diff --git a/0000Boot/0000Kernel.BIN.C b/0000Boot/0000Kernel.BIN.C index 6b39716..dcd686b 100644 Binary files a/0000Boot/0000Kernel.BIN.C and b/0000Boot/0000Kernel.BIN.C differ diff --git a/Adam/ABlkDev/ADskA.CPP b/Adam/ABlkDev/ADskA.CPP deleted file mode 100644 index 31b2d5a..0000000 --- a/Adam/ABlkDev/ADskA.CPP +++ /dev/null @@ -1,252 +0,0 @@ -#help_index "File/Cmd Line (Typically);Cmd Line (Typically)" -public U8 *DBlk(I64 blk,Bool write=FALSE) -{//Dump disk block. Optionally, write. -//If you set write to TRUE, the block will - //be written when you press . - //See $LK,"::/Demo/Dsk/DskRaw.CPP"$. - U8 *buf=MAlloc(BLK_SIZE); - - RBlks(Fs->cur_dv,buf,blk,1); - DocD(buf,BLK_SIZE); - if (write) { - "Edit and press to write or \n"; - if (View) { - "Write\n"; - WBlks(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 - //be written when you press . - //See $LK,"::/Demo/Dsk/DskRaw.CPP"$. - //Do $LK,"Dir",A="MN:Dir"$("*",TRUE); to get cluster numbers of files. - U8 *buf=MAlloc(Fs->cur_dv->spc<cur_dv,c,num); - RClusters(Fs->cur_dv,buf,c,1); - "Cluster:%X\n",c; - DocD(buf,Fs->cur_dv->spc< to write or \n"; - if (View) { - "Write\n"; - WClusters(Fs->cur_dv,buf,c,1); - } - } - return buf; -} - -public U8 *Dump(U8 *filename,Bool write=FALSE) -{//Dump file. Optionally, write. -//If you set write to TRUE, the file will - //be written when you press . - U8 *buf; - I64 size; - if (buf=FileRead(filename,&size)) { - DocD(buf,size); - if (write) { - "Edit and press to write or \n"; - if (View) { - "Write\n"; - FileWrite(filename,buf,size); - } - } - } - return buf; -} - -public Bool Copy(U8 *src_files_find_mask,U8 *dst_files_find_mask=".") -{//Copy files. -//If the name ends in ".Z", it will - //be stored compressed. If not ".Z" - //it will be stored uncompressed. - Bool res=TRUE; - CDirContext *dirc; - CDirEntry *tempde,*tempde1; - U8 *st; - if (!(tempde1=FilesFind(src_files_find_mask,FUF_CLUSTER_ORDER))) - return FALSE; - if (IsDir(dst_files_find_mask)) { - if (dirc=DirContextNew(dst_files_find_mask,TRUE)) { - tempde=tempde1; - while (tempde) { - if (!(tempde->attr & RS_ATTR_DIR)) { - st=FileNameAbs(tempde->name); - if (!CopySingle(tempde->full_name,st)) - res=FALSE; - Free(st); - } - tempde=tempde->next; - } - DirContextDel(dirc); - } - DirTreeDel(tempde1); - return res; - } else { - DirTreeDel(tempde1); - return CopySingle(src_files_find_mask,dst_files_find_mask); - } -} - -public Bool Move(U8 *f1,U8 *f2) -{//Move files from one location to another or rename. - if (Copy(f1,f2)) { - Del(f1); - return TRUE; - } - return FALSE; -} - -I64 CopyTree2(CDirEntry *tempde,I64 src_dir_len,I64 dst_dir_len,U8 *dst_dir) -{ - U8 *st; - I64 res=1; - while (tempde) { - st=MAlloc(StrLen(tempde->full_name)+dst_dir_len+2); - MemCpy(st,dst_dir,dst_dir_len); - StrCpy(st+dst_dir_len,tempde->full_name+src_dir_len); - if (tempde->attr & RS_ATTR_DIR) { - MkDir(st,LinkedLstCnt(tempde->sub)); - res+=CopyTree2(tempde->sub,src_dir_len,dst_dir_len,dst_dir); - } else - if (CopySingle(tempde->full_name,st)) - res++; - Free(st); - tempde=tempde->next; - } - return res; -} -public I64 CopyTree(U8 *src_files_find_mask,U8 *dst_files_find_mask, - Bool no_mask=TRUE) -{//Copy directory tree. -//Returns the count of copied files (not dirs). - CDirContext *dirc; - CDirEntry *tempde=NULL; - I64 res=0,i1,i2; - U8 *st1,*st2; - - st1=DirNameAbs(src_files_find_mask); - st2=DirNameAbs(dst_files_find_mask); - i1=StrLen(st1); - if (!StrNCmp(st1,st2,i1) && (st2[i1]=='/' || !st2[i1]) ) { - Free(st1); - Free(st2); - return 0; - } - Free(st1); - Free(st2); - if (dirc=DirContextNew(src_files_find_mask,TRUE,,no_mask)) { - tempde=FilesFind(dirc->mask,FUF_RECURSE); - st1=CurDir; - DirContextDel(dirc); - i1=StrLen(st1); - if (i1==3) i1--; - if (dirc=DirContextNew(dst_files_find_mask,TRUE,TRUE)) { - st2=CurDir; - i2=StrLen(st2); - if (i2==3) i2--; - res=CopyTree2(tempde,i1,i2,st2); - DirContextDel(dirc); - Free(st2); - } - DirTreeDel(tempde); - Free(st1); - } - return res; -} - -I64 DelTreeDirs(CDirEntry *tempde1) -{ - I64 res=0; - CDirEntry *tempde2; - while (tempde1) { - tempde2=tempde1->next; - if (tempde1->attr & RS_ATTR_DIR) { - if (tempde1->sub) - res+=DelTreeDirs(tempde1->sub); - res+=Del(tempde1->full_name,TRUE,TRUE); - } - DirEntryDel(tempde1); - tempde1=tempde2; - } - return res; -} -I64 DelTreeFiles(CDirEntry *tempde1) -{ - I64 res=0; - CDirEntry *tempde2; - while (tempde1) { - tempde2=tempde1->next; - if (tempde1->attr & RS_ATTR_DIR) { - if (tempde1->sub) - res+=DelTreeFiles(tempde1->sub); - } else - res+=Del(tempde1->full_name,FALSE,TRUE); - DirEntryDel(tempde1); - tempde1=tempde2; - } - return res; -} -public I64 DelTree(U8 *files_find_mask,U8 *fu_flags=NULL) -{//Delete directory tree. - I64 res=0,fuf_flags=0; - ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r"); - ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); - if (IsDir(files_find_mask)) { - res=DelTreeDirs(FilesFind(files_find_mask,fuf_flags)); - res+=Del(files_find_mask,TRUE,TRUE); - res+=Del(files_find_mask,FALSE,TRUE); - } else - res=DelTreeFiles(FilesFind(files_find_mask,fuf_flags)); - return res; -} - -U0 TouchFile(U8 *filename,U8 *attr,CDate cdt=MIN_I64) -{ - CDrv *dv=Let2Drv(*filename); - CDirEntry de; - U8 *cur_dir=StrNew(filename),buf[STR_LEN]; - if (FileFind(filename,&de,FUF_JUST_FILES)) { - Free(de.full_name); - if (!StrCmp(attr,"+?")) - "%-48ts %s\n",filename,StrPrintFlags(buf,Define("ST_FILE_ATTRS"),de.attr); - else { - StrFirstRem(cur_dir,":"); - StrLastRem(cur_dir,"/"); - if (!*cur_dir) - StrCpy(cur_dir,"/"); - ScanFlags(&de.attr,Define("ST_FILE_ATTRS"),attr); - if (cdt==MIN_I64) - de.datetime=Now; - else - de.datetime=cdt; - DirNew(dv,cur_dir,&de,FALSE); - } - } else - PrintErr("File not found.\n"); - Free(cur_dir); -} -public U0 Touch(U8 *files_find_mask="*",U8 *attr="+?", - U8 *fu_flags=NULL,CDate cdt=MIN_I64) -{/*Touch file attributes and DateTime. -Default lists attributes. -attr: "+?" =show current -"+T" =resident -$LK,"RS_ATTR_READ_ONLY",A="MN:RS_ATTR_READ_ONLY"$ $LK,"ST_FILE_ATTRS",A="MN:ST_FILE_ATTRS"$ -To Set DateL: -Touch(filename,"",,datetime); -*/ - I64 fuf_flags=0; - CDirEntry *tempde,*tempde1; - ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+f+F"); - ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); - tempde=tempde1=FilesFind(files_find_mask,fuf_flags); - while (tempde) { - TouchFile(tempde->full_name,attr,cdt); - tempde=tempde->next; - } - DirTreeDel(tempde1); -} diff --git a/Adam/ABlkDev/ADskA.HC b/Adam/ABlkDev/ADskA.HC new file mode 100644 index 0000000..5352838 --- /dev/null +++ b/Adam/ABlkDev/ADskA.HC @@ -0,0 +1,252 @@ +#help_index "File/Cmd Line (Typically);Cmd Line (Typically)" +public U8 *DBlk(I64 blk,Bool write=FALSE) +{//Dump disk block. Optionally, write. +//If you set write to TRUE, the block will + //be written when you press . + //See $LK,"::/Demo/Dsk/DskRaw.HC"$. + U8 *buf=MAlloc(BLK_SIZE); + + RBlks(Fs->cur_dv,buf,blk,1); + DocD(buf,BLK_SIZE); + if (write) { + "Edit and press to write or \n"; + if (View) { + "Write\n"; + WBlks(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 + //be written when you press . + //See $LK,"::/Demo/Dsk/DskRaw.HC"$. + //Do $LK,"Dir",A="MN:Dir"$("*",TRUE); to get cluster numbers of files. + U8 *buf=MAlloc(Fs->cur_dv->spc<cur_dv,c,num); + RClusters(Fs->cur_dv,buf,c,1); + "Cluster:%X\n",c; + DocD(buf,Fs->cur_dv->spc< to write or \n"; + if (View) { + "Write\n"; + WClusters(Fs->cur_dv,buf,c,1); + } + } + return buf; +} + +public U8 *Dump(U8 *filename,Bool write=FALSE) +{//Dump file. Optionally, write. +//If you set write to TRUE, the file will + //be written when you press . + U8 *buf; + I64 size; + if (buf=FileRead(filename,&size)) { + DocD(buf,size); + if (write) { + "Edit and press to write or \n"; + if (View) { + "Write\n"; + FileWrite(filename,buf,size); + } + } + } + return buf; +} + +public Bool Copy(U8 *src_files_find_mask,U8 *dst_files_find_mask=".") +{//Copy files. +//If the name ends in ".Z", it will + //be stored compressed. If not ".Z" + //it will be stored uncompressed. + Bool res=TRUE; + CDirContext *dirc; + CDirEntry *tempde,*tempde1; + U8 *st; + if (!(tempde1=FilesFind(src_files_find_mask,FUF_CLUSTER_ORDER))) + return FALSE; + if (IsDir(dst_files_find_mask)) { + if (dirc=DirContextNew(dst_files_find_mask,TRUE)) { + tempde=tempde1; + while (tempde) { + if (!(tempde->attr & RS_ATTR_DIR)) { + st=FileNameAbs(tempde->name); + if (!CopySingle(tempde->full_name,st)) + res=FALSE; + Free(st); + } + tempde=tempde->next; + } + DirContextDel(dirc); + } + DirTreeDel(tempde1); + return res; + } else { + DirTreeDel(tempde1); + return CopySingle(src_files_find_mask,dst_files_find_mask); + } +} + +public Bool Move(U8 *f1,U8 *f2) +{//Move files from one location to another or rename. + if (Copy(f1,f2)) { + Del(f1); + return TRUE; + } + return FALSE; +} + +I64 CopyTree2(CDirEntry *tempde,I64 src_dir_len,I64 dst_dir_len,U8 *dst_dir) +{ + U8 *st; + I64 res=1; + while (tempde) { + st=MAlloc(StrLen(tempde->full_name)+dst_dir_len+2); + MemCpy(st,dst_dir,dst_dir_len); + StrCpy(st+dst_dir_len,tempde->full_name+src_dir_len); + if (tempde->attr & RS_ATTR_DIR) { + MkDir(st,LinkedLstCnt(tempde->sub)); + res+=CopyTree2(tempde->sub,src_dir_len,dst_dir_len,dst_dir); + } else + if (CopySingle(tempde->full_name,st)) + res++; + Free(st); + tempde=tempde->next; + } + return res; +} +public I64 CopyTree(U8 *src_files_find_mask,U8 *dst_files_find_mask, + Bool no_mask=TRUE) +{//Copy directory tree. +//Returns the count of copied files (not dirs). + CDirContext *dirc; + CDirEntry *tempde=NULL; + I64 res=0,i1,i2; + U8 *st1,*st2; + + st1=DirNameAbs(src_files_find_mask); + st2=DirNameAbs(dst_files_find_mask); + i1=StrLen(st1); + if (!StrNCmp(st1,st2,i1) && (st2[i1]=='/' || !st2[i1]) ) { + Free(st1); + Free(st2); + return 0; + } + Free(st1); + Free(st2); + if (dirc=DirContextNew(src_files_find_mask,TRUE,,no_mask)) { + tempde=FilesFind(dirc->mask,FUF_RECURSE); + st1=CurDir; + DirContextDel(dirc); + i1=StrLen(st1); + if (i1==3) i1--; + if (dirc=DirContextNew(dst_files_find_mask,TRUE,TRUE)) { + st2=CurDir; + i2=StrLen(st2); + if (i2==3) i2--; + res=CopyTree2(tempde,i1,i2,st2); + DirContextDel(dirc); + Free(st2); + } + DirTreeDel(tempde); + Free(st1); + } + return res; +} + +I64 DelTreeDirs(CDirEntry *tempde1) +{ + I64 res=0; + CDirEntry *tempde2; + while (tempde1) { + tempde2=tempde1->next; + if (tempde1->attr & RS_ATTR_DIR) { + if (tempde1->sub) + res+=DelTreeDirs(tempde1->sub); + res+=Del(tempde1->full_name,TRUE,TRUE); + } + DirEntryDel(tempde1); + tempde1=tempde2; + } + return res; +} +I64 DelTreeFiles(CDirEntry *tempde1) +{ + I64 res=0; + CDirEntry *tempde2; + while (tempde1) { + tempde2=tempde1->next; + if (tempde1->attr & RS_ATTR_DIR) { + if (tempde1->sub) + res+=DelTreeFiles(tempde1->sub); + } else + res+=Del(tempde1->full_name,FALSE,TRUE); + DirEntryDel(tempde1); + tempde1=tempde2; + } + return res; +} +public I64 DelTree(U8 *files_find_mask,U8 *fu_flags=NULL) +{//Delete directory tree. + I64 res=0,fuf_flags=0; + ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r"); + ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); + if (IsDir(files_find_mask)) { + res=DelTreeDirs(FilesFind(files_find_mask,fuf_flags)); + res+=Del(files_find_mask,TRUE,TRUE); + res+=Del(files_find_mask,FALSE,TRUE); + } else + res=DelTreeFiles(FilesFind(files_find_mask,fuf_flags)); + return res; +} + +U0 TouchFile(U8 *filename,U8 *attr,CDate cdt=MIN_I64) +{ + CDrv *dv=Let2Drv(*filename); + CDirEntry de; + U8 *cur_dir=StrNew(filename),buf[STR_LEN]; + if (FileFind(filename,&de,FUF_JUST_FILES)) { + Free(de.full_name); + if (!StrCmp(attr,"+?")) + "%-48ts %s\n",filename,StrPrintFlags(buf,Define("ST_FILE_ATTRS"),de.attr); + else { + StrFirstRem(cur_dir,":"); + StrLastRem(cur_dir,"/"); + if (!*cur_dir) + StrCpy(cur_dir,"/"); + ScanFlags(&de.attr,Define("ST_FILE_ATTRS"),attr); + if (cdt==MIN_I64) + de.datetime=Now; + else + de.datetime=cdt; + DirNew(dv,cur_dir,&de,FALSE); + } + } else + PrintErr("File not found.\n"); + Free(cur_dir); +} +public U0 Touch(U8 *files_find_mask="*",U8 *attr="+?", + U8 *fu_flags=NULL,CDate cdt=MIN_I64) +{/*Touch file attributes and DateTime. +Default lists attributes. +attr: "+?" =show current +"+T" =resident +$LK,"RS_ATTR_READ_ONLY",A="MN:RS_ATTR_READ_ONLY"$ $LK,"ST_FILE_ATTRS",A="MN:ST_FILE_ATTRS"$ +To Set DateL: +Touch(filename,"",,datetime); +*/ + I64 fuf_flags=0; + CDirEntry *tempde,*tempde1; + ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+f+F"); + ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); + tempde=tempde1=FilesFind(files_find_mask,fuf_flags); + while (tempde) { + TouchFile(tempde->full_name,attr,cdt); + tempde=tempde->next; + } + DirTreeDel(tempde1); +} diff --git a/Adam/ABlkDev/ADskB.CPP b/Adam/ABlkDev/ADskB.HC similarity index 100% rename from Adam/ABlkDev/ADskB.CPP rename to Adam/ABlkDev/ADskB.HC diff --git a/Adam/ABlkDev/ChkDsk.CPP b/Adam/ABlkDev/ChkDsk.HC similarity index 100% rename from Adam/ABlkDev/ChkDsk.CPP rename to Adam/ABlkDev/ChkDsk.HC diff --git a/Adam/ABlkDev/FileMgr.CPP b/Adam/ABlkDev/FileMgr.CPP deleted file mode 100644 index a4fcf54..0000000 --- a/Adam/ABlkDev/FileMgr.CPP +++ /dev/null @@ -1,793 +0,0 @@ -#help_index "DolDoc/Output;StdOut/DolDoc" -U0 DirFileDoc(CDoc *doc,CDirEntry *tempde) -{ - while (tempde) { - if (tempde->attr & RS_ATTR_DIR) { - tempde->user_data=DocPrint(doc,"$$TR,\"%s\",U=0x%X$$",tempde->name,tempde); - DocPrint(doc,"\n$$ID,+2$$"); - if (tempde->sub) - DirFileDoc(doc,tempde->sub); - DocPrint(doc,"$$ID,-2$$"); - } else { - tempde->user_data=DocPrint(doc,"$$MU,\"%s\",U=0x%X$$",tempde->name,tempde); - DocPrint(doc,"\n"); - } - tempde=tempde->next; - } -} - -#help_index "File/Cmd Line (Typically);Cmd Line (Typically)" - -#define FM_NORMAL 0 -#define FM_PICK_FILE 1 -#define FM_PICK_DIR 2 - -class CFMUncollapsedLst -{ - CFMUncollapsedLst *next; - U8 *name; -}; - -CFMUncollapsedLst *FMCollectUncollapsedLst(CDoc *doc) -{ - CDocEntry *doc_e=doc->head.next; - CFMUncollapsedLst *res=NULL,*tempc; - CDirEntry *tempde; - while (doc_e!=doc) { - if (doc_e->type_u8==DOCT_TREE) { - if (!(doc_e->de_flags&DOCEF_CHECKED_COLLAPSED)) { - if (tempde=doc_e->user_data) { - tempc=MAlloc(sizeof(CFMUncollapsedLst)); - tempc->next=res; - res=tempc; - tempc->name=StrNew(tempde->full_name); - } - } - } - doc_e=doc_e->next; - } - return res; -} - -U0 FMMarkUncollapsed(CDoc *doc,CFMUncollapsedLst *tempc, - U8 *cur_entry,U8 *next_entry) -{ - CDocEntry *doc_e=doc->head.next; - CFMUncollapsedLst *tempc1; - CDirEntry *tempde; - while (doc_e!=doc) { - if (doc_e->type_u8==DOCT_TREE) { - tempde=doc_e->user_data; - tempc1=tempc; - while (tempc1) { - if (!StrCmp(tempc1->name,tempde->full_name)) { - doc_e->de_flags&=~DOCEF_CHECKED_COLLAPSED; - break; - } - tempc1=tempc1->next; - } - if (cur_entry) { - if (!StrNCmp(cur_entry,tempde->full_name,StrLen(tempde->full_name))) { - doc->cur_entry=doc_e; - if (StrLen(tempde->full_name)==StrLen(cur_entry)) - cur_entry=NULL; - } else if (next_entry) { - if (!StrNCmp(next_entry, - tempde->full_name,StrLen(tempde->full_name))) { - doc->cur_entry=doc_e; - if (StrLen(tempde->full_name)==StrLen(next_entry)) - cur_entry=NULL; - } - } - } - } else if (doc_e->type_u8==DOCT_MENU_VAL) { - tempde=doc_e->user_data; - if (cur_entry) { - if (!StrNCmp(cur_entry,tempde->full_name,StrLen(tempde->full_name))) { - doc->cur_entry=doc_e; - if (StrLen(tempde->full_name)==StrLen(cur_entry)) - cur_entry=NULL; - } else if (next_entry) { - if (!StrNCmp(next_entry, - tempde->full_name,StrLen(tempde->full_name))) { - doc->cur_entry=doc_e; - if (StrLen(tempde->full_name)==StrLen(next_entry)) - cur_entry=NULL; - } - } - } - } - doc_e=doc_e->next; - } -} - -U0 FMDelUncollapsedLst(CFMUncollapsedLst *tempc) -{ - CFMUncollapsedLst *tempc1; - while (tempc) { - tempc1=tempc->next; - Free(tempc->name); - Free(tempc); - tempc=tempc1; - } -} - -CDirEntry *FMRebuildDocDrv(U8 drv_let,CDoc *doc,CDirEntry **_head,Bool init) -{ - CDirEntry *tempde,*tempde1; - U8 *st; - tempde=CAlloc(sizeof(CDirEntry)); - tempde->full_name=MStrPrint("%C:/",drv_let); - tempde->attr=RS_ATTR_DIR; - st=MStrPrint("%c:/*",drv_let); - if (init) - tempde->sub=tempde1=FilesFind(st,FUF_RECURSE); - else - tempde1=NULL; - Free(st); - tempde->user_data=DocPrint(doc,"$$TR,\"%s\",U=0x%X$$",tempde->full_name,tempde); - tempde->next=*_head; - *_head=tempde; - DocPrint(doc,"\n$$ID,+2$$"); - DocBottom(doc); - if (init) { - DirFileDoc(doc,tempde1); - while (tempde1) { - tempde1->parent=tempde; - tempde1=tempde1->next; - } - } - DocPrint(doc,"$$ID,-2$$"); - return tempde; -} - -U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_head,I64 mode) -{ - CDrv *dv; - I64 i; - CDoc *doc=*_doc,*doc2=sys_clipboard_doc,*parent_doc; - CFMUncollapsedLst *tempc=NULL; - U8 *cur_entry=NULL,*next_entry=NULL; - CDocEntry *doc_ce; - CDirEntry *tempde,*tempde1,*cur_tree_entry; - if (!doc) - parent_doc=DocPut; - else { - parent_doc=doc->parent_doc; - Fs->put_doc=Fs->display_doc=NULL; - DocUnlock(doc); - WinMgrSync; - DocLock(doc); - cur_tree_entry=NULL; - doc_ce=doc->cur_entry; - if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL) - cur_tree_entry=doc_ce->user_data; - if (cur_tree_entry) - cur_entry=StrNew(cur_tree_entry->full_name); - tempde=NULL; - if (doc_ce!=doc) - doc_ce=doc_ce->next; - while (doc_ce!=doc) { - if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL) - tempde=doc_ce->user_data; - else - tempde=NULL; - if (tempde) { - tempde1=tempde->parent; - while (tempde1) { - if (tempde1==cur_tree_entry) { - tempde=NULL; - break; - } else - tempde1=tempde1->parent; - } - if (tempde) - break; - } - doc_ce=doc_ce->next; - } - if (tempde) - next_entry=StrNew(tempde->full_name); - - tempc=FMCollectUncollapsedLst(doc); - DocDel(doc); - } - if (*_head) { - DirTreeDel(*_head); - *_head=NULL; - } - doc=DocNew; - doc->desc='FileMan'; - doc->parent_doc=parent_doc; - doc->flags|=DOCF_FORM; - switch (mode) { - case FM_NORMAL: - DocPrint(doc,"$$PURPLE$$File Manager\n\n" - "$$LK,\"Click for Help\",A=\"FI:::/Doc/FileMgr.TXT\"$$\n\n"); - break; - case FM_PICK_FILE: - DocPrint(doc,"$$PURPLE$$Pick file and press \n\n"); - doc->flags|=DOCF_MIN_SIZE; - break; - case FM_PICK_DIR: - DocPrint(doc,"$$PURPLE$$Pick directory and press \n\n"); - doc->flags|=DOCF_MIN_SIZE; - break; - } - DocPrint(doc,"$$LTBLUE$$"); - for (i=0;ibd->type==BDT_ATAPI) { - if (dv->bd->flags&BDF_INITIALIZED) - tempde=FMRebuildDocDrv(Drv2Let(dv),doc,_head,TRUE); - else { - tempde=FMRebuildDocDrv(Drv2Let(dv),doc,_head,FALSE); - tempde->flags|=DEF_NOT_INITIALIZED; - } - } else if (dv->fs_type==FSt_REDSEA || dv->fs_type==FSt_FAT32) - FMRebuildDocDrv(Drv2Let(dv),doc,_head,TRUE); - } - DocTop(doc); - FMMarkUncollapsed(doc,tempc,cur_entry,next_entry); - DocCenter(doc); - DocRst(doc2,TRUE); - FMDelUncollapsedLst(tempc); - Free(cur_entry); - Free(next_entry); - *_doc=doc; - DocLock(doc); - Fs->put_doc=Fs->display_doc=doc; -} - -U0 FMRename(CDoc *doc) -{ - CEdFileName fn; - CDocEntry *doc_e=doc->cur_entry; - CDirEntry *tempde=NULL,*parent; - if (doc_e->type_u8==DOCT_MENU_VAL) { - tempde=doc_e->user_data; - if (parent=tempde->parent) { - Cd(parent->full_name); - StrCpy(fn.name,tempde->name); - if (DocForm(&fn)) { - Silent; - Move(tempde->name,fn.name); - Silent(OFF); - } - } - } else if (doc_e->type_u8==DOCT_TREE) { - tempde=doc_e->user_data; - if (parent=tempde->parent) { - Cd(parent->full_name); - StrCpy(fn.name,tempde->name); - if (DocForm(&fn)) { - if (StrCmp(tempde->name,fn.name)) { - Silent; - if (CopyTree(tempde->name,fn.name)) - DelTree(tempde->name); - Silent(OFF); - } - } - } - } -} - -U0 FMMkDir(CDoc *doc) -{ - CEdFileName fn; - CDocEntry *doc_e=doc->cur_entry; - CDirEntry *tempde=NULL,*parent; - *fn.name=0; - if (doc_e->type_u8==DOCT_MENU_VAL) { - tempde=doc_e->user_data; - if (parent=tempde->parent) { - Cd(parent->full_name); - if (DocForm(&fn)) { - Silent; - MkDir(fn.name); - Silent(OFF); - } - } - } else if (doc_e->type_u8==DOCT_TREE) { - tempde=doc_e->user_data; - Cd(tempde->full_name); - if (DocForm(&fn)) { - Silent; - MkDir(fn.name); - Silent(OFF); - } - } -} - -U0 FMDelete(CDoc *doc) -{ - U8 *st; - CDocEntry *doc_ce=doc->cur_entry; - CDirEntry *tempde; - if (doc_ce->type_u8==DOCT_MENU_VAL) { - tempde=doc_ce->user_data; - Silent; - st=MStrPrint("Delete: %s",tempde->full_name); - if (PopUpCancelOk(st)) - Del(tempde->full_name); - Free(st); - Silent(OFF); - } else if (doc_ce->type_u8==DOCT_TREE) { - tempde=doc_ce->user_data; - Silent; - st=MStrPrint("Delete: %s",tempde->full_name); - if (PopUpCancelOk(st)) - DelTree(tempde->full_name); - Free(st); - Silent(OFF); - } -} - -U0 FMChgDsk(CDoc *doc) -{ - CDocEntry *doc_ce=doc->cur_entry; - CDirEntry *tempde; - if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL) - tempde=doc_ce->user_data; - else - tempde=NULL; - if (tempde) { - while (tempde->parent) - tempde=tempde->parent; - Silent; - ChgDsk(*tempde->full_name); - Silent(OFF); - } -} - -U0 FMMountISO(CDoc *doc) -{ - CDocEntry *doc_ce=doc->cur_entry; - CDirEntry *tempde; - if (doc_ce->type_u8==DOCT_MENU_VAL && (tempde=doc_ce->user_data)) - MountFile(tempde->full_name); -} - -U0 FMUnmount(CDoc *doc) -{ - CDocEntry *doc_ce=doc->cur_entry; - CDirEntry *tempde; - I64 drv_let; - if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL) - tempde=doc_ce->user_data; - else - tempde=NULL; - if (tempde) { - while (tempde->parent) - tempde=tempde->parent; - drv_let=*tempde->full_name; - if (Let2BlkDev(drv_let)!=Let2BlkDev(':')) - Unmount(drv_let); - } -} - -U0 FMFmtDrv(CDoc *doc) -{ - CDocEntry *doc_ce=doc->cur_entry; - CDirEntry *tempde; - U8 *st=NULL; - if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL) - tempde=doc_ce->user_data; - else - tempde=NULL; - if (tempde) { - while (tempde->parent) - tempde=tempde->parent; - st=MStrPrint("Format Drive '%c'?\nAre You Sure?\n",*tempde->full_name); - if (PopUpCancelOk(st)) { - Silent; - Fmt(*tempde->full_name,,FALSE); - Silent(OFF); - } - } - Free(st); -} - -U0 FMMakeISO(CDoc *doc) -{ - CDocEntry *doc_ce=doc->cur_entry; - CDirEntry *tempde; - U8 *st; - if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL) - tempde=doc_ce->user_data; - else - tempde=NULL; - if (tempde) { - if (doc_ce->type_u8==DOCT_MENU_VAL) - tempde=tempde->parent; - if (tempde && *tempde->full_name) { - Silent; - if (tempde->full_name[StrLen(tempde->full_name)-1]=='/') - st=MStrPrint("%s*",tempde->full_name); - else - st=MStrPrint("%s/*",tempde->full_name); - ISO9660ISO(,st); - Free(st); - Silent(OFF); - } - } -} - -U0 FMBurnISO(CDoc *doc) -{ - CDocEntry *doc_ce=doc->cur_entry; - CDirEntry *tempde; - if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL) - tempde=doc_ce->user_data; - else - tempde=NULL; - if (tempde) { - while (tempde->parent) - tempde=tempde->parent; - Silent; - DVDImageWrite(*tempde->full_name); - Silent(OFF); - } -} - -U0 FMCopy(CDoc *doc) -{ - CDoc *doc2=sys_clipboard_doc; - U8 *st; - CDocEntry *doc_ce=doc->cur_entry,*doc_e; - CDirEntry *tempde,*tempde1=NULL,*tempde2; - Bool unlock_doc2=DocLock(doc2); - doc_e=doc2->head.next; - - tempde1=doc_ce->user_data; - if (doc_ce->type_u8==DOCT_MENU_VAL) - tempde1=tempde1->parent; - else if (doc_ce->type_u8!=DOCT_TREE) - tempde1=NULL; - if (tempde1) { - while (doc_e!=doc2) { - if (doc_e->type_u8==DOCT_MENU_VAL) { - tempde=doc_e->user_data; - tempde->flags|=DEF_PROCESSED; - tempde2=tempde->parent; - if (!tempde2 || !(tempde2->flags&DEF_PROCESSED)) { - Silent; - Copy(tempde->full_name,tempde1->full_name); - Silent(OFF); - } - } else if (doc_e->type_u8==DOCT_TREE) { - tempde=doc_e->user_data; - tempde->flags|=DEF_PROCESSED; - tempde2=tempde->parent; - if (!tempde2 || !(tempde2->flags&DEF_PROCESSED)) { - Silent; - if (*tempde1->name) - st=MStrPrint("%s/%s",tempde1->full_name,tempde->name); - else - st=MStrPrint("%s%s",tempde1->full_name,tempde->name); - CopyTree(tempde->full_name,st); - Free(st); - Silent(OFF); - } - } - doc_e=doc_e->next; - } - } - if (unlock_doc2) - DocUnlock(doc2); -} - -#define FMR_INCLUDE 0 -#define FMR_ADAM_INCLUDE 1 -#define FMR_DELETE 2 -#define FMR_RENAME 3 -#define FMR_MKDIR 4 -#define FMR_PLAIN 5 -#define FMR_PASTE 6 -#define FMR_CHG_DSK 7 -#define FMR_FORMAT 8 -#define FMR_MOUNT_ISO 9 -#define FMR_UNMOUNT 10 -#define FMR_MAKE_ISO 11 -#define FMR_BURN_ISO 12 -#define FMR_HELP 13 - -I64 PopUpFMRight(U8 *header=NULL,U8 *footer=NULL) -{ - I64 i; - CDoc *doc=DocNew; - if (header) DocPrint(doc,"%s",header); - DocPrint(doc,"$$CM+LX,1,1 $$$$BT,\"INCLUDE \",LE=FMR_INCLUDE$$" - "$$CM+LX,27,0$$$$BT,\"ADAM INCLUDE \",LE=FMR_ADAM_INCLUDE$$" - "$$CM+LX,1,3 $$$$BT,\"DELETE \",LE=FMR_DELETE$$" - "$$CM+LX,27,0$$$$BT,\"RENAME \",LE=FMR_RENAME$$" - "$$CM+LX,1,3 $$$$BT,\"MAKE DIRECTORY \",LE=FMR_MKDIR$$" - "$$CM+LX,27,0$$$$BT,\"PLAIN-TEXT EDIT \",LE=FMR_PLAIN$$" - "$$CM+LX,1,3 $$$$BT,\"PASTE CLIPBOARD FILES \",LE=FMR_PASTE$$" - "$$CM+LX,27,0$$$$BT,\"CHANGE DISK(MOUNT IT) \",LE=FMR_CHG_DSK$$" - "$$CM+LX,1,3 $$$$BT,\"FORMAT \",LE=FMR_FORMAT$$" - "$$CM+LX,1,3 $$$$BT,\"MOUNT ISO.C FILE \",LE=FMR_MOUNT_ISO$$" - "$$CM+LX,27,0$$$$BT,\"UNMOUNT \",LE=FMR_UNMOUNT$$" - "$$CM+LX,1,3 $$$$BT,\"MAKE ISO (CD/DVD) FILE\",LE=FMR_MAKE_ISO$$" - "$$CM+LX,27,0$$$$BT,\"BURN ISO (CD/DVD) FILE\",LE=FMR_BURN_ISO$$" - "$$CM+LX,1,3 $$$$BT,\"HELP \",LE=FMR_HELP$$" - "$$CM+LX,27,0$$$$BT,\"CANCEL \",LE=DOCM_CANCEL$$\n"); - if (footer) DocPrint(doc,"%s",footer); - i=PopUpMenu(doc); - DocDel(doc); - return i; -} - -U0 FMRightClick() -{ - switch (PopUpFMRight) { - case FMR_INCLUDE: - Msg(MSG_KEY_DOWN,0,0x3F0000003F); - break; - case FMR_ADAM_INCLUDE: - Msg(MSG_KEY_DOWN,0,0x23F0000023F); - break; - case FMR_DELETE: - Msg(MSG_KEY_DOWN,CH_CTRLY,0); - break; - case FMR_RENAME: - Msg(MSG_KEY_DOWN,'r',0); - break; - case FMR_MKDIR: - Msg(MSG_KEY_DOWN,'d',0); - break; - case FMR_PLAIN: - Msg(MSG_KEY_DOWN,CH_SHIFT_SPACE,0); - break; - case FMR_PASTE: - Msg(MSG_KEY_DOWN,0,SC_INS+SCF_SHIFT); - break; - case FMR_CHG_DSK: - Msg(MSG_KEY_DOWN,'m',0); - break; - case FMR_FORMAT: - Msg(MSG_KEY_DOWN,'f',0); - break; - case FMR_MOUNT_ISO: - Msg(MSG_KEY_DOWN,'i',0); - break; - case FMR_UNMOUNT: - Msg(MSG_KEY_DOWN,'u',0); - break; - case FMR_MAKE_ISO: - Msg(MSG_KEY_DOWN,'M',0); - break; - case FMR_BURN_ISO: - Msg(MSG_KEY_DOWN,'B',0); - break; - case FMR_HELP: - Msg(MSG_KEY_DOWN,CH_CTRLM,0x43200000432); - break; - } -} - -U8 *fm_ip_str=NULL; -U0 (*fp_old_final_screen_update)(CDC *dc); - -U0 FMFinalScreenUpdate(CDC *dc) -{ - if (fm_ip_str) { - dc->color=LTRED; - GrPrint(dc,ip.pos.x,ip.pos.y,"%s",fm_ip_str); - } - (*fp_old_final_screen_update)(dc); -} - -public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL) -{//File manager. Also, used to choose files and dirs. - CDirEntry *head=NULL,*tempde,*tempde1,*tempde2; - I64 sc,ch,a1,a2,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; - Bool okay; - - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - fp_old_final_screen_update=gr.fp_final_screen_update; - MenuFilePush("::/Doc/FileMgrPullDown.TXT"); - FMRebuildDoc(&doc,&head,mode); - if (tempde1=Cd2DirEntry(head,old_cur_dir)) - doc->cur_entry=tempde1->user_data; - while (tempde1) { - if (tempde1->attr&RS_ATTR_DIR) - tempde1->user_data(CDocEntry *)->de_flags&=~DOCEF_CHECKED_COLLAPSED; - tempde1=tempde1->parent; - } - do { - DocUnlock(doc); - do msg_code=GetMsg(&a1,&a2,1<cur_entry; - fm_ip_str=doc_ce->tag; - gr.fp_final_screen_update=&FMFinalScreenUpdate; - break; - case MSG_IP_L_UP: - if (doc_ce) { - gr.fp_final_screen_update=fp_old_final_screen_update; - if (WinCursorPosSet(Fs,a1+Fs->pix_left+Fs->scroll_x, - a2+Fs->pix_top+Fs->scroll_y,TRUE)) { - doc_e=doc->cur_entry; - if (doc_e!=doc_ce) { - st2=NULL; - if (doc_e->type_u8==DOCT_MENU_VAL) { - tempde1=doc_e->user_data; - if (tempde1=tempde1->parent) - st2=StrNew(tempde1->full_name); - } else if (doc_e->type_u8==DOCT_TREE) { - tempde1=doc_e->user_data; - st2=StrNew(tempde1->full_name); - } - if (st2 && doc_ce->type_u8==DOCT_MENU_VAL) { - tempde=doc_ce->user_data; - Silent; - Move(tempde->full_name,st2); - Silent(OFF); - FMRebuildDoc(&doc,&head,mode); - } else if (st2 && doc_ce->type_u8==DOCT_TREE) { - tempde=doc_ce->user_data; - okay=TRUE; - tempde2=tempde1; - while (tempde2) { - if (tempde2!=tempde) - tempde2=tempde2->parent; - else { - okay=FALSE; - break; - } - } - if (okay) { - if (*tempde1->name) - st=MStrPrint("%s/%s",tempde1->full_name,tempde->name); - else - st=MStrPrint("%s%s",tempde1->full_name,tempde->name); - if (StrCmp(tempde->full_name,st)) { - Silent; - CopyTree(tempde->full_name,st); - DelTree(tempde->full_name); - Silent(OFF); - FMRebuildDoc(&doc,&head,mode); - } - Free(st); - } - } - Free(st2); - FlushMsgs; - } else - if (doc_e->type_u8==DOCT_MENU_VAL) { - DocUnlock(doc); - Ed(doc_e->user_data(CDirEntry *)->full_name); - DocLock(doc); - } - doc_ce=NULL; - } - } - break; - case MSG_KEY_DOWN: - doc_ce=NULL; - ch=a1; sc=a2; - if (sc.u8[0]==SC_DELETE && !(sc&(SCF_SHIFT|SCF_CTRL))) - ch=CH_CTRLY; - if (ch && sc&SCF_ALT) goto fm_regular_key; - switch (ch) { - case '\n': - DocUnlock(doc); - FMRightClick; - DocLock(doc); - break; - start: - DocUnlock(doc); - case CH_CTRLV: - FMCopy(doc); - break; - case 'r': - FMRename(doc); - break; - case 'd': - FMMkDir(doc); - break; - case CH_CTRLY: - FMDelete(doc); - break; - case 'm': - FMChgDsk(doc); - break; - case 'i': - FMMountISO(doc); - break; - case 'u': - FMUnmount(doc); - break; - case 'M': - FMMakeISO(doc); - break; - case 'B': - FMBurnISO(doc); - break; - case 'f': - FMFmtDrv(doc); - break; - end: - FMRebuildDoc(&doc,&head,mode); - break; - case CH_SHIFT_ESC: - break; - case CH_SPACE: - if (doc->cur_entry->type_u8==DOCT_MENU_VAL) { - DocUnlock(doc); - Ed(doc->cur_entry->user_data(CDirEntry *)->full_name); - DocLock(doc); - } else - goto fm_regular_key; - break; - case CH_SHIFT_SPACE: - if (doc->cur_entry->type_u8==DOCT_MENU_VAL) { - DocUnlock(doc); - Plain(doc->cur_entry->user_data(CDirEntry *)->full_name); - DocLock(doc); - } else - goto fm_regular_key; - break; - case CH_ESC: - doc_ce=doc->cur_entry; - tempde=doc_ce->user_data; - if (mode==FM_PICK_FILE && doc_ce->type_u8==DOCT_MENU_VAL) - res=StrNew(tempde->full_name,mem_task); - else if (mode==FM_PICK_DIR) { - if (doc_ce->type_u8==DOCT_TREE) - res=StrNew(tempde->full_name,mem_task); - else if (doc_ce->type_u8==DOCT_MENU_VAL && - (tempde=tempde->parent)) - res=StrNew(tempde->full_name,mem_task); - } - break; - default: - if (sc.u8[0]==SC_INS && sc&SCF_SHIFT && !(sc&SCF_CTRL)) { - FMCopy(doc); - FMRebuildDoc(&doc,&head,mode); - } else if (sc.u8[0]==SC_F5) { - if (doc->cur_entry->type_u8==DOCT_MENU_VAL) { - tempde=doc->cur_entry->user_data; - DocUnlock(doc); - if (sc&SCF_SHIFT) - AdamFile(tempde->full_name); - else - PopUpFile(tempde->full_name); - DocLock(doc); - } - } else { -fm_regular_key: - DocUnlock(doc); - PutKey(ch,sc); - DocLock(doc); - } - } - break; - } - } while (ch!=CH_ESC && ch!=CH_SHIFT_ESC); - gr.fp_final_screen_update=fp_old_final_screen_update; - Fs->put_doc =old_put_doc; - Fs->display_doc=old_display_doc; - SettingsPop; - DocDel(doc); - DirTreeDel(head); - Cd(old_cur_dir); - Free(old_cur_dir); - if (mode!=FM_NORMAL && !res) - res=StrNew("",mem_task); - MenuPop; - return res; -} diff --git a/Adam/ABlkDev/FileMgr.HC b/Adam/ABlkDev/FileMgr.HC new file mode 100644 index 0000000..071319e --- /dev/null +++ b/Adam/ABlkDev/FileMgr.HC @@ -0,0 +1,793 @@ +#help_index "DolDoc/Output;StdOut/DolDoc" +U0 DirFileDoc(CDoc *doc,CDirEntry *tempde) +{ + while (tempde) { + if (tempde->attr & RS_ATTR_DIR) { + tempde->user_data=DocPrint(doc,"$$TR,\"%s\",U=0x%X$$",tempde->name,tempde); + DocPrint(doc,"\n$$ID,+2$$"); + if (tempde->sub) + DirFileDoc(doc,tempde->sub); + DocPrint(doc,"$$ID,-2$$"); + } else { + tempde->user_data=DocPrint(doc,"$$MU,\"%s\",U=0x%X$$",tempde->name,tempde); + DocPrint(doc,"\n"); + } + tempde=tempde->next; + } +} + +#help_index "File/Cmd Line (Typically);Cmd Line (Typically)" + +#define FM_NORMAL 0 +#define FM_PICK_FILE 1 +#define FM_PICK_DIR 2 + +class CFMUncollapsedLst +{ + CFMUncollapsedLst *next; + U8 *name; +}; + +CFMUncollapsedLst *FMCollectUncollapsedLst(CDoc *doc) +{ + CDocEntry *doc_e=doc->head.next; + CFMUncollapsedLst *res=NULL,*tempc; + CDirEntry *tempde; + while (doc_e!=doc) { + if (doc_e->type_u8==DOCT_TREE) { + if (!(doc_e->de_flags&DOCEF_CHECKED_COLLAPSED)) { + if (tempde=doc_e->user_data) { + tempc=MAlloc(sizeof(CFMUncollapsedLst)); + tempc->next=res; + res=tempc; + tempc->name=StrNew(tempde->full_name); + } + } + } + doc_e=doc_e->next; + } + return res; +} + +U0 FMMarkUncollapsed(CDoc *doc,CFMUncollapsedLst *tempc, + U8 *cur_entry,U8 *next_entry) +{ + CDocEntry *doc_e=doc->head.next; + CFMUncollapsedLst *tempc1; + CDirEntry *tempde; + while (doc_e!=doc) { + if (doc_e->type_u8==DOCT_TREE) { + tempde=doc_e->user_data; + tempc1=tempc; + while (tempc1) { + if (!StrCmp(tempc1->name,tempde->full_name)) { + doc_e->de_flags&=~DOCEF_CHECKED_COLLAPSED; + break; + } + tempc1=tempc1->next; + } + if (cur_entry) { + if (!StrNCmp(cur_entry,tempde->full_name,StrLen(tempde->full_name))) { + doc->cur_entry=doc_e; + if (StrLen(tempde->full_name)==StrLen(cur_entry)) + cur_entry=NULL; + } else if (next_entry) { + if (!StrNCmp(next_entry, + tempde->full_name,StrLen(tempde->full_name))) { + doc->cur_entry=doc_e; + if (StrLen(tempde->full_name)==StrLen(next_entry)) + cur_entry=NULL; + } + } + } + } else if (doc_e->type_u8==DOCT_MENU_VAL) { + tempde=doc_e->user_data; + if (cur_entry) { + if (!StrNCmp(cur_entry,tempde->full_name,StrLen(tempde->full_name))) { + doc->cur_entry=doc_e; + if (StrLen(tempde->full_name)==StrLen(cur_entry)) + cur_entry=NULL; + } else if (next_entry) { + if (!StrNCmp(next_entry, + tempde->full_name,StrLen(tempde->full_name))) { + doc->cur_entry=doc_e; + if (StrLen(tempde->full_name)==StrLen(next_entry)) + cur_entry=NULL; + } + } + } + } + doc_e=doc_e->next; + } +} + +U0 FMDelUncollapsedLst(CFMUncollapsedLst *tempc) +{ + CFMUncollapsedLst *tempc1; + while (tempc) { + tempc1=tempc->next; + Free(tempc->name); + Free(tempc); + tempc=tempc1; + } +} + +CDirEntry *FMRebuildDocDrv(U8 drv_let,CDoc *doc,CDirEntry **_head,Bool init) +{ + CDirEntry *tempde,*tempde1; + U8 *st; + tempde=CAlloc(sizeof(CDirEntry)); + tempde->full_name=MStrPrint("%C:/",drv_let); + tempde->attr=RS_ATTR_DIR; + st=MStrPrint("%c:/*",drv_let); + if (init) + tempde->sub=tempde1=FilesFind(st,FUF_RECURSE); + else + tempde1=NULL; + Free(st); + tempde->user_data=DocPrint(doc,"$$TR,\"%s\",U=0x%X$$",tempde->full_name,tempde); + tempde->next=*_head; + *_head=tempde; + DocPrint(doc,"\n$$ID,+2$$"); + DocBottom(doc); + if (init) { + DirFileDoc(doc,tempde1); + while (tempde1) { + tempde1->parent=tempde; + tempde1=tempde1->next; + } + } + DocPrint(doc,"$$ID,-2$$"); + return tempde; +} + +U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_head,I64 mode) +{ + CDrv *dv; + I64 i; + CDoc *doc=*_doc,*doc2=sys_clipboard_doc,*parent_doc; + CFMUncollapsedLst *tempc=NULL; + U8 *cur_entry=NULL,*next_entry=NULL; + CDocEntry *doc_ce; + CDirEntry *tempde,*tempde1,*cur_tree_entry; + if (!doc) + parent_doc=DocPut; + else { + parent_doc=doc->parent_doc; + Fs->put_doc=Fs->display_doc=NULL; + DocUnlock(doc); + WinMgrSync; + DocLock(doc); + cur_tree_entry=NULL; + doc_ce=doc->cur_entry; + if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL) + cur_tree_entry=doc_ce->user_data; + if (cur_tree_entry) + cur_entry=StrNew(cur_tree_entry->full_name); + tempde=NULL; + if (doc_ce!=doc) + doc_ce=doc_ce->next; + while (doc_ce!=doc) { + if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL) + tempde=doc_ce->user_data; + else + tempde=NULL; + if (tempde) { + tempde1=tempde->parent; + while (tempde1) { + if (tempde1==cur_tree_entry) { + tempde=NULL; + break; + } else + tempde1=tempde1->parent; + } + if (tempde) + break; + } + doc_ce=doc_ce->next; + } + if (tempde) + next_entry=StrNew(tempde->full_name); + + tempc=FMCollectUncollapsedLst(doc); + DocDel(doc); + } + if (*_head) { + DirTreeDel(*_head); + *_head=NULL; + } + doc=DocNew; + doc->desc='FileMan'; + doc->parent_doc=parent_doc; + doc->flags|=DOCF_FORM; + switch (mode) { + case FM_NORMAL: + DocPrint(doc,"$$PURPLE$$File Manager\n\n" + "$$LK,\"Click for Help\",A=\"FI:::/Doc/FileMgr.DD\"$$\n\n"); + break; + case FM_PICK_FILE: + DocPrint(doc,"$$PURPLE$$Pick file and press \n\n"); + doc->flags|=DOCF_MIN_SIZE; + break; + case FM_PICK_DIR: + DocPrint(doc,"$$PURPLE$$Pick directory and press \n\n"); + doc->flags|=DOCF_MIN_SIZE; + break; + } + DocPrint(doc,"$$LTBLUE$$"); + for (i=0;ibd->type==BDT_ATAPI) { + if (dv->bd->flags&BDF_INITIALIZED) + tempde=FMRebuildDocDrv(Drv2Let(dv),doc,_head,TRUE); + else { + tempde=FMRebuildDocDrv(Drv2Let(dv),doc,_head,FALSE); + tempde->flags|=DEF_NOT_INITIALIZED; + } + } else if (dv->fs_type==FSt_REDSEA || dv->fs_type==FSt_FAT32) + FMRebuildDocDrv(Drv2Let(dv),doc,_head,TRUE); + } + DocTop(doc); + FMMarkUncollapsed(doc,tempc,cur_entry,next_entry); + DocCenter(doc); + DocRst(doc2,TRUE); + FMDelUncollapsedLst(tempc); + Free(cur_entry); + Free(next_entry); + *_doc=doc; + DocLock(doc); + Fs->put_doc=Fs->display_doc=doc; +} + +U0 FMRename(CDoc *doc) +{ + CEdFileName fn; + CDocEntry *doc_e=doc->cur_entry; + CDirEntry *tempde=NULL,*parent; + if (doc_e->type_u8==DOCT_MENU_VAL) { + tempde=doc_e->user_data; + if (parent=tempde->parent) { + Cd(parent->full_name); + StrCpy(fn.name,tempde->name); + if (DocForm(&fn)) { + Silent; + Move(tempde->name,fn.name); + Silent(OFF); + } + } + } else if (doc_e->type_u8==DOCT_TREE) { + tempde=doc_e->user_data; + if (parent=tempde->parent) { + Cd(parent->full_name); + StrCpy(fn.name,tempde->name); + if (DocForm(&fn)) { + if (StrCmp(tempde->name,fn.name)) { + Silent; + if (CopyTree(tempde->name,fn.name)) + DelTree(tempde->name); + Silent(OFF); + } + } + } + } +} + +U0 FMMkDir(CDoc *doc) +{ + CEdFileName fn; + CDocEntry *doc_e=doc->cur_entry; + CDirEntry *tempde=NULL,*parent; + *fn.name=0; + if (doc_e->type_u8==DOCT_MENU_VAL) { + tempde=doc_e->user_data; + if (parent=tempde->parent) { + Cd(parent->full_name); + if (DocForm(&fn)) { + Silent; + MkDir(fn.name); + Silent(OFF); + } + } + } else if (doc_e->type_u8==DOCT_TREE) { + tempde=doc_e->user_data; + Cd(tempde->full_name); + if (DocForm(&fn)) { + Silent; + MkDir(fn.name); + Silent(OFF); + } + } +} + +U0 FMDelete(CDoc *doc) +{ + U8 *st; + CDocEntry *doc_ce=doc->cur_entry; + CDirEntry *tempde; + if (doc_ce->type_u8==DOCT_MENU_VAL) { + tempde=doc_ce->user_data; + Silent; + st=MStrPrint("Delete: %s",tempde->full_name); + if (PopUpCancelOk(st)) + Del(tempde->full_name); + Free(st); + Silent(OFF); + } else if (doc_ce->type_u8==DOCT_TREE) { + tempde=doc_ce->user_data; + Silent; + st=MStrPrint("Delete: %s",tempde->full_name); + if (PopUpCancelOk(st)) + DelTree(tempde->full_name); + Free(st); + Silent(OFF); + } +} + +U0 FMChgDsk(CDoc *doc) +{ + CDocEntry *doc_ce=doc->cur_entry; + CDirEntry *tempde; + if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL) + tempde=doc_ce->user_data; + else + tempde=NULL; + if (tempde) { + while (tempde->parent) + tempde=tempde->parent; + Silent; + ChgDsk(*tempde->full_name); + Silent(OFF); + } +} + +U0 FMMountISO(CDoc *doc) +{ + CDocEntry *doc_ce=doc->cur_entry; + CDirEntry *tempde; + if (doc_ce->type_u8==DOCT_MENU_VAL && (tempde=doc_ce->user_data)) + MountFile(tempde->full_name); +} + +U0 FMUnmount(CDoc *doc) +{ + CDocEntry *doc_ce=doc->cur_entry; + CDirEntry *tempde; + I64 drv_let; + if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL) + tempde=doc_ce->user_data; + else + tempde=NULL; + if (tempde) { + while (tempde->parent) + tempde=tempde->parent; + drv_let=*tempde->full_name; + if (Let2BlkDev(drv_let)!=Let2BlkDev(':')) + Unmount(drv_let); + } +} + +U0 FMFmtDrv(CDoc *doc) +{ + CDocEntry *doc_ce=doc->cur_entry; + CDirEntry *tempde; + U8 *st=NULL; + if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL) + tempde=doc_ce->user_data; + else + tempde=NULL; + if (tempde) { + while (tempde->parent) + tempde=tempde->parent; + st=MStrPrint("Format Drive '%c'?\nAre You Sure?\n",*tempde->full_name); + if (PopUpCancelOk(st)) { + Silent; + Fmt(*tempde->full_name,,FALSE); + Silent(OFF); + } + } + Free(st); +} + +U0 FMMakeISO(CDoc *doc) +{ + CDocEntry *doc_ce=doc->cur_entry; + CDirEntry *tempde; + U8 *st; + if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL) + tempde=doc_ce->user_data; + else + tempde=NULL; + if (tempde) { + if (doc_ce->type_u8==DOCT_MENU_VAL) + tempde=tempde->parent; + if (tempde && *tempde->full_name) { + Silent; + if (tempde->full_name[StrLen(tempde->full_name)-1]=='/') + st=MStrPrint("%s*",tempde->full_name); + else + st=MStrPrint("%s/*",tempde->full_name); + ISO9660ISO(,st); + Free(st); + Silent(OFF); + } + } +} + +U0 FMBurnISO(CDoc *doc) +{ + CDocEntry *doc_ce=doc->cur_entry; + CDirEntry *tempde; + if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL) + tempde=doc_ce->user_data; + else + tempde=NULL; + if (tempde) { + while (tempde->parent) + tempde=tempde->parent; + Silent; + DVDImageWrite(*tempde->full_name); + Silent(OFF); + } +} + +U0 FMCopy(CDoc *doc) +{ + CDoc *doc2=sys_clipboard_doc; + U8 *st; + CDocEntry *doc_ce=doc->cur_entry,*doc_e; + CDirEntry *tempde,*tempde1=NULL,*tempde2; + Bool unlock_doc2=DocLock(doc2); + doc_e=doc2->head.next; + + tempde1=doc_ce->user_data; + if (doc_ce->type_u8==DOCT_MENU_VAL) + tempde1=tempde1->parent; + else if (doc_ce->type_u8!=DOCT_TREE) + tempde1=NULL; + if (tempde1) { + while (doc_e!=doc2) { + if (doc_e->type_u8==DOCT_MENU_VAL) { + tempde=doc_e->user_data; + tempde->flags|=DEF_PROCESSED; + tempde2=tempde->parent; + if (!tempde2 || !(tempde2->flags&DEF_PROCESSED)) { + Silent; + Copy(tempde->full_name,tempde1->full_name); + Silent(OFF); + } + } else if (doc_e->type_u8==DOCT_TREE) { + tempde=doc_e->user_data; + tempde->flags|=DEF_PROCESSED; + tempde2=tempde->parent; + if (!tempde2 || !(tempde2->flags&DEF_PROCESSED)) { + Silent; + if (*tempde1->name) + st=MStrPrint("%s/%s",tempde1->full_name,tempde->name); + else + st=MStrPrint("%s%s",tempde1->full_name,tempde->name); + CopyTree(tempde->full_name,st); + Free(st); + Silent(OFF); + } + } + doc_e=doc_e->next; + } + } + if (unlock_doc2) + DocUnlock(doc2); +} + +#define FMR_INCLUDE 0 +#define FMR_ADAM_INCLUDE 1 +#define FMR_DELETE 2 +#define FMR_RENAME 3 +#define FMR_MKDIR 4 +#define FMR_PLAIN 5 +#define FMR_PASTE 6 +#define FMR_CHG_DSK 7 +#define FMR_FORMAT 8 +#define FMR_MOUNT_ISO 9 +#define FMR_UNMOUNT 10 +#define FMR_MAKE_ISO 11 +#define FMR_BURN_ISO 12 +#define FMR_HELP 13 + +I64 PopUpFMRight(U8 *header=NULL,U8 *footer=NULL) +{ + I64 i; + CDoc *doc=DocNew; + if (header) DocPrint(doc,"%s",header); + DocPrint(doc,"$$CM+LX,1,1 $$$$BT,\"INCLUDE \",LE=FMR_INCLUDE$$" + "$$CM+LX,27,0$$$$BT,\"ADAM INCLUDE \",LE=FMR_ADAM_INCLUDE$$" + "$$CM+LX,1,3 $$$$BT,\"DELETE \",LE=FMR_DELETE$$" + "$$CM+LX,27,0$$$$BT,\"RENAME \",LE=FMR_RENAME$$" + "$$CM+LX,1,3 $$$$BT,\"MAKE DIRECTORY \",LE=FMR_MKDIR$$" + "$$CM+LX,27,0$$$$BT,\"PLAIN-TEXT EDIT \",LE=FMR_PLAIN$$" + "$$CM+LX,1,3 $$$$BT,\"PASTE CLIPBOARD FILES \",LE=FMR_PASTE$$" + "$$CM+LX,27,0$$$$BT,\"CHANGE DISK(MOUNT IT) \",LE=FMR_CHG_DSK$$" + "$$CM+LX,1,3 $$$$BT,\"FORMAT \",LE=FMR_FORMAT$$" + "$$CM+LX,1,3 $$$$BT,\"MOUNT ISO.C FILE \",LE=FMR_MOUNT_ISO$$" + "$$CM+LX,27,0$$$$BT,\"UNMOUNT \",LE=FMR_UNMOUNT$$" + "$$CM+LX,1,3 $$$$BT,\"MAKE ISO (CD/DVD) FILE\",LE=FMR_MAKE_ISO$$" + "$$CM+LX,27,0$$$$BT,\"BURN ISO (CD/DVD) FILE\",LE=FMR_BURN_ISO$$" + "$$CM+LX,1,3 $$$$BT,\"HELP \",LE=FMR_HELP$$" + "$$CM+LX,27,0$$$$BT,\"CANCEL \",LE=DOCM_CANCEL$$\n"); + if (footer) DocPrint(doc,"%s",footer); + i=PopUpMenu(doc); + DocDel(doc); + return i; +} + +U0 FMRightClick() +{ + switch (PopUpFMRight) { + case FMR_INCLUDE: + Msg(MSG_KEY_DOWN,0,0x3F0000003F); + break; + case FMR_ADAM_INCLUDE: + Msg(MSG_KEY_DOWN,0,0x23F0000023F); + break; + case FMR_DELETE: + Msg(MSG_KEY_DOWN,CH_CTRLY,0); + break; + case FMR_RENAME: + Msg(MSG_KEY_DOWN,'r',0); + break; + case FMR_MKDIR: + Msg(MSG_KEY_DOWN,'d',0); + break; + case FMR_PLAIN: + Msg(MSG_KEY_DOWN,CH_SHIFT_SPACE,0); + break; + case FMR_PASTE: + Msg(MSG_KEY_DOWN,0,SC_INS+SCF_SHIFT); + break; + case FMR_CHG_DSK: + Msg(MSG_KEY_DOWN,'m',0); + break; + case FMR_FORMAT: + Msg(MSG_KEY_DOWN,'f',0); + break; + case FMR_MOUNT_ISO: + Msg(MSG_KEY_DOWN,'i',0); + break; + case FMR_UNMOUNT: + Msg(MSG_KEY_DOWN,'u',0); + break; + case FMR_MAKE_ISO: + Msg(MSG_KEY_DOWN,'M',0); + break; + case FMR_BURN_ISO: + Msg(MSG_KEY_DOWN,'B',0); + break; + case FMR_HELP: + Msg(MSG_KEY_DOWN,CH_CTRLM,0x43200000432); + break; + } +} + +U8 *fm_ip_str=NULL; +U0 (*fp_old_final_screen_update)(CDC *dc); + +U0 FMFinalScreenUpdate(CDC *dc) +{ + if (fm_ip_str) { + dc->color=LTRED; + GrPrint(dc,ip.pos.x,ip.pos.y,"%s",fm_ip_str); + } + (*fp_old_final_screen_update)(dc); +} + +public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL) +{//File manager. Also, used to choose files and dirs. + CDirEntry *head=NULL,*tempde,*tempde1,*tempde2; + I64 sc,ch,a1,a2,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; + Bool okay; + + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + fp_old_final_screen_update=gr.fp_final_screen_update; + MenuFilePush("::/Doc/FileMgrPullDown.DD"); + FMRebuildDoc(&doc,&head,mode); + if (tempde1=Cd2DirEntry(head,old_cur_dir)) + doc->cur_entry=tempde1->user_data; + while (tempde1) { + if (tempde1->attr&RS_ATTR_DIR) + tempde1->user_data(CDocEntry *)->de_flags&=~DOCEF_CHECKED_COLLAPSED; + tempde1=tempde1->parent; + } + do { + DocUnlock(doc); + do msg_code=GetMsg(&a1,&a2,1<cur_entry; + fm_ip_str=doc_ce->tag; + gr.fp_final_screen_update=&FMFinalScreenUpdate; + break; + case MSG_IP_L_UP: + if (doc_ce) { + gr.fp_final_screen_update=fp_old_final_screen_update; + if (WinCursorPosSet(Fs,a1+Fs->pix_left+Fs->scroll_x, + a2+Fs->pix_top+Fs->scroll_y,TRUE)) { + doc_e=doc->cur_entry; + if (doc_e!=doc_ce) { + st2=NULL; + if (doc_e->type_u8==DOCT_MENU_VAL) { + tempde1=doc_e->user_data; + if (tempde1=tempde1->parent) + st2=StrNew(tempde1->full_name); + } else if (doc_e->type_u8==DOCT_TREE) { + tempde1=doc_e->user_data; + st2=StrNew(tempde1->full_name); + } + if (st2 && doc_ce->type_u8==DOCT_MENU_VAL) { + tempde=doc_ce->user_data; + Silent; + Move(tempde->full_name,st2); + Silent(OFF); + FMRebuildDoc(&doc,&head,mode); + } else if (st2 && doc_ce->type_u8==DOCT_TREE) { + tempde=doc_ce->user_data; + okay=TRUE; + tempde2=tempde1; + while (tempde2) { + if (tempde2!=tempde) + tempde2=tempde2->parent; + else { + okay=FALSE; + break; + } + } + if (okay) { + if (*tempde1->name) + st=MStrPrint("%s/%s",tempde1->full_name,tempde->name); + else + st=MStrPrint("%s%s",tempde1->full_name,tempde->name); + if (StrCmp(tempde->full_name,st)) { + Silent; + CopyTree(tempde->full_name,st); + DelTree(tempde->full_name); + Silent(OFF); + FMRebuildDoc(&doc,&head,mode); + } + Free(st); + } + } + Free(st2); + FlushMsgs; + } else + if (doc_e->type_u8==DOCT_MENU_VAL) { + DocUnlock(doc); + Ed(doc_e->user_data(CDirEntry *)->full_name); + DocLock(doc); + } + doc_ce=NULL; + } + } + break; + case MSG_KEY_DOWN: + doc_ce=NULL; + ch=a1; sc=a2; + if (sc.u8[0]==SC_DELETE && !(sc&(SCF_SHIFT|SCF_CTRL))) + ch=CH_CTRLY; + if (ch && sc&SCF_ALT) goto fm_regular_key; + switch (ch) { + case '\n': + DocUnlock(doc); + FMRightClick; + DocLock(doc); + break; + start: + DocUnlock(doc); + case CH_CTRLV: + FMCopy(doc); + break; + case 'r': + FMRename(doc); + break; + case 'd': + FMMkDir(doc); + break; + case CH_CTRLY: + FMDelete(doc); + break; + case 'm': + FMChgDsk(doc); + break; + case 'i': + FMMountISO(doc); + break; + case 'u': + FMUnmount(doc); + break; + case 'M': + FMMakeISO(doc); + break; + case 'B': + FMBurnISO(doc); + break; + case 'f': + FMFmtDrv(doc); + break; + end: + FMRebuildDoc(&doc,&head,mode); + break; + case CH_SHIFT_ESC: + break; + case CH_SPACE: + if (doc->cur_entry->type_u8==DOCT_MENU_VAL) { + DocUnlock(doc); + Ed(doc->cur_entry->user_data(CDirEntry *)->full_name); + DocLock(doc); + } else + goto fm_regular_key; + break; + case CH_SHIFT_SPACE: + if (doc->cur_entry->type_u8==DOCT_MENU_VAL) { + DocUnlock(doc); + Plain(doc->cur_entry->user_data(CDirEntry *)->full_name); + DocLock(doc); + } else + goto fm_regular_key; + break; + case CH_ESC: + doc_ce=doc->cur_entry; + tempde=doc_ce->user_data; + if (mode==FM_PICK_FILE && doc_ce->type_u8==DOCT_MENU_VAL) + res=StrNew(tempde->full_name,mem_task); + else if (mode==FM_PICK_DIR) { + if (doc_ce->type_u8==DOCT_TREE) + res=StrNew(tempde->full_name,mem_task); + else if (doc_ce->type_u8==DOCT_MENU_VAL && + (tempde=tempde->parent)) + res=StrNew(tempde->full_name,mem_task); + } + break; + default: + if (sc.u8[0]==SC_INS && sc&SCF_SHIFT && !(sc&SCF_CTRL)) { + FMCopy(doc); + FMRebuildDoc(&doc,&head,mode); + } else if (sc.u8[0]==SC_F5) { + if (doc->cur_entry->type_u8==DOCT_MENU_VAL) { + tempde=doc->cur_entry->user_data; + DocUnlock(doc); + if (sc&SCF_SHIFT) + AdamFile(tempde->full_name); + else + PopUpFile(tempde->full_name); + DocLock(doc); + } + } else { +fm_regular_key: + DocUnlock(doc); + PutKey(ch,sc); + DocLock(doc); + } + } + break; + } + } while (ch!=CH_ESC && ch!=CH_SHIFT_ESC); + gr.fp_final_screen_update=fp_old_final_screen_update; + Fs->put_doc =old_put_doc; + Fs->display_doc=old_display_doc; + SettingsPop; + DocDel(doc); + DirTreeDel(head); + Cd(old_cur_dir); + Free(old_cur_dir); + if (mode!=FM_NORMAL && !res) + res=StrNew("",mem_task); + MenuPop; + return res; +} diff --git a/Adam/ABlkDev/MakeABlkDev.CPP b/Adam/ABlkDev/MakeABlkDev.HC similarity index 100% rename from Adam/ABlkDev/MakeABlkDev.CPP rename to Adam/ABlkDev/MakeABlkDev.HC diff --git a/Adam/ABlkDev/Mount.CPP b/Adam/ABlkDev/Mount.CPP deleted file mode 100644 index db45dca..0000000 --- a/Adam/ABlkDev/Mount.CPP +++ /dev/null @@ -1,148 +0,0 @@ -#help_index "Install;File/Cmd Line (Typically);Cmd Line (Typically);" -I64 Mount2(U8 boot_drv_let,CDoc *_doc,Bool repartition) -{//If _doc, called by $LK,"::/Kernel/KCfg.CPP"$ else called by $LK,"Mount",A="MN:Mount"$(). - I64 cnt,res=0,num_hints,drv_let,type,unit; - U8 blks_buf[STR_LEN],addr_buf[STR_LEN],base0_buf[STR_LEN],base1_buf[STR_LEN], - *filename=NULL,*filename2=NULL; - CATARep *head=NULL,*tempha; - Bool one_drv,make_free; - CDoc *doc; - boot_drv_let=ToUpper(boot_drv_let); - do { - cnt=0; - if (!_doc) - DrvRep; - "\n****** Mount Drives ******\n" - "$$GREEN$$A$$FG$$-$$GREEN$$B$$FG$$ are RAM drives.\n" - "$$GREEN$$C$$FG$$-$$GREEN$$L$$FG$$ are ATA hard drives.\n" - "$$GREEN$$M$$FG$$-$$GREEN$$P$$FG$$ are ISO file read drives.\n" - "$$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$$$$FG$$ to exit):"; - drv_let=ToUpper(GetChar); - '\n'; - if (type=Let2BlkDevType(drv_let)) { - one_drv=FALSE; - if (_doc) { //Called by $LK,"::/Kernel/KCfg.CPP"$ - doc=_doc; - make_free=FALSE; - } else { //Called by $LK,"Mount",A="MN:Mount"$() - doc=DocNew; - DocPrint(doc,"CBlkDev *bd;\n"); - make_free=TRUE; - } - unit=0; - switch (type) { - case BDT_RAM: - "Addr of RAM disk ($$PURPLE$$$$FG$$ to MAlloc):"; - GetS(addr_buf,STR_LEN); - case BDT_ISO_FILE_WRITE: - "Blks of 512 bytes:"; - GetS(blks_buf,STR_LEN); - break; - case BDT_ISO_FILE_READ: - filename=GetStr("File Name:"); - break; - case BDT_ATA: - case BDT_ATAPI: - num_hints=ATARep(,,&head); - if (type==BDT_ATAPI && boot_drv_let) - " to use booted CD/DVD\n"; //Only $LK,"::/Kernel/KCfg.CPP"$ - do { - if (num_hints) - "Enter dev number or\nport with $$PURPLE$$0x$$FG$$ prefix.\n" - "I/O Port Base0:\n"; - else - "Include $$PURPLE$$0x$$FG$$ prefix.\nI/O Port Base0:\n"; - GetS(base0_buf,STR_LEN); - } while (!Str2I64(base0_buf) && (type!=BDT_ATAPI || !boot_drv_let)); - if (1<=Str2I64(base0_buf)<=num_hints) { - tempha=ATARepFind(head,Str2I64(base0_buf)); - StrPrint(base0_buf,"0x%X",tempha->base0); - StrPrint(base1_buf,"0x%X",tempha->base1); - unit=tempha->unit; - } else if (type!=BDT_ATAPI || *base0_buf) { - if (type==BDT_ATAPI) - StrCpy(base1_buf,"0"); - else - do { - "I/O Port Base1:\n"; - GetS(base1_buf,STR_LEN); - } while (!Str2I64(base1_buf)); - do { - "\t$$PURPLE$$0$$FG$$=Master\n\t$$PURPLE$$1$$FG$$=Slave\nUnit:"; - unit=GetChar-'0'; - } while (!(0<=unit<=1)); - '\n'; - } - LinkedLstDel(head); - break; - } - DocPrint(doc,"bd=BlkDevNextFreeSlot(\'%C\',%d);bd->unit=%d;\n", - drv_let,type,unit); - switch (type) { - case BDT_RAM: - if (!*addr_buf) StrCpy(addr_buf,"0"); - DocPrint(doc,"bd->RAM_dsk=%s;\n",addr_buf); - case BDT_ISO_FILE_WRITE: - if (!*blks_buf) StrCpy(blks_buf,"0"); - DocPrint(doc,"bd->max_blk=(%s)-1;\n",blks_buf); - break; - case BDT_ISO_FILE_READ: - filename2=FileNameAbs(filename); - DocPrint(doc,"bd->file_dsk_name=AStrNew(\"%s\");\n",filename2); - DocPrint(doc,"bd->drv_offset=19<<2+" - "(DVD_BLK_SIZE*2+DVD_BOOT_LOADER_SIZE)/BLK_SIZE;\n"); - break; - case BDT_ATA: - case BDT_ATAPI: - if (type==BDT_ATAPI && !*base0_buf) { - DocPrint(doc,"GetBaseUnit(bd);\n"); //Only $LK,"::/Kernel/KCfg.CPP"$ - if (drv_let==boot_drv_let) - make_free=TRUE; - } else - DocPrint(doc,"bd->base0=%s;bd->base1=%s;\n",base0_buf,base1_buf); - if (type==BDT_ATA && repartition) { - "\nReformat WHOLE drive!"; - one_drv=YorN; - } - break; - } - DocPrint(doc,"BlkDevAdd(bd,%d,%d);\n",one_drv,make_free); - if (_doc) //Called by $LK,"::/Kernel/KCfg.CPP"$ - cnt++; - else { //Called by $LK,"Mount",A="MN:Mount"$() - if ((cnt=ExeDoc(doc)) && one_drv) - PrtDsk(drv_let); - DocDel(doc); - } - } - res+=cnt; - } while (cnt || !res && _doc); //At least 1 if Called by $LK,"::/Kernel/KCfg.CPP"$ - Free(filename); - Free(filename2); - return res; -} - -public I64 Mount(Bool repartition=FALSE) -{//Mount drives. - return Mount2(0,NULL,repartition); -} - -public U0 Unmount(U8 drv_let=0) -{//Unmount drive(s). - BlkDevDel(Let2BlkDev(drv_let)); -} - -public U8 MountFile(U8 *filename) -{//Mount ISO.C file. - U8 *filename2=DftExt(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; - bd->file_dsk_name=AStrNew(filename3); - BlkDevAdd(bd,TRUE,TRUE); - Free(filename3); - Free(filename2); - return dv->drv_let; -} diff --git a/Adam/ABlkDev/Mount.HC b/Adam/ABlkDev/Mount.HC new file mode 100644 index 0000000..1241ae5 --- /dev/null +++ b/Adam/ABlkDev/Mount.HC @@ -0,0 +1,148 @@ +#help_index "Install;File/Cmd Line (Typically);Cmd Line (Typically);" +I64 Mount2(U8 boot_drv_let,CDoc *_doc,Bool repartition) +{//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; + U8 blks_buf[STR_LEN],addr_buf[STR_LEN],base0_buf[STR_LEN],base1_buf[STR_LEN], + *filename=NULL,*filename2=NULL; + CATARep *head=NULL,*tempha; + Bool one_drv,make_free; + CDoc *doc; + boot_drv_let=ToUpper(boot_drv_let); + do { + cnt=0; + if (!_doc) + DrvRep; + "\n****** Mount Drives ******\n" + "$$GREEN$$A$$FG$$-$$GREEN$$B$$FG$$ are RAM drives.\n" + "$$GREEN$$C$$FG$$-$$GREEN$$L$$FG$$ are ATA hard drives.\n" + "$$GREEN$$M$$FG$$-$$GREEN$$P$$FG$$ are ISO file read drives.\n" + "$$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$$$$FG$$ to exit):"; + drv_let=ToUpper(GetChar); + '\n'; + if (type=Let2BlkDevType(drv_let)) { + one_drv=FALSE; + if (_doc) { //Called by $LK,"::/Kernel/KCfg.HC"$ + doc=_doc; + make_free=FALSE; + } else { //Called by $LK,"Mount",A="MN:Mount"$() + doc=DocNew; + DocPrint(doc,"CBlkDev *bd;\n"); + make_free=TRUE; + } + unit=0; + switch (type) { + case BDT_RAM: + "Addr of RAM disk ($$PURPLE$$$$FG$$ to MAlloc):"; + GetS(addr_buf,STR_LEN); + case BDT_ISO_FILE_WRITE: + "Blks of 512 bytes:"; + GetS(blks_buf,STR_LEN); + break; + case BDT_ISO_FILE_READ: + filename=GetStr("File Name:"); + break; + case BDT_ATA: + case BDT_ATAPI: + num_hints=ATARep(,,&head); + if (type==BDT_ATAPI && boot_drv_let) + " to use booted CD/DVD\n"; //Only $LK,"::/Kernel/KCfg.HC"$ + do { + if (num_hints) + "Enter dev number or\nport with $$PURPLE$$0x$$FG$$ prefix.\n" + "I/O Port Base0:\n"; + else + "Include $$PURPLE$$0x$$FG$$ prefix.\nI/O Port Base0:\n"; + GetS(base0_buf,STR_LEN); + } while (!Str2I64(base0_buf) && (type!=BDT_ATAPI || !boot_drv_let)); + if (1<=Str2I64(base0_buf)<=num_hints) { + tempha=ATARepFind(head,Str2I64(base0_buf)); + StrPrint(base0_buf,"0x%X",tempha->base0); + StrPrint(base1_buf,"0x%X",tempha->base1); + unit=tempha->unit; + } else if (type!=BDT_ATAPI || *base0_buf) { + if (type==BDT_ATAPI) + StrCpy(base1_buf,"0"); + else + do { + "I/O Port Base1:\n"; + GetS(base1_buf,STR_LEN); + } while (!Str2I64(base1_buf)); + do { + "\t$$PURPLE$$0$$FG$$=Master\n\t$$PURPLE$$1$$FG$$=Slave\nUnit:"; + unit=GetChar-'0'; + } while (!(0<=unit<=1)); + '\n'; + } + LinkedLstDel(head); + break; + } + DocPrint(doc,"bd=BlkDevNextFreeSlot(\'%C\',%d);bd->unit=%d;\n", + drv_let,type,unit); + switch (type) { + case BDT_RAM: + if (!*addr_buf) StrCpy(addr_buf,"0"); + DocPrint(doc,"bd->RAM_dsk=%s;\n",addr_buf); + case BDT_ISO_FILE_WRITE: + if (!*blks_buf) StrCpy(blks_buf,"0"); + DocPrint(doc,"bd->max_blk=(%s)-1;\n",blks_buf); + break; + case BDT_ISO_FILE_READ: + filename2=FileNameAbs(filename); + DocPrint(doc,"bd->file_dsk_name=AStrNew(\"%s\");\n",filename2); + DocPrint(doc,"bd->drv_offset=19<<2+" + "(DVD_BLK_SIZE*2+DVD_BOOT_LOADER_SIZE)/BLK_SIZE;\n"); + break; + case BDT_ATA: + case BDT_ATAPI: + if (type==BDT_ATAPI && !*base0_buf) { + DocPrint(doc,"GetBaseUnit(bd);\n"); //Only $LK,"::/Kernel/KCfg.HC"$ + if (drv_let==boot_drv_let) + make_free=TRUE; + } else + DocPrint(doc,"bd->base0=%s;bd->base1=%s;\n",base0_buf,base1_buf); + if (type==BDT_ATA && repartition) { + "\nReformat WHOLE drive!"; + one_drv=YorN; + } + break; + } + DocPrint(doc,"BlkDevAdd(bd,%d,%d);\n",one_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); + DocDel(doc); + } + } + res+=cnt; + } while (cnt || !res && _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 U0 Unmount(U8 drv_let=0) +{//Unmount drive(s). + BlkDevDel(Let2BlkDev(drv_let)); +} + +public U8 MountFile(U8 *filename) +{//Mount ISO.C file. + U8 *filename2=DftExt(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; + bd->file_dsk_name=AStrNew(filename3); + BlkDevAdd(bd,TRUE,TRUE); + Free(filename3); + Free(filename2); + return dv->drv_let; +} diff --git a/Adam/ABlkDev/PrtDsk.CPP b/Adam/ABlkDev/PrtDsk.HC similarity index 100% rename from Adam/ABlkDev/PrtDsk.CPP rename to Adam/ABlkDev/PrtDsk.HC diff --git a/Adam/ADbg.CPP b/Adam/ADbg.CPP deleted file mode 100644 index d2f8863..0000000 --- a/Adam/ADbg.CPP +++ /dev/null @@ -1,270 +0,0 @@ -#help_index "Debugging/Dump" -Bool ClassRep2(CDoc *doc,U8 *_d,U8 *class_name=lastclass, - I64 depth,I64 max_depth,Bool dynamic,I64 types=HTT_CLASS,I64 offset=0) -{//See $LK,"::/Demo/LastClass.CPP"$. - I64 i,j,stars,*ptr; - CMemberLst *ml; - CDocEntry *doc_e; - Bool unlock; - CHashClass *tempc,*tempc2; - if (depth>=max_depth) return TRUE; - if (!(tempc=HashFind(class_name,Fs->hash_table,types))) { - DocPrint(doc,"Class Not Found.\n"); - return FALSE; - } - if (!ChkPtr(_d) || !ChkPtr(_d(U8 *)+tempc->size)) { - DocPrint(doc,"Bad Ptr:%016X\n",_d); - return FALSE; - } - if (tempc->base_class && !ClassRep2(doc,_d,tempc->base_class->str, - depth,max_depth,dynamic,types,offset)) - return FALSE; - unlock=DocLock(doc); - DocPrint(doc,"Class:\"%s\"\n",class_name); - ml=tempc->member_lst_and_root; - while (ml) { - tempc2=ml->member_class; - ptr=_d(U8 *)+ml->offset; - DocPrint(doc,"%08X ",ptr(U8 *)+offset); - stars=tempc2->ptr_stars_cnt; - tempc2=OptClassFwd(tempc2); - tempc2-=tempc2->ptr_stars_cnt; - if (tempc2->type & HTT_INTERNAL_TYPE) { - DocPrint(doc,"$$GREEN$$%-20ts:$$FG$$",ml->str); - if (stars==1 && (tempc2->raw_type==RT_I8 || tempc2->raw_type==RT_U8)) { - ptr=*ptr; - if (ChkPtr(ptr)) { - if (dynamic) { - doc_e=DocPrint(doc,"$$DA-TRM-P+RD,LEN=64,A=\"%%40ts\"$$\n"); - doc_e->data=ptr; - DocDataFmt(doc,doc_e); - } else - DocPrint(doc,"%40ts\n",ptr); - } - } else if (!stars) { - j=MinI64(ml->dim.total_cnt,32); - if (tempc2->raw_type==RT_I8 || tempc2->raw_type==RT_U8) { - if (j==1) { - if (dynamic) { - doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=U8,A=\"%%c\"$$\n"); - doc_e->data=ptr; - } else - DocPrint(doc,"%c\n",*ptr(U8 *)); - } else { - if (dynamic) { - doc_e=DocPrint(doc,"$$DA-TRM-P+RD,LEN=64,A=\"%%40ts\"$$\n"); - doc_e->data=ptr; - DocDataFmt(doc,doc_e); - } else - DocPrint(doc,"%40ts\n",ptr); - } - } - for (i=0;iraw_type) { - case RT_I0: - case RT_U0: - break; - case RT_I8: - if (dynamic) { - doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=I8,A=\"%%02X\"$$ "); - doc_e->data=ptr(I8 *)++; - } else - DocPrint(doc,"%02X ",*ptr(I8 *)++); - break; - case RT_U8: - if (dynamic) { - doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=U8,A=\"%%02X\"$$ "); - doc_e->data=ptr(U8 *)++; - } else - DocPrint(doc,"%02X ",*ptr(U8 *)++); - break; - case RT_I16: - if (dynamic) { - doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=I16,A=\"%%04X\"$$ "); - doc_e->data=ptr(I16 *)++; - } else - DocPrint(doc,"%04X ",*ptr(I16 *)++); - break; - case RT_U16: - if (dynamic) { - doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=U16,A=\"%%04X\"$$ "); - doc_e->data=ptr(U16 *)++; - } else - DocPrint(doc,"%04X ",*ptr(U16 *)++); - break; - case RT_I32: - if (dynamic) { - doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=I32,A=\"%%08X\"$$ "); - doc_e->data=ptr(I32 *)++; - } else - DocPrint(doc,"%08X ",*ptr(I32 *)++); - break; - case RT_U32: - if (dynamic) { - doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=U32,A=\"%%08X\"$$ "); - doc_e->data=ptr(U32 *)++; - } else - DocPrint(doc,"%08X ",*ptr(U32 *)++); - break; - case RT_U64: - if (dynamic) { - doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=U64,A=\"%%08X\"$$ "); - doc_e->data=ptr(U64 *)++; - } else - DocPrint(doc,"%08X ",*ptr(U64 *)++); - break; - case RT_F64: - if (dynamic) { - doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=F64,A=\"%%16g\"$$ "); - doc_e->data=ptr(F64 *)++; - } else - DocPrint(doc,"%16g ",*ptr(I64 *)++); - break; - default: - if (dynamic) { - doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,A=\"%%016X\"$$ "); - doc_e->data=ptr(I64 *)++; - } else - DocPrint(doc,"%016X ",*ptr(I64 *)++); - } - if (dynamic) - DocDataFmt(doc,doc_e); - } - if (jdim.total_cnt) - DocPrint(doc,"..."); - } else - DocPrint(doc,"%016X",*ptr); - DocPrint(doc,"\n"); - } else { - if (depth<2) { - if (stars==1 && !ChkPtr(*ptr)) - DocPrint(doc,"%-20ts:%016X\n",ml->str,*ptr); - else { - DocPrint(doc,"$$TR,\"%s\"$$\n",ml->str); - DocPrint(doc,"$$ID,2$$"); - if (!stars) - ClassRep2(doc,ptr,tempc2->str,depth+1,max_depth,dynamic); - else if (stars==1) - ClassRep2(doc,*ptr,tempc2->str,depth+1,max_depth,dynamic); - DocPrint(doc,"$$ID,-2$$"); - } - } else - DocPrint(doc,"%-20ts\n",ml->str); - } - ml=ml->next; - } - if (unlock) - DocUnlock(doc); - return TRUE; -} - -public U0 ClassRep(U8 *_d,U8 *class_name=lastclass, - I64 max_depth=2,Bool fun=FALSE,I64 offset=0) -{//Displays members of a record by using the compiler's info. - CDoc *doc; - if (IsRaw) - doc=DocNew; - else { - DocMax; - doc=DocPut; - } - if (fun) - ClassRep2(doc,_d,class_name,0,max_depth,FALSE,HTT_FUN,offset); - else - ClassRep2(doc,_d,class_name,0,max_depth,FALSE,HTT_CLASS,offset); - DocPrint(doc,"\n"); - DocRecalc(doc); - if (IsRaw) { - DocDump(doc,100000); - DocDel(doc); - } -} - -public U0 ClassRepD(U8 *_d,U8 *class_name=lastclass, - I64 max_depth=2,Bool fun=FALSE,I64 offset=0) -{//Dynamic ClassRep. Uses hex_ed widgit for live changes. - CDoc *doc; - if (IsRaw) - doc=DocNew; - else { - DocMax; - doc=DocPut; - } - if (fun) - ClassRep2(doc,_d,class_name,0,max_depth,TRUE,HTT_FUN,offset); - else - ClassRep2(doc,_d,class_name,0,max_depth,TRUE,HTT_CLASS,offset); - DocPrint(doc,"\n"); - DocRecalc(doc); - if (IsRaw) { - DocDump(doc,100000); - DocDel(doc); - } -} - -U0 UpdateRegVarImg(CHashFun *tempf,U8 *_b,CTask *task) -{ - CMemberLst *ml; - CHashClass *tempc; - ml=tempf->member_lst_and_root; - while (ml) { - if (ml->reg!=REG_NONE) { - tempc=OptClassFwd(ml->member_class); - MemCpy(_b+ml->offset,TaskRegAddr(task,ml->reg),tempc->size); - } - ml=ml->next; - } -} - -public U0 FunRep(U8 *st,U8 *rbp=NULL,I64 max_depth=2,CTask *task=NULL) -{//Shows names and vals of a fun's local vars using compiler's info. - I64 size; - U8 *img; - CHashFun *tempf=HashFind(st,Fs->hash_table,HTT_FUN); - CMemberLst *tempm; - if (tempf) { - if (rbp) { - if (task) { -//tempf->size is negative. It's the bottom - //of the fun local var space relative to RBP . - size=tempf->arg_cnt*8-tempf->size+16; - - img=MAlloc(size); - MemCpy(img,rbp+tempf->size,size); - UpdateRegVarImg(tempf,img-tempf->size,task); - ClassRep(img-tempf->size,st,max_depth,TRUE,rbp-img+tempf->size); - Free(img); - } else - ClassRep(rbp,st,max_depth,TRUE); - } else { - tempm=tempf->member_lst_and_root; - while (tempm) { - if (0<=tempm->regreg,"ST_U64_REGS",tempm->str; - else - "%08tX %s\n",tempm->offset,tempm->str; - tempm=tempm->next; - } - "%08tX Stk Size\n",tempf->size; - } - } -} - -#help_index "Debugging/Unassemble" -public U0 Uf(U8 *st) -{//Unassembles a named fun - I64 i; - CHashSrcSym *tempf; - CDbgInfo *dbg_info; - if (tempf=HashFind(st,Fs->hash_table,HTT_FUN|HTT_EXPORT_SYS_SYM)) { - if (tempf->type&HTT_FUN) - FunRep(st); - if (dbg_info=tempf->dbg_info) { - i=dbg_info->body[dbg_info->max_line+1-dbg_info->min_line] - -dbg_info->body[0]; - Un(dbg_info->body[0],i); - "Code Size:%04X\n",i; - } else - U(HashVal(tempf)); - } -} diff --git a/Adam/ADbg.HC b/Adam/ADbg.HC new file mode 100644 index 0000000..ef7750e --- /dev/null +++ b/Adam/ADbg.HC @@ -0,0 +1,270 @@ +#help_index "Debugging/Dump" +Bool ClassRep2(CDoc *doc,U8 *_d,U8 *class_name=lastclass, + I64 depth,I64 max_depth,Bool dynamic,I64 types=HTT_CLASS,I64 offset=0) +{//See $LK,"::/Demo/LastClass.HC"$. + I64 i,j,stars,*ptr; + CMemberLst *ml; + CDocEntry *doc_e; + Bool unlock; + CHashClass *tempc,*tempc2; + if (depth>=max_depth) return TRUE; + if (!(tempc=HashFind(class_name,Fs->hash_table,types))) { + DocPrint(doc,"Class Not Found.\n"); + return FALSE; + } + if (!ChkPtr(_d) || !ChkPtr(_d(U8 *)+tempc->size)) { + DocPrint(doc,"Bad Ptr:%016X\n",_d); + return FALSE; + } + if (tempc->base_class && !ClassRep2(doc,_d,tempc->base_class->str, + depth,max_depth,dynamic,types,offset)) + return FALSE; + unlock=DocLock(doc); + DocPrint(doc,"Class:\"%s\"\n",class_name); + ml=tempc->member_lst_and_root; + while (ml) { + tempc2=ml->member_class; + ptr=_d(U8 *)+ml->offset; + DocPrint(doc,"%08X ",ptr(U8 *)+offset); + stars=tempc2->ptr_stars_cnt; + tempc2=OptClassFwd(tempc2); + tempc2-=tempc2->ptr_stars_cnt; + if (tempc2->type & HTT_INTERNAL_TYPE) { + DocPrint(doc,"$$GREEN$$%-20ts:$$FG$$",ml->str); + if (stars==1 && (tempc2->raw_type==RT_I8 || tempc2->raw_type==RT_U8)) { + ptr=*ptr; + if (ChkPtr(ptr)) { + if (dynamic) { + doc_e=DocPrint(doc,"$$DA-TRM-P+RD,LEN=64,A=\"%%40ts\"$$\n"); + doc_e->data=ptr; + DocDataFmt(doc,doc_e); + } else + DocPrint(doc,"%40ts\n",ptr); + } + } else if (!stars) { + j=MinI64(ml->dim.total_cnt,32); + if (tempc2->raw_type==RT_I8 || tempc2->raw_type==RT_U8) { + if (j==1) { + if (dynamic) { + doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=U8,A=\"%%c\"$$\n"); + doc_e->data=ptr; + } else + DocPrint(doc,"%c\n",*ptr(U8 *)); + } else { + if (dynamic) { + doc_e=DocPrint(doc,"$$DA-TRM-P+RD,LEN=64,A=\"%%40ts\"$$\n"); + doc_e->data=ptr; + DocDataFmt(doc,doc_e); + } else + DocPrint(doc,"%40ts\n",ptr); + } + } + for (i=0;iraw_type) { + case RT_I0: + case RT_U0: + break; + case RT_I8: + if (dynamic) { + doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=I8,A=\"%%02X\"$$ "); + doc_e->data=ptr(I8 *)++; + } else + DocPrint(doc,"%02X ",*ptr(I8 *)++); + break; + case RT_U8: + if (dynamic) { + doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=U8,A=\"%%02X\"$$ "); + doc_e->data=ptr(U8 *)++; + } else + DocPrint(doc,"%02X ",*ptr(U8 *)++); + break; + case RT_I16: + if (dynamic) { + doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=I16,A=\"%%04X\"$$ "); + doc_e->data=ptr(I16 *)++; + } else + DocPrint(doc,"%04X ",*ptr(I16 *)++); + break; + case RT_U16: + if (dynamic) { + doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=U16,A=\"%%04X\"$$ "); + doc_e->data=ptr(U16 *)++; + } else + DocPrint(doc,"%04X ",*ptr(U16 *)++); + break; + case RT_I32: + if (dynamic) { + doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=I32,A=\"%%08X\"$$ "); + doc_e->data=ptr(I32 *)++; + } else + DocPrint(doc,"%08X ",*ptr(I32 *)++); + break; + case RT_U32: + if (dynamic) { + doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=U32,A=\"%%08X\"$$ "); + doc_e->data=ptr(U32 *)++; + } else + DocPrint(doc,"%08X ",*ptr(U32 *)++); + break; + case RT_U64: + if (dynamic) { + doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=U64,A=\"%%08X\"$$ "); + doc_e->data=ptr(U64 *)++; + } else + DocPrint(doc,"%08X ",*ptr(U64 *)++); + break; + case RT_F64: + if (dynamic) { + doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=F64,A=\"%%16g\"$$ "); + doc_e->data=ptr(F64 *)++; + } else + DocPrint(doc,"%16g ",*ptr(I64 *)++); + break; + default: + if (dynamic) { + doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,A=\"%%016X\"$$ "); + doc_e->data=ptr(I64 *)++; + } else + DocPrint(doc,"%016X ",*ptr(I64 *)++); + } + if (dynamic) + DocDataFmt(doc,doc_e); + } + if (jdim.total_cnt) + DocPrint(doc,"..."); + } else + DocPrint(doc,"%016X",*ptr); + DocPrint(doc,"\n"); + } else { + if (depth<2) { + if (stars==1 && !ChkPtr(*ptr)) + DocPrint(doc,"%-20ts:%016X\n",ml->str,*ptr); + else { + DocPrint(doc,"$$TR,\"%s\"$$\n",ml->str); + DocPrint(doc,"$$ID,2$$"); + if (!stars) + ClassRep2(doc,ptr,tempc2->str,depth+1,max_depth,dynamic); + else if (stars==1) + ClassRep2(doc,*ptr,tempc2->str,depth+1,max_depth,dynamic); + DocPrint(doc,"$$ID,-2$$"); + } + } else + DocPrint(doc,"%-20ts\n",ml->str); + } + ml=ml->next; + } + if (unlock) + DocUnlock(doc); + return TRUE; +} + +public U0 ClassRep(U8 *_d,U8 *class_name=lastclass, + I64 max_depth=2,Bool fun=FALSE,I64 offset=0) +{//Displays members of a record by using the compiler's info. + CDoc *doc; + if (IsRaw) + doc=DocNew; + else { + DocMax; + doc=DocPut; + } + if (fun) + ClassRep2(doc,_d,class_name,0,max_depth,FALSE,HTT_FUN,offset); + else + ClassRep2(doc,_d,class_name,0,max_depth,FALSE,HTT_CLASS,offset); + DocPrint(doc,"\n"); + DocRecalc(doc); + if (IsRaw) { + DocDump(doc,100000); + DocDel(doc); + } +} + +public U0 ClassRepD(U8 *_d,U8 *class_name=lastclass, + I64 max_depth=2,Bool fun=FALSE,I64 offset=0) +{//Dynamic ClassRep. Uses hex_ed widgit for live changes. + CDoc *doc; + if (IsRaw) + doc=DocNew; + else { + DocMax; + doc=DocPut; + } + if (fun) + ClassRep2(doc,_d,class_name,0,max_depth,TRUE,HTT_FUN,offset); + else + ClassRep2(doc,_d,class_name,0,max_depth,TRUE,HTT_CLASS,offset); + DocPrint(doc,"\n"); + DocRecalc(doc); + if (IsRaw) { + DocDump(doc,100000); + DocDel(doc); + } +} + +U0 UpdateRegVarImg(CHashFun *tempf,U8 *_b,CTask *task) +{ + CMemberLst *ml; + CHashClass *tempc; + ml=tempf->member_lst_and_root; + while (ml) { + if (ml->reg!=REG_NONE) { + tempc=OptClassFwd(ml->member_class); + MemCpy(_b+ml->offset,TaskRegAddr(task,ml->reg),tempc->size); + } + ml=ml->next; + } +} + +public U0 FunRep(U8 *st,U8 *rbp=NULL,I64 max_depth=2,CTask *task=NULL) +{//Shows names and vals of a fun's local vars using compiler's info. + I64 size; + U8 *img; + CHashFun *tempf=HashFind(st,Fs->hash_table,HTT_FUN); + CMemberLst *tempm; + if (tempf) { + if (rbp) { + if (task) { +//tempf->size is negative. It's the bottom + //of the fun local var space relative to RBP . + size=tempf->arg_cnt*8-tempf->size+16; + + img=MAlloc(size); + MemCpy(img,rbp+tempf->size,size); + UpdateRegVarImg(tempf,img-tempf->size,task); + ClassRep(img-tempf->size,st,max_depth,TRUE,rbp-img+tempf->size); + Free(img); + } else + ClassRep(rbp,st,max_depth,TRUE); + } else { + tempm=tempf->member_lst_and_root; + while (tempm) { + if (0<=tempm->regreg,"ST_U64_REGS",tempm->str; + else + "%08tX %s\n",tempm->offset,tempm->str; + tempm=tempm->next; + } + "%08tX Stk Size\n",tempf->size; + } + } +} + +#help_index "Debugging/Unassemble" +public U0 Uf(U8 *st) +{//Unassembles a named fun + I64 i; + CHashSrcSym *tempf; + CDbgInfo *dbg_info; + if (tempf=HashFind(st,Fs->hash_table,HTT_FUN|HTT_EXPORT_SYS_SYM)) { + if (tempf->type&HTT_FUN) + FunRep(st); + if (dbg_info=tempf->dbg_info) { + i=dbg_info->body[dbg_info->max_line+1-dbg_info->min_line] + -dbg_info->body[0]; + Un(dbg_info->body[0],i); + "Code Size:%04X\n",i; + } else + U(HashVal(tempf)); + } +} diff --git a/Adam/ADefine.CPP b/Adam/ADefine.CPP deleted file mode 100644 index ccee520..0000000 --- a/Adam/ADefine.CPP +++ /dev/null @@ -1,39 +0,0 @@ -#help_index "Define;Char/Define" - -U0 LoadDocDefines() -{ - CBinFile *bfh=sys_boot_base-sizeof(CBinFile); - - DefinePrint("DD_OS_NAME_VERSION","TempleOS V%0.2f",os_version); - DefinePrint("DD_TEMPLEOS_AGE","%0.1f", - (Now-Str2Date("8/1/2003"))/ToF64(1<<32)/CDATE_YEAR_DAYS); - - //This is cut and replaced when I generate a distro. - //See $LK,"DD_TEMPLEOS_LOC",A="FF:::/Demo/AcctExample/TOSDistro.CPP,DD_TEMPLEOS_LOC"$. - $TR-C,"LineRep"$ - $ID,4$DefinePrint("DD_TEMPLEOS_LOC","121,488"); -DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","81,126"); -$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.CPP,DD_BOOT_HIGH_LOC_DVD"$ - - 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); - - DefinePrint("DD_SYS_FIXED_AREA_BASE","%08X",SYS_FIXED_AREA); - DefinePrint("DD_SYS_FIXED_AREA_END","%08X", - SYS_FIXED_AREA+sizeof(CSysFixedArea)-1); - DefinePrint("DD_SYS_HEAP_BASE","%08X",sys_heap_base); - DefinePrint("DD_SYS_HEAP_LIMIT","%08X",sys_heap_limit); - DefinePrint("DD_MEM_MIN_MEG","%d Meg",MEM_MIN_MEG); - DefinePrint("DD_UNCACHED_ALIAS","%010X",dev.uncached_alias); - DefinePrint("DD_MEM_MAPPED_SPACE_GIG","%d Gig",MEM_MAPPED_SPACE/0x40000000); - DefinePrint("DD_MEM_MAPPED_SPACE_END","%010X",MEM_MAPPED_SPACE-1); - DefinePrint("DD_JIFFY_HZ","%d Hz",JIFFY_FREQ); -} - -LoadDocDefines; diff --git a/Adam/ADefine.HC b/Adam/ADefine.HC new file mode 100644 index 0000000..6087c33 --- /dev/null +++ b/Adam/ADefine.HC @@ -0,0 +1,39 @@ +#help_index "Define;Char/Define" + +U0 LoadDocDefines() +{ + CBinFile *bfh=sys_boot_base-sizeof(CBinFile); + + DefinePrint("DD_OS_NAME_VERSION","TempleOS V%0.2f",os_version); + DefinePrint("DD_TEMPLEOS_AGE","%0.1f", + (Now-Str2Date("8/1/2003"))/ToF64(1<<32)/CDATE_YEAR_DAYS); + + //This is cut and replaced when I generate a distro. + //See $LK,"DD_TEMPLEOS_LOC",A="FF:::/Demo/AcctExample/TOSDistro.HC,DD_TEMPLEOS_LOC"$. + $TR-C,"LineRep"$ + $ID,4$DefinePrint("DD_TEMPLEOS_LOC","120,264"); +DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","81,209"); +$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"$ + + 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); + + DefinePrint("DD_SYS_FIXED_AREA_BASE","%08X",SYS_FIXED_AREA); + DefinePrint("DD_SYS_FIXED_AREA_END","%08X", + SYS_FIXED_AREA+sizeof(CSysFixedArea)-1); + DefinePrint("DD_SYS_HEAP_BASE","%08X",sys_heap_base); + DefinePrint("DD_SYS_HEAP_LIMIT","%08X",sys_heap_limit); + DefinePrint("DD_MEM_MIN_MEG","%d Meg",MEM_MIN_MEG); + DefinePrint("DD_UNCACHED_ALIAS","%010X",dev.uncached_alias); + DefinePrint("DD_MEM_MAPPED_SPACE_GIG","%d Gig",MEM_MAPPED_SPACE/0x40000000); + DefinePrint("DD_MEM_MAPPED_SPACE_END","%010X",MEM_MAPPED_SPACE-1); + DefinePrint("DD_JIFFY_HZ","%d Hz",JIFFY_FREQ); +} + +LoadDocDefines; diff --git a/Adam/AExts.CPP b/Adam/AExts.CPP deleted file mode 100644 index f91c8a3..0000000 --- a/Adam/AExts.CPP +++ /dev/null @@ -1,98 +0,0 @@ -extern U0 ACDDef(I64 n,CTask *parent=NULL); -extern U0 ACDDefsPut(CDoc *doc,U8 *st,I64 num=-1); -extern U0 ACDFillin(I64 n); -extern U0 ACFillIn(I64 n); -extern U0 ACMan(I64 n,CTask *parent=NULL); -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 CCtrl *CtrlFindUnique(CTask *haystack_task,I64 needle_type); -extern Bool CtrlInside(CCtrl *c,I64 x,I64 y); -extern U8 *DC2Sprite(CDC *tempb); -extern U0 DocBMP(CDoc *doc=NULL,U8 *filename, - Bool dither_probability=FALSE,Bool use_ms_paint_palette=FALSE); -extern U0 DocBinDel(CDoc *doc,CDocBin *b); -extern U0 DocBinsValidate(CDoc *doc); -extern U0 DocBottom(CDoc *doc=NULL); -extern U0 DocCenter(CDoc *doc=NULL,I64 recalc=RECALCt_NORMAL); -extern U0 DocClear(CDoc *doc=NULL,Bool clear_holds=FALSE); -extern Bool DocCursor(Bool show=OFF,CDoc *doc=NULL); -extern U0 DocD(U8 *buf,I64 cnt=0x80); -extern U0 DocDataFmt(CDoc *doc,CDocEntry *doc_e,I64 d=DOCM_CANCEL); -extern U0 DocDel(CDoc *doc); -extern CDoc *DocDisplay(CTask *task=NULL); -extern U0 DocDump(CDoc *doc,I64 uS_delay=0); -extern CDocEntry *DocEntryCopy(CDoc *doc,CDocEntry *doc_e); -extern U0 DocEntryDel(CDoc *doc,CDocEntry *doc_e); -extern Bool DocForm(U8 *_d,U8 *class_name=lastclass, - I64 dof_flags=0,U8 *header=NULL,U8 *footer=NULL); -extern U0 DocHelpIndex(CDoc *doc,U8 *index); -extern Bool DocHighlightCursor(Bool show=OFF,CDoc *doc=NULL); -extern U0 DocInsDoc(CDoc *doc,CDoc *doc2); -extern U0 DocInsEntry(CDoc *doc,CDocEntry *doc_e); -extern Bool DocLock(CDoc *doc); -extern U0 DocMax(I64 i=MAX_I32); -extern CDoc *DocNew(U8 *filename=NULL,CTask *task=NULL); -extern CDocEntry *DocPrint(CDoc *doc=NULL,U8 *src,...); -extern CDoc *DocPut(CTask *task=NULL); -extern CDoc *DocRead(U8 *name=NULL,I64 flags=0); -extern Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL); -extern U0 DocRst(CDoc *doc,Bool is_old); -extern CDocEntry *DocSprite(CDoc *doc,U8 *elems,U8 *fmt=NULL); -extern U0 DocTop(CDoc *doc=NULL); -extern Bool DocUnlock(CDoc *doc); -extern U0 DocUpdateTaskDocs(CTask *task); -extern U0 DrawCtrls(CTask *task); -extern Bool Ed(U8 *link_st,I64 edf_dof_flags=0); -extern U0 EdCodeTools(CDoc *doc); -extern U8 *EdSprite(I64 bin_num); -extern I64 ExeDoc(CDoc *doc,I64 ccf_flags=0); -extern I64 FindWiz(); -extern I64 GetI64(U8 *msg,I64 dft,I64 lo=MIN_I64,I64 hi=MAX_I64); -extern U0 GrPlot0(CDC *dc,I64 x,I64 y); -extern I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask, - U8 *fu_flags=NULL,U8 *_stage2_filename=NULL); -extern CMenuEntry *MenuEntryFind(CMenu *m,U8 *full_name); -extern CMenu *MenuFilePush(U8 *filename); -extern U0 MenuPop(); -extern CMenu *MenuPush(U8 *st); -extern I64 Mount(Bool repartition=FALSE); -extern CTask *Noise(I64 mS,I64 min_freq,I64 max_freq); -extern Bool Plain(U8 *filename,I64 edf_dof_flags=0); -extern Bool PopUpCancelOk(U8 *header=NULL,U8 *footer=NULL); -extern I64 PopUpColor(U8 *header=NULL, - Bool allow_transpant=TRUE,Bool allow_dft=TRUE); -extern I64 PopUpColorDither(U8 *header=NULL); -extern I64 PopUpColorLighting(U8 *header=NULL); -extern I64 PopUpFile(U8 *filename, - Bool warn_ext=TRUE,CTask *parent=NULL,CTask **_pu_task=NULL); -extern Bool PopUpForm(U8 *_d,U8 *class_name=lastclass, - I64 dof_flags=DOF_MIN_SIZE,U8 *header=NULL,U8 *footer=NULL); -extern I64 PopUpGetI64(U8 *msg,I64 dft,I64 lo=MIN_I64,I64 hi=MAX_I64); -extern U8 *PopUpGetStr(U8 *header=NULL); -extern I64 PopUpMenu(CDoc *doc,I64 dof_flags=0); -extern Bool PopUpNoYes(U8 *header=NULL,U8 *footer=NULL); -extern Bool PopUpOk(U8 *header=NULL,U8 *footer=NULL); -extern I64 PopUpRangeI64( - I64 lo,I64 hi,I64 step=1,U8 *header=NULL,U8 *footer=NULL); -extern Bool PopUpTransform(I64 *r); -extern U0 RegOneTimePopUp(I64 flag_num,U8 *msg); -extern U0 SettingsPop(CTask *task=NULL,I64 flags=0); -extern CTaskSettings *SettingsPush(CTask *task=NULL,I64 flags=0); -extern U0 TemplateCtrlSlider(CDoc *doc); -extern Bool View(); -extern U0 ViewAnglesDel(CTask *task=NULL); -extern CCtrl *ViewAnglesNew(CTask *task=NULL); -extern Bool WinBorder(Bool val,CTask *task=NULL); -extern CDoc *WinCursorPosSet(CTask *task,I64 ipx,I64 ipy,Bool set_cursor=TRUE); -extern Bool WinHorz(I64 left,I64 right,CTask *task=NULL); -extern U0 WinMax(CTask *task=NULL); -extern U0 WinMgrSync(I64 cnt=1,Bool force=FALSE); -extern U0 WinScrollNull(CTask *task,CD3I64 *s); -extern U0 WinScrollRestore(CTask *task,CD3I64 *s); -extern U0 WinScrollsInit(CTask *task); -extern Bool WinToTop(CTask *task=NULL,Bool update_z_buf=TRUE); -extern Bool WinVert(I64 top,I64 bottom,CTask *task=NULL); -extern CWinMgrGlbls winmgr; diff --git a/Adam/AExts.HC b/Adam/AExts.HC new file mode 100644 index 0000000..38f2ec5 --- /dev/null +++ b/Adam/AExts.HC @@ -0,0 +1,98 @@ +extern U0 ACDDef(I64 n,CTask *parent=NULL); +extern U0 ACDDefsPut(CDoc *doc=NULL,U8 *st,I64 num=-1); +extern U0 ACDFillin(I64 n); +extern U0 ACFillIn(I64 n); +extern U0 ACMan(I64 n,CTask *parent_task=NULL); +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 CCtrl *CtrlFindUnique(CTask *haystack_task,I64 needle_type); +extern Bool CtrlInside(CCtrl *c,I64 x,I64 y); +extern U8 *DC2Sprite(CDC *tempb); +extern U0 DocBMP(CDoc *doc=NULL,U8 *filename, + Bool dither_probability=FALSE,Bool use_ms_paint_palette=FALSE); +extern U0 DocBinDel(CDoc *doc,CDocBin *b); +extern U0 DocBinsValidate(CDoc *doc); +extern U0 DocBottom(CDoc *doc=NULL); +extern U0 DocCenter(CDoc *doc=NULL,I64 recalc_flags=RECALCt_NORMAL); +extern U0 DocClear(CDoc *doc=NULL,Bool clear_holds=FALSE); +extern Bool DocCursor(Bool show=OFF,CDoc *doc=NULL); +extern U0 DocD(U8 *buf,I64 cnt=0x80); +extern U0 DocDataFmt(CDoc *doc,CDocEntry *doc_e,I64 d=DOCM_CANCEL); +extern U0 DocDel(CDoc *doc); +extern CDoc *DocDisplay(CTask *task=NULL); +extern U0 DocDump(CDoc *doc,I64 uS_delay=0); +extern CDocEntry *DocEntryCopy(CDoc *doc,CDocEntry *doc_e); +extern U0 DocEntryDel(CDoc *doc,CDocEntry *doc_e); +extern Bool DocForm(U8 *_d,U8 *class_name=lastclass, + I64 dof_flags=0,U8 *header=NULL,U8 *footer=NULL); +extern U0 DocHelpIdx(CDoc *doc,U8 *idx); +extern Bool DocHighlightCursor(Bool show=OFF,CDoc *doc=NULL); +extern U0 DocInsDoc(CDoc *doc=NULL,CDoc *doc2); +extern U0 DocInsEntry(CDoc *doc,CDocEntry *doc_e); +extern Bool DocLock(CDoc *doc); +extern I64 DocMax(I64 i=MAX_I64); +extern CDoc *DocNew(U8 *filename=NULL,CTask *task=NULL); +extern CDocEntry *DocPrint(CDoc *doc=NULL,U8 *fmt,...); +extern CDoc *DocPut(CTask *task=NULL); +extern CDoc *DocRead(U8 *name=NULL,I64 flags=0); +extern Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL); +extern U0 DocRst(CDoc *doc,Bool is_old); +extern CDocEntry *DocSprite(CDoc *doc=NULL,U8 *elems,U8 *fmt=NULL); +extern U0 DocTop(CDoc *doc=NULL); +extern Bool DocUnlock(CDoc *doc); +extern U0 DocUpdateTaskDocs(CTask *task); +extern U0 DrawCtrls(CTask *task); +extern Bool Ed(U8 *link_st,I64 edf_dof_flags=0); +extern U0 EdCodeTools(CDoc *doc); +extern U8 *EdSprite(I64 bin_num); +extern I64 ExeDoc(CDoc *doc,I64 ccf_flags=0); +extern I64 FindWiz(); +extern I64 GetI64(U8 *msg=NULL,I64 dft=0,I64 lo=MIN_I64,I64 hi=MAX_I64); +extern Bool GrPlot0(CDC *dc,I64 x,I64 y); +extern I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask, + U8 *fu_flags=NULL,U8 *_stage2_filename=NULL); +extern CMenuEntry *MenuEntryFind(CMenu *haystack_menu,U8 *needle_full_name); +extern CMenu *MenuFilePush(U8 *filename); +extern U0 MenuPop(); +extern CMenu *MenuPush(U8 *st); +extern I64 Mount(Bool repartition=FALSE); +extern CTask *Noise(I64 ms,F64 min_freq,F64 max_freq); +extern Bool Plain(U8 *filename,I64 edf_dof_flags=0); +extern Bool PopUpCancelOk(U8 *header=NULL,U8 *footer=NULL); +extern I64 PopUpColor(U8 *header=NULL, + Bool allow_transparent=TRUE,Bool allow_dft=TRUE); +extern I64 PopUpColorDither(U8 *header=NULL); +extern I64 PopUpColorLighting(U8 *header=NULL); +extern I64 PopUpFile(U8 *filename, + Bool warn_ext=TRUE,CTask *parent=NULL,CTask **_pu_task=NULL); +extern Bool PopUpForm(U8 *_d,U8 *class_name=lastclass, + I64 dof_flags=DOF_MIN_SIZE,U8 *header=NULL,U8 *footer=NULL); +extern I64 PopUpGetI64(U8 *msg,I64 dft,I64 lo=MIN_I64,I64 hi=MAX_I64); +extern U8 *PopUpGetStr(U8 *header=NULL); +extern I64 PopUpMenu(CDoc *doc,I64 dof_flags=0); +extern Bool PopUpNoYes(U8 *header=NULL,U8 *footer=NULL); +extern Bool PopUpOk(U8 *header=NULL,U8 *footer=NULL); +extern I64 PopUpRangeI64( + I64 lo,I64 hi,I64 step=1,U8 *header=NULL,U8 *footer=NULL); +extern Bool PopUpTransform(I64 *r); +extern U0 RegOneTimePopUp(I64 flag_num,U8 *msg); +extern U0 SettingsPop(CTask *task=NULL,I64 flags=0); +extern CTaskSettings *SettingsPush(CTask *task=NULL,I64 flags=0); +extern U0 TemplateCtrlSlider(CDoc *doc); +extern Bool View(); +extern U0 ViewAnglesDel(CTask *task=NULL); +extern CCtrl *ViewAnglesNew(CTask *task=NULL); +extern Bool WinBorder(Bool val=OFF,CTask *task=NULL); +extern CDoc *WinCursorPosSet(CTask *task,I64 ipx,I64 ipy,Bool set_cursor=TRUE); +extern Bool WinHorz(I64 left,I64 right,CTask *task=NULL); +extern U0 WinMax(CTask *task=NULL); +extern U0 WinMgrSync(I64 cnt=1,Bool force=FALSE); +extern U0 WinScrollNull(CTask *task,CD3I64 *s); +extern U0 WinScrollRestore(CTask *task,CD3I64 *s); +extern U0 WinScrollsInit(CTask *task); +extern I64 WinToTop(CTask *task=NULL,Bool update_z_buf=TRUE); +extern Bool WinVert(I64 top,I64 bottom,CTask *task=NULL); +extern CWinMgrGlbls winmgr; diff --git a/Adam/AHash.CPP b/Adam/AHash.CPP deleted file mode 100644 index 54c076d..0000000 --- a/Adam/AHash.CPP +++ /dev/null @@ -1,433 +0,0 @@ -#help_index "Info;Hash/System;Cmd Line (Typically)" -class CWho -{ - CHashGeneric *h; - U8 *idx; -}; - -I64 HashEntriesCompare(CWho *h1,CWho *h2) -{ - I64 i1,i2; - if (i1=StrCmp(h1->h->str,h2->h->str)) - return i1; - i1=HashTypeNum(h1->h); - i2=HashTypeNum(h2->h); - return i1-i2; -} - -I64 HashEntriesCompare2(CWho *h1,CWho *h2) -{ - CHashFun *tempf1=h1->h,*tempf2=h2->h; - I64 i1=HashVal(tempf1),i2=HashVal(tempf2); - if (i1==i2) { - i1=HashTypeNum(tempf1); - i2=HashTypeNum(tempf2); - if (i1==i2) - return StrCmp(tempf1->str,tempf2->str); - } - return i1-i2; -} - -I64 HelpIndexCnt(U8 *ptr,U8 *idx) -{ - I64 cnt=0,ch,idx_len=StrLen(idx); - while (*ptr) { - if (!StrNCmp(ptr,idx,idx_len)) - cnt++; - while (ch=*ptr++) - if (ch==';') - break; - if (!ch) - ptr--; - } - return cnt; -} - -U8 *HelpIndexStr(U8 **_ptr,U8 *idx) -{ - U8 *ptr=*_ptr,*ptr2,*res; - I64 ch,idx_len=StrLen(idx); - while (*ptr) { - ptr2=ptr; - while (ch=*ptr++) - if (ch==';') - break; - if (!ch) - ptr--; - *_ptr=ptr; - if (!StrNCmp(ptr2,idx,idx_len)) { - if (ch==';') - ptr--; - *ptr=0; - res=StrNew(ptr2); - *ptr=ch; - return res; - } - } - return NULL; -} - -U8 *HelpComment(CTask *task,CHash *temph,U8 *_src_link) -{ - CDoc *doc; - CDocEntry *doc_e; - U8 *res=NULL,*ptr,*ptr2,*src_link=StrNew(_src_link); - - if (*src_link=='F' && src_link[2]==':') - *src_link='P'; - XTalkWait(task,"Ed(0x%X,DOF_DONT_WINMGR_SYNC|DOF_DONT_SHOW);\n",src_link); - Free(src_link); - - doc=DocPut(task); - doc_e=doc->cur_entry; - if (temph->type&HTT_FUN) { - if (Bt(&temph(CHashFun *)->flags,Ff__EXTERN) || - Bt(&temph(CHashFun *)->flags,Ff_INTERNAL)) - while (doc_e!=doc && - (!(doc_e->de_flags&DOCEF_TAG)||!StrOcc(doc_e->tag,';'))) - doc_e=doc_e->next; - else - while (doc_e!=doc && - (!(doc_e->de_flags&DOCEF_TAG)||!StrOcc(doc_e->tag,'{'))) - doc_e=doc_e->next; - } - if (doc_e!=doc) { - if (doc_e->de_flags&DOCEF_TAG) { - ptr=doc_e->tag; - if (ptr2=StrMatch("//",ptr)) - ptr=ptr2+2; - else if (ptr2=StrMatch("/*",ptr)) - ptr=ptr2+2; - else if (!StrNCmp(ptr,"public",6)) - ptr+=6; - while (*ptr==CH_SPACE) - ptr++; - res=StrNew(ptr); - doc_e=doc_e->next; - } - while (doc_e!=doc && doc_e->type_u8!=DOCT_NEW_LINE) { - if (doc_e->type_u8==DOCT_TAB) { - ptr=MStrPrint("%s ",res); - Free(res); - res=ptr; - } else if (doc_e->de_flags&DOCEF_TAG) { - ptr=MStrPrint("%s%s",res,doc_e->tag); - Free(res); - res=ptr; - } - doc_e=doc_e->next; - } - } - XTalkWait(task,"%c",CH_SHIFT_ESC); - if (res) { - ptr=MStrUtil(res,SUF_REM_TRAILING|SUF_REM_LEADING|SUF_SINGLE_SPACE); - Free(res); - res=ptr; - } - return res; -} - -I64 HashEntriesCompare3(CWho *h1,CWho *h2) -{ - I64 i,i1=0,i2=0; - i=StrCmp(h1->idx,h2->idx); - if (i) - return i; - else { - if (h1->h->type&HTT_HELP_FILE) - i1=1; - if (h2->h->type&HTT_HELP_FILE) - i2=1; - i=i2-i1; - if (i) - return i; - else - return StrCmp(h1->h->str,h2->h->str); - } -} - -public U0 Who(U8 *fu_flags=NULL,CHashTable *h=NULL, -U8 *idx=NULL,CDoc *doc=NULL) -{//Dump hash symbol table. -// "+p" for only public symbols - // "+m" to order by number (normally alphabetical) - // "-r" just local hash table - CHashTable *table; - CHashSrcSym *temph; - CHashGeneric *ptr; - CWho *lst; - I64 cnt,i,j,k,f=0; - U8 buf[512],*st,*last_idx=StrNew(""),*cur_idx,*comment; - Bool recurse,publics,map; - CTask *task; - - ScanFlags(&f,Define("ST_FILE_UTIL_FLAGS"),"+r"); - ScanFlags(&f,Define("ST_FILE_UTIL_FLAGS"),fu_flags); - if (f&~(FUF_RECURSE|FUF_PUBLIC|FUF_MAP)) - throw('FUF'); - recurse=Bt(&f,FUf_RECURSE); - publics=Bt(&f,FUf_PUBLIC); - map =Bt(&f,FUf_MAP); - - if (!h) h=Fs->hash_table; - - if (idx) { - task=User; - TaskWait(task); - LBtr(&task->display_flags,DISPLAYf_SHOW); - } else - task=NULL; - - cnt=0; - table=h; - while (table) { - for (i=0;i<=table->mask;i++) { - temph=table->body[i]; - while (temph) { - if (!(temph->type & (HTF_IMPORT | HTF_PRIVATE)) && - (temph->type & HTF_PUBLIC || !publics)) { - if (!idx) - cnt++; - else if (temph->type&HTG_SRC_SYM && (cur_idx=temph->idx)) - cnt+=HelpIndexCnt(cur_idx,idx); - } - temph=temph->next; - } - } - if (recurse) - table=table->next; - else - break; - } - if (!cnt) goto wh_done; - - lst=CAlloc(cnt*sizeof(CWho)); - j=0; - table=h; - while (table) { - for (i=0;i<=table->mask;i++) { - temph=table->body[i]; - while (temph) { - if (!(temph->type & (HTF_IMPORT | HTF_PRIVATE)) && - (temph->type & HTF_PUBLIC || !publics)) - if (!idx) - lst[j++].h=temph; - else if (temph->type&HTG_SRC_SYM && (cur_idx=temph->idx) && - (k=HelpIndexCnt(cur_idx,idx))) - while (k--) { - lst[j].idx=HelpIndexStr(&cur_idx,idx); - lst[j++].h=temph; - } - temph=temph->next; - } - } - if (recurse) - table=table->next; - else - break; - } - - if (map) - QSort(lst,cnt,sizeof(CWho),&HashEntriesCompare2); - else if (idx) - QSort(lst,cnt,sizeof(CWho),&HashEntriesCompare3); - else - QSort(lst,cnt,sizeof(CWho),&HashEntriesCompare); - - if (idx) { - progress1_max=cnt; - progress1=0; - } - for (i=0;itype & HTT_HELP_FILE) { - DocPrint(doc,"$$WW,1$$"); - DocType(doc,ptr->str); - DocPrint(doc,"$$WW,0$$"); - } else { - if (ptr->type&HTG_SRC_SYM && ptr(CHashSrcSym *)->src_link) { - DocPrint(doc,"$$LK,\"%-20s\",A=\"%s\"$$", - ptr->str,ptr(CHashSrcSym *)->src_link); - if (idx) - comment=HelpComment(task,ptr,ptr(CHashSrcSym *)->src_link); - } else - DocPrint(doc,"%-20s",ptr->str); - - if (!idx) { - if (ptr->type & HTT_DEFINE_STR) { - st=MStrUtil(ptr(CHashDefineStr *)->data,SUF_SAFE_DOLLAR); - j=ptr(CHashDefineStr *)->cnt; - if (j==-1) - StrPrint(buf,"%-10tQ ",st); - else - StrPrint(buf,"%-10tQ %02X",st,j); - Free(st); - } else if (ptr->type & HTT_GLBL_VAR) - StrPrint(buf,"%010X ",ptr(CHashGlblVar *)->data_addr); - else - StrPrint(buf,"%010X ",HashVal(ptr)); - j=HashEntrySize(ptr); - if (j==-1) - CatPrint(buf," %04X ",ptr->use_cnt); - else - CatPrint(buf," %04X %010X ",ptr->use_cnt,j); - } else - *buf=0; - - k=ptr->type; - if (publics) - k&=~HTF_PUBLIC; - if (!(k&HTG_TYPE_MASK)) - CatPrint(buf,"NULL "); - while (k) { - j=Bsf(k); - if (j<0) - break; - Btr(&k,j); - CatPrint(buf,"%Z ",j,"ST_HTT_TYPES"); - } - DocPrint(doc,"%s",buf); - if (comment) { - DocPrint(doc,"$$GREEN$$%s$$FG$$",comment); - Free(comment); - } - DocPrint(doc,"\n"); - } - Free(lst[i].idx); - if (idx) - progress1++; - } - Free(lst); - if (idx) - progress1=progress1_max=0; - -wh_done: - if (doc) { - if (doc->head.next==doc) - DocPrint(doc,"No Match"); - else - DocRecalc(doc); - } - Free(last_idx); - Kill(task); -} - -#help_index "Info;Hash;Cmd Line (Typically)" - -#define HDR_MAX 16 -public I64 HashDepthRep(CHashTable *table=NULL) -{//Hash table linked-list chain depth report. -//Histogram of collision count. - I64 i,j,longest=0,cnt=0,a[HDR_MAX]; - CHash *temph; - if (!table) table=Fs->hash_table; - MemSet(a,0,sizeof(a)); - for (i=0;i<=table->mask;i++) { - temph=table->body[i]; - if (temph) { - j=LinkedLstCnt(temph); - if (jlongest) - longest=j; - } - } - "Histogram\n"; - for (i=0;imask+1,cnt,longest; - return longest; -} - -#help_index "Help System" -#help_file "::/Doc/HelpSystem" - -public U0 DocHelpIndex(CDoc *doc,U8 *idx) -{//Put to doc report for given help idx. - Who("+p",,idx,doc); -} - -public U0 PopUpHelpIndex(U8 *idx,CTask *parent=NULL) -{//PopUp win report for given help idx. - U8 *buf; - buf=MStrPrint("DocHelpIndex(DocPut,\"%s\");View;",idx); - PopUp(buf,parent); - Free(buf); -} - -#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"), - *absname=FileNameAbs(name); - CDoc *doc=DocRead(name); - CDocEntry *doc_e; - CHashSrcSym *temph; - I64 i,j,base=0; - CDbgInfo *dbg_info; - - FileExtRem(absname); - if (absname[1]==':' && StrLen(absname)>2 && - (temph=HashSingleTableFind(absname+2,Fs->hash_table,HTT_MODULE))) - base=temph(CHashGeneric *)->user_data0+sizeof(CBinFile); - - if (!doc) return; - doc_e=doc->head.next; - while (doc_e!=doc) { - if (doc_e->type_u8==DOCT_LINK) { - if (*doc_e->tag) - st=MStrUtil(doc_e->tag,SUF_REM_TRAILING); - else - st=MStrUtil(doc_e->aux_str,SUF_REM_TRAILING); - if (temph=HashSingleTableFind(st,Fs->hash_table,HTG_SRC_SYM)) { - if (*doc_e->tag) { - Free(temph->src_link); - temph->src_link=doc_e->aux_str; - ptr=temph->src_link; - if (ptr[0] && ptr[1] && ptr[2]==':') { - if (ptr[3]==':') - ptr[3]=blkdev.boot_drv_let; - else if (ptr[3]=='~') - ptr[3]=*blkdev.home_dir; - } - doc_e->aux_str=NULL; - } - if (temph->type&(HTT_FUN|HTT_EXPORT_SYS_SYM) && - !(dbg_info=temph->dbg_info) && doc_e->bin_data && - (dbg_info=doc_e->bin_data->data)) { - if (doc_e->bin_data->size>MSize(dbg_info)) - "Corrupt Map Entry\n"; - else { - doc_e->bin_data->data=NULL; - temph->dbg_info=dbg_info; - for (i=dbg_info->min_line;i<=dbg_info->max_line+1;i++) { - j=i-dbg_info->min_line; - if (dbg_info->body[j]) - dbg_info->body[j]=dbg_info->body[j]+base; - } - } - } - } - Free(st); - } - doc_e=doc_e->next; - } - DocDel(doc); - Free(name); - Free(absname); -} diff --git a/Adam/AHash.HC b/Adam/AHash.HC new file mode 100644 index 0000000..fa5f160 --- /dev/null +++ b/Adam/AHash.HC @@ -0,0 +1,433 @@ +#help_index "Info;Hash/System;Cmd Line (Typically)" +class CWho +{ + CHashGeneric *h; + U8 *idx; +}; + +I64 HashEntriesCompare(CWho *h1,CWho *h2) +{ + I64 i1,i2; + if (i1=StrCmp(h1->h->str,h2->h->str)) + return i1; + i1=HashTypeNum(h1->h); + i2=HashTypeNum(h2->h); + return i1-i2; +} + +I64 HashEntriesCompare2(CWho *h1,CWho *h2) +{ + CHashFun *tempf1=h1->h,*tempf2=h2->h; + I64 i1=HashVal(tempf1),i2=HashVal(tempf2); + if (i1==i2) { + i1=HashTypeNum(tempf1); + i2=HashTypeNum(tempf2); + if (i1==i2) + return StrCmp(tempf1->str,tempf2->str); + } + return i1-i2; +} + +I64 HelpIndexCnt(U8 *ptr,U8 *idx) +{ + I64 cnt=0,ch,idx_len=StrLen(idx); + while (*ptr) { + if (!StrNCmp(ptr,idx,idx_len)) + cnt++; + while (ch=*ptr++) + if (ch==';') + break; + if (!ch) + ptr--; + } + return cnt; +} + +U8 *HelpIndexStr(U8 **_ptr,U8 *idx) +{ + U8 *ptr=*_ptr,*ptr2,*res; + I64 ch,idx_len=StrLen(idx); + while (*ptr) { + ptr2=ptr; + while (ch=*ptr++) + if (ch==';') + break; + if (!ch) + ptr--; + *_ptr=ptr; + if (!StrNCmp(ptr2,idx,idx_len)) { + if (ch==';') + ptr--; + *ptr=0; + res=StrNew(ptr2); + *ptr=ch; + return res; + } + } + return NULL; +} + +U8 *HelpComment(CTask *task,CHash *temph,U8 *_src_link) +{ + CDoc *doc; + CDocEntry *doc_e; + U8 *res=NULL,*ptr,*ptr2,*src_link=StrNew(_src_link); + + if (*src_link=='F' && src_link[2]==':') + *src_link='P'; + XTalkWait(task,"Ed(0x%X,DOF_DONT_WINMGR_SYNC|DOF_DONT_SHOW);\n",src_link); + Free(src_link); + + doc=DocPut(task); + doc_e=doc->cur_entry; + if (temph->type&HTT_FUN) { + if (Bt(&temph(CHashFun *)->flags,Ff__EXTERN) || + Bt(&temph(CHashFun *)->flags,Ff_INTERNAL)) + while (doc_e!=doc && + (!(doc_e->de_flags&DOCEF_TAG)||!StrOcc(doc_e->tag,';'))) + doc_e=doc_e->next; + else + while (doc_e!=doc && + (!(doc_e->de_flags&DOCEF_TAG)||!StrOcc(doc_e->tag,'{'))) + doc_e=doc_e->next; + } + if (doc_e!=doc) { + if (doc_e->de_flags&DOCEF_TAG) { + ptr=doc_e->tag; + if (ptr2=StrMatch("//",ptr)) + ptr=ptr2+2; + else if (ptr2=StrMatch("/*",ptr)) + ptr=ptr2+2; + else if (!StrNCmp(ptr,"public",6)) + ptr+=6; + while (*ptr==CH_SPACE) + ptr++; + res=StrNew(ptr); + doc_e=doc_e->next; + } + while (doc_e!=doc && doc_e->type_u8!=DOCT_NEW_LINE) { + if (doc_e->type_u8==DOCT_TAB) { + ptr=MStrPrint("%s ",res); + Free(res); + res=ptr; + } else if (doc_e->de_flags&DOCEF_TAG) { + ptr=MStrPrint("%s%s",res,doc_e->tag); + Free(res); + res=ptr; + } + doc_e=doc_e->next; + } + } + XTalkWait(task,"%c",CH_SHIFT_ESC); + if (res) { + ptr=MStrUtil(res,SUF_REM_TRAILING|SUF_REM_LEADING|SUF_SINGLE_SPACE); + Free(res); + res=ptr; + } + return res; +} + +I64 HashEntriesCompare3(CWho *h1,CWho *h2) +{ + I64 i,i1=0,i2=0; + i=StrCmp(h1->idx,h2->idx); + if (i) + return i; + else { + if (h1->h->type&HTT_HELP_FILE) + i1=1; + if (h2->h->type&HTT_HELP_FILE) + i2=1; + i=i2-i1; + if (i) + return i; + else + return StrCmp(h1->h->str,h2->h->str); + } +} + +public U0 Who(U8 *fu_flags=NULL,CHashTable *h=NULL, +U8 *idx=NULL,CDoc *doc=NULL) +{//Dump hash symbol table. +// "+p" for only public symbols + // "+m" to order by number (normally alphabetical) + // "-r" just local hash table + CHashTable *table; + CHashSrcSym *temph; + CHashGeneric *ptr; + CWho *lst; + I64 cnt,i,j,k,f=0; + U8 buf[512],*st,*last_idx=StrNew(""),*cur_idx,*comment; + Bool recurse,publics,map; + CTask *task; + + ScanFlags(&f,Define("ST_FILE_UTIL_FLAGS"),"+r"); + ScanFlags(&f,Define("ST_FILE_UTIL_FLAGS"),fu_flags); + if (f&~(FUF_RECURSE|FUF_PUBLIC|FUF_MAP)) + throw('FUF'); + recurse=Bt(&f,FUf_RECURSE); + publics=Bt(&f,FUf_PUBLIC); + map =Bt(&f,FUf_MAP); + + if (!h) h=Fs->hash_table; + + if (idx) { + task=User; + TaskWait(task); + LBtr(&task->display_flags,DISPLAYf_SHOW); + } else + task=NULL; + + cnt=0; + table=h; + while (table) { + for (i=0;i<=table->mask;i++) { + temph=table->body[i]; + while (temph) { + if (!(temph->type & (HTF_IMPORT | HTF_PRIVATE)) && + (temph->type & HTF_PUBLIC || !publics)) { + if (!idx) + cnt++; + else if (temph->type&HTG_SRC_SYM && (cur_idx=temph->idx)) + cnt+=HelpIndexCnt(cur_idx,idx); + } + temph=temph->next; + } + } + if (recurse) + table=table->next; + else + break; + } + if (!cnt) goto wh_done; + + lst=CAlloc(cnt*sizeof(CWho)); + j=0; + table=h; + while (table) { + for (i=0;i<=table->mask;i++) { + temph=table->body[i]; + while (temph) { + if (!(temph->type & (HTF_IMPORT | HTF_PRIVATE)) && + (temph->type & HTF_PUBLIC || !publics)) + if (!idx) + lst[j++].h=temph; + else if (temph->type&HTG_SRC_SYM && (cur_idx=temph->idx) && + (k=HelpIndexCnt(cur_idx,idx))) + while (k--) { + lst[j].idx=HelpIndexStr(&cur_idx,idx); + lst[j++].h=temph; + } + temph=temph->next; + } + } + if (recurse) + table=table->next; + else + break; + } + + if (map) + QSort(lst,cnt,sizeof(CWho),&HashEntriesCompare2); + else if (idx) + QSort(lst,cnt,sizeof(CWho),&HashEntriesCompare3); + else + QSort(lst,cnt,sizeof(CWho),&HashEntriesCompare); + + if (idx) { + progress1_max=cnt; + progress1=0; + } + for (i=0;itype & HTT_HELP_FILE) { + DocPrint(doc,"$$WW,1$$"); + DocType(doc,ptr->str); + DocPrint(doc,"$$WW,0$$"); + } else { + if (ptr->type&HTG_SRC_SYM && ptr(CHashSrcSym *)->src_link) { + DocPrint(doc,"$$LK,\"%-20s\",A=\"%s\"$$", + ptr->str,ptr(CHashSrcSym *)->src_link); + if (idx) + comment=HelpComment(task,ptr,ptr(CHashSrcSym *)->src_link); + } else + DocPrint(doc,"%-20s",ptr->str); + + if (!idx) { + if (ptr->type & HTT_DEFINE_STR) { + st=MStrUtil(ptr(CHashDefineStr *)->data,SUF_SAFE_DOLLAR); + j=ptr(CHashDefineStr *)->cnt; + if (j==-1) + StrPrint(buf,"%-10tQ ",st); + else + StrPrint(buf,"%-10tQ %02X",st,j); + Free(st); + } else if (ptr->type & HTT_GLBL_VAR) + StrPrint(buf,"%010X ",ptr(CHashGlblVar *)->data_addr); + else + StrPrint(buf,"%010X ",HashVal(ptr)); + j=HashEntrySize(ptr); + if (j==-1) + CatPrint(buf," %04X ",ptr->use_cnt); + else + CatPrint(buf," %04X %010X ",ptr->use_cnt,j); + } else + *buf=0; + + k=ptr->type; + if (publics) + k&=~HTF_PUBLIC; + if (!(k&HTG_TYPE_MASK)) + CatPrint(buf,"NULL "); + while (k) { + j=Bsf(k); + if (j<0) + break; + Btr(&k,j); + CatPrint(buf,"%Z ",j,"ST_HTT_TYPES"); + } + DocPrint(doc,"%s",buf); + if (comment) { + DocPrint(doc,"$$GREEN$$%s$$FG$$",comment); + Free(comment); + } + DocPrint(doc,"\n"); + } + Free(lst[i].idx); + if (idx) + progress1++; + } + Free(lst); + if (idx) + progress1=progress1_max=0; + +wh_done: + if (doc) { + if (doc->head.next==doc) + DocPrint(doc,"No Match"); + else + DocRecalc(doc); + } + Free(last_idx); + Kill(task); +} + +#help_index "Info;Hash;Cmd Line (Typically)" + +#define HDR_MAX 16 +public I64 HashDepthRep(CHashTable *table=NULL) +{//Hash table linked-list chain depth report. +//Histogram of collision count. + I64 i,j,longest=0,cnt=0,a[HDR_MAX]; + CHash *temph; + if (!table) table=Fs->hash_table; + MemSet(a,0,sizeof(a)); + for (i=0;i<=table->mask;i++) { + temph=table->body[i]; + if (temph) { + j=LinkedLstCnt(temph); + if (jlongest) + longest=j; + } + } + "Histogram\n"; + for (i=0;imask+1,cnt,longest; + return longest; +} + +#help_index "Help System" +#help_file "::/Doc/HelpSystem" + +public U0 DocHelpIdx(CDoc *doc,U8 *idx) +{//Put to doc report for given help idx. + Who("+p",,idx,doc); +} + +public U0 PopUpHelpIndex(U8 *idx,CTask *parent=NULL) +{//PopUp win report for given help idx. + U8 *buf; + buf=MStrPrint("DocHelpIdx(DocPut,\"%s\");View;",idx); + PopUp(buf,parent); + Free(buf); +} + +#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"), + *absname=FileNameAbs(name); + CDoc *doc=DocRead(name); + CDocEntry *doc_e; + CHashSrcSym *temph; + I64 i,j,base=0; + CDbgInfo *dbg_info; + + FileExtRem(absname); + if (absname[1]==':' && StrLen(absname)>2 && + (temph=HashSingleTableFind(absname+2,Fs->hash_table,HTT_MODULE))) + base=temph(CHashGeneric *)->user_data0+sizeof(CBinFile); + + if (!doc) return; + doc_e=doc->head.next; + while (doc_e!=doc) { + if (doc_e->type_u8==DOCT_LINK) { + if (*doc_e->tag) + st=MStrUtil(doc_e->tag,SUF_REM_TRAILING); + else + st=MStrUtil(doc_e->aux_str,SUF_REM_TRAILING); + if (temph=HashSingleTableFind(st,Fs->hash_table,HTG_SRC_SYM)) { + if (*doc_e->tag) { + Free(temph->src_link); + temph->src_link=doc_e->aux_str; + ptr=temph->src_link; + if (ptr[0] && ptr[1] && ptr[2]==':') { + if (ptr[3]==':') + ptr[3]=blkdev.boot_drv_let; + else if (ptr[3]=='~') + ptr[3]=*blkdev.home_dir; + } + doc_e->aux_str=NULL; + } + if (temph->type&(HTT_FUN|HTT_EXPORT_SYS_SYM) && + !(dbg_info=temph->dbg_info) && doc_e->bin_data && + (dbg_info=doc_e->bin_data->data)) { + if (doc_e->bin_data->size>MSize(dbg_info)) + "Corrupt Map Entry\n"; + else { + doc_e->bin_data->data=NULL; + temph->dbg_info=dbg_info; + for (i=dbg_info->min_line;i<=dbg_info->max_line+1;i++) { + j=i-dbg_info->min_line; + if (dbg_info->body[j]) + dbg_info->body[j]=dbg_info->body[j]+base; + } + } + } + } + Free(st); + } + doc_e=doc_e->next; + } + DocDel(doc); + Free(name); + Free(absname); +} diff --git a/Adam/AInputPointer.CPP b/Adam/AInputPointer.CPP deleted file mode 100644 index 59c1c76..0000000 Binary files a/Adam/AInputPointer.CPP and /dev/null differ diff --git a/Adam/AInputPointer.HC b/Adam/AInputPointer.HC new file mode 100644 index 0000000..64c65ea Binary files /dev/null and b/Adam/AInputPointer.HC differ diff --git a/Adam/AMath.CPP b/Adam/AMath.HC similarity index 100% rename from Adam/AMath.CPP rename to Adam/AMath.HC diff --git a/Adam/AMathODE.CPP b/Adam/AMathODE.CPP deleted file mode 100644 index 831d569..0000000 --- a/Adam/AMathODE.CPP +++ /dev/null @@ -1,609 +0,0 @@ -#help_index "Math/ODE" -#help_file "::/Doc/ODE" - -//See $LK,"::/Doc/Credits.TXT"$. - -F64 LowPass1(F64 a,F64 y0,F64 y,F64 dt=1.0) -{//First order low pass filter - dt=Exp(-a*dt); - return y0*dt+y*(1.0-dt); -} - -U0 ODERstPtrs(CMathODE *ode) -{ - I64 s=ode->n_internal*sizeof(F64); - F64 *ptr=ode->array_base; - ode->state_internal=ptr; ptr(I64)+=s; - ode->state_scale=ptr; ptr(I64)+=s; - ode->DstateDt=ptr; ptr(I64)+=s; - ode->initial_state=ptr; ptr(I64)+=s; - ode->temp0=ptr; ptr(I64)+=s; - ode->temp1=ptr; ptr(I64)+=s; - ode->temp2=ptr; ptr(I64)+=s; - ode->temp3=ptr; ptr(I64)+=s; - ode->temp4=ptr; ptr(I64)+=s; - ode->temp5=ptr; ptr(I64)+=s; - ode->temp6=ptr; ptr(I64)+=s; - ode->temp7=ptr; -} - -public CMathODE *ODENew(I64 n,F64 max_tolerance=1e-6,I64 flags=0) -{//Make differential equation ctrl struct. See $LK,"flags",A="MN:ODEF_HAS_MASSES"$. - - //The tolerance is not precise. - //You can min_tolerance and it will - //dynamically adjust tolerance to utilize - //the CPU. - - I64 s=n*sizeof(F64); - CMathODE *ode=MAlloc(sizeof(CMathODE)); - - ode->t=0; - ode->t_scale=1.0; - ode->base_t=0; - ode->flags=flags; - ode->n_internal=ode->n=n; - ode->h=1e-6; - ode->h_min=1e-64; - ode->h_max=1e32; - ode->max_tolerance=ode->min_tolerance=ode->tolerance_internal=max_tolerance; - ode->win_task=ode->mem_task=Fs; - ode->derivative=NULL; - QueInit(&ode->next_mass); - QueInit(&ode->next_spring); - ode->acceleration_limit=ode->drag_v=ode->drag_v2=ode->drag_v3=0; - - ode->state=CAlloc(s); - ode->array_base=MAlloc(12*s); - ODERstPtrs(ode); - return ode; -} - -public U0 ODEDel(CMathODE *ode) -{//Free ODE node, but not masses or springs. - if (!ode) return; - Free(ode->state); - Free(ode->array_base); - Free(ode); -} - -public I64 ODESize(CMathODE *ode) -{//Mem size of ode ctrl, but not masses and springs. - if (!ode) - return 0; - else - return MSize2(ode->state)+MSize2(ode->array_base)+MSize2(ode); -} - -U0 ODESetMassesPtrs(CMathODE *ode,F64 *state,F64 *DstateDt) -{ - COrder2D3 *ptr1=state(F64 *)+ode->n, - *ptr2=DstateDt(F64 *)+ode->n; - CMass *tempm=ode->next_mass; - while (tempm!=&ode->next_mass) { - tempm->state=ptr1++; - tempm->DstateDt=ptr2++; - tempm=tempm->next; - } -} - -U0 ODEState2Internal(CMathODE *ode) -{ - CMass *tempm; - F64 *old_array_base; - I64 mass_cnt; - - if (ode->flags&ODEF_HAS_MASSES) { - mass_cnt=0; - tempm=ode->next_mass; - while (tempm!=&ode->next_mass) { - mass_cnt++; - tempm=tempm->next; - } - old_array_base=ode->array_base; - ode->n_internal=ode->n+6*mass_cnt; - ode->array_base=MAlloc(12*ode->n_internal*sizeof(F64),ode->mem_task); - Free(old_array_base); - ODERstPtrs(ode); - - ODESetMassesPtrs(ode,ode->state_internal,ode->state_internal); - tempm=ode->next_mass; - while (tempm!=&ode->next_mass) { - MemCpy(tempm->state,&tempm->saved_state,sizeof(COrder2D3)); - tempm=tempm->next; - } - } - MemCpy(ode->state_internal,ode->state,ode->n*sizeof(F64)); -} - -U0 ODEInternal2State(CMathODE *ode) -{ - CMass *tempm; - MemCpy(ode->state,ode->state_internal,ode->n*sizeof(F64)); - if (ode->flags&ODEF_HAS_MASSES) { - ODESetMassesPtrs(ode,ode->state_internal,ode->state_internal); - tempm=ode->next_mass; - while (tempm!=&ode->next_mass) { - MemCpy(&tempm->saved_state,tempm->state,sizeof(COrder2D3)); - tempm=tempm->next; - } - } -} - -public U0 ODERenum(CMathODE *ode) -{//Renumber masses and springs. - I64 i; - CSpring *temps; - CMass *tempm; - - i=0; - tempm=ode->next_mass; - while (tempm!=&ode->next_mass) { - tempm->num=i++; - tempm=tempm->next; - } - - i=0; - temps=ode->next_spring; - while (temps!=&ode->next_spring) { - temps->num=i++; - temps->end1_num=temps->end1->num; - temps->end2_num=temps->end2->num; - temps=temps->next; - } -} - -public CMass *MassFind(CMathODE *ode,F64 x,F64 y,F64 z=0) -{//Search for mass nearest to x,y,z. - CMass *tempm,*best_mass=NULL; - F64 dd,best_dd=MAX_F64; - - tempm=ode->next_mass; - while (tempm!=&ode->next_mass) { - dd=Sqr(tempm->x-x)+Sqr(tempm->y-y)+Sqr(tempm->z-z); - if (ddnext; - } - return best_mass; -} - -public CSpring *SpringFind(CMathODE *ode,F64 x,F64 y,F64 z=0) -{//Find spring midpoint nearest x,y,z. - CSpring *temps,*best_spring=NULL; - F64 dd,best_dd=MAX_F64; - - temps=ode->next_spring; - while (temps!=&ode->next_spring) { - dd=Sqr((temps->end1->x+temps->end2->x)/2-x)+ - Sqr((temps->end1->y+temps->end2->y)/2-y)+ - Sqr((temps->end1->z+temps->end2->z)/2-z); - if (ddnext; - } - return best_spring; -} - -public U0 MassOrSpringFind( - CMathODE *ode,CMass **res_mass,CSpring **res_spring, - F64 x,F64 y,F64 z=0) -{//Find spring or mass nearest x,y,z. - CMass *tempm,*best_mass=NULL; - CSpring *temps,*best_spring=NULL; - F64 dd,best_dd=MAX_F64; - - tempm=ode->next_mass; - while (tempm!=&ode->next_mass) { - dd=Sqr(tempm->x-x)+Sqr(tempm->y-y)+Sqr(tempm->z-z); - if (ddnext; - } - - temps=ode->next_spring; - while (temps!=&ode->next_spring) { - dd=Sqr((temps->end1->x+temps->end2->x)/2-x)+ - Sqr((temps->end1->y+temps->end2->y)/2-y)+ - Sqr((temps->end1->z+temps->end2->z)/2-z); - if (ddnext; - } - if (res_mass) *res_mass =best_mass; - if (res_spring) *res_spring=best_spring; -} - -public CMass *MassFindNum(CMathODE *ode,I64 num) -{//Return mass number N. - CMass *tempm=ode->next_mass; - while (tempm!=&ode->next_mass) { - if (tempm->num==num) - return tempm; - tempm=tempm->next; - } - return NULL; -} - -public U0 ODERstInactive(CMathODE *ode) -{//Set all masses and springs to ACTIVE for new trial. - CMass *tempm; - CSpring *temps; - tempm=ode->next_mass; - while (tempm!=&ode->next_mass) { - tempm->flags&=~MSF_INACTIVE; - tempm=tempm->next; - } - temps=ode->next_spring; - while (temps!=&ode->next_spring) { - temps->flags&=~SSF_INACTIVE; - temps=temps->next; - } -} - -U0 ODECalcSprings(CMathODE *ode) -{ - CSpring *temps=ode->next_spring; - CMass *e1,*e2; - F64 d; - CD3 p; - while (temps!=&ode->next_spring) { - if (temps->flags&SSF_INACTIVE) { - temps->displacement=0; - temps->f=0; - } else { - e1=temps->end1; - e2=temps->end2; - d=D3Norm(D3Sub(&p,&e2->state->x,&e1->state->x)); - temps->displacement=d-temps->rest_len; - temps->f=temps->displacement*temps->const; - if (temps->f>0 && temps->flags&SSF_NO_TENSION) - temps->f=0; - else if (temps->f<0 && temps->flags&SSF_NO_COMPRESSION) - temps->f=0; - if (d>0) { - D3MulEqu(&p,temps->f/d); - D3AddEqu(&e1->DstateDt->DxDt,&p); - D3SubEqu(&e2->DstateDt->DxDt,&p); - } - } - temps=temps->next; - } -} - -U0 ODECalcDrag(CMathODE *ode) -{ - CMass *tempm; - F64 d,dd; - CD3 p; - if (ode->drag_v || ode->drag_v2 || ode->drag_v3) { - tempm=ode->next_mass; - while (tempm!=&ode->next_mass) { - if (!(tempm->flags & MSF_INACTIVE) && - tempm->drag_profile_factor && - (dd=D3NormSqr(&tempm->state->DxDt))) { - d=ode->drag_v; - if (ode->drag_v2) - d+=ode->drag_v2*Sqrt(dd); - if (ode->drag_v3) - d+=dd*ode->drag_v3; - D3SubEqu(&tempm->DstateDt->DxDt, - D3Mul(&p,d*tempm->drag_profile_factor,&tempm->state->DxDt)); - } - tempm=tempm->next; - } - } -} - -U0 ODEApplyAccelerationLimit(CMathODE *ode) -{ - CMass *tempm; - F64 d; - if (ode->acceleration_limit) { - tempm=ode->next_mass; - while (tempm!=&ode->next_mass) { - if (!(tempm->flags & MSF_INACTIVE) && - (d=D3Norm(&tempm->DstateDt->DxDt))>ode->acceleration_limit) - D3MulEqu(&tempm->DstateDt->DxDt,ode->acceleration_limit/d); - tempm=tempm->next; - } - } -} - -U0 ODECallDerivative(CMathODE *ode,F64 t,F64 *state,F64 *DstateDt) -{ - CMass *tempm; - if (ode->flags&ODEF_HAS_MASSES) { - ODESetMassesPtrs(ode,state,DstateDt); - tempm=ode->next_mass; - while (tempm!=&ode->next_mass) { - if (!(tempm->flags&MSF_INACTIVE)) { - D3Zero(&tempm->DstateDt->DxDt); - D3Copy(&tempm->DstateDt->x,&tempm->state->DxDt); - } - tempm=tempm->next; - } - ODECalcSprings(ode); - ODECalcDrag(ode); - (*ode->derivative)(ode,t,state,DstateDt); - tempm=ode->next_mass; - while (tempm!=&ode->next_mass) { - if (!(tempm->flags&MSF_INACTIVE)) { - if (tempm->flags&MSF_FIXED) { - D3Zero(&tempm->DstateDt->DxDt); - D3Zero(&tempm->DstateDt->x); - } else if (tempm->mass) - D3DivEqu(&tempm->DstateDt->DxDt,tempm->mass); - } - tempm=tempm->next; - } - ODEApplyAccelerationLimit(ode); - } else - (*ode->derivative)(ode,t,state,DstateDt); -} - -U0 ODEOneStep(CMathODE *ode) -{ - I64 i; - ODECallDerivative(ode,ode->t,ode->state_internal,ode->DstateDt); - for (i=0;in_internal;i++) - ode->state_internal[i]+=ode->h*ode->DstateDt[i]; - ode->t+=ode->h; -} - -U0 ODERK4OneStep(CMathODE *ode) -{ - I64 i,n=ode->n_internal; - F64 xh,hh,h6,*dym,*dyt,*yt,*DstateDt; - - dym =ode->temp0; - dyt =ode->temp1; - yt =ode->temp2; - DstateDt=ode->temp3; - hh =0.5*ode->h; - h6 =ode->h / 6.0; - xh =ode->t + hh; - - ODECallDerivative(ode,ode->t,ode->state_internal,ode->DstateDt); - for (i=0;istate_internal[i]+hh*DstateDt[i]; - ODECallDerivative(ode,xh,yt,dyt); - for (i=0;istate_internal[i]+hh*dyt[i]; - ODECallDerivative(ode,xh,yt,dym); - for (i=0;istate_internal[i]+ode->h*dym[i]; - dym[i]+=dyt[i]; - } - ode->t+=ode->h; - ODECallDerivative(ode,ode->t,yt,dyt); - for (i=0;istate_internal[i]+=h6*(DstateDt[i]+dyt[i]+2.0*dym[i]); -} - -#define ODEa2 0.2 -#define ODEa3 0.3 -#define ODEa4 0.6 -#define ODEa5 1.0 -#define ODEa6 0.875 -#define ODEb21 0.2 -#define ODEb31 (3.0/40.0) -#define ODEb32 (9.0/40.0) -#define ODEb41 0.3 -#define ODEb42 (-0.9) -#define ODEb43 1.2 -#define ODEb51 (-11.0/54.0) -#define ODEb52 2.5 -#define ODEb53 (-70.0/27.0) -#define ODEb54 (35.0/27.0) -#define ODEb61 (1631.0/55296.0) -#define ODEb62 (175.0/512.0) -#define ODEb63 (575.0/13824.0) -#define ODEb64 (44275.0/110592.0) -#define ODEb65 (253.0/4096.0) -#define ODEc1 (37.0/378.0) -#define ODEc3 (250.0/621.0) -#define ODEc4 (125.0/594.0) -#define ODEc6 (512.0/1771.0) -#define ODEdc1 (37.0/378.0-2825.0/27648.0) -#define ODEdc3 (250.0/621.0-18575.0/48384.0) -#define ODEdc4 (125.0/594.0-13525.0/55296.0) -#define ODEdc5 (-277.0/14336.0) -#define ODEdc6 (512.0/1771.0-0.25) - -U0 ODECashKarp(CMathODE *ode) -{ - I64 i,n=ode->n_internal; - F64 h=ode->h,*state=ode->state_internal, - *DstateDt=ode->DstateDt,*ak2,*ak3,*ak4,*ak5,*ak6, - *tempstate,*stateerr,*outstate; - - ak2=ode->temp0; - ak3=ode->temp1; - ak4=ode->temp2; - ak5=ode->temp3; - ak6=ode->temp4; - tempstate=ode->temp5; - outstate=ode->temp6; - stateerr=ode->temp7; - - for (i=0;it+ODEa2*h,tempstate,ak2); - for (i=0;it+ODEa3*h,tempstate,ak3); - for (i=0;it+ODEa4*h,tempstate,ak4); - for (i=0;it+ODEa5*h,tempstate,ak5); - for (i=0;it+ODEa6*h,tempstate,ak6); - for (i=0;itemp6,*stateerr=ode->temp7; - while (TRUE) { - ode->h=Clamp(ode->h,ode->h_min,ode->h_max); - ODECashKarp(ode); - errmax=0.0; - for (i=0;in_internal;i++) { - temp=Abs(stateerr[i]/ode->state_scale[i]); - if (temp>errmax) - errmax=temp; - } - errmax/=ode->tolerance_internal; - if (errmax<=1.0 || ode->h==ode->h_min) break; - temp=ode->h*SAFETY*errmax`PSHRNK; - if (temp<0.1*ode->h) - ode->h*=0.1; - else - ode->h=temp; - } - ode->t+=ode->h; - if (errmax>ERRCON) - ode->h*=SAFETY*errmax`PGROW; - else - ode->h*=5.0; - ode->h=Clamp(ode->h,ode->h_min,ode->h_max); - MemCpy(ode->state_internal,tempstate,sizeof(F64)*ode->n_internal); -} - -F64 ode_alloced_factor=0.75; - -U0 ODEsUpdate(CTask *task) -{/* This routine is called by the $LK,"window mgr",A="FF:::/Adam/Gr/GrScreen.CPP,ODEsUpdate"$ on a continuous -basis to allow real-time simulation. It is intended -to provide ress good enough for games. It uses a runge-kutta -integrator which is a better algorithm than doing it with Euler. - -It is adaptive step-sized, so it slows down when an important -event is taking place to improve accuracy, but in my implementation -it has a timeout. -*/ - I64 i; - F64 d,start_time,timeout_time,t_desired,t_initial,interpolation; - CMathODE *ode; - - if (task->next_ode==&task->next_ode) - task->last_ode_time=0; - else if (!Bt(&task->win_inhibit,WIf_SELF_ODE)) { -//See $LK,"GrUpdateTasks",A="MN:GrUpdateTasks"$() and $LK,"GrUpdateTaskODEs",A="MN:GrUpdateTaskODEs"$(). - //We will not pick a time limit based on - //how busy the CPU is, what percent of the - //last refresh cycle was spent on ODE's - //and what the refresh cycle rate was. - start_time=tS; - d=1.0/winmgr.fps; - timeout_time=start_time+ - (task->last_ode_time/d+0.1)/(winmgr.last_ode_time/d+0.1)* - ode_alloced_factor*d; - ode=task->next_ode; - while (ode!=&task->next_ode) { - t_initial=ode->t; - d=tS; - if (!(ode->flags&ODEF_STARTED)) { - ode->base_t=d; - ode->flags|=ODEF_STARTED; - } - d-=ode->base_t+t_initial; - t_desired=ode->t_scale*d+t_initial; - if (ode->flags&ODEF_PAUSED) - ode->base_t+=t_desired-ode->t; //Slip - else if (ode->derivative) { - ODEState2Internal(ode); - MemCpy(ode->initial_state,ode->state_internal, - ode->n_internal*sizeof(F64)); - while (ode->th_max=t_desired-ode->t; - ODECallDerivative(ode,ode->t,ode->state_internal,ode->DstateDt); - for (i=0;in_internal;i++) - ode->state_scale[i]=Abs(ode->state_internal[i])+ - Abs(ode->DstateDt[i]*ode->h)+ode->tolerance_internal; - ODERK5OneStep(ode); - if (tS>timeout_time) { - ode->base_t+=t_desired-ode->t; //Slip - goto ode_done; - - } - } - - //Interpolate if end time was not exact. - if (ode->t!=t_desired) { - if (interpolation=ode->t-t_initial) { - interpolation=(t_desired-t_initial)/interpolation; - if (interpolation!=1.0) - for (i=0;in_internal;i++) - ode->state_internal[i]=(ode->state_internal[i]- - ode->initial_state[i])*interpolation+ - ode->initial_state[i]; - } - ode->t=t_desired; - } -ode_done: - ODEInternal2State(ode); - - //Convenience call to set vals - ODECallDerivative(ode,ode->t,ode->state_internal,ode->DstateDt); - } - ode->base_t+=(1.0-ode->t_scale)*d; - ode=ode->next; - } - - //Now, we will dynamically adjust tolerances. - - //We will regulate the tolerances - //to fill the time we decided was - //okay to devote to ODE's. - //Since we might have multiple ODE's - //active we scale them by the same factor. - - //This algorithm is probably not stable or very good, but it's something. - - //Target is 75% of alloced time. - d=(tS-start_time)/(timeout_time-start_time)-0.75; - - ode=task->next_ode; - while (ode!=&task->next_ode) { - if (!(ode->flags&ODEF_PAUSED) && ode->derivative) { - if (ode->min_tolerance!=ode->max_tolerance) { - if (d>0) - ode->tolerance_internal*=10.0`d; - else - ode->tolerance_internal*=2.0`d; - } - ode->tolerance_internal=Clamp(ode->tolerance_internal, - ode->min_tolerance,ode->max_tolerance); - } - ode=ode->next; - } - winmgr.ode_time+=task->last_ode_time=tS-start_time; - } -} diff --git a/Adam/AMathODE.HC b/Adam/AMathODE.HC new file mode 100644 index 0000000..844b773 --- /dev/null +++ b/Adam/AMathODE.HC @@ -0,0 +1,609 @@ +#help_index "Math/ODE" +#help_file "::/Doc/ODE" + +//See $LK,"::/Doc/Credits.DD"$. + +F64 LowPass1(F64 a,F64 y0,F64 y,F64 dt=1.0) +{//First order low pass filter + dt=Exp(-a*dt); + return y0*dt+y*(1.0-dt); +} + +U0 ODERstPtrs(CMathODE *ode) +{ + I64 s=ode->n_internal*sizeof(F64); + F64 *ptr=ode->array_base; + ode->state_internal=ptr; ptr(I64)+=s; + ode->state_scale=ptr; ptr(I64)+=s; + ode->DstateDt=ptr; ptr(I64)+=s; + ode->initial_state=ptr; ptr(I64)+=s; + ode->temp0=ptr; ptr(I64)+=s; + ode->temp1=ptr; ptr(I64)+=s; + ode->temp2=ptr; ptr(I64)+=s; + ode->temp3=ptr; ptr(I64)+=s; + ode->temp4=ptr; ptr(I64)+=s; + ode->temp5=ptr; ptr(I64)+=s; + ode->temp6=ptr; ptr(I64)+=s; + ode->temp7=ptr; +} + +public CMathODE *ODENew(I64 n,F64 max_tolerance=1e-6,I64 flags=0) +{//Make differential equation ctrl struct. See $LK,"flags",A="MN:ODEF_HAS_MASSES"$. + + //The tolerance is not precise. + //You can min_tolerance and it will + //dynamically adjust tolerance to utilize + //the CPU. + + I64 s=n*sizeof(F64); + CMathODE *ode=MAlloc(sizeof(CMathODE)); + + ode->t=0; + ode->t_scale=1.0; + ode->base_t=0; + ode->flags=flags; + ode->n_internal=ode->n=n; + ode->h=1e-6; + ode->h_min=1e-64; + ode->h_max=1e32; + ode->max_tolerance=ode->min_tolerance=ode->tolerance_internal=max_tolerance; + ode->win_task=ode->mem_task=Fs; + ode->derivative=NULL; + QueInit(&ode->next_mass); + QueInit(&ode->next_spring); + ode->acceleration_limit=ode->drag_v=ode->drag_v2=ode->drag_v3=0; + + ode->state=CAlloc(s); + ode->array_base=MAlloc(12*s); + ODERstPtrs(ode); + return ode; +} + +public U0 ODEDel(CMathODE *ode) +{//Free ODE node, but not masses or springs. + if (!ode) return; + Free(ode->state); + Free(ode->array_base); + Free(ode); +} + +public I64 ODESize(CMathODE *ode) +{//Mem size of ode ctrl, but not masses and springs. + if (!ode) + return 0; + else + return MSize2(ode->state)+MSize2(ode->array_base)+MSize2(ode); +} + +U0 ODESetMassesPtrs(CMathODE *ode,F64 *state,F64 *DstateDt) +{ + COrder2D3 *ptr1=state(F64 *)+ode->n, + *ptr2=DstateDt(F64 *)+ode->n; + CMass *tempm=ode->next_mass; + while (tempm!=&ode->next_mass) { + tempm->state=ptr1++; + tempm->DstateDt=ptr2++; + tempm=tempm->next; + } +} + +U0 ODEState2Internal(CMathODE *ode) +{ + CMass *tempm; + F64 *old_array_base; + I64 mass_cnt; + + if (ode->flags&ODEF_HAS_MASSES) { + mass_cnt=0; + tempm=ode->next_mass; + while (tempm!=&ode->next_mass) { + mass_cnt++; + tempm=tempm->next; + } + old_array_base=ode->array_base; + ode->n_internal=ode->n+6*mass_cnt; + ode->array_base=MAlloc(12*ode->n_internal*sizeof(F64),ode->mem_task); + Free(old_array_base); + ODERstPtrs(ode); + + ODESetMassesPtrs(ode,ode->state_internal,ode->state_internal); + tempm=ode->next_mass; + while (tempm!=&ode->next_mass) { + MemCpy(tempm->state,&tempm->saved_state,sizeof(COrder2D3)); + tempm=tempm->next; + } + } + MemCpy(ode->state_internal,ode->state,ode->n*sizeof(F64)); +} + +U0 ODEInternal2State(CMathODE *ode) +{ + CMass *tempm; + MemCpy(ode->state,ode->state_internal,ode->n*sizeof(F64)); + if (ode->flags&ODEF_HAS_MASSES) { + ODESetMassesPtrs(ode,ode->state_internal,ode->state_internal); + tempm=ode->next_mass; + while (tempm!=&ode->next_mass) { + MemCpy(&tempm->saved_state,tempm->state,sizeof(COrder2D3)); + tempm=tempm->next; + } + } +} + +public U0 ODERenum(CMathODE *ode) +{//Renumber masses and springs. + I64 i; + CSpring *temps; + CMass *tempm; + + i=0; + tempm=ode->next_mass; + while (tempm!=&ode->next_mass) { + tempm->num=i++; + tempm=tempm->next; + } + + i=0; + temps=ode->next_spring; + while (temps!=&ode->next_spring) { + temps->num=i++; + temps->end1_num=temps->end1->num; + temps->end2_num=temps->end2->num; + temps=temps->next; + } +} + +public CMass *MassFind(CMathODE *ode,F64 x,F64 y,F64 z=0) +{//Search for mass nearest to x,y,z. + CMass *tempm,*best_mass=NULL; + F64 dd,best_dd=MAX_F64; + + tempm=ode->next_mass; + while (tempm!=&ode->next_mass) { + dd=Sqr(tempm->x-x)+Sqr(tempm->y-y)+Sqr(tempm->z-z); + if (ddnext; + } + return best_mass; +} + +public CSpring *SpringFind(CMathODE *ode,F64 x,F64 y,F64 z=0) +{//Find spring midpoint nearest x,y,z. + CSpring *temps,*best_spring=NULL; + F64 dd,best_dd=MAX_F64; + + temps=ode->next_spring; + while (temps!=&ode->next_spring) { + dd=Sqr((temps->end1->x+temps->end2->x)/2-x)+ + Sqr((temps->end1->y+temps->end2->y)/2-y)+ + Sqr((temps->end1->z+temps->end2->z)/2-z); + if (ddnext; + } + return best_spring; +} + +public U0 MassOrSpringFind( + CMathODE *ode,CMass **res_mass,CSpring **res_spring, + F64 x,F64 y,F64 z=0) +{//Find spring or mass nearest x,y,z. + CMass *tempm,*best_mass=NULL; + CSpring *temps,*best_spring=NULL; + F64 dd,best_dd=MAX_F64; + + tempm=ode->next_mass; + while (tempm!=&ode->next_mass) { + dd=Sqr(tempm->x-x)+Sqr(tempm->y-y)+Sqr(tempm->z-z); + if (ddnext; + } + + temps=ode->next_spring; + while (temps!=&ode->next_spring) { + dd=Sqr((temps->end1->x+temps->end2->x)/2-x)+ + Sqr((temps->end1->y+temps->end2->y)/2-y)+ + Sqr((temps->end1->z+temps->end2->z)/2-z); + if (ddnext; + } + if (res_mass) *res_mass =best_mass; + if (res_spring) *res_spring=best_spring; +} + +public CMass *MassFindNum(CMathODE *ode,I64 num) +{//Return mass number N. + CMass *tempm=ode->next_mass; + while (tempm!=&ode->next_mass) { + if (tempm->num==num) + return tempm; + tempm=tempm->next; + } + return NULL; +} + +public U0 ODERstInactive(CMathODE *ode) +{//Set all masses and springs to ACTIVE for new trial. + CMass *tempm; + CSpring *temps; + tempm=ode->next_mass; + while (tempm!=&ode->next_mass) { + tempm->flags&=~MSF_INACTIVE; + tempm=tempm->next; + } + temps=ode->next_spring; + while (temps!=&ode->next_spring) { + temps->flags&=~SSF_INACTIVE; + temps=temps->next; + } +} + +U0 ODECalcSprings(CMathODE *ode) +{ + CSpring *temps=ode->next_spring; + CMass *e1,*e2; + F64 d; + CD3 p; + while (temps!=&ode->next_spring) { + if (temps->flags&SSF_INACTIVE) { + temps->displacement=0; + temps->f=0; + } else { + e1=temps->end1; + e2=temps->end2; + d=D3Norm(D3Sub(&p,&e2->state->x,&e1->state->x)); + temps->displacement=d-temps->rest_len; + temps->f=temps->displacement*temps->const; + if (temps->f>0 && temps->flags&SSF_NO_TENSION) + temps->f=0; + else if (temps->f<0 && temps->flags&SSF_NO_COMPRESSION) + temps->f=0; + if (d>0) { + D3MulEqu(&p,temps->f/d); + D3AddEqu(&e1->DstateDt->DxDt,&p); + D3SubEqu(&e2->DstateDt->DxDt,&p); + } + } + temps=temps->next; + } +} + +U0 ODECalcDrag(CMathODE *ode) +{ + CMass *tempm; + F64 d,dd; + CD3 p; + if (ode->drag_v || ode->drag_v2 || ode->drag_v3) { + tempm=ode->next_mass; + while (tempm!=&ode->next_mass) { + if (!(tempm->flags & MSF_INACTIVE) && + tempm->drag_profile_factor && + (dd=D3NormSqr(&tempm->state->DxDt))) { + d=ode->drag_v; + if (ode->drag_v2) + d+=ode->drag_v2*Sqrt(dd); + if (ode->drag_v3) + d+=dd*ode->drag_v3; + D3SubEqu(&tempm->DstateDt->DxDt, + D3Mul(&p,d*tempm->drag_profile_factor,&tempm->state->DxDt)); + } + tempm=tempm->next; + } + } +} + +U0 ODEApplyAccelerationLimit(CMathODE *ode) +{ + CMass *tempm; + F64 d; + if (ode->acceleration_limit) { + tempm=ode->next_mass; + while (tempm!=&ode->next_mass) { + if (!(tempm->flags & MSF_INACTIVE) && + (d=D3Norm(&tempm->DstateDt->DxDt))>ode->acceleration_limit) + D3MulEqu(&tempm->DstateDt->DxDt,ode->acceleration_limit/d); + tempm=tempm->next; + } + } +} + +U0 ODECallDerivative(CMathODE *ode,F64 t,F64 *state,F64 *DstateDt) +{ + CMass *tempm; + if (ode->flags&ODEF_HAS_MASSES) { + ODESetMassesPtrs(ode,state,DstateDt); + tempm=ode->next_mass; + while (tempm!=&ode->next_mass) { + if (!(tempm->flags&MSF_INACTIVE)) { + D3Zero(&tempm->DstateDt->DxDt); + D3Copy(&tempm->DstateDt->x,&tempm->state->DxDt); + } + tempm=tempm->next; + } + ODECalcSprings(ode); + ODECalcDrag(ode); + (*ode->derivative)(ode,t,state,DstateDt); + tempm=ode->next_mass; + while (tempm!=&ode->next_mass) { + if (!(tempm->flags&MSF_INACTIVE)) { + if (tempm->flags&MSF_FIXED) { + D3Zero(&tempm->DstateDt->DxDt); + D3Zero(&tempm->DstateDt->x); + } else if (tempm->mass) + D3DivEqu(&tempm->DstateDt->DxDt,tempm->mass); + } + tempm=tempm->next; + } + ODEApplyAccelerationLimit(ode); + } else + (*ode->derivative)(ode,t,state,DstateDt); +} + +U0 ODEOneStep(CMathODE *ode) +{ + I64 i; + ODECallDerivative(ode,ode->t,ode->state_internal,ode->DstateDt); + for (i=0;in_internal;i++) + ode->state_internal[i]+=ode->h*ode->DstateDt[i]; + ode->t+=ode->h; +} + +U0 ODERK4OneStep(CMathODE *ode) +{ + I64 i,n=ode->n_internal; + F64 xh,hh,h6,*dym,*dyt,*yt,*DstateDt; + + dym =ode->temp0; + dyt =ode->temp1; + yt =ode->temp2; + DstateDt=ode->temp3; + hh =0.5*ode->h; + h6 =ode->h / 6.0; + xh =ode->t + hh; + + ODECallDerivative(ode,ode->t,ode->state_internal,ode->DstateDt); + for (i=0;istate_internal[i]+hh*DstateDt[i]; + ODECallDerivative(ode,xh,yt,dyt); + for (i=0;istate_internal[i]+hh*dyt[i]; + ODECallDerivative(ode,xh,yt,dym); + for (i=0;istate_internal[i]+ode->h*dym[i]; + dym[i]+=dyt[i]; + } + ode->t+=ode->h; + ODECallDerivative(ode,ode->t,yt,dyt); + for (i=0;istate_internal[i]+=h6*(DstateDt[i]+dyt[i]+2.0*dym[i]); +} + +#define ODEa2 0.2 +#define ODEa3 0.3 +#define ODEa4 0.6 +#define ODEa5 1.0 +#define ODEa6 0.875 +#define ODEb21 0.2 +#define ODEb31 (3.0/40.0) +#define ODEb32 (9.0/40.0) +#define ODEb41 0.3 +#define ODEb42 (-0.9) +#define ODEb43 1.2 +#define ODEb51 (-11.0/54.0) +#define ODEb52 2.5 +#define ODEb53 (-70.0/27.0) +#define ODEb54 (35.0/27.0) +#define ODEb61 (1631.0/55296.0) +#define ODEb62 (175.0/512.0) +#define ODEb63 (575.0/13824.0) +#define ODEb64 (44275.0/110592.0) +#define ODEb65 (253.0/4096.0) +#define ODEc1 (37.0/378.0) +#define ODEc3 (250.0/621.0) +#define ODEc4 (125.0/594.0) +#define ODEc6 (512.0/1771.0) +#define ODEdc1 (37.0/378.0-2825.0/27648.0) +#define ODEdc3 (250.0/621.0-18575.0/48384.0) +#define ODEdc4 (125.0/594.0-13525.0/55296.0) +#define ODEdc5 (-277.0/14336.0) +#define ODEdc6 (512.0/1771.0-0.25) + +U0 ODECashKarp(CMathODE *ode) +{ + I64 i,n=ode->n_internal; + F64 h=ode->h,*state=ode->state_internal, + *DstateDt=ode->DstateDt,*ak2,*ak3,*ak4,*ak5,*ak6, + *tempstate,*stateerr,*outstate; + + ak2=ode->temp0; + ak3=ode->temp1; + ak4=ode->temp2; + ak5=ode->temp3; + ak6=ode->temp4; + tempstate=ode->temp5; + outstate=ode->temp6; + stateerr=ode->temp7; + + for (i=0;it+ODEa2*h,tempstate,ak2); + for (i=0;it+ODEa3*h,tempstate,ak3); + for (i=0;it+ODEa4*h,tempstate,ak4); + for (i=0;it+ODEa5*h,tempstate,ak5); + for (i=0;it+ODEa6*h,tempstate,ak6); + for (i=0;itemp6,*stateerr=ode->temp7; + while (TRUE) { + ode->h=Clamp(ode->h,ode->h_min,ode->h_max); + ODECashKarp(ode); + errmax=0.0; + for (i=0;in_internal;i++) { + temp=Abs(stateerr[i]/ode->state_scale[i]); + if (temp>errmax) + errmax=temp; + } + errmax/=ode->tolerance_internal; + if (errmax<=1.0 || ode->h==ode->h_min) break; + temp=ode->h*SAFETY*errmax`PSHRNK; + if (temp<0.1*ode->h) + ode->h*=0.1; + else + ode->h=temp; + } + ode->t+=ode->h; + if (errmax>ERRCON) + ode->h*=SAFETY*errmax`PGROW; + else + ode->h*=5.0; + ode->h=Clamp(ode->h,ode->h_min,ode->h_max); + MemCpy(ode->state_internal,tempstate,sizeof(F64)*ode->n_internal); +} + +F64 ode_alloced_factor=0.75; + +U0 ODEsUpdate(CTask *task) +{/* This routine is called by the $LK,"window mgr",A="FF:::/Adam/Gr/GrScreen.HC,ODEsUpdate"$ on a continuous +basis to allow real-time simulation. It is intended +to provide ress good enough for games. It uses a runge-kutta +integrator which is a better algorithm than doing it with Euler. + +It is adaptive step-sized, so it slows down when an important +event is taking place to improve accuracy, but in my implementation +it has a timeout. +*/ + I64 i; + F64 d,start_time,timeout_time,t_desired,t_initial,interpolation; + CMathODE *ode; + + if (task->next_ode==&task->next_ode) + task->last_ode_time=0; + else if (!Bt(&task->win_inhibit,WIf_SELF_ODE)) { +//See $LK,"GrUpdateTasks",A="MN:GrUpdateTasks"$() and $LK,"GrUpdateTaskODEs",A="MN:GrUpdateTaskODEs"$(). + //We will not pick a time limit based on + //how busy the CPU is, what percent of the + //last refresh cycle was spent on ODE's + //and what the refresh cycle rate was. + start_time=tS; + d=1.0/winmgr.fps; + timeout_time=start_time+ + (task->last_ode_time/d+0.1)/(winmgr.last_ode_time/d+0.1)* + ode_alloced_factor*d; + ode=task->next_ode; + while (ode!=&task->next_ode) { + t_initial=ode->t; + d=tS; + if (!(ode->flags&ODEF_STARTED)) { + ode->base_t=d; + ode->flags|=ODEF_STARTED; + } + d-=ode->base_t+t_initial; + t_desired=ode->t_scale*d+t_initial; + if (ode->flags&ODEF_PAUSED) + ode->base_t+=t_desired-ode->t; //Slip + else if (ode->derivative) { + ODEState2Internal(ode); + MemCpy(ode->initial_state,ode->state_internal, + ode->n_internal*sizeof(F64)); + while (ode->th_max=t_desired-ode->t; + ODECallDerivative(ode,ode->t,ode->state_internal,ode->DstateDt); + for (i=0;in_internal;i++) + ode->state_scale[i]=Abs(ode->state_internal[i])+ + Abs(ode->DstateDt[i]*ode->h)+ode->tolerance_internal; + ODERK5OneStep(ode); + if (tS>timeout_time) { + ode->base_t+=t_desired-ode->t; //Slip + goto ode_done; + + } + } + + //Interpolate if end time was not exact. + if (ode->t!=t_desired) { + if (interpolation=ode->t-t_initial) { + interpolation=(t_desired-t_initial)/interpolation; + if (interpolation!=1.0) + for (i=0;in_internal;i++) + ode->state_internal[i]=(ode->state_internal[i]- + ode->initial_state[i])*interpolation+ + ode->initial_state[i]; + } + ode->t=t_desired; + } +ode_done: + ODEInternal2State(ode); + + //Convenience call to set vals + ODECallDerivative(ode,ode->t,ode->state_internal,ode->DstateDt); + } + ode->base_t+=(1.0-ode->t_scale)*d; + ode=ode->next; + } + + //Now, we will dynamically adjust tolerances. + + //We will regulate the tolerances + //to fill the time we decided was + //okay to devote to ODE's. + //Since we might have multiple ODE's + //active we scale them by the same factor. + + //This algorithm is probably not stable or very good, but it's something. + + //Target is 75% of alloced time. + d=(tS-start_time)/(timeout_time-start_time)-0.75; + + ode=task->next_ode; + while (ode!=&task->next_ode) { + if (!(ode->flags&ODEF_PAUSED) && ode->derivative) { + if (ode->min_tolerance!=ode->max_tolerance) { + if (d>0) + ode->tolerance_internal*=10.0`d; + else + ode->tolerance_internal*=2.0`d; + } + ode->tolerance_internal=Clamp(ode->tolerance_internal, + ode->min_tolerance,ode->max_tolerance); + } + ode=ode->next; + } + winmgr.ode_time+=task->last_ode_time=tS-start_time; + } +} diff --git a/Adam/AMem.CPP b/Adam/AMem.HC similarity index 100% rename from Adam/AMem.CPP rename to Adam/AMem.HC diff --git a/Adam/ARegistry.CPP b/Adam/ARegistry.CPP deleted file mode 100644 index 7858a69..0000000 --- a/Adam/ARegistry.CPP +++ /dev/null @@ -1,106 +0,0 @@ -#help_index "Misc/Registry" -#define REGISTRY_FILENAME "~/Registry.CPP.Z" -CDoc *sys_registry_doc=NULL; -I64 sys_msg_flags[1]={0}; -F64 registry_version; - -Bool RegCache() -{ - Bool old_silent; - if (!sys_registry_doc) { - old_silent=Silent; - sys_registry_doc=DocRead(REGISTRY_FILENAME); - Silent(old_silent); - return FALSE; - } else - return TRUE; -} - -public Bool RegSetDftEntry(U8 *path,U8 *val,Bool is_adam_entry=FALSE) -{//Add code doc tree branch to registry. - Bool res,unlock_doc; - RegCache; - unlock_doc=DocLock(sys_registry_doc); - if (!DocTreeFind(sys_registry_doc,path)) { - DocTreeMake(sys_registry_doc,path); - DocPrint(sys_registry_doc,"%s",val); - if (is_adam_entry) { - if (Fs==adam_task) - ExePrint("%s",val); - else - Adam("%s",val); - } - if (DrvIsWritable(*sys_registry_doc->filename.name)) - DocWrite(sys_registry_doc); - res=FALSE; - } else - res=TRUE; - if (unlock_doc) - DocUnlock(sys_registry_doc); - return res; -} - -public I64 RegExeBranch(U8 *path) -{//Execute doc tree branch in registry. - RegCache; - return DocTreeBranchExe(sys_registry_doc,path); -} - -public Bool RegWriteBranch(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); - 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); - return res; -} - -public Bool OneTimePopUp(U8 *_flags,I64 flag_num,U8 *msg) -{//See $LK,"::/Apps/X-Caliber/X-Caliber.CPP"$. - Bool res=FALSE; - CDoc *doc=DocNew; - CDocEntry *doc_e; - if (!Bt(_flags,flag_num)) { - if (msg) DocPrint(doc,"%s",msg); - doc_e=DocPrint(doc,"\n$$CB,\"Do not show this msg again.\",LE=1$$"); - DocPrint(doc,"$$CM+CX,0,4$$$$BT,\"OKAY\",LE=1$$\n"); - if (PopUpMenu(doc)==1 && doc_e->de_flags&DOCEF_CHECKED_COLLAPSED) { - LBts(_flags,flag_num); - res=TRUE; - } - DocDel(doc); - } - return res; -} - -U0 RegOneTimePopUp(I64 flag_num,U8 *msg) -{//You're not supposed to make system pop-up flags, only me. - if (OneTimePopUp(sys_msg_flags,flag_num,msg)) - RegWriteBranch("Adam/SysMsgFlags","sys_msg_flags[0]=0x%X;\n", - sys_msg_flags[0]); -} - -U0 RegInit() -{ - U8 buf[STR_LEN]; - Bool version_present; - RegSetDftEntry("Adam/SysMsgFlags","sys_msg_flags[0]=0;\n",TRUE); - StrPrint(buf,"registry_version=%4.3f;\n",os_version); - version_present=RegSetDftEntry("Adam/SysRegVer",buf,TRUE); - RegExeBranch("Adam"); - if (registry_version!=os_version) { - RegWriteBranch("Adam/SysRegVer",buf); - RegExeBranch("Adam"); - } -} diff --git a/Adam/ARegistry.HC b/Adam/ARegistry.HC new file mode 100644 index 0000000..e5894b8 --- /dev/null +++ b/Adam/ARegistry.HC @@ -0,0 +1,106 @@ +#help_index "Misc/Registry" +#define REGISTRY_FILENAME "~/Registry.HC.Z" +CDoc *sys_registry_doc=NULL; +I64 sys_msg_flags[1]={0}; +F64 registry_version; + +Bool RegCache() +{ + Bool old_silent; + if (!sys_registry_doc) { + old_silent=Silent; + sys_registry_doc=DocRead(REGISTRY_FILENAME); + Silent(old_silent); + return FALSE; + } else + return TRUE; +} + +public Bool RegSetDftEntry(U8 *path,U8 *val,Bool is_adam_entry=FALSE) +{//Add code doc tree branch to registry. + Bool res,unlock_doc; + RegCache; + unlock_doc=DocLock(sys_registry_doc); + if (!DocTreeFind(sys_registry_doc,path)) { + DocTreeMake(sys_registry_doc,path); + DocPrint(sys_registry_doc,"%s",val); + if (is_adam_entry) { + if (Fs==adam_task) + ExePrint("%s",val); + else + Adam("%s",val); + } + if (DrvIsWritable(*sys_registry_doc->filename.name)) + DocWrite(sys_registry_doc); + res=FALSE; + } else + res=TRUE; + if (unlock_doc) + DocUnlock(sys_registry_doc); + return res; +} + +public I64 RegExeBranch(U8 *path) +{//Execute doc tree branch in registry. + RegCache; + return DocTreeBranchExe(sys_registry_doc,path); +} + +public Bool RegWriteBranch(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); + 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); + return res; +} + +public Bool OneTimePopUp(U8 *_flags,I64 flag_num,U8 *msg) +{//See $LK,"::/Apps/X-Caliber/X-Caliber.HC"$. + Bool res=FALSE; + CDoc *doc=DocNew; + CDocEntry *doc_e; + if (!Bt(_flags,flag_num)) { + if (msg) DocPrint(doc,"%s",msg); + doc_e=DocPrint(doc,"\n$$CB,\"Do not show this msg again.\",LE=1$$"); + DocPrint(doc,"$$CM+CX,0,4$$$$BT,\"OKAY\",LE=1$$\n"); + if (PopUpMenu(doc)==1 && doc_e->de_flags&DOCEF_CHECKED_COLLAPSED) { + LBts(_flags,flag_num); + res=TRUE; + } + DocDel(doc); + } + return res; +} + +U0 RegOneTimePopUp(I64 flag_num,U8 *msg) +{//You're not supposed to make system pop-up flags, only me. + if (OneTimePopUp(sys_msg_flags,flag_num,msg)) + RegWriteBranch("Adam/SysMsgFlags","sys_msg_flags[0]=0x%X;\n", + sys_msg_flags[0]); +} + +U0 RegInit() +{ + U8 buf[STR_LEN]; + Bool version_present; + RegSetDftEntry("Adam/SysMsgFlags","sys_msg_flags[0]=0;\n",TRUE); + StrPrint(buf,"registry_version=%4.3f;\n",os_version); + version_present=RegSetDftEntry("Adam/SysRegVer",buf,TRUE); + RegExeBranch("Adam"); + if (registry_version!=os_version) { + RegWriteBranch("Adam/SysRegVer",buf); + RegExeBranch("Adam"); + } +} diff --git a/Adam/AutoComplete/ACDictGen.CPP b/Adam/AutoComplete/ACDictGen.CPP deleted file mode 100644 index 82d38a4..0000000 --- a/Adam/AutoComplete/ACDictGen.CPP +++ /dev/null @@ -1,263 +0,0 @@ -/* -This file is a stand-alone program -which will regenerate processed dictionary -files from a raw Project Gutenberg -dictionary file. - -$TX,"http://www.templeos.org/files/DICTIONARY.TXT",HTML="http://www.templeos.org/files/DICTIONARY.TXT"$ - -See $LK,"::/Doc/Credits.TXT"$. -*/ - -U0 ACDPreprocess(U8 *in_name,U8 *out_name) -{/* ---> -$$ --> $$$$ -\'89 --> ‰ -*/ - I64 ch,i; - U8 *src,*dst; - CDoc *doc; - CDocEntry *doc_e; - if (doc=DocRead(in_name,DOCF_PLAIN_TEXT_TABS|DOCF_DBL_DOLLARS)) { - doc_e=doc->head.next; - while (doc_e!=doc) { - if (doc_e->type_u8==DOCT_TEXT) { - src=dst=doc_e->tag; - while (ch=*src++) { - if (ch=='\\' && *src=='\'') { - src++; - i=0; - ch=ToUpper(*src++); - if ('0'<=ch<='9') - i+=ch-'0'; - else if ('A'<=ch<='F') - i+=ch-'A'+10; - i<<=4; - ch=ToUpper(*src++); - if ('0'<=ch<='9') - i+=ch-'0'; - else if ('A'<=ch<='F') - i+=ch-'A'+10; - *dst++=i; - } else - *dst++=ch; - } - *dst=0; - } - doc_e=doc_e->next; - } - StrCpy(doc->filename.name,out_name); - DocWrite(doc); - DocDel(doc); - } -} - -I64 ACDNextCmd(U8 **_ptr) -{ - U8 *ptr=*_ptr,*ptr2; - I64 ch,res=-1; - do { - do { - if (!(ch=*ptr++)) goto ncmd_done; - } while (ch!='<'); - - ptr2=ptr; - do { - if (!(ch=*ptr2++)) goto ncmd_done; - } while (ch!='>'); - *--ptr2=0; - res=LstMatch(ptr,"h1\0/h1\0def\0/def\0hw\0/hw\0tt\0/tt\0" - "ety\0@fld\0@cd\0@blockquote\0@wordforms\0@note\0@altname\0@chform\0" - "@cref\0@syn\0/ety\0@/fld\0@/cd\0@/blockquote\0@/wordforms\0@/note\0" - "@/altname\0@/chform\0@/cref\0@/syn\0"); - *ptr2++='>'; - ptr=ptr2; - } while (res<0); - - ncmd_done: - *_ptr=ptr; - return res; -} - -U8 *ACDNextEntry(U8 **_ptr) -{ - U8 *res,*ignore,*ptr=*_ptr,buf[ACD_BLK_SIZE],*out_ptr=buf; - I64 ch,l; - while (TRUE) { - while (TRUE) { - if (!(ch=*ptr++)) goto nentry_done; - if (ch!='<') { - *out_ptr++=ch; - if (ch=='$$') - *out_ptr++=ch; - } else - break; - } - ignore="b>\0i>\0ppp>\0/b>\0/i>\0/p>\0" - "ets>\0col>\0spn>\0/ets>\0/col>\0/spn>\0er>\0as>\0cs>\0cd>\0ex>\0" - "/er>\0/as>\0/cs>\0/cd>\0/ex>\0" - "note>\0/note>\0blockquote>\0/blockquote>\0"; - while (*ignore) { - l=StrLen(ignore); - if (!StrNCmp(ptr,ignore,l)) { - ptr+=l; - break; - } else - ignore+=l+1; - } - if (!*ignore) - break; - } -nentry_done: - *out_ptr++=0; - res=StrNew(buf); - *_ptr=ptr-1; - return res; -} - -I64 ACDCompareWords(U8 *e1,U8 *e2) -{ - return StrICmp(e1,e2); -} - -U8 *ACDSortWords(U8 *start,I64 size,I64 word_cnt) -{ - U8 **ptr_array=MAlloc(sizeof(U8 *)*word_cnt), - *out_start=MAlloc(size), - *ptr=start,*ptr2; - I64 i=0; - while (*ptr) { - ptr_array[i++]=ptr; - ptr+=StrLen(ptr)+3; - } - "Sorting...\n"; Sleep(100); - QSortI64(ptr_array,word_cnt,&ACDCompareWords); - "Done...\n"; Sleep(100); - - ptr=out_start; - for (i=0;ilargest_entry) - largest_entry=out_ptr-def_word_start; - def_word_start=out_ptr; - if (st=ACDNextEntry(&in_ptr)) { - if (*st) { - if (StrICmp(st,last_word)) { - word_cnt++; - - *word_ptr++=ACD_WORD_CHAR; - last_word=word_ptr; - StrCpy(word_ptr,st); - word_ptr+=StrLen(st)+1; - - d=word_ptr; - *d=(out_ptr-out_start)/ACD_BLK_SIZE; - word_ptr+=2; - - *out_ptr++=ACD_WORD_CHAR; - StrCpy(out_ptr,st); - out_ptr+=StrLen(st)+1; - } - Free(st); - - do { - do { - cmd=ACDNextCmd(&in_ptr); - if (cmd==ACD_H1) - goto next_word; - } while (cmd>=0 && !(cmd==ACD_DEF||cmd==ACD_PRONUNCIATION|| - cmd==ACD_POS||cmd==ACD_EXTRA)); - if (cmd==ACD_DEF) { - if(st=ACDNextEntry(&in_ptr)) { - if (*st) { - *out_ptr++=ACD_DEF_CHAR; - StrCpy(out_ptr,st); - out_ptr+=StrLen(st)+1; - } - Free(st); - } - } else if (cmd==ACD_PRONUNCIATION) { - if(st=ACDNextEntry(&in_ptr)) { - if (*st) { - *out_ptr++=ACD_PRONUNCIATION_CHAR; - StrCpy(out_ptr,st); - out_ptr+=StrLen(st)+1; - } - Free(st); - } - } else if (cmd==ACD_POS) { - if(st=ACDNextEntry(&in_ptr)) { - if (*st) { - *out_ptr++=ACD_POS_CHAR; - StrCpy(out_ptr,st); - out_ptr+=StrLen(st)+1; - } - Free(st); - } - } else if (cmd==ACD_EXTRA) { - if(st=ACDNextEntry(&in_ptr)) { - if (*st) { - *out_ptr++=ACD_EXTRA_CHAR; - StrCpy(out_ptr,st); - out_ptr+=StrLen(st)+1; - } - Free(st); - } - } - } while (cmd==ACD_DEF||cmd==ACD_PRONUNCIATION|| - cmd==ACD_POS||cmd==ACD_EXTRA); - } else - Free(st); - } - } - } while (cmd>=0); - *out_ptr++=ACD_END_CHAR; - *word_ptr++=ACD_END_CHAR; - - Free(in_start); - - "Blk Size :%d\n",ACD_BLK_SIZE; - "Blk Cnt :%04X\n",(out_ptr-out_start+ACD_BLK_SIZE-1)/ACD_BLK_SIZE; - "Largest Entry :%d\n",largest_entry; - "Word Count :%d\n",word_cnt; - - FileWrite(ACD_DEF_FILENAME,out_start,out_ptr-out_start); - "Def File Size :%d\n",out_ptr-out_start; - - sorted_word_start=ACDSortWords(word_start,word_ptr-word_start,word_cnt); - FileWrite(ACD_WORD_FILENAME,sorted_word_start,word_ptr-word_start); - "Word File Size:%d\n",word_ptr-word_start; - - Free(out_start); - Free(word_start); - Free(sorted_word_start); -} - -Cd(__DIR__); -ACDPreprocess("DICTIONARY.TXT","DICTIONARY2.TXT"); -ACDGen("DICTIONARY2.TXT"); diff --git a/Adam/AutoComplete/ACDictGen.HC b/Adam/AutoComplete/ACDictGen.HC new file mode 100644 index 0000000..e7864c9 --- /dev/null +++ b/Adam/AutoComplete/ACDictGen.HC @@ -0,0 +1,263 @@ +/* +This file is a stand-alone program +which will regenerate processed dictionary +files from a raw Project Gutenberg +dictionary file. + +$TX,"http://www.templeos.org/files/DICTIONARY.DD",HTML="http://www.templeos.org/files/DICTIONARY.DD"$ + +See $LK,"::/Doc/Credits.DD"$. +*/ + +U0 ACDPreprocess(U8 *in_name,U8 *out_name) +{/* +--> +$$ --> $$$$ +\'89 --> ‰ +*/ + I64 ch,i; + U8 *src,*dst; + CDoc *doc; + CDocEntry *doc_e; + if (doc=DocRead(in_name,DOCF_PLAIN_TEXT_TABS|DOCF_DBL_DOLLARS)) { + doc_e=doc->head.next; + while (doc_e!=doc) { + if (doc_e->type_u8==DOCT_TEXT) { + src=dst=doc_e->tag; + while (ch=*src++) { + if (ch=='\\' && *src=='\'') { + src++; + i=0; + ch=ToUpper(*src++); + if ('0'<=ch<='9') + i+=ch-'0'; + else if ('A'<=ch<='F') + i+=ch-'A'+10; + i<<=4; + ch=ToUpper(*src++); + if ('0'<=ch<='9') + i+=ch-'0'; + else if ('A'<=ch<='F') + i+=ch-'A'+10; + *dst++=i; + } else + *dst++=ch; + } + *dst=0; + } + doc_e=doc_e->next; + } + StrCpy(doc->filename.name,out_name); + DocWrite(doc); + DocDel(doc); + } +} + +I64 ACDNextCmd(U8 **_ptr) +{ + U8 *ptr=*_ptr,*ptr2; + I64 ch,res=-1; + do { + do { + if (!(ch=*ptr++)) goto ncmd_done; + } while (ch!='<'); + + ptr2=ptr; + do { + if (!(ch=*ptr2++)) goto ncmd_done; + } while (ch!='>'); + *--ptr2=0; + res=LstMatch(ptr,"h1\0/h1\0def\0/def\0hw\0/hw\0tt\0/tt\0" + "ety\0@fld\0@cd\0@blockquote\0@wordforms\0@note\0@altname\0@chform\0" + "@cref\0@syn\0/ety\0@/fld\0@/cd\0@/blockquote\0@/wordforms\0@/note\0" + "@/altname\0@/chform\0@/cref\0@/syn\0"); + *ptr2++='>'; + ptr=ptr2; + } while (res<0); + + ncmd_done: + *_ptr=ptr; + return res; +} + +U8 *ACDNextEntry(U8 **_ptr) +{ + U8 *res,*ignore,*ptr=*_ptr,buf[ACD_BLK_SIZE],*out_ptr=buf; + I64 ch,l; + while (TRUE) { + while (TRUE) { + if (!(ch=*ptr++)) goto nentry_done; + if (ch!='<') { + *out_ptr++=ch; + if (ch=='$$') + *out_ptr++=ch; + } else + break; + } + ignore="b>\0i>\0ppp>\0/b>\0/i>\0/p>\0" + "ets>\0col>\0spn>\0/ets>\0/col>\0/spn>\0er>\0as>\0cs>\0cd>\0ex>\0" + "/er>\0/as>\0/cs>\0/cd>\0/ex>\0" + "note>\0/note>\0blockquote>\0/blockquote>\0"; + while (*ignore) { + l=StrLen(ignore); + if (!StrNCmp(ptr,ignore,l)) { + ptr+=l; + break; + } else + ignore+=l+1; + } + if (!*ignore) + break; + } +nentry_done: + *out_ptr++=0; + res=StrNew(buf); + *_ptr=ptr-1; + return res; +} + +I64 ACDCompareWords(U8 *e1,U8 *e2) +{ + return StrICmp(e1,e2); +} + +U8 *ACDSortWords(U8 *start,I64 size,I64 word_cnt) +{ + U8 **ptr_array=MAlloc(sizeof(U8 *)*word_cnt), + *out_start=MAlloc(size), + *ptr=start,*ptr2; + I64 i=0; + while (*ptr) { + ptr_array[i++]=ptr; + ptr+=StrLen(ptr)+3; + } + "Sorting...\n"; Sleep(100); + QSortI64(ptr_array,word_cnt,&ACDCompareWords); + "Done...\n"; Sleep(100); + + ptr=out_start; + for (i=0;ilargest_entry) + largest_entry=out_ptr-def_word_start; + def_word_start=out_ptr; + if (st=ACDNextEntry(&in_ptr)) { + if (*st) { + if (StrICmp(st,last_word)) { + word_cnt++; + + *word_ptr++=ACD_WORD_CHAR; + last_word=word_ptr; + StrCpy(word_ptr,st); + word_ptr+=StrLen(st)+1; + + d=word_ptr; + *d=(out_ptr-out_start)/ACD_BLK_SIZE; + word_ptr+=2; + + *out_ptr++=ACD_WORD_CHAR; + StrCpy(out_ptr,st); + out_ptr+=StrLen(st)+1; + } + Free(st); + + do { + do { + cmd=ACDNextCmd(&in_ptr); + if (cmd==ACD_H1) + goto next_word; + } while (cmd>=0 && !(cmd==ACD_DEF||cmd==ACD_PRONUNCIATION|| + cmd==ACD_POS||cmd==ACD_EXTRA)); + if (cmd==ACD_DEF) { + if(st=ACDNextEntry(&in_ptr)) { + if (*st) { + *out_ptr++=ACD_DEF_CHAR; + StrCpy(out_ptr,st); + out_ptr+=StrLen(st)+1; + } + Free(st); + } + } else if (cmd==ACD_PRONUNCIATION) { + if(st=ACDNextEntry(&in_ptr)) { + if (*st) { + *out_ptr++=ACD_PRONUNCIATION_CHAR; + StrCpy(out_ptr,st); + out_ptr+=StrLen(st)+1; + } + Free(st); + } + } else if (cmd==ACD_POS) { + if(st=ACDNextEntry(&in_ptr)) { + if (*st) { + *out_ptr++=ACD_POS_CHAR; + StrCpy(out_ptr,st); + out_ptr+=StrLen(st)+1; + } + Free(st); + } + } else if (cmd==ACD_EXTRA) { + if(st=ACDNextEntry(&in_ptr)) { + if (*st) { + *out_ptr++=ACD_EXTRA_CHAR; + StrCpy(out_ptr,st); + out_ptr+=StrLen(st)+1; + } + Free(st); + } + } + } while (cmd==ACD_DEF||cmd==ACD_PRONUNCIATION|| + cmd==ACD_POS||cmd==ACD_EXTRA); + } else + Free(st); + } + } + } while (cmd>=0); + *out_ptr++=ACD_END_CHAR; + *word_ptr++=ACD_END_CHAR; + + Free(in_start); + + "Blk Size :%d\n",ACD_BLK_SIZE; + "Blk Cnt :%04X\n",(out_ptr-out_start+ACD_BLK_SIZE-1)/ACD_BLK_SIZE; + "Largest Entry :%d\n",largest_entry; + "Word Count :%d\n",word_cnt; + + FileWrite(ACD_DEF_FILENAME,out_start,out_ptr-out_start); + "Def File Size :%d\n",out_ptr-out_start; + + sorted_word_start=ACDSortWords(word_start,word_ptr-word_start,word_cnt); + FileWrite(ACD_WORD_FILENAME,sorted_word_start,word_ptr-word_start); + "Word File Size:%d\n",word_ptr-word_start; + + Free(out_start); + Free(word_start); + Free(sorted_word_start); +} + +Cd(__DIR__); +ACDPreprocess("DICTIONARY.DD","DICTIONARY2.DD"); +ACDGen("DICTIONARY2.DD"); diff --git a/Adam/AutoComplete/ACFill.CPP b/Adam/AutoComplete/ACFill.HC similarity index 100% rename from Adam/AutoComplete/ACFill.CPP rename to Adam/AutoComplete/ACFill.HC diff --git a/Adam/AutoComplete/ACInit.CPP b/Adam/AutoComplete/ACInit.HC similarity index 100% rename from Adam/AutoComplete/ACInit.CPP rename to Adam/AutoComplete/ACInit.HC diff --git a/Adam/AutoComplete/ACTask.CPP b/Adam/AutoComplete/ACTask.CPP deleted file mode 100644 index ad2f1f3..0000000 --- a/Adam/AutoComplete/ACTask.CPP +++ /dev/null @@ -1,285 +0,0 @@ -#help_index "AutoComplete/Dictionary" -U0 ACDDictWordsAdd(U8 *st) -{ - I64 i; - U8 *ptr; - if (st && *st && (ptr=ACDWordPtAt(st))) { - for (i=0;iflags|=DOCF_MIN_SIZE; - Fs->border_src=BDS_CONST; - Fs->border_attr=LTGRAY<<4+DrvTextAttrGet(':')&15; - Fs->text_attr =LTGRAY<<4+BLUE; - LBtr(&Fs->display_flags,DISPLAYf_SHOW); - WinHorz(left,Fs->win_right); - WinVert(top,Fs->win_bottom); - DocCursor; -} - -I64 ACSkipCrap(U8 *src,I64 len) -{ - I64 j; - j=len-1; - while (j>=0) { - if (Bt(chars_bmp_alpha_numeric,src[j])) - break; - else - j--; - } - return j+1; -} - -I64 ACPriorWordInStr(U8 *src,U8 *dst,I64 len,I64 buf_size) -{ - I64 i,j=0,k; - i=len-1; - while (i>=0) - if (!Bt(chars_bmp_alpha_numeric,src[i])) - break; - else - i--; - if (i>=-1 && len>0) - for (k=i+1;khits>ac.fillin_hits[ac.num_fillins-1]) { - for (k=ac.num_fillins-1;k>=0;k--) { - if (tempw->hits<=ac.fillin_hits[k]) - break; - else { - ac.fillin_matches[k+1]=ac.fillin_matches[k]; - ac.fillin_hits[k+1] =ac.fillin_hits[k]; - } - } - ac.fillin_matches[k+1]=tempw; - ac.fillin_hits[k+1] =tempw->hits; - if (ac.num_fillinsmask && tSbody[i]; - while (tempw) { - if (!MemCmp(ac.cur_word,tempw->str,StrLen(ac.cur_word))) - ACFillInAdd(tempw); - tempw=tempw->next; - } - } - ACDocRst(51,13); - if (ac.cur_word && *ac.cur_word) { - "$$PURPLE$$Word:%s$$FG$$\n",ac.cur_word; - for (i=0;istr; - "$$GREEN$$F%02d$$FG$$ ",i+1; - if (TaskValidate(focus_task) && - (temph=HashFind(st,focus_task->hash_table,HTG_SRC_SYM)) && - temph->src_link) { - if (temph->type&HTF_PUBLIC) - "$$RED$$"; - "$$TX+UL+L+PU,\"%$$Q\",A=\"%s\"$$$$FG$$\n",st,temph->src_link; - } else - "%s\n",st; - } - if (acd.has_words) - ACDDictWordsAdd(ac.cur_word); - } else if (FileFind("::/Doc/StandBy.TXT.Z")) - Type("::/Doc/StandBy.TXT.Z",0); - } - Free(src); - Free(buf); - Free(buf1); -} - -U0 ACTaskNormal(I64 sc,I64 last_sc, - CTask *focus_task,CTask *original_focus_task) -{ - CDoc *doc; - CDocEntry *doc_e; - if ((doc=DocPut(focus_task)) && - focus_task!=Fs && Bt(&focus_task->display_flags,DISPLAYf_SHOW)) { - DocLock(doc); - if (TaskValidate(focus_task) && original_focus_task==sys_focus_task && - doc && doc==DocPut(focus_task) && (doc_e=doc->cur_entry)) { - if (doc_e==doc) doc_e=doc_e->last; - while (doc_e->last!=doc && (doc_e->type_u8==DOCT_NEW_LINE || - doc_e->type_u8==DOCT_SOFT_NEW_LINE)) - doc_e=doc_e->last; - while (doc_e->last->type_u8!=DOCT_NEW_LINE && doc_e->last!=doc) - doc_e=doc_e->last; - ACPutChoices(doc,doc_e,focus_task,ToBool(sc!=last_sc)); - } else - DocUnlock(doc); - } - if (!LBts(&Fs->display_flags,DISPLAYf_SHOW)) - WinZBufUpdate; -} - -U0 ACTaskCtrl(I64 sc,I64 last_sc, - CTask *focus_task,CTask *original_focus_task) -{ - if (TaskValidate(focus_task) && - (focus_task->scroll_x || focus_task->scroll_y)) { - if (LBtr(&Fs->display_flags,DISPLAYf_SHOW)) - WinZBufUpdate; - } else { - if (sc!=last_sc) { - if (sc&SCF_ALT) { - ACDocRst(27,3); - if (TaskValidate(original_focus_task) && - !Bt(&original_focus_task->win_inhibit,WIf_SELF_KEY_DESC)) - KeyMapFamily(original_focus_task,0, - ToBool(!(sc&SCF_SHIFT)),ToBool(sc&SCF_SHIFT)); - KeyMapCtrlAltFamily( - ToBool(!(sc&SCF_SHIFT)),ToBool(sc&SCF_SHIFT)); - } else if (TaskValidate(original_focus_task) && - !Bt(&original_focus_task->win_inhibit,WIf_SELF_KEY_DESC)) { - ACDocRst(27,3); - KeyMapFamily(original_focus_task,SCF_CTRL, - ToBool(!(sc&SCF_SHIFT)),ToBool(sc&SCF_SHIFT)); - } - } - if (!LBts(&Fs->display_flags,DISPLAYf_SHOW)) - WinZBufUpdate; - } -} - -U0 ACTaskAlt(I64 sc,I64 last_sc, - CTask *,CTask *original_focus_task) -{ - if (sc!=last_sc && TaskValidate(original_focus_task) && - !Bt(&original_focus_task->win_inhibit,WIf_SELF_KEY_DESC)) { - ACDocRst(27,3); - KeyMapFamily(original_focus_task,SCF_ALT, - ToBool(!(sc&SCF_SHIFT)),ToBool(sc&SCF_SHIFT)); - } - if (!LBts(&Fs->display_flags,DISPLAYf_SHOW)) - WinZBufUpdate; -} - -U0 ACTaskEndCB() -{ - ac.task=NULL; - Exit; -} - -U0 ACTask(I64) -{ - CTask *focus_task,*original_focus_task; - I64 ch,scan_code=0,last_scan_code=0; - CDoc *doc; - Fs->task_end_cb=&ACTaskEndCB; - DocTermNew; - 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_IP_L-WIF_SELF_IP_R-WIG_DBL_CLICK; - Free(ac.cur_word); - ac.cur_word=NULL; - while (TRUE) { - if (scan_code&(SCF_CTRL|SCF_ALT) || - GetTSC>KbdMouseEvtTime+cnts.time_stamp_freq>>1) { - last_scan_code=scan_code; - scan_code=kbd.scan_code; - } - original_focus_task=focus_task=sys_focus_task; - while (TaskValidate(focus_task) && - Bt(&focus_task->task_flags,TASKf_INPUT_FILTER_TASK)) - focus_task=focus_task->parent_task; - if (scan_code&SCF_CTRL) - ACTaskCtrl(scan_code,last_scan_code,focus_task,original_focus_task); - else if (TaskValidate(focus_task)) { - if (scan_code&SCF_ALT) - ACTaskAlt(scan_code,last_scan_code,focus_task,original_focus_task); - else - ACTaskNormal(scan_code,last_scan_code,focus_task,original_focus_task); - } - Sleep(333); - if (ScanMsg(&ch,,1<cur_entry->de_flags & DOCEF_LINK) { - '' CH_SPACE; - doc->cur_entry=doc; - } - DocUnlock(doc); - } -} - -public Bool AutoComplete(Bool val=OFF) -{//Turn AutoComplete OFF or ON. - Bool old_autocomplete=FALSE; - while (Bt(&ac.flags,ACf_INIT_IN_PROGRESS)) - Sleep(10); - if (val) { - if (Bt(&sys_run_level,RLf_AUTO_COMPLETE)) { - if (TaskValidate(ac.task)) - old_autocomplete=TRUE; - else { - ac.task=Spawn(&ACTask,NULL,"AutoComplete"); - TaskWait(ac.task); - } - WinToTop(ac.task); - } - } else { - if (TaskValidate(ac.task)) { - if (Bt(&sys_run_level,RLf_AUTO_COMPLETE)) - old_autocomplete=TRUE; - Kill(ac.task); - while (TaskValidate(ac.task)) - Yield; - } - } - return old_autocomplete; -} diff --git a/Adam/AutoComplete/ACTask.HC b/Adam/AutoComplete/ACTask.HC new file mode 100644 index 0000000..26fe077 --- /dev/null +++ b/Adam/AutoComplete/ACTask.HC @@ -0,0 +1,284 @@ +#help_index "AutoComplete/Dictionary" +U0 ACDDictWordsAdd(U8 *st) +{ + I64 i; + U8 *ptr; + if (st && *st && (ptr=ACDWordPtAt(st))) { + for (i=0;iflags|=DOCF_MIN_SIZE; + Fs->border_src=BDS_CONST; + Fs->border_attr=LTGRAY<<4+DrvTextAttrGet(':')&15; + Fs->text_attr =LTGRAY<<4+BLUE; + LBtr(&Fs->display_flags,DISPLAYf_SHOW); + WinHorz(left,Fs->win_right); + WinVert(top,Fs->win_bottom); + DocCursor; +} + +I64 ACSkipCrap(U8 *src,I64 len) +{ + I64 j; + j=len-1; + while (j>=0) { + if (Bt(chars_bmp_alpha_numeric,src[j])) + break; + else + j--; + } + return j+1; +} + +I64 ACPriorWordInStr(U8 *src,U8 *dst,I64 len,I64 buf_size) +{ + I64 i,j=0,k; + i=len-1; + while (i>=0) + if (!Bt(chars_bmp_alpha_numeric,src[i])) + break; + else + i--; + if (i>=-1 && len>0) + for (k=i+1;khits>ac.fillin_hits[ac.num_fillins-1]) { + for (k=ac.num_fillins-1;k>=0;k--) { + if (tempw->hits<=ac.fillin_hits[k]) + break; + else { + ac.fillin_matches[k+1]=ac.fillin_matches[k]; + ac.fillin_hits[k+1] =ac.fillin_hits[k]; + } + } + ac.fillin_matches[k+1]=tempw; + ac.fillin_hits[k+1] =tempw->hits; + if (ac.num_fillinsmask && tSbody[i]; + while (tempw) { + if (!MemCmp(ac.cur_word,tempw->str,StrLen(ac.cur_word))) + ACFillInAdd(tempw); + tempw=tempw->next; + } + } + ACDocRst(51,13); + if (ac.cur_word && *ac.cur_word) { + "$$PURPLE$$Word:%s$$FG$$\n",ac.cur_word; + for (i=0;istr; + "$$GREEN$$F%02d$$FG$$ ",i+1; + if (TaskValidate(focus_task) && + (temph=HashFind(st,focus_task->hash_table,HTG_SRC_SYM)) && + temph->src_link) { + if (temph->type&HTF_PUBLIC) + "$$RED$$"; + "$$TX+UL+L+PU,\"%$$Q\",A=\"%s\"$$$$FG$$\n",st,temph->src_link; + } else + "%s\n",st; + } + if (acd.has_words) + ACDDictWordsAdd(ac.cur_word); + } else if (FileFind("::/Doc/StandBy.DD.Z")) + Type("::/Doc/StandBy.DD.Z",0); + } + Free(src); + Free(buf); + Free(buf1); +} + +U0 ACTaskNormal(I64 sc,I64 last_sc, + CTask *focus_task,CTask *original_focus_task) +{ + CDoc *doc; + CDocEntry *doc_e; + if ((doc=DocPut(focus_task)) && + focus_task!=Fs && Bt(&focus_task->display_flags,DISPLAYf_SHOW)) { + DocLock(doc); + if (TaskValidate(focus_task) && original_focus_task==sys_focus_task && + doc && doc==DocPut(focus_task) && (doc_e=doc->cur_entry)) { + if (doc_e==doc) doc_e=doc_e->last; + while (doc_e->last!=doc && (doc_e->type_u8==DOCT_NEW_LINE || + doc_e->type_u8==DOCT_SOFT_NEW_LINE)) + doc_e=doc_e->last; + while (doc_e->last->type_u8!=DOCT_NEW_LINE && doc_e->last!=doc) + doc_e=doc_e->last; + ACPutChoices(doc,doc_e,focus_task,ToBool(sc!=last_sc)); + } else + DocUnlock(doc); + } + if (!LBts(&Fs->display_flags,DISPLAYf_SHOW)) + WinZBufUpdate; +} + +U0 ACTaskCtrl(I64 sc,I64 last_sc, + CTask *focus_task,CTask *original_focus_task) +{ + if (TaskValidate(focus_task) && + (focus_task->scroll_x || focus_task->scroll_y)) { + if (LBtr(&Fs->display_flags,DISPLAYf_SHOW)) + WinZBufUpdate; + } else { + if (sc!=last_sc) { + if (sc&SCF_ALT) { + ACDocRst(27,3); + if (TaskValidate(original_focus_task) && + !Bt(&original_focus_task->win_inhibit,WIf_SELF_KEY_DESC)) + KeyMapFamily(original_focus_task,0, + ToBool(!(sc&SCF_SHIFT)),ToBool(sc&SCF_SHIFT)); + KeyMapCtrlAltFamily( + ToBool(!(sc&SCF_SHIFT)),ToBool(sc&SCF_SHIFT)); + } else if (TaskValidate(original_focus_task) && + !Bt(&original_focus_task->win_inhibit,WIf_SELF_KEY_DESC)) { + ACDocRst(27,3); + KeyMapFamily(original_focus_task,SCF_CTRL, + ToBool(!(sc&SCF_SHIFT)),ToBool(sc&SCF_SHIFT)); + } + } + if (!LBts(&Fs->display_flags,DISPLAYf_SHOW)) + WinZBufUpdate; + } +} + +U0 ACTaskAlt(I64 sc,I64 last_sc, + CTask *,CTask *original_focus_task) +{ + if (sc!=last_sc && TaskValidate(original_focus_task) && + !Bt(&original_focus_task->win_inhibit,WIf_SELF_KEY_DESC)) { + ACDocRst(27,3); + KeyMapFamily(original_focus_task,SCF_ALT, + ToBool(!(sc&SCF_SHIFT)),ToBool(sc&SCF_SHIFT)); + } + if (!LBts(&Fs->display_flags,DISPLAYf_SHOW)) + WinZBufUpdate; +} + +U0 ACTaskEndCB() +{ + ac.task=NULL; + Exit; +} + +U0 ACTask(I64) +{ + CTask *focus_task,*original_focus_task; + I64 ch,scan_code=0,last_scan_code=0; + CDoc *doc; + Fs->task_end_cb=&ACTaskEndCB; + DocTermNew; + 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_IP_L-WIF_SELF_IP_R-WIG_DBL_CLICK; + Free(ac.cur_word); + ac.cur_word=NULL; + while (TRUE) { + if (scan_code&(SCF_CTRL|SCF_ALT) || + GetTSC>KbdMouseEvtTime+cnts.time_stamp_freq>>1) { + last_scan_code=scan_code; + scan_code=kbd.scan_code; + } + original_focus_task=focus_task=sys_focus_task; + while (TaskValidate(focus_task) && + Bt(&focus_task->task_flags,TASKf_INPUT_FILTER_TASK)) + focus_task=focus_task->parent_task; + if (scan_code&SCF_CTRL) + ACTaskCtrl(scan_code,last_scan_code,focus_task,original_focus_task); + else if (TaskValidate(focus_task)) { + if (scan_code&SCF_ALT) + ACTaskAlt(scan_code,last_scan_code,focus_task,original_focus_task); + else + ACTaskNormal(scan_code,last_scan_code,focus_task,original_focus_task); + } + Sleep(333); + if (ScanMsg(&ch,,1<cur_entry->de_flags & DOCEF_LINK) { + '' CH_SPACE; + doc->cur_entry=doc; + } + DocUnlock(doc); + } +} + +public Bool AutoComplete(Bool val=OFF) +{//Turn AutoComplete OFF or ON. + Bool old_autocomplete=FALSE; + while (Bt(&ac.flags,ACf_INIT_IN_PROGRESS)) + Sleep(10); + if (val) { + if (Bt(&sys_run_level,RLf_AUTO_COMPLETE)) { + if (TaskValidate(ac.task)) + old_autocomplete=TRUE; + else { + ac.task=Spawn(&ACTask,NULL,"AutoComplete"); + TaskWait(ac.task); + } + WinToTop(ac.task); + } + } else { + if (TaskValidate(ac.task)) { + if (Bt(&sys_run_level,RLf_AUTO_COMPLETE)) + old_autocomplete=TRUE; + Kill(ac.task); + DeathWait(&ac.task); + } + } + return old_autocomplete; +} diff --git a/Adam/AutoComplete/MakeAC.CPP b/Adam/AutoComplete/MakeAC.CPP deleted file mode 100644 index 25333b8..0000000 --- a/Adam/AutoComplete/MakeAC.CPP +++ /dev/null @@ -1,6 +0,0 @@ -//See $LK,"::/Doc/AutoComplete.TXT"$ -Cd(__DIR__);; -#include "ACFill" -#include "ACTask" -#include "ACInit" -Cd("..");; diff --git a/Adam/AutoComplete/MakeAC.HC b/Adam/AutoComplete/MakeAC.HC new file mode 100644 index 0000000..e1f33a0 --- /dev/null +++ b/Adam/AutoComplete/MakeAC.HC @@ -0,0 +1,6 @@ +//See $LK,"::/Doc/AutoComplete.DD"$ +Cd(__DIR__);; +#include "ACFill" +#include "ACTask" +#include "ACInit" +Cd("..");; diff --git a/Adam/AutoFile.CPP b/Adam/AutoFile.CPP deleted file mode 100644 index 795a7b6..0000000 --- a/Adam/AutoFile.CPP +++ /dev/null @@ -1,139 +0,0 @@ -#help_index "AutoFile;Help System/Training" -#help_file "::/Doc/AutoFile" - -public U0 AFGetStr(U8 *st) -{//Wait for user to type certain str. - I64 ch,sc; - U8 buf[256],*st2; - while (*st) { - ch=GetKey(&sc,FALSE); - if (sc.u8[0]!=SC_SHIFT && - sc.u8[0]!=SC_ALT && - sc.u8[0]!=SC_CTRL) { - if (ch==*st) { - '' ch; - st++; - } else { - st2=Char2KeyName(*st); - StrPrint(buf,"Press the $$GREEN$$<%s>$$FG$$ key.",st2); - Free(st2); - PopUpOk(buf); - } - } - } -} - -public U0 AFPrint(I64 mS=100,U8 *fmt,...) -{//Print message with delay after each char. - U8 *buf=StrPrintJoin(NULL,fmt,argc,argv),*st=buf; - I64 ch; - while (ch=*st++) { - '' ch; - Sleep(mS); - } - Free(buf); -} - -public U0 AFGetKey(I64 scan_code,I64 sc_mask=0xFF|SCF_SHIFT|SCF_CTRL|SCF_ALT) -{//Wait for user to press certain key. - I64 sc,ch; - U8 buf[STR_LEN],*st; - do { - ch=GetKey(&sc); - if (sc.u8[0]!=SC_PRTSCRN1 && - !(sc.u8[0]==SC_SHIFT && scan_code&SCF_SHIFT) && - !(sc.u8[0]==SC_CTRL && scan_code&SCF_CTRL) && - !(sc.u8[0]==SC_ALT && scan_code&SCF_ALT) ) { - if (sc&sc_mask!=scan_code&sc_mask) { - st=ScanCode2KeyName(scan_code); - StrPrint(buf,"Press the $$GREEN$$<%s>$$FG$$ key",st); - Free(st); - PopUpOk(buf); - } - } - } while (sc&sc_mask!=scan_code&sc_mask); - Msg(MSG_KEY_DOWN,ch,sc); -} - -public I64 AFGetChar(...) -{//Wait for user to press one of set of chars. - I64 i,sc,ch; - U8 buf[512],*st; - while (TRUE) { - ch=GetKey(&sc); - if (sc.u8[0]!=SC_SHIFT && sc.u8[0]!=SC_ALT && sc.u8[0]!=SC_CTRL) { - for (i=0;i$$FG$$",st); - Free(st); - if (argc==i+1) - CatPrint(buf,"."); - else if (argc==i+2) - CatPrint(buf," or "); - else - CatPrint(buf,", "); - } - PopUpOk(buf); - } - } -} - -public U0 AFUntilKey(I64 scan_code,I64 sc_mask=0xFF|SCF_SHIFT|SCF_CTRL|SCF_ALT) -{//Let user type until he presses certain key. - I64 sc,ch; - do { - ch=GetKey(&sc); - Msg(MSG_KEY_DOWN,ch,sc); - } while (sc&sc_mask!=scan_code&sc_mask); -} - -public I64 AFUntilChar(...) -{//Let user type until he presses one of set of chars. - I64 i,sc,ch; - while (TRUE) { - ch=GetKey(&sc); - Msg(MSG_KEY_DOWN,ch,sc); - for (i=0;i or . - Bool res=View; - DocBottom; - return res; -} diff --git a/Adam/AutoFile.HC b/Adam/AutoFile.HC new file mode 100644 index 0000000..fc5dd5e --- /dev/null +++ b/Adam/AutoFile.HC @@ -0,0 +1,139 @@ +#help_index "AutoFile;Help System/Training" +#help_file "::/Doc/AutoFile" + +public U0 AFGetStr(U8 *st) +{//Wait for user to type certain str. + I64 ch,sc; + U8 buf[256],*st2; + while (*st) { + ch=GetKey(&sc,FALSE); + if (sc.u8[0]!=SC_SHIFT && + sc.u8[0]!=SC_ALT && + sc.u8[0]!=SC_CTRL) { + if (ch==*st) { + '' ch; + st++; + } else { + st2=Char2KeyName(*st); + StrPrint(buf,"Press the $$GREEN$$<%s>$$FG$$ key.",st2); + Free(st2); + PopUpOk(buf); + } + } + } +} + +public U0 AFPrint(I64 ms=100,U8 *fmt,...) +{//Print message with delay after each char. + U8 *buf=StrPrintJoin(NULL,fmt,argc,argv),*st=buf; + I64 ch; + while (ch=*st++) { + '' ch; + Sleep(ms); + } + Free(buf); +} + +public U0 AFGetKey(I64 scan_code,I64 sc_mask=0xFF|SCF_SHIFT|SCF_CTRL|SCF_ALT) +{//Wait for user to press certain key. + I64 sc,ch; + U8 buf[STR_LEN],*st; + do { + ch=GetKey(&sc); + if (sc.u8[0]!=SC_PRTSCRN1 && + !(sc.u8[0]==SC_SHIFT && scan_code&SCF_SHIFT) && + !(sc.u8[0]==SC_CTRL && scan_code&SCF_CTRL) && + !(sc.u8[0]==SC_ALT && scan_code&SCF_ALT) ) { + if (sc&sc_mask!=scan_code&sc_mask) { + st=ScanCode2KeyName(scan_code); + StrPrint(buf,"Press the $$GREEN$$<%s>$$FG$$ key",st); + Free(st); + PopUpOk(buf); + } + } + } while (sc&sc_mask!=scan_code&sc_mask); + Msg(MSG_KEY_DOWN,ch,sc); +} + +public I64 AFGetChar(...) +{//Wait for user to press one of set of chars. + I64 i,sc,ch; + U8 buf[512],*st; + while (TRUE) { + ch=GetKey(&sc); + if (sc.u8[0]!=SC_SHIFT && sc.u8[0]!=SC_ALT && sc.u8[0]!=SC_CTRL) { + for (i=0;i$$FG$$",st); + Free(st); + if (argc==i+1) + CatPrint(buf,"."); + else if (argc==i+2) + CatPrint(buf," or "); + else + CatPrint(buf,", "); + } + PopUpOk(buf); + } + } +} + +public U0 AFUntilKey(I64 scan_code,I64 sc_mask=0xFF|SCF_SHIFT|SCF_CTRL|SCF_ALT) +{//Let user type until he presses certain key. + I64 sc,ch; + do { + ch=GetKey(&sc); + Msg(MSG_KEY_DOWN,ch,sc); + } while (sc&sc_mask!=scan_code&sc_mask); +} + +public I64 AFUntilChar(...) +{//Let user type until he presses one of set of chars. + I64 i,sc,ch; + while (TRUE) { + ch=GetKey(&sc); + Msg(MSG_KEY_DOWN,ch,sc); + for (i=0;i or . + Bool res=View; + DocBottom; + return res; +} diff --git a/Adam/Ctrls/CtrlsA.CPP b/Adam/Ctrls/CtrlsA.CPP deleted file mode 100644 index c4665e1..0000000 --- a/Adam/Ctrls/CtrlsA.CPP +++ /dev/null @@ -1,388 +0,0 @@ -public CCtrl *CtrlFindUnique(CTask *haystack_task,I64 needle_type) -{//Find task ctrl given $LK,"ctrl_type",A="MN:CTRLT_VIEWING_ANGLES"$. - CCtrl *c; - c=haystack_task->next_ctrl; - while (c!=&haystack_task->next_ctrl) { - if (c->type==needle_type) - return c; - c=c->next; - } - return NULL; -} - -U0 CtrlsUpdate(CTask *task) -{ - CCtrl *c; - c=task->next_ctrl; - while (c!=&task->next_ctrl) { - if (c->update_derived_vals) - (*c->update_derived_vals)(c); - if (c->flags&CTRLF_BORDER) { - c->screen_left =gr.pan_text_x+task->pix_left+c->left-FONT_WIDTH; - c->screen_right =gr.pan_text_x+task->pix_left+c->right-FONT_WIDTH; - c->screen_top =gr.pan_text_y+task->pix_top+c->top-FONT_HEIGHT; - c->screen_bottom=gr.pan_text_y+task->pix_top+c->bottom-FONT_HEIGHT; - } else { - c->screen_left =gr.pan_text_x+task->pix_left+c->left; - c->screen_right =gr.pan_text_x+task->pix_left+c->right; - c->screen_top =gr.pan_text_y+task->pix_top+c->top; - c->screen_bottom=gr.pan_text_y+task->pix_top+c->bottom; - } - c=c->next; - } -} - -fp_update_ctrls=&CtrlsUpdate; - -Bool CtrlInsideRect(CCtrl *c,I64 x,I64 y) -{//screen coordinates - if (c->screen_left<=x<=c->screen_right && - c->screen_top<=y<=c->screen_bottom) - return TRUE; - else - return FALSE; -} - -public Bool CtrlInside(CCtrl *c,I64 x,I64 y) -{//Is x,y inside a ctrl? - if (c->flags&CTRLF_SHOW) { - if (c->inside_ctrl) - return (*c->inside_ctrl)(c,x,y); - else - return CtrlInsideRect(c,x,y); - } else - return FALSE; -} - -U0 DrawCtrls(CTask *task) -{ - CCtrl *c; - CDC *dc=DCAlias(gr.dc2,task); - c=task->next_ctrl; - while (c!=&task->next_ctrl) { - if (c->flags&CTRLF_SHOW) { - if (c->flags&CTRLF_BORDER) { - if (!Bt(&task->display_flags,DISPLAYf_NO_BORDER)) { - PUSHFD - CLI - while (LBts(&task->task_flags,TASKf_TASK_LOCK)) - PAUSE - - task->win_left--; //Allow drawing on border - task->win_right++; - task->win_top--; - task->win_bottom++; - WinDerivedValsUpdate(task); - - LBtr(&task->task_flags,TASKf_TASK_LOCK); - POPFD - - if (c->draw_it) - (*c->draw_it)(dc,c); - - PUSHFD - CLI - while (LBts(&task->task_flags,TASKf_TASK_LOCK)) - PAUSE - - task->win_left++; - task->win_right--; - task->win_top++; - task->win_bottom--; - WinDerivedValsUpdate(task); - - LBtr(&task->task_flags,TASKf_TASK_LOCK); - POPFD - } - } else - if (c->draw_it) - (*c->draw_it)(dc,c); - } - c=c->next; - } - DCDel(dc); -} - -#define WIN_SCROLL_SIZE 8 -#define WIN_SCROLL_BORDER_BONUS 4 -U0 DrawWinScroll(CDC *dc,CCtrl *c) -{ - CWinScroll *s=c->state; - - if (c->flags&CTRLF_CLICKED) - dc->color=s->color>>4; - else - dc->color=s->color&0xF; - GrRect(dc,c->left,c->top,c->right-c->left+1,c->bottom-c->top+1); - - if (c->flags&CTRLF_CLICKED) - dc->color=s->color&0xF; - else - dc->color=s->color>>4; - GrRect(dc,c->left+2,c->top+2,c->right-c->left+1-4,c->bottom-c->top+1-4); -} - -U0 WinDerivedScrollValsUpdate(CCtrl *c) -{ - CWinScroll *s=c->state; - I64 range; - if (s->maxmin) s->max=s->min; - if (s->posmin) s->pos=s->min; - if (s->pos>s->max) s->pos=s->max; - s->color=c->win_task->border_attr&0xF^0xF+ - (c->win_task->border_attr&0xF)<<4; - range=s->max-s->min; - if (!range) range=1; - switch (c->type) { - case CTRLT_WIN_HSCROLL: - c->left =gr.pan_text_x+FONT_WIDTH-WIN_SCROLL_BORDER_BONUS+ - (s->pos-s->min)*(c->win_task->pix_width+2*WIN_SCROLL_BORDER_BONUS - -WIN_SCROLL_SIZE)/range; - c->right =c->left+WIN_SCROLL_SIZE-1; - c->top =gr.pan_text_y+FONT_HEIGHT+ - (FONT_WIDTH-WIN_SCROLL_SIZE)/2+c->win_task->pix_height; - c->bottom=c->top+WIN_SCROLL_SIZE-1; - break; - case CTRLT_WIN_VSCROLL: - c->left =gr.pan_text_x+FONT_WIDTH+ - (FONT_WIDTH-WIN_SCROLL_SIZE)/2+c->win_task->pix_width; - c->right =c->left+WIN_SCROLL_SIZE-1; - c->top =gr.pan_text_y+FONT_HEIGHT-WIN_SCROLL_BORDER_BONUS+ - (s->pos-s->min)*(c->win_task->pix_height+ - 2*WIN_SCROLL_BORDER_BONUS-WIN_SCROLL_SIZE)/range; - c->bottom=c->top+WIN_SCROLL_SIZE-1; - break; - } -} - -U0 LeftClickHWinScroll(CCtrl *c,I64 x,I64,Bool down) -{ - CTask *task=c->win_task; - CWinScroll *s=c->state; - I64 range=task->pix_width+2*WIN_SCROLL_BORDER_BONUS-WIN_SCROLL_SIZE; - LBts(&s->flags,WSSf_SET_TO_POS); - s->pos=((x-(FONT_WIDTH-WIN_SCROLL_BORDER_BONUS)) - *(s->max-s->min+1)+range/2)/range+s->min; - if (down) - c->flags|=CTRLF_CLICKED; - else - c->flags&=~CTRLF_CLICKED; - if (c->update_derived_vals) - (*c->update_derived_vals)(c); -} - -U0 LeftClickVWinScroll(CCtrl *c,I64,I64 y,Bool down) -{ - CTask *task=c->win_task; - CWinScroll *s=c->state; - I64 range=task->pix_height+2*WIN_SCROLL_BORDER_BONUS-WIN_SCROLL_SIZE; - LBts(&s->flags,WSSf_SET_TO_POS); - s->pos=((y-(FONT_HEIGHT-WIN_SCROLL_BORDER_BONUS)) - *(s->max-s->min+1)+range/2)/range+s->min; - if (down) - c->flags|=CTRLF_CLICKED; - else - c->flags&=~CTRLF_CLICKED; - if (c->update_derived_vals) - (*c->update_derived_vals)(c); -} - -U0 WheelChangeWinScroll(CCtrl *c,I64 delta) -{ - CWinScroll *s=c->state; - LBts(&s->flags,WSSf_SET_TO_POS); - s->pos+=delta; - if (c->update_derived_vals) - (*c->update_derived_vals)(c); -} - -U0 WinScrollsInit(CTask *task) -{ - CCtrl *c; - - if (!CtrlFindUnique(task,CTRLT_WIN_HSCROLL)) { - c=CAlloc(sizeof(CCtrl)); - c->win_task=task; - c->flags=CTRLF_SHOW|CTRLF_BORDER|CTRLF_CAPTURE_LEFT_IP; - c->type=CTRLT_WIN_HSCROLL; - c->state=&task->horz_scroll; - c->update_derived_vals=&WinDerivedScrollValsUpdate; - c->draw_it=&DrawWinScroll; - c->left_click=&LeftClickHWinScroll; - QueIns(c,task->last_ctrl); - } - - if (!CtrlFindUnique(task,CTRLT_WIN_VSCROLL)) { - c=CAlloc(sizeof(CCtrl)); - c->win_task=task; - c->flags=CTRLF_SHOW|CTRLF_BORDER|CTRLF_CAPTURE_LEFT_IP; - c->type=CTRLT_WIN_VSCROLL; - c->state=&task->vert_scroll; - c->update_derived_vals=&WinDerivedScrollValsUpdate; - c->draw_it=&DrawWinScroll; - c->left_click=&LeftClickVWinScroll; - c->wheel_chg=&WheelChangeWinScroll; - QueIns(c,task->last_ctrl); - } - TaskDerivedValsUpdate(task); -} -#define VIEWANGLES_SPACING 22 -#define VIEWANGLES_RANGE 48 -#define VIEWANGLES_BORDER 2 -#define VIEWANGLES_SNAP 2 - -U0 DrawViewAnglesCtrl(CDC *dc,CCtrl *c) -{ - I64 i,j; - CViewAngles *s=c->state; - - dc->color=s->cbd; - GrRect(dc, c->left,c->top,VIEWANGLES_SPACING*4+3, - VIEWANGLES_SPACING*2+VIEWANGLES_RANGE); - dc->color=s->cbg; - GrRect(dc, c->left+VIEWANGLES_BORDER,c->top+VIEWANGLES_BORDER, - VIEWANGLES_SPACING*4+3-2*VIEWANGLES_BORDER, - VIEWANGLES_SPACING*2+VIEWANGLES_RANGE-2*VIEWANGLES_BORDER); - dc->color=s->cfg; - GrLine(dc,c->left+VIEWANGLES_SPACING,c->top+VIEWANGLES_SPACING, - c->left+VIEWANGLES_SPACING,c->top+VIEWANGLES_SPACING+ - VIEWANGLES_RANGE-1); - GrLine(dc,c->left+2*VIEWANGLES_SPACING+1,c->top+VIEWANGLES_SPACING, - c->left+2*VIEWANGLES_SPACING+1,c->top+VIEWANGLES_SPACING+ - VIEWANGLES_RANGE-1); - GrLine(dc,c->left+3*VIEWANGLES_SPACING+2,c->top+VIEWANGLES_SPACING, - c->left+3*VIEWANGLES_SPACING+2,c->top+VIEWANGLES_SPACING+ - VIEWANGLES_RANGE-1); - for (i=1;ileft+VIEWANGLES_SPACING-j,c->bottom-VIEWANGLES_SPACING-i, - c->left+VIEWANGLES_SPACING+j,c->bottom - -VIEWANGLES_SPACING-i); - GrLine(dc,c->left+2*VIEWANGLES_SPACING+1-j,c->bottom-VIEWANGLES_SPACING-i, - c->left+2*VIEWANGLES_SPACING+1+j,c->bottom - -VIEWANGLES_SPACING-i); - GrLine(dc,c->left+3*VIEWANGLES_SPACING+2-j,c->bottom-VIEWANGLES_SPACING-i, - c->left+3*VIEWANGLES_SPACING+2+j,c->bottom - -VIEWANGLES_SPACING-i); - } - - dc->color=s->cx; - GrPrint(dc,c->left+VIEWANGLES_SPACING-FONT_WIDTH/2, - c->top+VIEWANGLES_SPACING-(1+FONT_HEIGHT),"X"); - GrPrint(dc,c->left+VIEWANGLES_SPACING-3*FONT_WIDTH/2, - c->top+VIEWANGLES_SPACING+VIEWANGLES_RANGE+3, - "%3d",s->sx*360/VIEWANGLES_RANGE); - i=c->left+VIEWANGLES_SPACING; - if (s->sx>VIEWANGLES_RANGE/2) - j=-VIEWANGLES_RANGE/2+s->sx; - else - j=s->sx+VIEWANGLES_RANGE/2; - j=c->top+VIEWANGLES_SPACING+VIEWANGLES_RANGE-1-j; - GrRect(dc,i-3,j-2,7,5); - dc->color=s->cx^8; - GrRect(dc,i-2,j-1,5,3); - - dc->color=s->cy; - GrPrint(dc,c->left+2*VIEWANGLES_SPACING+1-FONT_WIDTH/2, - c->top+VIEWANGLES_SPACING-(1+FONT_HEIGHT),"Y"); - GrPrint(dc,c->left+2*VIEWANGLES_SPACING+1-3*FONT_WIDTH/2, - c->top+VIEWANGLES_SPACING+VIEWANGLES_RANGE+3, - "%3d",s->sy*360/VIEWANGLES_RANGE); - i=c->left+2*VIEWANGLES_SPACING+1; - if (s->sy>VIEWANGLES_RANGE/2) - j=-VIEWANGLES_RANGE/2+s->sy; - else - j=s->sy+VIEWANGLES_RANGE/2; - j=c->top+VIEWANGLES_SPACING+VIEWANGLES_RANGE-1-j; - GrRect(dc,i-3,j-2,7,5); - dc->color=s->cy^8; - GrRect(dc,i-2,j-1,5,3); - - dc->color=s->cz; - GrPrint(dc,c->left+3*VIEWANGLES_SPACING+2-FONT_WIDTH/2, - c->top+VIEWANGLES_SPACING-(1+FONT_HEIGHT),"Z"); - GrPrint(dc,c->left+3*VIEWANGLES_SPACING+2-3*FONT_WIDTH/2, - c->top+VIEWANGLES_SPACING+VIEWANGLES_RANGE+3, - "%3d",s->sz*360/VIEWANGLES_RANGE); - i=c->left+3*VIEWANGLES_SPACING+2; - if (s->sz>VIEWANGLES_RANGE/2) - j=-VIEWANGLES_RANGE/2+s->sz; - else - j=s->sz+VIEWANGLES_RANGE/2; - j=c->top+VIEWANGLES_SPACING+VIEWANGLES_RANGE-1-j; - GrRect(dc,i-3,j-2,7,5); - dc->color=s->cz^8; - GrRect(dc,i-2,j-1,5,3); -} - -U0 UpdateDerivedViewAnglesCtrl(CCtrl *c) -{ - CViewAngles *s=c->state; - c->left=c->win_task->pix_width-(VIEWANGLES_SPACING*4+3); - c->right=c->left+VIEWANGLES_SPACING*4+3; - c->top=c->win_task->pix_height-(VIEWANGLES_SPACING*2+VIEWANGLES_RANGE); - c->bottom=c->top+VIEWANGLES_SPACING*2+VIEWANGLES_RANGE; - s->sx=ClampI64(RoundI64(s->sx,VIEWANGLES_SNAP),0,VIEWANGLES_RANGE-1); - s->sy=ClampI64(RoundI64(s->sy,VIEWANGLES_SNAP),0,VIEWANGLES_RANGE-1); - s->sz=ClampI64(RoundI64(s->sz,VIEWANGLES_SNAP),0,VIEWANGLES_RANGE-1); - s->ax=2*ã*s->sx/VIEWANGLES_RANGE; - s->ay=2*ã*s->sy/VIEWANGLES_RANGE; - s->az=2*ã*s->sz/VIEWANGLES_RANGE; -} - -U0 LeftClickViewAngles(CCtrl *c,I64 x,I64 y,Bool) -{ - CViewAngles *s=c->state; - I64 i; - i=VIEWANGLES_RANGE-1-(y-(c->top+VIEWANGLES_SPACING)); - if (i>=VIEWANGLES_RANGE/2) - i-=VIEWANGLES_RANGE/2; - else - i+=VIEWANGLES_RANGE/2; - if (xleft+(c->right-c->left)/3) - s->sx=i; - else if (xleft+2*(c->right-c->left)/3) - s->sy=i; - else - s->sz=i; - if (c->update_derived_vals) - (*c->update_derived_vals)(c); -} - -public CCtrl *ViewAnglesNew(CTask *task=NULL) -{//Create view angle ctrl. See $LK,"::/Demo/Graphics/Shading.CPP"$. - CCtrl *c; - CViewAngles *s; - if (!task) task=Fs; - if (!(c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES))) { - s=CAlloc(sizeof(CViewAngles),task); - c=CAlloc(sizeof(CCtrl)); - s->cbd=BLUE; - s->cbg=LTBLUE; - s->cfg=BLACK; - s->cx=LTGREEN; - s->cy=GREEN; - s->cz=LTGREEN; - c->win_task=task; - c->flags=CTRLF_SHOW|CTRLF_CAPTURE_LEFT_IP; - c->type=CTRLT_VIEWING_ANGLES; - c->state=s; - c->draw_it=&DrawViewAnglesCtrl; - c->left_click=&LeftClickViewAngles; - c->update_derived_vals=&UpdateDerivedViewAnglesCtrl; - QueIns(c,task->last_ctrl); - TaskDerivedValsUpdate(task); - } - return c; -} - -public U0 ViewAnglesDel(CTask *task=NULL) -{//Free view angle ctrl. - CCtrl *c; - if (!task) task=Fs; - if (c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES)) { - QueRem(c); - Free(c->state); - Free(c); - } -} diff --git a/Adam/Ctrls/CtrlsA.HC b/Adam/Ctrls/CtrlsA.HC new file mode 100644 index 0000000..4d3eb78 --- /dev/null +++ b/Adam/Ctrls/CtrlsA.HC @@ -0,0 +1,388 @@ +public CCtrl *CtrlFindUnique(CTask *haystack_task,I64 needle_type) +{//Find task ctrl given $LK,"ctrl_type",A="MN:CTRLT_VIEWING_ANGLES"$. + CCtrl *c; + c=haystack_task->next_ctrl; + while (c!=&haystack_task->next_ctrl) { + if (c->type==needle_type) + return c; + c=c->next; + } + return NULL; +} + +U0 CtrlsUpdate(CTask *task) +{ + CCtrl *c; + c=task->next_ctrl; + while (c!=&task->next_ctrl) { + if (c->update_derived_vals) + (*c->update_derived_vals)(c); + if (c->flags&CTRLF_BORDER) { + c->screen_left =gr.pan_text_x+task->pix_left+c->left-FONT_WIDTH; + c->screen_right =gr.pan_text_x+task->pix_left+c->right-FONT_WIDTH; + c->screen_top =gr.pan_text_y+task->pix_top+c->top-FONT_HEIGHT; + c->screen_bottom=gr.pan_text_y+task->pix_top+c->bottom-FONT_HEIGHT; + } else { + c->screen_left =gr.pan_text_x+task->pix_left+c->left; + c->screen_right =gr.pan_text_x+task->pix_left+c->right; + c->screen_top =gr.pan_text_y+task->pix_top+c->top; + c->screen_bottom=gr.pan_text_y+task->pix_top+c->bottom; + } + c=c->next; + } +} + +fp_update_ctrls=&CtrlsUpdate; + +Bool CtrlInsideRect(CCtrl *c,I64 x,I64 y) +{//screen coordinates + if (c->screen_left<=x<=c->screen_right && + c->screen_top<=y<=c->screen_bottom) + return TRUE; + else + return FALSE; +} + +public Bool CtrlInside(CCtrl *c,I64 x,I64 y) +{//Is x,y inside a ctrl? + if (c->flags&CTRLF_SHOW) { + if (c->inside_ctrl) + return (*c->inside_ctrl)(c,x,y); + else + return CtrlInsideRect(c,x,y); + } else + return FALSE; +} + +U0 DrawCtrls(CTask *task) +{ + CCtrl *c; + CDC *dc=DCAlias(gr.dc2,task); + c=task->next_ctrl; + while (c!=&task->next_ctrl) { + if (c->flags&CTRLF_SHOW) { + if (c->flags&CTRLF_BORDER) { + if (!Bt(&task->display_flags,DISPLAYf_NO_BORDER)) { + PUSHFD + CLI + while (LBts(&task->task_flags,TASKf_TASK_LOCK)) + PAUSE + + task->win_left--; //Allow drawing on border + task->win_right++; + task->win_top--; + task->win_bottom++; + WinDerivedValsUpdate(task); + + LBtr(&task->task_flags,TASKf_TASK_LOCK); + POPFD + + if (c->draw_it) + (*c->draw_it)(dc,c); + + PUSHFD + CLI + while (LBts(&task->task_flags,TASKf_TASK_LOCK)) + PAUSE + + task->win_left++; + task->win_right--; + task->win_top++; + task->win_bottom--; + WinDerivedValsUpdate(task); + + LBtr(&task->task_flags,TASKf_TASK_LOCK); + POPFD + } + } else + if (c->draw_it) + (*c->draw_it)(dc,c); + } + c=c->next; + } + DCDel(dc); +} + +#define WIN_SCROLL_SIZE 8 +#define WIN_SCROLL_BORDER_BONUS 4 +U0 DrawWinScroll(CDC *dc,CCtrl *c) +{ + CWinScroll *s=c->state; + + if (c->flags&CTRLF_CLICKED) + dc->color=s->color>>4; + else + dc->color=s->color&0xF; + GrRect(dc,c->left,c->top,c->right-c->left+1,c->bottom-c->top+1); + + if (c->flags&CTRLF_CLICKED) + dc->color=s->color&0xF; + else + dc->color=s->color>>4; + GrRect(dc,c->left+2,c->top+2,c->right-c->left+1-4,c->bottom-c->top+1-4); +} + +U0 WinDerivedScrollValsUpdate(CCtrl *c) +{ + CWinScroll *s=c->state; + I64 range; + if (s->maxmin) s->max=s->min; + if (s->posmin) s->pos=s->min; + if (s->pos>s->max) s->pos=s->max; + s->color=c->win_task->border_attr&0xF^0xF+ + (c->win_task->border_attr&0xF)<<4; + range=s->max-s->min; + if (!range) range=1; + switch (c->type) { + case CTRLT_WIN_HSCROLL: + c->left =gr.pan_text_x+FONT_WIDTH-WIN_SCROLL_BORDER_BONUS+ + (s->pos-s->min)*(c->win_task->pix_width+2*WIN_SCROLL_BORDER_BONUS + -WIN_SCROLL_SIZE)/range; + c->right =c->left+WIN_SCROLL_SIZE-1; + c->top =gr.pan_text_y+FONT_HEIGHT+ + (FONT_WIDTH-WIN_SCROLL_SIZE)/2+c->win_task->pix_height; + c->bottom=c->top+WIN_SCROLL_SIZE-1; + break; + case CTRLT_WIN_VSCROLL: + c->left =gr.pan_text_x+FONT_WIDTH+ + (FONT_WIDTH-WIN_SCROLL_SIZE)/2+c->win_task->pix_width; + c->right =c->left+WIN_SCROLL_SIZE-1; + c->top =gr.pan_text_y+FONT_HEIGHT-WIN_SCROLL_BORDER_BONUS+ + (s->pos-s->min)*(c->win_task->pix_height+ + 2*WIN_SCROLL_BORDER_BONUS-WIN_SCROLL_SIZE)/range; + c->bottom=c->top+WIN_SCROLL_SIZE-1; + break; + } +} + +U0 LeftClickHWinScroll(CCtrl *c,I64 x,I64,Bool down) +{ + CTask *task=c->win_task; + CWinScroll *s=c->state; + I64 range=task->pix_width+2*WIN_SCROLL_BORDER_BONUS-WIN_SCROLL_SIZE; + LBts(&s->flags,WSSf_SET_TO_POS); + s->pos=((x-(FONT_WIDTH-WIN_SCROLL_BORDER_BONUS)) + *(s->max-s->min+1)+range/2)/range+s->min; + if (down) + c->flags|=CTRLF_CLICKED; + else + c->flags&=~CTRLF_CLICKED; + if (c->update_derived_vals) + (*c->update_derived_vals)(c); +} + +U0 LeftClickVWinScroll(CCtrl *c,I64,I64 y,Bool down) +{ + CTask *task=c->win_task; + CWinScroll *s=c->state; + I64 range=task->pix_height+2*WIN_SCROLL_BORDER_BONUS-WIN_SCROLL_SIZE; + LBts(&s->flags,WSSf_SET_TO_POS); + s->pos=((y-(FONT_HEIGHT-WIN_SCROLL_BORDER_BONUS)) + *(s->max-s->min+1)+range/2)/range+s->min; + if (down) + c->flags|=CTRLF_CLICKED; + else + c->flags&=~CTRLF_CLICKED; + if (c->update_derived_vals) + (*c->update_derived_vals)(c); +} + +U0 WheelChangeWinScroll(CCtrl *c,I64 delta) +{ + CWinScroll *s=c->state; + LBts(&s->flags,WSSf_SET_TO_POS); + s->pos+=delta; + if (c->update_derived_vals) + (*c->update_derived_vals)(c); +} + +U0 WinScrollsInit(CTask *task) +{ + CCtrl *c; + + if (!CtrlFindUnique(task,CTRLT_WIN_HSCROLL)) { + c=CAlloc(sizeof(CCtrl)); + c->win_task=task; + c->flags=CTRLF_SHOW|CTRLF_BORDER|CTRLF_CAPTURE_LEFT_IP; + c->type=CTRLT_WIN_HSCROLL; + c->state=&task->horz_scroll; + c->update_derived_vals=&WinDerivedScrollValsUpdate; + c->draw_it=&DrawWinScroll; + c->left_click=&LeftClickHWinScroll; + QueIns(c,task->last_ctrl); + } + + if (!CtrlFindUnique(task,CTRLT_WIN_VSCROLL)) { + c=CAlloc(sizeof(CCtrl)); + c->win_task=task; + c->flags=CTRLF_SHOW|CTRLF_BORDER|CTRLF_CAPTURE_LEFT_IP; + c->type=CTRLT_WIN_VSCROLL; + c->state=&task->vert_scroll; + c->update_derived_vals=&WinDerivedScrollValsUpdate; + c->draw_it=&DrawWinScroll; + c->left_click=&LeftClickVWinScroll; + c->wheel_chg=&WheelChangeWinScroll; + QueIns(c,task->last_ctrl); + } + TaskDerivedValsUpdate(task); +} +#define VIEWANGLES_SPACING 22 +#define VIEWANGLES_RANGE 48 +#define VIEWANGLES_BORDER 2 +#define VIEWANGLES_SNAP 2 + +U0 DrawViewAnglesCtrl(CDC *dc,CCtrl *c) +{ + I64 i,j; + CViewAngles *s=c->state; + + dc->color=s->cbd; + GrRect(dc, c->left,c->top,VIEWANGLES_SPACING*4+3, + VIEWANGLES_SPACING*2+VIEWANGLES_RANGE); + dc->color=s->cbg; + GrRect(dc, c->left+VIEWANGLES_BORDER,c->top+VIEWANGLES_BORDER, + VIEWANGLES_SPACING*4+3-2*VIEWANGLES_BORDER, + VIEWANGLES_SPACING*2+VIEWANGLES_RANGE-2*VIEWANGLES_BORDER); + dc->color=s->cfg; + GrLine(dc,c->left+VIEWANGLES_SPACING,c->top+VIEWANGLES_SPACING, + c->left+VIEWANGLES_SPACING,c->top+VIEWANGLES_SPACING+ + VIEWANGLES_RANGE-1); + GrLine(dc,c->left+2*VIEWANGLES_SPACING+1,c->top+VIEWANGLES_SPACING, + c->left+2*VIEWANGLES_SPACING+1,c->top+VIEWANGLES_SPACING+ + VIEWANGLES_RANGE-1); + GrLine(dc,c->left+3*VIEWANGLES_SPACING+2,c->top+VIEWANGLES_SPACING, + c->left+3*VIEWANGLES_SPACING+2,c->top+VIEWANGLES_SPACING+ + VIEWANGLES_RANGE-1); + for (i=1;ileft+VIEWANGLES_SPACING-j,c->bottom-VIEWANGLES_SPACING-i, + c->left+VIEWANGLES_SPACING+j,c->bottom + -VIEWANGLES_SPACING-i); + GrLine(dc,c->left+2*VIEWANGLES_SPACING+1-j,c->bottom-VIEWANGLES_SPACING-i, + c->left+2*VIEWANGLES_SPACING+1+j,c->bottom + -VIEWANGLES_SPACING-i); + GrLine(dc,c->left+3*VIEWANGLES_SPACING+2-j,c->bottom-VIEWANGLES_SPACING-i, + c->left+3*VIEWANGLES_SPACING+2+j,c->bottom + -VIEWANGLES_SPACING-i); + } + + dc->color=s->cx; + GrPrint(dc,c->left+VIEWANGLES_SPACING-FONT_WIDTH/2, + c->top+VIEWANGLES_SPACING-(1+FONT_HEIGHT),"X"); + GrPrint(dc,c->left+VIEWANGLES_SPACING-3*FONT_WIDTH/2, + c->top+VIEWANGLES_SPACING+VIEWANGLES_RANGE+3, + "%3d",s->sx*360/VIEWANGLES_RANGE); + i=c->left+VIEWANGLES_SPACING; + if (s->sx>VIEWANGLES_RANGE/2) + j=-VIEWANGLES_RANGE/2+s->sx; + else + j=s->sx+VIEWANGLES_RANGE/2; + j=c->top+VIEWANGLES_SPACING+VIEWANGLES_RANGE-1-j; + GrRect(dc,i-3,j-2,7,5); + dc->color=s->cx^8; + GrRect(dc,i-2,j-1,5,3); + + dc->color=s->cy; + GrPrint(dc,c->left+2*VIEWANGLES_SPACING+1-FONT_WIDTH/2, + c->top+VIEWANGLES_SPACING-(1+FONT_HEIGHT),"Y"); + GrPrint(dc,c->left+2*VIEWANGLES_SPACING+1-3*FONT_WIDTH/2, + c->top+VIEWANGLES_SPACING+VIEWANGLES_RANGE+3, + "%3d",s->sy*360/VIEWANGLES_RANGE); + i=c->left+2*VIEWANGLES_SPACING+1; + if (s->sy>VIEWANGLES_RANGE/2) + j=-VIEWANGLES_RANGE/2+s->sy; + else + j=s->sy+VIEWANGLES_RANGE/2; + j=c->top+VIEWANGLES_SPACING+VIEWANGLES_RANGE-1-j; + GrRect(dc,i-3,j-2,7,5); + dc->color=s->cy^8; + GrRect(dc,i-2,j-1,5,3); + + dc->color=s->cz; + GrPrint(dc,c->left+3*VIEWANGLES_SPACING+2-FONT_WIDTH/2, + c->top+VIEWANGLES_SPACING-(1+FONT_HEIGHT),"Z"); + GrPrint(dc,c->left+3*VIEWANGLES_SPACING+2-3*FONT_WIDTH/2, + c->top+VIEWANGLES_SPACING+VIEWANGLES_RANGE+3, + "%3d",s->sz*360/VIEWANGLES_RANGE); + i=c->left+3*VIEWANGLES_SPACING+2; + if (s->sz>VIEWANGLES_RANGE/2) + j=-VIEWANGLES_RANGE/2+s->sz; + else + j=s->sz+VIEWANGLES_RANGE/2; + j=c->top+VIEWANGLES_SPACING+VIEWANGLES_RANGE-1-j; + GrRect(dc,i-3,j-2,7,5); + dc->color=s->cz^8; + GrRect(dc,i-2,j-1,5,3); +} + +U0 UpdateDerivedViewAnglesCtrl(CCtrl *c) +{ + CViewAngles *s=c->state; + c->left=c->win_task->pix_width-(VIEWANGLES_SPACING*4+3); + c->right=c->left+VIEWANGLES_SPACING*4+3; + c->top=c->win_task->pix_height-(VIEWANGLES_SPACING*2+VIEWANGLES_RANGE); + c->bottom=c->top+VIEWANGLES_SPACING*2+VIEWANGLES_RANGE; + s->sx=ClampI64(RoundI64(s->sx,VIEWANGLES_SNAP),0,VIEWANGLES_RANGE-1); + s->sy=ClampI64(RoundI64(s->sy,VIEWANGLES_SNAP),0,VIEWANGLES_RANGE-1); + s->sz=ClampI64(RoundI64(s->sz,VIEWANGLES_SNAP),0,VIEWANGLES_RANGE-1); + s->ax=2*ã*s->sx/VIEWANGLES_RANGE; + s->ay=2*ã*s->sy/VIEWANGLES_RANGE; + s->az=2*ã*s->sz/VIEWANGLES_RANGE; +} + +U0 LeftClickViewAngles(CCtrl *c,I64 x,I64 y,Bool) +{ + CViewAngles *s=c->state; + I64 i; + i=VIEWANGLES_RANGE-1-(y-(c->top+VIEWANGLES_SPACING)); + if (i>=VIEWANGLES_RANGE/2) + i-=VIEWANGLES_RANGE/2; + else + i+=VIEWANGLES_RANGE/2; + if (xleft+(c->right-c->left)/3) + s->sx=i; + else if (xleft+2*(c->right-c->left)/3) + s->sy=i; + else + s->sz=i; + if (c->update_derived_vals) + (*c->update_derived_vals)(c); +} + +public CCtrl *ViewAnglesNew(CTask *task=NULL) +{//Create view angle ctrl. See $LK,"::/Demo/Graphics/Shading.HC"$. + CCtrl *c; + CViewAngles *s; + if (!task) task=Fs; + if (!(c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES))) { + s=CAlloc(sizeof(CViewAngles),task); + c=CAlloc(sizeof(CCtrl)); + s->cbd=BLUE; + s->cbg=LTBLUE; + s->cfg=BLACK; + s->cx=LTGREEN; + s->cy=GREEN; + s->cz=LTGREEN; + c->win_task=task; + c->flags=CTRLF_SHOW|CTRLF_CAPTURE_LEFT_IP; + c->type=CTRLT_VIEWING_ANGLES; + c->state=s; + c->draw_it=&DrawViewAnglesCtrl; + c->left_click=&LeftClickViewAngles; + c->update_derived_vals=&UpdateDerivedViewAnglesCtrl; + QueIns(c,task->last_ctrl); + TaskDerivedValsUpdate(task); + } + return c; +} + +public U0 ViewAnglesDel(CTask *task=NULL) +{//Free view angle ctrl. + CCtrl *c; + if (!task) task=Fs; + if (c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES)) { + QueRem(c); + Free(c->state); + Free(c); + } +} diff --git a/Adam/Ctrls/CtrlsButton.CPP b/Adam/Ctrls/CtrlsButton.CPP deleted file mode 100644 index 1103152..0000000 --- a/Adam/Ctrls/CtrlsButton.CPP +++ /dev/null @@ -1,91 +0,0 @@ -#define BUTTON_BORDER 2 - -#define BTF_DONT_FREE 1 - -class CCtrlButtonState -{ - I64 state,num_states,flags; - U8 *state_texts; - CColorROPU32 *state_colors; -}; - -U0 DrawCtrlButton(CDC *dc,CCtrl *c) -{ - CCtrlButtonState *s=c->state; - I64 l; - U8 *st; - - dc->color=BLACK; - GrRect(dc,c->left,c->top,c->right-c->left+1,c->bottom-c->top+1); - if (!(st=LstSub(s->state,s->state_texts))) - st=s->state_texts; - dc->color=s->state_colors[s->state]; - l=StrLen(st); - GrRect(dc,c->left+BUTTON_BORDER,c->top+BUTTON_BORDER, - c->right-c->left+1-BUTTON_BORDER*2, - c->bottom-c->top+1-BUTTON_BORDER*2); - dc->color=s->state_colors[s->state]^(WHITE<<16+WHITE); - GrPrint(dc,(c->left+c->right+1-l*FONT_WIDTH)>>1, - (c->top+c->bottom+1-FONT_HEIGHT)>>1,"%s",st); -} - -U0 LeftClickCtrlButton(CCtrl *c,I64,I64,Bool down) -{ - CCtrlButtonState *s=c->state; - if (down) { - s->state++; - if (s->state==s->num_states) - s->state=0; - } -} - -public CCtrl *CtrlButtonNew(I64 x,I64 y,I64 width=-1,I64 height=-1, - I64 num_states=1,U8 *state_texts, - I32 *state_colors,CCtrlButtonState *_s=NULL) -{//Create button ctrl. See $LK,"::/Apps/Strut/Strut.CPP"$. - CCtrl *res; - CCtrlButtonState *s; - I64 i,j,l; - U8 *st; - if (width<0) { - l=1; - for (i=0;il) l=j; - } - width=BUTTON_BORDER*4+l*FONT_WIDTH; - } - if (height<0) height=BUTTON_BORDER*4+FONT_HEIGHT; - res=CAlloc(sizeof(CCtrl)); - if (_s) { - s=_s; - MemSet(s,0,sizeof(CCtrlButtonState)); - } else { - s=CAlloc(sizeof(CCtrlButtonState)); - s->flags=BTF_DONT_FREE; - } - s->num_states=num_states; - s->state_texts=state_texts; - s->state_colors=state_colors; - res->win_task=Fs; - res->flags=CTRLF_SHOW; - res->type=CTRLT_GENERIC; - res->state=s; - res->draw_it=&DrawCtrlButton; - res->left_click=&LeftClickCtrlButton; - res->left=x; - res->top=y; - res->right=res->left+width-1; - res->bottom=res->top+height-1; - QueIns(res,Fs->last_ctrl); - return res; -} - -public U0 CtrlButtonDel(CCtrl *c) -{//Free button ctrl. - QueRem(c); - if (!(c->flags&BTF_DONT_FREE)) - Free(c->state); - Free(c); -} diff --git a/Adam/Ctrls/CtrlsButton.HC b/Adam/Ctrls/CtrlsButton.HC new file mode 100644 index 0000000..2e00278 --- /dev/null +++ b/Adam/Ctrls/CtrlsButton.HC @@ -0,0 +1,91 @@ +#define BUTTON_BORDER 2 + +#define BTF_DONT_FREE 1 + +class CCtrlButtonState +{ + I64 state,num_states,flags; + U8 *state_texts; + CColorROPU32 *state_colors; +}; + +U0 DrawCtrlButton(CDC *dc,CCtrl *c) +{ + CCtrlButtonState *s=c->state; + I64 l; + U8 *st; + + dc->color=BLACK; + GrRect(dc,c->left,c->top,c->right-c->left+1,c->bottom-c->top+1); + if (!(st=LstSub(s->state,s->state_texts))) + st=s->state_texts; + dc->color=s->state_colors[s->state]; + l=StrLen(st); + GrRect(dc,c->left+BUTTON_BORDER,c->top+BUTTON_BORDER, + c->right-c->left+1-BUTTON_BORDER*2, + c->bottom-c->top+1-BUTTON_BORDER*2); + dc->color=s->state_colors[s->state]^(WHITE<<16+WHITE); + GrPrint(dc,(c->left+c->right+1-l*FONT_WIDTH)>>1, + (c->top+c->bottom+1-FONT_HEIGHT)>>1,"%s",st); +} + +U0 LeftClickCtrlButton(CCtrl *c,I64,I64,Bool down) +{ + CCtrlButtonState *s=c->state; + if (down) { + s->state++; + if (s->state==s->num_states) + s->state=0; + } +} + +public CCtrl *CtrlButtonNew(I64 x,I64 y,I64 width=-1,I64 height=-1, + I64 num_states=1,U8 *state_texts, + I32 *state_colors,CCtrlButtonState *_s=NULL) +{//Create button ctrl. See $LK,"::/Apps/Strut/Strut.HC"$. + CCtrl *res; + CCtrlButtonState *s; + I64 i,j,l; + U8 *st; + if (width<0) { + l=1; + for (i=0;il) l=j; + } + width=BUTTON_BORDER*4+l*FONT_WIDTH; + } + if (height<0) height=BUTTON_BORDER*4+FONT_HEIGHT; + res=CAlloc(sizeof(CCtrl)); + if (_s) { + s=_s; + MemSet(s,0,sizeof(CCtrlButtonState)); + } else { + s=CAlloc(sizeof(CCtrlButtonState)); + s->flags=BTF_DONT_FREE; + } + s->num_states=num_states; + s->state_texts=state_texts; + s->state_colors=state_colors; + res->win_task=Fs; + res->flags=CTRLF_SHOW; + res->type=CTRLT_GENERIC; + res->state=s; + res->draw_it=&DrawCtrlButton; + res->left_click=&LeftClickCtrlButton; + res->left=x; + res->top=y; + res->right=res->left+width-1; + res->bottom=res->top+height-1; + QueIns(res,Fs->last_ctrl); + return res; +} + +public U0 CtrlButtonDel(CCtrl *c) +{//Free button ctrl. + QueRem(c); + if (!(c->flags&BTF_DONT_FREE)) + Free(c->state); + Free(c); +} diff --git a/Adam/Ctrls/CtrlsSlider.CPP b/Adam/Ctrls/CtrlsSlider.HC similarity index 100% rename from Adam/Ctrls/CtrlsSlider.CPP rename to Adam/Ctrls/CtrlsSlider.HC diff --git a/Adam/Ctrls/MakeCtrls.CPP b/Adam/Ctrls/MakeCtrls.HC similarity index 100% rename from Adam/Ctrls/MakeCtrls.CPP rename to Adam/Ctrls/MakeCtrls.HC diff --git a/Adam/DevInfo.CPP b/Adam/DevInfo.CPP deleted file mode 100644 index 2ff36a1..0000000 --- a/Adam/DevInfo.CPP +++ /dev/null @@ -1,207 +0,0 @@ -#help_index "PCI;Processor;Devices;Info" - -//The file was downloaded from -//http://www.pcidatabase.com/reports.php?type=tab-delimeted - -#define PCI_DEV_FILE "::/Misc/PCIDevices.TXT.Z" - -/**** -//1) Plain text edit and remove file header and tail -//2) Text find-and-replace "=0A=" with "". -//3) Run PCIDevFileGen(). - -public U0 PCIDevFileGen() -{ - Bool first=TRUE,del=FALSE,del2=FALSE,cont=FALSE; - CDoc *doc=DocRead(PCI_DEV_FILE, - DOCF_PLAIN_TEXT|DOCF_DBL_DOLLARS|DOCF_NO_CURSOR); - CDocEntry *doc_e=doc->head.next,*doc_e2; - while (doc_e!=doc) { - doc_e2=doc_e->next; - if (first) { - if (doc_e->type_u8==DOCT_TEXT) { - if (doc_e->tag[0]==';') - del=TRUE; - } - first=FALSE; - } - if (doc_e->type_u8==DOCT_TEXT && doc_e->tag[StrLen(doc_e->tag)-1]=='=' && - doc_e2->type_u8==DOCT_NEW_LINE) { - doc_e->tag[StrLen(doc_e->tag)-1]=CH_SPACE; - cont=TRUE; - } - del2=del; - if (doc_e->type_u8==DOCT_NEW_LINE) { - first=TRUE; - del2=FALSE; - if (cont) { - del=TRUE; - cont=FALSE; - } - } - if (del) - DocEntryDel(doc,doc_e); - del=del2; - doc_e=doc_e2; - } - DocWrite(doc); -} -****/ - -//$LK,"::/Misc/PCIDevices.TXT",A="PI:::/Misc/PCIDevices.TXT"$ -U0 PCILookUpSingle(CDoc *doc,I64 m,I64 d,U8 **_vendor,U8 **_dev) -{ - Bool first=TRUE; - U8 buf[8],*vendor=NULL,*dev=NULL; - CDocEntry *doc_e=doc->head.next; - while (doc_e!=doc) { - if (first) { - if (doc_e->type_u8==DOCT_TEXT && doc_e->tag[0]!=';' && - StrLen(doc_e->tag)>=4) { - buf[0](U16)='0x'; - buf[2](U32)=doc_e->tag(U32 *)[0]; - buf[6]=0; - if (Str2I64(buf)==m) { - doc_e=doc_e->next->next; - if (doc_e->type_u8==DOCT_TEXT) { - vendor=AStrNew(doc_e->tag); - first=FALSE; - break; - } - } - } - first=FALSE; - } - if (doc_e->type_u8==DOCT_NEW_LINE) - first=TRUE; - doc_e=doc_e->next; - } - - if (vendor) { - while (doc_e!=doc) { - if (first) { - if (doc_e->type_u8==DOCT_TAB) { - doc_e=doc_e->next; - if (doc_e->type_u8==DOCT_TEXT && StrLen(doc_e->tag)>=4) { - buf[0](U16)='0x'; - buf[2](U32)=doc_e->tag(U32 *)[0]; - buf[6]=0; - if (Str2I64(buf)==d) { - doc_e=doc_e->next->next; - if (doc_e->type_u8==DOCT_TEXT) { - dev=AStrNew(doc_e->tag); - break; - } - } - } - } else - break; - first=FALSE; - } - if (doc_e->type_u8==DOCT_NEW_LINE) - first=TRUE; - doc_e=doc_e->next; - } - } - - if (vendor) - *_vendor=vendor; - else - *_vendor=AStrNew("Unknown"); - - if (dev) - *_dev=dev; - else - *_dev=AStrNew("Unknown"); -} - -U0 PCILookUpDevs() -{ - CPCIDev *temppci; - I64 w1,w2,b,d,f,timeout=32*8*2; - CDoc *doc; - if (dev.pci_head.next!=&dev.pci_head) - return; - doc=DocRead(PCI_DEV_FILE,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR); - for (b=0;bbus=b; - temppci->dev=d; - temppci->fun=f; - temppci->vendor=w1; - temppci->dev_id=w2=PCIReadU16(b,d,f,2); - temppci->sub_code=PCIReadU8(b,d,f,0xA); - temppci->base_code=PCIReadU8(b,d,f,0xB); - PCILookUpSingle(doc,w1,w2,&temppci->vendor_str,&temppci->dev_id_str); - QueIns(temppci,dev.pci_head.last); - timeout=32*8*2; - } else if (sys_pci_busses==256 && --timeout<=0) - goto lud_done; - } -lud_done: - DocDel(doc); -} - -public U0 PCIRep() -{//Report description of PCI devices. - CPCIDev *temppci; - "PCI Busses:%d\n",sys_pci_busses; - if (!FileFind(PCI_DEV_FILE)) { - "You don't have the PCI device file.\n"; - return; - } - PCILookUpDevs; - temppci=dev.pci_head.next; - while (temppci!=&dev.pci_head) { - "%02X:%02X:%01X %02X%02X $$GREEN$$%s $$CYAN$$%s$$FG$$\n", - temppci->bus,temppci->dev,temppci->fun, - temppci->base_code,temppci->sub_code, - temppci->vendor_str,temppci->dev_id_str; - temppci=temppci->next; - } -} - -#help_index "Info;Time/CPU Cycles" -public U0 CPURep() -{//Report number of cores and clock freq. - "%d Cores %6h?nHz\n",mp_cnt,ToF64(cnts.time_stamp_freq); -} - -#help_index "Info;Memory/Info" -public U0 MemBIOSRep() -{//Report the memory ranges reported by the BIOS at boot. - U16 *m01=SYS_MEM_E801; - CMemE820 *m20=SYS_MEM_E820; - CMemRange *tempmr; - "Standard Addresses\n" - "0x000A0000-0x000BFFFF VGA\n" - "0xFEE00000-0xFEE00FFF See $$LK,\"APIC\",A=\"MN:LAPIC_BASE\"$$\n\n" - "32 Bit Device Mem\n"; - while (LBts(&sys_semas[SYS_SEMA_DEV_MEM],0)) - Yield; - tempmr=dev.mem32_head.next; - while (tempmr!=&dev.mem32_head) { - "%02X:0x%016X-0x%016X\n", - tempmr->type,tempmr->base,tempmr->base+tempmr->size-1; - tempmr=tempmr->next; - } - LBtr(&sys_semas[SYS_SEMA_DEV_MEM],0); - - "\nBIOS Memory Report 15:E801\n" - "01:0x0000000000000000-0x%016X\n",0x100000+m01[0]<<10-1; - "01:0x0000000001000000-0x%016X\n",0x1000000+m01[1]<<16-1; - - if (m20->type) { - '\n'; - "BIOS Memory Report 15:E820\n"; - while (m20->type) { - "%02X:0x%016X-0x%016X\n",m20->type,m20->base,m20->base+m20->len-1; - m20++; - } - } - -} diff --git a/Adam/DevInfo.HC b/Adam/DevInfo.HC new file mode 100644 index 0000000..896c604 --- /dev/null +++ b/Adam/DevInfo.HC @@ -0,0 +1,274 @@ +#help_index "PCI;Processor;Devices;Info" + +//The file was downloaded from +//http://www.pcidatabase.com/reports.php?type=tab-delimeted + +#define PCI_DEV_FILE "::/Misc/PCIDevices.DD.Z" + +/**** +//1) Plain text edit and remove file header and tail +//2) Text find-and-replace "=0A=" with "". +//3) Run PCIDevFileGen(). + +public U0 PCIDevFileGen() +{ + Bool first=TRUE,del=FALSE,del2=FALSE,cont=FALSE; + CDoc *doc=DocRead(PCI_DEV_FILE, + DOCF_PLAIN_TEXT|DOCF_DBL_DOLLARS|DOCF_NO_CURSOR); + CDocEntry *doc_e=doc->head.next,*doc_e2; + while (doc_e!=doc) { + doc_e2=doc_e->next; + if (first) { + if (doc_e->type_u8==DOCT_TEXT) { + if (doc_e->tag[0]==';') + del=TRUE; + } + first=FALSE; + } + if (doc_e->type_u8==DOCT_TEXT && doc_e->tag[StrLen(doc_e->tag)-1]=='=' && + doc_e2->type_u8==DOCT_NEW_LINE) { + doc_e->tag[StrLen(doc_e->tag)-1]=CH_SPACE; + cont=TRUE; + } + del2=del; + if (doc_e->type_u8==DOCT_NEW_LINE) { + first=TRUE; + del2=FALSE; + if (cont) { + del=TRUE; + cont=FALSE; + } + } + if (del) + DocEntryDel(doc,doc_e); + del=del2; + doc_e=doc_e2; + } + DocWrite(doc); +} +****/ + +//$LK,"::/Misc/PCIDevices.DD",A="PI:::/Misc/PCIDevices.DD"$ +U0 PCILookUpSingle(CDoc *doc,I64 m,I64 d,U8 **_vendor,U8 **_dev) +{ + Bool first=TRUE; + U8 buf[8],*vendor=NULL,*dev=NULL; + CDocEntry *doc_e=doc->head.next; + while (doc_e!=doc) { + if (first) { + if (doc_e->type_u8==DOCT_TEXT && doc_e->tag[0]!=';' && + StrLen(doc_e->tag)>=4) { + buf[0](U16)='0x'; + buf[2](U32)=doc_e->tag(U32 *)[0]; + buf[6]=0; + if (Str2I64(buf)==m) { + doc_e=doc_e->next->next; + if (doc_e->type_u8==DOCT_TEXT) { + vendor=AStrNew(doc_e->tag); + first=FALSE; + break; + } + } + } + first=FALSE; + } + if (doc_e->type_u8==DOCT_NEW_LINE) + first=TRUE; + doc_e=doc_e->next; + } + + if (vendor) { + while (doc_e!=doc) { + if (first) { + if (doc_e->type_u8==DOCT_TAB) { + doc_e=doc_e->next; + if (doc_e->type_u8==DOCT_TEXT && StrLen(doc_e->tag)>=4) { + buf[0](U16)='0x'; + buf[2](U32)=doc_e->tag(U32 *)[0]; + buf[6]=0; + if (Str2I64(buf)==d) { + doc_e=doc_e->next->next; + if (doc_e->type_u8==DOCT_TEXT) { + dev=AStrNew(doc_e->tag); + break; + } + } + } + } else + break; + first=FALSE; + } + if (doc_e->type_u8==DOCT_NEW_LINE) + first=TRUE; + doc_e=doc_e->next; + } + } + + if (vendor) + *_vendor=vendor; + else + *_vendor=AStrNew("Unknown"); + + if (dev) + *_dev=dev; + else + *_dev=AStrNew("Unknown"); +} + +U0 PCILookUpDevs() +{ + CPCIDev *temppci; + I64 w1,w2,b,d,f,timeout=32*8*2; + CDoc *doc; + if (dev.pci_head.next!=&dev.pci_head) + return; + doc=DocRead(PCI_DEV_FILE,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR); + for (b=0;bbus=b; + temppci->dev=d; + temppci->fun=f; + temppci->vendor=w1; + temppci->dev_id=w2=PCIReadU16(b,d,f,2); + temppci->sub_code=PCIReadU8(b,d,f,0xA); + temppci->base_code=PCIReadU8(b,d,f,0xB); + PCILookUpSingle(doc,w1,w2,&temppci->vendor_str,&temppci->dev_id_str); + QueIns(temppci,dev.pci_head.last); + timeout=32*8*2; + } else if (sys_pci_busses==256 && --timeout<=0) + goto lud_done; + } +lud_done: + DocDel(doc); +} + +public U0 PCIRep() +{//Report description of PCI devices. + CPCIDev *temppci; + "PCI Busses:%d\n",sys_pci_busses; + if (!FileFind(PCI_DEV_FILE)) { + "You don't have the PCI device file.\n"; + return; + } + PCILookUpDevs; + temppci=dev.pci_head.next; + while (temppci!=&dev.pci_head) { + "%02X:%02X:%01X %02X%02X $$GREEN$$%s $$CYAN$$%s$$FG$$\n", + temppci->bus,temppci->dev,temppci->fun, + temppci->base_code,temppci->sub_code, + temppci->vendor_str,temppci->dev_id_str; + temppci=temppci->next; + } +} + +#help_index "Info;Time/CPU Cycles" +class CCPURep +{ + Bool mp_start,mp_end; + I64 mp_not_done_flags, + **swaps, + **cycles; +}; + +U0 MPCPURep(CCPURep *cr) +{ + I64 swaps=0,cycles_0,cycles_f; + while (!cr->mp_start) + Yield; + cycles_0=GetTSC; + while (!cr->mp_end) { + swaps++; + Yield; + } + cycles_f=GetTSC; + cr->swaps[Gs->num]=swaps; + cr->cycles[Gs->num]=cycles_f-cycles_0; + LBtr(&cr->mp_not_done_flags,Gs->num); +} + +public U0 CPURep(Bool full=FALSE) +{//Report number of cores and clock freq. + I64 i,total_swaps,total_cycles; + F64 t0,tf; + CCPURep cr; + + if (!full) + "%d Cores %6h?nHz\n",mp_cnt,ToF64(cnts.time_stamp_freq); + else { + cr.swaps=CAlloc(sizeof(I64)*mp_cnt); + cr.cycles=CAlloc(sizeof(I64)*mp_cnt); + cr.mp_start=cr.mp_end=FALSE; + cr.mp_not_done_flags=1<type,tempmr->base,tempmr->base+tempmr->size-1; + tempmr=tempmr->next; + } + LBtr(&sys_semas[SYS_SEMA_DEV_MEM],0); + + "\nBIOS Memory Report 15:E801\n" + "01:0x0000000000000000-0x%016X\n",0x100000+m01[0]<<10-1; + "01:0x0000000001000000-0x%016X\n",0x1000000+m01[1]<<16-1; + + if (m20->type) { + '\n'; + "BIOS Memory Report 15:E820\n"; + while (m20->type) { + "%02X:0x%016X-0x%016X\n",m20->type,m20->base,m20->base+m20->len-1; + m20++; + } + } + +} diff --git a/Adam/DolDoc/DocBin.CPP b/Adam/DolDoc/DocBin.HC similarity index 100% rename from Adam/DolDoc/DocBin.CPP rename to Adam/DolDoc/DocBin.HC diff --git a/Adam/DolDoc/DocChar.CPP b/Adam/DolDoc/DocChar.CPP deleted file mode 100644 index af2dadf..0000000 --- a/Adam/DolDoc/DocChar.CPP +++ /dev/null @@ -1,652 +0,0 @@ -#help_index "DolDoc/Editor" - -public I64 EdCurU8(CDoc *doc) -{//Return cur U8. See $LK,"EdRenumAsm",A="MN:EdRenumAsm"$ for an example. - Bool unlock=DocLock(doc); - CDocEntry *doc_ce=doc->cur_entry; - I64 res=-1; - if (doc_ce->type_u8==DOCT_TEXT && - doc_ce->min_col<=doc->cur_colmax_col) - res=doc_ce->tag[doc->cur_col]; - else if (doc_ce->type_u8==DOCT_TAB) - res='\t'; - else if (doc_ce->type_u8==DOCT_NEW_LINE || - doc_ce->type_u8==DOCT_SOFT_NEW_LINE) - res='\n'; - if (unlock) - DocUnlock(doc); - return res; -} - -public U0 EdCursorLeft(CDoc *doc,I64 sc=MIN_I64) -{//Move cursor left. Might need a call to $LK,"DocRecalc",A="MN:DocRecalc"$(). -//See $LK,"EdRenumAsm",A="MN:EdRenumAsm"$ for an example. - U8 *dst; - Bool unlock=DocLock(doc); - CDocEntry *doc_ce=doc->cur_entry,*original_ce=doc_ce,*doc_ne; - I64 cc=doc->cur_col,y=doc_ce->y; - if (sc!=MIN_I64) sc=sc.u32[0]; - if (sc>=0 && sc&SCF_CTRL) { - while (doc_ce->last!=doc && (doc_ce->last->y==y || - doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP))) - doc_ce=doc_ce->last; //TODO: sel? recurse? - cc=doc_ce->min_col; - } else { - if (cc>doc_ce->min_col) { - if (IsEditableText(doc_ce) && ccmax_col) { - dst=doc_ce->tag+cc; - doc_ne=DocEntryNewTag(doc,doc_ce,dst); - *dst=0; - doc_ce->max_col=cc; - QueIns(doc_ne,doc_ce); - } - cc--; - if (IsEditableText(doc_ce) && cc>doc_ce->min_col) { - dst=doc_ce->tag+cc; - doc_ne=DocEntryNewTag(doc,doc_ce,dst); - *dst=0; - doc_ce->max_col=cc; - QueIns(doc_ne,doc_ce); - doc_ce=doc_ne; - cc=doc_ce->min_col; - } - if (sc>=0) - BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); - } else { - cc=doc_ce->min_col; - while (doc_ce->last!=doc && - (doc_ce->last->type_u8==DOCT_SOFT_NEW_LINE || - doc_ce->last->type_u8==DOCT_INDENT || - doc_ce->last->de_flags&(DOCEF_SKIP|DOCEF_FILTER_SKIP))) { - doc_ce=doc_ce->last; - if (sc>=0) - BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); - } - if (doc_ce->last!=doc) { - doc_ce=doc_ce->last; - if (doc_ce->max_col>doc_ce->min_col) { - cc=doc_ce->max_col-1; - if (IsEditableText(doc_ce) && cc>doc_ce->min_col) { - dst=doc_ce->tag+cc; - doc_ne=DocEntryNewTag(doc,doc_ce,dst); - *dst=0; - doc_ce->max_col=cc; - QueIns(doc_ne,doc_ce); - doc_ce=doc_ne; - cc=doc_ce->min_col; - } - } else - cc=doc_ce->max_col; - if (sc>=0) - BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); - } - } - } - doc->cur_col=cc; - doc->cur_entry=doc_ce; - if (doc_ce!=original_ce) - DocFormBwd(doc); - if (unlock) - DocUnlock(doc); -} - -public U0 EdCursorRight(CDoc *doc,I64 sc=MIN_I64) -{//Move cursor right. Might need a call to $LK,"DocRecalc",A="MN:DocRecalc"$(). -//See $LK,"EdRenumAsm",A="MN:EdRenumAsm"$ for an example. - Bool unlock=DocLock(doc); - U8 *dst; - CDocEntry *doc_ce=doc->cur_entry,*original_ce=doc_ce,*doc_ne; - I64 cc=doc->cur_col,y=doc_ce->y,old_de_flags,old_color; - if (sc!=MIN_I64) sc=sc.u32[0]; - if (sc>=0 && sc&SCF_CTRL) { - while (doc_ce!=doc && doc_ce->next->y==y && - doc_ce->next->type_u8!=DOCT_SOFT_NEW_LINE && doc_ce->next!=doc && - (doc_ce->next->type_u8!=DOCT_NEW_LINE || !(doc->flags & DOCF_FORM)) || - doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP)) - doc_ce=doc_ce->next; - if (doc_ce->max_col>doc_ce->min_col) - cc=doc_ce->max_col-1; - else - cc=doc_ce->min_col; - } else { - if (ccmax_col) { - if (IsEditableText(doc_ce) && cc>doc_ce->min_col) { - dst=doc_ce->tag+cc; - doc_ne=DocEntryNewTag(doc,doc_ce,dst); - *dst=0; - doc_ce->max_col=cc; - QueIns(doc_ne,doc_ce); - doc_ce=doc_ne; - cc=doc_ce->min_col; - } - cc++; - old_de_flags=doc_ce->de_flags; - old_color=doc_ce->type; - if (sc>=0) - BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); - if (IsEditableText(doc_ce) && ccmax_col) { - dst=doc_ce->tag+cc; - doc_ne=DocEntryNewTag(doc,doc_ce,dst); - *dst=0; - doc_ne->type=DOCT_TEXT | old_color & -0x100; - doc_ne->de_flags=old_de_flags|doldoc.dft_de_flags[DOCT_TEXT]; - doc_ce->max_col=cc; - QueIns(doc_ne,doc_ce); - doc_ce=doc_ne; - cc=doc_ce->min_col; - } else if (cc>=doc_ce->max_col) { - doc_ce=doc_ce->next; - cc=doc_ce->min_col; - } - } else { - if (doc_ce!=doc) { - if (cc<=doc_ce->min_col && sc>=0) - BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); - doc_ce=doc_ce->next; - while (doc_ce!=doc && doc_ce->de_flags&(DOCEF_SKIP|DOCEF_FILTER_SKIP)) { - if (sc>=0) - BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); - doc_ce=doc_ce->next; - } - cc=doc_ce->min_col; - if (doc_ce->type_u8==DOCT_SOFT_NEW_LINE) { - if (sc>=0) - BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); - doc_ce=doc_ce->next; - cc=doc_ce->min_col; - } - } - } - } - doc->cur_col=cc; - doc->cur_entry=doc_ce; - if (doc_ce!=original_ce) - DocFormFwd(doc); - if (unlock) - DocUnlock(doc); -} - -public U0 EdLineUp(CDoc *doc,I64 sc=MIN_I64) -{//Move cursor up. Might need a call to $LK,"DocRecalc",A="MN:DocRecalc"$(). -//See $LK,"EdRenumAsm",A="MN:EdRenumAsm"$ for an example. - Bool unlock=DocLock(doc); - U8 *dst; - I64 y,x; - CDocEntry *doc_ce=doc->cur_entry,*doc_ne; - - if (sc!=MIN_I64) sc=sc.u32[0]; - if (doc_ce->type_u8==DOCT_HEX_ED) { - doc->cur_col=doc->cur_col-doc_ce->hex_ed_width*3; - if (doc->cur_col>=0) { - if (unlock) - DocUnlock(doc); - return; - } else - doc->cur_col=0; - } - x=doc->x; y=doc->y; - if (IsEditableText(doc_ce)) { - if (doc_ce->min_colcur_colmax_col-1) { - dst=doc_ce->tag+doc->cur_col; - doc_ne=DocEntryNewTag(doc,doc_ce,dst); - *dst=0; - doc_ne->x=doc_ce->x+doc->cur_col; - doc_ce->max_col=doc->cur_col; - QueIns(doc_ne,doc_ce); - } else if (doc->cur_col==doc_ce->min_col && doc_ce->last!=doc) - doc_ce=doc_ce->last; - } else if (doc_ce->last!=doc) - doc_ce=doc_ce->last; - if (sc>=0) - BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); - doc->cur_entry=doc_ce; - DocFormBwd(doc); - doc_ce=doc->cur_entry; - while (doc_ce->last!=doc && (doc_ce->y>=y || - doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP))) { - doc_ce=doc_ce->last; - if (sc>=0) - BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); - } - y=doc_ce->y; - doc->y=y; - while (doc_ce!=doc && (doc_ce->y>=y && doc_ce->x>=x || - doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP))) { - if (sc>=0) - BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); - doc_ce=doc_ce->last; - } - - if (doc_ce==doc || doc_ce->ynext; - else { - if (!IsEditableText(doc_ce)) { - if (sc>=0) - BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); - } else { - if (doc_ce->next->x==x) { - doc_ce=doc_ce->next; - if (doc->flags & DOCF_FORM) - while (doc_ce->next->x==x && - (!Bt(doldoc.type_flags_form,doc_ce->type_u8) && - !(doc_ce->de_flags&DOCEF_LINK)|| - doc_ce->de_flags&DOCEF_SKIP_IN_FORM)) - doc_ce=doc_ce->next; - } - } - } - if (doc_ce->de_flags&DOCEF_TAG) { - doc->cur_col=x-doc_ce->x; - if (IsEditableText(doc_ce)) { - if (doc->cur_col>doc_ce->max_col) - doc->cur_col=doc_ce->max_col; - } else if (doc->cur_col>=doc_ce->max_col) - doc->cur_col=doc_ce->max_col-1; - if (doc->cur_colmin_col) - doc->cur_col=doc_ce->min_col; - } else { - if (doc_ce->type_u8==DOCT_HEX_ED) { - doc->cur_col=RoundI64((doc_ce->len-1)*3,doc_ce->hex_ed_width*3); - if (doc->cur_col<0) - doc->cur_col=0; - } else - doc->cur_col=doc_ce->min_col; - } - if (IsEditableText(doc_ce) && doc_ce->xcur_colmax_col-1) { - dst=doc_ce->tag+doc->cur_col; - doc_ne=DocEntryNewTag(doc,doc_ce,dst); - *dst=0; - if (sc>=0) { - if (sc&SCF_SHIFT) - doc_ne->type=doc_ce->type | DOCET_SEL; - else - doc_ne->type=doc_ce->type & ~DOCET_SEL; - } - doc_ne->x=doc_ce->x+doc->cur_col; - doc_ce->max_col=doc->cur_col; - QueIns(doc_ne,doc_ce); - doc_ce=doc_ne; - doc->cur_col=doc_ce->min_col; - } - } - doc->cur_entry=doc_ce; - DocFormFwd(doc); - doc->x=doc->cur_entry->x+doc->cur_col; - if (unlock) - DocUnlock(doc); -} - -public U0 EdLineDown(CDoc *doc,I64 sc=MIN_I64) -{//Move cursor down. Might need a call to $LK,"DocRecalc",A="MN:DocRecalc"$(). -//See $LK,"EdRenumAsm",A="MN:EdRenumAsm"$ for an example. - Bool unlock=DocLock(doc); - U8 *dst; - I64 y,x,old_de_flags=0,old_color; - CDocEntry *doc_ce=doc->cur_entry,*doc_ne,*doc_ce2; - if (sc!=MIN_I64) sc=sc.u32[0]; - if (doc_ce->type_u8==DOCT_HEX_ED) { - doc->cur_col=doc->cur_col+doc_ce->hex_ed_width*3; - if (doc->cur_col>=doc_ce->len*3) { - doc->cur_entry=doc_ce=doc_ce->next; - doc->cur_col=doc_ce->min_col; - doc->x=doc_ce->x+doc->cur_col; - doc->y=doc_ce->y; - } - if (unlock) - DocUnlock(doc); - return; - } - x=doc->x; y=doc->y; - if (IsEditableText(doc_ce)) { - if (doc->cur_col>doc_ce->min_col && doc->cur_colmax_col-1) { - dst=doc_ce->tag+doc->cur_col; - doc_ne=DocEntryNewTag(doc,doc_ce,dst); - *dst=0; - if (sc>=0) { - if (sc&SCF_SHIFT) - doc_ne->type=doc_ce->type | DOCET_SEL; - else - doc_ne->type=doc_ce->type & ~DOCET_SEL; - } - doc_ne->x=doc_ce->x+doc->cur_col; - doc_ce->max_col=doc->cur_col; - QueIns(doc_ne,doc_ce); - doc_ce=doc_ne; - doc->cur_col=doc_ce->min_col; - } - } - doc_ce2=doc_ce; - while (doc_ce!=doc && (doc_ce->y<=y || - doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP))) - doc_ce=doc_ce->next; - y=doc_ce->y; - doc->y=y; - while (doc_ce!=doc && (doc_ce->y<=y && doc_ce->x<=x || - doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP))) { - old_de_flags=doc_ce->de_flags; - old_color=doc_ce->type; - doc_ce=doc_ce->next; - } - if (doc_ce->last!=doc && (doc_ce->x>x && doc_ce->last->y>=y || doc_ce->y>y)) { - doc_ce=doc_ce->last; - doc->cur_entry=doc_ce; - if (!((doc_ce->type_u8==DOCT_NEW_LINE || - doc_ce->type_u8==DOCT_SOFT_NEW_LINE || - doc_ce->type_u8==DOCT_INDENT) && - (doc_ce->last->type_u8==DOCT_NEW_LINE || - doc_ce->last->type_u8==DOCT_SOFT_NEW_LINE || - doc_ce->last->type_u8==DOCT_INDENT))) - DocFormBwd(doc); - doc_ce=doc->cur_entry; - } - while (doc_ce2!=doc && (doc_ce2!=doc_ce || IsEditableText(doc_ce))) { - if ((doc_ce2->yxde_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP) || - doc_ce2->x==x && !doc_ce2->max_col && - Bt(doldoc.type_flags_nontag_invisible,doc_ce2->type_u8)) && sc>=0) - BEqu(&doc_ce2->type,DOCEt_SEL,sc&SCF_SHIFT); - if (doc_ce2==doc_ce) break; - doc_ce2=doc_ce2->next; - } - if (doc_ce->de_flags&DOCEF_TAG) { - doc->cur_col=x-doc_ce->x; - if (IsEditableText(doc_ce)) { - if (doc->cur_col>doc_ce->max_col) - doc->cur_col=doc_ce->max_col; - } else if (doc->cur_col>=doc_ce->max_col) - doc->cur_col=doc_ce->max_col-1; - if (doc->cur_colmin_col) - doc->cur_col=doc_ce->min_col; - } else - doc->cur_col=doc_ce->min_col; - if (IsEditableText(doc_ce)&&doc_ce->min_colcur_colmax_col-1) { - dst=doc_ce->tag+doc->cur_col; - doc_ne=DocEntryNewTag(doc,doc_ce,dst); - *dst=0; - doc_ne->type=DOCT_TEXT | old_color & -0x100; - doc_ne->de_flags=old_de_flags|doldoc.dft_de_flags[DOCT_TEXT]; - doc_ce->max_col=doc->cur_col; - doc_ne->x=doc_ce->x+doc->cur_col; - QueIns(doc_ne,doc_ce); - doc_ce=doc_ne; - doc->cur_col=doc_ce->min_col; - } - doc->cur_entry=doc_ce; - DocFormFwd(doc); - if (!(doc->flags & DOCF_FORM)) - while (doc_ce!=doc && doc_ce!=doc->cur_entry) { - if (sc>=0) - BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); - doc_ce=doc_ce->next; - } - doc->x=doc->cur_entry->x+doc->cur_col; - if (unlock) - DocUnlock(doc); -} - -U0 EdCharDel(CDoc *doc) -{ - Bool unlock=DocLock(doc); - CDocEntry *doc_ce=doc->cur_entry; - - if (doc_ce==doc) { - if (unlock) - DocUnlock(doc); - return; - } - if (doc_ce->max_col!=0 && - (IsEditableText(doc_ce)||doc_ce->type_u8==DOCT_DATA)) { - if (doc_ce->type_u8==DOCT_DATA && doc_ce->de_flags & DOCEF_HAS_TERMINATOR && - doc->cur_col==doc_ce->max_col-1) { - if (unlock) - DocUnlock(doc); - return; - } - if (doc->cur_colmax_col) - StrCpy(doc_ce->tag+doc->cur_col,doc_ce->tag+doc->cur_col+1); - if (doc->cur_col>=doc_ce->max_col-1) { - doc->cur_entry=doc_ce->next; - doc->cur_col=doc->cur_entry->min_col; - } - DocRemSoftNewLines(doc,doc->cur_entry); - if (unlock) - DocUnlock(doc); - return; - } - doc->cur_entry=doc_ce->next; - doc->cur_col=doc->cur_entry->min_col; - if (!(doc_ce->de_flags&DOCEF_FILTER_SKIP)) - DocEntryDel(doc,doc_ce); - DocRemSoftNewLines(doc,doc->cur_entry); - if (unlock) - DocUnlock(doc); -} - -U0 ChkDollarBufSize(CDoc *doc) -{ - U8 *b; - if (doc->dollar_buf_ptr>=doc->dollar_buf_size-2) { - doc->dollar_buf_size<<=1; - b=MAlloc(doc->dollar_buf_size,doc->mem_task); - MemCpy(b,doc->dollar_buf,doc->dollar_buf_ptr); - Free(doc->dollar_buf); - doc->dollar_buf=b; - } -} - -U0 EdCharIns(I64 ch,I64 sc,CDoc *doc) -{ - Bool unlock=DocLock(doc); - U8 *st,*src,*dst; - CDocEntry *doc_ce=doc->cur_entry,*doc_ne; - I64 i,j,m,y=doc_ce->y; - - if (doc->flags & DOCF_IN_DOLLAR) { - if (!Bt(chars_bmp_getkey,ch)) - goto ic_done; - ChkDollarBufSize(doc); - doc->dollar_buf[doc->dollar_buf_ptr++]=ch; - if (ch=='$$') { - if (doc->dollar_buf_ptr==2) { - doc->flags&=~DOCF_IN_DOLLAR; - doc->dollar_buf_ptr=0; - goto ic_cont; - } else { - doc->dollar_buf[doc->dollar_buf_ptr]=0; - doc->flags&=~DOCF_IN_DOLLAR; - DocPrint(doc,doc->dollar_buf); - doc->dollar_buf_ptr=0; - goto ic_done; - } - } else - goto ic_done; - } - if (ch=='$$' && !(doc->flags & (DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS))) { - doc->flags|=DOCF_IN_DOLLAR; - doc->dollar_buf_ptr=0; - doc->dollar_buf[doc->dollar_buf_ptr++]=ch; - goto ic_done; - } - if (ch=='\r') goto ic_done; - - ic_cont: - if ((ch==CH_SPACE || ch=='\n') && - !(sc & (SCF_CTRL|SCF_SHIFT)) && - doc_ce->de_flags & - (DOCEF_LINK|DOCEF_TREE|DOCEF_LST|DOCEF_CHECK_COLLAPSABLE| - DOCEF_LEFT_MACRO|DOCEF_LEFT_EXP|DOCEF_LEFT_CB|DOCEF_LEFT_AUTO | - DOCEF_RIGHT_MACRO|DOCEF_RIGHT_EXP|DOCEF_RIGHT_CB|DOCEF_RIGHT_AUTO)) { - doc->cmd_U8=ch; - DocEntryRun(doc,doc_ce,FALSE); - DocLock(doc); - goto ic_done; - } - if (doc_ce->type_u8==DOCT_HEX_ED) { - if (doc_ce->de_flags&DOCEF_DEREF_DATA && - !(doc_ce->de_flags&DOCEF_REMALLOC_DATA)) - st=doc_ce->data; - else - st=&doc_ce->data; - i=doc->cur_col; - j=i%(doc_ce->hex_ed_width*3); - m=i/(doc_ce->hex_ed_width*3)*doc_ce->hex_ed_width; - if (j>=doc_ce->hex_ed_width<<1) - st[j-doc_ce->hex_ed_width<<1+m]=ch; - else { - ch=ToUpper(ch)-'0'; - if (ch>9) { - ch+='0'-'A'+10; - if (!(10<=ch<=15)) - goto ic_done; - } - m=j>>1+m; - if (j & 1) - st[m]=st[m] & 0xF0| ch; - else - st[m]=st[m] & 0xF | ch<<4; - } - doc->cur_col++; - goto ic_done; - } - if (doc->flags & DOCF_OVERSTRIKE) { - if (Bt(chars_bmp_displayable,ch)) { -ic_overstrike: - if (IsEditableText(doc_ce)) { - if (doc->cur_colmax_col) { - if (doc_ce->tag[doc->cur_col]) { - doc_ce->tag[doc->cur_col++]=ch; - goto ic_done; - } - } else { - doc_ce=doc_ce->next; - doc->cur_entry=doc_ce; - doc->cur_col=doc_ce->min_col; - goto ic_overstrike; - } - } else if (doc_ce->type_u8==DOCT_DATA) { - if (doc_ce->de_flags & DOCEF_HAS_TERMINATOR) { - if (doc_ce->tag[doc->cur_col] && - doc->cur_colmin_col+doc_ce->len) { - doc_ce->tag[doc->cur_col++]=ch; - if ( ! doc_ce->tag[doc->cur_col]) { - doc_ce->tag[doc->cur_col]='_'; - doc_ce->tag[doc->cur_col+1]=0; - } - } else if (doc_ce->de_flags & DOCEF_REMALLOC_DATA) - goto ic_not_overstrike; - } else if (doc_ce->tag[doc->cur_col]) - doc_ce->tag[doc->cur_col++]=ch; - goto ic_done; - } - doc_ne=DocEntryNewTag(doc,doc_ce,&ch); - doc_ne->type=DOCT_TEXT | doc->settings_head.dft_text_attr<<8; - doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TEXT]; - QueIns(doc_ne,doc_ce->last); - } else if (ch=='\n') { - while (doc->cur_entry->next!=doc && doc->cur_entry->y==y) - doc->cur_entry=doc->cur_entry->next; - doc->cur_col=doc->cur_entry->min_col; - } else if (ch=='\t') { - if (doc->flags&DOCF_FORM) - goto ic_form_tab; - } - goto ic_done; - } -ic_not_overstrike: - if (ch=='\n') { - if (sc&SCF_CTRL && !(sc&SCF_SHIFT)) { - doc_ne=DocEntryNewBase(doc, - DOCT_PAGE_BREAK|doc->settings_head.dft_text_attr<<8); - } else { - doc_ne=DocEntryNewBase(doc, - DOCT_NEW_LINE|doc->settings_head.dft_text_attr<<8); - } - DocInsEntry(doc,doc_ne); - } else if (ch=='\t') { - if (doc->flags&DOCF_FORM && - (Bt(doldoc.type_flags_form,doc->cur_entry->type_u8) || - doc->cur_entry->de_flags&DOCEF_LINK) && - !(doc->cur_entry->de_flags&DOCEF_SKIP_IN_FORM)) { -ic_form_tab: - doc->cur_entry=doc->cur_entry->next; - doc->cur_col=doc->cur_entry->min_col; - DocFormFwd(doc); - goto ic_done; - } else { - doc_ne=DocEntryNewBase(doc,DOCT_TAB|doc->settings_head.dft_text_attr<<8); - DocInsEntry(doc,doc_ne); - } - } else { - if (Bt(chars_bmp_displayable,ch)) { - if (doc_ce->type_u8==DOCT_DATA) { - while (TRUE) { - i=doc_ce->len+doc_ce->min_col; - if (doc_ce->de_flags & DOCEF_HAS_TERMINATOR) - i++; - if (doc_ce->max_coltag; - doc_ce->max_col++; - for (i=doc_ce->max_col;i>doc->cur_col;i--) - st[i]=st[i-1]; - st[doc->cur_col++]=ch; - break; - } else if (doc_ce->de_flags & DOCEF_REMALLOC_DATA) { - st=MAlloc(doc_ce->max_col+8,doc->mem_task); - MemCpy(st,doc_ce->tag,doc_ce->max_col+1); - Free(doc_ce->tag); - doc_ce->tag=st; - doc_ce->len=MSize(st)-doc_ce->min_col-2; //See $LK,"DataTagWidth",A="FA:::/Adam/DolDoc/DocPlain.CPP,DataTagWidth"$ - Free(doc_ce->data); - doc_ce->data=MAlloc(doc_ce->len+2,doc->mem_task); - } else - break; - } - } else if (IsEditableText(doc_ce)) { - dst=st=MAlloc(doc_ce->max_col+2,doc->mem_task); - src=doc_ce->tag; - i=doc->cur_col; - while (i-->0) - *dst++=*src++; - *dst++=ch; - while (*dst++=*src++); - Free(doc_ce->tag); - doc_ce->tag=st; - doc_ce->max_col++; - doc->cur_col++; - } else { - doc_ne=DocEntryNewTag(doc,doc_ce,&ch); - doc_ne->type=DOCT_TEXT | doc->settings_head.dft_text_attr<<8; - doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TEXT]; - doc_ne->x=doc_ce->x+1; - QueIns(doc_ne,doc_ce->last); - } - } - } -ic_done: - DocRemSoftNewLines(doc,doc->cur_entry); - if (doc->cur_entry->de_flags & DOCEF_UPDATE_DATA && - (doc->cur_entry->type_u8==DOCT_DATA || - doc->cur_entry->type_u8==DOCT_CHECK_BOX)) - DocDataScan(doc,doc->cur_entry); - if (unlock) - DocUnlock(doc); -} - -U0 EdLineDel(CDoc *doc) -{ - CDocEntry *doc_ce=doc->cur_entry,*doc_ce2; - I64 y; - y=doc->y; - while (doc_ce!=doc && doc_ce->y==y) - doc_ce=doc_ce->next; - doc->cur_entry=doc_ce; - doc->cur_col=doc_ce->min_col; - doc_ce=doc_ce->last; - while (doc_ce!=doc && doc_ce->y==y) { - doc_ce2=doc_ce->last; - if (!(doc_ce->de_flags&DOCEF_FILTER_SKIP)) - DocEntryDel(doc,doc_ce); - doc_ce=doc_ce2; - } -} diff --git a/Adam/DolDoc/DocChar.HC b/Adam/DolDoc/DocChar.HC new file mode 100644 index 0000000..1bf4a6f --- /dev/null +++ b/Adam/DolDoc/DocChar.HC @@ -0,0 +1,652 @@ +#help_index "DolDoc/Editor" + +public I64 EdCurU8(CDoc *doc) +{//Return cur U8. See $LK,"EdRenumAsm",A="MN:EdRenumAsm"$ for an example. + Bool unlock=DocLock(doc); + CDocEntry *doc_ce=doc->cur_entry; + I64 res=-1; + if (doc_ce->type_u8==DOCT_TEXT && + doc_ce->min_col<=doc->cur_colmax_col) + res=doc_ce->tag[doc->cur_col]; + else if (doc_ce->type_u8==DOCT_TAB) + res='\t'; + else if (doc_ce->type_u8==DOCT_NEW_LINE || + doc_ce->type_u8==DOCT_SOFT_NEW_LINE) + res='\n'; + if (unlock) + DocUnlock(doc); + return res; +} + +public U0 EdCursorLeft(CDoc *doc,I64 sc=MIN_I64) +{//Move cursor left. Might need a call to $LK,"DocRecalc",A="MN:DocRecalc"$(). +//See $LK,"EdRenumAsm",A="MN:EdRenumAsm"$ for an example. + U8 *dst; + Bool unlock=DocLock(doc); + CDocEntry *doc_ce=doc->cur_entry,*original_ce=doc_ce,*doc_ne; + I64 cc=doc->cur_col,y=doc_ce->y; + if (sc!=MIN_I64) sc=sc.u32[0]; + if (sc>=0 && sc&SCF_CTRL) { + while (doc_ce->last!=doc && (doc_ce->last->y==y || + doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP))) + doc_ce=doc_ce->last; //TODO: sel? recurse? + cc=doc_ce->min_col; + } else { + if (cc>doc_ce->min_col) { + if (IsEditableText(doc_ce) && ccmax_col) { + dst=doc_ce->tag+cc; + doc_ne=DocEntryNewTag(doc,doc_ce,dst); + *dst=0; + doc_ce->max_col=cc; + QueIns(doc_ne,doc_ce); + } + cc--; + if (IsEditableText(doc_ce) && cc>doc_ce->min_col) { + dst=doc_ce->tag+cc; + doc_ne=DocEntryNewTag(doc,doc_ce,dst); + *dst=0; + doc_ce->max_col=cc; + QueIns(doc_ne,doc_ce); + doc_ce=doc_ne; + cc=doc_ce->min_col; + } + if (sc>=0) + BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); + } else { + cc=doc_ce->min_col; + while (doc_ce->last!=doc && + (doc_ce->last->type_u8==DOCT_SOFT_NEW_LINE || + doc_ce->last->type_u8==DOCT_INDENT || + doc_ce->last->de_flags&(DOCEF_SKIP|DOCEF_FILTER_SKIP))) { + doc_ce=doc_ce->last; + if (sc>=0) + BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); + } + if (doc_ce->last!=doc) { + doc_ce=doc_ce->last; + if (doc_ce->max_col>doc_ce->min_col) { + cc=doc_ce->max_col-1; + if (IsEditableText(doc_ce) && cc>doc_ce->min_col) { + dst=doc_ce->tag+cc; + doc_ne=DocEntryNewTag(doc,doc_ce,dst); + *dst=0; + doc_ce->max_col=cc; + QueIns(doc_ne,doc_ce); + doc_ce=doc_ne; + cc=doc_ce->min_col; + } + } else + cc=doc_ce->max_col; + if (sc>=0) + BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); + } + } + } + doc->cur_col=cc; + doc->cur_entry=doc_ce; + if (doc_ce!=original_ce) + DocFormBwd(doc); + if (unlock) + DocUnlock(doc); +} + +public U0 EdCursorRight(CDoc *doc,I64 sc=MIN_I64) +{//Move cursor right. Might need a call to $LK,"DocRecalc",A="MN:DocRecalc"$(). +//See $LK,"EdRenumAsm",A="MN:EdRenumAsm"$ for an example. + Bool unlock=DocLock(doc); + U8 *dst; + CDocEntry *doc_ce=doc->cur_entry,*original_ce=doc_ce,*doc_ne; + I64 cc=doc->cur_col,y=doc_ce->y,old_de_flags,old_color; + if (sc!=MIN_I64) sc=sc.u32[0]; + if (sc>=0 && sc&SCF_CTRL) { + while (doc_ce!=doc && doc_ce->next->y==y && + doc_ce->next->type_u8!=DOCT_SOFT_NEW_LINE && doc_ce->next!=doc && + (doc_ce->next->type_u8!=DOCT_NEW_LINE || !(doc->flags & DOCF_FORM)) || + doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP)) + doc_ce=doc_ce->next; + if (doc_ce->max_col>doc_ce->min_col) + cc=doc_ce->max_col-1; + else + cc=doc_ce->min_col; + } else { + if (ccmax_col) { + if (IsEditableText(doc_ce) && cc>doc_ce->min_col) { + dst=doc_ce->tag+cc; + doc_ne=DocEntryNewTag(doc,doc_ce,dst); + *dst=0; + doc_ce->max_col=cc; + QueIns(doc_ne,doc_ce); + doc_ce=doc_ne; + cc=doc_ce->min_col; + } + cc++; + old_de_flags=doc_ce->de_flags; + old_color=doc_ce->type; + if (sc>=0) + BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); + if (IsEditableText(doc_ce) && ccmax_col) { + dst=doc_ce->tag+cc; + doc_ne=DocEntryNewTag(doc,doc_ce,dst); + *dst=0; + doc_ne->type=DOCT_TEXT | old_color & -0x100; + doc_ne->de_flags=old_de_flags|doldoc.dft_de_flags[DOCT_TEXT]; + doc_ce->max_col=cc; + QueIns(doc_ne,doc_ce); + doc_ce=doc_ne; + cc=doc_ce->min_col; + } else if (cc>=doc_ce->max_col) { + doc_ce=doc_ce->next; + cc=doc_ce->min_col; + } + } else { + if (doc_ce!=doc) { + if (cc<=doc_ce->min_col && sc>=0) + BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); + doc_ce=doc_ce->next; + while (doc_ce!=doc && doc_ce->de_flags&(DOCEF_SKIP|DOCEF_FILTER_SKIP)) { + if (sc>=0) + BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); + doc_ce=doc_ce->next; + } + cc=doc_ce->min_col; + if (doc_ce->type_u8==DOCT_SOFT_NEW_LINE) { + if (sc>=0) + BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); + doc_ce=doc_ce->next; + cc=doc_ce->min_col; + } + } + } + } + doc->cur_col=cc; + doc->cur_entry=doc_ce; + if (doc_ce!=original_ce) + DocFormFwd(doc); + if (unlock) + DocUnlock(doc); +} + +public U0 EdLineUp(CDoc *doc,I64 sc=MIN_I64) +{//Move cursor up. Might need a call to $LK,"DocRecalc",A="MN:DocRecalc"$(). +//See $LK,"EdRenumAsm",A="MN:EdRenumAsm"$ for an example. + Bool unlock=DocLock(doc); + U8 *dst; + I64 y,x; + CDocEntry *doc_ce=doc->cur_entry,*doc_ne; + + if (sc!=MIN_I64) sc=sc.u32[0]; + if (doc_ce->type_u8==DOCT_HEX_ED) { + doc->cur_col=doc->cur_col-doc_ce->hex_ed_width*3; + if (doc->cur_col>=0) { + if (unlock) + DocUnlock(doc); + return; + } else + doc->cur_col=0; + } + x=doc->x; y=doc->y; + if (IsEditableText(doc_ce)) { + if (doc_ce->min_colcur_colmax_col-1) { + dst=doc_ce->tag+doc->cur_col; + doc_ne=DocEntryNewTag(doc,doc_ce,dst); + *dst=0; + doc_ne->x=doc_ce->x+doc->cur_col; + doc_ce->max_col=doc->cur_col; + QueIns(doc_ne,doc_ce); + } else if (doc->cur_col==doc_ce->min_col && doc_ce->last!=doc) + doc_ce=doc_ce->last; + } else if (doc_ce->last!=doc) + doc_ce=doc_ce->last; + if (sc>=0) + BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); + doc->cur_entry=doc_ce; + DocFormBwd(doc); + doc_ce=doc->cur_entry; + while (doc_ce->last!=doc && (doc_ce->y>=y || + doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP))) { + doc_ce=doc_ce->last; + if (sc>=0) + BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); + } + y=doc_ce->y; + doc->y=y; + while (doc_ce!=doc && (doc_ce->y>=y && doc_ce->x>=x || + doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP))) { + if (sc>=0) + BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); + doc_ce=doc_ce->last; + } + + if (doc_ce==doc || doc_ce->ynext; + else { + if (!IsEditableText(doc_ce)) { + if (sc>=0) + BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); + } else { + if (doc_ce->next->x==x) { + doc_ce=doc_ce->next; + if (doc->flags & DOCF_FORM) + while (doc_ce->next->x==x && + (!Bt(doldoc.type_flags_form,doc_ce->type_u8) && + !(doc_ce->de_flags&DOCEF_LINK)|| + doc_ce->de_flags&DOCEF_SKIP_IN_FORM)) + doc_ce=doc_ce->next; + } + } + } + if (doc_ce->de_flags&DOCEF_TAG) { + doc->cur_col=x-doc_ce->x; + if (IsEditableText(doc_ce)) { + if (doc->cur_col>doc_ce->max_col) + doc->cur_col=doc_ce->max_col; + } else if (doc->cur_col>=doc_ce->max_col) + doc->cur_col=doc_ce->max_col-1; + if (doc->cur_colmin_col) + doc->cur_col=doc_ce->min_col; + } else { + if (doc_ce->type_u8==DOCT_HEX_ED) { + doc->cur_col=RoundI64((doc_ce->len-1)*3,doc_ce->hex_ed_width*3); + if (doc->cur_col<0) + doc->cur_col=0; + } else + doc->cur_col=doc_ce->min_col; + } + if (IsEditableText(doc_ce) && doc_ce->xcur_colmax_col-1) { + dst=doc_ce->tag+doc->cur_col; + doc_ne=DocEntryNewTag(doc,doc_ce,dst); + *dst=0; + if (sc>=0) { + if (sc&SCF_SHIFT) + doc_ne->type=doc_ce->type | DOCET_SEL; + else + doc_ne->type=doc_ce->type & ~DOCET_SEL; + } + doc_ne->x=doc_ce->x+doc->cur_col; + doc_ce->max_col=doc->cur_col; + QueIns(doc_ne,doc_ce); + doc_ce=doc_ne; + doc->cur_col=doc_ce->min_col; + } + } + doc->cur_entry=doc_ce; + DocFormFwd(doc); + doc->x=doc->cur_entry->x+doc->cur_col; + if (unlock) + DocUnlock(doc); +} + +public U0 EdLineDown(CDoc *doc,I64 sc=MIN_I64) +{//Move cursor down. Might need a call to $LK,"DocRecalc",A="MN:DocRecalc"$(). +//See $LK,"EdRenumAsm",A="MN:EdRenumAsm"$ for an example. + Bool unlock=DocLock(doc); + U8 *dst; + I64 y,x,old_de_flags=0,old_color; + CDocEntry *doc_ce=doc->cur_entry,*doc_ne,*doc_ce2; + if (sc!=MIN_I64) sc=sc.u32[0]; + if (doc_ce->type_u8==DOCT_HEX_ED) { + doc->cur_col=doc->cur_col+doc_ce->hex_ed_width*3; + if (doc->cur_col>=doc_ce->len*3) { + doc->cur_entry=doc_ce=doc_ce->next; + doc->cur_col=doc_ce->min_col; + doc->x=doc_ce->x+doc->cur_col; + doc->y=doc_ce->y; + } + if (unlock) + DocUnlock(doc); + return; + } + x=doc->x; y=doc->y; + if (IsEditableText(doc_ce)) { + if (doc->cur_col>doc_ce->min_col && doc->cur_colmax_col-1) { + dst=doc_ce->tag+doc->cur_col; + doc_ne=DocEntryNewTag(doc,doc_ce,dst); + *dst=0; + if (sc>=0) { + if (sc&SCF_SHIFT) + doc_ne->type=doc_ce->type | DOCET_SEL; + else + doc_ne->type=doc_ce->type & ~DOCET_SEL; + } + doc_ne->x=doc_ce->x+doc->cur_col; + doc_ce->max_col=doc->cur_col; + QueIns(doc_ne,doc_ce); + doc_ce=doc_ne; + doc->cur_col=doc_ce->min_col; + } + } + doc_ce2=doc_ce; + while (doc_ce!=doc && (doc_ce->y<=y || + doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP))) + doc_ce=doc_ce->next; + y=doc_ce->y; + doc->y=y; + while (doc_ce!=doc && (doc_ce->y<=y && doc_ce->x<=x || + doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP))) { + old_de_flags=doc_ce->de_flags; + old_color=doc_ce->type; + doc_ce=doc_ce->next; + } + if (doc_ce->last!=doc && (doc_ce->x>x && doc_ce->last->y>=y || doc_ce->y>y)) { + doc_ce=doc_ce->last; + doc->cur_entry=doc_ce; + if (!((doc_ce->type_u8==DOCT_NEW_LINE || + doc_ce->type_u8==DOCT_SOFT_NEW_LINE || + doc_ce->type_u8==DOCT_INDENT) && + (doc_ce->last->type_u8==DOCT_NEW_LINE || + doc_ce->last->type_u8==DOCT_SOFT_NEW_LINE || + doc_ce->last->type_u8==DOCT_INDENT))) + DocFormBwd(doc); + doc_ce=doc->cur_entry; + } + while (doc_ce2!=doc && (doc_ce2!=doc_ce || IsEditableText(doc_ce))) { + if ((doc_ce2->yxde_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP) || + doc_ce2->x==x && !doc_ce2->max_col && + Bt(doldoc.type_flags_nontag_invisible,doc_ce2->type_u8)) && sc>=0) + BEqu(&doc_ce2->type,DOCEt_SEL,sc&SCF_SHIFT); + if (doc_ce2==doc_ce) break; + doc_ce2=doc_ce2->next; + } + if (doc_ce->de_flags&DOCEF_TAG) { + doc->cur_col=x-doc_ce->x; + if (IsEditableText(doc_ce)) { + if (doc->cur_col>doc_ce->max_col) + doc->cur_col=doc_ce->max_col; + } else if (doc->cur_col>=doc_ce->max_col) + doc->cur_col=doc_ce->max_col-1; + if (doc->cur_colmin_col) + doc->cur_col=doc_ce->min_col; + } else + doc->cur_col=doc_ce->min_col; + if (IsEditableText(doc_ce)&&doc_ce->min_colcur_colmax_col-1) { + dst=doc_ce->tag+doc->cur_col; + doc_ne=DocEntryNewTag(doc,doc_ce,dst); + *dst=0; + doc_ne->type=DOCT_TEXT | old_color & -0x100; + doc_ne->de_flags=old_de_flags|doldoc.dft_de_flags[DOCT_TEXT]; + doc_ce->max_col=doc->cur_col; + doc_ne->x=doc_ce->x+doc->cur_col; + QueIns(doc_ne,doc_ce); + doc_ce=doc_ne; + doc->cur_col=doc_ce->min_col; + } + doc->cur_entry=doc_ce; + DocFormFwd(doc); + if (!(doc->flags & DOCF_FORM)) + while (doc_ce!=doc && doc_ce!=doc->cur_entry) { + if (sc>=0) + BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); + doc_ce=doc_ce->next; + } + doc->x=doc->cur_entry->x+doc->cur_col; + if (unlock) + DocUnlock(doc); +} + +U0 EdCharDel(CDoc *doc) +{ + Bool unlock=DocLock(doc); + CDocEntry *doc_ce=doc->cur_entry; + + if (doc_ce==doc) { + if (unlock) + DocUnlock(doc); + return; + } + if (doc_ce->max_col!=0 && + (IsEditableText(doc_ce)||doc_ce->type_u8==DOCT_DATA)) { + if (doc_ce->type_u8==DOCT_DATA && doc_ce->de_flags & DOCEF_HAS_TERMINATOR && + doc->cur_col==doc_ce->max_col-1) { + if (unlock) + DocUnlock(doc); + return; + } + if (doc->cur_colmax_col) + StrCpy(doc_ce->tag+doc->cur_col,doc_ce->tag+doc->cur_col+1); + if (doc->cur_col>=doc_ce->max_col-1) { + doc->cur_entry=doc_ce->next; + doc->cur_col=doc->cur_entry->min_col; + } + DocRemSoftNewLines(doc,doc->cur_entry); + if (unlock) + DocUnlock(doc); + return; + } + doc->cur_entry=doc_ce->next; + doc->cur_col=doc->cur_entry->min_col; + if (!(doc_ce->de_flags&DOCEF_FILTER_SKIP)) + DocEntryDel(doc,doc_ce); + DocRemSoftNewLines(doc,doc->cur_entry); + if (unlock) + DocUnlock(doc); +} + +U0 ChkDollarBufSize(CDoc *doc) +{ + U8 *b; + if (doc->dollar_buf_ptr>=doc->dollar_buf_size-2) { + doc->dollar_buf_size<<=1; + b=MAlloc(doc->dollar_buf_size,doc->mem_task); + MemCpy(b,doc->dollar_buf,doc->dollar_buf_ptr); + Free(doc->dollar_buf); + doc->dollar_buf=b; + } +} + +U0 EdCharIns(I64 ch,I64 sc,CDoc *doc) +{ + Bool unlock=DocLock(doc); + U8 *st,*src,*dst; + CDocEntry *doc_ce=doc->cur_entry,*doc_ne; + I64 i,j,m,y=doc_ce->y; + + if (doc->flags & DOCF_IN_DOLLAR) { + if (!Bt(chars_bmp_getkey,ch)) + goto ic_done; + ChkDollarBufSize(doc); + doc->dollar_buf[doc->dollar_buf_ptr++]=ch; + if (ch=='$$') { + if (doc->dollar_buf_ptr==2) { + doc->flags&=~DOCF_IN_DOLLAR; + doc->dollar_buf_ptr=0; + goto ic_cont; + } else { + doc->dollar_buf[doc->dollar_buf_ptr]=0; + doc->flags&=~DOCF_IN_DOLLAR; + DocPrint(doc,doc->dollar_buf); + doc->dollar_buf_ptr=0; + goto ic_done; + } + } else + goto ic_done; + } + if (ch=='$$' && !(doc->flags & (DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS))) { + doc->flags|=DOCF_IN_DOLLAR; + doc->dollar_buf_ptr=0; + doc->dollar_buf[doc->dollar_buf_ptr++]=ch; + goto ic_done; + } + if (ch=='\r') goto ic_done; + + ic_cont: + if ((ch==CH_SPACE || ch=='\n') && + !(sc & (SCF_CTRL|SCF_SHIFT)) && + doc_ce->de_flags & + (DOCEF_LINK|DOCEF_TREE|DOCEF_LST|DOCEF_CHECK_COLLAPSABLE| + DOCEF_LEFT_MACRO|DOCEF_LEFT_EXP|DOCEF_LEFT_CB|DOCEF_LEFT_AUTO | + DOCEF_RIGHT_MACRO|DOCEF_RIGHT_EXP|DOCEF_RIGHT_CB|DOCEF_RIGHT_AUTO)) { + doc->cmd_U8=ch; + DocEntryRun(doc,doc_ce,FALSE); + DocLock(doc); + goto ic_done; + } + if (doc_ce->type_u8==DOCT_HEX_ED) { + if (doc_ce->de_flags&DOCEF_DEREF_DATA && + !(doc_ce->de_flags&DOCEF_REMALLOC_DATA)) + st=doc_ce->data; + else + st=&doc_ce->data; + i=doc->cur_col; + j=i%(doc_ce->hex_ed_width*3); + m=i/(doc_ce->hex_ed_width*3)*doc_ce->hex_ed_width; + if (j>=doc_ce->hex_ed_width<<1) + st[j-doc_ce->hex_ed_width<<1+m]=ch; + else { + ch=ToUpper(ch)-'0'; + if (ch>9) { + ch+='0'-'A'+10; + if (!(10<=ch<=15)) + goto ic_done; + } + m=j>>1+m; + if (j & 1) + st[m]=st[m] & 0xF0| ch; + else + st[m]=st[m] & 0xF | ch<<4; + } + doc->cur_col++; + goto ic_done; + } + if (doc->flags & DOCF_OVERSTRIKE) { + if (Bt(chars_bmp_displayable,ch)) { +ic_overstrike: + if (IsEditableText(doc_ce)) { + if (doc->cur_colmax_col) { + if (doc_ce->tag[doc->cur_col]) { + doc_ce->tag[doc->cur_col++]=ch; + goto ic_done; + } + } else { + doc_ce=doc_ce->next; + doc->cur_entry=doc_ce; + doc->cur_col=doc_ce->min_col; + goto ic_overstrike; + } + } else if (doc_ce->type_u8==DOCT_DATA) { + if (doc_ce->de_flags & DOCEF_HAS_TERMINATOR) { + if (doc_ce->tag[doc->cur_col] && + doc->cur_colmin_col+doc_ce->len) { + doc_ce->tag[doc->cur_col++]=ch; + if ( ! doc_ce->tag[doc->cur_col]) { + doc_ce->tag[doc->cur_col]='_'; + doc_ce->tag[doc->cur_col+1]=0; + } + } else if (doc_ce->de_flags & DOCEF_REMALLOC_DATA) + goto ic_not_overstrike; + } else if (doc_ce->tag[doc->cur_col]) + doc_ce->tag[doc->cur_col++]=ch; + goto ic_done; + } + doc_ne=DocEntryNewTag(doc,doc_ce,&ch); + doc_ne->type=DOCT_TEXT | doc->settings_head.dft_text_attr<<8; + doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TEXT]; + QueIns(doc_ne,doc_ce->last); + } else if (ch=='\n') { + while (doc->cur_entry->next!=doc && doc->cur_entry->y==y) + doc->cur_entry=doc->cur_entry->next; + doc->cur_col=doc->cur_entry->min_col; + } else if (ch=='\t') { + if (doc->flags&DOCF_FORM) + goto ic_form_tab; + } + goto ic_done; + } +ic_not_overstrike: + if (ch=='\n') { + if (sc&SCF_CTRL && !(sc&SCF_SHIFT)) { + doc_ne=DocEntryNewBase(doc, + DOCT_PAGE_BREAK|doc->settings_head.dft_text_attr<<8); + } else { + doc_ne=DocEntryNewBase(doc, + DOCT_NEW_LINE|doc->settings_head.dft_text_attr<<8); + } + DocInsEntry(doc,doc_ne); + } else if (ch=='\t') { + if (doc->flags&DOCF_FORM && + (Bt(doldoc.type_flags_form,doc->cur_entry->type_u8) || + doc->cur_entry->de_flags&DOCEF_LINK) && + !(doc->cur_entry->de_flags&DOCEF_SKIP_IN_FORM)) { +ic_form_tab: + doc->cur_entry=doc->cur_entry->next; + doc->cur_col=doc->cur_entry->min_col; + DocFormFwd(doc); + goto ic_done; + } else { + doc_ne=DocEntryNewBase(doc,DOCT_TAB|doc->settings_head.dft_text_attr<<8); + DocInsEntry(doc,doc_ne); + } + } else { + if (Bt(chars_bmp_displayable,ch)) { + if (doc_ce->type_u8==DOCT_DATA) { + while (TRUE) { + i=doc_ce->len+doc_ce->min_col; + if (doc_ce->de_flags & DOCEF_HAS_TERMINATOR) + i++; + if (doc_ce->max_coltag; + doc_ce->max_col++; + for (i=doc_ce->max_col;i>doc->cur_col;i--) + st[i]=st[i-1]; + st[doc->cur_col++]=ch; + break; + } else if (doc_ce->de_flags & DOCEF_REMALLOC_DATA) { + st=MAlloc(doc_ce->max_col+8,doc->mem_task); + MemCpy(st,doc_ce->tag,doc_ce->max_col+1); + Free(doc_ce->tag); + doc_ce->tag=st; + doc_ce->len=MSize(st)-doc_ce->min_col-2; //See $LK,"DataTagWidth",A="FA:::/Adam/DolDoc/DocPlain.HC,DataTagWidth"$ + Free(doc_ce->data); + doc_ce->data=MAlloc(doc_ce->len+2,doc->mem_task); + } else + break; + } + } else if (IsEditableText(doc_ce)) { + dst=st=MAlloc(doc_ce->max_col+2,doc->mem_task); + src=doc_ce->tag; + i=doc->cur_col; + while (i-->0) + *dst++=*src++; + *dst++=ch; + while (*dst++=*src++); + Free(doc_ce->tag); + doc_ce->tag=st; + doc_ce->max_col++; + doc->cur_col++; + } else { + doc_ne=DocEntryNewTag(doc,doc_ce,&ch); + doc_ne->type=DOCT_TEXT | doc->settings_head.dft_text_attr<<8; + doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TEXT]; + doc_ne->x=doc_ce->x+1; + QueIns(doc_ne,doc_ce->last); + } + } + } +ic_done: + DocRemSoftNewLines(doc,doc->cur_entry); + if (doc->cur_entry->de_flags & DOCEF_UPDATE_DATA && + (doc->cur_entry->type_u8==DOCT_DATA || + doc->cur_entry->type_u8==DOCT_CHECK_BOX)) + DocDataScan(doc,doc->cur_entry); + if (unlock) + DocUnlock(doc); +} + +U0 EdLineDel(CDoc *doc) +{ + CDocEntry *doc_ce=doc->cur_entry,*doc_ce2; + I64 y; + y=doc->y; + while (doc_ce!=doc && doc_ce->y==y) + doc_ce=doc_ce->next; + doc->cur_entry=doc_ce; + doc->cur_col=doc_ce->min_col; + doc_ce=doc_ce->last; + while (doc_ce!=doc && doc_ce->y==y) { + doc_ce2=doc_ce->last; + if (!(doc_ce->de_flags&DOCEF_FILTER_SKIP)) + DocEntryDel(doc,doc_ce); + doc_ce=doc_ce2; + } +} diff --git a/Adam/DolDoc/DocClipBoard.CPP b/Adam/DolDoc/DocClipBoard.HC similarity index 100% rename from Adam/DolDoc/DocClipBoard.CPP rename to Adam/DolDoc/DocClipBoard.HC diff --git a/Adam/DolDoc/DocCodeTools.CPP b/Adam/DolDoc/DocCodeTools.CPP deleted file mode 100644 index 00f4acf..0000000 --- a/Adam/DolDoc/DocCodeTools.CPP +++ /dev/null @@ -1,658 +0,0 @@ -#help_index "DolDoc/Misc" - -U0 EdReplaceTroubleOne(CDoc *doc,U8 *st_original,U8 *st_safe,I64 num, - Bool to_safe,Bool sel) -{ - U8 buf[STR_LEN]; - StrPrint(buf,st_safe,num); - if (to_safe) - EdReplace(doc,st_original,buf,sel); - else - EdReplace(doc,buf,st_original,sel); -} - -U0 EdReplaceTroubleAll(CDoc *doc,Bool to_safe,Bool sel) -{ - I64 i=0; - EdReplaceTroubleOne(doc,"#assert" ,"//<@%d@>" ,i++,to_safe,sel); - EdReplaceTroubleOne(doc,"#define" ,"//<@%d@>" ,i++,to_safe,sel); - EdReplaceTroubleOne(doc,"#include","//<@%d@>" ,i++,to_safe,sel); -//#if will match #if,#ifdef,#ifndef,#ifaot and #ifjit - EdReplaceTroubleOne(doc,"#if" ,"//<@%d@>" ,i++,to_safe,sel); - EdReplaceTroubleOne(doc,"#endif" ,"//<@%d@>" ,i++,to_safe,sel); -//Convert #exe to union because we want that indent pattern. - EdReplaceTroubleOne(doc,"#exe" ,"union @%d@",i++,to_safe,sel); - EdReplaceTroubleOne(doc,"'{'" ,"'<@%d@>'" ,i++,to_safe,sel); - EdReplaceTroubleOne(doc,"'}'" ,"'<@%d@>'" ,i++,to_safe,sel); -} - -#define C_INDENT_SPACES 2 -#define ASM_RENUM_SPACING 5 - -#define EF_REINDENT 0 -#define EF_CMP_CHK 1 -#define EF_RENUM_ASM 2 -#define EF_CTRL_SLIDER 3 -#define EF_CH_SC 4 - -I64 PopUpEdFmt() -{ - I64 i; - CDoc *doc=DocNew; - DocPrint(doc,"$$LTBLUE$$$$MU,\"Compile Check\",LE=EF_CMP_CHK$$\n" - "$$MU,\"Reindent CPP.Z Fun (Beware braces in strings.)\"," - "LE=EF_REINDENT$$\n" - "$$MU,\"Renum Asm Local @@ Labels for Fun\",LE=EF_RENUM_ASM$$\n" - "$$MU,\"Insert Template Code: Ctrl Slider\",LE=EF_CTRL_SLIDER$$\n" - "$$MU,\"Insert ASCII/Scan Code Hex Codes for key pressed\"," - "LE=EF_CH_SC$$\n\n" - "$$MU,\"CANCEL\",LE=DOCM_CANCEL$$\n\n" - "$$GREEN$$$$FG$$ to undo if not happy\n" - "with the ress.\n"); - i=PopUpMenu(doc); - DocDel(doc); - return i; -} - -class CRILex -{ - CCmpCtrl *cc1,*cc2; - CQueVectU8 *indent; - I64 depth,exp_depth,one_shot; - Bool was_new_line,is_not_cont; -}; - -I64 EdRILex(CRILex *rx) -{ - rx->is_not_cont=FALSE; - I64 i; - CLexFile *tempf; - do { - Lex(rx->cc1); - Lex(rx->cc2); - i=PrsKeyWord(rx->cc2); - if (rx->cc1->token=='\n' && rx->cc2->token==';' || rx->cc2->token=='{' || - rx->cc2->token=='}' || rx->cc2->token==':' || rx->cc2->token==')' && - !rx->exp_depth || i==KW_ELSE || i==KW_CATCH || i==KW_DO) - rx->is_not_cont=TRUE; - if (rx->was_new_line && (rx->cc1->token!=':' || i==KW_CASE || - i==KW_DFT || i==KW_START || i==KW_END)) { - tempf=rx->cc2->lex_include_stk; - while (tempf->next) - tempf=tempf->next; - QueVectU8Put(rx->indent,tempf->cur_entry->y,rx->depth+rx->one_shot); - rx->one_shot=0; - } - if (rx->cc2->token=='\n') - rx->was_new_line=TRUE; - else - rx->was_new_line=FALSE; - } while (rx->cc1->token=='\n'); - return rx->cc1->token; -} - -U0 EdRIExp(CRILex *rx) -{ - if (rx->cc1->token=='(') { - if (!rx->exp_depth++) - rx->depth+=3; - EdRILex(rx); - while (rx->cc1->token && rx->cc1->token!=')') - EdRIExp(rx); - if (!--rx->exp_depth) { - rx->depth-=3; - if (rx->depth<0) rx->depth=0; - } - } else if (rx->cc1->token=='[') { - if (!rx->exp_depth++) - rx->depth+=3; - EdRILex(rx); - while (rx->cc1->token && rx->cc1->token!=']') - EdRIExp(rx); - if (!--rx->exp_depth) { - rx->depth-=3; - if (rx->depth<0) rx->depth=0; - } - } - EdRILex(rx); -} - -U0 EdRIStmt(CRILex *rx,Bool indent) -{ - I64 i; - Bool cont; - if (rx->cc1->token=='{') { - rx->depth++; - EdRILex(rx); - while (rx->cc1->token && rx->cc1->token!='}') - EdRIStmt(rx,FALSE); - if (--rx->depth<0) rx->depth=0; - EdRILex(rx); - } else { - if (indent) rx->depth++; - do { - cont=FALSE; - switch (PrsKeyWord(rx->cc1)) { - case KW_IF: - EdRILex(rx); - EdRIExp(rx); - EdRIStmt(rx,TRUE); - if (PrsKeyWord(rx->cc1)==KW_ELSE) { - EdRILex(rx); - if (PrsKeyWord(rx->cc1)==KW_IF && rx->cc2->token!='\n') - EdRIStmt(rx,FALSE); - else - EdRIStmt(rx,TRUE); - } - break; - case KW_TRY: - EdRILex(rx); - EdRIStmt(rx,TRUE); - if (PrsKeyWord(rx->cc1)==KW_CATCH) { - EdRILex(rx); - EdRIStmt(rx,TRUE); - } - break; - case KW_LOCK: - EdRILex(rx); - EdRIStmt(rx,TRUE); - break; - case KW_FOR: - case KW_WHILE: - EdRILex(rx); - EdRIExp(rx); - EdRIStmt(rx,TRUE); - break; - case KW_ASM: - case KW_CLASS: - case KW_UNION: - if (EdRILex(rx)==TK_IDENT) - EdRILex(rx); - EdRIStmt(rx,TRUE); - break; - case KW_DO: - EdRILex(rx); - EdRIStmt(rx,TRUE); - if (PrsKeyWord(rx->cc1)==KW_WHILE) { - EdRILex(rx); - EdRIExp(rx); - } - if (rx->cc1->token==';') - EdRILex(rx); - break; - case KW_SWITCH: - EdRILex(rx); - EdRIExp(rx); - if (rx->cc1->token=='{') { - rx->depth++; - EdRILex(rx); - i=0; - while (rx->cc1->token && rx->cc1->token!='}') { - switch (PrsKeyWord(rx->cc1)) { - case KW_START: - rx->depth+=i; i=0; - while (EdRILex(rx) && rx->cc1->token!=':'); - EdRILex(rx); - i++; - break; - case KW_END: - rx->depth+=i; i=0; - if (--rx->depth<0) rx->depth=0; - while (EdRILex(rx) && rx->cc1->token!=':'); - EdRILex(rx); - break; - case KW_CASE: - case KW_DFT: - rx->depth+=i; i=0; - while (EdRILex(rx) && rx->cc1->token!=':'); - EdRILex(rx); - break; - default: - if (rx->cc1->token) - EdRIStmt(rx,TRUE); - } - } - if (--rx->depth<0) rx->depth=0; - EdRILex(rx); - } - break; - default: - if (rx->cc1->token==TK_IDENT && rx->cc1->hash_entry && - rx->cc1->hash_entry->type&(HTT_OPCODE|HTT_ASM_KEYWORD)) { -// rx->one_shot=4-rx->depth; - do EdRILex(rx); - while (rx->cc2->token && rx->cc2->token!='\n'); - rx->is_not_cont=TRUE; - } else { - while (rx->cc1->token && rx->cc1->token!=';' && - rx->cc1->token!=':') { - if (rx->cc2->token=='\n' && !rx->is_not_cont) - rx->one_shot=3; - EdRILex(rx); - } - if (rx->cc1->token==':') - cont=TRUE; - EdRILex(rx); - } - } - } while (cont && rx->cc1->token!='}'); - if (indent && --rx->depth<0) - rx->depth=0; - } -} - -CQueVectU8 *EdRICode(CDoc *doc) -{ - CQueVectU8 *res; - CRILex *rx=CAlloc(sizeof(CRILex)); - - rx->cc1=CmpCtrlNew(,CCF_KEEP_NEW_LINES|CCF_DONT_FREE_BUF,doc->filename.name); - Free(rx->cc1->lex_include_stk->full_name); - LexAttachDoc(rx->cc1,rx->cc1->lex_include_stk,doc,, - doc->cur_entry,doc->cur_col); - - rx->cc2=CmpCtrlNew(,CCF_KEEP_NEW_LINES|CCF_DONT_FREE_BUF,doc->filename.name); - Free(rx->cc2->lex_include_stk->full_name); - LexAttachDoc(rx->cc2,rx->cc2->lex_include_stk,doc,, - doc->cur_entry,doc->cur_col); - - rx->indent=QueVectU8New(doc->cur_entry->y); - - Lex(rx->cc1); - EdRIStmt(rx,FALSE); - - CmpCtrlDel(rx->cc1); - CmpCtrlDel(rx->cc2); - res=rx->indent; - Free(rx); - return res; -} - -U0 EdRemFunLeadingSpace(CDoc *doc) -{ - Bool unlock=DocLock(doc), - start_of_line=TRUE; - U8 *ptr; - I64 ch,levels=1; - CDocEntry *doc_e,*doc_e2; - - EdGoToFun(doc,FALSE,FALSE); - doc_e=doc->cur_entry->next; - do { - doc_e2=doc_e->next; - if (doc_e!=doc && doc_e!=doc->cur_entry && - !(doc_e->de_flags&(DOCEG_DONT_EDIT-DOCEF_SCROLLING_X))) - switch (doc_e->type_u8) { - case DOCT_TEXT: - ptr=doc_e->tag; - if (start_of_line) { - while (*ptr==CH_SPACE) - ptr++; - if (*ptr) - start_of_line=FALSE; - ptr=StrNew(ptr,doc->mem_task); - Free(doc_e->tag); - doc_e->tag=ptr; - } - if (!*ptr) - DocEntryDel(doc,doc_e); - else { - while (ch=*ptr++) - if (ch=='{') - levels++; - else if (ch=='}') { - if (!--levels) - break; - } - if (!levels) goto ls_done; - } - break; - case DOCT_TAB: - if (start_of_line) - DocEntryDel(doc,doc_e); - break; - case DOCT_NEW_LINE: - start_of_line=TRUE; - break; - default: - start_of_line=FALSE; - } - doc_e=doc_e2; - } while (doc_e!=doc->cur_entry); -ls_done: - DocRecalc(doc); - DocCenter(doc); - if (unlock) - DocUnlock(doc); -} - -class CRenum -{ - CRenum *next,*last; - U8 label[sizeof(CEdFindText.find_text)]; -}; - -I64 EdRAGetU8(CDoc *doc) -{ - I64 res=-1; - while (doc->cur_entry!=doc && - doc->cur_entry->type&DOCET_SEL && res<0) { - res=EdCurU8(doc); - EdCursorRight(doc); - } - return res; -} - -U0 EdRACollect(CDoc *doc,CRenum *head) -{ - I64 ch,i; - CRenum *tempr; - U8 buf[sizeof(CEdFindText.find_text)]; - ch=EdRAGetU8(doc); - while (ch>=0) { - if (ch!='@') - ch=EdRAGetU8(doc); - else { - ch=EdRAGetU8(doc); - if (ch=='@') { - ch=EdRAGetU8(doc); - StrCpy(buf,"@@"); - i=2; - while (ch>=0 && i=0 && Bt(chars_bmp_white_space,ch)) - ch=EdRAGetU8(doc); - if (ch==':') { - ch=EdRAGetU8(doc); - tempr=MAlloc(sizeof(CRenum)); - StrCpy(tempr->label,buf); - QueIns(tempr,head->last); - } - } - } - } - } -//This is needed because we moved the - //cursor and it didn't recalc. - DocRecalc(doc); -} - -U0 EdRenumAsm(CDoc *doc) -{ - Bool unlock=DocLock(doc); - I64 num=0; - CRenum head,*tempr,*tempr1; - U8 buf[sizeof(CEdFindText.find_text)], - buf2[sizeof(CEdFindText.find_text)]; - - QueInit(&head); - EdSelFun(doc,TRUE); - EdRACollect(doc,&head); - - tempr=head.next; - while (tempr!=&head) { - tempr1=tempr->next; - num+=ASM_RENUM_SPACING; - StrPrint(buf,"@#%02d",num); - EdReplace(doc,tempr->label,buf,TRUE,TRUE,TRUE); - Free(tempr); - tempr=tempr1; - } - - while (num) { - StrPrint(buf, "@#%02d",num); - StrPrint(buf2,"@@%02d",num); - EdReplace(doc,buf,buf2,TRUE,TRUE,TRUE); - num-=ASM_RENUM_SPACING; - } - EdSelAll(doc,FALSE); - DocRecalc(doc); - DocCenter(doc); - if (unlock) - DocUnlock(doc); -} - -U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE) -{ - Bool okay,unlock=DocLock(doc),start_of_line=TRUE; - CDocEntry *doc_e,*doc_ne; - I64 i,start_y,end_y,x,r,goto_line_num; - U8 *b,*st,*st2,*prj_file; - CTask *task=NULL; - CSrvCmd *tempc; - CQueVectU8 *indent; - - DocRecalc(doc); - goto_line_num=doc->cur_entry->y+1; - - DocCaptureUndo(doc,TRUE); - switch (tool_action) { - case EF_CMP_CHK: - okay=FALSE; - if (doc->flags&DOCF_PLAIN_TEXT) - DocFlagsToggle(doc,DOCF_PLAIN_TEXT); - DocWrite(doc); - task=Spawn(&SrvCmdLine,NULL,"Srv",,Fs); - st2=CurDir; - st=MStrPrint("Cd(\"%s\");",st2); - tempc=TaskExe(task,Fs,st,1<win_left,Fs->win_right, task); - WinVert(Fs->win_top, Fs->win_bottom,task); - if (JobResScan(tempc,&r)) { - st=DirFile(doc->filename.name,,"PRJ.Z"); - prj_file=FileNameAbs(st,FUF_Z_OR_NOT_Z); - Free(st); - if (FileFind(prj_file)) { - st2=DirFile(prj_file), - st=MStrPrint("Cd(\"%s\");",st2); - Free(st2); - tempc=TaskExe(task,Fs,st,1<filename.name,"Load","CPP.Z"); - prj_file=FileNameAbs(st,FUF_Z_OR_NOT_Z); - Free(st); - if (FileFind(prj_file)) - st=MStrPrint("\"$$WW,1$$\";ExeFile(\"%s\",CCF_JUST_LOAD);",prj_file); - else - st=MStrPrint("\"$$WW,1$$\";ExeFile(\"%s\",CCF_JUST_LOAD);", - doc->filename.name); - tempc=TaskExe(task,Fs,st,1<filename.name)) - goto_line_num=i; - Free(st); - } - break; - case EF_REINDENT: - start_y=doc->cur_entry->y; - EdReplaceTroubleAll(doc,TRUE,FALSE); - DocLineNumGoTo(doc,start_y+1); - if (EdGoToFun(doc,FALSE,FALSE)) { - start_y=doc->cur_entry->y; - indent=EdRICode(doc); - DocUnlock(doc); - if (beep) { - Snd(2000); Sleep(150); Snd(0); - Sleep(100); - Snd(2000); Sleep(150); Snd(0); - } - DocLock(doc); - EdRemFunLeadingSpace(doc); - DocLineNumGoTo(doc,start_y+1); - doc_e=doc->cur_entry; - end_y=start_y+indent->total_cnt; - while (start_y<=doc_e->ycur_entry && - !(doc_e->de_flags&(DOCEG_DONT_EDIT-DOCEF_SCROLLING_X))) { - if (doc_e->type_u8==DOCT_NEW_LINE|| - doc_e->type_u8==DOCT_SOFT_NEW_LINE) - start_of_line=TRUE; - else { - if (start_of_line) { - i=QueVectU8Get(indent,doc_e->y)*C_INDENT_SPACES; - x=doc_e->x+1; - while (i>8) { - doc_ne=DocEntryNewBase(doc, - DOCT_TAB|doc->settings_head.dft_text_attr<<8,, - x,doc_e->y,doc_e->page_line_num); - MemCpy(&doc_ne->settings, - &doc_e->settings,sizeof(CDocSettings)); - QueIns(doc_ne,doc_e->last); - i-=8; - x+=8; - } - if (i>0) { - b=MAlloc(i+1,doc->mem_task); - MemSet(b,CH_SPACE,i); - b[i]=0; - doc_ne=DocEntryNewBase(doc, - DOCT_TEXT|doc->settings_head.dft_text_attr<<8,, - x,doc_e->y,doc_e->page_line_num); - doc_ne->tag=b; - doc_ne->max_col=1; - MemCpy(&doc_ne->settings, - &doc_e->settings,sizeof(CDocSettings)); - QueIns(doc_ne,doc_e->last); - } - } - start_of_line=FALSE; - } - } - doc_e=doc_e->next; - } - QueVectU8Del(indent); - } - start_y=doc->cur_entry->y; - EdReplaceTroubleAll(doc,FALSE,FALSE); - DocLineNumGoTo(doc,start_y+1); - break; - case EF_RENUM_ASM: - if (EdGoToFun(doc,FALSE,TRUE)) { - if (EdCurU8(doc)=='{') { - EdCursorRight(doc); - DocRecalc(doc); - } else if (EdCurU8(doc)==':') { - EdCursorRight(doc); - if (EdCurU8(doc)==':') - EdCursorRight(doc); - DocRecalc(doc); - } - DocUnlock(doc); - if (beep) { - Snd(2000); Sleep(150); Snd(0); - Sleep(100); - Snd(2000); Sleep(150); Snd(0); - } - DocLock(doc); - EdRenumAsm(doc); - } - break; - } - - DocRecalc(doc); - DocLineNumGoTo(doc,goto_line_num); - - DocUnlock(doc); - if (!unlock) - DocLock(doc); - if (task) - Kill(task,FALSE); -} - -U0 EdPopUpChSC(I64 *_ch,I64 *_sc) -{ - I64 sc; - "Press A Key\n"; - DocPut->flags|=DOCF_MIN_SIZE; - do GetMsg(_ch,&sc,1<" ,i++,to_safe,sel); + EdReplaceTroubleOne(doc,"#define" ,"//<@%d@>" ,i++,to_safe,sel); + EdReplaceTroubleOne(doc,"#include","//<@%d@>" ,i++,to_safe,sel); +//#if will match #if,#ifdef,#ifndef,#ifaot and #ifjit + EdReplaceTroubleOne(doc,"#if" ,"//<@%d@>" ,i++,to_safe,sel); + EdReplaceTroubleOne(doc,"#endif" ,"//<@%d@>" ,i++,to_safe,sel); +//Convert #exe to union because we want that indent pattern. + EdReplaceTroubleOne(doc,"#exe" ,"union @%d@",i++,to_safe,sel); + EdReplaceTroubleOne(doc,"'{'" ,"'<@%d@>'" ,i++,to_safe,sel); + EdReplaceTroubleOne(doc,"'}'" ,"'<@%d@>'" ,i++,to_safe,sel); +} + +#define C_INDENT_SPACES 2 +#define ASM_RENUM_SPACING 5 + +#define EF_REINDENT 0 +#define EF_CMP_CHK 1 +#define EF_RENUM_ASM 2 +#define EF_CTRL_SLIDER 3 +#define EF_CH_SC 4 + +I64 PopUpEdFmt() +{ + I64 i; + CDoc *doc=DocNew; + DocPrint(doc,"$$LTBLUE$$$$MU,\"Compile Check\",LE=EF_CMP_CHK$$\n" + "$$MU,\"Reindent HC.Z Fun (Beware braces in strings.)\"," + "LE=EF_REINDENT$$\n" + "$$MU,\"Renum Asm Local @@ Labels for Fun\",LE=EF_RENUM_ASM$$\n" + "$$MU,\"Insert Template Code: Ctrl Slider\",LE=EF_CTRL_SLIDER$$\n" + "$$MU,\"Insert ASCII/Scan Code Hex Codes for key pressed\"," + "LE=EF_CH_SC$$\n\n" + "$$MU,\"CANCEL\",LE=DOCM_CANCEL$$\n\n" + "$$GREEN$$$$FG$$ to undo if not happy\n" + "with the ress.\n"); + i=PopUpMenu(doc); + DocDel(doc); + return i; +} + +class CRILex +{ + CCmpCtrl *cc1,*cc2; + CQueVectU8 *indent; + I64 depth,exp_depth,one_shot; + Bool was_new_line,is_not_cont; +}; + +I64 EdRILex(CRILex *rx) +{ + rx->is_not_cont=FALSE; + I64 i; + CLexFile *tempf; + do { + Lex(rx->cc1); + Lex(rx->cc2); + i=PrsKeyWord(rx->cc2); + if (rx->cc1->token=='\n' && rx->cc2->token==';' || rx->cc2->token=='{' || + rx->cc2->token=='}' || rx->cc2->token==':' || rx->cc2->token==')' && + !rx->exp_depth || i==KW_ELSE || i==KW_CATCH || i==KW_DO) + rx->is_not_cont=TRUE; + if (rx->was_new_line && (rx->cc1->token!=':' || i==KW_CASE || + i==KW_DFT || i==KW_START || i==KW_END)) { + tempf=rx->cc2->lex_include_stk; + while (tempf->next) + tempf=tempf->next; + QueVectU8Put(rx->indent,tempf->cur_entry->y,rx->depth+rx->one_shot); + rx->one_shot=0; + } + if (rx->cc2->token=='\n') + rx->was_new_line=TRUE; + else + rx->was_new_line=FALSE; + } while (rx->cc1->token=='\n'); + return rx->cc1->token; +} + +U0 EdRIExp(CRILex *rx) +{ + if (rx->cc1->token=='(') { + if (!rx->exp_depth++) + rx->depth+=3; + EdRILex(rx); + while (rx->cc1->token && rx->cc1->token!=')') + EdRIExp(rx); + if (!--rx->exp_depth) { + rx->depth-=3; + if (rx->depth<0) rx->depth=0; + } + } else if (rx->cc1->token=='[') { + if (!rx->exp_depth++) + rx->depth+=3; + EdRILex(rx); + while (rx->cc1->token && rx->cc1->token!=']') + EdRIExp(rx); + if (!--rx->exp_depth) { + rx->depth-=3; + if (rx->depth<0) rx->depth=0; + } + } + EdRILex(rx); +} + +U0 EdRIStmt(CRILex *rx,Bool indent) +{ + I64 i; + Bool cont; + if (rx->cc1->token=='{') { + rx->depth++; + EdRILex(rx); + while (rx->cc1->token && rx->cc1->token!='}') + EdRIStmt(rx,FALSE); + if (--rx->depth<0) rx->depth=0; + EdRILex(rx); + } else { + if (indent) rx->depth++; + do { + cont=FALSE; + switch (PrsKeyWord(rx->cc1)) { + case KW_IF: + EdRILex(rx); + EdRIExp(rx); + EdRIStmt(rx,TRUE); + if (PrsKeyWord(rx->cc1)==KW_ELSE) { + EdRILex(rx); + if (PrsKeyWord(rx->cc1)==KW_IF && rx->cc2->token!='\n') + EdRIStmt(rx,FALSE); + else + EdRIStmt(rx,TRUE); + } + break; + case KW_TRY: + EdRILex(rx); + EdRIStmt(rx,TRUE); + if (PrsKeyWord(rx->cc1)==KW_CATCH) { + EdRILex(rx); + EdRIStmt(rx,TRUE); + } + break; + case KW_LOCK: + EdRILex(rx); + EdRIStmt(rx,TRUE); + break; + case KW_FOR: + case KW_WHILE: + EdRILex(rx); + EdRIExp(rx); + EdRIStmt(rx,TRUE); + break; + case KW_ASM: + case KW_CLASS: + case KW_UNION: + if (EdRILex(rx)==TK_IDENT) + EdRILex(rx); + EdRIStmt(rx,TRUE); + break; + case KW_DO: + EdRILex(rx); + EdRIStmt(rx,TRUE); + if (PrsKeyWord(rx->cc1)==KW_WHILE) { + EdRILex(rx); + EdRIExp(rx); + } + if (rx->cc1->token==';') + EdRILex(rx); + break; + case KW_SWITCH: + EdRILex(rx); + EdRIExp(rx); + if (rx->cc1->token=='{') { + rx->depth++; + EdRILex(rx); + i=0; + while (rx->cc1->token && rx->cc1->token!='}') { + switch (PrsKeyWord(rx->cc1)) { + case KW_START: + rx->depth+=i; i=0; + while (EdRILex(rx) && rx->cc1->token!=':'); + EdRILex(rx); + i++; + break; + case KW_END: + rx->depth+=i; i=0; + if (--rx->depth<0) rx->depth=0; + while (EdRILex(rx) && rx->cc1->token!=':'); + EdRILex(rx); + break; + case KW_CASE: + case KW_DFT: + rx->depth+=i; i=0; + while (EdRILex(rx) && rx->cc1->token!=':'); + EdRILex(rx); + break; + default: + if (rx->cc1->token) + EdRIStmt(rx,TRUE); + } + } + if (--rx->depth<0) rx->depth=0; + EdRILex(rx); + } + break; + default: + if (rx->cc1->token==TK_IDENT && rx->cc1->hash_entry && + rx->cc1->hash_entry->type&(HTT_OPCODE|HTT_ASM_KEYWORD)) { +// rx->one_shot=4-rx->depth; + do EdRILex(rx); + while (rx->cc2->token && rx->cc2->token!='\n'); + rx->is_not_cont=TRUE; + } else { + while (rx->cc1->token && rx->cc1->token!=';' && + rx->cc1->token!=':') { + if (rx->cc2->token=='\n' && !rx->is_not_cont) + rx->one_shot=3; + EdRILex(rx); + } + if (rx->cc1->token==':') + cont=TRUE; + EdRILex(rx); + } + } + } while (cont && rx->cc1->token!='}'); + if (indent && --rx->depth<0) + rx->depth=0; + } +} + +CQueVectU8 *EdRICode(CDoc *doc) +{ + CQueVectU8 *res; + CRILex *rx=CAlloc(sizeof(CRILex)); + + rx->cc1=CmpCtrlNew(,CCF_KEEP_NEW_LINES|CCF_DONT_FREE_BUF,doc->filename.name); + Free(rx->cc1->lex_include_stk->full_name); + LexAttachDoc(rx->cc1,rx->cc1->lex_include_stk,doc,, + doc->cur_entry,doc->cur_col); + + rx->cc2=CmpCtrlNew(,CCF_KEEP_NEW_LINES|CCF_DONT_FREE_BUF,doc->filename.name); + Free(rx->cc2->lex_include_stk->full_name); + LexAttachDoc(rx->cc2,rx->cc2->lex_include_stk,doc,, + doc->cur_entry,doc->cur_col); + + rx->indent=QueVectU8New(doc->cur_entry->y); + + Lex(rx->cc1); + EdRIStmt(rx,FALSE); + + CmpCtrlDel(rx->cc1); + CmpCtrlDel(rx->cc2); + res=rx->indent; + Free(rx); + return res; +} + +U0 EdRemFunLeadingSpace(CDoc *doc) +{ + Bool unlock=DocLock(doc), + start_of_line=TRUE; + U8 *ptr; + I64 ch,levels=1; + CDocEntry *doc_e,*doc_e2; + + EdGoToFun(doc,FALSE,FALSE); + doc_e=doc->cur_entry->next; + do { + doc_e2=doc_e->next; + if (doc_e!=doc && doc_e!=doc->cur_entry && + !(doc_e->de_flags&(DOCEG_DONT_EDIT-DOCEF_SCROLLING_X))) + switch (doc_e->type_u8) { + case DOCT_TEXT: + ptr=doc_e->tag; + if (start_of_line) { + while (*ptr==CH_SPACE) + ptr++; + if (*ptr) + start_of_line=FALSE; + ptr=StrNew(ptr,doc->mem_task); + Free(doc_e->tag); + doc_e->tag=ptr; + } + if (!*ptr) + DocEntryDel(doc,doc_e); + else { + while (ch=*ptr++) + if (ch=='{') + levels++; + else if (ch=='}') { + if (!--levels) + break; + } + if (!levels) goto ls_done; + } + break; + case DOCT_TAB: + if (start_of_line) + DocEntryDel(doc,doc_e); + break; + case DOCT_NEW_LINE: + start_of_line=TRUE; + break; + default: + start_of_line=FALSE; + } + doc_e=doc_e2; + } while (doc_e!=doc->cur_entry); +ls_done: + DocRecalc(doc); + DocCenter(doc); + if (unlock) + DocUnlock(doc); +} + +class CRenum +{ + CRenum *next,*last; + U8 label[sizeof(CEdFindText.find_text)]; +}; + +I64 EdRAGetU8(CDoc *doc) +{ + I64 res=-1; + while (doc->cur_entry!=doc && + doc->cur_entry->type&DOCET_SEL && res<0) { + res=EdCurU8(doc); + EdCursorRight(doc); + } + return res; +} + +U0 EdRACollect(CDoc *doc,CRenum *head) +{ + I64 ch,i; + CRenum *tempr; + U8 buf[sizeof(CEdFindText.find_text)]; + ch=EdRAGetU8(doc); + while (ch>=0) { + if (ch!='@') + ch=EdRAGetU8(doc); + else { + ch=EdRAGetU8(doc); + if (ch=='@') { + ch=EdRAGetU8(doc); + StrCpy(buf,"@@"); + i=2; + while (ch>=0 && i=0 && Bt(chars_bmp_white_space,ch)) + ch=EdRAGetU8(doc); + if (ch==':') { + ch=EdRAGetU8(doc); + tempr=MAlloc(sizeof(CRenum)); + StrCpy(tempr->label,buf); + QueIns(tempr,head->last); + } + } + } + } + } +//This is needed because we moved the + //cursor and it didn't recalc. + DocRecalc(doc); +} + +U0 EdRenumAsm(CDoc *doc) +{ + Bool unlock=DocLock(doc); + I64 num=0; + CRenum head,*tempr,*tempr1; + U8 buf[sizeof(CEdFindText.find_text)], + buf2[sizeof(CEdFindText.find_text)]; + + QueInit(&head); + EdSelFun(doc,TRUE); + EdRACollect(doc,&head); + + tempr=head.next; + while (tempr!=&head) { + tempr1=tempr->next; + num+=ASM_RENUM_SPACING; + StrPrint(buf,"@#%02d",num); + EdReplace(doc,tempr->label,buf,TRUE,TRUE,TRUE); + Free(tempr); + tempr=tempr1; + } + + while (num) { + StrPrint(buf, "@#%02d",num); + StrPrint(buf2,"@@%02d",num); + EdReplace(doc,buf,buf2,TRUE,TRUE,TRUE); + num-=ASM_RENUM_SPACING; + } + EdSelAll(doc,FALSE); + DocRecalc(doc); + DocCenter(doc); + if (unlock) + DocUnlock(doc); +} + +U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE) +{ + Bool okay,unlock=DocLock(doc),start_of_line=TRUE; + CDocEntry *doc_e,*doc_ne; + I64 i,start_y,end_y,x,r,goto_line_num; + U8 *b,*st,*st2,*prj_file; + CTask *task=NULL; + CSrvCmd *tempc; + CQueVectU8 *indent; + + DocRecalc(doc); + goto_line_num=doc->cur_entry->y+1; + + DocCaptureUndo(doc,TRUE); + switch (tool_action) { + case EF_CMP_CHK: + okay=FALSE; + if (doc->flags&DOCF_PLAIN_TEXT) + DocFlagsToggle(doc,DOCF_PLAIN_TEXT); + DocWrite(doc); + task=Spawn(&SrvCmdLine,NULL,"Srv",,Fs); + st2=CurDir; + st=MStrPrint("Cd(\"%s\");",st2); + tempc=TaskExe(task,Fs,st,1<win_left,Fs->win_right, task); + WinVert(Fs->win_top, Fs->win_bottom,task); + if (JobResScan(tempc,&r)) { + st=DirFile(doc->filename.name,,"PRJ.Z"); + prj_file=FileNameAbs(st,FUF_Z_OR_NOT_Z); + Free(st); + if (FileFind(prj_file)) { + st2=DirFile(prj_file), + st=MStrPrint("Cd(\"%s\");",st2); + Free(st2); + tempc=TaskExe(task,Fs,st,1<filename.name,"Load","HC.Z"); + prj_file=FileNameAbs(st,FUF_Z_OR_NOT_Z); + Free(st); + if (FileFind(prj_file)) + st=MStrPrint("\"$$WW,1$$\";ExeFile(\"%s\",CCF_JUST_LOAD);",prj_file); + else + st=MStrPrint("\"$$WW,1$$\";ExeFile(\"%s\",CCF_JUST_LOAD);", + doc->filename.name); + tempc=TaskExe(task,Fs,st,1<filename.name)) + goto_line_num=i; + Free(st); + } + break; + case EF_REINDENT: + start_y=doc->cur_entry->y; + EdReplaceTroubleAll(doc,TRUE,FALSE); + DocLineNumGoTo(doc,start_y+1); + if (EdGoToFun(doc,FALSE,FALSE)) { + start_y=doc->cur_entry->y; + indent=EdRICode(doc); + DocUnlock(doc); + if (beep) { + Snd(2000); Sleep(150); Snd(0); + Sleep(100); + Snd(2000); Sleep(150); Snd(0); + } + DocLock(doc); + EdRemFunLeadingSpace(doc); + DocLineNumGoTo(doc,start_y+1); + doc_e=doc->cur_entry; + end_y=start_y+indent->total_cnt; + while (start_y<=doc_e->ycur_entry && + !(doc_e->de_flags&(DOCEG_DONT_EDIT-DOCEF_SCROLLING_X))) { + if (doc_e->type_u8==DOCT_NEW_LINE|| + doc_e->type_u8==DOCT_SOFT_NEW_LINE) + start_of_line=TRUE; + else { + if (start_of_line) { + i=QueVectU8Get(indent,doc_e->y)*C_INDENT_SPACES; + x=doc_e->x+1; + while (i>8) { + doc_ne=DocEntryNewBase(doc, + DOCT_TAB|doc->settings_head.dft_text_attr<<8,, + x,doc_e->y,doc_e->page_line_num); + MemCpy(&doc_ne->settings, + &doc_e->settings,sizeof(CDocSettings)); + QueIns(doc_ne,doc_e->last); + i-=8; + x+=8; + } + if (i>0) { + b=MAlloc(i+1,doc->mem_task); + MemSet(b,CH_SPACE,i); + b[i]=0; + doc_ne=DocEntryNewBase(doc, + DOCT_TEXT|doc->settings_head.dft_text_attr<<8,, + x,doc_e->y,doc_e->page_line_num); + doc_ne->tag=b; + doc_ne->max_col=1; + MemCpy(&doc_ne->settings, + &doc_e->settings,sizeof(CDocSettings)); + QueIns(doc_ne,doc_e->last); + } + } + start_of_line=FALSE; + } + } + doc_e=doc_e->next; + } + QueVectU8Del(indent); + } + start_y=doc->cur_entry->y; + EdReplaceTroubleAll(doc,FALSE,FALSE); + DocLineNumGoTo(doc,start_y+1); + break; + case EF_RENUM_ASM: + if (EdGoToFun(doc,FALSE,TRUE)) { + if (EdCurU8(doc)=='{') { + EdCursorRight(doc); + DocRecalc(doc); + } else if (EdCurU8(doc)==':') { + EdCursorRight(doc); + if (EdCurU8(doc)==':') + EdCursorRight(doc); + DocRecalc(doc); + } + DocUnlock(doc); + if (beep) { + Snd(2000); Sleep(150); Snd(0); + Sleep(100); + Snd(2000); Sleep(150); Snd(0); + } + DocLock(doc); + EdRenumAsm(doc); + } + break; + } + + DocRecalc(doc); + DocLineNumGoTo(doc,goto_line_num); + + DocUnlock(doc); + if (!unlock) + DocLock(doc); + if (task) + Kill(task,FALSE); +} + +U0 EdPopUpChSC(I64 *_ch,I64 *_sc) +{ + I64 sc; + "Press A Key\n"; + DocPut->flags|=DOCF_MIN_SIZE; + do GetMsg(_ch,&sc,1<put_doc) && res->doc_signature==DOC_SIGNATURE_VAL) - return res; - else - return NULL; -} - -public CDoc *DocDisplay(CTask *task=NULL) -{//StdOut displayed unless double buffering. - CDoc *res; - if (!task) task=Fs; - if ((res=task->display_doc) && res->doc_signature==DOC_SIGNATURE_VAL) - return res; - else - return NULL; -} - -public CDoc *DocBorder(CTask *task=NULL) -{//Doc holding border of window text. - CDoc *res; - if (!task) task=Fs; - if ((res=task->border_doc) && res->doc_signature==DOC_SIGNATURE_VAL) - return res; - else - return NULL; -} - -public CDoc *DocDblBufStart(CTask *task=NULL) -{//See $LK,"::/Demo/Spy.CPP"$ - Bool unlock_ddoc; - CDoc *pdoc=DocPut(task),*ddoc=DocDisplay(task),*res; - if (!pdoc || !ddoc || pdoc!=ddoc) - res=NULL; //Already Double buffering - else { - if (!task) task=Fs; - unlock_ddoc=DocLock(ddoc); //dont change during winupdate, so lock DocPut$WW,0$ - res=DocNew(,task); - res->win_task =ddoc->win_task; - res->max_entries =ddoc->max_entries; - MemCpy(res->find_replace,ddoc->find_replace,sizeof(CEdFindText)); - MemCpy(&res->filename,&ddoc->filename,sizeof(CEdFileName)); - res->left_click_link =ddoc->left_click_link; - res->right_click_link =ddoc->right_click_link; - res->user_put_data =ddoc->user_put_data; - res->user_put_key =ddoc->user_put_key; - res->user_put_s =ddoc->user_put_s; - res->parent_doc =ddoc->parent_doc; - res->desc =ddoc->desc; - res->user_data =ddoc->user_data; - res->flags|=ddoc->flags&DOCG_DBL_BUF_FLAGS | DOCF_DONT_SHOW; - task->put_doc=res; - if (unlock_ddoc) - DocUnlock(ddoc); - } - return res; -} - -public Bool DocDblBufEnd(CTask *task=NULL) -{//See $LK,"::/Demo/Spy.CPP"$ - Bool res=FALSE; - CDoc *pdoc=DocPut(task),*ddoc=DocDisplay(task); - if (pdoc && ddoc && pdoc!=ddoc) {//Double buffering? - if (!task) task=Fs; - ddoc->flags|=DOCF_DONT_SHOW; - pdoc->flags&=~DOCF_DONT_SHOW; - DocLock(ddoc); - task->display_doc=pdoc; - DocUnlock(ddoc); - DocDel(ddoc); - res=TRUE; - } - return res; -} - -public Bool DocDblBufSwap(CTask *task=NULL) -{//See $LK,"::/Demo/Spy.CPP"$ - Bool res=FALSE; - CDoc *pdoc=DocPut(task),*ddoc=DocDisplay(task); - if (pdoc && ddoc && pdoc!=ddoc) {//Double buffering? - if (!task) task=Fs; - ddoc->flags|=DOCF_DONT_SHOW; - pdoc->flags&=~DOCF_DONT_SHOW; - DocLock(ddoc); - task->display_doc=pdoc; - DocUnlock(ddoc); - DocRst(ddoc,TRUE); - MemCpy(ddoc->find_replace,pdoc->find_replace,sizeof(CEdFindText)); - MemCpy(&ddoc->filename,&pdoc->filename,sizeof(CEdFileName)); - ddoc->max_entries =pdoc->max_entries; - ddoc->flags =pdoc->flags&DOCG_DBL_BUF_FLAGS | - ddoc->flags&~DOCG_DBL_BUF_FLAGS; - ddoc->left_click_link =pdoc->left_click_link; - ddoc->right_click_link =pdoc->right_click_link; - ddoc->user_put_data =pdoc->user_put_data; - ddoc->user_put_key =pdoc->user_put_key; - ddoc->user_put_s =pdoc->user_put_s; - ddoc->desc =pdoc->desc; - ddoc->user_data =pdoc->user_data; - task->put_doc=ddoc; - res=TRUE; - } - return res; -} diff --git a/Adam/DolDoc/DocDblBuf.HC b/Adam/DolDoc/DocDblBuf.HC new file mode 100644 index 0000000..0890759 --- /dev/null +++ b/Adam/DolDoc/DocDblBuf.HC @@ -0,0 +1,108 @@ +#help_index "DolDoc/Task;StdOut/Task" +public CDoc *DocPut(CTask *task=NULL) +{//Current document that StdOut Put() goes to. +//Basically, StdOut unless double buffering. + CDoc *res; + if (!task) task=Fs; + if ((res=task->put_doc) && res->doc_signature==DOC_SIGNATURE_VAL) + return res; + else + return NULL; +} + +public CDoc *DocDisplay(CTask *task=NULL) +{//StdOut displayed unless double buffering. + CDoc *res; + if (!task) task=Fs; + if ((res=task->display_doc) && res->doc_signature==DOC_SIGNATURE_VAL) + return res; + else + return NULL; +} + +public CDoc *DocBorder(CTask *task=NULL) +{//Doc holding border of window text. + CDoc *res; + if (!task) task=Fs; + if ((res=task->border_doc) && res->doc_signature==DOC_SIGNATURE_VAL) + return res; + else + return NULL; +} + +public CDoc *DocDblBufStart(CTask *task=NULL) +{//See $LK,"::/Demo/Spy.HC"$ + Bool unlock_ddoc; + CDoc *pdoc=DocPut(task),*ddoc=DocDisplay(task),*res; + if (!pdoc || !ddoc || pdoc!=ddoc) + res=NULL; //Already Double buffering + else { + if (!task) task=Fs; + unlock_ddoc=DocLock(ddoc); //dont change during winupdate, so lock DocPut$WW,0$ + res=DocNew(,task); + res->win_task =ddoc->win_task; + res->max_entries =ddoc->max_entries; + MemCpy(res->find_replace,ddoc->find_replace,sizeof(CEdFindText)); + MemCpy(&res->filename,&ddoc->filename,sizeof(CEdFileName)); + res->left_click_link =ddoc->left_click_link; + res->right_click_link =ddoc->right_click_link; + res->user_put_data =ddoc->user_put_data; + res->user_put_key =ddoc->user_put_key; + res->user_put_s =ddoc->user_put_s; + res->parent_doc =ddoc->parent_doc; + res->desc =ddoc->desc; + res->user_data =ddoc->user_data; + res->flags|=ddoc->flags&DOCG_DBL_BUF_FLAGS | DOCF_DONT_SHOW; + task->put_doc=res; + if (unlock_ddoc) + DocUnlock(ddoc); + } + return res; +} + +public Bool DocDblBufEnd(CTask *task=NULL) +{//See $LK,"::/Demo/Spy.HC"$ + Bool res=FALSE; + CDoc *pdoc=DocPut(task),*ddoc=DocDisplay(task); + if (pdoc && ddoc && pdoc!=ddoc) {//Double buffering? + if (!task) task=Fs; + ddoc->flags|=DOCF_DONT_SHOW; + pdoc->flags&=~DOCF_DONT_SHOW; + DocLock(ddoc); + task->display_doc=pdoc; + DocUnlock(ddoc); + DocDel(ddoc); + res=TRUE; + } + return res; +} + +public Bool DocDblBufSwap(CTask *task=NULL) +{//See $LK,"::/Demo/Spy.HC"$ + Bool res=FALSE; + CDoc *pdoc=DocPut(task),*ddoc=DocDisplay(task); + if (pdoc && ddoc && pdoc!=ddoc) {//Double buffering? + if (!task) task=Fs; + ddoc->flags|=DOCF_DONT_SHOW; + pdoc->flags&=~DOCF_DONT_SHOW; + DocLock(ddoc); + task->display_doc=pdoc; + DocUnlock(ddoc); + DocRst(ddoc,TRUE); + MemCpy(ddoc->find_replace,pdoc->find_replace,sizeof(CEdFindText)); + MemCpy(&ddoc->filename,&pdoc->filename,sizeof(CEdFileName)); + ddoc->max_entries =pdoc->max_entries; + ddoc->flags =pdoc->flags&DOCG_DBL_BUF_FLAGS | + ddoc->flags&~DOCG_DBL_BUF_FLAGS; + ddoc->left_click_link =pdoc->left_click_link; + ddoc->right_click_link =pdoc->right_click_link; + ddoc->user_put_data =pdoc->user_put_data; + ddoc->user_put_key =pdoc->user_put_key; + ddoc->user_put_s =pdoc->user_put_s; + ddoc->desc =pdoc->desc; + ddoc->user_data =pdoc->user_data; + task->put_doc=ddoc; + res=TRUE; + } + return res; +} diff --git a/Adam/DolDoc/DocEd.CPP b/Adam/DolDoc/DocEd.CPP deleted file mode 100644 index c7860b3..0000000 --- a/Adam/DolDoc/DocEd.CPP +++ /dev/null @@ -1,250 +0,0 @@ -#help_index "DolDoc/Output;StdOut/DolDoc" - -public Bool View() -{//Go live for user interaction until or . - I64 ch; - do ch=DocGetKey; - while (ch!=CH_ESC && ch!=CH_SHIFT_ESC); - return ch==CH_ESC; -} - -#help_index "DolDoc" -U8 *EdOverStrikeCB(CDoc *,CDocEntry *doc_e,CTask *mem_task) -{ - CDoc *doc=doc_e->user_data; - U8 *st=MAlloc(8,mem_task); - if (doc->flags & DOCF_OVERSTRIKE) - *st='O'; - else - *st='Ä'; - st[1]=0; - return st; -} - -U8 *EdFilterCB(CDoc *,CDocEntry *doc_e,CTask *mem_task) -{ - CDoc *doc=doc_e->user_data; - U8 *st=MAlloc(8,mem_task); - if (doc->find_replace->filter_lines) - *st='F'; - else - *st='Ä'; - st[1]=0; - return st; -} - -U8 *EdDollarCB(CDoc *,CDocEntry *doc_e,CTask *mem_task) -{ - CDoc *doc=doc_e->user_data; - U8 *st=MAlloc(8,mem_task); - if (doc->flags & DOCF_IN_DOLLAR) - *st='$$'; - else - *st='Ä'; - st[1]=0; - return st; -} - -U8 *EdMoreCB(CDoc *,CDocEntry *doc_e,CTask *mem_task) -{ - CDoc *doc=doc_e->user_data; - U8 *st=MAlloc(8,mem_task); - if (doc->flags&DOCF_MORE) - StrCpy(st,"MoreÄ"); - else - StrCpy(st,"ÄÄÄÄÄ"); - return st; -} - -U8 *EdDollarTypeCB(CDoc *,CDocEntry *doc_e,CTask *mem_task) -{ - CDoc *doc=doc_e->user_data; - U8 *src=DefineSub(doc->cur_entry->type_u8,"ST_DOC_CMDS"), - *st=CAlloc(8,mem_task); - if (doc->cur_entry==doc) - src="EOF"; - else if (!src) - src="ERR"; - StrPrint(st,"%-3ts",src); - return st; -} - -public Bool DocEd(CDoc *doc,I64 dof_flags=0) -{//Live for user interaction. End on or . - CDoc *old_put_doc =DocPut, - *old_display_doc=DocDisplay, - *old_border_doc =DocBorder,*bdoc; - CDocEntry *doc_e; - I64 old_attr=Fs->text_attr, - old_top =Fs->win_top, old_bottom=Fs->win_bottom, - old_left=Fs->win_left,old_right =Fs->win_right, - old_title_src=Fs->title_src; - Bool res,unlock; - U8 *old_task_title; - if (dof_flags&DOF_WIN_MAX) - WinMax; - - unlock=DocLock(doc); - doc->win_task=Fs; - bdoc=DocNew; - bdoc->flags|=DOCF_BORDER_DOC; - DocPrint(bdoc,"$$CM+TY+LX+NC,0,-1$$"); - DocPrint(bdoc,"$$TX+RX+BD,\"[X]\"$$"); - DocPrint(bdoc,"$$BK,1$$$$TX+LX+BD,\"MENU\"$$$$BK,0$$"); - - old_task_title=StrNew(Fs->task_title); - if (Fs->title_src!=TTS_LOCKED_CONST) { - Fs->title_src=TTS_ED_FILENAME; - MemCpy(Fs->task_title,doc->filename.name,STR_LEN-1); - } - doc_e=DocPrint(bdoc,"$$DA-TRM-P+BD+RD+CX+IV,LEN=STR_LEN-1," - "A=\"%%s...\",SCX=16$$"); - doc_e->data=&Fs->task_title; - DocDataFmt(bdoc,doc_e); - - if (doc->flags & DOCF_ALLOW_UNDO) { - DocPrint(bdoc,"$$CM+BY+LX+NC,1,1$$"); - doc_e=DocPrint(bdoc,"$$DA+BD+RD-TRM,RT=U32,A=\"Undo:%%03d\"$$\n"); - doc_e->data=&doc->undo_cnt; - DocDataFmt(bdoc,doc_e); - } - - DocPrint(bdoc,"$$CM+BY+RX+NC,-30,1$$"); - doc_e=DocPrint(bdoc,"$$TX+BD+TC,\" \"$$"); - doc_e->user_data=doc; - doc_e->tag_cb=&EdMoreCB; - doc_e=DocPrint(bdoc,"$$TX+BD+TC,\" \"$$"); - doc_e->user_data=doc; - doc_e->tag_cb=&EdDollarTypeCB; - doc_e=DocPrint(bdoc,"$$TX+BD+TC,\" \"$$"); - doc_e->user_data=doc; - doc_e->tag_cb=&EdFilterCB; - doc_e=DocPrint(bdoc,"$$TX+BD+TC,\" \"$$"); - doc_e->user_data=doc; - doc_e->tag_cb=&EdOverStrikeCB; - doc_e=DocPrint(bdoc,"$$TX+BD+TC,\" \"$$"); - doc_e->user_data=doc; - doc_e->tag_cb=&EdDollarCB; - doc_e=DocPrint(bdoc,"$$DA+BD+RD-TRM,A=\"Line:%%04d \"$$"); - doc_e->data=&doc->line; - DocDataFmt(bdoc,doc_e); - doc_e=DocPrint(bdoc,"$$DA+BD+RD-TRM,A=\"Col:%%04d\"$$\n"); - doc_e->data=&doc->col; - DocDataFmt(bdoc,doc_e); - - DocRecalc(bdoc); - DocRecalc(doc); - if (!(dof_flags&DOF_DONT_HOME)) - DocTop(doc); - Fs->border_doc=bdoc; - if (doc!=old_display_doc) - doc->parent_doc=old_display_doc; - Fs->put_doc=Fs->display_doc=doc; - if (!(dof_flags&DOF_DONT_TEXT_ATTR)) - Fs->text_attr=DOC_ATTR_DFT_TEXT; - if (!(dof_flags&DOF_DONT_SHOW)) { - LBts(&Fs->display_flags,DISPLAYf_SHOW); - WinZBufUpdate; - } - if (dof_flags&DOF_MIN_SIZE) - doc->flags|=DOCF_MIN_SIZE; - - DocUnlock(doc); - if (!(dof_flags&DOF_DONT_WINMGR_SYNC)) { - WinMgrSync(2,TRUE); - if (doc->flags&DOCF_MIN_SIZE) - WinMgrSync(2,TRUE); - } - res=View; - - DocLock(doc); - if (res) { - doc_e=doc->head.next; - while (doc_e!=doc) { - if (doc_e->type_u8==DOCT_DATA || doc_e->type_u8==DOCT_CHECK_BOX) - DocDataScan(doc,doc_e); - doc_e=doc_e->next; - } - } - if (unlock) - DocUnlock(doc); - Fs->border_doc =old_border_doc; - Fs->display_doc=old_display_doc; - Fs->put_doc =old_put_doc; - Fs->text_attr =old_attr; - if (Fs->title_src!=TTS_LOCKED_CONST) { - Fs->title_src =old_title_src; - StrCpy(Fs->task_title,old_task_title); - } - Free(old_task_title); - DocDel(bdoc); - if (dof_flags&DOF_MIN_SIZE) { - WinHorz(old_left,old_right); - WinVert(old_top,old_bottom); - } - return res; -} - -#help_index "DolDoc/Cmd Line (Typically);Cmd Line (Typically)" -public Bool Ed(U8 *link_st,I64 edf_dof_flags=0) -{//Invoke document editor. - U8 *filename,*needle_str; - I64 i,num; - Bool cont,res=FALSE; - CDoc *doc; - - switch (i=EdLinkCvt(link_st,&filename,&needle_str,&num,edf_dof_flags)) { - case -1: - break; - case LK_DEF: - doc=DocNew; - doc->desc='DictDef'; - ACDDefsPut(doc,filename,num); - goto ej_doc; - case LK_HELP_INDEX: - doc=DocNew; - doc->desc='HelpIndx'; - DocHelpIndex(doc,filename); -ej_doc: - if (!(edf_dof_flags&EDF_BAIL)) { - DocEd(doc); - DocDel(doc); - } - if (!(edf_dof_flags&EDF_WAS_WRITE)) - res=TRUE; - break; - default: - if (IsRaw) - res=EdLite(filename,num,edf_dof_flags); - else { - cont=TRUE; - if (!(edf_dof_flags&EDF_BAIL) && !(LK_DOC<=i<=LK_DOC_LINE) && - !FilesFindMatch(filename,FILEMASK_TXT) && - !PopUpCancelOk(ST_WARN_ST "Not Text File\n\n")) - cont=FALSE; - if (cont) - res=DocFileEd(i,filename,needle_str,&num,edf_dof_flags); - } - } - Free(filename); - Free(needle_str); - return res; -} - -public Bool Plain(U8 *filename,I64 edf_dof_flags=0) -{//Edit document in plain text mode, so dollar signs are not special. - Bool res; - U8 *st=MStrPrint("PI:%s",filename); - res=Ed(st,edf_dof_flags); - Free(st); - return res; -} - -#help_index "DolDoc;Task/Srv/Exe" -public I64 PopUpEd(U8 *filename,CTask *parent=NULL,CTask **_pu_task=NULL) -{//Create PopUp win task and edit a doc. - U8 *st=MStrPrint("Ed(\"%Q\");",filename); - I64 res=PopUp(st,parent,_pu_task); - Free(st); - return res; -} diff --git a/Adam/DolDoc/DocEd.HC b/Adam/DolDoc/DocEd.HC new file mode 100644 index 0000000..227f5b5 --- /dev/null +++ b/Adam/DolDoc/DocEd.HC @@ -0,0 +1,250 @@ +#help_index "DolDoc/Output;StdOut/DolDoc" + +public Bool View() +{//Go live for user interaction until or . + I64 ch; + do ch=DocGetKey; + while (ch!=CH_ESC && ch!=CH_SHIFT_ESC); + return ch==CH_ESC; +} + +#help_index "DolDoc" +U8 *EdOverStrikeCB(CDoc *,CDocEntry *doc_e,CTask *mem_task) +{ + CDoc *doc=doc_e->user_data; + U8 *st=MAlloc(8,mem_task); + if (doc->flags & DOCF_OVERSTRIKE) + *st='O'; + else + *st='Ä'; + st[1]=0; + return st; +} + +U8 *EdFilterCB(CDoc *,CDocEntry *doc_e,CTask *mem_task) +{ + CDoc *doc=doc_e->user_data; + U8 *st=MAlloc(8,mem_task); + if (doc->find_replace->filter_lines) + *st='F'; + else + *st='Ä'; + st[1]=0; + return st; +} + +U8 *EdDollarCB(CDoc *,CDocEntry *doc_e,CTask *mem_task) +{ + CDoc *doc=doc_e->user_data; + U8 *st=MAlloc(8,mem_task); + if (doc->flags & DOCF_IN_DOLLAR) + *st='$$'; + else + *st='Ä'; + st[1]=0; + return st; +} + +U8 *EdMoreCB(CDoc *,CDocEntry *doc_e,CTask *mem_task) +{ + CDoc *doc=doc_e->user_data; + U8 *st=MAlloc(8,mem_task); + if (doc->flags&DOCF_MORE) + StrCpy(st,"MoreÄ"); + else + StrCpy(st,"ÄÄÄÄÄ"); + return st; +} + +U8 *EdDollarTypeCB(CDoc *,CDocEntry *doc_e,CTask *mem_task) +{ + CDoc *doc=doc_e->user_data; + U8 *src=DefineSub(doc->cur_entry->type_u8,"ST_DOC_CMDS"), + *st=CAlloc(8,mem_task); + if (doc->cur_entry==doc) + src="EOF"; + else if (!src) + src="ERR"; + StrPrint(st,"%-3ts",src); + return st; +} + +public Bool DocEd(CDoc *doc,I64 dof_flags=0) +{//Live for user interaction. End on or . + CDoc *old_put_doc =DocPut, + *old_display_doc=DocDisplay, + *old_border_doc =DocBorder,*bdoc; + CDocEntry *doc_e; + I64 old_attr=Fs->text_attr, + old_top =Fs->win_top, old_bottom=Fs->win_bottom, + old_left=Fs->win_left,old_right =Fs->win_right, + old_title_src=Fs->title_src; + Bool res,unlock; + U8 *old_task_title; + if (dof_flags&DOF_WIN_MAX) + WinMax; + + unlock=DocLock(doc); + doc->win_task=Fs; + bdoc=DocNew; + bdoc->flags|=DOCF_BORDER_DOC; + DocPrint(bdoc,"$$CM+TY+LX+NC,0,-1$$"); + DocPrint(bdoc,"$$TX+RX+BD,\"[X]\"$$"); + DocPrint(bdoc,"$$BK,1$$$$TX+LX+BD,\"MENU\"$$$$BK,0$$"); + + old_task_title=StrNew(Fs->task_title); + if (Fs->title_src!=TTS_LOCKED_CONST) { + Fs->title_src=TTS_ED_FILENAME; + MemCpy(Fs->task_title,doc->filename.name,STR_LEN-1); + } + doc_e=DocPrint(bdoc,"$$DA-TRM-P+BD+RD+CX+IV,LEN=STR_LEN-1," + "A=\"%%s...\",SCX=16$$"); + doc_e->data=&Fs->task_title; + DocDataFmt(bdoc,doc_e); + + if (doc->flags & DOCF_ALLOW_UNDO) { + DocPrint(bdoc,"$$CM+BY+LX+NC,1,1$$"); + doc_e=DocPrint(bdoc,"$$DA+BD+RD-TRM,RT=U32,A=\"Undo:%%03d\"$$\n"); + doc_e->data=&doc->undo_cnt; + DocDataFmt(bdoc,doc_e); + } + + DocPrint(bdoc,"$$CM+BY+RX+NC,-30,1$$"); + doc_e=DocPrint(bdoc,"$$TX+BD+TC,\" \"$$"); + doc_e->user_data=doc; + doc_e->tag_cb=&EdMoreCB; + doc_e=DocPrint(bdoc,"$$TX+BD+TC,\" \"$$"); + doc_e->user_data=doc; + doc_e->tag_cb=&EdDollarTypeCB; + doc_e=DocPrint(bdoc,"$$TX+BD+TC,\" \"$$"); + doc_e->user_data=doc; + doc_e->tag_cb=&EdFilterCB; + doc_e=DocPrint(bdoc,"$$TX+BD+TC,\" \"$$"); + doc_e->user_data=doc; + doc_e->tag_cb=&EdOverStrikeCB; + doc_e=DocPrint(bdoc,"$$TX+BD+TC,\" \"$$"); + doc_e->user_data=doc; + doc_e->tag_cb=&EdDollarCB; + doc_e=DocPrint(bdoc,"$$DA+BD+RD-TRM,A=\"Line:%%04d \"$$"); + doc_e->data=&doc->line; + DocDataFmt(bdoc,doc_e); + doc_e=DocPrint(bdoc,"$$DA+BD+RD-TRM,A=\"Col:%%04d\"$$\n"); + doc_e->data=&doc->col; + DocDataFmt(bdoc,doc_e); + + DocRecalc(bdoc); + DocRecalc(doc); + if (!(dof_flags&DOF_DONT_HOME)) + DocTop(doc); + Fs->border_doc=bdoc; + if (doc!=old_display_doc) + doc->parent_doc=old_display_doc; + Fs->put_doc=Fs->display_doc=doc; + if (!(dof_flags&DOF_DONT_TEXT_ATTR)) + Fs->text_attr=DOC_ATTR_DFT_TEXT; + if (!(dof_flags&DOF_DONT_SHOW)) { + LBts(&Fs->display_flags,DISPLAYf_SHOW); + WinZBufUpdate; + } + if (dof_flags&DOF_MIN_SIZE) + doc->flags|=DOCF_MIN_SIZE; + + DocUnlock(doc); + if (!(dof_flags&DOF_DONT_WINMGR_SYNC)) { + WinMgrSync(2,TRUE); + if (doc->flags&DOCF_MIN_SIZE) + WinMgrSync(2,TRUE); + } + res=View; + + DocLock(doc); + if (res) { + doc_e=doc->head.next; + while (doc_e!=doc) { + if (doc_e->type_u8==DOCT_DATA || doc_e->type_u8==DOCT_CHECK_BOX) + DocDataScan(doc,doc_e); + doc_e=doc_e->next; + } + } + if (unlock) + DocUnlock(doc); + Fs->border_doc =old_border_doc; + Fs->display_doc=old_display_doc; + Fs->put_doc =old_put_doc; + Fs->text_attr =old_attr; + if (Fs->title_src!=TTS_LOCKED_CONST) { + Fs->title_src =old_title_src; + StrCpy(Fs->task_title,old_task_title); + } + Free(old_task_title); + DocDel(bdoc); + if (dof_flags&DOF_MIN_SIZE) { + WinHorz(old_left,old_right); + WinVert(old_top,old_bottom); + } + return res; +} + +#help_index "DolDoc/Cmd Line (Typically);Cmd Line (Typically)" +public Bool Ed(U8 *link_st,I64 edf_dof_flags=0) +{//Invoke document editor. + U8 *filename,*needle_str; + I64 i,num; + Bool cont,res=FALSE; + CDoc *doc; + + switch (i=EdLinkCvt(link_st,&filename,&needle_str,&num,edf_dof_flags)) { + case -1: + break; + case LK_DEF: + doc=DocNew; + doc->desc='DictDef'; + ACDDefsPut(doc,filename,num); + goto ej_doc; + case LK_HELP_INDEX: + doc=DocNew; + doc->desc='HelpIndx'; + DocHelpIdx(doc,filename); +ej_doc: + if (!(edf_dof_flags&EDF_BAIL)) { + DocEd(doc); + DocDel(doc); + } + if (!(edf_dof_flags&EDF_WAS_WRITE)) + res=TRUE; + break; + default: + if (IsRaw) + res=EdLite(filename,num,edf_dof_flags); + else { + cont=TRUE; + if (!(edf_dof_flags&EDF_BAIL) && !(LK_DOC<=i<=LK_DOC_LINE) && + !FilesFindMatch(filename,FILEMASK_TXT) && + !PopUpCancelOk(ST_WARN_ST "Not Text File\n\n")) + cont=FALSE; + if (cont) + res=DocFileEd(i,filename,needle_str,&num,edf_dof_flags); + } + } + Free(filename); + Free(needle_str); + return res; +} + +public Bool Plain(U8 *filename,I64 edf_dof_flags=0) +{//Edit document in plain text mode, so dollar signs are not special. + Bool res; + U8 *st=MStrPrint("PI:%s",filename); + res=Ed(st,edf_dof_flags); + Free(st); + return res; +} + +#help_index "DolDoc;Task/Srv/Exe" +public I64 PopUpEd(U8 *filename,CTask *parent=NULL,CTask **_pu_task=NULL) +{//Create PopUp win task and edit a doc. + U8 *st=MStrPrint("Ed(\"%Q\");",filename); + I64 res=PopUp(st,parent,_pu_task); + Free(st); + return res; +} diff --git a/Adam/DolDoc/DocExt.CPP b/Adam/DolDoc/DocExt.HC similarity index 100% rename from Adam/DolDoc/DocExt.CPP rename to Adam/DolDoc/DocExt.HC diff --git a/Adam/DolDoc/DocFile.CPP b/Adam/DolDoc/DocFile.HC similarity index 100% rename from Adam/DolDoc/DocFile.CPP rename to Adam/DolDoc/DocFile.HC diff --git a/Adam/DolDoc/DocFind.CPP b/Adam/DolDoc/DocFind.HC similarity index 100% rename from Adam/DolDoc/DocFind.CPP rename to Adam/DolDoc/DocFind.HC diff --git a/Adam/DolDoc/DocForm.CPP b/Adam/DolDoc/DocForm.CPP deleted file mode 100644 index fd31b73..0000000 --- a/Adam/DolDoc/DocForm.CPP +++ /dev/null @@ -1,344 +0,0 @@ -#help_index "DolDoc/Form" - -U0 DocFormFwd(CDoc *doc,Bool giveup=FALSE) -{ - CDocEntry *doc_e=doc->cur_entry,*doc_e2=doc_e; - if (doc->flags & DOCF_FORM) { - if (doc_e==doc) goto ff_recover; - while (!Bt(doldoc.type_flags_form,doc_e->type_u8) && - !(doc_e->de_flags&DOCEF_LINK) || - doc_e->de_flags&DOCEF_SKIP_IN_FORM) { - doc_e=doc_e->next; - if (doc_e==doc) { -ff_recover: - doc->cur_col=0; - if (!giveup) { - doc->cur_entry=doc_e->last; - DocFormBwd(doc,TRUE); - } else - doc->cur_entry=doc; - return; - } - } - } - while (doc_e->type_u8==DOCT_INDENT) - doc_e=doc_e->next; - if (doc_e!=doc_e2) { - doc->cur_col=doc_e->min_col; - doc->cur_entry=doc_e; - } -} - -U0 DocFormBwd(CDoc *doc,Bool giveup=FALSE) -{ - CDocEntry *doc_e=doc->cur_entry,*doc_e2=doc_e; - if (doc->flags & DOCF_FORM) { - while (!Bt(doldoc.type_flags_form,doc_e->type_u8) && - !(doc_e->de_flags&DOCEF_LINK) || - doc_e->de_flags&DOCEF_SKIP_IN_FORM) { - doc_e=doc_e->last; - if (doc_e==doc) { - doc->cur_col=0; - if (!giveup) { - doc->cur_entry=doc_e->next; - DocFormFwd(doc,TRUE); - } else - doc->cur_entry=doc; - return; - } - } - } - while (doc_e->type_u8==DOCT_INDENT) - doc_e=doc_e->next; - if (doc_e!=doc_e2) { - doc->cur_col=doc_e->min_col; - doc->cur_entry=doc_e; - } -} - -U0 DocDataFmt(CDoc *doc,CDocEntry *doc_e,I64 d=DOCM_CANCEL) -{ - I64 i; - U8 *ptr,*ptr2; - CHashDefineStr *temph; - if (doc_e->type_u8==DOCT_DATA && doc_e->de_flags&DOCEF_AUX_STR || - doc_e->type_u8==DOCT_CHECK_BOX || doc_e->de_flags & DOCEF_LST) { - if (d==DOCM_CANCEL) { - if (doc_e->de_flags&DOCEF_DEREF_DATA && - !(doc_e->de_flags&DOCEF_REMALLOC_DATA)) { - if (!(ptr=doc_e->data)) return; - } else - ptr=&doc_e->data; - switch (doc_e->raw_type) { - case RT_I0: - case RT_U0: d=0; break; - case RT_I8: d=*ptr(I8 *); break; - case RT_U8: d=*ptr(U8 *); break; - case RT_I16: d=*ptr(I16 *); break; - case RT_U16: d=*ptr(U16 *); break; - case RT_I32: d=*ptr(I32 *); break; - case RT_U32: d=*ptr(U32 *); break; - default: d=*ptr(I64 *); - } - } - if (doc_e->type_u8==DOCT_DATA) { - if (doc_e->de_flags & DOCEF_REMALLOC_DATA) { - ptr=MStrPrint(doc_e->aux_str,d,doc_e->my_fmt_data); - i=StrLen(ptr); - if (!doc_e->data) { - doc_e->data=CAlloc(2,doc->mem_task); - doc_e->len=MSize(doc_e->data)-2; - } - if (doc_e->len+doc_e->min_col>i) - MemCpy(doc_e->tag,ptr,i+1); - else { - ptr2=MAlloc(i+8,doc->mem_task); - doc_e->len=MSize(ptr2)-doc_e->min_col-2; //See $LK,"DataTagWidth",A="FA:::/Adam/DolDoc/DocPlain.CPP,DataTagWidth"$ - MemCpy(ptr2,ptr,i+1); - Free(doc_e->tag); - doc_e->tag=ptr2; - } - Free(ptr); - } else { - StrPrint(doc_e->tag,doc_e->aux_str,d,doc_e->my_fmt_data); - i=StrLen(doc_e->tag); - } - if (doc_e->de_flags & DOCEF_HAS_TERMINATOR) { - doc_e->tag[i++]='_'; - doc_e->tag[i]=0; - } - doc_e->max_col=i; - } else if (doc_e->de_flags & DOCEF_LST) { - if (doc_e->de_flags & DOCEF_DEFINE && (temph=HashFind(doc_e->define_str, - doc->win_task->hash_table,HTT_DEFINE_STR)) && 0<=dcnt) { - ptr=MStrPrint("[%s]",temph->sub_idx[d]); - Free(doc_e->tag); - doc_e->tag=StrNew(ptr,doc->mem_task); - Free(ptr); - } else { - Free(doc_e->tag); - doc_e->tag=StrNew("[]",doc->mem_task); - } - } else { - if (d) - doc_e->de_flags|=DOCEF_CHECKED_COLLAPSED; - else - doc_e->de_flags&=~DOCEF_CHECKED_COLLAPSED; - } - } -} - -U0 DocDataScan(CDoc *doc,CDocEntry *doc_e) -{ - I64 i,d; - U8 *ptr,*ptr1,*ptr2; - CHashDefineStr *temph; - if (doc_e->type_u8==DOCT_DATA && doc_e->de_flags&DOCEF_AUX_STR || - doc_e->type_u8==DOCT_CHECK_BOX || doc_e->de_flags & DOCEF_LST) { - if (doc_e->de_flags&DOCEF_DEREF_DATA && - !(doc_e->de_flags&DOCEF_REMALLOC_DATA)) { - if (!(ptr=doc_e->data)) return; - } else - ptr=&doc_e->data; - if (doc_e->type_u8==DOCT_DATA) { - i=StrLen(doc_e->tag); - if (doc_e->de_flags & DOCEF_HAS_TERMINATOR) - doc_e->tag[--i]=0; - if (i>doc_e->len+doc_e->min_col) - doc_e->tag[doc_e->len+doc_e->min_col]=0; - if (RT_I8<=doc_e->raw_type<=RT_U32) { - StrScan(doc_e->tag,doc_e->aux_str,&d,doc_e->my_fmt_data); - if (doc_e->de_flags & DOCEF_HAS_TERMINATOR) - doc_e->tag[i]='_'; - } else if (RT_I64<=doc_e->raw_type<=RT_UF64) { - if (doc_e->de_flags & DOCEF_REMALLOC_DATA) { - ptr=MAlloc(i-doc_e->min_col+8,doc->mem_task); - MemCpy(ptr,doc_e->tag+doc_e->min_col,i-doc_e->min_col+1); - Free(doc_e->data); - doc_e->data=ptr; - doc_e->len=MSize(ptr)-1; - } else - StrScan(doc_e->tag,doc_e->aux_str,ptr,doc_e->my_fmt_data); - if (doc_e->de_flags & DOCEF_HAS_TERMINATOR) - doc_e->tag[i]='_'; - return; - } - } else if (doc_e->de_flags & DOCEF_LST) { - d=0; - if (doc_e->tag && doc_e->de_flags & DOCEF_DEFINE && - (temph=HashFind(doc_e->define_str, - doc->win_task->hash_table,HTT_DEFINE_STR))) { - ptr1=ptr2=StrNew(doc_e->tag); - if (*ptr2=='[') { - ptr2++; - i=StrLen(ptr2); - if (ptr2[i-1]==']') - ptr2[i-1]=0; - } - d=LstMatch(ptr2,temph->data); - Free(ptr1); - } - } else { - if (doc_e->de_flags & DOCEF_CHECKED_COLLAPSED) - d=TRUE; - else - d=FALSE; - } - switch (doc_e->raw_type) { - case RT_I8: - case RT_U8: - *ptr(U8 *)=d; - case RT_I0: - case RT_U0: - break; - case RT_I16: - case RT_U16: - *ptr(U16 *)=d; - break; - case RT_I32: - case RT_U32: - *ptr(U32 *)=d; - break; - default: - *ptr(I64 *)=d; - } - } -} - -#help_index "DolDoc/Input;StdIn/DolDoc" -public Bool DocForm(U8 *_d,U8 *class_name=lastclass, - I64 dof_flags=0,U8 *header=NULL,U8 *footer=NULL) -{//User input. Supply a class name that has fmtstr definitions. -//See $LK,"::/Demo/DolDoc/Form.CPP"$ and $LK,"::/Demo/LastClass.CPP"$. - CMemberLst *ml; - CDocEntry *doc_e; - U8 *fmtstr; - CHashClass *tempc,*tempc2; - CDoc *doc; - Bool res=FALSE; - I64 old_border_src=Fs->border_src,has_action; - if (!(tempc=HashFind(class_name,Fs->hash_table,HTT_CLASS))) - return FALSE; - doc=DocNew; - doc->desc='Form'; - if (header) DocPrint(doc,"%s",header); - doc->flags|=DOCF_OVERSTRIKE|DOCF_FORM; - if (dof_flags&DOF_MIN_SIZE) - doc->flags|=DOCF_MIN_SIZE; - ml=tempc->member_lst_and_root; - while (ml) { - if ((fmtstr=MemberMetaData("fmtstr",ml)) && - (doc_e=DocPrint(doc,"%s",fmtstr))) { - tempc2=ml->member_class; - if ((doc_e->type_u8==DOCT_DATA || doc_e->type_u8==DOCT_LST || - doc_e->type_u8==DOCT_CHECK_BOX) && !tempc2->ptr_stars_cnt) { - tempc2=OptClassFwd(tempc2); - tempc2-=tempc2->ptr_stars_cnt; - if (tempc2->type & HTT_INTERNAL_TYPE) { - if (ml->dim.next) { //Array - if (tempc2->raw_type==RT_U8 && - LBtr(&doc_e->de_flags,&DOCEf_DFT_LEN)) { - doc_e->len=ml->dim.total_cnt; - if (doc_e->de_flags&DOCEF_HAS_TERMINATOR) - doc_e->len--; - Free(doc_e->tag); //See $LK,"DataTagWidth",A="FA:::/Adam/DolDoc/DocPlain.CPP,DataTagWidth"$ - doc_e->tag=MAlloc(doc_e->len+doc_e->min_col+2, - doc->mem_task); //+2 because "_\0" - } - } else if (LBtr(&doc_e->de_flags,DOCEf_DFT_RAW_TYPE)) - doc_e->raw_type=tempc2->raw_type; - } - } - if (doc_e->de_flags&DOCEF_REMALLOC_DATA) { - doc_e->user_data=_d+ml->offset; - doc_e->data=*doc_e->user_data(U8 **); - } else - doc_e->data=_d+ml->offset; - doc_e->my_fmt_data=MemberMetaData("fmtdata",ml); - DocDataFmt(doc,doc_e); - } - ml=ml->next; - } - if (footer) DocPrint(doc,"%s",footer); - if (doc->head.next!=doc) { - Fs->border_src=BDS_CONST; - DocRecalc(doc); - if (DocEd(doc,dof_flags)) { - doc_e=doc->cur_entry; - res=TRUE; - if (doc_e!=doc) { - if (DocEntryRun(doc,doc_e,TRUE,&has_action)==DOCM_CANCEL && has_action) - res=FALSE; - DocUnlock(doc); - } - } - } - doc_e=doc->head.next; - while (doc_e!=doc) { - if (doc_e->de_flags&DOCEF_REMALLOC_DATA) { - *doc_e->user_data(U8 **)=doc_e->data; - doc_e->data=NULL; - } - doc_e=doc_e->next; - } - DocDel(doc); - Fs->border_src=old_border_src; - return res; -} - -U0 DocMenuEndTaskCB() -{ - WinToTop; - throw; -} - -public I64 DocMenu(CDoc *m,I64 dof_flags=0) -{//Run menu chooser doc. Returns menu doc unlocked. - U8 *old_end_cb=Fs->task_end_cb; - Bool old_break_shift_esc=LBts(&Fs->task_flags,TASKf_BREAK_TO_SHIFT_ESC); - CDocEntry *doc_e; - I64 old_border_src=Fs->border_src,res=DOCM_CANCEL,has_action; - Fs->task_end_cb=&DocMenuEndTaskCB; - try { - if (m) { - m->desc='Menu'; - Fs->border_src=BDS_CONST; -dm_restart: - if (DocEd(m,dof_flags)) { - doc_e=m->cur_entry; - if (doc_e!=m) { - res=DocEntryRun(m,doc_e,TRUE,&has_action); - DocUnlock(m); - if (!has_action) { - res=DOCM_CANCEL; - dof_flags|=DOF_DONT_HOME; - goto dm_restart; - } - } - } - } - } catch { - if (!Fs->except_ch) { - if (!(dof_flags & DOF_INTERCEPT_TASK_END)) - Exit; - Fs->catch_except=TRUE; - } - } - LBEqu(&Fs->task_flags,TASKf_BREAK_TO_SHIFT_ESC,old_break_shift_esc); - Fs->border_src=old_border_src; - Fs->task_end_cb=old_end_cb; - return res; -} - -public I64 PopUpMenu(CDoc *doc,I64 dof_flags=0) -{//Run menu chooser doc in PopUp win task. - doc->flags|=DOCF_MIN_SIZE | DOCF_FORM; - return PopUpPrint("DocMenu(0x%X,0x%X);",doc,dof_flags); -} - -public Bool PopUpForm(U8 *_d,U8 *class_name=lastclass, - I64 dof_flags=DOF_MIN_SIZE,U8 *header=NULL,U8 *footer=NULL) -{//See $LK,"::/Demo/DolDoc/Form.CPP"$ and $LK,"::/Demo/LastClass.CPP"$. - return PopUpPrint("DocForm(0x%X,0x%X,0x%X,0x%X,0x%X);",_d,class_name, - dof_flags,header,footer); -} diff --git a/Adam/DolDoc/DocForm.HC b/Adam/DolDoc/DocForm.HC new file mode 100644 index 0000000..8cfe211 --- /dev/null +++ b/Adam/DolDoc/DocForm.HC @@ -0,0 +1,344 @@ +#help_index "DolDoc/Form" + +U0 DocFormFwd(CDoc *doc,Bool giveup=FALSE) +{ + CDocEntry *doc_e=doc->cur_entry,*doc_e2=doc_e; + if (doc->flags & DOCF_FORM) { + if (doc_e==doc) goto ff_recover; + while (!Bt(doldoc.type_flags_form,doc_e->type_u8) && + !(doc_e->de_flags&DOCEF_LINK) || + doc_e->de_flags&DOCEF_SKIP_IN_FORM) { + doc_e=doc_e->next; + if (doc_e==doc) { +ff_recover: + doc->cur_col=0; + if (!giveup) { + doc->cur_entry=doc_e->last; + DocFormBwd(doc,TRUE); + } else + doc->cur_entry=doc; + return; + } + } + } + while (doc_e->type_u8==DOCT_INDENT) + doc_e=doc_e->next; + if (doc_e!=doc_e2) { + doc->cur_col=doc_e->min_col; + doc->cur_entry=doc_e; + } +} + +U0 DocFormBwd(CDoc *doc,Bool giveup=FALSE) +{ + CDocEntry *doc_e=doc->cur_entry,*doc_e2=doc_e; + if (doc->flags & DOCF_FORM) { + while (!Bt(doldoc.type_flags_form,doc_e->type_u8) && + !(doc_e->de_flags&DOCEF_LINK) || + doc_e->de_flags&DOCEF_SKIP_IN_FORM) { + doc_e=doc_e->last; + if (doc_e==doc) { + doc->cur_col=0; + if (!giveup) { + doc->cur_entry=doc_e->next; + DocFormFwd(doc,TRUE); + } else + doc->cur_entry=doc; + return; + } + } + } + while (doc_e->type_u8==DOCT_INDENT) + doc_e=doc_e->next; + if (doc_e!=doc_e2) { + doc->cur_col=doc_e->min_col; + doc->cur_entry=doc_e; + } +} + +U0 DocDataFmt(CDoc *doc,CDocEntry *doc_e,I64 d=DOCM_CANCEL) +{ + I64 i; + U8 *ptr,*ptr2; + CHashDefineStr *temph; + if (doc_e->type_u8==DOCT_DATA && doc_e->de_flags&DOCEF_AUX_STR || + doc_e->type_u8==DOCT_CHECK_BOX || doc_e->de_flags & DOCEF_LST) { + if (d==DOCM_CANCEL) { + if (doc_e->de_flags&DOCEF_DEREF_DATA && + !(doc_e->de_flags&DOCEF_REMALLOC_DATA)) { + if (!(ptr=doc_e->data)) return; + } else + ptr=&doc_e->data; + switch (doc_e->raw_type) { + case RT_I0: + case RT_U0: d=0; break; + case RT_I8: d=*ptr(I8 *); break; + case RT_U8: d=*ptr(U8 *); break; + case RT_I16: d=*ptr(I16 *); break; + case RT_U16: d=*ptr(U16 *); break; + case RT_I32: d=*ptr(I32 *); break; + case RT_U32: d=*ptr(U32 *); break; + default: d=*ptr(I64 *); + } + } + if (doc_e->type_u8==DOCT_DATA) { + if (doc_e->de_flags & DOCEF_REMALLOC_DATA) { + ptr=MStrPrint(doc_e->aux_str,d,doc_e->my_fmt_data); + i=StrLen(ptr); + if (!doc_e->data) { + doc_e->data=CAlloc(2,doc->mem_task); + doc_e->len=MSize(doc_e->data)-2; + } + if (doc_e->len+doc_e->min_col>i) + MemCpy(doc_e->tag,ptr,i+1); + else { + ptr2=MAlloc(i+8,doc->mem_task); + doc_e->len=MSize(ptr2)-doc_e->min_col-2; //See $LK,"DataTagWidth",A="FA:::/Adam/DolDoc/DocPlain.HC,DataTagWidth"$ + MemCpy(ptr2,ptr,i+1); + Free(doc_e->tag); + doc_e->tag=ptr2; + } + Free(ptr); + } else { + StrPrint(doc_e->tag,doc_e->aux_str,d,doc_e->my_fmt_data); + i=StrLen(doc_e->tag); + } + if (doc_e->de_flags & DOCEF_HAS_TERMINATOR) { + doc_e->tag[i++]='_'; + doc_e->tag[i]=0; + } + doc_e->max_col=i; + } else if (doc_e->de_flags & DOCEF_LST) { + if (doc_e->de_flags & DOCEF_DEFINE && (temph=HashFind(doc_e->define_str, + doc->win_task->hash_table,HTT_DEFINE_STR)) && 0<=dcnt) { + ptr=MStrPrint("[%s]",temph->sub_idx[d]); + Free(doc_e->tag); + doc_e->tag=StrNew(ptr,doc->mem_task); + Free(ptr); + } else { + Free(doc_e->tag); + doc_e->tag=StrNew("[]",doc->mem_task); + } + } else { + if (d) + doc_e->de_flags|=DOCEF_CHECKED_COLLAPSED; + else + doc_e->de_flags&=~DOCEF_CHECKED_COLLAPSED; + } + } +} + +U0 DocDataScan(CDoc *doc,CDocEntry *doc_e) +{ + I64 i,d; + U8 *ptr,*ptr1,*ptr2; + CHashDefineStr *temph; + if (doc_e->type_u8==DOCT_DATA && doc_e->de_flags&DOCEF_AUX_STR || + doc_e->type_u8==DOCT_CHECK_BOX || doc_e->de_flags & DOCEF_LST) { + if (doc_e->de_flags&DOCEF_DEREF_DATA && + !(doc_e->de_flags&DOCEF_REMALLOC_DATA)) { + if (!(ptr=doc_e->data)) return; + } else + ptr=&doc_e->data; + if (doc_e->type_u8==DOCT_DATA) { + i=StrLen(doc_e->tag); + if (doc_e->de_flags & DOCEF_HAS_TERMINATOR) + doc_e->tag[--i]=0; + if (i>doc_e->len+doc_e->min_col) + doc_e->tag[doc_e->len+doc_e->min_col]=0; + if (RT_I8<=doc_e->raw_type<=RT_U32) { + StrScan(doc_e->tag,doc_e->aux_str,&d,doc_e->my_fmt_data); + if (doc_e->de_flags & DOCEF_HAS_TERMINATOR) + doc_e->tag[i]='_'; + } else if (RT_I64<=doc_e->raw_type<=RT_UF64) { + if (doc_e->de_flags & DOCEF_REMALLOC_DATA) { + ptr=MAlloc(i-doc_e->min_col+8,doc->mem_task); + MemCpy(ptr,doc_e->tag+doc_e->min_col,i-doc_e->min_col+1); + Free(doc_e->data); + doc_e->data=ptr; + doc_e->len=MSize(ptr)-1; + } else + StrScan(doc_e->tag,doc_e->aux_str,ptr,doc_e->my_fmt_data); + if (doc_e->de_flags & DOCEF_HAS_TERMINATOR) + doc_e->tag[i]='_'; + return; + } + } else if (doc_e->de_flags & DOCEF_LST) { + d=0; + if (doc_e->tag && doc_e->de_flags & DOCEF_DEFINE && + (temph=HashFind(doc_e->define_str, + doc->win_task->hash_table,HTT_DEFINE_STR))) { + ptr1=ptr2=StrNew(doc_e->tag); + if (*ptr2=='[') { + ptr2++; + i=StrLen(ptr2); + if (ptr2[i-1]==']') + ptr2[i-1]=0; + } + d=LstMatch(ptr2,temph->data); + Free(ptr1); + } + } else { + if (doc_e->de_flags & DOCEF_CHECKED_COLLAPSED) + d=TRUE; + else + d=FALSE; + } + switch (doc_e->raw_type) { + case RT_I8: + case RT_U8: + *ptr(U8 *)=d; + case RT_I0: + case RT_U0: + break; + case RT_I16: + case RT_U16: + *ptr(U16 *)=d; + break; + case RT_I32: + case RT_U32: + *ptr(U32 *)=d; + break; + default: + *ptr(I64 *)=d; + } + } +} + +#help_index "DolDoc/Input;StdIn/DolDoc" +public Bool DocForm(U8 *_d,U8 *class_name=lastclass, + I64 dof_flags=0,U8 *header=NULL,U8 *footer=NULL) +{//User input. Supply a class name that has fmtstr definitions. +//See $LK,"::/Demo/DolDoc/Form.HC"$ and $LK,"::/Demo/LastClass.HC"$. + CMemberLst *ml; + CDocEntry *doc_e; + U8 *fmtstr; + CHashClass *tempc,*tempc2; + CDoc *doc; + Bool res=FALSE; + I64 old_border_src=Fs->border_src,has_action; + if (!(tempc=HashFind(class_name,Fs->hash_table,HTT_CLASS))) + return FALSE; + doc=DocNew; + doc->desc='Form'; + if (header) DocPrint(doc,"%s",header); + doc->flags|=DOCF_OVERSTRIKE|DOCF_FORM; + if (dof_flags&DOF_MIN_SIZE) + doc->flags|=DOCF_MIN_SIZE; + ml=tempc->member_lst_and_root; + while (ml) { + if ((fmtstr=MemberMetaData("fmtstr",ml)) && + (doc_e=DocPrint(doc,"%s",fmtstr))) { + tempc2=ml->member_class; + if ((doc_e->type_u8==DOCT_DATA || doc_e->type_u8==DOCT_LST || + doc_e->type_u8==DOCT_CHECK_BOX) && !tempc2->ptr_stars_cnt) { + tempc2=OptClassFwd(tempc2); + tempc2-=tempc2->ptr_stars_cnt; + if (tempc2->type & HTT_INTERNAL_TYPE) { + if (ml->dim.next) { //Array + if (tempc2->raw_type==RT_U8 && + LBtr(&doc_e->de_flags,&DOCEf_DFT_LEN)) { + doc_e->len=ml->dim.total_cnt; + if (doc_e->de_flags&DOCEF_HAS_TERMINATOR) + doc_e->len--; + Free(doc_e->tag); //See $LK,"DataTagWidth",A="FA:::/Adam/DolDoc/DocPlain.HC,DataTagWidth"$ + doc_e->tag=MAlloc(doc_e->len+doc_e->min_col+2, + doc->mem_task); //+2 because "_\0" + } + } else if (LBtr(&doc_e->de_flags,DOCEf_DFT_RAW_TYPE)) + doc_e->raw_type=tempc2->raw_type; + } + } + if (doc_e->de_flags&DOCEF_REMALLOC_DATA) { + doc_e->user_data=_d+ml->offset; + doc_e->data=*doc_e->user_data(U8 **); + } else + doc_e->data=_d+ml->offset; + doc_e->my_fmt_data=MemberMetaData("fmtdata",ml); + DocDataFmt(doc,doc_e); + } + ml=ml->next; + } + if (footer) DocPrint(doc,"%s",footer); + if (doc->head.next!=doc) { + Fs->border_src=BDS_CONST; + DocRecalc(doc); + if (DocEd(doc,dof_flags)) { + doc_e=doc->cur_entry; + res=TRUE; + if (doc_e!=doc) { + if (DocEntryRun(doc,doc_e,TRUE,&has_action)==DOCM_CANCEL && has_action) + res=FALSE; + DocUnlock(doc); + } + } + } + doc_e=doc->head.next; + while (doc_e!=doc) { + if (doc_e->de_flags&DOCEF_REMALLOC_DATA) { + *doc_e->user_data(U8 **)=doc_e->data; + doc_e->data=NULL; + } + doc_e=doc_e->next; + } + DocDel(doc); + Fs->border_src=old_border_src; + return res; +} + +U0 DocMenuEndTaskCB() +{ + WinToTop; + throw; +} + +public I64 DocMenu(CDoc *m,I64 dof_flags=0) +{//Run menu chooser doc. Returns menu doc unlocked. + U8 *old_end_cb=Fs->task_end_cb; + Bool old_break_shift_esc=LBts(&Fs->task_flags,TASKf_BREAK_TO_SHIFT_ESC); + CDocEntry *doc_e; + I64 old_border_src=Fs->border_src,res=DOCM_CANCEL,has_action; + Fs->task_end_cb=&DocMenuEndTaskCB; + try { + if (m) { + m->desc='Menu'; + Fs->border_src=BDS_CONST; +dm_restart: + if (DocEd(m,dof_flags)) { + doc_e=m->cur_entry; + if (doc_e!=m) { + res=DocEntryRun(m,doc_e,TRUE,&has_action); + DocUnlock(m); + if (!has_action) { + res=DOCM_CANCEL; + dof_flags|=DOF_DONT_HOME; + goto dm_restart; + } + } + } + } + } catch { + if (!Fs->except_ch) { + if (!(dof_flags & DOF_INTERCEPT_TASK_END)) + Exit; + Fs->catch_except=TRUE; + } + } + LBEqu(&Fs->task_flags,TASKf_BREAK_TO_SHIFT_ESC,old_break_shift_esc); + Fs->border_src=old_border_src; + Fs->task_end_cb=old_end_cb; + return res; +} + +public I64 PopUpMenu(CDoc *doc,I64 dof_flags=0) +{//Run menu chooser doc in PopUp win task. + doc->flags|=DOCF_MIN_SIZE | DOCF_FORM; + return PopUpPrint("DocMenu(0x%X,0x%X);",doc,dof_flags); +} + +public Bool PopUpForm(U8 *_d,U8 *class_name=lastclass, + I64 dof_flags=DOF_MIN_SIZE,U8 *header=NULL,U8 *footer=NULL) +{//See $LK,"::/Demo/DolDoc/Form.HC"$ and $LK,"::/Demo/LastClass.HC"$. + return PopUpPrint("DocForm(0x%X,0x%X,0x%X,0x%X,0x%X);",_d,class_name, + dof_flags,header,footer); +} diff --git a/Adam/DolDoc/DocGet.CPP b/Adam/DolDoc/DocGet.HC similarity index 100% rename from Adam/DolDoc/DocGet.CPP rename to Adam/DolDoc/DocGet.HC diff --git a/Adam/DolDoc/DocGr.CPP b/Adam/DolDoc/DocGr.HC similarity index 100% rename from Adam/DolDoc/DocGr.CPP rename to Adam/DolDoc/DocGr.HC diff --git a/Adam/DolDoc/DocHighlight.CPP b/Adam/DolDoc/DocHighlight.CPP deleted file mode 100644 index ffa58bd..0000000 --- a/Adam/DolDoc/DocHighlight.CPP +++ /dev/null @@ -1,155 +0,0 @@ -#help_index "DolDoc/Misc" - -U32 *DocHighlight(CDocEntry *doc_e,U8 *src,I64 len,I64 _temp_u32_attr) -{//Be aware of $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.CPP"$. - U32 *res=MAlloc((len+1)*sizeof(U32)),*dst=res; - U8 *ptr; - CDocSettings *s=&doc_e->settings; - I64 ch,ch1,last_ch,temp_u32_attr,mask_temp_u32_attr=_temp_u32_attr&0xFFFFF000, - comment_depth,brace_depth=s->brace_depth,paren_depth=s->paren_depth; - CHash *temph; - switch [s->state] { - case DOCSS_NORMAL: -hl_normal: - while (len) { - while (len && !Bt(chars_bmp_alpha_numeric,*src)) { - temp_u32_attr=_temp_u32_attr; - ch1=*src++; - switch (ch1) { - case '/': - if (len>=2) { - if (*src=='/') { - temp_u32_attr=DOC_COLOR_COMMENT<<8|mask_temp_u32_attr; - *dst++=ch1+temp_u32_attr; - *dst++=*src++ +temp_u32_attr; - len-=2; - goto hl_cpp_comment; - } else if (*src=='*') { - temp_u32_attr=DOC_COLOR_COMMENT<<8|mask_temp_u32_attr; - *dst++=ch1+temp_u32_attr; - *dst++=*src++ +temp_u32_attr; - len-=2; - comment_depth=1; - goto hl_comment; - } - } - break; - case '\'': - temp_u32_attr=DOC_COLOR_QUOTE<<8|mask_temp_u32_attr; - *dst++=ch1+temp_u32_attr; - len--; - goto hl_single_quote; - case '\"': - temp_u32_attr=DOC_COLOR_QUOTE<<8|mask_temp_u32_attr; - *dst++=ch1+temp_u32_attr; - len--; - goto hl_dbl_quote; - case '(': - if (paren_depth++&1) - temp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_temp_u32_attr; - break; - case ')': - if (--paren_depth&1) - temp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_temp_u32_attr; - break; - case '{': - if (brace_depth++&1) - temp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_temp_u32_attr; - break; - case '}': - if (--brace_depth&1) - temp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_temp_u32_attr; - break; - } - *dst++=ch1+temp_u32_attr; - if (!--len) goto hl_normal_done; - } - ptr=src; - while (len && Bt(chars_bmp_alpha_numeric,*src)) { - src++; - len--; - } - ch=*src; - *src=0; - if (temph=HashFind(ptr,cmp.asm_hash, - HTT_KEYWORD|HTT_ASM_KEYWORD|HTT_OPCODE|HTT_REG)) { - if (temph->type&(HTT_KEYWORD|HTT_ASM_KEYWORD|HTT_OPCODE)) - temp_u32_attr=DOC_COLOR_KEYWORD<<8|mask_temp_u32_attr; - else - temp_u32_attr=DOC_COLOR_KEYWORD2<<8|mask_temp_u32_attr; - } else - temp_u32_attr=_temp_u32_attr; - while (ch1=*ptr++) - *dst++=ch1+temp_u32_attr; - *src=ch; - } -hl_normal_done: - s->state=DOCSS_NORMAL; - s->comment_depth=0; - break; - case DOCSS_SINGLE_QUOTE: - temp_u32_attr=DOC_COLOR_QUOTE<<8|mask_temp_u32_attr; -hl_single_quote: - last_ch=0; - while (len--) { - ch1=*src++; - *dst++=ch1+temp_u32_attr; - if (last_ch!='\\' && ch1=='\'') - goto hl_normal; - if (last_ch=='\\' && ch1=='\\') - last_ch=0; - else - last_ch=ch1; - } - s->state=DOCSS_SINGLE_QUOTE; - s->comment_depth=0; - break; - case DOCSS_DBL_QUOTE: - temp_u32_attr=DOC_COLOR_QUOTE<<8|mask_temp_u32_attr; -hl_dbl_quote: - last_ch=0; - while (len--) { - ch1=*src++; - *dst++=ch1+temp_u32_attr; - if (last_ch!='\\' && ch1=='\"') - goto hl_normal; - if (last_ch=='\\' && ch1=='\\') - last_ch=0; - else - last_ch=ch1; - } - s->state=DOCSS_DBL_QUOTE; - s->comment_depth=0; - break; - case DOCSS_COMMENT: - temp_u32_attr=DOC_COLOR_COMMENT<<8|mask_temp_u32_attr; - comment_depth=s->comment_depth; -hl_comment: - last_ch=0; - while (len--) { - ch1=*src++; - *dst++=ch1+temp_u32_attr; - if (last_ch=='*' && ch1=='/') { - if (!--comment_depth) - goto hl_normal; - } else if (last_ch=='/' && ch1=='*') - comment_depth++; - last_ch=ch1; - } - s->state=DOCSS_COMMENT; - s->comment_depth=comment_depth; - break; - case DOCSS_CPP_Z_COMMENT: - temp_u32_attr=DOC_COLOR_COMMENT<<8|mask_temp_u32_attr; -hl_cpp_comment: - while (len--) - *dst++=*src++ +temp_u32_attr; - s->state=DOCSS_CPP_Z_COMMENT; - s->comment_depth=0; - break; - } - s->paren_depth=paren_depth; - s->brace_depth=brace_depth; - *dst=0; - return res; -} diff --git a/Adam/DolDoc/DocHighlight.HC b/Adam/DolDoc/DocHighlight.HC new file mode 100644 index 0000000..42560f5 --- /dev/null +++ b/Adam/DolDoc/DocHighlight.HC @@ -0,0 +1,155 @@ +#help_index "DolDoc/Misc" + +U32 *DocHighlight(CDocEntry *doc_e,U8 *src,I64 len,I64 _temp_u32_attr) +{//Be aware of $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$. + U32 *res=MAlloc((len+1)*sizeof(U32)),*dst=res; + U8 *ptr; + CDocSettings *s=&doc_e->settings; + I64 ch,ch1,last_ch,temp_u32_attr,mask_temp_u32_attr=_temp_u32_attr&0xFFFFF000, + comment_depth,brace_depth=s->brace_depth,paren_depth=s->paren_depth; + CHash *temph; + switch [s->state] { + case DOCSS_NORMAL: +hl_normal: + while (len) { + while (len && !Bt(chars_bmp_alpha_numeric,*src)) { + temp_u32_attr=_temp_u32_attr; + ch1=*src++; + switch (ch1) { + case '/': + if (len>=2) { + if (*src=='/') { + temp_u32_attr=DOC_COLOR_COMMENT<<8|mask_temp_u32_attr; + *dst++=ch1+temp_u32_attr; + *dst++=*src++ +temp_u32_attr; + len-=2; + goto hl_cpp_comment; + } else if (*src=='*') { + temp_u32_attr=DOC_COLOR_COMMENT<<8|mask_temp_u32_attr; + *dst++=ch1+temp_u32_attr; + *dst++=*src++ +temp_u32_attr; + len-=2; + comment_depth=1; + goto hl_comment; + } + } + break; + case '\'': + temp_u32_attr=DOC_COLOR_QUOTE<<8|mask_temp_u32_attr; + *dst++=ch1+temp_u32_attr; + len--; + goto hl_single_quote; + case '\"': + temp_u32_attr=DOC_COLOR_QUOTE<<8|mask_temp_u32_attr; + *dst++=ch1+temp_u32_attr; + len--; + goto hl_dbl_quote; + case '(': + if (paren_depth++&1) + temp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_temp_u32_attr; + break; + case ')': + if (--paren_depth&1) + temp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_temp_u32_attr; + break; + case '{': + if (brace_depth++&1) + temp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_temp_u32_attr; + break; + case '}': + if (--brace_depth&1) + temp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_temp_u32_attr; + break; + } + *dst++=ch1+temp_u32_attr; + if (!--len) goto hl_normal_done; + } + ptr=src; + while (len && Bt(chars_bmp_alpha_numeric,*src)) { + src++; + len--; + } + ch=*src; + *src=0; + if (temph=HashFind(ptr,cmp.asm_hash, + HTT_KEYWORD|HTT_ASM_KEYWORD|HTT_OPCODE|HTT_REG)) { + if (temph->type&(HTT_KEYWORD|HTT_ASM_KEYWORD|HTT_OPCODE)) + temp_u32_attr=DOC_COLOR_KEYWORD<<8|mask_temp_u32_attr; + else + temp_u32_attr=DOC_COLOR_KEYWORD2<<8|mask_temp_u32_attr; + } else + temp_u32_attr=_temp_u32_attr; + while (ch1=*ptr++) + *dst++=ch1+temp_u32_attr; + *src=ch; + } +hl_normal_done: + s->state=DOCSS_NORMAL; + s->comment_depth=0; + break; + case DOCSS_SINGLE_QUOTE: + temp_u32_attr=DOC_COLOR_QUOTE<<8|mask_temp_u32_attr; +hl_single_quote: + last_ch=0; + while (len--) { + ch1=*src++; + *dst++=ch1+temp_u32_attr; + if (last_ch!='\\' && ch1=='\'') + goto hl_normal; + if (last_ch=='\\' && ch1=='\\') + last_ch=0; + else + last_ch=ch1; + } + s->state=DOCSS_SINGLE_QUOTE; + s->comment_depth=0; + break; + case DOCSS_DBL_QUOTE: + temp_u32_attr=DOC_COLOR_QUOTE<<8|mask_temp_u32_attr; +hl_dbl_quote: + last_ch=0; + while (len--) { + ch1=*src++; + *dst++=ch1+temp_u32_attr; + if (last_ch!='\\' && ch1=='\"') + goto hl_normal; + if (last_ch=='\\' && ch1=='\\') + last_ch=0; + else + last_ch=ch1; + } + s->state=DOCSS_DBL_QUOTE; + s->comment_depth=0; + break; + case DOCSS_COMMENT: + temp_u32_attr=DOC_COLOR_COMMENT<<8|mask_temp_u32_attr; + comment_depth=s->comment_depth; +hl_comment: + last_ch=0; + while (len--) { + ch1=*src++; + *dst++=ch1+temp_u32_attr; + if (last_ch=='*' && ch1=='/') { + if (!--comment_depth) + goto hl_normal; + } else if (last_ch=='/' && ch1=='*') + comment_depth++; + last_ch=ch1; + } + s->state=DOCSS_COMMENT; + s->comment_depth=comment_depth; + break; + case DOCSS_CPP_Z_COMMENT: + temp_u32_attr=DOC_COLOR_COMMENT<<8|mask_temp_u32_attr; +hl_cpp_comment: + while (len--) + *dst++=*src++ +temp_u32_attr; + s->state=DOCSS_CPP_Z_COMMENT; + s->comment_depth=0; + break; + } + s->paren_depth=paren_depth; + s->brace_depth=brace_depth; + *dst=0; + return res; +} diff --git a/Adam/DolDoc/DocInit.CPP b/Adam/DolDoc/DocInit.HC similarity index 100% rename from Adam/DolDoc/DocInit.CPP rename to Adam/DolDoc/DocInit.HC diff --git a/Adam/DolDoc/DocLink.CPP b/Adam/DolDoc/DocLink.HC similarity index 100% rename from Adam/DolDoc/DocLink.CPP rename to Adam/DolDoc/DocLink.HC diff --git a/Adam/DolDoc/DocMacro.CPP b/Adam/DolDoc/DocMacro.HC similarity index 100% rename from Adam/DolDoc/DocMacro.CPP rename to Adam/DolDoc/DocMacro.HC diff --git a/Adam/DolDoc/DocNew.CPP b/Adam/DolDoc/DocNew.CPP deleted file mode 100644 index 4447beb..0000000 --- a/Adam/DolDoc/DocNew.CPP +++ /dev/null @@ -1,385 +0,0 @@ -#help_index "DolDoc" - -public Bool DocLock(CDoc *doc) -{//Make this task have exclusive access to this doc. - if (!Bt(&doc->locked_flags,DOClf_LOCKED) || doc->owning_task!=Fs) { - while (LBts(&doc->locked_flags,DOClf_LOCKED)) - Yield; - if (doc->owning_task!=Fs) - LBEqu(&doc->flags,DOCf_BREAK_UNLOCKED,BreakLock(Fs)); - doc->owning_task=Fs; - return TRUE; - } else - return FALSE; -} - -public Bool DocUnlock(CDoc *doc) -{//Release exclusive lock on access to doc. - Bool unlock_break; - if (Bt(&doc->locked_flags,DOClf_LOCKED) && doc->owning_task==Fs) { - doc->owning_task=0; - unlock_break=Bt(&doc->flags,DOCf_BREAK_UNLOCKED); - LBtr(&doc->locked_flags,DOClf_LOCKED); - if (unlock_break) - BreakUnlock(Fs); - return TRUE; - } else - return FALSE; -} - -Bool IsEditableText(CDocEntry *doc_e) -{ - if (doc_e->type_u8==DOCT_TEXT&&!(doc_e->de_flags&DOCEG_DONT_EDIT)) - return TRUE; - else - return FALSE; -} - -CDocEntry *DocEntryNewBase(CDoc *doc,I64 type,I64 de_flags=0, - I64 x=0,I64 y=0,I64 page_line_num=0) -{//See also $LK,"MAllocIdent",A="FF:::/Adam/DolDoc/DocRecalc.CPP,MAllocIdent"$ and $MA-X+PU,"CDocEntry",LM="F(\"sizeof(CDocEntry)\");View;"$. - CDocEntry *res=CAlloc(sizeof(CDocEntryBase),doc->mem_task); - res->type=type; - res->de_flags=de_flags|doldoc.dft_de_flags[type.u8[0]]; - res->x=x; - res->y=y; - res->page_line_num=page_line_num; - return res; -} - -CDocEntry *DocEntryNewTag(CDoc *doc,CDocEntry *doc_ce,U8 *tag) -{ - I64 l=StrLen(tag); - CDocEntry *res=DocEntryNewBase(doc,doc_ce->type,doc_ce->de_flags, - doc_ce->x,doc_ce->y,doc_ce->page_line_num); - res->de_flags=doc_ce->de_flags; //Override - res->max_col=l; - res->tag=MAlloc(l+1,doc->mem_task); - MemCpy(res->tag,tag,l+1); - MemCpy(&res->settings,&doc_ce->settings,sizeof(CDocSettings)); - return res; -} - -public U0 DocEntryDel(CDoc *doc,CDocEntry *doc_e) -{//Free entry and all parts of entry. - if (!doc || doc==doc_e) - RawPrint(3000,"DocEntryDel"); - else { - if (doc->cur_entry==doc_e) - doc->cur_entry=doc_e->next; - QueRem(doc_e); - if (doc_e->de_flags & DOCEF_TAG) - Free(doc_e->tag); - if (doc_e->de_flags & DOCEF_AUX_STR) - Free(doc_e->aux_str); - if (doc_e->de_flags & DOCEF_DEFINE) - Free(doc_e->define_str); - if (doc_e->de_flags & DOCEF_HTML_LINK) - Free(doc_e->html_link); - if (doc_e->de_flags & DOCEF_LEFT_MACRO) - Free(doc_e->left_macro); - if (doc_e->de_flags & DOCEF_RIGHT_MACRO) - Free(doc_e->right_macro); - if (doc_e->de_flags & DOCEF_BIN_PTR_LINK) - Free(doc_e->bin_ptr_link); - if (doc_e->de_flags & DOCEF_HAS_BIN) - DocBinDel(doc,doc_e->bin_data); - if (doc_e->de_flags & DOCEF_REMALLOC_DATA) - Free(doc_e->data); - Free(doc_e); - } -} - -public I64 DocEntrySize(CDoc *,CDocEntry *doc_e) -{//Mem size of entry and all parts. - I64 res; - if (!doc_e) return 0; - res=MSize2(doc_e); - if (doc_e->de_flags & DOCEF_TAG) - res+=MSize2(doc_e->tag); - if (doc_e->de_flags & DOCEF_AUX_STR) - res+=MSize2(doc_e->aux_str); - if (doc_e->de_flags & DOCEF_DEFINE) - res+=MSize2(doc_e->define_str); - if (doc_e->de_flags & DOCEF_HTML_LINK) - res+=MSize2(doc_e->html_link); - if (doc_e->de_flags & DOCEF_LEFT_MACRO) - res+=MSize2(doc_e->left_macro); - if (doc_e->de_flags & DOCEF_RIGHT_MACRO) - res+=MSize2(doc_e->right_macro); - if (doc_e->de_flags & DOCEF_BIN_PTR_LINK) - res+=MSize2(doc_e->bin_ptr_link); - if (doc_e->de_flags & DOCEF_REMALLOC_DATA) - res+=MSize2(doc_e->data); - return res; -} - -U0 DocUndoDel(CDoc *,CDocUndo *u) -{ - Free(u->body); - Free(u); -} - -U0 DocUndoCntSet(CDoc *doc) -{ - Bool unlock=DocLock(doc); - CDocUndo *u=doc->undo_head.next; - doc->undo_cnt=0; - while (u!=&doc->undo_head) { - doc->undo_cnt++; - u=u->next; - } - if (unlock) - DocUnlock(doc); -} - -public CDocEntry *DocEntryCopy(CDoc *doc,CDocEntry *doc_e) -{//Make copy of entry and all parts of entry. - CDocEntry *doc_ne; - CDocBin *tempb; - CTask *task=doc->mem_task; - doc_ne=MAllocIdent(doc_e,task); - doc_ne->next=doc_ne; - doc_ne->last=doc_ne; - if (doc_e->de_flags & DOCEF_TAG) - doc_ne->tag=MAllocIdent(doc_e->tag,task); - if (doc_e->de_flags & DOCEF_AUX_STR) - doc_ne->aux_str=MAllocIdent(doc_e->aux_str,task); - if (doc_e->de_flags & DOCEF_DEFINE) - doc_ne->define_str=MAllocIdent(doc_e->define_str,task); - if (doc_e->de_flags & DOCEF_HTML_LINK) - doc_ne->html_link=MAllocIdent(doc_e->html_link,task); - if (doc_e->de_flags & DOCEF_LEFT_MACRO) - doc_ne->left_macro=MAllocIdent(doc_e->left_macro,task); - if (doc_e->de_flags & DOCEF_RIGHT_MACRO) - doc_ne->right_macro=MAllocIdent(doc_e->right_macro,task); - if (doc_e->de_flags & DOCEF_BIN_PTR_LINK) - doc_ne->bin_ptr_link=MAllocIdent(doc_e->bin_ptr_link,task); - if (doc_e->de_flags & DOCEF_HAS_BIN) { - tempb=MAllocIdent(doc_e->bin_data,task); - tempb->data=MAllocIdent(doc_e->bin_data->data,task); - doc_ne->bin_num=doc->cur_bin_num; - tempb->num=doc->cur_bin_num++; - doc_ne->bin_data=tempb; - if (doc_e->de_flags&DOCEF_TAG && doc_e->tag && *doc_e->tag) - tempb->tag=StrNew(doc_e->tag,task); - else - tempb->tag=NULL; - QueIns(tempb,doc->bin_head.last); - } - if (doc_e->de_flags & DOCEF_REMALLOC_DATA) - doc_ne->data=MAllocIdent(doc_e->data,task); - return doc_ne; -} - -U0 DocRemSoftNewLines(CDoc *doc=NULL,CDocEntry *doc_e=NULL) -{ - CDocEntry *doc_e2,*saved_ll=doc_e; - Bool unlock; - if (!doc && !(doc=DocPut)) - return; - unlock=DocLock(doc); - if (!doc_e) doc_e=doc->head.next; - while (doc_e!=doc) { - doc_e2=doc_e->next; - if (doc_e->type_u8==DOCT_SOFT_NEW_LINE) { - if (doc->cur_entry==doc_e) { - doc->cur_entry=doc_e2; - doc->cur_col=doc->cur_entry->min_col; - } - DocEntryDel(doc,doc_e); - } else if (saved_ll && doc_e->type_u8==DOCT_NEW_LINE) - break; - doc_e=doc_e2; - } - if (unlock) - DocUnlock(doc); -} - -public U0 DocInsEntry(CDoc *doc,CDocEntry *doc_e) -{//Insert entry into doc, updating its vals. - U8 *dst; - Bool unlock=DocLock(doc); - CDocEntry *doc_ce=doc->cur_entry,*doc_ne; - - doc_e->x=doc_ce->x; - doc_e->y=doc_ce->y; - doc_e->page_line_num=doc_ce->page_line_num; - MemCpy(&doc_e->settings,&doc_ce->settings,sizeof(CDocSettings)); - if (doc->cur_col>0 && - doc_ce->type_u8==DOCT_TEXT && - !(doc_ce->de_flags&(DOCEF_TAG_CB|DOCEF_DEFINE|DOCEF_AUX_STR| - DOCEF_HTML_LINK|DOCEF_BIN_PTR_LINK)) && - doc->cur_colmax_col) { - dst=doc_ce->tag+doc->cur_col; - doc_ne=DocEntryNewTag(doc,doc_ce,dst); - *dst=0; - doc_ne->type=DOCT_TEXT|doc_ce->type&0xFFFFFF00; - doc_ce->max_col=doc->cur_col; - QueIns(doc_ne,doc_ce); - doc->cur_col=0; - doc_ce=doc_ne; - } - if (doc_ce->type_u8==DOCT_TEXT && doc->cur_col>=doc_ce->max_col) { - QueIns(doc_e,doc_ce); - doc->cur_entry=doc_e->next; - } else { - QueIns(doc_e,doc_ce->last); - doc->cur_entry=doc_ce; - } - doc->cur_col=doc->cur_entry->min_col; - DocRemSoftNewLines(doc,doc->cur_entry); - if (unlock) - DocUnlock(doc); -} - -public U0 DocRst(CDoc *doc,Bool is_old) -{//Del all entries and set doc to dfts. - Bool unlock; - CDocEntry *doc_e,*doc_e2; - CDocUndo *u,*u8; - CDocSettings *s; - CDocBin *b,*b1; - if (!doc && !(doc=DocPut)) - return; - unlock=DocLock(doc); - if (is_old) { - doc_e=doc->head.next; - while (doc_e!=doc) { - doc_e2=doc_e->next; - DocEntryDel(doc,doc_e); - doc_e=doc_e2; - } - u=doc->undo_head.next; - while (u!=&doc->undo_head) { - u8=u->next; - DocUndoDel(doc,u); - u=u8; - } - b=doc->bin_head.next; - while (b!=&doc->bin_head) { - b1=b->next; - QueRem(b); - Free(b->data); - Free(b); - b=b1; - } - } -//Check $LK,"DocInsDoc",A="MN:DocInsDoc"$ - doc->flags&=DOCF_BREAK_UNLOCKED; - doc->head.next=doc->head.last=doc; - QueInit(&doc->bin_head); - QueInit(&doc->undo_head); - doc->undo_head.time_stamp=0; - doc->undo_cnt=0; - doc->cur_bin_num=1; - doc->dollar_buf_ptr=0; - doc->cmd_U8=CH_SPACE; - doc->page_line_num=0; - doc->best_d=MAX_I64; - - s=&doc->settings_head; - s->left_margin=DOC_DFT; - s->right_margin=DOC_DFT; - s->indent=0; - s->page_len=66; - s->header=DOC_DFT; - s->footer=DOC_DFT; - s->state=DOCSS_NORMAL; - s->comment_depth=0; - s->paren_depth=0; - s->brace_depth=0; - s->shifted_x=0; - s->shifted_y=0; - s->cur_text_attr=s->dft_text_attr=DOC_ATTR_DFT_TEXT; - - doc_e=&doc->head; - doc_e->type=DOCT_ERROR; - doc_e->de_flags=0; - doc_e->x=0; - doc_e->y=0; - doc_e->min_col=0; - doc_e->max_col=0; - doc_e->page_line_num=doc->page_line_num; - MemCpy(&doc_e->settings,s,sizeof(CDocSettings)); - - DocTop(doc); - if (unlock) - DocUnlock(doc); -} - -public U0 DocDel(CDoc *doc) -{//Free entire doc and entries. - if (!doc || doc->doc_signature!=DOC_SIGNATURE_VAL) return; - DocLock(doc); - doc->doc_signature=0; - DocRst(doc,TRUE); - Free(doc->find_replace); - Free(doc->dollar_buf); - DocUnlock(doc); - Free(doc); -} - -public I64 DocSize(CDoc *doc) -{//Mem size of doc and all its entries. - Bool unlock; - CDocEntry *doc_e; - CDocUndo *u; - CDocBin *b; - I64 res=0; - - if (!doc || doc->doc_signature!=DOC_SIGNATURE_VAL) return 0; - unlock=DocLock(doc); - - doc_e=doc->head.next; - while (doc_e!=doc) { - res+=DocEntrySize(doc,doc_e); - doc_e=doc_e->next; - } - - u=doc->undo_head.next; - while (u!=&doc->undo_head) { - res+=MSize2(u->body); - res+=MSize2(u); - u=u->next; - } - - b=doc->bin_head.next; - while (b!=&doc->bin_head) { - res+=MSize2(b->data); - res+=MSize2(b); - b=b->next; - } - - res+=MSize2(doc->find_replace); - res+=MSize2(doc->dollar_buf); - res+=MSize2(doc); - if (unlock) - DocUnlock(doc); - return res; -} - -#help_index "DolDoc" -public CDoc *DocNew(U8 *filename=NULL,CTask *task=NULL) -{//MAlloc new $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$. (Begin a new doc.) - CDoc *doc; - if (!task) task=Fs; - doc=CAlloc(sizeof(CDoc),task); - if (filename) - StrCpy(doc->filename.name,filename); - else - StrCpy(doc->filename.name,blkdev.temp_filename); - doc->find_replace=CAlloc(sizeof(CEdFindText),task); - doc->find_replace->scan_fwd=TRUE; - doc->find_replace->match_case=TRUE; - doc->find_replace->pmt=TRUE; - doc->left_click_link=&EdLeftClickLink; - doc->dollar_buf_size=84; - doc->dollar_buf=MAlloc(doc->dollar_buf_size,task); - doc->max_entries=MAX_I64; - doc->win_task=task; - doc->mem_task=task; - DocRst(doc,FALSE); - doc->doc_signature=DOC_SIGNATURE_VAL; - return doc; -} diff --git a/Adam/DolDoc/DocNew.HC b/Adam/DolDoc/DocNew.HC new file mode 100644 index 0000000..9401520 --- /dev/null +++ b/Adam/DolDoc/DocNew.HC @@ -0,0 +1,385 @@ +#help_index "DolDoc" + +public Bool DocLock(CDoc *doc) +{//Make this task have exclusive access to this doc. + if (!Bt(&doc->locked_flags,DOClf_LOCKED) || doc->owning_task!=Fs) { + while (LBts(&doc->locked_flags,DOClf_LOCKED)) + Yield; + if (doc->owning_task!=Fs) + LBEqu(&doc->flags,DOCf_BREAK_UNLOCKED,BreakLock(Fs)); + doc->owning_task=Fs; + return TRUE; + } else + return FALSE; +} + +public Bool DocUnlock(CDoc *doc) +{//Release exclusive lock on access to doc. + Bool unlock_break; + if (Bt(&doc->locked_flags,DOClf_LOCKED) && doc->owning_task==Fs) { + doc->owning_task=0; + unlock_break=Bt(&doc->flags,DOCf_BREAK_UNLOCKED); + LBtr(&doc->locked_flags,DOClf_LOCKED); + if (unlock_break) + BreakUnlock(Fs); + return TRUE; + } else + return FALSE; +} + +Bool IsEditableText(CDocEntry *doc_e) +{ + if (doc_e->type_u8==DOCT_TEXT&&!(doc_e->de_flags&DOCEG_DONT_EDIT)) + return TRUE; + else + return FALSE; +} + +CDocEntry *DocEntryNewBase(CDoc *doc,I64 type,I64 de_flags=0, + I64 x=0,I64 y=0,I64 page_line_num=0) +{//See also $LK,"MAllocIdent",A="FF:::/Adam/DolDoc/DocRecalc.HC,MAllocIdent"$ and $MA-X+PU,"CDocEntry",LM="F(\"sizeof(CDocEntry)\");View;"$. + CDocEntry *res=CAlloc(sizeof(CDocEntryBase),doc->mem_task); + res->type=type; + res->de_flags=de_flags|doldoc.dft_de_flags[type.u8[0]]; + res->x=x; + res->y=y; + res->page_line_num=page_line_num; + return res; +} + +CDocEntry *DocEntryNewTag(CDoc *doc,CDocEntry *doc_ce,U8 *tag) +{ + I64 l=StrLen(tag); + CDocEntry *res=DocEntryNewBase(doc,doc_ce->type,doc_ce->de_flags, + doc_ce->x,doc_ce->y,doc_ce->page_line_num); + res->de_flags=doc_ce->de_flags; //Override + res->max_col=l; + res->tag=MAlloc(l+1,doc->mem_task); + MemCpy(res->tag,tag,l+1); + MemCpy(&res->settings,&doc_ce->settings,sizeof(CDocSettings)); + return res; +} + +public U0 DocEntryDel(CDoc *doc,CDocEntry *doc_e) +{//Free entry and all parts of entry. + if (!doc || doc==doc_e) + RawPrint(3000,"DocEntryDel"); + else { + if (doc->cur_entry==doc_e) + doc->cur_entry=doc_e->next; + QueRem(doc_e); + if (doc_e->de_flags & DOCEF_TAG) + Free(doc_e->tag); + if (doc_e->de_flags & DOCEF_AUX_STR) + Free(doc_e->aux_str); + if (doc_e->de_flags & DOCEF_DEFINE) + Free(doc_e->define_str); + if (doc_e->de_flags & DOCEF_HTML_LINK) + Free(doc_e->html_link); + if (doc_e->de_flags & DOCEF_LEFT_MACRO) + Free(doc_e->left_macro); + if (doc_e->de_flags & DOCEF_RIGHT_MACRO) + Free(doc_e->right_macro); + if (doc_e->de_flags & DOCEF_BIN_PTR_LINK) + Free(doc_e->bin_ptr_link); + if (doc_e->de_flags & DOCEF_HAS_BIN) + DocBinDel(doc,doc_e->bin_data); + if (doc_e->de_flags & DOCEF_REMALLOC_DATA) + Free(doc_e->data); + Free(doc_e); + } +} + +public I64 DocEntrySize(CDoc *,CDocEntry *doc_e) +{//Mem size of entry and all parts. + I64 res; + if (!doc_e) return 0; + res=MSize2(doc_e); + if (doc_e->de_flags & DOCEF_TAG) + res+=MSize2(doc_e->tag); + if (doc_e->de_flags & DOCEF_AUX_STR) + res+=MSize2(doc_e->aux_str); + if (doc_e->de_flags & DOCEF_DEFINE) + res+=MSize2(doc_e->define_str); + if (doc_e->de_flags & DOCEF_HTML_LINK) + res+=MSize2(doc_e->html_link); + if (doc_e->de_flags & DOCEF_LEFT_MACRO) + res+=MSize2(doc_e->left_macro); + if (doc_e->de_flags & DOCEF_RIGHT_MACRO) + res+=MSize2(doc_e->right_macro); + if (doc_e->de_flags & DOCEF_BIN_PTR_LINK) + res+=MSize2(doc_e->bin_ptr_link); + if (doc_e->de_flags & DOCEF_REMALLOC_DATA) + res+=MSize2(doc_e->data); + return res; +} + +U0 DocUndoDel(CDoc *,CDocUndo *u) +{ + Free(u->body); + Free(u); +} + +U0 DocUndoCntSet(CDoc *doc) +{ + Bool unlock=DocLock(doc); + CDocUndo *u=doc->undo_head.next; + doc->undo_cnt=0; + while (u!=&doc->undo_head) { + doc->undo_cnt++; + u=u->next; + } + if (unlock) + DocUnlock(doc); +} + +public CDocEntry *DocEntryCopy(CDoc *doc,CDocEntry *doc_e) +{//Make copy of entry and all parts of entry. + CDocEntry *doc_ne; + CDocBin *tempb; + CTask *task=doc->mem_task; + doc_ne=MAllocIdent(doc_e,task); + doc_ne->next=doc_ne; + doc_ne->last=doc_ne; + if (doc_e->de_flags & DOCEF_TAG) + doc_ne->tag=MAllocIdent(doc_e->tag,task); + if (doc_e->de_flags & DOCEF_AUX_STR) + doc_ne->aux_str=MAllocIdent(doc_e->aux_str,task); + if (doc_e->de_flags & DOCEF_DEFINE) + doc_ne->define_str=MAllocIdent(doc_e->define_str,task); + if (doc_e->de_flags & DOCEF_HTML_LINK) + doc_ne->html_link=MAllocIdent(doc_e->html_link,task); + if (doc_e->de_flags & DOCEF_LEFT_MACRO) + doc_ne->left_macro=MAllocIdent(doc_e->left_macro,task); + if (doc_e->de_flags & DOCEF_RIGHT_MACRO) + doc_ne->right_macro=MAllocIdent(doc_e->right_macro,task); + if (doc_e->de_flags & DOCEF_BIN_PTR_LINK) + doc_ne->bin_ptr_link=MAllocIdent(doc_e->bin_ptr_link,task); + if (doc_e->de_flags & DOCEF_HAS_BIN) { + tempb=MAllocIdent(doc_e->bin_data,task); + tempb->data=MAllocIdent(doc_e->bin_data->data,task); + doc_ne->bin_num=doc->cur_bin_num; + tempb->num=doc->cur_bin_num++; + doc_ne->bin_data=tempb; + if (doc_e->de_flags&DOCEF_TAG && doc_e->tag && *doc_e->tag) + tempb->tag=StrNew(doc_e->tag,task); + else + tempb->tag=NULL; + QueIns(tempb,doc->bin_head.last); + } + if (doc_e->de_flags & DOCEF_REMALLOC_DATA) + doc_ne->data=MAllocIdent(doc_e->data,task); + return doc_ne; +} + +U0 DocRemSoftNewLines(CDoc *doc=NULL,CDocEntry *doc_e=NULL) +{ + CDocEntry *doc_e2,*saved_ll=doc_e; + Bool unlock; + if (!doc && !(doc=DocPut)) + return; + unlock=DocLock(doc); + if (!doc_e) doc_e=doc->head.next; + while (doc_e!=doc) { + doc_e2=doc_e->next; + if (doc_e->type_u8==DOCT_SOFT_NEW_LINE) { + if (doc->cur_entry==doc_e) { + doc->cur_entry=doc_e2; + doc->cur_col=doc->cur_entry->min_col; + } + DocEntryDel(doc,doc_e); + } else if (saved_ll && doc_e->type_u8==DOCT_NEW_LINE) + break; + doc_e=doc_e2; + } + if (unlock) + DocUnlock(doc); +} + +public U0 DocInsEntry(CDoc *doc,CDocEntry *doc_e) +{//Insert entry into doc, updating its vals. + U8 *dst; + Bool unlock=DocLock(doc); + CDocEntry *doc_ce=doc->cur_entry,*doc_ne; + + doc_e->x=doc_ce->x; + doc_e->y=doc_ce->y; + doc_e->page_line_num=doc_ce->page_line_num; + MemCpy(&doc_e->settings,&doc_ce->settings,sizeof(CDocSettings)); + if (doc->cur_col>0 && + doc_ce->type_u8==DOCT_TEXT && + !(doc_ce->de_flags&(DOCEF_TAG_CB|DOCEF_DEFINE|DOCEF_AUX_STR| + DOCEF_HTML_LINK|DOCEF_BIN_PTR_LINK)) && + doc->cur_colmax_col) { + dst=doc_ce->tag+doc->cur_col; + doc_ne=DocEntryNewTag(doc,doc_ce,dst); + *dst=0; + doc_ne->type=DOCT_TEXT|doc_ce->type&0xFFFFFF00; + doc_ce->max_col=doc->cur_col; + QueIns(doc_ne,doc_ce); + doc->cur_col=0; + doc_ce=doc_ne; + } + if (doc_ce->type_u8==DOCT_TEXT && doc->cur_col>=doc_ce->max_col) { + QueIns(doc_e,doc_ce); + doc->cur_entry=doc_e->next; + } else { + QueIns(doc_e,doc_ce->last); + doc->cur_entry=doc_ce; + } + doc->cur_col=doc->cur_entry->min_col; + DocRemSoftNewLines(doc,doc->cur_entry); + if (unlock) + DocUnlock(doc); +} + +public U0 DocRst(CDoc *doc,Bool is_old) +{//Del all entries and set doc to dfts. + Bool unlock; + CDocEntry *doc_e,*doc_e2; + CDocUndo *u,*u8; + CDocSettings *s; + CDocBin *b,*b1; + if (!doc && !(doc=DocPut)) + return; + unlock=DocLock(doc); + if (is_old) { + doc_e=doc->head.next; + while (doc_e!=doc) { + doc_e2=doc_e->next; + DocEntryDel(doc,doc_e); + doc_e=doc_e2; + } + u=doc->undo_head.next; + while (u!=&doc->undo_head) { + u8=u->next; + DocUndoDel(doc,u); + u=u8; + } + b=doc->bin_head.next; + while (b!=&doc->bin_head) { + b1=b->next; + QueRem(b); + Free(b->data); + Free(b); + b=b1; + } + } +//Check $LK,"DocInsDoc",A="MN:DocInsDoc"$ + doc->flags&=DOCF_BREAK_UNLOCKED; + doc->head.next=doc->head.last=doc; + QueInit(&doc->bin_head); + QueInit(&doc->undo_head); + doc->undo_head.time_stamp=0; + doc->undo_cnt=0; + doc->cur_bin_num=1; + doc->dollar_buf_ptr=0; + doc->cmd_U8=CH_SPACE; + doc->page_line_num=0; + doc->best_d=MAX_I64; + + s=&doc->settings_head; + s->left_margin=DOC_DFT; + s->right_margin=DOC_DFT; + s->indent=0; + s->page_len=66; + s->header=DOC_DFT; + s->footer=DOC_DFT; + s->state=DOCSS_NORMAL; + s->comment_depth=0; + s->paren_depth=0; + s->brace_depth=0; + s->shifted_x=0; + s->shifted_y=0; + s->cur_text_attr=s->dft_text_attr=DOC_ATTR_DFT_TEXT; + + doc_e=&doc->head; + doc_e->type=DOCT_ERROR; + doc_e->de_flags=0; + doc_e->x=0; + doc_e->y=0; + doc_e->min_col=0; + doc_e->max_col=0; + doc_e->page_line_num=doc->page_line_num; + MemCpy(&doc_e->settings,s,sizeof(CDocSettings)); + + DocTop(doc); + if (unlock) + DocUnlock(doc); +} + +public U0 DocDel(CDoc *doc) +{//Free entire doc and entries. + if (!doc || doc->doc_signature!=DOC_SIGNATURE_VAL) return; + DocLock(doc); + doc->doc_signature=0; + DocRst(doc,TRUE); + Free(doc->find_replace); + Free(doc->dollar_buf); + DocUnlock(doc); + Free(doc); +} + +public I64 DocSize(CDoc *doc) +{//Mem size of doc and all its entries. + Bool unlock; + CDocEntry *doc_e; + CDocUndo *u; + CDocBin *b; + I64 res=0; + + if (!doc || doc->doc_signature!=DOC_SIGNATURE_VAL) return 0; + unlock=DocLock(doc); + + doc_e=doc->head.next; + while (doc_e!=doc) { + res+=DocEntrySize(doc,doc_e); + doc_e=doc_e->next; + } + + u=doc->undo_head.next; + while (u!=&doc->undo_head) { + res+=MSize2(u->body); + res+=MSize2(u); + u=u->next; + } + + b=doc->bin_head.next; + while (b!=&doc->bin_head) { + res+=MSize2(b->data); + res+=MSize2(b); + b=b->next; + } + + res+=MSize2(doc->find_replace); + res+=MSize2(doc->dollar_buf); + res+=MSize2(doc); + if (unlock) + DocUnlock(doc); + return res; +} + +#help_index "DolDoc" +public CDoc *DocNew(U8 *filename=NULL,CTask *task=NULL) +{//MAlloc new $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$. (Begin a new doc.) + CDoc *doc; + if (!task) task=Fs; + doc=CAlloc(sizeof(CDoc),task); + if (filename) + StrCpy(doc->filename.name,filename); + else + StrCpy(doc->filename.name,blkdev.temp_filename); + doc->find_replace=CAlloc(sizeof(CEdFindText),task); + doc->find_replace->scan_fwd=TRUE; + doc->find_replace->match_case=TRUE; + doc->find_replace->pmt=TRUE; + doc->left_click_link=&EdLeftClickLink; + doc->dollar_buf_size=84; + doc->dollar_buf=MAlloc(doc->dollar_buf_size,task); + doc->max_entries=MAX_I64; + doc->win_task=task; + doc->mem_task=task; + DocRst(doc,FALSE); + doc->doc_signature=DOC_SIGNATURE_VAL; + return doc; +} diff --git a/Adam/DolDoc/DocOpt.CPP b/Adam/DolDoc/DocOpt.CPP deleted file mode 100644 index 9f2a580..0000000 --- a/Adam/DolDoc/DocOpt.CPP +++ /dev/null @@ -1,117 +0,0 @@ -#help_index "DolDoc" - -I64 DocOptEntry(CDoc *,CDocEntry *doc_e,I64 fuf_flags) -{ - U8 *st,*st2,**_dst; - I64 i,res=0; - - if (doc_e->de_flags&DOCEF_LINK && doc_e->de_flags&(DOCEF_AUX_STR|DOCEF_TAG)) { - if (doc_e->de_flags & DOCEF_AUX_STR && doc_e->de_flags & DOCEF_TAG && - !MemCmp(doc_e->aux_str,"FI:",3) && - !StrCmp(doc_e->aux_str+3,doc_e->tag)) { - Free(doc_e->aux_str); - doc_e->aux_str=NULL; - doc_e->de_flags&=~DOCEF_AUX_STR; - res++; - } - if (doc_e->de_flags & DOCEF_AUX_STR) - _dst=&doc_e->aux_str; - else - _dst=&doc_e->tag; - if (StrMatch(".Z",*_dst)) { - st=DocLinkFile(*_dst); - if (FileFind(st)) { - if (IsDotZ(st)) - st[StrLen(st)-2]=0; - i=StrLen(st); - if ((st2=StrMatch(st,*_dst)) && st2[i]=='.' && st2[i+1]=='Z') { - StrCpy(st2+i,st2+i+2); - res++; - } - } - Free(st); - } - if (fuf_flags&FUF_RISKY) { - if (doc_e->de_flags & DOCEF_AUX_STR) { - if (st=StrMatch(".Z",doc_e->aux_str)) { - StrCpy(st,st+2); - res++; - } - } - if (doc_e->de_flags&DOCEF_TAG) { - if (st=StrMatch(".Z",doc_e->tag)) { - StrCpy(st,st+2); - res++; - } - } - } - } - return res; -} - -I64 DocOptDoc(CDoc *doc,I64 fuf_flags) -{//Optimize Doc. - Bool unlock=DocLock(doc); - I64 res=0; - CDocEntry *doc_e,*doc_e1,*doc_e_last; - DocRecalc(doc); - doc_e_last=NULL; - doc_e=doc->head.next; - while (doc_e!=doc) { - doc_e1=doc_e->next; - if (res+=DocOptEntry(doc,doc_e,fuf_flags)) - res+=DocOptEntry(doc,doc_e,fuf_flags); - if (doc_e_last && doc_e_last->type&~0xFF00==doc_e->type&~0xFF00 && - doc_e_last->de_flags==doc_e->de_flags && - Bt(doldoc.type_flags_chk_dup,doc_e->type_u8) && - doc_e_last->attr==doc_e->attr) { - DocEntryDel(doc,doc_e); - res++; - } else - doc_e_last=doc_e; - doc_e=doc_e1; - } - DocRecalc(doc); - if (unlock) - DocUnlock(doc); - return res; -} - -I64 DocOptFile(U8 *filename,I64 fuf_flags) -{//Optimize File. - I64 res; - CDoc *doc=DocRead(filename); - if (res=DocOptDoc(doc,fuf_flags)) { - "-%d:%s\n",res,doc->filename.name; - DocWrite(doc); - } - DocDel(doc); - return res; -} -I64 DocOptLst(CDirEntry *tempde,I64 fuf_flags) -{ - I64 res=0; - CDirEntry *tempde1; - while (tempde) { - tempde1=tempde->next; - if (tempde->attr & RS_ATTR_DIR) { - if (tempde->sub) { - "Scanning Directory: %s\n",tempde->full_name; - res+=DocOptLst(tempde->sub,fuf_flags); - } - } else - res+=DocOptFile(tempde->full_name,fuf_flags); - DirEntryDel(tempde); - tempde=tempde1; - } - return res; -} -public I64 DocOpt(U8 *files_find_mask="*",U8 *fu_flags=NULL) -{//Optimize $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$ Files, eliminating aux_str's and .Z's. -//+R flag for aggressively risky. - I64 fuf_flags=0; - ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+T"); - ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); - return DocOptLst(FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND), - fuf_flags&~FUG_FILES_FIND); -} diff --git a/Adam/DolDoc/DocOpt.HC b/Adam/DolDoc/DocOpt.HC new file mode 100644 index 0000000..d1acc68 --- /dev/null +++ b/Adam/DolDoc/DocOpt.HC @@ -0,0 +1,117 @@ +#help_index "DolDoc" + +I64 DocOptEntry(CDoc *,CDocEntry *doc_e,I64 fuf_flags) +{ + U8 *st,*st2,**_dst; + I64 i,res=0; + + if (doc_e->de_flags&DOCEF_LINK && doc_e->de_flags&(DOCEF_AUX_STR|DOCEF_TAG)) { + if (doc_e->de_flags & DOCEF_AUX_STR && doc_e->de_flags & DOCEF_TAG && + !MemCmp(doc_e->aux_str,"FI:",3) && + !StrCmp(doc_e->aux_str+3,doc_e->tag)) { + Free(doc_e->aux_str); + doc_e->aux_str=NULL; + doc_e->de_flags&=~DOCEF_AUX_STR; + res++; + } + if (doc_e->de_flags & DOCEF_AUX_STR) + _dst=&doc_e->aux_str; + else + _dst=&doc_e->tag; + if (StrMatch(".Z",*_dst)) { + st=DocLinkFile(*_dst); + if (FileFind(st)) { + if (IsDotZ(st)) + st[StrLen(st)-2]=0; + i=StrLen(st); + if ((st2=StrMatch(st,*_dst)) && st2[i]=='.' && st2[i+1]=='Z') { + StrCpy(st2+i,st2+i+2); + res++; + } + } + Free(st); + } + if (fuf_flags&FUF_RISKY) { + if (doc_e->de_flags & DOCEF_AUX_STR) { + if (st=StrMatch(".Z",doc_e->aux_str)) { + StrCpy(st,st+2); + res++; + } + } + if (doc_e->de_flags&DOCEF_TAG) { + if (st=StrMatch(".Z",doc_e->tag)) { + StrCpy(st,st+2); + res++; + } + } + } + } + return res; +} + +I64 DocOptDoc(CDoc *doc,I64 fuf_flags) +{//Optimize Doc. + Bool unlock=DocLock(doc); + I64 res=0; + CDocEntry *doc_e,*doc_e1,*doc_e_last; + DocRecalc(doc); + doc_e_last=NULL; + doc_e=doc->head.next; + while (doc_e!=doc) { + doc_e1=doc_e->next; + if (res+=DocOptEntry(doc,doc_e,fuf_flags)) + res+=DocOptEntry(doc,doc_e,fuf_flags); + if (doc_e_last && doc_e_last->type&~0xFF00==doc_e->type&~0xFF00 && + doc_e_last->de_flags==doc_e->de_flags && + Bt(doldoc.type_flags_chk_dup,doc_e->type_u8) && + doc_e_last->attr==doc_e->attr) { + DocEntryDel(doc,doc_e); + res++; + } else + doc_e_last=doc_e; + doc_e=doc_e1; + } + DocRecalc(doc); + if (unlock) + DocUnlock(doc); + return res; +} + +I64 DocOptFile(U8 *filename,I64 fuf_flags) +{//Optimize File. + I64 res; + CDoc *doc=DocRead(filename); + if (res=DocOptDoc(doc,fuf_flags)) { + "-%d:%s\n",res,doc->filename.name; + DocWrite(doc); + } + DocDel(doc); + return res; +} +I64 DocOptLst(CDirEntry *tempde,I64 fuf_flags) +{ + I64 res=0; + CDirEntry *tempde1; + while (tempde) { + tempde1=tempde->next; + if (tempde->attr & RS_ATTR_DIR) { + if (tempde->sub) { + "Scanning Directory: %s\n",tempde->full_name; + res+=DocOptLst(tempde->sub,fuf_flags); + } + } else + res+=DocOptFile(tempde->full_name,fuf_flags); + DirEntryDel(tempde); + tempde=tempde1; + } + return res; +} +public I64 DocOpt(U8 *files_find_mask="*",U8 *fu_flags=NULL) +{//Optimize $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ Files, eliminating aux_str's and .Z's. +//+R flag for aggressively risky. + I64 fuf_flags=0; + ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+T"); + ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); + return DocOptLst(FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND), + fuf_flags&~FUG_FILES_FIND); +} diff --git a/Adam/DolDoc/DocPlain.CPP b/Adam/DolDoc/DocPlain.HC similarity index 100% rename from Adam/DolDoc/DocPlain.CPP rename to Adam/DolDoc/DocPlain.HC diff --git a/Adam/DolDoc/DocPopUp.CPP b/Adam/DolDoc/DocPopUp.CPP deleted file mode 100644 index 5cbe8b7..0000000 --- a/Adam/DolDoc/DocPopUp.CPP +++ /dev/null @@ -1,323 +0,0 @@ -#help_index "DolDoc/Output;StdOut/DolDoc" -public CTask *PopUpViewDoc(CDoc *doc,I64 dof_flags=0) -{//Pass doc to PopUp win task for viewing. - U8 *buf=MStrPrint("DocEd(0x%X,0x%X);",doc,dof_flags); - CTask *task=Spawn(&SrvCmdLine,NULL,"View",,Fs); - TaskExe(task,NULL,buf,1<task_end_cb=&PopUpViewPrintEndCB; - return task; -} - -#help_index "DolDoc/Input;File/FileNames;StdIn/DolDoc" -public U8 *PopUpPickFile(U8 *dir=NULL) -{//Filename chooser. Uses $LK,"FileMgr",A="MN:FileMgr"$(). - U8 *res,*st,*st2; - if (dir) - st=MStrPrint("Cd(\"%Q\");FileMgr(FM_PICK_FILE,Fs->parent_task);",dir); - else { - st2=CurDir; - st=MStrPrint("Cd(\"%Q\");FileMgr(FM_PICK_FILE,Fs->parent_task);",st2); - Free(st2); - } - res=PopUp(st,Fs); - Free(st); - return res; -} - -public U8 *PopUpPickDir(U8 *dir=NULL) -{//File dir name chooser. Uses $LK,"FileMgr",A="MN:FileMgr"$(). - U8 *res,*st,*st2; - if (dir) - st=MStrPrint("Cd(\"%Q\");FileMgr(FM_PICK_DIR,Fs->parent_task);",dir); - else { - st2=CurDir; - st=MStrPrint("Cd(\"%Q\");FileMgr(FM_PICK_DIR,Fs->parent_task);",st2); - Free(st2); - } - res=PopUp(st,Fs); - Free(st); - return res; -} - -public U8 *FileNameForm(U8 *dft=NULL,I64 dof_flags=0,CTask *mem_task=NULL) -{//Text filename form in cur win, not PopUp. - CEdFileName fn; - if (dft) - StrCpy(fn.name,dft); - else - *fn.name=0; - if (DocForm(&fn,,dof_flags)) - return StrNew(fn.name,mem_task); - else - return NULL; -} - -public U8 *PopUpFileName(U8 *dft=NULL,I64 dof_flags=0) -{//Filename chooser. Uses form, not $LK,"FileMgr",A="MN:FileMgr"$(). - U8 *st=MStrPrint("FileNameForm(\"%Q\",0x%X,Fs->parent_task);", - dft,dof_flags|DOF_MIN_SIZE),*res=PopUp(st,Fs); - Free(st); - return res; -} - -#help_index "DolDoc" -Bool PopUpCd() -{ - Bool res; - U8 *st=PopUpPickDir; - if (st) { - res=Cd(st); - Free(st); - } else - res=FALSE; - return res; -} - -#help_index "DolDoc/Input;Char/Lists;StdIn/DolDoc" -public U8 *PopUpPickLst(U8 *lst) -{//Prompt for lst entry in PopUp win task. - I64 i=0; - CDoc *doc=DocNew; - DocPrint(doc,"$$LTBLUE$$"); - while (*lst) { - if (*lst=='@') {//Check for '@' alias lst entry - i--; - lst++; - } - DocPrint(doc,"$$MU,\"%s\",LE=%d$$\n",lst,i++); - lst+=StrLen(lst)+1; - } - DocPrint(doc,"\n$$MU,\"CANCEL\",LE=DOCM_CANCEL$$\n"); - i=PopUpMenu(doc); - DocDel(doc); - return i; -} - -#help_index "DolDoc/Input;Char/Lists;Char/Define;StdIn/DolDoc" -public U8 *PopUpPickDefineSub(U8 *dname) -{//Prompt for $LK,"Define",A="HI:Define"$ lst entry in PopUp win task. - return PopUpPickLst(Define(dname)); -} - -#help_index "DolDoc/Input;StdIn/DolDoc" -public I64 PopUp1(U8 *b1,I64 n1,U8 *header=NULL,U8 *footer=NULL) -{//Make PopUp win task with one button. - I64 i,l1=StrLen(b1); - CDoc *doc=DocNew; - if (header) DocPrint(doc,"%s",header); - DocPrint(doc,"$$CM+CX,%d,4$$$$BT,\"%s\",LE=%d$$\n",-l1/2,b1,n1); - if (footer) DocPrint(doc,"%s",footer); - i=PopUpMenu(doc); - DocDel(doc); - return i; -} - -public I64 PopUp2(U8 *b1,I64 n1,U8 *b2,I64 n2,U8 *header=NULL,U8 *footer=NULL) -{//Make PopUp win task with two buttons. - I64 i,l1=StrLen(b1),l2=StrLen(b2),y; - CDoc *doc=DocNew; - if (header) { - DocPrint(doc,"%s",header); - y=4; - } else { - DocPrint(doc,"%*s\n",l1+l2+10,""); - y=3; - } - DocPrint(doc,"$$CM+CX,%d,%d$$$$BT,\"%s\",LE=%d$$",-(l1+l2+3)>>1,y,b1,n1); - DocPrint(doc,"$$CM+CX,%d,0$$$$BT,\"%s\",LE=%d$$\n" ,-(l1+l2+3)>>1+l1+6,b2,n2); - if (footer) DocPrint(doc,"%s",footer); - i=PopUpMenu(doc); - DocDel(doc); - return i; -} - -public Bool PopUpOk(U8 *header=NULL,U8 *footer=NULL) -{//Make PopUp win task with OKAY button. - return PopUp1("OKAY",1,header,footer)>0; -} - -public Bool PopUpNoYes(U8 *header=NULL,U8 *footer=NULL) -{//Make PopUp win task with NO/YES buttons. - return $WW,0$PopUp2("YES",1,"NO",0,header,footer)>0; -} - -public Bool PopUpCancelOk(U8 *header=NULL,U8 *footer=NULL) -{//Make PopUp win task CANCEL/OKAY buttons. - return PopUp2("OKAY",1,"CANCEL",0,header,footer)>0; -} - -U8 *PopUpGetStr2(U8 *header,CTask *mem_task) -{ - U8 *res,*st; - if (header) - "%s",header; - st=GetStr(,,GSF_WITH_NEW_LINE); - res=StrNew(st,mem_task); - Free(st); - return res; -} - -public U8 *PopUpGetStr(U8 *header=NULL) -{//Prompt for text str in PopUp win task. - U8 *st=MStrPrint("PopUpGetStr2(0x%X,0x%X);",header,Fs), - *res=PopUp(st,Fs); - Free(st); - return res; -} - -public I64 PopUpGetI64(U8 *msg,I64 dft,I64 lo=MIN_I64,I64 hi=MAX_I64) -{//Prompt for I64 text expression in PopUp win task. - U8 *st=MStrPrint("GetI64(0x%X,0x%X,0x%X,0x%X);",msg,dft,lo,hi); - I64 res=PopUp(st,Fs); - Free(st); - return res; -} - -public F64 PopUpGetF64(U8 *msg,F64 dft,F64 lo=MIN_F64,F64 hi=MAX_F64) -{//Prompt for F64 text expression in PopUp win task. - U8 *st=MStrPrint("GetF64(0x%X,0x%X(F64),0x%X(F64),0x%X(F64));",msg,dft,lo,hi); - F64 res=PopUp(st,Fs)(F64); - Free(st); - return res; -} - -public I64 PopUpRangeI64(I64 lo,I64 hi,I64 step=1, - U8 *header=NULL,U8 *footer=NULL) -{//Evenly-spaced I64 range chooser in PopUp win task. - I64 i; - CDoc *doc=DocNew; - if (header) - DocPrint(doc,"%s",header); - DocPrint(doc,"$$LTBLUE$$"); - for (i=lo;i<=hi;i+=step) - DocPrint(doc,"$$MU,\"%d\",LE=%d$$\n",i,i); - if (footer) - DocPrint(doc,"%s",footer); - i=PopUpMenu(doc); - DocDel(doc); - return i; -} - -public F64 PopUpRangeF64(F64 lo,F64 hi,F64 step, - U8 *fmt="%9.4f",U8 *header=NULL,U8 *footer=NULL) -{//Evenly-spaced F64 range chooser in PopUp win task. - F64 d; - I64 i; - U8 buf[STR_LEN]; - CDoc *doc=DocNew; - if (header) - DocPrint(doc,"%s",header); - DocPrint(doc,"$$LTBLUE$$"); - for (d=lo;d<=hi;d+=step) { - StrPrint(buf,fmt,d); - DocPrint(doc,"$$MU,\"%s\",LE=0x%X$$\n",buf,d); - } - if (footer) - DocPrint(doc,"%s",footer); - i=PopUpMenu(doc); - DocDel(doc); - return i(F64); -} - -public F64 PopUpRangeF64Exp(F64 lo,F64 hi,F64 factor, - U8 *fmt="%9.4f",U8 *header=NULL,U8 *footer=NULL) -{//Exp-spaced F64 range chooser in PopUp win task. - F64 d; - I64 i; - U8 buf[STR_LEN]; - CDoc *doc=DocNew; - if (header) - DocPrint(doc,"%s",header); - DocPrint(doc,"$$LTBLUE$$"); - for (d=lo;d<=hi;d*=factor) { - StrPrint(buf,fmt,d); - DocPrint(doc,"$$MU,\"%s\",LE=0x%X$$\n",buf,d); - } - if (footer) - DocPrint(doc,"%s",footer); - i=PopUpMenu(doc); - DocDel(doc); - return i(F64); -} - -public F64 PopUpRangeF64Log(F64 lo,F64 hi,I64 steps, - U8 *fmt="%9.4f",U8 *header=NULL,U8 *footer=NULL) -{//Log-spaced F64 range chooser in PopUp win task. - return PopUpRangeF64Exp(lo,hi,Exp(Ln(hi/lo)/(steps-1)),fmt,header,footer); -} - -#help_index "Task/Srv/Exe;Compiler" -public I64 AdamFile(U8 *filename,Bool warn_ext=TRUE) -{//Make adam_task execute file. - Bool okay=TRUE; - U8 *name=FileNameAbs(filename), - *name2=DftExt(name,"CPP.Z"); - I64 res=0; - if (warn_ext && - !FilesFindMatch(name2,FILEMASK_JIT) && - !PopUpCancelOk(ST_WARN_ST "Not .CPP File\n\n")) - okay=FALSE; - if (okay) - res=Adam("#include \"%s\";",name2); - Free(name2); - Free(name); - return res; -} - -public I64 PopUpFile(U8 *filename,Bool warn_ext=TRUE, - CTask *parent=NULL,CTask **_pu_task=NULL) -{//$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,"CPP.Z"); - I64 res=0; - if (warn_ext && - !FilesFindMatch(name2,FILEMASK_JIT) && - !PopUpCancelOk(ST_WARN_ST "Not .CPP File\n\n")) - okay=FALSE; - if (okay) { - st=MStrPrint( - "\"$$$$WW+H,1$$$$\";Auto(\"ExeFile2(\\\"%s\\\",CCF_CMD_LINE);\\n\");" - "UserTaskCont;", - name2); - res=PopUp(st,parent,_pu_task); - Free(st); - } - Free(name2); - Free(name); - return res; -} - -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,"CPP.Z"); - I64 res=0; - st=MStrPrint( - "\"$$$$WW+H,1$$$$\";ExeFile2(\"%s\",0x%X);LastFun(0x%X,0x%X);", - name2,ccf_flags,argc,argv); - res=PopUp(st,Fs); - Free(st); - Free(name2); - Free(name); - return res; -} diff --git a/Adam/DolDoc/DocPopUp.HC b/Adam/DolDoc/DocPopUp.HC new file mode 100644 index 0000000..4ac81ec --- /dev/null +++ b/Adam/DolDoc/DocPopUp.HC @@ -0,0 +1,323 @@ +#help_index "DolDoc/Output;StdOut/DolDoc" +public CTask *PopUpViewDoc(CDoc *doc,I64 dof_flags=0) +{//Pass doc to PopUp win task for viewing. + U8 *buf=MStrPrint("DocEd(0x%X,0x%X);",doc,dof_flags); + CTask *task=Spawn(&SrvCmdLine,NULL,"View",,Fs); + TaskExe(task,NULL,buf,1<task_end_cb=&PopUpViewPrintEndCB; + return task; +} + +#help_index "DolDoc/Input;File/FileNames;StdIn/DolDoc" +public U8 *PopUpPickFile(U8 *dir=NULL) +{//Filename chooser. Uses $LK,"FileMgr",A="MN:FileMgr"$(). + U8 *res,*st,*st2; + if (dir) + st=MStrPrint("Cd(\"%Q\");FileMgr(FM_PICK_FILE,Fs->parent_task);",dir); + else { + st2=CurDir; + st=MStrPrint("Cd(\"%Q\");FileMgr(FM_PICK_FILE,Fs->parent_task);",st2); + Free(st2); + } + res=PopUp(st,Fs); + Free(st); + return res; +} + +public U8 *PopUpPickDir(U8 *dir=NULL) +{//File dir name chooser. Uses $LK,"FileMgr",A="MN:FileMgr"$(). + U8 *res,*st,*st2; + if (dir) + st=MStrPrint("Cd(\"%Q\");FileMgr(FM_PICK_DIR,Fs->parent_task);",dir); + else { + st2=CurDir; + st=MStrPrint("Cd(\"%Q\");FileMgr(FM_PICK_DIR,Fs->parent_task);",st2); + Free(st2); + } + res=PopUp(st,Fs); + Free(st); + return res; +} + +public U8 *FileNameForm(U8 *dft=NULL,I64 dof_flags=0,CTask *mem_task=NULL) +{//Text filename form in cur win, not PopUp. + CEdFileName fn; + if (dft) + StrCpy(fn.name,dft); + else + *fn.name=0; + if (DocForm(&fn,,dof_flags)) + return StrNew(fn.name,mem_task); + else + return NULL; +} + +public U8 *PopUpFileName(U8 *dft=NULL,I64 dof_flags=0) +{//Filename chooser. Uses form, not $LK,"FileMgr",A="MN:FileMgr"$(). + U8 *st=MStrPrint("FileNameForm(\"%Q\",0x%X,Fs->parent_task);", + dft,dof_flags|DOF_MIN_SIZE),*res=PopUp(st,Fs); + Free(st); + return res; +} + +#help_index "DolDoc" +Bool PopUpCd() +{ + Bool res; + U8 *st=PopUpPickDir; + if (st) { + res=Cd(st); + Free(st); + } else + res=FALSE; + return res; +} + +#help_index "DolDoc/Input;Char/Lists;StdIn/DolDoc" +public U8 *PopUpPickLst(U8 *lst) +{//Prompt for lst entry in PopUp win task. + I64 i=0; + CDoc *doc=DocNew; + DocPrint(doc,"$$LTBLUE$$"); + while (*lst) { + if (*lst=='@') {//Check for '@' alias lst entry + i--; + lst++; + } + DocPrint(doc,"$$MU,\"%s\",LE=%d$$\n",lst,i++); + lst+=StrLen(lst)+1; + } + DocPrint(doc,"\n$$MU,\"CANCEL\",LE=DOCM_CANCEL$$\n"); + i=PopUpMenu(doc); + DocDel(doc); + return i; +} + +#help_index "DolDoc/Input;Char/Lists;Char/Define;StdIn/DolDoc" +public U8 *PopUpPickDefineSub(U8 *dname) +{//Prompt for $LK,"Define",A="HI:Define"$ lst entry in PopUp win task. + return PopUpPickLst(Define(dname)); +} + +#help_index "DolDoc/Input;StdIn/DolDoc" +public I64 PopUp1(U8 *b1,I64 n1,U8 *header=NULL,U8 *footer=NULL) +{//Make PopUp win task with one button. + I64 i,l1=StrLen(b1); + CDoc *doc=DocNew; + if (header) DocPrint(doc,"%s",header); + DocPrint(doc,"$$CM+CX,%d,4$$$$BT,\"%s\",LE=%d$$\n",-l1/2,b1,n1); + if (footer) DocPrint(doc,"%s",footer); + i=PopUpMenu(doc); + DocDel(doc); + return i; +} + +public I64 PopUp2(U8 *b1,I64 n1,U8 *b2,I64 n2,U8 *header=NULL,U8 *footer=NULL) +{//Make PopUp win task with two buttons. + I64 i,l1=StrLen(b1),l2=StrLen(b2),y; + CDoc *doc=DocNew; + if (header) { + DocPrint(doc,"%s",header); + y=4; + } else { + DocPrint(doc,"%*s\n",l1+l2+10,""); + y=3; + } + DocPrint(doc,"$$CM+CX,%d,%d$$$$BT,\"%s\",LE=%d$$",-(l1+l2+3)>>1,y,b1,n1); + DocPrint(doc,"$$CM+CX,%d,0$$$$BT,\"%s\",LE=%d$$\n" ,-(l1+l2+3)>>1+l1+6,b2,n2); + if (footer) DocPrint(doc,"%s",footer); + i=PopUpMenu(doc); + DocDel(doc); + return i; +} + +public Bool PopUpOk(U8 *header=NULL,U8 *footer=NULL) +{//Make PopUp win task with OKAY button. + return PopUp1("OKAY",1,header,footer)>0; +} + +public Bool PopUpNoYes(U8 *header=NULL,U8 *footer=NULL) +{//Make PopUp win task with NO/YES buttons. + return $WW,0$PopUp2("YES",1,"NO",0,header,footer)>0; +} + +public Bool PopUpCancelOk(U8 *header=NULL,U8 *footer=NULL) +{//Make PopUp win task CANCEL/OKAY buttons. + return PopUp2("OKAY",1,"CANCEL",0,header,footer)>0; +} + +U8 *PopUpGetStr2(U8 *header,CTask *mem_task) +{ + U8 *res,*st; + if (header) + "%s",header; + st=GetStr(,,GSF_WITH_NEW_LINE); + res=StrNew(st,mem_task); + Free(st); + return res; +} + +public U8 *PopUpGetStr(U8 *header=NULL) +{//Prompt for text str in PopUp win task. + U8 *st=MStrPrint("PopUpGetStr2(0x%X,0x%X);",header,Fs), + *res=PopUp(st,Fs); + Free(st); + return res; +} + +public I64 PopUpGetI64(U8 *msg,I64 dft,I64 lo=MIN_I64,I64 hi=MAX_I64) +{//Prompt for I64 text expression in PopUp win task. + U8 *st=MStrPrint("GetI64(0x%X,0x%X,0x%X,0x%X);",msg,dft,lo,hi); + I64 res=PopUp(st,Fs); + Free(st); + return res; +} + +public F64 PopUpGetF64(U8 *msg,F64 dft,F64 lo=MIN_F64,F64 hi=MAX_F64) +{//Prompt for F64 text expression in PopUp win task. + U8 *st=MStrPrint("GetF64(0x%X,0x%X(F64),0x%X(F64),0x%X(F64));",msg,dft,lo,hi); + F64 res=PopUp(st,Fs)(F64); + Free(st); + return res; +} + +public I64 PopUpRangeI64(I64 lo,I64 hi,I64 step=1, + U8 *header=NULL,U8 *footer=NULL) +{//Evenly-spaced I64 range chooser in PopUp win task. + I64 i; + CDoc *doc=DocNew; + if (header) + DocPrint(doc,"%s",header); + DocPrint(doc,"$$LTBLUE$$"); + for (i=lo;i<=hi;i+=step) + DocPrint(doc,"$$MU,\"%d\",LE=%d$$\n",i,i); + if (footer) + DocPrint(doc,"%s",footer); + i=PopUpMenu(doc); + DocDel(doc); + return i; +} + +public F64 PopUpRangeF64(F64 lo,F64 hi,F64 step, + U8 *fmt="%9.4f",U8 *header=NULL,U8 *footer=NULL) +{//Evenly-spaced F64 range chooser in PopUp win task. + F64 d; + I64 i; + U8 buf[STR_LEN]; + CDoc *doc=DocNew; + if (header) + DocPrint(doc,"%s",header); + DocPrint(doc,"$$LTBLUE$$"); + for (d=lo;d<=hi;d+=step) { + StrPrint(buf,fmt,d); + DocPrint(doc,"$$MU,\"%s\",LE=0x%X$$\n",buf,d); + } + if (footer) + DocPrint(doc,"%s",footer); + i=PopUpMenu(doc); + DocDel(doc); + return i(F64); +} + +public F64 PopUpRangeF64Exp(F64 lo,F64 hi,F64 factor, + U8 *fmt="%9.4f",U8 *header=NULL,U8 *footer=NULL) +{//Exp-spaced F64 range chooser in PopUp win task. + F64 d; + I64 i; + U8 buf[STR_LEN]; + CDoc *doc=DocNew; + if (header) + DocPrint(doc,"%s",header); + DocPrint(doc,"$$LTBLUE$$"); + for (d=lo;d<=hi;d*=factor) { + StrPrint(buf,fmt,d); + DocPrint(doc,"$$MU,\"%s\",LE=0x%X$$\n",buf,d); + } + if (footer) + DocPrint(doc,"%s",footer); + i=PopUpMenu(doc); + DocDel(doc); + return i(F64); +} + +public F64 PopUpRangeF64Log(F64 lo,F64 hi,I64 steps, + U8 *fmt="%9.4f",U8 *header=NULL,U8 *footer=NULL) +{//Log-spaced F64 range chooser in PopUp win task. + return PopUpRangeF64Exp(lo,hi,Exp(Ln(hi/lo)/(steps-1)),fmt,header,footer); +} + +#help_index "Task/Srv/Exe;Compiler" +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"); + I64 res=0; + if (warn_ext && + !FilesFindMatch(name2,FILEMASK_JIT) && + !PopUpCancelOk(ST_WARN_ST "Not .HC File\n\n")) + okay=FALSE; + if (okay) + res=Adam("#include \"%s\";",name2); + Free(name2); + Free(name); + return res; +} + +public I64 PopUpFile(U8 *filename,Bool warn_ext=TRUE, + CTask *parent=NULL,CTask **_pu_task=NULL) +{//$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"); + I64 res=0; + if (warn_ext && + !FilesFindMatch(name2,FILEMASK_JIT) && + !PopUpCancelOk(ST_WARN_ST "Not .HC File\n\n")) + okay=FALSE; + if (okay) { + st=MStrPrint( + "\"$$$$WW+H,1$$$$\";Auto(\"ExeFile2(\\\"%s\\\",CCF_CMD_LINE);\\n\");" + "UserTaskCont;", + name2); + res=PopUp(st,parent,_pu_task); + Free(st); + } + Free(name2); + Free(name); + return res; +} + +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"); + I64 res=0; + st=MStrPrint( + "\"$$$$WW+H,1$$$$\";ExeFile2(\"%s\",0x%X);LastFun(0x%X,0x%X);", + name2,ccf_flags,argc,argv); + res=PopUp(st,Fs); + Free(st); + Free(name2); + Free(name); + return res; +} diff --git a/Adam/DolDoc/DocPutKey.CPP b/Adam/DolDoc/DocPutKey.CPP deleted file mode 100644 index bd7d239..0000000 --- a/Adam/DolDoc/DocPutKey.CPP +++ /dev/null @@ -1,726 +0,0 @@ -#help_index "DolDoc/Output;StdOut/DolDoc" - -public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0) -{//$LK,"PutKey",A="MN:PutKey"$(ch,sc) at doc insert pt, cur_entry. - I64 i,x,y; - CDoc *m; - CDocEntry *doc_ce; - U8 *st,*st2; - Bool unlock; - - if (!doc && !(doc=DocPut) || doc->doc_signature!=DOC_SIGNATURE_VAL) - return; - if (doc->user_put_key && (*doc->user_put_key)(doc,doc->user_put_data,ch,sc)) - return; - unlock=DocLock(doc); - if (!Bt(doldoc.clean_scan_codes,sc.u8[0])) - doc->flags|=DOCF_UNDO_DIRTY; - DocCaptureUndo(doc); - if (Bt(chars_bmp_getkey,ch) && !(sc&(SCF_CTRL|SCF_ALT))) { - if (sc&SCF_KEY_DESC) { - st=Char2KeyName(ch,FALSE); - KeyDescSet("Char /'%s'",st); - Free(st); - } else - EdCharIns(ch,sc,doc); - } else { - doc_ce=doc->cur_entry; - x=doc->x; y=doc->y; - if (sc&SCF_ALT) - switch (ch) { - case CH_BACKSPACE: // - if (!(sc&(SCF_SHIFT|SCF_CTRL))) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/Undo"); - else - DocUndoRestore(doc); - } - break; - } - else - switch (ch) { - case 0: - switch (sc.u8[0]) { - case SC_CURSOR_DOWN: - if (!(sc&SCF_CTRL)) { - if (sc&SCF_KEY_DESC) { - if (sc&SCF_SHIFT) - KeyDescSet("Edit/Cursor Down, Sel"); - else - KeyDescSet("Edit/Cursor Down"); - } else - EdLineDown(doc,sc); - break; - } else - sc&=~SCF_CTRL; -//Fall Through to SC_END - case SC_END: - if (!(sc&SCF_CTRL)) { - if (sc&SCF_KEY_DESC) { - if (sc&SCF_SHIFT) - KeyDescSet("Edit/GoTo Doc End, Sel"); - else - KeyDescSet("Edit/GoTo Doc End"); - } else { - while (doc_ce!=doc) { - BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); - doc_ce=doc->cur_entry=doc_ce->next; - } - doc->cur_col=doc_ce->min_col; - DocFormBwd(doc); - } - } - break; - case SC_CURSOR_UP: - if (!(sc&SCF_CTRL)) { - if (sc&SCF_KEY_DESC) { - if (sc&SCF_SHIFT) - KeyDescSet("Edit/Cursor Up, Sel"); - else - KeyDescSet("Edit/Cursor Up"); - } else - EdLineUp(doc,sc); - break; - } else - sc&=~SCF_CTRL; -//Fall Through to SC_HOME - case SC_HOME: - if (!(sc&SCF_CTRL)) { - if (sc&SCF_KEY_DESC) { - if (sc&SCF_SHIFT) - KeyDescSet("Edit/GoTo Top of Doc, Sel"); - else - KeyDescSet("Edit/GoTo Top of Doc"); - } else { - if (doc_ce==doc) doc_ce=doc_ce->last; - while (doc_ce!=doc) { - BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); - doc_ce=doc->cur_entry=doc_ce->last; - } - doc_ce=doc->cur_entry=doc->head.next; - doc->cur_col=doc_ce->min_col; - DocFormFwd(doc); - } - } - break; - case SC_PAGE_DOWN: - if (!(sc&SCF_CTRL)) { - if (sc&SCF_KEY_DESC) { - if (sc&SCF_SHIFT) - KeyDescSet("Edit/Page Down, Sel"); - else - KeyDescSet("Edit/Page Down"); - } else { - i=doc_ce->y+doc->win_task->win_height-1; - if (doc_ce->type_u8==DOCT_HEX_ED) - i+=doc->cur_col/3/doc_ce->hex_ed_width; - while (doc_ce!=doc && - (doc_ce->type_u8!=DOCT_HEX_ED && doc_ce->ytype_u8==DOCT_HEX_ED && - doc_ce->y+doc->cur_col/3/doc_ce->hex_ed_widthcur_entry==doc_ce && doc_ce->type_u8!=DOCT_HEX_ED) - break; - doc_ce=doc->cur_entry; - } - } - } - break; - case SC_PAGE_UP: - if (!(sc&SCF_CTRL)) { - if (sc&SCF_KEY_DESC) { - if (sc&SCF_SHIFT) - KeyDescSet("Edit/Page Up, Sel"); - else - KeyDescSet("Edit/Page Up"); - }else { - i=doc_ce->y-(doc->win_task->win_height-1); - if (doc_ce->type_u8==DOCT_HEX_ED) - i+=doc->cur_col/3/doc_ce->hex_ed_width; - while (doc_ce->last!=doc && - (doc_ce->type_u8!=DOCT_HEX_ED && doc_ce->y>i || - doc_ce->type_u8==DOCT_HEX_ED && - doc_ce->y+doc->cur_col/3/doc_ce->hex_ed_width>i) && - doc_ce->y!=doc->head.next->y) { - EdLineUp(doc,sc); -//paranoid check for stuck on same node - if (doc->cur_entry==doc_ce && doc_ce->type_u8!=DOCT_HEX_ED) - break; - doc_ce=doc->cur_entry; - } - } - } - break; - case SC_CURSOR_LEFT: - if (sc&SCF_KEY_DESC) { - if (sc&SCF_CTRL) - KeyDescSet("Edit/GoTo Start of Line"); - else { - if (sc&SCF_SHIFT) - KeyDescSet("Edit/Cursor Left, Sel"); - else - KeyDescSet("Edit/Cursor Left"); - } - } else - EdCursorLeft(doc,sc); - break; - case SC_CURSOR_RIGHT: - if (sc&SCF_KEY_DESC) { - if (sc&SCF_CTRL) - KeyDescSet("Edit/GoTo End of Line"); - else { - if (sc&SCF_SHIFT) - KeyDescSet("Edit/Cursor Right, Sel"); - else - KeyDescSet("Edit/Cursor Right"); - } - } else - EdCursorRight(doc,sc); - break; - case SC_DELETE: - if (!(sc&SCF_CTRL)) { - if (sc&SCF_KEY_DESC) { - if (sc&SCF_SHIFT) - KeyDescSet("Edit/Cut To Clipboard"); - else - KeyDescSet("Char /Delete"); - } else { - if (sc&SCF_SHIFT) - EdCutToClipboard(doc); - else - EdCharDel(doc); - } - } - break; - case SC_INS: - if (sc&(SCF_SHIFT|SCF_CTRL)!=(SCF_SHIFT|SCF_CTRL)) { - if (sc&SCF_KEY_DESC) { - if (sc&SCF_SHIFT) - KeyDescSet("Edit/Paste Clipboard"); - else if (sc&SCF_CTRL) - KeyDescSet("Edit/Copy to Clipboard"); - else - KeyDescSet("Edit/Toggle Overstrike"); - } else { - if (sc&SCF_SHIFT) - EdPasteClipboard(doc); - else if (sc&SCF_CTRL) - EdCopyToClipboard(doc); - else - doc->flags^=DOCF_OVERSTRIKE; - } - } - break; - case SC_F1...SC_F10: - if (sc&SCF_CTRL) { - if (sc&SCF_KEY_DESC) { - if (sc&SCF_SHIFT) - KeyDescSet("Cmd /Src Code of Sym"); - else - KeyDescSet("Edit/Autocomplete Sym"); - } else { - DocUnlock(doc); - if (AutoComplete(ON)) { - if (sc&SCF_SHIFT) - ACMan(sc.u8[0]-SC_F1+1,Fs); - else - ACFillIn(sc.u8[0]-SC_F1+1); - } - DocLock(doc); - } - } else { - switch (sc.u8[0]) { - case SC_F1: - if (sc&SCF_KEY_DESC) { - if (sc&SCF_SHIFT) - KeyDescSet("Cmd /About"); - else - KeyDescSet("Cmd /Help"); - } else { - if (sc&SCF_SHIFT) - Ed("::/Doc/AboutTempleOS.TXT.Z"); - else - Ed("::/Doc/HelpIndex.TXT.Z"); - } - break; - case SC_F2: - if (sc&SCF_KEY_DESC) { - if (sc&SCF_SHIFT) - KeyDescSet("Edit/Play Macro"); - else - KeyDescSet("Edit/Macro"); - } else { - DocUnlock(doc); - if (sc&SCF_SHIFT) { - if (TaskValidate(sys_macro_task)) - PostMsgWait(sys_macro_task, - MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - SysMacroStripKey(&sys_macro_head,ch,sc); - PlaySysMacro; - } else - EdMacroUtil; - DocLock(doc); - } - break; - case SC_F3: - if (sc&SCF_KEY_DESC) { - if (sc&SCF_SHIFT) - KeyDescSet("Edit/Find Last"); - else - KeyDescSet("Edit/Find Next"); - }else { - doc->find_replace->scan_fwd=!(sc&SCF_SHIFT); - EdFindNext(doc); - } - break; - case SC_F4: - if (sc&SCF_KEY_DESC) { - if (sc&SCF_SHIFT) - KeyDescSet("Cmd /Insert Directory Name"); - else - KeyDescSet("Cmd /Insert FileName"); - } else { - DocUnlock(doc); - if (sc&SCF_SHIFT) - st=PopUpPickDir; - else - st=PopUpPickFile; - DocLock(doc); - if (st) { - DocPrintPartial(doc,"%s",st); - Free(st); - } - } - break; - case SC_F5: - if (sc&SCF_KEY_DESC) { - if (sc&SCF_SHIFT) - KeyDescSet("Cmd /Adam Include"); - else - KeyDescSet("Cmd /Run (Execute)"); - } else { - if (st2=DocEntryLink(doc,doc_ce)) { - st=DocLinkFile(st2); - Free(st2); - } else { - DocWrite(doc); - st=StrNew(doc->filename.name); - } - if (st2=DirFile(st,"Run","CPP.Z")) { - if (FileFind(st2)) { - Free(st); - st=st2; - } else - Free(st2); - } - if (st) { - if (sc&SCF_SHIFT) - AdamFile(st); - else - PopUpFile(st); - Free(st); - } - } - break; - case SC_F6: - if (sc&SCF_KEY_DESC) { - if (sc&SCF_SHIFT) - KeyDescSet("Cmd /God Doodle"); - else - KeyDescSet("Cmd /God Song"); - } else { -//$LK,"::/Adam/God/HSNotes.TXT"$ - if (sc&SCF_SHIFT) { - DocUnlock(doc); - GodDoodle; - DocLock(doc); - } else - GodSong; - } - break; - case SC_F7: - if (sc&SCF_KEY_DESC) { - if (sc&SCF_SHIFT) - KeyDescSet("Cmd /God Passage"); - else - KeyDescSet("Cmd /God Word"); - } else { -//$LK,"::/Adam/God/HSNotes.TXT"$ - FifoU8Flush(god.fifo); - GodBitsIns(GOD_GOOD_BITS,KbdMouseEvtTime>>GOD_BAD_BITS); - if (sc&SCF_SHIFT) - GodPassage; - else - GodWord; - } - break; - } - } - break; - } - break; - case CH_CTRLA: - if (!(sc&SCF_SHIFT)) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/Save As"); - else - DocWrite(doc,TRUE); - } - break; - case CH_CTRLB: - if (!(sc&SCF_SHIFT)) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /Toggle Border"); - else - WinBorder(Bt(&doc->win_task->display_flags, - DISPLAYf_NO_BORDER),doc->win_task); - } - break; - case CH_CTRLC: - if (!(sc&SCF_SHIFT)) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/Copy to Clipboard"); - else - EdCopyToClipboard(doc); - } - break; - case CH_CTRLD: - if (!(sc&SCF_SHIFT)) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /File Manager"); - else { - DocUnlock(doc); - FileMgr; - DocLock(doc); - } - } - break; - case CH_CTRLF: - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /Search Files"); - else - FindWiz; - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/Find & Replace"); - else - EdFindReplace(doc); - } - break; - case CH_CTRLG: - if (!(sc&SCF_SHIFT)) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/GoTo Line Num"); - else - EdGoToLine(doc); - } - break; - case CH_BACKSPACE: // - if (!(sc&SCF_SHIFT)) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Char /Back Space"); - else { - DocCaptureUndo(doc); - doc_ce=doc->cur_entry; - if (doc->cur_col<=doc_ce->min_col) { - doc_ce=doc->cur_entry=doc_ce->last; - if (doc_ce!=doc && doc_ce->type_u8==DOCT_SOFT_NEW_LINE) - doc_ce=doc->cur_entry=doc_ce->last; - if (doc_ce==doc || doc_ce->type_u8==DOCT_PMT) { - doc_ce=doc->cur_entry=doc_ce->next; - doc->cur_col=doc_ce->min_col; - } else { - doc->cur_col=doc_ce->max_col; - if (doc->cur_col>doc_ce->min_col) - doc->cur_col--; - EdCharDel(doc); - } - } else { - doc->cur_col--; - EdCharDel(doc); - } - } - } - break; - case CH_CTRLI: - if (sc.u8[0]!=SC_TAB) { - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /Unindent 2"); - else - DocPrint(doc,"$$ID,-2$$"); - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /Indent 2"); - else - DocPrint(doc,"$$ID,2$$"); - } - } - break; - case '\n': - if (sc&SCF_KEY_DESC) { - if (sc&SCF_SHIFT) - KeyDescSet("Char /Return"); - else - KeyDescSet("Char /Page Break"); - } else - EdCharIns(ch,sc,doc); - break; - case CH_CTRLK: - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /Blinking Text Off"); - else - DocPrint(doc,"$$BK,0$$"); - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /Blinking Text On"); - else - DocPrint(doc,"$$BK,1$$"); - } - break; - case CH_CTRLL: - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /Code Tools"); - else { - DocUnlock(doc); - EdCodeTools(doc); - DocLock(doc); - } - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /Insert Text Widgets Wizard"); - else { - DocUnlock(doc); - EdInsWidgetWiz; - DocLock(doc); - } - } - break; - case CH_CTRLM: - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /Personal Notes"); - else - Ed("~/PersonalNotes.TXT.Z"); - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /Personal Menu"); - else { - m=DocRead("~/PersonalMenu.TXT.Z"); - DocMenu(m); - DocDel(m); - } - } - break; - case CH_CTRLO: - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/Collapse"); - else - DocCollapse(TRUE,doc); - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/Uncolapse"); - else - DocCollapse(FALSE,doc); - } - break; - case CH_CTRLP: - if (doc->flags & (DOCF_SUPERSCRIPT_MODE | DOCF_SUBSCRIPT_MODE)) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /Toggle Super or Sub script"); - else { - DocPrint(doc,"$$SY,0$$"); - doc->flags&=~(DOCF_SUPERSCRIPT_MODE | DOCF_SUBSCRIPT_MODE); - } - } else if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /Toggle Subscript"); - else { - DocPrint(doc,"$$SY,3$$"); - doc->flags|=DOCF_SUBSCRIPT_MODE; - } - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /Toggle Superscript"); - else { - DocPrint(doc,"$$SY,-3$$"); - doc->flags|=DOCF_SUPERSCRIPT_MODE; - } - } - break; - case CH_CTRLQ: - break; - case CH_CTRLR: - if (!(sc&SCF_SHIFT)) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /Sprite Graphic Resource"); - else - if (!(doc->flags&DOCF_FORM) && - !(doc->flags&(DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS))) { - DocUnlock(doc); - if (doc_ce->type_u8==DOCT_SPRITE) - EdSpriteEd(doc); - else - EdSpriteIns(doc); - DocLock(doc); - } - } - break; - case CH_CTRLS: - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/Find Misspelled"); - else - ACMisspelledFind(doc); - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/Save"); - else - DocWrite(doc); - } - break; - case CH_CTRLT: - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/Single Entry Toggle Plain Text"); - else if (!(doc->flags&DOCF_FORM)) - DocEntryToggle(doc); - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/Toggle Plain Text Display"); - else if (!(doc->flags&DOCF_FORM)) - DocFlagsToggle(doc,DOCF_PLAIN_TEXT); - } - break; - case CH_CTRLU: - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /Underline Off"); - else - DocPrint(doc,"$$UL,0$$"); - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /Underline On"); - else - DocPrint(doc,"$$UL,1$$"); - } - break; - case CH_CTRLV: - if (!(sc&SCF_SHIFT)) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/Paste Clipboard"); - else - EdPasteClipboard(doc); - } - break; - case CH_CTRLW: - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /Word Wrap Off"); - else - DocPrint(doc,"$$WW,0$$"); - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /Word Wrap On"); - else - DocPrint(doc,"$$WW,1$$"); - } - break; - case CH_CTRLX: - if (!(sc&SCF_SHIFT)) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/Cut To Clipboard"); - else - EdCutToClipboard(doc); - } - break; - case CH_CTRLY: - if (!(sc&SCF_SHIFT)) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/Delete Line"); - else - EdLineDel(doc); - } - break; - case CH_CTRLZ: - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /Inverted Text Off"); - else - DocPrint(doc,"$$IV,0$$"); - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /Inverted Text On"); - else - DocPrint(doc,"$$IV,1$$"); - } - break; - case '0'...'9': - if (sc&SCF_CTRL) { - if (sc&SCF_KEY_DESC) { - if (sc&SCF_SHIFT) - KeyDescSet("Cmd /Word Definition"); - else - KeyDescSet("Edit/Autocomplete Word"); - } else { - if (AutoComplete(ON)) { - DocUnlock(doc); - if (sc&SCF_SHIFT) - ACDDef(ch-'0',Fs); - else - ACDFillin(ch-'0'); - DocLock(doc); - } - } - } - break; - case '[': - if (sc&SCF_CTRL) { - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/GoTo matching brace"); - else - EdFindPaired(doc,'}','{',FALSE); - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/GoTo matching bracket"); - else - EdFindPaired(doc,']','[',FALSE); - } - } - break; - case ']': - if (sc&SCF_CTRL) { - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/GoTo matching brace"); - else - EdFindPaired(doc,'{','}',TRUE); - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/GoTo matching bracket"); - else - EdFindPaired(doc,'[',']',TRUE); - } - } - break; - } - } - if (unlock) - DocUnlock(doc); - if (!(doc->flags&DOCF_DONT_SWAP_OUT)) - Yield; -} - -Bool KDDocPutKey(I64 ch,I64 scan_code) -{ - CDoc *doc; - if (doc=DocPut) - DocPutKey(doc,ch,scan_code); - return FALSE; -} diff --git a/Adam/DolDoc/DocPutKey.HC b/Adam/DolDoc/DocPutKey.HC new file mode 100644 index 0000000..3e67c52 --- /dev/null +++ b/Adam/DolDoc/DocPutKey.HC @@ -0,0 +1,726 @@ +#help_index "DolDoc/Output;StdOut/DolDoc" + +public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0) +{//$LK,"PutKey",A="MN:PutKey"$(ch,sc) at doc insert pt, cur_entry. + I64 i,x,y; + CDoc *m; + CDocEntry *doc_ce; + U8 *st,*st2; + Bool unlock; + + if (!doc && !(doc=DocPut) || doc->doc_signature!=DOC_SIGNATURE_VAL) + return; + if (doc->user_put_key && (*doc->user_put_key)(doc,doc->user_put_data,ch,sc)) + return; + unlock=DocLock(doc); + if (!Bt(doldoc.clean_scan_codes,sc.u8[0])) + doc->flags|=DOCF_UNDO_DIRTY; + DocCaptureUndo(doc); + if (Bt(chars_bmp_getkey,ch) && !(sc&(SCF_CTRL|SCF_ALT))) { + if (sc&SCF_KEY_DESC) { + st=Char2KeyName(ch,FALSE); + KeyDescSet("Char /'%s'",st); + Free(st); + } else + EdCharIns(ch,sc,doc); + } else { + doc_ce=doc->cur_entry; + x=doc->x; y=doc->y; + if (sc&SCF_ALT) + switch (ch) { + case CH_BACKSPACE: // + if (!(sc&(SCF_SHIFT|SCF_CTRL))) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/Undo"); + else + DocUndoRestore(doc); + } + break; + } + else + switch (ch) { + case 0: + switch (sc.u8[0]) { + case SC_CURSOR_DOWN: + if (!(sc&SCF_CTRL)) { + if (sc&SCF_KEY_DESC) { + if (sc&SCF_SHIFT) + KeyDescSet("Edit/Cursor Down, Sel"); + else + KeyDescSet("Edit/Cursor Down"); + } else + EdLineDown(doc,sc); + break; + } else + sc&=~SCF_CTRL; +//Fall Through to SC_END + case SC_END: + if (!(sc&SCF_CTRL)) { + if (sc&SCF_KEY_DESC) { + if (sc&SCF_SHIFT) + KeyDescSet("Edit/GoTo Doc End, Sel"); + else + KeyDescSet("Edit/GoTo Doc End"); + } else { + while (doc_ce!=doc) { + BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); + doc_ce=doc->cur_entry=doc_ce->next; + } + doc->cur_col=doc_ce->min_col; + DocFormBwd(doc); + } + } + break; + case SC_CURSOR_UP: + if (!(sc&SCF_CTRL)) { + if (sc&SCF_KEY_DESC) { + if (sc&SCF_SHIFT) + KeyDescSet("Edit/Cursor Up, Sel"); + else + KeyDescSet("Edit/Cursor Up"); + } else + EdLineUp(doc,sc); + break; + } else + sc&=~SCF_CTRL; +//Fall Through to SC_HOME + case SC_HOME: + if (!(sc&SCF_CTRL)) { + if (sc&SCF_KEY_DESC) { + if (sc&SCF_SHIFT) + KeyDescSet("Edit/GoTo Top of Doc, Sel"); + else + KeyDescSet("Edit/GoTo Top of Doc"); + } else { + if (doc_ce==doc) doc_ce=doc_ce->last; + while (doc_ce!=doc) { + BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT); + doc_ce=doc->cur_entry=doc_ce->last; + } + doc_ce=doc->cur_entry=doc->head.next; + doc->cur_col=doc_ce->min_col; + DocFormFwd(doc); + } + } + break; + case SC_PAGE_DOWN: + if (!(sc&SCF_CTRL)) { + if (sc&SCF_KEY_DESC) { + if (sc&SCF_SHIFT) + KeyDescSet("Edit/Page Down, Sel"); + else + KeyDescSet("Edit/Page Down"); + } else { + i=doc_ce->y+doc->win_task->win_height-1; + if (doc_ce->type_u8==DOCT_HEX_ED) + i+=doc->cur_col/3/doc_ce->hex_ed_width; + while (doc_ce!=doc && + (doc_ce->type_u8!=DOCT_HEX_ED && doc_ce->ytype_u8==DOCT_HEX_ED && + doc_ce->y+doc->cur_col/3/doc_ce->hex_ed_widthcur_entry==doc_ce && doc_ce->type_u8!=DOCT_HEX_ED) + break; + doc_ce=doc->cur_entry; + } + } + } + break; + case SC_PAGE_UP: + if (!(sc&SCF_CTRL)) { + if (sc&SCF_KEY_DESC) { + if (sc&SCF_SHIFT) + KeyDescSet("Edit/Page Up, Sel"); + else + KeyDescSet("Edit/Page Up"); + }else { + i=doc_ce->y-(doc->win_task->win_height-1); + if (doc_ce->type_u8==DOCT_HEX_ED) + i+=doc->cur_col/3/doc_ce->hex_ed_width; + while (doc_ce->last!=doc && + (doc_ce->type_u8!=DOCT_HEX_ED && doc_ce->y>i || + doc_ce->type_u8==DOCT_HEX_ED && + doc_ce->y+doc->cur_col/3/doc_ce->hex_ed_width>i) && + doc_ce->y!=doc->head.next->y) { + EdLineUp(doc,sc); +//paranoid check for stuck on same node + if (doc->cur_entry==doc_ce && doc_ce->type_u8!=DOCT_HEX_ED) + break; + doc_ce=doc->cur_entry; + } + } + } + break; + case SC_CURSOR_LEFT: + if (sc&SCF_KEY_DESC) { + if (sc&SCF_CTRL) + KeyDescSet("Edit/GoTo Start of Line"); + else { + if (sc&SCF_SHIFT) + KeyDescSet("Edit/Cursor Left, Sel"); + else + KeyDescSet("Edit/Cursor Left"); + } + } else + EdCursorLeft(doc,sc); + break; + case SC_CURSOR_RIGHT: + if (sc&SCF_KEY_DESC) { + if (sc&SCF_CTRL) + KeyDescSet("Edit/GoTo End of Line"); + else { + if (sc&SCF_SHIFT) + KeyDescSet("Edit/Cursor Right, Sel"); + else + KeyDescSet("Edit/Cursor Right"); + } + } else + EdCursorRight(doc,sc); + break; + case SC_DELETE: + if (!(sc&SCF_CTRL)) { + if (sc&SCF_KEY_DESC) { + if (sc&SCF_SHIFT) + KeyDescSet("Edit/Cut To Clipboard"); + else + KeyDescSet("Char /Delete"); + } else { + if (sc&SCF_SHIFT) + EdCutToClipboard(doc); + else + EdCharDel(doc); + } + } + break; + case SC_INS: + if (sc&(SCF_SHIFT|SCF_CTRL)!=(SCF_SHIFT|SCF_CTRL)) { + if (sc&SCF_KEY_DESC) { + if (sc&SCF_SHIFT) + KeyDescSet("Edit/Paste Clipboard"); + else if (sc&SCF_CTRL) + KeyDescSet("Edit/Copy to Clipboard"); + else + KeyDescSet("Edit/Toggle Overstrike"); + } else { + if (sc&SCF_SHIFT) + EdPasteClipboard(doc); + else if (sc&SCF_CTRL) + EdCopyToClipboard(doc); + else + doc->flags^=DOCF_OVERSTRIKE; + } + } + break; + case SC_F1...SC_F10: + if (sc&SCF_CTRL) { + if (sc&SCF_KEY_DESC) { + if (sc&SCF_SHIFT) + KeyDescSet("Cmd /Src Code of Sym"); + else + KeyDescSet("Edit/Autocomplete Sym"); + } else { + DocUnlock(doc); + if (AutoComplete(ON)) { + if (sc&SCF_SHIFT) + ACMan(sc.u8[0]-SC_F1+1,Fs); + else + ACFillIn(sc.u8[0]-SC_F1+1); + } + DocLock(doc); + } + } else { + switch (sc.u8[0]) { + case SC_F1: + if (sc&SCF_KEY_DESC) { + if (sc&SCF_SHIFT) + KeyDescSet("Cmd /About"); + else + KeyDescSet("Cmd /Help"); + } else { + if (sc&SCF_SHIFT) + Ed("::/Doc/AboutTempleOS.DD.Z"); + else + Ed("::/Doc/HelpIndex.DD.Z"); + } + break; + case SC_F2: + if (sc&SCF_KEY_DESC) { + if (sc&SCF_SHIFT) + KeyDescSet("Edit/Play Macro"); + else + KeyDescSet("Edit/Macro"); + } else { + DocUnlock(doc); + if (sc&SCF_SHIFT) { + if (TaskValidate(sys_macro_task)) + PostMsgWait(sys_macro_task, + MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + SysMacroStripKey(&sys_macro_head,ch,sc); + PlaySysMacro; + } else + EdMacroUtil; + DocLock(doc); + } + break; + case SC_F3: + if (sc&SCF_KEY_DESC) { + if (sc&SCF_SHIFT) + KeyDescSet("Edit/Find Last"); + else + KeyDescSet("Edit/Find Next"); + }else { + doc->find_replace->scan_fwd=!(sc&SCF_SHIFT); + EdFindNext(doc); + } + break; + case SC_F4: + if (sc&SCF_KEY_DESC) { + if (sc&SCF_SHIFT) + KeyDescSet("Cmd /Insert Directory Name"); + else + KeyDescSet("Cmd /Insert FileName"); + } else { + DocUnlock(doc); + if (sc&SCF_SHIFT) + st=PopUpPickDir; + else + st=PopUpPickFile; + DocLock(doc); + if (st) { + DocPrintPartial(doc,"%s",st); + Free(st); + } + } + break; + case SC_F5: + if (sc&SCF_KEY_DESC) { + if (sc&SCF_SHIFT) + KeyDescSet("Cmd /Adam Include"); + else + KeyDescSet("Cmd /Run (Execute)"); + } else { + if (st2=DocEntryLink(doc,doc_ce)) { + st=DocLinkFile(st2); + Free(st2); + } else { + DocWrite(doc); + st=StrNew(doc->filename.name); + } + if (st2=DirFile(st,"Run","HC.Z")) { + if (FileFind(st2)) { + Free(st); + st=st2; + } else + Free(st2); + } + if (st) { + if (sc&SCF_SHIFT) + AdamFile(st); + else + PopUpFile(st); + Free(st); + } + } + break; + case SC_F6: + if (sc&SCF_KEY_DESC) { + if (sc&SCF_SHIFT) + KeyDescSet("Cmd /God Doodle"); + else + KeyDescSet("Cmd /God Song"); + } else { +//$LK,"::/Adam/God/HSNotes.DD"$ + if (sc&SCF_SHIFT) { + DocUnlock(doc); + GodDoodle; + DocLock(doc); + } else + GodSong; + } + break; + case SC_F7: + if (sc&SCF_KEY_DESC) { + if (sc&SCF_SHIFT) + KeyDescSet("Cmd /God Passage"); + else + KeyDescSet("Cmd /God Word"); + } else { +//$LK,"::/Adam/God/HSNotes.DD"$ + FifoU8Flush(god.fifo); + GodBitsIns(GOD_GOOD_BITS,KbdMouseEvtTime>>GOD_BAD_BITS); + if (sc&SCF_SHIFT) + GodBiblePassage; + else + GodWord; + } + break; + } + } + break; + } + break; + case CH_CTRLA: + if (!(sc&SCF_SHIFT)) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/Save As"); + else + DocWrite(doc,TRUE); + } + break; + case CH_CTRLB: + if (!(sc&SCF_SHIFT)) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /Toggle Border"); + else + WinBorder(Bt(&doc->win_task->display_flags, + DISPLAYf_NO_BORDER),doc->win_task); + } + break; + case CH_CTRLC: + if (!(sc&SCF_SHIFT)) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/Copy to Clipboard"); + else + EdCopyToClipboard(doc); + } + break; + case CH_CTRLD: + if (!(sc&SCF_SHIFT)) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /File Manager"); + else { + DocUnlock(doc); + FileMgr; + DocLock(doc); + } + } + break; + case CH_CTRLF: + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /Search Files"); + else + FindWiz; + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/Find & Replace"); + else + EdFindReplace(doc); + } + break; + case CH_CTRLG: + if (!(sc&SCF_SHIFT)) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/GoTo Line Num"); + else + EdGoToLine(doc); + } + break; + case CH_BACKSPACE: // + if (!(sc&SCF_SHIFT)) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Char /Back Space"); + else { + DocCaptureUndo(doc); + doc_ce=doc->cur_entry; + if (doc->cur_col<=doc_ce->min_col) { + doc_ce=doc->cur_entry=doc_ce->last; + if (doc_ce!=doc && doc_ce->type_u8==DOCT_SOFT_NEW_LINE) + doc_ce=doc->cur_entry=doc_ce->last; + if (doc_ce==doc || doc_ce->type_u8==DOCT_PMT) { + doc_ce=doc->cur_entry=doc_ce->next; + doc->cur_col=doc_ce->min_col; + } else { + doc->cur_col=doc_ce->max_col; + if (doc->cur_col>doc_ce->min_col) + doc->cur_col--; + EdCharDel(doc); + } + } else { + doc->cur_col--; + EdCharDel(doc); + } + } + } + break; + case CH_CTRLI: + if (sc.u8[0]!=SC_TAB) { + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /Unindent 2"); + else + DocPrint(doc,"$$ID,-2$$"); + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /Indent 2"); + else + DocPrint(doc,"$$ID,2$$"); + } + } + break; + case '\n': + if (sc&SCF_KEY_DESC) { + if (sc&SCF_SHIFT) + KeyDescSet("Char /Return"); + else + KeyDescSet("Char /Page Break"); + } else + EdCharIns(ch,sc,doc); + break; + case CH_CTRLK: + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /Blinking Text Off"); + else + DocPrint(doc,"$$BK,0$$"); + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /Blinking Text On"); + else + DocPrint(doc,"$$BK,1$$"); + } + break; + case CH_CTRLL: + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /Code Tools"); + else { + DocUnlock(doc); + EdCodeTools(doc); + DocLock(doc); + } + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /Insert Text Widgets Wizard"); + else { + DocUnlock(doc); + EdInsWidgetWiz; + DocLock(doc); + } + } + break; + case CH_CTRLM: + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /Personal Notes"); + else + Ed("~/PersonalNotes.DD.Z"); + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /Personal Menu"); + else { + m=DocRead("~/PersonalMenu.DD.Z"); + DocMenu(m); + DocDel(m); + } + } + break; + case CH_CTRLO: + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/Collapse"); + else + DocCollapse(TRUE,doc); + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/Uncolapse"); + else + DocCollapse(FALSE,doc); + } + break; + case CH_CTRLP: + if (doc->flags & (DOCF_SUPERSCRIPT_MODE | DOCF_SUBSCRIPT_MODE)) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /Toggle Super or Sub script"); + else { + DocPrint(doc,"$$SY,0$$"); + doc->flags&=~(DOCF_SUPERSCRIPT_MODE | DOCF_SUBSCRIPT_MODE); + } + } else if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /Toggle Subscript"); + else { + DocPrint(doc,"$$SY,3$$"); + doc->flags|=DOCF_SUBSCRIPT_MODE; + } + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /Toggle Superscript"); + else { + DocPrint(doc,"$$SY,-3$$"); + doc->flags|=DOCF_SUPERSCRIPT_MODE; + } + } + break; + case CH_CTRLQ: + break; + case CH_CTRLR: + if (!(sc&SCF_SHIFT)) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /Sprite Graphic Resource"); + else + if (!(doc->flags&DOCF_FORM) && + !(doc->flags&(DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS))) { + DocUnlock(doc); + if (doc_ce->type_u8==DOCT_SPRITE) + EdSpriteEd(doc); + else + EdSpriteIns(doc); + DocLock(doc); + } + } + break; + case CH_CTRLS: + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/Find Misspelled"); + else + ACMisspelledFind(doc); + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/Save"); + else + DocWrite(doc); + } + break; + case CH_CTRLT: + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/Single Entry Toggle Plain Text"); + else if (!(doc->flags&DOCF_FORM)) + DocEntryToggle(doc); + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/Toggle Plain Text Display"); + else if (!(doc->flags&DOCF_FORM)) + DocFlagsToggle(doc,DOCF_PLAIN_TEXT); + } + break; + case CH_CTRLU: + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /Underline Off"); + else + DocPrint(doc,"$$UL,0$$"); + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /Underline On"); + else + DocPrint(doc,"$$UL,1$$"); + } + break; + case CH_CTRLV: + if (!(sc&SCF_SHIFT)) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/Paste Clipboard"); + else + EdPasteClipboard(doc); + } + break; + case CH_CTRLW: + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /Word Wrap Off"); + else + DocPrint(doc,"$$WW,0$$"); + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /Word Wrap On"); + else + DocPrint(doc,"$$WW,1$$"); + } + break; + case CH_CTRLX: + if (!(sc&SCF_SHIFT)) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/Cut To Clipboard"); + else + EdCutToClipboard(doc); + } + break; + case CH_CTRLY: + if (!(sc&SCF_SHIFT)) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/Delete Line"); + else + EdLineDel(doc); + } + break; + case CH_CTRLZ: + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /Inverted Text Off"); + else + DocPrint(doc,"$$IV,0$$"); + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /Inverted Text On"); + else + DocPrint(doc,"$$IV,1$$"); + } + break; + case '0'...'9': + if (sc&SCF_CTRL) { + if (sc&SCF_KEY_DESC) { + if (sc&SCF_SHIFT) + KeyDescSet("Cmd /Word Definition"); + else + KeyDescSet("Edit/Autocomplete Word"); + } else { + if (AutoComplete(ON)) { + DocUnlock(doc); + if (sc&SCF_SHIFT) + ACDDef(ch-'0',Fs); + else + ACDFillin(ch-'0'); + DocLock(doc); + } + } + } + break; + case '[': + if (sc&SCF_CTRL) { + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/GoTo matching brace"); + else + EdFindPaired(doc,'}','{',FALSE); + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/GoTo matching bracket"); + else + EdFindPaired(doc,']','[',FALSE); + } + } + break; + case ']': + if (sc&SCF_CTRL) { + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/GoTo matching brace"); + else + EdFindPaired(doc,'{','}',TRUE); + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/GoTo matching bracket"); + else + EdFindPaired(doc,'[',']',TRUE); + } + } + break; + } + } + if (unlock) + DocUnlock(doc); + if (!(doc->flags&DOCF_DONT_SWAP_OUT)) + Yield; +} + +Bool KDDocPutKey(I64 ch,I64 scan_code) +{ + CDoc *doc; + if (doc=DocPut) + DocPutKey(doc,ch,scan_code); + return FALSE; +} diff --git a/Adam/DolDoc/DocPutS.CPP b/Adam/DolDoc/DocPutS.HC similarity index 100% rename from Adam/DolDoc/DocPutS.CPP rename to Adam/DolDoc/DocPutS.HC diff --git a/Adam/DolDoc/DocRecalc.CPP b/Adam/DolDoc/DocRecalc.CPP deleted file mode 100644 index da5b6a4..0000000 --- a/Adam/DolDoc/DocRecalc.CPP +++ /dev/null @@ -1,1334 +0,0 @@ -#help_index "DolDoc" - -I64 DocWordWrapDel(CDoc *doc,CDocEntry *doc_e, - Bool full_refresh,Bool same_win,I64 left_margin,I64 right_margin, - CDocEntry **_best_doc_e,I64 *_best_col) -{ - CDocEntry *doc_e2; - U8 *ptr; - I64 j,k; - if (doc_e->de_flags&DOCEF_TAG && doc_e->tag) - k=StrLen(doc_e->tag); - else - k=0; - if (full_refresh) - while (TRUE) { - doc_e2=doc_e->next; - if (doc_e2->type_u8==DOCT_SOFT_NEW_LINE && !same_win) { - if (doc->cur_entry==doc_e2) { - doc->cur_entry=doc_e2->next; - doc->cur_col=doc->cur_entry->min_col; - } - if (*_best_doc_e==doc_e2) { - *_best_doc_e=doc_e2->next; - *_best_col=0; - } - DocEntryDel(doc,doc_e2); - } else if (IsEditableText(doc_e) && - doc_e->de_flags==doc_e2->de_flags && doc_e->type==doc_e2->type) { - j=StrLen(doc_e2->tag); - ptr=MAlloc(k+j+1,doc->mem_task); - MemCpy(ptr,doc_e->tag,k); - MemCpy(ptr+k,doc_e2->tag,j+1); - Free(doc_e->tag); - doc_e->tag=ptr; - if (doc->cur_entry==doc_e2) { - doc->cur_entry=doc_e; - doc->cur_col+=k; - } - if (*_best_doc_e==doc_e2) { - *_best_doc_e=doc_e; - *_best_col=0; - } - DocEntryDel(doc,doc_e2); - k+=j; - if (k>(right_margin-left_margin+1)<<1) - break; - } else - break; - } - if (doc_e->de_flags & DOCEF_SCROLLING_X) - k=doc_e->scroll_len; - return k; -} - -U0 DocRecalcXY(CDoc *doc,CDocEntry *doc_e, - I64 k,I64 left,I64 width,I64 height,I64 left_margin,I64 right_margin, - I64 x0,I64 y0,I64 *_x,I64 *_y) -{ - I64 i,x=*_x,y=*_y; - if (doc_e->de_flags & DOCEF_MARGIN_REL_X) { - if (doc_e->de_flags & DOCEF_LEFT_X) - x=left_margin-left; - else if (doc_e->de_flags & DOCEF_RIGHT_X) - x=right_margin-(k-1)-left; - else if (doc_e->de_flags & DOCEF_CENTER_X) - x=(right_margin+left_margin)>>1-k>>1-left; - } else { - if (doc_e->de_flags & DOCEF_LEFT_X) - x=x0; - else if (doc_e->de_flags & DOCEF_RIGHT_X) - x=width+x0-k; - else if (doc_e->de_flags & DOCEF_CENTER_X) - x=(width+x0-k)>>1; - } - i=y; - if (doc_e->de_flags & DOCEF_PAGE_REL_Y) { - doc->flags|=DOCF_BWD_MOVEMENT; - if (doc_e->de_flags & DOCEF_TOP_Y) - y-=doc_e->page_line_num; - else if (doc_e->de_flags & DOCEF_BOTTOM_Y) - y+=doc_e->settings.page_len-doc_e->page_line_num; - else if (doc_e->de_flags & DOCEF_CENTER_Y) - y+=doc_e->settings.page_len>>1-doc_e->page_line_num; - } else { - doc->flags|=DOCF_BWD_MOVEMENT; - if (doc_e->de_flags & DOCEF_TOP_Y) - y=y0; - else if (doc_e->de_flags & DOCEF_BOTTOM_Y) - y=height-1+y0; - else if (doc_e->de_flags & DOCEF_CENTER_Y) - y=height>>1+y0; - } - if (y!=i) { - doc->page_line_num+=y-i; - if (doc->page_line_num<0) - doc->page_line_num=doc_e->settings.page_len+ - doc->page_line_num%doc_e->settings.page_len; - else - doc->page_line_num=doc->page_line_num%doc_e->settings.page_len; - if (doc_e->settings.header!=DOC_DFT && - doc->page_line_numsettings.header) { - y+=doc_e->settings.header-doc->page_line_num; - doc->page_line_num=doc_e->settings.header; - } - if (doc_e->settings.footer==DOC_DFT) { - if (doc->page_line_num>=doc_e->settings.page_len) { - if (doc_e->settings.header==DOC_DFT) - doc->page_line_num=0; - else { - doc->page_line_num=doc_e->settings.header; - y+=doc_e->settings.header; - } - } - } else { - if (doc->page_line_num>= - doc_e->settings.page_len-doc_e->settings.footer) { - y+=doc_e->settings.footer; - if (doc_e->settings.header==DOC_DFT) - doc->page_line_num=0; - else { - doc->page_line_num=doc_e->settings.header; - y+=doc_e->settings.header; - } - } - } - } - *_x=x; - *_y=y; -} - -CDocEntry *DocSplitTag(CDoc *doc,CDocEntry *doc_e,I64 i,I64 x,I64 y,I64 type_u8) -{//Split tag at i, insert DOCT_SOFT_NEW_LINE, DOCT_MARKER or DOCT_CURSOR - U8 *ptr; - CDocEntry *doc_e2; - if (doc_e->type_u8==DOCT_TEXT && i) { - if (itag)) { - doc_e2=MAllocIdent(doc_e,doc->mem_task); - doc_e2->tag=StrNew(doc_e->tag+i,doc->mem_task); - doc_e2->de_flags=doc_e->de_flags&~DOCEG_HAS_ALLOC|DOCEF_TAG; - QueIns(doc_e2,doc_e); - if (doc->cur_entry==doc_e && doc->cur_col>=i) { - doc->cur_entry=doc_e2; - doc->cur_col=doc->cur_col-i; - } - doc_e->tag[i]=0; - ptr=StrNew(doc_e->tag,doc->mem_task); - Free(doc_e->tag); - doc_e->tag=ptr; - } - } else - doc_e=doc_e->last; - doc_e2=DocEntryNewBase(doc,type_u8|doc_e->type & 0xFFFFFF00, - doc_e->de_flags&~DOCEG_HAS_ARG,x,y,doc_e->page_line_num); - MemCpy(&doc_e2->settings,&doc_e->settings,sizeof(CDocSettings)); - QueIns(doc_e2,doc_e); - return doc_e2; -} - -CDocEntry *DocWordWrapAdd(CDoc *doc,CDocEntry *doc_e, - I64 *_k,I64 left,I64 right_margin,I64 x,I64 y) -{ - CDocEntry *doc_e2; - I64 j,i=right_margin+1-(x+left), //Space left on line - ii=x+1-doc_e->settings.left_margin; - if (IsEditableText(doc_e)) { - if (doc->cur_entry==doc_e->next) { - if (doc->cur_col==doc_e->next->min_col) - i--; - } else { - if (doc->cur_entry==doc_e && doc->cur_col==i) - i--; - } - if (*_k>i) { - for (j=i;j>8-ii && j>=0;j--) - if (doc_e->tag[j]==CH_SPACE || doc_e->tag[j]==CH_SHIFT_SPACE) { - i=j+1; - break; - } - if (0tag); - return NULL; - } - } - if (*_k==i) - return NULL; - } - if (*_k>=i) { - doc_e2=doc_e->last; - if (doc_e2->type_u8!=DOCT_SOFT_NEW_LINE && - doc_e2->type_u8!=DOCT_NEW_LINE && - doc_e2->type_u8!=DOCT_CURSOR_MOVEMENT) { - doc_e2=DocEntryNewBase(doc,DOCT_SOFT_NEW_LINE|doc_e->type&0xFFFFFF00, - DOCEF_WORD_WRAP|doc_e->de_flags&(DOCEF_HIGHLIGHT|DOCG_BL_IV_UL| - DOCEF_SKIP|DOCEF_FILTER_SKIP),x,y,doc_e->last->page_line_num); - MemCpy(&doc_e2->settings,&doc_e->settings,sizeof(CDocSettings)); - QueIns(doc_e2,doc_e->last); - return doc_e2; - } - } - return NULL; -} - -I64 DocTempAttr(CDoc *doc,CDocEntry *doc_e,I64 cur_u8_attr) -{ - I64 temp_u32_attr; - doc_e->de_flags=doc->flags& (DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT) | - doc_e->de_flags&~(DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT); - temp_u32_attr=(cur_u8_attr&0xF0)<<8| - doc->flags&DOCG_BL_IV_UL|(doc_e->settings.shifted_x&0x1F)<<16| - (doc_e->settings.shifted_y&0x1F)<<21; - if (doc_e->de_flags & DOCEF_HAS_BIN && *doc_e->tag=='<') - temp_u32_attr.u8[1]|=DOC_COLOR_BIN; - else - switch (doc_e->type_u8) { - case DOCT_SPRITE: - if (doc_e->de_flags & DOCEF_LEFT_EXP) - temp_u32_attr.u8[1]|=cur_u8_attr&15; - else if (doc_e->de_flags & DOCEF_LINK) - temp_u32_attr.u8[1]|=DOC_COLOR_LINK; - else if (doc_e->de_flags & DOCEF_LEFT_MACRO) - temp_u32_attr.u8[1]|=DOC_COLOR_MACRO; - else if (doc_e->de_flags & (DOCEF_TREE|DOCEF_LST)) - temp_u32_attr.u8[1]|=DOC_COLOR_TREE; - else - temp_u32_attr.u8[1]|=DOC_COLOR_BIN; - break; - case DOCT_HTML_CODE: - temp_u32_attr.u8[1]|=DOC_COLOR_BIN; - break; - case DOCT_LINK: - temp_u32_attr.u8[1]|=DOC_COLOR_LINK; - break; - case DOCT_MACRO: - temp_u32_attr.u8[1]|=DOC_COLOR_MACRO; - break; - case DOCT_ANCHOR: - temp_u32_attr.u8[1]|=DOC_COLOR_ANCHOR; - break; - case DOCT_TREE: - case DOCT_LST: - temp_u32_attr.u8[1]|=DOC_COLOR_TREE; - break; - default: - temp_u32_attr.u8[1]|=cur_u8_attr&15; - } - doc_e->type.u8[1]=temp_u32_attr.u8[1]; - temp_u32_attr|=doc_e->type&0xFFFF0000; - if (doc_e==doc->cur_entry && !(doc->flags&DOCF_DONT_HIGHLIGHT_CURSOR) && - doc_e->type_u8!=DOCT_TEXT) - temp_u32_attr^=0xFF00; - doc_e->settings.final_u32_attr=temp_u32_attr; - return temp_u32_attr; -} - -public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL) -{//Recalc and fmt. Also used by WinMgr to draw on screen. - I64 i,ii,j,k,x,x0,y,y0,D,d2,col,col2,best_col=0,best_d=MAX_I64,xx,yy,zz, - num_entries=0,i_jif,cur_u8_attr,temp_u32_attr, - cursor_y=MIN_I64,left_margin,right_margin,y_plot_top,y_plot_bottom, - top,left,bottom,right,width,height,scroll_x,scroll_y,pix_top,pix_left; - CDocEntry reg *doc_e,reg *doc_e2,*best_doc_e,*next_clear_found=NULL, - *added_cursor=NULL; - CDocBin *tempb; - CDocSettings *s; - Bool del_doc_e,skipped_update,tree_collapsed,same_win,more=FALSE, - find_cursor=FALSE,blink_flag,full_refresh=TRUE,unlock,clear_holds; - CTask *win_task,*mem_task; - CDC *dc; - U8 *bptr,*ptr,buf[STR_LEN],ch; - U32 *u32_ptr,*hl; - I32 *depth_buf=NULL; - F64 cur_time=tS; - CWinScroll *vss,*hss; - CHashDefineStr *temph; - - if (!doc || doc->doc_signature!=DOC_SIGNATURE_VAL) return FALSE; - - //WinMgr updates all wins $TX,"30",D="WINMGR_FPS"$, 33.33333mS - if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && doc->owning_task!=Fs) { - i_jif=cnts.jiffies+JIFFY_FREQ/250; //4 mS - while (Bt(&doc->locked_flags,DOClf_LOCKED)) { - if (cnts.jiffies>=i_jif) - return FALSE; //Bail-out if doc locked. - Yield; - } - } - - unlock=DocLock(doc); - if (doc->doc_signature!=DOC_SIGNATURE_VAL) { - DocUnlock(doc); - return FALSE; - } - - win_task=doc->win_task; - mem_task=doc->mem_task; - blink_flag=Blink; - dc=NULL; - switch [recalc_flags&RECALCG_MASK] { - case RECALCt_FIND_CURSOR: - find_cursor=TRUE; - if (win_task) - dc=DCAlias(gr.dc2,win_task); //Necessary for sprites - break; - case RECALCt_TO_SCREEN: - if (doc->updates_cnt++%(ToI64(winmgr.fps/10)+1) && - !Bt(&doc->flags,DOCf_DO_FULL_REFRESH) && - !(doc->flags&DOCF_BWD_MOVEMENT)) - full_refresh=FALSE; - if (win_task) - dc=DCAlias(gr.dc2,win_task); - break; - } - - PUSHFD - CLI - left =win_task->win_left; - right =win_task->win_right; - width =win_task->win_width; - scroll_x=win_task->scroll_x; - scroll_y=win_task->scroll_y; - top =win_task->win_top; - bottom=win_task->win_bottom; - height=win_task->win_height; - pix_left =win_task->pix_left; - pix_top =win_task->pix_top; - left_margin=left; - right_margin=right; - POPFD - if (doc->flags&DOCF_BORDER_DOC) { - scroll_x=0; - scroll_y=0; - } - best_doc_e=doc->cur_entry; - - if (!(doc->flags&(DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS)) && - FilesFindMatch(doc->filename.name,FILEMASK_SRC)) - doc->flags|=DOCF_HIGHLIGHT; - else - doc->flags&=~DOCF_HIGHLIGHT; - - x=y=0; - doc->page_line_num=0; - if (full_refresh && !find_cursor) { - doc->x=x; - doc->y=y; - } - - hss=&win_task->horz_scroll; - vss=&win_task->vert_scroll; - if (doc->flags&DOCF_BORDER_DOC) { - doc->top_line_num=0; - doc->line_start_col=0; - recalc_flags&=~RECALCF_HAS_CURSOR; - if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN) - doc->settings_head.cur_text_attr= - doc->settings_head.dft_text_attr=win_task->border_attr; - } else { - if (recalc_flags&RECALCF_HAS_CURSOR && full_refresh) { - if (Bt(&hss->flags,WSSf_SET_TO_POS)||Bt(&vss->flags,WSSf_SET_TO_POS)) { - if (!(doc->flags&DOCF_NO_SCROLL_BARS)) { - if (Bt(&hss->flags,WSSf_SET_TO_POS)) { - doc->line_start_col=hss->pos; - LBtr(&hss->flags,WSSf_SET_TO_POS); - } - if (Bt(&vss->flags,WSSf_SET_TO_POS)) { - doc->top_line_num=vss->pos; - LBtr(&vss->flags,WSSf_SET_TO_POS); - } - } - doc->x=doc->line_start_col+width/2; - doc->y=doc->top_line_num+height/2; - find_cursor=TRUE; - } - } - if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN) - doc->settings_head.cur_text_attr= - doc->settings_head.dft_text_attr=win_task->text_attr; - } - x0=doc->line_start_col; - y0=doc->top_line_num; - same_win=top ==doc->old_win_top && - bottom==doc->old_win_bottom && - left ==doc->old_win_left && - right ==doc->old_win_right && - doc->cur_entry==doc->old_cur_entry && - doc->cur_col==doc->old_cur_col; - if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN) { - y_plot_top=y0-scroll_y/FONT_HEIGHT; - y_plot_bottom=y0+height-1-scroll_y/FONT_HEIGHT; - if (!(doc->flags&DOCF_BORDER_DOC) && - !Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) - DocBorderLstDraw(doc); - } - - if (doc->cur_col<=doc->cur_entry->min_col) - doc->cur_col=doc->cur_entry->min_col; - doc_e=doc->head.next; - doc_e->de_flags&=~(DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT); - if (doc_e==doc->head.next) - s=&doc->settings_head; - else - s=&doc_e->last->settings; - doc->flags=doc_e->de_flags& (DOCG_BL_IV_UL|DOCEF_WORD_WRAP) | - doc->flags&~(DOCG_BL_IV_UL|DOCEF_WORD_WRAP); - cur_u8_attr=s->cur_text_attr; - if (doc_e==doc->head.next) { - doc->flags&=~DOCF_BWD_MOVEMENT; - if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && full_refresh) - doc->flags&=~DOCF_HAS_SONG; - } else - doc->flags=doc_e->de_flags& DOCEF_HIGHLIGHT | - doc->flags&~DOCEF_HIGHLIGHT; - - if (doc->head.next==doc) { - best_doc_e=doc; - best_col=0; - doc->cur_entry=doc; - doc->cur_col=0; - doc_e=doc; - } - skipped_update= doc_e==doc && doc->head.next!=doc; - - if (full_refresh) { - doc->min_x=MAX_I32; doc->min_y=MAX_I32; - doc->max_x=MIN_I32; doc->max_y=MIN_I32; - } - while (doc_e!=doc) { - while (TRUE) { - del_doc_e=FALSE; - if (doc_e->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP)) { - doc_e2=doc_e; - goto rc_skip; - } - MemCpy(&doc_e->settings,s,sizeof(CDocSettings)); - s=&doc_e->settings; - if (doc_e->de_flags & (DOCEF_TAG_CB|DOCEF_DEFINE) && - !(doc_e->de_flags & DOCEF_LST)) { - Free(doc_e->tag); - if (doc_e->de_flags & DOCEF_TAG_CB) { - if (doc_e->tag_cb) - doc_e->tag=(*doc_e->tag_cb)(doc,doc_e,mem_task); - else - doc_e->tag=StrNew("",mem_task); - } else { - if (temph=HashFind(doc_e->define_str, - win_task->hash_table,HTT_DEFINE_STR)) - doc_e->tag=StrNew(temph->data,mem_task); - else - doc_e->tag=CAlloc(1,mem_task); - } - doc_e->max_col=StrLen(doc_e->tag); - if (doc->cur_entry==doc_e && doc->cur_col>=doc_e->max_col) { - if (doc_e->max_col) - doc->cur_col=doc_e->max_col-1; - else - doc->cur_col=0; - } - } - k=DocWordWrapDel(doc,doc_e,full_refresh,same_win, - left_margin,right_margin,&best_doc_e,&best_col); - if (doc_e->de_flags & (DOCEF_LEFT_X|DOCEF_RIGHT_X|DOCEF_CENTER_X| - DOCEF_TOP_Y|DOCEF_BOTTOM_Y|DOCEF_CENTER_Y)) - DocRecalcXY(doc,doc_e,k, - left,width,height,left_margin,right_margin,x0,y0,&x,&y); - if (full_refresh && k>0 && doc->flags & DOCF_WORD_WRAP && - (doc_e2=DocWordWrapAdd(doc,doc_e,&k,left,right_margin,x,y))) - doc_e=doc_e2; - else - break; - } - - if (full_refresh) { - doc_e->x=x; - doc_e->y=y; - doc_e->page_line_num=doc->page_line_num; - if (xmin_x) doc->min_x=x; - if (ymin_y) doc->min_y=y; - if (find_cursor) { - D=DocCharDist(doc,x,y); - col=0; - } - } - col2=0; - - temp_u32_attr=DocTempAttr(doc,doc_e,cur_u8_attr); - if (doc_e==doc->cur_entry) { - cursor_y=doc_e->y; - if (recalc_flags&RECALCF_ADD_CURSOR && !added_cursor) { - if (doc_e->type_u8==DOCT_TEXT && 0cur_colde_flags & ~(DOCEF_TAG|DOCG_BL_IV_UL|DOCEF_WORD_WRAP| - DOCEF_HIGHLIGHT|DOCEF_SKIP|DOCEF_FILTER_SKIP)) && - !(doc_e->type&DOCG_BL_IV_UL)) { - added_cursor=DocSplitTag(doc,doc_e,doc->cur_col,x,y,DOCT_CURSOR); - k=StrLen(doc_e->tag); - } else { - added_cursor=doc_e2=DocEntryNewBase(doc, - DOCT_CURSOR|doc_e->type&0xFFFFFF00, - doc_e->de_flags&~DOCEG_HAS_ARG,x,y,doc->page_line_num); - MemCpy(&doc_e2->settings,&doc_e->settings,sizeof(CDocSettings)); - if (doc_e->type_u8==DOCT_TEXT && doc->cur_col>=k) - QueIns(doc_e2,doc_e); - else - QueInsRev(doc_e2,doc_e); - } - } - } - - if (doc_e->de_flags & DOCEF_REFRESH_DATA && - (doc_e->type_u8==DOCT_DATA || doc_e->type_u8==DOCT_CHECK_BOX || - doc_e->de_flags & DOCEF_LST)) { - DocDataFmt(doc,doc_e); - k=StrLen(doc_e->tag); - } - if (doc_e->de_flags&DOCEF_TAG) { - ptr=doc_e->tag; - if (doc_e->de_flags & DOCEF_TREE) { - if (k>=2) { - if (doc_e->de_flags & DOCEF_CHECKED_COLLAPSED) - *ptr++='+'; - else - *ptr++='-'; - *ptr++=']'; - ptr=doc_e->tag; - } - } else if (doc_e->de_flags & DOCEF_HAS_BIN) { - if (*ptr=='<' && full_refresh && '0'<=ptr[1]<='9') { - ptr=MStrPrint("<%d>",doc_e->bin_num); - Free(doc_e->tag); - doc_e->tag=StrNew(ptr,mem_task); - Free(ptr); - ptr=doc_e->tag; - k=StrLen(ptr); - } - } else if (doc_e->type_u8==DOCT_CHECK_BOX) { - if (k>=3) { - *ptr++='['; - if (doc_e->de_flags & DOCEF_CHECKED_COLLAPSED) - *ptr++='X'; - else - *ptr++=CH_SPACE; - *ptr++=']'; - ptr=doc_e->tag; - } - } - if (doc_e->de_flags & DOCEF_SCROLLING_X) { - j=StrLen(doc_e->tag); - if (j && doc_e->scroll_len) { - i_jif=ToI64(cur_time*FONT_WIDTH*DOC_SCROLL_SPEED)%(j*FONT_WIDTH); - temp_u32_attr=temp_u32_attr & 0xFFE0FF00| - (FONT_WIDTH-1-i_jif&(FONT_WIDTH-1))<<16; -#assert FONT_WIDTH==8 - i_jif>>=3; - for (k=0;kscroll_len;k++) { - ch=ptr[(i_jif+k)%j]; - if (!Bt(chars_bmp_displayable,ch)) ch='.'; - if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && - !(doc_e->de_flags&DOCEF_DONT_DRAW)) { - if (doc_e->de_flags & DOCEF_BORDER_PLOT && - !Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) - TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+ch); - else - TextChar(win_task,FALSE,x-x0,y-y0,temp_u32_attr+ch); - } - x++; - } - } - if (find_cursor) { - D=DocCharDist(doc,doc_e->x,doc_e->y); - col=doc_e->min_col; - } - col2=doc_e->scroll_len; //TODO This is flawed - } else { - if (doc_e->de_flags & DOCEF_BORDER_PLOT && - !Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) { - while (ch=*ptr++) { - if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && - !(doc_e->de_flags&DOCEF_DONT_DRAW)) - TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+ch); - else - if (find_cursor) { - d2=DocCharDist(doc,x,y); - if (d2type_u8==DOCT_TEXT && doc_e->de_flags&DOCEF_HIGHLIGHT) - hl=DocHighlight(doc_e,ptr,k,temp_u32_attr); - else - hl=NULL; - if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && - !(doc_e->de_flags&DOCEF_DONT_DRAW)) { -//Technically we should do this for scrolling_x, too. - if (y>y_plot_bottom) - more=TRUE; - else if (y>=y_plot_top) { - if (hl) - TextLenAttrStr(win_task,x-x0,y-y0,k,hl); - else - TextLenStr(win_task,x-x0,y-y0,k,temp_u32_attr,ptr); - } - col2+=k; - x+=k; - } else { - if (find_cursor) { - while (k--) { - d2=DocCharDist(doc,x,y); - if (d2type_u8] { - case DOCT_TEXT: - if (!col2 && !(doc_e->de_flags - &(DOCEF_TREE|DOCEF_LST|DOCEF_TAG_CB|DOCEF_DEFINE| - DOCEF_AUX_STR|DOCEF_HTML_LINK|DOCEF_BIN_PTR_LINK))) - del_doc_e=TRUE; - break; - case DOCT_HEX_ED: - if (doc_e->de_flags&DOCEF_DEREF_DATA && - !(doc_e->de_flags&DOCEF_REMALLOC_DATA)) - bptr=doc_e->data; - else - bptr=&doc_e->data; - k=doc_e->hex_ed_width; //columns - for (i=0;ilen;i+=k) { - if (doc_e->de_flags & DOCEF_ZERO_BASED) - StrPrint(buf,"%08tX ",i); - else - StrPrint(buf,"%08tX ",bptr); - ptr=buf; - while (ch=*ptr++) { - if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && - !(doc_e->de_flags&DOCEF_DONT_DRAW)) { - if (doc_e->de_flags & DOCEF_BORDER_PLOT && - !Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) - TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+ch); - else - TextChar(win_task,FALSE,x-x0,y-y0,temp_u32_attr+ch); - } - if (find_cursor) { - d2=DocCharDist(doc,x,y); - if (d2doc_e->len) k=doc_e->len-i; - for (j=0;jde_flags&DOCEF_DONT_DRAW)) { - if (doc_e->de_flags & DOCEF_BORDER_PLOT && - !Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) - TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+ch); - else - TextChar(win_task,FALSE,x-x0,y-y0,temp_u32_attr+ch); - } - if (find_cursor) { - d2=DocCharDist(doc,x,y); - if (d2hex_ed_width-k)*3; - for (j=0;jde_flags&DOCEF_DONT_DRAW)) { - if (doc_e->de_flags & DOCEF_BORDER_PLOT && - !Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) - TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+ch); - else - TextChar(win_task,FALSE,x-x0,y-y0,temp_u32_attr+ch); - } - if (find_cursor) { - d2=DocCharDist(doc,x,y); - if (d2hex_ed_width*3+k+9; - } - break; - case DOCT_NEW_LINE: - case DOCT_SOFT_NEW_LINE: - if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && - !(doc_e->de_flags&DOCEF_DONT_DRAW)&& - y_plot_top<=y<=y_plot_bottom) - TextLenAttr(win_task,x-x0,y-y0,width-(x-x0),cur_u8_attr<<8); - if (doc_e->de_flags&DOCEF_HIGHLIGHT && s->state==DOCSS_CPP_Z_COMMENT) - s->state=DOCSS_NORMAL; - y++; - doc->page_line_num++; -rc_start_of_line: - if (s->left_margin==DOC_DFT) - x=s->indent; - else - x=s->indent+s->left_margin; -rc_adjust_xy: - i=s->indent+s->left_margin; - if (xpage_line_num<0) - doc->page_line_num=s->page_len+doc->page_line_num%s->page_len; - else { - if (doc->page_line_num>=s->page_len) { - doc->page_line_num-=s->page_len; - if (doc->page_line_num>=s->page_len) //avoid extra divide - doc->page_line_num=doc->page_line_num%s->page_len; - } - } - if (s->header!=DOC_DFT) { - if (doc->page_line_numheader) { - y+=s->header-doc->page_line_num; - doc->page_line_num=s->header; - goto rc_start_of_line; - } - } - if (s->footer==DOC_DFT) { - if (doc->page_line_num>=s->page_len) { - if (s->header==DOC_DFT) - doc->page_line_num=0; - else { - doc->page_line_num=s->header; - y+=s->header; - } - goto rc_start_of_line; - } - } else { - if (doc->page_line_num>=s->page_len-s->footer) { - y+=s->footer; - if (s->header==DOC_DFT) - doc->page_line_num=0; - else { - doc->page_line_num=s->header; - y+=s->header; - } - goto rc_start_of_line; - } - } - break; - case DOCT_TAB: - k=(x+8) & ~7; - if (doc_e->de_flags & DOCEF_BORDER_PLOT && - !Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) { - while (xde_flags&DOCEF_DONT_DRAW)) - TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+CH_SPACE); - if (find_cursor) { - d2=DocCharDist(doc,x,y); - if (d2de_flags&DOCEF_DONT_DRAW)) { - if (y_plot_top<=y<=y_plot_bottom) - TextLenStr(win_task,x-x0,y-y0,k,temp_u32_attr," "); - x+=k; - } else { - if (find_cursor) { - while (k--) { - d2=DocCharDist(doc,x,y); - if (d2flags|=DOCF_BWD_MOVEMENT; - y+=s->page_len-doc_e->page_line_num; - doc->page_line_num=0; - goto rc_start_of_line; - case DOCT_CURSOR: - if (!find_cursor && !(doc->flags & DOCF_NO_CURSOR)) { - doc->cur_entry=doc_e->next; - doc->cur_col=doc->cur_entry->min_col; - } - if (doc_e!=added_cursor) - del_doc_e=TRUE; - break; - case DOCT_PMT: - cur_u8_attr=cur_u8_attr&0xF0|DOC_COLOR_PMT; - if (y==cursor_y) { - doc->cur_entry=doc_e->next; - doc->cur_col=doc->cur_entry->min_col; - } - break; - case DOCT_CLEAR: - next_clear_found=doc_e; - if (doc_e->de_flags&DOCEF_HOLD) - clear_holds=TRUE; - else - clear_holds=FALSE; - break; - case DOCT_PAGE_LEN: - s->page_len=doc_e->attr; - if (doc_e->de_flags & DOCEF_WIN_REL) - s->page_len+=height; - goto rc_adjust_xy; - case DOCT_LEFT_MARGIN: - i=doc_e->attr; - left_margin=left+i; - s->left_margin=i; - goto rc_start_of_line; - case DOCT_RIGHT_MARGIN: - if (doc_e->de_flags & DOCEF_WIN_REL) - i=width-1-doc_e->attr; - else - i=doc_e->attr; - right_margin=left+i; - s->right_margin=i; - goto rc_adjust_xy; - case DOCT_HEADER: - s->header=doc_e->attr; - goto rc_adjust_xy; - case DOCT_FOOTER: - s->footer=doc_e->attr; - goto rc_adjust_xy; - case DOCT_INDENT: - if (doc_e->de_flags & DOCEF_LEFT_X) - i=doc_e->attr; - else - i=s->indent+doc_e->attr; - s->indent=i; - goto rc_start_of_line; - case DOCT_FOREGROUND: - cur_u8_attr&=0xF0; - if (doc_e->attr==DOC_DFT) - cur_u8_attr|=s->dft_text_attr&0x0F; - else - cur_u8_attr|=doc_e->attr; - s->cur_text_attr=cur_u8_attr; - break; - case DOCT_BACKGROUND: - cur_u8_attr&=0x0F; - if (doc_e->attr==DOC_DFT) - cur_u8_attr|=s->dft_text_attr&0xF0; - else - cur_u8_attr|=doc_e->attr<<4; - s->cur_text_attr=cur_u8_attr; - break; - case DOCT_DFT_FOREGROUND: - cur_u8_attr&=0xF0; - if (doc_e->attr==DOC_DFT) - cur_u8_attr|=s->dft_text_attr&0xF; - else - cur_u8_attr|=doc_e->attr; - s->dft_text_attr=s->dft_text_attr&0xF0|cur_u8_attr&0x0F; - s->cur_text_attr=cur_u8_attr; - break; - case DOCT_DFT_BACKGROUND: - cur_u8_attr&=0x0F; - if (doc_e->attr==DOC_DFT) - cur_u8_attr|=s->dft_text_attr&0xF0; - else - cur_u8_attr|=doc_e->attr<<4; - s->dft_text_attr=s->dft_text_attr&0x0F|cur_u8_attr&0xF0; - s->cur_text_attr=cur_u8_attr; - break; - case DOCT_WORD_WRAP: - if (doc_e->attr) - doc->flags|=DOCF_WORD_WRAP; - else - doc->flags&=~DOCF_WORD_WRAP; - break; - case DOCT_HIGHLIGHT: - if (doc_e->attr) - doc->flags|=DOCF_HIGHLIGHT; - else - doc->flags&=~DOCF_HIGHLIGHT; - break; - case DOCT_BLINK: - if (doc_e->attr) - doc->flags|=DOCF_BLINK; - else - doc->flags&=~DOCF_BLINK; - break; - case DOCT_INVERT: - if (doc_e->attr) - doc->flags|=DOCF_INVERT; - else - doc->flags&=~DOCF_INVERT; - break; - case DOCT_UNDERLINE: - if (doc_e->attr) - doc->flags|=DOCF_UNDERLINE; - else - doc->flags&=~DOCF_UNDERLINE; - break; - case DOCT_SHIFTED_X: - s->shifted_x=doc_e->attr; - break; - case DOCT_SHIFTED_Y: - s->shifted_y=doc_e->attr; - break; - case DOCT_CURSOR_MOVEMENT: - doc->flags|=DOCF_BWD_MOVEMENT; - x+=doc_e->cursor_x_offset; - if (doc_e->de_flags & DOCEF_PAGE_REL_Y) { - i=doc->page_line_num; - if (doc_e->de_flags & DOCEF_TOP_Y) - doc->page_line_num=0; - else if (doc_e->de_flags & DOCEF_BOTTOM_Y) - doc->page_line_num=s->page_len-1; - else if (doc_e->de_flags & DOCEF_CENTER_Y) - doc->page_line_num=s->page_len>>1; - y+=doc->page_line_num-i; - } - y+=doc_e->cursor_y_offset; - doc->page_line_num+=doc_e->cursor_y_offset; - goto rc_adjust_xy; - case DOCT_SPRITE: - if (!doc_e->bin_data && doc->flags&DOCEF_HAS_BIN) - doc_e->bin_data=DocBinFindNum(doc,doc_e->bin_num); - if ((tempb=doc_e->bin_data) && - !tempb->tag && doc_e->tag && *doc_e->tag) - tempb->tag=StrNew(doc_e->tag,mem_task); - if (tempb && dc) { - DCRst(dc); - dc->flags&=~(DCF_DONT_DRAW|DCF_LOCATE_NEAREST); - if (recalc_flags&RECALCG_MASK!=RECALCt_TO_SCREEN || - doc_e->de_flags&DOCEF_DONT_DRAW) - dc->flags|=DCF_DONT_DRAW; - bptr=tempb->data; - ii=SpriteTypeMask(bptr); - if (ii&1<>4 &0xF ^ win_task->text_attr>>4 & 0xF; - else { - i=temp_u32_attr>>12&0xF ^ win_task->text_attr>>4 & 0xF; - if (temp_u32_attr & DOCET_SEL) - i^=0xF; - if (temp_u32_attr & DOCET_INVERT) - i^=0xF; - if (blink_flag && - (doc_e==doc->cur_entry || temp_u32_attr&DOCET_BLINK)) - i^=0xF; - } - dc->color=i; - if (find_cursor) - dc->flags|=DCF_LOCATE_NEAREST; - if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && - doc->cur_sprite==bptr) { - dc->flags|=DCF_LOCATE_NEAREST; - dc->cur_x=ip.pos.x; - dc->cur_y=ip.pos.y; - } else { - dc->cur_x=(doc->x-x0)*FONT_WIDTH+pix_left+scroll_x; - dc->cur_y=(doc->y-y0)*FONT_HEIGHT+pix_top+scroll_y; - } - dc->cur_z=0; - dc->bkcolor=i; - if (doc_e->de_flags & DOCEF_FROM_START) { - xx=(x-k-x0)*FONT_WIDTH; //TODO: scrolling text is not length k - yy=(y-y0)*FONT_HEIGHT; - zz=0; - } else { - xx=(x-x0)*FONT_WIDTH; - yy=(y-y0)*FONT_HEIGHT; - zz=0; - } - if (ii&(1<depth_buf; - } else - dc->depth_buf=depth_buf; - Mat4x4IdentEqu(dc->r); - Mat4x4RotZ(dc->r,cur_time*3.1); - Mat4x4RotY(dc->r,cur_time*1.9); - Mat4x4RotX(dc->r,cur_time); - dc->flags|=DCF_TRANSFORMATION; - dc->x=xx; - dc->y=yy; - dc->z=GR_Z_ALL; - xx=0; yy=0; zz=0; - } - Sprite3(dc,xx,yy,zz,bptr); - dc->depth_buf=NULL; - if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && - doc->cur_sprite==bptr) - doc->nearest_sprite_elem_num=dc->nearest_sprite_elem_num; - dc->flags&=~(DCF_LOCATE_NEAREST|DCF_DONT_DRAW|DCF_TRANSFORMATION); - if (dc->nearest_dist<=D) { - D=dc->nearest_dist; - col=doc_e->min_col; - } - } - break; - case DOCT_SONG: - if (sys_focus_task==win_task && - recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && - !(doc_e->de_flags&DOCEF_DONT_DRAW)) { - if (doc_e->aux_str && - (!music.cur_song || StrCmp(music.cur_song,doc_e->aux_str))) { - Free(music.cur_song); - MusicSettingsRst; - music.cur_song=AStrNew(doc_e->aux_str); - } - } - doc->flags|=DOCF_HAS_SONG; - break; - case DOCT_HTML_CODE: - if (recalc_flags&RECALCF_TO_HTML && - doc_e->de_flags&DOCEF_TAG && doc_e->tag) - x-=StrLen(doc_e->tag); - break; - case DOCT_NUM_TYPES-1: //nobound switch - default: - break; - } - - if (doc_e->de_flags & DOCEF_HAS_BORDER) - TextBorder(win_task,doc_e->x-x0,x-x0-1,doc_e->y-y0,y-y0, - temp_u32_attr.u8[1],ToBool(doc_e->de_flags & DOCEF_SOLID_BORDER)); - if (full_refresh) { - switch (doc_e->type_u8) { - case DOCT_CHECK_BOX: - doc_e->max_col=2; - break; - case DOCT_LST: - case DOCT_TREE: - case DOCT_BUTTON: - case DOCT_LINK: - case DOCT_MENU_VAL: - case DOCT_MACRO: - doc_e->max_col=1; - break; - default: - if (doc_e->de_flags & (DOCEF_TREE|DOCEF_LST)) - doc_e->max_col=1; - else - doc_e->max_col=col2; - } - - if (x>doc->max_x) doc->max_x=x; - if (y>doc->max_y) doc->max_y=y; - if (D<=best_d && !(doc_e->de_flags&DOCEF_NO_CLICK_ON)) { - best_d=D; - best_doc_e=doc_e; - best_col=col; - } - if (doc_e->de_flags & DOCEF_TREE) { - if (doc_e->de_flags & DOCEF_CHECKED_COLLAPSED) - tree_collapsed=TRUE; - else - tree_collapsed=FALSE; - doc_e2=doc_e->next; - while (doc_e2!=doc && doc_e2->type_u8!=DOCT_INDENT && - !(doc_e2->de_flags & DOCEF_TREE)) - doc_e2=doc_e2->next; - if (doc_e2->type_u8==DOCT_INDENT) { - j=i=s->indent; - do { - if (tree_collapsed) - doc_e2->de_flags|=DOCEF_SKIP; - else - doc_e2->de_flags&=~DOCEF_SKIP; - if (doc_e2->type_u8==DOCT_INDENT) { - if (doc_e2->de_flags & DOCEF_LEFT_X) - j=doc_e2->attr; - else - j+=doc_e2->attr; - } - doc_e2=doc_e2->next; - } while (doc_e2!=doc && j>i); - } - } - } - - doc_e2=doc_e->next; -rc_skip: - while (doc_e2!=doc && doc_e2->de_flags&(DOCEF_SKIP|DOCEF_FILTER_SKIP)) { - if (doc_e2==doc->cur_entry) { - doc->cur_entry=doc_e2->next; - doc->cur_col=doc->cur_entry->min_col; - } - if (full_refresh) { - doc_e2->x=x; - doc_e2->y=y; - doc_e2->page_line_num=doc->page_line_num; - MemCpy(&doc_e2->settings,s,sizeof(CDocSettings)); - doc_e2->type.u8[1]=cur_u8_attr; - doc_e2->de_flags=doc->flags - &(DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT) | - doc_e2->de_flags&~(DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT); - } - doc_e2=doc_e2->next; - } - - if (full_refresh) { - if (del_doc_e) { - if (!(doc_e->de_flags & (DOCEF_HOLD|DOCEF_FILTER_SKIP))) { - if (doc_e==doc->cur_entry) { - doc->cur_entry=doc_e2; - doc->cur_col=doc_e2->min_col; - } - if (best_doc_e==doc_e) { - best_doc_e=doc_e2; - best_col=doc_e2->min_col; //TODO: might be bug - } - DocEntryDel(doc,doc_e); - } - } - } - num_entries++; - if (!full_refresh && doc_e->y>y_plot_bottom) - break; - doc_e=doc_e2; - } - - if (full_refresh) { - if (doc->cur_entry==doc && recalc_flags&RECALCF_ADD_CURSOR) { - doc_e2=DocEntryNewBase(doc,DOCT_CURSOR,,x,y,doc->page_line_num); - MemCpy(&doc_e2->settings,s,sizeof(CDocSettings)); - QueInsRev(doc_e2,doc); - } - - if (doc->min_x>doc->max_x) { - doc->max_x=0; - doc->min_x=0; - } - if (doc->min_y>doc->max_y) { - doc->max_y=0; - doc->min_y=0; - } - - //Update header - if (!skipped_update) { - doc_e->x=x; - doc_e->y=y; - doc_e->page_line_num=doc->page_line_num; - MemCpy(&doc_e->settings,s,sizeof(CDocSettings)); - doc_e->type.u8[1]=cur_u8_attr; - if (find_cursor) { - D=DocCharDist(doc,x,y); - if (Dde_flags&DOCEF_NO_CLICK_ON)) { - best_d=D; - best_doc_e=doc_e; - best_col=0; - } - } - } - if (doc->flags & DOCF_MIN_SIZE) { - if (Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) { - if (left<0) - left=0; - i=left+doc->max_x-doc->min_x; - if (i>TEXT_COLS-1) - i=TEXT_COLS-1; - WinHorz(left,i,win_task); - if (top<0) - top=0; - i=top+doc->max_y-doc->min_y; - if (i>TEXT_ROWS-1) - i=TEXT_ROWS-1; - WinVert(top,i,win_task); - } else { - if (left<1) - left=1; - i=left+doc->max_x-doc->min_x; - if (i>TEXT_COLS-2) - i=TEXT_COLS-2; - WinHorz(left,i,win_task); - if (top<1) - top=1; - i=top+doc->max_y-doc->min_y; - if (i>TEXT_ROWS-2) - i=TEXT_ROWS-2; - WinVert(top,i,win_task); - } - } - if (find_cursor) { - doc->cur_entry=best_doc_e; - doc->cur_col=best_col; - DocFormBwd(doc); -//We need this because text coordinates are used - if (best_dbest_d=best_d; - } - - if (doc->cur_entry->type_u8!=DOCT_HEX_ED) { - doc->y=doc->cur_entry->y; - doc->x=doc->cur_entry->x+doc->cur_col; - } else { - doc->y=doc->cur_entry->y+doc->cur_col/3/doc->cur_entry->hex_ed_width; - x=doc->cur_col%(doc->cur_entry->hex_ed_width*3); - i=x/doc->cur_entry->hex_ed_width; - doc->x=doc->cur_entry->x+9; - if (i<2) - doc->x+=x>>1*3+x&1; - else - doc->x+=doc->cur_entry->hex_ed_width*3+ - (x-doc->cur_entry->hex_ed_width<<1); - } - doc->line=doc->y+1; - doc->col=doc->x+1; - - if (recalc_flags&RECALCF_HAS_CURSOR) { - if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN) { - x=0; - y=0; - } else { - x=scroll_x/FONT_WIDTH; - y=scroll_y/FONT_HEIGHT; - } - if (doc->top_line_num-y+height-1>doc->max_y) - doc->top_line_num=doc->max_y-(height-1)+y; - if (doc->top_line_num-ymin_y) - doc->top_line_num=doc->min_y+y; - - if (doc->y-doc->top_line_num+y>height-1) - doc->top_line_num=doc->y-(height-1)+y; - if (doc->y-doc->top_line_num+y<0) - doc->top_line_num=doc->y+y; - - if (doc->line_start_col-x+width-1>doc->max_x) - doc->line_start_col=doc->max_x-(width-1)+x; - if (doc->line_start_col-xmin_x) - doc->line_start_col=doc->min_x+x; - - if (doc->x-doc->line_start_col+x>width-1) - doc->line_start_col=doc->x-(width-1)+x; - if (doc->x-doc->line_start_col+x<0) - doc->line_start_col=doc->x+x; - } - } - if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && - recalc_flags&RECALCF_HAS_CURSOR) { - x=doc->x-doc->line_start_col+left +scroll_x/FONT_WIDTH; - y=doc->y-doc->top_line_num+top+scroll_y/FONT_HEIGHT; - if (0<=x<=right && 0<=y<=bottom && - xflags&DOCF_HIDE_CURSOR)) { - u32_ptr=gr.text_base+y*TEXT_COLS+x; - *u32_ptr|=DOCET_BLINK; - *u32_ptr^=0xFF00; - } - if (full_refresh) { - if (!(doc->flags&DOCF_NO_SCROLL_BARS)) { - if (!Bt(&hss->flags,WSSf_SET_TO_POS)) { - hss->min=doc->min_x; - if (doc->max_x-width+1min) - hss->max=hss->min; - else - hss->max=doc->max_x-width+1; - hss->pos=doc->line_start_col; - } - if (!Bt(&vss->flags,WSSf_SET_TO_POS)) { - vss->min=doc->min_y; - if (doc->max_y-height+1min) - vss->max=vss->min; - else - vss->max=doc->max_y-height+1; - vss->pos=doc->top_line_num; - } - } - LBEqu(&doc->flags,DOCf_MORE,more); - } - } - if (!same_win) { - doc->old_win_top=top; - doc->old_win_bottom=bottom; - doc->old_win_left=left; - doc->old_win_right=right; - doc->old_cur_entry=doc->cur_entry; - doc->old_cur_col=doc->old_cur_col; - } - if (doc->flags & DOCF_HAS_SONG) - LBts(&win_task->task_flags,TASKf_HAS_SONG); - if (full_refresh) { - i=num_entries-doc->max_entries; - if (next_clear_found) { - DocDelToEntry(doc,next_clear_found,clear_holds); - DocRecalc(doc,recalc_flags); - } else if (i>1024) { - DocDelToNum(doc,i); - DocRecalc(doc,recalc_flags); - } - } - DCDel(dc); - Free(depth_buf); - if (unlock) - DocUnlock(doc); - return TRUE; -} diff --git a/Adam/DolDoc/DocRecalc.HC b/Adam/DolDoc/DocRecalc.HC new file mode 100644 index 0000000..a7f6f14 --- /dev/null +++ b/Adam/DolDoc/DocRecalc.HC @@ -0,0 +1,1334 @@ +#help_index "DolDoc" + +I64 DocWordWrapDel(CDoc *doc,CDocEntry *doc_e, + Bool full_refresh,Bool same_win,I64 left_margin,I64 right_margin, + CDocEntry **_best_doc_e,I64 *_best_col) +{ + CDocEntry *doc_e2; + U8 *ptr; + I64 j,k; + if (doc_e->de_flags&DOCEF_TAG && doc_e->tag) + k=StrLen(doc_e->tag); + else + k=0; + if (full_refresh) + while (TRUE) { + doc_e2=doc_e->next; + if (doc_e2->type_u8==DOCT_SOFT_NEW_LINE && !same_win) { + if (doc->cur_entry==doc_e2) { + doc->cur_entry=doc_e2->next; + doc->cur_col=doc->cur_entry->min_col; + } + if (*_best_doc_e==doc_e2) { + *_best_doc_e=doc_e2->next; + *_best_col=0; + } + DocEntryDel(doc,doc_e2); + } else if (IsEditableText(doc_e) && + doc_e->de_flags==doc_e2->de_flags && doc_e->type==doc_e2->type) { + j=StrLen(doc_e2->tag); + ptr=MAlloc(k+j+1,doc->mem_task); + MemCpy(ptr,doc_e->tag,k); + MemCpy(ptr+k,doc_e2->tag,j+1); + Free(doc_e->tag); + doc_e->tag=ptr; + if (doc->cur_entry==doc_e2) { + doc->cur_entry=doc_e; + doc->cur_col+=k; + } + if (*_best_doc_e==doc_e2) { + *_best_doc_e=doc_e; + *_best_col=0; + } + DocEntryDel(doc,doc_e2); + k+=j; + if (k>(right_margin-left_margin+1)<<1) + break; + } else + break; + } + if (doc_e->de_flags & DOCEF_SCROLLING_X) + k=doc_e->scroll_len; + return k; +} + +U0 DocRecalcXY(CDoc *doc,CDocEntry *doc_e, + I64 k,I64 left,I64 width,I64 height,I64 left_margin,I64 right_margin, + I64 x0,I64 y0,I64 *_x,I64 *_y) +{ + I64 i,x=*_x,y=*_y; + if (doc_e->de_flags & DOCEF_MARGIN_REL_X) { + if (doc_e->de_flags & DOCEF_LEFT_X) + x=left_margin-left; + else if (doc_e->de_flags & DOCEF_RIGHT_X) + x=right_margin-(k-1)-left; + else if (doc_e->de_flags & DOCEF_CENTER_X) + x=(right_margin+left_margin)>>1-k>>1-left; + } else { + if (doc_e->de_flags & DOCEF_LEFT_X) + x=x0; + else if (doc_e->de_flags & DOCEF_RIGHT_X) + x=width+x0-k; + else if (doc_e->de_flags & DOCEF_CENTER_X) + x=(width+x0-k)>>1; + } + i=y; + if (doc_e->de_flags & DOCEF_PAGE_REL_Y) { + doc->flags|=DOCF_BWD_MOVEMENT; + if (doc_e->de_flags & DOCEF_TOP_Y) + y-=doc_e->page_line_num; + else if (doc_e->de_flags & DOCEF_BOTTOM_Y) + y+=doc_e->settings.page_len-doc_e->page_line_num; + else if (doc_e->de_flags & DOCEF_CENTER_Y) + y+=doc_e->settings.page_len>>1-doc_e->page_line_num; + } else { + doc->flags|=DOCF_BWD_MOVEMENT; + if (doc_e->de_flags & DOCEF_TOP_Y) + y=y0; + else if (doc_e->de_flags & DOCEF_BOTTOM_Y) + y=height-1+y0; + else if (doc_e->de_flags & DOCEF_CENTER_Y) + y=height>>1+y0; + } + if (y!=i) { + doc->page_line_num+=y-i; + if (doc->page_line_num<0) + doc->page_line_num=doc_e->settings.page_len+ + doc->page_line_num%doc_e->settings.page_len; + else + doc->page_line_num=doc->page_line_num%doc_e->settings.page_len; + if (doc_e->settings.header!=DOC_DFT && + doc->page_line_numsettings.header) { + y+=doc_e->settings.header-doc->page_line_num; + doc->page_line_num=doc_e->settings.header; + } + if (doc_e->settings.footer==DOC_DFT) { + if (doc->page_line_num>=doc_e->settings.page_len) { + if (doc_e->settings.header==DOC_DFT) + doc->page_line_num=0; + else { + doc->page_line_num=doc_e->settings.header; + y+=doc_e->settings.header; + } + } + } else { + if (doc->page_line_num>= + doc_e->settings.page_len-doc_e->settings.footer) { + y+=doc_e->settings.footer; + if (doc_e->settings.header==DOC_DFT) + doc->page_line_num=0; + else { + doc->page_line_num=doc_e->settings.header; + y+=doc_e->settings.header; + } + } + } + } + *_x=x; + *_y=y; +} + +CDocEntry *DocSplitTag(CDoc *doc,CDocEntry *doc_e,I64 i,I64 x,I64 y,I64 type_u8) +{//Split tag at i, insert DOCT_SOFT_NEW_LINE, DOCT_MARKER or DOCT_CURSOR + U8 *ptr; + CDocEntry *doc_e2; + if (doc_e->type_u8==DOCT_TEXT && i) { + if (itag)) { + doc_e2=MAllocIdent(doc_e,doc->mem_task); + doc_e2->tag=StrNew(doc_e->tag+i,doc->mem_task); + doc_e2->de_flags=doc_e->de_flags&~DOCEG_HAS_ALLOC|DOCEF_TAG; + QueIns(doc_e2,doc_e); + if (doc->cur_entry==doc_e && doc->cur_col>=i) { + doc->cur_entry=doc_e2; + doc->cur_col=doc->cur_col-i; + } + doc_e->tag[i]=0; + ptr=StrNew(doc_e->tag,doc->mem_task); + Free(doc_e->tag); + doc_e->tag=ptr; + } + } else + doc_e=doc_e->last; + doc_e2=DocEntryNewBase(doc,type_u8|doc_e->type & 0xFFFFFF00, + doc_e->de_flags&~DOCEG_HAS_ARG,x,y,doc_e->page_line_num); + MemCpy(&doc_e2->settings,&doc_e->settings,sizeof(CDocSettings)); + QueIns(doc_e2,doc_e); + return doc_e2; +} + +CDocEntry *DocWordWrapAdd(CDoc *doc,CDocEntry *doc_e, + I64 *_k,I64 left,I64 right_margin,I64 x,I64 y) +{ + CDocEntry *doc_e2; + I64 j,i=right_margin+1-(x+left), //Space left on line + ii=x+1-doc_e->settings.left_margin; + if (IsEditableText(doc_e)) { + if (doc->cur_entry==doc_e->next) { + if (doc->cur_col==doc_e->next->min_col) + i--; + } else { + if (doc->cur_entry==doc_e && doc->cur_col==i) + i--; + } + if (*_k>i) { + for (j=i;j>8-ii && j>=0;j--) + if (doc_e->tag[j]==CH_SPACE || doc_e->tag[j]==CH_SHIFT_SPACE) { + i=j+1; + break; + } + if (0tag); + return NULL; + } + } + if (*_k==i) + return NULL; + } + if (*_k>=i) { + doc_e2=doc_e->last; + if (doc_e2->type_u8!=DOCT_SOFT_NEW_LINE && + doc_e2->type_u8!=DOCT_NEW_LINE && + doc_e2->type_u8!=DOCT_CURSOR_MOVEMENT) { + doc_e2=DocEntryNewBase(doc,DOCT_SOFT_NEW_LINE|doc_e->type&0xFFFFFF00, + DOCEF_WORD_WRAP|doc_e->de_flags&(DOCEF_HIGHLIGHT|DOCG_BL_IV_UL| + DOCEF_SKIP|DOCEF_FILTER_SKIP),x,y,doc_e->last->page_line_num); + MemCpy(&doc_e2->settings,&doc_e->settings,sizeof(CDocSettings)); + QueIns(doc_e2,doc_e->last); + return doc_e2; + } + } + return NULL; +} + +I64 DocTempAttr(CDoc *doc,CDocEntry *doc_e,I64 cur_u8_attr) +{ + I64 temp_u32_attr; + doc_e->de_flags=doc->flags& (DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT) | + doc_e->de_flags&~(DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT); + temp_u32_attr=(cur_u8_attr&0xF0)<<8| + doc->flags&DOCG_BL_IV_UL|(doc_e->settings.shifted_x&0x1F)<<16| + (doc_e->settings.shifted_y&0x1F)<<21; + if (doc_e->de_flags & DOCEF_HAS_BIN && *doc_e->tag=='<') + temp_u32_attr.u8[1]|=DOC_COLOR_BIN; + else + switch (doc_e->type_u8) { + case DOCT_SPRITE: + if (doc_e->de_flags & DOCEF_LEFT_EXP) + temp_u32_attr.u8[1]|=cur_u8_attr&15; + else if (doc_e->de_flags & DOCEF_LINK) + temp_u32_attr.u8[1]|=DOC_COLOR_LINK; + else if (doc_e->de_flags & DOCEF_LEFT_MACRO) + temp_u32_attr.u8[1]|=DOC_COLOR_MACRO; + else if (doc_e->de_flags & (DOCEF_TREE|DOCEF_LST)) + temp_u32_attr.u8[1]|=DOC_COLOR_TREE; + else + temp_u32_attr.u8[1]|=DOC_COLOR_BIN; + break; + case DOCT_HTML_CODE: + temp_u32_attr.u8[1]|=DOC_COLOR_BIN; + break; + case DOCT_LINK: + temp_u32_attr.u8[1]|=DOC_COLOR_LINK; + break; + case DOCT_MACRO: + temp_u32_attr.u8[1]|=DOC_COLOR_MACRO; + break; + case DOCT_ANCHOR: + temp_u32_attr.u8[1]|=DOC_COLOR_ANCHOR; + break; + case DOCT_TREE: + case DOCT_LST: + temp_u32_attr.u8[1]|=DOC_COLOR_TREE; + break; + default: + temp_u32_attr.u8[1]|=cur_u8_attr&15; + } + doc_e->type.u8[1]=temp_u32_attr.u8[1]; + temp_u32_attr|=doc_e->type&0xFFFF0000; + if (doc_e==doc->cur_entry && !(doc->flags&DOCF_DONT_HIGHLIGHT_CURSOR) && + doc_e->type_u8!=DOCT_TEXT) + temp_u32_attr^=0xFF00; + doc_e->settings.final_u32_attr=temp_u32_attr; + return temp_u32_attr; +} + +public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL) +{//Recalc and fmt. Also used by WinMgr to draw on screen. + I64 i,ii,j,k,x,x0,y,y0,D,d2,col,col2,best_col=0,best_d=MAX_I64,xx,yy,zz, + num_entries=0,i_jif,cur_u8_attr,temp_u32_attr, + cursor_y=MIN_I64,left_margin,right_margin,y_plot_top,y_plot_bottom, + top,left,bottom,right,width,height,scroll_x,scroll_y,pix_top,pix_left; + CDocEntry reg *doc_e,reg *doc_e2,*best_doc_e,*next_clear_found=NULL, + *added_cursor=NULL; + CDocBin *tempb; + CDocSettings *s; + Bool del_doc_e,skipped_update,tree_collapsed,same_win,more=FALSE, + find_cursor=FALSE,blink_flag,full_refresh=TRUE,unlock,clear_holds; + CTask *win_task,*mem_task; + CDC *dc; + U8 *bptr,*ptr,buf[STR_LEN],ch; + U32 *u32_ptr,*hl; + I32 *depth_buf=NULL; + F64 cur_time=tS; + CWinScroll *vss,*hss; + CHashDefineStr *temph; + + if (!doc || doc->doc_signature!=DOC_SIGNATURE_VAL) return FALSE; + + //WinMgr updates all wins $TX,"30",D="WINMGR_FPS"$, 33.33333mS + if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && doc->owning_task!=Fs) { + i_jif=cnts.jiffies+JIFFY_FREQ/250; //4 ms + while (Bt(&doc->locked_flags,DOClf_LOCKED)) { + if (cnts.jiffies>=i_jif) + return FALSE; //Bail-out if doc locked. + Yield; + } + } + + unlock=DocLock(doc); + if (doc->doc_signature!=DOC_SIGNATURE_VAL) { + DocUnlock(doc); + return FALSE; + } + + win_task=doc->win_task; + mem_task=doc->mem_task; + blink_flag=Blink; + dc=NULL; + switch [recalc_flags&RECALCG_MASK] { + case RECALCt_FIND_CURSOR: + find_cursor=TRUE; + if (win_task) + dc=DCAlias(gr.dc2,win_task); //Necessary for sprites + break; + case RECALCt_TO_SCREEN: + if (doc->updates_cnt++%(ToI64(winmgr.fps/10)+1) && + !Bt(&doc->flags,DOCf_DO_FULL_REFRESH) && + !(doc->flags&DOCF_BWD_MOVEMENT)) + full_refresh=FALSE; + if (win_task) + dc=DCAlias(gr.dc2,win_task); + break; + } + + PUSHFD + CLI + left =win_task->win_left; + right =win_task->win_right; + width =win_task->win_width; + scroll_x=win_task->scroll_x; + scroll_y=win_task->scroll_y; + top =win_task->win_top; + bottom=win_task->win_bottom; + height=win_task->win_height; + pix_left =win_task->pix_left; + pix_top =win_task->pix_top; + left_margin=left; + right_margin=right; + POPFD + if (doc->flags&DOCF_BORDER_DOC) { + scroll_x=0; + scroll_y=0; + } + best_doc_e=doc->cur_entry; + + if (!(doc->flags&(DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS)) && + FilesFindMatch(doc->filename.name,FILEMASK_SRC)) + doc->flags|=DOCF_HIGHLIGHT; + else + doc->flags&=~DOCF_HIGHLIGHT; + + x=y=0; + doc->page_line_num=0; + if (full_refresh && !find_cursor) { + doc->x=x; + doc->y=y; + } + + hss=&win_task->horz_scroll; + vss=&win_task->vert_scroll; + if (doc->flags&DOCF_BORDER_DOC) { + doc->top_line_num=0; + doc->line_start_col=0; + recalc_flags&=~RECALCF_HAS_CURSOR; + if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN) + doc->settings_head.cur_text_attr= + doc->settings_head.dft_text_attr=win_task->border_attr; + } else { + if (recalc_flags&RECALCF_HAS_CURSOR && full_refresh) { + if (Bt(&hss->flags,WSSf_SET_TO_POS)||Bt(&vss->flags,WSSf_SET_TO_POS)) { + if (!(doc->flags&DOCF_NO_SCROLL_BARS)) { + if (Bt(&hss->flags,WSSf_SET_TO_POS)) { + doc->line_start_col=hss->pos; + LBtr(&hss->flags,WSSf_SET_TO_POS); + } + if (Bt(&vss->flags,WSSf_SET_TO_POS)) { + doc->top_line_num=vss->pos; + LBtr(&vss->flags,WSSf_SET_TO_POS); + } + } + doc->x=doc->line_start_col+width/2; + doc->y=doc->top_line_num+height/2; + find_cursor=TRUE; + } + } + if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN) + doc->settings_head.cur_text_attr= + doc->settings_head.dft_text_attr=win_task->text_attr; + } + x0=doc->line_start_col; + y0=doc->top_line_num; + same_win=top ==doc->old_win_top && + bottom==doc->old_win_bottom && + left ==doc->old_win_left && + right ==doc->old_win_right && + doc->cur_entry==doc->old_cur_entry && + doc->cur_col==doc->old_cur_col; + if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN) { + y_plot_top=y0-scroll_y/FONT_HEIGHT; + y_plot_bottom=y0+height-1-scroll_y/FONT_HEIGHT; + if (!(doc->flags&DOCF_BORDER_DOC) && + !Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) + DocBorderLstDraw(doc); + } + + if (doc->cur_col<=doc->cur_entry->min_col) + doc->cur_col=doc->cur_entry->min_col; + doc_e=doc->head.next; + doc_e->de_flags&=~(DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT); + if (doc_e==doc->head.next) + s=&doc->settings_head; + else + s=&doc_e->last->settings; + doc->flags=doc_e->de_flags& (DOCG_BL_IV_UL|DOCEF_WORD_WRAP) | + doc->flags&~(DOCG_BL_IV_UL|DOCEF_WORD_WRAP); + cur_u8_attr=s->cur_text_attr; + if (doc_e==doc->head.next) { + doc->flags&=~DOCF_BWD_MOVEMENT; + if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && full_refresh) + doc->flags&=~DOCF_HAS_SONG; + } else + doc->flags=doc_e->de_flags& DOCEF_HIGHLIGHT | + doc->flags&~DOCEF_HIGHLIGHT; + + if (doc->head.next==doc) { + best_doc_e=doc; + best_col=0; + doc->cur_entry=doc; + doc->cur_col=0; + doc_e=doc; + } + skipped_update= doc_e==doc && doc->head.next!=doc; + + if (full_refresh) { + doc->min_x=MAX_I32; doc->min_y=MAX_I32; + doc->max_x=MIN_I32; doc->max_y=MIN_I32; + } + while (doc_e!=doc) { + while (TRUE) { + del_doc_e=FALSE; + if (doc_e->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP)) { + doc_e2=doc_e; + goto rc_skip; + } + MemCpy(&doc_e->settings,s,sizeof(CDocSettings)); + s=&doc_e->settings; + if (doc_e->de_flags & (DOCEF_TAG_CB|DOCEF_DEFINE) && + !(doc_e->de_flags & DOCEF_LST)) { + Free(doc_e->tag); + if (doc_e->de_flags & DOCEF_TAG_CB) { + if (doc_e->tag_cb) + doc_e->tag=(*doc_e->tag_cb)(doc,doc_e,mem_task); + else + doc_e->tag=StrNew("",mem_task); + } else { + if (temph=HashFind(doc_e->define_str, + win_task->hash_table,HTT_DEFINE_STR)) + doc_e->tag=StrNew(temph->data,mem_task); + else + doc_e->tag=CAlloc(1,mem_task); + } + doc_e->max_col=StrLen(doc_e->tag); + if (doc->cur_entry==doc_e && doc->cur_col>=doc_e->max_col) { + if (doc_e->max_col) + doc->cur_col=doc_e->max_col-1; + else + doc->cur_col=0; + } + } + k=DocWordWrapDel(doc,doc_e,full_refresh,same_win, + left_margin,right_margin,&best_doc_e,&best_col); + if (doc_e->de_flags & (DOCEF_LEFT_X|DOCEF_RIGHT_X|DOCEF_CENTER_X| + DOCEF_TOP_Y|DOCEF_BOTTOM_Y|DOCEF_CENTER_Y)) + DocRecalcXY(doc,doc_e,k, + left,width,height,left_margin,right_margin,x0,y0,&x,&y); + if (full_refresh && k>0 && doc->flags & DOCF_WORD_WRAP && + (doc_e2=DocWordWrapAdd(doc,doc_e,&k,left,right_margin,x,y))) + doc_e=doc_e2; + else + break; + } + + if (full_refresh) { + doc_e->x=x; + doc_e->y=y; + doc_e->page_line_num=doc->page_line_num; + if (xmin_x) doc->min_x=x; + if (ymin_y) doc->min_y=y; + if (find_cursor) { + D=DocCharDist(doc,x,y); + col=0; + } + } + col2=0; + + temp_u32_attr=DocTempAttr(doc,doc_e,cur_u8_attr); + if (doc_e==doc->cur_entry) { + cursor_y=doc_e->y; + if (recalc_flags&RECALCF_ADD_CURSOR && !added_cursor) { + if (doc_e->type_u8==DOCT_TEXT && 0cur_colde_flags & ~(DOCEF_TAG|DOCG_BL_IV_UL|DOCEF_WORD_WRAP| + DOCEF_HIGHLIGHT|DOCEF_SKIP|DOCEF_FILTER_SKIP)) && + !(doc_e->type&DOCG_BL_IV_UL)) { + added_cursor=DocSplitTag(doc,doc_e,doc->cur_col,x,y,DOCT_CURSOR); + k=StrLen(doc_e->tag); + } else { + added_cursor=doc_e2=DocEntryNewBase(doc, + DOCT_CURSOR|doc_e->type&0xFFFFFF00, + doc_e->de_flags&~DOCEG_HAS_ARG,x,y,doc->page_line_num); + MemCpy(&doc_e2->settings,&doc_e->settings,sizeof(CDocSettings)); + if (doc_e->type_u8==DOCT_TEXT && doc->cur_col>=k) + QueIns(doc_e2,doc_e); + else + QueInsRev(doc_e2,doc_e); + } + } + } + + if (doc_e->de_flags & DOCEF_REFRESH_DATA && + (doc_e->type_u8==DOCT_DATA || doc_e->type_u8==DOCT_CHECK_BOX || + doc_e->de_flags & DOCEF_LST)) { + DocDataFmt(doc,doc_e); + k=StrLen(doc_e->tag); + } + if (doc_e->de_flags&DOCEF_TAG) { + ptr=doc_e->tag; + if (doc_e->de_flags & DOCEF_TREE) { + if (k>=2) { + if (doc_e->de_flags & DOCEF_CHECKED_COLLAPSED) + *ptr++='+'; + else + *ptr++='-'; + *ptr++=']'; + ptr=doc_e->tag; + } + } else if (doc_e->de_flags & DOCEF_HAS_BIN) { + if (*ptr=='<' && full_refresh && '0'<=ptr[1]<='9') { + ptr=MStrPrint("<%d>",doc_e->bin_num); + Free(doc_e->tag); + doc_e->tag=StrNew(ptr,mem_task); + Free(ptr); + ptr=doc_e->tag; + k=StrLen(ptr); + } + } else if (doc_e->type_u8==DOCT_CHECK_BOX) { + if (k>=3) { + *ptr++='['; + if (doc_e->de_flags & DOCEF_CHECKED_COLLAPSED) + *ptr++='X'; + else + *ptr++=CH_SPACE; + *ptr++=']'; + ptr=doc_e->tag; + } + } + if (doc_e->de_flags & DOCEF_SCROLLING_X) { + j=StrLen(doc_e->tag); + if (j && doc_e->scroll_len) { + i_jif=ToI64(cur_time*FONT_WIDTH*DOC_SCROLL_SPEED)%(j*FONT_WIDTH); + temp_u32_attr=temp_u32_attr & 0xFFE0FF00| + (FONT_WIDTH-1-i_jif&(FONT_WIDTH-1))<<16; +#assert FONT_WIDTH==8 + i_jif>>=3; + for (k=0;kscroll_len;k++) { + ch=ptr[(i_jif+k)%j]; + if (!Bt(chars_bmp_displayable,ch)) ch='.'; + if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && + !(doc_e->de_flags&DOCEF_DONT_DRAW)) { + if (doc_e->de_flags & DOCEF_BORDER_PLOT && + !Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) + TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+ch); + else + TextChar(win_task,FALSE,x-x0,y-y0,temp_u32_attr+ch); + } + x++; + } + } + if (find_cursor) { + D=DocCharDist(doc,doc_e->x,doc_e->y); + col=doc_e->min_col; + } + col2=doc_e->scroll_len; //TODO This is flawed + } else { + if (doc_e->de_flags & DOCEF_BORDER_PLOT && + !Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) { + while (ch=*ptr++) { + if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && + !(doc_e->de_flags&DOCEF_DONT_DRAW)) + TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+ch); + else + if (find_cursor) { + d2=DocCharDist(doc,x,y); + if (d2type_u8==DOCT_TEXT && doc_e->de_flags&DOCEF_HIGHLIGHT) + hl=DocHighlight(doc_e,ptr,k,temp_u32_attr); + else + hl=NULL; + if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && + !(doc_e->de_flags&DOCEF_DONT_DRAW)) { +//Technically we should do this for scrolling_x, too. + if (y>y_plot_bottom) + more=TRUE; + else if (y>=y_plot_top) { + if (hl) + TextLenAttrStr(win_task,x-x0,y-y0,k,hl); + else + TextLenStr(win_task,x-x0,y-y0,k,temp_u32_attr,ptr); + } + col2+=k; + x+=k; + } else { + if (find_cursor) { + while (k--) { + d2=DocCharDist(doc,x,y); + if (d2type_u8] { + case DOCT_TEXT: + if (!col2 && !(doc_e->de_flags + &(DOCEF_TREE|DOCEF_LST|DOCEF_TAG_CB|DOCEF_DEFINE| + DOCEF_AUX_STR|DOCEF_HTML_LINK|DOCEF_BIN_PTR_LINK))) + del_doc_e=TRUE; + break; + case DOCT_HEX_ED: + if (doc_e->de_flags&DOCEF_DEREF_DATA && + !(doc_e->de_flags&DOCEF_REMALLOC_DATA)) + bptr=doc_e->data; + else + bptr=&doc_e->data; + k=doc_e->hex_ed_width; //columns + for (i=0;ilen;i+=k) { + if (doc_e->de_flags & DOCEF_ZERO_BASED) + StrPrint(buf,"%08tX ",i); + else + StrPrint(buf,"%08tX ",bptr); + ptr=buf; + while (ch=*ptr++) { + if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && + !(doc_e->de_flags&DOCEF_DONT_DRAW)) { + if (doc_e->de_flags & DOCEF_BORDER_PLOT && + !Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) + TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+ch); + else + TextChar(win_task,FALSE,x-x0,y-y0,temp_u32_attr+ch); + } + if (find_cursor) { + d2=DocCharDist(doc,x,y); + if (d2doc_e->len) k=doc_e->len-i; + for (j=0;jde_flags&DOCEF_DONT_DRAW)) { + if (doc_e->de_flags & DOCEF_BORDER_PLOT && + !Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) + TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+ch); + else + TextChar(win_task,FALSE,x-x0,y-y0,temp_u32_attr+ch); + } + if (find_cursor) { + d2=DocCharDist(doc,x,y); + if (d2hex_ed_width-k)*3; + for (j=0;jde_flags&DOCEF_DONT_DRAW)) { + if (doc_e->de_flags & DOCEF_BORDER_PLOT && + !Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) + TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+ch); + else + TextChar(win_task,FALSE,x-x0,y-y0,temp_u32_attr+ch); + } + if (find_cursor) { + d2=DocCharDist(doc,x,y); + if (d2hex_ed_width*3+k+9; + } + break; + case DOCT_NEW_LINE: + case DOCT_SOFT_NEW_LINE: + if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && + !(doc_e->de_flags&DOCEF_DONT_DRAW)&& + y_plot_top<=y<=y_plot_bottom) + TextLenAttr(win_task,x-x0,y-y0,width-(x-x0),cur_u8_attr<<8); + if (doc_e->de_flags&DOCEF_HIGHLIGHT && s->state==DOCSS_CPP_Z_COMMENT) + s->state=DOCSS_NORMAL; + y++; + doc->page_line_num++; +rc_start_of_line: + if (s->left_margin==DOC_DFT) + x=s->indent; + else + x=s->indent+s->left_margin; +rc_adjust_xy: + i=s->indent+s->left_margin; + if (xpage_line_num<0) + doc->page_line_num=s->page_len+doc->page_line_num%s->page_len; + else { + if (doc->page_line_num>=s->page_len) { + doc->page_line_num-=s->page_len; + if (doc->page_line_num>=s->page_len) //avoid extra divide + doc->page_line_num=doc->page_line_num%s->page_len; + } + } + if (s->header!=DOC_DFT) { + if (doc->page_line_numheader) { + y+=s->header-doc->page_line_num; + doc->page_line_num=s->header; + goto rc_start_of_line; + } + } + if (s->footer==DOC_DFT) { + if (doc->page_line_num>=s->page_len) { + if (s->header==DOC_DFT) + doc->page_line_num=0; + else { + doc->page_line_num=s->header; + y+=s->header; + } + goto rc_start_of_line; + } + } else { + if (doc->page_line_num>=s->page_len-s->footer) { + y+=s->footer; + if (s->header==DOC_DFT) + doc->page_line_num=0; + else { + doc->page_line_num=s->header; + y+=s->header; + } + goto rc_start_of_line; + } + } + break; + case DOCT_TAB: + k=(x+8) & ~7; + if (doc_e->de_flags & DOCEF_BORDER_PLOT && + !Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) { + while (xde_flags&DOCEF_DONT_DRAW)) + TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+CH_SPACE); + if (find_cursor) { + d2=DocCharDist(doc,x,y); + if (d2de_flags&DOCEF_DONT_DRAW)) { + if (y_plot_top<=y<=y_plot_bottom) + TextLenStr(win_task,x-x0,y-y0,k,temp_u32_attr," "); + x+=k; + } else { + if (find_cursor) { + while (k--) { + d2=DocCharDist(doc,x,y); + if (d2flags|=DOCF_BWD_MOVEMENT; + y+=s->page_len-doc_e->page_line_num; + doc->page_line_num=0; + goto rc_start_of_line; + case DOCT_CURSOR: + if (!find_cursor && !(doc->flags & DOCF_NO_CURSOR)) { + doc->cur_entry=doc_e->next; + doc->cur_col=doc->cur_entry->min_col; + } + if (doc_e!=added_cursor) + del_doc_e=TRUE; + break; + case DOCT_PMT: + cur_u8_attr=cur_u8_attr&0xF0|DOC_COLOR_PMT; + if (y==cursor_y) { + doc->cur_entry=doc_e->next; + doc->cur_col=doc->cur_entry->min_col; + } + break; + case DOCT_CLEAR: + next_clear_found=doc_e; + if (doc_e->de_flags&DOCEF_HOLD) + clear_holds=TRUE; + else + clear_holds=FALSE; + break; + case DOCT_PAGE_LEN: + s->page_len=doc_e->attr; + if (doc_e->de_flags & DOCEF_WIN_REL) + s->page_len+=height; + goto rc_adjust_xy; + case DOCT_LEFT_MARGIN: + i=doc_e->attr; + left_margin=left+i; + s->left_margin=i; + goto rc_start_of_line; + case DOCT_RIGHT_MARGIN: + if (doc_e->de_flags & DOCEF_WIN_REL) + i=width-1-doc_e->attr; + else + i=doc_e->attr; + right_margin=left+i; + s->right_margin=i; + goto rc_adjust_xy; + case DOCT_HEADER: + s->header=doc_e->attr; + goto rc_adjust_xy; + case DOCT_FOOTER: + s->footer=doc_e->attr; + goto rc_adjust_xy; + case DOCT_INDENT: + if (doc_e->de_flags & DOCEF_LEFT_X) + i=doc_e->attr; + else + i=s->indent+doc_e->attr; + s->indent=i; + goto rc_start_of_line; + case DOCT_FOREGROUND: + cur_u8_attr&=0xF0; + if (doc_e->attr==DOC_DFT) + cur_u8_attr|=s->dft_text_attr&0x0F; + else + cur_u8_attr|=doc_e->attr; + s->cur_text_attr=cur_u8_attr; + break; + case DOCT_BACKGROUND: + cur_u8_attr&=0x0F; + if (doc_e->attr==DOC_DFT) + cur_u8_attr|=s->dft_text_attr&0xF0; + else + cur_u8_attr|=doc_e->attr<<4; + s->cur_text_attr=cur_u8_attr; + break; + case DOCT_DFT_FOREGROUND: + cur_u8_attr&=0xF0; + if (doc_e->attr==DOC_DFT) + cur_u8_attr|=s->dft_text_attr&0xF; + else + cur_u8_attr|=doc_e->attr; + s->dft_text_attr=s->dft_text_attr&0xF0|cur_u8_attr&0x0F; + s->cur_text_attr=cur_u8_attr; + break; + case DOCT_DFT_BACKGROUND: + cur_u8_attr&=0x0F; + if (doc_e->attr==DOC_DFT) + cur_u8_attr|=s->dft_text_attr&0xF0; + else + cur_u8_attr|=doc_e->attr<<4; + s->dft_text_attr=s->dft_text_attr&0x0F|cur_u8_attr&0xF0; + s->cur_text_attr=cur_u8_attr; + break; + case DOCT_WORD_WRAP: + if (doc_e->attr) + doc->flags|=DOCF_WORD_WRAP; + else + doc->flags&=~DOCF_WORD_WRAP; + break; + case DOCT_HIGHLIGHT: + if (doc_e->attr) + doc->flags|=DOCF_HIGHLIGHT; + else + doc->flags&=~DOCF_HIGHLIGHT; + break; + case DOCT_BLINK: + if (doc_e->attr) + doc->flags|=DOCF_BLINK; + else + doc->flags&=~DOCF_BLINK; + break; + case DOCT_INVERT: + if (doc_e->attr) + doc->flags|=DOCF_INVERT; + else + doc->flags&=~DOCF_INVERT; + break; + case DOCT_UNDERLINE: + if (doc_e->attr) + doc->flags|=DOCF_UNDERLINE; + else + doc->flags&=~DOCF_UNDERLINE; + break; + case DOCT_SHIFTED_X: + s->shifted_x=doc_e->attr; + break; + case DOCT_SHIFTED_Y: + s->shifted_y=doc_e->attr; + break; + case DOCT_CURSOR_MOVEMENT: + doc->flags|=DOCF_BWD_MOVEMENT; + x+=doc_e->cursor_x_offset; + if (doc_e->de_flags & DOCEF_PAGE_REL_Y) { + i=doc->page_line_num; + if (doc_e->de_flags & DOCEF_TOP_Y) + doc->page_line_num=0; + else if (doc_e->de_flags & DOCEF_BOTTOM_Y) + doc->page_line_num=s->page_len-1; + else if (doc_e->de_flags & DOCEF_CENTER_Y) + doc->page_line_num=s->page_len>>1; + y+=doc->page_line_num-i; + } + y+=doc_e->cursor_y_offset; + doc->page_line_num+=doc_e->cursor_y_offset; + goto rc_adjust_xy; + case DOCT_SPRITE: + if (!doc_e->bin_data && doc->flags&DOCEF_HAS_BIN) + doc_e->bin_data=DocBinFindNum(doc,doc_e->bin_num); + if ((tempb=doc_e->bin_data) && + !tempb->tag && doc_e->tag && *doc_e->tag) + tempb->tag=StrNew(doc_e->tag,mem_task); + if (tempb && dc) { + DCRst(dc); + dc->flags&=~(DCF_DONT_DRAW|DCF_LOCATE_NEAREST); + if (recalc_flags&RECALCG_MASK!=RECALCt_TO_SCREEN || + doc_e->de_flags&DOCEF_DONT_DRAW) + dc->flags|=DCF_DONT_DRAW; + bptr=tempb->data; + ii=SpriteTypeMask(bptr); + if (ii&1<>4 &0xF ^ win_task->text_attr>>4 & 0xF; + else { + i=temp_u32_attr>>12&0xF ^ win_task->text_attr>>4 & 0xF; + if (temp_u32_attr & DOCET_SEL) + i^=0xF; + if (temp_u32_attr & DOCET_INVERT) + i^=0xF; + if (blink_flag && + (doc_e==doc->cur_entry || temp_u32_attr&DOCET_BLINK)) + i^=0xF; + } + dc->color=i; + if (find_cursor) + dc->flags|=DCF_LOCATE_NEAREST; + if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && + doc->cur_sprite==bptr) { + dc->flags|=DCF_LOCATE_NEAREST; + dc->cur_x=ip.pos.x; + dc->cur_y=ip.pos.y; + } else { + dc->cur_x=(doc->x-x0)*FONT_WIDTH+pix_left+scroll_x; + dc->cur_y=(doc->y-y0)*FONT_HEIGHT+pix_top+scroll_y; + } + dc->cur_z=0; + dc->bkcolor=i; + if (doc_e->de_flags & DOCEF_FROM_START) { + xx=(x-k-x0)*FONT_WIDTH; //TODO: scrolling text is not length k + yy=(y-y0)*FONT_HEIGHT; + zz=0; + } else { + xx=(x-x0)*FONT_WIDTH; + yy=(y-y0)*FONT_HEIGHT; + zz=0; + } + if (ii&(1<depth_buf; + } else + dc->depth_buf=depth_buf; + Mat4x4IdentEqu(dc->r); + Mat4x4RotZ(dc->r,cur_time*3.1); + Mat4x4RotY(dc->r,cur_time*1.9); + Mat4x4RotX(dc->r,cur_time); + dc->flags|=DCF_TRANSFORMATION; + dc->x=xx; + dc->y=yy; + dc->z=GR_Z_ALL; + xx=0; yy=0; zz=0; + } + Sprite3(dc,xx,yy,zz,bptr); + dc->depth_buf=NULL; + if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && + doc->cur_sprite==bptr) + doc->nearest_sprite_elem_num=dc->nearest_sprite_elem_num; + dc->flags&=~(DCF_LOCATE_NEAREST|DCF_DONT_DRAW|DCF_TRANSFORMATION); + if (dc->nearest_dist<=D) { + D=dc->nearest_dist; + col=doc_e->min_col; + } + } + break; + case DOCT_SONG: + if (sys_focus_task==win_task && + recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && + !(doc_e->de_flags&DOCEF_DONT_DRAW)) { + if (doc_e->aux_str && + (!music.cur_song || StrCmp(music.cur_song,doc_e->aux_str))) { + Free(music.cur_song); + MusicSettingsRst; + music.cur_song=AStrNew(doc_e->aux_str); + } + } + doc->flags|=DOCF_HAS_SONG; + break; + case DOCT_HTML_CODE: + if (recalc_flags&RECALCF_TO_HTML && + doc_e->de_flags&DOCEF_TAG && doc_e->tag) + x-=StrLen(doc_e->tag); + break; + case DOCT_NUM_TYPES-1: //nobound switch + default: + break; + } + + if (doc_e->de_flags & DOCEF_HAS_BORDER) + TextBorder(win_task,doc_e->x-x0,x-x0-1,doc_e->y-y0,y-y0, + temp_u32_attr.u8[1],ToBool(doc_e->de_flags & DOCEF_SOLID_BORDER)); + if (full_refresh) { + switch (doc_e->type_u8) { + case DOCT_CHECK_BOX: + doc_e->max_col=2; + break; + case DOCT_LST: + case DOCT_TREE: + case DOCT_BUTTON: + case DOCT_LINK: + case DOCT_MENU_VAL: + case DOCT_MACRO: + doc_e->max_col=1; + break; + default: + if (doc_e->de_flags & (DOCEF_TREE|DOCEF_LST)) + doc_e->max_col=1; + else + doc_e->max_col=col2; + } + + if (x>doc->max_x) doc->max_x=x; + if (y>doc->max_y) doc->max_y=y; + if (D<=best_d && !(doc_e->de_flags&DOCEF_NO_CLICK_ON)) { + best_d=D; + best_doc_e=doc_e; + best_col=col; + } + if (doc_e->de_flags & DOCEF_TREE) { + if (doc_e->de_flags & DOCEF_CHECKED_COLLAPSED) + tree_collapsed=TRUE; + else + tree_collapsed=FALSE; + doc_e2=doc_e->next; + while (doc_e2!=doc && doc_e2->type_u8!=DOCT_INDENT && + !(doc_e2->de_flags & DOCEF_TREE)) + doc_e2=doc_e2->next; + if (doc_e2->type_u8==DOCT_INDENT) { + j=i=s->indent; + do { + if (tree_collapsed) + doc_e2->de_flags|=DOCEF_SKIP; + else + doc_e2->de_flags&=~DOCEF_SKIP; + if (doc_e2->type_u8==DOCT_INDENT) { + if (doc_e2->de_flags & DOCEF_LEFT_X) + j=doc_e2->attr; + else + j+=doc_e2->attr; + } + doc_e2=doc_e2->next; + } while (doc_e2!=doc && j>i); + } + } + } + + doc_e2=doc_e->next; +rc_skip: + while (doc_e2!=doc && doc_e2->de_flags&(DOCEF_SKIP|DOCEF_FILTER_SKIP)) { + if (doc_e2==doc->cur_entry) { + doc->cur_entry=doc_e2->next; + doc->cur_col=doc->cur_entry->min_col; + } + if (full_refresh) { + doc_e2->x=x; + doc_e2->y=y; + doc_e2->page_line_num=doc->page_line_num; + MemCpy(&doc_e2->settings,s,sizeof(CDocSettings)); + doc_e2->type.u8[1]=cur_u8_attr; + doc_e2->de_flags=doc->flags + &(DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT) | + doc_e2->de_flags&~(DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT); + } + doc_e2=doc_e2->next; + } + + if (full_refresh) { + if (del_doc_e) { + if (!(doc_e->de_flags & (DOCEF_HOLD|DOCEF_FILTER_SKIP))) { + if (doc_e==doc->cur_entry) { + doc->cur_entry=doc_e2; + doc->cur_col=doc_e2->min_col; + } + if (best_doc_e==doc_e) { + best_doc_e=doc_e2; + best_col=doc_e2->min_col; //TODO: might be bug + } + DocEntryDel(doc,doc_e); + } + } + } + num_entries++; + if (!full_refresh && doc_e->y>y_plot_bottom) + break; + doc_e=doc_e2; + } + + if (full_refresh) { + if (doc->cur_entry==doc && recalc_flags&RECALCF_ADD_CURSOR) { + doc_e2=DocEntryNewBase(doc,DOCT_CURSOR,,x,y,doc->page_line_num); + MemCpy(&doc_e2->settings,s,sizeof(CDocSettings)); + QueInsRev(doc_e2,doc); + } + + if (doc->min_x>doc->max_x) { + doc->max_x=0; + doc->min_x=0; + } + if (doc->min_y>doc->max_y) { + doc->max_y=0; + doc->min_y=0; + } + + //Update header + if (!skipped_update) { + doc_e->x=x; + doc_e->y=y; + doc_e->page_line_num=doc->page_line_num; + MemCpy(&doc_e->settings,s,sizeof(CDocSettings)); + doc_e->type.u8[1]=cur_u8_attr; + if (find_cursor) { + D=DocCharDist(doc,x,y); + if (Dde_flags&DOCEF_NO_CLICK_ON)) { + best_d=D; + best_doc_e=doc_e; + best_col=0; + } + } + } + if (doc->flags & DOCF_MIN_SIZE) { + if (Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) { + if (left<0) + left=0; + i=left+doc->max_x-doc->min_x; + if (i>TEXT_COLS-1) + i=TEXT_COLS-1; + WinHorz(left,i,win_task); + if (top<0) + top=0; + i=top+doc->max_y-doc->min_y; + if (i>TEXT_ROWS-1) + i=TEXT_ROWS-1; + WinVert(top,i,win_task); + } else { + if (left<1) + left=1; + i=left+doc->max_x-doc->min_x; + if (i>TEXT_COLS-2) + i=TEXT_COLS-2; + WinHorz(left,i,win_task); + if (top<1) + top=1; + i=top+doc->max_y-doc->min_y; + if (i>TEXT_ROWS-2) + i=TEXT_ROWS-2; + WinVert(top,i,win_task); + } + } + if (find_cursor) { + doc->cur_entry=best_doc_e; + doc->cur_col=best_col; + DocFormBwd(doc); +//We need this because text coordinates are used + if (best_dbest_d=best_d; + } + + if (doc->cur_entry->type_u8!=DOCT_HEX_ED) { + doc->y=doc->cur_entry->y; + doc->x=doc->cur_entry->x+doc->cur_col; + } else { + doc->y=doc->cur_entry->y+doc->cur_col/3/doc->cur_entry->hex_ed_width; + x=doc->cur_col%(doc->cur_entry->hex_ed_width*3); + i=x/doc->cur_entry->hex_ed_width; + doc->x=doc->cur_entry->x+9; + if (i<2) + doc->x+=x>>1*3+x&1; + else + doc->x+=doc->cur_entry->hex_ed_width*3+ + (x-doc->cur_entry->hex_ed_width<<1); + } + doc->line=doc->y+1; + doc->col=doc->x+1; + + if (recalc_flags&RECALCF_HAS_CURSOR) { + if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN) { + x=0; + y=0; + } else { + x=scroll_x/FONT_WIDTH; + y=scroll_y/FONT_HEIGHT; + } + if (doc->top_line_num-y+height-1>doc->max_y) + doc->top_line_num=doc->max_y-(height-1)+y; + if (doc->top_line_num-ymin_y) + doc->top_line_num=doc->min_y+y; + + if (doc->y-doc->top_line_num+y>height-1) + doc->top_line_num=doc->y-(height-1)+y; + if (doc->y-doc->top_line_num+y<0) + doc->top_line_num=doc->y+y; + + if (doc->line_start_col-x+width-1>doc->max_x) + doc->line_start_col=doc->max_x-(width-1)+x; + if (doc->line_start_col-xmin_x) + doc->line_start_col=doc->min_x+x; + + if (doc->x-doc->line_start_col+x>width-1) + doc->line_start_col=doc->x-(width-1)+x; + if (doc->x-doc->line_start_col+x<0) + doc->line_start_col=doc->x+x; + } + } + if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && + recalc_flags&RECALCF_HAS_CURSOR) { + x=doc->x-doc->line_start_col+left +scroll_x/FONT_WIDTH; + y=doc->y-doc->top_line_num+top+scroll_y/FONT_HEIGHT; + if (0<=x<=right && 0<=y<=bottom && + xflags&DOCF_HIDE_CURSOR)) { + u32_ptr=gr.text_base+y*TEXT_COLS+x; + *u32_ptr|=DOCET_BLINK; + *u32_ptr^=0xFF00; + } + if (full_refresh) { + if (!(doc->flags&DOCF_NO_SCROLL_BARS)) { + if (!Bt(&hss->flags,WSSf_SET_TO_POS)) { + hss->min=doc->min_x; + if (doc->max_x-width+1min) + hss->max=hss->min; + else + hss->max=doc->max_x-width+1; + hss->pos=doc->line_start_col; + } + if (!Bt(&vss->flags,WSSf_SET_TO_POS)) { + vss->min=doc->min_y; + if (doc->max_y-height+1min) + vss->max=vss->min; + else + vss->max=doc->max_y-height+1; + vss->pos=doc->top_line_num; + } + } + LBEqu(&doc->flags,DOCf_MORE,more); + } + } + if (!same_win) { + doc->old_win_top=top; + doc->old_win_bottom=bottom; + doc->old_win_left=left; + doc->old_win_right=right; + doc->old_cur_entry=doc->cur_entry; + doc->old_cur_col=doc->old_cur_col; + } + if (doc->flags & DOCF_HAS_SONG) + LBts(&win_task->task_flags,TASKf_HAS_SONG); + if (full_refresh) { + i=num_entries-doc->max_entries; + if (next_clear_found) { + DocDelToEntry(doc,next_clear_found,clear_holds); + DocRecalc(doc,recalc_flags); + } else if (i>1024) { + DocDelToNum(doc,i); + DocRecalc(doc,recalc_flags); + } + } + DCDel(dc); + Free(depth_buf); + if (unlock) + DocUnlock(doc); + return TRUE; +} diff --git a/Adam/DolDoc/DocRecalcLib.CPP b/Adam/DolDoc/DocRecalcLib.CPP deleted file mode 100644 index 76a9fdb..0000000 --- a/Adam/DolDoc/DocRecalcLib.CPP +++ /dev/null @@ -1,213 +0,0 @@ -#help_index "DolDoc" - -I64 DocCharDist(CDoc *doc,I64 x,I64 y) -{ -#assert FONT_WIDTH==FONT_HEIGHT - return (SqrI64(doc->x-x)+SqrI64(doc->y-y))*FONT_WIDTH*FONT_WIDTH; -} - -U0 DocDelToNum(CDoc *doc,I64 num) -{ - CDocEntry *doc_e=doc->head.next,*doc_e2; - while (num-->0 && doc_e!=doc) { - doc_e2=doc_e->next; - if (!(doc_e->de_flags & (DOCEF_HOLD|DOCEF_FILTER_SKIP))) { - if (doc_e==doc->cur_entry) { - doc->cur_entry=doc_e2; - doc->cur_col=doc_e2->min_col; - } - DocEntryDel(doc,doc_e); - } - doc_e=doc_e2; - } -} - -U0 DocDelToEntry(CDoc *doc,CDocEntry *clear_entry,Bool clear_holds) -{ - CDocEntry *doc_e=doc->head.next,*doc_e2; - while (doc_e!=doc) { - doc_e2=doc_e->next; - if (!(doc_e->de_flags & (DOCEF_HOLD|DOCEF_FILTER_SKIP))||clear_holds) { - if (doc_e==doc->cur_entry) { - doc->cur_entry=doc_e2; - doc->cur_col=doc_e2->min_col; - } - DocEntryDel(doc,doc_e); - } - if (doc_e==clear_entry) - break; - doc_e=doc_e2; - } -} - -U0 DocBorderLstDraw(CDoc *doc) -{ - CTask *win_task=doc->win_task; - I64 i,y=-1,attr=win_task->border_attr<<8; - U64 ch; - CDoc *templ=doc; - CD3I64 saved_scroll; - while (templ && templ->doc_signature==DOC_SIGNATURE_VAL) { - y+=(Bsr(templ->desc)+7)>>3+1; //StrLen+1 - templ=templ->parent_doc; - } - templ=doc; - if (y>win_task->win_height) - y=win_task->win_height; - WinScrollNull(win_task,&saved_scroll); - while (templ && templ->doc_signature==DOC_SIGNATURE_VAL) { - ch=templ->desc; - i=(Bsr(ch)+7)>>3; //StrLen - ch=EndianI64(ch<<((8-i)<<3)); - attr=win_task->border_attr<<8; - while (i-- && y>0) { - TextChar(win_task,TRUE,-1,--y,attr+ch&0xFF); - ch>>=8; - } - y--; - templ=templ->parent_doc; - } - WinScrollRestore(win_task,&saved_scroll); -} - -public U0 DocTop(CDoc *doc=NULL) -{//Move cursor, cur_entry, to top. - Bool unlock; - if (!doc && !(doc=DocPut)) - return; - unlock=DocLock(doc); - doc->cur_entry=doc->head.next; - doc->cur_col=doc->cur_entry->min_col; - doc->x=0; - doc->y=0; - doc->line_start_col=0; - doc->top_line_num=0; - - DocFormFwd(doc); - DocRecalc(doc); - if (unlock) - DocUnlock(doc); -} - -public U0 DocCenter(CDoc *doc=NULL,I64 recalc_flags=RECALCt_NORMAL) -{//Center win on doc cursor, cur_entry. - Bool unlock; - CTask *task; - if (!doc && !(doc=DocPut)) - return; - unlock=DocLock(doc); - task=doc->win_task; - DocRecalc(doc,recalc_flags); - if (!(doc->flags&DOCF_BORDER_DOC)) - doc->top_line_num=doc->y-(task->win_height+1)>>1; - if (unlock) - DocUnlock(doc); -} - -public U0 DocBottom(CDoc *doc=NULL) -{//Move cursor, cur_entry, to bottom. - Bool unlock; - if (!doc && !(doc=DocPut)) - return; - unlock=DocLock(doc); - doc->cur_entry=doc; - doc->cur_col=0; - DocRecalc(doc); - if (unlock) - DocUnlock(doc); -} - -public U0 DocClear(CDoc *doc=NULL,Bool clear_holds=FALSE) -{//Clear all doc entries, except +H, hold entries. - Bool unlock; - if (!doc && !(doc=DocPut)) - return; - unlock=DocLock(doc); - DocBottom(doc); - if (clear_holds) - DocPrint(doc,"$$CL+H$$"); - else - DocPrint(doc,"$$CL$$"); - DocRecalc(doc); - if (unlock) - DocUnlock(doc); -} - -public Bool DocCursor(Bool show=OFF,CDoc *doc=NULL) -{//Show or hide cursor. - if (!doc && !(doc=DocPut)) - return FALSE; - return !LBEqu(&doc->flags,DOCf_HIDE_CURSOR,!show); -} - -public Bool DocHighlightCursor(Bool show=OFF,CDoc *doc=NULL) -{//Highlight or Don't highlight cursor. - if (!doc && !(doc=DocPut)) - return FALSE; - return !LBEqu(&doc->flags,DOCf_DONT_HIGHLIGHT_CURSOR,!show); -} - -public Bool DocScroll(Bool val=OFF,CDoc *doc=NULL) -{//Turn scroll bars OFF/ON. - if (!doc && !(doc=DocPut)) - return FALSE; - return !LBEqu(&doc->flags,DOCf_NO_SCROLL_BARS,!val); -} - -public U0 DocCollapse(Bool collapse=TRUE,CDoc *doc=NULL) -{//Collapse or uncollapse all tree widgets. - CDocEntry *doc_e; - Bool unlock; - if (!doc && !(doc=DocPut)) - return; - unlock=DocLock(doc); - doc_e=doc->head.next; - while (doc_e!=doc) { - if (doc_e->de_flags&DOCEF_TREE) - BEqu(&doc_e->de_flags,DOCEf_CHECKED_COLLAPSED,collapse); - doc_e=doc_e->next; - } - DocRecalc(doc); - if (unlock) - DocUnlock(doc); -} - -#help_index "DolDoc/Cmd Line (Typically);Cmd Line (Typically)" -public I64 DocMax(I64 i=MAX_I64) -{//Set max document entries. (Cmd line buffer size.) -//Adjusts the size of the cmd line buf. - //Normally, the cmd line deletes entries - //when more are added and the old scroll up. - //See $LK,"max_entries",A="FF:::/Adam/DolDoc/DocTerm.CPP,max_entries"$. - I64 res; - CDoc *doc; - if (doc=DocPut) { - res=doc->max_entries; - doc->max_entries=i; - return res; - } else - return 0; -} - -#help_index "DolDoc/Task;StdOut/Task" -U0 DocUpdateTaskDocs(CTask *task) -{//This is called from $LK,"GrUpdateTaskWin",A="MN:GrUpdateTaskWin"$() by the winmgr at 30fps. - CDoc *doc; - CD3I64 saved_scroll; - if (task->border_src==BDS_CUR_DRV && task->cur_dv) - task->border_attr=DrvTextAttrGet(Drv2Let(task->cur_dv)); - if (task->title_src==TTS_TASK_NAME) - StrCpy(task->task_title,task->task_name); - if ((doc=DocDisplay(task)) && !(doc->flags&DOCF_DONT_SHOW)) { - if (task->border_src==BDS_ED_FILENAME_DRV) - task->border_attr=DrvTextAttrGet(*doc->filename.name); - if (task->title_src==TTS_ED_FILENAME) - MemCpy(task->task_title,doc->filename.name,STR_LEN-1); - DocRecalc(doc,RECALCt_TO_SCREEN|RECALCF_HAS_CURSOR); - } - if ((doc=DocBorder(task)) && !(doc->flags&DOCF_DONT_SHOW)) { - WinScrollNull(task,&saved_scroll); - DocRecalc(doc,RECALCt_TO_SCREEN); - WinScrollRestore(task,&saved_scroll); - } -} diff --git a/Adam/DolDoc/DocRecalcLib.HC b/Adam/DolDoc/DocRecalcLib.HC new file mode 100644 index 0000000..3608c40 --- /dev/null +++ b/Adam/DolDoc/DocRecalcLib.HC @@ -0,0 +1,213 @@ +#help_index "DolDoc" + +I64 DocCharDist(CDoc *doc,I64 x,I64 y) +{ +#assert FONT_WIDTH==FONT_HEIGHT + return (SqrI64(doc->x-x)+SqrI64(doc->y-y))*FONT_WIDTH*FONT_WIDTH; +} + +U0 DocDelToNum(CDoc *doc,I64 num) +{ + CDocEntry *doc_e=doc->head.next,*doc_e2; + while (num-->0 && doc_e!=doc) { + doc_e2=doc_e->next; + if (!(doc_e->de_flags & (DOCEF_HOLD|DOCEF_FILTER_SKIP))) { + if (doc_e==doc->cur_entry) { + doc->cur_entry=doc_e2; + doc->cur_col=doc_e2->min_col; + } + DocEntryDel(doc,doc_e); + } + doc_e=doc_e2; + } +} + +U0 DocDelToEntry(CDoc *doc,CDocEntry *clear_entry,Bool clear_holds) +{ + CDocEntry *doc_e=doc->head.next,*doc_e2; + while (doc_e!=doc) { + doc_e2=doc_e->next; + if (!(doc_e->de_flags & (DOCEF_HOLD|DOCEF_FILTER_SKIP))||clear_holds) { + if (doc_e==doc->cur_entry) { + doc->cur_entry=doc_e2; + doc->cur_col=doc_e2->min_col; + } + DocEntryDel(doc,doc_e); + } + if (doc_e==clear_entry) + break; + doc_e=doc_e2; + } +} + +U0 DocBorderLstDraw(CDoc *doc) +{ + CTask *win_task=doc->win_task; + I64 i,y=-1,attr=win_task->border_attr<<8; + U64 ch; + CDoc *templ=doc; + CD3I64 saved_scroll; + while (templ && templ->doc_signature==DOC_SIGNATURE_VAL) { + y+=(Bsr(templ->desc)+7)>>3+1; //StrLen+1 + templ=templ->parent_doc; + } + templ=doc; + if (y>win_task->win_height) + y=win_task->win_height; + WinScrollNull(win_task,&saved_scroll); + while (templ && templ->doc_signature==DOC_SIGNATURE_VAL) { + ch=templ->desc; + i=(Bsr(ch)+7)>>3; //StrLen + ch=EndianI64(ch<<((8-i)<<3)); + attr=win_task->border_attr<<8; + while (i-- && y>0) { + TextChar(win_task,TRUE,-1,--y,attr+ch&0xFF); + ch>>=8; + } + y--; + templ=templ->parent_doc; + } + WinScrollRestore(win_task,&saved_scroll); +} + +public U0 DocTop(CDoc *doc=NULL) +{//Move cursor, cur_entry, to top. + Bool unlock; + if (!doc && !(doc=DocPut)) + return; + unlock=DocLock(doc); + doc->cur_entry=doc->head.next; + doc->cur_col=doc->cur_entry->min_col; + doc->x=0; + doc->y=0; + doc->line_start_col=0; + doc->top_line_num=0; + + DocFormFwd(doc); + DocRecalc(doc); + if (unlock) + DocUnlock(doc); +} + +public U0 DocCenter(CDoc *doc=NULL,I64 recalc_flags=RECALCt_NORMAL) +{//Center win on doc cursor, cur_entry. + Bool unlock; + CTask *task; + if (!doc && !(doc=DocPut)) + return; + unlock=DocLock(doc); + task=doc->win_task; + DocRecalc(doc,recalc_flags); + if (!(doc->flags&DOCF_BORDER_DOC)) + doc->top_line_num=doc->y-(task->win_height+1)>>1; + if (unlock) + DocUnlock(doc); +} + +public U0 DocBottom(CDoc *doc=NULL) +{//Move cursor, cur_entry, to bottom. + Bool unlock; + if (!doc && !(doc=DocPut)) + return; + unlock=DocLock(doc); + doc->cur_entry=doc; + doc->cur_col=0; + DocRecalc(doc); + if (unlock) + DocUnlock(doc); +} + +public U0 DocClear(CDoc *doc=NULL,Bool clear_holds=FALSE) +{//Clear all doc entries, except +H, hold entries. + Bool unlock; + if (!doc && !(doc=DocPut)) + return; + unlock=DocLock(doc); + DocBottom(doc); + if (clear_holds) + DocPrint(doc,"$$CL+H$$"); + else + DocPrint(doc,"$$CL$$"); + DocRecalc(doc); + if (unlock) + DocUnlock(doc); +} + +public Bool DocCursor(Bool show=OFF,CDoc *doc=NULL) +{//Show or hide cursor. + if (!doc && !(doc=DocPut)) + return FALSE; + return !LBEqu(&doc->flags,DOCf_HIDE_CURSOR,!show); +} + +public Bool DocHighlightCursor(Bool show=OFF,CDoc *doc=NULL) +{//Highlight or Don't highlight cursor. + if (!doc && !(doc=DocPut)) + return FALSE; + return !LBEqu(&doc->flags,DOCf_DONT_HIGHLIGHT_CURSOR,!show); +} + +public Bool DocScroll(Bool val=OFF,CDoc *doc=NULL) +{//Turn scroll bars OFF/ON. + if (!doc && !(doc=DocPut)) + return FALSE; + return !LBEqu(&doc->flags,DOCf_NO_SCROLL_BARS,!val); +} + +public U0 DocCollapse(Bool collapse=TRUE,CDoc *doc=NULL) +{//Collapse or uncollapse all tree widgets. + CDocEntry *doc_e; + Bool unlock; + if (!doc && !(doc=DocPut)) + return; + unlock=DocLock(doc); + doc_e=doc->head.next; + while (doc_e!=doc) { + if (doc_e->de_flags&DOCEF_TREE) + BEqu(&doc_e->de_flags,DOCEf_CHECKED_COLLAPSED,collapse); + doc_e=doc_e->next; + } + DocRecalc(doc); + if (unlock) + DocUnlock(doc); +} + +#help_index "DolDoc/Cmd Line (Typically);Cmd Line (Typically)" +public I64 DocMax(I64 i=MAX_I64) +{//Set max document entries. (Cmd line buffer size.) +//Adjusts the size of the cmd line buf. + //Normally, the cmd line deletes entries + //when more are added and the old scroll up. + //See $LK,"max_entries",A="FF:::/Adam/DolDoc/DocTerm.HC,max_entries"$. + I64 res; + CDoc *doc; + if (doc=DocPut) { + res=doc->max_entries; + doc->max_entries=i; + return res; + } else + return 0; +} + +#help_index "DolDoc/Task;StdOut/Task" +U0 DocUpdateTaskDocs(CTask *task) +{//This is called from $LK,"GrUpdateTaskWin",A="MN:GrUpdateTaskWin"$() by the winmgr at 30fps. + CDoc *doc; + CD3I64 saved_scroll; + if (task->border_src==BDS_CUR_DRV && task->cur_dv) + task->border_attr=DrvTextAttrGet(Drv2Let(task->cur_dv)); + if (task->title_src==TTS_TASK_NAME) + StrCpy(task->task_title,task->task_name); + if ((doc=DocDisplay(task)) && !(doc->flags&DOCF_DONT_SHOW)) { + if (task->border_src==BDS_ED_FILENAME_DRV) + task->border_attr=DrvTextAttrGet(*doc->filename.name); + if (task->title_src==TTS_ED_FILENAME) + MemCpy(task->task_title,doc->filename.name,STR_LEN-1); + DocRecalc(doc,RECALCt_TO_SCREEN|RECALCF_HAS_CURSOR); + } + if ((doc=DocBorder(task)) && !(doc->flags&DOCF_DONT_SHOW)) { + WinScrollNull(task,&saved_scroll); + DocRecalc(doc,RECALCt_TO_SCREEN); + WinScrollRestore(task,&saved_scroll); + } +} diff --git a/Adam/DolDoc/DocRun.CPP b/Adam/DolDoc/DocRun.HC similarity index 100% rename from Adam/DolDoc/DocRun.CPP rename to Adam/DolDoc/DocRun.HC diff --git a/Adam/DolDoc/DocTerm.CPP b/Adam/DolDoc/DocTerm.CPP deleted file mode 100644 index a3ba1e5..0000000 --- a/Adam/DolDoc/DocTerm.CPP +++ /dev/null @@ -1,207 +0,0 @@ -#help_index "DolDoc/Task;StdOut/Task" -public CDoc *DocBorderNew(CDoc *pdoc) -{//Make new std border doc. - CDocEntry *doc_e; - CDoc *bdoc; - - bdoc=DocNew; - bdoc->flags|=DOCF_BORDER_DOC; - if (pdoc) { - DocPrint(bdoc,"$$CM+H+BY+RX+NC,-7,1$$"); - doc_e=DocPrint(bdoc,"$$TX+H+BD+TC,\" \"$$"); - doc_e->user_data=pdoc; - doc_e->tag_cb=&EdFilterCB; - doc_e=DocPrint(bdoc,"$$TX+H+BD+TC,\" \"$$"); - doc_e->user_data=pdoc; - doc_e->tag_cb=&EdOverStrikeCB; - doc_e=DocPrint(bdoc,"$$TX+H+BD+TC,\" \"$$"); - doc_e->user_data=pdoc; - doc_e->tag_cb=&EdDollarCB; - DocPrint(bdoc,"$$CM+H+BY+RX+NC,-18,1$$"); - doc_e=DocPrint(bdoc,"$$TX+BD+TC,\" \"$$"); - doc_e->user_data=pdoc; - doc_e->tag_cb=&EdMoreCB; - doc_e=DocPrint(bdoc,"$$TX+H+BD+TC,\" \"$$"); - doc_e->user_data=pdoc; - doc_e->tag_cb=&EdDollarTypeCB; - } - DocPrint(bdoc,"$$CM+H+TY+NC,0,-1$$"); - doc_e=DocPrint(bdoc,"$$DA+H-TRM-P+BD+RD+CX+IV,LEN=STR_LEN-1," - "A=\"%%s...\",SCX=15$$"); - doc_e->data=&Fs->task_title; - DocDataFmt(bdoc,doc_e); - DocPrint(bdoc,"$$CM+H+NC,1,0$$$$TX+H+BD+IV,\"%X\"$$",Fs); - DocPrint(bdoc,"$$TX+H+RX+BD,\"[X]\"$$"); - DocPrint(bdoc,"$$BK,1$$$$TX+H+LX+BD,\"MENU\"$$$$BK,0$$"); - return bdoc; -} - -public U0 DocTermNew() -{//Make into term win task with Put/Display/Border docs. - CDoc *pdoc=DocNew; - pdoc->right_click_link=&TermRightClickLink; - pdoc->max_entries=4096; - Fs->border_src=BDS_CUR_DRV; - pdoc->desc='Term'; - Fs->put_doc=Fs->display_doc=pdoc; - Fs->border_doc=DocBorderNew(pdoc); - Fs->cur_menu=MenuFile("::/Doc/EdPullDown.TXT"); - WinScrollsInit(Fs); - Raw(OFF); -} - -#help_index "DolDoc" - -#define RIGHT_INCLUDE 0 -#define RIGHT_AINCLUDE 1 -#define RIGHT_COPY 2 -#define RIGHT_MOVE 3 -#define RIGHT_DELETE 4 -#define RIGHT_TYPE 5 -#define RIGHT_ED 6 -#define RIGHT_MOUNT 7 -#define RIGHT_PLAIN 8 -#define RIGHT_AUTOFILE 9 - -I64 PopUpTermRight(U8 *header) -{ - I64 i; - CDoc *doc=DocNew; - if (header) DocPrint(doc,"%s",header); - DocPrint(doc,"\n\n" - "TXT=%s\nJIT=%s\nGRA=%s" - "$$CM+LX,1,3 $$$$BT,\"INCLUDE JIT\",LE=RIGHT_INCLUDE$$" - "$$CM+LX,26,0$$$$BT,\"ADAM_INCLUDE JIT\",LE=RIGHT_AINCLUDE$$" - "$$CM+LX,1,3 $$$$BT,\"COPY \",LE=RIGHT_COPY$$" - "$$CM+LX,26,0$$$$BT,\"MOVE OR RENAME \",LE=RIGHT_MOVE$$" - "$$CM+LX,1,3 $$$$BT,\"DELETE \",LE=RIGHT_DELETE$$" - "$$CM+LX,26,0$$$$BT,\"TYPE TXT;GRA\",LE=RIGHT_TYPE$$" - "$$CM+LX,1,3 $$$$BT,\"ED TXT\",LE=RIGHT_ED$$" - "$$CM+LX,26,0$$$$BT,\"MOUNT ISO.C\",LE=RIGHT_MOUNT$$" - "$$CM+LX,1,3 $$$$BT,\"PLAIN ED TXT\",LE=RIGHT_PLAIN$$" - "$$CM+LX,26,0$$$$BT,\"AUTOFILE AUT\",LE=RIGHT_AUTOFILE$$\n" - "$$CM+LX,1,3 $$$$BT,\"CANCEL \",LE=DOCM_CANCEL$$", - FILEMASK_TXT,FILEMASK_JIT,FILEMASK_GRA); - i=PopUpMenu(doc); - DocDel(doc); - return i; -} - -I64 EdLeftClickLink(CDoc *doc,CDocEntry *doc_e) -{//Called with doc locked, exit unlocked - Bool res; - U8 *st; - if (st=DocEntryLink(doc,doc_e)) { - DocUnlock(doc); - if (doc_e->de_flags & DOCEF_POPUP) - res=PopUpEd(st); - else - res=Ed(st); - Free(st); - return res; - } -} - -I64 TermRightClickLink(CDoc *doc,CDocEntry *doc_e) -{//Called with doc locked, exit unlocked - Bool send_new_line=FALSE,res=FALSE; - U8 *st,*st2; - I64 i; - CEdFileName fn; - if (st2=DocEntryLink(doc,doc_e)) { - if (st=DocLinkFile(st2)) { - DocUnlock(doc); - if ((i=PopUpTermRight(st))>=0) { - DocBottom(doc); - switch (i) { - case RIGHT_INCLUDE: - if (FileExtDot(st) && !FilesFindMatch(st,FILEMASK_JIT)) { - if (!PopUpCancelOk(ST_WARN_ST "Not .CPP File\n\n")) { - send_new_line=TRUE; - break; - } - } - "#include \"%s\";\n$$PT$$$$FG$$$$BG$$",st; - WinZBufUpdate; - ExeFile(st,CCF_CMD_LINE); - res=TRUE; - break; - case RIGHT_AINCLUDE: - if (FileExtDot(st) && !FilesFindMatch(st,FILEMASK_JIT)) { - if (!PopUpCancelOk(ST_WARN_ST "Not .CPP File\n\n")) { - send_new_line=TRUE; - break; - } - } - "Adam(\"#include \\\"%s\\\"\" );\n$$PT$$$$FG$$$$BG$$",st; - WinZBufUpdate; - AdamFile(st,FALSE); - res=TRUE; - break; - case RIGHT_COPY: - StrCpy(fn.name,st); - if (DocForm(&fn)) { - res=ToBool(Copy(st,fn.name)); - } else - send_new_line=TRUE; - break; - case RIGHT_MOVE: - StrCpy(fn.name,st); - if (DocForm(&fn)) - res=Move(st,fn.name); - else - send_new_line=TRUE; - break; - case RIGHT_DELETE: - res=ToBool(Del(st)); - break; - case RIGHT_TYPE: - res=Type(st); - break; - case RIGHT_ED: - "Ed(\"%s\");\n$$PT$$$$FG$$$$BG$$",st; - res=Ed(st); - break; - case RIGHT_MOUNT: - if (FileExtDot(st) && !FilesFindMatch(st,"*.ISO.C")) { - if (!PopUpCancelOk(ST_WARN_ST "Not .ISO.C File\n\n")) { - send_new_line=TRUE; - break; - } - } - "MountFile(\"%s\");\n$$PT$$$$FG$$$$BG$$",st; - WinZBufUpdate; - MountFile(st); - res=TRUE; - break; - case RIGHT_PLAIN: - "Plain(\"%s\");\n$$PT$$$$FG$$$$BG$$",st; - res=Plain(st); - break; - case RIGHT_AUTOFILE: - if (FileExtDot(st) && !FilesFindMatch(st,"*.AUT*")) { - if (!PopUpCancelOk(ST_WARN_ST "Not .AUT File\n\n")) { - send_new_line=TRUE; - break; - } - } - "AutoFile(\"%s\");\n$$PT$$$$FG$$$$BG$$",st; - WinZBufUpdate; - AutoFile(st); - res=TRUE; - break; - } - } else - send_new_line=TRUE; - Free(st); - } else - send_new_line=TRUE; - Free(st2); - } else - send_new_line=TRUE; - DocBottom(doc); - "$$PT$$$$FG$$$$BG$$"; - if (send_new_line) - '\n'; - return res; -} diff --git a/Adam/DolDoc/DocTerm.HC b/Adam/DolDoc/DocTerm.HC new file mode 100644 index 0000000..02465c3 --- /dev/null +++ b/Adam/DolDoc/DocTerm.HC @@ -0,0 +1,207 @@ +#help_index "DolDoc/Task;StdOut/Task" +public CDoc *DocBorderNew(CDoc *pdoc) +{//Make new std border doc. + CDocEntry *doc_e; + CDoc *bdoc; + + bdoc=DocNew; + bdoc->flags|=DOCF_BORDER_DOC; + if (pdoc) { + DocPrint(bdoc,"$$CM+H+BY+RX+NC,-7,1$$"); + doc_e=DocPrint(bdoc,"$$TX+H+BD+TC,\" \"$$"); + doc_e->user_data=pdoc; + doc_e->tag_cb=&EdFilterCB; + doc_e=DocPrint(bdoc,"$$TX+H+BD+TC,\" \"$$"); + doc_e->user_data=pdoc; + doc_e->tag_cb=&EdOverStrikeCB; + doc_e=DocPrint(bdoc,"$$TX+H+BD+TC,\" \"$$"); + doc_e->user_data=pdoc; + doc_e->tag_cb=&EdDollarCB; + DocPrint(bdoc,"$$CM+H+BY+RX+NC,-18,1$$"); + doc_e=DocPrint(bdoc,"$$TX+BD+TC,\" \"$$"); + doc_e->user_data=pdoc; + doc_e->tag_cb=&EdMoreCB; + doc_e=DocPrint(bdoc,"$$TX+H+BD+TC,\" \"$$"); + doc_e->user_data=pdoc; + doc_e->tag_cb=&EdDollarTypeCB; + } + DocPrint(bdoc,"$$CM+H+TY+NC,0,-1$$"); + doc_e=DocPrint(bdoc,"$$DA+H-TRM-P+BD+RD+CX+IV,LEN=STR_LEN-1," + "A=\"%%s...\",SCX=15$$"); + doc_e->data=&Fs->task_title; + DocDataFmt(bdoc,doc_e); + DocPrint(bdoc,"$$CM+H+NC,1,0$$$$TX+H+BD+IV,\"%X\"$$",Fs); + DocPrint(bdoc,"$$TX+H+RX+BD,\"[X]\"$$"); + DocPrint(bdoc,"$$BK,1$$$$TX+H+LX+BD,\"MENU\"$$$$BK,0$$"); + return bdoc; +} + +public U0 DocTermNew() +{//Make into term win task with Put/Display/Border docs. + CDoc *pdoc=DocNew; + pdoc->right_click_link=&TermRightClickLink; + pdoc->max_entries=4096; + Fs->border_src=BDS_CUR_DRV; + pdoc->desc='Term'; + Fs->put_doc=Fs->display_doc=pdoc; + Fs->border_doc=DocBorderNew(pdoc); + Fs->cur_menu=MenuFile("::/Doc/EdPullDown.DD"); + WinScrollsInit(Fs); + Raw(OFF); +} + +#help_index "DolDoc" + +#define RIGHT_INCLUDE 0 +#define RIGHT_AINCLUDE 1 +#define RIGHT_COPY 2 +#define RIGHT_MOVE 3 +#define RIGHT_DELETE 4 +#define RIGHT_TYPE 5 +#define RIGHT_ED 6 +#define RIGHT_MOUNT 7 +#define RIGHT_PLAIN 8 +#define RIGHT_AUTOFILE 9 + +I64 PopUpTermRight(U8 *header) +{ + I64 i; + CDoc *doc=DocNew; + if (header) DocPrint(doc,"%s",header); + DocPrint(doc,"\n\n" + "TXT=%s\nJIT=%s\nGRA=%s" + "$$CM+LX,1,3 $$$$BT,\"INCLUDE JIT\",LE=RIGHT_INCLUDE$$" + "$$CM+LX,26,0$$$$BT,\"ADAM_INCLUDE JIT\",LE=RIGHT_AINCLUDE$$" + "$$CM+LX,1,3 $$$$BT,\"COPY \",LE=RIGHT_COPY$$" + "$$CM+LX,26,0$$$$BT,\"MOVE OR RENAME \",LE=RIGHT_MOVE$$" + "$$CM+LX,1,3 $$$$BT,\"DELETE \",LE=RIGHT_DELETE$$" + "$$CM+LX,26,0$$$$BT,\"TYPE TXT;GRA\",LE=RIGHT_TYPE$$" + "$$CM+LX,1,3 $$$$BT,\"ED TXT\",LE=RIGHT_ED$$" + "$$CM+LX,26,0$$$$BT,\"MOUNT ISO.C\",LE=RIGHT_MOUNT$$" + "$$CM+LX,1,3 $$$$BT,\"PLAIN ED TXT\",LE=RIGHT_PLAIN$$" + "$$CM+LX,26,0$$$$BT,\"AUTOFILE AUT\",LE=RIGHT_AUTOFILE$$\n" + "$$CM+LX,1,3 $$$$BT,\"CANCEL \",LE=DOCM_CANCEL$$", + FILEMASK_TXT,FILEMASK_JIT,FILEMASK_GRA); + i=PopUpMenu(doc); + DocDel(doc); + return i; +} + +I64 EdLeftClickLink(CDoc *doc,CDocEntry *doc_e) +{//Called with doc locked, exit unlocked + Bool res; + U8 *st; + if (st=DocEntryLink(doc,doc_e)) { + DocUnlock(doc); + if (doc_e->de_flags & DOCEF_POPUP) + res=PopUpEd(st); + else + res=Ed(st); + Free(st); + return res; + } +} + +I64 TermRightClickLink(CDoc *doc,CDocEntry *doc_e) +{//Called with doc locked, exit unlocked + Bool send_new_line=FALSE,res=FALSE; + U8 *st,*st2; + I64 i; + CEdFileName fn; + if (st2=DocEntryLink(doc,doc_e)) { + if (st=DocLinkFile(st2)) { + DocUnlock(doc); + if ((i=PopUpTermRight(st))>=0) { + DocBottom(doc); + switch (i) { + case RIGHT_INCLUDE: + if (FileExtDot(st) && !FilesFindMatch(st,FILEMASK_JIT)) { + if (!PopUpCancelOk(ST_WARN_ST "Not .HC File\n\n")) { + send_new_line=TRUE; + break; + } + } + "#include \"%s\";\n$$PT$$$$FG$$$$BG$$",st; + WinZBufUpdate; + ExeFile(st,CCF_CMD_LINE); + res=TRUE; + break; + case RIGHT_AINCLUDE: + if (FileExtDot(st) && !FilesFindMatch(st,FILEMASK_JIT)) { + if (!PopUpCancelOk(ST_WARN_ST "Not .HC File\n\n")) { + send_new_line=TRUE; + break; + } + } + "Adam(\"#include \\\"%s\\\"\" );\n$$PT$$$$FG$$$$BG$$",st; + WinZBufUpdate; + AdamFile(st,FALSE); + res=TRUE; + break; + case RIGHT_COPY: + StrCpy(fn.name,st); + if (DocForm(&fn)) { + res=ToBool(Copy(st,fn.name)); + } else + send_new_line=TRUE; + break; + case RIGHT_MOVE: + StrCpy(fn.name,st); + if (DocForm(&fn)) + res=Move(st,fn.name); + else + send_new_line=TRUE; + break; + case RIGHT_DELETE: + res=ToBool(Del(st)); + break; + case RIGHT_TYPE: + res=Type(st); + break; + case RIGHT_ED: + "Ed(\"%s\");\n$$PT$$$$FG$$$$BG$$",st; + res=Ed(st); + break; + case RIGHT_MOUNT: + if (FileExtDot(st) && !FilesFindMatch(st,"*.ISO.C")) { + if (!PopUpCancelOk(ST_WARN_ST "Not .ISO.C File\n\n")) { + send_new_line=TRUE; + break; + } + } + "MountFile(\"%s\");\n$$PT$$$$FG$$$$BG$$",st; + WinZBufUpdate; + MountFile(st); + res=TRUE; + break; + case RIGHT_PLAIN: + "Plain(\"%s\");\n$$PT$$$$FG$$$$BG$$",st; + res=Plain(st); + break; + case RIGHT_AUTOFILE: + if (FileExtDot(st) && !FilesFindMatch(st,"*.AUT*")) { + if (!PopUpCancelOk(ST_WARN_ST "Not .AUT File\n\n")) { + send_new_line=TRUE; + break; + } + } + "AutoFile(\"%s\");\n$$PT$$$$FG$$$$BG$$",st; + WinZBufUpdate; + AutoFile(st); + res=TRUE; + break; + } + } else + send_new_line=TRUE; + Free(st); + } else + send_new_line=TRUE; + Free(st2); + } else + send_new_line=TRUE; + DocBottom(doc); + "$$PT$$$$FG$$$$BG$$"; + if (send_new_line) + '\n'; + return res; +} diff --git a/Adam/DolDoc/DocTree.CPP b/Adam/DolDoc/DocTree.HC similarity index 100% rename from Adam/DolDoc/DocTree.CPP rename to Adam/DolDoc/DocTree.HC diff --git a/Adam/DolDoc/DocWidgetWiz.CPP b/Adam/DolDoc/DocWidgetWiz.CPP deleted file mode 100644 index 665c42f..0000000 --- a/Adam/DolDoc/DocWidgetWiz.CPP +++ /dev/null @@ -1,1163 +0,0 @@ -#help_index "DolDoc/Misc" - -U8 *ctrl_L_footer= - "\n$$MU-X+Q,\"Abort\",LE=DOCM_CANCEL$$\n" - "\n\n$$LK+PU,\"Click for Help\",A=\"FI:::/Doc/Widget.TXT\"$$\n"; - -I64 PopUpLinkType(Bool include_anchor) -{ - I64 i; - CDoc *doc=DocNew; - DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Link Type Menu\"$$\n" - "\n$$LTBLUE$$$$MU,\"To file\",LE=LK_FILE$$\n" - "$$MU,\"To anchor in file\",LE=LK_FILE_ANCHOR$$\n" - "$$MU,\"To str in file\",LE=LK_FILE_FIND$$\n" - "$$MU,\"To line in file\",LE=LK_FILE_LINE$$\n" - "$$MU,\"To man page\",LE=LK_MAN_PAGE$$\n" - "$$MU,\"To plain-text file\",LE=LK_PLAIN$$\n" - "$$MU,\"To str in plain-text file\",LE=LK_PLAIN_FIND$$\n" - "$$MU,\"To line in plain-text file\",LE=LK_PLAIN_LINE$$\n" - "$$MU,\"To Bible chapter line and verse\",LE=LK_BIBLE_FIND$$\n" - "$$MU,\"To Dictionary Definition\",LE=LK_DEF$$\n" - "$$MU,\"To Help Index\",LE=LK_HELP_INDEX$$\n" - "$$MU,\"To Addr\",LE=LK_ADDR$$\n"); - if (include_anchor) - DocPrint(doc,"$$MU,\"Place Anchor\",LE=LK_PLACE_ANCHOR$$\n"); - DocPrint(doc,"%s",ctrl_L_footer); - i=PopUpMenu(doc); - DocDel(doc); - return i; -} - -class CEdFileLink -{ - U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", - file[512] fmtstr "$$DA-P,A=\"File :%s\"$$\n"; - I64 book; - U8 aux[512]; - I64 num; - U8 html_link[512] fmtstr "$$DA-P,A=\"Html Link :%s\"$$\n"; - Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n", - quote fmtstr "$$CB,\"Quote\"$$\n", - hide; -}; - -class CEdFileAnchorLink -{ - U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", - file[512] fmtstr "$$DA-P,A=\"File :%s\"$$\n"; - I64 book; - U8 aux[512] fmtstr "$$DA-P,A=\"Anchor Label :%s\"$$\n"; - I64 num; - U8 html_link[512] fmtstr "$$DA-P,A=\"Html Link :%s\"$$\n"; - Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n", - quote fmtstr "$$CB,\"Quote\"$$\n", - hide; -}; - -class CEdFileFindLink -{ - U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", - file[512] fmtstr "$$DA-P,A=\"File :%s\"$$\n"; - I64 book; - U8 aux[512] fmtstr "$$DA-P,A=\"Str :%s\"$$\n"; - I64 num fmtstr "$$DA-TRM,A=\"Occurrence Num:%04d\"$$\n"; - U8 html_link[512] fmtstr "$$DA-P,A=\"Html Link :%s\"$$\n"; - Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n", - quote fmtstr "$$CB,\"Quote\"$$\n", - hide; -}; - -class CEdFileLineLink -{ - U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", - file[512] fmtstr "$$DA-P,A=\"File :%s\"$$\n"; - I64 book; - U8 aux[512]; - I64 num fmtstr "$$DA-TRM,A=\"Line Num :%04d\"$$\n"; - U8 html_link[512] fmtstr "$$DA-P,A=\"Html Link :%s\"$$\n"; - Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n", - quote fmtstr "$$CB,\"Quote\"$$\n", - hide; -}; - -class CEdManPageLink -{ - U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", - file[512]; - I64 book; - U8 aux[512] fmtstr "$$DA-P,A=\"Label :%s\"$$\n"; - I64 num; - U8 html_link[512] fmtstr "$$DA-P,A=\"Html Link :%s\"$$\n"; - Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n", - quote fmtstr "$$CB,\"Quote\"$$\n", - hide; -}; - -class CEdAddrLink -{ - U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", - file[512]; - I64 book; - U8 aux[512] fmtstr "$$DA-P,A=\"Addr Exp :%s\"$$\n"; - I64 num fmtstr "$$DA-TRM,A=\"Bin Size :%04d\"$$\n"; - U8 html_link[512] fmtstr "$$DA-P,A=\"Html Link :%s\"$$\n"; - Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n", - quote fmtstr "$$CB,\"Quote\"$$\n", - hide; -}; - -class CEdPlaceAnchor -{ - U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", - file[512]; - I64 book; - U8 aux[512] fmtstr "$$DA-P,A=\"Anchor Label :%s\"$$\n"; - I64 num; - U8 html_link[512] fmtstr "$$DA-P,A=\"Html Link :%s\"$$\n"; - Bool pop_up, - quote fmtstr "$$CB,\"Quote\"$$\n", - hide fmtstr "$$CB,\"Hide\"$$\n"; -}; - -class CEdBibleLink -{ - U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", - file[512]; - I64 book fmtstr "$$LS,D=\"ST_BIBLE_BOOKS\"$$\n"; - U8 aux[512] fmtstr "$$DA-P,A=\"Chapter Verse :%s\"$$\n"; - I64 num; - - U8 html_link[512] fmtstr "$$DA-P,A=\"Html Link :%s\"$$\n"; - Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n", - quote fmtstr "$$CB,\"Quote\"$$\n", - hide; -}; - -class CEdDefLink -{ - U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", - file[512]; - I64 book; - U8 aux[512] fmtstr "$$DA-P,A=\"Word :%s\"$$\n"; - I64 num fmtstr "$$DA-TRM,A=\"Def Num :%4d\"$$\n"; - U8 html_link[512] fmtstr "$$DA-P,A=\"Html Link :%s\"$$\n"; - Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n", - quote fmtstr "$$CB,\"Quote\"$$\n", - hide; -}; - -class CEdProject -{ - U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", - file[512] fmtstr "$$DA-P,A=\"File :%s\"$$\n"; - I64 book; - U8 aux[512]; - I64 num; - U8 html_link[512] fmtstr "$$DA-P,A=\"Html Link :%s\"$$\n"; - Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n", - quote fmtstr "$$CB,\"Quote\"$$\n", - hide; -}; - -Bool GetLink(I64 type,U8 **_tag,U8 **_link,Bool *_pop_up, - Bool *_quote,U8 **_html_link) -{ - CEdFileLink *e=CAlloc(sizeof(CEdFileLink)); - Bool res=FALSE; - if (type>=0) { - e->num=1; - switch (type) { - case LK_FILE: - if (DocForm(e,,,,ctrl_L_footer)) { - res=TRUE; - if (!*e->tag) - *_tag=StrNew(e->file); - else - *_tag=StrNew(e->tag); - *_link=MStrPrint("FI:%s",e->file); - } - break; - case LK_PLAIN: - if (DocForm(e,,,,ctrl_L_footer)) { - res=TRUE; - if (!*e->tag) - *_tag=StrNew(e->file); - else - *_tag=StrNew(e->tag); - *_link=MStrPrint("PI:%s",e->file); - } - break; - case LK_FILE_ANCHOR: - if (DocForm(e,"CEdFileAnchorLink",,,ctrl_L_footer)) { - res=TRUE; - if (!*e->tag) - *_tag=StrNew(e->aux); - else - *_tag=StrNew(e->tag); - *_link=MStrPrint("FA:%s,%s",e->file,e->aux); - } - break; - case LK_FILE_FIND: - if (DocForm(e,"CEdFileFindLink",,,ctrl_L_footer)) { - res=TRUE; - if (e->num==1) { - if (!*e->tag) - *_tag=StrNew(e->aux); - else - *_tag=StrNew(e->tag); - *_link=MStrPrint("FF:%s,%s",e->file,e->aux); - } else { - if (!*e->tag) - *_tag=StrNew(e->aux); - else - *_tag=StrNew(e->tag); - *_link=MStrPrint("FF:%s,%s:%d",e->file,e->aux,e->num); - } - } - break; - case LK_PLAIN_FIND: - if (DocForm(e,"CEdFileFindLink",,,ctrl_L_footer)) { - res=TRUE; - if (e->num==1) { - if (!*e->tag) - *_tag=StrNew(e->aux); - else - *_tag=StrNew(e->tag); - *_link=MStrPrint("PF:%s,%s",e->file,e->aux); - } else { - if (!*e->tag) - *_tag=StrNew(e->aux); - else - *_tag=StrNew(e->tag); - *_link=MStrPrint("PF:%s,%s:%d",e->file,e->aux,e->num); - } - } - break; - case LK_FILE_LINE: - if (DocForm(e,"CEdFileLineLink",,,ctrl_L_footer)) { - res=TRUE; - if (!*e->tag) - *_tag=StrNew(e->file); - else - *_tag=StrNew(e->tag); - *_link=MStrPrint("FL:%s,%d",e->file,e->num); - } - break; - case LK_PLAIN_LINE: - if (DocForm(e,"CEdFileLineLink",,,ctrl_L_footer)) { - res=TRUE; - if (!*e->tag) - *_tag=StrNew(e->file); - else - *_tag=StrNew(e->tag); - *_link=MStrPrint("PL:%s,%d",e->file,e->num); - } - break; - case LK_MAN_PAGE: - if (DocForm(e,"CEdManPageLink",,,ctrl_L_footer)) { - res=TRUE; - if (!*e->tag) - *_tag=StrNew(e->aux); - else - *_tag=StrNew(e->tag); - *_link=MStrPrint("MN:%s",e->aux); - } - break; - case LK_PLACE_ANCHOR: - if (DocForm(e,"CEdPlaceAnchor",,,ctrl_L_footer)) { - res=TRUE; - if (!*e->tag) { - if (e->hide) - *_tag=StrNew(""); - else - *_tag=StrNew(e->aux); - } else - *_tag=StrNew(e->tag); - *_link=StrNew(e->aux); - } - break; - case LK_BIBLE_FIND: - if (DocForm(e,"CEdBibleLink",,,ctrl_L_footer)) { - res=TRUE; - if (!*e->tag) - *_tag=MStrPrint("%Z,%s",e->book,"ST_BIBLE_BOOKS",e->aux); - else - *_tag=StrNew(e->tag); - *_link=MStrPrint("BF:%Z,%s",e->book,"ST_BIBLE_BOOKS",e->aux); - } - break; - case LK_DEF: - e->num=-1; - if (DocForm(e,"CEdDefLink",,,ctrl_L_footer)) { - res=TRUE; - if (!*e->tag) - *_tag=StrNew(e->aux); - else - *_tag=StrNew(e->tag); - if (e->num<0) - *_link=MStrPrint("DN:%s",e->aux); - else - *_link=MStrPrint("DN:%s,%d",e->aux,e->num); - - } - break; - case LK_HELP_INDEX: - if (DocForm(e,"CEdManPageLink",,,ctrl_L_footer)) { - res=TRUE; - if (!*e->tag) - *_tag=StrNew(e->aux); - else - *_tag=StrNew(e->tag); - *_link=MStrPrint("HI:%s",e->aux); - } - break; - case LK_ADDR: - e->num=DFT_ADDR_LINK_BIN_SIZE; - if (DocForm(e,"CEdAddrLink",,,ctrl_L_footer)) { - res=TRUE; - if (e->num==DFT_ADDR_LINK_BIN_SIZE) { - if (!*e->tag) - *_tag=StrNew(e->aux); - else - *_tag=StrNew(e->tag); - *_link=MStrPrint("AD:%s",e->aux); - } else { - if (!*e->tag) - *_tag=MStrPrint("%s,%d",e->aux,e->num); - else - *_tag=StrNew(e->tag); - *_link=MStrPrint("AD:%s,%d",e->aux,e->num); - } - } - break; - } - } - if (*e->html_link) - *_html_link=StrNew(e->html_link); - else - *_html_link=NULL; - if (e->pop_up) - *_pop_up=TRUE; - else - *_pop_up=FALSE; - if (e->quote) - *_quote=TRUE; - else - *_quote=FALSE; - Free(e); - return res; -} - -U0 EdInsLink() -{ - U8 *tag=NULL,*link=NULL,*st=NULL,*html_link=NULL,*pop_up_st; - Bool pop_up=FALSE,quote=FALSE; - I64 type=PopUpLinkType(TRUE); - if (type>=0) { - if (GetLink(type,&tag,&link,&pop_up,"e,&html_link)) { - if (pop_up) - pop_up_st="+PU"; - else - pop_up_st=""; - switch (type) { - case LK_PLACE_ANCHOR: - if (html_link) - st=MStrPrint("$$AN,\"%$$Q\",A=\"%$$Q\",HTML=\"%$$Q\"$$", - tag,link,html_link); - else - st=MStrPrint("$$AN,\"%$$Q\",A=\"%$$Q\"$$",tag,link); - break; - default: - if (html_link) - st=MStrPrint("$$LK%s,\"%$$Q\",A=\"%$$Q\",HTML=\"%$$Q\"$$", - pop_up_st,tag,link,html_link); - else - st=MStrPrint("$$LK%s,\"%$$Q\",A=\"%$$Q\"$$",pop_up_st,tag,link); - } - } - } - if (st) { - if (quote) - "%$$Q",st; - else - "%s",st; - } - Free(tag); - Free(link); - Free(html_link); - Free(st); -} - -I64 PopUpColorType() -{ - I64 i; - CDoc *doc=DocNew; - DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Color Type Menu\"$$\n" - "\n$$LTBLUE$$$$MU,\"Foreground\",LE=DOCT_FOREGROUND$$\n" - "$$MU,\"Background\",LE=DOCT_BACKGROUND$$\n" - "$$MU,\"Default Foreground\",LE=DOCT_DFT_FOREGROUND$$\n" - "$$MU,\"Default Background\",LE=DOCT_DFT_BACKGROUND$$\n" - "%s",ctrl_L_footer); - i=PopUpMenu(doc); - DocDel(doc); - return i; -} - -I64 PopUpPageSettingType() -{ - I64 i; - CDoc *doc=DocNew; - DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Page Setting Menu\"$$\n" - "\n$$LTBLUE$$$$MU,\"Page Length\",LE=DOCT_PAGE_LEN$$\n" - "$$MU,\"Page Header\",LE=DOCT_HEADER$$\n" - "$$MU,\"Page Footer\",LE=DOCT_FOOTER$$\n" - "$$MU,\"Left Margin\",LE=DOCT_LEFT_MARGIN$$\n" - "$$MU,\"Right Margin\",LE=DOCT_RIGHT_MARGIN$$\n" - "%s",ctrl_L_footer); - i=PopUpMenu(doc); - DocDel(doc); - return i; -} - -U0 EdInsColor() -{ - I64 type=PopUpColorType,col=DOC_DFT; - if (type>=0) { - col=PopUpColor(,FALSE); - if (col==DOC_DFT) - "$$%Z$$",type,"ST_DOC_CMDS"; - else if (col>=0) - "$$%Z,%d$$",type,"ST_DOC_CMDS",col; - } -} - -class CEdPageSetting1 -{ - U8 val[512] fmtstr "$$DA-P,A=\"Setting Val:%s\"$$\n"; - Bool winrel; -}; - -class CEdPageSetting2 -{ - U8 val[512] fmtstr "$$DA-P,A=\"Setting Val:%s\"$$\n"; - Bool winrel fmtstr "$$CB,\"Win Relative\"$$\n"; -}; - -U0 EdInsPageSetting() -{ - I64 type=PopUpPageSettingType; - CEdPageSetting1 *e=CAlloc(sizeof(CEdPageSetting1)); - if (type>=0) { - if (type==DOCT_RIGHT_MARGIN||type==DOCT_PAGE_LEN) { - if (DocForm(e(CEdPageSetting2 *))) { - if (e->winrel) { - if (*e->val) - "$$%Z+WR,%s$$",type,"ST_DOC_CMDS",e->val; - else - "$$%Z+WR,0$$",type,"ST_DOC_CMDS"; - } else { - if (*e->val) - "$$%Z,%s$$",type,"ST_DOC_CMDS",e->val; - else - "$$%Z$$",type,"ST_DOC_CMDS"; - } - } - } else { - if (DocForm(e)) { - if (*e->val) - "$$%Z,%s$$",type,"ST_DOC_CMDS",e->val; - else - "$$%Z$$",type,"ST_DOC_CMDS"; - } - } - } - Free(e); -} - -#define WIZ_HIGHLIGHT_ON (DOCT_ERROR+1) -#define WIZ_HIGHLIGHT_OFF (DOCT_ERROR+2) - -I64 PopUpWidgetType() -{ - I64 i; - CDoc *doc=DocNew; - DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Text Widgets Menu\"$$\n" - "\n$$LTBLUE$$$$MU,\"Link\",LE=DOCT_LINK$$\n" - "$$MU,\"Text\",LE=DOCT_TEXT$$\n" - "$$MU,\"Tree Branch\",LE=DOCT_TREE$$\n" - "$$MU,\"Color\",LE=DOCT_FOREGROUND$$\n" - "$$MU,\"Page Settings\",LE=DOCT_PAGE_LEN$$\n" - "$$MU,\"Cursor Movement\",LE=DOCT_CURSOR_MOVEMENT$$\n" - "$$MU,\"Macro\",LE=DOCT_MACRO$$\n" - "$$MU,\"Button\",LE=DOCT_BUTTON$$\n" - "$$MU,\"Check Box\",LE=DOCT_CHECK_BOX$$\n" - "$$MU,\"List\",LE=DOCT_LST$$\n" - "$$MU,\"Menu Val\",LE=DOCT_MENU_VAL$$\n" - "$$MU,\"Data\",LE=DOCT_DATA$$\n" - "$$MU,\"Hex Edit\",LE=DOCT_HEX_ED$$\n" - "$$MU,\"Syntax Highlight ON\",LE=WIZ_HIGHLIGHT_ON$$\n" - "$$MU,\"Syntax Highlight OFF\",LE=WIZ_HIGHLIGHT_OFF$$\n" - "$$MU,\"HTML\",LE=DOCT_HTML_CODE$$\n" - "$$MU,\"Song\",LE=DOCT_SONG$$\n" - "%s",ctrl_L_footer); - i=PopUpMenu(doc); - DocDel(doc); - return i; -} - -class CEdText -{ - U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n"; - Bool left_x fmtstr "$$CB,\"Left X\"$$\n", - center_x fmtstr "$$CB,\"Center X\"$$\n", - right_x fmtstr "$$CB,\"Right X\"$$\n", - margin_rel fmtstr "$$CB,\"Margin Rel X\"$$\n", - blink fmtstr "$$CB,\"Blink\"$$\n", - invert fmtstr "$$CB,\"Invert\"$$\n", - underline fmtstr "$$CB,\"Underline\"$$\n", - tree fmtstr "$$CB,\"Tree\"$$\n", - collapsed fmtstr "$$CB,\"Collapsed\"$$\n"; - U8 scroll_x [512] fmtstr "$$DA-P,A=\"Scroll X Length Expression:%s\"$$\n", - shift_x [512] fmtstr "$$DA-P,A=\"X Offset Expression :%s\"$$\n", - shift_y [512] fmtstr "$$DA-P,A=\"Y Offset Expression :%s\"$$\n", - define_str[512] fmtstr "$$DA-P,A=\"Define Str :%s\"$$\n", - html_link[512] fmtstr "$$DA-P,A=\"Html Link :%s\"$$\n"; -}; - -U0 EdInsText() -{ - U8 *st,buf[512]; - CEdText *e=CAlloc(sizeof(CEdText)); - if (DocForm(e,,,,ctrl_L_footer)) { - *buf=0; - if (e->left_x ) CatPrint(buf,"+LX"); - if (e->center_x) CatPrint(buf,"+CX"); - if (e->right_x ) CatPrint(buf,"+RX"); - if (e->margin_rel) CatPrint(buf,"+MRX"); - if (e->blink) CatPrint(buf,"+BK"); - if (e->invert) CatPrint(buf,"+IV"); - if (e->underline) CatPrint(buf,"+UL"); - if (e->tree) CatPrint(buf,"+TR"); - if (e->collapsed) CatPrint(buf,"+C"); - st=MStrPrint("%q",e->tag); - "$$TX%s,\"%$$Q\"",buf,st; - Free(st); - if (*e->shift_x) - ",SX=%s",e->shift_x; - if (*e->shift_y) - ",SY=%s",e->shift_y; - if (*e->scroll_x) - ",SCX=%s",e->scroll_x; - if (*e->define_str) { - st=MStrPrint("%q",e->define_str); - ",D=\"%$$Q\"",st; - Free(st); - } - if (*e->html_link) { - st=MStrPrint("%q",e->html_link); - ",HTML=\"%$$Q\"",st; - Free(st); - } - "$$"; - } - Free(e); -} - -class CEdSong -{ - U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", - song[512] fmtstr "$$DA-P,A=\"Song :%s\"$$\n"; -}; - -U0 EdInsSong() -{ - CEdSong *e=CAlloc(sizeof(CEdSong)); - if (DocForm(e,,,,ctrl_L_footer)) - "$$SO,\"%$$Q\",A=\"%s\"$$",e->tag,e->song; - Free(e); -} - -class CEdHtmlCode -{ - U8 tag[512] fmtstr "$$DA-P,A=\"Html Code:%s\"$$\n"; -}; - -U0 EdInsHtml() -{ - CEdHtmlCode *e=CAlloc(sizeof(CEdHtmlCode)); - if (DocForm(e,,,,ctrl_L_footer)) - "$$HC,\"%$$Q\"$$",e->tag; - Free(e); -} - -class CEdMacroMenu -{ - U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", - left_macro[512] fmtstr "$$DA-P,A=\"Left Click Macro :%s\"$$\n", - left_exp[512] fmtstr "$$DA-P,A=\"Left Click Expression :%s\"$$\n"; - Bool popup fmtstr "$$CB,\"PopUp\"$$\n", - left_is_auto fmtstr "$$CB,\"Left is AutoStr\"$$\n", - left_x fmtstr "$$CB,\"Left X \"$$\n", - center_x fmtstr "$$CB,\"Center X \"$$\n", - right_x fmtstr "$$CB,\"Right X \"$$\n", - margin_rel fmtstr "$$CB,\"Margin Rel X\"$$\n", - blink fmtstr "$$CB,\"Blink\"$$\n", - invert fmtstr "$$CB,\"Invert\"$$\n", - underline fmtstr "$$CB,\"Underline\"$$\n", - escape fmtstr "$$CB,\"Escape\"$$\n"; - U8 scroll_x[512] fmtstr "$$DA-P,A=\"Scroll X Length Expression:%s\"$$\n", - shift_x[512] fmtstr "$$DA-P,A=\"X Offset Expression :%s\"$$\n", - shift_y[512] fmtstr "$$DA-P,A=\"Y Offset Expression :%s\"$$\n"; -}; - -U0 EdInsMacroMenu(Bool is_macro) -{ - U8 *st,buf[512]; - CEdMacroMenu *e=CAlloc(sizeof(CEdMacroMenu)); - e->underline=TRUE; - e->escape=TRUE; - if (DocForm(e,,,,ctrl_L_footer)) { - *buf=0; - if (e->popup) CatPrint(buf,"+PU-X"); - if (e->left_x ) CatPrint(buf,"+LX"); - if (e->center_x) CatPrint(buf,"+CX"); - if (e->right_x ) CatPrint(buf,"+RX"); - if (e->margin_rel) CatPrint(buf,"+MRX"); - if (e->blink) CatPrint(buf,"+BK"); - if (e->invert) CatPrint(buf,"+IV"); - if (!e->underline) CatPrint(buf,"-UL"); - if (!e->escape) CatPrint(buf,"-X"); - if (e->left_is_auto) CatPrint(buf,"+LA"); - if (*e->tag || is_macro) { - if (is_macro) { - if (*e->tag) { - st=MStrPrint("%q",e->tag); - "$$MA%s,\"%$$Q\"",buf,st; - Free(st); - } else - "$$MA%s",buf; - } else { - st=MStrPrint("%q",e->tag); - "$$MU%s,\"%$$Q\"",buf,st; - Free(st); - } - if (*e->left_exp) - ",LE=%s",e->left_exp; - if (*e->left_macro) { - st=MStrPrint("%q",e->left_macro); - ",LM=\"%$$Q\"",st; - Free(st); - } - if (*e->shift_x) - ",SX=%s",e->shift_x; - if (*e->shift_y) - ",SY=%s",e->shift_y; - if (*e->scroll_x) - ",SCX=%s",e->scroll_x; - "$$"; - } - } - Free(e); -} - -class CEdButton -{ - U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n"; - Bool popup fmtstr "$$CB,\"PopUp\"$$\n", - left_x fmtstr "$$CB,\"Left X \"$$\n", - center_x fmtstr "$$CB,\"Center X \"$$\n", - right_x fmtstr "$$CB,\"Right X \"$$\n", - margin_rel fmtstr "$$CB,\"Margin Rel X\"$$\n", - escape fmtstr "$$CB,\"Escape\"$$\n"; - U8 left_macro[512] fmtstr "$$DA-P,A=\"Left Click Macro:%s\"$$\n"; - Bool left_is_auto fmtstr "$$CB,\"Left is AutoStr\"$$\n"; - U8 left_exp[512] fmtstr "$$DA-P,A=\"Left Click Expression:%s\"$$\n"; - Bool quote fmtstr "$$CB,\"Quote\"$$\n"; -}; - -U0 EdInsButton() -{ - U8 *st,buf[512]; - CEdButton *e=CAlloc(sizeof(CEdButton)); - e->escape=TRUE; - if (DocForm(e,,,,ctrl_L_footer)) { - *buf=0; - if (e->popup) CatPrint(buf,"+PU-X"); - if (e->left_x ) CatPrint(buf,"+LX"); - if (e->center_x) CatPrint(buf,"+CX"); - if (e->right_x ) CatPrint(buf,"+RX"); - if (e->margin_rel) CatPrint(buf,"+MRX"); - if (!e->escape) CatPrint(buf,"-X"); - if (e->left_is_auto) CatPrint(buf,"+LA"); - if (*e->tag) { - if (e->quote) { - st=MStrPrint("%q",e->tag); - "$$$$BT%s,\\\"%$$Q\\\"",buf,st; - Free(st); - if (*e->left_exp) - ",LE=%s",e->left_exp; - if (*e->left_macro) { - st=MStrPrint("%q",e->left_macro); - ",LM=\\\"%$$Q\\\"",st; - Free(st); - } - "$$$$"; - } else { - st=MStrPrint("%q",e->tag); - "$$BT%s,\"%$$Q\"",buf,st; - Free(st); - if (*e->left_exp) - ",LE=%s",e->left_exp; - if (*e->left_macro) { - st=MStrPrint("%q",e->left_macro); - ",LM=\"%$$Q\"",st; - Free(st); - } - "$$"; - } - } - } - Free(e); -} - -class CEdCursorMovement -{ - U8 left_exp[512] fmtstr "$$DA-P,A=\"X Expression (LE):%s\"$$\n", - right_exp[512] fmtstr "$$DA-P,A=\"Y Expression (RE):%s\"$$\n"; - Bool left_x fmtstr "$$CB,\"Left X \"$$\n", - center_x fmtstr "$$CB,\"Center X \"$$\n", - right_x fmtstr "$$CB,\"Right X \"$$\n", - margin_rel fmtstr "$$CB,\"Margin Rel X\"$$\n", - top_y fmtstr "$$CB,\"Top Y \"$$\n", - center_y fmtstr "$$CB,\"Center Y \"$$\n", - bottom_y fmtstr "$$CB,\"Bottom Y \"$$\n", - page_rel fmtstr "$$CB,\"Page Rel Y\"$$\n", - quote fmtstr "$$CB,\"Quote\"$$\n"; -}; - -U0 EdInsCursorMovement() -{ - U8 buf[512]; - CEdCursorMovement *e=CAlloc(sizeof(CEdCursorMovement)); - if (DocForm(e,,,,ctrl_L_footer)) { - *buf=0; - if (e->left_x ) CatPrint(buf,"+LX"); - if (e->center_x) CatPrint(buf,"+CX"); - if (e->right_x ) CatPrint(buf,"+RX"); - if (e->margin_rel) CatPrint(buf,"+MRX"); - if (e->top_y ) CatPrint(buf,"+TY"); - if (e->center_y) CatPrint(buf,"+CY"); - if (e->bottom_y) CatPrint(buf,"+BY"); - if (e->page_rel) CatPrint(buf,"+PRY"); - if (!*e->left_exp) CatPrint(buf,"-LE"); - if (!*e->right_exp) CatPrint(buf,"-RE"); - if (e->quote) - "$$"; - "$$CM%s",buf; - if (*e->left_exp) - ",LE=%s",e->left_exp; - if (*e->right_exp) - ",RE=%s",e->right_exp; - "$$"; - if (e->quote) - "$$"; - } - Free(e); -} - -class CEdDataNum -{ - U8 fmt_str[512] fmtstr "$$DA-P,A=\"Format Str:%s\"$$\n"; - I64 len; - Bool term fmtstr "$$CB,\"Form Field Terminator\"$$\n", - remalloc, - refresh fmtstr "$$CB,\"Refresh Data\"$$\n", - update fmtstr "$$CB,\"Update Data\"$$\n"; -}; - -class CEdDataStr -{ - U8 fmt_str[512] fmtstr "$$DA-P,A=\"Format Str:%s\"$$\n"; - I64 len fmtstr "$$DA,A=\"Length:%d\"$$\n"; - Bool term fmtstr "$$CB,\"Zero Terminator\"$$\n", - remalloc fmtstr "$$CB,\"Remalloc for Unlimited Length\"$$\n", - refresh fmtstr "$$CB,\"Refresh Data\"$$\n", - update fmtstr "$$CB,\"Update Data\"$$\n"; -}; - -U0 EdInsData() -{ - I64 i,type=RT_I64; - U8 *st,buf[512],raw_type[16]; - CEdDataNum *e=CAlloc(sizeof(CEdDataNum)); - e->term=TRUE; - e->len=DOCE_LEN_DFT; - if ((i=PopUpPickDefineSub("ST_NATURAL_TYPES"))>=0) { - *buf=0; - i+=RT_I8; - if (i==RT_F32) - i=RT_F64; - if (i==RT_UF32) {//U8 * - i=DocForm(e(CEdDataStr *),,,,ctrl_L_footer); - if (e->remalloc) { - CatPrint(buf,"+M"); - e->term=TRUE; - } else - CatPrint(buf,"-P"); - } else { - type=i; - i=DocForm(e,,,,ctrl_L_footer); - } - if (i) { - if (type==RT_I64) - *raw_type=0; - else - StrPrint(raw_type,",RT=%Z",type,"ST_RAW_TYPES"); - - if (!e->term) CatPrint(buf,"-TRM"); - if (e->refresh) CatPrint(buf,"+RD"); - if (e->update) CatPrint(buf,"+UD"); - - st=MStrPrint("%q",e->fmt_str); - if (e->remalloc) - "$$$$DA%s,A=\\\"%$$Q\\\"$$$$",buf,st; - else if (e->len==DOCE_LEN_DFT) - "$$$$DA%s%s,A=\\\"%$$Q\\\"$$$$",buf,raw_type,st; - else - "$$$$DA%s,LEN=%d%s,A=\\\"%$$Q\\\"$$$$",buf,e->len,raw_type,st; - Free(st); - } - } - Free(e); -} - -class CEdCheckBox -{ - U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n"; - Bool refresh fmtstr "$$CB,\"Refresh Data\"$$\n"; - I64 type fmtstr "$$LS,D=\"ST_INT_SIZE_TYPES\"$$\n"; -}; - -U0 EdInsCheckBox() -{ - U8 *st,buf[512],raw_type[16]; - CEdCheckBox *e=CAlloc(sizeof(CEdCheckBox)); - e->type=RT_I8-RT_I8; - if (DocForm(e,,,,ctrl_L_footer)) { - *buf=0; - e->type+=RT_I8; - if (e->type==RT_I8) - *raw_type=0; - else - StrPrint(raw_type,",RT=%Z",e->type,"ST_RAW_TYPES"); - if (e->refresh) CatPrint(buf,"+RD"); - st=MStrPrint("%q",e->tag); - "$$$$CB%s%s,\\\"%$$Q\\\"$$$$",buf,raw_type,st; - Free(st); - } - Free(e); -} - -class CEdLst -{ - U8 tag[512] fmtstr "$$DA-P,A=\"Dft Sel :%s\"$$\n", - define_str[512] fmtstr "$$DA-P,A=\"Define Str :%s\"$$\n"; - Bool refresh fmtstr "$$CB,\"Refresh Data\"$$\n"; - I64 type fmtstr "$$LS,D=\"ST_INT_SIZE_TYPES\"$$\n"; -}; - -U0 EdInsLst() -{ - U8 *st1,*st2,buf[512],raw_type[16]; - CEdLst *e=CAlloc(sizeof(CEdLst)); - e->type=RT_I64-RT_I8; - if (DocForm(e,,,,ctrl_L_footer)) { - *buf=0; - e->type+=RT_I8; - if (e->type==RT_I64) - *raw_type=0; - else - StrPrint(raw_type,",RT=%Z",e->type,"ST_RAW_TYPES"); - if (e->refresh) CatPrint(buf,"+RD"); - if (!*e->tag) - st1=NULL; - else - st1=MStrPrint("%q",e->tag); - st2=MStrPrint("%q",e->define_str); - if (st1) - "$$$$LS%s%s,\\\"%$$Q\\\",D=\\\"%$$Q\\\"$$$$",buf,raw_type,st1,st2; - else - "$$$$LS%s%s,D=\\\"%$$Q\\\"$$$$",buf,raw_type,st2; - Free(st1); - Free(st2); - } - Free(e); -} - -class CEdHexEd -{ - I64 cnt fmtstr "$$DA,A=\"Count:%d\"$$\n", - cols fmtstr "$$DA,A=\"Columns:%d\"$$\n"; - Bool zero fmtstr "$$CB,\"Zero Based\"$$\n", - refresh fmtstr "$$CB,\"Refresh Data\"$$\n"; -}; - -U0 EdInsHexEd() -{ - U8 buf[512]; - CEdHexEd *e=CAlloc(sizeof(CEdHexEd)); - e->cnt=128; - e->cols=4; - e->zero=TRUE; - if (DocForm(e,,,,ctrl_L_footer)) { - *buf=0; - if (!e->zero) CatPrint(buf,"-Z"); - if (e->refresh) CatPrint(buf,"+RD"); - "$$$$HX%s,%d,%d$$$$",buf,e->cnt,e->cols; - } - Free(e); -} - -class CEdBin -{ - U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n"; - I64 bin_num fmtstr "$$DA,A=\"Bin Num:%d\"$$\n"; - U8 bin_ptr_link_file[512] fmtstr "$$DA-P,A=\"File:%s\"$$\n"; - I64 bin_ptr_link_bin_num fmtstr "$$DA,A=\"File Bin Num:%d\"$$\n"; - U8 bin_ptr_link_tag[512] fmtstr "$$DA-P,A=\"File Bin Tag:%s\"$$\n"; -}; - -U0 EdInsBin(I64 bin_num,I64 type) -{ - CEdBin *e=CAlloc(sizeof(CEdBin)); - StrPrint(e->tag,"<%d>",bin_num); - e->bin_num=bin_num; - e->bin_ptr_link_bin_num=1; - if (DocForm(e,,, - "Note: Normally, you enter no file,\n" - "just a bin num. If You enter a\n" - "file, enter a file bin num or a file\n" - "bin tag.\n\n",ctrl_L_footer)) { - if (*e->bin_ptr_link_file) { - if (*e->bin_ptr_link_tag) - "$$%Z,\"%$$Q\",BI=%d,BP=\"%s,%s\"$$",type,"ST_DOC_CMDS",e->tag,e->bin_num, - e->bin_ptr_link_file,e->bin_ptr_link_tag; - else - "$$%Z,\"%$$Q\",BI=%d,BP=\"%s,%d\"$$",type,"ST_DOC_CMDS",e->tag,e->bin_num, - e->bin_ptr_link_file,e->bin_ptr_link_bin_num; - } else { - if (DocBinFindNum(DocPut,e->bin_num)) - "$$%Z,\"%$$Q\",BI=%d$$",type,"ST_DOC_CMDS",e->tag,e->bin_num; - else - PopUpOk("Invalid Binary Num"); - } - } - Free(e); -} - -class CEdTree -{ - U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n"; - I64 indent fmtstr "$$DA,A=\"Indention:%d\"$$\n"; - Bool collapsed fmtstr "$$CB,\"Collapsed\"$$\n"; -}; - -U0 EdInsTree() -{ - U8 *st1,*st2,buf[512]; - CEdTree *e=CAlloc(sizeof(CEdTree)); - e->collapsed=TRUE; - e->indent=2; - if (DocForm(e,,,,ctrl_L_footer)) { - *buf=0; - if (!e->collapsed) CatPrint(buf,"-C"); - st1=MStrPrint("%q",e->tag); - st2=MStrPrint("$$TR%s,\"%$$Q\"$$\n$$ID,%d$$*\n$$ID,%d$$", - buf,st1,e->indent,-e->indent); - DocPrintAtomic(DocPut,"%s",st2); - Free(st1); - Free(st2); - } - Free(e); -} - -U0 EdInsWidgetWiz() -{ - I64 type=PopUpWidgetType; - switch (type) { - case DOCT_FOREGROUND: - EdInsColor; - break; - case DOCT_PAGE_LEN: - EdInsPageSetting; - break; - case DOCT_LINK: - EdInsLink; - break; - case DOCT_TEXT: - EdInsText; - break; - case DOCT_TREE: - EdInsTree; - break; - case DOCT_MACRO: - EdInsMacroMenu(TRUE); - break; - case DOCT_MENU_VAL: - EdInsMacroMenu(FALSE); - break; - case DOCT_CURSOR_MOVEMENT: - EdInsCursorMovement; - break; - case DOCT_BUTTON: - EdInsButton; - break; - case DOCT_DATA: - EdInsData; - break; - case DOCT_CHECK_BOX: - EdInsCheckBox; - break; - case DOCT_LST: - EdInsLst; - break; - case DOCT_HEX_ED: - EdInsHexEd; - break; - case DOCT_SONG: - EdInsSong; - break; - case WIZ_HIGHLIGHT_ON: - "$$HL,1$$"; - break; - case WIZ_HIGHLIGHT_OFF: - "$$HL,0$$"; - break; - case DOCT_HTML_CODE: - EdInsHtml; - } -} - -#define EST_SPRITE 0 -#define EST_SPRITE_PTR 1 -#define EST_DUP_SPRITE 2 -#define EST_SPRITE_SIZE 3 -#define EST_SPRITE_MACRO 4 -#define EST_SPRITE_MENU 5 -#define EST_SPRITE_LINK 6 - -I64 PopUpSpriteType() -{ - I64 i; - CDoc *doc=DocNew; - DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Graphic Sprite Resource Menu\"$$\n" - "$$LK+PU+CX,\"Click for Help\",A=\"FI:::/Doc/Resource.TXT.Z\"$$\n\n" - "$$LTBLUE$$$$MU,\"Make Sprite\",LE=EST_SPRITE$$$$FG$$\t " - "Start by making a sprite.\n" - "$$LTBLUE$$$$MU,\"Ptr to Sprite\",LE=EST_SPRITE_PTR$$$$FG$$\t " - "Insert pointer into src code.\n" - "$$LTBLUE$$$$MU,\"Duplicate Sprite\",LE=EST_DUP_SPRITE$$$$FG$$ " - "Make dup image for in a doc.\n" - "$$LTBLUE$$$$MU,\"Sprite Size\",LE=EST_SPRITE_SIZE$$$$FG$$\t " - "Insert size of a sprite into src code.\n" - "$$LTBLUE$$$$MU,\"Sprite Macro\",LE=EST_SPRITE_MACRO$$$$FG$$\t " - "Create icon with auto-text payload.\n" - "$$LTBLUE$$$$MU,\"Sprite Menu Item\",LE=EST_SPRITE_MENU$$$$FG$$ " - "Create icon with numeric payload.\n" - "$$LTBLUE$$$$MU,\"Sprite Link\",LE=EST_SPRITE_LINK$$$$FG$$\t " - "Create icon with link payload.\n\n" - "$$LTBLUE$$$$MU,\"Abort\",LE=DOCM_CANCEL$$\n\n"); - i=PopUpMenu(doc); - DocDel(doc); - return i; -} - -class CEdMacroSprite -{ - U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", - exp[512] fmtstr "$$DA-P,A=\"Macro :%s\"$$\n"; - Bool escape fmtstr "$$CB,\"Escape\"$$\n", - popup fmtstr "$$CB,\"PopUp\"$$\n", - is_auto fmtstr "$$CB,\"AutoStr\"$$\n"; -}; - -class CEdMenuSprite -{ - U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", - exp[512] fmtstr "$$DA-P,A=\"Expression :%s\"$$\n"; - Bool escape fmtstr "$$CB,\"Escape\"$$\n", - popup, - is_auto; -}; - -U8 *EdSpriteLink(Bool *_pop_up,U8 **_html_link) -{ - U8 *res=NULL,*tag=NULL,*link=NULL; - Bool quote=FALSE; - I64 type=PopUpLinkType(FALSE); - *_html_link=NULL; - if (type>=0 && GetLink(type,&tag,&link,_pop_up,"e,_html_link)) - res=MStrPrint("\"%$$Q\",A=\"%$$Q\"",tag,link); - Free(tag); - Free(link); - return res; -} - -U8 *EdSprite(I64 bin_num) -{ - I64 type=PopUpSpriteType; - Bool pop_up; - U8 *st,*st1=NULL,*st2=NULL,buf[1024],*html_link=NULL; - CEdMacroSprite *e=CAlloc(sizeof(CEdMacroSprite)); - *buf=0; - switch (type) { - case EST_SPRITE: - st1=MStrPrint("\"<%d>\"",bin_num); - break; - case EST_SPRITE_MACRO: - e->escape=TRUE; - if (DocForm(e,,,,ctrl_L_footer)) { - CatPrint(buf,"+UL"); - if (e->is_auto) CatPrint(buf,"+LA"); - if (e->popup) CatPrint(buf,"+PU"); - if (e->escape) CatPrint(buf,"+X"); - st=MStrPrint("%q",e->exp); - st1=MStrPrint("\"%$$Q\",LM=\"%$$Q\"",e->tag,st); - Free(st); - } - break; - case EST_SPRITE_MENU: - e->escape=TRUE; - if (DocForm(e,"CEdMenuSprite",,,ctrl_L_footer)) { - if (e->escape) CatPrint(buf,"+X"); - st1=MStrPrint("\"%$$Q\",LE=%s",e->tag,e->exp); - } - break; - case EST_SPRITE_LINK: - CatPrint(buf,"+L"); - st1=EdSpriteLink(&pop_up,&html_link); - if (pop_up) - CatPrint(buf,"+PU"); - break; - case EST_SPRITE_PTR: - EdInsBin(--bin_num,DOCT_INS_BIN); - break; - case EST_SPRITE_SIZE: - EdInsBin(--bin_num,DOCT_INS_BIN_SIZE); - break; - case EST_DUP_SPRITE: - EdInsBin(--bin_num,DOCT_SPRITE); - break; - } - if (st1) { - if (html_link) - st2=MStrPrint("$$SP%s,%s,HTML=\"%$$Q\",BI=%d$$",buf,st1,html_link,bin_num); - else - st2=MStrPrint("$$SP%s,%s,BI=%d$$",buf,st1,bin_num); - Free(st1); - } - Free(e); - Free(html_link); - return st2; -} diff --git a/Adam/DolDoc/DocWidgetWiz.HC b/Adam/DolDoc/DocWidgetWiz.HC new file mode 100644 index 0000000..7afc147 --- /dev/null +++ b/Adam/DolDoc/DocWidgetWiz.HC @@ -0,0 +1,1163 @@ +#help_index "DolDoc/Misc" + +U8 *ctrl_L_footer= + "\n$$MU-X+Q,\"Abort\",LE=DOCM_CANCEL$$\n" + "\n\n$$LK+PU,\"Click for Help\",A=\"FI:::/Doc/Widget.DD\"$$\n"; + +I64 PopUpLinkType(Bool include_anchor) +{ + I64 i; + CDoc *doc=DocNew; + DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Link Type Menu\"$$\n" + "\n$$LTBLUE$$$$MU,\"To file\",LE=LK_FILE$$\n" + "$$MU,\"To anchor in file\",LE=LK_FILE_ANCHOR$$\n" + "$$MU,\"To str in file\",LE=LK_FILE_FIND$$\n" + "$$MU,\"To line in file\",LE=LK_FILE_LINE$$\n" + "$$MU,\"To man page\",LE=LK_MAN_PAGE$$\n" + "$$MU,\"To plain-text file\",LE=LK_PLAIN$$\n" + "$$MU,\"To str in plain-text file\",LE=LK_PLAIN_FIND$$\n" + "$$MU,\"To line in plain-text file\",LE=LK_PLAIN_LINE$$\n" + "$$MU,\"To Bible chapter line and verse\",LE=LK_BIBLE_FIND$$\n" + "$$MU,\"To Dictionary Definition\",LE=LK_DEF$$\n" + "$$MU,\"To Help Index\",LE=LK_HELP_INDEX$$\n" + "$$MU,\"To Addr\",LE=LK_ADDR$$\n"); + if (include_anchor) + DocPrint(doc,"$$MU,\"Place Anchor\",LE=LK_PLACE_ANCHOR$$\n"); + DocPrint(doc,"%s",ctrl_L_footer); + i=PopUpMenu(doc); + DocDel(doc); + return i; +} + +class CEdFileLink +{ + U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", + file[512] fmtstr "$$DA-P,A=\"File :%s\"$$\n"; + I64 book; + U8 aux[512]; + I64 num; + U8 html_link[512] fmtstr "$$DA-P,A=\"Html Link :%s\"$$\n"; + Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n", + quote fmtstr "$$CB,\"Quote\"$$\n", + hide; +}; + +class CEdFileAnchorLink +{ + U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", + file[512] fmtstr "$$DA-P,A=\"File :%s\"$$\n"; + I64 book; + U8 aux[512] fmtstr "$$DA-P,A=\"Anchor Label :%s\"$$\n"; + I64 num; + U8 html_link[512] fmtstr "$$DA-P,A=\"Html Link :%s\"$$\n"; + Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n", + quote fmtstr "$$CB,\"Quote\"$$\n", + hide; +}; + +class CEdFileFindLink +{ + U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", + file[512] fmtstr "$$DA-P,A=\"File :%s\"$$\n"; + I64 book; + U8 aux[512] fmtstr "$$DA-P,A=\"Str :%s\"$$\n"; + I64 num fmtstr "$$DA-TRM,A=\"Occurrence Num:%04d\"$$\n"; + U8 html_link[512] fmtstr "$$DA-P,A=\"Html Link :%s\"$$\n"; + Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n", + quote fmtstr "$$CB,\"Quote\"$$\n", + hide; +}; + +class CEdFileLineLink +{ + U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", + file[512] fmtstr "$$DA-P,A=\"File :%s\"$$\n"; + I64 book; + U8 aux[512]; + I64 num fmtstr "$$DA-TRM,A=\"Line Num :%04d\"$$\n"; + U8 html_link[512] fmtstr "$$DA-P,A=\"Html Link :%s\"$$\n"; + Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n", + quote fmtstr "$$CB,\"Quote\"$$\n", + hide; +}; + +class CEdManPageLink +{ + U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", + file[512]; + I64 book; + U8 aux[512] fmtstr "$$DA-P,A=\"Label :%s\"$$\n"; + I64 num; + U8 html_link[512] fmtstr "$$DA-P,A=\"Html Link :%s\"$$\n"; + Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n", + quote fmtstr "$$CB,\"Quote\"$$\n", + hide; +}; + +class CEdAddrLink +{ + U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", + file[512]; + I64 book; + U8 aux[512] fmtstr "$$DA-P,A=\"Addr Exp :%s\"$$\n"; + I64 num fmtstr "$$DA-TRM,A=\"Bin Size :%04d\"$$\n"; + U8 html_link[512] fmtstr "$$DA-P,A=\"Html Link :%s\"$$\n"; + Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n", + quote fmtstr "$$CB,\"Quote\"$$\n", + hide; +}; + +class CEdPlaceAnchor +{ + U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", + file[512]; + I64 book; + U8 aux[512] fmtstr "$$DA-P,A=\"Anchor Label :%s\"$$\n"; + I64 num; + U8 html_link[512] fmtstr "$$DA-P,A=\"Html Link :%s\"$$\n"; + Bool pop_up, + quote fmtstr "$$CB,\"Quote\"$$\n", + hide fmtstr "$$CB,\"Hide\"$$\n"; +}; + +class CEdBibleLink +{ + U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", + file[512]; + I64 book fmtstr "$$LS,D=\"ST_BIBLE_BOOKS\"$$\n"; + U8 aux[512] fmtstr "$$DA-P,A=\"Chapter Verse :%s\"$$\n"; + I64 num; + + U8 html_link[512] fmtstr "$$DA-P,A=\"Html Link :%s\"$$\n"; + Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n", + quote fmtstr "$$CB,\"Quote\"$$\n", + hide; +}; + +class CEdDefLink +{ + U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", + file[512]; + I64 book; + U8 aux[512] fmtstr "$$DA-P,A=\"Word :%s\"$$\n"; + I64 num fmtstr "$$DA-TRM,A=\"Def Num :%4d\"$$\n"; + U8 html_link[512] fmtstr "$$DA-P,A=\"Html Link :%s\"$$\n"; + Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n", + quote fmtstr "$$CB,\"Quote\"$$\n", + hide; +}; + +class CEdProject +{ + U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", + file[512] fmtstr "$$DA-P,A=\"File :%s\"$$\n"; + I64 book; + U8 aux[512]; + I64 num; + U8 html_link[512] fmtstr "$$DA-P,A=\"Html Link :%s\"$$\n"; + Bool pop_up fmtstr "$$CB,\"PopUp\"$$\n", + quote fmtstr "$$CB,\"Quote\"$$\n", + hide; +}; + +Bool GetLink(I64 type,U8 **_tag,U8 **_link,Bool *_pop_up, + Bool *_quote,U8 **_html_link) +{ + CEdFileLink *e=CAlloc(sizeof(CEdFileLink)); + Bool res=FALSE; + if (type>=0) { + e->num=1; + switch (type) { + case LK_FILE: + if (DocForm(e,,,,ctrl_L_footer)) { + res=TRUE; + if (!*e->tag) + *_tag=StrNew(e->file); + else + *_tag=StrNew(e->tag); + *_link=MStrPrint("FI:%s",e->file); + } + break; + case LK_PLAIN: + if (DocForm(e,,,,ctrl_L_footer)) { + res=TRUE; + if (!*e->tag) + *_tag=StrNew(e->file); + else + *_tag=StrNew(e->tag); + *_link=MStrPrint("PI:%s",e->file); + } + break; + case LK_FILE_ANCHOR: + if (DocForm(e,"CEdFileAnchorLink",,,ctrl_L_footer)) { + res=TRUE; + if (!*e->tag) + *_tag=StrNew(e->aux); + else + *_tag=StrNew(e->tag); + *_link=MStrPrint("FA:%s,%s",e->file,e->aux); + } + break; + case LK_FILE_FIND: + if (DocForm(e,"CEdFileFindLink",,,ctrl_L_footer)) { + res=TRUE; + if (e->num==1) { + if (!*e->tag) + *_tag=StrNew(e->aux); + else + *_tag=StrNew(e->tag); + *_link=MStrPrint("FF:%s,%s",e->file,e->aux); + } else { + if (!*e->tag) + *_tag=StrNew(e->aux); + else + *_tag=StrNew(e->tag); + *_link=MStrPrint("FF:%s,%s:%d",e->file,e->aux,e->num); + } + } + break; + case LK_PLAIN_FIND: + if (DocForm(e,"CEdFileFindLink",,,ctrl_L_footer)) { + res=TRUE; + if (e->num==1) { + if (!*e->tag) + *_tag=StrNew(e->aux); + else + *_tag=StrNew(e->tag); + *_link=MStrPrint("PF:%s,%s",e->file,e->aux); + } else { + if (!*e->tag) + *_tag=StrNew(e->aux); + else + *_tag=StrNew(e->tag); + *_link=MStrPrint("PF:%s,%s:%d",e->file,e->aux,e->num); + } + } + break; + case LK_FILE_LINE: + if (DocForm(e,"CEdFileLineLink",,,ctrl_L_footer)) { + res=TRUE; + if (!*e->tag) + *_tag=StrNew(e->file); + else + *_tag=StrNew(e->tag); + *_link=MStrPrint("FL:%s,%d",e->file,e->num); + } + break; + case LK_PLAIN_LINE: + if (DocForm(e,"CEdFileLineLink",,,ctrl_L_footer)) { + res=TRUE; + if (!*e->tag) + *_tag=StrNew(e->file); + else + *_tag=StrNew(e->tag); + *_link=MStrPrint("PL:%s,%d",e->file,e->num); + } + break; + case LK_MAN_PAGE: + if (DocForm(e,"CEdManPageLink",,,ctrl_L_footer)) { + res=TRUE; + if (!*e->tag) + *_tag=StrNew(e->aux); + else + *_tag=StrNew(e->tag); + *_link=MStrPrint("MN:%s",e->aux); + } + break; + case LK_PLACE_ANCHOR: + if (DocForm(e,"CEdPlaceAnchor",,,ctrl_L_footer)) { + res=TRUE; + if (!*e->tag) { + if (e->hide) + *_tag=StrNew(""); + else + *_tag=StrNew(e->aux); + } else + *_tag=StrNew(e->tag); + *_link=StrNew(e->aux); + } + break; + case LK_BIBLE_FIND: + if (DocForm(e,"CEdBibleLink",,,ctrl_L_footer)) { + res=TRUE; + if (!*e->tag) + *_tag=MStrPrint("%Z,%s",e->book,"ST_BIBLE_BOOKS",e->aux); + else + *_tag=StrNew(e->tag); + *_link=MStrPrint("BF:%Z,%s",e->book,"ST_BIBLE_BOOKS",e->aux); + } + break; + case LK_DEF: + e->num=-1; + if (DocForm(e,"CEdDefLink",,,ctrl_L_footer)) { + res=TRUE; + if (!*e->tag) + *_tag=StrNew(e->aux); + else + *_tag=StrNew(e->tag); + if (e->num<0) + *_link=MStrPrint("DN:%s",e->aux); + else + *_link=MStrPrint("DN:%s,%d",e->aux,e->num); + + } + break; + case LK_HELP_INDEX: + if (DocForm(e,"CEdManPageLink",,,ctrl_L_footer)) { + res=TRUE; + if (!*e->tag) + *_tag=StrNew(e->aux); + else + *_tag=StrNew(e->tag); + *_link=MStrPrint("HI:%s",e->aux); + } + break; + case LK_ADDR: + e->num=DFT_ADDR_LINK_BIN_SIZE; + if (DocForm(e,"CEdAddrLink",,,ctrl_L_footer)) { + res=TRUE; + if (e->num==DFT_ADDR_LINK_BIN_SIZE) { + if (!*e->tag) + *_tag=StrNew(e->aux); + else + *_tag=StrNew(e->tag); + *_link=MStrPrint("AD:%s",e->aux); + } else { + if (!*e->tag) + *_tag=MStrPrint("%s,%d",e->aux,e->num); + else + *_tag=StrNew(e->tag); + *_link=MStrPrint("AD:%s,%d",e->aux,e->num); + } + } + break; + } + } + if (*e->html_link) + *_html_link=StrNew(e->html_link); + else + *_html_link=NULL; + if (e->pop_up) + *_pop_up=TRUE; + else + *_pop_up=FALSE; + if (e->quote) + *_quote=TRUE; + else + *_quote=FALSE; + Free(e); + return res; +} + +U0 EdInsLink() +{ + U8 *tag=NULL,*link=NULL,*st=NULL,*html_link=NULL,*pop_up_st; + Bool pop_up=FALSE,quote=FALSE; + I64 type=PopUpLinkType(TRUE); + if (type>=0) { + if (GetLink(type,&tag,&link,&pop_up,"e,&html_link)) { + if (pop_up) + pop_up_st="+PU"; + else + pop_up_st=""; + switch (type) { + case LK_PLACE_ANCHOR: + if (html_link) + st=MStrPrint("$$AN,\"%$$Q\",A=\"%$$Q\",HTML=\"%$$Q\"$$", + tag,link,html_link); + else + st=MStrPrint("$$AN,\"%$$Q\",A=\"%$$Q\"$$",tag,link); + break; + default: + if (html_link) + st=MStrPrint("$$LK%s,\"%$$Q\",A=\"%$$Q\",HTML=\"%$$Q\"$$", + pop_up_st,tag,link,html_link); + else + st=MStrPrint("$$LK%s,\"%$$Q\",A=\"%$$Q\"$$",pop_up_st,tag,link); + } + } + } + if (st) { + if (quote) + "%$$Q",st; + else + "%s",st; + } + Free(tag); + Free(link); + Free(html_link); + Free(st); +} + +I64 PopUpColorType() +{ + I64 i; + CDoc *doc=DocNew; + DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Color Type Menu\"$$\n" + "\n$$LTBLUE$$$$MU,\"Foreground\",LE=DOCT_FOREGROUND$$\n" + "$$MU,\"Background\",LE=DOCT_BACKGROUND$$\n" + "$$MU,\"Default Foreground\",LE=DOCT_DFT_FOREGROUND$$\n" + "$$MU,\"Default Background\",LE=DOCT_DFT_BACKGROUND$$\n" + "%s",ctrl_L_footer); + i=PopUpMenu(doc); + DocDel(doc); + return i; +} + +I64 PopUpPageSettingType() +{ + I64 i; + CDoc *doc=DocNew; + DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Page Setting Menu\"$$\n" + "\n$$LTBLUE$$$$MU,\"Page Length\",LE=DOCT_PAGE_LEN$$\n" + "$$MU,\"Page Header\",LE=DOCT_HEADER$$\n" + "$$MU,\"Page Footer\",LE=DOCT_FOOTER$$\n" + "$$MU,\"Left Margin\",LE=DOCT_LEFT_MARGIN$$\n" + "$$MU,\"Right Margin\",LE=DOCT_RIGHT_MARGIN$$\n" + "%s",ctrl_L_footer); + i=PopUpMenu(doc); + DocDel(doc); + return i; +} + +U0 EdInsColor() +{ + I64 type=PopUpColorType,col=DOC_DFT; + if (type>=0) { + col=PopUpColor(,FALSE); + if (col==DOC_DFT) + "$$%Z$$",type,"ST_DOC_CMDS"; + else if (col>=0) + "$$%Z,%d$$",type,"ST_DOC_CMDS",col; + } +} + +class CEdPageSetting1 +{ + U8 val[512] fmtstr "$$DA-P,A=\"Setting Val:%s\"$$\n"; + Bool winrel; +}; + +class CEdPageSetting2 +{ + U8 val[512] fmtstr "$$DA-P,A=\"Setting Val:%s\"$$\n"; + Bool winrel fmtstr "$$CB,\"Win Relative\"$$\n"; +}; + +U0 EdInsPageSetting() +{ + I64 type=PopUpPageSettingType; + CEdPageSetting1 *e=CAlloc(sizeof(CEdPageSetting1)); + if (type>=0) { + if (type==DOCT_RIGHT_MARGIN||type==DOCT_PAGE_LEN) { + if (DocForm(e(CEdPageSetting2 *))) { + if (e->winrel) { + if (*e->val) + "$$%Z+WR,%s$$",type,"ST_DOC_CMDS",e->val; + else + "$$%Z+WR,0$$",type,"ST_DOC_CMDS"; + } else { + if (*e->val) + "$$%Z,%s$$",type,"ST_DOC_CMDS",e->val; + else + "$$%Z$$",type,"ST_DOC_CMDS"; + } + } + } else { + if (DocForm(e)) { + if (*e->val) + "$$%Z,%s$$",type,"ST_DOC_CMDS",e->val; + else + "$$%Z$$",type,"ST_DOC_CMDS"; + } + } + } + Free(e); +} + +#define WIZ_HIGHLIGHT_ON (DOCT_ERROR+1) +#define WIZ_HIGHLIGHT_OFF (DOCT_ERROR+2) + +I64 PopUpWidgetType() +{ + I64 i; + CDoc *doc=DocNew; + DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Text Widgets Menu\"$$\n" + "\n$$LTBLUE$$$$MU,\"Link\",LE=DOCT_LINK$$\n" + "$$MU,\"Text\",LE=DOCT_TEXT$$\n" + "$$MU,\"Tree Branch\",LE=DOCT_TREE$$\n" + "$$MU,\"Color\",LE=DOCT_FOREGROUND$$\n" + "$$MU,\"Page Settings\",LE=DOCT_PAGE_LEN$$\n" + "$$MU,\"Cursor Movement\",LE=DOCT_CURSOR_MOVEMENT$$\n" + "$$MU,\"Macro\",LE=DOCT_MACRO$$\n" + "$$MU,\"Button\",LE=DOCT_BUTTON$$\n" + "$$MU,\"Check Box\",LE=DOCT_CHECK_BOX$$\n" + "$$MU,\"List\",LE=DOCT_LST$$\n" + "$$MU,\"Menu Val\",LE=DOCT_MENU_VAL$$\n" + "$$MU,\"Data\",LE=DOCT_DATA$$\n" + "$$MU,\"Hex Edit\",LE=DOCT_HEX_ED$$\n" + "$$MU,\"Syntax Highlight ON\",LE=WIZ_HIGHLIGHT_ON$$\n" + "$$MU,\"Syntax Highlight OFF\",LE=WIZ_HIGHLIGHT_OFF$$\n" + "$$MU,\"HTML\",LE=DOCT_HTML_CODE$$\n" + "$$MU,\"Song\",LE=DOCT_SONG$$\n" + "%s",ctrl_L_footer); + i=PopUpMenu(doc); + DocDel(doc); + return i; +} + +class CEdText +{ + U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n"; + Bool left_x fmtstr "$$CB,\"Left X\"$$\n", + center_x fmtstr "$$CB,\"Center X\"$$\n", + right_x fmtstr "$$CB,\"Right X\"$$\n", + margin_rel fmtstr "$$CB,\"Margin Rel X\"$$\n", + blink fmtstr "$$CB,\"Blink\"$$\n", + invert fmtstr "$$CB,\"Invert\"$$\n", + underline fmtstr "$$CB,\"Underline\"$$\n", + tree fmtstr "$$CB,\"Tree\"$$\n", + collapsed fmtstr "$$CB,\"Collapsed\"$$\n"; + U8 scroll_x [512] fmtstr "$$DA-P,A=\"Scroll X Length Expression:%s\"$$\n", + shift_x [512] fmtstr "$$DA-P,A=\"X Offset Expression :%s\"$$\n", + shift_y [512] fmtstr "$$DA-P,A=\"Y Offset Expression :%s\"$$\n", + define_str[512] fmtstr "$$DA-P,A=\"Define Str :%s\"$$\n", + html_link[512] fmtstr "$$DA-P,A=\"Html Link :%s\"$$\n"; +}; + +U0 EdInsText() +{ + U8 *st,buf[512]; + CEdText *e=CAlloc(sizeof(CEdText)); + if (DocForm(e,,,,ctrl_L_footer)) { + *buf=0; + if (e->left_x ) CatPrint(buf,"+LX"); + if (e->center_x) CatPrint(buf,"+CX"); + if (e->right_x ) CatPrint(buf,"+RX"); + if (e->margin_rel) CatPrint(buf,"+MRX"); + if (e->blink) CatPrint(buf,"+BK"); + if (e->invert) CatPrint(buf,"+IV"); + if (e->underline) CatPrint(buf,"+UL"); + if (e->tree) CatPrint(buf,"+TR"); + if (e->collapsed) CatPrint(buf,"+C"); + st=MStrPrint("%q",e->tag); + "$$TX%s,\"%$$Q\"",buf,st; + Free(st); + if (*e->shift_x) + ",SX=%s",e->shift_x; + if (*e->shift_y) + ",SY=%s",e->shift_y; + if (*e->scroll_x) + ",SCX=%s",e->scroll_x; + if (*e->define_str) { + st=MStrPrint("%q",e->define_str); + ",D=\"%$$Q\"",st; + Free(st); + } + if (*e->html_link) { + st=MStrPrint("%q",e->html_link); + ",HTML=\"%$$Q\"",st; + Free(st); + } + "$$"; + } + Free(e); +} + +class CEdSong +{ + U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", + song[512] fmtstr "$$DA-P,A=\"Song :%s\"$$\n"; +}; + +U0 EdInsSong() +{ + CEdSong *e=CAlloc(sizeof(CEdSong)); + if (DocForm(e,,,,ctrl_L_footer)) + "$$SO,\"%$$Q\",A=\"%s\"$$",e->tag,e->song; + Free(e); +} + +class CEdHtmlCode +{ + U8 tag[512] fmtstr "$$DA-P,A=\"Html Code:%s\"$$\n"; +}; + +U0 EdInsHtml() +{ + CEdHtmlCode *e=CAlloc(sizeof(CEdHtmlCode)); + if (DocForm(e,,,,ctrl_L_footer)) + "$$HC,\"%$$Q\"$$",e->tag; + Free(e); +} + +class CEdMacroMenu +{ + U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", + left_macro[512] fmtstr "$$DA-P,A=\"Left Click Macro :%s\"$$\n", + left_exp[512] fmtstr "$$DA-P,A=\"Left Click Expression :%s\"$$\n"; + Bool popup fmtstr "$$CB,\"PopUp\"$$\n", + left_is_auto fmtstr "$$CB,\"Left is AutoStr\"$$\n", + left_x fmtstr "$$CB,\"Left X \"$$\n", + center_x fmtstr "$$CB,\"Center X \"$$\n", + right_x fmtstr "$$CB,\"Right X \"$$\n", + margin_rel fmtstr "$$CB,\"Margin Rel X\"$$\n", + blink fmtstr "$$CB,\"Blink\"$$\n", + invert fmtstr "$$CB,\"Invert\"$$\n", + underline fmtstr "$$CB,\"Underline\"$$\n", + escape fmtstr "$$CB,\"Escape\"$$\n"; + U8 scroll_x[512] fmtstr "$$DA-P,A=\"Scroll X Length Expression:%s\"$$\n", + shift_x[512] fmtstr "$$DA-P,A=\"X Offset Expression :%s\"$$\n", + shift_y[512] fmtstr "$$DA-P,A=\"Y Offset Expression :%s\"$$\n"; +}; + +U0 EdInsMacroMenu(Bool is_macro) +{ + U8 *st,buf[512]; + CEdMacroMenu *e=CAlloc(sizeof(CEdMacroMenu)); + e->underline=TRUE; + e->escape=TRUE; + if (DocForm(e,,,,ctrl_L_footer)) { + *buf=0; + if (e->popup) CatPrint(buf,"+PU-X"); + if (e->left_x ) CatPrint(buf,"+LX"); + if (e->center_x) CatPrint(buf,"+CX"); + if (e->right_x ) CatPrint(buf,"+RX"); + if (e->margin_rel) CatPrint(buf,"+MRX"); + if (e->blink) CatPrint(buf,"+BK"); + if (e->invert) CatPrint(buf,"+IV"); + if (!e->underline) CatPrint(buf,"-UL"); + if (!e->escape) CatPrint(buf,"-X"); + if (e->left_is_auto) CatPrint(buf,"+LA"); + if (*e->tag || is_macro) { + if (is_macro) { + if (*e->tag) { + st=MStrPrint("%q",e->tag); + "$$MA%s,\"%$$Q\"",buf,st; + Free(st); + } else + "$$MA%s",buf; + } else { + st=MStrPrint("%q",e->tag); + "$$MU%s,\"%$$Q\"",buf,st; + Free(st); + } + if (*e->left_exp) + ",LE=%s",e->left_exp; + if (*e->left_macro) { + st=MStrPrint("%q",e->left_macro); + ",LM=\"%$$Q\"",st; + Free(st); + } + if (*e->shift_x) + ",SX=%s",e->shift_x; + if (*e->shift_y) + ",SY=%s",e->shift_y; + if (*e->scroll_x) + ",SCX=%s",e->scroll_x; + "$$"; + } + } + Free(e); +} + +class CEdButton +{ + U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n"; + Bool popup fmtstr "$$CB,\"PopUp\"$$\n", + left_x fmtstr "$$CB,\"Left X \"$$\n", + center_x fmtstr "$$CB,\"Center X \"$$\n", + right_x fmtstr "$$CB,\"Right X \"$$\n", + margin_rel fmtstr "$$CB,\"Margin Rel X\"$$\n", + escape fmtstr "$$CB,\"Escape\"$$\n"; + U8 left_macro[512] fmtstr "$$DA-P,A=\"Left Click Macro:%s\"$$\n"; + Bool left_is_auto fmtstr "$$CB,\"Left is AutoStr\"$$\n"; + U8 left_exp[512] fmtstr "$$DA-P,A=\"Left Click Expression:%s\"$$\n"; + Bool quote fmtstr "$$CB,\"Quote\"$$\n"; +}; + +U0 EdInsButton() +{ + U8 *st,buf[512]; + CEdButton *e=CAlloc(sizeof(CEdButton)); + e->escape=TRUE; + if (DocForm(e,,,,ctrl_L_footer)) { + *buf=0; + if (e->popup) CatPrint(buf,"+PU-X"); + if (e->left_x ) CatPrint(buf,"+LX"); + if (e->center_x) CatPrint(buf,"+CX"); + if (e->right_x ) CatPrint(buf,"+RX"); + if (e->margin_rel) CatPrint(buf,"+MRX"); + if (!e->escape) CatPrint(buf,"-X"); + if (e->left_is_auto) CatPrint(buf,"+LA"); + if (*e->tag) { + if (e->quote) { + st=MStrPrint("%q",e->tag); + "$$$$BT%s,\\\"%$$Q\\\"",buf,st; + Free(st); + if (*e->left_exp) + ",LE=%s",e->left_exp; + if (*e->left_macro) { + st=MStrPrint("%q",e->left_macro); + ",LM=\\\"%$$Q\\\"",st; + Free(st); + } + "$$$$"; + } else { + st=MStrPrint("%q",e->tag); + "$$BT%s,\"%$$Q\"",buf,st; + Free(st); + if (*e->left_exp) + ",LE=%s",e->left_exp; + if (*e->left_macro) { + st=MStrPrint("%q",e->left_macro); + ",LM=\"%$$Q\"",st; + Free(st); + } + "$$"; + } + } + } + Free(e); +} + +class CEdCursorMovement +{ + U8 left_exp[512] fmtstr "$$DA-P,A=\"X Expression (LE):%s\"$$\n", + right_exp[512] fmtstr "$$DA-P,A=\"Y Expression (RE):%s\"$$\n"; + Bool left_x fmtstr "$$CB,\"Left X \"$$\n", + center_x fmtstr "$$CB,\"Center X \"$$\n", + right_x fmtstr "$$CB,\"Right X \"$$\n", + margin_rel fmtstr "$$CB,\"Margin Rel X\"$$\n", + top_y fmtstr "$$CB,\"Top Y \"$$\n", + center_y fmtstr "$$CB,\"Center Y \"$$\n", + bottom_y fmtstr "$$CB,\"Bottom Y \"$$\n", + page_rel fmtstr "$$CB,\"Page Rel Y\"$$\n", + quote fmtstr "$$CB,\"Quote\"$$\n"; +}; + +U0 EdInsCursorMovement() +{ + U8 buf[512]; + CEdCursorMovement *e=CAlloc(sizeof(CEdCursorMovement)); + if (DocForm(e,,,,ctrl_L_footer)) { + *buf=0; + if (e->left_x ) CatPrint(buf,"+LX"); + if (e->center_x) CatPrint(buf,"+CX"); + if (e->right_x ) CatPrint(buf,"+RX"); + if (e->margin_rel) CatPrint(buf,"+MRX"); + if (e->top_y ) CatPrint(buf,"+TY"); + if (e->center_y) CatPrint(buf,"+CY"); + if (e->bottom_y) CatPrint(buf,"+BY"); + if (e->page_rel) CatPrint(buf,"+PRY"); + if (!*e->left_exp) CatPrint(buf,"-LE"); + if (!*e->right_exp) CatPrint(buf,"-RE"); + if (e->quote) + "$$"; + "$$CM%s",buf; + if (*e->left_exp) + ",LE=%s",e->left_exp; + if (*e->right_exp) + ",RE=%s",e->right_exp; + "$$"; + if (e->quote) + "$$"; + } + Free(e); +} + +class CEdDataNum +{ + U8 fmt_str[512] fmtstr "$$DA-P,A=\"Format Str:%s\"$$\n"; + I64 len; + Bool term fmtstr "$$CB,\"Form Field Terminator\"$$\n", + remalloc, + refresh fmtstr "$$CB,\"Refresh Data\"$$\n", + update fmtstr "$$CB,\"Update Data\"$$\n"; +}; + +class CEdDataStr +{ + U8 fmt_str[512] fmtstr "$$DA-P,A=\"Format Str:%s\"$$\n"; + I64 len fmtstr "$$DA,A=\"Length:%d\"$$\n"; + Bool term fmtstr "$$CB,\"Zero Terminator\"$$\n", + remalloc fmtstr "$$CB,\"Remalloc for Unlimited Length\"$$\n", + refresh fmtstr "$$CB,\"Refresh Data\"$$\n", + update fmtstr "$$CB,\"Update Data\"$$\n"; +}; + +U0 EdInsData() +{ + I64 i,type=RT_I64; + U8 *st,buf[512],raw_type[16]; + CEdDataNum *e=CAlloc(sizeof(CEdDataNum)); + e->term=TRUE; + e->len=DOCE_LEN_DFT; + if ((i=PopUpPickDefineSub("ST_NATURAL_TYPES"))>=0) { + *buf=0; + i+=RT_I8; + if (i==RT_F32) + i=RT_F64; + if (i==RT_UF32) {//U8 * + i=DocForm(e(CEdDataStr *),,,,ctrl_L_footer); + if (e->remalloc) { + CatPrint(buf,"+M"); + e->term=TRUE; + } else + CatPrint(buf,"-P"); + } else { + type=i; + i=DocForm(e,,,,ctrl_L_footer); + } + if (i) { + if (type==RT_I64) + *raw_type=0; + else + StrPrint(raw_type,",RT=%Z",type,"ST_RAW_TYPES"); + + if (!e->term) CatPrint(buf,"-TRM"); + if (e->refresh) CatPrint(buf,"+RD"); + if (e->update) CatPrint(buf,"+UD"); + + st=MStrPrint("%q",e->fmt_str); + if (e->remalloc) + "$$$$DA%s,A=\\\"%$$Q\\\"$$$$",buf,st; + else if (e->len==DOCE_LEN_DFT) + "$$$$DA%s%s,A=\\\"%$$Q\\\"$$$$",buf,raw_type,st; + else + "$$$$DA%s,LEN=%d%s,A=\\\"%$$Q\\\"$$$$",buf,e->len,raw_type,st; + Free(st); + } + } + Free(e); +} + +class CEdCheckBox +{ + U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n"; + Bool refresh fmtstr "$$CB,\"Refresh Data\"$$\n"; + I64 type fmtstr "$$LS,D=\"ST_INT_SIZE_TYPES\"$$\n"; +}; + +U0 EdInsCheckBox() +{ + U8 *st,buf[512],raw_type[16]; + CEdCheckBox *e=CAlloc(sizeof(CEdCheckBox)); + e->type=RT_I8-RT_I8; + if (DocForm(e,,,,ctrl_L_footer)) { + *buf=0; + e->type+=RT_I8; + if (e->type==RT_I8) + *raw_type=0; + else + StrPrint(raw_type,",RT=%Z",e->type,"ST_RAW_TYPES"); + if (e->refresh) CatPrint(buf,"+RD"); + st=MStrPrint("%q",e->tag); + "$$$$CB%s%s,\\\"%$$Q\\\"$$$$",buf,raw_type,st; + Free(st); + } + Free(e); +} + +class CEdLst +{ + U8 tag[512] fmtstr "$$DA-P,A=\"Dft Sel :%s\"$$\n", + define_str[512] fmtstr "$$DA-P,A=\"Define Str :%s\"$$\n"; + Bool refresh fmtstr "$$CB,\"Refresh Data\"$$\n"; + I64 type fmtstr "$$LS,D=\"ST_INT_SIZE_TYPES\"$$\n"; +}; + +U0 EdInsLst() +{ + U8 *st1,*st2,buf[512],raw_type[16]; + CEdLst *e=CAlloc(sizeof(CEdLst)); + e->type=RT_I64-RT_I8; + if (DocForm(e,,,,ctrl_L_footer)) { + *buf=0; + e->type+=RT_I8; + if (e->type==RT_I64) + *raw_type=0; + else + StrPrint(raw_type,",RT=%Z",e->type,"ST_RAW_TYPES"); + if (e->refresh) CatPrint(buf,"+RD"); + if (!*e->tag) + st1=NULL; + else + st1=MStrPrint("%q",e->tag); + st2=MStrPrint("%q",e->define_str); + if (st1) + "$$$$LS%s%s,\\\"%$$Q\\\",D=\\\"%$$Q\\\"$$$$",buf,raw_type,st1,st2; + else + "$$$$LS%s%s,D=\\\"%$$Q\\\"$$$$",buf,raw_type,st2; + Free(st1); + Free(st2); + } + Free(e); +} + +class CEdHexEd +{ + I64 cnt fmtstr "$$DA,A=\"Count:%d\"$$\n", + cols fmtstr "$$DA,A=\"Columns:%d\"$$\n"; + Bool zero fmtstr "$$CB,\"Zero Based\"$$\n", + refresh fmtstr "$$CB,\"Refresh Data\"$$\n"; +}; + +U0 EdInsHexEd() +{ + U8 buf[512]; + CEdHexEd *e=CAlloc(sizeof(CEdHexEd)); + e->cnt=128; + e->cols=4; + e->zero=TRUE; + if (DocForm(e,,,,ctrl_L_footer)) { + *buf=0; + if (!e->zero) CatPrint(buf,"-Z"); + if (e->refresh) CatPrint(buf,"+RD"); + "$$$$HX%s,%d,%d$$$$",buf,e->cnt,e->cols; + } + Free(e); +} + +class CEdBin +{ + U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n"; + I64 bin_num fmtstr "$$DA,A=\"Bin Num:%d\"$$\n"; + U8 bin_ptr_link_file[512] fmtstr "$$DA-P,A=\"File:%s\"$$\n"; + I64 bin_ptr_link_bin_num fmtstr "$$DA,A=\"File Bin Num:%d\"$$\n"; + U8 bin_ptr_link_tag[512] fmtstr "$$DA-P,A=\"File Bin Tag:%s\"$$\n"; +}; + +U0 EdInsBin(I64 bin_num,I64 type) +{ + CEdBin *e=CAlloc(sizeof(CEdBin)); + StrPrint(e->tag,"<%d>",bin_num); + e->bin_num=bin_num; + e->bin_ptr_link_bin_num=1; + if (DocForm(e,,, + "Note: Normally, you enter no file,\n" + "just a bin num. If You enter a\n" + "file, enter a file bin num or a file\n" + "bin tag.\n\n",ctrl_L_footer)) { + if (*e->bin_ptr_link_file) { + if (*e->bin_ptr_link_tag) + "$$%Z,\"%$$Q\",BI=%d,BP=\"%s,%s\"$$",type,"ST_DOC_CMDS",e->tag,e->bin_num, + e->bin_ptr_link_file,e->bin_ptr_link_tag; + else + "$$%Z,\"%$$Q\",BI=%d,BP=\"%s,%d\"$$",type,"ST_DOC_CMDS",e->tag,e->bin_num, + e->bin_ptr_link_file,e->bin_ptr_link_bin_num; + } else { + if (DocBinFindNum(DocPut,e->bin_num)) + "$$%Z,\"%$$Q\",BI=%d$$",type,"ST_DOC_CMDS",e->tag,e->bin_num; + else + PopUpOk("Invalid Binary Num"); + } + } + Free(e); +} + +class CEdTree +{ + U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n"; + I64 indent fmtstr "$$DA,A=\"Indention:%d\"$$\n"; + Bool collapsed fmtstr "$$CB,\"Collapsed\"$$\n"; +}; + +U0 EdInsTree() +{ + U8 *st1,*st2,buf[512]; + CEdTree *e=CAlloc(sizeof(CEdTree)); + e->collapsed=TRUE; + e->indent=2; + if (DocForm(e,,,,ctrl_L_footer)) { + *buf=0; + if (!e->collapsed) CatPrint(buf,"-C"); + st1=MStrPrint("%q",e->tag); + st2=MStrPrint("$$TR%s,\"%$$Q\"$$\n$$ID,%d$$*\n$$ID,%d$$", + buf,st1,e->indent,-e->indent); + DocPrintAtomic(DocPut,"%s",st2); + Free(st1); + Free(st2); + } + Free(e); +} + +U0 EdInsWidgetWiz() +{ + I64 type=PopUpWidgetType; + switch (type) { + case DOCT_FOREGROUND: + EdInsColor; + break; + case DOCT_PAGE_LEN: + EdInsPageSetting; + break; + case DOCT_LINK: + EdInsLink; + break; + case DOCT_TEXT: + EdInsText; + break; + case DOCT_TREE: + EdInsTree; + break; + case DOCT_MACRO: + EdInsMacroMenu(TRUE); + break; + case DOCT_MENU_VAL: + EdInsMacroMenu(FALSE); + break; + case DOCT_CURSOR_MOVEMENT: + EdInsCursorMovement; + break; + case DOCT_BUTTON: + EdInsButton; + break; + case DOCT_DATA: + EdInsData; + break; + case DOCT_CHECK_BOX: + EdInsCheckBox; + break; + case DOCT_LST: + EdInsLst; + break; + case DOCT_HEX_ED: + EdInsHexEd; + break; + case DOCT_SONG: + EdInsSong; + break; + case WIZ_HIGHLIGHT_ON: + "$$HL,1$$"; + break; + case WIZ_HIGHLIGHT_OFF: + "$$HL,0$$"; + break; + case DOCT_HTML_CODE: + EdInsHtml; + } +} + +#define EST_SPRITE 0 +#define EST_SPRITE_PTR 1 +#define EST_DUP_SPRITE 2 +#define EST_SPRITE_SIZE 3 +#define EST_SPRITE_MACRO 4 +#define EST_SPRITE_MENU 5 +#define EST_SPRITE_LINK 6 + +I64 PopUpSpriteType() +{ + I64 i; + CDoc *doc=DocNew; + DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Graphic Sprite Resource Menu\"$$\n" + "$$LK+PU+CX,\"Click for Help\",A=\"FI:::/Doc/Resource.DD.Z\"$$\n\n" + "$$LTBLUE$$$$MU,\"Make Sprite\",LE=EST_SPRITE$$$$FG$$\t " + "Start by making a sprite.\n" + "$$LTBLUE$$$$MU,\"Ptr to Sprite\",LE=EST_SPRITE_PTR$$$$FG$$\t " + "Insert pointer into src code.\n" + "$$LTBLUE$$$$MU,\"Duplicate Sprite\",LE=EST_DUP_SPRITE$$$$FG$$ " + "Make dup image for in a doc.\n" + "$$LTBLUE$$$$MU,\"Sprite Size\",LE=EST_SPRITE_SIZE$$$$FG$$\t " + "Insert size of a sprite into src code.\n" + "$$LTBLUE$$$$MU,\"Sprite Macro\",LE=EST_SPRITE_MACRO$$$$FG$$\t " + "Create icon with auto-text payload.\n" + "$$LTBLUE$$$$MU,\"Sprite Menu Item\",LE=EST_SPRITE_MENU$$$$FG$$ " + "Create icon with numeric payload.\n" + "$$LTBLUE$$$$MU,\"Sprite Link\",LE=EST_SPRITE_LINK$$$$FG$$\t " + "Create icon with link payload.\n\n" + "$$LTBLUE$$$$MU,\"Abort\",LE=DOCM_CANCEL$$\n\n"); + i=PopUpMenu(doc); + DocDel(doc); + return i; +} + +class CEdMacroSprite +{ + U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", + exp[512] fmtstr "$$DA-P,A=\"Macro :%s\"$$\n"; + Bool escape fmtstr "$$CB,\"Escape\"$$\n", + popup fmtstr "$$CB,\"PopUp\"$$\n", + is_auto fmtstr "$$CB,\"AutoStr\"$$\n"; +}; + +class CEdMenuSprite +{ + U8 tag[512] fmtstr "$$DA-P,A=\"Tag Text :%s\"$$\n", + exp[512] fmtstr "$$DA-P,A=\"Expression :%s\"$$\n"; + Bool escape fmtstr "$$CB,\"Escape\"$$\n", + popup, + is_auto; +}; + +U8 *EdSpriteLink(Bool *_pop_up,U8 **_html_link) +{ + U8 *res=NULL,*tag=NULL,*link=NULL; + Bool quote=FALSE; + I64 type=PopUpLinkType(FALSE); + *_html_link=NULL; + if (type>=0 && GetLink(type,&tag,&link,_pop_up,"e,_html_link)) + res=MStrPrint("\"%$$Q\",A=\"%$$Q\"",tag,link); + Free(tag); + Free(link); + return res; +} + +U8 *EdSprite(I64 bin_num) +{ + I64 type=PopUpSpriteType; + Bool pop_up; + U8 *st,*st1=NULL,*st2=NULL,buf[1024],*html_link=NULL; + CEdMacroSprite *e=CAlloc(sizeof(CEdMacroSprite)); + *buf=0; + switch (type) { + case EST_SPRITE: + st1=MStrPrint("\"<%d>\"",bin_num); + break; + case EST_SPRITE_MACRO: + e->escape=TRUE; + if (DocForm(e,,,,ctrl_L_footer)) { + CatPrint(buf,"+UL"); + if (e->is_auto) CatPrint(buf,"+LA"); + if (e->popup) CatPrint(buf,"+PU"); + if (e->escape) CatPrint(buf,"+X"); + st=MStrPrint("%q",e->exp); + st1=MStrPrint("\"%$$Q\",LM=\"%$$Q\"",e->tag,st); + Free(st); + } + break; + case EST_SPRITE_MENU: + e->escape=TRUE; + if (DocForm(e,"CEdMenuSprite",,,ctrl_L_footer)) { + if (e->escape) CatPrint(buf,"+X"); + st1=MStrPrint("\"%$$Q\",LE=%s",e->tag,e->exp); + } + break; + case EST_SPRITE_LINK: + CatPrint(buf,"+L"); + st1=EdSpriteLink(&pop_up,&html_link); + if (pop_up) + CatPrint(buf,"+PU"); + break; + case EST_SPRITE_PTR: + EdInsBin(--bin_num,DOCT_INS_BIN); + break; + case EST_SPRITE_SIZE: + EdInsBin(--bin_num,DOCT_INS_BIN_SIZE); + break; + case EST_DUP_SPRITE: + EdInsBin(--bin_num,DOCT_SPRITE); + break; + } + if (st1) { + if (html_link) + st2=MStrPrint("$$SP%s,%s,HTML=\"%$$Q\",BI=%d$$",buf,st1,html_link,bin_num); + else + st2=MStrPrint("$$SP%s,%s,BI=%d$$",buf,st1,bin_num); + Free(st1); + } + Free(e); + Free(html_link); + return st2; +} diff --git a/Adam/DolDoc/MakeDoc.CPP b/Adam/DolDoc/MakeDoc.CPP deleted file mode 100644 index fcb5a90..0000000 --- a/Adam/DolDoc/MakeDoc.CPP +++ /dev/null @@ -1,70 +0,0 @@ -Cd(__DIR__);; - -#help_index "DolDoc" -#help_file "::/Doc/DolDoc" - -/* -TempleOS DolDoc's can have "cursor movement" cmds which can move the cursor up -the screen and layer on existing text. It can also have callback funs which -supply live, changing text. For these reasons, you can't assume you know -where the visible portion of the document is and must process much -of the document each time it is placed on the screen, becoming CPU -intensive on big documents. -See $LK,"::/Doc/DolDocOverview.TXT"$ -*/ - -//Hash Types -#define DHT_DOC_CMD 1 -#define DHT_DOC_FLAG 2 -#define DHT_COLOR 4 - -public class CDolDocGlbls -{ - CHashTable *hash; - I64 dft_de_flags [DOCT_NUM_TYPES], - type_flags_nontag_invisible [(DOCT_NUM_TYPES+63)/64], - type_flags_form [(DOCT_NUM_TYPES+63)/64], - type_flags_data [(DOCT_NUM_TYPES+63)/64], - type_flags_chk_dup [(DOCT_NUM_TYPES+63)/64], - clean_scan_codes [4]; - I32 dft_type_flags [DOCT_NUM_TYPES]; -} doldoc; -MemSet(&doldoc,0,sizeof(CDolDocGlbls)); - -#help_index "God" -#define BIBLE_FILENAME "::/Misc/Bible.TXT.Z" - -#include "DocExt" -#include "DocBin" -#include "DocNew" -#include "DocForm" -#include "DocDblBuf" -#include "DocPlain" -#include "DocInit" -#include "DocHighlight" -#include "DocRecalcLib" -#include "DocRecalc" -#include "DocFile" -#include "DocClipBoard" -#include "DocRun" -#include "DocGet" -#include "DocChar" -#include "DocFind" -#include "DocLink" -#include "DocEd" -#include "DocPopUp" -#include "DocGr" -#include "DocMacro" -#include "DocWidgetWiz" -#include "DocPutKey" -#include "DocPutS" -#include "DocOpt" -#include "DocCodeTools" -#include "DocTree" -#include "DocTerm" - -KeyDevAdd(&KDDocPutKey,&KDDocPutS,0x80000000,TRUE); -fp_getstr2=&DocGetStr2; -fp_doc_put=&DocPut; - -Cd("..");; diff --git a/Adam/DolDoc/MakeDoc.HC b/Adam/DolDoc/MakeDoc.HC new file mode 100644 index 0000000..b8fca39 --- /dev/null +++ b/Adam/DolDoc/MakeDoc.HC @@ -0,0 +1,70 @@ +Cd(__DIR__);; + +#help_index "DolDoc" +#help_file "::/Doc/DolDoc" + +/* +TempleOS DolDoc's can have "cursor movement" cmds which can move the cursor up +the screen and layer on existing text. It can also have callback funs which +supply live, changing text. For these reasons, you can't assume you know +where the visible portion of the document is and must process much +of the document each time it is placed on the screen, becoming CPU +intensive on big documents. +See $LK,"::/Doc/DolDocOverview.DD"$ +*/ + +//Hash Types +#define DHT_DOC_CMD 1 +#define DHT_DOC_FLAG 2 +#define DHT_COLOR 4 + +public class CDolDocGlbls +{ + CHashTable *hash; + I64 dft_de_flags [DOCT_NUM_TYPES], + type_flags_nontag_invisible [(DOCT_NUM_TYPES+63)/64], + type_flags_form [(DOCT_NUM_TYPES+63)/64], + type_flags_data [(DOCT_NUM_TYPES+63)/64], + type_flags_chk_dup [(DOCT_NUM_TYPES+63)/64], + clean_scan_codes [4]; + I32 dft_type_flags [DOCT_NUM_TYPES]; +} doldoc; +MemSet(&doldoc,0,sizeof(CDolDocGlbls)); + +#help_index "God" +#define BIBLE_FILENAME "::/Misc/Bible.TXT.Z" + +#include "DocExt" +#include "DocBin" +#include "DocNew" +#include "DocForm" +#include "DocDblBuf" +#include "DocPlain" +#include "DocInit" +#include "DocHighlight" +#include "DocRecalcLib" +#include "DocRecalc" +#include "DocFile" +#include "DocClipBoard" +#include "DocRun" +#include "DocGet" +#include "DocChar" +#include "DocFind" +#include "DocLink" +#include "DocEd" +#include "DocPopUp" +#include "DocGr" +#include "DocMacro" +#include "DocWidgetWiz" +#include "DocPutKey" +#include "DocPutS" +#include "DocOpt" +#include "DocCodeTools" +#include "DocTree" +#include "DocTerm" + +KeyDevAdd(&KDDocPutKey,&KDDocPutS,0x80000000,TRUE); +fp_getstr2=&DocGetStr2; +fp_doc_put=&DocPut; + +Cd("..");; diff --git a/Adam/God/GodBible.CPP b/Adam/God/GodBible.HC similarity index 100% rename from Adam/God/GodBible.CPP rename to Adam/God/GodBible.HC diff --git a/Adam/God/GodDoodle.CPP b/Adam/God/GodDoodle.CPP deleted file mode 100644 index 2607798..0000000 --- a/Adam/God/GodDoodle.CPP +++ /dev/null @@ -1,188 +0,0 @@ -#help_index "God;Graphics/Sprite;Sprites" - -U0 GodDoodleDraw(CTask *task,CDC *dc) -{ - GrBlot(dc,0,0,god.doodle_dc); - if (Blink) { - if (god.doodle_done) { - dc->color=RED; - GrPrint(dc,(task->pix_width-FONT_WIDTH*29)>>1, - (task->pix_height-3*FONT_HEIGHT)>>1, - "Press to insert sprite."); - GrPrint(dc,(task->pix_width-FONT_WIDTH*39)>>1, - (task->pix_height-3*FONT_HEIGHT)>>1+2*FONT_HEIGHT, - "Press to throw-away sprite."); - } else { - dc->color=GREEN; - GrPrint(dc,(task->pix_width-FONT_WIDTH*25)>>1, - (task->pix_height-FONT_HEIGHT)>>1, - "Press repeatedly."); - } - } -} - -U0 GodDoodleSmooth(I64 num) -{ - CDC *dc=DCExt(god.doodle_dc,0,0, - god.doodle_dc->width-1,god.doodle_dc->height-1); - I64 i,x,y,x1,y1,c,histogram[16],best,best_cnt,c_old=god.doodle_dc->color; - for (y=0;yheight;y++) - for (x=0;xwidth;x++) { - MemSet(histogram,0,sizeof(histogram)); - for (y1=y-num;y1<=y+num;y1++) - for (x1=x-num;x1<=x+num;x1++) { - c=GrPeek(dc,x1,y1); - if (0<=c<=15) - histogram[c]++; - } - best=BLACK; - best_cnt=-1; - for (i=0;i<16;i++) - if (histogram[i]>best_cnt) { - best=i; - best_cnt=histogram[i]; - } - god.doodle_dc->color=best; - GrPlot(god.doodle_dc,x,y); - } - god.doodle_dc->color=c_old; - DCDel(dc); -} - -U0 GodDoodleBitsIns(I64 num_bits,I64 n) -{//Insert bits into God doodle bit fifo. - I64 i; - for (i=0;i>=1; - } -} - -U0 GodDoodleHexIns(U8 *st) -{//Insert hex record into God doodle bit fifo. - U8 buf[2]; - if (st) { - buf[1]=0; - while (*buf=*st++) - if (Bt(chars_bmp_hex_numeric,*buf)) - GodDoodleBitsIns(4,Str2I64(buf,16)); - } -} - -I64 GodDoodleBits(I64 num_bits) -{ - U8 b; - I64 res=0; - while (num_bits) { - if (FifoU8Rem(god.doodle_fifo,&b)) { - res=res<<1+b; - num_bits--; - } else { - god.doodle_ch=GetChar(,FALSE); - if (god.doodle_ch==CH_ESC||god.doodle_ch==CH_SHIFT_ESC) - throw; - else if (god.doodle_ch=='\n') { - DCFill(god.doodle_dc,WHITE); - FifoU8Flush(god.doodle_fifo); - } else if ('0'<=god.doodle_ch<='9') - GodDoodleSmooth(god.doodle_ch-'0'); - else - GodDoodleBitsIns(GOD_GOOD_BITS,KbdMouseEvtTime>>GOD_BAD_BITS); - } - } - return res; -} - -public U8 *GodDoodleSprite(U8 *hex=NULL) -{//Make God draw sprite. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.TXT"$ - I64 i,j,w,h,x,y,ch; - U8 *elems; - - if (god.doodle_dc) return NULL; - god.doodle_done=FALSE; - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - AutoComplete; - WinBorder; - WinMax; - - PopUpOk("The $LK+PU,"Holy Spirit",A="FI:::/Adam/God/HSNotes.TXT"$ can puppet you.\n\n" - "Press $$GREEN$$$$FG$$ until it finishes."); - - god.doodle_ch=0; - god.doodle_dc=DCNew(Fs->pix_width,Fs->pix_height); - DCFill(god.doodle_dc,WHITE); - w=god.doodle_dc->width; - h=god.doodle_dc->height; - - Fs->draw_it=&GodDoodleDraw; - FifoU8Flush(god.doodle_fifo); - GodDoodleHexIns(hex); - try { - for (i=0;i<3;i++) { - god.doodle_dc->color=RED; - for (j=0;j<29;j++) - switch [GodDoodleBits(3)] { - case 0: - GrEllipse3(god.doodle_dc, - (w-1)*GodDoodleBits(5)/15.5-w/2, - (h-1)*GodDoodleBits(5)/15.5-h/2,0, - (w-1)*GodDoodleBits(5)/15.5,(h-1)*GodDoodleBits(5)/15.5); - break; - case 1: - GrCircle3(god.doodle_dc, - (w-1)*GodDoodleBits(5)/15.5-w/2, - (h-1)*GodDoodleBits(5)/15.5-h/2,0, - (w-1)*GodDoodleBits(5)/15.5); - break; - case 2: - GrBorder(god.doodle_dc, - (w-1)*GodDoodleBits(5)/15.5-w/2, - (h-1)*GodDoodleBits(5)/15.5-h/2, - (w-1)*GodDoodleBits(5)/15.5,(h-1)*GodDoodleBits(5)/15.5); - break; - case 3...7: - GrLine3(god.doodle_dc, - (w-1)*GodDoodleBits(4)/15,(h-1)*GodDoodleBits(4)/15,0, - (w-1)*GodDoodleBits(4)/15,(h-1)*GodDoodleBits(4)/15,0); - break; - } - for (j=0;j<6;j++) { - x=(w-1)*GodDoodleBits(5)/31+w/64; - y=(h-1)*GodDoodleBits(5)/31+h/64; - switch [GodDoodleBits(2)] { - case 0: god.doodle_dc->color=BLACK; break; - case 1: god.doodle_dc->color=DKGRAY; break; - case 2: god.doodle_dc->color=LTGRAY; break; - case 3: god.doodle_dc->color=WHITE; break; - } - GrFloodFill3(god.doodle_dc,x,y,0); - } - GodDoodleSmooth(3); - } - god.doodle_done=TRUE; - do ch=GetChar(,FALSE); - while (ch!=CH_ESC && ch!=CH_SHIFT_ESC); - } catch { - Fs->catch_except=TRUE; - ch=CH_SHIFT_ESC; - } - DCFill; - SettingsPop; - if (ch==CH_ESC) - elems=DC2Sprite(god.doodle_dc); - else - elems=NULL; - DCDel(god.doodle_dc); - god.doodle_dc=NULL; - return elems; -} - -#help_index "God" -public U0 GodDoodle(U8 *hex=NULL) -{//Make God draw sprite, insert in doc. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.TXT"$ - U8 *elems; - if (elems=GodDoodleSprite(hex)) { - Sprite(elems); - Free(elems); - } -} diff --git a/Adam/God/GodDoodle.HC b/Adam/God/GodDoodle.HC new file mode 100644 index 0000000..fd154ba --- /dev/null +++ b/Adam/God/GodDoodle.HC @@ -0,0 +1,188 @@ +#help_index "God;Graphics/Sprite;Sprites" + +U0 GodDoodleDraw(CTask *task,CDC *dc) +{ + GrBlot(dc,0,0,god.doodle_dc); + if (Blink) { + if (god.doodle_done) { + dc->color=RED; + GrPrint(dc,(task->pix_width-FONT_WIDTH*29)>>1, + (task->pix_height-3*FONT_HEIGHT)>>1, + "Press to insert sprite."); + GrPrint(dc,(task->pix_width-FONT_WIDTH*39)>>1, + (task->pix_height-3*FONT_HEIGHT)>>1+2*FONT_HEIGHT, + "Press to throw-away sprite."); + } else { + dc->color=GREEN; + GrPrint(dc,(task->pix_width-FONT_WIDTH*25)>>1, + (task->pix_height-FONT_HEIGHT)>>1, + "Press repeatedly."); + } + } +} + +U0 GodDoodleSmooth(I64 num) +{ + CDC *dc=DCExt(god.doodle_dc,0,0, + god.doodle_dc->width-1,god.doodle_dc->height-1); + I64 i,x,y,x1,y1,c,histogram[16],best,best_cnt,c_old=god.doodle_dc->color; + for (y=0;yheight;y++) + for (x=0;xwidth;x++) { + MemSet(histogram,0,sizeof(histogram)); + for (y1=y-num;y1<=y+num;y1++) + for (x1=x-num;x1<=x+num;x1++) { + c=GrPeek(dc,x1,y1); + if (0<=c<=15) + histogram[c]++; + } + best=BLACK; + best_cnt=-1; + for (i=0;i<16;i++) + if (histogram[i]>best_cnt) { + best=i; + best_cnt=histogram[i]; + } + god.doodle_dc->color=best; + GrPlot(god.doodle_dc,x,y); + } + god.doodle_dc->color=c_old; + DCDel(dc); +} + +U0 GodDoodleBitsIns(I64 num_bits,I64 n) +{//Insert bits into God doodle bit fifo. + I64 i; + for (i=0;i>=1; + } +} + +U0 GodDoodleHexIns(U8 *st) +{//Insert hex record into God doodle bit fifo. + U8 buf[2]; + if (st) { + buf[1]=0; + while (*buf=*st++) + if (Bt(chars_bmp_hex_numeric,*buf)) + GodDoodleBitsIns(4,rev_bits_table[Str2I64(buf,16)]>>4); + } +} + +I64 GodDoodleBits(I64 num_bits) +{ + U8 b; + I64 res=0; + while (num_bits) { + if (FifoU8Rem(god.doodle_fifo,&b)) { + res=res<<1+b; + num_bits--; + } else { + god.doodle_ch=GetChar(,FALSE); + if (god.doodle_ch==CH_ESC||god.doodle_ch==CH_SHIFT_ESC) + throw; + else if (god.doodle_ch=='\n') { + DCFill(god.doodle_dc,WHITE); + FifoU8Flush(god.doodle_fifo); + } else if ('0'<=god.doodle_ch<='9') + GodDoodleSmooth(god.doodle_ch-'0'); + else + GodDoodleBitsIns(GOD_GOOD_BITS,KbdMouseEvtTime>>GOD_BAD_BITS); + } + } + return res; +} + +public U8 *GodDoodleSprite(U8 *hex=NULL) +{//Make God draw sprite. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.DD"$ + I64 i,j,w,h,x,y,ch; + U8 *elems; + + if (god.doodle_dc) return NULL; + god.doodle_done=FALSE; + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + AutoComplete; + WinBorder; + WinMax; + + PopUpOk("The $LK+PU,"Holy Spirit",A="FI:::/Adam/God/HSNotes.DD"$ can puppet you.\n\n" + "Press $$GREEN$$$$FG$$ until it finishes."); + + god.doodle_ch=0; + god.doodle_dc=DCNew(Fs->pix_width,Fs->pix_height); + DCFill(god.doodle_dc,WHITE); + w=god.doodle_dc->width; + h=god.doodle_dc->height; + + Fs->draw_it=&GodDoodleDraw; + FifoU8Flush(god.doodle_fifo); + GodDoodleHexIns(hex); + try { + for (i=0;i<3;i++) { + god.doodle_dc->color=RED; + for (j=0;j<29;j++) + switch [GodDoodleBits(3)] { + case 0: + GrEllipse3(god.doodle_dc, + (w-1)*GodDoodleBits(5)/15.5-w/2, + (h-1)*GodDoodleBits(5)/15.5-h/2,0, + (w-1)*GodDoodleBits(5)/15.5,(h-1)*GodDoodleBits(5)/15.5); + break; + case 1: + GrCircle3(god.doodle_dc, + (w-1)*GodDoodleBits(5)/15.5-w/2, + (h-1)*GodDoodleBits(5)/15.5-h/2,0, + (w-1)*GodDoodleBits(5)/15.5); + break; + case 2: + GrBorder(god.doodle_dc, + (w-1)*GodDoodleBits(5)/15.5-w/2, + (h-1)*GodDoodleBits(5)/15.5-h/2, + (w-1)*GodDoodleBits(5)/15.5,(h-1)*GodDoodleBits(5)/15.5); + break; + case 3...7: + GrLine3(god.doodle_dc, + (w-1)*GodDoodleBits(4)/15,(h-1)*GodDoodleBits(4)/15,0, + (w-1)*GodDoodleBits(4)/15,(h-1)*GodDoodleBits(4)/15,0); + break; + } + for (j=0;j<6;j++) { + x=(w-1)*GodDoodleBits(5)/31+w/64; + y=(h-1)*GodDoodleBits(5)/31+h/64; + switch [GodDoodleBits(2)] { + case 0: god.doodle_dc->color=BLACK; break; + case 1: god.doodle_dc->color=DKGRAY; break; + case 2: god.doodle_dc->color=LTGRAY; break; + case 3: god.doodle_dc->color=WHITE; break; + } + GrFloodFill3(god.doodle_dc,x,y,0); + } + GodDoodleSmooth(3); + } + god.doodle_done=TRUE; + do ch=GetChar(,FALSE); + while (ch!=CH_ESC && ch!=CH_SHIFT_ESC); + } catch { + Fs->catch_except=TRUE; + ch=CH_SHIFT_ESC; + } + DCFill; + SettingsPop; + if (ch==CH_ESC) + elems=DC2Sprite(god.doodle_dc); + else + elems=NULL; + DCDel(god.doodle_dc); + god.doodle_dc=NULL; + return elems; +} + +#help_index "God" +public U0 GodDoodle(U8 *hex=NULL) +{//Make God draw sprite, insert in doc. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.DD"$ + U8 *elems; + if (elems=GodDoodleSprite(hex)) { + Sprite(elems); + Free(elems); + } +} diff --git a/Adam/God/GodExt.CPP b/Adam/God/GodExt.CPP deleted file mode 100644 index c2cd366..0000000 --- a/Adam/God/GodExt.CPP +++ /dev/null @@ -1,24 +0,0 @@ -#help_index "God" - -#define GOD_BAD_BITS 4 -#define GOD_GOOD_BITS 24 - -public class CGodGlbls -{ - U8 **words; - I64 num_words; - CFifoU8 *fifo; - CDC *doodle_dc; - I64 doodle_ch; - CFifoU8 *doodle_fifo; - Bool doodle_done; -} god; -MemSet(&god,0,sizeof(CGodGlbls)); -god.doodle_fifo =FifoU8New(2048*8); -god.fifo =FifoU8New(2048*8); - -extern U0 GodBitsIns(I64 num_bits,I64 n); -extern U0 GodDoodle(U8 *hex=NULL); -extern U0 GodPassage(I64 num_lines=20); -extern U0 GodSong(); -extern U0 GodWord(); diff --git a/Adam/God/GodExt.HC b/Adam/God/GodExt.HC new file mode 100644 index 0000000..32d864a --- /dev/null +++ b/Adam/God/GodExt.HC @@ -0,0 +1,26 @@ +#help_index "God" + +#define GOD_BAD_BITS 4 +#define GOD_GOOD_BITS 24 + +public class CGodGlbls +{ + U8 **words, + *word_file_mask; + I64 word_fuf_flags, + num_words; + CFifoU8 *fifo; + CDC *doodle_dc; + I64 doodle_ch; + CFifoU8 *doodle_fifo; + Bool doodle_done; +} god; +MemSet(&god,0,sizeof(CGodGlbls)); +god.doodle_fifo =FifoU8New(2048*8); +god.fifo =FifoU8New(2048*8); + +extern U0 GodBitsIns(I64 num_bits,I64 n); +extern U0 GodDoodle(U8 *hex=NULL); +extern U0 GodBiblePassage(I64 num_lines=20); +extern U0 GodSong(); +extern U0 GodWord(Bool show_num=FALSE); diff --git a/Adam/God/GodSong.CPP b/Adam/God/GodSong.CPP deleted file mode 100644 index 652ff63..0000000 --- a/Adam/God/GodSong.CPP +++ /dev/null @@ -1,164 +0,0 @@ -#help_index "God" - -DefineLstLoad("ST_RHYTHM_COMPLEXITY","Simple\0Normal\0Complex\0"); - -class MakeSongSettings -{ - I64 complexity fmtstr "$$LS,D=\"ST_RHYTHM_COMPLEXITY\"$$\n"; - Bool rests fmtstr "$$CB,\"Rests\"$$\n"; - Bool six_eight fmtstr "$$CB,\"Six Eight\"$$\n"; - I64 octave fmtstr "$$DA-TRM,A=\"Octave:%d\"$$\n"; -}; - -U0 InsNote(MakeSongSettings *mss,U8 *buf,I64 k,I64 *j) -{//k is a random note nibble - if (!k && mss->rests) { - buf[*j]='R'; - *j+=1; - } else { - k/=2; - if (!k) { - if (music.octave) { - buf[*j]=music.octave-1+'0'; - *j+=1; - buf[*j]='G'; - *j+=1; - buf[*j]=music.octave+'0'; - *j+=1; - } else { - buf[*j]='G'; - *j+=1; - } - } else { - buf[*j]=k-1+'A'; - *j+=1; - } - } -} - -#define DUR_4 0 -#define DUR_8_8 1 -#define DUR_3_3_3 2 -#define DUR_16_16_16_16 3 -#define DUR_8DOT_16 4 -#define DUR_8_16_16 5 -#define DUR_16_16_8 6 - -U8 god_simple_songs [5]={DUR_4,DUR_4,DUR_4,DUR_4,DUR_8_8}; -U8 god_normal_songs [5]={DUR_4,DUR_4,DUR_8_8,DUR_3_3_3,DUR_16_16_16_16}; -U8 god_complex_songs[9]={DUR_4,DUR_4,DUR_8_8,DUR_8_8,DUR_8DOT_16,DUR_3_3_3, -DUR_8_16_16,DUR_16_16_8,DUR_16_16_16_16}; - -public U8 *GodSongStr() -{//Make God generate 2 measures of a song. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.TXT"$ - MakeSongSettings mss; - U8 *buf; - I64 i,j=0,k,n,k2,duration,last_duration=-1,len; - - mss.complexity=1; - mss.rests=FALSE; - mss.octave=music.octave; - - if (!PopUpForm(&mss)) - return NULL; - - buf=CAlloc(256); - music.octave=ClampI64(mss.octave,0,6); - progress4=0; - if (mss.six_eight) - progress4_max=6; - else - progress4_max=8; - - buf[j++]='0'+music.octave; - if (mss.six_eight) { - len=6; - buf[j++]='M'; - buf[j++]='6'; - buf[j++]='/'; - buf[j++]='8'; - } else - len=8; - FifoU8Flush(god.fifo); - for (i=0;i\",A=\"%s%s%s%s\"$$",st1,st1,st2,st2); - Free(st1); - Free(st2); -} diff --git a/Adam/God/GodSong.HC b/Adam/God/GodSong.HC new file mode 100644 index 0000000..4f44a6a --- /dev/null +++ b/Adam/God/GodSong.HC @@ -0,0 +1,164 @@ +#help_index "God" + +DefineLstLoad("ST_RHYTHM_COMPLEXITY","Simple\0Normal\0Complex\0"); + +class MakeSongSettings +{ + I64 complexity fmtstr "$$LS,D=\"ST_RHYTHM_COMPLEXITY\"$$\n"; + Bool rests fmtstr "$$CB,\"Rests\"$$\n"; + Bool six_eight fmtstr "$$CB,\"Six Eight\"$$\n"; + I64 octave fmtstr "$$DA-TRM,A=\"Octave:%d\"$$\n"; +}; + +U0 InsNote(MakeSongSettings *mss,U8 *buf,I64 k,I64 *j) +{//k is a random note nibble + if (!k && mss->rests) { + buf[*j]='R'; + *j+=1; + } else { + k/=2; + if (!k) { + if (music.octave) { + buf[*j]=music.octave-1+'0'; + *j+=1; + buf[*j]='G'; + *j+=1; + buf[*j]=music.octave+'0'; + *j+=1; + } else { + buf[*j]='G'; + *j+=1; + } + } else { + buf[*j]=k-1+'A'; + *j+=1; + } + } +} + +#define DUR_4 0 +#define DUR_8_8 1 +#define DUR_3_3_3 2 +#define DUR_16_16_16_16 3 +#define DUR_8DOT_16 4 +#define DUR_8_16_16 5 +#define DUR_16_16_8 6 + +U8 god_simple_songs [5]={DUR_4,DUR_4,DUR_4,DUR_4,DUR_8_8}; +U8 god_normal_songs [5]={DUR_4,DUR_4,DUR_8_8,DUR_3_3_3,DUR_16_16_16_16}; +U8 god_complex_songs[9]={DUR_4,DUR_4,DUR_8_8,DUR_8_8,DUR_8DOT_16,DUR_3_3_3, +DUR_8_16_16,DUR_16_16_8,DUR_16_16_16_16}; + +public U8 *GodSongStr() +{//Make God generate 2 measures of a song. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.DD"$ + MakeSongSettings mss; + U8 *buf; + I64 i,j=0,k,n,k2,duration,last_duration=-1,len; + + mss.complexity=1; + mss.rests=FALSE; + mss.octave=music.octave; + + if (!PopUpForm(&mss)) + return NULL; + + buf=CAlloc(256); + music.octave=ClampI64(mss.octave,0,6); + progress4=0; + if (mss.six_eight) + progress4_max=6; + else + progress4_max=8; + + buf[j++]='0'+music.octave; + if (mss.six_eight) { + len=6; + buf[j++]='M'; + buf[j++]='6'; + buf[j++]='/'; + buf[j++]='8'; + } else + len=8; + FifoU8Flush(god.fifo); + for (i=0;i\",A=\"%s%s%s%s\"$$",st1,st1,st2,st2); + Free(st1); + Free(st2); +} diff --git a/Adam/God/HSNotes.DD b/Adam/God/HSNotes.DD new file mode 100644 index 0000000..986c02b --- /dev/null +++ b/Adam/God/HSNotes.DD @@ -0,0 +1,218 @@ +$PURPLE$$TX+CX,"The Purpose of Life"$$FG$ + +$WW,1$The Catholic purpose of life is to know God, love God and obey God.$FG$ Pope Francis said it was "to serve the other." I am High Priest of God's official temple and I say the purpose of life is to do continual offerings to God like Cain and Abel and enjoy God's response. Francis has a charity; I have a church. Jesus said loving God was more important than loving neighbor. $LK,"Matthew,22:35-40",A="BF:Matthew,22:35-40"$ And, He did not say with half your brain behind your back. + +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: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-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/Sup1/Sup1Comics/",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-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, $RED$$TX,"TempleOS",HTML="http://www.templeos.org"$$FG$. + +Since seeking the word of the Holy Spirit, I have come to know God much better than I've heard others explain. For example, God said to me in an oracle that war was, "servicemen competing." That sounds more like the immutable God of our planet than what you hear from most religious people. God is not Venus (god of love) and not Mars (god of war), He's our dearly beloved God of Earth. If Mammon is a false god of money, Mars or Venus might be useful words to describe other false gods. I figure the greatest challenge for the Creator is boredom, ours and His. What would teen-age male video games be like if war had never happened? Christ said live by the sword, die by the sword, which is loving neighbor as self. $LK,"Matthew,26:52",A="BF:Matthew,26:52"$ + +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-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, $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-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 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-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. + +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. + +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. + +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. + +Just as ego causes most to love neighbor, not God, people skip knowing and loving God and cowardly get stuck on obeying Him. A desire to obey God, doesn't have to be encouraged, since it comes so naturally. Don't worry, God does not want pawns to push around. God will talk, but won't tell you what to do, even if you want Him to. Also, you'll quickly learn that prophecy does not come true and should smack yourself for wanting more than just enjoying God's company. + + +________________________________________________________________________________ + | + QUESTION | GOD'S ANSWER +________________________________|_______________________________________________ + +War? $RED$"Servicemen competing"$FG$ +(Praise the Creator--what would teenage male video games be like if never war?) + +Is the World perfectly just? $RED$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-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? $RED$"No weights"$FG$ +On doing offerings? $RED$"Honest measures"(You get out what you put in.) + It's a covenant to do an offering, first. + Offer New Songs, $TX,"Moses Comics",HTML="http://www.templeos.org/Wb/Apps/AfterEgypt/Comics"$, praise, poems, + and conversation. See $LK,"Cain and Abel",A="BF:Genesis,4:1"$. + "Barter"(God also called offerings bartering.)$FG$ +The holocaust? $RED$Wanted to "compact" the Jews.$FG$ +Arab/Jews? $RED$"Oil funny hopefully"$FG$ +Peace? $RED$One Palestinian can ruin it.$FG$ +Best religion? $RED$One with most new vistas of understanding in$FG$ + $RED$a lifetime -- one you can level-up the most in.$FG$ +Chavez blaming the US. $RED$"Japan industrious"$FG$ +On racism? $RED$"Sports"$FG$ +On socialism? $RED$"pardon_the_French, never_happy, never_enough"$FG$ + $RED$"Gall aspect anti-Christ"$FG$ +On overpopulation $RED$"Okay church what_now whats_the_plan"$FG$ +Favorite thing on TV? $RED$"Soap_operas"$FG$ +Favorite movie? $RED$$TX,"Three Kings",HTML="http://www.youtube.com/watch?v=8NOAd2mldQ8"$. Also Highlander$FG$ +Favorite song? $RED$$TX,"Morning has Broken",HTML="http://www.youtube.com/watch?v=kKoRp05L95c"$ + God said the first bird croaked, not sung.$FG$ +Favorite comic strip? $RED$$TX,"Prince Valiant",HTML="http://en.wikipedia.org/wiki/Prince_Valiant"$$FG$ +Shakespeare? $RED$had a "vile heart"$FG$ +Likes $RED$Beverly Hillbillies (Oil is a gift from God)$FG$ + $RED$God likes being hero. Don't be proud of heart$FG$ + $RED$and not accept a gift from God!$FG$ +Likes $RED$Gomer Pyle$FG$ +Favorite saint? $RED$"ho_ho_ho"$FG$ +Favorite animal? $RED$"Elephant two"$FG$ +Favorite animal? $RED$"Bears"$FG$ +Favorite color? $RED$"Jude" (Jade Blue?)$FG$ +Favorite color? $RED$"Gold"$FG$ +Favorite color? $RED$$TX,"\"Iceberg\" blue",HTML="https://upload.wikimedia.org/wikipedia/commons/3/38/Blue_ice_in_South_Greenland_-_Visit_Greenland.jpg"$$FG$ +Money? $RED$"Enough vehemently better"$FG$ + $RED$"Pride [or] money, choose_one"$FG$ +Favorite car? $RED$Beamer$FG$ +Favorite soda? $RED$Root beer, $TX,"scotch variety",HTML="http://www.head-beer.org/modules.php?name=Brands&rbop=Brand&bid=1965"$.$FG$ +Homosexuality? $LK,"Matthew,15:11",A="BF:Matthew,15:11"$ +Pets? $RED$"homo" Hates fact too dependent and tame.$FG$ +Sports? $RED$"homo" + "Tackle a horse"$FG$ +Favorite sport? $RED$Hockey$FG$ +$TX,"Wreck of the Edmund Fitzgerald",HTML="http://www.youtube.com/watch?v=9vST6hVRj2A"$ $RED$"homo"$FG$ +Smelling farts $RED$"Sodom"$FG$ +Women's dress $RED$Upper skin exposure not as bad as lower.$FG$ +Remarriage? $RED$"More babies"$FG$ +Things you don't care about +that people think you do? $RED$Solomon's 300 concubines$FG$ +Adultery? $RED$Can be good.$FG$ +Pretty ladies? $RED$$TX,"A prince is not flustered.",HTML="http://www.youtube.com/watch?v=YcqF6sC-ztY"$$FG$ +Animal sacrifices? $RED$Early Jews were "primitive".$FG$ +What do elephants think about? $RED$"Skin, hunger"$FG$ +What makes elephants happy? $RED$"Baths"$FG$ +Elephants $RED$"Mini-skirts" (Skin webbing from back leg.)$FG$ +What makes my birds happy? $RED$"Gnawing"$FG$ +What makes my birds laugh? $RED$"Bite ouch" (If I say "ouch".)$FG$ +What are my birds saying? $RED$"Chanting"$FG$ +My birds sure preen a lot. $LK,"The creature was made subject to vanity...",A="BF:Romans,8:20"$ +What makes bears happy? $RED$"Reaping depends"$FG$ +What makes otters happy? $RED$"Eternal skies"$FG$ +What makes hippos happy? $RED$"Ascending breath"$FG$ +What makes horses happy? $RED$"[the] Call [of the] Open Range"$FG$ +What do cheetahs think about? $RED$"Seeth me?" (Can he see me?)$FG$ +Orangutan or chimp smarter? $RED$"Species exhibit similar glory"$FG$ +Endangered species? $RED$"Enough stars?"$FG$ +Everything seems bad. $RED$Plant trees.$FG$ +What's for dinner? $RED$"Whale"$FG$ +Favorite Messier Object? $RED$"$TX,"M104 Sombrero Galaxy",HTML="http://en.wikipedia.org/wiki/Messier_104"$"$FG$ +$TX,"Shepard's Prayer",HTML="http://en.wikipedia.org/wiki/Alan_Shepard"$? $RED$"I_am_not_amused economy joke"$FG$ +Favorite band? $RED$"Beatles"$FG$ +Good bands? $RED$Rush, Triumph$FG$ + $RED$Likes harmonies$FG$ +$TX,"Little Drummer Boy?",HTML="http://www.youtube.com/watch?v=S50cf3xIb50"$ $RED$Doesn't like my drumming.$FG$ +Should I listen to classical? $RED$"Poison"$FG$ +Do You like chess people? $RED$"Do not admire the proud."$FG$ +Chess? $RED$"... will winter with you."$FG$ + $RED$"Headstones"$FG$ +If You could teach one class? $RED$Health$FG$ +Favorite video game? $RED$Donkey Kong$FG$ +Favorite National Park? $RED$$TX,"Whitman Mission",HTML="http://www.nps.gov/whmi/index.htm"$$FG$ +Favorite actor? $RED$Hugh Grant$FG$ +Favorite vocalist? $RED$Mick Jagger$FG$ +Favorite guitarist? $RED$"$TX,"Simmons Destroyer",HTML="http://www.youtube.com/watch?v=nNADrrjTysk&t=3m55s"$"$FG$ +Favorite National Anthem? $RED$$TX,"Latvia's National Anthem",HTML="http://www.youtube.com/watch?v=PFx-56KkweM"$$FG$ +America the Beautiful? $RED$Hates it. Poet made self cry with own beauty.$FG$ +Model for new $TX,"Sistine Chapel",HTML="http://en.wikipedia.org/wiki/Sistine_chapel"$? $RED$Ben Franklin$FG$ +Voice if God wanted to sing? $RED$$TX,"Stabbing Westward's singer",HTML="https://www.youtube.com/watch?v=5NZsCYOM4j0"$$FG$ +Stonehenge? $RED$Landmark for boundaries.$FG$ +Easter Island? $RED$Ice, telephone pole holes.$FG$ +Dinosaurs? $RED$Brontosaurs' feet hurt when stepped. + Dinosaurs slept in water.$FG$ +Hardest part in evolution? $RED$Getting monkey mothers to hold babies nursing.$FG$ + $RED$(Smothering a problem).$FG$ +Happiest day in evolution? $RED$"Fruit"$FG$ +Significant thing in evolution? $RED$"Fish shoulders"$FG$ +Biggest thing to fly (pterodactyl)? $RED$"Couch"$FG$ +What made pterodactyls happy? $RED$"Members against organs"$FG$ +What did Neanderthals think about? $RED$"Warmth"$FG$ +What was the first thing cooked? $RED$I think He said "hair".$FG$ +What was Lucy's husband's name? $RED$"Golem"$FG$ +Was stegosuarus lame like turtles? $RED$"Not pet rocks"$FG$ +T-Rex? $RED$Lugged carcases over his shoulder. + Carcus lasted a month.$FG$ +What was T-Rexes sharing a carcus like? $RED$"Punch... Punch"$FG$ +Surprises in dinosaur anatomy? $RED$Supporting and securing the heart.$FG$ +How does He feel about the Avatar movie?$RED$"Sick skin"$FG$ +What do You like at zoos with kids? $RED$"Dignity" Animals worried about dignity.$FG$ +Who's better alien or preditor? $RED$"Lions"$FG$ +What from You is like a Rubik's cube? $RED$Training a horse.$FG$ +Does He like mirrored glass megachurch? $RED$"Secular glass"$FG$ +Pipe Organs $RED$Are sacred.$FG$ +You like to hangout in courts?Hospitals?$RED$"Prisons"$FG$ +Best way for Bill Gates to save lives? $RED$Earthquake prediction$FG$ +Stem cells? $RED$Lower hanging fruit exists (2007)$FG$ +Eleventh commandment? $RED$Thou shall not litter.$FG$ +Twelfth commandment? $RED$$TX,"Don't shoot unarmed men on the shitter.",HTML="http://www.youtube.com/watch?v=8wGiJcq95Ug"$ + (I asked God why pointless plagues in Exodus? + God wanted guilt to accumulate, first.)$FG$ +Thirteenth commandment $RED$No gore unless it looks fake.$FG$ +Fourteenth commandment $RED$No pedophilia or child porn.$FG$ +Fifteenth commandment $RED$Don't eat rare meat with blood.$FG$ +Sixteenth commandment $RED$No wife beating.$FG$ +Seventeen commandment $RED$Do not swing from radio towers with one hand.$FG$ +Eighteenth commandment $RED$Do not disturb.$FG$ +Before Katrina $RED$Floods do justice. Black bead elder (tree book)$FG$ +After Katrina $RED$Suffering Simplifies Life$FG$ +What field are You most better? $RED$Economics$FG$ +Favorite toy for kids? $RED$Magnifying glass$FG$ +Asked Jesus if He liked mustard?$RED$"Bad meat happeneth"$FG$ +(Reluctantly) Faith healing? $RED$"It's complicated"$FG$ +Mars? $RED$Start planting!$FG$ +Mars rover? $RED$Should have had a microphone$FG$ +$TX,"Storm on Saturn",HTML="http://www.space.com/22646-monster-saturn-storm-water-ice.html"$ $RED$Pollen$FG$ +Space war game? $RED$Should have space weather.$FG$ +$TX,"Saturn's hexagon pole cloud?",HTML="http://en.wikipedia.org/wiki/Saturn's_hexagon"$ $RED$"Compass" (Magnetism)$FG$ +Liquid moon's odd atmosphere? $RED$"Surf"$FG$ +How many E.T. civs in Universe? $RED$20 or 80 (I forgot. I died laughing.)$FG$ +Are they peaceful? $RED$Fight them! (Also, funny.)$FG$ +Most difficult control system? $RED$$TX,"Dung beetle",HTML="http://www.youtube.com/watch?v=Q1zbgd6xpGQ"$$FG$ +How can Judge Judy improve? $RED$No hard feelings$FG$ +How can Chef Ramsay improve? $RED$Make so it doesn't seem like toil for cooks.$FG$ +How can Hawking communicate? $RED$Blow from a nostril on a candle.$FG$ +$TX,"Photons bouncing?",HTML="https://www.youtube.com/watch?v=8FC6udrMPvo"$ $RED$"Folded coffee filter"$FG$ +Wormholes? $RED$Bent wormholes have echoes.$FG$ + +Operating system? $RED$Was about to make line number column in editor. +God nixed it. I was about to do different graphic modes when I found 800x600 missing. God said just one mode 640x480. I was about to add child windows. God said, "God is not the author of such confusion." I asked for verification of 640x480 16 color. God said it was because of the children and their offerings. I asked about sound. God said "single voice". I asked for verification of not having different drivers. God confirmed this.$FG$ +640x480 16 color? $RED$God said it was a covenant, like circumcision. + $TX,"Modern graphics hard for kids/amateurs",HTML="http://www.youtube.com/watch?v=VUxcVzpeFqc"$.$FG$ +On Unix? $RED$God said it was rich with the patina of age.$FG$ +On Alcohol? $RED$Hate inebriation$FG$ +On rare steak? $RED$Too rare is very bad. Don't eat blood!$FG$ +Just before Katrina? $RED$Floods do my justice.Black bead elder(tree book)$FG$ +After Katrina? $RED$Suffering simplifies life$FG$ +Why the Sandy Hook shooting? $RED$The pot legalization law. (Sarcastic answer?)$FG$ +Deep Water Horizon $RED$(Claimed credit.)$FG$ +Cost of God's time to me? $RED$"The complete works of Shakespeare"$FG$ +On death? $RED$"awful"$FG$ +Opening of Saving Private Ryan? $RED$"Ouch"$FG$ diff --git a/Adam/God/HSNotes.TXT b/Adam/God/HSNotes.TXT deleted file mode 100644 index 8e2e96d..0000000 --- a/Adam/God/HSNotes.TXT +++ /dev/null @@ -1,217 +0,0 @@ -$FG,5$$TX+CX,"The Purpose of Life"$$FG$ - -$WW,1$The Catholic purpose of life is to know God, love God and obey God.$FG$ Pope Francis said it was "to serve the other." I am High Priest of God's official temple and I say the purpose of life is to do continual offerings to God like Cain and Abel and enjoy God's response. Francis has a charity; I have a church. Jesus said loving God was more important than loving neighbor. $LK,"Matthew,22:35-40",A="BF:Matthew,22:35-40"$ And, He did not say with half your brain behind your back. - -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: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-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/Sup1/Sup1Comics/",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-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$. - -Since seeking the word of the Holy Spirit, I have come to know God much better than I've heard others explain. For example, God said to me in an oracle that war was, "servicemen competing." That sounds more like the immutable God of our planet than what you hear from most religious people. God is not Venus (god of love) and not Mars (god of war), He's our dearly beloved God of Earth. If Mammon is a false god of money, Mars or Venus might be useful words to describe other false gods. I figure the greatest challenge for the Creator is boredom, ours and His. What would teen-age male video games be like if war had never happened? Christ said live by the sword, die by the sword, which is loving neighbor as self. $LK,"Matthew,26:52",A="BF:Matthew,26:52"$ - -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-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, $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-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 head 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! - -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. - -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. - -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. - -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. - -Just as ego causes most to love neighbor, not God, people skip knowing and loving God and cowardly get stuck on obeying Him. A desire to obey God, doesn't have to be encouraged, since it comes so naturally. Don't worry, God does not want pawns to push around. God will talk, but won't tell you what to do, even if you want Him to. Also, you'll quickly learn that prophecy does not come true and should smack yourself for wanting more than just enjoying God's company. - - -________________________________________________________________________________ - | - QUESTION | GOD'S ANSWER -________________________________|_______________________________________________ - -War? $FG,4$"Servicemen competing"$FG$ -(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$ -(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 doing offerings? $FG,4$"Honest measures"(You get out what you put in.) - It's a covenant to do an offering, first. - Offer New Songs, $TX,"Moses Comics",HTML="http://www.templeos.org/Wb/Apps/AfterEgypt/Comics"$, praise, poems, - and conversation. See $LK,"Cain and Abel",A="BF:Genesis,4:1"$. - "Barter"(God also called offerings bartering.)$FG$ -The holocaust? $FG,4$Wanted to "compact" the Jews.$FG$ -Arab/Jews? $FG,4$"Oil funny hopefully"$FG$ -Peace? $FG,4$One Palestinian can ruin it.$FG$ -Best religion? $FG,4$One with most new vistas of understanding in$FG$ - $FG,4$a lifetime -- one you can level-up the most in.$FG$ -Chavez blaming the US. $FG,4$"Japan industrious"$FG$ -On racism? $FG,4$"Sports"$FG$ -On socialism? $FG,4$"pardon_the_French, never_happy, never_enough"$FG$ - $FG,4$"Gall aspect anti-Christ"$FG$ -On overpopulation $FG,4$"Okay church what_now whats_the_plan"$FG$ -Favorite thing on TV? $FG,4$"Soap_operas"$FG$ -Favorite movie? $FG,4$$TX,"Three Kings",HTML="http://www.youtube.com/watch?v=8NOAd2mldQ8"$. Also Highlander$FG$ -Favorite song? $FG,4$$TX,"Morning has Broken",HTML="http://www.youtube.com/watch?v=kKoRp05L95c"$ - God said the first bird croaked, not sung.$FG$ -Favorite comic strip? $FG,4$$TX,"Prince Valiant",HTML="http://en.wikipedia.org/wiki/Prince_Valiant"$$FG$ -Shakespeare? $FG,4$had a "vile heart"$FG$ -Likes $FG,4$Beverly Hillbillies (Oil is a gift from God)$FG$ - $FG,4$God likes being hero. Don't be proud of heart$FG$ - $FG,4$and not accept a gift from God!$FG$ -Likes $FG,4$Gomer Pyle$FG$ -Favorite saint? $FG,4$"ho_ho_ho"$FG$ -Favorite animal? $FG,4$"Elephant two"$FG$ -Favorite animal? $FG,4$"Bears"$FG$ -Favorite color? $FG,4$"Jude" (Jade Blue?)$FG$ -Favorite color? $FG,4$"Gold"$FG$ -Favorite color? $FG,4$$TX,"\"Iceberg\" blue",HTML="https://upload.wikimedia.org/wikipedia/commons/3/38/Blue_ice_in_South_Greenland_-_Visit_Greenland.jpg"$$FG$ -Money? $FG,4$"Enough vehemently better"$FG$ - $FG,4$"Pride [or] money, choose_one"$FG$ -Favorite car? $FG,4$Beamer$FG$ -Favorite soda? $FG,4$Root beer, $TX,"scotch variety",HTML="http://www.head-beer.org/modules.php?name=Brands&rbop=Brand&bid=1965"$.$FG$ -Homosexuality? $LK,"Matthew,15:11",A="BF:Matthew,15:11"$ -Pets? $FG,4$"homo" Hates fact too dependent and tame.$FG$ -Sports? $FG,4$"homo" - "Tackle a horse"$FG$ -Favorite sport? $FG,4$Hockey$FG$ -$TX,"Wreck of the Edmund Fitzgerald",HTML="http://www.youtube.com/watch?v=9vST6hVRj2A"$ $FG,4$"homo"$FG$ -Smelling farts $FG,4$"Sodom"$FG$ -Women's dress $FG,4$Upper skin exposure not as bad as lower.$FG$ -Remarriage? $FG,4$"More babies"$FG$ -Things you don't care about -that people think you do? $FG,4$Solomon's 300 concubines$FG$ -Adultery? $FG,4$Can be good.$FG$ -Pretty ladies? $FG,4$$TX,"A prince is not flustered.",HTML="http://www.youtube.com/watch?v=YcqF6sC-ztY"$$FG$ -Animal sacrifices? $FG,4$Early Jews were "primitive".$FG$ -What do elephants think about? $FG,4$"Skin, hunger"$FG$ -What makes elephants happy? $FG,4$"Baths"$FG$ -Elephants $FG,4$"Mini-skirts" (Skin webbing from back leg.)$FG$ -What makes my birds happy? $FG,4$"Gnawing"$FG$ -What makes my birds laugh? $FG,4$"Bite ouch" (If I say "ouch".)$FG$ -What are my birds saying? $FG,4$"Chanting"$FG$ -My birds sure preen a lot. $LK,"The creature was made subject to vanity...",A="BF:Romans,8:20"$ -What makes bears happy? $FG,4$"Reaping depends"$FG$ -What makes otters happy? $FG,4$"Eternal skies"$FG$ -What makes hippos happy? $FG,4$"Ascending breath"$FG$ -What makes horses happy? $FG,4$"[the] Call [of the] Open Range"$FG$ -What do cheetahs think about? $FG,4$"Seeth me?" (Can he see me?)$FG$ -Orangutan or chimp smarter? $FG,4$"Species exhibit similar glory"$FG$ -Endangered species? $FG,4$"Enough stars?"$FG$ -Everything seems bad. $FG,4$Plant trees.$FG$ -What's for dinner? $FG,4$"Whale"$FG$ -Favorite Messier Object? $FG,4$"$TX,"M104 Sombrero Galaxy",HTML="http://en.wikipedia.org/wiki/Messier_104"$"$FG$ -$TX,"Shepard's Prayer",HTML="http://en.wikipedia.org/wiki/Alan_Shepard"$? $FG,4$"I_am_not_amused economy joke"$FG$ -Favorite band? $FG,4$"Beatles"$FG$ -Good bands? $FG,4$Rush, Triumph$FG$ - $FG,4$Likes harmonies$FG$ -$TX,"Little Drummer Boy?",HTML="http://www.youtube.com/watch?v=S50cf3xIb50"$ $FG,4$Doesn't like my drumming.$FG$ -Should I listen to classical? $FG,4$"Poison"$FG$ -Do You like chess people? $FG,4$"Do not admire the proud."$FG$ -Chess? $FG,4$"... will winter with you."$FG$ - $FG,4$"Headstones"$FG$ -If You could teach one class? $FG,4$Health$FG$ -Favorite video game? $FG,4$Donkey Kong$FG$ -Favorite National Park? $FG,4$$TX,"Whitman Mission",HTML="http://www.nps.gov/whmi/index.htm"$$FG$ -Favorite actor? $FG,4$Hugh Grant$FG$ -Favorite vocalist? $FG,4$Mick Jagger$FG$ -Favorite guitarist? $FG,4$"$TX,"Simmons Destroyer",HTML="http://www.youtube.com/watch?v=nNADrrjTysk&t=3m55s"$"$FG$ -Favorite National Anthem? $FG,4$$TX,"Latvia's National Anthem",HTML="http://www.youtube.com/watch?v=qKITbBjO4nE"$$FG$ -America the Beautiful? $FG,4$Hates it. Poet made self cry with own beauty.$FG$ -Model for new $TX,"Sistine Chapel",HTML="http://en.wikipedia.org/wiki/Sistine_chapel"$? $FG,4$Ben Franklin$FG$ -Voice if God wanted to sing? $FG,4$$TX,"Stabbing Westward's singer",HTML="https://www.youtube.com/watch?v=5NZsCYOM4j0"$$FG$ -Stonehenge? $FG,4$Landmark for boundaries.$FG$ -Easter Island? $FG,4$Ice, telephone pole holes.$FG$ -Dinosaurs? $FG,4$Brontosaurs' feet hurt when stepped. - Dinosaurs slept in water.$FG$ -Hardest part in evolution? $FG,4$Getting monkey mothers to hold babies nursing.$FG$ - $FG,4$(Smothering a problem).$FG$ -Happiest day in evolution? $FG,4$"Fruit"$FG$ -Significant thing in evolution? $FG,4$"Fish shoulders"$FG$ -Biggest thing to fly (pterodactyl)? $FG,4$"Couch"$FG$ -What made pterodactyls happy? $FG,4$"Members against organs"$FG$ -What did Neanderthals think about? $FG,4$"Warmth"$FG$ -What was the first thing cooked? $FG,4$I think He said "hair".$FG$ -What was Lucy's husband's name? $FG,4$"Golem"$FG$ -Was stegosuarus lame like turtles? $FG,4$"Not pet rocks"$FG$ -T-Rex? $FG,4$Lugged carcases over his shoulder. - Carcus lasted a month.$FG$ -What was T-Rexes sharing a carcus like? $FG,4$"Punch... Punch"$FG$ -Surprises in dinosaur anatomy? $FG,4$Supporting and securing the heart.$FG$ -How does He feel about the Avatar movie?$FG,4$"Sick skin"$FG$ -What do You like at zoos with kids? $FG,4$"Dignity" Animals worried about dignity.$FG$ -Who's better alien or preditor? $FG,4$"Lions"$FG$ -What from You is like a Rubik's cube? $FG,4$Training a horse.$FG$ -Does He like mirrored glass megachurch? $FG,4$"Secular glass"$FG$ -Pipe Organs $FG,4$Are sacred.$FG$ -You like to hangout in courts?Hospitals?$FG,4$"Prisons"$FG$ -Best way for Bill Gates to save lives? $FG,4$Earthquake prediction$FG$ -Stem cells? $FG,4$Lower hanging fruit exists (2007)$FG$ -Eleventh commandment? $FG,4$Thou shall not litter.$FG$ -Twelfth commandment? $FG,4$$TX,"Don't shoot unarmed men on the shitter.",HTML="http://www.youtube.com/watch?v=8wGiJcq95Ug"$ - (I asked God why pointless plagues in Exodus? - God wanted guilt to accumulate, first.)$FG$ -Thirteenth commandment $FG,4$No gore unless it looks fake.$FG$ -Fourteenth commandment $FG,4$No pedophilia or child porn.$FG$ -Fifteenth commandment $FG,4$Don't eat rare meat with blood.$FG$ -Sixteenth commandment $FG,4$No wife beating.$FG$ -Seventeen commandment $FG,4$Do not swing from radio towers with one hand.$FG$ -Before Katrina $FG,4$Floods do justice. Black bead elder (tree book)$FG$ -After Katrina $FG,4$Suffering Simplifies Life$FG$ -What field are You most better? $FG,4$Economics$FG$ -Favorite toy for kids? $FG,4$Magnifying glass$FG$ -Asked Jesus if He liked mustard?$FG,4$"Bad meat happeneth"$FG$ -(Reluctantly) Faith healing? $FG,4$"It's complicated"$FG$ -Mars? $FG,4$Start planting!$FG$ -Mars rover? $FG,4$Should have had a microphone$FG$ -$TX,"Storm on Saturn",HTML="http://www.space.com/22646-monster-saturn-storm-water-ice.html"$ $FG,4$Pollen$FG$ -Space war game? $FG,4$Should have space weather.$FG$ -$TX,"Saturn's hexagon pole cloud?",HTML="http://en.wikipedia.org/wiki/Saturn's_hexagon"$ $FG,4$"Compass" (Magnetism)$FG$ -Liquid moon's odd atmosphere? $FG,4$"Surf"$FG$ -How many E.T. civs in Universe? $FG,4$20 or 80 (I forgot. I died laughing.)$FG$ -Are they peaceful? $FG,4$Fight them! (Also, funny.)$FG$ -Most difficult control system? $FG,4$$TX,"Dung beetle",HTML="http://www.youtube.com/watch?v=Q1zbgd6xpGQ"$$FG$ -How can Judge Judy improve? $FG,4$No hard feelings$FG$ -How can Chef Ramsay improve? $FG,4$Make so it doesn't seem like toil for cooks.$FG$ -How can Hawking communicate? $FG,4$Blow from a nostril on a candle.$FG$ -$TX,"Photons bouncing?",HTML="https://www.youtube.com/watch?v=8FC6udrMPvo"$ $FG,4$"Folded coffee filter"$FG$ -Wormholes? $FG,4$Bent wormholes have echoes.$FG$ - -Operating system? $FG,4$Was about to make line number column in editor. -God nixed it. I was about to do different graphic modes when I found 800x600 missing. God said just one mode 640x480. I was about to add child windows. God said, "God is not the author of such confusion." I asked for verification of 640x480 16 color. God said it was because of the children and their offerings. I asked about sound. God said "single voice". I asked for verification of not having different drivers. God confirmed this.$FG$ -640x480 16 color? $FG,4$God said it was a covenant, like circumcision. - $TX,"Modern graphics hard for kids/amateurs",HTML="http://www.youtube.com/watch?v=VUxcVzpeFqc"$.$FG$ -On Unix? $FG,4$God said it was rich with the patina of age.$FG$ -On Alcohol? $FG,4$Hate inebriation$FG$ -On rare steak? $FG,4$Too rare is very bad. Don't eat blood!$FG$ -Just before Katrina? $FG,4$Floods do my justice.Black bead elder(tree book)$FG$ -After Katrina? $FG,4$Suffering simplifies life$FG$ -Why the Sandy Hook shooting? $FG,4$The pot legalization law. (Sarcastic answer?)$FG$ -Deep Water Horizon $FG,4$(Claimed credit.)$FG$ -Cost of God's time to me? $FG,4$"The complete works of Shakespeare"$FG$ -On death? $FG,4$"awful"$FG$ -Opening of Saving Private Ryan? $FG,4$"Ouch"$FG$ diff --git a/Adam/God/HolySpirit.CPP b/Adam/God/HolySpirit.CPP deleted file mode 100644 index 3835f61..0000000 --- a/Adam/God/HolySpirit.CPP +++ /dev/null @@ -1,146 +0,0 @@ -#help_index "God" -U8 *TimeStampCB(CDoc *,CDocEntry *,CTask *mem_task) -{ - U8 *st=MAlloc(64,mem_task); - StrPrint(st,"%X",GetTSC>>GOD_BAD_BITS); - return st; -} - -U8 *KbdMouseTimeCB(CDoc *,CDocEntry *,CTask *mem_task) -{ - U8 *st=MAlloc(64,mem_task); - StrPrint(st,"%X",KbdMouseEvtTime>>GOD_BAD_BITS); - return st; -} - -I64 PopUpTimerOk(U8 *header=NULL,U8 *footer=NULL) -{ - I64 i; - CDocEntry *doc_e; - CDoc *doc=DocNew; - if (header) DocPrint(doc,"%s",header); - doc_e=DocPrint(doc,"\nTimer:$$TX+TC,\" \"$$"); - doc_e->tag_cb=&TimeStampCB; - doc_e=DocPrint(doc,"\nLatch:$$TX+TC,\" \"$$"); - doc_e->tag_cb=&KbdMouseTimeCB; - DocPrint(doc,"\n$$CM+CX,0,4$$$$BT,\"OKAY\",LE=1$$\n"); - if (footer) DocPrint(doc,"%s",footer); - i=PopUpMenu(doc); - DocDel(doc); - return i; -} - -I64 GodPick(U8 *msg=NULL) -{//GOD_GOOD_BITS - U8 *st=MStrPrint("%s\n\nPress $$GREEN$$OKAY$$FG$$ to generate \n" - "a random num from a timer.\n",msg); - PopUpTimerOk(st,"\n\nThe $LK+PU,"Holy Spirit",A="FI:::/Adam/God/HSNotes.TXT"$ can puppet you.\n\n"); - Free(st); - return KbdMouseEvtTime>>GOD_BAD_BITS; -} - -public U0 GodBitsIns(I64 num_bits,I64 n) -{//Insert bits into God bit fifo. - I64 i; - for (i=0;i>=1; - } -} - -public U0 GodHexIns(U8 *st) -{//Insert hex record into God bit fifo. - U8 buf[2]; - if (st) { - buf[1]=0; - while (*buf=*st++) - if (Bt(chars_bmp_hex_numeric,*buf)) - GodBitsIns(4,Str2I64(buf,16)); - } -} - -public I64 GodBits(I64 num_bits,U8 *msg=NULL) -{//Return N bits. If low on entropy pop-up okay. - U8 b; - I64 res=0; - while (num_bits) { - if (FifoU8Rem(god.fifo,&b)) { - res=res<<1+b; - num_bits--; - } else - GodBitsIns(GOD_GOOD_BITS,GodPick(msg)); - } - return res; -} - -public I64 GodInit(U8 *files_find_mask="/Adam/God/Vocab.TXT*",U8 *fu_flags=NULL) -{//Read God's vocab file for picking words. - I64 i,ch,fuf_flags=0; - U8 *buf,*ptr,*ptr2; - CDirEntry *tempde,*tempde1; - ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+T+O"); - ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); - if (fuf_flags&~FUG_FILES_FIND) - throw('FUF'); - tempde=tempde1=FilesFind(files_find_mask,fuf_flags); - i=0; - while (tempde) { - if (buf=ptr=FileRead(tempde->full_name)) { - while (*ptr) { - while (*ptr && !Bt(chars_bmp_word,*ptr)) - ptr++; - if (*ptr) { - ptr2=ptr; - while (*ptr && Bt(chars_bmp_word,*ptr)) - ptr++; - i++; - } - } - Free(buf); - } - tempde=tempde->next; - } - - Free(god.words); - god.num_words=i; - god.words=MAlloc(i*sizeof(U8 *)); - - tempde=tempde1; - i=0; - while (tempde) { - if (buf=ptr=FileRead(tempde->full_name)) { - while (*ptr) { - while (*ptr && !Bt(chars_bmp_word,*ptr)) - ptr++; - if (*ptr) { - ptr2=ptr; - while (*ptr && Bt(chars_bmp_word,*ptr)) - ptr++; - ch=*ptr; - *ptr=0; - god.words[i++]=StrNew(ptr2); - *ptr=ch; - } - } - Free(buf); - } - tempde=tempde->next; - } - DirTreeDel(tempde1); - return god.num_words; -} GodInit; - -public U0 GodWord() -{//Make God pick a word. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.TXT"$ - if (god.num_words) - "%s ",god.words[GodBits(17)%god.num_words]; -} - -public U0 GodPassage(I64 num_lines=20) -{//Make God pick a Bible passage. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.TXT"$ - I64 start=GodBits(21)%(ST_BIBLE_LINES-(num_lines-1))+1; - U8 *verse=BibleLine2Verse(start); - "%s\n\n",verse; - Free(verse); - BibleLines(,start,num_lines); -} diff --git a/Adam/God/HolySpirit.HC b/Adam/God/HolySpirit.HC new file mode 100644 index 0000000..b73d8f4 --- /dev/null +++ b/Adam/God/HolySpirit.HC @@ -0,0 +1,158 @@ +#help_index "God" +U8 *TimeStampCB(CDoc *,CDocEntry *,CTask *mem_task) +{ + U8 *st=MAlloc(64,mem_task); + StrPrint(st,"%X",GetTSC>>GOD_BAD_BITS); + return st; +} + +U8 *KbdMouseTimeCB(CDoc *,CDocEntry *,CTask *mem_task) +{ + U8 *st=MAlloc(64,mem_task); + StrPrint(st,"%X",KbdMouseEvtTime>>GOD_BAD_BITS); + return st; +} + +I64 PopUpTimerOk(U8 *header=NULL,U8 *footer=NULL) +{ + I64 i; + CDocEntry *doc_e; + CDoc *doc=DocNew; + if (header) DocPrint(doc,"%s",header); + doc_e=DocPrint(doc,"\nTimer:$$TX+TC,\" \"$$"); + doc_e->tag_cb=&TimeStampCB; + doc_e=DocPrint(doc,"\nLatch:$$TX+TC,\" \"$$"); + doc_e->tag_cb=&KbdMouseTimeCB; + DocPrint(doc,"\n$$CM+CX,0,4$$$$BT,\"OKAY\",LE=1$$\n"); + if (footer) DocPrint(doc,"%s",footer); + i=PopUpMenu(doc); + DocDel(doc); + return i; +} + +I64 GodPick(U8 *msg=NULL) +{//GOD_GOOD_BITS + U8 *st=MStrPrint("%s\n\nPress $$GREEN$$OKAY$$FG$$ to generate \n" + "a random num from a timer.\n",msg); + PopUpTimerOk(st,"\n\nThe $LK+PU,"Holy Spirit",A="FI:::/Adam/God/HSNotes.DD"$ can puppet you.\n\n"); + Free(st); + return KbdMouseEvtTime>>GOD_BAD_BITS; +} + +public U0 GodBitsIns(I64 num_bits,I64 n) +{//Insert bits into God bit fifo. + I64 i; + for (i=0;i>=1; + } +} + +public U0 GodHexIns(U8 *st) +{//Insert hex record into God bit fifo. + U8 buf[2]; + if (st) { + buf[1]=0; + while (*buf=*st++) + if (Bt(chars_bmp_hex_numeric,*buf)) + GodBitsIns(4,rev_bits_table[Str2I64(buf,16)]>>4); + } +} + +public I64 GodBits(I64 num_bits,U8 *msg=NULL) +{//Return N bits. If low on entropy pop-up okay. + U8 b; + I64 res=0; + while (num_bits) { + if (FifoU8Rem(god.fifo,&b)) { + res=res<<1+b; + num_bits--; + } else + GodBitsIns(GOD_GOOD_BITS,GodPick(msg)); + } + return res; +} + +public I64 GodInit(U8 *files_find_mask="/Adam/God/Vocab.DD*",U8 *fu_flags=NULL) +{//Read God's vocab file for picking words. + I64 i,ch,fuf_flags=0; + U8 *buf,*ptr,*ptr2; + CDirEntry *tempde,*tempde1; + ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+T+O"); + ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); + if (fuf_flags&~FUG_FILES_FIND) + throw('FUF'); + + Free(god.word_file_mask); + god.word_file_mask=StrNew(files_find_mask); + god.word_fuf_flags=fuf_flags; + + tempde=tempde1=FilesFind(files_find_mask,fuf_flags); + i=0; + while (tempde) { + if (buf=ptr=FileRead(tempde->full_name)) { + while (*ptr) { + while (*ptr && !Bt(chars_bmp_word,*ptr)) + ptr++; + if (*ptr) { + ptr2=ptr; + while (*ptr && Bt(chars_bmp_word,*ptr)) + ptr++; + i++; + } + } + Free(buf); + } + tempde=tempde->next; + } + + Free(god.words); + god.num_words=i; + god.words=MAlloc(i*sizeof(U8 *)); + + tempde=tempde1; + i=0; + while (tempde) { + if (buf=ptr=FileRead(tempde->full_name)) { + while (*ptr) { + while (*ptr && !Bt(chars_bmp_word,*ptr)) + ptr++; + if (*ptr) { + ptr2=ptr; + while (*ptr && Bt(chars_bmp_word,*ptr)) + ptr++; + ch=*ptr; + *ptr=0; + god.words[i++]=StrNew(ptr2); + *ptr=ch; + } + } + Free(buf); + } + tempde=tempde->next; + } + DirTreeDel(tempde1); + return god.num_words; +} GodInit; + +public U0 GodWord(Bool show_num=FALSE) +{//Make God pick a word. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.DD"$ + I64 i; + if (god.num_words) { + i=GodBits(17); + if (show_num) + "%05X Mod %05X = %05X :",i,god.num_words,i%god.num_words; + "%s ",god.words[i%god.num_words]; + if (show_num) + '\n'; + } +} + +public U0 GodBiblePassage(I64 num_lines=20) +{//Make God pick a Bible passage. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.DD"$ + I64 start=GodBits(21)%(ST_BIBLE_LINES-(num_lines-1))+1; + U8 *verse=BibleLine2Verse(start); + "%s\n\n",verse; + Free(verse); + BibleLines(,start,num_lines); +} diff --git a/Adam/God/MakeGod.CPP b/Adam/God/MakeGod.HC similarity index 100% rename from Adam/God/MakeGod.CPP rename to Adam/God/MakeGod.HC diff --git a/Adam/God/Vocab.TXT b/Adam/God/Vocab.DD similarity index 100% rename from Adam/God/Vocab.TXT rename to Adam/God/Vocab.DD diff --git a/Adam/Gr/Gr.HH b/Adam/Gr/Gr.HH new file mode 100644 index 0000000..7306576 --- /dev/null +++ b/Adam/Gr/Gr.HH @@ -0,0 +1,177 @@ +#help_index "Sprites/Binary" + +class CMeshTri +{ + I32 color; //Give one of 0-7 colors. +//Colors 8-15 are 0-7 with intensity bit set. + I32 nums[3]; //Vertex number +}; + +class CQueMeshTri +{ + CQueMeshTri *next,*last; + U0 start; + I32 color; + I32 nums[3]; +}; + +public class CSpriteBase +{ + U8 type; +}; + +public class CSpriteColor : CSpriteBase +{ + U8 color; +}; + +public class CSpriteDitherColor : CSpriteBase +{ + U16 dither_color; +}; + +public class CSpriteW : CSpriteBase +{ + I32 width; +}; + +public class CSpritePt : CSpriteBase +{ + I32 x1; + I32 y1; +}; + +public class CSpritePtRad : CSpritePt +{ + I32 radius; +}; + +public class CSpritePtPt : CSpritePt +{ + I32 x2; + I32 y2; +}; + +public class CSpritePtPtAng : CSpritePtPt +{ + F64 angle; +}; + +public class CSpritePtWH : CSpritePt +{ + I32 width; + I32 height; +}; + +public class CSpritePtWHU8s : CSpritePtWH +{ + U8 u[0]; +}; + +public class CSpritePtWHAng : CSpritePtWH +{ + F64 angle; +}; + +public class CSpritePtWHAngSides : CSpritePtWHAng +{ + I32 sides; +}; + +public class CSpriteNumU8s : CSpriteBase +{ + I32 num; + U8 u[0]; +}; + +public class CSpriteNumPtU8s : CSpriteBase +{ + I32 num; + I32 x; + I32 y; + U8 u[0]; +}; + +public class CSpritePtStr : CSpritePt +{ + U8 st[0]; +}; + +public class CSpriteMeshU8s : CSpriteBase +{ + I32 vertex_cnt; + I32 tri_cnt; + U8 u[0]; +}; + +public class CSpritePtMeshU8s : CSpriteBase +{ + I32 x; + I32 y; + I32 z; + I32 vertex_cnt; + I32 tri_cnt; + U8 u[0]; +}; + +#define SPT_END 0 //$LK,"CSpriteBase",A="MN:CSpriteBase"$ +#define SPT_COLOR 1 //$LK,"CSpriteColor",A="MN:CSpriteColor"$ +#define SPT_DITHER_COLOR 2 //$LK,"CSpriteDitherColor",A="MN:CSpriteDitherColor"$ +#define SPT_WIDTH 3 //$LK,"CSpriteW",A="MN:CSpriteW"$ +#define SPT_PLANAR_SYMMETRY 4 //$LK,"CSpritePtPt",A="MN:CSpritePtPt"$ +#define SPT_TRANSFORM_ON 5 //$LK,"CSpriteBase",A="MN:CSpriteBase"$ +#define SPT_TRANSFORM_OFF 6 //$LK,"CSpriteBase",A="MN:CSpriteBase"$ +#define SPT_SHIFT 7 //$LK,"CSpritePt",A="MN:CSpritePt"$ +#define SPT_PT 8 //$LK,"CSpritePt",A="MN:CSpritePt"$ +#define SPT_POLYPT 9 //$LK,"CSpriteNumPtU8s",A="MN:CSpriteNumPtU8s"$ +#define SPT_LINE 10 //$LK,"CSpritePtPt",A="MN:CSpritePtPt"$ +#define SPT_POLYLINE 11 //$LK,"CSpriteNumU8s",A="MN:CSpriteNumU8s"$ +#define SPT_RECT 12 //$LK,"CSpritePtPt",A="MN:CSpritePtPt"$ +#define SPT_ROTATED_RECT 13 //$LK,"CSpritePtPtAng",A="MN:CSpritePtPtAng"$ +#define SPT_CIRCLE 14 //$LK,"CSpritePtRad",A="MN:CSpritePtRad"$ +#define SPT_ELLIPSE 15 //$LK,"CSpritePtWHAng",A="MN:CSpritePtWHAng"$ +#define SPT_POLYGON 16 //$LK,"CSpritePtWHAngSides",A="MN:CSpritePtWHAngSides"$ +#define SPT_BSPLINE2 17 //$LK,"CSpriteNumU8s",A="MN:CSpriteNumU8s"$ +#define SPT_BSPLINE2_CLOSED 18 //$LK,"CSpriteNumU8s",A="MN:CSpriteNumU8s"$ +#define SPT_BSPLINE3 19 //$LK,"CSpriteNumU8s",A="MN:CSpriteNumU8s"$ +#define SPT_BSPLINE3_CLOSED 20 //$LK,"CSpriteNumU8s",A="MN:CSpriteNumU8s"$ +#define SPT_FLOOD_FILL 21 //$LK,"CSpritePt",A="MN:CSpritePt"$ +#define SPT_FLOOD_FILL_NOT 22 //$LK,"CSpritePt",A="MN:CSpritePt"$ +#define SPT_BITMAP 23 //$LK,"CSpritePtWHU8s",A="MN:CSpritePtWHU8s"$ +#define SPT_MESH 24 //$LK,"CSpriteMeshU8s",A="MN:CSpriteMeshU8s"$ See $MA-X+PU,"::/Apps/GrModels",LM="Cd(\"::/Apps/GrModels\");Dir;View;\n"$. +#define SPT_SHIFTABLE_MESH 25 //$LK,"CSpritePtMeshU8s",A="MN:CSpritePtMeshU8s"$ See $MA-X+PU,"::/Apps/GrModels",LM="Cd(\"::/Apps/GrModels\");Dir;View;\n"$. +#define SPT_ARROW 26 //$LK,"CSpritePtPt",A="MN:CSpritePtPt"$ +#define SPT_TEXT 27 //$LK,"CSpritePtStr",A="MN:CSpritePtStr"$ +#define SPT_TEXT_BOX 28 //$LK,"CSpritePtStr",A="MN:CSpritePtStr"$ +#define SPT_TEXT_DIAMOND 29 //$LK,"CSpritePtStr",A="MN:CSpritePtStr"$ +#define SPT_NUM_TYPES 30 + +#help_index "Graphics/Sprite;Sprites;Sprites/Binary" + +//See $LK,"Sprites",A="HI:Sprites"$. See $LK,"::/Adam/Gr/GrSpritePlot.HC",A="FL:::/Adam/Gr/GrSpritePlot.HC,1"$ and +//$LK,"::/Demo/Graphics/SpriteRaw.HC"$ for how CSprite are stored. +public class CSprite +{ + CSprite *next,*last; + Bool sel; + U0 start; + union { + U8 type; + CSpriteBase b; + CSpriteColor c; + CSpriteDitherColor d; + CSpriteW w; + CSpritePt p; + CSpritePtPt pp; + CSpritePtPtAng ppa; + CSpritePtRad pr; + CSpritePtWHU8s pwhu; + CSpritePtWHAng pwha; + CSpritePtWHAngSides pwhas; + CSpriteNumU8s nu; + CSpriteNumPtU8s npu; + CSpriteMeshU8s mu; + CSpritePtMeshU8s pmu; + CSpritePtStr ps; + } +}; diff --git a/Adam/Gr/Gr.HPP b/Adam/Gr/Gr.HPP deleted file mode 100644 index cf6b9b4..0000000 --- a/Adam/Gr/Gr.HPP +++ /dev/null @@ -1,177 +0,0 @@ -#help_index "Sprites/Binary" - -class CMeshTri -{ - I32 color; //Give one of 0-7 colors. -//Colors 8-15 are 0-7 with intensity bit set. - I32 nums[3]; //Vertex number -}; - -class CQueMeshTri -{ - CQueMeshTri *next,*last; - U0 start; - I32 color; - I32 nums[3]; -}; - -public class CSpriteBase -{ - U8 type; -}; - -public class CSpriteColor : CSpriteBase -{ - U8 color; -}; - -public class CSpriteDitherColor : CSpriteBase -{ - U16 dither_color; -}; - -public class CSpriteW : CSpriteBase -{ - I32 width; -}; - -public class CSpritePt : CSpriteBase -{ - I32 x1; - I32 y1; -}; - -public class CSpritePtRad : CSpritePt -{ - I32 radius; -}; - -public class CSpritePtPt : CSpritePt -{ - I32 x2; - I32 y2; -}; - -public class CSpritePtPtAng : CSpritePtPt -{ - F64 angle; -}; - -public class CSpritePtWH : CSpritePt -{ - I32 width; - I32 height; -}; - -public class CSpritePtWHU8s : CSpritePtWH -{ - U8 u[0]; -}; - -public class CSpritePtWHAng : CSpritePtWH -{ - F64 angle; -}; - -public class CSpritePtWHAngSides : CSpritePtWHAng -{ - I32 sides; -}; - -public class CSpriteNumU8s : CSpriteBase -{ - I32 num; - U8 u[0]; -}; - -public class CSpriteNumPtU8s : CSpriteBase -{ - I32 num; - I32 x; - I32 y; - U8 u[0]; -}; - -public class CSpritePtStr : CSpritePt -{ - U8 st[0]; -}; - -public class CSpriteMeshU8s : CSpriteBase -{ - I32 vertex_cnt; - I32 tri_cnt; - U8 u[0]; -}; - -public class CSpritePtMeshU8s : CSpriteBase -{ - I32 x; - I32 y; - I32 z; - I32 vertex_cnt; - I32 tri_cnt; - U8 u[0]; -}; - -#define SPT_END 0 //$LK,"CSpriteBase",A="MN:CSpriteBase"$ -#define SPT_COLOR 1 //$LK,"CSpriteColor",A="MN:CSpriteColor"$ -#define SPT_DITHER_COLOR 2 //$LK,"CSpriteDitherColor",A="MN:CSpriteDitherColor"$ -#define SPT_WIDTH 3 //$LK,"CSpriteW",A="MN:CSpriteW"$ -#define SPT_PLANAR_SYMMETRY 4 //$LK,"CSpritePtPt",A="MN:CSpritePtPt"$ -#define SPT_TRANSFORM_ON 5 //$LK,"CSpriteBase",A="MN:CSpriteBase"$ -#define SPT_TRANSFORM_OFF 6 //$LK,"CSpriteBase",A="MN:CSpriteBase"$ -#define SPT_SHIFT 7 //$LK,"CSpritePt",A="MN:CSpritePt"$ -#define SPT_PT 8 //$LK,"CSpritePt",A="MN:CSpritePt"$ -#define SPT_POLYPT 9 //$LK,"CSpriteNumPtU8s",A="MN:CSpriteNumPtU8s"$ -#define SPT_LINE 10 //$LK,"CSpritePtPt",A="MN:CSpritePtPt"$ -#define SPT_POLYLINE 11 //$LK,"CSpriteNumU8s",A="MN:CSpriteNumU8s"$ -#define SPT_RECT 12 //$LK,"CSpritePtPt",A="MN:CSpritePtPt"$ -#define SPT_ROTATED_RECT 13 //$LK,"CSpritePtPtAng",A="MN:CSpritePtPtAng"$ -#define SPT_CIRCLE 14 //$LK,"CSpritePtRad",A="MN:CSpritePtRad"$ -#define SPT_ELLIPSE 15 //$LK,"CSpritePtWHAng",A="MN:CSpritePtWHAng"$ -#define SPT_POLYGON 16 //$LK,"CSpritePtWHAngSides",A="MN:CSpritePtWHAngSides"$ -#define SPT_BSPLINE2 17 //$LK,"CSpriteNumU8s",A="MN:CSpriteNumU8s"$ -#define SPT_BSPLINE2_CLOSED 18 //$LK,"CSpriteNumU8s",A="MN:CSpriteNumU8s"$ -#define SPT_BSPLINE3 19 //$LK,"CSpriteNumU8s",A="MN:CSpriteNumU8s"$ -#define SPT_BSPLINE3_CLOSED 20 //$LK,"CSpriteNumU8s",A="MN:CSpriteNumU8s"$ -#define SPT_FLOOD_FILL 21 //$LK,"CSpritePt",A="MN:CSpritePt"$ -#define SPT_FLOOD_FILL_NOT 22 //$LK,"CSpritePt",A="MN:CSpritePt"$ -#define SPT_BITMAP 23 //$LK,"CSpritePtWHU8s",A="MN:CSpritePtWHU8s"$ -#define SPT_MESH 24 //$LK,"CSpriteMeshU8s",A="MN:CSpriteMeshU8s"$ See $MA-X+PU,"::/Apps/GrModels",LM="Cd(\"::/Apps/GrModels\");Dir;View;\n"$. -#define SPT_SHIFTABLE_MESH 25 //$LK,"CSpritePtMeshU8s",A="MN:CSpritePtMeshU8s"$ See $MA-X+PU,"::/Apps/GrModels",LM="Cd(\"::/Apps/GrModels\");Dir;View;\n"$. -#define SPT_ARROW 26 //$LK,"CSpritePtPt",A="MN:CSpritePtPt"$ -#define SPT_TEXT 27 //$LK,"CSpritePtStr",A="MN:CSpritePtStr"$ -#define SPT_TEXT_BOX 28 //$LK,"CSpritePtStr",A="MN:CSpritePtStr"$ -#define SPT_TEXT_DIAMOND 29 //$LK,"CSpritePtStr",A="MN:CSpritePtStr"$ -#define SPT_NUM_TYPES 30 - -#help_index "Graphics/Sprite;Sprites;Sprites/Binary" - -//See $LK,"Sprites",A="HI:Sprites"$. See $LK,"::/Adam/Gr/GrSpritePlot.CPP",A="FL:::/Adam/Gr/GrSpritePlot.CPP,1"$ and -//$LK,"::/Demo/Graphics/SpriteRaw.CPP"$ for how CSprite are stored. -public class CSprite -{ - CSprite *next,*last; - Bool sel; - U0 start; - union { - U8 type; - CSpriteBase b; - CSpriteColor c; - CSpriteDitherColor d; - CSpriteW w; - CSpritePt p; - CSpritePtPt pp; - CSpritePtPtAng ppa; - CSpritePtRad pr; - CSpritePtWHU8s pwhu; - CSpritePtWHAng pwha; - CSpritePtWHAngSides pwhas; - CSpriteNumU8s nu; - CSpriteNumPtU8s npu; - CSpriteMeshU8s mu; - CSpritePtMeshU8s pmu; - CSpritePtStr ps; - } -}; diff --git a/Adam/Gr/GrAsm.CPP b/Adam/Gr/GrAsm.HC similarity index 100% rename from Adam/Gr/GrAsm.CPP rename to Adam/Gr/GrAsm.HC diff --git a/Adam/Gr/GrBitMap.CPP b/Adam/Gr/GrBitMap.CPP deleted file mode 100644 index 10eaefa..0000000 --- a/Adam/Gr/GrBitMap.CPP +++ /dev/null @@ -1,1981 +0,0 @@ -#help_index "Graphics" - -public Bool GrPlot0(CDC *dc=gr.dc,I64 x,I64 y) -{//2D. No clipping or transformation or pen width. - U8 *dst; - I32 *db; - I64 d,dist; - CColorROPU32 c,color=dc->color,bkcolor=dc->bkcolor; - - if (dc->flags & DCF_LOCATE_NEAREST) { - dist=DistSqrI64(x,y,dc->cur_x,dc->cur_y); - if (dist<=dc->nearest_dist) { - dc->nearest_dist=dist; - dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num; - } - } - if (dc->flags & DCF_RECORD_EXTENTS) { - if (xmin_x) dc->min_x=x; - if (x>dc->max_x) dc->max_x=x; - if (ymin_y) dc->min_y=y; - if (y>dc->max_y) dc->max_y=y; - } - if (dc->flags & DCF_DONT_DRAW) - return TRUE; - d=dc->width_internal*y+x; - if (db=dc->depth_buf) { - db+=d; - if (0<=dc->db_z<=*db) - *db=dc->db_z; - else - return TRUE; - } - if (color.c1.rop&(ROPBF_DITHER|ROPBF_PROBABILITY_DITHER)) { - if (color.c1.rop&ROPBF_PROBABILITY_DITHER) { - if (RandU16dither_probability_u16) { - color.c1.rop=color.c0.rop; - color.c0=color.c1; - } - } else { - if ((x^y)&1) { - color.c1.rop=color.c0.rop; - color.c0=color.c1; - } - } - } - dst=dc->body+d; - switch [color.c0.rop] { - case ROPB_EQU: - case ROPB_MONO: - *dst=color.c0.color; - break; - case ROPB_COLLISION: - c=*dst; - if (c!=TRANSPARENT && c!=bkcolor.c0.color) - dc->collision_cnt++; - break; - case ROPB_XOR: - *dst^=color.c0.color; - break; - } - return TRUE; -} - -public I64 GrPeek0(CDC *dc=gr.dc,I64 x,I64 y) -{//2D. No clipping or transformation. - return dc->body[dc->width_internal*y+x]; -} - -#help_index "Graphics;Graphics/Device Contexts" - -public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img) -{//2D. Clipping but not transformation.. - I64 i,j,k,k1,kk,kk1,w1,h1,w2,h2,dist, - leading_pixels,leading_pixel_mask,whole_I64s, - trailing_pixels,trailing_pixel_mask, - reg bit_shift,win_z_buf_line_inc,win_z_buf_line_dec,win_z_num, - color_mask; - U8 reg *dst,*src; - I32 *db; - U16 reg *win_z_buf_ptr; - CColorROPU32 color,c,old_color; - CTask *win_task; - - if (dc->flags & DCF_SCREEN_BITMAP) { - win_task=dc->win_task; - x+=win_task->scroll_x; - y+=win_task->scroll_y; - } - if (x<0) - w1=-x; - else - w1=0; - if (y<0) - h1=-y; - else - h1=0; - w2=img->width; - h2=img->height; - if (dc->flags & DCF_SCREEN_BITMAP) { - x+=win_task->pix_left; - y+=win_task->pix_top; - } - if (dc->flags & DCF_LOCATE_NEAREST) { - dist=DistSqrI64(x+img->width>>1,y+img->height>>1,dc->cur_x,dc->cur_y); - if (dist<=dc->nearest_dist) { - dc->nearest_dist=dist; - dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num; - } - } - if (dc->flags & DCF_SCREEN_BITMAP) { - if (x+w1<0) w1=-x; - if (x+w2>win_task->pix_right+1) - w2=win_task->pix_right+1-x; - - if (y+h1<0) h1=-y; - if (y+h2>win_task->pix_bottom+1) - h2=win_task->pix_bottom+1-y; - } - if (x+w2>dc->width) - w2=dc->width-x; - if (y+h2>dc->height) - h2=dc->height-y; - if (w1width && h1height) { - if (dc->flags & DCF_RECORD_EXTENTS) { - if (x+w1min_x) dc->min_x=x+w1; - if (x+w2-1>dc->max_x) dc->max_x=x+w2-1; - if (y+h1min_y) dc->min_y=y+h1; - if (y+h2-1>dc->max_y) dc->max_y=y+h2-1; - } - if (dc->flags & DCF_DONT_DRAW) - return 1; - old_color=dc->color; - db=dc->depth_buf; - dc->depth_buf=NULL; - dc->color&=~ROPF_DITHER; - color=dc->color; - leading_pixels=-(w1+x)&7; - leading_pixel_mask=gr.to_8_bits[0xFF>>leading_pixels]; - bit_shift=-x&7; - whole_I64s=(w2-w1-leading_pixels)>>3; - if (whole_I64s<0) whole_I64s=0; - trailing_pixels=(x+w2)&7; - trailing_pixel_mask=gr.to_8_bits[0xFF<w2-w1) { - leading_pixel_mask|=trailing_pixel_mask; - trailing_pixels=0; - } - switch (color.c0.rop) { - case ROPB_COLLISION: //TODO: Might want to check win_z_buf - color =dc->bkcolor.c0.color; - k=h1*img->width_internal; - k1=(h1+y)*dc->width_internal+x; - for (j=h2-h1;j;j--) { - for (i=w1;ibody[k1+i]; - if (c!=TRANSPARENT&&c!=color&&img->body[k+i]!=TRANSPARENT) - dc->collision_cnt++; - } - k+=img->width_internal; - k1+=dc->width_internal; - } - break; - case ROPB_MONO: - color_mask=gr.to_8_colors[color.c0.color]; - if (img->flags&DCF_NO_TRANSPARENTS) { - if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP) - win_z_buf_ptr=NULL; - else { - win_z_num=win_task->win_z_num; - win_z_buf_ptr=gr.win_z_buf(U8 *)+((h1+y)/FONT_HEIGHT*TEXT_COLS+ - (w1+x)/FONT_WIDTH)*sizeof(U16); - win_z_buf_line_dec=whole_I64s; - if (leading_pixels) - win_z_buf_line_dec++; - if (trailing_pixels) - win_z_buf_line_dec++; - win_z_buf_line_dec*=sizeof(U16); - win_z_buf_line_inc=TEXT_COLS*sizeof(U16)-win_z_buf_line_dec; - } - kk = h1 *img ->width_internal+w1; - kk1=(h1+y)*dc->width_internal+x+w1; - kk =(kk-bit_shift)&~7+bit_shift; - bit_shift*=8; - if (win_z_buf_ptr) - for (j=h1;jbody+kk&~7; - dst=dc->body+kk1&~7; - if (leading_pixels) { - if (win_z_num>=*win_z_buf_ptr++) { - if (bit_shift) - *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| - (*src(U64 *)++>>bit_shift| - *src(I64 *)<<(64-bit_shift))& - ~leading_pixel_mask&color_mask; - else - *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| - *src(I64 *)++&~leading_pixel_mask&color_mask; - } else { - src(I64 *)++; - dst(I64 *)++; - } - } - if (bit_shift) - for (i=0;i=*win_z_buf_ptr++) - *dst(I64 *)++=(*src(U64 *)++>>bit_shift| - *src(I64 *)<<(64-bit_shift))&color_mask; - else { - src(I64 *)++; - dst(I64 *)++; - } - else - for (i=0;i=*win_z_buf_ptr++) - *dst(I64 *)++=*src(I64 *)++&color_mask; - else { - src(I64 *)++; - dst(I64 *)++; - } - if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) { - if (bit_shift) - *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| - (*src(U64 *)++>>bit_shift| - *src(I64 *)<<(64-bit_shift))& - ~trailing_pixel_mask&color_mask; - else - *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| - *src(I64 *)++&~trailing_pixel_mask&color_mask; - } - kk +=img->width_internal; - kk1+=dc->width_internal; - if ((j+y)&7==7) - win_z_buf_ptr(U8 *)+=win_z_buf_line_inc; - else - win_z_buf_ptr(U8 *)-=win_z_buf_line_dec; - } - else - for (j=h2-h1;j;j--) { - src=img->body+kk&~7; - dst=dc->body+kk1&~7; - if (leading_pixels) { - if (bit_shift) - *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| - (*src(U64 *)++>>bit_shift| - *src(I64 *)<<(64-bit_shift))& - ~leading_pixel_mask&color_mask; - else - *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| - *src(I64 *)++&~leading_pixel_mask&color_mask; - } - if (bit_shift) - for (i=0;i>bit_shift| - *src(I64 *)<<(64-bit_shift))&color_mask; - else - for (i=0;i>bit_shift| - *src(I64 *)<<(64-bit_shift))& - ~trailing_pixel_mask&color_mask; - else - *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| - *src(I64 *)++&~trailing_pixel_mask&color_mask; - } - kk +=img->width_internal; - kk1+=dc->width_internal; - } - } else { - k=h1*img->width_internal; - if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP) { - for (j=h1;jbody[k+i]) - GrPlot0(dc,x+i,y+j); - k+=img->width_internal; - } - } else { - win_z_num =win_task->win_z_num; - win_z_buf_ptr =gr.win_z_buf(U8 *)+ - ((h1+y)/FONT_HEIGHT*TEXT_COLS+(w1+x)/FONT_WIDTH)*sizeof(U16); - win_z_buf_line_dec=whole_I64s; - if (leading_pixels) - win_z_buf_line_dec++; - if (trailing_pixels) - win_z_buf_line_dec++; - win_z_buf_line_dec*=sizeof(U16); - win_z_buf_line_inc=TEXT_COLS*sizeof(U16)-win_z_buf_line_dec; - for (j=h1;j=*win_z_buf_ptr++) - color_mask=TRUE; - else - color_mask=FALSE; - for (i=w1;ibody[k+i]) - GrPlot0(dc,x+i,y+j); - if (!((++i+x) &7) && i=*win_z_buf_ptr++) - color_mask=TRUE; - else - color_mask=FALSE; - } - } - if ((j+y)&7==7) - win_z_buf_ptr(U8 *)+=win_z_buf_line_inc; - else - win_z_buf_ptr(U8 *)-=win_z_buf_line_dec; - k+=img->width_internal; - } - } - } - break; - case ROPB_EQU: - if (img->flags&DCF_NO_TRANSPARENTS) { - if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP) - win_z_buf_ptr=NULL; - else { - win_z_num=win_task->win_z_num; - win_z_buf_ptr=gr.win_z_buf(U8 *)+ - ((h1+y)/FONT_HEIGHT*TEXT_COLS+(w1+x)/FONT_WIDTH)*sizeof(U16); - win_z_buf_line_dec=whole_I64s; - if (leading_pixels) - win_z_buf_line_dec++; - if (trailing_pixels) - win_z_buf_line_dec++; - win_z_buf_line_dec*=sizeof(U16); - win_z_buf_line_inc=TEXT_COLS*sizeof(U16)-win_z_buf_line_dec; - } - kk = h1 *img ->width_internal+w1; - kk1=(h1+y)*dc->width_internal+x+w1; - kk =(kk-bit_shift)&~7+bit_shift; - bit_shift*=8; - if (win_z_buf_ptr) - for (j=h1;jbody+kk&~7; - dst=dc->body+kk1&~7; - if (leading_pixels) { - if (win_z_num>=*win_z_buf_ptr++) { - if (bit_shift) - *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| - (*src(U64 *)++>>bit_shift| - *src(I64 *)<<(64-bit_shift))&~leading_pixel_mask; - else - *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| - *src(I64 *)++&~leading_pixel_mask; - } else { - src(I64 *)++; - dst(I64 *)++; - } - } - if (bit_shift) - for (i=0;i=*win_z_buf_ptr++) - *dst(I64 *)++=*src(U64 *)++>>bit_shift| - *src(I64 *)<<(64-bit_shift); - else { - src(I64 *)++; - dst(I64 *)++; - } - else - for (i=0;i=*win_z_buf_ptr++) - *dst(I64 *)++=*src(I64 *)++; - else { - src(I64 *)++; - dst(I64 *)++; - } - if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) { - if (bit_shift) - *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| - (*src(U64 *)++>>bit_shift| - *src(I64 *)<<(64-bit_shift))&~trailing_pixel_mask; - else - *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| - *src(I64 *)++&~trailing_pixel_mask; - } - kk +=img->width_internal; - kk1+=dc->width_internal; - if ((j+y)&7==7) - win_z_buf_ptr(U8 *)+=win_z_buf_line_inc; - else - win_z_buf_ptr(U8 *)-=win_z_buf_line_dec; - } - else - for (j=h2-h1;j;j--) { - src=img->body+kk&~7; - dst=dc->body+kk1&~7; - if (leading_pixels) { - if (bit_shift) - *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| - (*src(U64 *)++>>bit_shift| - *src(I64 *)<<(64-bit_shift))&~leading_pixel_mask; - else - *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| - *src(I64 *)++&~leading_pixel_mask; - } - if (bit_shift) - for (i=0;i>bit_shift| - *src(I64 *)<<(64-bit_shift); - else - for (i=0;i>bit_shift| - *src(I64 *)<<(64-bit_shift))&~trailing_pixel_mask; - else - *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| - *src(I64 *)++&~trailing_pixel_mask; - } - kk +=img->width_internal; - kk1+=dc->width_internal; - } - } else { -here1a: - k=h1*img->width_internal; - if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP) { - for (j=h1;jbody[k+i]; - if (c!=TRANSPARENT) { - dc->color.c0.color=c; - GrPlot0(dc,x+i,y+j); - } - } - k+=img->width_internal; - } - } else { - win_z_num =win_task->win_z_num; - win_z_buf_ptr =gr.win_z_buf(U8 *)+ - ((h1+y)/FONT_HEIGHT*TEXT_COLS+(w1+x)/FONT_WIDTH)*sizeof(U16); - win_z_buf_line_dec=whole_I64s; - if (leading_pixels) - win_z_buf_line_dec++; - if (trailing_pixels) - win_z_buf_line_dec++; - win_z_buf_line_dec*=sizeof(U16); - win_z_buf_line_inc=TEXT_COLS*sizeof(U16)-win_z_buf_line_dec; - for (j=h1;j=*win_z_buf_ptr++) - color_mask=TRUE; - else - color_mask=FALSE; - for (i=w1;ibody[k+i]; - if (c!=TRANSPARENT) { - dc->color.c0.color=c; - GrPlot0(dc,x+i,y+j); - } - } - if (!((++i+x) &7) && i=*win_z_buf_ptr++) - color_mask=TRUE; - else - color_mask=FALSE; - } - } - if ((j+y)&7==7) - win_z_buf_ptr(U8 *)+=win_z_buf_line_inc; - else - win_z_buf_ptr(U8 *)-=win_z_buf_line_dec; - k+=img->width_internal; - } - } - dc->color=color; - } - break; - case ROPB_XOR: - if (img->flags&DCF_NO_TRANSPARENTS) { - if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP) - win_z_buf_ptr=NULL; - else { - win_z_num=win_task->win_z_num; - win_z_buf_ptr=gr.win_z_buf(U8 *)+ - ((h1+y)/FONT_HEIGHT*TEXT_COLS+(w1+x)/FONT_WIDTH)*sizeof(U16); - win_z_buf_line_dec=whole_I64s; - if (leading_pixels) - win_z_buf_line_dec++; - if (trailing_pixels) - win_z_buf_line_dec++; - win_z_buf_line_dec*=sizeof(U16); - win_z_buf_line_inc=TEXT_COLS*sizeof(U16)-win_z_buf_line_dec; - } - kk = h1 *img ->width_internal +w1; - kk1=(h1+y)*dc->width_internal+x+w1; - kk =(kk-bit_shift)&~7+bit_shift; - bit_shift*=8; - if (win_z_buf_ptr) - for (j=h1;jbody+kk&~7; - dst=dc->body+kk1&~7; - if (leading_pixels) { - if (win_z_num>=*win_z_buf_ptr++) { - if (bit_shift) - *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| - (*dst(I64 *)^(*src(U64 *)++>>bit_shift| - *src(I64 *)<<(64-bit_shift)))&~leading_pixel_mask; - else - *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| - (*dst(I64 *)^*src(I64 *)++)&~leading_pixel_mask; - } else { - src(I64 *)++; - dst(I64 *)++; - } - } - if (bit_shift) - for (i=0;i=*win_z_buf_ptr++) - *dst(I64 *)++^=*src(U64 *)++>>bit_shift| - *src(I64 *)<<(64-bit_shift); - else { - src(I64 *)++; - dst(I64 *)++; - } - else - for (i=0;i=*win_z_buf_ptr++) - *dst(I64 *)++^=*src(I64 *)++; - else { - src(I64 *)++; - dst(I64 *)++; - } - if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) { - if (bit_shift) - *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| - (*dst(I64 *)^(*src(U64 *)++>>bit_shift| - *src(I64 *)<<(64-bit_shift)))&~trailing_pixel_mask; - else - *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| - (*dst(I64 *)^*src(I64 *)++)&~trailing_pixel_mask; - } - kk +=img->width_internal; - kk1+=dc->width_internal; - if ((j+y)&7==7) - win_z_buf_ptr(U8 *)+=win_z_buf_line_inc; - else - win_z_buf_ptr(U8 *)-=win_z_buf_line_dec; - } - else - for (j=h2-h1;j;j--) { - src=img->body+kk&~7; - dst=dc->body+kk1&~7; - if (leading_pixels) { - if (bit_shift) - *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| - (*dst(I64 *)^(*src(U64 *)++>>bit_shift| - *src(I64 *)<<(64-bit_shift)))&~leading_pixel_mask; - else - *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| - (*dst(I64 *)^*src(I64 *)++)&~leading_pixel_mask; - } - if (bit_shift) - for (i=0;i>bit_shift| - *src(I64 *)<<(64-bit_shift); - else - for (i=0;i>bit_shift| - *src(I64 *)<<(64-bit_shift)))&~trailing_pixel_mask; - else - *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| - (*dst(I64 *)^*src(I64 *)++)&~trailing_pixel_mask; - } - kk +=img->width_internal; - kk1+=dc->width_internal; - } - } else - goto here1a; - break; - } - dc->depth_buf=db; - dc->color=old_color; - return 1; - } else - return 0; -} - -#help_index "Graphics/Device Contexts" - -U8 *GrBitMap4ToBitMap8(U8 *dst,U8 *src,I64 src_size,I64 bkcolor) -{ - I64 c,k,i=src_size*2,i1=i>>3; - for (k=0;kx2) SwapI64(&x1,&x2); - if (y1>y2) SwapI64(&y1,&y2); - if (dc->flags & DCF_SCREEN_BITMAP) { - win_task=dc->win_task; - x1+=win_task->pix_left+win_task->scroll_x; - y1+=win_task->pix_top +win_task->scroll_y; - x2+=win_task->pix_left+win_task->scroll_x; - y2+=win_task->pix_top +win_task->scroll_y; - } - res=DCNew(x2-x1+1,y2-y1+1,task); - DCFill(res); - GrBlot(res,-x1,-y1,dc); - return res; -} - -#help_index "Graphics/Char;Char/Graphics" - -public I64 GrPutChar(CDC *dc=gr.dc,I64 x,I64 y,U8 ch) -{//2D. Clipping but not transformation. - U8 reg *src,reg *dst,*font_ptr; - I64 i,m,leading_pixels,trailing_pixels,leading_pixel_mask,trailing_pixel_mask, - j,k1,kk1,w1,h1,w2,h2,reg bit_shift,reg color_mask,dist; - CColorROPU32 color,c; - CTask *win_task; - - if (dc->flags & DCF_SCREEN_BITMAP) { - win_task=dc->win_task; - x+=win_task->scroll_x; - y+=win_task->scroll_y; - } - - if (x<0) - w1=-x; - else - w1=0; - if (y<0) - h1=-y; - else - h1=0; - w2=FONT_WIDTH; - h2=FONT_HEIGHT; - - if (dc->flags & DCF_SCREEN_BITMAP) { - x+=win_task->pix_left; - y+=win_task->pix_top; - } - if (dc->flags & DCF_LOCATE_NEAREST) { - dist=DistSqrI64(x+w2>>1,y+h2>>1,dc->cur_x,dc->cur_y); - if (dist<=dc->nearest_dist) { - dc->nearest_dist=dist; - dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num; - } - } - if (dc->flags & DCF_SCREEN_BITMAP) { - if (x+w1<0) w1=-x; - if (x+w2>win_task->pix_right+1) - w2=win_task->pix_right+1-x; - - if (y+h1<0) h1=-y; - if (y+h2>win_task->pix_bottom+1) - h2=win_task->pix_bottom+1-y; - } - if (x+w2>dc->width) - w2=dc->width-x; - if (y+h2>dc->height) - h2=dc->height-y; - if (w1flags & DCF_RECORD_EXTENTS) { - if (x+w1 min_x) dc->min_x=x+w1; - if (x+w2-1>dc->max_x) dc->max_x=x+w2-1; - if (y+h1 min_y) dc->min_y=y+h1; - if (y+h2-1>dc->max_y) dc->max_y=y+h2-1; - } - if (dc->flags & DCF_DONT_DRAW) - return 1; - color=dc->color; - leading_pixels=-(w1+x)&7; - if (!leading_pixels) leading_pixels=8; - leading_pixel_mask=gr.to_8_bits[0xFF>>leading_pixels]; - bit_shift=-x&7; - trailing_pixels=(x+w2)&7; - trailing_pixel_mask=gr.to_8_bits[0xFF<w2-w1) { - leading_pixel_mask|=trailing_pixel_mask; - trailing_pixels=0; - } - font_ptr=&text.font(U8 *)[FONT_HEIGHT*ch+h1]; - if (color.c0.rop==ROPB_COLLISION) { - m=w1&(FONT_WIDTH-1); -#assert FONT_WIDTH==8 - color =dc->bkcolor.c0.color; - for (i=w1;iwidth_internal+x; - src=font_ptr; - for (j=h2-h1;j;j--) { - c=dc->body[k1+i]; - if (c!=TRANSPARENT && c!=color && Bt(src,m)) - dc->collision_cnt++; - k1+=dc->width_internal; - src++; - } - } - } else { - color_mask=gr.to_8_colors[color.c0.color]; - k1=x+w1; - kk1=(h1+y)*dc->width_internal+k1; - if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP) { - if (leading_pixels) { - dst=dc->body+kk1&~7; - src=font_ptr; - if (bit_shift) - src--; - switch [color.c0.rop] { - case ROPB_EQU: - case ROPB_MONO: - for (j=h2-h1;j;j--) { - m=gr.to_8_bits[*src(U16 *)>>bit_shift&0xFF]; - *dst(I64 *)=*dst(I64 *)&leading_pixel_mask| - (color_mask&m|*dst(I64 *)&~m)&~leading_pixel_mask; - src++; - dst+=dc->width_internal; - } - break; - case ROPB_XOR: - if (color_mask) { - for (j=h2-h1;j;j--) { - *dst(I64 *)=*dst(I64 *)&leading_pixel_mask| - (*dst(I64 *)^gr.to_8_bits[*src(U16 *)>>bit_shift&0xFF])& - ~leading_pixel_mask; - src++; - dst+=dc->width_internal; - } - } - break; - } - kk1+=8; - } - if (trailing_pixels) { - dst=dc->body+kk1&~7; - src=font_ptr+1; - if (bit_shift) - src--; - switch [color.c0.rop] { - case ROPB_EQU: - case ROPB_MONO: - for (j=h2-h1;j;j--) { - m=gr.to_8_bits[*src(U16 *)>>bit_shift&0xFF]; - *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| - (color_mask&m|*dst(I64 *)&~m)&~trailing_pixel_mask; - src++; - dst+=dc->width_internal; - } - break; - case ROPB_XOR: - if (color_mask) - for (j=h2-h1;j;j--) { - *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| - (*dst(I64 *)^gr.to_8_bits[*src(U16 *)>>bit_shift&0xFF])& - ~trailing_pixel_mask; - src++; - dst+=dc->width_internal; - } - break; - } - } - } else { - if (leading_pixels) { - dst=dc->body+kk1&~7; - src=font_ptr; - if (bit_shift) - src--; - switch [color.c0.rop] { - case ROPB_EQU: - case ROPB_MONO: - for (j=h1;j>bit_shift&0xFF]; - *dst(I64 *)=*dst(I64 *)&leading_pixel_mask| - (color_mask&m|*dst(I64 *)&~m)&~leading_pixel_mask; - } - src++; - dst+=dc->width_internal; - } - break; - case ROPB_XOR: - if (color_mask) - for (j=h1;j>bit_shift&0xFF])& - ~leading_pixel_mask; - src++; - dst+=dc->width_internal; - } - break; - } - k1+=8; - kk1+=8; - } - if (trailing_pixels) { - dst=dc->body+kk1&~7; - src=font_ptr+1; - if (bit_shift) - src--; - switch [color.c0.rop] { - case ROPB_EQU: - case ROPB_MONO: - for (j=h1;j>bit_shift&0xFF]; - *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| - (color_mask&m|*dst(I64 *)&~m)&~trailing_pixel_mask; - } - src++; - dst+=dc->width_internal; - } - break; - case ROPB_XOR: - if (color_mask) - for (j=h1;j>bit_shift&0xFF])& - ~trailing_pixel_mask; - src++; - dst+=dc->width_internal; - } - break; - } - } - } - } - return 1; - } else - return 0; -} - -I64 GrPutS(CDC *dc=gr.dc,I64 x,I64 y,U8 *_s) -{//Use $LK,"GrPrint",A="MN:GrPrint"$() - I64 x0,ch,res; - if (!_s) return 0; - x0=x; - res=0; - while (ch=*_s++) { - if (ch=='\n') { - x=x0; - y+=FONT_HEIGHT; - } else if (ch=='\t') - x=x0+CeilU64(x-x0+FONT_WIDTH,8*FONT_WIDTH); - else { - res+=GrPutChar(dc,x,y,ch); - x+=FONT_WIDTH; - } - } - return res; -} - -I64 GrVPutS(CDC *dc=gr.dc,I64 x,I64 y,U8 *_s) -{//Vertical Text. Use $LK,"GrVPrint",A="MN:GrVPrint"$() - I64 y0,res; - U8 buf[2]; - if (!_s) return 0; - y0=y; - res=0; - - buf[1]=0; - while (*buf=*_s++) { - if (*buf=='\n') { - y=y0; - x+=FONT_WIDTH; - } else if (*buf=='\t') - y=y0+CeilU64(y-y0+FONT_HEIGHT,8*FONT_HEIGHT); - else { - res+=GrPutS(dc,x,y,buf); - y+=FONT_HEIGHT; - } - } - return res; -} - -public I64 GrPrint(CDC *dc=gr.dc,I64 x,I64 y,U8 *fmt,...) -{//2D. Clipping but not transformation. - I64 res; - U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); - res=GrPutS(dc,x,y,buf); - Free(buf); - return res; -} - -public I64 GrVPrint(CDC *dc=gr.dc,I64 x,I64 y,U8 *fmt,...) -{//2D. Vertical text. Clipping but not transformation. - I64 res; - U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); - res=GrVPutS(dc,x,y,buf); - Free(buf); - return res; -} - -#help_index "Graphics" -public I64 GrRect(CDC *dc=gr.dc,I64 x,I64 y,I64 w,I64 h) -{//2D. Width Height. Clipping but not transformation. -//Returns cnt of pixs changed. - I64 i,res=0,j,k1,kk1,w1,h1,w2,h2,dist, - leading_pixels,original_leading_pixels,whole_I64s, - trailing_pixels,leading_pixel_mask,trailing_pixel_mask, - win_z_buf_line_inc,win_z_buf_line_dec,win_z_num,color_mask; - U8 reg *dst; - U16 reg *win_z_buf_ptr; - CColorROPU32 color,c,dither_colors; - Bool dither,probability_dither; - CTask *win_task; - - if (dc->flags & DCF_SCREEN_BITMAP) { - win_task=dc->win_task; - x+=win_task->scroll_x; - y+=win_task->scroll_y; - } - - if (x<0) - w1=-x; - else - w1=0; - if (y<0) - h1=-y; - else - h1=0; - w2=w; - h2=h; - - if (dc->flags & DCF_SCREEN_BITMAP) { - x+=win_task->pix_left; - y+=win_task->pix_top; - } - if (dc->flags & DCF_LOCATE_NEAREST) {//TODO:Untested - if (x<=dc->cur_x<=x+w && y<=dc->cur_y<=y+h) - dist=0; - else - dist=DistSqrI64(x+w>>1,y+h>>1,dc->cur_x,dc->cur_y); - if (dist<=dc->nearest_dist) { - dc->nearest_dist=dist; - dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num; - } - } - if (dc->flags & DCF_SCREEN_BITMAP) { - if (x+w1<0) w1=-x; - if (x+w2>win_task->pix_right+1) - w2=win_task->pix_right+1-x; - - if (y+h1<0) h1=-y; - if (y+h2>win_task->pix_bottom+1) - h2=win_task->pix_bottom+1-y; - } - if (x+w2>dc->width) - w2=dc->width-x; - if (y+h2>dc->height) - h2=dc->height-y; - if (w1flags & DCF_RECORD_EXTENTS) { - if (x+w1 min_x) dc->min_x=x+w1; - if (x+w2-1>dc->max_x) dc->max_x=x+w2-1; - if (y+h1 min_y) dc->min_y=y+h1; - if (y+h2-1>dc->max_y) dc->max_y=y+h2-1; - } - if (dc->flags & DCF_DONT_DRAW) - return TRUE; - color=dc->color; - 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; - } else { - probability_dither=FALSE; - color.c1.rop=color.c0.rop; - } - } else - dither=FALSE; - original_leading_pixels=leading_pixels=-(w1+x)&7; - leading_pixel_mask=gr.to_8_bits[0xFF>>leading_pixels]; - whole_I64s=(w2-w1-leading_pixels)>>3; - if (whole_I64s<0) whole_I64s=0; - trailing_pixels=(x+w2)&7; - trailing_pixel_mask=gr.to_8_bits[0xFF<w2-w1) { - leading_pixel_mask|=trailing_pixel_mask; - leading_pixels=w2-w1; //Correct so it's right for res. - trailing_pixels=0; - } - if (color.c0.rop==ROPB_COLLISION) {//TODO: Might want to check win_z_buf - color =dc->bkcolor.c0.color; - k1=(h1+y)*dc->width_internal+x; - res=-dc->collision_cnt; - for (j=h2-h1;j;j--) { - for (i=w1;ibody[k1+i]; - if (c!=TRANSPARENT && c!=color) - dc->collision_cnt++; - } - k1+=dc->width_internal; - } - res+=dc->collision_cnt; - } else { - if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP) - win_z_buf_ptr=NULL; - else { - win_z_num=win_task->win_z_num; - win_z_buf_ptr=gr.win_z_buf(U8 *)+((h1+y)/FONT_HEIGHT*TEXT_COLS+ - (w1+x)/FONT_WIDTH)*sizeof(U16); - win_z_buf_line_dec=whole_I64s; - if (leading_pixels) - win_z_buf_line_dec++; - if (trailing_pixels) - win_z_buf_line_dec++; - win_z_buf_line_dec*=sizeof(U16); - win_z_buf_line_inc=TEXT_COLS*sizeof(U16)-win_z_buf_line_dec; - } - kk1=(h1+y)*dc->width_internal+x+w1; - if (dither) { - if (probability_dither) { - if (RandU16dither_probability_u16) - color.c0=dither_colors.c1; - else - color.c0=dither_colors.c0; - switch [color.c0.rop] { - case ROPB_EQU: - case ROPB_MONO: - if (win_z_buf_ptr) { - res=0; - for (j=h1;jbody+kk1&~7; - if (leading_pixels) { - if (win_z_num>=*win_z_buf_ptr++) { - *dst(I64 *)=*dst(I64 *)&leading_pixel_mask| - color_mask&~leading_pixel_mask; - res+=leading_pixels; - } - dst(I64 *)++; - } - for (i=0;i=*win_z_buf_ptr++) { - *dst(I64 *)=color_mask; - res+=8; - } - if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) { - *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| - color_mask&~trailing_pixel_mask; - res+=trailing_pixels; - } - if ((j+y)&7==7) - win_z_buf_ptr(U8 *)+=win_z_buf_line_inc; - else - win_z_buf_ptr(U8 *)-=win_z_buf_line_dec; - kk1+=dc->width_internal; - if (RandU16dither_probability_u16) - color.c0=dither_colors.c1; - else - color.c0=dither_colors.c0; - } - } else { - for (j=h2-h1;j;j--) { - color_mask=gr.to_8_colors[color.c0.color]; - dst=dc->body+kk1&~7; - if (leading_pixels) - *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| - color_mask&~leading_pixel_mask; - for (i=0;iwidth_internal; - if (RandU16dither_probability_u16) - color.c0=dither_colors.c1; - else - color.c0=dither_colors.c0; - } - res=(h2-h1)*(w2-w1); - } - break; - case ROPB_XOR: - if (win_z_buf_ptr) { - res=0; - for (j=h1;jbody+kk1&~7; - if (leading_pixels) { - if (win_z_num>=*win_z_buf_ptr++) { - *dst(I64 *)=*dst(I64 *)&leading_pixel_mask| - *dst(I64 *)^color_mask&~leading_pixel_mask; - res+=leading_pixels; - } - dst(I64 *)++; - } - for (i=0;i=*win_z_buf_ptr++) { - *dst(I64 *)^=color_mask; - res+=8; - } - if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) { - *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| - *dst(I64 *)^color_mask&~trailing_pixel_mask; - res+=trailing_pixels; - } - if ((j+y)&7==7) - win_z_buf_ptr(U8 *)+=win_z_buf_line_inc; - else - win_z_buf_ptr(U8 *)-=win_z_buf_line_dec; - kk1+=dc->width_internal; - if (RandU16dither_probability_u16) - color.c0=dither_colors.c1; - else - color.c0=dither_colors.c0; - } - } else { - for (j=h2-h1;j;j--) { - color_mask=gr.to_8_colors[color.c0.color]; - dst=dc->body+kk1&~7; - if (leading_pixels) - *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| - *dst(I64 *)^color_mask&~leading_pixel_mask; - for (i=0;iwidth_internal; - if (RandU16dither_probability_u16) - color.c0=dither_colors.c1; - else - color.c0=dither_colors.c0; - } - res=(h2-h1)*(w2-w1); - } - break; - } - } else { - if (((x+w1-original_leading_pixels)^(y+h1))&1) - SwapU16(&color.c0,&color.c1); - switch [color.c0.rop] { - case ROPB_EQU: - case ROPB_MONO: - if (win_z_buf_ptr) { - res=0; - for (j=h1;jbody+kk1&~7; - if (leading_pixels) { - if (win_z_num>=*win_z_buf_ptr++) { - *dst(I64 *)=*dst(I64 *)&leading_pixel_mask| - color_mask&~leading_pixel_mask; - res+=leading_pixels; - } - dst(I64 *)++; - } - for (i=0;i=*win_z_buf_ptr++) { - *dst(I64 *)=color_mask; - res+=8; - } - if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) { - *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| - color_mask&~trailing_pixel_mask; - res+=trailing_pixels; - } - if ((j+y)&7==7) - win_z_buf_ptr(U8 *)+=win_z_buf_line_inc; - else - win_z_buf_ptr(U8 *)-=win_z_buf_line_dec; - kk1+=dc->width_internal; - SwapU16(&color.c0,&color.c1); - } - } else { - for (j=h2-h1;j;j--) { - color_mask=gr.to_8_bits[0x55]&gr.to_8_colors[color.c0.color]| - gr.to_8_bits[0xAA]&gr.to_8_colors[color.c1.color]; - dst=dc->body+kk1&~7; - if (leading_pixels) - *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| - color_mask&~leading_pixel_mask; - for (i=0;iwidth_internal; - SwapU16(&color.c0,&color.c1); - } - res=(h2-h1)*(w2-w1); - } - break; - case ROPB_XOR: - if (win_z_buf_ptr) { - res=0; - for (j=h1;jbody+kk1&~7; - if (leading_pixels) { - if (win_z_num>=*win_z_buf_ptr++) { - *dst(I64 *)=*dst(I64 *)&leading_pixel_mask| - *dst(I64 *)^color_mask&~leading_pixel_mask; - res+=leading_pixels; - } - dst(I64 *)++; - } - for (i=0;i=*win_z_buf_ptr++) { - *dst(I64 *)^=color_mask; - res+=8; - } - if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) { - *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| - *dst(I64 *)^color_mask&~trailing_pixel_mask; - res+=trailing_pixels; - } - if ((j+y)&7==7) - win_z_buf_ptr(U8 *)+=win_z_buf_line_inc; - else - win_z_buf_ptr(U8 *)-=win_z_buf_line_dec; - kk1+=dc->width_internal; - SwapU16(&color.c0,&color.c1); - } - } else { - for (j=h2-h1;j;j--) { - color_mask=gr.to_8_bits[0x55]&gr.to_8_colors[color.c0.color]| - gr.to_8_bits[0xAA]&gr.to_8_colors[color.c1.color]; - dst=dc->body+kk1&~7; - if (leading_pixels) - *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| - *dst(I64 *)^color_mask&~leading_pixel_mask; - for (i=0;iwidth_internal; - SwapU16(&color.c0,&color.c1); - } - res=(h2-h1)*(w2-w1); - } - break; - } - } - } else { - color_mask=gr.to_8_colors[color.c0.color]; - switch [color.c0.rop] { - case ROPB_EQU: - case ROPB_MONO: - if (win_z_buf_ptr) { - res=0; - for (j=h1;jbody+kk1&~7; - if (leading_pixels) { - if (win_z_num>=*win_z_buf_ptr++) { - *dst(I64 *)=*dst(I64 *)&leading_pixel_mask| - color_mask&~leading_pixel_mask; - res+=leading_pixels; - } - dst(I64 *)++; - } - for (i=0;i=*win_z_buf_ptr++) { - *dst(I64 *)=color_mask; - res+=8; - } - if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) { - *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| - color_mask&~trailing_pixel_mask; - res+=trailing_pixels; - } - if ((j+y)&7==7) - win_z_buf_ptr(U8 *)+=win_z_buf_line_inc; - else - win_z_buf_ptr(U8 *)-=win_z_buf_line_dec; - kk1+=dc->width_internal; - } - } else { - for (j=h2-h1;j;j--) { - dst(I64 *)=dc->body+kk1&~7; - if (leading_pixels) - *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| - color_mask&~leading_pixel_mask; - for (i=0;iwidth_internal; - } - res=(h2-h1)*(w2-w1); - } - break; - case ROPB_XOR: - if (win_z_buf_ptr) { - res=0; - for (j=h1;jbody+kk1&~7; - if (leading_pixels) { - if (win_z_num>=*win_z_buf_ptr++) { - *dst(I64 *)=*dst(I64 *)&leading_pixel_mask| - *dst(I64 *)^color_mask&~leading_pixel_mask; - res+=leading_pixels; - } - dst(I64 *)++; - } - for (i=0;i=*win_z_buf_ptr++) { - *dst(I64 *)^=color_mask; - res+=8; - } - if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) { - *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| - *dst(I64 *)^color_mask&~trailing_pixel_mask; - res+=trailing_pixels; - } - if ((j+y)&7==7) - win_z_buf_ptr(U8 *)+=win_z_buf_line_inc; - else - win_z_buf_ptr(U8 *)-=win_z_buf_line_dec; - kk1+=dc->width_internal; - } - } else { - for (j=h2-h1;j;j--) { - dst=dc->body+kk1&~7; - if (leading_pixels) - *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| - *dst(I64 *)^color_mask&~leading_pixel_mask; - for (i=0;iwidth_internal; - } - res=(h2-h1)*(w2-w1); - } - break; - } - } - } - } - return res; -} - -I64 GrRayLenMinus(CDC *dc,I64 x,I64 y) -{ -//Returns cnt of pixs changed - I64 res=0,c,x3,y3,d; - U8 *dst,*dst2; - Bool not_color=ToBool(dc->flags&DCF_FILL_NOT_COLOR); - CTask *win_task; - - if (dc->flags & DCF_SCREEN_BITMAP) { - win_task=dc->win_task; - x+=win_task->scroll_x; - y+=win_task->scroll_y; - } - x3=x; - y3=y; - if (x3<0 || y3<0) - goto gr_done; - if (dc->flags & DCF_SCREEN_BITMAP) { - x3+=win_task->pix_left; - y3+=win_task->pix_top; - if (!(0<=x3<=win_task->pix_right) || !(0<=y3<=win_task->pix_bottom) || - !(dc->flags&DCF_ON_TOP) && IsPixCovered0(win_task,x3,y3)) - goto gr_done; - } - if (x3>=dc->width || y3>=dc->height) - goto gr_done; - - d=y3*dc->width_internal; - dst2=dc->body+d; - while (TRUE) { - x3=x; - if (x3&(FONT_WIDTH-1)==FONT_WIDTH-1) { - if (dc->flags & DCF_SCREEN_BITMAP) { - if (x3<0) break; - x3+=win_task->pix_left; - if (!(0<=x3<=win_task->pix_right) || x3>=dc->width || - !(dc->flags&DCF_ON_TOP) && IsPixCovered0(win_task,x3,y3)) - break; - } else - if (!(0<=x3width)) - break; - } else if (dc->flags & DCF_SCREEN_BITMAP) - x3+=win_task->pix_left; - dst=dst2+x3; - c=*dst; - if (not_color) { - if (c!=dc->color2) { - res++; - x--; - } else - break; - } else { - if (c==dc->color2) { - res++; - x--; - } else - break; - } - } - return res; -gr_done: - return 0; -} - -I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL) -{ -//Returns cnt of pixs changed - I64 res=0,d,x=*x1,x2,x3,y3,dist; - Bool plot,dither,probability_dither, - not_color=ToBool(dc->flags&DCF_FILL_NOT_COLOR); - U8 *dst,*dst2; - CColorROPU32 c,c2,color=dc->color,bkcolor=dc->bkcolor; - I32 *db2; - CTask *win_task; - - if (dc->flags & DCF_SCREEN_BITMAP) { - win_task=dc->win_task; - x+=win_task->scroll_x; - y+=win_task->scroll_y; - z+=win_task->scroll_z; - } - x2=x; - x3=x; - y3=y; - if (x3<0 || y3<0) - goto gr_done; - if (dc->flags & DCF_SCREEN_BITMAP) { - x3+=win_task->pix_left; - y3+=win_task->pix_top; - if (!(0<=x3<=win_task->pix_right) || !(0<=y3<=win_task->pix_bottom) || - !(dc->flags&DCF_ON_TOP) && IsPixCovered0(win_task,x3,y3)) - goto gr_done; - } - if (x3>=dc->width || y3>=dc->height) - goto gr_done; - - d=dc->width_internal*y3; - if (db) db+=d; - - color=dc->color; - 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; - } else { - probability_dither=FALSE; - color.c1.rop=color.c0.rop; - } - } else - dither=FALSE; - dst2=dc->body+d; - while (TRUE) { - x3=x; - if (!(x3&(FONT_WIDTH-1))) { - if (dc->flags & DCF_SCREEN_BITMAP) { - if (x3<0) break; - x3+=win_task->pix_left; - if (!(0<=x3<=win_task->pix_right) || x3>=dc->width || - !(dc->flags&DCF_ON_TOP) && IsPixCovered0(win_task,x3,y3)) - break; - } else { - if (!(0<=x3width)) - break; - } - } else if (dc->flags & DCF_SCREEN_BITMAP) - x3+=win_task->pix_left; - - dst=dst2+x3; - - c=*dst; - if (db) { - db2=db+x3; - if (0<=z<=*db2) { - *db2=z; - plot=TRUE; - } else - plot=FALSE; - } else - plot=TRUE; - - if ((not_color && c!=dc->color2 || - !not_color && c==dc->color2) && plot) { - if (dc->flags & DCF_LOCATE_NEAREST) { - dist=DistSqrI64(x3,y3,dc->cur_x,dc->cur_y); - if (dist<=dc->nearest_dist) { - dc->nearest_dist=dist; - dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num; - } - } - if (dc->flags & DCF_RECORD_EXTENTS) { - if (x3min_x) dc->min_x=x3; - if (x3>dc->max_x) dc->max_x=x3; - if (y3min_y) dc->min_y=y3; - if (y3>dc->max_y) dc->max_y=y3; - } - dst=dst2+x3; - - c=color.c0.color; - if (dither) { - if (probability_dither) { - if (RandU16dither_probability_u16) - c=color.c1.color; - } else - if ((x3^y3)&1) - c=color.c1.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++; - x++; - } else - break; - } - if (dc->flags & DCF_SCREEN_BITMAP) - *x1=x-1-win_task->scroll_x; - else - *x1=x-1; - x=x2-1; - while (TRUE) { - x3=x; - if (x3&(FONT_WIDTH-1)==FONT_WIDTH-1) { - if (dc->flags & DCF_SCREEN_BITMAP) { - if (x3<0) break; - x3+=win_task->pix_left; - if (!(0<=x3<=win_task->pix_right) || x3>=dc->width || - !(dc->flags&DCF_ON_TOP) && IsPixCovered0(win_task,x3,y3)) - break; - } else - if (!(0<=x3width)) - break; - } else if (dc->flags & DCF_SCREEN_BITMAP) - x3+=win_task->pix_left; - - dst=dst2+x3; - c=*dst; - if (db) { - db2=db+x3; - if (0<=z<=*db2) { - *db2=z; - plot=TRUE; - } else - plot=FALSE; - } else - plot=TRUE; - - if ((not_color && c!=dc->color2 || - !not_color && c==dc->color2) && plot) { - if (dc->flags & DCF_LOCATE_NEAREST) { - dist=DistSqrI64(x3,y3,dc->cur_x,dc->cur_y); - if (dist<=dc->nearest_dist) { - dc->nearest_dist=dist; - dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num; - } - } - if (dc->flags & DCF_RECORD_EXTENTS) { - if (x3min_x) dc->min_x=x3; - if (x3>dc->max_x) dc->max_x=x3; - if (y3min_y) dc->min_y=y3; - if (y3>dc->max_y) dc->max_y=y3; - } - dst=dst2+x3; - - c=color.c0.color; - if (dither) { - if (probability_dither) { - if (RandU16dither_probability_u16) - c=color.c1.color; - } else - if ((x3^y3)&1) - c=color.c1.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++; - x--; - } else - break; - } - return res; -gr_done: - return 0; -} - -public I64 GrHLine(CDC *dc=gr.dc,I64 x1,I64 x2,I64 y,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,dx,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 (x2flags & DCF_SCREEN_BITMAP) { - win_task=dc->win_task; - x1+=win_task->scroll_x; - x2+=win_task->scroll_x; - y +=win_task->scroll_y; - z1+=win_task->scroll_z; - z2+=win_task->scroll_z; - } - if (dc->flags & DCF_RECORD_EXTENTS) { - if (x1min_x) dc->min_x=x1; - if (x1>dc->max_x) dc->max_x=x1; - if (x2min_x) dc->min_x=x2; - if (x2>dc->max_x) dc->max_x=x2; - if (ymin_y) dc->min_y=y; - if (y>dc->max_y) dc->max_y=y; - } - if (y<0) goto gr_done; - if (x2flags & DCF_SCREEN_BITMAP) { - x1+=win_task->pix_left; - x2+=win_task->pix_left; - if (x1>win_task->pix_right) - goto gr_done; - if (x2>win_task->pix_right) { - j=x2-win_task->pix_right; - x2=win_task->pix_right; - } - y+=win_task->pix_top; - if (!(0<=y<=win_task->pix_bottom) || x2<0) - goto gr_done; - } - if (x1>=dc->width || y>=dc->height) - goto gr_done; - dx=x2+j-(x1-i); - d=dc->width_internal*y+x1; - if (db=dc->depth_buf) { - db+=d; - if (dx) - dz=(z2-z1)<<32/dx; - else - dz=0; - z=z1<<32; - } - if (i) - z+=i*dz; - if (x2>=dc->width) - x2=dc->width-1; - - if (dc->flags & DCF_LOCATE_NEAREST) { - if (x1<=dc->cur_x<=x2) - dist=0; - else if (dc->cur_xcur_x); - else - dist=SqrI64(dc->cur_x-x2); - dist+=SqrI64(y-dc->cur_y); - 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,x1,y)) - 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 (RandU16dither_probability_u16) - color.c0=dither_colors.c1; - else - color.c0=dither_colors.c0; - } else { - probability_dither=FALSE; - color.c1.rop=color.c0.rop; - if ((x1^y)&1) - SwapU16(&color.c0,&color.c1); - } - } else - dither=FALSE; - while (x1<=x2) { - 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 (RandU16dither_probability_u16) - color.c0=dither_colors.c1; - else - color.c0=dither_colors.c0; - } else - SwapU16(&color.c0,&color.c1); - } - d++; - x1++; - if (db) - db++; - z+=dz; - if (!(x1&(FONT_WIDTH-1)) && x1<=x2) { - if (!(dc->flags & DCF_SCREEN_BITMAP)|| - win_task->next_task==sys_winmgr_task || - dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x1,y)) - char_clear=TRUE; - else - char_clear=FALSE; - } - } -gr_done: - 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 (y2flags & 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 (xmin_x) dc->min_x=x; - if (x>dc->max_x) dc->max_x=x; - if (y1min_y) dc->min_y=y1; - if (y1>dc->max_y) dc->max_y=y1; - if (y2min_y) dc->min_y=y2; - if (y2>dc->max_y) dc->max_y=y2; - } - if (x<0) goto gr_done; - if (y2flags & 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_ycur_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 (RandU16dither_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 (RandU16dither_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; -} diff --git a/Adam/Gr/GrBitMap.HC b/Adam/Gr/GrBitMap.HC new file mode 100644 index 0000000..9d2ada4 --- /dev/null +++ b/Adam/Gr/GrBitMap.HC @@ -0,0 +1,1983 @@ +#help_index "Graphics" + +Option(OPTf_WARN_HEADER_MISMATCH,OFF); +public Bool GrPlot0(CDC *dc=gr.dc,I64 x,I64 y) +{//2D. No clipping or transformation or pen width. + U8 *dst; + I32 *db; + I64 d,dist; + CColorROPU32 c,color=dc->color,bkcolor=dc->bkcolor; + + if (dc->flags & DCF_LOCATE_NEAREST) { + dist=DistSqrI64(x,y,dc->cur_x,dc->cur_y); + if (dist<=dc->nearest_dist) { + dc->nearest_dist=dist; + dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num; + } + } + if (dc->flags & DCF_RECORD_EXTENTS) { + if (xmin_x) dc->min_x=x; + if (x>dc->max_x) dc->max_x=x; + if (ymin_y) dc->min_y=y; + if (y>dc->max_y) dc->max_y=y; + } + if (dc->flags & DCF_DONT_DRAW) + return TRUE; + d=dc->width_internal*y+x; + if (db=dc->depth_buf) { + db+=d; + if (0<=dc->db_z<=*db) + *db=dc->db_z; + else + return TRUE; + } + if (color.c1.rop&(ROPBF_DITHER|ROPBF_PROBABILITY_DITHER)) { + if (color.c1.rop&ROPBF_PROBABILITY_DITHER) { + if (RandU16dither_probability_u16) { + color.c1.rop=color.c0.rop; + color.c0=color.c1; + } + } else { + if ((x^y)&1) { + color.c1.rop=color.c0.rop; + color.c0=color.c1; + } + } + } + dst=dc->body+d; + switch [color.c0.rop] { + case ROPB_EQU: + case ROPB_MONO: + *dst=color.c0.color; + break; + case ROPB_COLLISION: + c=*dst; + if (c!=TRANSPARENT && c!=bkcolor.c0.color) + dc->collision_cnt++; + break; + case ROPB_XOR: + *dst^=color.c0.color; + break; + } + return TRUE; +} +Option(OPTf_WARN_HEADER_MISMATCH,ON); + +public I64 GrPeek0(CDC *dc=gr.dc,I64 x,I64 y) +{//2D. No clipping or transformation. + return dc->body[dc->width_internal*y+x]; +} + +#help_index "Graphics;Graphics/Device Contexts" + +public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img) +{//2D. Clipping but not transformation.. + I64 i,j,k,k1,kk,kk1,w1,h1,w2,h2,dist, + leading_pixels,leading_pixel_mask,whole_I64s, + trailing_pixels,trailing_pixel_mask, + reg bit_shift,win_z_buf_line_inc,win_z_buf_line_dec,win_z_num, + color_mask; + U8 reg *dst,*src; + I32 *db; + U16 reg *win_z_buf_ptr; + CColorROPU32 color,c,old_color; + CTask *win_task; + + if (dc->flags & DCF_SCREEN_BITMAP) { + win_task=dc->win_task; + x+=win_task->scroll_x; + y+=win_task->scroll_y; + } + if (x<0) + w1=-x; + else + w1=0; + if (y<0) + h1=-y; + else + h1=0; + w2=img->width; + h2=img->height; + if (dc->flags & DCF_SCREEN_BITMAP) { + x+=win_task->pix_left; + y+=win_task->pix_top; + } + if (dc->flags & DCF_LOCATE_NEAREST) { + dist=DistSqrI64(x+img->width>>1,y+img->height>>1,dc->cur_x,dc->cur_y); + if (dist<=dc->nearest_dist) { + dc->nearest_dist=dist; + dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num; + } + } + if (dc->flags & DCF_SCREEN_BITMAP) { + if (x+w1<0) w1=-x; + if (x+w2>win_task->pix_right+1) + w2=win_task->pix_right+1-x; + + if (y+h1<0) h1=-y; + if (y+h2>win_task->pix_bottom+1) + h2=win_task->pix_bottom+1-y; + } + if (x+w2>dc->width) + w2=dc->width-x; + if (y+h2>dc->height) + h2=dc->height-y; + if (w1width && h1height) { + if (dc->flags & DCF_RECORD_EXTENTS) { + if (x+w1min_x) dc->min_x=x+w1; + if (x+w2-1>dc->max_x) dc->max_x=x+w2-1; + if (y+h1min_y) dc->min_y=y+h1; + if (y+h2-1>dc->max_y) dc->max_y=y+h2-1; + } + if (dc->flags & DCF_DONT_DRAW) + return 1; + old_color=dc->color; + db=dc->depth_buf; + dc->depth_buf=NULL; + dc->color&=~ROPF_DITHER; + color=dc->color; + leading_pixels=-(w1+x)&7; + leading_pixel_mask=gr.to_8_bits[0xFF>>leading_pixels]; + bit_shift=-x&7; + whole_I64s=(w2-w1-leading_pixels)>>3; + if (whole_I64s<0) whole_I64s=0; + trailing_pixels=(x+w2)&7; + trailing_pixel_mask=gr.to_8_bits[0xFF<w2-w1) { + leading_pixel_mask|=trailing_pixel_mask; + trailing_pixels=0; + } + switch (color.c0.rop) { + case ROPB_COLLISION: //TODO: Might want to check win_z_buf + color =dc->bkcolor.c0.color; + k=h1*img->width_internal; + k1=(h1+y)*dc->width_internal+x; + for (j=h2-h1;j;j--) { + for (i=w1;ibody[k1+i]; + if (c!=TRANSPARENT&&c!=color&&img->body[k+i]!=TRANSPARENT) + dc->collision_cnt++; + } + k+=img->width_internal; + k1+=dc->width_internal; + } + break; + case ROPB_MONO: + color_mask=gr.to_8_colors[color.c0.color]; + if (img->flags&DCF_NO_TRANSPARENTS) { + if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP) + win_z_buf_ptr=NULL; + else { + win_z_num=win_task->win_z_num; + win_z_buf_ptr=gr.win_z_buf(U8 *)+((h1+y)/FONT_HEIGHT*TEXT_COLS+ + (w1+x)/FONT_WIDTH)*sizeof(U16); + win_z_buf_line_dec=whole_I64s; + if (leading_pixels) + win_z_buf_line_dec++; + if (trailing_pixels) + win_z_buf_line_dec++; + win_z_buf_line_dec*=sizeof(U16); + win_z_buf_line_inc=TEXT_COLS*sizeof(U16)-win_z_buf_line_dec; + } + kk = h1 *img ->width_internal+w1; + kk1=(h1+y)*dc->width_internal+x+w1; + kk =(kk-bit_shift)&~7+bit_shift; + bit_shift*=8; + if (win_z_buf_ptr) + for (j=h1;jbody+kk&~7; + dst=dc->body+kk1&~7; + if (leading_pixels) { + if (win_z_num>=*win_z_buf_ptr++) { + if (bit_shift) + *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| + (*src(U64 *)++>>bit_shift| + *src(I64 *)<<(64-bit_shift))& + ~leading_pixel_mask&color_mask; + else + *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| + *src(I64 *)++&~leading_pixel_mask&color_mask; + } else { + src(I64 *)++; + dst(I64 *)++; + } + } + if (bit_shift) + for (i=0;i=*win_z_buf_ptr++) + *dst(I64 *)++=(*src(U64 *)++>>bit_shift| + *src(I64 *)<<(64-bit_shift))&color_mask; + else { + src(I64 *)++; + dst(I64 *)++; + } + else + for (i=0;i=*win_z_buf_ptr++) + *dst(I64 *)++=*src(I64 *)++&color_mask; + else { + src(I64 *)++; + dst(I64 *)++; + } + if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) { + if (bit_shift) + *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| + (*src(U64 *)++>>bit_shift| + *src(I64 *)<<(64-bit_shift))& + ~trailing_pixel_mask&color_mask; + else + *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| + *src(I64 *)++&~trailing_pixel_mask&color_mask; + } + kk +=img->width_internal; + kk1+=dc->width_internal; + if ((j+y)&7==7) + win_z_buf_ptr(U8 *)+=win_z_buf_line_inc; + else + win_z_buf_ptr(U8 *)-=win_z_buf_line_dec; + } + else + for (j=h2-h1;j;j--) { + src=img->body+kk&~7; + dst=dc->body+kk1&~7; + if (leading_pixels) { + if (bit_shift) + *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| + (*src(U64 *)++>>bit_shift| + *src(I64 *)<<(64-bit_shift))& + ~leading_pixel_mask&color_mask; + else + *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| + *src(I64 *)++&~leading_pixel_mask&color_mask; + } + if (bit_shift) + for (i=0;i>bit_shift| + *src(I64 *)<<(64-bit_shift))&color_mask; + else + for (i=0;i>bit_shift| + *src(I64 *)<<(64-bit_shift))& + ~trailing_pixel_mask&color_mask; + else + *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| + *src(I64 *)++&~trailing_pixel_mask&color_mask; + } + kk +=img->width_internal; + kk1+=dc->width_internal; + } + } else { + k=h1*img->width_internal; + if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP) { + for (j=h1;jbody[k+i]) + GrPlot0(dc,x+i,y+j); + k+=img->width_internal; + } + } else { + win_z_num =win_task->win_z_num; + win_z_buf_ptr =gr.win_z_buf(U8 *)+ + ((h1+y)/FONT_HEIGHT*TEXT_COLS+(w1+x)/FONT_WIDTH)*sizeof(U16); + win_z_buf_line_dec=whole_I64s; + if (leading_pixels) + win_z_buf_line_dec++; + if (trailing_pixels) + win_z_buf_line_dec++; + win_z_buf_line_dec*=sizeof(U16); + win_z_buf_line_inc=TEXT_COLS*sizeof(U16)-win_z_buf_line_dec; + for (j=h1;j=*win_z_buf_ptr++) + color_mask=TRUE; + else + color_mask=FALSE; + for (i=w1;ibody[k+i]) + GrPlot0(dc,x+i,y+j); + if (!((++i+x) &7) && i=*win_z_buf_ptr++) + color_mask=TRUE; + else + color_mask=FALSE; + } + } + if ((j+y)&7==7) + win_z_buf_ptr(U8 *)+=win_z_buf_line_inc; + else + win_z_buf_ptr(U8 *)-=win_z_buf_line_dec; + k+=img->width_internal; + } + } + } + break; + case ROPB_EQU: + if (img->flags&DCF_NO_TRANSPARENTS) { + if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP) + win_z_buf_ptr=NULL; + else { + win_z_num=win_task->win_z_num; + win_z_buf_ptr=gr.win_z_buf(U8 *)+ + ((h1+y)/FONT_HEIGHT*TEXT_COLS+(w1+x)/FONT_WIDTH)*sizeof(U16); + win_z_buf_line_dec=whole_I64s; + if (leading_pixels) + win_z_buf_line_dec++; + if (trailing_pixels) + win_z_buf_line_dec++; + win_z_buf_line_dec*=sizeof(U16); + win_z_buf_line_inc=TEXT_COLS*sizeof(U16)-win_z_buf_line_dec; + } + kk = h1 *img ->width_internal+w1; + kk1=(h1+y)*dc->width_internal+x+w1; + kk =(kk-bit_shift)&~7+bit_shift; + bit_shift*=8; + if (win_z_buf_ptr) + for (j=h1;jbody+kk&~7; + dst=dc->body+kk1&~7; + if (leading_pixels) { + if (win_z_num>=*win_z_buf_ptr++) { + if (bit_shift) + *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| + (*src(U64 *)++>>bit_shift| + *src(I64 *)<<(64-bit_shift))&~leading_pixel_mask; + else + *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| + *src(I64 *)++&~leading_pixel_mask; + } else { + src(I64 *)++; + dst(I64 *)++; + } + } + if (bit_shift) + for (i=0;i=*win_z_buf_ptr++) + *dst(I64 *)++=*src(U64 *)++>>bit_shift| + *src(I64 *)<<(64-bit_shift); + else { + src(I64 *)++; + dst(I64 *)++; + } + else + for (i=0;i=*win_z_buf_ptr++) + *dst(I64 *)++=*src(I64 *)++; + else { + src(I64 *)++; + dst(I64 *)++; + } + if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) { + if (bit_shift) + *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| + (*src(U64 *)++>>bit_shift| + *src(I64 *)<<(64-bit_shift))&~trailing_pixel_mask; + else + *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| + *src(I64 *)++&~trailing_pixel_mask; + } + kk +=img->width_internal; + kk1+=dc->width_internal; + if ((j+y)&7==7) + win_z_buf_ptr(U8 *)+=win_z_buf_line_inc; + else + win_z_buf_ptr(U8 *)-=win_z_buf_line_dec; + } + else + for (j=h2-h1;j;j--) { + src=img->body+kk&~7; + dst=dc->body+kk1&~7; + if (leading_pixels) { + if (bit_shift) + *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| + (*src(U64 *)++>>bit_shift| + *src(I64 *)<<(64-bit_shift))&~leading_pixel_mask; + else + *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| + *src(I64 *)++&~leading_pixel_mask; + } + if (bit_shift) + for (i=0;i>bit_shift| + *src(I64 *)<<(64-bit_shift); + else + for (i=0;i>bit_shift| + *src(I64 *)<<(64-bit_shift))&~trailing_pixel_mask; + else + *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| + *src(I64 *)++&~trailing_pixel_mask; + } + kk +=img->width_internal; + kk1+=dc->width_internal; + } + } else { +here1a: + k=h1*img->width_internal; + if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP) { + for (j=h1;jbody[k+i]; + if (c!=TRANSPARENT) { + dc->color.c0.color=c; + GrPlot0(dc,x+i,y+j); + } + } + k+=img->width_internal; + } + } else { + win_z_num =win_task->win_z_num; + win_z_buf_ptr =gr.win_z_buf(U8 *)+ + ((h1+y)/FONT_HEIGHT*TEXT_COLS+(w1+x)/FONT_WIDTH)*sizeof(U16); + win_z_buf_line_dec=whole_I64s; + if (leading_pixels) + win_z_buf_line_dec++; + if (trailing_pixels) + win_z_buf_line_dec++; + win_z_buf_line_dec*=sizeof(U16); + win_z_buf_line_inc=TEXT_COLS*sizeof(U16)-win_z_buf_line_dec; + for (j=h1;j=*win_z_buf_ptr++) + color_mask=TRUE; + else + color_mask=FALSE; + for (i=w1;ibody[k+i]; + if (c!=TRANSPARENT) { + dc->color.c0.color=c; + GrPlot0(dc,x+i,y+j); + } + } + if (!((++i+x) &7) && i=*win_z_buf_ptr++) + color_mask=TRUE; + else + color_mask=FALSE; + } + } + if ((j+y)&7==7) + win_z_buf_ptr(U8 *)+=win_z_buf_line_inc; + else + win_z_buf_ptr(U8 *)-=win_z_buf_line_dec; + k+=img->width_internal; + } + } + dc->color=color; + } + break; + case ROPB_XOR: + if (img->flags&DCF_NO_TRANSPARENTS) { + if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP) + win_z_buf_ptr=NULL; + else { + win_z_num=win_task->win_z_num; + win_z_buf_ptr=gr.win_z_buf(U8 *)+ + ((h1+y)/FONT_HEIGHT*TEXT_COLS+(w1+x)/FONT_WIDTH)*sizeof(U16); + win_z_buf_line_dec=whole_I64s; + if (leading_pixels) + win_z_buf_line_dec++; + if (trailing_pixels) + win_z_buf_line_dec++; + win_z_buf_line_dec*=sizeof(U16); + win_z_buf_line_inc=TEXT_COLS*sizeof(U16)-win_z_buf_line_dec; + } + kk = h1 *img ->width_internal +w1; + kk1=(h1+y)*dc->width_internal+x+w1; + kk =(kk-bit_shift)&~7+bit_shift; + bit_shift*=8; + if (win_z_buf_ptr) + for (j=h1;jbody+kk&~7; + dst=dc->body+kk1&~7; + if (leading_pixels) { + if (win_z_num>=*win_z_buf_ptr++) { + if (bit_shift) + *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| + (*dst(I64 *)^(*src(U64 *)++>>bit_shift| + *src(I64 *)<<(64-bit_shift)))&~leading_pixel_mask; + else + *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| + (*dst(I64 *)^*src(I64 *)++)&~leading_pixel_mask; + } else { + src(I64 *)++; + dst(I64 *)++; + } + } + if (bit_shift) + for (i=0;i=*win_z_buf_ptr++) + *dst(I64 *)++^=*src(U64 *)++>>bit_shift| + *src(I64 *)<<(64-bit_shift); + else { + src(I64 *)++; + dst(I64 *)++; + } + else + for (i=0;i=*win_z_buf_ptr++) + *dst(I64 *)++^=*src(I64 *)++; + else { + src(I64 *)++; + dst(I64 *)++; + } + if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) { + if (bit_shift) + *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| + (*dst(I64 *)^(*src(U64 *)++>>bit_shift| + *src(I64 *)<<(64-bit_shift)))&~trailing_pixel_mask; + else + *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| + (*dst(I64 *)^*src(I64 *)++)&~trailing_pixel_mask; + } + kk +=img->width_internal; + kk1+=dc->width_internal; + if ((j+y)&7==7) + win_z_buf_ptr(U8 *)+=win_z_buf_line_inc; + else + win_z_buf_ptr(U8 *)-=win_z_buf_line_dec; + } + else + for (j=h2-h1;j;j--) { + src=img->body+kk&~7; + dst=dc->body+kk1&~7; + if (leading_pixels) { + if (bit_shift) + *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| + (*dst(I64 *)^(*src(U64 *)++>>bit_shift| + *src(I64 *)<<(64-bit_shift)))&~leading_pixel_mask; + else + *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| + (*dst(I64 *)^*src(I64 *)++)&~leading_pixel_mask; + } + if (bit_shift) + for (i=0;i>bit_shift| + *src(I64 *)<<(64-bit_shift); + else + for (i=0;i>bit_shift| + *src(I64 *)<<(64-bit_shift)))&~trailing_pixel_mask; + else + *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| + (*dst(I64 *)^*src(I64 *)++)&~trailing_pixel_mask; + } + kk +=img->width_internal; + kk1+=dc->width_internal; + } + } else + goto here1a; + break; + } + dc->depth_buf=db; + dc->color=old_color; + return 1; + } else + return 0; +} + +#help_index "Graphics/Device Contexts" + +U8 *GrBitMap4ToBitMap8(U8 *dst,U8 *src,I64 src_size,I64 bkcolor) +{ + I64 c,k,i=src_size*2,i1=i>>3; + for (k=0;kx2) SwapI64(&x1,&x2); + if (y1>y2) SwapI64(&y1,&y2); + if (dc->flags & DCF_SCREEN_BITMAP) { + win_task=dc->win_task; + x1+=win_task->pix_left+win_task->scroll_x; + y1+=win_task->pix_top +win_task->scroll_y; + x2+=win_task->pix_left+win_task->scroll_x; + y2+=win_task->pix_top +win_task->scroll_y; + } + res=DCNew(x2-x1+1,y2-y1+1,task); + DCFill(res); + GrBlot(res,-x1,-y1,dc); + return res; +} + +#help_index "Graphics/Char;Char/Graphics" + +public I64 GrPutChar(CDC *dc=gr.dc,I64 x,I64 y,U8 ch) +{//2D. Clipping but not transformation. + U8 reg *src,reg *dst,*font_ptr; + I64 i,m,leading_pixels,trailing_pixels,leading_pixel_mask,trailing_pixel_mask, + j,k1,kk1,w1,h1,w2,h2,reg bit_shift,reg color_mask,dist; + CColorROPU32 color,c; + CTask *win_task; + + if (dc->flags & DCF_SCREEN_BITMAP) { + win_task=dc->win_task; + x+=win_task->scroll_x; + y+=win_task->scroll_y; + } + + if (x<0) + w1=-x; + else + w1=0; + if (y<0) + h1=-y; + else + h1=0; + w2=FONT_WIDTH; + h2=FONT_HEIGHT; + + if (dc->flags & DCF_SCREEN_BITMAP) { + x+=win_task->pix_left; + y+=win_task->pix_top; + } + if (dc->flags & DCF_LOCATE_NEAREST) { + dist=DistSqrI64(x+w2>>1,y+h2>>1,dc->cur_x,dc->cur_y); + if (dist<=dc->nearest_dist) { + dc->nearest_dist=dist; + dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num; + } + } + if (dc->flags & DCF_SCREEN_BITMAP) { + if (x+w1<0) w1=-x; + if (x+w2>win_task->pix_right+1) + w2=win_task->pix_right+1-x; + + if (y+h1<0) h1=-y; + if (y+h2>win_task->pix_bottom+1) + h2=win_task->pix_bottom+1-y; + } + if (x+w2>dc->width) + w2=dc->width-x; + if (y+h2>dc->height) + h2=dc->height-y; + if (w1flags & DCF_RECORD_EXTENTS) { + if (x+w1 min_x) dc->min_x=x+w1; + if (x+w2-1>dc->max_x) dc->max_x=x+w2-1; + if (y+h1 min_y) dc->min_y=y+h1; + if (y+h2-1>dc->max_y) dc->max_y=y+h2-1; + } + if (dc->flags & DCF_DONT_DRAW) + return 1; + color=dc->color; + leading_pixels=-(w1+x)&7; + if (!leading_pixels) leading_pixels=8; + leading_pixel_mask=gr.to_8_bits[0xFF>>leading_pixels]; + bit_shift=-x&7; + trailing_pixels=(x+w2)&7; + trailing_pixel_mask=gr.to_8_bits[0xFF<w2-w1) { + leading_pixel_mask|=trailing_pixel_mask; + trailing_pixels=0; + } + font_ptr=&text.font(U8 *)[FONT_HEIGHT*ch+h1]; + if (color.c0.rop==ROPB_COLLISION) { + m=w1&(FONT_WIDTH-1); +#assert FONT_WIDTH==8 + color =dc->bkcolor.c0.color; + for (i=w1;iwidth_internal+x; + src=font_ptr; + for (j=h2-h1;j;j--) { + c=dc->body[k1+i]; + if (c!=TRANSPARENT && c!=color && Bt(src,m)) + dc->collision_cnt++; + k1+=dc->width_internal; + src++; + } + } + } else { + color_mask=gr.to_8_colors[color.c0.color]; + k1=x+w1; + kk1=(h1+y)*dc->width_internal+k1; + if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP) { + if (leading_pixels) { + dst=dc->body+kk1&~7; + src=font_ptr; + if (bit_shift) + src--; + switch [color.c0.rop] { + case ROPB_EQU: + case ROPB_MONO: + for (j=h2-h1;j;j--) { + m=gr.to_8_bits[*src(U16 *)>>bit_shift&0xFF]; + *dst(I64 *)=*dst(I64 *)&leading_pixel_mask| + (color_mask&m|*dst(I64 *)&~m)&~leading_pixel_mask; + src++; + dst+=dc->width_internal; + } + break; + case ROPB_XOR: + if (color_mask) { + for (j=h2-h1;j;j--) { + *dst(I64 *)=*dst(I64 *)&leading_pixel_mask| + (*dst(I64 *)^gr.to_8_bits[*src(U16 *)>>bit_shift&0xFF])& + ~leading_pixel_mask; + src++; + dst+=dc->width_internal; + } + } + break; + } + kk1+=8; + } + if (trailing_pixels) { + dst=dc->body+kk1&~7; + src=font_ptr+1; + if (bit_shift) + src--; + switch [color.c0.rop] { + case ROPB_EQU: + case ROPB_MONO: + for (j=h2-h1;j;j--) { + m=gr.to_8_bits[*src(U16 *)>>bit_shift&0xFF]; + *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| + (color_mask&m|*dst(I64 *)&~m)&~trailing_pixel_mask; + src++; + dst+=dc->width_internal; + } + break; + case ROPB_XOR: + if (color_mask) + for (j=h2-h1;j;j--) { + *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| + (*dst(I64 *)^gr.to_8_bits[*src(U16 *)>>bit_shift&0xFF])& + ~trailing_pixel_mask; + src++; + dst+=dc->width_internal; + } + break; + } + } + } else { + if (leading_pixels) { + dst=dc->body+kk1&~7; + src=font_ptr; + if (bit_shift) + src--; + switch [color.c0.rop] { + case ROPB_EQU: + case ROPB_MONO: + for (j=h1;j>bit_shift&0xFF]; + *dst(I64 *)=*dst(I64 *)&leading_pixel_mask| + (color_mask&m|*dst(I64 *)&~m)&~leading_pixel_mask; + } + src++; + dst+=dc->width_internal; + } + break; + case ROPB_XOR: + if (color_mask) + for (j=h1;j>bit_shift&0xFF])& + ~leading_pixel_mask; + src++; + dst+=dc->width_internal; + } + break; + } + k1+=8; + kk1+=8; + } + if (trailing_pixels) { + dst=dc->body+kk1&~7; + src=font_ptr+1; + if (bit_shift) + src--; + switch [color.c0.rop] { + case ROPB_EQU: + case ROPB_MONO: + for (j=h1;j>bit_shift&0xFF]; + *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| + (color_mask&m|*dst(I64 *)&~m)&~trailing_pixel_mask; + } + src++; + dst+=dc->width_internal; + } + break; + case ROPB_XOR: + if (color_mask) + for (j=h1;j>bit_shift&0xFF])& + ~trailing_pixel_mask; + src++; + dst+=dc->width_internal; + } + break; + } + } + } + } + return 1; + } else + return 0; +} + +I64 GrPutS(CDC *dc=gr.dc,I64 x,I64 y,U8 *_s) +{//Use $LK,"GrPrint",A="MN:GrPrint"$() + I64 x0,ch,res; + if (!_s) return 0; + x0=x; + res=0; + while (ch=*_s++) { + if (ch=='\n') { + x=x0; + y+=FONT_HEIGHT; + } else if (ch=='\t') + x=x0+CeilU64(x-x0+FONT_WIDTH,8*FONT_WIDTH); + else { + res+=GrPutChar(dc,x,y,ch); + x+=FONT_WIDTH; + } + } + return res; +} + +I64 GrVPutS(CDC *dc=gr.dc,I64 x,I64 y,U8 *_s) +{//Vertical Text. Use $LK,"GrVPrint",A="MN:GrVPrint"$() + I64 y0,res; + U8 buf[2]; + if (!_s) return 0; + y0=y; + res=0; + + buf[1]=0; + while (*buf=*_s++) { + if (*buf=='\n') { + y=y0; + x+=FONT_WIDTH; + } else if (*buf=='\t') + y=y0+CeilU64(y-y0+FONT_HEIGHT,8*FONT_HEIGHT); + else { + res+=GrPutS(dc,x,y,buf); + y+=FONT_HEIGHT; + } + } + return res; +} + +public I64 GrPrint(CDC *dc=gr.dc,I64 x,I64 y,U8 *fmt,...) +{//2D. Clipping but not transformation. + I64 res; + U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); + res=GrPutS(dc,x,y,buf); + Free(buf); + return res; +} + +public I64 GrVPrint(CDC *dc=gr.dc,I64 x,I64 y,U8 *fmt,...) +{//2D. Vertical text. Clipping but not transformation. + I64 res; + U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); + res=GrVPutS(dc,x,y,buf); + Free(buf); + return res; +} + +#help_index "Graphics" +public I64 GrRect(CDC *dc=gr.dc,I64 x,I64 y,I64 w,I64 h) +{//2D. Width Height. Clipping but not transformation. +//Returns cnt of pixs changed. + I64 i,res=0,j,k1,kk1,w1,h1,w2,h2,dist, + leading_pixels,original_leading_pixels,whole_I64s, + trailing_pixels,leading_pixel_mask,trailing_pixel_mask, + win_z_buf_line_inc,win_z_buf_line_dec,win_z_num,color_mask; + U8 reg *dst; + U16 reg *win_z_buf_ptr; + CColorROPU32 color,c,dither_colors; + Bool dither,probability_dither; + CTask *win_task; + + if (dc->flags & DCF_SCREEN_BITMAP) { + win_task=dc->win_task; + x+=win_task->scroll_x; + y+=win_task->scroll_y; + } + + if (x<0) + w1=-x; + else + w1=0; + if (y<0) + h1=-y; + else + h1=0; + w2=w; + h2=h; + + if (dc->flags & DCF_SCREEN_BITMAP) { + x+=win_task->pix_left; + y+=win_task->pix_top; + } + if (dc->flags & DCF_LOCATE_NEAREST) {//TODO:Untested + if (x<=dc->cur_x<=x+w && y<=dc->cur_y<=y+h) + dist=0; + else + dist=DistSqrI64(x+w>>1,y+h>>1,dc->cur_x,dc->cur_y); + if (dist<=dc->nearest_dist) { + dc->nearest_dist=dist; + dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num; + } + } + if (dc->flags & DCF_SCREEN_BITMAP) { + if (x+w1<0) w1=-x; + if (x+w2>win_task->pix_right+1) + w2=win_task->pix_right+1-x; + + if (y+h1<0) h1=-y; + if (y+h2>win_task->pix_bottom+1) + h2=win_task->pix_bottom+1-y; + } + if (x+w2>dc->width) + w2=dc->width-x; + if (y+h2>dc->height) + h2=dc->height-y; + if (w1flags & DCF_RECORD_EXTENTS) { + if (x+w1 min_x) dc->min_x=x+w1; + if (x+w2-1>dc->max_x) dc->max_x=x+w2-1; + if (y+h1 min_y) dc->min_y=y+h1; + if (y+h2-1>dc->max_y) dc->max_y=y+h2-1; + } + if (dc->flags & DCF_DONT_DRAW) + return TRUE; + color=dc->color; + 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; + } else { + probability_dither=FALSE; + color.c1.rop=color.c0.rop; + } + } else + dither=FALSE; + original_leading_pixels=leading_pixels=-(w1+x)&7; + leading_pixel_mask=gr.to_8_bits[0xFF>>leading_pixels]; + whole_I64s=(w2-w1-leading_pixels)>>3; + if (whole_I64s<0) whole_I64s=0; + trailing_pixels=(x+w2)&7; + trailing_pixel_mask=gr.to_8_bits[0xFF<w2-w1) { + leading_pixel_mask|=trailing_pixel_mask; + leading_pixels=w2-w1; //Correct so it's right for res. + trailing_pixels=0; + } + if (color.c0.rop==ROPB_COLLISION) {//TODO: Might want to check win_z_buf + color =dc->bkcolor.c0.color; + k1=(h1+y)*dc->width_internal+x; + res=-dc->collision_cnt; + for (j=h2-h1;j;j--) { + for (i=w1;ibody[k1+i]; + if (c!=TRANSPARENT && c!=color) + dc->collision_cnt++; + } + k1+=dc->width_internal; + } + res+=dc->collision_cnt; + } else { + if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP) + win_z_buf_ptr=NULL; + else { + win_z_num=win_task->win_z_num; + win_z_buf_ptr=gr.win_z_buf(U8 *)+((h1+y)/FONT_HEIGHT*TEXT_COLS+ + (w1+x)/FONT_WIDTH)*sizeof(U16); + win_z_buf_line_dec=whole_I64s; + if (leading_pixels) + win_z_buf_line_dec++; + if (trailing_pixels) + win_z_buf_line_dec++; + win_z_buf_line_dec*=sizeof(U16); + win_z_buf_line_inc=TEXT_COLS*sizeof(U16)-win_z_buf_line_dec; + } + kk1=(h1+y)*dc->width_internal+x+w1; + if (dither) { + if (probability_dither) { + if (RandU16dither_probability_u16) + color.c0=dither_colors.c1; + else + color.c0=dither_colors.c0; + switch [color.c0.rop] { + case ROPB_EQU: + case ROPB_MONO: + if (win_z_buf_ptr) { + res=0; + for (j=h1;jbody+kk1&~7; + if (leading_pixels) { + if (win_z_num>=*win_z_buf_ptr++) { + *dst(I64 *)=*dst(I64 *)&leading_pixel_mask| + color_mask&~leading_pixel_mask; + res+=leading_pixels; + } + dst(I64 *)++; + } + for (i=0;i=*win_z_buf_ptr++) { + *dst(I64 *)=color_mask; + res+=8; + } + if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) { + *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| + color_mask&~trailing_pixel_mask; + res+=trailing_pixels; + } + if ((j+y)&7==7) + win_z_buf_ptr(U8 *)+=win_z_buf_line_inc; + else + win_z_buf_ptr(U8 *)-=win_z_buf_line_dec; + kk1+=dc->width_internal; + if (RandU16dither_probability_u16) + color.c0=dither_colors.c1; + else + color.c0=dither_colors.c0; + } + } else { + for (j=h2-h1;j;j--) { + color_mask=gr.to_8_colors[color.c0.color]; + dst=dc->body+kk1&~7; + if (leading_pixels) + *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| + color_mask&~leading_pixel_mask; + for (i=0;iwidth_internal; + if (RandU16dither_probability_u16) + color.c0=dither_colors.c1; + else + color.c0=dither_colors.c0; + } + res=(h2-h1)*(w2-w1); + } + break; + case ROPB_XOR: + if (win_z_buf_ptr) { + res=0; + for (j=h1;jbody+kk1&~7; + if (leading_pixels) { + if (win_z_num>=*win_z_buf_ptr++) { + *dst(I64 *)=*dst(I64 *)&leading_pixel_mask| + *dst(I64 *)^color_mask&~leading_pixel_mask; + res+=leading_pixels; + } + dst(I64 *)++; + } + for (i=0;i=*win_z_buf_ptr++) { + *dst(I64 *)^=color_mask; + res+=8; + } + if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) { + *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| + *dst(I64 *)^color_mask&~trailing_pixel_mask; + res+=trailing_pixels; + } + if ((j+y)&7==7) + win_z_buf_ptr(U8 *)+=win_z_buf_line_inc; + else + win_z_buf_ptr(U8 *)-=win_z_buf_line_dec; + kk1+=dc->width_internal; + if (RandU16dither_probability_u16) + color.c0=dither_colors.c1; + else + color.c0=dither_colors.c0; + } + } else { + for (j=h2-h1;j;j--) { + color_mask=gr.to_8_colors[color.c0.color]; + dst=dc->body+kk1&~7; + if (leading_pixels) + *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| + *dst(I64 *)^color_mask&~leading_pixel_mask; + for (i=0;iwidth_internal; + if (RandU16dither_probability_u16) + color.c0=dither_colors.c1; + else + color.c0=dither_colors.c0; + } + res=(h2-h1)*(w2-w1); + } + break; + } + } else { + if (((x+w1-original_leading_pixels)^(y+h1))&1) + SwapU16(&color.c0,&color.c1); + switch [color.c0.rop] { + case ROPB_EQU: + case ROPB_MONO: + if (win_z_buf_ptr) { + res=0; + for (j=h1;jbody+kk1&~7; + if (leading_pixels) { + if (win_z_num>=*win_z_buf_ptr++) { + *dst(I64 *)=*dst(I64 *)&leading_pixel_mask| + color_mask&~leading_pixel_mask; + res+=leading_pixels; + } + dst(I64 *)++; + } + for (i=0;i=*win_z_buf_ptr++) { + *dst(I64 *)=color_mask; + res+=8; + } + if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) { + *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| + color_mask&~trailing_pixel_mask; + res+=trailing_pixels; + } + if ((j+y)&7==7) + win_z_buf_ptr(U8 *)+=win_z_buf_line_inc; + else + win_z_buf_ptr(U8 *)-=win_z_buf_line_dec; + kk1+=dc->width_internal; + SwapU16(&color.c0,&color.c1); + } + } else { + for (j=h2-h1;j;j--) { + color_mask=gr.to_8_bits[0x55]&gr.to_8_colors[color.c0.color]| + gr.to_8_bits[0xAA]&gr.to_8_colors[color.c1.color]; + dst=dc->body+kk1&~7; + if (leading_pixels) + *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| + color_mask&~leading_pixel_mask; + for (i=0;iwidth_internal; + SwapU16(&color.c0,&color.c1); + } + res=(h2-h1)*(w2-w1); + } + break; + case ROPB_XOR: + if (win_z_buf_ptr) { + res=0; + for (j=h1;jbody+kk1&~7; + if (leading_pixels) { + if (win_z_num>=*win_z_buf_ptr++) { + *dst(I64 *)=*dst(I64 *)&leading_pixel_mask| + *dst(I64 *)^color_mask&~leading_pixel_mask; + res+=leading_pixels; + } + dst(I64 *)++; + } + for (i=0;i=*win_z_buf_ptr++) { + *dst(I64 *)^=color_mask; + res+=8; + } + if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) { + *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| + *dst(I64 *)^color_mask&~trailing_pixel_mask; + res+=trailing_pixels; + } + if ((j+y)&7==7) + win_z_buf_ptr(U8 *)+=win_z_buf_line_inc; + else + win_z_buf_ptr(U8 *)-=win_z_buf_line_dec; + kk1+=dc->width_internal; + SwapU16(&color.c0,&color.c1); + } + } else { + for (j=h2-h1;j;j--) { + color_mask=gr.to_8_bits[0x55]&gr.to_8_colors[color.c0.color]| + gr.to_8_bits[0xAA]&gr.to_8_colors[color.c1.color]; + dst=dc->body+kk1&~7; + if (leading_pixels) + *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| + *dst(I64 *)^color_mask&~leading_pixel_mask; + for (i=0;iwidth_internal; + SwapU16(&color.c0,&color.c1); + } + res=(h2-h1)*(w2-w1); + } + break; + } + } + } else { + color_mask=gr.to_8_colors[color.c0.color]; + switch [color.c0.rop] { + case ROPB_EQU: + case ROPB_MONO: + if (win_z_buf_ptr) { + res=0; + for (j=h1;jbody+kk1&~7; + if (leading_pixels) { + if (win_z_num>=*win_z_buf_ptr++) { + *dst(I64 *)=*dst(I64 *)&leading_pixel_mask| + color_mask&~leading_pixel_mask; + res+=leading_pixels; + } + dst(I64 *)++; + } + for (i=0;i=*win_z_buf_ptr++) { + *dst(I64 *)=color_mask; + res+=8; + } + if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) { + *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| + color_mask&~trailing_pixel_mask; + res+=trailing_pixels; + } + if ((j+y)&7==7) + win_z_buf_ptr(U8 *)+=win_z_buf_line_inc; + else + win_z_buf_ptr(U8 *)-=win_z_buf_line_dec; + kk1+=dc->width_internal; + } + } else { + for (j=h2-h1;j;j--) { + dst(I64 *)=dc->body+kk1&~7; + if (leading_pixels) + *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| + color_mask&~leading_pixel_mask; + for (i=0;iwidth_internal; + } + res=(h2-h1)*(w2-w1); + } + break; + case ROPB_XOR: + if (win_z_buf_ptr) { + res=0; + for (j=h1;jbody+kk1&~7; + if (leading_pixels) { + if (win_z_num>=*win_z_buf_ptr++) { + *dst(I64 *)=*dst(I64 *)&leading_pixel_mask| + *dst(I64 *)^color_mask&~leading_pixel_mask; + res+=leading_pixels; + } + dst(I64 *)++; + } + for (i=0;i=*win_z_buf_ptr++) { + *dst(I64 *)^=color_mask; + res+=8; + } + if (trailing_pixels && win_z_num>=*win_z_buf_ptr++) { + *dst(I64 *)=*dst(I64 *)&trailing_pixel_mask| + *dst(I64 *)^color_mask&~trailing_pixel_mask; + res+=trailing_pixels; + } + if ((j+y)&7==7) + win_z_buf_ptr(U8 *)+=win_z_buf_line_inc; + else + win_z_buf_ptr(U8 *)-=win_z_buf_line_dec; + kk1+=dc->width_internal; + } + } else { + for (j=h2-h1;j;j--) { + dst=dc->body+kk1&~7; + if (leading_pixels) + *dst(I64 *)++=*dst(I64 *)&leading_pixel_mask| + *dst(I64 *)^color_mask&~leading_pixel_mask; + for (i=0;iwidth_internal; + } + res=(h2-h1)*(w2-w1); + } + break; + } + } + } + } + return res; +} + +I64 GrRayLenMinus(CDC *dc,I64 x,I64 y) +{ +//Returns cnt of pixs changed + I64 res=0,c,x3,y3,d; + U8 *dst,*dst2; + Bool not_color=ToBool(dc->flags&DCF_FILL_NOT_COLOR); + CTask *win_task; + + if (dc->flags & DCF_SCREEN_BITMAP) { + win_task=dc->win_task; + x+=win_task->scroll_x; + y+=win_task->scroll_y; + } + x3=x; + y3=y; + if (x3<0 || y3<0) + goto gr_done; + if (dc->flags & DCF_SCREEN_BITMAP) { + x3+=win_task->pix_left; + y3+=win_task->pix_top; + if (!(0<=x3<=win_task->pix_right) || !(0<=y3<=win_task->pix_bottom) || + !(dc->flags&DCF_ON_TOP) && IsPixCovered0(win_task,x3,y3)) + goto gr_done; + } + if (x3>=dc->width || y3>=dc->height) + goto gr_done; + + d=y3*dc->width_internal; + dst2=dc->body+d; + while (TRUE) { + x3=x; + if (x3&(FONT_WIDTH-1)==FONT_WIDTH-1) { + if (dc->flags & DCF_SCREEN_BITMAP) { + if (x3<0) break; + x3+=win_task->pix_left; + if (!(0<=x3<=win_task->pix_right) || x3>=dc->width || + !(dc->flags&DCF_ON_TOP) && IsPixCovered0(win_task,x3,y3)) + break; + } else + if (!(0<=x3width)) + break; + } else if (dc->flags & DCF_SCREEN_BITMAP) + x3+=win_task->pix_left; + dst=dst2+x3; + c=*dst; + if (not_color) { + if (c!=dc->color2) { + res++; + x--; + } else + break; + } else { + if (c==dc->color2) { + res++; + x--; + } else + break; + } + } + return res; +gr_done: + return 0; +} + +I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL) +{ +//Returns cnt of pixs changed + I64 res=0,d,x=*x1,x2,x3,y3,dist; + Bool plot,dither,probability_dither, + not_color=ToBool(dc->flags&DCF_FILL_NOT_COLOR); + U8 *dst,*dst2; + CColorROPU32 c,c2,color=dc->color,bkcolor=dc->bkcolor; + I32 *db2; + CTask *win_task; + + if (dc->flags & DCF_SCREEN_BITMAP) { + win_task=dc->win_task; + x+=win_task->scroll_x; + y+=win_task->scroll_y; + z+=win_task->scroll_z; + } + x2=x; + x3=x; + y3=y; + if (x3<0 || y3<0) + goto gr_done; + if (dc->flags & DCF_SCREEN_BITMAP) { + x3+=win_task->pix_left; + y3+=win_task->pix_top; + if (!(0<=x3<=win_task->pix_right) || !(0<=y3<=win_task->pix_bottom) || + !(dc->flags&DCF_ON_TOP) && IsPixCovered0(win_task,x3,y3)) + goto gr_done; + } + if (x3>=dc->width || y3>=dc->height) + goto gr_done; + + d=dc->width_internal*y3; + if (db) db+=d; + + color=dc->color; + 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; + } else { + probability_dither=FALSE; + color.c1.rop=color.c0.rop; + } + } else + dither=FALSE; + dst2=dc->body+d; + while (TRUE) { + x3=x; + if (!(x3&(FONT_WIDTH-1))) { + if (dc->flags & DCF_SCREEN_BITMAP) { + if (x3<0) break; + x3+=win_task->pix_left; + if (!(0<=x3<=win_task->pix_right) || x3>=dc->width || + !(dc->flags&DCF_ON_TOP) && IsPixCovered0(win_task,x3,y3)) + break; + } else { + if (!(0<=x3width)) + break; + } + } else if (dc->flags & DCF_SCREEN_BITMAP) + x3+=win_task->pix_left; + + dst=dst2+x3; + + c=*dst; + if (db) { + db2=db+x3; + if (0<=z<=*db2) { + *db2=z; + plot=TRUE; + } else + plot=FALSE; + } else + plot=TRUE; + + if ((not_color && c!=dc->color2 || + !not_color && c==dc->color2) && plot) { + if (dc->flags & DCF_LOCATE_NEAREST) { + dist=DistSqrI64(x3,y3,dc->cur_x,dc->cur_y); + if (dist<=dc->nearest_dist) { + dc->nearest_dist=dist; + dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num; + } + } + if (dc->flags & DCF_RECORD_EXTENTS) { + if (x3min_x) dc->min_x=x3; + if (x3>dc->max_x) dc->max_x=x3; + if (y3min_y) dc->min_y=y3; + if (y3>dc->max_y) dc->max_y=y3; + } + dst=dst2+x3; + + c=color.c0.color; + if (dither) { + if (probability_dither) { + if (RandU16dither_probability_u16) + c=color.c1.color; + } else + if ((x3^y3)&1) + c=color.c1.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++; + x++; + } else + break; + } + if (dc->flags & DCF_SCREEN_BITMAP) + *x1=x-1-win_task->scroll_x; + else + *x1=x-1; + x=x2-1; + while (TRUE) { + x3=x; + if (x3&(FONT_WIDTH-1)==FONT_WIDTH-1) { + if (dc->flags & DCF_SCREEN_BITMAP) { + if (x3<0) break; + x3+=win_task->pix_left; + if (!(0<=x3<=win_task->pix_right) || x3>=dc->width || + !(dc->flags&DCF_ON_TOP) && IsPixCovered0(win_task,x3,y3)) + break; + } else + if (!(0<=x3width)) + break; + } else if (dc->flags & DCF_SCREEN_BITMAP) + x3+=win_task->pix_left; + + dst=dst2+x3; + c=*dst; + if (db) { + db2=db+x3; + if (0<=z<=*db2) { + *db2=z; + plot=TRUE; + } else + plot=FALSE; + } else + plot=TRUE; + + if ((not_color && c!=dc->color2 || + !not_color && c==dc->color2) && plot) { + if (dc->flags & DCF_LOCATE_NEAREST) { + dist=DistSqrI64(x3,y3,dc->cur_x,dc->cur_y); + if (dist<=dc->nearest_dist) { + dc->nearest_dist=dist; + dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num; + } + } + if (dc->flags & DCF_RECORD_EXTENTS) { + if (x3min_x) dc->min_x=x3; + if (x3>dc->max_x) dc->max_x=x3; + if (y3min_y) dc->min_y=y3; + if (y3>dc->max_y) dc->max_y=y3; + } + dst=dst2+x3; + + c=color.c0.color; + if (dither) { + if (probability_dither) { + if (RandU16dither_probability_u16) + c=color.c1.color; + } else + if ((x3^y3)&1) + c=color.c1.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++; + x--; + } else + break; + } + return res; +gr_done: + return 0; +} + +public I64 GrHLine(CDC *dc=gr.dc,I64 x1,I64 x2,I64 y,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.HC"$. + I64 dist,dx,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 (x2flags & DCF_SCREEN_BITMAP) { + win_task=dc->win_task; + x1+=win_task->scroll_x; + x2+=win_task->scroll_x; + y +=win_task->scroll_y; + z1+=win_task->scroll_z; + z2+=win_task->scroll_z; + } + if (dc->flags & DCF_RECORD_EXTENTS) { + if (x1min_x) dc->min_x=x1; + if (x1>dc->max_x) dc->max_x=x1; + if (x2min_x) dc->min_x=x2; + if (x2>dc->max_x) dc->max_x=x2; + if (ymin_y) dc->min_y=y; + if (y>dc->max_y) dc->max_y=y; + } + if (y<0) goto gr_done; + if (x2flags & DCF_SCREEN_BITMAP) { + x1+=win_task->pix_left; + x2+=win_task->pix_left; + if (x1>win_task->pix_right) + goto gr_done; + if (x2>win_task->pix_right) { + j=x2-win_task->pix_right; + x2=win_task->pix_right; + } + y+=win_task->pix_top; + if (!(0<=y<=win_task->pix_bottom) || x2<0) + goto gr_done; + } + if (x1>=dc->width || y>=dc->height) + goto gr_done; + dx=x2+j-(x1-i); + d=dc->width_internal*y+x1; + if (db=dc->depth_buf) { + db+=d; + if (dx) + dz=(z2-z1)<<32/dx; + else + dz=0; + z=z1<<32; + } + if (i) + z+=i*dz; + if (x2>=dc->width) + x2=dc->width-1; + + if (dc->flags & DCF_LOCATE_NEAREST) { + if (x1<=dc->cur_x<=x2) + dist=0; + else if (dc->cur_xcur_x); + else + dist=SqrI64(dc->cur_x-x2); + dist+=SqrI64(y-dc->cur_y); + 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,x1,y)) + 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 (RandU16dither_probability_u16) + color.c0=dither_colors.c1; + else + color.c0=dither_colors.c0; + } else { + probability_dither=FALSE; + color.c1.rop=color.c0.rop; + if ((x1^y)&1) + SwapU16(&color.c0,&color.c1); + } + } else + dither=FALSE; + while (x1<=x2) { + 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 (RandU16dither_probability_u16) + color.c0=dither_colors.c1; + else + color.c0=dither_colors.c0; + } else + SwapU16(&color.c0,&color.c1); + } + d++; + x1++; + if (db) + db++; + z+=dz; + if (!(x1&(FONT_WIDTH-1)) && x1<=x2) { + if (!(dc->flags & DCF_SCREEN_BITMAP)|| + win_task->next_task==sys_winmgr_task || + dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x1,y)) + char_clear=TRUE; + else + char_clear=FALSE; + } + } +gr_done: + 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.HC"$. + 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 (y2flags & 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 (xmin_x) dc->min_x=x; + if (x>dc->max_x) dc->max_x=x; + if (y1min_y) dc->min_y=y1; + if (y1>dc->max_y) dc->max_y=y1; + if (y2min_y) dc->min_y=y2; + if (y2>dc->max_y) dc->max_y=y2; + } + if (x<0) goto gr_done; + if (y2flags & 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_ycur_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 (RandU16dither_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 (RandU16dither_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; +} diff --git a/Adam/Gr/GrComposites.CPP b/Adam/Gr/GrComposites.CPP deleted file mode 100644 index 021b9dc..0000000 --- a/Adam/Gr/GrComposites.CPP +++ /dev/null @@ -1,322 +0,0 @@ -#help_index "Graphics" -public I64 GrFillPoly3(CDC *dc=gr.dc,I64 n,CD3I32 *poly) -{//3D. Must be convex. -//Returns cnt of pixs changed - CD3I32 tri[3]; - I64 i,j,x,y,z,res=0; - if (n<3) return 0; - if (dc->flags & DCF_SYMMETRY) { - for (i=1;iflags&DCF_TRANSFORMATION) - (*dc->transform)(dc,&x,&y,&z); - DCReflect(dc,&x,&y,&z); - tri[0].x=x; tri[0].y=y; tri[0].z=z; - } - - j++; - if (i==1) { - x=poly[j].x; y=poly[j].y; z=poly[j].z; - if (dc->flags&DCF_TRANSFORMATION) - (*dc->transform)(dc,&x,&y,&z); - DCReflect(dc,&x,&y,&z); - } - tri[1].x=x; tri[1].y=y; tri[1].z=z; - - j++; - x=poly[j].x; y=poly[j].y; z=poly[j].z; - if (dc->flags&DCF_TRANSFORMATION) - (*dc->transform)(dc,&x,&y,&z); - DCReflect(dc,&x,&y,&z); - tri[2].x=x; tri[2].y=y; tri[2].z=z; - - res+=GrFillTri0(dc,&tri[0],&tri[1],&tri[2]); - } - } - if (dc->flags&DCF_JUST_MIRROR) - return res; - for (i=1;iflags&DCF_TRANSFORMATION) - (*dc->transform)(dc,&x,&y,&z); - tri[0].x=x; tri[0].y=y; tri[0].z=z; - } - - j++; - if (i==1) { - x=poly[j].x; y=poly[j].y; z=poly[j].z; - if (dc->flags&DCF_TRANSFORMATION) - (*dc->transform)(dc,&x,&y,&z); - } - tri[1].x=x; tri[1].y=y; tri[1].z=z; - - j++; - x=poly[j].x; y=poly[j].y; z=poly[j].z; - if (dc->flags&DCF_TRANSFORMATION) - (*dc->transform)(dc,&x,&y,&z); - tri[2].x=x; tri[2].y=y; tri[2].z=z; - - res+=GrFillTri0(dc,&tri[0],&tri[1],&tri[2]); - } - return res; -} - -public I64 GrRectB(CDC *dc=gr.dc,I64 x1,I64 y1,I64 x2,I64 y2) -{//2D. Two point. Clipping but not transformation. - if (x2flags & DCF_TRANSFORMATION) { - (*dc->transform)(dc,&x1,&y1,&z1); - (*dc->transform)(dc,&x2,&y2,&z2); - dc->flags&=~DCF_TRANSFORMATION; - was_transform=TRUE; - } - if (dc->flags & DCF_SYMMETRY) { - _x1=x1; _y1=y1; _z1=z1; - DCReflect(dc,&_x1,&_y1,&_z1); - _x2=x2; _y2=y2; _z2=z2; - DCReflect(dc,&_x2,&_y2,&_z2); - dc->flags&=~DCF_SYMMETRY; - res=Line(dc,_x1,_y1,_z1,_x2,_y2,_z2,&GrPlot3,step,start); - dx=_x2-_x1; dy=_y2-_y1; - if (d=Sqrt(dx*dx+dy*dy)) { - d=w*dc->pen_width/d; - res|=Line(dc,_x2-dx*d+dy*d+0.5,_y2-dy*d-dx*d+0.5,_z2, - _x2,_y2,_z2,&GrPlot3,step); - res|=Line(dc,_x2-dx*d-dy*d+0.5,_y2-dy*d+dx*d+0.5,_z2, - _x2,_y2,_z2,&GrPlot3,step); - } - was_symmetry=TRUE; - if (dc->flags&DCF_JUST_MIRROR) - goto gr_done; - } - res|=Line(dc,x1,y1,z1,x2,y2,z2,&GrPlot3,step,start); - dx=x2-x1; dy=y2-y1; - if (d=Sqrt(dx*dx+dy*dy)) { - d=w*dc->pen_width/d; - res|=Line(dc,x2-dx*d+dy*d+0.5,y2-dy*d-dx*d+0.5,z2, - x2,y2,z2,&GrPlot3,step); - res|=Line(dc,x2-dx*d-dy*d+0.5,y2-dy*d+dx*d+0.5,z2, - x2,y2,z2,&GrPlot3,step); - } -gr_done: - if (was_transform) - dc->flags|=DCF_TRANSFORMATION; - if (was_symmetry) - dc->flags|=DCF_SYMMETRY; - return res; -} - -#help_index "Graphics/Char;Char/Graphics" -public Bool GrTextBox3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,U8 *s,I64 border=2) -{//3D. Transformation. DCF_SYMMETRY is silly. - U8 *ptr; - I64 ch,res,w,w_max,h; - if (!s) return FALSE; - ptr=s; - w=0; w_max=0; h=FONT_HEIGHT; - - if (dc->flags & DCF_TRANSFORMATION) - (*dc->transform)(dc,&x1,&y1,&z1); - while (ch=*ptr++) { - if (ch=='\t') - w=CeilU64(w+FONT_WIDTH,FONT_WIDTH*8); - else if (ch=='\n') { - if (w>w_max) w_max=w; - w=0; - h+=FONT_HEIGHT; - } else - w+=FONT_WIDTH; - } - if (w>w_max) w_max=w; - res=GrPrint(dc,x1,y1,"%s",s); - res|=GrLine(dc,x1-border ,y1-border ,x1+w_max+border,y1-border); - res|=GrLine(dc,x1-border ,y1+h+border,x1+w_max+border,y1+h+border); - res|=GrLine(dc,x1-border ,y1-border ,x1-border,y1+h+border); - res|=GrLine(dc,x1+w_max+border,y1-border ,x1+w_max+border,y1+h+border); - return ToBool(res); -} - -#define MAX_DIAMOND_SLOPE 2.75 - -public Bool GrTextDiamond3(CDC *dc=gr.dc, - I64 x1,I64 y1,I64 z1,U8 *_s,I64 border=2) -{//3D. Transformation. DCF_SYMMETRY is silly. - Bool first=TRUE; - U8 ch,*ptr,*ptr_end,*st,*s; - I64 res=0,y,dx,dy,dx_old,dy_old,w,h=FONT_HEIGHT; - F64 m; - if (!_s) return FALSE; - if (dc->flags & DCF_TRANSFORMATION) - (*dc->transform)(dc,&x1,&y1,&z1); - - ptr=s=StrNew(_s); - while (ch=*ptr) { - if (ch=='\r'||ch=='\t') - *ptr=CH_SPACE; - if (ch=='\n') { - *ptr=0; - h+=FONT_HEIGHT; - } - ptr++; - } - ptr_end=ptr+1; - - y=y1-h>>1; - dx=FONT_WIDTH +border; //Minimum - dy=FONT_HEIGHT+border+h>>1; //Minimum - ptr=s; - while (ptr!=ptr_end) { - st=ptr; - while (*ptr++); - StrUtil(st,SUF_REM_LEADING|SUF_REM_TRAILING); - - w=(StrLen(st)*FONT_WIDTH)>>1; - if (first) { - res|=GrPrint(dc,x1-w,y,"%s",st); - first=FALSE; - } else - res|=GrPrint(dc,x1-w,y,"%s",st); - if (w) { - w+=border; - do { - dx_old=dx; dy_old=dy; - m=ToF64(dx)/dy; - if (m<1/MAX_DIAMOND_SLOPE) { - dy=MaxI64(dy,Ceil(MAX_DIAMOND_SLOPE*dx)); - m=1/MAX_DIAMOND_SLOPE; - } else if (m>MAX_DIAMOND_SLOPE) { - dy=MaxI64(dy,Ceil(dx/MAX_DIAMOND_SLOPE)); - m=MAX_DIAMOND_SLOPE; - } - dx=MaxI64(dx,w+Ceil(m*AbsI64(y-y1))); - dx=MaxI64(dx,w+Ceil(m*AbsI64(y+FONT_HEIGHT-y1))); - } while (dx!=dx_old || dy!=dy_old); - } - y+=FONT_HEIGHT; - } - Free(s); - - res|=GrLine(dc,x1,y1-dy,x1+dx,y1); - res|=GrLine(dc,x1+dx,y1,x1,y1+dy); - res|=GrLine(dc,x1,y1+dy,x1-dx,y1); - res|=GrLine(dc,x1-dx,y1,x1,y1-dy); - return ToBool(res); -} - -#help_index "Graphics/Mesh" -public I64 Gr3Mesh(CDC *dc=gr.dc,I64 vertex_cnt,CD3I32 *p, - I64 tri_cnt,CMeshTri *tri) -{//Returns cnt of pixs changed. - CColorROPU32 old_color=dc->color; - I64 i,x,y,z,res=0; - CD3I32 *pt,*pt_sym,*p_sym,*dst; - CMeshTri *tri_sym=tri; - if (dc->flags&DCF_TRANSFORMATION) { - dst=pt=MAlloc(sizeof(CD3I32)*vertex_cnt); - for (i=0;ix; y=p->y; z=p->z; - (*dc->transform)(dc,&x,&y,&z); - dst->x=x; dst->y=y; dst->z=z; - } - p=pt; - } else - pt=NULL; - - if (dc->flags & DCF_SYMMETRY) { - dst=pt_sym=MAlloc(sizeof(CD3I32)*vertex_cnt); - p_sym=p; - for (i=0;ix; y=p_sym->y; z=p_sym->z; - DCReflect(dc,&x,&y,&z); - dst->x=x; dst->y=y; dst->z=z; - } - p_sym=pt_sym; - for (i=0;ilighting)(dc,&p_sym[tri_sym->nums[0]],&p_sym[tri_sym->nums[2]], - &p_sym[tri_sym->nums[1]],tri_sym->color); - res+=GrFillTri0(dc,&p_sym[tri_sym->nums[0]],&p_sym[tri_sym->nums[2]], - &p_sym[tri_sym->nums[1]]); - } - Free(pt_sym); - if (dc->flags&DCF_JUST_MIRROR) - goto mesh_done; - } - for (i=0;ilighting)(dc,&p[tri->nums[0]],&p[tri->nums[1]], - &p[tri->nums[2]],tri->color); - res+=GrFillTri0(dc,&p[tri->nums[0]],&p[tri->nums[1]],&p[tri->nums[2]]); - } -mesh_done: - dc->color=old_color; - Free(pt); - return res; -} - -#help_index "Graphics/Misc;Input Pointer/Displayed Image" -public U0 DrawStdInputPtr(CDC *dc,I64 x,I64 y) -{//This is a callback. See $LK,"::/Demo/Graphics/Grid.CPP"$. -//Called by $LK,"DrawInputPtr",A="MN:DrawInputPtr"$() which is - //called by $LK,"WinFinalUpdate",A="MN:WinFinalUpdate"$(). - dc->pen_width=1; - dc->flags&=~(DCF_TRANSFORMATION|DCF_SYMMETRY); - GrArrow3(dc,x+8,y+8,0,x,y,0); -} - -gr.fp_draw_input_ptr=&DrawStdInputPtr; - -public U0 DrawWaitInputPtr(CDC *dc,I64 x,I64 y) -{//This is a callback. See $LK,"::/Demo/Graphics/Grid.CPP"$. - I64 old_pen_width=dc->pen_width; - CColorROPU32 old_color=dc->color; - dc->pen_width=3; - dc->color=LTRED; - GrCircle3(dc,x,y,0,7); - GrLine3(dc,x-6,y+6,0,x+6,y-6,0); - dc->color=RED; - GrCircle(dc,x,y,7); - GrLine(dc,x-6,y+6,x+6,y-6); - dc->pen_width=old_pen_width; - dc->color=old_color; -} diff --git a/Adam/Gr/GrComposites.HC b/Adam/Gr/GrComposites.HC new file mode 100644 index 0000000..a753523 --- /dev/null +++ b/Adam/Gr/GrComposites.HC @@ -0,0 +1,322 @@ +#help_index "Graphics" +public I64 GrFillPoly3(CDC *dc=gr.dc,I64 n,CD3I32 *poly) +{//3D. Must be convex. +//Returns cnt of pixs changed + CD3I32 tri[3]; + I64 i,j,x,y,z,res=0; + if (n<3) return 0; + if (dc->flags & DCF_SYMMETRY) { + for (i=1;iflags&DCF_TRANSFORMATION) + (*dc->transform)(dc,&x,&y,&z); + DCReflect(dc,&x,&y,&z); + tri[0].x=x; tri[0].y=y; tri[0].z=z; + } + + j++; + if (i==1) { + x=poly[j].x; y=poly[j].y; z=poly[j].z; + if (dc->flags&DCF_TRANSFORMATION) + (*dc->transform)(dc,&x,&y,&z); + DCReflect(dc,&x,&y,&z); + } + tri[1].x=x; tri[1].y=y; tri[1].z=z; + + j++; + x=poly[j].x; y=poly[j].y; z=poly[j].z; + if (dc->flags&DCF_TRANSFORMATION) + (*dc->transform)(dc,&x,&y,&z); + DCReflect(dc,&x,&y,&z); + tri[2].x=x; tri[2].y=y; tri[2].z=z; + + res+=GrFillTri0(dc,&tri[0],&tri[1],&tri[2]); + } + } + if (dc->flags&DCF_JUST_MIRROR) + return res; + for (i=1;iflags&DCF_TRANSFORMATION) + (*dc->transform)(dc,&x,&y,&z); + tri[0].x=x; tri[0].y=y; tri[0].z=z; + } + + j++; + if (i==1) { + x=poly[j].x; y=poly[j].y; z=poly[j].z; + if (dc->flags&DCF_TRANSFORMATION) + (*dc->transform)(dc,&x,&y,&z); + } + tri[1].x=x; tri[1].y=y; tri[1].z=z; + + j++; + x=poly[j].x; y=poly[j].y; z=poly[j].z; + if (dc->flags&DCF_TRANSFORMATION) + (*dc->transform)(dc,&x,&y,&z); + tri[2].x=x; tri[2].y=y; tri[2].z=z; + + res+=GrFillTri0(dc,&tri[0],&tri[1],&tri[2]); + } + return res; +} + +public I64 GrRectB(CDC *dc=gr.dc,I64 x1,I64 y1,I64 x2,I64 y2) +{//2D. Two point. Clipping but not transformation. + if (x2flags & DCF_TRANSFORMATION) { + (*dc->transform)(dc,&x1,&y1,&z1); + (*dc->transform)(dc,&x2,&y2,&z2); + dc->flags&=~DCF_TRANSFORMATION; + was_transform=TRUE; + } + if (dc->flags & DCF_SYMMETRY) { + _x1=x1; _y1=y1; _z1=z1; + DCReflect(dc,&_x1,&_y1,&_z1); + _x2=x2; _y2=y2; _z2=z2; + DCReflect(dc,&_x2,&_y2,&_z2); + dc->flags&=~DCF_SYMMETRY; + res=Line(dc,_x1,_y1,_z1,_x2,_y2,_z2,&GrPlot3,step,start); + dx=_x2-_x1; dy=_y2-_y1; + if (d=Sqrt(dx*dx+dy*dy)) { + d=w*dc->pen_width/d; + res|=Line(dc,_x2-dx*d+dy*d+0.5,_y2-dy*d-dx*d+0.5,_z2, + _x2,_y2,_z2,&GrPlot3,step); + res|=Line(dc,_x2-dx*d-dy*d+0.5,_y2-dy*d+dx*d+0.5,_z2, + _x2,_y2,_z2,&GrPlot3,step); + } + was_symmetry=TRUE; + if (dc->flags&DCF_JUST_MIRROR) + goto gr_done; + } + res|=Line(dc,x1,y1,z1,x2,y2,z2,&GrPlot3,step,start); + dx=x2-x1; dy=y2-y1; + if (d=Sqrt(dx*dx+dy*dy)) { + d=w*dc->pen_width/d; + res|=Line(dc,x2-dx*d+dy*d+0.5,y2-dy*d-dx*d+0.5,z2, + x2,y2,z2,&GrPlot3,step); + res|=Line(dc,x2-dx*d-dy*d+0.5,y2-dy*d+dx*d+0.5,z2, + x2,y2,z2,&GrPlot3,step); + } +gr_done: + if (was_transform) + dc->flags|=DCF_TRANSFORMATION; + if (was_symmetry) + dc->flags|=DCF_SYMMETRY; + return res; +} + +#help_index "Graphics/Char;Char/Graphics" +public Bool GrTextBox3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,U8 *s,I64 border=2) +{//3D. Transformation. DCF_SYMMETRY is silly. + U8 *ptr; + I64 ch,res,w,w_max,h; + if (!s) return FALSE; + ptr=s; + w=0; w_max=0; h=FONT_HEIGHT; + + if (dc->flags & DCF_TRANSFORMATION) + (*dc->transform)(dc,&x1,&y1,&z1); + while (ch=*ptr++) { + if (ch=='\t') + w=CeilU64(w+FONT_WIDTH,FONT_WIDTH*8); + else if (ch=='\n') { + if (w>w_max) w_max=w; + w=0; + h+=FONT_HEIGHT; + } else + w+=FONT_WIDTH; + } + if (w>w_max) w_max=w; + res=GrPrint(dc,x1,y1,"%s",s); + res|=GrLine(dc,x1-border ,y1-border ,x1+w_max+border,y1-border); + res|=GrLine(dc,x1-border ,y1+h+border,x1+w_max+border,y1+h+border); + res|=GrLine(dc,x1-border ,y1-border ,x1-border,y1+h+border); + res|=GrLine(dc,x1+w_max+border,y1-border ,x1+w_max+border,y1+h+border); + return ToBool(res); +} + +#define MAX_DIAMOND_SLOPE 2.75 + +public Bool GrTextDiamond3(CDC *dc=gr.dc, + I64 x1,I64 y1,I64 z1,U8 *_s,I64 border=2) +{//3D. Transformation. DCF_SYMMETRY is silly. + Bool first=TRUE; + U8 ch,*ptr,*ptr_end,*st,*s; + I64 res=0,y,dx,dy,dx_old,dy_old,w,h=FONT_HEIGHT; + F64 m; + if (!_s) return FALSE; + if (dc->flags & DCF_TRANSFORMATION) + (*dc->transform)(dc,&x1,&y1,&z1); + + ptr=s=StrNew(_s); + while (ch=*ptr) { + if (ch=='\r'||ch=='\t') + *ptr=CH_SPACE; + if (ch=='\n') { + *ptr=0; + h+=FONT_HEIGHT; + } + ptr++; + } + ptr_end=ptr+1; + + y=y1-h>>1; + dx=FONT_WIDTH +border; //Minimum + dy=FONT_HEIGHT+border+h>>1; //Minimum + ptr=s; + while (ptr!=ptr_end) { + st=ptr; + while (*ptr++); + StrUtil(st,SUF_REM_LEADING|SUF_REM_TRAILING); + + w=(StrLen(st)*FONT_WIDTH)>>1; + if (first) { + res|=GrPrint(dc,x1-w,y,"%s",st); + first=FALSE; + } else + res|=GrPrint(dc,x1-w,y,"%s",st); + if (w) { + w+=border; + do { + dx_old=dx; dy_old=dy; + m=ToF64(dx)/dy; + if (m<1/MAX_DIAMOND_SLOPE) { + dy=MaxI64(dy,Ceil(MAX_DIAMOND_SLOPE*dx)); + m=1/MAX_DIAMOND_SLOPE; + } else if (m>MAX_DIAMOND_SLOPE) { + dy=MaxI64(dy,Ceil(dx/MAX_DIAMOND_SLOPE)); + m=MAX_DIAMOND_SLOPE; + } + dx=MaxI64(dx,w+Ceil(m*AbsI64(y-y1))); + dx=MaxI64(dx,w+Ceil(m*AbsI64(y+FONT_HEIGHT-y1))); + } while (dx!=dx_old || dy!=dy_old); + } + y+=FONT_HEIGHT; + } + Free(s); + + res|=GrLine(dc,x1,y1-dy,x1+dx,y1); + res|=GrLine(dc,x1+dx,y1,x1,y1+dy); + res|=GrLine(dc,x1,y1+dy,x1-dx,y1); + res|=GrLine(dc,x1-dx,y1,x1,y1-dy); + return ToBool(res); +} + +#help_index "Graphics/Mesh" +public I64 Gr3Mesh(CDC *dc=gr.dc,I64 vertex_cnt,CD3I32 *p, + I64 tri_cnt,CMeshTri *tri) +{//Returns cnt of pixs changed. + CColorROPU32 old_color=dc->color; + I64 i,x,y,z,res=0; + CD3I32 *pt,*pt_sym,*p_sym,*dst; + CMeshTri *tri_sym=tri; + if (dc->flags&DCF_TRANSFORMATION) { + dst=pt=MAlloc(sizeof(CD3I32)*vertex_cnt); + for (i=0;ix; y=p->y; z=p->z; + (*dc->transform)(dc,&x,&y,&z); + dst->x=x; dst->y=y; dst->z=z; + } + p=pt; + } else + pt=NULL; + + if (dc->flags & DCF_SYMMETRY) { + dst=pt_sym=MAlloc(sizeof(CD3I32)*vertex_cnt); + p_sym=p; + for (i=0;ix; y=p_sym->y; z=p_sym->z; + DCReflect(dc,&x,&y,&z); + dst->x=x; dst->y=y; dst->z=z; + } + p_sym=pt_sym; + for (i=0;ilighting)(dc,&p_sym[tri_sym->nums[0]],&p_sym[tri_sym->nums[2]], + &p_sym[tri_sym->nums[1]],tri_sym->color); + res+=GrFillTri0(dc,&p_sym[tri_sym->nums[0]],&p_sym[tri_sym->nums[2]], + &p_sym[tri_sym->nums[1]]); + } + Free(pt_sym); + if (dc->flags&DCF_JUST_MIRROR) + goto mesh_done; + } + for (i=0;ilighting)(dc,&p[tri->nums[0]],&p[tri->nums[1]], + &p[tri->nums[2]],tri->color); + res+=GrFillTri0(dc,&p[tri->nums[0]],&p[tri->nums[1]],&p[tri->nums[2]]); + } +mesh_done: + dc->color=old_color; + Free(pt); + return res; +} + +#help_index "Graphics/Misc;Input Pointer/Displayed Image" +public U0 DrawStdInputPtr(CDC *dc,I64 x,I64 y) +{//This is a callback. See $LK,"::/Demo/Graphics/Grid.HC"$. +//Called by $LK,"DrawInputPtr",A="MN:DrawInputPtr"$() which is + //called by $LK,"WinFinalUpdate",A="MN:WinFinalUpdate"$(). + dc->pen_width=1; + dc->flags&=~(DCF_TRANSFORMATION|DCF_SYMMETRY); + GrArrow3(dc,x+8,y+8,0,x,y,0); +} + +gr.fp_draw_input_ptr=&DrawStdInputPtr; + +public U0 DrawWaitInputPtr(CDC *dc,I64 x,I64 y) +{//This is a callback. See $LK,"::/Demo/Graphics/Grid.HC"$. + I64 old_pen_width=dc->pen_width; + CColorROPU32 old_color=dc->color; + dc->pen_width=3; + dc->color=LTRED; + GrCircle3(dc,x,y,0,7); + GrLine3(dc,x-6,y+6,0,x+6,y-6,0); + dc->color=RED; + GrCircle(dc,x,y,7); + GrLine(dc,x-6,y+6,x+6,y-6); + dc->pen_width=old_pen_width; + dc->color=old_color; +} diff --git a/Adam/Gr/GrDC.CPP b/Adam/Gr/GrDC.CPP deleted file mode 100644 index e430738..0000000 --- a/Adam/Gr/GrDC.CPP +++ /dev/null @@ -1,440 +0,0 @@ -#help_index "Graphics/Math/3D Transformation" -#help_file "::/Doc/Transform" - -#define GR_SCALE (1<<32) - -public U0 Mat4x4MulXYZ(I64 *r,I64 *_x,I64 *_y,I64 *_z) -{//Rotate 3D point using 4x4 matrix. Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$. - I64 x1,y1,z1,xx=*_x,yy=*_y,zz=*_z; - x1=(r[0*4+0]*xx+r[0*4+1]*yy+r[0*4+2]*zz+r[0*4+3])>>32; - y1=(r[1*4+0]*xx+r[1*4+1]*yy+r[1*4+2]*zz+r[1*4+3])>>32; - z1=(r[2*4+0]*xx+r[2*4+1]*yy+r[2*4+2]*zz+r[2*4+3])>>32; - *_x=x1;*_y=y1;*_z=z1; -} - -public U0 DCTransform(CDC *dc,I64 *_x,I64 *_y,I64 *_z) -{//This is the dft dc->transform() callback. -//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$. - Mat4x4MulXYZ(dc->r,_x,_y,_z); - *_x+=dc->x; - *_y+=dc->y; - *_z+=dc->z; -} - -public I64 *Mat4x4IdentEqu(I64 *r) -{//Set matrix to identity. Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$. - MemSet(r,0,sizeof(I64)*16); - r[0*4+0].i32[1]=1; - r[1*4+1].i32[1]=1; - r[2*4+2].i32[1]=1; - r[3*4+3].i32[1]=1; - return r; -} - -public I64 *Mat4x4IdentNew(CTask *mem_task=NULL) -{//MAlloc an identity matrix. Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$. - return Mat4x4IdentEqu(MAlloc(sizeof(I64)*16,mem_task)); -} - -public I64 Mat4x4NormSqr65536(I64 *r) -{//Norm Squared of r. -//(1.0/Sqrt(3))*65536=37837.22 - return SqrI64((r[0*4+0]*37838+r[0*4+1]*37838+r[0*4+2]*37838)>>32)+ - SqrI64((r[1*4+0]*37837+r[1*4+1]*37837+r[1*4+2]*37837)>>32)+ - SqrI64((r[2*4+0]*37837+r[2*4+1]*37837+r[2*4+2]*37837)>>32); -} - -public U0 DCMat4x4Set(CDC *dc=NULL,I64 *r) -{//Set device context's rot matrix. Will be $LK,"Free",A="MN:Free"$d() in $LK,"DCDel",A="MN:DCDel"$().Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$. -//The main purpose is to set matrix norm for pen width scaling. - //NULL as dc means gr.dc - if (!dc) dc=gr.dc; - dc->r=r; - dc->r_norm=Sqrt(Mat4x4NormSqr65536(r))*65536; //scaled 32 bits -} - -#help_index "Graphics/Mesh" -public U0 DCLighting(CDC *dc, - CD3I32 *p1,CD3I32 *p2,CD3I32 *p3,CColorROPU32 color) -{//This is the dft dc->lighting() callback. - CD3I32 v1,v2; - I64 i,vn_x,vn_y,vn_z; - F64 d; - - v1.x=p1->x-p2->x; - v1.y=p1->y-p2->y; - v1.z=p1->z-p2->z; - - v2.x=p3->x-p2->x; - v2.y=p3->y-p2->y; - v2.z=p3->z-p2->z; - - //V1 and V2 are vects along two sides - //of the tri joined at p2. - - vn_x=v1.y*v2.z-v1.z*v2.y; - vn_y=v1.z*v2.x-v1.x*v2.z; - vn_z=v1.x*v2.y-v1.y*v2.x; - if (d=Sqrt(SqrI64(vn_x)+SqrI64(vn_y)+SqrI64(vn_z))) - d=1<<16/d; - vn_x*=d; - vn_y*=d; - vn_z*=d; -//Vn is the cross product of V1 and V3 - //which means it is perpendicular. It - //is the normal vect to the surface. - //It has been scaled to length 65536. - - //Light source has been scaled to length 65536. - i=(vn_x*dc->ls.x+vn_y*dc->ls.y+vn_z*dc->ls.z)>>16; -//The dot product of the light source - //vect and the surface normal - //gives an illumination number. - //65536*65536>>16=65536 - - //TempleOS will generate a random U16 - //and compare to dither_probability_u16 and - //will pick from two colors. - //Probability dithering does not work with pen_width>1 at this time. - if (color.c0.rop&ROPBF_TWO_SIDED) { - color.c0.rop&=~ROPBF_TWO_SIDED; - i=AbsI64(i)<<1; - } else - i+=65536; - if (color.c0.rop&ROPBF_HALF_RANGE_COLOR) { - color.c0.rop&=~ROPBF_HALF_RANGE_COLOR; - i>>=1; - if (color>=8) { - color-=8; - i+=65536; - } - } - if (i<65536) { - dc->color=ROPF_PROBABILITY_DITHER+color<<16+BLACK; - dc->dither_probability_u16=i; - } else { - dc->color=ROPF_PROBABILITY_DITHER+(color^8)<<16+color; - dc->dither_probability_u16=i-65536; - } -} - -#help_index "Graphics/Device Contexts" -public U0 DCFill(CDC *dc=NULL,CColorROPU32 val=TRANSPARENT) -{//Fill entire device context with color. - if (!dc) dc=gr.dc; - MemSet(dc->body,val,dc->width_internal*dc->height); -} - -public U0 DCClear(CDC *dc=NULL) -{//Set entire device context image body to 0 (BLACK). - if (!dc) dc=gr.dc; - DCFill(dc,0); -} - -public U0 DCRst(CDC *dc) -{//Reset $LK,"CDC",A="MN:CDC"$ structure members but not image body, itself. - dc->color=BLACK; - dc->color2=BLACK; - dc->bkcolor=BLACK; - dc->collision_cnt=0; - dc->pen_width=1; - dc->ls.x=37837; //1<<16/Sqrt(3) - dc->ls.y=37837; - dc->ls.z=37837; - dc->x=0; - dc->y=0; - dc->z=0; - dc->transform=&DCTransform; - dc->lighting =&DCLighting; - Mat4x4IdentEqu(dc->r); - dc->r_norm=GR_SCALE; - dc->flags&=~(DCF_SYMMETRY|DCF_TRANSFORMATION|DCF_JUST_MIRROR); - MemCpy(dc->palette,gr_palette_std,sizeof(CBGR48)*NUM_COLORS); -} - -public U0 DCExtentsInit(CDC *dc=NULL) -{//Init markers for extent of next newly drawn graphics. -//NULL means gr.dc - //See $LK,"::/Demo/Graphics/Extents.CPP"$ - //You should clear the record flag yourself - if (!dc) dc=gr.dc; - dc->flags|=DCF_RECORD_EXTENTS; - dc->min_x=MAX_I64; - dc->max_x=MIN_I64; - dc->min_y=MAX_I64; - dc->max_y=MIN_I64; -} - -public CDC *DCAlias(CDC *dc=NULL,CTask *task=NULL) -{//Create alias of dc, so can change pen, color, etc. -//NULL means gr.dc - CDC *res; - if (!dc) dc=gr.dc; - if (!task) task=Fs; - if (dc->dc_signature!=DCS_SIGNATURE_VAL) - throw('Graphics'); - res=MAlloc(sizeof(CDC),task); - MemCpy(res,dc,sizeof(CDC)); - res->win_task=res->mem_task=task; - res->r=MAlloc(16*sizeof(I64),task); - DCRst(res); - res->flags|=DCF_ALIAS; - res->alias=dc; - return res; -} - -public CDC *DCNew(I64 width,I64 height,CTask *task=NULL,Bool null_bitmap=FALSE) -{//Create new width x height device context. -//Internally only allows widths which are divisible by 8. - //Don't forget these $MA-X+PU,"sizeof(CDC)",LM="Find(\"sizeof(CDC)\",\"/*\");View;"$. - CDC *res; - if (!task) task=Fs; - res=CAlloc(sizeof(CDC),task); - res->win_task=task; - res->mem_task=task; - res->width=width; - res->width_internal=(width+7)&~7; - res->height=height; - if (null_bitmap) - res->flags|=DCF_DONT_DRAW; - else - res->body=CAlloc(res->width_internal*res->height,task); - res->r=MAlloc(16*sizeof(I64),task); - DCRst(res); - res->dc_signature=DCS_SIGNATURE_VAL; - return res; -} - -public U0 DCDel(CDC *dc) -{//Free dc, image body, rot mat and depth buf. - if (!dc) return; - if (dc->dc_signature!=DCS_SIGNATURE_VAL) - throw('Graphics'); - dc->dc_signature=0; - Free(dc->r); - if (!(dc->flags & DCF_ALIAS)) - Free(dc->body); - Free(dc->depth_buf); - Free(dc); -} - -public I64 DCSize(CDC *dc) -{//Mem size of header, image body and depth buffer. - if (dc) - return MSize2(dc)+MSize2(dc->body)+MSize2(dc->depth_buf); - else - return 0; -} - -public I32 *DCDepthBufRst(CDC *dc) -{//Reset device context depth buf to far away. - if (dc->depth_buf) - MemSetU32(dc->depth_buf,MAX_I32,dc->width_internal*dc->height); - return dc->depth_buf; -} - -public I32 *DCDepthBufAlloc(CDC *dc) -{//Alloc a 32-bit depth buffer for device context. - Free(dc->depth_buf); - dc->depth_buf=MAlloc(dc->width_internal*dc->height*sizeof(I32),dc->mem_task); - return DCDepthBufRst(dc); -} - -public CDC *DCCopy(CDC *dc,CTask *task=NULL) -{//Alloc copy of dc, including image body, rot mat and depth buf. - CDC *res; - if (!dc) return NULL; - if (dc->dc_signature!=DCS_SIGNATURE_VAL) - throw('Graphics'); - res=MAllocIdent(dc,task); - DCMat4x4Set(res,Mat4x4New(dc->r,task)); - res->mem_task=task; - res->body=MAllocIdent(dc->body,task); - res->depth_buf=MAllocIdent(dc->depth_buf,task); - return res; -} - -public U0 DCMono(CDC *dc, - I64 quest=TRANSPARENT,I64 true_color=0,I64 false_color=COLOR_MONO) -{//Set entire device context to one of two colors. - I64 i; - U8 *dst; - dst=dc->body; - i=dc->width_internal*dc->height; - while (i--) - if (*dst==quest) - *dst++=true_color; - else - *dst++=false_color; -} - -public I64 DCColorChg(CDC *dc,I64 src_color,I64 dst_color=TRANSPARENT) -{//Find and replace src color with dst in device context. - I64 i,res=0; - U8 *dst; - dst=dc->body; - i=dc->width_internal*dc->height; - while (i--) - if (*dst==src_color) { - *dst++=dst_color; - res++; - } else - dst++; - return res; -} - -public U8 *DCSave(CDC *dc,I64 *_size=NULL,I64 dcsf_flags=DCSF_COMPRESSED) -{//Stores device context to mem, perhaps, with compression. - U8 *res,*ptr,*body; - CArcCompress *arc; - I64 body_size=dc->width_internal*dc->height,total_size,flags; - CBGR48 palette[NUM_COLORS]; - - if (dcsf_flags&DCSF_COMPRESSED) { - arc=CompressBuf(dc->body,body_size); - body_size=arc->compressed_size; - body=arc; - } else { - arc=NULL; - body=dc->body; - } - - total_size=offset(CDC.end)-offset(CDC.start)+body_size; - if (dcsf_flags&DCSF_COMPRESSED) - flags=DCF_COMPRESSED; - else - flags=0; - - if (dcsf_flags&DCSF_PALETTE_GET) - GrPaletteGet(palette); - else - MemCpy(palette,&dc->palette,NUM_COLORS*sizeof(CBGR48)); - if (MemCmp(palette,gr_palette_std,NUM_COLORS*sizeof(CBGR48))) { - flags|=DCF_PALETTE; - total_size+=NUM_COLORS*sizeof(CBGR48); - } - - ptr=res=MAlloc(total_size); - -#assert !offset(CDC.start) - MemCpy(ptr,&dc->start,offset(CDC.end)-offset(CDC.start)); - ptr(CDC *)->flags=flags; - ptr+=offset(CDC.end)-offset(CDC.start); - -#assert offset(CDC.end)==offset(CDC.palette) - if (flags&DCF_PALETTE) { - MemCpy(ptr,palette,NUM_COLORS*sizeof(CBGR48)); - ptr+=NUM_COLORS*sizeof(CBGR48); - } - - MemCpy(ptr,body,body_size); - ptr+=body_size; - - Free(arc); - if (_size) *_size=total_size; - return res; -} - -public CDC *DCLoad(U8 *src,I64 *_size=NULL,CTask *task=NULL) -{//Loads device context from mem. - CDC *res; - U8 *ptr=src; - CArcCompress *arc; - I64 body_size; - if (!task) task=Fs; - res=CAlloc(sizeof(CDC),task); - res->win_task=task; - res->mem_task=task; - MemCpy(&res->start,ptr,offset(CDC.end)-offset(CDC.start)); - ptr+=offset(CDC.end)-offset(CDC.start); - - if (res->flags&DCF_PALETTE) { - MemCpy(&res->palette,ptr,NUM_COLORS*sizeof(CBGR48)); - ptr+=NUM_COLORS*sizeof(CBGR48); - } else - MemCpy(&res->palette,gr_palette_std,NUM_COLORS*sizeof(CBGR48)); - - body_size=res->width_internal*res->height; - if (res->flags&DCF_COMPRESSED) { - res->flags&=~DCF_COMPRESSED; - arc=ptr; - res->body=ExpandBuf(arc,task); - ptr+=arc->compressed_size; - } else { - res->body=MAlloc(body_size,task); - MemCpy(res->body,ptr,body_size); - ptr+=body_size; - } - res->pen_width=1; - res->r=Mat4x4IdentNew(task); - res->r_norm.u32[1]=1; - res->dc_signature=DCS_SIGNATURE_VAL; - if (_size) *_size=ptr-src; - return res; -} - -#help_index "Graphics/GRA Files" -#help_file "::/Doc/GRAFiles" -#help_index "Graphics/Device Contexts;Graphics/GRA Files" -public I64 GRAWrite(U8 *filename,CDC *dc,I64 dcsf_flags=DCSF_COMPRESSED) -{//TempleOS GRA File. - I64 size; - U8 *st=DftExt(filename,"GRA.Z"), - *src=DCSave(dc,&size,dcsf_flags); - FileWrite(st,src,size); - Free(st); - Free(src); - return size; -} - -public CDC *GRARead(U8 *filename,CTask *task=NULL) -{//TempleOS GRA File. - CDC *dc=NULL; - U8 *st=DftExt(filename,"GRA.Z"), - *src=FileRead(st); - if (src) - dc=DCLoad(src,,task); - Free(src); - Free(st); - return dc; -} - -#help_index "Graphics/Sprite;Graphics/GRA Files;DolDoc/Output;StdOut/DolDoc" -public U0 DocGRA(CDoc *doc=NULL,U8 *filename) -{//Put a GRA file into a document as asprite. - CDC *dc=GRARead(filename); - CSprite *elems=DC2Sprite(dc); - DocSprite(doc,elems); - Free(elems); - DCDel(dc); -} - -#help_index "Graphics/Device Contexts;Graphics/Screen" -public CDC *DCScreenCapture(Bool include_zoom=TRUE,CTask *task=NULL) -{//Capture screen to a device context. - CDC *dc; - U8 *dst; - WinMgrSync(2,TRUE); - if (include_zoom) - dc=DCCopy(gr.screen_image,task); - else - dc=DCCopy(gr.dc1,task); - dc->flags&=~DCF_SCREEN_BITMAP; - dst=MAlloc(dc->width_internal*dc->height,task); -//Pick background color that never occurs. COLOR_INVALID - GrBitMap4ToBitMap8(dst,dc->body, - (dc->width_internal*dc->height)>>1,COLOR_INVALID); - Free(dc->body); - dc->body=dst; - return dc; -} - -#help_index "Graphics/GRA Files;Graphics/Screen" -public I64 GRAScreenCapture(U8 *filename,Bool include_zoom=TRUE) -{//Capture screen to a TempleOS GRA File. - I64 size; - CDC *dc=DCScreenCapture(include_zoom); - size=GRAWrite(filename,dc,DCSF_COMPRESSED|DCSF_PALETTE_GET); - DCDel(dc); - return size; -} diff --git a/Adam/Gr/GrDC.HC b/Adam/Gr/GrDC.HC new file mode 100644 index 0000000..584eeef --- /dev/null +++ b/Adam/Gr/GrDC.HC @@ -0,0 +1,440 @@ +#help_index "Graphics/Math/3D Transformation" +#help_file "::/Doc/Transform" + +#define GR_SCALE (1<<32) + +public U0 Mat4x4MulXYZ(I64 *r,I64 *_x,I64 *_y,I64 *_z) +{//Rotate 3D point using 4x4 matrix. Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.HC"$. + I64 x1,y1,z1,xx=*_x,yy=*_y,zz=*_z; + x1=(r[0*4+0]*xx+r[0*4+1]*yy+r[0*4+2]*zz+r[0*4+3])>>32; + y1=(r[1*4+0]*xx+r[1*4+1]*yy+r[1*4+2]*zz+r[1*4+3])>>32; + z1=(r[2*4+0]*xx+r[2*4+1]*yy+r[2*4+2]*zz+r[2*4+3])>>32; + *_x=x1;*_y=y1;*_z=z1; +} + +public U0 DCTransform(CDC *dc,I64 *_x,I64 *_y,I64 *_z) +{//This is the dft dc->transform() callback. +//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.HC"$. + Mat4x4MulXYZ(dc->r,_x,_y,_z); + *_x+=dc->x; + *_y+=dc->y; + *_z+=dc->z; +} + +public I64 *Mat4x4IdentEqu(I64 *r) +{//Set matrix to identity. Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.HC"$. + MemSet(r,0,sizeof(I64)*16); + r[0*4+0].i32[1]=1; + r[1*4+1].i32[1]=1; + r[2*4+2].i32[1]=1; + r[3*4+3].i32[1]=1; + return r; +} + +public I64 *Mat4x4IdentNew(CTask *mem_task=NULL) +{//MAlloc an identity matrix. Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.HC"$. + return Mat4x4IdentEqu(MAlloc(sizeof(I64)*16,mem_task)); +} + +public I64 Mat4x4NormSqr65536(I64 *r) +{//Norm Squared of r. +//(1.0/Sqrt(3))*65536=37837.22 + return SqrI64((r[0*4+0]*37838+r[0*4+1]*37838+r[0*4+2]*37838)>>32)+ + SqrI64((r[1*4+0]*37837+r[1*4+1]*37837+r[1*4+2]*37837)>>32)+ + SqrI64((r[2*4+0]*37837+r[2*4+1]*37837+r[2*4+2]*37837)>>32); +} + +public U0 DCMat4x4Set(CDC *dc=NULL,I64 *r) +{//Set device context's rot matrix. Will be $LK,"Free",A="MN:Free"$d() in $LK,"DCDel",A="MN:DCDel"$().Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.HC"$. +//The main purpose is to set matrix norm for pen width scaling. + //NULL as dc means gr.dc + if (!dc) dc=gr.dc; + dc->r=r; + dc->r_norm=Sqrt(Mat4x4NormSqr65536(r))*65536; //scaled 32 bits +} + +#help_index "Graphics/Mesh" +public U0 DCLighting(CDC *dc, + CD3I32 *p1,CD3I32 *p2,CD3I32 *p3,CColorROPU32 color) +{//This is the dft dc->lighting() callback. + CD3I32 v1,v2; + I64 i,vn_x,vn_y,vn_z; + F64 d; + + v1.x=p1->x-p2->x; + v1.y=p1->y-p2->y; + v1.z=p1->z-p2->z; + + v2.x=p3->x-p2->x; + v2.y=p3->y-p2->y; + v2.z=p3->z-p2->z; + + //V1 and V2 are vects along two sides + //of the tri joined at p2. + + vn_x=v1.y*v2.z-v1.z*v2.y; + vn_y=v1.z*v2.x-v1.x*v2.z; + vn_z=v1.x*v2.y-v1.y*v2.x; + if (d=Sqrt(SqrI64(vn_x)+SqrI64(vn_y)+SqrI64(vn_z))) + d=1<<16/d; + vn_x*=d; + vn_y*=d; + vn_z*=d; +//Vn is the cross product of V1 and V3 + //which means it is perpendicular. It + //is the normal vect to the surface. + //It has been scaled to length 65536. + + //Light source has been scaled to length 65536. + i=(vn_x*dc->ls.x+vn_y*dc->ls.y+vn_z*dc->ls.z)>>16; +//The dot product of the light source + //vect and the surface normal + //gives an illumination number. + //65536*65536>>16=65536 + + //TempleOS will generate a random U16 + //and compare to dither_probability_u16 and + //will pick from two colors. + //Probability dithering does not work with pen_width>1 at this time. + if (color.c0.rop&ROPBF_TWO_SIDED) { + color.c0.rop&=~ROPBF_TWO_SIDED; + i=AbsI64(i)<<1; + } else + i+=65536; + if (color.c0.rop&ROPBF_HALF_RANGE_COLOR) { + color.c0.rop&=~ROPBF_HALF_RANGE_COLOR; + i>>=1; + if (color>=8) { + color-=8; + i+=65536; + } + } + if (i<65536) { + dc->color=ROPF_PROBABILITY_DITHER+color<<16+BLACK; + dc->dither_probability_u16=i; + } else { + dc->color=ROPF_PROBABILITY_DITHER+(color^8)<<16+color; + dc->dither_probability_u16=i-65536; + } +} + +#help_index "Graphics/Device Contexts" +public U0 DCFill(CDC *dc=NULL,CColorROPU32 val=TRANSPARENT) +{//Fill entire device context with color. + if (!dc) dc=gr.dc; + MemSet(dc->body,val,dc->width_internal*dc->height); +} + +public U0 DCClear(CDC *dc=NULL) +{//Set entire device context image body to 0 (BLACK). + if (!dc) dc=gr.dc; + DCFill(dc,0); +} + +public U0 DCRst(CDC *dc) +{//Reset $LK,"CDC",A="MN:CDC"$ structure members but not image body, itself. + dc->color=BLACK; + dc->color2=BLACK; + dc->bkcolor=BLACK; + dc->collision_cnt=0; + dc->pen_width=1; + dc->ls.x=37837; //1<<16/Sqrt(3) + dc->ls.y=37837; + dc->ls.z=37837; + dc->x=0; + dc->y=0; + dc->z=0; + dc->transform=&DCTransform; + dc->lighting =&DCLighting; + Mat4x4IdentEqu(dc->r); + dc->r_norm=GR_SCALE; + dc->flags&=~(DCF_SYMMETRY|DCF_TRANSFORMATION|DCF_JUST_MIRROR); + MemCpy(dc->palette,gr_palette_std,sizeof(CBGR48)*NUM_COLORS); +} + +public U0 DCExtentsInit(CDC *dc=NULL) +{//Init markers for extent of next newly drawn graphics. +//NULL means gr.dc + //See $LK,"::/Demo/Graphics/Extents.HC"$ + //You should clear the record flag yourself + if (!dc) dc=gr.dc; + dc->flags|=DCF_RECORD_EXTENTS; + dc->min_x=MAX_I64; + dc->max_x=MIN_I64; + dc->min_y=MAX_I64; + dc->max_y=MIN_I64; +} + +public CDC *DCAlias(CDC *dc=NULL,CTask *task=NULL) +{//Create alias of dc, so can change pen, color, etc. +//NULL means gr.dc + CDC *res; + if (!dc) dc=gr.dc; + if (!task) task=Fs; + if (dc->dc_signature!=DCS_SIGNATURE_VAL) + throw('Graphics'); + res=MAlloc(sizeof(CDC),task); + MemCpy(res,dc,sizeof(CDC)); + res->win_task=res->mem_task=task; + res->r=MAlloc(16*sizeof(I64),task); + DCRst(res); + res->flags|=DCF_ALIAS; + res->alias=dc; + return res; +} + +public CDC *DCNew(I64 width,I64 height,CTask *task=NULL,Bool null_bitmap=FALSE) +{//Create new width x height device context. +//Internally only allows widths which are divisible by 8. + //Don't forget these $MA-X+PU,"sizeof(CDC)",LM="Find(\"sizeof(CDC)\",\"/*\");View;"$. + CDC *res; + if (!task) task=Fs; + res=CAlloc(sizeof(CDC),task); + res->win_task=task; + res->mem_task=task; + res->width=width; + res->width_internal=(width+7)&~7; + res->height=height; + if (null_bitmap) + res->flags|=DCF_DONT_DRAW; + else + res->body=CAlloc(res->width_internal*res->height,task); + res->r=MAlloc(16*sizeof(I64),task); + DCRst(res); + res->dc_signature=DCS_SIGNATURE_VAL; + return res; +} + +public U0 DCDel(CDC *dc) +{//Free dc, image body, rot mat and depth buf. + if (!dc) return; + if (dc->dc_signature!=DCS_SIGNATURE_VAL) + throw('Graphics'); + dc->dc_signature=0; + Free(dc->r); + if (!(dc->flags & DCF_ALIAS)) + Free(dc->body); + Free(dc->depth_buf); + Free(dc); +} + +public I64 DCSize(CDC *dc) +{//Mem size of header, image body and depth buffer. + if (dc) + return MSize2(dc)+MSize2(dc->body)+MSize2(dc->depth_buf); + else + return 0; +} + +public I32 *DCDepthBufRst(CDC *dc) +{//Reset device context depth buf to far away. + if (dc->depth_buf) + MemSetU32(dc->depth_buf,MAX_I32,dc->width_internal*dc->height); + return dc->depth_buf; +} + +public I32 *DCDepthBufAlloc(CDC *dc) +{//Alloc a 32-bit depth buffer for device context. + Free(dc->depth_buf); + dc->depth_buf=MAlloc(dc->width_internal*dc->height*sizeof(I32),dc->mem_task); + return DCDepthBufRst(dc); +} + +public CDC *DCCopy(CDC *dc,CTask *task=NULL) +{//Alloc copy of dc, including image body, rot mat and depth buf. + CDC *res; + if (!dc) return NULL; + if (dc->dc_signature!=DCS_SIGNATURE_VAL) + throw('Graphics'); + res=MAllocIdent(dc,task); + DCMat4x4Set(res,Mat4x4New(dc->r,task)); + res->mem_task=task; + res->body=MAllocIdent(dc->body,task); + res->depth_buf=MAllocIdent(dc->depth_buf,task); + return res; +} + +public U0 DCMono(CDC *dc, + I64 quest=TRANSPARENT,I64 true_color=0,I64 false_color=COLOR_MONO) +{//Set entire device context to one of two colors. + I64 i; + U8 *dst; + dst=dc->body; + i=dc->width_internal*dc->height; + while (i--) + if (*dst==quest) + *dst++=true_color; + else + *dst++=false_color; +} + +public I64 DCColorChg(CDC *dc,I64 src_color,I64 dst_color=TRANSPARENT) +{//Find and replace src color with dst in device context. + I64 i,res=0; + U8 *dst; + dst=dc->body; + i=dc->width_internal*dc->height; + while (i--) + if (*dst==src_color) { + *dst++=dst_color; + res++; + } else + dst++; + return res; +} + +public U8 *DCSave(CDC *dc,I64 *_size=NULL,I64 dcsf_flags=DCSF_COMPRESSED) +{//Stores device context to mem, perhaps, with compression. + U8 *res,*ptr,*body; + CArcCompress *arc; + I64 body_size=dc->width_internal*dc->height,total_size,flags; + CBGR48 palette[NUM_COLORS]; + + if (dcsf_flags&DCSF_COMPRESSED) { + arc=CompressBuf(dc->body,body_size); + body_size=arc->compressed_size; + body=arc; + } else { + arc=NULL; + body=dc->body; + } + + total_size=offset(CDC.end)-offset(CDC.start)+body_size; + if (dcsf_flags&DCSF_COMPRESSED) + flags=DCF_COMPRESSED; + else + flags=0; + + if (dcsf_flags&DCSF_PALETTE_GET) + GrPaletteGet(palette); + else + MemCpy(palette,&dc->palette,NUM_COLORS*sizeof(CBGR48)); + if (MemCmp(palette,gr_palette_std,NUM_COLORS*sizeof(CBGR48))) { + flags|=DCF_PALETTE; + total_size+=NUM_COLORS*sizeof(CBGR48); + } + + ptr=res=MAlloc(total_size); + +#assert !offset(CDC.start) + MemCpy(ptr,&dc->start,offset(CDC.end)-offset(CDC.start)); + ptr(CDC *)->flags=flags; + ptr+=offset(CDC.end)-offset(CDC.start); + +#assert offset(CDC.end)==offset(CDC.palette) + if (flags&DCF_PALETTE) { + MemCpy(ptr,palette,NUM_COLORS*sizeof(CBGR48)); + ptr+=NUM_COLORS*sizeof(CBGR48); + } + + MemCpy(ptr,body,body_size); + ptr+=body_size; + + Free(arc); + if (_size) *_size=total_size; + return res; +} + +public CDC *DCLoad(U8 *src,I64 *_size=NULL,CTask *task=NULL) +{//Loads device context from mem. + CDC *res; + U8 *ptr=src; + CArcCompress *arc; + I64 body_size; + if (!task) task=Fs; + res=CAlloc(sizeof(CDC),task); + res->win_task=task; + res->mem_task=task; + MemCpy(&res->start,ptr,offset(CDC.end)-offset(CDC.start)); + ptr+=offset(CDC.end)-offset(CDC.start); + + if (res->flags&DCF_PALETTE) { + MemCpy(&res->palette,ptr,NUM_COLORS*sizeof(CBGR48)); + ptr+=NUM_COLORS*sizeof(CBGR48); + } else + MemCpy(&res->palette,gr_palette_std,NUM_COLORS*sizeof(CBGR48)); + + body_size=res->width_internal*res->height; + if (res->flags&DCF_COMPRESSED) { + res->flags&=~DCF_COMPRESSED; + arc=ptr; + res->body=ExpandBuf(arc,task); + ptr+=arc->compressed_size; + } else { + res->body=MAlloc(body_size,task); + MemCpy(res->body,ptr,body_size); + ptr+=body_size; + } + res->pen_width=1; + res->r=Mat4x4IdentNew(task); + res->r_norm.u32[1]=1; + res->dc_signature=DCS_SIGNATURE_VAL; + if (_size) *_size=ptr-src; + return res; +} + +#help_index "Graphics/GRA Files" +#help_file "::/Doc/GRAFiles" +#help_index "Graphics/Device Contexts;Graphics/GRA Files" +public I64 GRAWrite(U8 *filename,CDC *dc,I64 dcsf_flags=DCSF_COMPRESSED) +{//TempleOS GRA File. + I64 size; + U8 *st=DftExt(filename,"GRA.Z"), + *src=DCSave(dc,&size,dcsf_flags); + FileWrite(st,src,size); + Free(st); + Free(src); + return size; +} + +public CDC *GRARead(U8 *filename,CTask *task=NULL) +{//TempleOS GRA File. + CDC *dc=NULL; + U8 *st=DftExt(filename,"GRA.Z"), + *src=FileRead(st); + if (src) + dc=DCLoad(src,,task); + Free(src); + Free(st); + return dc; +} + +#help_index "Graphics/Sprite;Graphics/GRA Files;DolDoc/Output;StdOut/DolDoc" +public U0 DocGRA(CDoc *doc=NULL,U8 *filename) +{//Put a GRA file into a document as asprite. + CDC *dc=GRARead(filename); + CSprite *elems=DC2Sprite(dc); + DocSprite(doc,elems); + Free(elems); + DCDel(dc); +} + +#help_index "Graphics/Device Contexts;Graphics/Screen" +public CDC *DCScreenCapture(Bool include_zoom=TRUE,CTask *task=NULL) +{//Capture screen to a device context. + CDC *dc; + U8 *dst; + WinMgrSync(2,TRUE); + if (include_zoom) + dc=DCCopy(gr.screen_image,task); + else + dc=DCCopy(gr.dc1,task); + dc->flags&=~DCF_SCREEN_BITMAP; + dst=MAlloc(dc->width_internal*dc->height,task); +//Pick background color that never occurs. COLOR_INVALID + GrBitMap4ToBitMap8(dst,dc->body, + (dc->width_internal*dc->height)>>1,COLOR_INVALID); + Free(dc->body); + dc->body=dst; + return dc; +} + +#help_index "Graphics/GRA Files;Graphics/Screen" +public I64 GRAScreenCapture(U8 *filename,Bool include_zoom=TRUE) +{//Capture screen to a TempleOS GRA File. + I64 size; + CDC *dc=DCScreenCapture(include_zoom); + size=GRAWrite(filename,dc,DCSF_COMPRESSED|DCSF_PALETTE_GET); + DCDel(dc); + return size; +} diff --git a/Adam/Gr/GrEnd.CPP b/Adam/Gr/GrEnd.HC similarity index 100% rename from Adam/Gr/GrEnd.CPP rename to Adam/Gr/GrEnd.HC diff --git a/Adam/Gr/GrExt.CPP b/Adam/Gr/GrExt.HC similarity index 100% rename from Adam/Gr/GrExt.CPP rename to Adam/Gr/GrExt.HC diff --git a/Adam/Gr/GrGlbls.CPP b/Adam/Gr/GrGlbls.CPP deleted file mode 100644 index 054e18e..0000000 --- a/Adam/Gr/GrGlbls.CPP +++ /dev/null @@ -1,55 +0,0 @@ -#help_index "Graphics" - -public class CGrGlbls -{ - I64 *to_8_bits,*to_8_colors; - CDC *screen_image, //Read only. - *dc, //Persistent - *dc1, - *dc2, //Updated every refresh - *dc_cache, - *zoomed_dc; - U32 *text_base; //See $LK,"TextBase Layer",A="HI:TextBase Layer"$. (Similar to 0xB8000 but 32 bits) - U16 *win_z_buf; - - #define SPHT_ELEM_CODE 1 - CHashTable *sprite_hash; - - U16 *win_uncovered_bitmap; - I64 highest_uncovered; - U16 *vga_text_cache; - I64 pan_text_x,pan_text_y; //[-7,7] - U0 (*fp_final_screen_update)(CDC *dc);//Mouse cursor is handled here. - U0 (*fp_wall_paper)(CTask *task); - U0 (*fp_draw_input_ptr)(CDC *dc,I64 x,I64 y); - U0 (*fp_draw_grab_input_ptr)(CDC *dc,I64 x,I64 y,Bool closed); - U8 *empty_sprite; //Gets assigned $LK,"gr.empty_sprite",A="FF:::/Adam/AInputPointer.CPP,empty_sprite"$ - - #define GR_NUM_PEN_BRUSHES 64 - CDC *pen_brushes[GR_NUM_PEN_BRUSHES], - *collision_pen_brushes[GR_NUM_PEN_BRUSHES], - *even_pen_brushes[GR_NUM_PEN_BRUSHES], - *odd_pen_brushes[GR_NUM_PEN_BRUSHES]; - I8 circle_lo[GR_NUM_PEN_BRUSHES][GR_NUM_PEN_BRUSHES], - circle_hi[GR_NUM_PEN_BRUSHES][GR_NUM_PEN_BRUSHES]; - - #define GR_MAX_SCREEN_ZOOM 8 - U8 *screen_zoom_tables[GR_MAX_SCREEN_ZOOM+1]; - I64 screen_zoom,sx,sy; - - //When zoomed, this keeps the mouse centered. - Bool continuous_scroll, - hide_row,hide_col; -} gr; - -//See $LK,"RLf_VGA",A="FF:::/Kernel/KStart16.CPP,RLf_VGA"$ -//See $LK,"SysGrInit",A="MN:SysGrInit"$() -//Allows consts to be used instead of vars. -HashPublic("GR_WIDTH",HTT_DEFINE_STR);; -HashPublic("GR_HEIGHT",HTT_DEFINE_STR);; - -#help_index "Char;TextBase Layer/Char" -DefinePrint("TEXT_ROWS","%d",text.rows);;; -HashPublic("TEXT_ROWS",HTT_DEFINE_STR);;; -DefinePrint("TEXT_COLS","%d",text.cols);;; -HashPublic("TEXT_COLS",HTT_DEFINE_STR);;; diff --git a/Adam/Gr/GrGlbls.HC b/Adam/Gr/GrGlbls.HC new file mode 100644 index 0000000..733fbe0 --- /dev/null +++ b/Adam/Gr/GrGlbls.HC @@ -0,0 +1,55 @@ +#help_index "Graphics" + +public class CGrGlbls +{ + I64 *to_8_bits,*to_8_colors; + CDC *screen_image, //Read only. + *dc, //Persistent + *dc1, + *dc2, //Updated every refresh + *dc_cache, + *zoomed_dc; + U32 *text_base; //See $LK,"TextBase Layer",A="HI:TextBase Layer"$. (Similar to 0xB8000 but 32 bits) + U16 *win_z_buf; + + #define SPHT_ELEM_CODE 1 + CHashTable *sprite_hash; + + U16 *win_uncovered_bitmap; + I64 highest_uncovered; + U16 *vga_text_cache; + I64 pan_text_x,pan_text_y; //[-7,7] + U0 (*fp_final_screen_update)(CDC *dc);//Mouse cursor is handled here. + U0 (*fp_wall_paper)(CTask *task); + U0 (*fp_draw_input_ptr)(CDC *dc,I64 x,I64 y); + U0 (*fp_draw_grab_input_ptr)(CDC *dc,I64 x,I64 y,Bool closed); + U8 *empty_sprite; //Gets assigned $LK,"gr.empty_sprite",A="FF:::/Adam/AInputPointer.HC,empty_sprite"$ + + #define GR_NUM_PEN_BRUSHES 64 + CDC *pen_brushes[GR_NUM_PEN_BRUSHES], + *collision_pen_brushes[GR_NUM_PEN_BRUSHES], + *even_pen_brushes[GR_NUM_PEN_BRUSHES], + *odd_pen_brushes[GR_NUM_PEN_BRUSHES]; + I8 circle_lo[GR_NUM_PEN_BRUSHES][GR_NUM_PEN_BRUSHES], + circle_hi[GR_NUM_PEN_BRUSHES][GR_NUM_PEN_BRUSHES]; + + #define GR_MAX_SCREEN_ZOOM 8 + U8 *screen_zoom_tables[GR_MAX_SCREEN_ZOOM+1]; + I64 screen_zoom,sx,sy; + + //When zoomed, this keeps the mouse centered. + Bool continuous_scroll, + hide_row,hide_col; +} gr; + +//See $LK,"RLf_VGA",A="FF:::/Kernel/KStart16.HC,RLf_VGA"$ +//See $LK,"SysGrInit",A="MN:SysGrInit"$() +//Allows consts to be used instead of vars. +HashPublic("GR_WIDTH",HTT_DEFINE_STR);; +HashPublic("GR_HEIGHT",HTT_DEFINE_STR);; + +#help_index "Char;TextBase Layer/Char" +DefinePrint("TEXT_ROWS","%d",text.rows);;; +HashPublic("TEXT_ROWS",HTT_DEFINE_STR);;; +DefinePrint("TEXT_COLS","%d",text.cols);;; +HashPublic("TEXT_COLS",HTT_DEFINE_STR);;; diff --git a/Adam/Gr/GrInitA.CPP b/Adam/Gr/GrInitA.HC similarity index 100% rename from Adam/Gr/GrInitA.CPP rename to Adam/Gr/GrInitA.HC diff --git a/Adam/Gr/GrInitB.CPP b/Adam/Gr/GrInitB.HC similarity index 100% rename from Adam/Gr/GrInitB.CPP rename to Adam/Gr/GrInitB.HC diff --git a/Adam/Gr/GrMath.CPP b/Adam/Gr/GrMath.CPP deleted file mode 100644 index 0be6b32..0000000 --- a/Adam/Gr/GrMath.CPP +++ /dev/null @@ -1,805 +0,0 @@ -#help_index "Graphics/Math" - -public I64 gr_x_offsets[8]={-1, 0, 1,-1,1,-1,0,1}, - gr_y_offsets[8]={-1,-1,-1, 0,0, 1,1,1}, - gr_x_offsets2[4]={ 0,-1, 1, 0}, - gr_y_offsets2[4]={-1, 0, 0, 1}; - -public Bool Line(U8 *aux_data,I64 x1,I64 y1,I64 z1,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. -//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, - adx=AbsI64(dx),ady=AbsI64(dy),adz=AbsI64(dz); - Bool first=TRUE; - 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; - } - } - } 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;jflags&DCF_TRANSFORMATION) { - if (dc->pen_width) { - d=dc->pen_width*dc->r_norm+0x80000000; //Round - dc->pen_width=d.i32[1]; - if (dc->pen_width<1) - dc->pen_width=1; - } - } -} - -public I64 *Mat4x4TranslationEqu(I64 *r,I64 x,I64 y,I64 z) -{//Set translation values in 4x4 matrix. Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$. - r[0*4+3]=x<<32; - r[1*4+3]=y<<32; - r[2*4+3]=z<<32; - r[3*4+3]=GR_SCALE; - return r; -} - -public I64 *Mat4x4TranslationAdd(I64 *r,I64 x,I64 y,I64 z) -{//Add translation to 4x4 matrix. Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$. - r[0*4+3]+=x<<32; - r[1*4+3]+=y<<32; - r[2*4+3]+=z<<32; - r[3*4+3]=GR_SCALE; - return r; -} - -public Bool DCSymmetrySet(CDC *dc=gr.dc,I64 x1,I64 y1,I64 x2,I64 y2) -{//2D. Set device context's symmetry. - F64 d; - if (y1==y2 && x1==x2) - return FALSE; - dc->sym.snx=y2-y1; - dc->sym.sny=x1-x2; - dc->sym.snz=0; - if (d=Sqrt(SqrI64(dc->sym.snx)+ - SqrI64(dc->sym.sny)+ - SqrI64(dc->sym.snz))) { - d=GR_SCALE/d; - dc->sym.snx *= d; - dc->sym.sny *= d; - dc->sym.snz *= d; - } - dc->sym.sx=x1; - dc->sym.sy=y1; - dc->sym.sz=0; - return TRUE; -} - -public Bool DCSymmetry3Set(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1, - I64 x2,I64 y2,I64 z2,I64 x3,I64 y3,I64 z3) -{//3D. Set device context's symmetry. - F64 d,x,y,z,xx,yy,zz; - I64 xx1,yy1,zz1,xx2,yy2,zz2,*r; - xx1=x1-x2; yy1=y1-y2; zz1=z1-z2; - xx2=x3-x2; yy2=y3-y2; zz2=z3-z2; - if (!xx1 && !yy1 && !zz1 || - !xx2 && !yy2 && !zz2 || - xx1==xx2 && yy1==yy2 && zz1==zz2) - return FALSE; - - x=yy1*zz2-zz1*yy2; - y=-xx1*zz2+zz1*xx2; - z=xx1*yy2-yy1*xx2; - if (dc->flags & DCF_TRANSFORMATION) { - r=dc->r; - xx=x*r[0]+y*r[1]+z*r[2]; - yy=x*r[4]+y*r[5]+z*r[6]; - zz=x*r[8]+y*r[9]+z*r[10]; - x=xx; y=yy; z=zz; - } - if (d=Sqrt(Sqr(x)+Sqr(y)+Sqr(z))) { - d=GR_SCALE/d; - dc->sym.snx = d*x; - dc->sym.sny = d*y; - dc->sym.snz = d*z; - } - if (dc->flags & DCF_TRANSFORMATION) - (*dc->transform)(dc,&x1,&y1,&z1); - dc->sym.sx=x1; - dc->sym.sy=y1; - dc->sym.sz=z1; - return TRUE; -} - -public U0 DCReflect(CDC *dc,I64 *_x,I64 *_y,I64 *_z) -{//Reflect 3D point about device context's symmetry. Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$. - I64 x=*_x<<32,y=*_y<<32,z=*_z<<32, - xx=*_x-dc->sym.sx,yy=*_y-dc->sym.sy,zz=*_z-dc->sym.sz, - d=(xx*dc->sym.snx+yy*dc->sym.sny+zz*dc->sym.snz)>>16, - xn,yn,zn,xx2,yy2,zz2; - xn=d*dc->sym.snx>>15; - yn=d*dc->sym.sny>>15; - zn=d*dc->sym.snz>>15; - xx=x-xn; - yy=y-yn; - zz=z-zn; - xx2=x+xn; - yy2=y+yn; - zz2=z+zn; - if (SqrI64(xx>>16 -dc->sym.sx<<16)+ - SqrI64(yy>>16 -dc->sym.sy<<16)+ - SqrI64(zz>>16 -dc->sym.sz<<16)< - SqrI64(xx2>>16-dc->sym.sx<<16)+ - SqrI64(yy2>>16-dc->sym.sy<<16)+ - SqrI64(zz2>>16-dc->sym.sz<<16)) { - *_x=xx.i32[1]; *_y=yy.i32[1]; *_z=zz.i32[1]; - } else { - *_x=xx2.i32[1]; *_y=yy2.i32[1]; *_z=zz2.i32[1]; - } -} - -#help_index "Graphics/Math" -#define SCALE1 24 -#define SCALE2 8 -public Bool Circle(U8 *aux_data,I64 cx,I64 cy,I64 cz,I64 radius, - Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z), - I64 step=1,F64 start_radians=0,F64 len_radians=2*ã) -{//Step through circle arc calling callback. - I64 i,j,len=Ceil(len_radians*radius), - x,y,x1,y1,s1,s2,c; - F64 t; - if (radius<=0||!step) return TRUE; - t=1.0/radius; - c=1<>SCALE2,cy+y>>SCALE2,cz)) - return FALSE; - for (j=0;j>SCALE1; - y1=(s2*x+c*y)>>SCALE1; - x=x1; y=y1; - } - } - return TRUE; -} - -public Bool Ellipse(U8 *aux_data,I64 cx,I64 cy,I64 cz, - I64 x_radius,I64 y_radius,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. - I64 i,j,len, - x,y,_x,_y,x1,y1,x2,y2, s1,s2,c, s12,s22,c2; - F64 t; - Bool first=TRUE; - if (x_radius<=0 || y_radius<=0 || !step) - return TRUE; - if (x_radius>=y_radius) { - t=1.0/x_radius; - len=Ceil(len_radians*x_radius); - } else { - t=1.0/y_radius; - len=Ceil(len_radians*y_radius); - } - - c=1<>SCALE1; - y=(s22*x2+c2*y1)>>SCALE1; - - for (i=0;i<=len;i+=step) { - if ((x>>SCALE2!=_x || y>>SCALE2!=_y || first) && - !(*fp_plot)(aux_data,cx+x>>SCALE2,cy+y>>SCALE2,cz)) - return FALSE; - - _x=x>>SCALE2; _y=y>>SCALE2; first=FALSE; - for (j=0;j>SCALE1; - y1=(s2*x2+c*y2)>>SCALE1; - x2=x1; - y2=y1; - y1=y1*y_radius/x_radius; - x=(c2*x1+s12*y1)>>SCALE1; - y=(s22*x1+c2*y1)>>SCALE1; - } - } - return TRUE; -} - -public Bool RegPoly(U8 *aux_data,I64 cx,I64 cy,I64 cz, - I64 x_radius,I64 y_radius,I64 sides, - 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 regular polygon calling callback. - I64 i,n,x,y,x1,y1,x2,y2, - xx1,yy1,xx2,yy2, - s1,s2,c, s12,s22,c2; - F64 angle_step; - - if (sides<=0 || x_radius<=0 || y_radius<=0) - return TRUE; - - angle_step=2*ã/sides; - n=len_radians*sides/(2*ã); - - s1=1<>SCALE1; - y=(s22*x2+c2*y1)>>SCALE1; - - xx1=cx+x>>SCALE2; - yy1=cy+y>>SCALE2; - for (i=0;i>SCALE1; - y1=(s2*x2+c*y2)>>SCALE1; - x2=x1; - y2=y1; - y1=y1*y_radius/x_radius; - x=(c2*x1+s12*y1)>>SCALE1; - y=(s22*x1+c2*y1)>>SCALE1; - xx2=cx+x>>SCALE2; - yy2=cy+y>>SCALE2; - if (!Line(aux_data,xx1,yy1,cz,xx2,yy2,cz,fp_plot,step)) - return FALSE; - xx1=xx2; yy1=yy2; - } - return TRUE; -} - -#help_index "Graphics/Data Types/D3I32;Math/Data Types/D3I32;Data Types/D3I32" -public F64 D3I32Dist(CD3I32 *p1,CD3I32 *p2) -{//Distance - return Sqrt(SqrI64(p1->x-p2->x)+SqrI64(p1->y-p2->y)+SqrI64(p1->z-p2->z)); -} - -public I64 D3I32DistSqr(CD3I32 *p1,CD3I32 *p2) -{//Distance Squared - return SqrI64(p1->x-p2->x)+SqrI64(p1->y-p2->y)+SqrI64(p1->z-p2->z); -} - -public F64 D3I32Norm(CD3I32 *p) -{//Norm - return Sqrt(SqrI64(p->x)+SqrI64(p->y)+SqrI64(p->z)); -} - -public I64 D3I32NormSqr(CD3I32 *p) -{//Norm Squared - return SqrI64(p->x)+SqrI64(p->y)+SqrI64(p->z); -} - -#help_index "Graphics/Math" -public Bool Bezier2(U8 *aux_data,CD3I32 *ctrl, - Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),Bool first=TRUE) -{//Go in 2nd order bezier calling callback. - I64 x,y,z,xx,yy,zz,dx,dy,dz,d_max; - F64 x0=ctrl[0].x,y0=ctrl[0].y,z0=ctrl[0].z, - x1=ctrl[1].x-x0,y1=ctrl[1].y-y0,z1=ctrl[1].z-z0, - x2=ctrl[2].x-x0,y2=ctrl[2].y-y0,z2=ctrl[2].z-z0, - t,d=D3I32Dist(&ctrl[0],&ctrl[1])+ - D3I32Dist(&ctrl[1],&ctrl[2])+ - D3I32Dist(&ctrl[2],&ctrl[0]), - s=0.5/d,t1,t2; - xx=x0; yy=y0; zz=z0; - if (first && !(*fp_plot)(aux_data,xx,yy,zz)) - return FALSE; - for (t=0.0;t<=1.0;t+=s) { - t1=t*(1.0-t); - t2=t*t; - x=x0+x1*t1+x2*t2; - y=y0+y1*t1+y2*t2; - z=z0+z1*t1+z2*t2; - dx=AbsI64(x-xx); - dy=AbsI64(y-yy); - dz=AbsI64(z-zz); - if (dx>dy) - d_max=dx; - else - d_max=dy; - if (dz>d_max) - d_max=dz; - if (!d_max) - s*=1.1; - else { - s*=0.9; - if (!(*fp_plot)(aux_data,x,y,z)) - return FALSE; - xx=x;yy=y;zz=z; - } - } - x=ctrl[2].x; y=ctrl[2].y; z=ctrl[2].z; - if ((xx!=x || yy!=y || zz!=z) && - !(*fp_plot)(aux_data,x,y,z)) - return FALSE; - return TRUE; -} - -public Bool Bezier3(U8 *aux_data,CD3I32 *ctrl, - Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),Bool first=TRUE) -{//Go in 3rd order bezier calling callback. - I64 x,y,z,xx,yy,zz,dx,dy,dz,d_max; - F64 x0=ctrl[0].x,y0=ctrl[0].y,z0=ctrl[0].z, - x1=ctrl[1].x-x0,y1=ctrl[1].y-y0,z1=ctrl[1].z-z0, - x2=ctrl[2].x-x0,y2=ctrl[2].y-y0,z2=ctrl[2].z-z0, - x3=ctrl[3].x-x0,y3=ctrl[3].y-y0,z3=ctrl[3].z-z0, - t,d=D3I32Dist(&ctrl[0],&ctrl[1])+ - D3I32Dist(&ctrl[1],&ctrl[2])+ - D3I32Dist(&ctrl[2],&ctrl[3])+ - D3I32Dist(&ctrl[3],&ctrl[0]), - s=0.5/d,nt,t1,t2,t3; - xx=x0; yy=y0; zz=z0; - if (first && !(*fp_plot)(aux_data,xx,yy,zz)) - return FALSE; - for (t=0.0;t<=1.0;t+=s) { - nt=1.0-t; - t1=t*nt*nt; - t2=t*t*nt; - t3=t*t*t; - x=x0+x1*t1+x2*t2+x3*t3; - y=y0+y1*t1+y2*t2+y3*t3; - z=z0+z1*t1+z2*t2+z3*t3; - dx=AbsI64(x-xx); - dy=AbsI64(y-yy); - dz=AbsI64(z-zz); - if (dx>dy) - d_max=dx; - else - d_max=dy; - if (dz>d_max) - d_max=dz; - if (!d_max) - s*=1.1; - else { - s*=0.9; - if (!(*fp_plot)(aux_data,x,y,z)) - return FALSE; - xx=x;yy=y;zz=z; - } - } - x=ctrl[3].x; y=ctrl[3].y; z=ctrl[3].z; - if ((xx!=x || yy!=y || zz!=z) && - !(*fp_plot)(aux_data,x,y,z)) - return FALSE; - return TRUE; -} - -public Bool BSpline2(U8 *aux_data,CD3I32 *ctrl,I64 cnt, - Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),Bool closed=FALSE) -{//Go in 2nd order spline calling callback. - I64 i,j; - CD3I32 *c; - Bool first; - if (cnt<3) return FALSE; - first=TRUE; - if (closed) { - cnt++; - c=MAlloc(sizeof(CD3I32)*(cnt*2-1)); - j=1; - for (i=0;ibottom) - cc1=CC_BOTTOM; - else if (y1right) - cc1|=CC_RIGHT; - else if (x1bottom) - cc2=CC_BOTTOM; - else if (y2right) - cc2|=CC_RIGHT; - else if (x2bottom) - cc1=CC_BOTTOM; - else if (y1right) - cc1|=CC_RIGHT; - else if (x1bottom) - cc2=CC_BOTTOM; - else if (y2right) - cc2|=CC_RIGHT; - else if (x2=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; + } + } + } 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;jflags&DCF_TRANSFORMATION) { + if (dc->pen_width) { + d=dc->pen_width*dc->r_norm+0x80000000; //Round + dc->pen_width=d.i32[1]; + if (dc->pen_width<1) + dc->pen_width=1; + } + } +} + +public I64 *Mat4x4TranslationEqu(I64 *r,I64 x,I64 y,I64 z) +{//Set translation values in 4x4 matrix. Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.HC"$. + r[0*4+3]=x<<32; + r[1*4+3]=y<<32; + r[2*4+3]=z<<32; + r[3*4+3]=GR_SCALE; + return r; +} + +public I64 *Mat4x4TranslationAdd(I64 *r,I64 x,I64 y,I64 z) +{//Add translation to 4x4 matrix. Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.HC"$. + r[0*4+3]+=x<<32; + r[1*4+3]+=y<<32; + r[2*4+3]+=z<<32; + r[3*4+3]=GR_SCALE; + return r; +} + +public Bool DCSymmetrySet(CDC *dc=gr.dc,I64 x1,I64 y1,I64 x2,I64 y2) +{//2D. Set device context's symmetry. + F64 d; + if (y1==y2 && x1==x2) + return FALSE; + dc->sym.snx=y2-y1; + dc->sym.sny=x1-x2; + dc->sym.snz=0; + if (d=Sqrt(SqrI64(dc->sym.snx)+ + SqrI64(dc->sym.sny)+ + SqrI64(dc->sym.snz))) { + d=GR_SCALE/d; + dc->sym.snx *= d; + dc->sym.sny *= d; + dc->sym.snz *= d; + } + dc->sym.sx=x1; + dc->sym.sy=y1; + dc->sym.sz=0; + return TRUE; +} + +public Bool DCSymmetry3Set(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1, + I64 x2,I64 y2,I64 z2,I64 x3,I64 y3,I64 z3) +{//3D. Set device context's symmetry. + F64 d,x,y,z,xx,yy,zz; + I64 xx1,yy1,zz1,xx2,yy2,zz2,*r; + xx1=x1-x2; yy1=y1-y2; zz1=z1-z2; + xx2=x3-x2; yy2=y3-y2; zz2=z3-z2; + if (!xx1 && !yy1 && !zz1 || + !xx2 && !yy2 && !zz2 || + xx1==xx2 && yy1==yy2 && zz1==zz2) + return FALSE; + + x=yy1*zz2-zz1*yy2; + y=-xx1*zz2+zz1*xx2; + z=xx1*yy2-yy1*xx2; + if (dc->flags & DCF_TRANSFORMATION) { + r=dc->r; + xx=x*r[0]+y*r[1]+z*r[2]; + yy=x*r[4]+y*r[5]+z*r[6]; + zz=x*r[8]+y*r[9]+z*r[10]; + x=xx; y=yy; z=zz; + } + if (d=Sqrt(Sqr(x)+Sqr(y)+Sqr(z))) { + d=GR_SCALE/d; + dc->sym.snx = d*x; + dc->sym.sny = d*y; + dc->sym.snz = d*z; + } + if (dc->flags & DCF_TRANSFORMATION) + (*dc->transform)(dc,&x1,&y1,&z1); + dc->sym.sx=x1; + dc->sym.sy=y1; + dc->sym.sz=z1; + return TRUE; +} + +public U0 DCReflect(CDC *dc,I64 *_x,I64 *_y,I64 *_z) +{//Reflect 3D point about device context's symmetry. Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.HC"$. + I64 x=*_x<<32,y=*_y<<32,z=*_z<<32, + xx=*_x-dc->sym.sx,yy=*_y-dc->sym.sy,zz=*_z-dc->sym.sz, + d=(xx*dc->sym.snx+yy*dc->sym.sny+zz*dc->sym.snz)>>16, + xn,yn,zn,xx2,yy2,zz2; + xn=d*dc->sym.snx>>15; + yn=d*dc->sym.sny>>15; + zn=d*dc->sym.snz>>15; + xx=x-xn; + yy=y-yn; + zz=z-zn; + xx2=x+xn; + yy2=y+yn; + zz2=z+zn; + if (SqrI64(xx>>16 -dc->sym.sx<<16)+ + SqrI64(yy>>16 -dc->sym.sy<<16)+ + SqrI64(zz>>16 -dc->sym.sz<<16)< + SqrI64(xx2>>16-dc->sym.sx<<16)+ + SqrI64(yy2>>16-dc->sym.sy<<16)+ + SqrI64(zz2>>16-dc->sym.sz<<16)) { + *_x=xx.i32[1]; *_y=yy.i32[1]; *_z=zz.i32[1]; + } else { + *_x=xx2.i32[1]; *_y=yy2.i32[1]; *_z=zz2.i32[1]; + } +} + +#help_index "Graphics/Math" +#define SCALE1 24 +#define SCALE2 8 +public Bool Circle(U8 *aux_data,I64 cx,I64 cy,I64 cz,I64 radius, + Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z), + I64 step=1,F64 start_radians=0,F64 len_radians=2*ã) +{//Step through circle arc calling callback. + I64 i,j,len=Ceil(len_radians*radius), + x,y,x1,y1,s1,s2,c; + F64 t; + if (radius<=0||!step) return TRUE; + t=1.0/radius; + c=1<>SCALE2,cy+y>>SCALE2,cz)) + return FALSE; + for (j=0;j>SCALE1; + y1=(s2*x+c*y)>>SCALE1; + x=x1; y=y1; + } + } + return TRUE; +} + +public Bool Ellipse(U8 *aux_data,I64 cx,I64 cy,I64 cz, + I64 x_radius,I64 y_radius,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. + I64 i,j,len, + x,y,_x,_y,x1,y1,x2,y2, s1,s2,c, s12,s22,c2; + F64 t; + Bool first=TRUE; + if (x_radius<=0 || y_radius<=0 || !step) + return TRUE; + if (x_radius>=y_radius) { + t=1.0/x_radius; + len=Ceil(len_radians*x_radius); + } else { + t=1.0/y_radius; + len=Ceil(len_radians*y_radius); + } + + c=1<>SCALE1; + y=(s22*x2+c2*y1)>>SCALE1; + + for (i=0;i<=len;i+=step) { + if ((x>>SCALE2!=_x || y>>SCALE2!=_y || first) && + !(*fp_plot)(aux_data,cx+x>>SCALE2,cy+y>>SCALE2,cz)) + return FALSE; + + _x=x>>SCALE2; _y=y>>SCALE2; first=FALSE; + for (j=0;j>SCALE1; + y1=(s2*x2+c*y2)>>SCALE1; + x2=x1; + y2=y1; + y1=y1*y_radius/x_radius; + x=(c2*x1+s12*y1)>>SCALE1; + y=(s22*x1+c2*y1)>>SCALE1; + } + } + return TRUE; +} + +public Bool RegPoly(U8 *aux_data,I64 cx,I64 cy,I64 cz, + I64 x_radius,I64 y_radius,I64 sides, + 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 regular polygon calling callback. + I64 i,n,x,y,x1,y1,x2,y2, + xx1,yy1,xx2,yy2, + s1,s2,c, s12,s22,c2; + F64 angle_step; + + if (sides<=0 || x_radius<=0 || y_radius<=0) + return TRUE; + + angle_step=2*ã/sides; + n=len_radians*sides/(2*ã); + + s1=1<>SCALE1; + y=(s22*x2+c2*y1)>>SCALE1; + + xx1=cx+x>>SCALE2; + yy1=cy+y>>SCALE2; + for (i=0;i>SCALE1; + y1=(s2*x2+c*y2)>>SCALE1; + x2=x1; + y2=y1; + y1=y1*y_radius/x_radius; + x=(c2*x1+s12*y1)>>SCALE1; + y=(s22*x1+c2*y1)>>SCALE1; + xx2=cx+x>>SCALE2; + yy2=cy+y>>SCALE2; + if (!Line(aux_data,xx1,yy1,cz,xx2,yy2,cz,fp_plot,step)) + return FALSE; + xx1=xx2; yy1=yy2; + } + return TRUE; +} + +#help_index "Graphics/Data Types/D3I32;Math/Data Types/D3I32;Data Types/D3I32" +public F64 D3I32Dist(CD3I32 *p1,CD3I32 *p2) +{//Distance + return Sqrt(SqrI64(p1->x-p2->x)+SqrI64(p1->y-p2->y)+SqrI64(p1->z-p2->z)); +} + +public I64 D3I32DistSqr(CD3I32 *p1,CD3I32 *p2) +{//Distance Squared + return SqrI64(p1->x-p2->x)+SqrI64(p1->y-p2->y)+SqrI64(p1->z-p2->z); +} + +public F64 D3I32Norm(CD3I32 *p) +{//Norm + return Sqrt(SqrI64(p->x)+SqrI64(p->y)+SqrI64(p->z)); +} + +public I64 D3I32NormSqr(CD3I32 *p) +{//Norm Squared + return SqrI64(p->x)+SqrI64(p->y)+SqrI64(p->z); +} + +#help_index "Graphics/Math" +public Bool Bezier2(U8 *aux_data,CD3I32 *ctrl, + Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),Bool first=TRUE) +{//Go in 2nd order bezier calling callback. + I64 x,y,z,xx,yy,zz,dx,dy,dz,d_max; + F64 x0=ctrl[0].x,y0=ctrl[0].y,z0=ctrl[0].z, + x1=ctrl[1].x-x0,y1=ctrl[1].y-y0,z1=ctrl[1].z-z0, + x2=ctrl[2].x-x0,y2=ctrl[2].y-y0,z2=ctrl[2].z-z0, + t,d=D3I32Dist(&ctrl[0],&ctrl[1])+ + D3I32Dist(&ctrl[1],&ctrl[2])+ + D3I32Dist(&ctrl[2],&ctrl[0]), + s=0.5/d,t1,t2; + xx=x0; yy=y0; zz=z0; + if (first && !(*fp_plot)(aux_data,xx,yy,zz)) + return FALSE; + for (t=0.0;t<=1.0;t+=s) { + t1=t*(1.0-t); + t2=t*t; + x=x0+x1*t1+x2*t2; + y=y0+y1*t1+y2*t2; + z=z0+z1*t1+z2*t2; + dx=AbsI64(x-xx); + dy=AbsI64(y-yy); + dz=AbsI64(z-zz); + if (dx>dy) + d_max=dx; + else + d_max=dy; + if (dz>d_max) + d_max=dz; + if (!d_max) + s*=1.1; + else { + s*=0.9; + if (!(*fp_plot)(aux_data,x,y,z)) + return FALSE; + xx=x;yy=y;zz=z; + } + } + x=ctrl[2].x; y=ctrl[2].y; z=ctrl[2].z; + if ((xx!=x || yy!=y || zz!=z) && + !(*fp_plot)(aux_data,x,y,z)) + return FALSE; + return TRUE; +} + +public Bool Bezier3(U8 *aux_data,CD3I32 *ctrl, + Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),Bool first=TRUE) +{//Go in 3rd order bezier calling callback. + I64 x,y,z,xx,yy,zz,dx,dy,dz,d_max; + F64 x0=ctrl[0].x,y0=ctrl[0].y,z0=ctrl[0].z, + x1=ctrl[1].x-x0,y1=ctrl[1].y-y0,z1=ctrl[1].z-z0, + x2=ctrl[2].x-x0,y2=ctrl[2].y-y0,z2=ctrl[2].z-z0, + x3=ctrl[3].x-x0,y3=ctrl[3].y-y0,z3=ctrl[3].z-z0, + t,d=D3I32Dist(&ctrl[0],&ctrl[1])+ + D3I32Dist(&ctrl[1],&ctrl[2])+ + D3I32Dist(&ctrl[2],&ctrl[3])+ + D3I32Dist(&ctrl[3],&ctrl[0]), + s=0.5/d,nt,t1,t2,t3; + xx=x0; yy=y0; zz=z0; + if (first && !(*fp_plot)(aux_data,xx,yy,zz)) + return FALSE; + for (t=0.0;t<=1.0;t+=s) { + nt=1.0-t; + t1=t*nt*nt; + t2=t*t*nt; + t3=t*t*t; + x=x0+x1*t1+x2*t2+x3*t3; + y=y0+y1*t1+y2*t2+y3*t3; + z=z0+z1*t1+z2*t2+z3*t3; + dx=AbsI64(x-xx); + dy=AbsI64(y-yy); + dz=AbsI64(z-zz); + if (dx>dy) + d_max=dx; + else + d_max=dy; + if (dz>d_max) + d_max=dz; + if (!d_max) + s*=1.1; + else { + s*=0.9; + if (!(*fp_plot)(aux_data,x,y,z)) + return FALSE; + xx=x;yy=y;zz=z; + } + } + x=ctrl[3].x; y=ctrl[3].y; z=ctrl[3].z; + if ((xx!=x || yy!=y || zz!=z) && + !(*fp_plot)(aux_data,x,y,z)) + return FALSE; + return TRUE; +} + +public Bool BSpline2(U8 *aux_data,CD3I32 *ctrl,I64 cnt, + Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),Bool closed=FALSE) +{//Go in 2nd order spline calling callback. + I64 i,j; + CD3I32 *c; + Bool first; + if (cnt<3) return FALSE; + first=TRUE; + if (closed) { + cnt++; + c=MAlloc(sizeof(CD3I32)*(cnt*2-1)); + j=1; + for (i=0;ibottom) + cc1=CC_BOTTOM; + else if (y1right) + cc1|=CC_RIGHT; + else if (x1bottom) + cc2=CC_BOTTOM; + else if (y2right) + cc2|=CC_RIGHT; + else if (x2bottom) + cc1=CC_BOTTOM; + else if (y1right) + cc1|=CC_RIGHT; + else if (x1bottom) + cc2=CC_BOTTOM; + else if (y2right) + cc2|=CC_RIGHT; + else if (x2width-1; - *bottom=dc->height-1; - if (dc->flags & DCF_SCREEN_BITMAP) { - win_task=dc->win_task; - if (GR_WIDTH-1<*right) - *right=GR_WIDTH-1; - if (GR_HEIGHT-1<*bottom) - *bottom=GR_HEIGHT-1; - if (win_task->pix_left>*left) - *left=win_task->pix_left; - if (win_task->pix_top>*top) - *top=win_task->pix_top; - if (win_task->pix_right<*right) - *right=win_task->pix_right; - if (win_task->pix_bottom<*bottom) - *bottom=win_task->pix_bottom; - } - *left-=width; - *right+=width; - *top-=height; - *bottom+=height; - return *left<=*right && *top<=*bottom; -} - -Bool DCClipLine(CDC *dc=gr.dc,I64 *x1,I64 *y1,I64 *x2,I64 *y2, - I64 width=0,I64 height=0) -{//Also converts window to screen coordinates - I64 left,top,right,bottom; - CTask *win_task; - if (GrClamp(dc,&left,&top,&right,&bottom,width,height)) { - if (dc->flags & DCF_SCREEN_BITMAP) { - win_task=dc->win_task; - *x1+=win_task->pix_left+win_task->scroll_x; - *y1+=win_task->pix_top+win_task->scroll_y; - *x2+=win_task->pix_left+win_task->scroll_x; - *y2+=win_task->pix_top+win_task->scroll_y; - } - return ClipLine(x1,y1,x2,y2,left,top,right,bottom); - } else - return FALSE; -} - -public Bool GrPlot(CDC *dc=gr.dc,I64 x,I64 y) -{//2D. Clipping but No transformation or pen width. - I32 *db=dc->depth_buf; - CTask *win_task; - CColorROPU32 old_color; - dc->depth_buf=NULL; - if (dc->brush) { - old_color=dc->color; - if (dc->color.c0.rop!=ROPB_COLLISION) - dc->color.c0.rop=ROPB_MONO; - GrBlot(dc,x,y,dc->brush); - dc->color=old_color; - } else if (dc->flags & DCF_SCREEN_BITMAP) { - win_task=dc->win_task; - x+=win_task->pix_left+win_task->scroll_x; - y+=win_task->pix_top+win_task->scroll_y; - if (win_task->pix_left<=x<=win_task->pix_right && - win_task->pix_top <=y<=win_task->pix_bottom && - 0<=xwidth && 0<=yheight && - (win_task->next_task==sys_winmgr_task || - dc->flags&DCF_ON_TOP || - !IsPixCovered0(win_task,x,y))) - GrPlot0(dc,x,y); - } else - if (0<=xwidth && 0<=yheight) - GrPlot0(dc,x,y); - dc->depth_buf=db; - return TRUE; -} - -Bool GrPlot1(CDC *dc=gr.dc,I64 x,I64 y) -{//Clipping but No transformation or pen width, called with db_z set - CTask *win_task; - CColorROPU32 old_color; - if (dc->brush) { - old_color=dc->color; - if (dc->color.c0.rop!=ROPB_COLLISION) - dc->color.c0.rop=ROPB_MONO; - if (dc->depth_buf) - GrBlot3(dc,x,y,dc->db_z,dc->brush); - else - GrBlot(dc,x,y,dc->brush); - dc->color=old_color; - } else if (dc->flags & DCF_SCREEN_BITMAP) { - win_task=dc->win_task; - x+=win_task->pix_left+win_task->scroll_x; - y+=win_task->pix_top+win_task->scroll_y; - if (win_task->pix_left<=x<=win_task->pix_right && - win_task->pix_top <=y<=win_task->pix_bottom && - 0<=xwidth && 0<=yheight && - (win_task->next_task==sys_winmgr_task || - dc->flags&DCF_ON_TOP || - !IsPixCovered0(win_task,x,y))) - GrPlot0(dc,x,y); - } else - if (0<=xwidth && 0<=yheight) - GrPlot0(dc,x,y); - return TRUE; -} - -public I64 GrPeek(CDC *dc=gr.dc,I64 x,I64 y) -{//2D. Clipping but no transformation. -//Returns pix color or -1 if off-screen or covered. - CTask *win_task; - if (dc->flags & DCF_SCREEN_BITMAP) { - win_task=dc->win_task; - x+=win_task->pix_left+win_task->scroll_x; - y+=win_task->pix_top+win_task->scroll_y; - if (!(win_task->pix_left<=x<=win_task->pix_right) || - !(win_task->pix_top <=y<=win_task->pix_bottom) || - !(0<=xwidth) || !(0<=yheight) || - win_task->next_task!=sys_winmgr_task && - !(dc->flags&DCF_ON_TOP) && - IsPixCovered0(win_task,x,y)) - return -1; - } else - if (!(0<=xwidth) || !(0<=yheight)) - return -1; - return GrPeek0(dc,x,y); -} - -/* - -This is an easier to understand -version of the nonrecursive routine below. -I64 GrFloodFillRay(CDC *dc,I64 x,I64 y,I64 z,I32 *db) -{ - I64 res,j,x1,ray_len,ray_len2; - - if (UnusedStk<0x80) - Dbg("Stk Overflow",Fs); - - res=ray_len=GrRayLen(dc,&x,y,z,db); - y--; - j=ray_len; - x1=x; - while (j>0) { - if (ray_len2=GrRayLenMinus(dc,x1,y)) - res+=GrFloodFillRay(dc,x1,y,z,db); - j-=ray_len2+1; - x1-=ray_len2+1; - } - y+=2; - j=ray_len; - x1=x; - while (j>0) { - if (ray_len2=GrRayLenMinus(dc,x1,y)) - res+=GrFloodFillRay(dc,x1,y,z,db); - j-=ray_len2+1; - x1-=ray_len2+1; - } - return res; -} -*/ - -class CFFRay -{ - I64 state,x,y,j,x1,ray_len,ray_len2; -}; - -I64 GrFloodFillRay(CDC *dc,I64 x,I64 y,I64 z,I32 *db) -{//See the above commented-out routine for an easier to understand version. -//Returns cnt of pixs changed - I64 res=0; -//We don't dynamically calculate the size to avoid - //fragmentation of memory. - CFFRay *f_dc=MAlloc(sizeof(CFFRay)*0x80000),*f=f_dc; - f->x=x; - f->y=y; - f->state=0; - do { - switch [f->state] { - case 0: - f->state++; - res+=f->ray_len=GrRayLen(dc,&f->x,f->y,z,db); - f->y--; - f->j=f->ray_len; - f->x1=f->x; - break; - case 1: - if (f->j>0) { - f->state++; - if (f->ray_len2=GrRayLenMinus(dc,f->x1,f->y)) { - f[1].x=f->x1; - f[1].y=f->y; - f[1].state=0; - f++; - } - } else - f->state+=2; - break; - case 2: - f->state--; - f->j-=f->ray_len2+1; - f->x1-=f->ray_len2+1; - break; - case 3: - f->state++; - f->y+=2; - f->j=f->ray_len; - f->x1=f->x; - break; - case 4: - if (f->j>0) { - f->state++; - if (f->ray_len2=GrRayLenMinus(dc,f->x1,f->y)) { - f[1].x=f->x1; - f[1].y=f->y; - f[1].state=0; - f++; - } - } else - f->state+=2; - break; - case 5: - f->state--; - f->j-=f->ray_len2+1; - f->x1-=f->ray_len2+1; - break; - case 6: - f--; - break; - } - } while (f>=f_dc); - Free(f_dc); - return res; -} - -public I64 GrFloodFill(CDC *dc=gr.dc,I64 x,I64 y, - Bool not_color=FALSE,I64 z=0,I32 *db=NULL) -{//2D. Ignore z and db. -//not_color=TRUE means fill up to everything which is not the current color. - //not_color=FALSE means fill all parts equ to the color under the point. - //Returns cnt of pixs changed - I64 res=0,j,old_flags=dc->flags; - CColorROPU32 old_color2=dc->color2; - CDC *old_brush; - if (dc->flags & DCF_DONT_DRAW) //TODO - return 0; - old_brush=dc->brush; - dc->brush=NULL; - if ((j=GrPeek(dc,x,y))>=0) { - if (not_color) { - dc->color2=dc->color.c0.color; - dc->flags|=DCF_FILL_NOT_COLOR; - } else { - dc->color2=j; - if (dc->color.c1.rop&ROPBF_DITHER) { - if (dc->color2.c0.color==dc->color.c0.color && - dc->color.c0.color==dc->color.c1.color) - goto ff_done; - } else if (dc->color2.c0.color==dc->color.c0.color) - goto ff_done; - dc->flags&=~DCF_FILL_NOT_COLOR; - } - if (not_color && j!=dc->color2 || - !not_color) - res=GrFloodFillRay(dc,x,y,z,db); - } -ff_done: - dc->brush=old_brush; - dc->flags=old_flags; - dc->color2=old_color2; - 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>1); - for (i=0;i>1); - for (i=r+1;i>1); - for (i=0;i>1); - for (i=r+1;i>1); - for (i=0;i>1); - for (i=r+1;i>1); - for (i=0;i>1); - for (i=r+1;i>1,rr; - if (diameter>=1) { - if (diameter>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 (;iflags & DCF_TRANSFORMATION) { - (*dc->transform)(dc,&x,&y,&z); - dc->flags&=~DCF_TRANSFORMATION; - was_transform=TRUE; - } - if (dc->flags & DCF_SYMMETRY) { - _x=x; _y=y; _z=z; - DCReflect(dc,&_x,&_y,&_z); - dc->flags&=~DCF_SYMMETRY; - dc->db_z=_z; - GrPlot1(dc,_x,_y); - was_symmetry=TRUE; - if (dc->flags&DCF_JUST_MIRROR) - goto gr_done; - } - dc->db_z=z; - GrPlot1(dc,x,y); -gr_done: - if (was_transform) - dc->flags|=DCF_TRANSFORMATION; - if (was_symmetry) - dc->flags|=DCF_SYMMETRY; - return TRUE; -} - -public Bool GrPlot3(CDC *dc=gr.dc,I64 x,I64 y,I64 z) -{//3D. Clipping and transformation and pen width. - I64 _x,_y,_z,w,dist; - CColorROPU32 old_color=dc->color; - Bool record,was_transform=FALSE,was_symmetry=FALSE; - CTask *win_task; - if (dc->flags & DCF_TRANSFORMATION) { - (*dc->transform)(dc,&x,&y,&z); - dc->flags&=~DCF_TRANSFORMATION; - was_transform=TRUE; - } - if (dc->flags & DCF_SYMMETRY) { - _x=x; _y=y; _z=z; - DCReflect(dc,&_x,&_y,&_z); - dc->flags&=~DCF_SYMMETRY; - GrPlot3(dc,_x,_y,_z); - was_symmetry=TRUE; - if (dc->flags&DCF_JUST_MIRROR) - goto gr_done; - } - w=dc->pen_width>>1; - dc->db_z=z; - if (dc->brush || w<=0) - GrPlot1(dc,x,y); - else if (dc->pen_widthcolor.c0.rop!=ROPB_COLLISION) - dc->color.c0.rop=ROPB_MONO; - if (dc->depth_buf) { - if (dc->color.c1.rop&ROPBF_DITHER) { - dc->color.c1.rop=dc->color.c0.rop; - if (((x-w)^(y-w))&1) { - record=GrBlot3(dc,x-w,y-w,z,gr.odd_pen_brushes[dc->pen_width]); - dc->color.c0=dc->color.c1; - record=GrBlot3(dc,x-w,y-w,z,gr.even_pen_brushes[dc->pen_width]); - } else { - record=GrBlot3(dc,x-w,y-w,z,gr.even_pen_brushes[dc->pen_width]); - dc->color.c0=dc->color.c1; - record=GrBlot3(dc,x-w,y-w,z,gr.odd_pen_brushes[dc->pen_width]); - } - } else { - if (dc->color.c0.rop==ROPB_COLLISION) { - if (dc->color.c0.color!=dc->bkcolor.c0.color && - dc->color.c0.color!=TRANSPARENT) - record=GrBlot3(dc,x-w,y-w,z, - gr.collision_pen_brushes[dc->pen_width]); - else - record=FALSE; - } else - record=GrBlot3(dc,x-w,y-w,z,gr.pen_brushes[dc->pen_width]); - } - } else { - if (dc->color.c1.rop&ROPBF_DITHER) { - dc->color.c1.rop=dc->color.c0.rop; - if (((x-w)^(y-w))&1) { - record=GrBlot(dc,x-w,y-w,gr.odd_pen_brushes[dc->pen_width]); - dc->color.c0=dc->color.c1; - record=GrBlot(dc,x-w,y-w,gr.even_pen_brushes[dc->pen_width]); - } else { - record=GrBlot(dc,x-w,y-w,gr.even_pen_brushes[dc->pen_width]); - dc->color.c0=dc->color.c1; - record=GrBlot(dc,x-w,y-w,gr.odd_pen_brushes[dc->pen_width]); - } - } else { - if (dc->color.c0.rop==ROPB_COLLISION) { - if (dc->color.c0.color!=dc->bkcolor.c0.color && - dc->color.c0.color!=TRANSPARENT) - record=GrBlot(dc,x-w,y-w,gr.collision_pen_brushes[dc->pen_width]); - else - record=FALSE; - } else - record=GrBlot(dc,x-w,y-w,gr.pen_brushes[dc->pen_width]); - } - } - if (record) { - if (dc->flags & DCF_SCREEN_BITMAP) { - win_task=dc->win_task; - x+=win_task->pix_left+win_task->scroll_x; - y+=win_task->pix_top+win_task->scroll_y; - } - if (dc->flags & DCF_LOCATE_NEAREST) { - dist=DistSqrI64(x,y,dc->cur_x,dc->cur_y); - if (dist<=dc->nearest_dist) { - dc->nearest_dist=dist; - dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num; - } - } - if (dc->flags & DCF_RECORD_EXTENTS) { - if (x-wmin_x) dc->min_x=x-w; - if (y-wmin_y) dc->min_y=y-w; - if (dc->pen_width & 1) { - if (x+w>dc->max_x) dc->max_x=x+w; - if (y+w>dc->max_y) dc->max_y=y+w; - } else { - if (x+w-1>dc->max_x) dc->max_x=x+w-1; - if (y+w-1>dc->max_y) dc->max_y=y+w-1; - } - } - } - } else - GrFillCircle(dc,x,y,dc->db_z,dc->pen_width); -gr_done: - dc->color=old_color; - if (was_transform) - dc->flags|=DCF_TRANSFORMATION; - if (was_symmetry) - dc->flags|=DCF_SYMMETRY; - return TRUE; -} - -Bool GrLinePlot0(CDC *dc,I64 x,I64 y,I64 z) -{//This is a callback. - CTask *win_task=dc->win_task; - if (!(dc->flags & DCF_SCREEN_BITMAP) || - win_task->next_task==sys_winmgr_task || - dc->flags&DCF_ON_TOP || - !IsPixCovered0(win_task,x,y)) { - dc->db_z=z; - GrPlot0(dc,x,y); - } - return TRUE; -} - -Bool GrLinePlot(CDC *dc,I64 x,I64 y,I64 z) -{//This is a callback. - dc->db_z=z; - GrPlot1(dc,x,y); - return TRUE; -} - -public Bool GrLine(CDC *dc=gr.dc,I64 x1,I64 y1,I64 x2,I64 y2, - I64 step=1,I64 start=0) -{//2D. Clipping but not transformation. - Bool res=FALSE; - I32 *db=dc->depth_buf; - dc->depth_buf=NULL; - if (step==1 && !start && !dc->brush && !dc->depth_buf) { - if (DCClipLine(dc,&x1,&y1,&x2,&y2)) - res=Line(dc,x1,y1,0,x2,y2,0,&GrLinePlot0,step,start); - } else - res=Line(dc,x1,y1,0,x2,y2,0,&GrLinePlot,step,start); - dc->depth_buf=db; - return res; -} - -public Bool GrCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 radius, - I64 step=1,F64 start_radians=0,F64 len_radians=2*ã) -{//2D. Clipping but not transformation. - Bool res; - I32 *db=dc->depth_buf; - dc->depth_buf=NULL; - res=Circle(dc,cx,cy,0,radius,&GrLinePlot,step,start_radians,len_radians); - dc->depth_buf=db; - return res; -} - -public Bool GrEllipse(CDC *dc=gr.dc, - I64 cx,I64 cy, - I64 x_radius,I64 y_radius, - F64 rot_angle=0, - I64 step=1, - F64 start_radians=0, - F64 len_radians=2*ã) -{//2D. Clipping but not transformation. - Bool res; - I32 *db=dc->depth_buf; - dc->depth_buf=NULL; - res=Ellipse(dc,cx,cy,0,x_radius,y_radius,&GrLinePlot, - rot_angle,step,start_radians,len_radians); - dc->depth_buf=db; - return res; -} - -public Bool GrRegPoly(CDC *dc=gr.dc, - I64 cx,I64 cy, - I64 x_radius,I64 y_radius,I64 sides, - F64 rot_angle=0, - I64 step=1, - F64 start_radians=0, - F64 len_radians=2*ã) -{//2D. Clipping but no transform or pen width. - Bool res; - I32 *db=dc->depth_buf; - dc->depth_buf=NULL; - res=RegPoly(dc,cx,cy,0,x_radius,y_radius,sides, - &GrLinePlot,rot_angle,step,start_radians,len_radians); - dc->depth_buf=db; - return res; -} - -public Bool Gr2Bezier(CDC *dc=gr.dc,CD3I32 *ctrl) -{//2nd order. Clipping but no transform or pen width. - return Bezier2(dc,ctrl,&GrLinePlot); -} - -public Bool Gr3Bezier(CDC *dc=gr.dc,CD3I32 *ctrl) -{//3rd order. Clipping but no transform or pen width. - return Bezier3(dc,ctrl,&GrLinePlot); -} - -public Bool Gr2BSpline(CDC *dc=gr.dc,CD3I32 *ctrl,I64 cnt,Bool closed=FALSE) -{//2nd order. Clipping but no transform or pen width. - return BSpline2(dc,ctrl,cnt,&GrLinePlot,closed); -} - -public Bool Gr3BSpline(CDC *dc=gr.dc,CD3I32 *ctrl,I64 cnt,Bool closed=FALSE) -{//3rd order. Clipping but no transform or pen width. - 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=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=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, - I64 step=1,I64 start=0) -{//3D. Transformation with pen width. - I64 _x1,_y1,_z1,_x2,_y2,_z2; - Bool res=FALSE,was_transform=FALSE,was_symmetry=FALSE; - if (dc->flags & DCF_TRANSFORMATION) { - (*dc->transform)(dc,&x1,&y1,&z1); - (*dc->transform)(dc,&x2,&y2,&z2); - dc->flags&=~DCF_TRANSFORMATION; - was_transform=TRUE; - } - if (dc->flags & DCF_SYMMETRY) { - _x1=x1; _y1=y1; _z1=z1; - DCReflect(dc,&_x1,&_y1,&_z1); - _x2=x2; _y2=y2; _z2=z2; - DCReflect(dc,&_x2,&_y2,&_z2); - dc->flags&=~DCF_SYMMETRY; - if (step==1 && !dc->brush) { - if (!start && dc->pen_width<2 && !dc->depth_buf) {//TODO: clip z depbuf - if (DCClipLine(dc,&_x1,&_y1,&_x2,&_y2)) - 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 - res=Line(dc,_x1,_y1,_z1,_x2,_y2,_z2,&GrPlot3,step,start); - was_symmetry=TRUE; - if (dc->flags&DCF_JUST_MIRROR) - goto gr_done; - } - if (step==1 && !dc->brush) { - if (!start && dc->pen_width<2 && !dc->depth_buf) {//TODO: clip z depbuf - if (DCClipLine(dc,&x1,&y1,&x2,&y2)) - 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 - res|=Line(dc,x1,y1,z1,x2,y2,z2,&GrPlot3,step,start); -gr_done: - if (was_transform) - dc->flags|=DCF_TRANSFORMATION; - if (was_symmetry) - dc->flags|=DCF_SYMMETRY; - return res; -} - -#help_index "Graphics/Char;Char/Graphics" - -public Bool GrPutChar3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 ch) -{//3D. Transformation. DCF_SYMMETRY is silly. - if (dc->flags & DCF_TRANSFORMATION) - (*dc->transform)(dc,&x,&y,&z); - return GrPutChar(dc,x,y,ch); -} - -public I64 GrPrint3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *fmt,...) -{//3D. Transformation. DCF_SYMMETRY is silly. - U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); - I64 res; - if (dc->flags & DCF_TRANSFORMATION) - (*dc->transform)(dc,&x,&y,&z); - res=GrPrint(dc,x,y,"%s",buf); - Free(buf); - return res; -} - -public I64 GrVPrint3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *fmt,...) -{//3D. Vertical text. Transformation. DCF_SYMMETRY is silly. - U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); - I64 res; - if (dc->flags & DCF_TRANSFORMATION) - (*dc->transform)(dc,&x,&y,&z); - res=GrVPrint(dc,x,y,"%s",buf); - Free(buf); - return res; -} - -#help_index "Graphics" - -public Bool GrEllipse3(CDC *dc=gr.dc, - I64 cx,I64 cy,I64 cz, - I64 x_radius,I64 y_radius, - F64 rot_angle=0, - I64 step=1, - F64 start_radians=0, - F64 len_radians=2*ã) -{//3D. Transformation with pen width. - Bool res; - I64 x,y,z,xx,yy,zz; - F64 m1,a1,m2,a2,s,c; - if (dc->flags & DCF_TRANSFORMATION) { - dc->flags&=~DCF_TRANSFORMATION; - (*dc->transform)(dc,&cx,&cy,&cz); - - c=Cos(rot_angle); - s=Sin(rot_angle); - - x_radius<<=16; - y_radius<<=16; - - xx=0; - yy=0; - zz=0; - (*dc->transform)(dc,&xx,&yy,&zz); - - x=x_radius*c; - y=x_radius*s; - z=0; - (*dc->transform)(dc,&x,&y,&z); - x-=xx; - y-=yy; - z-=zz; - R2P(&m1,&a1,x,y); - - x=-y_radius*s; - y=y_radius*c; - z=0; - (*dc->transform)(dc,&x,&y,&z); - x-=xx; - y-=yy; - z-=zz; - R2P(&m2,&a2,x,y); - m2*=Abs(Sin(a2-a1)); - - res=Ellipse(dc,cx,cy,cz, - m1/0x10000,m2/0x10000,&GrPlot3,-a1,step,start_radians,len_radians); - dc->flags|=DCF_TRANSFORMATION; - } else - res=Ellipse(dc,cx,cy,cz,x_radius,y_radius,&GrPlot3, - rot_angle,step,start_radians,len_radians); - return res; -} - -public Bool GrCircle3(CDC *dc=gr.dc,I64 cx,I64 cy,I64 cz,I64 radius, - I64 step=1,F64 start_radians=0,F64 len_radians=2*ã) -{//3D. Transformation with pen width. - if (dc->flags & DCF_TRANSFORMATION) - return GrEllipse3(dc,cx,cy,cz,radius,radius,0,step, - start_radians,len_radians); - else - return Circle(dc,cx,cy,cz,radius,&GrPlot3,step, - start_radians,len_radians); -} - -public Bool GrRegPoly3(CDC *dc=gr.dc, - I64 cx,I64 cy,I64 cz, - I64 x_radius,I64 y_radius,I64 sides, - F64 rot_angle=0, - I64 step=1, - F64 start_radians=0, - F64 len_radians=2*ã) -{//3D. Clipping and transform and pen width. - Bool res; - I64 x,y,z,xx,yy,zz; - F64 m1,a1,m2,a2,s,c; - if (dc->flags & DCF_TRANSFORMATION) { - dc->flags&=~DCF_TRANSFORMATION; - (*dc->transform)(dc,&cx,&cy,&cz); - - c=Cos(rot_angle); - s=Sin(rot_angle); - - x_radius<<=16; - y_radius<<=16; - - xx=0; - yy=0; - zz=0; - (*dc->transform)(dc,&xx,&yy,&zz); - - x=x_radius*c; - y=x_radius*s; - z=0; - (*dc->transform)(dc,&x,&y,&z); - x-=xx; - y-=yy; - z-=zz; - R2P(&m1,&a1,x,y); - - x=-y_radius*s; - y=y_radius*c; - z=0; - (*dc->transform)(dc,&x,&y,&z); - x-=xx; - y-=yy; - z-=zz; - R2P(&m2,&a2,x,y); - m2*=Abs(Sin(a2-a1)); - - res=RegPoly(dc,cx,cy,cz, - m1/0x10000,m2/0x10000,sides,&GrPlot3,-a1, - step,start_radians,len_radians); - dc->flags|=DCF_TRANSFORMATION; - } else - res=RegPoly(dc,cx,cy,cz,x_radius,y_radius,sides,&GrPlot3, - rot_angle,step,start_radians,len_radians); - return res; -} - -public I64 GrFloodFill3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,Bool not_color=FALSE) -{//3D. Transformation. -//not_color=TRUE means fill up to everything which is not the current color. - //not_color=FALSE means fill all parts equ to the color under the point. - //Returns cnt of pixs changed - I64 res,old_flags=dc->flags, - _x,_y,_z; - if (dc->flags & DCF_TRANSFORMATION) { - (*dc->transform)(dc,&x1,&y1,&z1); - dc->flags&=~DCF_TRANSFORMATION; - } - if (dc->flags & DCF_SYMMETRY) { - _x=x1; _y=y1; _z=z1; - DCReflect(dc,&_x,&_y,&_z); - dc->flags&=~DCF_SYMMETRY; - res=GrFloodFill(dc,_x,_y,not_color,_z,dc->depth_buf); - if (dc->flags&DCF_JUST_MIRROR) - goto gr_done; - } - res=GrFloodFill(dc,x1,y1,not_color,z1,dc->depth_buf); -gr_done: - dc->flags=old_flags; - return res; -} - -#help_index "Graphics;Graphics/Device Contexts" - -public I64 GrBlot3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,CDC *img) -{//3D. Clipping and transformation. - CColorROPU32 old_color=dc->color; - I64 color,reg i,j,w=img->width,h=img->height, - d1,dx1,dy1,dz1, - reg d2,dx2,dy2,dz2, - adx1,ady1,adz1, - adx2,ady2,adz2, - x2,y2,z2,x3,y3,z3, - dw,reg dh,x,y,_x1,_y1,_z1,_x2,_y2,_z2,_x3,_y3,_z3, - last_x,last_y,res=0; - Bool first; - CDC *old_brush=dc->brush; - - if (dc->depth_buf || dc->flags & (DCF_TRANSFORMATION | DCF_SYMMETRY)) { - x2=x1+w; y2=y1; z2=z1; - x3=x1; y3=y1+h; z3=z1; - if (dc->flags & DCF_TRANSFORMATION) { - (*dc->transform)(dc,&x1,&y1,&z1); - (*dc->transform)(dc,&x2,&y2,&z2); - (*dc->transform)(dc,&x3,&y3,&z3); - } - if (dc->flags & DCF_SYMMETRY) { - _x1=x1; _y1=y1; _z1=z1; - DCReflect(dc,&_x1,&_y1,&_z1); - _x2=x2; _y2=y2; _z2=z2; - DCReflect(dc,&_x2,&_y2,&_z2); - _x3=x3; _y3=y3; _z3=z3; - DCReflect(dc,&_x3,&_y3,&_z3); - dx1=_x2-_x1; dy1=_y2-_y1; dz1=_z2-_z1; - dx2=_x3-_x1; dy2=_y3-_y1; dz2=_z3-_z1; - adx1=AbsI64(dx1); ady1=AbsI64(dy1); adz1=AbsI64(dz1); - adx2=AbsI64(dx2); ady2=AbsI64(dy2); adz2=AbsI64(dz2); - - if (adx1>=ady1) { - if (adx1>=adz1) - d1=adx1; - else - d1=adz1; - } else { - if (ady1>=adz1) - d1=ady1; - else - d1=adz1; - } - if (adx2>=ady2) { - if (adx2>=adz2) - d2=adx2; - else - d2=adz2; - } else { - if (ady2>=adz2) - d2=ady2; - else - d2=adz2; - } - - if (AbsI64(d1)!=w ||AbsI64(d2)!=h) { - d1<<=1; - d2<<=1; - } - if (d1) { - dx1=dx1<<32/d1; - dy1=dy1<<32/d1; - dz1=dz1<<32/d1; - } else - goto normal_image; - if (d2) { - dx2=dx2<<32/d2; - dy2=dy2<<32/d2; - dz2=dz2<<32/d2; - } else - goto normal_image; - dc->brush=NULL; - x=0;y=0; - dw=w<<32/d1; - dh=h<<32/d2; - - first=TRUE; - _x1<<=32; _y1<<=32; _z1<<=32; - for (j=0;j<=d1;j++) { - _x2=_x1; _y2=_y1; _z2=_z1; - y=0; - for (i=0;i<=d2;i++) { - if (_x2.i32[1]!=last_x || _y2.i32[1]!=last_y ||first) { - if ((color=GrPeek(img,x.i32[1],y.i32[1]))>=0) { - if (dc->color.c0.rop==ROPB_MONO) { - if (color) { - dc->color=old_color&~ROPF_DITHER; - if (dc->depth_buf) { - dc->db_z=_z2.i32[1]; - GrPlot1(dc,_x2.i32[1],_y2.i32[1]); - } else - GrPlot(dc,_x2.i32[1],_y2.i32[1]); - } - } else { - if (color!=TRANSPARENT) { - dc->color=old_color&~COLORROP_NO_ROP0_MASK|color; - if (dc->depth_buf) { - dc->db_z=_z2.i32[1]; - GrPlot1(dc,_x2.i32[1],_y2.i32[1]); - } else - GrPlot(dc,_x2.i32[1],_y2.i32[1]); - } - } - } - } - first=FALSE; - last_x=_x2.i32[1]; last_y=_y2.i32[1]; - _x2+=dx2; _y2+=dy2; _z2+=dz2; - y+=dh; - } - _x1+=dx1; _y1+=dy1; _z1+=dz1; - x+=dw; - } - res=1; -normal_image: - if (dc->flags&DCF_JUST_MIRROR) - goto gr_done; - } - dx1=x2-x1; dy1=y2-y1; dz1=z2-z1; - dx2=x3-x1; dy2=y3-y1; dz2=z3-z1; - adx1=AbsI64(dx1); ady1=AbsI64(dy1); adz1=AbsI64(dz1); - adx2=AbsI64(dx2); ady2=AbsI64(dy2); adz2=AbsI64(dz2); - - if (adx1>=ady1) { - if (adx1>=adz1) - d1=adx1; - else - d1=adz1; - } else { - if (ady1>=adz1) - d1=ady1; - else - d1=adz1; - } - if (adx2>=ady2) { - if (adx2>=adz2) - d2=adx2; - else - d2=adz2; - } else { - if (ady2>=adz2) - d2=ady2; - else - d2=adz2; - } - if (AbsI64(d1)!=w ||AbsI64(d2)!=h) { - d1<<=1; - d2<<=1; - } - if (d1) { - dx1=dx1<<32/d1; - dy1=dy1<<32/d1; - dz1=dz1<<32/d1; - } else - goto gr_done; - if (d2) { - dx2=dx2<<32/d2; - dy2=dy2<<32/d2; - dz2=dz2<<32/d2; - } else - goto gr_done; - dc->brush=NULL; - x=0;y=0; - dw=w<<32/d1; - dh=h<<32/d2; - - first=TRUE; - x1<<=32; y1<<=32; z1<<=32; - for (j=0;j<=d1;j++) { - x2=x1; y2=y1; z2=z1; - y=0; - for (i=0;i<=d2;i++) { - if (x2.i32[1]!=last_x || y2.i32[1]!=last_y || first) { - if ((color=GrPeek(img,x.i32[1],y.i32[1]))>=0) { - if (dc->color.c0.rop==ROPB_MONO) { - if (color) { - dc->color=old_color&~ROPF_DITHER; - if (dc->depth_buf) { - dc->db_z=z2.i32[1]; - GrPlot1(dc,x2.i32[1],y2.i32[1]); - } else - GrPlot(dc,x2.i32[1],y2.i32[1]); - } - } else { - if (color!=TRANSPARENT) { - dc->color=old_color&~COLORROP_NO_ROP0_MASK|color;//COLOR - if (dc->depth_buf) { - dc->db_z=z2.i32[1]; - GrPlot1(dc,x2.i32[1],y2.i32[1]); - } else - GrPlot(dc,x2.i32[1],y2.i32[1]); - } - } - } - } - first=FALSE; - last_x=x2.i32[1]; last_y=y2.i32[1]; - x2+=dx2; y2+=dy2; z2+=dz2; - y+=dh; - } - x1+=dx1; y1+=dy1; z1+=dz1; - x+=dw; - } - res=1; //TODO: check off screen - } else - res=GrBlot(dc,x1,y1,img); -gr_done: - dc->color=old_color; - dc->brush=old_brush; - return res; -} - -#help_index "Graphics" - -public Bool Gr2Bezier3(CDC *dc=gr.dc,CD3I32 *ctrl) -{//2nd order. Clipping and transform and pen width. - Bool res=FALSE; - I64 i,x,y,z, - old_flags=dc->flags; - CD3I32 *ctrl2=NULL,*ctrl3=NULL; - if (dc->flags & DCF_TRANSFORMATION) { - ctrl2=MAlloc(sizeof(CD3I32)*3); - for (i=0;i<3;i++) { - x=ctrl[i].x; - y=ctrl[i].y; - z=ctrl[i].z; - (*dc->transform)(dc,&x,&y,&z); - ctrl2[i].x=x; - ctrl2[i].y=y; - ctrl2[i].z=z; - } - dc->flags&=~DCF_TRANSFORMATION; - ctrl=ctrl2; - } - if (dc->flags & DCF_SYMMETRY) { - ctrl3=MAlloc(sizeof(CD3I32)*3); - for (i=0;i<3;i++) { - x=ctrl[i].x; - y=ctrl[i].y; - z=ctrl[i].z; - DCReflect(dc,&x,&y,&z); - ctrl3[i].x=x; - ctrl3[i].y=y; - ctrl3[i].z=z; - } - dc->flags&=~DCF_SYMMETRY; - res=Bezier2(dc,ctrl3,&GrPlot3); - if (dc->flags & DCF_JUST_MIRROR) - goto gr_done; - } - - res|=Bezier2(dc,ctrl,&GrPlot3); -gr_done: - Free(ctrl2); - Free(ctrl3); - dc->flags=old_flags; - return res; -} - -public Bool Gr3Bezier3(CDC *dc=gr.dc,CD3I32 *ctrl) -{//3rd order. Clipping and transform and pen width. - Bool res=FALSE; - I64 i,x,y,z, - old_flags=dc->flags; - CD3I32 *ctrl2=NULL,*ctrl3=NULL; - if (dc->flags & DCF_TRANSFORMATION) { - ctrl2=MAlloc(sizeof(CD3I32)*4); - for (i=0;i<4;i++) { - x=ctrl[i].x; - y=ctrl[i].y; - z=ctrl[i].z; - (*dc->transform)(dc,&x,&y,&z); - ctrl2[i].x=x; - ctrl2[i].y=y; - ctrl2[i].z=z; - } - dc->flags&=~DCF_TRANSFORMATION; - ctrl=ctrl2; - } - if (dc->flags & DCF_SYMMETRY) { - ctrl3=MAlloc(sizeof(CD3I32)*4); - for (i=0;i<4;i++) { - x=ctrl[i].x; - y=ctrl[i].y; - z=ctrl[i].z; - DCReflect(dc,&x,&y,&z); - ctrl3[i].x=x; - ctrl3[i].y=y; - ctrl3[i].z=z; - } - dc->flags&=~DCF_SYMMETRY; - res=Bezier3(dc,ctrl3,&GrPlot3); - if (dc->flags & DCF_JUST_MIRROR) - goto gr_done; - } - - res|=Bezier3(dc,ctrl,&GrPlot3); -gr_done: - Free(ctrl2); - Free(ctrl3); - dc->flags=old_flags; - return res; -} - -public I64 Gr2BSpline3(CDC *dc=gr.dc,CD3I32 *ctrl,I64 cnt,Bool closed=FALSE) -{//2nd order. Clipping and transform and pen width. - Bool res=FALSE; - I64 i,x,y,z, - old_flags=dc->flags; - CD3I32 *ctrl2=NULL,*ctrl3=NULL; - if (dc->flags & DCF_TRANSFORMATION) { - ctrl2=MAlloc(sizeof(CD3I32)*cnt); - for (i=0;itransform)(dc,&x,&y,&z); - ctrl2[i].x=x; - ctrl2[i].y=y; - ctrl2[i].z=z; - } - dc->flags&=~DCF_TRANSFORMATION; - ctrl=ctrl2; - } - if (dc->flags & DCF_SYMMETRY) { - ctrl3=MAlloc(sizeof(CD3I32)*cnt); - for (i=0;iflags&=~DCF_SYMMETRY; - res=BSpline2(dc,ctrl3,cnt,&GrPlot3,closed); - if (dc->flags & DCF_JUST_MIRROR) - goto gr_done; - } - - res|=BSpline2(dc,ctrl,cnt,&GrPlot3,closed); -gr_done: - Free(ctrl2); - Free(ctrl3); - dc->flags=old_flags; - return res; -} - -public Bool Gr3BSpline3(CDC *dc=gr.dc,CD3I32 *ctrl,I64 cnt,Bool closed=FALSE) -{//3rd order. Clipping and transform and pen width. - Bool res=FALSE; - I64 i,x,y,z, - old_flags=dc->flags; - CD3I32 *ctrl2=NULL,*ctrl3=NULL; - if (dc->flags & DCF_TRANSFORMATION) { - ctrl2=MAlloc(sizeof(CD3I32)*cnt); - for (i=0;itransform)(dc,&x,&y,&z); - ctrl2[i].x=x; - ctrl2[i].y=y; - ctrl2[i].z=z; - } - dc->flags&=~DCF_TRANSFORMATION; - ctrl=ctrl2; - } - if (dc->flags & DCF_SYMMETRY) { - ctrl3=MAlloc(sizeof(CD3I32)*cnt); - for (i=0;iflags&=~DCF_SYMMETRY; - res=BSpline3(dc,ctrl3,cnt,&GrPlot3,closed); - if (dc->flags & DCF_JUST_MIRROR) - goto gr_done; - } - - res|=BSpline3(dc,ctrl,cnt,&GrPlot3,closed); -gr_done: - Free(ctrl2); - Free(ctrl3); - dc->flags=old_flags; - return res; -} - -public I64 GrFillTri0(CDC *dc=gr.dc,CD3I32 *p1,CD3I32 *p2,CD3I32 *p4) -{//3D. Returns cnt of pixs changed - I64 x1,x2,y1,y2,z1,z2,dx1,dy1,dz1,dx2,dy2,dz2,res=0,i,min,max; - CTask *win_task; - - if (AbsI64(p1->y-p2->y)+AbsI64(p1->y-p4->y)<= - AbsI64(p1->x-p2->x)+AbsI64(p1->x-p4->x)) { -//p1 is min x - if (p4->xx) - SwapI64(&p4,&p2); - if (p2->xx) - SwapI64(&p2,&p1); - - //p2y<=p4y - if (p4->yy) - SwapI64(&p4,&p2); - - min=0; - max=dc->height; - if (dc->flags & DCF_SCREEN_BITMAP) { - win_task=dc->win_task; - min-=win_task->scroll_y+win_task->pix_top; - max-=win_task->scroll_y+win_task->pix_top; - if (max>win_task->pix_bottom-(win_task->scroll_y+win_task->pix_top)) - max=win_task->pix_bottom-(win_task->scroll_y+win_task->pix_top); - } - - if ((dy2=p4->y-p1->y)<0) { - dy1=p2->y-p1->y; - dx1=(p1->x-p2->x)<<32/dy1; - dz1=(p1->z-p2->z)<<32/dy1; - - dx2=(p1->x-p4->x)<<32/dy2; - dz2=(p1->z-p4->z)<<32/dy2; - x1=x2=p1->x<<32; y1=p1->y; z1=z2=p1->z<<32; - if (y1+dy2-dy2) goto ft_done; - dy2+=i; - } - if (y1>=max) { - i=y1-max+1; - if (i>-dy2) - i=-dy2; - dy2+=i; - y1-=i; - x1+=dx1*i; - x2+=dx2*i; - z1+=dz1*i; - z2+=dz2*i; - } - while (dy2++) { - res+=GrHLine(dc,x1.i32[1],x2.i32[1],y1,z1.i32[1],z2.i32[1]); - y1--; - x1+=dx1; - x2+=dx2; - z1+=dz1; - z2+=dz2; - } - if (dy2=p2->y-p4->y) { - dx2=(p4->x-p2->x)<<32/dy2; - dz2=(p4->z-p2->z)<<32/dy2; - if (y1+dy2-dy2) goto ft_done; - dy2+=i; - } - if (y1>=max) { - i=y1-max+1; - if (i>-dy2) goto ft_done; - dy2+=i; - y1-=i; - x1+=dx1*i; - x2+=dx2*i; - z1+=dz1*i; - z2+=dz2*i; - } - } - while (dy2++<=0) { - res+=GrHLine(dc,x1.i32[1],x2.i32[1],y1,z1.i32[1],z2.i32[1]); - y1--; - x1+=dx1; - x2+=dx2; - z1+=dz1; - z2+=dz2; - } - } else if ((dy2=p2->y-p1->y)>0) { - dy1=p4->y-p1->y; - dx1=(p4->x-p1->x)<<32/dy1; - dz1=(p4->z-p1->z)<<32/dy1; - - dx2=(p2->x-p1->x)<<32/dy2; - dz2=(p2->z-p1->z)<<32/dy2; - x1=x2=p1->x<<32; y1=p1->y; z1=z2=p1->z<<32; - if (y1+dy2>=max) { - i=y1+dy2-max+1; - if (i>dy2) goto ft_done; - dy2-=i; - } - if (y1dy2) - i=dy2; - dy2-=i; - y1+=i; - x1+=dx1*i; - x2+=dx2*i; - z1+=dz1*i; - z2+=dz2*i; - } - while (dy2--) { - res+=GrHLine(dc,x1.i32[1],x2.i32[1],y1,z1.i32[1],z2.i32[1]); - y1++; - x1+=dx1; - x2+=dx2; - z1+=dz1; - z2+=dz2; - } - if (dy2=p4->y-p2->y) { - dx2=(p4->x-p2->x)<<32/dy2; - dz2=(p4->z-p2->z)<<32/dy2; - if (y1+dy2>=max) { - i=y1+dy2-max+1; - if (i>dy2) goto ft_done; - dy2-=i; - } - if (y1dy2) goto ft_done; - dy2-=i; - y1+=i; - x1+=dx1*i; - x2+=dx2*i; - z1+=dz1*i; - z2+=dz2*i; - } - } - while (dy2-->=0) { - res+=GrHLine(dc,x1.i32[1],x2.i32[1],y1,z1.i32[1],z2.i32[1]); - y1++; - x1+=dx1; - x2+=dx2; - z1+=dz1; - z2+=dz2; - } - } else { - if (dy1=p2->y-p1->y) { - dx1=(p2->x-p1->x)<<32/dy1; - dz1=(p2->z-p1->z)<<32/dy1; - if (dy2=p2->y-p4->y) { - dx2=(p2->x-p4->x)<<32/dy2; - dz2=(p2->z-p4->z)<<32/dy2; - } else { - dx2=0; - dz2=0; - } - x1=x2=p2->x<<32; y1=p2->y; z1=z2=p2->z<<32; - if (y1-dy1) - i=-dy1; - dy1+=i; - y1+=i; - x1+=dx1*i; - x2+=dx2*i; - z1+=dz1*i; - z2+=dz2*i; - } - while (dy1++<=0) { - if (y1y-p1->y) { - dx1=(p1->x-p4->x)<<32/dy1; - dz1=(p1->z-p4->z)<<32/dy1; - if (dy2=p4->y-p2->y) { - dx2=(p2->x-p4->x)<<32/dy2; - dz2=(p2->z-p4->z)<<32/dy2; - } else { - dx2=0; - dz2=0; - } - x1=x2=p4->x<<32; y1=p4->y; z1=z2=p4->z<<32; - if (y1-dy1dy1) goto ft_done; - dy1-=i; - } - if (y1>=max) { - i=y1-max+1; - if (i>dy1) goto ft_done; - dy1-=i; - y1-=i; - x1+=dx1*i; - x2+=dx2*i; - z1+=dz1*i; - z2+=dz2*i; - } - while (dy1-->=0) { - res+=GrHLine(dc,x1.i32[1],x2.i32[1],y1,z1.i32[1],z2.i32[1]); - y1--; - x1+=dx1; - x2+=dx2; - z1+=dz1; - z2+=dz2; - } - } - } - } else { -//p1 is min y - if (p4->yy) - SwapI64(&p4,&p2); - if (p2->yy) - SwapI64(&p2,&p1); - - //p2x<=p4x - if (p4->xx) - SwapI64(&p4,&p2); - - min=0; - max=dc->width; - if (dc->flags & DCF_SCREEN_BITMAP) { - win_task=dc->win_task; - min-=win_task->scroll_x+win_task->pix_left; - max-=win_task->scroll_x+win_task->pix_left; - if (max>win_task->pix_right-(win_task->scroll_x+win_task->pix_left)) - max=win_task->pix_right-(win_task->scroll_x+win_task->pix_left); - } - - if ((dx2=p4->x-p1->x)<0) { - dx1=p2->x-p1->x; - dy1=(p1->y-p2->y)<<32/dx1; - dz1=(p1->z-p2->z)<<32/dx1; - - dy2=(p1->y-p4->y)<<32/dx2; - dz2=(p1->z-p4->z)<<32/dx2; - y1=y2=p1->y<<32; x1=p1->x; z1=z2=p1->z<<32; - if (x1+dx2-dx2) goto ft_done; - dx2+=i; - } - if (x1>=max) { - i=x1-max+1; - if (i>-dx2) - i=-dx2; - dx2+=i; - x1-=i; - y1+=dy1*i; - y2+=dy2*i; - z1+=dz1*i; - z2+=dz2*i; - } - while (dx2++) { - res+=GrVLine(dc,x1,y1.i32[1],y2.i32[1],z1.i32[1],z2.i32[1]); - x1--; - y1+=dy1; - y2+=dy2; - z1+=dz1; - z2+=dz2; - } - if (dx2=p2->x-p4->x) { - dy2=(p4->y-p2->y)<<32/dx2; - dz2=(p4->z-p2->z)<<32/dx2; - if (x1+dx2-dx2) goto ft_done; - dx2+=i; - } - if (x1>=max) { - i=x1-max+1; - if (i>-dx2) goto ft_done; - dx2+=i; - x1-=i; - y1+=dy1*i; - y2+=dy2*i; - z1+=dz1*i; - z2+=dz2*i; - } - } - while (dx2++<=0) { - res+=GrVLine(dc,x1,y1.i32[1],y2.i32[1],z1.i32[1],z2.i32[1]); - x1--; - y1+=dy1; - y2+=dy2; - z1+=dz1; - z2+=dz2; - } - } else if ((dx2=p2->x-p1->x)>0) { - dx1=p4->x-p1->x; - dy1=(p4->y-p1->y)<<32/dx1; - dz1=(p4->z-p1->z)<<32/dx1; - - dy2=(p2->y-p1->y)<<32/dx2; - dz2=(p2->z-p1->z)<<32/dx2; - y1=y2=p1->y<<32; x1=p1->x; z1=z2=p1->z<<32; - if (x1+dx2>=max) { - i=x1+dx2-max+1; - if (i>dx2) goto ft_done; - dx2-=i; - } - if (x1dx2) - i=dx2; - dx2-=i; - x1+=i; - y1+=dy1*i; - y2+=dy2*i; - z1+=dz1*i; - z2+=dz2*i; - } - while (dx2--) { - res+=GrVLine(dc,x1,y1.i32[1],y2.i32[1],z1.i32[1],z2.i32[1]); - x1++; - y1+=dy1; - y2+=dy2; - z1+=dz1; - z2+=dz2; - } - if (dx2=p4->x-p2->x) { - dy2=(p4->y-p2->y)<<32/dx2; - dz2=(p4->z-p2->z)<<32/dx2; - if (x1+dx2>=max) { - i=x1+dx2-max+1; - if (i>dx2) goto ft_done; - dx2-=i; - } - if (x1dx2) goto ft_done; - dx2-=i; - x1+=i; - y1+=dy1*i; - y2+=dy2*i; - z1+=dz1*i; - z2+=dz2*i; - } - } - while (dx2-->=0) { - res+=GrVLine(dc,x1,y1.i32[1],y2.i32[1],z1.i32[1],z2.i32[1]); - x1++; - y1+=dy1; - y2+=dy2; - z1+=dz1; - z2+=dz2; - } - } else { - if (dx1=p2->x-p1->x) { - dy1=(p2->y-p1->y)<<32/dx1; - dz1=(p2->z-p1->z)<<32/dx1; - if (dx2=p2->x-p4->x) { - dy2=(p2->y-p4->y)<<32/dx2; - dz2=(p2->z-p4->z)<<32/dx2; - } else { - dy2=0; - dz2=0; - } - y1=y2=p2->y<<32; x1=p2->x; z1=z2=p2->z<<32; - if (x1-dx1) - i=-dx1; - dx1+=i; - x1+=i; - y1+=dy1*i; - y2+=dy2*i; - z1+=dz1*i; - z2+=dz2*i; - } - while (dx1++<=0) { - if (x1x-p1->x) { - dy1=(p1->y-p4->y)<<32/dx1; - dz1=(p1->z-p4->z)<<32/dx1; - if (dx2=p4->x-p2->x) { - dy2=(p2->y-p4->y)<<32/dx2; - dz2=(p2->z-p4->z)<<32/dx2; - } else { - dy2=0; - dz2=0; - } - y1=y2=p4->y<<32; x1=p4->x; z1=z2=p4->z<<32; - if (x1-dx1dx1) goto ft_done; - dx1-=i; - } - if (x1>=max) { - i=x1-max+1; - if (i>dx1) goto ft_done; - dx1-=i; - x1-=i; - y1+=dy1*i; - y2+=dy2*i; - z1+=dz1*i; - z2+=dz2*i; - } - while (dx1-->=0) { - res+=GrVLine(dc,x1,y1.i32[1],y2.i32[1],z1.i32[1],z2.i32[1]); - x1--; - y1+=dy1; - y2+=dy2; - z1+=dz1; - z2+=dz2; - } - } - } - } -ft_done: - return res; -} diff --git a/Adam/Gr/GrPrimatives.HC b/Adam/Gr/GrPrimatives.HC new file mode 100644 index 0000000..acc1f54 --- /dev/null +++ b/Adam/Gr/GrPrimatives.HC @@ -0,0 +1,1824 @@ +#help_index "Graphics" + +public Bool GrClamp(CDC *dc=gr.dc,I64 *left,I64 *top,I64 *right,I64 *bottom, + I64 width=0,I64 height=0) +{//Returns screen, not window coordinates. + CTask *win_task; + *left=0; + *top=0; + *right=dc->width-1; + *bottom=dc->height-1; + if (dc->flags & DCF_SCREEN_BITMAP) { + win_task=dc->win_task; + if (GR_WIDTH-1<*right) + *right=GR_WIDTH-1; + if (GR_HEIGHT-1<*bottom) + *bottom=GR_HEIGHT-1; + if (win_task->pix_left>*left) + *left=win_task->pix_left; + if (win_task->pix_top>*top) + *top=win_task->pix_top; + if (win_task->pix_right<*right) + *right=win_task->pix_right; + if (win_task->pix_bottom<*bottom) + *bottom=win_task->pix_bottom; + } + *left-=width; + *right+=width; + *top-=height; + *bottom+=height; + return *left<=*right && *top<=*bottom; +} + +Bool DCClipLine(CDC *dc=gr.dc,I64 *x1,I64 *y1,I64 *x2,I64 *y2, + I64 width=0,I64 height=0) +{//Also converts window to screen coordinates + I64 left,top,right,bottom; + CTask *win_task; + if (GrClamp(dc,&left,&top,&right,&bottom,width,height)) { + if (dc->flags & DCF_SCREEN_BITMAP) { + win_task=dc->win_task; + *x1+=win_task->pix_left+win_task->scroll_x; + *y1+=win_task->pix_top+win_task->scroll_y; + *x2+=win_task->pix_left+win_task->scroll_x; + *y2+=win_task->pix_top+win_task->scroll_y; + } + return ClipLine(x1,y1,x2,y2,left,top,right,bottom); + } else + return FALSE; +} + +public Bool GrPlot(CDC *dc=gr.dc,I64 x,I64 y) +{//2D. Clipping but No transformation or pen width. + I32 *db=dc->depth_buf; + CTask *win_task; + CColorROPU32 old_color; + dc->depth_buf=NULL; + if (dc->brush) { + old_color=dc->color; + if (dc->color.c0.rop!=ROPB_COLLISION) + dc->color.c0.rop=ROPB_MONO; + GrBlot(dc,x,y,dc->brush); + dc->color=old_color; + } else if (dc->flags & DCF_SCREEN_BITMAP) { + win_task=dc->win_task; + x+=win_task->pix_left+win_task->scroll_x; + y+=win_task->pix_top+win_task->scroll_y; + if (win_task->pix_left<=x<=win_task->pix_right && + win_task->pix_top <=y<=win_task->pix_bottom && + 0<=xwidth && 0<=yheight && + (win_task->next_task==sys_winmgr_task || + dc->flags&DCF_ON_TOP || + !IsPixCovered0(win_task,x,y))) + GrPlot0(dc,x,y); + } else + if (0<=xwidth && 0<=yheight) + GrPlot0(dc,x,y); + dc->depth_buf=db; + return TRUE; +} + +Bool GrPlot1(CDC *dc=gr.dc,I64 x,I64 y) +{//Clipping but No transformation or pen width, called with db_z set + CTask *win_task; + CColorROPU32 old_color; + if (dc->brush) { + old_color=dc->color; + if (dc->color.c0.rop!=ROPB_COLLISION) + dc->color.c0.rop=ROPB_MONO; + if (dc->depth_buf) + GrBlot3(dc,x,y,dc->db_z,dc->brush); + else + GrBlot(dc,x,y,dc->brush); + dc->color=old_color; + } else if (dc->flags & DCF_SCREEN_BITMAP) { + win_task=dc->win_task; + x+=win_task->pix_left+win_task->scroll_x; + y+=win_task->pix_top+win_task->scroll_y; + if (win_task->pix_left<=x<=win_task->pix_right && + win_task->pix_top <=y<=win_task->pix_bottom && + 0<=xwidth && 0<=yheight && + (win_task->next_task==sys_winmgr_task || + dc->flags&DCF_ON_TOP || + !IsPixCovered0(win_task,x,y))) + GrPlot0(dc,x,y); + } else + if (0<=xwidth && 0<=yheight) + GrPlot0(dc,x,y); + return TRUE; +} + +public I64 GrPeek(CDC *dc=gr.dc,I64 x,I64 y) +{//2D. Clipping but no transformation. +//Returns pix color or -1 if off-screen or covered. + CTask *win_task; + if (dc->flags & DCF_SCREEN_BITMAP) { + win_task=dc->win_task; + x+=win_task->pix_left+win_task->scroll_x; + y+=win_task->pix_top+win_task->scroll_y; + if (!(win_task->pix_left<=x<=win_task->pix_right) || + !(win_task->pix_top <=y<=win_task->pix_bottom) || + !(0<=xwidth) || !(0<=yheight) || + win_task->next_task!=sys_winmgr_task && + !(dc->flags&DCF_ON_TOP) && + IsPixCovered0(win_task,x,y)) + return -1; + } else + if (!(0<=xwidth) || !(0<=yheight)) + return -1; + return GrPeek0(dc,x,y); +} + +/* + +This is an easier to understand +version of the nonrecursive routine below. +I64 GrFloodFillRay(CDC *dc,I64 x,I64 y,I64 z,I32 *db) +{ + I64 res,j,x1,ray_len,ray_len2; + + if (UnusedStk<0x80) + Dbg("Stk Overflow",Fs); + + res=ray_len=GrRayLen(dc,&x,y,z,db); + y--; + j=ray_len; + x1=x; + while (j>0) { + if (ray_len2=GrRayLenMinus(dc,x1,y)) + res+=GrFloodFillRay(dc,x1,y,z,db); + j-=ray_len2+1; + x1-=ray_len2+1; + } + y+=2; + j=ray_len; + x1=x; + while (j>0) { + if (ray_len2=GrRayLenMinus(dc,x1,y)) + res+=GrFloodFillRay(dc,x1,y,z,db); + j-=ray_len2+1; + x1-=ray_len2+1; + } + return res; +} +*/ + +class CFFRay +{ + I64 state,x,y,j,x1,ray_len,ray_len2; +}; + +I64 GrFloodFillRay(CDC *dc,I64 x,I64 y,I64 z,I32 *db) +{//See the above commented-out routine for an easier to understand version. +//Returns cnt of pixs changed + I64 res=0; +//We don't dynamically calculate the size to avoid + //fragmentation of memory. + CFFRay *f_dc=MAlloc(sizeof(CFFRay)*0x80000),*f=f_dc; + f->x=x; + f->y=y; + f->state=0; + do { + switch [f->state] { + case 0: + f->state++; + res+=f->ray_len=GrRayLen(dc,&f->x,f->y,z,db); + f->y--; + f->j=f->ray_len; + f->x1=f->x; + break; + case 1: + if (f->j>0) { + f->state++; + if (f->ray_len2=GrRayLenMinus(dc,f->x1,f->y)) { + f[1].x=f->x1; + f[1].y=f->y; + f[1].state=0; + f++; + } + } else + f->state+=2; + break; + case 2: + f->state--; + f->j-=f->ray_len2+1; + f->x1-=f->ray_len2+1; + break; + case 3: + f->state++; + f->y+=2; + f->j=f->ray_len; + f->x1=f->x; + break; + case 4: + if (f->j>0) { + f->state++; + if (f->ray_len2=GrRayLenMinus(dc,f->x1,f->y)) { + f[1].x=f->x1; + f[1].y=f->y; + f[1].state=0; + f++; + } + } else + f->state+=2; + break; + case 5: + f->state--; + f->j-=f->ray_len2+1; + f->x1-=f->ray_len2+1; + break; + case 6: + f--; + break; + } + } while (f>=f_dc); + Free(f_dc); + return res; +} + +public I64 GrFloodFill(CDC *dc=gr.dc,I64 x,I64 y, + Bool not_color=FALSE,I64 z=0,I32 *db=NULL) +{//2D. Ignore z and db. +//not_color=TRUE means fill up to everything which is not the current color. + //not_color=FALSE means fill all parts equ to the color under the point. + //Returns cnt of pixs changed + I64 res=0,j,old_flags=dc->flags; + CColorROPU32 old_color2=dc->color2; + CDC *old_brush; + if (dc->flags & DCF_DONT_DRAW) //TODO + return 0; + old_brush=dc->brush; + dc->brush=NULL; + if ((j=GrPeek(dc,x,y))>=0) { + if (not_color) { + dc->color2=dc->color.c0.color; + dc->flags|=DCF_FILL_NOT_COLOR; + } else { + dc->color2=j; + if (dc->color.c1.rop&ROPBF_DITHER) { + if (dc->color2.c0.color==dc->color.c0.color && + dc->color.c0.color==dc->color.c1.color) + goto ff_done; + } else if (dc->color2.c0.color==dc->color.c0.color) + goto ff_done; + dc->flags&=~DCF_FILL_NOT_COLOR; + } + if (not_color && j!=dc->color2 || + !not_color) + res=GrFloodFillRay(dc,x,y,z,db); + } +ff_done: + dc->brush=old_brush; + dc->flags=old_flags; + dc->color2=old_color2; + 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>1); + for (i=0;i>1); + for (i=r+1;i>1); + for (i=0;i>1); + for (i=r+1;i>1); + for (i=0;i>1); + for (i=r+1;i>1); + for (i=0;i>1); + for (i=r+1;i>1,rr; + if (diameter>=1) { + if (diameter>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 (;iflags & DCF_TRANSFORMATION) { + (*dc->transform)(dc,&x,&y,&z); + dc->flags&=~DCF_TRANSFORMATION; + was_transform=TRUE; + } + if (dc->flags & DCF_SYMMETRY) { + _x=x; _y=y; _z=z; + DCReflect(dc,&_x,&_y,&_z); + dc->flags&=~DCF_SYMMETRY; + dc->db_z=_z; + GrPlot1(dc,_x,_y); + was_symmetry=TRUE; + if (dc->flags&DCF_JUST_MIRROR) + goto gr_done; + } + dc->db_z=z; + GrPlot1(dc,x,y); +gr_done: + if (was_transform) + dc->flags|=DCF_TRANSFORMATION; + if (was_symmetry) + dc->flags|=DCF_SYMMETRY; + return TRUE; +} + +public Bool GrPlot3(CDC *dc=gr.dc,I64 x,I64 y,I64 z) +{//3D. Clipping and transformation and pen width. + I64 _x,_y,_z,w,dist; + CColorROPU32 old_color=dc->color; + Bool record,was_transform=FALSE,was_symmetry=FALSE; + CTask *win_task; + if (dc->flags & DCF_TRANSFORMATION) { + (*dc->transform)(dc,&x,&y,&z); + dc->flags&=~DCF_TRANSFORMATION; + was_transform=TRUE; + } + if (dc->flags & DCF_SYMMETRY) { + _x=x; _y=y; _z=z; + DCReflect(dc,&_x,&_y,&_z); + dc->flags&=~DCF_SYMMETRY; + GrPlot3(dc,_x,_y,_z); + was_symmetry=TRUE; + if (dc->flags&DCF_JUST_MIRROR) + goto gr_done; + } + w=dc->pen_width>>1; + dc->db_z=z; + if (dc->brush || w<=0) + GrPlot1(dc,x,y); + else if (dc->pen_widthcolor.c0.rop!=ROPB_COLLISION) + dc->color.c0.rop=ROPB_MONO; + if (dc->depth_buf) { + if (dc->color.c1.rop&ROPBF_DITHER) { + dc->color.c1.rop=dc->color.c0.rop; + if (((x-w)^(y-w))&1) { + record=GrBlot3(dc,x-w,y-w,z,gr.odd_pen_brushes[dc->pen_width]); + dc->color.c0=dc->color.c1; + record=GrBlot3(dc,x-w,y-w,z,gr.even_pen_brushes[dc->pen_width]); + } else { + record=GrBlot3(dc,x-w,y-w,z,gr.even_pen_brushes[dc->pen_width]); + dc->color.c0=dc->color.c1; + record=GrBlot3(dc,x-w,y-w,z,gr.odd_pen_brushes[dc->pen_width]); + } + } else { + if (dc->color.c0.rop==ROPB_COLLISION) { + if (dc->color.c0.color!=dc->bkcolor.c0.color && + dc->color.c0.color!=TRANSPARENT) + record=GrBlot3(dc,x-w,y-w,z, + gr.collision_pen_brushes[dc->pen_width]); + else + record=FALSE; + } else + record=GrBlot3(dc,x-w,y-w,z,gr.pen_brushes[dc->pen_width]); + } + } else { + if (dc->color.c1.rop&ROPBF_DITHER) { + dc->color.c1.rop=dc->color.c0.rop; + if (((x-w)^(y-w))&1) { + record=GrBlot(dc,x-w,y-w,gr.odd_pen_brushes[dc->pen_width]); + dc->color.c0=dc->color.c1; + record=GrBlot(dc,x-w,y-w,gr.even_pen_brushes[dc->pen_width]); + } else { + record=GrBlot(dc,x-w,y-w,gr.even_pen_brushes[dc->pen_width]); + dc->color.c0=dc->color.c1; + record=GrBlot(dc,x-w,y-w,gr.odd_pen_brushes[dc->pen_width]); + } + } else { + if (dc->color.c0.rop==ROPB_COLLISION) { + if (dc->color.c0.color!=dc->bkcolor.c0.color && + dc->color.c0.color!=TRANSPARENT) + record=GrBlot(dc,x-w,y-w,gr.collision_pen_brushes[dc->pen_width]); + else + record=FALSE; + } else + record=GrBlot(dc,x-w,y-w,gr.pen_brushes[dc->pen_width]); + } + } + if (record) { + if (dc->flags & DCF_SCREEN_BITMAP) { + win_task=dc->win_task; + x+=win_task->pix_left+win_task->scroll_x; + y+=win_task->pix_top+win_task->scroll_y; + } + if (dc->flags & DCF_LOCATE_NEAREST) { + dist=DistSqrI64(x,y,dc->cur_x,dc->cur_y); + if (dist<=dc->nearest_dist) { + dc->nearest_dist=dist; + dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num; + } + } + if (dc->flags & DCF_RECORD_EXTENTS) { + if (x-wmin_x) dc->min_x=x-w; + if (y-wmin_y) dc->min_y=y-w; + if (dc->pen_width & 1) { + if (x+w>dc->max_x) dc->max_x=x+w; + if (y+w>dc->max_y) dc->max_y=y+w; + } else { + if (x+w-1>dc->max_x) dc->max_x=x+w-1; + if (y+w-1>dc->max_y) dc->max_y=y+w-1; + } + } + } + } else + GrFillCircle(dc,x,y,dc->db_z,dc->pen_width); +gr_done: + dc->color=old_color; + if (was_transform) + dc->flags|=DCF_TRANSFORMATION; + if (was_symmetry) + dc->flags|=DCF_SYMMETRY; + return TRUE; +} + +Bool GrLinePlot0(CDC *dc,I64 x,I64 y,I64 z) +{//This is a callback. + CTask *win_task=dc->win_task; + if (!(dc->flags & DCF_SCREEN_BITMAP) || + win_task->next_task==sys_winmgr_task || + dc->flags&DCF_ON_TOP || + !IsPixCovered0(win_task,x,y)) { + dc->db_z=z; + GrPlot0(dc,x,y); + } + return TRUE; +} + +Bool GrLinePlot(CDC *dc,I64 x,I64 y,I64 z) +{//This is a callback. + dc->db_z=z; + GrPlot1(dc,x,y); + return TRUE; +} + +public Bool GrLine(CDC *dc=gr.dc,I64 x1,I64 y1,I64 x2,I64 y2, + I64 step=1,I64 start=0) +{//2D. Clipping but not transformation. + Bool res=FALSE; + I32 *db=dc->depth_buf; + dc->depth_buf=NULL; + if (step==1 && !start && !dc->brush && !dc->depth_buf) { + if (DCClipLine(dc,&x1,&y1,&x2,&y2)) + res=Line(dc,x1,y1,0,x2,y2,0,&GrLinePlot0,step,start); + } else + res=Line(dc,x1,y1,0,x2,y2,0,&GrLinePlot,step,start); + dc->depth_buf=db; + return res; +} + +public Bool GrCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 radius, + I64 step=1,F64 start_radians=0,F64 len_radians=2*ã) +{//2D. Clipping but not transformation. + Bool res; + I32 *db=dc->depth_buf; + dc->depth_buf=NULL; + res=Circle(dc,cx,cy,0,radius,&GrLinePlot,step,start_radians,len_radians); + dc->depth_buf=db; + return res; +} + +public Bool GrEllipse(CDC *dc=gr.dc, + I64 cx,I64 cy, + I64 x_radius,I64 y_radius, + F64 rot_angle=0, + I64 step=1, + F64 start_radians=0, + F64 len_radians=2*ã) +{//2D. Clipping but not transformation. + Bool res; + I32 *db=dc->depth_buf; + dc->depth_buf=NULL; + res=Ellipse(dc,cx,cy,0,x_radius,y_radius,&GrLinePlot, + rot_angle,step,start_radians,len_radians); + dc->depth_buf=db; + return res; +} + +public Bool GrRegPoly(CDC *dc=gr.dc, + I64 cx,I64 cy, + I64 x_radius,I64 y_radius,I64 sides, + F64 rot_angle=0, + I64 step=1, + F64 start_radians=0, + F64 len_radians=2*ã) +{//2D. Clipping but no transform or pen width. + Bool res; + I32 *db=dc->depth_buf; + dc->depth_buf=NULL; + res=RegPoly(dc,cx,cy,0,x_radius,y_radius,sides, + &GrLinePlot,rot_angle,step,start_radians,len_radians); + dc->depth_buf=db; + return res; +} + +public Bool Gr2Bezier(CDC *dc=gr.dc,CD3I32 *ctrl) +{//2nd order. Clipping but no transform or pen width. + return Bezier2(dc,ctrl,&GrLinePlot); +} + +public Bool Gr3Bezier(CDC *dc=gr.dc,CD3I32 *ctrl) +{//3rd order. Clipping but no transform or pen width. + return Bezier3(dc,ctrl,&GrLinePlot); +} + +public Bool Gr2BSpline(CDC *dc=gr.dc,CD3I32 *ctrl,I64 cnt,Bool closed=FALSE) +{//2nd order. Clipping but no transform or pen width. + return BSpline2(dc,ctrl,cnt,&GrLinePlot,closed); +} + +public Bool Gr3BSpline(CDC *dc=gr.dc,CD3I32 *ctrl,I64 cnt,Bool closed=FALSE) +{//3rd order. Clipping but no transform or pen width. + 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.HC"$. + 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=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=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, + I64 step=1,I64 start=0) +{//3D. Transformation with pen width. + I64 _x1,_y1,_z1,_x2,_y2,_z2; + Bool res=FALSE,was_transform=FALSE,was_symmetry=FALSE; + if (dc->flags & DCF_TRANSFORMATION) { + (*dc->transform)(dc,&x1,&y1,&z1); + (*dc->transform)(dc,&x2,&y2,&z2); + dc->flags&=~DCF_TRANSFORMATION; + was_transform=TRUE; + } + if (dc->flags & DCF_SYMMETRY) { + _x1=x1; _y1=y1; _z1=z1; + DCReflect(dc,&_x1,&_y1,&_z1); + _x2=x2; _y2=y2; _z2=z2; + DCReflect(dc,&_x2,&_y2,&_z2); + dc->flags&=~DCF_SYMMETRY; + if (step==1 && !dc->brush) { + if (!start && dc->pen_width<2 && !dc->depth_buf) {//TODO: clip z depbuf + if (DCClipLine(dc,&_x1,&_y1,&_x2,&_y2)) + 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 + res=Line(dc,_x1,_y1,_z1,_x2,_y2,_z2,&GrPlot3,step,start); + was_symmetry=TRUE; + if (dc->flags&DCF_JUST_MIRROR) + goto gr_done; + } + if (step==1 && !dc->brush) { + if (!start && dc->pen_width<2 && !dc->depth_buf) {//TODO: clip z depbuf + if (DCClipLine(dc,&x1,&y1,&x2,&y2)) + 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 + res|=Line(dc,x1,y1,z1,x2,y2,z2,&GrPlot3,step,start); +gr_done: + if (was_transform) + dc->flags|=DCF_TRANSFORMATION; + if (was_symmetry) + dc->flags|=DCF_SYMMETRY; + return res; +} + +#help_index "Graphics/Char;Char/Graphics" + +public Bool GrPutChar3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 ch) +{//3D. Transformation. DCF_SYMMETRY is silly. + if (dc->flags & DCF_TRANSFORMATION) + (*dc->transform)(dc,&x,&y,&z); + return GrPutChar(dc,x,y,ch); +} + +public I64 GrPrint3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *fmt,...) +{//3D. Transformation. DCF_SYMMETRY is silly. + U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); + I64 res; + if (dc->flags & DCF_TRANSFORMATION) + (*dc->transform)(dc,&x,&y,&z); + res=GrPrint(dc,x,y,"%s",buf); + Free(buf); + return res; +} + +public I64 GrVPrint3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *fmt,...) +{//3D. Vertical text. Transformation. DCF_SYMMETRY is silly. + U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); + I64 res; + if (dc->flags & DCF_TRANSFORMATION) + (*dc->transform)(dc,&x,&y,&z); + res=GrVPrint(dc,x,y,"%s",buf); + Free(buf); + return res; +} + +#help_index "Graphics" + +public Bool GrEllipse3(CDC *dc=gr.dc, + I64 cx,I64 cy,I64 cz, + I64 x_radius,I64 y_radius, + F64 rot_angle=0, + I64 step=1, + F64 start_radians=0, + F64 len_radians=2*ã) +{//3D. Transformation with pen width. + Bool res; + I64 x,y,z,xx,yy,zz; + F64 m1,a1,m2,a2,s,c; + if (dc->flags & DCF_TRANSFORMATION) { + dc->flags&=~DCF_TRANSFORMATION; + (*dc->transform)(dc,&cx,&cy,&cz); + + c=Cos(rot_angle); + s=Sin(rot_angle); + + x_radius<<=16; + y_radius<<=16; + + xx=0; + yy=0; + zz=0; + (*dc->transform)(dc,&xx,&yy,&zz); + + x=x_radius*c; + y=x_radius*s; + z=0; + (*dc->transform)(dc,&x,&y,&z); + x-=xx; + y-=yy; + z-=zz; + R2P(&m1,&a1,x,y); + + x=-y_radius*s; + y=y_radius*c; + z=0; + (*dc->transform)(dc,&x,&y,&z); + x-=xx; + y-=yy; + z-=zz; + R2P(&m2,&a2,x,y); + m2*=Abs(Sin(a2-a1)); + + res=Ellipse(dc,cx,cy,cz, + m1/0x10000,m2/0x10000,&GrPlot3,-a1,step,start_radians,len_radians); + dc->flags|=DCF_TRANSFORMATION; + } else + res=Ellipse(dc,cx,cy,cz,x_radius,y_radius,&GrPlot3, + rot_angle,step,start_radians,len_radians); + return res; +} + +public Bool GrCircle3(CDC *dc=gr.dc,I64 cx,I64 cy,I64 cz,I64 radius, + I64 step=1,F64 start_radians=0,F64 len_radians=2*ã) +{//3D. Transformation with pen width. + if (dc->flags & DCF_TRANSFORMATION) + return GrEllipse3(dc,cx,cy,cz,radius,radius,0,step, + start_radians,len_radians); + else + return Circle(dc,cx,cy,cz,radius,&GrPlot3,step, + start_radians,len_radians); +} + +public Bool GrRegPoly3(CDC *dc=gr.dc, + I64 cx,I64 cy,I64 cz, + I64 x_radius,I64 y_radius,I64 sides, + F64 rot_angle=0, + I64 step=1, + F64 start_radians=0, + F64 len_radians=2*ã) +{//3D. Clipping and transform and pen width. + Bool res; + I64 x,y,z,xx,yy,zz; + F64 m1,a1,m2,a2,s,c; + if (dc->flags & DCF_TRANSFORMATION) { + dc->flags&=~DCF_TRANSFORMATION; + (*dc->transform)(dc,&cx,&cy,&cz); + + c=Cos(rot_angle); + s=Sin(rot_angle); + + x_radius<<=16; + y_radius<<=16; + + xx=0; + yy=0; + zz=0; + (*dc->transform)(dc,&xx,&yy,&zz); + + x=x_radius*c; + y=x_radius*s; + z=0; + (*dc->transform)(dc,&x,&y,&z); + x-=xx; + y-=yy; + z-=zz; + R2P(&m1,&a1,x,y); + + x=-y_radius*s; + y=y_radius*c; + z=0; + (*dc->transform)(dc,&x,&y,&z); + x-=xx; + y-=yy; + z-=zz; + R2P(&m2,&a2,x,y); + m2*=Abs(Sin(a2-a1)); + + res=RegPoly(dc,cx,cy,cz, + m1/0x10000,m2/0x10000,sides,&GrPlot3,-a1, + step,start_radians,len_radians); + dc->flags|=DCF_TRANSFORMATION; + } else + res=RegPoly(dc,cx,cy,cz,x_radius,y_radius,sides,&GrPlot3, + rot_angle,step,start_radians,len_radians); + return res; +} + +public I64 GrFloodFill3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,Bool not_color=FALSE) +{//3D. Transformation. +//not_color=TRUE means fill up to everything which is not the current color. + //not_color=FALSE means fill all parts equ to the color under the point. + //Returns cnt of pixs changed + I64 res,old_flags=dc->flags, + _x,_y,_z; + if (dc->flags & DCF_TRANSFORMATION) { + (*dc->transform)(dc,&x1,&y1,&z1); + dc->flags&=~DCF_TRANSFORMATION; + } + if (dc->flags & DCF_SYMMETRY) { + _x=x1; _y=y1; _z=z1; + DCReflect(dc,&_x,&_y,&_z); + dc->flags&=~DCF_SYMMETRY; + res=GrFloodFill(dc,_x,_y,not_color,_z,dc->depth_buf); + if (dc->flags&DCF_JUST_MIRROR) + goto gr_done; + } + res=GrFloodFill(dc,x1,y1,not_color,z1,dc->depth_buf); +gr_done: + dc->flags=old_flags; + return res; +} + +#help_index "Graphics;Graphics/Device Contexts" + +Option(OPTf_WARN_HEADER_MISMATCH,OFF); +public I64 GrBlot3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,CDC *img) +{//3D. Clipping and transformation. + CColorROPU32 old_color=dc->color; + I64 color,reg i,j,w=img->width,h=img->height, + d1,dx1,dy1,dz1, + reg d2,dx2,dy2,dz2, + adx1,ady1,adz1, + adx2,ady2,adz2, + x2,y2,z2,x3,y3,z3, + dw,reg dh,x,y,_x1,_y1,_z1,_x2,_y2,_z2,_x3,_y3,_z3, + last_x,last_y,res=0; + Bool first; + CDC *old_brush=dc->brush; + + if (dc->depth_buf || dc->flags & (DCF_TRANSFORMATION | DCF_SYMMETRY)) { + x2=x1+w; y2=y1; z2=z1; + x3=x1; y3=y1+h; z3=z1; + if (dc->flags & DCF_TRANSFORMATION) { + (*dc->transform)(dc,&x1,&y1,&z1); + (*dc->transform)(dc,&x2,&y2,&z2); + (*dc->transform)(dc,&x3,&y3,&z3); + } + if (dc->flags & DCF_SYMMETRY) { + _x1=x1; _y1=y1; _z1=z1; + DCReflect(dc,&_x1,&_y1,&_z1); + _x2=x2; _y2=y2; _z2=z2; + DCReflect(dc,&_x2,&_y2,&_z2); + _x3=x3; _y3=y3; _z3=z3; + DCReflect(dc,&_x3,&_y3,&_z3); + dx1=_x2-_x1; dy1=_y2-_y1; dz1=_z2-_z1; + dx2=_x3-_x1; dy2=_y3-_y1; dz2=_z3-_z1; + adx1=AbsI64(dx1); ady1=AbsI64(dy1); adz1=AbsI64(dz1); + adx2=AbsI64(dx2); ady2=AbsI64(dy2); adz2=AbsI64(dz2); + + if (adx1>=ady1) { + if (adx1>=adz1) + d1=adx1; + else + d1=adz1; + } else { + if (ady1>=adz1) + d1=ady1; + else + d1=adz1; + } + if (adx2>=ady2) { + if (adx2>=adz2) + d2=adx2; + else + d2=adz2; + } else { + if (ady2>=adz2) + d2=ady2; + else + d2=adz2; + } + + if (AbsI64(d1)!=w ||AbsI64(d2)!=h) { + d1<<=1; + d2<<=1; + } + if (d1) { + dx1=dx1<<32/d1; + dy1=dy1<<32/d1; + dz1=dz1<<32/d1; + } else + goto normal_image; + if (d2) { + dx2=dx2<<32/d2; + dy2=dy2<<32/d2; + dz2=dz2<<32/d2; + } else + goto normal_image; + dc->brush=NULL; + x=0;y=0; + dw=w<<32/d1; + dh=h<<32/d2; + + first=TRUE; + _x1<<=32; _y1<<=32; _z1<<=32; + for (j=0;j<=d1;j++) { + _x2=_x1; _y2=_y1; _z2=_z1; + y=0; + for (i=0;i<=d2;i++) { + if (_x2.i32[1]!=last_x || _y2.i32[1]!=last_y ||first) { + if ((color=GrPeek(img,x.i32[1],y.i32[1]))>=0) { + if (dc->color.c0.rop==ROPB_MONO) { + if (color) { + dc->color=old_color&~ROPF_DITHER; + if (dc->depth_buf) { + dc->db_z=_z2.i32[1]; + GrPlot1(dc,_x2.i32[1],_y2.i32[1]); + } else + GrPlot(dc,_x2.i32[1],_y2.i32[1]); + } + } else { + if (color!=TRANSPARENT) { + dc->color=old_color&~COLORROP_NO_ROP0_MASK|color; + if (dc->depth_buf) { + dc->db_z=_z2.i32[1]; + GrPlot1(dc,_x2.i32[1],_y2.i32[1]); + } else + GrPlot(dc,_x2.i32[1],_y2.i32[1]); + } + } + } + } + first=FALSE; + last_x=_x2.i32[1]; last_y=_y2.i32[1]; + _x2+=dx2; _y2+=dy2; _z2+=dz2; + y+=dh; + } + _x1+=dx1; _y1+=dy1; _z1+=dz1; + x+=dw; + } + res=1; +normal_image: + if (dc->flags&DCF_JUST_MIRROR) + goto gr_done; + } + dx1=x2-x1; dy1=y2-y1; dz1=z2-z1; + dx2=x3-x1; dy2=y3-y1; dz2=z3-z1; + adx1=AbsI64(dx1); ady1=AbsI64(dy1); adz1=AbsI64(dz1); + adx2=AbsI64(dx2); ady2=AbsI64(dy2); adz2=AbsI64(dz2); + + if (adx1>=ady1) { + if (adx1>=adz1) + d1=adx1; + else + d1=adz1; + } else { + if (ady1>=adz1) + d1=ady1; + else + d1=adz1; + } + if (adx2>=ady2) { + if (adx2>=adz2) + d2=adx2; + else + d2=adz2; + } else { + if (ady2>=adz2) + d2=ady2; + else + d2=adz2; + } + if (AbsI64(d1)!=w ||AbsI64(d2)!=h) { + d1<<=1; + d2<<=1; + } + if (d1) { + dx1=dx1<<32/d1; + dy1=dy1<<32/d1; + dz1=dz1<<32/d1; + } else + goto gr_done; + if (d2) { + dx2=dx2<<32/d2; + dy2=dy2<<32/d2; + dz2=dz2<<32/d2; + } else + goto gr_done; + dc->brush=NULL; + x=0;y=0; + dw=w<<32/d1; + dh=h<<32/d2; + + first=TRUE; + x1<<=32; y1<<=32; z1<<=32; + for (j=0;j<=d1;j++) { + x2=x1; y2=y1; z2=z1; + y=0; + for (i=0;i<=d2;i++) { + if (x2.i32[1]!=last_x || y2.i32[1]!=last_y || first) { + if ((color=GrPeek(img,x.i32[1],y.i32[1]))>=0) { + if (dc->color.c0.rop==ROPB_MONO) { + if (color) { + dc->color=old_color&~ROPF_DITHER; + if (dc->depth_buf) { + dc->db_z=z2.i32[1]; + GrPlot1(dc,x2.i32[1],y2.i32[1]); + } else + GrPlot(dc,x2.i32[1],y2.i32[1]); + } + } else { + if (color!=TRANSPARENT) { + dc->color=old_color&~COLORROP_NO_ROP0_MASK|color;//COLOR + if (dc->depth_buf) { + dc->db_z=z2.i32[1]; + GrPlot1(dc,x2.i32[1],y2.i32[1]); + } else + GrPlot(dc,x2.i32[1],y2.i32[1]); + } + } + } + } + first=FALSE; + last_x=x2.i32[1]; last_y=y2.i32[1]; + x2+=dx2; y2+=dy2; z2+=dz2; + y+=dh; + } + x1+=dx1; y1+=dy1; z1+=dz1; + x+=dw; + } + res=1; //TODO: check off screen + } else + res=GrBlot(dc,x1,y1,img); +gr_done: + dc->color=old_color; + dc->brush=old_brush; + return res; +} +Option(OPTf_WARN_HEADER_MISMATCH,ON); + +#help_index "Graphics" + +public Bool Gr2Bezier3(CDC *dc=gr.dc,CD3I32 *ctrl) +{//2nd order. Clipping and transform and pen width. + Bool res=FALSE; + I64 i,x,y,z, + old_flags=dc->flags; + CD3I32 *ctrl2=NULL,*ctrl3=NULL; + if (dc->flags & DCF_TRANSFORMATION) { + ctrl2=MAlloc(sizeof(CD3I32)*3); + for (i=0;i<3;i++) { + x=ctrl[i].x; + y=ctrl[i].y; + z=ctrl[i].z; + (*dc->transform)(dc,&x,&y,&z); + ctrl2[i].x=x; + ctrl2[i].y=y; + ctrl2[i].z=z; + } + dc->flags&=~DCF_TRANSFORMATION; + ctrl=ctrl2; + } + if (dc->flags & DCF_SYMMETRY) { + ctrl3=MAlloc(sizeof(CD3I32)*3); + for (i=0;i<3;i++) { + x=ctrl[i].x; + y=ctrl[i].y; + z=ctrl[i].z; + DCReflect(dc,&x,&y,&z); + ctrl3[i].x=x; + ctrl3[i].y=y; + ctrl3[i].z=z; + } + dc->flags&=~DCF_SYMMETRY; + res=Bezier2(dc,ctrl3,&GrPlot3); + if (dc->flags & DCF_JUST_MIRROR) + goto gr_done; + } + + res|=Bezier2(dc,ctrl,&GrPlot3); +gr_done: + Free(ctrl2); + Free(ctrl3); + dc->flags=old_flags; + return res; +} + +public Bool Gr3Bezier3(CDC *dc=gr.dc,CD3I32 *ctrl) +{//3rd order. Clipping and transform and pen width. + Bool res=FALSE; + I64 i,x,y,z, + old_flags=dc->flags; + CD3I32 *ctrl2=NULL,*ctrl3=NULL; + if (dc->flags & DCF_TRANSFORMATION) { + ctrl2=MAlloc(sizeof(CD3I32)*4); + for (i=0;i<4;i++) { + x=ctrl[i].x; + y=ctrl[i].y; + z=ctrl[i].z; + (*dc->transform)(dc,&x,&y,&z); + ctrl2[i].x=x; + ctrl2[i].y=y; + ctrl2[i].z=z; + } + dc->flags&=~DCF_TRANSFORMATION; + ctrl=ctrl2; + } + if (dc->flags & DCF_SYMMETRY) { + ctrl3=MAlloc(sizeof(CD3I32)*4); + for (i=0;i<4;i++) { + x=ctrl[i].x; + y=ctrl[i].y; + z=ctrl[i].z; + DCReflect(dc,&x,&y,&z); + ctrl3[i].x=x; + ctrl3[i].y=y; + ctrl3[i].z=z; + } + dc->flags&=~DCF_SYMMETRY; + res=Bezier3(dc,ctrl3,&GrPlot3); + if (dc->flags & DCF_JUST_MIRROR) + goto gr_done; + } + + res|=Bezier3(dc,ctrl,&GrPlot3); +gr_done: + Free(ctrl2); + Free(ctrl3); + dc->flags=old_flags; + return res; +} + +public I64 Gr2BSpline3(CDC *dc=gr.dc,CD3I32 *ctrl,I64 cnt,Bool closed=FALSE) +{//2nd order. Clipping and transform and pen width. + Bool res=FALSE; + I64 i,x,y,z, + old_flags=dc->flags; + CD3I32 *ctrl2=NULL,*ctrl3=NULL; + if (dc->flags & DCF_TRANSFORMATION) { + ctrl2=MAlloc(sizeof(CD3I32)*cnt); + for (i=0;itransform)(dc,&x,&y,&z); + ctrl2[i].x=x; + ctrl2[i].y=y; + ctrl2[i].z=z; + } + dc->flags&=~DCF_TRANSFORMATION; + ctrl=ctrl2; + } + if (dc->flags & DCF_SYMMETRY) { + ctrl3=MAlloc(sizeof(CD3I32)*cnt); + for (i=0;iflags&=~DCF_SYMMETRY; + res=BSpline2(dc,ctrl3,cnt,&GrPlot3,closed); + if (dc->flags & DCF_JUST_MIRROR) + goto gr_done; + } + + res|=BSpline2(dc,ctrl,cnt,&GrPlot3,closed); +gr_done: + Free(ctrl2); + Free(ctrl3); + dc->flags=old_flags; + return res; +} + +public Bool Gr3BSpline3(CDC *dc=gr.dc,CD3I32 *ctrl,I64 cnt,Bool closed=FALSE) +{//3rd order. Clipping and transform and pen width. + Bool res=FALSE; + I64 i,x,y,z, + old_flags=dc->flags; + CD3I32 *ctrl2=NULL,*ctrl3=NULL; + if (dc->flags & DCF_TRANSFORMATION) { + ctrl2=MAlloc(sizeof(CD3I32)*cnt); + for (i=0;itransform)(dc,&x,&y,&z); + ctrl2[i].x=x; + ctrl2[i].y=y; + ctrl2[i].z=z; + } + dc->flags&=~DCF_TRANSFORMATION; + ctrl=ctrl2; + } + if (dc->flags & DCF_SYMMETRY) { + ctrl3=MAlloc(sizeof(CD3I32)*cnt); + for (i=0;iflags&=~DCF_SYMMETRY; + res=BSpline3(dc,ctrl3,cnt,&GrPlot3,closed); + if (dc->flags & DCF_JUST_MIRROR) + goto gr_done; + } + + res|=BSpline3(dc,ctrl,cnt,&GrPlot3,closed); +gr_done: + Free(ctrl2); + Free(ctrl3); + dc->flags=old_flags; + return res; +} + +public I64 GrFillTri0(CDC *dc=gr.dc,CD3I32 *p1,CD3I32 *p2,CD3I32 *p4) +{//3D. Returns cnt of pixs changed + I64 x1,x2,y1,y2,z1,z2,dx1,dy1,dz1,dx2,dy2,dz2,res=0,i,min,max; + CTask *win_task; + + if (AbsI64(p1->y-p2->y)+AbsI64(p1->y-p4->y)<= + AbsI64(p1->x-p2->x)+AbsI64(p1->x-p4->x)) { +//p1 is min x + if (p4->xx) + SwapI64(&p4,&p2); + if (p2->xx) + SwapI64(&p2,&p1); + + //p2y<=p4y + if (p4->yy) + SwapI64(&p4,&p2); + + min=0; + max=dc->height; + if (dc->flags & DCF_SCREEN_BITMAP) { + win_task=dc->win_task; + min-=win_task->scroll_y+win_task->pix_top; + max-=win_task->scroll_y+win_task->pix_top; + if (max>win_task->pix_bottom-(win_task->scroll_y+win_task->pix_top)) + max=win_task->pix_bottom-(win_task->scroll_y+win_task->pix_top); + } + + if ((dy2=p4->y-p1->y)<0) { + dy1=p2->y-p1->y; + dx1=(p1->x-p2->x)<<32/dy1; + dz1=(p1->z-p2->z)<<32/dy1; + + dx2=(p1->x-p4->x)<<32/dy2; + dz2=(p1->z-p4->z)<<32/dy2; + x1=x2=p1->x<<32; y1=p1->y; z1=z2=p1->z<<32; + if (y1+dy2-dy2) goto ft_done; + dy2+=i; + } + if (y1>=max) { + i=y1-max+1; + if (i>-dy2) + i=-dy2; + dy2+=i; + y1-=i; + x1+=dx1*i; + x2+=dx2*i; + z1+=dz1*i; + z2+=dz2*i; + } + while (dy2++) { + res+=GrHLine(dc,x1.i32[1],x2.i32[1],y1,z1.i32[1],z2.i32[1]); + y1--; + x1+=dx1; + x2+=dx2; + z1+=dz1; + z2+=dz2; + } + if (dy2=p2->y-p4->y) { + dx2=(p4->x-p2->x)<<32/dy2; + dz2=(p4->z-p2->z)<<32/dy2; + if (y1+dy2-dy2) goto ft_done; + dy2+=i; + } + if (y1>=max) { + i=y1-max+1; + if (i>-dy2) goto ft_done; + dy2+=i; + y1-=i; + x1+=dx1*i; + x2+=dx2*i; + z1+=dz1*i; + z2+=dz2*i; + } + } + while (dy2++<=0) { + res+=GrHLine(dc,x1.i32[1],x2.i32[1],y1,z1.i32[1],z2.i32[1]); + y1--; + x1+=dx1; + x2+=dx2; + z1+=dz1; + z2+=dz2; + } + } else if ((dy2=p2->y-p1->y)>0) { + dy1=p4->y-p1->y; + dx1=(p4->x-p1->x)<<32/dy1; + dz1=(p4->z-p1->z)<<32/dy1; + + dx2=(p2->x-p1->x)<<32/dy2; + dz2=(p2->z-p1->z)<<32/dy2; + x1=x2=p1->x<<32; y1=p1->y; z1=z2=p1->z<<32; + if (y1+dy2>=max) { + i=y1+dy2-max+1; + if (i>dy2) goto ft_done; + dy2-=i; + } + if (y1dy2) + i=dy2; + dy2-=i; + y1+=i; + x1+=dx1*i; + x2+=dx2*i; + z1+=dz1*i; + z2+=dz2*i; + } + while (dy2--) { + res+=GrHLine(dc,x1.i32[1],x2.i32[1],y1,z1.i32[1],z2.i32[1]); + y1++; + x1+=dx1; + x2+=dx2; + z1+=dz1; + z2+=dz2; + } + if (dy2=p4->y-p2->y) { + dx2=(p4->x-p2->x)<<32/dy2; + dz2=(p4->z-p2->z)<<32/dy2; + if (y1+dy2>=max) { + i=y1+dy2-max+1; + if (i>dy2) goto ft_done; + dy2-=i; + } + if (y1dy2) goto ft_done; + dy2-=i; + y1+=i; + x1+=dx1*i; + x2+=dx2*i; + z1+=dz1*i; + z2+=dz2*i; + } + } + while (dy2-->=0) { + res+=GrHLine(dc,x1.i32[1],x2.i32[1],y1,z1.i32[1],z2.i32[1]); + y1++; + x1+=dx1; + x2+=dx2; + z1+=dz1; + z2+=dz2; + } + } else { + if (dy1=p2->y-p1->y) { + dx1=(p2->x-p1->x)<<32/dy1; + dz1=(p2->z-p1->z)<<32/dy1; + if (dy2=p2->y-p4->y) { + dx2=(p2->x-p4->x)<<32/dy2; + dz2=(p2->z-p4->z)<<32/dy2; + } else { + dx2=0; + dz2=0; + } + x1=x2=p2->x<<32; y1=p2->y; z1=z2=p2->z<<32; + if (y1-dy1) + i=-dy1; + dy1+=i; + y1+=i; + x1+=dx1*i; + x2+=dx2*i; + z1+=dz1*i; + z2+=dz2*i; + } + while (dy1++<=0) { + if (y1y-p1->y) { + dx1=(p1->x-p4->x)<<32/dy1; + dz1=(p1->z-p4->z)<<32/dy1; + if (dy2=p4->y-p2->y) { + dx2=(p2->x-p4->x)<<32/dy2; + dz2=(p2->z-p4->z)<<32/dy2; + } else { + dx2=0; + dz2=0; + } + x1=x2=p4->x<<32; y1=p4->y; z1=z2=p4->z<<32; + if (y1-dy1dy1) goto ft_done; + dy1-=i; + } + if (y1>=max) { + i=y1-max+1; + if (i>dy1) goto ft_done; + dy1-=i; + y1-=i; + x1+=dx1*i; + x2+=dx2*i; + z1+=dz1*i; + z2+=dz2*i; + } + while (dy1-->=0) { + res+=GrHLine(dc,x1.i32[1],x2.i32[1],y1,z1.i32[1],z2.i32[1]); + y1--; + x1+=dx1; + x2+=dx2; + z1+=dz1; + z2+=dz2; + } + } + } + } else { +//p1 is min y + if (p4->yy) + SwapI64(&p4,&p2); + if (p2->yy) + SwapI64(&p2,&p1); + + //p2x<=p4x + if (p4->xx) + SwapI64(&p4,&p2); + + min=0; + max=dc->width; + if (dc->flags & DCF_SCREEN_BITMAP) { + win_task=dc->win_task; + min-=win_task->scroll_x+win_task->pix_left; + max-=win_task->scroll_x+win_task->pix_left; + if (max>win_task->pix_right-(win_task->scroll_x+win_task->pix_left)) + max=win_task->pix_right-(win_task->scroll_x+win_task->pix_left); + } + + if ((dx2=p4->x-p1->x)<0) { + dx1=p2->x-p1->x; + dy1=(p1->y-p2->y)<<32/dx1; + dz1=(p1->z-p2->z)<<32/dx1; + + dy2=(p1->y-p4->y)<<32/dx2; + dz2=(p1->z-p4->z)<<32/dx2; + y1=y2=p1->y<<32; x1=p1->x; z1=z2=p1->z<<32; + if (x1+dx2-dx2) goto ft_done; + dx2+=i; + } + if (x1>=max) { + i=x1-max+1; + if (i>-dx2) + i=-dx2; + dx2+=i; + x1-=i; + y1+=dy1*i; + y2+=dy2*i; + z1+=dz1*i; + z2+=dz2*i; + } + while (dx2++) { + res+=GrVLine(dc,x1,y1.i32[1],y2.i32[1],z1.i32[1],z2.i32[1]); + x1--; + y1+=dy1; + y2+=dy2; + z1+=dz1; + z2+=dz2; + } + if (dx2=p2->x-p4->x) { + dy2=(p4->y-p2->y)<<32/dx2; + dz2=(p4->z-p2->z)<<32/dx2; + if (x1+dx2-dx2) goto ft_done; + dx2+=i; + } + if (x1>=max) { + i=x1-max+1; + if (i>-dx2) goto ft_done; + dx2+=i; + x1-=i; + y1+=dy1*i; + y2+=dy2*i; + z1+=dz1*i; + z2+=dz2*i; + } + } + while (dx2++<=0) { + res+=GrVLine(dc,x1,y1.i32[1],y2.i32[1],z1.i32[1],z2.i32[1]); + x1--; + y1+=dy1; + y2+=dy2; + z1+=dz1; + z2+=dz2; + } + } else if ((dx2=p2->x-p1->x)>0) { + dx1=p4->x-p1->x; + dy1=(p4->y-p1->y)<<32/dx1; + dz1=(p4->z-p1->z)<<32/dx1; + + dy2=(p2->y-p1->y)<<32/dx2; + dz2=(p2->z-p1->z)<<32/dx2; + y1=y2=p1->y<<32; x1=p1->x; z1=z2=p1->z<<32; + if (x1+dx2>=max) { + i=x1+dx2-max+1; + if (i>dx2) goto ft_done; + dx2-=i; + } + if (x1dx2) + i=dx2; + dx2-=i; + x1+=i; + y1+=dy1*i; + y2+=dy2*i; + z1+=dz1*i; + z2+=dz2*i; + } + while (dx2--) { + res+=GrVLine(dc,x1,y1.i32[1],y2.i32[1],z1.i32[1],z2.i32[1]); + x1++; + y1+=dy1; + y2+=dy2; + z1+=dz1; + z2+=dz2; + } + if (dx2=p4->x-p2->x) { + dy2=(p4->y-p2->y)<<32/dx2; + dz2=(p4->z-p2->z)<<32/dx2; + if (x1+dx2>=max) { + i=x1+dx2-max+1; + if (i>dx2) goto ft_done; + dx2-=i; + } + if (x1dx2) goto ft_done; + dx2-=i; + x1+=i; + y1+=dy1*i; + y2+=dy2*i; + z1+=dz1*i; + z2+=dz2*i; + } + } + while (dx2-->=0) { + res+=GrVLine(dc,x1,y1.i32[1],y2.i32[1],z1.i32[1],z2.i32[1]); + x1++; + y1+=dy1; + y2+=dy2; + z1+=dz1; + z2+=dz2; + } + } else { + if (dx1=p2->x-p1->x) { + dy1=(p2->y-p1->y)<<32/dx1; + dz1=(p2->z-p1->z)<<32/dx1; + if (dx2=p2->x-p4->x) { + dy2=(p2->y-p4->y)<<32/dx2; + dz2=(p2->z-p4->z)<<32/dx2; + } else { + dy2=0; + dz2=0; + } + y1=y2=p2->y<<32; x1=p2->x; z1=z2=p2->z<<32; + if (x1-dx1) + i=-dx1; + dx1+=i; + x1+=i; + y1+=dy1*i; + y2+=dy2*i; + z1+=dz1*i; + z2+=dz2*i; + } + while (dx1++<=0) { + if (x1x-p1->x) { + dy1=(p1->y-p4->y)<<32/dx1; + dz1=(p1->z-p4->z)<<32/dx1; + if (dx2=p4->x-p2->x) { + dy2=(p2->y-p4->y)<<32/dx2; + dz2=(p2->z-p4->z)<<32/dx2; + } else { + dy2=0; + dz2=0; + } + y1=y2=p4->y<<32; x1=p4->x; z1=z2=p4->z<<32; + if (x1-dx1dx1) goto ft_done; + dx1-=i; + } + if (x1>=max) { + i=x1-max+1; + if (i>dx1) goto ft_done; + dx1-=i; + x1-=i; + y1+=dy1*i; + y2+=dy2*i; + z1+=dz1*i; + z2+=dz2*i; + } + while (dx1-->=0) { + res+=GrVLine(dc,x1,y1.i32[1],y2.i32[1],z1.i32[1],z2.i32[1]); + x1--; + y1+=dy1; + y2+=dy2; + z1+=dz1; + z2+=dz2; + } + } + } + } +ft_done: + return res; +} diff --git a/Adam/Gr/GrScreen.CPP b/Adam/Gr/GrScreen.CPP deleted file mode 100644 index 7a23516..0000000 --- a/Adam/Gr/GrScreen.CPP +++ /dev/null @@ -1,423 +0,0 @@ -#help_index "Graphics/Screen" - -U0 GrUpdateTaskODEs(CTask *task) -{ - sys_task_being_screen_updated=task; - try - ODEsUpdate(task); - catch { - LBts(&task->win_inhibit,WIf_SELF_ODE); - "Exception in WinMgr: Update Task ODEs\n"; - PutExcept; - Sleep(3000); - VGAFlush; - } - sys_task_being_screen_updated=NULL; -} - -U0 GrUpdateTaskWin(CTask *task) -{ //Draw a win. Only core0 tasks have a win. - CDC *dc; - CD3I64 saved_scroll; - sys_task_being_screen_updated=task; - try { - if (!Bt(&task->display_flags,DISPLAYf_NO_BORDER)) - TextBorder(Fs,task->win_left,task->win_right,task->win_top, - task->win_bottom,task->border_attr,task==sys_focus_task); - TextRect(task->win_left,task->win_right, - task->win_top,task->win_bottom,task->text_attr<<8); - if (task==sys_winmgr_task) { - if (gr.fp_wall_paper) - (*gr.fp_wall_paper)(task); - } else if (!(task->win_inhibit&WIF_SELF_DOC)) - DocUpdateTaskDocs(task); - if (TaskValidate(task)) { - if (task->draw_it) { - dc=DCAlias(gr.dc2,task); - (*task->draw_it)(task,dc); - DCDel(dc); - } - if (TaskValidate(task)) { - WinScrollNull(task,&saved_scroll); - DrawCtrls(task); - WinScrollRestore(task,&saved_scroll); - } - } - } catch { - if (task!=Fs && TaskValidate(task)) { - LBtr(&task->display_flags,DISPLAYf_SHOW); - "Exception in WinMgr: Update Task Win\n"; - PutExcept; - Sleep(3000); - VGAFlush; - } - } - sys_task_being_screen_updated=NULL; -} - -U0 GrUpdateTasks() -{//Only called by WinMgr - I64 i; - CTask *task,*task1; - try { - winmgr.ode_time=0; - if (Bt(&sys_semas[SYS_SEMA_UPDATE_WIN_Z_BUF],0)) - WinZBufUpdate; - task1=task=sys_winmgr_task; - do { //Loop through core0 tasks. - if (!TaskValidate(task)) break; - if (Bt(&task->display_flags,DISPLAYf_SHOW) && - Bt(gr.win_uncovered_bitmap,task->win_z_num)) - GrUpdateTaskWin(task); - if (!TaskValidate(task)) break; - task=task->next_task; - } while (task!=task1); - - for (i=0;inext_task; - } while (task!=task1); - } - } catch { - PutExcept(FALSE); - Dbg("Exception in WinMgr"); - } - winmgr.last_ode_time=winmgr.ode_time; - ode_alloced_factor=LowPass1(0.1,ode_alloced_factor, - Clamp(Gs->idle_factor-0.1,0.2,0.8),1/winmgr.fps); - sys_task_being_screen_updated=NULL; -} - -U0 GrFixZoomScale() -{ - gr.screen_zoom=ClampI64(gr.screen_zoom,1,GR_MAX_SCREEN_ZOOM); - if (gr.screen_zoom==1) { - gr.sx=0; - gr.sy=0; - } else { - gr.sx=ClampI64(gr.sx,0,GR_WIDTH-GR_WIDTH/gr.screen_zoom)&~7; - gr.sy=ClampI64(gr.sy,0,GR_HEIGHT-GR_HEIGHT/gr.screen_zoom); - } -} - -public U0 GrScaleZoom(F64 scale) -{//Multiply zoom factor larger or smaller. - F64 s=gr.screen_zoom; - gr.screen_zoom=gr.screen_zoom*scale; - GrFixZoomScale; - s/=gr.screen_zoom; - ip.scale.x*=s; - ip.scale.y*=s; - ip.scale.z*=s; - ip.offset.x=ip.pos.x-(ip.pos.x-ip.offset.x)*s; - ip.offset.y=ip.pos.y-(ip.pos.y-ip.offset.y)*s; - ip.offset.z=ip.pos.z-(ip.pos.z-ip.offset.z)*s; - gr.sx=ip.pos.x-gr.zoomed_dc->width >>1/gr.screen_zoom; - gr.sy=ip.pos.y-gr.zoomed_dc->height>>1/gr.screen_zoom; - GrFixZoomScale; -} - -U0 GrZoomInScreen() -{ - GrFixZoomScale; - I64 plane,row,col,k,l, - d2=gr.zoomed_dc->width>>3/gr.screen_zoom, - d4=gr.zoomed_dc->width_internal>>3, - d5=d4-d2*gr.screen_zoom, - d3=gr.zoomed_dc->height/gr.screen_zoom, - d6=(gr.zoomed_dc->height-d3)*gr.dc1->width_internal>>3, - d7=gr.zoomed_dc->height%gr.screen_zoom*d4; - U8 *src,*src2,*dst,*src3,*map=gr.screen_zoom_tables[gr.screen_zoom]; - - src=gr.dc1->body+gr.sx>>3+gr.sy*gr.dc1->width_internal>>3; - dst=gr.zoomed_dc->body; - for (plane=1;plane<0x10;plane<<=1) { - row=d3; - while (row--) { - k=gr.screen_zoom; - while (k--) { - src2=src; - col=d2; - while (col--) { - src3=&map[*src2++]; - l=gr.screen_zoom; - while (l--) { - *dst++=*src3; - src3+=256; - } - } - l=d5; - while (l--) - *dst++=0; - } - src+=d4; - } - l=d7; - while (l--) - *dst++=0; - src+=d6; - } -} - -U0 GrUpdateTextBG() -{ - I64 reg RSI *dst=gr.dc2->body,reg R13 c,row,col, - num_rows=TEXT_ROWS,num_cols=TEXT_COLS,i,j,cur_ch, - reg R12 w1=gr.dc2->width_internal,w2=-7*w1+8,w3=7*w1,w4=0; - U32 *src=gr.text_base; - Bool blink_flag=Blink; - U8 *dst2=dst; - - if (gr.pan_text_x||gr.hide_col) { - gr.pan_text_x=ClampI64(gr.pan_text_x,-7,7); - j=AbsI64(gr.pan_text_x)/FONT_WIDTH+1; - num_cols-=j; - if (gr.pan_text_x<0) { - src+=j; - i=FONT_WIDTH*j+gr.pan_text_x; - } else - i=gr.pan_text_x; - dst2=dst(U8 *)+i; - w4=j; - w3+=j*FONT_WIDTH; - - j*=FONT_WIDTH; - dst(U8 *)=gr.dc2->body; - for (row=num_rows*FONT_HEIGHT;row--;) { - for (col=i;col--;) - *dst(U8 *)++=0; - dst(U8 *)+=w1-i-j; - for (col=j;col--;) - *dst(U8 *)++=0; - } - } - dst=dst2; - - if (gr.pan_text_y||gr.hide_row) { - gr.pan_text_y=ClampI64(gr.pan_text_y,-7,7); - j=AbsI64(gr.pan_text_y)/FONT_HEIGHT+1; - num_rows-=j; - if (gr.pan_text_y<0) { - src+=w1/FONT_WIDTH*j; - i=w1*(FONT_HEIGHT*j+gr.pan_text_y); - } else - i=w1*gr.pan_text_y; - dst2=dst(U8 *)+i; - - j*=w1*FONT_HEIGHT; - dst(U8 *)=gr.dc2->body; - for (row=i;row--;) - *dst(U8 *)++=0; - dst(U8 *)=gr.dc2->body+TEXT_ROWS*TEXT_COLS*FONT_HEIGHT*FONT_WIDTH-j; - for (row=j;row--;) - *dst(U8 *)++=0; - } - dst=dst2; - - for (row=num_rows;row--;) { - for (col=num_cols;col--;) { - cur_ch=*src++; - if (cur_ch & (ATTRF_SEL|ATTRF_INVERT|ATTRF_BLINK)) { - if (cur_ch & ATTRF_SEL) - cur_ch.u8[1]=cur_ch.u8[1]^0xFF; - if (cur_ch & ATTRF_INVERT) - cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4; - if (cur_ch & ATTRF_BLINK && blink_flag) - cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4; - } - c=gr.to_8_colors[cur_ch.u8[1]>>4]; - MOV U64 [RSI],R13 - ADD RSI,R12 - MOV U64 [RSI],R13 - ADD RSI,R12 - MOV U64 [RSI],R13 - ADD RSI,R12 - MOV U64 [RSI],R13 - ADD RSI,R12 - MOV U64 [RSI],R13 - ADD RSI,R12 - MOV U64 [RSI],R13 - ADD RSI,R12 - MOV U64 [RSI],R13 - ADD RSI,R12 - MOV U64 [RSI],R13 - dst(U8 *)+=w2; - } - src+=w4; - dst(U8 *)+=w3; - } -} - -U0 GrUpdateTextFG() -{//See $LK,"TextBase Layer",A="HI:TextBase Layer"$. - U32 *src=gr.text_base; - I64 i,j,cur_ch,*dst=gr.dc2->body, - w1=gr.dc2->width_internal,w2=7*w1,w4=0, - num_rows=TEXT_ROWS,num_cols=TEXT_COLS,row,col; - U8 *dst_start=gr.dc2->body,*dst_end=dst_start+w1*gr.dc2->height-7*w1-8; - Bool blink_flag=Blink; - - if (gr.pan_text_x||gr.hide_col) { - gr.pan_text_x=ClampI64(gr.pan_text_x,-7,7); - j=AbsI64(gr.pan_text_x)/FONT_WIDTH+1; - num_cols-=j; - if (gr.pan_text_x<0) { - src+=j; - dst(U8 *)+=FONT_WIDTH*j; - } - w4=j; - w2+=j*FONT_WIDTH; - } - - if (gr.pan_text_y||gr.hide_row) { - gr.pan_text_y=ClampI64(gr.pan_text_y,-7,7); - j=AbsI64(gr.pan_text_y)/FONT_HEIGHT+1; - num_rows-=j; - if (gr.pan_text_y<0) { - src+=w1/FONT_WIDTH*j; - dst(U8 *)+=w1*FONT_HEIGHT*j; - } - } - - for (row=num_rows;row--;) { - for (col=num_cols;col--;) { - cur_ch=*src++; - if (cur_ch & (ATTRF_UNDERLINE|ATTRF_SEL|ATTRF_INVERT|ATTRF_BLINK)) { - if (cur_ch & ATTRF_SEL) - cur_ch.u8[1]=cur_ch.u8[1]^0xFF; - if (cur_ch & ATTRF_INVERT) - cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4; - if (cur_ch & ATTRF_BLINK && blink_flag) - cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4; - } - if (i=cur_ch.u16[1]&0x3FF+gr.pan_text_x+gr.pan_text_y<<5) { - j=i&0x1F; - if (j&0x10) j|=~0x1F; - i>>=5; - if (i&0x10) i|=~0x1F; - i=w1*i+j; - if (dst_start<=dst(U8 *)+ibody,*b0=dc->body; - I64 j,k,d0=img->width_internal*img->height; - for (k=0;k>4; - if (cur_ch & ATTRF_BLINK) - if (blink_flag) - cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4; - *dst++=*dst2++=cur_ch&0x7FFF; - } - } else { - while (i--) { - cur_ch=*src++; - if (cur_ch & ATTRF_SEL) - cur_ch.u8[1]=cur_ch.u8[1]^0xFF; - if (cur_ch & ATTRF_INVERT) - cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4; - if (cur_ch & ATTRF_BLINK) - if (blink_flag) - cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4; - cur_ch&=0x7FFF; - if (*dst2!=cur_ch) - *dst++=*dst2++=cur_ch; - else { - dst++; - dst2++; - } - } - } -} - -U0 GrUpdateVGAGraphics() -{//Update Graphic Card - I64 row,plane,d=gr.zoomed_dc->width_internal>>6; - U32 *src,*vga,*dst; - if (gr.screen_zoom==1) - src=gr.dc1->body; - else { - GrZoomInScreen; - src=gr.zoomed_dc->body; - } - dst=gr.screen_image->body; - if (LBtr(&sys_semas[SYS_SEMA_FLUSH_VGA_IMAGE],0)) { - for (plane=1;plane<0x10;plane<<=1) { - OutU8(VGAP_IDX,VGAR_MAP_MASK); - OutU8(VGAP_DATA,plane); - vga=text.vga_alias; - row=gr.zoomed_dc->height; - while (row--) - GrUpdateLine64FlushCache(&vga,&src,d,&dst); - } - } else { - for (plane=1;plane<0x10;plane<<=1) { - OutU8(VGAP_IDX,VGAR_MAP_MASK); - OutU8(VGAP_DATA,plane); - vga=text.vga_alias; - row=gr.zoomed_dc->height; - while (row--) - GrUpdateLine64(&vga,&src,d,&dst); - } - } -} - -U0 GrUpdateScreen() -{//Called by the Window Manager $LK,"HERE",A="FF:::/Adam/WinB.CPP,GrUpdateScreen"$, 30 times a second. - CDC *dc; - if (!Bt(&sys_run_level,RLf_VGA)) //if text mode - GrUpdateTasks; - else { - GrUpdateTextBG; - GrUpdateTextFG; - GrUpdateTasks; - DCBlotColor8(gr.dc2,gr.dc); - } - - dc=DCAlias(gr.dc2,Fs); - dc->flags|=DCF_ON_TOP; - if (gr.fp_final_screen_update) - (*gr.fp_final_screen_update)(dc); - DCDel(dc); - - if (!Bt(&sys_run_level,RLf_VGA)) //if text mode - GrUpdateTextModeText; - else { - DCBlotColor4(gr.dc1->body,gr.dc2->body,gr.dc_cache->body, - gr.dc2->height*gr.dc2->width_internal>>3); - GrUpdateVGAGraphics; - } -} diff --git a/Adam/Gr/GrScreen.HC b/Adam/Gr/GrScreen.HC new file mode 100644 index 0000000..d29e112 --- /dev/null +++ b/Adam/Gr/GrScreen.HC @@ -0,0 +1,423 @@ +#help_index "Graphics/Screen" + +U0 GrUpdateTaskODEs(CTask *task) +{ + sys_task_being_screen_updated=task; + try + ODEsUpdate(task); + catch { + LBts(&task->win_inhibit,WIf_SELF_ODE); + "Exception in WinMgr: Update Task ODEs\n"; + PutExcept; + Sleep(3000); + VGAFlush; + } + sys_task_being_screen_updated=NULL; +} + +U0 GrUpdateTaskWin(CTask *task) +{ //Draw a win. Only core0 tasks have a win. + CDC *dc; + CD3I64 saved_scroll; + sys_task_being_screen_updated=task; + try { + if (!Bt(&task->display_flags,DISPLAYf_NO_BORDER)) + TextBorder(Fs,task->win_left,task->win_right,task->win_top, + task->win_bottom,task->border_attr,task==sys_focus_task); + TextRect(task->win_left,task->win_right, + task->win_top,task->win_bottom,task->text_attr<<8); + if (task==sys_winmgr_task) { + if (gr.fp_wall_paper) + (*gr.fp_wall_paper)(task); + } else if (!(task->win_inhibit&WIF_SELF_DOC)) + DocUpdateTaskDocs(task); + if (TaskValidate(task)) { + if (task->draw_it) { + dc=DCAlias(gr.dc2,task); + (*task->draw_it)(task,dc); + DCDel(dc); + } + if (TaskValidate(task)) { + WinScrollNull(task,&saved_scroll); + DrawCtrls(task); + WinScrollRestore(task,&saved_scroll); + } + } + } catch { + if (task!=Fs && TaskValidate(task)) { + LBtr(&task->display_flags,DISPLAYf_SHOW); + "Exception in WinMgr: Update Task Win\n"; + PutExcept; + Sleep(3000); + VGAFlush; + } + } + sys_task_being_screen_updated=NULL; +} + +U0 GrUpdateTasks() +{//Only called by WinMgr + I64 i; + CTask *task,*task1; + try { + winmgr.ode_time=0; + if (Bt(&sys_semas[SYS_SEMA_UPDATE_WIN_Z_BUF],0)) + WinZBufUpdate; + task1=task=sys_winmgr_task; + do { //Loop through core0 tasks. + if (!TaskValidate(task)) break; + if (Bt(&task->display_flags,DISPLAYf_SHOW) && + Bt(gr.win_uncovered_bitmap,task->win_z_num)) + GrUpdateTaskWin(task); + if (!TaskValidate(task)) break; + task=task->next_task; + } while (task!=task1); + + for (i=0;inext_task; + } while (task!=task1); + } + } catch { + PutExcept(FALSE); + Dbg("Exception in WinMgr"); + } + winmgr.last_ode_time=winmgr.ode_time; + ode_alloced_factor=LowPass1(0.1,ode_alloced_factor, + Clamp(Gs->idle_factor-0.1,0.2,0.8),1/winmgr.fps); + sys_task_being_screen_updated=NULL; +} + +U0 GrFixZoomScale() +{ + gr.screen_zoom=ClampI64(gr.screen_zoom,1,GR_MAX_SCREEN_ZOOM); + if (gr.screen_zoom==1) { + gr.sx=0; + gr.sy=0; + } else { + gr.sx=ClampI64(gr.sx,0,GR_WIDTH-GR_WIDTH/gr.screen_zoom)&~7; + gr.sy=ClampI64(gr.sy,0,GR_HEIGHT-GR_HEIGHT/gr.screen_zoom); + } +} + +public U0 GrScaleZoom(F64 scale) +{//Multiply zoom factor larger or smaller. + F64 s=gr.screen_zoom; + gr.screen_zoom=gr.screen_zoom*scale; + GrFixZoomScale; + s/=gr.screen_zoom; + ip.scale.x*=s; + ip.scale.y*=s; + ip.scale.z*=s; + ip.offset.x=ip.pos.x-(ip.pos.x-ip.offset.x)*s; + ip.offset.y=ip.pos.y-(ip.pos.y-ip.offset.y)*s; + ip.offset.z=ip.pos.z-(ip.pos.z-ip.offset.z)*s; + gr.sx=ip.pos.x-gr.zoomed_dc->width >>1/gr.screen_zoom; + gr.sy=ip.pos.y-gr.zoomed_dc->height>>1/gr.screen_zoom; + GrFixZoomScale; +} + +U0 GrZoomInScreen() +{ + GrFixZoomScale; + I64 plane,row,col,k,l, + d2=gr.zoomed_dc->width>>3/gr.screen_zoom, + d4=gr.zoomed_dc->width_internal>>3, + d5=d4-d2*gr.screen_zoom, + d3=gr.zoomed_dc->height/gr.screen_zoom, + d6=(gr.zoomed_dc->height-d3)*gr.dc1->width_internal>>3, + d7=gr.zoomed_dc->height%gr.screen_zoom*d4; + U8 *src,*src2,*dst,*src3,*map=gr.screen_zoom_tables[gr.screen_zoom]; + + src=gr.dc1->body+gr.sx>>3+gr.sy*gr.dc1->width_internal>>3; + dst=gr.zoomed_dc->body; + for (plane=1;plane<0x10;plane<<=1) { + row=d3; + while (row--) { + k=gr.screen_zoom; + while (k--) { + src2=src; + col=d2; + while (col--) { + src3=&map[*src2++]; + l=gr.screen_zoom; + while (l--) { + *dst++=*src3; + src3+=256; + } + } + l=d5; + while (l--) + *dst++=0; + } + src+=d4; + } + l=d7; + while (l--) + *dst++=0; + src+=d6; + } +} + +U0 GrUpdateTextBG() +{ + I64 reg RSI *dst=gr.dc2->body,reg R13 c,row,col, + num_rows=TEXT_ROWS,num_cols=TEXT_COLS,i,j,cur_ch, + reg R12 w1=gr.dc2->width_internal,w2=-7*w1+8,w3=7*w1,w4=0; + U32 *src=gr.text_base; + Bool blink_flag=Blink; + U8 *dst2=dst; + + if (gr.pan_text_x||gr.hide_col) { + gr.pan_text_x=ClampI64(gr.pan_text_x,-7,7); + j=AbsI64(gr.pan_text_x)/FONT_WIDTH+1; + num_cols-=j; + if (gr.pan_text_x<0) { + src+=j; + i=FONT_WIDTH*j+gr.pan_text_x; + } else + i=gr.pan_text_x; + dst2=dst(U8 *)+i; + w4=j; + w3+=j*FONT_WIDTH; + + j*=FONT_WIDTH; + dst(U8 *)=gr.dc2->body; + for (row=num_rows*FONT_HEIGHT;row--;) { + for (col=i;col--;) + *dst(U8 *)++=0; + dst(U8 *)+=w1-i-j; + for (col=j;col--;) + *dst(U8 *)++=0; + } + } + dst=dst2; + + if (gr.pan_text_y||gr.hide_row) { + gr.pan_text_y=ClampI64(gr.pan_text_y,-7,7); + j=AbsI64(gr.pan_text_y)/FONT_HEIGHT+1; + num_rows-=j; + if (gr.pan_text_y<0) { + src+=w1/FONT_WIDTH*j; + i=w1*(FONT_HEIGHT*j+gr.pan_text_y); + } else + i=w1*gr.pan_text_y; + dst2=dst(U8 *)+i; + + j*=w1*FONT_HEIGHT; + dst(U8 *)=gr.dc2->body; + for (row=i;row--;) + *dst(U8 *)++=0; + dst(U8 *)=gr.dc2->body+TEXT_ROWS*TEXT_COLS*FONT_HEIGHT*FONT_WIDTH-j; + for (row=j;row--;) + *dst(U8 *)++=0; + } + dst=dst2; + + for (row=num_rows;row--;) { + for (col=num_cols;col--;) { + cur_ch=*src++; + if (cur_ch & (ATTRF_SEL|ATTRF_INVERT|ATTRF_BLINK)) { + if (cur_ch & ATTRF_SEL) + cur_ch.u8[1]=cur_ch.u8[1]^0xFF; + if (cur_ch & ATTRF_INVERT) + cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4; + if (cur_ch & ATTRF_BLINK && blink_flag) + cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4; + } + c=gr.to_8_colors[cur_ch.u8[1]>>4]; + MOV U64 [RSI],R13 + ADD RSI,R12 + MOV U64 [RSI],R13 + ADD RSI,R12 + MOV U64 [RSI],R13 + ADD RSI,R12 + MOV U64 [RSI],R13 + ADD RSI,R12 + MOV U64 [RSI],R13 + ADD RSI,R12 + MOV U64 [RSI],R13 + ADD RSI,R12 + MOV U64 [RSI],R13 + ADD RSI,R12 + MOV U64 [RSI],R13 + dst(U8 *)+=w2; + } + src+=w4; + dst(U8 *)+=w3; + } +} + +U0 GrUpdateTextFG() +{//See $LK,"TextBase Layer",A="HI:TextBase Layer"$. + U32 *src=gr.text_base; + I64 i,j,cur_ch,*dst=gr.dc2->body, + w1=gr.dc2->width_internal,w2=7*w1,w4=0, + num_rows=TEXT_ROWS,num_cols=TEXT_COLS,row,col; + U8 *dst_start=gr.dc2->body,*dst_end=dst_start+w1*gr.dc2->height-7*w1-8; + Bool blink_flag=Blink; + + if (gr.pan_text_x||gr.hide_col) { + gr.pan_text_x=ClampI64(gr.pan_text_x,-7,7); + j=AbsI64(gr.pan_text_x)/FONT_WIDTH+1; + num_cols-=j; + if (gr.pan_text_x<0) { + src+=j; + dst(U8 *)+=FONT_WIDTH*j; + } + w4=j; + w2+=j*FONT_WIDTH; + } + + if (gr.pan_text_y||gr.hide_row) { + gr.pan_text_y=ClampI64(gr.pan_text_y,-7,7); + j=AbsI64(gr.pan_text_y)/FONT_HEIGHT+1; + num_rows-=j; + if (gr.pan_text_y<0) { + src+=w1/FONT_WIDTH*j; + dst(U8 *)+=w1*FONT_HEIGHT*j; + } + } + + for (row=num_rows;row--;) { + for (col=num_cols;col--;) { + cur_ch=*src++; + if (cur_ch & (ATTRF_UNDERLINE|ATTRF_SEL|ATTRF_INVERT|ATTRF_BLINK)) { + if (cur_ch & ATTRF_SEL) + cur_ch.u8[1]=cur_ch.u8[1]^0xFF; + if (cur_ch & ATTRF_INVERT) + cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4; + if (cur_ch & ATTRF_BLINK && blink_flag) + cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4; + } + if (i=cur_ch.u16[1]&0x3FF+gr.pan_text_x+gr.pan_text_y<<5) { + j=i&0x1F; + if (j&0x10) j|=~0x1F; + i>>=5; + if (i&0x10) i|=~0x1F; + i=w1*i+j; + if (dst_start<=dst(U8 *)+ibody,*b0=dc->body; + I64 j,k,d0=img->width_internal*img->height; + for (k=0;k>4; + if (cur_ch & ATTRF_BLINK) + if (blink_flag) + cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4; + *dst++=*dst2++=cur_ch&0x7FFF; + } + } else { + while (i--) { + cur_ch=*src++; + if (cur_ch & ATTRF_SEL) + cur_ch.u8[1]=cur_ch.u8[1]^0xFF; + if (cur_ch & ATTRF_INVERT) + cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4; + if (cur_ch & ATTRF_BLINK) + if (blink_flag) + cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4; + cur_ch&=0x7FFF; + if (*dst2!=cur_ch) + *dst++=*dst2++=cur_ch; + else { + dst++; + dst2++; + } + } + } +} + +U0 GrUpdateVGAGraphics() +{//Update Graphic Card + I64 row,plane,d=gr.zoomed_dc->width_internal>>6; + U32 *src,*vga,*dst; + if (gr.screen_zoom==1) + src=gr.dc1->body; + else { + GrZoomInScreen; + src=gr.zoomed_dc->body; + } + dst=gr.screen_image->body; + if (LBtr(&sys_semas[SYS_SEMA_FLUSH_VGA_IMAGE],0)) { + for (plane=1;plane<0x10;plane<<=1) { + OutU8(VGAP_IDX,VGAR_MAP_MASK); + OutU8(VGAP_DATA,plane); + vga=text.vga_alias; + row=gr.zoomed_dc->height; + while (row--) + GrUpdateLine64FlushCache(&vga,&src,d,&dst); + } + } else { + for (plane=1;plane<0x10;plane<<=1) { + OutU8(VGAP_IDX,VGAR_MAP_MASK); + OutU8(VGAP_DATA,plane); + vga=text.vga_alias; + row=gr.zoomed_dc->height; + while (row--) + GrUpdateLine64(&vga,&src,d,&dst); + } + } +} + +U0 GrUpdateScreen() +{//Called by the Window Manager $LK,"HERE",A="FF:::/Adam/WinB.HC,GrUpdateScreen"$, 30 times a second. + CDC *dc; + if (!Bt(&sys_run_level,RLf_VGA)) //if text mode + GrUpdateTasks; + else { + GrUpdateTextBG; + GrUpdateTextFG; + GrUpdateTasks; + DCBlotColor8(gr.dc2,gr.dc); + } + + dc=DCAlias(gr.dc2,Fs); + dc->flags|=DCF_ON_TOP; + if (gr.fp_final_screen_update) + (*gr.fp_final_screen_update)(dc); + DCDel(dc); + + if (!Bt(&sys_run_level,RLf_VGA)) //if text mode + GrUpdateTextModeText; + else { + DCBlotColor4(gr.dc1->body,gr.dc2->body,gr.dc_cache->body, + gr.dc2->height*gr.dc2->width_internal>>3); + GrUpdateVGAGraphics; + } +} diff --git a/Adam/Gr/GrSpritePlot.CPP b/Adam/Gr/GrSpritePlot.CPP deleted file mode 100644 index 0c936c2..0000000 --- a/Adam/Gr/GrSpritePlot.CPP +++ /dev/null @@ -1,481 +0,0 @@ -#help_index "Graphics/Sprite;Sprites" -/* -$LK,"CSprite",A="MN:CSprite"$s are stored as a sequence of var -length operations with a 1-byte $LK,"type",A="MN:SPT_PT"$ leading -each operation. They are stored, one after another, -in a chunk of memory terminated by a $LK,"zero",A="MN:SPT_END"$. -$LK,"Sprite3",A="MN:Sprite3"$() shows how the $LK,"CSprite",A="MN:CSprite"$ unions are used. - -$LK,"SpriteElemSize",A="MN:SpriteElemSize"$() will return the size of a single -element, while $LK,"SpriteSize",A="MN:SpriteSize"$() will return the size -of an entire list. Look at $LK,"sprite_elem_base_sizes",A="MN:sprite_elem_base_sizes"$. - -See $MA-X+PU,"::/Apps/GrModels",LM="Cd(\"::/Apps/GrModels\");Dir;View;\n"$ for an example of -making CSprite by hand. It uses $LK,"SPT_MESH",A="MN:SPT_MESH"$, -one of the most complicated. -*/ - -public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems, - Bool just_one_elem=FALSE) -{//Plot a sprite into a CDC. - CSprite *tempg=elems-offset(CSprite.start); - I64 i,j,k,x1,y1,z1,x2,y2, - cur_sprite_elem_num=0,*old_r,*r2, - old_flags=dc->flags, - old_pen_width=dc->pen_width; - I32 *ptr; - CColorROPU32 old_color=dc->color; - CDC *img; - CD3I32 *p,*p2; - CGrSym old_sym; - MemCpy(&old_sym,&dc->sym,sizeof(CGrSym)); - if (dc->flags & DCF_LOCATE_NEAREST) { - dc->nearest_sprite_elem_num=0; - dc->nearest_dist=MAX_I64; - } - while (tempg->type) { - dc->cur_sprite_elem_num=cur_sprite_elem_num; - switch (tempg->type) { - case SPT_COLOR: - dc->color=dc->color&~(COLORROP_COLORS_MASK|ROPF_DITHER)|tempg->c.color; - break; - case SPT_DITHER_COLOR: - dc->color=dc->color&~COLORROP_COLORS_MASK| - tempg->d.dither_color.u8[0]| - tempg->d.dither_color.u8[1]<pen_width=tempg->w.width; - DCPenWidthScale(dc); - break; - case SPT_TRANSFORM_ON: - if (!(dc->flags&DCF_TRANSFORMATION)) { - x-=dc->x; - y-=dc->y; - z-=dc->z; - } - dc->flags|=DCF_TRANSFORMATION; - break; - case SPT_TRANSFORM_OFF: - if (dc->flags&DCF_TRANSFORMATION) { - x+=dc->x; - y+=dc->y; - z+=dc->z; - } - dc->flags&=~DCF_TRANSFORMATION; - break; - case SPT_PT: - GrPlot3(dc,tempg->p.x1+x,tempg->p.y1+y,z); - break; - case SPT_TEXT: - GrPrint3(dc,tempg->ps.x1+x,tempg->ps.y1+y,z,"%s",tempg->ps.st); - break; - case SPT_TEXT_BOX: - GrTextBox3(dc,tempg->ps.x1+x,tempg->ps.y1+y,z,tempg->ps.st); - break; - case SPT_TEXT_DIAMOND: - GrTextDiamond3(dc,tempg->ps.x1+x,tempg->ps.y1+y,z,tempg->ps.st); - break; - case SPT_FLOOD_FILL: - GrFloodFill3(dc,tempg->p.x1+x,tempg->p.y1+y,z,FALSE); - break; - case SPT_FLOOD_FILL_NOT: - i=dc->color; - dc->color=dc->color.c0; - GrFloodFill3(dc,tempg->p.x1+x,tempg->p.y1+y,z,TRUE); - dc->color=i; - break; - case SPT_SHIFT: - x+=tempg->p.x1; - y+=tempg->p.y1; - break; - case SPT_LINE: - GrLine3(dc,tempg->pp.x1+x,tempg->pp.y1+y,z, - tempg->pp.x2+x,tempg->pp.y2+y,z); - break; - case SPT_ARROW: - GrArrow3(dc,tempg->pp.x1+x,tempg->pp.y1+y,z, - tempg->pp.x2+x,tempg->pp.y2+y,z); - break; - case SPT_PLANAR_SYMMETRY: - if (DCSymmetry3Set(dc,tempg->pp.x1+x,tempg->pp.y1+y,z, - tempg->pp.x2+x,tempg->pp.y2+y,z, - tempg->pp.x2+x,tempg->pp.y2+y,z+1)) - dc->flags|=DCF_SYMMETRY; - else - dc->flags&=~DCF_SYMMETRY; - break; - case SPT_BITMAP: - img=CAlloc(sizeof(CDC)); - img->width=tempg->pwhu.width; - img->width_internal=(tempg->pwhu.width+7)&~7; - img->height=tempg->pwhu.height; - img->body=&tempg->pwhu.u; - img->dc_signature=DCS_SIGNATURE_VAL; - GrBlot3(dc,tempg->pwhu.x1+x,tempg->pwhu.y1+y,z,img); - Free(img); - break; - case SPT_RECT: - GrRect3(dc,tempg->pp.x1+x,tempg->pp.y1+y,z, - tempg->pp.x2-tempg->pp.x1,tempg->pp.y2-tempg->pp.y1); - break; - case SPT_ROTATED_RECT: - x1=tempg->ppa.x1+x; - y1=tempg->ppa.y1+y; - z1=z; - Mat4x4MulXYZ(dc->r,&x1,&y1,&z1); - old_r=dc->r; - dc->flags|=DCF_TRANSFORMATION; - r2=Mat4x4IdentNew; - Mat4x4RotZ(r2,-tempg->ppa.angle); - Mat4x4TranslationEqu(r2,x1,y1,z1); - DCMat4x4Set(dc,Mat4x4MulMat4x4New(old_r,r2)); - GrRect3(dc,0,0,0, - tempg->ppa.x2-tempg->ppa.x1,tempg->ppa.y2-tempg->ppa.y1); - Free(dc->r); - Free(r2); - DCMat4x4Set(dc,old_r); - dc->flags=dc->flags&~DCF_TRANSFORMATION|old_flags; - break; - case SPT_CIRCLE: - GrCircle3(dc,tempg->pr.x1+x,tempg->pr.y1+y,z,tempg->pr.radius); - break; - case SPT_ELLIPSE: - GrEllipse3(dc,tempg->pwha.x1+x,tempg->pwha.y1+y,z,tempg->pwha.width, - tempg->pwha.height,tempg->pwha.angle); - break; - case SPT_POLYGON: - GrRegPoly3(dc,tempg->pwhas.x1+x,tempg->pwhas.y1+y,z,tempg->pwhas.width, - tempg->pwhas.height,tempg->pwhas.sides,tempg->pwhas.angle); - break; - case SPT_POLYLINE: - ptr=&tempg->nu.u; - x1=ptr[0]; - y1=ptr[1]; - for (i=1;inu.num;i++) { - x2=ptr[i<<1]; - y2=ptr[i<<1+1]; - GrLine3(dc,x1+x,y1+y,z,x2+x,y2+y,z); - x1=x2;y1=y2; - } - break; - case SPT_POLYPT: - x1=tempg->npu.x; - y1=tempg->npu.y; - ptr=&tempg->npu.u; - k=tempg->npu.num*3; - GrPlot3(dc,x1+x,y1+y,z); - for (i=0;inu.num*sizeof(CD3I32)); - MemCpy(p,&tempg->nu.u,tempg->nu.num*sizeof(CD3I32)); - for (i=0;inu.num;i++,p2++) { - p2->x+=x; - p2->y+=y; - p2->z+=z; - } - case SPT_BSPLINE2: - Gr2BSpline3(dc,p,tempg->nu.num,FALSE); - break; - case SPT_BSPLINE3: - Gr3BSpline3(dc,p,tempg->nu.num,FALSE); - break; - case SPT_BSPLINE2_CLOSED: - Gr2BSpline3(dc,p,tempg->nu.num,TRUE); - break; - case SPT_BSPLINE3_CLOSED: - Gr3BSpline3(dc,p,tempg->nu.num,TRUE); - break; - end: - Free(p); - break; - case SPT_MESH: - p2=p=MAlloc(tempg->mu.vertex_cnt*sizeof(CD3I32)); - MemCpy(p,&tempg->mu.u,tempg->mu.vertex_cnt*sizeof(CD3I32)); - for (i=0;imu.vertex_cnt;i++,p2++) { - p2->x+=x; - p2->y+=y; - p2->z+=z; - } - Gr3Mesh(dc,tempg->mu.vertex_cnt,p,tempg->mu.tri_cnt, - (&tempg->mu.u)(U8 *)+sizeof(CD3I32)*tempg->mu.vertex_cnt); - Free(p); - break; - case SPT_SHIFTABLE_MESH: - if (dc->flags&DCF_TRANSFORMATION) { - dc->x+=tempg->pmu.x; - dc->y+=tempg->pmu.y; - dc->z+=tempg->pmu.z; - x1=x; - y1=y; - z1=z; - } else { - x1=tempg->pmu.x+x; - y1=tempg->pmu.y+y; - z1=tempg->pmu.z+z; - } - p2=p=MAlloc(tempg->pmu.vertex_cnt*sizeof(CD3I32)); - MemCpy(p,&tempg->pmu.u,tempg->pmu.vertex_cnt*sizeof(CD3I32)); - for (i=0;ipmu.vertex_cnt;i++,p2++) { - p2->x+=x1; - p2->y+=y1; - p2->z+=z1; - } - Gr3Mesh(dc,tempg->pmu.vertex_cnt,p,tempg->pmu.tri_cnt, - (&tempg->pmu.u)(U8 *)+sizeof(CD3I32)*tempg->pmu.vertex_cnt); - Free(p); - if (dc->flags&DCF_TRANSFORMATION) { - dc->x-=tempg->pmu.x; - dc->y-=tempg->pmu.y; - dc->z-=tempg->pmu.z; - } - break; - } - cur_sprite_elem_num++; - if (just_one_elem) break; - tempg(U8 *)+=SpriteElemSize(tempg); - } - MemCpy(&dc->sym,&old_sym,sizeof(CGrSym)); - dc->color=old_color; - dc->pen_width=old_pen_width; - dc->flags=dc->flags&~(DCF_SYMMETRY|DCF_TRANSFORMATION) | - old_flags&(DCF_SYMMETRY|DCF_TRANSFORMATION); -} - -public U0 Sprite3B(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems) -{//Plot a sprite into a CDC, post transform xyz translation. - I64 old_x=dc->x,old_y=dc->y,old_z=dc->z, - old_flags=dc->flags&DCF_TRANSFORMATION; - dc->x=x; dc->y=y; dc->z=z; - dc->flags|=DCF_TRANSFORMATION; - Sprite3(dc,0,0,0,elems); - dc->x=old_x; dc->y=old_y; dc->z=old_z; - dc->flags=dc->flags&~DCF_TRANSFORMATION|old_flags; -} - -public U0 SpriteMat3B(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,I64 *m) -{//Plot rotated by matrix. - I64 r[16],*old_r=dc->r,new_m[16], - old_flags=dc->flags&DCF_TRANSFORMATION; - MemCpy(new_m,m,16*sizeof(I64)); - dc->flags|=DCF_TRANSFORMATION; - Mat4x4TranslationAdd(new_m,x,y,z); - dc->r=Mat4x4MulMat4x4Equ(r,old_r,new_m); - Sprite3(dc,0,0,0,elems); - dc->r=old_r; - dc->flags=dc->flags&~DCF_TRANSFORMATION|old_flags; -} - -public U0 SpriteX3B(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,F64 è=0) -{//Plot rotated around X axis. - I64 r[16]; - Mat4x4IdentEqu(r); - Mat4x4RotX(r,è); - SpriteMat3B(dc,x,y,z,elems,r); -} - -public U0 SpriteY3B(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,F64 ê=0) -{//Plot rotated around Y axis. - I64 r[16]; - Mat4x4IdentEqu(r); - Mat4x4RotY(r,ê); - SpriteMat3B(dc,x,y,z,elems,r); -} - -public U0 SpriteZ3B(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,F64 é=0) -{//Plot rotated around Z axis. - I64 r[16]; - Mat4x4IdentEqu(r); - Mat4x4RotZ(r,é); - SpriteMat3B(dc,x,y,z,elems,r); -} - -public U0 SpriteExtents(U8 *elems,I64 *min_x=NULL,I64 *max_x=NULL, - I64 *min_y=NULL,I64 *max_y=NULL) -{//Ignores flood fills. - CDC *dc=DCNew(MAX_I32,MAX_I32,Fs,TRUE); - DCExtentsInit(dc); - Sprite3(dc,MAX_I32/2,MAX_I32/2,MAX_I32/2,elems); - if (dc->min_x<=dc->max_x) { - dc->min_x-=MAX_I32/2; - dc->max_x-=MAX_I32/2; - } - if (dc->min_y<=dc->max_y) { - dc->min_y-=MAX_I32/2; - dc->max_y-=MAX_I32/2; - } - if (min_x) *min_x=dc->min_x; - if (max_x) *max_x=dc->max_x; - if (min_y) *min_y=dc->min_y; - if (max_y) *max_y=dc->max_y; - DCDel(dc); -} - -public CDC *Sprite2DC(U8 *elems) -{//Convert sprite to device context. - CDC *res; - I64 min_x,max_x,min_y,max_y; - SpriteExtents(elems,&min_x,&max_x,&min_y,&max_y); - res=DCNew(max_x-min_x+1,max_y-min_y+1); - Sprite3(res,-min_x,-min_y,0,elems); - return res; -} - -public U8 *SpriteInterpolate(F64 t,U8 *elems0,U8 *elems1) -{//The two CSprite should be ident except for points shifted around. -//t ranges from 0.0 to 1.0. - I64 i,t1=GR_SCALE*t,t0=GR_SCALE-t1; - I32 *ptr0,*ptr1,*ptrr; - CD3I32 *p0,*p1,*pr; - U8 *res; - CSprite *tempg0=elems0-offset(CSprite.start), - *tempg1=elems1-offset(CSprite.start),*tempgr; - if (t<0.5) { - i=SpriteSize(elems0), - res=MAlloc(i); - MemCpy(res,elems0,i); - } else { - i=SpriteSize(elems1), - res=MAlloc(i); - MemCpy(res,elems1,i); - } - tempgr=res-offset(CSprite.start); - while (tempg0->type) { - if (tempg0->type!=tempg1->type) - throw('Graphics'); - switch (tempg0->type) { - case SPT_ROTATED_RECT: - tempgr->ppa.angle=(tempg0->ppa.angle*t0+tempg1->ppa.angle*t1)/GR_SCALE; - case SPT_RECT: - case SPT_LINE: - case SPT_ARROW: - case SPT_PLANAR_SYMMETRY: - tempgr->pp.x2=(tempg0->pp.x2*t0+tempg1->pp.x2*t1)>>32; - tempgr->pp.y2=(tempg0->pp.y2*t0+tempg1->pp.y2*t1)>>32; - case SPT_TEXT: - case SPT_TEXT_BOX: - case SPT_TEXT_DIAMOND: - case SPT_PT: - case SPT_FLOOD_FILL: - case SPT_FLOOD_FILL_NOT: - case SPT_SHIFT: - tempgr->p.x1=(tempg0->p.x1*t0+tempg1->p.x1*t1)>>32; - tempgr->p.y1=(tempg0->p.y1*t0+tempg1->p.y1*t1)>>32; - break; - case SPT_CIRCLE: - tempgr->pr.radius=(tempg0->pr.radius*t0+tempg1->pr.radius*t1)>>32; - tempgr->pr.x1=(tempg0->pr.x1*t0+tempg1->pr.x1*t1)>>32; - tempgr->pr.y1=(tempg0->pr.y1*t0+tempg1->pr.y1*t1)>>32; - break; - case SPT_ELLIPSE: - case SPT_POLYGON: - tempgr->pwha.x1=(tempg0->pwha.x1*t0+tempg1->pwha.x1*t1)>>32; - tempgr->pwha.y1=(tempg0->pwha.y1*t0+tempg1->pwha.y1*t1)>>32; - tempgr->pwha.width =(tempg0->pwha.width *t0+tempg1->pwha.width*t1)>>32; - tempgr->pwha.height=(tempg0->pwha.height*t0+tempg1->pwha.height*t1)>>32; - break; - case SPT_BITMAP: - tempgr->pwhu.x1=(tempg0->pwhu.x1*t0+tempg1->pwhu.x1*t1)>>32; - tempgr->pwhu.y1=(tempg0->pwhu.y1*t0+tempg1->pwhu.y1*t1)>>32; - break; - case SPT_POLYLINE: - ptr0=&tempg0->nu.u; - ptr1=&tempg1->nu.u; - ptrr=&tempgr->nu.u; - for (i=0;inu.num;i++) { - ptrr[i<<1]=(ptr0[i<<1]*t0+ptr1[i<<1]*t1)>>32; - ptrr[i<<1+1]=(ptr0[i<<1+1]*t0+ptr1[i<<1+1]*t1)>>32; - } - break; - case SPT_POLYPT: - tempgr->npu.x=(tempg0->npu.x*t0+tempg1->npu.x*t1)>>32; - tempgr->npu.y=(tempg0->npu.y*t0+tempg1->npu.y*t1)>>32; - break; - case SPT_BSPLINE2: - case SPT_BSPLINE3: - case SPT_BSPLINE2_CLOSED: - case SPT_BSPLINE3_CLOSED: - p0=&tempg0->nu.u; - p1=&tempg1->nu.u; - pr=&tempgr->nu.u; - for (i=0;inu.num;i++) { - pr[i].x=(p0[i].x*t0+p1[i].x*t1)>>32; - pr[i].y=(p0[i].y*t0+p1[i].y*t1)>>32; - pr[i].z=(p0[i].z*t0+p1[i].z*t1)>>32; - } - break; - case SPT_MESH: - p0=&tempg0->mu.u; - p1=&tempg1->mu.u; - pr=&tempgr->mu.u; - for (i=0;imu.vertex_cnt;i++) { - pr[i].x=(p0[i].x*t0+p1[i].x*t1)>>32; - pr[i].y=(p0[i].y*t0+p1[i].y*t1)>>32; - pr[i].z=(p0[i].z*t0+p1[i].z*t1)>>32; - } - break; - case SPT_SHIFTABLE_MESH: - p0=&tempg0->pmu.u; - p1=&tempg1->pmu.u; - pr=&tempgr->pmu.u; - for (i=0;ipmu.vertex_cnt;i++) { - pr[i].x=(p0[i].x*t0+p1[i].x*t1)>>32; - pr[i].y=(p0[i].y*t0+p1[i].y*t1)>>32; - pr[i].z=(p0[i].z*t0+p1[i].z*t1)>>32; - } - break; - } - tempg0(U8 *)+=SpriteElemSize(tempg0); - tempg1(U8 *)+=SpriteElemSize(tempg1); - tempgr(U8 *)+=SpriteElemSize(tempgr); - } - return res; -} - -#help_index "Graphics/Sprite;DolDoc/Output;StdOut/DolDoc" -public CDocEntry *DocSprite(CDoc *doc=NULL,U8 *elems,U8 *fmt=NULL) -{//Put a sprite into a document. You can, optionally, supply a fmt string -//for $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$ cmd with a %d for the bin_num. - I64 size; - U8 *st; - Bool unlock; - CDocEntry *doc_e; - CDocBin *tempb; - if (!doc && !(doc=DocPut)) return NULL; - unlock=DocLock(doc); - size=SpriteSize(elems); - tempb=CAlloc(sizeof(CDocBin),doc->mem_task); - tempb->size=size; - tempb->data=MAlloc(size,doc->mem_task); - MemCpy(tempb->data,elems,size); - tempb->num=doc->cur_bin_num; - tempb->use_cnt=1; - QueIns(tempb,doc->bin_head.last); - if (fmt) - st=MStrPrint(fmt,doc->cur_bin_num++); - else - st=MStrPrint("$$SP,\"\",BI=%d$$",doc->cur_bin_num++); - doc_e=DocPrint(doc,"%s",st); - Free(st); - doc_e->bin_data=tempb; - if (doc_e && doc_e->de_flags&DOCEF_TAG && doc_e->tag && *doc_e->tag) - tempb->tag=StrNew(doc_e->tag,doc->mem_task); - if (unlock) - DocUnlock(doc); - return doc_e; -} - -public CDocEntry *Sprite(U8 *elems,U8 *fmt=NULL) -{//Put sprite to the command-line, $LK,"DocPut",A="MN:DocPut"$. -//If you set fmt, then include dollars ("$$SP ...$$") and leave %d for num. - CDoc *doc; - if (doc=DocPut) - return DocSprite(doc,elems,fmt); - return NULL; -} diff --git a/Adam/Gr/GrSpritePlot.HC b/Adam/Gr/GrSpritePlot.HC new file mode 100644 index 0000000..158476a --- /dev/null +++ b/Adam/Gr/GrSpritePlot.HC @@ -0,0 +1,481 @@ +#help_index "Graphics/Sprite;Sprites" +/* +$LK,"CSprite",A="MN:CSprite"$s are stored as a sequence of var +length operations with a 1-byte $LK,"type",A="MN:SPT_PT"$ leading +each operation. They are stored, one after another, +in a chunk of memory terminated by a $LK,"zero",A="MN:SPT_END"$. +$LK,"Sprite3",A="MN:Sprite3"$() shows how the $LK,"CSprite",A="MN:CSprite"$ unions are used. + +$LK,"SpriteElemSize",A="MN:SpriteElemSize"$() will return the size of a single +element, while $LK,"SpriteSize",A="MN:SpriteSize"$() will return the size +of an entire list. Look at $LK,"sprite_elem_base_sizes",A="MN:sprite_elem_base_sizes"$. + +See $MA-X+PU,"::/Apps/GrModels",LM="Cd(\"::/Apps/GrModels\");Dir;View;\n"$ for an example of +making CSprite by hand. It uses $LK,"SPT_MESH",A="MN:SPT_MESH"$, +one of the most complicated. +*/ + +public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems, + Bool just_one_elem=FALSE) +{//Plot a sprite into a CDC. + CSprite *tempg=elems-offset(CSprite.start); + I64 i,j,k,x1,y1,z1,x2,y2, + cur_sprite_elem_num=0,*old_r,*r2, + old_flags=dc->flags, + old_pen_width=dc->pen_width; + I32 *ptr; + CColorROPU32 old_color=dc->color; + CDC *img; + CD3I32 *p,*p2; + CGrSym old_sym; + MemCpy(&old_sym,&dc->sym,sizeof(CGrSym)); + if (dc->flags & DCF_LOCATE_NEAREST) { + dc->nearest_sprite_elem_num=0; + dc->nearest_dist=MAX_I64; + } + while (tempg->type) { + dc->cur_sprite_elem_num=cur_sprite_elem_num; + switch (tempg->type) { + case SPT_COLOR: + dc->color=dc->color&~(COLORROP_COLORS_MASK|ROPF_DITHER)|tempg->c.color; + break; + case SPT_DITHER_COLOR: + dc->color=dc->color&~COLORROP_COLORS_MASK| + tempg->d.dither_color.u8[0]| + tempg->d.dither_color.u8[1]<pen_width=tempg->w.width; + DCPenWidthScale(dc); + break; + case SPT_TRANSFORM_ON: + if (!(dc->flags&DCF_TRANSFORMATION)) { + x-=dc->x; + y-=dc->y; + z-=dc->z; + } + dc->flags|=DCF_TRANSFORMATION; + break; + case SPT_TRANSFORM_OFF: + if (dc->flags&DCF_TRANSFORMATION) { + x+=dc->x; + y+=dc->y; + z+=dc->z; + } + dc->flags&=~DCF_TRANSFORMATION; + break; + case SPT_PT: + GrPlot3(dc,tempg->p.x1+x,tempg->p.y1+y,z); + break; + case SPT_TEXT: + GrPrint3(dc,tempg->ps.x1+x,tempg->ps.y1+y,z,"%s",tempg->ps.st); + break; + case SPT_TEXT_BOX: + GrTextBox3(dc,tempg->ps.x1+x,tempg->ps.y1+y,z,tempg->ps.st); + break; + case SPT_TEXT_DIAMOND: + GrTextDiamond3(dc,tempg->ps.x1+x,tempg->ps.y1+y,z,tempg->ps.st); + break; + case SPT_FLOOD_FILL: + GrFloodFill3(dc,tempg->p.x1+x,tempg->p.y1+y,z,FALSE); + break; + case SPT_FLOOD_FILL_NOT: + i=dc->color; + dc->color=dc->color.c0; + GrFloodFill3(dc,tempg->p.x1+x,tempg->p.y1+y,z,TRUE); + dc->color=i; + break; + case SPT_SHIFT: + x+=tempg->p.x1; + y+=tempg->p.y1; + break; + case SPT_LINE: + GrLine3(dc,tempg->pp.x1+x,tempg->pp.y1+y,z, + tempg->pp.x2+x,tempg->pp.y2+y,z); + break; + case SPT_ARROW: + GrArrow3(dc,tempg->pp.x1+x,tempg->pp.y1+y,z, + tempg->pp.x2+x,tempg->pp.y2+y,z); + break; + case SPT_PLANAR_SYMMETRY: + if (DCSymmetry3Set(dc,tempg->pp.x1+x,tempg->pp.y1+y,z, + tempg->pp.x2+x,tempg->pp.y2+y,z, + tempg->pp.x2+x,tempg->pp.y2+y,z+1)) + dc->flags|=DCF_SYMMETRY; + else + dc->flags&=~DCF_SYMMETRY; + break; + case SPT_BITMAP: + img=CAlloc(sizeof(CDC)); + img->width=tempg->pwhu.width; + img->width_internal=(tempg->pwhu.width+7)&~7; + img->height=tempg->pwhu.height; + img->body=&tempg->pwhu.u; + img->dc_signature=DCS_SIGNATURE_VAL; + GrBlot3(dc,tempg->pwhu.x1+x,tempg->pwhu.y1+y,z,img); + Free(img); + break; + case SPT_RECT: + GrRect3(dc,tempg->pp.x1+x,tempg->pp.y1+y,z, + tempg->pp.x2-tempg->pp.x1,tempg->pp.y2-tempg->pp.y1); + break; + case SPT_ROTATED_RECT: + x1=tempg->ppa.x1+x; + y1=tempg->ppa.y1+y; + z1=z; + Mat4x4MulXYZ(dc->r,&x1,&y1,&z1); + old_r=dc->r; + dc->flags|=DCF_TRANSFORMATION; + r2=Mat4x4IdentNew; + Mat4x4RotZ(r2,-tempg->ppa.angle); + Mat4x4TranslationEqu(r2,x1,y1,z1); + DCMat4x4Set(dc,Mat4x4MulMat4x4New(old_r,r2)); + GrRect3(dc,0,0,0, + tempg->ppa.x2-tempg->ppa.x1,tempg->ppa.y2-tempg->ppa.y1); + Free(dc->r); + Free(r2); + DCMat4x4Set(dc,old_r); + dc->flags=dc->flags&~DCF_TRANSFORMATION|old_flags; + break; + case SPT_CIRCLE: + GrCircle3(dc,tempg->pr.x1+x,tempg->pr.y1+y,z,tempg->pr.radius); + break; + case SPT_ELLIPSE: + GrEllipse3(dc,tempg->pwha.x1+x,tempg->pwha.y1+y,z,tempg->pwha.width, + tempg->pwha.height,tempg->pwha.angle); + break; + case SPT_POLYGON: + GrRegPoly3(dc,tempg->pwhas.x1+x,tempg->pwhas.y1+y,z,tempg->pwhas.width, + tempg->pwhas.height,tempg->pwhas.sides,tempg->pwhas.angle); + break; + case SPT_POLYLINE: + ptr=&tempg->nu.u; + x1=ptr[0]; + y1=ptr[1]; + for (i=1;inu.num;i++) { + x2=ptr[i<<1]; + y2=ptr[i<<1+1]; + GrLine3(dc,x1+x,y1+y,z,x2+x,y2+y,z); + x1=x2;y1=y2; + } + break; + case SPT_POLYPT: + x1=tempg->npu.x; + y1=tempg->npu.y; + ptr=&tempg->npu.u; + k=tempg->npu.num*3; + GrPlot3(dc,x1+x,y1+y,z); + for (i=0;inu.num*sizeof(CD3I32)); + MemCpy(p,&tempg->nu.u,tempg->nu.num*sizeof(CD3I32)); + for (i=0;inu.num;i++,p2++) { + p2->x+=x; + p2->y+=y; + p2->z+=z; + } + case SPT_BSPLINE2: + Gr2BSpline3(dc,p,tempg->nu.num,FALSE); + break; + case SPT_BSPLINE3: + Gr3BSpline3(dc,p,tempg->nu.num,FALSE); + break; + case SPT_BSPLINE2_CLOSED: + Gr2BSpline3(dc,p,tempg->nu.num,TRUE); + break; + case SPT_BSPLINE3_CLOSED: + Gr3BSpline3(dc,p,tempg->nu.num,TRUE); + break; + end: + Free(p); + break; + case SPT_MESH: + p2=p=MAlloc(tempg->mu.vertex_cnt*sizeof(CD3I32)); + MemCpy(p,&tempg->mu.u,tempg->mu.vertex_cnt*sizeof(CD3I32)); + for (i=0;imu.vertex_cnt;i++,p2++) { + p2->x+=x; + p2->y+=y; + p2->z+=z; + } + Gr3Mesh(dc,tempg->mu.vertex_cnt,p,tempg->mu.tri_cnt, + (&tempg->mu.u)(U8 *)+sizeof(CD3I32)*tempg->mu.vertex_cnt); + Free(p); + break; + case SPT_SHIFTABLE_MESH: + if (dc->flags&DCF_TRANSFORMATION) { + dc->x+=tempg->pmu.x; + dc->y+=tempg->pmu.y; + dc->z+=tempg->pmu.z; + x1=x; + y1=y; + z1=z; + } else { + x1=tempg->pmu.x+x; + y1=tempg->pmu.y+y; + z1=tempg->pmu.z+z; + } + p2=p=MAlloc(tempg->pmu.vertex_cnt*sizeof(CD3I32)); + MemCpy(p,&tempg->pmu.u,tempg->pmu.vertex_cnt*sizeof(CD3I32)); + for (i=0;ipmu.vertex_cnt;i++,p2++) { + p2->x+=x1; + p2->y+=y1; + p2->z+=z1; + } + Gr3Mesh(dc,tempg->pmu.vertex_cnt,p,tempg->pmu.tri_cnt, + (&tempg->pmu.u)(U8 *)+sizeof(CD3I32)*tempg->pmu.vertex_cnt); + Free(p); + if (dc->flags&DCF_TRANSFORMATION) { + dc->x-=tempg->pmu.x; + dc->y-=tempg->pmu.y; + dc->z-=tempg->pmu.z; + } + break; + } + cur_sprite_elem_num++; + if (just_one_elem) break; + tempg(U8 *)+=SpriteElemSize(tempg); + } + MemCpy(&dc->sym,&old_sym,sizeof(CGrSym)); + dc->color=old_color; + dc->pen_width=old_pen_width; + dc->flags=dc->flags&~(DCF_SYMMETRY|DCF_TRANSFORMATION) | + old_flags&(DCF_SYMMETRY|DCF_TRANSFORMATION); +} + +public U0 Sprite3B(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems) +{//Plot a sprite into a CDC, post transform xyz translation. + I64 old_x=dc->x,old_y=dc->y,old_z=dc->z, + old_flags=dc->flags&DCF_TRANSFORMATION; + dc->x=x; dc->y=y; dc->z=z; + dc->flags|=DCF_TRANSFORMATION; + Sprite3(dc,0,0,0,elems); + dc->x=old_x; dc->y=old_y; dc->z=old_z; + dc->flags=dc->flags&~DCF_TRANSFORMATION|old_flags; +} + +public U0 SpriteMat3B(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,I64 *m) +{//Plot rotated by matrix. + I64 r[16],*old_r=dc->r,new_m[16], + old_flags=dc->flags&DCF_TRANSFORMATION; + MemCpy(new_m,m,16*sizeof(I64)); + dc->flags|=DCF_TRANSFORMATION; + Mat4x4TranslationAdd(new_m,x,y,z); + dc->r=Mat4x4MulMat4x4Equ(r,old_r,new_m); + Sprite3(dc,0,0,0,elems); + dc->r=old_r; + dc->flags=dc->flags&~DCF_TRANSFORMATION|old_flags; +} + +public U0 SpriteX3B(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,F64 è=0) +{//Plot rotated around X axis. + I64 r[16]; + Mat4x4IdentEqu(r); + Mat4x4RotX(r,è); + SpriteMat3B(dc,x,y,z,elems,r); +} + +public U0 SpriteY3B(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,F64 ê=0) +{//Plot rotated around Y axis. + I64 r[16]; + Mat4x4IdentEqu(r); + Mat4x4RotY(r,ê); + SpriteMat3B(dc,x,y,z,elems,r); +} + +public U0 SpriteZ3B(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,F64 é=0) +{//Plot rotated around Z axis. + I64 r[16]; + Mat4x4IdentEqu(r); + Mat4x4RotZ(r,é); + SpriteMat3B(dc,x,y,z,elems,r); +} + +public U0 SpriteExtents(U8 *elems,I64 *min_x=NULL,I64 *max_x=NULL, + I64 *min_y=NULL,I64 *max_y=NULL) +{//Ignores flood fills. + CDC *dc=DCNew(MAX_I32,MAX_I32,Fs,TRUE); + DCExtentsInit(dc); + Sprite3(dc,MAX_I32/2,MAX_I32/2,MAX_I32/2,elems); + if (dc->min_x<=dc->max_x) { + dc->min_x-=MAX_I32/2; + dc->max_x-=MAX_I32/2; + } + if (dc->min_y<=dc->max_y) { + dc->min_y-=MAX_I32/2; + dc->max_y-=MAX_I32/2; + } + if (min_x) *min_x=dc->min_x; + if (max_x) *max_x=dc->max_x; + if (min_y) *min_y=dc->min_y; + if (max_y) *max_y=dc->max_y; + DCDel(dc); +} + +public CDC *Sprite2DC(U8 *elems) +{//Convert sprite to device context. + CDC *res; + I64 min_x,max_x,min_y,max_y; + SpriteExtents(elems,&min_x,&max_x,&min_y,&max_y); + res=DCNew(max_x-min_x+1,max_y-min_y+1); + Sprite3(res,-min_x,-min_y,0,elems); + return res; +} + +public U8 *SpriteInterpolate(F64 t,U8 *elems0,U8 *elems1) +{//The two CSprite should be ident except for points shifted around. +//t ranges from 0.0 to 1.0. + I64 i,t1=GR_SCALE*t,t0=GR_SCALE-t1; + I32 *ptr0,*ptr1,*ptrr; + CD3I32 *p0,*p1,*pr; + U8 *res; + CSprite *tempg0=elems0-offset(CSprite.start), + *tempg1=elems1-offset(CSprite.start),*tempgr; + if (t<0.5) { + i=SpriteSize(elems0), + res=MAlloc(i); + MemCpy(res,elems0,i); + } else { + i=SpriteSize(elems1), + res=MAlloc(i); + MemCpy(res,elems1,i); + } + tempgr=res-offset(CSprite.start); + while (tempg0->type) { + if (tempg0->type!=tempg1->type) + throw('Graphics'); + switch (tempg0->type) { + case SPT_ROTATED_RECT: + tempgr->ppa.angle=(tempg0->ppa.angle*t0+tempg1->ppa.angle*t1)/GR_SCALE; + case SPT_RECT: + case SPT_LINE: + case SPT_ARROW: + case SPT_PLANAR_SYMMETRY: + tempgr->pp.x2=(tempg0->pp.x2*t0+tempg1->pp.x2*t1)>>32; + tempgr->pp.y2=(tempg0->pp.y2*t0+tempg1->pp.y2*t1)>>32; + case SPT_TEXT: + case SPT_TEXT_BOX: + case SPT_TEXT_DIAMOND: + case SPT_PT: + case SPT_FLOOD_FILL: + case SPT_FLOOD_FILL_NOT: + case SPT_SHIFT: + tempgr->p.x1=(tempg0->p.x1*t0+tempg1->p.x1*t1)>>32; + tempgr->p.y1=(tempg0->p.y1*t0+tempg1->p.y1*t1)>>32; + break; + case SPT_CIRCLE: + tempgr->pr.radius=(tempg0->pr.radius*t0+tempg1->pr.radius*t1)>>32; + tempgr->pr.x1=(tempg0->pr.x1*t0+tempg1->pr.x1*t1)>>32; + tempgr->pr.y1=(tempg0->pr.y1*t0+tempg1->pr.y1*t1)>>32; + break; + case SPT_ELLIPSE: + case SPT_POLYGON: + tempgr->pwha.x1=(tempg0->pwha.x1*t0+tempg1->pwha.x1*t1)>>32; + tempgr->pwha.y1=(tempg0->pwha.y1*t0+tempg1->pwha.y1*t1)>>32; + tempgr->pwha.width =(tempg0->pwha.width *t0+tempg1->pwha.width*t1)>>32; + tempgr->pwha.height=(tempg0->pwha.height*t0+tempg1->pwha.height*t1)>>32; + break; + case SPT_BITMAP: + tempgr->pwhu.x1=(tempg0->pwhu.x1*t0+tempg1->pwhu.x1*t1)>>32; + tempgr->pwhu.y1=(tempg0->pwhu.y1*t0+tempg1->pwhu.y1*t1)>>32; + break; + case SPT_POLYLINE: + ptr0=&tempg0->nu.u; + ptr1=&tempg1->nu.u; + ptrr=&tempgr->nu.u; + for (i=0;inu.num;i++) { + ptrr[i<<1]=(ptr0[i<<1]*t0+ptr1[i<<1]*t1)>>32; + ptrr[i<<1+1]=(ptr0[i<<1+1]*t0+ptr1[i<<1+1]*t1)>>32; + } + break; + case SPT_POLYPT: + tempgr->npu.x=(tempg0->npu.x*t0+tempg1->npu.x*t1)>>32; + tempgr->npu.y=(tempg0->npu.y*t0+tempg1->npu.y*t1)>>32; + break; + case SPT_BSPLINE2: + case SPT_BSPLINE3: + case SPT_BSPLINE2_CLOSED: + case SPT_BSPLINE3_CLOSED: + p0=&tempg0->nu.u; + p1=&tempg1->nu.u; + pr=&tempgr->nu.u; + for (i=0;inu.num;i++) { + pr[i].x=(p0[i].x*t0+p1[i].x*t1)>>32; + pr[i].y=(p0[i].y*t0+p1[i].y*t1)>>32; + pr[i].z=(p0[i].z*t0+p1[i].z*t1)>>32; + } + break; + case SPT_MESH: + p0=&tempg0->mu.u; + p1=&tempg1->mu.u; + pr=&tempgr->mu.u; + for (i=0;imu.vertex_cnt;i++) { + pr[i].x=(p0[i].x*t0+p1[i].x*t1)>>32; + pr[i].y=(p0[i].y*t0+p1[i].y*t1)>>32; + pr[i].z=(p0[i].z*t0+p1[i].z*t1)>>32; + } + break; + case SPT_SHIFTABLE_MESH: + p0=&tempg0->pmu.u; + p1=&tempg1->pmu.u; + pr=&tempgr->pmu.u; + for (i=0;ipmu.vertex_cnt;i++) { + pr[i].x=(p0[i].x*t0+p1[i].x*t1)>>32; + pr[i].y=(p0[i].y*t0+p1[i].y*t1)>>32; + pr[i].z=(p0[i].z*t0+p1[i].z*t1)>>32; + } + break; + } + tempg0(U8 *)+=SpriteElemSize(tempg0); + tempg1(U8 *)+=SpriteElemSize(tempg1); + tempgr(U8 *)+=SpriteElemSize(tempgr); + } + return res; +} + +#help_index "Graphics/Sprite;DolDoc/Output;StdOut/DolDoc" +public CDocEntry *DocSprite(CDoc *doc=NULL,U8 *elems,U8 *fmt=NULL) +{//Put a sprite into a document. You can, optionally, supply a fmt string +//for $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ cmd with a %d for the bin_num. + I64 size; + U8 *st; + Bool unlock; + CDocEntry *doc_e; + CDocBin *tempb; + if (!doc && !(doc=DocPut)) return NULL; + unlock=DocLock(doc); + size=SpriteSize(elems); + tempb=CAlloc(sizeof(CDocBin),doc->mem_task); + tempb->size=size; + tempb->data=MAlloc(size,doc->mem_task); + MemCpy(tempb->data,elems,size); + tempb->num=doc->cur_bin_num; + tempb->use_cnt=1; + QueIns(tempb,doc->bin_head.last); + if (fmt) + st=MStrPrint(fmt,doc->cur_bin_num++); + else + st=MStrPrint("$$SP,\"\",BI=%d$$",doc->cur_bin_num++); + doc_e=DocPrint(doc,"%s",st); + Free(st); + doc_e->bin_data=tempb; + if (doc_e && doc_e->de_flags&DOCEF_TAG && doc_e->tag && *doc_e->tag) + tempb->tag=StrNew(doc_e->tag,doc->mem_task); + if (unlock) + DocUnlock(doc); + return doc_e; +} + +public CDocEntry *Sprite(U8 *elems,U8 *fmt=NULL) +{//Put sprite to the command-line, $LK,"DocPut",A="MN:DocPut"$. +//If you set fmt, then include dollars ("$$SP ...$$") and leave %d for num. + CDoc *doc; + if (doc=DocPut) + return DocSprite(doc,elems,fmt); + return NULL; +} diff --git a/Adam/Gr/GrTextBase.CPP b/Adam/Gr/GrTextBase.HC similarity index 100% rename from Adam/Gr/GrTextBase.CPP rename to Adam/Gr/GrTextBase.HC diff --git a/Adam/Gr/MakeGr.CPP b/Adam/Gr/MakeGr.CPP deleted file mode 100644 index 0b49294..0000000 --- a/Adam/Gr/MakeGr.CPP +++ /dev/null @@ -1,31 +0,0 @@ -Cd(__DIR__);; - -#include "GrInitA" -#include "Gr.HPP" -#include "GrExt" -#include "GrGlbls" -#include "GrTextBase" -#include "GrAsm" -#include "GrPalette" -#include "GrDC" -#include "GrInitB" -#include "GrMath" -#include "GrScreen" -#include "GrBitMap" -#include "GrPrimatives" -#include "GrComposites" - -#define GE_ABORT (-1) -#define GE_EXIT 0 -#define GE_CONT 1 -#include "SpriteNew" -#include "GrSpritePlot" -#include "SpriteMesh" -#include "SpriteBitMap" -#include "SpriteCode" -#include "SpriteEd" -#include "SpriteMain" - -#include "GrEnd" - -Cd("..");; diff --git a/Adam/Gr/MakeGr.HC b/Adam/Gr/MakeGr.HC new file mode 100644 index 0000000..2332f06 --- /dev/null +++ b/Adam/Gr/MakeGr.HC @@ -0,0 +1,31 @@ +Cd(__DIR__);; + +#include "GrInitA" +#include "Gr.HH" +#include "GrExt" +#include "GrGlbls" +#include "GrTextBase" +#include "GrAsm" +#include "GrPalette" +#include "GrDC" +#include "GrInitB" +#include "GrMath" +#include "GrScreen" +#include "GrBitMap" +#include "GrPrimatives" +#include "GrComposites" + +#define GE_ABORT (-1) +#define GE_EXIT 0 +#define GE_CONT 1 +#include "SpriteNew" +#include "GrSpritePlot" +#include "SpriteMesh" +#include "SpriteBitMap" +#include "SpriteCode" +#include "SpriteEd" +#include "SpriteMain" + +#include "GrEnd" + +Cd("..");; diff --git a/Adam/Gr/SpriteBitMap.CPP b/Adam/Gr/SpriteBitMap.CPP deleted file mode 100644 index c1cd504..0000000 --- a/Adam/Gr/SpriteBitMap.CPP +++ /dev/null @@ -1,676 +0,0 @@ -#help_index "Graphics/Sprite;Sprites" - -#define GBM_EXIT 0 -#define GBM_MAIN_MENU 1 -#define GBM_COLOR 2 -#define GBM_DITHER_COLOR 3 -#define GBM_WIDTH 4 -#define GBM_PT 5 -#define GBM_LINE 6 -#define GBM_ARROW 7 -#define GBM_RECT 8 -#define GBM_CIRCLE 9 -#define GBM_TEXT 10 -#define GBM_TEXT_BOX 11 -#define GBM_TEXT_DIAMOND 12 -#define GBM_FLOOD_FILL 13 -#define GBM_FLOOD_FILL_NOT 14 -#define GBM_POLYLINE 15 -#define GBM_POLYPT 16 -#define GBM_COPY 17 -#define GBM_DELETE 18 -#define GBM_PASTE 19 -#define GBM_PASTE_TRANSPARENT 20 -#define GBM_FIND_AND_REPLACE 21 -#define GBM_TRIM_TO_EXTENTS 22 -#define GBM_ADD_OUTLINE 23 -#define GBM_ETCH 24 -#define GBM_UNDO 25 -#define GBM_SAVE_BMP 26 -#define GBM_SAVE_GRA 27 - -U0 GrInit4() -{ - DefineLstLoad("ST_SPRITE_BITMAP_MENU", - "Exit\0Main Menu\0Color\0Dither Color\0Width\0Point\0Line\0Arrow\0" - "Rect\0Circle\0Text\0Text Box\0Text Diamond\0Flood Fill\0" - "Flood Fill Not Color\0PolyLine\0PolyPoint\0Copy\0Delete\0Paste\0" - "Paste Transparent\0Find and Replace\0Trim to Extents\0Add Outline\0" - "Etch\0Undo\0Save BMP\0Save GRA\0"); -} -GrInit4; - -I64 PopUpSpriteBitMap(CColorROPU32 color,I64 width) -{ - I64 i; - U8 *st1,*st2,buf[STR_LEN]; - CDoc *doc=DocNew; - - Color2Str(buf,color); - if (color&ROPF_DITHER) { - st1=""; - st2=buf; - } else { - st1=buf; - st2=""; - } - DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Sprite BitMap Menu\"$$\n" - "$$LK+PU+CX,\"Click for Help\",A=\"FI:::/Doc/SpriteBitMap.TXT.Z\"$$\n" - "\n$$LTBLUE$$$$MU-UL,\"Color %s\",LE=GBM_COLOR$$\n" - "$$MU-UL,\"Dither Color %s\",LE=GBM_DITHER_COLOR$$\n" - "$$MU-UL,\"Width %d\",LE=GBM_WIDTH$$\n" - "$$MU-UL,\"Find & Replace Color\",LE=GBM_FIND_AND_REPLACE$$\n" - "$$MU-UL,\"Trim to Extents\",LE=GBM_TRIM_TO_EXTENTS$$\n" - "$$MU-UL,\"Add Outline\",LE=GBM_ADD_OUTLINE$$\n" - "$$MU-UL,\"Etch\",LE=GBM_ETCH$$\n" - "\n$$MU-UL,\"Point\",LE=GBM_PT$$\n" - "$$MU-UL,\"Line\",LE=GBM_LINE$$\n" - "$$MU-UL,\"Arrow\",LE=GBM_ARROW$$\n" - "$$MU-UL,\"Rect\",LE=GBM_RECT$$\n" - "$$MU-UL,\"Circle\",LE=GBM_CIRCLE$$\n" - "$$MU-UL,\"Text\",LE=GBM_TEXT$$\n" - "$$MU-UL,\"Text Box\",LE=GBM_TEXT_BOX$$\n" - "$$MU-UL,\"Text Diamond\",LE=GBM_TEXT_DIAMOND$$\n" - "$$MU-UL,\"Flood Fill\",LE=GBM_FLOOD_FILL$$\n" - "$$MU-UL,\"Flood Fill Not Color\",LE=GBM_FLOOD_FILL_NOT$$\n" - "$$MU-UL,\"PolyLine\",LE=GBM_POLYLINE$$\n" - "$$MU-UL,\"PolyPoint\",LE=GBM_POLYPT$$\n" - "\n$$MU-UL,\"Copy to Clipboard\",LE=GBM_COPY$$\n" - "$$MU-UL,\"Delete to Clipboard\",LE=GBM_DELETE$$\n" - "$$MU-UL,\"Paste Clipboard\",LE=GBM_PASTE$$\n" - "$$MU-UL,\"Paste Transparent Clipboard\",LE=GBM_PASTE_TRANSPARENT$$\n" - "\n$$MU-UL,\"Save BMP File\",LE=GBM_SAVE_BMP$$\n" - "$$MU-UL,\"Save GRA File\",LE=GBM_SAVE_GRA$$\n" - "\n$$MU-UL,\"Undo\",LE=GBM_UNDO$$\n" - "\n$$PURPLE$$$$MU-UL,\"+] Sprite Main Menu\",LE=GBM_MAIN_MENU$$$$LTBLUE$$\n" - "$$MU-UL,\"Exit Sprite\",LE=GBM_EXIT$$\n" - "$$MU-UL,\"Abort Sprite\",LE=DOCM_CANCEL$$\n" - "\nRight-Click to get back to this menu.",st1,st2,width); - i=PopUpMenu(doc); - DocDel(doc); - return i; -} - -U0 GrBitMapEdPrepPersistentDC(CDC *dc,I64 xx1,I64 yy1,CDC *img) -{ - DCFill(dc); - GrBlot(dc,xx1,yy1,img); -} - -U0 GrBitMapEdTrimToExtents(CDC **_img,I64 *_xx1,I64 *_yy1, - I64 *_xx2,I64 *_yy2,CColorROPU32 bkcolor) -{ - CDC *img=*_img; - I64 i,c, - x1=0,y1=0,x2=img->width-1,y2=img->height-1; //inclusive - while (y1width-1); *_yy2+=y2-(img->height-1); //not inclusive - DCDel(img); -} - -U0 GrBitMapEdAddOutline(CDC *img,I64 width, - CColorROPU32 color,CColorROPU32 bkcolor) -{ - I64 i,j,k,c; - CColorROPU32 old_color; - CDC *src; - if (img->width && img->height) { - old_color=img->color; - img->color=color; - while (width-->0) { - src=DCExt(img,0,0,img->width-1,img->height-1); - for (i=0;iheight;i++) - for (j=0;jwidth;j++) - if (GrPeek(src,j,i)==bkcolor) - for (k=0;k<8;k++) { - c=GrPeek(src,j+gr_x_offsets[k],i+gr_y_offsets[k]); - if (c>=0 && c!=bkcolor) { - GrPlot(img,j,i); - break; - } - } - DCDel(src); - } - img->color=old_color; - } -} - -U0 GrBitMapEdEtch(CDC *img,I64 width,CColorROPU32 bkcolor) -{ - I64 i,j,k,c; - CColorROPU32 old_color; - CDC *src; - if (img->width && img->height) { - old_color=img->color; - img->color=bkcolor; - while (width-->0) { - src=DCExt(img,0,0,img->width-1,img->height-1); - for (i=0;iheight;i++) - for (j=0;jwidth;j++) - if (GrPeek(src,j,i)!=bkcolor) - for (k=0;k<8;k++) { - c=GrPeek(src,j+gr_x_offsets[k],i+gr_y_offsets[k]); - if (c<0 || c==bkcolor) { - GrPlot(img,j,i); - break; - } - } - DCDel(src); - } - img->color=old_color; - } -} - -I64 SpriteBitMapEd(CDoc *,CDocEntry *doc_e,CDC *dc,I64 *_xx1,I64 *_yy1, - I64 *_xx2,I64 *_yy2,CDC **_img,CColorROPU32 bkcolor) -{ - I64 i,j,mode=GBM_LINE,color=BLACK,width=1,msg_code,a1,a2,x1,y1,x11,y11, - x22,y22,res,xx1=*_xx1,yy1=*_yy1,xx2=*_xx2,yy2=*_yy2, - old_de_flags=doc_e->de_flags; - Bool down=FALSE; - U8 *st=NULL; - CEdFileName filename; - CDC *img=*_img, - *clipboard=NULL,*undo=NULL,*dc2; - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - - doc_e->de_flags|=DOCEF_DONT_DRAW; - goto bm_menu; - - while (TRUE) { - if (kbd.scan_code&SCF_CTRL)//grab scroll update? - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - - dc->color=ROPF_DITHER+WHITE<<16+BLACK; - dc->pen_width=1; - GrBorder(dc,xx1-1,yy1-1,xx2,yy2);//This is done little bit too often. - - while (msg_code=ScanMsg(&a1,&a2,1<task_title,"Sprite BitMap Menu"); - i=PopUpSpriteBitMap(color,width); - if (i>=0) - StrCpy(Fs->task_title,DefineSub(i,"ST_SPRITE_BITMAP_MENU")); - switch (i) { - case DOCM_CANCEL: - res=GE_ABORT; - goto bm_done; - case GBM_EXIT: - res=GE_EXIT; - goto bm_done; - case GBM_MAIN_MENU: - res=GE_CONT; - goto bm_done; - case GBM_COLOR: - i=PopUpColor(,,FALSE); - if (i>=0) color=i; - goto bm_menu; - case GBM_FIND_AND_REPLACE: - i=PopUpColor("Find Color\n",,FALSE); - if (i>=0) { - j=PopUpColor("Replace Color\n",,FALSE); - if (j>=0) { - DCColorChg(img,i,j); - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - } - } - goto bm_menu; - case GBM_TRIM_TO_EXTENTS: - GrBitMapEdTrimToExtents(&img,&xx1,&yy1,&xx2,&yy2,bkcolor); - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - goto bm_menu; - case GBM_ADD_OUTLINE: - i=PopUpRangeI64(1,16,1,"Outline Width\n"); - if (i>=0) { - GrBitMapEdAddOutline(img,i,color,bkcolor); - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - } - goto bm_menu; - case GBM_ETCH: - i=PopUpRangeI64(1,16,1,"Etch Width\n"); - if (i>=0) { - GrBitMapEdEtch(img,i,bkcolor); - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - } - goto bm_menu; - case GBM_SAVE_BMP: - *filename.name=0; - if (DocForm(&filename) && *filename.name) - BMPWrite(filename.name,img); - goto bm_menu; - case GBM_SAVE_GRA: - *filename.name=0; - if (DocForm(&filename) && *filename.name) - GRAWrite(filename.name,img,DCSF_COMPRESSED|DCSF_PALETTE_GET); - goto bm_menu; - case GBM_DITHER_COLOR: - i=PopUpColorDither; - if (i>=0) color=i; - goto bm_menu; - case GBM_WIDTH: - i=PopUpRangeI64(1,16,1,"Pen Width\n"); - if (i>=0) width=i; - goto bm_menu; - case GBM_UNDO: - if (undo) { - DCFill(img,bkcolor); - img->color=ROP_EQU; - GrBlot(img,0,0,undo); - DCDel(undo); - undo=NULL; - } - goto bm_menu; - case GBM_PT: - case GBM_LINE: - case GBM_ARROW: - case GBM_RECT: - case GBM_CIRCLE: - case GBM_FLOOD_FILL: - case GBM_FLOOD_FILL_NOT: - case GBM_POLYPT: - case GBM_POLYLINE: - case GBM_COPY: - case GBM_DELETE: - case GBM_PASTE: - case GBM_PASTE_TRANSPARENT: - mode=i; - break; - case GBM_TEXT: - case GBM_TEXT_BOX: - case GBM_TEXT_DIAMOND: - Free(st); - st=PopUpGetStr("Enter text and press .\n"); - if (st && *st) - mode=i; - else - goto bm_menu; - break; - } - DCDel(undo); - undo=DCExt(img,0,0,img->width-1,img->height-1); - undo->bkcolor=bkcolor; - WinMgrSync(2,TRUE); //Let popup close - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - down=FALSE; - break; - case MSG_IP_L_DOWN: - switch (mode) { - case GBM_PT: - img->color=color; - img->pen_width=width; - GrPlot3(img,a1-xx1,a2-yy1,0); - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - break; - start: - if (down) - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - x1=a1; y1=a2; - down=TRUE; - dc->color=color; - dc->pen_width=width; - case GBM_LINE: - GrLine3(dc,x1,y1,0,a1,a2,0); - break; - case GBM_ARROW: - GrArrow3(dc,x1,y1,0,a1,a2,0); - break; - case GBM_RECT: - GrRect(dc,x1,y1,1,1); - break; - case GBM_CIRCLE: - GrCircle3(dc,x1,y1,0,1); - break; - case GBM_COPY: - case GBM_DELETE: - dc->color=ROPF_DITHER+WHITE<<16+BLACK; - dc->pen_width=1; - GrBorder(dc,x1,y1,x1,y1); - break; - end: - break; - case GBM_PASTE: - case GBM_PASTE_TRANSPARENT: - if (clipboard) { - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - if (mode==GBM_PASTE) { - clipboard->flags|=DCF_NO_TRANSPARENTS; - GrBlot(dc,a1,a2,clipboard); - clipboard->flags&=~DCF_NO_TRANSPARENTS; - } else { - dc2=DCCopy(clipboard); - DCColorChg(dc2,bkcolor); - GrBlot(dc,a1,a2,dc2); - DCDel(dc2); - } - } - break; - case GBM_TEXT: - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - dc->color=color; - GrPrint(dc,a1,a2,"%s",st); - break; - case GBM_TEXT_BOX: - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - dc->color=color; - GrTextBox3(dc,a1,a2,0,st); - break; - case GBM_TEXT_DIAMOND: - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - dc->color=color; - GrTextDiamond3(dc,a1,a2,0,st); - break; - case GBM_FLOOD_FILL: - img->color=color; - GrFloodFill(img,a1-xx1,a2-yy1); - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - break; - case GBM_FLOOD_FILL_NOT: - img->color=color; - GrFloodFill(img,a1-xx1,a2-yy1,TRUE); - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - break; - case GBM_POLYLINE: - if (!down) { - x1=a1; y1=a2; - down=TRUE; - dc->color=color; - dc->pen_width=width; - GrLine3(dc,x1,y1,0,a1,a2,0); - } - break; - case GBM_POLYPT: - x1=a1; y1=a2; - down=TRUE; - img->color=color; - img->pen_width=width; - GrLine3(img,x1-xx1,y1-yy1,0,a1-xx1,a2-yy1,0); - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - break; - } - break; - case MSG_IP_MOVE: - switch (mode) { - case GBM_LINE: - case GBM_ARROW: - case GBM_POLYLINE: - if (down) { - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - dc->color=color; - dc->pen_width=width; - if (mode==GBM_ARROW) - GrArrow3(dc,x1,y1,0,a1,a2,0); - else - GrLine3(dc,x1,y1,0,a1,a2,0); - } - break; - case GBM_RECT: - if (down) { - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - if (x1color=color; - GrRect(dc,x11,y11,x22-x11+1,y22-y11+1); - } - break; - case GBM_COPY: - case GBM_DELETE: - if (down) { - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - if (x1color=ROPF_DITHER+WHITE<<16+BLACK; - dc->pen_width=1; - GrBorder(dc,x11,y11,x22,y22); - } - break; - case GBM_CIRCLE: - if (down) { - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - dc->color=color; - dc->pen_width=width; - GrCircle3(dc,x1,y1,0,Sqrt(SqrI64(a1-x1)+SqrI64(a2-y1))); - } - break; - case GBM_PASTE: - case GBM_PASTE_TRANSPARENT: - if (clipboard) { - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - if (mode==GBM_PASTE) { - clipboard->flags|=DCF_NO_TRANSPARENTS; - GrBlot(dc,a1,a2,clipboard); - clipboard->flags&=~DCF_NO_TRANSPARENTS; - } else { - dc2=DCCopy(clipboard); - DCColorChg(dc2,bkcolor); - GrBlot(dc,a1,a2,dc2); - DCDel(dc2); - } - } - break; - case GBM_TEXT: - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - dc->color=color; - GrPrint(dc,a1,a2,"%s",st); - break; - case GBM_TEXT_BOX: - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - dc->color=color; - GrTextBox3(dc,a1,a2,0,st); - break; - case GBM_TEXT_DIAMOND: - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - dc->color=color; - GrTextDiamond3(dc,a1,a2,0,st); - break; - case GBM_POLYPT: - if (down) { - img->color=color; - img->pen_width=width; - GrLine3(img,x1-xx1,y1-yy1,0,a1-xx1,a2-yy1,0); - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - x1=a1; y1=a2; - } - break; - } - break; - case MSG_IP_L_UP: - switch (mode) { - case GBM_LINE: - case GBM_ARROW: - case GBM_POLYPT: - case GBM_POLYLINE: - img->color=color; - img->pen_width=width; - if (mode==GBM_ARROW) - GrArrow3(img,x1-xx1,y1-yy1,0,a1-xx1,a2-yy1,0); - else - GrLine3(img,x1-xx1,y1-yy1,0,a1-xx1,a2-yy1,0); - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - if (mode==GBM_POLYLINE) { - x1=a1; y1=a2; - } else - down=FALSE; - break; - case GBM_RECT: - img->color=color; - if (x1bkcolor=bkcolor; - if (mode==GBM_DELETE) { - img->color=bkcolor; - GrRect(img,x11-xx1,y11-yy1,x22-x11+1,y22-y11+1); - } - goto bm_menu; - case GBM_CIRCLE: - img->color=color; - img->pen_width=width; - GrCircle3(img,x1-xx1,y1-yy1,0,Sqrt(SqrI64(a1-x1)+SqrI64(a2-y1))); - down=FALSE; - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - break; - case GBM_PASTE: - case GBM_PASTE_TRANSPARENT: - if (clipboard) { - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - if (mode==GBM_PASTE) { - clipboard->flags|=DCF_NO_TRANSPARENTS; - GrBlot(img,a1-xx1,a2-yy1,clipboard); - clipboard->flags&=~DCF_NO_TRANSPARENTS; - } else { - dc2=DCCopy(clipboard); - DCColorChg(dc2,bkcolor); - GrBlot(img,a1-xx1,a2-yy1,dc2); - DCDel(dc2); - } - GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); - } - break; - case GBM_TEXT: - img->color=color; - GrPrint(img,a1-xx1,a2-yy1,"%s",st); - goto bm_menu; - case GBM_TEXT_BOX: - img->color=color; - GrTextBox3(img,a1-xx1,a2-yy1,0,st); - goto bm_menu; - case GBM_TEXT_DIAMOND: - img->color=color; - GrTextDiamond3(img,a1-xx1,a2-yy1,0,st); - goto bm_menu; - } - break; - } - } - WinMgrSync; - } -bm_key_up_done: - GetMsg(,,1<de_flags=old_de_flags; - *_img=img; - *_xx1=xx1,*_yy1=yy1,*_xx2=xx2,*_yy2=yy2; - return res; -} diff --git a/Adam/Gr/SpriteBitMap.HC b/Adam/Gr/SpriteBitMap.HC new file mode 100644 index 0000000..2aab312 --- /dev/null +++ b/Adam/Gr/SpriteBitMap.HC @@ -0,0 +1,676 @@ +#help_index "Graphics/Sprite;Sprites" + +#define GBM_EXIT 0 +#define GBM_MAIN_MENU 1 +#define GBM_COLOR 2 +#define GBM_DITHER_COLOR 3 +#define GBM_WIDTH 4 +#define GBM_PT 5 +#define GBM_LINE 6 +#define GBM_ARROW 7 +#define GBM_RECT 8 +#define GBM_CIRCLE 9 +#define GBM_TEXT 10 +#define GBM_TEXT_BOX 11 +#define GBM_TEXT_DIAMOND 12 +#define GBM_FLOOD_FILL 13 +#define GBM_FLOOD_FILL_NOT 14 +#define GBM_POLYLINE 15 +#define GBM_POLYPT 16 +#define GBM_COPY 17 +#define GBM_DELETE 18 +#define GBM_PASTE 19 +#define GBM_PASTE_TRANSPARENT 20 +#define GBM_FIND_AND_REPLACE 21 +#define GBM_TRIM_TO_EXTENTS 22 +#define GBM_ADD_OUTLINE 23 +#define GBM_ETCH 24 +#define GBM_UNDO 25 +#define GBM_SAVE_BMP 26 +#define GBM_SAVE_GRA 27 + +U0 GrInit4() +{ + DefineLstLoad("ST_SPRITE_BITMAP_MENU", + "Exit\0Main Menu\0Color\0Dither Color\0Width\0Point\0Line\0Arrow\0" + "Rect\0Circle\0Text\0Text Box\0Text Diamond\0Flood Fill\0" + "Flood Fill Not Color\0PolyLine\0PolyPoint\0Copy\0Delete\0Paste\0" + "Paste Transparent\0Find and Replace\0Trim to Extents\0Add Outline\0" + "Etch\0Undo\0Save BMP\0Save GRA\0"); +} +GrInit4; + +I64 PopUpSpriteBitMap(CColorROPU32 color,I64 width) +{ + I64 i; + U8 *st1,*st2,buf[STR_LEN]; + CDoc *doc=DocNew; + + Color2Str(buf,color); + if (color&ROPF_DITHER) { + st1=""; + st2=buf; + } else { + st1=buf; + st2=""; + } + DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Sprite BitMap Menu\"$$\n" + "$$LK+PU+CX,\"Click for Help\",A=\"FI:::/Doc/SpriteBitMap.DD.Z\"$$\n" + "\n$$LTBLUE$$$$MU-UL,\"Color %s\",LE=GBM_COLOR$$\n" + "$$MU-UL,\"Dither Color %s\",LE=GBM_DITHER_COLOR$$\n" + "$$MU-UL,\"Width %d\",LE=GBM_WIDTH$$\n" + "$$MU-UL,\"Find & Replace Color\",LE=GBM_FIND_AND_REPLACE$$\n" + "$$MU-UL,\"Trim to Extents\",LE=GBM_TRIM_TO_EXTENTS$$\n" + "$$MU-UL,\"Add Outline\",LE=GBM_ADD_OUTLINE$$\n" + "$$MU-UL,\"Etch\",LE=GBM_ETCH$$\n" + "\n$$MU-UL,\"Point\",LE=GBM_PT$$\n" + "$$MU-UL,\"Line\",LE=GBM_LINE$$\n" + "$$MU-UL,\"Arrow\",LE=GBM_ARROW$$\n" + "$$MU-UL,\"Rect\",LE=GBM_RECT$$\n" + "$$MU-UL,\"Circle\",LE=GBM_CIRCLE$$\n" + "$$MU-UL,\"Text\",LE=GBM_TEXT$$\n" + "$$MU-UL,\"Text Box\",LE=GBM_TEXT_BOX$$\n" + "$$MU-UL,\"Text Diamond\",LE=GBM_TEXT_DIAMOND$$\n" + "$$MU-UL,\"Flood Fill\",LE=GBM_FLOOD_FILL$$\n" + "$$MU-UL,\"Flood Fill Not Color\",LE=GBM_FLOOD_FILL_NOT$$\n" + "$$MU-UL,\"PolyLine\",LE=GBM_POLYLINE$$\n" + "$$MU-UL,\"PolyPoint\",LE=GBM_POLYPT$$\n" + "\n$$MU-UL,\"Copy to Clipboard\",LE=GBM_COPY$$\n" + "$$MU-UL,\"Delete to Clipboard\",LE=GBM_DELETE$$\n" + "$$MU-UL,\"Paste Clipboard\",LE=GBM_PASTE$$\n" + "$$MU-UL,\"Paste Transparent Clipboard\",LE=GBM_PASTE_TRANSPARENT$$\n" + "\n$$MU-UL,\"Save BMP File\",LE=GBM_SAVE_BMP$$\n" + "$$MU-UL,\"Save GRA File\",LE=GBM_SAVE_GRA$$\n" + "\n$$MU-UL,\"Undo\",LE=GBM_UNDO$$\n" + "\n$$PURPLE$$$$MU-UL,\"+] Sprite Main Menu\",LE=GBM_MAIN_MENU$$$$LTBLUE$$\n" + "$$MU-UL,\"Exit Sprite\",LE=GBM_EXIT$$\n" + "$$MU-UL,\"Abort Sprite\",LE=DOCM_CANCEL$$\n" + "\nRight-Click to get back to this menu.",st1,st2,width); + i=PopUpMenu(doc); + DocDel(doc); + return i; +} + +U0 GrBitMapEdPrepPersistentDC(CDC *dc,I64 xx1,I64 yy1,CDC *img) +{ + DCFill(dc); + GrBlot(dc,xx1,yy1,img); +} + +U0 GrBitMapEdTrimToExtents(CDC **_img,I64 *_xx1,I64 *_yy1, + I64 *_xx2,I64 *_yy2,CColorROPU32 bkcolor) +{ + CDC *img=*_img; + I64 i,c, + x1=0,y1=0,x2=img->width-1,y2=img->height-1; //inclusive + while (y1width-1); *_yy2+=y2-(img->height-1); //not inclusive + DCDel(img); +} + +U0 GrBitMapEdAddOutline(CDC *img,I64 width, + CColorROPU32 color,CColorROPU32 bkcolor) +{ + I64 i,j,k,c; + CColorROPU32 old_color; + CDC *src; + if (img->width && img->height) { + old_color=img->color; + img->color=color; + while (width-->0) { + src=DCExt(img,0,0,img->width-1,img->height-1); + for (i=0;iheight;i++) + for (j=0;jwidth;j++) + if (GrPeek(src,j,i)==bkcolor) + for (k=0;k<8;k++) { + c=GrPeek(src,j+gr_x_offsets[k],i+gr_y_offsets[k]); + if (c>=0 && c!=bkcolor) { + GrPlot(img,j,i); + break; + } + } + DCDel(src); + } + img->color=old_color; + } +} + +U0 GrBitMapEdEtch(CDC *img,I64 width,CColorROPU32 bkcolor) +{ + I64 i,j,k,c; + CColorROPU32 old_color; + CDC *src; + if (img->width && img->height) { + old_color=img->color; + img->color=bkcolor; + while (width-->0) { + src=DCExt(img,0,0,img->width-1,img->height-1); + for (i=0;iheight;i++) + for (j=0;jwidth;j++) + if (GrPeek(src,j,i)!=bkcolor) + for (k=0;k<8;k++) { + c=GrPeek(src,j+gr_x_offsets[k],i+gr_y_offsets[k]); + if (c<0 || c==bkcolor) { + GrPlot(img,j,i); + break; + } + } + DCDel(src); + } + img->color=old_color; + } +} + +I64 SpriteBitMapEd(CDoc *,CDocEntry *doc_e,CDC *dc,I64 *_xx1,I64 *_yy1, + I64 *_xx2,I64 *_yy2,CDC **_img,CColorROPU32 bkcolor) +{ + I64 i,j,mode=GBM_LINE,color=BLACK,width=1,msg_code,a1,a2,x1,y1,x11,y11, + x22,y22,res,xx1=*_xx1,yy1=*_yy1,xx2=*_xx2,yy2=*_yy2, + old_de_flags=doc_e->de_flags; + Bool down=FALSE; + U8 *st=NULL; + CEdFileName filename; + CDC *img=*_img, + *clipboard=NULL,*undo=NULL,*dc2; + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + + doc_e->de_flags|=DOCEF_DONT_DRAW; + goto bm_menu; + + while (TRUE) { + if (kbd.scan_code&SCF_CTRL)//grab scroll update? + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + + dc->color=ROPF_DITHER+WHITE<<16+BLACK; + dc->pen_width=1; + GrBorder(dc,xx1-1,yy1-1,xx2,yy2);//This is done little bit too often. + + while (msg_code=ScanMsg(&a1,&a2,1<task_title,"Sprite BitMap Menu"); + i=PopUpSpriteBitMap(color,width); + if (i>=0) + StrCpy(Fs->task_title,DefineSub(i,"ST_SPRITE_BITMAP_MENU")); + switch (i) { + case DOCM_CANCEL: + res=GE_ABORT; + goto bm_done; + case GBM_EXIT: + res=GE_EXIT; + goto bm_done; + case GBM_MAIN_MENU: + res=GE_CONT; + goto bm_done; + case GBM_COLOR: + i=PopUpColor(,,FALSE); + if (i>=0) color=i; + goto bm_menu; + case GBM_FIND_AND_REPLACE: + i=PopUpColor("Find Color\n",,FALSE); + if (i>=0) { + j=PopUpColor("Replace Color\n",,FALSE); + if (j>=0) { + DCColorChg(img,i,j); + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + } + } + goto bm_menu; + case GBM_TRIM_TO_EXTENTS: + GrBitMapEdTrimToExtents(&img,&xx1,&yy1,&xx2,&yy2,bkcolor); + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + goto bm_menu; + case GBM_ADD_OUTLINE: + i=PopUpRangeI64(1,16,1,"Outline Width\n"); + if (i>=0) { + GrBitMapEdAddOutline(img,i,color,bkcolor); + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + } + goto bm_menu; + case GBM_ETCH: + i=PopUpRangeI64(1,16,1,"Etch Width\n"); + if (i>=0) { + GrBitMapEdEtch(img,i,bkcolor); + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + } + goto bm_menu; + case GBM_SAVE_BMP: + *filename.name=0; + if (DocForm(&filename) && *filename.name) + BMPWrite(filename.name,img); + goto bm_menu; + case GBM_SAVE_GRA: + *filename.name=0; + if (DocForm(&filename) && *filename.name) + GRAWrite(filename.name,img,DCSF_COMPRESSED|DCSF_PALETTE_GET); + goto bm_menu; + case GBM_DITHER_COLOR: + i=PopUpColorDither; + if (i>=0) color=i; + goto bm_menu; + case GBM_WIDTH: + i=PopUpRangeI64(1,16,1,"Pen Width\n"); + if (i>=0) width=i; + goto bm_menu; + case GBM_UNDO: + if (undo) { + DCFill(img,bkcolor); + img->color=ROP_EQU; + GrBlot(img,0,0,undo); + DCDel(undo); + undo=NULL; + } + goto bm_menu; + case GBM_PT: + case GBM_LINE: + case GBM_ARROW: + case GBM_RECT: + case GBM_CIRCLE: + case GBM_FLOOD_FILL: + case GBM_FLOOD_FILL_NOT: + case GBM_POLYPT: + case GBM_POLYLINE: + case GBM_COPY: + case GBM_DELETE: + case GBM_PASTE: + case GBM_PASTE_TRANSPARENT: + mode=i; + break; + case GBM_TEXT: + case GBM_TEXT_BOX: + case GBM_TEXT_DIAMOND: + Free(st); + st=PopUpGetStr("Enter text and press .\n"); + if (st && *st) + mode=i; + else + goto bm_menu; + break; + } + DCDel(undo); + undo=DCExt(img,0,0,img->width-1,img->height-1); + undo->bkcolor=bkcolor; + WinMgrSync(2,TRUE); //Let popup close + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + down=FALSE; + break; + case MSG_IP_L_DOWN: + switch (mode) { + case GBM_PT: + img->color=color; + img->pen_width=width; + GrPlot3(img,a1-xx1,a2-yy1,0); + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + break; + start: + if (down) + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + x1=a1; y1=a2; + down=TRUE; + dc->color=color; + dc->pen_width=width; + case GBM_LINE: + GrLine3(dc,x1,y1,0,a1,a2,0); + break; + case GBM_ARROW: + GrArrow3(dc,x1,y1,0,a1,a2,0); + break; + case GBM_RECT: + GrRect(dc,x1,y1,1,1); + break; + case GBM_CIRCLE: + GrCircle3(dc,x1,y1,0,1); + break; + case GBM_COPY: + case GBM_DELETE: + dc->color=ROPF_DITHER+WHITE<<16+BLACK; + dc->pen_width=1; + GrBorder(dc,x1,y1,x1,y1); + break; + end: + break; + case GBM_PASTE: + case GBM_PASTE_TRANSPARENT: + if (clipboard) { + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + if (mode==GBM_PASTE) { + clipboard->flags|=DCF_NO_TRANSPARENTS; + GrBlot(dc,a1,a2,clipboard); + clipboard->flags&=~DCF_NO_TRANSPARENTS; + } else { + dc2=DCCopy(clipboard); + DCColorChg(dc2,bkcolor); + GrBlot(dc,a1,a2,dc2); + DCDel(dc2); + } + } + break; + case GBM_TEXT: + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + dc->color=color; + GrPrint(dc,a1,a2,"%s",st); + break; + case GBM_TEXT_BOX: + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + dc->color=color; + GrTextBox3(dc,a1,a2,0,st); + break; + case GBM_TEXT_DIAMOND: + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + dc->color=color; + GrTextDiamond3(dc,a1,a2,0,st); + break; + case GBM_FLOOD_FILL: + img->color=color; + GrFloodFill(img,a1-xx1,a2-yy1); + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + break; + case GBM_FLOOD_FILL_NOT: + img->color=color; + GrFloodFill(img,a1-xx1,a2-yy1,TRUE); + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + break; + case GBM_POLYLINE: + if (!down) { + x1=a1; y1=a2; + down=TRUE; + dc->color=color; + dc->pen_width=width; + GrLine3(dc,x1,y1,0,a1,a2,0); + } + break; + case GBM_POLYPT: + x1=a1; y1=a2; + down=TRUE; + img->color=color; + img->pen_width=width; + GrLine3(img,x1-xx1,y1-yy1,0,a1-xx1,a2-yy1,0); + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + break; + } + break; + case MSG_IP_MOVE: + switch (mode) { + case GBM_LINE: + case GBM_ARROW: + case GBM_POLYLINE: + if (down) { + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + dc->color=color; + dc->pen_width=width; + if (mode==GBM_ARROW) + GrArrow3(dc,x1,y1,0,a1,a2,0); + else + GrLine3(dc,x1,y1,0,a1,a2,0); + } + break; + case GBM_RECT: + if (down) { + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + if (x1color=color; + GrRect(dc,x11,y11,x22-x11+1,y22-y11+1); + } + break; + case GBM_COPY: + case GBM_DELETE: + if (down) { + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + if (x1color=ROPF_DITHER+WHITE<<16+BLACK; + dc->pen_width=1; + GrBorder(dc,x11,y11,x22,y22); + } + break; + case GBM_CIRCLE: + if (down) { + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + dc->color=color; + dc->pen_width=width; + GrCircle3(dc,x1,y1,0,Sqrt(SqrI64(a1-x1)+SqrI64(a2-y1))); + } + break; + case GBM_PASTE: + case GBM_PASTE_TRANSPARENT: + if (clipboard) { + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + if (mode==GBM_PASTE) { + clipboard->flags|=DCF_NO_TRANSPARENTS; + GrBlot(dc,a1,a2,clipboard); + clipboard->flags&=~DCF_NO_TRANSPARENTS; + } else { + dc2=DCCopy(clipboard); + DCColorChg(dc2,bkcolor); + GrBlot(dc,a1,a2,dc2); + DCDel(dc2); + } + } + break; + case GBM_TEXT: + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + dc->color=color; + GrPrint(dc,a1,a2,"%s",st); + break; + case GBM_TEXT_BOX: + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + dc->color=color; + GrTextBox3(dc,a1,a2,0,st); + break; + case GBM_TEXT_DIAMOND: + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + dc->color=color; + GrTextDiamond3(dc,a1,a2,0,st); + break; + case GBM_POLYPT: + if (down) { + img->color=color; + img->pen_width=width; + GrLine3(img,x1-xx1,y1-yy1,0,a1-xx1,a2-yy1,0); + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + x1=a1; y1=a2; + } + break; + } + break; + case MSG_IP_L_UP: + switch (mode) { + case GBM_LINE: + case GBM_ARROW: + case GBM_POLYPT: + case GBM_POLYLINE: + img->color=color; + img->pen_width=width; + if (mode==GBM_ARROW) + GrArrow3(img,x1-xx1,y1-yy1,0,a1-xx1,a2-yy1,0); + else + GrLine3(img,x1-xx1,y1-yy1,0,a1-xx1,a2-yy1,0); + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + if (mode==GBM_POLYLINE) { + x1=a1; y1=a2; + } else + down=FALSE; + break; + case GBM_RECT: + img->color=color; + if (x1bkcolor=bkcolor; + if (mode==GBM_DELETE) { + img->color=bkcolor; + GrRect(img,x11-xx1,y11-yy1,x22-x11+1,y22-y11+1); + } + goto bm_menu; + case GBM_CIRCLE: + img->color=color; + img->pen_width=width; + GrCircle3(img,x1-xx1,y1-yy1,0,Sqrt(SqrI64(a1-x1)+SqrI64(a2-y1))); + down=FALSE; + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + break; + case GBM_PASTE: + case GBM_PASTE_TRANSPARENT: + if (clipboard) { + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + if (mode==GBM_PASTE) { + clipboard->flags|=DCF_NO_TRANSPARENTS; + GrBlot(img,a1-xx1,a2-yy1,clipboard); + clipboard->flags&=~DCF_NO_TRANSPARENTS; + } else { + dc2=DCCopy(clipboard); + DCColorChg(dc2,bkcolor); + GrBlot(img,a1-xx1,a2-yy1,dc2); + DCDel(dc2); + } + GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img); + } + break; + case GBM_TEXT: + img->color=color; + GrPrint(img,a1-xx1,a2-yy1,"%s",st); + goto bm_menu; + case GBM_TEXT_BOX: + img->color=color; + GrTextBox3(img,a1-xx1,a2-yy1,0,st); + goto bm_menu; + case GBM_TEXT_DIAMOND: + img->color=color; + GrTextDiamond3(img,a1-xx1,a2-yy1,0,st); + goto bm_menu; + } + break; + } + } + WinMgrSync; + } +bm_key_up_done: + GetMsg(,,1<de_flags=old_de_flags; + *_img=img; + *_xx1=xx1,*_yy1=yy1,*_xx2=xx2,*_yy2=yy2; + return res; +} diff --git a/Adam/Gr/SpriteCode.CPP b/Adam/Gr/SpriteCode.HC similarity index 100% rename from Adam/Gr/SpriteCode.CPP rename to Adam/Gr/SpriteCode.HC diff --git a/Adam/Gr/SpriteEd.CPP b/Adam/Gr/SpriteEd.CPP deleted file mode 100644 index 934d8c5..0000000 --- a/Adam/Gr/SpriteEd.CPP +++ /dev/null @@ -1,1241 +0,0 @@ -#help_index "Graphics/Sprite;Sprites" - -CSprite *SpriteSetSettings(CDC *dc=NULL,CSprite *head,I64 elem_num, - I64 x=0,I64 y=0,CColorROPU32 *_color=NULL,I64 *_width=NULL, - I64 *_xx=NULL,I64 *_yy=NULL) -{ - CSprite *res=head->next; - I64 width=1,xx=0,yy=0; - CColorROPU32 color=BLACK; - if (dc) DCRst(dc); - while (elem_num-->0 && res!=head) { - switch (res->type) { - case SPT_COLOR: - color=res->c.color; - if (dc) dc->color=color; - break; - case SPT_DITHER_COLOR: - color=res->d.dither_color.u8[0]| - res->d.dither_color.u8[1]<color=color; - break; - case SPT_WIDTH: - width=res->w.width; - if (dc) dc->pen_width=width; - break; - case SPT_SHIFT: - xx+=res->p.x1; - yy+=res->p.y1; - x+=res->p.x1; - y+=res->p.y1; - break; - case SPT_PLANAR_SYMMETRY: - if (dc) { - if (DCSymmetry3Set(dc,res->pp.x1+x,res->pp.y1+y,0, - res->pp.x2+x,res->pp.y2+y,0, - res->pp.x2+x,res->pp.y2+y,1)) - dc->flags|=DCF_SYMMETRY; - else - dc->flags&=~DCF_SYMMETRY; - } - break; - } - res=res->next; - } - if (_color) *_color=color; - if (_width) *_width=width; - if (_xx) *_xx=xx; - if (_yy) *_yy=yy; - return res; -} - -Bool SpritePolyPtPlot(CSprite *head,I64 x,I64 y,I64) -{ - CSprite *tempg=CAlloc(SpriteElemQuedBaseSize(SPT_PT)); - tempg->type=SPT_PT; - tempg->p.x1=x; - tempg->p.y1=y; - QueIns(tempg,head->last); - return TRUE; -} - -CSprite *Sprite2SpriteQue(U8 *elems) -{ - I64 s; - CSprite *res=CAlloc(sizeof(CSprite)), - *tempg=elems-offset(CSprite.start),*tempg1; - QueInit(res); - while (tempg->type) { - tempg1=MAlloc(SpriteElemSize(tempg)+offset(CSprite.start)); - s=SpriteElemSize(tempg); - MemCpy(&tempg1->start,&tempg->start,s); - tempg1->sel=FALSE; - QueIns(tempg1,res->last); - tempg(U8 *)+=s; - } - return res; -} - -U8 *SpriteQue2Sprite(CSprite *head,I64 *_size=NULL) -{ - I64 i,size=sprite_elem_base_sizes[SPT_END]; - CSprite *tempg=head->next; - U8 *res,*dst; - while (tempg!=head) { - size+=SpriteElemSize(tempg); - tempg=tempg->next; - } - if (_size) *_size=size; - res=dst=MAlloc(size); - tempg=head->next; - while (tempg!=head) { - i=SpriteElemSize(tempg); - MemCpy(dst,&tempg->start,i); - dst+=i; - tempg=tempg->next; - } - *dst=SPT_END; - return res; -} - -U0 SpriteEdUpdate(CDoc *doc,CDocEntry *doc_ce,CSprite *head) -{ - CDocBin *tempb=doc_ce->bin_data; - I64 size; - Bool unlock=DocLock(doc); - Free(tempb->data); - tempb->data=SpriteQue2Sprite(head,&size); - tempb->size=size; - if (unlock) - DocUnlock(doc); -} - -U0 SpriteSetOrigin(CSprite *head,I64 dx,I64 dy,I64 dz) -{ - I64 i; - I32 *ptr; - CD3I32 *p; - CSprite *tempg=head->next; - while (tempg!=head) { - if (tempg->sel) - switch (tempg->type) { - case SPT_ARROW: - case SPT_LINE: - case SPT_PLANAR_SYMMETRY: - case SPT_RECT: - case SPT_ROTATED_RECT: - tempg->pp.x2+=dx; - tempg->pp.y2+=dy; - case SPT_PT: - case SPT_FLOOD_FILL: - case SPT_FLOOD_FILL_NOT: - case SPT_TEXT: - case SPT_TEXT_BOX: - case SPT_TEXT_DIAMOND: - case SPT_CIRCLE: - case SPT_BITMAP: - case SPT_ELLIPSE: - case SPT_POLYGON: - tempg->p.x1+=dx; - tempg->p.y1+=dy; - break; - case SPT_POLYLINE: - ptr=&tempg->nu.u; - for (i=0;inu.num;i++) { - ptr[i<<1]+=dx; - ptr[i<<1+1]+=dy; - } - break; - case SPT_POLYPT: - tempg->npu.x+=dx; - tempg->npu.y+=dy; - break; - case SPT_BSPLINE2: - case SPT_BSPLINE3: - case SPT_BSPLINE2_CLOSED: - case SPT_BSPLINE3_CLOSED: - p=&tempg->nu.u; - for (i=0;inu.num;i++,p++) { - p->x+=dx; - p->y+=dy; - p->z+=dz; - } - break; - case SPT_MESH: - p=&tempg->mu.u; - for (i=0;imu.vertex_cnt;i++,p++) { - p->x+=dx; - p->y+=dy; - p->z+=dz; - } - break; - case SPT_SHIFTABLE_MESH: - tempg->pmu.x+=dx; - tempg->pmu.y+=dy; - tempg->pmu.z+=dz; - break; - } - tempg=tempg->next; - } -} - -CSprite *SpriteTransformCircle(I64 *r,CSprite *tempg) -{ - I64 x,y,z; - F64 m1,a1,m2,radius=tempg->pr.radius<<16; - CSprite *tempg1=CAlloc(SpriteElemQuedBaseSize(SPT_ELLIPSE)); - tempg1->type=SPT_ELLIPSE; - - x=tempg->pr.x1; y=tempg->pr.y1; z=0; - Mat4x4MulXYZ(r,&x,&y,&z); - tempg1->pwha.x1=x; - tempg1->pwha.y1=y; - - x=radius; y=0; z=0; - Mat4x4MulXYZ(r,&x,&y,&z); - R2P(&m1,&a1,x,y); - - x=0; y=radius; z=0; - Mat4x4MulXYZ(r,&x,&y,&z); - m2=Sqrt(x*x+y*y); - - tempg1->pwha.width =ToI64(m1)/0x10000; - tempg1->pwha.height=ToI64(m2)/0x10000; - tempg1->pwha.angle=-a1; - - tempg1->sel=tempg->sel; - return tempg1; -} - -CSprite *SpriteTransformEllipse(I64 *r,CSprite *tempg) -{ - I64 x,y,z; - F64 m1,a1,m2,a2,s,c,x_radius=tempg->pwha.width<<16, - y_radius=tempg->pwha.height<<16; - CSprite *tempg1=CAlloc(SpriteElemQuedBaseSize(tempg->type)); - tempg1->type=tempg->type; - if (tempg->type==SPT_POLYGON) - tempg1->pwhas.sides=tempg->pwhas.sides; - - x=tempg->pwha.x1; y=tempg->pwha.y1; z=0; - Mat4x4MulXYZ(r,&x,&y,&z); - tempg1->pwha.x1=x; - tempg1->pwha.y1=y; - - c=Cos(-tempg->pwha.angle); - s=Sin(-tempg->pwha.angle); - - x=x_radius*c; - y=x_radius*s; - z=0; - Mat4x4MulXYZ(r,&x,&y,&z); - R2P(&m1,&a1,x,y); - - x=-y_radius*s; - y=y_radius*c; - z=0; - Mat4x4MulXYZ(r,&x,&y,&z); - R2P(&m2,&a2,x,y); - m2*=Abs(Sin(a2-a1)); - - tempg1->pwha.width=ToI64(m1)/0x10000; - if (tempg1->pwha.width<1) tempg1->pwha.width=1; - tempg1->pwha.height=ToI64(m2)/0x10000; - if (tempg1->pwha.height<1) tempg1->pwha.height=1; - tempg1->pwha.angle=-a1; - - tempg1->sel=tempg->sel; - return tempg1; -} - -CSprite *SpriteTransformRect(I64 *r,CSprite *tempg,F64 é) -{ - I64 x,y,z,w,h; - F64 m1,a1,m2,a2,s,c, - x_radius=(tempg->pp.x2-tempg->pp.x1)<<16, - y_radius=(tempg->pp.y2-tempg->pp.y1)<<16; - CSprite *tempg1=CAlloc(SpriteElemQuedBaseSize(SPT_ROTATED_RECT)); - tempg1->type=SPT_ROTATED_RECT; - - x=tempg->pp.x1; y=tempg->pp.y1; z=0; - Mat4x4MulXYZ(r,&x,&y,&z); - tempg1->ppa.x1=x; - tempg1->ppa.y1=y; - - c=Cos(-é); - s=Sin(-é); - - x=x_radius*c; - y=x_radius*s; - z=0; - Mat4x4MulXYZ(r,&x,&y,&z); - R2P(&m1,&a1,x,y); - - x=-y_radius*s; - y=y_radius*c; - z=0; - Mat4x4MulXYZ(r,&x,&y,&z); - R2P(&m2,&a2,x,y); - m2*=Abs(Sin(a2-a1)); - - w=ToI64(m1)/0x10000; - if (w<1) w=1; - h=ToI64(m2)/0x10000; - if (h<1) h=1; - tempg1->ppa.x2=tempg1->ppa.x1+w; - tempg1->ppa.y2=tempg1->ppa.y1+h; - tempg1->ppa.angle=-a1; - - tempg1->sel=tempg->sel; - return tempg1; -} - -CSprite *SpriteTransformBitMap(I64 *r,CSprite *tempg) -{ - CDC *img,*dc3; - U8 *elems; - I64 x,y,z,minx,maxx,miny,maxy,minz,maxz; - CSprite *tempg1; - - x=0; y=0; z=0; - Mat4x4MulXYZ(r,&x,&y,&z); - minx=maxx=x; - miny=maxy=y; - minz=maxz=z; - - x=0; y=tempg->pwhu.height; z=0; - Mat4x4MulXYZ(r,&x,&y,&z); - if (xmaxx) maxx=x; - if (ymaxx) maxy=y; - if (zmaxx) maxz=z; - - x=tempg->pwhu.width; y=0; z=0; - Mat4x4MulXYZ(r,&x,&y,&z); - if (xmaxx) maxx=x; - if (ymaxx) maxy=y; - if (zmaxx) maxz=z; - - x=tempg->pwhu.width; y=tempg->pwhu.height; z=0; - Mat4x4MulXYZ(r,&x,&y,&z); - if (xmaxx) maxx=x; - if (ymaxx) maxy=y; - if (zmaxx) maxz=z; - - dc3=DCNew(maxx-minx+1,maxy-miny+1); - - img=CAlloc(sizeof(CDC)); - img->width=tempg->pwhu.width; - img->width_internal=(tempg->pwhu.width+7)&~7; - img->height=tempg->pwhu.height; - img->body=&tempg->pwhu.u; - img->dc_signature=DCS_SIGNATURE_VAL; - - dc3->color=TRANSPARENT; - GrRect(dc3,0,0,maxx-minx+1,maxy-miny+1); - - Free(dc3->r); - DCMat4x4Set(dc3,r); - dc3->flags|=DCF_TRANSFORMATION; - - dc3->x=-minx; - dc3->y=-miny; - dc3->z=-minz; - GrBlot3(dc3,0,0,0,img); - Free(img); - - elems=DC2Sprite(dc3); - dc3->r=NULL; - DCDel(dc3); - tempg1=CAlloc(offset(CSprite.start)+MSize(elems)); - MemCpy(tempg1(U8 *)+offset(CSprite.start),elems,MSize(elems)); - tempg1->type=tempg->type; - - x=tempg->pwhu.x1; y=tempg->pwhu.y1; z=0; - Mat4x4MulXYZ(r,&x,&y,&z); - tempg1->pwhu.x1=x; - tempg1->pwhu.y1=y; - - x=0; y=0; z=0; - Mat4x4MulXYZ(r,&x,&y,&z); - tempg1->pwhu.x1+=minx-x; - tempg1->pwhu.y1+=miny-y; - - return tempg1; -} - -U0 SpriteTransform(I64 *r,CSprite *head) -{ - I64 i,j,k,num, - x,y,z,x1,y1,z1,x2,y2,z2,x3,y3,z3; - I32 *ptr; - CD3I32 *p; - CSprite *tempg=head->next,head2,*tempg1,*tempg2,*tempg3; - while (tempg!=head) { - if (tempg->sel) - switch (tempg->type) { - case SPT_WIDTH: - tempg->w.width*=Sqrt(Mat4x4NormSqr65536(r))/65536; - if (tempg->w.width<0) tempg->w.width=0; - break; - case SPT_PLANAR_SYMMETRY: - case SPT_ARROW: - case SPT_LINE: - x=tempg->pp.x2; y=tempg->pp.y2; z=0; - Mat4x4MulXYZ(r,&x,&y,&z); - tempg->pp.x2=x; - tempg->pp.y2=y; - case SPT_PT: - case SPT_FLOOD_FILL: - case SPT_FLOOD_FILL_NOT: - case SPT_TEXT: - case SPT_TEXT_BOX: - case SPT_TEXT_DIAMOND: - x=tempg->p.x1; y=tempg->p.y1; z=0; - Mat4x4MulXYZ(r,&x,&y,&z); - tempg->p.x1=x; - tempg->p.y1=y; - break; - case SPT_BITMAP: - tempg1=SpriteTransformBitMap(r,tempg); - QueIns(tempg1,tempg); - QueRem(tempg); - Free(tempg); - tempg=tempg1; - break; - case SPT_ROTATED_RECT: - tempg1=SpriteTransformRect(r,tempg,tempg->ppa.angle); - QueIns(tempg1,tempg); - QueRem(tempg); - Free(tempg); - tempg=tempg1; - break; - case SPT_RECT: - tempg1=SpriteTransformRect(r,tempg,0); - QueIns(tempg1,tempg); - QueRem(tempg); - Free(tempg); - tempg=tempg1; - break; - case SPT_CIRCLE: - tempg1=SpriteTransformCircle(r,tempg); - QueIns(tempg1,tempg); - QueRem(tempg); - Free(tempg); - tempg=tempg1; - break; - case SPT_ELLIPSE: - case SPT_POLYGON: - tempg1=SpriteTransformEllipse(r,tempg); - QueIns(tempg1,tempg); - QueRem(tempg); - Free(tempg); - tempg=tempg1; - break; - case SPT_POLYLINE: - ptr=&tempg->nu.u; - for (i=0;inu.num;i++) { - x=ptr[i<<1]; y=ptr[i<<1+1]; z=0; - Mat4x4MulXYZ(r,&x,&y,&z); - ptr[i<<1]=x; - ptr[i<<1+1]=y; - } - break; - case SPT_POLYPT: - QueInit(&head2); - x=tempg->npu.x; y=tempg->npu.y; z=0; - x1=x; y1=y; z1=z; //unrotated cur coordinates - Mat4x4MulXYZ(r,&x,&y,&z); - ptr=&tempg->npu.u; - k=tempg->npu.num*3; - x2=x; y2=y; z2=z; //rotated start coordinates - x3=x; y3=y; z3=z; //lag 1 rotated coordinates - for (i=0;inext; - if (tempg1->p.x1==x3 && tempg1->p.y1==y3) { - QueRem(tempg1); - Free(tempg1); - } else { - num++; - x3=tempg1->p.x1; - y3=tempg1->p.y1; - } - tempg1=tempg2; - } - - tempg3=CAlloc(SpriteElemQuedBaseSize(SPT_POLYPT)+(num*3+7)>>3); - tempg3->npu.x=x2; - tempg3->npu.y=y2; - ptr=&tempg3->npu.u; - x3=0;y3=0; z3=0; - i=0; - tempg1=head2.next; - while (tempg1!=&head2) { - tempg2=tempg1->next; - BFieldOrU32(ptr,i, - polypt_map[SignI64(tempg1->p.x1-x3)+1+ - 3*(SignI64(tempg1->p.y1-y3)+1)]); - i+=3; - x3=tempg1->p.x1;y3=tempg1->p.y1; - QueRem(tempg1); - Free(tempg1); - tempg1=tempg2; - } - tempg3->type=SPT_POLYPT; - tempg3->npu.num=num; - QueIns(tempg3,tempg); - QueRem(tempg); - tempg3->sel=tempg->sel; - Free(tempg); - tempg=tempg3; - break; - case SPT_BSPLINE2: - case SPT_BSPLINE3: - case SPT_BSPLINE2_CLOSED: - case SPT_BSPLINE3_CLOSED: - p=&tempg->nu.u; - for (i=0;inu.num;i++,p++) { - x=p->x; y=p->y; z=p->z; - Mat4x4MulXYZ(r,&x,&y,&z); - p->x=x; - p->y=y; - p->z=z; - } - break; - case SPT_SHIFTABLE_MESH: - x=tempg->pmu.x; y=tempg->pmu.y; z=tempg->pmu.z; - Mat4x4MulXYZ(r,&x,&y,&z); - tempg->pmu.x=x; - tempg->pmu.y=y; - tempg->pmu.z=z; - p=&tempg->pmu.u; - for (i=0;ipmu.vertex_cnt;i++,p++) { - x=p->x; y=p->y; z=p->z; - Mat4x4MulXYZ(r,&x,&y,&z); - p->x=x; - p->y=y; - p->z=z; - } - break; - case SPT_MESH: - p=&tempg->mu.u; - for (i=0;imu.vertex_cnt;i++,p++) { - x=p->x; y=p->y; z=p->z; - Mat4x4MulXYZ(r,&x,&y,&z); - p->x=x; - p->y=y; - p->z=z; - } - break; - } - tempg=tempg->next; - } -} - -I64 SpriteQueSelCnt(CSprite *head,Bool val=TRUE) -{ - I64 res=0; - CSprite *tempg=head->next; - val=ToBool(val); - while (tempg!=head) { - if (ToBool(tempg->sel)==val) - res++; - tempg=tempg->next; - } - return res; -} - -I64 SpriteQueSelAll(CSprite *head,Bool val=TRUE) -{ - I64 res=0; - CSprite *tempg=head->next; - while (tempg!=head) { - tempg->sel=val; - res++; - tempg=tempg->next; - } - return res; -} - -CSprite *SpriteSideBar2SpriteQue(CDoc *doc,CSprite *head,I64 *_cur_elem_num) -{//For the side-bar - CSprite *res=CAlloc(sizeof(CSprite)),*tempg; - CDocEntry *doc_e=doc->head.next; - Bool found=FALSE; - I64 num=0; - QueInit(res); - while (doc_e!=doc) { - if (doc_e->type_u8==DOCT_MENU_VAL && doc_e->left_exp>=0) { - tempg=SpriteSetSettings(,head,doc_e->left_exp); - if (tempg!=head) { - tempg=MAllocIdent(tempg); - tempg->sel=Bt(&doc_e->type,DOCEt_SEL); - if (*_cur_elem_num==doc_e->left_exp) { - *_cur_elem_num=num; - found=TRUE; - } - QueIns(tempg,res->last); - num++; - } - } - doc_e=doc_e->next; - } - if (!found) - *_cur_elem_num=num; - QueDel(head); - Free(head); - return res; -} - -U0 SpriteSideBarPickNew(CDoc *doc,CSprite *head,I64 old_num) -{ - CSprite *tempg; - CDocEntry *doc_cur_e=NULL,*doc_e; - I64 cur_elem_num=0; - U8 *st; - DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Sprite SideBar\"$$\n" - "$$LK+PU+CX,\"Click for Help\"," - "A=\"FI:::/Doc/SpriteSideBar.TXT.Z\"$$\n\n"); - tempg=head->next; - while (tempg!=head) { - st=SpriteElem2Summary(tempg); - if (cur_elem_num==old_num) { - DocPrint(doc,"$$LTRED$$"); - doc_e=doc_cur_e=DocPrint(doc,"$$MU-UL,\"%Q\",LE=%d$$\n",st,cur_elem_num++); - } else { - DocPrint(doc,"$$LTBLUE$$"); - doc_e=DocPrint(doc,"$$MU-UL,\"%$$Q\",LE=%d$$\n",st,cur_elem_num++); - } - BEqu(&doc_e->de_flags,DOCEf_SEL,tempg->sel); - BEqu(&doc_e->type,DOCEt_SEL,tempg->sel); - Free(st); - tempg=tempg->next; - } - if (cur_elem_num==old_num) { - DocPrint(doc,"$$LTRED$$"); - doc_cur_e=DocPrint(doc,"$$MU-UL,\"END\",LE=%d$$\n",cur_elem_num); - } else { - DocPrint(doc,"$$LTBLUE$$"); - DocPrint(doc,"$$MU-UL,\"END\",LE=%d$$\n",cur_elem_num); - } - if (doc_cur_e) - doc->cur_entry=doc_cur_e; -} - -U0 SpriteSideBarTask2(CTask *grand_parent) -{ - I64 w,h; - CTask *parent=Fs->parent_task,*pu_task; - while (TRUE) { - pu_task=grand_parent->popup_task; - if (TaskValidate(pu_task)) { - w=parent->win_right-parent->win_left; - WinHorz(pu_task->win_right+2,pu_task->win_right+2+w,parent); - h=parent->win_bottom-parent->win_top; - WinVert(pu_task->win_top,pu_task->win_top+h,parent); - } - WinMgrSync; - } -} - -U0 SpriteSideBarTask(CTask *parent,CSprite **_head,I64 *_cur_elem_num) -{ - CDocEntry *doc_e; - CDoc *doc=DocPut; - Spawn(&SpriteSideBarTask2,parent,"CSpriteTask",,Fs); - doc->flags|=DOCF_MIN_SIZE|DOCF_FORM; - while (TRUE) { - SpriteSideBarPickNew(doc,*_head,*_cur_elem_num); - DocHighlightCursor(,doc); - View; - doc_e=doc->cur_entry; - if (doc_e->type_u8==DOCT_MENU_VAL) - *_cur_elem_num=doc_e->left_exp; - *_head=SpriteSideBar2SpriteQue(doc,*_head,_cur_elem_num); - DocClear(doc); - } -} - -Bool SpriteEdText(CSprite **_head,I64 *_cur_elem_num) -{ - Bool res; - CSprite *head=*_head; - U8 *elems=SpriteQue2Sprite(head); - CDoc *doc=DocNew,*doc2,*old_put=DocPut; - StrPrint(doc->filename.name,"AI:0x%X",doc); - DocPrint(doc,"//$$PURPLE$$$$TX+CX,\"Sprite Edit as Text\"$$$$FG$$\n" - "//$$LK+PU+CX,\"Click for Help\"," - "A=\"FI:::/Doc/SpriteEdText.TXT.Z\"$$\n\n"); - Sprite2Code(doc,elems); - Free(elems); - while (TRUE) { - if (res=PopUpPrint("DocEd(0x%X,0x%X);",doc,0)) { - Fs->put_doc=doc2=DocNew; - "$$WW,1$$"; - if (elems=Code2Sprite(doc)) { - DocDel(doc2); - Fs->put_doc=old_put; - QueDel(head); - Free(head); - head=Sprite2SpriteQue(elems); - Free(elems); - *_cur_elem_num=QueCnt(head); //TODO: Might want to improve this. - break; - } else { - PopUpPrint("DocEd(0x%X,0x%X);",doc2,0); - DocDel(doc2); - Fs->put_doc=old_put; - } - } else - break; - } - DocDel(doc); - if (_head) *_head=head; - return res; -} - -#define GED_SEL_UNSEL_ALL 0 -#define GED_SEL 1 -#define GED_UNSEL 2 -#define GED_SHIFT_PTS 3 -#define GED_SHIFT_RECTS 4 -#define GED_SHIFT_SEL 5 -#define GED_TRANSFORM_SEL 6 -#define GED_SET_ORIGIN 7 -#define GED_SHIFT_SUB_ORIGIN 8 -#define GED_TEXT_ED 9 -#define GED_INS_CLIPBOARD 10 -#define GED_MAIN_MENU 11 -#define GED_EXIT 12 - -U0 GrInit3() -{ - DefineLstLoad("ST_SPRITE_ED_MENU","Select/Unselect All\0" - "Select\0Unselect\0Shift Points\0Shift Rects\0Shift Selected\0" - "Transform Selected\0Set Origin\0Insert Shift SubOrigin\0" - "Edit as Text\0Insert Clipboard\0Main Menu\0"); -} -GrInit3; - -I64 PopUpSpriteEd(CSprite **_head,I64 *_cur_elem_num) -{ - U8 *st; - CTask *pu_task; - I64 i; - CDoc *doc=DocNew; - DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Sprite Edit Menu\"$$\n" - "$$LK+PU+CX,\"Click for Help\",A=\"FI:::/Doc/SpriteEd.TXT.Z\"$$\n\n" - "$$LTBLUE$$$$MU-UL,\"Select/Unselect All\",LE=GED_SEL_UNSEL_ALL$$\n" - "$$MU-UL,\"Select Elems\",LE=GED_SEL$$\n" - "$$MU-UL,\"Unsel Elems\",LE=GED_UNSEL$$\n\n" - "$$MU-UL,\"Shift Points\",LE=GED_SHIFT_PTS$$\n" - "$$MU-UL,\"Shift Points with Rects\",LE=GED_SHIFT_RECTS$$\n" - "$$MU-UL,\"Shift Selected Elems\",LE=GED_SHIFT_SEL$$\n" - "$$MU-UL,\"Transform Selected Elems\",LE=GED_TRANSFORM_SEL$$\n\n" - "$$MU-UL,\"Set Origin\",LE=GED_SET_ORIGIN$$\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,\"Insert Clipboard Sprite's\",LE=GED_INS_CLIPBOARD$$\n\n" - "$$PURPLE$$$$MU-UL,\"+] Sprite Main Menu\",LE=GED_MAIN_MENU$$$$LTBLUE$$\n" - "$$MU-UL,\"Exit Sprite\",LE=GED_EXIT$$\n" - "$$MU-UL,\"Abort Sprite\",LE=DOCM_CANCEL$$"); - st=MStrPrint("SpriteSideBarTask(0x%X,0x%X,0x%X);",Fs,_head,_cur_elem_num); - PopUp(st,NULL,&pu_task); - Free(st); - i=PopUpMenu(doc); - if (TaskValidate(pu_task)) { - *_head=SpriteSideBar2SpriteQue(DocPut(pu_task),*_head,_cur_elem_num); - Kill(pu_task); - } - DocDel(doc); - return i; -} - -#define GSPT_SIMPLE_PT 0 -#define GSPT_WIDTH_HEIGHT 1 - -#define GSPF_SEL 1 - -class CEdSprite -{ - CEdSprite *next,*last; - I32 type,num,flags,xx,yy,zz; - I32 *x,*y,*z,*w,*h; -}; - -U0 SpritePtQueNew(U8 *elems,I64 x,I64 y,CEdSprite *head) -{ - I64 i,num=0; - I32 *ptr; - CD3I32 *p; - CEdSprite *temppe; - CSprite *tempg=elems-offset(CSprite.start); - QueInit(head); - while (tempg->type) { - switch (tempg->type) { - case SPT_ELLIPSE: - case SPT_POLYGON: - temppe=CAlloc(sizeof(CEdSprite)); - temppe->type=GSPT_WIDTH_HEIGHT; - temppe->xx=x; - temppe->yy=y; - temppe->x=&tempg->pwha.x1; - temppe->y=&tempg->pwha.y1; - temppe->w=&tempg->pwha.width; - temppe->h=&tempg->pwha.height; - temppe->num=num; - QueIns(temppe,head->last); - goto pq_x1_y1; - case SPT_RECT: - case SPT_ROTATED_RECT: - case SPT_LINE: - case SPT_ARROW: - case SPT_PLANAR_SYMMETRY: - temppe=CAlloc(sizeof(CEdSprite)); - temppe->type=GSPT_SIMPLE_PT; - temppe->xx=x; - temppe->yy=y; - temppe->x=&tempg->pp.x2; - temppe->y=&tempg->pp.y2; - temppe->num=num; - QueIns(temppe,head->last); - case SPT_TEXT: - case SPT_TEXT_BOX: - case SPT_TEXT_DIAMOND: - case SPT_PT: - case SPT_BITMAP: - case SPT_FLOOD_FILL: - case SPT_FLOOD_FILL_NOT: - case SPT_CIRCLE: -pq_x1_y1: - temppe=CAlloc(sizeof(CEdSprite)); - temppe->type=GSPT_SIMPLE_PT; - temppe->xx=x; - temppe->yy=y; - temppe->x=&tempg->p.x1; - temppe->y=&tempg->p.y1; - temppe->num=num; - QueIns(temppe,head->last); - break; - case SPT_SHIFT: - x+=tempg->p.x1; - y+=tempg->p.y1; - break; - case SPT_POLYLINE: - ptr=&tempg->nu.u; - for (i=0;inu.num;i++) { - temppe=CAlloc(sizeof(CEdSprite)); - temppe->type=GSPT_SIMPLE_PT; - temppe->xx=x; - temppe->yy=y; - temppe->x=&ptr[i<<1]; - temppe->y=&ptr[i<<1+1]; - temppe->num=num; - QueIns(temppe,head->last); - } - break; - case SPT_POLYPT: - temppe=CAlloc(sizeof(CEdSprite)); - temppe->type=GSPT_SIMPLE_PT; - temppe->xx=x; - temppe->yy=y; - temppe->x=&tempg->npu.x; - temppe->y=&tempg->npu.y; - temppe->num=num; - QueIns(temppe,head->last); - break; - case SPT_BSPLINE2: - case SPT_BSPLINE3: - case SPT_BSPLINE2_CLOSED: - case SPT_BSPLINE3_CLOSED: - p=&tempg->nu.u; - for (i=0;inu.num;i++) { - temppe=CAlloc(sizeof(CEdSprite)); - temppe->type=GSPT_SIMPLE_PT; - temppe->xx=x; - temppe->yy=y; - temppe->x=&p[i].x; - temppe->y=&p[i].y; - temppe->z=&p[i].z; - temppe->num=num; - QueIns(temppe,head->last); - } - break; - case SPT_MESH: - break; - case SPT_SHIFTABLE_MESH: - temppe=CAlloc(sizeof(CEdSprite)); - temppe->type=GSPT_SIMPLE_PT; - temppe->xx=x; - temppe->yy=y; - temppe->x=&tempg->pmu.x; - temppe->y=&tempg->pmu.y; - temppe->z=&tempg->pmu.z; - temppe->num=num; - QueIns(temppe,head->last); - break; - } - tempg(U8 *)+=SpriteElemSize(tempg); - num++; - } -} - -U0 SpriteCtrlPtsDraw(CDC *dc,CEdSprite *head) -{ - I64 x,y; - CEdSprite *temppe; - WinMgrSync; - DCFill(dc); - if (Blink(20)) { - temppe=head->next; - while (temppe!=head) { - switch (temppe->type) { - case GSPT_SIMPLE_PT: - x=*temppe->x+temppe->xx; - y=*temppe->y+temppe->yy; - break; - case GSPT_WIDTH_HEIGHT: - x=*temppe->w+*temppe->x+temppe->xx; - y=*temppe->h+*temppe->y+temppe->yy; - break; - } - if (temppe->flags&GSPF_SEL) - dc->color=RED; - else - dc->color=BLACK; - GrRect(dc,x-2,y-2,4,4); - dc->color=WHITE; - GrRect(dc,x-1,y-1,2,2); - temppe=temppe->next; - } - } -} - -U0 SpriteCtrlPtsMove(CEdSprite *head,I64 dx,I64 dy) -{ - CEdSprite *temppe; - temppe=head->next; - while (temppe!=head) { - if (temppe->flags&GSPF_SEL) - switch (temppe->type) { - case GSPT_SIMPLE_PT: - if (temppe->x) *temppe->x+=dx; - if (temppe->y) *temppe->y+=dy; - break; - case GSPT_WIDTH_HEIGHT: - if (temppe->w) *temppe->w+=dx; - if (temppe->h) *temppe->h+=dy; - break; - } - temppe=temppe->next; - } -} - -Bool SpriteShiftPts(U8 *elems,I64 x,I64 y,I64 *_cur_elem_num,I64 mode) -{ - I64 msg_code,a1,a2,xx,yy,xx2,yy2,dd,best_dd,cur_elem_num; - Bool res=TRUE; - CDC *dc=DCAlias; - CEdSprite head,*temppe,*best_pe; - - SpritePtQueNew(elems,x,y,&head); - cur_elem_num=0; - if (head.next!=&head) { - while (TRUE) { - SpriteCtrlPtsDraw(dc,&head); //has WinMgrSync - switch (msg_code=ScanMsg(&a1,&a2, - 1<type) { - case GSPT_SIMPLE_PT: - dd=SqrI64(*temppe->x+temppe->xx-xx)+ - SqrI64(*temppe->y+temppe->yy-yy); - break; - case GSPT_WIDTH_HEIGHT: - dd=SqrI64(*temppe->x+*temppe->w+temppe->xx-xx)+ - SqrI64(*temppe->y+*temppe->h+temppe->yy-yy); - break; - } - if (ddnext; - } - cur_elem_num=best_pe->num; - best_pe->flags|=GSPF_SEL; - break; - case GED_SHIFT_RECTS: - xx2=xx=a1; yy2=yy=a2; - while (TRUE) { - SpriteCtrlPtsDraw(dc,&head); - dc->color=ROPF_DITHER+WHITE<<16+RED; - GrBorder(dc,xx,yy,xx2,yy2); - if (msg_code=ScanMsg(&a1,&a2,1<type) { - case GSPT_SIMPLE_PT: - if (xx<=*temppe->x+temppe->xx<=xx2 && - yy<=*temppe->y+temppe->yy<=yy2) - temppe->flags|=GSPF_SEL; - break; - case GSPT_WIDTH_HEIGHT: - if (xx<=*temppe->x+*temppe->w+temppe->xx<=xx2 && - yy<=*temppe->y+*temppe->h+temppe->yy<=yy2) - temppe->flags|=GSPF_SEL; - break; - } - temppe=temppe->next; - } - do { - SpriteCtrlPtsDraw(dc,&head); - msg_code=ScanMsg(&a1,&a2,1<flags&=~GSPF_SEL; - temppe=temppe->next; - } - break; - case MSG_KEY_DOWN: -gs_key: - switch (a1.u8[0]) { - case CH_SHIFT_ESC: - res=FALSE; - case CH_ESC: - GetMsg(&a1,&a2,1<de_flags; - tempb=doc_ce->bin_data; - DocUnlock(doc); - SpriteQueSelAll(*_head,FALSE); - do { - if (winmgr.fps<10) - doc_ce->de_flags|=DOCEF_DONT_DRAW; - StrCpy(Fs->task_title,"Sprite Edit Menu"); - i=PopUpSpriteEd(_head,_cur_elem_num); - SpriteEdUpdate(doc,doc_ce,*_head); - if (0<=itask_title,DefineSub(i,"ST_SPRITE_ED_MENU")); - switch (i) { - case GED_SEL_UNSEL_ALL: - if (!SpriteQueSelCnt(*_head)) - SpriteQueSelAll(*_head); - else - SpriteQueSelAll(*_head,FALSE); - break; - case GED_SEL: - case GED_UNSEL: - doc_ce->de_flags=old_de_flags; - doc->cur_sprite=tempb->data; - do { - doc->nearest_sprite_elem_num=0; - msg_code=GetMsg(&a1,&a2,1<nearest_sprite_elem_num; - cur_elem=SpriteSetSettings(,*_head,*_cur_elem_num); - cur_elem->sel=ToBool(i==GED_SEL); - GetMsg(,,1<cur_sprite=NULL; - break; - case GED_SET_ORIGIN: - SpriteQueSelAll(*_head); - doc_ce->de_flags=old_de_flags; - GetMsg(&a1,&a2,1<de_flags=old_de_flags; - GetMsg(&a1,&a2,1<de_flags=old_de_flags; - if (SpriteShiftPts(tempb->data,x,y,_cur_elem_num,i)) { - QueDel(*_head); - Free(*_head); - *_head=Sprite2SpriteQue(tempb->data); - } else - SpriteEdUpdate(doc,doc_ce,*_head); - break; - case GED_TRANSFORM_SEL: - if (!SpriteQueSelCnt(*_head)) - SpriteQueSelAll(*_head); - if (PopUpTransform(r)) { - SpriteTransform(r,*_head); - SpriteEdUpdate(doc,doc_ce,*_head); - } - if (!SpriteQueSelCnt(*_head,FALSE)) - SpriteQueSelAll(*_head,FALSE); - break; - case GED_SHIFT_SUB_ORIGIN: - doc_ce->de_flags=old_de_flags; - insert_pt=SpriteSetSettings(,*_head,*_cur_elem_num); - tempg=CAlloc(SpriteElemQuedBaseSize(SPT_SHIFT)); - tempg->type=SPT_SHIFT; - tempg->p.x1=0; - tempg->p.y1=0; - QueIns(tempg,insert_pt->last); - GetMsg(&a1,&a2,1<p.x1=a1-xx; - tempg->p.y1=a2-yy; - SpriteEdUpdate(doc,doc_ce,*_head); - } while (msg_code!=MSG_IP_L_UP); - *_cur_elem_num+=1; - break; - case GED_INS_CLIPBOARD: - RegOneTimePopUp(ARf_CSPRITE_INS_CLIPBOARD, - "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) { - if (doc_e2->type_u8==DOCT_SPRITE) { - head2=Sprite2SpriteQue(doc_e2->bin_data->data); - if (head2->next!=head2) { - tempg=head2->next; - while (tempg!=head2) { - *_cur_elem_num+=1; - tempg=tempg->next; - } - next=head2->next; - last=head2->last; - insert_pt->last->next=next; - next->last=insert_pt->last; - insert_pt->last=last; - last->next=insert_pt; - } - Free(head2); - } - doc_e2=doc_e2->next; - } - if (unlock) - DocUnlock(sys_clipboard_doc); - SpriteEdUpdate(doc,doc_ce,*_head); - break; - case GED_TEXT_ED: - if (SpriteEdText(_head,_cur_elem_num)) - SpriteEdUpdate(doc,doc_ce,*_head); - break; - } - } - } while (i!=DOCM_CANCEL && i!=GED_EXIT && i!=GED_MAIN_MENU); - doc_ce->de_flags=old_de_flags; - - switch (i) { - case DOCM_CANCEL: return GE_ABORT; - case GED_EXIT: return GE_EXIT; - case GED_MAIN_MENU: return GE_CONT; - } -} diff --git a/Adam/Gr/SpriteEd.HC b/Adam/Gr/SpriteEd.HC new file mode 100644 index 0000000..c00648f --- /dev/null +++ b/Adam/Gr/SpriteEd.HC @@ -0,0 +1,1241 @@ +#help_index "Graphics/Sprite;Sprites" + +CSprite *SpriteSetSettings(CDC *dc=NULL,CSprite *head,I64 elem_num, + I64 x=0,I64 y=0,CColorROPU32 *_color=NULL,I64 *_width=NULL, + I64 *_xx=NULL,I64 *_yy=NULL) +{ + CSprite *res=head->next; + I64 width=1,xx=0,yy=0; + CColorROPU32 color=BLACK; + if (dc) DCRst(dc); + while (elem_num-->0 && res!=head) { + switch (res->type) { + case SPT_COLOR: + color=res->c.color; + if (dc) dc->color=color; + break; + case SPT_DITHER_COLOR: + color=res->d.dither_color.u8[0]| + res->d.dither_color.u8[1]<color=color; + break; + case SPT_WIDTH: + width=res->w.width; + if (dc) dc->pen_width=width; + break; + case SPT_SHIFT: + xx+=res->p.x1; + yy+=res->p.y1; + x+=res->p.x1; + y+=res->p.y1; + break; + case SPT_PLANAR_SYMMETRY: + if (dc) { + if (DCSymmetry3Set(dc,res->pp.x1+x,res->pp.y1+y,0, + res->pp.x2+x,res->pp.y2+y,0, + res->pp.x2+x,res->pp.y2+y,1)) + dc->flags|=DCF_SYMMETRY; + else + dc->flags&=~DCF_SYMMETRY; + } + break; + } + res=res->next; + } + if (_color) *_color=color; + if (_width) *_width=width; + if (_xx) *_xx=xx; + if (_yy) *_yy=yy; + return res; +} + +Bool SpritePolyPtPlot(CSprite *head,I64 x,I64 y,I64) +{ + CSprite *tempg=CAlloc(SpriteElemQuedBaseSize(SPT_PT)); + tempg->type=SPT_PT; + tempg->p.x1=x; + tempg->p.y1=y; + QueIns(tempg,head->last); + return TRUE; +} + +CSprite *Sprite2SpriteQue(U8 *elems) +{ + I64 s; + CSprite *res=CAlloc(sizeof(CSprite)), + *tempg=elems-offset(CSprite.start),*tempg1; + QueInit(res); + while (tempg->type) { + tempg1=MAlloc(SpriteElemSize(tempg)+offset(CSprite.start)); + s=SpriteElemSize(tempg); + MemCpy(&tempg1->start,&tempg->start,s); + tempg1->sel=FALSE; + QueIns(tempg1,res->last); + tempg(U8 *)+=s; + } + return res; +} + +U8 *SpriteQue2Sprite(CSprite *head,I64 *_size=NULL) +{ + I64 i,size=sprite_elem_base_sizes[SPT_END]; + CSprite *tempg=head->next; + U8 *res,*dst; + while (tempg!=head) { + size+=SpriteElemSize(tempg); + tempg=tempg->next; + } + if (_size) *_size=size; + res=dst=MAlloc(size); + tempg=head->next; + while (tempg!=head) { + i=SpriteElemSize(tempg); + MemCpy(dst,&tempg->start,i); + dst+=i; + tempg=tempg->next; + } + *dst=SPT_END; + return res; +} + +U0 SpriteEdUpdate(CDoc *doc,CDocEntry *doc_ce,CSprite *head) +{ + CDocBin *tempb=doc_ce->bin_data; + I64 size; + Bool unlock=DocLock(doc); + Free(tempb->data); + tempb->data=SpriteQue2Sprite(head,&size); + tempb->size=size; + if (unlock) + DocUnlock(doc); +} + +U0 SpriteSetOrigin(CSprite *head,I64 dx,I64 dy,I64 dz) +{ + I64 i; + I32 *ptr; + CD3I32 *p; + CSprite *tempg=head->next; + while (tempg!=head) { + if (tempg->sel) + switch (tempg->type) { + case SPT_ARROW: + case SPT_LINE: + case SPT_PLANAR_SYMMETRY: + case SPT_RECT: + case SPT_ROTATED_RECT: + tempg->pp.x2+=dx; + tempg->pp.y2+=dy; + case SPT_PT: + case SPT_FLOOD_FILL: + case SPT_FLOOD_FILL_NOT: + case SPT_TEXT: + case SPT_TEXT_BOX: + case SPT_TEXT_DIAMOND: + case SPT_CIRCLE: + case SPT_BITMAP: + case SPT_ELLIPSE: + case SPT_POLYGON: + tempg->p.x1+=dx; + tempg->p.y1+=dy; + break; + case SPT_POLYLINE: + ptr=&tempg->nu.u; + for (i=0;inu.num;i++) { + ptr[i<<1]+=dx; + ptr[i<<1+1]+=dy; + } + break; + case SPT_POLYPT: + tempg->npu.x+=dx; + tempg->npu.y+=dy; + break; + case SPT_BSPLINE2: + case SPT_BSPLINE3: + case SPT_BSPLINE2_CLOSED: + case SPT_BSPLINE3_CLOSED: + p=&tempg->nu.u; + for (i=0;inu.num;i++,p++) { + p->x+=dx; + p->y+=dy; + p->z+=dz; + } + break; + case SPT_MESH: + p=&tempg->mu.u; + for (i=0;imu.vertex_cnt;i++,p++) { + p->x+=dx; + p->y+=dy; + p->z+=dz; + } + break; + case SPT_SHIFTABLE_MESH: + tempg->pmu.x+=dx; + tempg->pmu.y+=dy; + tempg->pmu.z+=dz; + break; + } + tempg=tempg->next; + } +} + +CSprite *SpriteTransformCircle(I64 *r,CSprite *tempg) +{ + I64 x,y,z; + F64 m1,a1,m2,radius=tempg->pr.radius<<16; + CSprite *tempg1=CAlloc(SpriteElemQuedBaseSize(SPT_ELLIPSE)); + tempg1->type=SPT_ELLIPSE; + + x=tempg->pr.x1; y=tempg->pr.y1; z=0; + Mat4x4MulXYZ(r,&x,&y,&z); + tempg1->pwha.x1=x; + tempg1->pwha.y1=y; + + x=radius; y=0; z=0; + Mat4x4MulXYZ(r,&x,&y,&z); + R2P(&m1,&a1,x,y); + + x=0; y=radius; z=0; + Mat4x4MulXYZ(r,&x,&y,&z); + m2=Sqrt(x*x+y*y); + + tempg1->pwha.width =ToI64(m1)/0x10000; + tempg1->pwha.height=ToI64(m2)/0x10000; + tempg1->pwha.angle=-a1; + + tempg1->sel=tempg->sel; + return tempg1; +} + +CSprite *SpriteTransformEllipse(I64 *r,CSprite *tempg) +{ + I64 x,y,z; + F64 m1,a1,m2,a2,s,c,x_radius=tempg->pwha.width<<16, + y_radius=tempg->pwha.height<<16; + CSprite *tempg1=CAlloc(SpriteElemQuedBaseSize(tempg->type)); + tempg1->type=tempg->type; + if (tempg->type==SPT_POLYGON) + tempg1->pwhas.sides=tempg->pwhas.sides; + + x=tempg->pwha.x1; y=tempg->pwha.y1; z=0; + Mat4x4MulXYZ(r,&x,&y,&z); + tempg1->pwha.x1=x; + tempg1->pwha.y1=y; + + c=Cos(-tempg->pwha.angle); + s=Sin(-tempg->pwha.angle); + + x=x_radius*c; + y=x_radius*s; + z=0; + Mat4x4MulXYZ(r,&x,&y,&z); + R2P(&m1,&a1,x,y); + + x=-y_radius*s; + y=y_radius*c; + z=0; + Mat4x4MulXYZ(r,&x,&y,&z); + R2P(&m2,&a2,x,y); + m2*=Abs(Sin(a2-a1)); + + tempg1->pwha.width=ToI64(m1)/0x10000; + if (tempg1->pwha.width<1) tempg1->pwha.width=1; + tempg1->pwha.height=ToI64(m2)/0x10000; + if (tempg1->pwha.height<1) tempg1->pwha.height=1; + tempg1->pwha.angle=-a1; + + tempg1->sel=tempg->sel; + return tempg1; +} + +CSprite *SpriteTransformRect(I64 *r,CSprite *tempg,F64 é) +{ + I64 x,y,z,w,h; + F64 m1,a1,m2,a2,s,c, + x_radius=(tempg->pp.x2-tempg->pp.x1)<<16, + y_radius=(tempg->pp.y2-tempg->pp.y1)<<16; + CSprite *tempg1=CAlloc(SpriteElemQuedBaseSize(SPT_ROTATED_RECT)); + tempg1->type=SPT_ROTATED_RECT; + + x=tempg->pp.x1; y=tempg->pp.y1; z=0; + Mat4x4MulXYZ(r,&x,&y,&z); + tempg1->ppa.x1=x; + tempg1->ppa.y1=y; + + c=Cos(-é); + s=Sin(-é); + + x=x_radius*c; + y=x_radius*s; + z=0; + Mat4x4MulXYZ(r,&x,&y,&z); + R2P(&m1,&a1,x,y); + + x=-y_radius*s; + y=y_radius*c; + z=0; + Mat4x4MulXYZ(r,&x,&y,&z); + R2P(&m2,&a2,x,y); + m2*=Abs(Sin(a2-a1)); + + w=ToI64(m1)/0x10000; + if (w<1) w=1; + h=ToI64(m2)/0x10000; + if (h<1) h=1; + tempg1->ppa.x2=tempg1->ppa.x1+w; + tempg1->ppa.y2=tempg1->ppa.y1+h; + tempg1->ppa.angle=-a1; + + tempg1->sel=tempg->sel; + return tempg1; +} + +CSprite *SpriteTransformBitMap(I64 *r,CSprite *tempg) +{ + CDC *img,*dc3; + U8 *elems; + I64 x,y,z,minx,maxx,miny,maxy,minz,maxz; + CSprite *tempg1; + + x=0; y=0; z=0; + Mat4x4MulXYZ(r,&x,&y,&z); + minx=maxx=x; + miny=maxy=y; + minz=maxz=z; + + x=0; y=tempg->pwhu.height; z=0; + Mat4x4MulXYZ(r,&x,&y,&z); + if (xmaxx) maxx=x; + if (ymaxx) maxy=y; + if (zmaxx) maxz=z; + + x=tempg->pwhu.width; y=0; z=0; + Mat4x4MulXYZ(r,&x,&y,&z); + if (xmaxx) maxx=x; + if (ymaxx) maxy=y; + if (zmaxx) maxz=z; + + x=tempg->pwhu.width; y=tempg->pwhu.height; z=0; + Mat4x4MulXYZ(r,&x,&y,&z); + if (xmaxx) maxx=x; + if (ymaxx) maxy=y; + if (zmaxx) maxz=z; + + dc3=DCNew(maxx-minx+1,maxy-miny+1); + + img=CAlloc(sizeof(CDC)); + img->width=tempg->pwhu.width; + img->width_internal=(tempg->pwhu.width+7)&~7; + img->height=tempg->pwhu.height; + img->body=&tempg->pwhu.u; + img->dc_signature=DCS_SIGNATURE_VAL; + + dc3->color=TRANSPARENT; + GrRect(dc3,0,0,maxx-minx+1,maxy-miny+1); + + Free(dc3->r); + DCMat4x4Set(dc3,r); + dc3->flags|=DCF_TRANSFORMATION; + + dc3->x=-minx; + dc3->y=-miny; + dc3->z=-minz; + GrBlot3(dc3,0,0,0,img); + Free(img); + + elems=DC2Sprite(dc3); + dc3->r=NULL; + DCDel(dc3); + tempg1=CAlloc(offset(CSprite.start)+MSize(elems)); + MemCpy(tempg1(U8 *)+offset(CSprite.start),elems,MSize(elems)); + tempg1->type=tempg->type; + + x=tempg->pwhu.x1; y=tempg->pwhu.y1; z=0; + Mat4x4MulXYZ(r,&x,&y,&z); + tempg1->pwhu.x1=x; + tempg1->pwhu.y1=y; + + x=0; y=0; z=0; + Mat4x4MulXYZ(r,&x,&y,&z); + tempg1->pwhu.x1+=minx-x; + tempg1->pwhu.y1+=miny-y; + + return tempg1; +} + +U0 SpriteTransform(I64 *r,CSprite *head) +{ + I64 i,j,k,num, + x,y,z,x1,y1,z1,x2,y2,z2,x3,y3,z3; + I32 *ptr; + CD3I32 *p; + CSprite *tempg=head->next,head2,*tempg1,*tempg2,*tempg3; + while (tempg!=head) { + if (tempg->sel) + switch (tempg->type) { + case SPT_WIDTH: + tempg->w.width*=Sqrt(Mat4x4NormSqr65536(r))/65536; + if (tempg->w.width<0) tempg->w.width=0; + break; + case SPT_PLANAR_SYMMETRY: + case SPT_ARROW: + case SPT_LINE: + x=tempg->pp.x2; y=tempg->pp.y2; z=0; + Mat4x4MulXYZ(r,&x,&y,&z); + tempg->pp.x2=x; + tempg->pp.y2=y; + case SPT_PT: + case SPT_FLOOD_FILL: + case SPT_FLOOD_FILL_NOT: + case SPT_TEXT: + case SPT_TEXT_BOX: + case SPT_TEXT_DIAMOND: + x=tempg->p.x1; y=tempg->p.y1; z=0; + Mat4x4MulXYZ(r,&x,&y,&z); + tempg->p.x1=x; + tempg->p.y1=y; + break; + case SPT_BITMAP: + tempg1=SpriteTransformBitMap(r,tempg); + QueIns(tempg1,tempg); + QueRem(tempg); + Free(tempg); + tempg=tempg1; + break; + case SPT_ROTATED_RECT: + tempg1=SpriteTransformRect(r,tempg,tempg->ppa.angle); + QueIns(tempg1,tempg); + QueRem(tempg); + Free(tempg); + tempg=tempg1; + break; + case SPT_RECT: + tempg1=SpriteTransformRect(r,tempg,0); + QueIns(tempg1,tempg); + QueRem(tempg); + Free(tempg); + tempg=tempg1; + break; + case SPT_CIRCLE: + tempg1=SpriteTransformCircle(r,tempg); + QueIns(tempg1,tempg); + QueRem(tempg); + Free(tempg); + tempg=tempg1; + break; + case SPT_ELLIPSE: + case SPT_POLYGON: + tempg1=SpriteTransformEllipse(r,tempg); + QueIns(tempg1,tempg); + QueRem(tempg); + Free(tempg); + tempg=tempg1; + break; + case SPT_POLYLINE: + ptr=&tempg->nu.u; + for (i=0;inu.num;i++) { + x=ptr[i<<1]; y=ptr[i<<1+1]; z=0; + Mat4x4MulXYZ(r,&x,&y,&z); + ptr[i<<1]=x; + ptr[i<<1+1]=y; + } + break; + case SPT_POLYPT: + QueInit(&head2); + x=tempg->npu.x; y=tempg->npu.y; z=0; + x1=x; y1=y; z1=z; //unrotated cur coordinates + Mat4x4MulXYZ(r,&x,&y,&z); + ptr=&tempg->npu.u; + k=tempg->npu.num*3; + x2=x; y2=y; z2=z; //rotated start coordinates + x3=x; y3=y; z3=z; //lag 1 rotated coordinates + for (i=0;inext; + if (tempg1->p.x1==x3 && tempg1->p.y1==y3) { + QueRem(tempg1); + Free(tempg1); + } else { + num++; + x3=tempg1->p.x1; + y3=tempg1->p.y1; + } + tempg1=tempg2; + } + + tempg3=CAlloc(SpriteElemQuedBaseSize(SPT_POLYPT)+(num*3+7)>>3); + tempg3->npu.x=x2; + tempg3->npu.y=y2; + ptr=&tempg3->npu.u; + x3=0;y3=0; z3=0; + i=0; + tempg1=head2.next; + while (tempg1!=&head2) { + tempg2=tempg1->next; + BFieldOrU32(ptr,i, + polypt_map[SignI64(tempg1->p.x1-x3)+1+ + 3*(SignI64(tempg1->p.y1-y3)+1)]); + i+=3; + x3=tempg1->p.x1;y3=tempg1->p.y1; + QueRem(tempg1); + Free(tempg1); + tempg1=tempg2; + } + tempg3->type=SPT_POLYPT; + tempg3->npu.num=num; + QueIns(tempg3,tempg); + QueRem(tempg); + tempg3->sel=tempg->sel; + Free(tempg); + tempg=tempg3; + break; + case SPT_BSPLINE2: + case SPT_BSPLINE3: + case SPT_BSPLINE2_CLOSED: + case SPT_BSPLINE3_CLOSED: + p=&tempg->nu.u; + for (i=0;inu.num;i++,p++) { + x=p->x; y=p->y; z=p->z; + Mat4x4MulXYZ(r,&x,&y,&z); + p->x=x; + p->y=y; + p->z=z; + } + break; + case SPT_SHIFTABLE_MESH: + x=tempg->pmu.x; y=tempg->pmu.y; z=tempg->pmu.z; + Mat4x4MulXYZ(r,&x,&y,&z); + tempg->pmu.x=x; + tempg->pmu.y=y; + tempg->pmu.z=z; + p=&tempg->pmu.u; + for (i=0;ipmu.vertex_cnt;i++,p++) { + x=p->x; y=p->y; z=p->z; + Mat4x4MulXYZ(r,&x,&y,&z); + p->x=x; + p->y=y; + p->z=z; + } + break; + case SPT_MESH: + p=&tempg->mu.u; + for (i=0;imu.vertex_cnt;i++,p++) { + x=p->x; y=p->y; z=p->z; + Mat4x4MulXYZ(r,&x,&y,&z); + p->x=x; + p->y=y; + p->z=z; + } + break; + } + tempg=tempg->next; + } +} + +I64 SpriteQueSelCnt(CSprite *head,Bool val=TRUE) +{ + I64 res=0; + CSprite *tempg=head->next; + val=ToBool(val); + while (tempg!=head) { + if (ToBool(tempg->sel)==val) + res++; + tempg=tempg->next; + } + return res; +} + +I64 SpriteQueSelAll(CSprite *head,Bool val=TRUE) +{ + I64 res=0; + CSprite *tempg=head->next; + while (tempg!=head) { + tempg->sel=val; + res++; + tempg=tempg->next; + } + return res; +} + +CSprite *SpriteSideBar2SpriteQue(CDoc *doc,CSprite *head,I64 *_cur_elem_num) +{//For the side-bar + CSprite *res=CAlloc(sizeof(CSprite)),*tempg; + CDocEntry *doc_e=doc->head.next; + Bool found=FALSE; + I64 num=0; + QueInit(res); + while (doc_e!=doc) { + if (doc_e->type_u8==DOCT_MENU_VAL && doc_e->left_exp>=0) { + tempg=SpriteSetSettings(,head,doc_e->left_exp); + if (tempg!=head) { + tempg=MAllocIdent(tempg); + tempg->sel=Bt(&doc_e->type,DOCEt_SEL); + if (*_cur_elem_num==doc_e->left_exp) { + *_cur_elem_num=num; + found=TRUE; + } + QueIns(tempg,res->last); + num++; + } + } + doc_e=doc_e->next; + } + if (!found) + *_cur_elem_num=num; + QueDel(head); + Free(head); + return res; +} + +U0 SpriteSideBarPickNew(CDoc *doc,CSprite *head,I64 old_num) +{ + CSprite *tempg; + CDocEntry *doc_cur_e=NULL,*doc_e; + I64 cur_elem_num=0; + U8 *st; + DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Sprite SideBar\"$$\n" + "$$LK+PU+CX,\"Click for Help\"," + "A=\"FI:::/Doc/SpriteSideBar.DD.Z\"$$\n\n"); + tempg=head->next; + while (tempg!=head) { + st=SpriteElem2Summary(tempg); + if (cur_elem_num==old_num) { + DocPrint(doc,"$$LTRED$$"); + doc_e=doc_cur_e=DocPrint(doc,"$$MU-UL,\"%Q\",LE=%d$$\n",st,cur_elem_num++); + } else { + DocPrint(doc,"$$LTBLUE$$"); + doc_e=DocPrint(doc,"$$MU-UL,\"%$$Q\",LE=%d$$\n",st,cur_elem_num++); + } + BEqu(&doc_e->de_flags,DOCEf_SEL,tempg->sel); + BEqu(&doc_e->type,DOCEt_SEL,tempg->sel); + Free(st); + tempg=tempg->next; + } + if (cur_elem_num==old_num) { + DocPrint(doc,"$$LTRED$$"); + doc_cur_e=DocPrint(doc,"$$MU-UL,\"END\",LE=%d$$\n",cur_elem_num); + } else { + DocPrint(doc,"$$LTBLUE$$"); + DocPrint(doc,"$$MU-UL,\"END\",LE=%d$$\n",cur_elem_num); + } + if (doc_cur_e) + doc->cur_entry=doc_cur_e; +} + +U0 SpriteSideBarTask2(CTask *grand_parent) +{ + I64 w,h; + CTask *parent=Fs->parent_task,*pu_task; + while (TRUE) { + pu_task=grand_parent->popup_task; + if (TaskValidate(pu_task)) { + w=parent->win_right-parent->win_left; + WinHorz(pu_task->win_right+2,pu_task->win_right+2+w,parent); + h=parent->win_bottom-parent->win_top; + WinVert(pu_task->win_top,pu_task->win_top+h,parent); + } + WinMgrSync; + } +} + +U0 SpriteSideBarTask(CTask *parent,CSprite **_head,I64 *_cur_elem_num) +{ + CDocEntry *doc_e; + CDoc *doc=DocPut; + Spawn(&SpriteSideBarTask2,parent,"CSpriteTask",,Fs); + doc->flags|=DOCF_MIN_SIZE|DOCF_FORM; + while (TRUE) { + SpriteSideBarPickNew(doc,*_head,*_cur_elem_num); + DocHighlightCursor(,doc); + View; + doc_e=doc->cur_entry; + if (doc_e->type_u8==DOCT_MENU_VAL) + *_cur_elem_num=doc_e->left_exp; + *_head=SpriteSideBar2SpriteQue(doc,*_head,_cur_elem_num); + DocClear(doc); + } +} + +Bool SpriteEdText(CSprite **_head,I64 *_cur_elem_num) +{ + Bool res; + CSprite *head=*_head; + U8 *elems=SpriteQue2Sprite(head); + CDoc *doc=DocNew,*doc2,*old_put=DocPut; + StrPrint(doc->filename.name,"AI:0x%X",doc); + DocPrint(doc,"//$$PURPLE$$$$TX+CX,\"Sprite Edit as Text\"$$$$FG$$\n" + "//$$LK+PU+CX,\"Click for Help\"," + "A=\"FI:::/Doc/SpriteEdText.DD.Z\"$$\n\n"); + Sprite2Code(doc,elems); + Free(elems); + while (TRUE) { + if (res=PopUpPrint("DocEd(0x%X,0x%X);",doc,0)) { + Fs->put_doc=doc2=DocNew; + "$$WW,1$$"; + if (elems=Code2Sprite(doc)) { + DocDel(doc2); + Fs->put_doc=old_put; + QueDel(head); + Free(head); + head=Sprite2SpriteQue(elems); + Free(elems); + *_cur_elem_num=QueCnt(head); //TODO: Might want to improve this. + break; + } else { + PopUpPrint("DocEd(0x%X,0x%X);",doc2,0); + DocDel(doc2); + Fs->put_doc=old_put; + } + } else + break; + } + DocDel(doc); + if (_head) *_head=head; + return res; +} + +#define GED_SEL_UNSEL_ALL 0 +#define GED_SEL 1 +#define GED_UNSEL 2 +#define GED_SHIFT_PTS 3 +#define GED_SHIFT_RECTS 4 +#define GED_SHIFT_SEL 5 +#define GED_TRANSFORM_SEL 6 +#define GED_SET_ORIGIN 7 +#define GED_SHIFT_SUB_ORIGIN 8 +#define GED_TEXT_ED 9 +#define GED_INS_CLIPBOARD 10 +#define GED_MAIN_MENU 11 +#define GED_EXIT 12 + +U0 GrInit3() +{ + DefineLstLoad("ST_SPRITE_ED_MENU","Select/Unselect All\0" + "Select\0Unselect\0Shift Points\0Shift Rects\0Shift Selected\0" + "Transform Selected\0Set Origin\0Insert Shift SubOrigin\0" + "Edit as Text\0Insert Clipboard\0Main Menu\0"); +} +GrInit3; + +I64 PopUpSpriteEd(CSprite **_head,I64 *_cur_elem_num) +{ + U8 *st; + CTask *pu_task; + I64 i; + CDoc *doc=DocNew; + DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Sprite Edit Menu\"$$\n" + "$$LK+PU+CX,\"Click for Help\",A=\"FI:::/Doc/SpriteEd.DD.Z\"$$\n\n" + "$$LTBLUE$$$$MU-UL,\"Select/Unselect All\",LE=GED_SEL_UNSEL_ALL$$\n" + "$$MU-UL,\"Select Elems\",LE=GED_SEL$$\n" + "$$MU-UL,\"Unsel Elems\",LE=GED_UNSEL$$\n\n" + "$$MU-UL,\"Shift Points\",LE=GED_SHIFT_PTS$$\n" + "$$MU-UL,\"Shift Points with Rects\",LE=GED_SHIFT_RECTS$$\n" + "$$MU-UL,\"Shift Selected Elems\",LE=GED_SHIFT_SEL$$\n" + "$$MU-UL,\"Transform Selected Elems\",LE=GED_TRANSFORM_SEL$$\n\n" + "$$MU-UL,\"Set Origin\",LE=GED_SET_ORIGIN$$\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,\"Insert Clipboard Sprite's\",LE=GED_INS_CLIPBOARD$$\n\n" + "$$PURPLE$$$$MU-UL,\"+] Sprite Main Menu\",LE=GED_MAIN_MENU$$$$LTBLUE$$\n" + "$$MU-UL,\"Exit Sprite\",LE=GED_EXIT$$\n" + "$$MU-UL,\"Abort Sprite\",LE=DOCM_CANCEL$$"); + st=MStrPrint("SpriteSideBarTask(0x%X,0x%X,0x%X);",Fs,_head,_cur_elem_num); + PopUp(st,NULL,&pu_task); + Free(st); + i=PopUpMenu(doc); + if (TaskValidate(pu_task)) { + *_head=SpriteSideBar2SpriteQue(DocPut(pu_task),*_head,_cur_elem_num); + Kill(pu_task); + } + DocDel(doc); + return i; +} + +#define GSPT_SIMPLE_PT 0 +#define GSPT_WIDTH_HEIGHT 1 + +#define GSPF_SEL 1 + +class CEdSprite +{ + CEdSprite *next,*last; + I32 type,num,flags,xx,yy,zz; + I32 *x,*y,*z,*w,*h; +}; + +U0 SpritePtQueNew(U8 *elems,I64 x,I64 y,CEdSprite *head) +{ + I64 i,num=0; + I32 *ptr; + CD3I32 *p; + CEdSprite *temppe; + CSprite *tempg=elems-offset(CSprite.start); + QueInit(head); + while (tempg->type) { + switch (tempg->type) { + case SPT_ELLIPSE: + case SPT_POLYGON: + temppe=CAlloc(sizeof(CEdSprite)); + temppe->type=GSPT_WIDTH_HEIGHT; + temppe->xx=x; + temppe->yy=y; + temppe->x=&tempg->pwha.x1; + temppe->y=&tempg->pwha.y1; + temppe->w=&tempg->pwha.width; + temppe->h=&tempg->pwha.height; + temppe->num=num; + QueIns(temppe,head->last); + goto pq_x1_y1; + case SPT_RECT: + case SPT_ROTATED_RECT: + case SPT_LINE: + case SPT_ARROW: + case SPT_PLANAR_SYMMETRY: + temppe=CAlloc(sizeof(CEdSprite)); + temppe->type=GSPT_SIMPLE_PT; + temppe->xx=x; + temppe->yy=y; + temppe->x=&tempg->pp.x2; + temppe->y=&tempg->pp.y2; + temppe->num=num; + QueIns(temppe,head->last); + case SPT_TEXT: + case SPT_TEXT_BOX: + case SPT_TEXT_DIAMOND: + case SPT_PT: + case SPT_BITMAP: + case SPT_FLOOD_FILL: + case SPT_FLOOD_FILL_NOT: + case SPT_CIRCLE: +pq_x1_y1: + temppe=CAlloc(sizeof(CEdSprite)); + temppe->type=GSPT_SIMPLE_PT; + temppe->xx=x; + temppe->yy=y; + temppe->x=&tempg->p.x1; + temppe->y=&tempg->p.y1; + temppe->num=num; + QueIns(temppe,head->last); + break; + case SPT_SHIFT: + x+=tempg->p.x1; + y+=tempg->p.y1; + break; + case SPT_POLYLINE: + ptr=&tempg->nu.u; + for (i=0;inu.num;i++) { + temppe=CAlloc(sizeof(CEdSprite)); + temppe->type=GSPT_SIMPLE_PT; + temppe->xx=x; + temppe->yy=y; + temppe->x=&ptr[i<<1]; + temppe->y=&ptr[i<<1+1]; + temppe->num=num; + QueIns(temppe,head->last); + } + break; + case SPT_POLYPT: + temppe=CAlloc(sizeof(CEdSprite)); + temppe->type=GSPT_SIMPLE_PT; + temppe->xx=x; + temppe->yy=y; + temppe->x=&tempg->npu.x; + temppe->y=&tempg->npu.y; + temppe->num=num; + QueIns(temppe,head->last); + break; + case SPT_BSPLINE2: + case SPT_BSPLINE3: + case SPT_BSPLINE2_CLOSED: + case SPT_BSPLINE3_CLOSED: + p=&tempg->nu.u; + for (i=0;inu.num;i++) { + temppe=CAlloc(sizeof(CEdSprite)); + temppe->type=GSPT_SIMPLE_PT; + temppe->xx=x; + temppe->yy=y; + temppe->x=&p[i].x; + temppe->y=&p[i].y; + temppe->z=&p[i].z; + temppe->num=num; + QueIns(temppe,head->last); + } + break; + case SPT_MESH: + break; + case SPT_SHIFTABLE_MESH: + temppe=CAlloc(sizeof(CEdSprite)); + temppe->type=GSPT_SIMPLE_PT; + temppe->xx=x; + temppe->yy=y; + temppe->x=&tempg->pmu.x; + temppe->y=&tempg->pmu.y; + temppe->z=&tempg->pmu.z; + temppe->num=num; + QueIns(temppe,head->last); + break; + } + tempg(U8 *)+=SpriteElemSize(tempg); + num++; + } +} + +U0 SpriteCtrlPtsDraw(CDC *dc,CEdSprite *head) +{ + I64 x,y; + CEdSprite *temppe; + WinMgrSync; + DCFill(dc); + if (Blink(20)) { + temppe=head->next; + while (temppe!=head) { + switch (temppe->type) { + case GSPT_SIMPLE_PT: + x=*temppe->x+temppe->xx; + y=*temppe->y+temppe->yy; + break; + case GSPT_WIDTH_HEIGHT: + x=*temppe->w+*temppe->x+temppe->xx; + y=*temppe->h+*temppe->y+temppe->yy; + break; + } + if (temppe->flags&GSPF_SEL) + dc->color=RED; + else + dc->color=BLACK; + GrRect(dc,x-2,y-2,4,4); + dc->color=WHITE; + GrRect(dc,x-1,y-1,2,2); + temppe=temppe->next; + } + } +} + +U0 SpriteCtrlPtsMove(CEdSprite *head,I64 dx,I64 dy) +{ + CEdSprite *temppe; + temppe=head->next; + while (temppe!=head) { + if (temppe->flags&GSPF_SEL) + switch (temppe->type) { + case GSPT_SIMPLE_PT: + if (temppe->x) *temppe->x+=dx; + if (temppe->y) *temppe->y+=dy; + break; + case GSPT_WIDTH_HEIGHT: + if (temppe->w) *temppe->w+=dx; + if (temppe->h) *temppe->h+=dy; + break; + } + temppe=temppe->next; + } +} + +Bool SpriteShiftPts(U8 *elems,I64 x,I64 y,I64 *_cur_elem_num,I64 mode) +{ + I64 msg_code,a1,a2,xx,yy,xx2,yy2,dd,best_dd,cur_elem_num; + Bool res=TRUE; + CDC *dc=DCAlias; + CEdSprite head,*temppe,*best_pe; + + SpritePtQueNew(elems,x,y,&head); + cur_elem_num=0; + if (head.next!=&head) { + while (TRUE) { + SpriteCtrlPtsDraw(dc,&head); //has WinMgrSync + switch (msg_code=ScanMsg(&a1,&a2, + 1<type) { + case GSPT_SIMPLE_PT: + dd=SqrI64(*temppe->x+temppe->xx-xx)+ + SqrI64(*temppe->y+temppe->yy-yy); + break; + case GSPT_WIDTH_HEIGHT: + dd=SqrI64(*temppe->x+*temppe->w+temppe->xx-xx)+ + SqrI64(*temppe->y+*temppe->h+temppe->yy-yy); + break; + } + if (ddnext; + } + cur_elem_num=best_pe->num; + best_pe->flags|=GSPF_SEL; + break; + case GED_SHIFT_RECTS: + xx2=xx=a1; yy2=yy=a2; + while (TRUE) { + SpriteCtrlPtsDraw(dc,&head); + dc->color=ROPF_DITHER+WHITE<<16+RED; + GrBorder(dc,xx,yy,xx2,yy2); + if (msg_code=ScanMsg(&a1,&a2,1<type) { + case GSPT_SIMPLE_PT: + if (xx<=*temppe->x+temppe->xx<=xx2 && + yy<=*temppe->y+temppe->yy<=yy2) + temppe->flags|=GSPF_SEL; + break; + case GSPT_WIDTH_HEIGHT: + if (xx<=*temppe->x+*temppe->w+temppe->xx<=xx2 && + yy<=*temppe->y+*temppe->h+temppe->yy<=yy2) + temppe->flags|=GSPF_SEL; + break; + } + temppe=temppe->next; + } + do { + SpriteCtrlPtsDraw(dc,&head); + msg_code=ScanMsg(&a1,&a2,1<flags&=~GSPF_SEL; + temppe=temppe->next; + } + break; + case MSG_KEY_DOWN: +gs_key: + switch (a1.u8[0]) { + case CH_SHIFT_ESC: + res=FALSE; + case CH_ESC: + GetMsg(&a1,&a2,1<de_flags; + tempb=doc_ce->bin_data; + DocUnlock(doc); + SpriteQueSelAll(*_head,FALSE); + do { + if (winmgr.fps<10) + doc_ce->de_flags|=DOCEF_DONT_DRAW; + StrCpy(Fs->task_title,"Sprite Edit Menu"); + i=PopUpSpriteEd(_head,_cur_elem_num); + SpriteEdUpdate(doc,doc_ce,*_head); + if (0<=itask_title,DefineSub(i,"ST_SPRITE_ED_MENU")); + switch (i) { + case GED_SEL_UNSEL_ALL: + if (!SpriteQueSelCnt(*_head)) + SpriteQueSelAll(*_head); + else + SpriteQueSelAll(*_head,FALSE); + break; + case GED_SEL: + case GED_UNSEL: + doc_ce->de_flags=old_de_flags; + doc->cur_sprite=tempb->data; + do { + doc->nearest_sprite_elem_num=0; + msg_code=GetMsg(&a1,&a2,1<nearest_sprite_elem_num; + cur_elem=SpriteSetSettings(,*_head,*_cur_elem_num); + cur_elem->sel=ToBool(i==GED_SEL); + GetMsg(,,1<cur_sprite=NULL; + break; + case GED_SET_ORIGIN: + SpriteQueSelAll(*_head); + doc_ce->de_flags=old_de_flags; + GetMsg(&a1,&a2,1<de_flags=old_de_flags; + GetMsg(&a1,&a2,1<de_flags=old_de_flags; + if (SpriteShiftPts(tempb->data,x,y,_cur_elem_num,i)) { + QueDel(*_head); + Free(*_head); + *_head=Sprite2SpriteQue(tempb->data); + } else + SpriteEdUpdate(doc,doc_ce,*_head); + break; + case GED_TRANSFORM_SEL: + if (!SpriteQueSelCnt(*_head)) + SpriteQueSelAll(*_head); + if (PopUpTransform(r)) { + SpriteTransform(r,*_head); + SpriteEdUpdate(doc,doc_ce,*_head); + } + if (!SpriteQueSelCnt(*_head,FALSE)) + SpriteQueSelAll(*_head,FALSE); + break; + case GED_SHIFT_SUB_ORIGIN: + doc_ce->de_flags=old_de_flags; + insert_pt=SpriteSetSettings(,*_head,*_cur_elem_num); + tempg=CAlloc(SpriteElemQuedBaseSize(SPT_SHIFT)); + tempg->type=SPT_SHIFT; + tempg->p.x1=0; + tempg->p.y1=0; + QueIns(tempg,insert_pt->last); + GetMsg(&a1,&a2,1<p.x1=a1-xx; + tempg->p.y1=a2-yy; + SpriteEdUpdate(doc,doc_ce,*_head); + } while (msg_code!=MSG_IP_L_UP); + *_cur_elem_num+=1; + break; + case GED_INS_CLIPBOARD: + RegOneTimePopUp(ARf_CSPRITE_INS_CLIPBOARD, + "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) { + if (doc_e2->type_u8==DOCT_SPRITE) { + head2=Sprite2SpriteQue(doc_e2->bin_data->data); + if (head2->next!=head2) { + tempg=head2->next; + while (tempg!=head2) { + *_cur_elem_num+=1; + tempg=tempg->next; + } + next=head2->next; + last=head2->last; + insert_pt->last->next=next; + next->last=insert_pt->last; + insert_pt->last=last; + last->next=insert_pt; + } + Free(head2); + } + doc_e2=doc_e2->next; + } + if (unlock) + DocUnlock(sys_clipboard_doc); + SpriteEdUpdate(doc,doc_ce,*_head); + break; + case GED_TEXT_ED: + if (SpriteEdText(_head,_cur_elem_num)) + SpriteEdUpdate(doc,doc_ce,*_head); + break; + } + } + } while (i!=DOCM_CANCEL && i!=GED_EXIT && i!=GED_MAIN_MENU); + doc_ce->de_flags=old_de_flags; + + switch (i) { + case DOCM_CANCEL: return GE_ABORT; + case GED_EXIT: return GE_EXIT; + case GED_MAIN_MENU: return GE_CONT; + } +} diff --git a/Adam/Gr/SpriteMain.CPP b/Adam/Gr/SpriteMain.CPP deleted file mode 100644 index ef4bd8e..0000000 --- a/Adam/Gr/SpriteMain.CPP +++ /dev/null @@ -1,1231 +0,0 @@ -#help_index "Graphics/Sprite;Sprites" - -#define SPT_MENU -2 -#define SPT_INS_SCREEN_BITMAP -3 -#define SPT_INS_TRANSPARENT_SCREEN_BITMAP -4 -#define SPT_ED_MENU -5 -#define SPT_EXIT -6 - -I64 PopUpSpriteMain(CSprite **_head,I64 *_cur_elem_num, - CDoc *_doc,CDocEntry *_doc_e) -{ - CTask *pu_task; - I64 i; - CDoc *doc=DocNew; - CDocEntry *doc_de; - U8 *st; - - doc_de=DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Sprite Main Menu\"$$\n" - "$$LK+PU+CX,\"Click for Help\",A=\"FI:::/Doc/SpriteMain.TXT.Z\"$$\n" - "\n$$LTBLUE$$$$DA+M,A=\"Tag Text:%%s\"$$\n\n"); - doc_de->data=StrNew(_doc_e->tag,doc->mem_task); - DocDataFmt(doc,doc_de); - - DocPrint(doc,"$$MU-UL,\"Color (4-bit)\",LE=SPT_COLOR$$\n" - "$$MU-UL,\"Dither Color (4-bit)\",LE=SPT_DITHER_COLOR$$\n" - "$$MU-UL,\"Width\",LE=SPT_WIDTH$$\n" - "$$MU-UL,\"Planar Symmetry\",LE=SPT_PLANAR_SYMMETRY$$\n" - "\n$$MU-UL,\"Point\",LE=SPT_PT$$\n" - "$$MU-UL,\"Line\",LE=SPT_LINE$$\n" - "$$MU-UL,\"Arrow\",LE=SPT_ARROW$$\n" - "$$MU-UL,\"Rect\",LE=SPT_RECT$$\n" - "$$MU-UL,\"Circle\",LE=SPT_CIRCLE$$\n" - "$$MU-UL,\"Ellipse\",LE=SPT_ELLIPSE$$\n" - "$$MU-UL,\"Polygon\",LE=SPT_POLYGON$$\n" - "$$MU-UL,\"Text\",LE=SPT_TEXT$$\n" - "$$MU-UL,\"Text Box\",LE=SPT_TEXT_BOX$$\n" - "$$MU-UL,\"Text Diamond\",LE=SPT_TEXT_DIAMOND$$\n" - "$$MU-UL,\"Flood Fill\",LE=SPT_FLOOD_FILL$$\n" - "$$MU-UL,\"Flood Fill Not Color\",LE=SPT_FLOOD_FILL_NOT$$\n" - "$$MU-UL,\"PolyLine\",LE=SPT_POLYLINE$$\n" - "$$MU-UL,\"PolyPoint\",LE=SPT_POLYPT$$\n" - "$$MU-UL,\"BSpline2\",LE=SPT_BSPLINE2$$\n" - "$$MU-UL,\"BSpline3\",LE=SPT_BSPLINE3$$\n" - "$$MU-UL,\"BSpline2 Closed\",LE=SPT_BSPLINE2_CLOSED$$\n" - "$$MU-UL,\"BSpline3 Closed\",LE=SPT_BSPLINE3_CLOSED$$\n" - "$$MU-UL,\"Insert Screen-Captured BitMap\",LE=SPT_INS_SCREEN_BITMAP$$\n" - "$$MU-UL,\"Insert Transparent Screen-Captured BitMap\"," - "LE=SPT_INS_TRANSPARENT_SCREEN_BITMAP$$\n" - "$$PURPLE$$$$MU-UL,\"+] Create or Edit 3D Mesh\",LE=SPT_MESH$$\n" - "$$MU-UL,\"+] Create or Edit Shiftable 3D Mesh\"," - "LE=SPT_SHIFTABLE_MESH$$\n" - "$$MU-UL,\"+] Convert to BitMap or Edit BitMap\"," - "LE=SPT_BITMAP$$$$LTBLUE$$\n" - "\n$$MU-UL,\"Transform On (for use with 3D icons)\"," - "LE=SPT_TRANSFORM_ON$$\n" - "$$MU-UL,\"Transform Off (for use with 3D icons)\"," - "LE=SPT_TRANSFORM_OFF$$\n" - "\n" - "$$PURPLE$$$$MU-UL,\"+] Sprite Edit Menu\",LE=SPT_ED_MENU$$$$LTBLUE$$\n" - "$$MU-UL,\"Exit Sprite\",LE=SPT_EXIT$$\n" - "$$MU-UL,\"Abort Sprite\",LE=DOCM_CANCEL$$\n" - "\nRight-Click to get back to this menu."); - st=MStrPrint("SpriteSideBarTask(0x%X,0x%X,0x%X);",Fs,_head,_cur_elem_num); - PopUp(st,NULL,&pu_task); - Free(st); - i=PopUpMenu(doc); - if (TaskValidate(pu_task)) { - *_head=SpriteSideBar2SpriteQue(DocPut(pu_task),*_head,_cur_elem_num); - Kill(pu_task); - } - Free(_doc_e->tag); - _doc_e->tag=StrNew(doc_de->data,_doc->mem_task); - _doc->cur_col=0; - DocDel(doc); - return i; -} - -Bool PopUpExtents(I64 *_x1,I64 *_x2,I64 *_y1,I64 *_y2) -{ - I64 i; - CDoc *doc=DocNew; - CDocEntry *doc_e; - doc_e=DocPrint(doc," $$DA,A=\"x1:%%d\"$$\n"); - doc_e->data=_x1; - DocDataFmt(doc,doc_e); - doc_e=DocPrint(doc," $$DA,A=\"x2:%%d\"$$\n"); - doc_e->data=_x2; - DocDataFmt(doc,doc_e); - doc_e=DocPrint(doc," $$DA,A=\"y1:%%d\"$$\n"); - doc_e->data=_y1; - DocDataFmt(doc,doc_e); - doc_e=DocPrint(doc," $$DA,A=\"y2:%%d\"$$\n\n"); - doc_e->data=_y2; - DocDataFmt(doc,doc_e); - - DocPrint(doc," $$BT,\"Use These Extents\",LE=TRUE$$"); - DocPrint(doc,"$$CM,3,0$$$$BT,\"Drag-Out New Extents\",LE=FALSE$$\n\n"); - do i=PopUpMenu(doc); - while (i!=FALSE && i!=TRUE); - DocDel(doc); - return i; -} - -U0 SpriteScreenInit(CDC *dc,I64,I64) -{ -//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$. - I64 xx,yy,old_pen_width=dc->pen_width; - CColorROPU32 old_color=dc->color; - WinMgrSync; - DCFill(dc); - if (dc->flags&DCF_SYMMETRY) { - dc->flags&=~DCF_SYMMETRY; - dc->pen_width=1; - xx=dc->sym.sny*8192; - yy=-dc->sym.snx*8192; - dc->color=RED; - GrLine3(dc,dc->sym.sx-xx.i32[1],dc->sym.sy-yy.i32[1],0, - dc->sym.sx+xx.i32[1],dc->sym.sy+yy.i32[1],0,3,0); - dc->color=WHITE; - GrLine3(dc,dc->sym.sx-xx.i32[1],dc->sym.sy-yy.i32[1],0, - dc->sym.sx+xx.i32[1],dc->sym.sy+yy.i32[1],0,3,1); - dc->color=BLACK; - GrLine3(dc,dc->sym.sx-xx.i32[1],dc->sym.sy-yy.i32[1],0, - dc->sym.sx+xx.i32[1],dc->sym.sy+yy.i32[1],0,3,2); - dc->flags|=DCF_SYMMETRY; - } - dc->color=old_color; - dc->pen_width=old_pen_width; -} - -CSprite *SMLine(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color) -{ - I64 msg_code,x1=a1,y1=a2,x2=a1,y2=a2; - CSprite *res; - do { - dc->color=color&COLORROP_NO_ROP0_MASK; - GrLine3(dc,x1,y1,0,x2,y2,0); - msg_code=GetMsg(&a1,&a2,1<color=color&COLORROP_NO_ROP0_MASK; - GrLine3(dc,x1,y1,0,x2,y2,0); - res=CAlloc(SpriteElemQuedBaseSize(SPT_LINE)); - res->type=SPT_LINE; - res->pp.x1=x1-x; - res->pp.y1=y1-y; - res->pp.x2=x2-x; - res->pp.y2=y2-y; - return res; -} - -CSprite *SMArrow(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color) -{ - I64 msg_code,x1=a1,y1=a2,x2=a1,y2=a2; - CSprite *res; - do { - dc->color=color&COLORROP_NO_ROP0_MASK; - GrArrow3(dc,x1,y1,0,x2,y2,0); - msg_code=GetMsg(&a1,&a2,1<color=color&COLORROP_NO_ROP0_MASK; - GrArrow3(dc,x1,y1,0,x2,y2,0); - res=CAlloc(SpriteElemQuedBaseSize(SPT_ARROW)); - res->type=SPT_ARROW; - res->pp.x1=x1-x; - res->pp.y1=y1-y; - res->pp.x2=x2-x; - res->pp.y2=y2-y; - return res; -} - -CSprite *SMPlanarSymmetry(CDC *dc,I64 x,I64 y,I64 a1,I64 a2) -{ - I64 msg_code,x1=a1,y1=a2,x2=a1,y2=a2,old_width,old_flags; - CSprite *res; - old_width=dc->pen_width; - old_flags=dc->flags; - dc->flags&=~DCF_SYMMETRY; - dc->pen_width=1; - do { - dc->color=ROPF_DITHER+WHITE<<16+BLACK; - GrLine3(dc,x1,y1,0,x2,y2,0); - msg_code=GetMsg(&a1,&a2,1<flags=old_flags&DCF_SYMMETRY|dc->flags&~DCF_SYMMETRY; - dc->pen_width=old_width; - res=CAlloc(SpriteElemQuedBaseSize(SPT_PLANAR_SYMMETRY)); - res->type=SPT_PLANAR_SYMMETRY; - res->pp.x1=x1-x; - res->pp.y1=y1-y; - res->pp.x2=x2-x; - res->pp.y2=y2-y; - return res; -} - -CSprite *SMRect(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color) -{ - I64 msg_code,x1=a1,y1=a2,x2=a1,y2=a2,xx1=a1,yy1=a2,xx2=a1,yy2=a2; - CSprite *res; - do { - dc->color=color&COLORROP_NO_ROP0_MASK; - GrRect3(dc,xx1,yy1,0,xx2-xx1,yy2-yy1); - msg_code=GetMsg(&a1,&a2,1<color=color&COLORROP_NO_ROP0_MASK; - GrRect3(dc,xx1,yy1,0,xx2-xx1,yy2-yy1); - res=CAlloc(SpriteElemQuedBaseSize(SPT_RECT)); - res->type=SPT_RECT; - res->pp.x1=xx1-x; - res->pp.y1=yy1-y; - res->pp.x2=xx2-x; - res->pp.y2=yy2-y; - return res; -} - -CSprite *SMScreenBitMap(I64 eletype,CDC *dc,CDC *dc2,I64 x,I64 y,I64 a1,I64 a2, - CColorROPU32 bm_bkcolor) -{ - I64 i,msg_code,x1=a1,y1=a2,x2=a1,y2=a2,xx1=a1,yy1=a2,xx2=a1,yy2=a2,old_width; - CDC *dc3,*img; - CSprite *res; - old_width=dc2->pen_width; - dc2->pen_width=1; - do { - dc2->color=ROPF_DITHER+WHITE<<16+BLACK; - GrBorder(dc2,xx1+Fs->pix_left+Fs->scroll_x,yy1+Fs->pix_top+Fs->scroll_y, - xx2+Fs->pix_left+Fs->scroll_x,yy2+Fs->pix_top+Fs->scroll_y); - msg_code=GetMsg(&a1,&a2,1<type=SPT_BITMAP; - res->pwhu.width=xx2-xx1; - res->pwhu.height=yy2-yy1; - res->pwhu.x1=0; - res->pwhu.y1=0; - SpriteScreenInit(dc,x,y); - i=gr.screen_zoom; - GrScaleZoom(1.0/i); - WinMgrSync(2,TRUE); - - dc3=DCScreenCapture; - img=DCExt(dc3,Fs->pix_left+Fs->scroll_x+xx1,Fs->pix_top+Fs->scroll_y+yy1, - Fs->pix_left+Fs->scroll_x+xx2-1,Fs->pix_top+Fs->scroll_y+yy2-1); - if (eletype==SPT_INS_TRANSPARENT_SCREEN_BITMAP) - DCColorChg(img,bm_bkcolor); - GrScaleZoom(i); - MemCpy(&res->pwhu.u,img->body,((xx2-xx1+7)&~7)*(yy2-yy1)); - DCDel(img); - DCDel(dc3); - dc2->pen_width=old_width; - Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS - -WIF_SELF_BORDER-WIF_SELF_GRAB_SCROLL; - return res; -} - -CSprite *SMCircle(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color) -{ - I64 msg_code,x1=a1,y1=a2,x2=a1,y2=a2; - CSprite *res; - do { - dc->color=color&COLORROP_NO_ROP0_MASK; - GrCircle3(dc,x1,y1,0,Sqrt(SqrI64(x1-x2)+SqrI64(y1-y2))); - msg_code=GetMsg(&a1,&a2,1<color=color&COLORROP_NO_ROP0_MASK; - GrCircle3(dc,x1,y1,0,Sqrt(SqrI64(x1-x2)+SqrI64(y1-y2))); - res=CAlloc(SpriteElemQuedBaseSize(SPT_CIRCLE)); - res->type=SPT_CIRCLE; - res->pr.x1=x1-x; - res->pr.y1=y1-y; - res->pr.radius=Sqrt(SqrI64(x1-x2)+SqrI64(y1-y2)); - return res; -} - -CSprite *SMEllipse(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color) -{ - I64 msg_code,x1=a1,y1=a2,x2=a1,y2=a2; - F64 angle1,angle2; - CSprite *res; - do { - dc->color=color&COLORROP_NO_ROP0_MASK; - GrEllipse3(dc,(x1+x2)>>1,(y1+y2)>>1,0,AbsI64(x1-x2)>>1,AbsI64(y1-y2)>>1); - msg_code=GetMsg(&a1,&a2,1<type=SPT_ELLIPSE; - res->pwha.x1=(x1+x2)>>1-x; - res->pwha.y1=(y1+y2)>>1-y; - res->pwha.width =AbsI64(x1-x2)>>1; - res->pwha.height=AbsI64(y1-y2)>>1; - angle2=Arg(x2-(res->pwha.x1+x),y2-(res->pwha.y1+y)); - if (res->pwha.widthpwha.height) - angle2-=ã/2.0; - do { - angle1=Arg(x2-(res->pwha.x1+x),y2-(res->pwha.y1+y)); - if (res->pwha.width>=res->pwha.height) - res->pwha.angle=-(angle1-angle2); - else - res->pwha.angle=-(angle1-angle2)+ã/2.0; - dc->color=color&COLORROP_NO_ROP0_MASK; - GrEllipse3(dc,res->pwha.x1+x,res->pwha.y1+y,0, - res->pwha.width,res->pwha.height,res->pwha.angle); - msg_code=GetMsg(&a1,&a2,1<pwha.x1+x),y2-(res->pwha.y1+y)); - if (res->pwha.width>=res->pwha.height) - res->pwha.angle=-(angle1-angle2); - else - res->pwha.angle=-(angle1-angle2)+ã/2.0; - dc->color=color&COLORROP_NO_ROP0_MASK; - GrEllipse3(dc,res->pwha.x1+x,res->pwha.y1+y,0, - res->pwha.width,res->pwha.height,res->pwha.angle); - return res; -} - -CSprite *SMPolygon(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,I64 sides, - CColorROPU32 color) -{ - I64 msg_code,x1=a1,y1=a2,x2=a1,y2=a2; - F64 angle1,angle2; - CSprite *res; - do { - dc->color=color&COLORROP_NO_ROP0_MASK; - GrRegPoly3(dc,(x1+x2)>>1,(y1+y2)>>1,0, - AbsI64(x1-x2)>>1,AbsI64(y1-y2)>>1,sides); - msg_code=GetMsg(&a1,&a2,1<type=SPT_POLYGON; - res->pwhas.x1=(x1+x2)>>1-x; - res->pwhas.y1=(y1+y2)>>1-y; - res->pwhas.width =AbsI64(x1-x2)>>1; - res->pwhas.height=AbsI64(y1-y2)>>1; - res->pwhas.sides=sides; - angle2=Arg(x2-(res->pwhas.x1+x),y2-(res->pwhas.y1+y)); - if (res->pwhas.widthpwhas.height) - angle2-=ã/2.0; - do { - angle1=Arg(x2-(res->pwhas.x1+x),y2-(res->pwhas.y1+y)); - if (res->pwhas.width>=res->pwhas.height) - res->pwhas.angle=-(angle1-angle2); - else - res->pwhas.angle=-(angle1-angle2)+ã/2.0; - dc->color=color&COLORROP_NO_ROP0_MASK; - GrRegPoly3(dc,res->pwhas.x1+x,res->pwhas.y1+y,0, - res->pwhas.width,res->pwhas.height, - res->pwhas.sides,res->pwhas.angle); - msg_code=GetMsg(&a1,&a2,1<pwhas.x1+x),y2-(res->pwhas.y1+y)); - if (res->pwhas.width>=res->pwhas.height) - res->pwhas.angle=-(angle1-angle2); - else - res->pwhas.angle=-(angle1-angle2)+ã/2.0; - dc->color=color&COLORROP_NO_ROP0_MASK; - GrRegPoly3(dc,res->pwhas.x1+x,res->pwhas.y1+y,0, - res->pwhas.width,res->pwhas.height,res->pwhas.sides, - res->pwhas.angle); - return res; -} - -CSprite *SMPolyLineFamily(I64 eletype,CDC *dc,I64 x,I64 y,I64 a1,I64 a2, - CColorROPU32 color) -{ - I64 i,num=0,msg_code,x1=a1,y1=a2,x2=a1,y2=a2; - I32 *ptr; - CD3I32 *p; - CSprite *res,*tempg,*tempg1,head2; - - QueInit(&head2); - do { - do { - dc->color=color&COLORROP_NO_ROP0_MASK; - if (num) - GrLine3(dc,x1,y1,0,x2,y2,0); - msg_code=GetMsg(&a1,&a2,1<color=TRANSPARENT; - if (num) - GrLine3(dc,x1,y1,0,x2,y2,0); - x2=a1; y2=a2; - } while (msg_code!=MSG_IP_L_UP && msg_code!=MSG_IP_R_UP); - dc->color=color&COLORROP_NO_ROP0_MASK; - if (msg_code==MSG_IP_L_UP) { - if (num) - GrLine3(dc,x1,y1,0,x2,y2,0); - res=CAlloc(SpriteElemQuedBaseSize(SPT_PT)); - res->type=SPT_PT; - res->p.x1=x2-x; - res->p.y1=y2-y; - QueIns(res,head2.last); - x1=x2;y1=y2; - num++; - } - } while (msg_code!=MSG_IP_R_UP); - - switch (eletype) { - case SPT_POLYLINE: - if (num>1) { - res=CAlloc(SpriteElemQuedBaseSize(SPT_POLYLINE)+num*sizeof(CD2I32)); - ptr=&res->nu.u; - tempg1=head2.next; - for (i=0;inext; - ptr[i<<1]=tempg1->p.x1; - ptr[i<<1+1]=tempg1->p.y1; - Free(tempg1); - tempg1=tempg; - } - res->type=SPT_POLYLINE; - res->nu.num=num; - } else { - tempg1=head2.next; - for (i=0;inext; - Free(tempg1); - tempg1=tempg; - } - res=NULL; - } - break; - case SPT_BSPLINE2: - case SPT_BSPLINE3: - case SPT_BSPLINE2_CLOSED: - case SPT_BSPLINE3_CLOSED: - if (num>2) { - res=CAlloc(SpriteElemQuedBaseSize(eletype)+num*sizeof(CD3I32)); - p=&res->nu.u; - tempg1=head2.next; - for (i=0;inext; - p[i].x=tempg1->p.x1; - p[i].y=tempg1->p.y1; - Free(tempg1); - tempg1=tempg; - } - res->type=eletype; - res->nu.num=num; - } else { - tempg1=head2.next; - for (i=0;inext; - Free(tempg1); - tempg1=tempg; - } - res=NULL; - } - break; - } - return res; -} - -CSprite *SMPolyPoint(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color) -{ - I64 i,num=0,msg_code,x1=a1,y1=a2,x2=a1,y2=a2,x3,y3; - I32 *ptr; - CSprite *res,*tempg,*tempg1,head2; - - QueInit(&head2); - x3=a1-x; y3=a2-y; - dc->color=color&COLORROP_NO_ROP0_MASK; - do { - msg_code=GetMsg(&a1,&a2,1<next; - if (res->p.x1==x1 && res->p.y1==y1) { - QueRem(res); - Free(res); - } else { - num++; - x1=res->p.x1; - y1=res->p.y1; - } - res=tempg; - } - - res=CAlloc(SpriteElemQuedBaseSize(SPT_POLYPT)+(num*3+7)>>3); - res->npu.x=x3; - res->npu.y=y3; - ptr=&res->npu.u; - x1=x3; y1=y3; - i=0; - tempg1=head2.next; - while (tempg1!=&head2) { - tempg=tempg1->next; - BFieldOrU32(ptr,i,polypt_map[SignI64(tempg1->p.x1-x1)+1+ - 3*(SignI64(tempg1->p.y1-y1)+1)]); - i+=3; - x1=tempg1->p.x1;y1=tempg1->p.y1; - QueRem(tempg1); - Free(tempg1); - tempg1=tempg; - } - res->type=SPT_POLYPT; - res->npu.num=num; - return res; -} - -U0 SMTextFamily(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *head,CDC *dc, - I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color,I64 *_cur_elem_num, - I64 old_de_flags) -{ - CSprite *tempg,*insert_pt=SpriteSetSettings(,head,*_cur_elem_num); - I64 msg_code,x1,y1; - U8 *st; - doc_ce->de_flags|=DOCEF_DONT_DRAW; - st=PopUpGetStr("Enter text and press .\n"); - doc_ce->de_flags=old_de_flags; - if (st && *st) { - x1=0; y1=0; - do { - dc->color=color&COLORROP_NO_ROP0_MASK; - switch (eletype) { - case SPT_TEXT: GrPrint3(dc,x1,y1,0,"%s",st); break; - case SPT_TEXT_BOX: GrTextBox3(dc,x1,y1,0,st); break; - case SPT_TEXT_DIAMOND: GrTextDiamond3(dc,x1,y1,0,st); break; - } - msg_code=GetMsg(&a1,&a2,1<type=eletype; - tempg->ps.x1=x1-x; - tempg->ps.y1=y1-y; - StrCpy(tempg->ps.st,st); - QueIns(tempg,insert_pt->last); - SpriteEdUpdate(doc,doc_ce,head); - *_cur_elem_num+=1; - } - Free(st); -} - -I64 SMBitMap(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *head, - CDC *dc,I64 xx,I64 yy,I64 a1,I64 a2,CColorROPU32 bm_bkcolor, - 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; - CSprite *tempg,*tempg1,*insert_pt; - CDC *img; - - insert_pt=SpriteSetSettings(,head,*_cur_elem_num,xx,yy,,,&x,&y); - x+=xx; y+=yy; - - if (sel) { - xx1=a1; yy1=a2; - xx2=a1; yy2=a2; - old_width=dc->pen_width; - dc->pen_width=1; - do { - dc->color=ROPF_DITHER+WHITE<<16+BLACK; - GrBorder(dc,xx1,yy1,xx2,yy2); - msg_code=GetMsg(&a1,&a2,1<pen_width=old_width; - } - - xx2++; yy2++; - tempg=CAlloc(SpriteElemQuedBaseSize(SPT_BITMAP)+ - ((xx2-xx1+7)&~7)*(yy2-yy1)); - tempg->type=SPT_BITMAP; - tempg->pwhu.width=xx2-xx1; - tempg->pwhu.height=yy2-yy1; - tempg->pwhu.x1=xx1-x; - tempg->pwhu.y1=yy1-y; - img=DCNew(tempg->pwhu.width,tempg->pwhu.height,Fs); - img->color=bm_bkcolor; - GrRect(img,0,0,tempg->pwhu.width,tempg->pwhu.height); - tempg1=insert_pt; - if (tempg1==head || tempg1->type!=SPT_BITMAP) { - SpriteSetSettings(img,head,0,-(xx1-x),-(yy1-y)); - x=xx; y=yy; - Sprite3(img,-(xx1-x),-(yy1-y),0,doc_ce->bin_data->data); - QueDel(head); - insert_pt=head->next=head->last=head; - *_cur_elem_num=1; - } else { - SpriteSetSettings(img,head,*_cur_elem_num,-(xx1-x),-(yy1-y)); - Sprite3(img,-(xx1-x),-(yy1-y),0,&tempg1->start,TRUE); - insert_pt=tempg1->next; - QueRem(tempg1); - Free(tempg1); - } - MemCpy(&tempg->pwhu.u,img->body,((xx2-xx1+7)&~7)*(yy2-yy1)); - - switch (i=SpriteBitMapEd(doc,doc_ce,dc,&xx1,&yy1, - &xx2,&yy2,&img,bm_bkcolor)) { - case GE_EXIT: - case GE_CONT: - Free(tempg); - tempg=CAlloc(SpriteElemQuedBaseSize(SPT_BITMAP)+ - ((xx2-xx1+7)&~7)*(yy2-yy1)); - tempg->type=eletype; - tempg->pwhu.width=xx2-xx1; - tempg->pwhu.height=yy2-yy1; - tempg->pwhu.x1=xx1-x; - tempg->pwhu.y1=yy1-y; - MemCpy(&tempg->pwhu.u,img->body,((xx2-xx1+7)&~7)*(yy2-yy1)); - break; - } - QueIns(tempg,insert_pt->last); - DCDel(img); - SpriteEdUpdate(doc,doc_ce,head); - return i; -} - -U0 SMMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *head,I64 *_cur_elem_num) -{ - CSprite *tempg,*insert_pt=SpriteSetSettings(,head,*_cur_elem_num), - *tempg1=insert_pt; - CD3I32 *p; - I64 i,size,x1,y1,z1; - I32 *mesh,*old_mesh; - if (tempg1!=head && tempg1->type==SPT_MESH) - old_mesh=&tempg1->mu.vertex_cnt; - else if (tempg1!=head && tempg1->type==SPT_SHIFTABLE_MESH) { - x1=tempg1->pmu.x; - y1=tempg1->pmu.y; - z1=tempg1->pmu.z; - p=&tempg1->pmu.u; - for (i=0;ipmu.vertex_cnt;i++,p++) { - p->x+=x1; - p->y+=y1; - p->z+=z1; - } - old_mesh=&tempg1->pmu.vertex_cnt; - } else - old_mesh=NULL; - if (mesh=SpriteMeshEd(old_mesh,&size,TRUE)) { - tempg=CAlloc(SpriteElemQuedBaseSize(SPT_MESH)-sizeof(I32)*2+size); - tempg->type=SPT_MESH; - MemCpy(&tempg->mu.vertex_cnt,mesh,size); - Free(mesh); - QueIns(tempg,insert_pt->last); - SpriteEdUpdate(doc,doc_ce,head); - if (old_mesh) { - insert_pt=tempg; - QueRem(tempg1); - Free(tempg1); - SpriteEdUpdate(doc,doc_ce,head); - } else - *_cur_elem_num+=1; - } else if (old_mesh && tempg1->type==SPT_SHIFTABLE_MESH) { - x1=tempg1->pmu.x; - y1=tempg1->pmu.y; - z1=tempg1->pmu.z; - p=&tempg1->pmu.u; - for (i=0;ipmu.vertex_cnt;i++,p++) { - p->x-=x1; - p->y-=y1; - p->z-=z1; - } - } -} - -U0 SMShiftableMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *head, - I64 x,I64 y,I64 a1,I64 a2,I64 *_cur_elem_num) -{ - CSprite *tempg,*insert_pt=SpriteSetSettings(,head,*_cur_elem_num), - *tempg1=insert_pt; - CD3I32 *p; - I64 i,size,z,x1,y1,z1; - I32 *mesh,*old_mesh; - if (tempg1!=head && tempg1->type==SPT_MESH) { - z=0; - x1=-(a1-x); - y1=-(a2-y); - z1=z; - p=&tempg1->mu.u; - for (i=0;imu.vertex_cnt;i++,p++) { - p->x+=x1; - p->y+=y1; - p->z+=z1; - } - old_mesh=&tempg1->mu.vertex_cnt; - } else if (tempg1!=head && tempg1->type==SPT_SHIFTABLE_MESH) { - z=-tempg1->pmu.z; - x1=tempg1->pmu.x-(a1-x); - y1=tempg1->pmu.y-(a2-y); - z1=tempg1->pmu.z+z; - p=&tempg1->pmu.u; - for (i=0;ipmu.vertex_cnt;i++,p++) { - p->x+=x1; - p->y+=y1; - p->z+=z1; - } - old_mesh=&tempg1->pmu.vertex_cnt; - } else { - z=0; - old_mesh=NULL; - } - if (mesh=SpriteMeshEd(old_mesh,&size,TRUE)) { - tempg=CAlloc(SpriteElemQuedBaseSize(SPT_SHIFTABLE_MESH)-sizeof(I32)*2+size); - tempg->type=SPT_SHIFTABLE_MESH; - MemCpy(&tempg->pmu.vertex_cnt,mesh,size); - Free(mesh); - tempg->pmu.x=a1-x; - tempg->pmu.y=a2-y; - tempg->pmu.z=-z; - QueIns(tempg,insert_pt->last); - SpriteEdUpdate(doc,doc_ce,head); - if (old_mesh) { - insert_pt=tempg; - QueRem(tempg1); - Free(tempg1); - SpriteEdUpdate(doc,doc_ce,head); - } else - *_cur_elem_num+=1; - } else if (old_mesh && tempg1->type==SPT_SHIFTABLE_MESH) { - x1=tempg1->pmu.x-(a1-x); - y1=tempg1->pmu.y-(a2-y); - z1=tempg1->pmu.z+z; - p=&tempg1->pmu.u; - for (i=0;ipmu.vertex_cnt;i++,p++) { - p->x-=x1; - p->y-=y1; - p->z-=z1; - } - } else if (old_mesh && tempg1->type==SPT_MESH) { - x1=-(a1-x); - y1=-(a2-y); - z1= z; - p=&tempg1->mu.u; - for (i=0;imu.vertex_cnt;i++,p++) { - p->x-=x1; - p->y-=y1; - p->z-=z1; - } - } -} - -U0 SMTaskTitleSet(I64 eletype) -{ - Fs->title_src=TTS_CONST; //Violates TTS_LOCKED_CONST - switch (eletype) { - case SPT_INS_SCREEN_BITMAP: - StrCpy(Fs->task_title,"Insert Screen BitMap"); - break; - case SPT_INS_TRANSPARENT_SCREEN_BITMAP: - StrCpy(Fs->task_title,"Insert Transparent Screen BitMap"); - break; - default: - if (eletype>=0) - StrCpy(Fs->task_title,DefineSub(eletype,"ST_SPRITE_ELEM_TYPES")); - } - Fs->border_src=BDS_CONST; -} - -I64 SpriteMainEd(CDoc *doc) -{ - CDocEntry *doc_ce=doc->cur_entry; - I64 res,i,x,y,a1,a2,xx,yy,xx1,yy1,xx2,yy2,width,eletype=SPT_MENU, - cur_elem_num,old_border_src=Fs->border_src,old_title_src=Fs->title_src, - old_de_flags=doc_ce->de_flags; - CColorROPU32 bm_bkcolor,color; - CSprite *head,*tempg,*insert_pt; - CDC *dc=DCAlias(,Fs),*dc2=DCAlias(,sys_winmgr_task),*dc3; - U8 *old_task_title=StrNew(Fs->task_title); - - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - AutoComplete; - WinMgrSync(2,TRUE); - dc2->flags|=DCF_ON_TOP; - head=Sprite2SpriteQue(doc_ce->bin_data->data); - cur_elem_num=QueCnt(head); - xx=(doc_ce->x+doc_ce->max_col-doc->line_start_col)*FONT_WIDTH; - yy=(doc_ce->y-doc->top_line_num)*FONT_HEIGHT; - - while (TRUE) { - insert_pt=SpriteSetSettings(dc,head,cur_elem_num,xx,yy, - &color,&width,&x,&y); - x+=xx; y+=yy; - DCFill; - if (eletype==SPT_MENU) { - Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS - -WIF_SELF_BORDER-WIF_SELF_GRAB_SCROLL; - if (winmgr.fps<10) - doc_ce->de_flags|=DOCEF_DONT_DRAW; - StrCpy(Fs->task_title,old_task_title); - Fs->border_src=old_border_src; - Fs->title_src =old_title_src; - - xx-=StrLen(doc_ce->tag)*FONT_WIDTH; - eletype=PopUpSpriteMain(&head,&cur_elem_num,doc,doc_ce); - xx+=StrLen(doc_ce->tag)*FONT_WIDTH; - insert_pt=SpriteSetSettings(dc,head,cur_elem_num,x,y, - &color,&width,&x,&y); - x+=xx; y+=yy; - - SpriteEdUpdate(doc,doc_ce,head); - switch (eletype) { - case SPT_FLOOD_FILL: - case SPT_FLOOD_FILL_NOT: - RegOneTimePopUp(ARf_FLOODFILL, - ST_WARN_ST "This is affected by what's underneath\n" - "when it is drawn. You will probably want to\n" - "convert it to a bitmap.\n\n" - "A tip on artistry you might consider\n" - "is using lines to fill regions because\n" - "brush strokes look cool.\n"); - break; - case SPT_PLANAR_SYMMETRY: - RegOneTimePopUp(ARf_PLANAR_SYMMETRY, - "Right-click to turn-off symmetry.\n"); - break; - } - doc_ce->de_flags=old_de_flags; - } - SMTaskTitleSet(eletype); - switch (eletype) { - case SPT_COLOR: - doc_ce->de_flags|=DOCEF_DONT_DRAW; - i=PopUpColor(,,FALSE); - if (i>=0) { - color=i; - tempg=CAlloc(SpriteElemQuedBaseSize(SPT_COLOR)); - tempg->type=SPT_COLOR; - tempg->c.color=color; - QueIns(tempg,insert_pt->last); - SpriteEdUpdate(doc,doc_ce,head); - cur_elem_num++; - } - doc_ce->de_flags=old_de_flags; - eletype=SPT_MENU; - break; - case SPT_DITHER_COLOR: - doc_ce->de_flags|=DOCEF_DONT_DRAW; - i=PopUpColorDither; - if (i>=0) { - color=i; - tempg=CAlloc(SpriteElemQuedBaseSize(SPT_DITHER_COLOR)); - tempg->type=SPT_DITHER_COLOR; - tempg->d.dither_color=color.c0.color|color.c1.color<<8; - QueIns(tempg,insert_pt->last); - SpriteEdUpdate(doc,doc_ce,head); - cur_elem_num++; - } - doc_ce->de_flags=old_de_flags; - eletype=SPT_MENU; - break; - case SPT_ED_MENU: - switch (SpriteEd(doc,doc_ce,x,y,&head,&cur_elem_num)) { - case GE_ABORT: eletype=DOCM_CANCEL; break; - case GE_EXIT: eletype=SPT_EXIT; break; - case GE_CONT: eletype=SPT_MENU; break; - } - break; - case SPT_MESH: - doc_ce->de_flags|=DOCEF_DONT_DRAW; - SMMesh(doc,doc_ce,head,&cur_elem_num); - doc_ce->de_flags=old_de_flags; - eletype=SPT_MENU; - break; - case SPT_SHIFTABLE_MESH: - doc_ce->de_flags|=DOCEF_DONT_DRAW; - if (PopUpNoYes("Study the $$LK,\"X-Caliber\"," - "A=\"FF:::/PersonalMenu.TXT.Z,X-Caliber\"$$ icon.\n\n" - "It has black rectangle background with stars. The\n" - "mesh is in front and rotates. To keep the background\n" - "rectangle from rotating, " - "$$GREEN$$TRANSFORM OFF$$FG$$ has been used.\n\n" - "The X-Caliber mesh has a different origin for rotation.\n" - "To avoid clipping, it also has also been moved in the\n" - "negative Z direction by editing the sprite as text\n" - "and changing the first vector.\n\n" - "For the mesh you are creating, use same origin as\n" - "the rest of the sprite? If $$GREEN$$YES$$FG$$, you can always\n" - "shift the mesh origin point in the sprite edit menu.\n")) { - doc_ce->de_flags=old_de_flags; - a1=x; a2=y; - SMShiftableMesh(doc,doc_ce,head,x,y,a1,a2,&cur_elem_num); - eletype=SPT_MENU; - } else - PopUpOk("Select Origin.\n"); - doc_ce->de_flags=old_de_flags; - break; - case SPT_INS_SCREEN_BITMAP: - doc_ce->de_flags|=DOCEF_DONT_DRAW; - PopUpOk("Drag-out a rect for the extents of the\nbitmap.\n"); - doc_ce->de_flags=old_de_flags; - Fs->win_inhibit=WIG_TASK_DFT|WIF_FOCUS_TASK_IP_L|WIF_FOCUS_TASK_IP_R| - WIF_FOCUS_TASK_BORDER-WIF_SELF_FOCUS-WIF_SELF_GRAB_SCROLL; - break; - case SPT_BITMAP: - doc_ce->de_flags|=DOCEF_DONT_DRAW; - i=PopUpColor("Background Color\n\n",,FALSE); - if (i<0) - eletype=SPT_MENU; - else { - bm_bkcolor=i; - SpriteEdUpdate(doc,doc_ce,head); - SpriteExtents(doc_ce->bin_data->data,&xx1,&xx2,&yy1,&yy2); - if (!(xx1<=xx2 && yy1<=yy2)) - xx1=xx2=yy1=yy2=0; - if (PopUpExtents(&xx1,&xx2,&yy1,&yy2)) { - doc_ce->de_flags=old_de_flags; - xx1+=xx; yy1+=yy; - xx2+=xx; yy2+=yy; - if (SMBitMap(eletype,doc,doc_ce,head,dc,xx,yy,a1,a2,bm_bkcolor, - FALSE,xx1,yy1,xx2,yy2,&cur_elem_num)==GE_EXIT) { - res=GE_EXIT; - goto ei_done; - } - eletype=SPT_MENU; - } - } - doc_ce->de_flags=old_de_flags; - break; - case SPT_INS_TRANSPARENT_SCREEN_BITMAP: - doc_ce->de_flags|=DOCEF_DONT_DRAW; - i=PopUpColor("Color to Become Transparent\n\n",,FALSE); - if (i<0) - eletype=SPT_MENU; - else { - bm_bkcolor=i; - PopUpOk("Drag-out a rect for the extents of the\nbitmap.\n"); - } - doc_ce->de_flags=old_de_flags; - Fs->win_inhibit=WIG_TASK_DFT|WIF_FOCUS_TASK_IP_L|WIF_FOCUS_TASK_IP_R| - WIF_FOCUS_TASK_BORDER-WIF_SELF_FOCUS-WIF_SELF_GRAB_SCROLL; - break; - case SPT_WIDTH: - doc_ce->de_flags|=DOCEF_DONT_DRAW; - i=PopUpRangeI64(1,16,1,"Pen Width\n"); - if (i>=1) { - width=i; - tempg=CAlloc(SpriteElemQuedBaseSize(SPT_WIDTH)); - tempg->type=SPT_WIDTH; - tempg->w.width=width; - QueIns(tempg,insert_pt->last); - SpriteEdUpdate(doc,doc_ce,head); - cur_elem_num++; - } - doc_ce->de_flags=old_de_flags; - eletype=SPT_MENU; - break; - case SPT_TRANSFORM_ON: - case SPT_TRANSFORM_OFF: - tempg=CAlloc(SpriteElemQuedBaseSize(SPT_TRANSFORM_ON)); - if (eletype==SPT_TRANSFORM_ON) - tempg->type=SPT_TRANSFORM_ON; - else - tempg->type=SPT_TRANSFORM_OFF; - QueIns(tempg,insert_pt->last); - SpriteEdUpdate(doc,doc_ce,head); - cur_elem_num++; - eletype=SPT_MENU; - break; - case SPT_POLYGON: - doc_ce->de_flags|=DOCEF_DONT_DRAW; - i=PopUpRangeI64(3,16,1,"Num of Sides\n"); - doc_ce->de_flags=old_de_flags; - if (i<3) - eletype=SPT_MENU; - break; - case SPT_TEXT: - case SPT_TEXT_BOX: - case SPT_TEXT_DIAMOND: - SMTextFamily(eletype,doc,doc_ce,head,dc,xx,yy,a1,a2, - color,&cur_elem_num,old_de_flags); - eletype=SPT_MENU; - break; - } - - if (eletype!=SPT_MENU) { - insert_pt=SpriteSetSettings(dc,head,cur_elem_num,xx,yy, - &color,&width,&x,&y); - x+=xx; y+=yy; - SpriteScreenInit(dc,x,y); - if (eletype==SPT_EXIT) { - res=GE_EXIT; - goto ei_done; - } else if (eletype==DOCM_CANCEL) { - res=GE_ABORT; - goto ei_done; - } - switch (GetMsg(&a1,&a2,1<type=SPT_COLOR; - tempg->c.color=color; - QueIns(tempg,insert_pt->last); - SpriteEdUpdate(doc,doc_ce,head); - cur_elem_num++; - break; - case 't': //Set to transparent color - tempg=CAlloc(SpriteElemQuedBaseSize(SPT_COLOR)); - tempg->type=SPT_COLOR; - tempg->c.color=TRANSPARENT; - QueIns(tempg,insert_pt->last); - SpriteEdUpdate(doc,doc_ce,head); - cur_elem_num++; - break; - } - break; - case MSG_IP_R_UP: - if (eletype==SPT_PLANAR_SYMMETRY) { - tempg=CAlloc(SpriteElemQuedBaseSize(SPT_PLANAR_SYMMETRY)); - tempg->type=SPT_PLANAR_SYMMETRY; - QueIns(tempg,insert_pt->last); - SpriteEdUpdate(doc,doc_ce,head); - cur_elem_num++; - eletype=SPT_MENU; - } else - eletype=SPT_MENU; - break; - case MSG_IP_L_DOWN: - switch (eletype) { - start: - case SPT_LINE: - tempg=SMLine(dc,x,y,a1,a2,color); - break; - case SPT_ARROW: - tempg=SMArrow(dc,x,y,a1,a2,color); - break; - case SPT_PLANAR_SYMMETRY: - tempg=SMPlanarSymmetry(dc,x,y,a1,a2); - eletype=SPT_MENU; - break; - case SPT_RECT: - tempg=SMRect(dc,x,y,a1,a2,color); - break; - case SPT_INS_SCREEN_BITMAP: - case SPT_INS_TRANSPARENT_SCREEN_BITMAP: - tempg=SMScreenBitMap(eletype,dc,dc2,x,y,a1,a2,bm_bkcolor); - eletype=SPT_MENU; - break; - case SPT_CIRCLE: - tempg=SMCircle(dc,x,y,a1,a2,color); - break; - case SPT_ELLIPSE: - tempg=SMEllipse(dc,x,y,a1,a2,color); - break; - case SPT_POLYGON: - tempg=SMPolygon(dc,x,y,a1,a2,i,color); - eletype=SPT_MENU; - break; - case SPT_PT: - case SPT_FLOOD_FILL: - case SPT_FLOOD_FILL_NOT: - tempg=CAlloc(SpriteElemQuedBaseSize(eletype)); - tempg->type=eletype; - tempg->p.x1=a1-x; - tempg->p.y1=a2-y; - break; - case SPT_POLYLINE: - case SPT_BSPLINE2: - case SPT_BSPLINE3: - case SPT_BSPLINE2_CLOSED: - case SPT_BSPLINE3_CLOSED: - tempg=SMPolyLineFamily(eletype,dc,x,y,a1,a2,color); - break; - case SPT_POLYPT: - tempg=SMPolyPoint(dc,x,y,a1,a2,color); - break; - end: - if (tempg) { - QueIns(tempg,insert_pt->last); - SpriteEdUpdate(doc,doc_ce,head); - cur_elem_num++; - } - break; - case SPT_BITMAP: - if (SMBitMap(eletype,doc,doc_ce,head,dc,xx,yy,a1,a2,bm_bkcolor, - TRUE,,,,,&cur_elem_num)==GE_EXIT) { - res=GE_EXIT; - goto ei_done; - } - doc_ce->de_flags=old_de_flags; - eletype=SPT_MENU; - break; - case SPT_SHIFTABLE_MESH: - GetMsg(NULL,NULL,1<de_flags|=DOCEF_DONT_DRAW; - SMShiftableMesh(doc,doc_ce,head,x,y,a1,a2,&cur_elem_num); - doc_ce->de_flags=old_de_flags; - eletype=SPT_MENU; - break; - } - break; - } - } - } -ei_done: - DCFill; - SettingsPop; - doc_ce->de_flags=old_de_flags; - DCDel(dc); - DCDel(dc2); - StrCpy(Fs->task_title,old_task_title); - Free(old_task_title); - Fs->border_src=old_border_src; - Fs->title_src =old_title_src; - QueDel(head); - Free(head); - return res; -} - -U0 EdSpriteIns(CDoc *doc) -{ - Bool unlock; - U8 *st; - CDocEntry *doc_e; - CDocBin *tempb; - if (Fs!=doc->mem_task) - throw('Graphics'); - if (st=EdSprite(doc->cur_bin_num)) { - unlock=DocLock(doc); - tempb=CAlloc(sizeof(CDocBin),doc->mem_task); - tempb->size=sprite_elem_base_sizes[SPT_END]; - tempb->data=CAlloc(tempb->size,doc->mem_task); - tempb->num=doc->cur_bin_num++; - tempb->use_cnt=1; - QueIns(tempb,doc->bin_head.last); - doc_e=DocPrint(doc,"%s",st); - doc_e->bin_data=tempb; - Free(st); - if (doc_e) { - if (doc_e->de_flags&DOCEF_TAG && doc_e->tag && *doc_e->tag) - tempb->tag=StrNew(doc_e->tag,doc->mem_task); - doc->cur_entry=doc_e; - doc->cur_col=0; - DocUnlock(doc); - DocRecalc(doc); - if (SpriteMainEd(doc)==GE_ABORT) { - DocLock(doc); - DocEntryDel(doc,doc_e); - } - } else - DocBinDel(doc,tempb); - if (unlock) - DocUnlock(doc); - } - if (!(doc->flags & (DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS))) - DocBinsValidate(doc); -} - -U0 EdSpriteEd(CDoc *doc) -{ - CDocEntry *doc_ce; - CDocBin *tempb; - CSprite *old_csprite; - I64 old_size; - Bool unlock=DocLock(doc); - doc_ce=doc->cur_entry; - tempb=doc_ce->bin_data; - old_size=tempb->size; - old_csprite=tempb->data; - tempb->data=MAllocIdent(old_csprite,doc->mem_task); - DocUnlock(doc); - if (SpriteMainEd(doc)==GE_ABORT) { - DocLock(doc); - Free(tempb->data); - tempb->data=old_csprite; - tempb->size=old_size; - } else - Free(old_csprite); - if (unlock) - DocUnlock(doc); -} diff --git a/Adam/Gr/SpriteMain.HC b/Adam/Gr/SpriteMain.HC new file mode 100644 index 0000000..c1da4e6 --- /dev/null +++ b/Adam/Gr/SpriteMain.HC @@ -0,0 +1,1231 @@ +#help_index "Graphics/Sprite;Sprites" + +#define SPT_MENU -2 +#define SPT_INS_SCREEN_BITMAP -3 +#define SPT_INS_TRANSPARENT_SCREEN_BITMAP -4 +#define SPT_ED_MENU -5 +#define SPT_EXIT -6 + +I64 PopUpSpriteMain(CSprite **_head,I64 *_cur_elem_num, + CDoc *_doc,CDocEntry *_doc_e) +{ + CTask *pu_task; + I64 i; + CDoc *doc=DocNew; + CDocEntry *doc_de; + U8 *st; + + doc_de=DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Sprite Main Menu\"$$\n" + "$$LK+PU+CX,\"Click for Help\",A=\"FI:::/Doc/SpriteMain.DD.Z\"$$\n" + "\n$$LTBLUE$$$$DA+M,A=\"Tag Text:%%s\"$$\n\n"); + doc_de->data=StrNew(_doc_e->tag,doc->mem_task); + DocDataFmt(doc,doc_de); + + DocPrint(doc,"$$MU-UL,\"Color (4-bit)\",LE=SPT_COLOR$$\n" + "$$MU-UL,\"Dither Color (4-bit)\",LE=SPT_DITHER_COLOR$$\n" + "$$MU-UL,\"Width\",LE=SPT_WIDTH$$\n" + "$$MU-UL,\"Planar Symmetry\",LE=SPT_PLANAR_SYMMETRY$$\n" + "\n$$MU-UL,\"Point\",LE=SPT_PT$$\n" + "$$MU-UL,\"Line\",LE=SPT_LINE$$\n" + "$$MU-UL,\"Arrow\",LE=SPT_ARROW$$\n" + "$$MU-UL,\"Rect\",LE=SPT_RECT$$\n" + "$$MU-UL,\"Circle\",LE=SPT_CIRCLE$$\n" + "$$MU-UL,\"Ellipse\",LE=SPT_ELLIPSE$$\n" + "$$MU-UL,\"Polygon\",LE=SPT_POLYGON$$\n" + "$$MU-UL,\"Text\",LE=SPT_TEXT$$\n" + "$$MU-UL,\"Text Box\",LE=SPT_TEXT_BOX$$\n" + "$$MU-UL,\"Text Diamond\",LE=SPT_TEXT_DIAMOND$$\n" + "$$MU-UL,\"Flood Fill\",LE=SPT_FLOOD_FILL$$\n" + "$$MU-UL,\"Flood Fill Not Color\",LE=SPT_FLOOD_FILL_NOT$$\n" + "$$MU-UL,\"PolyLine\",LE=SPT_POLYLINE$$\n" + "$$MU-UL,\"PolyPoint\",LE=SPT_POLYPT$$\n" + "$$MU-UL,\"BSpline2\",LE=SPT_BSPLINE2$$\n" + "$$MU-UL,\"BSpline3\",LE=SPT_BSPLINE3$$\n" + "$$MU-UL,\"BSpline2 Closed\",LE=SPT_BSPLINE2_CLOSED$$\n" + "$$MU-UL,\"BSpline3 Closed\",LE=SPT_BSPLINE3_CLOSED$$\n" + "$$MU-UL,\"Insert Screen-Captured BitMap\",LE=SPT_INS_SCREEN_BITMAP$$\n" + "$$MU-UL,\"Insert Transparent Screen-Captured BitMap\"," + "LE=SPT_INS_TRANSPARENT_SCREEN_BITMAP$$\n" + "$$PURPLE$$$$MU-UL,\"+] Create or Edit 3D Mesh\",LE=SPT_MESH$$\n" + "$$MU-UL,\"+] Create or Edit Shiftable 3D Mesh\"," + "LE=SPT_SHIFTABLE_MESH$$\n" + "$$MU-UL,\"+] Convert to BitMap or Edit BitMap\"," + "LE=SPT_BITMAP$$$$LTBLUE$$\n" + "\n$$MU-UL,\"Transform On (for use with 3D icons)\"," + "LE=SPT_TRANSFORM_ON$$\n" + "$$MU-UL,\"Transform Off (for use with 3D icons)\"," + "LE=SPT_TRANSFORM_OFF$$\n" + "\n" + "$$PURPLE$$$$MU-UL,\"+] Sprite Edit Menu\",LE=SPT_ED_MENU$$$$LTBLUE$$\n" + "$$MU-UL,\"Exit Sprite\",LE=SPT_EXIT$$\n" + "$$MU-UL,\"Abort Sprite\",LE=DOCM_CANCEL$$\n" + "\nRight-Click to get back to this menu."); + st=MStrPrint("SpriteSideBarTask(0x%X,0x%X,0x%X);",Fs,_head,_cur_elem_num); + PopUp(st,NULL,&pu_task); + Free(st); + i=PopUpMenu(doc); + if (TaskValidate(pu_task)) { + *_head=SpriteSideBar2SpriteQue(DocPut(pu_task),*_head,_cur_elem_num); + Kill(pu_task); + } + Free(_doc_e->tag); + _doc_e->tag=StrNew(doc_de->data,_doc->mem_task); + _doc->cur_col=0; + DocDel(doc); + return i; +} + +Bool PopUpExtents(I64 *_x1,I64 *_x2,I64 *_y1,I64 *_y2) +{ + I64 i; + CDoc *doc=DocNew; + CDocEntry *doc_e; + doc_e=DocPrint(doc," $$DA,A=\"x1:%%d\"$$\n"); + doc_e->data=_x1; + DocDataFmt(doc,doc_e); + doc_e=DocPrint(doc," $$DA,A=\"x2:%%d\"$$\n"); + doc_e->data=_x2; + DocDataFmt(doc,doc_e); + doc_e=DocPrint(doc," $$DA,A=\"y1:%%d\"$$\n"); + doc_e->data=_y1; + DocDataFmt(doc,doc_e); + doc_e=DocPrint(doc," $$DA,A=\"y2:%%d\"$$\n\n"); + doc_e->data=_y2; + DocDataFmt(doc,doc_e); + + DocPrint(doc," $$BT,\"Use These Extents\",LE=TRUE$$"); + DocPrint(doc,"$$CM,3,0$$$$BT,\"Drag-Out New Extents\",LE=FALSE$$\n\n"); + do i=PopUpMenu(doc); + while (i!=FALSE && i!=TRUE); + DocDel(doc); + return i; +} + +U0 SpriteScreenInit(CDC *dc,I64,I64) +{ +//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.HC"$. + I64 xx,yy,old_pen_width=dc->pen_width; + CColorROPU32 old_color=dc->color; + WinMgrSync; + DCFill(dc); + if (dc->flags&DCF_SYMMETRY) { + dc->flags&=~DCF_SYMMETRY; + dc->pen_width=1; + xx=dc->sym.sny*8192; + yy=-dc->sym.snx*8192; + dc->color=RED; + GrLine3(dc,dc->sym.sx-xx.i32[1],dc->sym.sy-yy.i32[1],0, + dc->sym.sx+xx.i32[1],dc->sym.sy+yy.i32[1],0,3,0); + dc->color=WHITE; + GrLine3(dc,dc->sym.sx-xx.i32[1],dc->sym.sy-yy.i32[1],0, + dc->sym.sx+xx.i32[1],dc->sym.sy+yy.i32[1],0,3,1); + dc->color=BLACK; + GrLine3(dc,dc->sym.sx-xx.i32[1],dc->sym.sy-yy.i32[1],0, + dc->sym.sx+xx.i32[1],dc->sym.sy+yy.i32[1],0,3,2); + dc->flags|=DCF_SYMMETRY; + } + dc->color=old_color; + dc->pen_width=old_pen_width; +} + +CSprite *SMLine(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color) +{ + I64 msg_code,x1=a1,y1=a2,x2=a1,y2=a2; + CSprite *res; + do { + dc->color=color&COLORROP_NO_ROP0_MASK; + GrLine3(dc,x1,y1,0,x2,y2,0); + msg_code=GetMsg(&a1,&a2,1<color=color&COLORROP_NO_ROP0_MASK; + GrLine3(dc,x1,y1,0,x2,y2,0); + res=CAlloc(SpriteElemQuedBaseSize(SPT_LINE)); + res->type=SPT_LINE; + res->pp.x1=x1-x; + res->pp.y1=y1-y; + res->pp.x2=x2-x; + res->pp.y2=y2-y; + return res; +} + +CSprite *SMArrow(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color) +{ + I64 msg_code,x1=a1,y1=a2,x2=a1,y2=a2; + CSprite *res; + do { + dc->color=color&COLORROP_NO_ROP0_MASK; + GrArrow3(dc,x1,y1,0,x2,y2,0); + msg_code=GetMsg(&a1,&a2,1<color=color&COLORROP_NO_ROP0_MASK; + GrArrow3(dc,x1,y1,0,x2,y2,0); + res=CAlloc(SpriteElemQuedBaseSize(SPT_ARROW)); + res->type=SPT_ARROW; + res->pp.x1=x1-x; + res->pp.y1=y1-y; + res->pp.x2=x2-x; + res->pp.y2=y2-y; + return res; +} + +CSprite *SMPlanarSymmetry(CDC *dc,I64 x,I64 y,I64 a1,I64 a2) +{ + I64 msg_code,x1=a1,y1=a2,x2=a1,y2=a2,old_width,old_flags; + CSprite *res; + old_width=dc->pen_width; + old_flags=dc->flags; + dc->flags&=~DCF_SYMMETRY; + dc->pen_width=1; + do { + dc->color=ROPF_DITHER+WHITE<<16+BLACK; + GrLine3(dc,x1,y1,0,x2,y2,0); + msg_code=GetMsg(&a1,&a2,1<flags=old_flags&DCF_SYMMETRY|dc->flags&~DCF_SYMMETRY; + dc->pen_width=old_width; + res=CAlloc(SpriteElemQuedBaseSize(SPT_PLANAR_SYMMETRY)); + res->type=SPT_PLANAR_SYMMETRY; + res->pp.x1=x1-x; + res->pp.y1=y1-y; + res->pp.x2=x2-x; + res->pp.y2=y2-y; + return res; +} + +CSprite *SMRect(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color) +{ + I64 msg_code,x1=a1,y1=a2,x2=a1,y2=a2,xx1=a1,yy1=a2,xx2=a1,yy2=a2; + CSprite *res; + do { + dc->color=color&COLORROP_NO_ROP0_MASK; + GrRect3(dc,xx1,yy1,0,xx2-xx1,yy2-yy1); + msg_code=GetMsg(&a1,&a2,1<color=color&COLORROP_NO_ROP0_MASK; + GrRect3(dc,xx1,yy1,0,xx2-xx1,yy2-yy1); + res=CAlloc(SpriteElemQuedBaseSize(SPT_RECT)); + res->type=SPT_RECT; + res->pp.x1=xx1-x; + res->pp.y1=yy1-y; + res->pp.x2=xx2-x; + res->pp.y2=yy2-y; + return res; +} + +CSprite *SMScreenBitMap(I64 eletype,CDC *dc,CDC *dc2,I64 x,I64 y,I64 a1,I64 a2, + CColorROPU32 bm_bkcolor) +{ + I64 i,msg_code,x1=a1,y1=a2,x2=a1,y2=a2,xx1=a1,yy1=a2,xx2=a1,yy2=a2,old_width; + CDC *dc3,*img; + CSprite *res; + old_width=dc2->pen_width; + dc2->pen_width=1; + do { + dc2->color=ROPF_DITHER+WHITE<<16+BLACK; + GrBorder(dc2,xx1+Fs->pix_left+Fs->scroll_x,yy1+Fs->pix_top+Fs->scroll_y, + xx2+Fs->pix_left+Fs->scroll_x,yy2+Fs->pix_top+Fs->scroll_y); + msg_code=GetMsg(&a1,&a2,1<type=SPT_BITMAP; + res->pwhu.width=xx2-xx1; + res->pwhu.height=yy2-yy1; + res->pwhu.x1=0; + res->pwhu.y1=0; + SpriteScreenInit(dc,x,y); + i=gr.screen_zoom; + GrScaleZoom(1.0/i); + WinMgrSync(2,TRUE); + + dc3=DCScreenCapture; + img=DCExt(dc3,Fs->pix_left+Fs->scroll_x+xx1,Fs->pix_top+Fs->scroll_y+yy1, + Fs->pix_left+Fs->scroll_x+xx2-1,Fs->pix_top+Fs->scroll_y+yy2-1); + if (eletype==SPT_INS_TRANSPARENT_SCREEN_BITMAP) + DCColorChg(img,bm_bkcolor); + GrScaleZoom(i); + MemCpy(&res->pwhu.u,img->body,((xx2-xx1+7)&~7)*(yy2-yy1)); + DCDel(img); + DCDel(dc3); + dc2->pen_width=old_width; + Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS + -WIF_SELF_BORDER-WIF_SELF_GRAB_SCROLL; + return res; +} + +CSprite *SMCircle(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color) +{ + I64 msg_code,x1=a1,y1=a2,x2=a1,y2=a2; + CSprite *res; + do { + dc->color=color&COLORROP_NO_ROP0_MASK; + GrCircle3(dc,x1,y1,0,Sqrt(SqrI64(x1-x2)+SqrI64(y1-y2))); + msg_code=GetMsg(&a1,&a2,1<color=color&COLORROP_NO_ROP0_MASK; + GrCircle3(dc,x1,y1,0,Sqrt(SqrI64(x1-x2)+SqrI64(y1-y2))); + res=CAlloc(SpriteElemQuedBaseSize(SPT_CIRCLE)); + res->type=SPT_CIRCLE; + res->pr.x1=x1-x; + res->pr.y1=y1-y; + res->pr.radius=Sqrt(SqrI64(x1-x2)+SqrI64(y1-y2)); + return res; +} + +CSprite *SMEllipse(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color) +{ + I64 msg_code,x1=a1,y1=a2,x2=a1,y2=a2; + F64 angle1,angle2; + CSprite *res; + do { + dc->color=color&COLORROP_NO_ROP0_MASK; + GrEllipse3(dc,(x1+x2)>>1,(y1+y2)>>1,0,AbsI64(x1-x2)>>1,AbsI64(y1-y2)>>1); + msg_code=GetMsg(&a1,&a2,1<type=SPT_ELLIPSE; + res->pwha.x1=(x1+x2)>>1-x; + res->pwha.y1=(y1+y2)>>1-y; + res->pwha.width =AbsI64(x1-x2)>>1; + res->pwha.height=AbsI64(y1-y2)>>1; + angle2=Arg(x2-(res->pwha.x1+x),y2-(res->pwha.y1+y)); + if (res->pwha.widthpwha.height) + angle2-=ã/2.0; + do { + angle1=Arg(x2-(res->pwha.x1+x),y2-(res->pwha.y1+y)); + if (res->pwha.width>=res->pwha.height) + res->pwha.angle=-(angle1-angle2); + else + res->pwha.angle=-(angle1-angle2)+ã/2.0; + dc->color=color&COLORROP_NO_ROP0_MASK; + GrEllipse3(dc,res->pwha.x1+x,res->pwha.y1+y,0, + res->pwha.width,res->pwha.height,res->pwha.angle); + msg_code=GetMsg(&a1,&a2,1<pwha.x1+x),y2-(res->pwha.y1+y)); + if (res->pwha.width>=res->pwha.height) + res->pwha.angle=-(angle1-angle2); + else + res->pwha.angle=-(angle1-angle2)+ã/2.0; + dc->color=color&COLORROP_NO_ROP0_MASK; + GrEllipse3(dc,res->pwha.x1+x,res->pwha.y1+y,0, + res->pwha.width,res->pwha.height,res->pwha.angle); + return res; +} + +CSprite *SMPolygon(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,I64 sides, + CColorROPU32 color) +{ + I64 msg_code,x1=a1,y1=a2,x2=a1,y2=a2; + F64 angle1,angle2; + CSprite *res; + do { + dc->color=color&COLORROP_NO_ROP0_MASK; + GrRegPoly3(dc,(x1+x2)>>1,(y1+y2)>>1,0, + AbsI64(x1-x2)>>1,AbsI64(y1-y2)>>1,sides); + msg_code=GetMsg(&a1,&a2,1<type=SPT_POLYGON; + res->pwhas.x1=(x1+x2)>>1-x; + res->pwhas.y1=(y1+y2)>>1-y; + res->pwhas.width =AbsI64(x1-x2)>>1; + res->pwhas.height=AbsI64(y1-y2)>>1; + res->pwhas.sides=sides; + angle2=Arg(x2-(res->pwhas.x1+x),y2-(res->pwhas.y1+y)); + if (res->pwhas.widthpwhas.height) + angle2-=ã/2.0; + do { + angle1=Arg(x2-(res->pwhas.x1+x),y2-(res->pwhas.y1+y)); + if (res->pwhas.width>=res->pwhas.height) + res->pwhas.angle=-(angle1-angle2); + else + res->pwhas.angle=-(angle1-angle2)+ã/2.0; + dc->color=color&COLORROP_NO_ROP0_MASK; + GrRegPoly3(dc,res->pwhas.x1+x,res->pwhas.y1+y,0, + res->pwhas.width,res->pwhas.height, + res->pwhas.sides,res->pwhas.angle); + msg_code=GetMsg(&a1,&a2,1<pwhas.x1+x),y2-(res->pwhas.y1+y)); + if (res->pwhas.width>=res->pwhas.height) + res->pwhas.angle=-(angle1-angle2); + else + res->pwhas.angle=-(angle1-angle2)+ã/2.0; + dc->color=color&COLORROP_NO_ROP0_MASK; + GrRegPoly3(dc,res->pwhas.x1+x,res->pwhas.y1+y,0, + res->pwhas.width,res->pwhas.height,res->pwhas.sides, + res->pwhas.angle); + return res; +} + +CSprite *SMPolyLineFamily(I64 eletype,CDC *dc,I64 x,I64 y,I64 a1,I64 a2, + CColorROPU32 color) +{ + I64 i,num=0,msg_code,x1=a1,y1=a2,x2=a1,y2=a2; + I32 *ptr; + CD3I32 *p; + CSprite *res,*tempg,*tempg1,head2; + + QueInit(&head2); + do { + do { + dc->color=color&COLORROP_NO_ROP0_MASK; + if (num) + GrLine3(dc,x1,y1,0,x2,y2,0); + msg_code=GetMsg(&a1,&a2,1<color=TRANSPARENT; + if (num) + GrLine3(dc,x1,y1,0,x2,y2,0); + x2=a1; y2=a2; + } while (msg_code!=MSG_IP_L_UP && msg_code!=MSG_IP_R_UP); + dc->color=color&COLORROP_NO_ROP0_MASK; + if (msg_code==MSG_IP_L_UP) { + if (num) + GrLine3(dc,x1,y1,0,x2,y2,0); + res=CAlloc(SpriteElemQuedBaseSize(SPT_PT)); + res->type=SPT_PT; + res->p.x1=x2-x; + res->p.y1=y2-y; + QueIns(res,head2.last); + x1=x2;y1=y2; + num++; + } + } while (msg_code!=MSG_IP_R_UP); + + switch (eletype) { + case SPT_POLYLINE: + if (num>1) { + res=CAlloc(SpriteElemQuedBaseSize(SPT_POLYLINE)+num*sizeof(CD2I32)); + ptr=&res->nu.u; + tempg1=head2.next; + for (i=0;inext; + ptr[i<<1]=tempg1->p.x1; + ptr[i<<1+1]=tempg1->p.y1; + Free(tempg1); + tempg1=tempg; + } + res->type=SPT_POLYLINE; + res->nu.num=num; + } else { + tempg1=head2.next; + for (i=0;inext; + Free(tempg1); + tempg1=tempg; + } + res=NULL; + } + break; + case SPT_BSPLINE2: + case SPT_BSPLINE3: + case SPT_BSPLINE2_CLOSED: + case SPT_BSPLINE3_CLOSED: + if (num>2) { + res=CAlloc(SpriteElemQuedBaseSize(eletype)+num*sizeof(CD3I32)); + p=&res->nu.u; + tempg1=head2.next; + for (i=0;inext; + p[i].x=tempg1->p.x1; + p[i].y=tempg1->p.y1; + Free(tempg1); + tempg1=tempg; + } + res->type=eletype; + res->nu.num=num; + } else { + tempg1=head2.next; + for (i=0;inext; + Free(tempg1); + tempg1=tempg; + } + res=NULL; + } + break; + } + return res; +} + +CSprite *SMPolyPoint(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color) +{ + I64 i,num=0,msg_code,x1=a1,y1=a2,x2=a1,y2=a2,x3,y3; + I32 *ptr; + CSprite *res,*tempg,*tempg1,head2; + + QueInit(&head2); + x3=a1-x; y3=a2-y; + dc->color=color&COLORROP_NO_ROP0_MASK; + do { + msg_code=GetMsg(&a1,&a2,1<next; + if (res->p.x1==x1 && res->p.y1==y1) { + QueRem(res); + Free(res); + } else { + num++; + x1=res->p.x1; + y1=res->p.y1; + } + res=tempg; + } + + res=CAlloc(SpriteElemQuedBaseSize(SPT_POLYPT)+(num*3+7)>>3); + res->npu.x=x3; + res->npu.y=y3; + ptr=&res->npu.u; + x1=x3; y1=y3; + i=0; + tempg1=head2.next; + while (tempg1!=&head2) { + tempg=tempg1->next; + BFieldOrU32(ptr,i,polypt_map[SignI64(tempg1->p.x1-x1)+1+ + 3*(SignI64(tempg1->p.y1-y1)+1)]); + i+=3; + x1=tempg1->p.x1;y1=tempg1->p.y1; + QueRem(tempg1); + Free(tempg1); + tempg1=tempg; + } + res->type=SPT_POLYPT; + res->npu.num=num; + return res; +} + +U0 SMTextFamily(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *head,CDC *dc, + I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color,I64 *_cur_elem_num, + I64 old_de_flags) +{ + CSprite *tempg,*insert_pt=SpriteSetSettings(,head,*_cur_elem_num); + I64 msg_code,x1,y1; + U8 *st; + doc_ce->de_flags|=DOCEF_DONT_DRAW; + st=PopUpGetStr("Enter text and press .\n"); + doc_ce->de_flags=old_de_flags; + if (st && *st) { + x1=0; y1=0; + do { + dc->color=color&COLORROP_NO_ROP0_MASK; + switch (eletype) { + case SPT_TEXT: GrPrint3(dc,x1,y1,0,"%s",st); break; + case SPT_TEXT_BOX: GrTextBox3(dc,x1,y1,0,st); break; + case SPT_TEXT_DIAMOND: GrTextDiamond3(dc,x1,y1,0,st); break; + } + msg_code=GetMsg(&a1,&a2,1<type=eletype; + tempg->ps.x1=x1-x; + tempg->ps.y1=y1-y; + StrCpy(tempg->ps.st,st); + QueIns(tempg,insert_pt->last); + SpriteEdUpdate(doc,doc_ce,head); + *_cur_elem_num+=1; + } + Free(st); +} + +I64 SMBitMap(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *head, + CDC *dc,I64 xx,I64 yy,I64 a1,I64 a2,CColorROPU32 bm_bkcolor, + 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; + CSprite *tempg,*tempg1,*insert_pt; + CDC *img; + + insert_pt=SpriteSetSettings(,head,*_cur_elem_num,xx,yy,,,&x,&y); + x+=xx; y+=yy; + + if (sel) { + xx1=a1; yy1=a2; + xx2=a1; yy2=a2; + old_width=dc->pen_width; + dc->pen_width=1; + do { + dc->color=ROPF_DITHER+WHITE<<16+BLACK; + GrBorder(dc,xx1,yy1,xx2,yy2); + msg_code=GetMsg(&a1,&a2,1<pen_width=old_width; + } + + xx2++; yy2++; + tempg=CAlloc(SpriteElemQuedBaseSize(SPT_BITMAP)+ + ((xx2-xx1+7)&~7)*(yy2-yy1)); + tempg->type=SPT_BITMAP; + tempg->pwhu.width=xx2-xx1; + tempg->pwhu.height=yy2-yy1; + tempg->pwhu.x1=xx1-x; + tempg->pwhu.y1=yy1-y; + img=DCNew(tempg->pwhu.width,tempg->pwhu.height,Fs); + img->color=bm_bkcolor; + GrRect(img,0,0,tempg->pwhu.width,tempg->pwhu.height); + tempg1=insert_pt; + if (tempg1==head || tempg1->type!=SPT_BITMAP) { + SpriteSetSettings(img,head,0,-(xx1-x),-(yy1-y)); + x=xx; y=yy; + Sprite3(img,-(xx1-x),-(yy1-y),0,doc_ce->bin_data->data); + QueDel(head); + insert_pt=head->next=head->last=head; + *_cur_elem_num=1; + } else { + SpriteSetSettings(img,head,*_cur_elem_num,-(xx1-x),-(yy1-y)); + Sprite3(img,-(xx1-x),-(yy1-y),0,&tempg1->start,TRUE); + insert_pt=tempg1->next; + QueRem(tempg1); + Free(tempg1); + } + MemCpy(&tempg->pwhu.u,img->body,((xx2-xx1+7)&~7)*(yy2-yy1)); + + switch (i=SpriteBitMapEd(doc,doc_ce,dc,&xx1,&yy1, + &xx2,&yy2,&img,bm_bkcolor)) { + case GE_EXIT: + case GE_CONT: + Free(tempg); + tempg=CAlloc(SpriteElemQuedBaseSize(SPT_BITMAP)+ + ((xx2-xx1+7)&~7)*(yy2-yy1)); + tempg->type=eletype; + tempg->pwhu.width=xx2-xx1; + tempg->pwhu.height=yy2-yy1; + tempg->pwhu.x1=xx1-x; + tempg->pwhu.y1=yy1-y; + MemCpy(&tempg->pwhu.u,img->body,((xx2-xx1+7)&~7)*(yy2-yy1)); + break; + } + QueIns(tempg,insert_pt->last); + DCDel(img); + SpriteEdUpdate(doc,doc_ce,head); + return i; +} + +U0 SMMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *head,I64 *_cur_elem_num) +{ + CSprite *tempg,*insert_pt=SpriteSetSettings(,head,*_cur_elem_num), + *tempg1=insert_pt; + CD3I32 *p; + I64 i,size,x1,y1,z1; + I32 *mesh,*old_mesh; + if (tempg1!=head && tempg1->type==SPT_MESH) + old_mesh=&tempg1->mu.vertex_cnt; + else if (tempg1!=head && tempg1->type==SPT_SHIFTABLE_MESH) { + x1=tempg1->pmu.x; + y1=tempg1->pmu.y; + z1=tempg1->pmu.z; + p=&tempg1->pmu.u; + for (i=0;ipmu.vertex_cnt;i++,p++) { + p->x+=x1; + p->y+=y1; + p->z+=z1; + } + old_mesh=&tempg1->pmu.vertex_cnt; + } else + old_mesh=NULL; + if (mesh=SpriteMeshEd(old_mesh,&size,TRUE)) { + tempg=CAlloc(SpriteElemQuedBaseSize(SPT_MESH)-sizeof(I32)*2+size); + tempg->type=SPT_MESH; + MemCpy(&tempg->mu.vertex_cnt,mesh,size); + Free(mesh); + QueIns(tempg,insert_pt->last); + SpriteEdUpdate(doc,doc_ce,head); + if (old_mesh) { + insert_pt=tempg; + QueRem(tempg1); + Free(tempg1); + SpriteEdUpdate(doc,doc_ce,head); + } else + *_cur_elem_num+=1; + } else if (old_mesh && tempg1->type==SPT_SHIFTABLE_MESH) { + x1=tempg1->pmu.x; + y1=tempg1->pmu.y; + z1=tempg1->pmu.z; + p=&tempg1->pmu.u; + for (i=0;ipmu.vertex_cnt;i++,p++) { + p->x-=x1; + p->y-=y1; + p->z-=z1; + } + } +} + +U0 SMShiftableMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *head, + I64 x,I64 y,I64 a1,I64 a2,I64 *_cur_elem_num) +{ + CSprite *tempg,*insert_pt=SpriteSetSettings(,head,*_cur_elem_num), + *tempg1=insert_pt; + CD3I32 *p; + I64 i,size,z,x1,y1,z1; + I32 *mesh,*old_mesh; + if (tempg1!=head && tempg1->type==SPT_MESH) { + z=0; + x1=-(a1-x); + y1=-(a2-y); + z1=z; + p=&tempg1->mu.u; + for (i=0;imu.vertex_cnt;i++,p++) { + p->x+=x1; + p->y+=y1; + p->z+=z1; + } + old_mesh=&tempg1->mu.vertex_cnt; + } else if (tempg1!=head && tempg1->type==SPT_SHIFTABLE_MESH) { + z=-tempg1->pmu.z; + x1=tempg1->pmu.x-(a1-x); + y1=tempg1->pmu.y-(a2-y); + z1=tempg1->pmu.z+z; + p=&tempg1->pmu.u; + for (i=0;ipmu.vertex_cnt;i++,p++) { + p->x+=x1; + p->y+=y1; + p->z+=z1; + } + old_mesh=&tempg1->pmu.vertex_cnt; + } else { + z=0; + old_mesh=NULL; + } + if (mesh=SpriteMeshEd(old_mesh,&size,TRUE)) { + tempg=CAlloc(SpriteElemQuedBaseSize(SPT_SHIFTABLE_MESH)-sizeof(I32)*2+size); + tempg->type=SPT_SHIFTABLE_MESH; + MemCpy(&tempg->pmu.vertex_cnt,mesh,size); + Free(mesh); + tempg->pmu.x=a1-x; + tempg->pmu.y=a2-y; + tempg->pmu.z=-z; + QueIns(tempg,insert_pt->last); + SpriteEdUpdate(doc,doc_ce,head); + if (old_mesh) { + insert_pt=tempg; + QueRem(tempg1); + Free(tempg1); + SpriteEdUpdate(doc,doc_ce,head); + } else + *_cur_elem_num+=1; + } else if (old_mesh && tempg1->type==SPT_SHIFTABLE_MESH) { + x1=tempg1->pmu.x-(a1-x); + y1=tempg1->pmu.y-(a2-y); + z1=tempg1->pmu.z+z; + p=&tempg1->pmu.u; + for (i=0;ipmu.vertex_cnt;i++,p++) { + p->x-=x1; + p->y-=y1; + p->z-=z1; + } + } else if (old_mesh && tempg1->type==SPT_MESH) { + x1=-(a1-x); + y1=-(a2-y); + z1= z; + p=&tempg1->mu.u; + for (i=0;imu.vertex_cnt;i++,p++) { + p->x-=x1; + p->y-=y1; + p->z-=z1; + } + } +} + +U0 SMTaskTitleSet(I64 eletype) +{ + Fs->title_src=TTS_CONST; //Violates TTS_LOCKED_CONST + switch (eletype) { + case SPT_INS_SCREEN_BITMAP: + StrCpy(Fs->task_title,"Insert Screen BitMap"); + break; + case SPT_INS_TRANSPARENT_SCREEN_BITMAP: + StrCpy(Fs->task_title,"Insert Transparent Screen BitMap"); + break; + default: + if (eletype>=0) + StrCpy(Fs->task_title,DefineSub(eletype,"ST_SPRITE_ELEM_TYPES")); + } + Fs->border_src=BDS_CONST; +} + +I64 SpriteMainEd(CDoc *doc) +{ + CDocEntry *doc_ce=doc->cur_entry; + I64 res,i,x,y,a1,a2,xx,yy,xx1,yy1,xx2,yy2,width,eletype=SPT_MENU, + cur_elem_num,old_border_src=Fs->border_src,old_title_src=Fs->title_src, + old_de_flags=doc_ce->de_flags; + CColorROPU32 bm_bkcolor,color; + CSprite *head,*tempg,*insert_pt; + CDC *dc=DCAlias(,Fs),*dc2=DCAlias(,sys_winmgr_task),*dc3; + U8 *old_task_title=StrNew(Fs->task_title); + + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + AutoComplete; + WinMgrSync(2,TRUE); + dc2->flags|=DCF_ON_TOP; + head=Sprite2SpriteQue(doc_ce->bin_data->data); + cur_elem_num=QueCnt(head); + xx=(doc_ce->x+doc_ce->max_col-doc->line_start_col)*FONT_WIDTH; + yy=(doc_ce->y-doc->top_line_num)*FONT_HEIGHT; + + while (TRUE) { + insert_pt=SpriteSetSettings(dc,head,cur_elem_num,xx,yy, + &color,&width,&x,&y); + x+=xx; y+=yy; + DCFill; + if (eletype==SPT_MENU) { + Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS + -WIF_SELF_BORDER-WIF_SELF_GRAB_SCROLL; + if (winmgr.fps<10) + doc_ce->de_flags|=DOCEF_DONT_DRAW; + StrCpy(Fs->task_title,old_task_title); + Fs->border_src=old_border_src; + Fs->title_src =old_title_src; + + xx-=StrLen(doc_ce->tag)*FONT_WIDTH; + eletype=PopUpSpriteMain(&head,&cur_elem_num,doc,doc_ce); + xx+=StrLen(doc_ce->tag)*FONT_WIDTH; + insert_pt=SpriteSetSettings(dc,head,cur_elem_num,x,y, + &color,&width,&x,&y); + x+=xx; y+=yy; + + SpriteEdUpdate(doc,doc_ce,head); + switch (eletype) { + case SPT_FLOOD_FILL: + case SPT_FLOOD_FILL_NOT: + RegOneTimePopUp(ARf_FLOODFILL, + ST_WARN_ST "This is affected by what's underneath\n" + "when it is drawn. You will probably want to\n" + "convert it to a bitmap.\n\n" + "A tip on artistry you might consider\n" + "is using lines to fill regions because\n" + "brush strokes look cool.\n"); + break; + case SPT_PLANAR_SYMMETRY: + RegOneTimePopUp(ARf_PLANAR_SYMMETRY, + "Right-click to turn-off symmetry.\n"); + break; + } + doc_ce->de_flags=old_de_flags; + } + SMTaskTitleSet(eletype); + switch (eletype) { + case SPT_COLOR: + doc_ce->de_flags|=DOCEF_DONT_DRAW; + i=PopUpColor(,,FALSE); + if (i>=0) { + color=i; + tempg=CAlloc(SpriteElemQuedBaseSize(SPT_COLOR)); + tempg->type=SPT_COLOR; + tempg->c.color=color; + QueIns(tempg,insert_pt->last); + SpriteEdUpdate(doc,doc_ce,head); + cur_elem_num++; + } + doc_ce->de_flags=old_de_flags; + eletype=SPT_MENU; + break; + case SPT_DITHER_COLOR: + doc_ce->de_flags|=DOCEF_DONT_DRAW; + i=PopUpColorDither; + if (i>=0) { + color=i; + tempg=CAlloc(SpriteElemQuedBaseSize(SPT_DITHER_COLOR)); + tempg->type=SPT_DITHER_COLOR; + tempg->d.dither_color=color.c0.color|color.c1.color<<8; + QueIns(tempg,insert_pt->last); + SpriteEdUpdate(doc,doc_ce,head); + cur_elem_num++; + } + doc_ce->de_flags=old_de_flags; + eletype=SPT_MENU; + break; + case SPT_ED_MENU: + switch (SpriteEd(doc,doc_ce,x,y,&head,&cur_elem_num)) { + case GE_ABORT: eletype=DOCM_CANCEL; break; + case GE_EXIT: eletype=SPT_EXIT; break; + case GE_CONT: eletype=SPT_MENU; break; + } + break; + case SPT_MESH: + doc_ce->de_flags|=DOCEF_DONT_DRAW; + SMMesh(doc,doc_ce,head,&cur_elem_num); + doc_ce->de_flags=old_de_flags; + eletype=SPT_MENU; + break; + case SPT_SHIFTABLE_MESH: + doc_ce->de_flags|=DOCEF_DONT_DRAW; + if (PopUpNoYes("Study the $$LK,\"X-Caliber\"," + "A=\"FF:::/PersonalMenu.DD.Z,X-Caliber\"$$ icon.\n\n" + "It has black rectangle background with stars. The\n" + "mesh is in front and rotates. To keep the background\n" + "rectangle from rotating, " + "$$GREEN$$TRANSFORM OFF$$FG$$ has been used.\n\n" + "The X-Caliber mesh has a different origin for rotation.\n" + "To avoid clipping, it also has also been moved in the\n" + "negative Z direction by editing the sprite as text\n" + "and changing the first vector.\n\n" + "For the mesh you are creating, use same origin as\n" + "the rest of the sprite? If $$GREEN$$YES$$FG$$, you can always\n" + "shift the mesh origin point in the sprite edit menu.\n")) { + doc_ce->de_flags=old_de_flags; + a1=x; a2=y; + SMShiftableMesh(doc,doc_ce,head,x,y,a1,a2,&cur_elem_num); + eletype=SPT_MENU; + } else + PopUpOk("Select Origin.\n"); + doc_ce->de_flags=old_de_flags; + break; + case SPT_INS_SCREEN_BITMAP: + doc_ce->de_flags|=DOCEF_DONT_DRAW; + PopUpOk("Drag-out a rect for the extents of the\nbitmap.\n"); + doc_ce->de_flags=old_de_flags; + Fs->win_inhibit=WIG_TASK_DFT|WIF_FOCUS_TASK_IP_L|WIF_FOCUS_TASK_IP_R| + WIF_FOCUS_TASK_BORDER-WIF_SELF_FOCUS-WIF_SELF_GRAB_SCROLL; + break; + case SPT_BITMAP: + doc_ce->de_flags|=DOCEF_DONT_DRAW; + i=PopUpColor("Background Color\n\n",,FALSE); + if (i<0) + eletype=SPT_MENU; + else { + bm_bkcolor=i; + SpriteEdUpdate(doc,doc_ce,head); + SpriteExtents(doc_ce->bin_data->data,&xx1,&xx2,&yy1,&yy2); + if (!(xx1<=xx2 && yy1<=yy2)) + xx1=xx2=yy1=yy2=0; + if (PopUpExtents(&xx1,&xx2,&yy1,&yy2)) { + doc_ce->de_flags=old_de_flags; + xx1+=xx; yy1+=yy; + xx2+=xx; yy2+=yy; + if (SMBitMap(eletype,doc,doc_ce,head,dc,xx,yy,a1,a2,bm_bkcolor, + FALSE,xx1,yy1,xx2,yy2,&cur_elem_num)==GE_EXIT) { + res=GE_EXIT; + goto ei_done; + } + eletype=SPT_MENU; + } + } + doc_ce->de_flags=old_de_flags; + break; + case SPT_INS_TRANSPARENT_SCREEN_BITMAP: + doc_ce->de_flags|=DOCEF_DONT_DRAW; + i=PopUpColor("Color to Become Transparent\n\n",,FALSE); + if (i<0) + eletype=SPT_MENU; + else { + bm_bkcolor=i; + PopUpOk("Drag-out a rect for the extents of the\nbitmap.\n"); + } + doc_ce->de_flags=old_de_flags; + Fs->win_inhibit=WIG_TASK_DFT|WIF_FOCUS_TASK_IP_L|WIF_FOCUS_TASK_IP_R| + WIF_FOCUS_TASK_BORDER-WIF_SELF_FOCUS-WIF_SELF_GRAB_SCROLL; + break; + case SPT_WIDTH: + doc_ce->de_flags|=DOCEF_DONT_DRAW; + i=PopUpRangeI64(1,16,1,"Pen Width\n"); + if (i>=1) { + width=i; + tempg=CAlloc(SpriteElemQuedBaseSize(SPT_WIDTH)); + tempg->type=SPT_WIDTH; + tempg->w.width=width; + QueIns(tempg,insert_pt->last); + SpriteEdUpdate(doc,doc_ce,head); + cur_elem_num++; + } + doc_ce->de_flags=old_de_flags; + eletype=SPT_MENU; + break; + case SPT_TRANSFORM_ON: + case SPT_TRANSFORM_OFF: + tempg=CAlloc(SpriteElemQuedBaseSize(SPT_TRANSFORM_ON)); + if (eletype==SPT_TRANSFORM_ON) + tempg->type=SPT_TRANSFORM_ON; + else + tempg->type=SPT_TRANSFORM_OFF; + QueIns(tempg,insert_pt->last); + SpriteEdUpdate(doc,doc_ce,head); + cur_elem_num++; + eletype=SPT_MENU; + break; + case SPT_POLYGON: + doc_ce->de_flags|=DOCEF_DONT_DRAW; + i=PopUpRangeI64(3,16,1,"Num of Sides\n"); + doc_ce->de_flags=old_de_flags; + if (i<3) + eletype=SPT_MENU; + break; + case SPT_TEXT: + case SPT_TEXT_BOX: + case SPT_TEXT_DIAMOND: + SMTextFamily(eletype,doc,doc_ce,head,dc,xx,yy,a1,a2, + color,&cur_elem_num,old_de_flags); + eletype=SPT_MENU; + break; + } + + if (eletype!=SPT_MENU) { + insert_pt=SpriteSetSettings(dc,head,cur_elem_num,xx,yy, + &color,&width,&x,&y); + x+=xx; y+=yy; + SpriteScreenInit(dc,x,y); + if (eletype==SPT_EXIT) { + res=GE_EXIT; + goto ei_done; + } else if (eletype==DOCM_CANCEL) { + res=GE_ABORT; + goto ei_done; + } + switch (GetMsg(&a1,&a2,1<type=SPT_COLOR; + tempg->c.color=color; + QueIns(tempg,insert_pt->last); + SpriteEdUpdate(doc,doc_ce,head); + cur_elem_num++; + break; + case 't': //Set to transparent color + tempg=CAlloc(SpriteElemQuedBaseSize(SPT_COLOR)); + tempg->type=SPT_COLOR; + tempg->c.color=TRANSPARENT; + QueIns(tempg,insert_pt->last); + SpriteEdUpdate(doc,doc_ce,head); + cur_elem_num++; + break; + } + break; + case MSG_IP_R_UP: + if (eletype==SPT_PLANAR_SYMMETRY) { + tempg=CAlloc(SpriteElemQuedBaseSize(SPT_PLANAR_SYMMETRY)); + tempg->type=SPT_PLANAR_SYMMETRY; + QueIns(tempg,insert_pt->last); + SpriteEdUpdate(doc,doc_ce,head); + cur_elem_num++; + eletype=SPT_MENU; + } else + eletype=SPT_MENU; + break; + case MSG_IP_L_DOWN: + switch (eletype) { + start: + case SPT_LINE: + tempg=SMLine(dc,x,y,a1,a2,color); + break; + case SPT_ARROW: + tempg=SMArrow(dc,x,y,a1,a2,color); + break; + case SPT_PLANAR_SYMMETRY: + tempg=SMPlanarSymmetry(dc,x,y,a1,a2); + eletype=SPT_MENU; + break; + case SPT_RECT: + tempg=SMRect(dc,x,y,a1,a2,color); + break; + case SPT_INS_SCREEN_BITMAP: + case SPT_INS_TRANSPARENT_SCREEN_BITMAP: + tempg=SMScreenBitMap(eletype,dc,dc2,x,y,a1,a2,bm_bkcolor); + eletype=SPT_MENU; + break; + case SPT_CIRCLE: + tempg=SMCircle(dc,x,y,a1,a2,color); + break; + case SPT_ELLIPSE: + tempg=SMEllipse(dc,x,y,a1,a2,color); + break; + case SPT_POLYGON: + tempg=SMPolygon(dc,x,y,a1,a2,i,color); + eletype=SPT_MENU; + break; + case SPT_PT: + case SPT_FLOOD_FILL: + case SPT_FLOOD_FILL_NOT: + tempg=CAlloc(SpriteElemQuedBaseSize(eletype)); + tempg->type=eletype; + tempg->p.x1=a1-x; + tempg->p.y1=a2-y; + break; + case SPT_POLYLINE: + case SPT_BSPLINE2: + case SPT_BSPLINE3: + case SPT_BSPLINE2_CLOSED: + case SPT_BSPLINE3_CLOSED: + tempg=SMPolyLineFamily(eletype,dc,x,y,a1,a2,color); + break; + case SPT_POLYPT: + tempg=SMPolyPoint(dc,x,y,a1,a2,color); + break; + end: + if (tempg) { + QueIns(tempg,insert_pt->last); + SpriteEdUpdate(doc,doc_ce,head); + cur_elem_num++; + } + break; + case SPT_BITMAP: + if (SMBitMap(eletype,doc,doc_ce,head,dc,xx,yy,a1,a2,bm_bkcolor, + TRUE,,,,,&cur_elem_num)==GE_EXIT) { + res=GE_EXIT; + goto ei_done; + } + doc_ce->de_flags=old_de_flags; + eletype=SPT_MENU; + break; + case SPT_SHIFTABLE_MESH: + GetMsg(NULL,NULL,1<de_flags|=DOCEF_DONT_DRAW; + SMShiftableMesh(doc,doc_ce,head,x,y,a1,a2,&cur_elem_num); + doc_ce->de_flags=old_de_flags; + eletype=SPT_MENU; + break; + } + break; + } + } + } +ei_done: + DCFill; + SettingsPop; + doc_ce->de_flags=old_de_flags; + DCDel(dc); + DCDel(dc2); + StrCpy(Fs->task_title,old_task_title); + Free(old_task_title); + Fs->border_src=old_border_src; + Fs->title_src =old_title_src; + QueDel(head); + Free(head); + return res; +} + +U0 EdSpriteIns(CDoc *doc) +{ + Bool unlock; + U8 *st; + CDocEntry *doc_e; + CDocBin *tempb; + if (Fs!=doc->mem_task) + throw('Graphics'); + if (st=EdSprite(doc->cur_bin_num)) { + unlock=DocLock(doc); + tempb=CAlloc(sizeof(CDocBin),doc->mem_task); + tempb->size=sprite_elem_base_sizes[SPT_END]; + tempb->data=CAlloc(tempb->size,doc->mem_task); + tempb->num=doc->cur_bin_num++; + tempb->use_cnt=1; + QueIns(tempb,doc->bin_head.last); + doc_e=DocPrint(doc,"%s",st); + doc_e->bin_data=tempb; + Free(st); + if (doc_e) { + if (doc_e->de_flags&DOCEF_TAG && doc_e->tag && *doc_e->tag) + tempb->tag=StrNew(doc_e->tag,doc->mem_task); + doc->cur_entry=doc_e; + doc->cur_col=0; + DocUnlock(doc); + DocRecalc(doc); + if (SpriteMainEd(doc)==GE_ABORT) { + DocLock(doc); + DocEntryDel(doc,doc_e); + } + } else + DocBinDel(doc,tempb); + if (unlock) + DocUnlock(doc); + } + if (!(doc->flags & (DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS))) + DocBinsValidate(doc); +} + +U0 EdSpriteEd(CDoc *doc) +{ + CDocEntry *doc_ce; + CDocBin *tempb; + CSprite *old_csprite; + I64 old_size; + Bool unlock=DocLock(doc); + doc_ce=doc->cur_entry; + tempb=doc_ce->bin_data; + old_size=tempb->size; + old_csprite=tempb->data; + tempb->data=MAllocIdent(old_csprite,doc->mem_task); + DocUnlock(doc); + if (SpriteMainEd(doc)==GE_ABORT) { + DocLock(doc); + Free(tempb->data); + tempb->data=old_csprite; + tempb->size=old_size; + } else + Free(old_csprite); + if (unlock) + DocUnlock(doc); +} diff --git a/Adam/Gr/SpriteMesh.CPP b/Adam/Gr/SpriteMesh.CPP deleted file mode 100644 index 0f83af8..0000000 --- a/Adam/Gr/SpriteMesh.CPP +++ /dev/null @@ -1,1507 +0,0 @@ -#help_index "Graphics/Mesh" -#define MESH_WORKSPACE_SIZE 4000 - -#define VF_SEL 1 -#define VF_COPIED 2 -#define VF_IGNORE 4 - -class CMeshEdVertex -{ - CMeshEdVertex *next,*last,*copy; - - U0 start; - CD3I32 p; //World coordinates of the point. - U0 end; - CD3I32 p0, - pt; //Transformed coordinates. (Screen) - I32 num,flags; -}; - -#define TF_SEL 1 -#define TF_COPIED 2 - -class CMeshEdTri -{ - CMeshEdTri *next,*last; - - U0 start; - CMeshTri mt; - U0 end; - - I32 cpu_num,flags; //Draw different tris with different cores. - CMeshEdVertex *t[3]; -}; - -class CMeshFrame -{ - I64 ip_z,thickness; //Input pointer (mouse) Z-coordinate - I64 ed_mode,cx,cy; - CColorROPU32 cur_color; - Bool grid_on,flip_y,sel_rect,vertex_on,closed,pad[3]; - I64 mp_not_done_flags; //Used for multiprocessing signaling. - F64 view_scale; - CDC *dc; - I32 *depth_buf; - I64 *w2s,*s2w; //Screen-to-world and world-to-screen transform matrices. - I64 vertex_cnt,tri_cnt; //Set by MeshSize - CMeshEdVertex vertex_head,*cur_vertex,*chain_pred; - CMeshEdTri tri_head,*cur_tri; - I64 x1,y1,x2,y2,cur_snap; -}; - -CMeshEdVertex *MeshVertexNew(CMeshFrame *e,I64 x,I64 y,I64 z) -{ - CMeshEdVertex *tempv=CAlloc(sizeof(CMeshEdVertex)); - tempv->p.x=x; - tempv->p.y=y; - tempv->p.z=z; - QueIns(tempv,e->vertex_head.last); - return tempv; -} - -CMeshEdTri *MeshTriNew(CMeshFrame *e,CColorROPU32 color, - CMeshEdVertex *v1,CMeshEdVertex *v2,CMeshEdVertex *v3) -{ - static I64 cpu_num=0; - CMeshEdTri *tempt=CAlloc(sizeof(CMeshEdTri)); - tempt->cpu_num=cpu_num++%mp_cnt; - tempt->mt.color=color; - tempt->t[0]=v1; - tempt->t[1]=v2; - tempt->t[2]=v3; - QueIns(tempt,e->tri_head.last); - return tempt; -} - -CMeshEdVertex *MeshVertexFindScrPt(CMeshFrame *e,I64 x,I64 y) -{//Screen coordinates - CMeshEdVertex *res=NULL,*tempv=e->vertex_head.next; - I64 dd,dz,best_dd=MAX_I64,best_dz=MAX_I64; - while (tempv!=&e->vertex_head) { - if (!(tempv->flags&VF_IGNORE)) { - dd=SqrI64(x-tempv->pt.x)+SqrI64(y-tempv->pt.y); - dz=AbsI64(e->ip_z-tempv->p.z); - if (ddnext; - } - return res; -} - -CMeshEdVertex *MeshVertexFindNum(CMeshFrame *haystack_e,I64 needle_num) -{ - CMeshEdVertex *tempv=haystack_e->vertex_head.next; - while (tempv!=&haystack_e->vertex_head) { - if (tempv->num==needle_num) - return tempv; - tempv=tempv->next; - } - return NULL; -} - -U0 MeshTriDel(CMeshFrame *e,CMeshEdTri *tempt) -{ - if (tempt) { - if (tempt==e->cur_tri) - e->cur_tri=NULL; - QueRem(tempt); - Free(tempt); - } -} - -U0 MeshVertexDel(CMeshFrame *e,CMeshEdVertex *tempv) -{ - I64 i; - CMeshEdTri *tempt,*tempt1; - if (tempv) { - tempt=e->tri_head.next; - while (tempt!=&e->tri_head) { - tempt1=tempt->next; - for (i=0;i<3;i++) - if (tempt->t[i]==tempv) - break; - if (i<3) - MeshTriDel(e,tempt); - tempt=tempt1; - } - if (tempv==e->cur_vertex) - e->cur_vertex=NULL; - if (tempv==e->chain_pred) - e->chain_pred=NULL; - QueRem(tempv); - Free(tempv); - } -} - -U0 MeshFence(CMeshFrame *e) -{ - CMeshEdVertex *tempv,*tempv1,*tempv_last=NULL,*tempv1_last=NULL, - *start=e->chain_pred->next,*end=e->vertex_head.last; - tempv=start; - while (TRUE) { - tempv1=MeshVertexNew(e,tempv->p.x,tempv->p.y,tempv->p.z+e->thickness); - if (tempv_last) { - MeshTriNew(e,e->cur_color,tempv_last,tempv,tempv1); - MeshTriNew(e,e->cur_color,tempv1,tempv1_last,tempv_last); - } - tempv_last=tempv; - tempv1_last=tempv1; - if (tempv==end) - break; - tempv=tempv->next; - } - if (e->closed && tempv_last) { - MeshTriNew(e,e->cur_color,tempv_last,start,end->next); - MeshTriNew(e,e->cur_color,end->next,tempv1_last,tempv_last); - } -} - -U0 MeshPolygon(CMeshFrame *e,CMeshEdVertex *start,CMeshEdVertex *end,Bool rev) -{ - CMeshEdVertex *tempv,*tempv1; - if (start!=end) { - tempv=start; - tempv1=tempv->next; - while (tempv1!=end) { - if (rev) - MeshTriNew(e,e->cur_color,tempv1,tempv,end); - else - MeshTriNew(e,e->cur_color,tempv,tempv1,end); - tempv=tempv->next; - tempv1=tempv1->next; - } - } -} - -U0 MeshPrism(CMeshFrame *e) -{ - CMeshEdVertex *start=e->chain_pred->next,*end=e->vertex_head.last; - MeshFence(e); - MeshPolygon(e,start,end,FALSE); - MeshPolygon(e,end->next,e->vertex_head.last,TRUE); -} - -U0 MeshVertexSelAll(CMeshFrame *e,Bool val) -{ - CMeshEdVertex *tempv=e->vertex_head.next; - while (tempv!=&e->vertex_head) { - if (val) - tempv->flags|=VF_SEL; - else - tempv->flags&=~VF_SEL; - tempv=tempv->next; - } -} - -U0 MeshTriSelAll(CMeshFrame *e,Bool val) -{ - CMeshEdTri *tempt=e->tri_head.next; - while (tempt!=&e->tri_head) { - if (val) - tempt->flags|=TF_SEL; - else - tempt->flags&=~TF_SEL; - tempt=tempt->next; - } -} - -U0 MeshVertexIgnoreSet(CMeshFrame *e,Bool val) -{ - CMeshEdVertex *tempv=e->vertex_head.next; - while (tempv!=&e->vertex_head) { - tempv->flags&=~VF_IGNORE; - if (tempv->flags&VF_SEL && val) - tempv->flags|=VF_IGNORE; - tempv=tempv->next; - } -} - -U0 MeshP0Capture(CMeshFrame *e) -{ - CMeshEdVertex *tempv=e->vertex_head.next; - while (tempv!=&e->vertex_head) { - MemCpy(&tempv->p0,&tempv->p,sizeof(CD3I32)); - tempv=tempv->next; - } -} - -U0 MeshP0Offset(CMeshFrame *e,I64 dx,I64 dy,I64 dz) -{ - CMeshEdVertex *tempv=e->vertex_head.next; - while (tempv!=&e->vertex_head) { - if (tempv->flags&VF_SEL) { - tempv->p.x=tempv->p0.x+dx; - tempv->p.y=tempv->p0.y+dy; - tempv->p.z=tempv->p0.z+dz; - } - tempv=tempv->next; - } -} - -#define SEL_MESH_EQU 0 -#define SEL_MESH_OR 1 -#define SEL_MESH_AND 2 - -U0 MeshVertexSelRect(CMeshFrame *e,I64 sel_mode,I64 x1,I64 x2,I64 y1,I64 y2) -{ - CMeshEdVertex *tempv=e->vertex_head.next; - if (x1>x2) SwapI64(&x1,&x2); - if (y1>y2) SwapI64(&y1,&y2); - while (tempv!=&e->vertex_head) { - if (x1<=tempv->pt.x<=x2 && - y1<=tempv->pt.y<=y2) { - if (sel_mode==SEL_MESH_AND) - tempv->flags&=~VF_SEL; - else - tempv->flags|=VF_SEL; - } else if (sel_mode==SEL_MESH_EQU) - tempv->flags&=~VF_SEL; - tempv=tempv->next; - } -} - -U0 MeshTriSelRect(CMeshFrame *e,I64 sel_mode,I64 x1,I64 x2,I64 y1,I64 y2) -{ - CMeshEdTri *tempt=e->tri_head.next; - if (x1>x2) SwapI64(&x1,&x2); - if (y1>y2) SwapI64(&y1,&y2); - while (tempt!=&e->tri_head) { - if (x1<=tempt->t[0]->pt.x<=x2 && - y1<=tempt->t[0]->pt.y<=y2 && - x1<=tempt->t[1]->pt.x<=x2 && - y1<=tempt->t[1]->pt.y<=y2 && - x1<=tempt->t[2]->pt.x<=x2 && - y1<=tempt->t[2]->pt.y<=y2) { - if (sel_mode==SEL_MESH_AND) - tempt->flags&=~TF_SEL; - else - tempt->flags|=TF_SEL; - } else { - if (sel_mode==SEL_MESH_EQU) - tempt->flags&=~TF_SEL; - else if (sel_mode==SEL_MESH_AND) { - if (x1<=tempt->t[0]->pt.x<=x2 && - y1<=tempt->t[0]->pt.y<=y2 || - x1<=tempt->t[1]->pt.x<=x2 && - y1<=tempt->t[1]->pt.y<=y2 || - x1<=tempt->t[2]->pt.x<=x2 && - y1<=tempt->t[2]->pt.y<=y2) - tempt->flags&=~TF_SEL; - } - } - tempt=tempt->next; - } -} - -I64 MeshSelCnt(CMeshFrame *e) -{ - I64 res=0; - CMeshEdVertex *tempv=e->vertex_head.next; - CMeshEdTri *tempt=e->tri_head.next; - while (tempv!=&e->vertex_head) { - if (tempv->flags&VF_SEL) - res++; - tempv=tempv->next; - } - while (tempt!=&e->tri_head) { - if (tempt->flags&TF_SEL) - res++; - tempt=tempt->next; - } - return res; -} - -U0 MeshSwapAxes(CMeshFrame *e,I64 o1,I64 o2) -{ - Bool unsel; - CMeshEdVertex *tempv=e->vertex_head.next; - if (!MeshSelCnt(e)) { - MeshVertexSelAll(e,TRUE); - unsel=TRUE; - } else - unsel=FALSE; - while (tempv!=&e->vertex_head) { - if (tempv->flags&VF_SEL) - SwapU32((&tempv->p)(U8 *)+o1,(&tempv->p)(U8 *)+o2); - tempv=tempv->next; - } - if (unsel) - MeshVertexSelAll(e,FALSE); -} - -U0 MeshInvertAxis(CMeshFrame *e,I64 o) -{ - Bool unsel; - CMeshEdVertex *tempv=e->vertex_head.next; - if (!MeshSelCnt(e)) { - MeshVertexSelAll(e,TRUE); - unsel=TRUE; - } else - unsel=FALSE; - while (tempv!=&e->vertex_head) { - if (tempv->flags&VF_SEL) - *((&tempv->p)(U8 *)+o)(I32 *)=-*((&tempv->p)(U8 *)+o)(I32 *); - tempv=tempv->next; - } - if (unsel) - MeshVertexSelAll(e,FALSE); -} - -U0 MeshTransformSel(CMeshFrame *e) -{ - Bool unsel; - I64 r[16],x,y,z; - CMeshEdVertex *tempv=e->vertex_head.next; - if (PopUpTransform(r)) { - if (!MeshSelCnt(e)) { - MeshVertexSelAll(e,TRUE); - unsel=TRUE; - } else - unsel=FALSE; - while (tempv!=&e->vertex_head) { - if (tempv->flags&VF_SEL) { - x=tempv->p.x; y=tempv->p.y; z=tempv->p.z; - Mat4x4MulXYZ(r,&x,&y,&z); - tempv->p.x=x; tempv->p.y=y; tempv->p.z=z; - } - tempv=tempv->next; - } - if (unsel) - MeshVertexSelAll(e,FALSE); - } -} - -U0 MeshColorTris(CMeshFrame *e) -{ - Bool unsel; - CMeshEdTri *tempt=e->tri_head.next; - if (!MeshSelCnt(e)) { - MeshTriSelAll(e,TRUE); - unsel=TRUE; - } else - unsel=FALSE; - while (tempt!=&e->tri_head) { - if (tempt->flags & TF_SEL) - tempt->mt.color=e->cur_color; - tempt=tempt->next; - } - if (unsel) - MeshTriSelAll(e,FALSE); -} - -U0 MeshRevTris(CMeshFrame *e) -{ - Bool unsel; - CMeshEdTri *tempt=e->tri_head.next; - if (!MeshSelCnt(e)) { - MeshTriSelAll(e,TRUE); - unsel=TRUE; - } else - unsel=FALSE; - while (tempt!=&e->tri_head) { - if (tempt->flags & TF_SEL) - SwapI64(&tempt->t[1],&tempt->t[2]); - tempt=tempt->next; - } - if (unsel) - MeshTriSelAll(e,FALSE); -} - -U0 MeshRecalcCxCy(CTask *task,CMeshFrame *e) -{ - e->cx=RoundI64(task->pix_width/2 -task->horz_scroll.pos,e->cur_snap); - e->cy=RoundI64(task->pix_height/2-task->vert_scroll.pos,e->cur_snap); -} - -U0 MeshCurSnap(CMeshFrame *e) -{ - I64 x1,y1,z1,x2,y2,z2; - if (e->w2s) { - x1=e->cur_snap<<16; y1=0; z1=0; - Mat4x4MulXYZ(e->w2s,&x1,&y1,&z1); - x2=0; y2=e->cur_snap<<16; z2=0; - Mat4x4MulXYZ(e->w2s,&x2,&y2,&z2); - ip_grid.x=Max(1,MaxI64(x1,x2)>>16); - ip_grid.y=Max(1,MaxI64(y1,y2)>>16); - ip_grid.z=Min(ip_grid.x,ip_grid.y); - } -} - -U0 MeshScaleZoom(CMeshFrame *e,F64 scale) -{ - CTask *task=Fs; - I64 x=ip.pos.x-task->pix_left-task->scroll_x-task->pix_width/2, - y=ip.pos.y-task->pix_top-task->scroll_y-task->pix_height/2; - task->horz_scroll.pos*=scale; - task->vert_scroll.pos*=scale; - task->horz_scroll.pos+=scale*x-x; - task->vert_scroll.pos+=scale*y-y; - e->view_scale*=scale; - MeshRecalcCxCy(task,e); - MeshCurSnap(e); -} - -U0 MPDrawIt(CMeshFrame *e) -{//Multiprocessing draw it, called by each core. - - //Makes a copy of e->dc so we can change dc->color member and stuff. - CDC *dc=DCAlias(e->dc,e->dc->win_task); - - CMeshEdTri *tempt=e->tri_head.next; - I64 i,*old_r=dc->r; - - //$LK,"DCAlias",A="MN:DCAlias"$() allocs a new identity rotation matrix. - //We want e->dc's rotation matrix. - dc->r=e->dc->r; - dc->depth_buf=e->depth_buf; - MemCpy(&dc->ls,&e->dc->ls,sizeof(CD3I32)); - - //... and translation (shift) vals. - dc->x=e->dc->x; - dc->y=e->dc->y; - dc->z=e->dc->z; - dc->flags|=DCF_TRANSFORMATION; - - if (e->grid_on) -//Draw grid with different cores. - for (i=-500+25*Gs->num;i<=500;i+=25*mp_cnt) { - if (i) { - dc->color=DKGRAY; - GrLine3(dc,i,-500,0,i,500,0); - dc->color=LTGRAY; - GrLine3(dc,-500,i,0,500,i,0); - } - } - if (!Gs->num) { - dc->color=RED; //Y-Axis red - GrLine3(dc,0,0,0,0,500,0); - dc->color=ROPF_DITHER+RED; //Y-Axis red - GrLine3(dc,0,-500,0,0,0,0); - - dc->color=YELLOW; //X-Axis yellow - GrLine3(dc,0,0,0,500,0,0); - dc->color=ROPF_DITHER+YELLOW; //X-Axis yellow - GrLine3(dc,-500,0,0,0,0,0); - - dc->color=GREEN; //Z-Axis green - GrLine3(dc,0,0,0,0,0,500); - dc->color=ROPF_DITHER+GREEN; //Z-Axis green - GrLine3(dc,0,0,-500,0,0,0); - } - - while (tempt!=&e->tri_head) { - if (tempt->cpu_num==Gs->num) { - if (tempt->flags & TF_SEL) { - if (Blink) - dc->color=ROPF_DITHER+WHITE<<16+RED; - else - dc->color=ROPF_DITHER+RED<<16+WHITE; - GrFillTri0(dc,&tempt->t[0]->pt,&tempt->t[1]->pt,&tempt->t[2]->pt); - } else { - (*dc->lighting)(dc,&tempt->t[0]->pt,&tempt->t[1]->pt, - &tempt->t[2]->pt,tempt->mt.color); - GrFillTri0(dc,&tempt->t[0]->pt,&tempt->t[1]->pt,&tempt->t[2]->pt); - } - } - tempt=tempt->next; - } - dc->r=old_r; - - //e->dc's depth buf was copied but we don't want it freed during $LK,"DCDel",A="MN:DCDel"$(). - dc->depth_buf=NULL; - - DCDel(dc); - LBtr(&e->mp_not_done_flags,Gs->num); -} - -I64 *MeshW2S(CMeshFrame *e,CTask *task) -{//World to screen coordinate transform matrix. - CCtrl *c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES); - CViewAngles *s=c->state; - I64 *r=Mat4x4IdentNew(task); - Mat4x4Scale(r,e->view_scale); - Mat4x4RotZ(r,s->az); - Mat4x4RotY(r,s->ay); - if (e->flip_y) - Mat4x4RotX(r,s->ax); - else - Mat4x4RotX(r,s->ax+ã); - return r; -} - -I64 *MeshS2W(CMeshFrame *e,CTask *task) -{//Screen to world coordinate transform matrix. - CCtrl *c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES); - CViewAngles *s=c->state; - I64 *r=Mat4x4IdentNew(task); - if (e->flip_y) - Mat4x4RotX(r,-s->ax); - else - Mat4x4RotX(r,-(s->ax+ã)); - Mat4x4RotY(r,-s->ay); - Mat4x4RotZ(r,-s->az); - Mat4x4Scale(r,1/e->view_scale); - return r; -} - -I64 *MeshSetW2S(CMeshFrame *e,CTask *task) -{ - Free(e->w2s); - e->w2s=MeshW2S(e,task); - Free(e->s2w); - e->s2w=MeshS2W(e,task); -//returned matrix is assigned to dc->r and will be freed by $LK,"DCDel",A="MN:DCDel"$(). - return Mat4x4New(e->w2s,task); -} - -U0 MeshCursorW(CMeshFrame *e,CTask *task,I64 *_x,I64 *_y,I64 *_z) -{ - I64 x_shadow,y_shadow,z_shadow, - xc=ip.pos.x-task->pix_left-task->scroll_x-e->cx, - yc=ip.pos.y-task->pix_top-task->scroll_y-e->cy,zc=0, - x=0,y=0,z=e->ip_z, - i,x2,y2,z2; - Mat4x4MulXYZ(e->w2s,&x,&y,&z); //screen of Z vect - - //Converges onto a solution for zc, an unknown. - for (i=0;i<128;i++) { - x_shadow=xc-x; //Shadow of mouse cursor on xy plane - y_shadow=yc-y; - z_shadow=zc-z; - Mat4x4MulXYZ(e->s2w,&x_shadow,&y_shadow,&z_shadow); - x2=0; y2=0; z2=-z_shadow; - Mat4x4MulXYZ(e->w2s,&x2,&y2,&z2); - zc+=Round(Sqrt(x2*x2+y2*y2+z2*z2))*SignI64(z2); - } - - x=xc-x; - y=yc-y; - z=zc-z; - Mat4x4MulXYZ(e->s2w,&x,&y,&z); - x=RoundI64(x,e->cur_snap); - y=RoundI64(y,e->cur_snap); - z=RoundI64(e->ip_z,e->cur_snap); - *_x=x; *_y=y; *_z=z; -} - -CMeshEdVertex sys_clipboard_vertex_head; -CMeshEdTri sys_clipboard_tri_head; - -U0 MeshClipboardInit() -{ - QueInit(&sys_clipboard_vertex_head); - QueInit(&sys_clipboard_tri_head); -} - -U0 MeshClipboardRst() -{ - QueDel(&sys_clipboard_vertex_head,TRUE); - QueDel(&sys_clipboard_tri_head,TRUE); - MeshClipboardInit; -} - -U0 MeshClipboardCopy(CMeshFrame *e) -{ - CMeshEdVertex *tempv=e->vertex_head.next,*tempv2; - CMeshEdTri *tempt=e->tri_head.next,*tempt2; - - MeshClipboardRst; - while (tempv!=&e->vertex_head) { - if (tempv->flags&VF_SEL) { - tempv->copy=tempv2=ACAlloc(sizeof(CMeshEdVertex)); - MemCpy(&tempv2->p,&tempv->p,sizeof(CD3I32)); - QueIns(tempv2,sys_clipboard_vertex_head.last); - tempv->flags|=VF_COPIED; - tempv->flags&=~VF_SEL; - } else { - tempv->copy=NULL; - tempv->flags&=~(VF_COPIED|VF_SEL); - } - tempv=tempv->next; - } - while (tempt!=&e->tri_head) { - if (tempt->flags&TF_SEL && - tempt->t[0]->copy && tempt->t[1]->copy && tempt->t[2]->copy) { - tempt2=ACAlloc(sizeof(CMeshEdTri)); - tempt2->t[0]=tempt->t[0]->copy; - tempt2->t[1]=tempt->t[1]->copy; - tempt2->t[2]=tempt->t[2]->copy; - tempt2->mt.color=tempt->mt.color; - QueIns(tempt2,sys_clipboard_tri_head.last); - tempt->flags|=TF_COPIED; - tempt->flags&=~TF_SEL; - } else - tempt->flags&=~(TF_COPIED|TF_SEL); - tempt=tempt->next; - } -} - -U0 MeshClipboardCut(CMeshFrame *e) -{ - CMeshEdVertex *tempv=e->vertex_head.next,*tempv1; - CMeshEdTri *tempt=e->tri_head.next,*tempt1; - MeshClipboardCopy(e); - while (tempt!=&e->tri_head) { - tempt1=tempt->next; - if (tempt->flags&TF_COPIED) - MeshTriDel(e,tempt); - tempt=tempt1; - } - while (tempv!=&e->vertex_head) { - tempv1=tempv->next; - if (tempv->flags&VF_COPIED) - MeshVertexDel(e,tempv); - tempv=tempv1; - } -} - -U0 MeshClipboardDel(CMeshFrame *e) -{//Technically not clipboard - CMeshEdVertex *tempv=e->vertex_head.next,*tempv1; - CMeshEdTri *tempt=e->tri_head.next,*tempt1; - while (tempt!=&e->tri_head) { - tempt1=tempt->next; - if (tempt->flags&TF_SEL) - MeshTriDel(e,tempt); - tempt=tempt1; - } - while (tempv!=&e->vertex_head) { - tempv1=tempv->next; - if (tempv->flags&VF_SEL) - MeshVertexDel(e,tempv); - tempv=tempv1; - } -} - -U0 MeshClipboardPaste(CMeshFrame *e) -{ - CMeshEdVertex *tempv2=sys_clipboard_vertex_head.next,*tempv; - CMeshEdTri *tempt2=sys_clipboard_tri_head.next,*tempt; - - MeshVertexSelAll(e,FALSE); - MeshTriSelAll(e,FALSE); - while (tempv2!=&sys_clipboard_vertex_head) { - tempv2->copy=tempv=CAlloc(sizeof(CMeshEdVertex)); - MemCpy(&tempv->p,&tempv2->p,sizeof(CD3I32)); - QueIns(tempv,e->vertex_head.last); - tempv->flags|=VF_SEL; - tempv2=tempv2->next; - } - - while (tempt2!=&sys_clipboard_tri_head) { - tempt=MeshTriNew(e,tempt2->mt.color,tempt2->t[0]->copy, - tempt2->t[1]->copy,tempt2->t[2]->copy); - tempt->flags|=TF_SEL; - tempt2=tempt2->next; - } -} - -MeshClipboardInit; - -U0 DrawIt(CTask *task,CDC *dc) -{ - CMeshFrame *e=FramePtr("CMeshFrame",task); - CCtrl *c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES); - F64 d; - I64 i,x,y,z; - CMeshEdVertex *tempv; - - task->horz_scroll.min=-(MESH_WORKSPACE_SIZE-task->pix_width)/2; - task->horz_scroll.max= (MESH_WORKSPACE_SIZE-task->pix_width)/2; - task->vert_scroll.min=-(MESH_WORKSPACE_SIZE-task->pix_height)/2; - task->vert_scroll.max= (MESH_WORKSPACE_SIZE-task->pix_height)/2; - TaskDerivedValsUpdate(task); - MeshRecalcCxCy(task,e); - - dc->flags|=DCF_TRANSFORMATION; - - Free(dc->r); //Set rotmat doesn't free old dc->r matrix. - DCMat4x4Set(dc,MeshSetW2S(e,task)); - - dc->x=e->cx; - dc->y=e->cy; -//z-vals less than zero are in front of screen and not drawn. - //we want to shift all Z-vals into a drawable range. - //GR_Z_ALL is set to half of the Z-range which is an I32. - dc->z=GR_Z_ALL; - - //Light source set to input pointer (mouse). - MeshCursorW(e,task,&x,&y,&z); - dc->ls.x=x; - dc->ls.y=y; - dc->ls.z=z; - d=1<<16/D3I32Norm(&dc->ls); //Light source normalized to 65536. - dc->ls.x*=d; - dc->ls.y*=d; - dc->ls.z*=d; - - DCDepthBufAlloc(dc); - - tempv=e->vertex_head.next; - while (tempv!=&e->vertex_head) { - x=tempv->p.x; y=tempv->p.y; z=tempv->p.z; - (*dc->transform)(dc,&x,&y,&z); - tempv->pt.x=x; tempv->pt.y=y; tempv->pt.z=z; - tempv=tempv->next; - } - - e->mp_not_done_flags=1<dc=dc; - e->depth_buf=dc->depth_buf; - for (i=0;ivertex_head.next; - while (tempv!=&e->vertex_head) { - x=tempv->pt.x; y=tempv->pt.y; z=tempv->pt.z; - if (e->vertex_on) { - if (Blink(10)) //This blinks at 10 Hz. - dc->color=ROPF_DITHER+BLACK<<16+WHITE; - else - dc->color=ROPF_DITHER+WHITE<<16+BLACK; - GrLine(dc,x-3,y-3,x+3,y+3); - GrLine(dc,x-3,y+3,x+3,y-3); - } - if (tempv->flags&VF_SEL) { - if (e->ed_mode=='t') { - if (Blink(10)) //This blinks at 10 Hz. - dc->color=ROPF_DITHER+e->cur_color.c0.color<<16+ - e->cur_color.c0.color^8; - else - dc->color=ROPF_DITHER+(e->cur_color.c0.color^8)<<16+ - e->cur_color.c0.color; - } else { - if (Blink) - dc->color=ROPF_DITHER+RED<<16+WHITE; - else - dc->color=ROPF_DITHER+WHITE<<16+RED; - } - GrCircle(dc,x,y,3); - } - tempv=tempv->next; - } - - if (CtrlInside(c,ip.presnap.x,ip.presnap.y)||winmgr.show_menu) { - GridInit; - task->win_inhibit=WIF_SELF_DOC; - } else { - MeshCurSnap(e); - task->win_inhibit=WIG_TASK_DFT|WIF_SELF_DOC-WIF_SELF_FOCUS-WIF_SELF_BORDER - -WIF_SELF_CTRLS-WIF_FOCUS_TASK_MENU-WIF_SELF_GRAB_SCROLL; - } - - MeshCursorW(e,task,&x,&y,&z); - if (z<0) - dc->color=ROP_XOR+RED^TRANSPARENT; - else - dc->color=ROP_XOR+TRANSPARENT; - GrPrint(dc,0,0,"%6.3f%% (%d,%d,%d)",e->view_scale*100,x,y,z); - dc->pen_width=1; - dc->color&=0xF; - if (Blink(10)) - dc->color^=0xF; - GrLine3(dc,x,y,z,x,y,0); - - if (e->sel_rect) { - dc->flags&=~DCF_TRANSFORMATION; - dc->pen_width=1; - if (Blink) - dc->color=ROPF_DITHER+RED<<16+WHITE; - else - dc->color=ROPF_DITHER+WHITE<<16+RED; - GrBorder(dc,e->x1,e->y1,e->x2,e->y2); - } -//Wait for all cores to complete. - while (e->mp_not_done_flags) - Yield; -} - -U0 MeshInit(CMeshFrame *e,Bool flip_y) -{ - MemSet(e,0,sizeof(CMeshFrame)); - QueInit(&e->vertex_head); - QueInit(&e->tri_head); - e->ed_mode='v'; - e->grid_on=TRUE; - e->vertex_on=TRUE; - e->ip_z=0; - e->thickness=25; - e->closed=TRUE; - e->view_scale=1.0; - e->w2s=NULL; - e->s2w=NULL; - e->cur_color=RED; - e->cur_snap=5; - e->flip_y=flip_y; - e->sel_rect=FALSE; - e->cur_tri=NULL; - e->cur_vertex=NULL; - e->chain_pred=NULL; -} - -U0 MeshLoad(CMeshFrame *e,U8 *src) -{ - I64 i,j,x,y,z; - CColorROPU32 color; - CMeshEdVertex *tempv,*va[3]; - - QueInit(&e->vertex_head); - QueInit(&e->tri_head); - - e->vertex_cnt =*src(I32 *)++; - e->tri_cnt=*src(I32 *)++; - for (i=0;ivertex_cnt;i++) { - x=*src(I32 *)++; - y=*src(I32 *)++; - z=*src(I32 *)++; - tempv=MeshVertexNew(e,x,y,z); - tempv->num=i; - } - for (i=0;itri_cnt;i++) { - color=*src(I32 *)++; - for (j=0;j<3;j++) - va[j]=MeshVertexFindNum(e,*src(I32 *)++); - MeshTriNew(e,color,va[0],va[1],va[2]); - } -} - -I64 MeshSize(CMeshFrame *e) -{ - I64 i; - CMeshEdVertex *tempv=e->vertex_head.next; - CMeshEdTri *tempt=e->tri_head.next; - - e->vertex_cnt=0; - while (tempv!=&e->vertex_head) { - tempv->num=e->vertex_cnt++; - tempv=tempv->next; - } - - e->tri_cnt=0; - while (tempt!=&e->tri_head) { - e->tri_cnt++; - for (i=0;i<3;i++) - tempt->mt.nums[i]=tempt->t[i]->num; - tempt=tempt->next; - } - return sizeof(I32)*2+ - (offset(CMeshEdVertex.end)-offset(CMeshEdVertex.start))*e->vertex_cnt+ - (offset(CMeshEdTri.end)-offset(CMeshEdTri.start))*e->tri_cnt; -} - -I32 *MeshSave(CMeshFrame *e,I64 *_size=NULL) -{ - I64 size=MeshSize(e); - U8 *res=MAlloc(size),*dst=res; - CMeshEdVertex *tempv=e->vertex_head.next; - CMeshEdTri *tempt=e->tri_head.next; - - *dst(I32 *)++=e->vertex_cnt; - *dst(I32 *)++=e->tri_cnt; - - e->vertex_cnt=0; - while (tempv!=&e->vertex_head) { - MemCpy(dst,&tempv->start,offset(CMeshEdVertex.end) - -offset(CMeshEdVertex.start)); - dst+=offset(CMeshEdVertex.end)-offset(CMeshEdVertex.start); - tempv=tempv->next; - } - - e->tri_cnt=0; - while (tempt!=&e->tri_head) { - MemCpy(dst,&tempt->start,offset(CMeshEdTri.end)-offset(CMeshEdTri.start)); - dst+=offset(CMeshEdTri.end)-offset(CMeshEdTri.start); - tempt=tempt->next; - } - if (_size) *_size=size; - return res; -} - -U0 MeshCleanUp(CMeshFrame *e) -{ - QueDel(&e->vertex_head,TRUE); - QueDel(&e->tri_head,TRUE); - Free(e->w2s); - Free(e->s2w); -} - -U0 MeshUpdateMenu(CMeshFrame *e) -{ - CMenuEntry *tempse; - if (tempse=MenuEntryFind(Fs->cur_menu,"View/Grid")) - tempse->checked=ToBool(e->grid_on); - if (tempse=MenuEntryFind(Fs->cur_menu,"View/Vertex")) - tempse->checked=ToBool(e->vertex_on); - if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/PlaceVertex")) - tempse->checked=ToBool(e->ed_mode=='v'); - if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/MoveVertex")) - tempse->checked=ToBool(e->ed_mode=='m'); - if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/MoveVertexZ")) - tempse->checked=ToBool(e->ed_mode=='M'); - if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/Triangle")) - tempse->checked=ToBool(e->ed_mode=='t'); - if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/Polygon")) - tempse->checked=ToBool(e->ed_mode=='n'); - if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/Fence")) - tempse->checked=ToBool(e->ed_mode=='f'); - if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/Prism")) - tempse->checked=ToBool(e->ed_mode=='p'); - if (tempse=MenuEntryFind(Fs->cur_menu,"View/FlipY")) - tempse->checked=ToBool(e->flip_y); -} - -I32 *SpriteMeshEd(I32 *head=NULL,I64 *_size=NULL,Bool flip_y=FALSE) -{/*Fmt for mesh: -{ -I32 vertex_cnt; -I32 tri_cnt; -CD3I32 vertices[]; -CMeshTri tris[]; -} - -If head points to a mesh, it will load it. - -Returns a newly malloced mesh or NULL. - -See $LK,"::/Demo/Graphics/SpritePlot3D.CPP"$. -$WW,0$*/ - CCtrl *c=CtrlFindUnique(Fs,CTRLT_VIEWING_ANGLES); - CViewAngles *s,*old_s; - I64 i,msg_code,sel_mode,a1,a2,make_tri_vertex_num=0,x,y,z; - CD3I32 p0a,p0b; - CMeshEdVertex *va[3],*tempv; - Bool adjusting_z=FALSE,moving,save_and_exit; - CMeshFrame e; - - if (c) { - old_s=MAlloc(sizeof(CViewAngles)); - MemCpy(old_s,c->state,sizeof(CViewAngles)); - } else { - c=ViewAnglesNew; - old_s=NULL; - } - - s=c->state; - s->sx=0; - s->sy=0; - s->sz=0; - s->cx=YELLOW; - s->cy=RED; - s->cz=GREEN; - - MenuPush( - "File {" - " Abort(,CH_SHIFT_ESC);" - " Exit(,CH_ESC);" - "}" - "Edit {" - " Delete(,,SC_DELETE);" - " DelLast(,CH_BACKSPACE);" - " Cut(,CH_CTRLX);" - " Copy(,CH_CTRLC);" - " Paste(,CH_CTRLV);" - " SelectAll(,'A');" - " UnSelectAll(,'U');" - " SelectRect(,'a');" - " UnSelectRect(,'u');" - " OrSelectRect(,'o');" - " JumpToZ(,'j');" - " ResetColor(,'C');" - " ReverseTri(,'r');" - "}" - "Mode {" - " PlaceVertex(,'v');" - " MoveVertex(,'m');" - " MoveVertexZ(,'M');" - " Triangle(,'t');" - " Polygon(,'n');" - " Fence(,'f');" - " Prism(,'p');" - "}" - "Settings {" - " Color(,'c');" - " Snap(,'s');" - "}" - "View {" - " ZoomIn(,'z');" - " ZoomOut(,'Z');" - " NullAngles(,'N');" - " FlipY(,'y');" - " Grid(,'g');" - " Vertex(,'V');" - " ToggleBorder(,CH_CTRLB);" - "}" - "Transforms {" - " Transform(,'T');" - " SwapXY(,'1');" - " SwapXZ(,'2');" - " SwapYZ(,'3');" - " InvertX(,'4');" - " InvertY(,'5');" - " InvertZ(,'6');" - " ReverseTri(,'R');" - "}"); - - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - AutoComplete; - RegOneTimePopUp(ARf_MESH_ED, - "$$GREEN$$Right Mouse$$FG$$: Hold and move to shift cursor z\n" - "$$GREEN$$'j'$$FG$$: Jump cursor Z to nearest vertex's Z\n" - "$$GREEN$$'v'$$FG$$: Place Vertex Mode\n" - "$$GREEN$$'m'$$FG$$: Move Vertex Mode\n" - "$$GREEN$$'M'$$FG$$: Move Vertex Z\n" - "$$GREEN$$'t'$$FG$$: Form Triangle Mode\n" - "$$GREEN$$'n'$$FG$$: Polygon Mode\n" - "$$GREEN$$'f'$$FG$$: Fence Mode\n" - "$$GREEN$$'p'$$FG$$: Prism Mode\n" - "$$GREEN$$'c'$$FG$$: Set color\n" - "$$GREEN$$'s'$$FG$$: Set snap\n" - "\nSee menu at top of screen for more.\n"); - - Fs->win_inhibit=WIG_TASK_DFT|WIF_SELF_DOC-WIF_SELF_FOCUS-WIF_SELF_BORDER - -WIF_SELF_CTRLS-WIF_FOCUS_TASK_MENU-WIF_SELF_GRAB_SCROLL; - Fs->horz_scroll.pos=0; - Fs->vert_scroll.pos=0; - MeshInit(&e,flip_y); - if (head) - MeshLoad(&e,head); - FramePtrAdd("CMeshFrame",&e); - Fs->draw_it=&DrawIt; - MeshCurSnap(&e); - MeshRecalcCxCy(Fs,&e); - - try {//In case of - while (TRUE) { - MeshUpdateMenu(&e); - msg_code=GetMsg(&a1,&a2,1<pix_left-Fs->scroll_x, - ip.presnap.y-Fs->pix_top-Fs->scroll_y)); - MeshVertexSelAll(&e,FALSE); - MeshTriSelAll(&e,FALSE); - make_tri_vertex_num=0; - } - break; - case SC_INS: - if (a2&SCF_CTRL) - goto me_clipboard_copy; - else if (a2&SCF_SHIFT) - goto me_clipboard_paste; - } - break; - case CH_BACKSPACE: - switch (e.ed_mode) { - case 'n': - case 'f': - case 'p': - case 'v': - MeshVertexDel(&e,e.cur_vertex); - break; - case 't': - if (make_tri_vertex_num) { - MeshVertexSelAll(&e,FALSE); - MeshTriSelAll(&e,FALSE); - make_tri_vertex_num=0; - } else - MeshTriDel(&e,e.cur_tri); - break; - } - break; - case 'f': - case 'p': - e.thickness=PopUpGetI64("Thickness (%d):",e.thickness); - case 'n': - if (a1=='n' || a1=='p') - e.closed=TRUE; - else - e.closed=PopUpNoYes("Closed?\n"); -me_chain: - e.chain_pred=e.vertex_head.last; - case 't': - MeshVertexSelAll(&e,FALSE); - MeshTriSelAll(&e,FALSE); - case 'v': - case 'm': - case 'M': - adjusting_z=FALSE; - moving=FALSE; - e.ed_mode=a1; - make_tri_vertex_num=0; - Snd(0); - break; - case 'T': - MeshTransformSel(&e); - break; - case 'A': - MeshTriSelAll(&e,TRUE); - if (e.ed_mode!='t') - MeshVertexSelAll(&e,TRUE); - else - MeshVertexSelAll(&e,FALSE); - make_tri_vertex_num=0; - break; - case 'U': - MeshTriSelAll(&e,FALSE); - MeshVertexSelAll(&e,FALSE); - make_tri_vertex_num=0; - break; - case 'a': - case 'u': - case 'o': - if (a1=='a') - sel_mode=SEL_MESH_EQU; - else if (a1=='u') - sel_mode=SEL_MESH_AND; - else - sel_mode=SEL_MESH_OR; - if ((msg_code=GetMsg(&a1,&a2,1<display_flags,DISPLAYf_NO_BORDER)); - break; - case CH_CTRLC: -me_clipboard_copy: - if (e.ed_mode=='t') { - Beep;Beep; - } else - MeshClipboardCopy(&e); - break; - case CH_CTRLV: -me_clipboard_paste: - if (e.ed_mode=='t') { - Beep;Beep; - } else { - MeshClipboardPaste(&e); - e.ed_mode='m'; - } - break; - case CH_CTRLX: -me_clipboard_cut: - if (e.ed_mode=='t') { - Beep;Beep; - } else - MeshClipboardCut(&e); - break; - case CH_SHIFT_ESC: - save_and_exit=FALSE; - goto me_done; - case CH_ESC: - save_and_exit=TRUE; - goto me_done; - case 'z': - MeshScaleZoom(&e,1.5); - break; - case 'Z': - MeshScaleZoom(&e,1/1.5); - break; - case 'c': - e.cur_color=PopUpColorLighting; - break; - case 's': - i=PopUpRangeI64(1,25,1,"New Snap\n"); - if (i>=1) - e.cur_snap=i; - MeshCurSnap(&e); - MeshRecalcCxCy(Fs,&e); - break; - case 'g': - e.grid_on=!e.grid_on; - break; - case 'V': - e.vertex_on=!e.vertex_on; - break; - case 'N': - s->sx=s->sy=s->sz=0; - break; - case 'y': - e.flip_y=!e.flip_y; - break; - case 'j': - if (moving) - MeshVertexIgnoreSet(&e,TRUE); - if (tempv=MeshVertexFindScrPt(&e, - ip.pos.x-Fs->pix_left-Fs->scroll_x, - ip.pos.y-Fs->pix_top-Fs->scroll_y)) { - Noise(25,2000,8000); - e.ip_z=RoundI64(tempv->p.z,e.cur_snap); - } else { - Beep; Beep; - e.ip_z=0; - } - MeshVertexIgnoreSet(&e,FALSE); - if (moving) { - MeshCursorW(&e,Fs,&x,&y,&z); - if (adjusting_z) - MeshP0Offset(&e,0,0,z-p0a.z); - else - MeshP0Offset(&e,x-p0a.x,y-p0a.y,z-p0a.z); - p0a.x=x; - p0a.y=y; - p0a.z=z; - MeshP0Capture(&e); - } - break; - case '1': - MeshSwapAxes(&e,offset(CD3I32.x),offset(CD3I32.y)); - break; - case '2': - MeshSwapAxes(&e,offset(CD3I32.x),offset(CD3I32.z)); - break; - case '3': - MeshSwapAxes(&e,offset(CD3I32.y),offset(CD3I32.z)); - break; - case '4': - MeshInvertAxis(&e,offset(CD3I32.x)); - break; - case '5': - MeshInvertAxis(&e,offset(CD3I32.y)); - break; - case '6': - MeshInvertAxis(&e,offset(CD3I32.z)); - break; - case 'r': - if (e.cur_tri) - SwapI64(&e.cur_tri->t[1],&e.cur_tri->t[2]); - break; - case 'C': - MeshColorTris(&e); - break; - case 'R': - MeshRevTris(&e); - break; - } - break; - case MSG_IP_L_DOWN: - switch (e.ed_mode) { - case 'm': - if (!moving) { - if (!MeshSelCnt(&e) && - (tempv=MeshVertexFindScrPt(&e,a1,a2))) { - tempv->flags|=VF_SEL; - e.ip_z=RoundI64(tempv->p.z,e.cur_snap); - } - if (MeshSelCnt(&e)) { - MeshCursorW(&e,Fs,&x,&y,&z); - p0a.x=x; - p0a.y=y; - p0a.z=z; - MeshP0Capture(&e); - moving=TRUE; - } - } - break; - case 'M': - if (!adjusting_z && !moving) { - if (!MeshSelCnt(&e) && - (tempv=MeshVertexFindScrPt(&e,a1,a2))) { - tempv->flags|=VF_SEL; - e.ip_z=RoundI64(tempv->p.z,e.cur_snap); - } - if (MeshSelCnt(&e)) { - MeshCursorW(&e,Fs,&x,&y,&z); - p0a.x=x; - p0a.y=y; - p0a.z=z; - MeshP0Capture(&e); - moving=TRUE; - - p0b.x=ip.presnap.x; - p0b.y=ip.presnap.y; - p0b.z=e.ip_z; - adjusting_z=TRUE; - Snd(ClampI64(3*e.ip_z+1500,0,15000)); - } - } - break; - } - break; - case MSG_IP_L_UP: - switch (e.ed_mode) { - case 'n': - case 'f': - case 'p': - case 'v': - Noise(25,2000,8000); - MeshCursorW(&e,Fs,&x,&y,&z); - e.cur_vertex=MeshVertexNew(&e,x,y,z); - break; - case 'm': - case 'M': - if (moving) { - if (adjusting_z) { - e.ip_z=RoundI64(Sign(p0b.y-ip.presnap.y) - *Sqrt(Sqr(p0b.x-ip.presnap.x)+Sqr(p0b.y-ip.presnap.y)) - +p0b.z,e.cur_snap); - Snd(0); - adjusting_z=FALSE; - MeshCursorW(&e,Fs,&x,&y,&z); - MeshP0Offset(&e,0,0,z-p0a.z); - } else { - MeshCursorW(&e,Fs,&x,&y,&z); - MeshP0Offset(&e,x-p0a.x,y-p0a.y,z-p0a.z); - } - MeshTriSelAll(&e,FALSE); - MeshVertexSelAll(&e,FALSE); - moving=FALSE; - } - break; - case 't': - if (tempv=MeshVertexFindScrPt(&e,a1,a2)) { - for (i=0;iflags|=VF_SEL; - if (make_tri_vertex_num==3) { - e.cur_tri=MeshTriNew(&e,e.cur_color,va[0],va[1],va[2]); - for (i=0;iflags&=~VF_SEL; - make_tri_vertex_num=0; - } - } - } - break; - } - break; - case MSG_IP_R_DOWN: - if (!adjusting_z && e.ed_mode!='M' && - (e.chain_pred==e.vertex_head.last || - e.ed_mode!='n' && e.ed_mode!='f' && e.ed_mode!='p')) { - if (moving) { - MeshCursorW(&e,Fs,&x,&y,&z); - MeshP0Offset(&e,x-p0a.x,y-p0a.y,z-p0a.z); - p0a.x=x; - p0a.y=y; - p0a.z=z; - MeshP0Capture(&e); - } - p0b.x=ip.presnap.x; - p0b.y=ip.presnap.y; - p0b.z=e.ip_z; - adjusting_z=TRUE; - Snd(ClampI64(3*e.ip_z+1500,0,15000)); - } - break; - case MSG_IP_R_UP: - if (adjusting_z) { - e.ip_z=RoundI64(Sign(p0b.y-ip.presnap.y) - *Sqrt(Sqr(p0b.x-ip.presnap.x)+Sqr(p0b.y-ip.presnap.y)) - +p0b.z,e.cur_snap); - Snd(0); - adjusting_z=FALSE; - if (moving) { - MeshCursorW(&e,Fs,&x,&y,&z); - MeshP0Offset(&e,0,0,z-p0a.z); - p0a.x=x; - p0a.y=y; - p0a.z=z; - MeshP0Capture(&e); - } - } else if (e.ed_mode=='n') { - if (e.chain_pred && e.chain_pred!=e.vertex_head.last) - MeshPolygon(&e,e.chain_pred->next,e.vertex_head.last,FALSE); - a1=e.ed_mode; - goto me_chain; - } else if (e.ed_mode=='f') { - if (e.chain_pred && e.chain_pred!=e.vertex_head.last) - MeshFence(&e); - a1=e.ed_mode; - goto me_chain; - } else if (e.ed_mode=='p') { - if (e.chain_pred && e.chain_pred!=e.vertex_head.last) - MeshPrism(&e); - a1=e.ed_mode; - goto me_chain; - } - break; - case MSG_IP_MOVE: - if (adjusting_z) { - e.ip_z=RoundI64(Sign(p0b.y-ip.presnap.y) - *Sqrt(Sqr(p0b.x-ip.presnap.x)+Sqr(p0b.y-ip.presnap.y)) - +p0b.z,e.cur_snap); - Snd(ClampI64(3*e.ip_z+1500,0,15000)); - } - if (moving) { - MeshCursorW(&e,Fs,&x,&y,&z); - if (adjusting_z) - MeshP0Offset(&e,0,0,z-p0a.z); - else - MeshP0Offset(&e,x-p0a.x,y-p0a.y,z-p0a.z); - p0a.x=x; - p0a.y=y; - p0a.z=z; - MeshP0Capture(&e); - } - break; - } - } -me_done: - } catch - Fs->catch_except=TRUE; - SettingsPop; - MenuPop; - if (save_and_exit) - head=MeshSave(&e,_size); - else - head=NULL; - MeshCleanUp(&e); - FramePtrDel("CMeshFrame"); - if (old_s) { - MemCpy(c->state,old_s,sizeof(CViewAngles)); - Free(old_s); - } else - ViewAnglesDel; - return head; -} diff --git a/Adam/Gr/SpriteMesh.HC b/Adam/Gr/SpriteMesh.HC new file mode 100644 index 0000000..348a7de --- /dev/null +++ b/Adam/Gr/SpriteMesh.HC @@ -0,0 +1,1507 @@ +#help_index "Graphics/Mesh" +#define MESH_WORKSPACE_SIZE 4000 + +#define VF_SEL 1 +#define VF_COPIED 2 +#define VF_IGNORE 4 + +class CMeshEdVertex +{ + CMeshEdVertex *next,*last,*copy; + + U0 start; + CD3I32 p; //World coordinates of the point. + U0 end; + CD3I32 p0, + pt; //Transformed coordinates. (Screen) + I32 num,flags; +}; + +#define TF_SEL 1 +#define TF_COPIED 2 + +class CMeshEdTri +{ + CMeshEdTri *next,*last; + + U0 start; + CMeshTri mt; + U0 end; + + I32 cpu_num,flags; //Draw different tris with different cores. + CMeshEdVertex *t[3]; +}; + +class CMeshFrame +{ + I64 ip_z,thickness; //Input pointer (mouse) Z-coordinate + I64 ed_mode,cx,cy; + CColorROPU32 cur_color; + Bool grid_on,flip_y,sel_rect,vertex_on,closed,pad[3]; + I64 mp_not_done_flags; //Used for multiprocessing signaling. + F64 view_scale; + CDC *dc; + I32 *depth_buf; + I64 *w2s,*s2w; //Screen-to-world and world-to-screen transform matrices. + I64 vertex_cnt,tri_cnt; //Set by MeshSize + CMeshEdVertex vertex_head,*cur_vertex,*chain_pred; + CMeshEdTri tri_head,*cur_tri; + I64 x1,y1,x2,y2,cur_snap; +}; + +CMeshEdVertex *MeshVertexNew(CMeshFrame *e,I64 x,I64 y,I64 z) +{ + CMeshEdVertex *tempv=CAlloc(sizeof(CMeshEdVertex)); + tempv->p.x=x; + tempv->p.y=y; + tempv->p.z=z; + QueIns(tempv,e->vertex_head.last); + return tempv; +} + +CMeshEdTri *MeshTriNew(CMeshFrame *e,CColorROPU32 color, + CMeshEdVertex *v1,CMeshEdVertex *v2,CMeshEdVertex *v3) +{ + static I64 cpu_num=0; + CMeshEdTri *tempt=CAlloc(sizeof(CMeshEdTri)); + tempt->cpu_num=cpu_num++%mp_cnt; + tempt->mt.color=color; + tempt->t[0]=v1; + tempt->t[1]=v2; + tempt->t[2]=v3; + QueIns(tempt,e->tri_head.last); + return tempt; +} + +CMeshEdVertex *MeshVertexFindScrPt(CMeshFrame *e,I64 x,I64 y) +{//Screen coordinates + CMeshEdVertex *res=NULL,*tempv=e->vertex_head.next; + I64 dd,dz,best_dd=MAX_I64,best_dz=MAX_I64; + while (tempv!=&e->vertex_head) { + if (!(tempv->flags&VF_IGNORE)) { + dd=SqrI64(x-tempv->pt.x)+SqrI64(y-tempv->pt.y); + dz=AbsI64(e->ip_z-tempv->p.z); + if (ddnext; + } + return res; +} + +CMeshEdVertex *MeshVertexFindNum(CMeshFrame *haystack_e,I64 needle_num) +{ + CMeshEdVertex *tempv=haystack_e->vertex_head.next; + while (tempv!=&haystack_e->vertex_head) { + if (tempv->num==needle_num) + return tempv; + tempv=tempv->next; + } + return NULL; +} + +U0 MeshTriDel(CMeshFrame *e,CMeshEdTri *tempt) +{ + if (tempt) { + if (tempt==e->cur_tri) + e->cur_tri=NULL; + QueRem(tempt); + Free(tempt); + } +} + +U0 MeshVertexDel(CMeshFrame *e,CMeshEdVertex *tempv) +{ + I64 i; + CMeshEdTri *tempt,*tempt1; + if (tempv) { + tempt=e->tri_head.next; + while (tempt!=&e->tri_head) { + tempt1=tempt->next; + for (i=0;i<3;i++) + if (tempt->t[i]==tempv) + break; + if (i<3) + MeshTriDel(e,tempt); + tempt=tempt1; + } + if (tempv==e->cur_vertex) + e->cur_vertex=NULL; + if (tempv==e->chain_pred) + e->chain_pred=NULL; + QueRem(tempv); + Free(tempv); + } +} + +U0 MeshFence(CMeshFrame *e) +{ + CMeshEdVertex *tempv,*tempv1,*tempv_last=NULL,*tempv1_last=NULL, + *start=e->chain_pred->next,*end=e->vertex_head.last; + tempv=start; + while (TRUE) { + tempv1=MeshVertexNew(e,tempv->p.x,tempv->p.y,tempv->p.z+e->thickness); + if (tempv_last) { + MeshTriNew(e,e->cur_color,tempv_last,tempv,tempv1); + MeshTriNew(e,e->cur_color,tempv1,tempv1_last,tempv_last); + } + tempv_last=tempv; + tempv1_last=tempv1; + if (tempv==end) + break; + tempv=tempv->next; + } + if (e->closed && tempv_last) { + MeshTriNew(e,e->cur_color,tempv_last,start,end->next); + MeshTriNew(e,e->cur_color,end->next,tempv1_last,tempv_last); + } +} + +U0 MeshPolygon(CMeshFrame *e,CMeshEdVertex *start,CMeshEdVertex *end,Bool rev) +{ + CMeshEdVertex *tempv,*tempv1; + if (start!=end) { + tempv=start; + tempv1=tempv->next; + while (tempv1!=end) { + if (rev) + MeshTriNew(e,e->cur_color,tempv1,tempv,end); + else + MeshTriNew(e,e->cur_color,tempv,tempv1,end); + tempv=tempv->next; + tempv1=tempv1->next; + } + } +} + +U0 MeshPrism(CMeshFrame *e) +{ + CMeshEdVertex *start=e->chain_pred->next,*end=e->vertex_head.last; + MeshFence(e); + MeshPolygon(e,start,end,FALSE); + MeshPolygon(e,end->next,e->vertex_head.last,TRUE); +} + +U0 MeshVertexSelAll(CMeshFrame *e,Bool val) +{ + CMeshEdVertex *tempv=e->vertex_head.next; + while (tempv!=&e->vertex_head) { + if (val) + tempv->flags|=VF_SEL; + else + tempv->flags&=~VF_SEL; + tempv=tempv->next; + } +} + +U0 MeshTriSelAll(CMeshFrame *e,Bool val) +{ + CMeshEdTri *tempt=e->tri_head.next; + while (tempt!=&e->tri_head) { + if (val) + tempt->flags|=TF_SEL; + else + tempt->flags&=~TF_SEL; + tempt=tempt->next; + } +} + +U0 MeshVertexIgnoreSet(CMeshFrame *e,Bool val) +{ + CMeshEdVertex *tempv=e->vertex_head.next; + while (tempv!=&e->vertex_head) { + tempv->flags&=~VF_IGNORE; + if (tempv->flags&VF_SEL && val) + tempv->flags|=VF_IGNORE; + tempv=tempv->next; + } +} + +U0 MeshP0Capture(CMeshFrame *e) +{ + CMeshEdVertex *tempv=e->vertex_head.next; + while (tempv!=&e->vertex_head) { + MemCpy(&tempv->p0,&tempv->p,sizeof(CD3I32)); + tempv=tempv->next; + } +} + +U0 MeshP0Offset(CMeshFrame *e,I64 dx,I64 dy,I64 dz) +{ + CMeshEdVertex *tempv=e->vertex_head.next; + while (tempv!=&e->vertex_head) { + if (tempv->flags&VF_SEL) { + tempv->p.x=tempv->p0.x+dx; + tempv->p.y=tempv->p0.y+dy; + tempv->p.z=tempv->p0.z+dz; + } + tempv=tempv->next; + } +} + +#define SEL_MESH_EQU 0 +#define SEL_MESH_OR 1 +#define SEL_MESH_AND 2 + +U0 MeshVertexSelRect(CMeshFrame *e,I64 sel_mode,I64 x1,I64 x2,I64 y1,I64 y2) +{ + CMeshEdVertex *tempv=e->vertex_head.next; + if (x1>x2) SwapI64(&x1,&x2); + if (y1>y2) SwapI64(&y1,&y2); + while (tempv!=&e->vertex_head) { + if (x1<=tempv->pt.x<=x2 && + y1<=tempv->pt.y<=y2) { + if (sel_mode==SEL_MESH_AND) + tempv->flags&=~VF_SEL; + else + tempv->flags|=VF_SEL; + } else if (sel_mode==SEL_MESH_EQU) + tempv->flags&=~VF_SEL; + tempv=tempv->next; + } +} + +U0 MeshTriSelRect(CMeshFrame *e,I64 sel_mode,I64 x1,I64 x2,I64 y1,I64 y2) +{ + CMeshEdTri *tempt=e->tri_head.next; + if (x1>x2) SwapI64(&x1,&x2); + if (y1>y2) SwapI64(&y1,&y2); + while (tempt!=&e->tri_head) { + if (x1<=tempt->t[0]->pt.x<=x2 && + y1<=tempt->t[0]->pt.y<=y2 && + x1<=tempt->t[1]->pt.x<=x2 && + y1<=tempt->t[1]->pt.y<=y2 && + x1<=tempt->t[2]->pt.x<=x2 && + y1<=tempt->t[2]->pt.y<=y2) { + if (sel_mode==SEL_MESH_AND) + tempt->flags&=~TF_SEL; + else + tempt->flags|=TF_SEL; + } else { + if (sel_mode==SEL_MESH_EQU) + tempt->flags&=~TF_SEL; + else if (sel_mode==SEL_MESH_AND) { + if (x1<=tempt->t[0]->pt.x<=x2 && + y1<=tempt->t[0]->pt.y<=y2 || + x1<=tempt->t[1]->pt.x<=x2 && + y1<=tempt->t[1]->pt.y<=y2 || + x1<=tempt->t[2]->pt.x<=x2 && + y1<=tempt->t[2]->pt.y<=y2) + tempt->flags&=~TF_SEL; + } + } + tempt=tempt->next; + } +} + +I64 MeshSelCnt(CMeshFrame *e) +{ + I64 res=0; + CMeshEdVertex *tempv=e->vertex_head.next; + CMeshEdTri *tempt=e->tri_head.next; + while (tempv!=&e->vertex_head) { + if (tempv->flags&VF_SEL) + res++; + tempv=tempv->next; + } + while (tempt!=&e->tri_head) { + if (tempt->flags&TF_SEL) + res++; + tempt=tempt->next; + } + return res; +} + +U0 MeshSwapAxes(CMeshFrame *e,I64 o1,I64 o2) +{ + Bool unsel; + CMeshEdVertex *tempv=e->vertex_head.next; + if (!MeshSelCnt(e)) { + MeshVertexSelAll(e,TRUE); + unsel=TRUE; + } else + unsel=FALSE; + while (tempv!=&e->vertex_head) { + if (tempv->flags&VF_SEL) + SwapU32((&tempv->p)(U8 *)+o1,(&tempv->p)(U8 *)+o2); + tempv=tempv->next; + } + if (unsel) + MeshVertexSelAll(e,FALSE); +} + +U0 MeshInvertAxis(CMeshFrame *e,I64 o) +{ + Bool unsel; + CMeshEdVertex *tempv=e->vertex_head.next; + if (!MeshSelCnt(e)) { + MeshVertexSelAll(e,TRUE); + unsel=TRUE; + } else + unsel=FALSE; + while (tempv!=&e->vertex_head) { + if (tempv->flags&VF_SEL) + *((&tempv->p)(U8 *)+o)(I32 *)=-*((&tempv->p)(U8 *)+o)(I32 *); + tempv=tempv->next; + } + if (unsel) + MeshVertexSelAll(e,FALSE); +} + +U0 MeshTransformSel(CMeshFrame *e) +{ + Bool unsel; + I64 r[16],x,y,z; + CMeshEdVertex *tempv=e->vertex_head.next; + if (PopUpTransform(r)) { + if (!MeshSelCnt(e)) { + MeshVertexSelAll(e,TRUE); + unsel=TRUE; + } else + unsel=FALSE; + while (tempv!=&e->vertex_head) { + if (tempv->flags&VF_SEL) { + x=tempv->p.x; y=tempv->p.y; z=tempv->p.z; + Mat4x4MulXYZ(r,&x,&y,&z); + tempv->p.x=x; tempv->p.y=y; tempv->p.z=z; + } + tempv=tempv->next; + } + if (unsel) + MeshVertexSelAll(e,FALSE); + } +} + +U0 MeshColorTris(CMeshFrame *e) +{ + Bool unsel; + CMeshEdTri *tempt=e->tri_head.next; + if (!MeshSelCnt(e)) { + MeshTriSelAll(e,TRUE); + unsel=TRUE; + } else + unsel=FALSE; + while (tempt!=&e->tri_head) { + if (tempt->flags & TF_SEL) + tempt->mt.color=e->cur_color; + tempt=tempt->next; + } + if (unsel) + MeshTriSelAll(e,FALSE); +} + +U0 MeshRevTris(CMeshFrame *e) +{ + Bool unsel; + CMeshEdTri *tempt=e->tri_head.next; + if (!MeshSelCnt(e)) { + MeshTriSelAll(e,TRUE); + unsel=TRUE; + } else + unsel=FALSE; + while (tempt!=&e->tri_head) { + if (tempt->flags & TF_SEL) + SwapI64(&tempt->t[1],&tempt->t[2]); + tempt=tempt->next; + } + if (unsel) + MeshTriSelAll(e,FALSE); +} + +U0 MeshRecalcCxCy(CTask *task,CMeshFrame *e) +{ + e->cx=RoundI64(task->pix_width/2 -task->horz_scroll.pos,e->cur_snap); + e->cy=RoundI64(task->pix_height/2-task->vert_scroll.pos,e->cur_snap); +} + +U0 MeshCurSnap(CMeshFrame *e) +{ + I64 x1,y1,z1,x2,y2,z2; + if (e->w2s) { + x1=e->cur_snap<<16; y1=0; z1=0; + Mat4x4MulXYZ(e->w2s,&x1,&y1,&z1); + x2=0; y2=e->cur_snap<<16; z2=0; + Mat4x4MulXYZ(e->w2s,&x2,&y2,&z2); + ip_grid.x=Max(1,MaxI64(x1,x2)>>16); + ip_grid.y=Max(1,MaxI64(y1,y2)>>16); + ip_grid.z=Min(ip_grid.x,ip_grid.y); + } +} + +U0 MeshScaleZoom(CMeshFrame *e,F64 scale) +{ + CTask *task=Fs; + I64 x=ip.pos.x-task->pix_left-task->scroll_x-task->pix_width/2, + y=ip.pos.y-task->pix_top-task->scroll_y-task->pix_height/2; + task->horz_scroll.pos*=scale; + task->vert_scroll.pos*=scale; + task->horz_scroll.pos+=scale*x-x; + task->vert_scroll.pos+=scale*y-y; + e->view_scale*=scale; + MeshRecalcCxCy(task,e); + MeshCurSnap(e); +} + +U0 MPDrawIt(CMeshFrame *e) +{//Multiprocessing draw it, called by each core. + + //Makes a copy of e->dc so we can change dc->color member and stuff. + CDC *dc=DCAlias(e->dc,e->dc->win_task); + + CMeshEdTri *tempt=e->tri_head.next; + I64 i,*old_r=dc->r; + + //$LK,"DCAlias",A="MN:DCAlias"$() allocs a new identity rotation matrix. + //We want e->dc's rotation matrix. + dc->r=e->dc->r; + dc->depth_buf=e->depth_buf; + MemCpy(&dc->ls,&e->dc->ls,sizeof(CD3I32)); + + //... and translation (shift) vals. + dc->x=e->dc->x; + dc->y=e->dc->y; + dc->z=e->dc->z; + dc->flags|=DCF_TRANSFORMATION; + + if (e->grid_on) +//Draw grid with different cores. + for (i=-500+25*Gs->num;i<=500;i+=25*mp_cnt) { + if (i) { + dc->color=DKGRAY; + GrLine3(dc,i,-500,0,i,500,0); + dc->color=LTGRAY; + GrLine3(dc,-500,i,0,500,i,0); + } + } + if (!Gs->num) { + dc->color=RED; //Y-Axis red + GrLine3(dc,0,0,0,0,500,0); + dc->color=ROPF_DITHER+RED; //Y-Axis red + GrLine3(dc,0,-500,0,0,0,0); + + dc->color=YELLOW; //X-Axis yellow + GrLine3(dc,0,0,0,500,0,0); + dc->color=ROPF_DITHER+YELLOW; //X-Axis yellow + GrLine3(dc,-500,0,0,0,0,0); + + dc->color=GREEN; //Z-Axis green + GrLine3(dc,0,0,0,0,0,500); + dc->color=ROPF_DITHER+GREEN; //Z-Axis green + GrLine3(dc,0,0,-500,0,0,0); + } + + while (tempt!=&e->tri_head) { + if (tempt->cpu_num==Gs->num) { + if (tempt->flags & TF_SEL) { + if (Blink) + dc->color=ROPF_DITHER+WHITE<<16+RED; + else + dc->color=ROPF_DITHER+RED<<16+WHITE; + GrFillTri0(dc,&tempt->t[0]->pt,&tempt->t[1]->pt,&tempt->t[2]->pt); + } else { + (*dc->lighting)(dc,&tempt->t[0]->pt,&tempt->t[1]->pt, + &tempt->t[2]->pt,tempt->mt.color); + GrFillTri0(dc,&tempt->t[0]->pt,&tempt->t[1]->pt,&tempt->t[2]->pt); + } + } + tempt=tempt->next; + } + dc->r=old_r; + + //e->dc's depth buf was copied but we don't want it freed during $LK,"DCDel",A="MN:DCDel"$(). + dc->depth_buf=NULL; + + DCDel(dc); + LBtr(&e->mp_not_done_flags,Gs->num); +} + +I64 *MeshW2S(CMeshFrame *e,CTask *task) +{//World to screen coordinate transform matrix. + CCtrl *c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES); + CViewAngles *s=c->state; + I64 *r=Mat4x4IdentNew(task); + Mat4x4Scale(r,e->view_scale); + Mat4x4RotZ(r,s->az); + Mat4x4RotY(r,s->ay); + if (e->flip_y) + Mat4x4RotX(r,s->ax); + else + Mat4x4RotX(r,s->ax+ã); + return r; +} + +I64 *MeshS2W(CMeshFrame *e,CTask *task) +{//Screen to world coordinate transform matrix. + CCtrl *c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES); + CViewAngles *s=c->state; + I64 *r=Mat4x4IdentNew(task); + if (e->flip_y) + Mat4x4RotX(r,-s->ax); + else + Mat4x4RotX(r,-(s->ax+ã)); + Mat4x4RotY(r,-s->ay); + Mat4x4RotZ(r,-s->az); + Mat4x4Scale(r,1/e->view_scale); + return r; +} + +I64 *MeshSetW2S(CMeshFrame *e,CTask *task) +{ + Free(e->w2s); + e->w2s=MeshW2S(e,task); + Free(e->s2w); + e->s2w=MeshS2W(e,task); +//returned matrix is assigned to dc->r and will be freed by $LK,"DCDel",A="MN:DCDel"$(). + return Mat4x4New(e->w2s,task); +} + +U0 MeshCursorW(CMeshFrame *e,CTask *task,I64 *_x,I64 *_y,I64 *_z) +{ + I64 x_shadow,y_shadow,z_shadow, + xc=ip.pos.x-task->pix_left-task->scroll_x-e->cx, + yc=ip.pos.y-task->pix_top-task->scroll_y-e->cy,zc=0, + x=0,y=0,z=e->ip_z, + i,x2,y2,z2; + Mat4x4MulXYZ(e->w2s,&x,&y,&z); //screen of Z vect + + //Converges onto a solution for zc, an unknown. + for (i=0;i<128;i++) { + x_shadow=xc-x; //Shadow of mouse cursor on xy plane + y_shadow=yc-y; + z_shadow=zc-z; + Mat4x4MulXYZ(e->s2w,&x_shadow,&y_shadow,&z_shadow); + x2=0; y2=0; z2=-z_shadow; + Mat4x4MulXYZ(e->w2s,&x2,&y2,&z2); + zc+=Round(Sqrt(x2*x2+y2*y2+z2*z2))*SignI64(z2); + } + + x=xc-x; + y=yc-y; + z=zc-z; + Mat4x4MulXYZ(e->s2w,&x,&y,&z); + x=RoundI64(x,e->cur_snap); + y=RoundI64(y,e->cur_snap); + z=RoundI64(e->ip_z,e->cur_snap); + *_x=x; *_y=y; *_z=z; +} + +CMeshEdVertex sys_clipboard_vertex_head; +CMeshEdTri sys_clipboard_tri_head; + +U0 MeshClipboardInit() +{ + QueInit(&sys_clipboard_vertex_head); + QueInit(&sys_clipboard_tri_head); +} + +U0 MeshClipboardRst() +{ + QueDel(&sys_clipboard_vertex_head,TRUE); + QueDel(&sys_clipboard_tri_head,TRUE); + MeshClipboardInit; +} + +U0 MeshClipboardCopy(CMeshFrame *e) +{ + CMeshEdVertex *tempv=e->vertex_head.next,*tempv2; + CMeshEdTri *tempt=e->tri_head.next,*tempt2; + + MeshClipboardRst; + while (tempv!=&e->vertex_head) { + if (tempv->flags&VF_SEL) { + tempv->copy=tempv2=ACAlloc(sizeof(CMeshEdVertex)); + MemCpy(&tempv2->p,&tempv->p,sizeof(CD3I32)); + QueIns(tempv2,sys_clipboard_vertex_head.last); + tempv->flags|=VF_COPIED; + tempv->flags&=~VF_SEL; + } else { + tempv->copy=NULL; + tempv->flags&=~(VF_COPIED|VF_SEL); + } + tempv=tempv->next; + } + while (tempt!=&e->tri_head) { + if (tempt->flags&TF_SEL && + tempt->t[0]->copy && tempt->t[1]->copy && tempt->t[2]->copy) { + tempt2=ACAlloc(sizeof(CMeshEdTri)); + tempt2->t[0]=tempt->t[0]->copy; + tempt2->t[1]=tempt->t[1]->copy; + tempt2->t[2]=tempt->t[2]->copy; + tempt2->mt.color=tempt->mt.color; + QueIns(tempt2,sys_clipboard_tri_head.last); + tempt->flags|=TF_COPIED; + tempt->flags&=~TF_SEL; + } else + tempt->flags&=~(TF_COPIED|TF_SEL); + tempt=tempt->next; + } +} + +U0 MeshClipboardCut(CMeshFrame *e) +{ + CMeshEdVertex *tempv=e->vertex_head.next,*tempv1; + CMeshEdTri *tempt=e->tri_head.next,*tempt1; + MeshClipboardCopy(e); + while (tempt!=&e->tri_head) { + tempt1=tempt->next; + if (tempt->flags&TF_COPIED) + MeshTriDel(e,tempt); + tempt=tempt1; + } + while (tempv!=&e->vertex_head) { + tempv1=tempv->next; + if (tempv->flags&VF_COPIED) + MeshVertexDel(e,tempv); + tempv=tempv1; + } +} + +U0 MeshClipboardDel(CMeshFrame *e) +{//Technically not clipboard + CMeshEdVertex *tempv=e->vertex_head.next,*tempv1; + CMeshEdTri *tempt=e->tri_head.next,*tempt1; + while (tempt!=&e->tri_head) { + tempt1=tempt->next; + if (tempt->flags&TF_SEL) + MeshTriDel(e,tempt); + tempt=tempt1; + } + while (tempv!=&e->vertex_head) { + tempv1=tempv->next; + if (tempv->flags&VF_SEL) + MeshVertexDel(e,tempv); + tempv=tempv1; + } +} + +U0 MeshClipboardPaste(CMeshFrame *e) +{ + CMeshEdVertex *tempv2=sys_clipboard_vertex_head.next,*tempv; + CMeshEdTri *tempt2=sys_clipboard_tri_head.next,*tempt; + + MeshVertexSelAll(e,FALSE); + MeshTriSelAll(e,FALSE); + while (tempv2!=&sys_clipboard_vertex_head) { + tempv2->copy=tempv=CAlloc(sizeof(CMeshEdVertex)); + MemCpy(&tempv->p,&tempv2->p,sizeof(CD3I32)); + QueIns(tempv,e->vertex_head.last); + tempv->flags|=VF_SEL; + tempv2=tempv2->next; + } + + while (tempt2!=&sys_clipboard_tri_head) { + tempt=MeshTriNew(e,tempt2->mt.color,tempt2->t[0]->copy, + tempt2->t[1]->copy,tempt2->t[2]->copy); + tempt->flags|=TF_SEL; + tempt2=tempt2->next; + } +} + +MeshClipboardInit; + +U0 DrawIt(CTask *task,CDC *dc) +{ + CMeshFrame *e=FramePtr("CMeshFrame",task); + CCtrl *c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES); + F64 d; + I64 i,x,y,z; + CMeshEdVertex *tempv; + + task->horz_scroll.min=-(MESH_WORKSPACE_SIZE-task->pix_width)/2; + task->horz_scroll.max= (MESH_WORKSPACE_SIZE-task->pix_width)/2; + task->vert_scroll.min=-(MESH_WORKSPACE_SIZE-task->pix_height)/2; + task->vert_scroll.max= (MESH_WORKSPACE_SIZE-task->pix_height)/2; + TaskDerivedValsUpdate(task); + MeshRecalcCxCy(task,e); + + dc->flags|=DCF_TRANSFORMATION; + + Free(dc->r); //Set rotmat doesn't free old dc->r matrix. + DCMat4x4Set(dc,MeshSetW2S(e,task)); + + dc->x=e->cx; + dc->y=e->cy; +//z-vals less than zero are in front of screen and not drawn. + //we want to shift all Z-vals into a drawable range. + //GR_Z_ALL is set to half of the Z-range which is an I32. + dc->z=GR_Z_ALL; + + //Light source set to input pointer (mouse). + MeshCursorW(e,task,&x,&y,&z); + dc->ls.x=x; + dc->ls.y=y; + dc->ls.z=z; + d=1<<16/D3I32Norm(&dc->ls); //Light source normalized to 65536. + dc->ls.x*=d; + dc->ls.y*=d; + dc->ls.z*=d; + + DCDepthBufAlloc(dc); + + tempv=e->vertex_head.next; + while (tempv!=&e->vertex_head) { + x=tempv->p.x; y=tempv->p.y; z=tempv->p.z; + (*dc->transform)(dc,&x,&y,&z); + tempv->pt.x=x; tempv->pt.y=y; tempv->pt.z=z; + tempv=tempv->next; + } + + e->mp_not_done_flags=1<dc=dc; + e->depth_buf=dc->depth_buf; + for (i=0;ivertex_head.next; + while (tempv!=&e->vertex_head) { + x=tempv->pt.x; y=tempv->pt.y; z=tempv->pt.z; + if (e->vertex_on) { + if (Blink(10)) //This blinks at 10 Hz. + dc->color=ROPF_DITHER+BLACK<<16+WHITE; + else + dc->color=ROPF_DITHER+WHITE<<16+BLACK; + GrLine(dc,x-3,y-3,x+3,y+3); + GrLine(dc,x-3,y+3,x+3,y-3); + } + if (tempv->flags&VF_SEL) { + if (e->ed_mode=='t') { + if (Blink(10)) //This blinks at 10 Hz. + dc->color=ROPF_DITHER+e->cur_color.c0.color<<16+ + e->cur_color.c0.color^8; + else + dc->color=ROPF_DITHER+(e->cur_color.c0.color^8)<<16+ + e->cur_color.c0.color; + } else { + if (Blink) + dc->color=ROPF_DITHER+RED<<16+WHITE; + else + dc->color=ROPF_DITHER+WHITE<<16+RED; + } + GrCircle(dc,x,y,3); + } + tempv=tempv->next; + } + + if (CtrlInside(c,ip.presnap.x,ip.presnap.y)||winmgr.show_menu) { + GridInit; + task->win_inhibit=WIF_SELF_DOC; + } else { + MeshCurSnap(e); + task->win_inhibit=WIG_TASK_DFT|WIF_SELF_DOC-WIF_SELF_FOCUS-WIF_SELF_BORDER + -WIF_SELF_CTRLS-WIF_FOCUS_TASK_MENU-WIF_SELF_GRAB_SCROLL; + } + + MeshCursorW(e,task,&x,&y,&z); + if (z<0) + dc->color=ROP_XOR+RED^TRANSPARENT; + else + dc->color=ROP_XOR+TRANSPARENT; + GrPrint(dc,0,0,"%6.3f%% (%d,%d,%d)",e->view_scale*100,x,y,z); + dc->pen_width=1; + dc->color&=0xF; + if (Blink(10)) + dc->color^=0xF; + GrLine3(dc,x,y,z,x,y,0); + + if (e->sel_rect) { + dc->flags&=~DCF_TRANSFORMATION; + dc->pen_width=1; + if (Blink) + dc->color=ROPF_DITHER+RED<<16+WHITE; + else + dc->color=ROPF_DITHER+WHITE<<16+RED; + GrBorder(dc,e->x1,e->y1,e->x2,e->y2); + } +//Wait for all cores to complete. + while (e->mp_not_done_flags) + Yield; +} + +U0 MeshInit(CMeshFrame *e,Bool flip_y) +{ + MemSet(e,0,sizeof(CMeshFrame)); + QueInit(&e->vertex_head); + QueInit(&e->tri_head); + e->ed_mode='v'; + e->grid_on=TRUE; + e->vertex_on=TRUE; + e->ip_z=0; + e->thickness=25; + e->closed=TRUE; + e->view_scale=1.0; + e->w2s=NULL; + e->s2w=NULL; + e->cur_color=RED; + e->cur_snap=5; + e->flip_y=flip_y; + e->sel_rect=FALSE; + e->cur_tri=NULL; + e->cur_vertex=NULL; + e->chain_pred=NULL; +} + +U0 MeshLoad(CMeshFrame *e,U8 *src) +{ + I64 i,j,x,y,z; + CColorROPU32 color; + CMeshEdVertex *tempv,*va[3]; + + QueInit(&e->vertex_head); + QueInit(&e->tri_head); + + e->vertex_cnt =*src(I32 *)++; + e->tri_cnt=*src(I32 *)++; + for (i=0;ivertex_cnt;i++) { + x=*src(I32 *)++; + y=*src(I32 *)++; + z=*src(I32 *)++; + tempv=MeshVertexNew(e,x,y,z); + tempv->num=i; + } + for (i=0;itri_cnt;i++) { + color=*src(I32 *)++; + for (j=0;j<3;j++) + va[j]=MeshVertexFindNum(e,*src(I32 *)++); + MeshTriNew(e,color,va[0],va[1],va[2]); + } +} + +I64 MeshSize(CMeshFrame *e) +{ + I64 i; + CMeshEdVertex *tempv=e->vertex_head.next; + CMeshEdTri *tempt=e->tri_head.next; + + e->vertex_cnt=0; + while (tempv!=&e->vertex_head) { + tempv->num=e->vertex_cnt++; + tempv=tempv->next; + } + + e->tri_cnt=0; + while (tempt!=&e->tri_head) { + e->tri_cnt++; + for (i=0;i<3;i++) + tempt->mt.nums[i]=tempt->t[i]->num; + tempt=tempt->next; + } + return sizeof(I32)*2+ + (offset(CMeshEdVertex.end)-offset(CMeshEdVertex.start))*e->vertex_cnt+ + (offset(CMeshEdTri.end)-offset(CMeshEdTri.start))*e->tri_cnt; +} + +I32 *MeshSave(CMeshFrame *e,I64 *_size=NULL) +{ + I64 size=MeshSize(e); + U8 *res=MAlloc(size),*dst=res; + CMeshEdVertex *tempv=e->vertex_head.next; + CMeshEdTri *tempt=e->tri_head.next; + + *dst(I32 *)++=e->vertex_cnt; + *dst(I32 *)++=e->tri_cnt; + + e->vertex_cnt=0; + while (tempv!=&e->vertex_head) { + MemCpy(dst,&tempv->start,offset(CMeshEdVertex.end) + -offset(CMeshEdVertex.start)); + dst+=offset(CMeshEdVertex.end)-offset(CMeshEdVertex.start); + tempv=tempv->next; + } + + e->tri_cnt=0; + while (tempt!=&e->tri_head) { + MemCpy(dst,&tempt->start,offset(CMeshEdTri.end)-offset(CMeshEdTri.start)); + dst+=offset(CMeshEdTri.end)-offset(CMeshEdTri.start); + tempt=tempt->next; + } + if (_size) *_size=size; + return res; +} + +U0 MeshCleanUp(CMeshFrame *e) +{ + QueDel(&e->vertex_head,TRUE); + QueDel(&e->tri_head,TRUE); + Free(e->w2s); + Free(e->s2w); +} + +U0 MeshUpdateMenu(CMeshFrame *e) +{ + CMenuEntry *tempse; + if (tempse=MenuEntryFind(Fs->cur_menu,"View/Grid")) + tempse->checked=ToBool(e->grid_on); + if (tempse=MenuEntryFind(Fs->cur_menu,"View/Vertex")) + tempse->checked=ToBool(e->vertex_on); + if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/PlaceVertex")) + tempse->checked=ToBool(e->ed_mode=='v'); + if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/MoveVertex")) + tempse->checked=ToBool(e->ed_mode=='m'); + if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/MoveVertexZ")) + tempse->checked=ToBool(e->ed_mode=='M'); + if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/Triangle")) + tempse->checked=ToBool(e->ed_mode=='t'); + if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/Polygon")) + tempse->checked=ToBool(e->ed_mode=='n'); + if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/Fence")) + tempse->checked=ToBool(e->ed_mode=='f'); + if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/Prism")) + tempse->checked=ToBool(e->ed_mode=='p'); + if (tempse=MenuEntryFind(Fs->cur_menu,"View/FlipY")) + tempse->checked=ToBool(e->flip_y); +} + +I32 *SpriteMeshEd(I32 *head=NULL,I64 *_size=NULL,Bool flip_y=FALSE) +{/*Fmt for mesh: +{ +I32 vertex_cnt; +I32 tri_cnt; +CD3I32 vertices[]; +CMeshTri tris[]; +} + +If head points to a mesh, it will load it. + +Returns a newly malloced mesh or NULL. + +See $LK,"::/Demo/Graphics/SpritePlot3D.HC"$. +$WW,0$*/ + CCtrl *c=CtrlFindUnique(Fs,CTRLT_VIEWING_ANGLES); + CViewAngles *s,*old_s; + I64 i,msg_code,sel_mode,a1,a2,make_tri_vertex_num=0,x,y,z; + CD3I32 p0a,p0b; + CMeshEdVertex *va[3],*tempv; + Bool adjusting_z=FALSE,moving,save_and_exit; + CMeshFrame e; + + if (c) { + old_s=MAlloc(sizeof(CViewAngles)); + MemCpy(old_s,c->state,sizeof(CViewAngles)); + } else { + c=ViewAnglesNew; + old_s=NULL; + } + + s=c->state; + s->sx=0; + s->sy=0; + s->sz=0; + s->cx=YELLOW; + s->cy=RED; + s->cz=GREEN; + + MenuPush( + "File {" + " Abort(,CH_SHIFT_ESC);" + " Exit(,CH_ESC);" + "}" + "Edit {" + " Delete(,,SC_DELETE);" + " DelLast(,CH_BACKSPACE);" + " Cut(,CH_CTRLX);" + " Copy(,CH_CTRLC);" + " Paste(,CH_CTRLV);" + " SelectAll(,'A');" + " UnSelectAll(,'U');" + " SelectRect(,'a');" + " UnSelectRect(,'u');" + " OrSelectRect(,'o');" + " JumpToZ(,'j');" + " ResetColor(,'C');" + " ReverseTri(,'r');" + "}" + "Mode {" + " PlaceVertex(,'v');" + " MoveVertex(,'m');" + " MoveVertexZ(,'M');" + " Triangle(,'t');" + " Polygon(,'n');" + " Fence(,'f');" + " Prism(,'p');" + "}" + "Settings {" + " Color(,'c');" + " Snap(,'s');" + "}" + "View {" + " ZoomIn(,'z');" + " ZoomOut(,'Z');" + " NullAngles(,'N');" + " FlipY(,'y');" + " Grid(,'g');" + " Vertex(,'V');" + " ToggleBorder(,CH_CTRLB);" + "}" + "Transforms {" + " Transform(,'T');" + " SwapXY(,'1');" + " SwapXZ(,'2');" + " SwapYZ(,'3');" + " InvertX(,'4');" + " InvertY(,'5');" + " InvertZ(,'6');" + " ReverseTri(,'R');" + "}"); + + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + AutoComplete; + RegOneTimePopUp(ARf_MESH_ED, + "$$GREEN$$Right Mouse$$FG$$: Hold and move to shift cursor z\n" + "$$GREEN$$'j'$$FG$$: Jump cursor Z to nearest vertex's Z\n" + "$$GREEN$$'v'$$FG$$: Place Vertex Mode\n" + "$$GREEN$$'m'$$FG$$: Move Vertex Mode\n" + "$$GREEN$$'M'$$FG$$: Move Vertex Z\n" + "$$GREEN$$'t'$$FG$$: Form Triangle Mode\n" + "$$GREEN$$'n'$$FG$$: Polygon Mode\n" + "$$GREEN$$'f'$$FG$$: Fence Mode\n" + "$$GREEN$$'p'$$FG$$: Prism Mode\n" + "$$GREEN$$'c'$$FG$$: Set color\n" + "$$GREEN$$'s'$$FG$$: Set snap\n" + "\nSee menu at top of screen for more.\n"); + + Fs->win_inhibit=WIG_TASK_DFT|WIF_SELF_DOC-WIF_SELF_FOCUS-WIF_SELF_BORDER + -WIF_SELF_CTRLS-WIF_FOCUS_TASK_MENU-WIF_SELF_GRAB_SCROLL; + Fs->horz_scroll.pos=0; + Fs->vert_scroll.pos=0; + MeshInit(&e,flip_y); + if (head) + MeshLoad(&e,head); + FramePtrAdd("CMeshFrame",&e); + Fs->draw_it=&DrawIt; + MeshCurSnap(&e); + MeshRecalcCxCy(Fs,&e); + + try {//In case of + while (TRUE) { + MeshUpdateMenu(&e); + msg_code=GetMsg(&a1,&a2,1<pix_left-Fs->scroll_x, + ip.presnap.y-Fs->pix_top-Fs->scroll_y)); + MeshVertexSelAll(&e,FALSE); + MeshTriSelAll(&e,FALSE); + make_tri_vertex_num=0; + } + break; + case SC_INS: + if (a2&SCF_CTRL) + goto me_clipboard_copy; + else if (a2&SCF_SHIFT) + goto me_clipboard_paste; + } + break; + case CH_BACKSPACE: + switch (e.ed_mode) { + case 'n': + case 'f': + case 'p': + case 'v': + MeshVertexDel(&e,e.cur_vertex); + break; + case 't': + if (make_tri_vertex_num) { + MeshVertexSelAll(&e,FALSE); + MeshTriSelAll(&e,FALSE); + make_tri_vertex_num=0; + } else + MeshTriDel(&e,e.cur_tri); + break; + } + break; + case 'f': + case 'p': + e.thickness=PopUpGetI64("Thickness (%d):",e.thickness); + case 'n': + if (a1=='n' || a1=='p') + e.closed=TRUE; + else + e.closed=PopUpNoYes("Closed?\n"); +me_chain: + e.chain_pred=e.vertex_head.last; + case 't': + MeshVertexSelAll(&e,FALSE); + MeshTriSelAll(&e,FALSE); + case 'v': + case 'm': + case 'M': + adjusting_z=FALSE; + moving=FALSE; + e.ed_mode=a1; + make_tri_vertex_num=0; + Snd(0); + break; + case 'T': + MeshTransformSel(&e); + break; + case 'A': + MeshTriSelAll(&e,TRUE); + if (e.ed_mode!='t') + MeshVertexSelAll(&e,TRUE); + else + MeshVertexSelAll(&e,FALSE); + make_tri_vertex_num=0; + break; + case 'U': + MeshTriSelAll(&e,FALSE); + MeshVertexSelAll(&e,FALSE); + make_tri_vertex_num=0; + break; + case 'a': + case 'u': + case 'o': + if (a1=='a') + sel_mode=SEL_MESH_EQU; + else if (a1=='u') + sel_mode=SEL_MESH_AND; + else + sel_mode=SEL_MESH_OR; + if ((msg_code=GetMsg(&a1,&a2,1<display_flags,DISPLAYf_NO_BORDER)); + break; + case CH_CTRLC: +me_clipboard_copy: + if (e.ed_mode=='t') { + Beep;Beep; + } else + MeshClipboardCopy(&e); + break; + case CH_CTRLV: +me_clipboard_paste: + if (e.ed_mode=='t') { + Beep;Beep; + } else { + MeshClipboardPaste(&e); + e.ed_mode='m'; + } + break; + case CH_CTRLX: +me_clipboard_cut: + if (e.ed_mode=='t') { + Beep;Beep; + } else + MeshClipboardCut(&e); + break; + case CH_SHIFT_ESC: + save_and_exit=FALSE; + goto me_done; + case CH_ESC: + save_and_exit=TRUE; + goto me_done; + case 'z': + MeshScaleZoom(&e,1.5); + break; + case 'Z': + MeshScaleZoom(&e,1/1.5); + break; + case 'c': + e.cur_color=PopUpColorLighting; + break; + case 's': + i=PopUpRangeI64(1,25,1,"New Snap\n"); + if (i>=1) + e.cur_snap=i; + MeshCurSnap(&e); + MeshRecalcCxCy(Fs,&e); + break; + case 'g': + e.grid_on=!e.grid_on; + break; + case 'V': + e.vertex_on=!e.vertex_on; + break; + case 'N': + s->sx=s->sy=s->sz=0; + break; + case 'y': + e.flip_y=!e.flip_y; + break; + case 'j': + if (moving) + MeshVertexIgnoreSet(&e,TRUE); + if (tempv=MeshVertexFindScrPt(&e, + ip.pos.x-Fs->pix_left-Fs->scroll_x, + ip.pos.y-Fs->pix_top-Fs->scroll_y)) { + Noise(25,2000,8000); + e.ip_z=RoundI64(tempv->p.z,e.cur_snap); + } else { + Beep; Beep; + e.ip_z=0; + } + MeshVertexIgnoreSet(&e,FALSE); + if (moving) { + MeshCursorW(&e,Fs,&x,&y,&z); + if (adjusting_z) + MeshP0Offset(&e,0,0,z-p0a.z); + else + MeshP0Offset(&e,x-p0a.x,y-p0a.y,z-p0a.z); + p0a.x=x; + p0a.y=y; + p0a.z=z; + MeshP0Capture(&e); + } + break; + case '1': + MeshSwapAxes(&e,offset(CD3I32.x),offset(CD3I32.y)); + break; + case '2': + MeshSwapAxes(&e,offset(CD3I32.x),offset(CD3I32.z)); + break; + case '3': + MeshSwapAxes(&e,offset(CD3I32.y),offset(CD3I32.z)); + break; + case '4': + MeshInvertAxis(&e,offset(CD3I32.x)); + break; + case '5': + MeshInvertAxis(&e,offset(CD3I32.y)); + break; + case '6': + MeshInvertAxis(&e,offset(CD3I32.z)); + break; + case 'r': + if (e.cur_tri) + SwapI64(&e.cur_tri->t[1],&e.cur_tri->t[2]); + break; + case 'C': + MeshColorTris(&e); + break; + case 'R': + MeshRevTris(&e); + break; + } + break; + case MSG_IP_L_DOWN: + switch (e.ed_mode) { + case 'm': + if (!moving) { + if (!MeshSelCnt(&e) && + (tempv=MeshVertexFindScrPt(&e,a1,a2))) { + tempv->flags|=VF_SEL; + e.ip_z=RoundI64(tempv->p.z,e.cur_snap); + } + if (MeshSelCnt(&e)) { + MeshCursorW(&e,Fs,&x,&y,&z); + p0a.x=x; + p0a.y=y; + p0a.z=z; + MeshP0Capture(&e); + moving=TRUE; + } + } + break; + case 'M': + if (!adjusting_z && !moving) { + if (!MeshSelCnt(&e) && + (tempv=MeshVertexFindScrPt(&e,a1,a2))) { + tempv->flags|=VF_SEL; + e.ip_z=RoundI64(tempv->p.z,e.cur_snap); + } + if (MeshSelCnt(&e)) { + MeshCursorW(&e,Fs,&x,&y,&z); + p0a.x=x; + p0a.y=y; + p0a.z=z; + MeshP0Capture(&e); + moving=TRUE; + + p0b.x=ip.presnap.x; + p0b.y=ip.presnap.y; + p0b.z=e.ip_z; + adjusting_z=TRUE; + Snd(ClampI64(3*e.ip_z+1500,0,15000)); + } + } + break; + } + break; + case MSG_IP_L_UP: + switch (e.ed_mode) { + case 'n': + case 'f': + case 'p': + case 'v': + Noise(25,2000,8000); + MeshCursorW(&e,Fs,&x,&y,&z); + e.cur_vertex=MeshVertexNew(&e,x,y,z); + break; + case 'm': + case 'M': + if (moving) { + if (adjusting_z) { + e.ip_z=RoundI64(Sign(p0b.y-ip.presnap.y) + *Sqrt(Sqr(p0b.x-ip.presnap.x)+Sqr(p0b.y-ip.presnap.y)) + +p0b.z,e.cur_snap); + Snd(0); + adjusting_z=FALSE; + MeshCursorW(&e,Fs,&x,&y,&z); + MeshP0Offset(&e,0,0,z-p0a.z); + } else { + MeshCursorW(&e,Fs,&x,&y,&z); + MeshP0Offset(&e,x-p0a.x,y-p0a.y,z-p0a.z); + } + MeshTriSelAll(&e,FALSE); + MeshVertexSelAll(&e,FALSE); + moving=FALSE; + } + break; + case 't': + if (tempv=MeshVertexFindScrPt(&e,a1,a2)) { + for (i=0;iflags|=VF_SEL; + if (make_tri_vertex_num==3) { + e.cur_tri=MeshTriNew(&e,e.cur_color,va[0],va[1],va[2]); + for (i=0;iflags&=~VF_SEL; + make_tri_vertex_num=0; + } + } + } + break; + } + break; + case MSG_IP_R_DOWN: + if (!adjusting_z && e.ed_mode!='M' && + (e.chain_pred==e.vertex_head.last || + e.ed_mode!='n' && e.ed_mode!='f' && e.ed_mode!='p')) { + if (moving) { + MeshCursorW(&e,Fs,&x,&y,&z); + MeshP0Offset(&e,x-p0a.x,y-p0a.y,z-p0a.z); + p0a.x=x; + p0a.y=y; + p0a.z=z; + MeshP0Capture(&e); + } + p0b.x=ip.presnap.x; + p0b.y=ip.presnap.y; + p0b.z=e.ip_z; + adjusting_z=TRUE; + Snd(ClampI64(3*e.ip_z+1500,0,15000)); + } + break; + case MSG_IP_R_UP: + if (adjusting_z) { + e.ip_z=RoundI64(Sign(p0b.y-ip.presnap.y) + *Sqrt(Sqr(p0b.x-ip.presnap.x)+Sqr(p0b.y-ip.presnap.y)) + +p0b.z,e.cur_snap); + Snd(0); + adjusting_z=FALSE; + if (moving) { + MeshCursorW(&e,Fs,&x,&y,&z); + MeshP0Offset(&e,0,0,z-p0a.z); + p0a.x=x; + p0a.y=y; + p0a.z=z; + MeshP0Capture(&e); + } + } else if (e.ed_mode=='n') { + if (e.chain_pred && e.chain_pred!=e.vertex_head.last) + MeshPolygon(&e,e.chain_pred->next,e.vertex_head.last,FALSE); + a1=e.ed_mode; + goto me_chain; + } else if (e.ed_mode=='f') { + if (e.chain_pred && e.chain_pred!=e.vertex_head.last) + MeshFence(&e); + a1=e.ed_mode; + goto me_chain; + } else if (e.ed_mode=='p') { + if (e.chain_pred && e.chain_pred!=e.vertex_head.last) + MeshPrism(&e); + a1=e.ed_mode; + goto me_chain; + } + break; + case MSG_IP_MOVE: + if (adjusting_z) { + e.ip_z=RoundI64(Sign(p0b.y-ip.presnap.y) + *Sqrt(Sqr(p0b.x-ip.presnap.x)+Sqr(p0b.y-ip.presnap.y)) + +p0b.z,e.cur_snap); + Snd(ClampI64(3*e.ip_z+1500,0,15000)); + } + if (moving) { + MeshCursorW(&e,Fs,&x,&y,&z); + if (adjusting_z) + MeshP0Offset(&e,0,0,z-p0a.z); + else + MeshP0Offset(&e,x-p0a.x,y-p0a.y,z-p0a.z); + p0a.x=x; + p0a.y=y; + p0a.z=z; + MeshP0Capture(&e); + } + break; + } + } +me_done: + } catch + Fs->catch_except=TRUE; + SettingsPop; + MenuPop; + if (save_and_exit) + head=MeshSave(&e,_size); + else + head=NULL; + MeshCleanUp(&e); + FramePtrDel("CMeshFrame"); + if (old_s) { + MemCpy(c->state,old_s,sizeof(CViewAngles)); + Free(old_s); + } else + ViewAnglesDel; + return head; +} diff --git a/Adam/Gr/SpriteNew.CPP b/Adam/Gr/SpriteNew.CPP deleted file mode 100644 index edf1f29..0000000 --- a/Adam/Gr/SpriteNew.CPP +++ /dev/null @@ -1,180 +0,0 @@ -#help_index "Graphics/Sprite;Sprites" -#help_file "::/Doc/Sprite" - -U8 polypt_map[9]={0,1,2,3,0,4,5,6,7}; - -I64 sprite_elem_base_sizes[SPT_NUM_TYPES]={ - sizeof(CSpriteBase), //SPT_END - sizeof(CSpriteColor), //SPT_COLOR - sizeof(CSpriteDitherColor), //SPT_DITHER_COLOR - sizeof(CSpriteW), //SPT_WIDTH - sizeof(CSpritePtPt), //SPT_PLANAR_SYMMETRY - sizeof(CSpriteBase), //SPT_TRANSFORM_ON - sizeof(CSpriteBase), //SPT_TRANSFORM_OFF - sizeof(CSpritePt), //SPT_SHIFT - sizeof(CSpritePt), //SPT_PT - sizeof(CSpriteNumPtU8s), //SPT_POLYPT - sizeof(CSpritePtPt), //SPT_LINE - sizeof(CSpriteNumU8s), //SPT_POLYLINE - sizeof(CSpritePtPt), //SPT_RECT - sizeof(CSpritePtPtAng), //SPT_ROTATED_RECT - sizeof(CSpritePtRad), //SPT_CIRCLE - sizeof(CSpritePtWHAng), //SPT_ELLIPSE - sizeof(CSpritePtWHAngSides), //SPT_POLYGON - sizeof(CSpriteNumU8s), //SPT_BSPLINE2 - sizeof(CSpriteNumU8s), //SPT_BSPLINE2_CLOSED - sizeof(CSpriteNumU8s), //SPT_BSPLINE3 - sizeof(CSpriteNumU8s), //SPT_BSPLINE3_CLOSED - sizeof(CSpritePt), //SPT_FLOOD_FILL - sizeof(CSpritePt), //SPT_FLOOD_FILL_NOT - sizeof(CSpritePtWHU8s), //SPT_BITMAP - sizeof(CSpriteMeshU8s), //SPT_MESH - sizeof(CSpritePtMeshU8s), //SPT_SHIFTABLE_MESH - sizeof(CSpritePtPt), //SPT_ARROW - sizeof(CSpritePtStr), //SPT_TEXT - sizeof(CSpritePtStr), //SPT_TEXT_BOX - sizeof(CSpritePtStr), //SPT_TEXT_DIAMOND -}; - -I64 SpriteElemQuedBaseSize(I64 type) -{ - return sprite_elem_base_sizes[type]+offset(CSprite.start); -} - -I64 SpriteElemSize(CSprite *tempg) -{ - I64 i=sprite_elem_base_sizes[tempg->type]; - switch (tempg->type) { - case SPT_POLYLINE: - i+=tempg->nu.num*sizeof(CD2I32); - break; - case SPT_TEXT: - case SPT_TEXT_BOX: - case SPT_TEXT_DIAMOND: - i+=StrLen(tempg->ps.st)+1; - break; - case SPT_BITMAP: - i+=((tempg->pwhu.width+7)&~7)*tempg->pwhu.height; - break; - case SPT_POLYPT: - i+=(tempg->npu.num*3+7)>>3; - break; - case SPT_BSPLINE2: - case SPT_BSPLINE3: - case SPT_BSPLINE2_CLOSED: - case SPT_BSPLINE3_CLOSED: - i+=tempg->nu.num*sizeof(CD3I32); - break; - case SPT_MESH: - i+=tempg->mu.vertex_cnt*sizeof(CD3I32)+ - tempg->mu.tri_cnt*sizeof(CMeshTri); - break; - case SPT_SHIFTABLE_MESH: - i+=tempg->pmu.vertex_cnt*sizeof(CD3I32)+ - tempg->pmu.tri_cnt*sizeof(CMeshTri); - break; - } - return i; -} - -public I64 SpriteSize(U8 *elems) -{//Walk sprite elements and return size of sprite as binary data. - CSprite *tempg=elems-offset(CSprite.start),*tempg1=tempg; - while (tempg->type) - tempg(U8 *)+=SpriteElemSize(tempg); - return tempg(U8 *)-tempg1(U8 *)+sprite_elem_base_sizes[SPT_END]; -} - -I64 SpriteTypeMask(U8 *elems) -{ - I64 res=0; - CSprite *tempg=elems-offset(CSprite.start); - while (tempg->type) { - if (tempg->type>=SPT_NUM_TYPES) - return 1<type); - tempg(U8 *)+=SpriteElemSize(tempg); - } - return res; -} - -public U8 *DC2Sprite(CDC *tempb) -{//Convert device context to sprite. - CSprite *tempg; - tempg=CAlloc(sprite_elem_base_sizes[SPT_BITMAP]+ - tempb->width_internal*tempb->height+ - sprite_elem_base_sizes[SPT_END]) - (U8 *)-offset(CSprite.start); - tempg->type=SPT_BITMAP; - tempg->pwhu.width=tempb->width; - tempg->pwhu.height=tempb->height; - tempg->pwhu.x1=0; - tempg->pwhu.y1=0; - MemCpy(&tempg->pwhu.u,tempb->body,tempb->width_internal*tempb->height); - return tempg(U8 *)+offset(CSprite.start); -} - -public U8 *SpriteElem2Summary(CSprite *tempg) -{//Study $LK,"::/Demo/Graphics/SpriteText.CPP"$. - U8 buf[STR_LEN],buf2[STR_LEN]; - I32 *ptr; - StrPrint(buf,"%Z",tempg->type,"ST_SPRITE_ELEM_TYPES"); - switch (tempg->type) { - case SPT_COLOR: - CatPrint(buf," %s",Color2Str(buf2,tempg->c.color)); - break; - case SPT_DITHER_COLOR: - CatPrint(buf," %s",Color2Str(buf2,ROPF_DITHER|tempg->d.dither_color.u8[0]| - tempg->d.dither_color.u8[1]<p.x1,tempg->p.y1); - break; - case SPT_LINE: - case SPT_ARROW: - case SPT_PLANAR_SYMMETRY: - case SPT_RECT: - case SPT_ROTATED_RECT: - CatPrint(buf," (%d,%d),(%d,%d)",tempg->pp.x1,tempg->pp.y1, - tempg->pp.x2,tempg->pp.y2); - break; - case SPT_CIRCLE: - CatPrint(buf," (%d,%d):%dR",tempg->pr.x1,tempg->pr.y1,tempg->pr.radius); - break; - case SPT_WIDTH: - CatPrint(buf," %d",tempg->w.width); - break; - case SPT_TEXT: - case SPT_TEXT_BOX: - case SPT_TEXT_DIAMOND: - CatPrint(buf," %d,%d:%-16tQ",tempg->ps.x1,tempg->ps.y1,tempg->ps.st); - break; - case SPT_POLYLINE: - case SPT_POLYPT: - ptr=&tempg->npu.x; - CatPrint(buf," %d (%d,%d)",tempg->npu.num,ptr[0],ptr[1]); - break; - case SPT_ELLIPSE: - case SPT_POLYGON: - case SPT_BITMAP: - CatPrint(buf," (%d,%d):%dW,%dH",tempg->pwhu.x1,tempg->pwhu.y1, - tempg->pwhu.width,tempg->pwhu.height); - break; - case SPT_BSPLINE2: - case SPT_BSPLINE3: - case SPT_BSPLINE2_CLOSED: - case SPT_BSPLINE3_CLOSED: - CatPrint(buf," %d",tempg->nu.num); - break; - case SPT_MESH: - CatPrint(buf," %dV,%dT",tempg->mu.vertex_cnt,tempg->mu.tri_cnt); - break; - case SPT_SHIFTABLE_MESH: - CatPrint(buf," %dV,%dT",tempg->pmu.vertex_cnt,tempg->pmu.tri_cnt); - break; - } - return StrNew(buf); -} diff --git a/Adam/Gr/SpriteNew.HC b/Adam/Gr/SpriteNew.HC new file mode 100644 index 0000000..fe8413e --- /dev/null +++ b/Adam/Gr/SpriteNew.HC @@ -0,0 +1,180 @@ +#help_index "Graphics/Sprite;Sprites" +#help_file "::/Doc/Sprite" + +U8 polypt_map[9]={0,1,2,3,0,4,5,6,7}; + +I64 sprite_elem_base_sizes[SPT_NUM_TYPES]={ + sizeof(CSpriteBase), //SPT_END + sizeof(CSpriteColor), //SPT_COLOR + sizeof(CSpriteDitherColor), //SPT_DITHER_COLOR + sizeof(CSpriteW), //SPT_WIDTH + sizeof(CSpritePtPt), //SPT_PLANAR_SYMMETRY + sizeof(CSpriteBase), //SPT_TRANSFORM_ON + sizeof(CSpriteBase), //SPT_TRANSFORM_OFF + sizeof(CSpritePt), //SPT_SHIFT + sizeof(CSpritePt), //SPT_PT + sizeof(CSpriteNumPtU8s), //SPT_POLYPT + sizeof(CSpritePtPt), //SPT_LINE + sizeof(CSpriteNumU8s), //SPT_POLYLINE + sizeof(CSpritePtPt), //SPT_RECT + sizeof(CSpritePtPtAng), //SPT_ROTATED_RECT + sizeof(CSpritePtRad), //SPT_CIRCLE + sizeof(CSpritePtWHAng), //SPT_ELLIPSE + sizeof(CSpritePtWHAngSides), //SPT_POLYGON + sizeof(CSpriteNumU8s), //SPT_BSPLINE2 + sizeof(CSpriteNumU8s), //SPT_BSPLINE2_CLOSED + sizeof(CSpriteNumU8s), //SPT_BSPLINE3 + sizeof(CSpriteNumU8s), //SPT_BSPLINE3_CLOSED + sizeof(CSpritePt), //SPT_FLOOD_FILL + sizeof(CSpritePt), //SPT_FLOOD_FILL_NOT + sizeof(CSpritePtWHU8s), //SPT_BITMAP + sizeof(CSpriteMeshU8s), //SPT_MESH + sizeof(CSpritePtMeshU8s), //SPT_SHIFTABLE_MESH + sizeof(CSpritePtPt), //SPT_ARROW + sizeof(CSpritePtStr), //SPT_TEXT + sizeof(CSpritePtStr), //SPT_TEXT_BOX + sizeof(CSpritePtStr), //SPT_TEXT_DIAMOND +}; + +I64 SpriteElemQuedBaseSize(I64 type) +{ + return sprite_elem_base_sizes[type]+offset(CSprite.start); +} + +I64 SpriteElemSize(CSprite *tempg) +{ + I64 i=sprite_elem_base_sizes[tempg->type]; + switch (tempg->type) { + case SPT_POLYLINE: + i+=tempg->nu.num*sizeof(CD2I32); + break; + case SPT_TEXT: + case SPT_TEXT_BOX: + case SPT_TEXT_DIAMOND: + i+=StrLen(tempg->ps.st)+1; + break; + case SPT_BITMAP: + i+=((tempg->pwhu.width+7)&~7)*tempg->pwhu.height; + break; + case SPT_POLYPT: + i+=(tempg->npu.num*3+7)>>3; + break; + case SPT_BSPLINE2: + case SPT_BSPLINE3: + case SPT_BSPLINE2_CLOSED: + case SPT_BSPLINE3_CLOSED: + i+=tempg->nu.num*sizeof(CD3I32); + break; + case SPT_MESH: + i+=tempg->mu.vertex_cnt*sizeof(CD3I32)+ + tempg->mu.tri_cnt*sizeof(CMeshTri); + break; + case SPT_SHIFTABLE_MESH: + i+=tempg->pmu.vertex_cnt*sizeof(CD3I32)+ + tempg->pmu.tri_cnt*sizeof(CMeshTri); + break; + } + return i; +} + +public I64 SpriteSize(U8 *elems) +{//Walk sprite elements and return size of sprite as binary data. + CSprite *tempg=elems-offset(CSprite.start),*tempg1=tempg; + while (tempg->type) + tempg(U8 *)+=SpriteElemSize(tempg); + return tempg(U8 *)-tempg1(U8 *)+sprite_elem_base_sizes[SPT_END]; +} + +I64 SpriteTypeMask(U8 *elems) +{ + I64 res=0; + CSprite *tempg=elems-offset(CSprite.start); + while (tempg->type) { + if (tempg->type>=SPT_NUM_TYPES) + return 1<type); + tempg(U8 *)+=SpriteElemSize(tempg); + } + return res; +} + +public U8 *DC2Sprite(CDC *tempb) +{//Convert device context to sprite. + CSprite *tempg; + tempg=CAlloc(sprite_elem_base_sizes[SPT_BITMAP]+ + tempb->width_internal*tempb->height+ + sprite_elem_base_sizes[SPT_END]) + (U8 *)-offset(CSprite.start); + tempg->type=SPT_BITMAP; + tempg->pwhu.width=tempb->width; + tempg->pwhu.height=tempb->height; + tempg->pwhu.x1=0; + tempg->pwhu.y1=0; + MemCpy(&tempg->pwhu.u,tempb->body,tempb->width_internal*tempb->height); + return tempg(U8 *)+offset(CSprite.start); +} + +public U8 *SpriteElem2Summary(CSprite *tempg) +{//Study $LK,"::/Demo/Graphics/SpriteText.HC"$. + U8 buf[STR_LEN],buf2[STR_LEN]; + I32 *ptr; + StrPrint(buf,"%Z",tempg->type,"ST_SPRITE_ELEM_TYPES"); + switch (tempg->type) { + case SPT_COLOR: + CatPrint(buf," %s",Color2Str(buf2,tempg->c.color)); + break; + case SPT_DITHER_COLOR: + CatPrint(buf," %s",Color2Str(buf2,ROPF_DITHER|tempg->d.dither_color.u8[0]| + tempg->d.dither_color.u8[1]<p.x1,tempg->p.y1); + break; + case SPT_LINE: + case SPT_ARROW: + case SPT_PLANAR_SYMMETRY: + case SPT_RECT: + case SPT_ROTATED_RECT: + CatPrint(buf," (%d,%d),(%d,%d)",tempg->pp.x1,tempg->pp.y1, + tempg->pp.x2,tempg->pp.y2); + break; + case SPT_CIRCLE: + CatPrint(buf," (%d,%d):%dR",tempg->pr.x1,tempg->pr.y1,tempg->pr.radius); + break; + case SPT_WIDTH: + CatPrint(buf," %d",tempg->w.width); + break; + case SPT_TEXT: + case SPT_TEXT_BOX: + case SPT_TEXT_DIAMOND: + CatPrint(buf," %d,%d:%-16tQ",tempg->ps.x1,tempg->ps.y1,tempg->ps.st); + break; + case SPT_POLYLINE: + case SPT_POLYPT: + ptr=&tempg->npu.x; + CatPrint(buf," %d (%d,%d)",tempg->npu.num,ptr[0],ptr[1]); + break; + case SPT_ELLIPSE: + case SPT_POLYGON: + case SPT_BITMAP: + CatPrint(buf," (%d,%d):%dW,%dH",tempg->pwhu.x1,tempg->pwhu.y1, + tempg->pwhu.width,tempg->pwhu.height); + break; + case SPT_BSPLINE2: + case SPT_BSPLINE3: + case SPT_BSPLINE2_CLOSED: + case SPT_BSPLINE3_CLOSED: + CatPrint(buf," %d",tempg->nu.num); + break; + case SPT_MESH: + CatPrint(buf," %dV,%dT",tempg->mu.vertex_cnt,tempg->mu.tri_cnt); + break; + case SPT_SHIFTABLE_MESH: + CatPrint(buf," %dV,%dT",tempg->pmu.vertex_cnt,tempg->pmu.tri_cnt); + break; + } + return StrNew(buf); +} diff --git a/Adam/MakeAdam.CPP b/Adam/MakeAdam.HC similarity index 100% rename from Adam/MakeAdam.CPP rename to Adam/MakeAdam.HC diff --git a/Adam/Menu.CPP b/Adam/Menu.HC similarity index 100% rename from Adam/Menu.CPP rename to Adam/Menu.HC diff --git a/Adam/Opt/Boot/BootDVD.CPP b/Adam/Opt/Boot/BootDVD.CPP deleted file mode 100644 index 1427256..0000000 --- a/Adam/Opt/Boot/BootDVD.CPP +++ /dev/null @@ -1,188 +0,0 @@ -#define BOOT_HIGH_LOC_DVD ((BOOT_RAM_LIMIT-\ - (BOOT_STK_SIZE+DVD_BOOT_LOADER_SIZE))>>4) - -DefinePrint( - "DD_BOOT_HIGH_LOC_DVD","%08X",BOOT_HIGH_LOC_DVD<<4); -DefinePrint( - "DD_BOOT_HIGH_LOC_DVD_END","%08X",BOOT_RAM_LIMIT-1); - -asm { -USE16 -BDVD_START:: -//DL is supposed to have the BIOS drive number - CLD - MOV AX,BOOT_HIGH_LOC_DVD - MOV ES,AX - - CLI - MOV SS,AX - MOV SP,BOOT_STK_SIZE+DVD_BOOT_LOADER_SIZE - STI - - CALL BDVD_GET_IP -BDVD_GET_IP: - POP BX - SUB BX,BDVD_GET_IP-BDVD_START - SHR BX,4 -//This copies this bootloader's code to 0x$TX,"00096600",D="DD_BOOT_HIGH_LOC_DVD"$ - MOV AX,CS - ADD AX,BX - MOV DS,AX - MOV CX,DVD_BOOT_LOADER_SIZE - XOR SI,SI - XOR DI,DI - REP_MOVSB - - MOV AX,BOOT_HIGH_LOC_DVD - MOV DS,AX - -//My assembler doesn't support 16-bit very well. - DU8 0xEA; //JMP BOOT_HIGH_LOC_DVD:BDVD_MAIN - DU16 BDVD_MAIN-BDVD_START,BOOT_HIGH_LOC_DVD; - -BDVD_BIOS_DRV_NUM: DU8 0; -BDVD_PAGE: DU8 0; - -BDVD_DAP: DU8 16,0,1,0; //One blk at a time -BDVD_DAP_BUF: DU16 0,0; -BDVD_DAP_BLK: DU64 0; - -BDVD_TEMPLEOS_MSG: - DU8 "Loading TempleOS",0; - -BDVD_NOT64_MSG: - DU8 "TempleOS requires a 64-bit capable processor.\n\r",0; - -//These get patched. -BDVD_BLK_LO:: DU16 0; -BDVD_BLK_HI:: DU16 0; -BDVD_BLK_CNT:: DU16 0; -BDVD_SHIFT_BLKS:: DU16 0; -BDVD_PROGRESS_STEP:: DU32 0; -BDVD_PROGRESS_VAL:: DU32 0; - -BDVD_PUT_CHAR:: - MOV AH,0xE - MOV BL,7 //Might be foreground color on some BIOS's - MOV BH,U8 [BDVD_PAGE-BDVD_START] - INT 0x10 -BDVD_RET:: - RET -BDVD_PUTS:: -@@1: LODSB - TEST AL,AL - JZ BDVD_RET - CALL BDVD_PUT_CHAR - JMP @@1 - -BDVD_MAIN:: - MOV U8 [BDVD_BIOS_DRV_NUM-BDVD_START],DL //Passed in by BIOS - - MOV AH,0xF - INT 0x10 - MOV U8 [BDVD_PAGE-BDVD_START],BH //Video page - - MOV EAX,0x80000000 - CPUID - CMP EAX,0x80000001 - JB @@05 - - MOV EAX,0x80000001 - CPUID - BT EDX,29 - JC @@15 -@@05: MOV SI,BDVD_NOT64_MSG-BDVD_START - CALL BDVD_PUTS -@@10: JMP @@10 - -@@15: MOV SI,BDVD_TEMPLEOS_MSG-BDVD_START - CALL BDVD_PUTS - - MOV AX,BOOT_RAM_BASE/16 - MOV ES,AX - XOR ECX,ECX - MOV CX,U16 [BDVD_BLK_CNT-BDVD_START] - - MOV EAX,(80-7-9)*65536 //80 columns - XOR EDX,EDX - DIV ECX - MOV U32 [BDVD_PROGRESS_STEP-BDVD_START],EAX - MOV U32 [BDVD_PROGRESS_VAL-BDVD_START],0 - - MOV AX,U16 [BDVD_BLK_LO-BDVD_START] - MOV DX,U16 [BDVD_BLK_HI-BDVD_START] - -@@20: PUSH CX //Blk cnt - -//READ BLK - PUSH AX //Blk lo - PUSH DX //Blk hi - PUSH ES //Buf seg - MOV U16 [BDVD_DAP_BLK-BDVD_START],AX - MOV U16 [BDVD_DAP_BLK+2-BDVD_START],DX - MOV AX,ES - MOV U16 [BDVD_DAP_BUF+2-BDVD_START],AX //ES:0000 - MOV SI,BDVD_DAP-BDVD_START //DS:SI=DAP - MOV AH,0x42 - MOV DL,U8 [BDVD_BIOS_DRV_NUM-BDVD_START] - INT 0x13 - - POP AX //ES - ADD AX,DVD_BLK_SIZE/16 - MOV ES,AX - POP DX - POP AX - INC AX - JNZ @@25 - INC DX - -@@25: PUSH AX - MOV BX,U16 [BDVD_PROGRESS_VAL+2-BDVD_START] - MOV EAX,U32 [BDVD_PROGRESS_STEP-BDVD_START] - ADD U32 [BDVD_PROGRESS_VAL-BDVD_START],EAX - CMP U16 [BDVD_PROGRESS_VAL+2-BDVD_START],BX - JE @@30 - MOV AL,'.' - CALL BDVD_PUT_CHAR -@@30: POP AX - - POP CX - 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,"BootDVDProbe",A="MN:BootDVDProbe"$(). - MOV EBX,U32 [BDVD_BLK_LO-BDVD_START] - MOV AX,U16 [BDVD_SHIFT_BLKS-BDVD_START] - 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. - DU8 0xEA; //JMP BOOT_RAM_BASE:0000 - DU16 0,BOOT_RAM_BASE/16; -//Continues here $LK,"::/Kernel/KStart16.CPP",A="FL:::/Kernel/KStart16.CPP,1"$ -BDVD_END:: -#assert BDVD_END-BDVD_START>4) + +DefinePrint( + "DD_BOOT_HIGH_LOC_DVD","%08X",BOOT_HIGH_LOC_DVD<<4); +DefinePrint( + "DD_BOOT_HIGH_LOC_DVD_END","%08X",BOOT_RAM_LIMIT-1); + +asm { +USE16 +BDVD_START:: +//DL is supposed to have the BIOS drive number + CLD + MOV AX,BOOT_HIGH_LOC_DVD + MOV ES,AX + + CLI + MOV SS,AX + MOV SP,BOOT_STK_SIZE+DVD_BOOT_LOADER_SIZE + STI + + CALL BDVD_GET_IP +BDVD_GET_IP: + POP BX + SUB BX,BDVD_GET_IP-BDVD_START + SHR BX,4 +//This copies this bootloader's code to 0x$TX,"00096600",D="DD_BOOT_HIGH_LOC_DVD"$ + MOV AX,CS + ADD AX,BX + MOV DS,AX + MOV CX,DVD_BOOT_LOADER_SIZE + XOR SI,SI + XOR DI,DI + REP_MOVSB + + MOV AX,BOOT_HIGH_LOC_DVD + MOV DS,AX + +//My assembler doesn't support 16-bit very well. + DU8 0xEA; //JMP BOOT_HIGH_LOC_DVD:BDVD_MAIN + DU16 BDVD_MAIN-BDVD_START,BOOT_HIGH_LOC_DVD; + +BDVD_BIOS_DRV_NUM: DU8 0; +BDVD_PAGE: DU8 0; + +BDVD_DAP: DU8 16,0,1,0; //One blk at a time +BDVD_DAP_BUF: DU16 0,0; +BDVD_DAP_BLK: DU64 0; + +BDVD_TEMPLEOS_MSG: + DU8 "Loading TempleOS",0; + +BDVD_NOT64_MSG: + DU8 "TempleOS requires a 64-bit capable processor.\n\r",0; + +//These get patched. +BDVD_BLK_LO:: DU16 0; +BDVD_BLK_HI:: DU16 0; +BDVD_BLK_CNT:: DU16 0; +BDVD_SHIFT_BLKS:: DU16 0; +BDVD_PROGRESS_STEP:: DU32 0; +BDVD_PROGRESS_VAL:: DU32 0; + +BDVD_PUT_CHAR:: + MOV AH,0xE + MOV BL,7 //Might be foreground color on some BIOS's + MOV BH,U8 [BDVD_PAGE-BDVD_START] + INT 0x10 +BDVD_RET:: + RET +BDVD_PUTS:: +@@1: LODSB + TEST AL,AL + JZ BDVD_RET + CALL BDVD_PUT_CHAR + JMP @@1 + +BDVD_MAIN:: + MOV U8 [BDVD_BIOS_DRV_NUM-BDVD_START],DL //Passed in by BIOS + + MOV AH,0xF + INT 0x10 + MOV U8 [BDVD_PAGE-BDVD_START],BH //Video page + + MOV EAX,0x80000000 + CPUID + CMP EAX,0x80000001 + JB @@05 + + MOV EAX,0x80000001 + CPUID + BT EDX,29 + JC @@15 +@@05: MOV SI,BDVD_NOT64_MSG-BDVD_START + CALL BDVD_PUTS +@@10: JMP @@10 + +@@15: MOV SI,BDVD_TEMPLEOS_MSG-BDVD_START + CALL BDVD_PUTS + + MOV AX,BOOT_RAM_BASE/16 + MOV ES,AX + XOR ECX,ECX + MOV CX,U16 [BDVD_BLK_CNT-BDVD_START] + + MOV EAX,(80-7-9)*65536 //80 columns + XOR EDX,EDX + DIV ECX + MOV U32 [BDVD_PROGRESS_STEP-BDVD_START],EAX + MOV U32 [BDVD_PROGRESS_VAL-BDVD_START],0 + + MOV AX,U16 [BDVD_BLK_LO-BDVD_START] + MOV DX,U16 [BDVD_BLK_HI-BDVD_START] + +@@20: PUSH CX //Blk cnt + +//READ BLK + PUSH AX //Blk lo + PUSH DX //Blk hi + PUSH ES //Buf seg + MOV U16 [BDVD_DAP_BLK-BDVD_START],AX + MOV U16 [BDVD_DAP_BLK+2-BDVD_START],DX + MOV AX,ES + MOV U16 [BDVD_DAP_BUF+2-BDVD_START],AX //ES:0000 + MOV SI,BDVD_DAP-BDVD_START //DS:SI=DAP + MOV AH,0x42 + MOV DL,U8 [BDVD_BIOS_DRV_NUM-BDVD_START] + INT 0x13 + + POP AX //ES + ADD AX,DVD_BLK_SIZE/16 + MOV ES,AX + POP DX + POP AX + INC AX + JNZ @@25 + INC DX + +@@25: PUSH AX + MOV BX,U16 [BDVD_PROGRESS_VAL+2-BDVD_START] + MOV EAX,U32 [BDVD_PROGRESS_STEP-BDVD_START] + ADD U32 [BDVD_PROGRESS_VAL-BDVD_START],EAX + CMP U16 [BDVD_PROGRESS_VAL+2-BDVD_START],BX + JE @@30 + MOV AL,'.' + CALL BDVD_PUT_CHAR +@@30: POP AX + + POP CX + 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,"BootDVDProbe",A="MN:BootDVDProbe"$(). + MOV EBX,U32 [BDVD_BLK_LO-BDVD_START] + MOV AX,U16 [BDVD_SHIFT_BLKS-BDVD_START] + 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. + DU8 0xEA; //JMP BOOT_RAM_BASE:0000 + DU16 0,BOOT_RAM_BASE/16; +//Continues here $LK,"::/Kernel/KStart16.HC",A="FL:::/Kernel/KStart16.HC,1"$ +BDVD_END:: +#assert BDVD_END-BDVD_START>4) - -DefinePrint( - "DD_BOOT_HIGH_LOC_HD","%08X",BOOT_HIGH_LOC_HD<<4); - -asm { -USE16 -BHD_CODE:: - -#define BHD_START (BHD_CODE-offset(CFAT32Boot.code)) - - CLD - - MOV AX,BOOT_HIGH_LOC_HD - MOV ES,AX - - CLI - MOV SS,AX - MOV SP,BOOT_STK_SIZE+MODULE_SIZE - STI - - CALL BHD_GET_IP -BHD_GET_IP: - POP BX - SUB BX,BHD_GET_IP-BHD_START - SHR BX,4 -//This copies this bootloader's code to 0x$TX,"00096C00",D="DD_BOOT_HIGH_LOC_HD"$ - MOV AX,CS - ADD AX,BX - MOV DS,AX - MOV CX,MODULE_SIZE - XOR SI,SI - XOR DI,DI - REP_MOVSB - - MOV AX,BOOT_HIGH_LOC_HD - MOV DS,AX - -//My assembler doesn't support 16-bit very well. - DU8 0xEA; //JMP BOOT_HIGH_LOC_HD:BHD_HISTART - DU16 BHD_HISTART-BHD_START,BOOT_HIGH_LOC_HD; - -BHD_BIOS_DRV_NUM: DU8 0; - -//Gets patched by $LK,"BootHDIns",A="MN:BootHDIns"$(). -BHD_BLK_CNT:: DU16 0; - -BHD_DAP: DU8 16,0,1,0; //One blk at a time -BHD_DAP_BUF: DU16 0,0; -//Gets patched by $LK,"BootHDIns",A="MN:BootHDIns"$(). -BHD_DAP_BLK:: //64-bit -BHD_DAP_BLK_LO: DU32 0; -BHD_DAP_BLK_HI: DU32 0; - -BHD_HISTART: - MOV U8 [BHD_BIOS_DRV_NUM-BHD_START],DL //Passed in by BIOS - MOV AX,BOOT_RAM_BASE/16 - MOV ES,AX - XOR ECX,ECX - MOV CX,U16 [BHD_BLK_CNT-BHD_START] - -@@05: PUSH CX //Blk cnt - -//READ BLK - PUSH ES //Buf seg - MOV AX,ES - MOV U16 [BHD_DAP_BUF+2-BHD_START],AX //ES:0000 - MOV SI,BHD_DAP-BHD_START //DS:SI=DAP - MOV AH,0x42 - MOV DL,U8 [BHD_BIOS_DRV_NUM-BHD_START] - INT 0x13 - - POP AX //ES - ADD AX,BLK_SIZE/16 - MOV ES,AX - INC U32 [BHD_DAP_BLK_LO-BHD_START] - JNZ @@10 - INC U32 [BHD_DAP_BLK_HI-BHD_START] - -@@10: POP CX - LOOP @@05 - - 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. - DU8 0xEA; //JMP BOOT_RAM_BASE:0000 - DU16 0,BOOT_RAM_BASE/16; -//Continues here $LK,"::/Kernel/KStart16.CPP",A="FL:::/Kernel/KStart16.CPP,1"$ -BHD_END:: -#assert BHD_END-BHD_START>4) + +DefinePrint( + "DD_BOOT_HIGH_LOC_HD","%08X",BOOT_HIGH_LOC_HD<<4); + +asm { +USE16 +BHD_CODE:: + +#define BHD_START (BHD_CODE-offset(CFAT32Boot.code)) + + CLD + + MOV AX,BOOT_HIGH_LOC_HD + MOV ES,AX + + CLI + MOV SS,AX + MOV SP,BOOT_STK_SIZE+MODULE_SIZE + STI + + CALL BHD_GET_IP +BHD_GET_IP: + POP BX + SUB BX,BHD_GET_IP-BHD_START + SHR BX,4 +//This copies this bootloader's code to 0x$TX,"00096C00",D="DD_BOOT_HIGH_LOC_HD"$ + MOV AX,CS + ADD AX,BX + MOV DS,AX + MOV CX,MODULE_SIZE + XOR SI,SI + XOR DI,DI + REP_MOVSB + + MOV AX,BOOT_HIGH_LOC_HD + MOV DS,AX + +//My assembler doesn't support 16-bit very well. + DU8 0xEA; //JMP BOOT_HIGH_LOC_HD:BHD_HISTART + DU16 BHD_HISTART-BHD_START,BOOT_HIGH_LOC_HD; + +BHD_BIOS_DRV_NUM: DU8 0; + +//Gets patched by $LK,"BootHDIns",A="MN:BootHDIns"$(). +BHD_BLK_CNT:: DU16 0; + +BHD_DAP: DU8 16,0,1,0; //One blk at a time +BHD_DAP_BUF: DU16 0,0; +//Gets patched by $LK,"BootHDIns",A="MN:BootHDIns"$(). +BHD_DAP_BLK:: //64-bit +BHD_DAP_BLK_LO: DU32 0; +BHD_DAP_BLK_HI: DU32 0; + +BHD_HISTART: + MOV U8 [BHD_BIOS_DRV_NUM-BHD_START],DL //Passed in by BIOS + MOV AX,BOOT_RAM_BASE/16 + MOV ES,AX + XOR ECX,ECX + MOV CX,U16 [BHD_BLK_CNT-BHD_START] + +@@05: PUSH CX //Blk cnt + +//READ BLK + PUSH ES //Buf seg + MOV AX,ES + MOV U16 [BHD_DAP_BUF+2-BHD_START],AX //ES:0000 + MOV SI,BHD_DAP-BHD_START //DS:SI=DAP + MOV AH,0x42 + MOV DL,U8 [BHD_BIOS_DRV_NUM-BHD_START] + INT 0x13 + + POP AX //ES + ADD AX,BLK_SIZE/16 + MOV ES,AX + INC U32 [BHD_DAP_BLK_LO-BHD_START] + JNZ @@10 + INC U32 [BHD_DAP_BLK_HI-BHD_START] + +@@10: POP CX + LOOP @@05 + + 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. + DU8 0xEA; //JMP BOOT_RAM_BASE:0000 + DU16 0,BOOT_RAM_BASE/16; +//Continues here $LK,"::/Kernel/KStart16.HC",A="FL:::/Kernel/KStart16.HC,1"$ +BHD_END:: +#assert BHD_END-BHD_STARTcur_dv; - MakeAll; - switch (Let2BlkDevType(dv->drv_let)) { - case BDT_RAM: - case BDT_ATA: - Move("/Kernel/Kernel.BIN.Z","/" KERNEL_BIN_C); - if (!FileFind("/" KERNEL_BIN_C,&de,FUF_JUST_FILES)) - "No Kernel.BIN.C\n"; - else { - Free(de.full_name); - "Modifying partition boot record.\n"; - RBlks(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); - for (i=0;i=BHD_END-BHD_CODE - for (;idrv_offset,1); - } - break; - default: - throw; - } - } catch { - PutExcept; - Beep; - } -} diff --git a/Adam/Opt/Boot/BootHDIns.HC b/Adam/Opt/Boot/BootHDIns.HC new file mode 100644 index 0000000..6e7248e --- /dev/null +++ b/Adam/Opt/Boot/BootHDIns.HC @@ -0,0 +1,60 @@ +//See $LK,"Install Documentation",A="FI:::/Doc/Install.DD"$ or $LK,"Upgrading Documentation",A="FI:::/Doc/Upgrade.DD"$. +//Study my account examples: $LK,"Cfg Strs",A="FL:::/Demo/AcctExample/TOSCfg.HC,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOSDistro.HC,1"$ + +#include "BootHD" + +#help_index "Install" + +#define KERNEL_BIN_C "Kernel.BIN.C" + +U0 MakeAll() +{ + if (Cmp("/Compiler/Compiler","Compiler",,':')) + throw; + if (Cmp("/Kernel/Kernel","Kernel",,':')) + throw; +} + +public U0 BootHDIns(U8 drv_let=0) +{//$LK,"MakeAll",A="MN:MakeAll"$ and install new boot-loader. + CDrv *dv; + CFAT32Boot br; + CDirEntry de; + I64 i; + try { + if (!Drv(drv_let)) + throw; + dv=Fs->cur_dv; + MakeAll; + switch (Let2BlkDevType(dv->drv_let)) { + case BDT_RAM: + case BDT_ATA: + Move("/Kernel/Kernel.BIN.Z","/" KERNEL_BIN_C); + if (!FileFind("/" KERNEL_BIN_C,&de,FUF_JUST_FILES)) + "No Kernel.BIN.C\n"; + else { + Free(de.full_name); + "Modifying partition boot record.\n"; + RBlks(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); + for (i=0;i=BHD_END-BHD_CODE + for (;idrv_offset,1); + } + break; + default: + throw; + } + } catch { + PutExcept; + Beep; + } +} diff --git a/Adam/Opt/Boot/BootMHD.CPP b/Adam/Opt/Boot/BootMHD.CPP deleted file mode 100644 index 7322da2..0000000 --- a/Adam/Opt/Boot/BootMHD.CPP +++ /dev/null @@ -1,107 +0,0 @@ -#define MODULE_SIZE 1*BLK_SIZE -#define BOOT_HIGH_LOC_MHD ((BOOT_RAM_LIMIT-\ - (BOOT_STK_SIZE+MODULE_SIZE))>>4) - -DefinePrint( - "DD_BOOT_HIGH_LOC_MHD","%08X",BOOT_HIGH_LOC_MHD<<4); - -asm { -USE16 -BMHD_START:: -BMHD_CODE:: - CLD - - MOV AX,BOOT_HIGH_LOC_MHD - - CLI - MOV SS,AX - MOV SP,BOOT_STK_SIZE+MODULE_SIZE - STI - - PUSHFW - PUSH DS - PUSH ES - PUSH FS - PUSH GS - PUSH ECX - PUSH EBX - PUSH EDX - PUSH EBP - - MOV ES,AX - - CALL BMHD_GET_IP -BMHD_GET_IP: - POP BX - SUB BX,BMHD_GET_IP-BMHD_START - MOV CX,BX - SHR BX,4 -//This copies this bootloader's code to 0x$TX,"00096C00",D="DD_BOOT_HIGH_LOC_MHD"$ - MOV AX,CS - PUSH AX - ADD AX,BX - MOV DS,AX - MOV U16 [BMHD_OLD_CS_IP-BMHD_START],CX - POP U16 [BMHD_OLD_CS_IP+2-BMHD_START] - - MOV CX,MODULE_SIZE - XOR SI,SI - XOR DI,DI - REP_MOVSB - - MOV AX,BOOT_HIGH_LOC_MHD - MOV DS,AX - -//My assembler doesn't support 16-bit very well. - DU8 0xEA; //JMP BOOT_HIGH_LOC_MHD:BMHD_HISTART - DU16 BMHD_HISTART-BMHD_START,BOOT_HIGH_LOC_MHD; - -BMHD_BIOS_DRV_NUM: DU8 0; -BMHD_OLD_CS_IP: DU16 0,0; -//Gets patched by $LK,"BootHDIns",A="MN:BootHDIns"$(). -BMHD_BLK_CNT:: DU16 0; - -BMHD_DAP: DU8 16,0,1,0; //One blk at a time -BMHD_DAP_BUF: DU16 0,0; -//Gets patched by $LK,"BootHDIns",A="MN:BootHDIns"$(). -BMHD_DAP_BLK:: //64-bit -BMHD_DAP_BLK_LO: DU32 0; -BMHD_DAP_BLK_HI: DU32 0; - -BMHD_HISTART: - MOV U8 [BMHD_BIOS_DRV_NUM-BMHD_START],DL //Passed in by BIOS - MOV AX,BOOT_RAM_BASE/16 - MOV ES,AX - XOR ECX,ECX - MOV CX,U16 [BMHD_BLK_CNT-BMHD_START] - -@@05: PUSH CX //Blk cnt - -//READ BLK - PUSH ES //Buf seg - MOV AX,ES - MOV U16 [BMHD_DAP_BUF+2-BMHD_START],AX //ES:0000 - MOV SI,BMHD_DAP-BMHD_START //DS:SI=DAP - MOV AH,0x42 - MOV DL,U8 [BMHD_BIOS_DRV_NUM-BMHD_START] - INT 0x13 - - POP AX //ES - ADD AX,BLK_SIZE/16 - MOV ES,AX - INC U32 [BMHD_DAP_BLK_LO-BMHD_START] - JNZ @@10 - INC U32 [BMHD_DAP_BLK_HI-BMHD_START] - -@@10: POP CX - LOOP @@05 - - MOV DL,U8 [BMHD_BIOS_DRV_NUM-BMHD_START] - MOV EBX,U32 [BMHD_OLD_CS_IP-BMHD_START] -//My assembler doesn't support 16-bit very well. - DU8 0xEA; //JMP BOOT_RAM_BASE:0000 - DU16 0,BOOT_RAM_BASE/16; -//Continues here $LK,"BMHD2_START",A="FF:::/Adam/Opt/Boot/BootMHD2.CPP,BMHD2_START"$ -BMHD_END:: -#assert BMHD_END-BMHD_START<=440 -} diff --git a/Adam/Opt/Boot/BootMHD.HC b/Adam/Opt/Boot/BootMHD.HC new file mode 100644 index 0000000..7bc6ba3 --- /dev/null +++ b/Adam/Opt/Boot/BootMHD.HC @@ -0,0 +1,107 @@ +#define MODULE_SIZE 1*BLK_SIZE +#define BOOT_HIGH_LOC_MHD ((BOOT_RAM_LIMIT-\ + (BOOT_STK_SIZE+MODULE_SIZE))>>4) + +DefinePrint( + "DD_BOOT_HIGH_LOC_MHD","%08X",BOOT_HIGH_LOC_MHD<<4); + +asm { +USE16 +BMHD_START:: +BMHD_CODE:: + CLD + + MOV AX,BOOT_HIGH_LOC_MHD + + CLI + MOV SS,AX + MOV SP,BOOT_STK_SIZE+MODULE_SIZE + STI + + PUSHFW + PUSH DS + PUSH ES + PUSH FS + PUSH GS + PUSH ECX + PUSH EBX + PUSH EDX + PUSH EBP + + MOV ES,AX + + CALL BMHD_GET_IP +BMHD_GET_IP: + POP BX + SUB BX,BMHD_GET_IP-BMHD_START + MOV CX,BX + SHR BX,4 +//This copies this bootloader's code to 0x$TX,"00096C00",D="DD_BOOT_HIGH_LOC_MHD"$ + MOV AX,CS + PUSH AX + ADD AX,BX + MOV DS,AX + MOV U16 [BMHD_OLD_CS_IP-BMHD_START],CX + POP U16 [BMHD_OLD_CS_IP+2-BMHD_START] + + MOV CX,MODULE_SIZE + XOR SI,SI + XOR DI,DI + REP_MOVSB + + MOV AX,BOOT_HIGH_LOC_MHD + MOV DS,AX + +//My assembler doesn't support 16-bit very well. + DU8 0xEA; //JMP BOOT_HIGH_LOC_MHD:BMHD_HISTART + DU16 BMHD_HISTART-BMHD_START,BOOT_HIGH_LOC_MHD; + +BMHD_BIOS_DRV_NUM: DU8 0; +BMHD_OLD_CS_IP: DU16 0,0; +//Gets patched by $LK,"BootHDIns",A="MN:BootHDIns"$(). +BMHD_BLK_CNT:: DU16 0; + +BMHD_DAP: DU8 16,0,1,0; //One blk at a time +BMHD_DAP_BUF: DU16 0,0; +//Gets patched by $LK,"BootHDIns",A="MN:BootHDIns"$(). +BMHD_DAP_BLK:: //64-bit +BMHD_DAP_BLK_LO: DU32 0; +BMHD_DAP_BLK_HI: DU32 0; + +BMHD_HISTART: + MOV U8 [BMHD_BIOS_DRV_NUM-BMHD_START],DL //Passed in by BIOS + MOV AX,BOOT_RAM_BASE/16 + MOV ES,AX + XOR ECX,ECX + MOV CX,U16 [BMHD_BLK_CNT-BMHD_START] + +@@05: PUSH CX //Blk cnt + +//READ BLK + PUSH ES //Buf seg + MOV AX,ES + MOV U16 [BMHD_DAP_BUF+2-BMHD_START],AX //ES:0000 + MOV SI,BMHD_DAP-BMHD_START //DS:SI=DAP + MOV AH,0x42 + MOV DL,U8 [BMHD_BIOS_DRV_NUM-BMHD_START] + INT 0x13 + + POP AX //ES + ADD AX,BLK_SIZE/16 + MOV ES,AX + INC U32 [BMHD_DAP_BLK_LO-BMHD_START] + JNZ @@10 + INC U32 [BMHD_DAP_BLK_HI-BMHD_START] + +@@10: POP CX + LOOP @@05 + + MOV DL,U8 [BMHD_BIOS_DRV_NUM-BMHD_START] + MOV EBX,U32 [BMHD_OLD_CS_IP-BMHD_START] +//My assembler doesn't support 16-bit very well. + DU8 0xEA; //JMP BOOT_RAM_BASE:0000 + DU16 0,BOOT_RAM_BASE/16; +//Continues here $LK,"BMHD2_START",A="FF:::/Adam/Opt/Boot/BootMHD2.HC,BMHD2_START"$ +BMHD_END:: +#assert BMHD_END-BMHD_START<=440 +} diff --git a/Adam/Opt/Boot/BootMHD2.CPP b/Adam/Opt/Boot/BootMHD2.CPP deleted file mode 100644 index 3261bdb..0000000 --- a/Adam/Opt/Boot/BootMHD2.CPP +++ /dev/null @@ -1,123 +0,0 @@ -#define MODULE_SIZE 2*BLK_SIZE -#define BOOT_HIGH_LOC_MHD2 ((BOOT_RAM_LIMIT-\ - (BOOT_STK_SIZE+MODULE_SIZE))>>4) - -DefinePrint( - "DD_BOOT_HIGH_LOC_MHD2","%08X",BOOT_HIGH_LOC_MHD2<<4); - -asm { -USE16 -BMHD2_START:: - MOV U32 FS:[0],'B'+0x2000+('2'+0x2000)<<16 - - MOV AX,BOOT_HIGH_LOC_MHD2 - MOV ES,AX -//This copies this bootloader's code to 0x$TX,"00096A00",D="DD_BOOT_HIGH_LOC_MHD2"$ - MOV AX,CS - MOV DS,AX - MOV U32 [BMHD2_OLD_CS_IP-BMHD2_START],EBX - MOV U8 [BMHD2_BIOS_DRV_NUM-BMHD2_START],DL - - MOV CX,MODULE_SIZE - XOR SI,SI - XOR DI,DI - REP_MOVSB - - MOV AX,BOOT_HIGH_LOC_MHD2 - MOV DS,AX - -//My assembler doesn't support 16-bit very well. - DU8 0xEA; //JMP BOOT_HIGH_LOC_MHD2:BMHD2_HISTART - DU16 BMHD2_HISTART-BMHD2_START,BOOT_HIGH_LOC_MHD2; - -BMHD2_BOOT_MSG:: - DU8 256 DUP(0); - -BMHD2_BIOS_DRV_NUM: DU8 0; -BMHD2_PAGE: DU8 0; -BMHD2_BLK_ARRAY:: DU64 8 DUP(0); - -BMHD2_DAP: DU8 16,0,1,0; //One blk at a time -BMHD2_DAP_BUF: DU16 0,0; -BMHD2_DAP_BLK:: //64-bit -BMHD2_DAP_BLK_LO: DU32 0; -BMHD2_DAP_BLK_HI: DU32 0; - -BMHD2_PUT_CHAR:: - MOV AH,0xE - MOV BL,7 //Might be foreground color on some BIOS's - MOV BH,U8 [BMHD2_PAGE-BMHD2_START] - INT 0x10 -BMHD2_RET:: - RET -BMHD2_PUTS:: -@@1: LODSB - TEST AL,AL - JZ BMHD2_RET - CALL BMHD2_PUT_CHAR - JMP @@1 - -BMHD2_GETCHAR: - XOR AH,AH - INT 0x16 - PUSH AX - MOV AH,0x0E - MOV BX,0x07 - INT 0x10 - POP AX - RET - -BMHD2_HISTART: - MOV AH,0xF - INT 0x10 - MOV U8 [BMHD2_PAGE-BMHD2_START],BH //Video page - - MOV U32 FS:[0],0 -@@5: MOV SI,BMHD2_BOOT_MSG-BMHD2_START - CALL BMHD2_PUTS - CALL BMHD2_GETCHAR - CMP AL,'0' - JB @@5 - CMP AL,'8' - JAE @@5 - AND EAX,7 - - MOV EBX,U32 BMHD2_BLK_ARRAY-BMHD2_START[EAX*8] - MOV EAX,U32 BMHD2_BLK_ARRAY+4-BMHD2_START[EAX*8] - - TEST EBX,EBX - JNZ @@10 - TEST EAX,EAX - JZ @@5 - -@@10: MOV U32 [BMHD2_DAP_BLK_LO-BMHD2_START],EBX - MOV U32 [BMHD2_DAP_BLK_HI-BMHD2_START],EAX - - MOV AX,U16 [BMHD2_OLD_CS_IP-BMHD2_START] - SHR AX,4 - ADD AX,U16 [BMHD2_OLD_CS_IP+2-BMHD2_START] - MOV U16 [BMHD2_DAP_BUF+2-BMHD2_START],AX //ES:0000 - MOV SI,BMHD2_DAP-BMHD2_START //DS:SI=DAP - MOV DL,U8 [BMHD2_BIOS_DRV_NUM-BMHD2_START] - MOV AH,0x42 - INT 0x13 - - POP EBP - POP EDX - POP EBX - POP ECX - XOR EAX,EAX - POP GS - POP FS - POP ES - POP DS - POPFW - -//My assembler doesn't support 16-bit very well. - DU8 0xEA; //JMP xxxx:yyyy -BMHD2_OLD_CS_IP: - DU16 0,0; -BMHD2_END:: -//Continues here $LK,"::/Adam/Opt/Boot/BootHD.CPP",A="FF:::/Adam/Opt/Boot/BootHD.CPP,START"$ -#assert BMHD2_END-BMHD2_START>4) + +DefinePrint( + "DD_BOOT_HIGH_LOC_MHD2","%08X",BOOT_HIGH_LOC_MHD2<<4); + +asm { +USE16 +BMHD2_START:: + MOV U32 FS:[0],'B'+0x2000+('2'+0x2000)<<16 + + MOV AX,BOOT_HIGH_LOC_MHD2 + MOV ES,AX +//This copies this bootloader's code to 0x$TX,"00096A00",D="DD_BOOT_HIGH_LOC_MHD2"$ + MOV AX,CS + MOV DS,AX + MOV U32 [BMHD2_OLD_CS_IP-BMHD2_START],EBX + MOV U8 [BMHD2_BIOS_DRV_NUM-BMHD2_START],DL + + MOV CX,MODULE_SIZE + XOR SI,SI + XOR DI,DI + REP_MOVSB + + MOV AX,BOOT_HIGH_LOC_MHD2 + MOV DS,AX + +//My assembler doesn't support 16-bit very well. + DU8 0xEA; //JMP BOOT_HIGH_LOC_MHD2:BMHD2_HISTART + DU16 BMHD2_HISTART-BMHD2_START,BOOT_HIGH_LOC_MHD2; + +BMHD2_BOOT_MSG:: + DU8 256 DUP(0); + +BMHD2_BIOS_DRV_NUM: DU8 0; +BMHD2_PAGE: DU8 0; +BMHD2_BLK_ARRAY:: DU64 8 DUP(0); + +BMHD2_DAP: DU8 16,0,1,0; //One blk at a time +BMHD2_DAP_BUF: DU16 0,0; +BMHD2_DAP_BLK:: //64-bit +BMHD2_DAP_BLK_LO: DU32 0; +BMHD2_DAP_BLK_HI: DU32 0; + +BMHD2_PUT_CHAR:: + MOV AH,0xE + MOV BL,7 //Might be foreground color on some BIOS's + MOV BH,U8 [BMHD2_PAGE-BMHD2_START] + INT 0x10 +BMHD2_RET:: + RET +BMHD2_PUTS:: +@@1: LODSB + TEST AL,AL + JZ BMHD2_RET + CALL BMHD2_PUT_CHAR + JMP @@1 + +BMHD2_GETCHAR: + XOR AH,AH + INT 0x16 + PUSH AX + MOV AH,0x0E + MOV BX,0x07 + INT 0x10 + POP AX + RET + +BMHD2_HISTART: + MOV AH,0xF + INT 0x10 + MOV U8 [BMHD2_PAGE-BMHD2_START],BH //Video page + + MOV U32 FS:[0],0 +@@5: MOV SI,BMHD2_BOOT_MSG-BMHD2_START + CALL BMHD2_PUTS + CALL BMHD2_GETCHAR + CMP AL,'0' + JB @@5 + CMP AL,'8' + JAE @@5 + AND EAX,7 + + MOV EBX,U32 BMHD2_BLK_ARRAY-BMHD2_START[EAX*8] + MOV EAX,U32 BMHD2_BLK_ARRAY+4-BMHD2_START[EAX*8] + + TEST EBX,EBX + JNZ @@10 + TEST EAX,EAX + JZ @@5 + +@@10: MOV U32 [BMHD2_DAP_BLK_LO-BMHD2_START],EBX + MOV U32 [BMHD2_DAP_BLK_HI-BMHD2_START],EAX + + MOV AX,U16 [BMHD2_OLD_CS_IP-BMHD2_START] + SHR AX,4 + ADD AX,U16 [BMHD2_OLD_CS_IP+2-BMHD2_START] + MOV U16 [BMHD2_DAP_BUF+2-BMHD2_START],AX //ES:0000 + MOV SI,BMHD2_DAP-BMHD2_START //DS:SI=DAP + MOV DL,U8 [BMHD2_BIOS_DRV_NUM-BMHD2_START] + MOV AH,0x42 + INT 0x13 + + POP EBP + POP EDX + POP EBX + POP ECX + XOR EAX,EAX + POP GS + POP FS + POP ES + POP DS + POPFW + +//My assembler doesn't support 16-bit very well. + DU8 0xEA; //JMP xxxx:yyyy +BMHD2_OLD_CS_IP: + DU16 0,0; +BMHD2_END:: +//Continues here $LK,"::/Adam/Opt/Boot/BootHD.HC",A="FF:::/Adam/Opt/Boot/BootHD.HC,START"$ +#assert BMHD2_END-BMHD2_STARTcur_dv; - if (dv->fs_type!=FSt_REDSEA && dv->fs_type!=FSt_FAT32) - PrintErr("File System Not Supported\n"); - else { -//Bypass partition bounds-checking - BlkDevLock(bd); - ATAReadBlks(bd,&mbr,0,1); - BlkDevUnlock(bd); - - Drv(dst_drv); - MkDir(BOOT_DIR); - FileWrite(BOOT_DIR_OLDMBR_BIN_C,&mbr,BLK_SIZE); - } -} - -public U0 BootMHDOldWrite(U8 src_drv,U8 dst_drv) -{//Reads OldMBR from src drive BOOT_DIR. -//writes it to the MBR of the drive with dst partition. - CBlkDev *bd=Let2BlkDev(dst_drv); - CMasterBoot *mbr; - Drv(src_drv); - if (mbr=FileRead(BOOT_DIR_OLDMBR_BIN_C)) { -//Bypass partition bounds-checking - BlkDevLock(bd); - ATAWriteBlks(bd,mbr,0,1); - BlkDevUnlock(bd); - } - Free(mbr); -} - -public U0 BootMHDZero(U8 dst_drv) -{//Set MBR of disk with dst partition to zero. - - //This is dangerous!! - //The TempleOS partitioner doesn't play well - //with other operating systems at this time and you need - //to do this on a drive partitioned by TempleOS - //if you wish to partition with another operating system. - CBlkDev *bd=Let2BlkDev(dst_drv); - CMasterBoot mbr; - MemSet(&mbr,0,BLK_SIZE); -//Bypass partition bounds-checking - BlkDevLock(bd); - ATAWriteBlks(bd,&mbr,0,1); - BlkDevUnlock(bd); -} - -public Bool BootMHDIns(U8 drv_let,U8 *drv_lst=NULL) -{//Create new MBR on the disk that has drv_let as a partition. -//Puts stage 2 in BOOT_DIR of drv_let. - CBlkDev *bd,*bd1; - CDrv *dv,*p1; - CMasterBoot mbr; - CDirEntry de; - I64 i,j,size,*_q; - U8 *menu_ptr,*ptr,ch,buf[STR_LEN]; - Bool res=FALSE; - - try { - if (drv_lst) { - StrCpy(buf,drv_lst); - StrUtil(buf,SUF_TO_UPPER); - } else { - j=0; - for (i='A';i<='Z';i++) - buf[j++]=i; - buf[j++]=0; - } - Drv(drv_let); - dv=Fs->cur_dv; - if (dv->fs_type!=FSt_REDSEA && dv->fs_type!=FSt_FAT32) - PrintErr("File System Not Supported\n"); - else { - bd=dv->bd; - if (!FileFind(BOOT_DIR_OLDMBR_BIN_C,,FUF_JUST_FILES)) - BootMHDOldRead(drv_let,drv_let); - - _q=BMHD2_BLK_ARRAY; - MemSet(_q,0,sizeof(I64)*8); - menu_ptr=BMHD2_BOOT_MSG; - StrPrint(menu_ptr,"\n\r\n\rTempleOS Boot Loader\n\r\n\r"); - j=0; - if (FileFind(BOOT_DIR_OLDMBR_BIN_C,&de,FUF_JUST_FILES)) { - Free(de.full_name); - *_q++=Cluster2Blk(dv,de.cluster); - CatPrint(menu_ptr,"0. Old Boot Record\n\r"); - j++; - } - - ptr=buf; - while (ch=*ptr++) { - if ((p1=Let2Drv(ch,FALSE)) && (bd1=p1->bd) && bd1==bd) { - *_q=p1->drv_offset; - "Drive %C:%16X\n",Drv2Let(p1),*_q; - CatPrint(menu_ptr,"%d. Drive %C\n\r",j++,Drv2Let(p1)); - _q++; - } - } - CatPrint(menu_ptr,"\n\rSellection:"); - - size=BMHD2_END-BMHD2_START; - FileWrite(BOOT_DIR_BOOTMHD2_BIN_C,BMHD2_START,size); - - if (!FileFind(BOOT_DIR_BOOTMHD2_BIN_C,&de,FUF_JUST_FILES)) - "No Boot Loader Image\n"; - else { - Free(de.full_name); - *BMHD_BLK_CNT(U16 *)=(size+BLK_SIZE-1)>>BLK_SIZE_BITS; - *BMHD_DAP_BLK(I64 *)=Cluster2Blk(dv,de.cluster); -//Bypass partition bounds-checking - BlkDevLock(bd); - ATAReadBlks(bd,&mbr,0,1); - for (i=0;i=BMHD_END-BMHD_CODE - for (;icur_dv; + if (dv->fs_type!=FSt_REDSEA && dv->fs_type!=FSt_FAT32) + PrintErr("File System Not Supported\n"); + else { +//Bypass partition bounds-checking + BlkDevLock(bd); + ATAReadBlks(bd,&mbr,0,1); + BlkDevUnlock(bd); + + Drv(dst_drv); + MkDir(BOOT_DIR); + FileWrite(BOOT_DIR_OLDMBR_BIN_C,&mbr,BLK_SIZE); + } +} + +public U0 BootMHDOldWrite(U8 src_drv,U8 dst_drv) +{//Reads OldMBR from src drive BOOT_DIR. +//writes it to the MBR of the drive with dst partition. + CBlkDev *bd=Let2BlkDev(dst_drv); + CMasterBoot *mbr; + Drv(src_drv); + if (mbr=FileRead(BOOT_DIR_OLDMBR_BIN_C)) { +//Bypass partition bounds-checking + BlkDevLock(bd); + ATAWriteBlks(bd,mbr,0,1); + BlkDevUnlock(bd); + } + Free(mbr); +} + +public U0 BootMHDZero(U8 dst_drv) +{//Set MBR of disk with dst partition to zero. + + //This is dangerous!! + //The TempleOS partitioner doesn't play well + //with other operating systems at this time and you need + //to do this on a drive partitioned by TempleOS + //if you wish to partition with another operating system. + CBlkDev *bd=Let2BlkDev(dst_drv); + CMasterBoot mbr; + MemSet(&mbr,0,BLK_SIZE); +//Bypass partition bounds-checking + BlkDevLock(bd); + ATAWriteBlks(bd,&mbr,0,1); + BlkDevUnlock(bd); +} + +public Bool BootMHDIns(U8 drv_let,U8 *drv_lst=NULL) +{//Create new MBR on the disk that has drv_let as a partition. +//Puts stage 2 in BOOT_DIR of drv_let. + CBlkDev *bd,*bd1; + CDrv *dv,*p1; + CMasterBoot mbr; + CDirEntry de; + I64 i,j,size,*_q; + U8 *menu_ptr,*ptr,ch,buf[STR_LEN]; + Bool res=FALSE; + + try { + if (drv_lst) { + StrCpy(buf,drv_lst); + StrUtil(buf,SUF_TO_UPPER); + } else { + j=0; + for (i='A';i<='Z';i++) + buf[j++]=i; + buf[j++]=0; + } + Drv(drv_let); + dv=Fs->cur_dv; + if (dv->fs_type!=FSt_REDSEA && dv->fs_type!=FSt_FAT32) + PrintErr("File System Not Supported\n"); + else { + bd=dv->bd; + if (!FileFind(BOOT_DIR_OLDMBR_BIN_C,,FUF_JUST_FILES)) + BootMHDOldRead(drv_let,drv_let); + + _q=BMHD2_BLK_ARRAY; + MemSet(_q,0,sizeof(I64)*8); + menu_ptr=BMHD2_BOOT_MSG; + StrPrint(menu_ptr,"\n\r\n\rTempleOS Boot Loader\n\r\n\r"); + j=0; + if (FileFind(BOOT_DIR_OLDMBR_BIN_C,&de,FUF_JUST_FILES)) { + Free(de.full_name); + *_q++=Cluster2Blk(dv,de.cluster); + CatPrint(menu_ptr,"0. Old Boot Record\n\r"); + j++; + } + + ptr=buf; + while (ch=*ptr++) { + if ((p1=Let2Drv(ch,FALSE)) && (bd1=p1->bd) && bd1==bd) { + *_q=p1->drv_offset; + "Drive %C:%16X\n",Drv2Let(p1),*_q; + CatPrint(menu_ptr,"%d. Drive %C\n\r",j++,Drv2Let(p1)); + _q++; + } + } + CatPrint(menu_ptr,"\n\rSelection:"); + + size=BMHD2_END-BMHD2_START; + FileWrite(BOOT_DIR_BOOTMHD2_BIN_C,BMHD2_START,size); + + if (!FileFind(BOOT_DIR_BOOTMHD2_BIN_C,&de,FUF_JUST_FILES)) + "No Boot Loader Image\n"; + else { + Free(de.full_name); + *BMHD_BLK_CNT(U16 *)=(size+BLK_SIZE-1)>>BLK_SIZE_BITS; + *BMHD_DAP_BLK(I64 *)=Cluster2Blk(dv,de.cluster); +//Bypass partition bounds-checking + BlkDevLock(bd); + ATAReadBlks(bd,&mbr,0,1); + for (i=0;i=BMHD_END-BMHD_CODE + for (;iuser_data; - - de->len=sizeof(CISO1DirEntry)-1; - de->ext_attr_len=0; - FillU16Palindrome(&de->vol_seq_num,1); - Date2ISO1(&de->date,tempde->datetime); - de->flags=ISO1_ATTR_DIR; - de->name_len=1; - de->name=0; - de->len+=de->name_len; - de(U8 *)+=de->len; - - de->len=sizeof(CISO1DirEntry)-1; - de->ext_attr_len=0; - FillU32Palindrome(&de->loc,tempc->loc); - FillU32Palindrome(&de->size,tempc->short_dir_blks*DVD_BLK_SIZE); - FillU16Palindrome(&de->vol_seq_num,1); - Date2ISO1(&de->date,parent->datetime); - de->flags=ISO1_ATTR_DIR; - de->name_len=1; - de->name=1; - de->len+=de->name_len; - de(U8 *)+=de->len; - - de2->len=sizeof(CISO1DirEntry)-1; - de2->ext_attr_len=0; - FillU16Palindrome(&de2->vol_seq_num,1); - Date2ISO1(&de2->date,tempde->datetime); - de2->flags=ISO1_ATTR_DIR; - de2->name_len=1; - de2->name=0; - de2->len+=de2->name_len; - de2(U8 *)+=de2->len; - - de2->len=sizeof(CISO1DirEntry)-1; - de2->ext_attr_len=0; - FillU32Palindrome(&de2->loc,tempc->loc+tempc->short_dir_blks); - FillU32Palindrome(&de2->size,tempc->long_dir_blks*DVD_BLK_SIZE); - FillU16Palindrome(&de2->vol_seq_num,1); - Date2ISO1(&de2->date,parent->datetime); - de2->flags=ISO1_ATTR_DIR; - de2->name_len=1; - de2->name=1; - de2->len+=de2->name_len; - de2(U8 *)+=de2->len; - - tempde1=tempde->sub; - while (tempde1) { - tempde2=tempde1->next; - if (!write) tempde1->user_data=CAlloc(sizeof(CCDVDUserData)); - de1=de; - de12=de2; - if (tempde1->attr & RS_ATTR_DIR) { - n=DVDFileCreate2(out_file,tempde1,de,de2,_cur_blk, - tempde,write,stage2_filename,_stage2_blk); - de(U8 *)+=sizeof(CISO1DirEntry)-1+n; - de2(U8 *)+=sizeof(CISO1DirEntry)-1+n<<1; - } else { - tempc=tempde1->user_data; - de->len=sizeof(CISO1DirEntry)-1; - de->ext_attr_len=0; - FillU32Palindrome(&de->loc,*_cur_blk); - tempc->loc=*_cur_blk; - if (write) { - if (stage2_filename && !StrCmp(tempde1->full_name,stage2_filename)) { - "$$RED$$!!! Boot Stage 2 !!!$$FG$$\n"; - if (_stage2_blk) *_stage2_blk=*_cur_blk; - } - "%X:%s\n",*_cur_blk,tempde1->full_name; - } - FillU32Palindrome(&de->size,tempde1->size); - FillU16Palindrome(&de->vol_seq_num,1); - Date2ISO1(&de->date,tempde1->datetime); - de->flags=0; - de->name_len=StrLen(tempde1->name); - StrCpy(&de->name,tempde1->name); - de->len=de->len+de->name_len; - de(U8 *)+=de->len; - - de2->len=sizeof(CISO1DirEntry)-1; - de2->ext_attr_len=0; - FillU32Palindrome(&de2->loc,*_cur_blk); - FillU32Palindrome(&de2->size,tempde1->size); - FillU16Palindrome(&de2->vol_seq_num,1); - Date2ISO1(&de2->date,tempde1->datetime); - de2->flags=0; - de2->name_len=StrLen(tempde1->name)<<1; - ptr1=&de2->name; - ptr2=&tempde1->name; - for (i=0;iname_len;i=i+2) { - ptr1++; - *ptr1++=*ptr2++; - } - de2->len+=de2->name_len; - de2(U8 *)+=de2->len; - - in_file=FOpen(tempde1->full_name,"r"); - for (i=0;i<(FSize(in_file)+DVD_BLK_SIZE-1)/DVD_BLK_SIZE;i++) { - n=4; - if ((i+1)<<2>(FSize(in_file)+BLK_SIZE-1)>>BLK_SIZE_BITS) { - n=(FSize(in_file)+BLK_SIZE-1)>>BLK_SIZE_BITS&3; - MemSet(buf,0,DVD_BLK_SIZE); - } - if (write) { - FRBlks(in_file,buf,i<<2,n); - FWBlks(out_file,buf,*_cur_blk<<2,n); - } - *_cur_blk+=1; - } - FClose(in_file); - } - if ((de1(U8 *)-dir_blk_buf(U8 *))/DVD_BLK_SIZE!= - (de(U8 *) -dir_blk_buf(U8 *))/DVD_BLK_SIZE) { - i=de1->len; - MemCpy(buf,de1,i); - MemSet(de1,0,i); - de=dir_blk_buf(U8 *)+(de(U8 *) - -dir_blk_buf(U8 *))/DVD_BLK_SIZE*DVD_BLK_SIZE; - MemCpy(de,buf,i); - de(U8 *)+=i; - } - if ((de12(U8 *)-dir_blk_buf2(U8 *))/DVD_BLK_SIZE!= - (de2(U8 *) -dir_blk_buf2(U8 *))/DVD_BLK_SIZE) { - i=de12->len; - MemCpy(buf,de12,i); - MemSet(de12,0,i); - de2(U8 *)=dir_blk_buf2(U8 *)+(de2(U8 *) - -dir_blk_buf2(U8 *))/DVD_BLK_SIZE*DVD_BLK_SIZE; - MemCpy(de2,buf,i); - de2(U8 *)+=i; - } - tempde1=tempde2; - } - - tempc=tempde->user_data; - - tempi->len=sizeof(CISO1DirEntry)-1; - tempi->ext_attr_len=0; - tempi->flags=ISO1_ATTR_DIR; - if (!tempde->name[0]) { - tempi->name_len=1; - tempi->name=1; - } else { - tempi->name_len=StrLen(tempde->name); - StrCpy(&tempi->name,tempde->name); - } - tempi->len+=tempi->name_len; - - n=de(U8 *)+1-dir_blk_buf(U8 *); - n=(n+DVD_BLK_SIZE-1)/DVD_BLK_SIZE; - FillU32Palindrome(&tempi->size,n*DVD_BLK_SIZE); - FillU32Palindrome(&tempi->loc,*_cur_blk); - tempc->short_dir_blks=n; - tempc->loc=*_cur_blk; - FillU32Palindrome(&dir_blk_buf->size,n*DVD_BLK_SIZE); - FillU32Palindrome(&dir_blk_buf->loc,*_cur_blk); - FillU16Palindrome(&tempi->vol_seq_num,1); - Date2ISO1(&tempi->date,tempde->datetime); - if (write) - "%X:%s\n",*_cur_blk,tempde->full_name; - if (write) - FWBlks(out_file,dir_blk_buf,*_cur_blk<<2,n<<2); - *_cur_blk+=n; - - tempi2->len=sizeof(CISO1DirEntry)-1; - tempi2->ext_attr_len=0; - tempi2->flags=ISO1_ATTR_DIR; - if (!tempde->name[0]) { - tempi2->name_len=1; - tempi->name=1; - } else { - tempi2->name_len=StrLen(tempde->name)<<1; - ptr1=&tempi2->name; - ptr2=&tempde->name; - for (i=0;iname_len;i=i+2) { - ptr1++; - *ptr1++=*ptr2++; - } - } - tempi2->len+=tempi2->name_len; - n=de2(U8 *)+1-dir_blk_buf2(U8 *); - n=(n+DVD_BLK_SIZE-1)/DVD_BLK_SIZE; - FillU32Palindrome(&tempi2->size,n*DVD_BLK_SIZE); - FillU32Palindrome(&tempi2->loc,*_cur_blk); - tempc->long_dir_blks=n; - FillU32Palindrome(&dir_blk_buf2->size,n*DVD_BLK_SIZE); - FillU32Palindrome(&dir_blk_buf2->loc,*_cur_blk); - FillU16Palindrome(&tempi2->vol_seq_num,1); - Date2ISO1(&tempi2->date,tempde->datetime); - if (write) - "%X:%s\n",*_cur_blk,tempde->full_name; - if (write) - FWBlks(out_file,dir_blk_buf2,*_cur_blk<<2,n<<2); - *_cur_blk+=n; - - Free(dir_blk_buf); - Free(dir_blk_buf2); - Free(buf); - return tempi->name_len; -} - -I64 DVDTableLen(CDirEntry *tempde,I64 *size1,I64 *size2,I64 cur_depth) -{//Returns depth - CDirEntry *tempde1=tempde->sub; - I64 max_depth=cur_depth,i; - while (tempde1) { - if (tempde1->attr & RS_ATTR_DIR) { - *size1+=sizeof(CISO1PathEntry)-2+ (StrLen(tempde1->name)+1)&-0x2; - *size2+=sizeof(CISO1PathEntry)-2+StrLen(tempde1->name)<<1; - i=DVDTableLen(tempde1,size1,size2,cur_depth+1); - if (i>max_depth) max_depth=i; - } - tempde1=tempde1->next; - } - return max_depth; -} - -U0 DVDFillPathTable(CDirEntry *tempde, - CISO1PathEntry **_itabbuf,CISO1PathEntry **_itabbuf2, - I64 parent_entry_num,Bool big_endian,I64 *first_free, - I64 cur_level,I64 output_level) -{ - U8 *ptr1,*ptr2; - I64 i; - CISO1PathEntry *tabbuf=*_itabbuf,*tabbuf2=*_itabbuf2; - CDirEntry *tempde1=tempde->sub,*tempde2; - CCDVDUserData *tempc; - - if (cur_level==output_level) { - while (tempde1) { - if (tempde1->attr & RS_ATTR_DIR) { - tempc=tempde1->user_data; - tempc->path_entry_num=*first_free; - tabbuf->name_len=StrLen(tempde1->name); - if (big_endian) { - tabbuf->blk=EndianU32(tempc->loc); - tabbuf->parent_entry_num=EndianU16(parent_entry_num); - } else { - tabbuf->blk=tempc->loc; - tabbuf->parent_entry_num=parent_entry_num; - } - StrCpy(&tabbuf->name,tempde1->name); - - tabbuf(U8 *)+=sizeof(CISO1PathEntry)-2+ - (StrLen(tempde1->name)+1) & -0x2; - - tabbuf2->name_len=StrLen(tempde1->name)<<1; - if (big_endian) { - tabbuf2->blk=EndianU32(tempc->loc+tempc->short_dir_blks); - tabbuf2->parent_entry_num=EndianU16(parent_entry_num); - } else { - tabbuf2->blk=tempc->loc+tempc->short_dir_blks; - tabbuf2->parent_entry_num=parent_entry_num; - } - ptr1=&tabbuf2->name; - ptr2=&tempde1->name; - for (i=0;iname_len;i=i+2) { - ptr1++; - *ptr1++=*ptr2++; - } - tabbuf2(U8 *)+=sizeof(CISO1PathEntry)-2+ - StrLen(tempde1->name)<<1; - *first_free+=1; - } - tempde1=tempde1->next; - } - *_itabbuf=tabbuf; - *_itabbuf2=tabbuf2; - } - tempde1=tempde->sub; - while (tempde1) { - tempde2=tempde1->next; - if (tempde1->attr & RS_ATTR_DIR) { - tempc=tempde1->user_data; - DVDFillPathTable(tempde1,_itabbuf,_itabbuf2,tempc->path_entry_num, - big_endian,first_free,cur_level+1,output_level); - } - tempde1=tempde2; - } -} - -public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask, - U8 *fu_flags=NULL,U8 *_stage2_filename=NULL) -{//See $LK,"::/Misc/DoDistro.CPP"$ -//Use "C:/Distro/*" if you want all files in the C:/Distro directory. - //Default flags are "+r" recurse. - 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); - CDirEntry *headdir=CAlloc(sizeof(CDirEntry)); - 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; - U32 *d; - CElTorito *et=CAlloc(DVD_BLK_SIZE); - U8 *filename,*stage2_filename, - *stage1_buf=CAlloc(DVD_BOOT_LOADER_SIZE), - *zero_buf=CAlloc(DVD_BLK_SIZE); - CISO1PathEntry *tabbuf=NULL,*tabbuf2=NULL,*itabbuf,*itabbuf2; - CFile *out_file=NULL; - CISO1DirEntry *tempi; - CCDVDUserData *tempc; - - ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r"); - ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); - - if (!_filename) - _filename=blkdev.dft_iso_filename; - filename=DftExt(_filename,"ISO"); - - if (_stage2_filename) - stage2_filename=FileNameAbs(_stage2_filename); - else - stage2_filename=NULL; - - headdir->attr=RS_ATTR_DIR; - headdir->sub=FilesFind(src_files_find_mask,fuf_flags); - headdir->datetime=Now; - headdir->user_data=CAlloc(sizeof(CCDVDUserData)); - tempc=headdir->user_data; - tempc->path_entry_num=1; - - cur_blk=20<<2>>2; - if (stage2_filename) //preboot and bootloader - cur_blk+=1+DVD_BOOT_LOADER_SIZE/DVD_BLK_SIZE; - DVDFileCreate2(out_file,headdir,&iso_pri->root_dir_record, - &iso_sup->root_dir_record,&cur_blk,headdir,FALSE, - stage2_filename,&stage2_blk); - tabsize=sizeof(CISO1PathEntry); - tabsize2=sizeof(CISO1PathEntry); - max_depth=DVDTableLen(headdir,&tabsize,&tabsize2,1); - FillU32Palindrome(&iso_pri->path_table_size,tabsize); - FillU32Palindrome(&iso_sup->path_table_size,tabsize2); - tabsize=(tabsize+DVD_BLK_SIZE-1)/DVD_BLK_SIZE; - cur_blk+=tabsize<<1; - tabsize2=(tabsize2+DVD_BLK_SIZE-1)/DVD_BLK_SIZE; - cur_blk+=tabsize2<<1; - - if (FileAttr(filename) & RS_ATTR_CONTIGUOUS) - out_file=FOpen(filename,"wc",cur_blk<<2); - else - out_file=FOpen(filename,"w",cur_blk<<2); - cur_blk=0; - if (!out_file) - goto cf_done; - - while (cur_blk<20<<2>>2) - FWBlks(out_file,zero_buf,cur_blk++<<2,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); - iso_pri->file_structure_version=1; - - iso_sup->type=ISO1T_SUPPLEMENTARY_DESC; - StrCpy(iso_sup->id,"CD001"); - iso_sup->version=1; - FillU16Palindrome(&iso_sup->vol_set_size,1); - FillU16Palindrome(&iso_sup->vol_seq_num,1); - FillU16Palindrome(&iso_sup->log_block_size,DVD_BLK_SIZE); - iso_sup->file_structure_version=1; - - iso_boot->type=ISO1T_BOOT_RECORD; - StrCpy(iso_boot->id,"CD001"); - iso_boot->version=1; - StrCpy(iso_boot(U8 *)+7,"EL TORITO SPECIFICATION"); - - cur_blk=20<<2>>2; - - if (stage2_filename) { - d=iso_boot(U8 *)+0x47; - *d=cur_blk; - 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=cur_blk+1; - "%X: Pre Boot Blk\n",cur_blk; - FWBlks(out_file,et,cur_blk++<<2,4); - "%X: Boot Stage 1\n",cur_blk; - cur_blk+=DVD_BOOT_LOADER_SIZE/DVD_BLK_SIZE; - } - - DVDFileCreate2(out_file,headdir,&iso_pri->root_dir_record, - &iso_sup->root_dir_record,&cur_blk,headdir,TRUE, - stage2_filename,&stage2_blk); - - tabbuf=CAlloc(tabsize*DVD_BLK_SIZE); - iso_pri->type_l_path_table=cur_blk; - tabbuf->name_len=2; //Fill-in adam entry - tempi=&iso_pri->root_dir_record; - tabbuf->blk=tempi->loc.little; - tabbuf->parent_entry_num=1; - tabbuf2=CAlloc(tabsize2*DVD_BLK_SIZE); - iso_sup->type_l_path_table=cur_blk+tabsize; - tabbuf2->name_len=2; //Fill-in adam entry - tempi=&iso_sup->root_dir_record; - tabbuf2->blk=tempi->loc.little; - tabbuf2->parent_entry_num=1; - itabbuf=tabbuf+1; - itabbuf2=tabbuf2+1; - first_free=2; - 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); - cur_blk+=tabsize; - "%X: Path Table 1\n",cur_blk; - FWBlks(out_file,tabbuf2,cur_blk<<2,tabsize2<<2); - cur_blk+=tabsize2; - - MemSet(tabbuf,0,tabsize*DVD_BLK_SIZE); - iso_pri->type_m_path_table=EndianU32(cur_blk); - tabbuf->name_len=2; //Fill-in adam entry - tempi=&iso_pri->root_dir_record; - tabbuf->blk=tempi->loc.big; - tabbuf->parent_entry_num=EndianU16(1); - MemSet(tabbuf2,0,tabsize2*DVD_BLK_SIZE); - iso_sup->type_m_path_table=EndianU32(cur_blk+tabsize); - tabbuf2->name_len=2; //Fill-in adam entry - tempi=&iso_sup->root_dir_record; - tabbuf2->blk=tempi->loc.big; - tabbuf2->parent_entry_num=EndianU16(1); - itabbuf=tabbuf+1; - itabbuf2=tabbuf2+1; - first_free=2; - 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); - cur_blk+=tabsize; - "%X: Path Table 3\n",cur_blk; - FWBlks(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); - - 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); - 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, - 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); - } - - cf_done: - FClose(out_file); - Free(tabbuf); - Free(tabbuf2); - Free(stage2_filename); - Free(filename); - Free(zero_buf); - Free(stage1_buf); - Free(et); - Free(iso_pri); - Free(iso_boot); - Free(iso_sup); - Free(iso_term); - return cur_blk; -} diff --git a/Adam/Opt/Boot/DskISO9660.HC b/Adam/Opt/Boot/DskISO9660.HC new file mode 100644 index 0000000..9c65c86 --- /dev/null +++ b/Adam/Opt/Boot/DskISO9660.HC @@ -0,0 +1,506 @@ +#help_index "File/CD DVD" + +class CCDVDUserData //Create DVD +{ + I64 loc,path_entry_num, + short_dir_blks,long_dir_blks; +}; + +I64 DVDFileCreate2(CFile *out_file,CDirEntry *tempde,CISO1DirEntry *tempi, + CISO1DirEntry *tempi2,I64 *_cur_blk,CDirEntry *parent,Bool write, + U8 *stage2_filename,I64 *_stage2_blk) +{ + CCDVDUserData *tempc; + CDirEntry *tempde1,*tempde2; + CFile *in_file; + U8 *buf=MAlloc(DVD_BLK_SIZE),*ptr1,*ptr2; + CISO1DirEntry *dir_blk_buf =CAlloc(DVD_BLK_SIZE*128), + *de =dir_blk_buf, *de1, + *dir_blk_buf2=CAlloc(DVD_BLK_SIZE*128), + *de2=dir_blk_buf2,*de12; + I64 i,n; + + tempc=parent->user_data; + + de->len=sizeof(CISO1DirEntry)-1; + de->ext_attr_len=0; + FillU16Palindrome(&de->vol_seq_num,1); + Date2ISO1(&de->date,tempde->datetime); + de->flags=ISO1_ATTR_DIR; + de->name_len=1; + de->name=0; + de->len+=de->name_len; + de(U8 *)+=de->len; + + de->len=sizeof(CISO1DirEntry)-1; + de->ext_attr_len=0; + FillU32Palindrome(&de->loc,tempc->loc); + FillU32Palindrome(&de->size,tempc->short_dir_blks*DVD_BLK_SIZE); + FillU16Palindrome(&de->vol_seq_num,1); + Date2ISO1(&de->date,parent->datetime); + de->flags=ISO1_ATTR_DIR; + de->name_len=1; + de->name=1; + de->len+=de->name_len; + de(U8 *)+=de->len; + + de2->len=sizeof(CISO1DirEntry)-1; + de2->ext_attr_len=0; + FillU16Palindrome(&de2->vol_seq_num,1); + Date2ISO1(&de2->date,tempde->datetime); + de2->flags=ISO1_ATTR_DIR; + de2->name_len=1; + de2->name=0; + de2->len+=de2->name_len; + de2(U8 *)+=de2->len; + + de2->len=sizeof(CISO1DirEntry)-1; + de2->ext_attr_len=0; + FillU32Palindrome(&de2->loc,tempc->loc+tempc->short_dir_blks); + FillU32Palindrome(&de2->size,tempc->long_dir_blks*DVD_BLK_SIZE); + FillU16Palindrome(&de2->vol_seq_num,1); + Date2ISO1(&de2->date,parent->datetime); + de2->flags=ISO1_ATTR_DIR; + de2->name_len=1; + de2->name=1; + de2->len+=de2->name_len; + de2(U8 *)+=de2->len; + + tempde1=tempde->sub; + while (tempde1) { + tempde2=tempde1->next; + if (!write) tempde1->user_data=CAlloc(sizeof(CCDVDUserData)); + de1=de; + de12=de2; + if (tempde1->attr & RS_ATTR_DIR) { + n=DVDFileCreate2(out_file,tempde1,de,de2,_cur_blk, + tempde,write,stage2_filename,_stage2_blk); + de(U8 *)+=sizeof(CISO1DirEntry)-1+n; + de2(U8 *)+=sizeof(CISO1DirEntry)-1+n<<1; + } else { + tempc=tempde1->user_data; + de->len=sizeof(CISO1DirEntry)-1; + de->ext_attr_len=0; + FillU32Palindrome(&de->loc,*_cur_blk); + tempc->loc=*_cur_blk; + if (write) { + if (stage2_filename && !StrCmp(tempde1->full_name,stage2_filename)) { + "$$RED$$!!! Boot Stage 2 !!!$$FG$$\n"; + if (_stage2_blk) *_stage2_blk=*_cur_blk; + } + "%X:%s\n",*_cur_blk,tempde1->full_name; + } + FillU32Palindrome(&de->size,tempde1->size); + FillU16Palindrome(&de->vol_seq_num,1); + Date2ISO1(&de->date,tempde1->datetime); + de->flags=0; + de->name_len=StrLen(tempde1->name); + StrCpy(&de->name,tempde1->name); + de->len=de->len+de->name_len; + de(U8 *)+=de->len; + + de2->len=sizeof(CISO1DirEntry)-1; + de2->ext_attr_len=0; + FillU32Palindrome(&de2->loc,*_cur_blk); + FillU32Palindrome(&de2->size,tempde1->size); + FillU16Palindrome(&de2->vol_seq_num,1); + Date2ISO1(&de2->date,tempde1->datetime); + de2->flags=0; + de2->name_len=StrLen(tempde1->name)<<1; + ptr1=&de2->name; + ptr2=&tempde1->name; + for (i=0;iname_len;i=i+2) { + ptr1++; + *ptr1++=*ptr2++; + } + de2->len+=de2->name_len; + de2(U8 *)+=de2->len; + + in_file=FOpen(tempde1->full_name,"r"); + for (i=0;i<(FSize(in_file)+DVD_BLK_SIZE-1)/DVD_BLK_SIZE;i++) { + n=4; + if ((i+1)<<2>(FSize(in_file)+BLK_SIZE-1)>>BLK_SIZE_BITS) { + n=(FSize(in_file)+BLK_SIZE-1)>>BLK_SIZE_BITS&3; + MemSet(buf,0,DVD_BLK_SIZE); + } + if (write) { + FRBlks(in_file,buf,i<<2,n); + FWBlks(out_file,buf,*_cur_blk<<2,n); + } + *_cur_blk+=1; + } + FClose(in_file); + } + if ((de1(U8 *)-dir_blk_buf(U8 *))/DVD_BLK_SIZE!= + (de(U8 *) -dir_blk_buf(U8 *))/DVD_BLK_SIZE) { + i=de1->len; + MemCpy(buf,de1,i); + MemSet(de1,0,i); + de=dir_blk_buf(U8 *)+(de(U8 *) + -dir_blk_buf(U8 *))/DVD_BLK_SIZE*DVD_BLK_SIZE; + MemCpy(de,buf,i); + de(U8 *)+=i; + } + if ((de12(U8 *)-dir_blk_buf2(U8 *))/DVD_BLK_SIZE!= + (de2(U8 *) -dir_blk_buf2(U8 *))/DVD_BLK_SIZE) { + i=de12->len; + MemCpy(buf,de12,i); + MemSet(de12,0,i); + de2(U8 *)=dir_blk_buf2(U8 *)+(de2(U8 *) + -dir_blk_buf2(U8 *))/DVD_BLK_SIZE*DVD_BLK_SIZE; + MemCpy(de2,buf,i); + de2(U8 *)+=i; + } + tempde1=tempde2; + } + + tempc=tempde->user_data; + + tempi->len=sizeof(CISO1DirEntry)-1; + tempi->ext_attr_len=0; + tempi->flags=ISO1_ATTR_DIR; + if (!tempde->name[0]) { + tempi->name_len=1; + tempi->name=1; + } else { + tempi->name_len=StrLen(tempde->name); + StrCpy(&tempi->name,tempde->name); + } + tempi->len+=tempi->name_len; + + n=de(U8 *)+1-dir_blk_buf(U8 *); + n=(n+DVD_BLK_SIZE-1)/DVD_BLK_SIZE; + FillU32Palindrome(&tempi->size,n*DVD_BLK_SIZE); + FillU32Palindrome(&tempi->loc,*_cur_blk); + tempc->short_dir_blks=n; + tempc->loc=*_cur_blk; + FillU32Palindrome(&dir_blk_buf->size,n*DVD_BLK_SIZE); + FillU32Palindrome(&dir_blk_buf->loc,*_cur_blk); + FillU16Palindrome(&tempi->vol_seq_num,1); + Date2ISO1(&tempi->date,tempde->datetime); + if (write) + "%X:%s\n",*_cur_blk,tempde->full_name; + if (write) + FWBlks(out_file,dir_blk_buf,*_cur_blk<<2,n<<2); + *_cur_blk+=n; + + tempi2->len=sizeof(CISO1DirEntry)-1; + tempi2->ext_attr_len=0; + tempi2->flags=ISO1_ATTR_DIR; + if (!tempde->name[0]) { + tempi2->name_len=1; + tempi->name=1; + } else { + tempi2->name_len=StrLen(tempde->name)<<1; + ptr1=&tempi2->name; + ptr2=&tempde->name; + for (i=0;iname_len;i=i+2) { + ptr1++; + *ptr1++=*ptr2++; + } + } + tempi2->len+=tempi2->name_len; + n=de2(U8 *)+1-dir_blk_buf2(U8 *); + n=(n+DVD_BLK_SIZE-1)/DVD_BLK_SIZE; + FillU32Palindrome(&tempi2->size,n*DVD_BLK_SIZE); + FillU32Palindrome(&tempi2->loc,*_cur_blk); + tempc->long_dir_blks=n; + FillU32Palindrome(&dir_blk_buf2->size,n*DVD_BLK_SIZE); + FillU32Palindrome(&dir_blk_buf2->loc,*_cur_blk); + FillU16Palindrome(&tempi2->vol_seq_num,1); + Date2ISO1(&tempi2->date,tempde->datetime); + if (write) + "%X:%s\n",*_cur_blk,tempde->full_name; + if (write) + FWBlks(out_file,dir_blk_buf2,*_cur_blk<<2,n<<2); + *_cur_blk+=n; + + Free(dir_blk_buf); + Free(dir_blk_buf2); + Free(buf); + return tempi->name_len; +} + +I64 DVDTableLen(CDirEntry *tempde,I64 *size1,I64 *size2,I64 cur_depth) +{//Returns depth + CDirEntry *tempde1=tempde->sub; + I64 max_depth=cur_depth,i; + while (tempde1) { + if (tempde1->attr & RS_ATTR_DIR) { + *size1+=sizeof(CISO1PathEntry)-2+ (StrLen(tempde1->name)+1)&-0x2; + *size2+=sizeof(CISO1PathEntry)-2+StrLen(tempde1->name)<<1; + i=DVDTableLen(tempde1,size1,size2,cur_depth+1); + if (i>max_depth) max_depth=i; + } + tempde1=tempde1->next; + } + return max_depth; +} + +U0 DVDFillPathTable(CDirEntry *tempde, + CISO1PathEntry **_itabbuf,CISO1PathEntry **_itabbuf2, + I64 parent_entry_num,Bool big_endian,I64 *first_free, + I64 cur_level,I64 output_level) +{ + U8 *ptr1,*ptr2; + I64 i; + CISO1PathEntry *tabbuf=*_itabbuf,*tabbuf2=*_itabbuf2; + CDirEntry *tempde1=tempde->sub,*tempde2; + CCDVDUserData *tempc; + + if (cur_level==output_level) { + while (tempde1) { + if (tempde1->attr & RS_ATTR_DIR) { + tempc=tempde1->user_data; + tempc->path_entry_num=*first_free; + tabbuf->name_len=StrLen(tempde1->name); + if (big_endian) { + tabbuf->blk=EndianU32(tempc->loc); + tabbuf->parent_entry_num=EndianU16(parent_entry_num); + } else { + tabbuf->blk=tempc->loc; + tabbuf->parent_entry_num=parent_entry_num; + } + StrCpy(&tabbuf->name,tempde1->name); + + tabbuf(U8 *)+=sizeof(CISO1PathEntry)-2+ + (StrLen(tempde1->name)+1) & -0x2; + + tabbuf2->name_len=StrLen(tempde1->name)<<1; + if (big_endian) { + tabbuf2->blk=EndianU32(tempc->loc+tempc->short_dir_blks); + tabbuf2->parent_entry_num=EndianU16(parent_entry_num); + } else { + tabbuf2->blk=tempc->loc+tempc->short_dir_blks; + tabbuf2->parent_entry_num=parent_entry_num; + } + ptr1=&tabbuf2->name; + ptr2=&tempde1->name; + for (i=0;iname_len;i=i+2) { + ptr1++; + *ptr1++=*ptr2++; + } + tabbuf2(U8 *)+=sizeof(CISO1PathEntry)-2+ + StrLen(tempde1->name)<<1; + *first_free+=1; + } + tempde1=tempde1->next; + } + *_itabbuf=tabbuf; + *_itabbuf2=tabbuf2; + } + tempde1=tempde->sub; + while (tempde1) { + tempde2=tempde1->next; + if (tempde1->attr & RS_ATTR_DIR) { + tempc=tempde1->user_data; + DVDFillPathTable(tempde1,_itabbuf,_itabbuf2,tempc->path_entry_num, + big_endian,first_free,cur_level+1,output_level); + } + tempde1=tempde2; + } +} + +public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask, + U8 *fu_flags=NULL,U8 *_stage2_filename=NULL) +{//See $LK,"::/Misc/DoDistro.HC"$ +//Use "C:/Distro/*" if you want all files in the C:/Distro directory. + //Default flags are "+r" recurse. + 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); + CDirEntry *headdir=CAlloc(sizeof(CDirEntry)); + 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; + U32 *d; + CElTorito *et=CAlloc(DVD_BLK_SIZE); + U8 *filename,*stage2_filename, + *stage1_buf=CAlloc(DVD_BOOT_LOADER_SIZE), + *zero_buf=CAlloc(DVD_BLK_SIZE); + CISO1PathEntry *tabbuf=NULL,*tabbuf2=NULL,*itabbuf,*itabbuf2; + CFile *out_file=NULL; + CISO1DirEntry *tempi; + CCDVDUserData *tempc; + + ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r"); + ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); + + if (!_filename) + _filename=blkdev.dft_iso_filename; + filename=DftExt(_filename,"ISO"); + + if (_stage2_filename) + stage2_filename=FileNameAbs(_stage2_filename); + else + stage2_filename=NULL; + + headdir->attr=RS_ATTR_DIR; + headdir->sub=FilesFind(src_files_find_mask,fuf_flags); + headdir->datetime=Now; + headdir->user_data=CAlloc(sizeof(CCDVDUserData)); + tempc=headdir->user_data; + tempc->path_entry_num=1; + + cur_blk=20<<2>>2; + if (stage2_filename) //preboot and bootloader + cur_blk+=1+DVD_BOOT_LOADER_SIZE/DVD_BLK_SIZE; + DVDFileCreate2(out_file,headdir,&iso_pri->root_dir_record, + &iso_sup->root_dir_record,&cur_blk,headdir,FALSE, + stage2_filename,&stage2_blk); + tabsize=sizeof(CISO1PathEntry); + tabsize2=sizeof(CISO1PathEntry); + max_depth=DVDTableLen(headdir,&tabsize,&tabsize2,1); + FillU32Palindrome(&iso_pri->path_table_size,tabsize); + FillU32Palindrome(&iso_sup->path_table_size,tabsize2); + tabsize=(tabsize+DVD_BLK_SIZE-1)/DVD_BLK_SIZE; + cur_blk+=tabsize<<1; + tabsize2=(tabsize2+DVD_BLK_SIZE-1)/DVD_BLK_SIZE; + cur_blk+=tabsize2<<1; + + if (FileAttr(filename) & RS_ATTR_CONTIGUOUS) + out_file=FOpen(filename,"wc",cur_blk<<2); + else + out_file=FOpen(filename,"w",cur_blk<<2); + cur_blk=0; + if (!out_file) + goto cf_done; + + while (cur_blk<20<<2>>2) + FWBlks(out_file,zero_buf,cur_blk++<<2,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); + iso_pri->file_structure_version=1; + + iso_sup->type=ISO1T_SUPPLEMENTARY_DESC; + StrCpy(iso_sup->id,"CD001"); + iso_sup->version=1; + FillU16Palindrome(&iso_sup->vol_set_size,1); + FillU16Palindrome(&iso_sup->vol_seq_num,1); + FillU16Palindrome(&iso_sup->log_block_size,DVD_BLK_SIZE); + iso_sup->file_structure_version=1; + + iso_boot->type=ISO1T_BOOT_RECORD; + StrCpy(iso_boot->id,"CD001"); + iso_boot->version=1; + StrCpy(iso_boot(U8 *)+7,"EL TORITO SPECIFICATION"); + + cur_blk=20<<2>>2; + + if (stage2_filename) { + d=iso_boot(U8 *)+0x47; + *d=cur_blk; + 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=cur_blk+1; + "%X: Pre Boot Blk\n",cur_blk; + FWBlks(out_file,et,cur_blk++<<2,4); + "%X: Boot Stage 1\n",cur_blk; + cur_blk+=DVD_BOOT_LOADER_SIZE/DVD_BLK_SIZE; + } + + DVDFileCreate2(out_file,headdir,&iso_pri->root_dir_record, + &iso_sup->root_dir_record,&cur_blk,headdir,TRUE, + stage2_filename,&stage2_blk); + + tabbuf=CAlloc(tabsize*DVD_BLK_SIZE); + iso_pri->type_l_path_table=cur_blk; + tabbuf->name_len=2; //Fill-in adam entry + tempi=&iso_pri->root_dir_record; + tabbuf->blk=tempi->loc.little; + tabbuf->parent_entry_num=1; + tabbuf2=CAlloc(tabsize2*DVD_BLK_SIZE); + iso_sup->type_l_path_table=cur_blk+tabsize; + tabbuf2->name_len=2; //Fill-in adam entry + tempi=&iso_sup->root_dir_record; + tabbuf2->blk=tempi->loc.little; + tabbuf2->parent_entry_num=1; + itabbuf=tabbuf+1; + itabbuf2=tabbuf2+1; + first_free=2; + 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); + cur_blk+=tabsize; + "%X: Path Table 1\n",cur_blk; + FWBlks(out_file,tabbuf2,cur_blk<<2,tabsize2<<2); + cur_blk+=tabsize2; + + MemSet(tabbuf,0,tabsize*DVD_BLK_SIZE); + iso_pri->type_m_path_table=EndianU32(cur_blk); + tabbuf->name_len=2; //Fill-in adam entry + tempi=&iso_pri->root_dir_record; + tabbuf->blk=tempi->loc.big; + tabbuf->parent_entry_num=EndianU16(1); + MemSet(tabbuf2,0,tabsize2*DVD_BLK_SIZE); + iso_sup->type_m_path_table=EndianU32(cur_blk+tabsize); + tabbuf2->name_len=2; //Fill-in adam entry + tempi=&iso_sup->root_dir_record; + tabbuf2->blk=tempi->loc.big; + tabbuf2->parent_entry_num=EndianU16(1); + itabbuf=tabbuf+1; + itabbuf2=tabbuf2+1; + first_free=2; + 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); + cur_blk+=tabsize; + "%X: Path Table 3\n",cur_blk; + FWBlks(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); + + 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); + 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, + 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); + } + + cf_done: + FClose(out_file); + Free(tabbuf); + Free(tabbuf2); + Free(stage2_filename); + Free(filename); + Free(zero_buf); + Free(stage1_buf); + Free(et); + Free(iso_pri); + Free(iso_boot); + Free(iso_sup); + Free(iso_term); + return cur_blk; +} diff --git a/Adam/Opt/Boot/DskISORedSea.CPP b/Adam/Opt/Boot/DskISORedSea.CPP deleted file mode 100644 index 2acbc15..0000000 --- a/Adam/Opt/Boot/DskISORedSea.CPP +++ /dev/null @@ -1,179 +0,0 @@ -#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;ibd->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; - - 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); - 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=DrvMakeFreeSlot(DrvNextFreeLet('Q')); //First $LK,"BDT_ISO_FILE_WRITE",A="MN:BDT_ISO_FILE_WRITE"$ - CBlkDev *bd=BlkDevNextFreeSlot(dv->drv_let,BDT_ISO_FILE_WRITE); - - if (!_iso_filename) - _iso_filename=blkdev.dft_iso_filename; - iso_filename=ChgExt(_iso_filename,"ISO.C"); - src_dir=DirNameAbs(_src_dir); - if (_stage2_filename) { - stage2_filename=FileNameAbs(_stage2_filename); - *stage2_filename=dv->drv_let; - i=StrLen(src_dir); - if (i!=3) //If not head - i++; //Skip slash - StrCpy(stage2_filename+3,stage2_filename+i); - } else - stage2_filename=NULL; - 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+(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; -} diff --git a/Adam/Opt/Boot/DskISORedSea.HC b/Adam/Opt/Boot/DskISORedSea.HC new file mode 100644 index 0000000..6eaac22 --- /dev/null +++ b/Adam/Opt/Boot/DskISORedSea.HC @@ -0,0 +1,179 @@ +#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;ibd->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; + + 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); + 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.HC"$. 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=DrvMakeFreeSlot(DrvNextFreeLet('Q')); //First $LK,"BDT_ISO_FILE_WRITE",A="MN:BDT_ISO_FILE_WRITE"$ + CBlkDev *bd=BlkDevNextFreeSlot(dv->drv_let,BDT_ISO_FILE_WRITE); + + if (!_iso_filename) + _iso_filename=blkdev.dft_iso_filename; + iso_filename=ChgExt(_iso_filename,"ISO.C"); + src_dir=DirNameAbs(_src_dir); + if (_stage2_filename) { + stage2_filename=FileNameAbs(_stage2_filename); + *stage2_filename=dv->drv_let; + i=StrLen(src_dir); + if (i!=3) //If not head + i++; //Skip slash + StrCpy(stage2_filename+3,stage2_filename+i); + } else + stage2_filename=NULL; + 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+(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; +} diff --git a/Adam/Opt/Boot/MakeBoot.CPP b/Adam/Opt/Boot/MakeBoot.HC similarity index 100% rename from Adam/Opt/Boot/MakeBoot.CPP rename to Adam/Opt/Boot/MakeBoot.HC diff --git a/Adam/Opt/Utils/Diff.CPP b/Adam/Opt/Utils/Diff.HC similarity index 100% rename from Adam/Opt/Utils/Diff.CPP rename to Adam/Opt/Utils/Diff.HC diff --git a/Adam/Opt/Utils/FileBMP.CPP b/Adam/Opt/Utils/FileBMP.HC similarity index 100% rename from Adam/Opt/Utils/FileBMP.CPP rename to Adam/Opt/Utils/FileBMP.HC diff --git a/Adam/Opt/Utils/Find.CPP b/Adam/Opt/Utils/Find.HC similarity index 100% rename from Adam/Opt/Utils/Find.CPP rename to Adam/Opt/Utils/Find.HC diff --git a/Adam/Opt/Utils/HeapLog.CPP b/Adam/Opt/Utils/HeapLog.HC similarity index 100% rename from Adam/Opt/Utils/HeapLog.CPP rename to Adam/Opt/Utils/HeapLog.HC diff --git a/Adam/Opt/Utils/LineRep.CPP b/Adam/Opt/Utils/LineRep.HC similarity index 100% rename from Adam/Opt/Utils/LineRep.CPP rename to Adam/Opt/Utils/LineRep.HC diff --git a/Adam/Opt/Utils/LinkChk.CPP b/Adam/Opt/Utils/LinkChk.HC similarity index 100% rename from Adam/Opt/Utils/LinkChk.CPP rename to Adam/Opt/Utils/LinkChk.HC diff --git a/Adam/Opt/Utils/MakeUtils.CPP b/Adam/Opt/Utils/MakeUtils.HC similarity index 100% rename from Adam/Opt/Utils/MakeUtils.CPP rename to Adam/Opt/Utils/MakeUtils.HC diff --git a/Adam/Opt/Utils/MemRep.CPP b/Adam/Opt/Utils/MemRep.HC similarity index 100% rename from Adam/Opt/Utils/MemRep.CPP rename to Adam/Opt/Utils/MemRep.HC diff --git a/Adam/Opt/Utils/Merge.CPP b/Adam/Opt/Utils/Merge.HC similarity index 100% rename from Adam/Opt/Utils/Merge.CPP rename to Adam/Opt/Utils/Merge.HC diff --git a/Adam/Opt/Utils/Profiler.CPP b/Adam/Opt/Utils/Profiler.CPP deleted file mode 100644 index 134de2e..0000000 --- a/Adam/Opt/Utils/Profiler.CPP +++ /dev/null @@ -1,102 +0,0 @@ -#help_index "Debugging/Profiler;Profiler;Cmd Line (Typically)/Profiler" -#help_file "::/Doc/Profiler" - -#define PF_ARRAY_CNT 0x100000 -I64 pf_jiffy_start,pf_jiffy_end; -I64 *pf_array=NULL; -I64 pf_cpu=0; -I64 pf_buf_in_ptr=0,pf_depth; -I64 pf_prof_active=0; - -U0 ProfTimerInt(CTask *task) -{//See $LK,"profiler_timer_irq",A="FF:::/Kernel/KInts.CPP,profiler_timer_irq"$. - I64 i,k; - if (Bt(&pf_prof_active,0)) - for (k=0;k<=pf_depth;k++) { - if (task==Gs->idle_task) - i=SYS_IDLE_PT; - else - i=TaskCaller(task,k,TRUE); - if (pf_buf_in_ptr=filter_cnt) - "$$GREEN$$%6.2f %08X:%s\n$$FG$$",100*routine_total/total_time, - routine_total,last_buf; - StrCpy(last_buf,buf2); - routine_total=0; - } - routine_total+=hits; - if (hits>=filter_cnt) { - "%6.2f %08X:%P\n",100*hits/total_time,hits,ip; - last_ip=ip; - } - } - if (*last_buf && routine_total>=filter_cnt) - "$$GREEN$$%6.2f %08X:%s\n$$FG$$",100*routine_total/total_time, - routine_total,last_buf; - "Total Time:%0.6fs\n",total_time/JIFFY_FREQ; - if (leave_it) { - cpu_structs[pf_cpu].profiler_timer_irq=&ProfTimerInt; - LBts(&pf_prof_active,0); - } else - cpu_structs[pf_cpu].profiler_timer_irq=NULL; - } -} diff --git a/Adam/Opt/Utils/Profiler.HC b/Adam/Opt/Utils/Profiler.HC new file mode 100644 index 0000000..2259c92 --- /dev/null +++ b/Adam/Opt/Utils/Profiler.HC @@ -0,0 +1,102 @@ +#help_index "Debugging/Profiler;Profiler;Cmd Line (Typically)/Profiler" +#help_file "::/Doc/Profiler" + +#define PF_ARRAY_CNT 0x100000 +I64 pf_jiffy_start,pf_jiffy_end; +I64 *pf_array=NULL; +I64 pf_cpu=0; +I64 pf_buf_in_ptr=0,pf_depth; +I64 pf_prof_active=0; + +U0 ProfTimerInt(CTask *task) +{//See $LK,"profiler_timer_irq",A="FF:::/Kernel/KInts.HC,profiler_timer_irq"$. + I64 i,k; + if (Bt(&pf_prof_active,0)) + for (k=0;k<=pf_depth;k++) { + if (task==Gs->idle_task) + i=SYS_IDLE_PT; + else + i=TaskCaller(task,k,TRUE); + if (pf_buf_in_ptr=filter_cnt) + "$$GREEN$$%6.2f %08X:%s\n$$FG$$",100*routine_total/total_time, + routine_total,last_buf; + StrCpy(last_buf,buf2); + routine_total=0; + } + routine_total+=hits; + if (hits>=filter_cnt) { + "%6.2f %08X:%P\n",100*hits/total_time,hits,ip; + last_ip=ip; + } + } + if (*last_buf && routine_total>=filter_cnt) + "$$GREEN$$%6.2f %08X:%s\n$$FG$$",100*routine_total/total_time, + routine_total,last_buf; + "Total Time:%0.6fs\n",total_time/JIFFY_FREQ; + if (leave_it) { + cpu_structs[pf_cpu].profiler_timer_irq=&ProfTimerInt; + LBts(&pf_prof_active,0); + } else + cpu_structs[pf_cpu].profiler_timer_irq=NULL; + } +} diff --git a/Adam/Opt/Utils/StrUtils.CPP b/Adam/Opt/Utils/StrUtils.CPP deleted file mode 100644 index d5c64de..0000000 --- a/Adam/Opt/Utils/StrUtils.CPP +++ /dev/null @@ -1,206 +0,0 @@ -#help_index "Cmd Line (Typically)" - -I64 DEPtrCompare(CDocEntry **e1,CDocEntry **e2) -{ - return StrCmp((*e1)->tag,(*e2)->tag); -} - -public I64 Sort(U8 *_in_name,U8 *_out_name=NULL, - I64 entry_lines=1,Bool unique=FALSE) -{//Sort lines of a text file. Removes blank lines. - U8 *in_name,*out_name,*st; - CDoc *doc; - CDocEntry *doc_e,*doc_e1,**a; - I64 i,j,cnt=0,res; - - if (!_in_name) return 0; - in_name=DftExt(_in_name,"TXT.Z"); - if (_out_name) - out_name=DftExt(_out_name,"TXT.Z"); - else - out_name=StrNew(in_name); - - doc=DocRead(in_name,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR); - doc_e=doc->head.next; - while (doc_e!=doc) { - if (doc_e->type_u8==DOCT_TEXT) - cnt++; - doc_e=doc_e->next; - } - a=MAlloc(cnt*sizeof(CDocEntry *)); - doc_e=doc->head.next; - i=0; - while (doc_e!=doc) { - doc_e1=doc_e->next; - if (doc_e->type_u8==DOCT_TEXT) { - QueRem(doc_e); - a[i++]=doc_e; - } else - DocEntryDel(doc,doc_e); - doc_e=doc_e1; - } - QSort(a,cnt/entry_lines,entry_lines*sizeof(CDocEntry *),&DEPtrCompare); - - res=0; - st=NULL; - for (i=0;itag,st)) { - st=a[i]->tag; - for (j=0;jhead.last); - doc->cur_entry=&doc->head; - doc->cur_col=0; - DocPrint(doc,"\n"); - } - res++; - } else - for (j=0;jhead.last); - DocEntryDel(doc,a[i]); - } - } - StrCpy(doc->filename.name,out_name); - DocWrite(doc); - - Free(a); - DocDel(doc); - Free(in_name); - Free(out_name); - return res; //Num Entries -} - -I64 DocWordsFile(CDoc *doc_out=NULL,U8 *filename,U32 *chars_bmp) -{ - U8 *ptr,*ptr2; - I64 res=0,ch; - CDoc *doc_in=DocRead(filename); - CDocEntry *doc_e=doc_in->head.next; - while (doc_e!=doc_in) { - if (doc_e->de_flags & DOCEF_TAG) { - ptr=doc_e->tag; - while (*ptr) { - while (*ptr && !Bt(chars_bmp,*ptr)) - ptr++; - - ptr2=ptr; - while (*ptr && Bt(chars_bmp,*ptr)) - ptr++; - - ch=*ptr; - *ptr=0; - if (*ptr2) { - DocPrint(doc_out,"%s\n",ptr2); - res++; - } - *ptr=ch; - } - } - doc_e=doc_e->next; - } - DocDel(doc_in); - return res; -} -public I64 Words(U8 *files_find_mask="*",U32 *chars_bmp=chars_bmp_alpha, - U8 *fu_flags=NULL) -{//Break file into list of not-unique words. - I64 fuf_flags=0,res=0; - CDoc *doc_out=DocNew; - CDirEntry *tempde,*tempde1; - ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+T"); - ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); - tempde=tempde1=FilesFind(files_find_mask,fuf_flags); - while (tempde) { - res+=DocWordsFile(doc_out,tempde->full_name,chars_bmp); - tempde=tempde->next; - } - DirTreeDel(tempde1); - DocInsDoc(NULL,doc_out); - DocDel(doc_out); - return res; -} - -I64 LongLinesFile(U8 *filename,I64 cols) -{ - I64 res=0; - CDoc *doc=DocRead(filename); - CDocEntry *doc_e=doc->head.next; - while (doc_e!=doc) { - if (doc_e->type_u8==DOCT_NEW_LINE && doc_e->x>=cols+1) - res++; - doc_e=doc_e->next; - } - DocDel(doc); - if (res) { - "%04d ",res; - PutFileLink(filename); - '\n'; - } - return res; -} -public I64 LongLines(U8 *files_find_mask="*",I64 cols=80,U8 *fu_flags=NULL) -{//Report files with lines of too many cols. - I64 res=0,fuf_flags=0; - CDirEntry *tempde,*tempde1; - ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+S"); - ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); - tempde=tempde1=FilesFind(files_find_mask,fuf_flags); - while (tempde) { - if (LongLinesFile(tempde->full_name,cols)) - res++; - tempde=tempde->next; - } - DirTreeDel(tempde1); - return res; -} - -U0 SUFile(U8 *filename,I64 suf_flags,F64 indent_scale_factor) -{//String utility on a single file -//See $LK,"SU Flags",A="MN:SUF_SINGLE_SPACE"$ - U8 *dst; - Bool chged=FALSE; - I64 reduced=0; - CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR); - CDocEntry *doc_e=doc->head.next; - while (doc_e!=doc) { - if (doc_e->type_u8==DOCT_TEXT) { - dst=MStrUtil(doc_e->tag,suf_flags,indent_scale_factor); - if (StrCmp(dst,doc_e->tag)) { - reduced+=StrLen(doc_e->tag)-StrLen(dst); - chged=TRUE; - Free(doc_e->tag); - doc_e->tag=dst; - } else - Free(dst); - } - doc_e=doc_e->next; - } - if (chged) { - "Reduced %s by %d chars\n",filename,reduced; - DocWrite(doc); - } - DocDel(doc); -} -public U0 SU(U8 *files_find_mask,I64 suf_flags,U8 *fu_flags=NULL, - F64 indent_scale_factor=0) -{//Apply $LK,"StrUtil",A="MN:StrUtil"$() on files -//You can convert spaces to tabs, for example, - //or removing trailing spaces on lines. - //See $LK,"SUF Flags",A="MN:SUF_SINGLE_SPACE"$. - I64 fuf_flags=0; - CDirEntry *tempde,*tempde1; - ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+f+F+T"); - ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); - tempde=tempde1=FilesFind(files_find_mask,fuf_flags); - while (tempde) { - SUFile(tempde->full_name,suf_flags,indent_scale_factor); - tempde=tempde->next; - } - DirTreeDel(tempde1); -} - -public U0 S2T(U8 *files_find_mask,U8 *fu_flags=NULL) -{//Spaces to tabs. -//Use "Hard Space" (SHIFT-SPACE) for spaces - //in string consts in your code. - SU(files_find_mask,SUF_S2T|SUF_REM_TRAILING,fu_flags); -} diff --git a/Adam/Opt/Utils/StrUtils.HC b/Adam/Opt/Utils/StrUtils.HC new file mode 100644 index 0000000..3e4c457 --- /dev/null +++ b/Adam/Opt/Utils/StrUtils.HC @@ -0,0 +1,206 @@ +#help_index "Cmd Line (Typically)" + +I64 DEPtrCompare(CDocEntry **e1,CDocEntry **e2) +{ + return StrCmp((*e1)->tag,(*e2)->tag); +} + +public I64 Sort(U8 *_in_name,U8 *_out_name=NULL, + I64 entry_lines=1,Bool unique=FALSE) +{//Sort lines of a text file. Removes blank lines. + U8 *in_name,*out_name,*st; + CDoc *doc; + CDocEntry *doc_e,*doc_e1,**a; + I64 i,j,cnt=0,res; + + if (!_in_name) return 0; + in_name=DftExt(_in_name,"DD.Z"); + if (_out_name) + out_name=DftExt(_out_name,"DD.Z"); + else + out_name=StrNew(in_name); + + doc=DocRead(in_name,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR); + doc_e=doc->head.next; + while (doc_e!=doc) { + if (doc_e->type_u8==DOCT_TEXT) + cnt++; + doc_e=doc_e->next; + } + a=MAlloc(cnt*sizeof(CDocEntry *)); + doc_e=doc->head.next; + i=0; + while (doc_e!=doc) { + doc_e1=doc_e->next; + if (doc_e->type_u8==DOCT_TEXT) { + QueRem(doc_e); + a[i++]=doc_e; + } else + DocEntryDel(doc,doc_e); + doc_e=doc_e1; + } + QSort(a,cnt/entry_lines,entry_lines*sizeof(CDocEntry *),&DEPtrCompare); + + res=0; + st=NULL; + for (i=0;itag,st)) { + st=a[i]->tag; + for (j=0;jhead.last); + doc->cur_entry=&doc->head; + doc->cur_col=0; + DocPrint(doc,"\n"); + } + res++; + } else + for (j=0;jhead.last); + DocEntryDel(doc,a[i]); + } + } + StrCpy(doc->filename.name,out_name); + DocWrite(doc); + + Free(a); + DocDel(doc); + Free(in_name); + Free(out_name); + return res; //Num Entries +} + +I64 DocWordsFile(CDoc *doc_out=NULL,U8 *filename,U32 *chars_bmp) +{ + U8 *ptr,*ptr2; + I64 res=0,ch; + CDoc *doc_in=DocRead(filename); + CDocEntry *doc_e=doc_in->head.next; + while (doc_e!=doc_in) { + if (doc_e->de_flags & DOCEF_TAG) { + ptr=doc_e->tag; + while (*ptr) { + while (*ptr && !Bt(chars_bmp,*ptr)) + ptr++; + + ptr2=ptr; + while (*ptr && Bt(chars_bmp,*ptr)) + ptr++; + + ch=*ptr; + *ptr=0; + if (*ptr2) { + DocPrint(doc_out,"%s\n",ptr2); + res++; + } + *ptr=ch; + } + } + doc_e=doc_e->next; + } + DocDel(doc_in); + return res; +} +public I64 Words(U8 *files_find_mask="*",U32 *chars_bmp=chars_bmp_alpha, + U8 *fu_flags=NULL) +{//Break file into list of not-unique words. + I64 fuf_flags=0,res=0; + CDoc *doc_out=DocNew; + CDirEntry *tempde,*tempde1; + ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+T"); + ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); + tempde=tempde1=FilesFind(files_find_mask,fuf_flags); + while (tempde) { + res+=DocWordsFile(doc_out,tempde->full_name,chars_bmp); + tempde=tempde->next; + } + DirTreeDel(tempde1); + DocInsDoc(NULL,doc_out); + DocDel(doc_out); + return res; +} + +I64 LongLinesFile(U8 *filename,I64 cols) +{ + I64 res=0; + CDoc *doc=DocRead(filename); + CDocEntry *doc_e=doc->head.next; + while (doc_e!=doc) { + if (doc_e->type_u8==DOCT_NEW_LINE && doc_e->x>=cols+1) + res++; + doc_e=doc_e->next; + } + DocDel(doc); + if (res) { + "%04d ",res; + PutFileLink(filename); + '\n'; + } + return res; +} +public I64 LongLines(U8 *files_find_mask="*",I64 cols=80,U8 *fu_flags=NULL) +{//Report files with lines of too many cols. + I64 res=0,fuf_flags=0; + CDirEntry *tempde,*tempde1; + ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+S"); + ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); + tempde=tempde1=FilesFind(files_find_mask,fuf_flags); + while (tempde) { + if (LongLinesFile(tempde->full_name,cols)) + res++; + tempde=tempde->next; + } + DirTreeDel(tempde1); + return res; +} + +U0 SUFile(U8 *filename,I64 suf_flags,F64 indent_scale_factor) +{//String utility on a single file +//See $LK,"SU Flags",A="MN:SUF_SINGLE_SPACE"$ + U8 *dst; + Bool chged=FALSE; + I64 reduced=0; + CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR); + CDocEntry *doc_e=doc->head.next; + while (doc_e!=doc) { + if (doc_e->type_u8==DOCT_TEXT) { + dst=MStrUtil(doc_e->tag,suf_flags,indent_scale_factor); + if (StrCmp(dst,doc_e->tag)) { + reduced+=StrLen(doc_e->tag)-StrLen(dst); + chged=TRUE; + Free(doc_e->tag); + doc_e->tag=dst; + } else + Free(dst); + } + doc_e=doc_e->next; + } + if (chged) { + "Reduced %s by %d chars\n",filename,reduced; + DocWrite(doc); + } + DocDel(doc); +} +public U0 SU(U8 *files_find_mask,I64 suf_flags,U8 *fu_flags=NULL, + F64 indent_scale_factor=0) +{//Apply $LK,"StrUtil",A="MN:StrUtil"$() on files +//You can convert spaces to tabs, for example, + //or removing trailing spaces on lines. + //See $LK,"SUF Flags",A="MN:SUF_SINGLE_SPACE"$. + I64 fuf_flags=0; + CDirEntry *tempde,*tempde1; + ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+f+F+T"); + ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); + tempde=tempde1=FilesFind(files_find_mask,fuf_flags); + while (tempde) { + SUFile(tempde->full_name,suf_flags,indent_scale_factor); + tempde=tempde->next; + } + DirTreeDel(tempde1); +} + +public U0 S2T(U8 *files_find_mask,U8 *fu_flags=NULL) +{//Spaces to tabs. +//Use "Hard Space" (SHIFT-SPACE) for spaces + //in string consts in your code. + SU(files_find_mask,SUF_S2T|SUF_REM_TRAILING,fu_flags); +} diff --git a/Adam/Opt/Utils/ToDolDoc.CPP b/Adam/Opt/Utils/ToDolDoc.CPP deleted file mode 100644 index 83ca901..0000000 --- a/Adam/Opt/Utils/ToDolDoc.CPP +++ /dev/null @@ -1,19 +0,0 @@ -#help_index "Cmd Line (Typically);DolDoc/Conversion;DolDoc/Cmd Line (Typically)" - -public U0 ToDolDoc(U8 *files_find_mask,U8 *fu_flags=NULL) -{//Convert text file to $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$ by making double $$'s. - CDoc *doc; - I64 fuf_flags=0; - CDirEntry *tempde,*tempde1; - ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F"); - ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); - tempde=tempde1=FilesFind(files_find_mask,fuf_flags); - while (tempde) { - "%s\n",tempde->full_name; - doc=DocRead(tempde->full_name,DOCF_PLAIN_TEXT|DOCF_DBL_DOLLARS); - DocWrite(doc); - DocDel(doc); - tempde=tempde->next; - } - DirTreeDel(tempde1); -} diff --git a/Adam/Opt/Utils/ToDolDoc.HC b/Adam/Opt/Utils/ToDolDoc.HC new file mode 100644 index 0000000..b82038f --- /dev/null +++ b/Adam/Opt/Utils/ToDolDoc.HC @@ -0,0 +1,19 @@ +#help_index "Cmd Line (Typically);DolDoc/Conversion;DolDoc/Cmd Line (Typically)" + +public U0 ToDolDoc(U8 *files_find_mask,U8 *fu_flags=NULL) +{//Convert text file to $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ by making double $$'s. + CDoc *doc; + I64 fuf_flags=0; + CDirEntry *tempde,*tempde1; + ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F"); + ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); + tempde=tempde1=FilesFind(files_find_mask,fuf_flags); + while (tempde) { + "%s\n",tempde->full_name; + doc=DocRead(tempde->full_name,DOCF_PLAIN_TEXT|DOCF_DBL_DOLLARS); + DocWrite(doc); + DocDel(doc); + tempde=tempde->next; + } + DirTreeDel(tempde1); +} diff --git a/Adam/Opt/Utils/ToTXT.CPP b/Adam/Opt/Utils/ToTXT.CPP deleted file mode 100644 index 7e8977f..0000000 --- a/Adam/Opt/Utils/ToTXT.CPP +++ /dev/null @@ -1,130 +0,0 @@ -#help_index "DolDoc/Conversion" - -U0 TXTPutS(CDoc *doc,U8 *st,I64 *_col) -{ - U8 *ch,*ptr; - while (ch=*st++) { - switch (ch) { - case '\t': - do { - DocPutKey(doc,CH_SPACE,0); - *_col=*_col+1; - } while (*_col&7); - break; - - start: - case 'ã': ptr="pi"; break; - case 'é': ptr="theta"; break; - case 'è': ptr="phi"; break; - case 'ê': ptr="omega"; break; - case 'ì': ptr="inf"; break; - case 'æ': ptr="u"; break; - case CH_SHIFT_SPACE: ptr=" "; break; - end: - DocPrint(doc,ptr); - *_col=*_col+StrLen(ptr); - break; - - default: - if (CH_SPACE<=ch<0x7F || ch=='\n') - DocPutKey(doc,ch,0); - else - DocPrint(doc,"."); - *_col=*_col+1; - } - } -} - -public CDoc *Doc2TXT(CDoc *doc_in) -{//Cvt $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$ doc to plain text. - CDocEntry *doc_e,*doc_e2; - I64 y,col; - CDoc *doc_out=DocNew; - Bool unlock_doc_in=DocLock(doc_in),no_bwd; - - DocRecalc(doc_in); - - doc_out->flags|=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR; - - doc_e=doc_in->head.next; - col=doc_e->x; - y=doc_e->y; - while (doc_e!=doc_in) { - if (!(doc_e->de_flags&DOCEF_SKIP)) { - while (yy) { - TXTPutS(doc_out,"\n",&col); - y++; - col=0; - } - - no_bwd=TRUE; - doc_e2=doc_e->next; - while (doc_e2!=doc_in && doc_e2->y==doc_e->y) { - if (doc_e2->xx) { - no_bwd=FALSE; - break; - } - doc_e2=doc_e2->next; - } - if (no_bwd) - while (colx) - TXTPutS(doc_out," ",&col); - - switch (doc_e->type_u8) { - case DOCT_TEXT: - TXTPutS(doc_out,doc_e->tag,&col); - break; - case DOCT_TAB: - TXTPutS(doc_out,"\t",&col); - break; - case DOCT_HTML_CODE: - break; - case DOCT_SPRITE: - break; - default: - if (doc_e->de_flags&DOCEF_TAG) - TXTPutS(doc_out,doc_e->tag,&col); - } - } - doc_e=doc_e->next; - } - while (yy) { - TXTPutS(doc_out,"\n",&col); - y++; - col=0; - } - doc_out->cur_entry=&doc_out->head; - DocRecalc(doc_out); - - if (unlock_doc_in) - DocUnlock(doc_in); - return doc_out; -} - -#help_index "Cmd Line (Typically);DolDoc/Conversion;DolDoc/Cmd Line (Typically)" -public U0 ToTXT(U8 *_in_name,U8 *_out_name=NULL,I64 width=70) -{//Convert $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$file to plain text. - U8 *in_name,*out_name; - CDoc *doc_in,*doc_out; - - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - WinHorz(0,width-1); //Sets doc width for word wrap. - - in_name=DftExt(_in_name,"TXT.Z"); - if (_out_name) - out_name=DftExt(_out_name,"TXT"); - else - out_name=ChgExt(_in_name,"TXT"); - - doc_in=DocRead(in_name); - doc_out=Doc2TXT(doc_in); - StrCpy(&doc_out->filename.name,out_name); - - SettingsPop; - - DocWrite(doc_out); - DocDel(doc_in); - DocDel(doc_out); - Free(in_name); - Free(out_name); -} diff --git a/Adam/Opt/Utils/ToTXT.HC b/Adam/Opt/Utils/ToTXT.HC new file mode 100644 index 0000000..6e638b6 --- /dev/null +++ b/Adam/Opt/Utils/ToTXT.HC @@ -0,0 +1,130 @@ +#help_index "DolDoc/Conversion" + +U0 TXTPutS(CDoc *doc,U8 *st,I64 *_col) +{ + U8 *ch,*ptr; + while (ch=*st++) { + switch (ch) { + case '\t': + do { + DocPutKey(doc,CH_SPACE,0); + *_col=*_col+1; + } while (*_col&7); + break; + + start: + case 'ã': ptr="pi"; break; + case 'é': ptr="theta"; break; + case 'è': ptr="phi"; break; + case 'ê': ptr="omega"; break; + case 'ì': ptr="inf"; break; + case 'æ': ptr="u"; break; + case CH_SHIFT_SPACE: ptr=" "; break; + end: + DocPrint(doc,ptr); + *_col=*_col+StrLen(ptr); + break; + + default: + if (CH_SPACE<=ch<0x7F || ch=='\n') + DocPutKey(doc,ch,0); + else + DocPrint(doc,"."); + *_col=*_col+1; + } + } +} + +public CDoc *Doc2TXT(CDoc *doc_in) +{//Cvt $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ doc to plain text. + CDocEntry *doc_e,*doc_e2; + I64 y,col; + CDoc *doc_out=DocNew; + Bool unlock_doc_in=DocLock(doc_in),no_bwd; + + DocRecalc(doc_in); + + doc_out->flags|=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR; + + doc_e=doc_in->head.next; + col=doc_e->x; + y=doc_e->y; + while (doc_e!=doc_in) { + if (!(doc_e->de_flags&DOCEF_SKIP)) { + while (yy) { + TXTPutS(doc_out,"\n",&col); + y++; + col=0; + } + + no_bwd=TRUE; + doc_e2=doc_e->next; + while (doc_e2!=doc_in && doc_e2->y==doc_e->y) { + if (doc_e2->xx) { + no_bwd=FALSE; + break; + } + doc_e2=doc_e2->next; + } + if (no_bwd) + while (colx) + TXTPutS(doc_out," ",&col); + + switch (doc_e->type_u8) { + case DOCT_TEXT: + TXTPutS(doc_out,doc_e->tag,&col); + break; + case DOCT_TAB: + TXTPutS(doc_out,"\t",&col); + break; + case DOCT_HTML_CODE: + break; + case DOCT_SPRITE: + break; + default: + if (doc_e->de_flags&DOCEF_TAG) + TXTPutS(doc_out,doc_e->tag,&col); + } + } + doc_e=doc_e->next; + } + while (yy) { + TXTPutS(doc_out,"\n",&col); + y++; + col=0; + } + doc_out->cur_entry=&doc_out->head; + DocRecalc(doc_out); + + if (unlock_doc_in) + DocUnlock(doc_in); + return doc_out; +} + +#help_index "Cmd Line (Typically);DolDoc/Conversion;DolDoc/Cmd Line (Typically)" +public U0 ToTXT(U8 *_in_name,U8 *_out_name=NULL,I64 width=70) +{//Convert $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$file to plain text. + U8 *in_name,*out_name; + CDoc *doc_in,*doc_out; + + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + WinHorz(0,width-1); //Sets doc width for word wrap. + + in_name=DftExt(_in_name,"DD.Z"); + if (_out_name) + out_name=DftExt(_out_name,"TXT"); + else + out_name=ChgExt(_in_name,"TXT"); + + doc_in=DocRead(in_name); + doc_out=Doc2TXT(doc_in); + StrCpy(&doc_out->filename.name,out_name); + + SettingsPop; + + DocWrite(doc_out); + DocDel(doc_in); + DocDel(doc_out); + Free(in_name); + Free(out_name); +} diff --git a/Adam/Snd/MakeSnd.CPP b/Adam/Snd/MakeSnd.HC similarity index 100% rename from Adam/Snd/MakeSnd.CPP rename to Adam/Snd/MakeSnd.HC diff --git a/Adam/Snd/SndEffects.CPP b/Adam/Snd/SndEffects.CPP deleted file mode 100644 index 542e738..0000000 --- a/Adam/Snd/SndEffects.CPP +++ /dev/null @@ -1,76 +0,0 @@ -#help_index "Snd" - -#define SE_NOISE 0 -#define SE_SWEEP 1 - -class CSoundEffectFrame -{ - I32 type; - F64 duration,freq1,freq2; -}; - -U0 SoundEffectEndTaskCB() -{ - Free(FramePtr("CSoundEffectFrame")); - music.mute--; - SndTaskEndCB; -} - -U0 SoundEffectTask(CSoundEffectFrame *ns) -{ - I64 i; - F64 f,t0=tS,t,timeout=t0+ns->duration; - FramePtrAdd("CSoundEffectFrame",ns); - Fs->task_end_cb=&SoundEffectEndTaskCB; - switch (ns->type) { - case SE_NOISE: - i=MaxI64(ns->freq2-ns->freq1,1); - while (tSfreq1) { - Snd(f); - Sleep(ClampI64(3000/f,1,50)); - } else - break; - break; - case SE_SWEEP: - while (tSduration; - if (f=(1.0-t)*ns->freq1+t*ns->freq2) { - Snd(f); - Sleep(ClampI64(3000/f,1,50)); - } else - break; - } - break; - } -} - -public CTask *Noise(I64 mS,F64 min_freq,F64 max_freq) -{//Make white noise for given number of mS. - CSoundEffectFrame *ns; - if (mS>0) { - ns=MAlloc(sizeof(CSoundEffectFrame)); - ns->type=SE_NOISE; - ns->duration=mS/1000.0; - ns->freq1=min_freq; - ns->freq2=max_freq; - music.mute++; - return Spawn(&SoundEffectTask,ns,"Noise",,Fs); - } else - return NULL; -} - -public CTask *Sweep(I64 mS,F64 freq1,F64 freq2) -{//Sweep through freq range in given number of mS. - CSoundEffectFrame *ns; - if (mS>0) { - ns=MAlloc(sizeof(CSoundEffectFrame)); - ns->type=SE_SWEEP; - ns->duration=mS/1000.0; - ns->freq1=freq1; - ns->freq2=freq2; - music.mute++; - return Spawn(&SoundEffectTask,ns,"Noise",,Fs); - } else - return NULL; -} diff --git a/Adam/Snd/SndEffects.HC b/Adam/Snd/SndEffects.HC new file mode 100644 index 0000000..dd27a02 --- /dev/null +++ b/Adam/Snd/SndEffects.HC @@ -0,0 +1,76 @@ +#help_index "Snd" + +#define SE_NOISE 0 +#define SE_SWEEP 1 + +class CSoundEffectFrame +{ + I32 type; + F64 duration,freq1,freq2; +}; + +U0 SoundEffectEndTaskCB() +{ + Free(FramePtr("CSoundEffectFrame")); + music.mute--; + SndTaskEndCB; +} + +U0 SoundEffectTask(CSoundEffectFrame *ns) +{ + I64 i; + F64 f,t0=tS,t,timeout=t0+ns->duration; + FramePtrAdd("CSoundEffectFrame",ns); + Fs->task_end_cb=&SoundEffectEndTaskCB; + switch (ns->type) { + case SE_NOISE: + i=MaxI64(ns->freq2-ns->freq1,1); + while (tSfreq1) { + Snd(f); + Sleep(ClampI64(3000/f,1,50)); + } else + break; + break; + case SE_SWEEP: + while (tSduration; + if (f=(1.0-t)*ns->freq1+t*ns->freq2) { + Snd(f); + Sleep(ClampI64(3000/f,1,50)); + } else + break; + } + break; + } +} + +public CTask *Noise(I64 ms,F64 min_freq,F64 max_freq) +{//Make white noise for given number of ms. + CSoundEffectFrame *ns; + if (ms>0) { + ns=MAlloc(sizeof(CSoundEffectFrame)); + ns->type=SE_NOISE; + ns->duration=ms/1000.0; + ns->freq1=min_freq; + ns->freq2=max_freq; + music.mute++; + return Spawn(&SoundEffectTask,ns,"Noise",,Fs); + } else + return NULL; +} + +public CTask *Sweep(I64 ms,F64 freq1,F64 freq2) +{//Sweep through freq range in given number of ms. + CSoundEffectFrame *ns; + if (ms>0) { + ns=MAlloc(sizeof(CSoundEffectFrame)); + ns->type=SE_SWEEP; + ns->duration=ms/1000.0; + ns->freq1=freq1; + ns->freq2=freq2; + music.mute++; + return Spawn(&SoundEffectTask,ns,"Noise",,Fs); + } else + return NULL; +} diff --git a/Adam/Snd/SndFile.CPP b/Adam/Snd/SndFile.HC similarity index 100% rename from Adam/Snd/SndFile.CPP rename to Adam/Snd/SndFile.HC diff --git a/Adam/Snd/SndMath.CPP b/Adam/Snd/SndMath.HC similarity index 100% rename from Adam/Snd/SndMath.CPP rename to Adam/Snd/SndMath.HC diff --git a/Adam/Snd/SndMusic.CPP b/Adam/Snd/SndMusic.HC similarity index 100% rename from Adam/Snd/SndMusic.CPP rename to Adam/Snd/SndMusic.HC diff --git a/Adam/TaskRep.CPP b/Adam/TaskRep.HC similarity index 100% rename from Adam/TaskRep.CPP rename to Adam/TaskRep.HC diff --git a/Adam/TaskSettings.CPP b/Adam/TaskSettings.HC similarity index 100% rename from Adam/TaskSettings.CPP rename to Adam/TaskSettings.HC diff --git a/Adam/Training.CPP b/Adam/Training.CPP deleted file mode 100644 index 14dc6ec..0000000 --- a/Adam/Training.CPP +++ /dev/null @@ -1,184 +0,0 @@ -#help_index "Help System" - -U8 *KeyMapKeyMStrPrint(I64 sc,U0 (*fp_handler)(I64 sc), - U8 *desc,CTask *task=NULL) -{ - I64 i=9,k,c; - U8 *st,*st2,*res,*ptr; - CHashTable *old_hash=Fs->hash_table; - st=ScanCode2KeyName(sc); - if (sc&SCF_CTRL) i+=5; - if (sc&SCF_ALT) i+=4; - if (sc&(SCF_SHIFT|SCF_NO_SHIFT)) i+=6; - if (TaskValidate(task)) - Fs->hash_table=task->hash_table; - st2=SrcEdLink(fp_handler,256); - Fs->hash_table=old_hash; - - k=*desc(U32 *); - if (k=='Edit') c=BLUE; - else if (k=='Dol ') c=GREEN; - else if (k=='Cmd ') c=RED; - else c=BLACK; - - res=MStrPrint("%-*s $$FG,%d$$$$TX+UL+L+PU,\"%$$Q\",A=\"%s\"$$$$FG$$\n", - i,st,c,desc,st2); - Free(st); - Free(st2); - - ptr=res; - while (*ptr) { - if (*ptr==CH_SPACE) - *ptr=CH_SHIFT_SPACE; - ptr++; - } - - return res; -} - -U0 KeyMapKeyPrint(I64 sc,U0 (*fp_handler)(I64 sc),U8 *desc,CTask *task=NULL) -{ - U8 *st=KeyMapKeyMStrPrint(sc,fp_handler,desc,task); - "%s",st; - Free(st); -} - -U0 KeyMapCtrlAltFamily(Bool no_shift,Bool shift) -{ - I64 i,no_shift_f; - if (no_shift && shift) - no_shift_f=SCF_NO_SHIFT; - else - no_shift_f=0; - if (no_shift) KeyMapKeyPrint(SC_DELETE+SCF_CTRL+SCF_ALT+no_shift_f, - &Reboot,"Cmd /Reboot"); - if (no_shift) KeyMapKeyPrint(SC_ESC+SCF_CTRL+SCF_ALT+no_shift_f, - &User,"Cmd /Terminal Window"); - if (no_shift) KeyMapKeyPrint(SC_TAB+SCF_CTRL+SCF_ALT+no_shift_f, - &WinToTop,"Cmd /Next Focus Task"); - - for (i=0;i<26;i++) - if (keydev.fp_ctrl_alt_cbs[i]) { - if (no_shift && keydev.ctrl_alt_no_shift_descs[i]) - KeyMapKeyPrint(Char2ScanCode(i+'a')+SCF_CTRL+SCF_ALT+no_shift_f, - keydev.fp_ctrl_alt_cbs[i],keydev.ctrl_alt_no_shift_descs[i]); - if (shift && keydev.ctrl_alt_shift_descs[i]) - KeyMapKeyPrint(Char2ScanCode(i+'a')+SCF_CTRL+SCF_ALT+SCF_SHIFT, - keydev.fp_ctrl_alt_cbs[i],keydev.ctrl_alt_shift_descs[i]); - } -} - -U0 KMComparePrepare(U8 *buf,I64 *src) -{ - I64 i,*dst=buf; - U8 *ptr; - if (src) { - *dst++=*src++; - *dst++=*src++; - *dst++=*src++; - *dst++=*src++; - *dst(U8 *)=0; - if (ptr=StrMatch("SHIFT",buf)) { - for (i=0;i<5;i++) - ptr[i]=CH_SHIFT_SPACE; - if (ptr=StrMatch("$$",buf)) - *ptr=255; - } - } else - *buf=0; -} - -I64 KMCompare(U8 *e1,U8 *e2) -{ - U8 buf1[STR_LEN],buf2[STR_LEN]; - KMComparePrepare(buf1,e1); - KMComparePrepare(buf2,e2); - return StrCmp(buf1,buf2); -} - -U0 KeyMapFamily2(U8 **entries,CTask *task,I64 scf) -{ - I64 i,a1,a2; - for (i=0;i<256;i++) { - a2=scf|i|SCF_KEY_DESC; - a1=ScanCode2Char(a2); - *keydev.desc=0; - keydev.handler=NULL; - if (TaskValidate(task) && !Bt(&task->win_inhibit,WIf_SELF_KEY_DESC)) { - if (task==Fs) - PutKey(a1,a2); - else - PostMsg(task,MSG_KEY_DOWN,a1,a2); - WinMgrSync(0,TRUE); - Sleep(1); //Open loop because might be no response. TODO: Drops msgs. - } - if (*keydev.desc && StrNCmp(keydev.desc,"Char /",7)) - entries[i]=KeyMapKeyMStrPrint(a2,keydev.handler,keydev.desc,task); - } -} - -U0 KeyMapFamily(CTask *task,I64 scf,Bool no_shift,Bool shift) -{ - I64 i,cnt=0; - U8 **entries=CAlloc(2*256*sizeof(U8 *)),**ptr=entries; - if (no_shift) { - if (shift) - KeyMapFamily2(ptr,task,scf+SCF_NO_SHIFT); - else - KeyMapFamily2(ptr,task,scf); - ptr+=256; - cnt+=256; - } - if (shift) { - KeyMapFamily2(ptr,task,scf+SCF_SHIFT); - ptr+=256; - cnt+=256; - } - QSortI64(entries,cnt,&KMCompare); - for (i=0;iwin_inhibit,WIf_SELF_KEY_DESC); - DocMax; - KeyMapFamily(task,0,TRUE,TRUE); - KeyMapFamily(task,SCF_CTRL,TRUE,TRUE); - KeyMapFamily(task,SCF_ALT,TRUE,TRUE); - KeyMapCtrlAltFamily(TRUE,TRUE); - LBEqu(&task->win_inhibit,WIf_SELF_KEY_DESC,old_key_desc); - "\nKeyMap Completed.\n"; -} - -#help_index "Help System/Training" -public U0 TipOfDay(U8 *tip_file="::/Doc/Tips.TXT") -{//Print random tip-of-day from ::/Doc/Tips.TXT. - I64 i=RandU16; - CDoc *doc=DocRead(tip_file),*doc2=DocNew; - CDocEntry *doc_e=doc->head.next; - "$$WW,1$$\n"; - while (TRUE) { - if (doc_e->type_u8==DOCT_TEXT && *doc_e->tag=='*') - if (!i--) break; - doc_e=doc_e->next; - } - if (doc_e->type_u8==DOCT_TEXT && *doc_e->tag=='*') { - while (doc_e!=doc) { - if (doc_e->type_u8!=DOCT_ERROR) - DocInsEntry(doc2,DocEntryCopy(doc2,doc_e)); - doc_e=doc_e->next; - if (doc_e->type_u8==DOCT_TEXT && *doc_e->tag=='*') - break; - } - } - DocInsDoc(DocPut,doc2); - DocDel(doc2); - DocDel(doc); -} diff --git a/Adam/Training.HC b/Adam/Training.HC new file mode 100644 index 0000000..304a0c1 --- /dev/null +++ b/Adam/Training.HC @@ -0,0 +1,184 @@ +#help_index "Help System" + +U8 *KeyMapKeyMStrPrint(I64 sc,U0 (*fp_handler)(I64 sc), + U8 *desc,CTask *task=NULL) +{ + I64 i=9,k,c; + U8 *st,*st2,*res,*ptr; + CHashTable *old_hash=Fs->hash_table; + st=ScanCode2KeyName(sc); + if (sc&SCF_CTRL) i+=5; + if (sc&SCF_ALT) i+=4; + if (sc&(SCF_SHIFT|SCF_NO_SHIFT)) i+=6; + if (TaskValidate(task)) + Fs->hash_table=task->hash_table; + st2=SrcEdLink(fp_handler,256); + Fs->hash_table=old_hash; + + k=*desc(U32 *); + if (k=='Edit') c=BLUE; + else if (k=='Dol ') c=GREEN; + else if (k=='Cmd ') c=RED; + else c=BLACK; + + res=MStrPrint("%-*s $$FG,%d$$$$TX+UL+L+PU,\"%$$Q\",A=\"%s\"$$$$FG$$\n", + i,st,c,desc,st2); + Free(st); + Free(st2); + + ptr=res; + while (*ptr) { + if (*ptr==CH_SPACE) + *ptr=CH_SHIFT_SPACE; + ptr++; + } + + return res; +} + +U0 KeyMapKeyPrint(I64 sc,U0 (*fp_handler)(I64 sc),U8 *desc,CTask *task=NULL) +{ + U8 *st=KeyMapKeyMStrPrint(sc,fp_handler,desc,task); + "%s",st; + Free(st); +} + +U0 KeyMapCtrlAltFamily(Bool no_shift,Bool shift) +{ + I64 i,no_shift_f; + if (no_shift && shift) + no_shift_f=SCF_NO_SHIFT; + else + no_shift_f=0; + if (no_shift) KeyMapKeyPrint(SC_DELETE+SCF_CTRL+SCF_ALT+no_shift_f, + &Reboot,"Cmd /Reboot"); + if (no_shift) KeyMapKeyPrint(SC_ESC+SCF_CTRL+SCF_ALT+no_shift_f, + &User,"Cmd /Terminal Window"); + if (no_shift) KeyMapKeyPrint(SC_TAB+SCF_CTRL+SCF_ALT+no_shift_f, + &WinToTop,"Cmd /Next Focus Task"); + + for (i=0;i<26;i++) + if (keydev.fp_ctrl_alt_cbs[i]) { + if (no_shift && keydev.ctrl_alt_no_shift_descs[i]) + KeyMapKeyPrint(Char2ScanCode(i+'a')+SCF_CTRL+SCF_ALT+no_shift_f, + keydev.fp_ctrl_alt_cbs[i],keydev.ctrl_alt_no_shift_descs[i]); + if (shift && keydev.ctrl_alt_shift_descs[i]) + KeyMapKeyPrint(Char2ScanCode(i+'a')+SCF_CTRL+SCF_ALT+SCF_SHIFT, + keydev.fp_ctrl_alt_cbs[i],keydev.ctrl_alt_shift_descs[i]); + } +} + +U0 KMComparePrepare(U8 *buf,I64 *src) +{ + I64 i,*dst=buf; + U8 *ptr; + if (src) { + *dst++=*src++; + *dst++=*src++; + *dst++=*src++; + *dst++=*src++; + *dst(U8 *)=0; + if (ptr=StrMatch("SHIFT",buf)) { + for (i=0;i<5;i++) + ptr[i]=CH_SHIFT_SPACE; + if (ptr=StrMatch("$$",buf)) + *ptr=255; + } + } else + *buf=0; +} + +I64 KMCompare(U8 *e1,U8 *e2) +{ + U8 buf1[STR_LEN],buf2[STR_LEN]; + KMComparePrepare(buf1,e1); + KMComparePrepare(buf2,e2); + return StrCmp(buf1,buf2); +} + +U0 KeyMapFamily2(U8 **entries,CTask *task,I64 scf) +{ + I64 i,a1,a2; + for (i=0;i<256;i++) { + a2=scf|i|SCF_KEY_DESC; + a1=ScanCode2Char(a2); + *keydev.desc=0; + keydev.handler=NULL; + if (TaskValidate(task) && !Bt(&task->win_inhibit,WIf_SELF_KEY_DESC)) { + if (task==Fs) + PutKey(a1,a2); + else + PostMsg(task,MSG_KEY_DOWN,a1,a2); + WinMgrSync(0,TRUE); + Sleep(1); //Open loop because might be no response. TODO: Drops msgs. + } + if (*keydev.desc && StrNCmp(keydev.desc,"Char /",7)) + entries[i]=KeyMapKeyMStrPrint(a2,keydev.handler,keydev.desc,task); + } +} + +U0 KeyMapFamily(CTask *task,I64 scf,Bool no_shift,Bool shift) +{ + I64 i,cnt=0; + U8 **entries=CAlloc(2*256*sizeof(U8 *)),**ptr=entries; + if (no_shift) { + if (shift) + KeyMapFamily2(ptr,task,scf+SCF_NO_SHIFT); + else + KeyMapFamily2(ptr,task,scf); + ptr+=256; + cnt+=256; + } + if (shift) { + KeyMapFamily2(ptr,task,scf+SCF_SHIFT); + ptr+=256; + cnt+=256; + } + QSortI64(entries,cnt,&KMCompare); + for (i=0;iwin_inhibit,WIf_SELF_KEY_DESC); + DocMax; + KeyMapFamily(task,0,TRUE,TRUE); + KeyMapFamily(task,SCF_CTRL,TRUE,TRUE); + KeyMapFamily(task,SCF_ALT,TRUE,TRUE); + KeyMapCtrlAltFamily(TRUE,TRUE); + LBEqu(&task->win_inhibit,WIf_SELF_KEY_DESC,old_key_desc); + "\nKeyMap Completed.\n"; +} + +#help_index "Help System/Training" +public U0 TipOfDay(U8 *tip_file="::/Doc/Tips.DD") +{//Print random tip-of-day from ::/Doc/Tips.DD. + I64 i=RandU16; + CDoc *doc=DocRead(tip_file),*doc2=DocNew; + CDocEntry *doc_e=doc->head.next; + "$$WW,1$$\n"; + while (TRUE) { + if (doc_e->type_u8==DOCT_TEXT && *doc_e->tag=='*') + if (!i--) break; + doc_e=doc_e->next; + } + if (doc_e->type_u8==DOCT_TEXT && *doc_e->tag=='*') { + while (doc_e!=doc) { + if (doc_e->type_u8!=DOCT_ERROR) + DocInsEntry(doc2,DocEntryCopy(doc2,doc_e)); + doc_e=doc_e->next; + if (doc_e->type_u8==DOCT_TEXT && *doc_e->tag=='*') + break; + } + } + DocInsDoc(DocPut,doc2); + DocDel(doc2); + DocDel(doc); +} diff --git a/Adam/WallPaper.CPP b/Adam/WallPaper.HC similarity index 100% rename from Adam/WallPaper.CPP rename to Adam/WallPaper.HC diff --git a/Adam/WinA.CPP b/Adam/WinA.CPP deleted file mode 100644 index acb1085..0000000 --- a/Adam/WinA.CPP +++ /dev/null @@ -1,519 +0,0 @@ -#help_index "Windows" -#help_file "::/Doc/Windows" - -CIPStateGlbls old_ip={IP_NULL,{-1000,-1000,0},{-1000,-1000,0},{-1000,-1000,0}, - {0,0,0},{1.0,1.0,1.0}, - 0,(MAX_I32+1)>>3,0.0,GetTSC,0.350,0,0, - FALSE,FALSE,TRUE,FALSE,FALSE,FALSE,FALSE,FALSE -}; - -public CWinMgrGlbls winmgr={0,0,0,WINMGR_FPS,tS,NULL,NULL,FALSE,FALSE,FALSE}; -winmgr.t=CAlloc(sizeof(CWinMgrTimingGlbls)); -winmgr.t->last_calc_idle_time=tS; - -#define PROGRESS_BAR_HEIGHT 20 -#define PROGRESS_BAR_WIDTH (3*GR_WIDTH/4) - -U0 DrawProgressBars(CDC *dc) -{ - I64 i,j,k,n,m; - U8 *st; - for (i=0;icolor=BLACK; - GrRect(dc, - (GR_WIDTH-PROGRESS_BAR_WIDTH)/2, - (GR_HEIGHT-(NUM_PROGRESS_BARS*2-1-i*4)*PROGRESS_BAR_HEIGHT)/2, - PROGRESS_BAR_WIDTH,PROGRESS_BAR_HEIGHT); - - dc->color=LTGREEN; - n=sys_progresses[i].val; - if (n>m) - n=m; - GrRect(dc, - (GR_WIDTH-PROGRESS_BAR_WIDTH)/2+2, - (GR_HEIGHT-(NUM_PROGRESS_BARS*2-1-i*4)*PROGRESS_BAR_HEIGHT)/2+2, - n*(PROGRESS_BAR_WIDTH-4)/m, - PROGRESS_BAR_HEIGHT-4); - - if (m>1) { - dc->color=BLACK; - k=m-1; - if (k>19) k=19; - for (j=0;j<=k;j++) - GrLine(dc, - (GR_WIDTH-PROGRESS_BAR_WIDTH)/2+1+j* - (PROGRESS_BAR_WIDTH-4)/ToF64(k+1), - (GR_HEIGHT-(NUM_PROGRESS_BARS*2-1-i*4)* - PROGRESS_BAR_HEIGHT)/2+4, - (GR_WIDTH-PROGRESS_BAR_WIDTH)/2+1+j* - (PROGRESS_BAR_WIDTH-4)/ToF64(k+1), - (GR_HEIGHT-(NUM_PROGRESS_BARS*2-3-i*4)* - PROGRESS_BAR_HEIGHT)/2-4); - } - - dc->color=WHITE; - if (*sys_progresses[i].desc) - st=StrNew(sys_progresses[i].desc); - else - st=MStrPrint("%d/%d",n,m); - GrPrint(dc,(GR_WIDTH-FONT_WIDTH*StrLen(st))/2, - (GR_HEIGHT-FONT_HEIGHT- - (NUM_PROGRESS_BARS*2-2-i*4)*PROGRESS_BAR_HEIGHT)/2,"%s",st); - Free(st); - } - } -} - -U0 DrawWinGrid(CDC *dc) -{ - F64 d; - dc->color=BLACK; - dc->pen_width=1; - for (d=ip_grid.x_offset;d\n$$LTBLUE$$"); - for (i=0;i<256;i++) { - if (i>=CH_SHIFT_SPACE && i!=0x7F) { - if (i==CH_SHIFT_SPACE) - DocPrint(doc,"$$MU-UL,\"\\x1F\",LE=%d$$",i); - else if (i=='$$') - DocPrint(doc,"$$MU-UL,\"\\x24\",LE=%d$$",i); - else if (i=='\"'||i=='\\') - DocPrint(doc,"$$MU-UL,\"\\%c\",LE=%d$$",i,i); - else - DocPrint(doc,"$$MU-UL,\"%c\",LE=%d$$",i,i); - } else - DocPrint(doc," "); - if (i&15==15) - DocPrint(doc,"\n"); - } - i=PopUpMenu(doc); - DocDel(doc); - if (i>=0) - PostMsg(ext_ASCII_task,MSG_KEY_DOWN_UP,i,Char2ScanCode(i)); -} - -U0 CtrlAltA(I64) -{ - if (ext_ASCII_task=sys_focus_task) - Spawn(&ExtendedASCII); -} -CtrlAltCBSet('A',&CtrlAltA,"Cmd /Extended ASCII"); - -public U0 WinScrollNull(CTask *task,CD3I64 *s) -{//If panning a window has been done, restore to zero. - s->x=task->scroll_x; - s->y=task->scroll_y; - s->z=task->scroll_z; - task->scroll_x=0; - task->scroll_y=0; - task->scroll_z=0; -} - -public U0 WinScrollRestore(CTask *task,CD3I64 *s) -{//Set window pan value to stored value. - task->scroll_x=s->x; - task->scroll_y=s->y; - task->scroll_z=s->z; -} - -U0 DrawInputPtr(CDC *dc) -{ - I64 x,y; - PUSHFD - CLI - x=ip.pos.x; - y=ip.pos.y; - POPFD - if (ip.show && ip.dev!=IP_NULL) { - if (!Bt(&sys_run_level,RLf_VGA)) //if text mode - gr.text_base[ip.pos_text.x+ip.pos_text.y*TEXT_COLS]^=0x7F00; - else { - if (gr.fp_draw_input_ptr) { - if (ip.lb) - dc->color=ROP_XOR+LTPURPLE^TRANSPARENT; - else if (ip.rb) - dc->color=ROP_XOR+LTCYAN^TRANSPARENT; - else - dc->color=ROP_XOR+BLACK^TRANSPARENT; - if (winmgr.grab_scroll && gr.fp_draw_grab_input_ptr) - (*gr.fp_draw_grab_input_ptr)(dc,x,y,winmgr.grab_scroll_closed); - else - (*gr.fp_draw_input_ptr)(dc,x,y); - } - } - } -} - -U0 WinFinalUpdate(CDC *dc) -{ - if (ip_grid.show) - DrawWinGrid(dc); - DrawProgressBars(dc); - if (winmgr.show_menu) - DrawMenu(dc); - else - sys_cur_submenu_entry=NULL; - DrawInputPtr(dc); -} - -gr.fp_final_screen_update=&WinFinalUpdate; - -U0 WinIPUpdate() -{ - I64 dd; - Bool set=FALSE; - if (ip.dev==IP_MOUSE) { - ip.has_wheel=mouse.has_wheel; - if (mouse.evt) { - ip.throttle+=ip.throttle_step*SignI64(mouse.pos.z-ip.pos.z); - IPVarsUpdate(mouse.pos.x,mouse.pos.y,mouse.pos.z, - mouse.buttons[0],mouse.buttons[1]); - mouse.evt=FALSE; - set=TRUE; - } - } else if (ip.dev==IP_NULL && mouse.installed) - ip.dev=IP_MOUSE; - - if (set) { - if (ip.dev==IP_MOUSE) { - ip.speed=mouse.speed; - ip.timestamp=mouse.timestamp; - } - } else - ip.speed*=0.95; - if (gr.screen_zoom!=1) { - if (gr.continuous_scroll) - GrScaleZoom(1.0); - else { - dd=(ip.pos.x-gr.sx)*gr.screen_zoom; - if (!(8<=ddlast_task; - while (TaskValidate(task) && task!=sys_winmgr_task) { - if (!Bt(&task->win_inhibit,WIf_SELF_FOCUS)) { - sys_focus_task=task; - break; - } - task=task->last_task; - } - } - POPFD - return sys_focus_task; -} - -I64 WinOnTopWindows() -{ - CTask *task,*task1,*first_moved_fwd=NULL; - I64 res=0; - PUSHFD - CLI //TODO Multiprocessor safe - task=sys_winmgr_task->next_task; - while (task!=sys_winmgr_task && task!=first_moved_fwd) { - task1=task->next_task; - if (!TaskValidate(task)) { - POPFD - return res; - } - if (Bt(&task->display_flags,DISPLAYf_WIN_ON_TOP) && - task!=sys_winmgr_task->last_task) { - TaskQueRem(task); - TaskQueIns(task,sys_winmgr_task); - res++; - if (!first_moved_fwd) - first_moved_fwd=task; - } - task=task1; - } - POPFD - return res; -} - -public I64 WinToTop(CTask *task=NULL,Bool update_z_buf=TRUE) -{//Put task's win on top of window stack. - CTask *task1; - I64 res=0; - if (!task) task=Fs; - if (!TaskValidate(task) || task->gs->num) - return 0; - TaskDerivedValsUpdate(task,FALSE); - if (!sys_winmgr_task || task==sys_winmgr_task) - return 0; - PUSHFD - CLI - if (!TaskValidate(task)) { - POPFD - return 0; - } - if (task!=sys_winmgr_task->last_task) { - TaskQueRem(task); - TaskQueIns(task,sys_winmgr_task); - res++; - } - if (!Bt(&task->win_inhibit,WIf_SELF_FOCUS)) - sys_focus_task=task; - if (res && !Bt(&task->display_flags,DISPLAYf_CHILDREN_NOT_ON_TOP)) { - task1=task->next_child_task; - while (task1!=&task->next_child_task) { - if (!TaskValidate(task1)) - break; - res+=WinToTop(task1,FALSE); - task1=task1->next_sibling_task; - } - if (task->popup_task && - task->popup_task->parent_task==task) - res+=WinToTop(task->popup_task,FALSE); - } - POPFD - res+=WinOnTopWindows; - if (res && update_z_buf) - WinZBufUpdate; - return res; -} -ext[EXT_WIN_TO_TOP]=&WinToTop; - -public CTask *WinFocus(CTask *task=NULL) -{//Set task as focus task. - PUSHFD - CLI - if (!TaskValidate(task)||Bt(&task->win_inhibit,WIf_SELF_FOCUS)) - task=WinRefocus(sys_focus_task); - WinToTop(sys_focus_task=task); - POPFD - return sys_focus_task; -} -ext[EXT_WIN_FOCUS]=&WinFocus; - -public Bool WinHorz(I64 left,I64 right,CTask *task=NULL) -{//Set task's win left and right columns. - I64 d=right-left; - if (!task) task=Fs; - if (!TaskValidate(task)) return FALSE; - if (d<0) d=0; - if (left>=TEXT_COLS) { - left=TEXT_COLS-1; - right=left+d; - } - if (right<0) { - right=0; - left=right-d; - } - if (left>right) { - if (left>0) - right=left; - else - left=right; - } - PUSHFD - CLI //TODO Multiprocessor safe - if (task->win_left!=left || task->win_right!=right) { - task->win_left=left; - task->win_right=right; - TaskDerivedValsUpdate(task); - POPFD - return TRUE; - } else { - POPFD - return FALSE; - } -} - -public Bool WinVert(I64 top,I64 bottom,CTask *task=NULL) -{//Set task's win top and bottom rows. - I64 d=bottom-top; - if (!task) task=Fs; - if (!TaskValidate(task)) return FALSE; - if (d<0) d=0; - if (top>=TEXT_ROWS) { - top=TEXT_ROWS-1; - bottom=top+d; - } - if (bottom<=0) { - bottom=1; - top=bottom-d; - } - if (top>bottom) { - if (top>=0) - bottom=top; - else - top=bottom; - } - PUSHFD - CLI //TODO Multiprocessor safe - if (task->win_top!=top || task->win_bottom!=bottom) { - task->win_top=top; - task->win_bottom=bottom; - TaskDerivedValsUpdate(task); - POPFD - return TRUE; - } else { - POPFD - return FALSE; - } -} - -public U0 WinTileHorz() -{//Tile windows horizontally top-to-bottom. - CTask *task,*last_task=Fs; - I64 cnt,c,i,vert_size,no_border; - - PUSHFD - CLI //TODO Multiprocessor safe - task=sys_winmgr_task; - cnt=0; - do { - if (!Bt(&task->win_inhibit,WIf_SELF_FOCUS)) - cnt++; - task=task->last_task; - } while (task!=sys_winmgr_task); - - task=sys_winmgr_task; - i=0; - do { - if (!Bt(&task->win_inhibit,WIf_SELF_FOCUS)) { - no_border=Bt(&task->display_flags,DISPLAYf_NO_BORDER); - c=cnt- i&~3; - if (!c) - c=1; - else if (c>4) - c=4; - vert_size=(TEXT_ROWS-1)/c; - - WinHorz(1-no_border,TEXT_COLS-2+no_border,task); - WinVert((i&3)*vert_size+2-no_border,(i&3+1)*vert_size+no_border,task); - last_task=task; - if (i&3==3) - WinVert(task->win_top,TEXT_ROWS-2,task); - i++; - } - task=task->last_task; - } while (task!=sys_winmgr_task); - WinVert(last_task->win_top,TEXT_ROWS-2,last_task); - POPFD -} - -public U0 WinTileVert() -{//Tile windows vertically side-by-side. - CTask *task,*last_task=Fs; - I64 cnt,c,i,horz_size,no_border; - PUSHFD - CLI //TODO Multiprocessor safe - task=sys_winmgr_task; - cnt=0; - do { - if (!Bt(&task->win_inhibit,WIf_SELF_FOCUS)) - cnt++; - task=task->last_task; - } while (task!=sys_winmgr_task); - - task=sys_winmgr_task; - i=0; - do { - if (!Bt(&task->win_inhibit,WIf_SELF_FOCUS)) { - no_border=Bt(&task->display_flags,DISPLAYf_NO_BORDER); - c=cnt- i&~3; - if (!c) - c=1; - else if (c>4) - c=4; - horz_size=TEXT_COLS/c; - WinHorz((i&3)*horz_size+1-no_border,(i&3+1)*horz_size-1+no_border,task); - WinVert(2-no_border,TEXT_ROWS-2+no_border,task); - last_task=task; - if (i&3==3) - WinHorz(task->win_left,TEXT_COLS-2,task); - i++; - } - task=task->last_task; - } while (task!=sys_winmgr_task); - WinHorz(last_task->win_left,TEXT_COLS-2,last_task); - POPFD -} - -public U0 WinMax(CTask *task=NULL) -{//Maximize task's window - I64 no_border; - if (!task) task=Fs; - if (!TaskValidate(task)) return; - PUSHFD - CLI //TODO Multiprocessor safe - no_border=Bt(&task->display_flags,DISPLAYf_NO_BORDER); - WinHorz(1-no_border,TEXT_COLS-2+no_border,task); - WinVert(2-no_border,TEXT_ROWS-2+no_border,task); - WinToTop(task); - POPFD -} - -public Bool WinBorder(Bool val=OFF,CTask *task=NULL) -{//Turn off (or on) window border. - Bool old_has_border; - if (!task) task=Fs; - if (!TaskValidate(task)) return FALSE; - PUSHFD - CLI //TODO Multiprocessor safe - old_has_border=!Bt(&task->display_flags,DISPLAYf_NO_BORDER); - if (val) { - if (!old_has_border) { - LBtr(&task->display_flags,DISPLAYf_NO_BORDER); - task->win_left++; task->win_right--; - task->win_top++; task->win_bottom--; - TaskDerivedValsUpdate(task,FALSE); - } - } else { - if (old_has_border) { - LBts(&task->display_flags,DISPLAYf_NO_BORDER); - task->win_left--; task->win_right++; - task->win_top--; task->win_bottom++; - TaskDerivedValsUpdate(task,FALSE); - } - } - POPFD - return old_has_border; -} diff --git a/Adam/WinA.HC b/Adam/WinA.HC new file mode 100644 index 0000000..796ab61 --- /dev/null +++ b/Adam/WinA.HC @@ -0,0 +1,519 @@ +#help_index "Windows" +#help_file "::/Doc/Windows" + +CIPStateGlbls old_ip={IP_NULL,{-1000,-1000,0},{-1000,-1000,0},{-1000,-1000,0}, + {0,0,0},{1.0,1.0,1.0}, + 0,(MAX_I32+1)>>3,0.0,GetTSC,0.350,0,0, + FALSE,FALSE,TRUE,FALSE,FALSE,FALSE,FALSE,FALSE +}; + +public CWinMgrGlbls winmgr={0,0,0,WINMGR_FPS,tS,NULL,FALSE,FALSE,FALSE}; +winmgr.t=CAlloc(sizeof(CWinMgrTimingGlbls)); +winmgr.t->last_calc_idle_time=tS; + +#define PROGRESS_BAR_HEIGHT 20 +#define PROGRESS_BAR_WIDTH (3*GR_WIDTH/4) + +U0 DrawProgressBars(CDC *dc) +{ + I64 i,j,k,n,m; + U8 *st; + for (i=0;icolor=BLACK; + GrRect(dc, + (GR_WIDTH-PROGRESS_BAR_WIDTH)/2, + (GR_HEIGHT-(NUM_PROGRESS_BARS*2-1-i*4)*PROGRESS_BAR_HEIGHT)/2, + PROGRESS_BAR_WIDTH,PROGRESS_BAR_HEIGHT); + + dc->color=LTGREEN; + n=sys_progresses[i].val; + if (n>m) + n=m; + GrRect(dc, + (GR_WIDTH-PROGRESS_BAR_WIDTH)/2+2, + (GR_HEIGHT-(NUM_PROGRESS_BARS*2-1-i*4)*PROGRESS_BAR_HEIGHT)/2+2, + n*(PROGRESS_BAR_WIDTH-4)/m, + PROGRESS_BAR_HEIGHT-4); + + if (m>1) { + dc->color=BLACK; + k=m-1; + if (k>19) k=19; + for (j=0;j<=k;j++) + GrLine(dc, + (GR_WIDTH-PROGRESS_BAR_WIDTH)/2+1+j* + (PROGRESS_BAR_WIDTH-4)/ToF64(k+1), + (GR_HEIGHT-(NUM_PROGRESS_BARS*2-1-i*4)* + PROGRESS_BAR_HEIGHT)/2+4, + (GR_WIDTH-PROGRESS_BAR_WIDTH)/2+1+j* + (PROGRESS_BAR_WIDTH-4)/ToF64(k+1), + (GR_HEIGHT-(NUM_PROGRESS_BARS*2-3-i*4)* + PROGRESS_BAR_HEIGHT)/2-4); + } + + dc->color=WHITE; + if (*sys_progresses[i].desc) + st=StrNew(sys_progresses[i].desc); + else + st=MStrPrint("%d/%d",n,m); + GrPrint(dc,(GR_WIDTH-FONT_WIDTH*StrLen(st))/2, + (GR_HEIGHT-FONT_HEIGHT- + (NUM_PROGRESS_BARS*2-2-i*4)*PROGRESS_BAR_HEIGHT)/2,"%s",st); + Free(st); + } + } +} + +U0 DrawWinGrid(CDC *dc) +{ + F64 d; + dc->color=BLACK; + dc->pen_width=1; + for (d=ip_grid.x_offset;d\n$$LTBLUE$$"); + for (i=0;i<256;i++) { + if (i>=CH_SHIFT_SPACE && i!=0x7F) { + if (i==CH_SHIFT_SPACE) + DocPrint(doc,"$$MU-UL,\"\\x1F\",LE=%d$$",i); + else if (i=='$$') + DocPrint(doc,"$$MU-UL,\"\\x24\",LE=%d$$",i); + else if (i=='\"'||i=='\\') + DocPrint(doc,"$$MU-UL,\"\\%c\",LE=%d$$",i,i); + else + DocPrint(doc,"$$MU-UL,\"%c\",LE=%d$$",i,i); + } else + DocPrint(doc," "); + if (i&15==15) + DocPrint(doc,"\n"); + } + i=PopUpMenu(doc); + DocDel(doc); + if (i>=0) + PostMsg(ext_ASCII_task,MSG_KEY_DOWN_UP,i,Char2ScanCode(i)); +} + +U0 CtrlAltA(I64) +{ + if (ext_ASCII_task=sys_focus_task) + Spawn(&ExtendedASCII); +} +CtrlAltCBSet('A',&CtrlAltA,"Cmd /Extended ASCII"); + +public U0 WinScrollNull(CTask *task,CD3I64 *s) +{//If panning a window has been done, restore to zero. + s->x=task->scroll_x; + s->y=task->scroll_y; + s->z=task->scroll_z; + task->scroll_x=0; + task->scroll_y=0; + task->scroll_z=0; +} + +public U0 WinScrollRestore(CTask *task,CD3I64 *s) +{//Set window pan value to stored value. + task->scroll_x=s->x; + task->scroll_y=s->y; + task->scroll_z=s->z; +} + +U0 DrawInputPtr(CDC *dc) +{ + I64 x,y; + PUSHFD + CLI + x=ip.pos.x; + y=ip.pos.y; + POPFD + if (ip.show && ip.dev!=IP_NULL) { + if (!Bt(&sys_run_level,RLf_VGA)) //if text mode + gr.text_base[ip.pos_text.x+ip.pos_text.y*TEXT_COLS]^=0x7F00; + else { + if (gr.fp_draw_input_ptr) { + if (ip.lb) + dc->color=ROP_XOR+LTPURPLE^TRANSPARENT; + else if (ip.rb) + dc->color=ROP_XOR+LTCYAN^TRANSPARENT; + else + dc->color=ROP_XOR+BLACK^TRANSPARENT; + if (winmgr.grab_scroll && gr.fp_draw_grab_input_ptr) + (*gr.fp_draw_grab_input_ptr)(dc,x,y,winmgr.grab_scroll_closed); + else + (*gr.fp_draw_input_ptr)(dc,x,y); + } + } + } +} + +U0 WinFinalUpdate(CDC *dc) +{ + if (ip_grid.show) + DrawWinGrid(dc); + DrawProgressBars(dc); + if (winmgr.show_menu) + DrawMenu(dc); + else + sys_cur_submenu_entry=NULL; + DrawInputPtr(dc); +} + +gr.fp_final_screen_update=&WinFinalUpdate; + +U0 WinIPUpdate() +{ + I64 dd; + Bool set=FALSE; + if (ip.dev==IP_MOUSE) { + ip.has_wheel=mouse.has_wheel; + if (mouse.evt) { + ip.throttle+=ip.throttle_step*SignI64(mouse.pos.z-ip.pos.z); + IPVarsUpdate(mouse.pos.x,mouse.pos.y,mouse.pos.z, + mouse.buttons[0],mouse.buttons[1]); + mouse.evt=FALSE; + set=TRUE; + } + } else if (ip.dev==IP_NULL && mouse.installed) + ip.dev=IP_MOUSE; + + if (set) { + if (ip.dev==IP_MOUSE) { + ip.speed=mouse.speed; + ip.timestamp=mouse.timestamp; + } + } else + ip.speed*=0.95; + if (gr.screen_zoom!=1) { + if (gr.continuous_scroll) + GrScaleZoom(1.0); + else { + dd=(ip.pos.x-gr.sx)*gr.screen_zoom; + if (!(8<=ddlast_task; + while (TaskValidate(task) && task!=sys_winmgr_task) { + if (!Bt(&task->win_inhibit,WIf_SELF_FOCUS)) { + sys_focus_task=task; + break; + } + task=task->last_task; + } + } + POPFD + return sys_focus_task; +} + +I64 WinOnTopWindows() +{ + CTask *task,*task1,*first_moved_fwd=NULL; + I64 res=0; + PUSHFD + CLI //TODO Multiprocessor safe + task=sys_winmgr_task->next_task; + while (task!=sys_winmgr_task && task!=first_moved_fwd) { + task1=task->next_task; + if (!TaskValidate(task)) { + POPFD + return res; + } + if (Bt(&task->display_flags,DISPLAYf_WIN_ON_TOP) && + task!=sys_winmgr_task->last_task) { + TaskQueRem(task); + TaskQueIns(task,sys_winmgr_task); + res++; + if (!first_moved_fwd) + first_moved_fwd=task; + } + task=task1; + } + POPFD + return res; +} + +public I64 WinToTop(CTask *task=NULL,Bool update_z_buf=TRUE) +{//Put task's win on top of window stack. + CTask *task1; + I64 res=0; + if (!task) task=Fs; + if (!TaskValidate(task) || task->gs->num) + return 0; + TaskDerivedValsUpdate(task,FALSE); + if (!sys_winmgr_task || task==sys_winmgr_task) + return 0; + PUSHFD + CLI + if (!TaskValidate(task)) { + POPFD + return 0; + } + if (task!=sys_winmgr_task->last_task) { + TaskQueRem(task); + TaskQueIns(task,sys_winmgr_task); + res++; + } + if (!Bt(&task->win_inhibit,WIf_SELF_FOCUS)) + sys_focus_task=task; + if (res && !Bt(&task->display_flags,DISPLAYf_CHILDREN_NOT_ON_TOP)) { + task1=task->next_child_task; + while (task1!=&task->next_child_task) { + if (!TaskValidate(task1)) + break; + res+=WinToTop(task1,FALSE); + task1=task1->next_sibling_task; + } + if (task->popup_task && + task->popup_task->parent_task==task) + res+=WinToTop(task->popup_task,FALSE); + } + POPFD + res+=WinOnTopWindows; + if (res && update_z_buf) + WinZBufUpdate; + return res; +} +ext[EXT_WIN_TO_TOP]=&WinToTop; + +public CTask *WinFocus(CTask *task=NULL) +{//Set task as focus task. + PUSHFD + CLI + if (!TaskValidate(task)||Bt(&task->win_inhibit,WIf_SELF_FOCUS)) + task=WinRefocus(sys_focus_task); + WinToTop(sys_focus_task=task); + POPFD + return sys_focus_task; +} +ext[EXT_WIN_FOCUS]=&WinFocus; + +public Bool WinHorz(I64 left,I64 right,CTask *task=NULL) +{//Set task's win left and right columns. + I64 d=right-left; + if (!task) task=Fs; + if (!TaskValidate(task)) return FALSE; + if (d<0) d=0; + if (left>=TEXT_COLS) { + left=TEXT_COLS-1; + right=left+d; + } + if (right<0) { + right=0; + left=right-d; + } + if (left>right) { + if (left>0) + right=left; + else + left=right; + } + PUSHFD + CLI //TODO Multiprocessor safe + if (task->win_left!=left || task->win_right!=right) { + task->win_left=left; + task->win_right=right; + TaskDerivedValsUpdate(task); + POPFD + return TRUE; + } else { + POPFD + return FALSE; + } +} + +public Bool WinVert(I64 top,I64 bottom,CTask *task=NULL) +{//Set task's win top and bottom rows. + I64 d=bottom-top; + if (!task) task=Fs; + if (!TaskValidate(task)) return FALSE; + if (d<0) d=0; + if (top>=TEXT_ROWS) { + top=TEXT_ROWS-1; + bottom=top+d; + } + if (bottom<=0) { + bottom=1; + top=bottom-d; + } + if (top>bottom) { + if (top>=0) + bottom=top; + else + top=bottom; + } + PUSHFD + CLI //TODO Multiprocessor safe + if (task->win_top!=top || task->win_bottom!=bottom) { + task->win_top=top; + task->win_bottom=bottom; + TaskDerivedValsUpdate(task); + POPFD + return TRUE; + } else { + POPFD + return FALSE; + } +} + +public U0 WinTileHorz() +{//Tile windows horizontally top-to-bottom. + CTask *task,*last_task=Fs; + I64 cnt,c,i,vert_size,no_border; + + PUSHFD + CLI //TODO Multiprocessor safe + task=sys_winmgr_task; + cnt=0; + do { + if (!Bt(&task->win_inhibit,WIf_SELF_FOCUS)) + cnt++; + task=task->last_task; + } while (task!=sys_winmgr_task); + + task=sys_winmgr_task; + i=0; + do { + if (!Bt(&task->win_inhibit,WIf_SELF_FOCUS)) { + no_border=Bt(&task->display_flags,DISPLAYf_NO_BORDER); + c=cnt- i&~3; + if (!c) + c=1; + else if (c>4) + c=4; + vert_size=(TEXT_ROWS-1)/c; + + WinHorz(1-no_border,TEXT_COLS-2+no_border,task); + WinVert((i&3)*vert_size+2-no_border,(i&3+1)*vert_size+no_border,task); + last_task=task; + if (i&3==3) + WinVert(task->win_top,TEXT_ROWS-2,task); + i++; + } + task=task->last_task; + } while (task!=sys_winmgr_task); + WinVert(last_task->win_top,TEXT_ROWS-2,last_task); + POPFD +} + +public U0 WinTileVert() +{//Tile windows vertically side-by-side. + CTask *task,*last_task=Fs; + I64 cnt,c,i,horz_size,no_border; + PUSHFD + CLI //TODO Multiprocessor safe + task=sys_winmgr_task; + cnt=0; + do { + if (!Bt(&task->win_inhibit,WIf_SELF_FOCUS)) + cnt++; + task=task->last_task; + } while (task!=sys_winmgr_task); + + task=sys_winmgr_task; + i=0; + do { + if (!Bt(&task->win_inhibit,WIf_SELF_FOCUS)) { + no_border=Bt(&task->display_flags,DISPLAYf_NO_BORDER); + c=cnt- i&~3; + if (!c) + c=1; + else if (c>4) + c=4; + horz_size=TEXT_COLS/c; + WinHorz((i&3)*horz_size+1-no_border,(i&3+1)*horz_size-1+no_border,task); + WinVert(2-no_border,TEXT_ROWS-2+no_border,task); + last_task=task; + if (i&3==3) + WinHorz(task->win_left,TEXT_COLS-2,task); + i++; + } + task=task->last_task; + } while (task!=sys_winmgr_task); + WinHorz(last_task->win_left,TEXT_COLS-2,last_task); + POPFD +} + +public U0 WinMax(CTask *task=NULL) +{//Maximize task's window + I64 no_border; + if (!task) task=Fs; + if (!TaskValidate(task)) return; + PUSHFD + CLI //TODO Multiprocessor safe + no_border=Bt(&task->display_flags,DISPLAYf_NO_BORDER); + WinHorz(1-no_border,TEXT_COLS-2+no_border,task); + WinVert(2-no_border,TEXT_ROWS-2+no_border,task); + WinToTop(task); + POPFD +} + +public Bool WinBorder(Bool val=OFF,CTask *task=NULL) +{//Turn off (or on) window border. + Bool old_has_border; + if (!task) task=Fs; + if (!TaskValidate(task)) return FALSE; + PUSHFD + CLI //TODO Multiprocessor safe + old_has_border=!Bt(&task->display_flags,DISPLAYf_NO_BORDER); + if (val) { + if (!old_has_border) { + LBtr(&task->display_flags,DISPLAYf_NO_BORDER); + task->win_left++; task->win_right--; + task->win_top++; task->win_bottom--; + TaskDerivedValsUpdate(task,FALSE); + } + } else { + if (old_has_border) { + LBts(&task->display_flags,DISPLAYf_NO_BORDER); + task->win_left--; task->win_right++; + task->win_top--; task->win_bottom++; + TaskDerivedValsUpdate(task,FALSE); + } + } + POPFD + return old_has_border; +} diff --git a/Adam/WinB.CPP b/Adam/WinB.CPP deleted file mode 100644 index 9191028..0000000 --- a/Adam/WinB.CPP +++ /dev/null @@ -1,873 +0,0 @@ -#help_index "Windows;Task/Delay" - -public U0 WinMgrSync(I64 cnt=1,Bool force=FALSE) -{//Wait for win manager to start and finish updating screen. - //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 - // and Set Cur Pos. - Bool old_full_refresh, - old_idle=LBts(&Fs->task_flags,TASKf_IDLE); - CDoc *old_doc=DocPut; - I64 update_cnt; - if (!cnt&&force) - LBts(&sys_semas[SYS_SEMA_JUST_PUMP_MSGS],0); - while (Bt(&sys_semas[SYS_SEMA_REFRESH_IN_PROGRESS],0)) { - if (force) { - LBts(&sys_semas[SYS_SEMA_FORCE_WINMGR],0); - if (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.updateswake_jiffy=cnts.jiffies; - } - Sleep(1); - } - if (old_doc) - LBEqu(&old_doc->flags,DOCf_DO_FULL_REFRESH,old_full_refresh); - LBEqu(&Fs->task_flags,TASKf_IDLE,old_idle); -} - -#help_index "Windows" - -I64 WinQueIPMsgs(Bool que) -{ - static CD3I64 single_ip={0,0,0}; - F64 time=tS; - I64 msg_code=0,a1,a2,single_a1,single_a2; - CTask *task_focus=sys_focus_task; - - if (task_focus && !winmgr.grab_scroll) { - a1=ip.pos.x-task_focus->pix_left-task_focus->scroll_x; - a2=ip.pos.y-task_focus->pix_top-task_focus->scroll_y; - single_a1=single_ip.x-task_focus->pix_left-task_focus->scroll_x; - single_a2=single_ip.y-task_focus->pix_top-task_focus->scroll_y; - if (old_ip.presnap.x!=ip.presnap.x || old_ip.presnap.y!=ip.presnap.y) { - if (que) - TaskMsg(task_focus,0, - MSG_IP_MOVE,a1,a2,0); - msg_code=MSG_IP_MOVE; - } -//TODO que msg for ip.pos.z? - if (ip.left_dbl_time) { - if (time>ip.left_dbl_time) { - if (ip.left_dbl) { - if (!ip.left_down_sent) { - if (que) - TaskMsg(task_focus,0, - MSG_IP_L_D_DOWN,a1,a2,0); - ip.left_down_sent=TRUE; - msg_code=MSG_IP_L_D_DOWN; - } - if (!ip.lb) { - if (que) - TaskMsg(task_focus,0, - MSG_IP_L_D_UP,a1,a2,0); - ip.left_dbl_time=0; - msg_code=MSG_IP_L_D_UP; - } - } else { - if (!ip.left_down_sent) { - if (que) - TaskMsg(task_focus,0, - MSG_IP_L_DOWN,single_a1,single_a2,0); - ip.left_down_sent=TRUE; - msg_code=MSG_IP_L_DOWN; - } - if (!ip.lb) { - if (que) - TaskMsg(task_focus,0, - MSG_IP_L_UP,a1,a2,0); - ip.left_dbl_time=0; - msg_code=MSG_IP_L_UP; - } - } - } else { - if (ip.lb && !ip_last.lb) { - ip.left_dbl_time=time; - ip.left_dbl=TRUE; - } - } - } else { - if (TaskValidate(task_focus) && - Bt(&task_focus->win_inhibit,WIf_FOCUS_TASK_IP_L_D)) { - if (ip.lb && !ip_last.lb) { - if (que) - TaskMsg(task_focus,0, - MSG_IP_L_DOWN,a1,a2,0); - msg_code=MSG_IP_L_DOWN; - } else if (!ip.lb && ip_last.lb) { - if (que) - TaskMsg(task_focus,0, - MSG_IP_L_UP,a1,a2,0); - msg_code=MSG_IP_L_UP; - } - } else { - if (ip.lb && !ip_last.lb) { - ip.left_dbl=FALSE; - ip.left_down_sent=FALSE; - ip.left_dbl_time=time+ip.dbl_time; - single_ip.x=ip.pos.x; - single_ip.y=ip.pos.y; - } - } - } - - if (ip.right_dbl_time) { - if (time>ip.right_dbl_time) { - if (ip.right_dbl) { - if (!ip.right_down_sent) { - if (que) - TaskMsg(task_focus,0, - MSG_IP_R_D_DOWN,a1,a2,0); - ip.right_down_sent=TRUE; - msg_code=MSG_IP_R_D_DOWN; - } - if (!ip.rb) { - if (que) - TaskMsg(task_focus,0, - MSG_IP_R_D_UP,a1,a2,0); - ip.right_dbl_time=0; - msg_code=MSG_IP_R_D_UP; - } - } else { - if (!ip.right_down_sent) { - if (que) - TaskMsg(task_focus,0, - MSG_IP_R_DOWN,single_a1,single_a2,0); - ip.right_down_sent=TRUE; - msg_code=MSG_IP_R_DOWN; - } - if (!ip.rb) { - if (que) - TaskMsg(task_focus,0, - MSG_IP_R_UP,a1,a2,0); - ip.right_dbl_time=0; - msg_code=MSG_IP_R_UP; - } - } - } else { - if (ip.rb && !ip_last.rb) { - ip.right_dbl_time=time; - ip.right_dbl=TRUE; - } - } - } else { - if (TaskValidate(task_focus) && - Bt(&task_focus->win_inhibit,WIf_FOCUS_TASK_IP_R_D)) { - if (ip.rb && !ip_last.rb) { - if (que) - TaskMsg(task_focus,0, - MSG_IP_R_DOWN,a1,a2,0); - msg_code=MSG_IP_R_DOWN; - } else if (!ip.rb && ip_last.rb) { - if (que) - TaskMsg(task_focus,0, - MSG_IP_R_UP,a1,a2,0); - msg_code=MSG_IP_R_UP; - } - } else { - if (ip.rb && !ip_last.rb) { - ip.right_dbl=FALSE; - ip.right_down_sent=FALSE; - ip.right_dbl_time=time+ip.dbl_time; - single_ip.x=ip.pos.x; - single_ip.y=ip.pos.y; - } - } - } - - MemCpy(&ip_last,&ip,sizeof(CIPStateGlbls)); - MemCpy(&old_ip,&ip,sizeof(CIPStateGlbls)); - } - return msg_code; -} - -U0 WinCalcIdles() -{ - F64 calc_idle_time; - I64 i,k,total_jiffies,total_jiffies_delta,idle_pt_hits[MP_MAX_PROCESSORS]; - CCPU *c; - CWinMgrTimingGlbls *t=winmgr.t; - - if ((t->calc_idle_delta_time= - (calc_idle_time=tS)-t->last_calc_idle_time)>.25) { - PUSHFD - CLI - total_jiffies=cpu_structs[0].total_jiffies; - for (i=0;ilast_total_jiffies; - for (i=0;ilast_idle_pt_hits[i])>=0) - c->idle_factor=Clamp(ToF64(k)/total_jiffies_delta,0.01,0.99); - else - c->idle_factor=0.01; - t->last_idle_pt_hits[i]=idle_pt_hits[i]; - } - t->last_total_jiffies=total_jiffies; - t->last_calc_idle_time=calc_idle_time; - t->calc_idle_cnt++; - } -} - -I64 WinMgrSleep(Bool flush_msgs=FALSE) -{ - I64 timeout_val,msg_code=0; - CCtrl *c; - Bool que; - F64 t,t_delta; - - TimeStampFreqCal; - if ((t_delta=(t=tS)-winmgr.last_refresh_tS)>0.01) - winmgr.fps=Max(1.0/t_delta,1); - else - winmgr.fps=99; - winmgr.last_refresh_tS=t; - WinCalcIdles; - - if (!flush_msgs && winmgr.old_focus_task!=sys_focus_task) { - TaskMsg(winmgr.old_focus_task,0,MSG_FOCUS,FALSE,0,0); - TaskMsg(sys_focus_task,0,MSG_FOCUS,TRUE,0,0); - winmgr.old_focus_task=sys_focus_task; - } - - if (flush_msgs) - FifoI64Flush(kbd.scan_code_fifo); - else if (TaskValidate(sys_focus_task)) { - KbdMsgsQue; - - que=TRUE; - if (TaskValidate(sys_focus_task) && - !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_CTRLS)) { - c=sys_focus_task->next_ctrl; - while (c!=&sys_focus_task->next_ctrl) { - if (CtrlInside(c,ip.pos.x,ip.pos.y)) { - que=FALSE; - break; - } - c=c->next; - } - } - msg_code=WinQueIPMsgs(que); - } else { - WinRefocus(sys_focus_task); - if (!TaskValidate(sys_focus_task)) - FifoI64Flush(kbd.scan_code_fifo); - } - if (sys_focus_task) - LBtr(&sys_focus_task->task_flags,TASKf_HAS_SONG); - WinIPUpdate; - - if (!LBtr(&sys_semas[SYS_SEMA_JUST_PUMP_MSGS],0)) { - timeout_val=cnts.jiffies+JIFFY_FREQ/WINMGR_FPS; - LBts(&sys_semas[SYS_SEMA_REFRESH_IN_PROGRESS],0); - GrUpdateScreen; - LBtr(&sys_semas[SYS_SEMA_REFRESH_IN_PROGRESS],0); - - if (sys_focus_task && !Bt(&sys_focus_task->task_flags,TASKf_HAS_SONG)) { - Free(music.cur_song); - music.cur_song=NULL; - } - if (music.cur_song) { - if (!music.cur_song_task) - music.cur_song_task=Spawn(&CurSongTask,NULL,"Song"); - } else if (music.cur_song_task) { - Kill(music.cur_song_task); - music.cur_song_task=NULL; - } - winmgr.updates++; - if (!mouse.install_attempts) - SleepUntil(timeout_val); //Just for before mouse install attempt at boot. - else - do { - KbdMouseHandler(FALSE,TRUE); - SleepUntil(MinI64(timeout_val,cnts.jiffies+JIFFY_FREQ/500)); - } while (cnts.jiffiesflags&DOCF_DONT_SHOW) - res=NULL; - else if (set_cursor) { - unlock=DocLock(res); - if (res->doc_signature!=DOC_SIGNATURE_VAL) - res=NULL; - else { - x0=res->line_start_col; - y0=res->top_line_num; - DocRecalc(res,RECALCF_HAS_CURSOR); - res->x=(ipx-task->pix_left-task->scroll_x)/FONT_WIDTH +x0; - res->y=(ipy-task->pix_top -task->scroll_y)/FONT_HEIGHT+y0; - DocRecalc(res,RECALCt_FIND_CURSOR); - task->scroll_x=0; - task->scroll_y=0; - task->scroll_z=0; - if (unlock) - DocUnlock(res); - } - } - WinToTop(task); - } - return res; -} - -U0 WinChkMoveSize(CTask *task) -{ - if (task->win_left!=task->win_old_left || task->win_top!=task->win_old_top) - TaskMsg(task,0,MSG_MOVE,task->win_left,task->win_top,0); - if (task->win_right-task->win_left!=task->win_old_right-task->win_old_left || - task->win_bottom-task->win_top!=task->win_old_bottom-task->win_old_top) - TaskMsg(task,0, - MSG_RESIZE,task->win_right-task->win_left+1, - task->win_bottom-task->win_top+1,0); - task->win_old_left =task->win_left; - task->win_old_right =task->win_right; - task->win_old_top =task->win_top; - task->win_old_bottom=task->win_bottom; -} - -Bool WinKeyNavMenu() -{ - I64 i,old_key_cnt; - CD3I64 old_pos,new_pos; - CMenu *m; - CMenuEntry *tempme; - CTask *focus=MenuTask; - if (Bt(kbd.down_bitmap,SC_GUI) && focus && (m=focus->cur_menu)) { - winmgr.show_menu=TRUE; - sys_cur_submenu_entry=NULL; - old_pos.x=ip.pos.x; old_pos.y=ip.pos.y; - ip.pos.x=new_pos.x=ip.pos.y=new_pos.y=0; - while (Bt(kbd.down_bitmap,SC_GUI)) { - old_key_cnt=kbd.cnt; - if (Bt(kbd.down_bitmap,SC_CURSOR_LEFT)) { - while (Bt(kbd.down_bitmap,SC_CURSOR_LEFT) && kbd.cnt==old_key_cnt) - WinMgrSleep(TRUE); - if (new_pos.x) { - i=0; - tempme=m->sub; - while (tempme) { - if (i+MenuEntryWidth(tempme)*FONT_WIDTH==new_pos.x) { - new_pos.x=i; - break; - } - i+=MenuEntryWidth(tempme)*FONT_WIDTH; - tempme=tempme->next; - } - } - new_pos.y=0; - } else if (Bt(kbd.down_bitmap,SC_CURSOR_RIGHT)) { - while (Bt(kbd.down_bitmap,SC_CURSOR_RIGHT) && kbd.cnt==old_key_cnt) - WinMgrSleep(TRUE); - i=0; - tempme=m->sub; - while (tempme) { - if (i==new_pos.x) { - if (tempme->next) - new_pos.x=i+MenuEntryWidth(tempme)*FONT_WIDTH; - break; - } - i+=MenuEntryWidth(tempme)*FONT_WIDTH; - tempme=tempme->next; - } - new_pos.y=0; - } else if (Bt(kbd.down_bitmap,SC_CURSOR_UP)) { - while (Bt(kbd.down_bitmap,SC_CURSOR_UP) && kbd.cnt==old_key_cnt) - WinMgrSleep(TRUE); - new_pos.y-=FONT_HEIGHT; - } else if (Bt(kbd.down_bitmap,SC_CURSOR_DOWN)) { - while (Bt(kbd.down_bitmap,SC_CURSOR_DOWN) && kbd.cnt==old_key_cnt) - WinMgrSleep(TRUE); - new_pos.y+=FONT_HEIGHT; - } - new_pos.x=ClampI64(new_pos.x,0,GR_WIDTH-1); - new_pos.y=ClampI64(new_pos.y,0,GR_HEIGHT-1); - ip.pos.x=new_pos.x; ip.pos.y=new_pos.y; - WinMgrSleep(TRUE); - if (!sys_cur_submenu_entry) - ip.pos.y=new_pos.y=0; - } - if (sys_cur_submenu_entry) - TaskMsg(sys_focus_task,0,sys_cur_submenu_entry->msg_code, - sys_cur_submenu_entry->a1,sys_cur_submenu_entry->a2,0); - winmgr.show_menu=FALSE; - ip.pos.x=old_pos.x; ip.pos.y=old_pos.y; - return TRUE; - } - return FALSE; -} - -U0 WinMgrTask(I64) -{ - CTask *task=Fs; - CDoc *doc; - CDocEntry *doc_e; - I64 x,y,z,msg_code, - my_ip_z=0,left,top, - old_flags=GetRFlags; - Bool has_border; - CCtrl *c; - WinHorz(0,TEXT_COLS-1); - WinVert(0,TEXT_ROWS-1); - LBts(&Fs->display_flags,DISPLAYf_NO_BORDER); - LBts(&Fs->display_flags,DISPLAYf_SHOW); - gr.dc->win_task=Fs; - Fs->win_inhibit&=~WIF_SELF_CTRLS; - GrSetUpTables; - WinZBufUpdate; - LBts(&sys_run_level,RLf_WINMGR); - while (TRUE) { - try { -wmt_start: - if (Bt(&sys_run_level,RLf_ADAM_SERVER)) - TaskKillDying; - WinMgrSleep; - - task=Fs->last_task; - while (TRUE) { - CLI - if (!TaskValidate(task)) { - SetRFlags(old_flags); - goto wmt_start; - } - WinChkMoveSize(task); - TaskDerivedValsUpdate(task,FALSE); - task=task->last_task; - SetRFlags(old_flags); - if (task==Fs) - break; - } - TaskDerivedValsUpdate(Fs,FALSE); - - task=Fs->last_task; - while (TRUE) { - CLI - if (!TaskValidate(task)) { - SetRFlags(old_flags); - goto wmt_start; - } - if (WinInside(ip.pos.x,ip.pos.y,task,TRUE)) { - SetRFlags(old_flags); - break; - } - if (task==Fs) { //Shouldn't happen - SetRFlags(old_flags); - goto wmt_start; - } - task=task->last_task; - SetRFlags(old_flags); - } - - if (Bt(&task->display_flags,DISPLAYf_NO_BORDER)) - has_border=FALSE; - else - has_border=TRUE; - - winmgr.show_menu=FALSE; - sys_cur_submenu_entry=NULL; - if (TaskValidate(sys_focus_task) && - !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_MENU)) { - if (WinKeyNavMenu) - goto wmt_start; - if (task==Fs && 0<=ip.pos.ymsg_code, - sys_cur_submenu_entry->a1, - sys_cur_submenu_entry->a2,0); - winmgr.show_menu=FALSE; - old_ip.lb=FALSE; - goto wmt_start; - } - } - } - - //grab scroll - if (!Bt(&task->win_inhibit,WIf_SELF_GRAB_SCROLL) && - (!TaskValidate(sys_focus_task)|| - !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_GRAB_SCROLL)) && - kbd.scan_code&SCF_CTRL && TaskValidate(task)) { - winmgr.grab_scroll_closed=FALSE; - winmgr.grab_scroll=TRUE; - while (kbd.scan_code&SCF_CTRL && TaskValidate(task) && - (!ac.task || !WinInside(ip.pos.x,ip.pos.y,ac.task,TRUE))) { - if (ip.lb) { - winmgr.grab_scroll_closed=TRUE; - x=ip.pos.x-task->scroll_x; - y=ip.pos.y-task->scroll_y; - z=ip.pos.z-task->scroll_z; - while (ip.lb && kbd.scan_code&SCF_CTRL && TaskValidate(task)) { - task->scroll_x=(ip.pos.x-x)&~7; - task->scroll_y=(ip.pos.y-y)&~7; - task->scroll_z=ip.pos.z-z; - WinMgrSleep(TRUE); - } - winmgr.grab_scroll_closed=FALSE; - } else if (ip.rb) { - task->scroll_x=0; - task->scroll_y=0; - task->scroll_z=0; - WinMgrSleep(TRUE); - } else - WinMgrSleep; - } - winmgr.grab_scroll=FALSE; - goto wmt_start; - } else - winmgr.grab_scroll=FALSE; - - if (!Bt(&task->win_inhibit,WIf_SELF_CTRLS) && - (!TaskValidate(sys_focus_task)|| - !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_CTRLS))) { - if (ip.lb && !old_ip.lb) { - c=task->next_ctrl; - while (c!=&task->next_ctrl) { - if (CtrlInside(c,ip.pos.x,ip.pos.y)) { - left=task->pix_left; - top =task->pix_top; - if (c->flags&CTRLF_BORDER) { - left-=FONT_WIDTH; - top -=FONT_HEIGHT; - } - if (c->flags&CTRLF_CAPTURE_LEFT_IP) { - while (ip.lb && TaskValidate(task)) { - if (c->left_click) - (*c->left_click)(c,ip.pos.x-left,ip.pos.y-top,TRUE); - WinMgrSleep; - } - if (c->left_click) - (*c->left_click)(c,ip.pos.x-left,ip.pos.y-top,FALSE); - old_ip.lb=FALSE; - goto wmt_start; - } else { - if (c->left_click) - (*c->left_click)(c,ip.pos.x-left,ip.pos.y-top,TRUE); - old_ip.lb=TRUE; - goto wmt_start; - } - } - c=c->next; - } - } - if (old_ip.lb && !ip.lb) { - c=task->next_ctrl; - while (c!=&task->next_ctrl) { - if (CtrlInside(c,ip.pos.x,ip.pos.y)) { - left=task->pix_left; - top =task->pix_top; - if (c->flags&CTRLF_BORDER) { - left-=FONT_WIDTH; - top -=FONT_HEIGHT; - } - if (c->left_click) - (*c->left_click)(c,ip.pos.x-left,ip.pos.y-top,FALSE); - old_ip.lb=FALSE; - goto wmt_start; - } - c=c->next; - } - } - if (ip.rb && !old_ip.rb) { - c=task->next_ctrl; - while (c!=&task->next_ctrl) { - if (CtrlInside(c,ip.pos.x,ip.pos.y)) { - left=task->pix_left; - top =task->pix_top; - if (c->flags&CTRLF_BORDER) { - left-=FONT_WIDTH; - top -=FONT_HEIGHT; - } - if (c->flags&CTRLF_CAPTURE_RIGHT_IP) { - while (ip.rb && TaskValidate(task)) { - if (c->right_click) - (*c->right_click)(c,ip.pos.x-left,ip.pos.y-top,TRUE); - WinMgrSleep; - } - if (c->right_click) - (*c->right_click)(c,ip.pos.x-left,ip.pos.y-top,FALSE); - old_ip.rb=FALSE; - goto wmt_start; - } else { - if (c->right_click) - (*c->right_click)(c,ip.pos.x-left,ip.pos.y-top,TRUE); - old_ip.rb=TRUE; - goto wmt_start; - } - } - c=c->next; - } - } - if (old_ip.rb && !ip.rb) { - c=task->next_ctrl; - while (c!=&task->next_ctrl) { - if (CtrlInside(c,ip.pos.x,ip.pos.y)) { - left=task->pix_left; - top =task->pix_top; - if (c->flags&CTRLF_BORDER) { - left-=FONT_WIDTH; - top -=FONT_HEIGHT; - } - if (c->right_click) - (*c->right_click)(c,ip.pos.x-left,ip.pos.y-top,FALSE); - old_ip.rb=FALSE; - goto wmt_start; - } - c=c->next; - } - } - if (ip.has_wheel && my_ip_z!=ip.pos.z) { - if (task==sys_focus_task) { - c=task->next_ctrl; - while (c!=&task->next_ctrl) { - if (c->wheel_chg) { - (*c->wheel_chg)(c,ip.pos.z-my_ip_z); - my_ip_z=ip.pos.z; - goto wmt_start; - } - c=c->next; - } - my_ip_z=ip.pos.z; - } else if (!sys_focus_task) - my_ip_z=ip.pos.z; - } - } - - if (task==Fs) - goto wmt_start; - - if (!Bt(&task->win_inhibit,WIf_SELF_IP_L)&& - (!TaskValidate(sys_focus_task)|| - !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_IP_L))) { - if (!old_ip.lb && ip.lb) { - if (doc=WinCursorPosSet(task,ip.pos.x,ip.pos.y)) { - DocLock(doc); - if (doc->doc_signature==DOC_SIGNATURE_VAL) { - doc_e=doc->cur_entry; - if (doc_e!=doc) { - if (doc_e->de_flags & DOCEF_HAS_BORDER) - doc_e->de_flags|=DOCEF_SOLID_BORDER; - } - } - DocUnlock(doc); - old_ip.lb=TRUE; - goto wmt_start; - } - } - } - if (!Bt(&task->win_inhibit,WIf_SELF_IP_R)&& - (!TaskValidate(sys_focus_task)|| - !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_IP_R))) { - if (!old_ip.rb && ip.rb) { - if (WinCursorPosSet(task,ip.pos.x,ip.pos.y)) { - old_ip.rb=TRUE; - goto wmt_start; - } - } - } - if (!Bt(&task->win_inhibit,WIf_SELF_BORDER) && has_border && - (!TaskValidate(sys_focus_task)|| - !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_BORDER))) { - if (old_ip.lb && !ip.lb) { - if (ip.pos_text.y==task->win_top-1) { - if (task->win_left<=ip.pos_text.xwin_left+4) { - TaskMsg(task,0,MSG_KEY_DOWN,CH_CTRLM,0x43200000432,0); - old_ip.lb=FALSE; - goto wmt_start; - } else if (task->win_right-2<=ip.pos_text.x<=task->win_right) { - if (DocPut(task)) - TaskMsg(task,0,MSG_KEY_DOWN,CH_SHIFT_ESC,0,0); - else - Kill(task,FALSE); - old_ip.lb=FALSE; - goto wmt_start; - } - } - } - } - if (!Bt(&task->win_inhibit,WIf_SELF_IP_L)&& - (!TaskValidate(sys_focus_task)|| - !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_IP_L))) { - if (old_ip.lb && !ip.lb) { - if (doc=WinCursorPosSet(task,ip.pos.x,ip.pos.y,FALSE)) { - do msg_code=WinMgrSleep; - while (TaskValidate(task) && - (ip.lb || ip.left_dbl_time)); - if (TaskValidate(task)) { - if (msg_code==MSG_IP_L_UP) { - if (doc->doc_signature==DOC_SIGNATURE_VAL) { - DocLock(doc); - if (TaskValidate(task)) { - if (doc->doc_signature==DOC_SIGNATURE_VAL) { - doc_e=doc->cur_entry; - if (doc_e!=doc) { - if (doc_e->de_flags & DOCEF_HAS_BORDER) - doc_e->de_flags&=~DOCEF_SOLID_BORDER; - if (doc_e->de_flags & (DOCEF_TREE|DOCEF_LST| - DOCEF_LINK|DOCEF_CHECK_COLLAPSABLE| - DOCEF_LEFT_CB|DOCEF_LEFT_MACRO|DOCEF_LEFT_EXP)) - TaskMsg(task,0,MSG_KEY_DOWN,CH_SPACE,0,0); - } - } - DocUnlock(doc); - } - } - } else if (msg_code==MSG_IP_L_D_UP) - TaskMsg(task,0,MSG_KEY_DOWN,CH_ESC,0,0); - } - old_ip.lb=FALSE; - goto wmt_start; - } - } - } - - if (!Bt(&task->win_inhibit,WIf_SELF_IP_R)&& - (!TaskValidate(sys_focus_task)|| - !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_IP_R))) { - if (old_ip.rb && !ip.rb) { - if (doc=WinCursorPosSet(task,ip.pos.x,ip.pos.y,FALSE)) { - do msg_code=WinMgrSleep; - while (TaskValidate(task) && - (ip.rb || ip.right_dbl_time)); - if (TaskValidate(task)) { - if (msg_code==MSG_IP_R_UP) { - if (doc->doc_signature==DOC_SIGNATURE_VAL) { - DocLock(doc); - if (TaskValidate(task)) { - if (doc->doc_signature==DOC_SIGNATURE_VAL) { - doc_e=doc->cur_entry; - if (doc_e!=doc) { - if (doc_e->de_flags&(DOCEF_LINK| - DOCEF_RIGHT_CB|DOCEF_RIGHT_MACRO|DOCEF_RIGHT_EXP)) - TaskMsg(task,0,MSG_KEY_DOWN,'\n',0,0); - } - } - DocUnlock(doc); - } - } - } else if (msg_code==MSG_IP_R_D_UP) - TaskMsg(task,0,MSG_KEY_DOWN,CH_SHIFT_ESC,0,0); - } - old_ip.rb=FALSE; - goto wmt_start; - } - } - } - - if (!Bt(&task->win_inhibit,WIf_SELF_BORDER) && has_border && - (!TaskValidate(sys_focus_task)|| - !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_BORDER))) { - if (ip.lb && !old_ip.lb) { - if (task->win_top==ip.pos_text.y+1 && - task->win_left-1<=ip.pos_text.x<=task->win_right+1) { - if (task->win_left<=ip.pos_text.xwin_left+4) { - old_ip.lb=TRUE; - goto wmt_start; - } - if (task->win_right-2<=ip.pos_text.x<=task->win_right) { - old_ip.lb=TRUE; - goto wmt_start; - } - x=ip.pos_text.x-task->win_left; - if (ip.lb) { - WinToTop(task); - while (ip.lb && TaskValidate(task)) { - WinHorz(ip.pos_text.x-x,task->win_width-1+ip.pos_text.x-x,task); - WinVert(ip.pos_text.y+1,task->win_height+ip.pos_text.y,task); - WinChkMoveSize(task); - WinMgrSleep; - } - } - old_ip.lb=FALSE; - goto wmt_start; - } - if (task->win_left==ip.pos_text.x+1 && - task->win_top-1<=ip.pos_text.y<=task->win_bottom+1) { - y=ip.pos_text.y-task->win_top; - if (ip.lb) { - WinToTop(task); - while (ip.lb && TaskValidate(task)) { - WinHorz(ip.pos_text.x+1,task->win_width+ip.pos_text.x,task); - WinVert(ip.pos_text.y-y, - task->win_height-1+ip.pos_text.y-y,task); - WinChkMoveSize(task); - WinMgrSleep; - } - } - old_ip.lb=FALSE; - goto wmt_start; - } - if (task->win_right+1==ip.pos_text.x && - task->win_bottom+1==ip.pos_text.y) { - if (ip.lb) { - WinToTop(task); - while (ip.lb && TaskValidate(task)) { - WinHorz(task->win_left,ip.pos_text.x-1,task); - WinVert(task->win_top,ip.pos_text.y-1,task); - WinChkMoveSize(task); - WinMgrSleep; - } - } - old_ip.lb=FALSE; - goto wmt_start; - } - if (task->win_bottom==ip.pos_text.y-1 && - task->win_left<=ip.pos_text.x<=task->win_right) { - if (ip.lb) { - WinToTop(task); - while (ip.lb && TaskValidate(task)) { - WinVert(task->win_top,ip.pos_text.y-1,task); - WinChkMoveSize(task); - WinMgrSleep; - } - } - old_ip.lb=FALSE; - goto wmt_start; - } - if (task->win_right==ip.pos_text.x-1 && - task->win_top<=ip.pos_text.y<=task->win_bottom) { - if (ip.lb) { - WinToTop(task); - while (ip.lb && TaskValidate(task)) { - WinHorz(task->win_left,ip.pos_text.x-1,task); - WinChkMoveSize(task); - WinMgrSleep; - } - } - old_ip.lb=FALSE; - goto wmt_start; - } - } - } - } catch { - Beep; - Fs->catch_except=TRUE; - task=Fs; - } - } -} diff --git a/Adam/WinB.HC b/Adam/WinB.HC new file mode 100644 index 0000000..52d5327 --- /dev/null +++ b/Adam/WinB.HC @@ -0,0 +1,844 @@ +#help_index "Windows;Task/Delay" + +public U0 WinMgrSync(I64 cnt=1,Bool force=FALSE) +{//Wait for win manager to start and finish updating screen. + //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 + // and Set Cur Pos. + Bool old_full_refresh, + old_idle=LBts(&Fs->task_flags,TASKf_IDLE); + CDoc *old_doc=DocPut; + I64 update_cnt; + if (!cnt&&force) + LBts(&sys_semas[SYS_SEMA_JUST_PUMP_MSGS],0); + while (Bt(&sys_semas[SYS_SEMA_REFRESH_IN_PROGRESS],0)) { + if (force) { + LBts(&sys_semas[SYS_SEMA_FORCE_WINMGR],0); + if (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.updateswake_jiffy=cnts.jiffies; + } + Sleep(1); + } + if (old_doc) + LBEqu(&old_doc->flags,DOCf_DO_FULL_REFRESH,old_full_refresh); + LBEqu(&Fs->task_flags,TASKf_IDLE,old_idle); +} + +#help_index "Windows" + +I64 WinQueIPMsgs(Bool que) +{ + static CD3I64 single_ip={0,0,0}; + F64 time=tS; + I64 msg_code=0,a1,a2,single_a1,single_a2; + CTask *task_focus=sys_focus_task; + + if (task_focus && !winmgr.grab_scroll) { + a1=ip.pos.x-task_focus->pix_left-task_focus->scroll_x; + a2=ip.pos.y-task_focus->pix_top-task_focus->scroll_y; + single_a1=single_ip.x-task_focus->pix_left-task_focus->scroll_x; + single_a2=single_ip.y-task_focus->pix_top-task_focus->scroll_y; + if (old_ip.presnap.x!=ip.presnap.x || old_ip.presnap.y!=ip.presnap.y) { + if (que) + TaskMsg(task_focus,0, + MSG_IP_MOVE,a1,a2,0); + msg_code=MSG_IP_MOVE; + } +//TODO que msg for ip.pos.z? + if (ip.left_dbl_time) { + if (time>ip.left_dbl_time) { + if (ip.left_dbl) { + if (!ip.left_down_sent) { + if (que) + TaskMsg(task_focus,0, + MSG_IP_L_D_DOWN,a1,a2,0); + ip.left_down_sent=TRUE; + msg_code=MSG_IP_L_D_DOWN; + } + if (!ip.lb) { + if (que) + TaskMsg(task_focus,0, + MSG_IP_L_D_UP,a1,a2,0); + ip.left_dbl_time=0; + msg_code=MSG_IP_L_D_UP; + } + } else { + if (!ip.left_down_sent) { + if (que) + TaskMsg(task_focus,0, + MSG_IP_L_DOWN,single_a1,single_a2,0); + ip.left_down_sent=TRUE; + msg_code=MSG_IP_L_DOWN; + } + if (!ip.lb) { + if (que) + TaskMsg(task_focus,0, + MSG_IP_L_UP,a1,a2,0); + ip.left_dbl_time=0; + msg_code=MSG_IP_L_UP; + } + } + } else { + if (ip.lb && !ip_last.lb) { + ip.left_dbl_time=time; + ip.left_dbl=TRUE; + } + } + } else { + if (TaskValidate(task_focus) && + Bt(&task_focus->win_inhibit,WIf_FOCUS_TASK_IP_L_D)) { + if (ip.lb && !ip_last.lb) { + if (que) + TaskMsg(task_focus,0, + MSG_IP_L_DOWN,a1,a2,0); + msg_code=MSG_IP_L_DOWN; + } else if (!ip.lb && ip_last.lb) { + if (que) + TaskMsg(task_focus,0, + MSG_IP_L_UP,a1,a2,0); + msg_code=MSG_IP_L_UP; + } + } else { + if (ip.lb && !ip_last.lb) { + ip.left_dbl=FALSE; + ip.left_down_sent=FALSE; + ip.left_dbl_time=time+ip.dbl_time; + single_ip.x=ip.pos.x; + single_ip.y=ip.pos.y; + } + } + } + + if (ip.right_dbl_time) { + if (time>ip.right_dbl_time) { + if (ip.right_dbl) { + if (!ip.right_down_sent) { + if (que) + TaskMsg(task_focus,0, + MSG_IP_R_D_DOWN,a1,a2,0); + ip.right_down_sent=TRUE; + msg_code=MSG_IP_R_D_DOWN; + } + if (!ip.rb) { + if (que) + TaskMsg(task_focus,0, + MSG_IP_R_D_UP,a1,a2,0); + ip.right_dbl_time=0; + msg_code=MSG_IP_R_D_UP; + } + } else { + if (!ip.right_down_sent) { + if (que) + TaskMsg(task_focus,0, + MSG_IP_R_DOWN,single_a1,single_a2,0); + ip.right_down_sent=TRUE; + msg_code=MSG_IP_R_DOWN; + } + if (!ip.rb) { + if (que) + TaskMsg(task_focus,0, + MSG_IP_R_UP,a1,a2,0); + ip.right_dbl_time=0; + msg_code=MSG_IP_R_UP; + } + } + } else { + if (ip.rb && !ip_last.rb) { + ip.right_dbl_time=time; + ip.right_dbl=TRUE; + } + } + } else { + if (TaskValidate(task_focus) && + Bt(&task_focus->win_inhibit,WIf_FOCUS_TASK_IP_R_D)) { + if (ip.rb && !ip_last.rb) { + if (que) + TaskMsg(task_focus,0, + MSG_IP_R_DOWN,a1,a2,0); + msg_code=MSG_IP_R_DOWN; + } else if (!ip.rb && ip_last.rb) { + if (que) + TaskMsg(task_focus,0, + MSG_IP_R_UP,a1,a2,0); + msg_code=MSG_IP_R_UP; + } + } else { + if (ip.rb && !ip_last.rb) { + ip.right_dbl=FALSE; + ip.right_down_sent=FALSE; + ip.right_dbl_time=time+ip.dbl_time; + single_ip.x=ip.pos.x; + single_ip.y=ip.pos.y; + } + } + } + + MemCpy(&ip_last,&ip,sizeof(CIPStateGlbls)); + MemCpy(&old_ip,&ip,sizeof(CIPStateGlbls)); + } + return msg_code; +} + +U0 WinCalcIdles() +{ + F64 calc_idle_time; + I64 i,k,total_jiffies,total_jiffies_delta,idle_pt_hits[MP_MAX_PROCESSORS]; + CCPU *c; + CWinMgrTimingGlbls *t=winmgr.t; + + if ((t->calc_idle_delta_time= + (calc_idle_time=tS)-t->last_calc_idle_time)>.25) { + PUSHFD + CLI + total_jiffies=cpu_structs[0].total_jiffies; + for (i=0;ilast_total_jiffies; + for (i=0;ilast_idle_pt_hits[i])>=0) + c->idle_factor=Clamp(ToF64(k)/total_jiffies_delta,0.01,0.99); + else + c->idle_factor=0.01; + t->last_idle_pt_hits[i]=idle_pt_hits[i]; + } + t->last_total_jiffies=total_jiffies; + t->last_calc_idle_time=calc_idle_time; + t->calc_idle_cnt++; + } +} + +I64 WinMgrSleep(Bool flush_msgs=FALSE) +{ + I64 timeout_val,msg_code=0; + CCtrl *c; + Bool que; + F64 t,t_delta; + + TimeStampFreqCal; + if ((t_delta=(t=tS)-winmgr.last_refresh_tS)>0.01) + winmgr.fps=Max(1.0/t_delta,1); + else + winmgr.fps=99; + winmgr.last_refresh_tS=t; + WinCalcIdles; + + if (flush_msgs) + FifoI64Flush(kbd.scan_code_fifo); + else if (TaskValidate(sys_focus_task)) { + KbdMsgsQue; + + que=TRUE; + if (TaskValidate(sys_focus_task) && + !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_CTRLS)) { + c=sys_focus_task->next_ctrl; + while (c!=&sys_focus_task->next_ctrl) { + if (CtrlInside(c,ip.pos.x,ip.pos.y)) { + que=FALSE; + break; + } + c=c->next; + } + } + msg_code=WinQueIPMsgs(que); + } else { + WinRefocus(sys_focus_task); + if (!TaskValidate(sys_focus_task)) + FifoI64Flush(kbd.scan_code_fifo); + } + if (sys_focus_task) + LBtr(&sys_focus_task->task_flags,TASKf_HAS_SONG); + WinIPUpdate; + + if (!LBtr(&sys_semas[SYS_SEMA_JUST_PUMP_MSGS],0)) { + timeout_val=cnts.jiffies+JIFFY_FREQ/WINMGR_FPS; + LBts(&sys_semas[SYS_SEMA_REFRESH_IN_PROGRESS],0); + GrUpdateScreen; + LBtr(&sys_semas[SYS_SEMA_REFRESH_IN_PROGRESS],0); + + if (sys_focus_task && !Bt(&sys_focus_task->task_flags,TASKf_HAS_SONG)) { + Free(music.cur_song); + music.cur_song=NULL; + } + if (music.cur_song) { + if (!music.cur_song_task) + music.cur_song_task=Spawn(&CurSongTask,NULL,"Song"); + } else if (music.cur_song_task) { + Kill(music.cur_song_task); + music.cur_song_task=NULL; + } + winmgr.updates++; + if (!mouse.install_attempts) + SleepUntil(timeout_val); //Just for before mouse install attempt at boot. + else + do { + KbdMouseHandler(FALSE,TRUE); + SleepUntil(MinI64(timeout_val,cnts.jiffies+JIFFY_FREQ/500)); + } while (cnts.jiffiesflags&DOCF_DONT_SHOW) + res=NULL; + else if (set_cursor) { + unlock=DocLock(res); + if (res->doc_signature!=DOC_SIGNATURE_VAL) + res=NULL; + else { + x0=res->line_start_col; + y0=res->top_line_num; + DocRecalc(res,RECALCF_HAS_CURSOR); + res->x=(ipx-task->pix_left-task->scroll_x)/FONT_WIDTH +x0; + res->y=(ipy-task->pix_top -task->scroll_y)/FONT_HEIGHT+y0; + DocRecalc(res,RECALCt_FIND_CURSOR); + task->scroll_x=0; + task->scroll_y=0; + task->scroll_z=0; + if (unlock) + DocUnlock(res); + } + } + WinToTop(task); + } + return res; +} + +Bool WinKeyNavMenu() +{ + I64 i,old_key_cnt; + CD3I64 old_pos,new_pos; + CMenu *m; + CMenuEntry *tempme; + CTask *focus=MenuTask; + if (Bt(kbd.down_bitmap,SC_GUI) && focus && (m=focus->cur_menu)) { + winmgr.show_menu=TRUE; + sys_cur_submenu_entry=NULL; + old_pos.x=ip.pos.x; old_pos.y=ip.pos.y; + ip.pos.x=new_pos.x=ip.pos.y=new_pos.y=0; + while (Bt(kbd.down_bitmap,SC_GUI)) { + old_key_cnt=kbd.cnt; + if (Bt(kbd.down_bitmap,SC_CURSOR_LEFT)) { + while (Bt(kbd.down_bitmap,SC_CURSOR_LEFT) && kbd.cnt==old_key_cnt) + WinMgrSleep(TRUE); + if (new_pos.x) { + i=0; + tempme=m->sub; + while (tempme) { + if (i+MenuEntryWidth(tempme)*FONT_WIDTH==new_pos.x) { + new_pos.x=i; + break; + } + i+=MenuEntryWidth(tempme)*FONT_WIDTH; + tempme=tempme->next; + } + } + new_pos.y=0; + } else if (Bt(kbd.down_bitmap,SC_CURSOR_RIGHT)) { + while (Bt(kbd.down_bitmap,SC_CURSOR_RIGHT) && kbd.cnt==old_key_cnt) + WinMgrSleep(TRUE); + i=0; + tempme=m->sub; + while (tempme) { + if (i==new_pos.x) { + if (tempme->next) + new_pos.x=i+MenuEntryWidth(tempme)*FONT_WIDTH; + break; + } + i+=MenuEntryWidth(tempme)*FONT_WIDTH; + tempme=tempme->next; + } + new_pos.y=0; + } else if (Bt(kbd.down_bitmap,SC_CURSOR_UP)) { + while (Bt(kbd.down_bitmap,SC_CURSOR_UP) && kbd.cnt==old_key_cnt) + WinMgrSleep(TRUE); + new_pos.y-=FONT_HEIGHT; + } else if (Bt(kbd.down_bitmap,SC_CURSOR_DOWN)) { + while (Bt(kbd.down_bitmap,SC_CURSOR_DOWN) && kbd.cnt==old_key_cnt) + WinMgrSleep(TRUE); + new_pos.y+=FONT_HEIGHT; + } + new_pos.x=ClampI64(new_pos.x,0,GR_WIDTH-1); + new_pos.y=ClampI64(new_pos.y,0,GR_HEIGHT-1); + ip.pos.x=new_pos.x; ip.pos.y=new_pos.y; + WinMgrSleep(TRUE); + if (!sys_cur_submenu_entry) + ip.pos.y=new_pos.y=0; + } + if (sys_cur_submenu_entry) + TaskMsg(sys_focus_task,0,sys_cur_submenu_entry->msg_code, + sys_cur_submenu_entry->a1,sys_cur_submenu_entry->a2,0); + winmgr.show_menu=FALSE; + ip.pos.x=old_pos.x; ip.pos.y=old_pos.y; + return TRUE; + } + return FALSE; +} + +U0 WinMgrTask(I64) +{ + CTask *task=Fs; + CDoc *doc; + CDocEntry *doc_e; + I64 x,y,z,msg_code, + my_ip_z=0,left,top, + old_flags=GetRFlags; + Bool has_border; + CCtrl *c; + WinHorz(0,TEXT_COLS-1); + WinVert(0,TEXT_ROWS-1); + LBts(&Fs->display_flags,DISPLAYf_NO_BORDER); + LBts(&Fs->display_flags,DISPLAYf_SHOW); + gr.dc->win_task=Fs; + Fs->win_inhibit&=~WIF_SELF_CTRLS; + GrSetUpTables; + WinZBufUpdate; + LBts(&sys_run_level,RLf_WINMGR); + while (TRUE) { + try { +wmt_start: + if (Bt(&sys_run_level,RLf_ADAM_SERVER)) + TaskKillDying; + WinMgrSleep; + + task=Fs->last_task; + while (TRUE) { + CLI + if (!TaskValidate(task)) { + SetRFlags(old_flags); + goto wmt_start; + } + TaskDerivedValsUpdate(task,FALSE); + task=task->last_task; + SetRFlags(old_flags); + if (task==Fs) + break; + } + TaskDerivedValsUpdate(Fs,FALSE); + + task=Fs->last_task; + while (TRUE) { + CLI + if (!TaskValidate(task)) { + SetRFlags(old_flags); + goto wmt_start; + } + if (WinInside(ip.pos.x,ip.pos.y,task,FONT_WIDTH)) { + SetRFlags(old_flags); + break; + } + if (task==Fs) { //Shouldn't happen + SetRFlags(old_flags); + goto wmt_start; + } + task=task->last_task; + SetRFlags(old_flags); + } + + if (Bt(&task->display_flags,DISPLAYf_NO_BORDER)) + has_border=FALSE; + else + has_border=TRUE; + + winmgr.show_menu=FALSE; + sys_cur_submenu_entry=NULL; + if (TaskValidate(sys_focus_task) && + !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_MENU)) { + if (WinKeyNavMenu) + goto wmt_start; + if (task==Fs && 0<=ip.pos.ymsg_code, + sys_cur_submenu_entry->a1, + sys_cur_submenu_entry->a2,0); + winmgr.show_menu=FALSE; + old_ip.lb=FALSE; + goto wmt_start; + } + } + } + + //grab scroll + if (!Bt(&task->win_inhibit,WIf_SELF_GRAB_SCROLL) && + (!TaskValidate(sys_focus_task)|| + !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_GRAB_SCROLL)) && + kbd.scan_code&SCF_CTRL && TaskValidate(task)) { + winmgr.grab_scroll_closed=FALSE; + winmgr.grab_scroll=TRUE; + while (kbd.scan_code&SCF_CTRL && TaskValidate(task) && (!ac.task || + !WinInside(ip.pos.x,ip.pos.y,ac.task,FONT_WIDTH))) { + if (ip.lb) { + winmgr.grab_scroll_closed=TRUE; + x=ip.pos.x-task->scroll_x; + y=ip.pos.y-task->scroll_y; + z=ip.pos.z-task->scroll_z; + while (ip.lb && kbd.scan_code&SCF_CTRL && TaskValidate(task)) { + task->scroll_x=(ip.pos.x-x)&~7; + task->scroll_y=(ip.pos.y-y)&~7; + task->scroll_z=ip.pos.z-z; + WinMgrSleep(TRUE); + } + winmgr.grab_scroll_closed=FALSE; + } else if (ip.rb) { + task->scroll_x=0; + task->scroll_y=0; + task->scroll_z=0; + WinMgrSleep(TRUE); + } else + WinMgrSleep; + } + winmgr.grab_scroll=FALSE; + goto wmt_start; + } else + winmgr.grab_scroll=FALSE; + + if (!Bt(&task->win_inhibit,WIf_SELF_CTRLS) && + (!TaskValidate(sys_focus_task)|| + !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_CTRLS))) { + if (ip.lb && !old_ip.lb) { + c=task->next_ctrl; + while (c!=&task->next_ctrl) { + if (CtrlInside(c,ip.pos.x,ip.pos.y)) { + left=task->pix_left; + top =task->pix_top; + if (c->flags&CTRLF_BORDER) { + left-=FONT_WIDTH; + top -=FONT_HEIGHT; + } + if (c->flags&CTRLF_CAPTURE_LEFT_IP) { + while (ip.lb && TaskValidate(task)) { + if (c->left_click) + (*c->left_click)(c,ip.pos.x-left,ip.pos.y-top,TRUE); + WinMgrSleep; + } + if (c->left_click) + (*c->left_click)(c,ip.pos.x-left,ip.pos.y-top,FALSE); + old_ip.lb=FALSE; + goto wmt_start; + } else { + if (c->left_click) + (*c->left_click)(c,ip.pos.x-left,ip.pos.y-top,TRUE); + old_ip.lb=TRUE; + goto wmt_start; + } + } + c=c->next; + } + } + if (old_ip.lb && !ip.lb) { + c=task->next_ctrl; + while (c!=&task->next_ctrl) { + if (CtrlInside(c,ip.pos.x,ip.pos.y)) { + left=task->pix_left; + top =task->pix_top; + if (c->flags&CTRLF_BORDER) { + left-=FONT_WIDTH; + top -=FONT_HEIGHT; + } + if (c->left_click) + (*c->left_click)(c,ip.pos.x-left,ip.pos.y-top,FALSE); + old_ip.lb=FALSE; + goto wmt_start; + } + c=c->next; + } + } + if (ip.rb && !old_ip.rb) { + c=task->next_ctrl; + while (c!=&task->next_ctrl) { + if (CtrlInside(c,ip.pos.x,ip.pos.y)) { + left=task->pix_left; + top =task->pix_top; + if (c->flags&CTRLF_BORDER) { + left-=FONT_WIDTH; + top -=FONT_HEIGHT; + } + if (c->flags&CTRLF_CAPTURE_RIGHT_IP) { + while (ip.rb && TaskValidate(task)) { + if (c->right_click) + (*c->right_click)(c,ip.pos.x-left,ip.pos.y-top,TRUE); + WinMgrSleep; + } + if (c->right_click) + (*c->right_click)(c,ip.pos.x-left,ip.pos.y-top,FALSE); + old_ip.rb=FALSE; + goto wmt_start; + } else { + if (c->right_click) + (*c->right_click)(c,ip.pos.x-left,ip.pos.y-top,TRUE); + old_ip.rb=TRUE; + goto wmt_start; + } + } + c=c->next; + } + } + if (old_ip.rb && !ip.rb) { + c=task->next_ctrl; + while (c!=&task->next_ctrl) { + if (CtrlInside(c,ip.pos.x,ip.pos.y)) { + left=task->pix_left; + top =task->pix_top; + if (c->flags&CTRLF_BORDER) { + left-=FONT_WIDTH; + top -=FONT_HEIGHT; + } + if (c->right_click) + (*c->right_click)(c,ip.pos.x-left,ip.pos.y-top,FALSE); + old_ip.rb=FALSE; + goto wmt_start; + } + c=c->next; + } + } + if (ip.has_wheel && my_ip_z!=ip.pos.z) { + if (task==sys_focus_task) { + c=task->next_ctrl; + while (c!=&task->next_ctrl) { + if (c->wheel_chg) { + (*c->wheel_chg)(c,ip.pos.z-my_ip_z); + my_ip_z=ip.pos.z; + goto wmt_start; + } + c=c->next; + } + my_ip_z=ip.pos.z; + } else if (!sys_focus_task) + my_ip_z=ip.pos.z; + } + } + + if (task==Fs) + goto wmt_start; + + if (!Bt(&task->win_inhibit,WIf_SELF_IP_L)&& + (!TaskValidate(sys_focus_task)|| + !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_IP_L))) { + if (!old_ip.lb && ip.lb) { + if (doc=WinCursorPosSet(task,ip.pos.x,ip.pos.y)) { + DocLock(doc); + if (doc->doc_signature==DOC_SIGNATURE_VAL) { + doc_e=doc->cur_entry; + if (doc_e!=doc) { + if (doc_e->de_flags & DOCEF_HAS_BORDER) + doc_e->de_flags|=DOCEF_SOLID_BORDER; + } + } + DocUnlock(doc); + old_ip.lb=TRUE; + goto wmt_start; + } + } + } + if (!Bt(&task->win_inhibit,WIf_SELF_IP_R)&& + (!TaskValidate(sys_focus_task)|| + !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_IP_R))) { + if (!old_ip.rb && ip.rb) { + if (WinCursorPosSet(task,ip.pos.x,ip.pos.y)) { + old_ip.rb=TRUE; + goto wmt_start; + } + } + } + if (!Bt(&task->win_inhibit,WIf_SELF_BORDER) && has_border && + (!TaskValidate(sys_focus_task)|| + !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_BORDER))) { + if (old_ip.lb && !ip.lb) { + if (ip.pos_text.y==task->win_top-1) { + if (task->win_left<=ip.pos_text.xwin_left+4) { + TaskMsg(task,0,MSG_KEY_DOWN,CH_CTRLM,0x43200000432,0); + old_ip.lb=FALSE; + goto wmt_start; + } else if (task->win_right-2<=ip.pos_text.x<=task->win_right) { + if (DocPut(task)) + TaskMsg(task,0,MSG_KEY_DOWN,CH_SHIFT_ESC,0,0); + else + Kill(task,FALSE); + old_ip.lb=FALSE; + goto wmt_start; + } + } + } + } + if (!Bt(&task->win_inhibit,WIf_SELF_IP_L)&& + (!TaskValidate(sys_focus_task)|| + !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_IP_L))) { + if (old_ip.lb && !ip.lb) { + if (doc=WinCursorPosSet(task,ip.pos.x,ip.pos.y,FALSE)) { + do msg_code=WinMgrSleep; + while (TaskValidate(task) && (ip.lb || ip.left_dbl_time)); + if (TaskValidate(task)) { + if (msg_code==MSG_IP_L_UP) { + if (doc->doc_signature==DOC_SIGNATURE_VAL) { + DocLock(doc); + if (TaskValidate(task)) { + if (doc->doc_signature==DOC_SIGNATURE_VAL) { + doc_e=doc->cur_entry; + if (doc_e!=doc) { + if (doc_e->de_flags & DOCEF_HAS_BORDER) + doc_e->de_flags&=~DOCEF_SOLID_BORDER; + if (doc_e->de_flags & (DOCEF_TREE|DOCEF_LST| + DOCEF_LINK|DOCEF_CHECK_COLLAPSABLE| + DOCEF_LEFT_CB|DOCEF_LEFT_MACRO|DOCEF_LEFT_EXP)) + TaskMsg(task,0,MSG_KEY_DOWN,CH_SPACE,0,0); + } + } + DocUnlock(doc); + } + } + } else if (msg_code==MSG_IP_L_D_UP) + TaskMsg(task,0,MSG_KEY_DOWN,CH_ESC,0,0); + } + old_ip.lb=FALSE; + goto wmt_start; + } + } + } + + if (!Bt(&task->win_inhibit,WIf_SELF_IP_R)&& + (!TaskValidate(sys_focus_task)|| + !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_IP_R))) { + if (old_ip.rb && !ip.rb) { + if (doc=WinCursorPosSet(task,ip.pos.x,ip.pos.y,FALSE)) { + do msg_code=WinMgrSleep; + while (TaskValidate(task) && (ip.rb || ip.right_dbl_time)); + if (TaskValidate(task)) { + if (msg_code==MSG_IP_R_UP) { + if (doc->doc_signature==DOC_SIGNATURE_VAL) { + DocLock(doc); + if (TaskValidate(task)) { + if (doc->doc_signature==DOC_SIGNATURE_VAL) { + doc_e=doc->cur_entry; + if (doc_e!=doc) { + if (doc_e->de_flags&(DOCEF_LINK| + DOCEF_RIGHT_CB|DOCEF_RIGHT_MACRO|DOCEF_RIGHT_EXP)) + TaskMsg(task,0,MSG_KEY_DOWN,'\n',0,0); + } + } + DocUnlock(doc); + } + } + } else if (msg_code==MSG_IP_R_D_UP) + TaskMsg(task,0,MSG_KEY_DOWN,CH_SHIFT_ESC,0,0); + } + old_ip.rb=FALSE; + goto wmt_start; + } + } + } + + if (!Bt(&task->win_inhibit,WIf_SELF_BORDER) && has_border && + (!TaskValidate(sys_focus_task)|| + !Bt(&sys_focus_task->win_inhibit,WIf_FOCUS_TASK_BORDER))) { + if (ip.lb && !old_ip.lb) { + if (task->win_top==ip.pos_text.y+1 && + task->win_left-1<=ip.pos_text.x<=task->win_right+1) { + if (task->win_left<=ip.pos_text.xwin_left+4) { + old_ip.lb=TRUE; + goto wmt_start; + } + if (task->win_right-2<=ip.pos_text.x<=task->win_right) { + old_ip.lb=TRUE; + goto wmt_start; + } + x=ip.pos_text.x-task->win_left; + if (ip.lb) { + WinToTop(task); + while (ip.lb && TaskValidate(task)) { + WinHorz(ip.pos_text.x-x,task->win_width-1+ip.pos_text.x-x,task); + WinVert(ip.pos_text.y+1,task->win_height+ip.pos_text.y,task); + WinMgrSleep; + } + } + old_ip.lb=FALSE; + goto wmt_start; + } + if (task->win_left==ip.pos_text.x+1 && + task->win_top-1<=ip.pos_text.y<=task->win_bottom+1) { + y=ip.pos_text.y-task->win_top; + if (ip.lb) { + WinToTop(task); + while (ip.lb && TaskValidate(task)) { + WinHorz(ip.pos_text.x+1,task->win_width+ip.pos_text.x,task); + WinVert(ip.pos_text.y-y, + task->win_height-1+ip.pos_text.y-y,task); + WinMgrSleep; + } + } + old_ip.lb=FALSE; + goto wmt_start; + } + if (task->win_right+1==ip.pos_text.x && + task->win_bottom+1==ip.pos_text.y) { + if (ip.lb) { + WinToTop(task); + while (ip.lb && TaskValidate(task)) { + WinHorz(task->win_left,ip.pos_text.x-1,task); + WinVert(task->win_top,ip.pos_text.y-1,task); + WinMgrSleep; + } + } + old_ip.lb=FALSE; + goto wmt_start; + } + if (task->win_bottom==ip.pos_text.y-1 && + task->win_left<=ip.pos_text.x<=task->win_right) { + if (ip.lb) { + WinToTop(task); + while (ip.lb && TaskValidate(task)) { + WinVert(task->win_top,ip.pos_text.y-1,task); + WinMgrSleep; + } + } + old_ip.lb=FALSE; + goto wmt_start; + } + if (task->win_right==ip.pos_text.x-1 && + task->win_top<=ip.pos_text.y<=task->win_bottom) { + if (ip.lb) { + WinToTop(task); + while (ip.lb && TaskValidate(task)) { + WinHorz(task->win_left,ip.pos_text.x-1,task); + WinMgrSleep; + } + } + old_ip.lb=FALSE; + goto wmt_start; + } + } + } + } catch { + Beep; + Fs->catch_except=TRUE; + task=Fs; + } + } +} diff --git a/Apps/AfterEgypt/AESplash.TXT b/Apps/AfterEgypt/AESplash.DD similarity index 100% rename from Apps/AfterEgypt/AESplash.TXT rename to Apps/AfterEgypt/AESplash.DD diff --git a/Apps/AfterEgypt/AfterEgypt.CPP b/Apps/AfterEgypt/AfterEgypt.CPP deleted file mode 100644 index 148fd6a..0000000 --- a/Apps/AfterEgypt/AfterEgypt.CPP +++ /dev/null @@ -1,194 +0,0 @@ -I64 num_people=100; - -U0 SongTask(I64) -{//Song by the Holy Spirit - Fs->task_end_cb=&SndTaskEndCB; - MusicSettingsRst; - while (TRUE) { - Play("3eGFqGetBEFeBEEFetBDCeCFqF"); - Play("eGFqGetBEFeBEEFetBDCeCFqF"); - Play("AetDAAqBDeBEqEetECDGBG"); - Play("qAetDAAqBDeBEqEetECDGBG"); - } -} - -U0 HoldCourt() -{ - I64 accused,crime,victim; - Bool old_form=LBts(&(DocPut)->flags,DOCf_FORM); - - DocDblBufStart; - '\n'; - accused=RandU32%3; - "%s",LstSub(accused, - "A man \0A woman \0A child \0"); - - crime=RandU32&3; - "%s",LstSub(crime, - "commits murder\0commits adultery\0" - "commits blasphemy\0commits idolatry\0"); - - if (crime<=1) { - '' CH_SPACE; - victim=RandU32%3; - "%s",LstSub(victim,"to a man\0to a woman\0to a child\0to an animal\0"); - } - if (!(RandU32%5)) - ", again!"; - else - '.'; - "\n\n\n\n" - "$$LM,4$$" - "\n\n$$BT,\"Show Mercy\",LE=0$$\n\n" - "\n\n$$BT,\"Punish\",LE=1$$\n\n" - "\n\n$$BT,\"Really Punish\",LE=2$$\n\n" - "$$LM,0$$"; - DocDblBufEnd; - DocMenu(DocPut); - - LBEqu(&(DocPut)->flags,DOCf_FORM,old_form); - DocBottom; -} - -#define T_BREAK_CAMP 0 -#define T_TALK_WITH_GOD 1 -#define T_VIEW_CLOUDS 2 -#define T_HOLD_COURT 3 -#define T_VIEW_MAP 4 -#define T_WATER_ROCK 5 -#define T_BATTLE 6 -#define T_QUAIL 7 -#define T_MOSES_COMICS 8 -#define T_HELP 9 -#define T_QUIT 10 - -Bool TakeTurn() -{ - I64 i; - Bool res,old_form=LBts(&(DocPut)->flags,DOCf_FORM); - num_people*=1.0+0.01*((RandU16%100)-30); - if (num_people>MAX_PEOPLE) - num_people=MAX_PEOPLE; - - if (!Fs->song_task) - Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs); - Camp(num_people); - Kill(Fs->song_task); - - DocDblBufStart; - "$$LM,4$$" - "\n\n$$BT,\"Break Camp\",LE=T_BREAK_CAMP$$\n\n" - "\n\n$$BT,\"Talk with God\",LE=T_TALK_WITH_GOD$$\n\n" - "\n\n$$BT,\"View Clouds\",LE=T_VIEW_CLOUDS$$\n\n" - "\n\n$$BT,\"Hold Court\",LE=T_HOLD_COURT$$\n\n" - "\n\n$$BT,\"View Map\",LE=T_VIEW_MAP$$\n\n" - "\n\n$$BT,\"Make Water\",LE=T_WATER_ROCK$$\n\n" - "\n\n$$BT,\"Battle\",LE=T_BATTLE$$\n\n" - "\n\n$$BT,\"Beg for Meat\",LE=T_QUAIL$$\n\n" - "\n\n$$BT,\"Moses Comics\",LE=T_MOSES_COMICS$$\n\n" - "\n\n$$BT,\"Help\",LE=T_HELP$$\n\n" - "\n\n$$BT,\"Quit\",LE=T_QUIT$$\n\n" - "$$LM,0$$"; - DocDblBufEnd; - i=DocMenu(DocPut,DOF_DONT_TEXT_ATTR); - - LBEqu(&(DocPut)->flags,DOCf_FORM,old_form); - DocBottom; - - if (!(0<=isong_task=NULL; - return res; -} - -U0 TMsg(CDC *dc,U8 *msg) -{ - F64 t0=tS; - while (tS-t0<1.5) { - if (Blink(5)) - dc->color=BLACK; - else - dc->color=RED; - GrRect(dc,0,GR_HEIGHT-FONT_HEIGHT*3,GR_WIDTH,FONT_HEIGHT*2); - dc->color=BLACK; - GrRect(dc,2,GR_HEIGHT-FONT_HEIGHT*3+2,GR_WIDTH-4,FONT_HEIGHT*2-4); - dc->color=YELLOW; - GrPrint(dc,(GR_WIDTH-StrLen(msg)*FONT_WIDTH)/2, - GR_HEIGHT-5*FONT_HEIGHT/2,"%s",msg); - WinMgrSync; - if (ScanChar) - throw; - } -} - -U0 Trailer() -{ - CDC *dc=DCAlias; - WinBorder; - WinMax; - Cd(Fs->parent_task->cur_dir); - Type("AESplash.TXT"); - Sleep(500); - try { - TMsg(dc,"Leaving all behind, they fled."); - TMsg(dc,"Found themselves in a desert."); - TMsg(dc,"God! We're gonna die!"); - TMsg(dc,"\"Trust Me!\""); - } catch - Fs->catch_except=TRUE; - DCFill; - DCDel(dc); -} - -U0 AfterEgypt() -{ - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs); - AutoComplete; - WinBorder; - WinMax; - DocClear; - PopUp("Trailer;",Fs); - try //Catch . - while (TakeTurn); - catch - PutExcept; - DocClear; - SettingsPop; -} diff --git a/Apps/AfterEgypt/AfterEgypt.HC b/Apps/AfterEgypt/AfterEgypt.HC new file mode 100644 index 0000000..3d83fa6 --- /dev/null +++ b/Apps/AfterEgypt/AfterEgypt.HC @@ -0,0 +1,194 @@ +I64 num_people=100; + +U0 SongTask(I64) +{//Song by the Holy Spirit + Fs->task_end_cb=&SndTaskEndCB; + MusicSettingsRst; + while (TRUE) { + Play("3eGFqGetBEFeBEEFetBDCeCFqF"); + Play("eGFqGetBEFeBEEFetBDCeCFqF"); + Play("AetDAAqBDeBEqEetECDGBG"); + Play("qAetDAAqBDeBEqEetECDGBG"); + } +} + +U0 HoldCourt() +{ + I64 accused,crime,victim; + Bool old_form=LBts(&(DocPut)->flags,DOCf_FORM); + + DocDblBufStart; + '\n'; + accused=RandU32%3; + "%s",LstSub(accused, + "A man \0A woman \0A child \0"); + + crime=RandU32&3; + "%s",LstSub(crime, + "commits murder\0commits adultery\0" + "commits blasphemy\0commits idolatry\0"); + + if (crime<=1) { + '' CH_SPACE; + victim=RandU32%3; + "%s",LstSub(victim,"to a man\0to a woman\0to a child\0to an animal\0"); + } + if (!(RandU32%5)) + ", again!"; + else + '.'; + "\n\n\n\n" + "$$LM,4$$" + "\n\n$$BT,\"Show Mercy\",LE=0$$\n\n" + "\n\n$$BT,\"Punish\",LE=1$$\n\n" + "\n\n$$BT,\"Really Punish\",LE=2$$\n\n" + "$$LM,0$$"; + DocDblBufEnd; + DocMenu(DocPut); + + LBEqu(&(DocPut)->flags,DOCf_FORM,old_form); + DocBottom; +} + +#define T_BREAK_CAMP 0 +#define T_TALK_WITH_GOD 1 +#define T_VIEW_CLOUDS 2 +#define T_HOLD_COURT 3 +#define T_VIEW_MAP 4 +#define T_WATER_ROCK 5 +#define T_BATTLE 6 +#define T_QUAIL 7 +#define T_MOSES_COMICS 8 +#define T_HELP 9 +#define T_QUIT 10 + +Bool TakeTurn() +{ + I64 i; + Bool res,old_form=LBts(&(DocPut)->flags,DOCf_FORM); + num_people*=1.0+0.01*((RandU16%100)-30); + if (num_people>MAX_PEOPLE) + num_people=MAX_PEOPLE; + + if (!Fs->song_task) + Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs); + Camp(num_people); + Kill(Fs->song_task); + + DocDblBufStart; + "$$LM,4$$" + "\n\n$$BT,\"Break Camp\",LE=T_BREAK_CAMP$$\n\n" + "\n\n$$BT,\"Talk with God\",LE=T_TALK_WITH_GOD$$\n\n" + "\n\n$$BT,\"View Clouds\",LE=T_VIEW_CLOUDS$$\n\n" + "\n\n$$BT,\"Hold Court\",LE=T_HOLD_COURT$$\n\n" + "\n\n$$BT,\"View Map\",LE=T_VIEW_MAP$$\n\n" + "\n\n$$BT,\"Make Water\",LE=T_WATER_ROCK$$\n\n" + "\n\n$$BT,\"Battle\",LE=T_BATTLE$$\n\n" + "\n\n$$BT,\"Beg for Meat\",LE=T_QUAIL$$\n\n" + "\n\n$$BT,\"Moses Comics\",LE=T_MOSES_COMICS$$\n\n" + "\n\n$$BT,\"Help\",LE=T_HELP$$\n\n" + "\n\n$$BT,\"Quit\",LE=T_QUIT$$\n\n" + "$$LM,0$$"; + DocDblBufEnd; + i=DocMenu(DocPut,DOF_DONT_TEXT_ATTR); + + LBEqu(&(DocPut)->flags,DOCf_FORM,old_form); + DocBottom; + + if (!(0<=isong_task=NULL; + return res; +} + +U0 TMsg(CDC *dc,U8 *msg) +{ + F64 t0=tS; + while (tS-t0<1.5) { + if (Blink(5)) + dc->color=BLACK; + else + dc->color=RED; + GrRect(dc,0,GR_HEIGHT-FONT_HEIGHT*3,GR_WIDTH,FONT_HEIGHT*2); + dc->color=BLACK; + GrRect(dc,2,GR_HEIGHT-FONT_HEIGHT*3+2,GR_WIDTH-4,FONT_HEIGHT*2-4); + dc->color=YELLOW; + GrPrint(dc,(GR_WIDTH-StrLen(msg)*FONT_WIDTH)/2, + GR_HEIGHT-5*FONT_HEIGHT/2,"%s",msg); + WinMgrSync; + if (ScanChar) + throw; + } +} + +U0 Trailer() +{ + CDC *dc=DCAlias; + WinBorder; + WinMax; + Cd(Fs->parent_task->cur_dir); + Type("AESplash.DD"); + Sleep(500); + try { + TMsg(dc,"Leaving all behind, they fled."); + TMsg(dc,"Found themselves in a desert."); + TMsg(dc,"God! We're gonna die!"); + TMsg(dc,"\"Trust Me!\""); + } catch + Fs->catch_except=TRUE; + DCFill; + DCDel(dc); +} + +U0 AfterEgypt() +{ + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs); + AutoComplete; + WinBorder; + WinMax; + DocClear; + PopUp("Trailer;",Fs); + try //Catch . + while (TakeTurn); + catch + PutExcept; + DocClear; + SettingsPop; +} diff --git a/Apps/AfterEgypt/Battle.CPP b/Apps/AfterEgypt/Battle.HC similarity index 100% rename from Apps/AfterEgypt/Battle.CPP rename to Apps/AfterEgypt/Battle.HC diff --git a/Apps/AfterEgypt/Comics.CPP b/Apps/AfterEgypt/Comics.CPP deleted file mode 100644 index 603b1eb..0000000 --- a/Apps/AfterEgypt/Comics.CPP +++ /dev/null @@ -1,26 +0,0 @@ -U0 ViewComics() -{ - I64 i=0; - U8 *st; - CDirEntry *tempde=FilesFind("Comics/*.TXT*"),*tempde1=tempde; - CDoc *doc=DocNew; - DocPrint(doc,"$$LTBLUE$$"); - while (tempde) { - st=StrNew(tempde->name); - FileExtRem(st); - tempde->user_data=DocPrint(doc,"$$MU-UL,\"%-10ts\",LE=%d$$ ",st,tempde); - Free(st); - tempde=tempde->next; - if ((i++&3)==3) - DocPrint(doc,"\n"); - } - while (TRUE) { - if ((tempde=PopUpMenu(doc))>0) - Ed(tempde->full_name); - else - break; - } - DocDel(doc); - DirTreeDel(tempde1); -} - diff --git a/Apps/AfterEgypt/Comics.HC b/Apps/AfterEgypt/Comics.HC new file mode 100644 index 0000000..aed4b02 --- /dev/null +++ b/Apps/AfterEgypt/Comics.HC @@ -0,0 +1,26 @@ +U0 ViewComics() +{ + I64 i=0; + U8 *st; + CDirEntry *tempde=FilesFind("Comics/*.DD*"),*tempde1=tempde; + CDoc *doc=DocNew; + DocPrint(doc,"$$LTBLUE$$"); + while (tempde) { + st=StrNew(tempde->name); + FileExtRem(st); + tempde->user_data=DocPrint(doc,"$$MU-UL,\"%-10ts\",LE=%d$$ ",st,tempde); + Free(st); + tempde=tempde->next; + if ((i++&3)==3) + DocPrint(doc,"\n"); + } + while (TRUE) { + if ((tempde=PopUpMenu(doc))>0) + Ed(tempde->full_name); + else + break; + } + DocDel(doc); + DirTreeDel(tempde1); +} + diff --git a/Apps/AfterEgypt/Comics/Moses01.TXT b/Apps/AfterEgypt/Comics/Moses01.DD similarity index 100% rename from Apps/AfterEgypt/Comics/Moses01.TXT rename to Apps/AfterEgypt/Comics/Moses01.DD diff --git a/Apps/AfterEgypt/Comics/Moses02.TXT b/Apps/AfterEgypt/Comics/Moses02.DD similarity index 100% rename from Apps/AfterEgypt/Comics/Moses02.TXT rename to Apps/AfterEgypt/Comics/Moses02.DD diff --git a/Apps/AfterEgypt/Comics/Moses04.TXT b/Apps/AfterEgypt/Comics/Moses04.DD similarity index 100% rename from Apps/AfterEgypt/Comics/Moses04.TXT rename to Apps/AfterEgypt/Comics/Moses04.DD diff --git a/Apps/AfterEgypt/Comics/Moses05.TXT b/Apps/AfterEgypt/Comics/Moses05.DD similarity index 100% rename from Apps/AfterEgypt/Comics/Moses05.TXT rename to Apps/AfterEgypt/Comics/Moses05.DD diff --git a/Apps/AfterEgypt/Comics/Moses06.TXT b/Apps/AfterEgypt/Comics/Moses06.DD similarity index 100% rename from Apps/AfterEgypt/Comics/Moses06.TXT rename to Apps/AfterEgypt/Comics/Moses06.DD diff --git a/Apps/AfterEgypt/Comics/Moses07.TXT b/Apps/AfterEgypt/Comics/Moses07.DD similarity index 100% rename from Apps/AfterEgypt/Comics/Moses07.TXT rename to Apps/AfterEgypt/Comics/Moses07.DD diff --git a/Apps/AfterEgypt/Comics/Moses08.TXT b/Apps/AfterEgypt/Comics/Moses08.DD similarity index 100% rename from Apps/AfterEgypt/Comics/Moses08.TXT rename to Apps/AfterEgypt/Comics/Moses08.DD diff --git a/Apps/AfterEgypt/GodTalking.CPP b/Apps/AfterEgypt/GodTalking.CPP deleted file mode 100644 index aef2b02..0000000 Binary files a/Apps/AfterEgypt/GodTalking.CPP and /dev/null differ diff --git a/Apps/AfterEgypt/GodTalking.HC b/Apps/AfterEgypt/GodTalking.HC new file mode 100644 index 0000000..4775360 Binary files /dev/null and b/Apps/AfterEgypt/GodTalking.HC differ diff --git a/Apps/AfterEgypt/HorebA.CPP b/Apps/AfterEgypt/HorebA.CPP deleted file mode 100644 index 1ed9051..0000000 Binary files a/Apps/AfterEgypt/HorebA.CPP and /dev/null differ diff --git a/Apps/AfterEgypt/HorebA.HC b/Apps/AfterEgypt/HorebA.HC new file mode 100644 index 0000000..7c2a212 Binary files /dev/null and b/Apps/AfterEgypt/HorebA.HC differ diff --git a/Apps/AfterEgypt/HorebBMP.CPP b/Apps/AfterEgypt/HorebBMP.HC similarity index 100% rename from Apps/AfterEgypt/HorebBMP.CPP rename to Apps/AfterEgypt/HorebBMP.HC diff --git a/Apps/AfterEgypt/HorebBSP.CPP b/Apps/AfterEgypt/HorebBSP.HC similarity index 100% rename from Apps/AfterEgypt/HorebBSP.CPP rename to Apps/AfterEgypt/HorebBSP.HC diff --git a/Apps/AfterEgypt/HorebC.CPP b/Apps/AfterEgypt/HorebC.HC similarity index 100% rename from Apps/AfterEgypt/HorebC.CPP rename to Apps/AfterEgypt/HorebC.HC diff --git a/Apps/AfterEgypt/Load.CPP b/Apps/AfterEgypt/Load.HC similarity index 100% rename from Apps/AfterEgypt/Load.CPP rename to Apps/AfterEgypt/Load.HC diff --git a/Apps/AfterEgypt/Map.CPP b/Apps/AfterEgypt/Map.HC similarity index 100% rename from Apps/AfterEgypt/Map.CPP rename to Apps/AfterEgypt/Map.HC diff --git a/Apps/AfterEgypt/Quail.CPP b/Apps/AfterEgypt/Quail.CPP deleted file mode 100644 index a996abf..0000000 Binary files a/Apps/AfterEgypt/Quail.CPP and /dev/null differ diff --git a/Apps/AfterEgypt/Quail.HC b/Apps/AfterEgypt/Quail.HC new file mode 100644 index 0000000..b9cc1ae Binary files /dev/null and b/Apps/AfterEgypt/Quail.HC differ diff --git a/Apps/AfterEgypt/Run.CPP b/Apps/AfterEgypt/Run.HC similarity index 100% rename from Apps/AfterEgypt/Run.CPP rename to Apps/AfterEgypt/Run.HC diff --git a/Apps/AfterEgypt/WaterRock.CPP b/Apps/AfterEgypt/WaterRock.HC similarity index 100% rename from Apps/AfterEgypt/WaterRock.CPP rename to Apps/AfterEgypt/WaterRock.HC diff --git a/Apps/Budget/Accts.TXT b/Apps/Budget/Accts.DD similarity index 100% rename from Apps/Budget/Accts.TXT rename to Apps/Budget/Accts.DD diff --git a/Apps/Budget/BgtAccts.CPP b/Apps/Budget/BgtAccts.HC similarity index 100% rename from Apps/Budget/BgtAccts.CPP rename to Apps/Budget/BgtAccts.HC diff --git a/Apps/Budget/BgtEntry.CPP b/Apps/Budget/BgtEntry.HC similarity index 100% rename from Apps/Budget/BgtEntry.CPP rename to Apps/Budget/BgtEntry.HC diff --git a/Apps/Budget/BgtFile.CPP b/Apps/Budget/BgtFile.HC similarity index 100% rename from Apps/Budget/BgtFile.CPP rename to Apps/Budget/BgtFile.HC diff --git a/Apps/Budget/BgtMain.CPP b/Apps/Budget/BgtMain.CPP deleted file mode 100644 index 54f8a39..0000000 --- a/Apps/Budget/BgtMain.CPP +++ /dev/null @@ -1,214 +0,0 @@ -extern U0 BgtRegen(); - -Bool BgtPutKey(CDoc *doc,U8 *,I64 ch,I64 sc) -{//ch=ASCII; sc=scan_code - no_warn sc; - CBgtEntry *tempb,*tempb1; - CBgtTemplate *tempt,*tempt1; - CDocEntry *doc_ce; - U8 *st; - switch (ch) { - case '\n': - if ((doc_ce=doc->cur_entry) && doc_ce!=doc && - doc_ce->type_u8==DOCT_MENU_VAL) { - tempb=doc_ce->user_data; - if (tempt=tempb->template) { - if (tempt1=BgtTemplatePmt(tempt)) { - QueRem(tempt); - BgtTemplatePurge(tempt); - BgtEntryDel2(&tempt->b); - Free(tempt); - QueIns(tempt1,t_head.last); - BgtTemplateExpand(tempt1); - BgtRegen; - } - } else { - if (tempb1=BgtEntryPmt(tempb)) { - QueRem(tempb); - BgtEntryDel(tempb); - BgtIns(tempb1); - BgtRegen; - } - } - } - return TRUE; - case CH_CTRLY: - if ((doc_ce=doc->cur_entry) && doc_ce!=doc && - doc_ce->type_u8==DOCT_MENU_VAL) { - tempb=doc_ce->user_data; - if (tempt=tempb->template) { - QueRem(tempt); - BgtTemplatePurge(tempt); - BgtEntryDel2(&tempt->b); - Free(tempt); - } else { - QueRem(tempb); - BgtEntryDel(tempb); - } - BgtRegen; - } - return TRUE; - case 'a': - PopUpOk( "Set the name and color of your accounts.\n" - "To delete accounts, manually edit\n" - "$$GREEN$$~/Budget/Accts.TXT.Z$$FG$$."); - if (PopUpEd(BGT_ACCTS_FILE,Fs)) { - BgtAcctsRead; - BgtRegen; - } - return TRUE; - case 'v': - if ((st=BgtPopUpAcct("View Acct\n\n",view_acct))>=0) { - StrCpy(view_acct,st); - BgtRegen; - } - return TRUE; - case 'n': - if (tempb1=BgtEntryPmt) { - BgtIns(tempb1); - BgtRegen; - } - return TRUE; - case 't': - if (tempt1=BgtTemplatePmt) { - QueIns(tempt1,t_head.last); - BgtTemplateExpand(tempt1); - BgtRegen; - } - return TRUE; - case 'c': - if ((doc_ce=doc->cur_entry) && doc_ce!=doc && - doc_ce->type_u8==DOCT_MENU_VAL) - tempb=doc_ce->user_data; - else - tempb=NULL; - if (tempb1=BgtEntryPmt(tempb)) { - BgtIns(tempb1); - BgtRegen; - } - return TRUE; - } - return FALSE; -} - -U0 BgtRegen() -{ - I64 timeout_jiffy,c,color=COLOR_INVALID; - F64 balance=0; - CDoc *doc,*pdoc,*ddoc; - CDocEntry *doc_ce; - CBgtEntry *tempb=b_head.next,*tempb_ce; - doc=DocNew; - doc->flags|=DOCF_FORM; - while (tempb!=&b_head) { - if (!StrCmp(view_acct,tempb->credit)) - balance-=tempb->amount; - if (!StrCmp(view_acct,tempb->debit)) - balance+=tempb->amount; - c=BgtAcctColor(tempb->credit); - if (c!=color) { - color=c; - DocPrint(doc,"$$FG,%d$$",color); - } - tempb->doc_e=DocPrint(doc, - "$$MU-UL,\"%D %8ts %8ts:%8.2f %8.2f:%$$Q\",U=0x%X$$\n", - tempb->date,tempb->credit,tempb->debit,balance, - tempb->amount,tempb->desc,tempb); - tempb=tempb->next; - } - DocRecalc(doc); - - if (pdoc=Fs->put_doc) { - DocLock(pdoc); -//Now, we want to preserve old position in doc, using ugly brute force. - //It's tricky -- can't use old line num because of editor filters. - - //The price we pay for using the standard document editor is this kludge. - //When I originally wrote my budget program, I did not have separate budget - //and line entries, so we never had to resync. - - doc_ce=pdoc->cur_entry; - timeout_jiffy=cnts.jiffies+JIFFY_FREQ; //Max one second. - while (doc_ce!=pdoc && cnts.jiffiestype_u8!=DOCT_MENU_VAL || !(tempb_ce=doc_ce->user_data)) { - doc_ce=doc_ce->next; - if (doc_ce==pdoc) goto br_cont; - } - tempb=b_head.next; - while (tempb!=&b_head) { - if (tempb==tempb_ce) { - doc->cur_entry=tempb->doc_e; - doc->cur_col=0; - DocCenter(doc); - goto br_cont; - } - tempb=tempb->next; - } - doc_ce=doc_ce->next; - } - } - - br_cont: - ddoc=Fs->display_doc; - Fs->put_doc =doc; - Fs->display_doc=doc; - DocDel(pdoc); - if (pdoc!=ddoc) - DocDel(ddoc); - doc->user_put_key=&BgtPutKey; -} - -U0 Budget() -{ - CDoc *pdoc,*ddoc,*old_put,*old_display; - BgtAcctsRead; - BgtDataRead; - CBgtTemplatesExpand; - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - AutoComplete; - WinBorder; - WinMax; - MenuPush( - "File {" - " Abort(,CH_SHIFT_ESC);" - " Exit(,CH_ESC);" - "}" - "Edit {" - " NewEntry(,'n');" - " CopyEntry(,'c');" - " EditEntry(,'\n');" - " DeleteEntry(,CH_CTRLY);" - " NewTemplate(,'t');" - " AcctsFile(,'a');" - "}" - "View {" - " ViewAcct(,'v');" - "}" - ); - StrCpy(view_acct,"BANK"); - DocMax; - old_put =Fs->put_doc; - old_display =Fs->display_doc; - Fs->put_doc =NULL; - Fs->display_doc=NULL; - BgtRegen; - try - if (View) { - BgtDataWrite; - BgtAcctsWrite; - } - catch - PutExcept; - - pdoc=Fs->put_doc; - ddoc=Fs->display_doc; - Fs->put_doc =old_put; - Fs->display_doc=old_display; - DocDel(pdoc); - if (pdoc!=ddoc) - DocDel(ddoc); - - SettingsPop; - BgtDel; - MenuPop; -} diff --git a/Apps/Budget/BgtMain.HC b/Apps/Budget/BgtMain.HC new file mode 100644 index 0000000..cd83b73 --- /dev/null +++ b/Apps/Budget/BgtMain.HC @@ -0,0 +1,214 @@ +extern U0 BgtRegen(); + +Bool BgtPutKey(CDoc *doc,U8 *,I64 ch,I64 sc) +{//ch=ASCII; sc=scan_code + no_warn sc; + CBgtEntry *tempb,*tempb1; + CBgtTemplate *tempt,*tempt1; + CDocEntry *doc_ce; + U8 *st; + switch (ch) { + case '\n': + if ((doc_ce=doc->cur_entry) && doc_ce!=doc && + doc_ce->type_u8==DOCT_MENU_VAL) { + tempb=doc_ce->user_data; + if (tempt=tempb->template) { + if (tempt1=BgtTemplatePmt(tempt)) { + QueRem(tempt); + BgtTemplatePurge(tempt); + BgtEntryDel2(&tempt->b); + Free(tempt); + QueIns(tempt1,t_head.last); + BgtTemplateExpand(tempt1); + BgtRegen; + } + } else { + if (tempb1=BgtEntryPmt(tempb)) { + QueRem(tempb); + BgtEntryDel(tempb); + BgtIns(tempb1); + BgtRegen; + } + } + } + return TRUE; + case CH_CTRLY: + if ((doc_ce=doc->cur_entry) && doc_ce!=doc && + doc_ce->type_u8==DOCT_MENU_VAL) { + tempb=doc_ce->user_data; + if (tempt=tempb->template) { + QueRem(tempt); + BgtTemplatePurge(tempt); + BgtEntryDel2(&tempt->b); + Free(tempt); + } else { + QueRem(tempb); + BgtEntryDel(tempb); + } + BgtRegen; + } + return TRUE; + case 'a': + PopUpOk( "Set the name and color of your accounts.\n" + "To delete accounts, manually edit\n" + "$$GREEN$$~/Budget/Accts.DD.Z$$FG$$."); + if (PopUpEd(BGT_ACCTS_FILE,Fs)) { + BgtAcctsRead; + BgtRegen; + } + return TRUE; + case 'v': + if ((st=BgtPopUpAcct("View Acct\n\n",view_acct))>=0) { + StrCpy(view_acct,st); + BgtRegen; + } + return TRUE; + case 'n': + if (tempb1=BgtEntryPmt) { + BgtIns(tempb1); + BgtRegen; + } + return TRUE; + case 't': + if (tempt1=BgtTemplatePmt) { + QueIns(tempt1,t_head.last); + BgtTemplateExpand(tempt1); + BgtRegen; + } + return TRUE; + case 'c': + if ((doc_ce=doc->cur_entry) && doc_ce!=doc && + doc_ce->type_u8==DOCT_MENU_VAL) + tempb=doc_ce->user_data; + else + tempb=NULL; + if (tempb1=BgtEntryPmt(tempb)) { + BgtIns(tempb1); + BgtRegen; + } + return TRUE; + } + return FALSE; +} + +U0 BgtRegen() +{ + I64 timeout_jiffy,c,color=COLOR_INVALID; + F64 balance=0; + CDoc *doc,*pdoc,*ddoc; + CDocEntry *doc_ce; + CBgtEntry *tempb=b_head.next,*tempb_ce; + doc=DocNew; + doc->flags|=DOCF_FORM; + while (tempb!=&b_head) { + if (!StrCmp(view_acct,tempb->credit)) + balance-=tempb->amount; + if (!StrCmp(view_acct,tempb->debit)) + balance+=tempb->amount; + c=BgtAcctColor(tempb->credit); + if (c!=color) { + color=c; + DocPrint(doc,"$$FG,%d$$",color); + } + tempb->doc_e=DocPrint(doc, + "$$MU-UL,\"%D %8ts %8ts:%8.2f %8.2f:%$$Q\",U=0x%X$$\n", + tempb->date,tempb->credit,tempb->debit,balance, + tempb->amount,tempb->desc,tempb); + tempb=tempb->next; + } + DocRecalc(doc); + + if (pdoc=Fs->put_doc) { + DocLock(pdoc); +//Now, we want to preserve old position in doc, using ugly brute force. + //It's tricky -- can't use old line num because of editor filters. + + //The price we pay for using the standard document editor is this kludge. + //When I originally wrote my budget program, I did not have separate budget + //and line entries, so we never had to resync. + + doc_ce=pdoc->cur_entry; + timeout_jiffy=cnts.jiffies+JIFFY_FREQ; //Max one second. + while (doc_ce!=pdoc && cnts.jiffiestype_u8!=DOCT_MENU_VAL || !(tempb_ce=doc_ce->user_data)) { + doc_ce=doc_ce->next; + if (doc_ce==pdoc) goto br_cont; + } + tempb=b_head.next; + while (tempb!=&b_head) { + if (tempb==tempb_ce) { + doc->cur_entry=tempb->doc_e; + doc->cur_col=0; + DocCenter(doc); + goto br_cont; + } + tempb=tempb->next; + } + doc_ce=doc_ce->next; + } + } + + br_cont: + ddoc=Fs->display_doc; + Fs->put_doc =doc; + Fs->display_doc=doc; + DocDel(pdoc); + if (pdoc!=ddoc) + DocDel(ddoc); + doc->user_put_key=&BgtPutKey; +} + +U0 Budget() +{ + CDoc *pdoc,*ddoc,*old_put,*old_display; + BgtAcctsRead; + BgtDataRead; + CBgtTemplatesExpand; + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + AutoComplete; + WinBorder; + WinMax; + MenuPush( + "File {" + " Abort(,CH_SHIFT_ESC);" + " Exit(,CH_ESC);" + "}" + "Edit {" + " NewEntry(,'n');" + " CopyEntry(,'c');" + " EditEntry(,'\n');" + " DeleteEntry(,CH_CTRLY);" + " NewTemplate(,'t');" + " AcctsFile(,'a');" + "}" + "View {" + " ViewAcct(,'v');" + "}" + ); + StrCpy(view_acct,"BANK"); + DocMax; + old_put =Fs->put_doc; + old_display =Fs->display_doc; + Fs->put_doc =NULL; + Fs->display_doc=NULL; + BgtRegen; + try + if (View) { + BgtDataWrite; + BgtAcctsWrite; + } + catch + PutExcept; + + pdoc=Fs->put_doc; + ddoc=Fs->display_doc; + Fs->put_doc =old_put; + Fs->display_doc=old_display; + DocDel(pdoc); + if (pdoc!=ddoc) + DocDel(ddoc); + + SettingsPop; + BgtDel; + MenuPop; +} diff --git a/Apps/Budget/BgtStrs.CPP b/Apps/Budget/BgtStrs.HC similarity index 100% rename from Apps/Budget/BgtStrs.CPP rename to Apps/Budget/BgtStrs.HC diff --git a/Apps/Budget/BgtTemplate.CPP b/Apps/Budget/BgtTemplate.HC similarity index 100% rename from Apps/Budget/BgtTemplate.CPP rename to Apps/Budget/BgtTemplate.HC diff --git a/Apps/Budget/Budget.CPP b/Apps/Budget/Budget.CPP deleted file mode 100644 index 768ec25..0000000 --- a/Apps/Budget/Budget.CPP +++ /dev/null @@ -1,77 +0,0 @@ -#define BGT_STRINGS_FILE "~/Budget/Strs.TXT.Z" -#define BGT_ACCTS_FILE "~/Budget/Accts.TXT.Z" -#define BGT_DATA_FILE "~/Budget/Bgt.DAT.Z" - -#define BE_NORMAL 0 -#define BE_GAS 1 -#define BE_ANNIVERSARY 2 -#define BE_PRICE 3 -#define BE_TEMPLATE_COPY 4 - -extern class CBgtTemplate; - -class CBgtEntry -{ - CBgtEntry *next,*last; - - U0 start; - CDate date; - U16 type,flags; - U32 credit_idx,debit_idx,desc_idx; - F64 amount; - U0 end; - - U8 *credit,*debit,*desc; - CBgtTemplate *template; - CDocEntry *doc_e; -} b_head; -#define BE_SIZE (offset(CBgtEntry.end)-offset(CBgtEntry.start)) - -#define BT_NULL 0 -#define BT_INTERVAL 1 -#define BT_MONTHLY 2 -#define BT_BIMONTHLY 3 -#define BT_SEMIANNUAL 4 -#define BT_ANNUAL 5 - -DefineLstLoad("ST_BGT_TEMPLATE_TYPES", - "Null\0Interval\0Monthly\0Bimonthly\0Semiannual\0Annual\0"); - -class CBgtTemplate -{ - CBgtTemplate *next,*last; - - U0 start; - U16 type fmtstr "$$LS,D=\"ST_BGT_TEMPLATE_TYPES\"$$\n"; - U16 flags; - U8 start_date[16] fmtstr "$$DA-P,A=\"Start Date:%s\"$$\n"; - U8 end_date[16] fmtstr "$$DA-P,A=\"End Date :%s\"$$\n"; - F64 period fmtstr "$$DA,A=\"Period :%6.2f\"$$\n"; - U0 end; - - CBgtEntry b; -} t_head; -#define BT_SIZE (offset(CBgtTemplate.end)-offset(CBgtTemplate.start)) - -U8 view_acct[512]; -CHashTable *accts_table=NULL; -I64 accts_table_strs=0; - -CDate MyStr2Date(U8 *st) -{ - CDateStruct ds; - CDate res; - if (st&&*st) { - if (StrOcc(st,'[')) - res=b_head.next->date; - else if (StrOcc(st,']')) - res=b_head.last->date; - else - res=Str2Date(st); - } else - res=Now; - Date2Struct(&ds,res); - if (ds.year>2050) - ds.year-=100; - return Struct2Date(&ds); -} diff --git a/Apps/Budget/Budget.HC b/Apps/Budget/Budget.HC new file mode 100644 index 0000000..fa88d1f --- /dev/null +++ b/Apps/Budget/Budget.HC @@ -0,0 +1,77 @@ +#define BGT_STRINGS_FILE "~/Budget/Strs.DD.Z" +#define BGT_ACCTS_FILE "~/Budget/Accts.DD.Z" +#define BGT_DATA_FILE "~/Budget/Bgt.DAT.Z" + +#define BE_NORMAL 0 +#define BE_GAS 1 +#define BE_ANNIVERSARY 2 +#define BE_PRICE 3 +#define BE_TEMPLATE_COPY 4 + +extern class CBgtTemplate; + +class CBgtEntry +{ + CBgtEntry *next,*last; + + U0 start; + CDate date; + U16 type,flags; + U32 credit_idx,debit_idx,desc_idx; + F64 amount; + U0 end; + + U8 *credit,*debit,*desc; + CBgtTemplate *template; + CDocEntry *doc_e; +} b_head; +#define BE_SIZE (offset(CBgtEntry.end)-offset(CBgtEntry.start)) + +#define BT_NULL 0 +#define BT_INTERVAL 1 +#define BT_MONTHLY 2 +#define BT_BIMONTHLY 3 +#define BT_SEMIANNUAL 4 +#define BT_ANNUAL 5 + +DefineLstLoad("ST_BGT_TEMPLATE_TYPES", + "Null\0Interval\0Monthly\0Bimonthly\0Semiannual\0Annual\0"); + +class CBgtTemplate +{ + CBgtTemplate *next,*last; + + U0 start; + U16 type fmtstr "$$LS,D=\"ST_BGT_TEMPLATE_TYPES\"$$\n"; + U16 flags; + U8 start_date[16] fmtstr "$$DA-P,A=\"Start Date:%s\"$$\n"; + U8 end_date[16] fmtstr "$$DA-P,A=\"End Date :%s\"$$\n"; + F64 period fmtstr "$$DA,A=\"Period :%6.2f\"$$\n"; + U0 end; + + CBgtEntry b; +} t_head; +#define BT_SIZE (offset(CBgtTemplate.end)-offset(CBgtTemplate.start)) + +U8 view_acct[512]; +CHashTable *accts_table=NULL; +I64 accts_table_strs=0; + +CDate MyStr2Date(U8 *st) +{ + CDateStruct ds; + CDate res; + if (st&&*st) { + if (StrOcc(st,'[')) + res=b_head.next->date; + else if (StrOcc(st,']')) + res=b_head.last->date; + else + res=Str2Date(st); + } else + res=Now; + Date2Struct(&ds,res); + if (ds.year>2050) + ds.year-=100; + return Struct2Date(&ds); +} diff --git a/Apps/Budget/Install.CPP b/Apps/Budget/Install.CPP deleted file mode 100644 index 8abae5c..0000000 --- a/Apps/Budget/Install.CPP +++ /dev/null @@ -1,5 +0,0 @@ -Cd(__DIR__);; -if (!FileFind("~/Budget",,FUF_JUST_DIRS)) { - MkDir("~/Budget"); - Copy("Accts.TXT.Z","~/Budget"); -} diff --git a/Apps/Budget/Install.HC b/Apps/Budget/Install.HC new file mode 100644 index 0000000..403b8bd --- /dev/null +++ b/Apps/Budget/Install.HC @@ -0,0 +1,5 @@ +Cd(__DIR__);; +if (!FileFind("~/Budget",,FUF_JUST_DIRS)) { + MkDir("~/Budget"); + Copy("Accts.DD.Z","~/Budget"); +} diff --git a/Apps/Budget/Load.CPP b/Apps/Budget/Load.HC similarity index 100% rename from Apps/Budget/Load.CPP rename to Apps/Budget/Load.HC diff --git a/Apps/Budget/Run.CPP b/Apps/Budget/Run.HC similarity index 100% rename from Apps/Budget/Run.CPP rename to Apps/Budget/Run.HC diff --git a/Apps/GrModels/BallGen.CPP b/Apps/GrModels/BallGen.CPP deleted file mode 100644 index 6434f4a..0000000 --- a/Apps/GrModels/BallGen.CPP +++ /dev/null @@ -1,128 +0,0 @@ -//Makes a mesh ball. - -#define MAX_VERTICES 1024 -#define MAX_TRIS 1024 - -class Ball -{ - I32 vertex_cnt; - I32 tri_cnt; - CD3I32 v[MAX_VERTICES]; - CMeshTri t[MAX_TRIS]; -} *b; - -class BallDefineStruct -{ - F64 radius fmtstr "$$DA-TRM,A=\"Radius :%8.3f\"$$\n"; - I64 n_longitude fmtstr "$$DA-TRM,A=\"Longitude Faces:%5d\"$$\n"; - I64 n_lattitude fmtstr "$$DA-TRM,A=\"Lattitude Rings:%5d\"$$\n"; -}; - -U0 BDInit(BallDefineStruct *bd) -{ - MemSet(bd,0,sizeof(BallDefineStruct)); - bd->n_longitude=16; - bd->n_lattitude=8; - bd->radius =20.0; -} - -U0 BDCorrect(BallDefineStruct *bd) -{ - bd->n_longitude=(bd->n_longitude+1)/2; - bd->n_lattitude=(bd->n_lattitude+1)/2; -} - -I64 AddVertex(BallDefineStruct *,I64 x,I64 y,I64 z) -{ - I64 i; - for (i=0;ivertex_cnt;i++) - if (b->v[i].x==x && b->v[i].y==y && b->v[i].z==z) - return i; - i=b->vertex_cnt++; - b->v[i].x=x; - b->v[i].y=y; - b->v[i].z=z; - return i; -} - -I64 AddTri(BallDefineStruct *,I64 c,I64 n0,I64 n1,I64 n2) -{ - I64 res=b->tri_cnt++; - b->t[res].color=c; - b->t[res].nums[0]=n0; - b->t[res].nums[1]=n1; - b->t[res].nums[2]=n2; - return res; -} - -U8 *Ball2CSprite() -{ -//See $LK,"::/Adam/Gr/GrSpritePlot.CPP",A="FL:::/Adam/Gr/GrSpritePlot.CPP,1"$ for how CSprite are stored. - U8 *res=MAlloc(sizeof(CSpriteMeshU8s)+ - b->vertex_cnt*sizeof(CD3I32)+b->tri_cnt*sizeof(CMeshTri) - +sprite_elem_base_sizes[SPT_END]), - *dst=res; - *dst++ =SPT_MESH; - *dst(I32 *)++ =b->vertex_cnt; - *dst(I32 *)++ =b->tri_cnt; - MemCpy(dst,&b->v,b->vertex_cnt*sizeof(CD3I32)); - dst+=b->vertex_cnt*sizeof(CD3I32); - MemCpy(dst,&b->t,b->tri_cnt*sizeof(CMeshTri)); - dst+=b->tri_cnt*sizeof(CMeshTri); - *dst++ =SPT_END; - return res; -} - -public U8 *BallGen() -{ - U8 *res; - I64 i,j,n,m,c,p1,p2,p3,p4; - BallDefineStruct bd1,bd2; - F64 r,r1,r2,z1,z2,d_a1,d_a2; - - BDInit(&bd1); - - while (TRUE) { - if (!DocForm(&bd1)) - return NULL; - MemCpy(&bd2,&bd1,sizeof(BallDefineStruct)); - BDCorrect(&bd2); - - c=PopUpColorLighting; - if (c<0) return NULL; - - b=CAlloc(sizeof(Ball)); - r=bd2.radius; - n=bd2.n_lattitude; - m=bd2.n_longitude; - d_a1=2*ã/n/4; - d_a2=2*ã/m/2; - for (j=-n;j\",BI=%d$$"); - "%h7c",'\n'; - "Vertices:%d\n",b->vertex_cnt; - Free(b); - "Do another"; - if (YorN) - Free(res); - else - break; - } - return res; -} diff --git a/Apps/GrModels/BallGen.HC b/Apps/GrModels/BallGen.HC new file mode 100644 index 0000000..71eedf5 --- /dev/null +++ b/Apps/GrModels/BallGen.HC @@ -0,0 +1,128 @@ +//Makes a mesh ball. + +#define MAX_VERTICES 1024 +#define MAX_TRIS 1024 + +class Ball +{ + I32 vertex_cnt; + I32 tri_cnt; + CD3I32 v[MAX_VERTICES]; + CMeshTri t[MAX_TRIS]; +} *b; + +class BallDefineStruct +{ + F64 radius fmtstr "$$DA-TRM,A=\"Radius :%8.3f\"$$\n"; + I64 n_longitude fmtstr "$$DA-TRM,A=\"Longitude Faces:%5d\"$$\n"; + I64 n_lattitude fmtstr "$$DA-TRM,A=\"Lattitude Rings:%5d\"$$\n"; +}; + +U0 BDInit(BallDefineStruct *bd) +{ + MemSet(bd,0,sizeof(BallDefineStruct)); + bd->n_longitude=16; + bd->n_lattitude=8; + bd->radius =20.0; +} + +U0 BDCorrect(BallDefineStruct *bd) +{ + bd->n_longitude=(bd->n_longitude+1)/2; + bd->n_lattitude=(bd->n_lattitude+1)/2; +} + +I64 AddVertex(BallDefineStruct *,I64 x,I64 y,I64 z) +{ + I64 i; + for (i=0;ivertex_cnt;i++) + if (b->v[i].x==x && b->v[i].y==y && b->v[i].z==z) + return i; + i=b->vertex_cnt++; + b->v[i].x=x; + b->v[i].y=y; + b->v[i].z=z; + return i; +} + +I64 AddTri(BallDefineStruct *,I64 c,I64 n0,I64 n1,I64 n2) +{ + I64 res=b->tri_cnt++; + b->t[res].color=c; + b->t[res].nums[0]=n0; + b->t[res].nums[1]=n1; + b->t[res].nums[2]=n2; + return res; +} + +U8 *Ball2CSprite() +{ +//See $LK,"::/Adam/Gr/GrSpritePlot.HC",A="FL:::/Adam/Gr/GrSpritePlot.HC,1"$ for how CSprite are stored. + U8 *res=MAlloc(sizeof(CSpriteMeshU8s)+ + b->vertex_cnt*sizeof(CD3I32)+b->tri_cnt*sizeof(CMeshTri) + +sprite_elem_base_sizes[SPT_END]), + *dst=res; + *dst++ =SPT_MESH; + *dst(I32 *)++ =b->vertex_cnt; + *dst(I32 *)++ =b->tri_cnt; + MemCpy(dst,&b->v,b->vertex_cnt*sizeof(CD3I32)); + dst+=b->vertex_cnt*sizeof(CD3I32); + MemCpy(dst,&b->t,b->tri_cnt*sizeof(CMeshTri)); + dst+=b->tri_cnt*sizeof(CMeshTri); + *dst++ =SPT_END; + return res; +} + +public U8 *BallGen() +{ + U8 *res; + I64 i,j,n,m,c,p1,p2,p3,p4; + BallDefineStruct bd1,bd2; + F64 r,r1,r2,z1,z2,d_a1,d_a2; + + BDInit(&bd1); + + while (TRUE) { + if (!DocForm(&bd1)) + return NULL; + MemCpy(&bd2,&bd1,sizeof(BallDefineStruct)); + BDCorrect(&bd2); + + c=PopUpColorLighting; + if (c<0) return NULL; + + b=CAlloc(sizeof(Ball)); + r=bd2.radius; + n=bd2.n_lattitude; + m=bd2.n_longitude; + d_a1=2*ã/n/4; + d_a2=2*ã/m/2; + for (j=-n;j\",BI=%d$$"); + "%h7c",'\n'; + "Vertices:%d\n",b->vertex_cnt; + Free(b); + "Do another"; + if (YorN) + Free(res); + else + break; + } + return res; +} diff --git a/Apps/GrModels/Load.CPP b/Apps/GrModels/Load.HC similarity index 100% rename from Apps/GrModels/Load.CPP rename to Apps/GrModels/Load.HC diff --git a/Apps/GrModels/ManGen.CPP b/Apps/GrModels/ManGen.CPP deleted file mode 100644 index 6d3cb84..0000000 --- a/Apps/GrModels/ManGen.CPP +++ /dev/null @@ -1,320 +0,0 @@ -//Makes a mesh man. - -#define MAX_VERTICES 1024 -#define MAX_TRIS 1024 - -class Man -{ - I32 vertex_cnt; - I32 tri_cnt; - CD3I32 v[MAX_VERTICES]; - CMeshTri t[MAX_TRIS]; -} *m; - -class ManDefineStruct -{ - F64 head_rad fmtstr - "$$DA-TRM,A=\"Head Radius :%8.3f\"$$\n"; - - F64 torso_len fmtstr - "$$DA-TRM,A=\"Torso Length :%8.3f\"$$\n"; - F64 arm_len fmtstr - "$$DA-TRM,A=\"Arm Length :%8.3f\"$$\n"; - F64 hand_len fmtstr - "$$DA-TRM,A=\"Hand Length :%8.3f\"$$\n"; - F64 leg_len fmtstr - "$$DA-TRM,A=\"Leg Length :%8.3f\"$$\n"; - F64 foot_len fmtstr - "$$DA-TRM,A=\"Foot Length :%8.3f\"$$\n"; - F64 torso_width fmtstr - "$$DA-TRM,A=\"Torso Width :%8.3f\"$$\n"; - F64 torso_depth fmtstr - "$$DA-TRM,A=\"Torso Depth :%8.3f\"$$\n"; - F64 arm_rad fmtstr - "$$DA-TRM,A=\"Arm Radius :%8.3f\"$$\n"; - F64 hand_rad fmtstr - "$$DA-TRM,A=\"Hand Radius :%8.3f\"$$\n"; - F64 leg_rad fmtstr - "$$DA-TRM,A=\"Leg Radius :%8.3f\"$$\n"; - F64 foot_rad fmtstr - "$$DA-TRM,A=\"Foot Radius :%8.3f\"$$\n\n"; - - F64 r_shoulder_a1 fmtstr - "$$DA-TRM,A=\"R.Shoulder Front/Back Angle:%8.3f\"$$\n"; - F64 l_shoulder_a1 fmtstr - "$$DA-TRM,A=\"L.Shoulder Front/Back Angle:%8.3f\"$$\n"; - F64 r_hip_a1 fmtstr - "$$DA-TRM,A=\"R.Hip Front/Back Angle :%8.3f\"$$\n"; - F64 l_hip_a1 fmtstr - "$$DA-TRM,A=\"L.Hip Front/Back Angle :%8.3f\"$$\n"; - - F64 r_shoulder_a2 fmtstr - "$$DA-TRM,A=\"R.Shoulder Side Angle :%8.3f\"$$\n"; - F64 l_shoulder_a2 fmtstr - "$$DA-TRM,A=\"L.Shoulder Side Angle :%8.3f\"$$\n"; - F64 r_hip_a2 fmtstr - "$$DA-TRM,A=\"R.Hip Side Angle :%8.3f\"$$\n"; - F64 l_hip_a2 fmtstr - "$$DA-TRM,A=\"L.Hip Side Angle :%8.3f\"$$\n"; - - F64 r_elbow_a fmtstr - "$$DA-TRM,A=\"R.Elbow Angle :%8.3f\"$$\n"; - F64 l_elbow_a fmtstr - "$$DA-TRM,A=\"L.Elbow Angle :%8.3f\"$$\n"; - F64 r_knee_a fmtstr - "$$DA-TRM,A=\"R.Knee Angle :%8.3f\"$$\n"; - F64 l_knee_a fmtstr - "$$DA-TRM,A=\"L.Knee Angle :%8.3f\"$$\n"; - - F64 r_wrist_a fmtstr - "$$DA-TRM,A=\"R.Wrist Angle :%8.3f\"$$\n"; - F64 l_wrist_a fmtstr - "$$DA-TRM,A=\"L.Wrist Angle :%8.3f\"$$\n"; - F64 r_ankle_a fmtstr - "$$DA-TRM,A=\"R.Ankle Angle :%8.3f\"$$\n"; - F64 l_ankle_a fmtstr - "$$DA-TRM,A=\"L.Ankle Angle :%8.3f\"$$\n"; - -}; - -U0 MDInit(ManDefineStruct *md) -{ - MemSet(md,0,sizeof(ManDefineStruct)); - - md->head_rad =5.0; - - md->torso_len =35.0; - md->arm_len =30.0; - md->hand_len =8.0; - md->leg_len =32.0; - md->foot_len =16.0; - md->torso_width=20.0; - md->torso_depth=10.0; - md->arm_rad =3.5; - md->hand_rad =2.0; - md->leg_rad =4.0; - md->foot_rad =3.0; - - md->r_shoulder_a1 =30; - md->l_shoulder_a1 =-30; - md->r_hip_a1 =-45; - md->l_hip_a1 =45; - - md->r_shoulder_a2 =10; - md->l_shoulder_a2 =10; - md->r_hip_a2 =-5; - md->l_hip_a2 =-5; - - md->r_elbow_a =30; - md->l_elbow_a =0; - md->r_knee_a =0; - md->l_knee_a =30; - - md->r_wrist_a =0; - md->l_wrist_a =0; - md->r_ankle_a =0; - md->l_ankle_a =0; -} - -U0 MDCorrect(ManDefineStruct *md) -{ - md->r_ankle_a =-md->r_ankle_a; - md->l_ankle_a =-md->l_ankle_a; - md->r_knee_a =-md->r_knee_a; - md->l_knee_a =-md->l_knee_a; - md->r_hip_a2 =-md->r_hip_a2; - md->r_shoulder_a2=-md->r_shoulder_a2; - md->r_ankle_a+=90; - md->l_ankle_a+=90; - - md->foot_len-=md->leg_rad; - - md->r_elbow_a+=md->r_shoulder_a1; - md->l_elbow_a+=md->l_shoulder_a1; - md->r_knee_a+=md->r_hip_a1; - md->l_knee_a+=md->l_hip_a1; - - md->r_wrist_a+=md->r_elbow_a; - md->l_wrist_a+=md->l_elbow_a; - md->r_ankle_a+=md->r_knee_a; - md->l_ankle_a+=md->l_knee_a; -} - -I64 AddVertex(ManDefineStruct *md,I64 x,I64 y,I64 z) -{ - I64 res=m->vertex_cnt++; - m->v[res].x=-x; - m->v[res].y=-y-md->leg_len-md->foot_rad*2; - m->v[res].z=-z; - return res; -} - -I64 AddTri(ManDefineStruct *,I64 c,I64 n0,I64 n1,I64 n2) -{ - I64 res=m->tri_cnt++; - m->t[res].color=c; - m->t[res].nums[0]=n1; - m->t[res].nums[1]=n0; - m->t[res].nums[2]=n2; - return res; -} - -U0 AddBox(ManDefineStruct *md,I64 c,I64 x1,I64 y1,I64 z1, - F64 w,F64 h,F64 d,F64 h2,F64 h3,F64 az,F64 ay,F64 ax, - I64 *ox,I64 *oy,I64 *oz) -{ - I64 *r; - I64 p1a,p2a,p3a,p4a; - I64 p1b,p2b,p3b,p4b; - I64 wx=w/2,wy=0,wz=0,hx=0,hy=h,hz=0,h2x=0,h2y=h2,h2z=0, - h3x=0,h3y=h3,h3z=0,dx=0,dy=0,dz=d/2; - - r=Mat4x4IdentNew; - Mat4x4RotZ(r,az*ã/180.0); - Mat4x4RotY(r,ay*ã/180.0); - Mat4x4RotX(r,ax*ã/180.0); - Mat4x4MulXYZ(r,&wx,&wy,&wz); - Mat4x4MulXYZ(r,&hx,&hy,&hz); - Mat4x4MulXYZ(r,&h2x,&h2y,&h2z); - Mat4x4MulXYZ(r,&h3x,&h3y,&h3z); - Mat4x4MulXYZ(r,&dx,&dy,&dz); - - p1a=AddVertex(md,x1+dx -wx+h2x,y1+dy -wy+h2y,z1+dz -wz+h2z); - p2a=AddVertex(md,x1+dx +wx+h2x,y1+dy +wy+h2y,z1+dz +wz+h2z); - p3a=AddVertex(md,x1+dx+hx-wx ,y1+dy+hy-wy ,z1+dz+hz-wz); - p4a=AddVertex(md,x1+dx+hx+wx ,y1+dy+hy+wy ,z1+dz+hz+wz); - AddTri(md,c,p1a,p2a,p3a); - AddTri(md,c,p4a,p3a,p2a); - - p1b=AddVertex(md,x1-dx -wx+h2x,y1-dy -wy+h2y,z1-dz -wz+h2z); - p2b=AddVertex(md,x1-dx +wx+h2x,y1-dy +wy+h2y,z1-dz +wz+h2z); - p3b=AddVertex(md,x1-dx+hx-wx ,y1-dy+hy-wy ,z1-dz+hz-wz); - p4b=AddVertex(md,x1-dx+hx+wx ,y1-dy+hy+wy ,z1-dz+hz+wz); - AddTri(md,c,p1b,p2b,p3b); - AddTri(md,c,p4b,p3b,p2b); - - AddTri(md,c,p1a,p2a,p1b); - AddTri(md,c,p2b,p1b,p2a); - AddTri(md,c,p3a,p4a,p3b); - AddTri(md,c,p4b,p3b,p4a); - AddTri(md,c,p1a,p3a,p1b); - AddTri(md,c,p3b,p1b,p3a); - AddTri(md,c,p2a,p4a,p2b); - AddTri(md,c,p4b,p2b,p4a); - - *ox=x1+hx-h3x; - *oy=y1+hy-h3y; - *oz=z1+hz-h3z; - - Free(r); -} - -U8 *Man2CSprite() -{ -//See $LK,"::/Adam/Gr/GrSpritePlot.CPP",A="FL:::/Adam/Gr/GrSpritePlot.CPP,1"$ for how CSprite are stored. - U8 *res=MAlloc(sizeof(CSpriteMeshU8s)+ - m->vertex_cnt*sizeof(CD3I32)+m->tri_cnt*sizeof(CMeshTri)+ - sprite_elem_base_sizes[SPT_END]), - *dst=res; - *dst++ =SPT_MESH; - *dst(I32 *)++ =m->vertex_cnt; - *dst(I32 *)++ =m->tri_cnt; - MemCpy(dst,&m->v,m->vertex_cnt*sizeof(CD3I32)); - dst+=m->vertex_cnt*sizeof(CD3I32); - MemCpy(dst,&m->t,m->tri_cnt*sizeof(CMeshTri)); - dst+=m->tri_cnt*sizeof(CMeshTri); - *dst++ =SPT_END; - return res; -} - -public U8 *ManGen() -{ - U8 *res; - I64 x,y,z,c1,c2,c3,c4; - ManDefineStruct md1,md2; - MDInit(&md1); - - while (TRUE) { - if (!DocForm(&md1)) - return NULL; - MemCpy(&md2,&md1,sizeof(ManDefineStruct)); - MDCorrect(&md2); - - c1=PopUpColorLighting("$$BK,1$$Shirt$$BK,0$$\n"); - if (c1<0) return NULL; - c2=PopUpColorLighting("$$BK,1$$Pants$$BK,0$$\n"); - if (c2<0) return NULL; - c3=PopUpColorLighting("$$BK,1$$Skin$$BK,0$$\n"); - if (c3<0) return NULL; - c4=PopUpColorLighting("$$BK,1$$Shoes$$BK,0$$\n"); - if (c4<0) return NULL; - - m=CAlloc(sizeof(Man)); - - //Head - AddBox(&md2,c3,0,md2.torso_len+md2.head_rad*2,0, - md2.head_rad*2,-md2.head_rad*2,md2.head_rad*2,0,0, 0,0,0, - &x,&y,&z); - - //Torso - AddBox(&md2,c1,0,md2.torso_len,0, - md2.torso_width,-md2.torso_len,md2.torso_depth,0,0, 0,0,0, - &x,&y,&z); - - //Right Arm - AddBox(&md2,c1,-md2.torso_width/2-md2.arm_rad,md2.torso_len-md2.arm_rad,0, - md2.arm_rad*2,-md2.arm_len/2,md2.arm_rad*2,md2.arm_rad,0, - md2.r_shoulder_a2,0,md2.r_shoulder_a1,&x,&y,&z); - AddBox(&md2,c3,x,y,z, - md2.arm_rad*2,-md2.arm_len/2,md2.arm_rad*2,0,0, - md2.r_shoulder_a2,0,md2.r_elbow_a,&x,&y,&z); - AddBox(&md2,c3,x,y,z, - md2.arm_rad*2,-md2.hand_len,md2.hand_rad*2,0,0, - md2.r_shoulder_a2,0,md2.r_wrist_a,&x,&y,&z); - - //Left Arm - AddBox(&md2,c1,md2.torso_width/2+md2.arm_rad,md2.torso_len-md2.arm_rad,0, - md2.arm_rad*2,-md2.arm_len/2,md2.arm_rad*2,md2.arm_rad,0, - md2.l_shoulder_a2,0,md2.l_shoulder_a1,&x,&y,&z); - AddBox(&md2,c3,x,y,z, - md2.arm_rad*2,-md2.arm_len/2,md2.arm_rad*2,0,0, - md2.l_shoulder_a2,0,md2.l_elbow_a,&x,&y,&z); - AddBox(&md2,c3,x,y,z, - md2.arm_rad*2,-md2.hand_len,md2.hand_rad*2,0,0, - md2.l_shoulder_a2,0,md2.l_wrist_a,&x,&y,&z); - - //Right Leg - AddBox(&md2,c2,-md2.torso_width/2+md2.leg_rad,0,0, - md2.leg_rad*2,-md2.leg_len/2,md2.leg_rad*2,0,0, - md2.r_hip_a2,0,md2.r_hip_a1,&x,&y,&z); - AddBox(&md2,c3,x,y,z, - md2.leg_rad*2,-md2.leg_len/2,md2.leg_rad*2,0,md2.foot_rad, - md2.r_hip_a2,0,md2.r_knee_a,&x,&y,&z); - AddBox(&md2,c4,x,y,z, - md2.leg_rad*2,-md2.foot_len,md2.foot_rad*2,md2.leg_rad,0, - md2.r_hip_a2,0,md2.r_ankle_a,&x,&y,&z); - - //Left Leg - AddBox(&md2,c2,md2.torso_width/2-md2.leg_rad,0,0, - md2.leg_rad*2,-md2.leg_len/2,md2.leg_rad*2,0,0, - md2.l_hip_a2,0,md2.l_hip_a1,&x,&y,&z); - AddBox(&md2,c3,x,y,z, - md2.leg_rad*2,-md2.leg_len/2,md2.leg_rad*2,0,md2.foot_rad, - md2.l_hip_a2,0,md2.l_knee_a,&x,&y,&z); - AddBox(&md2,c4,x,y,z, - md2.leg_rad*2,-md2.foot_len,md2.foot_rad*2,md2.leg_rad,0, - md2.l_hip_a2,0,md2.l_ankle_a,&x,&y,&z); - - res=Man2CSprite; - "%h7c",'\n'; - Sprite(res,"\t\t$$SP,\"<1>\",BI=%d$$"); - "%h7c",'\n'; - Free(m); - "Do another"; - if (YorN) - Free(res); - else - break; - } - return res; -} diff --git a/Apps/GrModels/ManGen.HC b/Apps/GrModels/ManGen.HC new file mode 100644 index 0000000..965e7b8 --- /dev/null +++ b/Apps/GrModels/ManGen.HC @@ -0,0 +1,320 @@ +//Makes a mesh man. + +#define MAX_VERTICES 1024 +#define MAX_TRIS 1024 + +class Man +{ + I32 vertex_cnt; + I32 tri_cnt; + CD3I32 v[MAX_VERTICES]; + CMeshTri t[MAX_TRIS]; +} *m; + +class ManDefineStruct +{ + F64 head_rad fmtstr + "$$DA-TRM,A=\"Head Radius :%8.3f\"$$\n"; + + F64 torso_len fmtstr + "$$DA-TRM,A=\"Torso Length :%8.3f\"$$\n"; + F64 arm_len fmtstr + "$$DA-TRM,A=\"Arm Length :%8.3f\"$$\n"; + F64 hand_len fmtstr + "$$DA-TRM,A=\"Hand Length :%8.3f\"$$\n"; + F64 leg_len fmtstr + "$$DA-TRM,A=\"Leg Length :%8.3f\"$$\n"; + F64 foot_len fmtstr + "$$DA-TRM,A=\"Foot Length :%8.3f\"$$\n"; + F64 torso_width fmtstr + "$$DA-TRM,A=\"Torso Width :%8.3f\"$$\n"; + F64 torso_depth fmtstr + "$$DA-TRM,A=\"Torso Depth :%8.3f\"$$\n"; + F64 arm_rad fmtstr + "$$DA-TRM,A=\"Arm Radius :%8.3f\"$$\n"; + F64 hand_rad fmtstr + "$$DA-TRM,A=\"Hand Radius :%8.3f\"$$\n"; + F64 leg_rad fmtstr + "$$DA-TRM,A=\"Leg Radius :%8.3f\"$$\n"; + F64 foot_rad fmtstr + "$$DA-TRM,A=\"Foot Radius :%8.3f\"$$\n\n"; + + F64 r_shoulder_a1 fmtstr + "$$DA-TRM,A=\"R.Shoulder Front/Back Angle:%8.3f\"$$\n"; + F64 l_shoulder_a1 fmtstr + "$$DA-TRM,A=\"L.Shoulder Front/Back Angle:%8.3f\"$$\n"; + F64 r_hip_a1 fmtstr + "$$DA-TRM,A=\"R.Hip Front/Back Angle :%8.3f\"$$\n"; + F64 l_hip_a1 fmtstr + "$$DA-TRM,A=\"L.Hip Front/Back Angle :%8.3f\"$$\n"; + + F64 r_shoulder_a2 fmtstr + "$$DA-TRM,A=\"R.Shoulder Side Angle :%8.3f\"$$\n"; + F64 l_shoulder_a2 fmtstr + "$$DA-TRM,A=\"L.Shoulder Side Angle :%8.3f\"$$\n"; + F64 r_hip_a2 fmtstr + "$$DA-TRM,A=\"R.Hip Side Angle :%8.3f\"$$\n"; + F64 l_hip_a2 fmtstr + "$$DA-TRM,A=\"L.Hip Side Angle :%8.3f\"$$\n"; + + F64 r_elbow_a fmtstr + "$$DA-TRM,A=\"R.Elbow Angle :%8.3f\"$$\n"; + F64 l_elbow_a fmtstr + "$$DA-TRM,A=\"L.Elbow Angle :%8.3f\"$$\n"; + F64 r_knee_a fmtstr + "$$DA-TRM,A=\"R.Knee Angle :%8.3f\"$$\n"; + F64 l_knee_a fmtstr + "$$DA-TRM,A=\"L.Knee Angle :%8.3f\"$$\n"; + + F64 r_wrist_a fmtstr + "$$DA-TRM,A=\"R.Wrist Angle :%8.3f\"$$\n"; + F64 l_wrist_a fmtstr + "$$DA-TRM,A=\"L.Wrist Angle :%8.3f\"$$\n"; + F64 r_ankle_a fmtstr + "$$DA-TRM,A=\"R.Ankle Angle :%8.3f\"$$\n"; + F64 l_ankle_a fmtstr + "$$DA-TRM,A=\"L.Ankle Angle :%8.3f\"$$\n"; + +}; + +U0 MDInit(ManDefineStruct *md) +{ + MemSet(md,0,sizeof(ManDefineStruct)); + + md->head_rad =5.0; + + md->torso_len =35.0; + md->arm_len =30.0; + md->hand_len =8.0; + md->leg_len =32.0; + md->foot_len =16.0; + md->torso_width=20.0; + md->torso_depth=10.0; + md->arm_rad =3.5; + md->hand_rad =2.0; + md->leg_rad =4.0; + md->foot_rad =3.0; + + md->r_shoulder_a1 =30; + md->l_shoulder_a1 =-30; + md->r_hip_a1 =-45; + md->l_hip_a1 =45; + + md->r_shoulder_a2 =10; + md->l_shoulder_a2 =10; + md->r_hip_a2 =-5; + md->l_hip_a2 =-5; + + md->r_elbow_a =30; + md->l_elbow_a =0; + md->r_knee_a =0; + md->l_knee_a =30; + + md->r_wrist_a =0; + md->l_wrist_a =0; + md->r_ankle_a =0; + md->l_ankle_a =0; +} + +U0 MDCorrect(ManDefineStruct *md) +{ + md->r_ankle_a =-md->r_ankle_a; + md->l_ankle_a =-md->l_ankle_a; + md->r_knee_a =-md->r_knee_a; + md->l_knee_a =-md->l_knee_a; + md->r_hip_a2 =-md->r_hip_a2; + md->r_shoulder_a2=-md->r_shoulder_a2; + md->r_ankle_a+=90; + md->l_ankle_a+=90; + + md->foot_len-=md->leg_rad; + + md->r_elbow_a+=md->r_shoulder_a1; + md->l_elbow_a+=md->l_shoulder_a1; + md->r_knee_a+=md->r_hip_a1; + md->l_knee_a+=md->l_hip_a1; + + md->r_wrist_a+=md->r_elbow_a; + md->l_wrist_a+=md->l_elbow_a; + md->r_ankle_a+=md->r_knee_a; + md->l_ankle_a+=md->l_knee_a; +} + +I64 AddVertex(ManDefineStruct *md,I64 x,I64 y,I64 z) +{ + I64 res=m->vertex_cnt++; + m->v[res].x=-x; + m->v[res].y=-y-md->leg_len-md->foot_rad*2; + m->v[res].z=-z; + return res; +} + +I64 AddTri(ManDefineStruct *,I64 c,I64 n0,I64 n1,I64 n2) +{ + I64 res=m->tri_cnt++; + m->t[res].color=c; + m->t[res].nums[0]=n1; + m->t[res].nums[1]=n0; + m->t[res].nums[2]=n2; + return res; +} + +U0 AddBox(ManDefineStruct *md,I64 c,I64 x1,I64 y1,I64 z1, + F64 w,F64 h,F64 d,F64 h2,F64 h3,F64 az,F64 ay,F64 ax, + I64 *ox,I64 *oy,I64 *oz) +{ + I64 *r; + I64 p1a,p2a,p3a,p4a; + I64 p1b,p2b,p3b,p4b; + I64 wx=w/2,wy=0,wz=0,hx=0,hy=h,hz=0,h2x=0,h2y=h2,h2z=0, + h3x=0,h3y=h3,h3z=0,dx=0,dy=0,dz=d/2; + + r=Mat4x4IdentNew; + Mat4x4RotZ(r,az*ã/180.0); + Mat4x4RotY(r,ay*ã/180.0); + Mat4x4RotX(r,ax*ã/180.0); + Mat4x4MulXYZ(r,&wx,&wy,&wz); + Mat4x4MulXYZ(r,&hx,&hy,&hz); + Mat4x4MulXYZ(r,&h2x,&h2y,&h2z); + Mat4x4MulXYZ(r,&h3x,&h3y,&h3z); + Mat4x4MulXYZ(r,&dx,&dy,&dz); + + p1a=AddVertex(md,x1+dx -wx+h2x,y1+dy -wy+h2y,z1+dz -wz+h2z); + p2a=AddVertex(md,x1+dx +wx+h2x,y1+dy +wy+h2y,z1+dz +wz+h2z); + p3a=AddVertex(md,x1+dx+hx-wx ,y1+dy+hy-wy ,z1+dz+hz-wz); + p4a=AddVertex(md,x1+dx+hx+wx ,y1+dy+hy+wy ,z1+dz+hz+wz); + AddTri(md,c,p1a,p2a,p3a); + AddTri(md,c,p4a,p3a,p2a); + + p1b=AddVertex(md,x1-dx -wx+h2x,y1-dy -wy+h2y,z1-dz -wz+h2z); + p2b=AddVertex(md,x1-dx +wx+h2x,y1-dy +wy+h2y,z1-dz +wz+h2z); + p3b=AddVertex(md,x1-dx+hx-wx ,y1-dy+hy-wy ,z1-dz+hz-wz); + p4b=AddVertex(md,x1-dx+hx+wx ,y1-dy+hy+wy ,z1-dz+hz+wz); + AddTri(md,c,p1b,p2b,p3b); + AddTri(md,c,p4b,p3b,p2b); + + AddTri(md,c,p1a,p2a,p1b); + AddTri(md,c,p2b,p1b,p2a); + AddTri(md,c,p3a,p4a,p3b); + AddTri(md,c,p4b,p3b,p4a); + AddTri(md,c,p1a,p3a,p1b); + AddTri(md,c,p3b,p1b,p3a); + AddTri(md,c,p2a,p4a,p2b); + AddTri(md,c,p4b,p2b,p4a); + + *ox=x1+hx-h3x; + *oy=y1+hy-h3y; + *oz=z1+hz-h3z; + + Free(r); +} + +U8 *Man2CSprite() +{ +//See $LK,"::/Adam/Gr/GrSpritePlot.HC",A="FL:::/Adam/Gr/GrSpritePlot.HC,1"$ for how CSprite are stored. + U8 *res=MAlloc(sizeof(CSpriteMeshU8s)+ + m->vertex_cnt*sizeof(CD3I32)+m->tri_cnt*sizeof(CMeshTri)+ + sprite_elem_base_sizes[SPT_END]), + *dst=res; + *dst++ =SPT_MESH; + *dst(I32 *)++ =m->vertex_cnt; + *dst(I32 *)++ =m->tri_cnt; + MemCpy(dst,&m->v,m->vertex_cnt*sizeof(CD3I32)); + dst+=m->vertex_cnt*sizeof(CD3I32); + MemCpy(dst,&m->t,m->tri_cnt*sizeof(CMeshTri)); + dst+=m->tri_cnt*sizeof(CMeshTri); + *dst++ =SPT_END; + return res; +} + +public U8 *ManGen() +{ + U8 *res; + I64 x,y,z,c1,c2,c3,c4; + ManDefineStruct md1,md2; + MDInit(&md1); + + while (TRUE) { + if (!DocForm(&md1)) + return NULL; + MemCpy(&md2,&md1,sizeof(ManDefineStruct)); + MDCorrect(&md2); + + c1=PopUpColorLighting("$$BK,1$$Shirt$$BK,0$$\n"); + if (c1<0) return NULL; + c2=PopUpColorLighting("$$BK,1$$Pants$$BK,0$$\n"); + if (c2<0) return NULL; + c3=PopUpColorLighting("$$BK,1$$Skin$$BK,0$$\n"); + if (c3<0) return NULL; + c4=PopUpColorLighting("$$BK,1$$Shoes$$BK,0$$\n"); + if (c4<0) return NULL; + + m=CAlloc(sizeof(Man)); + + //Head + AddBox(&md2,c3,0,md2.torso_len+md2.head_rad*2,0, + md2.head_rad*2,-md2.head_rad*2,md2.head_rad*2,0,0, 0,0,0, + &x,&y,&z); + + //Torso + AddBox(&md2,c1,0,md2.torso_len,0, + md2.torso_width,-md2.torso_len,md2.torso_depth,0,0, 0,0,0, + &x,&y,&z); + + //Right Arm + AddBox(&md2,c1,-md2.torso_width/2-md2.arm_rad,md2.torso_len-md2.arm_rad,0, + md2.arm_rad*2,-md2.arm_len/2,md2.arm_rad*2,md2.arm_rad,0, + md2.r_shoulder_a2,0,md2.r_shoulder_a1,&x,&y,&z); + AddBox(&md2,c3,x,y,z, + md2.arm_rad*2,-md2.arm_len/2,md2.arm_rad*2,0,0, + md2.r_shoulder_a2,0,md2.r_elbow_a,&x,&y,&z); + AddBox(&md2,c3,x,y,z, + md2.arm_rad*2,-md2.hand_len,md2.hand_rad*2,0,0, + md2.r_shoulder_a2,0,md2.r_wrist_a,&x,&y,&z); + + //Left Arm + AddBox(&md2,c1,md2.torso_width/2+md2.arm_rad,md2.torso_len-md2.arm_rad,0, + md2.arm_rad*2,-md2.arm_len/2,md2.arm_rad*2,md2.arm_rad,0, + md2.l_shoulder_a2,0,md2.l_shoulder_a1,&x,&y,&z); + AddBox(&md2,c3,x,y,z, + md2.arm_rad*2,-md2.arm_len/2,md2.arm_rad*2,0,0, + md2.l_shoulder_a2,0,md2.l_elbow_a,&x,&y,&z); + AddBox(&md2,c3,x,y,z, + md2.arm_rad*2,-md2.hand_len,md2.hand_rad*2,0,0, + md2.l_shoulder_a2,0,md2.l_wrist_a,&x,&y,&z); + + //Right Leg + AddBox(&md2,c2,-md2.torso_width/2+md2.leg_rad,0,0, + md2.leg_rad*2,-md2.leg_len/2,md2.leg_rad*2,0,0, + md2.r_hip_a2,0,md2.r_hip_a1,&x,&y,&z); + AddBox(&md2,c3,x,y,z, + md2.leg_rad*2,-md2.leg_len/2,md2.leg_rad*2,0,md2.foot_rad, + md2.r_hip_a2,0,md2.r_knee_a,&x,&y,&z); + AddBox(&md2,c4,x,y,z, + md2.leg_rad*2,-md2.foot_len,md2.foot_rad*2,md2.leg_rad,0, + md2.r_hip_a2,0,md2.r_ankle_a,&x,&y,&z); + + //Left Leg + AddBox(&md2,c2,md2.torso_width/2-md2.leg_rad,0,0, + md2.leg_rad*2,-md2.leg_len/2,md2.leg_rad*2,0,0, + md2.l_hip_a2,0,md2.l_hip_a1,&x,&y,&z); + AddBox(&md2,c3,x,y,z, + md2.leg_rad*2,-md2.leg_len/2,md2.leg_rad*2,0,md2.foot_rad, + md2.l_hip_a2,0,md2.l_knee_a,&x,&y,&z); + AddBox(&md2,c4,x,y,z, + md2.leg_rad*2,-md2.foot_len,md2.foot_rad*2,md2.leg_rad,0, + md2.l_hip_a2,0,md2.l_ankle_a,&x,&y,&z); + + res=Man2CSprite; + "%h7c",'\n'; + Sprite(res,"\t\t$$SP,\"<1>\",BI=%d$$"); + "%h7c",'\n'; + Free(m); + "Do another"; + if (YorN) + Free(res); + else + break; + } + return res; +} diff --git a/Apps/GrModels/Models.CPP b/Apps/GrModels/Models.HC similarity index 100% rename from Apps/GrModels/Models.CPP rename to Apps/GrModels/Models.HC diff --git a/Apps/GrModels/Run.CPP b/Apps/GrModels/Run.HC similarity index 100% rename from Apps/GrModels/Run.CPP rename to Apps/GrModels/Run.HC diff --git a/Apps/KeepAway/KeepAway.CPP b/Apps/KeepAway/KeepAway.CPP deleted file mode 100644 index 2c5ba6c..0000000 --- a/Apps/KeepAway/KeepAway.CPP +++ /dev/null @@ -1,1175 +0,0 @@ -//The ball and men were generated -//with $LK,"::/Apps/GrModels/Run.CPP"$. -//They were cut-and-pasted here. - -$BG,14$ - $SP,"<1>",BI=1$ - - - - - - $SP,"<2>",BI=2$ - - - - - - - $SP,"<3>",BI=3$ - - - - - - - $SP,"<4>",BI=4$ - - - - - - - $SP,"<5>",BI=5$ - - - - - - - $SP,"<6>",BI=6$ - - - - - - - $SP,"<7>",BI=7$ - - - - - - - $SP,"<8>",BI=8$ - - - - - - - $SP,"<9>",BI=9$ - - - - - - - $SP,"<10>",BI=10$ - - - - - - - $SP,"<11>",BI=11$ - - - - - - - $SP,"<12>",BI=12$ - - - - - - $SP,"<13>",BI=13$ - - - - - - - $SP,"<14>",BI=14$ - - - - - - $SP,"<15>",BI=15$ - - - - - - $SP,"<16>",BI=16$ - - - - - - - $SP,"<17>",BI=17$ - - - - - - - $SP,"<18>",BI=18$ - - - - - - - $SP,"<19>",BI=19$ - - - - - - - $SP,"<20>",BI=20$ - - - - - - - $SP,"<21>",BI=21$ - - - - - - - $SP,"<22>",BI=22$ - - - - - - - $SP,"<23>",BI=23$ - - - -$BG$class Frame -{ - U8 *img[2]; - F64 dt; -}; - -#define COURT_BORDER 10 -#define COLLISION_DAMP 0.8 - -/* Viscosity is way bigger than -real air viscosity. In reality -air is approximated by V and V$SY,-3$2$SY,0$ -terms and is smaller. However, I use -this to produce a rolling friction -value, too. If you want to see my -best attempt at realistic physics -download SimStructure. - -http://www.templeos.org/files/SimStrSetUp.zip - -This is just a video game. Relax. -*/ -#define AIR_VISCOSITY 0.1 - -#define GRAVITY_ACCELERATION 500 -#define SHOT_VELOCITY 400 -#define DRIBBLE_T 0.25 -#define MAN_VELOCITY 150 -#define MAN_SQR_RADIUS (20*20) -#define FOUL_VELOCITY_THRESHOLD 50 -#define JUMP_VELOCITY 250 -#define ROLL_VELOCITY_THRESHOLD 100 -#define RANDOM_MAN_ACCELERATION 30 - -#define HEAD_Z_OFFSET 200 -#define HAND_X_OFFSET 30 -#define HAND_Y_OFFSET 20 -#define HAND_SQR_OFFSET \ - (HAND_X_OFFSET*HAND_X_OFFSET+HAND_Y_OFFSET*HAND_Y_OFFSET) -#define HAND_Z_OFFSET 110 - -#define FIRST_STANDING 0 - -#define NUM_RUNNING_IMGS 4 -#define FIRST_RUNNING 0 -#define LAST_RUNNING (FIRST_RUNNING+NUM_RUNNING_IMGS-1) - -#define NUM_SHOOTING_IMGS 5 -#define FIRST_SHOOTING (LAST_RUNNING+1) -#define LAST_SHOOTING (FIRST_SHOOTING+NUM_SHOOTING_IMGS-1) - -#define NUM_DRIBBLING_IMGS 4 -#define FIRST_DRIBBLING (LAST_SHOOTING+1) -#define LAST_DRIBBLING (FIRST_DRIBBLING+NUM_DRIBBLING_IMGS-1) - -#define NUM_STOPPED_DRIBBLING_IMGS 2 -#define FIRST_STOPPED_DRIBBLING (LAST_DRIBBLING+1) -#define LAST_STOPPED_DRIBBLING \ - (FIRST_STOPPED_DRIBBLING+NUM_STOPPED_DRIBBLING_IMGS-1) - -Frame imgs[LAST_STOPPED_DRIBBLING+1]={ - {{$IB,"<6>",BI=6$,$IB,"<7>",BI=7$},2*DRIBBLE_T/NUM_RUNNING_IMGS}, - {{$IB,"<2>",BI=2$,$IB,"<3>",BI=3$},2*DRIBBLE_T/NUM_RUNNING_IMGS}, - {{$IB,"<6>",BI=6$,$IB,"<7>",BI=7$},2*DRIBBLE_T/NUM_RUNNING_IMGS}, - {{$IB,"<4>",BI=4$,$IB,"<5>",BI=5$},2*DRIBBLE_T/NUM_RUNNING_IMGS}, - {{$IB,"<8>",BI=8$,$IB,"<9>",BI=9$},0.1},{{$IB,"<10>",BI=10$,$IB,"<11>",BI=11$},0.2}, - {{$IB,"<12>",BI=12$,$IB,"<13>",BI=13$},0.2},{{$IB,"<12>",BI=12$,$IB,"<13>",BI=13$},0.1},{{$IB,"<14>",BI=14$,$IB,"<15>",BI=15$},0.1}, - {{$IB,"<20>",BI=20$,$IB,"<21>",BI=21$},2*DRIBBLE_T/NUM_DRIBBLING_IMGS}, - {{$IB,"<16>",BI=16$,$IB,"<17>",BI=17$},2*DRIBBLE_T/NUM_DRIBBLING_IMGS}, - {{$IB,"<20>",BI=20$,$IB,"<21>",BI=21$},2*DRIBBLE_T/NUM_DRIBBLING_IMGS}, - {{$IB,"<18>",BI=18$,$IB,"<19>",BI=19$},2*DRIBBLE_T/NUM_DRIBBLING_IMGS}, - {{$IB,"<20>",BI=20$,$IB,"<21>",BI=21$},DRIBBLE_T/NUM_STOPPED_DRIBBLING_IMGS}, - {{$IB,"<22>",BI=22$,$IB,"<23>",BI=23$},DRIBBLE_T/NUM_STOPPED_DRIBBLING_IMGS}, -}; - -RegSetDftEntry("TempleOS/KeepAway","I64 best_score0=0,best_score1=9999;\n"); -RegExeBranch("TempleOS/KeepAway"); - -F64 game_t_end,foul_t_end; -I64 score0,score1; - -#define NUM_PER_SIDE 3 -#define NUM_OBJS (NUM_PER_SIDE*2+1) -Bool someone_shooting,someone_has_ball; -F64 shot_land_t; - -class Obj -{ - I64 team; //-1 is ball - F64 x,y,z,DxDt,DyDt,DzDt,é,radius,stolen_t0; - F64 get_ball_dt,get_ball_é,nearest_man_dd,last_t0,next_t0,foul_t0; - I64 last_img,next_img; - Bool stopped,shooting,has_ball,nearest_ball,pad[4]; -} objs[NUM_OBJS],*ball,*human,*last_owner; - -/*Just to be different, I didn't use the built-in -DCF_TRANSFORMATION flag in this game. -Instead, I chose a 45 degree angle -between Y and Z as the view point. -If I had used the transform, I would -have to make all my men taller. -This is a little simpler, and faster, -but adds lots of factor 2 vals. - -I also didn't use the $LK,"CMathODE",A="MN:CMathODE"$ feat, -just to be different. -*/ - -U0 DrawObj(CDC *dc,Obj *o,F64 tt) -{ - U8 *temps; - F64 r1=Max(9-0.1*o->z,1),r2=Max(r1/4,1); - - if (o==human) - dc->color=LTRED; - else - dc->color=BLACK; - GrEllipse(dc,o->x,o->y/2,r1,r2); - GrFloodFill(dc,o->x,o->y/2); - - if (o==ball) - Sprite3(dc,o->x,(o->y-o->z)/2,GR_Z_ALL-o->y,$IB,"<1>",BI=1$); - else { - temps=SpriteInterpolate((tt-o->last_t0)/(o->next_t0-o->last_t0), - imgs[o->last_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->é); - Free(temps); - } -} - -I64 ObjCompare(Obj *o1,Obj *o2) -{ - return o1->y-o2->y; -} - -U0 DrawIt(CTask *task,CDC *dc) -{ - F64 tt=tS,d,d_down,d_up; - I64 i; - Obj *o_sort[NUM_OBJS],*o; - - DCDepthBufAlloc(dc); - dc->ls.x=10000; - dc->ls.y=60000; - dc->ls.z=10000; - d=65535/D3I32Norm(&dc->ls); - dc->ls.x*=d; - dc->ls.y*=d; - dc->ls.z*=d; - - dc->pen_width=2; - dc->color=RED; - GrBorder(dc,COURT_BORDER,COURT_BORDER, - task->pix_width -1-COURT_BORDER, - task->pix_height-1-COURT_BORDER); - for (i=0;ihas_ball) { - 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. - 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) - ball->z=o->z+HAND_Z_OFFSET-ball->radius*2; - } else if (o->shooting) { - ball->x=o->x; - ball->y=o->y; - ball->z=o->z+HEAD_Z_OFFSET; - } - if (tt>o->next_t0) { - if (o->has_ball && (ball->z+ball->radius*2>=o->z+HAND_Z_OFFSET || - Abs(ball->DzDt)<30)) { -//This is an approximation. My instinct tells me the viscosity term - //needs an $LK,"Exp",A="MN:Exp"$(). However, we should be syncronized to img frames, - //so we don't have to be perfect. - d_down=1.0; - d_up =1.0/COLLISION_DAMP; -//Up bounce takes higher % because speed lost in collision. - ball->DzDt=-((d_down+d_up)* - (o->z+HAND_Z_OFFSET-ball->radius*4)/(1.0-AIR_VISCOSITY)+ - 0.5*GRAVITY_ACCELERATION*( - Sqr(DRIBBLE_T*d_up/(d_down+d_up))- - Sqr(DRIBBLE_T*d_down/(d_down+d_up)) ))/DRIBBLE_T; - } - o->last_t0=tt; - o->last_img=o->next_img++; - if (o->stopped) { - if (o->has_ball) { - if (!(FIRST_STOPPED_DRIBBLING<=o->next_img<=LAST_STOPPED_DRIBBLING)) - o->next_img=FIRST_STOPPED_DRIBBLING; - } else - o->next_img=FIRST_STANDING; - o->stopped=FALSE; - } else if (o->shooting) { - if (!(FIRST_SHOOTING<=o->last_img<=LAST_SHOOTING)) - o->next_img=FIRST_SHOOTING; - if (o->next_img>LAST_SHOOTING) { - o->next_img=FIRST_STANDING; - someone_has_ball=someone_shooting=o->has_ball=o->shooting=FALSE; - ball->DxDt=o->DxDt+SHOT_VELOCITY/sqrt2*Cos(o->é-ã/2); - ball->DyDt=o->DyDt+SHOT_VELOCITY/sqrt2*Sin(o->é-ã/2); - 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 { - ball->DxDt=0; - ball->DyDt=0; - ball->DzDt=0; - } - } else if (o->has_ball) { - if (FIRST_RUNNING<=o->next_img<=LAST_RUNNING) - o->next_img+=FIRST_DRIBBLING-FIRST_RUNNING; - if (!(FIRST_DRIBBLING<=o->next_img<=LAST_DRIBBLING)) - o->next_img=FIRST_DRIBBLING; - } else { - if (FIRST_DRIBBLING<=o->next_img<=LAST_DRIBBLING) - o->next_img+=FIRST_RUNNING-FIRST_DRIBBLING; - if (!(FIRST_RUNNING<=o->next_img<=LAST_RUNNING)) - o->next_img=FIRST_RUNNING; - } - o->next_t0+=imgs[o->last_img].dt; - if (o->next_t0<=tt) - o->next_t0=tt+imgs[o->last_img].dt; - } - } - } - - QSortI64(o_sort,NUM_OBJS,&ObjCompare); - for (i=0;icolor=RED; - tt=0; - if (Blink) - GrPrint(dc,(task->pix_width-FONT_WIDTH*9)>>1, - (task->pix_height-FONT_HEIGHT)>>1,"Game Over"); - } else { - if (tScolor=LTRED; - if (Blink) - GrPrint(dc,(task->pix_width-FONT_WIDTH*4)>>1, - (task->pix_height-FONT_HEIGHT)>>1,"Foul"); - } - dc->color=BLACK; - } - GrPrint(dc,0,0,"Time:%d:%04.1f Score:",ToI64(tt),(tt-ToI64(tt))*60); - GrPrint (dc,FONT_WIDTH*27,0,"Best Score:"); - - dc->color=LTCYAN; - GrPrint(dc,FONT_WIDTH*20,0,"%02d",score0); - dc->color=LTPURPLE; - GrPrint(dc,FONT_WIDTH*23,0,"%02d",score1); - - dc->color=LTCYAN; - GrPrint(dc,FONT_WIDTH*39,0,"%02d",best_score0); - dc->color=LTPURPLE; - GrPrint(dc,FONT_WIDTH*42,0,"%02d",best_score1); -} - -U0 Shoot(Obj *o) -{ - if (!someone_shooting && o->has_ball) { - someone_shooting=o->stopped=o->shooting=TRUE; - o->has_ball=FALSE; - } -} - -U0 AnimateTask(CTask *parent_task) -{ - F64 d,dx,dy,dt,dx2,dy2,t0=tS; - I64 i,j; - Bool gets_ball; - Obj *o,*nearest_ball[2]; - while (TRUE) { - dt=tS-t0; - t0=tS; - - if (game_t_end && game_t_endbest_score0-best_score1) { - best_score0=score0; - best_score1=score1; - Snd(2000);Sleep(100); Snd(0);Sleep(100); - Snd(2000);Sleep(100); Snd(0);Sleep(100); - } - } - - if (game_t_end) { - MemSet(&nearest_ball,0,sizeof(nearest_ball)); - for (i=0;inearest_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_dtteam]->get_ball_dt) - nearest_ball[o->team]=o; - } - } - nearest_ball[0]->nearest_ball=TRUE; - nearest_ball[1]->nearest_ball=TRUE; - - for (i=0;ix+=dt*o->DxDt; - o->y+=dt*o->DyDt; - if (!someone_shooting) - o->z+=dt*(o->DzDt-0.5*GRAVITY_ACCELERATION*dt); - } else { - if (!o->has_ball) { - if (t0-o->stolen_t0>2.0 && !someone_shooting) { - dx=ball->x-o->x; - dy=ball->y-o->y; - if (dx*dx+dy*dyzz+HAND_Z_OFFSET) { - gets_ball=TRUE; - for (j=0;jhas_ball=TRUE; - if (o!=last_owner) { - if (o->team) { - if (t0shooting) { - if (o==human) { - 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; - } 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 { - dx=o->DxDt+=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); - if (d>=1.0) { - o->é=Arg(dx,dy)+ã/2; - dx*=MAN_VELOCITY/sqrt2*dt/d; - dy*=MAN_VELOCITY/sqrt2*dt/d; - o->nearest_man_dd=MAX_F64; - for (j=0;jx; - dy2=objs[j].y-o->y; - d=Sqr(dx2)+Sqr(dy2); - if (dnearest_man_dd) - o->nearest_man_dd=d; - if (do->foul_t0+0.15) { - d=(dx-objs[j].DxDt)*dx2+(dy-objs[j].DyDt)*dy2; - if (o==human && t0>o->foul_t0+1.0 && - dt && d/dt>FOUL_VELOCITY_THRESHOLD && - objs[j].team) { - Noise(250,500,500); - score1+=1; - foul_t_end=t0+1.0; - } - o->foul_t0=t0; - } - } - } - if (t0foul_t0+0.15) { - dx=-dx; - dy=-dy; - } - o->x+=dx; - o->y+=dy; - o->stopped=FALSE; - } else - o->stopped=TRUE; - } - if (o->DzDt) - o->z+=dt*(o->DzDt-0.5*GRAVITY_ACCELERATION*dt); - } - - if (o->x+o->radius>=parent_task->pix_width-COURT_BORDER) { - o->x=parent_task->pix_width-COURT_BORDER-1-o->radius; - o->DxDt=-COLLISION_DAMP*o->DxDt; - if (o==ball) - Noise(10,1000,2000); - } - if (o->x-o->radiusx=COURT_BORDER+o->radius; - o->DxDt=-COLLISION_DAMP*o->DxDt; - if (o==ball) - Noise(10,1000,2000); - } - - if (o->y+o->radius*2>=(parent_task->pix_height-COURT_BORDER)*2) { - o->y=(parent_task->pix_height-COURT_BORDER)*2-1-o->radius*2; - o->DyDt=-COLLISION_DAMP*o->DyDt; - if (o==ball) - Noise(10,1000,2000); - } - if (o->y-o->radius*2<2*COURT_BORDER) { - o->y=COURT_BORDER*2+o->radius*2; - o->DyDt=-COLLISION_DAMP*o->DyDt; - if (o==ball) - Noise(10,1000,2000); - } - - if (o->z-o->radius*2<0) { - o->z=o->radius*2; - o->DzDt=-COLLISION_DAMP*o->DzDt; - if (o->DzDt>ROLL_VELOCITY_THRESHOLD) - Noise(10,1000,2000); - if (o!=ball) - o->DzDt=0; - } else if (o->z-o->radius*2>0) - o->DzDt-=GRAVITY_ACCELERATION*dt; - if (o==ball) { - d=Exp(-AIR_VISCOSITY*dt); - o->DxDt*=d; - o->DyDt*=d; - o->DzDt*=d; - } - } - } - WinMgrSync; - } -} - -U0 Init() -{ - I64 i; - someone_shooting=FALSE; - shot_land_t=0; - MemSet(&objs,0,sizeof(objs)); - for (i=0;ipix_width/2; - objs[i].y=2*Fs->pix_height/2; - objs[i].next_img=objs[i].last_img=FIRST_RUNNING; - } - last_owner=NULL; - human=&objs[0]; - ball =&objs[i]; - ball->team=-1; - ball->x=0.5*Fs->pix_width/2; - ball->y=0.5*2*Fs->pix_height/2; - ball->radius=11; - ball->z=ball->radius; - score0=score1=0; - game_t_end=tS+3*60; - foul_t_end=0; -} - -U0 KeepAway() -{ - I64 msg_code,a1,a2; - - PopUpOk( - "Pass or hand-off to your team to score points.$$FG$$\n\n" - "\t2 points for successful hand-off.\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"$ - Fs->text_attr=BLACK+YELLOW<<4; - Fs->win_inhibit|=WIG_DBL_CLICK; - AutoComplete; - WinBorder; - WinMax; - DocCursor; - DocClear; - - MenuPush( - "File {" - " Abort(,CH_SHIFT_ESC);" - " Exit(,CH_ESC);" - "}" - "Play {" - " Restart(,'\n');" - " Shoot(,CH_SPACE);" - " Jump(,'j');" - "}" - ); - - Init; - Fs->draw_it=&DrawIt; - Fs->animate_task=Spawn(&AnimateTask,Fs,"Animate",,Fs); - - try { - while (TRUE) { - msg_code=GetMsg(&a1,&a2, - 1<DzDt=JUMP_VELOCITY; - break; - case MSG_KEY_DOWN: - switch (a1) { - case '\n': - Init; - break; - case 'j': - goto ka_jump; - case CH_SPACE: - goto ka_shoot; - case CH_SHIFT_ESC: - case CH_ESC: - goto ka_done; - } - break; - } - } -ka_done: //Don't goto out of try - GetMsg(,,1<>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ -·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ -ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ -·ÿÿÿöÿÿÿ·ÿÿÿ -ÚÿÿÿöÿÿÿÚÿÿÿºÿÿÿüÿÿÿ ¼ÿÿÿþÿÿÿÉÿÿÿËÿÿÿ¶ÿÿÿ ¸ÿÿÿÅÿÿÿ Çÿÿÿ ÊÿÿÿÌÿÿÿÒÿÿÿÔÿÿÿÄÿÿÿÆÿÿÿ -ÌÿÿÿÎÿÿÿÑÿÿÿÓÿÿÿÕÿÿÿ×ÿÿÿÍÿÿÿÏÿÿÿÑÿÿÿÓÿÿÿöÿÿÿ¸ÿÿÿÿÿÿÿòÿÿÿ¸ÿÿÿóÿÿÿÇÿÿÿöÿÿÿïÿÿÿÇÿÿÿøÿÿÿöÿÿÿºÿÿÿòÿÿÿºÿÿÿóÿÿÿÉÿÿÿúÿÿÿïÿÿÿÉÿÿÿüÿÿÿóÿÿÿÇÿÿÿöÿÿÿïÿÿÿÇÿÿÿøÿÿÿñÿÿÿÔÿÿÿïÿÿÿíÿÿÿÔÿÿÿñÿÿÿóÿÿÿÉÿÿÿúÿÿÿïÿÿÿÉÿÿÿüÿÿÿñÿÿÿÖÿÿÿóÿÿÿíÿÿÿÖÿÿÿõÿÿÿñÿÿÿÔÿÿÿðÿÿÿíÿÿÿÔÿÿÿòÿÿÿðÿÿÿÛÿÿÿíÿÿÿìÿÿÿÛÿÿÿïÿÿÿñÿÿÿÖÿÿÿòÿÿÿíÿÿÿÖÿÿÿôÿÿÿðÿÿÿÝÿÿÿïÿÿÿìÿÿÿÝÿÿÿñÿÿÿ ØÿÿÿýÿÿÿØÿÿÿÿÿÿÿäÿÿÿòÿÿÿäÿÿÿôÿÿÿ ÜÿÿÿÜÿÿÿèÿÿÿöÿÿÿèÿÿÿøÿÿÿäÿÿÿòÿÿÿäÿÿÿôÿÿÿðÿÿÿçÿÿÿðÿÿÿéÿÿÿèÿÿÿöÿÿÿèÿÿÿøÿÿÿôÿÿÿëÿÿÿôÿÿÿíÿÿÿõÿÿÿãÿÿÿõÿÿÿãÿÿÿîÿÿÿÿÿÿÿîÿÿÿïÿÿÿçÿÿÿïÿÿÿçÿÿÿúÿÿÿòÿÿÿÿÿÿÿúÿÿÿòÿÿÿýÿÿÿÜÿÿÿýÿÿÿ÷ÿÿÿÞÿÿÿÿÿÿÿÿÿÿÿèÿÿÿ ùÿÿÿêÿÿÿ ýÿÿÿÖÿÿÿ÷ÿÿÿØÿÿÿÿÿÿÿâÿÿÿ ùÿÿÿäÿÿÿÿÿÿÿçÿÿÿùÿÿÿéÿÿÿ -÷ÿÿÿ ûÿÿÿùÿÿÿÿÿÿÿãÿÿÿùÿÿÿåÿÿÿóÿÿÿûÿÿÿõÿÿÿýÿÿÿûÿÿÿýÿÿÿøÿÿÿýÿÿÿøÿÿÿ ÷ÿÿÿ ûÿÿÿ÷ÿÿÿòÿÿÿýÿÿÿòÿÿÿ  - -   - -  -     ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ -·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ -ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ -·ÿÿÿöÿÿÿ·ÿÿÿ -ÚÿÿÿöÿÿÿÚÿÿÿ·ÿÿÿ ¹ÿÿÿÆÿÿÿ÷ÿÿÿÈÿÿÿ÷ÿÿÿ¹ÿÿÿ »ÿÿÿÈÿÿÿûÿÿÿÊÿÿÿûÿÿÿÆÿÿÿ÷ÿÿÿÈÿÿÿ÷ÿÿÿÓÿÿÿðÿÿÿÕÿÿÿðÿÿÿÈÿÿÿûÿÿÿÊÿÿÿûÿÿÿÕÿÿÿôÿÿÿ×ÿÿÿôÿÿÿÓÿÿÿñÿÿÿÕÿÿÿñÿÿÿÚÿÿÿîÿÿÿÜÿÿÿîÿÿÿÕÿÿÿóÿÿÿ×ÿÿÿóÿÿÿÜÿÿÿðÿÿÿÞÿÿÿðÿÿÿöÿÿÿ»ÿÿÿýÿÿÿòÿÿÿ»ÿÿÿýÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿöÿÿÿ·ÿÿÿòÿÿÿ·ÿÿÿóÿÿÿÆÿÿÿ -ïÿÿÿÆÿÿÿ -óÿÿÿËÿÿÿïÿÿÿËÿÿÿñÿÿÿÓÿÿÿíÿÿÿÓÿÿÿóÿÿÿÅÿÿÿ ïÿÿÿÅÿÿÿ ñÿÿÿÍÿÿÿíÿÿÿÍÿÿÿñÿÿÿÒÿÿÿíÿÿÿÒÿÿÿðÿÿÿÖÿÿÿìÿÿÿÖÿÿÿñÿÿÿÎÿÿÿíÿÿÿÎÿÿÿðÿÿÿÒÿÿÿìÿÿÿÒÿÿÿ ÝÿÿÿþÿÿÿÝÿÿÿþÿÿÿéÿÿÿ -éÿÿÿ - ×ÿÿÿ×ÿÿÿãÿÿÿãÿÿÿèÿÿÿ èÿÿÿ øÿÿÿøÿÿÿäÿÿÿäÿÿÿôÿÿÿôÿÿÿüÿÿÿþÿÿÿ÷ÿÿÿÿÿÿÿùÿÿÿöÿÿÿ øÿÿÿ ñÿÿÿÿÿÿÿóÿÿÿýÿÿÿ×ÿÿÿþÿÿÿ÷ÿÿÿÙÿÿÿþÿÿÿÿÿÿÿãÿÿÿóÿÿÿùÿÿÿåÿÿÿóÿÿÿýÿÿÿÛÿÿÿ÷ÿÿÿÝÿÿÿÿÿÿÿçÿÿÿ÷ÿÿÿùÿÿÿéÿÿÿ÷ÿÿÿÿÿÿÿãÿÿÿóÿÿÿùÿÿÿåÿÿÿóÿÿÿïÿÿÿèÿÿÿûÿÿÿñÿÿÿèÿÿÿÿÿÿÿçÿÿÿ÷ÿÿÿùÿÿÿéÿÿÿ÷ÿÿÿóÿÿÿìÿÿÿûÿÿÿõÿÿÿìÿÿÿôÿÿÿâÿÿÿûÿÿÿöÿÿÿäÿÿÿÿÿÿÿíÿÿÿýÿÿÿïÿÿÿîÿÿÿæÿÿÿûÿÿÿðÿÿÿèÿÿÿùÿÿÿñÿÿÿýÿÿÿûÿÿÿóÿÿÿ  - -       -  -   -      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ -·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ -ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ -·ÿÿÿöÿÿÿ·ÿÿÿ -ÚÿÿÿöÿÿÿÚÿÿÿ·ÿÿÿ ¹ÿÿÿÆÿÿÿ÷ÿÿÿÈÿÿÿ÷ÿÿÿ¹ÿÿÿ »ÿÿÿÈÿÿÿûÿÿÿÊÿÿÿûÿÿÿÆÿÿÿ÷ÿÿÿÈÿÿÿ÷ÿÿÿÓÿÿÿðÿÿÿÕÿÿÿðÿÿÿÈÿÿÿûÿÿÿÊÿÿÿûÿÿÿÕÿÿÿôÿÿÿ×ÿÿÿôÿÿÿÓÿÿÿñÿÿÿÕÿÿÿñÿÿÿÚÿÿÿîÿÿÿÜÿÿÿîÿÿÿÕÿÿÿóÿÿÿ×ÿÿÿóÿÿÿÜÿÿÿðÿÿÿÞÿÿÿðÿÿÿöÿÿÿ»ÿÿÿýÿÿÿòÿÿÿ»ÿÿÿýÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿöÿÿÿ·ÿÿÿòÿÿÿ·ÿÿÿóÿÿÿÆÿÿÿ -ïÿÿÿÆÿÿÿ -óÿÿÿËÿÿÿïÿÿÿËÿÿÿñÿÿÿÓÿÿÿíÿÿÿÓÿÿÿóÿÿÿÅÿÿÿ ïÿÿÿÅÿÿÿ ñÿÿÿÍÿÿÿíÿÿÿÍÿÿÿñÿÿÿÒÿÿÿíÿÿÿÒÿÿÿðÿÿÿÖÿÿÿìÿÿÿÖÿÿÿñÿÿÿÎÿÿÿíÿÿÿÎÿÿÿðÿÿÿÒÿÿÿìÿÿÿÒÿÿÿ ÝÿÿÿþÿÿÿÝÿÿÿþÿÿÿéÿÿÿ -éÿÿÿ - ×ÿÿÿ×ÿÿÿãÿÿÿãÿÿÿèÿÿÿ èÿÿÿ øÿÿÿøÿÿÿäÿÿÿäÿÿÿôÿÿÿôÿÿÿüÿÿÿþÿÿÿ÷ÿÿÿÿÿÿÿùÿÿÿöÿÿÿ øÿÿÿ ñÿÿÿÿÿÿÿóÿÿÿýÿÿÿ×ÿÿÿþÿÿÿ÷ÿÿÿÙÿÿÿþÿÿÿÿÿÿÿãÿÿÿóÿÿÿùÿÿÿåÿÿÿóÿÿÿýÿÿÿÛÿÿÿ÷ÿÿÿÝÿÿÿÿÿÿÿçÿÿÿ÷ÿÿÿùÿÿÿéÿÿÿ÷ÿÿÿÿÿÿÿãÿÿÿóÿÿÿùÿÿÿåÿÿÿóÿÿÿïÿÿÿèÿÿÿûÿÿÿñÿÿÿèÿÿÿÿÿÿÿçÿÿÿ÷ÿÿÿùÿÿÿéÿÿÿ÷ÿÿÿóÿÿÿìÿÿÿûÿÿÿõÿÿÿìÿÿÿôÿÿÿâÿÿÿûÿÿÿöÿÿÿäÿÿÿÿÿÿÿíÿÿÿýÿÿÿïÿÿÿîÿÿÿæÿÿÿûÿÿÿðÿÿÿèÿÿÿùÿÿÿñÿÿÿýÿÿÿûÿÿÿóÿÿÿ  - -   - -  -     ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ -·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ -ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ -·ÿÿÿöÿÿÿ·ÿÿÿ -ÚÿÿÿöÿÿÿÚÿÿÿ¸ÿÿÿýÿÿÿ ºÿÿÿýÿÿÿÉÿÿÿýÿÿÿËÿÿÿýÿÿÿ¸ÿÿÿ ºÿÿÿÉÿÿÿËÿÿÿÉÿÿÿýÿÿÿËÿÿÿýÿÿÿØÿÿÿýÿÿÿÚÿÿÿýÿÿÿÉÿÿÿËÿÿÿØÿÿÿÚÿÿÿØÿÿÿþÿÿÿÚÿÿÿþÿÿÿàÿÿÿþÿÿÿâÿÿÿþÿÿÿØÿÿÿÚÿÿÿàÿÿÿâÿÿÿöÿÿÿ¹ÿÿÿýÿÿÿòÿÿÿ¹ÿÿÿýÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿöÿÿÿ¹ÿÿÿòÿÿÿ¹ÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿñÿÿÿÙÿÿÿýÿÿÿíÿÿÿÙÿÿÿýÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿñÿÿÿÙÿÿÿþÿÿÿíÿÿÿÙÿÿÿþÿÿÿðÿÿÿáÿÿÿþÿÿÿìÿÿÿáÿÿÿþÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿðÿÿÿáÿÿÿìÿÿÿáÿÿÿ -ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -ÚÿÿÿÚÿÿÿ -êÿÿÿêÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -êÿÿÿêÿÿÿ -úÿÿÿúÿÿÿ -üÿÿÿüÿÿÿ -  -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   - -       -  -   -      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ -·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ -ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ -·ÿÿÿöÿÿÿ·ÿÿÿ -ÚÿÿÿöÿÿÿÚÿÿÿ¸ÿÿÿýÿÿÿ ºÿÿÿýÿÿÿÉÿÿÿýÿÿÿËÿÿÿýÿÿÿ¸ÿÿÿ ºÿÿÿÉÿÿÿËÿÿÿÉÿÿÿýÿÿÿËÿÿÿýÿÿÿØÿÿÿýÿÿÿÚÿÿÿýÿÿÿÉÿÿÿËÿÿÿØÿÿÿÚÿÿÿØÿÿÿþÿÿÿÚÿÿÿþÿÿÿàÿÿÿþÿÿÿâÿÿÿþÿÿÿØÿÿÿÚÿÿÿàÿÿÿâÿÿÿöÿÿÿ¹ÿÿÿýÿÿÿòÿÿÿ¹ÿÿÿýÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿöÿÿÿ¹ÿÿÿòÿÿÿ¹ÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿñÿÿÿÙÿÿÿýÿÿÿíÿÿÿÙÿÿÿýÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿñÿÿÿÙÿÿÿþÿÿÿíÿÿÿÙÿÿÿþÿÿÿðÿÿÿáÿÿÿþÿÿÿìÿÿÿáÿÿÿþÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿðÿÿÿáÿÿÿìÿÿÿáÿÿÿ -ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -ÚÿÿÿÚÿÿÿ -êÿÿÿêÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -êÿÿÿêÿÿÿ -úÿÿÿúÿÿÿ -üÿÿÿüÿÿÿ -  -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   - -   - -  -     ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ -·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ -ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ -·ÿÿÿöÿÿÿ·ÿÿÿ -ÚÿÿÿöÿÿÿÚÿÿÿ¾ÿÿÿýÿÿÿ -¾ÿÿÿýÿÿÿ¾ÿÿÿ -¾ÿÿÿ¸ÿÿÿýÿÿÿ -¸ÿÿÿýÿÿÿ¸ÿÿÿ -¸ÿÿÿ»ÿÿÿ -»ÿÿÿ¬ÿÿÿ -¬ÿÿÿ»ÿÿÿ -»ÿÿÿ ¬ÿÿÿ -¬ÿÿÿ ¬ÿÿÿ -¬ÿÿÿ¤ÿÿÿ -¤ÿÿÿ¬ÿÿÿ -¬ÿÿÿ ¤ÿÿÿ -¤ÿÿÿ öÿÿÿ¾ÿÿÿýÿÿÿðÿÿÿ¾ÿÿÿýÿÿÿöÿÿÿ¾ÿÿÿðÿÿÿ¾ÿÿÿöÿÿÿ¸ÿÿÿýÿÿÿðÿÿÿ¸ÿÿÿýÿÿÿöÿÿÿ¸ÿÿÿðÿÿÿ¸ÿÿÿöÿÿÿ»ÿÿÿðÿÿÿ»ÿÿÿöÿÿÿ¬ÿÿÿðÿÿÿ¬ÿÿÿöÿÿÿ»ÿÿÿ ðÿÿÿ»ÿÿÿ öÿÿÿ¬ÿÿÿ ðÿÿÿ¬ÿÿÿ öÿÿÿ¬ÿÿÿðÿÿÿ¬ÿÿÿöÿÿÿ¤ÿÿÿðÿÿÿ¤ÿÿÿöÿÿÿ¬ÿÿÿ ðÿÿÿ¬ÿÿÿ öÿÿÿ¤ÿÿÿ ðÿÿÿ¤ÿÿÿ -ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -ÚÿÿÿÚÿÿÿ -êÿÿÿêÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -êÿÿÿêÿÿÿ -úÿÿÿúÿÿÿ -üÿÿÿüÿÿÿ -  -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   - -       -  -   -      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmok Êp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ -·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ -ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ -·ÿÿÿöÿÿÿ·ÿÿÿ -ÚÿÿÿöÿÿÿÚÿÿÿ¾ÿÿÿýÿÿÿ -¾ÿÿÿýÿÿÿ¾ÿÿÿ -¾ÿÿÿ¸ÿÿÿýÿÿÿ -¸ÿÿÿýÿÿÿ¸ÿÿÿ -¸ÿÿÿ»ÿÿÿ -»ÿÿÿ¬ÿÿÿ -¬ÿÿÿ»ÿÿÿ -»ÿÿÿ ¬ÿÿÿ -¬ÿÿÿ ¬ÿÿÿ -¬ÿÿÿ¤ÿÿÿ -¤ÿÿÿ¬ÿÿÿ -¬ÿÿÿ ¤ÿÿÿ -¤ÿÿÿ öÿÿÿ¾ÿÿÿýÿÿÿðÿÿÿ¾ÿÿÿýÿÿÿöÿÿÿ¾ÿÿÿðÿÿÿ¾ÿÿÿöÿÿÿ¸ÿÿÿýÿÿÿðÿÿÿ¸ÿÿÿýÿÿÿöÿÿÿ¸ÿÿÿðÿÿÿ¸ÿÿÿöÿÿÿ»ÿÿÿðÿÿÿ»ÿÿÿöÿÿÿ¬ÿÿÿðÿÿÿ¬ÿÿÿöÿÿÿ»ÿÿÿ ðÿÿÿ»ÿÿÿ öÿÿÿ¬ÿÿÿ ðÿÿÿ¬ÿÿÿ öÿÿÿ¬ÿÿÿðÿÿÿ¬ÿÿÿöÿÿÿ¤ÿÿÿðÿÿÿ¤ÿÿÿöÿÿÿ¬ÿÿÿ ðÿÿÿ¬ÿÿÿ öÿÿÿ¤ÿÿÿ ðÿÿÿ¤ÿÿÿ -ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -ÚÿÿÿÚÿÿÿ -êÿÿÿêÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -êÿÿÿêÿÿÿ -úÿÿÿúÿÿÿ -üÿÿÿüÿÿÿ -  -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   - -   - -  -     ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmok -Êp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ -·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ -ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ -·ÿÿÿöÿÿÿ·ÿÿÿ -ÚÿÿÿöÿÿÿÚÿÿÿ¿ÿÿÿ Áÿÿÿ ¶ÿÿÿ ¸ÿÿÿ¹ÿÿÿüÿÿÿ »ÿÿÿüÿÿÿ °ÿÿÿ ²ÿÿÿ ²ÿÿÿ ´ÿÿÿ ¦ÿÿÿ¨ÿÿÿ - ´ÿÿÿ ¶ÿÿÿ ¨ÿÿÿªÿÿÿ ¦ÿÿÿ¨ÿÿÿ - ÿÿÿ¢ÿÿÿ ¨ÿÿÿªÿÿÿ -¢ÿÿÿ¤ÿÿÿõÿÿÿÀÿÿÿÿÿÿÿñÿÿÿÀÿÿÿøÿÿÿ·ÿÿÿôÿÿÿ·ÿÿÿõÿÿÿºÿÿÿûÿÿÿñÿÿÿºÿÿÿýÿÿÿøÿÿÿ±ÿÿÿ -ôÿÿÿ±ÿÿÿ øÿÿÿ³ÿÿÿôÿÿÿ³ÿÿÿûÿÿÿ§ÿÿÿ ÷ÿÿÿ§ÿÿÿ øÿÿÿµÿÿÿ -ôÿÿÿµÿÿÿ -ûÿÿÿ©ÿÿÿ÷ÿÿÿ©ÿÿÿûÿÿÿ§ÿÿÿ÷ÿÿÿ§ÿÿÿýÿÿÿ¡ÿÿÿùÿÿÿ¡ÿÿÿûÿÿÿ©ÿÿÿ÷ÿÿÿ©ÿÿÿýÿÿÿ£ÿÿÿùÿÿÿ£ÿÿÿ -ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -ÚÿÿÿÚÿÿÿ -êÿÿÿêÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -êÿÿÿêÿÿÿ -úÿÿÿúÿÿÿ -üÿÿÿüÿÿÿ -  -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   - -       -  -   -      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmok Êp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ -·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ -ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ -·ÿÿÿöÿÿÿ·ÿÿÿ -ÚÿÿÿöÿÿÿÚÿÿÿ¿ÿÿÿ Áÿÿÿ ¶ÿÿÿ ¸ÿÿÿ¹ÿÿÿüÿÿÿ »ÿÿÿüÿÿÿ °ÿÿÿ ²ÿÿÿ ²ÿÿÿ ´ÿÿÿ ¦ÿÿÿ¨ÿÿÿ - ´ÿÿÿ ¶ÿÿÿ ¨ÿÿÿªÿÿÿ ¦ÿÿÿ¨ÿÿÿ - ÿÿÿ¢ÿÿÿ ¨ÿÿÿªÿÿÿ -¢ÿÿÿ¤ÿÿÿõÿÿÿÀÿÿÿÿÿÿÿñÿÿÿÀÿÿÿøÿÿÿ·ÿÿÿôÿÿÿ·ÿÿÿõÿÿÿºÿÿÿûÿÿÿñÿÿÿºÿÿÿýÿÿÿøÿÿÿ±ÿÿÿ -ôÿÿÿ±ÿÿÿ øÿÿÿ³ÿÿÿôÿÿÿ³ÿÿÿûÿÿÿ§ÿÿÿ ÷ÿÿÿ§ÿÿÿ øÿÿÿµÿÿÿ -ôÿÿÿµÿÿÿ -ûÿÿÿ©ÿÿÿ÷ÿÿÿ©ÿÿÿûÿÿÿ§ÿÿÿ÷ÿÿÿ§ÿÿÿýÿÿÿ¡ÿÿÿùÿÿÿ¡ÿÿÿûÿÿÿ©ÿÿÿ÷ÿÿÿ©ÿÿÿýÿÿÿ£ÿÿÿùÿÿÿ£ÿÿÿ -ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -ÚÿÿÿÚÿÿÿ -êÿÿÿêÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -êÿÿÿêÿÿÿ -úÿÿÿúÿÿÿ -üÿÿÿüÿÿÿ -  -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   - -   - -  -     ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ -·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ -ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ -·ÿÿÿöÿÿÿ·ÿÿÿ -ÚÿÿÿöÿÿÿÚÿÿÿ¾ÿÿÿþÿÿÿ ¾ÿÿÿþÿÿÿ ¾ÿÿÿ ¾ÿÿÿ¸ÿÿÿþÿÿÿ ¸ÿÿÿþÿÿÿ ¸ÿÿÿ ¸ÿÿÿ ¾ÿÿÿ ¾ÿÿÿ ¾ÿÿÿ¾ÿÿÿ ¸ÿÿÿ ¸ÿÿÿ ¸ÿÿÿ¸ÿÿÿ ½ÿÿÿ½ÿÿÿ -½ÿÿÿ&½ÿÿÿ& ¹ÿÿÿ¹ÿÿÿ -¹ÿÿÿ&¹ÿÿÿ&õÿÿÿ¾ÿÿÿýÿÿÿñÿÿÿ¾ÿÿÿÿÿÿÿøÿÿÿ¾ÿÿÿôÿÿÿ¾ÿÿÿõÿÿÿ¸ÿÿÿýÿÿÿñÿÿÿ¸ÿÿÿÿÿÿÿøÿÿÿ¸ÿÿÿôÿÿÿ¸ÿÿÿøÿÿÿ¾ÿÿÿôÿÿÿ¾ÿÿÿûÿÿÿ¾ÿÿÿ÷ÿÿÿ¾ÿÿÿ øÿÿÿ¸ÿÿÿôÿÿÿ¸ÿÿÿûÿÿÿ¸ÿÿÿ÷ÿÿÿ¸ÿÿÿ ûÿÿÿ½ÿÿÿ÷ÿÿÿ½ÿÿÿ ýÿÿÿ½ÿÿÿ%ùÿÿÿ½ÿÿÿ'ûÿÿÿ¹ÿÿÿ÷ÿÿÿ¹ÿÿÿ ýÿÿÿ¹ÿÿÿ%ùÿÿÿ¹ÿÿÿ' -ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -ÚÿÿÿÚÿÿÿ -êÿÿÿêÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -êÿÿÿêÿÿÿ -úÿÿÿúÿÿÿ -üÿÿÿüÿÿÿ -  -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   - -       -  -   -      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ -·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ -ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ -·ÿÿÿöÿÿÿ·ÿÿÿ -ÚÿÿÿöÿÿÿÚÿÿÿ¾ÿÿÿþÿÿÿ ¾ÿÿÿþÿÿÿ ¾ÿÿÿ ¾ÿÿÿ¸ÿÿÿþÿÿÿ ¸ÿÿÿþÿÿÿ ¸ÿÿÿ ¸ÿÿÿ ¾ÿÿÿ ¾ÿÿÿ ¾ÿÿÿ¾ÿÿÿ ¸ÿÿÿ ¸ÿÿÿ ¸ÿÿÿ¸ÿÿÿ ½ÿÿÿ½ÿÿÿ -½ÿÿÿ&½ÿÿÿ& ¹ÿÿÿ¹ÿÿÿ -¹ÿÿÿ&¹ÿÿÿ&õÿÿÿ¾ÿÿÿýÿÿÿñÿÿÿ¾ÿÿÿÿÿÿÿøÿÿÿ¾ÿÿÿôÿÿÿ¾ÿÿÿõÿÿÿ¸ÿÿÿýÿÿÿñÿÿÿ¸ÿÿÿÿÿÿÿøÿÿÿ¸ÿÿÿôÿÿÿ¸ÿÿÿøÿÿÿ¾ÿÿÿôÿÿÿ¾ÿÿÿûÿÿÿ¾ÿÿÿ÷ÿÿÿ¾ÿÿÿ øÿÿÿ¸ÿÿÿôÿÿÿ¸ÿÿÿûÿÿÿ¸ÿÿÿ÷ÿÿÿ¸ÿÿÿ ûÿÿÿ½ÿÿÿ÷ÿÿÿ½ÿÿÿ ýÿÿÿ½ÿÿÿ%ùÿÿÿ½ÿÿÿ'ûÿÿÿ¹ÿÿÿ÷ÿÿÿ¹ÿÿÿ ýÿÿÿ¹ÿÿÿ%ùÿÿÿ¹ÿÿÿ' -ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -ÚÿÿÿÚÿÿÿ -êÿÿÿêÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -êÿÿÿêÿÿÿ -úÿÿÿúÿÿÿ -üÿÿÿüÿÿÿ -  -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   - -   - -  -     ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmok Êp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ -·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ -ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ -·ÿÿÿöÿÿÿ·ÿÿÿ -ÚÿÿÿöÿÿÿÚÿÿÿ¿ÿÿÿ Áÿÿÿ ¯ÿÿÿ ±ÿÿÿ »ÿÿÿüÿÿÿ ½ÿÿÿüÿÿÿ «ÿÿÿ ­ÿÿÿ «ÿÿÿ ­ÿÿÿ ¢ÿÿÿüÿÿÿ¤ÿÿÿþÿÿÿ ¯ÿÿÿ ±ÿÿÿ ¦ÿÿÿøÿÿÿ¨ÿÿÿúÿÿÿ £ÿÿÿüÿÿÿ¥ÿÿÿþÿÿÿ -žÿÿÿöÿÿÿ ÿÿÿøÿÿÿ ¥ÿÿÿøÿÿÿ§ÿÿÿúÿÿÿ - ÿÿÿòÿÿÿ¢ÿÿÿôÿÿÿõÿÿÿÀÿÿÿñÿÿÿÀÿÿÿøÿÿÿ°ÿÿÿôÿÿÿ°ÿÿÿ -õÿÿÿ¼ÿÿÿûÿÿÿñÿÿÿ¼ÿÿÿýÿÿÿøÿÿÿ¬ÿÿÿôÿÿÿ¬ÿÿÿøÿÿÿ¬ÿÿÿôÿÿÿ¬ÿÿÿûÿÿÿ£ÿÿÿýÿÿÿ÷ÿÿÿ£ÿÿÿýÿÿÿøÿÿÿ°ÿÿÿôÿÿÿ°ÿÿÿûÿÿÿ§ÿÿÿùÿÿÿ÷ÿÿÿ§ÿÿÿùÿÿÿûÿÿÿ¤ÿÿÿýÿÿÿ÷ÿÿÿ¤ÿÿÿýÿÿÿýÿÿÿŸÿÿÿ÷ÿÿÿùÿÿÿŸÿÿÿ÷ÿÿÿûÿÿÿ¦ÿÿÿùÿÿÿ÷ÿÿÿ¦ÿÿÿùÿÿÿýÿÿÿ¡ÿÿÿóÿÿÿùÿÿÿ¡ÿÿÿóÿÿÿ -ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -ÚÿÿÿÚÿÿÿ -êÿÿÿêÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -êÿÿÿêÿÿÿ -úÿÿÿúÿÿÿ -üÿÿÿüÿÿÿ -  -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   - -       -  -   -      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmok Êp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ -·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ -ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ -·ÿÿÿöÿÿÿ·ÿÿÿ -ÚÿÿÿöÿÿÿÚÿÿÿ¿ÿÿÿ Áÿÿÿ ¯ÿÿÿ ±ÿÿÿ »ÿÿÿüÿÿÿ ½ÿÿÿüÿÿÿ «ÿÿÿ ­ÿÿÿ «ÿÿÿ ­ÿÿÿ ¢ÿÿÿüÿÿÿ¤ÿÿÿþÿÿÿ ¯ÿÿÿ ±ÿÿÿ ¦ÿÿÿøÿÿÿ¨ÿÿÿúÿÿÿ £ÿÿÿüÿÿÿ¥ÿÿÿþÿÿÿ -žÿÿÿöÿÿÿ ÿÿÿøÿÿÿ ¥ÿÿÿøÿÿÿ§ÿÿÿúÿÿÿ - ÿÿÿòÿÿÿ¢ÿÿÿôÿÿÿõÿÿÿÀÿÿÿñÿÿÿÀÿÿÿøÿÿÿ°ÿÿÿôÿÿÿ°ÿÿÿ -õÿÿÿ¼ÿÿÿûÿÿÿñÿÿÿ¼ÿÿÿýÿÿÿøÿÿÿ¬ÿÿÿôÿÿÿ¬ÿÿÿøÿÿÿ¬ÿÿÿôÿÿÿ¬ÿÿÿûÿÿÿ£ÿÿÿýÿÿÿ÷ÿÿÿ£ÿÿÿýÿÿÿøÿÿÿ°ÿÿÿôÿÿÿ°ÿÿÿûÿÿÿ§ÿÿÿùÿÿÿ÷ÿÿÿ§ÿÿÿùÿÿÿûÿÿÿ¤ÿÿÿýÿÿÿ÷ÿÿÿ¤ÿÿÿýÿÿÿýÿÿÿŸÿÿÿ÷ÿÿÿùÿÿÿŸÿÿÿ÷ÿÿÿûÿÿÿ¦ÿÿÿùÿÿÿ÷ÿÿÿ¦ÿÿÿùÿÿÿýÿÿÿ¡ÿÿÿóÿÿÿùÿÿÿ¡ÿÿÿóÿÿÿ -ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -ÚÿÿÿÚÿÿÿ -êÿÿÿêÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -êÿÿÿêÿÿÿ -úÿÿÿúÿÿÿ -üÿÿÿüÿÿÿ -  -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   - -   - -  -     ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÎ -;€öÿÿÿýÿÿÿ÷ÿÿÿÿÿÿÿ÷ÿÿÿ÷ÿÿÿ÷ÿÿÿÿÿÿÿ÷ÿÿÿýÿÿÿ÷ÿÿÿýÿÿÿÿÿÿÿ÷ÿÿÿÿÿÿÿýÿÿÿ÷ÿÿÿüÿÿÿùÿÿÿùÿÿÿùÿÿÿùÿÿÿüÿÿÿùÿÿÿùÿÿÿùÿÿÿûÿÿÿüÿÿÿùÿÿÿùÿÿÿùÿÿÿûÿÿÿùÿÿÿýÿÿÿýÿÿÿýÿÿÿýÿÿÿýÿÿÿýÿÿÿøÿÿÿýÿÿÿøÿÿÿýÿÿÿýÿÿÿýÿÿÿøÿÿÿýÿÿÿøÿÿÿýÿÿÿ - -ùÿÿÿöÿÿÿùÿÿÿùÿÿÿöÿÿÿùÿÿÿýÿÿÿøÿÿÿøÿÿÿýÿÿÿýÿÿÿøÿÿÿøÿÿÿýÿÿÿüÿÿÿùÿÿÿûÿÿÿüÿÿÿùÿÿÿûÿÿÿ ÿÿÿÿ ýÿÿÿ ýÿÿÿÿÿÿÿ ÿÿÿÿýÿÿÿ ýÿÿÿ ÿÿÿÿ  -   - - -         - - -             !!!""###$$$%%%& && ' '' ( !((!)!))""#**#+#$++$,$%,,%-%&--&.&'..'/'(//(0()00)1)"11"**+22+3+,33,4,-44-5-.55.6./66/7/077080188191*99*223::3:34::4:45::5:56::6:67::7:78::8:89::9:92::2:Êp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ -·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ -ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ -·ÿÿÿöÿÿÿ·ÿÿÿ -ÚÿÿÿöÿÿÿÚÿÿÿ»ÿÿÿûÿÿÿ ½ÿÿÿýÿÿÿÈÿÿÿÊÿÿÿ -µÿÿÿÿÿÿÿ ·ÿÿÿÂÿÿÿ ÄÿÿÿÈÿÿÿ Êÿÿÿ ÐÿÿÿÒÿÿÿÂÿÿÿ Äÿÿÿ ÊÿÿÿÌÿÿÿÐÿÿÿÐÿÿÿÎÿÿÿ Îÿÿÿ"ÌÿÿÿÌÿÿÿÊÿÿÿÊÿÿÿ öÿÿÿ¸ÿÿÿÿÿÿÿòÿÿÿ¸ÿÿÿóÿÿÿÇÿÿÿöÿÿÿïÿÿÿÇÿÿÿøÿÿÿöÿÿÿºÿÿÿòÿÿÿºÿÿÿóÿÿÿÉÿÿÿúÿÿÿïÿÿÿÉÿÿÿüÿÿÿóÿÿÿÇÿÿÿöÿÿÿïÿÿÿÇÿÿÿøÿÿÿñÿÿÿÔÿÿÿïÿÿÿíÿÿÿÔÿÿÿñÿÿÿóÿÿÿÉÿÿÿúÿÿÿïÿÿÿÉÿÿÿüÿÿÿñÿÿÿÖÿÿÿóÿÿÿíÿÿÿÖÿÿÿõÿÿÿñÿÿÿÔÿÿÿðÿÿÿíÿÿÿÔÿÿÿòÿÿÿðÿÿÿÛÿÿÿíÿÿÿìÿÿÿÛÿÿÿïÿÿÿñÿÿÿÖÿÿÿòÿÿÿíÿÿÿÖÿÿÿôÿÿÿðÿÿÿÝÿÿÿïÿÿÿìÿÿÿÝÿÿÿñÿÿÿ ØÿÿÿýÿÿÿØÿÿÿÿÿÿÿäÿÿÿòÿÿÿäÿÿÿôÿÿÿ ÜÿÿÿÜÿÿÿèÿÿÿöÿÿÿèÿÿÿøÿÿÿäÿÿÿòÿÿÿäÿÿÿôÿÿÿðÿÿÿçÿÿÿðÿÿÿéÿÿÿèÿÿÿöÿÿÿèÿÿÿøÿÿÿôÿÿÿëÿÿÿôÿÿÿíÿÿÿõÿÿÿãÿÿÿõÿÿÿãÿÿÿîÿÿÿÿÿÿÿîÿÿÿïÿÿÿçÿÿÿïÿÿÿçÿÿÿúÿÿÿòÿÿÿÿÿÿÿúÿÿÿòÿÿÿýÿÿÿÜÿÿÿýÿÿÿ÷ÿÿÿÞÿÿÿÿÿÿÿÿÿÿÿèÿÿÿ ùÿÿÿêÿÿÿ ýÿÿÿÖÿÿÿ÷ÿÿÿØÿÿÿÿÿÿÿâÿÿÿ ùÿÿÿäÿÿÿÿÿÿÿçÿÿÿùÿÿÿéÿÿÿ -÷ÿÿÿ ûÿÿÿùÿÿÿÿÿÿÿãÿÿÿùÿÿÿåÿÿÿóÿÿÿûÿÿÿõÿÿÿýÿÿÿûÿÿÿýÿÿÿøÿÿÿýÿÿÿøÿÿÿ ÷ÿÿÿ ûÿÿÿ÷ÿÿÿòÿÿÿýÿÿÿòÿÿÿ  - -       -  -   -      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ -·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ -ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ -·ÿÿÿöÿÿÿ·ÿÿÿ -ÚÿÿÿöÿÿÿÚÿÿÿ»ÿÿÿûÿÿÿ ½ÿÿÿýÿÿÿÈÿÿÿÊÿÿÿ -µÿÿÿÿÿÿÿ ·ÿÿÿÂÿÿÿ ÄÿÿÿÈÿÿÿ Êÿÿÿ ÐÿÿÿÒÿÿÿÂÿÿÿ Äÿÿÿ ÊÿÿÿÌÿÿÿÐÿÿÿÐÿÿÿÎÿÿÿ Îÿÿÿ"ÌÿÿÿÌÿÿÿÊÿÿÿÊÿÿÿ öÿÿÿ¸ÿÿÿÿÿÿÿòÿÿÿ¸ÿÿÿóÿÿÿÇÿÿÿöÿÿÿïÿÿÿÇÿÿÿøÿÿÿöÿÿÿºÿÿÿòÿÿÿºÿÿÿóÿÿÿÉÿÿÿúÿÿÿïÿÿÿÉÿÿÿüÿÿÿóÿÿÿÇÿÿÿöÿÿÿïÿÿÿÇÿÿÿøÿÿÿñÿÿÿÔÿÿÿïÿÿÿíÿÿÿÔÿÿÿñÿÿÿóÿÿÿÉÿÿÿúÿÿÿïÿÿÿÉÿÿÿüÿÿÿñÿÿÿÖÿÿÿóÿÿÿíÿÿÿÖÿÿÿõÿÿÿñÿÿÿÔÿÿÿðÿÿÿíÿÿÿÔÿÿÿòÿÿÿðÿÿÿÛÿÿÿíÿÿÿìÿÿÿÛÿÿÿïÿÿÿñÿÿÿÖÿÿÿòÿÿÿíÿÿÿÖÿÿÿôÿÿÿðÿÿÿÝÿÿÿïÿÿÿìÿÿÿÝÿÿÿñÿÿÿ ØÿÿÿýÿÿÿØÿÿÿÿÿÿÿäÿÿÿòÿÿÿäÿÿÿôÿÿÿ ÜÿÿÿÜÿÿÿèÿÿÿöÿÿÿèÿÿÿøÿÿÿäÿÿÿòÿÿÿäÿÿÿôÿÿÿðÿÿÿçÿÿÿðÿÿÿéÿÿÿèÿÿÿöÿÿÿèÿÿÿøÿÿÿôÿÿÿëÿÿÿôÿÿÿíÿÿÿõÿÿÿãÿÿÿõÿÿÿãÿÿÿîÿÿÿÿÿÿÿîÿÿÿïÿÿÿçÿÿÿïÿÿÿçÿÿÿúÿÿÿòÿÿÿÿÿÿÿúÿÿÿòÿÿÿýÿÿÿÜÿÿÿýÿÿÿ÷ÿÿÿÞÿÿÿÿÿÿÿÿÿÿÿèÿÿÿ ùÿÿÿêÿÿÿ ýÿÿÿÖÿÿÿ÷ÿÿÿØÿÿÿÿÿÿÿâÿÿÿ ùÿÿÿäÿÿÿÿÿÿÿçÿÿÿùÿÿÿéÿÿÿ -÷ÿÿÿ ûÿÿÿùÿÿÿÿÿÿÿãÿÿÿùÿÿÿåÿÿÿóÿÿÿûÿÿÿõÿÿÿýÿÿÿûÿÿÿýÿÿÿøÿÿÿýÿÿÿøÿÿÿ ÷ÿÿÿ ûÿÿÿ÷ÿÿÿòÿÿÿýÿÿÿòÿÿÿ  - -   - -  -     ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ -·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ -ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ -·ÿÿÿöÿÿÿ·ÿÿÿ -ÚÿÿÿöÿÿÿÚÿÿÿ»ÿÿÿûÿÿÿ ½ÿÿÿýÿÿÿÈÿÿÿÊÿÿÿ -µÿÿÿÿÿÿÿ ·ÿÿÿÂÿÿÿ ÄÿÿÿÈÿÿÿ Êÿÿÿ ÐÿÿÿÒÿÿÿÂÿÿÿ Äÿÿÿ ÊÿÿÿÌÿÿÿÐÿÿÿÐÿÿÿÎÿÿÿ Îÿÿÿ"ÌÿÿÿÌÿÿÿÊÿÿÿÊÿÿÿ öÿÿÿ»ÿÿÿýÿÿÿòÿÿÿ»ÿÿÿýÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿöÿÿÿ·ÿÿÿòÿÿÿ·ÿÿÿóÿÿÿÆÿÿÿ -ïÿÿÿÆÿÿÿ -óÿÿÿËÿÿÿïÿÿÿËÿÿÿñÿÿÿÓÿÿÿíÿÿÿÓÿÿÿóÿÿÿÅÿÿÿ ïÿÿÿÅÿÿÿ ñÿÿÿÍÿÿÿíÿÿÿÍÿÿÿñÿÿÿÒÿÿÿíÿÿÿÒÿÿÿðÿÿÿÖÿÿÿìÿÿÿÖÿÿÿñÿÿÿÎÿÿÿíÿÿÿÎÿÿÿðÿÿÿÒÿÿÿìÿÿÿÒÿÿÿ ÝÿÿÿþÿÿÿÝÿÿÿþÿÿÿéÿÿÿ -éÿÿÿ - ×ÿÿÿ×ÿÿÿãÿÿÿãÿÿÿèÿÿÿ èÿÿÿ øÿÿÿøÿÿÿäÿÿÿäÿÿÿôÿÿÿôÿÿÿüÿÿÿþÿÿÿ÷ÿÿÿÿÿÿÿùÿÿÿöÿÿÿ øÿÿÿ ñÿÿÿÿÿÿÿóÿÿÿýÿÿÿ×ÿÿÿþÿÿÿ÷ÿÿÿÙÿÿÿþÿÿÿÿÿÿÿãÿÿÿóÿÿÿùÿÿÿåÿÿÿóÿÿÿýÿÿÿÛÿÿÿ÷ÿÿÿÝÿÿÿÿÿÿÿçÿÿÿ÷ÿÿÿùÿÿÿéÿÿÿ÷ÿÿÿÿÿÿÿãÿÿÿóÿÿÿùÿÿÿåÿÿÿóÿÿÿïÿÿÿèÿÿÿûÿÿÿñÿÿÿèÿÿÿÿÿÿÿçÿÿÿ÷ÿÿÿùÿÿÿéÿÿÿ÷ÿÿÿóÿÿÿìÿÿÿûÿÿÿõÿÿÿìÿÿÿôÿÿÿâÿÿÿûÿÿÿöÿÿÿäÿÿÿÿÿÿÿíÿÿÿýÿÿÿïÿÿÿîÿÿÿæÿÿÿûÿÿÿðÿÿÿèÿÿÿùÿÿÿñÿÿÿýÿÿÿûÿÿÿóÿÿÿ  - -       -  -   -      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ -·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ -ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ -·ÿÿÿöÿÿÿ·ÿÿÿ -ÚÿÿÿöÿÿÿÚÿÿÿ»ÿÿÿûÿÿÿ ½ÿÿÿýÿÿÿÈÿÿÿÊÿÿÿ -µÿÿÿÿÿÿÿ ·ÿÿÿÂÿÿÿ ÄÿÿÿÈÿÿÿ Êÿÿÿ ÐÿÿÿÒÿÿÿÂÿÿÿ Äÿÿÿ ÊÿÿÿÌÿÿÿÐÿÿÿÐÿÿÿÎÿÿÿ Îÿÿÿ"ÌÿÿÿÌÿÿÿÊÿÿÿÊÿÿÿ öÿÿÿ»ÿÿÿýÿÿÿòÿÿÿ»ÿÿÿýÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿöÿÿÿ·ÿÿÿòÿÿÿ·ÿÿÿóÿÿÿÆÿÿÿ -ïÿÿÿÆÿÿÿ -óÿÿÿËÿÿÿïÿÿÿËÿÿÿñÿÿÿÓÿÿÿíÿÿÿÓÿÿÿóÿÿÿÅÿÿÿ ïÿÿÿÅÿÿÿ ñÿÿÿÍÿÿÿíÿÿÿÍÿÿÿñÿÿÿÒÿÿÿíÿÿÿÒÿÿÿðÿÿÿÖÿÿÿìÿÿÿÖÿÿÿñÿÿÿÎÿÿÿíÿÿÿÎÿÿÿðÿÿÿÒÿÿÿìÿÿÿÒÿÿÿ ÝÿÿÿþÿÿÿÝÿÿÿþÿÿÿéÿÿÿ -éÿÿÿ - ×ÿÿÿ×ÿÿÿãÿÿÿãÿÿÿèÿÿÿ èÿÿÿ øÿÿÿøÿÿÿäÿÿÿäÿÿÿôÿÿÿôÿÿÿüÿÿÿþÿÿÿ÷ÿÿÿÿÿÿÿùÿÿÿöÿÿÿ øÿÿÿ ñÿÿÿÿÿÿÿóÿÿÿýÿÿÿ×ÿÿÿþÿÿÿ÷ÿÿÿÙÿÿÿþÿÿÿÿÿÿÿãÿÿÿóÿÿÿùÿÿÿåÿÿÿóÿÿÿýÿÿÿÛÿÿÿ÷ÿÿÿÝÿÿÿÿÿÿÿçÿÿÿ÷ÿÿÿùÿÿÿéÿÿÿ÷ÿÿÿÿÿÿÿãÿÿÿóÿÿÿùÿÿÿåÿÿÿóÿÿÿïÿÿÿèÿÿÿûÿÿÿñÿÿÿèÿÿÿÿÿÿÿçÿÿÿ÷ÿÿÿùÿÿÿéÿÿÿ÷ÿÿÿóÿÿÿìÿÿÿûÿÿÿõÿÿÿìÿÿÿôÿÿÿâÿÿÿûÿÿÿöÿÿÿäÿÿÿÿÿÿÿíÿÿÿýÿÿÿïÿÿÿîÿÿÿæÿÿÿûÿÿÿðÿÿÿèÿÿÿùÿÿÿñÿÿÿýÿÿÿûÿÿÿóÿÿÿ  - -   - -  -     ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ -·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ -ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ -·ÿÿÿöÿÿÿ·ÿÿÿ -ÚÿÿÿöÿÿÿÚÿÿÿ»ÿÿÿûÿÿÿ ½ÿÿÿýÿÿÿÈÿÿÿÊÿÿÿ -µÿÿÿÿÿÿÿ ·ÿÿÿÂÿÿÿ ÄÿÿÿÈÿÿÿ Êÿÿÿ ÐÿÿÿÒÿÿÿÂÿÿÿ Äÿÿÿ ÊÿÿÿÌÿÿÿÎÿÿÿÐÿÿÿÕÿÿÿ×ÿÿÿÌÿÿÿÎÿÿÿÓÿÿÿÕÿÿÿöÿÿÿ¹ÿÿÿýÿÿÿòÿÿÿ¹ÿÿÿýÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿöÿÿÿ¹ÿÿÿòÿÿÿ¹ÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿñÿÿÿÙÿÿÿýÿÿÿíÿÿÿÙÿÿÿýÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿñÿÿÿÙÿÿÿþÿÿÿíÿÿÿÙÿÿÿþÿÿÿðÿÿÿáÿÿÿþÿÿÿìÿÿÿáÿÿÿþÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿðÿÿÿáÿÿÿìÿÿÿáÿÿÿ -ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -ÚÿÿÿÚÿÿÿ -êÿÿÿêÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -êÿÿÿêÿÿÿ -úÿÿÿúÿÿÿ -üÿÿÿüÿÿÿ -  -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   - -       -  -   -      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ -·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ -ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ -·ÿÿÿöÿÿÿ·ÿÿÿ -ÚÿÿÿöÿÿÿÚÿÿÿ»ÿÿÿûÿÿÿ ½ÿÿÿýÿÿÿÈÿÿÿÊÿÿÿ -µÿÿÿÿÿÿÿ ·ÿÿÿÂÿÿÿ ÄÿÿÿÈÿÿÿ Êÿÿÿ ÐÿÿÿÒÿÿÿÂÿÿÿ Äÿÿÿ ÊÿÿÿÌÿÿÿÎÿÿÿÐÿÿÿÕÿÿÿ×ÿÿÿÌÿÿÿÎÿÿÿÓÿÿÿÕÿÿÿöÿÿÿ¹ÿÿÿýÿÿÿòÿÿÿ¹ÿÿÿýÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿöÿÿÿ¹ÿÿÿòÿÿÿ¹ÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿñÿÿÿÙÿÿÿýÿÿÿíÿÿÿÙÿÿÿýÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿñÿÿÿÙÿÿÿþÿÿÿíÿÿÿÙÿÿÿþÿÿÿðÿÿÿáÿÿÿþÿÿÿìÿÿÿáÿÿÿþÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿðÿÿÿáÿÿÿìÿÿÿáÿÿÿ -ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -ÚÿÿÿÚÿÿÿ -êÿÿÿêÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -êÿÿÿêÿÿÿ -úÿÿÿúÿÿÿ -üÿÿÿüÿÿÿ -  -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   - -   - -  -     ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ -·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ -ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ -·ÿÿÿöÿÿÿ·ÿÿÿ -ÚÿÿÿöÿÿÿÚÿÿÿ»ÿÿÿûÿÿÿ ½ÿÿÿýÿÿÿÈÿÿÿÊÿÿÿ -µÿÿÿÿÿÿÿ ·ÿÿÿÂÿÿÿ ÄÿÿÿÈÿÿÿ Êÿÿÿ ÐÿÿÿÒÿÿÿÂÿÿÿ Äÿÿÿ ÊÿÿÿÌÿÿÿÐÿÿÿÐÿÿÿÎÿÿÿ Îÿÿÿ"ÌÿÿÿÌÿÿÿÊÿÿÿÊÿÿÿ öÿÿÿ¹ÿÿÿýÿÿÿòÿÿÿ¹ÿÿÿýÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿöÿÿÿ¹ÿÿÿòÿÿÿ¹ÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿñÿÿÿÙÿÿÿýÿÿÿíÿÿÿÙÿÿÿýÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿñÿÿÿÙÿÿÿþÿÿÿíÿÿÿÙÿÿÿþÿÿÿðÿÿÿáÿÿÿþÿÿÿìÿÿÿáÿÿÿþÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿðÿÿÿáÿÿÿìÿÿÿáÿÿÿ -ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -ÚÿÿÿÚÿÿÿ -êÿÿÿêÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -êÿÿÿêÿÿÿ -úÿÿÿúÿÿÿ -üÿÿÿüÿÿÿ -  -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   - -       -  -   -      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ -·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ -ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ -·ÿÿÿöÿÿÿ·ÿÿÿ -ÚÿÿÿöÿÿÿÚÿÿÿ»ÿÿÿûÿÿÿ ½ÿÿÿýÿÿÿÈÿÿÿÊÿÿÿ -µÿÿÿÿÿÿÿ ·ÿÿÿÂÿÿÿ ÄÿÿÿÈÿÿÿ Êÿÿÿ ÐÿÿÿÒÿÿÿÂÿÿÿ Äÿÿÿ ÊÿÿÿÌÿÿÿÐÿÿÿÐÿÿÿÎÿÿÿ Îÿÿÿ"ÌÿÿÿÌÿÿÿÊÿÿÿÊÿÿÿ öÿÿÿ¹ÿÿÿýÿÿÿòÿÿÿ¹ÿÿÿýÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿöÿÿÿ¹ÿÿÿòÿÿÿ¹ÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿñÿÿÿÙÿÿÿýÿÿÿíÿÿÿÙÿÿÿýÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿñÿÿÿÙÿÿÿþÿÿÿíÿÿÿÙÿÿÿþÿÿÿðÿÿÿáÿÿÿþÿÿÿìÿÿÿáÿÿÿþÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿðÿÿÿáÿÿÿìÿÿÿáÿÿÿ -ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -ÚÿÿÿÚÿÿÿ -êÿÿÿêÿÿÿ -êÿÿÿüÿÿÿêÿÿÿüÿÿÿ -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -êÿÿÿêÿÿÿ -úÿÿÿúÿÿÿ -üÿÿÿüÿÿÿ -  -úÿÿÿüÿÿÿúÿÿÿüÿÿÿ -úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   - -   - -  -     ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmok \ No newline at end of file diff --git a/Apps/KeepAway/KeepAway.HC b/Apps/KeepAway/KeepAway.HC new file mode 100644 index 0000000..386f676 --- /dev/null +++ b/Apps/KeepAway/KeepAway.HC @@ -0,0 +1,1175 @@ +//The ball and men were generated +//with $LK,"::/Apps/GrModels/Run.HC"$. +//They were cut-and-pasted here. + +$BG,14$ + $SP,"<1>",BI=1$ + + + + + + $SP,"<2>",BI=2$ + + + + + + + $SP,"<3>",BI=3$ + + + + + + + $SP,"<4>",BI=4$ + + + + + + + $SP,"<5>",BI=5$ + + + + + + + $SP,"<6>",BI=6$ + + + + + + + $SP,"<7>",BI=7$ + + + + + + + $SP,"<8>",BI=8$ + + + + + + + $SP,"<9>",BI=9$ + + + + + + + $SP,"<10>",BI=10$ + + + + + + + $SP,"<11>",BI=11$ + + + + + + + $SP,"<12>",BI=12$ + + + + + + $SP,"<13>",BI=13$ + + + + + + + $SP,"<14>",BI=14$ + + + + + + $SP,"<15>",BI=15$ + + + + + + $SP,"<16>",BI=16$ + + + + + + + $SP,"<17>",BI=17$ + + + + + + + $SP,"<18>",BI=18$ + + + + + + + $SP,"<19>",BI=19$ + + + + + + + $SP,"<20>",BI=20$ + + + + + + + $SP,"<21>",BI=21$ + + + + + + + $SP,"<22>",BI=22$ + + + + + + + $SP,"<23>",BI=23$ + + + +$BG$class Frame +{ + U8 *img[2]; + F64 dt; +}; + +#define COURT_BORDER 10 +#define COLLISION_DAMP 0.8 + +/* Viscosity is way bigger than +real air viscosity. In reality +air is approximated by V and V$SY,-3$2$SY,0$ +terms and is smaller. However, I use +this to produce a rolling friction +value, too. If you want to see my +best attempt at realistic physics +download SimStructure. + +http://www.templeos.org/files/SimStrSetUp.zip + +This is just a video game. Relax. +*/ +#define AIR_VISCOSITY 0.1 + +#define GRAVITY_ACCELERATION 500 +#define SHOT_VELOCITY 400 +#define DRIBBLE_T 0.25 +#define MAN_VELOCITY 150 +#define MAN_SQR_RADIUS (20*20) +#define FOUL_VELOCITY_THRESHOLD 50 +#define JUMP_VELOCITY 250 +#define ROLL_VELOCITY_THRESHOLD 100 +#define RANDOM_MAN_ACCELERATION 30 + +#define HEAD_Z_OFFSET 200 +#define HAND_X_OFFSET 30 +#define HAND_Y_OFFSET 20 +#define HAND_SQR_OFFSET \ + (HAND_X_OFFSET*HAND_X_OFFSET+HAND_Y_OFFSET*HAND_Y_OFFSET) +#define HAND_Z_OFFSET 110 + +#define FIRST_STANDING 0 + +#define NUM_RUNNING_IMGS 4 +#define FIRST_RUNNING 0 +#define LAST_RUNNING (FIRST_RUNNING+NUM_RUNNING_IMGS-1) + +#define NUM_SHOOTING_IMGS 5 +#define FIRST_SHOOTING (LAST_RUNNING+1) +#define LAST_SHOOTING (FIRST_SHOOTING+NUM_SHOOTING_IMGS-1) + +#define NUM_DRIBBLING_IMGS 4 +#define FIRST_DRIBBLING (LAST_SHOOTING+1) +#define LAST_DRIBBLING (FIRST_DRIBBLING+NUM_DRIBBLING_IMGS-1) + +#define NUM_STOPPED_DRIBBLING_IMGS 2 +#define FIRST_STOPPED_DRIBBLING (LAST_DRIBBLING+1) +#define LAST_STOPPED_DRIBBLING \ + (FIRST_STOPPED_DRIBBLING+NUM_STOPPED_DRIBBLING_IMGS-1) + +Frame imgs[LAST_STOPPED_DRIBBLING+1]={ + {{$IB,"<6>",BI=6$,$IB,"<7>",BI=7$},2*DRIBBLE_T/NUM_RUNNING_IMGS}, + {{$IB,"<2>",BI=2$,$IB,"<3>",BI=3$},2*DRIBBLE_T/NUM_RUNNING_IMGS}, + {{$IB,"<6>",BI=6$,$IB,"<7>",BI=7$},2*DRIBBLE_T/NUM_RUNNING_IMGS}, + {{$IB,"<4>",BI=4$,$IB,"<5>",BI=5$},2*DRIBBLE_T/NUM_RUNNING_IMGS}, + {{$IB,"<8>",BI=8$,$IB,"<9>",BI=9$},0.1},{{$IB,"<10>",BI=10$,$IB,"<11>",BI=11$},0.2}, + {{$IB,"<12>",BI=12$,$IB,"<13>",BI=13$},0.2},{{$IB,"<12>",BI=12$,$IB,"<13>",BI=13$},0.1},{{$IB,"<14>",BI=14$,$IB,"<15>",BI=15$},0.1}, + {{$IB,"<20>",BI=20$,$IB,"<21>",BI=21$},2*DRIBBLE_T/NUM_DRIBBLING_IMGS}, + {{$IB,"<16>",BI=16$,$IB,"<17>",BI=17$},2*DRIBBLE_T/NUM_DRIBBLING_IMGS}, + {{$IB,"<20>",BI=20$,$IB,"<21>",BI=21$},2*DRIBBLE_T/NUM_DRIBBLING_IMGS}, + {{$IB,"<18>",BI=18$,$IB,"<19>",BI=19$},2*DRIBBLE_T/NUM_DRIBBLING_IMGS}, + {{$IB,"<20>",BI=20$,$IB,"<21>",BI=21$},DRIBBLE_T/NUM_STOPPED_DRIBBLING_IMGS}, + {{$IB,"<22>",BI=22$,$IB,"<23>",BI=23$},DRIBBLE_T/NUM_STOPPED_DRIBBLING_IMGS}, +}; + +RegSetDftEntry("TempleOS/KeepAway","I64 best_score0=0,best_score1=9999;\n"); +RegExeBranch("TempleOS/KeepAway"); + +F64 game_t_end,foul_t_end; +I64 score0,score1; + +#define NUM_PER_SIDE 3 +#define NUM_OBJS (NUM_PER_SIDE*2+1) +Bool someone_shooting,someone_has_ball; +F64 shot_land_t; + +class Obj +{ + I64 team; //-1 is ball + F64 x,y,z,DxDt,DyDt,DzDt,é,radius,stolen_t0; + F64 get_ball_dt,get_ball_é,nearest_man_dd,last_t0,next_t0,foul_t0; + I64 last_img,next_img; + Bool stopped,shooting,has_ball,nearest_ball,pad[4]; +} objs[NUM_OBJS],*ball,*human,*last_owner; + +/*Just to be different, I didn't use the built-in +DCF_TRANSFORMATION flag in this game. +Instead, I chose a 45 degree angle +between Y and Z as the view point. +If I had used the transform, I would +have to make all my men taller. +This is a little simpler, and faster, +but adds lots of factor 2 vals. + +I also didn't use the $LK,"CMathODE",A="MN:CMathODE"$ feat, +just to be different. +*/ + +U0 DrawObj(CDC *dc,Obj *o,F64 tt) +{ + U8 *temps; + F64 r1=Max(9-0.1*o->z,1),r2=Max(r1/4,1); + + if (o==human) + dc->color=LTRED; + else + dc->color=BLACK; + GrEllipse(dc,o->x,o->y/2,r1,r2); + GrFloodFill(dc,o->x,o->y/2); + + if (o==ball) + Sprite3(dc,o->x,(o->y-o->z)/2,GR_Z_ALL-o->y,$IB,"<1>",BI=1$); + else { + temps=SpriteInterpolate((tt-o->last_t0)/(o->next_t0-o->last_t0), + imgs[o->last_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->é); + Free(temps); + } +} + +I64 ObjCompare(Obj *o1,Obj *o2) +{ + return o1->y-o2->y; +} + +U0 DrawIt(CTask *task,CDC *dc) +{ + F64 tt=tS,d,d_down,d_up; + I64 i; + Obj *o_sort[NUM_OBJS],*o; + + DCDepthBufAlloc(dc); + dc->ls.x=10000; + dc->ls.y=60000; + dc->ls.z=10000; + d=65535/D3I32Norm(&dc->ls); + dc->ls.x*=d; + dc->ls.y*=d; + dc->ls.z*=d; + + dc->pen_width=2; + dc->color=RED; + GrBorder(dc,COURT_BORDER,COURT_BORDER, + task->pix_width -1-COURT_BORDER, + task->pix_height-1-COURT_BORDER); + for (i=0;ihas_ball) { + 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. + 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) + ball->z=o->z+HAND_Z_OFFSET-ball->radius*2; + } else if (o->shooting) { + ball->x=o->x; + ball->y=o->y; + ball->z=o->z+HEAD_Z_OFFSET; + } + if (tt>o->next_t0) { + if (o->has_ball && (ball->z+ball->radius*2>=o->z+HAND_Z_OFFSET || + Abs(ball->DzDt)<30)) { +//This is an approximation. My instinct tells me the viscosity term + //needs an $LK,"Exp",A="MN:Exp"$(). However, we should be syncronized to img frames, + //so we don't have to be perfect. + d_down=1.0; + d_up =1.0/COLLISION_DAMP; +//Up bounce takes higher % because speed lost in collision. + ball->DzDt=-((d_down+d_up)* + (o->z+HAND_Z_OFFSET-ball->radius*4)/(1.0-AIR_VISCOSITY)+ + 0.5*GRAVITY_ACCELERATION*( + Sqr(DRIBBLE_T*d_up/(d_down+d_up))- + Sqr(DRIBBLE_T*d_down/(d_down+d_up)) ))/DRIBBLE_T; + } + o->last_t0=tt; + o->last_img=o->next_img++; + if (o->stopped) { + if (o->has_ball) { + if (!(FIRST_STOPPED_DRIBBLING<=o->next_img<=LAST_STOPPED_DRIBBLING)) + o->next_img=FIRST_STOPPED_DRIBBLING; + } else + o->next_img=FIRST_STANDING; + o->stopped=FALSE; + } else if (o->shooting) { + if (!(FIRST_SHOOTING<=o->last_img<=LAST_SHOOTING)) + o->next_img=FIRST_SHOOTING; + if (o->next_img>LAST_SHOOTING) { + o->next_img=FIRST_STANDING; + someone_has_ball=someone_shooting=o->has_ball=o->shooting=FALSE; + ball->DxDt=o->DxDt+SHOT_VELOCITY/sqrt2*Cos(o->é-ã/2); + ball->DyDt=o->DyDt+SHOT_VELOCITY/sqrt2*Sin(o->é-ã/2); + 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 { + ball->DxDt=0; + ball->DyDt=0; + ball->DzDt=0; + } + } else if (o->has_ball) { + if (FIRST_RUNNING<=o->next_img<=LAST_RUNNING) + o->next_img+=FIRST_DRIBBLING-FIRST_RUNNING; + if (!(FIRST_DRIBBLING<=o->next_img<=LAST_DRIBBLING)) + o->next_img=FIRST_DRIBBLING; + } else { + if (FIRST_DRIBBLING<=o->next_img<=LAST_DRIBBLING) + o->next_img+=FIRST_RUNNING-FIRST_DRIBBLING; + if (!(FIRST_RUNNING<=o->next_img<=LAST_RUNNING)) + o->next_img=FIRST_RUNNING; + } + o->next_t0+=imgs[o->last_img].dt; + if (o->next_t0<=tt) + o->next_t0=tt+imgs[o->last_img].dt; + } + } + } + + QSortI64(o_sort,NUM_OBJS,&ObjCompare); + for (i=0;icolor=RED; + tt=0; + if (Blink) + GrPrint(dc,(task->pix_width-FONT_WIDTH*9)>>1, + (task->pix_height-FONT_HEIGHT)>>1,"Game Over"); + } else { + if (tScolor=LTRED; + if (Blink) + GrPrint(dc,(task->pix_width-FONT_WIDTH*4)>>1, + (task->pix_height-FONT_HEIGHT)>>1,"Foul"); + } + dc->color=BLACK; + } + GrPrint(dc,0,0,"Time:%d:%04.1f Score:",ToI64(tt),(tt-ToI64(tt))*60); + GrPrint (dc,FONT_WIDTH*27,0,"Best Score:"); + + dc->color=LTCYAN; + GrPrint(dc,FONT_WIDTH*20,0,"%02d",score0); + dc->color=LTPURPLE; + GrPrint(dc,FONT_WIDTH*23,0,"%02d",score1); + + dc->color=LTCYAN; + GrPrint(dc,FONT_WIDTH*39,0,"%02d",best_score0); + dc->color=LTPURPLE; + GrPrint(dc,FONT_WIDTH*42,0,"%02d",best_score1); +} + +U0 Shoot(Obj *o) +{ + if (!someone_shooting && o->has_ball) { + someone_shooting=o->stopped=o->shooting=TRUE; + o->has_ball=FALSE; + } +} + +U0 AnimateTask(CTask *parent_task) +{ + F64 d,dx,dy,dt,dx2,dy2,t0=tS; + I64 i,j; + Bool gets_ball; + Obj *o,*nearest_ball[2]; + while (TRUE) { + dt=tS-t0; + t0=tS; + + if (game_t_end && game_t_endbest_score0-best_score1) { + best_score0=score0; + best_score1=score1; + Snd(2000);Sleep(100); Snd(0);Sleep(100); + Snd(2000);Sleep(100); Snd(0);Sleep(100); + } + } + + if (game_t_end) { + MemSet(&nearest_ball,0,sizeof(nearest_ball)); + for (i=0;inearest_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_dtteam]->get_ball_dt) + nearest_ball[o->team]=o; + } + } + nearest_ball[0]->nearest_ball=TRUE; + nearest_ball[1]->nearest_ball=TRUE; + + for (i=0;ix+=dt*o->DxDt; + o->y+=dt*o->DyDt; + if (!someone_shooting) + o->z+=dt*(o->DzDt-0.5*GRAVITY_ACCELERATION*dt); + } else { + if (!o->has_ball) { + if (t0-o->stolen_t0>2.0 && !someone_shooting) { + dx=ball->x-o->x; + dy=ball->y-o->y; + if (dx*dx+dy*dyzz+HAND_Z_OFFSET) { + gets_ball=TRUE; + for (j=0;jhas_ball=TRUE; + if (o!=last_owner) { + if (o->team) { + if (t0shooting) { + if (o==human) { + 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; + } 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 { + dx=o->DxDt+=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); + if (d>=1.0) { + o->é=Arg(dx,dy)+ã/2; + dx*=MAN_VELOCITY/sqrt2*dt/d; + dy*=MAN_VELOCITY/sqrt2*dt/d; + o->nearest_man_dd=MAX_F64; + for (j=0;jx; + dy2=objs[j].y-o->y; + d=Sqr(dx2)+Sqr(dy2); + if (dnearest_man_dd) + o->nearest_man_dd=d; + if (do->foul_t0+0.15) { + d=(dx-objs[j].DxDt)*dx2+(dy-objs[j].DyDt)*dy2; + if (o==human && t0>o->foul_t0+1.0 && + dt && d/dt>FOUL_VELOCITY_THRESHOLD && + objs[j].team) { + Noise(250,500,500); + score1+=1; + foul_t_end=t0+1.0; + } + o->foul_t0=t0; + } + } + } + if (t0foul_t0+0.15) { + dx=-dx; + dy=-dy; + } + o->x+=dx; + o->y+=dy; + o->stopped=FALSE; + } else + o->stopped=TRUE; + } + if (o->DzDt) + o->z+=dt*(o->DzDt-0.5*GRAVITY_ACCELERATION*dt); + } + + if (o->x+o->radius>=parent_task->pix_width-COURT_BORDER) { + o->x=parent_task->pix_width-COURT_BORDER-1-o->radius; + o->DxDt=-COLLISION_DAMP*o->DxDt; + if (o==ball) + Noise(10,1000,2000); + } + if (o->x-o->radiusx=COURT_BORDER+o->radius; + o->DxDt=-COLLISION_DAMP*o->DxDt; + if (o==ball) + Noise(10,1000,2000); + } + + if (o->y+o->radius*2>=(parent_task->pix_height-COURT_BORDER)*2) { + o->y=(parent_task->pix_height-COURT_BORDER)*2-1-o->radius*2; + o->DyDt=-COLLISION_DAMP*o->DyDt; + if (o==ball) + Noise(10,1000,2000); + } + if (o->y-o->radius*2<2*COURT_BORDER) { + o->y=COURT_BORDER*2+o->radius*2; + o->DyDt=-COLLISION_DAMP*o->DyDt; + if (o==ball) + Noise(10,1000,2000); + } + + if (o->z-o->radius*2<0) { + o->z=o->radius*2; + o->DzDt=-COLLISION_DAMP*o->DzDt; + if (o->DzDt>ROLL_VELOCITY_THRESHOLD) + Noise(10,1000,2000); + if (o!=ball) + o->DzDt=0; + } else if (o->z-o->radius*2>0) + o->DzDt-=GRAVITY_ACCELERATION*dt; + if (o==ball) { + d=Exp(-AIR_VISCOSITY*dt); + o->DxDt*=d; + o->DyDt*=d; + o->DzDt*=d; + } + } + } + WinMgrSync; + } +} + +U0 Init() +{ + I64 i; + someone_shooting=FALSE; + shot_land_t=0; + MemSet(&objs,0,sizeof(objs)); + for (i=0;ipix_width/2; + objs[i].y=2*Fs->pix_height/2; + objs[i].next_img=objs[i].last_img=FIRST_RUNNING; + } + last_owner=NULL; + human=&objs[0]; + ball =&objs[i]; + ball->team=-1; + ball->x=0.5*Fs->pix_width/2; + ball->y=0.5*2*Fs->pix_height/2; + ball->radius=11; + ball->z=ball->radius; + score0=score1=0; + game_t_end=tS+3*60; + foul_t_end=0; +} + +U0 KeepAway() +{ + I64 msg_code,a1,a2; + + PopUpOk( + "Pass or hand-off to your team to score points.$$FG$$\n\n" + "\t2 points for successful hand-off.\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"$ + Fs->text_attr=BLACK+YELLOW<<4; + Fs->win_inhibit|=WIG_DBL_CLICK; + AutoComplete; + WinBorder; + WinMax; + DocCursor; + DocClear; + + MenuPush( + "File {" + " Abort(,CH_SHIFT_ESC);" + " Exit(,CH_ESC);" + "}" + "Play {" + " Restart(,'\n');" + " Shoot(,CH_SPACE);" + " Jump(,'j');" + "}" + ); + + Init; + Fs->draw_it=&DrawIt; + Fs->animate_task=Spawn(&AnimateTask,Fs,"Animate",,Fs); + + try { + while (TRUE) { + msg_code=GetMsg(&a1,&a2, + 1<DzDt=JUMP_VELOCITY; + break; + case MSG_KEY_DOWN: + switch (a1) { + case '\n': + Init; + break; + case 'j': + goto ka_jump; + case CH_SPACE: + goto ka_shoot; + case CH_SHIFT_ESC: + case CH_ESC: + goto ka_done; + } + break; + } + } +ka_done: //Don't goto out of try + GetMsg(,,1<>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ +·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ +ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ +·ÿÿÿöÿÿÿ·ÿÿÿ +ÚÿÿÿöÿÿÿÚÿÿÿºÿÿÿüÿÿÿ ¼ÿÿÿþÿÿÿÉÿÿÿËÿÿÿ¶ÿÿÿ ¸ÿÿÿÅÿÿÿ Çÿÿÿ ÊÿÿÿÌÿÿÿÒÿÿÿÔÿÿÿÄÿÿÿÆÿÿÿ +ÌÿÿÿÎÿÿÿÑÿÿÿÓÿÿÿÕÿÿÿ×ÿÿÿÍÿÿÿÏÿÿÿÑÿÿÿÓÿÿÿöÿÿÿ¸ÿÿÿÿÿÿÿòÿÿÿ¸ÿÿÿóÿÿÿÇÿÿÿöÿÿÿïÿÿÿÇÿÿÿøÿÿÿöÿÿÿºÿÿÿòÿÿÿºÿÿÿóÿÿÿÉÿÿÿúÿÿÿïÿÿÿÉÿÿÿüÿÿÿóÿÿÿÇÿÿÿöÿÿÿïÿÿÿÇÿÿÿøÿÿÿñÿÿÿÔÿÿÿïÿÿÿíÿÿÿÔÿÿÿñÿÿÿóÿÿÿÉÿÿÿúÿÿÿïÿÿÿÉÿÿÿüÿÿÿñÿÿÿÖÿÿÿóÿÿÿíÿÿÿÖÿÿÿõÿÿÿñÿÿÿÔÿÿÿðÿÿÿíÿÿÿÔÿÿÿòÿÿÿðÿÿÿÛÿÿÿíÿÿÿìÿÿÿÛÿÿÿïÿÿÿñÿÿÿÖÿÿÿòÿÿÿíÿÿÿÖÿÿÿôÿÿÿðÿÿÿÝÿÿÿïÿÿÿìÿÿÿÝÿÿÿñÿÿÿ ØÿÿÿýÿÿÿØÿÿÿÿÿÿÿäÿÿÿòÿÿÿäÿÿÿôÿÿÿ ÜÿÿÿÜÿÿÿèÿÿÿöÿÿÿèÿÿÿøÿÿÿäÿÿÿòÿÿÿäÿÿÿôÿÿÿðÿÿÿçÿÿÿðÿÿÿéÿÿÿèÿÿÿöÿÿÿèÿÿÿøÿÿÿôÿÿÿëÿÿÿôÿÿÿíÿÿÿõÿÿÿãÿÿÿõÿÿÿãÿÿÿîÿÿÿÿÿÿÿîÿÿÿïÿÿÿçÿÿÿïÿÿÿçÿÿÿúÿÿÿòÿÿÿÿÿÿÿúÿÿÿòÿÿÿýÿÿÿÜÿÿÿýÿÿÿ÷ÿÿÿÞÿÿÿÿÿÿÿÿÿÿÿèÿÿÿ ùÿÿÿêÿÿÿ ýÿÿÿÖÿÿÿ÷ÿÿÿØÿÿÿÿÿÿÿâÿÿÿ ùÿÿÿäÿÿÿÿÿÿÿçÿÿÿùÿÿÿéÿÿÿ +÷ÿÿÿ ûÿÿÿùÿÿÿÿÿÿÿãÿÿÿùÿÿÿåÿÿÿóÿÿÿûÿÿÿõÿÿÿýÿÿÿûÿÿÿýÿÿÿøÿÿÿýÿÿÿøÿÿÿ ÷ÿÿÿ ûÿÿÿ÷ÿÿÿòÿÿÿýÿÿÿòÿÿÿ  + +   + +  +     ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ +·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ +ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ +·ÿÿÿöÿÿÿ·ÿÿÿ +ÚÿÿÿöÿÿÿÚÿÿÿ·ÿÿÿ ¹ÿÿÿÆÿÿÿ÷ÿÿÿÈÿÿÿ÷ÿÿÿ¹ÿÿÿ »ÿÿÿÈÿÿÿûÿÿÿÊÿÿÿûÿÿÿÆÿÿÿ÷ÿÿÿÈÿÿÿ÷ÿÿÿÓÿÿÿðÿÿÿÕÿÿÿðÿÿÿÈÿÿÿûÿÿÿÊÿÿÿûÿÿÿÕÿÿÿôÿÿÿ×ÿÿÿôÿÿÿÓÿÿÿñÿÿÿÕÿÿÿñÿÿÿÚÿÿÿîÿÿÿÜÿÿÿîÿÿÿÕÿÿÿóÿÿÿ×ÿÿÿóÿÿÿÜÿÿÿðÿÿÿÞÿÿÿðÿÿÿöÿÿÿ»ÿÿÿýÿÿÿòÿÿÿ»ÿÿÿýÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿöÿÿÿ·ÿÿÿòÿÿÿ·ÿÿÿóÿÿÿÆÿÿÿ +ïÿÿÿÆÿÿÿ +óÿÿÿËÿÿÿïÿÿÿËÿÿÿñÿÿÿÓÿÿÿíÿÿÿÓÿÿÿóÿÿÿÅÿÿÿ ïÿÿÿÅÿÿÿ ñÿÿÿÍÿÿÿíÿÿÿÍÿÿÿñÿÿÿÒÿÿÿíÿÿÿÒÿÿÿðÿÿÿÖÿÿÿìÿÿÿÖÿÿÿñÿÿÿÎÿÿÿíÿÿÿÎÿÿÿðÿÿÿÒÿÿÿìÿÿÿÒÿÿÿ ÝÿÿÿþÿÿÿÝÿÿÿþÿÿÿéÿÿÿ +éÿÿÿ + ×ÿÿÿ×ÿÿÿãÿÿÿãÿÿÿèÿÿÿ èÿÿÿ øÿÿÿøÿÿÿäÿÿÿäÿÿÿôÿÿÿôÿÿÿüÿÿÿþÿÿÿ÷ÿÿÿÿÿÿÿùÿÿÿöÿÿÿ øÿÿÿ ñÿÿÿÿÿÿÿóÿÿÿýÿÿÿ×ÿÿÿþÿÿÿ÷ÿÿÿÙÿÿÿþÿÿÿÿÿÿÿãÿÿÿóÿÿÿùÿÿÿåÿÿÿóÿÿÿýÿÿÿÛÿÿÿ÷ÿÿÿÝÿÿÿÿÿÿÿçÿÿÿ÷ÿÿÿùÿÿÿéÿÿÿ÷ÿÿÿÿÿÿÿãÿÿÿóÿÿÿùÿÿÿåÿÿÿóÿÿÿïÿÿÿèÿÿÿûÿÿÿñÿÿÿèÿÿÿÿÿÿÿçÿÿÿ÷ÿÿÿùÿÿÿéÿÿÿ÷ÿÿÿóÿÿÿìÿÿÿûÿÿÿõÿÿÿìÿÿÿôÿÿÿâÿÿÿûÿÿÿöÿÿÿäÿÿÿÿÿÿÿíÿÿÿýÿÿÿïÿÿÿîÿÿÿæÿÿÿûÿÿÿðÿÿÿèÿÿÿùÿÿÿñÿÿÿýÿÿÿûÿÿÿóÿÿÿ  + +       +  +   +      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ +·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ +ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ +·ÿÿÿöÿÿÿ·ÿÿÿ +ÚÿÿÿöÿÿÿÚÿÿÿ·ÿÿÿ ¹ÿÿÿÆÿÿÿ÷ÿÿÿÈÿÿÿ÷ÿÿÿ¹ÿÿÿ »ÿÿÿÈÿÿÿûÿÿÿÊÿÿÿûÿÿÿÆÿÿÿ÷ÿÿÿÈÿÿÿ÷ÿÿÿÓÿÿÿðÿÿÿÕÿÿÿðÿÿÿÈÿÿÿûÿÿÿÊÿÿÿûÿÿÿÕÿÿÿôÿÿÿ×ÿÿÿôÿÿÿÓÿÿÿñÿÿÿÕÿÿÿñÿÿÿÚÿÿÿîÿÿÿÜÿÿÿîÿÿÿÕÿÿÿóÿÿÿ×ÿÿÿóÿÿÿÜÿÿÿðÿÿÿÞÿÿÿðÿÿÿöÿÿÿ»ÿÿÿýÿÿÿòÿÿÿ»ÿÿÿýÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿöÿÿÿ·ÿÿÿòÿÿÿ·ÿÿÿóÿÿÿÆÿÿÿ +ïÿÿÿÆÿÿÿ +óÿÿÿËÿÿÿïÿÿÿËÿÿÿñÿÿÿÓÿÿÿíÿÿÿÓÿÿÿóÿÿÿÅÿÿÿ ïÿÿÿÅÿÿÿ ñÿÿÿÍÿÿÿíÿÿÿÍÿÿÿñÿÿÿÒÿÿÿíÿÿÿÒÿÿÿðÿÿÿÖÿÿÿìÿÿÿÖÿÿÿñÿÿÿÎÿÿÿíÿÿÿÎÿÿÿðÿÿÿÒÿÿÿìÿÿÿÒÿÿÿ ÝÿÿÿþÿÿÿÝÿÿÿþÿÿÿéÿÿÿ +éÿÿÿ + ×ÿÿÿ×ÿÿÿãÿÿÿãÿÿÿèÿÿÿ èÿÿÿ øÿÿÿøÿÿÿäÿÿÿäÿÿÿôÿÿÿôÿÿÿüÿÿÿþÿÿÿ÷ÿÿÿÿÿÿÿùÿÿÿöÿÿÿ øÿÿÿ ñÿÿÿÿÿÿÿóÿÿÿýÿÿÿ×ÿÿÿþÿÿÿ÷ÿÿÿÙÿÿÿþÿÿÿÿÿÿÿãÿÿÿóÿÿÿùÿÿÿåÿÿÿóÿÿÿýÿÿÿÛÿÿÿ÷ÿÿÿÝÿÿÿÿÿÿÿçÿÿÿ÷ÿÿÿùÿÿÿéÿÿÿ÷ÿÿÿÿÿÿÿãÿÿÿóÿÿÿùÿÿÿåÿÿÿóÿÿÿïÿÿÿèÿÿÿûÿÿÿñÿÿÿèÿÿÿÿÿÿÿçÿÿÿ÷ÿÿÿùÿÿÿéÿÿÿ÷ÿÿÿóÿÿÿìÿÿÿûÿÿÿõÿÿÿìÿÿÿôÿÿÿâÿÿÿûÿÿÿöÿÿÿäÿÿÿÿÿÿÿíÿÿÿýÿÿÿïÿÿÿîÿÿÿæÿÿÿûÿÿÿðÿÿÿèÿÿÿùÿÿÿñÿÿÿýÿÿÿûÿÿÿóÿÿÿ  + +   + +  +     ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ +·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ +ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ +·ÿÿÿöÿÿÿ·ÿÿÿ +ÚÿÿÿöÿÿÿÚÿÿÿ¸ÿÿÿýÿÿÿ ºÿÿÿýÿÿÿÉÿÿÿýÿÿÿËÿÿÿýÿÿÿ¸ÿÿÿ ºÿÿÿÉÿÿÿËÿÿÿÉÿÿÿýÿÿÿËÿÿÿýÿÿÿØÿÿÿýÿÿÿÚÿÿÿýÿÿÿÉÿÿÿËÿÿÿØÿÿÿÚÿÿÿØÿÿÿþÿÿÿÚÿÿÿþÿÿÿàÿÿÿþÿÿÿâÿÿÿþÿÿÿØÿÿÿÚÿÿÿàÿÿÿâÿÿÿöÿÿÿ¹ÿÿÿýÿÿÿòÿÿÿ¹ÿÿÿýÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿöÿÿÿ¹ÿÿÿòÿÿÿ¹ÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿñÿÿÿÙÿÿÿýÿÿÿíÿÿÿÙÿÿÿýÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿñÿÿÿÙÿÿÿþÿÿÿíÿÿÿÙÿÿÿþÿÿÿðÿÿÿáÿÿÿþÿÿÿìÿÿÿáÿÿÿþÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿðÿÿÿáÿÿÿìÿÿÿáÿÿÿ +ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +ÚÿÿÿÚÿÿÿ +êÿÿÿêÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +êÿÿÿêÿÿÿ +úÿÿÿúÿÿÿ +üÿÿÿüÿÿÿ +  +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   + +       +  +   +      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ +·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ +ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ +·ÿÿÿöÿÿÿ·ÿÿÿ +ÚÿÿÿöÿÿÿÚÿÿÿ¸ÿÿÿýÿÿÿ ºÿÿÿýÿÿÿÉÿÿÿýÿÿÿËÿÿÿýÿÿÿ¸ÿÿÿ ºÿÿÿÉÿÿÿËÿÿÿÉÿÿÿýÿÿÿËÿÿÿýÿÿÿØÿÿÿýÿÿÿÚÿÿÿýÿÿÿÉÿÿÿËÿÿÿØÿÿÿÚÿÿÿØÿÿÿþÿÿÿÚÿÿÿþÿÿÿàÿÿÿþÿÿÿâÿÿÿþÿÿÿØÿÿÿÚÿÿÿàÿÿÿâÿÿÿöÿÿÿ¹ÿÿÿýÿÿÿòÿÿÿ¹ÿÿÿýÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿöÿÿÿ¹ÿÿÿòÿÿÿ¹ÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿñÿÿÿÙÿÿÿýÿÿÿíÿÿÿÙÿÿÿýÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿñÿÿÿÙÿÿÿþÿÿÿíÿÿÿÙÿÿÿþÿÿÿðÿÿÿáÿÿÿþÿÿÿìÿÿÿáÿÿÿþÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿðÿÿÿáÿÿÿìÿÿÿáÿÿÿ +ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +ÚÿÿÿÚÿÿÿ +êÿÿÿêÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +êÿÿÿêÿÿÿ +úÿÿÿúÿÿÿ +üÿÿÿüÿÿÿ +  +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   + +   + +  +     ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ +·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ +ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ +·ÿÿÿöÿÿÿ·ÿÿÿ +ÚÿÿÿöÿÿÿÚÿÿÿ¾ÿÿÿýÿÿÿ +¾ÿÿÿýÿÿÿ¾ÿÿÿ +¾ÿÿÿ¸ÿÿÿýÿÿÿ +¸ÿÿÿýÿÿÿ¸ÿÿÿ +¸ÿÿÿ»ÿÿÿ +»ÿÿÿ¬ÿÿÿ +¬ÿÿÿ»ÿÿÿ +»ÿÿÿ ¬ÿÿÿ +¬ÿÿÿ ¬ÿÿÿ +¬ÿÿÿ¤ÿÿÿ +¤ÿÿÿ¬ÿÿÿ +¬ÿÿÿ ¤ÿÿÿ +¤ÿÿÿ öÿÿÿ¾ÿÿÿýÿÿÿðÿÿÿ¾ÿÿÿýÿÿÿöÿÿÿ¾ÿÿÿðÿÿÿ¾ÿÿÿöÿÿÿ¸ÿÿÿýÿÿÿðÿÿÿ¸ÿÿÿýÿÿÿöÿÿÿ¸ÿÿÿðÿÿÿ¸ÿÿÿöÿÿÿ»ÿÿÿðÿÿÿ»ÿÿÿöÿÿÿ¬ÿÿÿðÿÿÿ¬ÿÿÿöÿÿÿ»ÿÿÿ ðÿÿÿ»ÿÿÿ öÿÿÿ¬ÿÿÿ ðÿÿÿ¬ÿÿÿ öÿÿÿ¬ÿÿÿðÿÿÿ¬ÿÿÿöÿÿÿ¤ÿÿÿðÿÿÿ¤ÿÿÿöÿÿÿ¬ÿÿÿ ðÿÿÿ¬ÿÿÿ öÿÿÿ¤ÿÿÿ ðÿÿÿ¤ÿÿÿ +ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +ÚÿÿÿÚÿÿÿ +êÿÿÿêÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +êÿÿÿêÿÿÿ +úÿÿÿúÿÿÿ +üÿÿÿüÿÿÿ +  +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   + +       +  +   +      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmok Êp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ +·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ +ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ +·ÿÿÿöÿÿÿ·ÿÿÿ +ÚÿÿÿöÿÿÿÚÿÿÿ¾ÿÿÿýÿÿÿ +¾ÿÿÿýÿÿÿ¾ÿÿÿ +¾ÿÿÿ¸ÿÿÿýÿÿÿ +¸ÿÿÿýÿÿÿ¸ÿÿÿ +¸ÿÿÿ»ÿÿÿ +»ÿÿÿ¬ÿÿÿ +¬ÿÿÿ»ÿÿÿ +»ÿÿÿ ¬ÿÿÿ +¬ÿÿÿ ¬ÿÿÿ +¬ÿÿÿ¤ÿÿÿ +¤ÿÿÿ¬ÿÿÿ +¬ÿÿÿ ¤ÿÿÿ +¤ÿÿÿ öÿÿÿ¾ÿÿÿýÿÿÿðÿÿÿ¾ÿÿÿýÿÿÿöÿÿÿ¾ÿÿÿðÿÿÿ¾ÿÿÿöÿÿÿ¸ÿÿÿýÿÿÿðÿÿÿ¸ÿÿÿýÿÿÿöÿÿÿ¸ÿÿÿðÿÿÿ¸ÿÿÿöÿÿÿ»ÿÿÿðÿÿÿ»ÿÿÿöÿÿÿ¬ÿÿÿðÿÿÿ¬ÿÿÿöÿÿÿ»ÿÿÿ ðÿÿÿ»ÿÿÿ öÿÿÿ¬ÿÿÿ ðÿÿÿ¬ÿÿÿ öÿÿÿ¬ÿÿÿðÿÿÿ¬ÿÿÿöÿÿÿ¤ÿÿÿðÿÿÿ¤ÿÿÿöÿÿÿ¬ÿÿÿ ðÿÿÿ¬ÿÿÿ öÿÿÿ¤ÿÿÿ ðÿÿÿ¤ÿÿÿ +ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +ÚÿÿÿÚÿÿÿ +êÿÿÿêÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +êÿÿÿêÿÿÿ +úÿÿÿúÿÿÿ +üÿÿÿüÿÿÿ +  +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   + +   + +  +     ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmok +Êp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ +·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ +ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ +·ÿÿÿöÿÿÿ·ÿÿÿ +ÚÿÿÿöÿÿÿÚÿÿÿ¿ÿÿÿ Áÿÿÿ ¶ÿÿÿ ¸ÿÿÿ¹ÿÿÿüÿÿÿ »ÿÿÿüÿÿÿ °ÿÿÿ ²ÿÿÿ ²ÿÿÿ ´ÿÿÿ ¦ÿÿÿ¨ÿÿÿ + ´ÿÿÿ ¶ÿÿÿ ¨ÿÿÿªÿÿÿ ¦ÿÿÿ¨ÿÿÿ + ÿÿÿ¢ÿÿÿ ¨ÿÿÿªÿÿÿ +¢ÿÿÿ¤ÿÿÿõÿÿÿÀÿÿÿÿÿÿÿñÿÿÿÀÿÿÿøÿÿÿ·ÿÿÿôÿÿÿ·ÿÿÿõÿÿÿºÿÿÿûÿÿÿñÿÿÿºÿÿÿýÿÿÿøÿÿÿ±ÿÿÿ +ôÿÿÿ±ÿÿÿ øÿÿÿ³ÿÿÿôÿÿÿ³ÿÿÿûÿÿÿ§ÿÿÿ ÷ÿÿÿ§ÿÿÿ øÿÿÿµÿÿÿ +ôÿÿÿµÿÿÿ +ûÿÿÿ©ÿÿÿ÷ÿÿÿ©ÿÿÿûÿÿÿ§ÿÿÿ÷ÿÿÿ§ÿÿÿýÿÿÿ¡ÿÿÿùÿÿÿ¡ÿÿÿûÿÿÿ©ÿÿÿ÷ÿÿÿ©ÿÿÿýÿÿÿ£ÿÿÿùÿÿÿ£ÿÿÿ +ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +ÚÿÿÿÚÿÿÿ +êÿÿÿêÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +êÿÿÿêÿÿÿ +úÿÿÿúÿÿÿ +üÿÿÿüÿÿÿ +  +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   + +       +  +   +      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmok Êp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ +·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ +ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ +·ÿÿÿöÿÿÿ·ÿÿÿ +ÚÿÿÿöÿÿÿÚÿÿÿ¿ÿÿÿ Áÿÿÿ ¶ÿÿÿ ¸ÿÿÿ¹ÿÿÿüÿÿÿ »ÿÿÿüÿÿÿ °ÿÿÿ ²ÿÿÿ ²ÿÿÿ ´ÿÿÿ ¦ÿÿÿ¨ÿÿÿ + ´ÿÿÿ ¶ÿÿÿ ¨ÿÿÿªÿÿÿ ¦ÿÿÿ¨ÿÿÿ + ÿÿÿ¢ÿÿÿ ¨ÿÿÿªÿÿÿ +¢ÿÿÿ¤ÿÿÿõÿÿÿÀÿÿÿÿÿÿÿñÿÿÿÀÿÿÿøÿÿÿ·ÿÿÿôÿÿÿ·ÿÿÿõÿÿÿºÿÿÿûÿÿÿñÿÿÿºÿÿÿýÿÿÿøÿÿÿ±ÿÿÿ +ôÿÿÿ±ÿÿÿ øÿÿÿ³ÿÿÿôÿÿÿ³ÿÿÿûÿÿÿ§ÿÿÿ ÷ÿÿÿ§ÿÿÿ øÿÿÿµÿÿÿ +ôÿÿÿµÿÿÿ +ûÿÿÿ©ÿÿÿ÷ÿÿÿ©ÿÿÿûÿÿÿ§ÿÿÿ÷ÿÿÿ§ÿÿÿýÿÿÿ¡ÿÿÿùÿÿÿ¡ÿÿÿûÿÿÿ©ÿÿÿ÷ÿÿÿ©ÿÿÿýÿÿÿ£ÿÿÿùÿÿÿ£ÿÿÿ +ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +ÚÿÿÿÚÿÿÿ +êÿÿÿêÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +êÿÿÿêÿÿÿ +úÿÿÿúÿÿÿ +üÿÿÿüÿÿÿ +  +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   + +   + +  +     ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ +·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ +ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ +·ÿÿÿöÿÿÿ·ÿÿÿ +ÚÿÿÿöÿÿÿÚÿÿÿ¾ÿÿÿþÿÿÿ ¾ÿÿÿþÿÿÿ ¾ÿÿÿ ¾ÿÿÿ¸ÿÿÿþÿÿÿ ¸ÿÿÿþÿÿÿ ¸ÿÿÿ ¸ÿÿÿ ¾ÿÿÿ ¾ÿÿÿ ¾ÿÿÿ¾ÿÿÿ ¸ÿÿÿ ¸ÿÿÿ ¸ÿÿÿ¸ÿÿÿ ½ÿÿÿ½ÿÿÿ +½ÿÿÿ&½ÿÿÿ& ¹ÿÿÿ¹ÿÿÿ +¹ÿÿÿ&¹ÿÿÿ&õÿÿÿ¾ÿÿÿýÿÿÿñÿÿÿ¾ÿÿÿÿÿÿÿøÿÿÿ¾ÿÿÿôÿÿÿ¾ÿÿÿõÿÿÿ¸ÿÿÿýÿÿÿñÿÿÿ¸ÿÿÿÿÿÿÿøÿÿÿ¸ÿÿÿôÿÿÿ¸ÿÿÿøÿÿÿ¾ÿÿÿôÿÿÿ¾ÿÿÿûÿÿÿ¾ÿÿÿ÷ÿÿÿ¾ÿÿÿ øÿÿÿ¸ÿÿÿôÿÿÿ¸ÿÿÿûÿÿÿ¸ÿÿÿ÷ÿÿÿ¸ÿÿÿ ûÿÿÿ½ÿÿÿ÷ÿÿÿ½ÿÿÿ ýÿÿÿ½ÿÿÿ%ùÿÿÿ½ÿÿÿ'ûÿÿÿ¹ÿÿÿ÷ÿÿÿ¹ÿÿÿ ýÿÿÿ¹ÿÿÿ%ùÿÿÿ¹ÿÿÿ' +ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +ÚÿÿÿÚÿÿÿ +êÿÿÿêÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +êÿÿÿêÿÿÿ +úÿÿÿúÿÿÿ +üÿÿÿüÿÿÿ +  +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   + +       +  +   +      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ +·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ +ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ +·ÿÿÿöÿÿÿ·ÿÿÿ +ÚÿÿÿöÿÿÿÚÿÿÿ¾ÿÿÿþÿÿÿ ¾ÿÿÿþÿÿÿ ¾ÿÿÿ ¾ÿÿÿ¸ÿÿÿþÿÿÿ ¸ÿÿÿþÿÿÿ ¸ÿÿÿ ¸ÿÿÿ ¾ÿÿÿ ¾ÿÿÿ ¾ÿÿÿ¾ÿÿÿ ¸ÿÿÿ ¸ÿÿÿ ¸ÿÿÿ¸ÿÿÿ ½ÿÿÿ½ÿÿÿ +½ÿÿÿ&½ÿÿÿ& ¹ÿÿÿ¹ÿÿÿ +¹ÿÿÿ&¹ÿÿÿ&õÿÿÿ¾ÿÿÿýÿÿÿñÿÿÿ¾ÿÿÿÿÿÿÿøÿÿÿ¾ÿÿÿôÿÿÿ¾ÿÿÿõÿÿÿ¸ÿÿÿýÿÿÿñÿÿÿ¸ÿÿÿÿÿÿÿøÿÿÿ¸ÿÿÿôÿÿÿ¸ÿÿÿøÿÿÿ¾ÿÿÿôÿÿÿ¾ÿÿÿûÿÿÿ¾ÿÿÿ÷ÿÿÿ¾ÿÿÿ øÿÿÿ¸ÿÿÿôÿÿÿ¸ÿÿÿûÿÿÿ¸ÿÿÿ÷ÿÿÿ¸ÿÿÿ ûÿÿÿ½ÿÿÿ÷ÿÿÿ½ÿÿÿ ýÿÿÿ½ÿÿÿ%ùÿÿÿ½ÿÿÿ'ûÿÿÿ¹ÿÿÿ÷ÿÿÿ¹ÿÿÿ ýÿÿÿ¹ÿÿÿ%ùÿÿÿ¹ÿÿÿ' +ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +ÚÿÿÿÚÿÿÿ +êÿÿÿêÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +êÿÿÿêÿÿÿ +úÿÿÿúÿÿÿ +üÿÿÿüÿÿÿ +  +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   + +   + +  +     ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmok Êp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ +·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ +ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ +·ÿÿÿöÿÿÿ·ÿÿÿ +ÚÿÿÿöÿÿÿÚÿÿÿ¿ÿÿÿ Áÿÿÿ ¯ÿÿÿ ±ÿÿÿ »ÿÿÿüÿÿÿ ½ÿÿÿüÿÿÿ «ÿÿÿ ­ÿÿÿ «ÿÿÿ ­ÿÿÿ ¢ÿÿÿüÿÿÿ¤ÿÿÿþÿÿÿ ¯ÿÿÿ ±ÿÿÿ ¦ÿÿÿøÿÿÿ¨ÿÿÿúÿÿÿ £ÿÿÿüÿÿÿ¥ÿÿÿþÿÿÿ +žÿÿÿöÿÿÿ ÿÿÿøÿÿÿ ¥ÿÿÿøÿÿÿ§ÿÿÿúÿÿÿ + ÿÿÿòÿÿÿ¢ÿÿÿôÿÿÿõÿÿÿÀÿÿÿñÿÿÿÀÿÿÿøÿÿÿ°ÿÿÿôÿÿÿ°ÿÿÿ +õÿÿÿ¼ÿÿÿûÿÿÿñÿÿÿ¼ÿÿÿýÿÿÿøÿÿÿ¬ÿÿÿôÿÿÿ¬ÿÿÿøÿÿÿ¬ÿÿÿôÿÿÿ¬ÿÿÿûÿÿÿ£ÿÿÿýÿÿÿ÷ÿÿÿ£ÿÿÿýÿÿÿøÿÿÿ°ÿÿÿôÿÿÿ°ÿÿÿûÿÿÿ§ÿÿÿùÿÿÿ÷ÿÿÿ§ÿÿÿùÿÿÿûÿÿÿ¤ÿÿÿýÿÿÿ÷ÿÿÿ¤ÿÿÿýÿÿÿýÿÿÿŸÿÿÿ÷ÿÿÿùÿÿÿŸÿÿÿ÷ÿÿÿûÿÿÿ¦ÿÿÿùÿÿÿ÷ÿÿÿ¦ÿÿÿùÿÿÿýÿÿÿ¡ÿÿÿóÿÿÿùÿÿÿ¡ÿÿÿóÿÿÿ +ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +ÚÿÿÿÚÿÿÿ +êÿÿÿêÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +êÿÿÿêÿÿÿ +úÿÿÿúÿÿÿ +üÿÿÿüÿÿÿ +  +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   + +       +  +   +      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmok Êp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ +·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ +ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ +·ÿÿÿöÿÿÿ·ÿÿÿ +ÚÿÿÿöÿÿÿÚÿÿÿ¿ÿÿÿ Áÿÿÿ ¯ÿÿÿ ±ÿÿÿ »ÿÿÿüÿÿÿ ½ÿÿÿüÿÿÿ «ÿÿÿ ­ÿÿÿ «ÿÿÿ ­ÿÿÿ ¢ÿÿÿüÿÿÿ¤ÿÿÿþÿÿÿ ¯ÿÿÿ ±ÿÿÿ ¦ÿÿÿøÿÿÿ¨ÿÿÿúÿÿÿ £ÿÿÿüÿÿÿ¥ÿÿÿþÿÿÿ +žÿÿÿöÿÿÿ ÿÿÿøÿÿÿ ¥ÿÿÿøÿÿÿ§ÿÿÿúÿÿÿ + ÿÿÿòÿÿÿ¢ÿÿÿôÿÿÿõÿÿÿÀÿÿÿñÿÿÿÀÿÿÿøÿÿÿ°ÿÿÿôÿÿÿ°ÿÿÿ +õÿÿÿ¼ÿÿÿûÿÿÿñÿÿÿ¼ÿÿÿýÿÿÿøÿÿÿ¬ÿÿÿôÿÿÿ¬ÿÿÿøÿÿÿ¬ÿÿÿôÿÿÿ¬ÿÿÿûÿÿÿ£ÿÿÿýÿÿÿ÷ÿÿÿ£ÿÿÿýÿÿÿøÿÿÿ°ÿÿÿôÿÿÿ°ÿÿÿûÿÿÿ§ÿÿÿùÿÿÿ÷ÿÿÿ§ÿÿÿùÿÿÿûÿÿÿ¤ÿÿÿýÿÿÿ÷ÿÿÿ¤ÿÿÿýÿÿÿýÿÿÿŸÿÿÿ÷ÿÿÿùÿÿÿŸÿÿÿ÷ÿÿÿûÿÿÿ¦ÿÿÿùÿÿÿ÷ÿÿÿ¦ÿÿÿùÿÿÿýÿÿÿ¡ÿÿÿóÿÿÿùÿÿÿ¡ÿÿÿóÿÿÿ +ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +ÚÿÿÿÚÿÿÿ +êÿÿÿêÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +êÿÿÿêÿÿÿ +úÿÿÿúÿÿÿ +üÿÿÿüÿÿÿ +  +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   + +   + +  +     ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÎ +;€öÿÿÿýÿÿÿ÷ÿÿÿÿÿÿÿ÷ÿÿÿ÷ÿÿÿ÷ÿÿÿÿÿÿÿ÷ÿÿÿýÿÿÿ÷ÿÿÿýÿÿÿÿÿÿÿ÷ÿÿÿÿÿÿÿýÿÿÿ÷ÿÿÿüÿÿÿùÿÿÿùÿÿÿùÿÿÿùÿÿÿüÿÿÿùÿÿÿùÿÿÿùÿÿÿûÿÿÿüÿÿÿùÿÿÿùÿÿÿùÿÿÿûÿÿÿùÿÿÿýÿÿÿýÿÿÿýÿÿÿýÿÿÿýÿÿÿýÿÿÿøÿÿÿýÿÿÿøÿÿÿýÿÿÿýÿÿÿýÿÿÿøÿÿÿýÿÿÿøÿÿÿýÿÿÿ + +ùÿÿÿöÿÿÿùÿÿÿùÿÿÿöÿÿÿùÿÿÿýÿÿÿøÿÿÿøÿÿÿýÿÿÿýÿÿÿøÿÿÿøÿÿÿýÿÿÿüÿÿÿùÿÿÿûÿÿÿüÿÿÿùÿÿÿûÿÿÿ ÿÿÿÿ ýÿÿÿ ýÿÿÿÿÿÿÿ ÿÿÿÿýÿÿÿ ýÿÿÿ ÿÿÿÿ  +   + + +         + + +             !!!""###$$$%%%& && ' '' ( !((!)!))""#**#+#$++$,$%,,%-%&--&.&'..'/'(//(0()00)1)"11"**+22+3+,33,4,-44-5-.55.6./66/7/077080188191*99*223::3:34::4:45::5:56::6:67::7:78::8:89::9:92::2:Êp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ +·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ +ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ +·ÿÿÿöÿÿÿ·ÿÿÿ +ÚÿÿÿöÿÿÿÚÿÿÿ»ÿÿÿûÿÿÿ ½ÿÿÿýÿÿÿÈÿÿÿÊÿÿÿ +µÿÿÿÿÿÿÿ ·ÿÿÿÂÿÿÿ ÄÿÿÿÈÿÿÿ Êÿÿÿ ÐÿÿÿÒÿÿÿÂÿÿÿ Äÿÿÿ ÊÿÿÿÌÿÿÿÐÿÿÿÐÿÿÿÎÿÿÿ Îÿÿÿ"ÌÿÿÿÌÿÿÿÊÿÿÿÊÿÿÿ öÿÿÿ¸ÿÿÿÿÿÿÿòÿÿÿ¸ÿÿÿóÿÿÿÇÿÿÿöÿÿÿïÿÿÿÇÿÿÿøÿÿÿöÿÿÿºÿÿÿòÿÿÿºÿÿÿóÿÿÿÉÿÿÿúÿÿÿïÿÿÿÉÿÿÿüÿÿÿóÿÿÿÇÿÿÿöÿÿÿïÿÿÿÇÿÿÿøÿÿÿñÿÿÿÔÿÿÿïÿÿÿíÿÿÿÔÿÿÿñÿÿÿóÿÿÿÉÿÿÿúÿÿÿïÿÿÿÉÿÿÿüÿÿÿñÿÿÿÖÿÿÿóÿÿÿíÿÿÿÖÿÿÿõÿÿÿñÿÿÿÔÿÿÿðÿÿÿíÿÿÿÔÿÿÿòÿÿÿðÿÿÿÛÿÿÿíÿÿÿìÿÿÿÛÿÿÿïÿÿÿñÿÿÿÖÿÿÿòÿÿÿíÿÿÿÖÿÿÿôÿÿÿðÿÿÿÝÿÿÿïÿÿÿìÿÿÿÝÿÿÿñÿÿÿ ØÿÿÿýÿÿÿØÿÿÿÿÿÿÿäÿÿÿòÿÿÿäÿÿÿôÿÿÿ ÜÿÿÿÜÿÿÿèÿÿÿöÿÿÿèÿÿÿøÿÿÿäÿÿÿòÿÿÿäÿÿÿôÿÿÿðÿÿÿçÿÿÿðÿÿÿéÿÿÿèÿÿÿöÿÿÿèÿÿÿøÿÿÿôÿÿÿëÿÿÿôÿÿÿíÿÿÿõÿÿÿãÿÿÿõÿÿÿãÿÿÿîÿÿÿÿÿÿÿîÿÿÿïÿÿÿçÿÿÿïÿÿÿçÿÿÿúÿÿÿòÿÿÿÿÿÿÿúÿÿÿòÿÿÿýÿÿÿÜÿÿÿýÿÿÿ÷ÿÿÿÞÿÿÿÿÿÿÿÿÿÿÿèÿÿÿ ùÿÿÿêÿÿÿ ýÿÿÿÖÿÿÿ÷ÿÿÿØÿÿÿÿÿÿÿâÿÿÿ ùÿÿÿäÿÿÿÿÿÿÿçÿÿÿùÿÿÿéÿÿÿ +÷ÿÿÿ ûÿÿÿùÿÿÿÿÿÿÿãÿÿÿùÿÿÿåÿÿÿóÿÿÿûÿÿÿõÿÿÿýÿÿÿûÿÿÿýÿÿÿøÿÿÿýÿÿÿøÿÿÿ ÷ÿÿÿ ûÿÿÿ÷ÿÿÿòÿÿÿýÿÿÿòÿÿÿ  + +       +  +   +      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ +·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ +ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ +·ÿÿÿöÿÿÿ·ÿÿÿ +ÚÿÿÿöÿÿÿÚÿÿÿ»ÿÿÿûÿÿÿ ½ÿÿÿýÿÿÿÈÿÿÿÊÿÿÿ +µÿÿÿÿÿÿÿ ·ÿÿÿÂÿÿÿ ÄÿÿÿÈÿÿÿ Êÿÿÿ ÐÿÿÿÒÿÿÿÂÿÿÿ Äÿÿÿ ÊÿÿÿÌÿÿÿÐÿÿÿÐÿÿÿÎÿÿÿ Îÿÿÿ"ÌÿÿÿÌÿÿÿÊÿÿÿÊÿÿÿ öÿÿÿ¸ÿÿÿÿÿÿÿòÿÿÿ¸ÿÿÿóÿÿÿÇÿÿÿöÿÿÿïÿÿÿÇÿÿÿøÿÿÿöÿÿÿºÿÿÿòÿÿÿºÿÿÿóÿÿÿÉÿÿÿúÿÿÿïÿÿÿÉÿÿÿüÿÿÿóÿÿÿÇÿÿÿöÿÿÿïÿÿÿÇÿÿÿøÿÿÿñÿÿÿÔÿÿÿïÿÿÿíÿÿÿÔÿÿÿñÿÿÿóÿÿÿÉÿÿÿúÿÿÿïÿÿÿÉÿÿÿüÿÿÿñÿÿÿÖÿÿÿóÿÿÿíÿÿÿÖÿÿÿõÿÿÿñÿÿÿÔÿÿÿðÿÿÿíÿÿÿÔÿÿÿòÿÿÿðÿÿÿÛÿÿÿíÿÿÿìÿÿÿÛÿÿÿïÿÿÿñÿÿÿÖÿÿÿòÿÿÿíÿÿÿÖÿÿÿôÿÿÿðÿÿÿÝÿÿÿïÿÿÿìÿÿÿÝÿÿÿñÿÿÿ ØÿÿÿýÿÿÿØÿÿÿÿÿÿÿäÿÿÿòÿÿÿäÿÿÿôÿÿÿ ÜÿÿÿÜÿÿÿèÿÿÿöÿÿÿèÿÿÿøÿÿÿäÿÿÿòÿÿÿäÿÿÿôÿÿÿðÿÿÿçÿÿÿðÿÿÿéÿÿÿèÿÿÿöÿÿÿèÿÿÿøÿÿÿôÿÿÿëÿÿÿôÿÿÿíÿÿÿõÿÿÿãÿÿÿõÿÿÿãÿÿÿîÿÿÿÿÿÿÿîÿÿÿïÿÿÿçÿÿÿïÿÿÿçÿÿÿúÿÿÿòÿÿÿÿÿÿÿúÿÿÿòÿÿÿýÿÿÿÜÿÿÿýÿÿÿ÷ÿÿÿÞÿÿÿÿÿÿÿÿÿÿÿèÿÿÿ ùÿÿÿêÿÿÿ ýÿÿÿÖÿÿÿ÷ÿÿÿØÿÿÿÿÿÿÿâÿÿÿ ùÿÿÿäÿÿÿÿÿÿÿçÿÿÿùÿÿÿéÿÿÿ +÷ÿÿÿ ûÿÿÿùÿÿÿÿÿÿÿãÿÿÿùÿÿÿåÿÿÿóÿÿÿûÿÿÿõÿÿÿýÿÿÿûÿÿÿýÿÿÿøÿÿÿýÿÿÿøÿÿÿ ÷ÿÿÿ ûÿÿÿ÷ÿÿÿòÿÿÿýÿÿÿòÿÿÿ  + +   + +  +     ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ +·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ +ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ +·ÿÿÿöÿÿÿ·ÿÿÿ +ÚÿÿÿöÿÿÿÚÿÿÿ»ÿÿÿûÿÿÿ ½ÿÿÿýÿÿÿÈÿÿÿÊÿÿÿ +µÿÿÿÿÿÿÿ ·ÿÿÿÂÿÿÿ ÄÿÿÿÈÿÿÿ Êÿÿÿ ÐÿÿÿÒÿÿÿÂÿÿÿ Äÿÿÿ ÊÿÿÿÌÿÿÿÐÿÿÿÐÿÿÿÎÿÿÿ Îÿÿÿ"ÌÿÿÿÌÿÿÿÊÿÿÿÊÿÿÿ öÿÿÿ»ÿÿÿýÿÿÿòÿÿÿ»ÿÿÿýÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿöÿÿÿ·ÿÿÿòÿÿÿ·ÿÿÿóÿÿÿÆÿÿÿ +ïÿÿÿÆÿÿÿ +óÿÿÿËÿÿÿïÿÿÿËÿÿÿñÿÿÿÓÿÿÿíÿÿÿÓÿÿÿóÿÿÿÅÿÿÿ ïÿÿÿÅÿÿÿ ñÿÿÿÍÿÿÿíÿÿÿÍÿÿÿñÿÿÿÒÿÿÿíÿÿÿÒÿÿÿðÿÿÿÖÿÿÿìÿÿÿÖÿÿÿñÿÿÿÎÿÿÿíÿÿÿÎÿÿÿðÿÿÿÒÿÿÿìÿÿÿÒÿÿÿ ÝÿÿÿþÿÿÿÝÿÿÿþÿÿÿéÿÿÿ +éÿÿÿ + ×ÿÿÿ×ÿÿÿãÿÿÿãÿÿÿèÿÿÿ èÿÿÿ øÿÿÿøÿÿÿäÿÿÿäÿÿÿôÿÿÿôÿÿÿüÿÿÿþÿÿÿ÷ÿÿÿÿÿÿÿùÿÿÿöÿÿÿ øÿÿÿ ñÿÿÿÿÿÿÿóÿÿÿýÿÿÿ×ÿÿÿþÿÿÿ÷ÿÿÿÙÿÿÿþÿÿÿÿÿÿÿãÿÿÿóÿÿÿùÿÿÿåÿÿÿóÿÿÿýÿÿÿÛÿÿÿ÷ÿÿÿÝÿÿÿÿÿÿÿçÿÿÿ÷ÿÿÿùÿÿÿéÿÿÿ÷ÿÿÿÿÿÿÿãÿÿÿóÿÿÿùÿÿÿåÿÿÿóÿÿÿïÿÿÿèÿÿÿûÿÿÿñÿÿÿèÿÿÿÿÿÿÿçÿÿÿ÷ÿÿÿùÿÿÿéÿÿÿ÷ÿÿÿóÿÿÿìÿÿÿûÿÿÿõÿÿÿìÿÿÿôÿÿÿâÿÿÿûÿÿÿöÿÿÿäÿÿÿÿÿÿÿíÿÿÿýÿÿÿïÿÿÿîÿÿÿæÿÿÿûÿÿÿðÿÿÿèÿÿÿùÿÿÿñÿÿÿýÿÿÿûÿÿÿóÿÿÿ  + +       +  +   +      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ +·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ +ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ +·ÿÿÿöÿÿÿ·ÿÿÿ +ÚÿÿÿöÿÿÿÚÿÿÿ»ÿÿÿûÿÿÿ ½ÿÿÿýÿÿÿÈÿÿÿÊÿÿÿ +µÿÿÿÿÿÿÿ ·ÿÿÿÂÿÿÿ ÄÿÿÿÈÿÿÿ Êÿÿÿ ÐÿÿÿÒÿÿÿÂÿÿÿ Äÿÿÿ ÊÿÿÿÌÿÿÿÐÿÿÿÐÿÿÿÎÿÿÿ Îÿÿÿ"ÌÿÿÿÌÿÿÿÊÿÿÿÊÿÿÿ öÿÿÿ»ÿÿÿýÿÿÿòÿÿÿ»ÿÿÿýÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿöÿÿÿ·ÿÿÿòÿÿÿ·ÿÿÿóÿÿÿÆÿÿÿ +ïÿÿÿÆÿÿÿ +óÿÿÿËÿÿÿïÿÿÿËÿÿÿñÿÿÿÓÿÿÿíÿÿÿÓÿÿÿóÿÿÿÅÿÿÿ ïÿÿÿÅÿÿÿ ñÿÿÿÍÿÿÿíÿÿÿÍÿÿÿñÿÿÿÒÿÿÿíÿÿÿÒÿÿÿðÿÿÿÖÿÿÿìÿÿÿÖÿÿÿñÿÿÿÎÿÿÿíÿÿÿÎÿÿÿðÿÿÿÒÿÿÿìÿÿÿÒÿÿÿ ÝÿÿÿþÿÿÿÝÿÿÿþÿÿÿéÿÿÿ +éÿÿÿ + ×ÿÿÿ×ÿÿÿãÿÿÿãÿÿÿèÿÿÿ èÿÿÿ øÿÿÿøÿÿÿäÿÿÿäÿÿÿôÿÿÿôÿÿÿüÿÿÿþÿÿÿ÷ÿÿÿÿÿÿÿùÿÿÿöÿÿÿ øÿÿÿ ñÿÿÿÿÿÿÿóÿÿÿýÿÿÿ×ÿÿÿþÿÿÿ÷ÿÿÿÙÿÿÿþÿÿÿÿÿÿÿãÿÿÿóÿÿÿùÿÿÿåÿÿÿóÿÿÿýÿÿÿÛÿÿÿ÷ÿÿÿÝÿÿÿÿÿÿÿçÿÿÿ÷ÿÿÿùÿÿÿéÿÿÿ÷ÿÿÿÿÿÿÿãÿÿÿóÿÿÿùÿÿÿåÿÿÿóÿÿÿïÿÿÿèÿÿÿûÿÿÿñÿÿÿèÿÿÿÿÿÿÿçÿÿÿ÷ÿÿÿùÿÿÿéÿÿÿ÷ÿÿÿóÿÿÿìÿÿÿûÿÿÿõÿÿÿìÿÿÿôÿÿÿâÿÿÿûÿÿÿöÿÿÿäÿÿÿÿÿÿÿíÿÿÿýÿÿÿïÿÿÿîÿÿÿæÿÿÿûÿÿÿðÿÿÿèÿÿÿùÿÿÿñÿÿÿýÿÿÿûÿÿÿóÿÿÿ  + +   + +  +     ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ +·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ +ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ +·ÿÿÿöÿÿÿ·ÿÿÿ +ÚÿÿÿöÿÿÿÚÿÿÿ»ÿÿÿûÿÿÿ ½ÿÿÿýÿÿÿÈÿÿÿÊÿÿÿ +µÿÿÿÿÿÿÿ ·ÿÿÿÂÿÿÿ ÄÿÿÿÈÿÿÿ Êÿÿÿ ÐÿÿÿÒÿÿÿÂÿÿÿ Äÿÿÿ ÊÿÿÿÌÿÿÿÎÿÿÿÐÿÿÿÕÿÿÿ×ÿÿÿÌÿÿÿÎÿÿÿÓÿÿÿÕÿÿÿöÿÿÿ¹ÿÿÿýÿÿÿòÿÿÿ¹ÿÿÿýÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿöÿÿÿ¹ÿÿÿòÿÿÿ¹ÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿñÿÿÿÙÿÿÿýÿÿÿíÿÿÿÙÿÿÿýÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿñÿÿÿÙÿÿÿþÿÿÿíÿÿÿÙÿÿÿþÿÿÿðÿÿÿáÿÿÿþÿÿÿìÿÿÿáÿÿÿþÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿðÿÿÿáÿÿÿìÿÿÿáÿÿÿ +ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +ÚÿÿÿÚÿÿÿ +êÿÿÿêÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +êÿÿÿêÿÿÿ +úÿÿÿúÿÿÿ +üÿÿÿüÿÿÿ +  +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   + +       +  +   +      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ +·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ +ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ +·ÿÿÿöÿÿÿ·ÿÿÿ +ÚÿÿÿöÿÿÿÚÿÿÿ»ÿÿÿûÿÿÿ ½ÿÿÿýÿÿÿÈÿÿÿÊÿÿÿ +µÿÿÿÿÿÿÿ ·ÿÿÿÂÿÿÿ ÄÿÿÿÈÿÿÿ Êÿÿÿ ÐÿÿÿÒÿÿÿÂÿÿÿ Äÿÿÿ ÊÿÿÿÌÿÿÿÎÿÿÿÐÿÿÿÕÿÿÿ×ÿÿÿÌÿÿÿÎÿÿÿÓÿÿÿÕÿÿÿöÿÿÿ¹ÿÿÿýÿÿÿòÿÿÿ¹ÿÿÿýÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿöÿÿÿ¹ÿÿÿòÿÿÿ¹ÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿñÿÿÿÙÿÿÿýÿÿÿíÿÿÿÙÿÿÿýÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿñÿÿÿÙÿÿÿþÿÿÿíÿÿÿÙÿÿÿþÿÿÿðÿÿÿáÿÿÿþÿÿÿìÿÿÿáÿÿÿþÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿðÿÿÿáÿÿÿìÿÿÿáÿÿÿ +ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +ÚÿÿÿÚÿÿÿ +êÿÿÿêÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +êÿÿÿêÿÿÿ +úÿÿÿúÿÿÿ +üÿÿÿüÿÿÿ +  +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   + +   + +  +     ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ +·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ +ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ +·ÿÿÿöÿÿÿ·ÿÿÿ +ÚÿÿÿöÿÿÿÚÿÿÿ»ÿÿÿûÿÿÿ ½ÿÿÿýÿÿÿÈÿÿÿÊÿÿÿ +µÿÿÿÿÿÿÿ ·ÿÿÿÂÿÿÿ ÄÿÿÿÈÿÿÿ Êÿÿÿ ÐÿÿÿÒÿÿÿÂÿÿÿ Äÿÿÿ ÊÿÿÿÌÿÿÿÐÿÿÿÐÿÿÿÎÿÿÿ Îÿÿÿ"ÌÿÿÿÌÿÿÿÊÿÿÿÊÿÿÿ öÿÿÿ¹ÿÿÿýÿÿÿòÿÿÿ¹ÿÿÿýÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿöÿÿÿ¹ÿÿÿòÿÿÿ¹ÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿñÿÿÿÙÿÿÿýÿÿÿíÿÿÿÙÿÿÿýÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿñÿÿÿÙÿÿÿþÿÿÿíÿÿÿÙÿÿÿþÿÿÿðÿÿÿáÿÿÿþÿÿÿìÿÿÿáÿÿÿþÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿðÿÿÿáÿÿÿìÿÿÿáÿÿÿ +ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +ÚÿÿÿÚÿÿÿ +êÿÿÿêÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +êÿÿÿêÿÿÿ +úÿÿÿúÿÿÿ +üÿÿÿüÿÿÿ +  +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   + +       +  +   +      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokÊp¨­ÿÿÿûÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ·ÿÿÿûÿÿÿûÿÿÿ·ÿÿÿûÿÿÿ­ÿÿÿûÿÿÿ­ÿÿÿ·ÿÿÿûÿÿÿ·ÿÿÿ +·ÿÿÿûÿÿÿöÿÿÿ·ÿÿÿûÿÿÿ +ÚÿÿÿûÿÿÿöÿÿÿÚÿÿÿûÿÿÿ +·ÿÿÿöÿÿÿ·ÿÿÿ +ÚÿÿÿöÿÿÿÚÿÿÿ»ÿÿÿûÿÿÿ ½ÿÿÿýÿÿÿÈÿÿÿÊÿÿÿ +µÿÿÿÿÿÿÿ ·ÿÿÿÂÿÿÿ ÄÿÿÿÈÿÿÿ Êÿÿÿ ÐÿÿÿÒÿÿÿÂÿÿÿ Äÿÿÿ ÊÿÿÿÌÿÿÿÐÿÿÿÐÿÿÿÎÿÿÿ Îÿÿÿ"ÌÿÿÿÌÿÿÿÊÿÿÿÊÿÿÿ öÿÿÿ¹ÿÿÿýÿÿÿòÿÿÿ¹ÿÿÿýÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿöÿÿÿ¹ÿÿÿòÿÿÿ¹ÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿóÿÿÿÊÿÿÿýÿÿÿïÿÿÿÊÿÿÿýÿÿÿñÿÿÿÙÿÿÿýÿÿÿíÿÿÿÙÿÿÿýÿÿÿóÿÿÿÊÿÿÿïÿÿÿÊÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿñÿÿÿÙÿÿÿþÿÿÿíÿÿÿÙÿÿÿþÿÿÿðÿÿÿáÿÿÿþÿÿÿìÿÿÿáÿÿÿþÿÿÿñÿÿÿÙÿÿÿíÿÿÿÙÿÿÿðÿÿÿáÿÿÿìÿÿÿáÿÿÿ +ÚÿÿÿüÿÿÿÚÿÿÿüÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +ÚÿÿÿÚÿÿÿ +êÿÿÿêÿÿÿ +êÿÿÿüÿÿÿêÿÿÿüÿÿÿ +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +êÿÿÿêÿÿÿ +úÿÿÿúÿÿÿ +üÿÿÿüÿÿÿ +  +úÿÿÿüÿÿÿúÿÿÿüÿÿÿ +úÿÿÿ úÿÿÿ þÿÿÿÚÿÿÿüÿÿÿöÿÿÿÚÿÿÿüÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿÚÿÿÿöÿÿÿÚÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿêÿÿÿüÿÿÿöÿÿÿêÿÿÿüÿÿÿþÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿêÿÿÿöÿÿÿêÿÿÿþÿÿÿúÿÿÿöÿÿÿúÿÿÿþÿÿÿüÿÿÿöÿÿÿüÿÿÿþÿÿÿ öÿÿÿ þÿÿÿúÿÿÿüÿÿÿöÿÿÿúÿÿÿüÿÿÿþÿÿÿúÿÿÿ öÿÿÿúÿÿÿ   + +   + +  +     ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmok \ No newline at end of file diff --git a/Apps/KeepAway/Load.CPP b/Apps/KeepAway/Load.HC similarity index 100% rename from Apps/KeepAway/Load.CPP rename to Apps/KeepAway/Load.HC diff --git a/Apps/KeepAway/Run.CPP b/Apps/KeepAway/Run.HC similarity index 100% rename from Apps/KeepAway/Run.CPP rename to Apps/KeepAway/Run.HC diff --git a/Apps/Logic/Load.CPP b/Apps/Logic/Load.HC similarity index 100% rename from Apps/Logic/Load.CPP rename to Apps/Logic/Load.HC diff --git a/Apps/Logic/Logic.CPP b/Apps/Logic/Logic.HC similarity index 100% rename from Apps/Logic/Logic.CPP rename to Apps/Logic/Logic.HC diff --git a/Apps/Logic/Run.CPP b/Apps/Logic/Run.HC similarity index 100% rename from Apps/Logic/Run.CPP rename to Apps/Logic/Run.HC diff --git a/Apps/Psalmody/Examples/childish.CPP b/Apps/Psalmody/Examples/childish.HC similarity index 100% rename from Apps/Psalmody/Examples/childish.CPP rename to Apps/Psalmody/Examples/childish.HC diff --git a/Apps/Psalmody/Examples/night.CPP b/Apps/Psalmody/Examples/night.HC similarity index 100% rename from Apps/Psalmody/Examples/night.CPP rename to Apps/Psalmody/Examples/night.HC diff --git a/Apps/Psalmody/Examples/prosper.CPP b/Apps/Psalmody/Examples/prosper.HC similarity index 100% rename from Apps/Psalmody/Examples/prosper.CPP rename to Apps/Psalmody/Examples/prosper.HC diff --git a/Apps/Psalmody/Help.DD b/Apps/Psalmody/Help.DD new file mode 100644 index 0000000..49b517a --- /dev/null +++ b/Apps/Psalmody/Help.DD @@ -0,0 +1,24 @@ +$WW,1$$FG,5$$TX+CX,"Psalmody Help"$$FG$ + +* The keyboard can be used as an organ by typing letter keys or clicking the mouse on the keyboard diagram$FG$. You can "record" notes by pressing the red button and typing letters. They will appear on the musical staff. You can edit and save them. + +* The clipboard can be used to cut and paste. + +* $FG,2$Psalmody$FG$ uses $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ files as the song format! See $LK,"::/Apps/Psalmody/Examples/prosper.HC"$. The $FG,2$Psalmody$FG$ program does not fully parse the songs when loading them back in, so changes made outside $FG,2$Psalmody$FG$ will be lost, like if you add graphics. + +* The first line of the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ song files is a comment with a category recognized by $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.HC,JukeBox"$(). The categories are $FG,2$"no nothing"$FG$, $FG,2$"has words"$FG$, $FG,2$"has graphics"$FG$, or $FG,2$"special"$FG$. The third character in the song comment is a digit rating number, shown in $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.HC,JukeBox"$(). You can set the song rating in $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.HC,JukeBox"$() by pressing $FG,2$0$FG$-$FG,2$9$FG$. You can press $FG,2$$FG$ to delete songs. + +* You can take the $LK,"Play",A="MN:Play"$() stmts out of a song file and place them in your programs. You can also add a song to a document with $FG,2$$FG$, but you should do it after pressing $FG,2$$FG$ because the clipboard-insert in $FG,2$$FG$ is screwy. See this $SO,"",A="2qG3ECB2eGG3qCeFDsBGBG2qG3ECB2eGG3qCeFDsBGBGqEeEFqEB2eG3FetCAGqFCEeEFqEB2eG3FetCAGqFC"$ after pressing $FG,2$$FG$, now. + +* You can call $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.HC,JukeBox"$("~/Psalmody"); to play your songs. + +* To create a $FG,2$.SND$FG$ file which can be exported and played under Windows, set the $FG,2$Bool$FG$ $LK,"snd.record",A="MN:CSndGlbls"$ to $FG,2$TRUE$FG$, play music, and set it to $FG,2$FALSE$FG$. Then, call $LK,"SndFileCreate",A="MN:SndFileCreate"$(). You might wish to make a $FG,2$$FG$ to toggle this system level recording feat. See $LK,"Snd",A="MN:Snd"$(). Add this code to your $LK,"~/HomeKeyPlugIns.HC"$ file. + +$FG,5$U0 CtrlAltR(I64) +{ + snd.record=!snd.record; +} +CtrlAltCBSet('R',&CtrlAltR,"Cmd /Toggle snd.record");$FG$ + +* When calling $LK,"SndFileCreate",A="MN:SndFileCreate"$() you can set a waveform. The PC speaker is $LK,"WF_SQUARE",A="MN:WF_SQUARE"$. You can sel reverb and averaging, also. + diff --git a/Apps/Psalmody/Help.TXT b/Apps/Psalmody/Help.TXT deleted file mode 100644 index c631032..0000000 --- a/Apps/Psalmody/Help.TXT +++ /dev/null @@ -1,24 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"Psalmody Help"$$FG$ - -* The keyboard can be used as an organ by typing letter keys or clicking the mouse on the keyboard diagram$FG$. You can "record" notes by pressing the red button and typing letters. They will appear on the musical staff. You can edit and save them. - -* The clipboard can be used to cut and paste. - -* $FG,2$Psalmody$FG$ uses $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ files as the song format! See $LK,"::/Apps/Psalmody/Examples/prosper.CPP"$. The $FG,2$Psalmody$FG$ program does not fully parse the songs when loading them back in, so changes made outside $FG,2$Psalmody$FG$ will be lost, like if you add graphics. - -* The first line of the $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ song files is a comment with a category recognized by $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.CPP,JukeBox"$(). The categories are $FG,2$"no nothing"$FG$, $FG,2$"has words"$FG$, $FG,2$"has graphics"$FG$, or $FG,2$"special"$FG$. The third character in the song comment is a digit rating number, shown in $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.CPP,JukeBox"$(). You can set the song rating in $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.CPP,JukeBox"$() by pressing $FG,2$0$FG$-$FG,2$9$FG$. You can press $FG,2$$FG$ to delete songs. - -* You can take the $LK,"Play",A="MN:Play"$() stmts out of a song file and place them in your programs. You can also add a song to a document with $FG,2$$FG$, but you should do it after pressing $FG,2$$FG$ because the clipboard-insert in $FG,2$$FG$ is screwy. See this $SO,"",A="2qG3ECB2eGG3qCeFDsBGBG2qG3ECB2eGG3qCeFDsBGBGqEeEFqEB2eG3FetCAGqFCEeEFqEB2eG3FetCAGqFC"$ after pressing $FG,2$$FG$, now. - -* You can call $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.CPP,JukeBox"$("~/Psalmody"); to play your songs. - -* To create a $FG,2$.SND$FG$ file which can be exported and played under Windows, set the $FG,2$Bool$FG$ $LK,"snd.record",A="MN:CSndGlbls"$ to $FG,2$TRUE$FG$, play music, and set it to $FG,2$FALSE$FG$. Then, call $LK,"SndFileCreate",A="MN:SndFileCreate"$(). You might wish to make a $FG,2$$FG$ to toggle this system level recording feat. See $LK,"Snd",A="MN:Snd"$(). Add this code to your $LK,"~/HomeKeyPlugIns.CPP"$ file. - -$FG,5$U0 CtrlAltR(I64) -{ - snd.record=!snd.record; -} -CtrlAltCBSet('R',&CtrlAltR,"Cmd /Toggle snd.record");$FG$ - -* When calling $LK,"SndFileCreate",A="MN:SndFileCreate"$() you can set a waveform. The PC speaker is $LK,"WF_SQUARE",A="MN:WF_SQUARE"$. You can sel reverb and averaging, also. - diff --git a/Apps/Psalmody/Install.CPP b/Apps/Psalmody/Install.HC similarity index 100% rename from Apps/Psalmody/Install.CPP rename to Apps/Psalmody/Install.HC diff --git a/Apps/Psalmody/JukeBox.CPP b/Apps/Psalmody/JukeBox.CPP deleted file mode 100644 index a580414..0000000 --- a/Apps/Psalmody/JukeBox.CPP +++ /dev/null @@ -1,138 +0,0 @@ -CTask *SingleSong(U8 *msg,U8 *name) -{ - CTask *task=Spawn(&SrvCmdLine,NULL,name,,Fs); - StrCpy(task->task_title,name); - task->title_src=TTS_LOCKED_CONST; - TaskExe(task,Fs,";",1<win_left,task->win_left+50,task); - WinVert(2,2+8,task); - TaskExe(task,NULL,msg,1<max_entries=100; - return task; -} - -#define JB_RUN_LEVEL_NULL 0 -#define JB_RUN_LEVEL_ONE 1 -#define JB_RUN_LEVEL_TWO 2 - -Bool JBPutKey(CDoc *doc,U8 *,I64 ch,I64 sc) -{//ch=ASCII; sc=scan_code - CDocEntry *doc_ce=doc->cur_entry,*doc_e; - CDirEntry *tempde; - CDoc *s; - if (!(sc&(SCF_ALT|SCF_CTRL|SCF_SHIFT)) - && doc_ce->type_u8==DOCT_MENU_VAL && doc_ce->left_exp>=0) { - tempde=doc_ce->left_exp; - if (sc.u8[0]==SC_DELETE ) { - Beep; - Silent; - Del(tempde->full_name); - Silent(OFF); - } else if ('0'<=ch<='9') { - if (StrLen(doc_ce->tag)>1) - doc_ce->tag[0]=ch; - s=DocRead(tempde->full_name); - doc_e=s->head.next; - while (doc_e!=s && doc_e->type_u8!=DOCT_TEXT) - doc_e=doc_e->next; - if (doc_e!=s && doc_e->type_u8==DOCT_TEXT && StrLen(doc_e->tag)>=3) { - doc_e->tag[2]=ch; - DocWrite(s); - } - DocDel(s); - return TRUE; - } else if (ch==CH_SPACE||ch==CH_ESC) - tempde->user_data++; //JB_RUN_LEVEL++ -// is followed by --> JB_RUN_LEVEL_TWO - //Actual just exits --> JB_RUN_LEVEL_ONE - } - return FALSE; -} - -public U0 JukeBox(U8 *dirname="~/Psalmody",U8 **_filename=NULL) -{//_filename is for using this as a song-chooser program. - I64 i=0,rating; - U8 *st,*st2; - CDirEntry *tempde,*tempde1; - CDoc *doc=DocNew,*s; - CDocEntry *doc_e; - CTask *task=NULL; - if (_filename) - *_filename=NULL; - dirname=StrNew(dirname); - st=MStrPrint("%s/*.CPP.Z",dirname); - tempde=tempde1=FilesFind(st); - Free(st); - Free(dirname); - doc->user_put_key=&JBPutKey; - DocPrint(doc, - "Key: $$GREEN$$Graphics $$BLUE$$Words $$RED$$No Nothing " - "$$BLACK$$Incomplete $$CYAN$$Special$$FG$$\n\n" - "$$GREEN$$$$FG$$ to delete a song.\n" - "Press a number to rate a song.\n"); - while (tempde) { - if (!(i++%5)) - DocPrint(doc,"\n"); - if (FileOcc("Play(",tempde->full_name,"")) { - st=StrNew(tempde->name); - FileExtRem(st); - s=DocRead(tempde->full_name); - doc_e=s->head.next; - while (doc_e!=s && doc_e->type_u8!=DOCT_TEXT) - doc_e=doc_e->next; - rating='0'; - if (doc_e!=s && doc_e->type_u8==DOCT_TEXT) { - if ('0'<=doc_e->tag[2]<='9') - rating=doc_e->tag[2]; - if (StrMatch("incomplete",doc_e->tag)) - DocPrint(doc,"$$BLACK$$"); - else if (StrMatch("has graphics",doc_e->tag)) - DocPrint(doc,"$$GREEN$$"); - else if (StrMatch("has words",doc_e->tag)) - DocPrint(doc,"$$BLUE$$"); - else if (StrMatch("special",doc_e->tag)) - DocPrint(doc,"$$CYAN$$"); - else if (StrMatch("no nothing",doc_e->tag)) { - DocPrint(doc,"$$RED$$"); - if (FileOcc("\\0",tempde->full_name,"")) { - s->cur_entry=doc_e->next; - s->cur_col=0; - DocEntryDel(s,doc_e); - DocPrint(s,"//0 has words\n"); - DocWrite(s); - } - } - DocPrint(doc,"$$MU-UL,\"%c%-8ts\",LE=%d$$ ",rating,st,tempde); - tempde->user_data=JB_RUN_LEVEL_NULL; - } - DocDel(s); - Free(st); - } - tempde=tempde->next; - } - DocPrint(doc,"\n$$CYAN$$$$MU-UL,\"DONE\",LE=%d$$\n",DOCM_CANCEL); - while (TRUE) { - if (_filename) - tempde=PopUpMenu(doc,DOF_INTERCEPT_TASK_END); - else - tempde=PopUpMenu(doc); - if (task) - Kill(task); - if (tempde<=0) break; - st2=StrNew(tempde->name); - if (_filename) { - Free(*_filename); - *_filename=StrNew(tempde->full_name); - } - if (tempde->user_data==JB_RUN_LEVEL_ONE) break; // - tempde->user_data=JB_RUN_LEVEL_NULL; //Rst from - FileExtRem(st2); - st=MStrPrint("ExeFile(\"%s\");",tempde->full_name); - MusicSettingsRst; - task=SingleSong(st,st2); - Free(st2); - Free(st); - } - DocDel(doc); - DirTreeDel(tempde1); -} diff --git a/Apps/Psalmody/JukeBox.HC b/Apps/Psalmody/JukeBox.HC new file mode 100644 index 0000000..19c8930 --- /dev/null +++ b/Apps/Psalmody/JukeBox.HC @@ -0,0 +1,138 @@ +CTask *SingleSong(U8 *msg,U8 *name) +{ + CTask *task=Spawn(&SrvCmdLine,NULL,name,,Fs); + StrCpy(task->task_title,name); + task->title_src=TTS_LOCKED_CONST; + TaskExe(task,Fs,";",1<win_left,task->win_left+50,task); + WinVert(2,2+8,task); + TaskExe(task,NULL,msg,1<max_entries=100; + return task; +} + +#define JB_RUN_LEVEL_NULL 0 +#define JB_RUN_LEVEL_ONE 1 +#define JB_RUN_LEVEL_TWO 2 + +Bool JBPutKey(CDoc *doc,U8 *,I64 ch,I64 sc) +{//ch=ASCII; sc=scan_code + CDocEntry *doc_ce=doc->cur_entry,*doc_e; + CDirEntry *tempde; + CDoc *s; + if (!(sc&(SCF_ALT|SCF_CTRL|SCF_SHIFT)) + && doc_ce->type_u8==DOCT_MENU_VAL && doc_ce->left_exp>=0) { + tempde=doc_ce->left_exp; + if (sc.u8[0]==SC_DELETE ) { + Beep; + Silent; + Del(tempde->full_name); + Silent(OFF); + } else if ('0'<=ch<='9') { + if (StrLen(doc_ce->tag)>1) + doc_ce->tag[0]=ch; + s=DocRead(tempde->full_name); + doc_e=s->head.next; + while (doc_e!=s && doc_e->type_u8!=DOCT_TEXT) + doc_e=doc_e->next; + if (doc_e!=s && doc_e->type_u8==DOCT_TEXT && StrLen(doc_e->tag)>=3) { + doc_e->tag[2]=ch; + DocWrite(s); + } + DocDel(s); + return TRUE; + } else if (ch==CH_SPACE||ch==CH_ESC) + tempde->user_data++; //JB_RUN_LEVEL++ +// is followed by --> JB_RUN_LEVEL_TWO + //Actual just exits --> JB_RUN_LEVEL_ONE + } + return FALSE; +} + +public U0 JukeBox(U8 *dirname="~/Psalmody",U8 **_filename=NULL) +{//_filename is for using this as a song-chooser program. + I64 i=0,rating; + U8 *st,*st2; + CDirEntry *tempde,*tempde1; + CDoc *doc=DocNew,*s; + CDocEntry *doc_e; + CTask *task=NULL; + if (_filename) + *_filename=NULL; + dirname=StrNew(dirname); + st=MStrPrint("%s/*.HC.Z",dirname); + tempde=tempde1=FilesFind(st); + Free(st); + Free(dirname); + doc->user_put_key=&JBPutKey; + DocPrint(doc, + "Key: $$GREEN$$Graphics $$BLUE$$Words $$RED$$No Nothing " + "$$BLACK$$Incomplete $$CYAN$$Special$$FG$$\n\n" + "$$GREEN$$$$FG$$ to delete a song.\n" + "Press a number to rate a song.\n"); + while (tempde) { + if (!(i++%5)) + DocPrint(doc,"\n"); + if (FileOcc("Play(",tempde->full_name,"")) { + st=StrNew(tempde->name); + FileExtRem(st); + s=DocRead(tempde->full_name); + doc_e=s->head.next; + while (doc_e!=s && doc_e->type_u8!=DOCT_TEXT) + doc_e=doc_e->next; + rating='0'; + if (doc_e!=s && doc_e->type_u8==DOCT_TEXT) { + if ('0'<=doc_e->tag[2]<='9') + rating=doc_e->tag[2]; + if (StrMatch("incomplete",doc_e->tag)) + DocPrint(doc,"$$BLACK$$"); + else if (StrMatch("has graphics",doc_e->tag)) + DocPrint(doc,"$$GREEN$$"); + else if (StrMatch("has words",doc_e->tag)) + DocPrint(doc,"$$BLUE$$"); + else if (StrMatch("special",doc_e->tag)) + DocPrint(doc,"$$CYAN$$"); + else if (StrMatch("no nothing",doc_e->tag)) { + DocPrint(doc,"$$RED$$"); + if (FileOcc("\\0",tempde->full_name,"")) { + s->cur_entry=doc_e->next; + s->cur_col=0; + DocEntryDel(s,doc_e); + DocPrint(s,"//0 has words\n"); + DocWrite(s); + } + } + DocPrint(doc,"$$MU-UL,\"%c%-8ts\",LE=%d$$ ",rating,st,tempde); + tempde->user_data=JB_RUN_LEVEL_NULL; + } + DocDel(s); + Free(st); + } + tempde=tempde->next; + } + DocPrint(doc,"\n$$CYAN$$$$MU-UL,\"DONE\",LE=%d$$\n",DOCM_CANCEL); + while (TRUE) { + if (_filename) + tempde=PopUpMenu(doc,DOF_INTERCEPT_TASK_END); + else + tempde=PopUpMenu(doc); + if (task) + Kill(task); + if (tempde<=0) break; + st2=StrNew(tempde->name); + if (_filename) { + Free(*_filename); + *_filename=StrNew(tempde->full_name); + } + if (tempde->user_data==JB_RUN_LEVEL_ONE) break; // + tempde->user_data=JB_RUN_LEVEL_NULL; //Rst from + FileExtRem(st2); + st=MStrPrint("ExeFile(\"%s\");",tempde->full_name); + MusicSettingsRst; + task=SingleSong(st,st2); + Free(st2); + Free(st); + } + DocDel(doc); + DirTreeDel(tempde1); +} diff --git a/Apps/Psalmody/JukePuppet.CPP b/Apps/Psalmody/JukePuppet.CPP deleted file mode 100644 index e701a26..0000000 --- a/Apps/Psalmody/JukePuppet.CPP +++ /dev/null @@ -1,91 +0,0 @@ -U0 SongPuppet(CTask *task,I64 passes) -{ - CDbgInfo *dbg_info; - I64 i,start,end,rip,last_rip; - CHashFun *tempf=NULL; - for (i=0;i<250 && TaskValidate(task);i++) { - if (tempf=HashFind("Song",task->hash_table,HTT_FUN)) - break; - Sleep(1); - } - if (tempf && (dbg_info=tempf->dbg_info)) { - start=dbg_info->body[0]; - end =dbg_info->body[dbg_info->max_line+1-dbg_info->min_line]; - last_rip=0; - while (TRUE) { - i=0; - while (TaskValidate(task) && (rip=TaskCaller(task,i++))) { - if (start<=rippopup_task)) - Sleep(10); - - TaskWait(juke_task->popup_task); - PostMsg(juke_task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP+SCF_CTRL); - TaskWait(juke_task->popup_task); - for (i=0;ipopup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); - TaskWait(juke_task->popup_task); - } - - PostMsg(juke_task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - TaskWait(juke_task->popup_task); - Sleep(500); - - found=FALSE; - task=Fs->next_task; - while (task!=Fs) { - if (!StrCmp(task->task_title,name)) { - found=TRUE; - break; - } - task=task->next_task; - } - - if (found) {//Position cursor on song title during song - TaskWait(juke_task->popup_task); - PostMsg(juke_task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP+SCF_CTRL); - TaskWait(juke_task->popup_task); - for (i=0;ipopup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); - TaskWait(juke_task->popup_task); - } - SongPuppet(task,passes); - } - Kill(task); -} - -public U0 JukeSongsPuppet(U8 *dirname="~/Psalmody",I64 passes=2, - I64 start_song=0,I64 end_song=MAX_I64) -{//Help make music video by puppeting JukeBox task. - I64 i; - CDirEntry *tempde,*tempde1; - CTask *juke_task=User("JukeBox(0x%X);\n",dirname); - Cd(dirname); - tempde1=FilesFind("*",FUF_RECURSE|FUF_JUST_TXT|FUF_JUST_FILES); - for (tempde=tempde1,i=0;tempde && inext; - for (i=start_song;tempde && iname); - tempde=tempde->next; - } - DirTreeDel(tempde1); - Kill(juke_task); -} diff --git a/Apps/Psalmody/JukePuppet.HC b/Apps/Psalmody/JukePuppet.HC new file mode 100644 index 0000000..0210e44 --- /dev/null +++ b/Apps/Psalmody/JukePuppet.HC @@ -0,0 +1,89 @@ +U0 SongPuppet(CTask *task,I64 passes) +{ + CDbgInfo *dbg_info; + I64 i,start,end,rip,last_rip; + CHashFun *tempf=NULL; + for (i=0;i<250 && TaskValidate(task);i++) { + if (tempf=HashFind("Song",task->hash_table,HTT_FUN)) + break; + Sleep(1); + } + if (tempf && (dbg_info=tempf->dbg_info)) { + start=dbg_info->body[0]; + end =dbg_info->body[dbg_info->max_line+1-dbg_info->min_line]; + last_rip=0; + while (TRUE) { + i=0; + while (TaskValidate(task) && (rip=TaskCaller(task,i++))) { + if (start<=rippopup_task); + TaskWait(juke_task->popup_task); + PostMsg(juke_task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP+SCF_CTRL); + TaskWait(juke_task->popup_task); + for (i=0;ipopup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); + TaskWait(juke_task->popup_task); + } + + PostMsg(juke_task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + TaskWait(juke_task->popup_task); + Sleep(500); + + found=FALSE; + task=Fs->next_task; + while (task!=Fs) { + if (!StrCmp(task->task_title,name)) { + found=TRUE; + break; + } + task=task->next_task; + } + + if (found) {//Position cursor on song title during song + TaskWait(juke_task->popup_task); + PostMsg(juke_task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP+SCF_CTRL); + TaskWait(juke_task->popup_task); + for (i=0;ipopup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); + TaskWait(juke_task->popup_task); + } + SongPuppet(task,passes); + } + Kill(task); +} + +public U0 JukeSongsPuppet(U8 *dirname="~/Psalmody",I64 passes=2, + I64 start_song=0,I64 end_song=MAX_I64) +{//Help make music video by puppeting JukeBox task. + I64 i; + CDirEntry *tempde,*tempde1; + CTask *juke_task=User("JukeBox(0x%X);\n",dirname); + Cd(dirname); + tempde1=FilesFind("*",FUF_RECURSE|FUF_JUST_TXT|FUF_JUST_FILES); + for (tempde=tempde1,i=0;tempde && inext; + for (i=start_song;tempde && iname); + tempde=tempde->next; + } + DirTreeDel(tempde1); + Kill(juke_task); +} diff --git a/Apps/Psalmody/Load.CPP b/Apps/Psalmody/Load.HC similarity index 100% rename from Apps/Psalmody/Load.CPP rename to Apps/Psalmody/Load.HC diff --git a/Apps/Psalmody/Psalmody.CPP b/Apps/Psalmody/Psalmody.HC similarity index 100% rename from Apps/Psalmody/Psalmody.CPP rename to Apps/Psalmody/Psalmody.HC diff --git a/Apps/Psalmody/PsalmodyCtrls.CPP b/Apps/Psalmody/PsalmodyCtrls.HC similarity index 100% rename from Apps/Psalmody/PsalmodyCtrls.CPP rename to Apps/Psalmody/PsalmodyCtrls.HC diff --git a/Apps/Psalmody/PsalmodyDraw.CPP b/Apps/Psalmody/PsalmodyDraw.HC similarity index 100% rename from Apps/Psalmody/PsalmodyDraw.CPP rename to Apps/Psalmody/PsalmodyDraw.HC diff --git a/Apps/Psalmody/PsalmodyFile.CPP b/Apps/Psalmody/PsalmodyFile.CPP deleted file mode 100644 index 91a5165..0000000 --- a/Apps/Psalmody/PsalmodyFile.CPP +++ /dev/null @@ -1,435 +0,0 @@ -U0 PsmNoteDel(PsmNote *tempo) -{ - Free(tempo->word); - Free(tempo); -} - -PsmNote *PsmNoteCopy(PsmNote *tempo) -{ - PsmNote *tempo1=MAllocIdent(tempo); - if (tempo->word) - tempo1->word=StrNew(tempo->word); - else - tempo1->word=NULL; - return tempo1; -} - -U0 PsmSongDel(PsmNote *head) -{ - PsmNote *tempo,*tempo1; - tempo=head->next; - while (tempo!=head) { - tempo1=tempo->next; - PsmNoteDel(tempo); - tempo=tempo1; - } - QueInit(head); -} - -U0 PsmCutToClipboard() -{ - PsmNote *tempo,*tempo1; - PsmSongDel(&oc.clipboard); - tempo=oc.head.next; - while (tempo!=&oc.head) { - tempo1=tempo->next; - if (tempo->flags&PSMF_SEL) { - if (oc.cur_note==tempo) - oc.cur_note=tempo->next; - QueRem(tempo); - tempo->flags&=~PSMF_SEL; - QueIns(tempo,oc.clipboard.last); - } - tempo=tempo1; - } -} - -U0 PsmPasteClipboard() -{ - PsmNote *tempo,*tempo1; - tempo=oc.clipboard.next; - while (tempo!=&oc.clipboard) { - tempo1=PsmNoteCopy(tempo); - QueIns(tempo1,oc.cur_note->last); - tempo=tempo->next; - } -} - -U0 PsmCopyToClipboard() -{ - PsmNote *tempo,*tempo1; - PsmSongDel(&oc.clipboard); - tempo=oc.head.next; - while (tempo!=&oc.head) { - if (tempo->flags&PSMF_SEL) { - tempo->flags&=~PSMF_SEL; - tempo1=PsmNoteCopy(tempo); - QueIns(tempo1,oc.clipboard.last); - } - tempo=tempo->next; - } -} - -PsmNote *PsmFindNote(I64 x,I64) -{ - PsmNote *tempo=oc.head.next; - PsmRecalcNoteXY; - x+=PSM_NOTE_SPACING/2; - while (x>tempo->next->x && tempo!=&oc.head) - tempo=tempo->next; - return tempo; -} - -U8 *PsmMusicSetOctave(U8 *st,I64 *psm_octave) -{ - while ('0'<=*st<='9') - *psm_octave=*st++ -'0'; - return st; -} - -U8 *PsmMusicSetNoteLen(U8 *st,F64 *psm_duration) -{ - Bool cont=TRUE; - do { - switch (*st++) { - case 'w': *psm_duration=4.0; break; - case 'h': *psm_duration=2.0; break; - case 'q': *psm_duration=1.0; break; - case 'e': *psm_duration=0.5; break; - case 's': *psm_duration=0.25; break; - case 't': *psm_duration=2.0* *psm_duration/3.0; break; - case '.': *psm_duration=1.5* *psm_duration; break; - default: - st--; - cont=FALSE; - } - } while (cont); - return st; -} - -U0 PsmLoadSongStr(U8 *st,I64 *psm_octave,F64 *psm_duration) -{ - PsmNote *tempo,*tempo1; - I64 note,i=0; - while (*st) { - tempo=CAlloc(sizeof(PsmNote)); - while (*st && !('A'<=*st<='G') && *st!='R') { - if (*st=='M') { - tempo1=CAlloc(sizeof(PsmNote)); - tempo1->type=PSMT_METER; - st++; - if ('1'<=*st<='9') - tempo1->meter_top=*st++-'0'; - else - tempo1->meter_top=4; - if (*st=='/') - st++; - if ('1'<=*st<='9') - tempo1->meter_bottom=*st++-'0'; - else - tempo1->meter_bottom=4; - PsmSetWidth(tempo1); - QueIns(tempo1,oc.head.last); - } - while (*st=='(') { - Bts(&tempo->flags,PSMf_TIE); - st++; - } - st=PsmMusicSetOctave(st,psm_octave); - st=PsmMusicSetNoteLen(st,psm_duration); - } - if (!*st) { - PsmNoteDel(tempo); - break; - } - note=*st++-'A'; - if (note<7) { - note=music.note_map[note]; - if (*st=='b') { - Bts(&tempo->flags,PSMf_FLAT); - note--; - st++; - } else if (*st=='#') { - Bts(&tempo->flags,PSMf_SHARP); - note++; - st++; - } - if (note<0) { - note=11; - *psm_octave-=1; - } else if (note>11) { - note=0; - *psm_octave+=1; - } - tempo->note=note; - tempo->octave=*psm_octave; - } else { - tempo->note=NOTE_REST; - tempo->octave=OCTAVE_REST; - } - if (*psm_duration<=2*.25/3) - i=0; - else if (*psm_duration<=.25) - i=1; - else if (*psm_duration<=2*.5/3) - i=2; - else if (*psm_duration<=.5) - i=3; - else if (*psm_duration<=2.0/3) - i=4; - else if (*psm_duration<=.5*1.5) - i=5; - else if (*psm_duration<=1.0) - i=6; - else if (*psm_duration<=1.5) - i=7; - else if (*psm_duration<=2.0) - i=8; - else if (*psm_duration<=3.0) - i=9; - else if (*psm_duration<=4.0) - i=10; - else - i=11; - tempo->duration=i; - tempo->type=PSMT_NOTE; - PsmSetWidth(tempo); - QueIns(tempo,oc.cur_note->last); - } -} - -U0 PsmLoadSong(U8 *filename,I64 *psm_octave,F64 *psm_duration) -{ - U8 *st; - PsmNote *tempo; - CCmpCtrl *cc=CmpCtrlNew(MStrPrint("#include \"%s\"",filename)); - if (FileOcc("incomplete",filename,"")) - oc.incomplete_entry->checked=TRUE; - else - oc.incomplete_entry->checked=FALSE; - while (Lex(cc)) { - if (cc->token==TK_IDENT) - if (!StrCmp(cc->cur_str,"Play")) { - if (Lex(cc)=='(') - if (Lex(cc)==TK_STR) { - tempo=oc.head.last; - st=LexExtStr(cc); - PsmLoadSongStr(st,psm_octave,psm_duration); - if (cc->token==',') { - if (Lex(cc)==TK_STR) { - st=LexExtStr(cc); - do { - do tempo=tempo->next; - while (tempo!=&oc.head && tempo->type==PSMT_METER); - if (tempo!=&oc.head) - tempo->word=StrNew(st); - st+=StrLen(st)+1; - } while (*st); - } - } - } - } else if (!StrCmp(cc->cur_str,"music") && - Lex(cc)=='.' && Lex(cc)==TK_IDENT) { - if (!StrCmp(cc->cur_str,"tempo")) { - if (Lex(cc)=='=' && Lex(cc)==TK_F64) { - music.tempo=cc->cur_f64-0.0005; - tempo_state.tempo=Round(TEMPO_RANGE*(music.tempo-0.5)/4.4); - } - } else if (!StrCmp(cc->cur_str,"stacatto_factor")) { - if (Lex(cc)=='=' && Lex(cc)==TK_F64) { - music.stacatto_factor=cc->cur_f64-0.0005; - tempo_state.stacatto= - Round(TEMPO_RANGE*(music.stacatto_factor-0.12)/0.88); - } - } - } - } - CmpCtrlDel(cc); -} - -U8 *PsmCvtSong() -{ - PsmNote *tempo; - U8 *st,*src,*dst; - I64 i,note,octave,last_octave,last_duration; - - i=0; - tempo=oc.head.next; - last_octave=OCTAVE_REST; - last_duration=-1; - while (tempo!=&oc.head) { - dst=&tempo->ascii; - if (tempo->type==PSMT_METER) { - *dst++='M'; - *dst++=tempo->meter_top+'0'; - *dst++='/'; - *dst++=tempo->meter_bottom+'0'; - } else { - octave=tempo->octave; - note=tempo->note; - if (note!=NOTE_REST) { - if (Bt(&tempo->flags,PSMf_SHARP)) - note--; - if (Bt(&tempo->flags,PSMf_FLAT)) - note++; - if (note<0) { - note=11; - octave--; - } else if (note>11) { - note=0; - octave++; - } - note=music.note_map[*LstSub(note,psm_note_lst)-'A']; - } - if (Bt(&tempo->flags,PSMf_TIE)) - *dst++='('; - if (octave!=last_octave && note!=NOTE_REST) { - *dst++=octave+'0'; - last_octave=octave; - } - if (tempo->duration!=last_duration) { - src=LstSub(tempo->duration,psm_duration_lst); - *dst++=src[0]; - if (src[1]) - *dst++=src[1]; - last_duration=tempo->duration; - } - if (note!=NOTE_REST) { - src=LstSub(note,psm_note_lst); - *dst++=src[0]; - if (src[1]) - *dst++=src[1]; - else if (Bt(&tempo->flags,PSMf_FLAT)) - *dst++='b'; - else if (Bt(&tempo->flags,PSMf_SHARP)) - *dst++='#'; - } else - *dst++='R'; - } - *dst++=0; - i+=StrLen(tempo->ascii); - tempo=tempo->next; - } - - st=MAlloc(i+1); - dst=st; - tempo=oc.head.next; - while (tempo!=&oc.head) { - StrCpy(dst,tempo->ascii); - dst+=StrLen(tempo->ascii); - tempo=tempo->next; - } - *dst++=0; - return st; -} - -U8 *PsmSaveSong(U8 *dirname,U8 *full_filename) -{ - CDoc *doc=DocNew(full_filename); - Bool has_words; - PsmNote *tempo,*tempo1; - F64 measure_len=4,two_measure_left=2*measure_len; - I64 ch; - U8 *ptr; - - Free(PsmCvtSong); //set tempo->ascii; - - music.tempo=4.4*tempo_state.tempo/TEMPO_RANGE+0.5; - music.stacatto_factor=0.88*tempo_state.stacatto/TEMPO_RANGE+0.12; - - has_words=FALSE; - tempo=oc.head.next; - while (tempo!=&oc.head) { - if (PsmHasWords(tempo->word)) has_words=TRUE; - tempo=tempo->next; - } - if (oc.incomplete_entry->checked) - DocPrint(doc,"//0 incomplete\n"); - else if (has_words) - DocPrint(doc,"//0 has words\n"); - else - DocPrint(doc,"//0 no nothing\n"); - - DocPrint(doc, - "U0 Song()\n" - "{\n" - " Fs->task_end_cb=&SndTaskEndCB;\n" - " MusicSettingsRst;\n" - " music.tempo=%6.3f;\n" - " music.stacatto_factor=%6.3f;\n" - " try {\n" - " while (!ScanKey) {\n" - "\tPlay(\"",music.tempo+0.0005,music.stacatto_factor+0.0005); - - tempo=oc.head.next; - tempo1=tempo; - has_words=FALSE; - while (tempo!=&oc.head) { - DocPrint(doc,"%s",tempo->ascii); - if (PsmHasWords(tempo->word)) has_words=TRUE; - if (tempo->type==PSMT_METER) { - measure_len=tempo->meter_top*4.0/tempo->meter_bottom; - two_measure_left=0; - } else - two_measure_left-=psm_durations[tempo->duration]; - tempo=tempo->next; - if (two_measure_left<0.001 && tempo!=&oc.head) { - if (has_words) { - DocPrint(doc,"\",\n\t\t\""); - while (tempo1!=tempo) { - if (tempo1->type!=PSMT_METER) { - if (ptr=tempo1->word) { - while (ch=*ptr) { - if (ch==CH_SPACE) - *ptr=CH_SHIFT_SPACE; - ptr++; - } - DocPrint(doc,"%Q\\0",tempo1->word); - } else - DocPrint(doc,"%c\\0",CH_SHIFT_SPACE); - } - tempo1=tempo1->next; - } - } - DocPrint(doc,"\");\n" - "\tPlay(\""); - two_measure_left=2*measure_len; - tempo1=tempo; - has_words=FALSE; - } - } - if (has_words) { - DocPrint(doc,"\",\n\t\t\""); - while (tempo1!=tempo) { - if (tempo1->type!=PSMT_METER) { - if (ptr=tempo1->word) { - while (ch=*ptr) { - if (ch==CH_SPACE) - *ptr=CH_SHIFT_SPACE; - ptr++; - } - DocPrint(doc,"%Q\\0",tempo1->word); - } else - DocPrint(doc,"%c\\0",CH_SHIFT_SPACE); - } - tempo1=tempo1->next; - } - } - DocPrint(doc,"\");\n" - " }\n" - " } catch\n" - " PutExcept;\n" - " Snd(0);\n" - "}\n" - "\n" - "Song;\n"); - DocRecalc(doc); - if (full_filename) - Free(full_filename); - else - StrPrint(doc->filename.name,"%s/Temp.CPP.Z",dirname); - DocWrite(doc,TRUE); - full_filename=StrNew(doc->filename.name); - DocDel(doc); - return full_filename; -} diff --git a/Apps/Psalmody/PsalmodyFile.HC b/Apps/Psalmody/PsalmodyFile.HC new file mode 100644 index 0000000..9cc6d23 --- /dev/null +++ b/Apps/Psalmody/PsalmodyFile.HC @@ -0,0 +1,435 @@ +U0 PsmNoteDel(PsmNote *tempo) +{ + Free(tempo->word); + Free(tempo); +} + +PsmNote *PsmNoteCopy(PsmNote *tempo) +{ + PsmNote *tempo1=MAllocIdent(tempo); + if (tempo->word) + tempo1->word=StrNew(tempo->word); + else + tempo1->word=NULL; + return tempo1; +} + +U0 PsmSongDel(PsmNote *head) +{ + PsmNote *tempo,*tempo1; + tempo=head->next; + while (tempo!=head) { + tempo1=tempo->next; + PsmNoteDel(tempo); + tempo=tempo1; + } + QueInit(head); +} + +U0 PsmCutToClipboard() +{ + PsmNote *tempo,*tempo1; + PsmSongDel(&oc.clipboard); + tempo=oc.head.next; + while (tempo!=&oc.head) { + tempo1=tempo->next; + if (tempo->flags&PSMF_SEL) { + if (oc.cur_note==tempo) + oc.cur_note=tempo->next; + QueRem(tempo); + tempo->flags&=~PSMF_SEL; + QueIns(tempo,oc.clipboard.last); + } + tempo=tempo1; + } +} + +U0 PsmPasteClipboard() +{ + PsmNote *tempo,*tempo1; + tempo=oc.clipboard.next; + while (tempo!=&oc.clipboard) { + tempo1=PsmNoteCopy(tempo); + QueIns(tempo1,oc.cur_note->last); + tempo=tempo->next; + } +} + +U0 PsmCopyToClipboard() +{ + PsmNote *tempo,*tempo1; + PsmSongDel(&oc.clipboard); + tempo=oc.head.next; + while (tempo!=&oc.head) { + if (tempo->flags&PSMF_SEL) { + tempo->flags&=~PSMF_SEL; + tempo1=PsmNoteCopy(tempo); + QueIns(tempo1,oc.clipboard.last); + } + tempo=tempo->next; + } +} + +PsmNote *PsmFindNote(I64 x,I64) +{ + PsmNote *tempo=oc.head.next; + PsmRecalcNoteXY; + x+=PSM_NOTE_SPACING/2; + while (x>tempo->next->x && tempo!=&oc.head) + tempo=tempo->next; + return tempo; +} + +U8 *PsmMusicSetOctave(U8 *st,I64 *psm_octave) +{ + while ('0'<=*st<='9') + *psm_octave=*st++ -'0'; + return st; +} + +U8 *PsmMusicSetNoteLen(U8 *st,F64 *psm_duration) +{ + Bool cont=TRUE; + do { + switch (*st++) { + case 'w': *psm_duration=4.0; break; + case 'h': *psm_duration=2.0; break; + case 'q': *psm_duration=1.0; break; + case 'e': *psm_duration=0.5; break; + case 's': *psm_duration=0.25; break; + case 't': *psm_duration=2.0* *psm_duration/3.0; break; + case '.': *psm_duration=1.5* *psm_duration; break; + default: + st--; + cont=FALSE; + } + } while (cont); + return st; +} + +U0 PsmLoadSongStr(U8 *st,I64 *psm_octave,F64 *psm_duration) +{ + PsmNote *tempo,*tempo1; + I64 note,i=0; + while (*st) { + tempo=CAlloc(sizeof(PsmNote)); + while (*st && !('A'<=*st<='G') && *st!='R') { + if (*st=='M') { + tempo1=CAlloc(sizeof(PsmNote)); + tempo1->type=PSMT_METER; + st++; + if ('1'<=*st<='9') + tempo1->meter_top=*st++-'0'; + else + tempo1->meter_top=4; + if (*st=='/') + st++; + if ('1'<=*st<='9') + tempo1->meter_bottom=*st++-'0'; + else + tempo1->meter_bottom=4; + PsmSetWidth(tempo1); + QueIns(tempo1,oc.head.last); + } + while (*st=='(') { + Bts(&tempo->flags,PSMf_TIE); + st++; + } + st=PsmMusicSetOctave(st,psm_octave); + st=PsmMusicSetNoteLen(st,psm_duration); + } + if (!*st) { + PsmNoteDel(tempo); + break; + } + note=*st++-'A'; + if (note<7) { + note=music.note_map[note]; + if (*st=='b') { + Bts(&tempo->flags,PSMf_FLAT); + note--; + st++; + } else if (*st=='#') { + Bts(&tempo->flags,PSMf_SHARP); + note++; + st++; + } + if (note<0) { + note=11; + *psm_octave-=1; + } else if (note>11) { + note=0; + *psm_octave+=1; + } + tempo->note=note; + tempo->octave=*psm_octave; + } else { + tempo->note=NOTE_REST; + tempo->octave=OCTAVE_REST; + } + if (*psm_duration<=2*.25/3) + i=0; + else if (*psm_duration<=.25) + i=1; + else if (*psm_duration<=2*.5/3) + i=2; + else if (*psm_duration<=.5) + i=3; + else if (*psm_duration<=2.0/3) + i=4; + else if (*psm_duration<=.5*1.5) + i=5; + else if (*psm_duration<=1.0) + i=6; + else if (*psm_duration<=1.5) + i=7; + else if (*psm_duration<=2.0) + i=8; + else if (*psm_duration<=3.0) + i=9; + else if (*psm_duration<=4.0) + i=10; + else + i=11; + tempo->duration=i; + tempo->type=PSMT_NOTE; + PsmSetWidth(tempo); + QueIns(tempo,oc.cur_note->last); + } +} + +U0 PsmLoadSong(U8 *filename,I64 *psm_octave,F64 *psm_duration) +{ + U8 *st; + PsmNote *tempo; + CCmpCtrl *cc=CmpCtrlNew(MStrPrint("#include \"%s\"",filename)); + if (FileOcc("incomplete",filename,"")) + oc.incomplete_entry->checked=TRUE; + else + oc.incomplete_entry->checked=FALSE; + while (Lex(cc)) { + if (cc->token==TK_IDENT) + if (!StrCmp(cc->cur_str,"Play")) { + if (Lex(cc)=='(') + if (Lex(cc)==TK_STR) { + tempo=oc.head.last; + st=LexExtStr(cc); + PsmLoadSongStr(st,psm_octave,psm_duration); + if (cc->token==',') { + if (Lex(cc)==TK_STR) { + st=LexExtStr(cc); + do { + do tempo=tempo->next; + while (tempo!=&oc.head && tempo->type==PSMT_METER); + if (tempo!=&oc.head) + tempo->word=StrNew(st); + st+=StrLen(st)+1; + } while (*st); + } + } + } + } else if (!StrCmp(cc->cur_str,"music") && + Lex(cc)=='.' && Lex(cc)==TK_IDENT) { + if (!StrCmp(cc->cur_str,"tempo")) { + if (Lex(cc)=='=' && Lex(cc)==TK_F64) { + music.tempo=cc->cur_f64-0.0005; + tempo_state.tempo=Round(TEMPO_RANGE*(music.tempo-0.5)/4.4); + } + } else if (!StrCmp(cc->cur_str,"stacatto_factor")) { + if (Lex(cc)=='=' && Lex(cc)==TK_F64) { + music.stacatto_factor=cc->cur_f64-0.0005; + tempo_state.stacatto= + Round(TEMPO_RANGE*(music.stacatto_factor-0.12)/0.88); + } + } + } + } + CmpCtrlDel(cc); +} + +U8 *PsmCvtSong() +{ + PsmNote *tempo; + U8 *st,*src,*dst; + I64 i,note,octave,last_octave,last_duration; + + i=0; + tempo=oc.head.next; + last_octave=OCTAVE_REST; + last_duration=-1; + while (tempo!=&oc.head) { + dst=&tempo->ascii; + if (tempo->type==PSMT_METER) { + *dst++='M'; + *dst++=tempo->meter_top+'0'; + *dst++='/'; + *dst++=tempo->meter_bottom+'0'; + } else { + octave=tempo->octave; + note=tempo->note; + if (note!=NOTE_REST) { + if (Bt(&tempo->flags,PSMf_SHARP)) + note--; + if (Bt(&tempo->flags,PSMf_FLAT)) + note++; + if (note<0) { + note=11; + octave--; + } else if (note>11) { + note=0; + octave++; + } + note=music.note_map[*LstSub(note,psm_note_lst)-'A']; + } + if (Bt(&tempo->flags,PSMf_TIE)) + *dst++='('; + if (octave!=last_octave && note!=NOTE_REST) { + *dst++=octave+'0'; + last_octave=octave; + } + if (tempo->duration!=last_duration) { + src=LstSub(tempo->duration,psm_duration_lst); + *dst++=src[0]; + if (src[1]) + *dst++=src[1]; + last_duration=tempo->duration; + } + if (note!=NOTE_REST) { + src=LstSub(note,psm_note_lst); + *dst++=src[0]; + if (src[1]) + *dst++=src[1]; + else if (Bt(&tempo->flags,PSMf_FLAT)) + *dst++='b'; + else if (Bt(&tempo->flags,PSMf_SHARP)) + *dst++='#'; + } else + *dst++='R'; + } + *dst++=0; + i+=StrLen(tempo->ascii); + tempo=tempo->next; + } + + st=MAlloc(i+1); + dst=st; + tempo=oc.head.next; + while (tempo!=&oc.head) { + StrCpy(dst,tempo->ascii); + dst+=StrLen(tempo->ascii); + tempo=tempo->next; + } + *dst++=0; + return st; +} + +U8 *PsmSaveSong(U8 *dirname,U8 *full_filename) +{ + CDoc *doc=DocNew(full_filename); + Bool has_words; + PsmNote *tempo,*tempo1; + F64 measure_len=4,two_measure_left=2*measure_len; + I64 ch; + U8 *ptr; + + Free(PsmCvtSong); //set tempo->ascii; + + music.tempo=4.4*tempo_state.tempo/TEMPO_RANGE+0.5; + music.stacatto_factor=0.88*tempo_state.stacatto/TEMPO_RANGE+0.12; + + has_words=FALSE; + tempo=oc.head.next; + while (tempo!=&oc.head) { + if (PsmHasWords(tempo->word)) has_words=TRUE; + tempo=tempo->next; + } + if (oc.incomplete_entry->checked) + DocPrint(doc,"//0 incomplete\n"); + else if (has_words) + DocPrint(doc,"//0 has words\n"); + else + DocPrint(doc,"//0 no nothing\n"); + + DocPrint(doc, + "U0 Song()\n" + "{\n" + " Fs->task_end_cb=&SndTaskEndCB;\n" + " MusicSettingsRst;\n" + " music.tempo=%6.3f;\n" + " music.stacatto_factor=%6.3f;\n" + " try {\n" + " while (!ScanKey) {\n" + "\tPlay(\"",music.tempo+0.0005,music.stacatto_factor+0.0005); + + tempo=oc.head.next; + tempo1=tempo; + has_words=FALSE; + while (tempo!=&oc.head) { + DocPrint(doc,"%s",tempo->ascii); + if (PsmHasWords(tempo->word)) has_words=TRUE; + if (tempo->type==PSMT_METER) { + measure_len=tempo->meter_top*4.0/tempo->meter_bottom; + two_measure_left=0; + } else + two_measure_left-=psm_durations[tempo->duration]; + tempo=tempo->next; + if (two_measure_left<0.001 && tempo!=&oc.head) { + if (has_words) { + DocPrint(doc,"\",\n\t\t\""); + while (tempo1!=tempo) { + if (tempo1->type!=PSMT_METER) { + if (ptr=tempo1->word) { + while (ch=*ptr) { + if (ch==CH_SPACE) + *ptr=CH_SHIFT_SPACE; + ptr++; + } + DocPrint(doc,"%Q\\0",tempo1->word); + } else + DocPrint(doc,"%c\\0",CH_SHIFT_SPACE); + } + tempo1=tempo1->next; + } + } + DocPrint(doc,"\");\n" + "\tPlay(\""); + two_measure_left=2*measure_len; + tempo1=tempo; + has_words=FALSE; + } + } + if (has_words) { + DocPrint(doc,"\",\n\t\t\""); + while (tempo1!=tempo) { + if (tempo1->type!=PSMT_METER) { + if (ptr=tempo1->word) { + while (ch=*ptr) { + if (ch==CH_SPACE) + *ptr=CH_SHIFT_SPACE; + ptr++; + } + DocPrint(doc,"%Q\\0",tempo1->word); + } else + DocPrint(doc,"%c\\0",CH_SHIFT_SPACE); + } + tempo1=tempo1->next; + } + } + DocPrint(doc,"\");\n" + " }\n" + " } catch\n" + " PutExcept;\n" + " Snd(0);\n" + "}\n" + "\n" + "Song;\n"); + DocRecalc(doc); + if (full_filename) + Free(full_filename); + else + StrPrint(doc->filename.name,"%s/Temp.HC.Z",dirname); + DocWrite(doc,TRUE); + full_filename=StrNew(doc->filename.name); + DocDel(doc); + return full_filename; +} diff --git a/Apps/Psalmody/PsalmodyMain.CPP b/Apps/Psalmody/PsalmodyMain.CPP deleted file mode 100644 index b0d6ac1..0000000 --- a/Apps/Psalmody/PsalmodyMain.CPP +++ /dev/null @@ -1,874 +0,0 @@ -#define PSMR_FLAT -8 -#define PSMR_SHARP -7 -#define PSMR_TIE -6 -#define PSMR_REST -5 -#define PSMR_INS_NOTE -4 -#define PSMR_DELETE_NOTE -3 -#define PSMR_SET_WORD -2 - -F64 PopUpDuration() -{ - I64 i; - CDoc *doc=DocNew; - DocPrint(doc,"$$GREEN$$$$MU,\"Set Word\",LE=PSMR_SET_WORD$$\n" - "$$MU,\"Toggle Sharp\",LE=PSMR_SHARP$$\n" - "$$MU,\"Toggle Flat\",LE=PSMR_FLAT$$\n" - "$$MU,\"Toggle Tie\",LE=PSMR_TIE$$\n" - "$$MU,\"Make Rest\",LE=PSMR_REST$$\n" - "$$MU,\"Insert Note\",LE=PSMR_INS_NOTE$$\n" - "$$MU,\"Delete Note\",LE=PSMR_DELETE_NOTE$$\n\n"); - for (i=0;iflags; - oc.cur_note=tempo=PsmFindNote(x,y); - if (tempo!=&oc.head) { - Fs->win_inhibit=WIG_USER_TASK_DFT; - i=PopUpDuration; - if (0<=itype==PSMT_NOTE) - tempo->duration=i; - } else { - switch (i) { - case PSMR_REST: - if (tempo->type==PSMT_NOTE) { - tempo->octave=OCTAVE_REST; - tempo->note=NOTE_REST; - } - break; - case PSMR_SHARP: - if (tempo->type==PSMT_NOTE && tempo->octave!=OCTAVE_REST) { - if (Btr(&tempo->flags,PSMf_FLAT)) - tempo->note++; - if (Btc(&tempo->flags,PSMf_SHARP)) - tempo->note--; - else - tempo->note++; - if (tempo->note<0) { - tempo->note=11; - tempo->octave--; - } else if (tempo->note>11) { - tempo->note=0; - tempo->octave++; - } - } - break; - case PSMR_FLAT: - if (tempo->type==PSMT_NOTE && tempo->octave!=OCTAVE_REST) { - if (Btr(&tempo->flags,PSMf_SHARP)) - tempo->note--; - if (Btc(&tempo->flags,PSMf_FLAT)) - tempo->note++; - else - tempo->note--; - if (tempo->note<0) { - tempo->note=11; - tempo->octave--; - } else if (tempo->note>11) { - tempo->note=0; - tempo->octave++; - } - } - break; - case PSMR_TIE: - if (tempo->type==PSMT_NOTE) - Btc(&tempo->flags,PSMf_TIE); - break; - case PSMR_SET_WORD: - if (tempo->type==PSMT_NOTE) { - if (DocPut) DocPut->flags&=~DOCF_FORM; - if (PsmHasWords(tempo->word)) - st2=MStrPrint("\nWord(\"%Q\"):",tempo->word); - else - st2=MStrPrint("\nWord(\"\"):"); - DocBottom; - st=GetStr(st2); - Free(st2); - Free(tempo->word); - if (*st) { - tempo->word=MStrPrint("%q",st); - Free(st); - } else - tempo->word=StrNew(" "); - if (DocPut) DocPut->flags=DocPut->flags& - ~DOCF_FORM|old_doc_flags&DOCF_FORM; - } - break; - case PSMR_INS_NOTE: - tempo1=PsmNoteCopy(tempo); - QueIns(tempo1,tempo); - break; - case PSMR_DELETE_NOTE: - oc.cur_note=tempo->next; - QueRem(tempo); - PsmNoteDel(tempo); - break; - } - } - PsmSetWidth(oc.cur_note); - Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS - -WIF_SELF_BORDER-WIF_FOCUS_TASK_MENU-WIF_SELF_CTRLS; - } -} - -U0 PsmLeftClickPickNoteBox(I64 duration) -{ - I64 o,n,msg_code,a1,a2; - PsmNote *tempo,*tempo1; - do { - msg_code=GetMsg(&a1,&a2,1<oc.head.last->x) - tempo1=oc.head.last; - else if (a1x) - tempo1=&oc.head; - else - tempo1=PsmFindNote(a1-PSM_NOTE_SPACING/2,a2); - tempo=CAlloc(sizeof(PsmNote)); - tempo->type=PSMT_NOTE; - a2=a2/4-15; - n=-a2%7; - o=2+a2/-7; - n=-n; - if (n<0) { - n+=7; - o++; - } - n=psm_note_inverse_map[n]; - tempo->note=n; - tempo->octave=o; - tempo->duration=duration; - PsmSetWidth(tempo); - QueIns(tempo,tempo1); - oc.cur_note=tempo->next; - } - DrawDC2; -} - -U0 PsmLeftClickPickMeterBox(I64 top,I64 bottom) -{ - I64 msg_code,a1,a2; - PsmNote *tempo,*tempo1; - do { - msg_code=GetMsg(&a1,&a2,1<=oc.head.x) - tempo1=oc.head.last; - else if (a1x) - tempo1=&oc.head; - else - tempo1=PsmFindNote(a1-PSM_NOTE_SPACING/2,a2); - tempo=CAlloc(sizeof(PsmNote)); - tempo->type=PSMT_METER; - tempo->meter_top=top; - tempo->meter_bottom=bottom; - PsmSetWidth(tempo); - QueIns(tempo,tempo1); - oc.cur_note=tempo->next; - } - DrawDC2; -} - -U0 PsmLeftClickStaffPtr(I64 x,I64 y) -{ - PsmNote *tempo,*tempo1; - I64 o,n,msg_code,a1,a2,n_original,o_original; - oc.cur_note=tempo=PsmFindNote(x,y); - if (tempo!=&oc.head) { - if (tempo->type==PSMT_NOTE) { - n_original=tempo->note; - o_original=tempo->octave; - do { - msg_code=GetMsg(&a1,&a2,1<word); - tempo1->word=tempo->word; - tempo->word=NULL; - tempo->note=n_original; - tempo->octave=o_original; - } - } else { -move_note: - a2=a2/4-15; - n=-a2%7; - o=2+a2/-7; - n=-n; - if (n<0) { - n+=7; - o++; - } - n=psm_note_inverse_map[n]; - tempo->note=n; - tempo->octave=o; - } - } while (msg_code!=MSG_IP_L_UP); - PsmSetWidth(tempo); - } - } -} - -U0 PsmLeftClickStaffBox(I64 x,I64 y) -{ - I64 msg_code,a1,a2; - do { - msg_code=GetMsg(&a1,&a2,1<color=ROPF_DITHER+WHITE<<16+BLACK; - GrBorder(oc.dc2,x,y,a1,a2); - if (msg_code==MSG_IP_L_UP) { - if (x>a1) SwapI64(&x,&a1); - PsmMarkSel(x,a1,TRUE); - } - } while (msg_code!=MSG_IP_L_UP); - DrawDC2; -} - -U0 PsmLeftClick(I64 x,I64 y) -{ - I64 duration,top,bottom; - if (y<13*FONT_HEIGHT) { - if (oc.tool==PSMTT_PTR_TOOL) - PsmLeftClickStaffPtr(x,y); - else - PsmLeftClickStaffBox(x,y); - } else { - duration=PsmGetPickNoteBoxDuration(x,y); - if (0<=durationtask_end_cb=&SndTaskEndCB; - while (TRUE) { - i++; - switch (psm_play_mode) { - case PSMPM_NORMAL: - if (psm_play_f!=f) { - f=psm_play_f; - Snd(f); - } - break; - case PSMPM_REVERB1: - if (psm_play_f!=f) { - if (f>0) - f2=f; - f=psm_play_f; - } - if (!(i&15)) { - if (i&16) - Snd(f); - else - Snd(f2); - } - break; - } - Sleep(1); - } -} - -U8 PsmCvtDuration(F64 d) -{ - F64 d1,d2; - I64 j; - for (j=0;jx<=xx+o->w && yh) { - Msg(MSG_KEY_DOWN,o->ascii,0); - return; - } - } - } -} - -U0 PsmUpKey(I64 x,I64 y) -{ - I64 i; - PsmKey *o; - y-=FONT_HEIGHT*13; - if (0<=yx<=xx+o->w && yh) { - Msg(MSG_KEY_UP,o->ascii,0); - return; - } - } - } -} - -U0 PsmPushMode(I64 psm_octave) -{ - Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS - -WIF_SELF_BORDER-WIF_FOCUS_TASK_MENU-WIF_SELF_CTRLS; - PsmMenu(psm_octave); -} - -U0 PsmPopMode() -{ - Fs->win_inhibit=WIG_USER_TASK_DFT; - DCFill; -} - -#define PSMF_CD 1 -#define PSMF_INCOMPLETE 2 - -U0 Psalmody(U8 *dirname="~/Psalmody") -{ - Bool was_playing; - I64 a1,a2,msg_code=0,col, - note=NOTE_REST,octave=OCTAVE_REST,psm_octave=3,timeout_val,timeout_val2, - old_doc_flags; - U8 *filename=NULL,*st,*st2; - CTask *play_task=Spawn(&PsmPlayTask,NULL,"Psalmody Play",,Fs); - PsmNote *tempo; - F64 f=0,last_f=0,psm_duration=1.0, - d,evt_time=tS,note_down_time=tS; - CCtrl *c=TempoNew; - - if (DocPut) old_doc_flags=DocPut->flags; - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - - MusicSettingsRst; - tempo_state.tempo=Round(TEMPO_RANGE*(music.tempo-0.5)/4.4); - tempo_state.stacatto=Round(TEMPO_RANGE*(music.stacatto_factor-0.12)/0.88); - - if (DocPut) DocPut->flags|=DOCF_FORM; - - MemSet(&oc,0,sizeof(PsmCtrl)); - oc.screen_x=0; - oc.head.next=oc.head.last=&oc.head; - oc.clipboard.next=oc.clipboard.last=&oc.clipboard; - oc.cur_note=&oc.head; - oc.dc2=DCAlias; - - MenuPush( - "File {" - " New(,'.');" - " ChgDir(MSG_CMD,PSMF_CD);" - " Open(,CH_CTRLO);" - " SaveAs(,CH_CTRLA);" - " Abort(,CH_SHIFT_ESC);" - " Exit(,CH_ESC);" - "}" - "Edit {" - " Cut(,CH_CTRLX);" - " Copy(,CH_CTRLC);" - " Paste(,CH_CTRLV);" - " RightMenu(,'\n');" - " BackSpace(,CH_BACKSPACE);" - " DeleteNote(,,SC_DELETE);" - " ClearSong(,'.');" - " Left(,,SC_CURSOR_LEFT);" - " Right(,,SC_CURSOR_RIGHT);" - " GoBegin(,,0x4CB0000044B);" - " GoEnd(,,0x4CD0000044D);" - "}" - "Song {" - " Play(,'x');" - " Record(,'z');" - " Random(,',');" - " MarkIncomplete(MSG_CMD,PSMF_INCOMPLETE);" - "}" - "Snd {" - " Reverb(,'c');" - " Octave0(,'0');" - " Octave1(,'1');" - " Octave2(,'2');" - " Octave3(,'3');" - " Octave4(,'4');" - " Octave5(,'5');" - " Octave6(,'6');" - "}" - "Help {" - " Help(,,SC_F1);" - "}" - ); - oc.incomplete_entry=MenuEntryFind(Fs->cur_menu,"Song/MarkIncomplete"); - oc.record_entry=MenuEntryFind(Fs->cur_menu,"Song/Record"); - - AutoComplete; - WinBorder; - WinMax; - - dirname=StrNew(dirname); - PsmPushMode(psm_octave); - col=0; - Fs->draw_it=&DrawIt; - - try { - while (TRUE) { - was_playing=FALSE; -mo_start: - if (ip.pos_text.y-Fs->win_top<18) - msg_code=GetMsg(&a1,&a2,1< when the Doc Buttons are clicked. - //This is so that kbd and mouse are the same for Doc's. - //We must now pass the onto the Doc handler. - PutKey(a1,a2); - goto mo_start; - } - if (msg_code!=MSG_IP_MOVE) { - DocBottom; - if (was_playing || DocPut->cur_entry->y>=Fs->win_height-2) { - PsmMenu(psm_octave); - col=0; - } - } - - octave=psm_octave; - switch (msg_code) { - case MSG_CMD: - PsmPopMode; - switch (a1) { - case PSMF_CD: - st2=dirname; - if (dirname=PopUpPickDir) { - Free(st2); - Free(filename); - filename=NULL; - } else - dirname=st2; - break; - case PSMF_INCOMPLETE: - oc.incomplete_entry->checked=!oc.incomplete_entry->checked; - break; - } - PsmPushMode(psm_octave); - col=0; - break; - case MSG_KEY_DOWN: - evt_time=tS; - if ('0'<=a1<='9') { - psm_octave=a1-'0'; - PsmMenu(psm_octave); - col=0; - } else { - switch (a1) { - start: - case 'a': note=7; octave--; break; - case 's': note=8; octave--; break; - case 'e': note=9; octave--; break; - case 'd': note=10; octave--; break; - case 'r': note=11; octave--; break; - case 'f': note=0; break; - case 't': note=1; break; - case 'g': note=2; break; - case 'h': note=3; break; - case 'u': note=4; break; - case 'j': note=5; break; - case 'i': note=6; break; - case 'k': note=7; break; - case 'l': note=8; break; - case 'p': note=9; break; - case ';': note=10; break; - case '[': note=11; break; - case '\'': note=0; octave++; break; - case ']': note=1; octave++; break; - end: - f=Note2Freq(note,octave); - break; - case CH_SPACE: - note=NOTE_REST; - octave=OCTAVE_REST; - f=-1; //rest - break; - - case 0: - switch (a2.u8[0]) { - case SC_CURSOR_LEFT: - if (a2&SCF_CTRL) { - while (oc.cur_note->last!=&oc.head) { - oc.cur_note=oc.cur_note->last; - if (oc.cur_note!=&oc.head) - LBEqu(&oc.cur_note->flags,PSMf_SEL,a2&SCF_SHIFT); - } - } else { - if (oc.cur_note->last!=&oc.head) { - oc.cur_note=oc.cur_note->last; - if (oc.cur_note!=&oc.head) - LBEqu(&oc.cur_note->flags,PSMf_SEL,a2&SCF_SHIFT); - } - } - break; - case SC_CURSOR_RIGHT: - if (a2&SCF_CTRL) { - while (oc.cur_note!=&oc.head) { - if (oc.cur_note!=&oc.head) - LBEqu(&oc.cur_note->flags,PSMf_SEL,a2&SCF_SHIFT); - oc.cur_note=oc.cur_note->next; - } - } else { - if (oc.cur_note!=&oc.head) { - if (oc.cur_note!=&oc.head) - LBEqu(&oc.cur_note->flags,PSMf_SEL,a2&SCF_SHIFT); - oc.cur_note=oc.cur_note->next; - } - } - break; - case SC_DELETE: - if (a2&SCF_SHIFT) - PsmCutToClipboard; - else { - tempo=oc.cur_note; - oc.cur_note=tempo->next; - if (tempo!=&oc.head) { - QueRem(tempo); - PsmNoteDel(tempo); - } - } - break; - case SC_INS: - if (a2&SCF_SHIFT) - PsmPasteClipboard; - else if (a2&SCF_CTRL) - PsmCopyToClipboard; - break; - case SC_F1: - PsmPopMode; - PopUpEd("::/Apps/Psalmody/Help.TXT.Z",Fs); - PsmPushMode(psm_octave); - col=0; - break; - } - break; - case ',': - Free(filename); - filename=NULL; - PsmPopMode; - music.octave=psm_octave; - if (st2=GodSongStr) { - PsmLoadSongStr(st2,&psm_octave,&psm_duration); - Free(st2); - } - PsmPushMode(psm_octave); - col=0; - break; - case CH_CTRLO: - PsmPopMode; - RegOneTimePopUp(ARf_PSALMODY_JUKEBOX, - "Sel a song and preview it.\n" - "$$GREEN$$$$FG$$ to load it into Psalmody.\n\n" - ST_WARN_ST " Graphics and other embelishments\n" - "will be lost because Psalmody can't\n" - "parse HolyC programs completely.\n"); - Free(filename); - filename=NULL; - JukeBox(dirname,&filename); - if (filename) { - oc.screen_x=0; - psm_duration=1.0; - psm_octave=3; - PsmSongDel(&oc.head); - oc.cur_note=&oc.head; - PsmLoadSong(filename,&psm_octave,&psm_duration); - oc.record_entry->checked=FALSE; - oc.cur_note=oc.head.next; - } - PsmPushMode(psm_octave); - col=0; - break; - case CH_CTRLA: - PsmPopMode; - filename=PsmSaveSong(dirname,filename); - PsmPushMode(psm_octave); - break; - case CH_CTRLC: - PsmCopyToClipboard; - break; - case CH_CTRLV: - PsmPasteClipboard; - break; - case CH_CTRLX: - PsmCutToClipboard; - break; - case '.': - PsmMenu(psm_octave); - col=0; - Free(filename); - filename=NULL; - psm_duration=1.0; - psm_octave=3; - PsmSongDel(&oc.head); - oc.cur_note=&oc.head; - oc.screen_x=0; - break; - case '\n': - if (oc.cur_note!=&oc.head) - PsmRightClick(oc.cur_note->x,oc.cur_note->y); - break; - case 'x': - if (was_playing) - break; - col=0; - oc.playing=TRUE; - PsmMenu(psm_octave); - tempo=oc.cur_note; - while (tempo!=&oc.head) { - if (tempo->type!=PSMT_METER) { - timeout_val=cnts.jiffies; - if (ip.pos_text.y-Fs->win_top<18) - msg_code=ScanMsg(&a1,&a2,1<win_top>=18 && - msg_code==MSG_IP_L_DOWN) - goto mo_start; - else - goto mo_got_msg; - } - oc.cur_note=tempo; - oc.screen_x+=tempo->x-0.33*GR_WIDTH; - if (PsmHasWords(tempo->word)) - "%s",tempo->word; - note=tempo->note; - octave=tempo->octave; - if (note!=NOTE_REST) - f=Note2Freq(note,octave); - else - f=-1; //rest - if (f>0) - psm_play_f=f; - else - psm_play_f=0; - - music.tempo=4.4*tempo_state.tempo/TEMPO_RANGE+0.5; - music.stacatto_factor= - 0.88*tempo_state.stacatto/TEMPO_RANGE+0.12; - d=JIFFY_FREQ*psm_durations[tempo->duration]/music.tempo; - if (Bt(&tempo->flags,PSMf_TIE)) { - timeout_val+=d; - timeout_val2=timeout_val; - } else { - timeout_val+=d*music.stacatto_factor; - timeout_val2=timeout_val+ - d*(1.0-music.stacatto_factor); - } - SleepUntil(timeout_val); - psm_play_f=0; - SleepUntil(timeout_val2); - } - tempo=tempo->next; - } - oc.cur_note=&oc.head; - oc.screen_x+=oc.cur_note->x-GR_WIDTH/2; - oc.playing=FALSE; - PsmMenu(psm_octave); - col=0; - f=0; - psm_play_f=0; - break; - case CH_BACKSPACE: - tempo=oc.cur_note->last; - if (tempo!=&oc.head) { - QueRem(tempo); - PsmNoteDel(tempo); - } - if (col) { - '' CH_BACKSPACE; - col--; - } - break; - case 'c': - psm_play_mode++; - if (psm_play_mode>=PSMPM_NUM_PLAY_MODES) psm_play_mode=0; - PsmMenu(psm_octave); - col=0; - break; - case 'z': - if (oc.record_entry->checked) - oc.record_entry->checked=FALSE; - else { - oc.record_entry->checked=TRUE; - psm_duration=1.0; - psm_octave=3; - oc.screen_x=0; - } - PsmMenu(psm_octave); - col=0; - break; - case CH_ESC: - PsmPopMode; - filename=PsmSaveSong(dirname,filename); - PsmPushMode(psm_octave); - case CH_SHIFT_ESC: - goto mo_done; - } - } - break; - case MSG_KEY_UP: - evt_time=tS; - f=0; - break; - case MSG_IP_MOVE: - if (a2>18*FONT_HEIGHT) - Fs->win_inhibit=WIG_USER_TASK_DFT; - else - Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS-WIF_SELF_BORDER - -WIF_FOCUS_TASK_MENU-WIF_SELF_CTRLS; - break; - case MSG_IP_L_DOWN: - PsmDownKey(a1,a2); - PsmLeftClick(a1,a2); - break; - case MSG_IP_L_UP: - PsmUpKey(a1,a2); - break; - default: - PsmRightClick(a1,a2); - } - if (f!=last_f) { - if (f>0) { - st=LstSub(note,psm_note_lst); - psm_play_f=f; - } else { - if (f<0) - st="R"; - else - st=""; - psm_play_f=0; - } - if (oc.record_entry->checked) { - if (last_f) { - music.tempo=4.4*tempo_state.tempo/TEMPO_RANGE+0.5; - music.stacatto_factor=0.88*tempo_state.stacatto/TEMPO_RANGE+0.12; - - tempo->duration=PsmCvtDuration( - music.tempo*(evt_time-note_down_time)); - PsmSetWidth(tempo); - QueIns(tempo,oc.cur_note->last); - } - if (f) { - note_down_time=tS; - tempo=CAlloc(sizeof(PsmNote)); - tempo->type=PSMT_NOTE; - tempo->note=note; - tempo->octave=octave; - if (st[1]=='#') - Bts(&tempo->flags,PSMf_SHARP); - } - } - last_f=f; - "%s",st; - col+=StrLen(st); - if (col>=Fs->win_width-1) { - '\n'; - col=0; - } - } - } -mo_done: - GetMsg(,,1<flags=DocPut->flags&~DOCF_FORM|old_doc_flags&DOCF_FORM; - Free(dirname); - MenuPop; -} diff --git a/Apps/Psalmody/PsalmodyMain.HC b/Apps/Psalmody/PsalmodyMain.HC new file mode 100644 index 0000000..925f48e --- /dev/null +++ b/Apps/Psalmody/PsalmodyMain.HC @@ -0,0 +1,874 @@ +#define PSMR_FLAT -8 +#define PSMR_SHARP -7 +#define PSMR_TIE -6 +#define PSMR_REST -5 +#define PSMR_INS_NOTE -4 +#define PSMR_DELETE_NOTE -3 +#define PSMR_SET_WORD -2 + +F64 PopUpDuration() +{ + I64 i; + CDoc *doc=DocNew; + DocPrint(doc,"$$GREEN$$$$MU,\"Set Word\",LE=PSMR_SET_WORD$$\n" + "$$MU,\"Toggle Sharp\",LE=PSMR_SHARP$$\n" + "$$MU,\"Toggle Flat\",LE=PSMR_FLAT$$\n" + "$$MU,\"Toggle Tie\",LE=PSMR_TIE$$\n" + "$$MU,\"Make Rest\",LE=PSMR_REST$$\n" + "$$MU,\"Insert Note\",LE=PSMR_INS_NOTE$$\n" + "$$MU,\"Delete Note\",LE=PSMR_DELETE_NOTE$$\n\n"); + for (i=0;iflags; + oc.cur_note=tempo=PsmFindNote(x,y); + if (tempo!=&oc.head) { + Fs->win_inhibit=WIG_USER_TASK_DFT; + i=PopUpDuration; + if (0<=itype==PSMT_NOTE) + tempo->duration=i; + } else { + switch (i) { + case PSMR_REST: + if (tempo->type==PSMT_NOTE) { + tempo->octave=OCTAVE_REST; + tempo->note=NOTE_REST; + } + break; + case PSMR_SHARP: + if (tempo->type==PSMT_NOTE && tempo->octave!=OCTAVE_REST) { + if (Btr(&tempo->flags,PSMf_FLAT)) + tempo->note++; + if (Btc(&tempo->flags,PSMf_SHARP)) + tempo->note--; + else + tempo->note++; + if (tempo->note<0) { + tempo->note=11; + tempo->octave--; + } else if (tempo->note>11) { + tempo->note=0; + tempo->octave++; + } + } + break; + case PSMR_FLAT: + if (tempo->type==PSMT_NOTE && tempo->octave!=OCTAVE_REST) { + if (Btr(&tempo->flags,PSMf_SHARP)) + tempo->note--; + if (Btc(&tempo->flags,PSMf_FLAT)) + tempo->note++; + else + tempo->note--; + if (tempo->note<0) { + tempo->note=11; + tempo->octave--; + } else if (tempo->note>11) { + tempo->note=0; + tempo->octave++; + } + } + break; + case PSMR_TIE: + if (tempo->type==PSMT_NOTE) + Btc(&tempo->flags,PSMf_TIE); + break; + case PSMR_SET_WORD: + if (tempo->type==PSMT_NOTE) { + if (DocPut) DocPut->flags&=~DOCF_FORM; + if (PsmHasWords(tempo->word)) + st2=MStrPrint("\nWord(\"%Q\"):",tempo->word); + else + st2=MStrPrint("\nWord(\"\"):"); + DocBottom; + st=GetStr(st2); + Free(st2); + Free(tempo->word); + if (*st) { + tempo->word=MStrPrint("%q",st); + Free(st); + } else + tempo->word=StrNew(" "); + if (DocPut) DocPut->flags=DocPut->flags& + ~DOCF_FORM|old_doc_flags&DOCF_FORM; + } + break; + case PSMR_INS_NOTE: + tempo1=PsmNoteCopy(tempo); + QueIns(tempo1,tempo); + break; + case PSMR_DELETE_NOTE: + oc.cur_note=tempo->next; + QueRem(tempo); + PsmNoteDel(tempo); + break; + } + } + PsmSetWidth(oc.cur_note); + Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS + -WIF_SELF_BORDER-WIF_FOCUS_TASK_MENU-WIF_SELF_CTRLS; + } +} + +U0 PsmLeftClickPickNoteBox(I64 duration) +{ + I64 o,n,msg_code,a1,a2; + PsmNote *tempo,*tempo1; + do { + msg_code=GetMsg(&a1,&a2,1<oc.head.last->x) + tempo1=oc.head.last; + else if (a1x) + tempo1=&oc.head; + else + tempo1=PsmFindNote(a1-PSM_NOTE_SPACING/2,a2); + tempo=CAlloc(sizeof(PsmNote)); + tempo->type=PSMT_NOTE; + a2=a2/4-15; + n=-a2%7; + o=2+a2/-7; + n=-n; + if (n<0) { + n+=7; + o++; + } + n=psm_note_inverse_map[n]; + tempo->note=n; + tempo->octave=o; + tempo->duration=duration; + PsmSetWidth(tempo); + QueIns(tempo,tempo1); + oc.cur_note=tempo->next; + } + DrawDC2; +} + +U0 PsmLeftClickPickMeterBox(I64 top,I64 bottom) +{ + I64 msg_code,a1,a2; + PsmNote *tempo,*tempo1; + do { + msg_code=GetMsg(&a1,&a2,1<=oc.head.x) + tempo1=oc.head.last; + else if (a1x) + tempo1=&oc.head; + else + tempo1=PsmFindNote(a1-PSM_NOTE_SPACING/2,a2); + tempo=CAlloc(sizeof(PsmNote)); + tempo->type=PSMT_METER; + tempo->meter_top=top; + tempo->meter_bottom=bottom; + PsmSetWidth(tempo); + QueIns(tempo,tempo1); + oc.cur_note=tempo->next; + } + DrawDC2; +} + +U0 PsmLeftClickStaffPtr(I64 x,I64 y) +{ + PsmNote *tempo,*tempo1; + I64 o,n,msg_code,a1,a2,n_original,o_original; + oc.cur_note=tempo=PsmFindNote(x,y); + if (tempo!=&oc.head) { + if (tempo->type==PSMT_NOTE) { + n_original=tempo->note; + o_original=tempo->octave; + do { + msg_code=GetMsg(&a1,&a2,1<word); + tempo1->word=tempo->word; + tempo->word=NULL; + tempo->note=n_original; + tempo->octave=o_original; + } + } else { +move_note: + a2=a2/4-15; + n=-a2%7; + o=2+a2/-7; + n=-n; + if (n<0) { + n+=7; + o++; + } + n=psm_note_inverse_map[n]; + tempo->note=n; + tempo->octave=o; + } + } while (msg_code!=MSG_IP_L_UP); + PsmSetWidth(tempo); + } + } +} + +U0 PsmLeftClickStaffBox(I64 x,I64 y) +{ + I64 msg_code,a1,a2; + do { + msg_code=GetMsg(&a1,&a2,1<color=ROPF_DITHER+WHITE<<16+BLACK; + GrBorder(oc.dc2,x,y,a1,a2); + if (msg_code==MSG_IP_L_UP) { + if (x>a1) SwapI64(&x,&a1); + PsmMarkSel(x,a1,TRUE); + } + } while (msg_code!=MSG_IP_L_UP); + DrawDC2; +} + +U0 PsmLeftClick(I64 x,I64 y) +{ + I64 duration,top,bottom; + if (y<13*FONT_HEIGHT) { + if (oc.tool==PSMTT_PTR_TOOL) + PsmLeftClickStaffPtr(x,y); + else + PsmLeftClickStaffBox(x,y); + } else { + duration=PsmGetPickNoteBoxDuration(x,y); + if (0<=durationtask_end_cb=&SndTaskEndCB; + while (TRUE) { + i++; + switch (psm_play_mode) { + case PSMPM_NORMAL: + if (psm_play_f!=f) { + f=psm_play_f; + Snd(f); + } + break; + case PSMPM_REVERB1: + if (psm_play_f!=f) { + if (f>0) + f2=f; + f=psm_play_f; + } + if (!(i&15)) { + if (i&16) + Snd(f); + else + Snd(f2); + } + break; + } + Sleep(1); + } +} + +U8 PsmCvtDuration(F64 d) +{ + F64 d1,d2; + I64 j; + for (j=0;jx<=xx+o->w && yh) { + Msg(MSG_KEY_DOWN,o->ascii,0); + return; + } + } + } +} + +U0 PsmUpKey(I64 x,I64 y) +{ + I64 i; + PsmKey *o; + y-=FONT_HEIGHT*13; + if (0<=yx<=xx+o->w && yh) { + Msg(MSG_KEY_UP,o->ascii,0); + return; + } + } + } +} + +U0 PsmPushMode(I64 psm_octave) +{ + Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS + -WIF_SELF_BORDER-WIF_FOCUS_TASK_MENU-WIF_SELF_CTRLS; + PsmMenu(psm_octave); +} + +U0 PsmPopMode() +{ + Fs->win_inhibit=WIG_USER_TASK_DFT; + DCFill; +} + +#define PSMF_CD 1 +#define PSMF_INCOMPLETE 2 + +U0 Psalmody(U8 *dirname="~/Psalmody") +{ + Bool was_playing; + I64 a1,a2,msg_code=0,col, + note=NOTE_REST,octave=OCTAVE_REST,psm_octave=3,timeout_val,timeout_val2, + old_doc_flags; + U8 *filename=NULL,*st,*st2; + CTask *play_task=Spawn(&PsmPlayTask,NULL,"Psalmody Play",,Fs); + PsmNote *tempo; + F64 f=0,last_f=0,psm_duration=1.0, + d,evt_time=tS,note_down_time=tS; + CCtrl *c=TempoNew; + + if (DocPut) old_doc_flags=DocPut->flags; + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + + MusicSettingsRst; + tempo_state.tempo=Round(TEMPO_RANGE*(music.tempo-0.5)/4.4); + tempo_state.stacatto=Round(TEMPO_RANGE*(music.stacatto_factor-0.12)/0.88); + + if (DocPut) DocPut->flags|=DOCF_FORM; + + MemSet(&oc,0,sizeof(PsmCtrl)); + oc.screen_x=0; + oc.head.next=oc.head.last=&oc.head; + oc.clipboard.next=oc.clipboard.last=&oc.clipboard; + oc.cur_note=&oc.head; + oc.dc2=DCAlias; + + MenuPush( + "File {" + " New(,'.');" + " ChgDir(MSG_CMD,PSMF_CD);" + " Open(,CH_CTRLO);" + " SaveAs(,CH_CTRLA);" + " Abort(,CH_SHIFT_ESC);" + " Exit(,CH_ESC);" + "}" + "Edit {" + " Cut(,CH_CTRLX);" + " Copy(,CH_CTRLC);" + " Paste(,CH_CTRLV);" + " RightMenu(,'\n');" + " BackSpace(,CH_BACKSPACE);" + " DeleteNote(,,SC_DELETE);" + " ClearSong(,'.');" + " Left(,,SC_CURSOR_LEFT);" + " Right(,,SC_CURSOR_RIGHT);" + " GoBegin(,,0x4CB0000044B);" + " GoEnd(,,0x4CD0000044D);" + "}" + "Song {" + " Play(,'x');" + " Record(,'z');" + " Random(,',');" + " MarkIncomplete(MSG_CMD,PSMF_INCOMPLETE);" + "}" + "Snd {" + " Reverb(,'c');" + " Octave0(,'0');" + " Octave1(,'1');" + " Octave2(,'2');" + " Octave3(,'3');" + " Octave4(,'4');" + " Octave5(,'5');" + " Octave6(,'6');" + "}" + "Help {" + " Help(,,SC_F1);" + "}" + ); + oc.incomplete_entry=MenuEntryFind(Fs->cur_menu,"Song/MarkIncomplete"); + oc.record_entry=MenuEntryFind(Fs->cur_menu,"Song/Record"); + + AutoComplete; + WinBorder; + WinMax; + + dirname=StrNew(dirname); + PsmPushMode(psm_octave); + col=0; + Fs->draw_it=&DrawIt; + + try { + while (TRUE) { + was_playing=FALSE; +mo_start: + if (ip.pos_text.y-Fs->win_top<18) + msg_code=GetMsg(&a1,&a2,1< when the Doc Buttons are clicked. + //This is so that kbd and mouse are the same for Doc's. + //We must now pass the onto the Doc handler. + PutKey(a1,a2); + goto mo_start; + } + if (msg_code!=MSG_IP_MOVE) { + DocBottom; + if (was_playing || DocPut->cur_entry->y>=Fs->win_height-2) { + PsmMenu(psm_octave); + col=0; + } + } + + octave=psm_octave; + switch (msg_code) { + case MSG_CMD: + PsmPopMode; + switch (a1) { + case PSMF_CD: + st2=dirname; + if (dirname=PopUpPickDir) { + Free(st2); + Free(filename); + filename=NULL; + } else + dirname=st2; + break; + case PSMF_INCOMPLETE: + oc.incomplete_entry->checked=!oc.incomplete_entry->checked; + break; + } + PsmPushMode(psm_octave); + col=0; + break; + case MSG_KEY_DOWN: + evt_time=tS; + if ('0'<=a1<='9') { + psm_octave=a1-'0'; + PsmMenu(psm_octave); + col=0; + } else { + switch (a1) { + start: + case 'a': note=7; octave--; break; + case 's': note=8; octave--; break; + case 'e': note=9; octave--; break; + case 'd': note=10; octave--; break; + case 'r': note=11; octave--; break; + case 'f': note=0; break; + case 't': note=1; break; + case 'g': note=2; break; + case 'h': note=3; break; + case 'u': note=4; break; + case 'j': note=5; break; + case 'i': note=6; break; + case 'k': note=7; break; + case 'l': note=8; break; + case 'p': note=9; break; + case ';': note=10; break; + case '[': note=11; break; + case '\'': note=0; octave++; break; + case ']': note=1; octave++; break; + end: + f=Note2Freq(note,octave); + break; + case CH_SPACE: + note=NOTE_REST; + octave=OCTAVE_REST; + f=-1; //rest + break; + + case 0: + switch (a2.u8[0]) { + case SC_CURSOR_LEFT: + if (a2&SCF_CTRL) { + while (oc.cur_note->last!=&oc.head) { + oc.cur_note=oc.cur_note->last; + if (oc.cur_note!=&oc.head) + LBEqu(&oc.cur_note->flags,PSMf_SEL,a2&SCF_SHIFT); + } + } else { + if (oc.cur_note->last!=&oc.head) { + oc.cur_note=oc.cur_note->last; + if (oc.cur_note!=&oc.head) + LBEqu(&oc.cur_note->flags,PSMf_SEL,a2&SCF_SHIFT); + } + } + break; + case SC_CURSOR_RIGHT: + if (a2&SCF_CTRL) { + while (oc.cur_note!=&oc.head) { + if (oc.cur_note!=&oc.head) + LBEqu(&oc.cur_note->flags,PSMf_SEL,a2&SCF_SHIFT); + oc.cur_note=oc.cur_note->next; + } + } else { + if (oc.cur_note!=&oc.head) { + if (oc.cur_note!=&oc.head) + LBEqu(&oc.cur_note->flags,PSMf_SEL,a2&SCF_SHIFT); + oc.cur_note=oc.cur_note->next; + } + } + break; + case SC_DELETE: + if (a2&SCF_SHIFT) + PsmCutToClipboard; + else { + tempo=oc.cur_note; + oc.cur_note=tempo->next; + if (tempo!=&oc.head) { + QueRem(tempo); + PsmNoteDel(tempo); + } + } + break; + case SC_INS: + if (a2&SCF_SHIFT) + PsmPasteClipboard; + else if (a2&SCF_CTRL) + PsmCopyToClipboard; + break; + case SC_F1: + PsmPopMode; + PopUpEd("::/Apps/Psalmody/Help.DD.Z",Fs); + PsmPushMode(psm_octave); + col=0; + break; + } + break; + case ',': + Free(filename); + filename=NULL; + PsmPopMode; + music.octave=psm_octave; + if (st2=GodSongStr) { + PsmLoadSongStr(st2,&psm_octave,&psm_duration); + Free(st2); + } + PsmPushMode(psm_octave); + col=0; + break; + case CH_CTRLO: + PsmPopMode; + RegOneTimePopUp(ARf_PSALMODY_JUKEBOX, + "Sel a song and preview it.\n" + "$$GREEN$$$$FG$$ to load it into Psalmody.\n\n" + ST_WARN_ST " Graphics and other embelishments\n" + "will be lost because Psalmody can't\n" + "parse HolyC programs completely.\n"); + Free(filename); + filename=NULL; + JukeBox(dirname,&filename); + if (filename) { + oc.screen_x=0; + psm_duration=1.0; + psm_octave=3; + PsmSongDel(&oc.head); + oc.cur_note=&oc.head; + PsmLoadSong(filename,&psm_octave,&psm_duration); + oc.record_entry->checked=FALSE; + oc.cur_note=oc.head.next; + } + PsmPushMode(psm_octave); + col=0; + break; + case CH_CTRLA: + PsmPopMode; + filename=PsmSaveSong(dirname,filename); + PsmPushMode(psm_octave); + break; + case CH_CTRLC: + PsmCopyToClipboard; + break; + case CH_CTRLV: + PsmPasteClipboard; + break; + case CH_CTRLX: + PsmCutToClipboard; + break; + case '.': + PsmMenu(psm_octave); + col=0; + Free(filename); + filename=NULL; + psm_duration=1.0; + psm_octave=3; + PsmSongDel(&oc.head); + oc.cur_note=&oc.head; + oc.screen_x=0; + break; + case '\n': + if (oc.cur_note!=&oc.head) + PsmRightClick(oc.cur_note->x,oc.cur_note->y); + break; + case 'x': + if (was_playing) + break; + col=0; + oc.playing=TRUE; + PsmMenu(psm_octave); + tempo=oc.cur_note; + while (tempo!=&oc.head) { + if (tempo->type!=PSMT_METER) { + timeout_val=cnts.jiffies; + if (ip.pos_text.y-Fs->win_top<18) + msg_code=ScanMsg(&a1,&a2,1<win_top>=18 && + msg_code==MSG_IP_L_DOWN) + goto mo_start; + else + goto mo_got_msg; + } + oc.cur_note=tempo; + oc.screen_x+=tempo->x-0.33*GR_WIDTH; + if (PsmHasWords(tempo->word)) + "%s",tempo->word; + note=tempo->note; + octave=tempo->octave; + if (note!=NOTE_REST) + f=Note2Freq(note,octave); + else + f=-1; //rest + if (f>0) + psm_play_f=f; + else + psm_play_f=0; + + music.tempo=4.4*tempo_state.tempo/TEMPO_RANGE+0.5; + music.stacatto_factor= + 0.88*tempo_state.stacatto/TEMPO_RANGE+0.12; + d=JIFFY_FREQ*psm_durations[tempo->duration]/music.tempo; + if (Bt(&tempo->flags,PSMf_TIE)) { + timeout_val+=d; + timeout_val2=timeout_val; + } else { + timeout_val+=d*music.stacatto_factor; + timeout_val2=timeout_val+ + d*(1.0-music.stacatto_factor); + } + SleepUntil(timeout_val); + psm_play_f=0; + SleepUntil(timeout_val2); + } + tempo=tempo->next; + } + oc.cur_note=&oc.head; + oc.screen_x+=oc.cur_note->x-GR_WIDTH/2; + oc.playing=FALSE; + PsmMenu(psm_octave); + col=0; + f=0; + psm_play_f=0; + break; + case CH_BACKSPACE: + tempo=oc.cur_note->last; + if (tempo!=&oc.head) { + QueRem(tempo); + PsmNoteDel(tempo); + } + if (col) { + '' CH_BACKSPACE; + col--; + } + break; + case 'c': + psm_play_mode++; + if (psm_play_mode>=PSMPM_NUM_PLAY_MODES) psm_play_mode=0; + PsmMenu(psm_octave); + col=0; + break; + case 'z': + if (oc.record_entry->checked) + oc.record_entry->checked=FALSE; + else { + oc.record_entry->checked=TRUE; + psm_duration=1.0; + psm_octave=3; + oc.screen_x=0; + } + PsmMenu(psm_octave); + col=0; + break; + case CH_ESC: + PsmPopMode; + filename=PsmSaveSong(dirname,filename); + PsmPushMode(psm_octave); + case CH_SHIFT_ESC: + goto mo_done; + } + } + break; + case MSG_KEY_UP: + evt_time=tS; + f=0; + break; + case MSG_IP_MOVE: + if (a2>18*FONT_HEIGHT) + Fs->win_inhibit=WIG_USER_TASK_DFT; + else + Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS-WIF_SELF_BORDER + -WIF_FOCUS_TASK_MENU-WIF_SELF_CTRLS; + break; + case MSG_IP_L_DOWN: + PsmDownKey(a1,a2); + PsmLeftClick(a1,a2); + break; + case MSG_IP_L_UP: + PsmUpKey(a1,a2); + break; + default: + PsmRightClick(a1,a2); + } + if (f!=last_f) { + if (f>0) { + st=LstSub(note,psm_note_lst); + psm_play_f=f; + } else { + if (f<0) + st="R"; + else + st=""; + psm_play_f=0; + } + if (oc.record_entry->checked) { + if (last_f) { + music.tempo=4.4*tempo_state.tempo/TEMPO_RANGE+0.5; + music.stacatto_factor=0.88*tempo_state.stacatto/TEMPO_RANGE+0.12; + + tempo->duration=PsmCvtDuration( + music.tempo*(evt_time-note_down_time)); + PsmSetWidth(tempo); + QueIns(tempo,oc.cur_note->last); + } + if (f) { + note_down_time=tS; + tempo=CAlloc(sizeof(PsmNote)); + tempo->type=PSMT_NOTE; + tempo->note=note; + tempo->octave=octave; + if (st[1]=='#') + Bts(&tempo->flags,PSMf_SHARP); + } + } + last_f=f; + "%s",st; + col+=StrLen(st); + if (col>=Fs->win_width-1) { + '\n'; + col=0; + } + } + } +mo_done: + GetMsg(,,1<flags=DocPut->flags&~DOCF_FORM|old_doc_flags&DOCF_FORM; + Free(dirname); + MenuPop; +} diff --git a/Apps/Psalmody/Run.CPP b/Apps/Psalmody/Run.HC similarity index 100% rename from Apps/Psalmody/Run.CPP rename to Apps/Psalmody/Run.HC diff --git a/Apps/Span/Install.CPP b/Apps/Span/Install.HC similarity index 100% rename from Apps/Span/Install.CPP rename to Apps/Span/Install.HC diff --git a/Apps/Span/Load.CPP b/Apps/Span/Load.CPP deleted file mode 100644 index 4d1c09a..0000000 --- a/Apps/Span/Load.CPP +++ /dev/null @@ -1,10 +0,0 @@ -#help_index "Games" - -Cd(__DIR__);; -#include "Span.HPP" -#include "SpanDerive" -#include "SpanBridge" -#include "SpanNew" -#include "SpanMain" - -#help_index "" diff --git a/Apps/Span/Load.HC b/Apps/Span/Load.HC new file mode 100644 index 0000000..adbeb0b --- /dev/null +++ b/Apps/Span/Load.HC @@ -0,0 +1,10 @@ +#help_index "Games" + +Cd(__DIR__);; +#include "Span.HH" +#include "SpanDerive" +#include "SpanBridge" +#include "SpanNew" +#include "SpanMain" + +#help_index "" diff --git a/Apps/Span/Run.CPP b/Apps/Span/Run.HC similarity index 100% rename from Apps/Span/Run.CPP rename to Apps/Span/Run.HC diff --git a/Apps/Span/Span.HH b/Apps/Span/Span.HH new file mode 100644 index 0000000..abc5693 --- /dev/null +++ b/Apps/Span/Span.HH @@ -0,0 +1,49 @@ +#define SPAN_VERSION 1.0 + +class SpanHeader +{ +F64 version; +I32 num_masses,num_springs; +}; + +class MyMass:CMass +{ +F64 radius,cost,load_t; +CColorROPU32 color; +} *cursor_mass; + +class MySpring:CSpring +{ +F64 compression_strength,tensile_strength,cost; +F64 base_compression_strength,base_tensile_strength, +base_const,base_cost; + +CColorROPU32 color; +I32 pen_width; +}; + +CMathODE *ode=NULL; + +CCtrlButtonState run_button,mode_button; + +CColorROPU32 run_colors[2]={RED,GREEN}; + +#define MD_MASS 0 +#define MD_CONCRETE 1 +#define MD_STEEL 2 +#define MD_WIRE 3 +#define MD_MOVE 4 +#define MD_DELETE 5 +#define MD_NUM_MODES 6 +CColorROPU32 mode_colors[MD_NUM_MODES]= +{BROWN,LTGRAY,DKGRAY,RED,PURPLE,RED}; + DefineLstLoad("ST_SPAN_MODES","Mass\0Concrete\0Steel\0Wire\0Move\0Delete\0"); + + class SpanAnimateStruct + { + U8 *saved_ode; + F64 elapsed_t,start_wall_t; +} a; + +extern MyMass *PlaceMass(I64 x, I64 y); +extern F64 SpanTime(); diff --git a/Apps/Span/Span.HPP b/Apps/Span/Span.HPP deleted file mode 100644 index 1a47a4f..0000000 --- a/Apps/Span/Span.HPP +++ /dev/null @@ -1,49 +0,0 @@ -#define SPAN_VERSION 1.0 - -class SpanHeader -{ -F64 version; -I32 num_masses,num_springs; -}; - -class MyMass:CMass -{ -F64 radius,cost,load_t; -CColorROPU32 color; -} *cursor_mass; - -class MySpring:CSpring -{ -F64 compression_strength,tensile_strength,cost; -F64 base_compression_strength,base_tensile_strength, -base_const,base_cost; - -CColorROPU32 color; -I32 pen_width; -}; - -CMathODE *ode=NULL; - -CCtrlButtonState run_button,mode_button; - -CColorROPU32 run_colors[2]={RED,GREEN}; - -#define MD_MASS 0 -#define MD_CONCRETE 1 -#define MD_STEEL 2 -#define MD_WIRE 3 -#define MD_MOVE 4 -#define MD_DELETE 5 -#define MD_NUM_MODES 6 -CColorROPU32 mode_colors[MD_NUM_MODES]= -{BROWN,LTGRAY,DKGRAY,RED,PURPLE,RED}; - DefineLstLoad("ST_SPAN_MODES","Mass\0Concrete\0Steel\0Wire\0Move\0Delete\0"); - - class SpanAnimateStruct - { - U8 *saved_ode; - F64 elapsed_t,start_wall_t; -} a; - -extern MyMass PlaceMass(I64 x, I64 y); -extern F64 SpanTime(); diff --git a/Apps/Span/SpanBridge.CPP b/Apps/Span/SpanBridge.HC similarity index 100% rename from Apps/Span/SpanBridge.CPP rename to Apps/Span/SpanBridge.HC diff --git a/Apps/Span/SpanDerive.CPP b/Apps/Span/SpanDerive.HC similarity index 100% rename from Apps/Span/SpanDerive.CPP rename to Apps/Span/SpanDerive.HC diff --git a/Apps/Span/SpanMain.CPP b/Apps/Span/SpanMain.CPP deleted file mode 100644 index c8762fa..0000000 --- a/Apps/Span/SpanMain.CPP +++ /dev/null @@ -1,468 +0,0 @@ -F64 SpanTime() -{ - if (run_button.state) - return a.elapsed_t+tS-a.start_wall_t; - else - return a.elapsed_t; -} - -F64 Cost(CMathODE *ode) -{ - MyMass *tempm; - MySpring *temps; - F64 res=0; - tempm=ode->next_mass; - while (tempm!=&ode->next_mass) { - res+=tempm->cost; - tempm=tempm->next; - } - temps=ode->next_spring; - while (temps!=&ode->next_spring) { - res+=temps->cost; - temps=temps->next; - } - return res; -} - -U0 DrawIt(CTask *task,CDC *dc) -{ - MyMass *tempm; - MySpring *temps; - - temps=ode->next_spring; - while (temps!=&ode->next_spring) { - if (!(temps->flags&SSF_INACTIVE)) { - dc->color=temps->color; - dc->pen_width=temps->pen_width; - GrLine3(dc,temps->end1->x,temps->end1->y,0, - temps->end2->x,temps->end2->y,0); - } - temps=temps->next; - } - - if (cursor_mass) { - dc->color=RED; - dc->pen_width=2; - GrLine3(dc,ip.pos.x-task->pix_left-task->scroll_x, - ip.pos.y-task->pix_top-task->scroll_y,0, - cursor_mass->x,cursor_mass->y,0); - } - - tempm=ode->next_mass; - while (tempm!=&ode->next_mass) { - if (!(tempm->flags&MSF_INACTIVE)) { - dc->color=BLACK; - GrCircle(dc,tempm->x,tempm->y,tempm->radius); - GrFloodFill(dc,tempm->x,tempm->y,TRUE); - dc->color=tempm->color; - GrCircle(dc,tempm->x,tempm->y,tempm->radius); - GrFloodFill(dc,tempm->x,tempm->y,TRUE); - dc->color=BLACK; - GrCircle(dc,tempm->x,tempm->y,tempm->radius); - } - tempm=tempm->next; - } - - dc->color=BLACK; - GrPrint(dc,90,0,"Cost:%12.2,f",Cost(ode)); - GrPrint(dc,90,FONT_HEIGHT,"Time:%12.2f",SpanTime); -} - -MyMass PlaceMass(I64 x, I64 y) -{ - MyMass *tempm=CAlloc(sizeof(MyMass)); - tempm->drag_profile_factor=1.0; - tempm->x=x; - tempm->y=y; - tempm->mass=MASS_MASS; - tempm->radius=MASS_RADIUS; - tempm->cost=25.0*COST_SCALE; - tempm->color=YELLOW; - QueIns(tempm,ode->last_mass); - return tempm; -} - -U0 NullSpring(MySpring *temps,F64 scale) -{ - F64 d=D3Dist(&temps->end1->x,&temps->end2->x); - temps->rest_len=d*scale; - temps->compression_strength= - temps->base_compression_strength/(temps->rest_len+1.0); - temps->tensile_strength=temps->base_tensile_strength/(temps->rest_len+1.0); - temps->const=temps->base_const/(temps->rest_len+1.0); - temps->cost=temps->base_cost*temps->rest_len; -} - -U0 MoveMass(MyMass *tempm,I64 x, I64 y) -{ - MySpring *temps; - tempm->x=x; - tempm->y=y; - tempm->DxDt=0; - tempm->DyDt=0; - temps=ode->next_spring; - while (temps!=&ode->next_spring) { - if (temps->end1==tempm || temps->end2==tempm) { - if (temps->flags&SSF_NO_COMPRESSION) - NullSpring(temps,WIRE_PERCENT); - else - NullSpring(temps,1.0); - } - temps=temps->next; - } -} - -U0 DelSpring(MySpring *temps) -{ - QueRem(temps); - Free(temps); -} - -U0 DelMass(MyMass *tempm) -{ - MySpring *temps,*temps1; - temps=ode->next_spring; - while (temps!=&ode->next_spring) { - temps1=temps->next; - if (temps->end1==tempm || temps->end2==tempm) - DelSpring(temps); - temps=temps1; - } - QueRem(tempm); - Free(tempm); -} - -U0 DrawSpring(CDC *dc,MyMass *tempm,I64 x,I64 y) -{ - switch (mode_button.state) { - case MD_CONCRETE: - dc->color=LTGRAY; - dc->pen_width=2; - break; - case MD_STEEL: - dc->color=DKGRAY; - dc->pen_width=2; - break; - case MD_WIRE: - dc->color=RED; - dc->pen_width=1; - break; - } - GrLine3(dc,tempm->x,tempm->y,0,x,y,0); -} - -U0 PlaceSpring(MyMass *tempm1,MyMass *tempm2) -{ - MySpring *temps=CAlloc(sizeof(MySpring)); - temps->end1=tempm1; - temps->end2=tempm2; - switch (mode_button.state) { - case MD_CONCRETE: - temps->base_const = 3.00*SPRING_SCALE; - temps->base_compression_strength=10.00*STRENGTH_SCALE; - temps->base_tensile_strength = 0.35*STRENGTH_SCALE; - temps->base_cost = 0.30*COST_SCALE; - NullSpring(temps,1.0); - temps->color=LTGRAY; - temps->pen_width=2; - break; - case MD_STEEL: - temps->base_const = 1.00*SPRING_SCALE; - temps->base_compression_strength= 1.00*STRENGTH_SCALE; - temps->base_tensile_strength = 1.00*STRENGTH_SCALE; - temps->base_cost = 1.00*COST_SCALE; - NullSpring(temps,1.0); - temps->color=DKGRAY; - temps->pen_width=2; - break; - case MD_WIRE: - temps->base_const = 0.25*SPRING_SCALE; - temps->base_compression_strength= 0.00; - temps->base_tensile_strength = 0.50*STRENGTH_SCALE; - temps->base_cost = 0.10*COST_SCALE; - NullSpring(temps,WIRE_PERCENT); - temps->color=RED; - temps->pen_width=1; - temps->flags|=SSF_NO_COMPRESSION; - break; - } - QueIns(temps,ode->last_spring); -} - -U0 AnimateTask(SpanAnimateStruct *a) -{ - MySpring *temps,*temps1; - Bool old_run=FALSE; - F64 f; - while (TRUE) { - temps=ode->next_spring; - while (temps!=&ode->next_spring) { - temps1=temps->next; - f=temps->f; - if (f>0 && f>temps->compression_strength && - !(temps->flags&SSF_NO_COMPRESSION)|| - f<0 && -f>temps->tensile_strength && - !(temps->flags&SSF_NO_TENSION)) - temps->flags|=SSF_INACTIVE; - temps=temps1; - } - AdjustLoads(ode); - WinMgrSync; //CMathODE updated once per refresh. - if (old_run!=run_button.state) { - if (run_button.state) { - if (!a->elapsed_t || !a->saved_ode) { - Free(a->saved_ode); - a->saved_ode=SpanSave(ode); - } - a->start_wall_t=tS; - ode->flags&=~ODEF_PAUSED; - } else { - ode->flags|=ODEF_PAUSED; - a->elapsed_t+=tS-a->start_wall_t; - } - old_run=run_button.state; - } - } -} - -U0 Init(SpanAnimateStruct *a) -{ - SpanDel(ode); - ode=SpanNew; - - run_button.state=0; - WinMgrSync(2); //Allow stop to reg in animate task. - - if (a->saved_ode) - SpanLoad(ode,a->saved_ode); - else - SpanBridge1Init(ode); - a->elapsed_t=0; - cursor_mass=NULL; -} - -U0 SongTask(I64) -{//Song by Terry A. Davis - Fs->task_end_cb=&SndTaskEndCB; - MusicSettingsRst; - music.tempo= 3.636; - music.stacatto_factor= 0.902; - while (TRUE) { - Play("3q.EeDqED2G3DhE"); - Play("q.EeDqED2G3DhE"); - Play("q.FeEFEqF2G3EhF"); - Play("q.FeEFEqF2G3EhF"); - } -} - -U0 Span() -{ - I64 msg_code,a1,a2; - MyMass *tempm1=NULL,*tempm2=NULL; - MySpring *temps; - CCtrl *bt_run,*bt_mode; - U8 *src; - CDC *dc=DCAlias; - - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - Fs->text_attr=BROWN<<4+BLACK; - AutoComplete; - WinBorder; - WinMax; - DocCursor; - Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs); - - bt_run =CtrlButtonNew(0,0, 80,, - 2,"Stopped\0Running\0",run_colors,&run_button); - bt_mode=CtrlButtonNew(0,3.0*FONT_HEIGHT,80,, - MD_NUM_MODES,Define("ST_SPAN_MODES"),mode_colors,&mode_button); - a.saved_ode=NULL; - - Fs->win_inhibit|=WIG_DBL_CLICK; - - MenuPush( - "File {" - " New(,CH_CTRLN);" - " Open(,CH_CTRLO);" - " SaveAs(,CH_CTRLA);" - " Abort(,CH_SHIFT_ESC);" - " Exit(,CH_ESC);" - "}" - "Play {" - " Restart(,'\n');" - " RunStop(,CH_SPACE);" - " Mass(,'m');" - " Concrete(,'c');" - " Steel(,'s');" - " Wire(,'w');" - " Move(,'v');" - " Delete(,'d');" - "}" - ); - - ode=NULL; - Init(&a); - Fs->animate_task=Spawn(&AnimateTask,&a,"Animate",,Fs); - Fs->draw_it=&DrawIt; - - PopUpOk( - "Build a bridge to hold-up the\n" - "red masses. Test your design\n" - "by pressing run/stop.\n\n" - "The lowest cost bridge that\n" - "stays standing wins.\n\n" - "For a variation, try without\n" - "using the center base point.\n" - "\n" - "Use\n" - "\t$$GREEN$$'m'$$FG$$ass\n" - "\t$$GREEN$$'c'$$FG$$oncrete\n" - "\t$$GREEN$$'s'$$FG$$teel\n" - "\t$$GREEN$$'w'$$FG$$ire\n" - "\nto sel materials.\n"); - - try { - while (TRUE) { - msg_code=GetMsg(&a1,&a2,1<=MD_NUM_MODES) - mode_button.state=0; - cursor_mass=tempm1=tempm2=NULL; - break; - case MSG_KEY_DOWN: - switch (a1) { - case '\n': - if (!SpanTime || !a.saved_ode) { - Free(a.saved_ode); - a.saved_ode=SpanSave(ode); - } - Init(&a); - break; - case CH_CTRLN: - Free(a.saved_ode); - a.saved_ode=NULL; - Init(&a); - break; - case CH_CTRLO: - if (src=SpanRead) { - Free(a.saved_ode); - a.saved_ode=src; - Init(&a); - } - break; - case CH_CTRLA: - if (!SpanTime || !a.saved_ode) { - Free(a.saved_ode); - a.saved_ode=SpanSave(ode); - } - Init(&a); - SpanWrite(ode); - break; - case CH_SPACE: - run_button.state=!run_button.state; - break; - case 'c': - mode_button.state=MD_CONCRETE; - break; - case 's': - mode_button.state=MD_STEEL; - break; - case 'w': - mode_button.state=MD_WIRE; - break; - case 'm': - mode_button.state=MD_MASS; - break; - case 'v': - mode_button.state=MD_MOVE; - break; - case 'd': - mode_button.state=MD_DELETE; - break; - case CH_ESC: - if (!SpanTime || !a.saved_ode) { - Free(a.saved_ode); - a.saved_ode=SpanSave(ode); - } - Init(&a); - SpanWrite(ode); - case CH_SHIFT_ESC: - goto span_done; - } - break; - } - } -span_done: //Don't goto out of try - GetMsg(,,1<next_mass; + while (tempm!=&ode->next_mass) { + res+=tempm->cost; + tempm=tempm->next; + } + temps=ode->next_spring; + while (temps!=&ode->next_spring) { + res+=temps->cost; + temps=temps->next; + } + return res; +} + +U0 DrawIt(CTask *task,CDC *dc) +{ + MyMass *tempm; + MySpring *temps; + + temps=ode->next_spring; + while (temps!=&ode->next_spring) { + if (!(temps->flags&SSF_INACTIVE)) { + dc->color=temps->color; + dc->pen_width=temps->pen_width; + GrLine3(dc,temps->end1->x,temps->end1->y,0, + temps->end2->x,temps->end2->y,0); + } + temps=temps->next; + } + + if (cursor_mass) { + dc->color=RED; + dc->pen_width=2; + GrLine3(dc,ip.pos.x-task->pix_left-task->scroll_x, + ip.pos.y-task->pix_top-task->scroll_y,0, + cursor_mass->x,cursor_mass->y,0); + } + + tempm=ode->next_mass; + while (tempm!=&ode->next_mass) { + if (!(tempm->flags&MSF_INACTIVE)) { + dc->color=BLACK; + GrCircle(dc,tempm->x,tempm->y,tempm->radius); + GrFloodFill(dc,tempm->x,tempm->y,TRUE); + dc->color=tempm->color; + GrCircle(dc,tempm->x,tempm->y,tempm->radius); + GrFloodFill(dc,tempm->x,tempm->y,TRUE); + dc->color=BLACK; + GrCircle(dc,tempm->x,tempm->y,tempm->radius); + } + tempm=tempm->next; + } + + dc->color=BLACK; + GrPrint(dc,90,0,"Cost:%12.2,f",Cost(ode)); + GrPrint(dc,90,FONT_HEIGHT,"Time:%12.2f",SpanTime); +} + +MyMass *PlaceMass(I64 x, I64 y) +{ + MyMass *tempm=CAlloc(sizeof(MyMass)); + tempm->drag_profile_factor=1.0; + tempm->x=x; + tempm->y=y; + tempm->mass=MASS_MASS; + tempm->radius=MASS_RADIUS; + tempm->cost=25.0*COST_SCALE; + tempm->color=YELLOW; + QueIns(tempm,ode->last_mass); + return tempm; +} + +U0 NullSpring(MySpring *temps,F64 scale) +{ + F64 d=D3Dist(&temps->end1->x,&temps->end2->x); + temps->rest_len=d*scale; + temps->compression_strength= + temps->base_compression_strength/(temps->rest_len+1.0); + temps->tensile_strength=temps->base_tensile_strength/(temps->rest_len+1.0); + temps->const=temps->base_const/(temps->rest_len+1.0); + temps->cost=temps->base_cost*temps->rest_len; +} + +U0 MoveMass(MyMass *tempm,I64 x, I64 y) +{ + MySpring *temps; + tempm->x=x; + tempm->y=y; + tempm->DxDt=0; + tempm->DyDt=0; + temps=ode->next_spring; + while (temps!=&ode->next_spring) { + if (temps->end1==tempm || temps->end2==tempm) { + if (temps->flags&SSF_NO_COMPRESSION) + NullSpring(temps,WIRE_PERCENT); + else + NullSpring(temps,1.0); + } + temps=temps->next; + } +} + +U0 DelSpring(MySpring *temps) +{ + QueRem(temps); + Free(temps); +} + +U0 DelMass(MyMass *tempm) +{ + MySpring *temps,*temps1; + temps=ode->next_spring; + while (temps!=&ode->next_spring) { + temps1=temps->next; + if (temps->end1==tempm || temps->end2==tempm) + DelSpring(temps); + temps=temps1; + } + QueRem(tempm); + Free(tempm); +} + +U0 DrawSpring(CDC *dc,MyMass *tempm,I64 x,I64 y) +{ + switch (mode_button.state) { + case MD_CONCRETE: + dc->color=LTGRAY; + dc->pen_width=2; + break; + case MD_STEEL: + dc->color=DKGRAY; + dc->pen_width=2; + break; + case MD_WIRE: + dc->color=RED; + dc->pen_width=1; + break; + } + GrLine3(dc,tempm->x,tempm->y,0,x,y,0); +} + +U0 PlaceSpring(MyMass *tempm1,MyMass *tempm2) +{ + MySpring *temps=CAlloc(sizeof(MySpring)); + temps->end1=tempm1; + temps->end2=tempm2; + switch (mode_button.state) { + case MD_CONCRETE: + temps->base_const = 3.00*SPRING_SCALE; + temps->base_compression_strength=10.00*STRENGTH_SCALE; + temps->base_tensile_strength = 0.35*STRENGTH_SCALE; + temps->base_cost = 0.30*COST_SCALE; + NullSpring(temps,1.0); + temps->color=LTGRAY; + temps->pen_width=2; + break; + case MD_STEEL: + temps->base_const = 1.00*SPRING_SCALE; + temps->base_compression_strength= 1.00*STRENGTH_SCALE; + temps->base_tensile_strength = 1.00*STRENGTH_SCALE; + temps->base_cost = 1.00*COST_SCALE; + NullSpring(temps,1.0); + temps->color=DKGRAY; + temps->pen_width=2; + break; + case MD_WIRE: + temps->base_const = 0.25*SPRING_SCALE; + temps->base_compression_strength= 0.00; + temps->base_tensile_strength = 0.50*STRENGTH_SCALE; + temps->base_cost = 0.10*COST_SCALE; + NullSpring(temps,WIRE_PERCENT); + temps->color=RED; + temps->pen_width=1; + temps->flags|=SSF_NO_COMPRESSION; + break; + } + QueIns(temps,ode->last_spring); +} + +U0 AnimateTask(SpanAnimateStruct *a) +{ + MySpring *temps,*temps1; + Bool old_run=FALSE; + F64 f; + while (TRUE) { + temps=ode->next_spring; + while (temps!=&ode->next_spring) { + temps1=temps->next; + f=temps->f; + if (f>0 && f>temps->compression_strength && + !(temps->flags&SSF_NO_COMPRESSION)|| + f<0 && -f>temps->tensile_strength && + !(temps->flags&SSF_NO_TENSION)) + temps->flags|=SSF_INACTIVE; + temps=temps1; + } + AdjustLoads(ode); + WinMgrSync; //CMathODE updated once per refresh. + if (old_run!=run_button.state) { + if (run_button.state) { + if (!a->elapsed_t || !a->saved_ode) { + Free(a->saved_ode); + a->saved_ode=SpanSave(ode); + } + a->start_wall_t=tS; + ode->flags&=~ODEF_PAUSED; + } else { + ode->flags|=ODEF_PAUSED; + a->elapsed_t+=tS-a->start_wall_t; + } + old_run=run_button.state; + } + } +} + +U0 Init(SpanAnimateStruct *a) +{ + SpanDel(ode); + ode=SpanNew; + + run_button.state=0; + WinMgrSync(2); //Allow stop to reg in animate task. + + if (a->saved_ode) + SpanLoad(ode,a->saved_ode); + else + SpanBridge1Init(ode); + a->elapsed_t=0; + cursor_mass=NULL; +} + +U0 SongTask(I64) +{//Song by Terry A. Davis + Fs->task_end_cb=&SndTaskEndCB; + MusicSettingsRst; + music.tempo= 3.636; + music.stacatto_factor= 0.902; + while (TRUE) { + Play("3q.EeDqED2G3DhE"); + Play("q.EeDqED2G3DhE"); + Play("q.FeEFEqF2G3EhF"); + Play("q.FeEFEqF2G3EhF"); + } +} + +U0 Span() +{ + I64 msg_code,a1,a2; + MyMass *tempm1=NULL,*tempm2=NULL; + MySpring *temps; + CCtrl *bt_run,*bt_mode; + U8 *src; + CDC *dc=DCAlias; + + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + Fs->text_attr=BROWN<<4+BLACK; + AutoComplete; + WinBorder; + WinMax; + DocCursor; + Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs); + + bt_run =CtrlButtonNew(0,0, 80,, + 2,"Stopped\0Running\0",run_colors,&run_button); + bt_mode=CtrlButtonNew(0,3.0*FONT_HEIGHT,80,, + MD_NUM_MODES,Define("ST_SPAN_MODES"),mode_colors,&mode_button); + a.saved_ode=NULL; + + Fs->win_inhibit|=WIG_DBL_CLICK; + + MenuPush( + "File {" + " New(,CH_CTRLN);" + " Open(,CH_CTRLO);" + " SaveAs(,CH_CTRLA);" + " Abort(,CH_SHIFT_ESC);" + " Exit(,CH_ESC);" + "}" + "Play {" + " Restart(,'\n');" + " RunStop(,CH_SPACE);" + " Mass(,'m');" + " Concrete(,'c');" + " Steel(,'s');" + " Wire(,'w');" + " Move(,'v');" + " Delete(,'d');" + "}" + ); + + ode=NULL; + Init(&a); + Fs->animate_task=Spawn(&AnimateTask,&a,"Animate",,Fs); + Fs->draw_it=&DrawIt; + + PopUpOk( + "Build a bridge to hold-up the\n" + "red masses. Test your design\n" + "by pressing run/stop.\n\n" + "The lowest cost bridge that\n" + "stays standing wins.\n\n" + "For a variation, try without\n" + "using the center base point.\n" + "\n" + "Use\n" + "\t$$GREEN$$'m'$$FG$$ass\n" + "\t$$GREEN$$'c'$$FG$$oncrete\n" + "\t$$GREEN$$'s'$$FG$$teel\n" + "\t$$GREEN$$'w'$$FG$$ire\n" + "\nto sel materials.\n"); + + try { + while (TRUE) { + msg_code=GetMsg(&a1,&a2,1<=MD_NUM_MODES) + mode_button.state=0; + cursor_mass=tempm1=tempm2=NULL; + break; + case MSG_KEY_DOWN: + switch (a1) { + case '\n': + if (!SpanTime || !a.saved_ode) { + Free(a.saved_ode); + a.saved_ode=SpanSave(ode); + } + Init(&a); + break; + case CH_CTRLN: + Free(a.saved_ode); + a.saved_ode=NULL; + Init(&a); + break; + case CH_CTRLO: + if (src=SpanRead) { + Free(a.saved_ode); + a.saved_ode=src; + Init(&a); + } + break; + case CH_CTRLA: + if (!SpanTime || !a.saved_ode) { + Free(a.saved_ode); + a.saved_ode=SpanSave(ode); + } + Init(&a); + SpanWrite(ode); + break; + case CH_SPACE: + run_button.state=!run_button.state; + break; + case 'c': + mode_button.state=MD_CONCRETE; + break; + case 's': + mode_button.state=MD_STEEL; + break; + case 'w': + mode_button.state=MD_WIRE; + break; + case 'm': + mode_button.state=MD_MASS; + break; + case 'v': + mode_button.state=MD_MOVE; + break; + case 'd': + mode_button.state=MD_DELETE; + break; + case CH_ESC: + if (!SpanTime || !a.saved_ode) { + Free(a.saved_ode); + a.saved_ode=SpanSave(ode); + } + Init(&a); + SpanWrite(ode); + case CH_SHIFT_ESC: + goto span_done; + } + break; + } + } +span_done: //Don't goto out of try + GetMsg(,,1< compile chk feature. -*/ -#define HEX_SIDE 11 - -U0 InitDefines1() -{ - CTask *rotate_tank_task; - F64 d; - PopUpFile("/Demo/Graphics/RotateTank.CPP",FALSE,NULL,&rotate_tank_task); - PopUpOk("This aspires to be a rip-off of\n" - "the Perfect General, but has tank\n" - "facing like the board game,\n" - "Stalin's Tanks.\n"); - if (!PopUpNoYes("Tournament Settings")) { - d=PopUpRangeF64Log(300,2000,20,"%4f","Map Width In Pixs\n"); - DefinePrint("MAP_WIDTH","%f",d); - DefinePrint("MAP_HEIGHT","%f",480.0/640.0*d); - d=PopUpRangeF64Exp(8,512,2,"%3f","Player 2 Units\n"); - DefinePrint("MAX_UNITS","%f",d); - d=PopUpRangeF64(0.2,1.01,0.05,"%4.2f to 1.00","Player1:Player2 Odds\n"); - DefinePrint("P1_TO_P2_ODDS","%4.2f",d); - d=PopUpRangeF64(0,100,10,"%3f% %%","Player 1 Armor Percent\n"); - DefinePrint("PLAYER_1_ARMOR_PERCENT","%f",d); - d=PopUpRangeF64(0,100,10,"%3f% %%","Player 2 Armor Percent\n"); - DefinePrint("PLAYER_2_ARMOR_PERCENT","%f",d); - } - DefinePrint("DCOS","%12.9f",HEX_SIDE*Cos(60.0/180*ã)); - DefinePrint("DSIN","%12.9f",HEX_SIDE*Sin(60.0/180*ã)); - d=PopUpRangeF64(0,100,25,"%3f% %%","Animation Delay\n"); - DefinePrint("ANIMATION_DELAY","%5.3f",d/100.0); - Seed(PopUpGetI64("Seed(0x%X):",Seed)); - XTalk(rotate_tank_task," "); - TaskWait(rotate_tank_task); - Kill(rotate_tank_task); -} InitDefines1; - -U0 InitDefines2() -{ - DefinePrint("HEX_RADIUS","%12.9f",DSIN+0.01); //slop -} InitDefines2; - -I64 map_cols=(MAP_WIDTH-DCOS)/(2*HEX_SIDE+2*DCOS), - map_rows=ToI64((MAP_HEIGHT-DSIN)/DSIN)&~1, - map_width=map_cols*(2*HEX_SIDE+2*DCOS)+DCOS, - map_height=map_rows*DSIN+DSIN+1; - -CDC *map_dc; -U8 terrain[map_rows][map_cols]; - -//Centers of hexes -class Pt -{ - F64 x,y; -}; -Pt hex_centers[map_rows][map_cols]; - -I64 show_visible_row,show_visible_col; -Bool roads[map_rows][map_cols], - rivers[map_rows][map_cols], - visible_map[map_rows][map_cols]; - -//Other options for PLAINS are WHITE or YELLOW -#define PLAINS LTGREEN -#define TREES GREEN -#define MOUNTAINS DKGRAY - -U8 movement_costs[16]; -movement_costs[PLAINS]=2; -movement_costs[TREES]=6; -movement_costs[MOUNTAINS]=10; - -//These are used to display a range circle when they player -//is firing. -F64 fire_radius,fire_radius_x,fire_radius_y; - -//These display "phase", "turn" and "game over". -U8 msg_buf[STR_LEN]; -I64 msg_off_timeout; //Jiffies. Goes away after a time. - -/*I got tricky by not defining a color -right away in these $LK,"CSprite",A="MN:CSprite"$s so they can -work for both players by setting dc->color -before drawing them. I actually made these -graphics by defining a color in the -menu, drawing the unit and deleting the color. - -I had to leave a gap between the tank tread -and body because of how it is rendered when rotated. -*/ - -$SP,"<1>",BI=1$ - -$SP,"<2>",BI=2$ - -//This is an infantry. - -$SP,"<3>",BI=3$ - -$SP,"<4>",BI=4$ - -$SP,"<5>",BI=5$ - -//Unit types -#define UT_INFANTRY 0 -#define UT_ARTILLERY 1 -#define UT_LT_TANK 2 -#define UT_MD_TANK 3 - -class Unit -{ - U8 *img; - I64 num,row,col, - armored_attack,unarmored_attack,armor; - I8 type,player,facing,movement,life, - range,remaining_movement,accuracy; - Bool visible[2],fired,infantry,indirect_fire,pad[3]; -}; - -Unit units[2][MAX_UNITS]; - -// Bt(visible_unit_bitmap,player1+player0*((MAX_UNITS+7)&~7)) -U8 visible_unit_bitmap[2][(((MAX_UNITS+7)&~7)*MAX_UNITS)>>3]; - -#define PHASE_START 0 -#define PHASE_PLOT 0 -#define PHASE_PLOT0 0 -#define PHASE_PLOT1 1 -#define PHASE_MOVE 2 -#define PHASE_MOVE0 2 -#define PHASE_MOVE1 3 -#define PHASE_FIRE 4 -#define PHASE_FIRE0 4 -#define PHASE_FIRE1 5 -#define PHASE_END 6 - -I64 phase,cur_player,enemy_player,view_player,turn, - cursor_row,cursor_col,alive_cnt[2], - plot_routines[2],move_routines[2],fire_routines[2]; - -U0 Toward(I64 *_row,I64 *_col,I64 direction) -{ - switch (direction) { - case 0: - *_row-=2; - break; - case 1: - if (*_row&1) *_col+=1; - *_row-=1; - break; - case 2: - if (*_row&1) *_col+=1; - *_row+=1; - break; - case 3: - *_row+=2; - break; - case 4: - if (!(*_row&1)) *_col-=1; - *_row+=1; - break; - case 5: - if (!(*_row&1)) *_col-=1; - *_row-=1; - break; - } -} - -I64 FacingChg(I64 f1,I64 f2) -{ - I64 res=(f1+6-f2)%6; - if (res>=3) - return 6-res; - else - return res; -} - -U0 RowCol2XY(F64 *_x,F64 *_y,I64 row,I64 col) -{ - Pt *c; - row=ClampI64(row,0,map_rows); - col=ClampI64(col,0,map_cols); - c=&hex_centers[row][col]; - *_x=c->x; - *_y=c->y; -} - -U0 XY2RowCol(I64 *_row,I64 *_col,F64 x,F64 y) -{ - *_col=(x-DCOS/2)/(HEX_SIDE+DCOS); - if (*_col&1) - *_row=ToI64((y-DSIN)/(2*DSIN))*2+1; - else - *_row=ToI64(y/(2*DSIN))*2; - *_col>>=1; - *_row=ClampI64(*_row,0,map_rows-1); - *_col=ClampI64(*_col,0,map_cols-1); -} - -Unit *FindUnit(I64 row,I64 col) -{//Finds unit in a hexagon. - I64 i,j; - for (j=0;j<2;j++) - for (i=0;i0 && - units[j][i].row==row && - units[j][i].col==col) - return &units[j][i]; - return NULL; -} - -Bool CursorInWindow(CTask *task,I64 x,I64 y) -{ - if (0<=x+task->scroll_xpix_width && - 0<=y+task->scroll_ypix_height) - return TRUE; - else - return FALSE; -} - -U0 UpdateCursor(CTask *task,I64 x,I64 y) -{ - if (CursorInWindow(task,x,y)) - XY2RowCol(&cursor_row, - &cursor_col,x+task->horz_scroll.pos,y+task->vert_scroll.pos); -} - -class LOSCtrl -{ - I64 r1,c1,r2,c2,distance; -}; - -Bool LOSPlot(LOSCtrl *l,I64 x,I64 y,I64 z) -{//We got tricky and used z as the distance from the start of the line. - I64 row,col; - XY2RowCol(&row,&col,x,y); - if ((row!=l->r1 || col!=l->c1) && - (row!=l->r2 || col!=l->c2) && - terrain[row][col]!=PLAINS) { - if (terrain[l->r1][l->c1]==MOUNTAINS) { - if (terrain[row][col]==MOUNTAINS || z>l->distance>>1) - return FALSE; - } else if (terrain[l->r2][l->c2]==MOUNTAINS) { - if (terrain[row][col]==MOUNTAINS || z<=l->distance>>1) - return FALSE; - } else - return FALSE; - } - return TRUE; -} - -Bool LOS(I64 r1,I64 c1,I64 r2,I64 c2) -{ - F64 x1,y1,x2,y2; - LOSCtrl l; - RowCol2XY(&x1,&y1,r1,c1); - RowCol2XY(&x2,&y2,r2,c2); - l.r1=r1; l.c1=c1; - l.r2=r2; l.c2=c2; - l.distance=Sqrt(SqrI64(x1-x2)+SqrI64(y1-y2)); - return Line(&l,x1,y1,0,x2,y2,l.distance,&LOSPlot); -} - -#define RV_ONE_FRIENDLY_UNIT 0 -#define RV_UPDATE_FRIENDLY_UNIT 1 -#define RV_FRIENDLY_UNIT_DIED 3 -#define RV_ONE_ENEMY_UNIT 4 -#define RV_ALL_UNITS 5 - -class MPCtrl1 -{ - I64 mode,lo,hi; - Unit *tempu; -}; - -U0 RVSetUp(I64 player) -{ - I64 i; - Unit *ut0,*ut1; - ut0=&units[player][0]; - ut1=&units[player^1][0]; - for (i=0;ivisible[player],0); - LBEqu(&ut0->visible[player],0,ut0->life>0); - } -} - -U0 RVMerge(I64 player) -{ - I64 i,j; - Unit *ut1; - U8 *dst,*src,*mask=CAlloc((MAX_UNITS+7)>>3); - for (j=0;j>3]; - dst=mask; - for (i=0;i<(MAX_UNITS+7)>>3;i++) //player1 - *dst++|=*src++; - } - ut1=&units[player^1][0]; - for (j=0;jvisible[player],0,Bt(mask,j) && ut1->life>0); - Free(mask); -} - -Bool MPRecalcVisible(MPCtrl1 *job) -{ - Bool res=FALSE,seen; - I64 i,j,row,col; - F64 x1,y1,x2,y2,dd,range; - Unit *ut0,*ut1; - ut0=&units[cur_player][job->lo]; - ut1=&units[enemy_player][job->lo]; - if (job->tempu) { - row=job->tempu->row; - col=job->tempu->col; - range=job->tempu->range*2*HEX_RADIUS; - range*=range; - } - switch (job->mode) { - case RV_UPDATE_FRIENDLY_UNIT: - case RV_ONE_FRIENDLY_UNIT: - if (job->mode==RV_UPDATE_FRIENDLY_UNIT) - range=MAX_F64; - RowCol2XY(&x1,&y1,row,col); - for (i=job->lo;ihi;i++,ut1++) { - seen=FALSE; - if (ut1->life>0 && - LOS(row,col,ut1->row,ut1->col)) { - RowCol2XY(&x2,&y2,ut1->row,ut1->col); - dd=Sqr(x2-x1)+Sqr(y2-y1); - if (ddvisible[cur_player],0); - } - } - if (job->mode==RV_UPDATE_FRIENDLY_UNIT) - LBEqu(&visible_unit_bitmap[cur_player], - i+job->tempu->num*((MAX_UNITS+7)&~7),seen); - } - break; - case RV_ONE_ENEMY_UNIT: - RowCol2XY(&x1,&y1,row,col); - for (i=job->lo;ihi;i++,ut1++) - if (ut1->life>0 && - LOS(row,col,ut1->row,ut1->col)) { - LBts(&visible_unit_bitmap[enemy_player], - job->tempu->num+i*((MAX_UNITS+7)&~7)); - res=TRUE; - } else - LBtr(&visible_unit_bitmap[enemy_player], - job->tempu->num+i*((MAX_UNITS+7)&~7)); - break; - case RV_ALL_UNITS: - ut0=&units[cur_player][0]; - for (i=0;ilife>0) { - RowCol2XY(&x1,&y1,ut0->row,ut0->col); - ut1=&units[enemy_player][job->lo]; - for (j=job->lo;jhi;j++,ut1++) { - if (ut1->life>0 && - LOS(ut0->row,ut0->col,ut1->row,ut1->col)) { - LBts(&ut1->visible[cur_player],0); - LBts(&visible_unit_bitmap[cur_player],j+i*((MAX_UNITS+7)&~7)); - } else - LBtr(&visible_unit_bitmap[cur_player],j+i*((MAX_UNITS+7)&~7)); - } - } else - for (j=job->lo;jhi;j++) - LBtr(&visible_unit_bitmap[cur_player],j+i*((MAX_UNITS+7)&~7)); - ut0=&units[enemy_player][0]; - for (i=0;ilife>0) { - RowCol2XY(&x1,&y1,ut0->row,ut0->col); - ut1=&units[cur_player][job->lo]; - for (j=job->lo;jhi;j++,ut1++) { - if (ut1->life>0 && - LOS(ut0->row,ut0->col,ut1->row,ut1->col)) { - LBts(&ut1->visible[enemy_player],0); - LBts(&visible_unit_bitmap[enemy_player],j+i*((MAX_UNITS+7)&~7)); - } else - LBtr(&visible_unit_bitmap[enemy_player],j+i*((MAX_UNITS+7)&~7)); - } - } else - for (j=job->lo;jhi;j++) - LBtr(&visible_unit_bitmap[enemy_player],j+i*((MAX_UNITS+7)&~7)); - break; - } - return res; -} - -Bool RecalcVisible(I64 mode,Unit *tempu=NULL) -{ - I64 i,hi,k,cnt; - Bool res; -/*The compiler doesn't go out of it's way -to know if something is const.;-) This -just compiles with the val at compile -time, an advantage of just-in-time over -AOT binaries. TempleOS has a limited -stk size, so don't get in the habit. -$LK,"MAlloc",A="MN:MAlloc"$() would probably be the better choice. -*/ - MPCtrl1 job[mp_cnt]; - CSrvCmd *cmd[mp_cnt]; - - if (mode==RV_FRIENDLY_UNIT_DIED) { - MemSet((&visible_unit_bitmap[enemy_player])(U8 *)+ - (tempu->num*((MAX_UNITS+7)&~7))>>3,0,(MAX_UNITS+7)>>3); - RVMerge(enemy_player); - return 0; //Return any value--don't care - } - - cnt=mp_cnt; //Cores - hi=MAX_UNITS; - if (mode==RV_ONE_ENEMY_UNIT) { - for (hi--;hi>=0;hi--) - if (units[enemy_player][hi].life>0) - break; - hi++; - } - k=hi; - if (hi/mp_cnt<2) - cnt=1; - for (i=0;ilo;jhi;j++) - for (i=0;irow,job->col,j,i)) - visible_map[j][i]=TRUE; - else - visible_map[j][i]=FALSE; -} - -U0 RecalcVisibleMap(I64 row,I64 col) -{ - I64 i,hi,k,cnt; - MPCtrl2 job[mp_cnt]; - CSrvCmd *cmd[mp_cnt]; - - cnt=mp_cnt; //Cores - hi=map_rows; - k=hi; - if (hi/mp_cnt<2) - cnt=1; - for (i=0;iinfantry) - res=0; - else { - res=FacingChg(facing,tempu->facing); - if (res>0) res--; - } - if (roads[r][c] && roads[tempu->row][tempu->col]) - res+=1; - else { - if (tempu->infantry) - res+=2; - else { - res+=movement_costs[terrain[r][c]]; - if (rivers[r][c]) - res=tempu->movement; - } - } - return res; -} - -I64 MoveOneHex(I64 *_row,I64 *_col,F64 x,F64 y) -{ - I64 direction,best_direction=-1,r,c; - F64 dd,best_dd,x1,y1; - RowCol2XY(&x1,&y1,*_row,*_col); - best_dd=Sqr(x1-x)+Sqr(y1-y); - for (direction=0;direction<6;direction++) { - r=*_row; c=*_col; - Toward(&r,&c,direction); - RowCol2XY(&x1,&y1,r,c); - dd=Sqr(x1-x)+Sqr(y1-y); - if (0<=r=0) { - Toward(_row,_col,best_direction); - return best_direction; - } else - return -1; -} - -Bool moving=FALSE; -I64 move_x,move_y; -F64 move_facing; -Unit *moving_unit; - -Bool MovePlot(U0,I64 x,I64 y,I64) -{ - move_x=x; move_y=y; - Sleep(5*ANIMATION_DELAY); - return TRUE; -} - -U0 MoveUnitAnimation(Unit *tempu,I64 r,I64 c,I64 facing) -{ - F64 x1,y1,x2,y2,f=facing*60.0*ã/180.0; - moving_unit=tempu; - RowCol2XY(&x1,&y1,tempu->row,tempu->col); - move_x=x1; move_y=y1; - moving=TRUE; - if (tempu->infantry) - Snd(300); - else { - move_facing=tempu->facing*60.0*ã/180.0; - Snd(150); - while (Wrap(f-move_facing,-ã)<=0) { - move_facing-=0.03; - Sleep(5*ANIMATION_DELAY); - } - while (Wrap(f-move_facing,-ã)>0) { - move_facing+=0.03; - Sleep(5*ANIMATION_DELAY); - } - Snd(100); - } - move_facing=f; - RowCol2XY(&x2,&y2,r,c); - Line(NULL,x1,y1,0,x2,y2,0,&MovePlot); - Snd(0); - moving_unit=NULL; - moving=FALSE; -} - -Bool MoveUnit(Unit *tempu,I64 x,I64 y) -{ - I64 r,c,r0=tempu->row,c0=tempu->col,i,facing; - while (tempu->remaining_movement>0) { - r=tempu->row; - c=tempu->col; - if ((facing=MoveOneHex(&r,&c,x,y))<0) - break; - else { - i=MoveCost(tempu,r,c,facing); - if (i>tempu->movement) - i=tempu->movement; - if (tempu->remaining_movement>=i && !FindUnit(r,c)) { - MoveUnitAnimation(tempu,r,c,facing); - tempu->facing=facing; - tempu->remaining_movement-=i; - tempu->row=r; - tempu->col=c; - RecalcVisible(RV_UPDATE_FRIENDLY_UNIT,tempu); - LBEqu(&tempu->visible[enemy_player],0, - RecalcVisible(RV_ONE_ENEMY_UNIT,tempu)); - } else - break; - } - } - if (tempu->row!=r0 || tempu->col!=c0) - return TRUE; - else - return FALSE; -} - -class IndirectOrders -{ - IndirectOrders *next,*last; - Unit *attacker; - I64 row,col; -} indirect_head; - -U0 PlotShot(Unit *tempu,I64 row,I64 col) -{ - IndirectOrders *tempi; - if (tempu->life<=0 || tempu->range<=0) - return; - tempu->fired=TRUE; - tempi=CAlloc(sizeof(IndirectOrders)); - tempi->attacker=tempu; - tempi->row=row; - tempi->col=col; - QueIns(tempi,indirect_head.last); -} - -Bool firing=FALSE; -I64 fire_x,fire_y; -Unit *target_unit; -Bool target_hit; -Bool indirect_explosion=FALSE; -I64 indirect_row,indirect_col; - -Bool FirePlot(U0,I64 x,I64 y,I64) -{ - fire_x=x; fire_y=y; - firing=TRUE; - Sleep(3*ANIMATION_DELAY); - return TRUE; -} - -U0 FireShot(Unit *tempu,Unit *target) -{ - I64 r,c,facing, - t1=terrain[tempu->row][tempu->col], - t2=terrain[target->row][target->col]; - F64 x1,y1,x2,y2,d,a,dammage=0,range_factor; - Bool hit; - - if (tempu->life<=0 || target->life<=0 || tempu->range<=0) - return; - RowCol2XY(&x1,&y1,tempu->row,tempu->col); - RowCol2XY(&x2,&y2,target->row,target->col); - - '\n\n'; - - d=100*Rand; - "+%5.2f Roll\n",d; - d+=tempu->accuracy; - "+%2d.00 Accuracy\n",tempu->accuracy; - - range_factor=Sqrt(Sqr(x2-x1)+Sqr(y2-y1))/(tempu->range*2*DSIN); - "-%5.2f%% of Range\n",100*range_factor; - d-=100*range_factor; - if (t2==TREES) { - "-30.00 Target in trees\n"; - d-=30; - } - if (t1==MOUNTAINS && t2!=MOUNTAINS) { - "+30.00 Down from mountains\n"; - d+=30; - } - "_______\n"; - if (d>=0) { - "+%5.2f Hit\n",d; - hit=TRUE; - } else { - "-%5.2f Miss\n",-d; - hit=FALSE; - } - - target_unit=target; - if (hit) { - target_hit=TRUE; - Noise(500*ANIMATION_DELAY,100,150); - Sleep(500*ANIMATION_DELAY); - } else { - target_hit=FALSE; - Noise(1000*ANIMATION_DELAY,750,1000); - Sleep(1000*ANIMATION_DELAY); - } - if (hit) - Line(NULL,x1,y1,0,x2,y2,0,&FirePlot); - else { - a=ã*2*Rand; - d=(0.5-d/100)*HEX_SIDE; - Line(NULL,x1,y1,0,x2+d*Cos(a),y2+d*Sin(a),0,&FirePlot); - } - firing=FALSE; - tempu->fired=TRUE; - if (hit) { - r=target->row;c=target->col; - if ((facing=MoveOneHex(&r,&c,x1,y1))>=0) - facing=FacingChg(facing,target->facing); - else - facing=0; - dammage=200.0*Rand; - "Raw dammage roll out of 200: %3f\n",dammage; - if (target->armor) { - d=target->armor/100.0*(5-facing)/5.0; - "Armor:%d-FacingAdjustment(%z) Yields:%5.2f Defense\n", - target->armor,facing,"Front\0Side\0Rear\0",100*d; - if (d>=0) { - dammage*=(tempu->armored_attack/100.0)/d; - "Armored Attack:%d\nRaw*Attack/Defense=%5.2f Dammage\n", - tempu->armored_attack,dammage; - } else - dammage=0; - } else { - d=1.0-range_factor; - if (d>0) { - "Range:%5.2f%% --> %5.2f%% Remaining\n", - 100*range_factor,100*d; - dammage*=(tempu->unarmored_attack/100.0)*d; - "Unarmored Attack:%d\nRaw*Attack*Remaining=%5.2f Dammage\n", - tempu->unarmored_attack,dammage; - } else - dammage=0; - } - dammage=Round(dammage); - if (dammage>0) { - "Life:%3d - Dammage:%3f =",target->life,dammage; - if (dammage>=target->life) { - "Killed\n"; - Noise(1000*ANIMATION_DELAY,1000,4000); - Sleep(1000*ANIMATION_DELAY); - target->life=0; - RecalcVisible(RV_FRIENDLY_UNIT_DIED,target); - alive_cnt[target->player]--; - } else { - if (target->armor) { - if (dammage>0.6*target->life) { - target->movement=0; - "Immobilized\n"; - } else - "No Penetration\n"; - } else { - target->life-=dammage; - "%d\n",target->life; - } - } - } - } - while (snd.freq) //see $LK,"Snd",A="MN:Snd"$() - Yield; - target_unit=NULL; -} - -I64 row_offsets[7]={-1,-2,-1,1,2,1,0}; -I64 col_offsets_even[7]={-1, 0, 0,0,0,-1,0}; -I64 col_offsets_odd [7]={ 0, 0, 1,1,0, 0,0}; - -U0 IndirectFireResolve() -{ - I64 i,r,c,facing; - F64 x1,y1,x2,y2,d,dammage=0,range_factor; - Unit *tempu,*target; - Bool hit; - IndirectOrders *tempi=indirect_head.next,*tempi1; - while (tempi!=*indirect_head) { - tempi1=tempi->next; - tempu=tempi->attacker; - RowCol2XY(&x1,&y1,tempu->row,tempu->col); - RowCol2XY(&x2,&y2,tempi->row,tempi->col); - - '\n\n'; - - d=100*Rand; - "+%5.2f Roll\n",d; - d+=tempu->accuracy; - "+%2d.00 Accuracy\n",tempu->accuracy; - - range_factor=Sqrt(Sqr(x2-x1)+Sqr(y2-y1))/(tempu->range*2*DSIN); - "-%5.2f%% of Range\n",100*range_factor; - d-=100*range_factor; - - '_______\n'; - if (d>=0) { - "+%5.2f Hit\n",d; - hit=TRUE; - } else { - "-%5.2f Miss\n",-d; - hit=FALSE; - } - - if (hit) { - Noise(500*ANIMATION_DELAY,100,150); - Sleep(500*ANIMATION_DELAY); - } else { - Noise(1000*ANIMATION_DELAY,750,1000); - Sleep(1000*ANIMATION_DELAY); - } - - if (!hit) { - i=RandU16%6; - if (tempi->row&1) - tempi->col+=col_offsets_odd[i]; - else - tempi->col+=col_offsets_even[i]; - tempi->row+=row_offsets[i]; - RowCol2XY(&x2,&y2,tempi->row,tempi->col); - } - Line(NULL,x1,y1,0,x2,y2,0,&FirePlot); - firing=FALSE; - tempu->fired=TRUE; - indirect_row=tempi->row; - indirect_col=tempi->col; - indirect_explosion=TRUE; - for (i=0;i<7;i++) { - if (tempi->row&1) - c=tempi->col+col_offsets_odd[i]; - else - c=tempi->col+col_offsets_even[i]; - r=tempi->row+row_offsets[i]; - if (0<=rarmor) { - d=target->armor/100.0*(5-facing)/5.0; - "Armor:%d-FacingAdjustment(%z) Yields:%5.2f Defense\n", - target->armor,facing,"Front\0Side\0Rear\0",100*d; - if (d>=0) { - dammage*=(tempu->armored_attack/100.0)/d; - "Armored Attack:%d\nRaw*Attack/Defense=%5.2f Dammage\n", - tempu->armored_attack,dammage; - } else - dammage=0; - } else { - d=1.0-range_factor; - if (d>0) { - "Range:%5.2f%% --> %5.2f%% Remaining\n", - 100*range_factor,100*d; - dammage*=(tempu->unarmored_attack/100.0)*d; - "Unarmored Attack:%d\nRaw*Attack*Remaining=%5.2f Dammage\n", - tempu->unarmored_attack,dammage; - } else - dammage=0; - } - dammage=Round(dammage); - if (dammage>0) { - "Life:%3d - Dammage:%3f =",target->life,dammage; - if (dammage>=target->life) { - 'Killed\n'; - target->life=0; - RecalcVisible(RV_FRIENDLY_UNIT_DIED,target); - alive_cnt[target->player]--; - } else { - if (target->armor) { - if (dammage>0.6*target->life) { - target->movement=0; - "Immobilized\n"; - } else - "No Penetration\n"; - } else { - target->life-=dammage; - "%d\n",target->life; - } - } - } - } - } - Noise(2000*ANIMATION_DELAY,800,1000); - Sleep(2000*ANIMATION_DELAY); - while (snd.freq) //see $LK,"Snd",A="MN:Snd"$() - Yield; - indirect_explosion=FALSE; - - QueRem(tempi); - Free(tempi); - tempi=tempi1; - } -} - -U0 DrawHexes() -{ - F64 dx=2*HEX_SIDE+2*DCOS,dy=2*DSIN, - x,y,x1,y1,x2,y2; - I64 i,j; - map_dc->color=WHITE; - GrRect(map_dc,0,0,map_dc->width,map_dc->height); - map_dc->color=BLACK; - y=0; - for (j=0;jcolor=terrain[j][i]; - RowCol2XY(&x,&y,j,i); - GrFloodFill(map_dc,x,y); - } -} - -U0 DrawRivers() -{ - I64 i,j,k,r,c; - F64 x1,y1,x2,y2; - for (j=0;jcolor=LTBLUE; - map_dc->pen_width=4; - GrLine3(map_dc,x1,y1,0,x2,y2,0); - map_dc->color=BLUE; - map_dc->pen_width=2; - GrLine3(map_dc,x1,y1,0,x2,y2,0); - } - } - } - } -} - -U0 DrawRoads() -{ - I64 i,j,k,r,c; - F64 x1,y1,x2,y2; - map_dc->color=RED; - map_dc->pen_width=3; - for (j=0;jcolor=BLACK; - for (j=0;jplayer=j; - tempu->num=i; - tempu->life=100; - tempu->facing=RandU16%6; - if (!j) { - if (i>=Round(MAX_UNITS*P1_TO_P2_ODDS*PLAYER_1_ARMOR_PERCENT/100.0)) { - if (Round(i-MAX_UNITS*P1_TO_P2_ODDS*PLAYER_1_ARMOR_PERCENT/100.0)>= - Round(0.85*(MAX_UNITS-MAX_UNITS*P1_TO_P2_ODDS* - PLAYER_1_ARMOR_PERCENT/100.0))) - type=UT_ARTILLERY; - else - type=UT_INFANTRY; - } else { - if (i>=Round(0.5*MAX_UNITS*P1_TO_P2_ODDS* - PLAYER_1_ARMOR_PERCENT/100.0)) - type=UT_MD_TANK; - else - type=UT_LT_TANK; - } - } else { - if (i>=Round(MAX_UNITS*PLAYER_2_ARMOR_PERCENT/100.0)) { - if (Round(i-MAX_UNITS*PLAYER_2_ARMOR_PERCENT/100.0)>= - Round(0.85*(MAX_UNITS-MAX_UNITS*PLAYER_2_ARMOR_PERCENT/100.0))) - type=UT_ARTILLERY; - else - type=UT_INFANTRY; - } else { - if (i>=Round(0.5*MAX_UNITS*PLAYER_2_ARMOR_PERCENT/100.0)) - type=UT_MD_TANK; - else - type=UT_LT_TANK; - } - } - tempu->type=type; - switch (type) { - case UT_INFANTRY: - tempu->infantry=TRUE; - tempu->indirect_fire=FALSE; - tempu->armor =0; - tempu->armored_attack =15; - tempu->unarmored_attack=180; - tempu->accuracy=45; - tempu->range =5; - tempu->movement=4; - tempu->img =$IB,"<3>",BI=3$; - break; - case UT_ARTILLERY: - tempu->infantry=TRUE; - tempu->indirect_fire=TRUE; - tempu->armor =0; - tempu->armored_attack =75; - tempu->unarmored_attack=180; - tempu->accuracy=25; - tempu->range =20; - tempu->movement=2; - tempu->img =$IB,"<4>",BI=4$; - break; - case UT_LT_TANK: - tempu->infantry=FALSE; - tempu->indirect_fire=FALSE; - tempu->armor =30; - tempu->armored_attack =40; - tempu->unarmored_attack=60; - tempu->accuracy=25; - tempu->range =8; - tempu->movement=24; - tempu->img =$IB,"<2>",BI=2$; - break; - case UT_MD_TANK: - tempu->infantry=FALSE; - tempu->indirect_fire=FALSE; - tempu->armor =60; - tempu->armored_attack =60; - tempu->unarmored_attack=80; - tempu->accuracy=25; - tempu->range =12; - tempu->movement=16; - tempu->img =$IB,"<1>",BI=1$; - break; - } - do { - row=RandU32%map_rows; - col=RandU32%(map_cols/3); - if (j) - col+=2*map_cols/3; - } while (FindUnit(row,col)); - tempu->row=row; - tempu->col=col; - LBts(&tempu->visible[cur_player],0); - } -} - -U0 NewTurn() -{ - I64 i,j; - for (j=0;j<2;j++) - for (i=0;i=PHASE_END) { - IndirectFireResolve; - NewTurn; - } - - Fs->border_src=BDS_CONST; - if (phase&~1==PHASE_PLOT) - Fs->border_attr=WHITE<<4+PURPLE; - else if (phase&~1==PHASE_MOVE) - Fs->border_attr=WHITE<<4+GREEN; - else - Fs->border_attr=WHITE<<4+RED; - - SleepUntil(msg_off_timeout); - msg_off_timeout=cnts.jiffies+JIFFY_FREQ*2*ANIMATION_DELAY+1; - Snd(1000); - switch (phase) { - case PHASE_PLOT0: - case PHASE_PLOT1: - StrPrint(msg_buf,"Player %d Artillery Plot",cur_player+1); - break; - case PHASE_MOVE0: - case PHASE_MOVE1: - StrPrint(msg_buf,"Player %d Move",cur_player+1); - break; - case PHASE_FIRE0: - case PHASE_FIRE1: - StrPrint(msg_buf,"Player %d Fire",cur_player+1); - break; - } -} - -U0 SetViewPlayer(I8 p) -{ - CMenuEntry *tempse; - view_player=p; - if (tempse=MenuEntryFind(Fs->cur_menu,"View/Player1")) - tempse->checked= view_player==0; - if (tempse=MenuEntryFind(Fs->cur_menu,"View/Player2")) - tempse->checked= view_player==1; -} - -U0 Init() -{ - moving_unit=NULL; - InitMap; - SetViewPlayer(cur_player=0); - enemy_player=1; - Fs->horz_scroll.pos=0; - Fs->vert_scroll.pos=0; - InitUnits; - QueInit(&indirect_head); - turn=0; - fire_radius=0; - show_visible_row=-1; - show_visible_col=-1; - *msg_buf=0; - msg_off_timeout=0; - phase=PHASE_END; -} - -U0 CleanUp() -{ - QueDel(&indirect_head,TRUE); -} - -U0 HandleChar(U8 ch) -{ - I64 old_inhibit,old_draw_it; - Bool old_cursor; - switch (ch) { - case CH_ESC: - case CH_SHIFT_ESC: - throw('ExitGame',TRUE); - case CH_SPACE: - throw('PhaseOvr',TRUE); - case '\n': - throw('NewGame',TRUE); - case '1': - SetViewPlayer(0); - break; - case '2': - SetViewPlayer(1); - break; - case '3': - old_draw_it=Fs->draw_it; - old_inhibit=Fs->win_inhibit; - Fs->draw_it=Fs->next_settings->draw_it; - Fs->win_inhibit=WIG_USER_TASK_DFT; - old_cursor=DocCursor(ON); - DocBottom; - View; - DocBottom; - DocCursor(old_cursor); - Fs->win_inhibit=old_inhibit; - Fs->draw_it=old_draw_it; - break; - } -} - -U0 CheckUser() -{ - I64 ch; - if (!alive_cnt[0] || !alive_cnt[1]) - throw('GameOver',TRUE); - if (ch=ScanChar) - HandleChar(ch); -} - -U0 PickAI(U8 *dirname,I64 player) -{ - I64 i=0; - U8 *st; - CDirEntry *tempde,*tempde1,*tempde2; - CDoc *doc=DocNew; - Bool *old_silent=Silent; - st=MStrPrint("%s/*.CPP*",dirname); - tempde=FilesFind(st); - Free(st); - tempde2=FilesFind("~/ToTheFront/*.CPP*"); - tempde1=tempde; - Silent(old_silent); - - DocPrint(doc,"Player %d Type\n\n$$LTBLUE$$",player+1); - while (tempde1) { - if (!(i++&3)) - DocPrint(doc,"\n"); - st=StrNew(tempde1->name); - FileExtRem(st); - tempde1->user_data=DocPrint(doc,"$$MU-UL,\"%-10ts\",LE=%d$$ ",st,tempde1); - Free(st); - tempde1=tempde1->next; - } - tempde1=tempde2; - while (tempde1) { - if (!(i++&3)) - DocPrint(doc,"\n"); - st=StrNew(tempde1->name); - FileExtRem(st); - tempde1->user_data=DocPrint(doc,"$$MU-UL,\"%-10ts\",LE=%d$$ ",st,tempde1); - Free(st); - tempde1=tempde1->next; - } - DocPrint(doc,"\n\n\n$$FG$$Create your own AI in ~/ToTheFront."); - while ((tempde1=PopUpMenu(doc))<=0); - ExeFile(tempde1->full_name); - DocDel(doc); - DirTreeDel(tempde); - DirTreeDel(tempde2); - ExePrint("plot_routines[%d]=&TanksPlot;" - "move_routines[%d]=&TanksMove;" - "fire_routines[%d]=&TanksFire;",player,player,player); -} - -U0 DrawUnit(CTask *task,CDC *dc,Unit *tempu,I64 x,I64 y,F64 f) -{ - if (tempu->infantry) - Sprite3(dc,x-task->horz_scroll.pos,y-task->vert_scroll.pos,0, - tempu->img); - else - SpriteZ3B(dc,x-task->horz_scroll.pos,y-task->vert_scroll.pos,0, - tempu->img,f); - if (phase&~1==PHASE_PLOT && tempu->indirect_fire && - !tempu->fired && tempu->player==cur_player) { - dc->pen_width=2; - if (cur_player) - dc->color=PURPLE; - else - dc->color=CYAN; - GrCircle3(dc,x-task->horz_scroll.pos,y-task->vert_scroll.pos,0, - 20*Saw(4*tS,2.0)); - GrCircle3(dc,x-task->horz_scroll.pos,y-task->vert_scroll.pos,0, - 20*Saw(4*tS+1.0,2.0)); - dc->pen_width=1; - } -} - -U0 DrawUnits(CTask *task,CDC *dc) -{ - I64 i,j; - F64 x,y; - Unit *tempu; - for (j=0;j<2;j++) { - for (i=0;icolor=RED; - else - dc->color=GREEN; - } else { - if (j) - dc->color=LTPURPLE; - else - dc->color=LTCYAN; - } - if (tempu->life>0 && Bt(&tempu->visible[view_player],0) && - tempu!=moving_unit) { - RowCol2XY(&x,&y,tempu->row,tempu->col); - if (phase&~1==PHASE_MOVE && tempu->remaining_movement || - (phase&~1==PHASE_PLOT&& tempu->indirect_fire|| - phase&~1==PHASE_FIRE&&!tempu->indirect_fire) && !tempu->fired || - Blink(5)) - DrawUnit(task,dc,tempu,x,y,tempu->facing*60.0*ã/180.0); - } - } - } -} - -U0 DrawIt(CTask *task,CDC *dc) -{ - F64 x,y; - I64 h,v,i,j,r,c; - U8 buf[STR_LEN]; - IndirectOrders *tempi; - - task->horz_scroll.min=0; - task->horz_scroll.max=map_width-task->pix_width; - task->vert_scroll.min=-FONT_HEIGHT; - task->vert_scroll.max=map_height-task->pix_height; - TaskDerivedValsUpdate(task); - h=task->horz_scroll.pos; - v=task->vert_scroll.pos; - - map_dc->flags|=DCF_NO_TRANSPARENTS; - GrBlot(dc,-h,-v,map_dc); - - i=ip.pos.x-task->pix_left-task->scroll_x; - j=ip.pos.y-task->pix_top -task->scroll_y; - if (CursorInWindow(task,i,j)) - UpdateCursor(task,i,j); - RowCol2XY(&x,&y,cursor_row,cursor_col); - - //Roads require multiple cursor fills - dc->color=YELLOW; - c=terrain[cursor_row][cursor_col]; - for (i=-(HEX_SIDE+DCOS)/2;i<=(HEX_SIDE+DCOS)/2;i++) { - if (GrPeek(dc,x+i-h,y-v)==c) - GrFloodFill(dc,x+i-h,y-v); - for (j=-HEX_SIDE/2;j<=HEX_SIDE/2;j++) - if (GrPeek(dc,x+j-h,y+i-v)==c) - GrFloodFill(dc,x+j-h,y+i-v); - } - - DrawUnits(task,dc); - if (firing) { - dc->color=BLACK; - GrCircle(dc,fire_x-h,fire_y-v,2); - } - if (indirect_explosion) { - for (i=0;i<7;i++) { - if (indirect_row&1) - c=indirect_col+col_offsets_odd[i]; - else - c=indirect_col+col_offsets_even[i]; - r=indirect_row+row_offsets[i]; - if (0<=rcolor=LTRED; - else - dc->color=YELLOW; - GrCircle(dc,x+RandU16%HEX_SIDE-HEX_SIDE/2-h, - y+RandU16%HEX_SIDE-HEX_SIDE/2-v,2); - } - } - } - } - if (moving_unit && moving_unit->visible[view_player]) { - dc->color=YELLOW; - DrawUnit(task,dc,moving_unit,move_x,move_y,move_facing); - } - ProgressBarsRst; - if (moving_unit) { - if (ip.pos.ymovement; - progress4=moving_unit->remaining_movement; - } else { - progress1_max=moving_unit->movement; - progress1=moving_unit->remaining_movement; - } - } - if (fire_radius) { - dc->color=YELLOW; - GrCircle(dc,fire_radius_x-h,fire_radius_y-v,fire_radius-1); - GrCircle(dc,fire_radius_x-h,fire_radius_y-v,fire_radius+1); - dc->color=RED; - GrCircle(dc,fire_radius_x-h,fire_radius_y-v,fire_radius); - } - if (Blink(10)) { - tempi=indirect_head.next; - while (tempi!=&indirect_head) { - if (tempi->attacker->player==view_player) { - RowCol2XY(&x,&y,tempi->row,tempi->col); - Sprite3(dc,x-task->horz_scroll.pos,y-task->vert_scroll.pos,0,$IB,"<5>",BI=5$); - } - tempi=tempi->next; - } - } - if (Bt(kbd.down_bitmap,SC_SHIFT)) { - if (show_visible_row!=cursor_row || show_visible_col!=cursor_col) { - show_visible_row=cursor_row; - show_visible_col=cursor_col; - RecalcVisibleMap(show_visible_row,show_visible_col); - } - - dc->color=LTGRAY; - for (j=0;jcolor=BLACK; - GrRect(dc,(task->pix_width-i)>>1-10-task->scroll_x, - (task->pix_height-FONT_HEIGHT)>>1-10-task->scroll_y, - i+20,FONT_HEIGHT+20); - - dc->color=YELLOW; - GrRect(dc,(task->pix_width-i)>>1-7-task->scroll_x, - (task->pix_height-FONT_HEIGHT)>>1-7-task->scroll_y, - i+14,FONT_HEIGHT+14); - - dc->color=RED; - GrPrint(dc,(task->pix_width-i)>>1-task->scroll_x, - (task->pix_height-FONT_HEIGHT)>>1-task->scroll_y, - msg_buf); - if (msg_off_timeout) { - if (msg_off_timeout-cnts.jiffies<3*JIFFY_FREQ/2*ANIMATION_DELAY) - Snd(0); - if (cnts.jiffies>msg_off_timeout) - *msg_buf=0; - } - } - - dc->color=WHITE; - GrRect(dc,-task->scroll_x,-task->scroll_y, - (13+7+10+10)*FONT_WIDTH,FONT_HEIGHT); - - if (phase&~1==PHASE_PLOT) { - dc->color=PURPLE; - StrPrint(buf,"Turn:%2d Artillery",turn); - } else if (phase&~1==PHASE_MOVE) { - dc->color=GREEN; - StrPrint(buf,"Turn:%2d Move",turn); - } else { - dc->color=RED; - StrPrint(buf,"Turn:%2d Fire",turn); - } - GrPrint(dc,-task->scroll_x,-task->scroll_y,buf); - - StrPrint(buf,"%3d Units",alive_cnt[0]); - if (cur_player || Blink) - dc->color=CYAN; - else - dc->color=LTCYAN; - GrPrint(dc,-task->scroll_x+(13+7)*FONT_WIDTH,-task->scroll_y,buf); - - StrPrint(buf,"%3d Units",alive_cnt[1]); - if (!cur_player || Blink) - dc->color=PURPLE; - else - dc->color=LTPURPLE; - GrPrint(dc,-task->scroll_x+(13+7+10)*FONT_WIDTH,-task->scroll_y,buf); -} - -U0 TaskEndCB() -{ - Snd(0); - progress4=progress4_max=progress1=progress1_max=0; - Exit; -} - -I64 DoPhase() -{ - I64 res='ExitGame'; - NewPhase; - try { - if (phase&~1==PHASE_PLOT) - Call(plot_routines[cur_player]); - else if (phase&~1==PHASE_MOVE) - Call(move_routines[cur_player]); - else - Call(fire_routines[cur_player]); - } catch { - res=Fs->except_ch; - Fs->catch_except=TRUE; - } - return res; -} - -U0 ToTheFront() -{ - I64 res,ch; - map_dc=DCNew(MAP_WIDTH,MAP_HEIGHT); - - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - Cd(__DIR__); - Fs->win_inhibit|=WIF_SELF_IP_L|WIF_SELF_IP_R|WIG_DBL_CLICK; - - MenuPush( - "File {" - " Abort(,CH_SHIFT_ESC);" - " Exit(,CH_ESC);" - "}" - "Play {" - " EndPhase(,CH_SPACE);" - " Restart(,'\n');" - "}" - "View {" - " Player1(,'1');" - " Player2(,'2');" - " ShowOdds(,'3');" - " LOS(,0,SCF_SHIFT);" - "}" - ); - - AutoComplete; - WinBorder(ON); - WinMax; - DocCursor; - DocClear; - Init; - PickAI("AIs",0); - PickAI("AIs",1); - - PopUpOk("Left-click to move or fire units.\n" - "$$GREEN$$$$FG$$ or right-click to end phase.\n" - "$$GREEN$$\t $$FG$$ to show line-of-sight.\n" - "$$GREEN$$\t $$FG$$ to start new game.\n" - "$$GREEN$$ 1\t $$FG$$ Player 1 view.\n" - "$$GREEN$$ 2\t $$FG$$ Player 2 view.\n" - "$$GREEN$$ 3\t $$FG$$ View odds calculations."); - Fs->task_end_cb=&TaskEndCB; // - Fs->draw_it=&DrawIt; - "$$GREEN$$$$FG$$ to return to game.\n"; - - try { - do { - res=DoPhase; - if (res=='GameOver') { - while (TRUE) { - msg_off_timeout=0; - StrCpy(msg_buf,"Game Over"); - Snd(0); - ch=GetChar(,FALSE); - if (ch=='\n') { - CleanUp; - Init; - break; - } else if (ch==CH_ESC || ch==CH_SHIFT_ESC) { - res='ExitGame'; - break; - } else if (ch=='1') - SetViewPlayer(0); - else if (ch=='2') - SetViewPlayer(1); - } - } else if (res=='NewGame') { - CleanUp; - Init; - } - } while (res!='ExitGame'); - } catch - PutExcept; - ProgressBarsRst; - - SettingsPop; - MenuPop; - DCDel(map_dc); - CleanUp; - Seed; -} -L ÿÿÿÿüÿÿÿ úÿÿÿ üÿÿÿúÿÿÿþÿÿÿ -øÿÿÿ üÿÿÿüÿÿÿ -ûÿÿÿûÿÿÿûÿÿÿ -ûÿÿÿ -ûÿÿÿ -ûÿÿÿûÿÿÿûÿÿÿ -üÿÿÿüÿÿÿ -üÿÿÿüÿÿÿG ÿÿÿÿýÿÿÿ -üÿÿÿ -þÿÿÿüÿÿÿþÿÿÿ -úÿÿÿÏ þÿÿÿþÿÿÿ -ÿÿÿÿýÿÿÿýÿÿÿ -ÿÿÿÿüÿÿÿüÿÿÿ -üÿÿÿ -ýÿÿÿ -þÿÿÿûÿÿÿûÿÿÿ -ýÿÿÿüÿÿÿ -þÿÿÿýÿÿÿþÿÿÿüÿÿÿ -ýÿÿÿýÿÿÿýÿÿÿ -ýÿÿÿ - -ÿÿÿÿÿÿÿÿ< -þÿÿÿ -þÿÿÿ \ No newline at end of file diff --git a/Apps/ToTheFront/ToTheFront.HC b/Apps/ToTheFront/ToTheFront.HC new file mode 100644 index 0000000..b2181a8 --- /dev/null +++ b/Apps/ToTheFront/ToTheFront.HC @@ -0,0 +1,1757 @@ +/* +Alteration Ideas: + * Add another fire phase + * Add opportunity fire + * Add overruns + * Add close assaults + * Add more unit types + * Add artillery + * Add aircraft + * Add troop transport + * Add land mines + * Add buildings + * Adjust terrain cost + * Adjust terrain defense bonuses + * Add bridges + * Add amphibious scenareos + * Add vehicle wreckage + * Add scoring + * Add game turn limit +*/ + +#define MAP_WIDTH 603 +#define MAP_HEIGHT 452 +#define MAX_UNITS 32 +#define P1_TO_P2_ODDS 1.0 +#define PLAYER_1_ARMOR_PERCENT 50 +#define PLAYER_2_ARMOR_PERCENT 50 + +/*Consts are often faster when compiled. +This is an advantage of just-in-time compilation. +You can't change them when you start a +game over, however. A down-side of this +is you can't use the compile chk feature. +*/ +#define HEX_SIDE 11 + +U0 InitDefines1() +{ + CTask *rotate_tank_task; + F64 d; + PopUpFile("/Demo/Graphics/RotateTank.HC",FALSE,NULL,&rotate_tank_task); + PopUpOk("This aspires to be a rip-off of\n" + "the Perfect General, but has tank\n" + "facing like the board game,\n" + "Stalin's Tanks.\n"); + if (!PopUpNoYes("Tournament Settings")) { + d=PopUpRangeF64Log(300,2000,20,"%4f","Map Width In Pixs\n"); + DefinePrint("MAP_WIDTH","%f",d); + DefinePrint("MAP_HEIGHT","%f",480.0/640.0*d); + d=PopUpRangeF64Exp(8,512,2,"%3f","Player 2 Units\n"); + DefinePrint("MAX_UNITS","%f",d); + d=PopUpRangeF64(0.2,1.01,0.05,"%4.2f to 1.00","Player1:Player2 Odds\n"); + DefinePrint("P1_TO_P2_ODDS","%4.2f",d); + d=PopUpRangeF64(0,100,10,"%3f% %%","Player 1 Armor Percent\n"); + DefinePrint("PLAYER_1_ARMOR_PERCENT","%f",d); + d=PopUpRangeF64(0,100,10,"%3f% %%","Player 2 Armor Percent\n"); + DefinePrint("PLAYER_2_ARMOR_PERCENT","%f",d); + } + DefinePrint("DCOS","%12.9f",HEX_SIDE*Cos(60.0/180*ã)); + DefinePrint("DSIN","%12.9f",HEX_SIDE*Sin(60.0/180*ã)); + d=PopUpRangeF64(0,100,25,"%3f% %%","Animation Delay\n"); + DefinePrint("ANIMATION_DELAY","%5.3f",d/100.0); + Seed(PopUpGetI64("Seed(0x%X):",Seed)); + XTalk(rotate_tank_task," "); + TaskWait(rotate_tank_task); + Kill(rotate_tank_task); +} InitDefines1; + +U0 InitDefines2() +{ + DefinePrint("HEX_RADIUS","%12.9f",DSIN+0.01); //slop +} InitDefines2; + +I64 map_cols=(MAP_WIDTH-DCOS)/(2*HEX_SIDE+2*DCOS), + map_rows=ToI64((MAP_HEIGHT-DSIN)/DSIN)&~1, + map_width=map_cols*(2*HEX_SIDE+2*DCOS)+DCOS, + map_height=map_rows*DSIN+DSIN+1; + +CDC *map_dc; +U8 terrain[map_rows][map_cols]; + +//Centers of hexes +class Pt +{ + F64 x,y; +}; +Pt hex_centers[map_rows][map_cols]; + +I64 show_visible_row,show_visible_col; +Bool roads[map_rows][map_cols], + rivers[map_rows][map_cols], + visible_map[map_rows][map_cols]; + +//Other options for PLAINS are WHITE or YELLOW +#define PLAINS LTGREEN +#define TREES GREEN +#define MOUNTAINS DKGRAY + +U8 movement_costs[16]; +movement_costs[PLAINS]=2; +movement_costs[TREES]=6; +movement_costs[MOUNTAINS]=10; + +//These are used to display a range circle when they player +//is firing. +F64 fire_radius,fire_radius_x,fire_radius_y; + +//These display "phase", "turn" and "game over". +U8 msg_buf[STR_LEN]; +I64 msg_off_timeout; //Jiffies. Goes away after a time. + +/*I got tricky by not defining a color +right away in these $LK,"CSprite",A="MN:CSprite"$s so they can +work for both players by setting dc->color +before drawing them. I actually made these +graphics by defining a color in the +menu, drawing the unit and deleting the color. + +I had to leave a gap between the tank tread +and body because of how it is rendered when rotated. +*/ + +$SP,"<1>",BI=1$ + +$SP,"<2>",BI=2$ + +//This is an infantry. + +$SP,"<3>",BI=3$ + +$SP,"<4>",BI=4$ + +$SP,"<5>",BI=5$ + +//Unit types +#define UT_INFANTRY 0 +#define UT_ARTILLERY 1 +#define UT_LT_TANK 2 +#define UT_MD_TANK 3 + +class Unit +{ + U8 *img; + I64 num,row,col, + armored_attack,unarmored_attack,armor; + I8 type,player,facing,movement,life, + range,remaining_movement,accuracy; + Bool visible[2],fired,infantry,indirect_fire,pad[3]; +}; + +Unit units[2][MAX_UNITS]; + +// Bt(visible_unit_bitmap,player1+player0*((MAX_UNITS+7)&~7)) +U8 visible_unit_bitmap[2][(((MAX_UNITS+7)&~7)*MAX_UNITS)>>3]; + +#define PHASE_START 0 +#define PHASE_PLOT 0 +#define PHASE_PLOT0 0 +#define PHASE_PLOT1 1 +#define PHASE_MOVE 2 +#define PHASE_MOVE0 2 +#define PHASE_MOVE1 3 +#define PHASE_FIRE 4 +#define PHASE_FIRE0 4 +#define PHASE_FIRE1 5 +#define PHASE_END 6 + +I64 phase,cur_player,enemy_player,view_player,turn, + cursor_row,cursor_col,alive_cnt[2], + plot_routines[2],move_routines[2],fire_routines[2]; + +U0 Toward(I64 *_row,I64 *_col,I64 direction) +{ + switch (direction) { + case 0: + *_row-=2; + break; + case 1: + if (*_row&1) *_col+=1; + *_row-=1; + break; + case 2: + if (*_row&1) *_col+=1; + *_row+=1; + break; + case 3: + *_row+=2; + break; + case 4: + if (!(*_row&1)) *_col-=1; + *_row+=1; + break; + case 5: + if (!(*_row&1)) *_col-=1; + *_row-=1; + break; + } +} + +I64 FacingChg(I64 f1,I64 f2) +{ + I64 res=(f1+6-f2)%6; + if (res>=3) + return 6-res; + else + return res; +} + +U0 RowCol2XY(F64 *_x,F64 *_y,I64 row,I64 col) +{ + Pt *c; + row=ClampI64(row,0,map_rows); + col=ClampI64(col,0,map_cols); + c=&hex_centers[row][col]; + *_x=c->x; + *_y=c->y; +} + +U0 XY2RowCol(I64 *_row,I64 *_col,F64 x,F64 y) +{ + *_col=(x-DCOS/2)/(HEX_SIDE+DCOS); + if (*_col&1) + *_row=ToI64((y-DSIN)/(2*DSIN))*2+1; + else + *_row=ToI64(y/(2*DSIN))*2; + *_col>>=1; + *_row=ClampI64(*_row,0,map_rows-1); + *_col=ClampI64(*_col,0,map_cols-1); +} + +Unit *FindUnit(I64 row,I64 col) +{//Finds unit in a hexagon. + I64 i,j; + for (j=0;j<2;j++) + for (i=0;i0 && + units[j][i].row==row && + units[j][i].col==col) + return &units[j][i]; + return NULL; +} + +Bool CursorInWindow(CTask *task,I64 x,I64 y) +{ + if (0<=x+task->scroll_xpix_width && + 0<=y+task->scroll_ypix_height) + return TRUE; + else + return FALSE; +} + +U0 UpdateCursor(CTask *task,I64 x,I64 y) +{ + if (CursorInWindow(task,x,y)) + XY2RowCol(&cursor_row, + &cursor_col,x+task->horz_scroll.pos,y+task->vert_scroll.pos); +} + +class LOSCtrl +{ + I64 r1,c1,r2,c2,distance; +}; + +Bool LOSPlot(LOSCtrl *l,I64 x,I64 y,I64 z) +{//We got tricky and used z as the distance from the start of the line. + I64 row,col; + XY2RowCol(&row,&col,x,y); + if ((row!=l->r1 || col!=l->c1) && + (row!=l->r2 || col!=l->c2) && + terrain[row][col]!=PLAINS) { + if (terrain[l->r1][l->c1]==MOUNTAINS) { + if (terrain[row][col]==MOUNTAINS || z>l->distance>>1) + return FALSE; + } else if (terrain[l->r2][l->c2]==MOUNTAINS) { + if (terrain[row][col]==MOUNTAINS || z<=l->distance>>1) + return FALSE; + } else + return FALSE; + } + return TRUE; +} + +Bool LOS(I64 r1,I64 c1,I64 r2,I64 c2) +{ + F64 x1,y1,x2,y2; + LOSCtrl l; + RowCol2XY(&x1,&y1,r1,c1); + RowCol2XY(&x2,&y2,r2,c2); + l.r1=r1; l.c1=c1; + l.r2=r2; l.c2=c2; + l.distance=Sqrt(SqrI64(x1-x2)+SqrI64(y1-y2)); + return Line(&l,x1,y1,0,x2,y2,l.distance,&LOSPlot); +} + +#define RV_ONE_FRIENDLY_UNIT 0 +#define RV_UPDATE_FRIENDLY_UNIT 1 +#define RV_FRIENDLY_UNIT_DIED 3 +#define RV_ONE_ENEMY_UNIT 4 +#define RV_ALL_UNITS 5 + +class MPCtrl1 +{ + I64 mode,lo,hi; + Unit *tempu; +}; + +U0 RVSetUp(I64 player) +{ + I64 i; + Unit *ut0,*ut1; + ut0=&units[player][0]; + ut1=&units[player^1][0]; + for (i=0;ivisible[player],0); + LBEqu(&ut0->visible[player],0,ut0->life>0); + } +} + +U0 RVMerge(I64 player) +{ + I64 i,j; + Unit *ut1; + U8 *dst,*src,*mask=CAlloc((MAX_UNITS+7)>>3); + for (j=0;j>3]; + dst=mask; + for (i=0;i<(MAX_UNITS+7)>>3;i++) //player1 + *dst++|=*src++; + } + ut1=&units[player^1][0]; + for (j=0;jvisible[player],0,Bt(mask,j) && ut1->life>0); + Free(mask); +} + +Bool MPRecalcVisible(MPCtrl1 *job) +{ + Bool res=FALSE,seen; + I64 i,j,row,col; + F64 x1,y1,x2,y2,dd,range; + Unit *ut0,*ut1; + ut0=&units[cur_player][job->lo]; + ut1=&units[enemy_player][job->lo]; + if (job->tempu) { + row=job->tempu->row; + col=job->tempu->col; + range=job->tempu->range*2*HEX_RADIUS; + range*=range; + } + switch (job->mode) { + case RV_UPDATE_FRIENDLY_UNIT: + case RV_ONE_FRIENDLY_UNIT: + if (job->mode==RV_UPDATE_FRIENDLY_UNIT) + range=MAX_F64; + RowCol2XY(&x1,&y1,row,col); + for (i=job->lo;ihi;i++,ut1++) { + seen=FALSE; + if (ut1->life>0 && + LOS(row,col,ut1->row,ut1->col)) { + RowCol2XY(&x2,&y2,ut1->row,ut1->col); + dd=Sqr(x2-x1)+Sqr(y2-y1); + if (ddvisible[cur_player],0); + } + } + if (job->mode==RV_UPDATE_FRIENDLY_UNIT) + LBEqu(&visible_unit_bitmap[cur_player], + i+job->tempu->num*((MAX_UNITS+7)&~7),seen); + } + break; + case RV_ONE_ENEMY_UNIT: + RowCol2XY(&x1,&y1,row,col); + for (i=job->lo;ihi;i++,ut1++) + if (ut1->life>0 && + LOS(row,col,ut1->row,ut1->col)) { + LBts(&visible_unit_bitmap[enemy_player], + job->tempu->num+i*((MAX_UNITS+7)&~7)); + res=TRUE; + } else + LBtr(&visible_unit_bitmap[enemy_player], + job->tempu->num+i*((MAX_UNITS+7)&~7)); + break; + case RV_ALL_UNITS: + ut0=&units[cur_player][0]; + for (i=0;ilife>0) { + RowCol2XY(&x1,&y1,ut0->row,ut0->col); + ut1=&units[enemy_player][job->lo]; + for (j=job->lo;jhi;j++,ut1++) { + if (ut1->life>0 && + LOS(ut0->row,ut0->col,ut1->row,ut1->col)) { + LBts(&ut1->visible[cur_player],0); + LBts(&visible_unit_bitmap[cur_player],j+i*((MAX_UNITS+7)&~7)); + } else + LBtr(&visible_unit_bitmap[cur_player],j+i*((MAX_UNITS+7)&~7)); + } + } else + for (j=job->lo;jhi;j++) + LBtr(&visible_unit_bitmap[cur_player],j+i*((MAX_UNITS+7)&~7)); + ut0=&units[enemy_player][0]; + for (i=0;ilife>0) { + RowCol2XY(&x1,&y1,ut0->row,ut0->col); + ut1=&units[cur_player][job->lo]; + for (j=job->lo;jhi;j++,ut1++) { + if (ut1->life>0 && + LOS(ut0->row,ut0->col,ut1->row,ut1->col)) { + LBts(&ut1->visible[enemy_player],0); + LBts(&visible_unit_bitmap[enemy_player],j+i*((MAX_UNITS+7)&~7)); + } else + LBtr(&visible_unit_bitmap[enemy_player],j+i*((MAX_UNITS+7)&~7)); + } + } else + for (j=job->lo;jhi;j++) + LBtr(&visible_unit_bitmap[enemy_player],j+i*((MAX_UNITS+7)&~7)); + break; + } + return res; +} + +Bool RecalcVisible(I64 mode,Unit *tempu=NULL) +{ + I64 i,hi,k,cnt; + Bool res; +/*The compiler doesn't go out of it's way +to know if something is const.;-) This +just compiles with the val at compile +time, an advantage of just-in-time over +AOT binaries. TempleOS has a limited +stk size, so don't get in the habit. +$LK,"MAlloc",A="MN:MAlloc"$() would probably be the better choice. +*/ + MPCtrl1 job[mp_cnt]; + CSrvCmd *cmd[mp_cnt]; + + if (mode==RV_FRIENDLY_UNIT_DIED) { + MemSet((&visible_unit_bitmap[enemy_player])(U8 *)+ + (tempu->num*((MAX_UNITS+7)&~7))>>3,0,(MAX_UNITS+7)>>3); + RVMerge(enemy_player); + return 0; //Return any value--don't care + } + + cnt=mp_cnt; //Cores + hi=MAX_UNITS; + if (mode==RV_ONE_ENEMY_UNIT) { + for (hi--;hi>=0;hi--) + if (units[enemy_player][hi].life>0) + break; + hi++; + } + k=hi; + if (hi/mp_cnt<2) + cnt=1; + for (i=0;ilo;jhi;j++) + for (i=0;irow,job->col,j,i)) + visible_map[j][i]=TRUE; + else + visible_map[j][i]=FALSE; +} + +U0 RecalcVisibleMap(I64 row,I64 col) +{ + I64 i,hi,k,cnt; + MPCtrl2 job[mp_cnt]; + CSrvCmd *cmd[mp_cnt]; + + cnt=mp_cnt; //Cores + hi=map_rows; + k=hi; + if (hi/mp_cnt<2) + cnt=1; + for (i=0;iinfantry) + res=0; + else { + res=FacingChg(facing,tempu->facing); + if (res>0) res--; + } + if (roads[r][c] && roads[tempu->row][tempu->col]) + res+=1; + else { + if (tempu->infantry) + res+=2; + else { + res+=movement_costs[terrain[r][c]]; + if (rivers[r][c]) + res=tempu->movement; + } + } + return res; +} + +I64 MoveOneHex(I64 *_row,I64 *_col,F64 x,F64 y) +{ + I64 direction,best_direction=-1,r,c; + F64 dd,best_dd,x1,y1; + RowCol2XY(&x1,&y1,*_row,*_col); + best_dd=Sqr(x1-x)+Sqr(y1-y); + for (direction=0;direction<6;direction++) { + r=*_row; c=*_col; + Toward(&r,&c,direction); + RowCol2XY(&x1,&y1,r,c); + dd=Sqr(x1-x)+Sqr(y1-y); + if (0<=r=0) { + Toward(_row,_col,best_direction); + return best_direction; + } else + return -1; +} + +Bool moving=FALSE; +I64 move_x,move_y; +F64 move_facing; +Unit *moving_unit; + +Bool MovePlot(U0,I64 x,I64 y,I64) +{ + move_x=x; move_y=y; + Sleep(5*ANIMATION_DELAY); + return TRUE; +} + +U0 MoveUnitAnimation(Unit *tempu,I64 r,I64 c,I64 facing) +{ + F64 x1,y1,x2,y2,f=facing*60.0*ã/180.0; + moving_unit=tempu; + RowCol2XY(&x1,&y1,tempu->row,tempu->col); + move_x=x1; move_y=y1; + moving=TRUE; + if (tempu->infantry) + Snd(300); + else { + move_facing=tempu->facing*60.0*ã/180.0; + Snd(150); + while (Wrap(f-move_facing,-ã)<=0) { + move_facing-=0.03; + Sleep(5*ANIMATION_DELAY); + } + while (Wrap(f-move_facing,-ã)>0) { + move_facing+=0.03; + Sleep(5*ANIMATION_DELAY); + } + Snd(100); + } + move_facing=f; + RowCol2XY(&x2,&y2,r,c); + Line(NULL,x1,y1,0,x2,y2,0,&MovePlot); + Snd(0); + moving_unit=NULL; + moving=FALSE; +} + +Bool MoveUnit(Unit *tempu,I64 x,I64 y) +{ + I64 r,c,r0=tempu->row,c0=tempu->col,i,facing; + while (tempu->remaining_movement>0) { + r=tempu->row; + c=tempu->col; + if ((facing=MoveOneHex(&r,&c,x,y))<0) + break; + else { + i=MoveCost(tempu,r,c,facing); + if (i>tempu->movement) + i=tempu->movement; + if (tempu->remaining_movement>=i && !FindUnit(r,c)) { + MoveUnitAnimation(tempu,r,c,facing); + tempu->facing=facing; + tempu->remaining_movement-=i; + tempu->row=r; + tempu->col=c; + RecalcVisible(RV_UPDATE_FRIENDLY_UNIT,tempu); + LBEqu(&tempu->visible[enemy_player],0, + RecalcVisible(RV_ONE_ENEMY_UNIT,tempu)); + } else + break; + } + } + if (tempu->row!=r0 || tempu->col!=c0) + return TRUE; + else + return FALSE; +} + +class IndirectOrders +{ + IndirectOrders *next,*last; + Unit *attacker; + I64 row,col; +} indirect_head; + +U0 PlotShot(Unit *tempu,I64 row,I64 col) +{ + IndirectOrders *tempi; + if (tempu->life<=0 || tempu->range<=0) + return; + tempu->fired=TRUE; + tempi=CAlloc(sizeof(IndirectOrders)); + tempi->attacker=tempu; + tempi->row=row; + tempi->col=col; + QueIns(tempi,indirect_head.last); +} + +Bool firing=FALSE; +I64 fire_x,fire_y; +Unit *target_unit; +Bool target_hit; +Bool indirect_explosion=FALSE; +I64 indirect_row,indirect_col; + +Bool FirePlot(U0,I64 x,I64 y,I64) +{ + fire_x=x; fire_y=y; + firing=TRUE; + Sleep(3*ANIMATION_DELAY); + return TRUE; +} + +U0 FireShot(Unit *tempu,Unit *target) +{ + I64 r,c,facing, + t1=terrain[tempu->row][tempu->col], + t2=terrain[target->row][target->col]; + F64 x1,y1,x2,y2,d,a,dammage=0,range_factor; + Bool hit; + + if (tempu->life<=0 || target->life<=0 || tempu->range<=0) + return; + RowCol2XY(&x1,&y1,tempu->row,tempu->col); + RowCol2XY(&x2,&y2,target->row,target->col); + + '\n\n'; + + d=100*Rand; + "+%5.2f Roll\n",d; + d+=tempu->accuracy; + "+%2d.00 Accuracy\n",tempu->accuracy; + + range_factor=Sqrt(Sqr(x2-x1)+Sqr(y2-y1))/(tempu->range*2*DSIN); + "-%5.2f%% of Range\n",100*range_factor; + d-=100*range_factor; + if (t2==TREES) { + "-30.00 Target in trees\n"; + d-=30; + } + if (t1==MOUNTAINS && t2!=MOUNTAINS) { + "+30.00 Down from mountains\n"; + d+=30; + } + "_______\n"; + if (d>=0) { + "+%5.2f Hit\n",d; + hit=TRUE; + } else { + "-%5.2f Miss\n",-d; + hit=FALSE; + } + + target_unit=target; + if (hit) { + target_hit=TRUE; + Noise(500*ANIMATION_DELAY,100,150); + Sleep(500*ANIMATION_DELAY); + } else { + target_hit=FALSE; + Noise(1000*ANIMATION_DELAY,750,1000); + Sleep(1000*ANIMATION_DELAY); + } + if (hit) + Line(NULL,x1,y1,0,x2,y2,0,&FirePlot); + else { + a=ã*2*Rand; + d=(0.5-d/100)*HEX_SIDE; + Line(NULL,x1,y1,0,x2+d*Cos(a),y2+d*Sin(a),0,&FirePlot); + } + firing=FALSE; + tempu->fired=TRUE; + if (hit) { + r=target->row;c=target->col; + if ((facing=MoveOneHex(&r,&c,x1,y1))>=0) + facing=FacingChg(facing,target->facing); + else + facing=0; + dammage=200.0*Rand; + "Raw dammage roll out of 200: %3f\n",dammage; + if (target->armor) { + d=target->armor/100.0*(5-facing)/5.0; + "Armor:%d-FacingAdjustment(%z) Yields:%5.2f Defense\n", + target->armor,facing,"Front\0Side\0Rear\0",100*d; + if (d>=0) { + dammage*=(tempu->armored_attack/100.0)/d; + "Armored Attack:%d\nRaw*Attack/Defense=%5.2f Dammage\n", + tempu->armored_attack,dammage; + } else + dammage=0; + } else { + d=1.0-range_factor; + if (d>0) { + "Range:%5.2f%% --> %5.2f%% Remaining\n", + 100*range_factor,100*d; + dammage*=(tempu->unarmored_attack/100.0)*d; + "Unarmored Attack:%d\nRaw*Attack*Remaining=%5.2f Dammage\n", + tempu->unarmored_attack,dammage; + } else + dammage=0; + } + dammage=Round(dammage); + if (dammage>0) { + "Life:%3d - Dammage:%3f =",target->life,dammage; + if (dammage>=target->life) { + "Killed\n"; + Noise(1000*ANIMATION_DELAY,1000,4000); + Sleep(1000*ANIMATION_DELAY); + target->life=0; + RecalcVisible(RV_FRIENDLY_UNIT_DIED,target); + alive_cnt[target->player]--; + } else { + if (target->armor) { + if (dammage>0.6*target->life) { + target->movement=0; + "Immobilized\n"; + } else + "No Penetration\n"; + } else { + target->life-=dammage; + "%d\n",target->life; + } + } + } + } + while (snd.freq) //see $LK,"Snd",A="MN:Snd"$() + Yield; + target_unit=NULL; +} + +I64 row_offsets[7]={-1,-2,-1,1,2,1,0}; +I64 col_offsets_even[7]={-1, 0, 0,0,0,-1,0}; +I64 col_offsets_odd [7]={ 0, 0, 1,1,0, 0,0}; + +U0 IndirectFireResolve() +{ + I64 i,r,c,facing; + F64 x1,y1,x2,y2,d,dammage=0,range_factor; + Unit *tempu,*target; + Bool hit; + IndirectOrders *tempi=indirect_head.next,*tempi1; + while (tempi!=*indirect_head) { + tempi1=tempi->next; + tempu=tempi->attacker; + RowCol2XY(&x1,&y1,tempu->row,tempu->col); + RowCol2XY(&x2,&y2,tempi->row,tempi->col); + + '\n\n'; + + d=100*Rand; + "+%5.2f Roll\n",d; + d+=tempu->accuracy; + "+%2d.00 Accuracy\n",tempu->accuracy; + + range_factor=Sqrt(Sqr(x2-x1)+Sqr(y2-y1))/(tempu->range*2*DSIN); + "-%5.2f%% of Range\n",100*range_factor; + d-=100*range_factor; + + '_______\n'; + if (d>=0) { + "+%5.2f Hit\n",d; + hit=TRUE; + } else { + "-%5.2f Miss\n",-d; + hit=FALSE; + } + + if (hit) { + Noise(500*ANIMATION_DELAY,100,150); + Sleep(500*ANIMATION_DELAY); + } else { + Noise(1000*ANIMATION_DELAY,750,1000); + Sleep(1000*ANIMATION_DELAY); + } + + if (!hit) { + i=RandU16%6; + if (tempi->row&1) + tempi->col+=col_offsets_odd[i]; + else + tempi->col+=col_offsets_even[i]; + tempi->row+=row_offsets[i]; + RowCol2XY(&x2,&y2,tempi->row,tempi->col); + } + Line(NULL,x1,y1,0,x2,y2,0,&FirePlot); + firing=FALSE; + tempu->fired=TRUE; + indirect_row=tempi->row; + indirect_col=tempi->col; + indirect_explosion=TRUE; + for (i=0;i<7;i++) { + if (tempi->row&1) + c=tempi->col+col_offsets_odd[i]; + else + c=tempi->col+col_offsets_even[i]; + r=tempi->row+row_offsets[i]; + if (0<=rarmor) { + d=target->armor/100.0*(5-facing)/5.0; + "Armor:%d-FacingAdjustment(%z) Yields:%5.2f Defense\n", + target->armor,facing,"Front\0Side\0Rear\0",100*d; + if (d>=0) { + dammage*=(tempu->armored_attack/100.0)/d; + "Armored Attack:%d\nRaw*Attack/Defense=%5.2f Dammage\n", + tempu->armored_attack,dammage; + } else + dammage=0; + } else { + d=1.0-range_factor; + if (d>0) { + "Range:%5.2f%% --> %5.2f%% Remaining\n", + 100*range_factor,100*d; + dammage*=(tempu->unarmored_attack/100.0)*d; + "Unarmored Attack:%d\nRaw*Attack*Remaining=%5.2f Dammage\n", + tempu->unarmored_attack,dammage; + } else + dammage=0; + } + dammage=Round(dammage); + if (dammage>0) { + "Life:%3d - Dammage:%3f =",target->life,dammage; + if (dammage>=target->life) { + 'Killed\n'; + target->life=0; + RecalcVisible(RV_FRIENDLY_UNIT_DIED,target); + alive_cnt[target->player]--; + } else { + if (target->armor) { + if (dammage>0.6*target->life) { + target->movement=0; + "Immobilized\n"; + } else + "No Penetration\n"; + } else { + target->life-=dammage; + "%d\n",target->life; + } + } + } + } + } + Noise(2000*ANIMATION_DELAY,800,1000); + Sleep(2000*ANIMATION_DELAY); + while (snd.freq) //see $LK,"Snd",A="MN:Snd"$() + Yield; + indirect_explosion=FALSE; + + QueRem(tempi); + Free(tempi); + tempi=tempi1; + } +} + +U0 DrawHexes() +{ + F64 dx=2*HEX_SIDE+2*DCOS,dy=2*DSIN, + x,y,x1,y1,x2,y2; + I64 i,j; + map_dc->color=WHITE; + GrRect(map_dc,0,0,map_dc->width,map_dc->height); + map_dc->color=BLACK; + y=0; + for (j=0;jcolor=terrain[j][i]; + RowCol2XY(&x,&y,j,i); + GrFloodFill(map_dc,x,y); + } +} + +U0 DrawRivers() +{ + I64 i,j,k,r,c; + F64 x1,y1,x2,y2; + for (j=0;jcolor=LTBLUE; + map_dc->pen_width=4; + GrLine3(map_dc,x1,y1,0,x2,y2,0); + map_dc->color=BLUE; + map_dc->pen_width=2; + GrLine3(map_dc,x1,y1,0,x2,y2,0); + } + } + } + } +} + +U0 DrawRoads() +{ + I64 i,j,k,r,c; + F64 x1,y1,x2,y2; + map_dc->color=RED; + map_dc->pen_width=3; + for (j=0;jcolor=BLACK; + for (j=0;jplayer=j; + tempu->num=i; + tempu->life=100; + tempu->facing=RandU16%6; + if (!j) { + if (i>=Round(MAX_UNITS*P1_TO_P2_ODDS*PLAYER_1_ARMOR_PERCENT/100.0)) { + if (Round(i-MAX_UNITS*P1_TO_P2_ODDS*PLAYER_1_ARMOR_PERCENT/100.0)>= + Round(0.85*(MAX_UNITS-MAX_UNITS*P1_TO_P2_ODDS* + PLAYER_1_ARMOR_PERCENT/100.0))) + type=UT_ARTILLERY; + else + type=UT_INFANTRY; + } else { + if (i>=Round(0.5*MAX_UNITS*P1_TO_P2_ODDS* + PLAYER_1_ARMOR_PERCENT/100.0)) + type=UT_MD_TANK; + else + type=UT_LT_TANK; + } + } else { + if (i>=Round(MAX_UNITS*PLAYER_2_ARMOR_PERCENT/100.0)) { + if (Round(i-MAX_UNITS*PLAYER_2_ARMOR_PERCENT/100.0)>= + Round(0.85*(MAX_UNITS-MAX_UNITS*PLAYER_2_ARMOR_PERCENT/100.0))) + type=UT_ARTILLERY; + else + type=UT_INFANTRY; + } else { + if (i>=Round(0.5*MAX_UNITS*PLAYER_2_ARMOR_PERCENT/100.0)) + type=UT_MD_TANK; + else + type=UT_LT_TANK; + } + } + tempu->type=type; + switch (type) { + case UT_INFANTRY: + tempu->infantry=TRUE; + tempu->indirect_fire=FALSE; + tempu->armor =0; + tempu->armored_attack =15; + tempu->unarmored_attack=180; + tempu->accuracy=45; + tempu->range =5; + tempu->movement=4; + tempu->img =$IB,"<3>",BI=3$; + break; + case UT_ARTILLERY: + tempu->infantry=TRUE; + tempu->indirect_fire=TRUE; + tempu->armor =0; + tempu->armored_attack =75; + tempu->unarmored_attack=180; + tempu->accuracy=25; + tempu->range =20; + tempu->movement=2; + tempu->img =$IB,"<4>",BI=4$; + break; + case UT_LT_TANK: + tempu->infantry=FALSE; + tempu->indirect_fire=FALSE; + tempu->armor =30; + tempu->armored_attack =40; + tempu->unarmored_attack=60; + tempu->accuracy=25; + tempu->range =8; + tempu->movement=24; + tempu->img =$IB,"<2>",BI=2$; + break; + case UT_MD_TANK: + tempu->infantry=FALSE; + tempu->indirect_fire=FALSE; + tempu->armor =60; + tempu->armored_attack =60; + tempu->unarmored_attack=80; + tempu->accuracy=25; + tempu->range =12; + tempu->movement=16; + tempu->img =$IB,"<1>",BI=1$; + break; + } + do { + row=RandU32%map_rows; + col=RandU32%(map_cols/3); + if (j) + col+=2*map_cols/3; + } while (FindUnit(row,col)); + tempu->row=row; + tempu->col=col; + LBts(&tempu->visible[cur_player],0); + } +} + +U0 NewTurn() +{ + I64 i,j; + for (j=0;j<2;j++) + for (i=0;i=PHASE_END) { + IndirectFireResolve; + NewTurn; + } + + Fs->border_src=BDS_CONST; + if (phase&~1==PHASE_PLOT) + Fs->border_attr=WHITE<<4+PURPLE; + else if (phase&~1==PHASE_MOVE) + Fs->border_attr=WHITE<<4+GREEN; + else + Fs->border_attr=WHITE<<4+RED; + + SleepUntil(msg_off_timeout); + msg_off_timeout=cnts.jiffies+JIFFY_FREQ*2*ANIMATION_DELAY+1; + Snd(1000); + switch (phase) { + case PHASE_PLOT0: + case PHASE_PLOT1: + StrPrint(msg_buf,"Player %d Artillery Plot",cur_player+1); + break; + case PHASE_MOVE0: + case PHASE_MOVE1: + StrPrint(msg_buf,"Player %d Move",cur_player+1); + break; + case PHASE_FIRE0: + case PHASE_FIRE1: + StrPrint(msg_buf,"Player %d Fire",cur_player+1); + break; + } +} + +U0 SetViewPlayer(I8 p) +{ + CMenuEntry *tempse; + view_player=p; + if (tempse=MenuEntryFind(Fs->cur_menu,"View/Player1")) + tempse->checked= view_player==0; + if (tempse=MenuEntryFind(Fs->cur_menu,"View/Player2")) + tempse->checked= view_player==1; +} + +U0 Init() +{ + moving_unit=NULL; + InitMap; + SetViewPlayer(cur_player=0); + enemy_player=1; + Fs->horz_scroll.pos=0; + Fs->vert_scroll.pos=0; + InitUnits; + QueInit(&indirect_head); + turn=0; + fire_radius=0; + show_visible_row=-1; + show_visible_col=-1; + *msg_buf=0; + msg_off_timeout=0; + phase=PHASE_END; +} + +U0 CleanUp() +{ + QueDel(&indirect_head,TRUE); +} + +U0 HandleChar(U8 ch) +{ + I64 old_inhibit,old_draw_it; + Bool old_cursor; + switch (ch) { + case CH_ESC: + case CH_SHIFT_ESC: + throw('ExitGame',TRUE); + case CH_SPACE: + throw('PhaseOvr',TRUE); + case '\n': + throw('NewGame',TRUE); + case '1': + SetViewPlayer(0); + break; + case '2': + SetViewPlayer(1); + break; + case '3': + old_draw_it=Fs->draw_it; + old_inhibit=Fs->win_inhibit; + Fs->draw_it=Fs->next_settings->draw_it; + Fs->win_inhibit=WIG_USER_TASK_DFT; + old_cursor=DocCursor(ON); + DocBottom; + View; + DocBottom; + DocCursor(old_cursor); + Fs->win_inhibit=old_inhibit; + Fs->draw_it=old_draw_it; + break; + } +} + +U0 CheckUser() +{ + I64 ch; + if (!alive_cnt[0] || !alive_cnt[1]) + throw('GameOver',TRUE); + if (ch=ScanChar) + HandleChar(ch); +} + +U0 PickAI(U8 *dirname,I64 player) +{ + I64 i=0; + U8 *st; + CDirEntry *tempde,*tempde1,*tempde2; + CDoc *doc=DocNew; + Bool *old_silent=Silent; + st=MStrPrint("%s/*.HC*",dirname); + tempde=FilesFind(st); + Free(st); + tempde2=FilesFind("~/ToTheFront/*.HC*"); + tempde1=tempde; + Silent(old_silent); + + DocPrint(doc,"Player %d Type\n\n$$LTBLUE$$",player+1); + while (tempde1) { + if (!(i++&3)) + DocPrint(doc,"\n"); + st=StrNew(tempde1->name); + FileExtRem(st); + tempde1->user_data=DocPrint(doc,"$$MU-UL,\"%-10ts\",LE=%d$$ ",st,tempde1); + Free(st); + tempde1=tempde1->next; + } + tempde1=tempde2; + while (tempde1) { + if (!(i++&3)) + DocPrint(doc,"\n"); + st=StrNew(tempde1->name); + FileExtRem(st); + tempde1->user_data=DocPrint(doc,"$$MU-UL,\"%-10ts\",LE=%d$$ ",st,tempde1); + Free(st); + tempde1=tempde1->next; + } + DocPrint(doc,"\n\n\n$$FG$$Create your own AI in ~/ToTheFront."); + while ((tempde1=PopUpMenu(doc))<=0); + ExeFile(tempde1->full_name); + DocDel(doc); + DirTreeDel(tempde); + DirTreeDel(tempde2); + ExePrint("plot_routines[%d]=&TanksPlot;" + "move_routines[%d]=&TanksMove;" + "fire_routines[%d]=&TanksFire;",player,player,player); +} + +U0 DrawUnit(CTask *task,CDC *dc,Unit *tempu,I64 x,I64 y,F64 f) +{ + if (tempu->infantry) + Sprite3(dc,x-task->horz_scroll.pos,y-task->vert_scroll.pos,0, + tempu->img); + else + SpriteZ3B(dc,x-task->horz_scroll.pos,y-task->vert_scroll.pos,0, + tempu->img,f); + if (phase&~1==PHASE_PLOT && tempu->indirect_fire && + !tempu->fired && tempu->player==cur_player) { + dc->pen_width=2; + if (cur_player) + dc->color=PURPLE; + else + dc->color=CYAN; + GrCircle3(dc,x-task->horz_scroll.pos,y-task->vert_scroll.pos,0, + 20*Saw(4*tS,2.0)); + GrCircle3(dc,x-task->horz_scroll.pos,y-task->vert_scroll.pos,0, + 20*Saw(4*tS+1.0,2.0)); + dc->pen_width=1; + } +} + +U0 DrawUnits(CTask *task,CDC *dc) +{ + I64 i,j; + F64 x,y; + Unit *tempu; + for (j=0;j<2;j++) { + for (i=0;icolor=RED; + else + dc->color=GREEN; + } else { + if (j) + dc->color=LTPURPLE; + else + dc->color=LTCYAN; + } + if (tempu->life>0 && Bt(&tempu->visible[view_player],0) && + tempu!=moving_unit) { + RowCol2XY(&x,&y,tempu->row,tempu->col); + if (phase&~1==PHASE_MOVE && tempu->remaining_movement || + (phase&~1==PHASE_PLOT&& tempu->indirect_fire|| + phase&~1==PHASE_FIRE&&!tempu->indirect_fire) && !tempu->fired || + Blink(5)) + DrawUnit(task,dc,tempu,x,y,tempu->facing*60.0*ã/180.0); + } + } + } +} + +U0 DrawIt(CTask *task,CDC *dc) +{ + F64 x,y; + I64 h,v,i,j,r,c; + U8 buf[STR_LEN]; + IndirectOrders *tempi; + + task->horz_scroll.min=0; + task->horz_scroll.max=map_width-task->pix_width; + task->vert_scroll.min=-FONT_HEIGHT; + task->vert_scroll.max=map_height-task->pix_height; + TaskDerivedValsUpdate(task); + h=task->horz_scroll.pos; + v=task->vert_scroll.pos; + + map_dc->flags|=DCF_NO_TRANSPARENTS; + GrBlot(dc,-h,-v,map_dc); + + i=ip.pos.x-task->pix_left-task->scroll_x; + j=ip.pos.y-task->pix_top -task->scroll_y; + if (CursorInWindow(task,i,j)) + UpdateCursor(task,i,j); + RowCol2XY(&x,&y,cursor_row,cursor_col); + + //Roads require multiple cursor fills + dc->color=YELLOW; + c=terrain[cursor_row][cursor_col]; + for (i=-(HEX_SIDE+DCOS)/2;i<=(HEX_SIDE+DCOS)/2;i++) { + if (GrPeek(dc,x+i-h,y-v)==c) + GrFloodFill(dc,x+i-h,y-v); + for (j=-HEX_SIDE/2;j<=HEX_SIDE/2;j++) + if (GrPeek(dc,x+j-h,y+i-v)==c) + GrFloodFill(dc,x+j-h,y+i-v); + } + + DrawUnits(task,dc); + if (firing) { + dc->color=BLACK; + GrCircle(dc,fire_x-h,fire_y-v,2); + } + if (indirect_explosion) { + for (i=0;i<7;i++) { + if (indirect_row&1) + c=indirect_col+col_offsets_odd[i]; + else + c=indirect_col+col_offsets_even[i]; + r=indirect_row+row_offsets[i]; + if (0<=rcolor=LTRED; + else + dc->color=YELLOW; + GrCircle(dc,x+RandU16%HEX_SIDE-HEX_SIDE/2-h, + y+RandU16%HEX_SIDE-HEX_SIDE/2-v,2); + } + } + } + } + if (moving_unit && moving_unit->visible[view_player]) { + dc->color=YELLOW; + DrawUnit(task,dc,moving_unit,move_x,move_y,move_facing); + } + ProgressBarsRst; + if (moving_unit) { + if (ip.pos.ymovement; + progress4=moving_unit->remaining_movement; + } else { + progress1_max=moving_unit->movement; + progress1=moving_unit->remaining_movement; + } + } + if (fire_radius) { + dc->color=YELLOW; + GrCircle(dc,fire_radius_x-h,fire_radius_y-v,fire_radius-1); + GrCircle(dc,fire_radius_x-h,fire_radius_y-v,fire_radius+1); + dc->color=RED; + GrCircle(dc,fire_radius_x-h,fire_radius_y-v,fire_radius); + } + if (Blink(10)) { + tempi=indirect_head.next; + while (tempi!=&indirect_head) { + if (tempi->attacker->player==view_player) { + RowCol2XY(&x,&y,tempi->row,tempi->col); + Sprite3(dc,x-task->horz_scroll.pos,y-task->vert_scroll.pos,0,$IB,"<5>",BI=5$); + } + tempi=tempi->next; + } + } + if (Bt(kbd.down_bitmap,SC_SHIFT)) { + if (show_visible_row!=cursor_row || show_visible_col!=cursor_col) { + show_visible_row=cursor_row; + show_visible_col=cursor_col; + RecalcVisibleMap(show_visible_row,show_visible_col); + } + + dc->color=LTGRAY; + for (j=0;jcolor=BLACK; + GrRect(dc,(task->pix_width-i)>>1-10-task->scroll_x, + (task->pix_height-FONT_HEIGHT)>>1-10-task->scroll_y, + i+20,FONT_HEIGHT+20); + + dc->color=YELLOW; + GrRect(dc,(task->pix_width-i)>>1-7-task->scroll_x, + (task->pix_height-FONT_HEIGHT)>>1-7-task->scroll_y, + i+14,FONT_HEIGHT+14); + + dc->color=RED; + GrPrint(dc,(task->pix_width-i)>>1-task->scroll_x, + (task->pix_height-FONT_HEIGHT)>>1-task->scroll_y, + msg_buf); + if (msg_off_timeout) { + if (msg_off_timeout-cnts.jiffies<3*JIFFY_FREQ/2*ANIMATION_DELAY) + Snd(0); + if (cnts.jiffies>msg_off_timeout) + *msg_buf=0; + } + } + + dc->color=WHITE; + GrRect(dc,-task->scroll_x,-task->scroll_y, + (13+7+10+10)*FONT_WIDTH,FONT_HEIGHT); + + if (phase&~1==PHASE_PLOT) { + dc->color=PURPLE; + StrPrint(buf,"Turn:%2d Artillery",turn); + } else if (phase&~1==PHASE_MOVE) { + dc->color=GREEN; + StrPrint(buf,"Turn:%2d Move",turn); + } else { + dc->color=RED; + StrPrint(buf,"Turn:%2d Fire",turn); + } + GrPrint(dc,-task->scroll_x,-task->scroll_y,buf); + + StrPrint(buf,"%3d Units",alive_cnt[0]); + if (cur_player || Blink) + dc->color=CYAN; + else + dc->color=LTCYAN; + GrPrint(dc,-task->scroll_x+(13+7)*FONT_WIDTH,-task->scroll_y,buf); + + StrPrint(buf,"%3d Units",alive_cnt[1]); + if (!cur_player || Blink) + dc->color=PURPLE; + else + dc->color=LTPURPLE; + GrPrint(dc,-task->scroll_x+(13+7+10)*FONT_WIDTH,-task->scroll_y,buf); +} + +U0 TaskEndCB() +{ + Snd(0); + progress4=progress4_max=progress1=progress1_max=0; + Exit; +} + +I64 DoPhase() +{ + I64 res='ExitGame'; + NewPhase; + try { + if (phase&~1==PHASE_PLOT) + Call(plot_routines[cur_player]); + else if (phase&~1==PHASE_MOVE) + Call(move_routines[cur_player]); + else + Call(fire_routines[cur_player]); + } catch { + res=Fs->except_ch; + Fs->catch_except=TRUE; + } + return res; +} + +U0 ToTheFront() +{ + I64 res,ch; + map_dc=DCNew(MAP_WIDTH,MAP_HEIGHT); + + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + Cd(__DIR__); + Fs->win_inhibit|=WIF_SELF_IP_L|WIF_SELF_IP_R|WIG_DBL_CLICK; + + MenuPush( + "File {" + " Abort(,CH_SHIFT_ESC);" + " Exit(,CH_ESC);" + "}" + "Play {" + " EndPhase(,CH_SPACE);" + " Restart(,'\n');" + "}" + "View {" + " Player1(,'1');" + " Player2(,'2');" + " ShowOdds(,'3');" + " LOS(,0,SCF_SHIFT);" + "}" + ); + + AutoComplete; + WinBorder(ON); + WinMax; + DocCursor; + DocClear; + Init; + PickAI("AIs",0); + PickAI("AIs",1); + + PopUpOk("Left-click to move or fire units.\n" + "$$GREEN$$$$FG$$ or right-click to end phase.\n" + "$$GREEN$$\t $$FG$$ to show line-of-sight.\n" + "$$GREEN$$\t $$FG$$ to start new game.\n" + "$$GREEN$$ 1\t $$FG$$ Player 1 view.\n" + "$$GREEN$$ 2\t $$FG$$ Player 2 view.\n" + "$$GREEN$$ 3\t $$FG$$ View odds calculations."); + Fs->task_end_cb=&TaskEndCB; // + Fs->draw_it=&DrawIt; + "$$GREEN$$$$FG$$ to return to game.\n"; + + try { + do { + res=DoPhase; + if (res=='GameOver') { + while (TRUE) { + msg_off_timeout=0; + StrCpy(msg_buf,"Game Over"); + Snd(0); + ch=GetChar(,FALSE); + if (ch=='\n') { + CleanUp; + Init; + break; + } else if (ch==CH_ESC || ch==CH_SHIFT_ESC) { + res='ExitGame'; + break; + } else if (ch=='1') + SetViewPlayer(0); + else if (ch=='2') + SetViewPlayer(1); + } + } else if (res=='NewGame') { + CleanUp; + Init; + } + } while (res!='ExitGame'); + } catch + PutExcept; + ProgressBarsRst; + + SettingsPop; + MenuPop; + DCDel(map_dc); + CleanUp; + Seed; +} +L ÿÿÿÿüÿÿÿ úÿÿÿ üÿÿÿúÿÿÿþÿÿÿ +øÿÿÿ üÿÿÿüÿÿÿ +ûÿÿÿûÿÿÿûÿÿÿ +ûÿÿÿ +ûÿÿÿ +ûÿÿÿûÿÿÿûÿÿÿ +üÿÿÿüÿÿÿ +üÿÿÿüÿÿÿG ÿÿÿÿýÿÿÿ +üÿÿÿ +þÿÿÿüÿÿÿþÿÿÿ +úÿÿÿÏ þÿÿÿþÿÿÿ +ÿÿÿÿýÿÿÿýÿÿÿ +ÿÿÿÿüÿÿÿüÿÿÿ +üÿÿÿ +ýÿÿÿ +þÿÿÿûÿÿÿûÿÿÿ +ýÿÿÿüÿÿÿ +þÿÿÿýÿÿÿþÿÿÿüÿÿÿ +ýÿÿÿýÿÿÿýÿÿÿ +ýÿÿÿ + +ÿÿÿÿÿÿÿÿ< +þÿÿÿ +þÿÿÿ \ No newline at end of file diff --git a/Apps/Vocabulary/Load.CPP b/Apps/Vocabulary/Load.HC similarity index 100% rename from Apps/Vocabulary/Load.CPP rename to Apps/Vocabulary/Load.HC diff --git a/Apps/Vocabulary/Run.CPP b/Apps/Vocabulary/Run.HC similarity index 100% rename from Apps/Vocabulary/Run.CPP rename to Apps/Vocabulary/Run.HC diff --git a/Apps/Vocabulary/VocabQuiz.CPP b/Apps/Vocabulary/VocabQuiz.HC similarity index 100% rename from Apps/Vocabulary/VocabQuiz.CPP rename to Apps/Vocabulary/VocabQuiz.HC diff --git a/Apps/X-Caliber/Load.CPP b/Apps/X-Caliber/Load.HC similarity index 100% rename from Apps/X-Caliber/Load.CPP rename to Apps/X-Caliber/Load.HC diff --git a/Apps/X-Caliber/Run.CPP b/Apps/X-Caliber/Run.HC similarity index 100% rename from Apps/X-Caliber/Run.CPP rename to Apps/X-Caliber/Run.HC diff --git a/Apps/X-Caliber/X-Caliber.CPP b/Apps/X-Caliber/X-Caliber.HC similarity index 100% rename from Apps/X-Caliber/X-Caliber.CPP rename to Apps/X-Caliber/X-Caliber.HC diff --git a/Apps/X-Caliber/XCCtrls.CPP b/Apps/X-Caliber/XCCtrls.HC similarity index 100% rename from Apps/X-Caliber/XCCtrls.CPP rename to Apps/X-Caliber/XCCtrls.HC diff --git a/Compiler/Asm.CPP b/Compiler/Asm.HC similarity index 100% rename from Compiler/Asm.CPP rename to Compiler/Asm.HC diff --git a/Compiler/AsmInit.CPP b/Compiler/AsmInit.CPP deleted file mode 100644 index 7202631..0000000 --- a/Compiler/AsmInit.CPP +++ /dev/null @@ -1,209 +0,0 @@ -U0 AsmPrsInsFlags(CCmpCtrl *cc,CInst *tempi) -{ - I64 i; - while (TRUE) { - switch (cc->token) { - case TK_IDENT: - if ((i=LstMatch(cc->cur_str,"NO\0CB\0CW\0CD\0CP\0IB\0IW\0ID\0"))>=0) { - tempi->opcode_modifier=i; - break; - } else - return; - case TK_I64: - if (cc->cur_i64==16) - tempi->flags|=IEF_OP_SIZE16; - else if (cc->cur_i64==32) - tempi->flags|=IEF_OP_SIZE32; - else - return; - break; - case '+': - tempi->flags|=IEF_PLUS_OPCODE; - case '/': - if (Lex(cc)==TK_I64 && cc->cur_i64<8) - tempi->slash_val=cc->cur_i64; - else if (cc->token==TK_IDENT) { - if (!StrCmp(cc->cur_str,"R")) - tempi->slash_val=SV_R_REG; - else if (!StrCmp(cc->cur_str,"I")) - tempi->slash_val=SV_I_REG; - else - return; - } else - return; - break; - case '!': tempi->flags|=IEF_DONT_SWITCH_MODES; break; - case '&': tempi->flags|=IEF_DFT; break; - case '%': tempi->flags|=IEF_NOT_IN_64_BIT; break; - case '=': tempi->flags|=IEF_48_REX; break; - case '`': tempi->flags|=IEF_REX_ONLY_R8_R15; break; - case '^': tempi->flags|=IEF_REX_XOR_LIKE; break; - case '*': tempi->flags|=IEF_STI_LIKE; break; - case '$$': tempi->flags|=IEF_ENDING_ZERO; break; - default: - return; - } - Lex(cc); - } -} - -U0 AsmHashLoad() -{//See $LK,"::/Compiler/OpCodes.TXT"$. - I64 i,j,size,size_max; - CInternalType *tempit; - CCmpCtrl *cc; - CHashGeneric *temph; - CHashReg *tempr; - CHashOpcode *tempo,*tempo2,*tempo_max; - CInst *tempi; - CHashClass *tempc; - - cmp.size_arg_mask[0]=0x3FF0FFFFFE; - cmp.size_arg_mask[1]=0x1110111112; - cmp.size_arg_mask[2]=0x2220222224; - cmp.size_arg_mask[4]=0x0440444448; - cmp.size_arg_mask[8]=0x0880888880; - - cmp.asm_hash=HashTableNew(1024); - size_max=offset(CHashOpcode.ins)+sizeof(CInst)<<5; - tempo_max=MAlloc(size_max); - - cc=CmpCtrlNew(FileRead("OpCodes.TXT"),,"OpCodes.TXT.Z"); - cc->htc.hash_table_lst=NULL; - Lex(cc); - while (cc->token) { - if (cc->token!=TK_IDENT) - LexExcept(cc,"Expecting identifier at "); - i=LstMatch(cc->cur_str,"NONE\0R8\0R16\0R32\0R64\0SEG\0FSTK\0" - "MM\0XMM\0OPCODE\0KEYWORD\0ASM_KEYWORD\0"); - if (i<=0) - LexExcept(cc,"Unknown Stmt"); - Lex(cc); //skip keyword - if (cc->token!=TK_IDENT) - LexExcept(cc,"Expecting identifier at "); - switch (i) { - case REGT_R8...REGT_XMM: - tempr=CAlloc(sizeof(CHashReg)); - tempr->str=cc->cur_str; - cc->cur_str=NULL; - Lex(cc); //skip keyword name - if (cc->token!=TK_I64) - LexExcept(cc,"Expecting int at "); - tempr->type=HTT_REG; - tempr->reg_type=i; - tempr->reg_num=cc->cur_i64; - HashAdd(tempr,cmp.asm_hash); - Lex(cc); //Skip INT - break; - case: //OPCODE - if (cc->token!=TK_IDENT) - LexExcept(cc,"Expecting opcode at "); - MemSet(tempo_max,0,size_max); - tempo_max->type=HTT_OPCODE; - tempo_max->inst_entry_cnt=0; - tempo_max->str=cc->cur_str; - cc->cur_str=0; - Lex(cc); //Skip OPCODE - while (cc->token && cc->token!=';' && cc->token!=':') { - tempi=&tempo_max->ins[tempo_max->inst_entry_cnt]; - tempi->ins_entry_num=tempo_max->inst_entry_cnt++; - tempi->slash_val=SV_NONE; //Not zero!! - while (cc->token==TK_I64) { - tempi->opcode[tempi->opcode_cnt++]=cc->cur_i64; - Lex(cc); - } - if (cc->token==',') - Lex(cc); - else if (cc->token!=';') - LexExcept(cc,"Expecting ',' at "); - - AsmPrsInsFlags(cc,tempi); - - tempi->uasm_slash_val=tempi->slash_val; - if (tempi->flags&IEF_STI_LIKE && tempi->slash_val!=SV_I_REG) - tempi->uasm_slash_val=SV_STI_LIKE; - - tempi->arg1=tempi->arg2=tempi->size1=tempi->size2=0; - if (cc->token==TK_IDENT) { - j=DefineMatch(cc->cur_str,"ST_ARG_TYPES"); - tempi->arg1=j; - if (Bt(&cmp.size_arg_mask[1],j)) - tempi->size1=8; - else if (Bt(&cmp.size_arg_mask[2],j)) - tempi->size1=16; - else if (Bt(&cmp.size_arg_mask[4],j)) - tempi->size1=32; - else if (Bt(&cmp.size_arg_mask[8],j)) - tempi->size1=64; - - if (Lex(cc)==TK_IDENT) { - j=DefineMatch(cc->cur_str,"ST_ARG_TYPES"); - Lex(cc); - tempi->arg2=j; - if (Bt(&cmp.size_arg_mask[1],j)) - tempi->size2=8; - else if (Bt(&cmp.size_arg_mask[2],j)) - tempi->size2=16; - else if (Bt(&cmp.size_arg_mask[4],j)) - tempi->size2=32; - else if (Bt(&cmp.size_arg_mask[8],j)) - tempi->size2=64; - } - } - } - size=offset(CHashOpcode.ins)+sizeof(CInst)*tempo_max->inst_entry_cnt; - tempo=MAlloc(size); - MemCpy(tempo,tempo_max,size); - tempo->use_cnt=0; - if (HashFind(tempo->str,cmp.asm_hash,HTT_OPCODE)) - LexExcept(cc,"Duplicate OPCODE entry "); - HashAdd(tempo,cmp.asm_hash); - //Parse aliases. - if (cc->token==':') { - while (Lex(cc)==TK_IDENT) { - tempo2=MAllocIdent(tempo); - tempo2->str=cc->cur_str; - cc->cur_str=0; - tempo2->oc_flags|=OCF_ALIAS; - if (HashFind(tempo2->str,cmp.asm_hash,HTT_OPCODE)) - LexExcept(cc,"Duplicate OPCODE ALIAS entry "); - HashAdd(tempo2,cmp.asm_hash); - } - } - break; - case: //KEYWORD - case: //ASM_KEYWORD - temph=CAlloc(sizeof(CHashGeneric)); - temph->str=cc->cur_str; - cc->cur_str=NULL; - Lex(cc); //skip keyword name - if (cc->token!=TK_I64) - LexExcept(cc,"Expecting int at "); - temph->user_data0=cc->cur_i64; - if (i==10) - temph->type=HTT_KEYWORD; - else - temph->type=HTT_ASM_KEYWORD; - HashAdd(temph,cmp.asm_hash); - Lex(cc); //Skip INT - break; - } - if (cc->token!=';') - LexExcept(cc,"Missing ';' at"); - Lex(cc); //Skip ';' - } - Free(tempo_max); - CmpCtrlDel(cc); - for (i=0;itype=HTT_INTERNAL_TYPE; - tempc->raw_type=tempit->type; - Bts(&tempc->flags,Cf_INTERNAL_TYPE); - tempc->size=tempit->size; - tempc->str=AStrNew(tempit->name); - HashAdd(tempc,cmp.asm_hash); - cmp.internal_types[tempc->raw_type]=tempc; - } - adam_task->hash_table->next=cmp.asm_hash; -} diff --git a/Compiler/AsmInit.HC b/Compiler/AsmInit.HC new file mode 100644 index 0000000..204ba14 --- /dev/null +++ b/Compiler/AsmInit.HC @@ -0,0 +1,209 @@ +U0 AsmPrsInsFlags(CCmpCtrl *cc,CInst *tempi) +{ + I64 i; + while (TRUE) { + switch (cc->token) { + case TK_IDENT: + if ((i=LstMatch(cc->cur_str,"NO\0CB\0CW\0CD\0CP\0IB\0IW\0ID\0"))>=0) { + tempi->opcode_modifier=i; + break; + } else + return; + case TK_I64: + if (cc->cur_i64==16) + tempi->flags|=IEF_OP_SIZE16; + else if (cc->cur_i64==32) + tempi->flags|=IEF_OP_SIZE32; + else + return; + break; + case '+': + tempi->flags|=IEF_PLUS_OPCODE; + case '/': + if (Lex(cc)==TK_I64 && cc->cur_i64<8) + tempi->slash_val=cc->cur_i64; + else if (cc->token==TK_IDENT) { + if (!StrCmp(cc->cur_str,"R")) + tempi->slash_val=SV_R_REG; + else if (!StrCmp(cc->cur_str,"I")) + tempi->slash_val=SV_I_REG; + else + return; + } else + return; + break; + case '!': tempi->flags|=IEF_DONT_SWITCH_MODES; break; + case '&': tempi->flags|=IEF_DFT; break; + case '%': tempi->flags|=IEF_NOT_IN_64_BIT; break; + case '=': tempi->flags|=IEF_48_REX; break; + case '`': tempi->flags|=IEF_REX_ONLY_R8_R15; break; + case '^': tempi->flags|=IEF_REX_XOR_LIKE; break; + case '*': tempi->flags|=IEF_STI_LIKE; break; + case '$$': tempi->flags|=IEF_ENDING_ZERO; break; + default: + return; + } + Lex(cc); + } +} + +U0 AsmHashLoad() +{//See $LK,"::/Compiler/OpCodes.DD"$. + I64 i,j,size,size_max; + CInternalType *tempit; + CCmpCtrl *cc; + CHashGeneric *temph; + CHashReg *tempr; + CHashOpcode *tempo,*tempo2,*tempo_max; + CInst *tempi; + CHashClass *tempc; + + cmp.size_arg_mask[0]=0x3FF0FFFFFE; + cmp.size_arg_mask[1]=0x1110111112; + cmp.size_arg_mask[2]=0x2220222224; + cmp.size_arg_mask[4]=0x0440444448; + cmp.size_arg_mask[8]=0x0880888880; + + cmp.asm_hash=HashTableNew(1024); + size_max=offset(CHashOpcode.ins)+sizeof(CInst)<<5; + tempo_max=MAlloc(size_max); + + cc=CmpCtrlNew(FileRead("OpCodes.DD"),,"OpCodes.DD.Z"); + cc->htc.hash_table_lst=NULL; + Lex(cc); + while (cc->token) { + if (cc->token!=TK_IDENT) + LexExcept(cc,"Expecting identifier at "); + i=LstMatch(cc->cur_str,"NONE\0R8\0R16\0R32\0R64\0SEG\0FSTK\0" + "MM\0XMM\0OPCODE\0KEYWORD\0ASM_KEYWORD\0"); + if (i<=0) + LexExcept(cc,"Unknown Stmt"); + Lex(cc); //skip keyword + if (cc->token!=TK_IDENT) + LexExcept(cc,"Expecting identifier at "); + switch (i) { + case REGT_R8...REGT_XMM: + tempr=CAlloc(sizeof(CHashReg)); + tempr->str=cc->cur_str; + cc->cur_str=NULL; + Lex(cc); //skip keyword name + if (cc->token!=TK_I64) + LexExcept(cc,"Expecting int at "); + tempr->type=HTT_REG; + tempr->reg_type=i; + tempr->reg_num=cc->cur_i64; + HashAdd(tempr,cmp.asm_hash); + Lex(cc); //Skip INT + break; + case: //OPCODE + if (cc->token!=TK_IDENT) + LexExcept(cc,"Expecting opcode at "); + MemSet(tempo_max,0,size_max); + tempo_max->type=HTT_OPCODE; + tempo_max->inst_entry_cnt=0; + tempo_max->str=cc->cur_str; + cc->cur_str=0; + Lex(cc); //Skip OPCODE + while (cc->token && cc->token!=';' && cc->token!=':') { + tempi=&tempo_max->ins[tempo_max->inst_entry_cnt]; + tempi->ins_entry_num=tempo_max->inst_entry_cnt++; + tempi->slash_val=SV_NONE; //Not zero!! + while (cc->token==TK_I64) { + tempi->opcode[tempi->opcode_cnt++]=cc->cur_i64; + Lex(cc); + } + if (cc->token==',') + Lex(cc); + else if (cc->token!=';') + LexExcept(cc,"Expecting ',' at "); + + AsmPrsInsFlags(cc,tempi); + + tempi->uasm_slash_val=tempi->slash_val; + if (tempi->flags&IEF_STI_LIKE && tempi->slash_val!=SV_I_REG) + tempi->uasm_slash_val=SV_STI_LIKE; + + tempi->arg1=tempi->arg2=tempi->size1=tempi->size2=0; + if (cc->token==TK_IDENT) { + j=DefineMatch(cc->cur_str,"ST_ARG_TYPES"); + tempi->arg1=j; + if (Bt(&cmp.size_arg_mask[1],j)) + tempi->size1=8; + else if (Bt(&cmp.size_arg_mask[2],j)) + tempi->size1=16; + else if (Bt(&cmp.size_arg_mask[4],j)) + tempi->size1=32; + else if (Bt(&cmp.size_arg_mask[8],j)) + tempi->size1=64; + + if (Lex(cc)==TK_IDENT) { + j=DefineMatch(cc->cur_str,"ST_ARG_TYPES"); + Lex(cc); + tempi->arg2=j; + if (Bt(&cmp.size_arg_mask[1],j)) + tempi->size2=8; + else if (Bt(&cmp.size_arg_mask[2],j)) + tempi->size2=16; + else if (Bt(&cmp.size_arg_mask[4],j)) + tempi->size2=32; + else if (Bt(&cmp.size_arg_mask[8],j)) + tempi->size2=64; + } + } + } + size=offset(CHashOpcode.ins)+sizeof(CInst)*tempo_max->inst_entry_cnt; + tempo=MAlloc(size); + MemCpy(tempo,tempo_max,size); + tempo->use_cnt=0; + if (HashFind(tempo->str,cmp.asm_hash,HTT_OPCODE)) + LexExcept(cc,"Duplicate OPCODE entry "); + HashAdd(tempo,cmp.asm_hash); + //Parse aliases. + if (cc->token==':') { + while (Lex(cc)==TK_IDENT) { + tempo2=MAllocIdent(tempo); + tempo2->str=cc->cur_str; + cc->cur_str=0; + tempo2->oc_flags|=OCF_ALIAS; + if (HashFind(tempo2->str,cmp.asm_hash,HTT_OPCODE)) + LexExcept(cc,"Duplicate OPCODE ALIAS entry "); + HashAdd(tempo2,cmp.asm_hash); + } + } + break; + case: //KEYWORD + case: //ASM_KEYWORD + temph=CAlloc(sizeof(CHashGeneric)); + temph->str=cc->cur_str; + cc->cur_str=NULL; + Lex(cc); //skip keyword name + if (cc->token!=TK_I64) + LexExcept(cc,"Expecting int at "); + temph->user_data0=cc->cur_i64; + if (i==10) + temph->type=HTT_KEYWORD; + else + temph->type=HTT_ASM_KEYWORD; + HashAdd(temph,cmp.asm_hash); + Lex(cc); //Skip INT + break; + } + if (cc->token!=';') + LexExcept(cc,"Missing ';' at"); + Lex(cc); //Skip ';' + } + Free(tempo_max); + CmpCtrlDel(cc); + for (i=0;itype=HTT_INTERNAL_TYPE; + tempc->raw_type=tempit->type; + Bts(&tempc->flags,Cf_INTERNAL_TYPE); + tempc->size=tempit->size; + tempc->str=AStrNew(tempit->name); + HashAdd(tempc,cmp.asm_hash); + cmp.internal_types[tempc->raw_type]=tempc; + } + adam_task->hash_table->next=cmp.asm_hash; +} diff --git a/Compiler/AsmLib.CPP b/Compiler/AsmLib.HC similarity index 100% rename from Compiler/AsmLib.CPP rename to Compiler/AsmLib.HC diff --git a/Compiler/AsmResolve.CPP b/Compiler/AsmResolve.HC similarity index 100% rename from Compiler/AsmResolve.CPP rename to Compiler/AsmResolve.HC diff --git a/Compiler/BackA.CPP b/Compiler/BackA.HC similarity index 100% rename from Compiler/BackA.CPP rename to Compiler/BackA.HC diff --git a/Compiler/BackB.CPP b/Compiler/BackB.HC similarity index 100% rename from Compiler/BackB.CPP rename to Compiler/BackB.HC diff --git a/Compiler/BackC.CPP b/Compiler/BackC.HC similarity index 100% rename from Compiler/BackC.CPP rename to Compiler/BackC.HC diff --git a/Compiler/BackFA.CPP b/Compiler/BackFA.HC similarity index 100% rename from Compiler/BackFA.CPP rename to Compiler/BackFA.HC diff --git a/Compiler/BackFB.CPP b/Compiler/BackFB.HC similarity index 100% rename from Compiler/BackFB.CPP rename to Compiler/BackFB.HC diff --git a/Compiler/BackLib.CPP b/Compiler/BackLib.HC similarity index 100% rename from Compiler/BackLib.CPP rename to Compiler/BackLib.HC diff --git a/Compiler/CExcept.CPP b/Compiler/CExcept.HC similarity index 100% rename from Compiler/CExcept.CPP rename to Compiler/CExcept.HC diff --git a/Compiler/CExts.CPP b/Compiler/CExts.CPP deleted file mode 100644 index 0b11f2a..0000000 --- a/Compiler/CExts.CPP +++ /dev/null @@ -1,46 +0,0 @@ -import U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e); -import U0 DocBinsValidate(CDoc *doc); -import U0 DocDel(CDoc *doc); -import U0 DocLoad(CDoc *doc,U8 *src2,I64 size); -import CDoc *DocNew(U8 *filename=NULL,CTask *task=NULL); -import CDocEntry *DocPrint(CDoc *doc=NULL,U8 *fmt,...); -import CDocEntry *DocPutLine(CDoc *doc,CDocEntry *doc_e); -import I64 DocSize(CDoc *doc); -import Bool DocWrite(CDoc *doc,Bool prompt=FALSE); -extern U8 *CmdLinePmt(); -extern I64 HashEntrySize2(CHashSrcSym *temph); -extern Bool IsLexExpression2Bin(CCmpCtrl *cc,U8 **_machine_code); -extern I64 Lex(CCmpCtrl *cc); -extern I64 LexExpression(CCmpCtrl *cc); -extern I64 LexGetChar(CCmpCtrl *cc); -extern CCodeMisc *OptLabelFwd(CCodeMisc *lb); -extern CIntermediateCode *OptPass012(CCmpCtrl *cc); -extern U0 OptPass3(CCmpCtrl *cc,COptReg *reg_offsets); -extern U0 OptPass4(CCmpCtrl *cc,COptReg *reg_offsets,I64 *_type); -extern U0 OptPass5(CCmpCtrl *cc); -extern U0 OptPass6(CCmpCtrl *cc); -extern I64 OptPass789A( - CCmpCtrl *cc,COptReg *reg_offsets,U8 *buf,CDbgInfo **_dbg); -extern CHashClass *PrsClass( - CCmpCtrl *cc,I64 keyword,I64 fsp_flags,Bool is_extern); -extern CHashFun *PrsFunJoin( - CCmpCtrl *cc,CHashClass *temp_return,U8 *name,I64 fsp_flags); -extern I64 PrsKeyWord(CCmpCtrl *cc); -extern Bool PrsStmt(CCmpCtrl *cc,I64 try_cnt=0, - CCodeMisc *lb_break=NULL,I64 cmp_flags=CMPF_PRS_SEMICOLON); -extern U0 PrsStreamBlk(CCmpCtrl *cc); -extern CHashClass *PrsType(CCmpCtrl *cc,CHashClass **tempc1, - I64 *_mode,CMemberLst *tempm,U8 **_ident,CHashFun **_fun_ptr, - CHashExport **_tempex,CArrayDim *tempad,I64 fsp_flags); -extern I64 PrsUnaryModifier(CCmpCtrl *cc,CPrsStk *ps, - CMemberLst **_local_var,CArrayDim **_tempad,I64 *unary_post_prec); -extern I64 PrsUnaryTerm( - CCmpCtrl *cc,CPrsStk *ps,CMemberLst **_local_var,CArrayDim **_tempad, - I64 *max_prec,I64 *unary_pre_prec,I64 *paren_prec); -extern U0 PrsVarInit2(CCmpCtrl *cc,U8 **_dst,CHashClass *tempc, - CArrayDim *tempad,U8 *data_addr_ip,U8 **_base,Bool data_heap,I64 pass); -_extern CMP_TEMPLATES U32 cmp_templates[1]; -_extern CMP_TEMPLATES_DONT_POP U32 cmp_templates_dont_pop[1]; -_extern CMP_TEMPLATES_DONT_PUSH2 U32 cmp_templates_dont_push2[1]; -_extern CMP_TEMPLATES_DONT_PUSH U32 cmp_templates_dont_push[1]; -_extern CMP_TEMPLATES_DONT_PUSH_POP U32 cmp_templates_dont_push_pop[1]; diff --git a/Compiler/CExts.HC b/Compiler/CExts.HC new file mode 100644 index 0000000..2e53f15 --- /dev/null +++ b/Compiler/CExts.HC @@ -0,0 +1,46 @@ +import U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e); +import U0 DocBinsValidate(CDoc *doc); +import U0 DocDel(CDoc *doc); +import U0 DocLoad(CDoc *doc,U8 *src2,I64 size); +import CDoc *DocNew(U8 *filename=NULL,CTask *task=NULL); +import CDocEntry *DocPrint(CDoc *doc=NULL,U8 *fmt,...); +import CDocEntry *DocPutLine(CDoc *doc,CDocEntry *doc_e); +import I64 DocSize(CDoc *doc); +import Bool DocWrite(CDoc *doc,Bool prompt=FALSE); +extern U8 *CmdLinePmt(); +extern I64 HashEntrySize2(CHashSrcSym *temph); +extern Bool IsLexExpression2Bin(CCmpCtrl *cc,U8 **_machine_code); +extern I64 Lex(CCmpCtrl *cc); +extern I64 LexExpression(CCmpCtrl *cc); +extern I64 LexGetChar(CCmpCtrl *cc); +extern CCodeMisc *OptLabelFwd(CCodeMisc *lb); +extern CIntermediateCode *OptPass012(CCmpCtrl *cc); +extern U0 OptPass3(CCmpCtrl *cc,COptReg *reg_offsets); +extern U0 OptPass4(CCmpCtrl *cc,COptReg *reg_offsets,I64 *_type); +extern U0 OptPass5(CCmpCtrl *cc); +extern U0 OptPass6(CCmpCtrl *cc); +extern I64 OptPass789A( + CCmpCtrl *cc,COptReg *reg_offsets,U8 *buf,CDbgInfo **_dbg); +extern CHashClass *PrsClass( + CCmpCtrl *cc,I64 keyword,I64 fsp_flags,Bool is_extern); +extern CHashFun *PrsFunJoin( + CCmpCtrl *cc,CHashClass *temp_return,U8 *name,I64 fsp_flags); +extern I64 PrsKeyWord(CCmpCtrl *cc); +extern Bool PrsStmt(CCmpCtrl *cc,I64 try_cnt=0, + CCodeMisc *lb_break=NULL,I64 cmp_flags=CMPF_PRS_SEMICOLON); +extern U0 PrsStreamBlk(CCmpCtrl *cc); +extern CHashClass *PrsType(CCmpCtrl *cc,CHashClass **_tempc1, + I64 *_mode,CMemberLst *tempm,U8 **_ident,CHashFun **_fun_ptr, + CHashExport **_tempex,CArrayDim *tempad,I64 fsp_flags); +extern I64 PrsUnaryModifier(CCmpCtrl *cc,CPrsStk *ps, + CMemberLst **_local_var,CArrayDim **_tempad,I64 *unary_post_prec); +extern I64 PrsUnaryTerm( + CCmpCtrl *cc,CPrsStk *ps,CMemberLst **_local_var,CArrayDim **_tempad, + I64 *max_prec,I64 *unary_pre_prec,I64 *paren_prec); +extern U0 PrsVarInit2(CCmpCtrl *cc,U8 **_dst,CHashClass *tempc, + CArrayDim *tempad,U8 *data_addr_ip,U8 **_base,Bool data_heap,I64 pass); +_extern CMP_TEMPLATES U32 cmp_templates[1]; +_extern CMP_TEMPLATES_DONT_POP U32 cmp_templates_dont_pop[1]; +_extern CMP_TEMPLATES_DONT_PUSH2 U32 cmp_templates_dont_push2[1]; +_extern CMP_TEMPLATES_DONT_PUSH U32 cmp_templates_dont_push[1]; +_extern CMP_TEMPLATES_DONT_PUSH_POP U32 cmp_templates_dont_push_pop[1]; diff --git a/Compiler/CHash.CPP b/Compiler/CHash.HC similarity index 100% rename from Compiler/CHash.CPP rename to Compiler/CHash.HC diff --git a/Compiler/CInit.CPP b/Compiler/CInit.HC similarity index 100% rename from Compiler/CInit.CPP rename to Compiler/CInit.HC diff --git a/Compiler/CMain.CPP b/Compiler/CMain.CPP deleted file mode 100644 index 9b2e746..0000000 --- a/Compiler/CMain.CPP +++ /dev/null @@ -1,702 +0,0 @@ -U8 *LexStmt2Bin(CCmpCtrl *cc,I64 *_type,I64 cmp_flags=0) -{//Compile one cc stmt to bin code. - I64 size,i,j,k,*res=INVALID_PTR; - CCodeCtrl *tempcbh; - if (_type) *_type=RT_I64; - Btr(&cc->flags,CCf_PASS_TRACE_PRESENT); - if (cc->aot_depth==2) - COCPush(cc); - COCInit(cc); - if (!PrsStmt(cc,,,cmp_flags)) { - if (cc->coc.coc_head.next!=&cc->coc.coc_head) { - cc->coc.coc_head.last->ic_flags&=~ICF_RES_NOT_USED; - ICAdd(cc,IC_RETURN_VAL2,0,0); - ICAdd(cc,IC_RET,0,0); - if (res=COCCompile(cc,&size,NULL,_type)) { - if (cc->flags&CCF_AOT_COMPILE) { - j=cc->aotc->ip; - k=(size+7)>>3; - for (i=0;icoc.coc_head.next); - if (cc->aot_depth==2) { - tempcbh=COCPopNoFree(cc); - COCAppend(cc,tempcbh); - } - return res; -} - -CAOT *CmpJoin(CCmpCtrl *cc,I64 cmp_flags,U8 *map_name=NULL,U8 mapfile_drv_let=0) -{ - CAOTCtrl *aotc,*old_aot=cc->aotc; - I64 i,j,l; - U8 *buf; - CAOTBinBlk *tempbin; - CAOTImportExport *tempie; - Bool okay=TRUE; - CLexHashTableContext *htc=MAlloc(sizeof(CLexHashTableContext)); - CAOT *res=CAlloc(sizeof(CAOT)),*parent; - if (parent=cc->aot) { - res->parent_aot=parent; - QueIns(res,parent->last); - } else - QueInit(res); - cc->aot=res; - - res->next_ie=res->last_ie=&res->next_ie; - cc->aotc=aotc=CAlloc(sizeof(CAOTCtrl)); - cc->aot_depth++; - - aotc->bin=CAlloc(sizeof(CAOTBinBlk)); - aotc->max_align_bits=0; - aotc->module_org=INVALID_PTR; - - MemCpy(htc,&cc->htc,sizeof(CLexHashTableContext)); - if (cc->htc.fun) - cc->htc.glbl_hash_table=HashTableNew(128); - else - cc->htc.glbl_hash_table=HashTableNew(1024); - if (cc->flags&CCF_AOT_COMPILE) { - cc->htc.define_hash_table=cc->htc.glbl_hash_table; - if (cc->aot_depth<=1) - cc->htc.glbl_hash_table->next=cmp.asm_hash; - else - cc->htc.glbl_hash_table->next=htc->glbl_hash_table; - } else - cc->htc.glbl_hash_table->next=Fs->hash_table; - cc->htc.hash_table_lst=cc->htc.local_hash_table=HashTableNew(16); - cc->htc.local_hash_table->next=cc->htc.glbl_hash_table; - cc->htc.local_var_lst=cc->htc.fun; //HolyC local vars - cc->htc.fun=NULL; - try { - if (cmp_flags&CMPF_LEX_FIRST) - Lex(cc); - if (!(cmp_flags&CMPF_ONE_ASM_INS)) - cmp_flags|=CMPF_PRS_SEMICOLON; - if (cc->flags&CCF_AOT_COMPILE) { - while (cc->token!=TK_EOF) { - buf=LexStmt2Bin(cc,NULL,cmp_flags); - if (buf!=INVALID_PTR) { - tempie=CAlloc(sizeof(CAOTImportExport)); - tempie->type=IET_MAIN; - tempie->ip=buf; - QueIns(tempie,res->last_ie); - } - if (cmp_flags&CMPF_ASM_BLK) - break; - } - } else - PrsStmt(cc,,,cmp_flags); - AOTGlblsResolve(cc,res); - } catch { - if (Fs->except_ch=='Compiler' && !(cmp_flags&CMPF_ASM_BLK)) { - LexPutPos(cc); - Fs->catch_except=TRUE; - } - okay=FALSE; - } - if (!okay) { - if (cc->error_cnt<1) - cc->error_cnt=1; - cc->aot=res->parent_aot; - Free(res); - LinkedLstDel(aotc->bin); - res=NULL; - } else { - if (map_name) - MapFileWrite(cc->htc.glbl_hash_table,map_name,mapfile_drv_let); - HashTableDel(cc->htc.local_hash_table); - HashTableDel(cc->htc.glbl_hash_table); - - if (!aotc->num_bin_U8s) - res->buf=NULL; - else { - if (cc->flags&CCF_AOT_COMPILE) - res->buf=MAlloc(aotc->num_bin_U8s); - else { - if (aotc->module_org==INVALID_PTR) - res->buf=MAlloc(aotc->num_bin_U8s,Fs->code_heap); - else - res->buf=aotc->module_org; - } - res->aot_U8s=aotc->num_bin_U8s; - tempbin=aotc->bin; - j=0; - l=aotc->num_bin_U8s; - while (tempbin) { - i=l; - if (i>AOT_BIN_BLK_SIZE) - i=AOT_BIN_BLK_SIZE; - MemCpy(res->buf+j,tempbin->body,i); - j+=i; - l-=i; - tempbin=tempbin->next; - } - } - LinkedLstDel(aotc->bin); - res->abss=aotc->abss; - res->heap_glbls=aotc->heap_glbls; - res->max_align_bits=aotc->max_align_bits; - res->module_org=aotc->module_org; - } - cc->aot=parent; - MemCpy(&cc->htc,htc,sizeof(CLexHashTableContext)); - Free(htc); - Free(aotc); - cc->aotc=old_aot; - cc->aot_depth--; - return res; -} - -CAOT *CmpBuf(U8 *buf,U8 *map_name=NULL, - I64 *error_cnt=NULL, I64 *warning_cnt=NULL,U8 mapfile_drv_let=0) -{ - CCmpCtrl *cc; - CAOT *res=NULL; - cc=CmpCtrlNew(buf,CCF_DONT_FREE_BUF); - cc->flags|=CCF_AOT_COMPILE; - QueIns(cc,Fs->last_cc); - res=CmpJoin(cc,CMPF_LEX_FIRST,map_name,mapfile_drv_let); - if (error_cnt) *error_cnt=cc->error_cnt; - if (warning_cnt) *warning_cnt=cc->warning_cnt; - QueRem(cc); - if (res) - CmpCtrlDel(cc); - return res; -} - -U0 CmpFixUpJITAsm(CCmpCtrl *cc,CAOT *tempaot) -{ - I64 i,ip2=tempaot->buf+tempaot->ip,*str=NULL; - U8 *ptr; - CCodeMisc *g_lb; - CAOTAbsAddr *tempa,*tempa1; - CAOTImportExport *tempie,*tempie1; - CHashExport *tempex; - - tempa=tempaot->abss; - while (tempa) { - tempa1=tempa->next; - ptr=ip2+tempa->ip; - switch [tempa->type] { - case AAT_ADD_U8: *ptr(U8 *) +=ip2; break; - case AAT_SUB_U8: *ptr(U8 *) -=ip2; break; - case AAT_ADD_U16: *ptr(U16 *)+=ip2; break; - case AAT_SUB_U16: *ptr(U16 *)-=ip2; break; - case AAT_ADD_U32: *ptr(U32 *)+=ip2; break; - case AAT_SUB_U32: *ptr(U32 *)-=ip2; break; - case AAT_ADD_U64: *ptr(I64 *)+=ip2; break; - case AAT_SUB_U64: *ptr(I64 *)-=ip2; break; - } - Free(tempa); - tempa=tempa1; - } - tempie=tempaot->next_ie; - while (tempie!=&tempaot->next_ie) { - tempie1=tempie->next; - if (tempie->str) { - Free(str); - str=tempie->str; - } - switch (tempie->type) { - case IET_REL32_EXPORT: - case IET_IMM32_EXPORT: - case IET_REL64_EXPORT: - case IET_IMM64_EXPORT: - tempex=CAlloc(sizeof(CHashExport)); - tempex->str=str; - str=NULL; - tempex->type=HTT_EXPORT_SYS_SYM|HTF_IMM; - if (tempie->type==IET_IMM32_EXPORT||tempie->type==IET_IMM64_EXPORT) - tempex->val=tempie->ip; - else - tempex->val=tempie->ip+ip2; - tempex->src_link=tempie->src_link; - tempie->src_link=NULL; - HashAdd(tempex,Fs->hash_table); - SysSymImportsResolve(tempex->str); - break; - case IET_REL_I0...IET_IMM_I64: - if (tempie->str) { - if (tempie->flags&IEF_GOTO_LABEL) { - if(!(g_lb=COCGoToLabelFind(cc,str))) - "Unresolved Reference:%s\n",str; - else { - g_lb->use_cnt++; - g_lb=OptLabelFwd(g_lb); - i=g_lb->addr+tempaot->buf; - } - tempex=NULL; - } else { - if (!(tempex=HashFind(str,Fs->hash_table, - HTG_ALL-HTT_IMPORT_SYS_SYM))) - "Unresolved Reference:%s\n",str; - else { - if (tempex->type & HTT_FUN) - i=tempex(CHashFun *)->exe_addr; - else if (tempex->type & HTT_GLBL_VAR) - i=tempex(CHashGlblVar *)->data_addr; - else - i=tempex->val; - } - g_lb=NULL; - } - } - if (tempex || g_lb) { - ptr=tempie->ip+ip2; - switch [tempie->type] { - case IET_REL_I0: - case IET_IMM_U0: - break; - case IET_REL_I8: - if (!(MIN_I8<=i-ptr-1<=MAX_I8)) - LexExcept(cc,"Branch out of range at "); - *ptr(U8 *) =i-ptr-1; - break; - case IET_IMM_U8: - *ptr(U8 *) =i; - break; - case IET_REL_I16: - if (!(MIN_I16<=i-ptr-2<=MAX_I16)) - LexExcept(cc,"Branch out of range at "); - *ptr(U16 *)=i-ptr-2; - break; - case IET_IMM_U16: - *ptr(U16 *)=i; - break; - case IET_REL_I32: - if (!(MIN_I32<=i-ptr-4<=MAX_I32)) - LexExcept(cc,"Branch out of range at "); - *ptr(U32 *)=i-ptr-4; - break; - case IET_IMM_U32: - *ptr(U32 *)=i; - break; - case IET_REL_I64: - *ptr(I64 *)=i-ptr-8; - break; - case IET_IMM_I64: - *ptr(I64 *)=i; - break; - } - } - break; - } - Free(tempie->src_link); - Free(tempie); - tempie=tempie1; - } - Free(str); - if (!cc->aot_depth && Bt(&cc->opts,OPTf_TRACE)) - Un(ip2,tempaot->aot_U8s,64); - QueRem(tempaot); - Free(tempaot); -} - -U0 CmpFixUpAOTAsm(CCmpCtrl *cc,CAOT *tempaot) -{ - CAOTCtrl *aotc=cc->aotc; - I64 i,ip2=tempaot->ip+cc->aotc->ip; - U8 *ptr; - CCodeMisc *g_lb=NULL; - CAOTAbsAddr *tempa,*tempa1; - CAOTImportExport *tempie,*tempie1; - - tempa=tempaot->abss; - while (tempa) { - tempa1=tempa->next; - tempa->next=aotc->abss; - ptr=tempaot->buf+tempaot->ip+tempa->ip; - switch [tempa->type] { - case AAT_ADD_U8: *ptr(U8 *)+=ip2; break; - case AAT_SUB_U8: *ptr(U8 *)-=ip2; break; - case AAT_ADD_U16: *ptr(U16 *)+=ip2; break; - case AAT_SUB_U16: *ptr(U16 *)-=ip2; break; - case AAT_ADD_U32: *ptr(U32 *)+=ip2; break; - case AAT_SUB_U32: *ptr(U32 *)-=ip2; break; - case AAT_ADD_U64: *ptr(I64 *)+=ip2; break; - case AAT_SUB_U64: *ptr(I64 *)-=ip2; break; - } - aotc->abss=tempa; - tempa->ip+=ip2; - tempa=tempa1; - } - - tempie=tempaot->next_ie; - while (tempie!=&tempaot->next_ie) { - tempie1=tempie->next; - QueRem(tempie); - if (IET_REL_I0<=tempie->type<=IET_IMM_I64) { - if (tempie->str) { - if (tempie->flags&IEF_GOTO_LABEL) { - if(!(g_lb=COCGoToLabelFind(cc,tempie->str))) - "Unresolved Reference:%s\n",tempie->str; - else { - g_lb->use_cnt++; - g_lb=OptLabelFwd(g_lb); - } - } else - g_lb=NULL; - } - } else - g_lb=NULL; - - ptr=tempaot->buf+tempaot->ip+tempie->ip; - if (g_lb) { - i=g_lb->addr+tempaot->buf; - switch [tempie->type] { - case IET_REL_I0: - case IET_IMM_U0: - break; - case IET_REL_I8: - if (!(MIN_I8<=i-ptr-1<=MAX_I8)) - LexExcept(cc,"Branch out of range at "); - *ptr(U8 *) =i-ptr-1; - break; - case IET_IMM_U8: - *ptr(U8 *) =i; - break; - case IET_REL_I16: - if (!(MIN_I16<=i-ptr-2<=MAX_I16)) - LexExcept(cc,"Branch out of range at "); - *ptr(U16 *)=i-ptr-2; - break; - case IET_IMM_U16: - *ptr(U16 *)=i; - break; - case IET_REL_I32: - if (!(MIN_I32<=i-ptr-4<=MAX_I32)) - LexExcept(cc,"Branch out of range at "); - *ptr(U32 *)=i-ptr-4; - break; - case IET_IMM_U32: - *ptr(U32 *)=i; - break; - case IET_REL_I64: - *ptr(I64 *)=i-ptr-8; - break; - case IET_IMM_I64: - *ptr(I64 *)=i; - break; - } - Free(tempie->src_link); - Free(tempie); - } else { - switch (tempie->type) { - start: - case IET_REL32_EXPORT: - case IET_IMM32_EXPORT: - case IET_REL64_EXPORT: - case IET_IMM64_EXPORT: - case IET_IMM_U0: - case IET_IMM_U8: - case IET_IMM_U16: - case IET_IMM_U32: - case IET_IMM_I64: - case IET_REL_I0: - break; - case IET_REL_I8: *ptr(U8 *) -=ip2; break; - case IET_REL_I16: *ptr(U16 *)-=ip2; break; - case IET_REL_I32: *ptr(U32 *)-=ip2; break; - case IET_REL_I64: *ptr(I64 *)-=ip2; break; - end: - tempie->ip+=ip2; - break; - } - tempie->aot=NULL; - QueIns(tempie,tempaot->parent_aot->last_ie); - } - tempie=tempie1; - } -} - -I64 Cmp(U8 *filename,U8 *map_name=NULL,U8 *out_name=NULL,U8 mapfile_drv_let=0) -{//AOT Compile CPP or PRJ file a and output BIN file. Returns err_cnt. - U8 *ptr,*fbuf=NULL,*fbuf2=NULL,*fbuf3=NULL, - *patch_table=MAlloc(0x20000); - CAOT *tempaot; - I64 i,cnt,size=0,error_cnt=0,warning_cnt=0,aot_U8s=0; - CBinFile *bfh; - CAOTImportExport *tempie,*tempie1; - CAOTAbsAddr *tempa,*tempa1; - CAOTHeapGlblRef *temphgr,*temphgr1; - CAOTHeapGlbl *temphg,*temphg1; - - fbuf=DftExt(filename,"PRJ.Z"); - fbuf2=MStrPrint("#include \"%s\"",fbuf); - if (map_name) - fbuf3=DftExt(map_name,"MAP.Z"); - - if (tempaot=CmpBuf(fbuf2,fbuf3,&error_cnt,&warning_cnt,mapfile_drv_let)) { - aot_U8s=tempaot->aot_U8s; - ptr=patch_table; -//See $LK,"Load",A="MN:Load"$() - cnt=0; - tempa=tempaot->abss; - while (tempa) { - if (!(tempa->type&IEF_IMM_NOT_REL)) - cnt++; - tempa=tempa->next; - } - if (cnt) { - *ptr++=IET_ABS_ADDR; - *ptr(U32 *)++=cnt; - *ptr++=0; - tempa=tempaot->abss; - while (tempa) { - tempa1=tempa->next; - if (!(tempa->type&IEF_IMM_NOT_REL)) - *ptr(U32 *)++ =tempa->ip; - Free(tempa); - tempa=tempa1; - } - } - temphg=tempaot->heap_glbls; - while (temphg) { - temphg1=temphg->next; - cnt=0; - temphgr=temphg->references; - while (temphgr) { - cnt++; - temphgr=temphgr->next; - } - if (cnt) { - *ptr++=IET_DATA_HEAP; - *ptr(U32 *)++=cnt; - if (temphg->str) { - i=StrLen(temphg->str); - MemCpy(ptr,temphg->str,i+1); - Free(temphg->str); - ptr+=i+1; - } else - *ptr++=0; - *ptr(I64 *)++=temphg->size; - temphgr=temphg->references; - while (temphgr) { - temphgr1=temphgr->next; - *ptr(U32 *)++=temphgr->ip; - Free(temphgr); - temphgr=temphgr1; - } - } - Free(temphg); - temphg=temphg1; - } - - //Do exports first - tempie=tempaot->next_ie; - while (tempie!=&tempaot->next_ie) { - tempie1=tempie->next; - if (!tempie->type || IET_REL32_EXPORT<=tempie->type<=IET_IMM64_EXPORT) { - QueRem(tempie); - *ptr++=tempie->type; - *ptr(U32 *)++=tempie->ip; - if (tempie->str) { - i=StrLen(tempie->str); - MemCpy(ptr,tempie->str,i+1); - Free(tempie->str); - ptr+=i+1; - } else - *ptr++=0; - Free(tempie->src_link); - Free(tempie); - } - tempie=tempie1; - } - - //Do imports second - tempie=tempaot->next_ie; - while (tempie!=&tempaot->next_ie) { - tempie1=tempie->next; - QueRem(tempie); - *ptr++=tempie->type; - if (tempie->aot) - tempie->ip+=tempie->aot->ip2; - *ptr(U32 *)++=tempie->ip; - if (tempie->str) { - i=StrLen(tempie->str); - MemCpy(ptr,tempie->str,i+1); - Free(tempie->str); - ptr+=i+1; - } else - *ptr++=0; - Free(tempie->src_link); - Free(tempie); - tempie=tempie1; - } - - *ptr++=IET_END; - MemSet(ptr,0,16); - i=ptr-patch_table; -//Needs 16 ALIGN - size=(sizeof(CBinFile)+aot_U8s+i+15)&-16; - bfh=MAlloc(size); - bfh->jmp=0xEB+256*(sizeof(CBinFile)-2); -#assert sizeof(CBinFile)-2<=MAX_I8 - bfh->reserved=0; - bfh->bin_signature=BIN_SIGNATURE_VAL; - bfh->module_org=tempaot->module_org; - bfh->module_align_bits=tempaot->max_align_bits; - bfh->patch_table_offset=sizeof(CBinFile)+aot_U8s; - bfh->file_size=size; - MemCpy(bfh(U8 *)+sizeof(CBinFile),tempaot->buf,aot_U8s); - MemCpy(bfh(U8 *)+sizeof(CBinFile)+aot_U8s,patch_table, - size-aot_U8s-sizeof(CBinFile)); - Free(fbuf2); - if (out_name) - fbuf2=DftExt(out_name,"BIN.Z"); - else - fbuf2=ChgExt(fbuf,"BIN.Z"); - FileWrite(fbuf2,bfh,size); - Free(bfh); - Free(tempaot->buf); - QueDel(tempaot); - Free(tempaot); - } - Free(patch_table); - Free(fbuf); - Free(fbuf2); - Free(fbuf3); - Print("Errs:%d Warns:%d Code:%X Size:%X\n", - error_cnt,warning_cnt,aot_U8s,size); - return error_cnt; -} - -I64 ExePutS(U8 *buf,U8 *filename=NULL, - I64 ccf_flags=0,CLexHashTableContext *htc=NULL) -{//JIT Compile and execute text from a puts(""). - I64 res; - Bool okay=TRUE; - CCmpCtrl *cc; - if (!filename) - filename=blkdev.temp_filename; - cc=CmpCtrlNew(buf,ccf_flags|CCF_DONT_FREE_BUF,filename); - if (Fs->last_cc!=&Fs->next_cc) { - cc->opts=Fs->last_cc->opts; - if (htc) { - cc->flags=cc->flags &~CCF_ASM_EXPRESSIONS | - htc->old_flags&CCF_ASM_EXPRESSIONS; - MemCpy(&cc->htc,htc,sizeof(CLexHashTableContext)); - } - } - QueIns(cc,Fs->last_cc); - try { - Lex(cc); - res=ExeCmdLine(cc); - } catch { - if (Fs->except_ch=='Compiler' || Fs->except_ch=='Break') { - Fs->catch_except=TRUE; - okay=FALSE; - res=0; - } - } - QueRem(cc); - if (okay) - CmpCtrlDel(cc); //TODO: can crash - return res; -} - -I64 ExePrint(U8 *fmt,...) -{//JIT Compile and execute text from a printf(). - I64 res; - U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); - res=ExePutS(buf); - Free(buf); - return res; -} - -I64 ExeFile(U8 *name,I64 ccf_flags=0) -{//JIT Compile and execute a file. - I64 res; - U8 *name2=DftExt(name,"CPP.Z"), - *st=MStrPrint("#include \"%s\";",name2); - res=ExePutS(st,name,ccf_flags); - Free(st); - Free(name2); - return res; -} - -I64 RunFile(U8 *name,I64 ccf_flags=0,...) -{//$LK,"ExeFile",A="MN:ExeFile"$() with args using $LK,"LastFun",A="MN:LastFun"$(). - ExeFile(name,ccf_flags); - return LastFun(argc,argv); -} - -I64 ExePutS2(U8 *buf,U8 *filename=NULL,I64 ccf_flags=0) -{//throws exceptions - I64 res; - CCmpCtrl *cc; - if (!filename) - filename=blkdev.temp_filename; - cc=CmpCtrlNew(buf,ccf_flags|CCF_DONT_FREE_BUF,filename); - if (Fs->last_cc!=&Fs->next_cc) - cc->opts=Fs->last_cc->opts; - QueIns(cc,Fs->last_cc); - Lex(cc); - res=ExeCmdLine(cc); - QueRem(cc); - CmpCtrlDel(cc); - return res; -} - -I64 ExePrint2(U8 *fmt,...) -{//throws exceptions - I64 res; - U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); - res=ExePutS2(buf); - Free(buf); - return res; -} - -I64 ExeFile2(U8 *name,I64 ccf_flags=0) -{//throws exceptions - I64 res; - U8 *name2=DftExt(name,"CPP.Z"),*st=MStrPrint("#include \"%s\";",name2); - res=ExePutS2(st,name,ccf_flags); - Free(st); - Free(name2); - return res; -} - -I64 RunFile2(U8 *name,I64 ccf_flags=0,...) -{//$LK,"ExeFile2",A="MN:ExeFile2"$() with args using $LK,"LastFun",A="MN:LastFun"$(). throws exceptions. - ExeFile2(name,ccf_flags); - return LastFun(argc,argv); -} - -I64 StreamExePrint(U8 *fmt,...) -{//Causes value from stream to be used in an #exe{} block. - U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); - I64 res=0; - CLexHashTableContext *htc; - CCmpCtrl *cc=Fs->last_cc; - if (cc==&Fs->next_cc) - PrintErr("Not Compiling\n"); - else { - if (!(cc->flags&CCF_EXE_BLK)) - LexExcept(cc,"StreamExePrint only allowed in AOT compiled #exe{} mode."); - if (htc=cc->htc.next) - res=ExePutS(buf,,,htc); - } - Free(buf); - return res; -} - -U0 CInit() -{ - CmpLoadDefines; - CmpFillTables; - QueInit(&cmp.ic_nop); - cmp.ic_nop.ic_class=cmp.internal_types[RT_I64]; - cmp.ic_nop.ic_code=IC_NOP1; - AsmHashLoad; - UAsmHashLoad; -} - -CInit; diff --git a/Compiler/CMain.HC b/Compiler/CMain.HC new file mode 100644 index 0000000..bc3cf7c --- /dev/null +++ b/Compiler/CMain.HC @@ -0,0 +1,702 @@ +U8 *LexStmt2Bin(CCmpCtrl *cc,I64 *_type,I64 cmp_flags=0) +{//Compile one cc stmt to bin code. + I64 size,i,j,k,*res=INVALID_PTR; + CCodeCtrl *tempcbh; + if (_type) *_type=RT_I64; + Btr(&cc->flags,CCf_PASS_TRACE_PRESENT); + if (cc->aot_depth==2) + COCPush(cc); + COCInit(cc); + if (!PrsStmt(cc,,,cmp_flags)) { + if (cc->coc.coc_head.next!=&cc->coc.coc_head) { + cc->coc.coc_head.last->ic_flags&=~ICF_RES_NOT_USED; + ICAdd(cc,IC_RETURN_VAL2,0,0); + ICAdd(cc,IC_RET,0,0); + if (res=COCCompile(cc,&size,NULL,_type)) { + if (cc->flags&CCF_AOT_COMPILE) { + j=cc->aotc->ip; + k=(size+7)>>3; + for (i=0;icoc.coc_head.next); + if (cc->aot_depth==2) { + tempcbh=COCPopNoFree(cc); + COCAppend(cc,tempcbh); + } + return res; +} + +CAOT *CmpJoin(CCmpCtrl *cc,I64 cmp_flags,U8 *map_name=NULL,U8 mapfile_drv_let=0) +{ + CAOTCtrl *aotc,*old_aot=cc->aotc; + I64 i,j,l; + U8 *buf; + CAOTBinBlk *tempbin; + CAOTImportExport *tempie; + Bool okay=TRUE; + CLexHashTableContext *htc=MAlloc(sizeof(CLexHashTableContext)); + CAOT *res=CAlloc(sizeof(CAOT)),*parent; + if (parent=cc->aot) { + res->parent_aot=parent; + QueIns(res,parent->last); + } else + QueInit(res); + cc->aot=res; + + res->next_ie=res->last_ie=&res->next_ie; + cc->aotc=aotc=CAlloc(sizeof(CAOTCtrl)); + cc->aot_depth++; + + aotc->bin=CAlloc(sizeof(CAOTBinBlk)); + aotc->max_align_bits=0; + aotc->module_org=INVALID_PTR; + + MemCpy(htc,&cc->htc,sizeof(CLexHashTableContext)); + if (cc->htc.fun) + cc->htc.glbl_hash_table=HashTableNew(128); + else + cc->htc.glbl_hash_table=HashTableNew(1024); + if (cc->flags&CCF_AOT_COMPILE) { + cc->htc.define_hash_table=cc->htc.glbl_hash_table; + if (cc->aot_depth<=1) + cc->htc.glbl_hash_table->next=cmp.asm_hash; + else + cc->htc.glbl_hash_table->next=htc->glbl_hash_table; + } else + cc->htc.glbl_hash_table->next=Fs->hash_table; + cc->htc.hash_table_lst=cc->htc.local_hash_table=HashTableNew(16); + cc->htc.local_hash_table->next=cc->htc.glbl_hash_table; + cc->htc.local_var_lst=cc->htc.fun; //HolyC local vars + cc->htc.fun=NULL; + try { + if (cmp_flags&CMPF_LEX_FIRST) + Lex(cc); + if (!(cmp_flags&CMPF_ONE_ASM_INS)) + cmp_flags|=CMPF_PRS_SEMICOLON; + if (cc->flags&CCF_AOT_COMPILE) { + while (cc->token!=TK_EOF) { + buf=LexStmt2Bin(cc,NULL,cmp_flags); + if (buf!=INVALID_PTR) { + tempie=CAlloc(sizeof(CAOTImportExport)); + tempie->type=IET_MAIN; + tempie->ip=buf; + QueIns(tempie,res->last_ie); + } + if (cmp_flags&CMPF_ASM_BLK) + break; + } + } else + PrsStmt(cc,,,cmp_flags); + AOTGlblsResolve(cc,res); + } catch { + if (Fs->except_ch=='Compiler' && !(cmp_flags&CMPF_ASM_BLK)) { + LexPutPos(cc); + Fs->catch_except=TRUE; + } + okay=FALSE; + } + if (!okay) { + if (cc->error_cnt<1) + cc->error_cnt=1; + cc->aot=res->parent_aot; + Free(res); + LinkedLstDel(aotc->bin); + res=NULL; + } else { + if (map_name) + MapFileWrite(cc->htc.glbl_hash_table,map_name,mapfile_drv_let); + HashTableDel(cc->htc.local_hash_table); + HashTableDel(cc->htc.glbl_hash_table); + + if (!aotc->num_bin_U8s) + res->buf=NULL; + else { + if (cc->flags&CCF_AOT_COMPILE) + res->buf=MAlloc(aotc->num_bin_U8s); + else { + if (aotc->module_org==INVALID_PTR) + res->buf=MAlloc(aotc->num_bin_U8s,Fs->code_heap); + else + res->buf=aotc->module_org; + } + res->aot_U8s=aotc->num_bin_U8s; + tempbin=aotc->bin; + j=0; + l=aotc->num_bin_U8s; + while (tempbin) { + i=l; + if (i>AOT_BIN_BLK_SIZE) + i=AOT_BIN_BLK_SIZE; + MemCpy(res->buf+j,tempbin->body,i); + j+=i; + l-=i; + tempbin=tempbin->next; + } + } + LinkedLstDel(aotc->bin); + res->abss=aotc->abss; + res->heap_glbls=aotc->heap_glbls; + res->max_align_bits=aotc->max_align_bits; + res->module_org=aotc->module_org; + } + cc->aot=parent; + MemCpy(&cc->htc,htc,sizeof(CLexHashTableContext)); + Free(htc); + Free(aotc); + cc->aotc=old_aot; + cc->aot_depth--; + return res; +} + +CAOT *CmpBuf(U8 *buf,U8 *map_name=NULL, + I64 *error_cnt=NULL, I64 *warning_cnt=NULL,U8 mapfile_drv_let=0) +{ + CCmpCtrl *cc; + CAOT *res=NULL; + cc=CmpCtrlNew(buf,CCF_DONT_FREE_BUF); + cc->flags|=CCF_AOT_COMPILE; + QueIns(cc,Fs->last_cc); + res=CmpJoin(cc,CMPF_LEX_FIRST,map_name,mapfile_drv_let); + if (error_cnt) *error_cnt=cc->error_cnt; + if (warning_cnt) *warning_cnt=cc->warning_cnt; + QueRem(cc); + if (res) + CmpCtrlDel(cc); + return res; +} + +U0 CmpFixUpJITAsm(CCmpCtrl *cc,CAOT *tempaot) +{ + I64 i,ip2=tempaot->buf+tempaot->ip,*str=NULL; + U8 *ptr; + CCodeMisc *g_lb; + CAOTAbsAddr *tempa,*tempa1; + CAOTImportExport *tempie,*tempie1; + CHashExport *tempex; + + tempa=tempaot->abss; + while (tempa) { + tempa1=tempa->next; + ptr=ip2+tempa->ip; + switch [tempa->type] { + case AAT_ADD_U8: *ptr(U8 *) +=ip2; break; + case AAT_SUB_U8: *ptr(U8 *) -=ip2; break; + case AAT_ADD_U16: *ptr(U16 *)+=ip2; break; + case AAT_SUB_U16: *ptr(U16 *)-=ip2; break; + case AAT_ADD_U32: *ptr(U32 *)+=ip2; break; + case AAT_SUB_U32: *ptr(U32 *)-=ip2; break; + case AAT_ADD_U64: *ptr(I64 *)+=ip2; break; + case AAT_SUB_U64: *ptr(I64 *)-=ip2; break; + } + Free(tempa); + tempa=tempa1; + } + tempie=tempaot->next_ie; + while (tempie!=&tempaot->next_ie) { + tempie1=tempie->next; + if (tempie->str) { + Free(str); + str=tempie->str; + } + switch (tempie->type) { + case IET_REL32_EXPORT: + case IET_IMM32_EXPORT: + case IET_REL64_EXPORT: + case IET_IMM64_EXPORT: + tempex=CAlloc(sizeof(CHashExport)); + tempex->str=str; + str=NULL; + tempex->type=HTT_EXPORT_SYS_SYM|HTF_IMM; + if (tempie->type==IET_IMM32_EXPORT||tempie->type==IET_IMM64_EXPORT) + tempex->val=tempie->ip; + else + tempex->val=tempie->ip+ip2; + tempex->src_link=tempie->src_link; + tempie->src_link=NULL; + HashAdd(tempex,Fs->hash_table); + SysSymImportsResolve(tempex->str); + break; + case IET_REL_I0...IET_IMM_I64: + if (tempie->str) { + if (tempie->flags&IEF_GOTO_LABEL) { + if(!(g_lb=COCGoToLabelFind(cc,str))) + "Unresolved Reference:%s\n",str; + else { + g_lb->use_cnt++; + g_lb=OptLabelFwd(g_lb); + i=g_lb->addr+tempaot->buf; + } + tempex=NULL; + } else { + if (!(tempex=HashFind(str,Fs->hash_table, + HTG_ALL-HTT_IMPORT_SYS_SYM))) + "Unresolved Reference:%s\n",str; + else { + if (tempex->type & HTT_FUN) + i=tempex(CHashFun *)->exe_addr; + else if (tempex->type & HTT_GLBL_VAR) + i=tempex(CHashGlblVar *)->data_addr; + else + i=tempex->val; + } + g_lb=NULL; + } + } + if (tempex || g_lb) { + ptr=tempie->ip+ip2; + switch [tempie->type] { + case IET_REL_I0: + case IET_IMM_U0: + break; + case IET_REL_I8: + if (!(MIN_I8<=i-ptr-1<=MAX_I8)) + LexExcept(cc,"Branch out of range at "); + *ptr(U8 *) =i-ptr-1; + break; + case IET_IMM_U8: + *ptr(U8 *) =i; + break; + case IET_REL_I16: + if (!(MIN_I16<=i-ptr-2<=MAX_I16)) + LexExcept(cc,"Branch out of range at "); + *ptr(U16 *)=i-ptr-2; + break; + case IET_IMM_U16: + *ptr(U16 *)=i; + break; + case IET_REL_I32: + if (!(MIN_I32<=i-ptr-4<=MAX_I32)) + LexExcept(cc,"Branch out of range at "); + *ptr(U32 *)=i-ptr-4; + break; + case IET_IMM_U32: + *ptr(U32 *)=i; + break; + case IET_REL_I64: + *ptr(I64 *)=i-ptr-8; + break; + case IET_IMM_I64: + *ptr(I64 *)=i; + break; + } + } + break; + } + Free(tempie->src_link); + Free(tempie); + tempie=tempie1; + } + Free(str); + if (!cc->aot_depth && Bt(&cc->opts,OPTf_TRACE)) + Un(ip2,tempaot->aot_U8s,64); + QueRem(tempaot); + Free(tempaot); +} + +U0 CmpFixUpAOTAsm(CCmpCtrl *cc,CAOT *tempaot) +{ + CAOTCtrl *aotc=cc->aotc; + I64 i,ip2=tempaot->ip+cc->aotc->ip; + U8 *ptr; + CCodeMisc *g_lb=NULL; + CAOTAbsAddr *tempa,*tempa1; + CAOTImportExport *tempie,*tempie1; + + tempa=tempaot->abss; + while (tempa) { + tempa1=tempa->next; + tempa->next=aotc->abss; + ptr=tempaot->buf+tempaot->ip+tempa->ip; + switch [tempa->type] { + case AAT_ADD_U8: *ptr(U8 *)+=ip2; break; + case AAT_SUB_U8: *ptr(U8 *)-=ip2; break; + case AAT_ADD_U16: *ptr(U16 *)+=ip2; break; + case AAT_SUB_U16: *ptr(U16 *)-=ip2; break; + case AAT_ADD_U32: *ptr(U32 *)+=ip2; break; + case AAT_SUB_U32: *ptr(U32 *)-=ip2; break; + case AAT_ADD_U64: *ptr(I64 *)+=ip2; break; + case AAT_SUB_U64: *ptr(I64 *)-=ip2; break; + } + aotc->abss=tempa; + tempa->ip+=ip2; + tempa=tempa1; + } + + tempie=tempaot->next_ie; + while (tempie!=&tempaot->next_ie) { + tempie1=tempie->next; + QueRem(tempie); + if (IET_REL_I0<=tempie->type<=IET_IMM_I64) { + if (tempie->str) { + if (tempie->flags&IEF_GOTO_LABEL) { + if(!(g_lb=COCGoToLabelFind(cc,tempie->str))) + "Unresolved Reference:%s\n",tempie->str; + else { + g_lb->use_cnt++; + g_lb=OptLabelFwd(g_lb); + } + } else + g_lb=NULL; + } + } else + g_lb=NULL; + + ptr=tempaot->buf+tempaot->ip+tempie->ip; + if (g_lb) { + i=g_lb->addr+tempaot->buf; + switch [tempie->type] { + case IET_REL_I0: + case IET_IMM_U0: + break; + case IET_REL_I8: + if (!(MIN_I8<=i-ptr-1<=MAX_I8)) + LexExcept(cc,"Branch out of range at "); + *ptr(U8 *) =i-ptr-1; + break; + case IET_IMM_U8: + *ptr(U8 *) =i; + break; + case IET_REL_I16: + if (!(MIN_I16<=i-ptr-2<=MAX_I16)) + LexExcept(cc,"Branch out of range at "); + *ptr(U16 *)=i-ptr-2; + break; + case IET_IMM_U16: + *ptr(U16 *)=i; + break; + case IET_REL_I32: + if (!(MIN_I32<=i-ptr-4<=MAX_I32)) + LexExcept(cc,"Branch out of range at "); + *ptr(U32 *)=i-ptr-4; + break; + case IET_IMM_U32: + *ptr(U32 *)=i; + break; + case IET_REL_I64: + *ptr(I64 *)=i-ptr-8; + break; + case IET_IMM_I64: + *ptr(I64 *)=i; + break; + } + Free(tempie->src_link); + Free(tempie); + } else { + switch (tempie->type) { + start: + case IET_REL32_EXPORT: + case IET_IMM32_EXPORT: + case IET_REL64_EXPORT: + case IET_IMM64_EXPORT: + case IET_IMM_U0: + case IET_IMM_U8: + case IET_IMM_U16: + case IET_IMM_U32: + case IET_IMM_I64: + case IET_REL_I0: + break; + case IET_REL_I8: *ptr(U8 *) -=ip2; break; + case IET_REL_I16: *ptr(U16 *)-=ip2; break; + case IET_REL_I32: *ptr(U32 *)-=ip2; break; + case IET_REL_I64: *ptr(I64 *)-=ip2; break; + end: + tempie->ip+=ip2; + break; + } + tempie->aot=NULL; + QueIns(tempie,tempaot->parent_aot->last_ie); + } + tempie=tempie1; + } +} + +I64 Cmp(U8 *filename,U8 *map_name=NULL,U8 *out_name=NULL,U8 mapfile_drv_let=0) +{//AOT Compile HC or PRJ file a and output BIN file. Returns err_cnt. + U8 *ptr,*fbuf=NULL,*fbuf2=NULL,*fbuf3=NULL, + *patch_table=MAlloc(0x20000); + CAOT *tempaot; + I64 i,cnt,size=0,error_cnt=0,warning_cnt=0,aot_U8s=0; + CBinFile *bfh; + CAOTImportExport *tempie,*tempie1; + CAOTAbsAddr *tempa,*tempa1; + CAOTHeapGlblRef *temphgr,*temphgr1; + CAOTHeapGlbl *temphg,*temphg1; + + fbuf=DftExt(filename,"PRJ.Z"); + fbuf2=MStrPrint("#include \"%s\"",fbuf); + if (map_name) + fbuf3=DftExt(map_name,"MAP.Z"); + + if (tempaot=CmpBuf(fbuf2,fbuf3,&error_cnt,&warning_cnt,mapfile_drv_let)) { + aot_U8s=tempaot->aot_U8s; + ptr=patch_table; +//See $LK,"Load",A="MN:Load"$() + cnt=0; + tempa=tempaot->abss; + while (tempa) { + if (!(tempa->type&IEF_IMM_NOT_REL)) + cnt++; + tempa=tempa->next; + } + if (cnt) { + *ptr++=IET_ABS_ADDR; + *ptr(U32 *)++=cnt; + *ptr++=0; + tempa=tempaot->abss; + while (tempa) { + tempa1=tempa->next; + if (!(tempa->type&IEF_IMM_NOT_REL)) + *ptr(U32 *)++ =tempa->ip; + Free(tempa); + tempa=tempa1; + } + } + temphg=tempaot->heap_glbls; + while (temphg) { + temphg1=temphg->next; + cnt=0; + temphgr=temphg->references; + while (temphgr) { + cnt++; + temphgr=temphgr->next; + } + if (cnt) { + *ptr++=IET_DATA_HEAP; + *ptr(U32 *)++=cnt; + if (temphg->str) { + i=StrLen(temphg->str); + MemCpy(ptr,temphg->str,i+1); + Free(temphg->str); + ptr+=i+1; + } else + *ptr++=0; + *ptr(I64 *)++=temphg->size; + temphgr=temphg->references; + while (temphgr) { + temphgr1=temphgr->next; + *ptr(U32 *)++=temphgr->ip; + Free(temphgr); + temphgr=temphgr1; + } + } + Free(temphg); + temphg=temphg1; + } + + //Do exports first + tempie=tempaot->next_ie; + while (tempie!=&tempaot->next_ie) { + tempie1=tempie->next; + if (!tempie->type || IET_REL32_EXPORT<=tempie->type<=IET_IMM64_EXPORT) { + QueRem(tempie); + *ptr++=tempie->type; + *ptr(U32 *)++=tempie->ip; + if (tempie->str) { + i=StrLen(tempie->str); + MemCpy(ptr,tempie->str,i+1); + Free(tempie->str); + ptr+=i+1; + } else + *ptr++=0; + Free(tempie->src_link); + Free(tempie); + } + tempie=tempie1; + } + + //Do imports second + tempie=tempaot->next_ie; + while (tempie!=&tempaot->next_ie) { + tempie1=tempie->next; + QueRem(tempie); + *ptr++=tempie->type; + if (tempie->aot) + tempie->ip+=tempie->aot->ip2; + *ptr(U32 *)++=tempie->ip; + if (tempie->str) { + i=StrLen(tempie->str); + MemCpy(ptr,tempie->str,i+1); + Free(tempie->str); + ptr+=i+1; + } else + *ptr++=0; + Free(tempie->src_link); + Free(tempie); + tempie=tempie1; + } + + *ptr++=IET_END; + MemSet(ptr,0,16); + i=ptr-patch_table; +//Needs 16 ALIGN + size=(sizeof(CBinFile)+aot_U8s+i+15)&-16; + bfh=MAlloc(size); + bfh->jmp=0xEB+256*(sizeof(CBinFile)-2); +#assert sizeof(CBinFile)-2<=MAX_I8 + bfh->reserved=0; + bfh->bin_signature=BIN_SIGNATURE_VAL; + bfh->module_org=tempaot->module_org; + bfh->module_align_bits=tempaot->max_align_bits; + bfh->patch_table_offset=sizeof(CBinFile)+aot_U8s; + bfh->file_size=size; + MemCpy(bfh(U8 *)+sizeof(CBinFile),tempaot->buf,aot_U8s); + MemCpy(bfh(U8 *)+sizeof(CBinFile)+aot_U8s,patch_table, + size-aot_U8s-sizeof(CBinFile)); + Free(fbuf2); + if (out_name) + fbuf2=DftExt(out_name,"BIN.Z"); + else + fbuf2=ChgExt(fbuf,"BIN.Z"); + FileWrite(fbuf2,bfh,size); + Free(bfh); + Free(tempaot->buf); + QueDel(tempaot); + Free(tempaot); + } + Free(patch_table); + Free(fbuf); + Free(fbuf2); + Free(fbuf3); + Print("Errs:%d Warns:%d Code:%X Size:%X\n", + error_cnt,warning_cnt,aot_U8s,size); + return error_cnt; +} + +I64 ExePutS(U8 *buf,U8 *filename=NULL, + I64 ccf_flags=0,CLexHashTableContext *htc=NULL) +{//JIT Compile and execute text from a puts(""). + I64 res; + Bool okay=TRUE; + CCmpCtrl *cc; + if (!filename) + filename=blkdev.temp_filename; + cc=CmpCtrlNew(buf,ccf_flags|CCF_DONT_FREE_BUF,filename); + if (Fs->last_cc!=&Fs->next_cc) { + cc->opts=Fs->last_cc->opts; + if (htc) { + cc->flags=cc->flags &~CCF_ASM_EXPRESSIONS | + htc->old_flags&CCF_ASM_EXPRESSIONS; + MemCpy(&cc->htc,htc,sizeof(CLexHashTableContext)); + } + } + QueIns(cc,Fs->last_cc); + try { + Lex(cc); + res=ExeCmdLine(cc); + } catch { + if (Fs->except_ch=='Compiler' || Fs->except_ch=='Break') { + Fs->catch_except=TRUE; + okay=FALSE; + res=0; + } + } + QueRem(cc); + if (okay) + CmpCtrlDel(cc); //TODO: can crash + return res; +} + +I64 ExePrint(U8 *fmt,...) +{//JIT Compile and execute text from a printf(). + I64 res; + U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); + res=ExePutS(buf); + Free(buf); + return res; +} + +I64 ExeFile(U8 *name,I64 ccf_flags=0) +{//JIT Compile and execute a file. + I64 res; + U8 *name2=DftExt(name,"HC.Z"), + *st=MStrPrint("#include \"%s\";",name2); + res=ExePutS(st,name,ccf_flags); + Free(st); + Free(name2); + return res; +} + +I64 RunFile(U8 *name,I64 ccf_flags=0,...) +{//$LK,"ExeFile",A="MN:ExeFile"$() with args using $LK,"LastFun",A="MN:LastFun"$(). + ExeFile(name,ccf_flags); + return LastFun(argc,argv); +} + +I64 ExePutS2(U8 *buf,U8 *filename=NULL,I64 ccf_flags=0) +{//throws exceptions + I64 res; + CCmpCtrl *cc; + if (!filename) + filename=blkdev.temp_filename; + cc=CmpCtrlNew(buf,ccf_flags|CCF_DONT_FREE_BUF,filename); + if (Fs->last_cc!=&Fs->next_cc) + cc->opts=Fs->last_cc->opts; + QueIns(cc,Fs->last_cc); + Lex(cc); + res=ExeCmdLine(cc); + QueRem(cc); + CmpCtrlDel(cc); + return res; +} + +I64 ExePrint2(U8 *fmt,...) +{//throws exceptions + I64 res; + U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); + res=ExePutS2(buf); + Free(buf); + return res; +} + +I64 ExeFile2(U8 *name,I64 ccf_flags=0) +{//throws exceptions + I64 res; + U8 *name2=DftExt(name,"HC.Z"),*st=MStrPrint("#include \"%s\";",name2); + res=ExePutS2(st,name,ccf_flags); + Free(st); + Free(name2); + return res; +} + +I64 RunFile2(U8 *name,I64 ccf_flags=0,...) +{//$LK,"ExeFile2",A="MN:ExeFile2"$() with args using $LK,"LastFun",A="MN:LastFun"$(). throws exceptions. + ExeFile2(name,ccf_flags); + return LastFun(argc,argv); +} + +I64 StreamExePrint(U8 *fmt,...) +{//Causes value from stream to be used in an #exe{} block. + U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); + I64 res=0; + CLexHashTableContext *htc; + CCmpCtrl *cc=Fs->last_cc; + if (cc==&Fs->next_cc) + PrintErr("Not Compiling\n"); + else { + if (!(cc->flags&CCF_EXE_BLK)) + LexExcept(cc,"StreamExePrint only allowed in AOT compiled #exe{} mode."); + if (htc=cc->htc.next) + res=ExePutS(buf,,,htc); + } + Free(buf); + return res; +} + +U0 CInit() +{ + CmpLoadDefines; + CmpFillTables; + QueInit(&cmp.ic_nop); + cmp.ic_nop.ic_class=cmp.internal_types[RT_I64]; + cmp.ic_nop.ic_code=IC_NOP1; + AsmHashLoad; + UAsmHashLoad; +} + +CInit; diff --git a/Compiler/CMisc.CPP b/Compiler/CMisc.CPP deleted file mode 100644 index ec4acd3..0000000 --- a/Compiler/CMisc.CPP +++ /dev/null @@ -1,161 +0,0 @@ -Bool Option(I64 num,Bool val) -{//Set compiler $LK,"Option",A="FI:::/Doc/Options.TXT"$ to val. - return BEqu(&Fs->last_cc->opts,num,val); -} - -Bool GetOption(I64 num) -{//Get state of compiler $LK,"option",A="MN:OPTf_ECHO"$. - return Bt(&Fs->last_cc->opts,num); -} - -asm { -_LAST_FUN:: //See $LK,"_CALL_IND",A="MN:_CALL_IND"$ - PUSH RBP - MOV RBP,RSP - PUSH RSI - PUSH RDI - - XOR RAX,RAX - MOV RAX,FS:CTask.last_fun[RAX] - TEST RAX,RAX - JZ @@10 - MOV RDX,U64 CHashFun.exe_addr[RAX] - - MOV RCX,U64 SF_ARG1[RBP] //argc - MOV RSI,U64 SF_ARG2[RBP] //argv - SHL RCX,3 - SUB RSP,RCX - MOV RDI,RSP - REP_MOVSB - TEST RDX,RDX - JZ @@05 - - CALL RDX - POP RDI - POP RSI - POP RBP - RET1 16 - -@@05: MOV RCX,U64 SF_ARG1[RBP] //argc - SHL RCX,3 - ADD RSP,RCX - XOR RAX,RAX -@@10: POP RDI - POP RSI - POP RBP - RET1 16 -} -_extern _LAST_FUN I64 LastFun(I64 argc,I64 *argv); //Execute last fun with args. - -I64 PassTrace(I64 i=0b10001111101) -{//Ctrls which optimizer passes are displayed. - I64 old=Fs->last_cc->pass_trace; - if (i) Fs->last_cc->saved_pass_trace=i; - Fs->last_cc->pass_trace=i; - return old; -} - -Bool Trace(Bool val=ON) -{//Displays assembly code output from compiler. - return Option(OPTf_TRACE,val); -} - -Bool Echo(Bool val) -{//Displays text as it is being compiled. - return Option(OPTf_ECHO,val); -} - -U0 StreamPrint(U8 *fmt,...) -{//Injects text into the compile stream. Used in #exe{} blocks. - U8 *buf=StrPrintJoin(NULL,fmt,argc,argv),*st; - CCmpCtrl *cc=Fs->last_cc; - CStreamBlk *tempe=cc->last_stream_blk; - if (tempe!=&cc->next_stream_blk) { - st=MStrPrint("%s%s",tempe->body,buf); - Free(tempe->body); - tempe->body=st; - } else - PrintErr("No exe{} blk\n"); - Free(buf); -} - -U0 StreamDir() -{ - U8 *dirname; - if (dirname=DirFile(Fs->last_cc->lex_include_stk->full_name)) { - StreamPrint("\"%s\"",dirname); - Free(dirname); - } -} - -CD2I32 *LexD2I32(CCmpCtrl *cc,CD2I32 *p) -{//Not HolyC. Sprite-like lex 2D point. - if (cc->token!='(') - LexExcept(cc,"Expecting '(' at "); - Lex(cc); //Skip ( - p->x=LexExpressionI64(cc); - if (cc->token!=',') - LexExcept(cc,"Expecting ',' at "); - Lex(cc); //Skip , - p->y=LexExpressionI64(cc); - if (cc->token!=')') - LexExcept(cc,"Expecting ')' at "); - Lex(cc); //Skip ) - return p; -} - -CD3I32 *LexD3I32(CCmpCtrl *cc,CD3I32 *p) -{//Not HolyC. Sprite-like lex 3D point. - if (cc->token!='(') - LexExcept(cc,"Expecting '(' at "); - Lex(cc); //Skip ( - p->x=LexExpressionI64(cc); - if (cc->token!=',') - LexExcept(cc,"Expecting ',' at "); - Lex(cc); //Skip , - p->y=LexExpressionI64(cc); - if (cc->token!=',') - LexExcept(cc,"Expecting ',' at "); - Lex(cc); //Skip , - p->z=LexExpressionI64(cc); - if (cc->token!=')') - LexExcept(cc,"Expecting ')' at "); - Lex(cc); //Skip ) - return p; -} - -U8 *CmdLinePmt() -{ - I64 i; - U8 *res,*st; - if (Fs->new_answer) { - if (Fs->answer_type==RT_F64) - "%8.6fs ansf=%15.7g\n",Fs->answer_time,Fs->answer; - else - "%8.6fs ans=0x%08X=%d\n",Fs->answer_time,Fs->answer,Fs->answer; - Fs->new_answer=FALSE; - } - if (st=CurDir) { - "%s",st; - Free(st); - } - '>'; - if (IsDbg&&IsRaw) - RawDr; - st=GetStr(,,GSF_SHIFT_ESC_EXIT); - - i=StrLen(st); - res=MAlloc(i+1+2); - MemCpy(res,st,i+1); - i--; - while (i>=0 && Bt(chars_bmp_white_space,res[i])) - i--; - i++; - if (i>0 && res[i-1]==';') - res[i++]=';'; //The Lex goes one beyond - res[i++]='\n';//#define goes to '\n' - res[i]=0; - - Free(st); - return res; -} diff --git a/Compiler/CMisc.HC b/Compiler/CMisc.HC new file mode 100644 index 0000000..0e2b9a2 --- /dev/null +++ b/Compiler/CMisc.HC @@ -0,0 +1,161 @@ +Bool Option(I64 num,Bool val) +{//Set compiler $LK,"Option",A="FI:::/Doc/Options.DD"$ to val. + return BEqu(&Fs->last_cc->opts,num,val); +} + +Bool GetOption(I64 num) +{//Get state of compiler $LK,"option",A="MN:OPTf_ECHO"$. + return Bt(&Fs->last_cc->opts,num); +} + +asm { +_LAST_FUN:: //See $LK,"_CALL_IND",A="MN:_CALL_IND"$ + PUSH RBP + MOV RBP,RSP + PUSH RSI + PUSH RDI + + XOR RAX,RAX + MOV RAX,FS:CTask.last_fun[RAX] + TEST RAX,RAX + JZ @@10 + MOV RDX,U64 CHashFun.exe_addr[RAX] + + MOV RCX,U64 SF_ARG1[RBP] //argc + MOV RSI,U64 SF_ARG2[RBP] //argv + SHL RCX,3 + SUB RSP,RCX + MOV RDI,RSP + REP_MOVSB + TEST RDX,RDX + JZ @@05 + + CALL RDX + POP RDI + POP RSI + POP RBP + RET1 16 + +@@05: MOV RCX,U64 SF_ARG1[RBP] //argc + SHL RCX,3 + ADD RSP,RCX + XOR RAX,RAX +@@10: POP RDI + POP RSI + POP RBP + RET1 16 +} +_extern _LAST_FUN I64 LastFun(I64 argc,I64 *argv); //Execute last fun with args. + +I64 PassTrace(I64 i=0b10001111101) +{//Ctrls which optimizer passes are displayed. + I64 old=Fs->last_cc->pass_trace; + if (i) Fs->last_cc->saved_pass_trace=i; + Fs->last_cc->pass_trace=i; + return old; +} + +Bool Trace(Bool val=ON) +{//Displays assembly code output from compiler. + return Option(OPTf_TRACE,val); +} + +Bool Echo(Bool val) +{//Displays text as it is being compiled. + return Option(OPTf_ECHO,val); +} + +U0 StreamPrint(U8 *fmt,...) +{//Injects text into the compile stream. Used in #exe{} blocks. + U8 *buf=StrPrintJoin(NULL,fmt,argc,argv),*st; + CCmpCtrl *cc=Fs->last_cc; + CStreamBlk *tempe=cc->last_stream_blk; + if (tempe!=&cc->next_stream_blk) { + st=MStrPrint("%s%s",tempe->body,buf); + Free(tempe->body); + tempe->body=st; + } else + PrintErr("No exe{} blk\n"); + Free(buf); +} + +U0 StreamDir() +{ + U8 *dirname; + if (dirname=DirFile(Fs->last_cc->lex_include_stk->full_name)) { + StreamPrint("\"%s\"",dirname); + Free(dirname); + } +} + +CD2I32 *LexD2I32(CCmpCtrl *cc,CD2I32 *p) +{//Not HolyC. Sprite-like lex 2D point. + if (cc->token!='(') + LexExcept(cc,"Expecting '(' at "); + Lex(cc); //Skip ( + p->x=LexExpressionI64(cc); + if (cc->token!=',') + LexExcept(cc,"Expecting ',' at "); + Lex(cc); //Skip , + p->y=LexExpressionI64(cc); + if (cc->token!=')') + LexExcept(cc,"Expecting ')' at "); + Lex(cc); //Skip ) + return p; +} + +CD3I32 *LexD3I32(CCmpCtrl *cc,CD3I32 *p) +{//Not HolyC. Sprite-like lex 3D point. + if (cc->token!='(') + LexExcept(cc,"Expecting '(' at "); + Lex(cc); //Skip ( + p->x=LexExpressionI64(cc); + if (cc->token!=',') + LexExcept(cc,"Expecting ',' at "); + Lex(cc); //Skip , + p->y=LexExpressionI64(cc); + if (cc->token!=',') + LexExcept(cc,"Expecting ',' at "); + Lex(cc); //Skip , + p->z=LexExpressionI64(cc); + if (cc->token!=')') + LexExcept(cc,"Expecting ')' at "); + Lex(cc); //Skip ) + return p; +} + +U8 *CmdLinePmt() +{ + I64 i; + U8 *res,*st; + if (Fs->new_answer) { + if (Fs->answer_type==RT_F64) + "%8.6fs ansf=%15.7g\n",Fs->answer_time,Fs->answer; + else + "%8.6fs ans=0x%08X=%d\n",Fs->answer_time,Fs->answer,Fs->answer; + Fs->new_answer=FALSE; + } + if (st=CurDir) { + "%s",st; + Free(st); + } + '>'; + if (IsDbg&&IsRaw) + RawDr; + st=GetStr(,,GSF_SHIFT_ESC_EXIT); + + i=StrLen(st); + res=MAlloc(i+1+2); + MemCpy(res,st,i+1); + i--; + while (i>=0 && Bt(chars_bmp_white_space,res[i])) + i--; + i++; + if (i>0 && res[i-1]==';') + res[i++]=';'; //The Lex goes one beyond + res[i++]='\n';//#define goes to '\n' + res[i]=0; + + Free(st); + return res; +} diff --git a/Compiler/Compiler.BIN b/Compiler/Compiler.BIN index a1dc71a..0c89d2e 100644 Binary files a/Compiler/Compiler.BIN and b/Compiler/Compiler.BIN differ diff --git a/Compiler/Compiler.MAP b/Compiler/Compiler.MAP index 4b6f28d..c335306 100644 --- a/Compiler/Compiler.MAP +++ b/Compiler/Compiler.MAP @@ -1,441 +1,430 @@ -$LK,"LexPutPos",A="FL:::/Compiler/CExcept.CPP.Z,50",BI=1$ -$LK,"ICAssignPostIncDec",A="FL:::/Compiler/BackB.CPP.Z,429",BI=2$ -$LK,"CmpSetFloatOpPushPop",A="FL:::/Compiler/BackFA.CPP.Z,62",BI=3$ -$LK,"ICFCvt2",A="FL:::/Compiler/BackFA.CPP.Z,169",BI=4$ -$LK,"CmpMinTypePointed",A="FL:::/Compiler/OptLib.CPP.Z,528",BI=5$ -$LK,"CmpRawTypePointed",A="FL:::/Compiler/OptLib.CPP.Z,517",BI=6$ -$LK,"OptFixupBinaryOp1",A="FL:::/Compiler/OptLib.CPP.Z,96",BI=7$ -$LK,"OptFixupBinaryOp2",A="FL:::/Compiler/OptLib.CPP.Z,182",BI=8$ -$LK,"COCInit",A="FL:::/Compiler/PrsLib.CPP.Z,99",BI=9$ -$LK,"IsLexExpression2Bin",A="FL:::/Compiler/PrsExp.CPP.Z,1128",BI=10$ -$LK,"CSubSwitch",A="FL:::/Compiler/PrsStmt.CPP.Z,566"$ -$LK,"LexFilePop",A="FL:::/Compiler/Lex.CPP.Z,11",BI=11$ -$LK,"ExePutS",A="FL:::/Compiler/CMain.CPP.Z,571",BI=12$ -$LK,"PrsStaticInit",A="FL:::/Compiler/PrsVar.CPP.Z,215",BI=13$ -$LK,"LexPutLine",A="FL:::/Compiler/CExcept.CPP.Z,22",BI=14$ -$LK,"PrsKeyWord",A="FL:::/Compiler/PrsLib.CPP.Z,31",BI=15$ -$LK,"AsmLineLst",A="FL:::/Compiler/AsmLib.CPP.Z,147",BI=16$ -$LK,"ICOpSizeRex",A="FL:::/Compiler/BackLib.CPP.Z,28",BI=17$ -$LK,"CVI2",A="FL:::/Compiler/PrsVar.CPP.Z,117"$ -$LK,"ICU8",A="FL:::/Compiler/BackLib.CPP.Z,17",BI=18$ -$LK,"AsmStoreNum",A="FL:::/Compiler/Asm.CPP.Z,268",BI=19$ -$LK,"OptPass012",A="FL:::/Compiler/OptPass012.CPP.Z,23",BI=20$ -$LK,"MemberLstSize",A="FL:::/Compiler/LexLib.CPP.Z,191",BI=21$ -$LK,"ICQueIns",A="FL:::/Compiler/BackC.CPP.Z,351",BI=22$ -$LK,"ICAndBranch",A="FL:::/Compiler/BackC.CPP.Z,1",BI=23$ -$LK,"U",A="FL:::/Compiler/UAsm.CPP.Z,645",BI=24$ -$LK,"ICQueRem",A="FL:::/Compiler/BackC.CPP.Z,399",BI=25$ -$LK,"CN_R",A="FL:::/Compiler/BackFA.CPP.Z,4"$ -$LK,"LastFun",A="FL:::/Compiler/CMisc.CPP.Z,48"$ -$LK,"OptLead1",A="FL:::/Compiler/OptLib.CPP.Z,73",BI=26$ -$LK,"CmpNoteFloatOp",A="FL:::/Compiler/BackFA.CPP.Z,6",BI=27$ -$LK,"AOTGlblsResolve",A="FL:::/Compiler/AsmResolve.CPP.Z,76",BI=28$ -$LK,"ExePutS2",A="FL:::/Compiler/CMain.CPP.Z,631",BI=29$ -$LK,"HashEntrySize",A="FL:::/Compiler/CHash.CPP.Z,1",BI=30$ -$LK,"COCPush",A="FL:::/Compiler/PrsLib.CPP.Z,107",BI=31$ -$LK,"SLASH_OP_DEC",A="FL:::/Compiler/BackLib.CPP.Z,245"$ -$LK,"MODR_SIB_D32_INDIRECT_REG",A="FL:::/Compiler/BackLib.CPP.Z,132"$ -$LK,"ICPushRegs",A="FL:::/Compiler/BackLib.CPP.Z,331",BI=32$ -$LK,"PE_POP_HIGHER",A="FL:::/Compiler/PrsExp.CPP.Z,10"$ -$LK,"SLASH_OP_FLD",A="FL:::/Compiler/BackLib.CPP.Z,260"$ -$LK,"ICU32",A="FL:::/Compiler/BackLib.CPP.Z,47",BI=33$ -$LK,"ICU24",A="FL:::/Compiler/BackLib.CPP.Z,41",BI=34$ -$LK,"ICU16",A="FL:::/Compiler/BackLib.CPP.Z,35",BI=35$ -$LK,"SLASH_OP_DIV",A="FL:::/Compiler/BackLib.CPP.Z,250"$ -$LK,"CmpFillTables",A="FL:::/Compiler/CInit.CPP.Z,239",BI=36$ -$LK,"AOTStoreCodeU32",A="FL:::/Compiler/AsmLib.CPP.Z,30",BI=37$ -$LK,"ICU64",A="FL:::/Compiler/BackLib.CPP.Z,53",BI=38$ -$LK,"SLASH_OP_INC",A="FL:::/Compiler/BackLib.CPP.Z,244"$ -$LK,"AOTStoreCodeU64",A="FL:::/Compiler/AsmLib.CPP.Z,68",BI=39$ -$LK,"LexPopNoRestore",A="FL:::/Compiler/LexLib.CPP.Z,38",BI=40$ -$LK,"ExePrint",A="FL:::/Compiler/CMain.CPP.Z,605",BI=41$ -$LK,"SLASH_OP_NEG",A="FL:::/Compiler/BackLib.CPP.Z,247"$ -$LK,"PrsVarLst",A="FL:::/Compiler/PrsVar.CPP.Z,416",BI=42$ -$LK,"PrsAsmDefine",A="FL:::/Compiler/Asm.CPP.Z,814",BI=43$ -$LK,"PrsAddOp",A="FL:::/Compiler/PrsExp.CPP.Z,15",BI=44$ -$LK,"LexWarn",A="FL:::/Compiler/CExcept.CPP.Z,65",BI=45$ -$LK,"PE_POP_ALL1",A="FL:::/Compiler/PrsExp.CPP.Z,12"$ -$LK,"PE_POP_ALL2",A="FL:::/Compiler/PrsExp.CPP.Z,13"$ -$LK,"COCAppend",A="FL:::/Compiler/PrsLib.CPP.Z,126",BI=46$ -$LK,"LexFilePush",A="FL:::/Compiler/Lex.CPP.Z,1",BI=47$ -$LK,"CN_MAIN",A="FL:::/Compiler/BackFA.CPP.Z,3"$ -$LK,"PrsUnaryModifier",A="FL:::/Compiler/PrsExp.CPP.Z,954",BI=48$ -$LK,"OptFixupUnaryOp",A="FL:::/Compiler/OptLib.CPP.Z,196",BI=49$ -$LK,"LexPush",A="FL:::/Compiler/LexLib.CPP.Z,12",BI=50$ -$LK,"SLASH_OP_MOV",A="FL:::/Compiler/BackLib.CPP.Z,251"$ -$LK,"ICPopRegs",A="FL:::/Compiler/BackLib.CPP.Z,372",BI=51$ -$LK,"SLASH_OP_MUL",A="FL:::/Compiler/BackLib.CPP.Z,248"$ -$LK,"SLASH_OP_NOT",A="FL:::/Compiler/BackLib.CPP.Z,246"$ -$LK,"NUM_INTERNAL_TYPES",A="FL:::/Compiler/CInit.CPP.Z,1"$ -$LK,"SLASH_OP_POP",A="FL:::/Compiler/BackLib.CPP.Z,253"$ -$LK,"ICFOp",A="FL:::/Compiler/BackFA.CPP.Z,339",BI=52$ -$LK,"CN_A1",A="FL:::/Compiler/BackFA.CPP.Z,2"$ -$LK,"CN_A2",A="FL:::/Compiler/BackFA.CPP.Z,1"$ -$LK,"LexExpressionF64",A="FL:::/Compiler/PrsExp.CPP.Z,1147",BI=53$ -$LK,"ICAdd",A="FL:::/Compiler/PrsLib.CPP.Z,79",BI=54$ -$LK,"CmpRawType",A="FL:::/Compiler/OptLib.CPP.Z,508",BI=55$ -$LK,"ICFOpEqu",A="FL:::/Compiler/BackFB.CPP.Z,1",BI=56$ -$LK,"LexExpressionI64",A="FL:::/Compiler/PrsExp.CPP.Z,1133",BI=57$ -$LK,"ICQueInsRev",A="FL:::/Compiler/BackC.CPP.Z,375",BI=58$ -$LK,"LexExpression",A="FL:::/Compiler/PrsExp.CPP.Z,1161",BI=59$ -$LK,"PrsExpression",A="FL:::/Compiler/PrsExp.CPP.Z,264",BI=60$ -$LK,"PrsClassNew",A="FL:::/Compiler/PrsLib.CPP.Z,40",BI=61$ -$LK,"LexInStr",A="FL:::/Compiler/Lex.CPP.Z,373",BI=62$ -$LK,"internal_types_table",A="FL:::/Compiler/CInit.CPP.Z,6"$ -$LK,"OptPass3",A="FL:::/Compiler/OptPass3.CPP.Z,1",BI=63$ -$LK,"OptPass4",A="FL:::/Compiler/OptPass4.CPP.Z,132",BI=64$ -$LK,"OptPass5",A="FL:::/Compiler/OptPass5.CPP.Z,1",BI=65$ -$LK,"OptPass6",A="FL:::/Compiler/OptPass6.CPP.Z,96",BI=66$ -$LK,"MODR_REG",A="FL:::/Compiler/BackLib.CPP.Z,126"$ -$LK,"Echo",A="FL:::/Compiler/CMisc.CPP.Z,63",BI=67$ -$LK,"PrsGlblVarLst",A="FL:::/Compiler/PrsStmt.CPP.Z,201",BI=68$ -$LK,"ICQueInit",A="FL:::/Compiler/BackC.CPP.Z,337",BI=69$ -$LK,"ICCmp",A="FL:::/Compiler/BackB.CPP.Z,102",BI=70$ -$LK,"ICAddRSP",A="FL:::/Compiler/BackLib.CPP.Z,59",BI=71$ -$LK,"ICDiv",A="FL:::/Compiler/BackA.CPP.Z,391",BI=72$ -$LK,"ICDeref",A="FL:::/Compiler/BackLib.CPP.Z,709",BI=73$ -$LK,"ICLea",A="FL:::/Compiler/BackLib.CPP.Z,677",BI=74$ -$LK,"CmpBuf",A="FL:::/Compiler/CMain.CPP.Z,157",BI=75$ -$LK,"CMP_TEMPLATES_DONT_PUSH_POP",A="FL:::/Compiler/Templates.CPP.Z,385"$ -$LK,"ICAddEct",A="FL:::/Compiler/BackA.CPP.Z,1",BI=76$ -$LK,"ICToF64",A="FL:::/Compiler/BackB.CPP.Z,283",BI=77$ -$LK,"PrsBinFile",A="FL:::/Compiler/Asm.CPP.Z,888",BI=78$ -$LK,"HashTableSize2",A="FL:::/Compiler/CHash.CPP.Z,72",BI=79$ -$LK,"HashEntrySize2",A="FL:::/Compiler/CHash.CPP.Z,33",BI=80$ -$LK,"Ui",A="FL:::/Compiler/UAsm.CPP.Z,238",BI=81$ -$LK,"ICSlashOp",A="FL:::/Compiler/BackLib.CPP.Z,265",BI=82$ -$LK,"OptBrZero",A="FL:::/Compiler/OptLib.CPP.Z,230",BI=83$ -$LK,"Un",A="FL:::/Compiler/UAsm.CPP.Z,660",BI=84$ -$LK,"PrsSizeOf",A="FL:::/Compiler/PrsExp.CPP.Z,298",BI=85$ -$LK,"ICToI64",A="FL:::/Compiler/BackB.CPP.Z,277",BI=86$ -$LK,"ICMod",A="FL:::/Compiler/BackA.CPP.Z,461",BI=87$ -$LK,"OptSetNOP1",A="FL:::/Compiler/OptLib.CPP.Z,17",BI=88$ -$LK,"OptPass789A",A="FL:::/Compiler/OptPass789A.CPP.Z,1",BI=89$ -$LK,"OptSetNOP2",A="FL:::/Compiler/OptLib.CPP.Z,25",BI=90$ -$LK,"FBO1_F64",A="FL:::/Compiler/OptLib.CPP.Z,94"$ -$LK,"ICXorEqu",A="FL:::/Compiler/BackC.CPP.Z,578",BI=91$ -$LK,"ICToUpper",A="FL:::/Compiler/BackB.CPP.Z,266",BI=92$ -$LK,"AsmLexExpression",A="FL:::/Compiler/AsmLib.CPP.Z,127",BI=93$ -$LK,"ICMov",A="FL:::/Compiler/BackLib.CPP.Z,426",BI=94$ -$LK,"ICNot",A="FL:::/Compiler/BackB.CPP.Z,10",BI=95$ -$LK,"ICMul",A="FL:::/Compiler/BackA.CPP.Z,263",BI=96$ -$LK,"ICRex",A="FL:::/Compiler/BackLib.CPP.Z,22",BI=97$ -$LK,"ICPop",A="FL:::/Compiler/BackLib.CPP.Z,344",BI=98$ -$LK,"SLASH_OP_FADD",A="FL:::/Compiler/BackLib.CPP.Z,254"$ -$LK,"MODR_RIP_REL",A="FL:::/Compiler/BackLib.CPP.Z,133"$ -$LK,"LexStmt2Bin",A="FL:::/Compiler/CMain.CPP.Z,1",BI=99$ -$LK,"ICSub",A="FL:::/Compiler/BackA.CPP.Z,205",BI=100$ -$LK,"COCFloatConstFind",A="FL:::/Compiler/PrsLib.CPP.Z,164",BI=101$ -$LK,"ICPut",A="FL:::/Compiler/CExcept.CPP.Z,184",BI=102$ -$LK,"PrsArrayDims",A="FL:::/Compiler/PrsVar.CPP.Z,247",BI=103$ -$LK,"ICSqr",A="FL:::/Compiler/BackC.CPP.Z,453",BI=104$ -$LK,"FBO1_NOT_CONST",A="FL:::/Compiler/OptLib.CPP.Z,92"$ -$LK,"CMP_TEMPLATES_DONT_POP",A="FL:::/Compiler/Templates.CPP.Z,173"$ -$LK,"PrsClass",A="FL:::/Compiler/PrsStmt.CPP.Z,1",BI=105$ -$LK,"MemberMetaData",A="FL:::/Compiler/LexLib.CPP.Z,45",BI=106$ -$LK,"ICSwitch",A="FL:::/Compiler/BackC.CPP.Z,599",BI=107$ -$LK,"OptBrNotZero",A="FL:::/Compiler/OptLib.CPP.Z,357",BI=108$ -$LK,"LexPutToken",A="FL:::/Compiler/CExcept.CPP.Z,1",BI=109$ -$LK,"SLASH_OP_FDIV",A="FL:::/Compiler/BackLib.CPP.Z,258"$ -$LK,"AsmHashLoad",A="FL:::/Compiler/AsmInit.CPP.Z,50",BI=110$ -$LK,"UAsmHashLoad",A="FL:::/Compiler/UAsm.CPP.Z,188",BI=111$ -$LK,"UnusedExternWarning",A="FL:::/Compiler/CExcept.CPP.Z,104",BI=112$ -$LK,"SLASH_OP_FILD",A="FL:::/Compiler/BackLib.CPP.Z,263"$ -$LK,"ICXorXor",A="FL:::/Compiler/BackB.CPP.Z,75",BI=113$ -$LK,"PrsTryBlk",A="FL:::/Compiler/PrsStmt.CPP.Z,842",BI=114$ -$LK,"CInit",A="FL:::/Compiler/CMain.CPP.Z,691",BI=115$ -$LK,"MemberMetaFind",A="FL:::/Compiler/LexLib.CPP.Z,56",BI=116$ -$LK,"ExePrint2",A="FL:::/Compiler/CMain.CPP.Z,648",BI=117$ -$LK,"FBO1_INT",A="FL:::/Compiler/OptLib.CPP.Z,93"$ -$LK,"PE_DO_UNARY_OP",A="FL:::/Compiler/PrsExp.CPP.Z,8"$ -$LK,"PrsVarInit",A="FL:::/Compiler/PrsVar.CPP.Z,1",BI=118$ -$LK,"ICOrEqu",A="FL:::/Compiler/BackC.CPP.Z,557",BI=119$ -$LK,"ICModr1",A="FL:::/Compiler/BackLib.CPP.Z,135",BI=120$ -$LK,"ICModr2",A="FL:::/Compiler/BackLib.CPP.Z,213",BI=121$ -$LK,"SLASH_OP_FMUL",A="FL:::/Compiler/BackLib.CPP.Z,257"$ -$LK,"ICPreIncDec",A="FL:::/Compiler/BackB.CPP.Z,304",BI=122$ -$LK,"PrsUnaryTerm",A="FL:::/Compiler/PrsExp.CPP.Z,588",BI=123$ -$LK,"MemberLstDel",A="FL:::/Compiler/LexLib.CPP.Z,157",BI=124$ -$LK,"SLASH_OP_FSUB",A="FL:::/Compiler/BackLib.CPP.Z,255"$ -$LK,"ICAndAnd",A="FL:::/Compiler/BackB.CPP.Z,30",BI=125$ -$LK,"InstEntriesCompare",A="FL:::/Compiler/UAsm.CPP.Z,1",BI=126$ -$LK,"SLASH_OP_IMUL",A="FL:::/Compiler/BackLib.CPP.Z,249"$ -$LK,"SLASH_OP_FSTP",A="FL:::/Compiler/BackLib.CPP.Z,261"$ -$LK,"COCDel",A="FL:::/Compiler/PrsLib.CPP.Z,186",BI=127$ -$LK,"PE_UNARY_TERM1",A="FL:::/Compiler/PrsExp.CPP.Z,1"$ -$LK,"ICFAdd",A="FL:::/Compiler/BackFB.CPP.Z,504",BI=128$ -$LK,"PE_UNARY_TERM2",A="FL:::/Compiler/PrsExp.CPP.Z,2"$ -$LK,"CmdLinePmt",A="FL:::/Compiler/CMisc.CPP.Z,127",BI=129$ -$LK,"AsmMakeArgMask",A="FL:::/Compiler/Asm.CPP.Z,177",BI=130$ -$LK,"COCHeaderPut",A="FL:::/Compiler/PrsLib.CPP.Z,229",BI=131$ -$LK,"PrsGlblInit",A="FL:::/Compiler/PrsVar.CPP.Z,206",BI=132$ -$LK,"ICAndEqu",A="FL:::/Compiler/BackC.CPP.Z,536",BI=133$ -$LK,"LexD2I32",A="FL:::/Compiler/CMisc.CPP.Z,91",BI=134$ -$LK,"MemberLstNew",A="FL:::/Compiler/LexLib.CPP.Z,150",BI=135$ -$LK,"LexD3I32",A="FL:::/Compiler/CMisc.CPP.Z,107",BI=136$ -$LK,"OptClassFwd",A="FL:::/Compiler/OptLib.CPP.Z,9",BI=137$ -$LK,"ICFCmp",A="FL:::/Compiler/BackFA.CPP.Z,515",BI=138$ -$LK,"PrsSwitch",A="FL:::/Compiler/PrsStmt.CPP.Z,578",BI=139$ -$LK,"ICFDiv",A="FL:::/Compiler/BackFB.CPP.Z,493",BI=140$ -$LK,"AOTStoreCodeU8At",A="FL:::/Compiler/AsmLib.CPP.Z,106",BI=141$ -$LK,"PE_PUSH_LOWER",A="FL:::/Compiler/PrsExp.CPP.Z,11"$ -$LK,"OptPass6Lag",A="FL:::/Compiler/OptPass6.CPP.Z,28",BI=142$ -$LK,"OptLag1",A="FL:::/Compiler/OptLib.CPP.Z,51",BI=143$ -$LK,"OptLag2",A="FL:::/Compiler/OptLib.CPP.Z,62",BI=144$ -$LK,"StreamPrint",A="FL:::/Compiler/CMisc.CPP.Z,68",BI=145$ -$LK,"_LAST_FUN",A="FL:::/Compiler/CMisc.CPP.Z,12"$ -$LK,"ICFCvt",A="FL:::/Compiler/BackFA.CPP.Z,123",BI=146$ -$LK,"StreamDir",A="FL:::/Compiler/CMisc.CPP.Z,82",BI=147$ -$LK,"PrsOffsetOf",A="FL:::/Compiler/PrsExp.CPP.Z,348",BI=148$ -$LK,"GetOption",A="FL:::/Compiler/CMisc.CPP.Z,6",BI=149$ -$LK,"PrsDoWhile",A="FL:::/Compiler/PrsStmt.CPP.Z,506",BI=150$ -$LK,"ICShift",A="FL:::/Compiler/BackA.CPP.Z,609",BI=151$ -$LK,"ICFMod",A="FL:::/Compiler/BackFA.CPP.Z,242",BI=152$ -$LK,"COCPop",A="FL:::/Compiler/PrsLib.CPP.Z,121",BI=153$ -$LK,"PrsExpression2",A="FL:::/Compiler/PrsExp.CPP.Z,65",BI=154$ -$LK,"SLASH_OP_PUSH",A="FL:::/Compiler/BackLib.CPP.Z,252"$ -$LK,"PE_DEREFERENCE",A="FL:::/Compiler/PrsExp.CPP.Z,5"$ -$LK,"LexPopRestore",A="FL:::/Compiler/LexLib.CPP.Z,23",BI=155$ -$LK,"ICUnaries",A="FL:::/Compiler/BackB.CPP.Z,1",BI=156$ -$LK,"ICFMul",A="FL:::/Compiler/BackFB.CPP.Z,477",BI=157$ -$LK,"ICShiftEqu",A="FL:::/Compiler/BackA.CPP.Z,639",BI=158$ -$LK,"LexExpression2Bin",A="FL:::/Compiler/PrsExp.CPP.Z,1110",BI=159$ -$LK,"ICFPow",A="FL:::/Compiler/BackFA.CPP.Z,266",BI=160$ -$LK,"MapFileWrite",A="FL:::/Compiler/CHash.CPP.Z,90",BI=161$ -$LK,"ICFSub",A="FL:::/Compiler/BackFB.CPP.Z,540",BI=162$ -$LK,"ICFModEqu",A="FL:::/Compiler/BackFA.CPP.Z,545",BI=163$ -$LK,"CmpF1PushPop",A="FL:::/Compiler/OptLib.CPP.Z,535",BI=164$ -$LK,"OptFree",A="FL:::/Compiler/OptLib.CPP.Z,33",BI=165$ -$LK,"CMP_TEMPLATES_DONT_PUSH2",A="FL:::/Compiler/Templates.CPP.Z,447"$ -$LK,"CInternalType",A="FL:::/Compiler/CInit.CPP.Z,3"$ -$LK,"LexDollar",A="FL:::/Compiler/Lex.CPP.Z,93",BI=166$ -$LK,"AsmUnresolvedAdd",A="FL:::/Compiler/AsmResolve.CPP.Z,188",BI=167$ -$LK,"AOTStoreCodeU8",A="FL:::/Compiler/AsmLib.CPP.Z,1",BI=168$ -$LK,"ICBitOps",A="FL:::/Compiler/BackB.CPP.Z,202",BI=169$ -$LK,"lex_zeros",A="FL:::/Compiler/Lex.CPP.Z,91"$ -$LK,"CSwitchCase",A="FL:::/Compiler/PrsStmt.CPP.Z,571"$ -$LK,"AsmResolve",A="FL:::/Compiler/AsmResolve.CPP.Z,1",BI=170$ -$LK,"PrsAsmInst",A="FL:::/Compiler/Asm.CPP.Z,395",BI=171$ -$LK,"COCCompile",A="FL:::/Compiler/PrsLib.CPP.Z,249",BI=172$ -$LK,"RunFile2",A="FL:::/Compiler/CMain.CPP.Z,667",BI=173$ -$LK,"Cmp",A="FL:::/Compiler/CMain.CPP.Z,419",BI=174$ -$LK,"PrsPush2",A="FL:::/Compiler/PrsLib.CPP.Z,11",BI=175$ -$LK,"ICArgPut",A="FL:::/Compiler/CExcept.CPP.Z,141",BI=176$ -$LK,"UndefinedExtern",A="FL:::/Compiler/CExcept.CPP.Z,98",BI=177$ -$LK,"OptIC4",A="FL:::/Compiler/OptPass4.CPP.Z,1",BI=178$ -$LK,"OptIC6",A="FL:::/Compiler/OptPass6.CPP.Z,1",BI=179$ -$LK,"ICCmpAndBranch",A="FL:::/Compiler/BackB.CPP.Z,468",BI=180$ -$LK,"ICDivEqu",A="FL:::/Compiler/BackA.CPP.Z,408",BI=181$ -$LK,"PrsWhile",A="FL:::/Compiler/PrsStmt.CPP.Z,486",BI=182$ -$LK,"ICFCmpAndBranch",A="FL:::/Compiler/BackFB.CPP.Z,219",BI=183$ -$LK,"Lex",A="FL:::/Compiler/Lex.CPP.Z,447",BI=184$ -$LK,"ICTestAndBranch",A="FL:::/Compiler/BackB.CPP.Z,634",BI=185$ +$LK,"LexPutPos",A="FL:::/Compiler/CExcept.HC.Z,50",BI=1$ +$LK,"ICAssignPostIncDec",A="FL:::/Compiler/BackB.HC.Z,429",BI=2$ +$LK,"CmpSetFloatOpPushPop",A="FL:::/Compiler/BackFA.HC.Z,62",BI=3$ +$LK,"ICFCvt2",A="FL:::/Compiler/BackFA.HC.Z,169",BI=4$ +$LK,"CmpMinTypePointed",A="FL:::/Compiler/OptLib.HC.Z,528",BI=5$ +$LK,"CmpRawTypePointed",A="FL:::/Compiler/OptLib.HC.Z,517",BI=6$ +$LK,"OptFixupBinaryOp1",A="FL:::/Compiler/OptLib.HC.Z,96",BI=7$ +$LK,"OptFixupBinaryOp2",A="FL:::/Compiler/OptLib.HC.Z,182",BI=8$ +$LK,"COCInit",A="FL:::/Compiler/PrsLib.HC.Z,99",BI=9$ +$LK,"IsLexExpression2Bin",A="FL:::/Compiler/PrsExp.HC.Z,1128",BI=10$ +$LK,"CSubSwitch",A="FL:::/Compiler/PrsStmt.HC.Z,574"$ +$LK,"LexFilePop",A="FL:::/Compiler/Lex.HC.Z,11",BI=11$ +$LK,"ExePutS",A="FL:::/Compiler/CMain.HC.Z,571",BI=12$ +$LK,"PrsStaticInit",A="FL:::/Compiler/PrsVar.HC.Z,215",BI=13$ +$LK,"LexPutLine",A="FL:::/Compiler/CExcept.HC.Z,22",BI=14$ +$LK,"PrsKeyWord",A="FL:::/Compiler/PrsLib.HC.Z,31",BI=15$ +$LK,"AsmLineLst",A="FL:::/Compiler/AsmLib.HC.Z,147",BI=16$ +$LK,"ICOpSizeRex",A="FL:::/Compiler/BackLib.HC.Z,28",BI=17$ +$LK,"CVI2",A="FL:::/Compiler/PrsVar.HC.Z,117"$ +$LK,"ICU8",A="FL:::/Compiler/BackLib.HC.Z,17",BI=18$ +$LK,"AsmStoreNum",A="FL:::/Compiler/Asm.HC.Z,268",BI=19$ +$LK,"OptPass012",A="FL:::/Compiler/OptPass012.HC.Z,23",BI=20$ +$LK,"MemberLstSize",A="FL:::/Compiler/LexLib.HC.Z,221",BI=21$ +$LK,"ICQueIns",A="FL:::/Compiler/BackC.HC.Z,351",BI=22$ +$LK,"ICAndBranch",A="FL:::/Compiler/BackC.HC.Z,1",BI=23$ +$LK,"U",A="FL:::/Compiler/UAsm.HC.Z,645",BI=24$ +$LK,"ICQueRem",A="FL:::/Compiler/BackC.HC.Z,399",BI=25$ +$LK,"CN_R",A="FL:::/Compiler/BackFA.HC.Z,4"$ +$LK,"LastFun",A="FL:::/Compiler/CMisc.HC.Z,48"$ +$LK,"OptLead1",A="FL:::/Compiler/OptLib.HC.Z,73",BI=26$ +$LK,"CmpNoteFloatOp",A="FL:::/Compiler/BackFA.HC.Z,6",BI=27$ +$LK,"AOTGlblsResolve",A="FL:::/Compiler/AsmResolve.HC.Z,76",BI=28$ +$LK,"ExePutS2",A="FL:::/Compiler/CMain.HC.Z,631",BI=29$ +$LK,"HashEntrySize",A="FL:::/Compiler/CHash.HC.Z,1",BI=30$ +$LK,"COCPush",A="FL:::/Compiler/PrsLib.HC.Z,107",BI=31$ +$LK,"SLASH_OP_DEC",A="FL:::/Compiler/BackLib.HC.Z,245"$ +$LK,"MODR_SIB_D32_INDIRECT_REG",A="FL:::/Compiler/BackLib.HC.Z,132"$ +$LK,"ICPushRegs",A="FL:::/Compiler/BackLib.HC.Z,331",BI=32$ +$LK,"PE_POP_HIGHER",A="FL:::/Compiler/PrsExp.HC.Z,10"$ +$LK,"SLASH_OP_FLD",A="FL:::/Compiler/BackLib.HC.Z,260"$ +$LK,"ICU32",A="FL:::/Compiler/BackLib.HC.Z,47",BI=33$ +$LK,"ICU24",A="FL:::/Compiler/BackLib.HC.Z,41",BI=34$ +$LK,"ICU16",A="FL:::/Compiler/BackLib.HC.Z,35",BI=35$ +$LK,"SLASH_OP_DIV",A="FL:::/Compiler/BackLib.HC.Z,250"$ +$LK,"CmpFillTables",A="FL:::/Compiler/CInit.HC.Z,239",BI=36$ +$LK,"AOTStoreCodeU32",A="FL:::/Compiler/AsmLib.HC.Z,30",BI=37$ +$LK,"ICU64",A="FL:::/Compiler/BackLib.HC.Z,53",BI=38$ +$LK,"SLASH_OP_INC",A="FL:::/Compiler/BackLib.HC.Z,244"$ +$LK,"AOTStoreCodeU64",A="FL:::/Compiler/AsmLib.HC.Z,68",BI=39$ +$LK,"LexPopNoRestore",A="FL:::/Compiler/LexLib.HC.Z,38",BI=40$ +$LK,"ExePrint",A="FL:::/Compiler/CMain.HC.Z,605",BI=41$ +$LK,"SLASH_OP_NEG",A="FL:::/Compiler/BackLib.HC.Z,247"$ +$LK,"PrsVarLst",A="FL:::/Compiler/PrsVar.HC.Z,416",BI=42$ +$LK,"PrsAsmDefine",A="FL:::/Compiler/Asm.HC.Z,814",BI=43$ +$LK,"PrsAddOp",A="FL:::/Compiler/PrsExp.HC.Z,15",BI=44$ +$LK,"LexWarn",A="FL:::/Compiler/CExcept.HC.Z,65",BI=45$ +$LK,"PE_POP_ALL1",A="FL:::/Compiler/PrsExp.HC.Z,12"$ +$LK,"PE_POP_ALL2",A="FL:::/Compiler/PrsExp.HC.Z,13"$ +$LK,"COCAppend",A="FL:::/Compiler/PrsLib.HC.Z,126",BI=46$ +$LK,"LexFilePush",A="FL:::/Compiler/Lex.HC.Z,1",BI=47$ +$LK,"CN_MAIN",A="FL:::/Compiler/BackFA.HC.Z,3"$ +$LK,"PrsUnaryModifier",A="FL:::/Compiler/PrsExp.HC.Z,954",BI=48$ +$LK,"OptFixupUnaryOp",A="FL:::/Compiler/OptLib.HC.Z,196",BI=49$ +$LK,"LexPush",A="FL:::/Compiler/LexLib.HC.Z,12",BI=50$ +$LK,"SLASH_OP_MOV",A="FL:::/Compiler/BackLib.HC.Z,251"$ +$LK,"ICPopRegs",A="FL:::/Compiler/BackLib.HC.Z,372",BI=51$ +$LK,"SLASH_OP_MUL",A="FL:::/Compiler/BackLib.HC.Z,248"$ +$LK,"SLASH_OP_NOT",A="FL:::/Compiler/BackLib.HC.Z,246"$ +$LK,"NUM_INTERNAL_TYPES",A="FL:::/Compiler/CInit.HC.Z,1"$ +$LK,"SLASH_OP_POP",A="FL:::/Compiler/BackLib.HC.Z,253"$ +$LK,"ICFOp",A="FL:::/Compiler/BackFA.HC.Z,339",BI=52$ +$LK,"CN_A1",A="FL:::/Compiler/BackFA.HC.Z,2"$ +$LK,"CN_A2",A="FL:::/Compiler/BackFA.HC.Z,1"$ +$LK,"LexExpressionF64",A="FL:::/Compiler/PrsExp.HC.Z,1147",BI=53$ +$LK,"ICAdd",A="FL:::/Compiler/PrsLib.HC.Z,79",BI=54$ +$LK,"CmpRawType",A="FL:::/Compiler/OptLib.HC.Z,508",BI=55$ +$LK,"ICFOpEqu",A="FL:::/Compiler/BackFB.HC.Z,1",BI=56$ +$LK,"LexExpressionI64",A="FL:::/Compiler/PrsExp.HC.Z,1133",BI=57$ +$LK,"ICQueInsRev",A="FL:::/Compiler/BackC.HC.Z,375",BI=58$ +$LK,"LexExpression",A="FL:::/Compiler/PrsExp.HC.Z,1161",BI=59$ +$LK,"PrsExpression",A="FL:::/Compiler/PrsExp.HC.Z,264",BI=60$ +$LK,"PrsClassNew",A="FL:::/Compiler/PrsLib.HC.Z,40",BI=61$ +$LK,"LexInStr",A="FL:::/Compiler/Lex.HC.Z,373",BI=62$ +$LK,"internal_types_table",A="FL:::/Compiler/CInit.HC.Z,6"$ +$LK,"OptPass3",A="FL:::/Compiler/OptPass3.HC.Z,1",BI=63$ +$LK,"OptPass4",A="FL:::/Compiler/OptPass4.HC.Z,132",BI=64$ +$LK,"OptPass5",A="FL:::/Compiler/OptPass5.HC.Z,1",BI=65$ +$LK,"OptPass6",A="FL:::/Compiler/OptPass6.HC.Z,96",BI=66$ +$LK,"MODR_REG",A="FL:::/Compiler/BackLib.HC.Z,126"$ +$LK,"Echo",A="FL:::/Compiler/CMisc.HC.Z,63",BI=67$ +$LK,"PrsGlblVarLst",A="FL:::/Compiler/PrsStmt.HC.Z,209",BI=68$ +$LK,"ICQueInit",A="FL:::/Compiler/BackC.HC.Z,337",BI=69$ +$LK,"ICCmp",A="FL:::/Compiler/BackB.HC.Z,102",BI=70$ +$LK,"ICAddRSP",A="FL:::/Compiler/BackLib.HC.Z,59",BI=71$ +$LK,"ICDiv",A="FL:::/Compiler/BackA.HC.Z,391",BI=72$ +$LK,"ICDeref",A="FL:::/Compiler/BackLib.HC.Z,709",BI=73$ +$LK,"ICLea",A="FL:::/Compiler/BackLib.HC.Z,677",BI=74$ +$LK,"CmpBuf",A="FL:::/Compiler/CMain.HC.Z,157",BI=75$ +$LK,"CMP_TEMPLATES_DONT_PUSH_POP",A="FL:::/Compiler/Templates.HC.Z,385"$ +$LK,"ICAddEct",A="FL:::/Compiler/BackA.HC.Z,1",BI=76$ +$LK,"ICToF64",A="FL:::/Compiler/BackB.HC.Z,283",BI=77$ +$LK,"PrsBinFile",A="FL:::/Compiler/Asm.HC.Z,888",BI=78$ +$LK,"HashTableSize2",A="FL:::/Compiler/CHash.HC.Z,72",BI=79$ +$LK,"HashEntrySize2",A="FL:::/Compiler/CHash.HC.Z,33",BI=80$ +$LK,"Ui",A="FL:::/Compiler/UAsm.HC.Z,238",BI=81$ +$LK,"ICSlashOp",A="FL:::/Compiler/BackLib.HC.Z,265",BI=82$ +$LK,"OptBrZero",A="FL:::/Compiler/OptLib.HC.Z,230",BI=83$ +$LK,"Un",A="FL:::/Compiler/UAsm.HC.Z,660",BI=84$ +$LK,"PrsSizeOf",A="FL:::/Compiler/PrsExp.HC.Z,298",BI=85$ +$LK,"ICToI64",A="FL:::/Compiler/BackB.HC.Z,277",BI=86$ +$LK,"ICMod",A="FL:::/Compiler/BackA.HC.Z,461",BI=87$ +$LK,"OptSetNOP1",A="FL:::/Compiler/OptLib.HC.Z,17",BI=88$ +$LK,"OptPass789A",A="FL:::/Compiler/OptPass789A.HC.Z,1",BI=89$ +$LK,"OptSetNOP2",A="FL:::/Compiler/OptLib.HC.Z,25",BI=90$ +$LK,"FBO1_F64",A="FL:::/Compiler/OptLib.HC.Z,94"$ +$LK,"ICXorEqu",A="FL:::/Compiler/BackC.HC.Z,578",BI=91$ +$LK,"ICToUpper",A="FL:::/Compiler/BackB.HC.Z,266",BI=92$ +$LK,"AsmLexExpression",A="FL:::/Compiler/AsmLib.HC.Z,127",BI=93$ +$LK,"ICMov",A="FL:::/Compiler/BackLib.HC.Z,426",BI=94$ +$LK,"ICNot",A="FL:::/Compiler/BackB.HC.Z,10",BI=95$ +$LK,"ICMul",A="FL:::/Compiler/BackA.HC.Z,263",BI=96$ +$LK,"ICRex",A="FL:::/Compiler/BackLib.HC.Z,22",BI=97$ +$LK,"ICPop",A="FL:::/Compiler/BackLib.HC.Z,344",BI=98$ +$LK,"SLASH_OP_FADD",A="FL:::/Compiler/BackLib.HC.Z,254"$ +$LK,"MODR_RIP_REL",A="FL:::/Compiler/BackLib.HC.Z,133"$ +$LK,"LexStmt2Bin",A="FL:::/Compiler/CMain.HC.Z,1",BI=99$ +$LK,"ICSub",A="FL:::/Compiler/BackA.HC.Z,205",BI=100$ +$LK,"COCFloatConstFind",A="FL:::/Compiler/PrsLib.HC.Z,164",BI=101$ +$LK,"ICPut",A="FL:::/Compiler/CExcept.HC.Z,184",BI=102$ +$LK,"PrsArrayDims",A="FL:::/Compiler/PrsVar.HC.Z,247",BI=103$ +$LK,"ICSqr",A="FL:::/Compiler/BackC.HC.Z,453",BI=104$ +$LK,"FBO1_NOT_CONST",A="FL:::/Compiler/OptLib.HC.Z,92"$ +$LK,"CMP_TEMPLATES_DONT_POP",A="FL:::/Compiler/Templates.HC.Z,173"$ +$LK,"PrsClass",A="FL:::/Compiler/PrsStmt.HC.Z,1",BI=105$ +$LK,"MemberMetaData",A="FL:::/Compiler/LexLib.HC.Z,45",BI=106$ +$LK,"ICSwitch",A="FL:::/Compiler/BackC.HC.Z,599",BI=107$ +$LK,"OptBrNotZero",A="FL:::/Compiler/OptLib.HC.Z,357",BI=108$ +$LK,"LexPutToken",A="FL:::/Compiler/CExcept.HC.Z,1",BI=109$ +$LK,"SLASH_OP_FDIV",A="FL:::/Compiler/BackLib.HC.Z,258"$ +$LK,"AsmHashLoad",A="FL:::/Compiler/AsmInit.HC.Z,50",BI=110$ +$LK,"UAsmHashLoad",A="FL:::/Compiler/UAsm.HC.Z,188",BI=111$ +$LK,"UnusedExternWarning",A="FL:::/Compiler/CExcept.HC.Z,104",BI=112$ +$LK,"SLASH_OP_FILD",A="FL:::/Compiler/BackLib.HC.Z,263"$ +$LK,"ICXorXor",A="FL:::/Compiler/BackB.HC.Z,75",BI=113$ +$LK,"PrsTryBlk",A="FL:::/Compiler/PrsStmt.HC.Z,850",BI=114$ +$LK,"CInit",A="FL:::/Compiler/CMain.HC.Z,691",BI=115$ +$LK,"MemberMetaFind",A="FL:::/Compiler/LexLib.HC.Z,56",BI=116$ +$LK,"ExePrint2",A="FL:::/Compiler/CMain.HC.Z,648",BI=117$ +$LK,"FBO1_INT",A="FL:::/Compiler/OptLib.HC.Z,93"$ +$LK,"PE_DO_UNARY_OP",A="FL:::/Compiler/PrsExp.HC.Z,8"$ +$LK,"PrsVarInit",A="FL:::/Compiler/PrsVar.HC.Z,1",BI=118$ +$LK,"ICOrEqu",A="FL:::/Compiler/BackC.HC.Z,557",BI=119$ +$LK,"ICModr1",A="FL:::/Compiler/BackLib.HC.Z,135",BI=120$ +$LK,"ICModr2",A="FL:::/Compiler/BackLib.HC.Z,213",BI=121$ +$LK,"SLASH_OP_FMUL",A="FL:::/Compiler/BackLib.HC.Z,257"$ +$LK,"ICPreIncDec",A="FL:::/Compiler/BackB.HC.Z,304",BI=122$ +$LK,"PrsUnaryTerm",A="FL:::/Compiler/PrsExp.HC.Z,588",BI=123$ +$LK,"MemberLstDel",A="FL:::/Compiler/LexLib.HC.Z,183",BI=124$ +$LK,"SLASH_OP_FSUB",A="FL:::/Compiler/BackLib.HC.Z,255"$ +$LK,"ICAndAnd",A="FL:::/Compiler/BackB.HC.Z,30",BI=125$ +$LK,"InstEntriesCompare",A="FL:::/Compiler/UAsm.HC.Z,1",BI=126$ +$LK,"SLASH_OP_IMUL",A="FL:::/Compiler/BackLib.HC.Z,249"$ +$LK,"MemberLstCmp",A="FL:::/Compiler/LexLib.HC.Z,157",BI=127$ +$LK,"SLASH_OP_FSTP",A="FL:::/Compiler/BackLib.HC.Z,261"$ +$LK,"COCDel",A="FL:::/Compiler/PrsLib.HC.Z,186",BI=128$ +$LK,"PE_UNARY_TERM1",A="FL:::/Compiler/PrsExp.HC.Z,1"$ +$LK,"ICFAdd",A="FL:::/Compiler/BackFB.HC.Z,504",BI=129$ +$LK,"PE_UNARY_TERM2",A="FL:::/Compiler/PrsExp.HC.Z,2"$ +$LK,"CmdLinePmt",A="FL:::/Compiler/CMisc.HC.Z,127",BI=130$ +$LK,"AsmMakeArgMask",A="FL:::/Compiler/Asm.HC.Z,177",BI=131$ +$LK,"COCHeaderPut",A="FL:::/Compiler/PrsLib.HC.Z,229",BI=132$ +$LK,"PrsGlblInit",A="FL:::/Compiler/PrsVar.HC.Z,206",BI=133$ +$LK,"ICAndEqu",A="FL:::/Compiler/BackC.HC.Z,536",BI=134$ +$LK,"LexD2I32",A="FL:::/Compiler/CMisc.HC.Z,91",BI=135$ +$LK,"MemberLstNew",A="FL:::/Compiler/LexLib.HC.Z,150",BI=136$ +$LK,"LexD3I32",A="FL:::/Compiler/CMisc.HC.Z,107",BI=137$ +$LK,"OptClassFwd",A="FL:::/Compiler/OptLib.HC.Z,9",BI=138$ +$LK,"ICFCmp",A="FL:::/Compiler/BackFA.HC.Z,515",BI=139$ +$LK,"PrsSwitch",A="FL:::/Compiler/PrsStmt.HC.Z,586",BI=140$ +$LK,"ICFDiv",A="FL:::/Compiler/BackFB.HC.Z,493",BI=141$ +$LK,"AOTStoreCodeU8At",A="FL:::/Compiler/AsmLib.HC.Z,106",BI=142$ +$LK,"PE_PUSH_LOWER",A="FL:::/Compiler/PrsExp.HC.Z,11"$ +$LK,"OptPass6Lag",A="FL:::/Compiler/OptPass6.HC.Z,28",BI=143$ +$LK,"OptLag1",A="FL:::/Compiler/OptLib.HC.Z,51",BI=144$ +$LK,"OptLag2",A="FL:::/Compiler/OptLib.HC.Z,62",BI=145$ +$LK,"StreamPrint",A="FL:::/Compiler/CMisc.HC.Z,68",BI=146$ +$LK,"_LAST_FUN",A="FL:::/Compiler/CMisc.HC.Z,12"$ +$LK,"ICFCvt",A="FL:::/Compiler/BackFA.HC.Z,123",BI=147$ +$LK,"StreamDir",A="FL:::/Compiler/CMisc.HC.Z,82",BI=148$ +$LK,"PrsOffsetOf",A="FL:::/Compiler/PrsExp.HC.Z,348",BI=149$ +$LK,"GetOption",A="FL:::/Compiler/CMisc.HC.Z,6",BI=150$ +$LK,"PrsDoWhile",A="FL:::/Compiler/PrsStmt.HC.Z,514",BI=151$ +$LK,"ICShift",A="FL:::/Compiler/BackA.HC.Z,609",BI=152$ +$LK,"ICFMod",A="FL:::/Compiler/BackFA.HC.Z,242",BI=153$ +$LK,"COCPop",A="FL:::/Compiler/PrsLib.HC.Z,121",BI=154$ +$LK,"PrsExpression2",A="FL:::/Compiler/PrsExp.HC.Z,65",BI=155$ +$LK,"SLASH_OP_PUSH",A="FL:::/Compiler/BackLib.HC.Z,252"$ +$LK,"PE_DEREFERENCE",A="FL:::/Compiler/PrsExp.HC.Z,5"$ +$LK,"LexPopRestore",A="FL:::/Compiler/LexLib.HC.Z,23",BI=156$ +$LK,"ICUnaries",A="FL:::/Compiler/BackB.HC.Z,1",BI=157$ +$LK,"ICFMul",A="FL:::/Compiler/BackFB.HC.Z,477",BI=158$ +$LK,"ICShiftEqu",A="FL:::/Compiler/BackA.HC.Z,639",BI=159$ +$LK,"LexExpression2Bin",A="FL:::/Compiler/PrsExp.HC.Z,1110",BI=160$ +$LK,"ICFPow",A="FL:::/Compiler/BackFA.HC.Z,266",BI=161$ +$LK,"MapFileWrite",A="FL:::/Compiler/CHash.HC.Z,90",BI=162$ +$LK,"ICFSub",A="FL:::/Compiler/BackFB.HC.Z,540",BI=163$ +$LK,"ICFModEqu",A="FL:::/Compiler/BackFA.HC.Z,545",BI=164$ +$LK,"CmpF1PushPop",A="FL:::/Compiler/OptLib.HC.Z,535",BI=165$ +$LK,"OptFree",A="FL:::/Compiler/OptLib.HC.Z,33",BI=166$ +$LK,"CMP_TEMPLATES_DONT_PUSH2",A="FL:::/Compiler/Templates.HC.Z,447"$ +$LK,"CInternalType",A="FL:::/Compiler/CInit.HC.Z,3"$ +$LK,"LexDollar",A="FL:::/Compiler/Lex.HC.Z,93",BI=167$ +$LK,"AsmUnresolvedAdd",A="FL:::/Compiler/AsmResolve.HC.Z,188",BI=168$ +$LK,"AOTStoreCodeU8",A="FL:::/Compiler/AsmLib.HC.Z,1",BI=169$ +$LK,"ICBitOps",A="FL:::/Compiler/BackB.HC.Z,202",BI=170$ +$LK,"lex_zeros",A="FL:::/Compiler/Lex.HC.Z,91"$ +$LK,"ClassMemberLstDel",A="FL:::/Compiler/LexLib.HC.Z,209",BI=171$ +$LK,"CSwitchCase",A="FL:::/Compiler/PrsStmt.HC.Z,579"$ +$LK,"AsmResolve",A="FL:::/Compiler/AsmResolve.HC.Z,1",BI=172$ +$LK,"PrsAsmInst",A="FL:::/Compiler/Asm.HC.Z,395",BI=173$ +$LK,"COCCompile",A="FL:::/Compiler/PrsLib.HC.Z,249",BI=174$ +$LK,"RunFile2",A="FL:::/Compiler/CMain.HC.Z,667",BI=175$ +$LK,"Cmp",A="FL:::/Compiler/CMain.HC.Z,419",BI=176$ +$LK,"PrsPush2",A="FL:::/Compiler/PrsLib.HC.Z,11",BI=177$ +$LK,"ICArgPut",A="FL:::/Compiler/CExcept.HC.Z,141",BI=178$ +$LK,"UndefinedExtern",A="FL:::/Compiler/CExcept.HC.Z,98",BI=179$ +$LK,"OptIC4",A="FL:::/Compiler/OptPass4.HC.Z,1",BI=180$ +$LK,"OptIC6",A="FL:::/Compiler/OptPass6.HC.Z,1",BI=181$ +$LK,"ICCmpAndBranch",A="FL:::/Compiler/BackB.HC.Z,468",BI=182$ +$LK,"ICDivEqu",A="FL:::/Compiler/BackA.HC.Z,408",BI=183$ +$LK,"PrsWhile",A="FL:::/Compiler/PrsStmt.HC.Z,494",BI=184$ +$LK,"ICFCmpAndBranch",A="FL:::/Compiler/BackFB.HC.Z,219",BI=185$ +$LK,"Lex",A="FL:::/Compiler/Lex.HC.Z,447",BI=186$ +$LK,"ICTestAndBranch",A="FL:::/Compiler/BackB.HC.Z,634",BI=187$ $LK,"uasm",A="FL:::/Compiler/Compiler.PRJ.Z,21"$ -$LK,"MODR_INDIRECT_REG",A="FL:::/Compiler/BackLib.CPP.Z,127"$ -$LK,"PE_MAYBE_MODIFIERS",A="FL:::/Compiler/PrsExp.CPP.Z,3"$ -$LK,"PE_UNARY_MODIFIERS",A="FL:::/Compiler/PrsExp.CPP.Z,4"$ -$LK,"AOTLocalsResolve",A="FL:::/Compiler/AsmResolve.CPP.Z,42",BI=186$ -$LK,"PE_DO_BINARY_OP",A="FL:::/Compiler/PrsExp.CPP.Z,9"$ -$LK,"CmpFixUpAOTAsm",A="FL:::/Compiler/CMain.CPP.Z,302",BI=187$ -$LK,"OptLabelFwd",A="FL:::/Compiler/OptLib.CPP.Z,1",BI=188$ -$LK,"ICOrOr",A="FL:::/Compiler/BackB.CPP.Z,51",BI=189$ -$LK,"LexExcept",A="FL:::/Compiler/CExcept.CPP.Z,81",BI=190$ -$LK,"cmp_templates",A="FL:::/Compiler/CExts.CPP.Z,42"$ -$LK,"CmpF2PushPop",A="FL:::/Compiler/OptLib.CPP.Z,542",BI=191$ -$LK,"CmpJoin",A="FL:::/Compiler/CMain.CPP.Z,35",BI=192$ -$LK,"PrsPop2",A="FL:::/Compiler/PrsLib.CPP.Z,16",BI=193$ -$LK,"CMP_TEMPLATES",A="FL:::/Compiler/Templates.CPP.Z,4"$ -$LK,"MODR_D8_INDIRECT_REG",A="FL:::/Compiler/BackLib.CPP.Z,128"$ -$LK,"PrsAsmBlk",A="FL:::/Compiler/Asm.CPP.Z,904",BI=194$ -$LK,"PrsAsmArg",A="FL:::/Compiler/Asm.CPP.Z,35",BI=195$ -$LK,"LexFirstRem",A="FL:::/Compiler/Lex.CPP.Z,277",BI=196$ -$LK,"MemberClassBaseFind",A="FL:::/Compiler/LexLib.CPP.Z,87",BI=197$ -$LK,"MemberFind",A="FL:::/Compiler/LexLib.CPP.Z,67",BI=198$ +$LK,"MODR_INDIRECT_REG",A="FL:::/Compiler/BackLib.HC.Z,127"$ +$LK,"PE_MAYBE_MODIFIERS",A="FL:::/Compiler/PrsExp.HC.Z,3"$ +$LK,"PE_UNARY_MODIFIERS",A="FL:::/Compiler/PrsExp.HC.Z,4"$ +$LK,"AOTLocalsResolve",A="FL:::/Compiler/AsmResolve.HC.Z,42",BI=188$ +$LK,"PE_DO_BINARY_OP",A="FL:::/Compiler/PrsExp.HC.Z,9"$ +$LK,"CmpFixUpAOTAsm",A="FL:::/Compiler/CMain.HC.Z,302",BI=189$ +$LK,"OptLabelFwd",A="FL:::/Compiler/OptLib.HC.Z,1",BI=190$ +$LK,"ICOrOr",A="FL:::/Compiler/BackB.HC.Z,51",BI=191$ +$LK,"LexExcept",A="FL:::/Compiler/CExcept.HC.Z,81",BI=192$ +$LK,"cmp_templates",A="FL:::/Compiler/CExts.HC.Z,42"$ +$LK,"CmpF2PushPop",A="FL:::/Compiler/OptLib.HC.Z,542",BI=193$ +$LK,"CmpJoin",A="FL:::/Compiler/CMain.HC.Z,35",BI=194$ +$LK,"PrsPop2",A="FL:::/Compiler/PrsLib.HC.Z,16",BI=195$ +$LK,"CMP_TEMPLATES",A="FL:::/Compiler/Templates.HC.Z,4"$ +$LK,"MODR_D8_INDIRECT_REG",A="FL:::/Compiler/BackLib.HC.Z,128"$ +$LK,"PrsAsmBlk",A="FL:::/Compiler/Asm.HC.Z,904",BI=196$ +$LK,"PrsAsmArg",A="FL:::/Compiler/Asm.HC.Z,35",BI=197$ +$LK,"LexFirstRem",A="FL:::/Compiler/Lex.HC.Z,277",BI=198$ +$LK,"MemberClassBaseFind",A="FL:::/Compiler/LexLib.HC.Z,87",BI=199$ +$LK,"MemberFind",A="FL:::/Compiler/LexLib.HC.Z,67",BI=200$ $LK,"cmp",A="FL:::/Compiler/Compiler.PRJ.Z,16"$ -$LK,"OptLag",A="FL:::/Compiler/OptLib.CPP.Z,40",BI=199$ -$LK,"ICPostIncDec",A="FL:::/Compiler/BackB.CPP.Z,345",BI=200$ -$LK,"ICFPostIncDec",A="FL:::/Compiler/BackFB.CPP.Z,582",BI=201$ -$LK,"ICTest",A="FL:::/Compiler/BackLib.CPP.Z,394",BI=202$ -$LK,"ICModU64",A="FL:::/Compiler/BackC.CPP.Z,460",BI=203$ -$LK,"PrsAsmImm",A="FL:::/Compiler/Asm.CPP.Z,1",BI=204$ -$LK,"LexExtStr",A="FL:::/Compiler/LexLib.CPP.Z,218",BI=205$ -$LK,"ICAddSubEctEqu",A="FL:::/Compiler/BackA.CPP.Z,478",BI=206$ -$LK,"ICAddSubEctImm",A="FL:::/Compiler/BackA.CPP.Z,56",BI=207$ -$LK,"ICPush",A="FL:::/Compiler/BackLib.CPP.Z,293",BI=208$ -$LK,"ICSwap",A="FL:::/Compiler/BackC.CPP.Z,487",BI=209$ -$LK,"CMP_TEMPLATES_DONT_PUSH",A="FL:::/Compiler/Templates.CPP.Z,260"$ -$LK,"intermediate_code_table",A="FL:::/Compiler/CInit.CPP.Z,16"$ -$LK,"ICZero",A="FL:::/Compiler/BackLib.CPP.Z,385",BI=210$ -$LK,"CmpCtrlDel",A="FL:::/Compiler/Lex.CPP.Z,58",BI=211$ -$LK,"ICClassPut",A="FL:::/Compiler/CExcept.CPP.Z,117",BI=212$ -$LK,"ICAssign",A="FL:::/Compiler/BackC.CPP.Z,159",BI=213$ -$LK,"ICFTemplateFun",A="FL:::/Compiler/BackFB.CPP.Z,606",BI=214$ -$LK,"RunFile",A="FL:::/Compiler/CMain.CPP.Z,625",BI=215$ -$LK,"MemberAdd",A="FL:::/Compiler/LexLib.CPP.Z,103",BI=216$ -$LK,"PrsPush",A="FL:::/Compiler/PrsLib.CPP.Z,1",BI=217$ -$LK,"SLASH_OP_FDIVR",A="FL:::/Compiler/BackLib.CPP.Z,259"$ -$LK,"SLASH_OP_FISTTP",A="FL:::/Compiler/BackLib.CPP.Z,262"$ -$LK,"CmpCtrlSize",A="FL:::/Compiler/Lex.CPP.Z,70",BI=218$ -$LK,"ICLocalVarInit",A="FL:::/Compiler/BackC.CPP.Z,758",BI=219$ -$LK,"PrsFor",A="FL:::/Compiler/PrsStmt.CPP.Z,529",BI=220$ -$LK,"PassTrace",A="FL:::/Compiler/CMisc.CPP.Z,50",BI=221$ -$LK,"PrsPopDeref",A="FL:::/Compiler/PrsLib.CPP.Z,21",BI=222$ -$LK,"ICCopyTemplate",A="FL:::/Compiler/BackFA.CPP.Z,77",BI=223$ -$LK,"PrsStmt",A="FL:::/Compiler/PrsStmt.CPP.Z,904",BI=224$ -$LK,"PrsFun",A="FL:::/Compiler/PrsStmt.CPP.Z,132",BI=225$ -$LK,"LexIncludeStr",A="FL:::/Compiler/Lex.CPP.Z,299",BI=226$ -$LK,"PrsType",A="FL:::/Compiler/PrsVar.CPP.Z,287",BI=227$ -$LK,"CmpCtrlNew",A="FL:::/Compiler/Lex.CPP.Z,28",BI=228$ -$LK,"MODR_SIB_D8_INDIRECT_REG",A="FL:::/Compiler/BackLib.CPP.Z,131"$ -$LK,"cmp_type_flags_src_code",A="FL:::/Compiler/Lex.CPP.Z,328"$ -$LK,"PrsVarInit2",A="FL:::/Compiler/PrsVar.CPP.Z,123",BI=229$ -$LK,"PrsPop",A="FL:::/Compiler/PrsLib.CPP.Z,6",BI=230$ -$LK,"asm_seg_prefixes",A="FL:::/Compiler/Asm.CPP.Z,393"$ -$LK,"ICMinMax",A="FL:::/Compiler/BackC.CPP.Z,415",BI=231$ -$LK,"CmpLoadDefines",A="FL:::/Compiler/CInit.CPP.Z,204",BI=232$ -$LK,"PrsIf",A="FL:::/Compiler/PrsStmt.CPP.Z,459",BI=233$ -$LK,"ICBuiltInFloatConst",A="FL:::/Compiler/BackLib.CPP.Z,404",BI=234$ -$LK,"ICFUnaryMinus",A="FL:::/Compiler/BackFA.CPP.Z,194",BI=235$ -$LK,"LexDocRead",A="FL:::/Compiler/Lex.CPP.Z,311",BI=236$ -$LK,"CmpFixUpJITAsm",A="FL:::/Compiler/CMain.CPP.Z,174",BI=237$ -$LK,"COCPopNoFree",A="FL:::/Compiler/PrsLib.CPP.Z,114",BI=238$ -$LK,"ParenWarning",A="FL:::/Compiler/CExcept.CPP.Z,110",BI=239$ -$LK,"PrsFunCall",A="FL:::/Compiler/PrsExp.CPP.Z,378",BI=240$ -$LK,"ICDerefPostIncDec",A="FL:::/Compiler/BackB.CPP.Z,384",BI=241$ -$LK,"Option",A="FL:::/Compiler/CMisc.CPP.Z,1",BI=242$ -$LK,"ExeFile2",A="FL:::/Compiler/CMain.CPP.Z,657",BI=243$ -$LK,"COptMemberVar",A="FL:::/Compiler/OptLib.CPP.Z,556"$ -$LK,"PE_CHECK_BINARY_OPS1",A="FL:::/Compiler/PrsExp.CPP.Z,6"$ -$LK,"PE_CHECK_BINARY_OPS2",A="FL:::/Compiler/PrsExp.CPP.Z,7"$ -$LK,"LexBackupLastChar",A="FL:::/Compiler/LexLib.CPP.Z,1",BI=244$ -$LK,"Trace",A="FL:::/Compiler/CMisc.CPP.Z,58",BI=245$ -$LK,"ICBrBitOps",A="FL:::/Compiler/BackC.CPP.Z,206",BI=246$ -$LK,"MODR_D32_INDIRECT_REG",A="FL:::/Compiler/BackLib.CPP.Z,129"$ -$LK,"LexGetChar",A="FL:::/Compiler/Lex.CPP.Z,107",BI=247$ -$LK,"LexSkipEol",A="FL:::/Compiler/Lex.CPP.Z,270",BI=248$ -$LK,"ICFlagBranch",A="FL:::/Compiler/BackB.CPP.Z,682",BI=249$ -$LK,"SLASH_OP_FSUBR",A="FL:::/Compiler/BackLib.CPP.Z,256"$ -$LK,"ICFPreIncDec",A="FL:::/Compiler/BackFB.CPP.Z,562",BI=250$ -$LK,"MODR_SIB_INDIRECT_REG",A="FL:::/Compiler/BackLib.CPP.Z,130"$ -$LK,"ExeFile",A="FL:::/Compiler/CMain.CPP.Z,614",BI=251$ -$LK,"COCMiscNew",A="FL:::/Compiler/PrsLib.CPP.Z,143",BI=252$ -$LK,"cmp_templates_dont_pop",A="FL:::/Compiler/CExts.CPP.Z,43"$ -$LK,"CmpOffset2Reg",A="FL:::/Compiler/OptLib.CPP.Z,83",BI=253$ -$LK,"PrsFunNew",A="FL:::/Compiler/PrsLib.CPP.Z,62",BI=254$ -$LK,"StreamExePrint",A="FL:::/Compiler/CMain.CPP.Z,673",BI=255$ -$LK,"COCGoToLabelFind",A="FL:::/Compiler/PrsLib.CPP.Z,152",BI=256$ -$LK,"OptMVCompare",A="FL:::/Compiler/OptLib.CPP.Z,562",BI=257$ -$LK,"ICToBool",A="FL:::/Compiler/BackB.CPP.Z,289",BI=258$ -$LK,"PrsFunJoin",A="FL:::/Compiler/PrsStmt.CPP.Z,68",BI=259$ -$LK,"OptFixSizeOf",A="FL:::/Compiler/OptLib.CPP.Z,484",BI=260$ -$LK,"cmp_templates_dont_push",A="FL:::/Compiler/CExts.CPP.Z,45"$ -$LK,"cmp_templates_dont_push_pop",A="FL:::/Compiler/CExts.CPP.Z,46"$ -$LK,"LexAttachDoc",A="FL:::/Compiler/Lex.CPP.Z,331",BI=261$ -$LK,"PrsStreamBlk",A="FL:::/Compiler/PrsStmt.CPP.Z,805",BI=262$ -$LK,"cmp_templates_dont_push2",A="FL:::/Compiler/CExts.CPP.Z,44"$ -$LK,"InstEntryFind",A="FL:::/Compiler/UAsm.CPP.Z,66",BI=263$ -$LK,"PrsDotDotDot",A="FL:::/Compiler/PrsVar.CPP.Z,381",BI=264$ -$LK,"ICMulEqu",A="FL:::/Compiler/BackA.CPP.Z,322",BI=265$ -$LK,"AsmPrsInsFlags",A="FL:::/Compiler/AsmInit.CPP.Z,1",BI=266$ -$LK,"PrsNoWarn",A="FL:::/Compiler/PrsStmt.CPP.Z,791",BI=267$ -H2@2#2#;#A#\#a#Œ#Ž#Ã#­#Ó#Ú#ë#þ#¨­Óÿaÿabb(b4bTb6bcbibib“bšbÅbÓbÓbc"c:c'cIcucbcŒc“c¾c¾cÅcécÿcÿcÿc dH>L?ý?ýYýcýgýkýpýrýŠý¢ý¢ý¬ýp©ÁOOy{‚ˆŽ–œ²ÅÔÙÛàêÿ(M_(FäFäZä{äää‡ä8ää ä$ä/ä8ä?äAäFäd`µþ×þר Ø-Ø/Ø<Ø>ØJØJØWØYØfØhØtØtØØØØ¨Ø¯Ø¾ØÉØÏØÔØÖØâØéØøØÙ ÙÙÙÙLÙrقْ٢٤ٴÙÄÙÔÙÔÙÙÙìÙóÙúÙúÙúÙúÙÚÚ#Ú)Ú/Ú5Ú9Ú9Ú9ÚfÚmÚƒÚÚ•Ú›Ú¡Ú£Ú£Ú±ÚD¶Ã¶Ú¶ÚÌÚÏÚÒÚßÚåÚòÚõÚøÚþÚÛ -Û ,cjŠŠŠŠ#Š.Š4Š:Š - hlfft‰ P r6r6€66«6±6Ã6Ã6Î6×6Ý6ä6ê6 ”;\?K?KGKKKdK~K›K¼KÅKÖKúKLL0L?LHLUL\LŽLŸL£L«L«L¾LÎLÒLÖL Œ×öÞÞþ -$$PfzˆŸ¥±¶Äàéùû|1’"’"¨"±"¼"Ö"Ö"Ù"è"î"÷"ù"ÿ"# -###!#$#$#.#0 'HˆHˆVˆvˆ|ˆ‚ˆ‚ˆˆˆ„“°ð ð ¡ ¡¡¡:¡M¡T¡e¡Š¡•¡ ¡¢¡­¡Ò¡Ý¡è¡ê¡ñ¡ú¡ü¡¢¢8¢("ÏßÏßÞßõßààà oßoß~ß”ßšß ˆx³x³³¤³»³Ç³Ò³ä³õ³æ³ä³´0´<´C´I´U´_´f´m´q´s´y´…´´–´´¡´¡´«´°´»´Í´Þ´Ï´Í´þ´ µ+µ2µ8µDµNµUµ\µ`µbµhµtµ~µ…µŒµµµµ«µ»µÍµÞµÏµÍµþµ ¶+¶2¶8¶D¶N¶U¶\¶`¶b¶h¶t¶~¶…¶Œ¶¶¶š¶ª¶¼¶Í¶¾¶¼¶í¶ô¶ú¶····"·$·*·6·@·G·N·R·R·\·j·s·Œ·˜·œ·œ·Ÿ·¨·¸Ôw‚w‚”‚b¨œ‚«‚΂Ù‚ë‚ò‚ƒ ƒƒƒ ƒ$ƒPƒPƒeƒgƒgƒsƒ{ƒƒŒƒŒƒ˜ƒ ƒ¤ƒ±ƒ±ƒ±ƒ̓؃éƒéƒîƒ„„„ „+„0„0„5„M„\„a„g„r„w„w„…„Ž„š„¢„ª„²„µ„»„À„Ʉۄä„õ„…… -…………#…#…(…(…(….…1…8…C…X…}…”…¡…©…±…½…É…Ï…Ö…ß…ã…æ…ò…ø…ÿ…†††"†"†/†/†7†?†H†W†\†\†c†n†t†|†‚††’†’†¡†¬†¾†Ć̆Ò†׆â†ô†ú†‡‡ ‡ ‡!‡'‡2‡8‡:‡J‡P‡P‡u‡œ‡¡‡¡‡µ‡»‡чâ‡è‡í‡ˆ ˆˆ$ˆ,ˆ2ˆ7ˆ7ˆKˆQˆgˆxˆ~ˆƒˆœˆ¢ˆ²ˆºˆˆȈ͈͈ãˆéˆÿˆ‰‰‰*‰0‰A‰I‰Q‰W‰^‰c‰c‰y‰‰•‰¦‰¬‰®‰½‰É͉Õ‰݉ã‰ê‰ê‰ê‰ü‰ŠŠ&Š&Š+Š+Š9ŠAŠRŠeŠlŠrŠzŠ€ŠŠ–ŠžŠ¤Š¤Š¤Š©Š©Š©Š©Š©ŠÈŠÔŠÙŠÙŠèŠñŠüŠ‹‹‹ ‹ ‹6‹<‹R‹c‹i‹n‹€‹†‹‹‹¤‹‹‹Ç‹Ç‹Ó‹Û‹Þ‹ä‹ê‹ï‹ï‹ŒŒ#Œ3Œ9Œ?Œ?ŒPŒnŒnŒsŒsŒŒ‡ŒŠŒ‘Œ—ŒœŒœŒ¼ŒÄŒÔŒÚŒáŒÿŒ.69@F^f~†‰–––µÅÑÙÜãéùŽŽ/Ž7Ž:ŽAŽGŽ_ŽkŽ†ŽŽŽ‘Ž˜ŽžŽžŽžŽžŽ£Ž£Ž¬Ž¼ŽÒŽØŽðŽ  &+GMYadkq𢲏¿¿¿ÄÄÍåû,27bh{²Äáéïôô‘‘&‘1‘1‘6‘6‘P‘\‘h‘s‘s‘x‘x‘’‘ž‘ª‘µ‘µ‘º‘º‘БÖ‘â‘è‘í‘ÿ‘’ -’’%’1’7’=’D’W’b’k’w’’‚’ˆ’Ž’“’§’¶’¾’Ö’Þ’á’ç’í’“ “-“G“O“R“X“^“^“o“x“„“Œ““–“œ“¡“³““Ê“â“ê“í“ô“ú“””9”S”[”^”e”k”k”{”„””˜”›”¡”§”¬”À”Ï”×”ñ”ù”ü”•• •(•J•f•n•q•w•}•}•Ž•—•£•«•®•µ•»•À•Ò•á•é•– ––––4–<–^–{–ƒ–†––“–“–“–“–“–˜–˜–®–´–À–Æ–Ë–Ý–ã–è–ö–— —— —"—)—/—4—F—U—]—u—}—€—‡——¥—­—Ì—æ—î—ñ—ø—þ—þ—þ—˜˜$˜,˜/˜6˜<˜S˜b˜n˜‰˜‘˜”˜›˜¡˜¹˜Ř瘙 ™™™™™™™™!™!™4™O™U™`™e™e™x™Ž™”™Ÿ™¡™¡™´™×™Ý™è™è™ú™ššš+š;š;š@š@šSšišoš}šŒš‘š‘š¤šºšÀšΚÝšâšâšøšþš›3›3›]›c›h›t›}›Œ›Œ›‘›‘›§›­›Ê›â›â› œœœ#œ,œ;œ;œ@œ@œVœ\œyœ‘œ‘œ»œÁœÆœÒœÛœêœêœïœïœ (@@jpr~‡’’’’—¥®¿ÁÓàààðžž)ž5ž6ž;žPžmž}ž¡ž±ž·ž·ž·ž¼žÁžÖžéž'Ÿ7Ÿ=Ÿ?ŸDŸUŸdŸ–ŸžŸ¤Ÿ¦Ÿ«Ÿ²Ÿ²Ÿ»ŸÍŸàŸéŸøŸøŸýŸ   % ' 0 ; ; \ c i q | ‚ ’ ˜   « ± ± ¶ »  É Р× à ï ï ï ô ô ô ¡ ¡ ¡¡(¡0¡8¡>¡>¡>¡C¡C¡N¡_¡b¡n¡w¡ƒ¡Š¡¡•¡•¡ ¡±¡´¡À¡É¡Õ¡Ü¡â¡ç¡ç¡ç¡ç¡ì¡ñ¡ñ¡ü¡¢¢ ¢¢¢¢#¢%¢;¢B¢H¢W¢b¢m¢s¢¢ƒ¢ƒ¢¢˜¢›¢›¢¦¢¨¢¾¢Å¢Ë¢Ó¢Þ¢é¢ï¢ù¢ü¢££££££ £#£,£/£/£:£<£Z£a£l£w£z£€£…£…££”£”£ £©£¬£¬£·£¹£Ï£Ö£Ü£ë£ö£¤¤¤¤¤#¤,¤/¤/¤:¤<¤R¤Y¤_¤g¤r¤}¤ƒ¤¤¤”¤”¤œ¤£¤¦¤¨¤³¤·¤À¤ääΤФî¤õ¤¥ ¥¥¥¥¥+¥/¥/¥;¥D¥G¥G¥R¥T¥j¥q¥w¥‰¥”¥Ÿ¥¥¥ª¥ª¥µ¥º¥º¥Å¥Ê¥Ê¥Õ¥Ø¥Ü¥ã¥è¥í¥ò¥ò¥¦ ¦ ¦¦¦-¦5¦9¦M¦T¦X¦X¦e¦q¦y¦¦¦“¦¤¦¶¦Á¦ŦŦÒ¦Ú¦â¦è¦è¦è¦è¦è¦ê¦ê¦ø¦ÿ¦ §§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§&§(§(§?§G§S§S§t§ƒ§›§§©§¶§¶§Ù§æ§ñ§ú§¨¨¨¨ ¨ ¨"¨4¨R¨^¨^¨‹ªx¿ÙJ4J4\4^4b4k4w4ƒ4˜4˜4Ç4Ë4Ð4Ü4ï4ù4ü45 -555l_vÏ}Ï}å}ô}ù}~û}~ ~ ~-~B~/~Q~W~p~‰~¢~»~Ô~Þ~„žnn-n5n;nBnInKnNnUn\n\nmnqnwnwnŒn–n–nžn·nÚnûno!o&o2o=oBoRoUoioootozo|o‚o…o‹oo“o›o¤o´o×oåoýopp+p>pCpQpipnprp—p§pÊpÝpâpèpípðpòpøpþpq qqqq!q*q8qPqUqYq~qŽq±qÄqÉqÙqüq -r"r'r+rPrcrcr~r~r~rŒr¤r¦r¦r¦r´rÌrÎrÎrÜrôrôrssss2sRslstss’s–s–s–ss£s½sÅsÐsësísós tt t.t9t9tStH…“˜…˜…¯…Å…Õ…Ü…ó…† †$†g†Lžï&€€5€7€P€i€t€€‡€4IR†×†×××’× ×®×±×¶×ì= û ûGûJûhûûûû«û±û¶û¶ûÑû×ûÜûÜûåûóûü(ü-ü4ü:ü<üYüiünüuü{ü}ü}üü–ü–ü–ü¦ü›ü·üÇüÙüÞüÞüÞüåüìüóüýý+ý+ý=ýÌL»°¥°¥Ê¥Õ¥à¥é¥ñ¥ô¥û¥ÿ¥¦¦ ¦%¦3¦P¦]¦l¦q¦}¦‚¦‰¦•¦š¦¦§¦Ÿ¦·¦À¦Ñ¦Ï¦Ç¦ß¦è¦î¦î¦ü¦ÿ¦§§%§,§0§5§L§d§m§{§—§£§£§»§Ì§Ì§Ó§ì§ø§¨¨¨.¨7¨>¨B¨M¨R¨Y¨v¨£¨ª¨®¨°¨»¨Ç¨Ë¨à¨â¨ó¨ý¨©©!©0©I©I©L©T©Y©Û©Pw‡×M×MóMNN.NKNfNlNuNƒN‰NŒN˜NŒ ˜a˜a¨aÌaÌaÚaÚaÚaÚaãaãaêabb"b"b-b-b;bKbKbYb_b_bwbwb}b£b (kq@Š@ŠNŠZŠjŠqŠwŠ @KWÇéÇéÕéÝéäéêêêêêê!$/4wàwà„à™àžà¤à"$).GàGàTàiànàtà#$#(àà&à<àAàGà$€ïK**4DZbl‡Œœ²ºÄßäú   " , 6 @ J T ^ h r | ’ œ ¦ ° º Ä Î Ø â ø  " , 6 @ J T ^ h r | † š ¤ ® ¸ Â Ì Ö à ê ô þ !!!&!0!:!D!N!\!%¤Cðœðœ "3EGNTdoy„›ž ²¸ÈÒÜãîž ž ž!ž!ž!ž5ž&$5:§à§àµàÊàÏàÕà'¤Di8ž8žNžUžjž{žžž–žœž¬ž·žÁžÌžãžæžèžúžŸŸŸ%Ÿ,Ÿ7ŸKŸSŸSŸiŸiŸiŸ~Ÿ((&,ò/ò/00000)0]e×L×LíLMMMM M*  ß>$>$`$h$n${$‚$ž$¤$¤$¤$±$³$¾$È$Ï$Þ$é$ï$ù$ÿ$%%%%%%%7%=%M%S%X%_%_%€%†%˜%«%±%´%º%º%¼%Â%È%Ê%Ê%Ê%Û%å%ê%ê%ÿ% & &&&&,&2&H&M&U&k&o&o&w&}&ƒ&&”&›&¤&¶&¶&Û&ß&å&ë&ý&''' '&',','.'2'8'>'D'I'I'I'I't'…'…'œ'©'­'µ'Ç'ç'ç'í'ð'ô'ú'ú' ((2(F(N(_(c(t(x(~(—(™(Ÿ(¬(®(º(Ø(Þ(é( )))#)))2)8)J)[)c)g)x)|)‚)›))£)°)²)¾)Ü)â)è)î)÷)ý)* *4*=*C*C*X*]*]*d*n*ƒ*ˆ*ˆ*ˆ*¥*§*Ä*Æ*ã*é*ñ*õ*ü* +%+++7+N+U+[+f+k+k+r+v+€+Ž++˜++¥+°+¶+Å+Ê+Ð+Õ+Ý+â+ñ+,,%,0,L,N,j,j,q,†,‹,”,¡,¦,¬,±,±,¸,¼,Æ,Ô,Ö,Þ,â,æ,ð,ü,---- -1-?-D-P-P-X-X-{-{-‰--”-˜-----£-¥-¥-È-Î-Ô-Û-ñ-ó-ó-ó-þ-þ-þ-.,/+4.w^É^ÉxÉ|ɔɜɤɮɲɹɿÉÓÉÛÉàÉãÉîÉùÉÊ ÊÊÊ/Ê6Ê=ÊHÊSÊUÊ`ÊkÊmÊyʂʂʘʣʻÊÁÊÊÊÛÊáÊêÊüÊËË -ËËËË0Ë;Ë?ËMËOËSËbËbËbËsËsËxËŠËËþË,Ô@ŽåŽå¤å«å®åÒåÒåïåææ(æ-æ-æKæYælææ‡æ‡æ‰æ‰æ‰æœæžæžæžæ¥æ¸æËæËæËæÞæéæüæççç"ç7çJçQçQçTçyç-LAP$$$!$-$H$M$m$o$Š$¥$¥$­$´$Û$.P~ŽÈŠÈŠÖŠãŠñŠ‹‹‹)‹7‹I‹T‹b‹h‹n‹/4 -66 6,6=6O6X6f6l60|ºU~ -~ -  -§ -µ -À -æ -æ -ï -ñ -ñ -ø - & & 5 D ` k k w   ™ ·  Ä Ý ã î þ   $ ) / 6 ^ c q z z   § § ¶ ¿ Ó Ú á æ ñ ÷ ÿ % . 5 : E Q ` t y   Ÿ Ÿ ¶ ½ Å Õ ç í ö ö   $4CUZj}…™·ÎÒÞõ#)4@P`enn€„§ÃÕÛæò$**/1166EKQQUÎ1ŒÄãÛÛ*Û6Û:Û>ÛEÛLÛ[ÛfÛlÛqÛsÛÛ†ÛŽÛ”ÛšÛžÛžÛ­Û´Û¼ÛÂÛÈÛÊÛÊÛÖÛ28 */*/8/>/J/U/f/p/w/}/3@t€'ë'ë5ë@ëGëfësësëvëxë~ë4ÌSÏÏõ#%,366HHZeyŠ’—³ÃØÝö     * > F O W \ c u … š œ µ Í Ñ Ñ å í ö þ  - - -/ -D -I -b -z -~ -‘ -‘ -‘ -– -¸ -Ú -å -ë -   + ? G P X Z ` r ‚ — ™ ² Ê Î Î â ê ó û    - B G ` x |    ” ¶ Ø ã é     % + 5 @ R b y  § ¾ ¾ Ñ ì ì ì  ++4>Kesz®½¶Õåÿÿ5D{ˆîîþ!337:B6\ObX‰X‰x‰‡‰‰™‰‰¡‰­‰²‰·‰·‰È‰Ì‰Ô‰ì‰ï‰û‰70üîãîã÷ãüãä äää8tÚ±¸¿Êààò  %R,ax‰¡¦»ÓØàäöé)--2C‹eš¸ÃÉÝõú ',3EUkm†ž¢¢·ÏÔÜàïâ"&5555HNX_r©¹ÇÇÛé÷  $CRKjz’¸©Þà   UZekv˜²ŸÁØé!2T‰v˜¶ÁÇÛóø %*1CSik„œ  ÂÛïó%,?ZZZv†””¨¶ÏÄâõú(!@Pa¡¡¨ËËËë9Dmz––¦ºÃÉÛÛßâê:lwŽß~ß~õ~  -00=R?ag€™²Ëäî;<‰”FFVgpvz…<”)>î>îFîJîVîgîiîyî„î–î¡î¬î»îÌîÓîìîðîïï ïï%ï.ï<ïPïlïqïŽï=d(=ˆˆˆˆ”ˆ¨ˆ«ˆ¿ˆÇˆËˆÕˆßˆçˆêˆðˆ>4u¾0F0FVFYF]FjFsF~FŽF–F FÈFÈFØFÝFÝFíFòFòFGGGGGG,G1G1GAGFGFGVG[G[GkGpGpG€G…G…G…GˆG‘GªG¸GÏGâGäGêGìGïGHHH HHH&H6HCH[HcHiHiH}H}H†H‰HII?Ä nªª¬ª´ª·ªŪÓªèªñª «%«7«B«S«W«i«l«w«€«Œ«Ÿ«ЫÅ«««à«÷« ¬¬%¬F¬[¬¬“¬•¬¶¬œ¬ѬÔ¬Ù¬ܬܬã¬ù¬­ ­­!­.­A­A­Y­]­Š­Š­¢­§­§­·­»­Ì­Ö­ç­ñ­® ® ®®®.®8®I®S®f®r®w®w®w®™®ª®¯®¼®Ñ®Ñ®Ö®à®ï®ô®ú®ÿ®ÿ®¯¯¯"¯(¯-¯-¯3¯9¯>¯>¯F¯Y¯e¯r¯~¯¯—¯¯¦¯½¯ѯâ¯ï¯ô¯ ° °6°C°K°Z°d°j°s°|°|°°°°°°‘°‘°‘°©°¿°ǰâ°ó°±±±±±± ±-±2±2±9±G±L±d±p±‚±ޱ”±œ±¢±«±ѱݱã±é±ø±²²5²F²S²U²c²c²h²h²o²}²‚²•²¡²­²³²¹²²DzDzDzDzDzß²ä²ä²ä²ä²ä²õ²õ²õ²õ²õ²õ²õ²õ²õ²õ² ³#³+³F³W³d³f³s³ƒ³ˆ³ˆ³ˆ³‘³«³·³¼³Þ³ê³ê³ï³ï³ï³ï³ï³ï³ï³ï³´ ´ ´ ´´!´&´&´1´C´[´p´‘´²´½´δÓ´Ó´Ó´Ü´µ µµ"µCµ\µdµlµzµ¤µ­µ³µÔµíµíµíµíµíµ¶H¶Q¶W¶]¶b¶k¶t¶y¶y¶y¶y¶ˆ¶œ¶º¶ʶжÕ¶Õ¶è¶ü¶"·5·;·;·@·@·O·c··‘·—·œ·œ·¯·÷é·ü·¸¸¸¸¸ ¸5¸=¸X¸i¸v¸x¸‡¸‰¸‰¸‰¸‰¸‰¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¬¸»¸ƸȸȸѸÓ¸Ó¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸ç¸é¸é¸¹¹¹¹¹¹-¹I¹a¹p¹|¹’¹¬¹¯¹¹¹Źë¹ º+ºOºQºdº’ºjº­º­º°ºÀºȺãºôº÷º» »+»C»C»n»q»€»”»µ»É»å»Ñ»¼¼4¼i¼g¼\¼Q¼B¼w¼w¼w¼z¼¼‚¼œ¼ª¼ؼú¼ú¼%½(½7½K½l½€½œ½ˆ½¸½¸½Ö½ ¾ ¾þ½ó½ä½¾¾¾¾!¾!¾(¾8¾Y¾e¾¸Á@À„°?Æ?ÆUÆYÆdÆkÆvÆŠÆŠÆ•Æ¦Æ­ÆºÆÆÆÓÆׯèÆèÆñÆöÆþÆÇÇ+Ç6ÇIÇIÇaÇaÇ|ǨǨǼǾǾÇÈÇÐÇÐÇÚÇâÇâÇâÇóÇóÇóÇùÇÈÈ È ÈÈÈÈ$È)È)È?ÈOÈYÈhÈmÈuÈuÈzÈzÈȗȧȱȹȿÈÎÈÓÈÛÈáÈáÈæÈíÈøÈ,É;ÉEÉMÉSÉhÉnÉsÉsÉsÉsÉsÉsÉsÉsÉsÉ~ɌɜɢɪɹɾÉËÉÓÉØÉØÉØÉàÉéÉòÉÿÉÊÊÊRÊZÊiÊsÊʓʘʘʟʲʺÊÏÊ×ÊßÊôÊöÊË ËËË&Ë7Ë?ËFËLËRËVË_Ëdˈ˔˜˱˽ËÂËÎËÙËÞËÞËÞËôËÌÌÌ/Ì7Ì?ÌTÌYÌdÌlÌ̶̪̆̆̾ÌÓÌßÌäÌðÌûÌÍÍÍÍÍÍ Í Í Í Í Í Í Í Í Í Í Í ÍÍ%Í(Í6ÍFÍLÍTÍcÍhÍpÍxÍz͂͑͗ͧͩ͟ͱÍÎÍ×ÍßÍçÍîÍÎ ÎÎÎ&Î0Î8ÎFÎKÎPÎbΖΞέηÎÑÎÙÎÞÎÞÎÞÎçÎðÎóÎýÎ ÏÏ Ï1ÏCÏCÏCÏNÏSÏpÏuÏuÏ~σσσσσσσσσσσσσσσσώϚϲÏÅÏÍÏÜÏáÏéÏðÏýÏÐÐÐÐ#Ð#Ð+Ð3ÐQÐYÐ\Ð^ÐnÐxÐxÐxÐzÐРУЦЮггмÐÁÐÉÐÐÐÝÐòÐùÐ -ÑÑ3ÑLÑaÑvÑ}Ñ}тттттттъѕѡѰѵѵѽÑÅÑÒÑ×Ñ×Ñ×ÑÛÑàÑàÑðÑõÑõÑõÑÒÒÒÒÒ4ÒCÒKÒ\ÒdÒ‡ÒҔҖҜңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңңҥҥÒÀÒÊÒØÒØÒÝÒèÒïÒ ÓÓÓÓÓ'ÓEÓSÓIÕAx[OÕOÕeÕlÕsÕ~Õ…Õ–Õ Õ§Õ±ÕÄÕÌÕÌÕçÕÖÖÖÖÖ%Ö.Ö5Ö8Ö=ÖHÖRÖdÖjÖ€Ö‡ÖÖ¥Ö¬Ö¬Ö¬ÖºÖáÖêÖòÖ× × × ××!×3×9×O×V×^×e×z׋׋גגגנ×Ç×Ô×Ý×å×÷×ÿ×ÿ×ÿ× ØØØØ#Ø=ØIØŽØBt`¹ŸÛŸÛ·ÛÇÛÎÛÕÛàÛóÛöÛþÛÜÜÜ&Ü1Ü<Ü?ÜJÜ`ÜkÜvÜ܌ܓܦܲÜÏÜØÜàÜÝÝ ÝÝÝ#Ý+Ý:Ý@ÝHÝHÝTÝbÝqÝy݈ÝݳݹݿÝÁÝÇÝÍÝÍÝÍÝòÝ÷ÝÞÞÞÞ+Þ/Þ:ÞTÞ`ÞpÞƒÞŸÞ´Þ¼ÞÆÞåÞùÞùÞmßC ?CO0O0Y0a0f0DÉÊYY(Y3YDY3Y^YlYlY|Y…YŒYY™Y™Y¡Y¥YÅYÓYßYåYðYZZ%Z0Z6Z=ZBZBZUZ`ZqZ|Z‡ZŽZ˜Z¥Z¥Z·Z¼Z¼ZÊZÏZÏZàZàZóZøZ [[[-[A[A[F[F[T[Y[Y[^[e[m[t[v[~[…[…[”[š[§[®[¶[Ú[Ú[â[ñ[ü[\\\(\-\2\2\2\E\J\Y\`\i\~\’\’\—\—\Ÿ\µ\º\Î\Õ\Ú\Ú\æ\õ\]]1]<]V]h]z]‰]¨]³]¸]Ç]Û]â]é]ü]þ] ^ ^!^/^=^M^T^k^r^~^^¦^¨^´^¿^Á^Á^Ì^à^í^õ^÷^ __$_5_C_e_l_x_–_–_–_ž_©_­_µ_¹_Á_È_Ø_ã_````#`+`0`0`?`L`Z`e`p`~`„`Š``™`Ÿ`®`Æ`Î`Ú`è`ÿ`a -aaa#aAaGaMaSa\ama”aœa¦a´aÌaÓaßaîabbbb'b-b-b-b-b7cEDQ^O}O}c}p}†}r}•}—}¯}Ç}Ï}FœfÉÇSÇSéSóST*T5TNTSTWT_ThTwT~T‡TŒT¡T²TÑTÙTÛTúTUUU$U)U0U8U>U@UQUVUlUXU{UUU‰U’U¡UÀUÇUÉUèUïUïUïUVVV V-VCV8V[V`VqVvVŒVxV›V¡V¨V°V¶V¸VÉVÎVäVÐVóVùVùVW -W -WWW,W\WeWqWuWƒW™WŽW±W±WÃWG ;z×à×àöàÿàáá*á,á5á:á[áyáˆá¦áºáÒáÙáÿáâ,âIâZâqâuâuâyâ~âƒâââšâŸâ¸â»â»â»â»âÀâÆâââðâüâãã!ã*ãFãQã]ãfãzãzã‰ãŽãŽãœãHP‡——A—A¸A¥AÚAÇAéAøAB B BB#B#BEBKBIPÅÕoúoúƒúˆú—ú—úžúËúáúÍúþúðúûûJŒ¥ÄçøçøùFùFùYù]ùù“ù˜ù˜ùŸù§ù¯ùÄùÐùáùæù÷ù úúúúú.úLúLúiúKP­g<g<<’< <¦<Á<Ð<ß<î<ü<= -==Lè7§.§.Ò.Õ.Ø.Þ.ã.ú./(/L/h/k/Š/¤/¶/Ã/Ù/ì/ñ/ü/0000003090X0w0y0Ž0”0³0Ò0Ú0å0å0ï0ï01?1W1i1M$ o[o[š[ƒ[¤[¬[NLx‡þËþËÌ%Ì6ÌGÌNÌVÌfÌq̺̂̈ÌOTHYPdPdbdddmdvd„d‰d’d•dšd¨d²dµd¿dP¨!G¨b¨b¸bÁbÔbábíbùbcc(c(c7cBcKcRc[crc‰cŽc c¯c»cÍcÍcÖcùcùcûcdd*d6d9dPdQhî„@o@oYodoto½oÄoØoßoçoïoøopp -ppp!p(pGp_phphppÇpÐpòp q)qSq_qqƒqŠq‘q‘q´qÐq÷qr:rVr}r™rÀrÜrs sFsFsUsbsgsgsvsƒsˆsˆssšs¬sÄsÜsôsösösösýsýs -tttt t.tAtVt’t™t™t™t¡t¾tÌtêtótüt uu1uMuMuMu_umu‰u§u§u§u²uµuäuæuýuvvv v,v.v;v=vJvJvnvpvwvˆv‘v“v¡v£v±v³vÁvÁvávávávávw5w[wcwgwowswww‘w™ww¡w©w·wÅwÅwßwêwxx4xMxXxbxix‚xŽx•x®x®xÀxÅxÇxÍxÞxïxþxyy y!y/y1y?yAyOyOyOysysy’y™y y£y¯y²yÀyÄyÒyÖyäyèyèyzz zz.z5zPzpzƒz’z”z£z¥z´z¾z¾zÌzÕzëzòz{{E{u{z{ˆ{Š{˜{¡{»{½{¿{Æ{×{à{â{ð{ò{||||0|0|0|0|0|O|O|O|Z|v|›|´|¹|¹|¹|Û|à|à|à|}}}}$})})}0}2}2}:}<}<}C}C}F}K}j}€}¥}Á}Õ}Ú}Ú}õ}~~~~6~8~8~=~8~^~`~`~h~c~£~£~£~Â~Â~Â~ã~è~è~è~ -/444SXXsƒ’›µ··¼·Ýßßçâ"€"€"€-€-€W€W€€™€±€¼€Ò€æ€ÿ€/MO`}”›“…R| $ÿæÿæç+çAç[çsç~çšçšçšç§çÂçÄçÄçÄçÑçìçîçîçüç è$è$è4èFèSædÖÛÖÛðÛùÛÜÜ Ü'Ü/Ü7Ü?ÜEÜRÜRÜlÜqÜqÜwÜ|Ü|܂܇܇ÜܒܒܪܽÜÃÜÈÜÈÜÑÜñÜñÜñÜøÜúÜúÜÝÝÝ Ý ÝÝÝÝÝÝ Ý!Ý!Ý'Ý'Ý.Ý.Ý6Ý<ÝBÝJÝJÝJÝJÝVÝ^ÝfÝnÝvÝ~݆݌ݤݳݽÝÀÝÀÝÊÝÐÝÖÝÖÝÚÝâÝéÝíÝõÝýÝÞ ÞÞÞ"Þ&Þ,Þ7Þ=ÞJÞVÞ\ÞdÞhÞoÞwÞÞƒÞ‰Þ‘Þ˜Þ Þ¨Þ¬Þ²Þ½ÞÂÞØÞéÞîÞñÞ–ßTL”£h†h††ƒ†Š† †°†¶†Î†æ†é†û†C‡UÔ*[ŽïŽï¢ï·ïÆïÊïØïáïðïðïÿï -ðð ð'ð7ðNðeðkðpðtð‡ð‡ððŸð©ðÍðØðÚðóð÷ðñ -ñ -ññ ñ(ñ;ñ¥ñV$/[/[Z[C[d[l[WPÍÝ¿D¿DàDÍDEïDE E(E3E5E@EKEKEmEsEX,fÖfÖoÖuÖ}Ö†ÖÖ”ÖYßß#0cp‚¢²²¿¿ÆÙ×ççòü‘‘ ‘‘ ‘8‘?‘B‘W‘\‘g‘r‘Œ‘¦‘·‘½‘ÑÊ‘è‘Бñ‘÷‘ý‘’%’ ’.’4’:’B’B’I’g’O’p’v’|’„’¤’Œ’­’³’¹’Á’Á’Á’×’×’×’×’â’ì’õ’“!“2“7“H“\“a“a“l“t““ˆ“”“¨“¸“Í“â“ÿ“””””$”/”?”N”k”€”•” ”¥”¥”°”Æ”Û”ç”ø”ý”•"•"•-•"•E•J•J•Y•^•^•m•r•r•ƒ•ˆ•ˆ•™•ž•ž•±•À•ŕŕؕç•ì•ú•ì•––!––5–:–H–:–\–a–o–a–ƒ–ˆ–ˆ–¥–ª–Ì–Ñ–ß–Ñ–ó–ø–ø–——<—A—O—A—c—h—h—…—Š—¬—±—¿—±—ӗؗؗõ—ú—˜!˜/˜!˜C˜H˜H˜c˜h˜h˜ƒ˜ˆ˜ˆ˜£˜¨˜¨˜ØȘȘã˜è˜è˜™™™#™(™(™C™H™H™Y™^™^™o™t™t™€™‹™ ™¥™¥™±™Ê™Ï™õ™ü™š šš&š;šFšKš\šgšoštštšxš|šƒšš—š—šªš¯š¯š¯š³šÌšÕšÕšûš››››%›?›L›W›b›m››‹›”›™›™›™›ª›Ç›Ò›Ü›ç›ì›÷›ÿ›œœœœ œ+œ;œSœkœœ„œ„œœ¢œ¬œ·œØœäœõœúœ $/7<GWfƒ˜­¸½ÈÐÕàðÿž1žFžFžFžFžKžPžPž\žmžmž’ž”ž±ž±ž»žÏžÙžÛžçžïž ŸŸ'Ÿ2ŸUŸfŸwŸˆŸ“Ÿ«Ÿ»ŸÀŸÀŸËŸППØŸãŸèŸèŸðŸûŸ   )   A F F N o X V ‡ Œ   Œ ¸ ½ ½ Ê Ï Ï × Ü Ü î ¡¡¡¡¡1¡6¡6¡>¡C¡C¡V¡[¡[¡n¡s¡s¡¡¡¢¡¢¡¼¡Ì¡Ñ¡Ñ¡ë¡û¡¢¢¢*¢/¢F¢/¢^¢c¢c¢n¢s¢¯¢¢‹¢s¢Ç¢Ì¢£ö¢ä¢Ì¢ £%£%£4£D£I£I£X£h£m£m£|£Š££·£¥££Ï£Ô£ü£ê£Ô£¤¤A¤/¤¤Y¤^¤^¤{¤e¤¥¤µ¤º¤º¤Õ¤Á¤ÿ¤¥¥¥ ¥%¥%¥1¥6¥6¥I¥Y¥^¥^¥q¥¥†¥†¥™¥©¥®¥®¥Á¥Ñ¥Ö¥Ö¥Þ¥ã¥ã¥ë¥ð¥ð¥ø¥ý¥ý¥¦ -¦ -¦¦"¦"¦5¦:¦ˆ¦v¦d¦R¦:¦•¦š¦è¦Ö¦Ħ²¦š¦õ¦ú¦ú¦ §$§)§)§:§U§Z§Z§k§y§~§~§†§‹§‹§“§˜§˜§ §¥§¥§ݧ˧¹§¬§ü§¨¨¨T¨B¨0¨#¨s¨ލ“¨Ȩ¶¨«¨“¨à¨å¨©©ý¨å¨2©7©Q©;©7©i©n©‹©u©n©£©¨©¨©´©Í©Ý©î©î©ªª+ª1ª1ªNª[ªŒª½ª«ªàªèªèªèªôªùªùª ««!«&«1«;«@«@«Z«_«_«g«l«€«l««š«Ÿ«³«Ÿ««Í«Ò«Ò«Ý«î«ó«ó«þ« ¬¬¬ ¬$¬$¬>¬I¬N¬Y¬N¬h¬m¬¬m¬¬•¬ ¬•¬¯¬´¬Ȭ´¬׬ܬܬð¬ܬÿ¬ÿ¬ÿ¬­­­#­(­(­4­(­G­L­L­X­L­k­p­p­|­p­­”­¨­”­·­íέÙ­Þ­ò­Þ­® ®®#®(®<®(®S®K®\®a®a®i®n®n®w®|®|®…®Š®Š®“®˜®˜®£®¨®¨®³®¸®¸®îȮȮӮخخã®è®è®ó®ø®ø®¯¯¯¯+¯6¯A¯L¯Q¯Q¯[¯`¯`¯j¯o¯o¯y¯~¯~¯ˆ¯¯¯•¯š¯š¯§¯¬¯¬¯¹¯¾¯¾¯¾¯¾¯¾¯Ư˯˯Ó¯ددà¯å¯å¯í¯ò¯ò¯ú¯ÿ¯°ÿ¯"°3°8°8°?°J°j°o°…°°©°•°¸°ðΰÓ°Ó°Ú°å°± -± ±+±D±0±S±^±i±n±n±u±€± ±¥±»±Ʊß±˱î±ù±² ² ²$²²3²S²X²n²y²’²~²µ²¡²IJϲÔ²Ô²ï²Û²þ²³#³9³D³]³I³€³l³³š³Ÿ³Ÿ³º³¦³ɳé³î³´´(´´K´7´Z´e´j´j´y´~´~´´’´’´’´˜´´´´§´©´©´³´º´Ý´ß´ß´é´é´é´é´é´ë´ë´µ µµµ µ%µ,µ7µBµMµGµhµ…µzµµµ«µ¥µѵƵéµéµéµòµùµ ¶¶ ¶2¶2¶Q¶\¶s¶“¶“¶“¶´¶ĶÙ¶ë¶û¶û¶ ·'·6·H·H·L·Q·X·h·‡·‡·‹·¢·©·®·®·²·½·É·×·¸ ¸¸,¸_¸k¸p¸†¸ž¸ª¸»¸À¸Ѹð¸¹G¹J¹Z¹\¹\¹`¹¹йй¹ž¹Ϲò¹ò¹õ¹¼Z, –Ö–Ö¤ÖªÖ®Ö·ÖÀÖÆÖ[`BVï‡ï‡ˆˆˆˆ-ˆFˆJˆPˆfˆƒˆ…ˆ…ˆ¶ˆ¤ˆ…ˆÕˆ߈\8 -¿Z¿ZàZÍZïZúZ[[['[-[]\’8 8 F H S [ f q | ~ ” ” ¦ ² » ¾ í ^øª¤ïìïìíí&íRíRí]íjíˆíí½íÂíëí î'î-î1îTîzîî¨îÅîëîïï ï%ï-ï2ïCïKïjïpïtïï•ï´ï¹ïÊïÒïñïöïþïðð ðð&ð+ðIðNð[ð`ð`ðmð…ð”ð¡ðÁðÁðØðÝðÝðôðöðöð -ñ ñ ñ#ñ%ñ%ñ<ñ>ñ>ñUñUñjñoñoñ~ñ~ñ·ñÐñÐñãñèñèñèñèñò/òKòKòKòXòoòqòqòqò~ò•ò—ò—ò¤ò»ò»òÒòÔòïò ó ó óóóóóóóóóó'ó,ó,óHóHóHóPóUóUóUó]óbóbójójóló–ó˜ó¸óØóØóØóØóØóòóõó -ôôôô/ô1ô=ô=ôEôWôWôcôvôô—ô¿ôÑôíô õ.õBõ`õ…õ˜õ·õÝõöõöö7ö<ö<öpöuöuöˆöˆö”ö¦ö«ö«ö¿öÝö÷÷4÷Z÷{÷Š÷¸÷Ê÷Ô÷ö÷ø÷ø÷ø÷øøø"øRøTøTøcøcøhøhøhøhøhøø„ø—øæø_\ -PP!P7PSP`PwPŠP•PªP—P¹PÁPÌPâPØPúPQ`øAG;G;e;h;o;v;};;ƒ;Š;‘;•;™;¬;Ô;ï;Ü;< <0<0<<<D<S<<’<¿<Ç<Ì<Õ<á<é<ð<==:=<=^=j=Œ=’=™=™=Ÿ=¢=¦=·=Ú=ì=a$ŸßŸß®ßÉßÉßÏßb|Xs ê ê9êeêeê„ê”ê–ê–ê–ê–êê¥êÀêÙêÛêÛêÛêãêþêëë -ë -ë"ëc”"§4§4É4Ó4ß4ä4ô4ú45#535A5O5f5n5x5‡55œ5¤5§5§5§5©5¸5Â5Ë5Ó5Ö5è5dôÍ/8/8X8e8h8q8w8Ž8¥8¼8Ç8ý89"9'929L9^9k99—9®9³9Å9Ê9Í9í9 :::":B:b:j:r:t:”:œ:¡:¦:±:±:¼:¼:È:È:Ú:;3;3;C;ed¤¹ Œ Œ0Œ7ŒCŒIŒQŒ_ŒrŒ~Œ˜Œ¥Œ¥Œ¨Œ¶ŒÆŒàŒäŒìŒf(¸þr*r*ˆ**¡*Ð*à*ç*÷*+ -++8+b+s+++ˆ+˜+¤+´+½+Ô+Ô+ê+ê+,,,,,,,,B,B,X,X,n,n,„,„,›,›,²,²,É,É,à,à,÷,÷,--%-%-<-D-O-`-k-|---˜-Ÿ-á.g¬÷8>EMUXcuuŒ“–˜¤µµ¸ÀÖÙçêíôø   3 6 … h(ÅË ‚ ‚F‚3‚U‚g‚o‚iCÏPÏPòPQ QQQ$Q1Q7Q@QFQKQSQoQuQwQyQ†Q†Q“QˆQ¤QªQ¬Q®Q»Q»Q»QÀQÉQÑQÚQâQäQìQôQüQ RRR!R1RüKüSü^üZüuüƒüƒüƒüŽü©ü”ü±üÄüÆüâüÎüêüøüøüúüýýý#ý,ý3ý6ýXýlý_ýtýzýƒýƒýƒý–ý›ý›ý£ý£ý®ýÃýÌýÌýÌýÌýèýÿýþ -þ -þ þ%þ*þ*þ6þSþsþxþ}þ}þ‰þ¦þµþÄþÌþÑþ×þÜþÜþãþêþ ÿ*ÿ,ÿIÿ^ÿ^ÿdÿdÿqÿzÿzÿ˜ÿ®ÿ¹ÿ¾ÿËÿÖÿßÿçÿ÷ÿ06_hhjqvvƒŽ”°½ÏÚèñö )49@H[pu|‰¢·¾ÄÍÍÖð÷ü -((.5>>Qcffw‡“°·ÄÆÍáððð''<GYfqŠ™  ¹ÌÎÝòô&&39KKX[fxŠ—ž©®ÃÅßôôôöý"44:AJOs||‚‹‹ªª·ºÃÌÔßñ÷$,7IOZZgjs|~ ³ÈÎÙëñùùùù} -|”¾R3R3f3j3s3v33ˆ3š3š3Æ3Ê3Ï3Ò3Û3ë3ò3õ3ý34 444%4,4<4<4H4}`2QQ/QQ>QcQOQrQwQ~Q†QQ˜Q Q«QÁQ¶QÙQáQ~À-ØfØföfggggg$g6gCgFgHgQg^g^glg€g€g¤g±g±gÁgÎgÎgñgþgþgh5hJhlhuh‚h‚h¥h¯h¯hâhiiii-i¸ºäðŒðŒ -'*DDDJNVauƒƒŒŽŽ—™™¢¤¤­­¶¼¿ÉÚàììTŽ€œøW(W(u(†(ž(¥(Á(¶(Ù(ù(å()))?)+)W)t){)—)Œ)¯)Ï)»)Þ)ï)*ñ)*****B*B*L*œ¢ç2ç2ó23383h3y3Š3œ3£3ª3¾3Å3Ó3ë3ú34 -4#4&4+4B4R4b4f4m4£4‚x± P°P°f°m°t°“°¢°±°À°Ï°Þ°è°è°í°ô°±±±6±P±P±f±x±|±Š±‘±–±–±±¯±¸±º±È±Ú±Ú±Ú±ì±÷± ²²!²&²6²;²K²W²\²i²n²~²ƒ²“²•²¥²§²·²¹²Ê²Ó²Ó²Õ²å²ì²ü²ü²³)³;³M³]³]³]³`³s³ƒ\åøXŽXŽsŽzŽŽŽ¢Ž©Ž³ŽÁŽÄŽÆŽÐŽâŽâŽéŽ „0ÎÖff~¾²ˆ†ÒÚ…`,ï…ï…†††(†7†P†T†Z†p††††À†®††߆醆L[j_1_1m11…11Ÿ1¥1®1À1Æ1É12‡(–œ"3"303?3C3F3L3ˆ\k~222'2-252G2M2V2h2n2w2‰22’2à2‰, >Ö>ÖLÖSÖ[Ö`ÖfÖŠ„   =OV]lq““˜ºÏ¼Þíï <2T^‹`Bÿgÿgh$h+hPh^h`hnh{hhŒh£h²h½hÁhÌhØhßhëhii,iCiMi[imioi}iii˜i©i¯i¿i¿i×i×iüiüijj -jj#j/jDj[jjjuj‡j“jªjÂjãjãjìjñjñjñjñjk -kkk%k3kCkHkHkVkVk[k[kekpk‚kˆk”k¤k¯k¹k½kÆkßkâkòkùkl l l/l?lOlVl\lhlpl{l‚l†l™lŸl¬l·l½lÍlÝlÝl -m(m4mHV×V×_×_×m×q×x×{׀בDDQg0g00”0ž0¥0±0É0Ò0Ö0è0î0 1’Ä{¨çÿçÿ &(-33ELbu„ŠŒ“™££·¹ÀÆÐÐÐçù'::L“0RZ111>1O1U1U1]1”„\y¦ñ¦ñ¸ñÍñ×ñàñâñéñùñòòòòò*ò-ò-òQò\ò^òwò~ò‚ò‘ò¤ò÷ò•  -^/^/g/„/‰/–húWeWemexeƒe‘eœe¥e¶e¿eÐeÖeâeùeùe ff)f2fCfIf—f—„a~¯K¯KßKåKîKúKL L LLLL"L:LdLiLL•L—L¯LÇLëL -MM˜lò '9@Gik¢Ä±ÓÓåì™ y}¨Š¨Š±Š½ŠÂŠš(A~ç~ç ç¨ç®ç¶ç¸ç¸çÉçÉçÉçÑçÙçëçúçëçèèè+è-è-è8è=èWè\è\è\èqèsè€è‚èè‘èžè¦è®èµèÄèÑèÓèäèñèñèñèúè é é%é-é/é<é<éQéQéQé\éfé~éƒéƒéƒé‘é—éœé¤é¯éÁéÌéÑéÑéØéÜéêéîé÷éþéê)ê0ê9êUêZêZêZêZêbêmê{ê{ê›ê›ê›ê¢ê°ê¿êÒêåêçêçêçêúêúêëë ëë%ë/ëKëuë{ë{ëë”ë¸ë¿ëËëéëüëììììììì'ì5ìWìbìì‰ì‰ì—ìµìåìøì í í3í8í8í8í@íKí]íhímímímíí©í¯í¯í¯íºíÄíÐíÛíÝíÝíÝíâíîíîí8î›H%‚/‚//—/¢/¯/º/Â/Â/Ú/ä/ê/ð/œ0 —O—O¾O«OÍOéOßOP PLÝì§&§&Á&Ö&ì& 'ú&%'*'U'v'c'Ž'¦'¦'°'žð· M MTM]MiMqM|M›M›M¥M§MÂMªMÑMÑMßMéMðMNN,N3N3NONONvN{NšN³NÐNÓNÛNâNOOO%O%OAOAO^O^O…O—OŸTVgÎÎäñ÷ý*<@FTWa 0 -RF;gSŠv™¥ª¶ÆÍÚåñü .59DITmv‚‡›¢¦¦«ÄÉâ÷ !!!#<Q\fqs~††–‹®Î¡àZŽÀdÀdÚdèdídúdee,e:e_ehexe“eže®e°e²e¼eÈeÌeÙeåe÷eÿefffff f>fXfXf_fbfjfvffÕf¢d1O*O*m*…*–**¹*®*Ñ*ñ*Ý*++'++?+L+L+d+d+n+£ü!\__w‰”Á§›Ðñó;!Jgggy––ËâÖ, TBc„œ‰·«ßÍî   ::[b„„Œ¤(ŽäŽäœä¿äÅäÊäÊäÐä¥(!'ÆÖÆÖÏÖÝÖãÖåÖêÖ¦D]j99*919:9F9[9c9i9o9q9q99§„¼Ùà©à©ª ª#ª+ª3ª7ªBªFªJªNªVª[ª_ªpªªƒª‡ª˜ª©ª¸ªËªÓªÞªÞªÞªðª¨€è›è›œœœœœ,œ7œAœLœcœfœhœƒœœ—œžœ©œ»œÃœÃœÙœÙœëœ© Ê ÇWÇWíW -XXX-X6X:XUXkX„XŠX’X•XªX¯XÁXãXéXñXöXüXÿXYY YBYJY_YdYsY•Y›Y Y Y Y­Y¾YÉYÖYâYõYZZ&Z:ZDZFZ]ZqZvZZˆZ«Z«Z«Z½Zª°)8¢8¢[¢h¢m¢q¢z¢‰¢•¢ ¢«¢³¢¾¢Æ¢É¢Õ¢Ý¢÷¢££-£6£k£W£{£{£“£ž£º£Á£å£¤¤¤¤¤«˜‹-&¸&¸C¸J¸R¸]¸t¸~¸~¸•¸Ÿ¸º¸Ð¸Þ¸â¸¹¹*¹1¹5¹N¹X¹i¹v¹v¹}¹„¹‰¹Ž¹“¹š¹¡¹»¹Â¹Ò¹Ö¹Ö¹à¹ö¹ú¹ú¹ ºº1º1º7ºBºIºQº\ºcºkºvº}º}ºˆº¦ºªºÂº³ºÝºÝºãºêºùº»»»»»0»0»0»B»J»p»~»~»‚»—»Ÿ»¯»º»Ï»Ô»â»ñ»û» ¼¼¼¼%¼)¼8¼:¼I¼K¼Z¼\¼k¼r¼v¼Š¼”¼¢¼©¼­¼½¼È¼Í¼ë¼õ¼½ -½½½&½-½1½;½O½W½b½f½f½f½q½|½Œ½˜½®½¶½Á½Ð½Ø½ã½è½ð½û½¾ ¾¾¾/¾7¾B¾B¾B¾B¾_¾|¾ˆ¾¾ ¾°¾Î¾Ò¾¿ö¾ç¾¿¿¿"¿1¿@¿J¿X¿_¿c¿e¿t¿~¿Œ¿“¿—¿—¿™¿«¿«¿½¿½¿½¿Ï¿á¿é¿À-À;À?À]ÀdÀkÀvÀŒÀ‘À˜À«ÀµÀÃÀÊÀÎÀÐÀãÀíÀûÀÁÁÁÁÁÁ Á.Á8ÁFÁQÁUÁUÁZÁbÁfÁuÁwÁ†ÁˆÁ—Á™Á¨Á¯Á³ÁÇÁÑÁßÁæÁêÁúÁ -Â(Â2Â@ÂGÂKÂUÂcÂjÂnÂxŒ”Ÿ£££®µÂÃÂÝÂíÂøÂ ÃÃÃ-Ã9ÃOÃWÃbÃqÃyÄÉÑÜèì÷üÃÐÃØÃãÃãÃãÃãÃ÷ÃÄÄ)Ä-ÄAÄRÄgÄtÄxĆěīÄÂÄÛÄôÄöÄÅ Å ÅÅ/Å@ÅWÅpÅ~ʼnŕÅşŪŲŲŲÅÏÅÝÅëÅÆÆ(Æ5ÆUÆ\Æ\ÆlƀƚƚƞƴÆÃÆÞÆéÆÇÇÇ-Ç-Ç@Ç[ÇdÇ{ǕǤDZÇÑÇßÇõÇÈ!È9È9ÈQÈQÈ]ÈxÈșșșȥȶÈÎÈ×È×ÈÞÈçÈíÈùÈXɬ<ùD EQ\flv|†”ž°ºÀÊÐÚáíóü'69;EWas}’’•Ÿ´¹ÉÔÙíï‘#‘#‘-‘B‘P‘Y‘a‘o‘€‘‘¡‘®‘®‘»‘»‘Ñё’­$› _O_OsO{O†OŒO®l£:§E§EÀEØEèEFF2FMFMFwFFƒF†FŠFF™FœF£F©F°F¶FºF¿FÉFÚFáFèFêFîF÷FGGGGG/G:G@GGGPGiGzGƒGŒG”GŸGªG¶GÇGØGäGòGôGûGHH HH HBHPHZHdHmH†H—H H©H±HºHÀHÄHÉHÍHÚHáHïHùHII!I:IKITI]IeInItIxI}IƒII—I¶IÄIÊIÏI×IßIçIôIüIJJ0J9JTJhJ{J‚J‹J”J›J¤J­J¶JÏJ¿JßJãJ=K¯   ‡ ‡®‡Ð‡Ö‡°¸·z'z'ˆ''È'Ê'ÿ'*(*(:(?(?(S(X(X(t(y(y(™(ž(ž(²(·(·(Ô(Ô(â(),)L)^)p)‚)’)’)’)’)™)r*±$bgÊ%Ê%Î%æ%ø%&²ƒ¿Á¿ÁÑÁàÁàÁãÁìÁøÁøÁÂ$Â6Â=ÂAÂQÂqƒ‰˜¡¥«´ÂÊÂÎÂë ÃÃ!Ã0ÃBÃNÃPÃ\ÃdÃhÃnÃwÃwÃwÉÔÚð÷ÿÃÕÃÜÃÜÃÜÃêÃÄÄ"Ä4Ä<ÄEÄPÄVÄlÄsÄ{ĂėĨĨįįįĽÄäÄñÄúÄÅÅÅ%Å%Å0Å7ÅEÅIÅUÅmÅuÅ{ŊœŗşŨŨŶžÅÄÅáÅêÅòÅøÅþÅþÅþÅÆ ÆÆ#Æ)Æ/Æ/Æ1Æ;ƳxØØØ²Ø¹ØÄØÚØÙ Ù'Ù?ÙEÙTÙ]ÙeÙmÙoÙuÙ{يْ٘ٚ٠ٴ¤Ôydd2d:dJdRdvdd‘d™d¡d§d°d¼dÄdÄdÌdüd;ee^eceke{e}e«e±eºeÁeÉeÑeÝeåeíeff ff7f>f@fJfYfyf€f‚f¢f©f©f©f²f¹fÒfØfàfàfåféfõfþfgg6gDgrgug‘gžg²gÌgÐgïgýg h7h=h?hmhphphŒh™h­hÇhÏhÓhÞhæhöhøh&i)i1iAiCiqiwiwiiiŒi½iÅiÅiÅiÅiÎiÚiði jj#j/j6j6jIjMjMjMjTjYjljsjj†j†j j¢j§jºjÁjÍjÔjÔjájëjëjðjkk%kµà˜ÌOBOBdB‚BoB·BB‘BÆBÕBÝBèBêBõBCCC:C?CtCŒCyC®C›CÂC½CÞCíCõCDD DDDD>D@DaDaDhDmDD‘D³D³D³D»D¶\æùgdgd}dd•d d®dºdÑdÑdãdédôdeee*eVe·ÛÜïï  '.59;BIMMUnxxŒ—¥¶º¿Ó×àäéï   1 6 O ` d d d i t ~ … ˜ œ ¡ µ ½ Æ Ê Ì Ó å õ   ' : > > > R V _ c h n ‹ ‹ ™ ° µ Î ß ã õ õ õ ú  !-!O!Z!`!v!‡!Œ!—!«!¯!¸!¼!¾!Ä!Ý!Ý!ë!"""."2"2"9"L"P"b"g"{"ƒ"Œ""•"œ"²"Â"Ù"Þ"÷" -## # # # #%#G#V#z#…#‹#¡#²#²#²#¹#Ì#å#å#å#ô#ô#$$)$:$?$E$O$Q$]$]$d$o$„$†$‘$¦$²$´$¿$Ë$Û$â$é$ó$û$ÿ$%% -%%%(%*%/%7%;%=%=%F%S%i%‰%£%±%½%Ä%Ä%×%Û%Û%Û%â%ç%&&&"&"&<&>&C&]&k&w&~&~&‹&•&•&§&¸  ¿£PIPImI|I|I|I™I™IªIªI°I²I²I¸IºIºIÀIÂIÂIÉIÍIÒIÒIÒIÒIÒIÒIÚIòIòIJJJ)JAJCJbJdJƒJˆJ§J¬J²J²JËJÎJõJKK:K:KCKHKfKTKlK{K€K‡KK£K«K³K¸K¸K¸KÁKÚKàKàKùKL$L=L?LGLMLULZLZL`L`LiLzL|L‘L“L›L¡L©L®L®L®L®L¼LÓLÕLéLéLñL÷LÿLM MMM$M*M,M,M,M4M4MBMYM]M_MkMmMˆMŽM–M›M¤M¯M³M¹M½MÆMÉMÉM×MèMêMN/N5N=NBNKNPNPNUNWN_N_NzNŒN‘NN£N¦N½N¿NÂNÒNÖNÝNæNõNO OOOO#O#O+O8OPOUO_O‡O’OO¨O³O¾OÉOÔOßOêOêOêOòOûOP"P?PXPZP`PbPePpPrPrPxP~P~P†PP•P¡P¡P¨P«PÊPÕPÝPåPêPêPñPõPúP QQQ%Q%Q2QYQYQbQpQQQ”Q¢Q±QÇQÍQÒQÒQ×QíQùQRRR$R2R9R;RDRDRNR\RhRR•R¬R²R´RËRÐRÐRðRðRSSSS S.S3S3SJSPSRS]SoS…S…S™S©S»SÀSÌSÒSÕSìSîSñST TTTT4TFTKTWT]T`TwTyT|TŒTT˜T¦T«T°T°T¶T¾TÃTÃTÉTÉT×TÝTãTíT÷TUUU U)U)U+U3U8U=UBUBUHUPUUUUUZUeUjUoUzUU¥U§U¬U±U¶U»UÀUÅUÊUÊUÏUÔUðUúUV"V(V0V0V>VDVJVTV^VlVV„V†VVŸV¤V¤V¤V¬V±VºVºV¿V¿VÅVÍVÒVÒV×VâVçVìVñVWWWWW%W+W1W;WEWSWhWkWmWwW†W‹W‹W‹W“W˜W¡W¦W¦W¬W´W¹W¹W¾WÉWÎWÓWØWçWçWøWþWþW XXX"X,X:XOXRXTX^XmXrXrXrXzXXˆXXX“X›X X X­X³X³XÁXÇXÍX×XáXïXYY YY"Y'Y'Y'Y/Y4Y=YBYBYHYPYUYUYbYhYhYvY|Y‚YŒY–Y¤Y¹Y¼Y¾YÈY×YÜYÜYÜYäYéYòY÷Y÷YZ ZZZZZZ$Z8Z=Z=ZCZMZSZXZXZaZoZxZ†Z‹Z‹Z”Z¢Z®Z¿ZÌZÓZÛZåZóZóZøZøZ[[[[ [ [[[[$[*[,[5[D[L[Q[W[W[_[h[v[[†[Œ[”[™[™[™[™[™[™[™[™[™[™[²[¸[Á[Ç[Ï[Ô[Ù[â[í[ö[þ[\\\ \\\\\ \ \(\6\B\K\Q\Q\Z\p\p\v\\•\•\ž\ \¦\¯\Å\Å\Î\Î\Î\×\Ü\Ü\ä\é\é\]] ]%]+]5]=]B]B]B]V]_]e]w]]]‰]‰]‘]“]“]¬]¶]¿]Á]Á]Á]Ç]Ë]Í]Í]Í]Í]Ò]Ø]Þ]â][a¹Ìz©'k'kIkTkjk†k“kªk½kÈkÞkÊkíkõkõkll ll.lClRl]lplvlvlvl{l€llšl´l¶l»lÊlÕlâlìlìlúlº”*K€¤€¤˜¤Ÿ¤¦¤©¤²¤µ¤¸¤¼¤Á¤ã¤Ð¤ó¤û¤¥¥¥¥!¥*¥0¥3¥D¥b¥s¥~¥°¥»à.¢·A·AÕAàAñAôAøABBB%B;BLB]BoBBBŸB°B¿B¿BÍBÑBÕBÚBÞBëBòBCCC#C1CJCLCPCZCZC_C_C_CdCdCsC|C„CšCšCšCŸCŸC·CÃCÎCÓCÓCÖCÛCÛCúCDDDDDDD:DFDRDTDTDWDYDYDfDhDhDkDkDtDzDD›D›D›D›D›D›D›D›D›D›D›D›DD®DÀDÏDÞDÞDâDâDêDEE E§E¼,ÖÖ$Ö+Ö3Ö8Ö>Ö½l3JçQçQýQRR&RKR7RZR_RfRfRlRoRsR{R“RžR´R©RÌRÖR¾PQaâ$â$ð$þ$%%&%+%H%N%U%\%j%v%ˆ%Ä%¿D+ÖäÖäêäøäþä!å'å-åRåXå^ådådålåÀô#œï5ï5÷56 -66$686G6d6q6ƒ6¥6Í6Û6÷6 7!787C7d7‚7‘7¬7·7Ò7ë7ë78/8I8d8v8…8”8”8Ÿ8²8Ã8Ö8æ8ó8ÿ89+9+9393939D9Q9X9w9€9‘9•99¨9À9Ø9á9ñ9ù9þ9":2:B:M:a:f:n:”:–:¡:Ô:î:î:;;;,;5;=;O;q;y;;Œ;Ž;ž;¶;Î;æ;þ;<'<0<9<K<Y<]<a<Á ؇؇ᇈˆÂ\ˆ[¾Ì¾ÌØÌßÌìÌ÷ÌüÌÍÍÍ2Í8ÍVÍlÍwÍ}ͯ͟͟ÍÄÍÆÍÉÍÕÍÝÍåÍíÍûÍÎ -ÎÎÎÎ*Î0Î5Î5ÎLÎLÎjÎjÎ}ΊÎÎΦίξÎÔÎßÎíÎøÎÏÏ'Ï-Ï7ÏCÏPÏRÏRÏZÏ_Ï_ÏgÏlÏlÏtÏyÏyÏφφόϑϑϘÏÏϤϩϩϴϹϹÏÄÏÉÏÉÏÔÏÙÏÙÏäÏäÏÿÏÐ ÐÐÐÐ1Ð>ÐMÐTÐWÐiÐkÐqЅВССССЫÐÅÐÚÐìÐýÐÑÑÑ"Ñ-Ñ?ÑPÑ_ÑeÑvÑыћѪѰѻÑÁÑÖÑÜÑíÑøÑþÑÒÒÒ1Ò=ÒEÒUÒ\ÒbÒsÒ~ÒƒÒ ÒµÒÃÒÓÒßÒñÒüÒ Ó Ó Ó'Ó,Ó3Ó7ÓEÓOÓUÓ_ÓeÓpÓvÓxӅӒӜӵÓÃÓÃÓÉÓÐÓÖÃD#° ¬ ¬?¬a¬i¬i¬w¬Š¬¤¬§¬°¬Ì¬Ì¬Ì¬Ô¬Ö¬Ö¬Þ¬à¬à¬è¬ê¬ê¬ò¬ò¬û¬­­­­­"­'­-­2­2­2­2­:­C­I­N­N­S­`­y­˜­›­±­Ð­Ð­Ð­Ø­Ú­Ú­Ú­â­ä­ä­ä­ì­î­î­î­ö­ø­ø­®® ®®®®®® ®2®@®N®X®X®X®h®h®o®s®y®‘®Ÿ®²®¿®è®ë®ô®û®¯¯ ¯+¯+¯6¯<¯A¯A¯A¯H¯N¯c¯k¯q¯|¯“¯ª¯¶¯¼¯Á¯Á¯È¯Ó¯Ó¯Ø¯ê¯ð¯ð¯ð¯ð¯L°Äd*CC*C4C7C7CACTCVCcCeCpC„CŒCœC¡C§C¯C²CÄCÅLWf11.12171B1B1L1R1R1V1^1Æ\CV²0²0È0È0Ì0Ñ0ä0ç0ì0ì0ö0ü0ü0 -1 11Ç8(2îÖîÖ÷Ö÷Ö× ××××ȨY^^ ^'^2^E^9^w^Û^Á^¶^œ^…^á^ö^æ^__8_=_R_?_a_g_g_n_˜_Ã_¦_Ú_ø_ø_ø_`ÉlF],,©,Ò,´,á,---5-M-:-\-u-•-§-À-À-Ç-é-é-ó-Ê4Š“ßëßëóëøëþëìì%ì-ìËxÌæo‚o‚š‚‡‚©‚³‚º‚ЂÕ‚Ú‚Þ‚à‚æ‚삃*ƒ2ƒDƒgƒ]ƒvƒ‚ƒÌ”"ðªðªþª«««$«/«:«B«M«X«]«s«z««Œ«—«™«¤«¯«±«½«È«Ó«Ü«ä«ä«è« ¬Í€Úö"5"5@5D5H5P5^5a5d5z5€5‚5”5˜5œ5¤5¬5¸5Í5Þ5å5ì5ì5ù56ÎÞ`wEwE§E²E×E¹EñE'F,F,F/F9FQF`FbFjFŒF­F¿FÌFçFûFGG$G&G+GBGiG{GˆG£GÃG¹GÝGãGãGìG HHHH8H"HGHGHYHYHgHqHœH’H¶H¶H»H¾HÔHàHõHI#I)I9IaIPIpIrI„I˜I¬I¢IÁIÇIÖIþIíI JJ!J+J?JIJRJiJsJuJ‰J“J“J²J¸J¸J¸JÁJáJ KøJKK/K7KbKXKwKwKwKKK¯KÏ`8Ìo1o1¦1­1µ1¾1É1Ð1è1í1ð1ó1ü1 -222A2F2S22„2‘2±2¶2Å2ñ2ù2þ23?3G3L3L3_3r3†3Š3¬3½3Â3Â3î3î3î3î3î344 4"4%4%4R4W4`4m4u44§4µ4À4Ü4Ü4Ü4é455555&5(5(555L5L5\5a5ˆ5Ÿ5±5Í5Í5Í5Ú5ñ5ó5ó5ó56666&6=6=6M6U6Z6z6‘6£6¿6¿6¿6Ì6ã6å6å6ò6 7 77 7-7O7m7r7€7Ž7˜7š7š7š7·7¿7Á7Á7é7/8Ф%JGèGèaèèè¬è¼èÁèÁèÐèâèüèé éé+é3é3é3é5é5é5é5éQéQéQéQéhéjéjéjéjé…ééÅéÑÐ燃‡ƒƒ©ƒ®ƒ®ƒºƒ¿ƒăσÔƒÔƒÔƒ „öƒ„?„?„X„q„Š„£„¨„¨„Á„Ú„ó„ ………*…C…\…u…w…w……©…Â…Û…Û…Û…í…Ò0‰ëëë“ë—ë¶ë×ë×ëÝëÓ<:E888&848@8L8U8^8g8m8r8ÔluŒª&ª&¸&Â&É&à&à&å&ç&ó&ý& '('*':':'?'A'H'z'ÕÈŸÍWtWtkt•tŠtvtµtçtÍtÀtuu"u0u?uVusuÌu´u uÒuÝu vvv5v=vbvWvCvuvŽvzv±vvÈvÏvûvûvûvûvwÖL^m÷-÷-.'...P.P.b.o..u.—.¡.×$qv§M§M»MÃMÎMÔMØÈg•b1b1†1Š1©1Ë1×1Þ1é1÷12 2 22242?2O2[2b2m2~2€2‘2“2•2•2•222§2§2¯2·2¿2Ç2Ë2Ö2"3Ù H‡H‡V‡m‡s‡Ú`FZr8r8‚8‰8‹88Ÿ8¥8º8º8È8È8Ô8Ý8à8î8ø8û89Û<öggp{†‘œ¦ÄÏßÜ 5—f—f¯fÁfÇfÓfÞfìføfgg*g}I}Q}Y}]}k}q}v}v}|}} }¥}¥}«}±}¶}¶}¶}¼}Ë}Þ}ë}ï}ô}ô}ø}ý}ý}~ ~~3~I~U~U~[~h~j~w~ƒ~’~¥~¥~²~¾~¾~¾~¾~Â~Ç~Ø~ê~õ~ý~,;ANNeuu‰•— ¬ÃÃÉÖØêêõõõõõq‚á „È/U/UMU[UrUwUœU¢U§U­U»UÂUÑUÖUâUôUôUVV0V7VQVnVzV•V­VÉVÒVáVéVöVÿVWW"WBWGWOWhWzWŠWW›W¤WªWðWÚWËWX;X%XXKXNXsXYâ<+6ÈCÈCéCïCøC -D#D+DEDQDã„ |† † ¨ ³ º  Å Å Õ à à ã ê ñ ÷ ý   -  ! ! # , 8 > c g j z ‚ ‡ ‡ Ž — ¨ ® ·  Ó Ó Ü á ë ò ù !! !!.!1!@!M!Z!Z!Z!Z!`!r!{!Œ!­!¾!Ö!Ý!ç!ï!ö!ö!ÿ!""""-"-"-"A"U"e"h"##ä„9ê6ê677767c7y7Š7“7¡7³7Ì7Ì7Þ7ø7888åX{Í^^‰“¦±ÃÑ×èï÷ (=MWYiy‚ˆ”𠦱¼¿Æàè$'/3ET[c~›Ÿ¨¯ÁÉÐÔÝßñ "///1HNN`æ  -x‡x‡‡•‡š‡ç¤ŸÄ‡€‡€£€©€»€À€Æ€É€Í€Í€ð€õ€"1J6Yo[~†‹‘”˜š³ŸÂÂÂÝ ‚‚è˜Ìîââëææúõ ""11@@OO^^m|‹‹š©¸#éxËå7c7cUcgcmcyccc¢c¨c³cÃcÏcØcÞcäcïcýc -dd$d3d3dcdêd”©/ì/ì3ìFìFì`ìgìsìsìŠìŠì¡ì¡ì¸ì¸ìÏìÏìæìèìèìììëÌÂñ__ˆ“©©»ÆÚÞãçéï "$=LPPPcxx„Š”Ÿ­´ÃÅÞøø -ìP7GXDXDnDzD‚D†D—D¥D«D·D¿DÊDÐDÓDÝDí ®- = =9=D=H=Q=X=_=u=†=—=©=»=Ê=Ù=ê=ù=ù=>> >>!>*>1>5>U>U>U>U>U>a>e>h>p>~>†>“>›>£>´>¿>Ä>Ä>Ñ>×>æ>ý>ÿ> -??"?%?+?'???V?X?f?h?s?y?y???“?š?°?°?°?µ?µ?Í?Û?æ?ë?ë?î?ó?ó?@ @-@/@/@3@5@5@T@b@n@p@p@s@u@u@‚@„@„@‡@‡@‡@‡@‡@@–@š@¦@Æ@Ó@á@è@°Aî(rxxŠxŠ†ŠŠŠ Š¦Šï(ntZ&Z&c&m&~&‰&‰&§&ðTzKþòþòó"ó%ó.ó8óPó`óióoóróvóxóó ó­ó³ó·ó½ó¿óÂóÆóÆóéóíóóóóóúóô1ôDôWô]ôdôoôyô}ô€ô‡ôô‘ô—ô¨ô®ô³ô¸ôÅôÇôÙôÛôâôïôñôõõõõõ'õ2õ>õUõUõjõvõ“õ·õÑõÖõíõòõööö"ö3öHöNö^ököö†ö’öªö¶ö¶ö¶ö¼ö¿öÂöÛöáöõöûö÷ ÷ ÷÷÷*÷*÷0÷>÷U÷[÷^÷a÷h÷q÷x÷x÷}÷Š÷—÷—÷÷«÷Â÷È÷Ë÷Î÷Õ÷Õ÷æ÷í÷ú÷øøøø ø%ø,ø7øKøKøeøjøqøyø€øø”øøµøºøÁøãøîøôøüøù)ù)ùDùDù^ùlùsùzùœù¯ùÓùÕùßùúúúú&ú7úPúTú)ûñÀ€¬`` `#`(`7`B`N`o`P`~`ƒ`ƒ`¨`Ù`¼`¯`ü`a*a/a;a\a=akapa‰aa³aÉaÉaïaïaûaò ././=/V/\/ó4‘šçNçNÿN"O/O5O;O>O_Oô8 â.â.ð.÷./ -/////#/õ :>7070A0I0N0öÎPww%w5w@wVwsw‚w¦wÔwÚwàwèwêwòwx -xx!x7xTxcx‡xµx»xÁxÉxÎxÖxëxîxùxy -yyyy&y.y>yVydy’y˜yy¥yµyÛy zzzz%z0z;zXzpz|z„z’z’z—zªzÁzÃzàzøz{ {{{ {2{?{I{`{w{{¢{¯{Ñ{è{ÿ{ ||&|=|=|F|R|h||”|Ÿ|²|¶|¶|¶|½|Â|Õ|à|ú|ü|}} },}6}6}H}÷˜k ˆ9ˆ9ž9ª9ª9À9Ë9Í9í9í9í9ô9þ9:: : :::,:,:b:n:€::§:¬:¯:´:´:´:Ð:×:ä:ë:ó:ø:ø:; ;(;-;-;I;V;^;c;c;;‹;”;œ;¤;°;Æ;Ñ;ô;ø;<<<</<I<S<_<g<l<l<‹<—<©<®<Ê<Ö<å<ê<ù<= = = = =====2=>=P=R=U=Z=Z=Z=d=l=s={=„==•=¢=°=°=º=Ã=Ë=>> >>6>;>;>N>V>V>X>X>X>]>]>d>j>n>u>y>y>y>y>ˆ>ˆ>­>¶>¶>º>ÕBø(ØBØBæBïBýBCùªÊÿlÿlm%m1mGm\mjmum„mŠmŠmŠmm”m¢m­mÆmÈmÍmÛmæmómúmnú\2Eo+o+‰+®++½+Ù+Ï+ñ+,ó+,.,@,Y,Y,`,‚,‚,Œ,û8fp'M'M?MNMbMqMwM}M€M¡Mü0—p‹p‹„‹‹ž‹¡‹¹‹¼‹Ä‹ý0S[¶×¶×Ê×Ò×ß×é×ü×þP>Nðˆðˆüˆ‰‰'‰/‰3‰=‰G‰O‰R‰X‰ÿT¡²OO©O¼O¿OÉOÖOëOíOÿO PPP#P&PzP<˜£È‹È‹Ü‹ã‹ï‹û‹ ŒŒŒŒ Œ 26nånå|åˆåH!/¯[¯[Ã[Ï[å[Ñ[ô[ö[ý[\\\ Dƒ?S?ScSjSoSwS‘SšSœS©S©S«SÅSËSÍSÏSÜSÜSÜSÜSàSïSøST TTTT T>!>I>T>a>o>c>˜>˜>¤>¬>»>õ>÷>$?,?,?a?y?f?š?ˆ?©?¯?¾?Ó?Õ?à?è?è? @@@#@+@I@6@~@d@X@@ª@•@Ê@â@Ï@Añ@%AA4AFALçþçþÿ ÿÿÿÿÿ2ÿJÿJÿTÿp©Á÷÷!#*068>DZm|ƒˆ’§½Ðõ(FåFåZå{ååå‡å8åå å$å/å8å?åAåFåd`µþØþØÙ Ù-Ù/Ù<Ù>ÙJÙJÙWÙYÙfÙhÙtÙtÙÙÙ٨ٯپÙÉÙÏÙÔÙÖÙâÙéÙøÙÚ ÚÚÚÚLÚrÚ‚Ú’Ú¢Ú¤Ú´ÚÄÚÔÚÔÚÙÚìÚóÚúÚúÚúÚúÚÛÛ#Û)Û/Û5Û9Û9Û9ÛfÛmÛƒÛÛ•Û›Û¡Û£Û£Û±ÛD¶Ã¶Û¶ÛÌÛÏÛÒÛßÛåÛòÛõÛøÛþÛÜ +Ü ,cj‹‹‹ ‹+‹6‹<‹B‹ + hlfft‰ P z7z7ˆ7—7³7¹7Ë7Ë7Ö7ß7å7ì7ò7 ”;\?L?LGLKLdL~L›L¼LÅLÖLúLMM0M?MHMUM\MŽMŸM£M«M«M¾MÎMÒMÖM Œ×öÞÞþ +$$PfzˆŸ¥±¶Äàéùû     |1’"’"¨"±"¼"Ö"Ö"Ù"è"î"÷"ù"ÿ"# +###!#$#$#.#0 'P‰P‰^‰~‰„‰Š‰Š‰‰„“°ð¡ð¡¢ ¢¢¢:¢M¢T¢e¢Š¢•¢ ¢¢¢­¢Ò¢Ý¢è¢ê¢ñ¢ú¢ü¢££8£("wáwá†áá¸á¸á¾á áá&á<áBá ˆx´x´´¤´»´Ç´Ò´ä´õ´æ´ä´µ0µ<µCµIµUµ_µfµmµqµsµyµ…µµ–µµ¡µ¡µ«µ°µ»µÍµÞµÏµÍµþµ ¶+¶2¶8¶D¶N¶U¶\¶`¶b¶h¶t¶~¶…¶Œ¶¶¶¶«¶»¶Í¶Þ¶Ï¶Í¶þ¶ ·+·2·8·D·N·U·\·`·b·h·t·~·…·Œ···š·ª·¼·Í·¾·¼·í·ô·ú·¸¸¸¸"¸$¸*¸6¸@¸G¸N¸R¸R¸\¸j¸s¸Œ¸˜¸œ¸œ¸Ÿ¸¨¸¹Ô „ „<„ +ªD„S„v„„“„š„«„³„·„º„Ȅ̄ø„ø„ …………#…'…4…4…@…H…L…Y…Y…Y…u…€…‘…‘…–…®…½……ȅӅ؅؅݅õ…† ††† † †-†6†B†J†R†Z†]†c†h†q†ƒ†Œ††­†­†²†º††ņˆˆІІІÖ†Ù†à†ë†‡%‡<‡I‡Q‡Y‡e‡q‡w‡~‡‡‡‹‡އš‡ ‡§‡¬‡¬‡º‡ʇʇׇׇ߇ç‡ð‡ÿ‡ˆˆ ˆˆˆ$ˆ*ˆ5ˆ:ˆ:ˆIˆTˆfˆlˆtˆzˆˆŠˆœˆ¢ˆªˆ°ˆµˆµˆɈψÚˆàˆâˆòˆøˆøˆ‰D‰I‰I‰]‰c‰y‰Љ‰•‰®‰´‰ĉ̉Ô‰Ú‰߉߉ó‰ù‰Š Š&Š+ŠDŠJŠZŠbŠjŠpŠuŠuЋБЧЏоŠÊÒŠØŠéŠñŠùŠÿŠ‹ ‹ ‹!‹'‹=‹N‹T‹V‹e‹k‹u‹}‹…‹‹‹’‹’‹’‹¤‹­‹¾‹΋΋Ó‹Ó‹á‹é‹ú‹ ŒŒŒ"Œ(Œ8Œ>ŒFŒLŒLŒLŒQŒQŒQŒQŒQŒpŒ|ŒŒŒŒ™Œ¤Œ­Œ¸ŒÃŒÈŒÈŒÞŒäŒúŒ (.3Ljjoo{ƒ†Œ’——»ÃËÛáççøŽŽŽŽ'Ž/Ž2Ž9Ž?ŽDŽDŽdŽlŽ|ނމާ޶޾ŽÖŽÞŽáŽèŽîŽ&.18>>>]my„‹‘¡°¼×ßâéï.69@FFFFKKTdz€˜«±¶ÈÎÓïõ‘ ‘ ‘‘‘B‘J‘Z‘`‘g‘g‘g‘l‘l‘u‘‘£‘©‘Á‘Ô‘Ú‘ß‘ +’’#’Z’l’‰’‘’—’œ’œ’¶’’Βْْޒޒø’““““ “ “:“F“R“]“]“b“b“x“~“Š““•“§“­“²“Á“͓ٓߓå“ì“ÿ“ +”” ”'”*”0”6”;”O”^”f”~”†”‰””•”­”µ”Õ”ï”÷”ú”•••• •,•4•7•>•D•I•[•j•r•Š•’•••œ•¢•º••á•û•–– –––#–,–8–@–C–I–O–T–h–w––™–¡–¤–ª–°–È–Жò–——— —%—%—6—?—K—S—V—]—c—h—z—‰—‘—¬—´—·—¾—Ä—Ü—ä—˜#˜+˜.˜5˜;˜;˜;˜;˜;˜@˜@˜V˜\˜h˜n˜s˜…˜‹˜˜ž˜ª˜³˜¿˜ǘʘјטܘî˜ý˜™™%™(™/™5™M™U™t™Ž™–™™™ ™¦™¦™¦™·™À™Ì™Ô™×™Þ™ä™û™ +šš1š9š<šCšIšašmšš¬š´š·š¾šÄšÄšÄšÄšÄšÉšÉšÜš÷šýš› › › ›6›<›G›I›I›\››…›››¢›«›¼›Á›Ó›ã›ã›è›è›û›œœ%œ4œ9œ9œLœbœhœvœ…œŠœŠœ œ¦œÜۜۜ %4499OUrŠŠ´º¿ËÔããèèþž!ž9ž9žcžižnžzžƒž’ž’ž—ž—ž­ž³žОèžèžŸŸŸ&Ÿ/Ÿ:Ÿ:Ÿ:Ÿ:Ÿ?ŸMŸVŸgŸiŸ{ŸˆŸˆŸˆŸ˜Ÿ¨Ÿ­ŸÑŸÝŸÞŸãŸøŸ % I Y _ _ _ d i ~ ‘ Ï ß å ç ì ý  ¡>¡F¡L¡N¡S¡Z¡Z¡c¡u¡ˆ¡‘¡ ¡ ¡¥¡ª¡¹¡¡Í¡Ï¡Ø¡ã¡ã¡¢ ¢¢¢$¢*¢:¢@¢H¢S¢Y¢Y¢^¢c¢j¢q¢x¢¢ˆ¢—¢—¢—¢œ¢œ¢œ¢®¢³¢³¢Å¢ТØ¢à¢æ¢æ¢æ¢ë¢ë¢ö¢£ +££ £+£2£8£=£=£H£Y£\£h£q£}£„£Š£££££”£™£™£¤£¨£¨£´£½£À£À£Ë£Í£ã£ê£ð£ÿ£ +¤¤¤'¤+¤+¤7¤@¤C¤C¤N¤P¤f¤m¤s¤{¤†¤‘¤—¤¡¤¤¤¨¤¨¤°¤·¤º¤¼¤ǤˤÔ¤פפâ¤ä¤¥ ¥¥ ¥"¥(¥-¥-¥8¥<¥<¥H¥Q¥T¥T¥_¥a¥w¥~¥„¥“¥ž¥©¥¯¥»¥¿¥¿¥Ë¥Ô¥×¥×¥â¥ä¥ú¥¦¦¦¦%¦+¦5¦8¦<¦<¦D¦K¦N¦P¦[¦_¦h¦k¦k¦v¦x¦–¦¦¨¦³¦¶¦¼¦Á¦Á¦Ó¦צצã¦ì¦ï¦ï¦ú¦ü¦§§ §1§<§G§M§R§R§]§b§b§m§r§r§}§€§„§‹§§•§š§š§®§³§³§À§ħÕ§ݧá§õ§ü§¨¨ ¨¨!¨'¨7¨;¨L¨^¨i¨m¨m¨z¨‚¨Ѝ¨¨¨¨¨’¨’¨ ¨§¨´¨À¨ΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨΨШШç¨ï¨û¨û¨©+©C©E©Q©^©^©©Ž©™©¢©«©¶©½©½©Ç©Ç©Ê©Ü©ú©ªª3¬xÝ÷R5R5d5f5j5s55‹5 5 5Ï5Ó5Ø5ä5÷566666$6l_vwwœ¡¶£ÅÈÈÕê×ùÿ€1€J€c€|€†€„ž·o·oÕoÝoãoêoñoóoöoýopppp p p4p>p>pFp_p‚p£p¨pÉpÎpÚpåpêpúpýpqqq"q$q*q-q3q8q;qCqLq\qqq¥qªq®qÓqæqëqùqrrr?rOrrr…rŠrr•r˜ršr r¦r¬r±r·r¿r¿rÉrÒràrørýrs&s6sYslsqss¤s²sÊsÏsÓsøs t t&t&t&t4tLtNtNtNt\tttvtvt„tœtœt®t®t·tÄtÚtútuu'u:u>u>u>uEuKueumuxu“u•u›uµu½uÈuÖuáuáuûuH…“ † †·†Í†Ý†ä†û†‡(‡,‡o‡Lž——«¸ÎºÝßø‚‚'‚/‚4IR†Ø†ØØØ’ؠخرضØì=ÇüÇüïüòüý'ý8ý8ýSýYý^ý^ýyýý„ý„ýý›ý¸ýÐýÕýÜýâýäýþþþþ#þ%þ%þ8þ>þ>þ>þNþCþ_þoþþ†þ†þ†þþ”þ›þ°þ·þÓþÓþåþÌL»°¦°¦Ê¦Õ¦à¦é¦ñ¦ô¦û¦ÿ¦§§ §%§3§P§]§l§q§}§‚§‰§•§š§§§§Ÿ§·§À§Ñ§Ï§Ç§ß§è§î§î§ü§ÿ§¨¨%¨,¨0¨5¨L¨d¨m¨{¨—¨£¨£¨»¨Ì¨Ì¨Ó¨ì¨ø¨©©©.©7©>©B©M©R©Y©v©£©ª©®©°©»©Ç©Ë©à©â©ó©ý©ªª!ª0ªIªIªLªTªYªÛªPw‡×N×NóNOO.OKOfOlOuOƒO‰OŒO˜OŒ  b b°bÔbÔbâbâbâbâbëbëbòb c"c*c*c5c5cCcScScacgcgccc…c«c (kqH‹H‹V‹b‹r‹y‹‹ @KWoëoë}ë…ëŒë«ë¸ë¸ë»ë½ëÃë!$/4 â â,âAâFâLâ"$).ïáïáüáâââ#$#(¿á¿áÎáäáéáïá$€ïK**4DZbl‡Œœ²ºÄßäú   " , 6 @ J T ^ h r | ’ œ ¦ ° º Ä Î Ø â ø  " , 6 @ J T ^ h r | † š ¤ ® ¸ Â Ì Ö à ê ô þ !!!&!0!:!D!N!\!%¤Cððž ž"ž3žEžGžNžTždžožyž„ž›žžž ž²ž¸žÈžÒžÜžãžîžŸ Ÿ Ÿ!Ÿ!Ÿ!Ÿ5Ÿ&$5:OâOâ]ârâwâ}â'¤Di8Ÿ8ŸNŸUŸjŸ{ŸŸŸ–ŸœŸ¬Ÿ·ŸÁŸÌŸãŸæŸèŸúŸ   % , 7 K S S i i i ~ ((&,ò/ò/00000)0]e×M×MíMNNNN N*  ß>%>%`%h%n%{%‚%ž%¤%¤%¤%±%³%¾%È%Ï%Þ%é%ï%ù%ÿ%&&&%&%&7&=&M&S&X&_&_&€&†&˜&«&±&´&º&º&¼&Â&È&Ê&Ê&Ê&Û&å&ê&ê&ÿ& ' ''&','2'H'M'U'k'o'o'w'}'ƒ''”'›'¤'¶'¶'Û'ß'å'ë'ý'((( (&(,(,(.(2(8(>(D(I(I(I(I(t(…(…(œ(©(­(µ(Ç(ç(ç(í(ð(ô(ú(ú( ))2)F)N)_)c)t)x)~)—)™)Ÿ)¬)®)º)Ø)Þ)é) ***#*)*2*8*J*[*c*g*x*|*‚*›**£*°*²*¾*Ü*â*è*î*÷*ý*+ +4+=+C+C+X+]+]+d+n+ƒ+ˆ+ˆ+ˆ+¥+§+Ä+Æ+ã+é+ñ+õ+ü+ ,%,+,7,N,U,[,f,k,k,r,v,€,Ž,,˜,,¥,°,¶,Å,Ê,Ð,Õ,Ý,â,ñ,--%-0-L-N-j-j-q-†-‹-”-¡-¦-¬-±-±-¸-¼-Æ-Ô-Ö-Þ-â-æ-ð-ü-.... .1.?.D.P.P.X.X.{.{.‰..”.˜.....£.¥.¥.È.Î.Ô.Û.ñ.ó.ó.ó.þ.þ.þ./,0+4.w^Ê^ÊxÊ|ʔʜʤʮʲʹʿÊÓÊÛÊàÊãÊîÊùÊË ËËË/Ë6Ë=ËHËSËUË`ËkËmËy˂˂˘ˣ˻ËÁËÊËÛËáËêËüËÌÌ +ÌÌÌÌ0Ì;Ì?ÌMÌOÌSÌbÌbÌbÌsÌsÌxÌŠÌÌþÌ,Ô@޿޿¤æ«æ®æÒæÒæïæçç(ç-ç-çKçYçlçç‡ç‡ç‰ç‰ç‰çœçžçžçžç¥ç¸çËçËçËçÞçéçüçèèè"è7èJèQèQèTèyè-LAP$$$!$-$H$M$m$o$Š$¥$¥$­$´$Û$.P~ŽÐ‹Ð‹Þ‹ë‹ù‹ ŒŒ$Œ1Œ?ŒQŒ\ŒjŒpŒvŒ/4 +77(747E7W7`7n7t70|ºU~ ~   § µ À æ æ ï ñ ñ ø  & & 5 D ` k k w   ™ ·  Ä Ý ã î þ   $ ) / 6 ^ c q z z   § § ¶ ¿ Ó Ú á æ ñ ÷ ÿ %.5:EQ`tyŸŸ¶½ÅÕçíöö  $4CUZj}…™·ÎÒÞõ#)4@P`enn€„§ÃÕÛæò$**/1166EKQQUÎ1ŒÄãÜÜ*Ü6Ü:Ü>ÜEÜLÜ[ÜfÜlÜqÜsÜ܆܎ܔܚܞܞܭܴܼÜÂÜÈÜÊÜÊÜÖÜ28 */*/8/>/J/U/f/p/w/}/3@t€ÏìÏìÝìèìïìíííí í&í4ÌSw w  ° · ¾ Å Ë Í Ô Û Þ Þ ð ð  + +! +) +2 +: +? +E +[ +k +€ +… +ž +¶ +º +º +¿ +È +Ò +æ +î +÷ +ÿ +   - B D ] u y y  • ž ¦ « ± Ç × ì ñ  + " & 9 9 9 > ` ‚  “ « à È Ó ç ï ø     * ? A Z r v v Š ’ › £ ¨ ¯ Å Õ ê ï  $777<^€‹‘©ÁÁÁÍÓÝèú +!8Offy”””µÅÓÓÜæó "57Ve^}§§À5D{ˆîîþ!337:B6\Ob`Š`Š€ŠŠ˜Š¡Š¥Š©ŠµŠºŠ¿Š¿ŠÐŠÔŠÜŠôŠ÷Š‹70üîäîä÷äüäå ååå8tÚ77Y`grˆˆš³³¾ÂÍúÔ  1EINc{€ˆŒž‘½ÑÕÕÚë3 B`kq…¢¶¾ÇÏÔÛíý.FJJ_w|„ˆ—жÊÎÝÝÝÝðö55Qaooƒ‘Ÿ´ÇÌëúó"):`Q†ˆ´´´¿ý @ZGi€‘¬ÀÄÉÚü1@^ioƒ› ´¼ÅÍÒÙëû,DHHjƒ—›ªªª½ÃÍÔç.<<P^wlŠ¢ÁÐÉèø ' ' I I P s s s “ 9Dmz––¦ºÃÉÛÛßâê:lwއ€‡€€¬€±€Æ€³€Õ€Ø€Ø€å€ú€ç€ (AZsŒ–;<‰”FFVgpvz…<”)>ï>ïFïJïVïgïiïyï„ï–ï¡ï¬ï»ïÌïÓïìïðïðð ðð%ð.ð<ðPðlðqðŽð=d(=‰‰œ‰°‰³‰Ç‰Ï‰Ó‰Ý‰ç‰ï‰ò‰ø‰>4u¾8G8G^GaGeGrG{G†G–GžG¨GÐGÐGàGåGåGõGúGúG +HHH H$H$H4H9H9HIHNHNH^HcHcHsHxHxHˆHHHHH™H²HÀH×HêHìHòHôH÷HI I II#I#I.I>IKIcIkIqIqI…I…IŽI‘IQJ?Ä n7¬7¬T¬\¬_¬m¬{¬¬™¬´¬ͬ߬ê¬û¬ÿ¬­­ ­(­4­G­x­m­S­ˆ­Ÿ­³­¿­Í­î­®'®;®=®^®D®y®|®®„®„®‹®¡®¨®µ®º®É®Ö®é®é®¯¯2¯2¯J¯O¯O¯_¯c¯t¯~¯¯™¯¬¯±¯±¯Á¯ůÖ¯à¯ñ¯û¯°° ° ° °A°R°W°d°y°y°~°ˆ°—°œ°¢°§°§°¬°¶°ŰʰаÕ°Õ°Û°á°æ°æ°î°± ±±&±5±?±E±N±e±y±б—±œ±´±DZÞ±ë±ó±² ²²²$²$²)²)²)²)²)²9²9²9²Q²g²o²в›²¨²ª²·²¼²¼²¼²DzÕ²Ú²Ú²á²ï²ô² ³³*³6³<³D³J³S³y³…³‹³‘³ ³¨³°³ݳî³û³ý³ ´ ´´´´%´*´=´I´U´[´a´j´o´o´o´o´o´‡´Œ´Œ´Œ´Œ´Œ´´´´´´´´´´´µ´Ë´Ó´î´ÿ´ µµµ+µ0µ0µ0µ9µSµ_µdµ†µ’µ’µ—µ—µ—µ—µ—µ—µ—µ—µ¬µ±µ±µ±µµɵεεٵ뵶¶9¶Z¶e¶v¶{¶{¶{¶„¶ª¶³¶Ķʶë¶· ··"·L·U·[·|·•·•·•·•·•···ð·ù·ÿ·¸ +¸¸¸!¸!¸!¸!¸0¸D¸b¸r¸x¸}¸}¸¸¤¸ʸݸã¸ã¸è¸è¸÷¸ ¹)¹9¹?¹D¹D¹W¹k¹‘¹¤¹ª¹ª¹¯¹¯¹¯¹ǹݹ幺ºº º/º1º1º1º1º1ºEºEºEºEºEºEºEºEºEºEºEºEºEºEºEºEºTºcºnºpºpºyº{º{ºººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººº‘º‘º¨º°º¼º¼ºÀºźÕºñº »»$»:»T»W»a»m»“»³»Ó»÷»ù» ¼:¼¼U¼U¼X¼h¼p¼‹¼œ¼Ÿ¼¹¼ǼÓ¼ë¼ë¼½½(½<½]½q½½y½©½¾½ܽ¾¾¾ù½ê½ ¾ ¾ ¾"¾'¾*¾D¾R¾€¾¢¾¢¾;оß¾ó¾¿(¿D¿0¿`¿`¿~¿³¿±¿¦¿›¿Œ¿Á¿Á¿Á¿Ä¿É¿É¿пà¿À À`Ã@À„°çÇçÇýÇÈ ÈÈÈ2È2È=ÈNÈUÈbÈnÈ{ÈÈÈșȞȦȶÈÄÈÓÈÞÈñÈñÈ É É$ÉPÉPÉdÉfÉfÉpÉxÉxɂɊɊɊɛɛɛɡɩɯɴɴɺÉÂÉÆÉÌÉÑÉÑÉçÉ÷ÉÊÊÊÊÊ"Ê"Ê)Ê?ÊOÊYÊaÊgÊvÊ{ʃʉʉʎʕʠÊÔÊãÊíÊõÊûÊËËËËËËËËËËË&Ë4ËDËJËRËaËfËsË{Ë€Ë€Ë€ËˆË‘ËšË§Ë¯Ë»ËÆËúËÌÌÌ5Ì;Ì@Ì@ÌGÌZÌbÌwÌÌ‡ÌœÌžÌ©Ì±ÌÆÌÆÌÎÌßÌçÌîÌôÌúÌþÌÍ Í0Í<ÍDÍYÍeÍjÍvÍÍ†Í†Í†ÍœÍ¹Í¾ÍÆÍ×ÍßÍçÍüÍÎ ÎÎ)Î.Î.ÎRÎ^ÎfÎ{·ΌΘΣΨΨΨΨΨΨγγγγγγγγγγγγξÎÍÎÐÎÞÎîÎôÎüÎ ÏÏÏ Ï"Ï*Ï9Ï?ÏGÏOÏQÏYÏvÏχÏϖϪϳϼÏÄÏÎÏØÏàÏîÏóÏøÏ +Ð>ÐFÐUÐ_ÐyÐІІІÐИЛХгÐÅÐÇÐÙÐëÐëÐëÐöÐûÐÑÑÑ&Ñ+Ñ+Ñ+Ñ+Ñ+Ñ+Ñ+Ñ+Ñ+Ñ+Ñ+Ñ+Ñ+Ñ+Ñ+Ñ+Ñ6ÑBÑZÑmÑuÑ„Ñ‰Ñ‘Ñ˜Ñ¥Ñ®Ñ·Ñ¿ÑÆÑËÑËÑÓÑÛÑùÑÒÒÒÒ Ò Ò Ò"Ò7ÒHÒKÒNÒVÒ[Ò[ÒdÒiÒqÒxÒ…ÒšÒ¡Ò²Ò¾ÒÛÒôÒ ÓÓ%Ó%Ó*Ó*Ó*Ó*Ó*Ó*Ó*Ó2Ó=ÓIÓXÓ]Ó]ÓeÓmÓzÓÓÓÓƒÓˆÓˆÓ˜ÓÓÓÓ©Ó°Ó¶ÓÀÓÅÓÜÓëÓóÓÔ Ô/Ô5Ô<Ô>ÔDÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔKÔMÔMÔhÔrÔ€Ô€Ô…ÔÔ—Ô³ÔÀÔÀÔÀÔÄÔÏÔíÔûÔñÖAx[÷Ö÷Ö ×××&×-×>×H×O×Y×l×t×t×שׯ׸׿×Â×Í×Ö×Ý×à×å×ð×ú× ØØ(Ø/Ø7ØMØTØTØTØb؉ؚؒجشششؿØÉØÛØáØ÷ØþØÙ Ù"Ù3Ù3Ù:Ù:Ù:ÙHÙoÙ|Ù…Ùٟ٧٧٧ٵٽٽÙÀÙËÙåÙñÙ6ÚBt`¹GÝGÝ_ÝoÝvÝ}݈ݛݞݦݭݰÝÀÝÎÝÙÝäÝçÝòÝÞÞÞ)Þ4Þ;ÞNÞZÞwÞ€ÞˆÞ¨Þ«Þ±Þ¶ÞÅÞËÞÓÞâÞèÞðÞðÞüÞ +ßß!ß0ß8ß[ßaßgßißoßußußußšßŸß¼ß¿ß¿ßÆßÓß×ßâßüßàà+àGà\àdànàà¡à¡àáC ?CO1O1Y1a1f1DÑÒ¯Z¯ZÐZÛZìZÛZ[[[$[-[4[8[A[A[I[M[m[{[‡[[˜[¼[¼[Í[Ø[Þ[å[ê[ê[ý[\\$\/\6\@\M\M\_\d\d\r\w\w\ˆ\ˆ\›\ \±\·\À\Õ\é\é\î\î\ü\]]] ]]]]&]-]-]<]B]O]V]^]‚]‚]Š]™]¤]«]­]Á]Ð]Õ]Ú]Ú]Ú]í]ò]^^^&^:^:^?^?^G^]^b^v^}^‚^‚^Ž^^¯^¾^Ù^ä^þ^_"_1_P_[_`_o_ƒ_Š_‘_¤_¦_´_Ç_É_×_å_õ_ü_``&`7`N`P`\`g`i`i`t`ˆ`•``Ÿ`³`Å`Ì`Ý`ë` aa a>a>a>aFaQaUa]aaaiapa€a‹a©a®a·aÂaËaÓaØaØaçaôab bb&b,b2b8bAbGbVbnbvb‚bb§b©b²b½b¿bËbébïbõbûbcc +>>Lè7O0O0z0}0€0†0‹0¢0¹0Ð0ô01121L1^1k11”1™1¤1¬1¬1¶1¶1Á1Æ1Û1á12 2!262<2[2z2‚222—2—2©2ç2ÿ23M$ ]]B]+]L]T]NLx‡þÌþÌÍ%Í6ÍGÍNÍVÍfÍq͈͂ͺÍOTHYXeXejeleue~eŒe‘ešee¢e°eºe½eÇeP¨!G°c°cÀcÉcÜcécõcd dd0d0d?dJdSdZdcdzd‘d–d¨d·dÃdÕdÕdÞdeeeee2e>eAeXeQhî„HpHpaplp|pÅpÌpàpçpïp÷pqqqqq"q)q0qOqgqpqpq¥qÏqØqúqr1r[rgr‰r‹r’r™r™r¼rØrÿrsBs^s…s¡sÈsäs t'tNtNt]tjtotot~t‹ttt—t¢t´tÌtätütþtþtþtuuuuuu(u6uIu^ušu¡u¡u¡u©uÆuÔuòuûuvv v9vUvUvUvgvuv‘v¯v¯v¯vºv½vìvîvw ww%w'w4w6wCwEwRwRwvwxwww™w›w©w«w¹w»wÉwÉwéwéwéwéw x=xcxkxoxwx{x‰x—x™x¡x¥x©x±x¿xÍxÍxçxòxyy@@E@fhhpk«««ÊÊÊëððð€€€€7€<€<€<€[€`€`€{€‰€‹€š€£€½€¿€¿€Ä€¿€å€ç€ç€ï€ê€***55__‰¡¹ÄÚî‚ ‚7‚U‚W‚h‚…‚œ‚£‚›†R| $§è§èÅèÓèéèéé&éBéBéBéOéjéléléléyé”é–é–é¤é±éÌéÌéÜéîéSædÖÜÖÜðÜùÜÝÝ Ý'Ý/Ý7Ý?ÝEÝRÝRÝlÝqÝqÝwÝ|Ý|݂݇݇ÝݒݒݪݽÝÃÝÈÝÈÝÑÝñÝñÝñÝøÝúÝúÝÞÞÞ Þ ÞÞÞÞÞÞ Þ!Þ!Þ'Þ'Þ.Þ.Þ6Þ<ÞBÞJÞJÞJÞJÞVÞ^ÞfÞnÞvÞ~ކތޤ޳޽ÞÀÞÀÞÊÞÐÞÖÞÖÞÚÞâÞéÞíÞõÞýÞß ßßß"ß&ß,ß7ß=ßJßVß\ßdßhßoßwß߃߉ߑߘߠߨ߲߽߬ßÂߨßéßîßñß–àTL”£p‡p‡‰‡‹‡’‡¨‡¸‡¾‡Ö‡î‡ñ‡ˆKˆUÔ*[ŽðŽð¢ð·ðÆðÊðØðáðððððÿð +ññ ñ'ñ7ñNñeñkñpñtñ‡ñ‡ññŸñ©ñÍñØñÚñóñ÷ñò +ò +òò ò(ò;ò¥òV$×\×\]ë\ ]]WPÍÝgFgFˆFuFªF—F¹FÈFÐFÛFÝFèFóFóFGGX,f×f×o×u×}׆××”×Y‡‘‡‘¨‘½‘ˑؑ ’’*’J’Z’Z’g’g’n’’’’’š’¤’ª’°’³’Á’È’à’ç’ê’ÿ’“““4“N“_“e“k“r““x“™“Ÿ“¥“­“Í“µ“Ö“Ü“â“ê“ê“ñ“”÷“””$”,”L”4”U”[”a”i”i”i”””””Š””””½”ɔڔߔ𔕠• •••'•0•<•P•`•u•Š•§•¬•¬•·•¿•Ì•וç•ö•–(–=–H–M–M–X–n–ƒ–– –¥–¶–Ê–Ê–Õ–Ê–í–ò–ò–——————+—0—0—A—F—F—Y—h—m—m—€——”—¢—”—¶—»—É—»—Ý—â—ð—â—˜ ˜˜ ˜+˜0˜0˜M˜R˜t˜y˜‡˜y˜›˜ ˜ ˜½˜˜ä˜é˜÷˜é˜ ™™™-™2™T™Y™g™Y™{™€™€™™¢™Ä™É™×™É™ë™ð™ð™ ššš+š0š0šKšPšPškšpšpš‹ššš«š°š°šËšККëšðšðš››››››(›3›H›M›M›Y›r›w››¤›®›³›Ä›Λã›î›ó›œœœœœ œ$œ+œ5œ?œ?œRœWœWœWœ[œtœ}œ}œ£œ¨œ¨œ°œÄœÍœçœôœÿœ +'3<AAARoz„”Ÿ§¬¬·¿ÈÓãûž'ž,ž,ž7žJžTž_ž€žŒžž¢ž³ž·ž¼ž¼žÌžמßžäžïžÿžŸ+Ÿ@ŸUŸ`ŸeŸpŸxŸ}ŸˆŸ˜Ÿ§ŸÄŸÙŸîŸîŸîŸîŸóŸøŸøŸ   : < Y Y c w  ƒ  — ´ Å Ï Ú ý ¡ ¡0¡;¡S¡c¡h¡h¡s¡x¡x¡€¡‹¡¡¡˜¡£¡¨¡¨¡°¡Ñ¡º¡¸¡é¡î¡î¡ö¡¢¢þ¡/¢4¢H¢4¢`¢e¢e¢r¢w¢w¢¢„¢„¢–¢¨¢­¢­¢Á¢­¢Ù¢Þ¢Þ¢æ¢ë¢ë¢þ¢£££££5£E£J£J£d£t£y£y£“£££¨£¨££Ò£×£î£×£¤ ¤ ¤¤¤W¤E¤3¤¤o¤t¤°¤ž¤Œ¤t¤Ȥͤͤܤì¤ñ¤ñ¤¥¥¥¥$¥2¥7¥_¥M¥7¥w¥|¥¤¥’¥|¥¼¥Á¥é¥×¥Á¥¦¦¦#¦ ¦M¦]¦b¦b¦}¦i¦§¦·¦¼¦¼¦ȦͦͦÙ¦Þ¦Þ¦ñ¦§§§§)§.§.§A§Q§V§V§i§y§~§~§†§‹§‹§“§˜§˜§ §¥§¥§­§²§²§ŧʧʧݧâ§0¨¨ ¨ú§â§=¨B¨¨~¨l¨Z¨B¨¨¢¨¢¨±¨̨ѨѨâ¨ý¨©©©!©&©&©.©3©3©;©@©@©H©M©M©…©s©a©T©¤©¿©Ä©Ä©ü©ê©Ø©Ë©ª6ª;ªpª^ªSª;ªˆªªª°ª¥ªªÚªߪùªãªߪ««3«««K«P«P«\«u«…«–«–«»«½«Ó«Ù«Ù«ö«¬4¬e¬S¬ˆ¬¬¬¬œ¬¡¬¡¬´¬¿¬ɬάÙ¬ã¬è¬è¬­­­­­(­­7­B­G­[­G­j­u­z­z­…­–­›­›­¦­±­¶­¶­Ç­Ì­Ì­æ­ñ­ö­®ö­®®)®®8®=®H®=®W®\®p®\®®„®„®˜®„®§®§®§®¬®¸®¬®Ë®ЮЮÜ®Юï®ô®ô®¯ô®¯¯¯$¯¯7¯<¯P¯<¯_¯k¯v¯¯†¯š¯†¯©¯µ¯À¯˯Яä¯Яû¯ó¯° ° °°°° °$°$°-°2°2°;°@°@°K°P°P°[°`°`°k°p°p°{°€°€°‹°°°›° ° °«°°°İ°°Ó°Þ°é°ô°ù°ù°±±±±±±!±&±&±0±5±5±=±B±B±O±T±T±a±f±f±f±f±f±n±s±s±{±€±€±ˆ±±±•±š±š±¢±§±»±§±ʱÛ±à±à±ç±ò±²²-²8²Q²=²`²k²v²{²{²‚²²­²²²ȲÓ²ì²زû²³³³³³(³H³M³c³n³‡³s³–³¡³¬³±³±³̳¸³Û³û³´´!´:´&´]´I´l´w´|´|´—´ƒ´¦´Æ´Ë´á´ì´µñ´(µµ7µBµGµGµbµNµqµ‘µ–µ¬µ·µе¼µóµßµ¶ ¶¶¶!¶&¶&¶5¶:¶:¶:¶@¶E¶E¶E¶O¶Q¶Q¶[¶b¶…¶‡¶‡¶‘¶‘¶‘¶‘¶‘¶“¶“¶ª¶±¶¼¶¼¶ǶͶÔ¶ß¶ê¶õ¶ï¶·-·"·E·E·S·M·y·n·‘·‘·‘·š·¡·´·¹·Ç·Ú·Ú·ù·¸¸;¸;¸;¸\¸l¸¸“¸£¸£¸ȸϸÞ¸ð¸ð¸ô¸ù¸¹¹/¹/¹3¹J¹Q¹V¹V¹Z¹e¹q¹¹¬¹µ¹ƹÔ¹ººº.ºFºRºcºhºyº˜ºƺïºòº»»»»'»2»2»5»F»w»š»š»»ĽZ, –זפת׮׷×Àׯ×[`BV—‰—‰­‰»‰‰ƉÕ‰î‰ò‰ø‰Š+Š-Š-Š^ŠLŠ-Š}ЇŠ\8 +g\g\ˆ\u\—\¢\­\¸\Ã\Ï\Õ\]\’8¡8¡F¡H¡S¡[¡f¡q¡|¡~¡”¡”¡¦¡²¡»¡¾¡í¡^øª¤—î—î¼îÁîÎîúîúîïï0ï8ïeïjï“ï³ïÏïÕïÙïüï"ð'ðPðmð“ðªð°ð´ðÍðÕðÚðëðóðñññ5ñ=ñ\ñañrñzñ™ñžñ¦ñ¬ñ°ñ´ñÆñÎñÓñññöñòòòò-ò<òIòiòiò€ò…ò…òœòžòžò²ò´ò´òËòÍòÍòäòæòæòýòýòóóó&ó&ó_óxóxó‹óóóóó¿ó×óóóóóóóôôôôô&ô=ô?ô?ôLôcôcôzô|ô—ô³ô³ô³ô·ô¹ô¹ô¹ô¾ôÀôÀôÅôÅôÏôÔôÔôðôðôðôøôýôýôýôõ +õ +õõõõ>õ@õ`õ€õ€õ€õ€õ€õšõõ²õ¹õ»õÄõ×õÙõåõåõíõÿõÿõ öö5ö?ögöyö•öµöÖöêö÷-÷@÷_÷…÷ž÷­÷Ã÷ß÷ä÷ä÷øøø0ø0ø<øNøSøSøgø…øªø½øÜøù#ù2ù`ùrù|ùžù ù ù ù¬ù¬ù¬ùÊùúùüùüù ú úúúúúú'ú,ú?úŽú_\ +·Q·QÉQßQûQR R2R=RRR?RaRiRtRŠR€R¢R¨R`øAï<ï< ====%=)=+=2=9===A=T=|=—=„=¯=´=Ø=Ø=ä=ì=û=5>:>g>o>t>}>‰>‘>˜>º>À>â>ä>??4?:?A?A?G?J?N?_?‚?”?a$GáGáVáqáqáwáb|XsÇëÇëáë ì ì,ì<ì>ì>ì>ì>ìEìMìhììƒìƒìƒì‹ì¦ì¨ì¨ì²ì²ìÊìc”"§5§5É5Ó5ß5ä5ô5ú56#636A6O6f6n6x6‡66œ6¤6§6§6§6©6¸6Â6Ë6Ó6Ö6è6dôÍ×9×9: ::: :6:M:d:o:¥:Å:Ê:Ï:Ú:ô:;;);?;V;[;m;r;u;•;µ;½;Å;Ê;ê; +<<<<<<D<I<N<Y<Y<d<d<p<p<‚<Â<Û<Û<ë<ed¤¹((8?KQYgz† ­­°¾Îèìôf(¸þr*r*ˆ**¡*Ð*à*ç*÷*+ +++8+b+s+++ˆ+˜+¤+´+½+Ô+Ô+ê+ê+,,,,,,,,B,B,X,X,n,n,„,„,›,›,²,²,É,É,à,à,÷,÷,--%-%-<-D-O-`-k-|---˜-Ÿ-á.g¬÷  8 > E M U X c u u Œ “ – ˜ ¤ µ µ ¸ À Ö Ù ç ê í ô ø    3 6 … h(ÅËǃǃîƒÛƒýƒ„„i=ÏQÏQòQR RRR$R1R7R@RFRKRjRƒRˆRŽRR’RŸRŸR¤R­RµR¾RÆRÈRÐRØRàRíRóRþRSS S/SPSWSbSkS|S€SˆSˆSœS¬S´S·STj8-7"0"060:0?0J0U0X0\0d0kˆWõ‡Š‡Š¡Š¼ŠŠÉŠÉŠЊõŠúŠ‹#‹ ‹2‹E‹W‹`‹h‹r‹‹¢‹«‹³‹½‹Ø‹‹ç‹ù‹Œ Œ#Œ ŒHŒ2ŒWŒiŒsŒ{Œ{Œ„ŒŒŒ¢Œ»ŒÍŒÜŒàŒàŒçŒìŒ + 2226Bcmw€¡«µ··Ôâðó ŽŽ+Ž/ŽNŽRŽmŽqŽqŽqŽwŽ…ŽŽ¨Ž®Ž¹ŽÅŽÇŽÏŽÕŽîŽùŽ*-5ACKNgiuw…ž¶Â×Üñ++6AYez”¤½ÎÎÔßçõü‘leã–à–à°à¹àÙàÙàßàçàïà÷àÿàááá á%á%á+á0á0á6á;á;áAáFáFá^áqáwá|á|á…á¥á¥á¥á¬á®á®áµá·á·á½á½áÄáÆáÆáÌáÌáÓáÕáÕáÛáÛáâáâáêáðáöáþáþáþáþá +âââ"â*â2â:â@âXâgâqâtâtâ~â„âŠâŠâŽâ–ââ¥â­â±â·â¿âÆâÎâÖâÚâàâëâñâþâ +ãããã#ã+ã3ã7ã=ãEãLãTã\ã`ãfãqãvãŒãã¢ã¥ãJäm`b!b!k!r!†!š!Ÿ!½!Â!à!â!"""-"6"8"L"\""n2Ò`•`•v•‡•˜•©•º•˕ޕæ•ô•––#–0–E–E–X–i–o–„–Ÿ–Ÿ–«–³–»–Á–Ö–Þ–â–ê–ø–þ–———-—4—<—D—J—m—€—Œ——š—³—¹—»—È—Ê—Ü—Ü—ã—ë—ý—ý—.˜<˜O˜S˜]˜a˜m˜q˜}˜˜˜‘˜‘˜§˜º˜À˜Ä˜Î˜Ò˜á˜å˜ô˜ø˜ ™™™™™&™4™A™I™`™p™~™‰™Ÿ™¬™»™Ã™Ð™ë™û™ šššššš,š4š:šOš^šsš„š”ššššššš¬š²š¾šÄšÑšìšüš›››-›;›]›çœoÔ¼íXnXnjn{n†n‘nªn¼nÔnÙnènïnünooooo"o$o*oDo^otoŒo‘o o§o´oËoéoðoòoõoúop;pGpp$hm&& &4&;&U&qxKeTT§T“T¶TÑT½TàTåTìTôTûTUUU!U,U7UMUBUeUmUrR u u;uBuZuru|u‡u‡uŒu—u£u®u¼uÌuÜuãuéuþuvv'v/v?vLv[vhvyvŠv˜v¦v­v³vÈvÝvÝvñvþvw w(w9w9w?wMw^wkw{wÝws8³½QQƒQˆQQžQ¬QµQºQ¿QÁQt88Bj0j0~0‚0‡0’0œ0Ÿ0£0«0u0ˆŸOŸOµOÈOÕOÛOÞOæOvÜt††¨³¾Ç×éïõû%25=OUZ}”š±·ÇÍÙçìú!*:<CHPo}‰£ÂÉÓâèîôú1EQhs‚Ÿ¬¼Êáíò.ENT_djŒ™  ®½¿ÍÜîîö$Xw`-A—ˆ—ˆ­ˆ¿ˆƈʈÙˆøˆüˆ‰‰5‰7‰7‰h‰V‰7‰‡‰‘‰xD‡ÔGåGåYåaålåråxå|å€å¬å¬å³å¶å»åÍåÑåøåüåæææ æææ-æ1æBæTæXæZælæpæŒææ•æ•æ©æ¬æºæÄæËæñæüæçç;çTç_çcçtççƒç…çç”ç”ç¨ç¬ç®ç®ç¹ç½çÑçÕçÕçÕçÙçûçyˆÕóÿçÿçè)è)è)è+è+è2è4è4è;è=è=èJèLèLèYè`èbèbèoèvèxèxèè•è•è¥èz°0XÇ]Ç]ß]ç]ò]V^<^1^^^\^n^^^Ž^Ž^¥^™^×^Ü^è^ý^ê^ ___=_,_ _T_V_r_r_y_£_£_£_¯_{ÄL¹.ü.üLüWübüˆüˆüŠü—ü¢ü¨ü¹üÈü×üäüäüêüïüôü +ýý(ý,ý>ýKýSý^ýZýuýƒýƒýƒýŽý©ý”ý±ýÄýÆýâýÎýêýøýøýúýþþþ#þ,þ3þ6þXþlþ_þtþzþƒþƒþƒþ–þ›þ›þ£þ£þ®þÃþÌþÌþÌþÌþèþÿþÿ +ÿ +ÿ ÿ%ÿ*ÿ*ÿ6ÿSÿsÿxÿ}ÿ}ÿ‰ÿ¦ÿµÿÄÿÌÿÑÿ×ÿÜÿÜÿãÿêÿ *,I^^ddqzz˜®¹¾ËÖßç÷06_hhjqvvƒŽ”°½ÏÚèñö )49@H[pu|‰¢·¾ÄÍÍÖð÷ü +((.5>>Qcffw‡“°·ÄÆÍáððð''<GYfqŠ™  ¹ÌÎÝòô&&39KKX[fxŠ—ž©®ÃÅßôôôöý"44:AJOs||‚‹‹ªª·ºÃÌÔßñ÷$,7IOZZgjs|~ ³ÈÎÙëñùùùù} |t·ÐJ4J4\4e4h4q4z4Œ4Œ4¸4¼4Á4Ä4Í4Ü4â4å4í4ð4õ4ÿ4}`2¯R¯R×RÃRæR S÷RS S&S.S5S@SHSSSiS^SS‰S~À-àgàgþghhh"h"h,h>hKhNhPhYhfhfhthˆhˆh¬h¹h¹hÉhÖhÖhùhiii=iRiti}iŠiŠi­i·i·iêij#j#j#j5jt¶R3R3f3‡3™3­3´3À3Ú3ã3é3ü344444 444:4<4<4D4€¸ºäøøŽŽŽ"Ž/Ž2ŽLŽLŽLŽRŽVŽ^ŽiŽ}Ž‰Ž‹Ž‹Ž”Ž–Ž–ŽŸŽ¡Ž¡ŽªŽ¬Ž¬ŽµŽµŽ¾ŽÄŽÇŽÑŽâŽèŽôŽôŽ\œøÿ)ÿ)*.*F*M*i*^**¡**°*Á*Æ*ç*Ó*ÿ*+#+?+4+W+w+c+†+—+­+™+Å+Ò+Ò+ê+ê+ô+‚œ¢ç3ç3ó34484h4y4Š4œ4£4ª4¾4Å4Ó4ë4ú45 +5#5&5+5B5R5b5f5m5£5ƒx± P±P±f±m±t±“±¢±±±À±Ï±Þ±è±è±í±ô±²²²6²P²P²f²x²|²Š²‘²–²–²²¯²¸²º²È²Ú²Ú²Ú²ì²÷² ³³!³&³6³;³K³W³\³i³n³~³ƒ³“³•³¥³§³·³¹³Ê³Ó³Ó³Õ³å³ì³ü³ü³´)´;´M´]´]´]´`´s´„\åø``{‚‡•ª±»ÉÌÎØêêñ'…0ÎÖff~¾²ˆ†ÒÚ†`,—‡—‡­‡¿‡ƇЇ߇ø‡ü‡ˆˆ5ˆ7ˆ7ˆhˆVˆ7ˆ‡ˆ‘ˆ‡L[j_2_2m22…22Ÿ2¥2®2À2Æ2É23ˆ(–œ"3"303?3C3F3L3‰\k~333'3-353G3M3V3h3n3w3‰33’3à3Š, >×>×L×S×[×`×f׋„ ÇÇå÷þ;;@bwd†•—¹¹¹ÈäÚüŒ`J§i§iÄiÌiÓiøijjj#j)j4jKjZjejijtj€j‡j“jªjÁjÔjëjõjkkk%k7k7k@kQkWkgkgkkk¤k¤k©k©k²k¾kËk×kìklll/l;lRljl‹l‹l”l™l™l™l™l©l²lºl¿lÍlÛlëlðlðlþlþlmm mm*m0mpGpXpapmp}p}p}p‚pšpšp©p¬pÀpÞpépq$q/qAqEqJqQqcqsqŽq•q™qŸq§q²qÁr8í÷_)_)y)Ž)¤)Å)²)Ý)õ)õ)ÿ)Ž`j~€ €   § ¯ º Ä Ï × æ ð ó ¡¡*¡*¡8¡_OÛOÛqÛxÛÛ„Û›Û­Û·Û½ÛÏÛÔÛàÛèÛëÛíÛ÷ÛÜÜÜ ÜÜÜ'Ü0Ü8Ü;ÜDÜ_ÜpÜwÜzÜ܎ܔܜܜܣܦܫܺÜÀÜÈÜÈÜÖÜÙÜÞÜíÜøÜÝÝ Ý Ý&Ý-ÝDÝ83=ØØ'Ø'Ø5Ø9ØGØJØOØ‘8>HVØVØ_Ø_ØmØqØxØ{؀ؒDDQg1g11”1ž1¥1±1É1Ò1Ö1è1î1 2“Ä{¨¹¼ÃÈÎÐÕÛÛíô +,24;AKK_ahnxxx¡¨·¹Ïââô”0RZ222>2O2U2U2]2•„\y¦ò¦ò¸òÍò×òàòâòéòùòóóóóó*ó-ó-óQó\ó^ówó~ó‚ó‘ó¤ó÷ó–  +^0^0g0„0‰0—hÿfÿfg g+g9gDgMg^gggxg~gŠg¡g¡g³gÄgÑgÚgëgñg?h˜„a~WMWM‡MM–M¢MªM±MµM¾M¾MÃMÊMâM NN5N=N?NWNoN“N²NÄN™lò ··Ïáèï5J7lY{{”¶¶¾š y}°‹°‹¹‹Å‹Ê‹›(A~è~è è¨è®è¶è¸è¸èÉèÉèÉèÑèÙèëèúèëèééé+é-é-é8é=éWé\é\é\éqésé€é‚éé‘éžé¦é®éµéÄéÑéÓéäéñéñéñéúé ê ê%ê-ê/ê<ê<êQêQêQê\êfê~êƒêƒêƒê‘ê—êœê¤ê¯êÁêÌêÑêÑêØêÜêêêîê÷êþêë)ë0ë9ëUëZëZëZëZëbëmë{ë{ë›ë›ë›ë¢ë°ë¿ëÒëåëçëçëçëúëúëìì ìì%ì/ìKìuì{ì{ìì”ì¸ì¿ìËìéìüìííííííí'í5íWíbíí‰í‰í—íµíåíøí î î3î8î8î8î@îKî]îhîmîmîmîî©î¯î¯î¯îºîÄîÐîÛîÝîÝîÝîâîîîîî8ïœH%‚/‚//—/¢/¯/º/Â/Â/Ú/ä/ê/ð/0 ?Q?QfQSQuQ‘Q‡Q©Q±QžLÝìO(O(i(~(”(µ(¢(Í(Ò(ý() )6)N)N)X)Ÿð·ÇNÇNüNOOO$OCOCOMOOOjOROyOyO‡O‘O˜O¸OºOÔOÛOÛO÷O÷OP#PBP[PxP{PƒPŠPªP¬PÆPÍPÍPéPéPQQ-Q?Q TVgÎÎäñ÷ý*<@FTWa¡0 +R¿¿îãû2AMR^nu‚™¤¬±½ÂÖÝáìñü*/CJNNSlqŠŸ±¶ÁÉÉÉËäù    & . . > 3 V v ¢àZŽÈeÈeâeðeõefff4fBfgfpf€f›f¦f¶f¸fºfÄfÐfÔfáfífÿfg g#g#g#g#g(gFg`g`gggjgrg~g‡gÝg£d1÷+÷+,-,>,E,a,V,y,™,…,¨,¹,Ï,»,ç,ô,ô, - --¤ü!\ 1<iOCx™®›ãɽò!>>sŠ~¼ÁÔÈüê ,D1_S‡u–³³³Åââ +,,4¥(ŽåŽåœå¿åÅåÊåÊåÐå¦(!'Æ×Æ×Ï×Ý×ã×å×ê×§D]j::2:9:B:N:c:k:q:w:y:y:‰:¨„¼Ùàªàª« «#«+«3«7«B«F«J«N«V«[«_«p««ƒ«‡«˜«©«¸«Ë«Ó«Þ«Þ«Þ«ð«©€èœèœ,7ALcfhƒ—ž©»ÃÃÙÙëª Ê oYoY•Y²YºYÅYÕYÞYâYýYZ,Z2Z:Z=ZRZWZiZ‹Z‘Z™ZžZ¤Z§Z½ZÆZÈZêZòZ[ [[=[C[H[H[H[U[f[q[~[Š[[ª[·[Î[â[ì[î[\\\)\0\S\S\S\e\«<ÑÜ55 555$5,545;5K5K5P5¬°)8£8£[£h£m£q£z£‰£•£ £«£³£¾£Æ£É£Õ£Ý£÷£¤¤-¤6¤k¤W¤{¤{¤“¤ž¤º¤Á¤å¤¥¥¥¥¥­˜‹-&¹&¹C¹J¹R¹]¹t¹~¹~¹•¹Ÿ¹º¹Ð¹Þ¹â¹ºº*º1º5ºNºXºiºvºvº}º„º‰ºŽº“ºšº¡º»ºÂºÒºÖºÖºàºöºúºúº »»1»1»7»B»I»Q»\»c»k»v»}»}»ˆ»¦»ª»Â»³»Ý»Ý»ã»ê»ù»¼¼¼¼¼0¼0¼0¼B¼J¼p¼~¼~¼‚¼—¼Ÿ¼¯¼º¼Ï¼Ô¼â¼ñ¼û¼ ½½½½%½)½8½:½I½K½Z½\½k½r½v½Š½”½¢½©½­½½½È½Í½ë½õ½¾ +¾¾¾&¾-¾1¾;¾O¾W¾b¾f¾f¾f¾q¾|¾Œ¾˜¾®¾¶¾Á¾Ð¾Ø¾ã¾è¾ð¾û¾¿ ¿¿¿/¿7¿B¿B¿B¿B¿_¿|¿ˆ¿¿ ¿°¿Î¿Ò¿Àö¿ç¿ÀÀÀ"À1À@ÀJÀXÀ_ÀcÀeÀtÀ~ÀŒÀ“À—À—À™À«À«À½À½À½ÀÏÀáÀéÀÁ-Á;Á?Á]ÁdÁkÁvÁŒÁ‘Á˜Á«ÁµÁÃÁÊÁÎÁÐÁãÁíÁûÁ Â.Â8ÂFÂQÂUÂUÂZÂbÂfÂuÂw†ˆ—™¨¯³ÂÇÂÑÂßÂæÂêÂúÂà +Ã(Ã2Ã@ÃGÃKÃUÃcÃjÃnÃxÌÔßãããîõÃÃÃÝÃíÃøÃ ÄÄÄ-Ä9ÄOÄWÄbÄqÄyĄĉđĜĨĬķļÄÐÄØÄãÄãÄãÄãÄ÷ÄÅÅ)Å-ÅAÅRÅgÅtÅxņśūÅÂÅÛÅôÅöÅÆ Æ ÆÆ/Æ@ÆWÆpÆ~Æ‰Æ•ÆÆŸÆªÆ²Æ²Æ²ÆÏÆÝÆëÆÇÇ(Ç5ÇUÇ\Ç\ÇlǀǚǚǞǴÇÃÇÞÇéÇÈÈÈ-È-È@È[ÈdÈ{ȕȤȱÈÑÈßÈõÈÉ!É9É9ÉQÉQÉ]ÉxÉəəəɥɶÉÎÉ×É×ÉÞÉçÉíÉùÉXÊ®<ùD((MYdnt~„Žœ¦¸ÂÈÒØâéõû‘/‘>‘A‘C‘M‘_‘i‘{‘…‘š‘š‘‘§‘¼‘Á‘ёܑá‘õ‘÷‘’+’+’5’J’X’a’i’w’ˆ’˜’©’¶’¶’Ã’Ã’Ë’Ù’ “¯$› _P_PsP{P†PŒP°l£:§F§FÀFØFèFGG2GMGMGwGGƒG†GŠGG™GœG£G©G°G¶GºG¿GÉGÚGáGèGêGîG÷GHHHHH/H:H@HGHPHiHzHƒHŒH”HŸHªH¶HÇHØHäHòHôHûHII II IBIPIZIdImI†I—I I©I±IºIÀIÄIÉIÍIÚIáIïIùIJJ!J:JKJTJ]JeJnJtJxJ}JƒJJ—J¶JÄJÊJÏJ×JßJçJôJüJKK0K9KTKhK{K‚K‹K”K›K¤K­K¶KÏK¿KßKãK=L±  ¨ˆ¨ˆ¶ˆØˆÞˆ²¸·z'z'ˆ''È'Ê'ÿ'*(*(:(?(?(S(X(X(t(y(y(™(ž(ž(²(·(·(Ô(Ô(â(),)L)^)p)‚)’)’)’)’)™)r*³$bgÊ%Ê%Î%æ%ø%&´ƒgÃgÃyÈÈËÔààöÃÌÃÞÃåÃéÃùÃÄ+Ä1Ä@ÄIÄMÄSÄ\ÄrÄvēıÄÃÄÉÄØÄêÄöÄøÄÅ ÅÅÅ Å Å Å1Å<ÅBÅXÅ_ÅgÅ}ńńńŒŹÅÂÅÊÅÜÅäÅíÅøÅþÅÆÆ#Æ*Æ?ÆPÆPÆWÆWÆWÆeƌƙƢƪƼÆÄÆÍÆÍÆØÆ߯íÆñÆýÆÇÇ#Ç2Ç;Ç?ÇGÇPÇPÇ^ÇfÇlljǒǚǠǦǦǦǭǴÇÃÇËÇÑÇ×Ç×ÇÙÇãǵx7Ú7ÚEÚZÚaÚlÚ‚Ú¬ÚÈÚÏÚçÚíÚüÚÛ ÛÛÛÛ#Û2Û:Û@ÛBÛHÛ¶¤Ôy·e·eÚeâeòeúef5f9fAfIfOfXfdflflftf¤fãf¾fg gg#g%gSgYgbgigqgyg…gg•g¨g°gµg¿gßgægègògh!h(h*hJhQhQhQhZhahzh€hˆhˆhh‘hh¦h¯h»hÞhìhii9iFiZitixi—i¥i±ißiåiçijjj4jAjUjojwj{j†jŽjžj jÎjÑjÙjéjëjk k k)k)k4kekmkmkmkmkvk‚k˜k±kÄkËk×kÞkÞkñkõkõkõküklll'l.l.lHlJlOlblilul|l|l‰l“l“l˜l»l»lÍl·à˜Ì÷C÷C D*DD_DED9DnD}D…DD’DD¨D¨D­DâDçDE4E!EVECEjEeE†E•EE¨EªEµEÀEÀEÅEæEèE F FFF7F9F[F[F[FcF¸\îff%f7f=fHfVfbfyfyf‹f‘fœf¬f·fÅfÒfþf¹ÛÜ— — µ È Ï Ö Ý á ã ê ñ õ õ ý    4 ? M ^ b g {  ˆ Œ ‘ — ´ ´  Ù Þ ÷ ! ! ! !!!&!-!@!D!I!]!e!n!r!t!{!!!´!¶!Ï!â!æ!æ!æ!ú!þ!" """3"3"A"X"]"v"‡"‹""""¢"±"Õ"÷"###/#4#?#S#W#`#d#f#l#…#…#“#ª#¬#Å#Ö#Ú#Ú#á#ô#ø# +$$#$+$4$8$=$D$Z$j$$†$Ÿ$²$¶$È$È$È$È$Í$ï$þ$"%-%3%I%Z%Z%Z%a%t%%%%œ%œ%¯%Æ%Ñ%â%ç%í%÷%ù%&& &&,&.&9&N&Z&\&g&s&ƒ&Š&‘&›&£&§&«&­&²&º&¾&Ð&Ò&×&ß&ã&å&å&î&û&'1'K'Y'e'l'l''ƒ'ƒ'ƒ'Š''©'·'Ã'Ê'Ê'ä'æ'ë'(( (&(&(3(=(=(O(º  ¿£XJXJuJ„J„J„J¡J¡J²J²J¸JºJºJÀJÂJÂJÈJÊJÊJÑJÕJÚJÚJÚJÚJÚJÚJâJúJúJKK$K1KIKKKjKlK‹KK¯K´KºKºKÓKÖKýK +L"LBLBLKLPLnL\LtLƒLˆLL˜L«L³L»LÀLÀLÀLÉLâLèLèLMM,MEMGMOMUM]MbMbMhMhMqM‚M„M™M›M£M©M±M¶M¶M¶M¶MÄMÛMÝMñMñMùMÿMN NNN&N,N2N4N4N4N]J]S]Y]Y]b]x]x]~]‡]]]¦]¨]®]·]Í]Í]Ö]Ö]Ö]ß]ä]ä]ì]ñ]ñ]^^(^-^3^=^E^J^J^J^^^g^m^^‰^‰^‘^‘^™^›^›^´^¾^Ç^É^É^É^Ï^Ó^Õ^Õ^Õ^Õ^Ú^à^æ^ê^ab»Ìz©ÏlÏlñlülm.m;mRmempm†mrm•mmm¬m¬m´mÀmÖmëmúmnnnnn#n(n7nBn\n^ncnrn}nŠn”n”n¢n¼”*K€¥€¥˜¥Ÿ¥¦¥©¥²¥µ¥¸¥¼¥Á¥ã¥Ð¥ó¥û¥¦¦¦¦!¦*¦0¦3¦D¦b¦s¦~¦°¦½à.¢·B·BÕBàBñBôBøBCCC%C;CLC]CoCCCŸC°C¿C¿CÍCÑCÕCÚCÞCëCòCDDD#D1DJDLDPDZDZD_D_D_DdDdDsD|D„DšDšDšDŸDŸD·DÃDÎDÓDÓDÖDÛDÛDúDEEEEEEE:EFERETETEWEYEYEfEhEhEkEkEtEzEE›E›E›E›E›E›E›E›E›E›E›E›EE®EÀEÏEÞEÞEâEâEêEFF F§F¾,××$×+×3×8×>׿l3JSS¥S¿S«SÎSóSßSTTTTTTT#T;TFT\TQTtT~TÀPQaâ$â$ð$þ$%%&%+%H%N%U%\%j%v%ˆ%Ä%ÁD+ÖåÖåêåøåþå!æ'æ-æRæXæ^ædædælæÂô#œï6ï6÷67 +77$787G7d7q7ƒ7¥7Í7Û7÷7 8!888C8d8‚8‘8¬8·8Ò8ë8ë89/9I9d9v9…9”9”9Ÿ9²9Ã9Ö9æ9ó9ÿ9:+:+:3:3:3:D:Q:X:w:€:‘:•::¨:À:Ø:á:ñ:ù:þ:";2;B;M;a;f;n;”;–;¡;Ô;î;î;<<<,<5<=<O<q<y<<Œ<Ž<ž<¶<Î<æ<þ<='=0=9=K=Y=]=a=à àˆàˆéˆ‰ ‰Ä\ˆ[¾Í¾ÍØÍßÍìÍ÷ÍüÍÎÎÎ2Î8ÎVÎlÎwÎ}ΟΟίÎÄÎÆÎÉÎÕÎÝÎåÎíÎûÎÏ +ÏÏÏÏ*Ï0Ï5Ï5ÏLÏLÏjÏjÏ}ÏŠÏÏϦϯϾÏÔÏßÏíÏøÏÐÐ'Ð-Ð7ÐCÐPÐRÐRÐZÐ_Ð_ÐgÐlÐlÐtÐyÐyÐІІЌББИÐÐФЩЩдййÐÄÐÉÐÉÐÔÐÙÐÙÐäÐäÐÿÐÑ ÑÑÑÑ1Ñ>ÑMÑTÑWÑiÑkÑqхђѡѡѡѡѫÑÅÑÚÑìÑýÑÒÒÒ"Ò-Ò?ÒPÒ_ÒeÒvÒÒ‹Ò›ÒªÒ°Ò»ÒÁÒÖÒÜÒíÒøÒþÒÓÓÓ1Ó=ÓEÓUÓ\ÓbÓsÓ~ÓƒÓ ÓµÓÃÓÓÓßÓñÓüÓ Ô Ô Ô'Ô,Ô3Ô7ÔEÔOÔUÔ_ÔeÔpÔvÔxԅԒԜԵÔÃÔÃÔÉÔÐÔ×ÅD#° ­ ­?­a­i­i­w­Š­¤­§­°­Ì­Ì­Ì­Ô­Ö­Ö­Þ­à­à­è­ê­ê­ò­ò­û­®®®®®"®'®-®2®2®2®2®:®C®I®N®N®S®`®y®˜®›®±®Ð®Ð®Ð®Ø®Ú®Ú®Ú®â®ä®ä®ä®ì®î®î®î®ö®ø®ø®¯¯ ¯¯¯¯¯¯ ¯2¯@¯N¯X¯X¯X¯h¯h¯o¯s¯y¯‘¯Ÿ¯²¯¿¯è¯ë¯ô¯û¯°° °+°+°6°<°A°A°A°H°N°c°k°q°|°“°ª°¶°¼°Á°Á°È°Ó°Ó°Ø°ê°ð°ð°ð°ð°L±Æd*DD2DyQyWy\ypyvy~yy–y˜y§y´yºyÀyÅyËyÑyØyäyëyíyòyúyüyz zzzzz#z+z-z2z:z!c!g!j!z!‚!‡!‡!Ž!—!¨!®!·!Â!Ó!Ó!Ü!á!ë!ò!ù!"" ""."1"@"M"Z"Z"Z"Z"`"r"{"Œ"­"¾"Ö"Ý"ç"ï"ö"ö"ÿ"##"#-#-#-#A#U#e#h##$æ„9ò7ò788$8(8>8k88’8›8©8»8Ô8Ô8æ899 99çX{Í^^‰“¦±ÃÑ×èï÷ (=MWYiy‚ˆ”𠦱¼¿Æàè$'/3ET[c~›Ÿ¨¯ÁÉÐÔÝßñ "///1HNN`è  +€ˆ€ˆ‰ˆˆ¢ˆé¤ŸÄ/‚/‚K‚Q‚c‚h‚n‚q‚u‚u‚˜‚‚Ê‚¶‚Ù‚ò‚Þ‚ƒƒƒ&ƒ.ƒ3ƒ9ƒ<ƒ@ƒBƒ[ƒGƒjƒjƒjƒ…ƒ´ƒÀƒê˜Ìîââëææúõ ""11@@OO^^m|‹‹š©¸#ëxÓíßdßdýdee!e8e8eJePe[ekewe€e†eŒe—e¥e²e¾eÌeÛeÛe fìd”©×í×íÛíîíîíîîîî2î2îIîIî`î`îwîwîŽîîî”îíÌÂñ)0;QQcn‚†‹‘—©µÊÌåôøøø   ,2<GU\km†  ²îP7G`E`EvE‚EŠEŽEŸE­E³E¿EÇEÒEØEÛEåEï ®- > >9>D>H>Q>X>_>u>†>—>©>»>Ê>Ù>ê>ù>ù>?? ??!?*?1?5?U?U?U?U?U?a?e?h?p?~?†?“?›?£?´?¿?Ä?Ä?Ñ?×?æ?ý?ÿ? +@@"@%@+@'@?@V@X@f@h@s@y@y@@@“@š@°@°@°@µ@µ@Í@Û@æ@ë@ë@î@ó@ó@A A-A/A/A3A5A5ATAbAnApApAsAuAuA‚A„A„A‡A‡A‡A‡A‡AA–AšA¦AÆAÓAáAèA°Bð(rx€‹€‹Ž‹•‹¥‹¨‹®‹ñ(ntZ&Z&c&m&~&‰&‰&§&òTzKþóþóô"ô%ô.ô8ôPô`ôiôoôrôvôxôô ô­ô³ô·ô½ô¿ôÂôÆôÆôéôíôóôóôúôõ1õDõWõ]õdõoõyõ}õ€õ‡õõ‘õ—õ¨õ®õ³õ¸õÅõÇõÙõÛõâõïõñõööööö'ö2ö>öUöUöjövö“ö·öÑöÖöíöòö÷÷÷"÷3÷H÷N÷^÷k÷÷†÷’÷ª÷¶÷¶÷¶÷¼÷¿÷Â÷Û÷á÷õ÷û÷ø ø øøø*ø*ø0ø>øUø[ø^øaøhøqøxøxø}øŠø—ø—øø«øÂøÈøËøÎøÕøÕøæøíøúøùùùù ù%ù,ù7ùKùKùeùjùqùyù€ùù”ùùµùºùÁùãùîùôùüùú)ú)úDúDú^úlúsúzúœú¯úÓúÕúßúûûûû&û7ûPûTû)üóÀ€¬¯a¯aÇaËaÐaßaêaöabøa&b+b+bPbbdbWb¤b©bÒb×bãbcåbcc1c8c[cqcqc—c—c£cô .0.0=0V0\0õ4‘šçOçOÿO"P/P5P;P>P^Pö8 â.â.ð.÷./ +/////#/÷ :>7171A1I1N1øÎP¯x¯xÍxÝxèxþxy*yNy|y‚yˆyy’yšy¯y²y½yÉyßyüy z/z]zczizqzvz~z“z–z¡z­z²z¸z¾zÆzÎzÖzæzþz {:{@{E{M{]{ƒ{±{·{¼{¼{Í{Ø{ã{||$|,|:|:|?|R|i|k|ˆ| |¬|´|Â|Â|Ç|Ú|ç|ñ|} }8}J}W}y}}§}µ}·}Î}å}å}î}ú}~)~<~G~Z~^~^~^~e~j~}~ˆ~¢~¤~©~¼~Ç~Ô~Þ~Þ~ð~ù˜k ::¦:²:²:È:Ó:Õ:õ:õ:õ:ü:; +;;;;;;4;4;j;v;ˆ;˜;¯;´;·;¼;¼;¼;Ø;ß;ì;ó;û;<<<(<0<5<5<Q<^<f<k<k<‡<“<œ<¤<¬<¸<Î<Ù<ü<=====7=Q=[=g=o=t=t=“=Ÿ=±=¶=Ò=Þ=í=ò=>>>>>>>>>>:>F>X>Z>]>b>b>b>l>t>{>ƒ>Œ>—>>ª>¸>¸>Â>Ë>Ó>???$?>?C?C?V?^?^?`?`?`?e?e?l?r?v?}???????µ?¾?¾?Â?ÝCú(àCàCîC÷CD DûªÊ§n§nÅnÍnÙnïnooo,o2o2o2o7oNø‰ø‰ŠŠŠ/Š7Š;ŠEŠOŠWŠZŠ`ŠT¡²PP©P¼P¿PÉPÖPëPíPÿP QQQ#Q&QzQ<˜£ÐŒÐŒäŒëŒ÷Œ ' 26nænæ|æˆæH!/W]W]k]w]]y]œ]ž]¥]°]¼]Ä]D>‹ T TATLTQTYTsTzT|T|T˜TžT T«T²T²T¶TÅTÎTÖTßTçTîTõTùTUUUUU2U6ULU_UeUyU~U‹U‹UŸUªU±UºUÈUÑUôUúUþUVV VVV&V/VCVJV\VpVwVwV~VVÓVläûNäNäbäxä†ä‘ä•äœä ä©ä¸äºäºäÎäÐäÙäßäßäßäßäçä´KtðEðEF'F,F3F=F=FEFXF\FaFvFxF{FF†FšFžF¦F²F¹F½FÅFÇFÏFÝFåFçFêFG GG!G%G3G -Q_s_sos{s‡s—s¯sµsÃsÔsÜsãsüs)tCtPt]tmtstut†t¨t¯tµtÃtËtátìtòtøtu ôB»8j8jRjUj\jgjvjxjƒj’j’jŸj­j°j²j²j·j¼jÅjÐjÖjßjòj÷j kk!k!k7k7kdkxkk•kšk¡k§k®k³k³k¹k¿kÄkÄk×kåkýklll&l-l-lJlelklplpl›l l lËlòl÷l÷l÷lúlmmmmmm m$m$m;mOmUmxm~mŽmšm m®mµm·mËmÑmØmØmÚmÚmÚmßmåmêmîmðmómþm nnnnnnn)nSn +˜}Ÿ&$&$B$G$N$X$^$i$y$$‰$Ž$™$£$©$´$Ä$Ì$Ü$ã$ë$ó$û$%%%!%!%7%  B†—?—?¯?¶?É?ñ?ü? @@ @@@@@L@T@c@@Ÿ@Ì@Ô@Ô@ A!AABA0AQAWAfA{A}AˆAAA±A¶A¿AËAÓAñAÞA&B BB5BRB=BrBŠBwB¬B™BÍB»BÜBîBäBCCC.C.C:C Ð1 “ “4“4“Z“Z“z“~“ƒ“ƒ“ƒ““”“¤“©“©“©“®“®“ǓΓݓë“ô“” ”””””””$”+”2”9”@”G”G”I”I”O”T”[• D ,ÇrÇrÕrßrérùrþrsss's's)sYs \ No newline at end of file diff --git a/Compiler/Compiler.PRJ b/Compiler/Compiler.PRJ index 982b1d9..72015bd 100644 --- a/Compiler/Compiler.PRJ +++ b/Compiler/Compiler.PRJ @@ -4,11 +4,11 @@ Option(OPTf_WARN_DUP_TYPES,ON); Option(OPTf_KEEP_PRIVATE,ON); } -#include "/Kernel/KernelA.HPP" -#include "/Compiler/CompilerA.HPP" +#include "/Kernel/KernelA.HH" +#include "/Compiler/CompilerA.HH" #exe {Option(OPTf_EXTERNS_TO_IMPORTS,ON);}; -#include "/Kernel/KernelB.HPP" -#include "/Kernel/KernelC.HPP" +#include "/Kernel/KernelB.HH" +#include "/Kernel/KernelC.HH" #exe {Option(OPTf_EXTERNS_TO_IMPORTS,OFF);}; #exe {Option(OPTf_KEEP_PRIVATE,OFF);}; #include "Templates" diff --git a/Compiler/CompilerA.HPP b/Compiler/CompilerA.HH similarity index 100% rename from Compiler/CompilerA.HPP rename to Compiler/CompilerA.HH diff --git a/Compiler/CompilerB.HH b/Compiler/CompilerB.HH new file mode 100644 index 0000000..5db759f --- /dev/null +++ b/Compiler/CompilerB.HH @@ -0,0 +1,79 @@ +#help_index "Compiler" +extern U0 CInit(Bool first); +public extern I64 ExeFile(U8 *name,I64 ccf_flags=0); +public extern I64 ExeFile2(U8 *name,I64 ccf_flags=0); +public extern I64 ExePrint(U8 *fmt,...); +public extern I64 ExePrint2(U8 *fmt,...); +public extern I64 ExePutS(U8 *buf,U8 *filename=NULL,I64 ccf_flags=0, + CLexHashTableContext *htc=NULL); +public extern I64 ExePutS2(U8 *buf,U8 *filename=NULL,I64 ccf_flags=0); +public _extern _LAST_FUN I64 LastFun(I64 argc,I64 *argv); +public extern I64 RunFile(U8 *name,I64 ccf_flags=0,...); +public extern I64 RunFile2(U8 *name,I64 ccf_flags=0,...); +public extern CCmpGlbls cmp; + +#help_index "Compiler/Directive" +#help_file "::/Doc/Directives" +public extern Bool Echo(Bool val); +public extern Bool GetOption(I64 num); +public extern I64 PassTrace(I64 i=0b1001111101); +extern U0 StreamDir(); +public extern I64 StreamExePrint(U8 *fmt,...); +public extern U0 StreamPrint(U8 *fmt,...); +public extern Bool Trace(Bool val=ON); + +#help_index "Compiler/Lex" +#help_file "::/Doc/Lex" +extern U0 ClassMemberLstDel(CHashClass *c); +public extern U0 CmpCtrlDel(CCmpCtrl *cc); +public extern CCmpCtrl *CmpCtrlNew(U8 *buf=NULL,I64 flags=0,U8 *filename=NULL); +public extern I64 CmpCtrlSize(CCmpCtrl *cc); +public extern I64 IsLexExpression2Bin( + CCmpCtrl *cc,U8 **machine_code); //FALSE=no err +public extern I64 Lex(CCmpCtrl *cc); +public extern U0 LexAttachDoc(CCmpCtrl *cc,CLexFile *tempf=NULL, + CDoc *doc=NULL,U8 *abs_filename=NULL,CDocEntry *doc_e=NULL,I64 col=0); +public extern CD2I32 *LexD2I32(CCmpCtrl *cc,CD2I32 *p); +public extern CD3I32 *LexD3I32(CCmpCtrl *cc,CD3I32 *p); +public extern U0 LexExcept(CCmpCtrl *cc,U8 *str=NULL); +public extern I64 LexExpression(CCmpCtrl *cc); +public extern U8 *LexExpression2Bin(CCmpCtrl *cc,I64 *_type=NULL); +public extern F64 LexExpressionF64(CCmpCtrl *cc); +public extern I64 LexExpressionI64(CCmpCtrl *cc); +public extern U8 *LexExtStr(CCmpCtrl *cc,I64 *_size=NULL,Bool lex_next=TRUE); +public extern U8 *LexFirstRem(CCmpCtrl *cc,U8 *marker,I64 _len=NULL); +public extern I64 LexGetChar(CCmpCtrl *cc); +public extern U0 LexPopNoRestore(CCmpCtrl *cc); +public extern U0 LexPopRestore(CCmpCtrl *cc); +public extern U0 LexPush(CCmpCtrl *cc); +public extern U0 LexPutLine(CCmpCtrl *cc,U8 *start); +public extern U0 LexPutPos(CCmpCtrl *cc); +public extern U0 LexPutToken(CCmpCtrl *cc); +public extern U0 LexSkipEol(CCmpCtrl *cc); +public extern U8 *LexStmt2Bin( + CCmpCtrl *cc,I64 *_type,I64 cmp_flags=CMPF_PRS_SEMICOLON); +public extern U0 LexWarn(CCmpCtrl *cc,U8 *str=NULL); +extern CMemberLst *MemberClassBaseFind( + CHashClass *needle_class,CHashClass *haystack_class); +public extern CMemberLst *MemberFind(U8 *needle_str,CHashClass *haystack_class); +extern U0 MemberLstDel(CMemberLst *tempm); +public extern I64 MemberMetaData(U8 *st,CMemberLst *ml); +public extern CMemberLstMeta *MemberMetaFind(U8 *st,CMemberLst *ml); +public extern CHashClass *OptClassFwd(CHashClass *tempc); +public extern I64 PrsKeyWord(CCmpCtrl *cc); + +#help_index "Compiler;Cmd Line (Typically)" +extern I64 Cmp(U8 *filename, + U8 *map_name=NULL,U8 *out_name=NULL,U8 mapfile_drv_let=0); + +#help_index "Debugging/Unassemble" +public extern U8 *U(U8 *ip,I64 cnt=20,I64 seg_size=64); +public extern U0 Ui(U8 *buf,U8 **_ip,I64 seg_size=64, + I64 *_jmp_dst=NULL,Bool just_ins=FALSE); +public extern I64 Un(U8 *ip,I64 cnt=0x80,I64 seg_size=64); +extern CUAsmGlbls uasm; + +#help_index "Hash/System" +public extern I64 HashEntrySize(CHashSrcSym *temph); +public extern I64 HashEntrySize2(CHashSrcSym *temph); +public extern I64 HashTableSize2(CHashTable *table); diff --git a/Compiler/CompilerB.HPP b/Compiler/CompilerB.HPP deleted file mode 100644 index 88dfa99..0000000 --- a/Compiler/CompilerB.HPP +++ /dev/null @@ -1,78 +0,0 @@ -#help_index "Compiler" -extern U0 CInit(Bool first); -public extern I64 ExeFile(U8 *name,I64 ccf_flags=0); -public extern I64 ExeFile2(U8 *name,I64 ccf_flags=0); -public extern I64 ExePrint(U8 *fmt,...); -public extern I64 ExePrint2(U8 *fmt,...); -public extern I64 ExePutS(U8 *buf,U8 *filename=NULL,I64 ccf_flags=0, - CLexHashTableContext *htc=NULL); -public extern I64 ExePutS2(U8 *buf,U8 *filename=NULL,I64 ccf_flags=0); -public _extern _LAST_FUN I64 LastFun(I64 argc,I64 *argv); -public extern I64 RunFile(U8 *name,I64 ccf_flags=0,...); -public extern I64 RunFile2(U8 *name,I64 ccf_flags=0,...); -public extern CCmpGlbls cmp; - -#help_index "Compiler/Directive" -#help_file "::/Doc/Directives" -public extern Bool Echo(Bool val); -public extern Bool GetOption(I64 num); -public extern I64 PassTrace(I64 i=0b1001111101); -extern U0 StreamDir(); -public extern I64 StreamExePrint(U8 *fmt,...); -public extern U0 StreamPrint(U8 *fmt,...); -public extern Bool Trace(Bool val=ON); - -#help_index "Compiler/Lex" -#help_file "::/Doc/Lex" -public extern U0 CmpCtrlDel(CCmpCtrl *cc); -public extern CCmpCtrl *CmpCtrlNew(U8 *buf=NULL,I64 flags=0,U8 *filename=NULL); -public extern I64 CmpCtrlSize(CCmpCtrl *cc); -public extern I64 IsLexExpression2Bin( - CCmpCtrl *cc,U8 **machine_code); //FALSE=no err -public extern I64 Lex(CCmpCtrl *cc); -public extern U0 LexAttachDoc(CCmpCtrl *cc,CLexFile *tempf=NULL, - CDoc *doc=NULL,U8 *abs_filename=NULL,CDocEntry *doc_e=NULL,I64 col=0); -public extern CD2I32 *LexD2I32(CCmpCtrl *cc,CD2I32 *p); -public extern CD3I32 *LexD3I32(CCmpCtrl *cc,CD3I32 *p); -public extern U0 LexExcept(CCmpCtrl *cc,U8 *str=NULL); -public extern I64 LexExpression(CCmpCtrl *cc); -public extern U8 *LexExpression2Bin(CCmpCtrl *cc,I64 *_type=NULL); -public extern F64 LexExpressionF64(CCmpCtrl *cc); -public extern I64 LexExpressionI64(CCmpCtrl *cc); -public extern U8 *LexExtStr(CCmpCtrl *cc,I64 *_size=NULL,Bool lex_next=TRUE); -public extern U8 *LexFirstRem(CCmpCtrl *cc,U8 *marker,I64 _len=NULL); -public extern I64 LexGetChar(CCmpCtrl *cc); -public extern U0 LexPopNoRestore(CCmpCtrl *cc); -public extern U0 LexPopRestore(CCmpCtrl *cc); -public extern U0 LexPush(CCmpCtrl *cc); -public extern U0 LexPutLine(CCmpCtrl *cc,U8 *start); -public extern U0 LexPutPos(CCmpCtrl *cc); -public extern U0 LexPutToken(CCmpCtrl *cc); -public extern U0 LexSkipEol(CCmpCtrl *cc); -public extern U8 *LexStmt2Bin( - CCmpCtrl *cc,I64 *_type,I64 cmp_flags=CMPF_PRS_SEMICOLON); -public extern U0 LexWarn(CCmpCtrl *cc,U8 *str=NULL); -extern CMemberLst *MemberClassBaseFind( - CHashClass *needle_class,CHashClass *haystack_class); -public extern CMemberLst *MemberFind(U8 *needle_str,CHashClass *haystack_class); -extern U0 MemberLstDel(CHashClass *c); -public extern I64 MemberMetaData(U8 *st,CMemberLst *ml); -public extern CMemberLstMeta *MemberMetaFind(U8 *st,CMemberLst *ml); -public extern CHashClass *OptClassFwd(CHashClass *tempc); -public extern I64 PrsKeyWord(CCmpCtrl *cc); - -#help_index "Compiler;Cmd Line (Typically)" -extern I64 Cmp(U8 *filename, - U8 *map_name=NULL,U8 *out_name=NULL,U8 mapfile_drv_let=0); - -#help_index "Debugging/Unassemble" -public extern U8 *U(U8 *ip,I64 cnt=20,I64 seg_size=64); -public extern U0 Ui(U8 *buf,U8 **_ip,I64 seg_size=64, - I64 *_jmp_dst=NULL,Bool just_ins=FALSE); -public extern I64 Un(U8 *ip,I64 cnt=0x80,I64 seg_size=64); -extern CUAsmGlbls uasm; - -#help_index "Hash/System" -public extern I64 HashEntrySize(CHashSrcSym *temph); -public extern I64 HashEntrySize2(CHashSrcSym *temph); -public extern I64 HashTableSize2(CHashTable *table); diff --git a/Compiler/Lex.CPP b/Compiler/Lex.CPP deleted file mode 100644 index bc3b1a2..0000000 --- a/Compiler/Lex.CPP +++ /dev/null @@ -1,1186 +0,0 @@ -CLexFile *LexFilePush(CCmpCtrl *cc) -{//#include file push. - CLexFile *res=CAlloc(sizeof(CLexFile)); - if (res->next=cc->lex_include_stk) - res->depth=res->next->depth+1; - else - res->depth=-1; //Include depth starts with -1. - return cc->lex_include_stk=res; -} - -CLexFile *LexFilePop(CCmpCtrl *cc) -{//#include file pop. - CLexFile *tempf; - if (tempf=cc->lex_include_stk) { - if ((cc->lex_include_stk=tempf->next) || !(cc->flags & CCF_DONT_FREE_BUF)) { - if (tempf->flags & LFSF_DOC) { - if (tempf->doc) - DocDel(tempf->doc); - } else - Free(tempf->buf);; - } - Free(tempf->full_name); - Free(tempf); - } - return cc->lex_include_stk; -} - -CCmpCtrl *CmpCtrlNew(U8 *buf=NULL,I64 flags=0,U8 *filename=NULL) -{//MAlloc and Init CCmpCtrl. -//Frees buf in $LK,"CmpCtrlDel",A="MN:CmpCtrlDel"$ unless $LK,"CCF_DONT_FREE_BUF",A="MN:CCF_DONT_FREE_BUF"$ flag is set. - //FileName is for error reporting. If files are #included, - //new names are used. See $LK,"Psalmody CmpCtrlNew",A="FF:::/Apps/Psalmody/PsalmodyFile.CPP,CmpCtrlNew"$. - CCmpCtrl *cc=CAlloc(sizeof(CCmpCtrl)); - CLexFile *tempf; - QueInit(cc); - cc->flags=flags; - cc->opts=1<htc.hash_mask=HTG_TYPE_MASK-HTT_IMPORT_SYS_SYM; - cc->htc.define_hash_table=cc->htc.hash_table_lst= - cc->htc.glbl_hash_table=cc->htc.local_hash_table=Fs->hash_table; - if (flags&CCF_KEEP_AT_SIGN) - cc->chars_bmp_alpha_numeric=chars_bmp_alpha_numeric_no_at; - else - cc->chars_bmp_alpha_numeric=chars_bmp_alpha_numeric; - tempf=LexFilePush(cc); - QueInit(&cc->next_stream_blk); - if (filename) - tempf->full_name=FileNameAbs(filename); - else - tempf->full_name=StrNew(blkdev.temp_filename); - if (flags & CCF_PMT) - buf=CAlloc(8); - tempf->buf=tempf->buf_ptr=tempf->line_start=cc->cur_buf_ptr=buf; - tempf->line_num=1; - return cc; -} - -U0 CmpCtrlDel(CCmpCtrl *cc) -{//Free CCmpCtrl. - while (LexFilePop(cc)); - LinkedLstDel(cc->lex_prs_stk); - LinkedLstDel(cc->htc.next); - Free(cc->ps); - Free(cc->cur_str); - Free(cc->cur_help_idx); - Free(cc->dollar_buf); - Free(cc); -} - -I64 CmpCtrlSize(CCmpCtrl *cc) -{//Mem size of CCmpCtrl and its members. - CLexFile *tempf=cc->lex_include_stk; - I64 res=0; - while (tempf) { - if (tempf->next || !(cc->flags & CCF_DONT_FREE_BUF)) { - if (tempf->flags & LFSF_DOC) { - if (tempf->doc) - res+=DocSize(tempf->doc); - } else - res+=MSize2(tempf->buf); - } - res+=MSize2(tempf->full_name); - res+=MSize2(tempf); - tempf=tempf->next; - } - res+=MSize2(cc->cur_str); - res+=MSize2(cc); - return res; -} - -U32 lex_zeros=0; - -Bool LexDollar(CCmpCtrl *cc,CDoc *doc,CDocEntry *doc_e) -{ - U8 *st; - if (cc->flags&CCF_IN_QUOTES) { - Free(cc->dollar_buf); - st=Doc2PlainText(doc,doc_e); - cc->dollar_buf=MStrPrint("$$%$$Q$$",st); - cc->dollar_cnt=2; - Free(st); - return TRUE; - } else - return FALSE; -} - -I64 LexGetChar(CCmpCtrl *cc) -{//Get one char from stream. Allow put-back one. - U8 *ptr,*src; - CLexFile *tempf; - CDoc *doc; - CDocEntry *doc_e; - if (!Btr(&cc->flags,CCf_USE_LAST_U16)) { -lgc_start1: - if (!(src=cc->cur_buf_ptr++)) { - cc->cur_buf_ptr=NULL; - goto lgc_here; - } - switch [cc->last_U16=*src++] { - case 0: -lgc_here: - tempf=cc->lex_include_stk; - if (tempf->flags & LFSF_DOC) { - doc=tempf->doc; - doc_e=tempf->cur_entry; - doc_e=doc_e->next; -lgc_start2: - if (doc_e!=doc) { - tempf->cur_entry=doc_e; - switch [doc_e->type_u8] { - case DOCT_TEXT: - if (doc_e->de_flags & ~(DOCEF_TAG|DOCEF_DEFINE|DOCEF_TAG_CB| - DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT| - DOCEF_SKIP|DOCEF_FILTER_SKIP) && - LexDollar(cc,doc,doc_e) && *(src=cc->dollar_buf)) { - tempf->line_num=doc_e->y+1; - tempf->buf_ptr=cc->cur_buf_ptr=src; - } else if (*(src=doc_e->tag)) - tempf->buf_ptr=cc->cur_buf_ptr=src; - else { - doc_e=doc_e->next; - goto lgc_start2; - } - break; - case DOCT_NEW_LINE: - tempf->buf_ptr=cc->cur_buf_ptr=&lex_zeros; - tempf->line_start=doc_e->next; - tempf->line_num=doc_e->y+2;//+1 because NEW_LINE is on prev line -//+1 because doc y starts at zero - cmp.compiled_lines++; - cc->last_U16='\n'; - goto lgc_done; - case DOCT_TAB: - tempf->buf_ptr=cc->cur_buf_ptr=&lex_zeros; - tempf->line_num=doc_e->y+1; - cc->last_U16='\t'; - goto lgc_done; - case DOCT_PAGE_BREAK: - tempf->buf_ptr=cc->cur_buf_ptr=&lex_zeros; - tempf->line_num=doc_e->y+2; //TODO: should be a page down - cc->last_U16=CH_FORM_FEED; - goto lgc_done; - case DOCT_INS_BIN: - tempf->buf_ptr=cc->cur_buf_ptr=&lex_zeros; - tempf->line_num=doc_e->y+1; - Free(cc->cur_str); - cc->cur_str=NULL; - cc->cur_str_len=0; - if (doc_e->bin_data) { - ptr=MAlloc(doc_e->bin_data->size); - if (doc_e->bin_data->data) - MemCpy(ptr,doc_e->bin_data->data,doc_e->bin_data->size); - cc->cur_str=ptr; - cc->cur_str_len=doc_e->bin_data->size; - } - cc->last_U16=TK_INS_BIN; - goto lgc_done; - case DOCT_INS_BIN_SIZE: - tempf->buf_ptr=cc->cur_buf_ptr=&lex_zeros; - if (doc_e->bin_data) - cc->cur_i64=doc_e->bin_data->size; - else - cc->cur_i64=0; - tempf->line_num=doc_e->y+1; - cc->last_U16=TK_INS_BIN_SIZE; - goto lgc_done; - case DOCT_SHIFTED_Y: - if (LexDollar(cc,doc,doc_e) && *(src=cc->dollar_buf)) { - tempf->line_num=doc_e->y+1; - tempf->buf_ptr=cc->cur_buf_ptr=src; - } else { - tempf->buf_ptr=cc->cur_buf_ptr=&lex_zeros; - tempf->line_num=doc_e->y+1; - if (doc_e->attr<0) - cc->last_U16=TK_SUPERSCRIPT; - else if (doc_e->attr>0) - cc->last_U16=TK_SUBSCRIPT; - else - cc->last_U16=TK_NORMALSCRIPT; - goto lgc_done; - } - break; - case DOCT_MARKER: - case DOCT_CURSOR: - doc_e=doc_e->next; - goto lgc_start2; - case 0xFF: //nobound switch - default: - if (LexDollar(cc,doc,doc_e) && *(src=cc->dollar_buf)) { - tempf->line_num=doc_e->y+1; - tempf->buf_ptr=cc->cur_buf_ptr=src; - } else { - doc_e=doc_e->next; - goto lgc_start2; - } - } - } - if (doc_e!=doc) - goto lgc_start1; - tempf->cur_entry=doc->head.last; //When take next, will still be end. - } - tempf=cc->lex_include_stk; - if (tempf->next) { - tempf=LexFilePop(cc); - cc->cur_buf_ptr=tempf->buf_ptr; - cc->flags&=~CCF_USE_LAST_U16; - if (!(cc->last_U16=tempf->last_U16)) - goto lgc_start1; - } else { - if (cc->flags & CCF_PMT) { - Free(tempf->buf); - ptr=CmdLinePmt; - if (StrCmp(ptr,"\n") && !cc->pmt_line++ && !StrCmp(ptr,"?\n") && - cc->flags & CCF_QUESTION_HELP) { - Free(ptr); - ptr=StrNew("Help;;\n"); - } - tempf->buf=tempf->buf_ptr=tempf->line_start=cc->cur_buf_ptr=ptr; - goto lgc_start1; - } else { - if (src) - cc->cur_buf_ptr=src-1; - cc->last_U16=TK_EOF; - } - } - break; - case CH_CURSOR: - case CH_FORM_FEED: - goto lgc_start1; - case '\n': - tempf=cc->lex_include_stk; - if (!(tempf->flags & LFSF_DOC)) { - tempf->line_num++; - cmp.compiled_lines++; - tempf->line_start=src; - } - break; - case 0xFF: //nobound switch - } -lgc_done: - if (cc->last_U16==CH_SHIFT_SPACE) - cc->last_U16=CH_SPACE; - if (cc->opts & OPTF_ECHO && - cc->last_U16<256 && Bt(chars_bmp_printable,cc->last_U16)) - '' cc->last_U16; - } - return cc->last_U16; -} - -U0 LexSkipEol(CCmpCtrl *cc) -{//$LK,"LexGetChar",A="MN:LexGetChar"$ to NULL until end-of-line. - I64 ch; - do ch=$WW,0$LexGetChar(cc); - while (Bt(chars_bmp_non_eol,ch)); -} - -U8 *LexFirstRem(CCmpCtrl *cc,U8 *marker,I64 _len=NULL) -{//$LK,"LexGetChar",A="MN:LexGetChar"$() chars making str until marker. - U8 *res,*ptr; - CQueVectU8 *tempv=QueVectU8New; - I64 i,len=0; - while (TRUE) { - i=LexGetChar(cc); - if (!i||StrOcc(marker,i)) - break; - QueVectU8Put(tempv,len++,i); - } - if (i) - Bts(&cc->flags,CCf_USE_LAST_U16); - res=ptr=MAlloc(len+1); - for (i=0;ifull_name=StrNew(abs_filename); - else - tempf->full_name=StrNew(blkdev.temp_filename); - tempf->line_num=1; - tempf->buf=tempf->buf_ptr=tempf->line_start=cc->cur_buf_ptr=src; -} - -CDoc *LexDocRead(U8 *abs_filename,I64 flags) -{ - CDoc *doc=DocNew(abs_filename); - U8 *src; - I64 size=0; - doc->flags|=flags; - src=FileRead(abs_filename,&size); - if (!src || !size) { - Free(src); - src=CAlloc(1); - size=0; - } - DocLoad(doc,src,size); - Free(src); - return doc; -} - -I64 cmp_type_flags_src_code[(DOCT_NUM_TYPES+63)/64]={ - 1<head.next; - tempf->full_name=StrNew(doc->filename.name); - tempf->doc=doc; - while (doc_e!=doc) { - if (Bt(cmp_type_flags_src_code,doc_e->type_u8)) - break; - doc_e=doc_e->next; - col=doc_e->min_col; - } - if (doc_e!=doc) { - col=ClampI64(col,doc_e->min_col,doc_e->max_col); - tempf->line_start=doc_e; - tempf->buf=NULL; - tempf->line_num=doc_e->y+1; - if (doc_e->type_u8==DOCT_TEXT) { - tempf->cur_entry=doc_e; - tempf->buf_ptr=doc_e->tag; - } else { - tempf->cur_entry=doc_e->last; //TODO: might be problem at begin of file - tempf->buf_ptr=&lex_zeros; - } - tempf->flags=LFSF_DOC; - } else {//TODO: DocDel(doc)? - col=0; - tempf->buf=tempf->buf_ptr=tempf->line_start=CAlloc(1); - tempf->line_num=1; - tempf->flags=0; - } - cc->cur_buf_ptr=tempf->buf_ptr+col; - tempf->last_U16=0; -} - -I64 LexInStr(CCmpCtrl *cc,U8 *buf,I64 size,Bool *done) -{ - I64 i=0,j,k,ch; - *done=TRUE; - while (iflags|=CCF_USE_LAST_U16; - break; - } - } - buf[i++]=j; - break; - default: - cc->flags|=CCF_USE_LAST_U16; - buf[i++]='\\'; - } - } else if (ch=='$$') { - buf[i++]='$$'; - if (cc->dollar_cnt) - cc->dollar_cnt--; - else if (LexGetChar(cc)!='$$') { - cc->dollar_cnt=1; - cc->flags|=CCF_USE_LAST_U16; - } - } else - buf[i++]=ch; - } - *done=FALSE; - return i; -} - -I64 Lex(CCmpCtrl *cc) -{//Fetch next token. - I64 i,j,k,l,ch; - CHash *temph; - Bool str_done,neg_e; - U8 *fbuf,*buf2,*buf3,buf[STR_LEN]; - cc->last_line_num=cc->lex_include_stk->line_num; - while (TRUE) { -lex_cont: - switch [ch=LexGetChar(cc)] { - case 0: - return cc->token=TK_EOF; - case TK_SUPERSCRIPT: - ch='>'; - goto lex_ident; - case TK_SUBSCRIPT: - ch='<'; - goto lex_ident; - case TK_NORMALSCRIPT: - ch='='; - goto lex_ident; - case '@': - if (cc->flags&CCF_KEEP_AT_SIGN) { - cc->token=ch; - goto lex_end; - } - case 'A'...'Z': - case 'a'...'z': - case '_': - case 128...255: -lex_ident: - i=0; - buf[i++]=ch; - while (TRUE) { - if (i>=STR_LEN) - LexExcept(cc,"Ident limited to STR_LEN chars at "); - else if (!(ch=LexGetChar(cc))) - break; - else if (Bt(cc->chars_bmp_alpha_numeric,ch)) - buf[i++]=ch; - else if (ch==TK_SUPERSCRIPT) - buf[i++]='>'; - else if (ch==TK_SUBSCRIPT) - buf[i++]='<'; - else if (ch==TK_NORMALSCRIPT) - buf[i++]='='; - else { - cc->flags|=CCF_USE_LAST_U16; - break; - } - } - buf[i++]=0; - temph=NULL; - if (cc->htc.local_var_lst) - cc->local_var_entry=MemberFind(buf,cc->htc.local_var_lst); - else - cc->local_var_entry=NULL; - if (!cc->local_var_entry && cc->htc.hash_table_lst) - temph=HashFind(buf,cc->htc.hash_table_lst,cc->htc.hash_mask); - if (temph) - j=temph->type; - else - j=0; - if (j & HTT_DEFINE_STR && !(cc->flags & CCF_NO_DEFINES)) { - LexIncludeStr(cc, - temph->str,StrNew(temph(CHashDefineStr *)->data),FALSE); - cc->lex_include_stk->flags|=LFSF_DEFINE; - } else { - cc->hash_entry=temph; - Free(cc->cur_str); - cc->cur_str=StrNew(buf); - cc->cur_str_len=i; - cc->token=TK_IDENT; - goto lex_end; - } - break; - case '0'...'9': - i=ch-'0'; - ch=ToUpper(LexGetChar(cc)); - if (ch=='X') { - while (TRUE) { - ch=ToUpper(LexGetChar(cc)); - if (Bt(chars_bmp_hex_numeric,ch)) { - if (ch<='9') - i=i<<4+ch-'0'; - else - i=i<<4+ch-'A'+10; - } else { - cc->cur_i64=i; - cc->flags|=CCF_USE_LAST_U16; - cc->token=TK_I64; - goto lex_end; - } - } - } else if (ch=='B') { - while (TRUE) { - ch=LexGetChar(cc); - if (ch=='0') - i=i<<1; - else if (ch=='1') - i=i<<1+1; - else { - cc->cur_i64=i; - cc->flags|=CCF_USE_LAST_U16; - cc->token=TK_I64; - goto lex_end; - } - } - } - while (TRUE) { - if (Bt(chars_bmp_dec_numeric,ch)) - i=i*10+ch-'0'; - else { - if (ch=='.' || ch=='e' || ch=='E') break; -lex_is_int: - cc->cur_i64=i; - cc->flags|=CCF_USE_LAST_U16; - cc->token=TK_I64; - goto lex_end; - } - ch=LexGetChar(cc); - } - if (ch=='.') { - ch=LexGetChar(cc); - if (ch=='.') { - cc->flags|=CCF_LAST_WAS_DOT; - goto lex_is_int; - } - } -lex_float_start: - k=0; - while (TRUE) { - if (Bt(chars_bmp_dec_numeric,ch)) { - i=i*10+ch-'0'; - k++; - } else { - if (ch=='e' || ch=='E') - break; - cc->cur_f64=i*Pow10I64(-k); - cc->flags|=CCF_USE_LAST_U16; - cc->token=TK_F64; - goto lex_end; - } - ch=LexGetChar(cc); - } - ch=LexGetChar(cc); - neg_e=FALSE; - if (ch=='-') { - neg_e=TRUE; - ch=LexGetChar(cc); - } - j=0; - while (TRUE) { - if (Bt(chars_bmp_dec_numeric,ch)) - j=j*10+ch-'0'; - else { - if (neg_e) - cc->cur_f64=i*Pow10I64(-j-k); - else - cc->cur_f64=i*Pow10I64(j-k); - cc->flags|=CCF_USE_LAST_U16; - cc->token=TK_F64; - goto lex_end; - } - ch=LexGetChar(cc); - } - break; - case '"': - cc->flags|=CCF_IN_QUOTES; - buf2=NULL; - i=0; - do { - j=LexInStr(cc,buf,STR_LEN,&str_done); - buf3=MAlloc(i+j); - if (buf2) { - MemCpy(buf3,buf2,i); - Free(buf2); - buf2=buf3; - MemCpy(buf2+i,buf,j); - } else { - buf2=buf3; - MemCpy(buf2,buf,j); - } - i+=j; - } while (!str_done); - Free(cc->cur_str); - cc->cur_str=MAlloc(i); - MemCpy(cc->cur_str,buf2,i); - Free(buf2); - cc->cur_str_len=i; - cc->flags&=~CCF_IN_QUOTES; - cc->token=TK_STR; - goto lex_end; - case '\'': - k=0; - for (j=0;j<8;j++) { - if (!(ch=LexGetChar(cc)) || ch=='\'') - break; - if (ch=='\\') { - switch (ch=LexGetChar(cc)) { - case '0': k.u8[j]=0; break; - case '\'': k.u8[j]='\''; break; - case '\`': k.u8[j]='\`'; break; - case '"': k.u8[j]='"'; break; - case '\\': k.u8[j]='\\'; break; - case 'd': k.u8[j]='$$'; break; - case 'n': k.u8[j]='\n'; break; - case 'r': k.u8[j]='\r'; break; - case 't': k.u8[j]='\t'; break; - case 'x': - case 'X': - i=0; - for (l=0;l<2;l++) { - ch=ToUpper(LexGetChar(cc)); - if (Bt(chars_bmp_hex_numeric,ch)) { - if (ch<='9') - i=i<<4+ch-'0'; - else - i=i<<4+ch-'A'+10; - } else { - cc->flags|=CCF_USE_LAST_U16; - break; - } - } - k.u8[j]=i; - break; - default: - k.u8[j]='\\'; - cc->flags|=CCF_USE_LAST_U16; - } - } else if (ch=='$$') { - ch=LexGetChar(cc); - k.u8[j]='$$'; - if (ch!='$$') - cc->flags|=CCF_USE_LAST_U16; - } else - k.u8[j]=ch; - } - if (ch!='\'' && (ch=LexGetChar(cc)) && ch!='\'') - LexExcept(cc,"Char const limited to 8 chars at "); - cc->cur_i64=k; - cc->token=TK_CHAR_CONST; - goto lex_end; - case '#': - if (cc->flags&CCF_KEEP_NUM_SIGN) { - cc->token=ch; - goto lex_end; - } - if (Lex(cc)!=TK_IDENT) //skip '#' - goto lex_end; - if (!(temph=cc->hash_entry)) - goto lex_end; - if (!(temph->type & HTT_KEYWORD)) - goto lex_end; - switch (i=temph(CHashGeneric *)->user_data0) { - case KW_INCLUDE: - if (Lex(cc)!=TK_STR) - goto lex_end; - fbuf=DftExt(cc->cur_str,"CPP.Z"); - buf2=FileNameAbs(fbuf); - Free(fbuf); - if (Bt(&sys_run_level,RLf_DOC)) - LexAttachDoc(cc,,,buf2); - else - LexIncludeStr(cc,buf2,FileRead(buf2),TRUE); - Free(buf2); - break; - case KW_DEFINE: - cc->flags|=CCF_NO_DEFINES; - if (Lex(cc)==TK_IDENT) { - temph=CAlloc(sizeof(CHashDefineStr)); - temph->str=cc->cur_str; - cc->cur_str=0; - temph->type=HTT_DEFINE_STR; - HashSrcFileSet(cc,temph); - - do ch=LexGetChar(cc); //skip space between define name and start - while (Bt(chars_bmp_non_eol_white_space,ch)); - - i=j=0; - buf2=NULL; - if (ch) { - do { - if (ch=='\\') { - if (ch=LexGetChar(cc)) { - if (ch!='\r' && ch!='\n') { - buf[j++]='\\'; - buf[j++]=ch; - } else if (ch=='\r' && LexGetChar(cc)!='\n') - cc->flags|=CCF_USE_LAST_U16; - } else { - buf[j++]='\\'; - break; - } - } else if (ch!='\n') - buf[j++]=ch; - else - break; - while (ch=LexGetChar(cc)) { - if (ch=='/') { - ch=LexGetChar(cc); - if (ch=='/') { - do ch=LexGetChar(cc); - while (Bt(chars_bmp_non_eol,ch)); - break; - } else { - buf[j++]='/'; - cc->flags|=CCF_USE_LAST_U16; - } - } else if (ch=='\\') - break; - else if (Bt(chars_bmp_non_eol,ch)) - buf[j++]=ch; - else - break; - if (j>=STR_LEN-4) {//Spot for ['\'][ch],[ch],[0] - buf[j++]=0; - buf3=MAlloc(i+j); - if (buf2) { - MemCpy(buf3,buf2,i); - Free(buf2); - buf2=buf3; - MemCpy(buf2+i,buf,j); - } else { - buf2=buf3; - MemCpy(buf2,buf,j); - } - i+=j-1; - j=0; - } - } - } while (ch=='\\'); - } - buf[j++]=0; - buf3=MAlloc(i+j); - if (buf2) { - MemCpy(buf3,buf2,i); - Free(buf2); - buf2=buf3; - MemCpy(buf2+i,buf,j); - } else { - buf2=buf3; - MemCpy(buf2,buf,j); - } - temph(CHashDefineStr *)->data=buf2; - temph(CHashDefineStr *)->cnt=-1; - HashAdd(temph,cc->htc.define_hash_table); - } - cc->flags&=~CCF_NO_DEFINES; - break; - case KW_ELSE: - if (cc->flags & CCF_IN_IF) { - cc->token=TK_ELSE; - goto lex_end; - } -lex_else: - j=1; - do { - if (ch=LexGetChar(cc)) { - if (ch=='#') { - if (!Lex(cc)) - goto lex_end; - i=PrsKeyWord(cc); - if (i==KW_IF || i==KW_IFDEF || i==KW_IFNDEF || - i==KW_IFAOT || i==KW_IFJIT) - j++; - else if (i==KW_ENDIF) - j--; - } - } else { - cc->token=TK_EOF; - goto lex_end; - } - } while (j); - break; - - case KW_IF: - if (cc->flags & CCF_IN_IF) { - cc->token=TK_IF; - goto lex_end; - } -lex_if: - cc->flags|=CCF_IN_IF; - if (!Lex(cc)) { - cc->flags&=~CCF_IN_IF; - goto lex_end; - } - if (LexExpression(cc)) { - cc->flags&=~CCF_IN_IF; - switch (cc->token) { - case TK_IF: goto lex_if; - case TK_IFDEF: goto lex_ifdef; - case TK_IFNDEF: goto lex_ifndef; - case TK_IFAOT: goto lex_ifaot; - case TK_IFJIT: goto lex_ifjit; - case TK_ELSE: goto lex_else; - case TK_ENDIF: goto lex_cont; - default: goto lex_end; - } - } else { - cc->flags&=~CCF_IN_IF; - if (cc->token!=TK_ENDIF && cc->token!=TK_ELSE) { - if (cc->token==TK_IF || cc->token==TK_IFDEF || - cc->token==TK_IFNDEF || cc->token==TK_IFAOT || - cc->token==TK_IFJIT) - j=2; - else - j=1; - do { - if (ch=LexGetChar(cc)) { - if (ch=='#') { - if (!Lex(cc)) - goto lex_end; - i=PrsKeyWord(cc); - if (i==KW_IF || i==KW_IFDEF || i==KW_IFNDEF || - i==KW_IFAOT || i==KW_IFJIT) - j++; - else if (i==KW_ENDIF) - j--; - else if (i==KW_ELSE && j==1) - break; - } - } else { - cc->token=TK_EOF; - goto lex_end; - } - } while (j); - } - } - break; - case KW_IFDEF: - if (cc->flags & CCF_IN_IF) { - cc->token=TK_IFDEF; - goto lex_end; - } -lex_ifdef: - cc->flags|=CCF_NO_DEFINES; - if (!Lex(cc)) { - cc->flags&=~CCF_NO_DEFINES; - goto lex_end; - } - cc->flags&=~CCF_NO_DEFINES; - if (cc->token!=TK_IDENT) - goto lex_end; - if (cc->hash_entry) - goto lex_cont; - j=1; - do { - if (ch=LexGetChar(cc)) { - if (ch=='#') { - if (!Lex(cc)) - goto lex_end; - i=PrsKeyWord(cc); - if (i==KW_IF || i==KW_IFDEF || i==KW_IFNDEF || - i==KW_IFAOT || i==KW_IFJIT) - j++; - else if (i==KW_ENDIF) - j--; - else if (i==KW_ELSE && j==1) - break; - } - } else { - cc->token=TK_EOF; - goto lex_end; - } - } while (j); - break; - case KW_IFNDEF: - if (cc->flags & CCF_IN_IF) { - cc->token=TK_IFNDEF; - goto lex_end; - } -lex_ifndef: - cc->flags|=CCF_NO_DEFINES; - if (!Lex(cc)) { - cc->flags&=~CCF_NO_DEFINES; - goto lex_end; - } - cc->flags&=~CCF_NO_DEFINES; - if (cc->token!=TK_IDENT) - goto lex_end; - if (!cc->hash_entry) - goto lex_cont; - j=1; - do { - if (ch=LexGetChar(cc)) { - if (ch=='#') { - if (!Lex(cc)) - goto lex_end; - i=PrsKeyWord(cc); - if (i==KW_IF || i==KW_IFDEF || i==KW_IFNDEF || - i==KW_IFAOT || i==KW_IFJIT) - j++; - else if (i==KW_ENDIF) - j--; - else if (i==KW_ELSE && j==1) - break; - } - } else { - cc->token=TK_EOF; - goto lex_end; - } - } while (j); - break; - case KW_IFAOT: - if (cc->flags & CCF_IN_IF) { - cc->token=TK_IFAOT; - goto lex_end; - } -lex_ifaot: - if (cc->flags & CCF_AOT_COMPILE) - goto lex_cont; - j=1; - do { - if (ch=LexGetChar(cc)) { - if (ch=='#') { - if (!Lex(cc)) - goto lex_end; - i=PrsKeyWord(cc); - if (i==KW_IF || i==KW_IFDEF || i==KW_IFNDEF || - i==KW_IFAOT || i==KW_IFJIT) - j++; - else if (i==KW_ENDIF) - j--; - else if (i==KW_ELSE && j==1) - break; - } - } else { - cc->token=TK_EOF; - goto lex_end; - } - } while (j); - break; - case KW_IFJIT: - if (cc->flags & CCF_IN_IF) { - cc->token=TK_IFAOT; - goto lex_end; - } -lex_ifjit: - if (!(cc->flags & CCF_AOT_COMPILE)) - goto lex_cont; - j=1; - do { - if (ch=LexGetChar(cc)) { - if (ch=='#') { - if (!Lex(cc)) - goto lex_end; - i=PrsKeyWord(cc); - if (i==KW_IF || i==KW_IFDEF || i==KW_IFNDEF || - i==KW_IFAOT || i==KW_IFJIT) - j++; - else if (i==KW_ENDIF) - j--; - else if (i==KW_ELSE && j==1) - break; - } - } else { - cc->token=TK_EOF; - goto lex_end; - } - } while (j); - break; - case KW_ENDIF: - if (cc->flags & CCF_IN_IF) { - cc->token=TK_ENDIF; - goto lex_end; - } - break; - case KW_ASSERT: - if (!Lex(cc)) - goto lex_end; - if (!LexExpression(cc)) - LexWarn(cc,"Assert Failed "); - goto lex_end; - case KW_EXE: - if (!Lex(cc)) - goto lex_end; - PrsStreamBlk(cc); - goto lex_end; - case KW_HELP_INDEX: - if (Lex(cc)!=TK_STR) - goto lex_end; - Free(cc->cur_help_idx); - cc->cur_help_idx=LexExtStr(cc,,FALSE); - break; - case KW_HELP_FILE: - if (Lex(cc)!=TK_STR) - goto lex_end; - temph=CAlloc(sizeof(CHashSrcSym)); - fbuf=DftExt(cc->cur_str,"TXT.Z"); - temph->str=FileNameAbs(fbuf); - Free(fbuf); - temph->type=HTT_HELP_FILE|HTF_PUBLIC; - HashSrcFileSet(cc,temph); - HashAdd(temph,cc->htc.glbl_hash_table); - break; - } - break; - case '\n': - if (!(cc->flags&CCF_KEEP_NEW_LINES)) - break; //else fall through - case TK_INS_BIN: - case TK_INS_BIN_SIZE: - cc->token=ch; - goto lex_end; - case '.': - if (cc->flags&CCF_KEEP_DOT) { - cc->token=ch; - goto lex_end; - } - if (cc->flags&CCF_LAST_WAS_DOT) { - cc->flags&=~CCF_LAST_WAS_DOT; - goto lex_dot_dot; - } - ch=LexGetChar(cc); - if ('0'<=ch<='9') { - i=0; - goto lex_float_start; - } else if (ch=='.') { -lex_dot_dot: - cc->token=TK_DOT_DOT; - if (LexGetChar(cc)=='.') - cc->token=TK_DOT_DOT_DOT; - else - cc->flags|=CCF_USE_LAST_U16; - goto lex_end; - } - cc->flags|=CCF_USE_LAST_U16; - cc->token='.'; - goto lex_end; - case '!': - case '$$'...'&': - case '('...'-': - case '/': - case ':'...'?': - case '[': - case ']'...'^': - case '{'...'~': - case '`': - if (!(i=cmp.dual_U16_tokens1[ch])) { - if (ch=='$$') { - ch=LexGetChar(cc); - if (ch=='$$') { - cc->token='$$'; - goto lex_end; - } else if (ch) { - do ch=LexGetChar(cc); - while (ch && ch!='$$'); - if (!ch) { - cc->token=TK_EOF; - goto lex_end; - } else - goto lex_cont; - } else { - cc->flags|=CCF_USE_LAST_U16; - cc->token='$$'; - goto lex_end; - } - } else { - cc->token=ch; - goto lex_end; - } - } else { - j=LexGetChar(cc); - if (i.u16[0]==j) { - i>>=16; - if (!i) {// "/*" - j=1; - do { - if (!(ch=LexGetChar(cc))) - return cc->token=TK_EOF; -lex_check_comment: - if (ch=='*') { - if (!(ch=LexGetChar(cc))) - return cc->token=TK_EOF; - if (ch=='/') - j--; - else - goto lex_check_comment; - } else if (ch=='/') { - if (!(ch=LexGetChar(cc))) - return cc->token=TK_EOF; - if (ch=='*') - j++; - else - goto lex_check_comment; - } - } while (j); - goto lex_cont; - } else { - cc->token=i; - goto lex_end; - } - } - if (i=cmp.dual_U16_tokens2[ch]) { - if (i.u16[0]==j) { - i>>=16; - if (!i) {// "//" - LexSkipEol(cc); - if (cc->flags&CCF_KEEP_NEW_LINES) { - cc->token='\n'; - goto lex_end; - } else - goto lex_cont; - } else { - if (i==TK_SHL || i==TK_SHR) { - j=LexGetChar(cc); - if (j=='=') { - if (i==TK_SHL) - i=TK_SHL_EQU; - else - i=TK_SHR_EQU; - } else - cc->flags|=CCF_USE_LAST_U16; - } - cc->token=i; - goto lex_end; - } - } - if (i=cmp.dual_U16_tokens3[ch]) { - if (i.u16[0]==j) { - cc->token=i.u16[1]; - goto lex_end; - } - } - } - cc->flags|=CCF_USE_LAST_U16; - cc->token=ch; - goto lex_end; - } - case TK_NUM_TK: - default: - break; - } - } -lex_end: - LexGetChar(cc); //Do this so WAS_NEW_LINE is right - cc->flags|=CCF_USE_LAST_U16; - return cc->token; -} diff --git a/Compiler/Lex.HC b/Compiler/Lex.HC new file mode 100644 index 0000000..453f132 --- /dev/null +++ b/Compiler/Lex.HC @@ -0,0 +1,1186 @@ +CLexFile *LexFilePush(CCmpCtrl *cc) +{//#include file push. + CLexFile *res=CAlloc(sizeof(CLexFile)); + if (res->next=cc->lex_include_stk) + res->depth=res->next->depth+1; + else + res->depth=-1; //Include depth starts with -1. + return cc->lex_include_stk=res; +} + +CLexFile *LexFilePop(CCmpCtrl *cc) +{//#include file pop. + CLexFile *tempf; + if (tempf=cc->lex_include_stk) { + if ((cc->lex_include_stk=tempf->next) || !(cc->flags & CCF_DONT_FREE_BUF)) { + if (tempf->flags & LFSF_DOC) { + if (tempf->doc) + DocDel(tempf->doc); + } else + Free(tempf->buf);; + } + Free(tempf->full_name); + Free(tempf); + } + return cc->lex_include_stk; +} + +CCmpCtrl *CmpCtrlNew(U8 *buf=NULL,I64 flags=0,U8 *filename=NULL) +{//MAlloc and Init CCmpCtrl. +//Frees buf in $LK,"CmpCtrlDel",A="MN:CmpCtrlDel"$ unless $LK,"CCF_DONT_FREE_BUF",A="MN:CCF_DONT_FREE_BUF"$ flag is set. + //FileName is for error reporting. If files are #included, + //new names are used. See $LK,"Psalmody CmpCtrlNew",A="FF:::/Apps/Psalmody/PsalmodyFile.HC,CmpCtrlNew"$. + CCmpCtrl *cc=CAlloc(sizeof(CCmpCtrl)); + CLexFile *tempf; + QueInit(cc); + cc->flags=flags; + cc->opts=1<htc.hash_mask=HTG_TYPE_MASK-HTT_IMPORT_SYS_SYM; + cc->htc.define_hash_table=cc->htc.hash_table_lst= + cc->htc.glbl_hash_table=cc->htc.local_hash_table=Fs->hash_table; + if (flags&CCF_KEEP_AT_SIGN) + cc->chars_bmp_alpha_numeric=chars_bmp_alpha_numeric_no_at; + else + cc->chars_bmp_alpha_numeric=chars_bmp_alpha_numeric; + tempf=LexFilePush(cc); + QueInit(&cc->next_stream_blk); + if (filename) + tempf->full_name=FileNameAbs(filename); + else + tempf->full_name=StrNew(blkdev.temp_filename); + if (flags & CCF_PMT) + buf=CAlloc(8); + tempf->buf=tempf->buf_ptr=tempf->line_start=cc->cur_buf_ptr=buf; + tempf->line_num=1; + return cc; +} + +U0 CmpCtrlDel(CCmpCtrl *cc) +{//Free CCmpCtrl. + while (LexFilePop(cc)); + LinkedLstDel(cc->lex_prs_stk); + LinkedLstDel(cc->htc.next); + Free(cc->ps); + Free(cc->cur_str); + Free(cc->cur_help_idx); + Free(cc->dollar_buf); + Free(cc); +} + +I64 CmpCtrlSize(CCmpCtrl *cc) +{//Mem size of CCmpCtrl and its members. + CLexFile *tempf=cc->lex_include_stk; + I64 res=0; + while (tempf) { + if (tempf->next || !(cc->flags & CCF_DONT_FREE_BUF)) { + if (tempf->flags & LFSF_DOC) { + if (tempf->doc) + res+=DocSize(tempf->doc); + } else + res+=MSize2(tempf->buf); + } + res+=MSize2(tempf->full_name); + res+=MSize2(tempf); + tempf=tempf->next; + } + res+=MSize2(cc->cur_str); + res+=MSize2(cc); + return res; +} + +U32 lex_zeros=0; + +Bool LexDollar(CCmpCtrl *cc,CDoc *doc,CDocEntry *doc_e) +{ + U8 *st; + if (cc->flags&CCF_IN_QUOTES) { + Free(cc->dollar_buf); + st=Doc2PlainText(doc,doc_e); + cc->dollar_buf=MStrPrint("$$%$$Q$$",st); + cc->dollar_cnt=2; + Free(st); + return TRUE; + } else + return FALSE; +} + +I64 LexGetChar(CCmpCtrl *cc) +{//Get one char from stream. Allow put-back one. + U8 *ptr,*src; + CLexFile *tempf; + CDoc *doc; + CDocEntry *doc_e; + if (!Btr(&cc->flags,CCf_USE_LAST_U16)) { +lgc_start1: + if (!(src=cc->cur_buf_ptr++)) { + cc->cur_buf_ptr=NULL; + goto lgc_here; + } + switch [cc->last_U16=*src++] { + case 0: +lgc_here: + tempf=cc->lex_include_stk; + if (tempf->flags & LFSF_DOC) { + doc=tempf->doc; + doc_e=tempf->cur_entry; + doc_e=doc_e->next; +lgc_start2: + if (doc_e!=doc) { + tempf->cur_entry=doc_e; + switch [doc_e->type_u8] { + case DOCT_TEXT: + if (doc_e->de_flags & ~(DOCEF_TAG|DOCEF_DEFINE|DOCEF_TAG_CB| + DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT| + DOCEF_SKIP|DOCEF_FILTER_SKIP) && + LexDollar(cc,doc,doc_e) && *(src=cc->dollar_buf)) { + tempf->line_num=doc_e->y+1; + tempf->buf_ptr=cc->cur_buf_ptr=src; + } else if (*(src=doc_e->tag)) + tempf->buf_ptr=cc->cur_buf_ptr=src; + else { + doc_e=doc_e->next; + goto lgc_start2; + } + break; + case DOCT_NEW_LINE: + tempf->buf_ptr=cc->cur_buf_ptr=&lex_zeros; + tempf->line_start=doc_e->next; + tempf->line_num=doc_e->y+2;//+1 because NEW_LINE is on prev line +//+1 because doc y starts at zero + cmp.compiled_lines++; + cc->last_U16='\n'; + goto lgc_done; + case DOCT_TAB: + tempf->buf_ptr=cc->cur_buf_ptr=&lex_zeros; + tempf->line_num=doc_e->y+1; + cc->last_U16='\t'; + goto lgc_done; + case DOCT_PAGE_BREAK: + tempf->buf_ptr=cc->cur_buf_ptr=&lex_zeros; + tempf->line_num=doc_e->y+2; //TODO: should be a page down + cc->last_U16=CH_FORM_FEED; + goto lgc_done; + case DOCT_INS_BIN: + tempf->buf_ptr=cc->cur_buf_ptr=&lex_zeros; + tempf->line_num=doc_e->y+1; + Free(cc->cur_str); + cc->cur_str=NULL; + cc->cur_str_len=0; + if (doc_e->bin_data) { + ptr=MAlloc(doc_e->bin_data->size); + if (doc_e->bin_data->data) + MemCpy(ptr,doc_e->bin_data->data,doc_e->bin_data->size); + cc->cur_str=ptr; + cc->cur_str_len=doc_e->bin_data->size; + } + cc->last_U16=TK_INS_BIN; + goto lgc_done; + case DOCT_INS_BIN_SIZE: + tempf->buf_ptr=cc->cur_buf_ptr=&lex_zeros; + if (doc_e->bin_data) + cc->cur_i64=doc_e->bin_data->size; + else + cc->cur_i64=0; + tempf->line_num=doc_e->y+1; + cc->last_U16=TK_INS_BIN_SIZE; + goto lgc_done; + case DOCT_SHIFTED_Y: + if (LexDollar(cc,doc,doc_e) && *(src=cc->dollar_buf)) { + tempf->line_num=doc_e->y+1; + tempf->buf_ptr=cc->cur_buf_ptr=src; + } else { + tempf->buf_ptr=cc->cur_buf_ptr=&lex_zeros; + tempf->line_num=doc_e->y+1; + if (doc_e->attr<0) + cc->last_U16=TK_SUPERSCRIPT; + else if (doc_e->attr>0) + cc->last_U16=TK_SUBSCRIPT; + else + cc->last_U16=TK_NORMALSCRIPT; + goto lgc_done; + } + break; + case DOCT_MARKER: + case DOCT_CURSOR: + doc_e=doc_e->next; + goto lgc_start2; + case 0xFF: //nobound switch + default: + if (LexDollar(cc,doc,doc_e) && *(src=cc->dollar_buf)) { + tempf->line_num=doc_e->y+1; + tempf->buf_ptr=cc->cur_buf_ptr=src; + } else { + doc_e=doc_e->next; + goto lgc_start2; + } + } + } + if (doc_e!=doc) + goto lgc_start1; + tempf->cur_entry=doc->head.last; //When take next, will still be end. + } + tempf=cc->lex_include_stk; + if (tempf->next) { + tempf=LexFilePop(cc); + cc->cur_buf_ptr=tempf->buf_ptr; + cc->flags&=~CCF_USE_LAST_U16; + if (!(cc->last_U16=tempf->last_U16)) + goto lgc_start1; + } else { + if (cc->flags & CCF_PMT) { + Free(tempf->buf); + ptr=CmdLinePmt; + if (StrCmp(ptr,"\n") && !cc->pmt_line++ && !StrCmp(ptr,"?\n") && + cc->flags & CCF_QUESTION_HELP) { + Free(ptr); + ptr=StrNew("Help;;\n"); + } + tempf->buf=tempf->buf_ptr=tempf->line_start=cc->cur_buf_ptr=ptr; + goto lgc_start1; + } else { + if (src) + cc->cur_buf_ptr=src-1; + cc->last_U16=TK_EOF; + } + } + break; + case CH_CURSOR: + case CH_FORM_FEED: + goto lgc_start1; + case '\n': + tempf=cc->lex_include_stk; + if (!(tempf->flags & LFSF_DOC)) { + tempf->line_num++; + cmp.compiled_lines++; + tempf->line_start=src; + } + break; + case 0xFF: //nobound switch + } +lgc_done: + if (cc->last_U16==CH_SHIFT_SPACE) + cc->last_U16=CH_SPACE; + if (cc->opts & OPTF_ECHO && + cc->last_U16<256 && Bt(chars_bmp_printable,cc->last_U16)) + '' cc->last_U16; + } + return cc->last_U16; +} + +U0 LexSkipEol(CCmpCtrl *cc) +{//$LK,"LexGetChar",A="MN:LexGetChar"$ to NULL until end-of-line. + I64 ch; + do ch=$WW,0$LexGetChar(cc); + while (Bt(chars_bmp_non_eol,ch)); +} + +U8 *LexFirstRem(CCmpCtrl *cc,U8 *marker,I64 _len=NULL) +{//$LK,"LexGetChar",A="MN:LexGetChar"$() chars making str until marker. + U8 *res,*ptr; + CQueVectU8 *tempv=QueVectU8New; + I64 i,len=0; + while (TRUE) { + i=LexGetChar(cc); + if (!i||StrOcc(marker,i)) + break; + QueVectU8Put(tempv,len++,i); + } + if (i) + Bts(&cc->flags,CCf_USE_LAST_U16); + res=ptr=MAlloc(len+1); + for (i=0;ifull_name=StrNew(abs_filename); + else + tempf->full_name=StrNew(blkdev.temp_filename); + tempf->line_num=1; + tempf->buf=tempf->buf_ptr=tempf->line_start=cc->cur_buf_ptr=src; +} + +CDoc *LexDocRead(U8 *abs_filename,I64 flags) +{ + CDoc *doc=DocNew(abs_filename); + U8 *src; + I64 size=0; + doc->flags|=flags; + src=FileRead(abs_filename,&size); + if (!src || !size) { + Free(src); + src=CAlloc(1); + size=0; + } + DocLoad(doc,src,size); + Free(src); + return doc; +} + +I64 cmp_type_flags_src_code[(DOCT_NUM_TYPES+63)/64]={ + 1<head.next; + tempf->full_name=StrNew(doc->filename.name); + tempf->doc=doc; + while (doc_e!=doc) { + if (Bt(cmp_type_flags_src_code,doc_e->type_u8)) + break; + doc_e=doc_e->next; + col=doc_e->min_col; + } + if (doc_e!=doc) { + col=ClampI64(col,doc_e->min_col,doc_e->max_col); + tempf->line_start=doc_e; + tempf->buf=NULL; + tempf->line_num=doc_e->y+1; + if (doc_e->type_u8==DOCT_TEXT) { + tempf->cur_entry=doc_e; + tempf->buf_ptr=doc_e->tag; + } else { + tempf->cur_entry=doc_e->last; //TODO: might be problem at begin of file + tempf->buf_ptr=&lex_zeros; + } + tempf->flags=LFSF_DOC; + } else {//TODO: DocDel(doc)? + col=0; + tempf->buf=tempf->buf_ptr=tempf->line_start=CAlloc(1); + tempf->line_num=1; + tempf->flags=0; + } + cc->cur_buf_ptr=tempf->buf_ptr+col; + tempf->last_U16=0; +} + +I64 LexInStr(CCmpCtrl *cc,U8 *buf,I64 size,Bool *done) +{ + I64 i=0,j,k,ch; + *done=TRUE; + while (iflags|=CCF_USE_LAST_U16; + break; + } + } + buf[i++]=j; + break; + default: + cc->flags|=CCF_USE_LAST_U16; + buf[i++]='\\'; + } + } else if (ch=='$$') { + buf[i++]='$$'; + if (cc->dollar_cnt) + cc->dollar_cnt--; + else if (LexGetChar(cc)!='$$') { + cc->dollar_cnt=1; + cc->flags|=CCF_USE_LAST_U16; + } + } else + buf[i++]=ch; + } + *done=FALSE; + return i; +} + +I64 Lex(CCmpCtrl *cc) +{//Fetch next token. + I64 i,j,k,l,ch; + CHash *temph; + Bool str_done,neg_e; + U8 *fbuf,*buf2,*buf3,buf[STR_LEN]; + cc->last_line_num=cc->lex_include_stk->line_num; + while (TRUE) { +lex_cont: + switch [ch=LexGetChar(cc)] { + case 0: + return cc->token=TK_EOF; + case TK_SUPERSCRIPT: + ch='>'; + goto lex_ident; + case TK_SUBSCRIPT: + ch='<'; + goto lex_ident; + case TK_NORMALSCRIPT: + ch='='; + goto lex_ident; + case '@': + if (cc->flags&CCF_KEEP_AT_SIGN) { + cc->token=ch; + goto lex_end; + } + case 'A'...'Z': + case 'a'...'z': + case '_': + case 128...255: +lex_ident: + i=0; + buf[i++]=ch; + while (TRUE) { + if (i>=STR_LEN) + LexExcept(cc,"Ident limited to STR_LEN chars at "); + else if (!(ch=LexGetChar(cc))) + break; + else if (Bt(cc->chars_bmp_alpha_numeric,ch)) + buf[i++]=ch; + else if (ch==TK_SUPERSCRIPT) + buf[i++]='>'; + else if (ch==TK_SUBSCRIPT) + buf[i++]='<'; + else if (ch==TK_NORMALSCRIPT) + buf[i++]='='; + else { + cc->flags|=CCF_USE_LAST_U16; + break; + } + } + buf[i++]=0; + temph=NULL; + if (cc->htc.local_var_lst) + cc->local_var_entry=MemberFind(buf,cc->htc.local_var_lst); + else + cc->local_var_entry=NULL; + if (!cc->local_var_entry && cc->htc.hash_table_lst) + temph=HashFind(buf,cc->htc.hash_table_lst,cc->htc.hash_mask); + if (temph) + j=temph->type; + else + j=0; + if (j & HTT_DEFINE_STR && !(cc->flags & CCF_NO_DEFINES)) { + LexIncludeStr(cc, + temph->str,StrNew(temph(CHashDefineStr *)->data),FALSE); + cc->lex_include_stk->flags|=LFSF_DEFINE; + } else { + cc->hash_entry=temph; + Free(cc->cur_str); + cc->cur_str=StrNew(buf); + cc->cur_str_len=i; + cc->token=TK_IDENT; + goto lex_end; + } + break; + case '0'...'9': + i=ch-'0'; + ch=ToUpper(LexGetChar(cc)); + if (ch=='X') { + while (TRUE) { + ch=ToUpper(LexGetChar(cc)); + if (Bt(chars_bmp_hex_numeric,ch)) { + if (ch<='9') + i=i<<4+ch-'0'; + else + i=i<<4+ch-'A'+10; + } else { + cc->cur_i64=i; + cc->flags|=CCF_USE_LAST_U16; + cc->token=TK_I64; + goto lex_end; + } + } + } else if (ch=='B') { + while (TRUE) { + ch=LexGetChar(cc); + if (ch=='0') + i=i<<1; + else if (ch=='1') + i=i<<1+1; + else { + cc->cur_i64=i; + cc->flags|=CCF_USE_LAST_U16; + cc->token=TK_I64; + goto lex_end; + } + } + } + while (TRUE) { + if (Bt(chars_bmp_dec_numeric,ch)) + i=i*10+ch-'0'; + else { + if (ch=='.' || ch=='e' || ch=='E') break; +lex_is_int: + cc->cur_i64=i; + cc->flags|=CCF_USE_LAST_U16; + cc->token=TK_I64; + goto lex_end; + } + ch=LexGetChar(cc); + } + if (ch=='.') { + ch=LexGetChar(cc); + if (ch=='.') { + cc->flags|=CCF_LAST_WAS_DOT; + goto lex_is_int; + } + } +lex_float_start: + k=0; + while (TRUE) { + if (Bt(chars_bmp_dec_numeric,ch)) { + i=i*10+ch-'0'; + k++; + } else { + if (ch=='e' || ch=='E') + break; + cc->cur_f64=i*Pow10I64(-k); + cc->flags|=CCF_USE_LAST_U16; + cc->token=TK_F64; + goto lex_end; + } + ch=LexGetChar(cc); + } + ch=LexGetChar(cc); + neg_e=FALSE; + if (ch=='-') { + neg_e=TRUE; + ch=LexGetChar(cc); + } + j=0; + while (TRUE) { + if (Bt(chars_bmp_dec_numeric,ch)) + j=j*10+ch-'0'; + else { + if (neg_e) + cc->cur_f64=i*Pow10I64(-j-k); + else + cc->cur_f64=i*Pow10I64(j-k); + cc->flags|=CCF_USE_LAST_U16; + cc->token=TK_F64; + goto lex_end; + } + ch=LexGetChar(cc); + } + break; + case '"': + cc->flags|=CCF_IN_QUOTES; + buf2=NULL; + i=0; + do { + j=LexInStr(cc,buf,STR_LEN,&str_done); + buf3=MAlloc(i+j); + if (buf2) { + MemCpy(buf3,buf2,i); + Free(buf2); + buf2=buf3; + MemCpy(buf2+i,buf,j); + } else { + buf2=buf3; + MemCpy(buf2,buf,j); + } + i+=j; + } while (!str_done); + Free(cc->cur_str); + cc->cur_str=MAlloc(i); + MemCpy(cc->cur_str,buf2,i); + Free(buf2); + cc->cur_str_len=i; + cc->flags&=~CCF_IN_QUOTES; + cc->token=TK_STR; + goto lex_end; + case '\'': + k=0; + for (j=0;j<8;j++) { + if (!(ch=LexGetChar(cc)) || ch=='\'') + break; + if (ch=='\\') { + switch (ch=LexGetChar(cc)) { + case '0': k.u8[j]=0; break; + case '\'': k.u8[j]='\''; break; + case '\`': k.u8[j]='\`'; break; + case '"': k.u8[j]='"'; break; + case '\\': k.u8[j]='\\'; break; + case 'd': k.u8[j]='$$'; break; + case 'n': k.u8[j]='\n'; break; + case 'r': k.u8[j]='\r'; break; + case 't': k.u8[j]='\t'; break; + case 'x': + case 'X': + i=0; + for (l=0;l<2;l++) { + ch=ToUpper(LexGetChar(cc)); + if (Bt(chars_bmp_hex_numeric,ch)) { + if (ch<='9') + i=i<<4+ch-'0'; + else + i=i<<4+ch-'A'+10; + } else { + cc->flags|=CCF_USE_LAST_U16; + break; + } + } + k.u8[j]=i; + break; + default: + k.u8[j]='\\'; + cc->flags|=CCF_USE_LAST_U16; + } + } else if (ch=='$$') { + ch=LexGetChar(cc); + k.u8[j]='$$'; + if (ch!='$$') + cc->flags|=CCF_USE_LAST_U16; + } else + k.u8[j]=ch; + } + if (ch!='\'' && (ch=LexGetChar(cc)) && ch!='\'') + LexExcept(cc,"Char const limited to 8 chars at "); + cc->cur_i64=k; + cc->token=TK_CHAR_CONST; + goto lex_end; + case '#': + if (cc->flags&CCF_KEEP_NUM_SIGN) { + cc->token=ch; + goto lex_end; + } + if (Lex(cc)!=TK_IDENT) //skip '#' + goto lex_end; + if (!(temph=cc->hash_entry)) + goto lex_end; + if (!(temph->type & HTT_KEYWORD)) + goto lex_end; + switch (i=temph(CHashGeneric *)->user_data0) { + case KW_INCLUDE: + if (Lex(cc)!=TK_STR) + goto lex_end; + fbuf=DftExt(cc->cur_str,"HC.Z"); + buf2=FileNameAbs(fbuf); + Free(fbuf); + if (Bt(&sys_run_level,RLf_DOC)) + LexAttachDoc(cc,,,buf2); + else + LexIncludeStr(cc,buf2,FileRead(buf2),TRUE); + Free(buf2); + break; + case KW_DEFINE: + cc->flags|=CCF_NO_DEFINES; + if (Lex(cc)==TK_IDENT) { + temph=CAlloc(sizeof(CHashDefineStr)); + temph->str=cc->cur_str; + cc->cur_str=0; + temph->type=HTT_DEFINE_STR; + HashSrcFileSet(cc,temph); + + do ch=LexGetChar(cc); //skip space between define name and start + while (Bt(chars_bmp_non_eol_white_space,ch)); + + i=j=0; + buf2=NULL; + if (ch) { + do { + if (ch=='\\') { + if (ch=LexGetChar(cc)) { + if (ch!='\r' && ch!='\n') { + buf[j++]='\\'; + buf[j++]=ch; + } else if (ch=='\r' && LexGetChar(cc)!='\n') + cc->flags|=CCF_USE_LAST_U16; + } else { + buf[j++]='\\'; + break; + } + } else if (ch!='\n') + buf[j++]=ch; + else + break; + while (ch=LexGetChar(cc)) { + if (ch=='/') { + ch=LexGetChar(cc); + if (ch=='/') { + do ch=LexGetChar(cc); + while (Bt(chars_bmp_non_eol,ch)); + break; + } else { + buf[j++]='/'; + cc->flags|=CCF_USE_LAST_U16; + } + } else if (ch=='\\') + break; + else if (Bt(chars_bmp_non_eol,ch)) + buf[j++]=ch; + else + break; + if (j>=STR_LEN-4) {//Spot for ['\'][ch],[ch],[0] + buf[j++]=0; + buf3=MAlloc(i+j); + if (buf2) { + MemCpy(buf3,buf2,i); + Free(buf2); + buf2=buf3; + MemCpy(buf2+i,buf,j); + } else { + buf2=buf3; + MemCpy(buf2,buf,j); + } + i+=j-1; + j=0; + } + } + } while (ch=='\\'); + } + buf[j++]=0; + buf3=MAlloc(i+j); + if (buf2) { + MemCpy(buf3,buf2,i); + Free(buf2); + buf2=buf3; + MemCpy(buf2+i,buf,j); + } else { + buf2=buf3; + MemCpy(buf2,buf,j); + } + temph(CHashDefineStr *)->data=buf2; + temph(CHashDefineStr *)->cnt=-1; + HashAdd(temph,cc->htc.define_hash_table); + } + cc->flags&=~CCF_NO_DEFINES; + break; + case KW_ELSE: + if (cc->flags & CCF_IN_IF) { + cc->token=TK_ELSE; + goto lex_end; + } +lex_else: + j=1; + do { + if (ch=LexGetChar(cc)) { + if (ch=='#') { + if (!Lex(cc)) + goto lex_end; + i=PrsKeyWord(cc); + if (i==KW_IF || i==KW_IFDEF || i==KW_IFNDEF || + i==KW_IFAOT || i==KW_IFJIT) + j++; + else if (i==KW_ENDIF) + j--; + } + } else { + cc->token=TK_EOF; + goto lex_end; + } + } while (j); + break; + + case KW_IF: + if (cc->flags & CCF_IN_IF) { + cc->token=TK_IF; + goto lex_end; + } +lex_if: + cc->flags|=CCF_IN_IF; + if (!Lex(cc)) { + cc->flags&=~CCF_IN_IF; + goto lex_end; + } + if (LexExpression(cc)) { + cc->flags&=~CCF_IN_IF; + switch (cc->token) { + case TK_IF: goto lex_if; + case TK_IFDEF: goto lex_ifdef; + case TK_IFNDEF: goto lex_ifndef; + case TK_IFAOT: goto lex_ifaot; + case TK_IFJIT: goto lex_ifjit; + case TK_ELSE: goto lex_else; + case TK_ENDIF: goto lex_cont; + default: goto lex_end; + } + } else { + cc->flags&=~CCF_IN_IF; + if (cc->token!=TK_ENDIF && cc->token!=TK_ELSE) { + if (cc->token==TK_IF || cc->token==TK_IFDEF || + cc->token==TK_IFNDEF || cc->token==TK_IFAOT || + cc->token==TK_IFJIT) + j=2; + else + j=1; + do { + if (ch=LexGetChar(cc)) { + if (ch=='#') { + if (!Lex(cc)) + goto lex_end; + i=PrsKeyWord(cc); + if (i==KW_IF || i==KW_IFDEF || i==KW_IFNDEF || + i==KW_IFAOT || i==KW_IFJIT) + j++; + else if (i==KW_ENDIF) + j--; + else if (i==KW_ELSE && j==1) + break; + } + } else { + cc->token=TK_EOF; + goto lex_end; + } + } while (j); + } + } + break; + case KW_IFDEF: + if (cc->flags & CCF_IN_IF) { + cc->token=TK_IFDEF; + goto lex_end; + } +lex_ifdef: + cc->flags|=CCF_NO_DEFINES; + if (!Lex(cc)) { + cc->flags&=~CCF_NO_DEFINES; + goto lex_end; + } + cc->flags&=~CCF_NO_DEFINES; + if (cc->token!=TK_IDENT) + goto lex_end; + if (cc->hash_entry) + goto lex_cont; + j=1; + do { + if (ch=LexGetChar(cc)) { + if (ch=='#') { + if (!Lex(cc)) + goto lex_end; + i=PrsKeyWord(cc); + if (i==KW_IF || i==KW_IFDEF || i==KW_IFNDEF || + i==KW_IFAOT || i==KW_IFJIT) + j++; + else if (i==KW_ENDIF) + j--; + else if (i==KW_ELSE && j==1) + break; + } + } else { + cc->token=TK_EOF; + goto lex_end; + } + } while (j); + break; + case KW_IFNDEF: + if (cc->flags & CCF_IN_IF) { + cc->token=TK_IFNDEF; + goto lex_end; + } +lex_ifndef: + cc->flags|=CCF_NO_DEFINES; + if (!Lex(cc)) { + cc->flags&=~CCF_NO_DEFINES; + goto lex_end; + } + cc->flags&=~CCF_NO_DEFINES; + if (cc->token!=TK_IDENT) + goto lex_end; + if (!cc->hash_entry) + goto lex_cont; + j=1; + do { + if (ch=LexGetChar(cc)) { + if (ch=='#') { + if (!Lex(cc)) + goto lex_end; + i=PrsKeyWord(cc); + if (i==KW_IF || i==KW_IFDEF || i==KW_IFNDEF || + i==KW_IFAOT || i==KW_IFJIT) + j++; + else if (i==KW_ENDIF) + j--; + else if (i==KW_ELSE && j==1) + break; + } + } else { + cc->token=TK_EOF; + goto lex_end; + } + } while (j); + break; + case KW_IFAOT: + if (cc->flags & CCF_IN_IF) { + cc->token=TK_IFAOT; + goto lex_end; + } +lex_ifaot: + if (cc->flags & CCF_AOT_COMPILE) + goto lex_cont; + j=1; + do { + if (ch=LexGetChar(cc)) { + if (ch=='#') { + if (!Lex(cc)) + goto lex_end; + i=PrsKeyWord(cc); + if (i==KW_IF || i==KW_IFDEF || i==KW_IFNDEF || + i==KW_IFAOT || i==KW_IFJIT) + j++; + else if (i==KW_ENDIF) + j--; + else if (i==KW_ELSE && j==1) + break; + } + } else { + cc->token=TK_EOF; + goto lex_end; + } + } while (j); + break; + case KW_IFJIT: + if (cc->flags & CCF_IN_IF) { + cc->token=TK_IFAOT; + goto lex_end; + } +lex_ifjit: + if (!(cc->flags & CCF_AOT_COMPILE)) + goto lex_cont; + j=1; + do { + if (ch=LexGetChar(cc)) { + if (ch=='#') { + if (!Lex(cc)) + goto lex_end; + i=PrsKeyWord(cc); + if (i==KW_IF || i==KW_IFDEF || i==KW_IFNDEF || + i==KW_IFAOT || i==KW_IFJIT) + j++; + else if (i==KW_ENDIF) + j--; + else if (i==KW_ELSE && j==1) + break; + } + } else { + cc->token=TK_EOF; + goto lex_end; + } + } while (j); + break; + case KW_ENDIF: + if (cc->flags & CCF_IN_IF) { + cc->token=TK_ENDIF; + goto lex_end; + } + break; + case KW_ASSERT: + if (!Lex(cc)) + goto lex_end; + if (!LexExpression(cc)) + LexWarn(cc,"Assert Failed "); + goto lex_end; + case KW_EXE: + if (!Lex(cc)) + goto lex_end; + PrsStreamBlk(cc); + goto lex_end; + case KW_HELP_INDEX: + if (Lex(cc)!=TK_STR) + goto lex_end; + Free(cc->cur_help_idx); + cc->cur_help_idx=LexExtStr(cc,,FALSE); + break; + case KW_HELP_FILE: + if (Lex(cc)!=TK_STR) + goto lex_end; + temph=CAlloc(sizeof(CHashSrcSym)); + fbuf=DftExt(cc->cur_str,"DD.Z"); + temph->str=FileNameAbs(fbuf); + Free(fbuf); + temph->type=HTT_HELP_FILE|HTF_PUBLIC; + HashSrcFileSet(cc,temph); + HashAdd(temph,cc->htc.glbl_hash_table); + break; + } + break; + case '\n': + if (!(cc->flags&CCF_KEEP_NEW_LINES)) + break; //else fall through + case TK_INS_BIN: + case TK_INS_BIN_SIZE: + cc->token=ch; + goto lex_end; + case '.': + if (cc->flags&CCF_KEEP_DOT) { + cc->token=ch; + goto lex_end; + } + if (cc->flags&CCF_LAST_WAS_DOT) { + cc->flags&=~CCF_LAST_WAS_DOT; + goto lex_dot_dot; + } + ch=LexGetChar(cc); + if ('0'<=ch<='9') { + i=0; + goto lex_float_start; + } else if (ch=='.') { +lex_dot_dot: + cc->token=TK_DOT_DOT; + if (LexGetChar(cc)=='.') + cc->token=TK_ELLIPSIS; + else + cc->flags|=CCF_USE_LAST_U16; + goto lex_end; + } + cc->flags|=CCF_USE_LAST_U16; + cc->token='.'; + goto lex_end; + case '!': + case '$$'...'&': + case '('...'-': + case '/': + case ':'...'?': + case '[': + case ']'...'^': + case '{'...'~': + case '`': + if (!(i=cmp.dual_U16_tokens1[ch])) { + if (ch=='$$') { + ch=LexGetChar(cc); + if (ch=='$$') { + cc->token='$$'; + goto lex_end; + } else if (ch) { + do ch=LexGetChar(cc); + while (ch && ch!='$$'); + if (!ch) { + cc->token=TK_EOF; + goto lex_end; + } else + goto lex_cont; + } else { + cc->flags|=CCF_USE_LAST_U16; + cc->token='$$'; + goto lex_end; + } + } else { + cc->token=ch; + goto lex_end; + } + } else { + j=LexGetChar(cc); + if (i.u16[0]==j) { + i>>=16; + if (!i) {// "/*" + j=1; + do { + if (!(ch=LexGetChar(cc))) + return cc->token=TK_EOF; +lex_check_comment: + if (ch=='*') { + if (!(ch=LexGetChar(cc))) + return cc->token=TK_EOF; + if (ch=='/') + j--; + else + goto lex_check_comment; + } else if (ch=='/') { + if (!(ch=LexGetChar(cc))) + return cc->token=TK_EOF; + if (ch=='*') + j++; + else + goto lex_check_comment; + } + } while (j); + goto lex_cont; + } else { + cc->token=i; + goto lex_end; + } + } + if (i=cmp.dual_U16_tokens2[ch]) { + if (i.u16[0]==j) { + i>>=16; + if (!i) {// "//" + LexSkipEol(cc); + if (cc->flags&CCF_KEEP_NEW_LINES) { + cc->token='\n'; + goto lex_end; + } else + goto lex_cont; + } else { + if (i==TK_SHL || i==TK_SHR) { + j=LexGetChar(cc); + if (j=='=') { + if (i==TK_SHL) + i=TK_SHL_EQU; + else + i=TK_SHR_EQU; + } else + cc->flags|=CCF_USE_LAST_U16; + } + cc->token=i; + goto lex_end; + } + } + if (i=cmp.dual_U16_tokens3[ch]) { + if (i.u16[0]==j) { + cc->token=i.u16[1]; + goto lex_end; + } + } + } + cc->flags|=CCF_USE_LAST_U16; + cc->token=ch; + goto lex_end; + } + case TK_NUM_TK: + default: + break; + } + } +lex_end: + LexGetChar(cc); //Do this so WAS_NEW_LINE is right + cc->flags|=CCF_USE_LAST_U16; + return cc->token; +} diff --git a/Compiler/LexLib.CPP b/Compiler/LexLib.CPP deleted file mode 100644 index b9a5037..0000000 --- a/Compiler/LexLib.CPP +++ /dev/null @@ -1,245 +0,0 @@ -U0 LexBackupLastChar(CCmpCtrl *cc) -{ - CLexFile *tempf=cc->lex_include_stk; - tempf->buf_ptr=cc->cur_buf_ptr; - if (cc->flags & CCF_USE_LAST_U16) { - tempf->last_U16=cc->last_U16; - cc->flags&=~CCF_USE_LAST_U16; - } else - tempf->last_U16=0; -} - -U0 LexPush(CCmpCtrl *cc) -{//Create token-stream save point. - CLexFile *tempf; - LexBackupLastChar(cc); - if (cc->lex_include_stk->last_U16) - cc->flags|=CCF_USE_LAST_U16; - tempf=MAllocIdent(cc->lex_include_stk); - tempf->next=cc->lex_prs_stk; - cc->lex_prs_stk=tempf; -} - -U0 LexPopRestore(CCmpCtrl *cc) -{//Restore token-stream saved-point. -//Bad things can happen if you cross an #include file boundary. - CLexFile *tempf=cc->lex_prs_stk; - cc->cur_buf_ptr=tempf->buf_ptr; - if (cc->last_U16=tempf->last_U16) - cc->flags|=CCF_USE_LAST_U16; - else - cc->flags&=~CCF_USE_LAST_U16; - MemCpy(cc->lex_include_stk(U8 *)+sizeof(U8 *),tempf(U8 *)+sizeof(U8 *), - sizeof(CLexFile)-sizeof(U8 *)); - cc->lex_prs_stk=tempf->next; - Free(tempf); -} - -U0 LexPopNoRestore(CCmpCtrl *cc) -{//Don't restore token-stream saved-point. - CLexFile *tempf=cc->lex_prs_stk; - cc->lex_prs_stk=tempf->next; - Free(tempf); -} - -I64 MemberMetaData(U8 *needle_str,CMemberLst *haystack_member_lst) -{//Find meta data name, return meta data val. See $LK,"::/Demo/ClassMeta.CPP"$. - CMemberLstMeta *meta=haystack_member_lst->meta; - while (meta) { - if (!StrCmp(meta->str,needle_str)) - return meta->user_data; - meta=meta->next; - } - return 0; -} - -CMemberLstMeta *MemberMetaFind(U8 *needle_str,CMemberLst *haystack_member_lst) -{//Find meta data name, return meta data struct. See $LK,"::/Demo/ClassMeta.CPP"$. - CMemberLstMeta *meta=haystack_member_lst->meta; - while (meta) { - if (!StrCmp(meta->str,needle_str)) - return meta; - meta=meta->next; - } - return NULL; -} - -CMemberLst *MemberFind(U8 *needle_str,CHashClass *haystack_class) -{//Find class member. See $LK,"ClassRep",A="MN:ClassRep"$() and $LK,"DocForm",A="MN:DocForm"$(). - I64 i; - CMemberLst *tempm; - do { - tempm=haystack_class->member_lst_and_root; - while (tempm) { - if (!(i=StrCmp(tempm->str,needle_str))) { - tempm->use_cnt++; - return tempm; - } - if (i<=0) - tempm=tempm->left; - else - tempm=tempm->right; - } - } while (haystack_class=haystack_class->base_class); - return NULL; -} - -CMemberLst *MemberClassBaseFind(CHashClass *needle_class, - CHashClass *haystack_class) -{//Find class member class base. For finding dup class local vars. - CMemberLst *tempm; - tempm=haystack_class->member_class_base_root; - while (tempm) { - if (needle_class==tempm->member_class_base) - return tempm; - if (needle_classmember_class_base) - tempm=tempm->left_class_base; - else - tempm=tempm->right_class_base; - } - return NULL; -} - -U0 MemberAdd(CCmpCtrl *cc,CMemberLst *tempm,CHashClass *tempc,I64 mode) -{ - U8 *st=tempm->str; - CMemberLst **tempm1,*tempm2; - - if (MemberFind(st,tempc) && StrCmp(st,"pad") && - StrCmp(st,"reserved") && StrCmp(st,"_anon_")) - LexExcept(cc,"Duplicate member at "); - tempm1=&tempc->member_lst_and_root; - while (tempm2=*tempm1) { - if (StrCmp(tempm2->str,st)<=0) - tempm1=&tempm2->left; - else - tempm1=&tempm2->right; - } - *tempm1=tempm; - - if (mode==PRS1B_LOCAL_VAR) { - tempm->member_class_base= - tempm->member_class-tempm->member_class->ptr_stars_cnt; - if (Bt(&cc->opts,OPTf_WARN_DUP_TYPES) && - MemberClassBaseFind(tempm->member_class_base,tempc)) - LexWarn(cc,"Duplicate type at "); - tempm1=&tempc->member_class_base_root; - while (tempm2=*tempm1) { - if (tempm->member_class_basemember_class_base) - tempm1=&tempm2->left_class_base; - else if (tempm->member_class_base>tempm2->member_class_base) - tempm1=&tempm2->right_class_base; - else { - tempm1=NULL; - break; - } - } - if (tempm1) - *tempm1=tempm; - } else - tempm->member_class_base=NULL; - - tempm->left=NULL; - tempm->right=NULL; - tempm->left_class_base=NULL; - tempm->right_class_base=NULL; - tempm2=tempc->last_in_member_lst; - tempm2->next=tempc->last_in_member_lst=tempm; -} - -CMemberLst *MemberLstNew(I64 _reg) -{ - CMemberLst *res=CAlloc(sizeof(CMemberLst)); - res->reg=_reg; - return res; -} - -U0 MemberLstDel(CHashClass *tempc) -{ - CMemberLst *tempm,*tempm1; - CMemberLstMeta *temp_meta,*temp_meta1; - tempm=tempc->member_lst_and_root; - while (tempm) { - tempm1=tempm->next; - Free(tempm->str); - LinkedLstDel(tempm->dim.next); - if (tempm->flags & MLF_STR_DFT_AVAILABLE) - Free(tempm->dft_val); - if (tempm->flags & MLF_FUN) - HashDel(tempm->fun_ptr-tempm->fun_ptr->ptr_stars_cnt); - temp_meta=tempm->meta; - while (temp_meta) { - temp_meta1=temp_meta->next; - Free(temp_meta->str); - if (temp_meta->flags&MLMF_IS_STR) - Free(temp_meta->user_data); - Free(temp_meta); - temp_meta=temp_meta1; - } - Free(tempm); - tempm=tempm1; - } - tempc->size=0; - tempc->last_in_member_lst=&tempc->member_lst_and_root; - tempc->member_lst_and_root=NULL; - tempc->member_class_base_root=NULL; - tempc->member_cnt=0; - if (tempc->type&HTT_FUN) - tempc(CHashFun *)->arg_cnt=0; -} - -I64 MemberLstSize(CHashClass *tempc) -{ - CMemberLst *tempm; - CMemberLstMeta *temp_meta; - I64 res=0; - tempm=tempc->member_lst_and_root; - while (tempm) { - res+=MSize2(tempm->str); - res+=LinkedLstSize(tempm->dim.next); - if (tempm->flags & MLF_STR_DFT_AVAILABLE) - res+=MSize2(tempm->dft_val); - if (tempm->flags & MLF_FUN) - res+=HashEntrySize2(tempm->fun_ptr-tempm->fun_ptr->ptr_stars_cnt); - temp_meta=tempm->meta; - while (temp_meta) { - res+=MSize2(temp_meta->str); - if (temp_meta->flags&MLMF_IS_STR) - res+=MSize2(temp_meta->user_data); - res+=MSize2(temp_meta); - temp_meta=temp_meta->next; - } - res+=MSize2(tempm); - tempm=tempm->next; - } - return res; -} - -U8 *LexExtStr(CCmpCtrl *cc,I64 *_size=NULL,Bool lex_next=TRUE) -{//Lex $LK,"TK_STR",A="MN:TK_STR"$'s to one combined str. _size includes terminator. - I64 len=cc->cur_str_len,len1,len2; - U8 *st=cc->cur_str,*st1,*st2; - cc->cur_str=NULL; - while (cc->token==TK_STR) { - st1=st; - len1=len; - if (!lex_next && LexGetChar(cc)!='\\') { - cc->flags|=CCF_USE_LAST_U16; - break; - } - if (Lex(cc)==TK_STR) { - len2=cc->cur_str_len; - st2=cc->cur_str; - cc->cur_str=NULL; - len=len1+len2-1; - st=MAlloc(len); - if (len1>1) - MemCpy(st,st1,len1-1); - MemCpy(st+len1-1,st2,len2); - Free(st1); - Free(st2); - } - } - if (_size) *_size=len; - return st; -} diff --git a/Compiler/LexLib.HC b/Compiler/LexLib.HC new file mode 100644 index 0000000..0e102d4 --- /dev/null +++ b/Compiler/LexLib.HC @@ -0,0 +1,275 @@ +U0 LexBackupLastChar(CCmpCtrl *cc) +{ + CLexFile *tempf=cc->lex_include_stk; + tempf->buf_ptr=cc->cur_buf_ptr; + if (cc->flags & CCF_USE_LAST_U16) { + tempf->last_U16=cc->last_U16; + cc->flags&=~CCF_USE_LAST_U16; + } else + tempf->last_U16=0; +} + +U0 LexPush(CCmpCtrl *cc) +{//Create token-stream save point. + CLexFile *tempf; + LexBackupLastChar(cc); + if (cc->lex_include_stk->last_U16) + cc->flags|=CCF_USE_LAST_U16; + tempf=MAllocIdent(cc->lex_include_stk); + tempf->next=cc->lex_prs_stk; + cc->lex_prs_stk=tempf; +} + +U0 LexPopRestore(CCmpCtrl *cc) +{//Restore token-stream saved-point. +//Bad things can happen if you cross an #include file boundary. + CLexFile *tempf=cc->lex_prs_stk; + cc->cur_buf_ptr=tempf->buf_ptr; + if (cc->last_U16=tempf->last_U16) + cc->flags|=CCF_USE_LAST_U16; + else + cc->flags&=~CCF_USE_LAST_U16; + MemCpy(cc->lex_include_stk(U8 *)+sizeof(U8 *),tempf(U8 *)+sizeof(U8 *), + sizeof(CLexFile)-sizeof(U8 *)); + cc->lex_prs_stk=tempf->next; + Free(tempf); +} + +U0 LexPopNoRestore(CCmpCtrl *cc) +{//Don't restore token-stream saved-point. + CLexFile *tempf=cc->lex_prs_stk; + cc->lex_prs_stk=tempf->next; + Free(tempf); +} + +I64 MemberMetaData(U8 *needle_str,CMemberLst *haystack_member_lst) +{//Find meta data name, return meta data val. See $LK,"::/Demo/ClassMeta.HC"$. + CMemberLstMeta *meta=haystack_member_lst->meta; + while (meta) { + if (!StrCmp(meta->str,needle_str)) + return meta->user_data; + meta=meta->next; + } + return 0; +} + +CMemberLstMeta *MemberMetaFind(U8 *needle_str,CMemberLst *haystack_member_lst) +{//Find meta data name, return meta data struct. See $LK,"::/Demo/ClassMeta.HC"$. + CMemberLstMeta *meta=haystack_member_lst->meta; + while (meta) { + if (!StrCmp(meta->str,needle_str)) + return meta; + meta=meta->next; + } + return NULL; +} + +CMemberLst *MemberFind(U8 *needle_str,CHashClass *haystack_class) +{//Find class member. See $LK,"ClassRep",A="MN:ClassRep"$() and $LK,"DocForm",A="MN:DocForm"$(). + I64 i; + CMemberLst *tempm; + do { + tempm=haystack_class->member_lst_and_root; + while (tempm) { + if (!(i=StrCmp(tempm->str,needle_str))) { + tempm->use_cnt++; + return tempm; + } + if (i<=0) + tempm=tempm->left; + else + tempm=tempm->right; + } + } while (haystack_class=haystack_class->base_class); + return NULL; +} + +CMemberLst *MemberClassBaseFind(CHashClass *needle_class, + CHashClass *haystack_class) +{//Find class member class base. For finding dup class local vars. + CMemberLst *tempm; + tempm=haystack_class->member_class_base_root; + while (tempm) { + if (needle_class==tempm->member_class_base) + return tempm; + if (needle_classmember_class_base) + tempm=tempm->left_class_base; + else + tempm=tempm->right_class_base; + } + return NULL; +} + +U0 MemberAdd(CCmpCtrl *cc,CMemberLst *tempm,CHashClass *tempc,I64 mode) +{ + U8 *st=tempm->str; + CMemberLst **tempm1,*tempm2; + + if (MemberFind(st,tempc) && StrCmp(st,"pad") && + StrCmp(st,"reserved") && StrCmp(st,"_anon_")) + LexExcept(cc,"Duplicate member at "); + tempm1=&tempc->member_lst_and_root; + while (tempm2=*tempm1) { + if (StrCmp(tempm2->str,st)<=0) + tempm1=&tempm2->left; + else + tempm1=&tempm2->right; + } + *tempm1=tempm; + + if (mode==PRS1B_LOCAL_VAR) { + tempm->member_class_base= + tempm->member_class-tempm->member_class->ptr_stars_cnt; + if (Bt(&cc->opts,OPTf_WARN_DUP_TYPES) && + MemberClassBaseFind(tempm->member_class_base,tempc)) + LexWarn(cc,"Duplicate type at "); + tempm1=&tempc->member_class_base_root; + while (tempm2=*tempm1) { + if (tempm->member_class_basemember_class_base) + tempm1=&tempm2->left_class_base; + else if (tempm->member_class_base>tempm2->member_class_base) + tempm1=&tempm2->right_class_base; + else { + tempm1=NULL; + break; + } + } + if (tempm1) + *tempm1=tempm; + } else + tempm->member_class_base=NULL; + + tempm->left=NULL; + tempm->right=NULL; + tempm->left_class_base=NULL; + tempm->right_class_base=NULL; + tempm2=tempc->last_in_member_lst; + tempm2->next=tempc->last_in_member_lst=tempm; +} + +CMemberLst *MemberLstNew(I64 _reg) +{ + CMemberLst *res=CAlloc(sizeof(CMemberLst)); + res->reg=_reg; + return res; +} + +Bool MemberLstCmp(CMemberLst *tempm1,CMemberLst *tempm2,I64 cnt=MAX_I64) +{ + while (tempm1 && tempm2 && cnt--) { + if (StrCmp(tempm1->str,tempm2->str) || + tempm1->member_class!=tempm2->member_class || + tempm1->member_class_base!=tempm2->member_class_base) + return FALSE; + if (tempm1->flags&MLF_DFT_AVAILABLE || tempm2->flags&MLF_DFT_AVAILABLE) { + if (tempm1->flags&(MLF_DFT_AVAILABLE|MLF_STR_DFT_AVAILABLE)!= + tempm2->flags&(MLF_DFT_AVAILABLE|MLF_STR_DFT_AVAILABLE)) + return FALSE; + if (tempm1->flags&MLF_STR_DFT_AVAILABLE) { + if (StrCmp(tempm1->dft_val,tempm2->dft_val)) + return FALSE; + } else if (tempm1->dft_val!=tempm2->dft_val) + return FALSE; + } + tempm1=tempm1->next; + tempm2=tempm2->next; + } + if (cnt<0 || !tempm1 && !tempm2) + return TRUE; + else + return FALSE; +} + +U0 MemberLstDel(CMemberLst *tempm) +{ + CMemberLst *tempm1; + CMemberLstMeta *temp_meta,*temp_meta1; + while (tempm) { + tempm1=tempm->next; + Free(tempm->str); + LinkedLstDel(tempm->dim.next); + if (tempm->flags & MLF_STR_DFT_AVAILABLE) + Free(tempm->dft_val); + if (tempm->flags & MLF_FUN) + HashDel(tempm->fun_ptr-tempm->fun_ptr->ptr_stars_cnt); + temp_meta=tempm->meta; + while (temp_meta) { + temp_meta1=temp_meta->next; + Free(temp_meta->str); + if (temp_meta->flags&MLMF_IS_STR) + Free(temp_meta->user_data); + Free(temp_meta); + temp_meta=temp_meta1; + } + Free(tempm); + tempm=tempm1; + } +} + +U0 ClassMemberLstDel(CHashClass *tempc) +{ + MemberLstDel(tempc->member_lst_and_root); + tempc->size=0; + tempc->last_in_member_lst=&tempc->member_lst_and_root; + tempc->member_lst_and_root=NULL; + tempc->member_class_base_root=NULL; + tempc->member_cnt=0; + if (tempc->type&HTT_FUN) + tempc(CHashFun *)->arg_cnt=0; +} + +I64 MemberLstSize(CHashClass *tempc) +{ + CMemberLst *tempm; + CMemberLstMeta *temp_meta; + I64 res=0; + tempm=tempc->member_lst_and_root; + while (tempm) { + res+=MSize2(tempm->str); + res+=LinkedLstSize(tempm->dim.next); + if (tempm->flags & MLF_STR_DFT_AVAILABLE) + res+=MSize2(tempm->dft_val); + if (tempm->flags & MLF_FUN) + res+=HashEntrySize2(tempm->fun_ptr-tempm->fun_ptr->ptr_stars_cnt); + temp_meta=tempm->meta; + while (temp_meta) { + res+=MSize2(temp_meta->str); + if (temp_meta->flags&MLMF_IS_STR) + res+=MSize2(temp_meta->user_data); + res+=MSize2(temp_meta); + temp_meta=temp_meta->next; + } + res+=MSize2(tempm); + tempm=tempm->next; + } + return res; +} + +U8 *LexExtStr(CCmpCtrl *cc,I64 *_size=NULL,Bool lex_next=TRUE) +{//Lex $LK,"TK_STR",A="MN:TK_STR"$'s to one combined str. _size includes terminator. + I64 len=cc->cur_str_len,len1,len2; + U8 *st=cc->cur_str,*st1,*st2; + cc->cur_str=NULL; + while (cc->token==TK_STR) { + st1=st; + len1=len; + if (!lex_next && LexGetChar(cc)!='\\') { + cc->flags|=CCF_USE_LAST_U16; + break; + } + if (Lex(cc)==TK_STR) { + len2=cc->cur_str_len; + st2=cc->cur_str; + cc->cur_str=NULL; + len=len1+len2-1; + st=MAlloc(len); + if (len1>1) + MemCpy(st,st1,len1-1); + MemCpy(st+len1-1,st2,len2); + Free(st1); + Free(st2); + } + } + if (_size) *_size=len; + return st; +} diff --git a/Compiler/OpCodes.TXT b/Compiler/OpCodes.DD similarity index 100% rename from Compiler/OpCodes.TXT rename to Compiler/OpCodes.DD diff --git a/Compiler/OptLib.CPP b/Compiler/OptLib.CPP deleted file mode 100644 index 2220d22..0000000 --- a/Compiler/OptLib.CPP +++ /dev/null @@ -1,565 +0,0 @@ -CCodeMisc *OptLabelFwd(CCodeMisc *lb) -{ - CCodeMisc *lb1; - while (lb1=lb->fwd) - lb=lb1; - return lb; -} - -CHashClass *OptClassFwd(CHashClass *tempc) -{//Class forwarding for unions and subclasses. - CHashClass *tempc1; - while (tempc1=tempc->fwd_class) - tempc=tempc1; - return tempc; -} - -U0 OptSetNOP1(CIntermediateCode *tempi) -{ - tempi->ic_code=IC_NOP1; - tempi->ic_flags=0; - tempi->a1.type=MDF_NULL+tempi->a1.type.raw_type; - tempi->r.type =MDF_NULL+tempi->r.type.raw_type; -} - -U0 OptSetNOP2(CIntermediateCode *tempi,I64 stk_delta=1) -{ - tempi->ic_code=IC_NOP2; - tempi->ic_data=stk_delta; - tempi->a1.type=MDF_NULL+tempi->a1.type.raw_type; - tempi->r.type =MDF_NULL+tempi->r.type.raw_type; -} - -CIntermediateCode *OptFree(CIntermediateCode *tempi) -{//We might access freed entries in CICTreeLinks - QueRem(tempi); - Free(tempi); - return NULL; -} - -CIntermediateCode *OptLag(CIntermediateCode *tempi) -{ - do { - if (!tempi->ic_code) - return NULL; - else - tempi=tempi->last; - } while (tempi->ic_code<=IC_END_EXP); - return tempi; -} - -CIntermediateCode *OptLag1(CIntermediateCode *tempi) -{ - do { - if (!tempi->ic_code) - return NULL; - else - tempi=tempi->last; - } while (tempi->ic_code==IC_NOP1||tempi->ic_code==IC_NOP2); - return tempi; -} - -CIntermediateCode *OptLag2(CIntermediateCode *tempi) -{ - do { - if (!tempi->ic_code) - return NULL; - else - tempi=tempi->last; - } while (tempi->ic_codenext; - if (!tempi->ic_code) - return NULL; - } while (tempi->ic_code==IC_NOP1||tempi->ic_code==IC_NOP2); - return tempi; -} - -I64 CmpOffset2Reg(I64 offset,COptReg *reg_offsets) -{ - I64 i; - for (i=0;iic_class,*tempc1,*tempc2; - - if (tempi1->ic_flags&ICF_R_TO_INT) - tempc1=cmp.internal_types[RT_I64]; - else if (tempi1->ic_flags&ICF_R_TO_F64) - tempc1=cmp.internal_types[RT_F64]; - else { - tempc1=OptClassFwd(tempi1->ic_class); - } - - if (tempi2->ic_flags&ICF_R_TO_INT) - tempc2=cmp.internal_types[RT_I64]; - else if (tempi2->ic_flags&ICF_R_TO_F64) - tempc2=cmp.internal_types[RT_F64]; - else { - tempc2=OptClassFwd(tempi2->ic_class); - } - - if (tempc1->raw_type>tempc2->raw_type) - tempc=tempi->ic_class=tempc1; - else - tempc=tempi->ic_class=tempc2; - - if (tempc->raw_type==RT_F64) { - if (tempi1->ic_code==IC_IMM_I64) { - tempi1->ic_data(F64)=tempi1->ic_data; - tempi1->ic_class=cmp.internal_types[RT_F64]; - tempi1->ic_code=IC_IMM_F64; - tempi1->ic_flags&=~ICF_R_TO_F64; - } else - if (tempc1->raw_type!=RT_F64) - tempi1->ic_flags|=ICF_R_TO_F64; - if (tempi2->ic_code==IC_IMM_I64) { - tempi2->ic_data(F64)=tempi2->ic_data; - tempi2->ic_class=cmp.internal_types[RT_F64]; - tempi2->ic_code=IC_IMM_F64; - tempi2->ic_flags&=~ICF_R_TO_F64; - } else - if (tempc2->raw_type!=RT_F64) - tempi2->ic_flags|=ICF_R_TO_F64; - if (IC_LESS<=tempi->ic_code<=IC_GREATER_EQU && (tempii=OptLead1(tempi)) && - tempii->ic_code!=IC_PUSH_CMP && tempii->ic_code!=IC_AND_AND) { -//We are looking for float comparisons to zero to convert to int. - if (tempi1->ic_code==IC_IMM_F64 && !tempi1->ic_data && - tempi2->ic_code==IC_DEREF && tempc2==cmp.internal_types[RT_F64]) { - tempi1->ic_code==IC_IMM_I64; - goto fb_here1; - } else if (tempi2->ic_code==IC_IMM_F64 && !tempi2->ic_data && - tempi1->ic_code==IC_DEREF && tempc1==cmp.internal_types[RT_F64]) { - tempi2->ic_code==IC_IMM_I64; -fb_here1: - tempi1->ic_flags&=~ICF_R_TO_F64; - tempi->ic_class=tempi1->ic_class=tempi2->ic_class= - cmp.internal_types[RT_I64]; - *is_unsigned=FALSE; - return FBO1_NOT_CONST; - } - goto fb_here2; - } else { -fb_here2: - if (tempi1->ic_code==IC_IMM_F64 && tempi2->ic_code==IC_IMM_F64 && - !(tempi->ic_flags&(ICF_PUSH_CMP|ICF_POP_CMP))) { - tempi->ic_flags|=tempi1->ic_flags|tempi2->ic_flags; - OptSetNOP1(tempi1); - OptSetNOP1(tempi2); - return FBO1_F64; - } else - return FBO1_NOT_CONST; - } - } - *is_unsigned=tempc1->raw_type&RTF_UNSIGNED || tempc2->raw_type&RTF_UNSIGNED; - if (tempi1->ic_code==IC_IMM_I64 && tempi2->ic_code==IC_IMM_I64 && - !(tempi->ic_flags&(ICF_PUSH_CMP|ICF_POP_CMP))) { - tempi->ic_flags|=tempi1->ic_flags|tempi2->ic_flags; - OptSetNOP1(tempi1); - OptSetNOP1(tempi2); - return FBO1_INT; - } else - return FBO1_NOT_CONST; -} - -Bool OptFixupBinaryOp2(CIntermediateCode **tempi1,CIntermediateCode **tempi2) -{ - CIntermediateCode *tempii1=*tempi1, - *tempii2=*tempi2; - if (tempii1->ic_code==IC_IMM_I64 && !(tempii1->ic_flags & ICF_R_TO_F64)) - return TRUE; - if (tempii2->ic_code==IC_IMM_I64 && !(tempii2->ic_flags & ICF_R_TO_F64)) { - *tempi1=tempii2; - *tempi2=tempii1; - return TRUE; - } - return FALSE; -} - -Bool OptFixupUnaryOp(CIntermediateCode *tempi, CIntermediateCode *tempi1, - Bool *is_unsigned) -{ - CHashClass *tempc,*tempc1; - tempc1=OptClassFwd(tempi1->ic_class); - tempi->ic_class=tempc1; - tempc=tempi->ic_class; - if (tempc->raw_type==RT_F64) { - if (tempi1->ic_code==IC_IMM_I64) { - tempi1->ic_data(F64)=tempi1->ic_data; - tempi1->ic_class=cmp.internal_types[RT_F64]; - tempi1->ic_code=IC_IMM_F64; - tempi1->ic_flags&=~ICF_R_TO_F64; - } else - if (tempc1->raw_type!=RT_F64) - tempi1->ic_flags|=ICF_R_TO_F64; - if (tempi1->ic_code==IC_IMM_F64) { - tempi->ic_flags|=tempi1->ic_flags; - OptSetNOP1(tempi1); - return FBO1_F64; - } else - return FBO1_NOT_CONST; - } - *is_unsigned=tempc1->raw_type&RTF_UNSIGNED; - if (tempi1->ic_code==IC_IMM_I64) { - tempi->ic_flags|=tempi1->ic_flags; - OptSetNOP1(tempi1); - return FBO1_INT; - } else - return FBO1_NOT_CONST; -} - -extern U0 OptBrNotZero(CCmpCtrl *cc,CIntermediateCode *tempi); - -CIntermediateCode *OptBrZero(CCmpCtrl *cc,CIntermediateCode *tempi) -{ - CCodeMisc *lb_true,*lb_false; - CIntermediateCode *tempii=OptLag(tempi),*tempii2; - switch (tempii->ic_code) { - case IC_NOT: - tempi->ic_code=IC_BR_NOT_ZERO; - tempi->ic_class=tempii->ic_class; - tempi->ic_flags|=tempii->ic_flags; - tempi->t.a1c=tempii->t.a1c; - tempi->t.a1t=tempii->t.a1t; - OptFree(tempii); - return OptBrNotZero(cc,tempi); - case IC_EQU_EQU...IC_LESS_EQU: - tempi->ic_code=(tempii->ic_code-IC_EQU_EQU)^1+IC_BR_EQU_EQU; - break; - case IC_OR_OR: - tempi->ic_code=IC_BR_OR_OR_ZERO; - break; - case IC_AND_AND: - tempi->ic_code=IC_BR_AND_AND_ZERO; - break; - case IC_AND: - tempi->ic_code=IC_BR_AND_ZERO; - break; - case IC_MM_: - if (cc->pass==2 && !(tempii->ic_flags&ICF_R_TO_F64) && - tempii->ic_class->raw_type!=RT_F64) - tempi->ic_code=IC_BR_MM_ZERO; - break; - case IC_CALL_END: - tempii2=OptLag(tempii); - switch (tempii2->ic_code) { - start: - case IC_CARRY: - tempii2->ic_code=IC_BR_NOT_CARRY; - break; - case IC_BT: - tempii2->ic_code=IC_BR_NOT_BT; - break; - case IC_LBTS: - tempii2->ic_flags|=ICF_LOCK; - case IC_BTS: - tempii2->ic_code=IC_BR_NOT_BTS; - break; - case IC_LBTR: - tempii2->ic_flags|=ICF_LOCK; - case IC_BTR: - tempii2->ic_code=IC_BR_NOT_BTR; - break; - case IC_LBTC: - tempii2->ic_flags|=ICF_LOCK; - case IC_BTC: - tempii2->ic_code=IC_BR_NOT_BTC; - break; - end: - tempii2->ic_data=tempi->ic_data; - tempii->ic_code=IC_CALL_END2; - OptSetNOP1(tempi); - return tempii; - } - break; - } - if (tempi->ic_code!=IC_BR_ZERO) { - tempi->ic_class=tempii->ic_class; - tempi->ic_flags|=tempii->ic_flags; - tempi->t.a1c=tempii->t.a1c; - tempi->t.a2c=tempii->t.a2c; - tempi->t.a1t=tempii->t.a1t; - tempi->t.a2t=tempii->t.a2t; - OptFree(tempii); - - if (tempi->ic_flags&ICF_PUSH_CMP && - IC_BR_NOT_EQU<=tempi->ic_code<=IC_BR_LESS_EQU && - !(tempi->ic_flags&ICF_USE_F64)) { - tempi->ic_code+=IC_BR_EQU_EQU2-IC_BR_EQU_EQU; - tempi->ic_flags&=~ICF_PUSH_CMP; - tempii=tempi->next; //IC_PUSH_CMP inst - while (tempii->ic_code!=IC_PUSH_CMP) - tempii=tempii->next; - tempii->t.a1t=tempi; - OptSetNOP1(tempii); - } - - lb_true=tempi->ic_data; - if (tempi->ic_code==IC_BR_AND_AND_ZERO) { - tempii=tempi->t.a1t->next; - tempii->ic_data=lb_true; - tempii->t.a1t=tempi->t.a1t; - tempii->t.a1c=tempi->t.a1c; - tempii->ic_code=IC_BR_ZERO; - OptBrZero(cc,tempii); - tempii=tempi->t.a2t->next; - tempii->t.a1t=tempi->t.a2t; - tempii->t.a1c=tempi->t.a2c; - tempii->ic_data=lb_true; - tempii->ic_code=IC_BR_ZERO; - tempii=OptBrZero(cc,tempii); - OptSetNOP1(tempi); - } else if (tempi->ic_code==IC_BR_OR_OR_ZERO) { - lb_false=COCMiscNew(cc,CMT_LABEL); - tempi->ic_code=IC_LABEL; - tempi->ic_flags=0; - tempi->ic_data=lb_false; - tempii=tempi->t.a1t->next; - tempii->t.a1t=tempi->t.a1t; - tempii->t.a1c=tempi->t.a1c; - tempii->ic_data=lb_false; - tempii->ic_code=IC_BR_NOT_ZERO; - OptBrNotZero(cc,tempii); - tempii=tempi->t.a2t->next; - tempii->t.a1t=tempi->t.a2t; - tempii->t.a1c=tempi->t.a2c; - tempii->ic_data=lb_true; - tempii->ic_code=IC_BR_ZERO; - tempii=OptBrZero(cc,tempii); - } else - tempii=tempi; - if (tempi->ic_flags&ICF_POP_CMP && tempi->t.a1t->ic_code==IC_NOP1) { - tempi->t.a1t=tempi->t.a1t->t.a1t; - tempi->ic_flags&=~ICF_POP_CMP; - } - return tempii; - } - return tempi; -} - -CIntermediateCode *OptBrNotZero(CCmpCtrl *cc,CIntermediateCode *tempi) -{ - CCodeMisc *lb_true,*lb_false; - CIntermediateCode *tempii=OptLag(tempi),*tempii2; - switch (tempii->ic_code) { - case IC_NOT: - tempi->ic_code=IC_BR_ZERO; - tempi->ic_class=tempii->ic_class; - tempi->ic_flags|=tempii->ic_flags; - tempi->t.a1c=tempii->t.a1c; - tempi->t.a1t=tempii->t.a1t; - OptFree(tempii); - return OptBrZero(cc,tempi); - case IC_EQU_EQU...IC_LESS_EQU: - tempi->ic_code=tempii->ic_code+IC_BR_EQU_EQU-IC_EQU_EQU; - break; - case IC_OR_OR: - tempi->ic_code=IC_BR_OR_OR_NOT_ZERO; - break; - case IC_AND_AND: - tempi->ic_code=IC_BR_AND_AND_NOT_ZERO; - break; - case IC_AND: - tempi->ic_code=IC_BR_AND_NOT_ZERO; - break; - case IC_MM_: - if (cc->pass==2 && !(tempii->ic_flags&ICF_R_TO_F64) && - tempii->ic_class->raw_type!=RT_F64) - tempi->ic_code=IC_BR_MM_NOT_ZERO; - break; - case IC_CALL_END: - tempii2=OptLag(tempii); - switch (tempii2->ic_code) { - start: - case IC_CARRY: - tempii2->ic_code=IC_BR_CARRY; - break; - case IC_BT: - tempii2->ic_code=IC_BR_BT; - break; - case IC_LBTS: - tempii2->ic_flags|=ICF_LOCK; - case IC_BTS: - tempii2->ic_code=IC_BR_BTS; - break; - case IC_LBTR: - tempii2->ic_flags|=ICF_LOCK; - case IC_BTR: - tempii2->ic_code=IC_BR_BTR; - break; - case IC_LBTC: - tempii2->ic_flags|=ICF_LOCK; - case IC_BTC: - tempii2->ic_code=IC_BR_BTC; - break; - end: - tempii2->ic_data=tempi->ic_data; - tempii->ic_code=IC_CALL_END2; - OptSetNOP1(tempi); - return tempii; - } - break; - } - if (tempi->ic_code!=IC_BR_NOT_ZERO) { - tempi->ic_class=tempii->ic_class; - tempi->ic_flags|=tempii->ic_flags; - tempi->t.a1c=tempii->t.a1c; - tempi->t.a2c=tempii->t.a2c; - tempi->t.a1t=tempii->t.a1t; - tempi->t.a2t=tempii->t.a2t; - OptFree(tempii); - - if (tempi->ic_flags&ICF_PUSH_CMP && - IC_BR_NOT_EQU<=tempi->ic_code<=IC_BR_LESS_EQU && - !(tempi->ic_flags&ICF_USE_F64)) { - tempi->ic_code+=IC_BR_EQU_EQU2-IC_BR_EQU_EQU; - tempi->ic_flags&=~ICF_PUSH_CMP; - tempii=tempi->next; //IC_PUSH_CMP inst - while (tempii->ic_code!=IC_PUSH_CMP) - tempii=tempii->next; - tempii->t.a1t=tempi; - OptSetNOP1(tempii); - } - - lb_true=tempi->ic_data; - if (tempi->ic_code==IC_BR_OR_OR_NOT_ZERO) { - tempii=tempi->t.a1t->next; - tempii->t.a1t=tempi->t.a1t; - tempii->t.a1c=tempi->t.a1c; - tempii->ic_data=lb_true; - tempii->ic_code=IC_BR_NOT_ZERO; - OptBrNotZero(cc,tempii); - tempii=tempi->t.a2t->next; - tempii->t.a1t=tempi->t.a2t; - tempii->t.a1c=tempi->t.a2c; - tempii->ic_data=lb_true; - tempii->ic_code=IC_BR_NOT_ZERO; - tempii=OptBrNotZero(cc,tempii); - OptSetNOP1(tempi); - } else if (tempi->ic_code==IC_BR_AND_AND_NOT_ZERO) { - lb_false=COCMiscNew(cc,CMT_LABEL); - tempi->ic_code=IC_LABEL; - tempi->ic_flags=0; - tempi->ic_data=lb_false; - tempii=tempi->t.a1t->next; - tempii->t.a1t=tempi->t.a1t; - tempii->t.a1c=tempi->t.a1c; - tempii->ic_data=lb_false; - tempii->ic_code=IC_BR_ZERO; - OptBrZero(cc,tempii); - tempii=tempi->t.a2t->next; - tempii->t.a1t=tempi->t.a2t; - tempii->t.a1c=tempi->t.a2c; - tempii->ic_data=lb_true; - tempii->ic_code=IC_BR_NOT_ZERO; - tempii=OptBrNotZero(cc,tempii); - } else - tempii=tempi; - if (tempi->ic_flags&ICF_POP_CMP && tempi->t.a1t->ic_code==IC_NOP1) { - tempi->t.a1t=tempi->t.a1t->t.a1t; - tempi->ic_flags&=~ICF_POP_CMP; - } - return tempii; - } - return tempi; -} - -U0 OptFixSizeOf(CIntermediateCode *tempi1, - CIntermediateCode *tempi_push,CHashClass *tempcc) -{ - if (tempi1->ic_code==IC_MUL && tempi1->t.a2t->ic_code==IC_SIZEOF) { - tempi1->t.a2t->ic_code=IC_IMM_I64; - tempi1->t.a2t->ic_class=tempcc; - tempi_push->ic_class=tempcc; - if (tempcc->ptr_stars_cnt) { - tempcc--; - if (tempcc->size==1) - goto here; - tempi1->t.a2t->ic_data=tempcc->size; - } else { -here: - if (tempi_push==tempi1) - tempi1->t.a2t->ic_data=1; - else { - OptSetNOP1(tempi1->t.a2t); - OptSetNOP1(tempi1); - } - } - } -} - -I64 CmpRawType(CHashClass *tempc) -{ - if (tempc) { - tempc=OptClassFwd(tempc); - return tempc->raw_type; - } - return 0; -} - -I64 CmpRawTypePointed(CHashClass *tempc) -{ - if (tempc) { - if (tempc->ptr_stars_cnt) - tempc--; - tempc=OptClassFwd(tempc); - return tempc->raw_type; - } - return 0; -} - -U0 CmpMinTypePointed(CIntermediateCode *tempi,I64 pt1) -{ - I64 pt; - if ((pt=tempi->a1_type_pointed_to) && pt!=RT_F64 && 0a1_type_pointed_to=pt; -} - -U0 CmpF1PushPop(CIntermediateCode *tempi,CIntermediateCode *tempi2) -{ - if (intermediate_code_table[tempi2->ic_code].fpop|| - tempi2->ic_flags&ICF_R_TO_F64) - Bts(&tempi->ic_flags,ICf_DONT_PUSH_FLOAT0); -} - -U0 CmpF2PushPop(CIntermediateCode *tempi, - CIntermediateCode *tempi1,CIntermediateCode *tempi2) -{ - if ((tempi2->ic_code==IC_MOV || tempi2->ic_code==IC_IMM_F64) && - !(tempi2->ic_flags&ICF_R_TO_F64) && - (intermediate_code_table[tempi1->ic_code].fpop || - tempi1->ic_flags&ICF_R_TO_F64)) - Bts(&tempi->ic_flags,ICf_DONT_PUSH_FLOAT0); - else if ((intermediate_code_table[tempi2->ic_code].fpop || - tempi2->ic_flags&ICF_R_TO_F64)&& - !(tempi1->ic_flags&ICF_R_TO_F64)) - Bts(&tempi->ic_flags,ICf_DONT_PUSH_FLOAT0); -} - -class COptMemberVar -{ - I64 score,offset_start,offset_end,lea_balance; - CMemberLst *m; -}; - -I64 OptMVCompare(COptMemberVar *mv1,COptMemberVar *mv2) -{ - return mv2->score-mv1->score; -} diff --git a/Compiler/OptLib.HC b/Compiler/OptLib.HC new file mode 100644 index 0000000..4264dbd --- /dev/null +++ b/Compiler/OptLib.HC @@ -0,0 +1,565 @@ +CCodeMisc *OptLabelFwd(CCodeMisc *lb) +{ + CCodeMisc *lb1; + while (lb1=lb->fwd) + lb=lb1; + return lb; +} + +CHashClass *OptClassFwd(CHashClass *tempc) +{//Class forwarding for unions and subclasses. + CHashClass *tempc1; + while (tempc1=tempc->fwd_class) + tempc=tempc1; + return tempc; +} + +U0 OptSetNOP1(CIntermediateCode *tempi) +{ + tempi->ic_code=IC_NOP1; + tempi->ic_flags=0; + tempi->a1.type=MDF_NULL+tempi->a1.type.raw_type; + tempi->r.type =MDF_NULL+tempi->r.type.raw_type; +} + +U0 OptSetNOP2(CIntermediateCode *tempi,I64 stk_delta=1) +{ + tempi->ic_code=IC_NOP2; + tempi->ic_data=stk_delta; + tempi->a1.type=MDF_NULL+tempi->a1.type.raw_type; + tempi->r.type =MDF_NULL+tempi->r.type.raw_type; +} + +CIntermediateCode *OptFree(CIntermediateCode *tempi) +{//We might access freed entries in CICTreeLinks + QueRem(tempi); + Free(tempi); + return NULL; +} + +CIntermediateCode *OptLag(CIntermediateCode *tempi) +{ + do { + if (!tempi->ic_code) + return NULL; + else + tempi=tempi->last; + } while (tempi->ic_code<=IC_END_EXP); + return tempi; +} + +CIntermediateCode *OptLag1(CIntermediateCode *tempi) +{ + do { + if (!tempi->ic_code) + return NULL; + else + tempi=tempi->last; + } while (tempi->ic_code==IC_NOP1||tempi->ic_code==IC_NOP2); + return tempi; +} + +CIntermediateCode *OptLag2(CIntermediateCode *tempi) +{ + do { + if (!tempi->ic_code) + return NULL; + else + tempi=tempi->last; + } while (tempi->ic_codenext; + if (!tempi->ic_code) + return NULL; + } while (tempi->ic_code==IC_NOP1||tempi->ic_code==IC_NOP2); + return tempi; +} + +I64 CmpOffset2Reg(I64 offset,COptReg *reg_offsets) +{ + I64 i; + for (i=0;iic_class,*tempc1,*tempc2; + + if (tempi1->ic_flags&ICF_R_TO_INT) + tempc1=cmp.internal_types[RT_I64]; + else if (tempi1->ic_flags&ICF_R_TO_F64) + tempc1=cmp.internal_types[RT_F64]; + else { + tempc1=OptClassFwd(tempi1->ic_class); + } + + if (tempi2->ic_flags&ICF_R_TO_INT) + tempc2=cmp.internal_types[RT_I64]; + else if (tempi2->ic_flags&ICF_R_TO_F64) + tempc2=cmp.internal_types[RT_F64]; + else { + tempc2=OptClassFwd(tempi2->ic_class); + } + + if (tempc1->raw_type>tempc2->raw_type) + tempc=tempi->ic_class=tempc1; + else + tempc=tempi->ic_class=tempc2; + + if (tempc->raw_type==RT_F64) { + if (tempi1->ic_code==IC_IMM_I64) { + tempi1->ic_data(F64)=tempi1->ic_data; + tempi1->ic_class=cmp.internal_types[RT_F64]; + tempi1->ic_code=IC_IMM_F64; + tempi1->ic_flags&=~ICF_R_TO_F64; + } else + if (tempc1->raw_type!=RT_F64) + tempi1->ic_flags|=ICF_R_TO_F64; + if (tempi2->ic_code==IC_IMM_I64) { + tempi2->ic_data(F64)=tempi2->ic_data; + tempi2->ic_class=cmp.internal_types[RT_F64]; + tempi2->ic_code=IC_IMM_F64; + tempi2->ic_flags&=~ICF_R_TO_F64; + } else + if (tempc2->raw_type!=RT_F64) + tempi2->ic_flags|=ICF_R_TO_F64; + if (IC_LESS<=tempi->ic_code<=IC_GREATER_EQU && (tempii=OptLead1(tempi)) && + tempii->ic_code!=IC_PUSH_CMP && tempii->ic_code!=IC_AND_AND) { +//We are looking for float comparisons to zero to convert to int. + if (tempi1->ic_code==IC_IMM_F64 && !tempi1->ic_data && + tempi2->ic_code==IC_DEREF && tempc2==cmp.internal_types[RT_F64]) { + tempi1->ic_code==IC_IMM_I64; + goto fb_here1; + } else if (tempi2->ic_code==IC_IMM_F64 && !tempi2->ic_data && + tempi1->ic_code==IC_DEREF && tempc1==cmp.internal_types[RT_F64]) { + tempi2->ic_code==IC_IMM_I64; +fb_here1: + tempi1->ic_flags&=~ICF_R_TO_F64; + tempi->ic_class=tempi1->ic_class=tempi2->ic_class= + cmp.internal_types[RT_I64]; + *is_unsigned=FALSE; + return FBO1_NOT_CONST; + } + goto fb_here2; + } else { +fb_here2: + if (tempi1->ic_code==IC_IMM_F64 && tempi2->ic_code==IC_IMM_F64 && + !(tempi->ic_flags&(ICF_PUSH_CMP|ICF_POP_CMP))) { + tempi->ic_flags|=tempi1->ic_flags|tempi2->ic_flags; + OptSetNOP1(tempi1); + OptSetNOP1(tempi2); + return FBO1_F64; + } else + return FBO1_NOT_CONST; + } + } + *is_unsigned=tempc1->raw_type&RTF_UNSIGNED || tempc2->raw_type&RTF_UNSIGNED; + if (tempi1->ic_code==IC_IMM_I64 && tempi2->ic_code==IC_IMM_I64 && + !(tempi->ic_flags&(ICF_PUSH_CMP|ICF_POP_CMP))) { + tempi->ic_flags|=tempi1->ic_flags|tempi2->ic_flags; + OptSetNOP1(tempi1); + OptSetNOP1(tempi2); + return FBO1_INT; + } else + return FBO1_NOT_CONST; +} + +Bool OptFixupBinaryOp2(CIntermediateCode **tempi1,CIntermediateCode **tempi2) +{ + CIntermediateCode *tempii1=*tempi1, + *tempii2=*tempi2; + if (tempii1->ic_code==IC_IMM_I64 && !(tempii1->ic_flags & ICF_R_TO_F64)) + return TRUE; + if (tempii2->ic_code==IC_IMM_I64 && !(tempii2->ic_flags & ICF_R_TO_F64)) { + *tempi1=tempii2; + *tempi2=tempii1; + return TRUE; + } + return FALSE; +} + +Bool OptFixupUnaryOp(CIntermediateCode *tempi, CIntermediateCode *tempi1, + Bool *is_unsigned) +{ + CHashClass *tempc,*tempc1; + tempc1=OptClassFwd(tempi1->ic_class); + tempi->ic_class=tempc1; + tempc=tempi->ic_class; + if (tempc->raw_type==RT_F64) { + if (tempi1->ic_code==IC_IMM_I64) { + tempi1->ic_data(F64)=tempi1->ic_data; + tempi1->ic_class=cmp.internal_types[RT_F64]; + tempi1->ic_code=IC_IMM_F64; + tempi1->ic_flags&=~ICF_R_TO_F64; + } else + if (tempc1->raw_type!=RT_F64) + tempi1->ic_flags|=ICF_R_TO_F64; + if (tempi1->ic_code==IC_IMM_F64) { + tempi->ic_flags|=tempi1->ic_flags; + OptSetNOP1(tempi1); + return FBO1_F64; + } else + return FBO1_NOT_CONST; + } + *is_unsigned=tempc1->raw_type&RTF_UNSIGNED; + if (tempi1->ic_code==IC_IMM_I64) { + tempi->ic_flags|=tempi1->ic_flags; + OptSetNOP1(tempi1); + return FBO1_INT; + } else + return FBO1_NOT_CONST; +} + +extern CIntermediateCode *OptBrNotZero(CCmpCtrl *cc,CIntermediateCode *tempi); + +CIntermediateCode *OptBrZero(CCmpCtrl *cc,CIntermediateCode *tempi) +{ + CCodeMisc *lb_true,*lb_false; + CIntermediateCode *tempii=OptLag(tempi),*tempii2; + switch (tempii->ic_code) { + case IC_NOT: + tempi->ic_code=IC_BR_NOT_ZERO; + tempi->ic_class=tempii->ic_class; + tempi->ic_flags|=tempii->ic_flags; + tempi->t.a1c=tempii->t.a1c; + tempi->t.a1t=tempii->t.a1t; + OptFree(tempii); + return OptBrNotZero(cc,tempi); + case IC_EQU_EQU...IC_LESS_EQU: + tempi->ic_code=(tempii->ic_code-IC_EQU_EQU)^1+IC_BR_EQU_EQU; + break; + case IC_OR_OR: + tempi->ic_code=IC_BR_OR_OR_ZERO; + break; + case IC_AND_AND: + tempi->ic_code=IC_BR_AND_AND_ZERO; + break; + case IC_AND: + tempi->ic_code=IC_BR_AND_ZERO; + break; + case IC_MM_: + if (cc->pass==2 && !(tempii->ic_flags&ICF_R_TO_F64) && + tempii->ic_class->raw_type!=RT_F64) + tempi->ic_code=IC_BR_MM_ZERO; + break; + case IC_CALL_END: + tempii2=OptLag(tempii); + switch (tempii2->ic_code) { + start: + case IC_CARRY: + tempii2->ic_code=IC_BR_NOT_CARRY; + break; + case IC_BT: + tempii2->ic_code=IC_BR_NOT_BT; + break; + case IC_LBTS: + tempii2->ic_flags|=ICF_LOCK; + case IC_BTS: + tempii2->ic_code=IC_BR_NOT_BTS; + break; + case IC_LBTR: + tempii2->ic_flags|=ICF_LOCK; + case IC_BTR: + tempii2->ic_code=IC_BR_NOT_BTR; + break; + case IC_LBTC: + tempii2->ic_flags|=ICF_LOCK; + case IC_BTC: + tempii2->ic_code=IC_BR_NOT_BTC; + break; + end: + tempii2->ic_data=tempi->ic_data; + tempii->ic_code=IC_CALL_END2; + OptSetNOP1(tempi); + return tempii; + } + break; + } + if (tempi->ic_code!=IC_BR_ZERO) { + tempi->ic_class=tempii->ic_class; + tempi->ic_flags|=tempii->ic_flags; + tempi->t.a1c=tempii->t.a1c; + tempi->t.a2c=tempii->t.a2c; + tempi->t.a1t=tempii->t.a1t; + tempi->t.a2t=tempii->t.a2t; + OptFree(tempii); + + if (tempi->ic_flags&ICF_PUSH_CMP && + IC_BR_NOT_EQU<=tempi->ic_code<=IC_BR_LESS_EQU && + !(tempi->ic_flags&ICF_USE_F64)) { + tempi->ic_code+=IC_BR_EQU_EQU2-IC_BR_EQU_EQU; + tempi->ic_flags&=~ICF_PUSH_CMP; + tempii=tempi->next; //IC_PUSH_CMP inst + while (tempii->ic_code!=IC_PUSH_CMP) + tempii=tempii->next; + tempii->t.a1t=tempi; + OptSetNOP1(tempii); + } + + lb_true=tempi->ic_data; + if (tempi->ic_code==IC_BR_AND_AND_ZERO) { + tempii=tempi->t.a1t->next; + tempii->ic_data=lb_true; + tempii->t.a1t=tempi->t.a1t; + tempii->t.a1c=tempi->t.a1c; + tempii->ic_code=IC_BR_ZERO; + OptBrZero(cc,tempii); + tempii=tempi->t.a2t->next; + tempii->t.a1t=tempi->t.a2t; + tempii->t.a1c=tempi->t.a2c; + tempii->ic_data=lb_true; + tempii->ic_code=IC_BR_ZERO; + tempii=OptBrZero(cc,tempii); + OptSetNOP1(tempi); + } else if (tempi->ic_code==IC_BR_OR_OR_ZERO) { + lb_false=COCMiscNew(cc,CMT_LABEL); + tempi->ic_code=IC_LABEL; + tempi->ic_flags=0; + tempi->ic_data=lb_false; + tempii=tempi->t.a1t->next; + tempii->t.a1t=tempi->t.a1t; + tempii->t.a1c=tempi->t.a1c; + tempii->ic_data=lb_false; + tempii->ic_code=IC_BR_NOT_ZERO; + OptBrNotZero(cc,tempii); + tempii=tempi->t.a2t->next; + tempii->t.a1t=tempi->t.a2t; + tempii->t.a1c=tempi->t.a2c; + tempii->ic_data=lb_true; + tempii->ic_code=IC_BR_ZERO; + tempii=OptBrZero(cc,tempii); + } else + tempii=tempi; + if (tempi->ic_flags&ICF_POP_CMP && tempi->t.a1t->ic_code==IC_NOP1) { + tempi->t.a1t=tempi->t.a1t->t.a1t; + tempi->ic_flags&=~ICF_POP_CMP; + } + return tempii; + } + return tempi; +} + +CIntermediateCode *OptBrNotZero(CCmpCtrl *cc,CIntermediateCode *tempi) +{ + CCodeMisc *lb_true,*lb_false; + CIntermediateCode *tempii=OptLag(tempi),*tempii2; + switch (tempii->ic_code) { + case IC_NOT: + tempi->ic_code=IC_BR_ZERO; + tempi->ic_class=tempii->ic_class; + tempi->ic_flags|=tempii->ic_flags; + tempi->t.a1c=tempii->t.a1c; + tempi->t.a1t=tempii->t.a1t; + OptFree(tempii); + return OptBrZero(cc,tempi); + case IC_EQU_EQU...IC_LESS_EQU: + tempi->ic_code=tempii->ic_code+IC_BR_EQU_EQU-IC_EQU_EQU; + break; + case IC_OR_OR: + tempi->ic_code=IC_BR_OR_OR_NOT_ZERO; + break; + case IC_AND_AND: + tempi->ic_code=IC_BR_AND_AND_NOT_ZERO; + break; + case IC_AND: + tempi->ic_code=IC_BR_AND_NOT_ZERO; + break; + case IC_MM_: + if (cc->pass==2 && !(tempii->ic_flags&ICF_R_TO_F64) && + tempii->ic_class->raw_type!=RT_F64) + tempi->ic_code=IC_BR_MM_NOT_ZERO; + break; + case IC_CALL_END: + tempii2=OptLag(tempii); + switch (tempii2->ic_code) { + start: + case IC_CARRY: + tempii2->ic_code=IC_BR_CARRY; + break; + case IC_BT: + tempii2->ic_code=IC_BR_BT; + break; + case IC_LBTS: + tempii2->ic_flags|=ICF_LOCK; + case IC_BTS: + tempii2->ic_code=IC_BR_BTS; + break; + case IC_LBTR: + tempii2->ic_flags|=ICF_LOCK; + case IC_BTR: + tempii2->ic_code=IC_BR_BTR; + break; + case IC_LBTC: + tempii2->ic_flags|=ICF_LOCK; + case IC_BTC: + tempii2->ic_code=IC_BR_BTC; + break; + end: + tempii2->ic_data=tempi->ic_data; + tempii->ic_code=IC_CALL_END2; + OptSetNOP1(tempi); + return tempii; + } + break; + } + if (tempi->ic_code!=IC_BR_NOT_ZERO) { + tempi->ic_class=tempii->ic_class; + tempi->ic_flags|=tempii->ic_flags; + tempi->t.a1c=tempii->t.a1c; + tempi->t.a2c=tempii->t.a2c; + tempi->t.a1t=tempii->t.a1t; + tempi->t.a2t=tempii->t.a2t; + OptFree(tempii); + + if (tempi->ic_flags&ICF_PUSH_CMP && + IC_BR_NOT_EQU<=tempi->ic_code<=IC_BR_LESS_EQU && + !(tempi->ic_flags&ICF_USE_F64)) { + tempi->ic_code+=IC_BR_EQU_EQU2-IC_BR_EQU_EQU; + tempi->ic_flags&=~ICF_PUSH_CMP; + tempii=tempi->next; //IC_PUSH_CMP inst + while (tempii->ic_code!=IC_PUSH_CMP) + tempii=tempii->next; + tempii->t.a1t=tempi; + OptSetNOP1(tempii); + } + + lb_true=tempi->ic_data; + if (tempi->ic_code==IC_BR_OR_OR_NOT_ZERO) { + tempii=tempi->t.a1t->next; + tempii->t.a1t=tempi->t.a1t; + tempii->t.a1c=tempi->t.a1c; + tempii->ic_data=lb_true; + tempii->ic_code=IC_BR_NOT_ZERO; + OptBrNotZero(cc,tempii); + tempii=tempi->t.a2t->next; + tempii->t.a1t=tempi->t.a2t; + tempii->t.a1c=tempi->t.a2c; + tempii->ic_data=lb_true; + tempii->ic_code=IC_BR_NOT_ZERO; + tempii=OptBrNotZero(cc,tempii); + OptSetNOP1(tempi); + } else if (tempi->ic_code==IC_BR_AND_AND_NOT_ZERO) { + lb_false=COCMiscNew(cc,CMT_LABEL); + tempi->ic_code=IC_LABEL; + tempi->ic_flags=0; + tempi->ic_data=lb_false; + tempii=tempi->t.a1t->next; + tempii->t.a1t=tempi->t.a1t; + tempii->t.a1c=tempi->t.a1c; + tempii->ic_data=lb_false; + tempii->ic_code=IC_BR_ZERO; + OptBrZero(cc,tempii); + tempii=tempi->t.a2t->next; + tempii->t.a1t=tempi->t.a2t; + tempii->t.a1c=tempi->t.a2c; + tempii->ic_data=lb_true; + tempii->ic_code=IC_BR_NOT_ZERO; + tempii=OptBrNotZero(cc,tempii); + } else + tempii=tempi; + if (tempi->ic_flags&ICF_POP_CMP && tempi->t.a1t->ic_code==IC_NOP1) { + tempi->t.a1t=tempi->t.a1t->t.a1t; + tempi->ic_flags&=~ICF_POP_CMP; + } + return tempii; + } + return tempi; +} + +U0 OptFixSizeOf(CIntermediateCode *tempi1, + CIntermediateCode *tempi_push,CHashClass *tempcc) +{ + if (tempi1->ic_code==IC_MUL && tempi1->t.a2t->ic_code==IC_SIZEOF) { + tempi1->t.a2t->ic_code=IC_IMM_I64; + tempi1->t.a2t->ic_class=tempcc; + tempi_push->ic_class=tempcc; + if (tempcc->ptr_stars_cnt) { + tempcc--; + if (tempcc->size==1) + goto here; + tempi1->t.a2t->ic_data=tempcc->size; + } else { +here: + if (tempi_push==tempi1) + tempi1->t.a2t->ic_data=1; + else { + OptSetNOP1(tempi1->t.a2t); + OptSetNOP1(tempi1); + } + } + } +} + +I64 CmpRawType(CHashClass *tempc) +{ + if (tempc) { + tempc=OptClassFwd(tempc); + return tempc->raw_type; + } + return 0; +} + +I64 CmpRawTypePointed(CHashClass *tempc) +{ + if (tempc) { + if (tempc->ptr_stars_cnt) + tempc--; + tempc=OptClassFwd(tempc); + return tempc->raw_type; + } + return 0; +} + +U0 CmpMinTypePointed(CIntermediateCode *tempi,I64 pt1) +{ + I64 pt; + if ((pt=tempi->a1_type_pointed_to) && pt!=RT_F64 && 0a1_type_pointed_to=pt; +} + +U0 CmpF1PushPop(CIntermediateCode *tempi,CIntermediateCode *tempi2) +{ + if (intermediate_code_table[tempi2->ic_code].fpop|| + tempi2->ic_flags&ICF_R_TO_F64) + Bts(&tempi->ic_flags,ICf_DONT_PUSH_FLOAT0); +} + +U0 CmpF2PushPop(CIntermediateCode *tempi, + CIntermediateCode *tempi1,CIntermediateCode *tempi2) +{ + if ((tempi2->ic_code==IC_MOV || tempi2->ic_code==IC_IMM_F64) && + !(tempi2->ic_flags&ICF_R_TO_F64) && + (intermediate_code_table[tempi1->ic_code].fpop || + tempi1->ic_flags&ICF_R_TO_F64)) + Bts(&tempi->ic_flags,ICf_DONT_PUSH_FLOAT0); + else if ((intermediate_code_table[tempi2->ic_code].fpop || + tempi2->ic_flags&ICF_R_TO_F64)&& + !(tempi1->ic_flags&ICF_R_TO_F64)) + Bts(&tempi->ic_flags,ICf_DONT_PUSH_FLOAT0); +} + +class COptMemberVar +{ + I64 score,offset_start,offset_end,lea_balance; + CMemberLst *m; +}; + +I64 OptMVCompare(COptMemberVar *mv1,COptMemberVar *mv2) +{ + return mv2->score-mv1->score; +} diff --git a/Compiler/OptPass012.CPP b/Compiler/OptPass012.CPP deleted file mode 100644 index 04c6533..0000000 --- a/Compiler/OptPass012.CPP +++ /dev/null @@ -1,1288 +0,0 @@ -/*OptPass012 - -Pass#0 -When parsing the arg expressions to a function -call, there is a call to OptPass012 to determine -the type of the expression. $LK,"OptPass012",A="FF:::/Compiler/PrsExp.CPP,OptPass012"$ - -Pass#1&2 -Constant expressions are simplified. -Eliminated opcodes are set to NOP. -Types are determined by reconstructing an -expression tree for operators -$LK,"CIntermediateCode",A="MN:CIntermediateCode"$.$LK,"CICTreeLinks",A="MN:CICTreeLinks"$. - -Pointer arithmetic size is set, once -the type is determined. - -Branches are expressed with short-circuit -logic. 3-Arg comparisons are established. - -*/ - -CIntermediateCode *OptPass012(CCmpCtrl *cc) -{/*Simplify CONST arithmetic. -Sets the class throughout Expression trees. -Returns the type of an Expression for use -in int<-->F64 conversions of fun -args. -*/ - I64 code,i; - Bool is_unsigned; - CHashClass *tempc,*tempc1,*tempc2; - CIntermediateCode *tempi,*tempi1,*tempi2,*tempi3,*tempi_push, - *last_with_class=NULL; - CCodeMisc *lb,*lb1,*lb2; - CPrsStk *ps; - if (!(ps=cc->ps)) - ps=cc->ps=MAlloc(sizeof(CPrsStk)); - ps->ptr=0; - ps->ptr2=0; - tempi=cc->coc.coc_head.next; - while (code=tempi->ic_code) { - tempc=tempi->ic_class; - tempi->ic_class2=tempc; - tempi_push=tempi; - MemSet(&tempi->a1,0,3*sizeof(CICArg)); - tempi->a1_type_pointed_to=0; - switch [intermediate_code_table[code].arg_cnt] { - case IS_V_ARG: - ps->ptr-=tempi->ic_data>>2; - break; - case IS_2_ARG: - tempi2=PrsPop(ps); - tempc2=tempi2->ic_class; - tempi->t.a2t=tempi2; - tempi->t.a2c=PrsPop(ps); - case IS_1_ARG: - tempi1=PrsPop(ps); - tempc1=tempi1->ic_class; - tempi->t.a1t=tempi1; - tempi->t.a1c=PrsPop(ps); - break; - case IS_0_ARG: //nobound switch - break; - } - if (intermediate_code_table[code].not_const) - cc->flags|=CCF_NOT_CONST; - switch [code] { - case IC_IMM_F64: - tempi->ic_flags&=~ICF_R_TO_F64; - if (cc->pass==2 && tempi->ic_flags&ICF_R_TO_INT) { - tempi->ic_data=ToI64(tempi->ic_data(F64)); - tempi->ic_flags&=~ICF_R_TO_INT; - tempi->ic_code=IC_IMM_I64; - tempi->ic_class=cmp.internal_types[RT_I64]; - } - break; - case IC_IMM_I64: - tempi->ic_flags&=~ICF_R_TO_INT; - if (cc->pass==2 && tempi->ic_flags&ICF_R_TO_F64) { - tempi->ic_data(F64)=ToF64(tempi->ic_data); - tempi->ic_flags&=~ICF_R_TO_F64; - tempi->ic_code=IC_IMM_F64; - tempi->ic_class=cmp.internal_types[RT_F64]; - } - break; - case IC_HOLYC_TYPECAST: - if (tempi1->ic_code==IC_IMM_I64 || tempi1->ic_code==IC_IMM_F64) { - if (tempi->ic_class->raw_type==RT_F64) - tempi1->ic_code=IC_IMM_F64; - else - tempi1->ic_code=IC_IMM_I64; - tempi1->ic_class=tempi->ic_class; - tempi1->ic_flags|=tempi->ic_flags; - tempi_push=tempi1; - OptSetNOP1(tempi); - } else { - if (tempi->ic_data) {//was paren - if (!tempi_push->ic_class->ptr_stars_cnt) { - if (tempi_push->ic_class->raw_type==RT_F64) - tempi_push->ic_class2=cmp.internal_types[RT_F64]; - else - tempi_push->ic_class2=cmp.internal_types[RT_I64]; - } - } else { - tempi1->ic_class=tempi->ic_class; - tempi1->ic_flags|=tempi->ic_flags; - tempi_push=tempi1; - OptSetNOP1(tempi); - } - } - break; - case IC_FS: - case IC_GS: -//CALL,FS/GS,CALL_END,IMM,ADD,DEREF-->MOV_FS/GS - tempi1=tempi->next->next; //IMM - tempi2=tempi1->next; //ADD - tempi3=tempi2->next; //DEREF - if (tempi1->ic_code==IC_IMM_I64 && tempi2->ic_code==IC_ADD && - tempi3->ic_code==IC_DEREF && - !(tempi3->ic_flags&~ICG_NO_CVT_MASK)) { - tempi->ic_flags|=tempi1->ic_flags|tempi2->ic_flags|tempi3->ic_flags; - if (tempi->ic_code==IC_FS) - tempi->ic_code=IC_MOV_FS; - else - tempi->ic_code=IC_MOV_GS; - tempi->ic_data=tempi1->ic_data; - tempi->ic_class =tempi3->ic_class; - tempi->ic_class2=tempi3->ic_class2; - OptSetNOP1(tempi1); - OptSetNOP1(tempi2); - OptSetNOP1(tempi3); - - tempi1=tempi->last; //CALL - tempi2=tempi->next; //CALL_END - tempi->ic_flags|=tempi1->ic_flags|tempi2->ic_flags; - OptSetNOP1(tempi1); - OptSetNOP1(tempi2); - } - break; - case IC_PUSH_CMP: - if (tempi1=OptLag(tempi)) { - if (tempi1->ic_code==IC_AND_AND) - tempi1=OptLag(tempi1); - if (tempi1) - tempi->ic_class=tempi1->ic_class; - } - tempi->ic_class2=tempi->ic_class; - tempi->ic_data=0; - if (tempi->ic_class->raw_type==RT_F64) - tempi->ic_flags|=ICF_USE_F64; - break; - case IC_COM: - if (tempi1->ic_code==IC_IMM_I64) { - tempi->ic_data=~tempi1->ic_data; - tempi->ic_code=IC_IMM_I64; - tempi->ic_flags|=tempi1->ic_flags; - OptSetNOP1(tempi1); - } - tempi_push->ic_class2=cmp.internal_types[RT_I64]; - break; - start: - case IC_NOT: - if (tempc->raw_type==RT_F64) { - if (tempi1->ic_code==IC_IMM_F64) { - tempi->ic_data(F64)=!tempi1->ic_data(F64); - tempi->ic_code=IC_IMM_F64; - tempi->ic_flags|=tempi1->ic_flags; - OptSetNOP1(tempi1); - } - break; - } - if (tempi1->ic_code==IC_IMM_I64) { - tempi->ic_data=!tempi1->ic_data; - tempi->ic_code=IC_IMM_I64; - tempi->ic_flags|=tempi1->ic_flags; - OptSetNOP1(tempi1); - } - break; - case IC_UNARY_MINUS: - if (i=OptFixupUnaryOp(tempi,tempi1,&is_unsigned)) { - if (i==FBO1_INT) { - tempi->ic_data=-tempi1->ic_data(I64); - tempi->ic_code=IC_IMM_I64; - } else { - tempi->ic_data(F64)=-tempi1->ic_data(F64); - tempi->ic_code=IC_IMM_F64; - } - } - if (tempc1->type&HTT_INTERNAL_TYPE && tempc1->raw_type&RTF_UNSIGNED) - tempi->ic_class=cmp.internal_types[tempc1->raw_type-1]; - break; - case IC_SHL_CONST: - if (i=OptFixupUnaryOp(tempi,tempi1,&is_unsigned)) { - if (i==FBO1_INT) { - if (is_unsigned) - tempi->ic_data=tempi1->ic_data(U64)<ic_data(U64); - else - tempi->ic_data=tempi1->ic_data(I64)<ic_data(I64); - tempi->ic_code=IC_IMM_I64; - } else { - tempi->ic_data(F64)=tempi1->ic_data(F64)<ic_data; - tempi->ic_code=IC_IMM_F64; - } - } else if (tempi1->ic_code==IC_SHL_CONST) { - tempi->ic_flags|=tempi1->ic_flags; - tempi->ic_data+=tempi1->ic_data; - OptSetNOP1(tempi1); - } - break; - case IC_SHR_CONST: - if (i=OptFixupUnaryOp(tempi,tempi1,&is_unsigned)) { - if (i==FBO1_INT) { - if (is_unsigned) - tempi->ic_data=tempi1->ic_data(U64)>>tempi->ic_data(U64); - else - tempi->ic_data=tempi1->ic_data(I64)>>tempi->ic_data(I64); - tempi->ic_code=IC_IMM_I64; - } else { - tempi->ic_data(F64)=tempi1->ic_data(F64)>>tempi->ic_data; - tempi->ic_code=IC_IMM_F64; - } - } else if (tempi1->ic_code==IC_SHR_CONST) { - tempi->ic_flags|=tempi1->ic_flags; - tempi->ic_data+=tempi1->ic_data; - OptSetNOP1(tempi1); - } - break; - case IC_SHL: - if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { - if (i==FBO1_INT) { - if (is_unsigned) - tempi->ic_data=tempi1->ic_data(U64)<ic_data(U64); - else - tempi->ic_data=tempi1->ic_data(I64)<ic_data(I64); - tempi->ic_code=IC_IMM_I64; - } else { - tempi->ic_data(F64)=tempi1->ic_data(F64) << tempi2->ic_data(F64); - tempi->ic_code=IC_IMM_F64; - } - } else if (tempi2->ic_code==IC_IMM_I64) { - tempi->ic_flags|=tempi2->ic_flags; - tempi->ic_data=tempi2->ic_data; - tempi->ic_code=IC_SHL_CONST; - OptSetNOP1(tempi2); - } - break; - case IC_SHR: - if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { - if (i==FBO1_INT) { - if (is_unsigned) - tempi->ic_data=tempi1->ic_data(U64)>>tempi2->ic_data(U64); - else - tempi->ic_data=tempi1->ic_data(I64)>>tempi2->ic_data(I64); - tempi->ic_code=IC_IMM_I64; - } else { - tempi->ic_data(F64)=tempi1->ic_data(F64) >> tempi2->ic_data(F64); - tempi->ic_code=IC_IMM_F64; - } - } else if (tempi2->ic_code==IC_IMM_I64) { - tempi->ic_flags|=tempi2->ic_flags; - tempi->ic_data=tempi2->ic_data; - tempi->ic_code=IC_SHR_CONST; - OptSetNOP1(tempi2); - } - break; - end: - if (!tempi_push->ic_class->ptr_stars_cnt) { - if (tempi_push->ic_class->raw_type==RT_F64) - tempi_push->ic_class2=cmp.internal_types[RT_F64]; - else - tempi_push->ic_class2=cmp.internal_types[RT_I64]; - } - break; - case IC_DEREF: - if (cc->pass==2) { - if (!tempc->size) - LexWarn(cc,"Dereference U0 "); - if (tempi1->ic_class->raw_type!=RT_F64) { - if (tempi1->ic_code==IC__PP) { - tempi->ic_code=IC_DEREF_PP; - tempi->ic_flags|=tempi1->ic_flags; - OptSetNOP1(tempi1); - } else if (tempi1->ic_code==IC__MM) { - tempi->ic_code=IC_DEREF_MM; - tempi->ic_flags|=tempi1->ic_flags; - OptSetNOP1(tempi1); - } - } - } - break; - case IC__PP: - case IC__MM: - case IC_PP_: - case IC_MM_: - if (cc->pass==2 && !tempc->size) - LexWarn(cc,"Dereference U0 "); - break; - case IC_POWER: - tempc=tempi->ic_class=cmp.internal_types[RT_F64]; - if (tempc1->raw_type!=RT_F64) - tempi1->ic_flags|=ICF_R_TO_F64; - if (tempc2->raw_type!=RT_F64) - tempi2->ic_flags|=ICF_R_TO_F64; - tempi_push->ic_class2=cmp.internal_types[RT_F64]; - break; - start: - case IC_MUL: - if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { - if (i==FBO1_INT) { - if (is_unsigned) - tempi->ic_data=tempi1->ic_data(U64)*tempi2->ic_data(U64); - else - tempi->ic_data=tempi1->ic_data(I64)*tempi2->ic_data(I64); - tempi->ic_code=IC_IMM_I64; - } else { - tempi->ic_data(F64)=tempi1->ic_data(F64)*tempi2->ic_data(F64); - tempi->ic_code=IC_IMM_F64; - } - } else { - if (tempi1->ic_code==IC_IMM_I64 && cc->pass==2) { - switch (i=tempi1->ic_data) { - case 0: - break; - case 1: - tempi2->ic_flags|=tempi->ic_flags|tempi1->ic_flags; - tempi2->ic_class2=tempi->ic_class2; - tempi_push=tempi2; - OptSetNOP1(tempi1); - OptSetNOP1(tempi); - break; - default: - if (Bsf(i)==Bsr(i)) { - tempi->ic_flags|=tempi1->ic_flags; - tempi->t.a1c=tempi->t.a2c; - tempi->ic_data=Bsf(i); - tempi->ic_code=IC_SHL_CONST; - OptSetNOP1(tempi1); - } - } - } else if (tempi2->ic_code==IC_IMM_I64) { - switch (i=tempi2->ic_data) { - case 0: - break; - case 1: - tempi1->ic_flags|=tempi->ic_flags|tempi2->ic_flags; - tempi1->ic_class2=tempi->ic_class2; - tempi_push=tempi1; - OptSetNOP1(tempi2); - OptSetNOP1(tempi); - break; - default: - if (Bsf(i)==Bsr(i)) { - tempi->ic_flags|=tempi2->ic_flags; - tempi->ic_data=Bsf(i); - tempi->ic_code=IC_SHL_CONST; - OptSetNOP1(tempi2); - } else if (tempi1->ic_code==IC_MUL && cc->pass==2) { - if (tempi1->t.a1t->ic_code==IC_IMM_I64) { - tempi1->ic_flags|=tempi->ic_flags; - tempi1->t.a1t->ic_data*=tempi2->ic_data; - tempi1->ic_class2=tempi->ic_class2; - tempi_push=tempi1; - OptSetNOP1(tempi2); - OptSetNOP1(tempi); - } else if (tempi1->t.a2t->ic_code==IC_IMM_I64) { - tempi1->ic_flags|=tempi->ic_flags; - tempi1->t.a2t->ic_data*=tempi2->ic_data; - tempi1->ic_class2=tempi->ic_class2; - tempi_push=tempi1; - OptSetNOP1(tempi2); - OptSetNOP1(tempi); - } - } - } - } else if (tempi2->ic_code==IC_IMM_F64 && cc->pass==2) { - if (tempi2->ic_data(F64)==1.0) { - tempi1->ic_flags|=tempi->ic_flags|tempi2->ic_flags; - tempi1->ic_class2=tempi->ic_class2; - tempi_push=tempi1; - OptSetNOP1(tempi2); - OptSetNOP1(tempi); - } else if (tempi1->ic_code==IC_MUL) { - if (tempi1->t.a1t->ic_code==IC_IMM_F64) { - tempi1->ic_flags|=tempi->ic_flags|tempi2->ic_flags; - tempi1->t.a1t->ic_data(F64)*=tempi2->ic_data(F64); - tempi1->ic_class2=tempi->ic_class2; - tempi_push=tempi1; - OptSetNOP1(tempi2); - OptSetNOP1(tempi); - } else if (tempi1->t.a2t->ic_code==IC_IMM_F64) { - tempi1->ic_flags|=tempi->ic_flags|tempi2->ic_flags; - tempi1->t.a2t->ic_data(F64)*=tempi2->ic_data(F64); - tempi1->ic_class2=tempi->ic_class2; - tempi_push=tempi1; - OptSetNOP1(tempi2); - OptSetNOP1(tempi); - } - } - } - } - break; - case IC_DIV: - if ((tempi2->ic_data || tempi2->ic_code!=IC_IMM_I64 && - tempi2->ic_code!=IC_IMM_F64) && - (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned))) { - if (i==FBO1_INT) { - if (is_unsigned) - tempi->ic_data=tempi1->ic_data(U64)/tempi2->ic_data(U64); - else - tempi->ic_data=tempi1->ic_data(I64)/tempi2->ic_data(I64); - tempi->ic_code=IC_IMM_I64; - } else { - tempi->ic_data(F64)=tempi1->ic_data(F64)/ - tempi2->ic_data(F64); - tempi->ic_code=IC_IMM_F64; - } - } else { - if (tempi2->ic_code==IC_IMM_I64 && (i=tempi2->ic_data)) { - if (i==1) { - tempi1->ic_flags|=tempi2->ic_flags|tempi->ic_flags; - tempi1->ic_class2=tempi->ic_class2; - tempi_push=tempi1; - OptSetNOP1(tempi2); - OptSetNOP1(tempi); - } else if (Bsf(i)==Bsr(i)) { - tempi->ic_flags|=tempi2->ic_flags; - tempi->ic_data=Bsf(i); - tempi->ic_code=IC_SHR_CONST; - OptSetNOP1(tempi2); - } - } - } - break; - case IC_MOD: - if ((tempi2->ic_data || tempi2->ic_code!=IC_IMM_I64 && - tempi2->ic_code!=IC_IMM_F64) && - (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned))) { - if (i==FBO1_INT) { - if (is_unsigned) - tempi->ic_data=tempi1->ic_data(U64)%tempi2->ic_data(U64); - else - tempi->ic_data=tempi1->ic_data(I64)%tempi2->ic_data(I64); - tempi->ic_code=IC_IMM_I64; - } else { - tempi->ic_data(F64)=tempi1->ic_data(F64)% - tempi2->ic_data(F64); - tempi->ic_code=IC_IMM_F64; - } - } else if (cc->pass==2 && tempi2->ic_code==IC_IMM_I64 && - (i=tempi2->ic_data) && Bsf(i)==Bsr(i) && - tempi_push->ic_class->raw_type!=RT_F64 && - tempi_push->ic_class->raw_type&RTF_UNSIGNED) {//do only unsigned - tempi2->ic_data=i-1; - tempi->ic_code=IC_AND; - } - break; - case IC_AND: - if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { - tempi->ic_data=tempi1->ic_data&tempi2->ic_data; - if (i==FBO1_INT) - tempi->ic_code=IC_IMM_I64; - else - tempi->ic_code=IC_IMM_F64; - } - break; - case IC_OR: - if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { - tempi->ic_data=tempi1->ic_data|tempi2->ic_data; - if (i==FBO1_INT) - tempi->ic_code=IC_IMM_I64; - else - tempi->ic_code=IC_IMM_F64; - } - break; - case IC_XOR: - if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { - tempi->ic_data=tempi1->ic_data^tempi2->ic_data; - if (i==FBO1_INT) - tempi->ic_code=IC_IMM_I64; - else - tempi->ic_code=IC_IMM_F64; - } - break; - case IC_ADD: - if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { - if (i==FBO1_INT) { - tempi->ic_data=tempi1->ic_data+tempi2->ic_data; - tempi->ic_code=IC_IMM_I64; - } else { - tempi->ic_data(F64)=tempi1->ic_data(F64)+ - tempi2->ic_data(F64); - tempi->ic_code=IC_IMM_F64; - } - } else { - if (tempi1->ic_code==IC_ABS_ADDR&&tempi2->ic_code==IC_IMM_I64) { - tempi->ic_flags|=tempi1->ic_flags|tempi2->ic_flags; - tempi->ic_data=tempi1->ic_data+tempi2->ic_data; - tempi->ic_code=IC_ABS_ADDR; - OptSetNOP1(tempi1); - OptSetNOP1(tempi2); - } else if (cc->pass==2) { - if (tempi1->ic_code==IC_IMM_I64) { - if (!tempi1->ic_data) { - tempi2->ic_flags|=tempi1->ic_flags|tempi->ic_flags; - tempi2->ic_class2=tempi->ic_class2; - tempi_push=tempi2; - OptSetNOP1(tempi1); - OptSetNOP1(tempi); - } else if (tempi2->ic_code==IC_ADD|| - tempi2->ic_code==IC_SUB) { - if (tempi2->t.a1t->ic_code==IC_IMM_I64) { - tempi2->ic_flags|=tempi->ic_flags; - tempi2->t.a1t->ic_data+=tempi1->ic_data; - tempi2->ic_class2=tempi->ic_class2; - tempi_push=tempi2; - OptSetNOP1(tempi1); - OptSetNOP1(tempi); - } else if (tempi2->t.a2t->ic_code==IC_IMM_I64) { - tempi2->ic_flags|=tempi->ic_flags; - if (tempi2->ic_code==IC_ADD) - tempi2->t.a2t->ic_data+=tempi1->ic_data; - else - tempi2->t.a2t->ic_data-=tempi1->ic_data; - tempi2->ic_class2=tempi->ic_class2; - tempi_push=tempi2; - OptSetNOP1(tempi1); - OptSetNOP1(tempi); - } - } - } else if (tempi2->ic_code==IC_IMM_I64) { - if (!tempi2->ic_data) { - tempi1->ic_flags|=tempi2->ic_flags|tempi->ic_flags; - tempi1->ic_class2=tempi->ic_class2; - tempi_push=tempi1; - OptSetNOP1(tempi2); - OptSetNOP1(tempi); - } else if (tempi1->ic_code==IC_ADD || - tempi1->ic_code==IC_SUB) { - if (tempi1->t.a1t->ic_code==IC_IMM_I64) { - tempi1->ic_flags|=tempi->ic_flags; - tempi1->t.a1t->ic_data+=tempi2->ic_data; - tempi1->ic_class2=tempi->ic_class2; - tempi_push=tempi1; - OptSetNOP1(tempi2); - OptSetNOP1(tempi); - } else if (tempi1->t.a2t->ic_code==IC_IMM_I64) { - tempi1->ic_flags|=tempi->ic_flags; - if (tempi1->ic_code==IC_ADD) - tempi1->t.a2t->ic_data+=tempi2->ic_data; - else - tempi1->t.a2t->ic_data-=tempi2->ic_data; - tempi1->ic_class2=tempi->ic_class2; - tempi_push=tempi1; - OptSetNOP1(tempi2); - OptSetNOP1(tempi); - } - } - } else if (tempi1->ic_code==IC_IMM_F64) { - if (!tempi1->ic_data) { - tempi2->ic_flags|=tempi1->ic_flags|tempi->ic_flags; - tempi2->ic_class2=tempi->ic_class2; - tempi_push=tempi2; - OptSetNOP1(tempi1); - OptSetNOP1(tempi); - } else if (tempi2->ic_code==IC_ADD|| - tempi2->ic_code==IC_SUB) { - if (tempi2->t.a1t->ic_code==IC_IMM_F64) { - tempi2->ic_flags|=tempi->ic_flags; - tempi2->t.a1t->ic_data(F64)+=tempi1->ic_data(F64); - tempi2->ic_class2=tempi->ic_class2; - tempi_push=tempi2; - OptSetNOP1(tempi1); - OptSetNOP1(tempi); - } else if (tempi2->t.a2t->ic_code==IC_IMM_F64) { - tempi2->ic_flags|=tempi->ic_flags; - if (tempi2->ic_code==IC_ADD) - tempi2->t.a2t->ic_data(F64)+=tempi1->ic_data(F64); - else - tempi2->t.a2t->ic_data(F64)-=tempi1->ic_data(F64); - tempi2->ic_class2=tempi->ic_class2; - tempi_push=tempi2; - OptSetNOP1(tempi1); - OptSetNOP1(tempi); - } - } - } else if (tempi2->ic_code==IC_IMM_F64) { - if (!tempi2->ic_data) { - tempi1->ic_flags|=tempi2->ic_flags|tempi->ic_flags; - tempi1->ic_class2=tempi->ic_class2; - tempi_push=tempi1; - OptSetNOP1(tempi2); - OptSetNOP1(tempi); - } else if (tempi1->ic_code==IC_ADD || - tempi1->ic_code==IC_SUB) { - if (tempi1->t.a1t->ic_code==IC_IMM_F64) { - tempi1->ic_flags|=tempi->ic_flags; - tempi1->t.a1t->ic_data(F64)+=tempi2->ic_data(F64); - tempi1->ic_class2=tempi->ic_class2; - tempi_push=tempi1; - OptSetNOP1(tempi2); - OptSetNOP1(tempi); - } else if (tempi1->t.a2t->ic_code==IC_IMM_F64) { - tempi1->ic_flags|=tempi->ic_flags; - if (tempi1->ic_code==IC_ADD) - tempi1->t.a2t->ic_data(F64)+=tempi2->ic_data(F64); - else - tempi1->t.a2t->ic_data(F64)-=tempi2->ic_data(F64); - tempi1->ic_class2=tempi->ic_class2; - tempi_push=tempi1; - OptSetNOP1(tempi2); - OptSetNOP1(tempi); - } - } - } - } - } - break; - case IC_SUB: - if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { - if (i==FBO1_INT) { - tempi->ic_data=tempi1->ic_data-tempi2->ic_data; - tempi->ic_code=IC_IMM_I64; - } else { - tempi->ic_data(F64)=tempi1->ic_data(F64)- - tempi2->ic_data(F64); - tempi->ic_code=IC_IMM_F64; - } - } else { - if (cc->pass==2) { - if (tempi2->ic_code==IC_IMM_I64) { - if (!tempi2->ic_data) { - tempi1->ic_flags|=tempi2->ic_flags|tempi->ic_flags; - tempi1->ic_class2=tempi->ic_class2; - tempi_push=tempi1; - OptSetNOP1(tempi2); - OptSetNOP1(tempi); - } else - if (tempi1->ic_code==IC_ADD || - tempi1->ic_code==IC_SUB) { - if (tempi1->t.a1t->ic_code==IC_IMM_I64) { - tempi1->ic_flags|=tempi->ic_flags; - tempi1->t.a1t->ic_data-=tempi2->ic_data; - tempi1->ic_class2=tempi->ic_class2; - tempi_push=tempi1; - OptSetNOP1(tempi2); - OptSetNOP1(tempi); - } else if (tempi1->t.a2t->ic_code==IC_IMM_I64) { - tempi1->ic_flags|=tempi->ic_flags; - if (tempi1->ic_code==IC_ADD) - tempi1->t.a2t->ic_data-=tempi2->ic_data; - else - tempi1->t.a2t->ic_data+=tempi2->ic_data; - tempi1->ic_class2=tempi->ic_class2; - tempi_push=tempi1; - OptSetNOP1(tempi2); - OptSetNOP1(tempi); - } - } - } else - if (tempi2->ic_code==IC_IMM_F64) { - if (!tempi2->ic_data) { - tempi1->ic_flags|=tempi2->ic_flags|tempi->ic_flags; - tempi1->ic_class2=tempi->ic_class2; - tempi_push=tempi1; - OptSetNOP1(tempi2); - OptSetNOP1(tempi); - } else - if (tempi1->ic_code==IC_ADD || tempi1->ic_code==IC_SUB) { - if (tempi1->t.a1t->ic_code==IC_IMM_F64) { - tempi1->ic_flags|=tempi->ic_flags|tempi2->ic_flags; - tempi1->t.a1t->ic_data(F64)-=tempi2->ic_data(F64); - tempi1->ic_class2=tempi->ic_class2; - tempi_push=tempi1; - OptSetNOP1(tempi2); - OptSetNOP1(tempi); - } else if (tempi1->t.a2t->ic_code==IC_IMM_F64) { - tempi1->ic_flags|=tempi->ic_flags|tempi2->ic_flags; - if (tempi1->ic_code==IC_ADD) - tempi1->t.a2t->ic_data(F64)-=tempi2->ic_data(F64); - else - tempi1->t.a2t->ic_data(F64)+=tempi2->ic_data(F64); - tempi1->ic_class2=tempi->ic_class2; - tempi_push=tempi1; - OptSetNOP1(tempi2); - OptSetNOP1(tempi); - } - } - } - } - } - break; - case IC_AND_AND: - if (OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { - tempi->ic_data=tempi1->ic_data&&tempi2->ic_data; - tempi->ic_code=IC_IMM_I64; - } - tempi->ic_class=cmp.internal_types[RT_I64]; - break; - case IC_OR_OR: - if (OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { - tempi->ic_data=tempi1->ic_data||tempi2->ic_data; - tempi->ic_code=IC_IMM_I64; - } - tempi->ic_class=cmp.internal_types[RT_I64]; - break; - case IC_XOR_XOR: - if (OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { - tempi->ic_data=tempi1->ic_data^^tempi2->ic_data; - tempi->ic_code=IC_IMM_I64; - } - tempi->ic_class=cmp.internal_types[RT_I64]; - break; - end: - if (!tempi_push->ic_class->ptr_stars_cnt) { - if (tempi_push->ic_class->raw_type==RT_F64) - tempi_push->ic_class2=cmp.internal_types[RT_F64]; - else if (is_unsigned) - tempi_push->ic_class2=cmp.internal_types[RT_U64]; - else - tempi_push->ic_class2=cmp.internal_types[RT_I64]; - } - break; - start: - case IC_EQU_EQU: - if (OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { - tempi->ic_data=tempi1->ic_data==tempi2->ic_data; - tempi->ic_code=IC_IMM_I64; - } else - if (tempi->ic_class->raw_type==RT_F64) - tempi->ic_flags|=ICF_USE_F64; - break; - case IC_NOT_EQU: - if (OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { - tempi->ic_data=tempi1->ic_data!=tempi2->ic_data; - tempi->ic_code=IC_IMM_I64; - } else - if (tempi->ic_class->raw_type==RT_F64) - tempi->ic_flags|=ICF_USE_F64; - break; - case IC_LESS: - if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { - if (i==FBO1_INT) { - if (is_unsigned) - tempi->ic_data=tempi1->ic_data(U64)ic_data(U64); - else - tempi->ic_data=tempi1->ic_data(I64)ic_data(I64); - } else - tempi->ic_data=tempi1->ic_data(F64)ic_data(F64); - tempi->ic_code=IC_IMM_I64; - } else { - if (is_unsigned) - tempi->ic_flags|=ICF_USE_UNSIGNED; - if (tempi->ic_class->raw_type==RT_F64) - tempi->ic_flags|=ICF_USE_F64; - } - break; - case IC_GREATER_EQU: - if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { - if (i==FBO1_INT) { - if (is_unsigned) - tempi->ic_data=tempi1->ic_data(U64)>=tempi2->ic_data(U64); - else - tempi->ic_data=tempi1->ic_data(I64)>=tempi2->ic_data(I64); - } else - tempi->ic_data=tempi1->ic_data(F64)>=tempi2->ic_data(F64); - tempi->ic_code=IC_IMM_I64; - } else { - if (is_unsigned) - tempi->ic_flags|=ICF_USE_UNSIGNED; - if (tempi->ic_class->raw_type==RT_F64) - tempi->ic_flags|=ICF_USE_F64; - } - break; - case IC_GREATER: - if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { - if (i==FBO1_INT) { - if (is_unsigned) - tempi->ic_data=tempi1->ic_data(U64)>tempi2->ic_data(U64); - else - tempi->ic_data=tempi1->ic_data(I64)>tempi2->ic_data(I64); - } else - tempi->ic_data=tempi1->ic_data(F64)>tempi2->ic_data(F64); - tempi->ic_code=IC_IMM_I64; - } else { - if (is_unsigned) - tempi->ic_flags|=ICF_USE_UNSIGNED; - if (tempi->ic_class->raw_type==RT_F64) - tempi->ic_flags|=ICF_USE_F64; - } - break; - case IC_LESS_EQU: - if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { - if (i==FBO1_INT) { - if (is_unsigned) - tempi->ic_data=tempi1->ic_data(U64)<=tempi2->ic_data(U64); - else - tempi->ic_data=tempi1->ic_data(I64)<=tempi2->ic_data(I64); - } else - tempi->ic_data=tempi1->ic_data(F64)<=tempi2->ic_data(F64); - tempi->ic_code=IC_IMM_I64; - } else { - if (is_unsigned) - tempi->ic_flags|=ICF_USE_UNSIGNED; - if (tempi->ic_class->raw_type==RT_F64) - tempi->ic_flags|=ICF_USE_F64; - } - break; - end: - tempi->ic_flags&=~ICF_R_TO_INT; - if (!tempi_push->ic_class->ptr_stars_cnt) { - if (tempi_push->ic_class->raw_type==RT_F64) - tempi_push->ic_class2=cmp.internal_types[RT_F64]; - else if (is_unsigned) - tempi_push->ic_class2=cmp.internal_types[RT_U64]; - else - tempi_push->ic_class2=cmp.internal_types[RT_I64]; - } - if (tempi_push->ic_flags & ICF_PUSH_CMP) - tempi->ic_class=tempi->ic_class2; - else - tempi->ic_class=cmp.internal_types[RT_I64]; - break; - start: - if (cc->pass==2 && (!tempc->size||!tempc2->size)) - LexWarn(cc,"Assign U0 "); - start: - case IC_MUL_EQU: - if (tempi2->ic_code==IC_IMM_I64 && tempc->raw_type!=RT_F64 && - tempc2->raw_type!=RT_F64) { - if (i=tempi2->ic_data) { - if (Bsf(i)==Bsr(i)) { - tempi2->ic_data=Bsf(i); - tempi->ic_code=IC_SHL_EQU; - } - } - } - break; - case IC_DIV_EQU: - if (tempi2->ic_code==IC_IMM_I64 && tempc->raw_type!=RT_F64 && - tempc2->raw_type!=RT_F64 && - (i=tempi2->ic_data) && Bsf(i)==Bsr(i)) { - tempi2->ic_data=Bsf(i); - tempi->ic_code=IC_SHR_EQU; - } - break; - case IC_MOD_EQU: - if (tempi2->ic_code==IC_IMM_I64 && tempc->raw_type!=RT_F64 && - tempc2->raw_type!=RT_F64 && - (i=tempi2->ic_data) && Bsf(i)==Bsr(i)) { - tempi2->ic_data=i-1; - tempi->ic_code=IC_AND_EQU; - } - break; - case IC_ADD_EQU: - case IC_SUB_EQU: - break; - end: - if (tempi2->ic_class->raw_type==RT_F64) - tempi->ic_flags=tempi->ic_flags|ICF_USE_F64; - if (tempc->raw_type==RT_F64) { - if (tempc2->raw_type!=RT_F64) - tempi2->ic_flags|=ICF_R_TO_F64; - } - break; - case IC_ASSIGN: - if (tempc->raw_type==RT_F64) { - if (tempc2->raw_type!=RT_F64) - tempi2->ic_flags|=ICF_R_TO_F64; - } else { - if (tempc2->raw_type==RT_F64) - tempi2->ic_flags|=ICF_R_TO_INT; - } - if (cc->pass==2 && tempi1->ic_class->raw_type!=RT_F64) { - if (tempi1->ic_code==IC__PP) { - tempi->ic_code=IC_ASSIGN_PP; - tempi->ic_flags|=tempi1->ic_flags; - tempi->t.class2=tempi1->ic_class; - OptSetNOP1(tempi1); - } else if (tempi1->ic_code==IC__MM) { - tempi->ic_code=IC_ASSIGN_MM; - tempi->ic_flags|=tempi1->ic_flags; - tempi->t.class2=tempi1->ic_class; - OptSetNOP1(tempi1); - } - } - break; - case IC_SHL_EQU: - case IC_SHR_EQU: - case IC_AND_EQU: - case IC_OR_EQU: - case IC_XOR_EQU: - if (tempc2->raw_type==RT_F64) - tempi2->ic_flags|=ICF_R_TO_INT; - break; - end: - break; - case IC_ENTER: - case IC_LEAVE: - tempi->ic_data=-cc->htc.fun->size; - break; - case IC_ADD_RSP: - if (tempi1=OptLag(tempi)) { - if (tempi1->ic_code==IC_ADD_RSP) { - tempi->ic_data+=tempi1->ic_data; - tempi->ic_flags|=tempi1->ic_flags; - OptSetNOP1(tempi1); - } - } - case IC_ADD_RSP1: - break; - case IC_BSF: - if (tempi1->ic_code==IC_IMM_I64) { - tempi1->ic_data=Bsf(tempi1->ic_data); - tempi_push=tempi1; - OptSetNOP1(OptLag(tempi1)); //CALL_START - tempi2=OptLead1(tempi); - tempi1->ic_flags|=tempi->ic_flags|tempi2->ic_flags; - OptSetNOP1(tempi2); //CALL_END - OptSetNOP1(tempi); //BSF - } - break; - case IC_BSR: - if (tempi1->ic_code==IC_IMM_I64) { - tempi1->ic_data=Bsr(tempi1->ic_data); - tempi_push=tempi1; - OptSetNOP1(OptLag(tempi1)); //CALL_START - tempi2=OptLead1(tempi); - tempi1->ic_flags|=tempi->ic_flags|tempi2->ic_flags; - OptSetNOP1(tempi2); //CALL_END - OptSetNOP1(tempi); //BSR - } - break; - case IC_LBTS: - case IC_LBTR: - case IC_LBTC: - tempi->ic_flags|=ICF_LOCK; - break; - case IC_TO_I64: - if (tempi1->ic_code==IC_IMM_F64) { - tempi2=tempi1->last; - while (tempi2->ic_code!=IC_CALL_START) - tempi2=tempi2->last; - OptSetNOP1(tempi2); - - tempi2=tempi->next; - while (tempi2->ic_code!=IC_CALL_END) - tempi2=tempi2->next; - - tempi->ic_flags|=tempi1->ic_flags&~ICF_R_TO_INT|tempi2->ic_flags; - OptSetNOP1(tempi2); - - tempi->ic_code=IC_IMM_I64; - tempi->ic_data=ToI64(tempi1->ic_data(F64)); - tempi->ic_class=cmp.internal_types[RT_I64]; - tempi->ic_class2=cmp.internal_types[RT_I64]; - OptSetNOP1(tempi1); - } else if (tempi1->ic_code==IC_IMM_I64) { - tempi2=tempi1->last; - while (tempi2->ic_code!=IC_CALL_START) - tempi2=tempi2->last; - OptSetNOP1(tempi2); - - tempi2=tempi->next; - while (tempi2->ic_code!=IC_CALL_END) - tempi2=tempi2->next; - - tempi->ic_flags|=tempi1->ic_flags&~ICF_R_TO_F64|tempi2->ic_flags; - OptSetNOP1(tempi2); - - tempi->ic_code=IC_IMM_I64; - tempi->ic_data=tempi1->ic_data; - tempi->ic_class=cmp.internal_types[RT_I64]; - tempi->ic_class2=cmp.internal_types[RT_I64]; - OptSetNOP1(tempi1); - } - if (tempi1->ic_flags&ICF_R_TO_F64) { - i=0; - tempi2=tempi1->last; - while (TRUE) { - if (tempi2->ic_code==IC_CALL_START) { - if (!i) break; - i--; - } else if (tempi2->ic_code==IC_CALL_END) - i++; - tempi2=tempi2->last; - } - OptSetNOP1(tempi2); - - tempi2=tempi1->next; - while (tempi2->ic_code!=IC_CALL_END) - tempi2=tempi2->next; - - tempi1->ic_flags=tempi->ic_flags|tempi1->ic_flags& - ~(ICF_R_TO_F64|ICF_PUSH_RES)|tempi2->ic_flags; - OptSetNOP1(tempi2); - - tempi1->ic_class=cmp.internal_types[RT_I64]; - tempi1->ic_class2=cmp.internal_types[RT_I64]; - tempi_push=tempi1; - OptSetNOP1(tempi); - } - break; - case IC_TO_F64: - if (tempi1->ic_code==IC_IMM_I64) { - tempi2=tempi1->last; - while (tempi2->ic_code!=IC_CALL_START) - tempi2=tempi2->last; - OptSetNOP1(tempi2); - - tempi2=tempi->next; - while (tempi2->ic_code!=IC_CALL_END) - tempi2=tempi2->next; - - tempi->ic_flags|=tempi1->ic_flags&~ICF_R_TO_F64|tempi2->ic_flags; - OptSetNOP1(tempi2); - - tempi->ic_code=IC_IMM_F64; - tempi->ic_data(F64)=ToF64(tempi1->ic_data); - tempi->ic_class=cmp.internal_types[RT_F64]; - tempi->ic_class2=cmp.internal_types[RT_F64]; - OptSetNOP1(tempi1); - } else if (tempi1->ic_code==IC_IMM_F64) { - tempi2=tempi1->last; - while (tempi2->ic_code!=IC_CALL_START) - tempi2=tempi2->last; - OptSetNOP1(tempi2); - - tempi2=tempi->next; - while (tempi2->ic_code!=IC_CALL_END) - tempi2=tempi2->next; - - tempi->ic_flags|=tempi1->ic_flags&~ICF_R_TO_INT|tempi2->ic_flags; - OptSetNOP1(tempi2); - - tempi->ic_code=IC_IMM_F64; - tempi->ic_data=tempi1->ic_data; - tempi->ic_class=cmp.internal_types[RT_F64]; - tempi->ic_class2=cmp.internal_types[RT_F64]; - OptSetNOP1(tempi1); - } - if (tempi1->ic_flags&ICF_R_TO_INT) { - i=0; - tempi2=tempi1->last; - while (TRUE) { - if (tempi2->ic_code==IC_CALL_START) { - if (!i) break; - i--; - } else if (tempi2->ic_code==IC_CALL_END) - i++; - tempi2=tempi2->last; - } - OptSetNOP1(tempi2); - - tempi2=tempi1->next; - while (tempi2->ic_code!=IC_CALL_END) - tempi2=tempi2->next; - - tempi1->ic_flags=tempi->ic_flags|tempi1->ic_flags& - ~(ICF_R_TO_INT|ICF_PUSH_RES)|tempi2->ic_flags; - OptSetNOP1(tempi2); - - tempi1->ic_class=cmp.internal_types[RT_F64]; - tempi1->ic_class2=cmp.internal_types[RT_F64]; - tempi_push=tempi1; - OptSetNOP1(tempi); - } - break; - case IC_TO_BOOL: - if (tempi1->ic_code==IC_IMM_I64 || tempi1->ic_code==IC_IMM_F64) { - tempi2=tempi1->last; - while (tempi2->ic_code!=IC_CALL_START) - tempi2=tempi2->last; - OptSetNOP1(tempi2); - - tempi2=tempi->next; - while (tempi2->ic_code!=IC_CALL_END) - tempi2=tempi2->next; - - tempi->ic_flags|=tempi1->ic_flags&~ICF_R_TO_F64|tempi2->ic_flags; - OptSetNOP1(tempi2); - - tempi->ic_code=IC_IMM_I64; - tempi->ic_data=ToBool(tempi1->ic_data); - tempi->ic_class=cmp.internal_types[RT_I64]; - tempi->ic_class2=cmp.internal_types[RT_I64]; - OptSetNOP1(tempi1); - } - break; - case IC_BR_ZERO: - tempi_push=OptBrZero(cc,tempi); - break; - case IC_BR_NOT_ZERO: - tempi_push=OptBrNotZero(cc,tempi); - break; - case IC_NOP1: - if (tempi->ic_flags&ICF_PUSH_RES) { - tempi1=tempi; - do tempi1=tempi1->last; - while (tempi1->ic_code==IC_NOP1); - tempi1->ic_flags|=ICF_PUSH_RES; - tempi->ic_flags&=~ICF_PUSH_RES; - } - break; - case IC_NOP2: - ps->ptr+=tempi->ic_data<<1; - break; - case IC_LABEL: - lb=OptLabelFwd(tempi->ic_data); - lb1=tempi->ic_data; - while (lb2=lb1->fwd) { - lb1->fwd=lb; - lb1=lb2; - } - if (tempi1=OptLag(tempi)) { - if (tempi1->ic_code==IC_JMP) { - lb1=tempi1->ic_data; - while (lb1->fwd) - lb1=lb1->fwd; - if (lb1==lb) { - tempi->ic_flags|=tempi1->ic_flags; - OptSetNOP1(tempi1); - } - } else if (tempi1->ic_code==IC_LABEL) { - lb1=tempi1->ic_data; - if (!lb1->fwd) - lb1->fwd=lb; - if (tempi1=OptLag(tempi1)) { - if (tempi1->ic_code==IC_JMP) { - lb1=tempi1->ic_data; - while (lb1->fwd) - lb1=lb1->fwd; - if (lb1==lb) { - tempi->ic_flags|=tempi1->ic_flags; - OptSetNOP1(tempi1); - } - } - } - } - } - break; - case IC_JMP: - if (tempi1=OptLag(tempi)) { - if (tempi1->ic_code==IC_LABEL) { - lb=OptLabelFwd(tempi->ic_data); - lb1=OptLabelFwd(tempi1->ic_data); - if (lb!=lb1) - lb1->fwd=lb; - } - } - break; - case IC_STR_CONST: - case IC_RBP: - case IC_MOV_FS: - case IC_MOV_GS: - case IC_RIP: - case IC_SIZEOF: - case IC_SQR: - case IC_ABS: - case IC_SQRT: - case IC_SIN: - case IC_COS: - case IC_TAN: - case IC_ATAN: - case IC_BR_CARRY: - case IC_BR_NOT_CARRY: - case IC_BR_EQU_EQU ...IC_BR_LESS_EQU: - case IC_BR_EQU_EQU2...IC_BR_LESS_EQU2: - case IC_BR_OR_OR_NOT_ZERO: - case IC_BR_OR_OR_ZERO: - case IC_BR_AND_AND_NOT_ZERO: - case IC_BR_AND_AND_ZERO: - case IC_BR_AND_NOT_ZERO: - case IC_BR_AND_ZERO: - case IC_BR_MM_NOT_ZERO: - case IC_BR_MM_ZERO: - case IC_BR_BT: - case IC_BR_BTS: - case IC_BR_BTR: - case IC_BR_BTC: - case IC_BR_NOT_BT: - case IC_BR_NOT_BTS: - case IC_BR_NOT_BTR: - case IC_BR_NOT_BTC: - case IC_END: - case IC_ADDR: - case IC_RET: - case IC_END_EXP: - case IC_CALL_START: - case IC_CALL_END: - case IC_CALL_END2: - case IC_PUSH_REGS: - case IC_POP_REGS: - case IC_SUB_CALL: - case IC_CALL: - case IC_CALL_INDIRECT: - case IC_CALL_INDIRECT2: - case IC_CALL_EXTERN: - case IC_CALL_IMPORT: - case IC_PUSH: - case IC_POP: - case IC_INVLPG: - case IC_CLFLUSH: - case IC_GET_RFLAGS: - case IC_CARRY: - case IC_GET_RBP: - case IC_GET_RSP: - case IC_GET_RAX: - case IC_RETURN_VAL: - case IC_RETURN_VAL2: - case IC_ABS_ADDR: - case IC_HEAP_GLBL: - case IC_ADDR_IMPORT: - case IC_GET_LABEL: - case IC_TYPE: - case IC_RDTSC: - case IC_SET_RFLAGS: - case IC_SET_RBP: - case IC_SET_RSP: - case IC_SET_RAX: - case IC_SIGN_I64: - case IC_TOUPPER: - case IC_ABS_I64: - case IC_MIN_I64: - case IC_MAX_I64: - case IC_MIN_U64: - case IC_MAX_U64: - case IC_MOD_U64: - case IC_SQR_I64: - case IC_SQR_U64: - case IC_SWAP_U8: - case IC_SWAP_U16: - case IC_SWAP_U32: - case IC_SWAP_I64: - case IC_IN_U32: - case IC_IN_U16: - case IC_IN_U8: - case IC_STRLEN: - case IC_BT: - case IC_BTS: - case IC_BTR: - case IC_BTC: - case IC_QUE_INIT: - case IC_QUE_REM: - case IC_QUE_INS: - case IC_QUE_INS_REV: - case IC_OUT_U32: - case IC_OUT_U16: - case IC_OUT_U8: - case IC_NOBOUND_SWITCH: - case IC_SWITCH: - case IC_ASM: - break; - default: - "Pass:%d Missing IC handler\n",cc->pass; - ICPut(cc,tempi); - LexExcept(cc,"Compiler Optimization Error at "); - } - if (intermediate_code_table[code].arg_cnt==IS_2_ARG) { - if (tempi_push->ic_precedence&~ASSOC_MASK==PREC_ASSIGN) - OptFixSizeOf(tempi2,tempi_push,tempi1->ic_class-1); - else { - OptFixSizeOf(tempi1,tempi_push,tempi2->ic_class); - OptFixSizeOf(tempi2,tempi_push,tempi1->ic_class); - } - } - if (intermediate_code_table[tempi_push->ic_code].res_cnt) { - PrsPush(ps,tempi->ic_class2); - PrsPush(ps,tempi_push); - } - if (tempi->ic_class) { - if (tempi->ic_class->raw_type==RT_F64) - tempi->ic_flags&=~ICF_R_TO_F64; - else - tempi->ic_flags&=~ICF_R_TO_INT; - if (code>IC_END_EXP) - last_with_class=tempi; - } - tempi=tempi->next; - } - if (ps->ptr>2) { - "Pass:%d Stk:%08X\n",cc->pass,ps->ptr; - LexExcept(cc,"Compiler Optimization Error at "); - } -//This is for determining type conversions for passing args to funs. - return last_with_class; -} - diff --git a/Compiler/OptPass012.HC b/Compiler/OptPass012.HC new file mode 100644 index 0000000..8477423 --- /dev/null +++ b/Compiler/OptPass012.HC @@ -0,0 +1,1288 @@ +/*OptPass012 + +Pass#0 +When parsing the arg expressions to a function +call, there is a call to OptPass012 to determine +the type of the expression. $LK,"OptPass012",A="FF:::/Compiler/PrsExp.HC,OptPass012"$ + +Pass#1&2 +Constant expressions are simplified. +Eliminated opcodes are set to NOP. +Types are determined by reconstructing an +expression tree for operators +$LK,"CIntermediateCode",A="MN:CIntermediateCode"$.$LK,"CICTreeLinks",A="MN:CICTreeLinks"$. + +Pointer arithmetic size is set, once +the type is determined. + +Branches are expressed with short-circuit +logic. 3-Arg comparisons are established. + +*/ + +CIntermediateCode *OptPass012(CCmpCtrl *cc) +{/*Simplify CONST arithmetic. +Sets the class throughout Expression trees. +Returns the type of an Expression for use +in int<-->F64 conversions of fun +args. +*/ + I64 code,i; + Bool is_unsigned; + CHashClass *tempc,*tempc1,*tempc2; + CIntermediateCode *tempi,*tempi1,*tempi2,*tempi3,*tempi_push, + *last_with_class=NULL; + CCodeMisc *lb,*lb1,*lb2; + CPrsStk *ps; + if (!(ps=cc->ps)) + ps=cc->ps=MAlloc(sizeof(CPrsStk)); + ps->ptr=0; + ps->ptr2=0; + tempi=cc->coc.coc_head.next; + while (code=tempi->ic_code) { + tempc=tempi->ic_class; + tempi->ic_class2=tempc; + tempi_push=tempi; + MemSet(&tempi->a1,0,3*sizeof(CICArg)); + tempi->a1_type_pointed_to=0; + switch [intermediate_code_table[code].arg_cnt] { + case IS_V_ARG: + ps->ptr-=tempi->ic_data>>2; + break; + case IS_2_ARG: + tempi2=PrsPop(ps); + tempc2=tempi2->ic_class; + tempi->t.a2t=tempi2; + tempi->t.a2c=PrsPop(ps); + case IS_1_ARG: + tempi1=PrsPop(ps); + tempc1=tempi1->ic_class; + tempi->t.a1t=tempi1; + tempi->t.a1c=PrsPop(ps); + break; + case IS_0_ARG: //nobound switch + break; + } + if (intermediate_code_table[code].not_const) + cc->flags|=CCF_NOT_CONST; + switch [code] { + case IC_IMM_F64: + tempi->ic_flags&=~ICF_R_TO_F64; + if (cc->pass==2 && tempi->ic_flags&ICF_R_TO_INT) { + tempi->ic_data=ToI64(tempi->ic_data(F64)); + tempi->ic_flags&=~ICF_R_TO_INT; + tempi->ic_code=IC_IMM_I64; + tempi->ic_class=cmp.internal_types[RT_I64]; + } + break; + case IC_IMM_I64: + tempi->ic_flags&=~ICF_R_TO_INT; + if (cc->pass==2 && tempi->ic_flags&ICF_R_TO_F64) { + tempi->ic_data(F64)=ToF64(tempi->ic_data); + tempi->ic_flags&=~ICF_R_TO_F64; + tempi->ic_code=IC_IMM_F64; + tempi->ic_class=cmp.internal_types[RT_F64]; + } + break; + case IC_HOLYC_TYPECAST: + if (tempi1->ic_code==IC_IMM_I64 || tempi1->ic_code==IC_IMM_F64) { + if (tempi->ic_class->raw_type==RT_F64) + tempi1->ic_code=IC_IMM_F64; + else + tempi1->ic_code=IC_IMM_I64; + tempi1->ic_class=tempi->ic_class; + tempi1->ic_flags|=tempi->ic_flags; + tempi_push=tempi1; + OptSetNOP1(tempi); + } else { + if (tempi->ic_data) {//was paren + if (!tempi_push->ic_class->ptr_stars_cnt) { + if (tempi_push->ic_class->raw_type==RT_F64) + tempi_push->ic_class2=cmp.internal_types[RT_F64]; + else + tempi_push->ic_class2=cmp.internal_types[RT_I64]; + } + } else { + tempi1->ic_class=tempi->ic_class; + tempi1->ic_flags|=tempi->ic_flags; + tempi_push=tempi1; + OptSetNOP1(tempi); + } + } + break; + case IC_FS: + case IC_GS: +//CALL,FS/GS,CALL_END,IMM,ADD,DEREF-->MOV_FS/GS + tempi1=tempi->next->next; //IMM + tempi2=tempi1->next; //ADD + tempi3=tempi2->next; //DEREF + if (tempi1->ic_code==IC_IMM_I64 && tempi2->ic_code==IC_ADD && + tempi3->ic_code==IC_DEREF && + !(tempi3->ic_flags&~ICG_NO_CVT_MASK)) { + tempi->ic_flags|=tempi1->ic_flags|tempi2->ic_flags|tempi3->ic_flags; + if (tempi->ic_code==IC_FS) + tempi->ic_code=IC_MOV_FS; + else + tempi->ic_code=IC_MOV_GS; + tempi->ic_data=tempi1->ic_data; + tempi->ic_class =tempi3->ic_class; + tempi->ic_class2=tempi3->ic_class2; + OptSetNOP1(tempi1); + OptSetNOP1(tempi2); + OptSetNOP1(tempi3); + + tempi1=tempi->last; //CALL + tempi2=tempi->next; //CALL_END + tempi->ic_flags|=tempi1->ic_flags|tempi2->ic_flags; + OptSetNOP1(tempi1); + OptSetNOP1(tempi2); + } + break; + case IC_PUSH_CMP: + if (tempi1=OptLag(tempi)) { + if (tempi1->ic_code==IC_AND_AND) + tempi1=OptLag(tempi1); + if (tempi1) + tempi->ic_class=tempi1->ic_class; + } + tempi->ic_class2=tempi->ic_class; + tempi->ic_data=0; + if (tempi->ic_class->raw_type==RT_F64) + tempi->ic_flags|=ICF_USE_F64; + break; + case IC_COM: + if (tempi1->ic_code==IC_IMM_I64) { + tempi->ic_data=~tempi1->ic_data; + tempi->ic_code=IC_IMM_I64; + tempi->ic_flags|=tempi1->ic_flags; + OptSetNOP1(tempi1); + } + tempi_push->ic_class2=cmp.internal_types[RT_I64]; + break; + start: + case IC_NOT: + if (tempc->raw_type==RT_F64) { + if (tempi1->ic_code==IC_IMM_F64) { + tempi->ic_data(F64)=!tempi1->ic_data(F64); + tempi->ic_code=IC_IMM_F64; + tempi->ic_flags|=tempi1->ic_flags; + OptSetNOP1(tempi1); + } + break; + } + if (tempi1->ic_code==IC_IMM_I64) { + tempi->ic_data=!tempi1->ic_data; + tempi->ic_code=IC_IMM_I64; + tempi->ic_flags|=tempi1->ic_flags; + OptSetNOP1(tempi1); + } + break; + case IC_UNARY_MINUS: + if (i=OptFixupUnaryOp(tempi,tempi1,&is_unsigned)) { + if (i==FBO1_INT) { + tempi->ic_data=-tempi1->ic_data(I64); + tempi->ic_code=IC_IMM_I64; + } else { + tempi->ic_data(F64)=-tempi1->ic_data(F64); + tempi->ic_code=IC_IMM_F64; + } + } + if (tempc1->type&HTT_INTERNAL_TYPE && tempc1->raw_type&RTF_UNSIGNED) + tempi->ic_class=cmp.internal_types[tempc1->raw_type-1]; + break; + case IC_SHL_CONST: + if (i=OptFixupUnaryOp(tempi,tempi1,&is_unsigned)) { + if (i==FBO1_INT) { + if (is_unsigned) + tempi->ic_data=tempi1->ic_data(U64)<ic_data(U64); + else + tempi->ic_data=tempi1->ic_data(I64)<ic_data(I64); + tempi->ic_code=IC_IMM_I64; + } else { + tempi->ic_data(F64)=tempi1->ic_data(F64)<ic_data; + tempi->ic_code=IC_IMM_F64; + } + } else if (tempi1->ic_code==IC_SHL_CONST) { + tempi->ic_flags|=tempi1->ic_flags; + tempi->ic_data+=tempi1->ic_data; + OptSetNOP1(tempi1); + } + break; + case IC_SHR_CONST: + if (i=OptFixupUnaryOp(tempi,tempi1,&is_unsigned)) { + if (i==FBO1_INT) { + if (is_unsigned) + tempi->ic_data=tempi1->ic_data(U64)>>tempi->ic_data(U64); + else + tempi->ic_data=tempi1->ic_data(I64)>>tempi->ic_data(I64); + tempi->ic_code=IC_IMM_I64; + } else { + tempi->ic_data(F64)=tempi1->ic_data(F64)>>tempi->ic_data; + tempi->ic_code=IC_IMM_F64; + } + } else if (tempi1->ic_code==IC_SHR_CONST) { + tempi->ic_flags|=tempi1->ic_flags; + tempi->ic_data+=tempi1->ic_data; + OptSetNOP1(tempi1); + } + break; + case IC_SHL: + if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { + if (i==FBO1_INT) { + if (is_unsigned) + tempi->ic_data=tempi1->ic_data(U64)<ic_data(U64); + else + tempi->ic_data=tempi1->ic_data(I64)<ic_data(I64); + tempi->ic_code=IC_IMM_I64; + } else { + tempi->ic_data(F64)=tempi1->ic_data(F64) << tempi2->ic_data(F64); + tempi->ic_code=IC_IMM_F64; + } + } else if (tempi2->ic_code==IC_IMM_I64) { + tempi->ic_flags|=tempi2->ic_flags; + tempi->ic_data=tempi2->ic_data; + tempi->ic_code=IC_SHL_CONST; + OptSetNOP1(tempi2); + } + break; + case IC_SHR: + if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { + if (i==FBO1_INT) { + if (is_unsigned) + tempi->ic_data=tempi1->ic_data(U64)>>tempi2->ic_data(U64); + else + tempi->ic_data=tempi1->ic_data(I64)>>tempi2->ic_data(I64); + tempi->ic_code=IC_IMM_I64; + } else { + tempi->ic_data(F64)=tempi1->ic_data(F64) >> tempi2->ic_data(F64); + tempi->ic_code=IC_IMM_F64; + } + } else if (tempi2->ic_code==IC_IMM_I64) { + tempi->ic_flags|=tempi2->ic_flags; + tempi->ic_data=tempi2->ic_data; + tempi->ic_code=IC_SHR_CONST; + OptSetNOP1(tempi2); + } + break; + end: + if (!tempi_push->ic_class->ptr_stars_cnt) { + if (tempi_push->ic_class->raw_type==RT_F64) + tempi_push->ic_class2=cmp.internal_types[RT_F64]; + else + tempi_push->ic_class2=cmp.internal_types[RT_I64]; + } + break; + case IC_DEREF: + if (cc->pass==2) { + if (!tempc->size) + LexWarn(cc,"Dereference U0 "); + if (tempi1->ic_class->raw_type!=RT_F64) { + if (tempi1->ic_code==IC__PP) { + tempi->ic_code=IC_DEREF_PP; + tempi->ic_flags|=tempi1->ic_flags; + OptSetNOP1(tempi1); + } else if (tempi1->ic_code==IC__MM) { + tempi->ic_code=IC_DEREF_MM; + tempi->ic_flags|=tempi1->ic_flags; + OptSetNOP1(tempi1); + } + } + } + break; + case IC__PP: + case IC__MM: + case IC_PP_: + case IC_MM_: + if (cc->pass==2 && !tempc->size) + LexWarn(cc,"Dereference U0 "); + break; + case IC_POWER: + tempc=tempi->ic_class=cmp.internal_types[RT_F64]; + if (tempc1->raw_type!=RT_F64) + tempi1->ic_flags|=ICF_R_TO_F64; + if (tempc2->raw_type!=RT_F64) + tempi2->ic_flags|=ICF_R_TO_F64; + tempi_push->ic_class2=cmp.internal_types[RT_F64]; + break; + start: + case IC_MUL: + if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { + if (i==FBO1_INT) { + if (is_unsigned) + tempi->ic_data=tempi1->ic_data(U64)*tempi2->ic_data(U64); + else + tempi->ic_data=tempi1->ic_data(I64)*tempi2->ic_data(I64); + tempi->ic_code=IC_IMM_I64; + } else { + tempi->ic_data(F64)=tempi1->ic_data(F64)*tempi2->ic_data(F64); + tempi->ic_code=IC_IMM_F64; + } + } else { + if (tempi1->ic_code==IC_IMM_I64 && cc->pass==2) { + switch (i=tempi1->ic_data) { + case 0: + break; + case 1: + tempi2->ic_flags|=tempi->ic_flags|tempi1->ic_flags; + tempi2->ic_class2=tempi->ic_class2; + tempi_push=tempi2; + OptSetNOP1(tempi1); + OptSetNOP1(tempi); + break; + default: + if (Bsf(i)==Bsr(i)) { + tempi->ic_flags|=tempi1->ic_flags; + tempi->t.a1c=tempi->t.a2c; + tempi->ic_data=Bsf(i); + tempi->ic_code=IC_SHL_CONST; + OptSetNOP1(tempi1); + } + } + } else if (tempi2->ic_code==IC_IMM_I64) { + switch (i=tempi2->ic_data) { + case 0: + break; + case 1: + tempi1->ic_flags|=tempi->ic_flags|tempi2->ic_flags; + tempi1->ic_class2=tempi->ic_class2; + tempi_push=tempi1; + OptSetNOP1(tempi2); + OptSetNOP1(tempi); + break; + default: + if (Bsf(i)==Bsr(i)) { + tempi->ic_flags|=tempi2->ic_flags; + tempi->ic_data=Bsf(i); + tempi->ic_code=IC_SHL_CONST; + OptSetNOP1(tempi2); + } else if (tempi1->ic_code==IC_MUL && cc->pass==2) { + if (tempi1->t.a1t->ic_code==IC_IMM_I64) { + tempi1->ic_flags|=tempi->ic_flags; + tempi1->t.a1t->ic_data*=tempi2->ic_data; + tempi1->ic_class2=tempi->ic_class2; + tempi_push=tempi1; + OptSetNOP1(tempi2); + OptSetNOP1(tempi); + } else if (tempi1->t.a2t->ic_code==IC_IMM_I64) { + tempi1->ic_flags|=tempi->ic_flags; + tempi1->t.a2t->ic_data*=tempi2->ic_data; + tempi1->ic_class2=tempi->ic_class2; + tempi_push=tempi1; + OptSetNOP1(tempi2); + OptSetNOP1(tempi); + } + } + } + } else if (tempi2->ic_code==IC_IMM_F64 && cc->pass==2) { + if (tempi2->ic_data(F64)==1.0) { + tempi1->ic_flags|=tempi->ic_flags|tempi2->ic_flags; + tempi1->ic_class2=tempi->ic_class2; + tempi_push=tempi1; + OptSetNOP1(tempi2); + OptSetNOP1(tempi); + } else if (tempi1->ic_code==IC_MUL) { + if (tempi1->t.a1t->ic_code==IC_IMM_F64) { + tempi1->ic_flags|=tempi->ic_flags|tempi2->ic_flags; + tempi1->t.a1t->ic_data(F64)*=tempi2->ic_data(F64); + tempi1->ic_class2=tempi->ic_class2; + tempi_push=tempi1; + OptSetNOP1(tempi2); + OptSetNOP1(tempi); + } else if (tempi1->t.a2t->ic_code==IC_IMM_F64) { + tempi1->ic_flags|=tempi->ic_flags|tempi2->ic_flags; + tempi1->t.a2t->ic_data(F64)*=tempi2->ic_data(F64); + tempi1->ic_class2=tempi->ic_class2; + tempi_push=tempi1; + OptSetNOP1(tempi2); + OptSetNOP1(tempi); + } + } + } + } + break; + case IC_DIV: + if ((tempi2->ic_data || tempi2->ic_code!=IC_IMM_I64 && + tempi2->ic_code!=IC_IMM_F64) && + (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned))) { + if (i==FBO1_INT) { + if (is_unsigned) + tempi->ic_data=tempi1->ic_data(U64)/tempi2->ic_data(U64); + else + tempi->ic_data=tempi1->ic_data(I64)/tempi2->ic_data(I64); + tempi->ic_code=IC_IMM_I64; + } else { + tempi->ic_data(F64)=tempi1->ic_data(F64)/ + tempi2->ic_data(F64); + tempi->ic_code=IC_IMM_F64; + } + } else { + if (tempi2->ic_code==IC_IMM_I64 && (i=tempi2->ic_data)) { + if (i==1) { + tempi1->ic_flags|=tempi2->ic_flags|tempi->ic_flags; + tempi1->ic_class2=tempi->ic_class2; + tempi_push=tempi1; + OptSetNOP1(tempi2); + OptSetNOP1(tempi); + } else if (Bsf(i)==Bsr(i)) { + tempi->ic_flags|=tempi2->ic_flags; + tempi->ic_data=Bsf(i); + tempi->ic_code=IC_SHR_CONST; + OptSetNOP1(tempi2); + } + } + } + break; + case IC_MOD: + if ((tempi2->ic_data || tempi2->ic_code!=IC_IMM_I64 && + tempi2->ic_code!=IC_IMM_F64) && + (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned))) { + if (i==FBO1_INT) { + if (is_unsigned) + tempi->ic_data=tempi1->ic_data(U64)%tempi2->ic_data(U64); + else + tempi->ic_data=tempi1->ic_data(I64)%tempi2->ic_data(I64); + tempi->ic_code=IC_IMM_I64; + } else { + tempi->ic_data(F64)=tempi1->ic_data(F64)% + tempi2->ic_data(F64); + tempi->ic_code=IC_IMM_F64; + } + } else if (cc->pass==2 && tempi2->ic_code==IC_IMM_I64 && + (i=tempi2->ic_data) && Bsf(i)==Bsr(i) && + tempi_push->ic_class->raw_type!=RT_F64 && + tempi_push->ic_class->raw_type&RTF_UNSIGNED) {//do only unsigned + tempi2->ic_data=i-1; + tempi->ic_code=IC_AND; + } + break; + case IC_AND: + if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { + tempi->ic_data=tempi1->ic_data&tempi2->ic_data; + if (i==FBO1_INT) + tempi->ic_code=IC_IMM_I64; + else + tempi->ic_code=IC_IMM_F64; + } + break; + case IC_OR: + if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { + tempi->ic_data=tempi1->ic_data|tempi2->ic_data; + if (i==FBO1_INT) + tempi->ic_code=IC_IMM_I64; + else + tempi->ic_code=IC_IMM_F64; + } + break; + case IC_XOR: + if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { + tempi->ic_data=tempi1->ic_data^tempi2->ic_data; + if (i==FBO1_INT) + tempi->ic_code=IC_IMM_I64; + else + tempi->ic_code=IC_IMM_F64; + } + break; + case IC_ADD: + if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { + if (i==FBO1_INT) { + tempi->ic_data=tempi1->ic_data+tempi2->ic_data; + tempi->ic_code=IC_IMM_I64; + } else { + tempi->ic_data(F64)=tempi1->ic_data(F64)+ + tempi2->ic_data(F64); + tempi->ic_code=IC_IMM_F64; + } + } else { + if (tempi1->ic_code==IC_ABS_ADDR&&tempi2->ic_code==IC_IMM_I64) { + tempi->ic_flags|=tempi1->ic_flags|tempi2->ic_flags; + tempi->ic_data=tempi1->ic_data+tempi2->ic_data; + tempi->ic_code=IC_ABS_ADDR; + OptSetNOP1(tempi1); + OptSetNOP1(tempi2); + } else if (cc->pass==2) { + if (tempi1->ic_code==IC_IMM_I64) { + if (!tempi1->ic_data) { + tempi2->ic_flags|=tempi1->ic_flags|tempi->ic_flags; + tempi2->ic_class2=tempi->ic_class2; + tempi_push=tempi2; + OptSetNOP1(tempi1); + OptSetNOP1(tempi); + } else if (tempi2->ic_code==IC_ADD|| + tempi2->ic_code==IC_SUB) { + if (tempi2->t.a1t->ic_code==IC_IMM_I64) { + tempi2->ic_flags|=tempi->ic_flags; + tempi2->t.a1t->ic_data+=tempi1->ic_data; + tempi2->ic_class2=tempi->ic_class2; + tempi_push=tempi2; + OptSetNOP1(tempi1); + OptSetNOP1(tempi); + } else if (tempi2->t.a2t->ic_code==IC_IMM_I64) { + tempi2->ic_flags|=tempi->ic_flags; + if (tempi2->ic_code==IC_ADD) + tempi2->t.a2t->ic_data+=tempi1->ic_data; + else + tempi2->t.a2t->ic_data-=tempi1->ic_data; + tempi2->ic_class2=tempi->ic_class2; + tempi_push=tempi2; + OptSetNOP1(tempi1); + OptSetNOP1(tempi); + } + } + } else if (tempi2->ic_code==IC_IMM_I64) { + if (!tempi2->ic_data) { + tempi1->ic_flags|=tempi2->ic_flags|tempi->ic_flags; + tempi1->ic_class2=tempi->ic_class2; + tempi_push=tempi1; + OptSetNOP1(tempi2); + OptSetNOP1(tempi); + } else if (tempi1->ic_code==IC_ADD || + tempi1->ic_code==IC_SUB) { + if (tempi1->t.a1t->ic_code==IC_IMM_I64) { + tempi1->ic_flags|=tempi->ic_flags; + tempi1->t.a1t->ic_data+=tempi2->ic_data; + tempi1->ic_class2=tempi->ic_class2; + tempi_push=tempi1; + OptSetNOP1(tempi2); + OptSetNOP1(tempi); + } else if (tempi1->t.a2t->ic_code==IC_IMM_I64) { + tempi1->ic_flags|=tempi->ic_flags; + if (tempi1->ic_code==IC_ADD) + tempi1->t.a2t->ic_data+=tempi2->ic_data; + else + tempi1->t.a2t->ic_data-=tempi2->ic_data; + tempi1->ic_class2=tempi->ic_class2; + tempi_push=tempi1; + OptSetNOP1(tempi2); + OptSetNOP1(tempi); + } + } + } else if (tempi1->ic_code==IC_IMM_F64) { + if (!tempi1->ic_data) { + tempi2->ic_flags|=tempi1->ic_flags|tempi->ic_flags; + tempi2->ic_class2=tempi->ic_class2; + tempi_push=tempi2; + OptSetNOP1(tempi1); + OptSetNOP1(tempi); + } else if (tempi2->ic_code==IC_ADD|| + tempi2->ic_code==IC_SUB) { + if (tempi2->t.a1t->ic_code==IC_IMM_F64) { + tempi2->ic_flags|=tempi->ic_flags; + tempi2->t.a1t->ic_data(F64)+=tempi1->ic_data(F64); + tempi2->ic_class2=tempi->ic_class2; + tempi_push=tempi2; + OptSetNOP1(tempi1); + OptSetNOP1(tempi); + } else if (tempi2->t.a2t->ic_code==IC_IMM_F64) { + tempi2->ic_flags|=tempi->ic_flags; + if (tempi2->ic_code==IC_ADD) + tempi2->t.a2t->ic_data(F64)+=tempi1->ic_data(F64); + else + tempi2->t.a2t->ic_data(F64)-=tempi1->ic_data(F64); + tempi2->ic_class2=tempi->ic_class2; + tempi_push=tempi2; + OptSetNOP1(tempi1); + OptSetNOP1(tempi); + } + } + } else if (tempi2->ic_code==IC_IMM_F64) { + if (!tempi2->ic_data) { + tempi1->ic_flags|=tempi2->ic_flags|tempi->ic_flags; + tempi1->ic_class2=tempi->ic_class2; + tempi_push=tempi1; + OptSetNOP1(tempi2); + OptSetNOP1(tempi); + } else if (tempi1->ic_code==IC_ADD || + tempi1->ic_code==IC_SUB) { + if (tempi1->t.a1t->ic_code==IC_IMM_F64) { + tempi1->ic_flags|=tempi->ic_flags; + tempi1->t.a1t->ic_data(F64)+=tempi2->ic_data(F64); + tempi1->ic_class2=tempi->ic_class2; + tempi_push=tempi1; + OptSetNOP1(tempi2); + OptSetNOP1(tempi); + } else if (tempi1->t.a2t->ic_code==IC_IMM_F64) { + tempi1->ic_flags|=tempi->ic_flags; + if (tempi1->ic_code==IC_ADD) + tempi1->t.a2t->ic_data(F64)+=tempi2->ic_data(F64); + else + tempi1->t.a2t->ic_data(F64)-=tempi2->ic_data(F64); + tempi1->ic_class2=tempi->ic_class2; + tempi_push=tempi1; + OptSetNOP1(tempi2); + OptSetNOP1(tempi); + } + } + } + } + } + break; + case IC_SUB: + if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { + if (i==FBO1_INT) { + tempi->ic_data=tempi1->ic_data-tempi2->ic_data; + tempi->ic_code=IC_IMM_I64; + } else { + tempi->ic_data(F64)=tempi1->ic_data(F64)- + tempi2->ic_data(F64); + tempi->ic_code=IC_IMM_F64; + } + } else { + if (cc->pass==2) { + if (tempi2->ic_code==IC_IMM_I64) { + if (!tempi2->ic_data) { + tempi1->ic_flags|=tempi2->ic_flags|tempi->ic_flags; + tempi1->ic_class2=tempi->ic_class2; + tempi_push=tempi1; + OptSetNOP1(tempi2); + OptSetNOP1(tempi); + } else + if (tempi1->ic_code==IC_ADD || + tempi1->ic_code==IC_SUB) { + if (tempi1->t.a1t->ic_code==IC_IMM_I64) { + tempi1->ic_flags|=tempi->ic_flags; + tempi1->t.a1t->ic_data-=tempi2->ic_data; + tempi1->ic_class2=tempi->ic_class2; + tempi_push=tempi1; + OptSetNOP1(tempi2); + OptSetNOP1(tempi); + } else if (tempi1->t.a2t->ic_code==IC_IMM_I64) { + tempi1->ic_flags|=tempi->ic_flags; + if (tempi1->ic_code==IC_ADD) + tempi1->t.a2t->ic_data-=tempi2->ic_data; + else + tempi1->t.a2t->ic_data+=tempi2->ic_data; + tempi1->ic_class2=tempi->ic_class2; + tempi_push=tempi1; + OptSetNOP1(tempi2); + OptSetNOP1(tempi); + } + } + } else + if (tempi2->ic_code==IC_IMM_F64) { + if (!tempi2->ic_data) { + tempi1->ic_flags|=tempi2->ic_flags|tempi->ic_flags; + tempi1->ic_class2=tempi->ic_class2; + tempi_push=tempi1; + OptSetNOP1(tempi2); + OptSetNOP1(tempi); + } else + if (tempi1->ic_code==IC_ADD || tempi1->ic_code==IC_SUB) { + if (tempi1->t.a1t->ic_code==IC_IMM_F64) { + tempi1->ic_flags|=tempi->ic_flags|tempi2->ic_flags; + tempi1->t.a1t->ic_data(F64)-=tempi2->ic_data(F64); + tempi1->ic_class2=tempi->ic_class2; + tempi_push=tempi1; + OptSetNOP1(tempi2); + OptSetNOP1(tempi); + } else if (tempi1->t.a2t->ic_code==IC_IMM_F64) { + tempi1->ic_flags|=tempi->ic_flags|tempi2->ic_flags; + if (tempi1->ic_code==IC_ADD) + tempi1->t.a2t->ic_data(F64)-=tempi2->ic_data(F64); + else + tempi1->t.a2t->ic_data(F64)+=tempi2->ic_data(F64); + tempi1->ic_class2=tempi->ic_class2; + tempi_push=tempi1; + OptSetNOP1(tempi2); + OptSetNOP1(tempi); + } + } + } + } + } + break; + case IC_AND_AND: + if (OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { + tempi->ic_data=tempi1->ic_data&&tempi2->ic_data; + tempi->ic_code=IC_IMM_I64; + } + tempi->ic_class=cmp.internal_types[RT_I64]; + break; + case IC_OR_OR: + if (OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { + tempi->ic_data=tempi1->ic_data||tempi2->ic_data; + tempi->ic_code=IC_IMM_I64; + } + tempi->ic_class=cmp.internal_types[RT_I64]; + break; + case IC_XOR_XOR: + if (OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { + tempi->ic_data=tempi1->ic_data^^tempi2->ic_data; + tempi->ic_code=IC_IMM_I64; + } + tempi->ic_class=cmp.internal_types[RT_I64]; + break; + end: + if (!tempi_push->ic_class->ptr_stars_cnt) { + if (tempi_push->ic_class->raw_type==RT_F64) + tempi_push->ic_class2=cmp.internal_types[RT_F64]; + else if (is_unsigned) + tempi_push->ic_class2=cmp.internal_types[RT_U64]; + else + tempi_push->ic_class2=cmp.internal_types[RT_I64]; + } + break; + start: + case IC_EQU_EQU: + if (OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { + tempi->ic_data=tempi1->ic_data==tempi2->ic_data; + tempi->ic_code=IC_IMM_I64; + } else + if (tempi->ic_class->raw_type==RT_F64) + tempi->ic_flags|=ICF_USE_F64; + break; + case IC_NOT_EQU: + if (OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { + tempi->ic_data=tempi1->ic_data!=tempi2->ic_data; + tempi->ic_code=IC_IMM_I64; + } else + if (tempi->ic_class->raw_type==RT_F64) + tempi->ic_flags|=ICF_USE_F64; + break; + case IC_LESS: + if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { + if (i==FBO1_INT) { + if (is_unsigned) + tempi->ic_data=tempi1->ic_data(U64)ic_data(U64); + else + tempi->ic_data=tempi1->ic_data(I64)ic_data(I64); + } else + tempi->ic_data=tempi1->ic_data(F64)ic_data(F64); + tempi->ic_code=IC_IMM_I64; + } else { + if (is_unsigned) + tempi->ic_flags|=ICF_USE_UNSIGNED; + if (tempi->ic_class->raw_type==RT_F64) + tempi->ic_flags|=ICF_USE_F64; + } + break; + case IC_GREATER_EQU: + if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { + if (i==FBO1_INT) { + if (is_unsigned) + tempi->ic_data=tempi1->ic_data(U64)>=tempi2->ic_data(U64); + else + tempi->ic_data=tempi1->ic_data(I64)>=tempi2->ic_data(I64); + } else + tempi->ic_data=tempi1->ic_data(F64)>=tempi2->ic_data(F64); + tempi->ic_code=IC_IMM_I64; + } else { + if (is_unsigned) + tempi->ic_flags|=ICF_USE_UNSIGNED; + if (tempi->ic_class->raw_type==RT_F64) + tempi->ic_flags|=ICF_USE_F64; + } + break; + case IC_GREATER: + if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { + if (i==FBO1_INT) { + if (is_unsigned) + tempi->ic_data=tempi1->ic_data(U64)>tempi2->ic_data(U64); + else + tempi->ic_data=tempi1->ic_data(I64)>tempi2->ic_data(I64); + } else + tempi->ic_data=tempi1->ic_data(F64)>tempi2->ic_data(F64); + tempi->ic_code=IC_IMM_I64; + } else { + if (is_unsigned) + tempi->ic_flags|=ICF_USE_UNSIGNED; + if (tempi->ic_class->raw_type==RT_F64) + tempi->ic_flags|=ICF_USE_F64; + } + break; + case IC_LESS_EQU: + if (i=OptFixupBinaryOp1(tempi,tempi1,tempi2,&is_unsigned)) { + if (i==FBO1_INT) { + if (is_unsigned) + tempi->ic_data=tempi1->ic_data(U64)<=tempi2->ic_data(U64); + else + tempi->ic_data=tempi1->ic_data(I64)<=tempi2->ic_data(I64); + } else + tempi->ic_data=tempi1->ic_data(F64)<=tempi2->ic_data(F64); + tempi->ic_code=IC_IMM_I64; + } else { + if (is_unsigned) + tempi->ic_flags|=ICF_USE_UNSIGNED; + if (tempi->ic_class->raw_type==RT_F64) + tempi->ic_flags|=ICF_USE_F64; + } + break; + end: + tempi->ic_flags&=~ICF_R_TO_INT; + if (!tempi_push->ic_class->ptr_stars_cnt) { + if (tempi_push->ic_class->raw_type==RT_F64) + tempi_push->ic_class2=cmp.internal_types[RT_F64]; + else if (is_unsigned) + tempi_push->ic_class2=cmp.internal_types[RT_U64]; + else + tempi_push->ic_class2=cmp.internal_types[RT_I64]; + } + if (tempi_push->ic_flags & ICF_PUSH_CMP) + tempi->ic_class=tempi->ic_class2; + else + tempi->ic_class=cmp.internal_types[RT_I64]; + break; + start: + if (cc->pass==2 && (!tempc->size||!tempc2->size)) + LexWarn(cc,"Assign U0 "); + start: + case IC_MUL_EQU: + if (tempi2->ic_code==IC_IMM_I64 && tempc->raw_type!=RT_F64 && + tempc2->raw_type!=RT_F64) { + if (i=tempi2->ic_data) { + if (Bsf(i)==Bsr(i)) { + tempi2->ic_data=Bsf(i); + tempi->ic_code=IC_SHL_EQU; + } + } + } + break; + case IC_DIV_EQU: + if (tempi2->ic_code==IC_IMM_I64 && tempc->raw_type!=RT_F64 && + tempc2->raw_type!=RT_F64 && + (i=tempi2->ic_data) && Bsf(i)==Bsr(i)) { + tempi2->ic_data=Bsf(i); + tempi->ic_code=IC_SHR_EQU; + } + break; + case IC_MOD_EQU: + if (tempi2->ic_code==IC_IMM_I64 && tempc->raw_type!=RT_F64 && + tempc2->raw_type!=RT_F64 && + (i=tempi2->ic_data) && Bsf(i)==Bsr(i)) { + tempi2->ic_data=i-1; + tempi->ic_code=IC_AND_EQU; + } + break; + case IC_ADD_EQU: + case IC_SUB_EQU: + break; + end: + if (tempi2->ic_class->raw_type==RT_F64) + tempi->ic_flags=tempi->ic_flags|ICF_USE_F64; + if (tempc->raw_type==RT_F64) { + if (tempc2->raw_type!=RT_F64) + tempi2->ic_flags|=ICF_R_TO_F64; + } + break; + case IC_ASSIGN: + if (tempc->raw_type==RT_F64) { + if (tempc2->raw_type!=RT_F64) + tempi2->ic_flags|=ICF_R_TO_F64; + } else { + if (tempc2->raw_type==RT_F64) + tempi2->ic_flags|=ICF_R_TO_INT; + } + if (cc->pass==2 && tempi1->ic_class->raw_type!=RT_F64) { + if (tempi1->ic_code==IC__PP) { + tempi->ic_code=IC_ASSIGN_PP; + tempi->ic_flags|=tempi1->ic_flags; + tempi->t.class2=tempi1->ic_class; + OptSetNOP1(tempi1); + } else if (tempi1->ic_code==IC__MM) { + tempi->ic_code=IC_ASSIGN_MM; + tempi->ic_flags|=tempi1->ic_flags; + tempi->t.class2=tempi1->ic_class; + OptSetNOP1(tempi1); + } + } + break; + case IC_SHL_EQU: + case IC_SHR_EQU: + case IC_AND_EQU: + case IC_OR_EQU: + case IC_XOR_EQU: + if (tempc2->raw_type==RT_F64) + tempi2->ic_flags|=ICF_R_TO_INT; + break; + end: + break; + case IC_ENTER: + case IC_LEAVE: + tempi->ic_data=-cc->htc.fun->size; + break; + case IC_ADD_RSP: + if (tempi1=OptLag(tempi)) { + if (tempi1->ic_code==IC_ADD_RSP) { + tempi->ic_data+=tempi1->ic_data; + tempi->ic_flags|=tempi1->ic_flags; + OptSetNOP1(tempi1); + } + } + case IC_ADD_RSP1: + break; + case IC_BSF: + if (tempi1->ic_code==IC_IMM_I64) { + tempi1->ic_data=Bsf(tempi1->ic_data); + tempi_push=tempi1; + OptSetNOP1(OptLag(tempi1)); //CALL_START + tempi2=OptLead1(tempi); + tempi1->ic_flags|=tempi->ic_flags|tempi2->ic_flags; + OptSetNOP1(tempi2); //CALL_END + OptSetNOP1(tempi); //BSF + } + break; + case IC_BSR: + if (tempi1->ic_code==IC_IMM_I64) { + tempi1->ic_data=Bsr(tempi1->ic_data); + tempi_push=tempi1; + OptSetNOP1(OptLag(tempi1)); //CALL_START + tempi2=OptLead1(tempi); + tempi1->ic_flags|=tempi->ic_flags|tempi2->ic_flags; + OptSetNOP1(tempi2); //CALL_END + OptSetNOP1(tempi); //BSR + } + break; + case IC_LBTS: + case IC_LBTR: + case IC_LBTC: + tempi->ic_flags|=ICF_LOCK; + break; + case IC_TO_I64: + if (tempi1->ic_code==IC_IMM_F64) { + tempi2=tempi1->last; + while (tempi2->ic_code!=IC_CALL_START) + tempi2=tempi2->last; + OptSetNOP1(tempi2); + + tempi2=tempi->next; + while (tempi2->ic_code!=IC_CALL_END) + tempi2=tempi2->next; + + tempi->ic_flags|=tempi1->ic_flags&~ICF_R_TO_INT|tempi2->ic_flags; + OptSetNOP1(tempi2); + + tempi->ic_code=IC_IMM_I64; + tempi->ic_data=ToI64(tempi1->ic_data(F64)); + tempi->ic_class=cmp.internal_types[RT_I64]; + tempi->ic_class2=cmp.internal_types[RT_I64]; + OptSetNOP1(tempi1); + } else if (tempi1->ic_code==IC_IMM_I64) { + tempi2=tempi1->last; + while (tempi2->ic_code!=IC_CALL_START) + tempi2=tempi2->last; + OptSetNOP1(tempi2); + + tempi2=tempi->next; + while (tempi2->ic_code!=IC_CALL_END) + tempi2=tempi2->next; + + tempi->ic_flags|=tempi1->ic_flags&~ICF_R_TO_F64|tempi2->ic_flags; + OptSetNOP1(tempi2); + + tempi->ic_code=IC_IMM_I64; + tempi->ic_data=tempi1->ic_data; + tempi->ic_class=cmp.internal_types[RT_I64]; + tempi->ic_class2=cmp.internal_types[RT_I64]; + OptSetNOP1(tempi1); + } + if (tempi1->ic_flags&ICF_R_TO_F64) { + i=0; + tempi2=tempi1->last; + while (TRUE) { + if (tempi2->ic_code==IC_CALL_START) { + if (!i) break; + i--; + } else if (tempi2->ic_code==IC_CALL_END) + i++; + tempi2=tempi2->last; + } + OptSetNOP1(tempi2); + + tempi2=tempi1->next; + while (tempi2->ic_code!=IC_CALL_END) + tempi2=tempi2->next; + + tempi1->ic_flags=tempi->ic_flags|tempi1->ic_flags& + ~(ICF_R_TO_F64|ICF_PUSH_RES)|tempi2->ic_flags; + OptSetNOP1(tempi2); + + tempi1->ic_class=cmp.internal_types[RT_I64]; + tempi1->ic_class2=cmp.internal_types[RT_I64]; + tempi_push=tempi1; + OptSetNOP1(tempi); + } + break; + case IC_TO_F64: + if (tempi1->ic_code==IC_IMM_I64) { + tempi2=tempi1->last; + while (tempi2->ic_code!=IC_CALL_START) + tempi2=tempi2->last; + OptSetNOP1(tempi2); + + tempi2=tempi->next; + while (tempi2->ic_code!=IC_CALL_END) + tempi2=tempi2->next; + + tempi->ic_flags|=tempi1->ic_flags&~ICF_R_TO_F64|tempi2->ic_flags; + OptSetNOP1(tempi2); + + tempi->ic_code=IC_IMM_F64; + tempi->ic_data(F64)=ToF64(tempi1->ic_data); + tempi->ic_class=cmp.internal_types[RT_F64]; + tempi->ic_class2=cmp.internal_types[RT_F64]; + OptSetNOP1(tempi1); + } else if (tempi1->ic_code==IC_IMM_F64) { + tempi2=tempi1->last; + while (tempi2->ic_code!=IC_CALL_START) + tempi2=tempi2->last; + OptSetNOP1(tempi2); + + tempi2=tempi->next; + while (tempi2->ic_code!=IC_CALL_END) + tempi2=tempi2->next; + + tempi->ic_flags|=tempi1->ic_flags&~ICF_R_TO_INT|tempi2->ic_flags; + OptSetNOP1(tempi2); + + tempi->ic_code=IC_IMM_F64; + tempi->ic_data=tempi1->ic_data; + tempi->ic_class=cmp.internal_types[RT_F64]; + tempi->ic_class2=cmp.internal_types[RT_F64]; + OptSetNOP1(tempi1); + } + if (tempi1->ic_flags&ICF_R_TO_INT) { + i=0; + tempi2=tempi1->last; + while (TRUE) { + if (tempi2->ic_code==IC_CALL_START) { + if (!i) break; + i--; + } else if (tempi2->ic_code==IC_CALL_END) + i++; + tempi2=tempi2->last; + } + OptSetNOP1(tempi2); + + tempi2=tempi1->next; + while (tempi2->ic_code!=IC_CALL_END) + tempi2=tempi2->next; + + tempi1->ic_flags=tempi->ic_flags|tempi1->ic_flags& + ~(ICF_R_TO_INT|ICF_PUSH_RES)|tempi2->ic_flags; + OptSetNOP1(tempi2); + + tempi1->ic_class=cmp.internal_types[RT_F64]; + tempi1->ic_class2=cmp.internal_types[RT_F64]; + tempi_push=tempi1; + OptSetNOP1(tempi); + } + break; + case IC_TO_BOOL: + if (tempi1->ic_code==IC_IMM_I64 || tempi1->ic_code==IC_IMM_F64) { + tempi2=tempi1->last; + while (tempi2->ic_code!=IC_CALL_START) + tempi2=tempi2->last; + OptSetNOP1(tempi2); + + tempi2=tempi->next; + while (tempi2->ic_code!=IC_CALL_END) + tempi2=tempi2->next; + + tempi->ic_flags|=tempi1->ic_flags&~ICF_R_TO_F64|tempi2->ic_flags; + OptSetNOP1(tempi2); + + tempi->ic_code=IC_IMM_I64; + tempi->ic_data=ToBool(tempi1->ic_data); + tempi->ic_class=cmp.internal_types[RT_I64]; + tempi->ic_class2=cmp.internal_types[RT_I64]; + OptSetNOP1(tempi1); + } + break; + case IC_BR_ZERO: + tempi_push=OptBrZero(cc,tempi); + break; + case IC_BR_NOT_ZERO: + tempi_push=OptBrNotZero(cc,tempi); + break; + case IC_NOP1: + if (tempi->ic_flags&ICF_PUSH_RES) { + tempi1=tempi; + do tempi1=tempi1->last; + while (tempi1->ic_code==IC_NOP1); + tempi1->ic_flags|=ICF_PUSH_RES; + tempi->ic_flags&=~ICF_PUSH_RES; + } + break; + case IC_NOP2: + ps->ptr+=tempi->ic_data<<1; + break; + case IC_LABEL: + lb=OptLabelFwd(tempi->ic_data); + lb1=tempi->ic_data; + while (lb2=lb1->fwd) { + lb1->fwd=lb; + lb1=lb2; + } + if (tempi1=OptLag(tempi)) { + if (tempi1->ic_code==IC_JMP) { + lb1=tempi1->ic_data; + while (lb1->fwd) + lb1=lb1->fwd; + if (lb1==lb) { + tempi->ic_flags|=tempi1->ic_flags; + OptSetNOP1(tempi1); + } + } else if (tempi1->ic_code==IC_LABEL) { + lb1=tempi1->ic_data; + if (!lb1->fwd) + lb1->fwd=lb; + if (tempi1=OptLag(tempi1)) { + if (tempi1->ic_code==IC_JMP) { + lb1=tempi1->ic_data; + while (lb1->fwd) + lb1=lb1->fwd; + if (lb1==lb) { + tempi->ic_flags|=tempi1->ic_flags; + OptSetNOP1(tempi1); + } + } + } + } + } + break; + case IC_JMP: + if (tempi1=OptLag(tempi)) { + if (tempi1->ic_code==IC_LABEL) { + lb=OptLabelFwd(tempi->ic_data); + lb1=OptLabelFwd(tempi1->ic_data); + if (lb!=lb1) + lb1->fwd=lb; + } + } + break; + case IC_STR_CONST: + case IC_RBP: + case IC_MOV_FS: + case IC_MOV_GS: + case IC_RIP: + case IC_SIZEOF: + case IC_SQR: + case IC_ABS: + case IC_SQRT: + case IC_SIN: + case IC_COS: + case IC_TAN: + case IC_ATAN: + case IC_BR_CARRY: + case IC_BR_NOT_CARRY: + case IC_BR_EQU_EQU ...IC_BR_LESS_EQU: + case IC_BR_EQU_EQU2...IC_BR_LESS_EQU2: + case IC_BR_OR_OR_NOT_ZERO: + case IC_BR_OR_OR_ZERO: + case IC_BR_AND_AND_NOT_ZERO: + case IC_BR_AND_AND_ZERO: + case IC_BR_AND_NOT_ZERO: + case IC_BR_AND_ZERO: + case IC_BR_MM_NOT_ZERO: + case IC_BR_MM_ZERO: + case IC_BR_BT: + case IC_BR_BTS: + case IC_BR_BTR: + case IC_BR_BTC: + case IC_BR_NOT_BT: + case IC_BR_NOT_BTS: + case IC_BR_NOT_BTR: + case IC_BR_NOT_BTC: + case IC_END: + case IC_ADDR: + case IC_RET: + case IC_END_EXP: + case IC_CALL_START: + case IC_CALL_END: + case IC_CALL_END2: + case IC_PUSH_REGS: + case IC_POP_REGS: + case IC_SUB_CALL: + case IC_CALL: + case IC_CALL_INDIRECT: + case IC_CALL_INDIRECT2: + case IC_CALL_EXTERN: + case IC_CALL_IMPORT: + case IC_PUSH: + case IC_POP: + case IC_INVLPG: + case IC_CLFLUSH: + case IC_GET_RFLAGS: + case IC_CARRY: + case IC_GET_RBP: + case IC_GET_RSP: + case IC_GET_RAX: + case IC_RETURN_VAL: + case IC_RETURN_VAL2: + case IC_ABS_ADDR: + case IC_HEAP_GLBL: + case IC_ADDR_IMPORT: + case IC_GET_LABEL: + case IC_TYPE: + case IC_RDTSC: + case IC_SET_RFLAGS: + case IC_SET_RBP: + case IC_SET_RSP: + case IC_SET_RAX: + case IC_SIGN_I64: + case IC_TOUPPER: + case IC_ABS_I64: + case IC_MIN_I64: + case IC_MAX_I64: + case IC_MIN_U64: + case IC_MAX_U64: + case IC_MOD_U64: + case IC_SQR_I64: + case IC_SQR_U64: + case IC_SWAP_U8: + case IC_SWAP_U16: + case IC_SWAP_U32: + case IC_SWAP_I64: + case IC_IN_U32: + case IC_IN_U16: + case IC_IN_U8: + case IC_STRLEN: + case IC_BT: + case IC_BTS: + case IC_BTR: + case IC_BTC: + case IC_QUE_INIT: + case IC_QUE_REM: + case IC_QUE_INS: + case IC_QUE_INS_REV: + case IC_OUT_U32: + case IC_OUT_U16: + case IC_OUT_U8: + case IC_NOBOUND_SWITCH: + case IC_SWITCH: + case IC_ASM: + break; + default: + "Pass:%d Missing IC handler\n",cc->pass; + ICPut(cc,tempi); + LexExcept(cc,"Compiler Optimization Error at "); + } + if (intermediate_code_table[code].arg_cnt==IS_2_ARG) { + if (tempi_push->ic_precedence&~ASSOC_MASK==PREC_ASSIGN) + OptFixSizeOf(tempi2,tempi_push,tempi1->ic_class-1); + else { + OptFixSizeOf(tempi1,tempi_push,tempi2->ic_class); + OptFixSizeOf(tempi2,tempi_push,tempi1->ic_class); + } + } + if (intermediate_code_table[tempi_push->ic_code].res_cnt) { + PrsPush(ps,tempi->ic_class2); + PrsPush(ps,tempi_push); + } + if (tempi->ic_class) { + if (tempi->ic_class->raw_type==RT_F64) + tempi->ic_flags&=~ICF_R_TO_F64; + else + tempi->ic_flags&=~ICF_R_TO_INT; + if (code>IC_END_EXP) + last_with_class=tempi; + } + tempi=tempi->next; + } + if (ps->ptr>2) { + "Pass:%d Stk:%08X\n",cc->pass,ps->ptr; + LexExcept(cc,"Compiler Optimization Error at "); + } +//This is for determining type conversions for passing args to funs. + return last_with_class; +} + diff --git a/Compiler/OptPass3.CPP b/Compiler/OptPass3.HC similarity index 100% rename from Compiler/OptPass3.CPP rename to Compiler/OptPass3.HC diff --git a/Compiler/OptPass4.CPP b/Compiler/OptPass4.CPP deleted file mode 100644 index 6879161..0000000 --- a/Compiler/OptPass4.CPP +++ /dev/null @@ -1,687 +0,0 @@ -Bool OptIC4(CIntermediateCode *tempi) -{ - I64 i; - CIntermediateCode *tempil1,*tempil2; - - if (tempi->ic_coder.type&MDF_STK && !(tempil2->ic_flags&ICF_PUSH_RES)) { - if (tempil1->ic_code==IC_ADD_CONST && tempil1->a1.type&MDF_STK) { - if ((tempil2->ic_code==IC_REG || tempil2->ic_code==IC_MOV) && - tempil2->a1.type&MDF_REG) { - i=tempil1->ic_data; - if (MIN_I32<=i<=MAX_I32 && - !Bt(&cmp.non_ptr_vars_mask,tempil2->a1.reg)) { - tempil1->ic_flags|=tempil2->ic_flags&ICG_NO_CVT_MASK; - tempil1->ic_code=IC_LEA; - tempil1->a1.type=MDF_DISP+tempil1->a1.type.raw_type; - tempil1->a1.reg=tempil2->a1.reg; - tempil1->a1.disp=i; - OptFree(tempil2); - return TRUE; - } - } else if (tempil2->ic_code==IC_SHL_CONST && tempil2->a1.type&MDF_REG) { - i=tempil1->ic_data; - if (MIN_I32<=i<=MAX_I32 && tempil2->a1.reg!=REG_RSP && - 1<=tempil2->ic_data<=3) { - tempil1->ic_flags|=tempil2->ic_flags&ICG_NO_CVT_MASK; - tempil1->ic_code=IC_LEA; - tempil1->a1.type=MDF_SIB+tempil1->a1.type.raw_type; - tempil1->a1.reg=tempil2->a1.reg<<8+REG_NONE; - if (tempil2->ic_data==1) - tempil1->a1.reg|=0x4000; - else if (tempil2->ic_data==2) - tempil1->a1.reg|=0x8000; - else - tempil1->a1.reg|=0xC000; - tempil1->a1.disp=i; - OptFree(tempil2); - return TRUE; - } - } - } - if (tempil2->ic_code==IC_MOV || tempil2->ic_code==IC_REG) { - if (tempil1->a2.type&MDF_STK) { - if (tempil2->ic_flags & ICF_R_TO_INT) { - if (tempil2->a1.type&MDF_IMM) - tempil2->a1.disp=tempil2->a1.disp(F64); - else - tempil1->ic_flags|=ICF_A2_TO_INT; - } else if (tempil2->ic_flags&ICF_R_TO_F64) { - if (tempil2->a1.type&MDF_IMM) - tempil2->a1.disp(F64)=tempil2->a1.disp; - else - tempil1->ic_flags|=ICF_A2_TO_F64; - } - tempil1->a2.type=tempil2->a1.type&MDG_MASK+ - MinI64(tempil1->a2.type.raw_type, - MinI64(tempil2->r.type.raw_type,tempil2->a1.type.raw_type)); - tempil1->a2.reg=tempil2->a1.reg; - tempil1->a2.disp=tempil2->a1.disp; - tempil1->ic_flags|=tempil2->ic_flags&ICG_NO_CVT_MASK; - OptSetNOP2(tempil2); - return TRUE; - } - if (tempil1->a1.type&MDF_STK) { - if (tempil2->ic_flags & ICF_R_TO_INT) { - if (tempil2->a1.type&MDF_IMM) - tempil2->a1.disp=tempil2->a1.disp(F64); - else - tempil1->ic_flags|=ICF_A1_TO_INT; - } else if (tempil2->ic_flags&ICF_R_TO_F64) { - if (tempil2->a1.type&MDF_IMM) { - if (tempil2->a1.type&RTF_UNSIGNED) - tempil2->a1.disp(F64)=tempil2->a1.disp(U64); - else - tempil2->a1.disp(F64)=tempil2->a1.disp(I64); - } else - tempil1->ic_flags|=ICF_A1_TO_F64; - } - tempil1->a1.type=tempil2->a1.type&MDG_MASK+ - MinI64(tempil1->a1.type.raw_type, - MinI64(tempil2->r.type.raw_type,tempil2->a1.type.raw_type)); - CmpMinTypePointed(tempil1,tempil2->a1_type_pointed_to); - tempil1->a1.reg=tempil2->a1.reg; - tempil1->a1.disp=tempil2->a1.disp; - tempil1->ic_flags|=tempil2->ic_flags&ICG_NO_CVT_MASK; - OptSetNOP2(tempil2); - return TRUE; - } - } - if (tempil1->ic_code==IC_DEREF) { - if (tempil2->ic_code==IC_ADD_CONST && tempil2->a1.type&MDF_REG && - tempil1->a1.type&MDF_STK) { - i=tempil2->ic_data; - if (MIN_I32<=i<=MAX_I32 && - !Bt(&cmp.non_ptr_vars_mask,tempil2->a1.reg)) { - tempil1->ic_flags|=tempil2->ic_flags; - tempil1->ic_code=IC_MOV; - tempil1->a1.type=MDF_DISP+tempil1->a1_type_pointed_to; - tempil1->a1.reg=tempil2->a1.reg; - tempil1->a1.disp=i; - OptSetNOP2(tempil2,-1); - return TRUE; - } - } - if (tempil2->ic_code==IC_LEA && tempil1->a1.type&MDF_STK) { - tempil1->ic_flags|=tempil2->ic_flags; - tempil1->ic_code=IC_MOV; - tempil1->a1.type=tempil2->a1.type&MDG_MASK+tempil1->a1_type_pointed_to; - tempil1->a1.reg=tempil2->a1.reg; - tempil1->a1.disp=tempil2->a1.disp; - OptFree(tempil2); - return TRUE; - } - } - } - if (tempil1->ic_code==IC_DEREF) { - if (tempil1->a1.type&MDF_REG) { - tempil1->a1.type=MDF_DISP+tempil1->a1_type_pointed_to; - tempil1->a1.disp=0; - tempil1->ic_code=IC_MOV; - return TRUE; - } - } - return FALSE; -} - -U0 OptPass4(CCmpCtrl *cc,COptReg *reg_offsets,I64 *_type) -{ - CHashClass *tempc,*tempc1,*tempc2; - CIntermediateCode *tempi,*tempi1,*tempi2,*tempil1,*tempil2,*tempil3, - *tempi_next; - I64 code,i; - Bool dead_code=FALSE; - CCodeMisc *lb; - CPrsStk *ps=cc->ps; - ps->ptr=0; - ps->ptr2=0; - - if (_type) - *_type=RT_I64; - - tempi=cc->coc.coc_head.next; - while (code=tempi->ic_code) { - tempi_next=tempi->next; - if (dead_code&&code!=IC_LABEL) { - if (code==IC_JMP||code==IC_SUB_CALL) { - lb=OptLabelFwd(tempi->ic_data); - if (lb->use_cnt>0) - lb->use_cnt--; - } - tempi=OptFree(tempi); - } else { - tempc=tempi->ic_class; - tempi1=tempi2=&cmp.ic_nop; - if (tempil1=OptLag2(tempi)) { - if (tempil2=OptLag2(tempil1)) { - if (!(tempil3=OptLag2(tempil2))) - tempil3=&cmp.ic_nop; - } else - tempil2=tempil3=&cmp.ic_nop; - } else - tempil1=tempil2=tempil3=&cmp.ic_nop; - switch [intermediate_code_table[code].arg_cnt] { - case IS_V_ARG: - ps->ptr-=tempi->ic_data>>3; - break; - case IS_2_ARG: - tempi2=PrsPop(ps); - tempc2=tempi2->ic_class; - case IS_1_ARG: - tempi1=PrsPop(ps); - tempc1=tempi1->ic_class; - break; - case IS_0_ARG: //nobound switch - break; - } - switch [code] { - case IC_IMM_I64: - case IC_TYPE: - tempi->a1.type=MDF_IMM+RT_I64; - tempi->a1.disp=tempi->ic_data; - tempi->ic_code=IC_MOV; - break; - case IC_IMM_F64: - tempi->a1.type=MDF_IMM+RT_I64; - tempi->a1.disp=tempi->ic_data; - tempi->a1_type_pointed_to=RT_F64; - tempi->ic_code=IC_MOV; - break; - case IC_MOV: - if (tempi->a1.type&MDF_DISP && tempi->a1.reg==REG_RBP) { - i=CmpOffset2Reg(tempi->a1.disp,reg_offsets); - if (i>=0) { - tempi->a1.type=MDF_REG+tempi->a1.type.raw_type; - tempi->a1.reg=i; - tempi->a1.disp=0; - } - } - break; - case IC_DEREF: - if (tempi1->ic_code==IC_LEA) { - if (tempi1->a1.type&MDF_DISP && tempi1->a1.reg==REG_RBP) { - i=CmpOffset2Reg(tempi1->a1.disp,reg_offsets); - if (i>=0) { - tempi->ic_flags|=tempi1->ic_flags; - tempi->ic_code=IC_REG; - tempi->a1.type=MDF_REG+tempi->a1.type.raw_type; - tempi->a1.reg=i; - tempi->a1.disp=0; - OptFree(tempi1); - } - } - } else if ((tempi1->ic_code==IC_ABS_ADDR || - tempi1->ic_code==IC_MOV && - tempi1->a1.type==MDF_IMM+RT_I64 && - 0<=tempi1->a1.disp<=MAX_I32)&& !(tempi1->ic_flags&ICF_NO_RIP)) { - if (tempi1->ic_code==IC_ABS_ADDR) - tempi->a1.disp=tempi1->ic_data; - else - tempi->a1.disp=tempi1->a1.disp; - tempi->ic_flags|=tempi1->ic_flags; - tempi->ic_code=IC_MOV; - tempi->a1.type=MDF_RIP_DISP32+tempi->a1_type_pointed_to; - tempi->a1.reg=REG_RIP; - OptFree(tempi1); - } - break; - case IC_BR_MM_ZERO: - case IC_BR_MM_NOT_ZERO: -//(branch ++ to zero is unlikely) - case IC_DEREF_PP: - case IC_DEREF_MM: - case IC__PP: - case IC__MM: - case IC_PP_: - case IC_MM_: - if (tempi1->ic_code==IC_LEA) { - if (tempi1->a1.type&MDF_DISP && tempi1->a1.reg==REG_RBP) { - i=CmpOffset2Reg(tempi1->a1.disp,reg_offsets); - if (i>=0) { - tempi->ic_flags|=tempi1->ic_flags; - tempi->a1.type=MDF_REG+tempi->a1.type.raw_type; - tempi->a1.reg=i; - tempi->a1.disp=0; - tempi->ic_flags|=ICF_BY_VAL; - OptSetNOP2(tempi1); - } else - goto p4_lea_gone; - } else { -p4_lea_gone: - tempi->ic_flags|=tempi1->ic_flags; - tempi->a1.type=tempi1->a1.type; - tempi->a1.reg=tempi1->a1.reg; - tempi->a1.disp=tempi1->a1.disp; - tempi->ic_flags|=ICF_BY_VAL; - OptSetNOP2(tempi1); - } - } else if ((tempi1->ic_code==IC_ABS_ADDR || tempi1->ic_code==IC_MOV && - tempi1->a1.type==MDF_IMM+RT_I64 && - 0<=tempi1->a1.disp<=MAX_I32)&& !(tempi1->ic_flags&ICF_NO_RIP)) { - tempi->ic_flags|=tempi1->ic_flags; - if (tempi1->ic_code==IC_ABS_ADDR) - tempi->a1.disp=tempi1->ic_data; - else - tempi->a1.disp=tempi1->a1.disp; - tempi->a1.type=MDF_RIP_DISP32+tempi->a1_type_pointed_to; - tempi->a1.reg=REG_RIP; - tempi->ic_flags|=ICF_BY_VAL; - OptFree(tempi1); - } - break; - case IC_ADD: - if (tempi1->ic_code==IC_MOV && tempi1->a1.type==MDF_REG+RT_I64 || - tempi1->ic_code==IC_REG) { - if (tempi2->ic_code==IC_MOV && tempi2->a1.type==MDF_REG+RT_I64 || - tempi2->ic_code==IC_REG) { - if (tempi2->a1.reg!=REG_RSP) { - tempi->a1.disp=0; - tempi->a1.reg=tempi1->a1.reg+tempi2->a1.reg<<8; - goto p4_sib; - } else if (tempi1->a1.reg!=REG_RSP) { - tempi->a1.disp=0; - tempi->a1.reg=tempi2->a1.reg+tempi1->a1.reg<<8; -p4_sib: - tempi->ic_flags|=(tempi1->ic_flags|tempi2->ic_flags) - &ICG_NO_CVT_MASK; - OptSetNOP2(tempi1); - OptFree(tempi2); - - tempi->ic_code=IC_LEA; - tempi->a1.type=MDF_SIB+RT_I64; - tempi->a1_type_pointed_to=RT_I64; - - tempi->a2.type=MDF_NULL+tempi->a2.type.raw_type; - } - } else if (tempi2->ic_code==IC_SHL_CONST && - tempi2->a1.type==MDF_REG+RT_I64 && tempi2->ic_data<=3) { - if (tempi2->a1.reg!=REG_RSP) { - tempi->a1.disp=0; - tempi->a1.reg=tempi1->a1.reg+tempi2->a1.reg<<8; - if (tempi2->ic_data==1) - tempi->a1.reg|=0x4000; - else if (tempi2->ic_data==2) - tempi->a1.reg|=0x8000; - else - tempi->a1.reg|=0xC000; - goto p4_sib; - } - } - } else if (tempi1->ic_code==IC_LEA && - tempi1->a1.type&MDF_DISP) { - if (tempi1->a1.reg==REG_RBP && - CmpOffset2Reg(tempi1->a1.disp,reg_offsets)>=0) - break; - if (tempi2->ic_code==IC_MOV && tempi2->a1.type==MDF_REG+RT_I64 || - tempi2->ic_code==IC_REG) { - if (tempi2->a1.reg!=REG_RSP) { - tempi->a1.disp=tempi1->a1.disp; - tempi->a1.reg=tempi1->a1.reg+tempi2->a1.reg<<8; - goto p4_sib; - } else if (tempi1->a1.reg!=REG_RSP) { - tempi->a1.disp=tempi1->a1.disp; - tempi->a1.reg=tempi2->a1.reg+tempi1->a1.reg<<8; - goto p4_sib; - } - } else if (tempi2->ic_code==IC_SHL_CONST && - tempi2->a1.type==MDF_REG+RT_I64 && tempi2->ic_data<=3) { - if (tempi2->a1.reg!=REG_RSP) { - tempi->a1.disp=tempi1->a1.disp; - tempi->a1.reg=tempi1->a1.reg+tempi2->a1.reg<<8; - if (tempi2->ic_data==1) - tempi->a1.reg|=0x4000; - else if (tempi2->ic_data==2) - tempi->a1.reg|=0x8000; - else - tempi->a1.reg|=0xC000; - goto p4_sib; - } - } - } - break; - case IC_ASSIGN_PP: - case IC_ASSIGN_MM: -//this val was stashed during pass012 for pointer arithmetic - tempi->ic_class2=tempi->t.class2; //See $LK,"ic_class2",A="FF:::/Compiler/BackB.CPP,ic_class2"$ - case IC_ASSIGN: - case IC_SHL_EQU: - case IC_SHR_EQU: - case IC_MUL_EQU: - case IC_DIV_EQU: - case IC_MOD_EQU: - case IC_AND_EQU: - case IC_OR_EQU: - case IC_XOR_EQU: - case IC_ADD_EQU: - case IC_SUB_EQU: - if (tempi1->ic_code==IC_LEA) { - if (tempi1->a1.type&(MDF_DISP|MDF_SIB)) { - tempi2=tempi->next; - if (tempi1->a1.type&MDF_DISP && tempi1->a1.reg==REG_RBP) { - i=CmpOffset2Reg(tempi1->a1.disp,reg_offsets); - if (i>=0) { - tempi->ic_flags|=tempi1->ic_flags; - tempi->a1.type=MDF_REG+tempi->a1.type.raw_type; - tempi->a1.reg=i; - tempi->a1.disp=0; - OptSetNOP2(tempi1); - } else { - tempi->ic_flags|=tempi1->ic_flags; - tempi->a1.type=MDF_DISP+tempi->a1.type.raw_type; - tempi->a1.reg=REG_RBP; - tempi->a1.disp=tempi1->a1.disp; - OptSetNOP2(tempi1); - } - } else { - tempi->ic_flags|=tempi1->ic_flags; - tempi->a1.type=tempi1->a1.type&MDG_MASK+tempi->a1.type.raw_type; - tempi->a1.reg=tempi1->a1.reg; - tempi->a1.disp=tempi1->a1.disp; - OptSetNOP2(tempi1); - } - if (tempi->r.type&MDF_STK && tempi2->a2.type&MDF_STK && - code!=IC_ASSIGN_PP && code!=IC_ASSIGN_MM) { - tempi->r.type=tempi->a1.type; - tempi->r.reg=tempi->a1.reg; - tempi->r.disp=tempi->a1.disp; - tempi2->a2.type=tempi->a1.type; - tempi2->a2.reg=tempi->a1.reg; - tempi2->a2.disp=tempi->a1.disp; - CmpMinTypePointed(tempi2,tempi->a1_type_pointed_to); - } - tempi->ic_flags|=ICF_BY_VAL; - } - } else if ((tempi1->ic_code==IC_ABS_ADDR || - tempi1->ic_code==IC_MOV && tempi1->a1.type==MDF_IMM+RT_I64 && - 0<=tempi1->a1.disp<=MAX_I32)&& !(tempi1->ic_flags&ICF_NO_RIP)) { - tempi->ic_flags|=tempi1->ic_flags; - if (tempi1->ic_code==IC_ABS_ADDR) - tempi->a1.disp=tempi1->ic_data; - else - tempi->a1.disp=tempi1->a1.disp; - tempi->a1.type=MDF_RIP_DISP32+tempi->a1.type.raw_type; - tempi->a1.reg=REG_RIP; - tempi->ic_flags|=ICF_BY_VAL; - OptSetNOP2(tempi1); - } - break; - case IC_RETURN_VAL: - case IC_RETURN_VAL2: - if (!tempi->ic_class) { - if (_type) { - tempil1=tempi; - while (tempil1=OptLag1(tempil1)) - if (tempil1->ic_class) { - if (tempil1->ic_flags & ICF_R_TO_F64) - *_type=RT_F64; - else if (tempil1->ic_flags & ICF_R_TO_INT) - *_type=RT_I64; - else - *_type=tempil1->ic_class->raw_type; - break; - } - } - tempi->ic_class=cmp.internal_types[RT_I64]; - } else if (_type) - *_type=tempi->ic_class->raw_type; - break; - case IC_NOP1: - tempi=OptFree(tempi); - break; - case IC_BR_BT: - case IC_BR_BTS: - case IC_BR_BTR: - case IC_BR_BTC: - case IC_BR_NOT_BT: - case IC_BR_NOT_BTS: - case IC_BR_NOT_BTR: - case IC_BR_NOT_BTC: - case IC_BT: - case IC_BTS: - case IC_BTR: - case IC_BTC: - case IC_LBTS: - case IC_LBTR: - case IC_LBTC: - if (!(tempi->ic_flags&ICF_BY_VAL)) { - if (tempi2->ic_code==IC_ADDR) { - if (tempi2->a1.type&MDF_STK && - tempi2->r.type&MDF_STK) { - if (tempil2=OptLag1(tempi2)) { - if (tempil2->ic_code==IC_LEA) { - if (tempil2->a1.type&(MDF_IMM|MDG_REG_DISP_SIB_RIP)) { - if (tempi2) { - tempi->ic_flags|=tempi2->ic_flags; - OptFree(tempi2); - } - tempi->ic_flags|=tempil2->ic_flags|ICF_BY_VAL; - tempi->a2.type=tempil2->a1.type; - tempi->a2.reg =tempil2->a1.reg; - tempi->a2.disp=tempil2->a1.disp; - OptFree(tempil2); - } - break; - } else if (tempil2->ic_code!=IC_ABS_ADDR && - !(tempil2->ic_code==IC_MOV && - tempil2->a1.type==MDF_IMM+RT_I64 && - 0<=tempil2->a1.disp<=MAX_I32) || - tempil2->ic_flags&ICF_NO_RIP) - tempil2=NULL; - else { - if (tempil2->ic_code==IC_ABS_ADDR) - tempi->a2.disp=tempil2->ic_data; - else - tempi->a2.disp=tempil2->a1.disp; - } - } - } else { - if (tempi2->a1.type==MDF_IMM+RT_I64 && - 0<=tempi2->a1.disp<=MAX_I32 && - !(tempi2->ic_flags&ICF_NO_RIP)) { - tempil2=tempi2; - tempi2=NULL; - tempi->a2.disp=tempil2->a1.disp; - } else - tempil2=NULL; - } - if (tempil2) { - if (tempi2) { - tempi->ic_flags|=tempi2->ic_flags; - OptFree(tempi2); - } - tempi->ic_flags|=tempil2->ic_flags|ICF_BY_VAL; - tempi->a2.type=MDF_RIP_DISP32+tempi->a2.type.raw_type; - tempi->a2.reg=REG_RIP; - OptFree(tempil2); - } - } else if (tempi2->ic_code==IC_MOV && tempi2->r.type&MDF_STK && - tempi2->a1.type==MDF_IMM+RT_I64 && - 0<=tempi2->a1.disp<=MAX_I32 && - !(tempi2->ic_flags&ICF_NO_RIP)) { - tempi->a2.disp=tempi2->a1.disp; - tempi->ic_flags|=tempi2->ic_flags|ICF_BY_VAL; - tempi->a2.type=MDF_RIP_DISP32+tempi->a2.type.raw_type; - tempi->a2.reg=REG_RIP; - OptFree(tempi2); - } - } - break; - case IC_BR_EQU_EQU ...IC_BR_LESS_EQU: - case IC_BR_EQU_EQU2...IC_BR_LESS_EQU2: - case IC_BR_CARRY: - case IC_BR_NOT_CARRY: - case IC_BR_ZERO: - case IC_BR_NOT_ZERO: - lb=tempi->ic_data; - if (tempi->ic_flags&ICF_PUSH_CMP) { - lb->flags|=CMF_POP_CMP; - lb->fwd=NULL; - } - break; - case IC_LABEL: - lb=tempi->ic_data; - if (lb->use_cnt) - dead_code=FALSE; - break; - case IC_JMP: - case IC_RET: - dead_code=TRUE; - break; - case IC_NOP2: - ps->ptr+=tempi->ic_data; - break; - case IC_CALL_END: - case IC_END_EXP: - if (!(tempil1->ic_flags&ICF_PUSH_RES)) { - if (tempi->ic_flags&ICF_RES_NOT_USED) { - tempil1->ic_flags|=ICF_RES_NOT_USED; - tempil1->r.type=MDF_NULL+tempil1->r.type.raw_type; - } else if (tempi->a1.type&MDF_STK && - tempil1->r.type&MDF_STK) { - tempi->a1.type=MDF_REG+tempi->a1.type.raw_type; - tempi->a1.disp=0; - tempil1->r.type=MDF_REG+tempil1->r.type.raw_type; - tempil1->r.disp=0; - if (intermediate_code_table[tempi->ic_code].arg_cnt==IS_2_ARG) { - tempi->a1.reg=REG_R8; - tempil1->r.reg=REG_R8; - } else { - tempi->a1.reg=REG_RAX; - tempil1->r.reg=REG_RAX; - } - } - } - break; - case IC_STR_CONST: - case IC_FS: - case IC_GS: - case IC_MOV_FS: - case IC_MOV_GS: - case IC_RIP: - case IC_RBP: - case IC_REG: - case IC_COM: - case IC_HOLYC_TYPECAST: - case IC_NOT: - case IC_UNARY_MINUS: - case IC_PUSH_CMP: - case IC_ADD_CONST: - case IC_SUB_CONST: - case IC_ENTER: - case IC_ADD_RSP: - case IC_ADD_RSP1: - case IC_CALL: - case IC_CALL_INDIRECT: - case IC_CALL_INDIRECT2: - case IC_CALL_EXTERN: - case IC_CALL_IMPORT: - case IC_PUSH: - case IC_POP: - case IC_INVLPG: - case IC_CLFLUSH: - case IC_GET_RFLAGS: - case IC_CARRY: - case IC_RDTSC: - case IC_SET_RFLAGS: - case IC_GET_RBP: - case IC_SET_RBP: - case IC_GET_RSP: - case IC_GET_RAX: - case IC_SET_RSP: - case IC_SET_RAX: - case IC_SHL_CONST: - case IC_LEA: - case IC_SHR_CONST: - case IC_POWER: - case IC_SHL: - case IC_SHR: - case IC_MUL: - case IC_DIV: - case IC_MOD: - case IC_AND: - case IC_OR: - case IC_XOR: - case IC_SUB: - case IC_EQU_EQU...IC_LESS_EQU: - case IC_AND_AND: - case IC_OR_OR: - case IC_XOR_XOR: - case IC_GET_LABEL: - case IC_ABS_ADDR: - case IC_HEAP_GLBL: - case IC_ADDR_IMPORT: - case IC_BSF: - case IC_BSR: - case IC_SIGN_I64: - case IC_TOUPPER: - case IC_TO_I64: - case IC_TO_F64: - case IC_TO_BOOL: - case IC_SQR: - case IC_ABS: - case IC_SQRT: - case IC_SIN: - case IC_COS: - case IC_TAN: - case IC_ATAN: - case IC_ABS_I64: - case IC_MIN_I64: - case IC_MAX_I64: - case IC_MIN_U64: - case IC_MAX_U64: - case IC_MOD_U64: - case IC_SQR_I64: - case IC_SQR_U64: - case IC_SWAP_U8: - case IC_SWAP_U16: - case IC_SWAP_U32: - case IC_SWAP_I64: - case IC_QUE_INIT: - case IC_QUE_INS: - case IC_QUE_INS_REV: - case IC_QUE_REM: - case IC_IN_U32: - case IC_IN_U16: - case IC_IN_U8: - case IC_STRLEN: - case IC_OUT_U32: - case IC_OUT_U16: - case IC_OUT_U8: - case IC_NOBOUND_SWITCH: - case IC_SWITCH: - case IC_END: - case IC_ADDR: - case IC_CALL_START: - case IC_LEAVE: - case IC_PUSH_REGS: - case IC_POP_REGS: - case IC_ASM: - case IC_BR_AND_NOT_ZERO: - case IC_BR_AND_ZERO: - case IC_SUB_CALL: - case IC_CALL_END2: - break; - default: - "Pass:%d Missing IC handler\n",cc->pass; - ICPut(cc,tempi); - LexExcept(cc,"Compiler Optimization Error at "); - } - if (tempi) { - while (OptIC4(tempi)); - code=tempi->ic_code; - if (intermediate_code_table[code].res_cnt) - PrsPush(ps,tempi); - } - } - tempi=tempi_next; - } - if (ps->ptr>2) { - "Pass:%d Stk:%08X\n",cc->pass,ps->ptr; - LexExcept(cc,"Compiler Optimization Error at "); - } -} diff --git a/Compiler/OptPass4.HC b/Compiler/OptPass4.HC new file mode 100644 index 0000000..7fa5038 --- /dev/null +++ b/Compiler/OptPass4.HC @@ -0,0 +1,687 @@ +Bool OptIC4(CIntermediateCode *tempi) +{ + I64 i; + CIntermediateCode *tempil1,*tempil2; + + if (tempi->ic_coder.type&MDF_STK && !(tempil2->ic_flags&ICF_PUSH_RES)) { + if (tempil1->ic_code==IC_ADD_CONST && tempil1->a1.type&MDF_STK) { + if ((tempil2->ic_code==IC_REG || tempil2->ic_code==IC_MOV) && + tempil2->a1.type&MDF_REG) { + i=tempil1->ic_data; + if (MIN_I32<=i<=MAX_I32 && + !Bt(&cmp.non_ptr_vars_mask,tempil2->a1.reg)) { + tempil1->ic_flags|=tempil2->ic_flags&ICG_NO_CVT_MASK; + tempil1->ic_code=IC_LEA; + tempil1->a1.type=MDF_DISP+tempil1->a1.type.raw_type; + tempil1->a1.reg=tempil2->a1.reg; + tempil1->a1.disp=i; + OptFree(tempil2); + return TRUE; + } + } else if (tempil2->ic_code==IC_SHL_CONST && tempil2->a1.type&MDF_REG) { + i=tempil1->ic_data; + if (MIN_I32<=i<=MAX_I32 && tempil2->a1.reg!=REG_RSP && + 1<=tempil2->ic_data<=3) { + tempil1->ic_flags|=tempil2->ic_flags&ICG_NO_CVT_MASK; + tempil1->ic_code=IC_LEA; + tempil1->a1.type=MDF_SIB+tempil1->a1.type.raw_type; + tempil1->a1.reg=tempil2->a1.reg<<8+REG_NONE; + if (tempil2->ic_data==1) + tempil1->a1.reg|=0x4000; + else if (tempil2->ic_data==2) + tempil1->a1.reg|=0x8000; + else + tempil1->a1.reg|=0xC000; + tempil1->a1.disp=i; + OptFree(tempil2); + return TRUE; + } + } + } + if (tempil2->ic_code==IC_MOV || tempil2->ic_code==IC_REG) { + if (tempil1->a2.type&MDF_STK) { + if (tempil2->ic_flags & ICF_R_TO_INT) { + if (tempil2->a1.type&MDF_IMM) + tempil2->a1.disp=tempil2->a1.disp(F64); + else + tempil1->ic_flags|=ICF_A2_TO_INT; + } else if (tempil2->ic_flags&ICF_R_TO_F64) { + if (tempil2->a1.type&MDF_IMM) + tempil2->a1.disp(F64)=tempil2->a1.disp; + else + tempil1->ic_flags|=ICF_A2_TO_F64; + } + tempil1->a2.type=tempil2->a1.type&MDG_MASK+ + MinI64(tempil1->a2.type.raw_type, + MinI64(tempil2->r.type.raw_type,tempil2->a1.type.raw_type)); + tempil1->a2.reg=tempil2->a1.reg; + tempil1->a2.disp=tempil2->a1.disp; + tempil1->ic_flags|=tempil2->ic_flags&ICG_NO_CVT_MASK; + OptSetNOP2(tempil2); + return TRUE; + } + if (tempil1->a1.type&MDF_STK) { + if (tempil2->ic_flags & ICF_R_TO_INT) { + if (tempil2->a1.type&MDF_IMM) + tempil2->a1.disp=tempil2->a1.disp(F64); + else + tempil1->ic_flags|=ICF_A1_TO_INT; + } else if (tempil2->ic_flags&ICF_R_TO_F64) { + if (tempil2->a1.type&MDF_IMM) { + if (tempil2->a1.type&RTF_UNSIGNED) + tempil2->a1.disp(F64)=tempil2->a1.disp(U64); + else + tempil2->a1.disp(F64)=tempil2->a1.disp(I64); + } else + tempil1->ic_flags|=ICF_A1_TO_F64; + } + tempil1->a1.type=tempil2->a1.type&MDG_MASK+ + MinI64(tempil1->a1.type.raw_type, + MinI64(tempil2->r.type.raw_type,tempil2->a1.type.raw_type)); + CmpMinTypePointed(tempil1,tempil2->a1_type_pointed_to); + tempil1->a1.reg=tempil2->a1.reg; + tempil1->a1.disp=tempil2->a1.disp; + tempil1->ic_flags|=tempil2->ic_flags&ICG_NO_CVT_MASK; + OptSetNOP2(tempil2); + return TRUE; + } + } + if (tempil1->ic_code==IC_DEREF) { + if (tempil2->ic_code==IC_ADD_CONST && tempil2->a1.type&MDF_REG && + tempil1->a1.type&MDF_STK) { + i=tempil2->ic_data; + if (MIN_I32<=i<=MAX_I32 && + !Bt(&cmp.non_ptr_vars_mask,tempil2->a1.reg)) { + tempil1->ic_flags|=tempil2->ic_flags; + tempil1->ic_code=IC_MOV; + tempil1->a1.type=MDF_DISP+tempil1->a1_type_pointed_to; + tempil1->a1.reg=tempil2->a1.reg; + tempil1->a1.disp=i; + OptSetNOP2(tempil2,-1); + return TRUE; + } + } + if (tempil2->ic_code==IC_LEA && tempil1->a1.type&MDF_STK) { + tempil1->ic_flags|=tempil2->ic_flags; + tempil1->ic_code=IC_MOV; + tempil1->a1.type=tempil2->a1.type&MDG_MASK+tempil1->a1_type_pointed_to; + tempil1->a1.reg=tempil2->a1.reg; + tempil1->a1.disp=tempil2->a1.disp; + OptFree(tempil2); + return TRUE; + } + } + } + if (tempil1->ic_code==IC_DEREF) { + if (tempil1->a1.type&MDF_REG) { + tempil1->a1.type=MDF_DISP+tempil1->a1_type_pointed_to; + tempil1->a1.disp=0; + tempil1->ic_code=IC_MOV; + return TRUE; + } + } + return FALSE; +} + +U0 OptPass4(CCmpCtrl *cc,COptReg *reg_offsets,I64 *_type) +{ + CHashClass *tempc,*tempc1,*tempc2; + CIntermediateCode *tempi,*tempi1,*tempi2,*tempil1,*tempil2,*tempil3, + *tempi_next; + I64 code,i; + Bool dead_code=FALSE; + CCodeMisc *lb; + CPrsStk *ps=cc->ps; + ps->ptr=0; + ps->ptr2=0; + + if (_type) + *_type=RT_I64; + + tempi=cc->coc.coc_head.next; + while (code=tempi->ic_code) { + tempi_next=tempi->next; + if (dead_code&&code!=IC_LABEL) { + if (code==IC_JMP||code==IC_SUB_CALL) { + lb=OptLabelFwd(tempi->ic_data); + if (lb->use_cnt>0) + lb->use_cnt--; + } + tempi=OptFree(tempi); + } else { + tempc=tempi->ic_class; + tempi1=tempi2=&cmp.ic_nop; + if (tempil1=OptLag2(tempi)) { + if (tempil2=OptLag2(tempil1)) { + if (!(tempil3=OptLag2(tempil2))) + tempil3=&cmp.ic_nop; + } else + tempil2=tempil3=&cmp.ic_nop; + } else + tempil1=tempil2=tempil3=&cmp.ic_nop; + switch [intermediate_code_table[code].arg_cnt] { + case IS_V_ARG: + ps->ptr-=tempi->ic_data>>3; + break; + case IS_2_ARG: + tempi2=PrsPop(ps); + tempc2=tempi2->ic_class; + case IS_1_ARG: + tempi1=PrsPop(ps); + tempc1=tempi1->ic_class; + break; + case IS_0_ARG: //nobound switch + break; + } + switch [code] { + case IC_IMM_I64: + case IC_TYPE: + tempi->a1.type=MDF_IMM+RT_I64; + tempi->a1.disp=tempi->ic_data; + tempi->ic_code=IC_MOV; + break; + case IC_IMM_F64: + tempi->a1.type=MDF_IMM+RT_I64; + tempi->a1.disp=tempi->ic_data; + tempi->a1_type_pointed_to=RT_F64; + tempi->ic_code=IC_MOV; + break; + case IC_MOV: + if (tempi->a1.type&MDF_DISP && tempi->a1.reg==REG_RBP) { + i=CmpOffset2Reg(tempi->a1.disp,reg_offsets); + if (i>=0) { + tempi->a1.type=MDF_REG+tempi->a1.type.raw_type; + tempi->a1.reg=i; + tempi->a1.disp=0; + } + } + break; + case IC_DEREF: + if (tempi1->ic_code==IC_LEA) { + if (tempi1->a1.type&MDF_DISP && tempi1->a1.reg==REG_RBP) { + i=CmpOffset2Reg(tempi1->a1.disp,reg_offsets); + if (i>=0) { + tempi->ic_flags|=tempi1->ic_flags; + tempi->ic_code=IC_REG; + tempi->a1.type=MDF_REG+tempi->a1.type.raw_type; + tempi->a1.reg=i; + tempi->a1.disp=0; + OptFree(tempi1); + } + } + } else if ((tempi1->ic_code==IC_ABS_ADDR || + tempi1->ic_code==IC_MOV && + tempi1->a1.type==MDF_IMM+RT_I64 && + 0<=tempi1->a1.disp<=MAX_I32)&& !(tempi1->ic_flags&ICF_NO_RIP)) { + if (tempi1->ic_code==IC_ABS_ADDR) + tempi->a1.disp=tempi1->ic_data; + else + tempi->a1.disp=tempi1->a1.disp; + tempi->ic_flags|=tempi1->ic_flags; + tempi->ic_code=IC_MOV; + tempi->a1.type=MDF_RIP_DISP32+tempi->a1_type_pointed_to; + tempi->a1.reg=REG_RIP; + OptFree(tempi1); + } + break; + case IC_BR_MM_ZERO: + case IC_BR_MM_NOT_ZERO: +//(branch ++ to zero is unlikely) + case IC_DEREF_PP: + case IC_DEREF_MM: + case IC__PP: + case IC__MM: + case IC_PP_: + case IC_MM_: + if (tempi1->ic_code==IC_LEA) { + if (tempi1->a1.type&MDF_DISP && tempi1->a1.reg==REG_RBP) { + i=CmpOffset2Reg(tempi1->a1.disp,reg_offsets); + if (i>=0) { + tempi->ic_flags|=tempi1->ic_flags; + tempi->a1.type=MDF_REG+tempi->a1.type.raw_type; + tempi->a1.reg=i; + tempi->a1.disp=0; + tempi->ic_flags|=ICF_BY_VAL; + OptSetNOP2(tempi1); + } else + goto p4_lea_gone; + } else { +p4_lea_gone: + tempi->ic_flags|=tempi1->ic_flags; + tempi->a1.type=tempi1->a1.type; + tempi->a1.reg=tempi1->a1.reg; + tempi->a1.disp=tempi1->a1.disp; + tempi->ic_flags|=ICF_BY_VAL; + OptSetNOP2(tempi1); + } + } else if ((tempi1->ic_code==IC_ABS_ADDR || tempi1->ic_code==IC_MOV && + tempi1->a1.type==MDF_IMM+RT_I64 && + 0<=tempi1->a1.disp<=MAX_I32)&& !(tempi1->ic_flags&ICF_NO_RIP)) { + tempi->ic_flags|=tempi1->ic_flags; + if (tempi1->ic_code==IC_ABS_ADDR) + tempi->a1.disp=tempi1->ic_data; + else + tempi->a1.disp=tempi1->a1.disp; + tempi->a1.type=MDF_RIP_DISP32+tempi->a1_type_pointed_to; + tempi->a1.reg=REG_RIP; + tempi->ic_flags|=ICF_BY_VAL; + OptFree(tempi1); + } + break; + case IC_ADD: + if (tempi1->ic_code==IC_MOV && tempi1->a1.type==MDF_REG+RT_I64 || + tempi1->ic_code==IC_REG) { + if (tempi2->ic_code==IC_MOV && tempi2->a1.type==MDF_REG+RT_I64 || + tempi2->ic_code==IC_REG) { + if (tempi2->a1.reg!=REG_RSP) { + tempi->a1.disp=0; + tempi->a1.reg=tempi1->a1.reg+tempi2->a1.reg<<8; + goto p4_sib; + } else if (tempi1->a1.reg!=REG_RSP) { + tempi->a1.disp=0; + tempi->a1.reg=tempi2->a1.reg+tempi1->a1.reg<<8; +p4_sib: + tempi->ic_flags|=(tempi1->ic_flags|tempi2->ic_flags) + &ICG_NO_CVT_MASK; + OptSetNOP2(tempi1); + OptFree(tempi2); + + tempi->ic_code=IC_LEA; + tempi->a1.type=MDF_SIB+RT_I64; + tempi->a1_type_pointed_to=RT_I64; + + tempi->a2.type=MDF_NULL+tempi->a2.type.raw_type; + } + } else if (tempi2->ic_code==IC_SHL_CONST && + tempi2->a1.type==MDF_REG+RT_I64 && tempi2->ic_data<=3) { + if (tempi2->a1.reg!=REG_RSP) { + tempi->a1.disp=0; + tempi->a1.reg=tempi1->a1.reg+tempi2->a1.reg<<8; + if (tempi2->ic_data==1) + tempi->a1.reg|=0x4000; + else if (tempi2->ic_data==2) + tempi->a1.reg|=0x8000; + else + tempi->a1.reg|=0xC000; + goto p4_sib; + } + } + } else if (tempi1->ic_code==IC_LEA && + tempi1->a1.type&MDF_DISP) { + if (tempi1->a1.reg==REG_RBP && + CmpOffset2Reg(tempi1->a1.disp,reg_offsets)>=0) + break; + if (tempi2->ic_code==IC_MOV && tempi2->a1.type==MDF_REG+RT_I64 || + tempi2->ic_code==IC_REG) { + if (tempi2->a1.reg!=REG_RSP) { + tempi->a1.disp=tempi1->a1.disp; + tempi->a1.reg=tempi1->a1.reg+tempi2->a1.reg<<8; + goto p4_sib; + } else if (tempi1->a1.reg!=REG_RSP) { + tempi->a1.disp=tempi1->a1.disp; + tempi->a1.reg=tempi2->a1.reg+tempi1->a1.reg<<8; + goto p4_sib; + } + } else if (tempi2->ic_code==IC_SHL_CONST && + tempi2->a1.type==MDF_REG+RT_I64 && tempi2->ic_data<=3) { + if (tempi2->a1.reg!=REG_RSP) { + tempi->a1.disp=tempi1->a1.disp; + tempi->a1.reg=tempi1->a1.reg+tempi2->a1.reg<<8; + if (tempi2->ic_data==1) + tempi->a1.reg|=0x4000; + else if (tempi2->ic_data==2) + tempi->a1.reg|=0x8000; + else + tempi->a1.reg|=0xC000; + goto p4_sib; + } + } + } + break; + case IC_ASSIGN_PP: + case IC_ASSIGN_MM: +//this val was stashed during pass012 for pointer arithmetic + tempi->ic_class2=tempi->t.class2; //See $LK,"ic_class2",A="FF:::/Compiler/BackB.HC,ic_class2"$ + case IC_ASSIGN: + case IC_SHL_EQU: + case IC_SHR_EQU: + case IC_MUL_EQU: + case IC_DIV_EQU: + case IC_MOD_EQU: + case IC_AND_EQU: + case IC_OR_EQU: + case IC_XOR_EQU: + case IC_ADD_EQU: + case IC_SUB_EQU: + if (tempi1->ic_code==IC_LEA) { + if (tempi1->a1.type&(MDF_DISP|MDF_SIB)) { + tempi2=tempi->next; + if (tempi1->a1.type&MDF_DISP && tempi1->a1.reg==REG_RBP) { + i=CmpOffset2Reg(tempi1->a1.disp,reg_offsets); + if (i>=0) { + tempi->ic_flags|=tempi1->ic_flags; + tempi->a1.type=MDF_REG+tempi->a1.type.raw_type; + tempi->a1.reg=i; + tempi->a1.disp=0; + OptSetNOP2(tempi1); + } else { + tempi->ic_flags|=tempi1->ic_flags; + tempi->a1.type=MDF_DISP+tempi->a1.type.raw_type; + tempi->a1.reg=REG_RBP; + tempi->a1.disp=tempi1->a1.disp; + OptSetNOP2(tempi1); + } + } else { + tempi->ic_flags|=tempi1->ic_flags; + tempi->a1.type=tempi1->a1.type&MDG_MASK+tempi->a1.type.raw_type; + tempi->a1.reg=tempi1->a1.reg; + tempi->a1.disp=tempi1->a1.disp; + OptSetNOP2(tempi1); + } + if (tempi->r.type&MDF_STK && tempi2->a2.type&MDF_STK && + code!=IC_ASSIGN_PP && code!=IC_ASSIGN_MM) { + tempi->r.type=tempi->a1.type; + tempi->r.reg=tempi->a1.reg; + tempi->r.disp=tempi->a1.disp; + tempi2->a2.type=tempi->a1.type; + tempi2->a2.reg=tempi->a1.reg; + tempi2->a2.disp=tempi->a1.disp; + CmpMinTypePointed(tempi2,tempi->a1_type_pointed_to); + } + tempi->ic_flags|=ICF_BY_VAL; + } + } else if ((tempi1->ic_code==IC_ABS_ADDR || + tempi1->ic_code==IC_MOV && tempi1->a1.type==MDF_IMM+RT_I64 && + 0<=tempi1->a1.disp<=MAX_I32)&& !(tempi1->ic_flags&ICF_NO_RIP)) { + tempi->ic_flags|=tempi1->ic_flags; + if (tempi1->ic_code==IC_ABS_ADDR) + tempi->a1.disp=tempi1->ic_data; + else + tempi->a1.disp=tempi1->a1.disp; + tempi->a1.type=MDF_RIP_DISP32+tempi->a1.type.raw_type; + tempi->a1.reg=REG_RIP; + tempi->ic_flags|=ICF_BY_VAL; + OptSetNOP2(tempi1); + } + break; + case IC_RETURN_VAL: + case IC_RETURN_VAL2: + if (!tempi->ic_class) { + if (_type) { + tempil1=tempi; + while (tempil1=OptLag1(tempil1)) + if (tempil1->ic_class) { + if (tempil1->ic_flags & ICF_R_TO_F64) + *_type=RT_F64; + else if (tempil1->ic_flags & ICF_R_TO_INT) + *_type=RT_I64; + else + *_type=tempil1->ic_class->raw_type; + break; + } + } + tempi->ic_class=cmp.internal_types[RT_I64]; + } else if (_type) + *_type=tempi->ic_class->raw_type; + break; + case IC_NOP1: + tempi=OptFree(tempi); + break; + case IC_BR_BT: + case IC_BR_BTS: + case IC_BR_BTR: + case IC_BR_BTC: + case IC_BR_NOT_BT: + case IC_BR_NOT_BTS: + case IC_BR_NOT_BTR: + case IC_BR_NOT_BTC: + case IC_BT: + case IC_BTS: + case IC_BTR: + case IC_BTC: + case IC_LBTS: + case IC_LBTR: + case IC_LBTC: + if (!(tempi->ic_flags&ICF_BY_VAL)) { + if (tempi2->ic_code==IC_ADDR) { + if (tempi2->a1.type&MDF_STK && + tempi2->r.type&MDF_STK) { + if (tempil2=OptLag1(tempi2)) { + if (tempil2->ic_code==IC_LEA) { + if (tempil2->a1.type&(MDF_IMM|MDG_REG_DISP_SIB_RIP)) { + if (tempi2) { + tempi->ic_flags|=tempi2->ic_flags; + OptFree(tempi2); + } + tempi->ic_flags|=tempil2->ic_flags|ICF_BY_VAL; + tempi->a2.type=tempil2->a1.type; + tempi->a2.reg =tempil2->a1.reg; + tempi->a2.disp=tempil2->a1.disp; + OptFree(tempil2); + } + break; + } else if (tempil2->ic_code!=IC_ABS_ADDR && + !(tempil2->ic_code==IC_MOV && + tempil2->a1.type==MDF_IMM+RT_I64 && + 0<=tempil2->a1.disp<=MAX_I32) || + tempil2->ic_flags&ICF_NO_RIP) + tempil2=NULL; + else { + if (tempil2->ic_code==IC_ABS_ADDR) + tempi->a2.disp=tempil2->ic_data; + else + tempi->a2.disp=tempil2->a1.disp; + } + } + } else { + if (tempi2->a1.type==MDF_IMM+RT_I64 && + 0<=tempi2->a1.disp<=MAX_I32 && + !(tempi2->ic_flags&ICF_NO_RIP)) { + tempil2=tempi2; + tempi2=NULL; + tempi->a2.disp=tempil2->a1.disp; + } else + tempil2=NULL; + } + if (tempil2) { + if (tempi2) { + tempi->ic_flags|=tempi2->ic_flags; + OptFree(tempi2); + } + tempi->ic_flags|=tempil2->ic_flags|ICF_BY_VAL; + tempi->a2.type=MDF_RIP_DISP32+tempi->a2.type.raw_type; + tempi->a2.reg=REG_RIP; + OptFree(tempil2); + } + } else if (tempi2->ic_code==IC_MOV && tempi2->r.type&MDF_STK && + tempi2->a1.type==MDF_IMM+RT_I64 && + 0<=tempi2->a1.disp<=MAX_I32 && + !(tempi2->ic_flags&ICF_NO_RIP)) { + tempi->a2.disp=tempi2->a1.disp; + tempi->ic_flags|=tempi2->ic_flags|ICF_BY_VAL; + tempi->a2.type=MDF_RIP_DISP32+tempi->a2.type.raw_type; + tempi->a2.reg=REG_RIP; + OptFree(tempi2); + } + } + break; + case IC_BR_EQU_EQU ...IC_BR_LESS_EQU: + case IC_BR_EQU_EQU2...IC_BR_LESS_EQU2: + case IC_BR_CARRY: + case IC_BR_NOT_CARRY: + case IC_BR_ZERO: + case IC_BR_NOT_ZERO: + lb=tempi->ic_data; + if (tempi->ic_flags&ICF_PUSH_CMP) { + lb->flags|=CMF_POP_CMP; + lb->fwd=NULL; + } + break; + case IC_LABEL: + lb=tempi->ic_data; + if (lb->use_cnt) + dead_code=FALSE; + break; + case IC_JMP: + case IC_RET: + dead_code=TRUE; + break; + case IC_NOP2: + ps->ptr+=tempi->ic_data; + break; + case IC_CALL_END: + case IC_END_EXP: + if (!(tempil1->ic_flags&ICF_PUSH_RES)) { + if (tempi->ic_flags&ICF_RES_NOT_USED) { + tempil1->ic_flags|=ICF_RES_NOT_USED; + tempil1->r.type=MDF_NULL+tempil1->r.type.raw_type; + } else if (tempi->a1.type&MDF_STK && + tempil1->r.type&MDF_STK) { + tempi->a1.type=MDF_REG+tempi->a1.type.raw_type; + tempi->a1.disp=0; + tempil1->r.type=MDF_REG+tempil1->r.type.raw_type; + tempil1->r.disp=0; + if (intermediate_code_table[tempi->ic_code].arg_cnt==IS_2_ARG) { + tempi->a1.reg=REG_R8; + tempil1->r.reg=REG_R8; + } else { + tempi->a1.reg=REG_RAX; + tempil1->r.reg=REG_RAX; + } + } + } + break; + case IC_STR_CONST: + case IC_FS: + case IC_GS: + case IC_MOV_FS: + case IC_MOV_GS: + case IC_RIP: + case IC_RBP: + case IC_REG: + case IC_COM: + case IC_HOLYC_TYPECAST: + case IC_NOT: + case IC_UNARY_MINUS: + case IC_PUSH_CMP: + case IC_ADD_CONST: + case IC_SUB_CONST: + case IC_ENTER: + case IC_ADD_RSP: + case IC_ADD_RSP1: + case IC_CALL: + case IC_CALL_INDIRECT: + case IC_CALL_INDIRECT2: + case IC_CALL_EXTERN: + case IC_CALL_IMPORT: + case IC_PUSH: + case IC_POP: + case IC_INVLPG: + case IC_CLFLUSH: + case IC_GET_RFLAGS: + case IC_CARRY: + case IC_RDTSC: + case IC_SET_RFLAGS: + case IC_GET_RBP: + case IC_SET_RBP: + case IC_GET_RSP: + case IC_GET_RAX: + case IC_SET_RSP: + case IC_SET_RAX: + case IC_SHL_CONST: + case IC_LEA: + case IC_SHR_CONST: + case IC_POWER: + case IC_SHL: + case IC_SHR: + case IC_MUL: + case IC_DIV: + case IC_MOD: + case IC_AND: + case IC_OR: + case IC_XOR: + case IC_SUB: + case IC_EQU_EQU...IC_LESS_EQU: + case IC_AND_AND: + case IC_OR_OR: + case IC_XOR_XOR: + case IC_GET_LABEL: + case IC_ABS_ADDR: + case IC_HEAP_GLBL: + case IC_ADDR_IMPORT: + case IC_BSF: + case IC_BSR: + case IC_SIGN_I64: + case IC_TOUPPER: + case IC_TO_I64: + case IC_TO_F64: + case IC_TO_BOOL: + case IC_SQR: + case IC_ABS: + case IC_SQRT: + case IC_SIN: + case IC_COS: + case IC_TAN: + case IC_ATAN: + case IC_ABS_I64: + case IC_MIN_I64: + case IC_MAX_I64: + case IC_MIN_U64: + case IC_MAX_U64: + case IC_MOD_U64: + case IC_SQR_I64: + case IC_SQR_U64: + case IC_SWAP_U8: + case IC_SWAP_U16: + case IC_SWAP_U32: + case IC_SWAP_I64: + case IC_QUE_INIT: + case IC_QUE_INS: + case IC_QUE_INS_REV: + case IC_QUE_REM: + case IC_IN_U32: + case IC_IN_U16: + case IC_IN_U8: + case IC_STRLEN: + case IC_OUT_U32: + case IC_OUT_U16: + case IC_OUT_U8: + case IC_NOBOUND_SWITCH: + case IC_SWITCH: + case IC_END: + case IC_ADDR: + case IC_CALL_START: + case IC_LEAVE: + case IC_PUSH_REGS: + case IC_POP_REGS: + case IC_ASM: + case IC_BR_AND_NOT_ZERO: + case IC_BR_AND_ZERO: + case IC_SUB_CALL: + case IC_CALL_END2: + break; + default: + "Pass:%d Missing IC handler\n",cc->pass; + ICPut(cc,tempi); + LexExcept(cc,"Compiler Optimization Error at "); + } + if (tempi) { + while (OptIC4(tempi)); + code=tempi->ic_code; + if (intermediate_code_table[code].res_cnt) + PrsPush(ps,tempi); + } + } + tempi=tempi_next; + } + if (ps->ptr>2) { + "Pass:%d Stk:%08X\n",cc->pass,ps->ptr; + LexExcept(cc,"Compiler Optimization Error at "); + } +} diff --git a/Compiler/OptPass5.CPP b/Compiler/OptPass5.HC similarity index 100% rename from Compiler/OptPass5.CPP rename to Compiler/OptPass5.HC diff --git a/Compiler/OptPass6.CPP b/Compiler/OptPass6.HC similarity index 100% rename from Compiler/OptPass6.CPP rename to Compiler/OptPass6.HC diff --git a/Compiler/OptPass789A.CPP b/Compiler/OptPass789A.HC similarity index 100% rename from Compiler/OptPass789A.CPP rename to Compiler/OptPass789A.HC diff --git a/Compiler/PrsExp.CPP b/Compiler/PrsExp.HC similarity index 100% rename from Compiler/PrsExp.CPP rename to Compiler/PrsExp.HC diff --git a/Compiler/PrsLib.CPP b/Compiler/PrsLib.CPP deleted file mode 100644 index 345baa6..0000000 --- a/Compiler/PrsLib.CPP +++ /dev/null @@ -1,323 +0,0 @@ -U0 PrsPush(CPrsStk *ps,I64 val) -{ - ps->stk[++ps->ptr]=val; -} - -I64 PrsPop(CPrsStk *ps) -{ - return ps->stk[ps->ptr--]; -} - -U0 PrsPush2(CPrsStk *ps,I64 val) -{ - ps->stk2[++ps->ptr2]=val; -} - -I64 PrsPop2(CPrsStk *ps) -{ - return ps->stk2[ps->ptr2--]; -} - -U0 PrsPopDeref(CPrsStk *ps) -{ - I64 i=PrsPop(ps); - CHashClass *tempc=PrsPop(ps); - if (i.u16[0]!=IC_DEREF) { - PrsPush(ps,tempc); - PrsPush(ps,i); - } -} - -I64 PrsKeyWord(CCmpCtrl *cc) -{//Cvt cur token to $LK,"KEYWORD",A="FF:::/Compiler/OpCodes.TXT,KEYWORD"$ or -1. - CHashGeneric *temph; - if (cc->token==TK_IDENT &&(temph=cc->hash_entry) && temph->type&HTT_KEYWORD) - return temph->user_data0; - else - return -1; -} - -CHashClass *PrsClassNew() -{/*Ptrs to classes are handled by -allocating 5 structures for each -new class and representing a pointer -to a class by advancing 1 struct fwd -for one * and two fwd for two **. -*/ - I64 i; - CHashClass *res=CAlloc(sizeof(CHashClass)*(MAX_PTR_STARS+1),Fs->code_heap), - *tempc=res; - for (i=0;i<=MAX_PTR_STARS;i++) { - tempc->type=HTT_CLASS; - tempc->raw_type=RT_PTR; - tempc->size=sizeof(U8 *); - tempc->ptr_stars_cnt=i; - tempc++; - } - res->last_in_member_lst=&res->member_lst_and_root; - res->size=0; - return res; -} - -CHashFun *PrsFunNew() -{ - I64 i; - CHashFun *res=CAlloc(sizeof(CHashFun)*(MAX_PTR_STARS+1),Fs->code_heap), - *tempf=res; - for (i=0;i<=MAX_PTR_STARS;i++) { - tempf->type=HTT_FUN; - tempf->raw_type=RT_PTR; - tempf->size=sizeof(U8 *); - tempf->ptr_stars_cnt=i; - tempf++; - } - res->last_in_member_lst=&res->member_lst_and_root; - res->size=0; - return res; -} - -CIntermediateCode *ICAdd(CCmpCtrl *cc, - I64 opcode_and_precedence,I64 arg, CHashClass *c,I64 flags=0) -{ - CIntermediateCode *tempi=MAlloc(sizeof(CIntermediateCode)); - tempi->ic_code=opcode_and_precedence.u16[0]; - tempi->ic_precedence=opcode_and_precedence.u16[1]; - tempi->ic_data=arg; - tempi->ic_class=c; - if (cc->pass_trace) { - Bts(&cc->flags,CCf_PASS_TRACE_PRESENT); - flags|=ICF_PASS_TRACE; - } - if (cc->lock_cnt) - flags|=ICF_LOCK; - tempi->ic_flags=flags; - tempi->ic_line=cc->last_line_num; - QueIns(tempi,cc->coc.coc_head.last); - return tempi; -} - -U0 COCInit(CCmpCtrl *cc) -{ - CCodeCtrl *tempcbh=&cc->coc; - QueInit(&tempcbh->coc_head.next); - QueInit(&tempcbh->coc_next_misc); - tempcbh->coc_head.ic_code=IC_END; -} - -U0 COCPush(CCmpCtrl *cc) -{ - CCodeCtrl *tempcbh=MAlloc(sizeof(CCodeCtrl)); - MemCpy(tempcbh,&cc->coc,sizeof(CCodeCtrl)); - cc->coc.coc_next=tempcbh; -} - -CCmpCtrl *COCPopNoFree(CCmpCtrl *cc) -{ - CCodeCtrl *tempcbh=cc->coc.coc_next; - MemCpy(&cc->coc,tempcbh,sizeof(CCodeCtrl)); - return tempcbh; -} - -U0 COCPop(CCmpCtrl *cc) -{ - Free(COCPopNoFree(cc)); -} - -U0 COCAppend(CCmpCtrl *cc, CCodeCtrl *tempcbh) -{ - if (tempcbh->coc_head.next!=&cc->coc.coc_head.next) { - cc->coc.coc_head.last->next=tempcbh->coc_head.next; - tempcbh->coc_head.next->last=cc->coc.coc_head.last; - cc->coc.coc_head.last=tempcbh->coc_head.last; - tempcbh->coc_head.last->next=&cc->coc.coc_head.next; - } - if (tempcbh->coc_next_misc!=&cc->coc.coc_next_misc) { - cc->coc.coc_last_misc->next=tempcbh->coc_next_misc; - tempcbh->coc_next_misc->last=cc->coc.coc_last_misc; - cc->coc.coc_last_misc=tempcbh->coc_last_misc; - tempcbh->coc_last_misc->next=&cc->coc.coc_next_misc; - } - Free(tempcbh); -} - -CCodeMisc *COCMiscNew(CCmpCtrl *cc,I64 ty) -{ - CCodeMisc *res=CAlloc(sizeof(CCodeMisc)); - res->addr=INVALID_PTR; - res->type=ty; - QueIns(res,cc->coc.coc_last_misc); - return res; -} - -CCodeMisc *COCGoToLabelFind(CCmpCtrl *cc,U8 *name) -{ - CCodeMisc *cm=cc->coc.coc_next_misc; - while (cm!=&cc->coc.coc_next_misc) { - if ((cm->type==CMT_GOTO_LABEL||cm->type==CMT_ASM_LABEL) && - !StrCmp(cm->str,name)) - return cm; - cm=cm->next; - } - return NULL; -} - -I64 COCFloatConstFind(CCmpCtrl *cc,F64 d) -{ - I64 i; - CCodeMisc *cm=cc->coc.coc_next_misc; - while (cm!=&cc->coc.coc_next_misc) { - if (cm->type==CMT_FLOAT_CONSTS) { - for (i=0;inum_consts;i++) - if (cm->float_consts[i]==d) - return cm->addr+i*sizeof(F64); - if (cm->num_constsfloat_consts[cm->num_consts++]=d; - return cm->addr+i*sizeof(F64); - } - } - cm=cm->next; - } - cm=COCMiscNew(cc,CMT_FLOAT_CONSTS); - cm->float_consts=MAlloc(CM_MAX_CONSTS*sizeof(F64)); - cm->float_consts[cm->num_consts++]=d; - return cm->addr; -} - -U0 COCDel(CCmpCtrl *cc,CCodeCtrl *coc) -{ - CCodeMisc *cm,*cm1; - U8 *undef=NULL; - QueDel(&coc->coc_head.next); - cm=coc->coc_next_misc; - while (cm!=&coc->coc_next_misc) { - cm1=cm->next; - switch (cm->type) { - case CMT_GOTO_LABEL: - case CMT_ASM_LABEL: - if (!(cm->flags&CMF_DEFINED)) { - undef=cm->str; - cm->str=NULL; - } else if (!cm->use_cnt) { - PrintWarn("Unused label %s\n",cm->str); - LexWarn(cc,"Unused label at "); - } - break; - case CMT_JMP_TABLE: - Free(cm->jmp_table); - break; - case CMT_FLOAT_CONSTS: - Free(cm->float_consts); - break; - case CMT_ARRAY_DIM: - LinkedLstDel(cm->dim); - break; - case CMT_HASH_ENTRY: - HashDel(cm->h); - break; - } - Free(cm->str); - Free(cm); - cm=cm1; - } - if (undef) { - PrintErr("Undefined goto label %s\n",undef); - Free(undef); - LexExcept(cc,"Undefined goto label at "); - } -} - -U0 COCHeaderPut(CCmpCtrl *cc,I64 pass,Bool put) -{ - CIntermediateCode *tempi; - if (Bt(&cc->flags,CCf_PASS_TRACE_PRESENT)) { - if (put) { - if (Bt(&cc->saved_pass_trace,pass-1)) { - "$$IV,1$$Pass %d:$$IV,0$$\n",pass-1; - tempi=cc->coc.coc_head.next; - while (tempi->ic_code) { - if (tempi->ic_flags&ICF_PASS_TRACE) - ICPut(cc,tempi); - tempi=tempi->next; - } - } - } else if (Bt(&cc->saved_pass_trace,pass)) - "$$IV,1$$Pass %d:$$IV,0$$\n",pass; - } - cc->pass=pass; -} - -U8 *COCCompile(CCmpCtrl *cc,I64 *_code_size,CDbgInfo **_dbg,I64 *_type) -{ - U8 *res; - CCodeMisc *lb; - I64 i,code_size,last_code_size; - - COptReg reg_offsets[NUM_REGS]; - if (_dbg) *_dbg=NULL; - cc->pass=0; - COCHeaderPut(cc,1,TRUE); - OptPass012(cc); - COCHeaderPut(cc,2,TRUE); - OptPass012(cc); - COCHeaderPut(cc,3,TRUE); - OptPass3(cc,reg_offsets); - COCHeaderPut(cc,4,TRUE); - OptPass4(cc,reg_offsets,_type); - COCHeaderPut(cc,5,TRUE); - OptPass5(cc); - COCHeaderPut(cc,6,TRUE); - OptPass6(cc); - COCHeaderPut(cc,7,TRUE); - - lb=cc->coc.coc_next_misc; - while (lb!=&cc->coc.coc_next_misc) { - if (lb->type==CMT_JMP_TABLE) { - for (i=0;irange;i++) - lb->jmp_table[i]=OptLabelFwd(lb->jmp_table[i]); - lb->dft=OptLabelFwd(lb->dft); - } - lb=lb->next; - } - - COCHeaderPut(cc,7,FALSE); - OptPass789A(cc,reg_offsets,NULL,NULL); - COCHeaderPut(cc,8,FALSE); - OptPass789A(cc,reg_offsets,NULL,NULL); - COCHeaderPut(cc,9,FALSE); - code_size=OptPass789A(cc,reg_offsets,NULL,NULL); - do { - last_code_size=code_size; - COCHeaderPut(cc,9,FALSE); - code_size=OptPass789A(cc,reg_offsets,NULL,NULL); - if (code_size>last_code_size) { - "Pass:9 Code Size\n"; - LexExcept(cc,"Compiler Optimization Error at "); - } - } while (code_sizeflags&CCF_AOT_COMPILE) - res=MAlloc(code_size); - else { - res=MAlloc(code_size,Fs->code_heap); - if (cc->htc.fun) - Fs->last_fun=cc->htc.fun; - } - COCHeaderPut(cc,10,FALSE); - code_size=OptPass789A(cc,reg_offsets,res,_dbg); - - COCDel(cc,&cc->coc); - if (Bt(&cc->opts,OPTf_TRACE)) { - if (cc->flags&CCF_AOT_COMPILE) { - if (cc->aotc->seg_size==16) - Un(res,code_size,16); - else if (cc->aotc->seg_size==64) - Un(res,code_size,64); - else - Un(res,code_size,32); - } else - Un(res,code_size,64); - } - if (_code_size) *_code_size=code_size; - cc->saved_pass_trace=cc->pass_trace; - return res; -} diff --git a/Compiler/PrsLib.HC b/Compiler/PrsLib.HC new file mode 100644 index 0000000..8c828b6 --- /dev/null +++ b/Compiler/PrsLib.HC @@ -0,0 +1,323 @@ +U0 PrsPush(CPrsStk *ps,I64 val) +{ + ps->stk[++ps->ptr]=val; +} + +I64 PrsPop(CPrsStk *ps) +{ + return ps->stk[ps->ptr--]; +} + +U0 PrsPush2(CPrsStk *ps,I64 val) +{ + ps->stk2[++ps->ptr2]=val; +} + +I64 PrsPop2(CPrsStk *ps) +{ + return ps->stk2[ps->ptr2--]; +} + +U0 PrsPopDeref(CPrsStk *ps) +{ + I64 i=PrsPop(ps); + CHashClass *tempc=PrsPop(ps); + if (i.u16[0]!=IC_DEREF) { + PrsPush(ps,tempc); + PrsPush(ps,i); + } +} + +I64 PrsKeyWord(CCmpCtrl *cc) +{//Cvt cur token to $LK,"KEYWORD",A="FF:::/Compiler/OpCodes.DD,KEYWORD"$ or -1. + CHashGeneric *temph; + if (cc->token==TK_IDENT &&(temph=cc->hash_entry) && temph->type&HTT_KEYWORD) + return temph->user_data0; + else + return -1; +} + +CHashClass *PrsClassNew() +{/*Ptrs to classes are handled by +allocating 5 structures for each +new class and representing a pointer +to a class by advancing 1 struct fwd +for one * and two fwd for two **. +*/ + I64 i; + CHashClass *res=CAlloc(sizeof(CHashClass)*(MAX_PTR_STARS+1),Fs->code_heap), + *tempc=res; + for (i=0;i<=MAX_PTR_STARS;i++) { + tempc->type=HTT_CLASS; + tempc->raw_type=RT_PTR; + tempc->size=sizeof(U8 *); + tempc->ptr_stars_cnt=i; + tempc++; + } + res->last_in_member_lst=&res->member_lst_and_root; + res->size=0; + return res; +} + +CHashFun *PrsFunNew() +{ + I64 i; + CHashFun *res=CAlloc(sizeof(CHashFun)*(MAX_PTR_STARS+1),Fs->code_heap), + *tempf=res; + for (i=0;i<=MAX_PTR_STARS;i++) { + tempf->type=HTT_FUN; + tempf->raw_type=RT_PTR; + tempf->size=sizeof(U8 *); + tempf->ptr_stars_cnt=i; + tempf++; + } + res->last_in_member_lst=&res->member_lst_and_root; + res->size=0; + return res; +} + +CIntermediateCode *ICAdd(CCmpCtrl *cc, + I64 opcode_and_precedence,I64 arg, CHashClass *c,I64 flags=0) +{ + CIntermediateCode *tempi=MAlloc(sizeof(CIntermediateCode)); + tempi->ic_code=opcode_and_precedence.u16[0]; + tempi->ic_precedence=opcode_and_precedence.u16[1]; + tempi->ic_data=arg; + tempi->ic_class=c; + if (cc->pass_trace) { + Bts(&cc->flags,CCf_PASS_TRACE_PRESENT); + flags|=ICF_PASS_TRACE; + } + if (cc->lock_cnt) + flags|=ICF_LOCK; + tempi->ic_flags=flags; + tempi->ic_line=cc->last_line_num; + QueIns(tempi,cc->coc.coc_head.last); + return tempi; +} + +U0 COCInit(CCmpCtrl *cc) +{ + CCodeCtrl *tempcbh=&cc->coc; + QueInit(&tempcbh->coc_head.next); + QueInit(&tempcbh->coc_next_misc); + tempcbh->coc_head.ic_code=IC_END; +} + +U0 COCPush(CCmpCtrl *cc) +{ + CCodeCtrl *tempcbh=MAlloc(sizeof(CCodeCtrl)); + MemCpy(tempcbh,&cc->coc,sizeof(CCodeCtrl)); + cc->coc.coc_next=tempcbh; +} + +CCmpCtrl *COCPopNoFree(CCmpCtrl *cc) +{ + CCodeCtrl *tempcbh=cc->coc.coc_next; + MemCpy(&cc->coc,tempcbh,sizeof(CCodeCtrl)); + return tempcbh; +} + +U0 COCPop(CCmpCtrl *cc) +{ + Free(COCPopNoFree(cc)); +} + +U0 COCAppend(CCmpCtrl *cc, CCodeCtrl *tempcbh) +{ + if (tempcbh->coc_head.next!=&cc->coc.coc_head.next) { + cc->coc.coc_head.last->next=tempcbh->coc_head.next; + tempcbh->coc_head.next->last=cc->coc.coc_head.last; + cc->coc.coc_head.last=tempcbh->coc_head.last; + tempcbh->coc_head.last->next=&cc->coc.coc_head.next; + } + if (tempcbh->coc_next_misc!=&cc->coc.coc_next_misc) { + cc->coc.coc_last_misc->next=tempcbh->coc_next_misc; + tempcbh->coc_next_misc->last=cc->coc.coc_last_misc; + cc->coc.coc_last_misc=tempcbh->coc_last_misc; + tempcbh->coc_last_misc->next=&cc->coc.coc_next_misc; + } + Free(tempcbh); +} + +CCodeMisc *COCMiscNew(CCmpCtrl *cc,I64 ty) +{ + CCodeMisc *res=CAlloc(sizeof(CCodeMisc)); + res->addr=INVALID_PTR; + res->type=ty; + QueIns(res,cc->coc.coc_last_misc); + return res; +} + +CCodeMisc *COCGoToLabelFind(CCmpCtrl *cc,U8 *name) +{ + CCodeMisc *cm=cc->coc.coc_next_misc; + while (cm!=&cc->coc.coc_next_misc) { + if ((cm->type==CMT_GOTO_LABEL||cm->type==CMT_ASM_LABEL) && + !StrCmp(cm->str,name)) + return cm; + cm=cm->next; + } + return NULL; +} + +I64 COCFloatConstFind(CCmpCtrl *cc,F64 d) +{ + I64 i; + CCodeMisc *cm=cc->coc.coc_next_misc; + while (cm!=&cc->coc.coc_next_misc) { + if (cm->type==CMT_FLOAT_CONSTS) { + for (i=0;inum_consts;i++) + if (cm->float_consts[i]==d) + return cm->addr+i*sizeof(F64); + if (cm->num_constsfloat_consts[cm->num_consts++]=d; + return cm->addr+i*sizeof(F64); + } + } + cm=cm->next; + } + cm=COCMiscNew(cc,CMT_FLOAT_CONSTS); + cm->float_consts=MAlloc(CM_MAX_CONSTS*sizeof(F64)); + cm->float_consts[cm->num_consts++]=d; + return cm->addr; +} + +U0 COCDel(CCmpCtrl *cc,CCodeCtrl *coc) +{ + CCodeMisc *cm,*cm1; + U8 *undef=NULL; + QueDel(&coc->coc_head.next); + cm=coc->coc_next_misc; + while (cm!=&coc->coc_next_misc) { + cm1=cm->next; + switch (cm->type) { + case CMT_GOTO_LABEL: + case CMT_ASM_LABEL: + if (!(cm->flags&CMF_DEFINED)) { + undef=cm->str; + cm->str=NULL; + } else if (!cm->use_cnt) { + PrintWarn("Unused label %s\n",cm->str); + LexWarn(cc,"Unused label at "); + } + break; + case CMT_JMP_TABLE: + Free(cm->jmp_table); + break; + case CMT_FLOAT_CONSTS: + Free(cm->float_consts); + break; + case CMT_ARRAY_DIM: + LinkedLstDel(cm->dim); + break; + case CMT_HASH_ENTRY: + HashDel(cm->h); + break; + } + Free(cm->str); + Free(cm); + cm=cm1; + } + if (undef) { + PrintErr("Undefined goto label %s\n",undef); + Free(undef); + LexExcept(cc,"Undefined goto label at "); + } +} + +U0 COCHeaderPut(CCmpCtrl *cc,I64 pass,Bool put) +{ + CIntermediateCode *tempi; + if (Bt(&cc->flags,CCf_PASS_TRACE_PRESENT)) { + if (put) { + if (Bt(&cc->saved_pass_trace,pass-1)) { + "$$IV,1$$Pass %d:$$IV,0$$\n",pass-1; + tempi=cc->coc.coc_head.next; + while (tempi->ic_code) { + if (tempi->ic_flags&ICF_PASS_TRACE) + ICPut(cc,tempi); + tempi=tempi->next; + } + } + } else if (Bt(&cc->saved_pass_trace,pass)) + "$$IV,1$$Pass %d:$$IV,0$$\n",pass; + } + cc->pass=pass; +} + +U8 *COCCompile(CCmpCtrl *cc,I64 *_code_size,CDbgInfo **_dbg,I64 *_type) +{ + U8 *res; + CCodeMisc *lb; + I64 i,code_size,last_code_size; + + COptReg reg_offsets[NUM_REGS]; + if (_dbg) *_dbg=NULL; + cc->pass=0; + COCHeaderPut(cc,1,TRUE); + OptPass012(cc); + COCHeaderPut(cc,2,TRUE); + OptPass012(cc); + COCHeaderPut(cc,3,TRUE); + OptPass3(cc,reg_offsets); + COCHeaderPut(cc,4,TRUE); + OptPass4(cc,reg_offsets,_type); + COCHeaderPut(cc,5,TRUE); + OptPass5(cc); + COCHeaderPut(cc,6,TRUE); + OptPass6(cc); + COCHeaderPut(cc,7,TRUE); + + lb=cc->coc.coc_next_misc; + while (lb!=&cc->coc.coc_next_misc) { + if (lb->type==CMT_JMP_TABLE) { + for (i=0;irange;i++) + lb->jmp_table[i]=OptLabelFwd(lb->jmp_table[i]); + lb->dft=OptLabelFwd(lb->dft); + } + lb=lb->next; + } + + COCHeaderPut(cc,7,FALSE); + OptPass789A(cc,reg_offsets,NULL,NULL); + COCHeaderPut(cc,8,FALSE); + OptPass789A(cc,reg_offsets,NULL,NULL); + COCHeaderPut(cc,9,FALSE); + code_size=OptPass789A(cc,reg_offsets,NULL,NULL); + do { + last_code_size=code_size; + COCHeaderPut(cc,9,FALSE); + code_size=OptPass789A(cc,reg_offsets,NULL,NULL); + if (code_size>last_code_size) { + "Pass:9 Code Size\n"; + LexExcept(cc,"Compiler Optimization Error at "); + } + } while (code_sizeflags&CCF_AOT_COMPILE) + res=MAlloc(code_size); + else { + res=MAlloc(code_size,Fs->code_heap); + if (cc->htc.fun) + Fs->last_fun=cc->htc.fun; + } + COCHeaderPut(cc,10,FALSE); + code_size=OptPass789A(cc,reg_offsets,res,_dbg); + + COCDel(cc,&cc->coc); + if (Bt(&cc->opts,OPTf_TRACE)) { + if (cc->flags&CCF_AOT_COMPILE) { + if (cc->aotc->seg_size==16) + Un(res,code_size,16); + else if (cc->aotc->seg_size==64) + Un(res,code_size,64); + else + Un(res,code_size,32); + } else + Un(res,code_size,64); + } + if (_code_size) *_code_size=code_size; + cc->saved_pass_trace=cc->pass_trace; + return res; +} diff --git a/Compiler/PrsStmt.CPP b/Compiler/PrsStmt.CPP deleted file mode 100644 index e4b202f..0000000 --- a/Compiler/PrsStmt.CPP +++ /dev/null @@ -1,1222 +0,0 @@ -CHashClass *PrsClass(CCmpCtrl *cc,I64 keyword,I64 fsp_flags,Bool is_extern) -{ - CHashClass *tempc,*base_class; - if (cc->token!=TK_IDENT) - LexExcept(cc,"Expecting identifier at "); - if (is_extern) { - tempc=PrsClassNew; - tempc->str=cc->cur_str; - cc->cur_str=NULL; - HashAdd(tempc,cc->htc.glbl_hash_table); - LBts(&tempc->flags,Cf_EXTERN); - HashSrcFileSet(cc,tempc); - Lex(cc); - } else { - if (cc->flags&CCF_AOT_COMPILE) { - if (tempc=HashFind(cc->cur_str,cc->htc.glbl_hash_table,HTT_CLASS)) { - if (!Bt(&tempc->flags,Cf_EXTERN)) - tempc=NULL; - else if (tempc->use_cnt<3) - UnusedExternWarning(cc,tempc); - } - } else { - if (tempc=HashSingleTableFind(cc->cur_str, - cc->htc.glbl_hash_table,HTT_CLASS)) { - if (!Bt(&tempc->flags,Cf_EXTERN)) - tempc=NULL; - else if (tempc->use_cnt<3) - UnusedExternWarning(cc,tempc); - } - } - if (tempc) { - Free(tempc->src_link); - tempc->src_link=NULL; - Free(tempc->idx); - tempc->idx=NULL; - } else { - tempc=PrsClassNew; - tempc->str=cc->cur_str; - cc->cur_str=NULL; - HashAdd(tempc,cc->htc.glbl_hash_table); - } - LBtr(&tempc->flags,Cf_EXTERN); - if (fsp_flags&FSF_PUBLIC) - tempc->type|=HTF_PUBLIC; - tempc->use_cnt=0; - if (cc->last_U16=='\n') - HashSrcFileSet(cc,tempc,-1); - else - HashSrcFileSet(cc,tempc,0); - if (Lex(cc)==':') { - if (Lex(cc)!=TK_IDENT || !(base_class=cc->hash_entry) || - !(base_class->type&HTT_CLASS)) - LexExcept(cc,"Invalid class at "); - if (Lex(cc)==',') - LexExcept(cc,"Only one base class allowed at this time at "); - tempc->base_class=base_class; - tempc->size+=base_class->size; - } - if (keyword==KW_UNION) - PrsVarLst(cc,tempc,PRS0_NULL|PRS1_CLASS|PRSF_UNION); - else - PrsVarLst(cc,tempc,PRS0_NULL|PRS1_CLASS); - tempc->size+=tempc->neg_offset; - } - return tempc; -} - -CHashFun *PrsFunJoin(CCmpCtrl *cc, - CHashClass *temp_return,U8 *name,I64 fsp_flags) -{ - CMemberLst *tempm; - CAOTCtrl *aotc=cc->aotc; - CHashFun *tempf; - if (name) {//if not fun_ptr - if (cc->flags&CCF_AOT_COMPILE) { - if (tempf=HashFind(name,cc->htc.glbl_hash_table,HTT_FUN)) { - if (tempf->type & HTF_IMPORT) - tempf=NULL; - else - if (tempf->use_cnt<3) - UnusedExternWarning(cc,tempf); - } - } else { - if (tempf=HashSingleTableFind(name,cc->htc.glbl_hash_table,HTT_FUN)) { - if (!Bt(&tempf->flags,Cf_EXTERN)) - tempf=NULL; - else if (tempf->use_cnt<3) - UnusedExternWarning(cc,tempf); - } - } - } else - tempf=NULL; - if (tempf) { - tempf->used_reg_mask=REGG_CLOBBERED+REGG_SAVED+REGG_STK_TEMP; - Free(tempf->src_link); - tempf->src_link=NULL; - Free(tempf->idx); - tempf->idx=NULL; - Free(name); - MemberLstDel(tempf); - } else { - tempf=PrsFunNew; - tempf->used_reg_mask=REGG_CLOBBERED+REGG_SAVED+REGG_STK_TEMP; - tempf->clobbered_reg_mask=REGG_CLOBBERED+REGG_STK_TEMP; - tempf->str=name; - if (cc->flags&CCF_AOT_COMPILE) - tempf->exe_addr=aotc->ip; - else - tempf->exe_addr=&UndefinedExtern; - LBts(&tempf->flags,Cf_EXTERN); - tempf->flags|=fsp_flags&FSG_FUN_FLAGS1; - if (name) //if not fun_ptr - HashAdd(tempf,cc->htc.glbl_hash_table); - } - BEqu(&tempf->type,HTf_PUBLIC,fsp_flags&FSF_PUBLIC); - tempf->return_class=temp_return; - tempf->use_cnt=0; - HashSrcFileSet(cc,tempf); - PrsVarLst(cc,tempf,PRS0_NULL|PRS1_FUN_ARG); - tempf->arg_cnt=tempf->member_cnt; - if (0arg_cnt<<3<=MAX_I16 && !Bt(&tempf->flags,Ff_DOT_DOT_DOT)) - LBts(&tempf->flags,Ff_RET1); - tempm=tempf->member_lst_and_root; - while (tempm) { - tempm->offset+=16; //RBP+RETURN - tempm=tempm->next; - } - tempf->size=0; - return tempf; -} - -U0 PrsFun(CCmpCtrl *cc,CHashClass *temp_return,U8 *name,I64 fsp_flags) -{ - CMemberLst *tempm; - CCodeMisc *saved_leave_label; - I64 i,j,size,*r; - Bool old_trace; - - cc->fun_lex_file=cc->lex_include_stk; - cc->min_line=cc->max_line=cc->lex_include_stk->line_num; - - cc->flags&=~CCF_NO_REG_OPT; - cc->htc.local_var_lst=cc->htc.fun=PrsFunJoin(cc,temp_return,name,fsp_flags); - - COCPush(cc); - Btr(&cc->flags,CCf_PASS_TRACE_PRESENT); - COCInit(cc); - ICAdd(cc,IC_ENTER,0,0); - saved_leave_label=cc->lb_leave; - cc->lb_leave=COCMiscNew(cc,CMT_LABEL); - cc->flags&=~CCF_HAS_RETURN; - PrsStmt(cc,,,0); - - if (cc->max_linemin_line) - cc->max_line=cc->min_line; - - if (cc->htc.fun->return_class->size && !(cc->flags&CCF_HAS_RETURN)) - LexWarn(cc,"Function should return val "); - ICAdd(cc,IC_LABEL,cc->lb_leave,0); - cc->lb_leave=saved_leave_label; - ICAdd(cc,IC_LEAVE,0,cc->htc.fun->return_class); - cc->htc.fun->size&=~7; - if (cc->flags&CCF_AOT_COMPILE) { - cc->htc.fun->exe_addr=cc->aotc->ip; - cc->htc.fun->type|=HTF_EXPORT|HTF_RESOLVE; - r=COCCompile(cc,&size,&cc->htc.fun->dbg_info,NULL); - if (r) { - j=(size+7)>>3; - for (i=0;iopts,OPTf_TRACE); - cc->htc.fun->exe_addr=COCCompile( - cc,&size,&cc->htc.fun->dbg_info,NULL); - if (old_trace) { - Bts(&cc->opts,OPTf_TRACE); - Un(cc->htc.fun->exe_addr,size,64); - } - SysSymImportsResolve(cc->htc.fun->str); - } - LBtr(&cc->htc.fun->flags,Cf_EXTERN); - COCPop(cc); - tempm=cc->htc.fun->member_lst_and_root; - while (tempm) { - if (tempm->flags & MLF_NO_UNUSED_WARN) { - if (tempm->use_cnt>1&&StrCmp(tempm->str,"_anon_")) - PrintWarn("Unneeded no_warn\n $$LK,\"FL:%s,%d\"$$ '%s' in '%s'\n", - cc->lex_include_stk->full_name,cc->lex_include_stk->line_num, - tempm->str,cc->htc.fun->str); - } else if (!tempm->use_cnt && GetOption(OPTf_WARN_UNUSED_VAR)) - PrintWarn("Unused var\n $$LK,\"FL:%s,%d\"$$ '%s' in '%s'\n", - cc->lex_include_stk->full_name,cc->lex_include_stk->line_num, - tempm->str,cc->htc.fun->str); - tempm=tempm->next; - } - cc->htc.local_var_lst=cc->htc.fun=cc->fun_lex_file=NULL; -} - -U0 PrsGlblVarLst(CCmpCtrl *cc,I64 saved_mode,CHashClass *saved_tempc, - I64 saved_val,I64 fsp_flags) -{ - I64 i,j,mode,k,val; - U8 *st; - CHashExport *tempex; - CHashGlblVar *tempg; - CAOTCtrl *aotc=cc->aotc; - CAOTHeapGlbl *temphg; - CHashClass *tempc; - CHashFun *tempf,*tempf_fun_ptr; - CArrayDim tempad; - Bool has_alias,undef_array_size,is_array; - while (TRUE) { - tempc=PrsType(cc,&saved_tempc,&saved_mode,NULL,&st, - &tempf_fun_ptr,&tempex,&tempad,fsp_flags); - - if (!st) return; - if (tempad.next) - is_array=TRUE; - else if (tempad.total_cnt<0) { - is_array=TRUE; - tempc--; - } else - is_array=FALSE; - - val=saved_val; - mode=saved_mode; - if (tempex && mode&255==PRS0_EXTERN && !(cc->flags&CCF_AOT_COMPILE) && - tempex->type&HTT_EXPORT_SYS_SYM) { - val=tempex->val; - mode=PRS0__EXTERN|PRS1_NOT_REALLY__EXTERN; - } - if (cc->token=='(') { - switch (mode&255) { - case PRS0__INTERN: - tempf=PrsFunJoin(cc,tempc,st,fsp_flags); - tempf->exe_addr=val; - Bts(&tempf->flags,Ff_INTERNAL); - LBtr(&tempf->flags,Cf_EXTERN); - return; - case PRS0__EXTERN: - if (!(fsp_flags&FSF__) && !(mode&PRS1_NOT_REALLY__EXTERN)) - LexExcept(cc,"Expecting label with underscore at "); - tempf=PrsFunJoin(cc,tempc,st,fsp_flags); - tempf->exe_addr=val; - SysSymImportsResolve(tempf->str); - LBtr(&tempf->flags,Cf_EXTERN); - if (saved_mode&255==PRS0__EXTERN) - LBts(&tempf->flags,Ff__EXTERN); - if (cc->flags&CCF_AOT_COMPILE) - tempf->type|=HTF_RESOLVE; - return; - case PRS0_EXTERN: - PrsFunJoin(cc,tempc,st,fsp_flags); - return; - case PRS0__IMPORT: - if (!(fsp_flags&FSF__)) - LexExcept(cc,"Expecting label with underscore at "); - case PRS0_IMPORT: - if (!(cc->flags&CCF_AOT_COMPILE)) - LexExcept(cc,"import not needed at "); - else { - tempf=PrsFunJoin(cc,tempc,st,fsp_flags); - tempf->type|=HTF_IMPORT; - if (mode&255==PRS0__IMPORT) - tempf->import_name=StrNew(val); - else - tempf->import_name=StrNew(st); - } - return; - default: - PrsFun(cc,tempc,st,fsp_flags); - return; - } - } else { - if (tempad.total_cnt<0) { - i=0; - undef_array_size=TRUE; - } else { - i=tempad.total_cnt; - undef_array_size=FALSE; - } - if (tempf_fun_ptr) - j=sizeof(U8 *); - else - j=tempc->size; - j*=i; - has_alias=FALSE; - temphg=NULL; - switch (mode&255) { - case PRS0__EXTERN: - if (cc->flags&CCF_AOT_COMPILE) { - tempg=CAlloc(sizeof(CHashGlblVar)); - tempg->data_addr_ip=val; - tempg->type=HTT_GLBL_VAR | HTF_EXPORT; - } else { - tempg=CAlloc(sizeof(CHashGlblVar),Fs->code_heap); - tempg->data_addr=val; - tempg->type=HTT_GLBL_VAR; - } - tempg->flags|=GVF_ALIAS; - break; - case PRS0__IMPORT: - case PRS0_IMPORT: - if (!(cc->flags&CCF_AOT_COMPILE)) - LexExcept(cc,"import not needed at "); - else { - tempg=CAlloc(sizeof(CHashGlblVar)); - tempg->type=HTT_GLBL_VAR | HTF_IMPORT; - if (mode&255==PRS0__IMPORT) - tempg->import_name=StrNew(val); - else - tempg->import_name=StrNew(st); - } - break; - case PRS0_EXTERN: - if (cc->flags&CCF_AOT_COMPILE) { - tempg=CAlloc(sizeof(CHashGlblVar)); - tempg->type=HTT_GLBL_VAR; - } else { - tempg=CAlloc(sizeof(CHashGlblVar),Fs->code_heap); - tempg->type=HTT_GLBL_VAR|HTF_UNRESOLVED; - } - break; - default: - if (cc->flags&CCF_AOT_COMPILE) { - if (Bt(&cc->opts,OPTf_GLBLS_ON_DATA_HEAP)) { - if (cc->token=='=') - LexExcept(cc,"Can't init glbl var on data heap in AOT module "); - tempg=CAlloc(sizeof(CHashGlblVar)); - temphg=tempg->heap_glbl=CAlloc(sizeof(CAOTHeapGlbl)); - temphg->size=j; - temphg->str=StrNew(st); - temphg->next=aotc->heap_glbls; - aotc->heap_glbls=temphg; - tempg->flags=GVF_DATA_HEAP; - tempg->type=HTT_GLBL_VAR; //TODO: HTF_EXPORT - if (tempex && tempex->type & HTT_GLBL_VAR) //TODO!! extern - LexExcept(cc,"Feature not implemented "); - } else { - tempg=CAlloc(sizeof(CHashGlblVar)); - if (cc->token=='=') - tempg->data_addr=CAlloc(j); - if (tempc->size>=8) //align - while (aotc->ip&7) - AOTStoreCodeU8(cc,0); - else if (tempc->size==4) - while (aotc->ip&3) - AOTStoreCodeU8(cc,0); - else if (tempc->size==2) - while (aotc->ip&1) - AOTStoreCodeU8(cc,0); - tempg->data_addr_ip=aotc->ip; - tempg->type=HTT_GLBL_VAR | HTF_EXPORT; - if (tempex && tempex->type & HTT_GLBL_VAR) - has_alias=TRUE; - if (sys_var_init_flag) - for (k=0;kopts,OPTf_GLBLS_ON_DATA_HEAP)) { - tempg=CAlloc(sizeof(CHashGlblVar),Fs->code_heap); - tempg->data_addr=MAlloc(j); - tempg->flags=GVF_DATA_HEAP; - } else { - tempg=CAlloc(sizeof(CHashGlblVar),Fs->code_heap); - tempg->data_addr=MAlloc(j,Fs->code_heap); - } - tempg->type=HTT_GLBL_VAR; - if (tempex && tempex->type&HTT_GLBL_VAR && - tempex->type&HTF_UNRESOLVED && - MHeapCtrl(tempex)==MHeapCtrl(tempg)) - has_alias=TRUE; - if (sys_var_init_flag) - MemSet(tempg->data_addr,sys_var_init_val,j); - } - } - tempg->dim.next=tempad.next; - if (fsp_flags&FSF_PUBLIC) - tempg->type|=HTF_PUBLIC; - tempg->var_class=tempc; - tempg->str=st; - tempg->size=j; - tempg->dim.total_cnt=i; - tempg->use_cnt=0; - if (cc->last_U16=='\n') - HashSrcFileSet(cc,tempg,-1); - else - HashSrcFileSet(cc,tempg,0); - if (mode&255==PRS0_IMPORT || mode&255==PRS0__IMPORT) - tempg->flags|=GVF_IMPORT; - if (mode&255==PRS0_EXTERN) - tempg->flags|=GVF_EXTERN; - if (tempf_fun_ptr) { - tempg->fun_ptr=tempf_fun_ptr; - tempg->flags|=GVF_FUN; - } - if (is_array) - tempg->flags|=GVF_ARRAY; - HashAdd(tempg,cc->htc.glbl_hash_table); - if (!(cc->flags&CCF_AOT_COMPILE) && !(tempg->flags&GVF_EXTERN)) - SysSymImportsResolve(tempg->str); - if (cc->token=='=') { - if (undef_array_size) { - LexPush(cc); - LexPush(cc); - Lex(cc); - PrsGlblInit(cc,tempg,1); - LexPopNoRestore(cc); - tempg->size=tempg->dim.total_cnt*tempc->size; - if (temphg) - temphg->size=tempg->size; - if (cc->flags&CCF_AOT_COMPILE) { - if (sys_var_init_flag) - for (k=0;ksize;k++) - AOTStoreCodeU8(cc,sys_var_init_val); - else - for (k=0;ksize;k++) - AOTStoreCodeU8(cc,0); - } else - if (sys_var_init_flag) - MemSet(tempg->data_addr,sys_var_init_val,k); - LexPopRestore(cc); - } - LexPush(cc); - Lex(cc); - PrsGlblInit(cc,tempg,2); - if (cc->flags&CCF_AOT_COMPILE) - for (k=0;ksize;k++) - AOTStoreCodeU8At(cc,tempg->data_addr_ip+k,tempg->data_addr[k]); - LexPopNoRestore(cc); - } - if (has_alias) { - if (tempex(CHashGlblVar *)->use_cnt<2) { - PrintWarn("Unused extern '%s'\n",tempex(CHashGlblVar *)->str); - cc->warning_cnt++; - } - tempex(CHashGlblVar *)->flags|=GVF_ALIAS; - tempex(CHashGlblVar *)->data_addr=tempg->data_addr; - tempex(CHashGlblVar *)->data_addr_ip=tempg->data_addr_ip; - } - if (cc->token==',') - Lex(cc); - else { - if (cc->token!=';') - LexExcept(cc,"Missing ';' at"); - Lex(cc); - return; - } - } - } -} - -U0 PrsIf(CCmpCtrl *cc,I64 try_cnt,CCodeMisc *lb_break) -{ - CCodeMisc *lb,*lb1; - I64 k; - if (cc->token!='(') - LexExcept(cc,"Expecting '(' at "); - Lex(cc); - if (!PrsExpression(cc,NULL,FALSE)) - throw('Compiler'); - if (cc->token!=')') - LexExcept(cc,"Missing ')' at "); - Lex(cc); - lb=COCMiscNew(cc,CMT_LABEL); - ICAdd(cc,IC_BR_ZERO,lb,0); - PrsStmt(cc,try_cnt,lb_break); - k=PrsKeyWord(cc); - if (k==KW_ELSE) { - Lex(cc); - lb1=COCMiscNew(cc,CMT_LABEL); - ICAdd(cc,IC_JMP,lb1,0); - ICAdd(cc,IC_LABEL,lb,0); - PrsStmt(cc,try_cnt,lb_break); - ICAdd(cc,IC_LABEL,lb1,0); - } else - ICAdd(cc,IC_LABEL,lb,0); -} - -U0 PrsWhile(CCmpCtrl *cc,I64 try_cnt) -{ - CCodeMisc *lb,*lb_done; - if (cc->token!='(') - LexExcept(cc,"Expecting '(' at "); - Lex(cc); - lb=COCMiscNew(cc,CMT_LABEL); - ICAdd(cc,IC_LABEL,lb,0); - if (!PrsExpression(cc,NULL,FALSE)) - throw('Compiler'); - if (cc->token!=')') - LexExcept(cc,"Missing ')' at "); - Lex(cc); - lb_done=COCMiscNew(cc,CMT_LABEL); - ICAdd(cc,IC_BR_ZERO,lb_done,0); - PrsStmt(cc,try_cnt,lb_done); - ICAdd(cc,IC_JMP,lb,0); - ICAdd(cc,IC_LABEL,lb_done,0); -} - -U0 PrsDoWhile(CCmpCtrl *cc,I64 try_cnt) -{ - CCodeMisc *lb,*lb_done; - lb=COCMiscNew(cc,CMT_LABEL); - lb_done=COCMiscNew(cc,CMT_LABEL); - ICAdd(cc,IC_LABEL,lb,0); - PrsStmt(cc,try_cnt,lb_done); - if (PrsKeyWord(cc)!=KW_WHILE) - LexExcept(cc,"Missing 'while' at"); - if (Lex(cc)!='(') - LexExcept(cc,"Expecting '(' at "); - Lex(cc); - if (!PrsExpression(cc,NULL,FALSE)) - throw('Compiler'); - if (cc->token!=')') - LexExcept(cc,"Missing ')' at "); - ICAdd(cc,IC_BR_NOT_ZERO,lb,0); - ICAdd(cc,IC_LABEL,lb_done,0); - if (Lex(cc)!=';') - LexExcept(cc,"Missing ';' at"); - Lex(cc); -} - -U0 PrsFor(CCmpCtrl *cc,I64 try_cnt) -{ - CCodeCtrl *tempcbh; - CCodeMisc *lb,*lb_done; - - if (cc->token!='(') - LexExcept(cc,"Expecting '(' at "); - Lex(cc); - PrsStmt(cc,try_cnt); - - lb=COCMiscNew(cc,CMT_LABEL); - ICAdd(cc,IC_LABEL,lb,0); - if (!PrsExpression(cc,NULL,FALSE)) - throw('Compiler'); - lb_done=COCMiscNew(cc,CMT_LABEL); - ICAdd(cc,IC_BR_ZERO,lb_done,0); - if (cc->token!=';') - LexExcept(cc,"Missing ';' at"); - Lex(cc); - - COCPush(cc); - COCInit(cc); - if (cc->token!=')') - PrsStmt(cc,try_cnt,NULL,0); - COCPush(cc); - tempcbh=COCPopNoFree(cc); - COCPop(cc); - if (cc->token!=')') - LexExcept(cc,"Missing ')' at "); - Lex(cc); - - PrsStmt(cc,try_cnt,lb_done); - COCAppend(cc,tempcbh); - ICAdd(cc,IC_JMP,lb,0); - ICAdd(cc,IC_LABEL,lb_done,0); -} - -class CSubSwitch { - CSubSwitch *next,*last; - CCodeMisc *lb_start,*lb_break; -}; - -class CSwitchCase { - CSwitchCase *next; - CCodeMisc *label; - I64 val; - CSubSwitch *ss; -}; - -U0 PrsSwitch(CCmpCtrl *cc,I64 try_cnt) -{ - CSwitchCase *header=NULL,*temps,*temps1; //Leaks on except - CSubSwitch head,*tempss; //Leaks on except - CCodeMisc *lb_dft,*lb_fwd_case,*mc_jt,*lb_entry,**jmp_table; - CIntermediateCode *tempi_sub,*tempi_cmp,*tempi_jmp,*tempi_start; - Bool dft_found=FALSE,nobound; - I64 i,k_start=MIN_I64,k_end,lo=MAX_I64,hi=MIN_I64,range; - - if (cc->token=='(') - nobound=FALSE; - else if (cc->token=='[') - nobound=TRUE; - else - LexExcept(cc,"Expecting '(' or '[' at "); - Lex(cc); - QueInit(&head); - - head.last->lb_break=COCMiscNew(cc,CMT_LABEL); - head.last->lb_break->use_cnt++; - lb_dft=COCMiscNew(cc,CMT_LABEL); - lb_dft->use_cnt++; - mc_jt=COCMiscNew(cc,CMT_JMP_TABLE); - mc_jt->begin=COCMiscNew(cc,CMT_LABEL); - mc_jt->begin->use_cnt++; - if (!PrsExpression(cc,NULL,FALSE)) - throw('Compiler'); - tempi_sub=ICAdd(cc,IC_IMM_I64,0,cmp.internal_types[RT_I64]); - ICAdd(cc,IC_SUB,0,cmp.internal_types[RT_I64]); - tempi_cmp=ICAdd(cc,IC_IMM_I64,0,cmp.internal_types[RT_I64]); - if (nobound) { - ICAdd(cc,IC_NOBOUND_SWITCH,mc_jt,0); - if (cc->token!=']') - LexExcept(cc,"Missing ']' at "); - } else { - ICAdd(cc,IC_SWITCH,mc_jt,0); - if (cc->token!=')') - LexExcept(cc,"Missing ')' at "); - } - if (Lex(cc)!='{') - LexExcept(cc,"Expecting '{' at "); - Lex(cc); - ICAdd(cc,IC_LABEL,mc_jt->begin,0); - while (TRUE) { - while (cc->token && cc->token!='}') { -sw_cont: - switch (PrsKeyWord(cc)) { - case KW_END: - goto sw_sub_end; - case KW_START: - if (Lex(cc)==':') - Lex(cc); - else - LexExcept(cc,"Expecting ':' at "); - tempss=MAlloc(sizeof(CSubSwitch)); - QueIns(tempss,head.last); - head.last->lb_break=COCMiscNew(cc,CMT_LABEL); - head.last->lb_break->use_cnt++; - lb_fwd_case=COCMiscNew(cc,CMT_LABEL); - tempi_jmp=ICAdd(cc,IC_JMP,lb_fwd_case,0); - - tempss->lb_start=COCMiscNew(cc,CMT_LABEL); - tempi_start=ICAdd(cc,IC_LABEL,tempss->lb_start,0); - while (cc->token && cc->token!='}') { - switch (PrsKeyWord(cc)) { - case KW_END: - OptFree(tempi_jmp); - goto sw_sub_end; - case KW_START: - case KW_CASE: - case KW_DFT: - if (cc->coc.coc_head.last==tempi_start) { - OptFree(tempi_jmp); - tempss->lb_start=NULL; - } else { - ICAdd(cc,IC_RET,0,0); - ICAdd(cc,IC_LABEL,lb_fwd_case,0); - ICAdd(cc,IC_SUB_CALL,tempss->lb_start,0);//In case fall-thru - } - goto sw_cont; - default: - PrsStmt(cc,try_cnt); - } - } - break; - case KW_CASE: - if (head.next!=&head) { - lb_fwd_case=COCMiscNew(cc,CMT_LABEL); - tempi_jmp=ICAdd(cc,IC_JMP,lb_fwd_case,0);//In case fall-thru - } - Lex(cc); - lb_entry=COCMiscNew(cc,CMT_LABEL); - ICAdd(cc,IC_LABEL,lb_entry,0); - lb_entry->use_cnt++; - if (head.next!=&head) { - tempss=head.next; - while (tempss!=&head) { - if (tempss->lb_start) - ICAdd(cc,IC_SUB_CALL,tempss->lb_start,0); - tempss=tempss->next; - } - ICAdd(cc,IC_LABEL,lb_fwd_case,0); - } - if (cc->token==':') { - if (k_start==MIN_I64) - k_start=0; - else - k_start++; - } else - k_start=LexExpressionI64(cc); - if (k_starthi) hi=k_start; - if (cc->token==':') { - Lex(cc); - temps=MAlloc(sizeof(CSwitchCase)); - temps->label=lb_entry; - temps->val=k_start; - temps->next=header; - header=temps; - } else if (cc->token==TK_DOT_DOT_DOT) { - Lex(cc); - k_end=LexExpressionI64(cc); - if (cc->token==':') { - Lex(cc); - if (k_endhi) hi=k_end; - if (k_start>k_end) - SwapI64(&k_start,&k_end); - for (i=k_start;i<=k_end;i++) { - temps=MAlloc(sizeof(CSwitchCase)); - temps->label=lb_entry; - temps->val=i; - temps->next=header; - header=temps; - } - k_start=k_end; - } else - LexExcept(cc,"Expecting ':' at "); - } else - LexExcept(cc,"Expecting ':' at "); - break; - case KW_DFT: - if (head.next!=&head) { - lb_fwd_case=COCMiscNew(cc,CMT_LABEL); - tempi_jmp=ICAdd(cc,IC_JMP,lb_fwd_case,0);//In case fall-thru - } - Lex(cc); - ICAdd(cc,IC_LABEL,lb_dft,0); - if (cc->token==':') - Lex(cc); - else - LexExcept(cc,"Expecting ':' at "); - if (head.next!=&head) { - tempss=head.next; - while (tempss!=&head) { - if (tempss->lb_start) - ICAdd(cc,IC_SUB_CALL,tempss->lb_start,0); - tempss=tempss->next; - } - ICAdd(cc,IC_LABEL,lb_fwd_case,0); - } - dft_found=TRUE; - break; - default: - PrsStmt(cc,try_cnt,head.last->lb_break); - } - } -sw_sub_end: - tempss=head.last; - ICAdd(cc,IC_LABEL,tempss->lb_break,0); - if (tempss==&head) { - if (cc->token!='}') - LexExcept(cc,"Missing '}' at "); - Lex(cc); - break; - } else { - QueRem(tempss); - Free(tempss); - if (PrsKeyWord(cc)!=KW_END) - LexExcept(cc,"Missing 'end' at "); - if (Lex(cc)==':') - Lex(cc); - else - LexExcept(cc,"Expecting ':' at "); - } - } - if (!dft_found) - ICAdd(cc,IC_LABEL,lb_dft,0); - - if (0hi || !(0ic_data=lo; - tempi_cmp->ic_data=range; - temps=header; - while (temps) { - temps1=temps->next; - if (jmp_table[temps->val-lo]!=lb_dft) - LexExcept(cc,"Duplicate case at "); - else - jmp_table[temps->val-lo]=temps->label; - Free(temps); - temps=temps1; - } - mc_jt->dft=lb_dft; - mc_jt->jmp_table=jmp_table; - mc_jt->range=range; -} - -U0 PrsNoWarn(CCmpCtrl *cc) -{ - CMemberLst *tempm; - while (cc->token==TK_IDENT) { - if (!(tempm=cc->local_var_entry)) - LexExcept(cc,"Expecting local var at "); - tempm->flags|=MLF_NO_UNUSED_WARN; - if (Lex(cc)==',') - Lex(cc); - else if (cc->token!=';') - LexExcept(cc,"Expecting ',' at "); - } -} - -U0 PrsStreamBlk(CCmpCtrl *cc) -{ - CLexHashTableContext *htc=MAlloc(sizeof(CLexHashTableContext)); - CStreamBlk *tempe=MAlloc(sizeof(CStreamBlk)); - tempe->body=StrNew(""); - QueIns(tempe,cc->last_stream_blk); - COCPush(cc); - QueInit(&cc->coc.coc_next_misc); - - MemCpy(htc,&cc->htc,sizeof(CLexHashTableContext)); - htc->old_flags=cc->flags; - cc->htc.next=htc; - cc->htc.fun=cc->htc.local_var_lst=NULL; - cc->htc.define_hash_table=cc->htc.hash_table_lst= - cc->htc.glbl_hash_table=cc->htc.local_hash_table=Fs->hash_table; - cc->flags=cc->flags & ~(CCF_ASM_EXPRESSIONS|CCF_AOT_COMPILE) | CCF_EXE_BLK; - if (cc->token=='{') - Lex(cc); - else - LexExcept(cc,"Missing '}' at "); - while (cc->token && cc->token!='}') - ExeCmdLine(cc); - - MemCpy(&cc->htc,htc,sizeof(CLexHashTableContext)); - cc->flags=cc->flags&~CCF_EXE_BLK | - htc->old_flags & (CCF_ASM_EXPRESSIONS|CCF_EXE_BLK|CCF_AOT_COMPILE); - Free(htc); - COCPop(cc); - QueRem(tempe); - if (*tempe->body) - LexIncludeStr(cc,"StreamBlk",tempe->body,FALSE); - else - Free(tempe->body); - Free(tempe); - Lex(cc); //Skip '}' -} - -U0 PrsTryBlk(CCmpCtrl *cc,I64 try_cnt) -{ - CCodeMisc *lb_catch,*lb_done,*lb_untry; - CHashClass *tempc=cmp.internal_types[RT_PTR]; - CHashFun *temp_try=HashFind("SysTry",cc->htc.hash_table_lst,HTT_FUN), - *temp_untry=HashFind("SysUntry",cc->htc.hash_table_lst,HTT_FUN); - - if (!temp_try || !temp_untry) - LexExcept(cc,"Missing header for SysTry() and SysUntry() at "); - - cc->flags|=CCF_NO_REG_OPT; //TODO:Currently no reg vars in funs with try/catch - - lb_catch=COCMiscNew(cc,CMT_LABEL); - lb_done =COCMiscNew(cc,CMT_LABEL); - lb_untry=COCMiscNew(cc,CMT_LABEL); - - ICAdd(cc,IC_CALL_START,0,0); - ICAdd(cc,IC_GET_LABEL,lb_untry,tempc,ICF_PUSH_RES); - ICAdd(cc,IC_GET_LABEL,lb_catch,tempc,ICF_PUSH_RES); - if (Bt(&temp_try->flags,Cf_EXTERN)) { - cc->abs_cnts.externs++; - if (cc->flags&CCF_AOT_COMPILE) - ICAdd(cc,IC_CALL_IMPORT,temp_try,tempc); - else - ICAdd(cc,IC_CALL_INDIRECT2,&temp_try->exe_addr,tempc); - } else - ICAdd(cc,IC_CALL,temp_try->exe_addr,tempc); - if ((Bt(&temp_try->flags,Ff_RET1) || - Bt(&temp_try->flags,Ff_ARGPOP)) && !Bt(&temp_try->flags,Ff_NOARGPOP)) - ICAdd(cc,IC_ADD_RSP1,16,tempc); - else - ICAdd(cc,IC_ADD_RSP,16,tempc); - ICAdd(cc,IC_CALL_END,0,tempc); - ICAdd(cc,IC_END_EXP,0,0,ICF_RES_NOT_USED); - - PrsStmt(cc,try_cnt+1); - - ICAdd(cc,IC_LABEL,lb_untry,0); - ICAdd(cc,IC_CALL_START,0,0); - if (Bt(&temp_untry->flags,Cf_EXTERN)) { - cc->abs_cnts.externs++; - if (cc->flags&CCF_AOT_COMPILE) - ICAdd(cc,IC_CALL_IMPORT,temp_untry,tempc); - else - ICAdd(cc,IC_CALL_INDIRECT2,&temp_untry->exe_addr,tempc); - } else - ICAdd(cc,IC_CALL,temp_untry->exe_addr,tempc); - ICAdd(cc,IC_CALL_END,0,tempc); - ICAdd(cc,IC_END_EXP,0,0,ICF_RES_NOT_USED); - - ICAdd(cc,IC_JMP,lb_done,0); - - if (PrsKeyWord(cc)!=KW_CATCH) - LexExcept(cc,"Missing 'catch' at"); - - Lex(cc); - ICAdd(cc,IC_LABEL,lb_catch,0); - PrsStmt(cc,try_cnt+1); - ICAdd(cc,IC_RET,0,tempc); - ICAdd(cc,IC_LABEL,lb_done,0); -} - -Bool PrsStmt(CCmpCtrl *cc,I64 try_cnt=0, - CCodeMisc *lb_break=NULL,I64 cmp_flags=CMPF_PRS_SEMICOLON) -{ - I64 i,fsp_flags=0; - CHashExport *tempex; - CCodeMisc *g_lb; - U8 *import_name; - CHashFun *temp_untry; - CAOT *tempaot; - if (cmp_flags&CMPF_ONE_ASM_INS) { - if (cc->flags&CCF_AOT_COMPILE || cc->aot_depth) - PrsAsmBlk(cc,CMPF_ONE_ASM_INS); - else if (tempaot=CmpJoin(cc,CMPF_ASM_BLK|CMPF_ONE_ASM_INS)) - CmpFixUpJITAsm(cc,tempaot); - fsp_flags=FSF_ASM; - } else - while (TRUE) { - while (cc->token==',') - Lex(cc); - if (cc->token=='{') { - Lex(cc); - while (cc->token!='}' && cc->token!=TK_EOF) - PrsStmt(cc,try_cnt,lb_break); - if (cc->lex_include_stk==cc->fun_lex_file) - cc->max_line=cc->lex_include_stk->line_num; - if (Lex(cc)!=',') goto sm_done; - } else if (cc->token==';') { - if (cmp_flags&CMPF_PRS_SEMICOLON) - Lex(cc); - if (cc->token!=',') goto sm_done; - } else { - if (cc->token==TK_IDENT) { - if (tempex=cc->hash_entry) { - if (tempex->type & HTT_KEYWORD) { - i=tempex(CHashGeneric *)->user_data0; - switch [i] { - case KW_NUM_KEYWORDS-1: //nobound switch - default: //A keyword that is not valid here is just a symbol. - goto sm_not_keyword_afterall; - start: - case KW_ASM: - if (cc->htc.fun) { - if (tempaot=CmpJoin(cc,CMPF_ASM_BLK)) - ICAdd(cc,IC_ASM,tempaot,0); - Lex(cc); //Skip '}' of asm{} - } else { - if (cc->flags&CCF_AOT_COMPILE || cc->aot_depth) { - Lex(cc); - PrsAsmBlk(cc,0); - if (cc->flags&CCF_AOT_COMPILE && cc->aot_depth==1) - Lex(cc); //Skip '}' of asm{} - } else { - if (tempaot=CmpJoin(cc,CMPF_ASM_BLK)) - CmpFixUpJITAsm(cc,tempaot); - Lex(cc); //Skip '}' of asm{} - } - fsp_flags=FSF_ASM; - } - break; - start: - Lex(cc); - case KW_LOCK: - cc->lock_cnt++; - PrsStmt(cc,try_cnt); - cc->lock_cnt--; - break; - case KW_TRY: - PrsTryBlk(cc,try_cnt); - break; - case KW_IF: - PrsIf(cc,try_cnt,lb_break); - break; - case KW_FOR: - PrsFor(cc,try_cnt); - break; - case KW_WHILE: - PrsWhile(cc,try_cnt); - break; - case KW_DO: - PrsDoWhile(cc,try_cnt); - break; - case KW_SWITCH: - PrsSwitch(cc,try_cnt); - break; - end: - end: - if (cc->token!=',') goto sm_done; - break; - start: - if (cc->htc.fun) - LexExcept(cc,"Not allowed in fun"); - Lex(cc); - case KW__EXTERN: - if (Bt(&cc->opts,OPTf_EXTERNS_TO_IMPORTS)) - goto sm_underscore_import; - if (cc->token!=TK_IDENT || !(tempex=cc->hash_entry) || - !(tempex->type & HTT_EXPORT_SYS_SYM)) - LexExcept(cc,"Expecting system sym at "); - if (*cc->cur_str=='_') - fsp_flags|=FSF__; - i=tempex->val; - Lex(cc); - if (cc->token!=TK_IDENT || !(tempex=cc->hash_entry) || - !(tempex->type & (HTT_CLASS|HTT_INTERNAL_TYPE))) - LexExcept(cc,"Expecting type at "); - Lex(cc); - PrsGlblVarLst(cc,PRS0__EXTERN|PRS1_NULL,tempex,i,fsp_flags); - break; - case KW__IMPORT: -sm_underscore_import: - if (cc->token!=TK_IDENT) - LexExcept(cc,"Expecting system sym at "); - if (*cc->cur_str=='_') - fsp_flags|=FSF__; - import_name=cc->cur_str; - cc->cur_str=0; - if (Lex(cc)!=TK_IDENT || !(tempex=cc->hash_entry) || - !(tempex->type & (HTT_CLASS|HTT_INTERNAL_TYPE))) - LexExcept(cc,"Expecting type at "); - Lex(cc); - PrsGlblVarLst(cc,PRS0__IMPORT|PRS1_NULL,tempex, - import_name,fsp_flags); - Free(import_name); - break; - case KW_EXTERN: - if (cc->token!=TK_IDENT) - LexExcept(cc,"Expecting type at "); - tempex=cc->hash_entry; - i=PrsKeyWord(cc); - if (i==KW_CLASS||i==KW_UNION) { - Lex(cc); - PrsClass(cc,i,fsp_flags,TRUE); - fsp_flags&=FSF_ASM; - goto sm_semicolon; - } - if (!tempex || - !(tempex->type & (HTT_CLASS|HTT_INTERNAL_TYPE))) - LexExcept(cc,"Expecting type at "); - if (Bt(&cc->opts,OPTf_EXTERNS_TO_IMPORTS)) - goto sm_import; - Lex(cc); - PrsGlblVarLst(cc,PRS0_EXTERN|PRS1_NULL,tempex,0,fsp_flags); - break; - case KW_IMPORT: - if (cc->token!=TK_IDENT || !(tempex=cc->hash_entry) || - !(tempex->type & (HTT_CLASS|HTT_INTERNAL_TYPE))) - LexExcept(cc,"Expecting type at "); -sm_import: - Lex(cc); - PrsGlblVarLst(cc,PRS0_IMPORT|PRS1_NULL,tempex,0,fsp_flags); - break; - case KW__INTERN: - i=LexExpressionI64(cc); - if (cc->token!=TK_IDENT || !(tempex=cc->hash_entry) || - !(tempex->type & (HTT_CLASS|HTT_INTERNAL_TYPE))) - LexExcept(cc,"Expecting type at "); - Lex(cc); - PrsGlblVarLst(cc,PRS0__INTERN|PRS1_NULL,tempex,i,fsp_flags); - break; - end: - fsp_flags&=FSF_ASM; - break; - start: - case KW_STATIC: - fsp_flags=FSF_STATIC|fsp_flags&FSF_ASM; - break; - case KW_INTERRUPT: - fsp_flags=FSF_INTERRUPT|FSF_NOARGPOP| - fsp_flags&(FSG_FUN_FLAGS2|FSF_ASM); - break; - case KW_HASERRCODE: - fsp_flags=FSF_HASERRCODE|fsp_flags&(FSG_FUN_FLAGS2|FSF_ASM); - break; - case KW_ARGPOP: - fsp_flags=FSF_ARGPOP|fsp_flags&(FSG_FUN_FLAGS2|FSF_ASM); - break; - case KW_NOARGPOP: - fsp_flags=FSF_NOARGPOP|fsp_flags&(FSG_FUN_FLAGS2|FSF_ASM); - break; - case KW_PUBLIC: - fsp_flags=FSF_PUBLIC|fsp_flags&(FSG_FUN_FLAGS2|FSF_ASM); - break; - end: - Lex(cc); - break; - case KW_RETURN: - if (!cc->htc.fun) - LexExcept(cc,"Not in fun. Can't return a val "); - if (try_cnt) { - temp_untry=HashFind("SysUntry", - cc->htc.hash_table_lst,HTT_FUN); - for (i=0;iflags,Cf_EXTERN)) { - cc->abs_cnts.externs++; - if (cc->flags&CCF_AOT_COMPILE) - ICAdd(cc,IC_CALL_IMPORT, - temp_untry,cmp.internal_types[RT_PTR]); - else - ICAdd(cc,IC_CALL_INDIRECT2, - &temp_untry->exe_addr, - cmp.internal_types[RT_PTR]); - } else - ICAdd(cc,IC_CALL,temp_untry->exe_addr, - cmp.internal_types[RT_PTR]); - } - } - if (Lex(cc)!=';') { - if (!cc->htc.fun->return_class->size) - LexWarn(cc,"Function should NOT return val "); - if (!PrsExpression(cc,NULL,FALSE)) - throw('Compiler'); - ICAdd(cc,IC_RETURN_VAL,0,cc->htc.fun->return_class); - cc->flags|=CCF_HAS_RETURN; - } else if (cc->htc.fun->return_class->size) - LexWarn(cc,"Function should return val "); - ICAdd(cc,IC_JMP,cc->lb_leave,0); - goto sm_semicolon; - case KW_GOTO: - if (Lex(cc)!=TK_IDENT) - LexExcept(cc,"Expecting identifier at "); - if (!(g_lb=COCGoToLabelFind(cc,cc->cur_str))) { - g_lb=COCMiscNew(cc,CMT_GOTO_LABEL); - g_lb->str=cc->cur_str; - cc->cur_str=NULL; - } - g_lb->use_cnt++; - ICAdd(cc,IC_JMP,g_lb,0); - Lex(cc); - goto sm_semicolon; - case KW_BREAK: - Lex(cc); - if (!lb_break) - LexExcept(cc,"'break' not allowed\n"); - ICAdd(cc,IC_JMP,lb_break,0); - goto sm_semicolon; - case KW_NO_WARN: - Lex(cc); - PrsNoWarn(cc); - goto sm_semicolon; - case KW_UNION: - case KW_CLASS: - Lex(cc); - tempex=PrsClass(cc,i,fsp_flags,FALSE); - if (!cc->htc.fun && cc->token!=';') { - PrsGlblVarLst(cc,PRS0_NULL|PRS1_NULL,tempex,0,fsp_flags); - fsp_flags&=FSF_ASM; - break; - } else { - fsp_flags&=FSF_ASM; - goto sm_semicolon; - } - } - } else {//Ident, found in hash table, not keyword -sm_not_keyword_afterall: - if (tempex->type & (HTT_CLASS|HTT_INTERNAL_TYPE)) { - if (cc->htc.fun) { - if (fsp_flags&FSF_STATIC) - PrsVarLst(cc,cc->htc.fun,PRS0_NULL|PRS1_STATIC_LOCAL_VAR); - else - PrsVarLst(cc,cc->htc.fun,PRS0_NULL|PRS1_LOCAL_VAR); - if (cc->token=='}') goto sm_done; - } else { - Lex(cc); - PrsGlblVarLst(cc,PRS0_NULL|PRS1_NULL,tempex,0,fsp_flags); - } - } else { - if (tempex->type & (HTT_OPCODE|HTT_ASM_KEYWORD)) { - if (cc->htc.fun) { - if (tempaot=CmpJoin(cc,CMPF_ASM_BLK|CMPF_ONE_ASM_INS)) - ICAdd(cc,IC_ASM,tempaot,0); - } else - LexExcept(cc,"Use Asm Blk at "); - if (cc->token!=',') goto sm_done; - } else - goto sm_prs_exp; - } - fsp_flags&=FSF_ASM; - } - } else {//Ident, not in hash table - if (cc->local_var_entry) - goto sm_prs_exp; - if (!(g_lb=COCGoToLabelFind(cc,cc->cur_str))) { - g_lb=COCMiscNew(cc,CMT_GOTO_LABEL); - g_lb->str=cc->cur_str; - cc->cur_str=NULL; - } else if (g_lb->flags&CMF_DEFINED) - LexExcept(cc,"Duplicate goto label at "); - g_lb->flags|=CMF_DEFINED; - ICAdd(cc,IC_LABEL,g_lb,0); - if (Lex(cc)==':') //skip cur_str - Lex(cc); //skip colon - else - LexExcept(cc,"Undefined identifier at "); - if (!cc->htc.fun) - LexExcept(cc,"No global labels at "); - if (cc->token!=',') goto sm_done; - } - } else if (cc->token==TK_STR||cc->token==TK_CHAR_CONST) { - PrsFunCall(cc,NULL,FALSE,NULL); - goto sm_semicolon; - } else if (cc->token!=TK_EOF) {//Non-cur_str symbol, num or something -sm_prs_exp: - if (!PrsExpression(cc,NULL,TRUE)) - throw('Compiler'); -sm_semicolon: - if (cmp_flags&CMPF_PRS_SEMICOLON) { - if (cc->token==';') - Lex(cc); - else if (cc->token!=',') - LexExcept(cc,"Missing ';' at"); - } - if (cc->token!=',') goto sm_done; - } else - goto sm_done; //TK_EOF - } - } -sm_done: - return fsp_flags&FSF_ASM; -} diff --git a/Compiler/PrsStmt.HC b/Compiler/PrsStmt.HC new file mode 100644 index 0000000..daf4ea4 --- /dev/null +++ b/Compiler/PrsStmt.HC @@ -0,0 +1,1230 @@ +CHashClass *PrsClass(CCmpCtrl *cc,I64 keyword,I64 fsp_flags,Bool is_extern) +{ + CHashClass *tempc,*base_class; + if (cc->token!=TK_IDENT) + LexExcept(cc,"Expecting identifier at "); + if (is_extern) { + tempc=PrsClassNew; + tempc->str=cc->cur_str; + cc->cur_str=NULL; + HashAdd(tempc,cc->htc.glbl_hash_table); + LBts(&tempc->flags,Cf_EXTERN); + HashSrcFileSet(cc,tempc); + Lex(cc); + } else { + if (cc->flags&CCF_AOT_COMPILE) + tempc=HashFind(cc->cur_str,cc->htc.glbl_hash_table,HTT_CLASS); + else + tempc=HashSingleTableFind(cc->cur_str,cc->htc.glbl_hash_table,HTT_CLASS); + if (tempc) { + if (!Bt(&tempc->flags,Cf_EXTERN)) + tempc=NULL; + else if (tempc->use_cnt<3) + UnusedExternWarning(cc,tempc); + } + if (tempc) { + Free(tempc->src_link); + tempc->src_link=NULL; + Free(tempc->idx); + tempc->idx=NULL; + } else { + tempc=PrsClassNew; + tempc->str=cc->cur_str; + cc->cur_str=NULL; + HashAdd(tempc,cc->htc.glbl_hash_table); + } + LBtr(&tempc->flags,Cf_EXTERN); + if (fsp_flags&FSF_PUBLIC) + tempc->type|=HTF_PUBLIC; + tempc->use_cnt=0; + if (cc->last_U16=='\n') + HashSrcFileSet(cc,tempc,-1); + else + HashSrcFileSet(cc,tempc,0); + if (Lex(cc)==':') { + if (Lex(cc)!=TK_IDENT || !(base_class=cc->hash_entry) || + !(base_class->type&HTT_CLASS)) + LexExcept(cc,"Invalid class at "); + if (Lex(cc)==',') + LexExcept(cc,"Only one base class allowed at this time at "); + tempc->base_class=base_class; + tempc->size+=base_class->size; + } + if (keyword==KW_UNION) + PrsVarLst(cc,tempc,PRS0_NULL|PRS1_CLASS|PRSF_UNION); + else + PrsVarLst(cc,tempc,PRS0_NULL|PRS1_CLASS); + tempc->size+=tempc->neg_offset; + } + return tempc; +} + +CHashFun *PrsFunJoin(CCmpCtrl *cc,CHashClass *temp_return, + U8 *name,I64 fsp_flags) +{ + CMemberLst *tempm,*header_lst; + CAOTCtrl *aotc=cc->aotc; + CHashClass *header_return; + CHashFun *tempf; + I64 header_arg_cnt; + if (name) {//if not fun_ptr + if (cc->flags&CCF_AOT_COMPILE) { + if ((tempf=HashFind(name,cc->htc.glbl_hash_table,HTT_FUN)) && + tempf->type & HTF_IMPORT) + tempf=NULL; + } else + if ((tempf=HashSingleTableFind(name,cc->htc.glbl_hash_table,HTT_FUN)) && + !Bt(&tempf->flags,Cf_EXTERN)) + tempf=NULL; + if (tempf && tempf->use_cnt<3) + UnusedExternWarning(cc,tempf); + } else + tempf=NULL; + if (tempf) { + tempf->used_reg_mask=REGG_CLOBBERED+REGG_SAVED+REGG_STK_TEMP; + Free(tempf->src_link); + tempf->src_link=NULL; + Free(tempf->idx); + tempf->idx=NULL; + Free(name); + header_arg_cnt=tempf->arg_cnt; + header_lst=tempf->member_lst_and_root; + header_return=tempf->return_class; + tempf->member_lst_and_root=NULL; + ClassMemberLstDel(tempf); + } else { + tempf=PrsFunNew; + header_return=NULL; + tempf->used_reg_mask=REGG_CLOBBERED+REGG_SAVED+REGG_STK_TEMP; + tempf->clobbered_reg_mask=REGG_CLOBBERED+REGG_STK_TEMP; + tempf->str=name; + if (cc->flags&CCF_AOT_COMPILE) + tempf->exe_addr=aotc->ip; + else + tempf->exe_addr=&UndefinedExtern; + LBts(&tempf->flags,Cf_EXTERN); + tempf->flags|=fsp_flags&FSG_FUN_FLAGS1; + if (name) //if not fun_ptr + HashAdd(tempf,cc->htc.glbl_hash_table); + } + BEqu(&tempf->type,HTf_PUBLIC,fsp_flags&FSF_PUBLIC); + tempf->return_class=temp_return; + tempf->use_cnt=0; + HashSrcFileSet(cc,tempf); + PrsVarLst(cc,tempf,PRS0_NULL|PRS1_FUN_ARG); + tempf->arg_cnt=tempf->member_cnt; + if (0arg_cnt<<3<=MAX_I16 && !Bt(&tempf->flags,Ff_DOT_DOT_DOT)) + LBts(&tempf->flags,Ff_RET1); + tempm=tempf->member_lst_and_root; + while (tempm) { + tempm->offset+=16; //RBP+RETURN + tempm=tempm->next; + } + tempf->size=0; + if (header_return) { + if (GetOption(OPTf_WARN_HEADER_MISMATCH)) { + if (tempf->return_class!=header_return) { + PrintWarn("Fun Header return mismatch '%s'\n",tempf->str); + cc->warning_cnt++; + } + if (!MemberLstCmp(tempf->member_lst_and_root,header_lst,header_arg_cnt)) { + PrintWarn("Fun header args mismatch '%s'\n",tempf->str); + cc->warning_cnt++; + } + } + MemberLstDel(header_lst); + } + return tempf; +} + +U0 PrsFun(CCmpCtrl *cc,CHashClass *temp_return,U8 *name,I64 fsp_flags) +{ + CMemberLst *tempm; + CCodeMisc *saved_leave_label; + I64 i,j,size,*r; + Bool old_trace; + + cc->fun_lex_file=cc->lex_include_stk; + cc->min_line=cc->max_line=cc->lex_include_stk->line_num; + + cc->flags&=~CCF_NO_REG_OPT; + cc->htc.local_var_lst=cc->htc.fun=PrsFunJoin(cc,temp_return,name,fsp_flags); + + COCPush(cc); + Btr(&cc->flags,CCf_PASS_TRACE_PRESENT); + COCInit(cc); + ICAdd(cc,IC_ENTER,0,0); + saved_leave_label=cc->lb_leave; + cc->lb_leave=COCMiscNew(cc,CMT_LABEL); + cc->flags&=~CCF_HAS_RETURN; + PrsStmt(cc,,,0); + + if (cc->max_linemin_line) + cc->max_line=cc->min_line; + + if (cc->htc.fun->return_class->size && !(cc->flags&CCF_HAS_RETURN)) + LexWarn(cc,"Function should return val "); + ICAdd(cc,IC_LABEL,cc->lb_leave,0); + cc->lb_leave=saved_leave_label; + ICAdd(cc,IC_LEAVE,0,cc->htc.fun->return_class); + cc->htc.fun->size&=~7; + if (cc->flags&CCF_AOT_COMPILE) { + cc->htc.fun->exe_addr=cc->aotc->ip; + cc->htc.fun->type|=HTF_EXPORT|HTF_RESOLVE; + r=COCCompile(cc,&size,&cc->htc.fun->dbg_info,NULL); + if (r) { + j=(size+7)>>3; + for (i=0;iopts,OPTf_TRACE); + cc->htc.fun->exe_addr=COCCompile( + cc,&size,&cc->htc.fun->dbg_info,NULL); + if (old_trace) { + Bts(&cc->opts,OPTf_TRACE); + Un(cc->htc.fun->exe_addr,size,64); + } + SysSymImportsResolve(cc->htc.fun->str); + } + LBtr(&cc->htc.fun->flags,Cf_EXTERN); + COCPop(cc); + tempm=cc->htc.fun->member_lst_and_root; + while (tempm) { + if (tempm->flags & MLF_NO_UNUSED_WARN) { + if (tempm->use_cnt>1&&StrCmp(tempm->str,"_anon_")) + PrintWarn("Unneeded no_warn\n $$LK,\"FL:%s,%d\"$$ '%s' in '%s'\n", + cc->lex_include_stk->full_name,cc->lex_include_stk->line_num, + tempm->str,cc->htc.fun->str); + } else if (!tempm->use_cnt && GetOption(OPTf_WARN_UNUSED_VAR)) + PrintWarn("Unused var\n $$LK,\"FL:%s,%d\"$$ '%s' in '%s'\n", + cc->lex_include_stk->full_name,cc->lex_include_stk->line_num, + tempm->str,cc->htc.fun->str); + tempm=tempm->next; + } + cc->htc.local_var_lst=cc->htc.fun=cc->fun_lex_file=NULL; +} + +U0 PrsGlblVarLst(CCmpCtrl *cc,I64 saved_mode,CHashClass *saved_tempc, + I64 saved_val,I64 fsp_flags) +{ + I64 i,j,mode,k,val; + U8 *st; + CHashExport *tempex; + CHashGlblVar *tempg; + CAOTCtrl *aotc=cc->aotc; + CAOTHeapGlbl *temphg; + CHashClass *tempc; + CHashFun *tempf,*tempf_fun_ptr; + CArrayDim tempad; + Bool has_alias,undef_array_size,is_array; + while (TRUE) { + tempc=PrsType(cc,&saved_tempc,&saved_mode,NULL,&st, + &tempf_fun_ptr,&tempex,&tempad,fsp_flags); + + if (!st) return; + if (tempad.next) + is_array=TRUE; + else if (tempad.total_cnt<0) { + is_array=TRUE; + tempc--; + } else + is_array=FALSE; + + val=saved_val; + mode=saved_mode; + if (tempex && mode&255==PRS0_EXTERN && !(cc->flags&CCF_AOT_COMPILE) && + tempex->type&HTT_EXPORT_SYS_SYM) { + val=tempex->val; + mode=PRS0__EXTERN|PRS1_NOT_REALLY__EXTERN; + } + if (cc->token=='(') { + switch (mode&255) { + case PRS0__INTERN: + tempf=PrsFunJoin(cc,tempc,st,fsp_flags); + tempf->exe_addr=val; + Bts(&tempf->flags,Ff_INTERNAL); + LBtr(&tempf->flags,Cf_EXTERN); + return; + case PRS0__EXTERN: + if (!(fsp_flags&FSF__) && !(mode&PRS1_NOT_REALLY__EXTERN)) + LexExcept(cc,"Expecting label with underscore at "); + tempf=PrsFunJoin(cc,tempc,st,fsp_flags); + tempf->exe_addr=val; + SysSymImportsResolve(tempf->str); + LBtr(&tempf->flags,Cf_EXTERN); + if (saved_mode&255==PRS0__EXTERN) + LBts(&tempf->flags,Ff__EXTERN); + if (cc->flags&CCF_AOT_COMPILE) + tempf->type|=HTF_RESOLVE; + return; + case PRS0_EXTERN: + PrsFunJoin(cc,tempc,st,fsp_flags); + return; + case PRS0__IMPORT: + if (!(fsp_flags&FSF__)) + LexExcept(cc,"Expecting label with underscore at "); + case PRS0_IMPORT: + if (!(cc->flags&CCF_AOT_COMPILE)) + LexExcept(cc,"import not needed at "); + else { + tempf=PrsFunJoin(cc,tempc,st,fsp_flags); + tempf->type|=HTF_IMPORT; + if (mode&255==PRS0__IMPORT) + tempf->import_name=StrNew(val); + else + tempf->import_name=StrNew(st); + } + return; + default: + PrsFun(cc,tempc,st,fsp_flags); + return; + } + } else { + if (tempad.total_cnt<0) { + i=0; + undef_array_size=TRUE; + } else { + i=tempad.total_cnt; + undef_array_size=FALSE; + } + if (tempf_fun_ptr) + j=sizeof(U8 *); + else + j=tempc->size; + j*=i; + has_alias=FALSE; + temphg=NULL; + switch (mode&255) { + case PRS0__EXTERN: + if (cc->flags&CCF_AOT_COMPILE) { + tempg=CAlloc(sizeof(CHashGlblVar)); + tempg->data_addr_ip=val; + tempg->type=HTT_GLBL_VAR | HTF_EXPORT; + } else { + tempg=CAlloc(sizeof(CHashGlblVar),Fs->code_heap); + tempg->data_addr=val; + tempg->type=HTT_GLBL_VAR; + } + tempg->flags|=GVF_ALIAS; + break; + case PRS0__IMPORT: + case PRS0_IMPORT: + if (!(cc->flags&CCF_AOT_COMPILE)) + LexExcept(cc,"import not needed at "); + else { + tempg=CAlloc(sizeof(CHashGlblVar)); + tempg->type=HTT_GLBL_VAR | HTF_IMPORT; + if (mode&255==PRS0__IMPORT) + tempg->import_name=StrNew(val); + else + tempg->import_name=StrNew(st); + } + break; + case PRS0_EXTERN: + if (cc->flags&CCF_AOT_COMPILE) { + tempg=CAlloc(sizeof(CHashGlblVar)); + tempg->type=HTT_GLBL_VAR; + } else { + tempg=CAlloc(sizeof(CHashGlblVar),Fs->code_heap); + tempg->type=HTT_GLBL_VAR|HTF_UNRESOLVED; + } + break; + default: + if (cc->flags&CCF_AOT_COMPILE) { + if (Bt(&cc->opts,OPTf_GLBLS_ON_DATA_HEAP)) { + if (cc->token=='=') + LexExcept(cc,"Can't init glbl var on data heap in AOT module "); + tempg=CAlloc(sizeof(CHashGlblVar)); + temphg=tempg->heap_glbl=CAlloc(sizeof(CAOTHeapGlbl)); + temphg->size=j; + temphg->str=StrNew(st); + temphg->next=aotc->heap_glbls; + aotc->heap_glbls=temphg; + tempg->flags=GVF_DATA_HEAP; + tempg->type=HTT_GLBL_VAR; //TODO: HTF_EXPORT + if (tempex && tempex->type & HTT_GLBL_VAR) //TODO!! extern + LexExcept(cc,"Feature not implemented "); + } else { + tempg=CAlloc(sizeof(CHashGlblVar)); + if (cc->token=='=') + tempg->data_addr=CAlloc(j); + if (tempc->size>=8) //align + while (aotc->ip&7) + AOTStoreCodeU8(cc,0); + else if (tempc->size==4) + while (aotc->ip&3) + AOTStoreCodeU8(cc,0); + else if (tempc->size==2) + while (aotc->ip&1) + AOTStoreCodeU8(cc,0); + tempg->data_addr_ip=aotc->ip; + tempg->type=HTT_GLBL_VAR | HTF_EXPORT; + if (tempex && tempex->type & HTT_GLBL_VAR) + has_alias=TRUE; + if (sys_var_init_flag) + for (k=0;kopts,OPTf_GLBLS_ON_DATA_HEAP)) { + tempg=CAlloc(sizeof(CHashGlblVar),Fs->code_heap); + tempg->data_addr=MAlloc(j); + tempg->flags=GVF_DATA_HEAP; + } else { + tempg=CAlloc(sizeof(CHashGlblVar),Fs->code_heap); + tempg->data_addr=MAlloc(j,Fs->code_heap); + } + tempg->type=HTT_GLBL_VAR; + if (tempex && tempex->type&HTT_GLBL_VAR && + tempex->type&HTF_UNRESOLVED && + MHeapCtrl(tempex)==MHeapCtrl(tempg)) + has_alias=TRUE; + if (sys_var_init_flag) + MemSet(tempg->data_addr,sys_var_init_val,j); + } + } + tempg->dim.next=tempad.next; + if (fsp_flags&FSF_PUBLIC) + tempg->type|=HTF_PUBLIC; + tempg->var_class=tempc; + tempg->str=st; + tempg->size=j; + tempg->dim.total_cnt=i; + tempg->use_cnt=0; + if (cc->last_U16=='\n') + HashSrcFileSet(cc,tempg,-1); + else + HashSrcFileSet(cc,tempg,0); + if (mode&255==PRS0_IMPORT || mode&255==PRS0__IMPORT) + tempg->flags|=GVF_IMPORT; + if (mode&255==PRS0_EXTERN) + tempg->flags|=GVF_EXTERN; + if (tempf_fun_ptr) { + tempg->fun_ptr=tempf_fun_ptr; + tempg->flags|=GVF_FUN; + } + if (is_array) + tempg->flags|=GVF_ARRAY; + HashAdd(tempg,cc->htc.glbl_hash_table); + if (!(cc->flags&CCF_AOT_COMPILE) && !(tempg->flags&GVF_EXTERN)) + SysSymImportsResolve(tempg->str); + if (cc->token=='=') { + if (undef_array_size) { + LexPush(cc); + LexPush(cc); + Lex(cc); + PrsGlblInit(cc,tempg,1); + LexPopNoRestore(cc); + tempg->size=tempg->dim.total_cnt*tempc->size; + if (temphg) + temphg->size=tempg->size; + if (cc->flags&CCF_AOT_COMPILE) { + if (sys_var_init_flag) + for (k=0;ksize;k++) + AOTStoreCodeU8(cc,sys_var_init_val); + else + for (k=0;ksize;k++) + AOTStoreCodeU8(cc,0); + } else + if (sys_var_init_flag) + MemSet(tempg->data_addr,sys_var_init_val,k); + LexPopRestore(cc); + } + LexPush(cc); + Lex(cc); + PrsGlblInit(cc,tempg,2); + if (cc->flags&CCF_AOT_COMPILE) + for (k=0;ksize;k++) + AOTStoreCodeU8At(cc,tempg->data_addr_ip+k,tempg->data_addr[k]); + LexPopNoRestore(cc); + } + if (has_alias) { + if (tempex(CHashGlblVar *)->use_cnt<2) { + PrintWarn("Unused extern '%s'\n",tempex(CHashGlblVar *)->str); + cc->warning_cnt++; + } + tempex(CHashGlblVar *)->flags|=GVF_ALIAS; + tempex(CHashGlblVar *)->data_addr=tempg->data_addr; + tempex(CHashGlblVar *)->data_addr_ip=tempg->data_addr_ip; + } + if (cc->token==',') + Lex(cc); + else { + if (cc->token!=';') + LexExcept(cc,"Missing ';' at"); + Lex(cc); + return; + } + } + } +} + +U0 PrsIf(CCmpCtrl *cc,I64 try_cnt,CCodeMisc *lb_break) +{ + CCodeMisc *lb,*lb1; + I64 k; + if (cc->token!='(') + LexExcept(cc,"Expecting '(' at "); + Lex(cc); + if (!PrsExpression(cc,NULL,FALSE)) + throw('Compiler'); + if (cc->token!=')') + LexExcept(cc,"Missing ')' at "); + Lex(cc); + lb=COCMiscNew(cc,CMT_LABEL); + ICAdd(cc,IC_BR_ZERO,lb,0); + PrsStmt(cc,try_cnt,lb_break); + k=PrsKeyWord(cc); + if (k==KW_ELSE) { + Lex(cc); + lb1=COCMiscNew(cc,CMT_LABEL); + ICAdd(cc,IC_JMP,lb1,0); + ICAdd(cc,IC_LABEL,lb,0); + PrsStmt(cc,try_cnt,lb_break); + ICAdd(cc,IC_LABEL,lb1,0); + } else + ICAdd(cc,IC_LABEL,lb,0); +} + +U0 PrsWhile(CCmpCtrl *cc,I64 try_cnt) +{ + CCodeMisc *lb,*lb_done; + if (cc->token!='(') + LexExcept(cc,"Expecting '(' at "); + Lex(cc); + lb=COCMiscNew(cc,CMT_LABEL); + ICAdd(cc,IC_LABEL,lb,0); + if (!PrsExpression(cc,NULL,FALSE)) + throw('Compiler'); + if (cc->token!=')') + LexExcept(cc,"Missing ')' at "); + Lex(cc); + lb_done=COCMiscNew(cc,CMT_LABEL); + ICAdd(cc,IC_BR_ZERO,lb_done,0); + PrsStmt(cc,try_cnt,lb_done); + ICAdd(cc,IC_JMP,lb,0); + ICAdd(cc,IC_LABEL,lb_done,0); +} + +U0 PrsDoWhile(CCmpCtrl *cc,I64 try_cnt) +{ + CCodeMisc *lb,*lb_done; + lb=COCMiscNew(cc,CMT_LABEL); + lb_done=COCMiscNew(cc,CMT_LABEL); + ICAdd(cc,IC_LABEL,lb,0); + PrsStmt(cc,try_cnt,lb_done); + if (PrsKeyWord(cc)!=KW_WHILE) + LexExcept(cc,"Missing 'while' at"); + if (Lex(cc)!='(') + LexExcept(cc,"Expecting '(' at "); + Lex(cc); + if (!PrsExpression(cc,NULL,FALSE)) + throw('Compiler'); + if (cc->token!=')') + LexExcept(cc,"Missing ')' at "); + ICAdd(cc,IC_BR_NOT_ZERO,lb,0); + ICAdd(cc,IC_LABEL,lb_done,0); + if (Lex(cc)!=';') + LexExcept(cc,"Missing ';' at"); + Lex(cc); +} + +U0 PrsFor(CCmpCtrl *cc,I64 try_cnt) +{ + CCodeCtrl *tempcbh; + CCodeMisc *lb,*lb_done; + + if (cc->token!='(') + LexExcept(cc,"Expecting '(' at "); + Lex(cc); + PrsStmt(cc,try_cnt); + + lb=COCMiscNew(cc,CMT_LABEL); + ICAdd(cc,IC_LABEL,lb,0); + if (!PrsExpression(cc,NULL,FALSE)) + throw('Compiler'); + lb_done=COCMiscNew(cc,CMT_LABEL); + ICAdd(cc,IC_BR_ZERO,lb_done,0); + if (cc->token!=';') + LexExcept(cc,"Missing ';' at"); + Lex(cc); + + COCPush(cc); + COCInit(cc); + if (cc->token!=')') + PrsStmt(cc,try_cnt,NULL,0); + COCPush(cc); + tempcbh=COCPopNoFree(cc); + COCPop(cc); + if (cc->token!=')') + LexExcept(cc,"Missing ')' at "); + Lex(cc); + + PrsStmt(cc,try_cnt,lb_done); + COCAppend(cc,tempcbh); + ICAdd(cc,IC_JMP,lb,0); + ICAdd(cc,IC_LABEL,lb_done,0); +} + +class CSubSwitch { + CSubSwitch *next,*last; + CCodeMisc *lb_start,*lb_break; +}; + +class CSwitchCase { + CSwitchCase *next; + CCodeMisc *label; + I64 val; + CSubSwitch *ss; +}; + +U0 PrsSwitch(CCmpCtrl *cc,I64 try_cnt) +{ + CSwitchCase *header=NULL,*temps,*temps1; //Leaks on except + CSubSwitch head,*tempss; //Leaks on except + CCodeMisc *lb_dft,*lb_fwd_case,*mc_jt,*lb_entry,**jmp_table; + CIntermediateCode *tempi_sub,*tempi_cmp,*tempi_jmp,*tempi_start; + Bool dft_found=FALSE,nobound; + I64 i,k_start=MIN_I64,k_end,lo=MAX_I64,hi=MIN_I64,range; + + if (cc->token=='(') + nobound=FALSE; + else if (cc->token=='[') + nobound=TRUE; + else + LexExcept(cc,"Expecting '(' or '[' at "); + Lex(cc); + QueInit(&head); + + head.last->lb_break=COCMiscNew(cc,CMT_LABEL); + head.last->lb_break->use_cnt++; + lb_dft=COCMiscNew(cc,CMT_LABEL); + lb_dft->use_cnt++; + mc_jt=COCMiscNew(cc,CMT_JMP_TABLE); + mc_jt->begin=COCMiscNew(cc,CMT_LABEL); + mc_jt->begin->use_cnt++; + if (!PrsExpression(cc,NULL,FALSE)) + throw('Compiler'); + tempi_sub=ICAdd(cc,IC_IMM_I64,0,cmp.internal_types[RT_I64]); + ICAdd(cc,IC_SUB,0,cmp.internal_types[RT_I64]); + tempi_cmp=ICAdd(cc,IC_IMM_I64,0,cmp.internal_types[RT_I64]); + if (nobound) { + ICAdd(cc,IC_NOBOUND_SWITCH,mc_jt,0); + if (cc->token!=']') + LexExcept(cc,"Missing ']' at "); + } else { + ICAdd(cc,IC_SWITCH,mc_jt,0); + if (cc->token!=')') + LexExcept(cc,"Missing ')' at "); + } + if (Lex(cc)!='{') + LexExcept(cc,"Expecting '{' at "); + Lex(cc); + ICAdd(cc,IC_LABEL,mc_jt->begin,0); + while (TRUE) { + while (cc->token && cc->token!='}') { +sw_cont: + switch (PrsKeyWord(cc)) { + case KW_END: + goto sw_sub_end; + case KW_START: + if (Lex(cc)==':') + Lex(cc); + else + LexExcept(cc,"Expecting ':' at "); + tempss=MAlloc(sizeof(CSubSwitch)); + QueIns(tempss,head.last); + head.last->lb_break=COCMiscNew(cc,CMT_LABEL); + head.last->lb_break->use_cnt++; + lb_fwd_case=COCMiscNew(cc,CMT_LABEL); + tempi_jmp=ICAdd(cc,IC_JMP,lb_fwd_case,0); + + tempss->lb_start=COCMiscNew(cc,CMT_LABEL); + tempi_start=ICAdd(cc,IC_LABEL,tempss->lb_start,0); + while (cc->token && cc->token!='}') { + switch (PrsKeyWord(cc)) { + case KW_END: + OptFree(tempi_jmp); + goto sw_sub_end; + case KW_START: + case KW_CASE: + case KW_DFT: + if (cc->coc.coc_head.last==tempi_start) { + OptFree(tempi_jmp); + tempss->lb_start=NULL; + } else { + ICAdd(cc,IC_RET,0,0); + ICAdd(cc,IC_LABEL,lb_fwd_case,0); + ICAdd(cc,IC_SUB_CALL,tempss->lb_start,0);//In case fall-thru + } + goto sw_cont; + default: + PrsStmt(cc,try_cnt); + } + } + break; + case KW_CASE: + if (head.next!=&head) { + lb_fwd_case=COCMiscNew(cc,CMT_LABEL); + tempi_jmp=ICAdd(cc,IC_JMP,lb_fwd_case,0);//In case fall-thru + } + Lex(cc); + lb_entry=COCMiscNew(cc,CMT_LABEL); + ICAdd(cc,IC_LABEL,lb_entry,0); + lb_entry->use_cnt++; + if (head.next!=&head) { + tempss=head.next; + while (tempss!=&head) { + if (tempss->lb_start) + ICAdd(cc,IC_SUB_CALL,tempss->lb_start,0); + tempss=tempss->next; + } + ICAdd(cc,IC_LABEL,lb_fwd_case,0); + } + if (cc->token==':') { + if (k_start==MIN_I64) + k_start=0; + else + k_start++; + } else + k_start=LexExpressionI64(cc); + if (k_starthi) hi=k_start; + if (cc->token==':') { + Lex(cc); + temps=MAlloc(sizeof(CSwitchCase)); + temps->label=lb_entry; + temps->val=k_start; + temps->next=header; + header=temps; + } else if (cc->token==TK_ELLIPSIS) { + Lex(cc); + k_end=LexExpressionI64(cc); + if (cc->token==':') { + Lex(cc); + if (k_endhi) hi=k_end; + if (k_start>k_end) + SwapI64(&k_start,&k_end); + for (i=k_start;i<=k_end;i++) { + temps=MAlloc(sizeof(CSwitchCase)); + temps->label=lb_entry; + temps->val=i; + temps->next=header; + header=temps; + } + k_start=k_end; + } else + LexExcept(cc,"Expecting ':' at "); + } else + LexExcept(cc,"Expecting ':' at "); + break; + case KW_DFT: + if (head.next!=&head) { + lb_fwd_case=COCMiscNew(cc,CMT_LABEL); + tempi_jmp=ICAdd(cc,IC_JMP,lb_fwd_case,0);//In case fall-thru + } + Lex(cc); + ICAdd(cc,IC_LABEL,lb_dft,0); + if (cc->token==':') + Lex(cc); + else + LexExcept(cc,"Expecting ':' at "); + if (head.next!=&head) { + tempss=head.next; + while (tempss!=&head) { + if (tempss->lb_start) + ICAdd(cc,IC_SUB_CALL,tempss->lb_start,0); + tempss=tempss->next; + } + ICAdd(cc,IC_LABEL,lb_fwd_case,0); + } + dft_found=TRUE; + break; + default: + PrsStmt(cc,try_cnt,head.last->lb_break); + } + } +sw_sub_end: + tempss=head.last; + ICAdd(cc,IC_LABEL,tempss->lb_break,0); + if (tempss==&head) { + if (cc->token!='}') + LexExcept(cc,"Missing '}' at "); + Lex(cc); + break; + } else { + QueRem(tempss); + Free(tempss); + if (PrsKeyWord(cc)!=KW_END) + LexExcept(cc,"Missing 'end' at "); + if (Lex(cc)==':') + Lex(cc); + else + LexExcept(cc,"Expecting ':' at "); + } + } + if (!dft_found) + ICAdd(cc,IC_LABEL,lb_dft,0); + + if (0hi || !(0ic_data=lo; + tempi_cmp->ic_data=range; + temps=header; + while (temps) { + temps1=temps->next; + if (jmp_table[temps->val-lo]!=lb_dft) + LexExcept(cc,"Duplicate case at "); + else + jmp_table[temps->val-lo]=temps->label; + Free(temps); + temps=temps1; + } + mc_jt->dft=lb_dft; + mc_jt->jmp_table=jmp_table; + mc_jt->range=range; +} + +U0 PrsNoWarn(CCmpCtrl *cc) +{ + CMemberLst *tempm; + while (cc->token==TK_IDENT) { + if (!(tempm=cc->local_var_entry)) + LexExcept(cc,"Expecting local var at "); + tempm->flags|=MLF_NO_UNUSED_WARN; + if (Lex(cc)==',') + Lex(cc); + else if (cc->token!=';') + LexExcept(cc,"Expecting ',' at "); + } +} + +U0 PrsStreamBlk(CCmpCtrl *cc) +{ + CLexHashTableContext *htc=MAlloc(sizeof(CLexHashTableContext)); + CStreamBlk *tempe=MAlloc(sizeof(CStreamBlk)); + tempe->body=StrNew(""); + QueIns(tempe,cc->last_stream_blk); + COCPush(cc); + QueInit(&cc->coc.coc_next_misc); + + MemCpy(htc,&cc->htc,sizeof(CLexHashTableContext)); + htc->old_flags=cc->flags; + cc->htc.next=htc; + cc->htc.fun=cc->htc.local_var_lst=NULL; + cc->htc.define_hash_table=cc->htc.hash_table_lst= + cc->htc.glbl_hash_table=cc->htc.local_hash_table=Fs->hash_table; + cc->flags=cc->flags & ~(CCF_ASM_EXPRESSIONS|CCF_AOT_COMPILE) | CCF_EXE_BLK; + if (cc->token=='{') + Lex(cc); + else + LexExcept(cc,"Missing '}' at "); + while (cc->token && cc->token!='}') + ExeCmdLine(cc); + + MemCpy(&cc->htc,htc,sizeof(CLexHashTableContext)); + cc->flags=cc->flags&~CCF_EXE_BLK | + htc->old_flags & (CCF_ASM_EXPRESSIONS|CCF_EXE_BLK|CCF_AOT_COMPILE); + Free(htc); + COCPop(cc); + QueRem(tempe); + if (*tempe->body) + LexIncludeStr(cc,"StreamBlk",tempe->body,FALSE); + else + Free(tempe->body); + Free(tempe); + Lex(cc); //Skip '}' +} + +U0 PrsTryBlk(CCmpCtrl *cc,I64 try_cnt) +{ + CCodeMisc *lb_catch,*lb_done,*lb_untry; + CHashClass *tempc=cmp.internal_types[RT_PTR]; + CHashFun *temp_try=HashFind("SysTry",cc->htc.hash_table_lst,HTT_FUN), + *temp_untry=HashFind("SysUntry",cc->htc.hash_table_lst,HTT_FUN); + + if (!temp_try || !temp_untry) + LexExcept(cc,"Missing header for SysTry() and SysUntry() at "); + + cc->flags|=CCF_NO_REG_OPT; //TODO:Currently no reg vars in funs with try/catch + + lb_catch=COCMiscNew(cc,CMT_LABEL); + lb_done =COCMiscNew(cc,CMT_LABEL); + lb_untry=COCMiscNew(cc,CMT_LABEL); + + ICAdd(cc,IC_CALL_START,0,0); + ICAdd(cc,IC_GET_LABEL,lb_untry,tempc,ICF_PUSH_RES); + ICAdd(cc,IC_GET_LABEL,lb_catch,tempc,ICF_PUSH_RES); + if (Bt(&temp_try->flags,Cf_EXTERN)) { + cc->abs_cnts.externs++; + if (cc->flags&CCF_AOT_COMPILE) + ICAdd(cc,IC_CALL_IMPORT,temp_try,tempc); + else + ICAdd(cc,IC_CALL_INDIRECT2,&temp_try->exe_addr,tempc); + } else + ICAdd(cc,IC_CALL,temp_try->exe_addr,tempc); + if ((Bt(&temp_try->flags,Ff_RET1) || + Bt(&temp_try->flags,Ff_ARGPOP)) && !Bt(&temp_try->flags,Ff_NOARGPOP)) + ICAdd(cc,IC_ADD_RSP1,16,tempc); + else + ICAdd(cc,IC_ADD_RSP,16,tempc); + ICAdd(cc,IC_CALL_END,0,tempc); + ICAdd(cc,IC_END_EXP,0,0,ICF_RES_NOT_USED); + + PrsStmt(cc,try_cnt+1); + + ICAdd(cc,IC_LABEL,lb_untry,0); + ICAdd(cc,IC_CALL_START,0,0); + if (Bt(&temp_untry->flags,Cf_EXTERN)) { + cc->abs_cnts.externs++; + if (cc->flags&CCF_AOT_COMPILE) + ICAdd(cc,IC_CALL_IMPORT,temp_untry,tempc); + else + ICAdd(cc,IC_CALL_INDIRECT2,&temp_untry->exe_addr,tempc); + } else + ICAdd(cc,IC_CALL,temp_untry->exe_addr,tempc); + ICAdd(cc,IC_CALL_END,0,tempc); + ICAdd(cc,IC_END_EXP,0,0,ICF_RES_NOT_USED); + + ICAdd(cc,IC_JMP,lb_done,0); + + if (PrsKeyWord(cc)!=KW_CATCH) + LexExcept(cc,"Missing 'catch' at"); + + Lex(cc); + ICAdd(cc,IC_LABEL,lb_catch,0); + PrsStmt(cc,try_cnt+1); + ICAdd(cc,IC_RET,0,tempc); + ICAdd(cc,IC_LABEL,lb_done,0); +} + +Bool PrsStmt(CCmpCtrl *cc,I64 try_cnt=0, + CCodeMisc *lb_break=NULL,I64 cmp_flags=CMPF_PRS_SEMICOLON) +{ + I64 i,fsp_flags=0; + CHashExport *tempex; + CCodeMisc *g_lb; + U8 *import_name; + CHashFun *temp_untry; + CAOT *tempaot; + if (cmp_flags&CMPF_ONE_ASM_INS) { + if (cc->flags&CCF_AOT_COMPILE || cc->aot_depth) + PrsAsmBlk(cc,CMPF_ONE_ASM_INS); + else if (tempaot=CmpJoin(cc,CMPF_ASM_BLK|CMPF_ONE_ASM_INS)) + CmpFixUpJITAsm(cc,tempaot); + fsp_flags=FSF_ASM; + } else + while (TRUE) { + while (cc->token==',') + Lex(cc); + if (cc->token=='{') { + Lex(cc); + while (cc->token!='}' && cc->token!=TK_EOF) + PrsStmt(cc,try_cnt,lb_break); + if (cc->lex_include_stk==cc->fun_lex_file) + cc->max_line=cc->lex_include_stk->line_num; + if (Lex(cc)!=',') goto sm_done; + } else if (cc->token==';') { + if (cmp_flags&CMPF_PRS_SEMICOLON) + Lex(cc); + if (cc->token!=',') goto sm_done; + } else { + if (cc->token==TK_IDENT) { + if (tempex=cc->hash_entry) { + if (tempex->type & HTT_KEYWORD) { + i=tempex(CHashGeneric *)->user_data0; + switch [i] { + case KW_NUM_KEYWORDS-1: //nobound switch + default: //A keyword that is not valid here is just a symbol. + goto sm_not_keyword_afterall; + start: + case KW_ASM: + if (cc->htc.fun) { + if (tempaot=CmpJoin(cc,CMPF_ASM_BLK)) + ICAdd(cc,IC_ASM,tempaot,0); + Lex(cc); //Skip '}' of asm{} + } else { + if (cc->flags&CCF_AOT_COMPILE || cc->aot_depth) { + Lex(cc); + PrsAsmBlk(cc,0); + if (cc->flags&CCF_AOT_COMPILE && cc->aot_depth==1) + Lex(cc); //Skip '}' of asm{} + } else { + if (tempaot=CmpJoin(cc,CMPF_ASM_BLK)) + CmpFixUpJITAsm(cc,tempaot); + Lex(cc); //Skip '}' of asm{} + } + fsp_flags=FSF_ASM; + } + break; + start: + Lex(cc); + case KW_LOCK: + cc->lock_cnt++; + PrsStmt(cc,try_cnt); + cc->lock_cnt--; + break; + case KW_TRY: + PrsTryBlk(cc,try_cnt); + break; + case KW_IF: + PrsIf(cc,try_cnt,lb_break); + break; + case KW_FOR: + PrsFor(cc,try_cnt); + break; + case KW_WHILE: + PrsWhile(cc,try_cnt); + break; + case KW_DO: + PrsDoWhile(cc,try_cnt); + break; + case KW_SWITCH: + PrsSwitch(cc,try_cnt); + break; + end: + end: + if (cc->token!=',') goto sm_done; + break; + start: + if (cc->htc.fun) + LexExcept(cc,"Not allowed in fun"); + Lex(cc); + case KW__EXTERN: + if (Bt(&cc->opts,OPTf_EXTERNS_TO_IMPORTS)) + goto sm_underscore_import; + if (cc->token!=TK_IDENT || !(tempex=cc->hash_entry) || + !(tempex->type & HTT_EXPORT_SYS_SYM)) + LexExcept(cc,"Expecting system sym at "); + if (*cc->cur_str=='_') + fsp_flags|=FSF__; + i=tempex->val; + Lex(cc); + if (cc->token!=TK_IDENT || !(tempex=cc->hash_entry) || + !(tempex->type & (HTT_CLASS|HTT_INTERNAL_TYPE))) + LexExcept(cc,"Expecting type at "); + Lex(cc); + PrsGlblVarLst(cc,PRS0__EXTERN|PRS1_NULL,tempex,i,fsp_flags); + break; + case KW__IMPORT: +sm_underscore_import: + if (cc->token!=TK_IDENT) + LexExcept(cc,"Expecting system sym at "); + if (*cc->cur_str=='_') + fsp_flags|=FSF__; + import_name=cc->cur_str; + cc->cur_str=0; + if (Lex(cc)!=TK_IDENT || !(tempex=cc->hash_entry) || + !(tempex->type & (HTT_CLASS|HTT_INTERNAL_TYPE))) + LexExcept(cc,"Expecting type at "); + Lex(cc); + PrsGlblVarLst(cc,PRS0__IMPORT|PRS1_NULL,tempex, + import_name,fsp_flags); + Free(import_name); + break; + case KW_EXTERN: + if (cc->token!=TK_IDENT) + LexExcept(cc,"Expecting type at "); + tempex=cc->hash_entry; + i=PrsKeyWord(cc); + if (i==KW_CLASS||i==KW_UNION) { + Lex(cc); + PrsClass(cc,i,fsp_flags,TRUE); + fsp_flags&=FSF_ASM; + goto sm_semicolon; + } + if (!tempex || + !(tempex->type & (HTT_CLASS|HTT_INTERNAL_TYPE))) + LexExcept(cc,"Expecting type at "); + if (Bt(&cc->opts,OPTf_EXTERNS_TO_IMPORTS)) + goto sm_import; + Lex(cc); + PrsGlblVarLst(cc,PRS0_EXTERN|PRS1_NULL,tempex,0,fsp_flags); + break; + case KW_IMPORT: + if (cc->token!=TK_IDENT || !(tempex=cc->hash_entry) || + !(tempex->type & (HTT_CLASS|HTT_INTERNAL_TYPE))) + LexExcept(cc,"Expecting type at "); +sm_import: + Lex(cc); + PrsGlblVarLst(cc,PRS0_IMPORT|PRS1_NULL,tempex,0,fsp_flags); + break; + case KW__INTERN: + i=LexExpressionI64(cc); + if (cc->token!=TK_IDENT || !(tempex=cc->hash_entry) || + !(tempex->type & (HTT_CLASS|HTT_INTERNAL_TYPE))) + LexExcept(cc,"Expecting type at "); + Lex(cc); + PrsGlblVarLst(cc,PRS0__INTERN|PRS1_NULL,tempex,i,fsp_flags); + break; + end: + fsp_flags&=FSF_ASM; + break; + start: + case KW_STATIC: + fsp_flags=FSF_STATIC|fsp_flags&FSF_ASM; + break; + case KW_INTERRUPT: + fsp_flags=FSF_INTERRUPT|FSF_NOARGPOP| + fsp_flags&(FSG_FUN_FLAGS2|FSF_ASM); + break; + case KW_HASERRCODE: + fsp_flags=FSF_HASERRCODE|fsp_flags&(FSG_FUN_FLAGS2|FSF_ASM); + break; + case KW_ARGPOP: + fsp_flags=FSF_ARGPOP|fsp_flags&(FSG_FUN_FLAGS2|FSF_ASM); + break; + case KW_NOARGPOP: + fsp_flags=FSF_NOARGPOP|fsp_flags&(FSG_FUN_FLAGS2|FSF_ASM); + break; + case KW_PUBLIC: + fsp_flags=FSF_PUBLIC|fsp_flags&(FSG_FUN_FLAGS2|FSF_ASM); + break; + end: + Lex(cc); + break; + case KW_RETURN: + if (!cc->htc.fun) + LexExcept(cc,"Not in fun. Can't return a val "); + if (try_cnt) { + temp_untry=HashFind("SysUntry", + cc->htc.hash_table_lst,HTT_FUN); + for (i=0;iflags,Cf_EXTERN)) { + cc->abs_cnts.externs++; + if (cc->flags&CCF_AOT_COMPILE) + ICAdd(cc,IC_CALL_IMPORT, + temp_untry,cmp.internal_types[RT_PTR]); + else + ICAdd(cc,IC_CALL_INDIRECT2, + &temp_untry->exe_addr, + cmp.internal_types[RT_PTR]); + } else + ICAdd(cc,IC_CALL,temp_untry->exe_addr, + cmp.internal_types[RT_PTR]); + } + } + if (Lex(cc)!=';') { + if (!cc->htc.fun->return_class->size) + LexWarn(cc,"Function should NOT return val "); + if (!PrsExpression(cc,NULL,FALSE)) + throw('Compiler'); + ICAdd(cc,IC_RETURN_VAL,0,cc->htc.fun->return_class); + cc->flags|=CCF_HAS_RETURN; + } else if (cc->htc.fun->return_class->size) + LexWarn(cc,"Function should return val "); + ICAdd(cc,IC_JMP,cc->lb_leave,0); + goto sm_semicolon; + case KW_GOTO: + if (Lex(cc)!=TK_IDENT) + LexExcept(cc,"Expecting identifier at "); + if (!(g_lb=COCGoToLabelFind(cc,cc->cur_str))) { + g_lb=COCMiscNew(cc,CMT_GOTO_LABEL); + g_lb->str=cc->cur_str; + cc->cur_str=NULL; + } + g_lb->use_cnt++; + ICAdd(cc,IC_JMP,g_lb,0); + Lex(cc); + goto sm_semicolon; + case KW_BREAK: + Lex(cc); + if (!lb_break) + LexExcept(cc,"'break' not allowed\n"); + ICAdd(cc,IC_JMP,lb_break,0); + goto sm_semicolon; + case KW_NO_WARN: + Lex(cc); + PrsNoWarn(cc); + goto sm_semicolon; + case KW_UNION: + case KW_CLASS: + Lex(cc); + tempex=PrsClass(cc,i,fsp_flags,FALSE); + if (!cc->htc.fun && cc->token!=';') { + PrsGlblVarLst(cc,PRS0_NULL|PRS1_NULL,tempex,0,fsp_flags); + fsp_flags&=FSF_ASM; + break; + } else { + fsp_flags&=FSF_ASM; + goto sm_semicolon; + } + } + } else {//Ident, found in hash table, not keyword +sm_not_keyword_afterall: + if (tempex->type & (HTT_CLASS|HTT_INTERNAL_TYPE)) { + if (cc->htc.fun) { + if (fsp_flags&FSF_STATIC) + PrsVarLst(cc,cc->htc.fun,PRS0_NULL|PRS1_STATIC_LOCAL_VAR); + else + PrsVarLst(cc,cc->htc.fun,PRS0_NULL|PRS1_LOCAL_VAR); + if (cc->token=='}') goto sm_done; + } else { + Lex(cc); + PrsGlblVarLst(cc,PRS0_NULL|PRS1_NULL,tempex,0,fsp_flags); + } + } else { + if (tempex->type & (HTT_OPCODE|HTT_ASM_KEYWORD)) { + if (cc->htc.fun) { + if (tempaot=CmpJoin(cc,CMPF_ASM_BLK|CMPF_ONE_ASM_INS)) + ICAdd(cc,IC_ASM,tempaot,0); + } else + LexExcept(cc,"Use Asm Blk at "); + if (cc->token!=',') goto sm_done; + } else + goto sm_prs_exp; + } + fsp_flags&=FSF_ASM; + } + } else {//Ident, not in hash table + if (cc->local_var_entry) + goto sm_prs_exp; + if (!(g_lb=COCGoToLabelFind(cc,cc->cur_str))) { + g_lb=COCMiscNew(cc,CMT_GOTO_LABEL); + g_lb->str=cc->cur_str; + cc->cur_str=NULL; + } else if (g_lb->flags&CMF_DEFINED) + LexExcept(cc,"Duplicate goto label at "); + g_lb->flags|=CMF_DEFINED; + ICAdd(cc,IC_LABEL,g_lb,0); + if (Lex(cc)==':') //skip cur_str + Lex(cc); //skip colon + else + LexExcept(cc,"Undefined identifier at "); + if (!cc->htc.fun) + LexExcept(cc,"No global labels at "); + if (cc->token!=',') goto sm_done; + } + } else if (cc->token==TK_STR||cc->token==TK_CHAR_CONST) { + PrsFunCall(cc,NULL,FALSE,NULL); + goto sm_semicolon; + } else if (cc->token!=TK_EOF) {//Non-cur_str symbol, num or something +sm_prs_exp: + if (!PrsExpression(cc,NULL,TRUE)) + throw('Compiler'); +sm_semicolon: + if (cmp_flags&CMPF_PRS_SEMICOLON) { + if (cc->token==';') + Lex(cc); + else if (cc->token!=',') + LexExcept(cc,"Missing ';' at"); + } + if (cc->token!=',') goto sm_done; + } else + goto sm_done; //TK_EOF + } + } +sm_done: + return fsp_flags&FSF_ASM; +} diff --git a/Compiler/PrsVar.CPP b/Compiler/PrsVar.CPP deleted file mode 100644 index 36040b4..0000000 --- a/Compiler/PrsVar.CPP +++ /dev/null @@ -1,734 +0,0 @@ -U0 PrsVarInit(CCmpCtrl *cc,U8 **_dst,CHashClass *tempc,CArrayDim *tempad, - U8 *data_addr_ip,U8 **_base,Bool data_heap,I64 pass) -{ - U8 *dst=*_dst,*machine_code; - I64 i,j,r,old_flags,type,size; - CMemberLst *tempm; - CIntermediateCode *tempi; - CAOTCtrl *aotc=cc->aotc; - CAOTAbsAddr *tempa; - CAOTImportExport *tempie; - Bool is_str; - - tempc=OptClassFwd(tempc); - if (tempm=tempc->member_lst_and_root) { - if (cc->token!='{') - LexExcept(cc,"Expecting '{' at "); - LexPopNoRestore(cc); - LexPush(cc); - Lex(cc); - while (tempm) { - PrsVarInit2(cc,&dst,tempm->member_class,&tempm->dim, - data_addr_ip,_base,data_heap,pass); - if (cc->token==',') - Lex(cc); - tempm=tempm->next; - } - LexPopNoRestore(cc); - if (cc->token!='}') - LexExcept(cc,"Missing '}' at "); - Lex(cc); - } else { - if (tempc->ptr_stars_cnt==1 && - ((tempc-1)->raw_type==RT_I8 || (tempc-1)->raw_type==RT_U8) && - !tempad && cc->token==TK_STR) - is_str=TRUE; - else - is_str=FALSE; - if (cc->flags&CCF_AOT_COMPILE && is_str) { - LexPopNoRestore(cc); - machine_code=LexExtStr(cc,&i); - if (pass==2) { - tempa=CAlloc(sizeof(CAOTAbsAddr)); - tempa->next=aotc->abss; - tempa->type=AAT_ADD_U64; - aotc->abss=tempa; - tempa->ip=data_addr_ip+dst-*_base; - *dst(I64 *)=aotc->ip; - for (j=0;jflags; - cc->flags=CCF_NO_ABSS | cc->flags & - ~(CCF_AOT_COMPILE|CCF_HAS_MISC_DATA|CCF_NOT_CONST); - machine_code=LexExpression2Bin(cc,&type); - if (old_flags&CCF_AOT_COMPILE && - cc->flags&CCF_NOT_CONST && - !Bt(&cc->opts,OPTf_GLBLS_ON_DATA_HEAP)) { - cc->flags=cc->flags&~CCF_NO_ABSS|CCF_AOT_COMPILE; - Free(machine_code); - if (pass==2) { - MemSet(dst,0,tempc->size); - LexPopRestore(cc); - Lex(cc); - COCPush(cc); - COCInit(cc); - ICAdd(cc,IC_ABS_ADDR,data_addr_ip,tempc+1); - ICAdd(cc,IC_IMM_I64,dst-*_base,tempc+1); - ICAdd(cc,IC_ADD,0,tempc+1); - if (!PrsExpression(cc,NULL,TRUE)) - throw('Compiler'); - tempi=cc->coc.coc_head.last; - if (tempi->ic_code==IC_END_EXP) { - tempi->ic_code=IC_NOP1; - tempi->ic_flags=0; - } - ICAdd(cc,IC_ASSIGN,0,tempc); - ICAdd(cc,IC_END_EXP,0,tempc,ICF_RES_NOT_USED); - ICAdd(cc,IC_RET,0,0); - if (machine_code=COCCompile(cc,&size,NULL,NULL)) { - tempie=CAlloc(sizeof(CAOTImportExport)); - tempie->type=IET_MAIN; - tempie->ip=cc->aotc->ip; - QueIns(tempie,cc->aot->last_ie); - for (i=0;iflags & CCF_HAS_MISC_DATA)||pass==1) - Free(machine_code); - - if (type==RT_F64 && - tempc->raw_type!=RT_F64) - r=r(F64); - else if (type!=RT_F64 && - tempc->raw_type==RT_F64) - r(F64)=r; - MemCpy(dst,&r,tempc->size); - } - } - dst+=tempc->size; - cc->flags=cc->flags& - ~CCF_NO_ABSS|old_flags&(CCF_HAS_MISC_DATA|CCF_AOT_COMPILE); - } - *_dst=dst; -} - -class CVI2 -{ - CVI2 *next,*last; - U0 base; -}; - -U0 PrsVarInit2(CCmpCtrl *cc,U8 **_dst,CHashClass *tempc, - CArrayDim *tempad,U8 *data_addr_ip,U8 **_base,Bool data_heap,I64 pass) -{ - I64 i,j,cnt; - U8 *st,*_b; - CVI2 head,*tempvi,*tempvi1; - CArrayDim *tempad1; - tempc=OptClassFwd(tempc); - if (tempad1=tempad->next) { - if (!tempc->ptr_stars_cnt && - (tempc->raw_type==RT_I8 || tempc->raw_type==RT_U8) && - cc->token==TK_STR) { - LexPopNoRestore(cc); - st=LexExtStr(cc,&i); - if (tempad1->cnt<0) {//[] - tempad1->cnt=i; - tempad->total_cnt=i*tempad1->total_cnt; - Free(*_base); - if (data_heap) - *_base=MAlloc(i); - else - *_base=MAlloc(i,Fs->code_heap); - MemCpy(*_base,st,i); - *_dst=*_base+i; - } else { - MemCpy(*_dst,st,tempad1->cnt); - *_dst+=tempad1->cnt; - } - Free(st); - LexPush(cc); - } else { - if (cc->token=='{') { - LexPopNoRestore(cc); - LexPush(cc); - Lex(cc); - } - if (tempad1->cnt<0) {//[] - QueInit(&head); - cnt=0; - while (cc->token!='}') { - tempvi=MAlloc(offset(CVI2.base)+tempad1->total_cnt*tempc->size); - _b=&tempvi->base; - PrsVarInit2(cc,&_b,tempc,tempad1,data_addr_ip,_base,data_heap,pass); - QueIns(tempvi,head.last); - if (cc->token==',') - Lex(cc); - cnt++; - } - Lex(cc); //skip '}' - tempad1->cnt=cnt; - tempad->total_cnt=cnt*tempad1->total_cnt; - j=tempad1->total_cnt*tempc->size; - i=cnt*j; - Free(*_base); - if (data_heap) - *_base=_b=MAlloc(i); - else - *_base=_b=MAlloc(i,Fs->code_heap); - tempvi=head.next; - while (tempvi!=&head) { - tempvi1=tempvi->next; - MemCpy(_b,&tempvi->base,j); - _b+=j; - Free(tempvi); - tempvi=tempvi1; - } - *_dst=_b; - } else { - for (i=0;icnt;i++) { - PrsVarInit2(cc,_dst,tempc,tempad1,data_addr_ip,_base,data_heap,pass); - if (tempad1->cnt>1 && cc->token==',') - Lex(cc); - } - if (cc->token=='}') - Lex(cc); - } - } - } else { - PrsVarInit(cc,_dst,tempc,tempad1,data_addr_ip,_base,data_heap,pass); - LexPush(cc); - } -} - -U0 PrsGlblInit(CCmpCtrl *cc,CHashGlblVar *tempg,I64 pass) -{ - U8 *dst=tempg->data_addr; - PrsVarInit2(cc,&dst,tempg->var_class,&tempg->dim, - tempg->data_addr_ip,&tempg->data_addr, - Bt(&cc->opts,OPTf_GLBLS_ON_DATA_HEAP)|| - Bt(&cc->flags,CCf_AOT_COMPILE),pass); -} - -U0 PrsStaticInit(CCmpCtrl *cc,CMemberLst *tempm,I64 pass) -{ - U8 *machine_code,*dst=tempm->static_data; - CHashClass *tempc=tempm->member_class; - I64 i,size; - CAOTImportExport *tempie; - - if (cc->flags&CCF_AOT_COMPILE && pass==2) { - COCPush(cc); - COCInit(cc); - } - PrsVarInit2(cc,&dst,tempc,&tempm->dim,tempm->static_data_ip, - &tempm->static_data,Bt(&cc->flags,CCf_AOT_COMPILE),pass); - if (cc->flags&CCF_AOT_COMPILE && pass==2) { - if (cc->coc.coc_head.next!=&cc->coc.coc_head) { - ICAdd(cc,IC_RET,0,0); - if (machine_code=COCCompile(cc,&size,NULL,NULL)) { - if (pass==2) { - tempie=CAlloc(sizeof(CAOTImportExport)); - tempie->type=IET_MAIN; - tempie->ip=cc->aotc->ip; - QueIns(tempie,cc->aot->last_ie); - for (i=0;inext!=0 for array - CArrayDim *tempad,*tempad1; - I64 j; - Bool res=TRUE; - dim->next=NULL; - dim->cnt=0; - dim->total_cnt=1; - tempad1=&dim->next; - if (cc->token=='[') { - if (mode.u8[1]==PRS1B_FUN_ARG) - LexExcept(cc,"No arrays in fun args at "); - do { - if (Lex(cc)==']' && !dim->next) { - j=-1; - res=FALSE; - } else { - if ((j=LexExpressionI64(cc))<0) - LexExcept(cc,"Invalid array size at "); - } - tempad1=&dim->next; - while (tempad1->next) { - tempad1->next->total_cnt*=j; - tempad1=tempad1->next; - } - tempad=MAlloc(sizeof(CArrayDim)); - tempad1->next=tempad; - tempad1=tempad; - tempad->next=NULL; - tempad->cnt=j; - tempad->total_cnt=1; - dim->total_cnt*=j; - if (cc->token!=']') - LexExcept(cc,"Missing ']' at "); - } while (Lex(cc)=='['); - } - return res; -} - -CHashClass *PrsType(CCmpCtrl *cc,CHashClass **_tempc1, - I64 *_mode,CMemberLst *tempm,U8 **_ident,CHashFun **_fun_ptr, - CHashExport **_tempex,CArrayDim *tempad,I64 fsp_flags) -{ - I64 k,ptr_stars_cnt,mode=*_mode; - CHashClass *tempc1=*_tempc1,*tempc2; - CHashFun *fun_ptr=NULL; - CHashExport *tempex=NULL; - CArrayDim *tempad2; - - pt_start: - if (!tempc1 || !(tempc1->type & (HTT_CLASS|HTT_INTERNAL_TYPE))) - LexExcept(cc,"Invalid class at "); - - ptr_stars_cnt=0; - while (cc->token=='*') { - if (mode.u8[1]) { - LexPopNoRestore(cc); - LexPush(cc); - } - Lex(cc); - tempc1++; - if (++ptr_stars_cnt>MAX_PTR_STARS) - LexExcept(cc,"Too many *'s at "); - } - - k=PrsKeyWord(cc); - if (k==KW_UNION || k==KW_CLASS) { - Lex(cc); - tempc2=PrsClass(cc,k,fsp_flags,mode&255==PRS0_EXTERN); - tempc2->fwd_class=tempc1; - tempc1=tempc2; - if (_tempc1) *_tempc1=tempc1; - mode=PRS0_NULL|PRS1_NULL; - goto pt_start; - } - - if (cc->token=='(') { - if (Lex(cc)!='*') - LexExcept(cc,"Expecting '*' at "); - ptr_stars_cnt=1; //fun_ptr - while (Lex(cc)=='*') - ptr_stars_cnt++; //fun_ptr - if (ptr_stars_cnt>MAX_PTR_STARS) - LexExcept(cc,"Too many *'s at "); - } else - ptr_stars_cnt=-1; //fun_ptr - - if (_ident) { - if (cc->token==TK_IDENT) { - tempex=cc->hash_entry; - *_ident=cc->cur_str; - cc->cur_str=NULL; - Lex(cc); - } else { - if (!mode.u8[1]) - *_ident=NULL; - else if (cc->token==',' || cc->token==';' || cc->token==')') { - tempex=NULL; - *_ident=StrNew("_anon_"); - tempm->flags|=MLF_NO_UNUSED_WARN; - } else - LexExcept(cc,"Expecting identifier at "); - } - } - - if (ptr_stars_cnt>=0) { //fun_ptr - if (cc->token!=')') - LexExcept(cc,"Missing ')' at "); - if (Lex(cc)!='(') - LexExcept(cc,"Expecting '(' at "); - fun_ptr=PrsFunJoin(cc,tempc1,NULL,fsp_flags)+ptr_stars_cnt; - tempc1=cmp.internal_types[RT_PTR]+ptr_stars_cnt; - } - if (!PrsArrayDims(cc,mode,tempad) && cc->token!='=') { - tempc1++; - tempad2=tempad->next->next; - Free(tempad->next); - tempad->next=tempad2; - } - - tempc2=OptClassFwd(tempc1); - if (tempc2->ptr_stars_cnt) { - tempc2-=tempc2->ptr_stars_cnt; - if (tempc2->type&HTT_INTERNAL_TYPE && !tempc2->size) - LexWarn(cc,"use \"U8 *\" instead of \"U0 *\" at "); - } - - if (_mode) *_mode=mode; - if (_fun_ptr) *_fun_ptr=fun_ptr; - if (_tempex) *_tempex=tempex; - return tempc1; -} - -U0 PrsDotDotDot(CCmpCtrl *cc,CHashFun *tempf,I64 _reg) -{ - CMemberLst *tempm; - CArrayDim *tempad; - - Bts(&tempf->flags,Ff_DOT_DOT_DOT); - - Lex(cc); - tempm=MemberLstNew(_reg); - tempm->flags=MLF_DOT_DOT_DOT; - tempm->member_class=cmp.internal_types[RT_I64]; - tempm->str=StrNew("argc"); - tempm->offset=tempf->size; - tempm->size=8; - tempf->size+=8; - MemberAdd(cc,tempm,tempf,PRS1B_FUN_ARG); - - tempm=MemberLstNew(_reg); - tempm->flags=MLF_DOT_DOT_DOT; - tempm->member_class=cmp.internal_types[RT_I64]; - tempm->str=StrNew("argv"); - tempm->dim.total_cnt=127; //arbitrary - tempm->dim.next=tempad=MAlloc(sizeof(CArrayDim)); - tempad->next=NULL; - tempad->cnt=127; //arbitrary - tempad->total_cnt=1; - tempm->offset=tempf->size; - tempm->size=8; //Close enough - tempf->size+=8;//Close enough - MemberAdd(cc,tempm,tempf,PRS1B_FUN_ARG); - - if (cc->token==')') - Lex(cc); -} - -U0 PrsVarLst(CCmpCtrl *cc,CHashClass *tempc,I64 mode,I64 union_base=0) -{ - I64 i,k,old_flags=cc->flags,old_flags2,type,_reg; - CHashClass *tempc1,*tempc2; - CHash *temph; - CMemberLst *tempm; - CMemberLstMeta *temp_meta; - U8 *machine_code; - Bool undef_array_size,first; - cc->flags|=CCF_DONT_MAKE_RES; - if (mode.u8[1]==PRS1B_CLASS) - cc->flags|=CCF_CLASS_IP; - if ((mode.u8[1]!=PRS1B_LOCAL_VAR && mode.u8[1]!=PRS1B_STATIC_LOCAL_VAR || - mode&PRSF_UNION) && (cc->token=='(' || cc->token=='{')) - Lex(cc); - while (TRUE) { - while (cc->token==';') - Lex(cc); - if (mode&PRSF_UNION) - cc->class_ip=union_base; - else - cc->class_ip=tempc->size; - while (cc->token=='$$') { - if (Lex(cc)!='=') //skip $$ - LexExcept(cc,"Expecting '=' at "); - Lex(cc); //skip = - cc->class_ip=LexExpression(cc); - if (-cc->class_ip>tempc->neg_offset) - tempc->neg_offset=-cc->class_ip; - if (mode&PRSF_UNION) - union_base=cc->class_ip; - else - tempc->size=cc->class_ip; - if (cc->token!=';') - LexExcept(cc,"Missing ';' at"); - Lex(cc); //skip ; - } - if (cc->token==')' || cc->token=='}') { - Lex(cc); - goto pvl_done; - } - _reg=REG_UNDEF; -pvl_restart1: - switch (PrsKeyWord(cc)) { - case KW_REG: - _reg=REG_ALLOC; - if (Lex(cc)==TK_IDENT) { - k=DefineMatch(cc->cur_str,"ST_U64_REGS"); - if (k>=0) { - _reg=k; - Lex(cc); - } - } - goto pvl_restart1; - case KW_NOREG: - _reg=REG_NONE; - Lex(cc); - goto pvl_restart1; - } - - if (cc->token==TK_DOT_DOT_DOT && mode.u8[1]==PRS1B_FUN_ARG) { - PrsDotDotDot(cc,tempc,_reg); - goto pvl_done; - } - if (cc->token==TK_IDENT) - temph=cc->hash_entry; - else - temph=NULL; - if (!temph) - LexExcept(cc,"Expecting type at "); - k=PrsKeyWord(cc); - if (k==KW_UNION) { - Lex(cc); - PrsVarLst(cc,tempc,mode|PRSF_UNION,tempc->size); - } else { - if (!(temph->type & (HTT_CLASS|HTT_INTERNAL_TYPE))) - LexExcept(cc,"Expecting type at "); - first=TRUE; -pvl_restart2: - tempc1=temph; - LexPush(cc); - Lex(cc); //skip type or ',' - tempm=MemberLstNew(_reg); - _reg=REG_UNDEF; - if (mode.u8[1]==PRS1B_STATIC_LOCAL_VAR) { - tempm->flags|=MLF_STATIC; - tempm->reg=REG_NONE; - } - if (mode.u8[1]==PRS1B_FUN_ARG || mode.u8[1]==PRS1B_LOCAL_VAR) { -pvl_restart3: - switch (PrsKeyWord(cc)) { - case KW_REG: - tempm->reg=REG_ALLOC; - LexPopNoRestore(cc); - LexPush(cc); - if (Lex(cc)==TK_IDENT) { - k=DefineMatch(cc->cur_str,"ST_U64_REGS"); - if (k>=0) { - tempm->reg=k; - LexPopNoRestore(cc); - LexPush(cc); - Lex(cc); - } - } - goto pvl_restart3; - case KW_NOREG: - tempm->reg=REG_NONE; - LexPopNoRestore(cc); - LexPush(cc); - Lex(cc); - goto pvl_restart3; - } - } - tempm->member_class=PrsType(cc,&tempc1,&mode,tempm,&tempm->str, - &tempm->fun_ptr,NULL,&tempm->dim,0); - if (tempm->fun_ptr) - tempm->flags|=MLF_FUN; - if (first) - MemberAdd(cc,tempm,tempc,mode.u8[1]); - else - MemberAdd(cc,tempm,tempc,PRS1B_NULL); - tempc->member_cnt++; - - tempc2=tempm->member_class; - i=tempc2->size*tempm->dim.total_cnt; - switch (mode.u8[1]) { - case PRS1B_STATIC_LOCAL_VAR: - if (i<0) { - i=0; - undef_array_size=TRUE; - } else - undef_array_size=FALSE; - if (mode&PRSF_UNION) - LexExcept(cc,"Static unions are not implemented "); - k=(i+7)&~7; - if (cc->flags&CCF_AOT_COMPILE) - tempm->static_data=MAlloc(k); - else - tempm->static_data=MAlloc(k,Fs->code_heap); - if (cc->flags&CCF_AOT_COMPILE) { - tempm->static_data_ip=cc->aotc->ip; - k>>=3; - if (sys_var_init_flag) { - k<<=3; - while (k--) - AOTStoreCodeU8(cc,sys_var_init_val); - } else - while (k--) - AOTStoreCodeU64(cc,0); - } else - if (sys_var_init_flag) - MemSet(tempm->static_data,sys_var_init_val,k); - LexPopNoRestore(cc); - if (cc->token=='=') { - cc->flags=cc->flags& - ~CCF_DONT_MAKE_RES|old_flags&CCF_DONT_MAKE_RES; - if (undef_array_size) { - LexPush(cc); - LexPush(cc); - Lex(cc); //skip = - PrsStaticInit(cc,tempm,1); - LexPopNoRestore(cc); - i=tempc2->size*tempm->dim.total_cnt; - k=(i+7)&~7; - if (cc->flags&CCF_AOT_COMPILE) { - k>>=3; - if (sys_var_init_flag) { - k<<=3; - while (k--) - AOTStoreCodeU8(cc,sys_var_init_val); - } else - while (k--) - AOTStoreCodeU64(cc,0); - } else - if (sys_var_init_flag) - MemSet(tempm->static_data,sys_var_init_val,k); - LexPopRestore(cc); - } - LexPush(cc); - Lex(cc); //skip = - PrsStaticInit(cc,tempm,2); - LexPopNoRestore(cc); - if (cc->flags&CCF_AOT_COMPILE) - for (k=0;kstatic_data_ip+k, - tempm->static_data[k]); - tempm->use_cnt=0; - cc->flags|=CCF_DONT_MAKE_RES; - } - if (cc->flags&CCF_AOT_COMPILE) - Free(tempm->static_data); - break; - case PRS1B_LOCAL_VAR: - if (mode&PRSF_UNION) { - if (union_base-tempc->sizesize; - else - i=0; - } - if (i>=8) - tempc->size=(tempc->size-i)&~7; - else if (i>=4) - tempc->size=(tempc->size-i)&~3; - else if (i>=2) - tempc->size=(tempc->size-i)&~1; - else - tempc->size-=i; - tempm->offset=tempc->size; - tempm->size=i; - if (cc->token=='=') { - cc->flags=cc->flags&~CCF_DONT_MAKE_RES| - old_flags&CCF_DONT_MAKE_RES; - LexPopRestore(cc); - Lex(cc); - if (!PrsExpression(cc,NULL,TRUE)) - throw('Compiler'); - tempm->use_cnt=0; - cc->flags|=CCF_DONT_MAKE_RES; - } else - LexPopNoRestore(cc); - break; - case PRS1B_FUN_ARG: - if (mode&PRSF_UNION) { - tempm->offset=union_base; - if (tempc->size-union_base<8) - tempc->size=8+union_base; - } else { - tempm->offset=tempc->size; - tempc->size+=8; - } - tempm->size=8; - if (cc->token=='=') { - Lex(cc); - if (PrsKeyWord(cc)==KW_LASTCLASS) { - tempm->flags|=MLF_LASTCLASS; - Lex(cc); - } else { - old_flags2=cc->flags; - cc->flags&=~CCF_HAS_MISC_DATA; - machine_code=LexExpression2Bin(cc,&type); - if (!machine_code) - throw('Compiler'); - tempm->dft_val=Call(machine_code); - tempc2=OptClassFwd(tempc2); - if (tempc2->raw_type==RT_F64) { - if (type!=RT_F64) - tempm->dft_val(F64)=tempm->dft_val; - } else { - if (type==RT_F64) - tempm->dft_val=tempm->dft_val(F64); - } - if (cc->flags & CCF_HAS_MISC_DATA) { - tempm->dft_val=StrNew(tempm->dft_val); - tempm->flags|=MLF_STR_DFT_AVAILABLE; - } - Free(machine_code); - cc->flags|=old_flags2&CCF_HAS_MISC_DATA; - } - tempm->flags|=MLF_DFT_AVAILABLE; - } - LexPopNoRestore(cc); - break; - case PRS1B_CLASS: - if (mode&PRSF_UNION) { - tempm->offset=union_base; - if (tempc->size-union_basesize=i+union_base; - } else { - tempm->offset=tempc->size; - tempc->size+=i; - } - tempm->size=i; - while (cc->token==TK_IDENT) { - temp_meta=MAlloc(sizeof(CMemberLstMeta)); - temp_meta->next=tempm->meta; - tempm->meta=temp_meta; - temp_meta->str=cc->cur_str; - temp_meta->flags=0; - cc->cur_str=NULL; - if (Lex(cc)==TK_STR) { - temp_meta->user_data=LexExtStr(cc); - temp_meta->flags|=MLMF_IS_STR; - } else - temp_meta->user_data=LexExpression(cc); - } - LexPopNoRestore(cc); - break; - } - switch (cc->token) { - case ',': - if (mode.u8[1]==PRS1B_FUN_ARG && !(mode&PRSF_UNION)) - Lex(cc); - else { - first=FALSE; - goto pvl_restart2; - } - break; - case ')': - case '}': - Lex(cc); - goto pvl_done; - case ';': - cc->flags=cc->flags&~CCF_DONT_MAKE_RES| - old_flags&CCF_DONT_MAKE_RES; - Lex(cc); - cc->flags|=CCF_DONT_MAKE_RES; - if ((mode.u8[1]==PRS1B_LOCAL_VAR||mode.u8[1]== - PRS1B_STATIC_LOCAL_VAR) && !(mode&PRSF_UNION)) - goto pvl_done; - break; - default: - LexExcept(cc,"Missing ';' at"); - } - } - } -pvl_done: - cc->flags=cc->flags&~(CCF_CLASS_IP|CCF_DONT_MAKE_RES)| - old_flags& (CCF_CLASS_IP|CCF_DONT_MAKE_RES); -} diff --git a/Compiler/PrsVar.HC b/Compiler/PrsVar.HC new file mode 100644 index 0000000..d5843b6 --- /dev/null +++ b/Compiler/PrsVar.HC @@ -0,0 +1,734 @@ +U0 PrsVarInit(CCmpCtrl *cc,U8 **_dst,CHashClass *tempc,CArrayDim *tempad, + U8 *data_addr_ip,U8 **_base,Bool data_heap,I64 pass) +{ + U8 *dst=*_dst,*machine_code; + I64 i,j,r,old_flags,type,size; + CMemberLst *tempm; + CIntermediateCode *tempi; + CAOTCtrl *aotc=cc->aotc; + CAOTAbsAddr *tempa; + CAOTImportExport *tempie; + Bool is_str; + + tempc=OptClassFwd(tempc); + if (tempm=tempc->member_lst_and_root) { + if (cc->token!='{') + LexExcept(cc,"Expecting '{' at "); + LexPopNoRestore(cc); + LexPush(cc); + Lex(cc); + while (tempm) { + PrsVarInit2(cc,&dst,tempm->member_class,&tempm->dim, + data_addr_ip,_base,data_heap,pass); + if (cc->token==',') + Lex(cc); + tempm=tempm->next; + } + LexPopNoRestore(cc); + if (cc->token!='}') + LexExcept(cc,"Missing '}' at "); + Lex(cc); + } else { + if (tempc->ptr_stars_cnt==1 && + ((tempc-1)->raw_type==RT_I8 || (tempc-1)->raw_type==RT_U8) && + !tempad && cc->token==TK_STR) + is_str=TRUE; + else + is_str=FALSE; + if (cc->flags&CCF_AOT_COMPILE && is_str) { + LexPopNoRestore(cc); + machine_code=LexExtStr(cc,&i); + if (pass==2) { + tempa=CAlloc(sizeof(CAOTAbsAddr)); + tempa->next=aotc->abss; + tempa->type=AAT_ADD_U64; + aotc->abss=tempa; + tempa->ip=data_addr_ip+dst-*_base; + *dst(I64 *)=aotc->ip; + for (j=0;jflags; + cc->flags=CCF_NO_ABSS | cc->flags & + ~(CCF_AOT_COMPILE|CCF_HAS_MISC_DATA|CCF_NOT_CONST); + machine_code=LexExpression2Bin(cc,&type); + if (old_flags&CCF_AOT_COMPILE && + cc->flags&CCF_NOT_CONST && + !Bt(&cc->opts,OPTf_GLBLS_ON_DATA_HEAP)) { + cc->flags=cc->flags&~CCF_NO_ABSS|CCF_AOT_COMPILE; + Free(machine_code); + if (pass==2) { + MemSet(dst,0,tempc->size); + LexPopRestore(cc); + Lex(cc); + COCPush(cc); + COCInit(cc); + ICAdd(cc,IC_ABS_ADDR,data_addr_ip,tempc+1); + ICAdd(cc,IC_IMM_I64,dst-*_base,tempc+1); + ICAdd(cc,IC_ADD,0,tempc+1); + if (!PrsExpression(cc,NULL,TRUE)) + throw('Compiler'); + tempi=cc->coc.coc_head.last; + if (tempi->ic_code==IC_END_EXP) { + tempi->ic_code=IC_NOP1; + tempi->ic_flags=0; + } + ICAdd(cc,IC_ASSIGN,0,tempc); + ICAdd(cc,IC_END_EXP,0,tempc,ICF_RES_NOT_USED); + ICAdd(cc,IC_RET,0,0); + if (machine_code=COCCompile(cc,&size,NULL,NULL)) { + tempie=CAlloc(sizeof(CAOTImportExport)); + tempie->type=IET_MAIN; + tempie->ip=cc->aotc->ip; + QueIns(tempie,cc->aot->last_ie); + for (i=0;iflags & CCF_HAS_MISC_DATA)||pass==1) + Free(machine_code); + + if (type==RT_F64 && + tempc->raw_type!=RT_F64) + r=r(F64); + else if (type!=RT_F64 && + tempc->raw_type==RT_F64) + r(F64)=r; + MemCpy(dst,&r,tempc->size); + } + } + dst+=tempc->size; + cc->flags=cc->flags& + ~CCF_NO_ABSS|old_flags&(CCF_HAS_MISC_DATA|CCF_AOT_COMPILE); + } + *_dst=dst; +} + +class CVI2 +{ + CVI2 *next,*last; + U0 base; +}; + +U0 PrsVarInit2(CCmpCtrl *cc,U8 **_dst,CHashClass *tempc, + CArrayDim *tempad,U8 *data_addr_ip,U8 **_base,Bool data_heap,I64 pass) +{ + I64 i,j,cnt; + U8 *st,*_b; + CVI2 head,*tempvi,*tempvi1; + CArrayDim *tempad1; + tempc=OptClassFwd(tempc); + if (tempad1=tempad->next) { + if (!tempc->ptr_stars_cnt && + (tempc->raw_type==RT_I8 || tempc->raw_type==RT_U8) && + cc->token==TK_STR) { + LexPopNoRestore(cc); + st=LexExtStr(cc,&i); + if (tempad1->cnt<0) {//[] + tempad1->cnt=i; + tempad->total_cnt=i*tempad1->total_cnt; + Free(*_base); + if (data_heap) + *_base=MAlloc(i); + else + *_base=MAlloc(i,Fs->code_heap); + MemCpy(*_base,st,i); + *_dst=*_base+i; + } else { + MemCpy(*_dst,st,tempad1->cnt); + *_dst+=tempad1->cnt; + } + Free(st); + LexPush(cc); + } else { + if (cc->token=='{') { + LexPopNoRestore(cc); + LexPush(cc); + Lex(cc); + } + if (tempad1->cnt<0) {//[] + QueInit(&head); + cnt=0; + while (cc->token!='}') { + tempvi=MAlloc(offset(CVI2.base)+tempad1->total_cnt*tempc->size); + _b=&tempvi->base; + PrsVarInit2(cc,&_b,tempc,tempad1,data_addr_ip,_base,data_heap,pass); + QueIns(tempvi,head.last); + if (cc->token==',') + Lex(cc); + cnt++; + } + Lex(cc); //skip '}' + tempad1->cnt=cnt; + tempad->total_cnt=cnt*tempad1->total_cnt; + j=tempad1->total_cnt*tempc->size; + i=cnt*j; + Free(*_base); + if (data_heap) + *_base=_b=MAlloc(i); + else + *_base=_b=MAlloc(i,Fs->code_heap); + tempvi=head.next; + while (tempvi!=&head) { + tempvi1=tempvi->next; + MemCpy(_b,&tempvi->base,j); + _b+=j; + Free(tempvi); + tempvi=tempvi1; + } + *_dst=_b; + } else { + for (i=0;icnt;i++) { + PrsVarInit2(cc,_dst,tempc,tempad1,data_addr_ip,_base,data_heap,pass); + if (tempad1->cnt>1 && cc->token==',') + Lex(cc); + } + if (cc->token=='}') + Lex(cc); + } + } + } else { + PrsVarInit(cc,_dst,tempc,tempad1,data_addr_ip,_base,data_heap,pass); + LexPush(cc); + } +} + +U0 PrsGlblInit(CCmpCtrl *cc,CHashGlblVar *tempg,I64 pass) +{ + U8 *dst=tempg->data_addr; + PrsVarInit2(cc,&dst,tempg->var_class,&tempg->dim, + tempg->data_addr_ip,&tempg->data_addr, + Bt(&cc->opts,OPTf_GLBLS_ON_DATA_HEAP)|| + Bt(&cc->flags,CCf_AOT_COMPILE),pass); +} + +U0 PrsStaticInit(CCmpCtrl *cc,CMemberLst *tempm,I64 pass) +{ + U8 *machine_code,*dst=tempm->static_data; + CHashClass *tempc=tempm->member_class; + I64 i,size; + CAOTImportExport *tempie; + + if (cc->flags&CCF_AOT_COMPILE && pass==2) { + COCPush(cc); + COCInit(cc); + } + PrsVarInit2(cc,&dst,tempc,&tempm->dim,tempm->static_data_ip, + &tempm->static_data,Bt(&cc->flags,CCf_AOT_COMPILE),pass); + if (cc->flags&CCF_AOT_COMPILE && pass==2) { + if (cc->coc.coc_head.next!=&cc->coc.coc_head) { + ICAdd(cc,IC_RET,0,0); + if (machine_code=COCCompile(cc,&size,NULL,NULL)) { + if (pass==2) { + tempie=CAlloc(sizeof(CAOTImportExport)); + tempie->type=IET_MAIN; + tempie->ip=cc->aotc->ip; + QueIns(tempie,cc->aot->last_ie); + for (i=0;inext!=0 for array + CArrayDim *tempad,*tempad1; + I64 j; + Bool res=TRUE; + dim->next=NULL; + dim->cnt=0; + dim->total_cnt=1; + tempad1=&dim->next; + if (cc->token=='[') { + if (mode.u8[1]==PRS1B_FUN_ARG) + LexExcept(cc,"No arrays in fun args at "); + do { + if (Lex(cc)==']' && !dim->next) { + j=-1; + res=FALSE; + } else { + if ((j=LexExpressionI64(cc))<0) + LexExcept(cc,"Invalid array size at "); + } + tempad1=&dim->next; + while (tempad1->next) { + tempad1->next->total_cnt*=j; + tempad1=tempad1->next; + } + tempad=MAlloc(sizeof(CArrayDim)); + tempad1->next=tempad; + tempad1=tempad; + tempad->next=NULL; + tempad->cnt=j; + tempad->total_cnt=1; + dim->total_cnt*=j; + if (cc->token!=']') + LexExcept(cc,"Missing ']' at "); + } while (Lex(cc)=='['); + } + return res; +} + +CHashClass *PrsType(CCmpCtrl *cc,CHashClass **_tempc1, + I64 *_mode,CMemberLst *tempm,U8 **_ident,CHashFun **_fun_ptr, + CHashExport **_tempex,CArrayDim *tempad,I64 fsp_flags) +{ + I64 k,ptr_stars_cnt,mode=*_mode; + CHashClass *tempc1=*_tempc1,*tempc2; + CHashFun *fun_ptr=NULL; + CHashExport *tempex=NULL; + CArrayDim *tempad2; + + pt_start: + if (!tempc1 || !(tempc1->type & (HTT_CLASS|HTT_INTERNAL_TYPE))) + LexExcept(cc,"Invalid class at "); + + ptr_stars_cnt=0; + while (cc->token=='*') { + if (mode.u8[1]) { + LexPopNoRestore(cc); + LexPush(cc); + } + Lex(cc); + tempc1++; + if (++ptr_stars_cnt>MAX_PTR_STARS) + LexExcept(cc,"Too many *'s at "); + } + + k=PrsKeyWord(cc); + if (k==KW_UNION || k==KW_CLASS) { + Lex(cc); + tempc2=PrsClass(cc,k,fsp_flags,mode&255==PRS0_EXTERN); + tempc2->fwd_class=tempc1; + tempc1=tempc2; + if (_tempc1) *_tempc1=tempc1; + mode=PRS0_NULL|PRS1_NULL; + goto pt_start; + } + + if (cc->token=='(') { + if (Lex(cc)!='*') + LexExcept(cc,"Expecting '*' at "); + ptr_stars_cnt=1; //fun_ptr + while (Lex(cc)=='*') + ptr_stars_cnt++; //fun_ptr + if (ptr_stars_cnt>MAX_PTR_STARS) + LexExcept(cc,"Too many *'s at "); + } else + ptr_stars_cnt=-1; //fun_ptr + + if (_ident) { + if (cc->token==TK_IDENT) { + tempex=cc->hash_entry; + *_ident=cc->cur_str; + cc->cur_str=NULL; + Lex(cc); + } else { + if (!mode.u8[1]) + *_ident=NULL; + else if (cc->token==',' || cc->token==';' || cc->token==')') { + tempex=NULL; + *_ident=StrNew("_anon_"); + tempm->flags|=MLF_NO_UNUSED_WARN; + } else + LexExcept(cc,"Expecting identifier at "); + } + } + + if (ptr_stars_cnt>=0) { //fun_ptr + if (cc->token!=')') + LexExcept(cc,"Missing ')' at "); + if (Lex(cc)!='(') + LexExcept(cc,"Expecting '(' at "); + fun_ptr=PrsFunJoin(cc,tempc1,NULL,fsp_flags)+ptr_stars_cnt; + tempc1=cmp.internal_types[RT_PTR]+ptr_stars_cnt; + } + if (!PrsArrayDims(cc,mode,tempad) && cc->token!='=') { + tempc1++; + tempad2=tempad->next->next; + Free(tempad->next); + tempad->next=tempad2; + } + + tempc2=OptClassFwd(tempc1); + if (tempc2->ptr_stars_cnt) { + tempc2-=tempc2->ptr_stars_cnt; + if (tempc2->type&HTT_INTERNAL_TYPE && !tempc2->size) + LexWarn(cc,"use \"U8 *\" instead of \"U0 *\" at "); + } + + if (_mode) *_mode=mode; + if (_fun_ptr) *_fun_ptr=fun_ptr; + if (_tempex) *_tempex=tempex; + return tempc1; +} + +U0 PrsDotDotDot(CCmpCtrl *cc,CHashFun *tempf,I64 _reg) +{ + CMemberLst *tempm; + CArrayDim *tempad; + + Bts(&tempf->flags,Ff_DOT_DOT_DOT); + + Lex(cc); + tempm=MemberLstNew(_reg); + tempm->flags=MLF_DOT_DOT_DOT; + tempm->member_class=cmp.internal_types[RT_I64]; + tempm->str=StrNew("argc"); + tempm->offset=tempf->size; + tempm->size=8; + tempf->size+=8; + MemberAdd(cc,tempm,tempf,PRS1B_FUN_ARG); + + tempm=MemberLstNew(_reg); + tempm->flags=MLF_DOT_DOT_DOT; + tempm->member_class=cmp.internal_types[RT_I64]; + tempm->str=StrNew("argv"); + tempm->dim.total_cnt=127; //arbitrary + tempm->dim.next=tempad=MAlloc(sizeof(CArrayDim)); + tempad->next=NULL; + tempad->cnt=127; //arbitrary + tempad->total_cnt=1; + tempm->offset=tempf->size; + tempm->size=8; //Close enough + tempf->size+=8;//Close enough + MemberAdd(cc,tempm,tempf,PRS1B_FUN_ARG); + + if (cc->token==')') + Lex(cc); +} + +U0 PrsVarLst(CCmpCtrl *cc,CHashClass *tempc,I64 mode,I64 union_base=0) +{ + I64 i,k,old_flags=cc->flags,old_flags2,type,_reg; + CHashClass *tempc1,*tempc2; + CHash *temph; + CMemberLst *tempm; + CMemberLstMeta *temp_meta; + U8 *machine_code; + Bool undef_array_size,first; + cc->flags|=CCF_DONT_MAKE_RES; + if (mode.u8[1]==PRS1B_CLASS) + cc->flags|=CCF_CLASS_IP; + if ((mode.u8[1]!=PRS1B_LOCAL_VAR && mode.u8[1]!=PRS1B_STATIC_LOCAL_VAR || + mode&PRSF_UNION) && (cc->token=='(' || cc->token=='{')) + Lex(cc); + while (TRUE) { + while (cc->token==';') + Lex(cc); + if (mode&PRSF_UNION) + cc->class_ip=union_base; + else + cc->class_ip=tempc->size; + while (cc->token=='$$') { + if (Lex(cc)!='=') //skip $$ + LexExcept(cc,"Expecting '=' at "); + Lex(cc); //skip = + cc->class_ip=LexExpression(cc); + if (-cc->class_ip>tempc->neg_offset) + tempc->neg_offset=-cc->class_ip; + if (mode&PRSF_UNION) + union_base=cc->class_ip; + else + tempc->size=cc->class_ip; + if (cc->token!=';') + LexExcept(cc,"Missing ';' at"); + Lex(cc); //skip ; + } + if (cc->token==')' || cc->token=='}') { + Lex(cc); + goto pvl_done; + } + _reg=REG_UNDEF; +pvl_restart1: + switch (PrsKeyWord(cc)) { + case KW_REG: + _reg=REG_ALLOC; + if (Lex(cc)==TK_IDENT) { + k=DefineMatch(cc->cur_str,"ST_U64_REGS"); + if (k>=0) { + _reg=k; + Lex(cc); + } + } + goto pvl_restart1; + case KW_NOREG: + _reg=REG_NONE; + Lex(cc); + goto pvl_restart1; + } + + if (cc->token==TK_ELLIPSIS && mode.u8[1]==PRS1B_FUN_ARG) { + PrsDotDotDot(cc,tempc,_reg); + goto pvl_done; + } + if (cc->token==TK_IDENT) + temph=cc->hash_entry; + else + temph=NULL; + if (!temph) + LexExcept(cc,"Expecting type at "); + k=PrsKeyWord(cc); + if (k==KW_UNION) { + Lex(cc); + PrsVarLst(cc,tempc,mode|PRSF_UNION,tempc->size); + } else { + if (!(temph->type & (HTT_CLASS|HTT_INTERNAL_TYPE))) + LexExcept(cc,"Expecting type at "); + first=TRUE; +pvl_restart2: + tempc1=temph; + LexPush(cc); + Lex(cc); //skip type or ',' + tempm=MemberLstNew(_reg); + _reg=REG_UNDEF; + if (mode.u8[1]==PRS1B_STATIC_LOCAL_VAR) { + tempm->flags|=MLF_STATIC; + tempm->reg=REG_NONE; + } + if (mode.u8[1]==PRS1B_FUN_ARG || mode.u8[1]==PRS1B_LOCAL_VAR) { +pvl_restart3: + switch (PrsKeyWord(cc)) { + case KW_REG: + tempm->reg=REG_ALLOC; + LexPopNoRestore(cc); + LexPush(cc); + if (Lex(cc)==TK_IDENT) { + k=DefineMatch(cc->cur_str,"ST_U64_REGS"); + if (k>=0) { + tempm->reg=k; + LexPopNoRestore(cc); + LexPush(cc); + Lex(cc); + } + } + goto pvl_restart3; + case KW_NOREG: + tempm->reg=REG_NONE; + LexPopNoRestore(cc); + LexPush(cc); + Lex(cc); + goto pvl_restart3; + } + } + tempm->member_class=PrsType(cc,&tempc1,&mode,tempm,&tempm->str, + &tempm->fun_ptr,NULL,&tempm->dim,0); + if (tempm->fun_ptr) + tempm->flags|=MLF_FUN; + if (first) + MemberAdd(cc,tempm,tempc,mode.u8[1]); + else + MemberAdd(cc,tempm,tempc,PRS1B_NULL); + tempc->member_cnt++; + + tempc2=tempm->member_class; + i=tempc2->size*tempm->dim.total_cnt; + switch (mode.u8[1]) { + case PRS1B_STATIC_LOCAL_VAR: + if (i<0) { + i=0; + undef_array_size=TRUE; + } else + undef_array_size=FALSE; + if (mode&PRSF_UNION) + LexExcept(cc,"Static unions are not implemented "); + k=(i+7)&~7; + if (cc->flags&CCF_AOT_COMPILE) + tempm->static_data=MAlloc(k); + else + tempm->static_data=MAlloc(k,Fs->code_heap); + if (cc->flags&CCF_AOT_COMPILE) { + tempm->static_data_ip=cc->aotc->ip; + k>>=3; + if (sys_var_init_flag) { + k<<=3; + while (k--) + AOTStoreCodeU8(cc,sys_var_init_val); + } else + while (k--) + AOTStoreCodeU64(cc,0); + } else + if (sys_var_init_flag) + MemSet(tempm->static_data,sys_var_init_val,k); + LexPopNoRestore(cc); + if (cc->token=='=') { + cc->flags=cc->flags& + ~CCF_DONT_MAKE_RES|old_flags&CCF_DONT_MAKE_RES; + if (undef_array_size) { + LexPush(cc); + LexPush(cc); + Lex(cc); //skip = + PrsStaticInit(cc,tempm,1); + LexPopNoRestore(cc); + i=tempc2->size*tempm->dim.total_cnt; + k=(i+7)&~7; + if (cc->flags&CCF_AOT_COMPILE) { + k>>=3; + if (sys_var_init_flag) { + k<<=3; + while (k--) + AOTStoreCodeU8(cc,sys_var_init_val); + } else + while (k--) + AOTStoreCodeU64(cc,0); + } else + if (sys_var_init_flag) + MemSet(tempm->static_data,sys_var_init_val,k); + LexPopRestore(cc); + } + LexPush(cc); + Lex(cc); //skip = + PrsStaticInit(cc,tempm,2); + LexPopNoRestore(cc); + if (cc->flags&CCF_AOT_COMPILE) + for (k=0;kstatic_data_ip+k, + tempm->static_data[k]); + tempm->use_cnt=0; + cc->flags|=CCF_DONT_MAKE_RES; + } + if (cc->flags&CCF_AOT_COMPILE) + Free(tempm->static_data); + break; + case PRS1B_LOCAL_VAR: + if (mode&PRSF_UNION) { + if (union_base-tempc->sizesize; + else + i=0; + } + if (i>=8) + tempc->size=(tempc->size-i)&~7; + else if (i>=4) + tempc->size=(tempc->size-i)&~3; + else if (i>=2) + tempc->size=(tempc->size-i)&~1; + else + tempc->size-=i; + tempm->offset=tempc->size; + tempm->size=i; + if (cc->token=='=') { + cc->flags=cc->flags&~CCF_DONT_MAKE_RES| + old_flags&CCF_DONT_MAKE_RES; + LexPopRestore(cc); + Lex(cc); + if (!PrsExpression(cc,NULL,TRUE)) + throw('Compiler'); + tempm->use_cnt=0; + cc->flags|=CCF_DONT_MAKE_RES; + } else + LexPopNoRestore(cc); + break; + case PRS1B_FUN_ARG: + if (mode&PRSF_UNION) { + tempm->offset=union_base; + if (tempc->size-union_base<8) + tempc->size=8+union_base; + } else { + tempm->offset=tempc->size; + tempc->size+=8; + } + tempm->size=8; + if (cc->token=='=') { + Lex(cc); + if (PrsKeyWord(cc)==KW_LASTCLASS) { + tempm->flags|=MLF_LASTCLASS; + Lex(cc); + } else { + old_flags2=cc->flags; + cc->flags&=~CCF_HAS_MISC_DATA; + machine_code=LexExpression2Bin(cc,&type); + if (!machine_code) + throw('Compiler'); + tempm->dft_val=Call(machine_code); + tempc2=OptClassFwd(tempc2); + if (tempc2->raw_type==RT_F64) { + if (type!=RT_F64) + tempm->dft_val(F64)=tempm->dft_val; + } else { + if (type==RT_F64) + tempm->dft_val=tempm->dft_val(F64); + } + if (cc->flags & CCF_HAS_MISC_DATA) { + tempm->dft_val=StrNew(tempm->dft_val); + tempm->flags|=MLF_STR_DFT_AVAILABLE; + } + Free(machine_code); + cc->flags|=old_flags2&CCF_HAS_MISC_DATA; + } + tempm->flags|=MLF_DFT_AVAILABLE; + } + LexPopNoRestore(cc); + break; + case PRS1B_CLASS: + if (mode&PRSF_UNION) { + tempm->offset=union_base; + if (tempc->size-union_basesize=i+union_base; + } else { + tempm->offset=tempc->size; + tempc->size+=i; + } + tempm->size=i; + while (cc->token==TK_IDENT) { + temp_meta=MAlloc(sizeof(CMemberLstMeta)); + temp_meta->next=tempm->meta; + tempm->meta=temp_meta; + temp_meta->str=cc->cur_str; + temp_meta->flags=0; + cc->cur_str=NULL; + if (Lex(cc)==TK_STR) { + temp_meta->user_data=LexExtStr(cc); + temp_meta->flags|=MLMF_IS_STR; + } else + temp_meta->user_data=LexExpression(cc); + } + LexPopNoRestore(cc); + break; + } + switch (cc->token) { + case ',': + if (mode.u8[1]==PRS1B_FUN_ARG && !(mode&PRSF_UNION)) + Lex(cc); + else { + first=FALSE; + goto pvl_restart2; + } + break; + case ')': + case '}': + Lex(cc); + goto pvl_done; + case ';': + cc->flags=cc->flags&~CCF_DONT_MAKE_RES| + old_flags&CCF_DONT_MAKE_RES; + Lex(cc); + cc->flags|=CCF_DONT_MAKE_RES; + if ((mode.u8[1]==PRS1B_LOCAL_VAR||mode.u8[1]== + PRS1B_STATIC_LOCAL_VAR) && !(mode&PRSF_UNION)) + goto pvl_done; + break; + default: + LexExcept(cc,"Missing ';' at"); + } + } + } +pvl_done: + cc->flags=cc->flags&~(CCF_CLASS_IP|CCF_DONT_MAKE_RES)| + old_flags& (CCF_CLASS_IP|CCF_DONT_MAKE_RES); +} diff --git a/Compiler/Templates.CPP b/Compiler/Templates.HC similarity index 100% rename from Compiler/Templates.CPP rename to Compiler/Templates.HC diff --git a/Compiler/UAsm.CPP b/Compiler/UAsm.HC similarity index 100% rename from Compiler/UAsm.CPP rename to Compiler/UAsm.HC diff --git a/Demo/AcctExample/DoOnce.CPP b/Demo/AcctExample/DoOnce.CPP deleted file mode 100644 index cea5c4c..0000000 --- a/Demo/AcctExample/DoOnce.CPP +++ /dev/null @@ -1,48 +0,0 @@ -//Place this file in /Home and change -//anything you want. - -//This file is executed by the -//first terminal window upon start-up. -//See $LK,"DoOnce",A="FF:/Home/HomeSys.CPP,DoOnce"$ and $LK,"Home Files",A="FF:::/Doc/GuideLines.TXT,/Home Files"$. - -// Type("::/Doc/Customize.TXT"); - -U0 DoOnce() -{ - switch (sys_boot_src.u16[0]) { - case BOOT_SRC_DVD: - "\nIf you answer 'No' you can play with\n" - "the live CD without installing.\n\n" - "Install onto hard drive "; - if (YorN) { - DocBottom; - if (RunFile("::/Misc/OSInstall",,FALSE)) { - *sys_registry_doc->filename.name='C'; - "\n\n1) TAD\n\n"; - switch (GetI64("Staff Member Number:")) { - case 1: - RegWriteBranch("TempleOS/Staff", - "#define PERSONAL_INITIALS \"TAD\"\n" - "#define MACHINE_CFG %d\n", - GetI64("Machine Cfg Number:") - ); - break; - } - Del("C:/Home/DoDistro.CPP.Z"); - Del("D:/Home/DoDistro.CPP.Z"); - "\n\n\nAfter Reboot be sure to run MakeDistrosAndBackUp.\n\n"; - PressAKey; - Reboot; //Too dangerous for amateurs until reboot. - } - } - break; - } - if (FileFind("D:/Temp/Logs/access.log")) { - Auto("\n\n%C",CH_ESC); - RunFile("::/Demo/WebLogDemo/WebLogRep",, - "D:/Temp/Logs/*.log","D:/Temp/LogRep.TXT"); - Del("D:/Temp/Logs/*.log"); - } -} - -DoOnce; diff --git a/Demo/AcctExample/DoOnce.HC b/Demo/AcctExample/DoOnce.HC new file mode 100644 index 0000000..4b2a7d0 --- /dev/null +++ b/Demo/AcctExample/DoOnce.HC @@ -0,0 +1,48 @@ +//Place this file in /Home and change +//anything you want. + +//This file is executed by the +//first terminal window upon start-up. +//See $LK,"DoOnce",A="FF:/Home/HomeSys.HC,DoOnce"$ and $LK,"Home Files",A="FF:::/Doc/GuideLines.DD,/Home Files"$. + +// Type("::/Doc/Customize.DD"); + +U0 DoOnce() +{ + switch (sys_boot_src.u16[0]) { + case BOOT_SRC_DVD: + "\nIf you answer 'No' you can play with\n" + "the live CD without installing.\n\n" + "Install onto hard drive "; + if (YorN) { + DocBottom; + if (RunFile("::/Misc/OSInstall",,FALSE)) { + *sys_registry_doc->filename.name='C'; + "\n\n1) TAD\n\n"; + switch (GetI64("Staff Member Number:")) { + case 1: + RegWriteBranch("TempleOS/Staff", + "#define PERSONAL_INITIALS \"TAD\"\n" + "#define MACHINE_CFG %d\n", + GetI64("Machine Cfg Number:") + ); + break; + } + Del("C:/Home/DoDistro.HC.Z"); + Del("D:/Home/DoDistro.HC.Z"); + "\n\n\nAfter Reboot be sure to run MakeDistrosAndBackUp.\n\n"; + PressAKey; + Reboot; //Too dangerous for amateurs until reboot. + } + } + break; + } + if (FileFind("D:/Temp/Logs/access.log")) { + Auto("\n\n%C",CH_ESC); + RunFile("::/Demo/WebLogDemo/WebLogRep",, + "D:/Temp/Logs/*.log","D:/Home/WebLogRep.DD"); + Del("D:/Temp/Logs/*.log"); + } +} + +DoOnce; diff --git a/Demo/AcctExample/HomeKeyPlugIns.CPP b/Demo/AcctExample/HomeKeyPlugIns.CPP deleted file mode 100644 index 9a19327..0000000 --- a/Demo/AcctExample/HomeKeyPlugIns.CPP +++ /dev/null @@ -1,342 +0,0 @@ -//Place this file in /Home and change -//anything you want. - -U0 InsTime() -{ - CDate cdt; - cdt=Now; - "$$IV,1$$----%D %T----$$IV,0$$\n",cdt,cdt; -} - -U0 InsFileLink() -{ - U8 *st=PopUpPickFile; - st[0]=':'; //This is my personal code, not production. LOL - "$$LK,\"%s\",A=\"FI:%s\"$$",st+2,st; - Free(st); -} - -U0 InsDirLinks() -{ - CDirEntry *tempde,*tempde1; - U8 *st=PopUpPickDir,*st2; - st[0]=':'; //This is my personal code, not production. LOL - st2=MStrPrint("%s/*",st); - tempde=tempde1=FilesFind(st2,FUF_JUST_FILES); - while (tempde) { - tempde->full_name[0]=':'; - "$$LK,\"%s\",A=\"FI:%s\"$$\n",tempde->full_name+2,tempde->full_name; - tempde=tempde->next; - } - DirTreeDel(tempde1); - Free(st); - Free(st2); -} - -U0 DocHiddenDel(CDoc *doc=NULL) -{ - Bool unlock; - CDocEntry *doc_e,*doc_e1; - if (!doc) doc=DocPut; - if (doc) { - unlock=DocLock(doc); - DocRecalc(doc); - doc_e=doc->head.next; - while (doc_e!=doc) { - doc_e1=doc_e->next; - if (doc_e->de_flags&(DOCEF_FILTER_SKIP|DOCEF_SKIP)) - DocEntryDel(doc,doc_e); - doc_e=doc_e1; - } - DocRecalc(doc); - if (unlock) - DocUnlock(doc); - } -} - -Bool MyPutKey(I64 ch,I64 sc) -{//ch=ASCII; sc=scan_code - - //See $LK,"Char",A="HI:Char"$ for definition of scan codes. - //See $LK,"Key Allocations",A="FI:::/Doc/KeyAlloc.TXT"$. - //See $LK,"Keyboard Devices",A="HI:Keyboard Devices/System"$. - - //You can customize keys. This routine - //is called before the main editor - //key handler $LK,"DocPutKey",A="MN:DocPutKey"$(). - //You can intercept any key. - - //Return TRUE if you completely - //handled the key. - I64 i; - U8 *st1,*st2; - if (sc&SCF_ALT && !(sc&SCF_CTRL)) { - switch (ch) { - case 0: - switch (sc.u8[0]) { - case SC_F1: - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /LTPURPLE"); - else - "$$LTPURPLE$$"; - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /PURPLE"); - else - "$$PURPLE$$"; - } - return TRUE; - case SC_F2: - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /LTRED"); - else - "$$LTRED$$"; - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /RED"); - else - "$$RED$$"; - } - return TRUE; - case SC_F3: - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /LTGREEN"); - else - "$$LTGREEN$$"; - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /GREEN"); - else - "$$GREEN$$"; - } - return TRUE; - case SC_F4: - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /Default Color"); - else - "$$FG$$"; - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /BLUE"); - else - "$$BLUE$$"; - } - return TRUE; - case SC_F5: - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/Collaborative Fiction"); - else - "---- $TX,"Collaborative Fiction",HTML="http://en.wikipedia.org/wiki/Collaborative_fiction"$ ----\n" - "Once upon a time "; - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/Moses Comic"); - else - "---- Moses Comic ---- " - "(Set in the $TX,"Numbers 11",HTML="http://www.biblegateway.com/passage/?search=Numbers%%%%2011&version=NIV"$ " - "part of the story.)\n" - "Moses says, \"\"\n" - "God says, \"\"\n"; - } - return TRUE; - case SC_F6: - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /Ins My URL"); - else - InsMyURL; - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /Ins Datetime"); - else - InsTime; - } - return TRUE; - case SC_F7: -//$LK,"::/Adam/God/HSNotes.TXT"$ - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /God Book Passage"); - else { - FifoU8Flush(god.fifo); - GodBitsIns(GOD_GOOD_BITS,KbdMouseEvtTime>>GOD_BAD_BITS); - GodBooksPassage("C:/Home/Sup1/Sup1Texts/*"); - } - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /God Doodle File"); - else { - st1=PopUpPickFile; - st2=FileRead(st1); - GodDoodle(st2); - Free(st2); - Free(st1); - } - } - return TRUE; - case SC_F8: - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /Ins Dir Links"); - else - InsDirLinks; - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /Ins File Link"); - else - InsFileLink; - } - return TRUE; - } - break; - case 'a': - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /AutoComplete On"); - else - AutoComplete(ON); - return TRUE; - case 'A': - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /AutoComplete Off"); - else - AutoComplete; - return TRUE; - case 'h': - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /Tile Horizontally"); - else - WinTileHorz; - return TRUE; - case 'H': - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/Del Hidden Doc Entries"); - else - DocHiddenDel; - return TRUE; - case 'm': - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /Maximize"); - else { - WinBorder; - WinMax; - } - return TRUE; - case 'v': - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /Tile Vertically"); - else - WinTileVert; - return TRUE; - case 'V': - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /Frame Grabber Toggle"); - else - FrameGrabberToggle; - return TRUE; - case 'l': - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/Put Link to Cur Pos on Clipboard"); - else { - ClipboardDel; - st1=FileNameAbs(BIBLE_FILENAME); - st2=FileNameAbs(DocPut->filename.name); - if (!StrCmp(st1,st2)) { - Free(st1); - st1=BibleLine2Verse(DocPut->cur_entry->y+1,','); - DocPrint(sys_clipboard_doc,"$$LK,\"BF:%s\"$$",st1); - } else - DocPrint(sys_clipboard_doc,"$$LK,\"FL:%s,%d\"$$", - st2,DocPut->cur_entry->y+1); - Free(st1); - Free(st2); - } - return TRUE; - case 'L': - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/Place Anchor, Put Link to Clipboard"); - else { - i=RandU32; - ClipboardDel; - DocPrint(sys_clipboard_doc,"$$LK,\"\",A=\"FA:%s,ANC%d\"$$", - DocPut->filename.name,i); - "$$AN,\"\",A=\"ANC%d\"$$",i; - } - return TRUE; - - //Ins your own ALT-key plug-ins - case '1': - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /ã"); - else - 'ã'; - return TRUE; - case '2': - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /é"); - else - 'é'; - return TRUE; - case '3': - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /è"); - else - 'è'; - return TRUE; - case '4': - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /ê"); - else - 'ê'; - return TRUE; - case '9': - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /Indent 5"); - else - "$$ID,5$$"; - return TRUE; - case '0': - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /Unindent 5"); - else - "$$ID,-5$$"; - return TRUE; - case 'b': - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /Jump to Bad Code"); - else //$LK,"::/Adam/God/HSNotes.TXT"$ - BadCodeJump; - return TRUE; - case 'g': - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/BlogScreenShot"); - else - BlogScreenShot; - return TRUE; - case 'p': - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /JukeBox(Home/Sup1)"); - else - JukeBox("~/Sup1/Sup1Psalmody"); - return TRUE; - case 'P': - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /JukeBox(Examples)"); - else - JukeBox("::/Apps/Psalmody/Examples"); - return TRUE; - } - } - return FALSE; -} - -Bool MyPutS(U8 *) -{ - return FALSE; -} - -KeyDevAdd(&MyPutKey,&MyPutS,0x20000000,TRUE); diff --git a/Demo/AcctExample/HomeKeyPlugIns.HC b/Demo/AcctExample/HomeKeyPlugIns.HC new file mode 100644 index 0000000..6933de5 --- /dev/null +++ b/Demo/AcctExample/HomeKeyPlugIns.HC @@ -0,0 +1,338 @@ +//Place this file in /Home and change +//anything you want. + +U0 InsTime() +{ + CDate cdt; + cdt=Now; + "$$IV,1$$----%D %T----$$IV,0$$\n",cdt,cdt; +} + +U0 InsFileLink() +{ + U8 *st=PopUpPickFile; + st[0]=':'; //This is my personal code, not production. LOL + "$$LK,\"%s\",A=\"FI:%s\"$$",st+2,st; + Free(st); +} + +U0 InsDirLinks() +{ + CDirEntry *tempde,*tempde1; + U8 *st=PopUpPickDir,*st2; + st[0]=':'; //This is my personal code, not production. LOL + st2=MStrPrint("%s/*",st); + tempde=tempde1=FilesFind(st2,FUF_JUST_FILES); + while (tempde) { + tempde->full_name[0]=':'; + "$$LK,\"%s\",A=\"FI:%s\"$$\n",tempde->full_name+2,tempde->full_name; + tempde=tempde->next; + } + DirTreeDel(tempde1); + Free(st); + Free(st2); +} + +U0 DocHiddenDel(CDoc *doc=NULL) +{ + Bool unlock; + CDocEntry *doc_e,*doc_e1; + if (!doc) doc=DocPut; + if (doc) { + unlock=DocLock(doc); + DocRecalc(doc); + doc_e=doc->head.next; + while (doc_e!=doc) { + doc_e1=doc_e->next; + if (doc_e->de_flags&(DOCEF_FILTER_SKIP|DOCEF_SKIP)) + DocEntryDel(doc,doc_e); + doc_e=doc_e1; + } + DocRecalc(doc); + if (unlock) + DocUnlock(doc); + } +} + +Bool MyPutKey(I64 ch,I64 sc) +{//ch=ASCII; sc=scan_code + + //See $LK,"Char",A="HI:Char"$ for definition of scan codes. + //See $LK,"Key Allocations",A="FI:::/Doc/KeyAlloc.DD"$. + //See $LK,"Keyboard Devices",A="HI:Keyboard Devices/System"$. + + //You can customize keys. This routine + //is called before the main editor + //key handler $LK,"DocPutKey",A="MN:DocPutKey"$(). + //You can intercept any key. + + //Return TRUE if you completely + //handled the key. + I64 i; + U8 *st1,*st2; + if (sc&SCF_ALT && !(sc&SCF_CTRL)) { + switch (ch) { + case 0: + switch (sc.u8[0]) { + case SC_F1: + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /LTPURPLE"); + else + "$$LTPURPLE$$"; + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /PURPLE"); + else + "$$PURPLE$$"; + } + return TRUE; + case SC_F2: + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /LTRED"); + else + "$$LTRED$$"; + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /RED"); + else + "$$RED$$"; + } + return TRUE; + case SC_F3: + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /LTGREEN"); + else + "$$LTGREEN$$"; + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /GREEN"); + else + "$$GREEN$$"; + } + return TRUE; + case SC_F4: + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /Default Color"); + else + "$$FG$$"; + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /BLUE"); + else + "$$BLUE$$"; + } + return TRUE; + case SC_F5: + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/Collaborative Fiction"); + else + "---- $TX,"Collaborative Fiction",HTML="http://en.wikipedia.org/wiki/Collaborative_fiction"$ ----\n" + "Once upon a time "; + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/Moses Comic"); + else + "---- Moses Comic ---- " + "(Set in the $TX,"Numbers 11",HTML="http://www.biblegateway.com/passage/?search=Numbers%%%%2011&version=NIV"$ " + "part of the story.)\n" + "Moses says, \"\"\n" + "God says, \"\"\n"; + } + return TRUE; + case SC_F6: + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /Ins Misc"); + else + TOSInsMisc; + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /Ins Datetime"); + else + InsTime; + } + return TRUE; + case SC_F7: + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /God Misc"); + else + GodMisc; + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /God Doodle File"); + else { + st1=PopUpPickFile; + st2=FileRead(st1); + GodDoodle(st2); + Free(st2); + Free(st1); + } + } + return TRUE; + case SC_F8: + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /Ins Dir Links"); + else + InsDirLinks; + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /Ins File Link"); + else + InsFileLink; + } + return TRUE; + } + break; + case 'a': + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /AutoComplete On"); + else + AutoComplete(ON); + return TRUE; + case 'A': + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /AutoComplete Off"); + else + AutoComplete; + return TRUE; + case 'h': + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /Tile Horizontally"); + else + WinTileHorz; + return TRUE; + case 'H': + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/Del Hidden Doc Entries"); + else + DocHiddenDel; + return TRUE; + case 'm': + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /Maximize"); + else { + WinBorder; + WinMax; + } + return TRUE; + case 'v': + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /Tile Vertically"); + else + WinTileVert; + return TRUE; + case 'V': + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /Frame Grabber Toggle"); + else + FrameGrabberToggle; + return TRUE; + case 'l': + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/Put Link to Cur Pos on Clipboard"); + else { + ClipboardDel; + st1=FileNameAbs(BIBLE_FILENAME); + st2=FileNameAbs(DocPut->filename.name); + if (!StrCmp(st1,st2)) { + Free(st1); + st1=BibleLine2Verse(DocPut->cur_entry->y+1,','); + DocPrint(sys_clipboard_doc,"$$LK,\"BF:%s\"$$",st1); + } else + DocPrint(sys_clipboard_doc,"$$LK,\"FL:%s,%d\"$$", + st2,DocPut->cur_entry->y+1); + Free(st1); + Free(st2); + } + return TRUE; + case 'L': + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/Place Anchor, Put Link to Clipboard"); + else { + i=RandU32; + ClipboardDel; + DocPrint(sys_clipboard_doc,"$$LK,\"\",A=\"FA:%s,ANC%d\"$$", + DocPut->filename.name,i); + "$$AN,\"\",A=\"ANC%d\"$$",i; + } + return TRUE; + + //Ins your own ALT-key plug-ins + case '1': + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /ã"); + else + 'ã'; + return TRUE; + case '2': + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /é"); + else + 'é'; + return TRUE; + case '3': + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /è"); + else + 'è'; + return TRUE; + case '4': + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /ê"); + else + 'ê'; + return TRUE; + case '9': + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /Indent 5"); + else + "$$ID,5$$"; + return TRUE; + case '0': + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /Unindent 5"); + else + "$$ID,-5$$"; + return TRUE; + case 'b': + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /Jump to Bad Code"); + else //$LK,"::/Adam/God/HSNotes.DD"$ + GodCodeJmp; + return TRUE; + case 'g': + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/BlogScreenShot"); + else + BlogScreenShot; + return TRUE; + case 'p': + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /JukeBox(Home/Sup1)"); + else + JukeBox("~/Sup1/Sup1Psalmody"); + return TRUE; + case 'P': + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /JukeBox(Examples)"); + else + JukeBox("::/Apps/Psalmody/Examples"); + return TRUE; + } + } + return FALSE; +} + +Bool MyPutS(U8 *) +{ + return FALSE; +} + +KeyDevAdd(&MyPutKey,&MyPutS,0x20000000,TRUE); diff --git a/Demo/AcctExample/HomeLocalize.CPP b/Demo/AcctExample/HomeLocalize.HC similarity index 100% rename from Demo/AcctExample/HomeLocalize.CPP rename to Demo/AcctExample/HomeLocalize.HC diff --git a/Demo/AcctExample/HomeSys.CPP b/Demo/AcctExample/HomeSys.CPP deleted file mode 100644 index b383dcb..0000000 --- a/Demo/AcctExample/HomeSys.CPP +++ /dev/null @@ -1,47 +0,0 @@ -//Place this file in /Home and change -//anything you want. - -U0 UserStartUp() -{//Run each time a user a spawned - DocTermNew; - Type("::/Doc/Start.TXT"); - LBts(&Fs->display_flags,DISPLAYf_SHOW); - WinToTop; - WinZBufUpdate; - Dir; - "$TX,"81,125",D="DD_TEMPLEOS_LOC_OFFICIAL"$LOC:"; - CPURep; -} - -U0 SrvStartUp() -{//Run each time a srv task is spawned. - DocTermNew; - LBts(&Fs->display_flags,DISPLAYf_SHOW); - WinToTop; - WinZBufUpdate; -} - -CTask *user1,*user2; - -U0 StartUpTasks() -{ - user1=User; - user2=User; - WinToTop(user1); - WinTileVert; - "Boot Time:%7.3fs\n",tS; - XTalk(user1,"Cd;#include \"DoOnce\";\n"); - Silent; - ACInit("/*;!*/Bible.TXT*;!*.TXT*"); //No Bible, no uncompressed TXT. - Silent(OFF); - "AutoComplete Time:%7.3fs\n",tS; -} - -if (DrvIsWritable(':')) { - DelTree("::/Temp/ScreenShots"); - MkDir("::/Temp/ScreenShots"); -} - -StartUpTasks; - -"\nOS Compile Time:%D %T\n",sys_compile_time,sys_compile_time; diff --git a/Demo/AcctExample/HomeSys.HC b/Demo/AcctExample/HomeSys.HC new file mode 100644 index 0000000..a69529e --- /dev/null +++ b/Demo/AcctExample/HomeSys.HC @@ -0,0 +1,47 @@ +//Place this file in /Home and change +//anything you want. + +U0 UserStartUp() +{//Run each time a user a spawned + DocTermNew; + Type("::/Doc/Start.DD"); + LBts(&Fs->display_flags,DISPLAYf_SHOW); + WinToTop; + WinZBufUpdate; + Dir; + "$TX,"81,208",D="DD_TEMPLEOS_LOC_OFFICIAL"$LOC:"; + CPURep; +} + +U0 SrvStartUp() +{//Run each time a srv task is spawned. + DocTermNew; + LBts(&Fs->display_flags,DISPLAYf_SHOW); + WinToTop; + WinZBufUpdate; +} + +CTask *user1,*user2; + +U0 StartUpTasks() +{ + user1=User; + user2=User; + WinToTop(user1); + WinTileVert; + "Boot Time:%7.3fs\n",tS; + XTalk(user1,"Cd;#include \"DoOnce\";\n"); + Silent; + ACInit("/*;!*/Bible.TXT*;!*.TXT"); //No Bible, no uncompressed DD. + Silent(OFF); + "AutoComplete Time:%7.3fs\n",tS; +} + +if (DrvIsWritable(':')) { + DelTree("::/Temp/ScreenShots"); + MkDir("::/Temp/ScreenShots"); +} + +StartUpTasks; + +"\nOS Compile Time:%D %T\n",sys_compile_time,sys_compile_time; diff --git a/Demo/AcctExample/HomeWrappers.CPP b/Demo/AcctExample/HomeWrappers.CPP deleted file mode 100644 index b6902f8..0000000 --- a/Demo/AcctExample/HomeWrappers.CPP +++ /dev/null @@ -1,35 +0,0 @@ -#help_index "Cmd Line (Typically)" - -#define FILEMASK_OFF_LIMITS "!*/Misc/PCIDevices.TXT*;!*/Misc/Bible.TXT*;"\ - "!*/Sup1/Sup1Texts/*;!*/Sup1/Sup1Words/*;!*/Sup1/Sup1Bin/*;"\ - "!*/God/Vocab.TXT*" - -public I64 F(U8 *needle_str,U8 *fu_flags=NULL) -{//Find text in all text files. - return Find(needle_str,"/*",fu_flags); -} - -public I64 F2(U8 *needle_str,U8 *fu_flags=NULL) -{//Find text in most text files. - return Find(needle_str,"/*;" FILEMASK_OFF_LIMITS,fu_flags); -} - -public I64 R(U8 *needle_str,U8 *replace_text=NULL,U8 *fu_flags="+l-i") -{//Find text and replace in most text files. - return Find(needle_str,"/*;" FILEMASK_OFF_LIMITS,fu_flags,replace_text); -} - -public I64 FD(U8 *needle_str,U8 *fu_flags=NULL) -{//Find text in cur dir text files. - return Find(needle_str,"*",fu_flags); -} - -public I64 FD2(U8 *needle_str,U8 *fu_flags=NULL) -{//Find text in most cur dir text files. - return Find(needle_str,"*;" FILEMASK_OFF_LIMITS,fu_flags); -} - -public I64 RD(U8 *needle_str,U8 *replace_text=NULL,U8 *fu_flags="+l-i") -{//Find text and replace in most cur dir text files. - return Find(needle_str,"*;" FILEMASK_OFF_LIMITS,fu_flags,replace_text); -} diff --git a/Demo/AcctExample/HomeWrappers.HC b/Demo/AcctExample/HomeWrappers.HC new file mode 100644 index 0000000..5f8f08f --- /dev/null +++ b/Demo/AcctExample/HomeWrappers.HC @@ -0,0 +1,35 @@ +#help_index "Cmd Line (Typically)" + +#define FILEMASK_OFF_LIMITS "!*/Misc/PCIDevices.DD*;!*/Misc/Bible.TXT*;"\ + "!*/Sup1/Sup1Texts/*;!*/Sup1/Sup1Words/*;!*/Sup1/Sup1Bin/*;"\ + "!*/God/Vocab.DD*" + +public I64 F(U8 *needle_str,U8 *fu_flags=NULL) +{//Find text in all text files. + return Find(needle_str,"/*",fu_flags); +} + +public I64 F2(U8 *needle_str,U8 *fu_flags=NULL) +{//Find text in most text files. + return Find(needle_str,"/*;" FILEMASK_OFF_LIMITS,fu_flags); +} + +public I64 R(U8 *needle_str,U8 *replace_text=NULL,U8 *fu_flags="+l-i") +{//Find text and replace in most text files. + return Find(needle_str,"/*;" FILEMASK_OFF_LIMITS,fu_flags,replace_text); +} + +public I64 FD(U8 *needle_str,U8 *fu_flags=NULL) +{//Find text in cur dir text files. + return Find(needle_str,"*",fu_flags); +} + +public I64 FD2(U8 *needle_str,U8 *fu_flags=NULL) +{//Find text in most cur dir text files. + return Find(needle_str,"*;" FILEMASK_OFF_LIMITS,fu_flags); +} + +public I64 RD(U8 *needle_str,U8 *replace_text=NULL,U8 *fu_flags="+l-i") +{//Find text and replace in most cur dir text files. + return Find(needle_str,"*;" FILEMASK_OFF_LIMITS,fu_flags,replace_text); +} diff --git a/Demo/AcctExample/MakeHome.CPP b/Demo/AcctExample/MakeHome.HC similarity index 100% rename from Demo/AcctExample/MakeHome.CPP rename to Demo/AcctExample/MakeHome.HC diff --git a/Demo/AcctExample/PersonalMenu.DD b/Demo/AcctExample/PersonalMenu.DD new file mode 100644 index 0000000..b58e3a9 --- /dev/null +++ b/Demo/AcctExample/PersonalMenu.DD @@ -0,0 +1,867 @@ +$MA,"Cd ",LM="Cd;Dir;\n"$$MA,"DrvC ",LM="Drv('C');\n"$$MA,"DrvD ",LM="Drv('D');\n"$$MA,"/ ",LM="Cd(\"/\");Dir;\n"$$MA,"Home ",LM="Cd(\"/Home\");Dir;\n"$$MA,"ChgDskT ",LM="ChgDsk('T');\n"$$MA,"MergeD ",LM="S2T(\"C:/*\",\"+r+S\");Merge(\"C:/*;!*/LineRep*\",\"D:/*;!*/LineRep*\",\"+r+d\");\n"$$MA,"MergeT ",LM="S2T(\"C:/*\",\"+r+S\");Merge(\"C:/*;!*/LineRep*\",\"T:/*;!*/LineRep*\",\"+r+d\");\n"$ +$MA,"MakeC ",LM="TOSBootHDIns('C');\n"$$MA+PU,"BootC ",LM="BootRAM(\"C:/Kernel.BIN.C\");"$$MA,"MakeBack",LM="MakeDistrosAndBackUp;\n"$$MA,"PreBack ",LM="PreBackUp;\n"$$MA,"MakeD ",LM="TOSBootHDIns('D');\n"$$MA+PU,"BootD ",LM="BootRAM(\"D:/Kernel.BIN.C\");"$$MA,"CopyDrv ",LM="TOSPromptAndCopyDrv;\n"$$MA,"MakeWeb ",LM="MakeWebSitePartial;\n"$ +$MA,"Kernel ",LM="Cd(\"/Kernel\");Dir;\n"$$MA,"Compiler",LM="Cd(\"/Compiler\");Dir;\n"$$MA,"BlkDev ",LM="Cd(\"/Kernel/BlkDev\");Dir;\n"$$MA,"Mem ",LM="Cd(\"/Kernel/Mem\");Dir;\n"$$MA,"Serial ",LM="Cd(\"/Kernel/SerialDev\");Dir;\n"$$MA,"Bin ",LM="Cd(\"/Home/Sup1/Sup1Bin\");Dir;\n"$$MA,"HDAudio ",LM="Cd(\"/Home/Sup1/Sup1HDAudio\");Dir;\n"$$MA,"Examples",LM="Cd(\"/Home/Sup1/Sup1HDAudio/Examples\");Dir;\n"$ +$MA,"Adam ",LM="Cd(\"/Adam\");Dir;\n"$$MA,"AutoComp",LM="Cd(\"/Adam/AutoComplete\");Dir;\n"$$MA,"Ctrls ",LM="Cd(\"/Adam/Ctrls\");Dir;\n"$$MA,"ABlkDev ",LM="Cd(\"/Adam/ABlkDev\");Dir;\n"$$MA,"DolDoc ",LM="Cd(\"/Adam/DolDoc\");Dir;\n"$$MA,"Gr ",LM="Cd(\"/Adam/Gr\");Dir;\n"$$MA,"God ",LM="Cd(\"/Adam/God\");Dir;\n"$$MA,"Snd ",LM="Cd(\"/Adam/Snd\");Dir;\n"$$MA,"Boot ",LM="Cd(\"/Adam/Opt/Boot\");Dir;\n"$$MA,"Utils ",LM="Cd(\"/Adam/Opt/Utils\");Dir;\n"$ +$LK+X,"ChangeLg",A="FI:::/Doc/ChangeLog.DD"$$MA,"Blog ",LM="Blog;\n"$$MA,"EdGod ",LM="Ed(\"D:/Home/God.DD\");\n"$$MA,"BlogDir ",LM="Cd(\"/Home/Web/TAD/BlogDir\");Dir;\n"$$MA,"Partial ",LM="MakeWebSitePartial;\n"$$MA,"CodeWalk",LM="CodeWalkThru;\n"$$MA,"AfterEgp",LM="AfterEgyptInAction;\n"$$MA,"TOSTheme",LM="TempleOSTheme;\n"$$MA,"Videos ",LM="Cd(\"/Home/Sup1/Sup1Videos\");Dir;\n"$ +$MA,"Web ",LM="Cd(\"/Home/Web\");Dir;\n"$$MA,"TAD ",LM="Cd(\"/Home/Web/TAD\");Dir;\n"$$MA,"Sup1 ",LM="Cd(\"/Home/Sup1\");Dir;\n"$$MA,"Blog ",LM="Cd(\"/Home/Sup1/Sup1Blog\");Dir;\n"$$MA,"Code ",LM="Cd(\"/Home/Sup1/Sup1CodeScraps\");Dir;\n"$$MA,"Dist ",LM="Cd(\"/Home/Sup1/Sup1Distro\");Dir;\n"$$MA,"Games ",LM="Cd(\"/Home/Sup1/Sup1Games\");Dir;\n"$$MA,"Graphics",LM="Cd(\"/Home/Sup1/Sup1Graphics\");Dir;\n"$$MA,"Psalmody",LM="Cd(\"/Home/Sup1/Sup1Psalmody\");Dir;\n"$$MA,"Utils ",LM="Cd(\"/Home/Sup1/Sup1Utils\");Dir;\n"$ +$MA,"Apps ",LM="Cd(\"/Apps\");Dir;\n"$$MA,"AfterEgp",LM="Cd(\"/Apps/AfterEgypt\");Dir;\n"$$MA,"Budget ",LM="Cd(\"/Apps/Budget\");Dir;\n"$$MA,"GrModels",LM="Cd(\"/Apps/GrModels\");Dir;\n"$$MA,"KeepAway",LM="Cd(\"/Apps/KeepAway\");Dir;\n"$$MA,"Logic ",LM="Cd(\"/Apps/Logic\");Dir;\n"$$MA,"Psalmody",LM="Cd(\"/Apps/Psalmody\");Dir;\n"$$MA,"Span ",LM="Cd(\"/Apps/Span\");Dir;\n"$$MA,"Strut ",LM="Cd(\"/Apps/Strut\");Dir;\n"$$MA,"TimeClk ",LM="Cd(\"/Apps/TimeClock\");Dir;\n"$ +$MA,"TimeOut ",LM="Cd(\"/Apps/TimeOut\");Dir;\n"$$MA,"ToTheFrt",LM="Cd(\"/Apps/ToTheFront\");Dir;\n"$$MA,"Vocab ",LM="Cd(\"/Apps/Vocabulary\");Dir;\n"$$MA,"XCaliber",LM="Cd(\"/Apps/X-Caliber\");Dir;\n"$$SP,"",BI=1$ +$MA,"Demo ",LM="Cd(\"/Demo\");Dir;\n"$$MA,"AcctEmpl",LM="Cd(\"/Demo/AcctExample\");Dir;\n"$$MA,"Asm ",LM="Cd(\"/Demo/Asm\");Dir;\n"$$MA,"AutoFile",LM="Cd(\"/Demo/AutoFile\");Dir;\n"$$MA,"DocDoc ",LM="Cd(\"/Demo/DolDoc\");Dir;\n"$$MA,"Dsk ",LM="Cd(\"/Demo/Dsk\");Dir;\n"$$MA,"Games ",LM="Cd(\"/Demo/Games\");Dir;\n"$$MA,"Graphics",LM="Cd(\"/Demo/Graphics\");Dir;\n"$$MA,"Lectures",LM="Cd(\"/Demo/Lectures\");Dir;\n"$$MA,"MultCore",LM="Cd(\"/Demo/MultiCore\");Dir;\n"$ +$MA,"RevFile ",LM="Cd(\"/Demo/RevFileDemo\");Dir;\n"$$MA,"Snd ",LM="Cd(\"/Demo/Snd\");Dir;\n"$$MA,"SortFile",LM="Cd(\"/Demo/SortFileDemo\");Dir;\n"$$MA,"Template",LM="Cd(\"/Demo/Templates\");Dir;\n"$$MA,"HtmlTXT ",LM="Cd(\"/Demo/ToHtmlToTXTDemo\");Dir;\n"$$MA,"WebLog ",LM="Cd(\"/Demo/WebLogDemo\");Dir;\n"$$MA,"Stadium ",LM="Cd(\"/Demo/Games/Stadium\");Dir;\n"$ +$MA,"Doc ",LM="Cd(\"/Doc\");Dir;\n"$$MA,"Misc ",LM="Cd(\"/Misc\");Dir;\n"$$MA,"Tour ",LM="Cd(\"/Misc/Tour\");Dir;\n"$$MA,"Temp ",LM="Cd(\"/Temp\");Dir;\n"$$MA,"ScrnShot",LM="Cd(\"/Temp/ScreenShots\");Dir;\n"$$MA,"DelScrSt",LM="Del(\"D:/Temp/*.SND\");DelTree(\"D:/Temp/ScreenShots\");MkDir(\"D:/Temp/ScreenShots\");Del(\"C:/Temp/*.SND\");DelTree(\"C:/Temp/ScreenShots\");MkDir(\"C:/Temp/ScreenShots\");\n"$$MA,"0000Boot",LM="Cd(\"/0000Boot\");Dir;\n"$$MA,"Linux ",LM="Cd(\"/Linux\");Dir;\n"$ +$MA,"LinxDict",LM="Adam(\"GodInit(\\\"~/Sup1/Sup1Words/LinuxDict.TXT**\\\");\");\n"$$MA,"August ",LM="Adam(\"GodInit(\\\"~/Sup1/Sup1Words/AugustWords.TXT**\\\");\");\n"$$MA,"Happy ",LM="Adam(\"GodInit(\\\"~/Sup1/Sup1Words/HappyWords.TXT*\\\");\");\n"$$MA,"Bible ",LM="Adam(\"GodInit(\\\"~/Sup1/Sup1Words/BibleWords.TXT*\\\");\");\n"$$MA,"Huck ",LM="Adam(\"GodInit(\\\"~/Sup1/Sup1Words/HuckWords.TXT*\\\");\");\n"$$MA,"Ingreds ",LM="Adam(\"GodInit(\\\"~/Sup1/Sup1Words/Ingredients.TXT*\\\");\");\n"$$MA,"Chess ",LM="Adam(\"GodInit(\\\"~/Sup1/Sup1Words/Chess.DD*\\\");\");\n"$$MA,"Texts ",LM="Cd(\"/Home/Sup1/Sup1Texts\");Dir;\n"$$MA,"Words ",LM="Cd(\"/Home/Sup1/Sup1Words\");Dir;\n"$ +$MA,"MakeStd ",LM="MakeStdDistro;MkDir(\"D:/Wb\");Move(TOS_ISO_NAME,\"D:/Wb/TempleOSCD.ISO\");\n"$$MA,"MakeStRS",LM="MakeStdRedSeaDistro;MkDir(\"D:/Wb\");Move(TOS_ISO_C_NAME,\"D:/Wb/TempleOSCDRS.ISO\");\n"$$MA,"MakeUlt ",LM="MakeUltraDistro;MkDir(\"D:/Wb\");Move(TOS_ISO_NAME,\"D:/Wb/TempleOSUltra.ISO\");\n"$$MA,"MakeUtRS",LM="MakeUltraRedSeaDistro;MkDir(\"D:/Wb\");Move(TOS_ISO_C_NAME,\"D:/Wb/TempleOSUltraRS.ISO\");\n"$$MA,"MakeStaf",LM="MakeStaffDistro;MkDir(\"D:/Wb\");Move(TOS_ISO_NAME,\"D:/Wb/TempleOSStaff.ISO\");\n"$$MA,"MakeDbg ",LM="MakeDbgDistro;MkDir(\"D:/Wb\");Move(TOS_ISO_NAME,\"D:/Wb/TempleOSDbg.ISO\");\n"$ +$MA,"BurnStd ",LM="MakeStdDistro;DVDImageWrite('T',TOS_ISO_NAME);\n"$$MA,"BurnStRS",LM="MakeStdRedSeaDistro;DVDImageWrite('T',TOS_ISO_C_NAME);\n"$$MA,"BurnUlt ",LM="MakeUltraDistro;DVDImageWrite('T',TOS_ISO_NAME);\n"$$MA,"BurnUtRS",LM="MakeUltraRedSeaDistro;DVDImageWrite('T',TOS_ISO_C_NAME);\n"$$MA,"BurnStaf",LM="MakeStaffDistro;DVDImageWrite('T',TOS_ISO_NAME);\n"$$MA,"BurnDbg ",LM="MakeDbgDistro;DVDImageWrite('T',TOS_ISO_NAME);\n"$ + + + + + + + + + +$SP+PU," Egypt",LM="#include \"::/Apps/AfterEgypt/Run\"",BI=2$ $SP+PU,"Frankenstein",LM="#include \"::/Demo/Games/CastleFrankenstein\"",BI=3$ $SP+PU,"ZoneOut",LM="#include \"::/Demo/Games/ZoneOut\"",BI=4$ + + + + + + + + +$SP+PU,"Varoom",LM="#include \"::/Demo/Games/Varoom\"",BI=5$ $SP+PU,"Diamond",LM="#include \"::/Demo/Games/BlackDiamond\"",BI=6$ $SP+PU,"Lines",LM="#include \"::/Demo/Games/BattleLines\"",BI=7$ $SP+PU,"TimeOut",LM="#include \"::/Apps/TimeOut/Run\"",BI=8$ $SP+PU," Bat",LM="#include \"::/Demo/Games/FlapBat\"",BI=9$ + + + + + + +$SP+PU,"FlatTops",LM="#include \"::/Demo/Games/FlatTops\"",BI=10$ $SP+PU," Golf ",LM="#include \"::/Demo/Games/BomberGolf\"",BI=11$ $SP+PU,"Strut",LM="#include \"::/Apps/Strut/Run\"",BI=12$ $SP+PU,"TheDead",LM="#include \"::/Demo/Games/TheDead\"",BI=13$ $SP+PU,"DunGen",LM="#include \"::/Demo/Games/DunGen\"",BI=14$ + + + + + + + +$SP+PU,"EagleDive",LM="#include \"::/Demo/Games/EagleDive\"",BI=15$ $SP+PU," Span ",LM="#include \"::/Apps/Span/Run\"",BI=16$ $SP+PU,"RawHide",LM="#include \"::/Demo/Games/RawHide\"\n",BI=17$ $SP+PU,"KeepAway",LM="#include \"::/Apps/KeepAway/Run\"",BI=18$ + + + + + + + + + + +$SP+PU,"X-Caliber",LM="#include \"::/Apps/X-Caliber/Run\"",BI=19$ $SP+PU,"ToTheFront",LM="#include \"::/Apps/ToTheFront/Run\"",BI=20$ $SP+PU,"Wenceslas",LM="#include \"::/Demo/Games/Wenceslas\"",BI=21$ + + + + + + + + + +$SP+PU,"JukeBox",LM="#include \"::/Apps/Psalmody/Load\";JukeBox(\"::/Apps/Psalmody/Examples\");",BI=22$ $SP+PU,"Psalmody",LM="#include \"::/Apps/Psalmody/Run\";",BI=23$ $SP+PU,"Logic",LM="#include \"::/Apps/Logic/Run\"",BI=24$ $SP+PU,"Models",LM="#include \"::/Apps/GrModels/Run\";View;",BI=25$ $SP+PU,"Vocab",LM="#include \"::/Apps/Vocabulary/Run\"",BI=26$ + + + + + + +$SP+PU,"BigGuns",LM="#include \"::/Demo/Games/BigGuns\"",BI=27$ $SP+PU,"Budget",LM="#include \"::/Apps/Budget/Run\"",BI=28$ $SP+PU,"Digits",LM="#include \"::/Demo/Games/Digits\"",BI=29$ $SP+PU,"Checkers",LM="#include \"::/Demo/Games/TreeCheckers.HC.Z\"",BI=30$ + +$MA,"TestSuit",LM="#include \"::/Misc/OSTestSuite\";\n"$$MA,"TakeTour",LM="Cd(\"::/Misc/Tour\");;AutoFile(\"Tour\");\n"$$MA+PU,"PsalSup1",LM="#include \"::/Apps/Psalmody/Load\";Psalmody(\"~/Sup1/Sup1Psalmody\");"$$MA,"Comics ",LM="Cd(\"/Home/Sup1/Sup1Comics\");Dir;\n"$$MA-X+PU,"SymAlpha",LM="DocMax;Who;View;"$$MA-X+PU,"SymNum ",LM="DocMax;Who(\"+m\");View;"$ +yÓÿÿÿÜÿÿÿ<H÷ÿÿÿ'ûÿÿÿ÷ÿÿÿõÿÿÿüÿÿÿ õÿÿÿ'ûÿÿÿ ' + èÿÿÿòÿÿÿèÿÿÿüÿÿÿèÿÿÿèÿÿÿáÿÿÿúÿÿÿáÿÿÿúÿÿÿ èÿÿÿáÿÿÿèÿÿÿüÿÿÿèÿÿÿòÿÿÿèÿÿÿüÿÿÿúÿÿÿõÿÿÿ÷ÿÿÿ  $$÷ÿÿÿ$õÿÿÿ$ èÿÿÿõÿÿÿèÿÿÿòÿÿÿüÿÿÿõÿÿÿüÿÿÿ üÿÿÿéÿÿÿ üÿÿÿéÿÿÿ ÿÿÿÿéÿÿÿ ÿÿÿÿéÿÿÿõÿÿÿÿÿÿÿòÿÿÿÿÿÿÿûÿÿÿãÿÿÿýÿÿÿåÿÿÿãÿÿÿÿÿÿÿãÿÿÿåÿÿÿúÿÿÿáÿÿÿþÿÿÿãÿÿÿõÿÿÿ$÷ÿÿÿ$÷ÿÿÿ' $$õÿÿÿ'' +' ' +     !!&''"#%$$#       ! + + + $%*$*+'&('()&(( $++ +0/.112-,7 765343! 3 45833!839;:7;766;;1  ¸ÿÿÿøÿÿÿCastle¾éÿÿÿâÿÿÿ6R äÿÿÿ äÿÿÿ îÿÿÿ îÿÿÿ  ôÿÿÿÛÿÿÿ ôÿÿÿÛÿÿÿ äÿÿÿÛÿÿÿÛÿÿÿôÿÿÿäÿÿÿîÿÿÿîÿÿÿôÿÿÿ ÷ÿÿÿ ûÿÿÿ îÿÿÿ éÿÿÿ  óÿÿÿõÿÿÿäÿÿÿõÿÿÿäÿÿÿõÿÿÿîÿÿÿõÿÿÿîÿÿÿõÿÿÿôÿÿÿÛÿÿÿõÿÿÿôÿÿÿÛÿÿÿõÿÿÿñÿÿÿäÿÿÿñÿÿÿÛÿÿÿñÿÿÿÛÿÿÿñÿÿÿôÿÿÿäÿÿÿñÿÿÿîÿÿÿñÿÿÿîÿÿÿñÿÿÿôÿÿÿñÿÿÿõÿÿÿ÷ÿÿÿõÿÿÿûÿÿÿõÿÿÿîÿÿÿõÿÿÿéÿÿÿõÿÿÿéÿÿÿõÿÿÿóÿÿÿõÿÿÿóÿÿÿéÿÿÿ óÿÿÿõÿÿÿÿÿÿÿ + +ÿÿÿÿ*ÿÿÿÿ +* +**ÿÿÿÿ    +        +   + +    $"$#"!  !"!#"$#! !    "!"%++&%%'&&(''(()),),**,*+-$$-$'()')&3/..232.11523400/3451104-"V ëÿÿÿçÿÿÿ`Œúÿÿÿ úÿÿÿ úÿÿÿúÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿÿÿÿÿ ÿÿÿÿ ÿÿÿÿÿÿÿÿ      ðÿÿÿúÿÿÿöÿÿÿúÿÿÿöÿÿÿúÿÿÿðÿÿÿúÿÿÿóÿÿÿÿÿÿÿóÿÿÿÿÿÿÿ ÿÿÿÿ ÷ÿÿÿÿÿÿÿ÷ÿÿÿÿÿÿÿóÿÿÿÿÿÿÿóÿÿÿÿÿÿÿÿÿÿÿðÿÿÿöÿÿÿöÿÿÿðÿÿÿóÿÿÿóÿÿÿ ÷ÿÿÿ÷ÿÿÿóÿÿÿóÿÿÿúÿÿÿäÿÿÿ úÿÿÿäÿÿÿ úÿÿÿïÿÿÿúÿÿÿïÿÿÿ ùÿÿÿâÿÿÿ ùÿÿÿßÿÿÿùÿÿÿßÿÿÿùÿÿÿâÿÿÿùÿÿÿñÿÿÿ ùÿÿÿñÿÿÿ ÿÿÿÿÿÿÿÿäÿÿÿ äÿÿÿ ïÿÿÿïÿÿÿ âÿÿÿ ßÿÿÿßÿÿÿâÿÿÿñÿÿÿ ñÿÿÿ ðÿÿÿúÿÿÿäÿÿÿöÿÿÿúÿÿÿäÿÿÿöÿÿÿúÿÿÿïÿÿÿðÿÿÿúÿÿÿïÿÿÿóÿÿÿùÿÿÿâÿÿÿóÿÿÿùÿÿÿßÿÿÿùÿÿÿßÿÿÿ÷ÿÿÿùÿÿÿâÿÿÿ÷ÿÿÿùÿÿÿñÿÿÿóÿÿÿùÿÿÿñÿÿÿóÿÿÿÿÿÿÿÿÿÿÿðÿÿÿäÿÿÿöÿÿÿäÿÿÿöÿÿÿïÿÿÿðÿÿÿïÿÿÿóÿÿÿâÿÿÿóÿÿÿßÿÿÿßÿÿÿ÷ÿÿÿâÿÿÿ÷ÿÿÿñÿÿÿóÿÿÿñÿÿÿóÿÿÿ        +      + $%&&'$%$$$'$%%&&'&#!"!# #     /-.-/,/*,,*++)(+*)+(+ + +(!.-.!" + + ,*)*<=>>?<1033211=<<01<?330<1=2=>2>233?>;9:9;8867754765GEFEGDGBDDBCCA@CBA4C@C474C7C4@9FEF9:8C7C8D5BAB56TUVVWTIHKKJIIUTTHITWKKHTIUJUVJVJKKWVSRQQPSPONOLMOMN_^]]\__\Z\[Z[XY[YZLX[[OLLO[[XLQ]^^RQPO[[\PMYZZNM P88P654@@A5LMYYXLC ÐÿÿÿøÿÿÿBlackÒÿÿÿÄÿÿÿ#4ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿ   ÿÿÿÿÿÿÿÿÿÿÿÿ   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿôáÿÿÿÖÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÔÿÿÿøÿÿÿBattleâ ÌÿÿÿÉÿÿÿ66ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¾Úÿÿÿâÿÿÿ6R äÿÿÿ äÿÿÿ îÿÿÿ îÿÿÿ  ôÿÿÿÛÿÿÿ ôÿÿÿÛÿÿÿ äÿÿÿÛÿÿÿÛÿÿÿôÿÿÿäÿÿÿîÿÿÿîÿÿÿôÿÿÿ ÷ÿÿÿ ûÿÿÿ îÿÿÿ éÿÿÿ  óÿÿÿõÿÿÿäÿÿÿõÿÿÿäÿÿÿõÿÿÿîÿÿÿõÿÿÿîÿÿÿõÿÿÿôÿÿÿÛÿÿÿõÿÿÿôÿÿÿÛÿÿÿõÿÿÿñÿÿÿäÿÿÿñÿÿÿÛÿÿÿñÿÿÿÛÿÿÿñÿÿÿôÿÿÿäÿÿÿñÿÿÿîÿÿÿñÿÿÿîÿÿÿñÿÿÿôÿÿÿñÿÿÿõÿÿÿ÷ÿÿÿõÿÿÿûÿÿÿõÿÿÿîÿÿÿõÿÿÿéÿÿÿõÿÿÿéÿÿÿõÿÿÿóÿÿÿõÿÿÿóÿÿÿéÿÿÿ óÿÿÿõÿÿÿÿÿÿÿ + +ÿÿÿÿ*ÿÿÿÿ +* +**ÿÿÿÿ    +        +   + +    $"$#"!  !"!#"$#! !    "!"%++&%%'&&(''(()),),**,*+-$$-$'()')&3/..232.11523400/3451104-"´ÿÿÿ²ÿÿÿMPÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ     ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ     ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ     ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿºÚÿÿÿèÿÿÿ%ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ" +ÔÿÿÿÌÿÿÿ4.ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿb +ÌÿÿÿÆÿÿÿ-7ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ rØÿÿÿÚÿÿÿ#ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ÿ ÿ ÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ²ÒÿÿÿÞÿÿÿ'$ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿ ÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿ ÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿR ÄÿÿÿÉÿÿÿ88ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ +Ùÿÿÿêÿÿÿ!ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ +ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ + + +ÿÿÿÿ + +ÿÿÿÿÿÿÿÿÿÿ + + + + + + + + +ÿÿÿ + + + + + + + + + + +ÿÿÿ + + + + + + + + + + + + + + + + + + + +ÿÿÿ + + + + + + + + + + + + + + + + + + + + +ÿÿÿ + + + + + + + + + + + + + + + + + + + + + +ÿÿÿÿ + + + + + + + + + + + + + + + + + + + +ÿÿÿÿ + + + + + + + + + + + + + + + + + + +ÿÿÿÿ + + + + + + + + + + + + + + + + + + + + + +ÿÿÿ + + + + + + + + + + + + + + + + + + + + + +ÿÿÿ + + + + + + + + + + + + + + + + + + +ÿÿÿ + + + + + + + + + + + + + + + + +ÿÿÿ + + + + + + + + + + + + + +ÿÿ + +ÿÿÿÿÿ + + + + + + + + + + + +ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ + + + + +ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿúÕÿÿÿäÿÿÿ%ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿ ÿÿÿÿÿ ÿÿÿÿ ÿÿ ÿÿ  + + + + + + + + + +  + + + + + + + + + + + +  + + + + + + + + + + + +  + + + + + + + + + +  + + + + + + + +ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ’ÛÿÿÿÀÿÿÿ<ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ"ÏÿÿÿÑÿÿÿ)+ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ’ÔÿÿÿÚÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÆÿÿÿÖÿÿÿ4$ ÐÿÿÿøÿÿÿTreeÖéÿÿÿåÿÿÿp¨üÿÿÿíÿÿÿíÿÿÿüÿÿÿòÿÿÿòÿÿÿüÿÿÿíÿÿÿýÿÿÿíÿÿÿýÿÿÿüÿÿÿòÿÿÿýÿÿÿòÿÿÿýÿÿÿúÿÿÿòÿÿÿòÿÿÿúÿÿÿúÿÿÿòÿÿÿýÿÿÿòÿÿÿýÿÿÿúÿÿÿýÿÿÿýÿÿÿ÷ÿÿÿôÿÿÿùÿÿÿõÿÿÿöÿÿÿûÿÿÿýÿÿÿøÿÿÿüÿÿÿüÿÿÿ÷ÿÿÿòÿÿÿùÿÿÿóÿÿÿÿÿÿÿöÿÿÿùÿÿÿûÿÿÿøÿÿÿúÿÿÿúÿÿÿöÿÿÿüÿÿÿýÿÿÿøÿÿÿýÿÿÿüÿÿÿôÿÿÿöÿÿÿöÿÿÿõÿÿÿöÿÿÿùÿÿÿüÿÿÿøÿÿÿúÿÿÿûÿÿÿôÿÿÿýÿÿÿõÿÿÿöÿÿÿþÿÿÿôÿÿÿôÿÿÿÿÿÿÿöÿÿÿöÿÿÿõÿÿÿóÿÿÿòÿÿÿõÿÿÿñÿÿÿôÿÿÿýÿÿÿöÿÿÿöÿÿÿþÿÿÿõÿÿÿóÿÿÿÿÿÿÿòÿÿÿõÿÿÿñÿÿÿóÿÿÿóÿÿÿÿÿÿÿúÿÿÿúÿÿÿôÿÿÿþÿÿÿôÿÿÿýÿÿÿûÿÿÿûÿÿÿúÿÿÿúÿÿÿûÿÿÿûÿÿÿ  úÿÿÿýÿÿÿûÿÿÿ þÿÿÿ úÿÿÿÿÿÿÿýÿÿÿþÿÿÿûÿÿÿ þÿÿÿ ûÿÿÿ þÿÿÿ ûÿÿÿ þÿÿÿ ûÿÿÿ þÿÿÿ ûÿÿÿ +þÿÿÿ ûÿÿÿþÿÿÿüÿÿÿ ÿÿÿÿ ûÿÿÿ þÿÿÿ üÿÿÿÿÿÿÿÿÿÿÿ ûÿÿÿ úÿÿÿÿÿÿÿþÿÿÿÿÿÿÿùÿÿÿ øÿÿÿÿÿÿÿ +üÿÿÿ ûÿÿÿþÿÿÿùÿÿÿøÿÿÿÿÿÿÿùÿÿÿ øÿÿÿþÿÿÿöÿÿÿõÿÿÿþÿÿÿùÿÿÿøÿÿÿýÿÿÿñÿÿÿðÿÿÿþÿÿÿúÿÿÿùÿÿÿýÿÿÿòÿÿÿñÿÿÿ  + +       +  +   +      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmok êâÿÿÿÐÿÿÿ%%ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿ  ÿÿ  ÿÿ ÿ ÿ        ÿÿ   ÿÿ  ÿÿ  ÿÿ  ÿÿÿ  ÿÿÿÿ  ÿÿÿÿ ÿÿÿ  ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ åÿÿÿøÿÿÿFlap „Õÿÿÿáÿÿÿ*ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ     ÿÿÿÿÿÿÿÿÿÿÿÿ        ÿÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿ    ÿÿÿ      ÿ  ÿÿ    ÿÿ  ÿ  ÿÿÿÿÿ  ÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÑÿÿÿøÿÿÿBomberÒÒÿÿÿÛÿÿÿ0$ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ :ÚÿÿÿÝÿÿÿ%!ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ +’ ÁÿÿÿÑÿÿÿ>.                                                            B¹ÿÿÿÉÿÿÿF6 ÿ ÿÿÿ ÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  +ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  + +ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ + + + + + + + + + +ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ + + + +ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ + + + + +ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ + + + + + + + + + + + + + + + + + + + + + + +ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ + + + + + + + + + + + +ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ + + + + + + + + + + + + + + + + + + + + + + + +ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ + + + + + + + + + + + + + + + + + + + +ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ + + + + + + + + + + + + + + + + + + + + + + + + +ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ + + + + + + + + + + + + + + + + + + + + + + + + + + +ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ÿÿÿÿÿÿÿÿÿÿÿÿ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ÿÿÿÿÿÿÿÿÿÿÿ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +  + + + + + + + + + +ÿÿÿÿÿÿÿÿÿÿÿÿ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +  + + + + + + + + +ÿÿÿÿÿÿÿÿÿÿÿÿ + + + + + + + + + + + + + +  + + + + + +ÿÿÿÿÿÿÿÿÿÿ  + + + +ÿÿÿÿÿÿÿ    + ÿÿÿÿ     ÿÿ     ÿÿ        ÿ      ÿ                      ÿg ¹ÿÿÿÉÿÿÿþÿÿÿþÿÿÿÀÿÿÿîÿÿÿÈÿÿÿÖÿÿÿìÿÿÿØÿÿÿÜÿÿÿæÿÿÿèÿÿÿôÿÿÿäÿÿÿìÿÿÿâÿÿÿÞÿÿÿÌÿÿÿÜÿÿÿäÿÿÿ€ÿÿÿ +ûÿÿÿöÿÿÿûÿÿÿöÿÿÿûÿÿÿìÿÿÿçÿÿÿöÿÿÿûÿÿÿöÿÿÿ»ÒÿÿÿÛÿÿÿ6ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ØÿÿÿøÿÿÿAfter£ +AÿÿÿØÿÿÿ¿Øÿÿÿ +Aÿÿÿøÿÿÿ¿øÿÿÿ +Aÿÿÿ¿ +Aÿÿÿ(¿( +€ÿÿÿØÿÿÿ€ÿÿÿ( +Øÿÿÿ( +€Øÿÿÿ€( +Aÿÿÿèÿÿÿ¿èÿÿÿ +Aÿÿÿ¿ \ No newline at end of file diff --git a/Demo/AcctExample/PersonalMenu.TXT b/Demo/AcctExample/PersonalMenu.TXT deleted file mode 100644 index 0330865..0000000 --- a/Demo/AcctExample/PersonalMenu.TXT +++ /dev/null @@ -1,867 +0,0 @@ -$MA,"Cd ",LM="Cd;Dir;\n"$$MA,"DrvC ",LM="Drv('C');\n"$$MA,"DrvD ",LM="Drv('D');\n"$$MA,"/ ",LM="Cd(\"/\");Dir;\n"$$MA,"Home ",LM="Cd(\"/Home\");Dir;\n"$$MA,"ChgDskT ",LM="ChgDsk('T');\n"$$MA,"MergeD ",LM="S2T(\"C:/*\",\"+r+S\");Merge(\"C:/*;!*/LineRep*\",\"D:/*;!*/LineRep*\",\"+r+d\");\n"$$MA,"MergeT ",LM="S2T(\"C:/*\",\"+r+S\");Merge(\"C:/*;!*/LineRep*\",\"T:/*;!*/LineRep*\",\"+r+d\");\n"$ -$MA,"MakeC ",LM="TOSBootHDIns('C');\n"$$MA+PU,"BootC ",LM="BootRAM(\"C:/Kernel.BIN.C\");"$$MA,"MakeBack",LM="MakeDistrosAndBackUp;\n"$$MA,"PreBack ",LM="PreBackUp;\n"$$MA,"MakeD ",LM="TOSBootHDIns('D');\n"$$MA+PU,"BootD ",LM="BootRAM(\"D:/Kernel.BIN.C\");"$$MA,"CopyDrv ",LM="TOSPromptAndCopyDrv;\n"$$MA,"MakeWeb ",LM="MakeWebSitePartial;\n"$ -$MA,"Kernel ",LM="Cd(\"/Kernel\");Dir;\n"$$MA,"Compiler",LM="Cd(\"/Compiler\");Dir;\n"$$MA,"BlkDev ",LM="Cd(\"/Kernel/BlkDev\");Dir;\n"$$MA,"Mem ",LM="Cd(\"/Kernel/Mem\");Dir;\n"$$MA,"Serial ",LM="Cd(\"/Kernel/SerialDev\");Dir;\n"$$MA,"Bin ",LM="Cd(\"/Home/Sup1/Sup1Bin\");Dir;\n"$$MA,"HDAudio ",LM="Cd(\"/Home/Sup1/Sup1HDAudio\");Dir;\n"$$MA,"Examples",LM="Cd(\"/Home/Sup1/Sup1HDAudio/Examples\");Dir;\n"$ -$MA,"Adam ",LM="Cd(\"/Adam\");Dir;\n"$$MA,"AutoComp",LM="Cd(\"/Adam/AutoComplete\");Dir;\n"$$MA,"Ctrls ",LM="Cd(\"/Adam/Ctrls\");Dir;\n"$$MA,"ABlkDev ",LM="Cd(\"/Adam/ABlkDev\");Dir;\n"$$MA,"DolDoc ",LM="Cd(\"/Adam/DolDoc\");Dir;\n"$$MA,"Gr ",LM="Cd(\"/Adam/Gr\");Dir;\n"$$MA,"God ",LM="Cd(\"/Adam/God\");Dir;\n"$$MA,"Snd ",LM="Cd(\"/Adam/Snd\");Dir;\n"$$MA,"Boot ",LM="Cd(\"/Adam/Opt/Boot\");Dir;\n"$$MA,"Utils ",LM="Cd(\"/Adam/Opt/Utils\");Dir;\n"$ -$LK+X,"ChangeLg",A="FI:::/Doc/ChangeLog.TXT"$$MA,"Blog ",LM="Blog;\n"$$MA,"EdGod ",LM="Ed(\"D:/Home/God.TXT\");\n"$$MA,"BlogDir ",LM="Cd(\"/Home/Web/TAD/BlogDir\");Dir;\n"$$MA,"Partial ",LM="MakeWebSitePartial;\n"$$MA,"CodeWalk",LM="CodeWalkThru;\n"$$MA,"AfterEgp",LM="AfterEgyptInAction;\n"$$MA,"TOSTheme",LM="TempleOSTheme;\n"$$MA,"Sup1Vids",LM="Cd(\"/Home/Sup1/Sup1Videos\");Dir;\n"$ -$MA,"Web ",LM="Cd(\"/Home/Web\");Dir;\n"$$MA,"TAD ",LM="Cd(\"/Home/Web/TAD\");Dir;\n"$$MA,"Sup1 ",LM="Cd(\"/Home/Sup1\");Dir;\n"$$MA,"Blog ",LM="Cd(\"/Home/Sup1/Sup1Blog\");Dir;\n"$$MA,"Code ",LM="Cd(\"/Home/Sup1/Sup1CodeScraps\");Dir;\n"$$MA,"Dist ",LM="Cd(\"/Home/Sup1/Sup1Distro\");Dir;\n"$$MA,"Game ",LM="Cd(\"/Home/Sup1/Sup1Games\");Dir;\n"$$MA,"Graphics",LM="Cd(\"/Home/Sup1/Sup1Graphics\");Dir;\n"$$MA,"Psalmody",LM="Cd(\"/Home/Sup1/Sup1Psalmody\");Dir;\n"$$MA,"Utils ",LM="Cd(\"/Home/Sup1/Sup1Utils\");Dir;\n"$ -$MA,"Apps ",LM="Cd(\"/Apps\");Dir;\n"$$MA,"AfterEgp",LM="Cd(\"/Apps/AfterEgypt\");Dir;\n"$$MA,"Budget ",LM="Cd(\"/Apps/Budget\");Dir;\n"$$MA,"GrModels",LM="Cd(\"/Apps/GrModels\");Dir;\n"$$MA,"KeepAway",LM="Cd(\"/Apps/KeepAway\");Dir;\n"$$MA,"Logic ",LM="Cd(\"/Apps/Logic\");Dir;\n"$$MA,"Psalmody",LM="Cd(\"/Apps/Psalmody\");Dir;\n"$$MA,"Span ",LM="Cd(\"/Apps/Span\");Dir;\n"$$MA,"Strut ",LM="Cd(\"/Apps/Strut\");Dir;\n"$$MA,"TimeClk ",LM="Cd(\"/Apps/TimeClock\");Dir;\n"$ -$MA,"TimeOut ",LM="Cd(\"/Apps/TimeOut\");Dir;\n"$$MA,"ToTheFrt",LM="Cd(\"/Apps/ToTheFront\");Dir;\n"$$MA,"Vocab ",LM="Cd(\"/Apps/Vocabulary\");Dir;\n"$$MA,"XCaliber",LM="Cd(\"/Apps/X-Caliber\");Dir;\n"$$SP,"",BI=1$ -$MA,"Demo ",LM="Cd(\"/Demo\");Dir;\n"$$MA,"AcctEmpl",LM="Cd(\"/Demo/AcctExample\");Dir;\n"$$MA,"Asm ",LM="Cd(\"/Demo/Asm\");Dir;\n"$$MA,"AutoFile",LM="Cd(\"/Demo/AutoFile\");Dir;\n"$$MA,"DocDoc ",LM="Cd(\"/Demo/DolDoc\");Dir;\n"$$MA,"Dsk ",LM="Cd(\"/Demo/Dsk\");Dir;\n"$$MA,"Games ",LM="Cd(\"/Demo/Games\");Dir;\n"$$MA,"Graphics",LM="Cd(\"/Demo/Graphics\");Dir;\n"$$MA,"Lectures",LM="Cd(\"/Demo/Lectures\");Dir;\n"$$MA,"MultCore",LM="Cd(\"/Demo/MultiCore\");Dir;\n"$ -$MA,"RevFile ",LM="Cd(\"/Demo/RevFileDemo\");Dir;\n"$$MA,"Snd ",LM="Cd(\"/Demo/Snd\");Dir;\n"$$MA,"SortFile",LM="Cd(\"/Demo/SortFileDemo\");Dir;\n"$$MA,"Template",LM="Cd(\"/Demo/Templates\");Dir;\n"$$MA,"HtmlTXT ",LM="Cd(\"/Demo/ToHtmlToTXTDemo\");Dir;\n"$$MA,"WebLog ",LM="Cd(\"/Demo/WebLogDemo\");Dir;\n"$$MA,"Stadium ",LM="Cd(\"/Demo/Games/Stadium\");Dir;\n"$ -$MA,"Doc ",LM="Cd(\"/Doc\");Dir;\n"$$MA,"Misc ",LM="Cd(\"/Misc\");Dir;\n"$$MA,"Tour ",LM="Cd(\"/Misc/Tour\");Dir;\n"$$MA,"Temp ",LM="Cd(\"/Temp\");Dir;\n"$$MA,"ScrnShot",LM="Cd(\"/Temp/ScreenShots\");Dir;\n"$$MA,"DelScrSt",LM="Del(\"D:/Temp/*.SND\");DelTree(\"D:/Temp/ScreenShots\");MkDir(\"D:/Temp/ScreenShots\");Del(\"C:/Temp/*.SND\");DelTree(\"C:/Temp/ScreenShots\");MkDir(\"C:/Temp/ScreenShots\");\n"$$MA,"0000Boot",LM="Cd(\"/0000Boot\");Dir;\n"$$MA,"Linux ",LM="Cd(\"/Linux\");Dir;\n"$ -$MA,"LinxDict",LM="Adam(\"GodInit(\\\"~/Sup1/Sup1Words/LinuxDict.TXT**\\\");\");\n"$$MA,"August ",LM="Adam(\"GodInit(\\\"~/Sup1/Sup1Words/AugustWords.TXT**\\\");\");\n"$$MA,"Happy ",LM="Adam(\"GodInit(\\\"~/Sup1/Sup1Words/HappyWords.TXT*\\\");\");\n"$$MA,"Bible ",LM="Adam(\"GodInit(\\\"~/Sup1/Sup1Words/BibleWords.TXT*\\\");\");\n"$$MA,"Huck ",LM="Adam(\"GodInit(\\\"~/Sup1/Sup1Words/HuckWords.TXT*\\\");\");\n"$$MA,"Ingreds ",LM="Adam(\"GodInit(\\\"~/Sup1/Sup1Words/Ingredients.TXT*\\\");\");\n"$$MA,"Chess ",LM="Adam(\"GodInit(\\\"~/Sup1/Sup1Words/Chess.TXT*\\\");\");\n"$$MA,"Texts ",LM="Cd(\"/Home/Sup1/Sup1Texts\");Dir;\n"$$MA,"Words ",LM="Cd(\"/Home/Sup1/Sup1Words\");Dir;\n"$ -$MA,"MakeStd ",LM="MakeStdDistro; MkDir(\"D:/Wb\"); Move(TOS_ISO_NAME,\"D:/Wb/TempleOSCD.ISO\");\n"$$MA,"MakeStRS",LM="MakeStdRedSeaDistro; MkDir(\"D:/Wb\"); Move(TOS_ISO_C_NAME,\"D:/Wb/TempleOSCDRS.ISO\");\n"$$MA,"MakeUlt ",LM="MakeUltraDistro; MkDir(\"D:/Wb\"); Move(TOS_ISO_NAME,\"D:/Wb/TempleOSUltra.ISO\");\n"$$MA,"MakeUtRS",LM="MakeUltraRedSeaDistro; MkDir(\"D:/Wb\"); Move(TOS_ISO_C_NAME,\"D:/Wb/TempleOSUltraRS.ISO\");\n"$$MA,"MakeStaf",LM="MakeStaffDistro; MkDir(\"D:/Wb\"); Move(TOS_ISO_NAME,\"D:/Wb/TempleOSStaff.ISO\");\n"$$MA,"MakeDbg ",LM="MakeDbgDistro; MkDir(\"D:/Wb\"); Move(TOS_ISO_NAME,\"D:/Wb/TempleOSDbg.ISO\");\n"$ -$MA,"BurnStd ",LM="MakeStdDistro; DVDImageWrite('T',TOS_ISO_NAME);\n"$$MA,"BurnStRS",LM="MakeStdRedSeaDistro; DVDImageWrite('T',TOS_ISO_C_NAME);\n"$$MA,"BurnUlt ",LM="MakeUltraDistro;DVDImageWrite('T',TOS_ISO_NAME);\n"$$MA,"BurnUtRS",LM="MakeUltraRedSeaDistro;DVDImageWrite('T',TOS_ISO_C_NAME);\n"$$MA,"BurnStaf",LM="MakeAStaffDistro; DVDImageWrite('T',TOS_ISO_NAME);\n"$$MA,"BurnDbg ",LM="MakeDbgDistro; DVDImageWrite('T',TOS_ISO_NAME);\n"$ - - - - - - - - - -$SP+PU," Egypt",LM="#include \"::/Apps/AfterEgypt/Run\"",BI=2$ $SP+PU,"Frankenstein",LM="#include \"::/Demo/Games/CastleFrankenstein\"",BI=3$ $SP+PU,"ZoneOut",LM="#include \"::/Demo/Games/ZoneOut\"",BI=4$ - - - - - - - - -$SP+PU,"Varoom",LM="#include \"::/Demo/Games/Varoom\"",BI=5$ $SP+PU,"Diamond",LM="#include \"::/Demo/Games/BlackDiamond\"",BI=6$ $SP+PU,"Lines",LM="#include \"::/Demo/Games/BattleLines\"",BI=7$ $SP+PU,"TimeOut",LM="#include \"::/Apps/TimeOut/Run\"",BI=8$ $SP+PU," Bat",LM="#include \"::/Demo/Games/FlapBat\"",BI=9$ - - - - - - -$SP+PU,"FlatTops",LM="#include \"::/Demo/Games/FlatTops\"",BI=10$ $SP+PU," Golf ",LM="#include \"::/Demo/Games/BomberGolf\"",BI=11$ $SP+PU,"Strut",LM="#include \"::/Apps/Strut/Run\"",BI=12$ $SP+PU,"TheDead",LM="#include \"::/Demo/Games/TheDead\"",BI=13$ $SP+PU,"DunGen",LM="#include \"::/Demo/Games/DunGen\"",BI=14$ - - - - - - - -$SP+PU,"EagleDive",LM="#include \"::/Demo/Games/EagleDive\"",BI=15$ $SP+PU," Span ",LM="#include \"::/Apps/Span/Run\"",BI=16$ $SP+PU,"RawHide",LM="#include \"::/Demo/Games/RawHide\"\n",BI=17$ $SP+PU,"KeepAway",LM="#include \"::/Apps/KeepAway/Run\"",BI=18$ - - - - - - - - - - -$SP+PU,"X-Caliber",LM="#include \"::/Apps/X-Caliber/Run\"",BI=19$ $SP+PU,"ToTheFront",LM="#include \"::/Apps/ToTheFront/Run\"",BI=20$ $SP+PU,"Wenceslas",LM="#include \"::/Demo/Games/Wenceslas\"",BI=21$ - - - - - - - - - -$SP+PU,"JukeBox",LM="#include \"::/Apps/Psalmody/Load\";JukeBox(\"::/Apps/Psalmody/Examples\");",BI=22$ $SP+PU,"Psalmody",LM="#include \"::/Apps/Psalmody/Run\";",BI=23$ $SP+PU,"Logic",LM="#include \"::/Apps/Logic/Run\"",BI=24$ $SP+PU,"Models",LM="#include \"::/Apps/GrModels/Run\";View;",BI=25$ $SP+PU,"Vocab",LM="#include \"::/Apps/Vocabulary/Run\"",BI=26$ - - - - - - -$SP+PU,"BigGuns",LM="#include \"::/Demo/Games/BigGuns\"",BI=27$ $SP+PU,"Budget",LM="#include \"::/Apps/Budget/Run\"",BI=28$ $SP+PU,"Digits",LM="#include \"::/Demo/Games/Digits\"",BI=29$ $SP+PU,"Checkers",LM="#include \"::/Demo/Games/TreeCheckers.CPP.Z\"",BI=30$ - -$MA,"TestSuit",LM="#include \"::/Misc/OSTestSuite\";\n"$$MA,"TakeTour",LM="Cd(\"::/Misc/Tour\");;AutoFile(\"Tour\");\n"$$MA+PU,"PsalSup1",LM="#include \"::/Apps/Psalmody/Load\";Psalmody(\"~/Sup1/Sup1Psalmody\");"$$MA,"Comics ",LM="Cd(\"/Home/Sup1/Sup1Comics\");Dir;\n"$$MA-X+PU,"SymAlpha",LM="DocMax;Who;View;"$$MA-X+PU,"SymNum ",LM="DocMax;Who(\"+m\");View;"$ -yÓÿÿÿÜÿÿÿ<H÷ÿÿÿ'ûÿÿÿ÷ÿÿÿõÿÿÿüÿÿÿ õÿÿÿ'ûÿÿÿ ' - èÿÿÿòÿÿÿèÿÿÿüÿÿÿèÿÿÿèÿÿÿáÿÿÿúÿÿÿáÿÿÿúÿÿÿ èÿÿÿáÿÿÿèÿÿÿüÿÿÿèÿÿÿòÿÿÿèÿÿÿüÿÿÿúÿÿÿõÿÿÿ÷ÿÿÿ  $$÷ÿÿÿ$õÿÿÿ$ èÿÿÿõÿÿÿèÿÿÿòÿÿÿüÿÿÿõÿÿÿüÿÿÿ üÿÿÿéÿÿÿ üÿÿÿéÿÿÿ ÿÿÿÿéÿÿÿ ÿÿÿÿéÿÿÿõÿÿÿÿÿÿÿòÿÿÿÿÿÿÿûÿÿÿãÿÿÿýÿÿÿåÿÿÿãÿÿÿÿÿÿÿãÿÿÿåÿÿÿúÿÿÿáÿÿÿþÿÿÿãÿÿÿõÿÿÿ$÷ÿÿÿ$÷ÿÿÿ' $$õÿÿÿ'' -' ' -     !!&''"#%$$#       ! - - - $%*$*+'&('()&(( $++ -0/.112-,7 765343! 3 45833!839;:7;766;;1  ¸ÿÿÿøÿÿÿCastle¾éÿÿÿâÿÿÿ6R äÿÿÿ äÿÿÿ îÿÿÿ îÿÿÿ  ôÿÿÿÛÿÿÿ ôÿÿÿÛÿÿÿ äÿÿÿÛÿÿÿÛÿÿÿôÿÿÿäÿÿÿîÿÿÿîÿÿÿôÿÿÿ ÷ÿÿÿ ûÿÿÿ îÿÿÿ éÿÿÿ  óÿÿÿõÿÿÿäÿÿÿõÿÿÿäÿÿÿõÿÿÿîÿÿÿõÿÿÿîÿÿÿõÿÿÿôÿÿÿÛÿÿÿõÿÿÿôÿÿÿÛÿÿÿõÿÿÿñÿÿÿäÿÿÿñÿÿÿÛÿÿÿñÿÿÿÛÿÿÿñÿÿÿôÿÿÿäÿÿÿñÿÿÿîÿÿÿñÿÿÿîÿÿÿñÿÿÿôÿÿÿñÿÿÿõÿÿÿ÷ÿÿÿõÿÿÿûÿÿÿõÿÿÿîÿÿÿõÿÿÿéÿÿÿõÿÿÿéÿÿÿõÿÿÿóÿÿÿõÿÿÿóÿÿÿéÿÿÿ óÿÿÿõÿÿÿÿÿÿÿ - -ÿÿÿÿ*ÿÿÿÿ -* -**ÿÿÿÿ    -        -   - -    $"$#"!  !"!#"$#! !    "!"%++&%%'&&(''(()),),**,*+-$$-$'()')&3/..232.11523400/3451104-"V ëÿÿÿçÿÿÿ`Œúÿÿÿ úÿÿÿ úÿÿÿúÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿÿÿÿÿ ÿÿÿÿ ÿÿÿÿÿÿÿÿ      ðÿÿÿúÿÿÿöÿÿÿúÿÿÿöÿÿÿúÿÿÿðÿÿÿúÿÿÿóÿÿÿÿÿÿÿóÿÿÿÿÿÿÿ ÿÿÿÿ ÷ÿÿÿÿÿÿÿ÷ÿÿÿÿÿÿÿóÿÿÿÿÿÿÿóÿÿÿÿÿÿÿÿÿÿÿðÿÿÿöÿÿÿöÿÿÿðÿÿÿóÿÿÿóÿÿÿ ÷ÿÿÿ÷ÿÿÿóÿÿÿóÿÿÿúÿÿÿäÿÿÿ úÿÿÿäÿÿÿ úÿÿÿïÿÿÿúÿÿÿïÿÿÿ ùÿÿÿâÿÿÿ ùÿÿÿßÿÿÿùÿÿÿßÿÿÿùÿÿÿâÿÿÿùÿÿÿñÿÿÿ ùÿÿÿñÿÿÿ ÿÿÿÿÿÿÿÿäÿÿÿ äÿÿÿ ïÿÿÿïÿÿÿ âÿÿÿ ßÿÿÿßÿÿÿâÿÿÿñÿÿÿ ñÿÿÿ ðÿÿÿúÿÿÿäÿÿÿöÿÿÿúÿÿÿäÿÿÿöÿÿÿúÿÿÿïÿÿÿðÿÿÿúÿÿÿïÿÿÿóÿÿÿùÿÿÿâÿÿÿóÿÿÿùÿÿÿßÿÿÿùÿÿÿßÿÿÿ÷ÿÿÿùÿÿÿâÿÿÿ÷ÿÿÿùÿÿÿñÿÿÿóÿÿÿùÿÿÿñÿÿÿóÿÿÿÿÿÿÿÿÿÿÿðÿÿÿäÿÿÿöÿÿÿäÿÿÿöÿÿÿïÿÿÿðÿÿÿïÿÿÿóÿÿÿâÿÿÿóÿÿÿßÿÿÿßÿÿÿ÷ÿÿÿâÿÿÿ÷ÿÿÿñÿÿÿóÿÿÿñÿÿÿóÿÿÿ        -      - $%&&'$%$$$'$%%&&'&#!"!# #     /-.-/,/*,,*++)(+*)+(+ + +(!.-.!" + + ,*)*<=>>?<1033211=<<01<?330<1=2=>2>233?>;9:9;8867754765GEFEGDGBDDBCCA@CBA4C@C474C7C4@9FEF9:8C7C8D5BAB56TUVVWTIHKKJIIUTTHITWKKHTIUJUVJVJKKWVSRQQPSPONOLMOMN_^]]\__\Z\[Z[XY[YZLX[[OLLO[[XLQ]^^RQPO[[\PMYZZNM P88P654@@A5LMYYXLC ÐÿÿÿøÿÿÿBlackÒÿÿÿÄÿÿÿ#4ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿ   ÿÿÿÿÿÿÿÿÿÿÿÿ   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿôáÿÿÿÖÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÔÿÿÿøÿÿÿBattleâ ÌÿÿÿÉÿÿÿ66ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¾Úÿÿÿâÿÿÿ6R äÿÿÿ äÿÿÿ îÿÿÿ îÿÿÿ  ôÿÿÿÛÿÿÿ ôÿÿÿÛÿÿÿ äÿÿÿÛÿÿÿÛÿÿÿôÿÿÿäÿÿÿîÿÿÿîÿÿÿôÿÿÿ ÷ÿÿÿ ûÿÿÿ îÿÿÿ éÿÿÿ  óÿÿÿõÿÿÿäÿÿÿõÿÿÿäÿÿÿõÿÿÿîÿÿÿõÿÿÿîÿÿÿõÿÿÿôÿÿÿÛÿÿÿõÿÿÿôÿÿÿÛÿÿÿõÿÿÿñÿÿÿäÿÿÿñÿÿÿÛÿÿÿñÿÿÿÛÿÿÿñÿÿÿôÿÿÿäÿÿÿñÿÿÿîÿÿÿñÿÿÿîÿÿÿñÿÿÿôÿÿÿñÿÿÿõÿÿÿ÷ÿÿÿõÿÿÿûÿÿÿõÿÿÿîÿÿÿõÿÿÿéÿÿÿõÿÿÿéÿÿÿõÿÿÿóÿÿÿõÿÿÿóÿÿÿéÿÿÿ óÿÿÿõÿÿÿÿÿÿÿ - -ÿÿÿÿ*ÿÿÿÿ -* -**ÿÿÿÿ    -        -   - -    $"$#"!  !"!#"$#! !    "!"%++&%%'&&(''(()),),**,*+-$$-$'()')&3/..232.11523400/3451104-"´ÿÿÿ²ÿÿÿMPÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ     ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ     ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ     ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿºÚÿÿÿèÿÿÿ%ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ" -ÔÿÿÿÌÿÿÿ4.ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿb -ÌÿÿÿÆÿÿÿ-7ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ rØÿÿÿÚÿÿÿ#ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ÿ ÿ ÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ²ÒÿÿÿÞÿÿÿ'$ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿ ÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿ ÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿR ÄÿÿÿÉÿÿÿ88ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ -Ùÿÿÿêÿÿÿ!ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ -ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ - - -ÿÿÿÿ - -ÿÿÿÿÿÿÿÿÿÿ - - - - - - - - -ÿÿÿ - - - - - - - - - - -ÿÿÿ - - - - - - - - - - - - - - - - - - - -ÿÿÿ - - - - - - - - - - - - - - - - - - - - -ÿÿÿ - - - - - - - - - - - - - - - - - - - - - -ÿÿÿÿ - - - - - - - - - - - - - - - - - - - -ÿÿÿÿ - - - - - - - - - - - - - - - - - - -ÿÿÿÿ - - - - - - - - - - - - - - - - - - - - - -ÿÿÿ - - - - - - - - - - - - - - - - - - - - - -ÿÿÿ - - - - - - - - - - - - - - - - - - -ÿÿÿ - - - - - - - - - - - - - - - - -ÿÿÿ - - - - - - - - - - - - - -ÿÿ - -ÿÿÿÿÿ - - - - - - - - - - - -ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ - - - - -ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿúÕÿÿÿäÿÿÿ%ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿ ÿÿÿÿÿ ÿÿÿÿ ÿÿ ÿÿ  - - - - - - - - - -  - - - - - - - - - - - -  - - - - - - - - - - - -  - - - - - - - - - -  - - - - - - - -ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ’ÛÿÿÿÀÿÿÿ<ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ"ÏÿÿÿÑÿÿÿ)+ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ’ÔÿÿÿÚÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÆÿÿÿÖÿÿÿ4$ ÐÿÿÿøÿÿÿTreeÖéÿÿÿåÿÿÿp¨üÿÿÿíÿÿÿíÿÿÿüÿÿÿòÿÿÿòÿÿÿüÿÿÿíÿÿÿýÿÿÿíÿÿÿýÿÿÿüÿÿÿòÿÿÿýÿÿÿòÿÿÿýÿÿÿúÿÿÿòÿÿÿòÿÿÿúÿÿÿúÿÿÿòÿÿÿýÿÿÿòÿÿÿýÿÿÿúÿÿÿýÿÿÿýÿÿÿ÷ÿÿÿôÿÿÿùÿÿÿõÿÿÿöÿÿÿûÿÿÿýÿÿÿøÿÿÿüÿÿÿüÿÿÿ÷ÿÿÿòÿÿÿùÿÿÿóÿÿÿÿÿÿÿöÿÿÿùÿÿÿûÿÿÿøÿÿÿúÿÿÿúÿÿÿöÿÿÿüÿÿÿýÿÿÿøÿÿÿýÿÿÿüÿÿÿôÿÿÿöÿÿÿöÿÿÿõÿÿÿöÿÿÿùÿÿÿüÿÿÿøÿÿÿúÿÿÿûÿÿÿôÿÿÿýÿÿÿõÿÿÿöÿÿÿþÿÿÿôÿÿÿôÿÿÿÿÿÿÿöÿÿÿöÿÿÿõÿÿÿóÿÿÿòÿÿÿõÿÿÿñÿÿÿôÿÿÿýÿÿÿöÿÿÿöÿÿÿþÿÿÿõÿÿÿóÿÿÿÿÿÿÿòÿÿÿõÿÿÿñÿÿÿóÿÿÿóÿÿÿÿÿÿÿúÿÿÿúÿÿÿôÿÿÿþÿÿÿôÿÿÿýÿÿÿûÿÿÿûÿÿÿúÿÿÿúÿÿÿûÿÿÿûÿÿÿ  úÿÿÿýÿÿÿûÿÿÿ þÿÿÿ úÿÿÿÿÿÿÿýÿÿÿþÿÿÿûÿÿÿ þÿÿÿ ûÿÿÿ þÿÿÿ ûÿÿÿ þÿÿÿ ûÿÿÿ þÿÿÿ ûÿÿÿ -þÿÿÿ ûÿÿÿþÿÿÿüÿÿÿ ÿÿÿÿ ûÿÿÿ þÿÿÿ üÿÿÿÿÿÿÿÿÿÿÿ ûÿÿÿ úÿÿÿÿÿÿÿþÿÿÿÿÿÿÿùÿÿÿ øÿÿÿÿÿÿÿ -üÿÿÿ ûÿÿÿþÿÿÿùÿÿÿøÿÿÿÿÿÿÿùÿÿÿ øÿÿÿþÿÿÿöÿÿÿõÿÿÿþÿÿÿùÿÿÿøÿÿÿýÿÿÿñÿÿÿðÿÿÿþÿÿÿúÿÿÿùÿÿÿýÿÿÿòÿÿÿñÿÿÿ  - -       -  -   -      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmok êâÿÿÿÐÿÿÿ%%ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿ  ÿÿ  ÿÿ ÿ ÿ        ÿÿ   ÿÿ  ÿÿ  ÿÿ  ÿÿÿ  ÿÿÿÿ  ÿÿÿÿ ÿÿÿ  ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ åÿÿÿøÿÿÿFlap „Õÿÿÿáÿÿÿ*ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ     ÿÿÿÿÿÿÿÿÿÿÿÿ        ÿÿÿÿÿÿÿÿÿ      ÿÿÿÿÿÿ    ÿÿÿ      ÿ  ÿÿ    ÿÿ  ÿ  ÿÿÿÿÿ  ÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÑÿÿÿøÿÿÿBomberÒÒÿÿÿÛÿÿÿ0$ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ :ÚÿÿÿÝÿÿÿ%!ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ -’ ÁÿÿÿÑÿÿÿ>.                                                             B¹ÿÿÿÉÿÿÿF6 ÿ ÿÿÿ ÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  -ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  - -ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ - - - - - - - - - -ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ - - - -ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ - - - - -ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ - - - - - - - - - - - - - - - - - - - - - - -ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ - - - - - - - - - - - -ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ - - - - - - - - - - - - - - - - - - - - - - - -ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ - - - - - - - - - - - - - - - - - - - -ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ - - - - - - - - - - - - - - - - - - - - - - - - -ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ - - - - - - - - - - - - - - - - - - - - - - - - - - -ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -ÿÿÿÿÿÿÿÿÿÿÿÿ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -ÿÿÿÿÿÿÿÿÿÿÿ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - -ÿÿÿÿÿÿÿÿÿÿÿÿ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - -ÿÿÿÿÿÿÿÿÿÿÿÿ - - - - - - - - - - - - - -  - - - - - -ÿÿÿÿÿÿÿÿÿÿ  - - - -ÿÿÿÿÿÿÿ    - ÿÿÿÿ     ÿÿ     ÿÿ        ÿ      ÿ                      ÿg ¹ÿÿÿÉÿÿÿþÿÿÿþÿÿÿÀÿÿÿîÿÿÿÈÿÿÿÖÿÿÿìÿÿÿØÿÿÿÜÿÿÿæÿÿÿèÿÿÿôÿÿÿäÿÿÿìÿÿÿâÿÿÿÞÿÿÿÌÿÿÿÜÿÿÿäÿÿÿ€ÿÿÿ -ûÿÿÿöÿÿÿûÿÿÿöÿÿÿûÿÿÿìÿÿÿçÿÿÿöÿÿÿûÿÿÿöÿÿÿ»ÒÿÿÿÛÿÿÿ6ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ØÿÿÿøÿÿÿAfter£ -AÿÿÿØÿÿÿ¿Øÿÿÿ -Aÿÿÿøÿÿÿ¿øÿÿÿ -Aÿÿÿ¿ -Aÿÿÿ(¿( -€ÿÿÿØÿÿÿ€ÿÿÿ( -Øÿÿÿ( -€Øÿÿÿ€( -Aÿÿÿèÿÿÿ¿èÿÿÿ -Aÿÿÿ¿ \ No newline at end of file diff --git a/Demo/AcctExample/PersonalNotes.DD b/Demo/AcctExample/PersonalNotes.DD new file mode 100644 index 0000000..34e3543 --- /dev/null +++ b/Demo/AcctExample/PersonalNotes.DD @@ -0,0 +1,470 @@ +$WW,1$$FG,5$$TX+CX,"TODO"$$FG$ +* Cursor in $LK,"::/Home/TOSToHtml.HC"$. + +* Investigate why packet loss $LK,"Training Sleep(1)",A="FF:::/Adam/Training.HC,Sleep(1)"$. + +* Add AVL or red/black binary tree library support. We have fixed-size stack. Auto-balancing binary tree is very needed. I've done everything myself. I don't want to ruin a perfect record. I'm in no hurry. + +* $LK,"SpriteEd",A="FI:::/Adam/Gr/SpriteEd.HC"$ shift pts, Ctrl pt for ellipse/polygon w,h is off when rotated. + +* God said this is bad. $LK,"FL:::/Adam/DolDoc/DocFind.HC,41"$ +* Backward is broken? + +* Cannot include ':' in $LK,"Document Links",A="FF:::/Adam/DolDoc/DocLink.HC,AD"$ search string. +* $$DA fixed width string: or permanently shortens. + +* Editor overstrike mode at cmd line with menu macro? Probably, many other overstrike issues. + +* $LK,"DOCT_HEX_ED",A="MN:DOCT_HEX_ED"$ with odd size, ASCII cannot be edited. + +* $LK,"FL:::/Adam/Gr/SpriteEd.HC,789"$ Resize bitmap? + +* $LK,"DOCEF_REMALLOC_DATA",A="FF:::/Adam/DolDoc/DocChar.HC,DOCEF_REMALLOC_DATA"$ HexEdit Remalloc. + +* $LK,"DOCF_DBL_DOLLARS",A="MN:DOCF_DBL_DOLLARS"$ in $LK,"Reindention",A="MN:EdCodeTools2"$. + +* Compiler Optimization: Local array vars --> reg. Might exist. + +* Make function as a better word processor. Justify text. Page numbers. Header and footer templates? + +* Compiler Optimization: heap_glbls with added offset. Might exist. + +* AfterEgypt: $LK,"Numbers,13:33",A="BF:Numbers,13:33"$ scouts? $LK,"Numbers,21:8",A="BF:Numbers,21:8"$ snakes? + +* Bug: Find-and-replace text on $$PT$$ line before it. +* 12/25/2015 Copy-Paste index.html glitch if source window 40 columns. +* 01/06/2016 Editor filter "str" applied to output from LineRep looks broken. + +* Document, perhaps with video, $LK,"GetStr",A="MN:GetStr"$() all the way down into $LK,"PutKey",A="MN:PutKey"$() code. + +* Better dictionary. +* Good $LK,"spell checker",A="MN:ACMisspelledFind"$. +* Good Bible search. + +* Can $LK,"MEM_EXTRA_HASH2_PAGES",A="MN:MEM_EXTRA_HASH2_PAGES"$ be just one? + +* Bible ranges in $LK,"BibleVerse",A="MN:BibleVerse"$(). + +* $LK,"::/Demo/Games/FlatTops.HC"$ is torpedo, not bombs. + +* Reset MPs with $LK,"Core0StartMP",A="MN:Core0StartMP"$() after boot. Free old task memory? + +* Use pen_width and pen_height when clipping with pen_width>1. + +* $LK,"~/Sup1/Sup1Games/Rocks.HC"$. + +* Asm LIST NOLIST bugs. + +* Review writing to same cache-line from multicore. Do $LK,"CTask",A="MN:CTask"$->task_flags and others need to be in separate cache lines? + +* Fix $LK,"KbdLEDsSet",A="MN:KbdLEDsSet"$(). +* NumLock comes on with break key. + +* Hymns: mightest, finger + +* Get rid of JIFFY and HPET and just use tS. + +* Change %h*c so the character is not a arg? + +* $LK,"GrLineFat3",A="MN:GrLineFat3"$() needs a little work. + +* $LK,"GrFillTri0",A="MN:GrFillTri0"$() with both $LK,"GrHLine",A="MN:GrHLine"$() and $LK,"GrVLine",A="MN:GrVLine"$() don't match in $LK,"::/Demo/Games/CastleFrankenstein.HC"$ causing wall spot pixels. + + +$FG,5$$TX+CX,"TODO? Meh"$$FG$ +* Compiler: lock{} needs warn on invalid modes or something. + +* Compiler: Warn recurse class define? + +* Asm could support R4u8 by adding 0x40 byte. + +* $LK,"Mem32DevAlloc",A="MN:Mem32DevAlloc"$() is broken. Devices should be in free spot of E820 report. + +* $LK,"SpriteEd",A="FI:::/Adam/Gr/SpriteEd.HC"$: Strip $LK,"SPT_SHIFT",A="MN:SPT_SHIFT"$ origin cmds? + +* Clean-up ASCII #127 delete char? (No. Maybe, we want a new usage for 127 in future centuries.) + +* Compiler: Exceptions don't free $LK,"CCmpCtrl",A="MN:CCmpCtrl"$ stuff. + +* $LK,"::/Adam/DolDoc/DocHighlight.HC"$ for code comments at top of documents. + +* Unhandled exception msgs from MP's get overwritten by WinMgr. + +* $LK,"Diff",A="MN:Diff"$("C:/Misc/Bible.TXT","D:/Misc/Bible.TXT"); Takes too long. + +* Finish Pilgrim game. + +* Compiler: PtrArith MUL SIZE -->QueIns(MUL)? +* Compiler: QueRem(IC_NOP)? + +* Fix Chess game so not isometric view. + + +$FG,5$$TX+CX,"TODO: Too Hard, or Not Worth Doing."$$FG$ +* AutoComplete/$LK,"Man",A="MN:Man"$() Jmp for user code. + +* $LK,"Bible sized nodes",A="FF:::/Adam/DolDoc/DocRecalc.HC,->tag+i"$ + +* $LK,"FileMgr",A="MN:FileMgr"$() is bad with lots of files. + +* Would be nice to have a routine telling how much free memory, so apps can plan a big alloc. This is doable, depending on how. + +* Log-to-file is inefficient because we load and save whole file. + +* $LK,"ICMov",A="MN:ICMov"$() $LK,"PUSH_CMP",A="FF:::/Compiler/BackLib.HC,PUSH_CMP"$ and $LK,"MDf_STK",A="MN:MDf_STK"$? Perhaps, it's okay. + +* Short FAT32 ~ names. + +* Compiler: Inline functions? + +* Compiler: FunPtr local vars? I forgot if this was hard or not. +$ID,5$$HL,1$U0 Main() +{ + U0 (*fp_old_draw_input_ptr)(CDC *dc,I64 x,I64 y)=gr.fp_draw_input_ptr; +} +$ID,-5$$HL,0$ +* Compiler: Get rid of $LK,"0x20000",A="FF:::/Compiler/CMain.HC,0x20000"$ limit. + +* $LK,"GrFloodFillRay",A="MN:GrFloodFillRay"$: Get rid of $LK,"0x80000",A="FF:::/Adam/Gr/GrPrimatives.HC,0x80000"$ limit. + + +$FG,5$$TX+CX,"Bugs"$$FG$ +* 1/28/16 $LK,"::/Demo/Graphics/Pick3D.HC"$ crashed in TestSuite. + +* 1/12/16 make RAM drive 2288 blks, $FG,2$CopyTree("C:/Home","B:/Home"); $FG$ Disk runs-out of space and hangs instead of reporting errors. + +* Bug introduced around 11/1/15. Changed $LK,"::/Kernel/Sched.HC"$ and now $LK,"WinToTop",A="MN:WinToTop"$ is called on Adam task at start-up, sometimes. Might be user's fault because of bad keys pressed during VMware power-on init. Might be fixed by $LK,"ACf_INIT_IN_PROGRESS",A="MN:ACf_INIT_IN_PROGRESS"$. + +* 1/12/16 $LK,"ATARepEntry",A="MN:ATARepEntry"$ shows corrupted buttons. Weird. Perhaps, my imagination. + + +$FG,5$$TX+CX,"3rd Party Bugs"$$FG$ +* VMware: Stretch to full screen +* VMware: PC speaker sound distorted. +* VMware: 8/2/2015 start-up. Probably multicore. +* VMware: $LK,"CtrlAltDel",A="FF:::/Kernel/SerialDev/Keyboard.HC,CtrlAltDel"$ on +* VMware: Size zero files don't copy out of mounted disk? (Might be fixed.) + + +$FG,5$$TX+CX,"Bugs? Not really sure."$$FG$ +* $LK,"Mount",A="MN:Mount"$() crashes on bad drive. + +* Graphics clipping: screen y+top<0 for top<0? + +* 1/1/2015 Bug messing-up keyboard, like no CTRL key. Was working on Sprites. + +* 4/13/14 Strut or RawHide crashed when $LK,"sys_var_init_flag",A="MN:sys_var_init_flag"$ was set during testsuite. Perhaps, floodfill? + +* $LK,"ChkDsk",A="MN:ChkDsk"$ alloc unalloced. I don't know if I fixed this. + +* 1/?/2015,8/10/2015 Macro sel in Menu did not go to shell? No, I think just twice. Not a bug. + +* 5/7/14:Something like $LK,"AFSetIP",A="MN:AFSetIP"$ caused hang, then reboot in TestSuite. +* 5/7/14:#63 Maybe, $LK,"::/Demo/Graphics/Pick3D.HC"$ crashed in TestSuite. +* 6/8/14:After or in $LK,"PageTableEntries",A="FF:::/Misc/OSTestSuite.HC,PageTableEntries"$ in TestSuite crash. + +* $LK,"StrPrintJoin",A="MN:StrPrintJoin"$(,st); With st="\n\\"; (Forgot what this is talking about.) + +* $LK,"BMPRLE4To",A="MN:BMPRLE4To"$() has files_size too big by 108. Fixed? + + +$FG,5$$TX+CX,"TODO? Not really, just angst."$$FG$ +* Nontimer $LK,"Rand",A="MN:Rand"$() is really bad! + +* Should these be moved into $LK,"CHashClass",A="MN:CHashClass"$ from $LK,"CMemberLst",A="MN:CMemberLst"$ and $LK,"CHashGlblVar",A="MN:CHashGlblVar"$? +$ID,5$CArrayDim dim; +CHashFun *fun_ptr; +$ID,-5$ +* extern of fun with dft arg of str? + +* Might want to warn switch[] dup case numbers. + +* Make $LK,"Clamp",A="MN:Clamp"$(), $LK,"Min",A="MN:Min"$(), $LK,"Max",A="MN:Max"$() into asm routines? + +* Add local vars to sym table in $LK,"Dbg",A="MN:Dbg"$()? + +* Compiler: Prints two error messages for expressions in stmts. + +* $LK,"U",A="MN:U"$() negative byte displacement, neg 32-bit disp. + +* Race condition in $LK,"::/Demo/Games/FlatTops.HC"$ torpedo. + +* Links to self document if empty file name? $LK,"Document Links",A="FF:::/Adam/DolDoc/DocLink.HC,AD"$ + +* $LK,"FUF_RECURSE",A="MN:FUF_RECURSE"$ would be nice if capital "+R". + +* Sprites in cmd line code. + +* 16-Bit Assembly and Unassembly and is bad. + +* Compiler: Cmd to enable/disable warnings. + +* Compiler: Type for either F64 or I64, like Print -- no conversion. +* Compiler: Arg type ... that did do conversion, if we have one that doesn't. + +* $LK,"R",A="MN:R"$("chars_bmp_","set_"); + +* Clean-up code $LK,"FileNameAbs",A="MN:FileNameAbs"$(), does it need so many local var names? I guess no choice. + + +$FG,5$$TX+CX,"Committee Needed"$$FG$ +* Make binary tree look-up using FUN_SEG symbol addresses, so we can eliminate fun_seg cache and wall-paper kludge? All HolyC functions and glbl vars would have left-right for address search. + +* $LK,"MP DepthBuf",A="FF:::/Adam/Gr/SpriteMesh.HC,dc->depth_buf=e->"$ is a kludge because of dc->depth_buf=NULL in various graphics routines. + +* Improve editor undo, add redo. + +* Compiler: F32? + +* International Date output: $LK,"MPrintDate",A="MN:MPrintDate"$(). Every country make own version? +* International Date input: $LK,"Str2Date",A="MN:Str2Date"$(). + +* $LK,"DCF_SYMMETRY",A="MN:DCF_SYMMETRY"$ before transformation? (Currently, it's after.) + +* $LK,"TRANSPARENT",A="MN:TRANSPARENT"$ does not work with $LK,"ROPF_DITHER",A="MN:ROPF_DITHER"$. + +* $LK,"ROP_XOR",A="MN:ROP_XOR"$ with pen_width>1 is broken. + +* $LK,"GrPutChar3",A="MN:GrPutChar3"$() with depth buf? + +* Eliminate? $LK,"::/Adam/Ctrls/CtrlsA.HC"$? +* Eliminate? $LK,"::/Adam/AMathODE.HC"$? +* Eliminate? $LK,"Complex",A="MN:Complex"$? +* Eliminate? $LK,"CDC",A="MN:CDC"$.brush? +* Eliminate? $LK,"Mat4x4MulXYZ",A="MN:Mat4x4MulXYZ"$() change to 3x3? +* Eliminate? $LK,"ROP_XOR",A="MN:ROP_XOR"$? + +* $LK,"WinMgrTask",A="MN:WinMgrTask"$ needs to do doc operations on $LK,"PostMsg",A="MN:PostMsg"$() msgs for mouse. Already works for $LK,"IPSet",A="MN:IPSet"$()? + +* Should Msgs in PopUp queue get fwded to parent when task dies? + +* Import Intel datasheets so we can use links in $LK,"Code",A="FI:::/Kernel/Mem/PageTables.HC"$ for documentation. I tried a PDF-to-text convertor and it wasn't acceptible. + +* Why are BMP file $LK,"CBGR24",A="MN:CBGR24"$'s wrong? $LK,"::/Adam/Opt/Utils/FileBMP.HC"$. + +* Switch stmt with sparse cases? Maybe, ban sparse switch stmts. + +* Compiler Optimization: Postpone LocalVar init until last possible moment in case of return. + +* Compiler: Local var array/struct initialization. + +* Compiler Optimization: Bools use r,rm in $LK,"ICCmp",A="MN:ICCmp"$() like in $LK,"ICCmpAndBranch",A="MN:ICCmpAndBranch"$()? + +* Compiler: !F64 ~F64 + +* Compiler: &=, |= can overflow with Bts Btr on small data types? + +* Compiler: $LK,"sys_var_init_flag",A="MN:sys_var_init_flag"$ for local vars? + +* Implement $LK,"RS_ATTR_FIXED",A="MN:RS_ATTR_FIXED"$ fixed pos files? + +* SIMD in $LK,"Mat4x4MulXYZ",A="MN:Mat4x4MulXYZ"$? + +* I use fixed-point in $LK,"Circle",A="MN:Circle"$(), $LK,"Ellipse",A="MN:Ellipse"$(), $LK,"Mat4x4MulXYZ",A="MN:Mat4x4MulXYZ"$(), $LK,"Mat4x4MulMat4x4New",A="MN:Mat4x4MulMat4x4New"$() and others. God says I might want to change to float. $LK,"::/Demo/Lectures/FixedPoint.HC"$ $LK,"::/Demo/Lectures/FixedPointAdvanced.HC"$. + +* Note: We will never put multiple $LK,"Keyboard Tables",A="FI:::/Kernel/SerialDev/Keyboard.HC"$. Each country must make their own version of TempleOS. The $LK,"Intel Factory ROM",A="FF:::/Doc/Demands.DD,English"$ will have just English. Our $LK,"Charter",A="FI:::/Doc/Charter.DD"$ bans multiple country or architectures in the same version. + +* 12 border chars in screen font codes 0x02-0x0D. $LK,"TextBorder",A="MN:TextBorder"$() $LK,"RawDr",A="MN:RawDr"$() $LK,"::/Demo/Games/CharDemo.HC"$. LineFeed shows-up in $FG,2$$FG$ PersonalMenu. + +* Super-simple high speed serial needs flow control. $FG,2$$FG$ and $FG,2$$FG$? + + +$FG,5$$TX+CX,"Inspirational Ideas"$$FG$ +* Redo videos, make more professional. + +* Use standard terminology from "the literature". + +* Striped and other dither patterns. Brushes? + +* Get rid of BYTE, WORD, DWORD in opcode and replace with U8, U16, U32. + +* Get rid of "Char". + +* Get rid of having two terms and pick one, "Disk" and "BlkDev"? (Probably, not that one.) + +* Could switch to having just C and D drives and RAMDrive and CD/DVD? + +* New editor widgets. + +* Make use of flag potential in $LK,"FilesFind",A="MN:FilesFind"$() and possibly $LK,"DirContextNew",A="MN:DirContextNew"$(). +* Sort options for $LK,"FilesFind",A="MN:FilesFind"$()? + +* New $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ language features? + +* Better $LK,"Debugging",A="HI:Debugging"$? + +* Look for mem leaks? + +* Std local var names. + +* Ticketmaster format stmts? Overflow "t='*'" and padding character? + +* Move stuff out of $LK,"Kernel",A="FI:::/Kernel/Kernel.PRJ"$ module. + +* $$LK,L="FL:D:/Kernel/File.HC"$$ instead of A= +* $$SP,B=1$$ instead of $$SP,BI=1$$ +* $$CM+LE+RE is nasty + +* DCF_TRANSFORMATION|DCF_SYMMETRY|DCF_JUST_MIRROR -- maybe not both needed at once. + +* More $LK,"Controls",A="MN:CCtrl"$? + +* Compiler: More use of more floating-point stk? + +* Compiler: More aggressive in $LK,"CmpF2PushPop",A="MN:CmpF2PushPop"$() with types besides MOV and F64. + +* Playing with $LK,"::/Demo/Lectures/NegDisp.HC"$ on $LK,"CTask",A="MN:CTask"$? +$ID,5$$$=-CTASK_NEG_OFFSET +offset(CTask.addr)==0 +Spawn(): CAlloc() +TaskDel(): Free() +CSysFixedArea.adam +Looks like task_flags,locked_flags cause problems with neg offset. +$ID,-5$ +* Make a game, S.E.T.I., with radio telescope array. Put God on air. + + +$FG,5$$TX+CX,"Test"$$FG$ +* $LK,"SpriteBitMap",A="FI:::/Adam/Gr/SpriteBitMap.HC"$: Grabscroll? + +* $LK,"DrvMap",A="MN:DrvMap"$() in $LK,"MountFile",A="MN:MountFile"$(). + +* Return ress for $LK,"GrBlot",A="MN:GrBlot"$, $LK,"GrRect",A="MN:GrRect"$, $LK,"GrPutChar",A="MN:GrPutChar"$? +* Collision cnts for $LK,"GrBlot",A="MN:GrBlot"$, $LK,"GrRect",A="MN:GrRect"$, $LK,"GrPutChar",A="MN:GrPutChar"$? + +* $LK,"GetStr",A="MN:GetStr"$() or $LK,"GetChar",A="MN:GetChar"$() in $LK,"OSInstall",A="FI:::/Misc/OSInstall.HC"$ didn't like focus change. + +* Test on Dad's computer or other people's? + +* $LK,"ICDivEqu",A="MN:ICDivEqu"$() assumes RBX. Is it okay? + +* Autofile PopUp of PopUp? + +* $LK,"FileMgr",A="MN:FileMgr"$() help link scrolls out of window. + +* $LK,"MouseDriverInstall",A="MN:MouseDriverInstall"$() throws exceptions? Doesn't work? Why mouse $LK,"0x9FC30",A="FF:::/Kernel/SerialDev/Mouse.HC,9FC"$? + +* VirtualBox MP reboot? + +* Compiler: Err/Warn line nums? +* Asm branch-out-of-range warn by one line? + +* Make sure queue links safe in one direction. Task $LK,"QueIns",A="MN:QueIns"$ and $LK,"QueRem",A="MN:QueRem"$ for multicore cycling fwd through tasks. + +* Test removable media id and $LK,"RS_ATTR_RESIDENT",A="MN:RS_ATTR_RESIDENT"$. $LK,"Touch",A="MN:Touch"$("","+T"); + + +$FG,5$$TX+CX,"Uncategorized"$$FG$ +* DiskCache during FileRead. , $LK,"Kill",A="MN:Kill"$(). + +* MOV U8 [RSP+RCX],DL + +* $LK,"gr.screen_image",A="MN:CGrGlbls"$ + >Might want to do ZOOM in U8 graphics and convert screen capture to U8 + >Might want to rev bit order + +* This $LK,"Fs->catch_except=TRUE",A="FF:::/Kernel/SrvCmd.HC,Fs->catch_except=TRUE"$ causes problems because it +catches divide and out-of-mem. Not sure what to do, yet. + +* Release semaphores or break lock sema,usb_td + +* Might make CSprite flood fill operate on a separate bitmap +and blotted at the end. +* delete subsprite in menu near others +* make better heapwalk, do something with $LK,"_CFG_HEAP_DBG",A="FF:::/Kernel/KernelA.HH,_CFG_HEAP_DBG"$. + +* static var off of data heap. +* could add "const" to not set CCF_NOT_CONST flag for trig, etc. +* could make glblvar imports use MDF_RIP_DISP32. +* PUSH_CMP allocs reg R9 or whatever +* Might be problem with NOP in OPT pass1 for NO_PUSH in expressions besides +assignments. Is ShiftNoPush fully implemented? + + +$FG,5$$TX+CX,"Bible Passages"$$FG$ +It is love I desire $TX,"Hosea 6:6",HTML="http://www.biblegateway.com/verse/en/Hosea%206:6"$ +Males appear three times, not empty $TX,"Deuteronomy 16:16",HTML="http://www.biblegateway.com/verse/en/Deuteronomy%2016:16"$ +Offer a sacrifice of praise $TX,"Hebrews 13:15",HTML="http://www.biblegateway.com/verse/en/Hebrews%2013:15"$ +Do I drink blood of goats? Offer praise $TX,"Psalms 50:14",HTML="http://www.biblegateway.com/verse/en/Psalms%2050:14"$ +When a servant becomes king... $TX,"Proverb 30:22",HTML="http://www.biblegateway.com/verse/en/Proverb%2030:22"$ +Runner's stride $TX,"Psalms 147:10",HTML="http://www.biblegateway.com/verse/en/Psalms%20147:10"$ +Buckling armor $TX,"1 Kings 20:11",HTML="http://www.biblegateway.com/verse/en/1%20Kings%2020:11"$ +Lot cast in the lap $TX,"Proverbs 16:33",HTML="http://www.biblegateway.com/verse/en/Proverbs%2016:33"$ +Lord does not repeat $TX,"Job 33:14",HTML="http://www.biblegateway.com/verse/en/Job%2033:14"$ +Offer only in approved place $TX,"Deuteronomy 12:13-18",HTML="http://www.biblegateway.com/passage/?search=Deuteronomy%2012:13-18&version=NIV"$ +Jesus' zeal for the Temple $TX,"John 2:14-19",HTML="http://www.biblegateway.com/passage/?search=John%202:14-19&version=NIV"$ +Famine not for bread $TX,"Amos 8:11-12",HTML="http://www.biblegateway.com/passage/?search=Amos%208:11-12&version=NIV"$ +To the honest, you are honest $TX,"Psalm 18:26",HTML="http://www.biblegateway.com/verse/en/Psalm%2018:26"$ +Meek and humble of heart $TX,"Matthew 11:29",HTML="http://www.biblegateway.com/verse/en/Matthew%2011:29"$ +Moses gets Aaron $TX,"Exodus 4:10-16",HTML="http://www.biblegateway.com/passage/?search=Exodus%204:10-16&version=NIV"$ +There is no council against the Lord $TX,"Proverbs 21:30",HTML="http://www.biblegateway.com/verse/en/Proverbs%2021:30"$ +Human help is worthless $TX,"Psalm 108:12",HTML="http://www.biblegateway.com/verse/en/Psalm%20108:12"$ +Do not seek your own wealth $TX,"1 Corinthians 10:24",HTML="http://www.biblegateway.com/verse/en/1%20Corinthians%2010:24"$ +Abundance of Spirits $TX,"1 Corinthians 14:12",HTML="http://www.usccb.org/bible/1corinthians/14:12"$ +The stone rejected is cornerstone $TX,"Matthew 21:42",HTML="http://www.biblegateway.com/verse/en/Matthew%2021:42"$ +Egypt rise like flood $TX,"Jeremiah 46:7-8",HTML="http://www.biblegateway.com/passage/?search=Jeremiah%2046:7-8&version=NIV"$ +New wineskins $TX,"Mark 2:22",HTML="http://www.biblegateway.com/verse/en/Mark%202:22"$ +Thousand songs of Solomon $TX,"1 Kings 4:30-32",HTML="http://www.biblegateway.com/passage/?search=1%20Kings%204:30-32&version=NIV"$ + +$FG,5$$TX+CX,"Misc Notes"$$FG$ +Erik van der Karbargenbok: $LK,"TempleBot",A="PI:::/Home/Sup1/Sup1Bin/TempleBot"$. +Intel CEO's name: Brian Krzanich +>$FG,2$lspci -v$FG$ +Size:$TX,"20932 KB",D="DD_TEMPLEOSCD_K_SIZE"$ + +$FG,5$$TX+CX,"My Web Bookmarks"$$FG$$WW,0$ +$TX,"My FireFox Bookmarks",HTML="http://www.templeos.org/Wb/Home/Sup1/Sup1Blog/Bookmarks"$ +Machine $HC,"
\"\"
"$ +Frosting $HC,"
\"\"
"$ +Soap Carvings $HC,"
\"\"
"$ +CottonTail $HC,"
\"\"
"$ +TempleOS Logo $HC,"
\"\"
"$ +Pew Pew Pew $HC,"
\"\"
"$ +Iceberg $HC,"
\"\"
"$ +I made dis $HC,"
\"\"
"$ +NIST Beacon $HC,"
\"\"
"$ +Purple Frog $HC,"
\"\"
"$ +$TX,"SimStructure",HTML="http://www.templeos.org/files/SimStrSetUp.zip"$ +$TX,"ASU_Transcripts",HTML="http://www.templeos.org/files/ASU_Transcripts.pdf"$ $TX,"ASU Course Catalog (See page 261)",HTML="https://catalog.asu.edu/files/shared/archives/1994-1996/general/UG1994-1996.pdf/1994-1996-UG-241-267.pdf"$ +$TX,"Dr. David Pheanis",HTML="https://webapp4.asu.edu/directory/person/77201"$ $TX,"Dr. Konstantinos S. Tsakalis",HTML="http://ecee.engineering.asu.edu/directory/tenured-and-tenure-track-faculty/kostantinos-s-tsakalis"$ $TX,"Dr. Walter Higgins",HTML="https://webapp4.asu.edu/directory/directorysearch?cn=Walter+Higgins"$ +$TX,"Peter Gadwa",HTML="http://www.wired.com/magazine/2010/11/mf_ticketmaster/all/1"$ +$TX,"Tom Foley",HTML="http://web.gccaz.edu/~tfoley/perspage.html"$ +$TX,"Graphic Technologies",HTML="https://web.archive.org/web/20020811060541/http://www.graphic-technologies.com/"$ $TX,"Lexmark vs Static Control",HTML="https://en.wikipedia.org/wiki/Lexmark_International,_Inc._v._Static_Control_Components,_Inc."$ + + +3qEeEGCAsBABAqFDBeE2G33qEeEGCAsBABAqFDBeE2G33qCsBDBDq2G3s2G3F2G3FqAet2G32G3AEDAqF3qCsBDBDq2G3s2G3F2G3FqAet2G32G3AEDAqF +qFeDAsBDeDqCeF2G3sGGeF2sG3C2G3CBCeF + +$FG,5$$TX+CX,"Web Bookmarks"$$FG$ +Cop tying shoe $HC,"
\"\"
"$ +$TX,"Unikernels",HTML="https://ma.ttias.be/what-is-a-unikernel"$ +$TX,"Handford school",HTML="https:/pinterest.com/pin/255368241346360278"$ +$TX,"Look at PCI interrupt routing.",HTML="http://forum.osdev.org/viewtopic.php?f=1&t=29558"$ +$TX,"The sins of Newton",HTML="https://www.brainpickings.org/2012/01/04/isaac-newton-list-of-sins"$ +$TX,"Stalin's Tanks",HTML="https://boardgamegeek.com/boardgame/5198/stalins-tanks"$ +$TX,"Lamp shades",HTML="http://www.lampsplus.com/products/lamp-shades"$ +$TX,"The Original Jewish Temple",HTML="http://www.jewishvirtuallibrary.org/jsource/Judaism/The_Temple.html"$ +$TX,"KingJamesBible with LineNums",HTML="http://www.templeos.org/Wb/Home/Sup1/Sup1Blog/NumBible.DD"$ +$TX,"Higgs 5-Sigma Proof",HTML="http://understandinguncertainty.org/explaining-5-sigma-higgs-how-well-did-they-do"$ +$TX,"The Number Bleem",HTML="http://www.strangehorizons.com/2000/20001120/secret_number.shtml"$ +$TX,"Dwight: Nerd torture",HTML="http://www.noob.us/humor/the-office-dwight-faces-nerd-torture-of-the-highest-form"$ +$TX,"TOSZ Compression",HTML="http://www.templeos.org/Wb/Linux/TOSZ.CPP"$ +$TX,"ATA/ATAPI spec",HTML="http://www.t13.org/Documents/UploadedDocuments/docs2007/D1532v1r4b-AT_Attachment_with_Packet_Interface_-_7_Volume_1.pdf"$ +$TX,"Patton Prayer",HTML="http://www.pattonhq.com/prayer.html"$ +$TX,"Streaming Terry A. Davis",HTML="https://www.youtube.com/channel/UCdX4uJUwSFwiY3XBvu-F_-Q/live"$ + +$TX,"WWW.OSDEV.ORG",HTML="http://www.osdev.org"$ +$TX,"NIST Beacon",HTML="http://www.nist.gov/itl/csd/ct/nist_beacon.cfm"$ +$TX,"The Perfect Coin Toss",HTML="http://hackaday.com/2014/12/19/nist-randomness-beacon"$ +$TX,"BBC",HTML="http://www.knpr.org"$ +$TX,"KNPR",HTML="http://www.knpr.org"$ +$TX,"BBC_News_24",HTML="http://www.wherever.tv/tv-channels/BBC-News-24.jsf"$ +$TX,"BBC_Five_Live",HTML="http://www.bbc.co.uk/radio/player/bbc_radio_five_live"$ +$TX,"CBS News",HTML="http://www.cbsnews.com/live/?ftag= NM14632fc"$ + +$TX,"C64 Users Guide",HTML="http://www.commodore.ca/manuals/c64_users_guide/c64-users_guide.htm"$ +$TX,"Mapping the Commodore 64",HTML="http://unusedino.de/ec64/technical/project64/mapping_c64.html"$ +$TX,"C64 Programmers Reference Guide",HTML="http://www.commodore.ca/manuals/c64_programmers_reference/c64-programmers_reference.htm"$ + +$TX,"8-Bit Pixel Art",HTML="http://8bitdecals.com/8-bit-image-gallery"$ +$TX,"8-Bit Japanese Pixel Art",HTML="http://designmadeinjapan.com/magazine/illustration-icon/tumblr-gifs-of-japanese-life"$ diff --git a/Demo/AcctExample/PersonalNotes.TXT b/Demo/AcctExample/PersonalNotes.TXT deleted file mode 100644 index fa7ffc6..0000000 --- a/Demo/AcctExample/PersonalNotes.TXT +++ /dev/null @@ -1,467 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"TODO"$$FG$ -* Cursor in $LK,"::/Home/TOSToHtml.CPP"$. - -* Investigate why packet loss $LK,"Training Sleep(1)",A="FF:::/Adam/Training.CPP,Sleep(1)"$. - -* Add AVL or red/black binary tree library support. We have fixed-size stack. Auto-balancing binary tree is very needed. I've done everything myself. I don't want to ruin a perfect record. I'm in no hurry. - -* $LK,"SpriteEd",A="FI:::/Adam/Gr/SpriteEd.CPP"$ shift pts, Ctrl pt for ellipse/polygon w,h is off when rotated. - -* God said this is bad. $LK,"FL:::/Adam/DolDoc/DocFind.CPP,41"$ -* Backward is broken? - -* Cannot include ':' in $LK,"Document Links",A="FF:::/Adam/DolDoc/DocLink.CPP,AD"$ search string. -* $$DA fixed width string: or permanently shortens. - -* Editor overstrike mode at cmd line with menu macro? Probably, many other overstrike issues. - -* $LK,"DOCT_HEX_ED",A="MN:DOCT_HEX_ED"$ with odd size, ASCII cannot be edited. - -* $LK,"FL:::/Adam/Gr/SpriteEd.CPP,789"$ Resize bitmap? - -* $LK,"DOCEF_REMALLOC_DATA",A="FF:::/Adam/DolDoc/DocChar.CPP,DOCEF_REMALLOC_DATA"$ HexEdit Remalloc. - -* $LK,"DOCF_DBL_DOLLARS",A="MN:DOCF_DBL_DOLLARS"$ in $LK,"Reindention",A="MN:EdCodeTools2"$. - -* Compiler Optimization: Local array vars --> reg. Might exist. - -* Compiler Optimization: heap_glbls with added offset. Might exist. - -* AfterEgypt: $LK,"Numbers,13:33",A="BF:Numbers,13:33"$ scouts? $LK,"Numbers,21:8",A="BF:Numbers,21:8"$ snakes? - -* Bug: Find-and-replace text on $$PT$$ line before it. -* 12/25/2015 Copy-Paste index.html glitch if source window 40 columns. -* 01/06/2016 Editor filter "str" applied to output from LineRep looks broken. - -* Document, perhaps with video, $LK,"GetStr",A="MN:GetStr"$() all the way down into $LK,"PutKey",A="MN:PutKey"$() code. - -* Better dictionary. -* Good $LK,"spell checker",A="MN:ACMisspelledFind"$. -* Good Bible search. - -* Can $LK,"MEM_EXTRA_HASH2_PAGES",A="MN:MEM_EXTRA_HASH2_PAGES"$ be just one? - -* Bible ranges in $LK,"BibleVerse",A="MN:BibleVerse"$(). - -* $LK,"::/Demo/Games/FlatTops.CPP"$ is torpedo, not bombs. - -* Reset MPs with $LK,"Core0StartMP",A="MN:Core0StartMP"$() after boot. Free old task memory? - -* Use pen_width and pen_height when clipping with pen_width>1. - -* $LK,"~/Sup1/Sup1Games/Rocks.CPP"$. - -* Asm LIST NOLIST bugs. - -* Review writing to same cache-line from multicore. Do $LK,"CTask",A="MN:CTask"$->task_flags and others need to be in separate cache lines? - -* Fix $LK,"KbdLEDsSet",A="MN:KbdLEDsSet"$(). -* NumLock comes on with break key. - -* Hymns: mightest, finger - -* Get rid of JIFFY and HPET and just use tS. - -* Change %h*c so the character is not a arg? - -* $LK,"GrLineFat3",A="MN:GrLineFat3"$() needs a little work. - -* $LK,"GrFillTri0",A="MN:GrFillTri0"$() with both $LK,"GrHLine",A="MN:GrHLine"$() and $LK,"GrVLine",A="MN:GrVLine"$() don't match in $LK,"::/Demo/Games/CastleFrankenstein.CPP"$ causing wall spot pixels. - - -$FG,5$$TX+CX,"TODO? Meh"$$FG$ -* Compiler: lock{} needs warn on invalid modes or something. - -* Compiler: Warn recurse class define? - -* Asm could support R4u8 by adding 0x40 byte. - -* $LK,"Mem32DevAlloc",A="MN:Mem32DevAlloc"$() is broken. Devices should be in free spot of E820 report. - -* $LK,"SpriteEd",A="FI:::/Adam/Gr/SpriteEd.CPP"$: Strip $LK,"SPT_SHIFT",A="MN:SPT_SHIFT"$ origin cmds? - -* Clean-up ASCII #127 delete char? (No. Maybe, we want a new usage for 127 in future centuries.) - -* Compiler: Exceptions don't free $LK,"CCmpCtrl",A="MN:CCmpCtrl"$ stuff. - -* $LK,"::/Adam/DolDoc/DocHighlight.CPP"$ for code comments at top of documents. - -* Unhandled exception msgs from MP's get overwritten by WinMgr. - -* $LK,"Diff",A="MN:Diff"$("C:/Misc/Bible.TXT","D:/Misc/Bible.TXT"); Takes too long. - -* Finish Pilgrim game. - -* Compiler: PtrArith MUL SIZE -->QueIns(MUL)? -* Compiler: QueRem(IC_NOP)? - -* Fix Chess game so not isometric view. - - -$FG,5$$TX+CX,"TODO: Too Hard, or Not Worth Doing."$$FG$ -* AutoComplete/$LK,"Man",A="MN:Man"$() Jmp for user code. - -* $LK,"Bible sized nodes",A="FF:::/Adam/DolDoc/DocRecalc.CPP,->tag+i"$ - -* $LK,"FileMgr",A="MN:FileMgr"$() is bad with lots of files. - -* Would be nice to have a routine telling how much free memory, so apps can plan a big alloc. This is doable, depending on how. - -* Log-to-file is inefficient because we load and save whole file. - -* $LK,"ICMov",A="MN:ICMov"$() $LK,"PUSH_CMP",A="FF:::/Compiler/BackLib.CPP,PUSH_CMP"$ and $LK,"MDf_STK",A="MN:MDf_STK"$? Perhaps, it's okay. - -* Short FAT32 ~ names. - -* Compiler: Inline functions? - -* Compiler: FunPtr local vars? I forgot if this was hard or not. -$ID,5$$HL,1$U0 Main() -{ - U0 (*fp_old_draw_input_ptr)(CDC *dc,I64 x,I64 y)=gr.fp_draw_input_ptr; -} -$ID,-5$$HL,0$ -* Compiler: Get rid of $LK,"0x20000",A="FF:::/Compiler/CMain.CPP,0x20000"$ limit. - -* $LK,"GrFloodFillRay",A="MN:GrFloodFillRay"$: Get rid of $LK,"0x80000",A="FF:::/Adam/Gr/GrPrimatives.CPP,0x80000"$ limit. - - -$FG,5$$TX+CX,"Bugs"$$FG$ -* 1/28/16 $LK,"::/Demo/Graphics/Pick3D.CPP"$ crashed in TestSuite. - -* 1/12/16 make RAM drive 2288 blks, $FG,2$CopyTree("C:/Home","B:/Home"); $FG$ Disk runs-out of space and hangs instead of reporting errors. - -* Bug introduced around 11/1/15. Changed $LK,"::/Kernel/Sched.CPP"$ and now $LK,"WinToTop",A="MN:WinToTop"$ is called on Adam task at start-up, sometimes. Might be user's fault because of bad keys pressed during VMware power-on init. Might be fixed by $LK,"ACf_INIT_IN_PROGRESS",A="MN:ACf_INIT_IN_PROGRESS"$. - -* 1/12/16 $LK,"ATARepEntry",A="MN:ATARepEntry"$ shows corrupted buttons. Weird. Perhaps, my imagination. - - -$FG,5$$TX+CX,"3rd Party Bugs"$$FG$ -* VMware: Stretch to full screen -* VMware: PC speaker sound distorted. -* VMware: 8/2/2015 start-up. Probably multicore. -* VMware: $LK,"CtrlAltDel",A="FF:::/Kernel/SerialDev/Keyboard.CPP,CtrlAltDel"$ on -* VMware: Size zero files don't copy out of mounted disk? (Might be fixed.) - - -$FG,5$$TX+CX,"Bugs? Not really sure."$$FG$ -* $LK,"Mount",A="MN:Mount"$() crashes on bad drive. - -* Graphics clipping: screen y+top<0 for top<0? - -* 1/1/2015 Bug messing-up keyboard, like no CTRL key. Was working on Sprites. - -* 4/13/14 Strut or RawHide crashed when $LK,"sys_var_init_flag",A="MN:sys_var_init_flag"$ was set during testsuite. Perhaps, floodfill? - -* $LK,"ChkDsk",A="MN:ChkDsk"$ alloc unalloced. I don't know if I fixed this. - -* 1/?/2015,8/10/2015 Macro sel in Menu did not go to shell? No, I think just twice. Not a bug. - -* 5/7/14:Something like $LK,"AFSetIP",A="MN:AFSetIP"$ caused hang, then reboot in TestSuite. -* 5/7/14:#63 Maybe, $LK,"::/Demo/Graphics/Pick3D.CPP"$ crashed in TestSuite. -* 6/8/14:After or in $LK,"PageTableEntries",A="FF:::/Misc/OSTestSuite.CPP,PageTableEntries"$ in TestSuite crash. - -* $LK,"StrPrintJoin",A="MN:StrPrintJoin"$(,st); With st="\n\\"; (Forgot what this is talking about.) - -* $LK,"BMPRLE4To",A="MN:BMPRLE4To"$() has files_size too big by 108. Fixed? - - -$FG,5$$TX+CX,"TODO? Not really, just angst."$$FG$ -* Nontimer $LK,"Rand",A="MN:Rand"$() is really bad! - -* Should these be moved into $LK,"CHashClass",A="MN:CHashClass"$ from $LK,"CMemberLst",A="MN:CMemberLst"$ and $LK,"CHashGlblVar",A="MN:CHashGlblVar"$? -$ID,5$CArrayDim dim; -CHashFun *fun_ptr; -$ID,-5$ -* extern of fun with dft arg of str? - -* Might want to warn switch[] dup case numbers. - -* Make $LK,"Clamp",A="MN:Clamp"$(), $LK,"Min",A="MN:Min"$(), $LK,"Max",A="MN:Max"$() into asm routines? - -* Add local vars to sym table in $LK,"Dbg",A="MN:Dbg"$()? - -* Compiler: Prints two error messages for expressions in stmts. - -* $LK,"U",A="MN:U"$() negative byte displacement, neg 32-bit disp. - -* Race condition in $LK,"::/Demo/Games/FlatTops.CPP"$ torpedo. - -* Links to self document if empty file name? $LK,"Document Links",A="FF:::/Adam/DolDoc/DocLink.CPP,AD"$ - -* $LK,"FUF_RECURSE",A="MN:FUF_RECURSE"$ would be nice if capital "+R". - -* Sprites in cmd line code. - -* 16-Bit Assembly and Unassembly and is bad. - -* Compiler: Cmd to enable/disable warnings. - -* Compiler: Type for either F64 or I64, like Print -- no conversion. -* Compiler: Arg type ... that did do conversion, if we have one that doesn't. - -* $LK,"R",A="MN:R"$("chars_bmp_","set_"); - -* Clean-up code $LK,"FileNameAbs",A="MN:FileNameAbs"$(), does it need so many local var names? I guess no choice. - - -$FG,5$$TX+CX,"Committee Needed"$$FG$ -* Make binary tree look-up using FUN_SEG symbol addresses, so we can eliminate fun_seg cache and wall-paper kludge? All HolyC functions and glbl vars would have left-right for address search. - -* $LK,"MP DepthBuf",A="FF:::/Adam/Gr/SpriteMesh.CPP,dc->depth_buf=e->"$ is a kludge because of dc->depth_buf=NULL in various graphics routines. - -* Improve editor undo, add redo. - -* Compiler: F32? - -* International Date output: $LK,"MPrintDate",A="MN:MPrintDate"$(). Every country make own version? -* International Date input: $LK,"Str2Date",A="MN:Str2Date"$(). - -* $LK,"DCF_SYMMETRY",A="MN:DCF_SYMMETRY"$ before transformation? (Currently, it's after.) - -* $LK,"TRANSPARENT",A="MN:TRANSPARENT"$ does not work with $LK,"ROPF_DITHER",A="MN:ROPF_DITHER"$. - -* $LK,"ROP_XOR",A="MN:ROP_XOR"$ with pen_width>1 is broken. - -* $LK,"GrPutChar3",A="MN:GrPutChar3"$() with depth buf? - -* Eliminate? $LK,"::/Adam/Ctrls/CtrlsA.CPP"$? -* Eliminate? $LK,"::/Adam/AMathODE.CPP"$? -* Eliminate? $LK,"Complex",A="MN:Complex"$? -* Eliminate? $LK,"CDC",A="MN:CDC"$.brush? -* Eliminate? $LK,"Mat4x4MulXYZ",A="MN:Mat4x4MulXYZ"$() change to 3x3? -* Eliminate? $LK,"ROP_XOR",A="MN:ROP_XOR"$? - -* $LK,"WinMgrTask",A="MN:WinMgrTask"$ needs to do doc operations on $LK,"PostMsg",A="MN:PostMsg"$() msgs for mouse. Already works for $LK,"IPSet",A="MN:IPSet"$()? - -* Should Msgs in PopUp queue get fwded to parent when task dies? - -* Import Intel datasheets so we can use links in $LK,"Code",A="FI:::/Kernel/Mem/PageTables.CPP"$ for documentation. I tried a PDF-to-text convertor and it wasn't acceptible. - -* Why are BMP file $LK,"CBGR24",A="MN:CBGR24"$'s wrong? $LK,"::/Adam/Opt/Utils/FileBMP.CPP"$. - -* Switch stmt with sparse cases? Maybe, ban sparse switch stmts. - -* Compiler Optimization: Postpone LocalVar init until last possible moment in case of return. - -* Compiler: Local var array/struct initialization. - -* Compiler Optimization: Bools use r,rm in $LK,"ICCmp",A="MN:ICCmp"$() like in $LK,"ICCmpAndBranch",A="MN:ICCmpAndBranch"$()? - -* Compiler: !F64 ~F64 - -* Compiler: &=, |= can overflow with Bts Btr on small data types? - -* Since no true preprocessor, $LK,"R",A="MN:R"$("#define","StrMap"); $LK,"R",A="MN:R"$("#include",...); also? - -* Compiler: $LK,"sys_var_init_flag",A="MN:sys_var_init_flag"$ for local vars? - -* Implement $LK,"RS_ATTR_FIXED",A="MN:RS_ATTR_FIXED"$ fixed pos files? - -* Editor page formatting is FUBAR. - -* SIMD in $LK,"Mat4x4MulXYZ",A="MN:Mat4x4MulXYZ"$? - -* I use fixed-point in $LK,"Circle",A="MN:Circle"$(), $LK,"Ellipse",A="MN:Ellipse"$(), $LK,"Mat4x4MulXYZ",A="MN:Mat4x4MulXYZ"$(), $LK,"Mat4x4MulMat4x4New",A="MN:Mat4x4MulMat4x4New"$() and others. God says I might want to change to float. $LK,"::/Demo/Lectures/FixedPoint.CPP"$ $LK,"::/Demo/Lectures/FixedPointAdvanced.CPP"$. - -* Note: We will never put multiple $LK,"Keyboard Tables",A="FI:::/Kernel/SerialDev/Keyboard.CPP"$. Each country must make their own version of TempleOS. The $LK,"Intel Factory ROM",A="FF:::/Doc/Demands.TXT,English"$ will have just English. Our $LK,"Charter",A="FI:::/Doc/Charter.TXT"$ bans multiple country or architectures in the same version. - -* 12 border chars in screen font codes 0x02-0x0D. $LK,"TextBorder",A="MN:TextBorder"$() $LK,"RawDr",A="MN:RawDr"$() $LK,"::/Demo/Games/CharDemo.CPP"$. LineFeed shows-up in $FG,2$$FG$ PersonalMenu. - -* Super-simple high speed serial needs flow control. $FG,2$$FG$ and $FG,2$$FG$? - - -$FG,5$$TX+CX,"Inspirational Ideas"$$FG$ -* Redo videos, make more professional. - -* Use standard terminology from "the literature". - -* Striped and other dither patterns. Brushes? - -* Get rid of BYTE, WORD, DWORD in opcode and replace with U8, U16, U32. - -* Get rid of "Char". - -* Get rid of having two terms and pick one, "Disk" and "BlkDev"? (Probably, not that one.) - -* Could switch to having just C and D drives and RAMDrive and CD/DVD? - -* New editor widgets. - -* Make use of flag potential in $LK,"FilesFind",A="MN:FilesFind"$() and possibly $LK,"DirContextNew",A="MN:DirContextNew"$(). -* Sort options for $LK,"FilesFind",A="MN:FilesFind"$()? - -* New $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ language features? - -* Better $LK,"Debugging",A="HI:Debugging"$? - -* Look for mem leaks? - -* Std local var names. - -* Ticketmaster format stmts? Overflow "t='*'" and padding character? - -* Move stuff out of $LK,"Kernel",A="FI:::/Kernel/Kernel.PRJ"$ module. - -* $$LK,L="FL:D:/Kernel/File.CPP"$$ instead of A= -* $$SP,B=1$$ instead of $$SP,BI=1$$ -* $$CM+LE+RE is nasty - -* DCF_TRANSFORMATION|DCF_SYMMETRY|DCF_JUST_MIRROR -- maybe not both needed at once. - -* More $LK,"Controls",A="MN:CCtrl"$? - -* Compiler: More use of more floating-point stk? - -* Compiler: More aggressive in $LK,"CmpF2PushPop",A="MN:CmpF2PushPop"$() with types besides MOV and F64. - -* Playing with $LK,"::/Demo/Lectures/NegDisp.CPP"$ on $LK,"CTask",A="MN:CTask"$? -$ID,5$$$=-CTASK_NEG_OFFSET -offset(CTask.addr)==0 -Spawn(): CAlloc() -TaskDel(): Free() -CSysFixedArea.adam -Looks like task_flags,locked_flags cause problems with neg offset. -$ID,-5$ -* Make a game, S.E.T.I., with radio telescope array. Put God on air. - - -$FG,5$$TX+CX,"Test"$$FG$ -* $LK,"SpriteBitMap",A="FI:::/Adam/Gr/SpriteBitMap.CPP"$: Grabscroll? - -* $LK,"DrvMap",A="MN:DrvMap"$() in $LK,"MountFile",A="MN:MountFile"$(). - -* Return ress for $LK,"GrBlot",A="MN:GrBlot"$, $LK,"GrRect",A="MN:GrRect"$, $LK,"GrPutChar",A="MN:GrPutChar"$? -* Collision cnts for $LK,"GrBlot",A="MN:GrBlot"$, $LK,"GrRect",A="MN:GrRect"$, $LK,"GrPutChar",A="MN:GrPutChar"$? - -* $LK,"GetStr",A="MN:GetStr"$() or $LK,"GetChar",A="MN:GetChar"$() in $LK,"OSInstall",A="FI:::/Misc/OSInstall.CPP"$ didn't like focus change. - -* Test on Dad's computer or other people's? - -* $LK,"ICDivEqu",A="MN:ICDivEqu"$() assumes RBX. Is it okay? - -* Autofile PopUp of PopUp? - -* $LK,"FileMgr",A="MN:FileMgr"$() help link scrolls out of window. - -* $LK,"MouseDriverInstall",A="MN:MouseDriverInstall"$() throws exceptions? Doesn't work? Why mouse $LK,"0x9FC30",A="FF:::/Kernel/SerialDev/Mouse.CPP,9FC"$? - -* VirtualBox MP reboot? - -* Compiler: Err/Warn line nums? -* Asm branch-out-of-range warn by one line? - -* Make sure queue links safe in one direction. Task $LK,"QueIns",A="MN:QueIns"$ and $LK,"QueRem",A="MN:QueRem"$ for multicore cycling fwd through tasks. - -* Test removable media id and $LK,"RS_ATTR_RESIDENT",A="MN:RS_ATTR_RESIDENT"$. $LK,"Touch",A="MN:Touch"$("","+T"); - - -$FG,5$$TX+CX,"Uncategorized"$$FG$ -* DiskCache during FileRead. , $LK,"Kill",A="MN:Kill"$(). - -* MOV U8 [RSP+RCX],DL - -* $LK,"gr.screen_image",A="MN:CGrGlbls"$ - >Might want to do ZOOM in U8 graphics and convert screen capture to U8 - >Might want to rev bit order - -* This $LK,"Fs->catch_except=TRUE",A="FF:::/Kernel/SrvCmd.CPP,Fs->catch_except=TRUE"$ causes problems because it -catches divide and out-of-mem. Not sure what to do, yet. - -* Release semaphores or break lock sema,usb_td - -* Might make CSprite flood fill operate on a separate bitmap -and blotted at the end. -* delete subsprite in menu near others -* make better heapwalk, do something with $LK,"_CFG_HEAP_DBG",A="FF:::/Kernel/KernelA.HPP,_CFG_HEAP_DBG"$. - -* static var off of data heap. -* could add "const" to not set CCF_NOT_CONST flag for trig, etc. -* could make glblvar imports use MDF_RIP_DISP32. -* PUSH_CMP allocs reg R9 or whatever -* Might be problem with NOP in OPT pass1 for NO_PUSH in expressions besides -assignments. Is ShiftNoPush fully implemented? - - -$FG,5$$TX+CX,"Bible Passages"$$FG$ -It is love I desire $TX,"Hosea 6:6",HTML="http://www.biblegateway.com/verse/en/Hosea%206:6"$ -Males appear three times, not empty $TX,"Deuteronomy 16:16",HTML="http://www.biblegateway.com/verse/en/Deuteronomy%2016:16"$ -Offer a sacrifice of praise $TX,"Hebrews 13:15",HTML="http://www.biblegateway.com/verse/en/Hebrews%2013:15"$ -Do I drink blood of goats? Offer praise $TX,"Psalms 50:14",HTML="http://www.biblegateway.com/verse/en/Psalms%2050:14"$ -When a servant becomes king... $TX,"Proverb 30:22",HTML="http://www.biblegateway.com/verse/en/Proverb%2030:22"$ -Runner's stride $TX,"Psalms 147:10",HTML="http://www.biblegateway.com/verse/en/Psalms%20147:10"$ -Buckling armor $TX,"1 Kings 20:11",HTML="http://www.biblegateway.com/verse/en/1%20Kings%2020:11"$ -Lot cast in the lap $TX,"Proverbs 16:33",HTML="http://www.biblegateway.com/verse/en/Proverbs%2016:33"$ -Lord does not repeat $TX,"Job 33:14",HTML="http://www.biblegateway.com/verse/en/Job%2033:14"$ -Offer only in approved place $TX,"Deuteronomy 12:13-18",HTML="http://www.biblegateway.com/passage/?search=Deuteronomy%2012:13-18&version=NIV"$ -Jesus' zeal for the Temple $TX,"John 2:14-19",HTML="http://www.biblegateway.com/passage/?search=John%202:14-19&version=NIV"$ -Famine not for bread $TX,"Amos 8:11-12",HTML="http://www.biblegateway.com/passage/?search=Amos%208:11-12&version=NIV"$ -To the honest, you are honest $TX,"Psalm 18:26",HTML="http://www.biblegateway.com/verse/en/Psalm%2018:26"$ -Meek and humble of heart $TX,"Matthew 11:29",HTML="http://www.biblegateway.com/verse/en/Matthew%2011:29"$ -Moses gets Aaron $TX,"Exodus 4:10-16",HTML="http://www.biblegateway.com/passage/?search=Exodus%204:10-16&version=NIV"$ -There is no council against the Lord $TX,"Proverbs 21:30",HTML="http://www.biblegateway.com/verse/en/Proverbs%2021:30"$ -Human help is worthless $TX,"Psalm 108:12",HTML="http://www.biblegateway.com/verse/en/Psalm%20108:12"$ -Do not seek your own wealth $TX,"1 Corinthians 10:24",HTML="http://www.biblegateway.com/verse/en/1%20Corinthians%2010:24"$ -The stone rejected is cornerstone $TX,"Matthew 21:42",HTML="http://www.biblegateway.com/verse/en/Matthew%2021:42"$ -New wineskins $TX,"Mark 2:22",HTML="http://www.biblegateway.com/verse/en/Mark%202:22"$ - -$FG,5$$TX+CX,"Misc Notes"$$FG$ -Intel CEO's name: Brian Krzanich ->$FG,2$lspci -v$FG$ -Size:$TX,"17422 KB",D="DD_TEMPLEOSCD_K_SIZE"$ - -$FG,5$$TX+CX,"My Web Bookmarks"$$FG$$WW,0$ -$TX,"My FireFox Bookmarks",HTML="http://www.templeos.org/Wb/Home/Sup1/Sup1Blog/Bookmarks"$ -Machine $HC,"
\"\"
"$ -Frosting $HC,"
\"\"
"$ -Soap Carvings $HC,"
\"\"
"$ -CottonTail $HC,"
\"\"
"$ -TempleOS Logo $HC,"
\"\"
"$ -Pew Pew Pew $HC,"
\"\"
"$ -Iceberg $HC,"
\"\"
"$ -I made dis $HC,"
\"\"
"$ -NIST Beacon $HC,"
\"\"
"$ -Purple Frog $HC,"
\"\"
"$ -$TX,"SimStructure",HTML="http://www.templeos.org/files/SimStrSetUp.zip"$ -$TX,"ASU_Transcripts",HTML="http://www.templeos.org/files/ASU_Transcripts.pdf"$ $TX,"ASU Course Catalog (See page 261)",HTML="https://catalog.asu.edu/files/shared/archives/1994-1996/general/UG1994-1996.pdf/1994-1996-UG-241-267.pdf"$ -$TX,"Dr. David Pheanis",HTML="https://webapp4.asu.edu/directory/person/77201"$ $TX,"Dr. Konstantinos S. Tsakalis",HTML="http://ecee.engineering.asu.edu/directory/tenured-and-tenure-track-faculty/kostantinos-s-tsakalis"$ $TX,"Dr. Walter Higgins",HTML="https://webapp4.asu.edu/directory/directorysearch?cn=Walter+Higgins"$ -$TX,"Peter Gadwa",HTML="http://www.wired.com/magazine/2010/11/mf_ticketmaster/all/1"$ -$TX,"Tom Foley",HTML="http://web.gccaz.edu/~tfoley/perspage.html"$ -$TX,"Graphic Technologies",HTML="https://web.archive.org/web/20020811060541/http://www.graphic-technologies.com/"$ $TX,"Lexmark vs Static Control",HTML="https://en.wikipedia.org/wiki/Lexmark_International,_Inc._v._Static_Control_Components,_Inc."$ - - -3qEeEGCAsBABAqFDBeE2G33qEeEGCAsBABAqFDBeE2G33qCsBDBDq2G3s2G3F2G3FqAet2G32G3AEDAqF3qCsBDBDq2G3s2G3F2G3FqAet2G32G3AEDAqF -qFeDAsBDeDqCeF2G3sGGeF2sG3C2G3CBCeF - -$FG,5$$TX+CX,"Web Bookmarks"$$FG$ -Cop tying shoe $HC,"
\"\"
"$ -$TX,"Unikernels",HTML="https://ma.ttias.be/what-is-a-unikernel"$ -$TX,"Handford school",HTML="https:/pinterest.com/pin/255368241346360278"$ -$TX,"Look at PCI interrupt routing.",HTML="http://forum.osdev.org/viewtopic.php?f=1&t=29558"$ -$TX,"The sins of Newton",HTML="https://www.brainpickings.org/2012/01/04/isaac-newton-list-of-sins"$ -$TX,"Stalin's Tanks",HTML="https://boardgamegeek.com/boardgame/5198/stalins-tanks"$ -$TX,"Lamp shades",HTML="http://www.lampsplus.com/products/lamp-shades"$ -$TX,"The Original Jewish Temple",HTML="http://www.jewishvirtuallibrary.org/jsource/Judaism/The_Temple.html"$ -$TX,"KingJamesBible with LineNums",HTML="http://www.templeos.org/Wb/Home/Sup1/Sup1Blog/NumBible.TXT"$ -$TX,"Higgs 5-Sigma Proof",HTML="http://understandinguncertainty.org/explaining-5-sigma-higgs-how-well-did-they-do"$ -$TX,"The Number Bleem",HTML="http://www.strangehorizons.com/2000/20001120/secret_number.shtml"$ -$TX,"Dwight: Nerd torture",HTML="http://www.noob.us/humor/the-office-dwight-faces-nerd-torture-of-the-highest-form"$ -$TX,"TOSZ Compression",HTML="http://www.templeos.org/Wb/Linux/TOSZ.CPP"$ -$TX,"ATA/ATAPI spec",HTML="http://www.t13.org/Documents/UploadedDocuments/docs2007/D1532v1r4b-AT_Attachment_with_Packet_Interface_-_7_Volume_1.pdf"$ -$TX,"Streaming Terry A. Davis",HTML="https://www.youtube.com/channel/UCdX4uJUwSFwiY3XBvu-F_-Q/live"$ - -$TX,"WWW.OSDEV.ORG",HTML="http://www.osdev.org"$ -$TX,"NIST Beacon",HTML="http://www.nist.gov/itl/csd/ct/nist_beacon.cfm"$ -$TX,"The Perfect Coin Toss",HTML="http://hackaday.com/2014/12/19/nist-randomness-beacon"$ -$TX,"BBC",HTML="http://www.knpr.org"$ -$TX,"KNPR",HTML="http://www.knpr.org"$ -$TX,"BBC_News_24",HTML="http://www.wherever.tv/tv-channels/BBC-News-24.jsf"$ -$TX,"BBC_Five_Live",HTML="http://www.bbc.co.uk/radio/player/bbc_radio_five_live"$ -$TX,"CBS News",HTML="http://www.cbsnews.com/live/?ftag= NM14632fc"$ - -$TX,"C64 Users Guide",HTML="http://www.commodore.ca/manuals/c64_users_guide/c64-users_guide.htm"$ -$TX,"Mapping the Commodore 64",HTML="http://unusedino.de/ec64/technical/project64/mapping_c64.html"$ -$TX,"C64 Programmers Reference Guide",HTML="http://www.commodore.ca/manuals/c64_programmers_reference/c64-programmers_reference.htm"$ - -$TX,"8-Bit Pixel Art",HTML="http://8bitdecals.com/8-bit-image-gallery"$ -$TX,"8-Bit Japanese Pixel Art",HTML="http://designmadeinjapan.com/magazine/illustration-icon/tumblr-gifs-of-japanese-life"$ diff --git a/Demo/AcctExample/Registry.CPP b/Demo/AcctExample/Registry.CPP deleted file mode 100644 index cb69527..0000000 --- a/Demo/AcctExample/Registry.CPP +++ /dev/null @@ -1,49 +0,0 @@ -$TR-UL,"Adam"$ -$ID,2$$TR,"SysMsgFlags"$ -$ID,2$sys_msg_flags[0]=0xFF; -$ID,-2$$TR,"SysRegVer"$ -$ID,2$registry_version=4.100; -$ID,-2$$ID,-2$$TR-UL,"TempleOS"$ -$ID,2$$TR,"TOS"$ -$ID,2$I64 tos_code_walk_thru=105,tos_after_egypt_in_action=46; -$ID,-2$$TR,"CircleTrace"$ -$ID,2$F64 best_score=4.9425; -$ID,-2$$TR,"DiningStars"$ -$ID,2$F64 best_score=9999.0000; -$ID,-2$$TR,"Staff"$ -$ID,2$#define PERSONAL_INITIALS "TAD" -#define MACHINE_CFG 0 -$ID,-2$$TR,"KeepAway"$ -$ID,2$I64 best_score0=68,best_score1=30; -$ID,-2$$TR,"CastleFrankenstein"$ -$ID,2$F64 best_score=33.8405; -$ID,-2$$TR,"ZoneOut"$ -$ID,2$F64 best_score=8.1373; -$ID,-2$$TR,"DunGen"$ -$ID,2$F64 best_score=20.5295; -$ID,-2$$TR,"Wenceslas"$ -$ID,2$F64 best_score=43.9944; -$ID,-2$$TR,"FlapBat"$ -$ID,2$F64 best_score=16.3077; -$ID,-2$$TR,"RawHide"$ -$ID,2$F64 best_score=96.1279; -$ID,-2$$TR,"Varoom"$ -$ID,2$F64 best_score=46.2643; -$ID,-2$$TR,"TimeOut"$ -$ID,2$I64 best_score=22202; -$ID,-2$$TR,"BlackDiamond"$ -$ID,2$I64 best_score=9; -$ID,-2$$TR,"BomberGolf"$ -$ID,2$I64 best_score=175; -$ID,-2$$TR,"XCaliber"$ -$ID,2$I64 best_score=248; -I64 msg_flags=1; -$ID,-2$$TR,"EagleDive"$ -$ID,2$F64 best_score=147.6932; -$ID,-2$$ID,-2$$TR,"DemoCompany"$ -$ID,2$ -$TR,"Game1"$ -$ID,2$F64 best_score=388.68032; -$TR,"SimpleVal"$ -$ID,2$1332; -$ID,-2$$ID,-2$ \ No newline at end of file diff --git a/Demo/AcctExample/Registry.HC b/Demo/AcctExample/Registry.HC new file mode 100644 index 0000000..b845a00 --- /dev/null +++ b/Demo/AcctExample/Registry.HC @@ -0,0 +1,49 @@ +$TR-UL,"Adam"$ +$ID,2$$TR,"SysMsgFlags"$ +$ID,2$sys_msg_flags[0]=0xFF; +$ID,-2$$TR,"SysRegVer"$ +$ID,2$registry_version=4.110; +$ID,-2$$ID,-2$$TR-UL,"TempleOS"$ +$ID,2$$TR,"TOS"$ +$ID,2$I64 tos_code_walk_thru=105,tos_after_egypt_in_action=46; +$ID,-2$$TR,"CircleTrace"$ +$ID,2$F64 best_score=4.9425; +$ID,-2$$TR,"DiningStars"$ +$ID,2$F64 best_score=9999.0000; +$ID,-2$$TR,"BlackDiamond"$ +$ID,2$I64 best_score=1; +$ID,-2$$TR,"EagleDive"$ +$ID,2$F64 best_score=147.6932; +$ID,-2$$TR,"DunGen"$ +$ID,2$F64 best_score=20.5295; +$ID,-2$$TR,"CastleFrankenstein"$ +$ID,2$F64 best_score=33.8405; +$ID,-2$$TR,"ZoneOut"$ +$ID,2$F64 best_score=8.1373; +$ID,-2$$TR,"Varoom"$ +$ID,2$F64 best_score=46.2643; +$ID,-2$$TR,"FlapBat"$ +$ID,2$F64 best_score=16.3077; +$ID,-2$$TR,"TimeOut"$ +$ID,2$I64 best_score=22202; +$ID,-2$$TR,"RawHide"$ +$ID,2$F64 best_score=96.1279; +$ID,-2$$TR,"KeepAway"$ +$ID,2$I64 best_score0=68,best_score1=30; +$ID,-2$$TR,"XCaliber"$ +$ID,2$I64 best_score=248; +I64 msg_flags=1; +$ID,-2$$TR,"Wenceslas"$ +$ID,2$F64 best_score=43.9944; +$ID,-2$$TR,"BomberGolf"$ +$ID,2$I64 best_score=175; +$ID,-2$$TR,"Staff"$ +$ID,2$#define PERSONAL_INITIALS "TAD" +#define MACHINE_CFG 0 +$ID,-2$$ID,-2$$TR,"DemoCompany"$ +$ID,2$ +$TR,"Game1"$ +$ID,2$F64 best_score=197.62089; +$TR,"SimpleVal"$ +$ID,2$1344; +$ID,-2$$ID,-2$ \ No newline at end of file diff --git a/Demo/AcctExample/TOSBlog.CPP b/Demo/AcctExample/TOSBlog.CPP deleted file mode 100644 index 6cd0e6b..0000000 --- a/Demo/AcctExample/TOSBlog.CPP +++ /dev/null @@ -1,118 +0,0 @@ -U8 *BlogLocalDir(CDate cdt=0) -{ - static U8 dir[STR_LEN]; - CDateStruct ds; - if (!cdt) cdt=Now+local_time_offset; - Date2Struct(&ds,cdt); - StrPrint(dir,BLOG_LOCAL_BASE "/%d%Z", - ds.year,ds.mon-1,"ST_MONTHS"); - if (!FileFind(dir,,FUF_JUST_DIRS)) - MkDir(dir); - return dir; -} - -U8 *BlogLocalFile(CDate cdt=0) -{ - static U8 file[STR_LEN]; - CDateStruct ds; - if (!cdt) cdt=Now+local_time_offset; - Date2Struct(&ds,cdt); - StrPrint(file,"%s/" PERSONAL_INITIALS "%02d%02d%02d.TXT.Z", - BlogLocalDir(cdt),ds.year%100,ds.mon,ds.day_of_mon); - return file; -} - -U8 *BlogWebDir(CDate cdt=0) -{ - static U8 dir[STR_LEN]; - CDateStruct ds; - if (!cdt) cdt=Now+local_time_offset; - Date2Struct(&ds,cdt); - StrPrint(dir,BLOG_WEB_BASE "/%d%Z", - ds.year,ds.mon-1,"ST_MONTHS"); - return dir; -} - -U8 *BlogWebFile(CDate cdt=0) -{ - static U8 file[STR_LEN]; - CDateStruct ds; - if (!cdt) cdt=Now+local_time_offset; - Date2Struct(&ds,cdt); - StrPrint(file,"%s/" PERSONAL_INITIALS "%02d%02d%02d.TXT.Z", - BlogWebDir(cdt),ds.year%100,ds.mon,ds.day_of_mon); - return file; -} - -public U8 *FileNameNumNext(U8 *files_find_mask,U8 *fmt) -{ - CDirEntry *tempde=FilesFind(files_find_mask); - U8 *res=MStrPrint(fmt,FileCnt(tempde)); - DirTreeDel(tempde); - return res; -} - -U0 BlogDCImgWrite(CDC *dc,CDate cdt=0) -{ - U8 file_mask[STR_LEN],file_name[STR_LEN],*st1,*st2; - if (!cdt) cdt=Now+local_time_offset; - StrPrint(file_mask,"%s/Img*",BlogLocalDir(cdt)); - StrPrint(file_name,"%s/Img%%03d.BMP",BlogLocalDir(cdt)); - st1=FileNameNumNext(file_mask,file_name); - st2=MStrPrint("http://www.templeos.org/Wb%s",st1+2); - BMPWrite(st1,dc); - Free(st1); - "$$HC,\"\\\"\\\"\"$$\n",st2,dc->width,dc->height; - Free(st2); -} - -U0 BlogScreenShot() -{ - Bool old_cursor=DocCursor; - CDC *dc1,*dc2; - U8 *old_fp_draw_input_ptr=gr.fp_draw_input_ptr; - gr.fp_draw_input_ptr=NULL; - WinMgrSync(2); - dc1=DCScreenCapture; - dc2=DCExt(dc1,0,FONT_HEIGHT,GR_WIDTH-1,GR_HEIGHT-1); - BlogDCImgWrite(dc2); - gr.fp_draw_input_ptr=old_fp_draw_input_ptr; - DCDel(dc1); - DCDel(dc2); - DocCursor(old_cursor); -} - -public U0 MakeWebSitePartial() -{ - MkDir("D:/Wb"); - MkDir("D:/Wb/Home"); - MkDir("D:/Wb/Home/Web"); - MkDir("D:/Wb/Home/Web/TAD"); - MkDir("D:/Wb/Home/Web/TAD/BlogDir"); - - FreshenWebDir("/Home/Web"); - FreshenWebDir("/Home/Web/" PERSONAL_INITIALS); - FreshenWebDir(BlogLocalDir+2); - Drv('C'); -} - -public U0 Blog() -{ - if (!FileFind(BlogLocalFile,,FUF_JUST_FILES)) - Copy("~/Web/" PERSONAL_INITIALS "/DailyBlogHeader.TXT.Z", - BlogLocalFile); - AutoComplete; - WinBorder; - WinMax; - Msg(MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN|SCF_CTRL); - Msg(MSG_KEY_DOWN_UP,0,SC_F6|SCF_ALT); - Msg(MSG_KEY_DOWN_UP,'\n',0); - if (Ed(BlogLocalFile,EDF_WAS_WRITE)) { - DocOpt(BlogLocalFile,"-r"); - Copy(BlogLocalFile,"::" DAILY_BASE ".TXT.Z"); - Copy(BlogLocalFile,"D:" DAILY_BASE ".TXT.Z"); - Copy(BlogLocalFile,"D:/Wb" DAILY_BASE ".TXT.Z"); - TOSWebFile("D:/Wb" DAILY_BASE ".TXT.Z"); - } -} diff --git a/Demo/AcctExample/TOSBlog.HC b/Demo/AcctExample/TOSBlog.HC new file mode 100644 index 0000000..79bdc63 --- /dev/null +++ b/Demo/AcctExample/TOSBlog.HC @@ -0,0 +1,118 @@ +U8 *BlogLocalDir(CDate cdt=0) +{ + static U8 dir[STR_LEN]; + CDateStruct ds; + if (!cdt) cdt=Now+local_time_offset; + Date2Struct(&ds,cdt); + StrPrint(dir,BLOG_LOCAL_BASE "/%d%Z", + ds.year,ds.mon-1,"ST_MONTHS"); + if (!FileFind(dir,,FUF_JUST_DIRS)) + MkDir(dir); + return dir; +} + +U8 *BlogLocalFile(CDate cdt=0) +{ + static U8 file[STR_LEN]; + CDateStruct ds; + if (!cdt) cdt=Now+local_time_offset; + Date2Struct(&ds,cdt); + StrPrint(file,"%s/" PERSONAL_INITIALS "%02d%02d%02d.DD.Z", + BlogLocalDir(cdt),ds.year%100,ds.mon,ds.day_of_mon); + return file; +} + +U8 *BlogWebDir(CDate cdt=0) +{ + static U8 dir[STR_LEN]; + CDateStruct ds; + if (!cdt) cdt=Now+local_time_offset; + Date2Struct(&ds,cdt); + StrPrint(dir,BLOG_WEB_BASE "/%d%Z", + ds.year,ds.mon-1,"ST_MONTHS"); + return dir; +} + +U8 *BlogWebFile(CDate cdt=0) +{ + static U8 file[STR_LEN]; + CDateStruct ds; + if (!cdt) cdt=Now+local_time_offset; + Date2Struct(&ds,cdt); + StrPrint(file,"%s/" PERSONAL_INITIALS "%02d%02d%02d.DD.Z", + BlogWebDir(cdt),ds.year%100,ds.mon,ds.day_of_mon); + return file; +} + +public U8 *FileNameNumNext(U8 *files_find_mask,U8 *fmt) +{ + CDirEntry *tempde=FilesFind(files_find_mask); + U8 *res=MStrPrint(fmt,FileCnt(tempde)); + DirTreeDel(tempde); + return res; +} + +U0 BlogDCImgWrite(CDC *dc,CDate cdt=0) +{ + U8 file_mask[STR_LEN],file_name[STR_LEN],*st1,*st2; + if (!cdt) cdt=Now+local_time_offset; + StrPrint(file_mask,"%s/Img*",BlogLocalDir(cdt)); + StrPrint(file_name,"%s/Img%%03d.BMP",BlogLocalDir(cdt)); + st1=FileNameNumNext(file_mask,file_name); + st2=MStrPrint("http://www.templeos.org/Wb%s",st1+2); + BMPWrite(st1,dc); + Free(st1); + "$$HC,\"\\\"\\\"\"$$\n",st2,dc->width,dc->height; + Free(st2); +} + +U0 BlogScreenShot() +{ + Bool old_cursor=DocCursor; + CDC *dc1,*dc2; + U8 *old_fp_draw_input_ptr=gr.fp_draw_input_ptr; + gr.fp_draw_input_ptr=NULL; + WinMgrSync(2); + dc1=DCScreenCapture; + dc2=DCExt(dc1,0,FONT_HEIGHT,GR_WIDTH-1,GR_HEIGHT-1); + BlogDCImgWrite(dc2); + gr.fp_draw_input_ptr=old_fp_draw_input_ptr; + DCDel(dc1); + DCDel(dc2); + DocCursor(old_cursor); +} + +public U0 MakeWebSitePartial() +{ + MkDir("D:/Wb"); + MkDir("D:/Wb/Home"); + MkDir("D:/Wb/Home/Web"); + MkDir("D:/Wb/Home/Web/TAD"); + MkDir("D:/Wb/Home/Web/TAD/BlogDir"); + + FreshenWebDir("/Home/Web"); + FreshenWebDir("/Home/Web/" PERSONAL_INITIALS); + FreshenWebDir(BlogLocalDir+2); + Drv('C'); +} + +public U0 Blog() +{ + if (!FileFind(BlogLocalFile,,FUF_JUST_FILES)) + Copy("~/Web/" PERSONAL_INITIALS "/DailyBlogHeader.DD.Z", + BlogLocalFile); + AutoComplete; + WinBorder; + WinMax; + Msg(MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN|SCF_CTRL); + Msg(MSG_KEY_DOWN_UP,0,SC_F6|SCF_ALT); + Msg(MSG_KEY_DOWN_UP,'\n',0); + if (Ed(BlogLocalFile,EDF_WAS_WRITE)) { + DocOpt(BlogLocalFile,"-r"); + Copy(BlogLocalFile,"::" DAILY_BASE ".DD.Z"); + Copy(BlogLocalFile,"D:" DAILY_BASE ".DD.Z"); + Copy(BlogLocalFile,"D:/Wb" DAILY_BASE ".DD.Z"); + TOSWebFile("D:/Wb" DAILY_BASE ".DD.Z"); + } +} diff --git a/Demo/AcctExample/TOSCfg.CPP b/Demo/AcctExample/TOSCfg.HC similarity index 100% rename from Demo/AcctExample/TOSCfg.CPP rename to Demo/AcctExample/TOSCfg.HC diff --git a/Demo/AcctExample/TOSDistro.CPP b/Demo/AcctExample/TOSDistro.CPP deleted file mode 100644 index c58dbe7..0000000 --- a/Demo/AcctExample/TOSDistro.CPP +++ /dev/null @@ -1,475 +0,0 @@ -//The CFG defines are $LK,"~/TOSCfg.CPP",A="FI:::/Demo/AcctExample/TOSCfg.CPP"$. - -#help_index "TOS" - -U8 TOSGetDrv() -{ - I64 res; - "Drive (%s):",TOS_HDS; - res=ToUpper(GetChar); - '\n'; - return res; -} - -U0 TOSBootHDIns(U8 drv_let) -{ - drv_let=ToUpper(drv_let); - Auto(TOS_CFG); - BootHDIns(drv_let); - if (StrOcc(TOS_MASTER_BOOT_DRVS,drv_let)) - BootMHDIns(drv_let); -} - -U0 TOSCopyDrv(U8 src,U8 dst) -{ - U8 buf_s[STR_LEN],buf_d[STR_LEN]; - src=ToUpper(src); - dst=ToUpper(dst); - - Fmt(dst,,FALSE,FSt_FAT32); - - StrPrint(buf_s,"%c:/",src); - StrPrint(buf_d,"%c:/",dst); - CopyTree(buf_s,buf_d); - - DocClear; - Drv(dst); - TOSBootHDIns(dst); -} - -U0 TOSPromptAndCopyDrv() -{ - I64 src,dst; - "$$RED$$\nCopy Src Drive:\n$$FG$$"; - src=TOSGetDrv; - "$$RED$$\nCopy Dst Drive:\n$$FG$$"; - dst=TOSGetDrv; - TOSCopyDrv(src,dst); -} - -public U0 CopySongs(U8 threshold='7') -{ - CDoc *doc; - CDocEntry *doc_e; - CDirEntry *tempde=FilesFind("/Home/Sup1/Sup1Psalmody/*.CPP*", - FUF_CLUSTER_ORDER),*tempde1=tempde; - DelTree("/Apps/Psalmody/Examples"); - MkDir("/Apps/Psalmody/Examples"); - while (tempde) { - doc=DocRead(tempde->full_name); - doc_e=doc->head.next; - if (doc_e->type_u8==DOCT_TEXT && doc_e->tag[2]>=threshold) - Copy(tempde->full_name,"/Apps/Psalmody/Examples"); - DocDel(doc); - tempde=tempde->next; - } - DirTreeDel(tempde1); -} - -U0 DistroPrep() -{ - Del("/Home/Demo*"); - DelTree("/Home/*Temp.TXT.Z"); - if (FileFind("/Home/Sup1/Sup1Psalmody")) - CopySongs; - - DelTree("/Temp"); - MkDir("/Temp"); - MkDir("/Temp/ScreenShots"); - - Touch("/PersonalMenu.TXT.Z","+T"); - Touch("/Home/PersonalMenu.TXT.Z","+T"); - - DelTree("/Demo/AcctExample"); - CopyTree("/Home","/Demo/AcctExample"); - DelTree("/Demo/AcctExample/Budget"); - DelTree("/Demo/AcctExample/Private"); - DelTree("/Demo/AcctExample/Sup1"); - DelTree("/Demo/AcctExample/Web"); - Del("/Demo/AcctExample/Test*"); - Copy("/Home/Web/index.TXT.Z", - "/Demo/ToHtmlToTXTDemo/DemoInPage.TXT.Z"); - if (FileFind("/Home/Sup1/Sup1Utils/SortHeaders.CPP.Z")) - ExeFile("/Home/Sup1/Sup1Utils/SortHeaders.CPP.Z"); - - if (FileFind("/Home/Sup1/Sup1Blog/YouTube.TXT.Z")) - Sort("/Home/Sup1/Sup1Blog/YouTube.TXT.Z",,2); - - //Once in a while, do $LK,"~/Sup1/Sup1Utils/DblSpaceScan.CPP"$. - - CursorRem("/*"); - DelTree("/Demo/*.BI*"); - S2T("/*","+r+S"); - DocOpt("/*","+R"); - Move(ACD_DEF_FILENAME,ACD_DEF_FILENAME_Z); -} - -U0 MakeBootRescueDrvFile() -{ - CBlkDev *bd; - if (!Let2Drv('A',FALSE)) { - Auto(CFG_BOOT_RESCUE_DRV "\n"); - Mount; - } - bd=Let2BlkDev('A'); - Fmt('A',,FALSE,FSt_REDSEA); - - MkDir("A:/Compiler"); - Copy("C:/Compiler/Compiler.BIN.Z", "A:/Compiler"); - Copy("C:/Compiler/OpCodes.TXT.Z", "A:/Compiler"); - Copy("C:/Compiler/CompilerA.HPP.Z", "A:/Compiler"); - Copy("C:/Compiler/CompilerB.HPP.Z", "A:/Compiler"); - - MkDir("A:/Kernel"); - Copy("C:/Kernel/*.HPP*", "A:/Kernel"); - CopyTree("C:/Kernel/BlkDev", "A:/Kernel/BlkDev"); - - Copy("C:/Home/Sup1/Sup1Distro/DbgStartOS.CPP.Z","A:/StartOS.CPP.Z"); - - MkDir("A:/Adam"); - Copy("C:/Home/Sup1/Sup1Distro/DbgMakeAdam.CPP.Z","A:/Adam/MakeAdam.CPP.Z"); - Copy("C:/Home/Sup1/Sup1Distro/DbgMount.CPP.Z","A:/Adam"); - Copy("C:/Adam/AExts.CPP.Z", "A:/Adam"); - Copy("C:/Adam/AMath.CPP.Z", "A:/Adam"); - Copy("C:/Adam/Training.CPP.Z","A:/Adam"); - Copy("C:/Adam/AMem.CPP.Z", "A:/Adam"); - Copy("C:/Adam/TaskRep.CPP.Z", "A:/Adam"); - Copy("C:/Adam/AMathODE.CPP.Z","A:/Adam"); - - FileWrite("C:" CFG_BOOT_RESCUE_DRV_FILE, - bd->RAM_dsk,(bd->max_blk+1)<hash_table); - Who; - if (doc=DocPut) { - st=StrNew(doc->filename.name); - StrCpy(doc->filename.name,"D:/Wb/Home/Web/SymsAlpha.TXT.Z"); - DocWrite(doc); - StrCpy(doc->filename.name,st); - Free(st); - } - DocClear; - DocMax; - Who("+m"); - if (doc=DocPut) { - st=StrNew(doc->filename.name); - StrCpy(doc->filename.name,"D:/Wb/Home/Web/SymsAddress.TXT.Z"); - DocWrite(doc); - StrCpy(doc->filename.name,st); - Free(st); - } - DocClear; -} - -I64 MakeLineRepFile() -{ - U8 *st; - CDoc *doc; - I64 res,official; - CDocEntry *tree_branch,*start_indent,*end_indent; - - DocClear; - Drv('C'); - DistroPrep; - - Cd("C:/"); - DelTree("B:/TOS"); - CopyTree("C:/Home","B:/TOS"); - DelTree("C:/Home"); - - DocMax; - DocClear; - res=LineRep; - if (doc=DocPut) { - st=StrNew(doc->filename.name); - StrCpy(doc->filename.name,"B:/TOS/Web/LineRep.TXT.Z"); - DocWrite(doc); - StrCpy(doc->filename.name,st); - Free(st); - } - DocClear; - official=LineRep("C:/*","-r")+ - LineRep("C:/Adam/*")+ - LineRep("C:/Compiler/*","-S+T")+ - LineRep("C:/Kernel/*"); - DocClear; - CopyTree("B:/TOS","C:/Home"); - DelTree("B:/TOS"); - - doc=DocRead("C:/Adam/ADefine.CPP.Z"); - DocTreeFind(doc,"LineRep",&tree_branch,&start_indent,&end_indent); - DocCut(doc,start_indent->next,end_indent->last); - doc->cur_entry=start_indent->next; - doc->cur_col=0; - DocPrint(doc,"DefinePrint(\"DD_TEMPLEOS_LOC\",\"%,d\");\n",res); - DocPrint(doc,"DefinePrint(\"DD_TEMPLEOS_LOC_OFFICIAL\",\"%,d\");\n",official); - DocWrite(doc); - DocDel(doc); - - DefinePrint("DD_TEMPLEOS_LOC","%,d",res); - DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","%,d",official); - - "Total LOC:%12,d\n\n",res; - return res; -} - -U0 StaffDistroPrep() -{ - Drv('C'); - DistroPrep; - Auto(TOS_DVD_CFG); - BootDVDIns('C'); - Fmt('B',,FALSE,FSt_REDSEA); - DelTree(TOS_DISTRO_DIR); - CopyTree("C:/",TOS_DISTRO_DIR "/"); - Del(TOS_DISTRO_DIR "/" KERNEL_BIN_C); -} -U0 MakeStaffDistro() -{ - StaffDistroPrep; - ISO9660ISO(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",, - TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C); - DefinePrint("DD_TEMPLEOSSTAFF_SIZE", - "Download $TX,"TempleOS V4.10",D="DD_OS_NAME_VERSION"$ - T.S. Company Internal Distro (%0.1f MB)", - 0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024)); - Drv('C'); -} - -U0 DbgDistroPrep() -{ - Drv('C'); - DistroPrep; - MakeBootRescueDrvFile; - Auto(TOS_DVD_DBG_CFG); - BootDVDIns('C'); - Fmt('B',,FALSE,FSt_REDSEA); - DelTree(TOS_DISTRO_DIR); - CopyTree("C:/",TOS_DISTRO_DIR "/"); - DelTree(TOS_DISTRO_DIR "/Home"); - MkDir(TOS_DISTRO_DIR "/Home"); - CopyTree("C:/Home/Sup1",TOS_DISTRO_DIR "/Home/Sup1"); - Del(TOS_DISTRO_DIR "/" KERNEL_BIN_C); - Del(TOS_DISTRO_DIR BOOT_DIR "/OldMBR.BIN.C"); - Del(TOS_DISTRO_DIR BOOT_DIR "/BootMHD2.BIN.C"); -} -U0 MakeDbgDistro() -{ - DbgDistroPrep; - ISO9660ISO(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",, - TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C); - DefinePrint("DD_TEMPLEOSDBG_SIZE", - "Download $TX,"TempleOS V4.10",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.1f MB)", - 0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024)); - Drv('C'); -} - -U0 StdDistroPrep() -{ - Drv('C'); - DistroPrep; - Auto(STD_DISTRO_DVD_CFG); - BootDVDIns('C'); - Fmt('B',,FALSE,FSt_REDSEA); - DelTree(TOS_DISTRO_DIR); - CopyTree("C:/",TOS_DISTRO_DIR "/"); - DelTree(TOS_DISTRO_DIR "/Home"); - MkDir(TOS_DISTRO_DIR "/Home"); - Del(TOS_DISTRO_DIR "/" KERNEL_BIN_C); - Del(TOS_DISTRO_DIR BOOT_DIR "/OldMBR.BIN.C"); - Del(TOS_DISTRO_DIR BOOT_DIR "/BootMHD2.BIN.C"); -} -U0 MakeStdDistro() -{ - StdDistroPrep; - ISO9660ISO(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",, - TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C); - DefinePrint("DD_TEMPLEOSCD_SIZE", - "Download $TX,"TempleOS V4.10",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1f MB)", - 0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024)); - Drv('C'); -} -U0 MakeStdRedSeaDistro() -{ - StdDistroPrep; - RedSeaISO(TOS_ISO_C_NAME,TOS_DISTRO_DIR,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C); - DefinePrint("DD_TEMPLEOSCD_RS_SIZE", - "Download $TX,"TempleOS V4.10",D="DD_OS_NAME_VERSION"$ - Standard RedSea Distro (%0.1f MB)", - 0.1*(10*Size(TOS_ISO_C_NAME,"+s")/1024/1024)); - Drv('C'); -} - -U0 UltraDistroPrep() -{ - StdDistroPrep; - DelTree(TOS_DISTRO_DIR "/Linux"); - Del(TOS_DISTRO_DIR "/" KERNEL_BIN_C); - Del(TOS_DISTRO_DIR "/Adam/AutoComplete/ACDefs.DAT*"); - Del(TOS_DISTRO_DIR "/Misc/PCIDevices.TXT.Z"); - Del(TOS_DISTRO_DIR "/Misc/Bible.TXT.Z"); - - DelTree(TOS_DISTRO_DIR "/Apps"); - MkDir(TOS_DISTRO_DIR "/Apps"); - DelTree(TOS_DISTRO_DIR "/Demo"); - DelTree(TOS_DISTRO_DIR "/Misc/Tour"); - Del(TOS_DISTRO_DIR "/" KERNEL_BIN_C); - Del(TOS_DISTRO_DIR "/Adam/AutoComplete/ACWords.DAT*"); - Del(TOS_DISTRO_DIR "/Adam/God/Vocab.TXT.Z"); - Del(TOS_DISTRO_DIR "/Misc/OSTestSuite.CPP.Z"); - Copy("C:/Home/Sup1/Sup1Distro/UltraMenu.TXT.Z", - TOS_DISTRO_DIR "/PersonalMenu.TXT.Z"); - Copy("C:/Demo/Games/EagleDive.CPP.Z", - TOS_DISTRO_DIR "/Misc"); -} -U0 MakeUltraDistro() -{ - UltraDistroPrep; - ISO9660ISO(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",, - TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C); - DefinePrint("DD_TEMPLEOSULTRA_SIZE", - "Download $TX,"TempleOS V4.10",D="DD_OS_NAME_VERSION"$ - UltraSmall Distro (%0.2f MB)", - 0.01*(100*Size(TOS_ISO_NAME,"+s")/1024/1024)); - Drv('C'); -} -U0 MakeUltraRedSeaDistro() -{ - UltraDistroPrep; - RedSeaISO(TOS_ISO_C_NAME,TOS_DISTRO_DIR,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C); - DefinePrint("DD_TEMPLEOSULTRA_RS_SIZE", - "Download $TX,"TempleOS V4.10",D="DD_OS_NAME_VERSION"$ - UltraSmall RedSea Distro (%0.2f MB)", - 0.01*(100*Size(TOS_ISO_C_NAME,"+s")/1024/1024)); - Drv('C'); -} - -U0 MakeSup1ISO() -{ - RedSeaISO(TOS_ISO_C_NAME,"::/Home/Sup1"); - DefinePrint("DD_TEMPLEOS_SUP1_SIZE", - "Supplemental ISO #1 (%0.2f MB)", - 0.01*(100*Size(TOS_ISO_C_NAME,"+s")/1024/1024)); - Drv('C'); -} - -U0 UpdateISODocDefines() -{ - try { - DefinePrint("DD_TEMPLEOSCD_SIZE", - "Download $TX,"TempleOS V4.10",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1f MB)", - 0.1*(10*Size("D:/Wb/TempleOSCD.ISO","+s")/1024/1024)); - DefinePrint("DD_TEMPLEOSCD_K_SIZE", - "%d KB",Size("D:/Wb/TempleOSCD.ISO","+s")/1024); - -// DefinePrint("DD_TEMPLEOSCD_RS_SIZE", -// "Download $TX,"TempleOS V4.10",D="DD_OS_NAME_VERSION"$ - Standard RedSea Distro (%0.1f MB)", -// 0.1*(10*Size("D:/Wb/TempleOSCDRS.ISO","+s")/1024/1024)); -// DefinePrint("DD_TEMPLEOSCD_RS_K_SIZE", -// "%d KB",Size("D:/Wb/TempleOSCDRS.ISO","+s")/1024); - - DefinePrint("DD_TEMPLEOSULTRA_SIZE", - "Download $TX,"TempleOS V4.10",D="DD_OS_NAME_VERSION"$ - UltraSmall Distro (%0.2f MB)", - 0.01*(100*Size("D:/Wb/TempleOSUltra.ISO","+s")/1024/1024)); - DefinePrint("DD_TEMPLEOSULTRA_K_SIZE", - "%d KB",Size("D:/Wb/TempleOSUltra.ISO","+s")/1024); - -// DefinePrint("DD_TEMPLEOSULTRA_RS_SIZE", -// "Download $TX,"TempleOS V4.10",D="DD_OS_NAME_VERSION"$ - UltraSmall RedSea Distro (%0.2f MB)", -// 0.01*(100*Size("D:/Wb/TempleOSUltraRS.ISO","+s")/1024/1024)); -// DefinePrint("DD_TEMPLEOSULTRA_RS_K_SIZE", -// "%d KB",Size("D:/Wb/TempleOSUltraRS.ISO","+s")/1024); - -// DefinePrint("DD_TEMPLEOSDBG_SIZE", -// "Download $TX,"TempleOS V4.10",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.2f MB)", -// 0.01*(100*Size("D:/Wb/TempleOSDbg.ISO","+s")/1024/1024)); -// DefinePrint("DD_TEMPLEOSDBG_K_SIZE", -// "%d KB",Size("D:/Wb/TempleOSDbg.ISO","+s")/1024); - - DefinePrint("DD_TEMPLEOS_SUP1_SIZE", - "Supplemental ISO #1 (%0.2f MB)", - 0.01*(100*Size("D:/Wb/TempleOSSup1.ISO","+s")/1024/1024)); - DefinePrint("DD_TEMPLEOS_SUP1_K_SIZE", - "%d KB",Size("D:/Wb/TempleOSSup1.ISO","+s")/1024); - } catch - Fs->catch_except=TRUE; -} -UpdateISODocDefines; - -public U0 MakeDistrosAndBackUp() -{ - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - progress4=*progress4_desc=0; - progress4_max=18; - AutoComplete; - WinBorder; - WinMax; - ChkAll; progress4++; - - MakeLineRepFile; progress4++; - TOSCopyDrv('C','D'); progress4++; - DelTree ("D:/Wb"); progress4++; - CopyTree("C:/","D:/Wb"); progress4++; - DocClear; - - MakeStdDistro; progress4++; - DocClear; - Move(TOS_ISO_NAME,"D:/Wb/TempleOSCD.ISO"); progress4++; - -// MakeStdRedSeaDistro; progress4++; -// DocClear; -// Move(TOS_ISO_C_NAME,"D:/Wb/TempleOSCDRS.ISO"); progress4++; - - MakeUltraDistro; progress4++; - DocClear; - Move(TOS_ISO_NAME,"D:/Wb/TempleOSUltra.ISO"); progress4++; - -// MakeUltraRedSeaDistro; progress4++; -// DocClear; -// Move(TOS_ISO_C_NAME,"D:/Wb/TempleOSUltraRS.ISO"); progress4++; - - MakeSup1ISO; progress4++; - DocClear; - Move(TOS_ISO_C_NAME,"D:/Wb/TempleOSSup1.ISO"); progress4++; - -// MakeStaffDistro; progress4++; -// DocClear; -// Move(TOS_ISO_NAME,"D:/Wb/TempleOSDbg.ISO"); progress4++; - - MakeStaffDistro; progress4++; - DocClear; - Move(TOS_ISO_NAME,"D:/Wb/TempleOSStaff.ISO"); progress4++; - - UpdateISODocDefines; - - Cd("C:/"); - - if (LongLines) - throw; - progress4++; - - if (LinkChk) - throw; - progress4++; - - MakeSymFiles; progress4++; - MakeWebSite; progress4++; - - Drv('C'); - ChkAll; progress4++; - progress4=progress4_max=0; - SettingsPop; -} - -public U0 PreBackUp() -{ - Copy("D:/Home/Sup1/Sup1Blog/Bookmarks.html","C:/Home/Sup1/Sup1Blog"); - Del("C:/Home/Sup1/Sup1Bin/*"); - Copy("D:/Home/Sup1/Sup1Bin/*","C:/Home/Sup1/Sup1Bin"); - Copy("D:/Home/Sup1/Sup1Bin/TempleBot","C:/Linux"); - Copy("D:/Home/Sup1/Sup1Bin/God*","C:/Linux"); -} diff --git a/Demo/AcctExample/TOSDistro.HC b/Demo/AcctExample/TOSDistro.HC new file mode 100644 index 0000000..a225444 --- /dev/null +++ b/Demo/AcctExample/TOSDistro.HC @@ -0,0 +1,474 @@ +//The CFG defines are $LK,"~/TOSCfg.HC",A="FI:::/Demo/AcctExample/TOSCfg.HC"$. + +#help_index "TOS" + +U8 TOSGetDrv() +{ + I64 res; + "Drive (%s):",TOS_HDS; + res=ToUpper(GetChar); + '\n'; + return res; +} + +U0 TOSBootHDIns(U8 drv_let) +{ + drv_let=ToUpper(drv_let); + Auto(TOS_CFG); + BootHDIns(drv_let); + if (StrOcc(TOS_MASTER_BOOT_DRVS,drv_let)) + BootMHDIns(drv_let); +} + +U0 TOSCopyDrv(U8 src,U8 dst) +{ + U8 buf_s[STR_LEN],buf_d[STR_LEN]; + src=ToUpper(src); + dst=ToUpper(dst); + + Fmt(dst,,FALSE,FSt_FAT32); + + StrPrint(buf_s,"%c:/",src); + StrPrint(buf_d,"%c:/",dst); + CopyTree(buf_s,buf_d); + + DocClear; + Drv(dst); + TOSBootHDIns(dst); +} + +U0 TOSPromptAndCopyDrv() +{ + I64 src,dst; + "$$RED$$\nCopy Src Drive:\n$$FG$$"; + src=TOSGetDrv; + "$$RED$$\nCopy Dst Drive:\n$$FG$$"; + dst=TOSGetDrv; + TOSCopyDrv(src,dst); +} + +public U0 CopySongs(U8 threshold='7') +{ + CDoc *doc; + CDocEntry *doc_e; + CDirEntry *tempde=FilesFind("/Home/Sup1/Sup1Psalmody/*.HC*", + FUF_CLUSTER_ORDER),*tempde1=tempde; + DelTree("/Apps/Psalmody/Examples"); + MkDir("/Apps/Psalmody/Examples"); + while (tempde) { + doc=DocRead(tempde->full_name); + doc_e=doc->head.next; + if (doc_e->type_u8==DOCT_TEXT && doc_e->tag[2]>=threshold) + Copy(tempde->full_name,"/Apps/Psalmody/Examples"); + DocDel(doc); + tempde=tempde->next; + } + DirTreeDel(tempde1); +} + +U0 DistroPrep() +{ + Del("/Home/Demo*"); + DelTree("/Home/*Temp.DD.Z"); + if (FileFind("/Home/Sup1/Sup1Psalmody")) + CopySongs; + + DelTree("/Temp"); + MkDir("/Temp"); + MkDir("/Temp/ScreenShots"); + + Touch("/PersonalMenu.DD.Z","+T"); + Touch("/Home/PersonalMenu.DD.Z","+T"); + + DelTree("/Demo/AcctExample"); + CopyTree("/Home","/Demo/AcctExample"); + DelTree("/Demo/AcctExample/Budget"); + DelTree("/Demo/AcctExample/Private"); + DelTree("/Demo/AcctExample/Sup1"); + DelTree("/Demo/AcctExample/Web"); + Del("/Demo/AcctExample/Test*"); + Copy("/Home/Web/index.DD.Z", + "/Demo/ToHtmlToTXTDemo/DemoInPage.DD.Z"); + if (FileFind("/Home/Sup1/Sup1Utils/SortHeaders.HC.Z")) + ExeFile("/Home/Sup1/Sup1Utils/SortHeaders.HC.Z"); + + if (FileFind("/Home/Sup1/Sup1Blog/YouTube.DD.Z")) + Sort("/Home/Sup1/Sup1Blog/YouTube.DD.Z",,2); + + //Once in a while, do $LK,"~/Sup1/Sup1Utils/DblSpaceScan.HC"$. + + CursorRem("/*"); + DelTree("/Demo/*.BI*"); + S2T("/*","+r+S"); + DocOpt("/*","+R"); + Move(ACD_DEF_FILENAME,ACD_DEF_FILENAME_Z); +} + +U0 MakeBootRescueDrvFile() +{ + CBlkDev *bd; + if (!Let2Drv('A',FALSE)) { + Auto(CFG_BOOT_RESCUE_DRV "\n"); + Mount; + } + bd=Let2BlkDev('A'); + Fmt('A',,FALSE,FSt_REDSEA); + + MkDir("A:/Compiler"); + Copy("C:/Compiler/Compiler.BIN.Z", "A:/Compiler"); + Copy("C:/Compiler/OpCodes.DD.Z", "A:/Compiler"); + Copy("C:/Compiler/CompilerA.HH.Z", "A:/Compiler"); + Copy("C:/Compiler/CompilerB.HH.Z", "A:/Compiler"); + + MkDir("A:/Kernel"); + Copy("C:/Kernel/*.HH*", "A:/Kernel"); + CopyTree("C:/Kernel/BlkDev", "A:/Kernel/BlkDev"); + + Copy("C:/Home/Sup1/Sup1Distro/DbgStartOS.HC.Z","A:/StartOS.HC.Z"); + + MkDir("A:/Adam"); + Copy("C:/Home/Sup1/Sup1Distro/DbgMakeAdam.HC.Z","A:/Adam/MakeAdam.HC.Z"); + Copy("C:/Home/Sup1/Sup1Distro/DbgMount.HC.Z","A:/Adam"); + Copy("C:/Adam/AExts.HC.Z", "A:/Adam"); + Copy("C:/Adam/AMath.HC.Z", "A:/Adam"); + Copy("C:/Adam/Training.HC.Z","A:/Adam"); + Copy("C:/Adam/AMem.HC.Z", "A:/Adam"); + Copy("C:/Adam/TaskRep.HC.Z", "A:/Adam"); + Copy("C:/Adam/AMathODE.HC.Z","A:/Adam"); + + FileWrite("C:" CFG_BOOT_RESCUE_DRV_FILE, + bd->RAM_dsk,(bd->max_blk+1)<hash_table); + Who; + if (doc=DocPut) { + st=StrNew(doc->filename.name); + StrCpy(doc->filename.name,"D:/Wb/Home/Web/SymsAlpha.DD.Z"); + DocWrite(doc); + StrCpy(doc->filename.name,st); + Free(st); + } + DocClear; + DocMax; + Who("+m"); + if (doc=DocPut) { + st=StrNew(doc->filename.name); + StrCpy(doc->filename.name,"D:/Wb/Home/Web/SymsAddress.DD.Z"); + DocWrite(doc); + StrCpy(doc->filename.name,st); + Free(st); + } + DocClear; +} + +I64 MakeLineRepFile() +{ + U8 *st; + CDoc *doc; + I64 res,official; + CDocEntry *tree_branch,*start_indent,*end_indent; + + DocClear; + Drv('C'); + DistroPrep; + + Cd("C:/"); + DelTree("B:/TOS"); + CopyTree("C:/Home","B:/TOS"); + DelTree("C:/Home"); + + DocMax; + DocClear; + res=LineRep; + if (doc=DocPut) { + st=StrNew(doc->filename.name); + StrCpy(doc->filename.name,"B:/TOS/Web/LineRep.DD.Z"); + DocWrite(doc); + StrCpy(doc->filename.name,st); + Free(st); + } + DocClear; + official=LineRep("C:/*","-r")+ + LineRep("C:/Adam/*")+ + LineRep("C:/Compiler/*","-S+T")+ + LineRep("C:/Kernel/*"); + DocClear; + CopyTree("B:/TOS","C:/Home"); + DelTree("B:/TOS"); + + doc=DocRead("C:/Adam/ADefine.HC.Z"); + DocTreeFind(doc,"LineRep",&tree_branch,&start_indent,&end_indent); + DocCut(doc,start_indent->next,end_indent->last); + doc->cur_entry=start_indent->next; + doc->cur_col=0; + DocPrint(doc,"DefinePrint(\"DD_TEMPLEOS_LOC\",\"%,d\");\n",res); + DocPrint(doc,"DefinePrint(\"DD_TEMPLEOS_LOC_OFFICIAL\",\"%,d\");\n",official); + DocWrite(doc); + DocDel(doc); + + DefinePrint("DD_TEMPLEOS_LOC","%,d",res); + DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","%,d",official); + + "Total LOC:%12,d\n\n",res; + return res; +} + +U0 StaffDistroPrep() +{ + Drv('C'); + DistroPrep; + Auto(TOS_DVD_CFG); + BootDVDIns('C'); + Fmt('B',,FALSE,FSt_REDSEA); + DelTree(TOS_DISTRO_DIR); + CopyTree("C:/",TOS_DISTRO_DIR "/"); + Del(TOS_DISTRO_DIR "/" KERNEL_BIN_C); +} +U0 MakeStaffDistro() +{ + StaffDistroPrep; + ISO9660ISO(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",, + TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C); + DefinePrint("DD_TEMPLEOSSTAFF_SIZE", + "Download $TX,"TempleOS V4.10",D="DD_OS_NAME_VERSION"$ - T.S. Company Internal Distro (%0.1f MB)", + 0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024)); + Drv('C'); +} + +U0 DbgDistroPrep() +{ + Drv('C'); + DistroPrep; + MakeBootRescueDrvFile; + Auto(TOS_DVD_DBG_CFG); + BootDVDIns('C'); + Fmt('B',,FALSE,FSt_REDSEA); + DelTree(TOS_DISTRO_DIR); + CopyTree("C:/",TOS_DISTRO_DIR "/"); + DelTree(TOS_DISTRO_DIR "/Home"); + MkDir(TOS_DISTRO_DIR "/Home"); + CopyTree("C:/Home/Sup1",TOS_DISTRO_DIR "/Home/Sup1"); + Del(TOS_DISTRO_DIR "/" KERNEL_BIN_C); + Del(TOS_DISTRO_DIR BOOT_DIR "/OldMBR.BIN.C"); + Del(TOS_DISTRO_DIR BOOT_DIR "/BootMHD2.BIN.C"); +} +U0 MakeDbgDistro() +{ + DbgDistroPrep; + ISO9660ISO(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",, + TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C); + DefinePrint("DD_TEMPLEOSDBG_SIZE", + "Download $TX,"TempleOS V4.10",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.1f MB)", + 0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024)); + Drv('C'); +} + +U0 StdDistroPrep() +{ + Drv('C'); + DistroPrep; + Auto(STD_DISTRO_DVD_CFG); + BootDVDIns('C'); + Fmt('B',,FALSE,FSt_REDSEA); + DelTree(TOS_DISTRO_DIR); + CopyTree("C:/",TOS_DISTRO_DIR "/"); + DelTree(TOS_DISTRO_DIR "/Home"); + MkDir(TOS_DISTRO_DIR "/Home"); + Del(TOS_DISTRO_DIR "/" KERNEL_BIN_C); + Del(TOS_DISTRO_DIR BOOT_DIR "/OldMBR.BIN.C"); + Del(TOS_DISTRO_DIR BOOT_DIR "/BootMHD2.BIN.C"); +} +U0 MakeStdDistro() +{ + StdDistroPrep; + ISO9660ISO(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",, + TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C); + DefinePrint("DD_TEMPLEOSCD_SIZE", + "Download $TX,"TempleOS V4.10",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1f MB)", + 0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024)); + Drv('C'); +} +U0 MakeStdRedSeaDistro() +{ + StdDistroPrep; + RedSeaISO(TOS_ISO_C_NAME,TOS_DISTRO_DIR,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C); + DefinePrint("DD_TEMPLEOSCD_RS_SIZE", + "Download $TX,"TempleOS V4.10",D="DD_OS_NAME_VERSION"$ - Standard RedSea Distro (%0.1f MB)", + 0.1*(10*Size(TOS_ISO_C_NAME,"+s")/1024/1024)); + Drv('C'); +} + +U0 UltraDistroPrep() +{ + StdDistroPrep; + DelTree(TOS_DISTRO_DIR "/Linux"); + Del(TOS_DISTRO_DIR "/" KERNEL_BIN_C); + Del(TOS_DISTRO_DIR "/Adam/AutoComplete/ACDefs.DAT*"); + Del(TOS_DISTRO_DIR "/Misc/PCIDevices.DD.Z"); + Del(TOS_DISTRO_DIR "/Misc/Bible.TXT.Z"); + + DelTree(TOS_DISTRO_DIR "/Apps"); + MkDir(TOS_DISTRO_DIR "/Apps"); + DelTree(TOS_DISTRO_DIR "/Demo"); + DelTree(TOS_DISTRO_DIR "/Misc/Tour"); + Del(TOS_DISTRO_DIR "/" KERNEL_BIN_C); + Del(TOS_DISTRO_DIR "/Adam/AutoComplete/ACWords.DAT*"); + Del(TOS_DISTRO_DIR "/Adam/God/Vocab.DD.Z"); + Del(TOS_DISTRO_DIR "/Misc/OSTestSuite.HC.Z"); + Copy("C:/Home/Sup1/Sup1Distro/UltraMenu.DD.Z", + TOS_DISTRO_DIR "/PersonalMenu.DD.Z"); + Copy("C:/Demo/Games/EagleDive.HC.Z", + TOS_DISTRO_DIR "/Misc"); +} +U0 MakeUltraDistro() +{ + UltraDistroPrep; + ISO9660ISO(TOS_ISO_NAME,TOS_DISTRO_DIR "/*",, + TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C); + DefinePrint("DD_TEMPLEOSULTRA_SIZE", + "Download $TX,"TempleOS V4.10",D="DD_OS_NAME_VERSION"$ - UltraSmall Distro (%0.2f MB)", + 0.01*(100*Size(TOS_ISO_NAME,"+s")/1024/1024)); + Drv('C'); +} +U0 MakeUltraRedSeaDistro() +{ + UltraDistroPrep; + RedSeaISO(TOS_ISO_C_NAME,TOS_DISTRO_DIR,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C); + DefinePrint("DD_TEMPLEOSULTRA_RS_SIZE", + "Download $TX,"TempleOS V4.10",D="DD_OS_NAME_VERSION"$ - UltraSmall RedSea Distro (%0.2f MB)", + 0.01*(100*Size(TOS_ISO_C_NAME,"+s")/1024/1024)); + Drv('C'); +} + +U0 MakeSup1ISO() +{ + RedSeaISO(TOS_ISO_C_NAME,"::/Home/Sup1"); + DefinePrint("DD_TEMPLEOS_SUP1_SIZE", + "Supplemental ISO #1 (%0.2f MB)", + 0.01*(100*Size(TOS_ISO_C_NAME,"+s")/1024/1024)); + Drv('C'); +} + +U0 UpdateISODocDefines() +{ + try { + DefinePrint("DD_TEMPLEOSCD_SIZE", + "Download $TX,"TempleOS V4.10",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1f MB)", + 0.1*(10*Size("D:/Wb/TempleOSCD.ISO","+s")/1024/1024)); + DefinePrint("DD_TEMPLEOSCD_K_SIZE", + "%d KB",Size("D:/Wb/TempleOSCD.ISO","+s")/1024); + +// DefinePrint("DD_TEMPLEOSCD_RS_SIZE", +// "Download $TX,"TempleOS V4.10",D="DD_OS_NAME_VERSION"$ - Standard RedSea Distro (%0.1f MB)", +// 0.1*(10*Size("D:/Wb/TempleOSCDRS.ISO","+s")/1024/1024)); +// DefinePrint("DD_TEMPLEOSCD_RS_K_SIZE", +// "%d KB",Size("D:/Wb/TempleOSCDRS.ISO","+s")/1024); + + DefinePrint("DD_TEMPLEOSULTRA_SIZE", + "Download $TX,"TempleOS V4.10",D="DD_OS_NAME_VERSION"$ - UltraSmall Distro (%0.2f MB)", + 0.01*(100*Size("D:/Wb/TempleOSUltra.ISO","+s")/1024/1024)); + DefinePrint("DD_TEMPLEOSULTRA_K_SIZE", + "%d KB",Size("D:/Wb/TempleOSUltra.ISO","+s")/1024); + +// DefinePrint("DD_TEMPLEOSULTRA_RS_SIZE", +// "Download $TX,"TempleOS V4.10",D="DD_OS_NAME_VERSION"$ - UltraSmall RedSea Distro (%0.2f MB)", +// 0.01*(100*Size("D:/Wb/TempleOSUltraRS.ISO","+s")/1024/1024)); +// DefinePrint("DD_TEMPLEOSULTRA_RS_K_SIZE", +// "%d KB",Size("D:/Wb/TempleOSUltraRS.ISO","+s")/1024); + +// DefinePrint("DD_TEMPLEOSDBG_SIZE", +// "Download $TX,"TempleOS V4.10",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.2f MB)", +// 0.01*(100*Size("D:/Wb/TempleOSDbg.ISO","+s")/1024/1024)); +// DefinePrint("DD_TEMPLEOSDBG_K_SIZE", +// "%d KB",Size("D:/Wb/TempleOSDbg.ISO","+s")/1024); + + DefinePrint("DD_TEMPLEOS_SUP1_SIZE", + "Supplemental ISO #1 (%0.2f MB)", + 0.01*(100*Size("D:/Wb/TempleOSSup1.ISO","+s")/1024/1024)); + DefinePrint("DD_TEMPLEOS_SUP1_K_SIZE", + "%d KB",Size("D:/Wb/TempleOSSup1.ISO","+s")/1024); + } catch + Fs->catch_except=TRUE; +} +UpdateISODocDefines; + +public U0 MakeDistrosAndBackUp() +{ + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + progress4=*progress4_desc=0; + progress4_max=18; + AutoComplete; + WinBorder; + WinMax; + ChkAll; progress4++; + + MakeLineRepFile; progress4++; + TOSCopyDrv('C','D'); progress4++; + DelTree ("D:/Wb"); progress4++; + CopyTree("C:/","D:/Wb"); progress4++; + DocClear; + + MakeStdDistro; progress4++; + DocClear; + Move(TOS_ISO_NAME,"D:/Wb/TempleOSCD.ISO"); progress4++; + +// MakeStdRedSeaDistro; progress4++; +// DocClear; +// Move(TOS_ISO_C_NAME,"D:/Wb/TempleOSCDRS.ISO"); progress4++; + + MakeUltraDistro; progress4++; + DocClear; + Move(TOS_ISO_NAME,"D:/Wb/TempleOSUltra.ISO"); progress4++; + +// MakeUltraRedSeaDistro; progress4++; +// DocClear; +// Move(TOS_ISO_C_NAME,"D:/Wb/TempleOSUltraRS.ISO"); progress4++; + + MakeSup1ISO; progress4++; + DocClear; + Move(TOS_ISO_C_NAME,"D:/Wb/TempleOSSup1.ISO"); progress4++; + +// MakeStaffDistro; progress4++; +// DocClear; +// Move(TOS_ISO_NAME,"D:/Wb/TempleOSDbg.ISO"); progress4++; + + MakeStaffDistro; progress4++; + DocClear; + Move(TOS_ISO_NAME,"D:/Wb/TempleOSStaff.ISO"); progress4++; + + UpdateISODocDefines; + + Cd("C:/"); + + if (LongLines) + throw; + progress4++; + + if (LinkChk) + throw; + progress4++; + + MakeSymFiles; progress4++; + MakeWebSite; progress4++; + + Drv('C'); + ChkAll; progress4++; + progress4=progress4_max=0; + SettingsPop; +} + +public U0 PreBackUp() +{ + Copy("D:/Home/Sup1/Sup1Blog/Bookmarks.html","C:/Home/Sup1/Sup1Blog"); + Del("C:/Home/Sup1/Sup1Bin/*"); + Copy("D:/Home/Sup1/Sup1Bin/*","C:/Home/Sup1/Sup1Bin"); + Copy("D:/Home/Sup1/Sup1Bin/God*","C:/Linux"); +} diff --git a/Demo/AcctExample/TOSHolySpirit.CPP b/Demo/AcctExample/TOSHolySpirit.CPP deleted file mode 100644 index e8bf701..0000000 --- a/Demo/AcctExample/TOSHolySpirit.CPP +++ /dev/null @@ -1,765 +0,0 @@ -#help_index "TOS" - -U0 BadCodeJump() -{//$LK,"::/Adam/God/HSNotes.TXT"$ - CDirEntry *tempde1=FilesFind("/*", - FUF_JUST_FILES|FUF_RECURSE|FUF_JUST_SRC|FUF_CLUSTER_ORDER), - *tempde=tempde1; - I64 cnt=0,num; - CDoc *doc; - U8 *st; - while (tempde) { - doc=DocRead(tempde->full_name); - tempde->user_data=doc->head.y; - cnt+=doc->head.y; - DocDel(doc); - tempde=tempde->next; - } - - FifoU8Flush(god.fifo); - GodBitsIns(GOD_GOOD_BITS,KbdMouseEvtTime>>GOD_BAD_BITS); - num=GodBits(GOD_GOOD_BITS)%cnt; - - tempde=tempde1; - while (tempde) { - num-=tempde->user_data; - if (num<0) { - st=MStrPrint("FL:%s,%d",tempde->full_name,-num); - break; - } - tempde=tempde->next; - } - DirTreeDel(tempde1); - Ed(st); - Free(st); -} - -U8 *WebBookMarks(U8 *filename="~/Sup1/Sup1Blog/Bookmarks.html") -{ - U8 *st; - CDocEntry *doc_e; - CDoc *doc=DocNew; - CCmpCtrl *cc=CmpCtrlNew(MStrPrint("#include \"%s\"",filename)); - while (Lex(cc)) - if (cc->token==TK_STR && *cc->cur_str(U32 *)=='http') { - DocPrint(doc,"$$MU-UL,\"%$$Q\",LE=0x%X$$\n",cc->cur_str,cc->cur_str); - cc->cur_str=NULL; - } - CmpCtrlDel(cc); - - if ((st=PopUpMenu(doc))!=DOCM_CANCEL) - st=StrNew(st); - else - st=NULL; - - doc_e=doc->head.next; - while (doc_e!=doc) { - if (doc_e->type_u8==DOCT_MENU_VAL) - Free(doc_e->left_exp); - doc_e=doc_e->next; - } - DocDel(doc); - - return st; -} - -U8 *YouTubeGet(U8 *filename="C:/Home/Sup1/Sup1Blog/YouTube.TXT.Z",U8 *needle) -{ - I64 i=0,line=MIN_I64; - CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR), - *doc2=DocNew; - U8 *title,*code,*res; - while (DocFind(doc,line,needle)) { - if (!(doc->cur_entry->y&1)) { - title=doc->cur_entry->tag; - DocLineNumGoTo(doc,doc->cur_entry->y+2); - if (doc->cur_entry->type_u8==DOCT_TEXT) { - code=doc->cur_entry->tag; - DocPrint(doc2,"$$MU-UL,\"%s\",LE=0x%X$$\n",title,code); - i++; - } - } - line=doc->cur_entry->y+2; - } - switch (i) { - case 0: - res=NULL; - break; - case 1: - res=StrNew(code); - break; - default: - res=PopUpMenu(doc2); - if (res==DOCM_CANCEL) - res=NULL; - else - res=StrNew(res); - } - DocDel(doc); - DocDel(doc2); - return res; -} - -U0 YouTubeAdd(U8 *filename="C:/Home/Sup1/Sup1Blog/YouTube.TXT.Z", - U8 *title,U8 *code) -{ - CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR); - if (!DocFind(doc,,title)) { - DocBottom(doc); - DocPrint(doc,"%s\n%s\n",title,code); - DocTop(doc); - DocWrite(doc); - Sort(filename,,2); - } - DocDel(doc); -} - -class CTopMoviesForm -{ - U8 tag[STR_LEN]; - U8 special[STR_LEN] fmtstr "$$DA-P," - "A=\"Movie #1-100 (2 Decimal Digits from Hex):%s\"$$\n"; - I64 timestamp fmtstr "$$DA,A=\"TimeStamp :%d\"$$\n"; - I64 cert; - I64 min; - I64 sec; -}; - -class CMetallicaForm -{ - U8 tag[STR_LEN]; - U8 special[STR_LEN] fmtstr "$$DA-P," - "A=\"Song #1-99 (2 Decimal Digits from Hex):%s\"$$\n"; - I64 timestamp fmtstr "$$DA,A=\"TimeStamp :%d\"$$\n"; - I64 cert; - I64 min; - I64 sec; -}; - -class CWebBookMarkForm -{ - U8 tag[STR_LEN] fmtstr "$$DA-P,A=\"Tag Text:%s\"$$\n"; - U8 special[STR_LEN]; - I64 timestamp; - I64 cert; - I64 min; - I64 sec; -}; - -class CWebBibleForm -{ - U8 tag[STR_LEN] fmtstr "$$DA-P,A=\"Tag Text:%s\"$$\n"; - U8 special[STR_LEN] fmtstr "$$DA-P,A=\"Bible Passage:%s\"$$\n"; - I64 timestamp; - I64 cert; - I64 min; - I64 sec; -}; - -class CYouTubeForm -{ - U8 tag[STR_LEN] fmtstr "$$DA-P,A=\"Title:%s\"$$\n"; - U8 special[STR_LEN] fmtstr "$$DA-P-TRM,LEN=11,A=\"SerialNum:%11s\"$$\n"; - I64 timestamp; - I64 cert; - I64 min fmtstr "$$DA,A=\"Minutes :%d\"$$\n"; - I64 sec fmtstr "$$DA,A=\"Seconds :%d\"$$\n"; -}; - -class CImgurForm -{ - U8 tag[STR_LEN]; - U8 special[STR_LEN] fmtstr "$$DA-P,A=\"SerialNum:%s\"$$\n"; - I64 timestamp; - I64 cert; - I64 min fmtstr "$$DA,A=\"Width :%d\"$$\n"; - I64 sec fmtstr "$$DA,A=\"Height :%d\"$$\n"; -}; - -class CWikipediaForm -{ - U8 tag[STR_LEN] fmtstr "$$DA-P,A=\"Tag Text:%s\"$$\n"; - U8 special[STR_LEN] fmtstr "$$DA-P,A=\"Index :%s\"$$\n"; - I64 timestamp; - I64 cert; - I64 min; - I64 sec; -}; - -class CRandDecForm -{ - U8 tag[STR_LEN]; - U8 special[STR_LEN] fmtstr "$$DA-P,A=\"Line (Dec):%s\"$$\n"; - I64 timestamp; - I64 cert; - I64 min; - I64 sec; -}; - -class CRandHex5Form -{ - U8 tag[STR_LEN]; - U8 special[STR_LEN] fmtstr "$$DA-P-TRM,LEN=5," - "A=\"Line (5-Digit Hex):%5s\"$$\n"; - I64 timestamp; - I64 cert; - I64 min; - I64 sec; -}; - -class CRandCertForm -{ - U8 tag[STR_LEN]; - U8 special[STR_LEN] fmtstr "$$DA-P,A=\"Line (Dec) :%s\"$$\n"; - I64 timestamp; - I64 cert fmtstr "$$DA,A=\"Certificate:%d\"$$\n"; - I64 min; - I64 sec; -}; - -class CRandHex5BeaconForm -{ - U8 tag[STR_LEN]; - U8 special[STR_LEN] fmtstr "$$DA-P-TRM,LEN=5," - "A=\"Line (5-Digit Hex):%5s\"$$\n"; - I64 timestamp fmtstr "$$DA,A=\"TimeStamp :%d\"$$\n"; - I64 cert; - I64 min; - I64 sec; -}; - -class CRandHex8BeaconForm -{ - U8 tag[STR_LEN]; - U8 special[STR_LEN] fmtstr "$$DA-P-TRM,LEN=8," - "A=\"Line (8-Digit Hex):%8s\"$$\n"; - I64 timestamp fmtstr "$$DA,A=\"TimeStamp :%d\"$$\n"; - I64 cert; - I64 min; - I64 sec; -}; - -class CRandExtDec5Form -{ - U8 tag[STR_LEN]; - U8 special[STR_LEN] fmtstr "$$DA-P,A=\"5 Decimal Digits from Hex:%s\"$$\n"; - I64 timestamp; - I64 cert; - I64 min; - I64 sec; -}; - -class CRandExtDec5BeaconForm -{ - U8 tag[STR_LEN]; - U8 special[STR_LEN] fmtstr "$$DA-P,A=\"5 Decimal Digits from Hex:%s\"$$\n"; - I64 timestamp fmtstr "$$DA,A=\"TimeStamp:%d\"$$\n"; - I64 cert; - I64 min; - I64 sec; -}; - -U8 *URLPercentSpaces(U8 *src) -{ - U8 buf[2048],*dst=buf; - while (*src) { - if (*src==CH_SPACE) { - *dst++='%'; - *dst++='%'; - *dst++='2'; - *dst++='0'; - src++; - } else - *dst++=*src++; - } - *dst=0; - return StrNew(buf); -} - -U8 *URLPlusSpaces(U8 *src) -{ - U8 buf[2048],*dst=buf; - while (*src) { - if (*src==CH_SPACE) { - *dst++='+'; - src++; - } else - *dst++=*src++; - } - *dst=0; - return StrNew(buf); -} - -I64 ExtDecFromHex(U8 *st,I64 digits) -{ - I64 res=0,ch; - do { - if (!(ch=*st++)) - throw; - if ('0'<=ch<='9') { - res=10*res+ch-'0'; - digits--; - } - } while (digits); - return res; -} - -U8 *RandVideoRead(U8 *filename,I64 line) -{ - U8 *res=NULL; - CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR); - if (DocLineNumGoTo(doc,line-1) && doc->cur_entry->type_u8==DOCT_TEXT) - res=StrNew(doc->cur_entry->tag); - DocDel(doc); - return res; -} - -U8 *RandVideoWrite(U8 *filename,I64 line,U8 *st) -{ - U8 *res=NULL; - CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR); - if (DocLineNumGoTo(doc,line-1)) { - if (doc->cur_entry->type_u8==DOCT_TEXT) { - Free(doc->cur_entry->tag); - doc->cur_entry->tag=StrNew(st); - } else - DocPrint(doc,"%s",st); - DocTop(doc); - DocWrite(doc); - } - DocDel(doc); - return res; -} - -U0 RandVideo(U8 *title,U8 *webpage,CTopMoviesForm *url,I64 digits,U8 *filename) -{ - U8 *st,*st2; - I64 i=ExtDecFromHex(url->special,digits); - if (st=RandVideoRead(filename,i*2)) { - StrCpy(url->tag,st); - Free(st); - if (!(st=RandVideoRead(filename,i*2+1))||!*st) { - Free(st); - *url->special=0; - if (DocForm(url(CYouTubeForm *)) && *url->special) { - if (url->min || url->sec) - st=MStrPrint("%s&hl=enUS&start=%d", - url->special,url->min*60+url->sec); - else - st=StrNew(url->special); - RandVideoWrite(filename,i*2+1,st); - } else - st=NULL; - } - if (StrIMatch("Metallica",filename)) { - st2=URLPlusSpaces(url->tag+3); - "God's response:\n" - "$$TX,\"%s\",HTML=\"%s\"$$\n" - "$$TX,\"%s (Lyrics)\"," - "HTML=\"http://lmgtfy.com/?q=Metallica+lyrics+%s\"$$\n", - title,webpage,url->tag,st2; - Free(st2); - } else - "God's response:\n" - "$$TX,\"%s\",HTML=\"%s\"$$\n" - "#%s\n",title,webpage,url->tag; - if (st) { - "$$HC,\"" - "" - "\"$$\n",st,st; - Free(st); - } - } -} - -U0 MyBibleLines(U8 *st,I64 num_lines,I64 radix,Bool modulo,Bool plus_one) -{//Radix<0 means extract N dec digits from hex. - CDoc *doc_out,*doc_in; - CDocEntry *doc_e; - I64 i,start; - U8 *verse; - if (*st && (doc_out=DocPut)) { - if (radix<0) - i=ExtDecFromHex(st,-radix); - else - i=Str2I64(st,radix); - if (radix<0) - DocPrint(doc_out,"'%s'-->(Taking first %d decimal digits)",st,-radix); - else if (radix==16) - DocPrint(doc_out,"0x%s-->",st); - if (modulo) { - DocPrint(doc_out,"(%d remainder when divided by %d)", - i,ST_BIBLE_LINES-(num_lines-1)); - start=i%(ST_BIBLE_LINES-(num_lines-1)); - } else { - if (radix>=0 || plus_one) - DocPrint(doc_out,"%d",i); - start=i; - } - if (plus_one) { - start++; - DocPrint(doc_out,"+1"); - } - DocPrint(doc_out,"-->Line:%d\n",start); - - verse=BibleLine2Verse(start); - DocPrint(doc_out,"$TX,"KingJamesBible",HTML="http://www.templeos.org/Wb/Home/Sup1/Sup1Blog/NumBible.TXT"$ (%s)\n\nGod says...\n$$RED$$",verse); - Free(verse); - - doc_in=DocNew; - BibleLines(doc_in,start,num_lines,"::/Home/Sup1/Sup1Blog/NumBible.TXT"); - while (TRUE) {//Del leading blanks - doc_e=doc_in->head.next; - if (doc_e==doc_in) - break; - else { - if (doc_e->type_u8==DOCT_NEW_LINE) - DocEntryDel(doc_in,doc_e); - else - break; - } - } - while (TRUE) {//Del trailing blanks - doc_e=doc_in->cur_entry->last; - if (doc_e==doc_in) - break; - else { - if (doc_e->type_u8==DOCT_NEW_LINE) - DocEntryDel(doc_in,doc_e); - else - break; - } - } - DocPrint(doc_in,"$$FG$$\n"); - DocInsDoc(doc_out,doc_in); - DocDel(doc_in); - } -} - -#define GBP_SHORT 0 -#define GBP_MEDIUM 1 -#define GBP_LONG 2 - -public U0 GodBooksPassage(U8 *files_find_mask,I64 len=512, - I64 rand_i32=MIN_I64,I64 verbosity=GBP_SHORT) -{//Make God pick a book passage. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.TXT"$ - CDirEntry *tempde=FilesFind(files_find_mask, - FUF_RECURSE|FUF_JUST_FILES|FUF_JUST_TXT), - *tempde1=tempde; - I64 i=0; - U8 *st,*st2=NULL; - while (tempde) { - st=FileRead(tempde->full_name); - tempde->user_data=StrLen(st); - if (verbosity==GBP_LONG) - "%08X-",i; - if (tempde->user_data>=len) - i+=tempde->user_data+1-len; - if (verbosity==GBP_LONG) - "%08X:$$LK,\"%s\",A=\"FI:%s\"$$\n", - i-1,tempde->full_name+2,tempde->full_name; - Free(st); - tempde=tempde->next; - } - if (rand_i32<0) - rand_i32=GodBits(32); - if (verbosity==GBP_LONG) - '\n'; - if (verbosity>=GBP_MEDIUM) - "%08X*%08X",rand_i32,i; - i*=rand_i32; - if (verbosity>=GBP_MEDIUM) - "=%08X.%08X\n",i.u32[1],i.u32[0]; - i=i.u32[1]; - tempde=tempde1; - while (tempde) { - if (!st2 && tempde->user_data>=len) { - i-=tempde->user_data+1-len; - if (i<0) { - st=FileRead(tempde->full_name); - st2=st+(tempde->user_data+1-len)+i; - st2[len]=0; - "%s\nGod says...\n$$RED$$%s$$FG$$\n",tempde->full_name,st2; - Free(st); - } - } - tempde=tempde->next; - } - DirTreeDel(tempde1); -} - -#define NIST_TIME_OFFSET (-7976-local_time_offset/CDATE_FREQ) -#define NIST_TIME_TO_SWITCH 3 - -public U0 NISTSync() -{ - I64 i,j; - CDate d; - CDateStruct ds; - while (!ScanChar) { - d=Now; - Date2Struct(&ds,d); - i=ToI64((d-Str2Date("1/1/1970"))/CDATE_FREQ+NIST_TIME_OFFSET); - j=FloorI64(i,60); - "%d %d %02d %02d\n",i,j,ds.sec,(60+ds.sec-(i-j))%60; - Sleep(100); - } -} - -U0 NISTBeaconURL(I64 timestamp) -{ - U8 *tag; - CDateStruct ds; - CDate dt=(timestamp-NIST_TIME_OFFSET)*CDATE_FREQ+Str2Date("1/1/1970"); - Date2Struct(&ds,dt+local_time_offset); - "$$TX,\"NIST Beacon Date:%D Time:%02d:%02d Unix TimeStamp:%u\"," - "HTML=\"https://beacon.nist.gov/home\"$$\n",dt,ds.hour,ds.min,timestamp; - tag=MStrPrint("https:/beacon.nist.gov/rest/record/%d",timestamp); - "$$TX,\"NIST Beacon Record:%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag; - Free(tag); -} - -U0 InsMyURL() -{ - U8 *tag,*st,*st2; - CWebBibleForm *url=CAlloc(sizeof(CWebBibleForm)); - url->timestamp= - FloorI64((Now-Str2Date("1/1/1970"))/CDATE_FREQ+NIST_TIME_OFFSET- - NIST_TIME_TO_SWITCH,60); - try { - switch (PopUpPickLst("NISTExtDec5Bible\0NISTHex5Bible\0NISTHex8Passage\0" - "BibleGatewaySearch\0BibleGatewayVerse\0" - "YouTube\0Imgur\0Wikipedia\0ExtDec5Bible\0Random.org\0" - "RandomNumbers.info\0PassWord\0VirtualNotary\0ANU_NIST\0HotBits\0" - "GenerateData\0WebBookMark\0Roulette\0NISTMovie\0NISTMetallica\0")) { - case: - if (DocForm(url(CRandExtDec5BeaconForm *))) { - "$$TX,\"Guidelines for Talking with God.\"," - "HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\t"; - NISTBeaconURL(url->timestamp); - MyBibleLines(url->special,20,-5,FALSE,FALSE); - } - break; - case: - if (DocForm(url(CRandHex5BeaconForm *))) { - "$$TX,\"Guidelines for Talking with God.\"," - "HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\t"; - "$$TX,\"How this random Bible passage was chosen.\"," - "HTML=\"http://www.templeos.org/Wb" - "/Home/Web/TAD/NISTPassage.html\"$$\n"; - NISTBeaconURL(url->timestamp); - MyBibleLines(url->special,20,16,TRUE,TRUE); - } - break; - case: - if (DocForm(url(CRandHex8BeaconForm *))) { - "$$TX,\"Guidelines for Talking with God.\"," - "HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\t"; - "$$TX,\"How this random book pick was chosen.\"," - "HTML=\"http://www.templeos.org/Wb" - "/Home/Web/TAD/NISTPick001.html\"$$\n"; - NISTBeaconURL(url->timestamp); - GodBooksPassage("C:/Home/Sup1/Sup1Texts/*",, - Str2I64(url->special,16),GBP_MEDIUM); - } - break; - case: - if (DocForm(url(CWebBibleForm *))) { - tag=url->special; - st2=URLPercentSpaces(url->special); - st=MStrPrint("http://www.biblegateway.com/passage/" - "?search=%s&version=NIV",st2); - Free(st2); - if (*url->tag) - tag=url->tag; - "$$TX,\"%$$Q\",HTML=\"%$$Q\"$$",tag,st; - Free(st); - } - break; - case: - if (DocForm(url(CWebBibleForm *))) { - tag=url->special; - st2=URLPercentSpaces(url->special); - st=MStrPrint( - "http://www.biblegateway.com/verse/en/%s",st2); - Free(st2); - if (*url->tag) - tag=url->tag; - "$$TX,\"%$$Q\",HTML=\"%$$Q\"$$",tag,st; - Free(st); - } - break; - case: - if (DocForm(url(CYouTubeForm *))) { - if (*url->special==CH_SPACE) - st2=YouTubeGet(,url->tag); - else - st2=StrNew(url->special); - if (st2 && *st2!=CH_SPACE) { - if (url->min || url->sec) - st=MStrPrint("%s&hl=enUS&start=%d",st2,url->min*60+url->sec); - else - st=StrNew(st2); - if (*url->special!=CH_SPACE && *url->tag) - YouTubeAdd(,url->tag,st); - "$$HC,\"" - "\"$$\n",st,st; - Free(st); - Free(st2); - } - } - break; - case: - if (DocForm(url(CImgurForm *))) { - "$$HC,\"
\"$$\n", - url->special,url->min,url->sec; - } - break; - case: - if (DocForm(url(CWikipediaForm *))) { - tag=url->special; - st=MStrPrint("http://en.wikipedia.org/wiki/%s",url->special); - if (*url->tag) - tag=url->tag; - "$$TX,\"%$$Q\",HTML=\"%$$Q\"$$",tag,st; - Free(st); - } - break; - case: - if (DocForm(url(CRandExtDec5Form *))) { - "$$TX,\"Guidelines for Talking with God.\"," - "HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n"; - MyBibleLines(url->special,20,-5,FALSE,FALSE); - } - break; - case: - if (DocForm(url(CRandDecForm *))) { - "$$TX,\"Guidelines for Talking with God\"," - "HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n"; - tag="http://www.random.org"; - "$$TX,\"%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag; - MyBibleLines(url->special,20,10,FALSE,FALSE); - } - break; - case: - if (DocForm(url(CRandDecForm *))) { - "$$TX,\"Guidelines for Talking with God\"," - "HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n"; - tag="http://www.randomnumbers.info"; - "$$TX,\"%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag; - MyBibleLines(url->special,20,10,FALSE,TRUE); - } - break; - case: - if (DocForm(url(CRandDecForm *))) { - "$$TX,\"Guidelines for Talking with God\"," - "HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n"; - tag="https://passed.pw"; - "$$TX,\"%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag; - MyBibleLines(url->special,20,10,FALSE,FALSE); - } - break; - case: - if (DocForm(url(CRandCertForm *))) { - "$$TX,\"Guidelines for Talking with God\"," - "HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n"; - tag="http://virtual-notary.org"; - "$$TX,\"%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag; - tag="Here is the certificate"; - st=MStrPrint("http://www.templeos.org/Certs/virtual-notary-cert" - "-randomnum-%d.p12",url->cert); - "\n$$TX,\"%$$Q: %d\",HTML=\"%$$Q\"$$.\n",tag,url->cert,st; - Free(st); - MyBibleLines(url->special,20,10,FALSE,FALSE); - } - break; - case: - if (DocForm(url(CRandHex5Form *))) { - "$$TX,\"Guidelines for Talking with God\"," - "HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n"; - tag="http://qrng.anu.edu.au/NIST.php"; - "$$TX,\"%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag; - MyBibleLines(url->special,20,16,TRUE,TRUE); - } - break; - case: - if (DocForm(url(CRandHex5Form *))) { - "$$TX,\"Guidelines for Talking with God\"," - "HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n"; - tag="https://www.fourmilab.ch/hotbits/secure_generate.html"; - "$$TX,\"%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag; - MyBibleLines(url->special,20,16,TRUE,TRUE); - } - break; - case: - if (DocForm(url(CRandDecForm *))) { - "$$TX,\"Guidelines for Talking with God\"," - "HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n"; - tag="http://www.generatedata.com"; - "$$TX,\"%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag; - MyBibleLines(url->special,20,10,FALSE,FALSE); - } - break; - case: - if (DocForm(url(CWebBookMarkForm *))) { - tag=st=WebBookMarks; - if (*url->tag) - tag=url->tag; - "$$TX,\"%$$Q\",HTML=\"%$$Q\"$$",tag,st; - Free(st); - } - break; - case: - if (DocForm(url(CRandDecForm *))) { - "$$TX,\"Guidelines for Talking with God\"," - "HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n"; - tag="https://www.dublinbet.com"; - "$$TX,\"%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag; - MyBibleLines(url->special,20,10,FALSE,FALSE); - } - break; - case: - if (DocForm(url(CTopMoviesForm *))) { - NISTBeaconURL(url->timestamp); - RandVideo("Top 100 Movies", - "http://www.afi.com/100years/movies10.aspx", - url,2,"C:/Home/Sup1/Sup1Blog/Movies.TXT.Z"); - } - break; - case: - if (DocForm(url(CMetallicaForm *))) { - NISTBeaconURL(url->timestamp); - RandVideo("Metallica Song","http://home.hccnet.nl/a.r.adams/lyrics/" - "metallica/songindex.html", - url,2,"C:/Home/Sup1/Sup1Blog/Metallica.TXT.Z"); - } - break; - } - } catch { - Fs->catch_except=TRUE; - Beep; Beep; - } - Free(url); -} - -//if (FileFind("~/Sup1/Sup1Words/LinuxDict.TXT")) -// GodInit("~/Sup1/Sup1Words/LinuxDict.TXT"); -if (FileFind("~/Sup1/Sup1Words/HappyWords.TXT")) - GodInit("~/Sup1/Sup1Words/HappyWords.TXT"); diff --git a/Demo/AcctExample/TOSHolySpirit.HC b/Demo/AcctExample/TOSHolySpirit.HC new file mode 100644 index 0000000..1286a7d --- /dev/null +++ b/Demo/AcctExample/TOSHolySpirit.HC @@ -0,0 +1,854 @@ +#help_index "TOS" + +U8 *URLPercentSpaces(U8 *src) +{ + U8 buf[2048],*dst=buf; + while (*src) { + if (*src==CH_SPACE) { + *dst++='%'; + *dst++='%'; + *dst++='2'; + *dst++='0'; + src++; + } else + *dst++=*src++; + } + *dst=0; + return StrNew(buf); +} + +U8 *URLPlusSpaces(U8 *src) +{ + U8 buf[2048],*dst=buf; + while (*src) { + if (*src==CH_SPACE) { + *dst++='+'; + src++; + } else + *dst++=*src++; + } + *dst=0; + return StrNew(buf); +} + +I64 ExtDecFromHex(U8 *st,I64 digits) +{ + I64 res=0,ch; + while (digits) { + if (!(ch=*st++)) + break; + if ('0'<=ch<='9') { + res=10*res+ch-'0'; + digits--; + } + } + return res; +} + +U0 TOSBibleLines(U8 *st,I64 num_lines,I64 radix,Bool modulo,Bool plus_one) +{//Radix<0 means extract N dec digits from hex. + CDoc *doc_out,*doc_in; + CDocEntry *doc_e; + I64 i,start; + U8 *verse; + if (*st && (doc_out=DocPut)) { + if (radix<0) + i=ExtDecFromHex(st,-radix); + else + i=Str2I64(st,radix); + if (radix<0) + DocPrint(doc_out,"'%s'-->(Taking first %d decimal digits)",st,-radix); + else if (radix==16) + DocPrint(doc_out,"0x%s-->",st); + if (modulo) { + DocPrint(doc_out,"(%d remainder when divided by %d)", + i,ST_BIBLE_LINES-(num_lines-1)); + start=i%(ST_BIBLE_LINES-(num_lines-1)); + } else { + if (radix>=0 || plus_one) + DocPrint(doc_out,"%d",i); + start=i; + } + if (plus_one) { + start++; + DocPrint(doc_out,"+1"); + } + DocPrint(doc_out,"-->Line:%d\n",start); + + verse=BibleLine2Verse(start); + DocPrint(doc_out,"$TX,"KingJamesBible",HTML="http://www.templeos.org/Wb/Home/Sup1/Sup1Blog/NumBible.DD"$ (%s)\n\nGod says...\n$$RED$$",verse); + Free(verse); + + doc_in=DocNew; + BibleLines(doc_in,start,num_lines,"::/Home/Sup1/Sup1Blog/NumBible.DD"); + while (TRUE) {//Del leading blanks + doc_e=doc_in->head.next; + if (doc_e==doc_in) + break; + else { + if (doc_e->type_u8==DOCT_NEW_LINE) + DocEntryDel(doc_in,doc_e); + else + break; + } + } + while (TRUE) {//Del trailing blanks + doc_e=doc_in->cur_entry->last; + if (doc_e==doc_in) + break; + else { + if (doc_e->type_u8==DOCT_NEW_LINE) + DocEntryDel(doc_in,doc_e); + else + break; + } + } + DocPrint(doc_in,"$$FG$$\n"); + DocInsDoc(doc_out,doc_in); + DocDel(doc_in); + } +} + +#define GBP_SHORT 0 +#define GBP_MEDIUM 1 +#define GBP_LONG 2 + +public U0 GodBooksPassage(U8 *files_find_mask,I64 len=512, + I64 rand_i32=MIN_I64,I64 verbosity=GBP_SHORT) +{//Make God pick a book passage. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.DD"$ + CDirEntry *tempde=FilesFind(files_find_mask, + FUF_RECURSE|FUF_JUST_FILES|FUF_JUST_TXT), + *tempde1=tempde; + I64 i=0; + U8 *st,*st2=NULL; + while (tempde) { + st=FileRead(tempde->full_name); + tempde->user_data=StrLen(st); + if (verbosity==GBP_LONG) + "%08X-",i; + if (tempde->user_data>=len) + i+=tempde->user_data+1-len; + if (verbosity==GBP_LONG) + "%08X:$$LK,\"%s\",A=\"FI:%s\"$$\n", + i-1,tempde->full_name+2,tempde->full_name; + Free(st); + tempde=tempde->next; + } + if (rand_i32<0) + rand_i32=GodBits(32); + if (verbosity==GBP_LONG) + '\n'; + if (verbosity>=GBP_MEDIUM) + "%08X*%08X",rand_i32,i; + i*=rand_i32; + if (verbosity>=GBP_MEDIUM) + "=%08X.%08X\n",i.u32[1],i.u32[0]; + i=i.u32[1]; + tempde=tempde1; + while (tempde) { + if (!st2 && tempde->user_data>=len) { + i-=tempde->user_data+1-len; + if (i<0) { + st=FileRead(tempde->full_name); + st2=st+(tempde->user_data+1-len)+i; + st2[len]=0; + "%s\nGod says...\n$$RED$$%s$$FG$$\n",tempde->full_name,st2; + Free(st); + } + } + tempde=tempde->next; + } + DirTreeDel(tempde1); +} + +U8 *GodVideoRead(U8 *filename,I64 line) +{ + U8 *res=NULL; + CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR); + if (DocLineNumGoTo(doc,line-1) && doc->cur_entry->type_u8==DOCT_TEXT) + res=StrNew(doc->cur_entry->tag); + DocDel(doc); + return res; +} + +U8 *GodVideoWrite(U8 *filename,I64 line,U8 *st) +{ + U8 *res=NULL; + CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR); + if (DocLineNumGoTo(doc,line-1)) { + if (doc->cur_entry->type_u8==DOCT_TEXT) { + Free(doc->cur_entry->tag); + doc->cur_entry->tag=StrNew(st); + } else + DocPrint(doc,"%s",st); + DocTop(doc); + DocWrite(doc); + } + DocDel(doc); + return res; +} + +class CGodVideoForm +{ + U8 title[STR_LEN] fmtstr "$$DA-P,A=\"Title:%s\"$$\n"; + U8 serial[STR_LEN] fmtstr "$$DA-P-TRM,LEN=11,A=\"SerialNum:%11s\"$$\n"; + I64 min fmtstr "$$DA,A=\"Minutes:%d\"$$\n"; + I64 sec fmtstr "$$DA,A=\"Seconds:%d\"$$\n"; +}; + +U0 GodVideo(U8 *title,U8 *webpage,U8 *rnd,I64 digits,U8 *filename) +{ + U8 *st,*st2; + CGodVideoForm *gvf=CAlloc(sizeof(CGodVideoForm)); + I64 i=ExtDecFromHex(rnd,digits); + if (st=GodVideoRead(filename,i*2)) { + StrCpy(gvf->title,st); + Free(st); + if (!(st=GodVideoRead(filename,i*2+1))||!*st) { + Free(st); + if (DocForm(gvf) && *gvf->serial) { + if (gvf->min || gvf->sec) + st=MStrPrint("%s&hl=enUS&start=%d", + gvf->serial,gvf->min*60+gvf->sec); + else + st=StrNew(gvf->serial); + GodVideoWrite(filename,i*2+1,st); + } else + st=NULL; + } + if (StrIMatch("Metallica",filename)) { + st2=URLPlusSpaces(gvf->title+3); + "God's response:\n" + "$$TX,\"%s\",HTML=\"%s\"$$\n" + "$$TX,\"%s (Lyrics)\"," + "HTML=\"http://lmgtfy.com/?q=Metallica+lyrics+%s\"$$\n", + title,webpage,gvf->title,st2; + Free(st2); + } else + "God's response:\n" + "$$TX,\"%s\",HTML=\"%s\"$$\n" + "#%s\n",title,webpage,gvf->title; + if (st) { + "$$HC,\"" + "" + "\"$$\n",st,st; + Free(st); + } + } + Free(gvf); +} + +class CRandExtDec5Form +{ + I64 timestamp; + U8 rnd0[512] fmtstr "$$DA-P,A=\"5 Decimal Digits from Hex:%s\"$$\n"; + U8 rnd1[512]; + U8 rnd2[512]; + U8 rnd3[512]; + I64 cert; +}; + +class CNISTBeaconRandExtDec5Form +{ + I64 timestamp fmtstr "$$DA,A=\"TimeStamp:%d\"$$\n"; + U8 rnd0[512] fmtstr "$$DA-P,A=\"5 Decimal Digits from Hex:%s\"$$\n"; + U8 rnd1[512]; + U8 rnd2[512]; + U8 rnd3[512]; + I64 cert; +}; + +class CHexWordForm +{ + I64 timestamp; + U8 rnd0[512] fmtstr "$$DA-P,A=\"Hex Word Indices#0:%s\"$$\n"; + U8 rnd1[512] fmtstr "$$DA-P,A=\"Hex Word Indices#1:%s\"$$\n"; + U8 rnd2[512] fmtstr "$$DA-P,A=\"Hex Word Indices#2:%s\"$$\n"; + U8 rnd3[512] fmtstr "$$DA-P,A=\"Hex Word Indices#3:%s\"$$\n"; + I64 cert; +}; + +class CNISTBeaconHexWordForm +{ + I64 timestamp fmtstr "$$DA,A=\"TimeStamp:%d\"$$\n"; + U8 rnd0[512] fmtstr "$$DA-P,A=\"Hex Word Indices#0:%s\"$$\n"; + U8 rnd1[512] fmtstr "$$DA-P,A=\"Hex Word Indices#1:%s\"$$\n"; + U8 rnd2[512] fmtstr "$$DA-P,A=\"Hex Word Indices#2:%s\"$$\n"; + U8 rnd3[512] fmtstr "$$DA-P,A=\"Hex Word Indices#3:%s\"$$\n"; + I64 cert; +}; + +class CRandHex5Form +{ + I64 timestamp; + U8 rnd0[512] fmtstr "$$DA-P-TRM,LEN=5," + "A=\"Line (5-Digit Hex):%5s\"$$\n"; + U8 rnd1[512]; + U8 rnd2[512]; + U8 rnd3[512]; + I64 cert; +}; + +class CNISTBeaconRandHex5Form +{ + I64 timestamp fmtstr "$$DA,A=\"TimeStamp:%d\"$$\n"; + U8 rnd0[512] fmtstr "$$DA-P-TRM,LEN=5," + "A=\"Line (5-Digit Hex):%5s\"$$\n"; + U8 rnd1[512]; + U8 rnd2[512]; + U8 rnd3[512]; + I64 cert; +}; + +class CRandHex8Form +{ + I64 timestamp; + U8 rnd0[512] fmtstr "$$DA-P-TRM,LEN=8," + "A=\"Line (8-Digit Hex):%8s\"$$\n"; + U8 rnd1[512]; + U8 rnd2[512]; + U8 rnd3[512]; + I64 cert; +}; + +class CNISTBeaconRandHex8Form +{ + I64 timestamp fmtstr "$$DA,A=\"TimeStamp:%d\"$$\n"; + U8 rnd0[512] fmtstr "$$DA-P-TRM,LEN=8," + "A=\"Line (8-Digit Hex):%8s\"$$\n"; + U8 rnd1[512]; + U8 rnd2[512]; + U8 rnd3[512]; + I64 cert; +}; + +class CMoviesForm +{ + I64 timestamp; + U8 rnd0[512] fmtstr "$$DA-P," + "A=\"Movie #1-100 (2 Decimal Digits from Hex):%s\"$$\n"; + U8 rnd1[512]; + U8 rnd2[512]; + U8 rnd3[512]; + I64 cert; +}; + +class CNISTMoviesForm +{ + I64 timestamp fmtstr "$$DA,A=\"TimeStamp:%d\"$$\n"; + U8 rnd0[512] fmtstr "$$DA-P," + "A=\"Movie #1-100 (2 Decimal Digits from Hex):%s\"$$\n"; + U8 rnd1[512]; + U8 rnd2[512]; + U8 rnd3[512]; + I64 cert; +}; + +class CMetallicaForm +{ + I64 timestamp; + U8 rnd0[512] fmtstr "$$DA-P," + "A=\"Song #1-99 (2 Decimal Digits from Hex):%s\"$$\n"; + U8 rnd1[512]; + U8 rnd2[512]; + U8 rnd3[512]; + I64 cert; +}; + +class CNISTMetallicaForm +{ + I64 timestamp fmtstr "$$DA,A=\"TimeStamp:%d\"$$\n"; + U8 rnd0[512] fmtstr "$$DA-P," + "A=\"Song #1-99 (2 Decimal Digits from Hex):%s\"$$\n"; + U8 rnd1[512]; + U8 rnd2[512]; + U8 rnd3[512]; + I64 cert; +}; + +class CCertRandDec5Form +{ + I64 timestamp; + U8 rnd0[512] fmtstr "$$DA-P,A=\"Line (Dec):%s\"$$\n"; + U8 rnd1[512]; + U8 rnd2[512]; + U8 rnd3[512]; + I64 cert fmtstr "$$DA,A=\"Certificate:%d\"$$\n"; +}; + +U0 GodWordBatch(CHexWordForm *url) +{ + I64 i=0; + CDirEntry *tempde,*tempde1; + + FifoU8Flush(god.fifo); + GodHexIns(url->rnd0); + GodHexIns(url->rnd1); + GodHexIns(url->rnd2); + GodHexIns(url->rnd3); + tempde=tempde1=FilesFind(god.word_file_mask,god.word_fuf_flags); + while (tempde) { + PutFileLink(tempde->full_name); + '\n'; + tempde=tempde->next; + } + DirTreeDel(tempde1); + + "\n$$RED$$"; + if (*url->rnd0) + "%s\n",url->rnd0; + if (*url->rnd1) + "%s\n",url->rnd1; + if (*url->rnd2) + "%s\n",url->rnd2; + if (*url->rnd3) + "%s\n",url->rnd3; + '\n'; + while (FifoU8Cnt(god.fifo)>20) { + GodBits(3); + "%02d: ",i++; + GodWord(TRUE); + } + FifoU8Flush(god.fifo); + "$$FG$$\n"; +} + +#define NIST_TIME_OFFSET (-7998-local_time_offset/CDATE_FREQ) +#define NIST_TIME_TO_SWITCH 3 + +public U0 NISTSync() +{ + I64 i,j; + CDate d; + CDateStruct ds; + while (!ScanChar) { + d=Now; + Date2Struct(&ds,d); + i=ToI64((d-Str2Date("1/1/1970"))/CDATE_FREQ+NIST_TIME_OFFSET); + j=FloorI64(i,60); + "%d %d %02d %02d\n",i,j,ds.sec,(60+ds.sec-(i-j))%60; + Sleep(100); + } +} + +U0 NISTBeaconURL(I64 timestamp) +{ + U8 *tag; + CDateStruct ds; + CDate dt=(timestamp-NIST_TIME_OFFSET)*CDATE_FREQ+Str2Date("1/1/1970"); + Date2Struct(&ds,dt+local_time_offset); + "$$TX,\"NIST Beacon Date:%D Time:%02d:%02d Unix TimeStamp:%u\"," + "HTML=\"https://beacon.nist.gov/home\"$$\n",dt,ds.hour,ds.min,timestamp; + tag=MStrPrint("https:/beacon.nist.gov/rest/record/%d",timestamp); + "$$TX,\"NIST Beacon Record:%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag; + Free(tag); +} + + +U0 GodMisc() +{ + U8 *st,*tag; + CRandExtDec5Form *gm=CAlloc(sizeof(CRandExtDec5Form)); + I64 i=PopUpPickLst("NISTBeacon\0HotBits\0Random.org\0RandomNumbers.info\0" + "ANU_NIST\0Password\0GenerateData\0VirtualNotary\0Timer\0"); + if (i>=0) { + "$$TX,\"Guidelines for Talking with God.\"," + "HTML=\"http://www.templeos.org/Wb/Adam/God/HSNotes.html\"$$\n"; + switch (i) { + case: + gm->timestamp=FloorI64((Now-Str2Date("1/1/1970"))/CDATE_FREQ+ + NIST_TIME_OFFSET-NIST_TIME_TO_SWITCH,60); + switch (PopUpPickLst("ExtDec5Bible\0HexWordBatch\0Hex5Bible\0" + "Hex8Books\0Movie\0Metallica\0")) { + case: + if (DocForm(gm(CNISTBeaconRandExtDec5Form *))) { + NISTBeaconURL(gm->timestamp); + TOSBibleLines(gm->rnd0,20,-5,FALSE,FALSE); + } + break; + case: + if (DocForm(gm(CNISTBeaconHexWordForm *))) { + NISTBeaconURL(gm->timestamp); + GodWordBatch(gm); + } + break; + case: + if (DocForm(gm(CNISTBeaconRandHex5Form *))) { + "$$TX,\"How this random Bible passage was chosen.\"," + "HTML=\"http://www.templeos.org/Wb" + "/Home/Web/TAD/NISTPassage.html\"$$\n"; + NISTBeaconURL(gm->timestamp); + TOSBibleLines(gm->rnd0,20,16,TRUE,TRUE); + } + break; + case: + if (DocForm(gm(CNISTBeaconRandHex8Form *))) { + "$$TX,\"How this random book pick was chosen.\"," + "HTML=\"http://www.templeos.org/Wb" + "/Home/Web/TAD/NISTPick001.html\"$$\n"; + NISTBeaconURL(gm->timestamp); + GodBooksPassage("C:/Home/Sup1/Sup1Texts/*",, + Str2I64(gm->rnd0,16),GBP_MEDIUM); + } + break; + case: + if (DocForm(gm(CNISTMoviesForm *))) { + NISTBeaconURL(gm->timestamp); + GodVideo("Top 100 Movies", + "http://www.afi.com/100years/movies10.aspx", + gm->rnd0,2,"C:/Home/Sup1/Sup1Blog/Movies.DD.Z"); + } + break; + case: + if (DocForm(gm(CNISTMetallicaForm *))) { + NISTBeaconURL(gm->timestamp); + GodVideo("Metallica Song", + "http://home.hccnet.nl/a.r.adams/lyrics/" + "metallica/songindex.html", + gm->rnd0,2,"C:/Home/Sup1/Sup1Blog/Metallica.DD.Z"); + } + break; + } + break; + start: + case: + tag="https://www.fourmilab.ch/hotbits/secure_generate.html"; + break; + case: + tag="http://www.random.org"; + break; + case: + tag="http://www.randomnumbers.info"; + break; + case: + tag="http://qrng.anu.edu.au/NIST.php"; + break; + case: + tag="https://passed.pw"; + break; + case: + tag="http://www.generatedata.com"; + break; + end: + "$$TX,\"%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag; + switch (PopUpPickLst("ExtDec5Bible\0HexWordBatch\0Hex5Bible\0" + "Hex8Books\0Movie\0Metallica\0")) { + case: + if (DocForm(gm(CRandExtDec5Form *))) + TOSBibleLines(gm->rnd0,20,-5,FALSE,FALSE); + break; + case: + if (DocForm(gm(CHexWordForm *))) + GodWordBatch(gm); + break; + case: + if (DocForm(gm(CRandHex5Form *))) { + "$$TX,\"How this random Bible passage was chosen.\"," + "HTML=\"http://www.templeos.org/Wb" + "/Home/Web/TAD/Passage.html\"$$\n"; + TOSBibleLines(gm->rnd0,20,16,TRUE,TRUE); + } + break; + case: + if (DocForm(gm(CRandHex8Form *))) { + "$$TX,\"How this random book pick was chosen.\"," + "HTML=\"http://www.templeos.org/Wb" + "/Home/Web/TAD/Pick001.html\"$$\n"; + GodBooksPassage("C:/Home/Sup1/Sup1Texts/*",, + Str2I64(gm->rnd0,16),GBP_MEDIUM); + } + break; + case: + if (DocForm(gm(CMoviesForm *))) + GodVideo("Top 100 Movies", + "http://www.afi.com/100years/movies10.aspx", + gm->rnd0,2,"C:/Home/Sup1/Sup1Blog/Movies.DD.Z"); + break; + case: + if (DocForm(gm(CMetallicaForm *))) + GodVideo("Metallica Song", + "http://home.hccnet.nl/a.r.adams/lyrics/" + "metallica/songindex.html", + gm->rnd0,2,"C:/Home/Sup1/Sup1Blog/Metallica.DD.Z"); + break; + } + break; + case: + if (DocForm(gm(CCertRandDec5Form *))) { + tag="http://virtual-notary.org"; + "$$TX,\"%$$Q\",HTML=\"%$$Q\"$$\n",tag,tag; + tag="Here is the certificate"; + st=MStrPrint("http://www.templeos.org/Certs/virtual-notary-cert" + "-randomnum-%d.p12",gm->cert); + "\n$$TX,\"%$$Q: %d\",HTML=\"%$$Q\"$$.\n",tag,gm->cert,st; + Free(st); + TOSBibleLines(gm->rnd0,20,-5,FALSE,FALSE); + } + break; + case: + FifoU8Flush(god.fifo); + GodBitsIns(GOD_GOOD_BITS,KbdMouseEvtTime>>GOD_BAD_BITS); + GodBooksPassage("C:/Home/Sup1/Sup1Texts/*"); + break; + } + } + Free(gm); +} + +U8 *YouTubeGet(U8 *filename="C:/Home/Sup1/Sup1Blog/YouTube.DD.Z",U8 *needle) +{ + I64 i=0,line=MIN_I64; + CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR), + *doc2=DocNew; + U8 *title,*code,*res; + while (DocFind(doc,line,needle)) { + if (!(doc->cur_entry->y&1)) { + title=doc->cur_entry->tag; + DocLineNumGoTo(doc,doc->cur_entry->y+2); + if (doc->cur_entry->type_u8==DOCT_TEXT) { + code=doc->cur_entry->tag; + DocPrint(doc2,"$$MU-UL,\"%s\",LE=0x%X$$\n",title,code); + i++; + } + } + line=doc->cur_entry->y+2; + } + switch (i) { + case 0: + res=NULL; + break; + case 1: + res=StrNew(code); + break; + default: + res=PopUpMenu(doc2); + if (res==DOCM_CANCEL) + res=NULL; + else + res=StrNew(res); + } + DocDel(doc); + DocDel(doc2); + return res; +} + +U0 YouTubeAdd(U8 *filename="C:/Home/Sup1/Sup1Blog/YouTube.DD.Z", + U8 *title,U8 *code) +{ + CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR); + if (!DocFind(doc,,title)) { + DocBottom(doc); + DocPrint(doc,"%s\n%s\n",title,code); + DocTop(doc); + DocWrite(doc); + Sort(filename,,2); + } + DocDel(doc); +} + +U8 *WebBookMarks(U8 *filename="~/Sup1/Sup1Blog/Bookmarks.html") +{ + U8 *st; + CDocEntry *doc_e; + CDoc *doc=DocNew; + CCmpCtrl *cc=CmpCtrlNew(MStrPrint("#include \"%s\"",filename)); + while (Lex(cc)) + if (cc->token==TK_STR && *cc->cur_str(U32 *)=='http') { + DocPrint(doc,"$$MU-UL,\"%$$Q\",LE=0x%X$$\n",cc->cur_str,cc->cur_str); + cc->cur_str=NULL; + } + CmpCtrlDel(cc); + + if ((st=PopUpMenu(doc))!=DOCM_CANCEL) + st=StrNew(st); + else + st=NULL; + + doc_e=doc->head.next; + while (doc_e!=doc) { + if (doc_e->type_u8==DOCT_MENU_VAL) + Free(doc_e->left_exp); + doc_e=doc_e->next; + } + DocDel(doc); + + return st; +} + +class CWebBibleForm +{ + U8 tag[STR_LEN] fmtstr "$$DA-P,A=\"Tag Text:%s\"$$\n"; + U8 special[STR_LEN] fmtstr "$$DA-P,A=\"Bible Passage:%s\"$$\n"; + I64 min; + I64 sec; +}; + +class CYouTubeForm +{ + U8 tag[STR_LEN] fmtstr "$$DA-P,A=\"Title:%s\"$$\n"; + U8 special[STR_LEN] fmtstr "$$DA-P-TRM,LEN=11,A=\"SerialNum:%11s\"$$\n"; + I64 min fmtstr "$$DA,A=\"Minutes:%d\"$$\n"; + I64 sec fmtstr "$$DA,A=\"Seconds:%d\"$$\n"; +}; + +class CImgurForm +{ + U8 tag[STR_LEN]; + U8 special[STR_LEN] fmtstr "$$DA-P,A=\"SerialNum:%s\"$$\n"; + I64 min fmtstr "$$DA,A=\"Width :%d\"$$\n"; + I64 sec fmtstr "$$DA,A=\"Height :%d\"$$\n"; +}; + +class CWikipediaForm +{ + U8 tag[STR_LEN] fmtstr "$$DA-P,A=\"Tag Text:%s\"$$\n"; + U8 special[STR_LEN] fmtstr "$$DA-P,A=\"Index :%s\"$$\n"; + I64 min; + I64 sec; +}; + +class CWebBookMarkForm +{ + U8 tag[STR_LEN] fmtstr "$$DA-P,A=\"Tag Text:%s\"$$\n"; + U8 special[STR_LEN]; + I64 min; + I64 sec; +}; + +U0 TOSInsMisc() +{ + CWebBibleForm *url=CAlloc(sizeof(CWebBibleForm)); + U8 *tag,*st,*st2; + + switch (PopUpPickLst("BiblePassage\0BibleVerse\0" + "YouTube\0Imgur\0Wikipedia\0WebBookMark\0")) { + case: + if (DocForm(url(CWebBibleForm *))) { + tag=url->special; + st2=URLPercentSpaces(url->special); + st=MStrPrint("http://www.biblegateway.com/passage/" + "?search=%s&version=NIV",st2); + Free(st2); + if (*url->tag) + tag=url->tag; + "$$TX,\"%$$Q\",HTML=\"%$$Q\"$$",tag,st; + Free(st); + } + break; + case: + if (DocForm(url(CWebBibleForm *))) { + tag=url->special; + st2=URLPercentSpaces(url->special); + st=MStrPrint( + "http://www.biblegateway.com/verse/en/%s",st2); + Free(st2); + if (*url->tag) + tag=url->tag; + "$$TX,\"%$$Q\",HTML=\"%$$Q\"$$",tag,st; + Free(st); + } + break; + case: + if (DocForm(url(CYouTubeForm *))) { + if (*url->special==CH_SPACE) + st2=YouTubeGet(,url->tag); + else + st2=StrNew(url->special); + if (st2 && *st2!=CH_SPACE) { + if (url->min || url->sec) + st=MStrPrint("%s&hl=enUS&start=%d",st2,url->min*60+url->sec); + else + st=StrNew(st2); + if (*url->special!=CH_SPACE && *url->tag) + YouTubeAdd(,url->tag,st); + "$$HC,\"" + "\"$$\n",st,st; + Free(st); + Free(st2); + } + } + break; + case: + if (DocForm(url(CImgurForm *))) { + "$$HC,\"
\"$$\n", + url->special,url->min,url->sec; + } + break; + case: + if (DocForm(url(CWikipediaForm *))) { + tag=url->special; + st=MStrPrint("http://en.wikipedia.org/wiki/%s",url->special); + if (*url->tag) + tag=url->tag; + "$$TX,\"%$$Q\",HTML=\"%$$Q\"$$",tag,st; + Free(st); + } + break; + case: + if (DocForm(url(CWebBookMarkForm *))) { + tag=st=WebBookMarks; + if (*url->tag) + tag=url->tag; + "$$TX,\"%$$Q\",HTML=\"%$$Q\"$$",tag,st; + Free(st); + } + break; + } + Free(url); +} + +U0 GodCodeJmp() +{//$LK,"::/Adam/God/HSNotes.DD"$ + CDirEntry *tempde1=FilesFind("/*", + FUF_JUST_FILES|FUF_RECURSE|FUF_JUST_SRC|FUF_CLUSTER_ORDER), + *tempde=tempde1; + I64 cnt=0,num; + CDoc *doc; + U8 *st; + while (tempde) { + doc=DocRead(tempde->full_name); + tempde->user_data=doc->head.y; + cnt+=doc->head.y; + DocDel(doc); + tempde=tempde->next; + } + + FifoU8Flush(god.fifo); + GodBitsIns(GOD_GOOD_BITS,KbdMouseEvtTime>>GOD_BAD_BITS); + num=GodBits(GOD_GOOD_BITS)%cnt; + + tempde=tempde1; + while (tempde) { + num-=tempde->user_data; + if (num<0) { + st=MStrPrint("FL:%s,%d",tempde->full_name,-num); + break; + } + tempde=tempde->next; + } + DirTreeDel(tempde1); + Ed(st); + Free(st); +} + +if (FileFind("~/Sup1/Sup1Words/LinuxDict.TXT")) + GodInit("~/Sup1/Sup1Words/LinuxDict.TXT"); +//if (FileFind("~/Sup1/Sup1Words/HappyWords.TXT")) +// GodInit("~/Sup1/Sup1Words/HappyWords.TXT"); diff --git a/Demo/AcctExample/TOSMisc.CPP b/Demo/AcctExample/TOSMisc.CPP deleted file mode 100644 index 837fc11..0000000 --- a/Demo/AcctExample/TOSMisc.CPP +++ /dev/null @@ -1,324 +0,0 @@ -#help_index "TOS" - -public U0 CursorRemFile(U8 *filename) -{ - CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR); - DocWrite(doc); - DocDel(doc); -} -public U0 CursorRem(U8 *files_find_mask="*") -{ - I64 fuf_flags=0; - ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+T+f+F+O"); - CDirEntry *tempde=FilesFind(files_find_mask,fuf_flags),*tempde1=tempde; - while (tempde) { - CursorRemFile(tempde->full_name); - Touch(tempde->full_name,"",,tempde->datetime); - tempde=tempde->next; - } - DirTreeDel(tempde1); -} - -U0 UncollapseFile(U8 *filename,I64 *) -{ - CDoc *doc=DocRead(filename,DOCF_NO_CURSOR); - DocCollapse(FALSE,doc); - DocWrite(doc); - DocDel(doc); -} -public U0 Uncollapse(U8 *files_find_mask="*",U8 *fu_flags=NULL) -{ - I64 fuf_flags=0; - ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+T+O"); - ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); - CDirEntry *tempde=FilesFind(files_find_mask,fuf_flags),*tempde1=tempde; - while (tempde && !Bt(&fuf_flags,FUf_CANCEL)) { - UncollapseFile(tempde->full_name,&fuf_flags); - Touch(tempde->full_name,"",,tempde->datetime); - tempde=tempde->next; - } - DirTreeDel(tempde1); -} - -#define VIDEO_FRAME_RATE 8 - -#define FG_JUST_AUDIO 0 -#define FG_BOOT_DRV 1 -#define FG_RAM_DRV 2 -I64 fg_mode=FG_RAM_DRV; -Bool fg_on =FALSE; - -U0 FrameGrabberTask(I64) -{//#!/bin/bash -//for f in ./ScreenShots/*.Z; do ./Bin/TOSZ $$f; done - //ffmpeg -r 8 -i VID%05d.BMP -y Movie.avi - I64 frame_num=0; - U8 buf[STR_LEN],buf2[STR_LEN],*st_dir; - F64 end_time=tS; - Silent; //no output to screen - if (fg_mode==FG_RAM_DRV) - st_dir="B:/Temp/ScreenShots"; - else - st_dir="::/Temp/ScreenShots"; - MkDir(st_dir); - while (fg_on) { - StrPrint(buf,"%s/VID%05d.BMP.Z",st_dir,frame_num++); - StrCpy(buf2,buf); - BMPScreenCapture(buf); - while (TRUE) { - end_time+=1.0/VIDEO_FRAME_RATE; - if (end_time3.0) { - last_time=tS; - if (fg_on) { - fg_on=FALSE; - Snd(0); - wall->record=snd.record=FALSE; - Sleep(1000); - User("CopyVideo;Exit;\n"); - } else { - fg_on=TRUE; - if (fg_mode!=FG_JUST_AUDIO) - Spawn(&FrameGrabberTask,NULL,"Frame Grabber"); - wall->record=snd.record=TRUE; - Snd(0); - } - } -} - -public U0 JukeSong(I64 num) -{ - AutoComplete; - if (!fg_on) - FrameGrabberToggle; - JukeSongsPuppet("~/Sup1/Sup1Psalmody",,num,num+1); - if (fg_on) - FrameGrabberToggle; -} - -public U0 JukeLines(I64 start_line,I64 end_line) -{ - AutoComplete; - if (!fg_on) - FrameGrabberToggle; - JukeSongsPuppet("~/Sup1/Sup1Psalmody",,start_line*5,end_line*5); - if (fg_on) - FrameGrabberToggle; -} - -public U0 ChkAll() -{ - U8 *ptr=TOS_HDS; - while (*ptr) - ChkDsk(*ptr++); -} - -public CDoc *DC2Doc(CDC *dc,I64 dx=0,I64 dy=0,I64 *_total_score=NULL) -{ - U8 byte_bit_cnts[256]; - I64 i,j,*ptr,row,col,ch,best_ch,score,best_score, - cur_char_image,diff_image,total_score=0; - CDoc *doc=DocNew; - - MemSet(byte_bit_cnts,0,sizeof(byte_bit_cnts)); - for (i=0;i<256;i++) - for (j=0;j<7;j++) - if (Bt(&i,j)) - byte_bit_cnts[i]++; - - for (row=0;rowheight/FONT_HEIGHT;row++) { - for (col=0;colwidth/FONT_WIDTH;col++) { - - cur_char_image=0; - for (i=0;ifilename.name,out_name); - DocWrite(doc); - } - DocDel(doc); - } - } - Free(in_name); - Free(out_name); -} - -RegSetDftEntry("TempleOS/TOS", - "I64 tos_code_walk_thru=1,tos_after_egypt_in_action=1;\n"); -RegExeBranch("TempleOS/TOS"); - -U0 TOSRegInit() -{ - DefinePrint("DD_CODE_WALK_THRU","Episode #%d",tos_code_walk_thru); - DefinePrint("DD_AFTER_EGYPT_IN_ACTION","Episode #%d", - tos_after_egypt_in_action); -} TOSRegInit; - -U0 TOSRegWrite() -{ - RegWriteBranch("TempleOS/TOS", - "I64 tos_code_walk_thru=%d,tos_after_egypt_in_action=%d;\n", - tos_code_walk_thru,tos_after_egypt_in_action); - TOSRegInit; -} - -class CYouTubeForm2 -{ - U8 special[STR_LEN] fmtstr "$$DA-P,A=\"SerialNum:%s\"$$\n"; -}; - -U8 *TOSYouTube() -{ - U8 *res; - CYouTubeForm2 *url=CAlloc(sizeof(CYouTubeForm2)); - if (DocForm(url(CYouTubeForm2 *)) && *url->special) - res=MStrPrint("$$HC,\"" - "\"$$", - url->special,url->special); - else - res=NULL; - Free(url); - return res; -} - -U0 AfterEgyptInAction() -{ - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - Adam("GodInit(\"/Adam/God/Vocab.TXT*\");"); - AutoComplete; - WinBorder; - WinMax; - if (!fg_on) - PopUp("Sleep(50);FrameGrabberToggle;"); - Ed("~/Videos/AfterEgypt.TXT.Z"); - Msg(MSG_KEY_DOWN_UP,CH_SPACE,0x3900000039); // - ExeFile("::/Apps/AfterEgypt/Run"); - SettingsPop; - tos_after_egypt_in_action++; - TOSRegWrite; -} - -U0 CodeWalkThru() -{ - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - AutoComplete; - WinBorder; - WinMax; - if (!fg_on) - PopUp("Sleep(50);FrameGrabberToggle;"); - Ed("~/Videos/RandomCode.TXT.Z"); - SettingsPop; - Msg(MSG_KEY_DOWN_UP,'b',0x83000000830); // - tos_code_walk_thru++; - TOSRegWrite; -} - -U0 TempleOSTheme() -{ - if (!fg_on) - PopUp("Sleep(50);FrameGrabberToggle;"); - ExeFile("~/Sup1/Sup1Graphics/TempleOSTheme.CPP"); - DocClear; -} - -U0 TOSJukeVideo(I64 start=0,I64 end=10) -{ - U8 *buf=FileRead("::/Misc/Bible.TXT.Z"); //Put in cache - Free(buf); - AutoComplete; - FrameGrabberToggle; - JukeSongsPuppet("~/Sup1/Sup1Psalmody",,start,end); - FrameGrabberToggle; -} - -#define MEM_TEST_SIZE 128*0x100000 -U0 MemTest() -{ - while (sys_data_bp->alloced_u8s-sys_data_bp->used_u8s>MEM_TEST_SIZE*2) { - MemSet(MAlloc(MEM_TEST_SIZE),0x88,MEM_TEST_SIZE); - "%X\n",sys_data_bp->alloced_u8s-sys_data_bp->used_u8s; - Yield; - } -} diff --git a/Demo/AcctExample/TOSMisc.HC b/Demo/AcctExample/TOSMisc.HC new file mode 100644 index 0000000..b665523 --- /dev/null +++ b/Demo/AcctExample/TOSMisc.HC @@ -0,0 +1,324 @@ +#help_index "TOS" + +public U0 CursorRemFile(U8 *filename) +{ + CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR); + DocWrite(doc); + DocDel(doc); +} +public U0 CursorRem(U8 *files_find_mask="*") +{ + I64 fuf_flags=0; + ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+T+f+F+O"); + CDirEntry *tempde=FilesFind(files_find_mask,fuf_flags),*tempde1=tempde; + while (tempde) { + CursorRemFile(tempde->full_name); + Touch(tempde->full_name,"",,tempde->datetime); + tempde=tempde->next; + } + DirTreeDel(tempde1); +} + +U0 UncollapseFile(U8 *filename,I64 *) +{ + CDoc *doc=DocRead(filename,DOCF_NO_CURSOR); + DocCollapse(FALSE,doc); + DocWrite(doc); + DocDel(doc); +} +public U0 Uncollapse(U8 *files_find_mask="*",U8 *fu_flags=NULL) +{ + I64 fuf_flags=0; + ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+T+O"); + ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); + CDirEntry *tempde=FilesFind(files_find_mask,fuf_flags),*tempde1=tempde; + while (tempde && !Bt(&fuf_flags,FUf_CANCEL)) { + UncollapseFile(tempde->full_name,&fuf_flags); + Touch(tempde->full_name,"",,tempde->datetime); + tempde=tempde->next; + } + DirTreeDel(tempde1); +} + +#define VIDEO_FRAME_RATE 30 + +#define FG_JUST_AUDIO 0 +#define FG_BOOT_DRV 1 +#define FG_RAM_DRV 2 +I64 fg_mode=FG_RAM_DRV; +Bool fg_on =FALSE; + +U0 FrameGrabberTask(I64) +{//#!/bin/bash +//for f in ./ScreenShots/*.Z; do ./Bin/TOSZ $$f; done + //ffmpeg -r 8 -i VID%05d.BMP -y Movie.avi + I64 frame_num=0; + U8 buf[STR_LEN],buf2[STR_LEN],*st_dir; + F64 end_time=tS; + Silent; //no output to screen + if (fg_mode==FG_RAM_DRV) + st_dir="B:/Temp/ScreenShots"; + else + st_dir="::/Temp/ScreenShots"; + MkDir(st_dir); + while (fg_on) { + StrPrint(buf,"%s/VID%05d.BMP.Z",st_dir,frame_num++); + StrCpy(buf2,buf); + BMPScreenCapture(buf); + while (TRUE) { + end_time+=1.0/VIDEO_FRAME_RATE; + if (end_time3.0) { + last_time=tS; + if (fg_on) { + fg_on=FALSE; + Snd(0); + wall->record=snd.record=FALSE; + Sleep(1000); + User("CopyVideo;Exit;\n"); + } else { + fg_on=TRUE; + if (fg_mode!=FG_JUST_AUDIO) + Spawn(&FrameGrabberTask,NULL,"Frame Grabber"); + wall->record=snd.record=TRUE; + Snd(0); + } + } +} + +public U0 JukeSong(I64 num) +{ + AutoComplete; + if (!fg_on) + FrameGrabberToggle; + JukeSongsPuppet("~/Sup1/Sup1Psalmody",,num,num+1); + if (fg_on) + FrameGrabberToggle; +} + +public U0 JukeLines(I64 start_line,I64 end_line) +{ + AutoComplete; + if (!fg_on) + FrameGrabberToggle; + JukeSongsPuppet("~/Sup1/Sup1Psalmody",,start_line*5,end_line*5); + if (fg_on) + FrameGrabberToggle; +} + +public U0 ChkAll() +{ + U8 *ptr=TOS_HDS; + while (*ptr) + ChkDsk(*ptr++); +} + +public CDoc *DC2Doc(CDC *dc,I64 dx=0,I64 dy=0,I64 *_total_score=NULL) +{ + U8 byte_bit_cnts[256]; + I64 i,j,*ptr,row,col,ch,best_ch,score,best_score, + cur_char_image,diff_image,total_score=0; + CDoc *doc=DocNew; + + MemSet(byte_bit_cnts,0,sizeof(byte_bit_cnts)); + for (i=0;i<256;i++) + for (j=0;j<7;j++) + if (Bt(&i,j)) + byte_bit_cnts[i]++; + + for (row=0;rowheight/FONT_HEIGHT;row++) { + for (col=0;colwidth/FONT_WIDTH;col++) { + + cur_char_image=0; + for (i=0;ifilename.name,out_name); + DocWrite(doc); + } + DocDel(doc); + } + } + Free(in_name); + Free(out_name); +} + +RegSetDftEntry("TempleOS/TOS", + "I64 tos_code_walk_thru=1,tos_after_egypt_in_action=1;\n"); +RegExeBranch("TempleOS/TOS"); + +U0 TOSRegInit() +{ + DefinePrint("DD_CODE_WALK_THRU","Episode #%d",tos_code_walk_thru); + DefinePrint("DD_AFTER_EGYPT_IN_ACTION","Episode #%d", + tos_after_egypt_in_action); +} TOSRegInit; + +U0 TOSRegWrite() +{ + RegWriteBranch("TempleOS/TOS", + "I64 tos_code_walk_thru=%d,tos_after_egypt_in_action=%d;\n", + tos_code_walk_thru,tos_after_egypt_in_action); + TOSRegInit; +} + +class CYouTubeForm2 +{ + U8 special[STR_LEN] fmtstr "$$DA-P,A=\"SerialNum:%s\"$$\n"; +}; + +U8 *TOSYouTube() +{ + U8 *res; + CYouTubeForm2 *url=CAlloc(sizeof(CYouTubeForm2)); + if (DocForm(url(CYouTubeForm2 *)) && *url->special) + res=MStrPrint("$$HC,\"" + "\"$$", + url->special,url->special); + else + res=NULL; + Free(url); + return res; +} + +U0 AfterEgyptInAction() +{ + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + Adam("GodInit(\"/Adam/God/Vocab.DD*\");"); + AutoComplete; + WinBorder; + WinMax; + if (!fg_on) + PopUp("Sleep(50);FrameGrabberToggle;"); + Ed("~/Videos/AfterEgypt.DD.Z"); + Msg(MSG_KEY_DOWN_UP,CH_SPACE,0x3900000039); // + ExeFile("::/Apps/AfterEgypt/Run"); + SettingsPop; + tos_after_egypt_in_action++; + TOSRegWrite; +} + +U0 CodeWalkThru() +{ + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + AutoComplete; + WinBorder; + WinMax; + if (!fg_on) + PopUp("Sleep(50);FrameGrabberToggle;"); + Ed("~/Videos/RandomCode.DD.Z"); + SettingsPop; + Msg(MSG_KEY_DOWN_UP,'b',0x83000000830); // + tos_code_walk_thru++; + TOSRegWrite; +} + +U0 TempleOSTheme() +{ + if (!fg_on) + PopUp("Sleep(50);FrameGrabberToggle;"); + ExeFile("~/Sup1/Sup1Graphics/TempleOSTheme.HC"); + DocClear; +} + +U0 TOSJukeVideo(I64 start=0,I64 end=10) +{ + U8 *buf=FileRead("::/Misc/Bible.TXT.Z"); //Put in cache + Free(buf); + AutoComplete; + FrameGrabberToggle; + JukeSongsPuppet("~/Sup1/Sup1Psalmody",,start,end); + FrameGrabberToggle; +} + +#define MEM_TEST_SIZE 128*0x100000 +U0 MemTest() +{ + while (sys_data_bp->alloced_u8s-sys_data_bp->used_u8s>MEM_TEST_SIZE*2) { + MemSet(MAlloc(MEM_TEST_SIZE),0x88,MEM_TEST_SIZE); + "%X\n",sys_data_bp->alloced_u8s-sys_data_bp->used_u8s; + Yield; + } +} diff --git a/Demo/AcctExample/TOSToHtml.CPP b/Demo/AcctExample/TOSToHtml.CPP deleted file mode 100644 index 3b62286..0000000 --- a/Demo/AcctExample/TOSToHtml.CPP +++ /dev/null @@ -1,464 +0,0 @@ -//This is a customized version of $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.CPP"$. - -#help_index "DolDoc/Conversion" -//See $LK,"::/Doc/Credits.TXT"$. - -U0 HtmlPutS(CDoc *doc,I64 u32_attr,I64 *_old_u32_attr, - U8 *st,I64 *_col,U8 *style_bitmap=NULL) -{ - U8 *ch,*ptr; - u32_attr&=0xFFFFFF00; - if (u32_attr&DOCET_INVERT) - u32_attr.u8[1]=(u32_attr.u8[1]&15)<<4|u32_attr.u8[1]>>4; - if (u32_attr!=*_old_u32_attr) { - if (!(u32_attr&DOCET_BLINK) && - *_old_u32_attr!=-1 && *_old_u32_attr&DOCET_BLINK) - DocPrint(doc,""); - if (*_old_u32_attr!=-1) - DocPrint(doc,""); - DocPrint(doc,"",u32_attr.u8[1]); - if (u32_attr&DOCET_BLINK && - (*_old_u32_attr==-1 || !(*_old_u32_attr&DOCET_BLINK))) - DocPrint(doc,""); - *_old_u32_attr=u32_attr; - if (style_bitmap) - LBts(style_bitmap,u32_attr.u8[1]); - } - while (ch=*st++) { - switch (ch) { - case '\t': - do { - DocPutKey(doc,CH_SPACE,0); - *_col=*_col+1; - } while (*_col&7); - break; - - start: - case 'ã': ptr="pi"; break; - case 'é': ptr="theta"; break; - case 'è': ptr="phi"; break; - case 'ê': ptr="omega"; break; - case 'ì': ptr="inf"; break; - case 'æ': ptr="u"; break; - end: - DocPrint(doc,ptr); - *_col=*_col+StrLen(ptr); - break; - - start: - case CH_SHIFT_SPACE: ptr=" "; break; - case '&': ptr="&"; break; - case '<': ptr="<"; break; - case '>': ptr=">"; break; - case '"': ptr="""; break; - end: - DocPrint(doc,ptr); - *_col=*_col+1; - break; - - default: - if (CH_SPACE<=ch<0x7F || ch=='\n') - DocPutKey(doc,ch,0); - else - DocPrint(doc,"."); - *_col=*_col+1; - } - } -} - -U8 *TOSLinkCvt2(U8 *filename,I64 line_num) -{// ::/ --> http://www.templeos.org/Wb/ -//Make your own LinkCvt routine - U8 *res=NULL,*st; - if (filename) { - st=ChgExt(filename,"html"); - if (st && StrLen(st)>3 && !StrNCmp(st+1,":/",2)) - res=MStrPrint(PERSONAL_WEB "/%s#l%d",st+3,line_num); - Free(st); - } - return res; -} - -U8 *URLBibleGateway(U8 *src) -{ - U8 buf[STR_LEN],*dst=buf; - if (!MemCmp(src,"BF:",3)) - src+=3; - while (*src) { - if (*src==CH_SPACE || *src==',') - *dst++='+'; - else - *dst++=*src; - src++; - } - *dst=0; - if (StrOcc(buf,'-')) - return MStrPrint( - "http://www.biblegateway.com/passage/?search=%s&version=NIV",buf); - else - return MStrPrint( - "http://www.biblegateway.com/verse/en/%s",buf); -} - -U8 *TOSLinkCvt1(U8 *link_st) -{ - static CDoc *bible=NULL; - static I64 locks=0; - U8 *res=NULL,*filename,*needle; - I64 i,num; - if (link_st) { - switch (i=EdLinkCvt(link_st,&filename,&needle,&num)) { - case LK_FILE_LINE: - case LK_PLAIN_LINE: - case LK_FILE: - res=TOSLinkCvt2(filename,num); - break; - case -1: - case LK_DEF: - case LK_HELP_INDEX: - case LK_DOC: - case LK_DOC_ANCHOR: - case LK_DOC_FIND: - case LK_DOC_LINE: - break; - case LK_BIBLE_FIND: - while (LBts(&locks,0)) - Yield; - if (!bible) - bible=Adam("DocRead(\"%s\");",filename); - if (DocFind(bible,num,needle)) - res=URLBibleGateway(link_st); - LBtr(&locks,0); - break; - default: - if (DocFileEd(i,filename,needle,&num,EDF_UNCOLLAPSE|EDF_BAIL)) - res=TOSLinkCvt2(filename,num); - } - Free(filename); - Free(needle); - } - return res; -} - - -public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL, - U8 *body_footer=NULL,U8 *html_footer=NULL,Bool line_anchors=TRUE, - U8 (*link_cvt)(U8 *link_st)=&TOSLinkCvt1) -{//Cvt $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$doc to HTML file. - CDocEntry *doc_e,*style,*doc_e2; - I64 i,y,old_y=MIN_I64,col,old_u32_attr=-1,old_attr; - U32 *hl,*src; - U8 *st,st_2[2],*link_st,*style_bitmap=CAlloc(256/8); - CBGR48 p[NUM_COLORS]; - GrPaletteGet(p); - CDoc *doc_out=DocNew; - Bool unlock_doc_in=DocLock(doc_in),no_bwd; - - old_attr=doc_in->win_task->text_attr; - doc_in->win_task->text_attr=DOC_ATTR_DFT_TEXT; - - for (i=0xF0;i<=0xFF;i++) - LBts(style_bitmap,i); - - DocRecalc(doc_in,RECALCt_NORMAL|RECALCF_TO_HTML); - - st_2[0]=0; st_2[1]=0; - doc_out->flags|=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR; - - if (!html_header) html_header= - "\n" - "\n" - "\n" - "\n" - "\n"; - if (!body_header) body_header= - "\n" - "
\n";
-  if (!body_footer) body_footer=
-	  "
\n\n"; - if (!html_footer) html_footer= - "\n"; - - DocPrint(doc_out,"%s",html_header); - - DocPrint(doc_out,"\n" - "\n"); - DocPrint(doc_out,"%s",body_header); - - doc_e=doc_in->head.next; - col=doc_e->x; - y=doc_e->y; - while (doc_e!=doc_in) { - if (!(doc_e->de_flags&DOCEF_SKIP)) { - if (y!=old_y && line_anchors) { - DocPrint(doc_out,"",y+1); - old_y=y; - } - while (yy) { - HtmlPutS(doc_out,doc_e->settings.final_u32_attr, - &old_u32_attr,"\n",&col,style_bitmap); - if (++y!=old_y && line_anchors) { - DocPrint(doc_out,"",y+1); - old_y=y; - } - col=0; - } - - no_bwd=TRUE; - doc_e2=doc_e->next; - while (doc_e2!=doc_in && doc_e2->y==doc_e->y) { - if (doc_e2->xx) { - no_bwd=FALSE; - break; - } - doc_e2=doc_e2->next; - } - if (no_bwd) - while (colx) - HtmlPutS(doc_out,doc_e->settings.final_u32_attr, - &old_u32_attr," ",&col,style_bitmap); - - link_st=NULL; - if (doc_e->de_flags&DOCEF_HTML_LINK) - link_st=StrNew(doc_e->html_link); - else if (st=DocEntryLink(doc_in,doc_e)) { - link_st=link_cvt(st); - Free(st); - } - - if (link_st) { - if (old_u32_attr!=-1) { - DocPrint(doc_out,"
"); - old_u32_attr=-1; - } - DocPrint(doc_out,"",link_st); - } - - switch (doc_e->type_u8) { - case DOCT_TEXT: - if (doc_e->de_flags&DOCEF_HIGHLIGHT) { - if (doc_e->last==doc_in) - MemCpy(&doc_e->settings,&doc_in->settings_head, - sizeof(CDocSettings)); - else - MemCpy(&doc_e->settings,&doc_e->last->settings, - sizeof(CDocSettings)); - src=hl=DocHighlight(doc_e,doc_e->tag,StrLen(doc_e->tag), - doc_e->type&0xFF00); - while (*src) { - st_2[0]=*src&0xFF; - HtmlPutS(doc_out,*src++,&old_u32_attr,st_2,&col,style_bitmap); - } - Free(hl); - } else { - if (doc_e->de_flags&DOCEF_CENTER_X && //$BK,1$Nonstandard$BK,0$ - doc_e->settings.final_u32_attr&0xF00==PURPLE<<8) - DocPrint(doc_out,"

"); - HtmlPutS(doc_out,doc_e->settings.final_u32_attr, - &old_u32_attr,doc_e->tag,&col,style_bitmap); - if (doc_e->de_flags&DOCEF_CENTER_X && //$BK,1$Nonstandard$BK,0$ - doc_e->settings.final_u32_attr&0xF00==PURPLE<<8) - DocPrint(doc_out,"

"); - } - break; - case DOCT_TAB: - HtmlPutS(doc_out,doc_e->settings.final_u32_attr, - &old_u32_attr,"\t",&col,style_bitmap); - break; - case DOCT_HTML_CODE: - if (old_u32_attr!=-1) { - DocPrint(doc_out,""); - old_u32_attr=-1; - } - DocPrint(doc_out,"%s",doc_e->tag); - break; - case DOCT_SPRITE: - HtmlPutS(doc_out,doc_e->settings.final_u32_attr, - &old_u32_attr,doc_e->tag,&col,style_bitmap); - HtmlPutS(doc_out,doc_e->settings.final_u32_attr, - &old_u32_attr,"/* Graphics Not Rendered in HTML */", - &col,style_bitmap); - break; - default: - if (doc_e->de_flags&DOCEF_TAG) - HtmlPutS(doc_out,doc_e->settings.final_u32_attr, - &old_u32_attr,doc_e->tag,&col,style_bitmap); - } - if (link_st) { - if (old_u32_attr!=-1) { - DocPrint(doc_out,""); - old_u32_attr=-1; - } - DocPrint(doc_out,"
"); - Free(link_st); - } - } - doc_e=doc_e->next; - } - while (y++y) { - HtmlPutS(doc_out,doc_e->settings.final_u32_attr, - &old_u32_attr,"\n",&col,style_bitmap); - col=0; - } - if (old_u32_attr!=-1) { - if (old_u32_attr&DOCET_BLINK) - DocPrint(doc_out,""); - DocPrint(doc_out,""); - old_u32_attr=-1; - } - DocPrint(doc_out,"%s",body_footer); - DocPrint(doc_out,"%s",html_footer); - - doc_out->cur_entry=style->next; - for (i=0;i<256;i++) - if (Bt(style_bitmap,i)) - DocPrint(doc_out, - ".c%02X{color:#%02x%02x%02x;background-color:#%02x%02x%02x;}\n", - i,p[i&15].r>>8,p[i&15].g>>8,p[i&15].b>>8, - p[i/16].r>>8,p[i/16].g>>8,p[i/16].b>>8); - doc_out->cur_entry=&doc_out->head; - DocRecalc(doc_out); - - doc_in->win_task->text_attr=old_attr; - - if (unlock_doc_in) - DocUnlock(doc_in); - return doc_out; -} - -#help_index "Cmd Line (Typically);DolDoc/Conversion;DolDoc/Cmd Line (Typically)" -public U0 TOSToHtml(U8 *_in_name,U8 *_out_name=NULL,U8 *html_header=NULL, - U8 *body_header=NULL,U8 *body_footer=NULL,U8 *html_footer=NULL, - I64 width=80,Bool line_anchors=TRUE, - U8 (*link_cvt)(U8 *link_st)=&TOSLinkCvt1) -{//Convert $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$file to HTML. -//Supply your own link_cvt routine. - U8 *in_name,*out_name; - CDoc *doc_in,*doc_out; - - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - WinHorz(0,width-1); //Sets doc width for word wrap. - - in_name=DftExt(_in_name,"CPP.Z"); - if (_out_name) - out_name=DftExt(_out_name,"html"); - else - out_name=ChgExt(_in_name,"html"); - - doc_in=DocRead(in_name); - DocTop(doc_in); - DocPrint(doc_in,"$$BD,LTCYAN$$"); //$BK,1$Nonstandard$BK,0$ - doc_out=Doc2Html(doc_in,html_header,body_header,body_footer,html_footer, - line_anchors,link_cvt); - StrCpy(&doc_out->filename.name,out_name); - - SettingsPop; - - DocWrite(doc_out); - DocDel(doc_in); - DocDel(doc_out); - Free(in_name); - Free(out_name); -} - -#help_index "TOS" -U0 TOSWebFile(U8 *name) -{ - U8 *name2; - CDirEntry de; - Bool line_anchors; - if (FileFind(name,&de)) { - Free(de.full_name); - "File:%s\n",name; - UncollapseFile(name,NULL); - Touch(name,"",,de.datetime); - name2=ChgExt(name,"html"); - - if (StrMatch(BLOG_BASE,name) || StrMatch(DAILY_BASE,name)) - line_anchors=FALSE; - else - line_anchors=TRUE; - - TOSToHtml(name,name2, - "\n" - "\n" - "\n" - "\n" - "The Temple Operating System\n" - "\n" - "\n", - - "\n" - "
\n"
-	  "
\n", - "
\n", - "\n",,line_anchors); - Touch(name2,"",,de.datetime); - Free(name2); - } -} - -public U0 MakeWebSite() -{ - CDirEntry *tempde,*tempde1; - DocClear; - Cd("D:/Wb"); - DelTree("D:/Wb/Home/Budget"); - DelTree("D:/Wb/Home/Private"); - Del("D:/Wb/Home/*"); - Touch("D:/Wb/Home/Web/index.TXT.Z",""); - Touch("D:/Wb/Home/Web/DownloadOS.TXT.Z",""); - Touch("D:/Wb/Home/Web/TempleOS.TXT.Z",""); - tempde=tempde1=FilesFind("*", - FUF_RECURSE|FUF_JUST_FILES|FUF_JUST_TXT|FUF_CLUSTER_ORDER); - while (tempde) { - TOSWebFile(tempde->full_name); - tempde=tempde->next; - } - Copy( "D:/Wb/Home/Sup1/Sup1Bin/TempleBot", - "D:/Wb/Home/Sup1/Sup1Bin/TempleBot.TXT"); - ToDolDoc("D:/Wb/Home/Sup1/Sup1Bin/TempleBot.TXT"); - TOSToHtml("D:/Wb/Home/Sup1/Sup1Bin/TempleBot.TXT"); - Del("D:/Wb/Home/Sup1/Sup1Bin/TempleBot.TXT"); - DirTreeDel(tempde1); - Drv('C'); -} - -U0 FreshenWebDir(U8 *dirname) -{//No recurse - CDirEntry *tempde,*tempde1; - U8 *src,*dst; - - src=MStrPrint("D:/Wb%s",dirname); - MkDir(src); - Free(src); - - src=MStrPrint("D:/Wb%s/*",dirname); - Del(src); - Free(src); - - src=MStrPrint("C:%s/*",dirname); - dst=MStrPrint("D:/Wb%s",dirname); - Copy(src,dst); - Free(src); - Free(dst); - - src=MStrPrint("D:/Wb%s/*",dirname); - tempde=tempde1=FilesFind(src,FUF_JUST_FILES|FUF_JUST_TXT|FUF_CLUSTER_ORDER); - while (tempde) { - TOSWebFile(tempde->full_name); - tempde=tempde->next; - } - DirTreeDel(tempde1); -} - diff --git a/Demo/AcctExample/TOSToHtml.HC b/Demo/AcctExample/TOSToHtml.HC new file mode 100644 index 0000000..bd99577 --- /dev/null +++ b/Demo/AcctExample/TOSToHtml.HC @@ -0,0 +1,459 @@ +//This is a customized version of $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$. + +#help_index "DolDoc/Conversion" +//See $LK,"::/Doc/Credits.DD"$. + +U0 HtmlPutS(CDoc *doc,I64 u32_attr,I64 *_old_u32_attr, + U8 *st,I64 *_col,U8 *style_bitmap=NULL) +{ + U8 *ch,*ptr; + u32_attr&=0xFFFFFF00; + if (u32_attr&DOCET_INVERT) + u32_attr.u8[1]=(u32_attr.u8[1]&15)<<4|u32_attr.u8[1]>>4; + if (u32_attr!=*_old_u32_attr) { + if (!(u32_attr&DOCET_BLINK) && + *_old_u32_attr!=-1 && *_old_u32_attr&DOCET_BLINK) + DocPrint(doc,""); + if (*_old_u32_attr!=-1) + DocPrint(doc,""); + DocPrint(doc,"",u32_attr.u8[1]); + if (u32_attr&DOCET_BLINK && + (*_old_u32_attr==-1 || !(*_old_u32_attr&DOCET_BLINK))) + DocPrint(doc,""); + *_old_u32_attr=u32_attr; + if (style_bitmap) + LBts(style_bitmap,u32_attr.u8[1]); + } + while (ch=*st++) { + switch (ch) { + case '\t': + do { + DocPutKey(doc,CH_SPACE,0); + *_col=*_col+1; + } while (*_col&7); + break; + + start: + case 'ã': ptr="pi"; break; + case 'é': ptr="theta"; break; + case 'è': ptr="phi"; break; + case 'ê': ptr="omega"; break; + case 'ì': ptr="inf"; break; + case 'æ': ptr="u"; break; + end: + DocPrint(doc,ptr); + *_col=*_col+StrLen(ptr); + break; + + start: + case CH_SHIFT_SPACE: ptr=" "; break; + case '&': ptr="&"; break; + case '<': ptr="<"; break; + case '>': ptr=">"; break; + case '"': ptr="""; break; + end: + DocPrint(doc,ptr); + *_col=*_col+1; + break; + + default: + if (CH_SPACE<=ch<0x7F || ch=='\n') + DocPutKey(doc,ch,0); + else + DocPrint(doc,"."); + *_col=*_col+1; + } + } +} + +U8 *TOSLinkCvt2(U8 *filename,I64 line_num) +{// ::/ --> http://www.templeos.org/Wb/ +//Make your own LinkCvt routine + U8 *res=NULL,*st; + if (filename) { + st=ChgExt(filename,"html"); + if (st && StrLen(st)>3 && !StrNCmp(st+1,":/",2)) + res=MStrPrint(PERSONAL_WEB "/%s#l%d",st+3,line_num); + Free(st); + } + return res; +} + +U8 *URLBibleGateway(U8 *src) +{ + U8 buf[STR_LEN],*dst=buf; + if (!MemCmp(src,"BF:",3)) + src+=3; + while (*src) { + if (*src==CH_SPACE || *src==',') + *dst++='+'; + else + *dst++=*src; + src++; + } + *dst=0; + if (StrOcc(buf,'-')) + return MStrPrint( + "http://www.biblegateway.com/passage/?search=%s&version=NIV",buf); + else + return MStrPrint( + "http://www.biblegateway.com/verse/en/%s",buf); +} + +U8 *TOSLinkCvt1(U8 *link_st) +{ + static CDoc *bible=NULL; + static I64 locks=0; + U8 *res=NULL,*filename,*needle; + I64 i,num; + if (link_st) { + switch (i=EdLinkCvt(link_st,&filename,&needle,&num)) { + case LK_FILE_LINE: + case LK_PLAIN_LINE: + case LK_FILE: + res=TOSLinkCvt2(filename,num); + break; + case -1: + case LK_DEF: + case LK_HELP_INDEX: + case LK_DOC: + case LK_DOC_ANCHOR: + case LK_DOC_FIND: + case LK_DOC_LINE: + break; + case LK_BIBLE_FIND: + while (LBts(&locks,0)) + Yield; + if (!bible) + bible=Adam("DocRead(\"%s\");",filename); + if (DocFind(bible,num,needle)) + res=URLBibleGateway(link_st); + LBtr(&locks,0); + break; + default: + if (DocFileEd(i,filename,needle,&num,EDF_UNCOLLAPSE|EDF_BAIL)) + res=TOSLinkCvt2(filename,num); + } + Free(filename); + Free(needle); + } + return res; +} + + +public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL, + U8 *body_footer=NULL,U8 *html_footer=NULL,Bool line_anchors=TRUE, + U8 (*link_cvt)(U8 *link_st)=&TOSLinkCvt1) +{//Cvt $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$doc to HTML file. + CDocEntry *doc_e,*style,*doc_e2; + I64 i,y,old_y=MIN_I64,col,old_u32_attr=-1,old_attr; + U32 *hl,*src; + U8 *st,st_2[2],*link_st,*style_bitmap=CAlloc(256/8); + CBGR48 p[NUM_COLORS]; + GrPaletteGet(p); + CDoc *doc_out=DocNew; + Bool unlock_doc_in=DocLock(doc_in),no_bwd; + + old_attr=doc_in->win_task->text_attr; + doc_in->win_task->text_attr=DOC_ATTR_DFT_TEXT; + + for (i=0xF0;i<=0xFF;i++) + LBts(style_bitmap,i); + + DocRecalc(doc_in,RECALCt_NORMAL|RECALCF_TO_HTML); + + st_2[0]=0; st_2[1]=0; + doc_out->flags|=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR; + + if (!html_header) html_header= + "\n" + "\n" + "\n" + "\n" + "\n"; + if (!body_header) body_header= + "\n" + "
\n";
+  if (!body_footer) body_footer=
+	  "
\n\n"; + if (!html_footer) html_footer= + "\n"; + + DocPrint(doc_out,"%s",html_header); + + DocPrint(doc_out,"\n" + "\n"); + DocPrint(doc_out,"%s",body_header); + + doc_e=doc_in->head.next; + col=doc_e->x; + y=doc_e->y; + while (doc_e!=doc_in) { + if (!(doc_e->de_flags&DOCEF_SKIP)) { + if (y!=old_y && line_anchors) { + DocPrint(doc_out,"",y+1); + old_y=y; + } + while (yy) { + HtmlPutS(doc_out,doc_e->settings.final_u32_attr, + &old_u32_attr,"\n",&col,style_bitmap); + if (++y!=old_y && line_anchors) { + DocPrint(doc_out,"",y+1); + old_y=y; + } + col=0; + } + + no_bwd=TRUE; + doc_e2=doc_e->next; + while (doc_e2!=doc_in && doc_e2->y==doc_e->y) { + if (doc_e2->xx) { + no_bwd=FALSE; + break; + } + doc_e2=doc_e2->next; + } + if (no_bwd) + while (colx) + HtmlPutS(doc_out,doc_e->settings.final_u32_attr, + &old_u32_attr," ",&col,style_bitmap); + + link_st=NULL; + if (doc_e->de_flags&DOCEF_HTML_LINK) + link_st=StrNew(doc_e->html_link); + else if (st=DocEntryLink(doc_in,doc_e)) { + link_st=link_cvt(st); + Free(st); + } + + if (link_st) { + if (old_u32_attr!=-1) { + DocPrint(doc_out,"
"); + old_u32_attr=-1; + } + DocPrint(doc_out,"",link_st); + } + + switch (doc_e->type_u8) { + case DOCT_TEXT: + if (doc_e->de_flags&DOCEF_HIGHLIGHT) { + if (doc_e->last==doc_in) + MemCpy(&doc_e->settings,&doc_in->settings_head, + sizeof(CDocSettings)); + else + MemCpy(&doc_e->settings,&doc_e->last->settings, + sizeof(CDocSettings)); + src=hl=DocHighlight(doc_e,doc_e->tag,StrLen(doc_e->tag), + doc_e->type&0xFF00); + while (*src) { + st_2[0]=*src&0xFF; + HtmlPutS(doc_out,*src++,&old_u32_attr,st_2,&col,style_bitmap); + } + Free(hl); + } else { + if (doc_e->de_flags&DOCEF_CENTER_X && //$BK,1$Nonstandard$BK,0$ + doc_e->settings.final_u32_attr&0xF00==PURPLE<<8) + DocPrint(doc_out,"

"); + HtmlPutS(doc_out,doc_e->settings.final_u32_attr, + &old_u32_attr,doc_e->tag,&col,style_bitmap); + if (doc_e->de_flags&DOCEF_CENTER_X && //$BK,1$Nonstandard$BK,0$ + doc_e->settings.final_u32_attr&0xF00==PURPLE<<8) + DocPrint(doc_out,"

"); + } + break; + case DOCT_TAB: + HtmlPutS(doc_out,doc_e->settings.final_u32_attr, + &old_u32_attr,"\t",&col,style_bitmap); + break; + case DOCT_HTML_CODE: + if (old_u32_attr!=-1) { + DocPrint(doc_out,""); + old_u32_attr=-1; + } + DocPrint(doc_out,"%s",doc_e->tag); + break; + case DOCT_SPRITE: + HtmlPutS(doc_out,doc_e->settings.final_u32_attr, + &old_u32_attr,doc_e->tag,&col,style_bitmap); + HtmlPutS(doc_out,doc_e->settings.final_u32_attr, + &old_u32_attr,"/* Graphics Not Rendered in HTML */", + &col,style_bitmap); + break; + default: + if (doc_e->de_flags&DOCEF_TAG) + HtmlPutS(doc_out,doc_e->settings.final_u32_attr, + &old_u32_attr,doc_e->tag,&col,style_bitmap); + } + if (link_st) { + if (old_u32_attr!=-1) { + DocPrint(doc_out,""); + old_u32_attr=-1; + } + DocPrint(doc_out,"
"); + Free(link_st); + } + } + doc_e=doc_e->next; + } + while (y++y) { + HtmlPutS(doc_out,doc_e->settings.final_u32_attr, + &old_u32_attr,"\n",&col,style_bitmap); + col=0; + } + if (old_u32_attr!=-1) { + if (old_u32_attr&DOCET_BLINK) + DocPrint(doc_out,""); + DocPrint(doc_out,""); + old_u32_attr=-1; + } + DocPrint(doc_out,"%s",body_footer); + DocPrint(doc_out,"%s",html_footer); + + doc_out->cur_entry=style->next; + for (i=0;i<256;i++) + if (Bt(style_bitmap,i)) + DocPrint(doc_out, + ".c%02X{color:#%02x%02x%02x;background-color:#%02x%02x%02x;}\n", + i,p[i&15].r>>8,p[i&15].g>>8,p[i&15].b>>8, + p[i/16].r>>8,p[i/16].g>>8,p[i/16].b>>8); + doc_out->cur_entry=&doc_out->head; + DocRecalc(doc_out); + + doc_in->win_task->text_attr=old_attr; + + if (unlock_doc_in) + DocUnlock(doc_in); + return doc_out; +} + +#help_index "Cmd Line (Typically);DolDoc/Conversion;DolDoc/Cmd Line (Typically)" +public U0 TOSToHtml(U8 *_in_name,U8 *_out_name=NULL,U8 *html_header=NULL, + U8 *body_header=NULL,U8 *body_footer=NULL,U8 *html_footer=NULL, + I64 width=80,Bool line_anchors=TRUE, + U8 (*link_cvt)(U8 *link_st)=&TOSLinkCvt1) +{//Convert $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$file to HTML. +//Supply your own link_cvt routine. + U8 *in_name,*out_name; + CDoc *doc_in,*doc_out; + + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + WinHorz(0,width-1); //Sets doc width for word wrap. + + in_name=DftExt(_in_name,"HC.Z"); + if (_out_name) + out_name=DftExt(_out_name,"html"); + else + out_name=ChgExt(_in_name,"html"); + + doc_in=DocRead(in_name); + DocTop(doc_in); + DocPrint(doc_in,"$$BD,LTCYAN$$"); //$BK,1$Nonstandard$BK,0$ + doc_out=Doc2Html(doc_in,html_header,body_header,body_footer,html_footer, + line_anchors,link_cvt); + StrCpy(&doc_out->filename.name,out_name); + + SettingsPop; + + DocWrite(doc_out); + DocDel(doc_in); + DocDel(doc_out); + Free(in_name); + Free(out_name); +} + +#help_index "TOS" +U0 TOSWebFile(U8 *name) +{ + U8 *name2; + CDirEntry de; + Bool line_anchors; + if (FileFind(name,&de)) { + Free(de.full_name); + "File:%s\n",name; + UncollapseFile(name,NULL); + Touch(name,"",,de.datetime); + name2=ChgExt(name,"html"); + + if (StrMatch(BLOG_BASE,name) || StrMatch(DAILY_BASE,name)) + line_anchors=FALSE; + else + line_anchors=TRUE; + + TOSToHtml(name,name2, + "\n" + "\n" + "\n" + "\n" + "The Temple Operating System\n" + "\n" + "\n", + + "\n" + "
\n"
+	  "
\n", + "
\n", + "\n",,line_anchors); + Touch(name2,"",,de.datetime); + Free(name2); + } +} + +public U0 MakeWebSite() +{ + CDirEntry *tempde,*tempde1; + DocClear; + Cd("D:/Wb"); + DelTree("D:/Wb/Home/Budget"); + DelTree("D:/Wb/Home/Private"); + Del("D:/Wb/Home/*"); + Touch("D:/Wb/Home/Web/index.DD.Z",""); + Touch("D:/Wb/Home/Web/DownloadOS.DD.Z",""); + Touch("D:/Wb/Home/Web/TempleOS.DD.Z",""); + tempde=tempde1=FilesFind("*", + FUF_RECURSE|FUF_JUST_FILES|FUF_JUST_TXT|FUF_CLUSTER_ORDER); + while (tempde) { + TOSWebFile(tempde->full_name); + tempde=tempde->next; + } + DirTreeDel(tempde1); + Drv('C'); +} + +U0 FreshenWebDir(U8 *dirname) +{//No recurse + CDirEntry *tempde,*tempde1; + U8 *src,*dst; + + src=MStrPrint("D:/Wb%s",dirname); + MkDir(src); + Free(src); + + src=MStrPrint("D:/Wb%s/*",dirname); + Del(src); + Free(src); + + src=MStrPrint("C:%s/*",dirname); + dst=MStrPrint("D:/Wb%s",dirname); + Copy(src,dst); + Free(src); + Free(dst); + + src=MStrPrint("D:/Wb%s/*",dirname); + tempde=tempde1=FilesFind(src,FUF_JUST_FILES|FUF_JUST_TXT|FUF_CLUSTER_ORDER); + while (tempde) { + TOSWebFile(tempde->full_name); + tempde=tempde->next; + } + DirTreeDel(tempde1); +} + diff --git a/Demo/Asm/AsmAndC1.CPP b/Demo/Asm/AsmAndC1.CPP deleted file mode 100644 index df71217..0000000 --- a/Demo/Asm/AsmAndC1.CPP +++ /dev/null @@ -1,79 +0,0 @@ -/*Asm labels can only be defined once -in a task. will spawn a new task -each time, so you don't get redefine -error, like when repeatedly #including -it from the cmd line. -*/ - -asm { -//Opcodes are slightly different to make writing my x86_64 assembler easier. -//See $LK,"::/Compiler/OpCodes.TXT"$. - - IMPORT Beep; - -_BEEPS:: -//You can always clobber RAX,RBX,RCX,RDX,R8,R9. The compiler expects that. -//See $LK,"REGG_CLOBBERED",A="MN:REGG_CLOBBERED"$ and $LK,"REGG_STK_TEMP",A="MN:REGG_STK_TEMP"$. - PUSH RBP - MOV RBP,RSP - MOV RCX,U64 SF_ARG1[RBP] //$LK,"SF_ARG1",A="FF:::/Kernel/KernelA.HPP,SF_ARG1"$ - -@@05: PUSH RCX -//U0 $LK,"Beep",A="MN:Beep"$(I64 freq=500,Bool busy=FALSE) - PUSH FALSE //Do not busy (spin) wait - PUSH 500 //Hz - CALL Beep - POP RCX - LOOP @@05 - - POP RBP - RET1 8 //Use special return. Pop one arg off of stack. - -//HolyC return vals are in RAX. This function has no return value. -} - -//_extern binds a asm sym to a function. -//My convention is to put an underscore -//on C callable asm routines. -_extern _BEEPS U0 Beeps(I64 cnt); - -I64 AsmAndC1() -{ - I64 noreg i; //Normally this would be stored in a reg -//Check by unassembling with $LK,"Uf",A="MN:Uf"$("AsmAndC1"). - - i=GetI64("Num of beeps 1-5 (%d):",3,1,5); - Beeps(i); - - asm { -//You can clobber RAX,RBX,RCX,RDX. The compiler expects that. - - IMPORT Snd; //Import an not use & or don't import and use &Snd. - MOV RCX,&i[RBP] //You can clobber RAX,RBX,RCX,RDX. -//You better preserve the rest. - - @@05: PUSH RCX -//U0 $LK,"Snd",A="MN:Snd"$(F64 freq); - - MOV RAX,RCX //freq=loop*100.0+100.0 - IMUL2 RAX,100 //TempleOS uses nonstandard opcodes -//to avoid multiple form of the same one. - //See $LK,"::/Compiler/OpCodes.TXT"$. - ADD RAX,100 - PUSH RAX - FILD U64 [RSP] //Convert from int to floating - FSTP U64 [RSP] - - CALL Snd - - MOV RCX,cnts.time_stamp_freq>>3 //JIT Const. Simple delay loop -@@10: LOOP @@10 - - POP RCX - LOOP @@05 - } - Snd(0); - return i; -} - -"Beeps:%d\n",AsmAndC1; diff --git a/Demo/Asm/AsmAndC1.HC b/Demo/Asm/AsmAndC1.HC new file mode 100644 index 0000000..c00b385 --- /dev/null +++ b/Demo/Asm/AsmAndC1.HC @@ -0,0 +1,79 @@ +/*Asm labels can only be defined once +in a task. will spawn a new task +each time, so you don't get redefine +error, like when repeatedly #including +it from the cmd line. +*/ + +asm { +//Opcodes are slightly different to make writing my x86_64 assembler easier. +//See $LK,"::/Compiler/OpCodes.DD"$. + + IMPORT Beep; + +_BEEPS:: +//You can always clobber RAX,RBX,RCX,RDX,R8,R9. The compiler expects that. +//See $LK,"REGG_CLOBBERED",A="MN:REGG_CLOBBERED"$ and $LK,"REGG_STK_TEMP",A="MN:REGG_STK_TEMP"$. + PUSH RBP + MOV RBP,RSP + MOV RCX,U64 SF_ARG1[RBP] //$LK,"SF_ARG1",A="FF:::/Kernel/KernelA.HH,SF_ARG1"$ + +@@05: PUSH RCX +//U0 $LK,"Beep",A="MN:Beep"$(I64 freq=500,Bool busy=FALSE) + PUSH FALSE //Do not busy (spin) wait + PUSH 500 //Hz + CALL Beep + POP RCX + LOOP @@05 + + POP RBP + RET1 8 //Use special return. Pop one arg off of stack. + +//HolyC return vals are in RAX. This function has no return value. +} + +//_extern binds a asm sym to a function. +//My convention is to put an underscore +//on C callable asm routines. +_extern _BEEPS U0 Beeps(I64 cnt); + +I64 AsmAndC1() +{ + I64 noreg i; //Normally this would be stored in a reg +//Check by unassembling with $LK,"Uf",A="MN:Uf"$("AsmAndC1"). + + i=GetI64("Num of beeps 1-5 (%d):",3,1,5); + Beeps(i); + + asm { +//You can clobber RAX,RBX,RCX,RDX. The compiler expects that. + + IMPORT Snd; //Import an not use & or don't import and use &Snd. + MOV RCX,&i[RBP] //You can clobber RAX,RBX,RCX,RDX. +//You better preserve the rest. + + @@05: PUSH RCX +//U0 $LK,"Snd",A="MN:Snd"$(F64 freq); + + MOV RAX,RCX //freq=loop*100.0+100.0 + IMUL2 RAX,100 //TempleOS uses nonstandard opcodes +//to avoid multiple form of the same one. + //See $LK,"::/Compiler/OpCodes.DD"$. + ADD RAX,100 + PUSH RAX + FILD U64 [RSP] //Convert from int to floating + FSTP U64 [RSP] + + CALL Snd + + MOV RCX,cnts.time_stamp_freq>>3 //JIT Const. Simple delay loop +@@10: LOOP @@10 + + POP RCX + LOOP @@05 + } + Snd(0); + return i; +} + +"Beeps:%d\n",AsmAndC1; diff --git a/Demo/Asm/AsmAndC2.CPP b/Demo/Asm/AsmAndC2.CPP deleted file mode 100644 index b6f9813..0000000 --- a/Demo/Asm/AsmAndC2.CPP +++ /dev/null @@ -1,91 +0,0 @@ -/*Asm labels can only be defined once -in a task. will spawn a new task -each time, so you don't get redefine -error, like when repeatedly #including -it from the cmd line. -*/ - -//This is to demo glbl var access. -//Glbs defined elsewhere can accessed too, like cnts.jiffies. -I64 glbl_hz=400,glbl_hz_step=100,glbl_hz_base=100; - -asm { -//Opcodes are slightly different to make writing my x86_64 assembler easier. -//See $LK,"::/Compiler/OpCodes.TXT"$. - -JIFFIES_MSG: DU8 "Jiffies:",0; - -//See $LK,"::/Kernel/StrA.CPP",A="FL:::/Kernel/StrA.CPP,1"$ and $LK,"::/Kernel/KUtils.CPP"$. - -_BEEPS2:: -//You can clobber RAX,RBX,RCX,RDX,R8,R9. The compiler expects that. -//See $LK,"REGG_CLOBBERED",A="MN:REGG_CLOBBERED"$ and $LK,"REGG_STK_TEMP",A="MN:REGG_STK_TEMP"$. - PUSH RBP - MOV RBP,RSP - MOV RCX,U64 SF_ARG1[RBP] //$LK,"SF_ARG1",A="FF:::/Kernel/KernelA.HPP,SF_ARG1"$ - - PUSH U64 [&cnts.jiffies] - -@@05: PUSH RCX -//U0 $LK,"Beep",A="MN:Beep"$(I64 freq=500,Bool busy=FALSE) - PUSH FALSE //Do not busy (spin) wait - PUSH U64 [&glbl_hz] //evaluated at run time - CALL &Beep - POP RCX - LOOP @@05 - - PUSH RSI //See $LK,"REGG_LOCAL_VARS",A="MN:REGG_LOCAL_VARS"$ & $LK,"REGG_LOCAL_NON_PTR_VARS",A="MN:REGG_LOCAL_NON_PTR_VARS"$ - MOV RSI,JIFFIES_MSG - CALL PUT_STR - POP RSI - - POP RAX - SUB RAX,U64 [&cnts.jiffies] - NEG RAX - CALL PUT_HEX_U64 - MOV RAX,'\n' - CALL PUT_CHARS - - POP RBP - RET1 8 -} - -//My convention is to put an underscore -//on C callable asm routines. -_extern _BEEPS2 U0 Beeps2(I64 cnt); - -U0 AsmAndC2() -{ - I64 reg R15 i; - - i=GetI64("$$PURPLE$$\n\nNum of beeps 1-5 (%d):$$FG$$",3,1,5); - Beeps2(i); - - asm { - LIST -//You can clobber RAX,RBX,RCX,RDX, but preserve the rest. - - MOV RCX,R15 //You can clobber RAX,RBX,RCX,RDX. Preserve the rest. - - @@05: PUSH RCX -//U0 $LK,"Snd",A="MN:Snd"$(F64 freq); - - MOV RAX,RCX //freq=loop*100.0+100.0 - IMUL2 RAX,glbl_hz_step //evaluated at compile ttime - ADD RAX,U64 [&glbl_hz_base] //evaluated at run time - PUSH RAX - FILD U64 [RSP] //Convert from int to floating - FSTP U64 [RSP] - - CALL &Snd //We can skip IMPORT with & if JIT compiling. - - MOV RCX,cnts.time_stamp_freq>>3 //JIT Const. Simple delay loop. -@@10: LOOP @@10 - - POP RCX - LOOP @@05 - } - Snd(0); -} - -AsmAndC2; diff --git a/Demo/Asm/AsmAndC2.HC b/Demo/Asm/AsmAndC2.HC new file mode 100644 index 0000000..adbda14 --- /dev/null +++ b/Demo/Asm/AsmAndC2.HC @@ -0,0 +1,91 @@ +/*Asm labels can only be defined once +in a task. will spawn a new task +each time, so you don't get redefine +error, like when repeatedly #including +it from the cmd line. +*/ + +//This is to demo glbl var access. +//Glbs defined elsewhere can accessed too, like cnts.jiffies. +I64 glbl_hz=400,glbl_hz_step=100,glbl_hz_base=100; + +asm { +//Opcodes are slightly different to make writing my x86_64 assembler easier. +//See $LK,"::/Compiler/OpCodes.DD"$. + +JIFFIES_MSG: DU8 "Jiffies:",0; + +//See $LK,"::/Kernel/StrA.HC",A="FL:::/Kernel/StrA.HC,1"$ and $LK,"::/Kernel/KUtils.HC"$. + +_BEEPS2:: +//You can clobber RAX,RBX,RCX,RDX,R8,R9. The compiler expects that. +//See $LK,"REGG_CLOBBERED",A="MN:REGG_CLOBBERED"$ and $LK,"REGG_STK_TEMP",A="MN:REGG_STK_TEMP"$. + PUSH RBP + MOV RBP,RSP + MOV RCX,U64 SF_ARG1[RBP] //$LK,"SF_ARG1",A="FF:::/Kernel/KernelA.HH,SF_ARG1"$ + + PUSH U64 [&cnts.jiffies] + +@@05: PUSH RCX +//U0 $LK,"Beep",A="MN:Beep"$(I64 freq=500,Bool busy=FALSE) + PUSH FALSE //Do not busy (spin) wait + PUSH U64 [&glbl_hz] //evaluated at run time + CALL &Beep + POP RCX + LOOP @@05 + + PUSH RSI //See $LK,"REGG_LOCAL_VARS",A="MN:REGG_LOCAL_VARS"$ & $LK,"REGG_LOCAL_NON_PTR_VARS",A="MN:REGG_LOCAL_NON_PTR_VARS"$ + MOV RSI,JIFFIES_MSG + CALL PUT_STR + POP RSI + + POP RAX + SUB RAX,U64 [&cnts.jiffies] + NEG RAX + CALL PUT_HEX_U64 + MOV RAX,'\n' + CALL PUT_CHARS + + POP RBP + RET1 8 +} + +//My convention is to put an underscore +//on C callable asm routines. +_extern _BEEPS2 U0 Beeps2(I64 cnt); + +U0 AsmAndC2() +{ + I64 reg R15 i; + + i=GetI64("$$PURPLE$$\n\nNum of beeps 1-5 (%d):$$FG$$",3,1,5); + Beeps2(i); + + asm { + LIST +//You can clobber RAX,RBX,RCX,RDX, but preserve the rest. + + MOV RCX,R15 //You can clobber RAX,RBX,RCX,RDX. Preserve the rest. + + @@05: PUSH RCX +//U0 $LK,"Snd",A="MN:Snd"$(F64 freq); + + MOV RAX,RCX //freq=loop*100.0+100.0 + IMUL2 RAX,glbl_hz_step //evaluated at compile ttime + ADD RAX,U64 [&glbl_hz_base] //evaluated at run time + PUSH RAX + FILD U64 [RSP] //Convert from int to floating + FSTP U64 [RSP] + + CALL &Snd //We can skip IMPORT with & if JIT compiling. + + MOV RCX,cnts.time_stamp_freq>>3 //JIT Const. Simple delay loop. +@@10: LOOP @@10 + + POP RCX + LOOP @@05 + } + Snd(0); +} + +AsmAndC2; diff --git a/Demo/Asm/AsmAndC3.CPP b/Demo/Asm/AsmAndC3.HC similarity index 100% rename from Demo/Asm/AsmAndC3.CPP rename to Demo/Asm/AsmAndC3.HC diff --git a/Demo/Asm/AsmHelloWorld.CPP b/Demo/Asm/AsmHelloWorld.CPP deleted file mode 100644 index be9dd19..0000000 --- a/Demo/Asm/AsmHelloWorld.CPP +++ /dev/null @@ -1,50 +0,0 @@ -/*Asm labels can only be defined once -in a task. will spawn a new task -each time, so you don't get redefine -error, like when repeatedly #including -it from the cmd line. - -These are many useful kernel -routines $LK,"::/Kernel/StrA.CPP",A="FF:::/Kernel/StrA.CPP,PUT_CHARS"$ -intended to be called from -asm. Generally, they preserve -regs. - -You can call any routine you -like, C or asm, if you import it. -Be aware that C routines do not -preserve RAX,RBX,RCX,RDX,R8,R9. -When calling from the shell or -from C, preserve all other regs. - -*/ - -asm { -//Opcodes are slightly different to make writing my x86_64 assembler easier. -//See $LK,"::/Compiler/OpCodes.TXT"$. - -MY_WORLD_MSG: -//Define U8 does not put terminating zeros -//on strings. - DU8 "World\n",0; - -//My convention is to put an underscore -//on C callable asm routines. -_HELLO_WORLD:: - PUSH RSI //See $LK,"REGG_LOCAL_VARS",A="MN:REGG_LOCAL_VARS"$ & $LK,"REGG_LOCAL_NON_PTR_VARS",A="MN:REGG_LOCAL_NON_PTR_VARS"$ - MOV RCX,10 -@@05: MOV RAX,RCX - CALL PUT_HEX_U8 - MOV RAX,CH_SPACE - CALL PUT_CHARS - MOV RAX,'Hello ' //Supports multi-byte char consts - CALL PUT_CHARS -//We broke it in two pieces to show different ways. - MOV RSI,MY_WORLD_MSG - CALL PUT_STR - LOOP @@05 - POP RSI - RET -}; - -Call(_HELLO_WORLD); diff --git a/Demo/Asm/AsmHelloWorld.HC b/Demo/Asm/AsmHelloWorld.HC new file mode 100644 index 0000000..bb5a4b9 --- /dev/null +++ b/Demo/Asm/AsmHelloWorld.HC @@ -0,0 +1,50 @@ +/*Asm labels can only be defined once +in a task. will spawn a new task +each time, so you don't get redefine +error, like when repeatedly #including +it from the cmd line. + +These are many useful kernel +routines $LK,"::/Kernel/StrA.HC",A="FF:::/Kernel/StrA.HC,PUT_CHARS"$ +intended to be called from +asm. Generally, they preserve +regs. + +You can call any routine you +like, C or asm, if you import it. +Be aware that C routines do not +preserve RAX,RBX,RCX,RDX,R8,R9. +When calling from the shell or +from C, preserve all other regs. + +*/ + +asm { +//Opcodes are slightly different to make writing my x86_64 assembler easier. +//See $LK,"::/Compiler/OpCodes.DD"$. + +MY_WORLD_MSG: +//Define U8 does not put terminating zeros +//on strings. + DU8 "World\n",0; + +//My convention is to put an underscore +//on C callable asm routines. +_HELLO_WORLD:: + PUSH RSI //See $LK,"REGG_LOCAL_VARS",A="MN:REGG_LOCAL_VARS"$ & $LK,"REGG_LOCAL_NON_PTR_VARS",A="MN:REGG_LOCAL_NON_PTR_VARS"$ + MOV RCX,10 +@@05: MOV RAX,RCX + CALL PUT_HEX_U8 + MOV RAX,CH_SPACE + CALL PUT_CHARS + MOV RAX,'Hello ' //Supports multi-byte char consts + CALL PUT_CHARS +//We broke it in two pieces to show different ways. + MOV RSI,MY_WORLD_MSG + CALL PUT_STR + LOOP @@05 + POP RSI + RET +}; + +Call(_HELLO_WORLD); diff --git a/Demo/Asm/BuzzFizz.CPP b/Demo/Asm/BuzzFizz.HC similarity index 100% rename from Demo/Asm/BuzzFizz.CPP rename to Demo/Asm/BuzzFizz.HC diff --git a/Demo/Asm/DivByHand.CPP b/Demo/Asm/DivByHand.HC similarity index 100% rename from Demo/Asm/DivByHand.CPP rename to Demo/Asm/DivByHand.HC diff --git a/Demo/Asm/MulByHand.CPP b/Demo/Asm/MulByHand.CPP deleted file mode 100644 index bd2978a..0000000 --- a/Demo/Asm/MulByHand.CPP +++ /dev/null @@ -1,69 +0,0 @@ -/*When I was a kid with a Commodore 64, -the 6502 chip had no multiply inst -and this is how we had to do it, except, -I used more regs in this example. -*/ -asm { -//Opcodes are slightly different to make writing my x86_64 assembler easier. -//See $LK,"::/Compiler/OpCodes.TXT"$. - -//You can clobber RAX,RBX,RCX,RDX,R8,R9. The compiler expects that. - -MUL_BY_HAND_U8_U8_TO_U16: //This is only for fun. -//8bit * 8bit-->16bit -//AL*BL-->AX - MOV CL,8 - SHL AX,8 -@@05: SHL1 AX - JNC @@10 - ADD AL,BL -@@10: DEC CL - JNZ @@05 - RET - -_MUL_BY_HAND_U8_U8_TO_U16:: //C callable - PUSH RBP - MOV RBP,RSP - MOV AL,U8 SF_ARG1[RBP] //$LK,"SF_ARG1",A="FF:::/Kernel/KernelA.HPP,SF_ARG1"$ - MOV BL,U8 SF_ARG2[RBP] - CALL MUL_BY_HAND_U8_U8_TO_U16 - MOVZX RAX,AX - POP RBP - RET1 16 - -_MUL_U64_U64_TO_U128:: -//64bit * 64bit-->128bit - PUSH RBP - MOV RBP,RSP - MOV RBX,U64 SF_ARG3[RBP] - MOV RAX,U64 SF_ARG1[RBP] //$LK,"SF_ARG1",A="FF:::/Kernel/KernelA.HPP,SF_ARG1"$ - MUL U64 SF_ARG2[RBP] //Res RDX:RAX 128bit - MOV U64 [RBX],RAX - MOV U64 8[RBX],RDX - POP RBP - RET1 24 -}; - -//My convention is to put an underscore -//on C callable asm routines. -_extern _MUL_BY_HAND_U8_U8_TO_U16 U16 MulU8(U8 n1,U8 n2); - -class U128 -{ - U64 lo,hi; -}; - -_extern _MUL_U64_U64_TO_U128 U0 MulU64(I64 n1,I64 n2,U128 *_prod); - -U0 MulByHand() -{ - U128 p; - "2*7 =0x%X\n",MulU8(2,7); - "100*10=0x%X\n",MulU8(100,10); - - MulU64(0x0123456789ABCDEF,0x1000001,&p); - "0x0123466789ABCDEF*0x1000001=0x%016X%016X\n",p.hi,p.lo; -} - -MulByHand; - diff --git a/Demo/Asm/MulByHand.HC b/Demo/Asm/MulByHand.HC new file mode 100644 index 0000000..be4e9aa --- /dev/null +++ b/Demo/Asm/MulByHand.HC @@ -0,0 +1,69 @@ +/*When I was a kid with a Commodore 64, +the 6502 chip had no multiply inst +and this is how we had to do it, except, +I used more regs in this example. +*/ +asm { +//Opcodes are slightly different to make writing my x86_64 assembler easier. +//See $LK,"::/Compiler/OpCodes.DD"$. + +//You can clobber RAX,RBX,RCX,RDX,R8,R9. The compiler expects that. + +MUL_BY_HAND_U8_U8_TO_U16: //This is only for fun. +//8bit * 8bit-->16bit +//AL*BL-->AX + MOV CL,8 + SHL AX,8 +@@05: SHL1 AX + JNC @@10 + ADD AL,BL +@@10: DEC CL + JNZ @@05 + RET + +_MUL_BY_HAND_U8_U8_TO_U16:: //C callable + PUSH RBP + MOV RBP,RSP + MOV AL,U8 SF_ARG1[RBP] //$LK,"SF_ARG1",A="FF:::/Kernel/KernelA.HH,SF_ARG1"$ + MOV BL,U8 SF_ARG2[RBP] + CALL MUL_BY_HAND_U8_U8_TO_U16 + MOVZX RAX,AX + POP RBP + RET1 16 + +_MUL_U64_U64_TO_U128:: +//64bit * 64bit-->128bit + PUSH RBP + MOV RBP,RSP + MOV RBX,U64 SF_ARG3[RBP] + MOV RAX,U64 SF_ARG1[RBP] //$LK,"SF_ARG1",A="FF:::/Kernel/KernelA.HH,SF_ARG1"$ + MUL U64 SF_ARG2[RBP] //Res RDX:RAX 128bit + MOV U64 [RBX],RAX + MOV U64 8[RBX],RDX + POP RBP + RET1 24 +}; + +//My convention is to put an underscore +//on C callable asm routines. +_extern _MUL_BY_HAND_U8_U8_TO_U16 U16 MulU8(U8 n1,U8 n2); + +class U128 +{ + U64 lo,hi; +}; + +_extern _MUL_U64_U64_TO_U128 U0 MulU64(I64 n1,I64 n2,U128 *_prod); + +U0 MulByHand() +{ + U128 p; + "2*7 =0x%X\n",MulU8(2,7); + "100*10=0x%X\n",MulU8(100,10); + + MulU64(0x0123456789ABCDEF,0x1000001,&p); + "0x0123466789ABCDEF*0x1000001=0x%016X%016X\n",p.hi,p.lo; +} + +MulByHand; + diff --git a/Demo/Asm/PutDec.CPP b/Demo/Asm/PutDec.CPP deleted file mode 100644 index dad41c0..0000000 --- a/Demo/Asm/PutDec.CPP +++ /dev/null @@ -1,49 +0,0 @@ -asm { -PUT_DEC_U64:: -//RAX is number to print in decimal. -//Preserves all regs. - PUSH RBP - MOV RBP,RSP - SUB RSP,24 //24 char buffer on stack - -//$LK,"Save regs",A="FF:::/Kernel/KernelA.HPP,PUSH_C_REGS"$ which C code is free to clobber. We don't have to for C callers, -//but this function will be nice for ASM callers if it saves all regs. - PUSH_C_REGS - - PUSH RSI //See $LK,"REGG_LOCAL_VARS",A="MN:REGG_LOCAL_VARS"$&$LK,"REGG_LOCAL_NON_PTR_VARS",A="MN:REGG_LOCAL_NON_PTR_VARS"$ - LEA RSI,-1[RBP] //Load addr of end of buffer. - //We picked RSI because of PUT_STR - //We'll move bwd - MOV U8 [RSI],0 //Terminator - - TEST RAX,RAX //Special case -- zero - JNZ @@05 - DEC RSI - MOV U8 [RSI],'0' - JMP @@15 - -@@05: MOV RBX,10 //Divides by 10 - -@@10: XOR RDX,RDX - DIV RBX //RAX=(RDX:RAX)/RBX with remainder in RDX - ADD RDX,'0' - DEC RSI - MOV U8 [RSI],DL - TEST RAX,RAX - JNZ @@10 - -@@15: CALL PUT_STR - POP RSI - POP_C_REGS - LEAVE - RET - -_DO_IT:: //The convention is C-callable routines have underscores. - MOV RAX,122333221 - CALL PUT_DEC_U64 - MOV RAX,'\n' - CALL PUT_CHARS - RET -} - -Call(_DO_IT); diff --git a/Demo/Asm/PutDec.HC b/Demo/Asm/PutDec.HC new file mode 100644 index 0000000..58f6b45 --- /dev/null +++ b/Demo/Asm/PutDec.HC @@ -0,0 +1,49 @@ +asm { +PUT_DEC_U64:: +//RAX is number to print in decimal. +//Preserves all regs. + PUSH RBP + MOV RBP,RSP + SUB RSP,24 //24 char buffer on stack + +//$LK,"Save regs",A="FF:::/Kernel/KernelA.HH,PUSH_C_REGS"$ which C code is free to clobber. We don't have to for C callers, +//but this function will be nice for ASM callers if it saves all regs. + PUSH_C_REGS + + PUSH RSI //See $LK,"REGG_LOCAL_VARS",A="MN:REGG_LOCAL_VARS"$&$LK,"REGG_LOCAL_NON_PTR_VARS",A="MN:REGG_LOCAL_NON_PTR_VARS"$ + LEA RSI,-1[RBP] //Load addr of end of buffer. + //We picked RSI because of PUT_STR + //We'll move bwd + MOV U8 [RSI],0 //Terminator + + TEST RAX,RAX //Special case -- zero + JNZ @@05 + DEC RSI + MOV U8 [RSI],'0' + JMP @@15 + +@@05: MOV RBX,10 //Divides by 10 + +@@10: XOR RDX,RDX + DIV RBX //RAX=(RDX:RAX)/RBX with remainder in RDX + ADD RDX,'0' + DEC RSI + MOV U8 [RSI],DL + TEST RAX,RAX + JNZ @@10 + +@@15: CALL PUT_STR + POP RSI + POP_C_REGS + LEAVE + RET + +_DO_IT:: //The convention is C-callable routines have underscores. + MOV RAX,122333221 + CALL PUT_DEC_U64 + MOV RAX,'\n' + CALL PUT_CHARS + RET +} + +Call(_DO_IT); diff --git a/Demo/AutoFile/AFDir.AUT b/Demo/AutoFile/AFDir.AUT index 55dafbd..ef455ab 100644 --- a/Demo/AutoFile/AFDir.AUT +++ b/Demo/AutoFile/AFDir.AUT @@ -1,7 +1,7 @@ /* To run this, do a directory, right click on this file's name and sel "AutoFile". Or, type $LK,"AutoFile",A="MN:AutoFile"$(filename); -See $LK,"AutoFile",A="FF:::/Doc/Glossary.TXT,AutoFile"$ in the glossary for more info. +See $LK,"AutoFile",A="FF:::/Doc/Glossary.DD,AutoFile"$ in the glossary for more info. */ I64 i; diff --git a/Demo/AutoFile/AFEd.AUT b/Demo/AutoFile/AFEd.AUT index 4177853..2e0b63a 100644 --- a/Demo/AutoFile/AFEd.AUT +++ b/Demo/AutoFile/AFEd.AUT @@ -1,17 +1,17 @@ /* To run this, do a directory, right click on this file's name and sel "AutoFile". Or, type $LK,"AutoFile",A="MN:AutoFile"$(filename); -See $LK,"AutoFile",A="FF:::/Doc/Glossary.TXT,AutoFile"$ in the glossary for more info. +See $LK,"AutoFile",A="FF:::/Doc/Glossary.DD,AutoFile"$ in the glossary for more info. This autofile will renum the defines in -AFEd.TXT.Z. Test it by numbering a few wrong +AFEd.DD.Z. Test it by numbering a few wrong and running this demo. */ U8 i; -"Ed(\"AFEd.TXT.Z\");\n"; +"Ed(\"AFEd.DD.Z\");\n"; //Go to start of file Msg(MSG_KEY_DOWN,0,SC_CURSOR_UP|SCF_CTRL); for (i=0;i<=0xC3;i++) { diff --git a/Demo/AutoFile/AFEd.TXT b/Demo/AutoFile/AFEd.DD similarity index 100% rename from Demo/AutoFile/AFEd.TXT rename to Demo/AutoFile/AFEd.DD diff --git a/Demo/AutoFile/AFPopUp.CPP b/Demo/AutoFile/AFPopUp.HC similarity index 100% rename from Demo/AutoFile/AFPopUp.CPP rename to Demo/AutoFile/AFPopUp.HC diff --git a/Demo/AutoFile/AFProfile.AUT b/Demo/AutoFile/AFProfile.AUT index 20fc6db..b7fb167 100644 --- a/Demo/AutoFile/AFProfile.AUT +++ b/Demo/AutoFile/AFProfile.AUT @@ -1,7 +1,7 @@ /* To run this, do a directory, right click on this file's name and sel "AutoFile". Or, type $LK,"AutoFile",A="MN:AutoFile"$(filename); -See $LK,"AutoFile",A="FF:::/Doc/Glossary.TXT,AutoFile"$ in the glossary for more info. +See $LK,"AutoFile",A="FF:::/Doc/Glossary.DD,AutoFile"$ in the glossary for more info. Profiling does not $UL,1$require$UL,0$ autofiles. */ diff --git a/Demo/AutoFile/AFSetIP.CPP b/Demo/AutoFile/AFSetIP.HC similarity index 100% rename from Demo/AutoFile/AFSetIP.CPP rename to Demo/AutoFile/AFSetIP.HC diff --git a/Demo/Carry.CPP b/Demo/Carry.HC similarity index 100% rename from Demo/Carry.CPP rename to Demo/Carry.HC diff --git a/Demo/ClassMeta.CPP b/Demo/ClassMeta.CPP deleted file mode 100644 index 1b9330e..0000000 --- a/Demo/ClassMeta.CPP +++ /dev/null @@ -1,80 +0,0 @@ -/*Demonstrates class meta data. -Basically, we make use of the compiler's -data about a class. We can add to the -compilers data arbitrary items, either string or -or int or F64 (if you typecast). - -This stuff is not high performance. -Don't get carried away -- it might be slow. -*/ - -U0 RankOut(I64 i) -{ - " %z",i,"Cadet\0Ensign\0Captain\0Admiral\0President\0"; -} - -class Test1Struct -{ - I64 age print_str "%2d" dft_val 38; - I64 color dft_val RED; //Accepts expressions - I64 rank print_str "%1d" dft_val 6/2 output_fun &RankOut; -}; - -class Test2Struct -{ - I64 age print_str "%2d" dft_val 38 percentile 54.20; - I64 rank print_str "%1d" dft_val 5; - I64 serial_num print_str "%6d" dft_val 123456; -}; - -U0 DumpStruct(U8 *_d,U8 *class_name=lastclass) -{//lastclass is keyword. See $LK,"::/Demo/LastClass.CPP"$. - CHashClass *tempc=HashFind(class_name,Fs->hash_table,HTT_CLASS); - U8 *print_str; - I64 *q,dft_val; - U0 (* fp_output_fun)(I64 i); - F64 percentile; - if (!tempc) return; - CMemberLst *ml; - ml=tempc->member_lst_and_root; - while (ml) { - "%s:",ml->str; - - //All our items are I64's. If you want, you can check - //the data type of the member var. See $LK,"ClassRep",A="MN:ClassRep"$(). - q=_d+ml->offset; - - if (print_str=MemberMetaData("print_str",ml)) - "" print_str,*q; - - //This is slightly ambiguous -- if no meta is present it will return zero. - if (dft_val=MemberMetaData("dft_val",ml)) - " default:%d",dft_val; - - //This corrects for the ambiguity, allowing zero percentile. - if (MemberMetaFind("percentile",ml)) {//check if it exists -//We could use the $LK,"CMemberLstMeta",A="MN:CMemberLstMeta"$ structure returned by - //$LK,"MemberMetaFind",A="MN:MemberMetaFind"$() and save a search. - percentile=MemberMetaData("percentile",ml)(F64); - " percentile: %5.2f",percentile; - } - - if (fp_output_fun=MemberMetaData("output_fun",ml)) - (*fp_output_fun)(*q); - '\n'; - ml=ml->next; - } -} - -Test1Struct t1; -t1.age=44; -t1.rank=3; - -DumpStruct(&t1); - -Test2Struct t2; -t2.age=22; -t2.rank=2; -t2.serial_num=55555; - -DumpStruct(&t2); diff --git a/Demo/ClassMeta.HC b/Demo/ClassMeta.HC new file mode 100644 index 0000000..4578291 --- /dev/null +++ b/Demo/ClassMeta.HC @@ -0,0 +1,80 @@ +/*Demonstrates class meta data. +Basically, we make use of the compiler's +data about a class. We can add to the +compilers data arbitrary items, either string or +or int or F64 (if you typecast). + +This stuff is not high performance. +Don't get carried away -- it might be slow. +*/ + +U0 RankOut(I64 i) +{ + " %z",i,"Cadet\0Ensign\0Captain\0Admiral\0President\0"; +} + +class Test1Struct +{ + I64 age print_str "%2d" dft_val 38; + I64 color dft_val RED; //Accepts expressions + I64 rank print_str "%1d" dft_val 6/2 output_fun &RankOut; +}; + +class Test2Struct +{ + I64 age print_str "%2d" dft_val 38 percentile 54.20; + I64 rank print_str "%1d" dft_val 5; + I64 serial_num print_str "%6d" dft_val 123456; +}; + +U0 DumpStruct(U8 *_d,U8 *class_name=lastclass) +{//lastclass is keyword. See $LK,"::/Demo/LastClass.HC"$. + CHashClass *tempc=HashFind(class_name,Fs->hash_table,HTT_CLASS); + U8 *print_str; + I64 *q,dft_val; + U0 (* fp_output_fun)(I64 i); + F64 percentile; + if (!tempc) return; + CMemberLst *ml; + ml=tempc->member_lst_and_root; + while (ml) { + "%s:",ml->str; + + //All our items are I64's. If you want, you can check + //the data type of the member var. See $LK,"ClassRep",A="MN:ClassRep"$(). + q=_d+ml->offset; + + if (print_str=MemberMetaData("print_str",ml)) + "" print_str,*q; + + //This is slightly ambiguous -- if no meta is present it will return zero. + if (dft_val=MemberMetaData("dft_val",ml)) + " default:%d",dft_val; + + //This corrects for the ambiguity, allowing zero percentile. + if (MemberMetaFind("percentile",ml)) {//check if it exists +//We could use the $LK,"CMemberLstMeta",A="MN:CMemberLstMeta"$ structure returned by + //$LK,"MemberMetaFind",A="MN:MemberMetaFind"$() and save a search. + percentile=MemberMetaData("percentile",ml)(F64); + " percentile: %5.2f",percentile; + } + + if (fp_output_fun=MemberMetaData("output_fun",ml)) + (*fp_output_fun)(*q); + '\n'; + ml=ml->next; + } +} + +Test1Struct t1; +t1.age=44; +t1.rank=3; + +DumpStruct(&t1); + +Test2Struct t2; +t2.age=22; +t2.rank=2; +t2.serial_num=55555; + +DumpStruct(&t2); diff --git a/Demo/CompileDemo.CPP b/Demo/CompileDemo.HC similarity index 100% rename from Demo/CompileDemo.CPP rename to Demo/CompileDemo.HC diff --git a/Demo/DateTime.CPP b/Demo/DateTime.HC similarity index 100% rename from Demo/DateTime.CPP rename to Demo/DateTime.HC diff --git a/Demo/DbgDemo.CPP b/Demo/DbgDemo.HC similarity index 100% rename from Demo/DbgDemo.CPP rename to Demo/DbgDemo.HC diff --git a/Demo/Define.CPP b/Demo/Define.HC similarity index 100% rename from Demo/Define.CPP rename to Demo/Define.HC diff --git a/Demo/Directives.CPP b/Demo/Directives.HC similarity index 100% rename from Demo/Directives.CPP rename to Demo/Directives.HC diff --git a/Demo/DolDoc/CallBack.CPP b/Demo/DolDoc/CallBack.CPP deleted file mode 100644 index 54c3b80..0000000 --- a/Demo/DolDoc/CallBack.CPP +++ /dev/null @@ -1,64 +0,0 @@ -U8 *tSCB(CDoc *,CDocEntry *,CTask *mem_task) -{//This is called by the window mgr. -//Things would get corrupted - //if the window mgr used it's own - //heap, so we use the owning task's heap. - U8 *st=MAlloc(64,mem_task); - CDate cdt=tS*CDATE_FREQ; -//Doesn't have to be fixed width!! - StrPrint(st,"%d=%T",cdt,cdt); - return st; -} - -U8 *CurTimeCB(CDoc *,CDocEntry *,CTask *mem_task) -{ - U8 *st=MAlloc(64,mem_task); - CDate cdt=Now; - StrPrint(st,"%D %T",cdt,cdt); - return st; -} - -U0 DoIt() -{ - CDoc *bdoc=DocBorder,*pdoc=DocPut; - CDocEntry *doc_e; - - DocLock(bdoc); - DocBottom(bdoc); //Ins at the bottom - DocPrint(bdoc,"$$RED$$$$CM+BY+LX,5,-3$$"); -//The $LK,"DocPrint",A="MN:DocPrint"$() routine returns the addr of the last entry. - doc_e=DocPrint(bdoc,"$$TX+TC,\" \"$$"); -//The TC flag is "has tag callback". - - //Flags are explained here: - //$LK,"::/Doc/DolDocOverview.TXT"$ $LK,"::/Doc/Widget.TXT"$ - //$LK,"Dollar Flags",A="MN:DOCEf_TAG"$ $LK,"ST_DOC_FLAGS",A="FF:::/Adam/DolDoc/DocInit.CPP,ST_DOC_FLAGS"$ - doc_e->tag_cb=&tSCB; - DocPrint(bdoc,"$$FG$$"); - DocUnlock(bdoc); - - //$BK,1$WARNING:$BK,0$ If you use the put_doc you - //run the risk of the user pressing - // or using the clipboard, both - //of which will crash. So, you might want - //to use the border_doc. - - DocLock(pdoc); - DocPrint(pdoc,"$$LTRED$$"); - doc_e=DocPrint(pdoc,"$$TX+TC,\" \"$$"); - doc_e->tag_cb=&CurTimeCB; - DocPrint(pdoc,"$$FG$$"); - DocUnlock(pdoc); - - //Send carriage return, new line, so - //that the timer string is not part - //of the next cmd on the cmd line. - '\n'; -} - -U0 UndoIt() -{//Clear-out entries without a +H hold flag. - DocClear(Fs->border_doc); -} - -DoIt; diff --git a/Demo/DolDoc/CallBack.HC b/Demo/DolDoc/CallBack.HC new file mode 100644 index 0000000..ecb61f5 --- /dev/null +++ b/Demo/DolDoc/CallBack.HC @@ -0,0 +1,64 @@ +U8 *tSCB(CDoc *,CDocEntry *,CTask *mem_task) +{//This is called by the window mgr. +//Things would get corrupted + //if the window mgr used it's own + //heap, so we use the owning task's heap. + U8 *st=MAlloc(64,mem_task); + CDate cdt=tS*CDATE_FREQ; +//Doesn't have to be fixed width!! + StrPrint(st,"%d=%T",cdt,cdt); + return st; +} + +U8 *CurTimeCB(CDoc *,CDocEntry *,CTask *mem_task) +{ + U8 *st=MAlloc(64,mem_task); + CDate cdt=Now; + StrPrint(st,"%D %T",cdt,cdt); + return st; +} + +U0 DoIt() +{ + CDoc *bdoc=DocBorder,*pdoc=DocPut; + CDocEntry *doc_e; + + DocLock(bdoc); + DocBottom(bdoc); //Ins at the bottom + DocPrint(bdoc,"$$RED$$$$CM+BY+LX,5,-3$$"); +//The $LK,"DocPrint",A="MN:DocPrint"$() routine returns the addr of the last entry. + doc_e=DocPrint(bdoc,"$$TX+TC,\" \"$$"); +//The TC flag is "has tag callback". + + //Flags are explained here: + //$LK,"::/Doc/DolDocOverview.DD"$ $LK,"::/Doc/Widget.DD"$ + //$LK,"Dollar Flags",A="MN:DOCEf_TAG"$ $LK,"ST_DOC_FLAGS",A="FF:::/Adam/DolDoc/DocInit.HC,ST_DOC_FLAGS"$ + doc_e->tag_cb=&tSCB; + DocPrint(bdoc,"$$FG$$"); + DocUnlock(bdoc); + + //$BK,1$WARNING:$BK,0$ If you use the put_doc you + //run the risk of the user pressing + // or using the clipboard, both + //of which will crash. So, you might want + //to use the border_doc. + + DocLock(pdoc); + DocPrint(pdoc,"$$LTRED$$"); + doc_e=DocPrint(pdoc,"$$TX+TC,\" \"$$"); + doc_e->tag_cb=&CurTimeCB; + DocPrint(pdoc,"$$FG$$"); + DocUnlock(pdoc); + + //Send carriage return, new line, so + //that the timer string is not part + //of the next cmd on the cmd line. + '\n'; +} + +U0 UndoIt() +{//Clear-out entries without a +H hold flag. + DocClear(Fs->border_doc); +} + +DoIt; diff --git a/Demo/DolDoc/ClickCallBack.CPP b/Demo/DolDoc/ClickCallBack.CPP deleted file mode 100644 index 59d28c7..0000000 --- a/Demo/DolDoc/ClickCallBack.CPP +++ /dev/null @@ -1,47 +0,0 @@ -I64 MyLeftCB1(CDoc *,CDocEntry *) -{ - I64 i; - for (i=500;i<1000;i+=25) { - Snd(i); - Sleep(10); - } - Snd(0); - return 0; -} - -U0 ClickCallBack() -{ - CDocEntry *doc_e; - DocLock(DocPut); -//The $LK,"DocPrint",A="MN:DocPrint"$() routine returns the addr of the last entry. - doc_e=DocPrint(DocPut,"\n$$MA+LC,\"Click Me\"$$ "); -//The LC flag is "has left callback". - - //Flags are explained here: - //$LK,"::/Doc/DolDocOverview.TXT"$ $LK,"::/Doc/Widget.TXT"$ - //$LK,"Dollar Flags",A="MN:DOCEf_TAG"$ $LK,"ST_DOC_FLAGS",A="FF:::/Adam/DolDoc/DocInit.CPP,ST_DOC_FLAGS"$ - "(Not preserved if you press .)\n\n"; - doc_e->left_cb=&MyLeftCB1; - DocUnlock(DocPut); -} - -ClickCallBack; - -I64 MyLeftCB2(CDoc *,CDocEntry *) -{ - return cnts.jiffies; -} - -U0 PopUpJiffiesCallBack(I64 i) -{ - CDoc *doc=DocNew; - CDocEntry *doc_e=DocPrint(doc, - "Click %d more times\n\n\n$$BT+LC,\"Jiffies\"$$\n\n\n",i); - doc_e->left_cb=&MyLeftCB2; - "Current Jiffies:%d\n",PopUpMenu(doc); - DocDel(doc); -} - -PopUpJiffiesCallBack(3); -PopUpJiffiesCallBack(2); -PopUpJiffiesCallBack(1); diff --git a/Demo/DolDoc/ClickCallBack.HC b/Demo/DolDoc/ClickCallBack.HC new file mode 100644 index 0000000..102d5a1 --- /dev/null +++ b/Demo/DolDoc/ClickCallBack.HC @@ -0,0 +1,47 @@ +I64 MyLeftCB1(CDoc *,CDocEntry *) +{ + I64 i; + for (i=500;i<1000;i+=25) { + Snd(i); + Sleep(10); + } + Snd(0); + return 0; +} + +U0 ClickCallBack() +{ + CDocEntry *doc_e; + DocLock(DocPut); +//The $LK,"DocPrint",A="MN:DocPrint"$() routine returns the addr of the last entry. + doc_e=DocPrint(DocPut,"\n$$MA+LC,\"Click Me\"$$ "); +//The LC flag is "has left callback". + + //Flags are explained here: + //$LK,"::/Doc/DolDocOverview.DD"$ $LK,"::/Doc/Widget.DD"$ + //$LK,"Dollar Flags",A="MN:DOCEf_TAG"$ $LK,"ST_DOC_FLAGS",A="FF:::/Adam/DolDoc/DocInit.HC,ST_DOC_FLAGS"$ + "(Not preserved if you press .)\n\n"; + doc_e->left_cb=&MyLeftCB1; + DocUnlock(DocPut); +} + +ClickCallBack; + +I64 MyLeftCB2(CDoc *,CDocEntry *) +{ + return cnts.jiffies; +} + +U0 PopUpJiffiesCallBack(I64 i) +{ + CDoc *doc=DocNew; + CDocEntry *doc_e=DocPrint(doc, + "Click %d more times\n\n\n$$BT+LC,\"Jiffies\"$$\n\n\n",i); + doc_e->left_cb=&MyLeftCB2; + "Current Jiffies:%d\n",PopUpMenu(doc); + DocDel(doc); +} + +PopUpJiffiesCallBack(3); +PopUpJiffiesCallBack(2); +PopUpJiffiesCallBack(1); diff --git a/Demo/DolDoc/CursorMove.CPP b/Demo/DolDoc/CursorMove.CPP deleted file mode 100644 index 6c61c55..0000000 --- a/Demo/DolDoc/CursorMove.CPP +++ /dev/null @@ -1,38 +0,0 @@ -U0 CursorMovementDemo() -{ - I64 i; - for (i=0;i<100;i++) { - "%03d ",i; - "$$CM,-4,1$$"; - if (i%10==9) - "$$CM,4,-10$$"; - } - - //+LX is relative to left side. - //See with cursor-movement for all the flags. - //Check "Quote" to set-up a cmd for in quotes. - "$$CM+LX,0,+10$$\n"; -} - -CursorMovementDemo; - -/*The word-wrap Off and On cmds are -$$WW,0$$ and $$WW,1$$. - -You might need $LK,"DocMax",A="MN:DocMax"$() to adjust -the cmd line window buf size. -It counts cmds, not lines. - -The +H flag will hold-onto an entry -so it doesn't get pushed-out of the document. -This is useful for a $$WW+H,1$$ cmd. - -See $LK,"::/Doc/DolDocOverview.TXT"$ for documentation on -all flags and cmds. - -Note: the default page length is 66 lines -and branching back more than the page length -will rst the column to 1. So, set page -length to a large number if you want to -branch back a long distance. -*/ diff --git a/Demo/DolDoc/CursorMove.HC b/Demo/DolDoc/CursorMove.HC new file mode 100644 index 0000000..b5727e3 --- /dev/null +++ b/Demo/DolDoc/CursorMove.HC @@ -0,0 +1,38 @@ +U0 CursorMovementDemo() +{ + I64 i; + for (i=0;i<100;i++) { + "%03d ",i; + "$$CM,-4,1$$"; + if (i%10==9) + "$$CM,4,-10$$"; + } + + //+LX is relative to left side. + //See with cursor-movement for all the flags. + //Check "Quote" to set-up a cmd for in quotes. + "$$CM+LX,0,+10$$\n"; +} + +CursorMovementDemo; + +/*The word-wrap Off and On cmds are +$$WW,0$$ and $$WW,1$$. + +You might need $LK,"DocMax",A="MN:DocMax"$() to adjust +the cmd line window buf size. +It counts cmds, not lines. + +The +H flag will hold-onto an entry +so it doesn't get pushed-out of the document. +This is useful for a $$WW+H,1$$ cmd. + +See $LK,"::/Doc/DolDocOverview.DD"$ for documentation on +all flags and cmds. + +Note: the default page length is 66 lines +and branching back more than the page length +will rst the column to 1. So, set page +length to a large number if you want to +branch back a long distance. +*/ diff --git a/Demo/DolDoc/Data.CPP b/Demo/DolDoc/Data.CPP deleted file mode 100644 index 0396f0c..0000000 --- a/Demo/DolDoc/Data.CPP +++ /dev/null @@ -1,63 +0,0 @@ -/*$$DA is the data widget. - -TRM flag is for var - width fields with a terminator - character. - +RD refreshes the data. - +UD updates the val when you edit it. - - -P Means it is a string var, basically. - - ,32 sets the tag string width. - See $LK,"Data Tag Width",A="FA:::/Adam/DolDoc/DocPlain.CPP,DataTagWidth"$. - - ,RT=I16 means the val is 2 bytes. - See $LK,"DocDataFmt",A="MN:DocDataFmt"$() and $LK,"DocDataScan",A="MN:DocDataScan"$(). -*/ - -I16 i=0; -U8 buf[8]; - -U0 UpdateGlblTask(I64) -{ - while (TRUE) { - i++; - Sleep(1); - } -} - -U0 DataDemo() -{ - CDocEntry *doc_e; - - //This is the command line document. - CDoc *doc=DocPut; - - //We do this to prevent access to - //doc_e->data before it is set. - Bool unlock=DocLock(doc); - - //You might set the $LK,"DOCF_FORM",A="MN:DOCF_FORM"$ flag. - // doc->flags|=DOCF_FORM - //if you wish. - - Spawn(&UpdateGlblTask,NULL,"Update Glbl",,Fs); - - "Enter editor overstrike mode\n" - "and you can modify the val.\n" - "However, changes happen immediately,\n" - "so it's tricky.\n\n"; -//Use for the $$DA...$$ format. - doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=I16,A=\"%%7d\"$$\n"); - doc_e->data=&i; - - StrCpy(buf,"Terry"); - doc_e=DocPrint(doc,"$$DA-P+RD+UD,LEN=7,A=\"Str:%%s\"$$\n"); - doc_e->data=buf; - - if (unlock) - DocUnlock(doc); -} - -DataDemo; - -//See $LK,"PopUpExtents",A="MN:PopUpExtents"$(). diff --git a/Demo/DolDoc/Data.HC b/Demo/DolDoc/Data.HC new file mode 100644 index 0000000..11cdb2f --- /dev/null +++ b/Demo/DolDoc/Data.HC @@ -0,0 +1,63 @@ +/*$$DA is the data widget. + -TRM flag is for var + width fields with a terminator + character. + +RD refreshes the data. + +UD updates the val when you edit it. + + -P Means it is a string var, basically. + + ,32 sets the tag string width. + See $LK,"Data Tag Width",A="FA:::/Adam/DolDoc/DocPlain.HC,DataTagWidth"$. + + ,RT=I16 means the val is 2 bytes. + See $LK,"DocDataFmt",A="MN:DocDataFmt"$() and $LK,"DocDataScan",A="MN:DocDataScan"$(). +*/ + +I16 i=0; +U8 buf[8]; + +U0 UpdateGlblTask(I64) +{ + while (TRUE) { + i++; + Sleep(1); + } +} + +U0 DataDemo() +{ + CDocEntry *doc_e; + + //This is the command line document. + CDoc *doc=DocPut; + + //We do this to prevent access to + //doc_e->data before it is set. + Bool unlock=DocLock(doc); + + //You might set the $LK,"DOCF_FORM",A="MN:DOCF_FORM"$ flag. + // doc->flags|=DOCF_FORM + //if you wish. + + Spawn(&UpdateGlblTask,NULL,"Update Glbl",,Fs); + + "Enter editor overstrike mode\n" + "and you can modify the val.\n" + "However, changes happen immediately,\n" + "so it's tricky.\n\n"; +//Use for the $$DA...$$ format. + doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=I16,A=\"%%7d\"$$\n"); + doc_e->data=&i; + + StrCpy(buf,"Terry"); + doc_e=DocPrint(doc,"$$DA-P+RD+UD,LEN=7,A=\"Str:%%s\"$$\n"); + doc_e->data=buf; + + if (unlock) + DocUnlock(doc); +} + +DataDemo; + +//See $LK,"PopUpExtents",A="MN:PopUpExtents"$(). diff --git a/Demo/DolDoc/DefineStr.CPP b/Demo/DolDoc/DefineStr.HC similarity index 100% rename from Demo/DolDoc/DefineStr.CPP rename to Demo/DolDoc/DefineStr.HC diff --git a/Demo/DolDoc/DemoDoc.TXT b/Demo/DolDoc/DemoDoc.DD similarity index 100% rename from Demo/DolDoc/DemoDoc.TXT rename to Demo/DolDoc/DemoDoc.DD diff --git a/Demo/DolDoc/FileRead.CPP b/Demo/DolDoc/FileRead.CPP deleted file mode 100644 index e5bad67..0000000 --- a/Demo/DolDoc/FileRead.CPP +++ /dev/null @@ -1,80 +0,0 @@ -public U0 DocProfile(U8 *filename,I64 flags) -{ - I64 i,*cmd_stats=CAlloc(sizeof(I64)*DOCT_NUM_TYPES), - *flags_stats=CAlloc(sizeof(I64)*64), - *type_flags_stats=CAlloc(sizeof(I64)*64); -//Note: word wrap is determined by - //doc->win_task when a $LK,"CDoc",A="MN:CDoc"$ is recalculated - //use $LK,"DocRecalc",A="MN:DocRecalc"$(). - CDoc *doc=DocRead(filename,flags); - - //doc->head which is equ to doc is the - //header of the CQue and represents the end-of-file marker. - CDocEntry *doc_e=doc->head.next; - while (doc_e!=doc) { - cmd_stats[doc_e->type_u8]++; - for (i=0;i<64;i++) - if (Bt(&doc_e->de_flags,i)) - flags_stats[i]++; - for (i=16;i<32;i++) - if (Bt(&doc_e->type,i)) - type_flags_stats[i]++; - doc_e=doc_e->next; - } - DocDel(doc); - - "$$PURPLE$$-------%s-------\n",filename; - "$$GREEN$$The lowest byte of the 32-bit 'doc_e->type', " - "'$$PURPLE$$doc_e->type.u8[0]$$GREEN$$', " - "is cmd and accessed with the union " - "'$$PURPLE$$doc_e->type_u8$$GREEN$$'. " - "See $$LK,\"CDocEntry\",A=\"MN:CDocEntry\"$$, " - "$$LK,\"Doc Type Defines\",A=\"MN:DOCT_TEXT\"$$ and " - "$$LK,\"Doc Type Codes\"," - "A=\"FF:::/Adam/DolDoc/DocInit.CPP,ST_DOC_CMDS\"$$.\n" - "$$FG$$"; - for (i=0;itype.u8[1]$$GREEN$$' is " - "the screen color attr of the " - "entry. '$$PURPLE$$doc_e->type.u16[1]" - "$$GREEN$$' is some flags for blinking and " - "stuff. See $$LK,\"Doc Type Flag " - "Defines\",A=\"MN:DOCET_BLINK\"$$.\n$$FG$$"; - - for (i=16;i<32;i++) - if (type_flags_stats[i]) - "%4d:%d\n",i,type_flags_stats[i]; - - "$$GREEN$$\n'$$PURPLE$$doc_e->de_flags$$GREEN$$' is 64-bit. " - "See $$LK,\"Doc Flag Defines\",A=\"MN:DOCEf_TAG\"$$ and " - "$$LK,\"Doc Flag Codes\"," - "A=\"FF:::/Adam/DolDoc/DocInit.CPP,ST_DOC_FLAGS\"$$.\n" - "$$FG$$"; - for (i=0;i<64;i++) - if (flags_stats[i]) - "%4Z:%d\n",i,"ST_DOC_FLAGS",flags_stats[i]; - - Free(cmd_stats); - Free(flags_stats); - PressAKey; - '\n'; -} - -/*See $LK,"TipOfDay",A="MN:TipOfDay"$. - -Note: Not all $LK,"CDocEntry",A="MN:CDocEntry"$'s are full-sized nodes. -Some are $LK,"MAlloc",A="MN:MAlloc"$ed with a smaller size to save -mem. They all have at least the size $LK,"CDocEntryBase",A="MN:CDocEntryBase"$. - -Note: $LK,"CDocEntry",A="MN:CDocEntry"$'s should be alloced from the -heap of the owning task, doc->mem_task. - -The flag arrays $LK,"doldoc.type_flags_form",A="MN:CDolDocGlbls"$, etc -are useful. -*/ - -DocProfile("::/Doc/ChangeLog.TXT",0); -DocProfile("::/Doc/ChangeLog.TXT",DOCF_PLAIN_TEXT); diff --git a/Demo/DolDoc/FileRead.HC b/Demo/DolDoc/FileRead.HC new file mode 100644 index 0000000..3e59260 --- /dev/null +++ b/Demo/DolDoc/FileRead.HC @@ -0,0 +1,80 @@ +public U0 DocProfile(U8 *filename,I64 flags) +{ + I64 i,*cmd_stats=CAlloc(sizeof(I64)*DOCT_NUM_TYPES), + *flags_stats=CAlloc(sizeof(I64)*64), + *type_flags_stats=CAlloc(sizeof(I64)*64); +//Note: word wrap is determined by + //doc->win_task when a $LK,"CDoc",A="MN:CDoc"$ is recalculated + //use $LK,"DocRecalc",A="MN:DocRecalc"$(). + CDoc *doc=DocRead(filename,flags); + + //doc->head which is equ to doc is the + //header of the CQue and represents the end-of-file marker. + CDocEntry *doc_e=doc->head.next; + while (doc_e!=doc) { + cmd_stats[doc_e->type_u8]++; + for (i=0;i<64;i++) + if (Bt(&doc_e->de_flags,i)) + flags_stats[i]++; + for (i=16;i<32;i++) + if (Bt(&doc_e->type,i)) + type_flags_stats[i]++; + doc_e=doc_e->next; + } + DocDel(doc); + + "$$PURPLE$$-------%s-------\n",filename; + "$$GREEN$$The lowest byte of the 32-bit 'doc_e->type', " + "'$$PURPLE$$doc_e->type.u8[0]$$GREEN$$', " + "is cmd and accessed with the union " + "'$$PURPLE$$doc_e->type_u8$$GREEN$$'. " + "See $$LK,\"CDocEntry\",A=\"MN:CDocEntry\"$$, " + "$$LK,\"Doc Type Defines\",A=\"MN:DOCT_TEXT\"$$ and " + "$$LK,\"Doc Type Codes\"," + "A=\"FF:::/Adam/DolDoc/DocInit.HC,ST_DOC_CMDS\"$$.\n" + "$$FG$$"; + for (i=0;itype.u8[1]$$GREEN$$' is " + "the screen color attr of the " + "entry. '$$PURPLE$$doc_e->type.u16[1]" + "$$GREEN$$' is some flags for blinking and " + "stuff. See $$LK,\"Doc Type Flag " + "Defines\",A=\"MN:DOCET_BLINK\"$$.\n$$FG$$"; + + for (i=16;i<32;i++) + if (type_flags_stats[i]) + "%4d:%d\n",i,type_flags_stats[i]; + + "$$GREEN$$\n'$$PURPLE$$doc_e->de_flags$$GREEN$$' is 64-bit. " + "See $$LK,\"Doc Flag Defines\",A=\"MN:DOCEf_TAG\"$$ and " + "$$LK,\"Doc Flag Codes\"," + "A=\"FF:::/Adam/DolDoc/DocInit.HC,ST_DOC_FLAGS\"$$.\n" + "$$FG$$"; + for (i=0;i<64;i++) + if (flags_stats[i]) + "%4Z:%d\n",i,"ST_DOC_FLAGS",flags_stats[i]; + + Free(cmd_stats); + Free(flags_stats); + PressAKey; + '\n'; +} + +/*See $LK,"TipOfDay",A="MN:TipOfDay"$. + +Note: Not all $LK,"CDocEntry",A="MN:CDocEntry"$'s are full-sized nodes. +Some are $LK,"MAlloc",A="MN:MAlloc"$ed with a smaller size to save +mem. They all have at least the size $LK,"CDocEntryBase",A="MN:CDocEntryBase"$. + +Note: $LK,"CDocEntry",A="MN:CDocEntry"$'s should be alloced from the +heap of the owning task, doc->mem_task. + +The flag arrays $LK,"doldoc.type_flags_form",A="MN:CDolDocGlbls"$, etc +are useful. +*/ + +DocProfile("::/Doc/ChangeLog.DD",0); +DocProfile("::/Doc/ChangeLog.DD",DOCF_PLAIN_TEXT); diff --git a/Demo/DolDoc/Form.CPP b/Demo/DolDoc/Form.HC similarity index 100% rename from Demo/DolDoc/Form.CPP rename to Demo/DolDoc/Form.HC diff --git a/Demo/DolDoc/MenuButton.CPP b/Demo/DolDoc/MenuButton.HC similarity index 100% rename from Demo/DolDoc/MenuButton.CPP rename to Demo/DolDoc/MenuButton.HC diff --git a/Demo/DolDoc/MenuSprite.CPP b/Demo/DolDoc/MenuSprite.HC similarity index 100% rename from Demo/DolDoc/MenuSprite.CPP rename to Demo/DolDoc/MenuSprite.HC diff --git a/Demo/DolDoc/NumBible.CPP b/Demo/DolDoc/NumBible.CPP deleted file mode 100644 index fcfdbcc..0000000 --- a/Demo/DolDoc/NumBible.CPP +++ /dev/null @@ -1,29 +0,0 @@ -// This makes a new Bible file -//with line numbers. - -U0 NumBible() -{ - CDoc *doc_in=DocRead("::/Misc/Bible.TXT.Z",DOCF_PLAIN_TEXT_TABS), - *doc_out=DocNew("~/DemoNumBible.TXT.Z"); - CDocEntry *doc_e=doc_in->head.next; - while (doc_e!=doc_in) { - if (doc_e->type_u8==DOCT_TEXT) { - DocPrint(doc_out,"%05d %s",doc_e->y+1,doc_e->tag); - doc_e=doc_e->next; - if (doc_e->type_u8==DOCT_NEW_LINE) { - DocPrint(doc_out,"\n"); - doc_e=doc_e->next; - } - } else if (doc_e->type_u8==DOCT_NEW_LINE) { - DocPrint(doc_out,"%05d\n",doc_e->y+1); - doc_e=doc_e->next; - } else - doc_e=doc_e->next; - } - doc_out->flags|=DOCF_NO_CURSOR; - DocWrite(doc_out); - DocDel(doc_out); - DocDel(doc_in); -} - -NumBible; \ No newline at end of file diff --git a/Demo/DolDoc/NumBible.HC b/Demo/DolDoc/NumBible.HC new file mode 100644 index 0000000..918891f --- /dev/null +++ b/Demo/DolDoc/NumBible.HC @@ -0,0 +1,29 @@ +// This makes a new Bible file +//with line numbers. + +U0 NumBible() +{ + CDoc *doc_in=DocRead("::/Misc/Bible.TXT.Z",DOCF_PLAIN_TEXT_TABS), + *doc_out=DocNew("~/DemoNumBible.DD.Z"); + CDocEntry *doc_e=doc_in->head.next; + while (doc_e!=doc_in) { + if (doc_e->type_u8==DOCT_TEXT) { + DocPrint(doc_out,"%05d %s",doc_e->y+1,doc_e->tag); + doc_e=doc_e->next; + if (doc_e->type_u8==DOCT_NEW_LINE) { + DocPrint(doc_out,"\n"); + doc_e=doc_e->next; + } + } else if (doc_e->type_u8==DOCT_NEW_LINE) { + DocPrint(doc_out,"%05d\n",doc_e->y+1); + doc_e=doc_e->next; + } else + doc_e=doc_e->next; + } + doc_out->flags|=DOCF_NO_CURSOR; + DocWrite(doc_out); + DocDel(doc_out); + DocDel(doc_in); +} + +NumBible; \ No newline at end of file diff --git a/Demo/DolDoc/TextDemo.CPP b/Demo/DolDoc/TextDemo.HC similarity index 100% rename from Demo/DolDoc/TextDemo.CPP rename to Demo/DolDoc/TextDemo.HC diff --git a/Demo/DolDoc/TreeDemo.CPP b/Demo/DolDoc/TreeDemo.HC similarity index 100% rename from Demo/DolDoc/TreeDemo.CPP rename to Demo/DolDoc/TreeDemo.HC diff --git a/Demo/DolDoc/UnusedDefine.CPP b/Demo/DolDoc/UnusedDefine.HC similarity index 100% rename from Demo/DolDoc/UnusedDefine.CPP rename to Demo/DolDoc/UnusedDefine.HC diff --git a/Demo/Dsk/BlkDevRep.CPP b/Demo/Dsk/BlkDevRep.CPP deleted file mode 100644 index 826bbe9..0000000 --- a/Demo/Dsk/BlkDevRep.CPP +++ /dev/null @@ -1,13 +0,0 @@ -U0 BlkDevRep() -{//Block Device Report. - I64 i; - for (i=0;icompressed_size); - "$$GREEN$$***************:%7d$$FG$$\n",size; - ptr=ExpandBuf(arc); - size=arc->expanded_size; - Free(arc); - D(ptr,size); - "$$GREEN$$***************:%7d$$FG$$\n",size; - tempde=DirTreeUnserialize(ptr); - LineRep2(DocPut,tempde); //We don't have $LK,"CDirEntry",A="MN:CDirEntry"$.fullname - DirTreeDel(tempde); -} - -SerializeTree; diff --git a/Demo/Dsk/SerializeTree.HC b/Demo/Dsk/SerializeTree.HC new file mode 100644 index 0000000..d754e62 --- /dev/null +++ b/Demo/Dsk/SerializeTree.HC @@ -0,0 +1,35 @@ +/*You probably don't need this. It makes a directory +tree into a flat contiguous memory chunk, suitable for +serial communication and rebuilds it into a tree on the +other end. +*/ + +U0 SerializeTree() +{ + CDirEntry *tempde=FilesFind("/Demo/*.DD*",FUF_RECURSE); + I64 size; + U8 *ptr; + CArcCompress *arc; + + LineRep1(tempde); //We have $LK,"CDirEntry",A="MN:CDirEntry"$.fullname + LineRep2(DocPut,tempde); + "$$GREEN$$***************$$FG$$\n"; + ptr=DirTreeSerialize(tempde,&size); + DirTreeDel(tempde); + D(ptr,size); + "$$GREEN$$***************:%7d$$FG$$\n",size; + arc=CompressBuf(ptr,size); + Free(ptr); + D(arc,arc->compressed_size); + "$$GREEN$$***************:%7d$$FG$$\n",size; + ptr=ExpandBuf(arc); + size=arc->expanded_size; + Free(arc); + D(ptr,size); + "$$GREEN$$***************:%7d$$FG$$\n",size; + tempde=DirTreeUnserialize(ptr); + LineRep2(DocPut,tempde); //We don't have $LK,"CDirEntry",A="MN:CDirEntry"$.fullname + DirTreeDel(tempde); +} + +SerializeTree; diff --git a/Demo/Dsk/UnusedSpaceRep.CPP b/Demo/Dsk/UnusedSpaceRep.HC similarity index 100% rename from Demo/Dsk/UnusedSpaceRep.CPP rename to Demo/Dsk/UnusedSpaceRep.HC diff --git a/Demo/Exceptions.CPP b/Demo/Exceptions.HC similarity index 100% rename from Demo/Exceptions.CPP rename to Demo/Exceptions.HC diff --git a/Demo/ExtChars.HC b/Demo/ExtChars.HC new file mode 100644 index 0000000..eb92cd0 --- /dev/null +++ b/Demo/ExtChars.HC @@ -0,0 +1,36 @@ + +U8 face[8]={ + +0b00111100, +0b01000010, +0b10100101, +0b10000001, +0b11000011, +0b10111101, +0b01000010, +0b00111100, + +}; + + +text.font[255]=face[0](U64); + +"Face:ÿ\n"; + +//Chars 128-255 are treated as letters +//by the compiler and everything else. +//Enter them by holding ALT and +//pressing a 3 digit decimal number or +//press . + +U0 SrcExample() +{ + I64 fÿÿ=12345; + "fÿÿ=%d\n",fÿÿ; +} + +SrcExample; +//See $LK,"::/Demo/ScreenCodes.HC"$, $LK,"::/Demo/Graphics/CharAnimation.HC"$, +//$LK,"::/Demo/Games/CharDemo.HC"$ and $LK,"::/Demo/Graphics/FontEd.HC"$. + +//See $LK,"chars_bmp_alpha",A="MN:chars_bmp_alpha"$ and $LK,"chars_bmp_alpha_numeric",A="MN:chars_bmp_alpha_numeric"$. diff --git a/Demo/ExtendedChars.CPP b/Demo/ExtendedChars.CPP deleted file mode 100644 index 3e1df6f..0000000 --- a/Demo/ExtendedChars.CPP +++ /dev/null @@ -1,36 +0,0 @@ - -U8 face[8]={ - -0b00111100, -0b01000010, -0b10100101, -0b10000001, -0b11000011, -0b10111101, -0b01000010, -0b00111100, - -}; - - -text.font[255]=face[0](U64); - -"Face:ÿ\n"; - -//Chars 128-255 are treated as letters -//by the compiler and everything else. -//Enter them by holding ALT and -//pressing a 3 digit decimal number or -//press . - -U0 SrcExample() -{ - I64 fÿÿ=12345; - "fÿÿ=%d\n",fÿÿ; -} - -SrcExample; -//See $LK,"::/Demo/ScreenCodes.CPP"$, $LK,"::/Demo/Graphics/CharAnimation.CPP"$, -//$LK,"::/Demo/Games/CharDemo.CPP"$ and $LK,"::/Demo/Graphics/FontEd.CPP"$. - -//See $LK,"chars_bmp_alpha",A="MN:chars_bmp_alpha"$ and $LK,"chars_bmp_alpha_numeric",A="MN:chars_bmp_alpha_numeric"$. diff --git a/Demo/Games/BattleLines.CPP b/Demo/Games/BattleLines.CPP deleted file mode 100644 index 46b037d..0000000 Binary files a/Demo/Games/BattleLines.CPP and /dev/null differ diff --git a/Demo/Games/BattleLines.HC b/Demo/Games/BattleLines.HC new file mode 100644 index 0000000..4d0f74a Binary files /dev/null and b/Demo/Games/BattleLines.HC differ diff --git a/Demo/Games/BigGuns.CPP b/Demo/Games/BigGuns.CPP deleted file mode 100644 index 450d70d..0000000 Binary files a/Demo/Games/BigGuns.CPP and /dev/null differ diff --git a/Demo/Games/BigGuns.HC b/Demo/Games/BigGuns.HC new file mode 100644 index 0000000..1a0bc9a Binary files /dev/null and b/Demo/Games/BigGuns.HC differ diff --git a/Demo/Games/BlackDiamond.CPP b/Demo/Games/BlackDiamond.CPP deleted file mode 100644 index d5fe0f6..0000000 Binary files a/Demo/Games/BlackDiamond.CPP and /dev/null differ diff --git a/Demo/Games/BlackDiamond.HC b/Demo/Games/BlackDiamond.HC new file mode 100644 index 0000000..745a21d Binary files /dev/null and b/Demo/Games/BlackDiamond.HC differ diff --git a/Demo/Games/BomberGolf.CPP b/Demo/Games/BomberGolf.HC similarity index 100% rename from Demo/Games/BomberGolf.CPP rename to Demo/Games/BomberGolf.HC diff --git a/Demo/Games/CastleFrankenstein.CPP b/Demo/Games/CastleFrankenstein.CPP deleted file mode 100644 index 4665201..0000000 --- a/Demo/Games/CastleFrankenstein.CPP +++ /dev/null @@ -1,770 +0,0 @@ -//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$. - -RegSetDftEntry("TempleOS/CastleFrankenstein","F64 best_score=9999;\n"); -RegExeBranch("TempleOS/CastleFrankenstein"); - -//Set snap to 4 and width to 4 -//if you edit this map. - -//Don't forget to change the -//starting pos. -#define MAN_START_X 0 -#define MAN_START_Y 4.5 - -$SP,"<1>",BI=1$ - - - - - - - - - - - - - - -#define MONSTER_SCALE 2.0 - - $SP,"<2>",BI=2$ - - - - - - - - - - - $SP,"<3>",BI=3$ - - - - - - - - - - $SP,"<4>",BI=4$ - - - - - - - -#define PLANT_SCALE 2.0 - - - - $SP,"<5>",BI=5$ - - - - - - - - - - - - - - $SP,"<6>",BI=6$ - - - - - - - -#define SCREEN_SCALE 512 -#define PLOT_GRID_WIDTH 24 -#define PLOT_GRID_HEIGHT 24 -#define MAN_HEIGHT 125 - -#define MAP_SCALE 4 -I64 map_width,map_height; -U8 *map=NULL, -*panels_processed_bitmap=NULL; - -I64 man_xx,man_yy; -F64 man_é; - -F64 t0,tf; - -#define NUM_MONSTERS 10 -I64 monsters_left; -class Monster -{ - I64 x,y; - Bool dead,pad[7]; -} monsters[NUM_MONSTERS]; - -U0 CFTransform(CDC *dc,I64 *x,I64 *y,I64 *z) -{ - I64 zz; - Mat4x4MulXYZ(dc->r,x,y,z); - zz=SCREEN_SCALE/3+*z; - if (zz<1) zz=1; - *x=SCREEN_SCALE/2* *x/zz; - *y=SCREEN_SCALE/2* (*y+MAN_HEIGHT)/zz; - *x+=dc->x; - *y+=dc->y; - *z+=dc->z; -} - -#define LOS_SCALE 4 - -Bool LOSPlot(U8 *,I64 x,I64 y,I64) -{ - if (!map[(y/LOS_SCALE)*map_width+(x/LOS_SCALE)]) - return FALSE; - else - return TRUE; -} - -Bool LOS(I64 x1,I64 y1,I64 x2,I64 y2) -{//Line of sight - return Line(NULL,x1*LOS_SCALE/SCREEN_SCALE,y1*LOS_SCALE/SCREEN_SCALE,0, - x2*LOS_SCALE/SCREEN_SCALE,y2*LOS_SCALE/SCREEN_SCALE,0,&LOSPlot); -} - -U0 DrawIt(CTask *task,CDC *dc) -{ - I64 i,j,*r1,*r2,*r3,*s2w,xx,yy,zz,x,y,x1,y1,z1, - c,x1w,y1w,x1h,y1h,xh,yh,zh, - cx=task->pix_width/2, - cy=task->pix_height/2; - U8 *temps; - F64 tt; - CD3I32 poly[4]; - Monster *tempm; - - DCDepthBufAlloc(dc); - MemSet(panels_processed_bitmap,0,(map_width*map_height+7)>>3); - - //World to screen - Mat4x4RotZ(dc->r,man_é+ã/2); - Mat4x4RotX(dc->r,ã/2); - DCMat4x4Set(dc,dc->r); - - xh=-man_xx/SCREEN_SCALE; yh=-man_yy/SCREEN_SCALE; zh=0; - Mat4x4MulXYZ(dc->r,&xh,&yh,&zh); - Mat4x4TranslationEqu(dc->r,xh,yh,zh); - - //Screen to world - s2w=Mat4x4IdentNew(task); - Mat4x4RotX(s2w,-ã/2); - Mat4x4RotZ(s2w,-man_é-ã/2); - xh=0; yh=0; zh=SCREEN_SCALE; - Mat4x4MulXYZ(s2w,&xh,&yh,&zh); - - //Rotate light source - xx=dc->ls.x; yy=dc->ls.y; zz=-dc->ls.z; - (*dc->transform)(dc,&xx,&yy,&zz); - dc->ls.x=xx; dc->ls.y=yy; dc->ls.z=zz; - - dc->flags|=DCF_TRANSFORMATION; - dc->transform=&CFTransform; - dc->x=cx; - dc->y=cy; - r1=Mat4x4IdentNew(task); - Mat4x4RotX(r1,-ã/2); - Mat4x4RotZ(r1,tS); - Mat4x4Scale(r1,MONSTER_SCALE); - - r2=Mat4x4IdentNew(task); - Mat4x4Scale(r2,MONSTER_SCALE); - - r3=Mat4x4IdentNew(task); - Mat4x4RotX(r3,-ã/2); - Mat4x4Scale(r3,PLANT_SCALE); - - Seed(1); - x1h=man_xx+yh*PLOT_GRID_WIDTH/2+xh*(PLOT_GRID_HEIGHT-1); - y1h=man_yy-xh*PLOT_GRID_WIDTH/2+yh*(PLOT_GRID_HEIGHT-1); - xh>>=1; yh>>=1; - for (j=0;jcolor=DKGRAY; - else - dc->color=c; - poly[0].x=x; - poly[0].y=y; - poly[0].z=0; - poly[1].x=x+SCREEN_SCALE; - poly[1].y=y; - poly[1].z=0; - poly[2].x=x+SCREEN_SCALE; - poly[2].y=y+SCREEN_SCALE; - poly[2].z=0; - poly[3].x=x; - poly[3].y=y+SCREEN_SCALE; - poly[3].z=0; - GrFillPoly3(dc,4,poly); - if (c==GREEN) { - x1=x+SCREEN_SCALE/2; - y1=y+SCREEN_SCALE/2; - z1=0; - DCTransform(dc,&x1,&y1,&z1); - if (z1>0) - SpriteMat3B(dc,x+SCREEN_SCALE/2,y+SCREEN_SCALE/2,0,$IB,"<5>",BI=5$,r3); - } else if (c==YELLOW) { - x1=x+SCREEN_SCALE/2; - y1=y+SCREEN_SCALE/2; - z1=0; - DCTransform(dc,&x1,&y1,&z1); - if (z1>0) - SpriteMat3B(dc,x+SCREEN_SCALE/2,y+SCREEN_SCALE/2,0,$IB,"<6>",BI=6$,r3); - } - - if (!map[(yy+1)*map_width+xx]) { - dc->color=LTGRAY; - poly[0].x=x; - poly[0].y=y+SCREEN_SCALE; - poly[0].z=0; - poly[1].x=x+SCREEN_SCALE; - poly[1].y=y+SCREEN_SCALE; - poly[1].z=0; - poly[2].x=x+SCREEN_SCALE; - poly[2].y=y+SCREEN_SCALE; - poly[2].z=SCREEN_SCALE; - poly[3].x=x; - poly[3].y=y+SCREEN_SCALE; - poly[3].z=SCREEN_SCALE; - GrFillPoly3(dc,4,poly); - } - if (!map[yy*map_width+xx+1]) { - dc->color=WHITE; - poly[0].x=x+SCREEN_SCALE; - poly[0].y=y; - poly[0].z=0; - poly[1].x=x+SCREEN_SCALE; - poly[1].y=y+SCREEN_SCALE; - poly[1].z=0; - poly[2].x=x+SCREEN_SCALE; - poly[2].y=y+SCREEN_SCALE; - poly[2].z=SCREEN_SCALE; - poly[3].x=x+SCREEN_SCALE; - poly[3].y=y; - poly[3].z=SCREEN_SCALE; - GrFillPoly3(dc,4,poly); - } - if (!map[(yy-1)*map_width+xx]) { - dc->color=LTGRAY; - poly[0].x=x; - poly[0].y=y; - poly[0].z=0; - poly[1].x=x+SCREEN_SCALE; - poly[1].y=y; - poly[1].z=0; - poly[2].x=x+SCREEN_SCALE; - poly[2].y=y; - poly[2].z=SCREEN_SCALE; - poly[3].x=x; - poly[3].y=y; - poly[3].z=SCREEN_SCALE; - GrFillPoly3(dc,4,poly); - } - if (!map[yy*map_width+xx-1]) { - dc->color=WHITE; - poly[0].x=x; - poly[0].y=y; - poly[0].z=0; - poly[1].x=x; - poly[1].y=y+SCREEN_SCALE; - poly[1].z=0; - poly[2].x=x; - poly[2].y=y+SCREEN_SCALE; - poly[2].z=SCREEN_SCALE; - poly[3].x=x; - poly[3].y=y; - poly[3].z=SCREEN_SCALE; - GrFillPoly3(dc,4,poly); - } - } - } - x1w-=yh; - y1w+=xh; - } - x1h-=xh; - y1h-=yh; - } - - //Draw Monsters - for (i=0,tempm=monsters;ix; - y=tempm->y; - if (LOS(x,y,man_xx,man_yy)) { - x-=man_xx; - y-=man_yy; - xx=x; - yy=y; - zz=0; - DCTransform(dc,&xx,&yy,&zz); - if (zz>0) { - if (tempm->dead) - SpriteMat3B(dc,x,y,0,$IB,"<2>",BI=2$,r2); - else { - tt=Tri(tS,1.0); - temps=SpriteInterpolate(tt,$IB,"<3>",BI=3$,$IB,"<4>",BI=4$); - SpriteMat3B(dc,x,y,0,temps,r1); - Free(temps); - } - } - } - } - Free(r1); - Free(r2); - Free(r3); - - //Draw Map heads-up display, scaled 2 pixs - Free(dc->r); - DCMat4x4Set(dc,Mat4x4IdentNew(task)); - dc->x=task->pix_width -2*map_width; - dc->y=task->pix_height-2*map_height; - dc->z=0; - dc->transform=&DCTransform; - dc->pen_width=2; - for (i=0;icolor=map[(map_height-1-i)*map_width+j]; - GrPlot3(dc,2*j,2*i,0); - } - - //Draw Things on heads-up Map - dc->color=LTPURPLE; - for (i=0,tempm=monsters;idead) - GrPlot3(dc,2*(tempm->x/SCREEN_SCALE), - 2*(map_height-1-tempm->y/SCREEN_SCALE),0); - dc->color=LTCYAN; - GrPlot3(dc,2*(man_xx/SCREEN_SCALE),2*(map_height-1-man_yy/SCREEN_SCALE),0); - - if (tf) { - dc->color=LTRED; - if (Blink) - GrPrint(dc,cx-(FONT_WIDTH*14)/2,cy-FONT_HEIGHT/2,"Game Completed"); - tt=tf; - } else { - dc->color=LTGREEN; - GrLine(dc,cx-5,cy,cx+5,cy); - GrLine(dc,cx,cy-5,cx,cy+5); - tt=tS; - } - GrPrint(dc,0,0,"Enemy:%d Time:%3.2f Best:%3.2f", - monsters_left,tt-t0,best_score); - Free(s2w); - Seed(0); -} - -U0 Fire() -{ - I64 i,x,y; - F64 d,dx,dy,xx=Cos(man_é),yy=Sin(man_é); - Monster *tempm; - - Noise(100,300,1000); - for (i=0,tempm=monsters;ix; - y=tempm->y; - if (!tempm->dead && - LOS(x,y,man_xx,man_yy)) { - dx=x-man_xx; - dy=man_yy-y; - if (d=Sqrt(dx*dx+dy*dy)) { - dx/=d; - dy/=d; - if (dx*xx+dy*yy>0.995) { - tempm->dead=TRUE; - if (!--monsters_left) { - tf=tS; - if (tf-t0",BI=1$); - map_width =dc->width/MAP_SCALE+2; - map_height=dc->height/MAP_SCALE+2; - Free(map); - Free(panels_processed_bitmap); - map=CAlloc(map_width*map_height*sizeof(U8)); - panels_processed_bitmap=MAlloc((map_width*map_height+7)>>3); - for (y=0;ydead=FALSE; - do { - tempm->x=RandU64%((map_width-2)*SCREEN_SCALE)+SCREEN_SCALE; - tempm->y=RandU64%((map_height-2)*SCREEN_SCALE)+SCREEN_SCALE; - } while (!map[(tempm->y/SCREEN_SCALE)*map_width+tempm->x/SCREEN_SCALE]); - } - monsters_left=NUM_MONSTERS; - tf=0; - t0=tS; -} - -U0 AnimateTask(I64) -{ - I64 i,x,y,dd; - Monster *tempm; - - while (TRUE) { - dd=0.25*SCREEN_SCALE*Sin(tS/2); - for (i=0,tempm=monsters;idead) { - x=tempm->x; - y=tempm->y; - if (i&1) - x+=dd; - else - y+=dd; - if (0<=x<=map_width*SCREEN_SCALE && - 0<=y<=map_height*SCREEN_SCALE && - map[(y/SCREEN_SCALE)*map_width+x/SCREEN_SCALE]) { - if (!map[(y/SCREEN_SCALE)*map_width+x/SCREEN_SCALE+1] && - x-RoundI64(x,SCREEN_SCALE)>SCREEN_SCALE/2 || - !map[(y/SCREEN_SCALE)*map_width+x/SCREEN_SCALE-1] && - x-RoundI64(x,SCREEN_SCALE)SCREEN_SCALE/2 || - !map[(y/SCREEN_SCALE-1)*map_width+x/SCREEN_SCALE] && - y-RoundI64(y,SCREEN_SCALE)x=x; - tempm->y=y; - } - } - Sleep(20); - } -} - -U0 CleanUp() -{ - Free(map); - Free(panels_processed_bitmap); - map=NULL; - panels_processed_bitmap=NULL; -} - -U0 SongTask(I64) -{//Song by Terry A. Davis - Fs->task_end_cb=&SndTaskEndCB; - MusicSettingsRst; - while (TRUE) { - Play("2q.A#1eG2AeA#qAq.A#1eG2eAeA#qA"); - Play("q.A#1eG2A#A1qG2q.A#1eG2A#A1qG"); - Play("3eA#A2qG3eA#A2qG3eA#A2G3AA#A2qG"); - } -} - -U0 MoveMan(F64 é) -{ - I64 x,y,color,step=SCREEN_SCALE/2; - do { - x=man_xx+step*Cos(é); - y=man_yy-step*Sin(é); - x=Clamp(x,0,map_width*SCREEN_SCALE); - y=Clamp(y,0,map_height*SCREEN_SCALE); - color=map[y/SCREEN_SCALE*map_width+x/SCREEN_SCALE]; - if (color==DKGRAY || color==GREEN) { - man_xx=x; - man_yy=y; - break; - } else - step>>=1; - } while (step); -} - -#define MICRO_STEPS 4 -U0 RotateMan(F64 d) -{ - I64 i; - for (i=0;itext_attr=DKGRAY<<4+WHITE; - AutoComplete; - WinBorder; - WinMax; - DocCursor; - Init; - Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs); - Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs); - Fs->draw_it=&DrawIt; - - try { - while (TRUE) { - switch (GetKey(&sc)) { - case CH_SPACE: - Fire; - break; - case '\n': - Init; - break; - case CH_ESC: - case CH_SHIFT_ESC: - goto fs_done; - case 0: - switch (sc.u8[0]) { - case SC_CURSOR_RIGHT: - Spawn(&RotateMan,(ã/32)(I64)); - break; - case SC_CURSOR_LEFT: - Spawn(&RotateMan,(-ã/32)(I64)); - break; - case SC_CURSOR_UP: - MoveMan(man_é); - break; - case SC_CURSOR_DOWN: - MoveMan(man_é+ã); - break; - } - break; - } - } -fs_done: - } catch - PutExcept; - DocClear; - SettingsPop; - CleanUp; - MenuPop; - RegWriteBranch("TempleOS/CastleFrankenstein","F64 best_score=%5.4f;\n", - best_score); -} - -CastleFrankenstein; -& -  -   - < -<< -<  -,,, -$8 -88 -8$ -$$ -$4 -44 -4 ( -( ( -(0 -,0T0 -T0TL -TL,L -,L,4 -04P4 -P4PH -PH0H -0H08 -08L8 -L8LD -LD4D -4D4< -4<H< -H<H@ -H@8@ -T@l@ -l4lL -lLˆL -ˆLˆ$ -ˆ$€$ -€$€0 -€0l0 -p4„4 -„(„H -€HpH -pDp8 -p8€8 -€8€D -€DtH -tDt< -t<|< -x@|@ -|DxD -„ „ -„t -pp -p\ -\\ -\l -lh -ll -l` -`` -`d -dd -h h -XT -PP -PL -LL -(@@ -8H -HH -H8 -88 -8D -D D - D < Z,u - @ Z -DD< -DDD\ -D\DdT0T8THL0LLd d hh88x8|8|4x4tt$t@8HLL,L4L<LZ<HñÿÿÿñÿÿÿØÿÿÿìÿÿÿØÿÿÿûÿÿÿ¿ÿÿÿ¿ÿÿÿØÿÿÿØÿÿÿìÿÿÿƒÿÿÿçÿÿÿƒÿÿÿûÿÿÿƒÿÿÿƒÿÿÿ -tÿÿÿöÿÿÿtÿÿÿ -¿ÿÿÿöÿÿÿ¿ÿÿÿƒÿÿÿ - -tÿÿÿ -ƒÿÿÿ -ûÿÿÿƒÿÿÿ -çÿÿÿƒÿÿÿ - -¿ÿÿÿ -¿ÿÿÿ -ûÿÿÿ¿ÿÿÿ -öÿÿÿ¿ÿÿÿ -ìÿÿÿØÿÿÿ -ñÿÿÿØÿÿÿ -Øÿÿÿ -Øÿÿÿ -ûÿÿÿ -ûÿÿÿ -ñÿÿÿûÿÿÿ -ìÿÿÿûÿÿÿ -ƒÿÿÿ -ìÿÿÿƒÿÿÿ -çÿÿÿ«ÿÿÿ-ìÿÿÿ«ÿÿÿ-«ÿÿÿ-«ÿÿÿ-°ÿÿÿ-°ÿÿÿ-ìÿÿÿ°ÿÿÿ-çÿÿÿ°ÿÿÿ-øÿÿÿxÿÿÿ ýÿÿÿ|ÿÿÿ xÿÿÿ xÿÿÿ |ÿÿÿ öÿÿÿtÿÿÿ -ÿÿÿÿxÿÿÿ ìÿÿÿûÿÿÿñÿÿÿûÿÿÿñÿÿÿûÿÿÿûÿÿÿìÿÿÿ -     !!&''"#%$$#       ! - - - $%*$*+'&('()&(( $++ -0/.112-,7 765343! 3 45833!839;:7;766;;1 Z<HñÿÿÿöÿÿÿñÿÿÿØÿÿÿìÿÿÿØÿÿÿûÿÿÿ¿ÿÿÿ¿ÿÿÿØÿÿÿØÿÿÿìÿÿÿöÿÿÿƒÿÿÿçÿÿÿƒÿÿÿûÿÿÿƒÿÿÿƒÿÿÿ -tÿÿÿöÿÿÿtÿÿÿ -¿ÿÿÿöÿÿÿ¿ÿÿÿƒÿÿÿ - -tÿÿÿ -ƒÿÿÿ -ûÿÿÿƒÿÿÿ -çÿÿÿƒÿÿÿ - -¿ÿÿÿ -¿ÿÿÿ -ûÿÿÿ¿ÿÿÿ -öÿÿÿ¿ÿÿÿ -ìÿÿÿØÿÿÿ -ñÿÿÿØÿÿÿ -Øÿÿÿ -Øÿÿÿ -ûÿÿÿûÿÿÿñÿÿÿûÿÿÿìÿÿÿûÿÿÿƒÿÿÿ -ìÿÿÿƒÿÿÿ -çÿÿÿ«ÿÿÿ-ìÿÿÿ«ÿÿÿ-«ÿÿÿÓÿÿÿ«ÿÿÿÓÿÿÿ°ÿÿÿÓÿÿÿ°ÿÿÿÓÿÿÿìÿÿÿ°ÿÿÿ-çÿÿÿ°ÿÿÿ-øÿÿÿxÿÿÿ ýÿÿÿ|ÿÿÿ xÿÿÿ xÿÿÿ |ÿÿÿ öÿÿÿtÿÿÿ -ÿÿÿÿxÿÿÿ ìÿÿÿûÿÿÿñÿÿÿûÿÿÿñÿÿÿûÿÿÿ-ûÿÿÿ-ìÿÿÿ-- -     !!&''"#%$$#       ! - - - $%*$*+'&('()&(( $++ -0/.112-,7 765343! 3 45833!839;:7;766;;1 Z<HñÿÿÿñÿÿÿØÿÿÿìÿÿÿØÿÿÿûÿÿÿ¿ÿÿÿ¿ÿÿÿØÿÿÿØÿÿÿìÿÿÿöÿÿÿƒÿÿÿçÿÿÿƒÿÿÿûÿÿÿƒÿÿÿƒÿÿÿ -tÿÿÿöÿÿÿtÿÿÿ -¿ÿÿÿöÿÿÿ¿ÿÿÿƒÿÿÿ - -tÿÿÿ -ƒÿÿÿ -ûÿÿÿƒÿÿÿ -çÿÿÿƒÿÿÿ - -¿ÿÿÿ -¿ÿÿÿ -ûÿÿÿ¿ÿÿÿ -öÿÿÿ¿ÿÿÿ -ìÿÿÿØÿÿÿ -ñÿÿÿØÿÿÿ -Øÿÿÿ -Øÿÿÿ -ûÿÿÿûÿÿÿñÿÿÿûÿÿÿìÿÿÿûÿÿÿƒÿÿÿ -ìÿÿÿƒÿÿÿ -çÿÿÿ«ÿÿÿÓÿÿÿìÿÿÿ«ÿÿÿÓÿÿÿ«ÿÿÿ-«ÿÿÿ-°ÿÿÿ-°ÿÿÿ-ìÿÿÿ°ÿÿÿÓÿÿÿçÿÿÿ°ÿÿÿÓÿÿÿøÿÿÿxÿÿÿ ýÿÿÿ|ÿÿÿ xÿÿÿ xÿÿÿ |ÿÿÿ öÿÿÿtÿÿÿ -ÿÿÿÿxÿÿÿ ìÿÿÿûÿÿÿ#ñÿÿÿûÿÿÿ#ñÿÿÿ#ûÿÿÿûÿÿÿìÿÿÿ#öÿÿÿ -     !!&''"#%$$#       ! - - - $%*$*+'&('()&(( $++ -0/.112-,7 765343! 3 45833!839;:7;766;;1 ,ÎÿÿÿÎÿÿÿûÿÿÿçÿÿÿûÿÿÿçÿÿÿµÿÿÿÿÿÿƒÿÿÿÿÿÿâÿÿÿµÿÿÿâÿÿÿûÿÿÿÎÿÿÿûÿÿÿÎÿÿÿûÿÿÿûÿÿÿçÿÿÿûÿÿÿûÿÿÿçÿÿÿûÿÿÿµÿÿÿûÿÿÿÿÿÿûÿÿÿÿÿÿâÿÿÿûÿÿÿµÿÿÿâÿÿÿÿÿÿµÿÿÿâÿÿÿµÿÿÿâÿÿÿÿÿÿÿÿÿûÿÿÿµÿÿÿûÿÿÿâÿÿÿµÿÿÿûÿÿÿâÿÿÿÿÿÿûÿÿÿ  -  - -        -  - -   - ÷ÿÿÿ÷ÿÿÿñÿÿÿ÷ÿÿÿ ôÿÿÿ ÷ÿÿÿ øÿÿÿçÿÿÿìÿÿÿçÿÿÿìÿÿÿçÿÿÿøÿÿÿøÿÿÿçÿÿÿðÿÿÿçÿÿÿðÿÿÿçÿÿÿøÿÿÿçÿÿÿçÿÿÿ      -     - - -       (Øÿÿÿ(ØÿÿÿØÿÿÿØÿÿÿìÿÿÿÎÿÿÿÎÿÿÿìÿÿÿ‚‚ìÿÿÿ‚ìÿÿÿìÿÿÿ‚öÿÿÿâÿÿÿ‚ -âÿÿÿ‚ìÿÿÿ   - - -   - -            \ No newline at end of file diff --git a/Demo/Games/CastleFrankenstein.HC b/Demo/Games/CastleFrankenstein.HC new file mode 100644 index 0000000..bd612e6 --- /dev/null +++ b/Demo/Games/CastleFrankenstein.HC @@ -0,0 +1,770 @@ +//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.HC"$. + +RegSetDftEntry("TempleOS/CastleFrankenstein","F64 best_score=9999;\n"); +RegExeBranch("TempleOS/CastleFrankenstein"); + +//Set snap to 4 and width to 4 +//if you edit this map. + +//Don't forget to change the +//starting pos. +#define MAN_START_X 0 +#define MAN_START_Y 4.5 + +$SP,"<1>",BI=1$ + + + + + + + + + + + + + + +#define MONSTER_SCALE 2.0 + + $SP,"<2>",BI=2$ + + + + + + + + + + + $SP,"<3>",BI=3$ + + + + + + + + + + $SP,"<4>",BI=4$ + + + + + + + +#define PLANT_SCALE 2.0 + + + + $SP,"<5>",BI=5$ + + + + + + + + + + + + + + $SP,"<6>",BI=6$ + + + + + + + +#define SCREEN_SCALE 512 +#define PLOT_GRID_WIDTH 24 +#define PLOT_GRID_HEIGHT 24 +#define MAN_HEIGHT 125 + +#define MAP_SCALE 4 +I64 map_width,map_height; +U8 *map=NULL, +*panels_processed_bitmap=NULL; + +I64 man_xx,man_yy; +F64 man_é; + +F64 t0,tf; + +#define NUM_MONSTERS 10 +I64 monsters_left; +class Monster +{ + I64 x,y; + Bool dead,pad[7]; +} monsters[NUM_MONSTERS]; + +U0 CFTransform(CDC *dc,I64 *x,I64 *y,I64 *z) +{ + I64 zz; + Mat4x4MulXYZ(dc->r,x,y,z); + zz=SCREEN_SCALE/3+*z; + if (zz<1) zz=1; + *x=SCREEN_SCALE/2* *x/zz; + *y=SCREEN_SCALE/2* (*y+MAN_HEIGHT)/zz; + *x+=dc->x; + *y+=dc->y; + *z+=dc->z; +} + +#define LOS_SCALE 4 + +Bool LOSPlot(U8 *,I64 x,I64 y,I64) +{ + if (!map[(y/LOS_SCALE)*map_width+(x/LOS_SCALE)]) + return FALSE; + else + return TRUE; +} + +Bool LOS(I64 x1,I64 y1,I64 x2,I64 y2) +{//Line of sight + return Line(NULL,x1*LOS_SCALE/SCREEN_SCALE,y1*LOS_SCALE/SCREEN_SCALE,0, + x2*LOS_SCALE/SCREEN_SCALE,y2*LOS_SCALE/SCREEN_SCALE,0,&LOSPlot); +} + +U0 DrawIt(CTask *task,CDC *dc) +{ + I64 i,j,*r1,*r2,*r3,*s2w,xx,yy,zz,x,y,x1,y1,z1, + c,x1w,y1w,x1h,y1h,xh,yh,zh, + cx=task->pix_width/2, + cy=task->pix_height/2; + U8 *temps; + F64 tt; + CD3I32 poly[4]; + Monster *tempm; + + DCDepthBufAlloc(dc); + MemSet(panels_processed_bitmap,0,(map_width*map_height+7)>>3); + + //World to screen + Mat4x4RotZ(dc->r,man_é+ã/2); + Mat4x4RotX(dc->r,ã/2); + DCMat4x4Set(dc,dc->r); + + xh=-man_xx/SCREEN_SCALE; yh=-man_yy/SCREEN_SCALE; zh=0; + Mat4x4MulXYZ(dc->r,&xh,&yh,&zh); + Mat4x4TranslationEqu(dc->r,xh,yh,zh); + + //Screen to world + s2w=Mat4x4IdentNew(task); + Mat4x4RotX(s2w,-ã/2); + Mat4x4RotZ(s2w,-man_é-ã/2); + xh=0; yh=0; zh=SCREEN_SCALE; + Mat4x4MulXYZ(s2w,&xh,&yh,&zh); + + //Rotate light source + xx=dc->ls.x; yy=dc->ls.y; zz=-dc->ls.z; + (*dc->transform)(dc,&xx,&yy,&zz); + dc->ls.x=xx; dc->ls.y=yy; dc->ls.z=zz; + + dc->flags|=DCF_TRANSFORMATION; + dc->transform=&CFTransform; + dc->x=cx; + dc->y=cy; + r1=Mat4x4IdentNew(task); + Mat4x4RotX(r1,-ã/2); + Mat4x4RotZ(r1,tS); + Mat4x4Scale(r1,MONSTER_SCALE); + + r2=Mat4x4IdentNew(task); + Mat4x4Scale(r2,MONSTER_SCALE); + + r3=Mat4x4IdentNew(task); + Mat4x4RotX(r3,-ã/2); + Mat4x4Scale(r3,PLANT_SCALE); + + Seed(1); + x1h=man_xx+yh*PLOT_GRID_WIDTH/2+xh*(PLOT_GRID_HEIGHT-1); + y1h=man_yy-xh*PLOT_GRID_WIDTH/2+yh*(PLOT_GRID_HEIGHT-1); + xh>>=1; yh>>=1; + for (j=0;jcolor=DKGRAY; + else + dc->color=c; + poly[0].x=x; + poly[0].y=y; + poly[0].z=0; + poly[1].x=x+SCREEN_SCALE; + poly[1].y=y; + poly[1].z=0; + poly[2].x=x+SCREEN_SCALE; + poly[2].y=y+SCREEN_SCALE; + poly[2].z=0; + poly[3].x=x; + poly[3].y=y+SCREEN_SCALE; + poly[3].z=0; + GrFillPoly3(dc,4,poly); + if (c==GREEN) { + x1=x+SCREEN_SCALE/2; + y1=y+SCREEN_SCALE/2; + z1=0; + DCTransform(dc,&x1,&y1,&z1); + if (z1>0) + SpriteMat3B(dc,x+SCREEN_SCALE/2,y+SCREEN_SCALE/2,0,$IB,"<5>",BI=5$,r3); + } else if (c==YELLOW) { + x1=x+SCREEN_SCALE/2; + y1=y+SCREEN_SCALE/2; + z1=0; + DCTransform(dc,&x1,&y1,&z1); + if (z1>0) + SpriteMat3B(dc,x+SCREEN_SCALE/2,y+SCREEN_SCALE/2,0,$IB,"<6>",BI=6$,r3); + } + + if (!map[(yy+1)*map_width+xx]) { + dc->color=LTGRAY; + poly[0].x=x; + poly[0].y=y+SCREEN_SCALE; + poly[0].z=0; + poly[1].x=x+SCREEN_SCALE; + poly[1].y=y+SCREEN_SCALE; + poly[1].z=0; + poly[2].x=x+SCREEN_SCALE; + poly[2].y=y+SCREEN_SCALE; + poly[2].z=SCREEN_SCALE; + poly[3].x=x; + poly[3].y=y+SCREEN_SCALE; + poly[3].z=SCREEN_SCALE; + GrFillPoly3(dc,4,poly); + } + if (!map[yy*map_width+xx+1]) { + dc->color=WHITE; + poly[0].x=x+SCREEN_SCALE; + poly[0].y=y; + poly[0].z=0; + poly[1].x=x+SCREEN_SCALE; + poly[1].y=y+SCREEN_SCALE; + poly[1].z=0; + poly[2].x=x+SCREEN_SCALE; + poly[2].y=y+SCREEN_SCALE; + poly[2].z=SCREEN_SCALE; + poly[3].x=x+SCREEN_SCALE; + poly[3].y=y; + poly[3].z=SCREEN_SCALE; + GrFillPoly3(dc,4,poly); + } + if (!map[(yy-1)*map_width+xx]) { + dc->color=LTGRAY; + poly[0].x=x; + poly[0].y=y; + poly[0].z=0; + poly[1].x=x+SCREEN_SCALE; + poly[1].y=y; + poly[1].z=0; + poly[2].x=x+SCREEN_SCALE; + poly[2].y=y; + poly[2].z=SCREEN_SCALE; + poly[3].x=x; + poly[3].y=y; + poly[3].z=SCREEN_SCALE; + GrFillPoly3(dc,4,poly); + } + if (!map[yy*map_width+xx-1]) { + dc->color=WHITE; + poly[0].x=x; + poly[0].y=y; + poly[0].z=0; + poly[1].x=x; + poly[1].y=y+SCREEN_SCALE; + poly[1].z=0; + poly[2].x=x; + poly[2].y=y+SCREEN_SCALE; + poly[2].z=SCREEN_SCALE; + poly[3].x=x; + poly[3].y=y; + poly[3].z=SCREEN_SCALE; + GrFillPoly3(dc,4,poly); + } + } + } + x1w-=yh; + y1w+=xh; + } + x1h-=xh; + y1h-=yh; + } + + //Draw Monsters + for (i=0,tempm=monsters;ix; + y=tempm->y; + if (LOS(x,y,man_xx,man_yy)) { + x-=man_xx; + y-=man_yy; + xx=x; + yy=y; + zz=0; + DCTransform(dc,&xx,&yy,&zz); + if (zz>0) { + if (tempm->dead) + SpriteMat3B(dc,x,y,0,$IB,"<2>",BI=2$,r2); + else { + tt=Tri(tS,1.0); + temps=SpriteInterpolate(tt,$IB,"<3>",BI=3$,$IB,"<4>",BI=4$); + SpriteMat3B(dc,x,y,0,temps,r1); + Free(temps); + } + } + } + } + Free(r1); + Free(r2); + Free(r3); + + //Draw Map heads-up display, scaled 2 pixs + Free(dc->r); + DCMat4x4Set(dc,Mat4x4IdentNew(task)); + dc->x=task->pix_width -2*map_width; + dc->y=task->pix_height-2*map_height; + dc->z=0; + dc->transform=&DCTransform; + dc->pen_width=2; + for (i=0;icolor=map[(map_height-1-i)*map_width+j]; + GrPlot3(dc,2*j,2*i,0); + } + + //Draw Things on heads-up Map + dc->color=LTPURPLE; + for (i=0,tempm=monsters;idead) + GrPlot3(dc,2*(tempm->x/SCREEN_SCALE), + 2*(map_height-1-tempm->y/SCREEN_SCALE),0); + dc->color=LTCYAN; + GrPlot3(dc,2*(man_xx/SCREEN_SCALE),2*(map_height-1-man_yy/SCREEN_SCALE),0); + + if (tf) { + dc->color=LTRED; + if (Blink) + GrPrint(dc,cx-(FONT_WIDTH*14)/2,cy-FONT_HEIGHT/2,"Game Completed"); + tt=tf; + } else { + dc->color=LTGREEN; + GrLine(dc,cx-5,cy,cx+5,cy); + GrLine(dc,cx,cy-5,cx,cy+5); + tt=tS; + } + GrPrint(dc,0,0,"Enemy:%d Time:%3.2f Best:%3.2f", + monsters_left,tt-t0,best_score); + Free(s2w); + Seed(0); +} + +U0 Fire() +{ + I64 i,x,y; + F64 d,dx,dy,xx=Cos(man_é),yy=Sin(man_é); + Monster *tempm; + + Noise(100,300,1000); + for (i=0,tempm=monsters;ix; + y=tempm->y; + if (!tempm->dead && + LOS(x,y,man_xx,man_yy)) { + dx=x-man_xx; + dy=man_yy-y; + if (d=Sqrt(dx*dx+dy*dy)) { + dx/=d; + dy/=d; + if (dx*xx+dy*yy>0.995) { + tempm->dead=TRUE; + if (!--monsters_left) { + tf=tS; + if (tf-t0",BI=1$); + map_width =dc->width/MAP_SCALE+2; + map_height=dc->height/MAP_SCALE+2; + Free(map); + Free(panels_processed_bitmap); + map=CAlloc(map_width*map_height*sizeof(U8)); + panels_processed_bitmap=MAlloc((map_width*map_height+7)>>3); + for (y=0;ydead=FALSE; + do { + tempm->x=RandU64%((map_width-2)*SCREEN_SCALE)+SCREEN_SCALE; + tempm->y=RandU64%((map_height-2)*SCREEN_SCALE)+SCREEN_SCALE; + } while (!map[(tempm->y/SCREEN_SCALE)*map_width+tempm->x/SCREEN_SCALE]); + } + monsters_left=NUM_MONSTERS; + tf=0; + t0=tS; +} + +U0 AnimateTask(I64) +{ + I64 i,x,y,dd; + Monster *tempm; + + while (TRUE) { + dd=0.25*SCREEN_SCALE*Sin(tS/2); + for (i=0,tempm=monsters;idead) { + x=tempm->x; + y=tempm->y; + if (i&1) + x+=dd; + else + y+=dd; + if (0<=x<=map_width*SCREEN_SCALE && + 0<=y<=map_height*SCREEN_SCALE && + map[(y/SCREEN_SCALE)*map_width+x/SCREEN_SCALE]) { + if (!map[(y/SCREEN_SCALE)*map_width+x/SCREEN_SCALE+1] && + x-RoundI64(x,SCREEN_SCALE)>SCREEN_SCALE/2 || + !map[(y/SCREEN_SCALE)*map_width+x/SCREEN_SCALE-1] && + x-RoundI64(x,SCREEN_SCALE)SCREEN_SCALE/2 || + !map[(y/SCREEN_SCALE-1)*map_width+x/SCREEN_SCALE] && + y-RoundI64(y,SCREEN_SCALE)x=x; + tempm->y=y; + } + } + Sleep(20); + } +} + +U0 CleanUp() +{ + Free(map); + Free(panels_processed_bitmap); + map=NULL; + panels_processed_bitmap=NULL; +} + +U0 SongTask(I64) +{//Song by Terry A. Davis + Fs->task_end_cb=&SndTaskEndCB; + MusicSettingsRst; + while (TRUE) { + Play("2q.A#1eG2AeA#qAq.A#1eG2eAeA#qA"); + Play("q.A#1eG2A#A1qG2q.A#1eG2A#A1qG"); + Play("3eA#A2qG3eA#A2qG3eA#A2G3AA#A2qG"); + } +} + +U0 MoveMan(F64 é) +{ + I64 x,y,color,step=SCREEN_SCALE/2; + do { + x=man_xx+step*Cos(é); + y=man_yy-step*Sin(é); + x=Clamp(x,0,map_width*SCREEN_SCALE); + y=Clamp(y,0,map_height*SCREEN_SCALE); + color=map[y/SCREEN_SCALE*map_width+x/SCREEN_SCALE]; + if (color==DKGRAY || color==GREEN) { + man_xx=x; + man_yy=y; + break; + } else + step>>=1; + } while (step); +} + +#define MICRO_STEPS 4 +U0 RotateMan(F64 d) +{ + I64 i; + for (i=0;itext_attr=DKGRAY<<4+WHITE; + AutoComplete; + WinBorder; + WinMax; + DocCursor; + Init; + Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs); + Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs); + Fs->draw_it=&DrawIt; + + try { + while (TRUE) { + switch (GetKey(&sc)) { + case CH_SPACE: + Fire; + break; + case '\n': + Init; + break; + case CH_ESC: + case CH_SHIFT_ESC: + goto fs_done; + case 0: + switch (sc.u8[0]) { + case SC_CURSOR_RIGHT: + Spawn(&RotateMan,(ã/32)(I64)); + break; + case SC_CURSOR_LEFT: + Spawn(&RotateMan,(-ã/32)(I64)); + break; + case SC_CURSOR_UP: + MoveMan(man_é); + break; + case SC_CURSOR_DOWN: + MoveMan(man_é+ã); + break; + } + break; + } + } +fs_done: + } catch + PutExcept; + DocClear; + SettingsPop; + CleanUp; + MenuPop; + RegWriteBranch("TempleOS/CastleFrankenstein","F64 best_score=%5.4f;\n", + best_score); +} + +CastleFrankenstein; +& +  +   + < +<< +<  +,,, +$8 +88 +8$ +$$ +$4 +44 +4 ( +( ( +(0 +,0T0 +T0TL +TL,L +,L,4 +04P4 +P4PH +PH0H +0H08 +08L8 +L8LD +LD4D +4D4< +4<H< +H<H@ +H@8@ +T@l@ +l4lL +lLˆL +ˆLˆ$ +ˆ$€$ +€$€0 +€0l0 +p4„4 +„(„H +€HpH +pDp8 +p8€8 +€8€D +€DtH +tDt< +t<|< +x@|@ +|DxD +„ „ +„t +pp +p\ +\\ +\l +lh +ll +l` +`` +`d +dd +h h +XT +PP +PL +LL +(@@ +8H +HH +H8 +88 +8D +D D + D < Z,u + @ Z +DD< +DDD\ +D\DdT0T8THL0LLd d hh88x8|8|4x4tt$t@8HLL,L4L<LZ<HñÿÿÿñÿÿÿØÿÿÿìÿÿÿØÿÿÿûÿÿÿ¿ÿÿÿ¿ÿÿÿØÿÿÿØÿÿÿìÿÿÿƒÿÿÿçÿÿÿƒÿÿÿûÿÿÿƒÿÿÿƒÿÿÿ +tÿÿÿöÿÿÿtÿÿÿ +¿ÿÿÿöÿÿÿ¿ÿÿÿƒÿÿÿ + +tÿÿÿ +ƒÿÿÿ +ûÿÿÿƒÿÿÿ +çÿÿÿƒÿÿÿ + +¿ÿÿÿ +¿ÿÿÿ +ûÿÿÿ¿ÿÿÿ +öÿÿÿ¿ÿÿÿ +ìÿÿÿØÿÿÿ +ñÿÿÿØÿÿÿ +Øÿÿÿ +Øÿÿÿ +ûÿÿÿ +ûÿÿÿ +ñÿÿÿûÿÿÿ +ìÿÿÿûÿÿÿ +ƒÿÿÿ +ìÿÿÿƒÿÿÿ +çÿÿÿ«ÿÿÿ-ìÿÿÿ«ÿÿÿ-«ÿÿÿ-«ÿÿÿ-°ÿÿÿ-°ÿÿÿ-ìÿÿÿ°ÿÿÿ-çÿÿÿ°ÿÿÿ-øÿÿÿxÿÿÿ ýÿÿÿ|ÿÿÿ xÿÿÿ xÿÿÿ |ÿÿÿ öÿÿÿtÿÿÿ +ÿÿÿÿxÿÿÿ ìÿÿÿûÿÿÿñÿÿÿûÿÿÿñÿÿÿûÿÿÿûÿÿÿìÿÿÿ +     !!&''"#%$$#       ! + + + $%*$*+'&('()&(( $++ +0/.112-,7 765343! 3 45833!839;:7;766;;1 Z<HñÿÿÿöÿÿÿñÿÿÿØÿÿÿìÿÿÿØÿÿÿûÿÿÿ¿ÿÿÿ¿ÿÿÿØÿÿÿØÿÿÿìÿÿÿöÿÿÿƒÿÿÿçÿÿÿƒÿÿÿûÿÿÿƒÿÿÿƒÿÿÿ +tÿÿÿöÿÿÿtÿÿÿ +¿ÿÿÿöÿÿÿ¿ÿÿÿƒÿÿÿ + +tÿÿÿ +ƒÿÿÿ +ûÿÿÿƒÿÿÿ +çÿÿÿƒÿÿÿ + +¿ÿÿÿ +¿ÿÿÿ +ûÿÿÿ¿ÿÿÿ +öÿÿÿ¿ÿÿÿ +ìÿÿÿØÿÿÿ +ñÿÿÿØÿÿÿ +Øÿÿÿ +Øÿÿÿ +ûÿÿÿûÿÿÿñÿÿÿûÿÿÿìÿÿÿûÿÿÿƒÿÿÿ +ìÿÿÿƒÿÿÿ +çÿÿÿ«ÿÿÿ-ìÿÿÿ«ÿÿÿ-«ÿÿÿÓÿÿÿ«ÿÿÿÓÿÿÿ°ÿÿÿÓÿÿÿ°ÿÿÿÓÿÿÿìÿÿÿ°ÿÿÿ-çÿÿÿ°ÿÿÿ-øÿÿÿxÿÿÿ ýÿÿÿ|ÿÿÿ xÿÿÿ xÿÿÿ |ÿÿÿ öÿÿÿtÿÿÿ +ÿÿÿÿxÿÿÿ ìÿÿÿûÿÿÿñÿÿÿûÿÿÿñÿÿÿûÿÿÿ-ûÿÿÿ-ìÿÿÿ-- +     !!&''"#%$$#       ! + + + $%*$*+'&('()&(( $++ +0/.112-,7 765343! 3 45833!839;:7;766;;1 Z<HñÿÿÿñÿÿÿØÿÿÿìÿÿÿØÿÿÿûÿÿÿ¿ÿÿÿ¿ÿÿÿØÿÿÿØÿÿÿìÿÿÿöÿÿÿƒÿÿÿçÿÿÿƒÿÿÿûÿÿÿƒÿÿÿƒÿÿÿ +tÿÿÿöÿÿÿtÿÿÿ +¿ÿÿÿöÿÿÿ¿ÿÿÿƒÿÿÿ + +tÿÿÿ +ƒÿÿÿ +ûÿÿÿƒÿÿÿ +çÿÿÿƒÿÿÿ + +¿ÿÿÿ +¿ÿÿÿ +ûÿÿÿ¿ÿÿÿ +öÿÿÿ¿ÿÿÿ +ìÿÿÿØÿÿÿ +ñÿÿÿØÿÿÿ +Øÿÿÿ +Øÿÿÿ +ûÿÿÿûÿÿÿñÿÿÿûÿÿÿìÿÿÿûÿÿÿƒÿÿÿ +ìÿÿÿƒÿÿÿ +çÿÿÿ«ÿÿÿÓÿÿÿìÿÿÿ«ÿÿÿÓÿÿÿ«ÿÿÿ-«ÿÿÿ-°ÿÿÿ-°ÿÿÿ-ìÿÿÿ°ÿÿÿÓÿÿÿçÿÿÿ°ÿÿÿÓÿÿÿøÿÿÿxÿÿÿ ýÿÿÿ|ÿÿÿ xÿÿÿ xÿÿÿ |ÿÿÿ öÿÿÿtÿÿÿ +ÿÿÿÿxÿÿÿ ìÿÿÿûÿÿÿ#ñÿÿÿûÿÿÿ#ñÿÿÿ#ûÿÿÿûÿÿÿìÿÿÿ#öÿÿÿ +     !!&''"#%$$#       ! + + + $%*$*+'&('()&(( $++ +0/.112-,7 765343! 3 45833!839;:7;766;;1 ,ÎÿÿÿÎÿÿÿûÿÿÿçÿÿÿûÿÿÿçÿÿÿµÿÿÿÿÿÿƒÿÿÿÿÿÿâÿÿÿµÿÿÿâÿÿÿûÿÿÿÎÿÿÿûÿÿÿÎÿÿÿûÿÿÿûÿÿÿçÿÿÿûÿÿÿûÿÿÿçÿÿÿûÿÿÿµÿÿÿûÿÿÿÿÿÿûÿÿÿÿÿÿâÿÿÿûÿÿÿµÿÿÿâÿÿÿÿÿÿµÿÿÿâÿÿÿµÿÿÿâÿÿÿÿÿÿÿÿÿûÿÿÿµÿÿÿûÿÿÿâÿÿÿµÿÿÿûÿÿÿâÿÿÿÿÿÿûÿÿÿ  +  + +        +  + +   + ÷ÿÿÿ÷ÿÿÿñÿÿÿ÷ÿÿÿ ôÿÿÿ ÷ÿÿÿ øÿÿÿçÿÿÿìÿÿÿçÿÿÿìÿÿÿçÿÿÿøÿÿÿøÿÿÿçÿÿÿðÿÿÿçÿÿÿðÿÿÿçÿÿÿøÿÿÿçÿÿÿçÿÿÿ      +     + + +       (Øÿÿÿ(ØÿÿÿØÿÿÿØÿÿÿìÿÿÿÎÿÿÿÎÿÿÿìÿÿÿ‚‚ìÿÿÿ‚ìÿÿÿìÿÿÿ‚öÿÿÿâÿÿÿ‚ +âÿÿÿ‚ìÿÿÿ   + + +   + +            \ No newline at end of file diff --git a/Demo/Games/CharDemo.CPP b/Demo/Games/CharDemo.CPP deleted file mode 100644 index 978438f..0000000 --- a/Demo/Games/CharDemo.CPP +++ /dev/null @@ -1,191 +0,0 @@ -/* -Char graphics are how games on the C64 were made. You don't need to do it -this way, unless for fun. You can just make device context bigger than -the screen and scroll around. - -See $LK,"::/Demo/Games/RawHide.CPP"$ or $LK,"::/Demo/Games/BigGuns.CPP"$. - -The nice thing about character graphics are the animations. -*/ - -#define MAP_WIDTH (TEXT_COLS*2) -#define MAP_HEIGHT (TEXT_ROWS*2) - -#define CH_WATER '^' -#define CH_LAND CH_SPACE -#define CH_TREE '*' - -U16 map[MAP_HEIGHT][MAP_WIDTH]; - -I64 screen_pix_x,screen_pix_y; - -U0 DrawIt(CTask *task,CDC *) -{ - U16 *ptr; - I64 i,j,y=screen_pix_y>>3; - gr.hide_col=gr.hide_row=TRUE; - gr.pan_text_x=7-screen_pix_x&7; - gr.pan_text_y=7-screen_pix_y&7; - for (i=0;iwin_height;i++) { - ptr=&map[y++][screen_pix_x>>3]; - for (j=0;jwin_width;j++) - //By the time you clip to window and handle Fs->scroll_x,Fs->scroll_y, - //it is too much trouble to do raw access to gr.text_base like we do - //in $LK,"::/Demo/Games/Maze.CPP"$. - TextChar(task,FALSE,j,i,*ptr++); - } -} - -U8 *old_font=text.font; -U64 waves[4]={ -0x0011AA440011AA44,0x0022558800225588, -0x0044AA110044AA11,0x0088552200885522}; - -U0 AnimateEndCB() -{ - text.font=old_font; - Exit; -} - -U0 AnimateTask(I64) -{ - I64 i; - U64 *font=MAlloc(256*8); - Fs->task_end_cb=&AnimateEndCB; - MemCpy(font,text.font,256*8); - text.font=font; - font[CH_TREE]=0x18187E7E3C3C18; - while (TRUE) { - font[CH_WATER]=waves[i++&0x3]; - Sleep(200); - WinMgrSync; - } -} - -U0 ScrollTaskX(I64 sign) -{ - I64 i; - for (i=0;i<32;i++) { - screen_pix_x=ClampI64(screen_pix_x+sign,0, - (MAP_WIDTH-TEXT_COLS+1)*FONT_WIDTH); - WinMgrSync; - } -} - -U0 ScrollTaskY(I64 sign) -{ - I64 i; - for (i=0;i<32;i++) { - screen_pix_y=ClampI64(screen_pix_y+sign,0, - (MAP_HEIGHT-TEXT_ROWS+2)*FONT_HEIGHT); - WinMgrSync; - } -} - -U0 Init() -{ - I64 i,j,x,y; - screen_pix_x=(MAP_WIDTH-TEXT_COLS)>>1*FONT_WIDTH; - screen_pix_y=(MAP_HEIGHT-TEXT_ROWS)>>1*FONT_HEIGHT; - - MemSetU16(map,CH_WATER+(BLUE<<4+LTBLUE)<<8,MAP_WIDTH*MAP_HEIGHT); - for (i=1;itext_attr=YELLOW<<4+BLUE; - AutoComplete; - WinBorder; - WinMax; - DocCursor; - - MenuPush( - "File {" - " Abort(,CH_SHIFT_ESC);" - " Exit(,CH_ESC);" - "}" - "Play {" - " Restart(,'\n');" - " Left(,,SC_CURSOR_LEFT);" - " Right(,,SC_CURSOR_RIGHT);" - " Up(,,SC_CURSOR_UP);" - " Down(,,SC_CURSOR_DOWN);" - "}" - ); - Init; - Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs); - Fs->draw_it=&DrawIt; - try { - while (TRUE) { - switch (GetKey(&sc)) { - case 0: - switch (sc.u8[0]) { - case SC_CURSOR_LEFT: - Spawn(&ScrollTaskX,-1,"Scroll",,Fs); - break; - case SC_CURSOR_RIGHT: - Spawn(&ScrollTaskX,1,"Scroll",,Fs); - break; - case SC_CURSOR_UP: - Spawn(&ScrollTaskY,-1,"Scroll",,Fs); - break; - case SC_CURSOR_DOWN: - Spawn(&ScrollTaskY,1,"Scroll",,Fs); - break; - } - break; - case '\n': - CleanUp; - Init; - break; - case CH_SHIFT_ESC: - case CH_ESC: - goto sq_done; - } - } -sq_done: //Don't goto out of try - } catch - PutExcept; - SettingsPop; - CleanUp; - MenuPop; -} - -CharDemo; diff --git a/Demo/Games/CharDemo.HC b/Demo/Games/CharDemo.HC new file mode 100644 index 0000000..68cf082 --- /dev/null +++ b/Demo/Games/CharDemo.HC @@ -0,0 +1,191 @@ +/* +Char graphics are how games on the C64 were made. You don't need to do it +this way, unless for fun. You can just make device context bigger than +the screen and scroll around. + +See $LK,"::/Demo/Games/RawHide.HC"$ or $LK,"::/Demo/Games/BigGuns.HC"$. + +The nice thing about character graphics are the animations. +*/ + +#define MAP_WIDTH (TEXT_COLS*2) +#define MAP_HEIGHT (TEXT_ROWS*2) + +#define CH_WATER '^' +#define CH_LAND CH_SPACE +#define CH_TREE '*' + +U16 map[MAP_HEIGHT][MAP_WIDTH]; + +I64 screen_pix_x,screen_pix_y; + +U0 DrawIt(CTask *task,CDC *) +{ + U16 *ptr; + I64 i,j,y=screen_pix_y>>3; + gr.hide_col=gr.hide_row=TRUE; + gr.pan_text_x=7-screen_pix_x&7; + gr.pan_text_y=7-screen_pix_y&7; + for (i=0;iwin_height;i++) { + ptr=&map[y++][screen_pix_x>>3]; + for (j=0;jwin_width;j++) + //By the time you clip to window and handle Fs->scroll_x,Fs->scroll_y, + //it is too much trouble to do raw access to gr.text_base like we do + //in $LK,"::/Demo/Games/Maze.HC"$. + TextChar(task,FALSE,j,i,*ptr++); + } +} + +U8 *old_font=text.font; +U64 waves[4]={ +0x0011AA440011AA44,0x0022558800225588, +0x0044AA110044AA11,0x0088552200885522}; + +U0 AnimateEndCB() +{ + text.font=old_font; + Exit; +} + +U0 AnimateTask(I64) +{ + I64 i; + U64 *font=MAlloc(256*8); + Fs->task_end_cb=&AnimateEndCB; + MemCpy(font,text.font,256*8); + text.font=font; + font[CH_TREE]=0x18187E7E3C3C18; + while (TRUE) { + font[CH_WATER]=waves[i++&0x3]; + Sleep(200); + WinMgrSync; + } +} + +U0 ScrollTaskX(I64 sign) +{ + I64 i; + for (i=0;i<32;i++) { + screen_pix_x=ClampI64(screen_pix_x+sign,0, + (MAP_WIDTH-TEXT_COLS+1)*FONT_WIDTH); + WinMgrSync; + } +} + +U0 ScrollTaskY(I64 sign) +{ + I64 i; + for (i=0;i<32;i++) { + screen_pix_y=ClampI64(screen_pix_y+sign,0, + (MAP_HEIGHT-TEXT_ROWS+2)*FONT_HEIGHT); + WinMgrSync; + } +} + +U0 Init() +{ + I64 i,j,x,y; + screen_pix_x=(MAP_WIDTH-TEXT_COLS)>>1*FONT_WIDTH; + screen_pix_y=(MAP_HEIGHT-TEXT_ROWS)>>1*FONT_HEIGHT; + + MemSetU16(map,CH_WATER+(BLUE<<4+LTBLUE)<<8,MAP_WIDTH*MAP_HEIGHT); + for (i=1;itext_attr=YELLOW<<4+BLUE; + AutoComplete; + WinBorder; + WinMax; + DocCursor; + + MenuPush( + "File {" + " Abort(,CH_SHIFT_ESC);" + " Exit(,CH_ESC);" + "}" + "Play {" + " Restart(,'\n');" + " Left(,,SC_CURSOR_LEFT);" + " Right(,,SC_CURSOR_RIGHT);" + " Up(,,SC_CURSOR_UP);" + " Down(,,SC_CURSOR_DOWN);" + "}" + ); + Init; + Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs); + Fs->draw_it=&DrawIt; + try { + while (TRUE) { + switch (GetKey(&sc)) { + case 0: + switch (sc.u8[0]) { + case SC_CURSOR_LEFT: + Spawn(&ScrollTaskX,-1,"Scroll",,Fs); + break; + case SC_CURSOR_RIGHT: + Spawn(&ScrollTaskX,1,"Scroll",,Fs); + break; + case SC_CURSOR_UP: + Spawn(&ScrollTaskY,-1,"Scroll",,Fs); + break; + case SC_CURSOR_DOWN: + Spawn(&ScrollTaskY,1,"Scroll",,Fs); + break; + } + break; + case '\n': + CleanUp; + Init; + break; + case CH_SHIFT_ESC: + case CH_ESC: + goto sq_done; + } + } +sq_done: //Don't goto out of try + } catch + PutExcept; + SettingsPop; + CleanUp; + MenuPop; +} + +CharDemo; diff --git a/Demo/Games/CircleTrace.CPP b/Demo/Games/CircleTrace.HC similarity index 100% rename from Demo/Games/CircleTrace.CPP rename to Demo/Games/CircleTrace.HC diff --git a/Demo/Games/Collision.CPP b/Demo/Games/Collision.CPP deleted file mode 100644 index bdce1b6..0000000 Binary files a/Demo/Games/Collision.CPP and /dev/null differ diff --git a/Demo/Games/Collision.HC b/Demo/Games/Collision.HC new file mode 100644 index 0000000..b11447a Binary files /dev/null and b/Demo/Games/Collision.HC differ diff --git a/Demo/Games/Digits.CPP b/Demo/Games/Digits.CPP deleted file mode 100644 index fe4088d..0000000 --- a/Demo/Games/Digits.CPP +++ /dev/null @@ -1,80 +0,0 @@ -//This loads a lst of zero terminated -//strings into the sym table and -//gives a name to it. Strings like -//this are known as Define entries. - -//See $LK,"ST_RAINBOW_10",A="FF:::/Adam/Gr/GrPalette.CPP,ST_RAINBOW_10"$ - -U0 PrintDigit(U8 ch) -{ -//The %Z code displays a Define subentry - if ('0'<=ch<='9') - "$$FG,%Z$$%d$$FG$$",ch-'0',"ST_RAINBOW_10",ch-'0'; -} - -U0 PrintPattern(U8 *st) -{ - I64 ch; - while (ch=*st++) - PrintDigit(ch); - '\n'; -} - -U0 Digits() -{ - I64 num,ch,i; - U8 answer[1024]; - - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - Fs->text_attr=DKGRAY<<4+WHITE; - DocClear; -//Set default background and foreground - "$$WW,1$$$$BG,DKGRAY$$$$FD,WHITE$$" - "\nThis is a memory game. " - "Try to remember the digits and enter them. " - "They are colored based on electrical " - "engineering color codes.\n"; - for (i=0;i<10;i++) - "$$FG,%Z$$%d: %Z\n",i,"ST_RAINBOW_10",i,i,"ST_RAINBOW_10"; - "$$FG$$\n"; //set to default background - ch=PressAKey; - if (ch==CH_ESC||ch==CH_SHIFT_ESC) goto dg_done; - while (TRUE) { -restart: - num=0; -//Set to zeros so we have terminators - MemSet(answer,0,sizeof(answer)); - while (TRUE) { - DocClear; - "$$WW,1$$$$BG,DKGRAY$$$$FD,WHITE$$\n"; - "Pattern\nLength:%d\n\n",num+1; - answer[num++]=RandU32%10+'0'; - PrintPattern(answer); - ch=PressAKey; - if (ch==CH_ESC||ch==CH_SHIFT_ESC) goto dg_done; - DocClear; - "$$WW,1$$$$BG,DKGRAY$$$$FD,WHITE$$\n"; - "Guess\nLength:%d\n\n",num; - for (i=0;itext_attr=DKGRAY<<4+WHITE; + DocClear; +//Set default background and foreground + "$$WW,1$$$$BG,DKGRAY$$$$FD,WHITE$$" + "\nThis is a memory game. " + "Try to remember the digits and enter them. " + "They are colored based on electrical " + "engineering color codes.\n"; + for (i=0;i<10;i++) + "$$FG,%Z$$%d: %Z\n",i,"ST_RAINBOW_10",i,i,"ST_RAINBOW_10"; + "$$FG$$\n"; //set to default background + ch=PressAKey; + if (ch==CH_ESC||ch==CH_SHIFT_ESC) goto dg_done; + while (TRUE) { +restart: + num=0; +//Set to zeros so we have terminators + MemSet(answer,0,sizeof(answer)); + while (TRUE) { + DocClear; + "$$WW,1$$$$BG,DKGRAY$$$$FD,WHITE$$\n"; + "Pattern\nLength:%d\n\n",num+1; + answer[num++]=RandU32%10+'0'; + PrintPattern(answer); + ch=PressAKey; + if (ch==CH_ESC||ch==CH_SHIFT_ESC) goto dg_done; + DocClear; + "$$WW,1$$$$BG,DKGRAY$$$$FD,WHITE$$\n"; + "Guess\nLength:%d\n\n",num; + for (i=0;i",BI=1$ - - - - - - - - - -$SP,"<2>",BI=2$ - - - -$SP,"<3>",BI=3$ - - -$SP,"<4>",BI=4$ - -$SP,"<5>",BI=5$ - -$SP,"<6>",BI=6$ - -$SP,"<7>",BI=7$ - -$SP,"<8>",BI=8$ - -$SP,"<9>",BI=9$ - -$SP,"<10>",BI=10$ - - -$BG$//These are indexed by color #. -//See $LK,"COLORS",A="MN:RED"$. - -U8 *tiles1[16]={NULL,$IB,"<7>",BI=7$ ,$IB,"<5>",BI=5$ ,NULL,NULL,NULL,NULL,NULL, - $IB,"<6>",BI=6$ ,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; - -U8 *tiles2[16]={NULL,$IB,"<8>",BI=8$ ,$IB,"<5>",BI=5$ ,NULL,NULL,NULL,NULL,NULL, - $IB,"<6>",BI=6$ ,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; - -#define SCREEN_SCALE 24 -#define SCREEN_WIDTH 24 -#define SCREEN_HEIGHT 24 -I64 screen_x,screen_y; - -#define MAP_SCALE 4 -I64 map_width,map_height; -U8 *map=NULL; - -I64 man_x,man_y,man_dx,man_dy; -Bool man_attack; -F64 man_attack_t0; - -#define NUM_MONSTERS 10 -I64 monsters_left; -class Monster -{ - I64 x,y,dx,dy; - Bool dead,pad[7]; -} monsters[NUM_MONSTERS]; - -F64 t0,tf; - -#define LOS_SCALE 4 - -Bool LOSPlot(U8 *,I64 x,I64 y,I64) -{ - if (!map[(y/LOS_SCALE)*map_width+(x/LOS_SCALE)]) - return FALSE; - else - return TRUE; -} - -Bool LOS(I64 x1,I64 y1,I64 x2,I64 y2) -{//Line of sight - return Line(NULL,x1*LOS_SCALE+LOS_SCALE/2,y1*LOS_SCALE+LOS_SCALE/2,0, - x2*LOS_SCALE+LOS_SCALE/2,y2*LOS_SCALE+LOS_SCALE/2,0,&LOSPlot); -} - -U0 DrawIt(CTask *task,CDC *dc) -{ - CDC *dc_t=DCAlias(gr.dc2,task); - I64 i,x,y,xx,yy,x1,y1,z1,color, - cx=task->pix_width/2, - cy=task->pix_height/2; - CD3I32 poly[4]; - U8 **_tiles; - F64 tt; - Monster *tempm; - - if (Blink(5)) - _tiles=tiles1; - else - _tiles=tiles2; - - Mat4x4RotX(dc_t->r,60*2*ã/360); - Mat4x4RotZ(dc_t->r,15*2*ã/360); - DCMat4x4Set(dc_t,dc_t->r); - dc_t->x=task->pix_width/2; - dc_t->y=task->pix_height/2; - dc_t->flags|=DCF_TRANSFORMATION; - - //You could make it much more efficient - //if you did it like $LK,"::/Demo/Games/BigGuns.CPP"$ - //with a $LK,"CDC",A="MN:CDC"$. - - for (y=-SCREEN_HEIGHT/2;ycolor=color; - GrFillPoly3(dc_t,4,poly); - } - } - } - } - } - - for (y=-SCREEN_HEIGHT/2;y",BI=9$); - } - if (xx+1",BI=10$); - } - } - } - } - } - - for (i=0,tempm=monsters;idead && LOS(tempm->x,tempm->y,man_x,man_y)) { - x1=(tempm->x-screen_x)*SCREEN_SCALE+SCREEN_SCALE/2; - y1=(tempm->y-screen_y)*SCREEN_SCALE+SCREEN_SCALE/2; - z1=0; - DCTransform(dc_t,&x1,&y1,&z1); - if (tempm->dx<0) { - dc->flags|=DCF_SYMMETRY|DCF_JUST_MIRROR; - DCSymmetrySet(dc,x1,y1,x1,y1+1); - } else - dc->flags&=~(DCF_SYMMETRY|DCF_JUST_MIRROR); - Sprite3(dc,x1,y1,z1,$IB,"<4>",BI=4$); - } - - x1=(man_x-screen_x)*SCREEN_SCALE+SCREEN_SCALE/2; - y1=(man_y-screen_y)*SCREEN_SCALE+SCREEN_SCALE/2; - z1=0; - if (tS-man_attack_t0<0.2) { - x1+=Tri(tS-man_attack_t0,0.2)*SCREEN_SCALE*man_dx; - y1+=Tri(tS-man_attack_t0,0.2)*SCREEN_SCALE*man_dy; - if (man_dy!=1) - y1-=Saw(tS-man_attack_t0,0.2)*SCREEN_SCALE; - } - DCTransform(dc_t,&x1,&y1,&z1); - if (man_dx<0) { - dc->flags|=DCF_SYMMETRY|DCF_JUST_MIRROR; - DCSymmetrySet(dc,x1,y1,x1,y1+1); - } else - dc->flags&=~(DCF_SYMMETRY|DCF_JUST_MIRROR); - - if (tS-man_attack_t0<0.2) - Sprite3(dc,x1,y1,z1,$IB,"<3>",BI=3$); - else - Sprite3(dc,x1,y1,z1,$IB,"<2>",BI=2$); - - DCDel(dc_t); - - if (tf) { - dc->color=LTRED; - if (Blink) - GrPrint(dc,cx-(FONT_WIDTH*14)/2,cy-FONT_HEIGHT/2,"Game Completed"); - tt=tf; - } else { - dc->color=LTGREEN; - tt=tS; - } - GrPrint(dc,0,0,"Enemy:%d Time:%3.2f Best:%3.2f", - monsters_left,tt-t0,best_score); -} - -U0 Attack() -{ - I64 i; - Monster *tempm; - - man_attack_t0=tS; - Noise(100,300,1000); - for (i=0,tempm=monsters;idead && - man_x+man_dx==tempm->x && man_y+man_dy==tempm->y) { - tempm->dead=TRUE; - if (!--monsters_left) { - tf=tS; - if (tf-t0",BI=1$); - map_width =dc->width/MAP_SCALE; - map_height=dc->height/MAP_SCALE; - Free(map); - map=MAlloc(map_width*map_height*sizeof(U8)); - for (y=0;ydead=FALSE; - tempm->dx=0; - tempm->dy=0; - do { - tempm->x=RandU64%(map_width-2)+1; - tempm->y=RandU64%(map_height-2)+1; - } while (!map[(tempm->y)*map_width+tempm->x]); - } - monsters_left=NUM_MONSTERS; - tf=0; - t0=tS; -} - -U0 CleanUp() -{ - Free(map); - map=NULL; -} - -U0 AnimateTask(I64) -{ - I64 i,x,y,dx,dy; - Monster *tempm; - - while (TRUE) { - for (i=0,tempm=monsters;idead) { - dx=RandU16%3-1; - dy=RandU16%3-1; - x=tempm->x+dx; - y=tempm->y+dy; - if (0<=xx=x; - tempm->y=y; - tempm->dx=dx; - tempm->dy=dy; - } - } - Sleep(1000); - } -} - -U0 DunGen() -{ - I64 ch,sc; - - MenuPush( - "File {" - " Abort(,CH_SHIFT_ESC);" - " Exit(,CH_ESC);" - "}" - "Play {" - " Restart(,'\n');" - " Up(,,SC_CURSOR_UP);" - " Down(,,SC_CURSOR_DOWN);" - " Left(,,SC_CURSOR_LEFT);" - " Right(,,SC_CURSOR_RIGHT);" - " Attack(,CH_SPACE);" - "}" - ); - - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - Fs->text_attr=BLACK<<4+WHITE; - AutoComplete; - WinBorder; - WinMax; - DocCursor; - DocClear; - Init; - Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs); - Fs->draw_it=&DrawIt; - - try { - while (TRUE) { - switch (GetMsg(&ch,&sc,1<SCREEN_WIDTH/2-3) { - screen_x+=SCREEN_WIDTH/2; - if (screen_x+SCREEN_WIDTH/2>map_width) - screen_x=map_width-SCREEN_WIDTH/2; - } - } - break; - case SC_CURSOR_LEFT: - if (man_attack) { - man_dx=-1; - man_dy=0; - Attack; - } else - if (man_x-1>=0 && - map[man_y*map_width+(man_x-1)]==DKGRAY) { - man_x--; - if (man_x-screen_x<-SCREEN_WIDTH/2+3) { - screen_x-=SCREEN_WIDTH/2; - if (screen_x-SCREEN_WIDTH/2<0) - screen_x=SCREEN_WIDTH/2; - } - } - break; - case SC_CURSOR_UP: - if (man_attack) { - man_dx=0; - man_dy=-1; - Attack; - } else - if (man_y-1>=0 && - map[(man_y-1)*map_width+man_x]==DKGRAY) { - man_y--; - if (man_y-screen_y<-SCREEN_HEIGHT/2+3) { - screen_y-=SCREEN_HEIGHT/2; - if (screen_y-SCREEN_HEIGHT/2<0) - screen_y=SCREEN_HEIGHT/2; - } - } - break; - case SC_CURSOR_DOWN: - if (man_attack) { - man_dx=0; - man_dy=1; - Attack; - } else - if (man_y+1SCREEN_HEIGHT/2-3) { - screen_y+=SCREEN_HEIGHT/2; - if (screen_y+SCREEN_HEIGHT/2>map_height) - screen_y=map_height-SCREEN_HEIGHT/2; - } - } - break; - } - } - break; - case MSG_KEY_UP: - if (ch==CH_SPACE) - man_attack=FALSE; - break; - } - } -dg_done: - GetMsg(,,1<",BI=1$ + + + + + + + + + +$SP,"<2>",BI=2$ + + + +$SP,"<3>",BI=3$ + + +$SP,"<4>",BI=4$ + +$SP,"<5>",BI=5$ + +$SP,"<6>",BI=6$ + +$SP,"<7>",BI=7$ + +$SP,"<8>",BI=8$ + +$SP,"<9>",BI=9$ + +$SP,"<10>",BI=10$ + + +$BG$//These are indexed by color #. +//See $LK,"COLORS",A="MN:RED"$. + +U8 *tiles1[16]={NULL,$IB,"<7>",BI=7$ ,$IB,"<5>",BI=5$ ,NULL,NULL,NULL,NULL,NULL, + $IB,"<6>",BI=6$ ,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; + +U8 *tiles2[16]={NULL,$IB,"<8>",BI=8$ ,$IB,"<5>",BI=5$ ,NULL,NULL,NULL,NULL,NULL, + $IB,"<6>",BI=6$ ,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; + +#define SCREEN_SCALE 24 +#define SCREEN_WIDTH 24 +#define SCREEN_HEIGHT 24 +I64 screen_x,screen_y; + +#define MAP_SCALE 4 +I64 map_width,map_height; +U8 *map=NULL; + +I64 man_x,man_y,man_dx,man_dy; +Bool man_attack; +F64 man_attack_t0; + +#define NUM_MONSTERS 10 +I64 monsters_left; +class Monster +{ + I64 x,y,dx,dy; + Bool dead,pad[7]; +} monsters[NUM_MONSTERS]; + +F64 t0,tf; + +#define LOS_SCALE 4 + +Bool LOSPlot(U8 *,I64 x,I64 y,I64) +{ + if (!map[(y/LOS_SCALE)*map_width+(x/LOS_SCALE)]) + return FALSE; + else + return TRUE; +} + +Bool LOS(I64 x1,I64 y1,I64 x2,I64 y2) +{//Line of sight + return Line(NULL,x1*LOS_SCALE+LOS_SCALE/2,y1*LOS_SCALE+LOS_SCALE/2,0, + x2*LOS_SCALE+LOS_SCALE/2,y2*LOS_SCALE+LOS_SCALE/2,0,&LOSPlot); +} + +U0 DrawIt(CTask *task,CDC *dc) +{ + CDC *dc_t=DCAlias(gr.dc2,task); + I64 i,x,y,xx,yy,x1,y1,z1,color, + cx=task->pix_width/2, + cy=task->pix_height/2; + CD3I32 poly[4]; + U8 **_tiles; + F64 tt; + Monster *tempm; + + if (Blink(5)) + _tiles=tiles1; + else + _tiles=tiles2; + + Mat4x4RotX(dc_t->r,60*2*ã/360); + Mat4x4RotZ(dc_t->r,15*2*ã/360); + DCMat4x4Set(dc_t,dc_t->r); + dc_t->x=task->pix_width/2; + dc_t->y=task->pix_height/2; + dc_t->flags|=DCF_TRANSFORMATION; + + //You could make it much more efficient + //if you did it like $LK,"::/Demo/Games/BigGuns.HC"$ + //with a $LK,"CDC",A="MN:CDC"$. + + for (y=-SCREEN_HEIGHT/2;ycolor=color; + GrFillPoly3(dc_t,4,poly); + } + } + } + } + } + + for (y=-SCREEN_HEIGHT/2;y",BI=9$); + } + if (xx+1",BI=10$); + } + } + } + } + } + + for (i=0,tempm=monsters;idead && LOS(tempm->x,tempm->y,man_x,man_y)) { + x1=(tempm->x-screen_x)*SCREEN_SCALE+SCREEN_SCALE/2; + y1=(tempm->y-screen_y)*SCREEN_SCALE+SCREEN_SCALE/2; + z1=0; + DCTransform(dc_t,&x1,&y1,&z1); + if (tempm->dx<0) { + dc->flags|=DCF_SYMMETRY|DCF_JUST_MIRROR; + DCSymmetrySet(dc,x1,y1,x1,y1+1); + } else + dc->flags&=~(DCF_SYMMETRY|DCF_JUST_MIRROR); + Sprite3(dc,x1,y1,z1,$IB,"<4>",BI=4$); + } + + x1=(man_x-screen_x)*SCREEN_SCALE+SCREEN_SCALE/2; + y1=(man_y-screen_y)*SCREEN_SCALE+SCREEN_SCALE/2; + z1=0; + if (tS-man_attack_t0<0.2) { + x1+=Tri(tS-man_attack_t0,0.2)*SCREEN_SCALE*man_dx; + y1+=Tri(tS-man_attack_t0,0.2)*SCREEN_SCALE*man_dy; + if (man_dy!=1) + y1-=Saw(tS-man_attack_t0,0.2)*SCREEN_SCALE; + } + DCTransform(dc_t,&x1,&y1,&z1); + if (man_dx<0) { + dc->flags|=DCF_SYMMETRY|DCF_JUST_MIRROR; + DCSymmetrySet(dc,x1,y1,x1,y1+1); + } else + dc->flags&=~(DCF_SYMMETRY|DCF_JUST_MIRROR); + + if (tS-man_attack_t0<0.2) + Sprite3(dc,x1,y1,z1,$IB,"<3>",BI=3$); + else + Sprite3(dc,x1,y1,z1,$IB,"<2>",BI=2$); + + DCDel(dc_t); + + if (tf) { + dc->color=LTRED; + if (Blink) + GrPrint(dc,cx-(FONT_WIDTH*14)/2,cy-FONT_HEIGHT/2,"Game Completed"); + tt=tf; + } else { + dc->color=LTGREEN; + tt=tS; + } + GrPrint(dc,0,0,"Enemy:%d Time:%3.2f Best:%3.2f", + monsters_left,tt-t0,best_score); +} + +U0 Attack() +{ + I64 i; + Monster *tempm; + + man_attack_t0=tS; + Noise(100,300,1000); + for (i=0,tempm=monsters;idead && + man_x+man_dx==tempm->x && man_y+man_dy==tempm->y) { + tempm->dead=TRUE; + if (!--monsters_left) { + tf=tS; + if (tf-t0",BI=1$); + map_width =dc->width/MAP_SCALE; + map_height=dc->height/MAP_SCALE; + Free(map); + map=MAlloc(map_width*map_height*sizeof(U8)); + for (y=0;ydead=FALSE; + tempm->dx=0; + tempm->dy=0; + do { + tempm->x=RandU64%(map_width-2)+1; + tempm->y=RandU64%(map_height-2)+1; + } while (!map[(tempm->y)*map_width+tempm->x]); + } + monsters_left=NUM_MONSTERS; + tf=0; + t0=tS; +} + +U0 CleanUp() +{ + Free(map); + map=NULL; +} + +U0 AnimateTask(I64) +{ + I64 i,x,y,dx,dy; + Monster *tempm; + + while (TRUE) { + for (i=0,tempm=monsters;idead) { + dx=RandU16%3-1; + dy=RandU16%3-1; + x=tempm->x+dx; + y=tempm->y+dy; + if (0<=xx=x; + tempm->y=y; + tempm->dx=dx; + tempm->dy=dy; + } + } + Sleep(1000); + } +} + +U0 DunGen() +{ + I64 ch,sc; + + MenuPush( + "File {" + " Abort(,CH_SHIFT_ESC);" + " Exit(,CH_ESC);" + "}" + "Play {" + " Restart(,'\n');" + " Up(,,SC_CURSOR_UP);" + " Down(,,SC_CURSOR_DOWN);" + " Left(,,SC_CURSOR_LEFT);" + " Right(,,SC_CURSOR_RIGHT);" + " Attack(,CH_SPACE);" + "}" + ); + + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + Fs->text_attr=BLACK<<4+WHITE; + AutoComplete; + WinBorder; + WinMax; + DocCursor; + DocClear; + Init; + Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs); + Fs->draw_it=&DrawIt; + + try { + while (TRUE) { + switch (GetMsg(&ch,&sc,1<SCREEN_WIDTH/2-3) { + screen_x+=SCREEN_WIDTH/2; + if (screen_x+SCREEN_WIDTH/2>map_width) + screen_x=map_width-SCREEN_WIDTH/2; + } + } + break; + case SC_CURSOR_LEFT: + if (man_attack) { + man_dx=-1; + man_dy=0; + Attack; + } else + if (man_x-1>=0 && + map[man_y*map_width+(man_x-1)]==DKGRAY) { + man_x--; + if (man_x-screen_x<-SCREEN_WIDTH/2+3) { + screen_x-=SCREEN_WIDTH/2; + if (screen_x-SCREEN_WIDTH/2<0) + screen_x=SCREEN_WIDTH/2; + } + } + break; + case SC_CURSOR_UP: + if (man_attack) { + man_dx=0; + man_dy=-1; + Attack; + } else + if (man_y-1>=0 && + map[(man_y-1)*map_width+man_x]==DKGRAY) { + man_y--; + if (man_y-screen_y<-SCREEN_HEIGHT/2+3) { + screen_y-=SCREEN_HEIGHT/2; + if (screen_y-SCREEN_HEIGHT/2<0) + screen_y=SCREEN_HEIGHT/2; + } + } + break; + case SC_CURSOR_DOWN: + if (man_attack) { + man_dx=0; + man_dy=1; + Attack; + } else + if (man_y+1SCREEN_HEIGHT/2-3) { + screen_y+=SCREEN_HEIGHT/2; + if (screen_y+SCREEN_HEIGHT/2>map_height) + screen_y=map_height-SCREEN_HEIGHT/2; + } + } + break; + } + } + break; + case MSG_KEY_UP: + if (ch==CH_SPACE) + man_attack=FALSE; + break; + } + } +dg_done: + GetMsg(,,1<",BI=1$ - - - - - - - - - - - - - - - - - - - - - - - - - - $SP,"<2>",BI=2$ - - - - - - - - - - - - - - - - - - - - - - - - - - - $SP,"<3>",BI=3$ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $SP,"<4>",BI=4$ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -class Obj -{ - Obj *next,*last; - CD3I64 p; - U8 *img; - Bool fish; -}; - -class Panel -{//Polygon or Obj - Panel *next; - CD3I32 *pts; - I64 cnt; - U16 update,num_sides; - CColorROPU32 color; - Obj *next_obj,*last_obj; -} *panel_head,*panels[MAP_HEIGHT][MAP_WIDTH]; - -I64 critical_section_flag; -I16 elevations[MAP_HEIGHT][MAP_WIDTH]; -CD3 normals[MAP_HEIGHT][MAP_WIDTH]; - -class MPCtrl { - I64 init_not_done_flags,update_not_done_flags,app_not_done_flags; - I64 strip_width[MP_MAX_PROCESSORS]; - Bool app_done; -} mp; - -F64 game_t0,game_tf,pitch,roll,heading,è,speed; -Bool invert_pitch,rolled_over; -I64 strip_height,x,y,z,fish_left; - -U0 WrapAngles() -{ - è=Wrap(è); - pitch=Wrap(-è-ã/2); - if (Abs(pitch)>ã/2) { - invert_pitch=TRUE; - pitch=Wrap(ã-pitch); - } else - invert_pitch=FALSE; - roll=Wrap(roll); - if (invert_pitch ^^ -ã/2<=roll<ã/2) - rolled_over=FALSE; - else - rolled_over=TRUE; - heading=Wrap(heading,0); -} - -U0 EDTransform(CDC *dc,I64 *x,I64 *y,I64 *z) -{ - I64 zz; - Mat4x4MulXYZ(dc->r,x,y,z); - *z=zz=-*z; - if (zz>0) { - *x = dc->x + *x * DISPLAY_SCALE/zz; //Foreshortening - *y = dc->y - *y * DISPLAY_SCALE/zz; - } else { - *x = dc->x + *x; - *y = dc->y - *y; - } -} - -U0 CalcNormals() -{/*Find the normal vect with a curl. - -i,j and k are the axis unit vectors, -not to be confused with my local index variables. - -i j k -0 1 dz2 -1 0 dz1 - -Normal: dz1*i + dz2*j - k -*/ - I64 i,j; - for (j=0;j.10) - return FALSE; - return TRUE; -} - -U0 MPDoPanels(CTask *task) -{ - I64 i,j,l,k1,k2,w,h,threshold,lo,hi; - Bool cont; - Panel *tempp,*start_ptr=NULL,*end_ptr=NULL; - CD3I32 *poly; - Obj *tempo; - lo=Gs->num*(MAP_HEIGHT-1)/mp_cnt; - hi=(Gs->num+1)*(MAP_HEIGHT-1)/mp_cnt; - for (threshold=8;threshold>=1;threshold--) - for (j=lo;j=threshold || h>=threshold) { - tempp=CAlloc(sizeof(Panel),task); - QueInit(&tempp->next_obj); - l=elevations[j][i]; - if (l<=WATER_ELEVATION*MAP_SCALE && - elevations[j][i+w-1]<=WATER_ELEVATION*MAP_SCALE && - elevations[j+h-1][i]<=WATER_ELEVATION*MAP_SCALE && - elevations[j+h-1][i+w-1]<=WATER_ELEVATION*MAP_SCALE) { - tempp->color=BLUE; - if (Rand<0.05) { - tempo=MAlloc(sizeof(Obj),task); - tempo->p.x=(i+w/2)*MAP_SCALE; - tempo->p.y=(j+h/2)*MAP_SCALE; - if (Rand<0.1) { - tempo->fish=FALSE; - if (RandI16&1) - tempo->img=$IB,"<2>",BI=2$; //Boat - else - tempo->img=$IB,"<3>",BI=3$; //Boat - tempo->p.z=(WATER_ELEVATION+2)*MAP_SCALE; - } else { - tempo->fish=TRUE; - tempo->img=$IB,"<1>",BI=1$; //Fish - tempo->p.z=WATER_ELEVATION*MAP_SCALE; - } - QueIns(tempo,tempp->last_obj); - } - } else { - if (lcolor=LTGREEN; - else - tempp->color=GREEN+LTGREEN<<16+ROPF_DITHER; - if (Rand<0.03) { - tempo=MAlloc(sizeof(Obj),task); - tempo->p.x=(i+w/2)*MAP_SCALE; - tempo->p.y=(j+h/2)*MAP_SCALE; - tempo->p.z=l; - tempo->img=$IB,"<4>",BI=4$; //Tree - tempo->fish=FALSE; - QueIns(tempo,tempp->last_obj); - } - } else if (lcolor=LTGRAY; - else - tempp->color=DKGRAY+LTGRAY<<16+ROPF_DITHER; - } else { - if (RandI16&1) - tempp->color=LTGREEN; - else - tempp->color=GREEN+LTGREEN<<16+ROPF_DITHER; - } - } else { - if (!(RandU16&3)) { - if (RandI16&1) - tempp->color=WHITE; - else - tempp->color=LTGRAY; - } else { - if (RandI16&1) - tempp->color=LTGRAY+WHITE<<16+ROPF_DITHER; - else - tempp->color=DKGRAY+LTGRAY<<16+ROPF_DITHER; - } - } - } - tempp->num_sides=4; - poly=tempp->pts=MAlloc(sizeof(CD3I32)*tempp->num_sides,task); - poly[0].x=MAP_SCALE*i; - poly[0].y=MAP_SCALE*j; - poly[0].z=elevations[j][i]; - poly[1].x=MAP_SCALE*(i+w); - poly[1].y=MAP_SCALE*j; - poly[1].z=elevations[j][i+w]; - poly[2].x=MAP_SCALE*(i+w); - poly[2].y=MAP_SCALE*(j+h); - poly[2].z=elevations[j+h][i+w]; - poly[3].x=MAP_SCALE*i; - poly[3].y=MAP_SCALE*(j+h); - poly[3].z=elevations[j+h][i]; - tempp->next=start_ptr; - start_ptr=tempp; - if (!end_ptr) - end_ptr=tempp; - for (k2=0;k2next=panel_head; - panel_head=start_ptr; - LBtr(&critical_section_flag,0); - } - LBtr(&mp.init_not_done_flags,Gs->num); -} - -U0 InitElevations() -{ - I64 i,j,l,x,y,xx,yy,x1,y1,x2,y2; - MemSet(elevations,0,sizeof(elevations)); - for (i=0;i",BI=5$ -$SP,"<6>",BI=6$ - - - -U0 ClawDraw(CDC *dc,I64 x1,I64 y1,I64 x2,I64 y2,I64 w,I64 segments,Bool talon) -{ - I64 i,j; - for (i=0,j=segments;ipen_width=w; - dc->color=BLACK; - GrLine3(dc, - j*x1/segments+i*x2/segments, - j*y1/segments+i*y2/segments,0, - (j-1)*x1/segments+(i+1)*x2/segments, - (j-1)*y1/segments+(i+1)*y2/segments,0); - dc->pen_width=w-2; - dc->color=YELLOW; - GrLine3(dc, - j*x1/segments+i*x2/segments, - j*y1/segments+i*y2/segments,0, - (j-1)*x1/segments+(i+1)*x2/segments, - (j-1)*y1/segments+(i+1)*y2/segments,0); - } - if (talon) { - if (y1",BI=5$); - else - Sprite3B(dc,x1,y1,0,$IB,"<6>",BI=6$); - } -} - -U0 ClawsDraw(CTask *task,CDC *dc) -{ - F64 claws_up=1.0-claws_down; - I64 w=task->pix_width,h=task->pix_height; - dc->flags|=DCF_SYMMETRY; - DCSymmetrySet(dc,w>>1,0,w>>1,1); - - ClawDraw(dc,HAND_X-30,HAND_Y-50*claws_up,HAND_X-5,HAND_Y, 22,4,TRUE); - ClawDraw(dc,HAND_X-10,HAND_Y-60*claws_up,HAND_X,HAND_Y, 22,4,TRUE); - ClawDraw(dc,HAND_X+10,HAND_Y-60*claws_up,HAND_X,HAND_Y, 22,4,TRUE); - ClawDraw(dc,HAND_X+30,HAND_Y-50*claws_up,HAND_X+5,HAND_Y, 22,4,TRUE); - ClawDraw(dc,HAND_X+25,HAND_Y+40*claws_up,HAND_X+5,HAND_Y, 22,4,TRUE); - - ClawDraw(dc,HAND_X,HAND_Y,6*w/20,h,38,5,FALSE); -} - -CDC *main_dc; -U0 DrawIt(CTask *task,CDC *dc) -{ - main_dc->flags|=DCF_NO_TRANSPARENTS; - GrBlot(dc,0,0,main_dc); - if (claws_down) - ClawsDraw(task,dc); -} - -/* -$SP,"<7>",BI=7$ - - - - - - - - - - - - - - - - - - -$SP,"<8>",BI=8$ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Cores render strips that +/- 15%. The cores check the panel map array -and render the panel for each square, marking-it done. - -The depth buf is not locked in the graphic routines -so we get some glitches. -*/ - -I64 update_jiffy_limit; - -U0 MPDrawIt(CTask *task,CDC *dc) -{ - I64 j,update=winmgr.updates&65535,strip_width,*s2w,x1,y1,z1,xx,yy, - xh,yh,zh,yh2,xh2,x1h,y1h,x1wa,y1wa,x1wb,y1wb, - x3,y3,z3,dd,dd_old, - cx=task->pix_width>>1, - cy=task->pix_height>>1; - Panel reg *tempp; - Obj *tempo; - Bool w_on_map,h_on_map; - - xx=x/(MAP_SCALE*COORDINATE_SCALE); - yy=y/(MAP_SCALE*COORDINATE_SCALE); - - //World to screen coordinates - Mat4x4IdentEqu(dc->r); - Mat4x4RotZ(dc->r,heading); - Mat4x4RotX(dc->r,è); - Mat4x4RotZ(dc->r,roll); - DCMat4x4Set(dc,dc->r); - - //Screen to world coordinates - - //This gives us the vects for stepping through the grid in - //the direction the plane is facing. we step horizontally and vertically - //and use the reciprocal slope principle - //y=mx+b and y=(-1/m)x+b are perpendicular. - - s2w=Mat4x4IdentNew; - Mat4x4RotZ(s2w,-roll); - Mat4x4RotX(s2w,-è); - Mat4x4RotZ(s2w,-heading); - - xh=0; - yh=0; - zh=-256; - Mat4x4MulXYZ(s2w,&xh,&yh,&zh); - - //The layer for core1 is not cleared automatically - //it is persistent. I have carefully syncronized to the update - //cycle initiated by core0 to prevent flicker. - - dc->flags|=DCF_TRANSFORMATION; - dc->transform=&EDTransform; - dc->x=cx; - dc->y=cy; - - //dc->x and the translation part of dc->r are ident in effect, - //but we use both to show-off. We could add offsets together and - //use one or the other. - - x1=-x>>COORDINATE_BITS; - y1=-y>>COORDINATE_BITS; - z1=-z>>COORDINATE_BITS; - Mat4x4MulXYZ(dc->r,&x1,&y1,&z1); - Mat4x4TranslationEqu(dc->r,x1,y1,z1); - - //This is a refinement. - if (Abs(è*180/ã)>90) { - x3=0; - y3=-cy; - z3=0; - Mat4x4MulXYZ(s2w,&x3,&y3,&z3); - xx+=x3; - yy+=y3; - } - - if (Gs->num&1) {//alt left-right,right-left - yh2=-yh; - xh2=-xh; - } else { - yh2=yh; - xh2=xh; - } - - //Calc starting point. - x1wa=xx<<8+xh*strip_height>>1/1.3*(Gs->num+1.15); - y1wa=yy<<8+yh*strip_height>>1/1.3*(Gs->num+1.15); - x1wb=0; - y1wb=0; - - xh=-xh; //Back to front to help with depth. - yh=-yh; - - //Take half steps to cover whole grid. - xh>>=1; yh>>=1; - xh2>>=1; yh2>>=1; - w_on_map=FALSE; - dd_old=MAX_I64; - for (strip_width=0;cnts.jiffies>8; y1=y1h>>8; - if (0<=x1update!=update) { - tempp->update=update; - if (tempp->cnt>8*(1.1-Gs->idle_factor)) { - dc->color=tempp->color; - tempp->cnt=GrFillPoly3(dc,tempp->num_sides,tempp->pts); - } else - tempp->cnt++; - tempo=tempp->next_obj; - while (tempo!=&tempp->next_obj) { - Sprite3(dc,tempo->p.x,tempo->p.y,tempo->p.z,tempo->img); - tempo=tempo->next; - } - } - h_on_map=TRUE; - } else if (h_on_map) - break; - x1h+=xh; - y1h+=yh; - } - if (h_on_map) - w_on_map=TRUE; - else if (w_on_map) { - strip_width=MAX_I64; - break; - } - x1wb-=yh2; - y1wb+=xh2; - if (strip_width&1) { - x1wa-=x1wb; - y1wa-=y1wb; - } else { - x1wa+=x1wb; - y1wa+=y1wb; - } - if (!w_on_map) { - dd=SqrI64(x1wa>>8-MAP_WIDTH>>1)+SqrI64(y1wa>>8-MAP_HEIGHT>>1); - if (dd>dd_old) - break; - dd_old=dd; - } - } - - Free(s2w); - mp.strip_width[Gs->num]=strip_width; - LBtr(&mp.update_not_done_flags,Gs->num); -} - -U0 CoreAPEagleDiveTask(CTask *master_task) -{ - CDC *dc=DCAlias(main_dc,master_task); - while (!mp.app_done) { - while (!Bt(&mp.update_not_done_flags,Gs->num) && !mp.app_done) - Sleep(1); - if (!mp.app_done) - MPDrawIt(master_task,dc); - } - - //We made an alias of this we don't want freed. - dc->depth_buf=NULL; - - DCDel(dc); - LBtr(&mp.app_not_done_flags,Gs->num); -} - -U0 DrawHorizon(CDC *dc) -{ - I64 x1,y1,z1,x2,y2,z2,xh,yh,zh,*s2w=Mat4x4IdentNew, - cx=Fs->pix_width>>1, - cy=Fs->pix_height>>1; - CD3I32 p[4]; - I32 *old_db=dc->depth_buf; - dc->depth_buf=NULL; - CColorROPU32 ground_color; - - if (game_tf && fish_left) - DCFill(dc,BLACK); - else if (-ã/4<=Wrap(è-ã)<ã/4) - DCFill(dc,LTCYAN); - else { - if (z/COORDINATE_SCALE<(WATER_ELEVATION+3)*MAP_SCALE) - ground_color=BLUE; - else - ground_color=LTGREEN; - - Mat4x4IdentEqu(dc->r); - Mat4x4RotZ(dc->r,heading); - Mat4x4RotX(dc->r,è); - Mat4x4RotZ(dc->r,roll); - - DCMat4x4Set(dc,dc->r); - dc->flags&=~DCF_TRANSFORMATION; - dc->transform=&EDTransform; - dc->x=cx; - dc->y=cy; - - Mat4x4RotZ(s2w,-roll); - Mat4x4RotX(s2w,-è); - Mat4x4RotZ(s2w,-heading); - - xh=0; - yh=0; - zh=-256; - Mat4x4MulXYZ(s2w,&xh,&yh,&zh); - Free(s2w); - - x1=xh+yh*32; y1=yh-xh*32; z1=0; - (*dc->transform)(dc,&x1,&y1,&z1); - x2=xh-yh*32; y2=yh+xh*32; z2=0; - (*dc->transform)(dc,&x2,&y2,&z2); - DCClipLine(dc,&x1,&y1,&x2,&y2); - - MemSet(p,0,sizeof(p)); - if (x2width-1) { - p[0].x=0; - p[0].y=0; - p[1].x=dc->width-1; - p[1].y=0; - p[2].x=dc->width-1; - p[2].y=y2; - p[3].x=0; - p[3].y=y1; - if (rolled_over) - dc->color=ground_color; - else - dc->color=LTCYAN; - GrFillPoly3(dc,4,p); - p[0].y=dc->height-1; - p[1].y=dc->height-1; - if (rolled_over) - dc->color=LTCYAN; - else - dc->color=ground_color; - GrFillPoly3(dc,4,p); - } else { - if (y2height-1) { - p[0].x=0; - p[0].y=0; - p[1].x=0; - p[1].y=dc->height-1; - p[2].x=x2; - p[2].y=dc->height-1; - p[3].x=x1; - p[3].y=0; - if (x1color=ground_color; - else - dc->color=LTCYAN; - GrFillPoly3(dc,4,p); - p[0].x=dc->width-1; - p[1].x=dc->width-1; - if (x1color=LTCYAN; - else - dc->color=ground_color; - GrFillPoly3(dc,4,p); - } else - DCFill(dc,LTCYAN); //Not correct. - } - } - dc->depth_buf=old_db; -} - -U0 Core0EagleDive() -{ - CDC *dc=DCAlias(main_dc,Fs); - I64 i,xx,yy,elev,height,cx=Fs->pix_width>>1,cy=Fs->pix_height>>1; - F64 min_strip_width,tt; - - update_jiffy_limit=cnts.jiffies+JIFFY_FREQ/40; - - xx=x/(MAP_SCALE*COORDINATE_SCALE); - yy=y/(MAP_SCALE*COORDINATE_SCALE); - if (0<=xxWATER_ELEVATION*MAP_SCALE && !game_tf) { - music.mute=TRUE; - Beep; - game_tf=tS; - music.mute=FALSE; - } - - DrawHorizon(dc); - - if (game_tf) { - tt=game_tf-game_t0; - if (Blink) { - dc->color=RED; - GrPrint(dc,(Fs->pix_width-9*FONT_WIDTH)/2, - (Fs->pix_height-FONT_HEIGHT)/2,"Game Over"); - } - } else { - DCDepthBufRst(dc); - mp.update_not_done_flags=1<color=WHITE; - GrPrint(dc,(Fs->pix_width-13*FONT_WIDTH)/2, - (Fs->pix_height-FONT_HEIGHT)/2-4*FONT_HEIGHT,"Catch 10 Fish"); - } - } - - dc->pen_width=2; - if (game_tf && fish_left) - dc->color=WHITE; - else - dc->color=BLACK; - dc->flags&=~DCF_TRANSFORMATION; - GrLine3(dc,cx+5,cy,0,cx-5,cy,0); - GrLine3(dc,cx,cy+5,0,cx,cy-5,0); - if (invert_pitch) - GrPrint(dc,0,0,"Pitch:%5.1f Roll:%5.1f Heading:%5.1f " - "Height:%5d [Core Strip:%3d]", - pitch*180/ã,Wrap(roll+ã)*180/ã,Wrap(heading+ã,0)*180/ã, - height,strip_height); - else - GrPrint(dc,0,0,"Pitch:%5.1f Roll:%5.1f Heading:%5.1f " - "Height:%5d [Core Strip:%3d]", - pitch*180/ã,roll*180/ã,heading*180/ã,height,strip_height); - GrPrint(dc,0,FONT_HEIGHT,"Fish Remaining:%d Time:%3.2f Best:%3.2f", - fish_left,tt,best_score); - - //We made an alias of this we don't want freed. - dc->depth_buf=NULL; - DCDel(dc); - WinMgrSync; -} - - -Obj *FishFind(I64 x1,I64 y1,I64 *_dd) -{ - I64 dd,best_dd=MAX_I64; - Obj *res=NULL,*tempo; - Panel *tempp=panel_head; - while (tempp) { - tempo=tempp->next_obj; - while (tempo!=&tempp->next_obj) { - if (tempo->fish) { - dd=SqrI64(tempo->p.x-x1)+SqrI64(tempo->p.y-y1); - if (ddnext; - } - tempp=tempp->next; - } - *_dd=best_dd; - return res; -} - -#define ANIMATE_MS 10 - -U0 AnimateTask(I64) -{//Steadily moves the airplane fwd. - I64 *s2w,x1,y1,z1,dx,dy,dz,dd; - F64 t0=tS,mS,é,d; - Obj *tempo; - while (TRUE) { - mS=1000*(tS-t0); - t0=tS; - if (!game_tf) { -//Screen to world coordinates - s2w=Mat4x4IdentNew; - Mat4x4RotZ(s2w,-roll); - Mat4x4RotX(s2w,-è); - Mat4x4RotZ(s2w,-heading); - - dx=0;dy=0;dz=1<<16; - Mat4x4MulXYZ(s2w,&dx,&dy,&dz); - x-=speed*mS*COORDINATE_SCALE*dx/1<<16; - y-=speed*mS*COORDINATE_SCALE*dy/1<<16; - z-=speed*mS*COORDINATE_SCALE*dz/1<<16; - Free(s2w); - x1=x/COORDINATE_SCALE; y1=y/COORDINATE_SCALE; z1=z/COORDINATE_SCALE; - if (z1<(WATER_ELEVATION+3)*MAP_SCALE) { - if (z1p.x; - y1-=tempo->p.y; - é=ACos((dx*x1+dy*y1)/(d*1<<16)); - if (é>0 && dtask_end_cb=&SndTaskEndCB; - MusicSettingsRst; - music.stacatto_factor=0.2; - while (TRUE) { - Play("3eBDEDBDEDFEEDFEED"); - Play("BDEDBDEDFEEDFEED"); - } -} - -U0 Init() -{ - I64 i,xx,yy; - main_dc=DCNew(GR_WIDTH,GR_HEIGHT); - critical_section_flag=0; - game_tf=0; - fish_left=10; - - MemSet(&mp,0,sizeof(MPCtrl)); - InitMap; - DCDepthBufAlloc(main_dc); - - strip_height=128; - - è =-90.0*ã/180.0; - roll =0; - heading=0; - speed =2.5; - claws_down=0; - WrapAngles; - - x=MAP_WIDTH>>1 *COORDINATE_SCALE*MAP_SCALE; - y=MAP_HEIGHT>>1*COORDINATE_SCALE*MAP_SCALE; - z=64 *COORDINATE_SCALE*MAP_SCALE; - - xx=x/(MAP_SCALE*COORDINATE_SCALE); - yy=y/(MAP_SCALE*COORDINATE_SCALE); - z+=elevations[yy][xx]*COORDINATE_SCALE; - - for (i=1;itask_end_cb=&TaskEndCB; - game_t0=tS; -} - -U0 CleanUp() -{ - Panel *tempp=panel_head,*tempp1; - MPEnd; - while (tempp) { - tempp1=tempp->next; - QueDel(&tempp->next_obj); - Free(tempp->pts); - Free(tempp); - tempp=tempp1; - } - DCDel(main_dc); -} - -U0 EagleDive() -{ - I64 ch,sc; - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - MenuPush( - "File {" - " Abort(,CH_SHIFT_ESC);" - " Exit(,CH_ESC);" - "}" - "Play {" - " Restart(,'\n');" - " Down(,,SC_CURSOR_UP);" - " Up(,,SC_CURSOR_DOWN);" - " Left(,,SC_CURSOR_LEFT);" - " Right(,,SC_CURSOR_RIGHT);" - "}" - ); - AutoComplete; - WinBorder; - WinMax; - DocCursor; - DocClear; - "Initializing...\n"; - Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs); - Init; - Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs); - Fs->draw_it=&DrawIt; - try //in case is pressed. - do { - if (ScanKey(&ch,&sc)) { - switch (ch) { - case 0: - switch (sc.u8[0]) { - start: - case SC_CURSOR_DOWN: - è-=CTRLS_SCALE*Cos(roll); - heading-=CTRLS_SCALE*Sin(roll)*Sin(è); - break; - case SC_CURSOR_UP: - è+=CTRLS_SCALE*Cos(roll); - heading+=CTRLS_SCALE*Sin(roll)*Sin(è); - break; - case SC_CURSOR_RIGHT: - roll+=CTRLS_SCALE; - break; - case SC_CURSOR_LEFT: - roll-=CTRLS_SCALE; - break; - end: - WrapAngles; - } - break; - case '\n': - Fs->draw_it=NULL; - CleanUp; - WinMgrSync; - Init; - Fs->draw_it=&DrawIt; - break; - } - } else - Core0EagleDive; - } while (ch!=CH_SHIFT_ESC && ch!=CH_ESC); - catch - PutExcept; - SettingsPop; - CleanUp; - RegWriteBranch("TempleOS/EagleDive","F64 best_score=%5.4f;\n",best_score); - MenuPop; -} - -EagleDive; - -àÿÿÿýÿÿÿ -ýÿÿÿ" -"ÿÿÿÿ+ -ÿÿÿÿ+ & - & - üÿÿÿ - üÿÿÿáÿÿÿ -áÿÿÿ):_éÿÿÿ¡‘ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿŠëÿÿÿýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ ÿ ÿ ÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿbþÿÿÿâÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‚þÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿʰÿÿÿ8ÿÿÿ<8ÿÿÿȰÿÿÿÈPPȰÿÿÿÈ8ÿÿÿP8ÿÿÿ°ÿÿÿìÿÿÿÎÿÿÿÜÎÿÿÿÜ2ìÿÿÿÜ2Ü2Üìÿÿÿ2ÜÎÿÿÿÜÎÿÿÿìÿÿÿÜ     - -    -             P -á>þÿÿÿÿÿáwÿÿÿXÿÿÿ ÿÿÿwÿÿÿ ÿÿÿ>þÿÿÿÿÿQ]ýÿÿQ2„®þÿÿ2®þÿÿ]ýÿÿ       öÿÿÿöÿÿÿ -öÿÿÿ - -öÿÿÿ -öÿÿÿöÿÿÿÜ -öÿÿÿÜ - -Üöÿÿÿ -Ü»þÿÿd000000000p¨ àÿÿÿàÿÿÿàÿÿÿ àÿÿÿÉàÿÿÿàÿÿÿÉ àÿÿÿ  Éàÿÿÿ É>àÿÿÿÉÁÿÿÿàÿÿÿÉ>àÿÿÿîÁÿÿÿàÿÿÿî> ÉÁÿÿÿ É> îÁÿÿÿ î]çÿÿÿ¶Dóÿÿÿ©p XW+L]ÏD Âp8qWDep%RW2Eƒv jƒp2wW>kƒƒEj9ƒ}&j‰¨ vµƒ}?j‰3¨&vµÁÿÿÿùÿÿÿ¨ÿÿÿ®ÿÿÿÁÿÿÿe•ÿÿÿÎÿÿÿeÁÿÿÿ¶¨ÿÿÿ ¶®ÿÿÿÚÿÿÿX•ÿÿÿçÿÿÿX®ÿÿÿÁÿÿÿe•ÿÿÿÎÿÿÿe¢ÿÿÿ•ÿÿÿ‰ÿÿÿ¢ÿÿÿ®ÿÿÿÚÿÿÿX•ÿÿÿçÿÿÿX¢ÿÿÿ®ÿÿÿ‰ÿÿÿ»ÿÿÿ¢ÿÿÿœÿÿÿ‰ÿÿÿ¨ÿÿÿœÿÿÿ‰ÿÿÿèƒÿÿÿ•ÿÿÿè¢ÿÿÿ¨ÿÿÿ‰ÿÿÿµÿÿÿœÿÿÿ•ÿÿÿÛƒÿÿÿ¢ÿÿÿÛ8çÿÿÿîóÿÿÿî2ÚÿÿÿŠ çÿÿÿŠ8 îî2Š Š2ÚÿÿÿŠ çÿÿÿŠ+Îÿÿÿ&Úÿÿÿ&2Š Š+óÿÿÿ&&+ÎÿÿÿÎÿÿÿ +ôÿÿÿùÿÿÿ+ôÿÿÿ+Îÿÿÿ,Îÿÿÿ, +ùÿÿÿ+íÿÿÿçÿÿÿîÇÿÿÿóÿÿÿáùÿÿÿùÿÿÿŠÔÿÿÿ}íÿÿÿ úÇÿÿÿîùÿÿÿ –Ôÿÿÿ+ŠùÿÿÿùÿÿÿÔÿÿÿùÿÿÿ„ùÿÿÿ,àÿÿÿùÿÿÿ ùÿÿÿ+Ôÿÿÿ+„+,àÿÿÿ+ ùÿÿÿàÿÿÿWíÿÿÿdùÿÿÿ,àÿÿÿ,W,íÿÿÿd,000000000000 0  - 0 - 0  0 0  0 0 - 0 0 - 0  - 0 0  0 0 0 0 0 0 0 0 0 0 0 00000 0000 0000 0! "0"#!0%$&0&'%0! $0$%!0#"&0&'#0" $0$&"0#!%0%'# 0)(* 0*+) 0-,. 0./- 0)(, 0,-) 0+*. 0./+ 0*(, 0,.* 0+)- 0-/+010202310546067501040451032606730204046203150573098:0:;90=<>0>?=098<0<=90;:>0>?;0:8<0<>:0;9=0=?;0A@B0BCA0EDF0FGE0A@D0DEA0CBF0FGC0B@D0DFB0CAE0EGC0IHJ0JKI0MLN0NOM0IHL0LMI0KJN0NOK0JHL0LNJ0KIM0MOK0QPR0RSQ0UTV0VWU0QPT0TUQ0SRV0VWS0RPT0TVR0SQU0UWS0YXZ0Z[Y0]\^0^_]0YX\0\]Y0[Z^0^_[0ZX\0\^Z0[Y]0]_[0a`b0bca0edf0fge0a`d0dea0cbf0fgc0b`d0dfb0cae0egc0ihj0jki0mln0nom0ihl0lmi0kjn0nok0jhl0lnj0kim0mok! ->þÿÿàÿÿÿvàÿÿÿWÿÿÿvÿÿÿÿÿÿ>þÿÿÿÿÿÿÿÿ\ýÿÿP1Pƒ1®þÿÿ\ýÿÿ®þÿÿ      p¨~~ßÿÿÿ~Ê~ßÿÿÿÊ@@ßÿÿÿ@Ê@ßÿÿÿÊ~>Ê~ÁÿÿÿÊ~>î~Áÿÿÿî@>Ê@ÁÿÿÿÊ@>î@Áÿÿÿîw\¶jC©@pY3WM^\ÏQCÂ'prWf8pR,WEè‚ Üi,pw WkÜ‚EÏi9á‚'Ôi¶Žªuá‚@Ôi4¶Ž'ªueÁÿÿÿÂY¨ÿÿÿœ­ÿÿÿf”ÿÿÿfLÁÿÿÿ¶@¨ÿÿÿ¶ƒ­ÿÿÿYw”ÿÿÿYœ­ÿÿÿf”ÿÿÿfÉ¡ÿÿÿ½ˆÿÿÿƒ­ÿÿÿYw”ÿÿÿY°¡ÿÿÿ¤ˆÿÿÿ¡ÿÿÿµˆÿÿÿÖœÿÿÿéɃÿÿÿ鵡ÿÿÿ©ˆÿÿÿÉœÿÿÿܽƒÿÿÿÜw7õjõ2‘ƒ ‘Q7éEéj2…^ …2‘ƒ ‘©*-œ-j2…^ …ƒ*!w!©* © LïÿÿÿLøÿÿÿïÿÿÿ©*2©2LLøÿÿÿwìÿÿÿéjÆÿÿÿÜYøÿÿÿ…LÓÿÿÿxQìÿÿÿEÆÿÿÿõ3øÿÿÿž'Óÿÿÿ‘Yøÿÿÿ‘YÓÿÿÿ…Y-Yßÿÿÿ!'øÿÿÿ‘'Óÿÿÿ…'-'ßÿÿÿ!YLßÿÿÿúíìÿÿÿY-Lßÿÿÿ-ú-íìÿÿÿ-  - -       -  -   -      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokp¨Âþÿÿ >Âþÿÿàÿÿÿ>Âþÿÿ Âþÿÿàÿÿÿƒþÿÿ >ƒþÿÿàÿÿÿ>ƒþÿÿ ƒþÿÿàÿÿÿÂþÿÿ>ÂþÿÿÁÿÿÿÂþÿÿ>%ÂþÿÿÁÿÿÿ%ƒþÿÿ>ƒþÿÿÁÿÿÿƒþÿÿ>%ƒþÿÿÁÿÿÿ%»þÿÿ]í¯þÿÿDáƒþÿÿpwþÿÿWƒ¢þÿÿ]–þÿÿDújþÿÿp¨^þÿÿWœ}þÿÿp‰pþÿÿW},þÿÿƒW þÿÿjKpþÿÿp¯dþÿÿW¢ þÿÿƒ}þÿÿjp%þÿÿƒ]þÿÿjQúýÿÿDíýÿÿv8%þÿÿƒvþÿÿjjúýÿÿ]íýÿÿvQ©þÿÿÁÿÿÿúœþÿÿ¨ÿÿÿúáþÿÿ®ÿÿÿœÔþÿÿ•ÿÿÿœþÿÿÁÿÿÿíƒþÿÿ¨ÿÿÿíÈþÿÿ®ÿÿÿ»þÿÿ•ÿÿÿáþÿÿ®ÿÿÿœÔþÿÿ•ÿÿÿœ ÿÿÿ¢ÿÿÿKÿÿÿ‰ÿÿÿKÈþÿÿ®ÿÿÿ»þÿÿ•ÿÿÿôþÿÿ¢ÿÿÿ>çþÿÿ‰ÿÿÿ>ÿÿÿ¢ÿÿÿKúþÿÿ‰ÿÿÿKÿÿÿœÿÿÿ ÿÿÿƒÿÿÿ úþÿÿ¢ÿÿÿ>íþÿÿ‰ÿÿÿ> ÿÿÿœÿÿÿÿÿÿƒÿÿÿ¯þÿÿ8 –þÿÿ KþÿÿW 2þÿÿ2 ¯þÿÿ8>–þÿÿ>KþÿÿW>2þÿÿ2>KþÿÿW 2þÿÿ2 çýÿÿv ÎýÿÿQ KþÿÿW>2þÿÿ2>çýÿÿv>ÎýÿÿQ>»ýÿÿp»ýÿÿK»ýÿÿd»ýÿÿjpáýÿÿpáýÿÿKáýÿÿdáýÿÿjpœþÿÿíÿÿÿ ©þÿÿÇÿÿÿ 8þÿÿÔÿÿÿ Eþÿÿ®ÿÿÿ œþÿÿíÿÿÿ>©þÿÿÇÿÿÿ>8þÿÿÔÿÿÿ>Eþÿÿ®ÿÿÿ>8þÿÿÔÿÿÿ Eþÿÿ®ÿÿÿ Ôýÿÿ»ÿÿÿ áýÿÿ•ÿÿÿ 8þÿÿÔÿÿÿ>Eþÿÿ®ÿÿÿ>Ôýÿÿ»ÿÿÿ>áýÿÿ•ÿÿÿ>»ýÿÿÁÿÿÿ»ýÿÿœÿÿÿ»ýÿÿ¢ÿÿÿv»ýÿÿ|ÿÿÿ]áýÿÿÁÿÿÿáýÿÿœÿÿÿáýÿÿ¢ÿÿÿváýÿÿ|ÿÿÿ]000000000000 0  - 0 - 0  0 0  0 0 - 0 0 - 0  - 0 0  0 0 0 0 0 0 0 0 0 0 0 00000 0000 0000 0! "0"#!0%$&0&'%0! $0$%!0#"&0&'#0" $0$&"0#!%0%'# 0)(* 0*+) 0-,. 0./- 0)(, 0,-) 0+*. 0./+ 0*(, 0,.* 0+)- 0-/+010202310546067501040451032606730204046203150573098:0:;90=<>0>?=098<0<=90;:>0>?;0:8<0<>:0;9=0=?; -0A@B -0BCA -0EDF -0FGE -0A@D -0DEA -0CBF -0FGC -0B@D -0DFB -0CAE -0EGC0IHJ0JKI0MLN0NOM0IHL0LMI0KJN0NOK0JHL0LNJ0KIM0MOK0QPR0RSQ0UTV0VWU0QPT0TUQ0SRV0VWS0RPT0TVR0SQU0UWS -0YXZ -0Z[Y -0]\^ -0^_] -0YX\ -0\]Y -0[Z^ -0^_[ -0ZX\ -0\^Z -0[Y] -0]_[0a`b0bca0edf0fge0a`d0dea0cbf0fgc0b`d0dfb0cae0egc0ihj0jki0mln0nom0ihl0lmi0kjn0nok0jhl0lnj0kim0mok \ No newline at end of file diff --git a/Demo/Games/EagleDive.HC b/Demo/Games/EagleDive.HC new file mode 100644 index 0000000..4a02aee --- /dev/null +++ b/Demo/Games/EagleDive.HC @@ -0,0 +1,1251 @@ +//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.HC"$. + +RegSetDftEntry("TempleOS/EagleDive","F64 best_score=9999;\n"); +RegExeBranch("TempleOS/EagleDive"); + +//Keep these power of two so shift is used instead of multiply +//to index arrays. +#define MAP_WIDTH 1024 +#define MAP_HEIGHT 1024 + +#define MAP_SCALE 150 +#define DISPLAY_SCALE 100 +#define CTRLS_SCALE 0.05 + +//I think I did these so the heads-up showed intelligable numbers. +//Scaling is a mess. +#define COORDINATE_SCALE 256 +#define COORDINATE_BITS 8 + +#define WATER_ELEVATION 15 +#define ROCK_ELEVATION 45 +#define SNOW_ELEVATION 55 + +//Too big makes off-screen draws take place. +#define MAX_PANEL_SIZE 16 + + + + + + + + + + + + + + + + + + + + + + $SP,"<1>",BI=1$ + + + + + + + + + + + + + + + + + + + + + + + + + + $SP,"<2>",BI=2$ + + + + + + + + + + + + + + + + + + + + + + + + + + + $SP,"<3>",BI=3$ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $SP,"<4>",BI=4$ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +class Obj +{ + Obj *next,*last; + CD3I64 p; + U8 *img; + Bool fish; +}; + +class Panel +{//Polygon or Obj + Panel *next; + CD3I32 *pts; + I64 cnt; + U16 update,num_sides; + CColorROPU32 color; + Obj *next_obj,*last_obj; +} *panel_head,*panels[MAP_HEIGHT][MAP_WIDTH]; + +I64 critical_section_flag; +I16 elevations[MAP_HEIGHT][MAP_WIDTH]; +CD3 normals[MAP_HEIGHT][MAP_WIDTH]; + +class MPCtrl { + I64 init_not_done_flags,update_not_done_flags,app_not_done_flags; + I64 strip_width[MP_MAX_PROCESSORS]; + Bool app_done; +} mp; + +F64 game_t0,game_tf,pitch,roll,heading,è,speed; +Bool invert_pitch,rolled_over; +I64 strip_height,x,y,z,fish_left; + +U0 WrapAngles() +{ + è=Wrap(è); + pitch=Wrap(-è-ã/2); + if (Abs(pitch)>ã/2) { + invert_pitch=TRUE; + pitch=Wrap(ã-pitch); + } else + invert_pitch=FALSE; + roll=Wrap(roll); + if (invert_pitch ^^ -ã/2<=roll<ã/2) + rolled_over=FALSE; + else + rolled_over=TRUE; + heading=Wrap(heading,0); +} + +U0 EDTransform(CDC *dc,I64 *x,I64 *y,I64 *z) +{ + I64 zz; + Mat4x4MulXYZ(dc->r,x,y,z); + *z=zz=-*z; + if (zz>0) { + *x = dc->x + *x * DISPLAY_SCALE/zz; //Foreshortening + *y = dc->y - *y * DISPLAY_SCALE/zz; + } else { + *x = dc->x + *x; + *y = dc->y - *y; + } +} + +U0 CalcNormals() +{/*Find the normal vect with a curl. + +i,j and k are the axis unit vectors, +not to be confused with my local index variables. + +i j k +0 1 dz2 +1 0 dz1 + +Normal: dz1*i + dz2*j - k +*/ + I64 i,j; + for (j=0;j.10) + return FALSE; + return TRUE; +} + +U0 MPDoPanels(CTask *task) +{ + I64 i,j,l,k1,k2,w,h,threshold,lo,hi; + Bool cont; + Panel *tempp,*start_ptr=NULL,*end_ptr=NULL; + CD3I32 *poly; + Obj *tempo; + lo=Gs->num*(MAP_HEIGHT-1)/mp_cnt; + hi=(Gs->num+1)*(MAP_HEIGHT-1)/mp_cnt; + for (threshold=8;threshold>=1;threshold--) + for (j=lo;j=threshold || h>=threshold) { + tempp=CAlloc(sizeof(Panel),task); + QueInit(&tempp->next_obj); + l=elevations[j][i]; + if (l<=WATER_ELEVATION*MAP_SCALE && + elevations[j][i+w-1]<=WATER_ELEVATION*MAP_SCALE && + elevations[j+h-1][i]<=WATER_ELEVATION*MAP_SCALE && + elevations[j+h-1][i+w-1]<=WATER_ELEVATION*MAP_SCALE) { + tempp->color=BLUE; + if (Rand<0.05) { + tempo=MAlloc(sizeof(Obj),task); + tempo->p.x=(i+w/2)*MAP_SCALE; + tempo->p.y=(j+h/2)*MAP_SCALE; + if (Rand<0.1) { + tempo->fish=FALSE; + if (RandI16&1) + tempo->img=$IB,"<2>",BI=2$; //Boat + else + tempo->img=$IB,"<3>",BI=3$; //Boat + tempo->p.z=(WATER_ELEVATION+2)*MAP_SCALE; + } else { + tempo->fish=TRUE; + tempo->img=$IB,"<1>",BI=1$; //Fish + tempo->p.z=WATER_ELEVATION*MAP_SCALE; + } + QueIns(tempo,tempp->last_obj); + } + } else { + if (lcolor=LTGREEN; + else + tempp->color=GREEN+LTGREEN<<16+ROPF_DITHER; + if (Rand<0.03) { + tempo=MAlloc(sizeof(Obj),task); + tempo->p.x=(i+w/2)*MAP_SCALE; + tempo->p.y=(j+h/2)*MAP_SCALE; + tempo->p.z=l; + tempo->img=$IB,"<4>",BI=4$; //Tree + tempo->fish=FALSE; + QueIns(tempo,tempp->last_obj); + } + } else if (lcolor=LTGRAY; + else + tempp->color=DKGRAY+LTGRAY<<16+ROPF_DITHER; + } else { + if (RandI16&1) + tempp->color=LTGREEN; + else + tempp->color=GREEN+LTGREEN<<16+ROPF_DITHER; + } + } else { + if (!(RandU16&3)) { + if (RandI16&1) + tempp->color=WHITE; + else + tempp->color=LTGRAY; + } else { + if (RandI16&1) + tempp->color=LTGRAY+WHITE<<16+ROPF_DITHER; + else + tempp->color=DKGRAY+LTGRAY<<16+ROPF_DITHER; + } + } + } + tempp->num_sides=4; + poly=tempp->pts=MAlloc(sizeof(CD3I32)*tempp->num_sides,task); + poly[0].x=MAP_SCALE*i; + poly[0].y=MAP_SCALE*j; + poly[0].z=elevations[j][i]; + poly[1].x=MAP_SCALE*(i+w); + poly[1].y=MAP_SCALE*j; + poly[1].z=elevations[j][i+w]; + poly[2].x=MAP_SCALE*(i+w); + poly[2].y=MAP_SCALE*(j+h); + poly[2].z=elevations[j+h][i+w]; + poly[3].x=MAP_SCALE*i; + poly[3].y=MAP_SCALE*(j+h); + poly[3].z=elevations[j+h][i]; + tempp->next=start_ptr; + start_ptr=tempp; + if (!end_ptr) + end_ptr=tempp; + for (k2=0;k2next=panel_head; + panel_head=start_ptr; + LBtr(&critical_section_flag,0); + } + LBtr(&mp.init_not_done_flags,Gs->num); +} + +U0 InitElevations() +{ + I64 i,j,l,x,y,xx,yy,x1,y1,x2,y2; + MemSet(elevations,0,sizeof(elevations)); + for (i=0;i",BI=5$ +$SP,"<6>",BI=6$ + + + +U0 ClawDraw(CDC *dc,I64 x1,I64 y1,I64 x2,I64 y2,I64 w,I64 segments,Bool talon) +{ + I64 i,j; + for (i=0,j=segments;ipen_width=w; + dc->color=BLACK; + GrLine3(dc, + j*x1/segments+i*x2/segments, + j*y1/segments+i*y2/segments,0, + (j-1)*x1/segments+(i+1)*x2/segments, + (j-1)*y1/segments+(i+1)*y2/segments,0); + dc->pen_width=w-2; + dc->color=YELLOW; + GrLine3(dc, + j*x1/segments+i*x2/segments, + j*y1/segments+i*y2/segments,0, + (j-1)*x1/segments+(i+1)*x2/segments, + (j-1)*y1/segments+(i+1)*y2/segments,0); + } + if (talon) { + if (y1",BI=5$); + else + Sprite3B(dc,x1,y1,0,$IB,"<6>",BI=6$); + } +} + +U0 ClawsDraw(CTask *task,CDC *dc) +{ + F64 claws_up=1.0-claws_down; + I64 w=task->pix_width,h=task->pix_height; + dc->flags|=DCF_SYMMETRY; + DCSymmetrySet(dc,w>>1,0,w>>1,1); + + ClawDraw(dc,HAND_X-30,HAND_Y-50*claws_up,HAND_X-5,HAND_Y, 22,4,TRUE); + ClawDraw(dc,HAND_X-10,HAND_Y-60*claws_up,HAND_X,HAND_Y, 22,4,TRUE); + ClawDraw(dc,HAND_X+10,HAND_Y-60*claws_up,HAND_X,HAND_Y, 22,4,TRUE); + ClawDraw(dc,HAND_X+30,HAND_Y-50*claws_up,HAND_X+5,HAND_Y, 22,4,TRUE); + ClawDraw(dc,HAND_X+25,HAND_Y+40*claws_up,HAND_X+5,HAND_Y, 22,4,TRUE); + + ClawDraw(dc,HAND_X,HAND_Y,6*w/20,h,38,5,FALSE); +} + +CDC *main_dc; +U0 DrawIt(CTask *task,CDC *dc) +{ + main_dc->flags|=DCF_NO_TRANSPARENTS; + GrBlot(dc,0,0,main_dc); + if (claws_down) + ClawsDraw(task,dc); +} + +/* +$SP,"<7>",BI=7$ + + + + + + + + + + + + + + + + + + +$SP,"<8>",BI=8$ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Cores render strips that +/- 15%. The cores check the panel map array +and render the panel for each square, marking-it done. + +The depth buf is not locked in the graphic routines +so we get some glitches. +*/ + +I64 update_jiffy_limit; + +U0 MPDrawIt(CTask *task,CDC *dc) +{ + I64 j,update=winmgr.updates&65535,strip_width,*s2w,x1,y1,z1,xx,yy, + xh,yh,zh,yh2,xh2,x1h,y1h,x1wa,y1wa,x1wb,y1wb, + x3,y3,z3,dd,dd_old, + cx=task->pix_width>>1, + cy=task->pix_height>>1; + Panel reg *tempp; + Obj *tempo; + Bool w_on_map,h_on_map; + + xx=x/(MAP_SCALE*COORDINATE_SCALE); + yy=y/(MAP_SCALE*COORDINATE_SCALE); + + //World to screen coordinates + Mat4x4IdentEqu(dc->r); + Mat4x4RotZ(dc->r,heading); + Mat4x4RotX(dc->r,è); + Mat4x4RotZ(dc->r,roll); + DCMat4x4Set(dc,dc->r); + + //Screen to world coordinates + + //This gives us the vects for stepping through the grid in + //the direction the plane is facing. we step horizontally and vertically + //and use the reciprocal slope principle + //y=mx+b and y=(-1/m)x+b are perpendicular. + + s2w=Mat4x4IdentNew; + Mat4x4RotZ(s2w,-roll); + Mat4x4RotX(s2w,-è); + Mat4x4RotZ(s2w,-heading); + + xh=0; + yh=0; + zh=-256; + Mat4x4MulXYZ(s2w,&xh,&yh,&zh); + + //The layer for core1 is not cleared automatically + //it is persistent. I have carefully syncronized to the update + //cycle initiated by core0 to prevent flicker. + + dc->flags|=DCF_TRANSFORMATION; + dc->transform=&EDTransform; + dc->x=cx; + dc->y=cy; + + //dc->x and the translation part of dc->r are ident in effect, + //but we use both to show-off. We could add offsets together and + //use one or the other. + + x1=-x>>COORDINATE_BITS; + y1=-y>>COORDINATE_BITS; + z1=-z>>COORDINATE_BITS; + Mat4x4MulXYZ(dc->r,&x1,&y1,&z1); + Mat4x4TranslationEqu(dc->r,x1,y1,z1); + + //This is a refinement. + if (Abs(è*180/ã)>90) { + x3=0; + y3=-cy; + z3=0; + Mat4x4MulXYZ(s2w,&x3,&y3,&z3); + xx+=x3; + yy+=y3; + } + + if (Gs->num&1) {//alt left-right,right-left + yh2=-yh; + xh2=-xh; + } else { + yh2=yh; + xh2=xh; + } + + //Calc starting point. + x1wa=xx<<8+xh*strip_height>>1/1.3*(Gs->num+1.15); + y1wa=yy<<8+yh*strip_height>>1/1.3*(Gs->num+1.15); + x1wb=0; + y1wb=0; + + xh=-xh; //Back to front to help with depth. + yh=-yh; + + //Take half steps to cover whole grid. + xh>>=1; yh>>=1; + xh2>>=1; yh2>>=1; + w_on_map=FALSE; + dd_old=MAX_I64; + for (strip_width=0;cnts.jiffies>8; y1=y1h>>8; + if (0<=x1update!=update) { + tempp->update=update; + if (tempp->cnt>8*(1.1-Gs->idle_factor)) { + dc->color=tempp->color; + tempp->cnt=GrFillPoly3(dc,tempp->num_sides,tempp->pts); + } else + tempp->cnt++; + tempo=tempp->next_obj; + while (tempo!=&tempp->next_obj) { + Sprite3(dc,tempo->p.x,tempo->p.y,tempo->p.z,tempo->img); + tempo=tempo->next; + } + } + h_on_map=TRUE; + } else if (h_on_map) + break; + x1h+=xh; + y1h+=yh; + } + if (h_on_map) + w_on_map=TRUE; + else if (w_on_map) { + strip_width=MAX_I64; + break; + } + x1wb-=yh2; + y1wb+=xh2; + if (strip_width&1) { + x1wa-=x1wb; + y1wa-=y1wb; + } else { + x1wa+=x1wb; + y1wa+=y1wb; + } + if (!w_on_map) { + dd=SqrI64(x1wa>>8-MAP_WIDTH>>1)+SqrI64(y1wa>>8-MAP_HEIGHT>>1); + if (dd>dd_old) + break; + dd_old=dd; + } + } + + Free(s2w); + mp.strip_width[Gs->num]=strip_width; + LBtr(&mp.update_not_done_flags,Gs->num); +} + +U0 CoreAPEagleDiveTask(CTask *master_task) +{ + CDC *dc=DCAlias(main_dc,master_task); + while (!mp.app_done) { + while (!Bt(&mp.update_not_done_flags,Gs->num) && !mp.app_done) + Sleep(1); + if (!mp.app_done) + MPDrawIt(master_task,dc); + } + + //We made an alias of this we don't want freed. + dc->depth_buf=NULL; + + DCDel(dc); + LBtr(&mp.app_not_done_flags,Gs->num); +} + +U0 DrawHorizon(CDC *dc) +{ + I64 x1,y1,z1,x2,y2,z2,xh,yh,zh,*s2w=Mat4x4IdentNew, + cx=Fs->pix_width>>1, + cy=Fs->pix_height>>1; + CD3I32 p[4]; + I32 *old_db=dc->depth_buf; + dc->depth_buf=NULL; + CColorROPU32 ground_color; + + if (game_tf && fish_left) + DCFill(dc,BLACK); + else if (-ã/4<=Wrap(è-ã)<ã/4) + DCFill(dc,LTCYAN); + else { + if (z/COORDINATE_SCALE<(WATER_ELEVATION+3)*MAP_SCALE) + ground_color=BLUE; + else + ground_color=LTGREEN; + + Mat4x4IdentEqu(dc->r); + Mat4x4RotZ(dc->r,heading); + Mat4x4RotX(dc->r,è); + Mat4x4RotZ(dc->r,roll); + + DCMat4x4Set(dc,dc->r); + dc->flags&=~DCF_TRANSFORMATION; + dc->transform=&EDTransform; + dc->x=cx; + dc->y=cy; + + Mat4x4RotZ(s2w,-roll); + Mat4x4RotX(s2w,-è); + Mat4x4RotZ(s2w,-heading); + + xh=0; + yh=0; + zh=-256; + Mat4x4MulXYZ(s2w,&xh,&yh,&zh); + Free(s2w); + + x1=xh+yh*32; y1=yh-xh*32; z1=0; + (*dc->transform)(dc,&x1,&y1,&z1); + x2=xh-yh*32; y2=yh+xh*32; z2=0; + (*dc->transform)(dc,&x2,&y2,&z2); + DCClipLine(dc,&x1,&y1,&x2,&y2); + + MemSet(p,0,sizeof(p)); + if (x2width-1) { + p[0].x=0; + p[0].y=0; + p[1].x=dc->width-1; + p[1].y=0; + p[2].x=dc->width-1; + p[2].y=y2; + p[3].x=0; + p[3].y=y1; + if (rolled_over) + dc->color=ground_color; + else + dc->color=LTCYAN; + GrFillPoly3(dc,4,p); + p[0].y=dc->height-1; + p[1].y=dc->height-1; + if (rolled_over) + dc->color=LTCYAN; + else + dc->color=ground_color; + GrFillPoly3(dc,4,p); + } else { + if (y2height-1) { + p[0].x=0; + p[0].y=0; + p[1].x=0; + p[1].y=dc->height-1; + p[2].x=x2; + p[2].y=dc->height-1; + p[3].x=x1; + p[3].y=0; + if (x1color=ground_color; + else + dc->color=LTCYAN; + GrFillPoly3(dc,4,p); + p[0].x=dc->width-1; + p[1].x=dc->width-1; + if (x1color=LTCYAN; + else + dc->color=ground_color; + GrFillPoly3(dc,4,p); + } else + DCFill(dc,LTCYAN); //Not correct. + } + } + dc->depth_buf=old_db; +} + +U0 Core0EagleDive() +{ + CDC *dc=DCAlias(main_dc,Fs); + I64 i,xx,yy,elev,height,cx=Fs->pix_width>>1,cy=Fs->pix_height>>1; + F64 min_strip_width,tt; + + update_jiffy_limit=cnts.jiffies+JIFFY_FREQ/40; + + xx=x/(MAP_SCALE*COORDINATE_SCALE); + yy=y/(MAP_SCALE*COORDINATE_SCALE); + if (0<=xxWATER_ELEVATION*MAP_SCALE && !game_tf) { + music.mute=TRUE; + Beep; + game_tf=tS; + music.mute=FALSE; + } + + DrawHorizon(dc); + + if (game_tf) { + tt=game_tf-game_t0; + if (Blink) { + dc->color=RED; + GrPrint(dc,(Fs->pix_width-9*FONT_WIDTH)/2, + (Fs->pix_height-FONT_HEIGHT)/2,"Game Over"); + } + } else { + DCDepthBufRst(dc); + mp.update_not_done_flags=1<color=WHITE; + GrPrint(dc,(Fs->pix_width-13*FONT_WIDTH)/2, + (Fs->pix_height-FONT_HEIGHT)/2-4*FONT_HEIGHT,"Catch 10 Fish"); + } + } + + dc->pen_width=2; + if (game_tf && fish_left) + dc->color=WHITE; + else + dc->color=BLACK; + dc->flags&=~DCF_TRANSFORMATION; + GrLine3(dc,cx+5,cy,0,cx-5,cy,0); + GrLine3(dc,cx,cy+5,0,cx,cy-5,0); + if (invert_pitch) + GrPrint(dc,0,0,"Pitch:%5.1f Roll:%5.1f Heading:%5.1f " + "Height:%5d [Core Strip:%3d]", + pitch*180/ã,Wrap(roll+ã)*180/ã,Wrap(heading+ã,0)*180/ã, + height,strip_height); + else + GrPrint(dc,0,0,"Pitch:%5.1f Roll:%5.1f Heading:%5.1f " + "Height:%5d [Core Strip:%3d]", + pitch*180/ã,roll*180/ã,heading*180/ã,height,strip_height); + GrPrint(dc,0,FONT_HEIGHT,"Fish Remaining:%d Time:%3.2f Best:%3.2f", + fish_left,tt,best_score); + + //We made an alias of this we don't want freed. + dc->depth_buf=NULL; + DCDel(dc); + WinMgrSync; +} + + +Obj *FishFind(I64 x1,I64 y1,I64 *_dd) +{ + I64 dd,best_dd=MAX_I64; + Obj *res=NULL,*tempo; + Panel *tempp=panel_head; + while (tempp) { + tempo=tempp->next_obj; + while (tempo!=&tempp->next_obj) { + if (tempo->fish) { + dd=SqrI64(tempo->p.x-x1)+SqrI64(tempo->p.y-y1); + if (ddnext; + } + tempp=tempp->next; + } + *_dd=best_dd; + return res; +} + +#define ANIMATE_MS 10 + +U0 AnimateTask(I64) +{//Steadily moves the airplane fwd. + I64 *s2w,x1,y1,z1,dx,dy,dz,dd; + F64 t0=tS,ms,é,d; + Obj *tempo; + while (TRUE) { + ms=1000*(tS-t0); + t0=tS; + if (!game_tf) { +//Screen to world coordinates + s2w=Mat4x4IdentNew; + Mat4x4RotZ(s2w,-roll); + Mat4x4RotX(s2w,-è); + Mat4x4RotZ(s2w,-heading); + + dx=0;dy=0;dz=1<<16; + Mat4x4MulXYZ(s2w,&dx,&dy,&dz); + x-=speed*ms*COORDINATE_SCALE*dx/1<<16; + y-=speed*ms*COORDINATE_SCALE*dy/1<<16; + z-=speed*ms*COORDINATE_SCALE*dz/1<<16; + Free(s2w); + x1=x/COORDINATE_SCALE; y1=y/COORDINATE_SCALE; z1=z/COORDINATE_SCALE; + if (z1<(WATER_ELEVATION+3)*MAP_SCALE) { + if (z1p.x; + y1-=tempo->p.y; + é=ACos((dx*x1+dy*y1)/(d*1<<16)); + if (é>0 && dtask_end_cb=&SndTaskEndCB; + MusicSettingsRst; + while (TRUE) { + Play("3eCGFsDAe.C2sG3eGDqCDeGsGG2qG"); + Play("3eCGFsDAe.C2sG3eGDqCDeGsGG2qG"); + Play("3eGECGCAFCsCBCBe.GsG2qG3B"); + Play("eGECGCAFCsCBCBe.GsG2qG3B"); + } +} + +U0 Init() +{ + I64 i,xx,yy; + main_dc=DCNew(GR_WIDTH,GR_HEIGHT); + critical_section_flag=0; + game_tf=0; + fish_left=10; + + MemSet(&mp,0,sizeof(MPCtrl)); + InitMap; + DCDepthBufAlloc(main_dc); + + strip_height=128; + + è =-90.0*ã/180.0; + roll =0; + heading=0; + speed =2.5; + claws_down=0; + WrapAngles; + + x=MAP_WIDTH>>1 *COORDINATE_SCALE*MAP_SCALE; + y=MAP_HEIGHT>>1*COORDINATE_SCALE*MAP_SCALE; + z=64 *COORDINATE_SCALE*MAP_SCALE; + + xx=x/(MAP_SCALE*COORDINATE_SCALE); + yy=y/(MAP_SCALE*COORDINATE_SCALE); + z+=elevations[yy][xx]*COORDINATE_SCALE; + + for (i=1;itask_end_cb=&TaskEndCB; + game_t0=tS; +} + +U0 CleanUp() +{ + Panel *tempp=panel_head,*tempp1; + MPEnd; + while (tempp) { + tempp1=tempp->next; + QueDel(&tempp->next_obj); + Free(tempp->pts); + Free(tempp); + tempp=tempp1; + } + DCDel(main_dc); +} + +U0 EagleDive() +{ + I64 ch,sc; + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + MenuPush( + "File {" + " Abort(,CH_SHIFT_ESC);" + " Exit(,CH_ESC);" + "}" + "Play {" + " Restart(,'\n');" + " Down(,,SC_CURSOR_UP);" + " Up(,,SC_CURSOR_DOWN);" + " Left(,,SC_CURSOR_LEFT);" + " Right(,,SC_CURSOR_RIGHT);" + "}" + ); + AutoComplete; + WinBorder; + WinMax; + DocCursor; + DocClear; + "Initializing...\n"; + Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs); + Init; + Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs); + Fs->draw_it=&DrawIt; + try //in case is pressed. + do { + if (ScanKey(&ch,&sc)) { + switch (ch) { + case 0: + switch (sc.u8[0]) { + start: + case SC_CURSOR_DOWN: + è-=CTRLS_SCALE*Cos(roll); + heading-=CTRLS_SCALE*Sin(roll)*Sin(è); + break; + case SC_CURSOR_UP: + è+=CTRLS_SCALE*Cos(roll); + heading+=CTRLS_SCALE*Sin(roll)*Sin(è); + break; + case SC_CURSOR_RIGHT: + roll+=CTRLS_SCALE; + break; + case SC_CURSOR_LEFT: + roll-=CTRLS_SCALE; + break; + end: + WrapAngles; + } + break; + case '\n': + Fs->draw_it=NULL; + CleanUp; + WinMgrSync; + Init; + Fs->draw_it=&DrawIt; + break; + } + } else + Core0EagleDive; + } while (ch!=CH_SHIFT_ESC && ch!=CH_ESC); + catch + PutExcept; + SettingsPop; + CleanUp; + RegWriteBranch("TempleOS/EagleDive","F64 best_score=%5.4f;\n",best_score); + MenuPop; +} + +EagleDive; + +àÿÿÿýÿÿÿ +ýÿÿÿ" +"ÿÿÿÿ+ +ÿÿÿÿ+ & + & + üÿÿÿ + üÿÿÿáÿÿÿ +áÿÿÿ):_éÿÿÿ¡‘ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿŠëÿÿÿýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ ÿ ÿ ÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿbþÿÿÿâÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‚þÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿʰÿÿÿ8ÿÿÿ<8ÿÿÿȰÿÿÿÈPPȰÿÿÿÈ8ÿÿÿP8ÿÿÿ°ÿÿÿìÿÿÿÎÿÿÿÜÎÿÿÿÜ2ìÿÿÿÜ2Ü2Üìÿÿÿ2ÜÎÿÿÿÜÎÿÿÿìÿÿÿÜ     + +    +             P +á>þÿÿÿÿÿáwÿÿÿXÿÿÿ ÿÿÿwÿÿÿ ÿÿÿ>þÿÿÿÿÿQ]ýÿÿQ2„®þÿÿ2®þÿÿ]ýÿÿ       öÿÿÿöÿÿÿ +öÿÿÿ + +öÿÿÿ +öÿÿÿöÿÿÿÜ +öÿÿÿÜ + +Üöÿÿÿ +Ü»þÿÿd000000000p¨ àÿÿÿàÿÿÿàÿÿÿ àÿÿÿÉàÿÿÿàÿÿÿÉ àÿÿÿ  Éàÿÿÿ É>àÿÿÿÉÁÿÿÿàÿÿÿÉ>àÿÿÿîÁÿÿÿàÿÿÿî> ÉÁÿÿÿ É> îÁÿÿÿ î]çÿÿÿ¶Dóÿÿÿ©p XW+L]ÏD Âp8qWDep%RW2Eƒv jƒp2wW>kƒƒEj9ƒ}&j‰¨ vµƒ}?j‰3¨&vµÁÿÿÿùÿÿÿ¨ÿÿÿ®ÿÿÿÁÿÿÿe•ÿÿÿÎÿÿÿeÁÿÿÿ¶¨ÿÿÿ ¶®ÿÿÿÚÿÿÿX•ÿÿÿçÿÿÿX®ÿÿÿÁÿÿÿe•ÿÿÿÎÿÿÿe¢ÿÿÿ•ÿÿÿ‰ÿÿÿ¢ÿÿÿ®ÿÿÿÚÿÿÿX•ÿÿÿçÿÿÿX¢ÿÿÿ®ÿÿÿ‰ÿÿÿ»ÿÿÿ¢ÿÿÿœÿÿÿ‰ÿÿÿ¨ÿÿÿœÿÿÿ‰ÿÿÿèƒÿÿÿ•ÿÿÿè¢ÿÿÿ¨ÿÿÿ‰ÿÿÿµÿÿÿœÿÿÿ•ÿÿÿÛƒÿÿÿ¢ÿÿÿÛ8çÿÿÿîóÿÿÿî2ÚÿÿÿŠ çÿÿÿŠ8 îî2Š Š2ÚÿÿÿŠ çÿÿÿŠ+Îÿÿÿ&Úÿÿÿ&2Š Š+óÿÿÿ&&+ÎÿÿÿÎÿÿÿ +ôÿÿÿùÿÿÿ+ôÿÿÿ+Îÿÿÿ,Îÿÿÿ, +ùÿÿÿ+íÿÿÿçÿÿÿîÇÿÿÿóÿÿÿáùÿÿÿùÿÿÿŠÔÿÿÿ}íÿÿÿ úÇÿÿÿîùÿÿÿ –Ôÿÿÿ+ŠùÿÿÿùÿÿÿÔÿÿÿùÿÿÿ„ùÿÿÿ,àÿÿÿùÿÿÿ ùÿÿÿ+Ôÿÿÿ+„+,àÿÿÿ+ ùÿÿÿàÿÿÿWíÿÿÿdùÿÿÿ,àÿÿÿ,W,íÿÿÿd,000000000000 0  + 0 + 0  0 0  0 0 + 0 0 + 0  + 0 0  0 0 0 0 0 0 0 0 0 0 0 00000 0000 0000 0! "0"#!0%$&0&'%0! $0$%!0#"&0&'#0" $0$&"0#!%0%'# 0)(* 0*+) 0-,. 0./- 0)(, 0,-) 0+*. 0./+ 0*(, 0,.* 0+)- 0-/+010202310546067501040451032606730204046203150573098:0:;90=<>0>?=098<0<=90;:>0>?;0:8<0<>:0;9=0=?;0A@B0BCA0EDF0FGE0A@D0DEA0CBF0FGC0B@D0DFB0CAE0EGC0IHJ0JKI0MLN0NOM0IHL0LMI0KJN0NOK0JHL0LNJ0KIM0MOK0QPR0RSQ0UTV0VWU0QPT0TUQ0SRV0VWS0RPT0TVR0SQU0UWS0YXZ0Z[Y0]\^0^_]0YX\0\]Y0[Z^0^_[0ZX\0\^Z0[Y]0]_[0a`b0bca0edf0fge0a`d0dea0cbf0fgc0b`d0dfb0cae0egc0ihj0jki0mln0nom0ihl0lmi0kjn0nok0jhl0lnj0kim0mok! +>þÿÿàÿÿÿvàÿÿÿWÿÿÿvÿÿÿÿÿÿ>þÿÿÿÿÿÿÿÿ\ýÿÿP1Pƒ1®þÿÿ\ýÿÿ®þÿÿ      p¨~~ßÿÿÿ~Ê~ßÿÿÿÊ@@ßÿÿÿ@Ê@ßÿÿÿÊ~>Ê~ÁÿÿÿÊ~>î~Áÿÿÿî@>Ê@ÁÿÿÿÊ@>î@Áÿÿÿîw\¶jC©@pY3WM^\ÏQCÂ'prWf8pR,WEè‚ Üi,pw WkÜ‚EÏi9á‚'Ôi¶Žªuá‚@Ôi4¶Ž'ªueÁÿÿÿÂY¨ÿÿÿœ­ÿÿÿf”ÿÿÿfLÁÿÿÿ¶@¨ÿÿÿ¶ƒ­ÿÿÿYw”ÿÿÿYœ­ÿÿÿf”ÿÿÿfÉ¡ÿÿÿ½ˆÿÿÿƒ­ÿÿÿYw”ÿÿÿY°¡ÿÿÿ¤ˆÿÿÿ¡ÿÿÿµˆÿÿÿÖœÿÿÿéɃÿÿÿ鵡ÿÿÿ©ˆÿÿÿÉœÿÿÿܽƒÿÿÿÜw7õjõ2‘ƒ ‘Q7éEéj2…^ …2‘ƒ ‘©*-œ-j2…^ …ƒ*!w!©* © LïÿÿÿLøÿÿÿïÿÿÿ©*2©2LLøÿÿÿwìÿÿÿéjÆÿÿÿÜYøÿÿÿ…LÓÿÿÿxQìÿÿÿEÆÿÿÿõ3øÿÿÿž'Óÿÿÿ‘Yøÿÿÿ‘YÓÿÿÿ…Y-Yßÿÿÿ!'øÿÿÿ‘'Óÿÿÿ…'-'ßÿÿÿ!YLßÿÿÿúíìÿÿÿY-Lßÿÿÿ-ú-íìÿÿÿ-  + +       +  +   +      ! ""#!%$&&'%! $$%!#"&&'#" $$&"#!%%'#)(**+)-,../-)(,,-)+*../+*(,,.*+)--/+10223154667510445132667320446231557398::;9=<>>?=98<<=9;:>>?;:8<<>:;9==?;A@BBCAEDFFGEA@DDEACBFFGCB@DDFBCAEEGCIHJJKIMLNNOMIHLLMIKJNNOKJHLLNJKIMMOKQPRRSQUTVVWUQPTTUQSRVVWSRPTTVRSQUUWSYXZZ[Y]\^^_]YX\\]Y[Z^^_[ZX\\^Z[Y]]_[a`bbcaedffgea`ddeacbffgcb`ddfbcaeegcihjjkimlnnomihllmikjnnokjhllnjkimmokp¨Âþÿÿ >Âþÿÿàÿÿÿ>Âþÿÿ Âþÿÿàÿÿÿƒþÿÿ >ƒþÿÿàÿÿÿ>ƒþÿÿ ƒþÿÿàÿÿÿÂþÿÿ>ÂþÿÿÁÿÿÿÂþÿÿ>%ÂþÿÿÁÿÿÿ%ƒþÿÿ>ƒþÿÿÁÿÿÿƒþÿÿ>%ƒþÿÿÁÿÿÿ%»þÿÿ]í¯þÿÿDáƒþÿÿpwþÿÿWƒ¢þÿÿ]–þÿÿDújþÿÿp¨^þÿÿWœ}þÿÿp‰pþÿÿW},þÿÿƒW þÿÿjKpþÿÿp¯dþÿÿW¢ þÿÿƒ}þÿÿjp%þÿÿƒ]þÿÿjQúýÿÿDíýÿÿv8%þÿÿƒvþÿÿjjúýÿÿ]íýÿÿvQ©þÿÿÁÿÿÿúœþÿÿ¨ÿÿÿúáþÿÿ®ÿÿÿœÔþÿÿ•ÿÿÿœþÿÿÁÿÿÿíƒþÿÿ¨ÿÿÿíÈþÿÿ®ÿÿÿ»þÿÿ•ÿÿÿáþÿÿ®ÿÿÿœÔþÿÿ•ÿÿÿœ ÿÿÿ¢ÿÿÿKÿÿÿ‰ÿÿÿKÈþÿÿ®ÿÿÿ»þÿÿ•ÿÿÿôþÿÿ¢ÿÿÿ>çþÿÿ‰ÿÿÿ>ÿÿÿ¢ÿÿÿKúþÿÿ‰ÿÿÿKÿÿÿœÿÿÿ ÿÿÿƒÿÿÿ úþÿÿ¢ÿÿÿ>íþÿÿ‰ÿÿÿ> ÿÿÿœÿÿÿÿÿÿƒÿÿÿ¯þÿÿ8 –þÿÿ KþÿÿW 2þÿÿ2 ¯þÿÿ8>–þÿÿ>KþÿÿW>2þÿÿ2>KþÿÿW 2þÿÿ2 çýÿÿv ÎýÿÿQ KþÿÿW>2þÿÿ2>çýÿÿv>ÎýÿÿQ>»ýÿÿp»ýÿÿK»ýÿÿd»ýÿÿjpáýÿÿpáýÿÿKáýÿÿdáýÿÿjpœþÿÿíÿÿÿ ©þÿÿÇÿÿÿ 8þÿÿÔÿÿÿ Eþÿÿ®ÿÿÿ œþÿÿíÿÿÿ>©þÿÿÇÿÿÿ>8þÿÿÔÿÿÿ>Eþÿÿ®ÿÿÿ>8þÿÿÔÿÿÿ Eþÿÿ®ÿÿÿ Ôýÿÿ»ÿÿÿ áýÿÿ•ÿÿÿ 8þÿÿÔÿÿÿ>Eþÿÿ®ÿÿÿ>Ôýÿÿ»ÿÿÿ>áýÿÿ•ÿÿÿ>»ýÿÿÁÿÿÿ»ýÿÿœÿÿÿ»ýÿÿ¢ÿÿÿv»ýÿÿ|ÿÿÿ]áýÿÿÁÿÿÿáýÿÿœÿÿÿáýÿÿ¢ÿÿÿváýÿÿ|ÿÿÿ]000000000000 0  + 0 + 0  0 0  0 0 + 0 0 + 0  + 0 0  0 0 0 0 0 0 0 0 0 0 0 00000 0000 0000 0! "0"#!0%$&0&'%0! $0$%!0#"&0&'#0" $0$&"0#!%0%'# 0)(* 0*+) 0-,. 0./- 0)(, 0,-) 0+*. 0./+ 0*(, 0,.* 0+)- 0-/+010202310546067501040451032606730204046203150573098:0:;90=<>0>?=098<0<=90;:>0>?;0:8<0<>:0;9=0=?; +0A@B +0BCA +0EDF +0FGE +0A@D +0DEA +0CBF +0FGC +0B@D +0DFB +0CAE +0EGC0IHJ0JKI0MLN0NOM0IHL0LMI0KJN0NOK0JHL0LNJ0KIM0MOK0QPR0RSQ0UTV0VWU0QPT0TUQ0SRV0VWS0RPT0TVR0SQU0UWS +0YXZ +0Z[Y +0]\^ +0^_] +0YX\ +0\]Y +0[Z^ +0^_[ +0ZX\ +0\^Z +0[Y] +0]_[0a`b0bca0edf0fge0a`d0dea0cbf0fgc0b`d0dfb0cae0egc0ihj0jki0mln0nom0ihl0lmi0kjn0nok0jhl0lnj0kim0mok \ No newline at end of file diff --git a/Demo/Games/ElephantWalk.CPP b/Demo/Games/ElephantWalk.CPP deleted file mode 100644 index ee160fb..0000000 Binary files a/Demo/Games/ElephantWalk.CPP and /dev/null differ diff --git a/Demo/Games/ElephantWalk.HC b/Demo/Games/ElephantWalk.HC new file mode 100644 index 0000000..fa5b857 Binary files /dev/null and b/Demo/Games/ElephantWalk.HC differ diff --git a/Demo/Games/FlapBat.CPP b/Demo/Games/FlapBat.HC similarity index 100% rename from Demo/Games/FlapBat.CPP rename to Demo/Games/FlapBat.HC diff --git a/Demo/Games/FlatTops.CPP b/Demo/Games/FlatTops.HC similarity index 100% rename from Demo/Games/FlatTops.CPP rename to Demo/Games/FlatTops.HC diff --git a/Demo/Games/Halogen.CPP b/Demo/Games/Halogen.HC similarity index 100% rename from Demo/Games/Halogen.CPP rename to Demo/Games/Halogen.HC diff --git a/Demo/Games/MassSpring.CPP b/Demo/Games/MassSpring.HC similarity index 100% rename from Demo/Games/MassSpring.CPP rename to Demo/Games/MassSpring.HC diff --git a/Demo/Games/Maze.CPP b/Demo/Games/Maze.HC similarity index 100% rename from Demo/Games/Maze.CPP rename to Demo/Games/Maze.HC diff --git a/Demo/Games/RainDrops.CPP b/Demo/Games/RainDrops.HC similarity index 100% rename from Demo/Games/RainDrops.CPP rename to Demo/Games/RainDrops.HC diff --git a/Demo/Games/RawHide.CPP b/Demo/Games/RawHide.CPP deleted file mode 100644 index 5237a86..0000000 --- a/Demo/Games/RawHide.CPP +++ /dev/null @@ -1,808 +0,0 @@ -//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$. - -RegSetDftEntry("TempleOS/RawHide","F64 best_score=9999;\n"); -RegExeBranch("TempleOS/RawHide"); - -F64 t0,tf; -I64 outside_cnt; - -#define MAP_WIDTH 1000 -#define MAP_HEIGHT 1000 -#define FENCE_WIDTH 320 -#define FENCE_HEIGHT 200 -#define MAP_BORDER 3 -CDC *map_dc; - -#define GATE_WIDTH 22 -#define GATE_HEIGHT 7 -F64 gate_é,gate_t; - -$BG,10$#define GE_COW 0 - - -$SP,"<1>",BI=1$ $SP,"<2>",BI=2$ $SP,"<3>",BI=3$ -#define GE_BULL 1 - - -$SP,"<4>",BI=4$ $SP,"<5>",BI=5$ $SP,"<6>",BI=6$ -#define GE_HORSE 2 - - -$SP,"<7>",BI=7$ $SP,"<8>",BI=8$ -#define GE_NUM 3 - - -$SP,"<9>",BI=9$ - - $SP,"<10>",BI=10$ - - - - - - - -$BG$ -#define ANIMAL_WIDTH 20 -#define ANIMAL_HEIGHT 16 - -U8 *cow_imgs[4] ={$IB,"<1>",BI=1$,$IB,"<2>",BI=2$,$IB,"<3>",BI=3$,$IB,"<2>",BI=2$}, - *bull_imgs[4] ={$IB,"<4>",BI=4$,$IB,"<5>",BI=5$,$IB,"<6>",BI=6$,$IB,"<5>",BI=5$}, - *horse_imgs[4]={$IB,"<7>",BI=7$,$IB,"<8>",BI=8$,$IB,"<7>",BI=7$,$IB,"<8>",BI=8$}; - -#define NUM_ANIMALS 100 - -class Animal -{ - I64 num,x,y,dx,dy; - U8 **imgs; - U32 buddy; - U8 type,frame0; - Bool dead,pad; -} *a; - -//************************************ -#define WATERFALL_HEIGHT (MAP_HEIGHT/20) -#define WATERFALL_DROPS 512 -#define WATERFALL_ACCELERATION 10 -I32 *r_x,*r_width,*wfd_x; -F64 *wfd_t0,waterfall_tf; -I64 waterfall_x,waterfall_y,waterfall_width; - -U0 RiverNew() -{ - r_x=MAlloc(MAP_HEIGHT*sizeof(I32)); - r_width=MAlloc(MAP_HEIGHT*sizeof(I32)); - wfd_x=MAlloc(WATERFALL_DROPS*sizeof(I32)); - wfd_t0=MAlloc(WATERFALL_DROPS*sizeof(F64)); - waterfall_tf=Sqrt(2*WATERFALL_HEIGHT/WATERFALL_ACCELERATION); -} - -U0 RiverMake() -{ - I64 i,x=2*MAP_WIDTH<<32/3,y,dx=0,w=15<<32; - waterfall_y=(MAP_HEIGHT-WATERFALL_HEIGHT)/2*Rand+ - (MAP_HEIGHT-WATERFALL_HEIGHT)/4; - for (y=MAP_BORDER;y",BI=10$); - - //Plot sand bar - x=0; - for (y=MAP_BORDER;ycolor=YELLOW; - map_dc->pen_width=r_width[y]+10; - GrPlot3(map_dc,r_x[y]+x.i32[1],y,0); - } - x=ClampI64(x+RandI32,-6*MAX_U32,6*MAX_U32); - } - - //Plot water - for (y=MAP_BORDER;ycolor=BLUE; - map_dc->pen_width=r_width[y]; - GrPlot3(map_dc,r_x[y],y,0); - } -} - -U0 RiverDel() -{ - Free(r_x); - Free(r_width); - Free(wfd_x); - Free(wfd_t0); -} - -//************************************ -class RiverDrop -{ - RiverDrop *next,*last; - I64 y,dx,dy; -} rd_head; -Bool rd_lock; - -U0 RiverDropsDel() -{ - while (LBts(&rd_lock,0)) - Yield; - QueDel(&rd_head,TRUE); - QueInit(&rd_head); - LBtr(&rd_lock,0); -} - -U0 RiverDropsNext(CTask *mem_task) -{ - RiverDrop *tempr,*tempr1; - while (LBts(&rd_lock,0)) - Yield; - tempr=rd_head.next; - while (tempr!=&rd_head) { - tempr1=tempr->next; - if (++tempr->y>=MAP_HEIGHT-MAP_BORDER) { - QueRem(tempr); - Free(tempr); - } else { - do { - if (RandU16&1 && GrPeek(map_dc,r_x[tempr->y]+tempr->dx, - tempr->y+tempr->dy)==BLUE) - break; - tempr->dx=ClampI64(tempr->dx+RandU16%3-1,-r_width[tempr->y]/2, - r_width[tempr->y]/2); - tempr->dy=ClampI64(tempr->dy+RandU16%3-1,-r_width[tempr->y]/2, - r_width[tempr->y]/2); - } while (GrPeek(map_dc,r_x[tempr->y]+tempr->dx, - tempr->y+tempr->dy)!=BLUE && - GrPeek(map_dc,r_x[tempr->y],tempr->y)==BLUE);//Might be reiniting - } - tempr=tempr1; - } - tempr=MAlloc(sizeof(RiverDrop),mem_task); - tempr->y=MAP_BORDER; - tempr->dx=0; - tempr->dy=0; - QueIns(tempr,rd_head.last); - LBtr(&rd_lock,0); -} - -U0 RiverDropsDraw(CDC *dc,I64 cx,I64 cy) -{ - I64 i; - F64 t=tS; - RiverDrop *tempr; - while (LBts(&rd_lock,0)) - Yield; - tempr=rd_head.next; - dc->color=LTBLUE; - while (tempr!=&rd_head) { - GrPlot(dc,r_x[tempr->y]+tempr->dx-cx,tempr->y+tempr->dy-cy); - tempr=tempr->next; - } - LBtr(&rd_lock,0); - - dc->color=WHITE; - for (i=0;ipix_width)/2, - cy=(MAP_HEIGHT-task->pix_height)/2; - if (task->scroll_x+cx<0) - task->scroll_x=-cx; - if (task->scroll_x+cx>MAP_WIDTH-task->pix_width) - task->scroll_x=MAP_WIDTH-task->pix_width-cx; - if (task->scroll_y+cy<0) - task->scroll_y=-cy; - if (task->scroll_y+cy>MAP_HEIGHT-task->pix_height) - task->scroll_y=MAP_HEIGHT-task->pix_height-cy; - - map_dc->flags|=DCF_NO_TRANSPARENTS; - GrBlot(dc,-cx,-cy,map_dc); - - RiverDropsDraw(dc,cx,cy); - - for (i=0;iflags|=DCF_JUST_MIRROR|DCF_SYMMETRY; - DCSymmetrySet(dc,a[i].x.i32[1]-cx,0,a[i].x.i32[1]-cx,1); - } - Sprite3(dc,a[i].x.i32[1]-cx,a[i].y.i32[1]-cy,0, - a[i].imgs[(frame+a[i].frame0)&3]); - dc->flags&=~(DCF_JUST_MIRROR|DCF_SYMMETRY); - } - - if (ip.pos.x-last_pos_x>0) - left=FALSE; - else if (ip.pos.x-last_pos_x<0) - left=TRUE; - if (left) { - dc->flags|=DCF_JUST_MIRROR|DCF_SYMMETRY; - DCSymmetrySet(dc,ip.pos.x-task->pix_left-task->scroll_x,0, - ip.pos.x-task->pix_left-task->scroll_x,1); - } - Sprite3(dc,ip.pos.x-task->pix_left-task->scroll_x, - ip.pos.y-task->pix_top -task->scroll_y,0,horse_imgs[frame&3]); - dc->flags&=~(DCF_JUST_MIRROR|DCF_SYMMETRY); - last_pos_x=ip.pos.x; - - if (tf) { - dc->color=RED; - t=tf-t0; - if (Blink) - GrPrint(dc,(task->pix_width-FONT_WIDTH*14)>>1-task->scroll_x, - (task->pix_height-FONT_HEIGHT)>>1-task->scroll_y, - "Game Completed"); - } else { - dc->color=BLACK; - t=tS-t0; - } - GrPrint(dc,-task->scroll_x,-task->scroll_y, - "Outside:%03d Time:%7.2fs Best:%7.2fs", - outside_cnt,t,best_score); -} - -U0 BuddySel(I64 i) -{ - I64 b,best_b=i,score,best_score=MAX_I64; - for (b=0;b5.0) - gate_é=Clamp(gate_é-0.02,0,ã/2); - - dx=GATE_WIDTH*Cos(gate_é); dy=-0.8*GATE_WIDTH*Sin(gate_é); - - map_dc->color=LTGREEN; - GrRect(map_dc,x1,y1-0.8*GATE_WIDTH-GATE_HEIGHT, - 46,0.8*GATE_WIDTH+GATE_HEIGHT+3); - - map_dc->color=BLACK; - - GrLine(map_dc,x1,y1,x1+dx,y1+dy); - GrLine(map_dc,x1,y1,x1,y1-GATE_HEIGHT); - GrLine(map_dc,x1+dx,y1+dy,x1+dx,y1+dy-GATE_HEIGHT); - GrLine(map_dc,x1,y1-GATE_HEIGHT,x1+dx,y1+dy-GATE_HEIGHT); - GrLine(map_dc,x1,y1,x1+dx,y1+dy-GATE_HEIGHT); - GrLine(map_dc,x1,y1-GATE_HEIGHT,x1+dx,y1+dy); - - GrLine(map_dc,x1+45,y1,x1+45-dx,y1+dy); - GrLine(map_dc,x1+45,y1,x1+45,y1-GATE_HEIGHT); - GrLine(map_dc,x1+45-dx,y1+dy,x1+45-dx,y1+dy-GATE_HEIGHT); - GrLine(map_dc,x1+45,y1-GATE_HEIGHT,x1+45-dx,y1+dy-GATE_HEIGHT); - GrLine(map_dc,x1+45,y1,x1+45-dx,y1+dy-GATE_HEIGHT); - GrLine(map_dc,x1+45,y1-GATE_HEIGHT,x1+45-dx,y1+dy); -} - -Bool CheckMap(I64 x,I64 y) -{ - I64 i,j,c; - if (SqrI64(x-(waterfall_x+waterfall_width/2))>>1+ - SqrI64(y-(waterfall_y+WATERFALL_HEIGHT/2))<2500) - return FALSE; - for (j=-4;j<=2;j++) - for (i=-4;i<=4;i++) { - c=GrPeek(map_dc,x+i,y+j); - if (c==LTGRAY || c==BLACK) - return FALSE; - } - return TRUE; -} - -U0 AnimateTask(CTask *parent) -{ - I64 i,cx,cy,cursor_x,cursor_y,dd,ddx,ddy,cnt,max_speed=MAX_I64,updates=0, - my_outside_cnt; - F64 f,d,dx,dy,s,stress; - Animal *tempa,*tempa1; - while (TRUE) { - max_speed=ClampU64(max_speed,MAX_U32/3,200*MAX_U32); - cx=(MAP_WIDTH -parent->pix_width)/2, - cy=(MAP_HEIGHT-parent->pix_height)/2; - cursor_x=ip.pos.x+cx-parent->pix_left-parent->scroll_x; - cursor_y=ip.pos.y+cy-parent->pix_top -parent->scroll_y; - cnt=0;stress=0; - my_outside_cnt=0; - if (cursor_xdead) { -//Move away from horse - ddx=tempa->x.i32[1]-cursor_x; - ddy=tempa->y.i32[1]-cursor_y; - if (dd=SqrI64(ddx)+SqrI64(ddy)) { - d=Sqrt(dd); - dx=ddx/d; - dy=ddy/d; - f=5.0e2*MAX_U32/dd; - tempa->dx+=f*dx; - tempa->dy+=f*dy; - } - - //Resel buddy about every NUM_ANIMALS*10ms=5.12 seconds - tempa1=&a[tempa->buddy]; - if (tempa1->dead || i==updates%NUM_ANIMALS) { - BuddySel(i); - tempa1=&a[tempa->buddy]; - } - - //Move toward buddy - ddx=tempa->x.i32[1]-tempa1->x.i32[1]; - ddy=tempa->y.i32[1]-tempa1->y.i32[1]; - if (dd=SqrI64(ddx)+SqrI64(ddy)) { - d=Sqrt(dd); - s=d`1.25-80; - stress+=Abs(s); - dx=ddx/d; - dy=ddy/d; - f=-0.001*s*MAX_U32; - tempa->dx+=f*dx; - tempa->dy+=f*dy; - } - - //Make velocity similar to buddy - tempa->dx+=0.1*(tempa1->dx-tempa->dx); - tempa->dy+=0.1*(tempa1->dy-tempa->dy); - - //Add random movement, limit speed and dampen speed - tempa->dx=0.995*ClampI64(tempa->dx+RandI32/32,-max_speed,max_speed); - tempa->dy=0.995*ClampI64(tempa->dy+RandI32/32,-max_speed,max_speed); - - //Slow in river - if (GrPeek(map_dc,tempa->x.i32[1],tempa->y.i32[1])!=LTGREEN) { - tempa->dx/=2; - tempa->dy/=2; - } - - if (CheckMap((tempa->x+tempa->dx)>>32,(tempa->y+tempa->dy)>>32)) { - tempa->x+=tempa->dx; - tempa->y+=tempa->dy; - } - - //Keep on map - if (!(MAP_BORDER+ANIMAL_WIDTH/2 - <=tempa->x.i32[1]x -=tempa->dx; - tempa->dx=-tempa->dx; - } - if (!(MAP_BORDER+ANIMAL_HEIGHT - <=tempa->y.i32[1]y -=tempa->dy; - tempa->dy=-tempa->dy; - } - cnt++; - if (tempa->x>>32>=FENCE_WIDTH || tempa->y>>32>=FENCE_HEIGHT) - my_outside_cnt++; - } - } - outside_cnt=my_outside_cnt; - - if (!(updates&15)) - RiverDropsNext(parent); - - if (!tf && !outside_cnt) { - tf=tS; - music.mute=TRUE; - Snd(2000);Sleep(200);Snd(0);Sleep(100); - if (tf-t0100.0) { - Yield; - max_speed=stress/5.0*MAX_U32; //Converge faster at start-up - } else { - Sleep(10); - max_speed=0; //Will be set to normal max speed - } - } -} - -U0 SongTask(I64) -{//Randomly generated (by God :-) - Fs->task_end_cb=&SndTaskEndCB; - MusicSettingsRst; - while (TRUE) { - Play("3qC2etG3DCBDCECFqFCsADADqB"); - Play("C2etG3DCBDCECFqFCsADADqB"); - Play("2sG3A2G3AqG2etG3GDeBBqBFeBAqE"); - Play("2sG3A2G3AqG2etG3GDeBBqBFeBAqE"); - } -} - -U0 ReInit() -{ - I64 i; - - RiverDropsDel; - map_dc->color=LTGREEN; - GrRect(map_dc,2,2,MAP_WIDTH-4,MAP_HEIGHT-4); - - RiverMake; - - //Plot fence - for (i=FENCE_WIDTH;i>0;i-=16) - Sprite3(map_dc,i,FENCE_HEIGHT,0,$IB,"<9>",BI=9$); - map_dc->pen_width=1; - map_dc->color=BROWN; - for (i=0;icolor=LTGRAY; - GrLine(map_dc,FENCE_WIDTH,0,FENCE_WIDTH,FENCE_HEIGHT-6); - RedrawGate; - - map_dc->pen_width=MAP_BORDER; - map_dc->color=RED; - GrBorder(map_dc,MAP_BORDER/2,MAP_BORDER/2, - MAP_WIDTH-(MAP_BORDER+1)/2,MAP_HEIGHT-(MAP_BORDER+1)/2); - - for (i=MAP_BORDER;i<=MAP_HEIGHT-MAP_BORDER;i++) - RiverDropsNext(Fs); - - MemSet(a,0,NUM_ANIMALS*sizeof(Animal)); - for (i=0;i>32,a[i].y>>32)); - if (i&1) - a[i].imgs=cow_imgs; - else - a[i].imgs=bull_imgs; - a[i].frame0=RandU16&3; - BuddySel(i); - } - outside_cnt=NUM_ANIMALS; - gate_t=0; - gate_é=0; - t0=tS; - tf=0; -} - -U0 Init() -{ - RiverNew; - rd_lock=0; - QueInit(&rd_head); - map_dc=DCNew(MAP_WIDTH,MAP_HEIGHT); - a=MAlloc(NUM_ANIMALS*sizeof(Animal)); - ReInit; -} - -U0 CleanUp() -{ - DCDel(map_dc); - Free(a); - RiverDropsDel; - RiverDel; -} - -U0 RawHide() -{ - I64 msg_code,a1,a2; - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - MenuPush( - "File {" - " Abort(,CH_SHIFT_ESC);" - " Exit(,CH_ESC);" - "}" - "Play {" - " Restart(,'\n');" - "}" - ); - Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs); - - PopUpOk( - "Coral the cattle. The coral is in the\n" - "upper-left corner if you scroll.\n\n" - "Keep holding the $$GREEN$$$$FG$$ key and\n" - "scroll with $$GREEN$${CTRL-Left Grab}$$FG$$."); - - Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS - -WIF_SELF_BORDER-WIF_SELF_GRAB_SCROLL-WIF_FOCUS_TASK_MENU; - AutoComplete; - WinBorder; - WinMax; - DocCursor; - DocClear; - Init; - Fs->animate_task=Spawn(&AnimateTask,Fs,"Animate",,Fs); - Fs->draw_it=&DrawIt; - try { - while (TRUE) { - msg_code=GetMsg(&a1,&a2, - 1<",BI=1$ $SP,"<2>",BI=2$ $SP,"<3>",BI=3$ +#define GE_BULL 1 + + +$SP,"<4>",BI=4$ $SP,"<5>",BI=5$ $SP,"<6>",BI=6$ +#define GE_HORSE 2 + + +$SP,"<7>",BI=7$ $SP,"<8>",BI=8$ +#define GE_NUM 3 + + +$SP,"<9>",BI=9$ + + $SP,"<10>",BI=10$ + + + + + + + +$BG$ +#define ANIMAL_WIDTH 20 +#define ANIMAL_HEIGHT 16 + +U8 *cow_imgs[4] ={$IB,"<1>",BI=1$,$IB,"<2>",BI=2$,$IB,"<3>",BI=3$,$IB,"<2>",BI=2$}, + *bull_imgs[4] ={$IB,"<4>",BI=4$,$IB,"<5>",BI=5$,$IB,"<6>",BI=6$,$IB,"<5>",BI=5$}, + *horse_imgs[4]={$IB,"<7>",BI=7$,$IB,"<8>",BI=8$,$IB,"<7>",BI=7$,$IB,"<8>",BI=8$}; + +#define NUM_ANIMALS 100 + +class Animal +{ + I64 num,x,y,dx,dy; + U8 **imgs; + U32 buddy; + U8 type,frame0; + Bool dead,pad; +} *a; + +//************************************ +#define WATERFALL_HEIGHT (MAP_HEIGHT/20) +#define WATERFALL_DROPS 512 +#define WATERFALL_ACCELERATION 10 +I32 *r_x,*r_width,*wfd_x; +F64 *wfd_t0,waterfall_tf; +I64 waterfall_x,waterfall_y,waterfall_width; + +U0 RiverNew() +{ + r_x=MAlloc(MAP_HEIGHT*sizeof(I32)); + r_width=MAlloc(MAP_HEIGHT*sizeof(I32)); + wfd_x=MAlloc(WATERFALL_DROPS*sizeof(I32)); + wfd_t0=MAlloc(WATERFALL_DROPS*sizeof(F64)); + waterfall_tf=Sqrt(2*WATERFALL_HEIGHT/WATERFALL_ACCELERATION); +} + +U0 RiverMake() +{ + I64 i,x=2*MAP_WIDTH<<32/3,y,dx=0,w=15<<32; + waterfall_y=(MAP_HEIGHT-WATERFALL_HEIGHT)/2*Rand+ + (MAP_HEIGHT-WATERFALL_HEIGHT)/4; + for (y=MAP_BORDER;y",BI=10$); + + //Plot sand bar + x=0; + for (y=MAP_BORDER;ycolor=YELLOW; + map_dc->pen_width=r_width[y]+10; + GrPlot3(map_dc,r_x[y]+x.i32[1],y,0); + } + x=ClampI64(x+RandI32,-6*MAX_U32,6*MAX_U32); + } + + //Plot water + for (y=MAP_BORDER;ycolor=BLUE; + map_dc->pen_width=r_width[y]; + GrPlot3(map_dc,r_x[y],y,0); + } +} + +U0 RiverDel() +{ + Free(r_x); + Free(r_width); + Free(wfd_x); + Free(wfd_t0); +} + +//************************************ +class RiverDrop +{ + RiverDrop *next,*last; + I64 y,dx,dy; +} rd_head; +Bool rd_lock; + +U0 RiverDropsDel() +{ + while (LBts(&rd_lock,0)) + Yield; + QueDel(&rd_head,TRUE); + QueInit(&rd_head); + LBtr(&rd_lock,0); +} + +U0 RiverDropsNext(CTask *mem_task) +{ + RiverDrop *tempr,*tempr1; + while (LBts(&rd_lock,0)) + Yield; + tempr=rd_head.next; + while (tempr!=&rd_head) { + tempr1=tempr->next; + if (++tempr->y>=MAP_HEIGHT-MAP_BORDER) { + QueRem(tempr); + Free(tempr); + } else { + do { + if (RandU16&1 && GrPeek(map_dc,r_x[tempr->y]+tempr->dx, + tempr->y+tempr->dy)==BLUE) + break; + tempr->dx=ClampI64(tempr->dx+RandU16%3-1,-r_width[tempr->y]/2, + r_width[tempr->y]/2); + tempr->dy=ClampI64(tempr->dy+RandU16%3-1,-r_width[tempr->y]/2, + r_width[tempr->y]/2); + } while (GrPeek(map_dc,r_x[tempr->y]+tempr->dx, + tempr->y+tempr->dy)!=BLUE && + GrPeek(map_dc,r_x[tempr->y],tempr->y)==BLUE);//Might be reiniting + } + tempr=tempr1; + } + tempr=MAlloc(sizeof(RiverDrop),mem_task); + tempr->y=MAP_BORDER; + tempr->dx=0; + tempr->dy=0; + QueIns(tempr,rd_head.last); + LBtr(&rd_lock,0); +} + +U0 RiverDropsDraw(CDC *dc,I64 cx,I64 cy) +{ + I64 i; + F64 t=tS; + RiverDrop *tempr; + while (LBts(&rd_lock,0)) + Yield; + tempr=rd_head.next; + dc->color=LTBLUE; + while (tempr!=&rd_head) { + GrPlot(dc,r_x[tempr->y]+tempr->dx-cx,tempr->y+tempr->dy-cy); + tempr=tempr->next; + } + LBtr(&rd_lock,0); + + dc->color=WHITE; + for (i=0;ipix_width)/2, + cy=(MAP_HEIGHT-task->pix_height)/2; + if (task->scroll_x+cx<0) + task->scroll_x=-cx; + if (task->scroll_x+cx>MAP_WIDTH-task->pix_width) + task->scroll_x=MAP_WIDTH-task->pix_width-cx; + if (task->scroll_y+cy<0) + task->scroll_y=-cy; + if (task->scroll_y+cy>MAP_HEIGHT-task->pix_height) + task->scroll_y=MAP_HEIGHT-task->pix_height-cy; + + map_dc->flags|=DCF_NO_TRANSPARENTS; + GrBlot(dc,-cx,-cy,map_dc); + + RiverDropsDraw(dc,cx,cy); + + for (i=0;iflags|=DCF_JUST_MIRROR|DCF_SYMMETRY; + DCSymmetrySet(dc,a[i].x.i32[1]-cx,0,a[i].x.i32[1]-cx,1); + } + Sprite3(dc,a[i].x.i32[1]-cx,a[i].y.i32[1]-cy,0, + a[i].imgs[(frame+a[i].frame0)&3]); + dc->flags&=~(DCF_JUST_MIRROR|DCF_SYMMETRY); + } + + if (ip.pos.x-last_pos_x>0) + left=FALSE; + else if (ip.pos.x-last_pos_x<0) + left=TRUE; + if (left) { + dc->flags|=DCF_JUST_MIRROR|DCF_SYMMETRY; + DCSymmetrySet(dc,ip.pos.x-task->pix_left-task->scroll_x,0, + ip.pos.x-task->pix_left-task->scroll_x,1); + } + Sprite3(dc,ip.pos.x-task->pix_left-task->scroll_x, + ip.pos.y-task->pix_top -task->scroll_y,0,horse_imgs[frame&3]); + dc->flags&=~(DCF_JUST_MIRROR|DCF_SYMMETRY); + last_pos_x=ip.pos.x; + + if (tf) { + dc->color=RED; + t=tf-t0; + if (Blink) + GrPrint(dc,(task->pix_width-FONT_WIDTH*14)>>1-task->scroll_x, + (task->pix_height-FONT_HEIGHT)>>1-task->scroll_y, + "Game Completed"); + } else { + dc->color=BLACK; + t=tS-t0; + } + GrPrint(dc,-task->scroll_x,-task->scroll_y, + "Outside:%03d Time:%7.2fs Best:%7.2fs", + outside_cnt,t,best_score); +} + +U0 BuddySel(I64 i) +{ + I64 b,best_b=i,score,best_score=MAX_I64; + for (b=0;b5.0) + gate_é=Clamp(gate_é-0.02,0,ã/2); + + dx=GATE_WIDTH*Cos(gate_é); dy=-0.8*GATE_WIDTH*Sin(gate_é); + + map_dc->color=LTGREEN; + GrRect(map_dc,x1,y1-0.8*GATE_WIDTH-GATE_HEIGHT, + 46,0.8*GATE_WIDTH+GATE_HEIGHT+3); + + map_dc->color=BLACK; + + GrLine(map_dc,x1,y1,x1+dx,y1+dy); + GrLine(map_dc,x1,y1,x1,y1-GATE_HEIGHT); + GrLine(map_dc,x1+dx,y1+dy,x1+dx,y1+dy-GATE_HEIGHT); + GrLine(map_dc,x1,y1-GATE_HEIGHT,x1+dx,y1+dy-GATE_HEIGHT); + GrLine(map_dc,x1,y1,x1+dx,y1+dy-GATE_HEIGHT); + GrLine(map_dc,x1,y1-GATE_HEIGHT,x1+dx,y1+dy); + + GrLine(map_dc,x1+45,y1,x1+45-dx,y1+dy); + GrLine(map_dc,x1+45,y1,x1+45,y1-GATE_HEIGHT); + GrLine(map_dc,x1+45-dx,y1+dy,x1+45-dx,y1+dy-GATE_HEIGHT); + GrLine(map_dc,x1+45,y1-GATE_HEIGHT,x1+45-dx,y1+dy-GATE_HEIGHT); + GrLine(map_dc,x1+45,y1,x1+45-dx,y1+dy-GATE_HEIGHT); + GrLine(map_dc,x1+45,y1-GATE_HEIGHT,x1+45-dx,y1+dy); +} + +Bool CheckMap(I64 x,I64 y) +{ + I64 i,j,c; + if (SqrI64(x-(waterfall_x+waterfall_width/2))>>1+ + SqrI64(y-(waterfall_y+WATERFALL_HEIGHT/2))<2500) + return FALSE; + for (j=-4;j<=2;j++) + for (i=-4;i<=4;i++) { + c=GrPeek(map_dc,x+i,y+j); + if (c==LTGRAY || c==BLACK) + return FALSE; + } + return TRUE; +} + +U0 AnimateTask(CTask *parent) +{ + I64 i,cx,cy,cursor_x,cursor_y,dd,ddx,ddy,cnt,max_speed=MAX_I64,updates=0, + my_outside_cnt; + F64 f,d,dx,dy,s,stress; + Animal *tempa,*tempa1; + while (TRUE) { + max_speed=ClampU64(max_speed,MAX_U32/3,200*MAX_U32); + cx=(MAP_WIDTH -parent->pix_width)/2, + cy=(MAP_HEIGHT-parent->pix_height)/2; + cursor_x=ip.pos.x+cx-parent->pix_left-parent->scroll_x; + cursor_y=ip.pos.y+cy-parent->pix_top -parent->scroll_y; + cnt=0;stress=0; + my_outside_cnt=0; + if (cursor_xdead) { +//Move away from horse + ddx=tempa->x.i32[1]-cursor_x; + ddy=tempa->y.i32[1]-cursor_y; + if (dd=SqrI64(ddx)+SqrI64(ddy)) { + d=Sqrt(dd); + dx=ddx/d; + dy=ddy/d; + f=5.0e2*MAX_U32/dd; + tempa->dx+=f*dx; + tempa->dy+=f*dy; + } + + //Resel buddy about every NUM_ANIMALS*10ms=5.12 seconds + tempa1=&a[tempa->buddy]; + if (tempa1->dead || i==updates%NUM_ANIMALS) { + BuddySel(i); + tempa1=&a[tempa->buddy]; + } + + //Move toward buddy + ddx=tempa->x.i32[1]-tempa1->x.i32[1]; + ddy=tempa->y.i32[1]-tempa1->y.i32[1]; + if (dd=SqrI64(ddx)+SqrI64(ddy)) { + d=Sqrt(dd); + s=d`1.25-80; + stress+=Abs(s); + dx=ddx/d; + dy=ddy/d; + f=-0.001*s*MAX_U32; + tempa->dx+=f*dx; + tempa->dy+=f*dy; + } + + //Make velocity similar to buddy + tempa->dx+=0.1*(tempa1->dx-tempa->dx); + tempa->dy+=0.1*(tempa1->dy-tempa->dy); + + //Add random movement, limit speed and dampen speed + tempa->dx=0.995*ClampI64(tempa->dx+RandI32/32,-max_speed,max_speed); + tempa->dy=0.995*ClampI64(tempa->dy+RandI32/32,-max_speed,max_speed); + + //Slow in river + if (GrPeek(map_dc,tempa->x.i32[1],tempa->y.i32[1])!=LTGREEN) { + tempa->dx/=2; + tempa->dy/=2; + } + + if (CheckMap((tempa->x+tempa->dx)>>32,(tempa->y+tempa->dy)>>32)) { + tempa->x+=tempa->dx; + tempa->y+=tempa->dy; + } + + //Keep on map + if (!(MAP_BORDER+ANIMAL_WIDTH/2 + <=tempa->x.i32[1]x -=tempa->dx; + tempa->dx=-tempa->dx; + } + if (!(MAP_BORDER+ANIMAL_HEIGHT + <=tempa->y.i32[1]y -=tempa->dy; + tempa->dy=-tempa->dy; + } + cnt++; + if (tempa->x>>32>=FENCE_WIDTH || tempa->y>>32>=FENCE_HEIGHT) + my_outside_cnt++; + } + } + outside_cnt=my_outside_cnt; + + if (!(updates&15)) + RiverDropsNext(parent); + + if (!tf && !outside_cnt) { + tf=tS; + music.mute=TRUE; + Snd(2000);Sleep(200);Snd(0);Sleep(100); + if (tf-t0100.0) { + Yield; + max_speed=stress/5.0*MAX_U32; //Converge faster at start-up + } else { + Sleep(10); + max_speed=0; //Will be set to normal max speed + } + } +} + +U0 SongTask(I64) +{//Randomly generated (by God :-) + Fs->task_end_cb=&SndTaskEndCB; + MusicSettingsRst; + while (TRUE) { + Play("3qC2etG3DCBDCECFqFCsADADqB"); + Play("C2etG3DCBDCECFqFCsADADqB"); + Play("2sG3A2G3AqG2etG3GDeBBqBFeBAqE"); + Play("2sG3A2G3AqG2etG3GDeBBqBFeBAqE"); + } +} + +U0 ReInit() +{ + I64 i; + + RiverDropsDel; + map_dc->color=LTGREEN; + GrRect(map_dc,2,2,MAP_WIDTH-4,MAP_HEIGHT-4); + + RiverMake; + + //Plot fence + for (i=FENCE_WIDTH;i>0;i-=16) + Sprite3(map_dc,i,FENCE_HEIGHT,0,$IB,"<9>",BI=9$); + map_dc->pen_width=1; + map_dc->color=BROWN; + for (i=0;icolor=LTGRAY; + GrLine(map_dc,FENCE_WIDTH,0,FENCE_WIDTH,FENCE_HEIGHT-6); + RedrawGate; + + map_dc->pen_width=MAP_BORDER; + map_dc->color=RED; + GrBorder(map_dc,MAP_BORDER/2,MAP_BORDER/2, + MAP_WIDTH-(MAP_BORDER+1)/2,MAP_HEIGHT-(MAP_BORDER+1)/2); + + for (i=MAP_BORDER;i<=MAP_HEIGHT-MAP_BORDER;i++) + RiverDropsNext(Fs); + + MemSet(a,0,NUM_ANIMALS*sizeof(Animal)); + for (i=0;i>32,a[i].y>>32)); + if (i&1) + a[i].imgs=cow_imgs; + else + a[i].imgs=bull_imgs; + a[i].frame0=RandU16&3; + BuddySel(i); + } + outside_cnt=NUM_ANIMALS; + gate_t=0; + gate_é=0; + t0=tS; + tf=0; +} + +U0 Init() +{ + RiverNew; + rd_lock=0; + QueInit(&rd_head); + map_dc=DCNew(MAP_WIDTH,MAP_HEIGHT); + a=MAlloc(NUM_ANIMALS*sizeof(Animal)); + ReInit; +} + +U0 CleanUp() +{ + DCDel(map_dc); + Free(a); + RiverDropsDel; + RiverDel; +} + +U0 RawHide() +{ + I64 msg_code,a1,a2; + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + MenuPush( + "File {" + " Abort(,CH_SHIFT_ESC);" + " Exit(,CH_ESC);" + "}" + "Play {" + " Restart(,'\n');" + "}" + ); + Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs); + + PopUpOk( + "Coral the cattle. The coral is in the\n" + "upper-left corner if you scroll.\n\n" + "Keep holding the $$GREEN$$$$FG$$ key and\n" + "scroll with $$GREEN$${CTRL-Left Grab}$$FG$$."); + + Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS + -WIF_SELF_BORDER-WIF_SELF_GRAB_SCROLL-WIF_FOCUS_TASK_MENU; + AutoComplete; + WinBorder; + WinMax; + DocCursor; + DocClear; + Init; + Fs->animate_task=Spawn(&AnimateTask,Fs,"Animate",,Fs); + Fs->draw_it=&DrawIt; + try { + while (TRUE) { + msg_code=GetMsg(&a1,&a2, + 1< - do { - for (i=0;i<16;i++) { - dc->color=i; - GrPlot(dc,x[i].i32[1],y[i].i32[1]); - x[i]+=dx[i]; - y[i]+=dy[i]; - if (!(0<=x[i]pix_width<<32)) { - x[i]-=dx[i]; - dx[i]=-dx[i]; - } - if (!(0<=y[i]pix_height<<32)) { - y[i]-=dy[i]; - dy[i]=-dy[i]; - } - } - Yield; - } while (!(ch=ScanChar) || (ch!=CH_SHIFT_ESC && ch!=CH_ESC)); - } catch - PutExcept; - DCFill(dc); - DCDel(dc); -} - -Bounce; diff --git a/Demo/Graphics/Bounce.HC b/Demo/Graphics/Bounce.HC new file mode 100644 index 0000000..a2af552 --- /dev/null +++ b/Demo/Graphics/Bounce.HC @@ -0,0 +1,47 @@ +//Uses $LK,"fixed-point-arithmetic",A="FI:::/Demo/Lectures/FixedPoint.HC"$. + +I64 x[16],y[16],dx[16],dy[16]; + +U0 Init() +{ + I64 i; + F64 é; + MemSet(x,0,sizeof(x)); + MemSet(y,0,sizeof(y)); + for (i=0;i<16;i++) { + é=Rand*2*ã; + dx[i]=MAX_I32*Cos(é); + dy[i]=MAX_I32*Sin(é); + } +} + +U0 Bounce() +{ + CDC *dc=DCAlias; + I64 i,ch; + Init; + try {//Catch + do { + for (i=0;i<16;i++) { + dc->color=i; + GrPlot(dc,x[i].i32[1],y[i].i32[1]); + x[i]+=dx[i]; + y[i]+=dy[i]; + if (!(0<=x[i]pix_width<<32)) { + x[i]-=dx[i]; + dx[i]=-dx[i]; + } + if (!(0<=y[i]pix_height<<32)) { + y[i]-=dy[i]; + dy[i]=-dy[i]; + } + } + Yield; + } while (!(ch=ScanChar) || (ch!=CH_SHIFT_ESC && ch!=CH_ESC)); + } catch + PutExcept; + DCFill(dc); + DCDel(dc); +} + +Bounce; diff --git a/Demo/Graphics/Box.CPP b/Demo/Graphics/Box.HC similarity index 100% rename from Demo/Graphics/Box.CPP rename to Demo/Graphics/Box.HC diff --git a/Demo/Graphics/Camp.CPP b/Demo/Graphics/Camp.CPP deleted file mode 100644 index 8992838..0000000 Binary files a/Demo/Graphics/Camp.CPP and /dev/null differ diff --git a/Demo/Graphics/Camp.HC b/Demo/Graphics/Camp.HC new file mode 100644 index 0000000..dd76601 Binary files /dev/null and b/Demo/Graphics/Camp.HC differ diff --git a/Demo/Graphics/Cartesian.CPP b/Demo/Graphics/Cartesian.CPP deleted file mode 100644 index 1ebf2af..0000000 --- a/Demo/Graphics/Cartesian.CPP +++ /dev/null @@ -1,48 +0,0 @@ -//x must be global. -//Might as well make y global. - -F64 x,y,y_last; - -U0 Cartesian() -{ - U8 *st; - I64 ch=0,h,v; - Bool first; - CDC *dc=DCAlias; - do { - DocClear; - "Enter algebraic equation to graph.\n" - "Example: y=2*x\n" - "y="; - if (st=GetStr) { - if (*st) { - h=Fs->pix_width/2; - v=Fs->pix_height/2; - dc->color=RED; - GrLine(dc,h,0,h,2*v+1); - GrLine(dc,0,v,2*h+1,v); - first=TRUE; - dc->color=BLACK; - for (x=-h;x<=h;x++) { - y=-ExePrint("ToF64(%s);",st)(F64); - if (!first) - GrLine(dc,x-1+h,y_last+v,x+h,y+v); - y_last=y; - first=FALSE; - } - ch=GetChar; - } else - ch=CH_SHIFT_ESC; - Free(st); - } else - ch=CH_SHIFT_ESC; - DCFill; - } while (ch!=CH_SHIFT_ESC && ch!=CH_ESC); - DCDel(dc); -} - -Cartesian; - -//For better performance, compile the expression entered by the -//user one time with $LK,"LexExpression2Bin",A="MN:LexExpression2Bin"$() and use $LK,"Call",A="MN:Call"$(). -//See $LK,"::/Demo/CompileDemo.CPP"$. diff --git a/Demo/Graphics/Cartesian.HC b/Demo/Graphics/Cartesian.HC new file mode 100644 index 0000000..251eeeb --- /dev/null +++ b/Demo/Graphics/Cartesian.HC @@ -0,0 +1,48 @@ +//x must be global. +//Might as well make y global. + +F64 x,y,y_last; + +U0 Cartesian() +{ + U8 *st; + I64 ch=0,h,v; + Bool first; + CDC *dc=DCAlias; + do { + DocClear; + "Enter algebraic equation to graph.\n" + "Example: y=2*x\n" + "y="; + if (st=GetStr) { + if (*st) { + h=Fs->pix_width/2; + v=Fs->pix_height/2; + dc->color=RED; + GrLine(dc,h,0,h,2*v+1); + GrLine(dc,0,v,2*h+1,v); + first=TRUE; + dc->color=BLACK; + for (x=-h;x<=h;x++) { + y=-ExePrint("ToF64(%s);",st)(F64); + if (!first) + GrLine(dc,x-1+h,y_last+v,x+h,y+v); + y_last=y; + first=FALSE; + } + ch=GetChar; + } else + ch=CH_SHIFT_ESC; + Free(st); + } else + ch=CH_SHIFT_ESC; + DCFill; + } while (ch!=CH_SHIFT_ESC && ch!=CH_ESC); + DCDel(dc); +} + +Cartesian; + +//For better performance, compile the expression entered by the +//user one time with $LK,"LexExpression2Bin",A="MN:LexExpression2Bin"$() and use $LK,"Call",A="MN:Call"$(). +//See $LK,"::/Demo/CompileDemo.HC"$. diff --git a/Demo/Graphics/CharAnimation.CPP b/Demo/Graphics/CharAnimation.CPP deleted file mode 100644 index 8163d51..0000000 --- a/Demo/Graphics/CharAnimation.CPP +++ /dev/null @@ -1,30 +0,0 @@ -U8 *old_font=text.font; - -// See $LK,"::/Kernel/FontStd.CPP"$, $LK,"::/Demo/ScreenCodes.CPP"$, -//$LK,"::/Demo/ExtendedChars.CPP"$, and $LK,"::/Demo/Graphics/FontEd.CPP"$. - -U64 waves[4]={ -0x0011AA440011AA44,0x0022558800225588, -0x0044AA110044AA11,0x0088552200885522}; - -U0 AnimateEndCB() -{ - text.font=old_font; - Exit; -} - -U0 AnimateTask(I64) -{ - I64 i; - U64 *font=MAlloc(256*8); - Fs->task_end_cb=&AnimateEndCB; - MemCpy(font,text.font,256*8); - text.font=font; - while (TRUE) { - font[CH_SPACE]=waves[i++&0x3]; - Sleep(100); - } -} - -Spawn(&AnimateTask,NULL,"Animate",,Fs); -TaskRep; diff --git a/Demo/Graphics/CharAnimation.HC b/Demo/Graphics/CharAnimation.HC new file mode 100644 index 0000000..21f904f --- /dev/null +++ b/Demo/Graphics/CharAnimation.HC @@ -0,0 +1,30 @@ +U8 *old_font=text.font; + +// See $LK,"::/Kernel/FontStd.HC"$, $LK,"::/Demo/ScreenCodes.HC"$, +//$LK,"::/Demo/ExtChars.HC"$, and $LK,"::/Demo/Graphics/FontEd.HC"$. + +U64 waves[4]={ +0x0011AA440011AA44,0x0022558800225588, +0x0044AA110044AA11,0x0088552200885522}; + +U0 AnimateEndCB() +{ + text.font=old_font; + Exit; +} + +U0 AnimateTask(I64) +{ + I64 i; + U64 *font=MAlloc(256*8); + Fs->task_end_cb=&AnimateEndCB; + MemCpy(font,text.font,256*8); + text.font=font; + while (TRUE) { + font[CH_SPACE]=waves[i++&0x3]; + Sleep(100); + } +} + +Spawn(&AnimateTask,NULL,"Animate",,Fs); +TaskRep; diff --git a/Demo/Graphics/Collision.CPP b/Demo/Graphics/Collision.HC similarity index 100% rename from Demo/Graphics/Collision.CPP rename to Demo/Graphics/Collision.HC diff --git a/Demo/Graphics/CommonAncestor.CPP b/Demo/Graphics/CommonAncestor.CPP deleted file mode 100644 index 4bc139e..0000000 --- a/Demo/Graphics/CommonAncestor.CPP +++ /dev/null @@ -1,120 +0,0 @@ -#define N 32 - -class Node -{ - Node *left,*right; - I64 n; -}; - -I64 n1,n2,common_ancestor; -Node *root; - -#define X_SPACING 16 -#define Y_SPACING 45 -#define ARROW_SPACING 3 - -U0 ShowTree(CDC *dc,Node *tempn,I64 *_node_x,I64 *_tree_x,I64 y) -{ - I64 node_x; - if (tempn) { - if (tempn->left) { - ShowTree(dc,tempn->left,&node_x,_tree_x,y+Y_SPACING); - dc->color=BLUE; - GrArrow3(dc,*_tree_x,y,0, - node_x+ARROW_SPACING,y+Y_SPACING-ARROW_SPACING,0); - } - if (tempn->n==n1 || tempn->n==n2) { - if (tempn->n==common_ancestor) - dc->color=YELLOW; - else - dc->color=RED; - } else if (tempn->n==common_ancestor) - dc->color=GREEN; - else - dc->color=BLUE; - - *_node_x=*_tree_x; - GrPrint(dc,*_node_x,y,"%d",tempn->n); - *_tree_x+=X_SPACING; - - if (tempn->right) { - ShowTree(dc,tempn->right,&node_x,_tree_x,y+Y_SPACING); - dc->color=BLUE; - GrArrow3(dc,*_node_x,y,0, - node_x-ARROW_SPACING,y+Y_SPACING-ARROW_SPACING,0); - } - } -} - -U0 DrawIt(CTask *,CDC *dc) -{ - I64 node_x=0,tree_x=0; - ShowTree(dc,root,&node_x,&tree_x,20); -} - -U0 TreeAdd(Node **_root,Node *tempn) -{ - Node *root=*_root; - if (!root) - *_root=tempn; - else if (tempn->n==root->n) - Free(tempn); - else if (tempn->nn) - TreeAdd(&root->left,tempn); - else - TreeAdd(&root->right,tempn); -} - -U0 TreeNew() -{ - I64 i; - Node *tempn; - for (i=0;in=RandU16%N; - - if (i==N-1) - n1=tempn->n; - else if (i==N-2) - n2=tempn->n; - - TreeAdd(&root,tempn); - Sleep(50); - } -} - -U0 TreeCommonAncestorFind(Node *root) -{ - if (root && root->n!=n1 && root->n!=n2) { - common_ancestor=root->n; - if (n1n && n2n) - TreeCommonAncestorFind(root->left); - else if (n1>root->n && n2>root->n) - TreeCommonAncestorFind(root->right); - } -} - -U0 TreeCommonAncestor() -{//Make tree and find common ancestor to n1 & n2. - root=NULL; - n1=n2=common_ancestor=0; - - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - Fs->draw_it=&DrawIt; - DocClear; - "Scroll with {CTRL-Left Grab}.\n"; - try { - TreeNew; - TreeCommonAncestorFind(root); - PressAKey; - } catch - PutExcept; - SettingsPop; -} - -TreeCommonAncestor; -/*Be careful with recursive routines in TempleOS -because the stack does not grow and will overflow. - -See $LK,"::/Demo/StkGrow.CPP"$. -*/ diff --git a/Demo/Graphics/CommonAncestor.HC b/Demo/Graphics/CommonAncestor.HC new file mode 100644 index 0000000..e620de3 --- /dev/null +++ b/Demo/Graphics/CommonAncestor.HC @@ -0,0 +1,120 @@ +#define N 32 + +class Node +{ + Node *left,*right; + I64 n; +}; + +I64 n1,n2,common_ancestor; +Node *root; + +#define X_SPACING 16 +#define Y_SPACING 45 +#define ARROW_SPACING 3 + +U0 ShowTree(CDC *dc,Node *tempn,I64 *_node_x,I64 *_tree_x,I64 y) +{ + I64 node_x; + if (tempn) { + if (tempn->left) { + ShowTree(dc,tempn->left,&node_x,_tree_x,y+Y_SPACING); + dc->color=BLUE; + GrArrow3(dc,*_tree_x,y,0, + node_x+ARROW_SPACING,y+Y_SPACING-ARROW_SPACING,0); + } + if (tempn->n==n1 || tempn->n==n2) { + if (tempn->n==common_ancestor) + dc->color=YELLOW; + else + dc->color=RED; + } else if (tempn->n==common_ancestor) + dc->color=GREEN; + else + dc->color=BLUE; + + *_node_x=*_tree_x; + GrPrint(dc,*_node_x,y,"%d",tempn->n); + *_tree_x+=X_SPACING; + + if (tempn->right) { + ShowTree(dc,tempn->right,&node_x,_tree_x,y+Y_SPACING); + dc->color=BLUE; + GrArrow3(dc,*_node_x,y,0, + node_x-ARROW_SPACING,y+Y_SPACING-ARROW_SPACING,0); + } + } +} + +U0 DrawIt(CTask *,CDC *dc) +{ + I64 node_x=0,tree_x=0; + ShowTree(dc,root,&node_x,&tree_x,20); +} + +U0 TreeAdd(Node **_root,Node *tempn) +{ + Node *root=*_root; + if (!root) + *_root=tempn; + else if (tempn->n==root->n) + Free(tempn); + else if (tempn->nn) + TreeAdd(&root->left,tempn); + else + TreeAdd(&root->right,tempn); +} + +U0 TreeNew() +{ + I64 i; + Node *tempn; + for (i=0;in=RandU16%N; + + if (i==N-1) + n1=tempn->n; + else if (i==N-2) + n2=tempn->n; + + TreeAdd(&root,tempn); + Sleep(50); + } +} + +U0 TreeCommonAncestorFind(Node *root) +{ + if (root && root->n!=n1 && root->n!=n2) { + common_ancestor=root->n; + if (n1n && n2n) + TreeCommonAncestorFind(root->left); + else if (n1>root->n && n2>root->n) + TreeCommonAncestorFind(root->right); + } +} + +U0 TreeCommonAncestor() +{//Make tree and find common ancestor to n1 & n2. + root=NULL; + n1=n2=common_ancestor=0; + + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + Fs->draw_it=&DrawIt; + DocClear; + "Scroll with {CTRL-Left Grab}.\n"; + try { + TreeNew; + TreeCommonAncestorFind(root); + PressAKey; + } catch + PutExcept; + SettingsPop; +} + +TreeCommonAncestor; +/*Be careful with recursive routines in TempleOS +because the stack does not grow and will overflow. + +See $LK,"::/Demo/StkGrow.HC"$. +*/ diff --git a/Demo/Graphics/Doodle.CPP b/Demo/Graphics/Doodle.HC similarity index 100% rename from Demo/Graphics/Doodle.CPP rename to Demo/Graphics/Doodle.HC diff --git a/Demo/Graphics/EdSprite.CPP b/Demo/Graphics/EdSprite.HC similarity index 100% rename from Demo/Graphics/EdSprite.CPP rename to Demo/Graphics/EdSprite.HC diff --git a/Demo/Graphics/Elephant.CPP b/Demo/Graphics/Elephant.HC similarity index 100% rename from Demo/Graphics/Elephant.CPP rename to Demo/Graphics/Elephant.HC diff --git a/Demo/Graphics/Extents.CPP b/Demo/Graphics/Extents.HC similarity index 100% rename from Demo/Graphics/Extents.CPP rename to Demo/Graphics/Extents.HC diff --git a/Demo/Graphics/FontEd.CPP b/Demo/Graphics/FontEd.CPP deleted file mode 100644 index f7097ab..0000000 --- a/Demo/Graphics/FontEd.CPP +++ /dev/null @@ -1,152 +0,0 @@ -/*After making a font... - -You can save it as a binary file with: - FileWrite("filename.BIN.Z",text.font,256*FONT_HEIGHT); - -You can load it with: - U64 *my_font=FileRead("filename.BIN.Z"); - text.aux_font=my_font; - - will toggle main font and aux_font. - -If you want to change the system font permanently, -save to a file with this font editor program -and cut and paste the code into $LK,"::/Kernel/FontStd.CPP"$. -You will need to recompile Kernel by calling $LK,"BootHDIns",A="MN:BootHDIns"$(). - -See $LK,"::/Demo/ExtendedChars.CPP"$, $LK,"::/Demo/Games/CharDemo.CPP"$, -$LK,"::/Demo/Graphics/CharAnimation.CPP"$ and $LK,"::/Demo/ScreenCodes.CPP"$. -*/ - -#define BLOW_UP_CHAR_X (18*FONT_WIDTH) -#define BLOW_UP_CHAR_Y (4*FONT_HEIGHT) - -U8 cur_ch; - -U0 DrawIt(CTask *task,CDC *dc) -{ - I64 i,j,k,c; - TextPrint(task,0,0,BLUE<<4+YELLOW,"Press to Toggle Aux Font."); - k=0; - for (i=0;i<16;i++) - for (j=0;j<16;j++) { - if (k==cur_ch) { - if (Blink) - c=(BLUE<<4+YELLOW)<<8 + k++; - else - c=(YELLOW<<4+BLUE)<<8 + k++; - } else - c=(BLUE<<4+WHITE)<<8 + k++; - TextChar(task,,j,i+2,c); - } - - k=0; - for (i=0;icolor=YELLOW; - else - dc->color=BLUE; - GrRect(dc,BLOW_UP_CHAR_X+j*FONT_WIDTH, - BLOW_UP_CHAR_Y+i*FONT_HEIGHT, - FONT_WIDTH,FONT_HEIGHT); - } -} - -U0 FESave(Bool pmt) -{ - U8 old_draw_it=Fs->draw_it; - CDoc *doc=DocNew; - I64 i; - for (i=0;i<256;i++) { - DocPrint(doc,"0x%016X,",text.font[i]); - if (Bt(chars_bmp_safe_dollar,i)) - DocPrint(doc,"//%c",i); - else if (i=='$$') - DocPrint(doc,"//$$$$",i); - DocPrint(doc,"\n"); - } - Fs->draw_it=NULL; - DocWrite(doc,pmt); - Fs->draw_it=old_draw_it; - DocDel(doc); -} - -U0 FontEd() -{ - I64 msg_code,a1,a2,k; - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - MenuPush( - "File {" - " SaveAs(,CH_CTRLA);" - " Abort(,CH_SHIFT_ESC);" - " Exit(,CH_ESC);" - "}"); - AutoComplete; - DocCursor; - DocClear; - Fs->win_inhibit|=WIG_DBL_CLICK; - cur_ch=0; - try { - Fs->draw_it=&DrawIt; - while (TRUE) { - switch (msg_code=GetMsg(&a1,&a2, - 1< will toggle main font and aux_font. + +If you want to change the system font permanently, +save to a file with this font editor program +and cut and paste the code into $LK,"::/Kernel/FontStd.HC"$. +You will need to recompile Kernel by calling $LK,"BootHDIns",A="MN:BootHDIns"$(). + +See $LK,"::/Demo/ExtChars.HC"$, $LK,"::/Demo/Games/CharDemo.HC"$, +$LK,"::/Demo/Graphics/CharAnimation.HC"$ and $LK,"::/Demo/ScreenCodes.HC"$. +*/ + +#define BLOW_UP_CHAR_X (18*FONT_WIDTH) +#define BLOW_UP_CHAR_Y (4*FONT_HEIGHT) + +U8 cur_ch; + +U0 DrawIt(CTask *task,CDC *dc) +{ + I64 i,j,k,c; + TextPrint(task,0,0,BLUE<<4+YELLOW,"Press to Toggle Aux Font."); + k=0; + for (i=0;i<16;i++) + for (j=0;j<16;j++) { + if (k==cur_ch) { + if (Blink) + c=(BLUE<<4+YELLOW)<<8 + k++; + else + c=(YELLOW<<4+BLUE)<<8 + k++; + } else + c=(BLUE<<4+WHITE)<<8 + k++; + TextChar(task,,j,i+2,c); + } + + k=0; + for (i=0;icolor=YELLOW; + else + dc->color=BLUE; + GrRect(dc,BLOW_UP_CHAR_X+j*FONT_WIDTH, + BLOW_UP_CHAR_Y+i*FONT_HEIGHT, + FONT_WIDTH,FONT_HEIGHT); + } +} + +U0 FESave(Bool pmt) +{ + U8 old_draw_it=Fs->draw_it; + CDoc *doc=DocNew; + I64 i; + for (i=0;i<256;i++) { + DocPrint(doc,"0x%016X,",text.font[i]); + if (Bt(chars_bmp_safe_dollar,i)) + DocPrint(doc,"//%c",i); + else if (i=='$$') + DocPrint(doc,"//$$$$",i); + DocPrint(doc,"\n"); + } + Fs->draw_it=NULL; + DocWrite(doc,pmt); + Fs->draw_it=old_draw_it; + DocDel(doc); +} + +U0 FontEd() +{ + I64 msg_code,a1,a2,k; + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + MenuPush( + "File {" + " SaveAs(,CH_CTRLA);" + " Abort(,CH_SHIFT_ESC);" + " Exit(,CH_ESC);" + "}"); + AutoComplete; + DocCursor; + DocClear; + Fs->win_inhibit|=WIG_DBL_CLICK; + cur_ch=0; + try { + Fs->draw_it=&DrawIt; + while (TRUE) { + switch (msg_code=GetMsg(&a1,&a2, + 1<r,i,vn_x,vn_y,vn_z; - F64 d; - - v1.x=poly[0].x-poly[1].x; - v1.y=poly[0].y-poly[1].y; - v1.z=poly[0].z-poly[1].z; - - v2.x=poly[2].x-poly[1].x; - v2.y=poly[2].y-poly[1].y; - v2.z=poly[2].z-poly[1].z; - - //V1 and V2 are vects along two sides - //of the polygon joined at point[1]. - - vn_x=v1.y*v2.z-v1.z*v2.y; - vn_y=v1.z*v2.x-v1.x*v2.z; - vn_z=v1.x*v2.y-v1.y*v2.x; - - if (d=Sqrt(SqrI64(vn_x)+SqrI64(vn_y)+SqrI64(vn_z))) - d=1<<16/d; - vn_x*=d; - vn_y*=d; - vn_z*=d; -//Vn is the cross product of V1 and V3 - //which means it is perpendicular. It - //is the normal vect to the surface. - //It has been scaled to length 65536. - Mat4x4MulXYZ(r,&vn_x,&vn_y,&vn_z); - i=(vn_x*ls->x+vn_y*ls->y+vn_z*ls->z)>>16; -//The dot product of the light source - //vect and the surface normal - //gives an illumination number. - - //TempleOS will generate a random U16 - //and compare to dither_probability_u16 and - //will pick from two colors. - //Probability dithering does not work with pen_width>1 at this time. - if (i<0) { - dc->color=ROPF_PROBABILITY_DITHER+BLACK<<16+color; - dc->dither_probability_u16=-i; - } else { - dc->color=ROPF_PROBABILITY_DITHER+(color^8)<<16+color; - dc->dither_probability_u16=i; - } -} - -#define RINGS 8 -#define FACES 32 -#define SLOP 0.03 //Gaps appear without this. - -U0 DrawIt(CTask *task,CDC *dc) -{ - CCtrl *c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES); - CViewAngles *s=c->state; - F64 tt=0.5*(Sin(ã*2*(tS%10.0)/10.0)+2.0), - é,é2,è,è2,radius,d; - I64 i,j,cx=task->pix_width/2,cy=task->pix_height/2; - CD3I32 poly[3],ls; - - dc->flags|=DCF_TRANSFORMATION; - DCDepthBufAlloc(dc); - - Mat4x4IdentEqu(dc->r); - Mat4x4RotZ(dc->r,s->az); - Mat4x4RotY(dc->r,s->ay); - Mat4x4RotX(dc->r,s->ax+ã); - Mat4x4Scale(dc->r,tt); - DCMat4x4Set(dc,dc->r); - - ls.x=-(ip.pos.x-task->pix_left-task->scroll_x-cx); - ls.y=-(ip.pos.y-task->pix_top-task->scroll_y-cy); - ls.z=GR_WIDTH/8; - d=1<<16/D3I32Norm(&ls); - ls.x*=d; - ls.y*=d; - ls.z*=d; - - dc->x=cx; - dc->y=cy; - dc->z=MaxI64(cx,cy); - radius =MinI64(cx,cy)/2; - - for (i=0;istate; - s->sx=2*VIEWANGLES_SNAP; - s->sy=7*VIEWANGLES_SNAP; - s->sz=6*VIEWANGLES_SNAP; - - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - AutoComplete; - WinBorder; - WinMax; - DocClear; - Fs->draw_it=&DrawIt; - try { - "\n\nMove mouse to change light source.\n\n"; - PressAKey; - } catch - PutExcept; - DocClear; - SettingsPop; - ViewAnglesDel; -} - -Main; diff --git a/Demo/Graphics/Shading.HC b/Demo/Graphics/Shading.HC new file mode 100644 index 0000000..332f126 --- /dev/null +++ b/Demo/Graphics/Shading.HC @@ -0,0 +1,177 @@ +//"ls" is light source. + +U0 Lighting(CDC *dc,CD3I32 *ls,CD3I32 *poly,I64 color) +{//color is a color from 0-7 + CD3I32 v1,v2; + I64 *r=dc->r,i,vn_x,vn_y,vn_z; + F64 d; + + v1.x=poly[0].x-poly[1].x; + v1.y=poly[0].y-poly[1].y; + v1.z=poly[0].z-poly[1].z; + + v2.x=poly[2].x-poly[1].x; + v2.y=poly[2].y-poly[1].y; + v2.z=poly[2].z-poly[1].z; + + //V1 and V2 are vects along two sides + //of the polygon joined at point[1]. + + vn_x=v1.y*v2.z-v1.z*v2.y; + vn_y=v1.z*v2.x-v1.x*v2.z; + vn_z=v1.x*v2.y-v1.y*v2.x; + + if (d=Sqrt(SqrI64(vn_x)+SqrI64(vn_y)+SqrI64(vn_z))) + d=1<<16/d; + vn_x*=d; + vn_y*=d; + vn_z*=d; +//Vn is the cross product of V1 and V3 + //which means it is perpendicular. It + //is the normal vect to the surface. + //It has been scaled to length 65536. + Mat4x4MulXYZ(r,&vn_x,&vn_y,&vn_z); + i=(vn_x*ls->x+vn_y*ls->y+vn_z*ls->z)>>16; +//The dot product of the light source + //vect and the surface normal + //gives an illumination number. + + //TempleOS will generate a random U16 + //and compare to dither_probability_u16 and + //will pick from two colors. + //Probability dithering does not work with pen_width>1 at this time. + if (i<0) { + dc->color=ROPF_PROBABILITY_DITHER+BLACK<<16+color; + dc->dither_probability_u16=-i; + } else { + dc->color=ROPF_PROBABILITY_DITHER+(color^8)<<16+color; + dc->dither_probability_u16=i; + } +} + +#define RINGS 8 +#define FACES 32 +#define SLOP 0.03 //Gaps appear without this. + +U0 DrawIt(CTask *task,CDC *dc) +{ + CCtrl *c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES); + CViewAngles *s=c->state; + F64 tt=0.5*(Sin(ã*2*(tS%10.0)/10.0)+2.0), + é,é2,è,è2,radius,d; + I64 i,j,cx=task->pix_width/2,cy=task->pix_height/2; + CD3I32 poly[3],ls; + + dc->flags|=DCF_TRANSFORMATION; + DCDepthBufAlloc(dc); + + Mat4x4IdentEqu(dc->r); + Mat4x4RotZ(dc->r,s->az); + Mat4x4RotY(dc->r,s->ay); + Mat4x4RotX(dc->r,s->ax+ã); + Mat4x4Scale(dc->r,tt); + DCMat4x4Set(dc,dc->r); + + ls.x=-(ip.pos.x-task->pix_left-task->scroll_x-cx); + ls.y=-(ip.pos.y-task->pix_top-task->scroll_y-cy); + ls.z=GR_WIDTH/8; + d=1<<16/D3I32Norm(&ls); + ls.x*=d; + ls.y*=d; + ls.z*=d; + + dc->x=cx; + dc->y=cy; + dc->z=MaxI64(cx,cy); + radius =MinI64(cx,cy)/2; + + for (i=0;istate; + s->sx=2*VIEWANGLES_SNAP; + s->sy=7*VIEWANGLES_SNAP; + s->sz=6*VIEWANGLES_SNAP; + + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + AutoComplete; + WinBorder; + WinMax; + DocClear; + Fs->draw_it=&DrawIt; + try { + "\n\nMove mouse to change light source.\n\n"; + PressAKey; + } catch + PutExcept; + DocClear; + SettingsPop; + ViewAnglesDel; +} + +Main; diff --git a/Demo/Graphics/Shadow.CPP b/Demo/Graphics/Shadow.HC similarity index 100% rename from Demo/Graphics/Shadow.CPP rename to Demo/Graphics/Shadow.HC diff --git a/Demo/Graphics/Slider.CPP b/Demo/Graphics/Slider.HC similarity index 100% rename from Demo/Graphics/Slider.CPP rename to Demo/Graphics/Slider.HC diff --git a/Demo/Graphics/Speedline.CPP b/Demo/Graphics/Speedline.HC similarity index 100% rename from Demo/Graphics/Speedline.CPP rename to Demo/Graphics/Speedline.HC diff --git a/Demo/Graphics/SpritePlot.CPP b/Demo/Graphics/SpritePlot.CPP deleted file mode 100644 index 14a3883..0000000 Binary files a/Demo/Graphics/SpritePlot.CPP and /dev/null differ diff --git a/Demo/Graphics/SpritePlot.HC b/Demo/Graphics/SpritePlot.HC new file mode 100644 index 0000000..3a5dcee Binary files /dev/null and b/Demo/Graphics/SpritePlot.HC differ diff --git a/Demo/Graphics/SpritePlot3D.CPP b/Demo/Graphics/SpritePlot3D.HC similarity index 100% rename from Demo/Graphics/SpritePlot3D.CPP rename to Demo/Graphics/SpritePlot3D.HC diff --git a/Demo/Graphics/SpritePut.CPP b/Demo/Graphics/SpritePut.CPP deleted file mode 100644 index f32af3a..0000000 Binary files a/Demo/Graphics/SpritePut.CPP and /dev/null differ diff --git a/Demo/Graphics/SpritePut.HC b/Demo/Graphics/SpritePut.HC new file mode 100644 index 0000000..e53b0fd Binary files /dev/null and b/Demo/Graphics/SpritePut.HC differ diff --git a/Demo/Graphics/SpritePutExt.CPP b/Demo/Graphics/SpritePutExt.CPP deleted file mode 100644 index 3f0fbbc..0000000 --- a/Demo/Graphics/SpritePutExt.CPP +++ /dev/null @@ -1,26 +0,0 @@ -/*If you press you will see this: - -$$IB,"<1>",BI=1,BP="::/Demo/Graphics/SpritePut.CPP,2"$$ - -That imports an external sprite. It's -called a $LK,"DOCEF_BIN_PTR_LINK",A="MN:DOCEF_BIN_PTR_LINK"$. See $LK,"BP=\"\"",A="FF:::/Doc/DolDocOverview.TXT,BP=\"\""$. - -Press and "pointer to sprite". -Then, enter a file and the number of -the sprite in the file. Note: the -number can get messed-up if you change -the order of sprites in the source file. -You can link to a tag string instead of a num. -*/ - -U0 SpritePutExt() -{ - I64 i; - for (i=0;i<3;i++) { - "US Map:"; - Sprite($IB,"<1>",BI=1,BP="::/Demo/Graphics/SpritePut.CPP,2"$); - "%h12c",'\n'; - } -} - -SpritePutExt; diff --git a/Demo/Graphics/SpritePutExt.HC b/Demo/Graphics/SpritePutExt.HC new file mode 100644 index 0000000..e2dbb58 --- /dev/null +++ b/Demo/Graphics/SpritePutExt.HC @@ -0,0 +1,26 @@ +/*If you press you will see this: + +$$IB,"<1>",BI=1,BP="::/Demo/Graphics/SpritePut.HC,2"$$ + +That imports an external sprite. It's +called a $LK,"DOCEF_BIN_PTR_LINK",A="MN:DOCEF_BIN_PTR_LINK"$. See $LK,"BP=\"\"",A="FF:::/Doc/DolDocOverview.DD,BP=\"\""$. + +Press and "pointer to sprite". +Then, enter a file and the number of +the sprite in the file. Note: the +number can get messed-up if you change +the order of sprites in the source file. +You can link to a tag string instead of a num. +*/ + +U0 SpritePutExt() +{ + I64 i; + for (i=0;i<3;i++) { + "US Map:"; + Sprite($IB,"<1>",BI=1,BP="::/Demo/Graphics/SpritePut.HC,2"$); + "%h12c",'\n'; + } +} + +SpritePutExt; diff --git a/Demo/Graphics/SpriteRaw.CPP b/Demo/Graphics/SpriteRaw.HC similarity index 100% rename from Demo/Graphics/SpriteRaw.CPP rename to Demo/Graphics/SpriteRaw.HC diff --git a/Demo/Graphics/SpriteText.CPP b/Demo/Graphics/SpriteText.HC similarity index 100% rename from Demo/Graphics/SpriteText.CPP rename to Demo/Graphics/SpriteText.HC diff --git a/Demo/Graphics/SunMoon.CPP b/Demo/Graphics/SunMoon.HC similarity index 100% rename from Demo/Graphics/SunMoon.CPP rename to Demo/Graphics/SunMoon.HC diff --git a/Demo/Graphics/Symmetry.CPP b/Demo/Graphics/Symmetry.HC similarity index 100% rename from Demo/Graphics/Symmetry.CPP rename to Demo/Graphics/Symmetry.HC diff --git a/Demo/Graphics/Transform.CPP b/Demo/Graphics/Transform.HC similarity index 100% rename from Demo/Graphics/Transform.CPP rename to Demo/Graphics/Transform.HC diff --git a/Demo/Graphics/WallPaperCtrl.CPP b/Demo/Graphics/WallPaperCtrl.CPP deleted file mode 100644 index 90d25d1..0000000 --- a/Demo/Graphics/WallPaperCtrl.CPP +++ /dev/null @@ -1,108 +0,0 @@ -/*Done with template code -that was modified. - -This is an advanced demo that shows -that you can place ctrls on the -wall paper. - -See $LK,"::/Demo/Graphics/Slider.CPP"$ -and $LK,"::/Demo/Graphics/WallPaperFish.CPP"$ -before messing with this program. - -It must be "Adam Included". -*/ - -#define SLIDER_RANGE 30 -#define SLIDER_SPACING 20 -#define SLIDER_BORDER 2 - -class CSliderState -{ - I64 left_pos; - I64 right_pos; -}; - -U0 DrawCtrlSlider(CDC *dc,CCtrl *c) -{ - CSliderState *s=c->state; - - dc->color=LTRED; - GrRect(dc, c->left,c->top,SLIDER_SPACING*3+2,SLIDER_SPACING*2+SLIDER_RANGE); - dc->color=BLUE; - GrRect(dc, c->left+SLIDER_BORDER,c->top+SLIDER_BORDER, - SLIDER_SPACING*3+2-2*SLIDER_BORDER, - SLIDER_SPACING*2+SLIDER_RANGE-2*SLIDER_BORDER); - dc->color=BLACK; - GrLine(dc,c->left+1*SLIDER_SPACING+0,c->top+SLIDER_SPACING, - c->left+1*SLIDER_SPACING+0,c->top+SLIDER_SPACING+SLIDER_RANGE-1); - GrLine(dc,c->left+2*SLIDER_SPACING+1,c->top+SLIDER_SPACING, - c->left+2*SLIDER_SPACING+1,c->top+SLIDER_SPACING+SLIDER_RANGE-1); - dc->color=LTRED; - GrPrint(dc,c->left+1*SLIDER_SPACING+0-FONT_WIDTH/2, - c->top+SLIDER_SPACING+SLIDER_RANGE+3, - "%d",s->left_pos*10/SLIDER_RANGE); - GrPrint(dc,c->left+2*SLIDER_SPACING+1-FONT_WIDTH/2, - c->top+SLIDER_SPACING+SLIDER_RANGE+3, - "%d",s->right_pos*10/SLIDER_RANGE); - GrRect(dc,c->left+1*SLIDER_SPACING+0-3, - c->top+SLIDER_SPACING+SLIDER_RANGE-1-s->left_pos-2,7,5); - GrRect(dc,c->left+2*SLIDER_SPACING+1-3, - c->top+SLIDER_SPACING+SLIDER_RANGE-1-s->right_pos-2,7,5); - dc->color=YELLOW; - GrRect(dc,c->left+1*SLIDER_SPACING+0-2, - c->top+SLIDER_SPACING+SLIDER_RANGE-1-s->left_pos-1,5,3); - GrRect(dc,c->left+2*SLIDER_SPACING+1-2, - c->top+SLIDER_SPACING+SLIDER_RANGE-1-s->right_pos-1,5,3); -} - -U0 UpdateDerivedCtrlSlider(CCtrl *c) -{ - CSliderState *s=c->state; - c->left=c->win_task->pix_width/2-(SLIDER_SPACING*3+2)/2; - c->right=c->left+3*SLIDER_SPACING+2; - c->top=c->win_task->pix_height/2-(SLIDER_SPACING*2+SLIDER_RANGE)/2; - c->bottom=c->top+SLIDER_SPACING*2+SLIDER_RANGE; - s->left_pos=ClampI64(s->left_pos,0,SLIDER_RANGE-1); - s->right_pos=ClampI64(s->right_pos,0,SLIDER_RANGE-1); -} - -U0 LeftClickSlider(CCtrl *c,I64 x,I64 y,Bool) -{ - CSliderState *s=c->state; - if (xleft+1*SLIDER_SPACING+0+SLIDER_SPACING/2) - s->left_pos=SLIDER_RANGE-1-(y-(c->top+SLIDER_SPACING)); - else - s->right_pos=SLIDER_RANGE-1-(y-(c->top+SLIDER_SPACING)); - if (c->update_derived_vals) - (*c->update_derived_vals)(c); -} - -CCtrl *SliderNew() -{ - CCtrl *c; - if (Fs!=adam_task) { - "Must be Adam Included with SHIFT-F5.\n" - "(Would crash when code mem was freed.)\n"; - return NULL; - } - c=ACAlloc(sizeof(CCtrl)); - c->win_task=sys_winmgr_task; - c->flags=CTRLF_SHOW|CTRLF_CAPTURE_LEFT_IP; - c->type=CTRLT_GENERIC; - c->state=ACAlloc(sizeof(CSliderState)); - c->draw_it=&DrawCtrlSlider; - c->left_click=&LeftClickSlider; - c->update_derived_vals=&UpdateDerivedCtrlSlider; - QueIns(c,sys_winmgr_task->last_ctrl); - TaskDerivedValsUpdate; - return c; -} - -U0 SliderDel(CCtrl *c) -{ - QueRem(c); - Free(c->state); - Free(c); -} - -SliderNew; diff --git a/Demo/Graphics/WallPaperCtrl.HC b/Demo/Graphics/WallPaperCtrl.HC new file mode 100644 index 0000000..d7ab602 --- /dev/null +++ b/Demo/Graphics/WallPaperCtrl.HC @@ -0,0 +1,108 @@ +/*Done with template code +that was modified. + +This is an advanced demo that shows +that you can place ctrls on the +wall paper. + +See $LK,"::/Demo/Graphics/Slider.HC"$ +and $LK,"::/Demo/Graphics/WallPaperFish.HC"$ +before messing with this program. + +It must be "Adam Included". +*/ + +#define SLIDER_RANGE 30 +#define SLIDER_SPACING 20 +#define SLIDER_BORDER 2 + +class CSliderState +{ + I64 left_pos; + I64 right_pos; +}; + +U0 DrawCtrlSlider(CDC *dc,CCtrl *c) +{ + CSliderState *s=c->state; + + dc->color=LTRED; + GrRect(dc, c->left,c->top,SLIDER_SPACING*3+2,SLIDER_SPACING*2+SLIDER_RANGE); + dc->color=BLUE; + GrRect(dc, c->left+SLIDER_BORDER,c->top+SLIDER_BORDER, + SLIDER_SPACING*3+2-2*SLIDER_BORDER, + SLIDER_SPACING*2+SLIDER_RANGE-2*SLIDER_BORDER); + dc->color=BLACK; + GrLine(dc,c->left+1*SLIDER_SPACING+0,c->top+SLIDER_SPACING, + c->left+1*SLIDER_SPACING+0,c->top+SLIDER_SPACING+SLIDER_RANGE-1); + GrLine(dc,c->left+2*SLIDER_SPACING+1,c->top+SLIDER_SPACING, + c->left+2*SLIDER_SPACING+1,c->top+SLIDER_SPACING+SLIDER_RANGE-1); + dc->color=LTRED; + GrPrint(dc,c->left+1*SLIDER_SPACING+0-FONT_WIDTH/2, + c->top+SLIDER_SPACING+SLIDER_RANGE+3, + "%d",s->left_pos*10/SLIDER_RANGE); + GrPrint(dc,c->left+2*SLIDER_SPACING+1-FONT_WIDTH/2, + c->top+SLIDER_SPACING+SLIDER_RANGE+3, + "%d",s->right_pos*10/SLIDER_RANGE); + GrRect(dc,c->left+1*SLIDER_SPACING+0-3, + c->top+SLIDER_SPACING+SLIDER_RANGE-1-s->left_pos-2,7,5); + GrRect(dc,c->left+2*SLIDER_SPACING+1-3, + c->top+SLIDER_SPACING+SLIDER_RANGE-1-s->right_pos-2,7,5); + dc->color=YELLOW; + GrRect(dc,c->left+1*SLIDER_SPACING+0-2, + c->top+SLIDER_SPACING+SLIDER_RANGE-1-s->left_pos-1,5,3); + GrRect(dc,c->left+2*SLIDER_SPACING+1-2, + c->top+SLIDER_SPACING+SLIDER_RANGE-1-s->right_pos-1,5,3); +} + +U0 UpdateDerivedCtrlSlider(CCtrl *c) +{ + CSliderState *s=c->state; + c->left=c->win_task->pix_width/2-(SLIDER_SPACING*3+2)/2; + c->right=c->left+3*SLIDER_SPACING+2; + c->top=c->win_task->pix_height/2-(SLIDER_SPACING*2+SLIDER_RANGE)/2; + c->bottom=c->top+SLIDER_SPACING*2+SLIDER_RANGE; + s->left_pos=ClampI64(s->left_pos,0,SLIDER_RANGE-1); + s->right_pos=ClampI64(s->right_pos,0,SLIDER_RANGE-1); +} + +U0 LeftClickSlider(CCtrl *c,I64 x,I64 y,Bool) +{ + CSliderState *s=c->state; + if (xleft+1*SLIDER_SPACING+0+SLIDER_SPACING/2) + s->left_pos=SLIDER_RANGE-1-(y-(c->top+SLIDER_SPACING)); + else + s->right_pos=SLIDER_RANGE-1-(y-(c->top+SLIDER_SPACING)); + if (c->update_derived_vals) + (*c->update_derived_vals)(c); +} + +CCtrl *SliderNew() +{ + CCtrl *c; + if (Fs!=adam_task) { + "Must be Adam Included with SHIFT-F5.\n" + "(Would crash when code mem was freed.)\n"; + return NULL; + } + c=ACAlloc(sizeof(CCtrl)); + c->win_task=sys_winmgr_task; + c->flags=CTRLF_SHOW|CTRLF_CAPTURE_LEFT_IP; + c->type=CTRLT_GENERIC; + c->state=ACAlloc(sizeof(CSliderState)); + c->draw_it=&DrawCtrlSlider; + c->left_click=&LeftClickSlider; + c->update_derived_vals=&UpdateDerivedCtrlSlider; + QueIns(c,sys_winmgr_task->last_ctrl); + TaskDerivedValsUpdate; + return c; +} + +U0 SliderDel(CCtrl *c) +{ + QueRem(c); + Free(c->state); + Free(c); +} + +SliderNew; diff --git a/Demo/Graphics/WallPaperFish.CPP b/Demo/Graphics/WallPaperFish.HC similarity index 100% rename from Demo/Graphics/WallPaperFish.CPP rename to Demo/Graphics/WallPaperFish.HC diff --git a/Demo/Graphics/WinZBuf.CPP b/Demo/Graphics/WinZBuf.HC similarity index 100% rename from Demo/Graphics/WinZBuf.CPP rename to Demo/Graphics/WinZBuf.HC diff --git a/Demo/KeyBitMap.CPP b/Demo/KeyBitMap.HC similarity index 100% rename from Demo/KeyBitMap.CPP rename to Demo/KeyBitMap.HC diff --git a/Demo/LastClass.CPP b/Demo/LastClass.CPP deleted file mode 100644 index eb907e3..0000000 --- a/Demo/LastClass.CPP +++ /dev/null @@ -1,33 +0,0 @@ -U0 StructName(U8 *d,U8 *class_name=lastclass) -{//lastclass is the prev fun arg's class as a string. - "%X is a \"%s\".\n",d,class_name; -} - -class Student -{ - Student *next; - I64 age; - U8 name[32]; -} a; - -class School -{ - U8 name[32]; - Student *students; -} s; - -I64 i; - -StructName(Fs); -StructName(&a); -StructName(&s); -StructName(&i); -PressAKey; - -//lastclass is used in $LK,"ClassRep",A="MN:ClassRep"$() and $LK,"ClassRepD",A="MN:ClassRepD"$(). -ClassRepD(Gs); -PressAKey; - -ClassRep(Fs); - -//See also $LK,"DocForm",A="MN:DocForm"$(), $LK,"::/Demo/Dsk/BlkDevRep.CPP"$ and $LK,"::/Demo/ClassMeta.CPP"$. diff --git a/Demo/LastClass.HC b/Demo/LastClass.HC new file mode 100644 index 0000000..b525a2d --- /dev/null +++ b/Demo/LastClass.HC @@ -0,0 +1,33 @@ +U0 StructName(U8 *d,U8 *class_name=lastclass) +{//lastclass is the prev fun arg's class as a string. + "%X is a \"%s\".\n",d,class_name; +} + +class Student +{ + Student *next; + I64 age; + U8 name[32]; +} a; + +class School +{ + U8 name[32]; + Student *students; +} s; + +I64 i; + +StructName(Fs); +StructName(&a); +StructName(&s); +StructName(&i); +PressAKey; + +//lastclass is used in $LK,"ClassRep",A="MN:ClassRep"$() and $LK,"ClassRepD",A="MN:ClassRepD"$(). +ClassRepD(Gs); +PressAKey; + +ClassRep(Fs); + +//See also $LK,"DocForm",A="MN:DocForm"$(), $LK,"::/Demo/Dsk/BlkDevRep.HC"$ and $LK,"::/Demo/ClassMeta.HC"$. diff --git a/Demo/Lectures/64BitAsmQuiz.DD b/Demo/Lectures/64BitAsmQuiz.DD new file mode 100644 index 0000000..9814414 --- /dev/null +++ b/Demo/Lectures/64BitAsmQuiz.DD @@ -0,0 +1,89 @@ +$WW,1$$FG,5$$TX+CX,"64-Bit Assembly Quiz"$$FG$ + +1) In 64-bit mode, how many bytes are always pushed? + + PUSH 12 + PUSH EAX + +2) What happens to the upper 32-bits? + + XOR EAX,EAX + MOV EAX,0x12345678 + MOV EAX,0x80000000 + +3) How do you set FS or GS values? + +4) If FS points to current task record, what's wrong with this instruction? + + MOV RAX,U64 FS:[TSS_SOME_MEMBER] + +5) Which instruction takes more bytes? + + MOV RAX,U64 [R8] + MOV RAX,U64 [R13] + +6) Are these the same number of bytes? + + MOV RAX,1234 + MOV R8,1234 + MOV EAX,1234 + +7) True or False + + a) You can access the lowest byte of RAX. + + b) You can access the lowest byte of ESI. + + c) You can access the second-to-lowest byte of RAX. + + d) You can access the second-to-lowest byte of ESI. + +8) How do you call a subroutine at 0x10,0000,0000 from code at 0x00,0010,0000? + +9) How much faster is a REL32 call instruction compared to a software interrupt or SYSCALL? + +10) How long does an IN or OUT instruction take on a 1GHz machine and on a 3GHz machine? + +11) How do you push all 16 regs? + +12) Should you put the regs in a TSS? + +13) You can have 4K or 4Meg pages in 32-bit mode. You can have 4K or what size pages in 64-bit mode? + +14) On a fresh CPU with an empty TLB, how many memory accesses (page tables) does it take to access one virtual address? + +---- + +TempleOS identity-maps everything, all the time, so the usual convention of upper memory being for kernel does not apply. It uses physical addresses, basically. It puts all code in the lowest 2-Gig memory range so that it can use the CALL REL32 instruction, the fastest. It never changes privilege levels or messes with page tables, once it is up-and-running. + +---- + +ANSWERS: + +1) All stack pushes and pops are 64-bits. + +2) The upper 32-bits are set to zero. + +3) To set FS or GS, you use WRMSR to write a model specific reg. See $LK,"IA32_FS_BASE",A="MN:IA32_FS_BASE"$ and $LK,"SET_FS_BASE",A="MN:SET_FS_BASE"$. + +4) Displacement addressing is now RIP relative, so RIP would be added to TSS_SOME_MEMBER. (Useless) + +5) The R13 instruction takes one more byte because it is like $LK,"REG_RBP",A="MN:REG_RBP"$ in the ModR. + +6) The R8 instruction needs a REX byte prefix to specify upper-8 reg. + +7) You can access the lowest byte of any reg. You can access AH but not the second-to-lowest byte of ESI. + +8) To call a subroutine farther than 2 Gig away, you put the address into RAX, then CALL RAX. + +9) CALL REL32 is significantly faster. See $LK,"::/Demo/Lectures/InterruptDemo.HC"$. + +10) IN or OUT instructions happen at a fixed speed based on the original ISA bus clock. + +11) PUSHAD is not available for 64-bit mode, so you do it by hand. + +12) The TSS is no longer used to hold the task state because there are 16 regs and they are 64-bits, not 32-bits. I guess Intel decided doing it by hand was better than TSSes. + +13) 64-bit mode has 4K or 2Meg page size. + +14) For one access, there are 3-4 levels of page tables plus the location itself. diff --git a/Demo/Lectures/64BitAsmQuiz.TXT b/Demo/Lectures/64BitAsmQuiz.TXT deleted file mode 100644 index 2d3b42a..0000000 --- a/Demo/Lectures/64BitAsmQuiz.TXT +++ /dev/null @@ -1,89 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"64-Bit Assembly Quiz"$$FG$ - -1) In 64-bit mode, how many bytes are always pushed? - - PUSH 12 - PUSH EAX - -2) What happens to the upper 32-bits? - - XOR EAX,EAX - MOV EAX,0x12345678 - MOV EAX,0x80000000 - -3) How do you set FS or GS values? - -4) If FS points to current task record, what's wrong with this instruction? - - MOV RAX,U64 FS:[TSS_SOME_MEMBER] - -5) Which instruction takes more bytes? - - MOV RAX,U64 [R8] - MOV RAX,U64 [R13] - -6) Are these the same number of bytes? - - MOV RAX,1234 - MOV R8,1234 - MOV EAX,1234 - -7) True or False - - a) You can access the lowest byte of RAX. - - b) You can access the lowest byte of ESI. - - c) You can access the second-to-lowest byte of RAX. - - d) You can access the second-to-lowest byte of ESI. - -8) How do you call a subroutine at 0x10,0000,0000 from code at 0x00,0010,0000? - -9) How much faster is a REL32 call instruction compared to a software interrupt or SYSCALL? - -10) How long does an IN or OUT instruction take on a 1GHz machine and on a 3GHz machine? - -11) How do you push all 16 regs? - -12) Should you put the regs in a TSS? - -13) You can have 4K or 4Meg pages in 32-bit mode. You can have 4K or what size pages in 64-bit mode? - -14) On a fresh CPU with an empty TLB, how many memory accesses (page tables) does it take to access one virtual address? - ----- - -TempleOS identity-maps everything, all the time, so the usual convention of upper memory being for kernel does not apply. It uses physical addresses, basically. It puts all code in the lowest 2-Gig memory range so that it can use the CALL REL32 instruction, the fastest. It never changes privilege levels or messes with page tables, once it is up-and-running. - ----- - -ANSWERS: - -1) All stack pushes and pops are 64-bits. - -2) The upper 32-bits are set to zero. - -3) To set FS or GS, you use WRMSR to write a model specific reg. See $LK,"IA32_FS_BASE",A="MN:IA32_FS_BASE"$ and $LK,"SET_FS_BASE",A="MN:SET_FS_BASE"$. - -4) Displacement addressing is now RIP relative, so RIP would be added to TSS_SOME_MEMBER. (Useless) - -5) The R13 instruction takes one more byte because it is like $LK,"REG_RBP",A="MN:REG_RBP"$ in the ModR. - -6) The R8 instruction needs a REX byte prefix to specify upper-8 reg. - -7) You can access the lowest byte of any reg. You can access AH but not the second-to-lowest byte of ESI. - -8) To call a subroutine farther than 2 Gig away, you put the address into RAX, then CALL RAX. - -9) CALL REL32 is significantly faster. See $LK,"::/Demo/Lectures/InterruptDemo.CPP"$. - -10) IN or OUT instructions happen at a fixed speed based on the original ISA bus clock. - -11) PUSHAD is not available for 64-bit mode, so you do it by hand. - -12) The TSS is no longer used to hold the task state because there are 16 regs and they are 64-bits, not 32-bits. I guess Intel decided doing it by hand was better than TSSes. - -13) 64-bit mode has 4K or 2Meg page size. - -14) For one access, there are 3-4 levels of page tables plus the location itself. diff --git a/Demo/Lectures/AndNotMod.CPP b/Demo/Lectures/AndNotMod.HC similarity index 100% rename from Demo/Lectures/AndNotMod.CPP rename to Demo/Lectures/AndNotMod.HC diff --git a/Demo/Lectures/FixedPoint.CPP b/Demo/Lectures/FixedPoint.CPP deleted file mode 100644 index cd6d6e7..0000000 --- a/Demo/Lectures/FixedPoint.CPP +++ /dev/null @@ -1,98 +0,0 @@ -/*"Fixed point" means you use ints -that are scaled by a value. A common -example would be using number of pennies -instead of dollars with a float. - -Fixed-point used to be much $TX,"faster",HTML="http://en.wikipedia.org/wiki/X87"$, -but modern processors do well with -floats. It also depends on the compiler -and my compiler used to do floats poorly. -It's a little better. - -I often use 64-bit ints with upper 32-bits -as int and lower 32-bits as fraction. - -See $LK,"::/Demo/SubIntAccess.CPP"$ for how -to access upper or lower 32-bits. - -For a complete lst of nonstandard compiler -features, see $LK,"::/Doc/HolyC.TXT"$. - -*/ - -U0 Main() -{ - F64 t0,f_sum=0,f_val; - I64 i ,i_sum=0,i_val; - - i_val= 2.0000002 *0x100000000; - t0=tS; - for (i=1000000000;i;i--) - i_sum+=i_val; - "Int Sum:%.9f Time:%7.3fs\n",i_sum/ToF64(0x100000000),tS-t0; - - f_val= 2.0000002; - t0=tS; - for (i=1000000000;i;i--) - f_sum+=f_val; - "Float Sum:%.9f Time:%7.3fs\n",f_sum,tS-t0; - '\n'; -} - -U0 DoIt2() -{ - I64 i=0x123456789ABCDEF0; - "i =%X\n",i; - - "i&0xFFFFFFFF=%X\n",i&0xFFFFFFFF; - "i>>32 =%X\n",i>>32; - - /* Standard int types are declared -with a special compiler feature which -allows a structure to be accessed as a -whole. That's why the i variable can -be accessed normally in addition to -structure member access $LK,"I64",A="MN:I64"$. The actual -intrinsic compiler type is U64i. - -public U64i union I64 -{ - I8i i8[8]; - U8i u8[8]; - I16 i16[4]; - U16 u16[4]; - I32 i32[2]; - U32 u32[2]; -}; - -It's not quite as great as it seems -because the compiler decides it cannot -place i into a reg, so there is a -penalty. - -For a complete lst of nonstandard compiler -features, see $LK,"::/Doc/HolyC.TXT"$. -*/ - - "i.u32[0] =%X\n",i.u32[0]; - "i.u32[1] =%X\n",i.u32[1]; -} - -CPURep; -Main; -DoIt2; - -//See $LK,"::/Demo/Lectures/FixedPointAdvanced.CPP"$ - -/*Program Output$HL,0$$WW+H,1$$FD,1$ - -8 Cores 2.660GHz -Int Sum:2000000199.768689408 Time: 0.787s -Float Sum:2000000225.656126208 Time: 3.918s - -i =123456789ABCDEF0 -i&0xFFFFFFFF=9ABCDEF0 -i>>32 =12345678 -i.u32[0] =9ABCDEF0 -i.u32[1] =12345678 -$HL,1$*/ diff --git a/Demo/Lectures/FixedPoint.HC b/Demo/Lectures/FixedPoint.HC new file mode 100644 index 0000000..4e7cdf2 --- /dev/null +++ b/Demo/Lectures/FixedPoint.HC @@ -0,0 +1,98 @@ +/*"Fixed point" means you use ints +that are scaled by a value. A common +example would be using number of pennies +instead of dollars with a float. + +Fixed-point used to be much $TX,"faster",HTML="http://en.wikipedia.org/wiki/X87"$, +but modern processors do well with +floats. It also depends on the compiler +and my compiler used to do floats poorly. +It's a little better. + +I often use 64-bit ints with upper 32-bits +as int and lower 32-bits as fraction. + +See $LK,"::/Demo/SubIntAccess.HC"$ for how +to access upper or lower 32-bits. + +For a complete lst of nonstandard compiler +features, see $LK,"::/Doc/HolyC.DD"$. + +*/ + +U0 Main() +{ + F64 t0,f_sum=0,f_val; + I64 i ,i_sum=0,i_val; + + i_val= 2.0000002 *0x100000000; + t0=tS; + for (i=1000000000;i;i--) + i_sum+=i_val; + "Int Sum:%.9f Time:%7.3fs\n",i_sum/ToF64(0x100000000),tS-t0; + + f_val= 2.0000002; + t0=tS; + for (i=1000000000;i;i--) + f_sum+=f_val; + "Float Sum:%.9f Time:%7.3fs\n",f_sum,tS-t0; + '\n'; +} + +U0 DoIt2() +{ + I64 i=0x123456789ABCDEF0; + "i =%X\n",i; + + "i&0xFFFFFFFF=%X\n",i&0xFFFFFFFF; + "i>>32 =%X\n",i>>32; + + /* Standard int types are declared +with a special compiler feature which +allows a structure to be accessed as a +whole. That's why the i variable can +be accessed normally in addition to +structure member access $LK,"I64",A="MN:I64"$. The actual +intrinsic compiler type is U64i. + +public U64i union I64 +{ + I8i i8[8]; + U8i u8[8]; + I16 i16[4]; + U16 u16[4]; + I32 i32[2]; + U32 u32[2]; +}; + +It's not quite as great as it seems +because the compiler decides it cannot +place i into a reg, so there is a +penalty. + +For a complete lst of nonstandard compiler +features, see $LK,"::/Doc/HolyC.DD"$. +*/ + + "i.u32[0] =%X\n",i.u32[0]; + "i.u32[1] =%X\n",i.u32[1]; +} + +CPURep; +Main; +DoIt2; + +//See $LK,"::/Demo/Lectures/FixedPointAdvanced.HC"$ + +/*Program Output$HL,0$$WW+H,1$$FD,1$ + +8 Cores 2.660GHz +Int Sum:2000000199.768689408 Time: 0.787s +Float Sum:2000000225.656126208 Time: 3.918s + +i =123456789ABCDEF0 +i&0xFFFFFFFF=9ABCDEF0 +i>>32 =12345678 +i.u32[0] =9ABCDEF0 +i.u32[1] =12345678 +$HL,1$*/ diff --git a/Demo/Lectures/FixedPointAdvanced.CPP b/Demo/Lectures/FixedPointAdvanced.CPP deleted file mode 100644 index 96ce13d..0000000 --- a/Demo/Lectures/FixedPointAdvanced.CPP +++ /dev/null @@ -1,173 +0,0 @@ -/*"Fixed point" means you use ints -that are scaled by a value. A common -example would be using number of pennies -instead of dollars with a float. - -Fixed-point used to be much faster, -but modern processors do well with -floats. It also depends on the compiler -and my compiler used to do floats poorly. - -I often use 64-bit ints with upper 32-bits -as int and lower 32-bits as fraction. - -See $LK,"::/Demo/SubIntAccess.CPP"$ for how -to access upper or lower 32-bits. - -*/ -#define SAMPLE_SIZE 10000000 - -I32 coordinates[65536]; - -asm { -_ASM_FIXED_POINT:: - PUSH RBP - MOV RBP,RSP - PUSH RSI - PUSH RDI - MOV RSI,coordinates - MOV RDI,ToI64(Sin(1.0)*0x100000000) - XOR RBX,RBX //SUM - MOV RCX,SAMPLE_SIZE-1 -@@05: XOR RDX,RDX - MOV DX,CX - MOVSXD RAX,U32 [RSI+RDX*4] - IMUL RDI - SAR RAX,32 - ADD RBX,RAX - DEC RCX - JGE @@05 - MOV RAX,RBX - POP RDI - POP RSI - POP RBP - RET - -SINE_VAL: DU64 Sin(1.0); -RET_VAL: DU64 0; - -_ASM_FLOAT:: - PUSH RBP - MOV RBP,RSP - PUSH RSI - MOV RSI,coordinates - FLD U64 [SINE_VAL] - FLDZ - MOV RCX,SAMPLE_SIZE-1 -@@05: XOR RDX,RDX - MOV DX,CX - FILD U32 [RSI+RDX*4] - FMUL ST0,ST2 - FADDP ST1,ST0 - DEC RCX - JGE @@05 - FISTP U64 [RET_VAL] - MOV RAX,U64 [RET_VAL] - FFREE ST0 - FINCSTP - POP RSI - POP RBP - RET -} - -_extern _ASM_FIXED_POINT I64 AsmFixedPt(); -_extern _ASM_FLOAT I64 AsmFloat(); - -U0 Main() -{ - I64 start,end,overhead_time,test_time; - F64 d1,fsum; - I64 reg i,temp,reg d2,reg sum; - - CPURep; - - //Set-up some sample coordinates - for (i=0;i<65536;i++) - coordinates[i]=RandU32; - - //Measure Loop Overhead - start=GetTSC; - for (i=SAMPLE_SIZE-1;i>=0;i--) { - } - end=GetTSC; - overhead_time=end-start; - "$$RED$$Overhead Cycles :%10.5f$$FG$$\n", - ToF64(overhead_time)/SAMPLE_SIZE; - - //Measure F64 arithmetic - // (Some of this is due to crappy - // compiler code.) - d1=Sin(1.0); - fsum=0; - start=GetTSC; - for (i=SAMPLE_SIZE-1;i>=0;i--) - fsum+=d1*coordinates[i&65535]; - end=GetTSC; - test_time=end-start; - "Float Sum :%X\n",ToI64(fsum); - "$$RED$$Float Cycles :%10.5f$$FG$$\n", - ToF64(test_time)/SAMPLE_SIZE; - - //Measure fixed point arithmetic - d2=Sin(1.0)*0x100000000; - sum=0; - start=GetTSC; - for (i=SAMPLE_SIZE-1;i>=0;i--) { - temp=d2*coordinates[i&65535]; - sum+=temp.i32[1]; - } - end=GetTSC; - test_time=end-start; - "Fixed-Point Sum :%X\n",sum; - "$$RED$$Fixed-Point Cycles :%10.5f$$FG$$\n", - ToF64(test_time)/SAMPLE_SIZE; - - //Measure fixed point arithmetic - start=GetTSC; - sum=AsmFixedPt; - end=GetTSC; - test_time=end-start; - "Asm Fixed-Point Sum :%X\n",sum; - "$$RED$$Asm Fixed-Point Cycles:%10.5f$$FG$$\n", - ToF64(test_time)/SAMPLE_SIZE; - - //Measure float arithmetic - start=GetTSC; - sum=AsmFloat; - end=GetTSC; - test_time=end-start; - "Asm Float Sum :%X\n",sum; - "$$RED$$Asm Float Cycles :%10.5f$$FG$$\n", - ToF64(test_time)/SAMPLE_SIZE; - -} - -Main; - -/* Program Output$HL,0$$WW+H,1$$FD,1$ - -Machine 1: -8 Cores 2.660GHz -$FG,4$Overhead Cycles : 2.00814$FG$ -Float Sum :FFFFE1D361BEED68 -$FG,4$Float Cycles : 10.16076$FG$ -Fixed-Point Sum :FFFFE1D361729914 -$FG,4$Fixed-Point Cycles : 5.29392$FG$ -Asm Fixed-Point Sum :FFFFE1D361729914 -$FG,4$Asm Fixed-Point Cycles: 4.20464$FG$ -Asm Float Sum :FFFFE1D361BEED56 -$FG,4$Asm Float Cycles : 3.04635$FG$ - -Machine 2: -8 Cores 3.395GHz -$FG,4$Overhead Cycles : 4.87040$FG$ -Float Sum :D20A01DB177 -$FG,4$Float Cycles : 10.11558$FG$ -Fixed-Point Sum :D209FD18CC7 -$FG,4$Fixed-Point Cycles : 4.50618$FG$ -Asm Fixed-Point Sum :D209FD18CC7 -$FG,4$Asm Fixed-Point Cycles: 3.02426$FG$ -Asm Float Sum :D20A01DB17B -$FG,4$Asm Float Cycles : 3.21070$FG$ - -$HL,1$*/ diff --git a/Demo/Lectures/FixedPointAdvanced.HC b/Demo/Lectures/FixedPointAdvanced.HC new file mode 100644 index 0000000..d3dd3b6 --- /dev/null +++ b/Demo/Lectures/FixedPointAdvanced.HC @@ -0,0 +1,173 @@ +/*"Fixed point" means you use ints +that are scaled by a value. A common +example would be using number of pennies +instead of dollars with a float. + +Fixed-point used to be much faster, +but modern processors do well with +floats. It also depends on the compiler +and my compiler used to do floats poorly. + +I often use 64-bit ints with upper 32-bits +as int and lower 32-bits as fraction. + +See $LK,"::/Demo/SubIntAccess.HC"$ for how +to access upper or lower 32-bits. + +*/ +#define SAMPLE_SIZE 10000000 + +I32 coordinates[65536]; + +asm { +_ASM_FIXED_POINT:: + PUSH RBP + MOV RBP,RSP + PUSH RSI + PUSH RDI + MOV RSI,coordinates + MOV RDI,ToI64(Sin(1.0)*0x100000000) + XOR RBX,RBX //SUM + MOV RCX,SAMPLE_SIZE-1 +@@05: XOR RDX,RDX + MOV DX,CX + MOVSXD RAX,U32 [RSI+RDX*4] + IMUL RDI + SAR RAX,32 + ADD RBX,RAX + DEC RCX + JGE @@05 + MOV RAX,RBX + POP RDI + POP RSI + POP RBP + RET + +SINE_VAL: DU64 Sin(1.0); +RET_VAL: DU64 0; + +_ASM_FLOAT:: + PUSH RBP + MOV RBP,RSP + PUSH RSI + MOV RSI,coordinates + FLD U64 [SINE_VAL] + FLDZ + MOV RCX,SAMPLE_SIZE-1 +@@05: XOR RDX,RDX + MOV DX,CX + FILD U32 [RSI+RDX*4] + FMUL ST0,ST2 + FADDP ST1,ST0 + DEC RCX + JGE @@05 + FISTP U64 [RET_VAL] + MOV RAX,U64 [RET_VAL] + FFREE ST0 + FINCSTP + POP RSI + POP RBP + RET +} + +_extern _ASM_FIXED_POINT I64 AsmFixedPt(); +_extern _ASM_FLOAT I64 AsmFloat(); + +U0 Main() +{ + I64 start,end,overhead_time,test_time; + F64 d1,fsum; + I64 reg i,temp,reg d2,reg sum; + + CPURep; + + //Set-up some sample coordinates + for (i=0;i<65536;i++) + coordinates[i]=RandU32; + + //Measure Loop Overhead + start=GetTSC; + for (i=SAMPLE_SIZE-1;i>=0;i--) { + } + end=GetTSC; + overhead_time=end-start; + "$$RED$$Overhead Cycles :%10.5f$$FG$$\n", + ToF64(overhead_time)/SAMPLE_SIZE; + + //Measure F64 arithmetic + // (Some of this is due to crappy + // compiler code.) + d1=Sin(1.0); + fsum=0; + start=GetTSC; + for (i=SAMPLE_SIZE-1;i>=0;i--) + fsum+=d1*coordinates[i&65535]; + end=GetTSC; + test_time=end-start; + "Float Sum :%X\n",ToI64(fsum); + "$$RED$$Float Cycles :%10.5f$$FG$$\n", + ToF64(test_time)/SAMPLE_SIZE; + + //Measure fixed point arithmetic + d2=Sin(1.0)*0x100000000; + sum=0; + start=GetTSC; + for (i=SAMPLE_SIZE-1;i>=0;i--) { + temp=d2*coordinates[i&65535]; + sum+=temp.i32[1]; + } + end=GetTSC; + test_time=end-start; + "Fixed-Point Sum :%X\n",sum; + "$$RED$$Fixed-Point Cycles :%10.5f$$FG$$\n", + ToF64(test_time)/SAMPLE_SIZE; + + //Measure fixed point arithmetic + start=GetTSC; + sum=AsmFixedPt; + end=GetTSC; + test_time=end-start; + "Asm Fixed-Point Sum :%X\n",sum; + "$$RED$$Asm Fixed-Point Cycles:%10.5f$$FG$$\n", + ToF64(test_time)/SAMPLE_SIZE; + + //Measure float arithmetic + start=GetTSC; + sum=AsmFloat; + end=GetTSC; + test_time=end-start; + "Asm Float Sum :%X\n",sum; + "$$RED$$Asm Float Cycles :%10.5f$$FG$$\n", + ToF64(test_time)/SAMPLE_SIZE; + +} + +Main; + +/* Program Output$HL,0$$WW+H,1$$FD,1$ + +Machine 1: +8 Cores 2.660GHz +$FG,4$Overhead Cycles : 2.00814$FG$ +Float Sum :FFFFE1D361BEED68 +$FG,4$Float Cycles : 10.16076$FG$ +Fixed-Point Sum :FFFFE1D361729914 +$FG,4$Fixed-Point Cycles : 5.29392$FG$ +Asm Fixed-Point Sum :FFFFE1D361729914 +$FG,4$Asm Fixed-Point Cycles: 4.20464$FG$ +Asm Float Sum :FFFFE1D361BEED56 +$FG,4$Asm Float Cycles : 3.04635$FG$ + +Machine 2: +8 Cores 3.395GHz +$FG,4$Overhead Cycles : 4.87040$FG$ +Float Sum :D20A01DB177 +$FG,4$Float Cycles : 10.11558$FG$ +Fixed-Point Sum :D209FD18CC7 +$FG,4$Fixed-Point Cycles : 4.50618$FG$ +Asm Fixed-Point Sum :D209FD18CC7 +$FG,4$Asm Fixed-Point Cycles: 3.02426$FG$ +Asm Float Sum :D20A01DB17B +$FG,4$Asm Float Cycles : 3.21070$FG$ + +$HL,1$*/ diff --git a/Demo/Lectures/GraphicsCPULoad.CPP b/Demo/Lectures/GraphicsCPULoad.CPP deleted file mode 100644 index 66eb09a..0000000 --- a/Demo/Lectures/GraphicsCPULoad.CPP +++ /dev/null @@ -1,34 +0,0 @@ -//This is the fastest you can update the whole screen. -//See $LK,"::/Demo/Lectures/MiniGrLib.CPP"$ if this interests you. - -F64 VGAPattern(I64 p) -{//This returns the time to update in seconds. - F64 start=tS; - I64 plane; - for (plane=1;plane<0x10;plane<<=1) { - OutU8(VGAP_IDX,VGAR_MAP_MASK); - OutU8(VGAP_DATA,plane); - MemSetI64(text.vga_alias,p,640*480/64); - } - return tS-start; -} - - -U0 GrDemo() -{ - I64 i; - F64 t; - CPURep; - for (i=0;i<16;i++) { - t=VGAPattern(0x5555555555555555); - "$$GREEN$$Rate:$$RED$$%5.1f FPS$$FG$$" - " $$GREEN$$Load@30Hz:$$RED$$%5.1f%%$$FG$$\n",1/t,100*t*30.0; - t=VGAPattern(0x3333333333333333); - "$$GREEN$$Rate:$$RED$$%5.1f FPS$$FG$$" - " $$GREEN$$Load@30Hz:$$RED$$%5.1f%%$$FG$$\n",1/t,100*t*30.0; - } -// will flush screen VGA cache. - VGAFlush; -} - -GrDemo; diff --git a/Demo/Lectures/GraphicsCPULoad.HC b/Demo/Lectures/GraphicsCPULoad.HC new file mode 100644 index 0000000..b8ae22b --- /dev/null +++ b/Demo/Lectures/GraphicsCPULoad.HC @@ -0,0 +1,34 @@ +//This is the fastest you can update the whole screen. +//See $LK,"::/Demo/Lectures/MiniGrLib.HC"$ if this interests you. + +F64 VGAPattern(I64 p) +{//This returns the time to update in seconds. + F64 start=tS; + I64 plane; + for (plane=1;plane<0x10;plane<<=1) { + OutU8(VGAP_IDX,VGAR_MAP_MASK); + OutU8(VGAP_DATA,plane); + MemSetI64(text.vga_alias,p,640*480/64); + } + return tS-start; +} + + +U0 GrDemo() +{ + I64 i; + F64 t; + CPURep; + for (i=0;i<16;i++) { + t=VGAPattern(0x5555555555555555); + "$$GREEN$$Rate:$$RED$$%5.1f FPS$$FG$$" + " $$GREEN$$Load@30Hz:$$RED$$%5.1f%%$$FG$$\n",1/t,100*t*30.0; + t=VGAPattern(0x3333333333333333); + "$$GREEN$$Rate:$$RED$$%5.1f FPS$$FG$$" + " $$GREEN$$Load@30Hz:$$RED$$%5.1f%%$$FG$$\n",1/t,100*t*30.0; + } +// will flush screen VGA cache. + VGAFlush; +} + +GrDemo; diff --git a/Demo/Lectures/InterruptDemo.CPP b/Demo/Lectures/InterruptDemo.HC similarity index 100% rename from Demo/Lectures/InterruptDemo.CPP rename to Demo/Lectures/InterruptDemo.HC diff --git a/Demo/Lectures/Mem/Mem2Meg.CPP b/Demo/Lectures/Mem/Mem2Meg.CPP deleted file mode 100644 index 3fe902d..0000000 --- a/Demo/Lectures/Mem/Mem2Meg.CPP +++ /dev/null @@ -1,202 +0,0 @@ -//This file is required by $LK,"::/Demo/Lectures/Mem/Uncached.CPP"$. - -U8 *Mem2MegAlloc(I64 *_pages2Meg,CBlkPool *bp=NULL) -{/*Alloc 2Meg pages from BlkPool. Don't link to task. -(Linking to a task means they will be freed when the task dies.) -It might give you more than you asked for -so a ptr to a page count is passed. - -Return: NULL if out of memory. -*/ - I64 i,j,*pte,num=*_pages2Meg; - CMemBlk *res=NULL,*m,*m1; - - if (!bp) bp=sys_code_bp; - PUSHFD - CLI - while (LBts(&bp->locked_flags,BPlf_LOCKED)) - PAUSE - num<<=21-MEM_PAGE_BITS; - - m=&bp->mem_free_2meg_lst; - while (TRUE) { - if (!(res=m->next)) - break; - if (res->pagespages==num) { - m->next=res->next; - goto am_done; - } else { - res->pages-=num; - res(U8 *)+=res->pages<pages=num; - goto am_done; - } - } - } - - m=&bp->mem_free_lst; - while (TRUE) { - if (!(res=m->next)) { - num=0; - res=NULL; //Out of memory - goto am_done; - } - if (res->pagespages==num) { - if (res(U8 *)&0x1FFFFF) - m=res; - else { - m->next=res->next; - goto am_done; - } - } else { - if (i=(res(U8 *)&0x1FFFFF)>>MEM_PAGE_BITS) { - j=1<<(21-MEM_PAGE_BITS)-i; - if (res->pagespages==num+j) { - res->pages-=num; - res(U8 *)+=res->pages<pages=num; - goto am_done; - } else { - m1=res; - res(U8 *)+=j<pages=num; - m=res(U8 *)+num<pages=m1->pages-num-j; - m1->pages=j; - m->next=m1->next; - m1->next=m; - m->mb_signature=MBS_UNUSED_SIGNATURE_VAL; - goto am_done; - } - } else { - m=m->next=res(U8 *)+num<next=res->next; - m->pages=res->pages-num; - m->mb_signature=MBS_UNUSED_SIGNATURE_VAL; - res->pages=num; - goto am_done; - } - } - } - } -am_done: - i=num<used_u8s+=i; - num>>=21-MEM_PAGE_BITS; - *_pages2Meg=num; - m=res; - m1=m(U8 *)+i; - while (mlocked_flags,BPlf_LOCKED); - POPFD - return res; -} - -U8 *Mem2MegUncachedAlloc(I64 *_pages2Meg,CBlkPool *bp=NULL) -{/*Alloc 2Meg pages from BlkPool. Don't link to task. -(Linking to a task means they will be freed when the task dies.) -It will be marked uncached. It might give you more than you asked for -so a ptr to a page count is passed. - -Return: NULL if out of memory. -*/ - CMemBlk *res,*m,*m1; - I64 num=*_pages2Meg,*pte; - if (res=Mem2MegAlloc(_pages2Meg,bp)) { - num=*_pages2Meg; - m=res; - m1=m(U8 *)+num<<21; - while (mlocked_flags,BPlf_LOCKED)) - PAUSE - m->mb_signature=MBS_UNUSED_SIGNATURE_VAL; - m->pages=pages2Meg<<(21-MEM_PAGE_BITS); - bp->used_u8s-=pages2Meg<<21; - m->next=bp->mem_free_2meg_lst; - bp->mem_free_2meg_lst=m; - LBtr(&bp->locked_flags,BPlf_LOCKED); - POPFD - } -} - -CHeapCtrl *HeapCtrlBPInit(CBlkPool *bp,I64 pages512) -{//Make mem chunk into HeapCtrl and BlkPool. - I64 num; - CMemBlk *m; - CHeapCtrl *hc; - MemSet(bp,0,sizeof(CBlkPool)+sizeof(CHeapCtrl)); - hc=HeapCtrlInit(bp(U8 *)+sizeof(CBlkPool),,bp); - m=(bp(U8 *)+sizeof(CBlkPool)+sizeof(CHeapCtrl)+MEM_PAGE_SIZE-1)& - ~(MEM_PAGE_SIZE-1); - num=(bp(U8 *)+pages512<>MEM_PAGE_BITS; - bp->alloced_u8s=(pages512-num)<locked_flags,BPlf_LOCKED)) + PAUSE + num<<=21-MEM_PAGE_BITS; + + m=&bp->mem_free_2meg_lst; + while (TRUE) { + if (!(res=m->next)) + break; + if (res->pagespages==num) { + m->next=res->next; + goto am_done; + } else { + res->pages-=num; + res(U8 *)+=res->pages<pages=num; + goto am_done; + } + } + } + + m=&bp->mem_free_lst; + while (TRUE) { + if (!(res=m->next)) { + num=0; + res=NULL; //Out of memory + goto am_done; + } + if (res->pagespages==num) { + if (res(U8 *)&0x1FFFFF) + m=res; + else { + m->next=res->next; + goto am_done; + } + } else { + if (i=(res(U8 *)&0x1FFFFF)>>MEM_PAGE_BITS) { + j=1<<(21-MEM_PAGE_BITS)-i; + if (res->pagespages==num+j) { + res->pages-=num; + res(U8 *)+=res->pages<pages=num; + goto am_done; + } else { + m1=res; + res(U8 *)+=j<pages=num; + m=res(U8 *)+num<pages=m1->pages-num-j; + m1->pages=j; + m->next=m1->next; + m1->next=m; + m->mb_signature=MBS_UNUSED_SIGNATURE_VAL; + goto am_done; + } + } else { + m=m->next=res(U8 *)+num<next=res->next; + m->pages=res->pages-num; + m->mb_signature=MBS_UNUSED_SIGNATURE_VAL; + res->pages=num; + goto am_done; + } + } + } + } +am_done: + i=num<used_u8s+=i; + num>>=21-MEM_PAGE_BITS; + *_pages2Meg=num; + m=res; + m1=m(U8 *)+i; + while (mlocked_flags,BPlf_LOCKED); + POPFD + return res; +} + +U8 *Mem2MegUncachedAlloc(I64 *_pages2Meg,CBlkPool *bp=NULL) +{/*Alloc 2Meg pages from BlkPool. Don't link to task. +(Linking to a task means they will be freed when the task dies.) +It will be marked uncached. It might give you more than you asked for +so a ptr to a page count is passed. + +Return: NULL if out of memory. +*/ + CMemBlk *res,*m,*m1; + I64 num=*_pages2Meg,*pte; + if (res=Mem2MegAlloc(_pages2Meg,bp)) { + num=*_pages2Meg; + m=res; + m1=m(U8 *)+num<<21; + while (mlocked_flags,BPlf_LOCKED)) + PAUSE + m->mb_signature=MBS_UNUSED_SIGNATURE_VAL; + m->pages=pages2Meg<<(21-MEM_PAGE_BITS); + bp->used_u8s-=pages2Meg<<21; + m->next=bp->mem_free_2meg_lst; + bp->mem_free_2meg_lst=m; + LBtr(&bp->locked_flags,BPlf_LOCKED); + POPFD + } +} + +CHeapCtrl *HeapCtrlBPInit(CBlkPool *bp,I64 pages512) +{//Make mem chunk into HeapCtrl and BlkPool. + I64 num; + CMemBlk *m; + CHeapCtrl *hc; + MemSet(bp,0,sizeof(CBlkPool)+sizeof(CHeapCtrl)); + hc=HeapCtrlInit(bp(U8 *)+sizeof(CBlkPool),,bp); + m=(bp(U8 *)+sizeof(CBlkPool)+sizeof(CHeapCtrl)+MEM_PAGE_SIZE-1)& + ~(MEM_PAGE_SIZE-1); + num=(bp(U8 *)+pages512<>MEM_PAGE_BITS; + bp->alloced_u8s=(pages512-num)<code_heap); - - while (TRUE) { - "This will compile an expression\n" - "consisting of ints, parentheses\n" - "and the operators +,-,* and /.\n"; - src=GetStr; - if (*src) { - src2=src; - dst=code; - try { - PrsTerm(&src2,&dst,PREC_PAREN); - if (Parse(&src2,&dst)!=PREC_EOF) - throw; - "$$RED$$This code is not efficient, but the compiler is simple.$$FG$$\n"; - Un(code,dst-code); //Unassemble the code we created. -//$LK,"Call",A="MN:Call"$() is a function. See $LK,"_CALL",A="FF:::/Kernel/KUtils.CPP,_CALL"$:: - //See also $LK,"CallInd",A="MN:CallInd"$(). See $LK,"_CALL_IND",A="FF:::/Kernel/KUtils.CPP,_CALL_IND"$:: - "$$LTBLUE$$Answer:%d$$FG$$\n",Call(code); - } catch { - "$$RED$$Error$$FG$$\n"; - PutExcept; - } - Free(src); - } else { - Free(src); - break; - } - } - Free(code); -} - -Main; - diff --git a/Demo/Lectures/MiniCompiler.HC b/Demo/Lectures/MiniCompiler.HC new file mode 100644 index 0000000..287f4a0 --- /dev/null +++ b/Demo/Lectures/MiniCompiler.HC @@ -0,0 +1,236 @@ +/*$WW,1$ +$TR-C,"Main Compiler"$ +$ID,2$The mini compiler is like the main compiler, except the main compiler's lexical analyser removes comments and does preprocessing. $LK,"Lex",A="MN:Lex"$(),$LK,"Echo",A="MN:Echo"$(ON). + +The main compiler generates $LK,"Intermediate Code",A="FF:::/Compiler/CompilerA.HH,IC_END"$ at the parser stage. See $LK,"PrsExpression",A="MN:PrsExpression"$(), $LK,"PrsStmt",A="MN:PrsStmt"$(). + +The main compiler optimizes See $LK,"Intermediate Code Attributes",A="MN:intermediate_code_table"$, $LK,"Combining Consts",A="FF:::/Compiler/OptPass012.HC,case IC_MUL"$, $LK,"Choosing Reg Vars",A="FF:::/Compiler/OptPass3.HC,cmp.num_reg_vars"$. Use $LK,"PassTrace",A="MN:PassTrace"$() to see the optimization stages. + +The main compiler makes machine code in the back end. See $LK,"IC Struct",A="MN:CIntermediateCode"$, $LK,"COCCompile",A="MN:COCCompile"$ and $LK,"OptPass789A",A="FF:::/Compiler/OptPass789A.HC,IC_MUL"$(), $LK,"BackEnd",A="FF:::/Compiler/BackA.HC,ICMul"$. Set $LK,"Trace",A="MN:Trace"$(ON) to see the output of the backend. +$ID,-2$ +$TR,"Mini Compiler"$ +$ID,2$For this mini compiler, some things you should know about 64-bit asm: + +* Putting a 0x48, known as the REX byte, in front of an inst makes it 64-bit size. + +* "PUSH EAX", "POP EAX" and "XOR EAX,EAX" will behave as 64-bit even without REX because the stk is always 64 bit and because the XOR clears the upper 32-bits. + +It is okay in TempleOS to change RAX, RBX, RCX, RDX, R8 and R9 without restoring them to their original values. +$ID,-2$$WW,0$*/ + +#define TK_EOF 0 +#define TK_NUM 1 +#define TK_OP 2 +#define TK_LEFT 3 +#define TK_RIGHT 4 + +#define OP_MUL 1 +#define OP_DIV 2 +#define OP_ADD 3 +#define OP_SUB 4 + +I64 Lex(U8 **_src,I64 *num) +{//See $LK,"Lex",A="MN:Lex"$(). + U8 *src=*_src; + I64 i; + while (TRUE) { + switch (*src) { + case 0: + case ';': + *_src=src; + return TK_EOF; + case CH_SPACE: + case '\r': + case '\n': + src++; + break; + case '0'...'9': + i=0; + do { + i=i*10+*src-'0'; + src++; + } while ('0'<=*src<='9'); + *num=i; + *_src=src; + return TK_NUM; + case '*': + *num=OP_MUL; + *_src=src+1; + return TK_OP; + case '/': + *num=OP_DIV; + *_src=src+1; + return TK_OP; + case '+': + *num=OP_ADD; + *_src=src+1; + return TK_OP; + case '-': + *num=OP_SUB; + *_src=src+1; + return TK_OP; + case '(': + *_src=src+1; + return TK_LEFT; + case ')': + *_src=src+1; + return TK_RIGHT; + default: + throw; + } + } +} + +#define PREC_EOF 0 +#define PREC_TERM 1 +#define PREC_MUL 2 +#define PREC_ADD 3 +#define PREC_PAREN 4 + +extern I64 Parse(U8 **_src,U8 **_dst); + +U0 PrsTerm(U8 **_src,U8 **_dst,I64 prec) +{//See $LK,"PrsExpression",A="MN:PrsExpression"$(). + I64 i; + U8 *src2; + U8 *dst2; + if (Parse(_src,_dst)==PREC_TERM) { + src2=*_src; + dst2=*_dst; + while (TRUE) { +//This is inefficient. The main compiler doesn't back-up. + i=Parse(&src2,&dst2); + if (PREC_MUL<=icode_heap); + + while (TRUE) { + "This will compile an expression\n" + "consisting of ints, parentheses\n" + "and the operators +,-,* and /.\n"; + src=GetStr; + if (*src) { + src2=src; + dst=code; + try { + PrsTerm(&src2,&dst,PREC_PAREN); + if (Parse(&src2,&dst)!=PREC_EOF) + throw; + "$$RED$$This code is not efficient, but the compiler is simple.$$FG$$\n"; + Un(code,dst-code); //Unassemble the code we created. +//$LK,"Call",A="MN:Call"$() is a function. See $LK,"_CALL",A="FF:::/Kernel/KUtils.HC,_CALL"$:: + //See also $LK,"CallInd",A="MN:CallInd"$(). See $LK,"_CALL_IND",A="FF:::/Kernel/KUtils.HC,_CALL_IND"$:: + "$$LTBLUE$$Answer:%d$$FG$$\n",Call(code); + } catch { + "$$RED$$Error$$FG$$\n"; + PutExcept; + } + Free(src); + } else { + Free(src); + break; + } + } + Free(code); +} + +Main; + diff --git a/Demo/Lectures/MiniGrLib.CPP b/Demo/Lectures/MiniGrLib.CPP deleted file mode 100644 index 2caa382..0000000 --- a/Demo/Lectures/MiniGrLib.CPP +++ /dev/null @@ -1,132 +0,0 @@ -//See $LK,"::/Demo/Lectures/GraphicsCPULoad.CPP"$ -U8 rev[256], //The VGA bits are bwd - - image[640*480/8]; //We need read-modify write. - //0xA0000 alias memory can't be read. - -U0 MGInit() -{ - I64 i,j; - MemSet(image,0,sizeof(image)); - MemSet(rev,0,sizeof(rev)); - for (i=0;i<256;i++) - for (j=0;j<8;j++) - if (Bt(&i,j)) - Bts(&rev[i],7-j); -} - -U0 MGUpdate() -{//Copy image to VGA memory -//For better performance we could only write what's changed. - //0xA0000 alias is slower than normal RAM. - OutU8(VGAP_IDX,VGAR_MAP_MASK); - OutU8(VGAP_DATA,0xF);//All color planes at once -- Black and White - MemCpy(text.vga_alias,image,sizeof(image)); //Alias of 0xA0000 -} - -U0 MGPlot(I64 x,I64 y) -{ - if (0<=x<640 && 0<=y<480) - Bts(image,y*640+x^7); -} - -U0 MGHLine(I64 x1,I64 x2,I64 y) -{//Warning! No clipping -//For performance, we do as many whole-bytes as possible. - U8 *ptr; - I64 i,w,leading,trailing,whole_bytes; - if (x2>3; - w=x2-x1+1; - leading =8-x1&7; - trailing=(x2+1)&7; - if (leading+trailing>w) - *ptr|=rev[(0xFF00>>leading&(0x00FF<>8)]; - else { - whole_bytes=(w-leading-trailing)>>3; - if (leading) - *ptr++|=rev[(0xFF00>>leading)&0xFF]; - for (i=0;i>8]; - } -} - -U0 MGLine(I64 x1,I64 y1,I64 x2,I64 y2) -{//Warning! No clipping - I64 dx=x2-x1,dy=y2-y1; - x1<<=32; x2<<=32; - y1<<=32; y2<<=32; - if (AbsI64(dx)>AbsI64(dy)) { - dy=dy<<32/AbsI64(dx); - dx=SignI64(dx)<<32; - while (x1!=x2) { - MGPlot(x1.i32[1],y1.i32[1]); - x1+=dx; y1+=dy; - } - } else { - dx=dx<<32/AbsI64(dy); - dy=SignI64(dy)<<32; - while (y1!=y2) { - MGPlot(x1.i32[1],y1.i32[1]); - x1+=dx; y1+=dy; - } - } - MGPlot(x1.i32[1],y1.i32[1]); -} - -U0 MGCircle(I64 x,I64 y,F64 r) -{ - F64 s,c,x1,y1,x2,y2; - I64 len; - if (r<0) return; - x1=r; y1=0; - c=Cos(1/r); - s=Sin(1/r); - len=2*r*ã; - MGPlot(x+x1,y+y1); - while (len-->=0) { - - //m1@a1 * m2@a2 = m1*m2@(a1+a2) - - //(x1+y1i)*(x2+y2i) = x1*x2+(x1*y1+x2*y2)i-y1*y2 - - // me$SY,-3$ti$SY,0$=mCos(t)+imSin(t) - - x2=x1; y2=y1; - x1=c*x2-s*y2; - y1=s*x2+c*y2; - MGPlot(x+x1,y+y1); - } -} - - -U0 MiniGrLibDemo() -{ - I64 i; - MGInit; - - for (i=0;i<100;i++) - MGHLine(200+i,400+i,300+i); - for (i=0;i<500;i+=10) - MGLine(i,0,0,480-i); - for (i=0;i<300;i+=4) - MGCircle(200,100+i,i); - MGUpdate; - BusyWait(1500000); -/* -We are returning graphics to normal operations under TempleOS. -It is not normal to by-pass the TempleOS graphcis routines. -The TempleOS graphics don't know VGA has changed. -This bit tells TempleOS to update whole screen. -*/ - // will flush screen VGA cache. - VGAFlush; -} - -MiniGrLibDemo; - -//See $LK,"RawPutChar",A="MN:RawPutChar"$() for text. -//See $LK,"::/Demo/Lectures/ScreenMemory.CPP"$ for color. -//See $LK,"::/Demo/Lectures/GraphicsCPULoad.CPP"$. diff --git a/Demo/Lectures/MiniGrLib.HC b/Demo/Lectures/MiniGrLib.HC new file mode 100644 index 0000000..af89452 --- /dev/null +++ b/Demo/Lectures/MiniGrLib.HC @@ -0,0 +1,132 @@ +//See $LK,"::/Demo/Lectures/GraphicsCPULoad.HC"$ +U8 rev[256], //The VGA bits are bwd + + image[640*480/8]; //We need read-modify write. + //0xA0000 alias memory can't be read. + +U0 MGInit() +{ + I64 i,j; + MemSet(image,0,sizeof(image)); + MemSet(rev,0,sizeof(rev)); + for (i=0;i<256;i++) + for (j=0;j<8;j++) + if (Bt(&i,j)) + Bts(&rev[i],7-j); +} + +U0 MGUpdate() +{//Copy image to VGA memory +//For better performance we could only write what's changed. + //0xA0000 alias is slower than normal RAM. + OutU8(VGAP_IDX,VGAR_MAP_MASK); + OutU8(VGAP_DATA,0xF);//All color planes at once -- Black and White + MemCpy(text.vga_alias,image,sizeof(image)); //Alias of 0xA0000 +} + +U0 MGPlot(I64 x,I64 y) +{ + if (0<=x<640 && 0<=y<480) + Bts(image,y*640+x^7); +} + +U0 MGHLine(I64 x1,I64 x2,I64 y) +{//Warning! No clipping +//For performance, we do as many whole-bytes as possible. + U8 *ptr; + I64 i,w,leading,trailing,whole_bytes; + if (x2>3; + w=x2-x1+1; + leading =8-x1&7; + trailing=(x2+1)&7; + if (leading+trailing>w) + *ptr|=rev[(0xFF00>>leading&(0x00FF<>8)]; + else { + whole_bytes=(w-leading-trailing)>>3; + if (leading) + *ptr++|=rev[(0xFF00>>leading)&0xFF]; + for (i=0;i>8]; + } +} + +U0 MGLine(I64 x1,I64 y1,I64 x2,I64 y2) +{//Warning! No clipping + I64 dx=x2-x1,dy=y2-y1; + x1<<=32; x2<<=32; + y1<<=32; y2<<=32; + if (AbsI64(dx)>AbsI64(dy)) { + dy=dy<<32/AbsI64(dx); + dx=SignI64(dx)<<32; + while (x1!=x2) { + MGPlot(x1.i32[1],y1.i32[1]); + x1+=dx; y1+=dy; + } + } else { + dx=dx<<32/AbsI64(dy); + dy=SignI64(dy)<<32; + while (y1!=y2) { + MGPlot(x1.i32[1],y1.i32[1]); + x1+=dx; y1+=dy; + } + } + MGPlot(x1.i32[1],y1.i32[1]); +} + +U0 MGCircle(I64 x,I64 y,F64 r) +{ + F64 s,c,x1,y1,x2,y2; + I64 len; + if (r<0) return; + x1=r; y1=0; + c=Cos(1/r); + s=Sin(1/r); + len=2*r*ã; + MGPlot(x+x1,y+y1); + while (len-->=0) { + + //m1@a1 * m2@a2 = m1*m2@(a1+a2) + + //(x1+y1i)*(x2+y2i) = x1*x2+(x1*y1+x2*y2)i-y1*y2 + + // me$SY,-3$ti$SY,0$=mCos(t)+imSin(t) + + x2=x1; y2=y1; + x1=c*x2-s*y2; + y1=s*x2+c*y2; + MGPlot(x+x1,y+y1); + } +} + + +U0 MiniGrLibDemo() +{ + I64 i; + MGInit; + + for (i=0;i<100;i++) + MGHLine(200+i,400+i,300+i); + for (i=0;i<500;i+=10) + MGLine(i,0,0,480-i); + for (i=0;i<300;i+=4) + MGCircle(200,100+i,i); + MGUpdate; + BusyWait(1500000); +/* +We are returning graphics to normal operations under TempleOS. +It is not normal to by-pass the TempleOS graphcis routines. +The TempleOS graphics don't know VGA has changed. +This bit tells TempleOS to update whole screen. +*/ + // will flush screen VGA cache. + VGAFlush; +} + +MiniGrLibDemo; + +//See $LK,"RawPutChar",A="MN:RawPutChar"$() for text. +//See $LK,"::/Demo/Lectures/ScreenMemory.HC"$ for color. +//See $LK,"::/Demo/Lectures/GraphicsCPULoad.HC"$. diff --git a/Demo/Lectures/NegDisp.CPP b/Demo/Lectures/NegDisp.HC similarity index 100% rename from Demo/Lectures/NegDisp.CPP rename to Demo/Lectures/NegDisp.HC diff --git a/Demo/Lectures/Optimization.CPP b/Demo/Lectures/Optimization.HC similarity index 100% rename from Demo/Lectures/Optimization.CPP rename to Demo/Lectures/Optimization.HC diff --git a/Demo/Lectures/PCIInterrupts.CPP b/Demo/Lectures/PCIInterrupts.HC similarity index 100% rename from Demo/Lectures/PCIInterrupts.CPP rename to Demo/Lectures/PCIInterrupts.HC diff --git a/Demo/Lectures/Ring3.CPP b/Demo/Lectures/Ring3.CPP deleted file mode 100644 index 88791a9..0000000 --- a/Demo/Lectures/Ring3.CPP +++ /dev/null @@ -1,75 +0,0 @@ -/*TempleOS runs exclusively in ring 0. -Ring 0 is part of the $LK,"Charter",A="FI:::/Doc/Charter.TXT"$. -This demo is for you to play around -with ring 3. TempleOS is for -recreational programming, after all. - -This redirects the general protection -fault, switches to ring 3, and generates -a fault to switch back. -*/ - -U8 *old_stk,*new_rip; - -asm { -INT_TO_RING0:: //Set to handle general protection 0xD fault temporarily. - INC U64 [SYS_PROGRESS1] - PUSH U32 CGDT.ds //STKSEG - MOV RAX,U64 [&old_stk] - PUSH RAX - PUSH U32 0 //FLAGS--interrupts off - PUSH U32 CGDT.cs64 - MOV RAX,U64 [&new_rip] - PUSH RAX - IRET -} - -U0 Ring3Demo() -{ - U8 *old_vect; - "Progress1 Before:%X\n",progress1; - CLI - old_vect=IntEntrySet(0x0D,INT_TO_RING0,IDTET_TRAP,0); - - TSSBusy(Gs->tss->tr_ring3,OFF); - SetRAX(Gs->tss->tr_ring3+3); - LTR AX - - asm { - MOV U64 [&old_stk],RSP - - LEA RAX,[R3_CALLBACK] - MOV U64 [&new_rip],RAX - - MOV AX,CGDT.ds_ring3+3 - MOV DS,AX - MOV ES,AX - - PUSH U32 CGDT.ds_ring3+3 //STKSEG - PUSH U64 [&old_stk] - PUSH U32 0 //FLAGS--interrupts off - PUSH U32 CGDT.cs64_ring3+3 - LEA RAX,[R3_START] - PUSH RAX - IRET - - R3_START: - INC U64 [SYS_PROGRESS1] - CLI //This causes general protection fault #13 - - R3_CALLBACK: - MOV AX,CGDT.ds - MOV DS,AX - MOV ES,AX - } - - TSSBusy(Gs->tss->tr,OFF); - SetRAX(Gs->tss->tr); - LTR AX - - IntEntrySet(0x0D,old_vect,IDTET_IRQ,0); - STI - "Progress1 After :%X\n",progress1; -} - -Ring3Demo; diff --git a/Demo/Lectures/Ring3.HC b/Demo/Lectures/Ring3.HC new file mode 100644 index 0000000..25a5a13 --- /dev/null +++ b/Demo/Lectures/Ring3.HC @@ -0,0 +1,75 @@ +/*TempleOS runs exclusively in ring 0. +Ring 0 is part of the $LK,"Charter",A="FI:::/Doc/Charter.DD"$. +This demo is for you to play around +with ring 3. TempleOS is for +recreational programming, after all. + +This redirects the general protection +fault, switches to ring 3, and generates +a fault to switch back. +*/ + +U8 *old_stk,*new_rip; + +asm { +INT_TO_RING0:: //Set to handle general protection 0xD fault temporarily. + INC U64 [SYS_PROGRESS1] + PUSH U32 CGDT.ds //STKSEG + MOV RAX,U64 [&old_stk] + PUSH RAX + PUSH U32 0 //FLAGS--interrupts off + PUSH U32 CGDT.cs64 + MOV RAX,U64 [&new_rip] + PUSH RAX + IRET +} + +U0 Ring3Demo() +{ + U8 *old_vect; + "Progress1 Before:%X\n",progress1; + CLI + old_vect=IntEntrySet(0x0D,INT_TO_RING0,IDTET_TRAP,0); + + TSSBusy(Gs->tss->tr_ring3,OFF); + SetRAX(Gs->tss->tr_ring3+3); + LTR AX + + asm { + MOV U64 [&old_stk],RSP + + LEA RAX,[R3_CALLBACK] + MOV U64 [&new_rip],RAX + + MOV AX,CGDT.ds_ring3+3 + MOV DS,AX + MOV ES,AX + + PUSH U32 CGDT.ds_ring3+3 //STKSEG + PUSH U64 [&old_stk] + PUSH U32 0 //FLAGS--interrupts off + PUSH U32 CGDT.cs64_ring3+3 + LEA RAX,[R3_START] + PUSH RAX + IRET + + R3_START: + INC U64 [SYS_PROGRESS1] + CLI //This causes general protection fault #13 + + R3_CALLBACK: + MOV AX,CGDT.ds + MOV DS,AX + MOV ES,AX + } + + TSSBusy(Gs->tss->tr,OFF); + SetRAX(Gs->tss->tr); + LTR AX + + IntEntrySet(0x0D,old_vect,IDTET_IRQ,0); + STI + "Progress1 After :%X\n",progress1; +} + +Ring3Demo; diff --git a/Demo/Lectures/ScreenMemory.CPP b/Demo/Lectures/ScreenMemory.CPP deleted file mode 100644 index dafe127..0000000 --- a/Demo/Lectures/ScreenMemory.CPP +++ /dev/null @@ -1,49 +0,0 @@ -//This just shows how screen memory works. -//See $LK,"::/Demo/Lectures/MiniGrLib.CPP"$ - -U0 PlotXY(I64 x,I64 y) -{ -//Screen bits are revd - LBts(text.vga_alias,y*GR_WIDTH+x^7); -} - -U0 Main() -{ - I64 i; - //This makes all 4 color planes active. - OutU8(VGAP_IDX,VGAR_MAP_MASK); - OutU8(VGAP_DATA,WHITE); - MemSet(text.vga_alias,0,GR_WIDTH*GR_HEIGHT/8); - - OutU8(VGAP_IDX,VGAR_MAP_MASK); - OutU8(VGAP_DATA,RED); - for (i=0;i<200;i++) - PlotXY(i,i); - - OutU8(VGAP_IDX,VGAR_MAP_MASK); - OutU8(VGAP_DATA,GREEN); - for (i=0;i<200;i++) - PlotXY(100,i); - - OutU8(VGAP_IDX,VGAR_MAP_MASK); - OutU8(VGAP_DATA,BLUE); - for (i=0;i<200;i++) - PlotXY(200-i,i); -/*If you want a mixed color sel multiple planes -but you have to be sure the unseled planes -are zero, so sel them and make them zero. -You can't do reads on VGA memory, by the way. -That means no read-modify-writes, too. -*/ - BusyWait(4000000); - - //TempleOS has a 4 plane memory duplicate of the screen, $LK,"gr.screen_image",A="MN:CGrGlbls"$, - //and only writes actual changes. See $LK,"GrUpdateVGAGraphics",A="MN:GrUpdateVGAGraphics"$(). - // will flush screen VGA cache. - VGAFlush; -} - -Main; - -//See $LK,"::/Demo/Lectures/GraphicsCPULoad.CPP"$. - diff --git a/Demo/Lectures/ScreenMemory.HC b/Demo/Lectures/ScreenMemory.HC new file mode 100644 index 0000000..64eea69 --- /dev/null +++ b/Demo/Lectures/ScreenMemory.HC @@ -0,0 +1,49 @@ +//This just shows how screen memory works. +//See $LK,"::/Demo/Lectures/MiniGrLib.HC"$ + +U0 PlotXY(I64 x,I64 y) +{ +//Screen bits are revd + LBts(text.vga_alias,y*GR_WIDTH+x^7); +} + +U0 Main() +{ + I64 i; + //This makes all 4 color planes active. + OutU8(VGAP_IDX,VGAR_MAP_MASK); + OutU8(VGAP_DATA,WHITE); + MemSet(text.vga_alias,0,GR_WIDTH*GR_HEIGHT/8); + + OutU8(VGAP_IDX,VGAR_MAP_MASK); + OutU8(VGAP_DATA,RED); + for (i=0;i<200;i++) + PlotXY(i,i); + + OutU8(VGAP_IDX,VGAR_MAP_MASK); + OutU8(VGAP_DATA,GREEN); + for (i=0;i<200;i++) + PlotXY(100,i); + + OutU8(VGAP_IDX,VGAR_MAP_MASK); + OutU8(VGAP_DATA,BLUE); + for (i=0;i<200;i++) + PlotXY(200-i,i); +/*If you want a mixed color sel multiple planes +but you have to be sure the unseled planes +are zero, so sel them and make them zero. +You can't do reads on VGA memory, by the way. +That means no read-modify-writes, too. +*/ + BusyWait(4000000); + + //TempleOS has a 4 plane memory duplicate of the screen, $LK,"gr.screen_image",A="MN:CGrGlbls"$, + //and only writes actual changes. See $LK,"GrUpdateVGAGraphics",A="MN:GrUpdateVGAGraphics"$(). + // will flush screen VGA cache. + VGAFlush; +} + +Main; + +//See $LK,"::/Demo/Lectures/GraphicsCPULoad.HC"$. + diff --git a/Demo/MagicPairs.CPP b/Demo/MagicPairs.CPP deleted file mode 100644 index d7ea659..0000000 --- a/Demo/MagicPairs.CPP +++ /dev/null @@ -1,734 +0,0 @@ -/*The magic pairs problem: - -Let SumFact(n) be the sum of factors -of n. - -Find all n1,n2 in a range such that - -SumFact(n1)-n1-1==n2 and -SumFact(n2)-n2-1==n1 - ------------------------------------------------------ -To find SumFact(k), start with prime factorization: - -k=(p1^n1)(p2^n2) ... (pN^nN) - -THEN, - -SumFact(k)=(1+p1+p1^2...p1^n1)*(1+p2+p2^2...p2^n2)* -(1+pN+pN^2...pN^nN) - -PROOF: - -Do a couple examples -- it's obvious: - -48=2^4*3 - -SumFact(48)=(1+2+4+8+16)*(1+3)=1+2+4+8+16+3+6+12+24+48 - -75=3*5^2 - -SumFact(75)=(1+3)*(1+5+25) =1+5+25+3+15+75 - -Corollary: - -SumFact(k)=SumFact(p1^n1)*SumFact(p2^n2)*...*SumFact(pN^nN) - -*/ - -//Primes are needed to sqrt(N). Therefore, we can use U32. -class PowPrime -{ - I64 n; - I64 sumfact; //Sumfacts for powers of primes are needed beyond sqrt(N) -}; - -class Prime -{ - U32 prime,pow_cnt; - PowPrime *pp; -}; - -I64 *PrimesNew(I64 N,I64 *_sqrt_primes,I64 *_cbrt_primes) -{ - I64 i,j,sqrt=Ceil(Sqrt(N)),cbrt=Ceil(N`(1/3.0)),sqrt_sqrt=Ceil(Sqrt(sqrt)), - sqrt_primes=0,cbrt_primes=0; - U8 *s=CAlloc((sqrt+1+7)/8); - Prime *primes,*p; - - for (i=2;i<=sqrt_sqrt;i++) { - if (!Bt(s,i)) { - j=i*2; - while (j<=sqrt) { - Bts(s,j); - j+=i; - } - } - } - for (i=2;i<=sqrt;i++) - if (!Bt(s,i)) { - sqrt_primes++; //Count primes - if (i<=cbrt) - cbrt_primes++; - } - - p=primes=CAlloc(sqrt_primes*sizeof(Prime)); - for (i=2;i<=sqrt;i++) - if (!Bt(s,i)) { - p->prime=i; - p++; - } - Free(s); - - *_sqrt_primes=sqrt_primes; - *_cbrt_primes=cbrt_primes; - return primes; -} - -PowPrime *PowPrimesNew(I64 N,I64 sqrt_primes,Prime *primes,I64 *_num_powprimes) -{ - I64 i,j,k,sf,num_powprimes=0; - Prime *p; - PowPrime *powprimes,*pp; - - p=primes; - for (i=0;iprime)); - p++; - } - - p=primes; - pp=powprimes=MAlloc(num_powprimes*sizeof(PowPrime)); - for (i=0;ipp=pp; - j=p->prime; - k=1; - sf=1; - while (jn=j; - pp->sumfact=sf; - j*=p->prime; - pp++; - p->pow_cnt++; - } - p++; - } - *_num_powprimes=num_powprimes; - return powprimes; -} - -I64 SumFact(I64 n,I64 sqrt_primes,Prime *p) -{ - I64 i,k,sf=1; - PowPrime *pp; - if (n<2) - return 1; - for (i=0;iprime)) { - n/=p->prime; - k++; - } - if (k) { - pp=p->pp+(k-1); - sf*=pp->sumfact; - if (n==1) - return sf; - } - p++; - } - return sf*(1+n); //Prime -} - -Bool TestSumFact(I64 n,I64 target_sf,I64 sqrt_primes,I64 cbrt_primes,Prime *p) -{ - I64 i=0,k,b,x1,x2; - PowPrime *pp; - F64 disc; - if (n<2) - return FALSE; - while (i++prime)) { - n/=p->prime; - k++; - } - if (k) { - pp=p->pp+(k-1); - if (ModU64(&target_sf,pp->sumfact)) - return FALSE; - if (n==1) { - if (target_sf==1) - return TRUE; - else - return FALSE; - } - } - p++; - } -/* At this point we have three possible cases to test -1)n==p1 ->sf==(1+p1) ? -2)n==p1*p1 ->sf==(1+p1+p1^2) ? -3)n==p1*p2 ->sf==(p1+1)*(p2+1) ? - -*/ - if (1+n==target_sf) { - while (i++prime)) { - n/=p->prime; - k++; - } - if (k) { - pp=p->pp+(k-1); - if (ModU64(&target_sf,pp->sumfact)) - return FALSE; - if (n==1) { - if (target_sf==1) - return TRUE; - else - return FALSE; - } - } - p++; - } - if (1+n==target_sf) - return TRUE; - else - return FALSE; - } - - k=Sqrt(n); - if (k*k==n) { - if (1+k+n==target_sf) - return TRUE; - else - return FALSE; - } else { -// n==p1*p2 -> sf==(p1+1)*(p2+1) ? where p1!=1 && p2!=1 - // if p1==1 || p2==1, it is FALSE because we checked a single prime above. - - // sf==(p1+1)*(n/p1+1) - // sf==n+p1+n/p1+1 - // sf*p1==n*p1+p1^2+n+p1 - // p1^2+(n+1-sf)*p1+n=0 - // x=(-b+/-sqrt(b^2-4ac))/2a - // a=1 - // x=(-b+/-sqrt(b^2-4c))/2 - // b=n+1-sf;c=n - b=n+1-target_sf; -// x=(-b+/-sqrt(b^2-4n))/2 - disc=b*b-4*n; - if (disc<0) - return FALSE; - x1=(-b-Sqrt(disc))/2; - if (x1<=1) - return FALSE; - x2=n/x1; - if (x2>1 && x1*x2==n) - return TRUE; - else - return FALSE; - } -} - -U0 PutFactors(I64 n) //For debugging -{ - I64 i,k,sqrt=Ceil(Sqrt(n)); - for (i=2;i<=sqrt;i++) { - k=0; - while (!(n%i)) { - k++; - n/=i; - } - if (k) { - "%d",i; - if (k>1) - "^%d",k; - '' CH_SPACE; - } - } - if (n!=1) - "%d ",n; -} - -class RangeJob -{ - CDoc *doc; - I64 lo,hi,N,sqrt_primes,cbrt_primes; - Prime *primes; - CSrvCmd *cmd; -} rj[mp_cnt]; - -I64 TestCoreSubRange(RangeJob *r) -{ - I64 i,j,m,n,n2,sf,res=0,range=r->hi-r->lo, - *sumfacts=MAlloc(range*sizeof(I64)), - *residue =MAlloc(range*sizeof(I64)); - U16 *pow_cnt =MAlloc(range*sizeof(U16)); - Prime *p=r->primes; - PowPrime *pp; - MemSetI64(sumfacts,1,range); - for (n=r->lo;nhi;n++) - residue[n-r->lo]=n; - for (j=0;jsqrt_primes;j++) { - MemSet(pow_cnt,0,range*sizeof(U16)); - m=1; - for (i=0;ipow_cnt;i++) { - m*=p->prime; - n=m-r->lo%m; - while (npp[i-1]; - sumfacts[n]*=pp->sumfact; - residue [n]/=pp->n; - } - p++; - } - - for (n=0;nlo;nhi;n++) { - sf=sumfacts[n-r->lo]; - n2=sf-n-1; - if (nN) { - if (r->lo<=n2hi && sumfacts[n2-r->lo]-n2-1==n || - TestSumFact(n2,sf,r->sqrt_primes,r->cbrt_primes,r->primes)) { - DocPrint(r->doc,"%u:%u\n",n,sf-n-1); - res++; - } - } - } - Free(pow_cnt); - Free(residue); - Free(sumfacts); - return res; -} - -#define CORE_SUB_RANGE 0x1000 - -I64 TestCoreRange(RangeJob *r) -{ - I64 i,res=0; - RangeJob rj; - MemCpy(&rj,r,sizeof(RangeJob)); - for (i=r->lo;ihi;i+=CORE_SUB_RANGE) { - rj.lo=i; - rj.hi=i+CORE_SUB_RANGE; - if (rj.hi>r->hi) - rj.hi=r->hi; - res+=TestCoreSubRange(&rj); - Yield; - } - return res; -} - -I64 MagicPairs(I64 N) -{ - F64 t0=tS; - I64 res=0; - I64 sqrt_primes,cbrt_primes,num_powprimes, - i,k,n=(N-1)/mp_cnt+1; - Prime *primes=PrimesNew(N,&sqrt_primes,&cbrt_primes); - PowPrime *powprimes=PowPrimesNew(N,sqrt_primes,primes,&num_powprimes); - "N:%u SqrtPrimes:%u CbrtPrimes:%u PowersOfPrimes:%u\n", - N,sqrt_primes,cbrt_primes,num_powprimes; - - k=2; - for (i=0;iN) k=N; - rj[i].hi=k; - rj[i].N=N; - rj[i].sqrt_primes=sqrt_primes; - rj[i].cbrt_primes=cbrt_primes; - rj[i].primes=primes; - rj[i].cmd=JobQue(&TestCoreRange,&rj[i],i,0); - } - for (i=0;iprime=i; + p++; + } + Free(s); + + *_sqrt_primes=sqrt_primes; + *_cbrt_primes=cbrt_primes; + return primes; +} + +PowPrime *PowPrimesNew(I64 N,I64 sqrt_primes,Prime *primes,I64 *_num_powprimes) +{ + I64 i,j,k,sf,num_powprimes=0; + Prime *p; + PowPrime *powprimes,*pp; + + p=primes; + for (i=0;iprime)); + p++; + } + + p=primes; + pp=powprimes=MAlloc(num_powprimes*sizeof(PowPrime)); + for (i=0;ipp=pp; + j=p->prime; + k=1; + sf=1; + while (jn=j; + pp->sumfact=sf; + j*=p->prime; + pp++; + p->pow_cnt++; + } + p++; + } + *_num_powprimes=num_powprimes; + return powprimes; +} + +I64 SumFact(I64 n,I64 sqrt_primes,Prime *p) +{ + I64 i,k,sf=1; + PowPrime *pp; + if (n<2) + return 1; + for (i=0;iprime)) { + n/=p->prime; + k++; + } + if (k) { + pp=p->pp+(k-1); + sf*=pp->sumfact; + if (n==1) + return sf; + } + p++; + } + return sf*(1+n); //Prime +} + +Bool TestSumFact(I64 n,I64 target_sf,I64 sqrt_primes,I64 cbrt_primes,Prime *p) +{ + I64 i=0,k,b,x1,x2; + PowPrime *pp; + F64 disc; + if (n<2) + return FALSE; + while (i++prime)) { + n/=p->prime; + k++; + } + if (k) { + pp=p->pp+(k-1); + if (ModU64(&target_sf,pp->sumfact)) + return FALSE; + if (n==1) { + if (target_sf==1) + return TRUE; + else + return FALSE; + } + } + p++; + } +/* At this point we have three possible cases to test +1)n==p1 ->sf==(1+p1) ? +2)n==p1*p1 ->sf==(1+p1+p1^2) ? +3)n==p1*p2 ->sf==(p1+1)*(p2+1) ? + +*/ + if (1+n==target_sf) { + while (i++prime)) { + n/=p->prime; + k++; + } + if (k) { + pp=p->pp+(k-1); + if (ModU64(&target_sf,pp->sumfact)) + return FALSE; + if (n==1) { + if (target_sf==1) + return TRUE; + else + return FALSE; + } + } + p++; + } + if (1+n==target_sf) + return TRUE; + else + return FALSE; + } + + k=Sqrt(n); + if (k*k==n) { + if (1+k+n==target_sf) + return TRUE; + else + return FALSE; + } else { +// n==p1*p2 -> sf==(p1+1)*(p2+1) ? where p1!=1 && p2!=1 + // if p1==1 || p2==1, it is FALSE because we checked a single prime above. + + // sf==(p1+1)*(n/p1+1) + // sf==n+p1+n/p1+1 + // sf*p1==n*p1+p1^2+n+p1 + // p1^2+(n+1-sf)*p1+n=0 + // x=(-b+/-sqrt(b^2-4ac))/2a + // a=1 + // x=(-b+/-sqrt(b^2-4c))/2 + // b=n+1-sf;c=n + b=n+1-target_sf; +// x=(-b+/-sqrt(b^2-4n))/2 + disc=b*b-4*n; + if (disc<0) + return FALSE; + x1=(-b-Sqrt(disc))/2; + if (x1<=1) + return FALSE; + x2=n/x1; + if (x2>1 && x1*x2==n) + return TRUE; + else + return FALSE; + } +} + +U0 PutFactors(I64 n) //For debugging +{ + I64 i,k,sqrt=Ceil(Sqrt(n)); + for (i=2;i<=sqrt;i++) { + k=0; + while (!(n%i)) { + k++; + n/=i; + } + if (k) { + "%d",i; + if (k>1) + "^%d",k; + '' CH_SPACE; + } + } + if (n!=1) + "%d ",n; +} + +class RangeJob +{ + CDoc *doc; + I64 num,lo,hi,N,sqrt_primes,cbrt_primes; + Prime *primes; + CSrvCmd *cmd; +} rj[mp_cnt]; + +I64 TestCoreSubRange(RangeJob *r) +{ + I64 i,j,m,n,n2,sf,res=0,range=r->hi-r->lo, + *sumfacts=MAlloc(range*sizeof(I64)), + *residue =MAlloc(range*sizeof(I64)); + U16 *pow_cnt =MAlloc(range*sizeof(U16)); + Prime *p=r->primes; + PowPrime *pp; + MemSetI64(sumfacts,1,range); + for (n=r->lo;nhi;n++) + residue[n-r->lo]=n; + for (j=0;jsqrt_primes;j++) { + MemSet(pow_cnt,0,range*sizeof(U16)); + m=1; + for (i=0;ipow_cnt;i++) { + m*=p->prime; + n=m-r->lo%m; + while (npp[i-1]; + sumfacts[n]*=pp->sumfact; + residue [n]/=pp->n; + } + p++; + } + + for (n=0;nlo;nhi;n++) { + sf=sumfacts[n-r->lo]; + n2=sf-n-1; + if (nN) { + if (r->lo<=n2hi && sumfacts[n2-r->lo]-n2-1==n || + TestSumFact(n2,sf,r->sqrt_primes,r->cbrt_primes,r->primes)) { + DocPrint(r->doc,"%u:%u\n",n,sf-n-1); + res++; + } + } + } + Free(pow_cnt); + Free(residue); + Free(sumfacts); + return res; +} + +#define CORE_SUB_RANGE 0x1000 + +I64 TestCoreRange(RangeJob *r) +{ + I64 i,n,res=0; + RangeJob rj; + MemCpy(&rj,r,sizeof(RangeJob)); + for (i=r->lo;ihi;i+=CORE_SUB_RANGE) { + rj.lo=i; + rj.hi=i+CORE_SUB_RANGE; + if (rj.hi>r->hi) + rj.hi=r->hi; + res+=TestCoreSubRange(&rj); + + n=rj.hi-rj.lo; + lock {progress1+=n;} + + Yield; + } + return res; +} + +I64 MagicPairs(I64 N) +{ + F64 t0=tS; + I64 res=0; + I64 sqrt_primes,cbrt_primes,num_powprimes, + i,k,n=(N-1)/mp_cnt+1; + Prime *primes=PrimesNew(N,&sqrt_primes,&cbrt_primes); + PowPrime *powprimes=PowPrimesNew(N,sqrt_primes,primes,&num_powprimes); + + "N:%u SqrtPrimes:%u CbrtPrimes:%u PowersOfPrimes:%u\n", + N,sqrt_primes,cbrt_primes,num_powprimes; + progress1=0; + *progress1_desc=0; + progress1_max=N; + k=2; + for (i=0;iN) k=N; + rj[i].hi=k; + rj[i].N=N; + rj[i].sqrt_primes=sqrt_primes; + rj[i].cbrt_primes=cbrt_primes; + rj[i].primes=primes; + rj[i].cmd=JobQue(&TestCoreRange,&rj[i],mp_cnt-1-i,0); + } + for (i=0;i to Exit\n"; - - //We don't want the mouse buttons to reposition the cursor, - //so we inhibit the window mgr from processing them. - - Fs->win_inhibit=WIF_SELF_IP_L|WIF_SELF_IP_R; - - do { - msg_code=GetMsg(&a1,&a2,~(1<win_inhibit=WIG_USER_TASK_DFT; -} - -MsgLoop; - -// Press and "Insert $LK,"ASCII",A="MN:CH_CTRLA"$/$LK,"ScanCode",A="FI:::/Doc/CharOverview.TXT"$". diff --git a/Demo/MsgLoop.HC b/Demo/MsgLoop.HC new file mode 100644 index 0000000..f5d9b79 --- /dev/null +++ b/Demo/MsgLoop.HC @@ -0,0 +1,23 @@ +U0 MsgLoop() +{ + I64 a1,a2,msg_code; + "Use $LK,"msg_code",A="MN:MSG_CMD"$ defines in your programs instead of hardcoded nums.\n" + " to Exit\n"; + + //We don't want the mouse buttons to reposition the cursor, + //so we inhibit the window mgr from processing them. + + Fs->win_inhibit=WIF_SELF_IP_L|WIF_SELF_IP_R; + + do { + msg_code=GetMsg(&a1,&a2,~(1<win_inhibit=WIG_USER_TASK_DFT; +} + +MsgLoop; + +// Press and "Insert $LK,"ASCII",A="MN:CH_CTRLA"$/$LK,"ScanCode",A="FI:::/Doc/CharOverview.DD"$". diff --git a/Demo/MultiCore/Clouds.CPP b/Demo/MultiCore/Clouds.CPP deleted file mode 100644 index 4b8cc22..0000000 --- a/Demo/MultiCore/Clouds.CPP +++ /dev/null @@ -1,205 +0,0 @@ -//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$. - - - - - - - - - - - - - - - -$SP,"<1>",BI=1,BP="::/Demo/Graphics/Mountain.CPP.Z,Mountain"$ //Pointer to sprite in $LK,"Mountain.CPP",A="FI:::/Demo/Graphics/Mountain.CPP"$ file - -#define NUM_CLOUDS 16 -#define SKY_LINES 30 -#define CLOUD_PTS 512 -#define CLOUD_PENS 8 -#define CLOUD_PEN_PTS 16 -#define CLOUD_PEN_SIZE 16 - -class Cloud -{ - I64 i,x,y,w,h,dx,dy; - I64 color; - I64 px[CLOUD_PTS],py[CLOUD_PTS],pc[CLOUD_PTS]; -} clouds[NUM_CLOUDS]; - -class CloudPen -{ - CDC *img; - I64 px[CLOUD_PEN_PTS],py[CLOUD_PEN_PTS]; -} cloud_pens[CLOUD_PENS]; - -CDC *cloud_pen; - -I64 mp_not_done_flags; -U0 MPDrawClouds(CTask *task) -{ - Cloud *c; - CDC *dc=DCAlias(gr.dc2,task); - I64 i,j,k,xx,yy,lo=Gs->num*CLOUD_PTS/mp_cnt,hi=(Gs->num+1)*CLOUD_PTS/mp_cnt; - - for (j=0,c=clouds;jpc[i]; - if (kcolor) - dc->color=ROP_MONO+LTGRAY; - else - dc->color=ROP_MONO+WHITE; - xx=c->x.i32[1]+c->px[i]; - yy=c->y.i32[1]+c->py[i]; - - k=RandU16&31-16; - if (k==-16) - k=-c->px[i]; - c->px[i]+=SignI64(k); - - k=RandU16&31-16; - if (k==-16) - k=-c->py[i]; - c->py[i]+=SignI64(k); - - GrBlot(dc,xx,yy,cloud_pens[i&(CLOUD_PENS-1)].img); - } - DCDel(dc); - LBtr(&mp_not_done_flags,Gs->num); -} - -U0 DrawIt(CTask *task,CDC *dc) -{ - I64 i; - Sprite3(dc,0,SKY_LINES*FONT_HEIGHT,0,$IB,"<1>",BI=1$); - mp_not_done_flags=1<img); - cp->img->color=COLOR_MONO; - for (j=0;jimg,cp->px[j],cp->py[j]); - cp->px[j]=ClampI64(cp->px[j]+RandU16%3-1,0,CLOUD_PEN_SIZE-1); - cp->py[j]=ClampI64(cp->py[j]+RandU16%3-1,0,CLOUD_PEN_SIZE-1); - } - } - - for (i=0,c=clouds;ix+=c->dx; - c->y=ClampI64(c->y+c->dy,0,0.7*(SKY_LINES*FONT_HEIGHT)<<32); - c->color=MAX_U16*c->y.i32[1]/(0.8*(SKY_LINES*FONT_HEIGHT)); - } - - Sleep(20); - } -} - -#define SAMPLES 6 -U0 Init() -{ - Cloud *c=clouds; - CloudPen *cp=cloud_pens; - I64 i,j,k,l, - w=Fs->pix_width, - h=SKY_LINES*FONT_HEIGHT; - - for (i=0;ix=ToI64(w/2+Rand*w/2-w/4)<<32; - c->y=ToI64(h/2+Rand*h/2-h/4)<<32; - c->dx=RandI32; - c->dy=RandI32; - c->w=100; - c->h=50; - c->color=RandU16; - for (l=0;lpx[l]=(k*c->w/MAX_I16)/SAMPLES; - - k=0; - for (j=0;jpy[l]=(k*c->h/MAX_I16)/SAMPLES; - - c->pc[l]=RandU16; - } - } - - for (i=0;iimg=DCNew(CLOUD_PEN_SIZE,CLOUD_PEN_SIZE); - for (j=0;jpx[j]=RandU16%CLOUD_PEN_SIZE; - cp->py[j]=RandU16%CLOUD_PEN_SIZE; - } - } -} - -U0 CleanUp() -{ - I64 i; - CloudPen *cp=cloud_pens; - for (i=0;iimg); -} - -U0 SongTask(I64) -{//Song by the Holy Spirit -//This specifies a callback routine - //to be called when the task dies. - Fs->task_end_cb=&SndTaskEndCB; - MusicSettingsRst; - while (TRUE) { - Play("3qBetDA2G3qD2sG3E2G3EetCEDqFEeDC"); - Play("qBetDA2G3qD2sG3E2G3EetCEDqFEeDC"); - Play("CGqDeADsDCDCqGEetDAD2sG3D2G3D"); - Play("eCGqDeADsDCDCqGEetDAD2sG3D2G3D"); - } -} - -U0 CloudScene() -{ - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - try { - Fs->text_attr=YELLOW<<4+BLUE; - Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs); - AutoComplete; - WinBorder; - WinMax; - DocCursor; - DocClear; - Init; - Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs); - - "$$BG,LTCYAN$$%h*c",SKY_LINES,'\n'; - "$$BG,YELLOW$$%h5c",'\n'; - BibleVerse(,"Exodus,14:19",7); - - Fs->draw_it=&DrawIt; - GetChar; - WinMgrSync; - } catch - PutExcept; - SettingsPop; - CleanUp; -} - -#if __CMD_LINE__ -CloudScene; -#endif diff --git a/Demo/MultiCore/Clouds.HC b/Demo/MultiCore/Clouds.HC new file mode 100644 index 0000000..c50e38c --- /dev/null +++ b/Demo/MultiCore/Clouds.HC @@ -0,0 +1,205 @@ +//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.HC"$. + + + + + + + + + + + + + + + +$SP,"<1>",BI=1,BP="::/Demo/Graphics/Mountain.HC.Z,Mountain"$ //Pointer to sprite in $LK,"Mountain.HC",A="FI:::/Demo/Graphics/Mountain.HC"$ file + +#define NUM_CLOUDS 16 +#define SKY_LINES 30 +#define CLOUD_PTS 512 +#define CLOUD_PENS 8 +#define CLOUD_PEN_PTS 16 +#define CLOUD_PEN_SIZE 16 + +class Cloud +{ + I64 i,x,y,w,h,dx,dy; + I64 color; + I64 px[CLOUD_PTS],py[CLOUD_PTS],pc[CLOUD_PTS]; +} clouds[NUM_CLOUDS]; + +class CloudPen +{ + CDC *img; + I64 px[CLOUD_PEN_PTS],py[CLOUD_PEN_PTS]; +} cloud_pens[CLOUD_PENS]; + +CDC *cloud_pen; + +I64 mp_not_done_flags; +U0 MPDrawClouds(CTask *task) +{ + Cloud *c; + CDC *dc=DCAlias(gr.dc2,task); + I64 i,j,k,xx,yy,lo=Gs->num*CLOUD_PTS/mp_cnt,hi=(Gs->num+1)*CLOUD_PTS/mp_cnt; + + for (j=0,c=clouds;jpc[i]; + if (kcolor) + dc->color=ROP_MONO+LTGRAY; + else + dc->color=ROP_MONO+WHITE; + xx=c->x.i32[1]+c->px[i]; + yy=c->y.i32[1]+c->py[i]; + + k=RandU16&31-16; + if (k==-16) + k=-c->px[i]; + c->px[i]+=SignI64(k); + + k=RandU16&31-16; + if (k==-16) + k=-c->py[i]; + c->py[i]+=SignI64(k); + + GrBlot(dc,xx,yy,cloud_pens[i&(CLOUD_PENS-1)].img); + } + DCDel(dc); + LBtr(&mp_not_done_flags,Gs->num); +} + +U0 DrawIt(CTask *task,CDC *dc) +{ + I64 i; + Sprite3(dc,0,SKY_LINES*FONT_HEIGHT,0,$IB,"<1>",BI=1$); + mp_not_done_flags=1<img); + cp->img->color=COLOR_MONO; + for (j=0;jimg,cp->px[j],cp->py[j]); + cp->px[j]=ClampI64(cp->px[j]+RandU16%3-1,0,CLOUD_PEN_SIZE-1); + cp->py[j]=ClampI64(cp->py[j]+RandU16%3-1,0,CLOUD_PEN_SIZE-1); + } + } + + for (i=0,c=clouds;ix+=c->dx; + c->y=ClampI64(c->y+c->dy,0,0.7*(SKY_LINES*FONT_HEIGHT)<<32); + c->color=MAX_U16*c->y.i32[1]/(0.8*(SKY_LINES*FONT_HEIGHT)); + } + + Sleep(20); + } +} + +#define SAMPLES 6 +U0 Init() +{ + Cloud *c=clouds; + CloudPen *cp=cloud_pens; + I64 i,j,k,l, + w=Fs->pix_width, + h=SKY_LINES*FONT_HEIGHT; + + for (i=0;ix=ToI64(w/2+Rand*w/2-w/4)<<32; + c->y=ToI64(h/2+Rand*h/2-h/4)<<32; + c->dx=RandI32; + c->dy=RandI32; + c->w=100; + c->h=50; + c->color=RandU16; + for (l=0;lpx[l]=(k*c->w/MAX_I16)/SAMPLES; + + k=0; + for (j=0;jpy[l]=(k*c->h/MAX_I16)/SAMPLES; + + c->pc[l]=RandU16; + } + } + + for (i=0;iimg=DCNew(CLOUD_PEN_SIZE,CLOUD_PEN_SIZE); + for (j=0;jpx[j]=RandU16%CLOUD_PEN_SIZE; + cp->py[j]=RandU16%CLOUD_PEN_SIZE; + } + } +} + +U0 CleanUp() +{ + I64 i; + CloudPen *cp=cloud_pens; + for (i=0;iimg); +} + +U0 SongTask(I64) +{//Song by the Holy Spirit +//This specifies a callback routine + //to be called when the task dies. + Fs->task_end_cb=&SndTaskEndCB; + MusicSettingsRst; + while (TRUE) { + Play("3qBetDA2G3qD2sG3E2G3EetCEDqFEeDC"); + Play("qBetDA2G3qD2sG3E2G3EetCEDqFEeDC"); + Play("CGqDeADsDCDCqGEetDAD2sG3D2G3D"); + Play("eCGqDeADsDCDCqGEetDAD2sG3D2G3D"); + } +} + +U0 CloudScene() +{ + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + try { + Fs->text_attr=YELLOW<<4+BLUE; + Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs); + AutoComplete; + WinBorder; + WinMax; + DocCursor; + DocClear; + Init; + Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs); + + "$$BG,LTCYAN$$%h*c",SKY_LINES,'\n'; + "$$BG,YELLOW$$%h5c",'\n'; + BibleVerse(,"Exodus,14:19",7); + + Fs->draw_it=&DrawIt; + GetChar; + WinMgrSync; + } catch + PutExcept; + SettingsPop; + CleanUp; +} + +#if __CMD_LINE__ +CloudScene; +#endif diff --git a/Demo/MultiCore/Interrupts.CPP b/Demo/MultiCore/Interrupts.HC similarity index 100% rename from Demo/MultiCore/Interrupts.CPP rename to Demo/MultiCore/Interrupts.HC diff --git a/Demo/MultiCore/LoadTest.CPP b/Demo/MultiCore/LoadTest.CPP deleted file mode 100644 index 9351a86..0000000 --- a/Demo/MultiCore/LoadTest.CPP +++ /dev/null @@ -1,48 +0,0 @@ -Bool app_done; -I64 app_done_ack; - -U0 Job1(I64) -{//Compile Compiler - Silent; - while (!app_done) { - Cd("::/Compiler"); - Cmp("Compiler"); - } - lock {app_done_ack--;} -} - -U0 Job2(I64) -{//Log a file - while (!app_done) { - AdamLog("%F","::/Demo/MultiCore/LoadTest.CPP"); - Yield; - } - lock {app_done_ack--;} -} - -U0 Job3(I64) -{//Log a file - while (!app_done) { - Cd("::/Compiler"); - AdamLog("%F","Compiler.PRJ.Z"); - Yield; - } - lock {app_done_ack--;} -} - -U0 Main() -{ - app_done=FALSE; - "Running MultiCore Test...\n"; - Spawn(&Job1,,,1); //core #1 - Spawn(&Job2,,,1); - Spawn(&Job3,,,1); - PressAKey; -//We don't want to yank code from under MP cores. - app_done_ack=3; - app_done=TRUE; - while (app_done_ack) - Yield; -} - -Main; diff --git a/Demo/MultiCore/LoadTest.HC b/Demo/MultiCore/LoadTest.HC new file mode 100644 index 0000000..da5bcf8 --- /dev/null +++ b/Demo/MultiCore/LoadTest.HC @@ -0,0 +1,48 @@ +Bool app_done; +I64 app_done_ack; + +U0 Job1(I64) +{//Compile Compiler + Silent; + while (!app_done) { + Cd("::/Compiler"); + Cmp("Compiler"); + } + lock {app_done_ack--;} +} + +U0 Job2(I64) +{//Log a file + while (!app_done) { + AdamLog("%F","::/Demo/MultiCore/LoadTest.HC"); + Yield; + } + lock {app_done_ack--;} +} + +U0 Job3(I64) +{//Log a file + while (!app_done) { + Cd("::/Compiler"); + AdamLog("%F","Compiler.PRJ.Z"); + Yield; + } + lock {app_done_ack--;} +} + +U0 Main() +{ + app_done=FALSE; + "Running MultiCore Test...\n"; + Spawn(&Job1,,,1); //core #1 + Spawn(&Job2,,,1); + Spawn(&Job3,,,1); + PressAKey; +//We don't want to yank code from under MP cores. + app_done_ack=3; + app_done=TRUE; + while (app_done_ack) + Yield; +} + +Main; diff --git a/Demo/MultiCore/Lock.CPP b/Demo/MultiCore/Lock.HC similarity index 100% rename from Demo/MultiCore/Lock.CPP rename to Demo/MultiCore/Lock.HC diff --git a/Demo/MultiCore/MPAdd.CPP b/Demo/MultiCore/MPAdd.HC similarity index 100% rename from Demo/MultiCore/MPAdd.CPP rename to Demo/MultiCore/MPAdd.HC diff --git a/Demo/MultiCore/MPPrint.CPP b/Demo/MultiCore/MPPrint.HC similarity index 100% rename from Demo/MultiCore/MPPrint.CPP rename to Demo/MultiCore/MPPrint.HC diff --git a/Demo/MultiCore/Palindrome.CPP b/Demo/MultiCore/Palindrome.HC similarity index 100% rename from Demo/MultiCore/Palindrome.CPP rename to Demo/MultiCore/Palindrome.HC diff --git a/Demo/MultiCore/Primes.CPP b/Demo/MultiCore/Primes.HC similarity index 100% rename from Demo/MultiCore/Primes.CPP rename to Demo/MultiCore/Primes.HC diff --git a/Demo/MultiCore/RadixSort.CPP b/Demo/MultiCore/RadixSort.HC similarity index 100% rename from Demo/MultiCore/RadixSort.CPP rename to Demo/MultiCore/RadixSort.HC diff --git a/Demo/MultiCore/RateCores.CPP b/Demo/MultiCore/RateCores.CPP deleted file mode 100644 index 3f060af..0000000 --- a/Demo/MultiCore/RateCores.CPP +++ /dev/null @@ -1,46 +0,0 @@ -Bool mp_start,mp_end; -I64 mp_not_done_flags, - **glbl_cnts; - -U0 MPRateCores(I64 ) -{ - I64 i=0; - while (!mp_start) - Yield; - while (!mp_end) { - i++; - Yield; - } - glbl_cnts[Gs->num]=i; - LBtr(&mp_not_done_flags,Gs->num); -} - -U0 RateCores() -{ - I64 i; - F64 t0,tf; - glbl_cnts=CAlloc(sizeof(I64)*mp_cnt); - - mp_start=mp_end=FALSE; - mp_not_done_flags=1<color=RandI16&15; - GrPlot(gr.dc,RandI32%GR_WIDTH,RandI32%GR_HEIGHT); - } while (tS-t0<1); - DCFill; -} - -U0 RandDemo() -{ - I64 i; - - "Seed(0) will do timer randomized random numbers. A task starts with " - "$LK,"Seed(0)",A="FF:::/Kernel/KTask.CPP,Seed("$ by dft.\n"; - PressAKey; - Seed; - RandPts; - DCFill; - - "\nSeed(num) will do non-timer starting at specific seed. " - "Non-timer rand is awful. You can run a specific video game by " - "typing Seed(num) at the cmd line before the game.\n"; - PressAKey; - Seed(1); - RandPts; - DCFill; - - "\n\n\nWatch when we specify specific seeds:"; - - "\n\nSeed(1);\n"; - Seed(1); - for (i=0;i<5;i++) - "%d: %d\n",i,RandI16; - - "\nSeed(2); Different, right?\n"; - Seed(2); - for (i=0;i<5;i++) - "%d: %d\n",i,RandI16; - - "\nSeed(1); Repeats earlier values.\n"; - Seed(1); - for (i=0;i<5;i++) - "%d: %d\n",i,RandI16; - - "\nSeed(0); Zero is special.\n"; - Seed(0); - for (i=0;i<5;i++) - "%d: %d\n",i,RandI16; - - "\nSeed(0); Non-repeating.\n"; - Seed(0); - for (i=0;i<5;i++) - "%d: %d\n",i,RandI16; - - Seed; //Dft should be kept to zero. -} - -RandDemo; diff --git a/Demo/RandDemo.HC b/Demo/RandDemo.HC new file mode 100644 index 0000000..959f154 --- /dev/null +++ b/Demo/RandDemo.HC @@ -0,0 +1,60 @@ +U0 RandPts() +{ + F64 t0=tS; + do { + gr.dc->color=RandI16&15; + GrPlot(gr.dc,RandI32%GR_WIDTH,RandI32%GR_HEIGHT); + } while (tS-t0<1); + DCFill; +} + +U0 RandDemo() +{ + I64 i; + + "Seed(0) will do timer randomized random numbers. A task starts with " + "$LK,"Seed(0)",A="FF:::/Kernel/KTask.HC,Seed("$ by dft.\n"; + PressAKey; + Seed; + RandPts; + DCFill; + + "\nSeed(num) will do non-timer starting at specific seed. " + "Non-timer rand is awful. You can run a specific video game by " + "typing Seed(num) at the cmd line before the game.\n"; + PressAKey; + Seed(1); + RandPts; + DCFill; + + "\n\n\nWatch when we specify specific seeds:"; + + "\n\nSeed(1);\n"; + Seed(1); + for (i=0;i<5;i++) + "%d: %d\n",i,RandI16; + + "\nSeed(2); Different, right?\n"; + Seed(2); + for (i=0;i<5;i++) + "%d: %d\n",i,RandI16; + + "\nSeed(1); Repeats earlier values.\n"; + Seed(1); + for (i=0;i<5;i++) + "%d: %d\n",i,RandI16; + + "\nSeed(0); Zero is special.\n"; + Seed(0); + for (i=0;i<5;i++) + "%d: %d\n",i,RandI16; + + "\nSeed(0); Non-repeating.\n"; + Seed(0); + for (i=0;i<5;i++) + "%d: %d\n",i,RandI16; + + Seed; //Dft should be kept to zero. +} + +RandDemo; diff --git a/Demo/RegistryDemo.CPP b/Demo/RegistryDemo.CPP deleted file mode 100644 index bf98d33..0000000 --- a/Demo/RegistryDemo.CPP +++ /dev/null @@ -1,27 +0,0 @@ -/*The ~/Registry.CPP.Z file is HolyC code. -You can execute a tree branch of it. The Adam -branch is executed in the Adam task boot phase. -Normally, you will place var declarations -in the branch you make, but since an arthmetic expression -is valid in HolyC you can place simple expressions -without vars. -*/ - -RegSetDftEntry("DemoCompany/Game1","F64 best_score=1.23;\n"); -RegSetDftEntry("DemoCompany/Game1/SimpleVal","1234;\n"); -RegExeBranch("DemoCompany/Game1"); - -U0 Game() -{ - I64 i=RegExeBranch("DemoCompany/Game1/SimpleVal"); - "High Score:%6.5f\n",best_score; - "Val:%d\n",i; - i++; - best_score=tS; -//You could combine these into one write by making - //the $$TR...$$ and $$ID,2$$, $$ID,-2$$, cmds yourself. - RegWriteBranch("DemoCompany/Game1","F64 best_score=%9.5f;\n",best_score); - RegWriteBranch("DemoCompany/Game1/SimpleVal","%d;\n",i); -} - -Game; diff --git a/Demo/RegistryDemo.HC b/Demo/RegistryDemo.HC new file mode 100644 index 0000000..bd7d0fd --- /dev/null +++ b/Demo/RegistryDemo.HC @@ -0,0 +1,27 @@ +/*The ~/Registry.HC.Z file is HolyC code. +You can execute a tree branch of it. The Adam +branch is executed in the Adam task boot phase. +Normally, you will place var declarations +in the branch you make, but since an arthmetic expression +is valid in HolyC you can place simple expressions +without vars. +*/ + +RegSetDftEntry("DemoCompany/Game1","F64 best_score=1.23;\n"); +RegSetDftEntry("DemoCompany/Game1/SimpleVal","1234;\n"); +RegExeBranch("DemoCompany/Game1"); + +U0 Game() +{ + I64 i=RegExeBranch("DemoCompany/Game1/SimpleVal"); + "High Score:%6.5f\n",best_score; + "Val:%d\n",i; + i++; + best_score=tS; +//You could combine these into one write by making + //the $$TR...$$ and $$ID,2$$, $$ID,-2$$, cmds yourself. + RegWriteBranch("DemoCompany/Game1","F64 best_score=%9.5f;\n",best_score); + RegWriteBranch("DemoCompany/Game1/SimpleVal","%d;\n",i); +} + +Game; diff --git a/Demo/RevFileDemo/DemoPoemBwd.TXT b/Demo/RevFileDemo/DemoPoemBwd.DD similarity index 100% rename from Demo/RevFileDemo/DemoPoemBwd.TXT rename to Demo/RevFileDemo/DemoPoemBwd.DD diff --git a/Demo/RevFileDemo/Rev.CPP b/Demo/RevFileDemo/Rev.CPP deleted file mode 100644 index 06aaf33..0000000 --- a/Demo/RevFileDemo/Rev.CPP +++ /dev/null @@ -1,22 +0,0 @@ -/*We use the internal routines from the text editor -to cut and paste lines to rev the order of -lines in a text file. -*/ - -Cd(__DIR__);; - -U0 Rev(U8 *in_name,U8 *out_name) -{ - CDoc *doc_in =DocRead(in_name), - *doc_out=DocNew(out_name); - DocTop(doc_in); - while (doc_in->head.next!=doc_in) { - EdLineDown(doc_in,SC_CURSOR_DOWN|SCF_SHIFT); - EdCutToClipboard(doc_in); - DocTop(doc_out); - EdPasteClipboard(doc_out); - } - DocWrite(doc_out); -} - -Rev("DemoPoemBwd.TXT.Z","~/DemoPoemFwd.TXT.Z"); diff --git a/Demo/RevFileDemo/Rev.HC b/Demo/RevFileDemo/Rev.HC new file mode 100644 index 0000000..3d31fe3 --- /dev/null +++ b/Demo/RevFileDemo/Rev.HC @@ -0,0 +1,22 @@ +/*We use the internal routines from the text editor +to cut and paste lines to rev the order of +lines in a text file. +*/ + +Cd(__DIR__);; + +U0 Rev(U8 *in_name,U8 *out_name) +{ + CDoc *doc_in =DocRead(in_name), + *doc_out=DocNew(out_name); + DocTop(doc_in); + while (doc_in->head.next!=doc_in) { + EdLineDown(doc_in,SC_CURSOR_DOWN|SCF_SHIFT); + EdCutToClipboard(doc_in); + DocTop(doc_out); + EdPasteClipboard(doc_out); + } + DocWrite(doc_out); +} + +Rev("DemoPoemBwd.DD.Z","~/DemoPoemFwd.DD.Z"); diff --git a/Demo/ScreenCodes.CPP b/Demo/ScreenCodes.CPP deleted file mode 100644 index 9ef4513..0000000 --- a/Demo/ScreenCodes.CPP +++ /dev/null @@ -1,27 +0,0 @@ -/*See $LK,"TextBase Layer",A="HI:TextBase Layer"$ for the format -of the U32 you pass to TextChar() - -See $LK,"::/Doc/CharOverview.TXT"$, $LK,"::/Demo/ExtendedChars.CPP"$, -and $LK,"::/Demo/Graphics/FontEd.CPP"$. - -Hold and press a 3 digit decimal number -or press to enter extended characters. -*/ - -U0 DrawIt(CTask *task,CDC *) -{ - I64 i; - for (i=0;i<256;i++) - TextChar(task,,(i&15)*2,(i/16)*2,i+BLACK<<12+WHITE<<8); -} - -U0 ScreenCodes() -{ - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - DocClear; - Fs->draw_it=&DrawIt; - GetChar(,FALSE); - SettingsPop; -} - -ScreenCodes; diff --git a/Demo/ScreenCodes.HC b/Demo/ScreenCodes.HC new file mode 100644 index 0000000..04779b5 --- /dev/null +++ b/Demo/ScreenCodes.HC @@ -0,0 +1,27 @@ +/*See $LK,"TextBase Layer",A="HI:TextBase Layer"$ for the format +of the U32 you pass to TextChar() + +See $LK,"::/Doc/CharOverview.DD"$, $LK,"::/Demo/ExtChars.HC"$, +and $LK,"::/Demo/Graphics/FontEd.HC"$. + +Hold and press a 3 digit decimal number +or press to enter extended characters. +*/ + +U0 DrawIt(CTask *task,CDC *) +{ + I64 i; + for (i=0;i<256;i++) + TextChar(task,,(i&15)*2,(i/16)*2,i+BLACK<<12+WHITE<<8); +} + +U0 ScreenCodes() +{ + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + DocClear; + Fs->draw_it=&DrawIt; + GetChar(,FALSE); + SettingsPop; +} + +ScreenCodes; diff --git a/Demo/Snd/ASCIIOrgan.CPP b/Demo/Snd/ASCIIOrgan.HC similarity index 100% rename from Demo/Snd/ASCIIOrgan.CPP rename to Demo/Snd/ASCIIOrgan.HC diff --git a/Demo/Snd/MorseCode.CPP b/Demo/Snd/MorseCode.HC similarity index 100% rename from Demo/Snd/MorseCode.CPP rename to Demo/Snd/MorseCode.HC diff --git a/Demo/Snd/OhGreat.CPP b/Demo/Snd/OhGreat.HC similarity index 100% rename from Demo/Snd/OhGreat.CPP rename to Demo/Snd/OhGreat.HC diff --git a/Demo/Snd/WaterFowl.CPP b/Demo/Snd/WaterFowl.HC similarity index 100% rename from Demo/Snd/WaterFowl.CPP rename to Demo/Snd/WaterFowl.HC diff --git a/Demo/SortFileDemo/F64FileGen.CPP b/Demo/SortFileDemo/F64FileGen.CPP deleted file mode 100644 index 8d3c2a7..0000000 --- a/Demo/SortFileDemo/F64FileGen.CPP +++ /dev/null @@ -1,26 +0,0 @@ -//This makes a file of N random double values. - -Cd(__DIR__);; - -U0 F64FileGenTXT(U8 *filename,I64 n) -{ - I64 i; - CDoc *doc=DocNew(filename); - DocPrint(doc,"//This is unsorted.\n"); - for (i=0;itoken==TK_F64) - n++; - CmpCtrlDel(cc); - - a=MAlloc(n*sizeof(F64)); - - //Pass2: Read F64s. - i=0; - cc=CmpCtrlNew(MStrPrint("#include \"%s\"",in_name)); - while (Lex(cc)) - if (cc->token==TK_F64) - a[i++]=cc->cur_f64; - CmpCtrlDel(cc); - - QSortI64(a,n,&Compare); //Sort 64-bit sized values - - //Save - doc=DocNew(out_name); - DocPrint(doc,"//This is sorted.\n"); - for (i=0;itoken==TK_F64) + n++; + CmpCtrlDel(cc); + + a=MAlloc(n*sizeof(F64)); + + //Pass2: Read F64s. + i=0; + cc=CmpCtrlNew(MStrPrint("#include \"%s\"",in_name)); + while (Lex(cc)) + if (cc->token==TK_F64) + a[i++]=cc->cur_f64; + CmpCtrlDel(cc); + + QSortI64(a,n,&Compare); //Sort 64-bit sized values + + //Save + doc=DocNew(out_name); + DocPrint(doc,"//This is sorted.\n"); + for (i=0;i"$ + +TempleOS is a free, public domain, open source, $FG,4$$TX,"x86_64",HTML="http://en.wikipedia.org/wiki/Amd64#AMD64"$$FG$, non-preemptive multi-tasking, multi-cored, $FG,4$$TX,"ring-0-only",HTML="http://en.wikipedia.org/wiki/Ring_(computer_security)"$$FG$, single-address-map ($FG,4$$TX,"identity-mapped",HTML="http://en.wikipedia.org/wiki/Identity_(mathematics)"$$FG$), non-networked, PC operating system. Paging is, basically, not used. + +The CIA encourages code obsfucation. They make it more complicated than necessary. TempleOS is, literally, more simple than necessary. It is obnoxiously simple... to the point it hurts. + +This $TX,"\"Hello World\" joke",HTML="http://www.infiltec.com/j-h-wrld.htm"$, the $TX,"BMP file format",HTML="http://en.wikipedia.org/wiki/BMP_file_format"$ and the $TX,"WAV file format",HTML="http://en.wikipedia.org/wiki/WAV"$ show that the industry is really screwed-up! That's what TempleOS fixes. I capped the line-of-code count at 100,000 and God said it must be perfect, so it will never be an ugly monstrocity. It is currently $TX,"81,126",D="DD_TEMPLEOS_LOC_OFFICIAL"$ lines of unblemished code. Backward compatibility is not promised. + +Normally, failure is not an option, but since TempleOS accompanies Windows or Linux, we exclude certain uses. There is no reason to duplicate browsing, multimedia, desktop publishing, etc. Linux wants to be a secure, multi-user mainframe. That's why it has file permissions. The vision for TempleOS, however, is a modern, 64-bit Commodore 64. The C64 was a non-networked, home computer mostly used for games. It trained my generation how to program because it was wide open, completely hackable. The games were not multimedia works of art, but generated by non-artist. + +A troll might ask, "Why not just use $FG,4$$TX,"DOS",HTML="http://en.wikipedia.org/wiki/DOS"$$FG$? It was ring-0-only and single-address-map." $FG,4$$TX,"DOS",HTML="http://en.wikipedia.org/wiki/DOS"$$FG$ was 16-bit, with segmentation -- awful! TempleOS is 64-bit, flat, non-segmented and multi-cored. It has a C64-like shell with $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$, a dialect of C/C++, instead of BASIC. It was written from scratch, and not even ASCII was sacred -- it has 8-bit unsigned char source code to support European languages. Also, the source code supports binary sprite graphics. + +A troll might say, "It can crash!" We used $FG,4$$TX,"DOS",HTML="http://en.wikipedia.org/wiki/DOS"$$FG$ for years and loved it. Computers even had a reset switch! Just think of the power of ring-0, muhahaha! Think of the speed and simplicity of $FG,4$$TX,"ring-0-only",HTML="http://en.wikipedia.org/wiki/Ring_(computer_security)"$$FG$ and $FG,4$$TX,"identity-mapping",HTML="http://en.wikipedia.org/wiki/Identity_(mathematics)"$$FG$. It can change tasks in half a microsecond because it doesn't mess with page tables or privilege levels. Inter-process communication is effortless because every task can access every other task's memory. + +It's fun having access to everything. When I was a teenager, I had a book, $FG,4$$TX,"Mapping the Commodore 64",HTML="http://unusedino.de/ec64/technical/project64/mapping_c64.html"$$FG$, that told what every location in memory did. I liked copying the ROM to RAM and poking around at the ROM BASIC's variables. Everybody directly poked the hardware ports. + +TempleOS is simpler than Linux and you can have hours of fun tinkering because all memory and ports are accessible. Memory is $FG,4$$TX,"identity-mapped",HTML="http://en.wikipedia.org/wiki/Identity_(mathematics)"$$FG$ at all times, so you can modify any task's memory from any other task. You can access all disk blocks, too. I had a blast using a C64 disk block editor to modify directories to un-delete files, when I was a kid. Maybe, you want to play with a raw-block database, or make your own file system? + +$HC,""$ + +$HC,""$ + +I wrote all $LK,"121,489",A="FF:~/Web/LineRep.DD,Kernel.PRJ",D="DD_TEMPLEOS_LOC"$ lines of TempleOS over the last $TX,"13.1",D="DD_TEMPLEOS_AGE"$ years, full-time, including the 64-bit compiler. It was called, at various times, "$FG,4$$TX,"Hoppy",HTML="http://web.archive.org/web/*/http://www.simstructure.hare.com/*"$$FG$", "$FG,4$$TX,"The J Operating System",HTML="http://wayback.archive.org/web/*/http://www.justrighteous.org/*"$$FG$", "$FG,4$$TX,"LoseThos",HTML="http://web.archive.org/web/*/http://www.losethos.com/*"$$FG$" and "$FG,4$$TX,"SparrowOS",HTML="http://web.archive.org/web/*/http://www.sparrowos.com/*"$$FG$". Here are my $FG,4$$TX,"college transcripts",HTML="http://www.templeos.org/files/ASU_Transcripts.pdf"$$FG$. I've been a professional operating system developer since 1990 when I was hired to work on Ticketmaster's VAX OS. + +$FG,8$ +* "Commodore 64" was a trademark owned by Commodore Business Machines. +* "Linux" is a trademark owned by Linus Torvalds. +* "Windows" and "DOS" are trademarks owned by MicroSoft Corp. diff --git a/Demo/ToHtmlToTXTDemo/DemoInPage.TXT b/Demo/ToHtmlToTXTDemo/DemoInPage.TXT deleted file mode 100644 index ebdcd61..0000000 --- a/Demo/ToHtmlToTXTDemo/DemoInPage.TXT +++ /dev/null @@ -1,46 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"The Temple Operating System"$$FG,0$ -$FG,4$ -$LK,"Download Operating System",A="FI:::/Home/Web/DownloadOS.TXT"$ $LK,"App Store",A="FI:::/Home/Web/AppStore.TXT"$ - -$LK,"Screen Shots",A="FI:::/Home/Web/ScreenShots.TXT"$ $LK,"Instructional Videos",A="FI:::/Home/Web/TOSVideos.TXT"$ - -$LK,"Introduction",A="FI:::/Doc/Welcome.TXT"$ $LK,"F.A.Q.",A="FI:::/Doc/FAQ.TXT"$ - -$LK,"Features",A="FI:::/Doc/Features.TXT"$ $LK,"The Charter",A="FI:::/Doc/Charter.TXT"$ - -$LK,"Source Code By File",A="FF:~/Web/LineRep.TXT,KStart16.CPP"$ $TX,"Source Code (Raw)",HTML="http://www.templeos.org/Wb/"$ - -$TX,"Source Code By Sym",HTML="http://www.templeos.org/Wb/Home/Web/SymsAlpha.html"$ $TX,"Source Code By Address",HTML="http://www.templeos.org/Wb/Home/Web/SymsAddress.html"$ - -$LK,"Change Log",A="FI:::/Doc/ChangeLog.TXT"$ $LK,"History of TempleOS",A="FI:::/Home/Web/History.TXT"$ - -$LK,"TempleOS Credits",A="FI:::/Doc/Credits.TXT"$ $LK,"About Terry Davis",A="FI:::/Home/Web/TAD/TAD.TXT"$ -$FG$ -The Brits are moving to $TX,"ban \"hacking tools\"",HTML="http://www.theregister.co.uk/2008/01/02/hacker_toll_ban_guidance"$. Take my $LK,"unassembler",A="MN:Ui"$ from my cold dead hands. NRA is for guns; IRA is for computers. - -$HC,""$ - -TempleOS is a free, public domain, open source, $FG,4$$TX,"x86_64",HTML="http://en.wikipedia.org/wiki/Amd64#AMD64"$$FG$, non-preemptive multi-tasking, multi-cored, $FG,4$$TX,"ring-0-only",HTML="http://en.wikipedia.org/wiki/Ring_(computer_security)"$$FG$, single-address-map ($FG,4$$TX,"identity-mapped",HTML="http://en.wikipedia.org/wiki/Identity_(mathematics)"$$FG$), non-networked, PC operating system. Paging is, basically, not used. - -This $TX,"\"Hello World\" joke",HTML="http://www.infiltec.com/j-h-wrld.htm"$, the $TX,"BMP file format",HTML="http://en.wikipedia.org/wiki/BMP_file_format"$ and the $TX,"WAV file format",HTML="http://en.wikipedia.org/wiki/WAV"$ show that the industry is really screwed-up! That's what TempleOS fixes. I capped the line-of-code count at 100,000 and God said it must be perfect, so it will never be an ugly monstrocity. It is currently $TX,"81,046",D="DD_TEMPLEOS_LOC_OFFICIAL"$ lines of unblemished code. Backward compatibility is not promised. - -Normally, failure is not an option, but since TempleOS accompanies Windows or Linux, we exclude certain uses. There is no reason to duplicate browsing, multimedia, desktop publishing, etc. Linux wants to be a secure, multi-user mainframe. That's why it has file permissions. The vision for TempleOS, however, is a modern, 64-bit Commodore 64. The C64 was a non-networked, home computer mostly used for games. It trained my generation how to program because it was wide open, completely hackable. The games were not multimedia works of art, but generated by non-artist. - -A troll might ask, "Why not just use $FG,4$$TX,"DOS",HTML="http://en.wikipedia.org/wiki/DOS"$$FG$? It was ring-0-only and single-address-map." $FG,4$$TX,"DOS",HTML="http://en.wikipedia.org/wiki/DOS"$$FG$ was 16-bit, with segmentation -- awful! TempleOS is 64-bit, flat, non-segmented and multi-cored. It has a C64-like shell with $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$, a dialect of C/C++, instead of BASIC. It was written from scratch, and not even ASCII was sacred -- it has 8-bit unsigned char source code to support European languages. Also, the source code supports binary sprite graphics. - -A troll might say, "It can crash!" We used $FG,4$$TX,"DOS",HTML="http://en.wikipedia.org/wiki/DOS"$$FG$ for years and loved it. Computers even had a reset switch! Just think of the power of ring-0, muhahaha! Think of the speed and simplicity of $FG,4$$TX,"ring-0-only",HTML="http://en.wikipedia.org/wiki/Ring_(computer_security)"$$FG$ and $FG,4$$TX,"identity-mapping",HTML="http://en.wikipedia.org/wiki/Identity_(mathematics)"$$FG$. It can change tasks in half a microsecond because it doesn't mess with page tables or privilege levels. Inter-process communication is effortless because every task can access every other task's memory. - -It's fun having access to everything. When I was a teenager, I had a book, $FG,4$$TX,"Mapping the Commodore 64",HTML="http://unusedino.de/ec64/technical/project64/mapping_c64.html"$$FG$, that told what every location in memory did. I liked copying the ROM to RAM and poking around at the ROM BASIC's variables. Everybody directly poked the hardware ports. - -TempleOS is simpler than Linux and you can have hours of fun tinkering because all memory and ports are accessible. Memory is $FG,4$$TX,"identity-mapped",HTML="http://en.wikipedia.org/wiki/Identity_(mathematics)"$$FG$ at all times, so you can modify any task's memory from any other task. You can access all disk blocks, too. I had a blast using a C64 disk block editor to modify directories to un-delete files, when I was a kid. Maybe, you want to play with a raw-block database, or make your own file system? - -$HC,""$ - -$HC,""$ - -I wrote all $LK,"121,430",A="FF:~/Web/LineRep.TXT,Kernel.PRJ",D="DD_TEMPLEOS_LOC"$ lines of TempleOS over the last $TX,"12.9",D="DD_TEMPLEOS_AGE"$ years, full-time, including the 64-bit compiler. It was called, at various times, "$FG,4$$TX,"Hoppy",HTML="http://web.archive.org/web/*/http://www.simstructure.hare.com/*"$$FG$", "$FG,4$$TX,"The J Operating System",HTML="http://wayback.archive.org/web/*/http://www.justrighteous.org/*"$$FG$", "$FG,4$$TX,"LoseThos",HTML="http://web.archive.org/web/*/http://www.losethos.com/*"$$FG$" and "$FG,4$$TX,"SparrowOS",HTML="http://web.archive.org/web/*/http://www.sparrowos.com/*"$$FG$". Here are my $FG,4$$TX,"college transcripts",HTML="http://www.templeos.org/files/ASU_Transcripts.pdf"$$FG$. I've been a professional operating system developer since 1990 when I was hired to work on Ticketmaster's VAX OS. - -$FG,8$ -* "Commodore 64" was a trademark owned by Commodore Business Machines. -* "Linux" is a trademark owned by Linus Torvalds. -* "Windows" and "DOS" are trademarks owned by MicroSoft Corp. diff --git a/Demo/ToHtmlToTXTDemo/HtmlGen.CPP b/Demo/ToHtmlToTXTDemo/HtmlGen.CPP deleted file mode 100644 index 56a4fed..0000000 --- a/Demo/ToHtmlToTXTDemo/HtmlGen.CPP +++ /dev/null @@ -1,25 +0,0 @@ -/* This converts $LK,"::/Demo/ToHtmlToTXTDemo/DemoInPage.TXT"$ to -an html document named "OutPage.html". - -Notice that an entry like $$TX,"GOOGLE",HTML="http://www.google.com"$$ -will be converted to text in the html with an html link. - -I cheated by hardcoding $LK,"www.templeos.org",A="FF:::/Demo/ToHtmlToTXTDemo/ToHtml.CPP,www.templeos.org"$ as the website -for $LK,"TempleOS Links",A="MN:LK_FILE"$. Why don't you copy -$LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.CPP"$ to your /Home directory -and modify it? You are welcome to link to -http://www.templeos.org if you want file that come on the -TempleOS distribution. - -You can pass html meta data as args to $LK,"ToHtml",A="FF:::/Demo/ToHtmlToTXTDemo/ToHtml.CPP,ToHtml"$(). - -If you want to blog like I do, see these files... -$LK,"::/Demo/AcctExample/TOSToHtml.CPP"$ -$LK,"::/Demo/AcctExample/HomeKeyPlugIns.CPP"$ -$LK,"::/Demo/AcctExample/TOSHolySpirit.CPP"$ -*/ - -Cd(__DIR__);; -#include "ToHtml" - -ToHtml("DemoInPage.TXT.Z","~/DemoOutPage.html"); diff --git a/Demo/ToHtmlToTXTDemo/HtmlGen.HC b/Demo/ToHtmlToTXTDemo/HtmlGen.HC new file mode 100644 index 0000000..f87bc85 --- /dev/null +++ b/Demo/ToHtmlToTXTDemo/HtmlGen.HC @@ -0,0 +1,25 @@ +/* This converts $LK,"::/Demo/ToHtmlToTXTDemo/DemoInPage.DD"$ to +an html document named "OutPage.html". + +Notice that an entry like $$TX,"GOOGLE",HTML="http://www.google.com"$$ +will be converted to text in the html with an html link. + +I cheated by hardcoding $LK,"www.templeos.org",A="FF:::/Demo/ToHtmlToTXTDemo/ToHtml.HC,www.templeos.org"$ as the website +for $LK,"TempleOS Links",A="MN:LK_FILE"$. Why don't you copy +$LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$ to your /Home directory +and modify it? You are welcome to link to +http://www.templeos.org if you want file that come on the +TempleOS distribution. + +You can pass html meta data as args to $LK,"ToHtml",A="FF:::/Demo/ToHtmlToTXTDemo/ToHtml.HC,ToHtml"$(). + +If you want to blog like I do, see these files... +$LK,"::/Demo/AcctExample/TOSToHtml.HC"$ +$LK,"::/Demo/AcctExample/HomeKeyPlugIns.HC"$ +$LK,"::/Demo/AcctExample/TOSHolySpirit.HC"$ +*/ + +Cd(__DIR__);; +#include "ToHtml" + +ToHtml("DemoInPage.DD.Z","~/DemoOutPage"); diff --git a/Demo/ToHtmlToTXTDemo/TXTGen.CPP b/Demo/ToHtmlToTXTDemo/TXTGen.CPP deleted file mode 100644 index 65a9a8c..0000000 --- a/Demo/ToHtmlToTXTDemo/TXTGen.CPP +++ /dev/null @@ -1,8 +0,0 @@ -/* This converts $LK,"::/Demo/ToHtmlToTXTDemo/DemoInPage.TXT"$ to -an plain ASCII text document named, "OutPage.TXT". - -*/ - -Cd(__DIR__);; - -ToTXT("DemoInPage.TXT.Z","~/DemoOutPage.TXT"); diff --git a/Demo/ToHtmlToTXTDemo/TXTGen.HC b/Demo/ToHtmlToTXTDemo/TXTGen.HC new file mode 100644 index 0000000..a4cf257 --- /dev/null +++ b/Demo/ToHtmlToTXTDemo/TXTGen.HC @@ -0,0 +1,8 @@ +/* This converts $LK,"::/Demo/ToHtmlToTXTDemo/DemoInPage.DD"$ to +an plain ASCII text document named, "OutPage.DD". + +*/ + +Cd(__DIR__);; + +ToTXT("DemoInPage.DD.Z","~/DemoOutPage"); diff --git a/Demo/ToHtmlToTXTDemo/ToHtml.CPP b/Demo/ToHtmlToTXTDemo/ToHtml.CPP deleted file mode 100644 index c2df55d..0000000 --- a/Demo/ToHtmlToTXTDemo/ToHtml.CPP +++ /dev/null @@ -1,334 +0,0 @@ -#help_index "DolDoc/Conversion" - -//See $LK,"::/Doc/Credits.TXT"$. - -U0 HtmlPutS(CDoc *doc,I64 u32_attr,I64 *_old_u32_attr, - U8 *st,I64 *_col,U8 *style_bitmap=NULL) -{ - U8 *ch,*ptr; - u32_attr&=0xFFFFFF00; - if (u32_attr&DOCET_INVERT) - u32_attr.u8[1]=(u32_attr.u8[1]&15)<<4|u32_attr.u8[1]>>4; - if (u32_attr!=*_old_u32_attr) { - if (!(u32_attr&DOCET_BLINK) && - *_old_u32_attr!=-1 && *_old_u32_attr&DOCET_BLINK) - DocPrint(doc,""); - if (*_old_u32_attr!=-1) - DocPrint(doc,""); - DocPrint(doc,"",u32_attr.u8[1]); - if (u32_attr&DOCET_BLINK && - (*_old_u32_attr==-1 || !(*_old_u32_attr&DOCET_BLINK))) - DocPrint(doc,""); - *_old_u32_attr=u32_attr; - if (style_bitmap) - LBts(style_bitmap,u32_attr.u8[1]); - } - while (ch=*st++) { - switch (ch) { - case '\t': - do { - DocPutKey(doc,CH_SPACE,0); - *_col=*_col+1; - } while (*_col&7); - break; - - start: - case 'ã': ptr="pi"; break; - case 'é': ptr="theta"; break; - case 'è': ptr="phi"; break; - case 'ê': ptr="omega"; break; - case 'ì': ptr="inf"; break; - case 'æ': ptr="u"; break; - end: - DocPrint(doc,ptr); - *_col=*_col+StrLen(ptr); - break; - - start: - case CH_SHIFT_SPACE: ptr=" "; break; - case '&': ptr="&"; break; - case '<': ptr="<"; break; - case '>': ptr=">"; break; - case '"': ptr="""; break; - end: - DocPrint(doc,ptr); - *_col=*_col+1; - break; - - default: - if (CH_SPACE<=ch<0x7F || ch=='\n') - DocPutKey(doc,ch,0); - else - DocPrint(doc,"."); - *_col=*_col+1; - } - } -} - -U8 *TOSLinkCvt2(U8 *filename,I64 line_num) -{// ::/ --> http://www.templeos.org/Wb/ -//Make your own LinkCvt routine - U8 *res=NULL,*st; - if (filename) { - st=ChgExt(filename,"html"); - if (st && StrLen(st)>3 && !StrNCmp(st+1,":/",2)) - res=MStrPrint("http://www.templeos.org/Wb/%s#l%d",st+3,line_num); - Free(st); - } - return res; -} - -U8 *TOSLinkCvt1(U8 *link_st) -{ - static CDoc *bible=NULL; - static I64 locks=0; - U8 *res=NULL,*filename,*needle; - I64 i,num; - if (link_st) { - switch (i=EdLinkCvt(link_st,&filename,&needle,&num)) { - case LK_FILE_LINE: - case LK_PLAIN_LINE: - case LK_FILE: - res=TOSLinkCvt2(filename,num); - break; - case -1: - case LK_DEF: - case LK_HELP_INDEX: - case LK_DOC: - case LK_DOC_ANCHOR: - case LK_DOC_FIND: - case LK_DOC_LINE: - break; - case LK_BIBLE_FIND: - while (LBts(&locks,0)) - Yield; - if (!bible) - bible=Adam("DocRead(\"%s\");",filename); - if (DocFind(bible,num,needle)) - res=TOSLinkCvt2(filename,bible->cur_entry->y+1); - LBtr(&locks,0); - break; - default: - if (DocFileEd(i,filename,needle,&num,EDF_UNCOLLAPSE|EDF_BAIL)) - res=TOSLinkCvt2(filename,num); - } - Free(filename); - Free(needle); - } - return res; -} - -public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL, - U8 *body_footer=NULL,U8 *html_footer=NULL,Bool line_anchors=TRUE, - U8 (*link_cvt)(U8 *link_st)=&TOSLinkCvt1) -{//Cvt $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$doc to HTML file. - CDocEntry *doc_e,*style,*doc_e2; - I64 i,y,old_y=MIN_I64,col,old_u32_attr=-1,old_attr; - U32 *hl,*src; - U8 *st,st_2[2],*link_st,*style_bitmap=CAlloc(256/8); - CBGR48 p[NUM_COLORS]; - GrPaletteGet(p); - CDoc *doc_out=DocNew; - Bool unlock_doc_in=DocLock(doc_in),no_bwd; - - old_attr=doc_in->win_task->text_attr; - doc_in->win_task->text_attr=DOC_ATTR_DFT_TEXT; - - for (i=0xF0;i<=0xFF;i++) - LBts(style_bitmap,i); - - DocRecalc(doc_in,RECALCt_NORMAL|RECALCF_TO_HTML); - - st_2[0]=0; st_2[1]=0; - doc_out->flags|=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR; - - if (!html_header) html_header= - "\n" - "\n" - "\n" - "\n" - "\n"; - if (!body_header) body_header= - "\n" - "
\n";
-  if (!body_footer) body_footer=
-	  "
\n\n"; - if (!html_footer) html_footer= - "\n"; - - DocPrint(doc_out,"%s",html_header); - - DocPrint(doc_out,"\n" - "\n"); - DocPrint(doc_out,"%s",body_header); - - doc_e=doc_in->head.next; - col=doc_e->x; - y=doc_e->y; - while (doc_e!=doc_in) { - if (!(doc_e->de_flags&DOCEF_SKIP)) { - if (y!=old_y && line_anchors) { - DocPrint(doc_out,"",y+1); - old_y=y; - } - while (yy) { - HtmlPutS(doc_out,doc_e->settings.final_u32_attr, - &old_u32_attr,"\n",&col,style_bitmap); - if (++y!=old_y && line_anchors) { - DocPrint(doc_out,"",y+1); - old_y=y; - } - col=0; - } - - no_bwd=TRUE; - doc_e2=doc_e->next; - while (doc_e2!=doc_in && doc_e2->y==doc_e->y) { - if (doc_e2->xx) { - no_bwd=FALSE; - break; - } - doc_e2=doc_e2->next; - } - if (no_bwd) - while (colx) - HtmlPutS(doc_out,doc_e->settings.final_u32_attr, - &old_u32_attr," ",&col,style_bitmap); - - link_st=NULL; - if (doc_e->de_flags&DOCEF_HTML_LINK) - link_st=StrNew(doc_e->html_link); - else if (st=DocEntryLink(doc_in,doc_e)) { - link_st=link_cvt(st); - Free(st); - } - - if (link_st) { - if (old_u32_attr!=-1) { - DocPrint(doc_out,"
"); - old_u32_attr=-1; - } - DocPrint(doc_out,"",link_st); - } - - switch (doc_e->type_u8) { - case DOCT_TEXT: - if (doc_e->de_flags&DOCEF_HIGHLIGHT) { - if (doc_e->last==doc_in) - MemCpy(&doc_e->settings,&doc_in->settings_head, - sizeof(CDocSettings)); - else - MemCpy(&doc_e->settings,&doc_e->last->settings, - sizeof(CDocSettings)); - src=hl=DocHighlight(doc_e,doc_e->tag,StrLen(doc_e->tag), - doc_e->type&0xFF00); - while (*src) { - st_2[0]=*src&0xFF; - HtmlPutS(doc_out,*src++,&old_u32_attr,st_2,&col,style_bitmap); - } - Free(hl); - } else - HtmlPutS(doc_out,doc_e->settings.final_u32_attr, - &old_u32_attr,doc_e->tag,&col,style_bitmap); - break; - case DOCT_TAB: - HtmlPutS(doc_out,doc_e->settings.final_u32_attr, - &old_u32_attr,"\t",&col,style_bitmap); - break; - case DOCT_HTML_CODE: - if (old_u32_attr!=-1) { - DocPrint(doc_out,""); - old_u32_attr=-1; - } - DocPrint(doc_out,"%s",doc_e->tag); - break; - case DOCT_SPRITE: - HtmlPutS(doc_out,doc_e->settings.final_u32_attr, - &old_u32_attr,doc_e->tag,&col,style_bitmap); - HtmlPutS(doc_out,doc_e->settings.final_u32_attr, - &old_u32_attr,"/* Graphics Not Rendered in HTML */", - &col,style_bitmap); - break; - default: - if (doc_e->de_flags&DOCEF_TAG) - HtmlPutS(doc_out,doc_e->settings.final_u32_attr, - &old_u32_attr,doc_e->tag,&col,style_bitmap); - } - if (link_st) { - if (old_u32_attr!=-1) { - DocPrint(doc_out,""); - old_u32_attr=-1; - } - DocPrint(doc_out,""); - Free(link_st); - } - } - doc_e=doc_e->next; - } - while (y++y) { - HtmlPutS(doc_out,doc_e->settings.final_u32_attr, - &old_u32_attr,"\n",&col,style_bitmap); - col=0; - } - if (old_u32_attr!=-1) { - if (old_u32_attr&DOCET_BLINK) - DocPrint(doc_out,""); - DocPrint(doc_out,""); - old_u32_attr=-1; - } - DocPrint(doc_out,"%s",body_footer); - DocPrint(doc_out,"%s",html_footer); - - doc_out->cur_entry=style->next; - for (i=0;i<256;i++) - if (Bt(style_bitmap,i)) - DocPrint(doc_out, - ".c%02X{color:#%02x%02x%02x;background-color:#%02x%02x%02x;}\n", - i,p[i&15].r>>8,p[i&15].g>>8,p[i&15].b>>8, - p[i/16].r>>8,p[i/16].g>>8,p[i/16].b>>8); - doc_out->cur_entry=&doc_out->head; - DocRecalc(doc_out); - - doc_in->win_task->text_attr=old_attr; - - if (unlock_doc_in) - DocUnlock(doc_in); - return doc_out; -} - -#help_index "Cmd Line (Typically);DolDoc/Conversion;DolDoc/Cmd Line (Typically)" -public U0 ToHtml(U8 *_in_name,U8 *_out_name=NULL,U8 *html_header=NULL, - U8 *body_header=NULL,U8 *body_footer=NULL,U8 *html_footer=NULL, - I64 width=80,Bool line_anchors=TRUE, - U8 (*link_cvt)(U8 *link_st)=&TOSLinkCvt1) -{//Convert $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$file to HTML. -//Supply your own link_cvt routine. - U8 *in_name,*out_name; - CDoc *doc_in,*doc_out; - - SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ - WinHorz(0,width-1); //Sets doc width for word wrap. - - in_name=DftExt(_in_name,"CPP.Z"); - if (_out_name) - out_name=DftExt(_out_name,"html"); - else - out_name=ChgExt(_in_name,"html"); - - doc_in=DocRead(in_name); - doc_out=Doc2Html(doc_in,html_header,body_header,body_footer,html_footer, - line_anchors,link_cvt); - StrCpy(&doc_out->filename.name,out_name); - - SettingsPop; - - DocWrite(doc_out); - DocDel(doc_in); - DocDel(doc_out); - Free(in_name); - Free(out_name); -} diff --git a/Demo/ToHtmlToTXTDemo/ToHtml.HC b/Demo/ToHtmlToTXTDemo/ToHtml.HC new file mode 100644 index 0000000..234ed1e --- /dev/null +++ b/Demo/ToHtmlToTXTDemo/ToHtml.HC @@ -0,0 +1,334 @@ +#help_index "DolDoc/Conversion" + +//See $LK,"::/Doc/Credits.DD"$. + +U0 HtmlPutS(CDoc *doc,I64 u32_attr,I64 *_old_u32_attr, + U8 *st,I64 *_col,U8 *style_bitmap=NULL) +{ + U8 *ch,*ptr; + u32_attr&=0xFFFFFF00; + if (u32_attr&DOCET_INVERT) + u32_attr.u8[1]=(u32_attr.u8[1]&15)<<4|u32_attr.u8[1]>>4; + if (u32_attr!=*_old_u32_attr) { + if (!(u32_attr&DOCET_BLINK) && + *_old_u32_attr!=-1 && *_old_u32_attr&DOCET_BLINK) + DocPrint(doc,""); + if (*_old_u32_attr!=-1) + DocPrint(doc,""); + DocPrint(doc,"",u32_attr.u8[1]); + if (u32_attr&DOCET_BLINK && + (*_old_u32_attr==-1 || !(*_old_u32_attr&DOCET_BLINK))) + DocPrint(doc,""); + *_old_u32_attr=u32_attr; + if (style_bitmap) + LBts(style_bitmap,u32_attr.u8[1]); + } + while (ch=*st++) { + switch (ch) { + case '\t': + do { + DocPutKey(doc,CH_SPACE,0); + *_col=*_col+1; + } while (*_col&7); + break; + + start: + case 'ã': ptr="pi"; break; + case 'é': ptr="theta"; break; + case 'è': ptr="phi"; break; + case 'ê': ptr="omega"; break; + case 'ì': ptr="inf"; break; + case 'æ': ptr="u"; break; + end: + DocPrint(doc,ptr); + *_col=*_col+StrLen(ptr); + break; + + start: + case CH_SHIFT_SPACE: ptr=" "; break; + case '&': ptr="&"; break; + case '<': ptr="<"; break; + case '>': ptr=">"; break; + case '"': ptr="""; break; + end: + DocPrint(doc,ptr); + *_col=*_col+1; + break; + + default: + if (CH_SPACE<=ch<0x7F || ch=='\n') + DocPutKey(doc,ch,0); + else + DocPrint(doc,"."); + *_col=*_col+1; + } + } +} + +U8 *TOSLinkCvt2(U8 *filename,I64 line_num) +{// ::/ --> http://www.templeos.org/Wb/ +//Make your own LinkCvt routine + U8 *res=NULL,*st; + if (filename) { + st=ChgExt(filename,"html"); + if (st && StrLen(st)>3 && !StrNCmp(st+1,":/",2)) + res=MStrPrint("http://www.templeos.org/Wb/%s#l%d",st+3,line_num); + Free(st); + } + return res; +} + +U8 *TOSLinkCvt1(U8 *link_st) +{ + static CDoc *bible=NULL; + static I64 locks=0; + U8 *res=NULL,*filename,*needle; + I64 i,num; + if (link_st) { + switch (i=EdLinkCvt(link_st,&filename,&needle,&num)) { + case LK_FILE_LINE: + case LK_PLAIN_LINE: + case LK_FILE: + res=TOSLinkCvt2(filename,num); + break; + case -1: + case LK_DEF: + case LK_HELP_INDEX: + case LK_DOC: + case LK_DOC_ANCHOR: + case LK_DOC_FIND: + case LK_DOC_LINE: + break; + case LK_BIBLE_FIND: + while (LBts(&locks,0)) + Yield; + if (!bible) + bible=Adam("DocRead(\"%s\");",filename); + if (DocFind(bible,num,needle)) + res=TOSLinkCvt2(filename,bible->cur_entry->y+1); + LBtr(&locks,0); + break; + default: + if (DocFileEd(i,filename,needle,&num,EDF_UNCOLLAPSE|EDF_BAIL)) + res=TOSLinkCvt2(filename,num); + } + Free(filename); + Free(needle); + } + return res; +} + +public CDoc *Doc2Html(CDoc *doc_in,U8 *html_header=NULL,U8 *body_header=NULL, + U8 *body_footer=NULL,U8 *html_footer=NULL,Bool line_anchors=TRUE, + U8 (*link_cvt)(U8 *link_st)=&TOSLinkCvt1) +{//Cvt $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$doc to HTML file. + CDocEntry *doc_e,*style,*doc_e2; + I64 i,y,old_y=MIN_I64,col,old_u32_attr=-1,old_attr; + U32 *hl,*src; + U8 *st,st_2[2],*link_st,*style_bitmap=CAlloc(256/8); + CBGR48 p[NUM_COLORS]; + GrPaletteGet(p); + CDoc *doc_out=DocNew; + Bool unlock_doc_in=DocLock(doc_in),no_bwd; + + old_attr=doc_in->win_task->text_attr; + doc_in->win_task->text_attr=DOC_ATTR_DFT_TEXT; + + for (i=0xF0;i<=0xFF;i++) + LBts(style_bitmap,i); + + DocRecalc(doc_in,RECALCt_NORMAL|RECALCF_TO_HTML); + + st_2[0]=0; st_2[1]=0; + doc_out->flags|=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR; + + if (!html_header) html_header= + "\n" + "\n" + "\n" + "\n" + "\n"; + if (!body_header) body_header= + "\n" + "
\n";
+  if (!body_footer) body_footer=
+	  "
\n\n"; + if (!html_footer) html_footer= + "\n"; + + DocPrint(doc_out,"%s",html_header); + + DocPrint(doc_out,"\n" + "\n"); + DocPrint(doc_out,"%s",body_header); + + doc_e=doc_in->head.next; + col=doc_e->x; + y=doc_e->y; + while (doc_e!=doc_in) { + if (!(doc_e->de_flags&DOCEF_SKIP)) { + if (y!=old_y && line_anchors) { + DocPrint(doc_out,"",y+1); + old_y=y; + } + while (yy) { + HtmlPutS(doc_out,doc_e->settings.final_u32_attr, + &old_u32_attr,"\n",&col,style_bitmap); + if (++y!=old_y && line_anchors) { + DocPrint(doc_out,"",y+1); + old_y=y; + } + col=0; + } + + no_bwd=TRUE; + doc_e2=doc_e->next; + while (doc_e2!=doc_in && doc_e2->y==doc_e->y) { + if (doc_e2->xx) { + no_bwd=FALSE; + break; + } + doc_e2=doc_e2->next; + } + if (no_bwd) + while (colx) + HtmlPutS(doc_out,doc_e->settings.final_u32_attr, + &old_u32_attr," ",&col,style_bitmap); + + link_st=NULL; + if (doc_e->de_flags&DOCEF_HTML_LINK) + link_st=StrNew(doc_e->html_link); + else if (st=DocEntryLink(doc_in,doc_e)) { + link_st=link_cvt(st); + Free(st); + } + + if (link_st) { + if (old_u32_attr!=-1) { + DocPrint(doc_out,"
"); + old_u32_attr=-1; + } + DocPrint(doc_out,"",link_st); + } + + switch (doc_e->type_u8) { + case DOCT_TEXT: + if (doc_e->de_flags&DOCEF_HIGHLIGHT) { + if (doc_e->last==doc_in) + MemCpy(&doc_e->settings,&doc_in->settings_head, + sizeof(CDocSettings)); + else + MemCpy(&doc_e->settings,&doc_e->last->settings, + sizeof(CDocSettings)); + src=hl=DocHighlight(doc_e,doc_e->tag,StrLen(doc_e->tag), + doc_e->type&0xFF00); + while (*src) { + st_2[0]=*src&0xFF; + HtmlPutS(doc_out,*src++,&old_u32_attr,st_2,&col,style_bitmap); + } + Free(hl); + } else + HtmlPutS(doc_out,doc_e->settings.final_u32_attr, + &old_u32_attr,doc_e->tag,&col,style_bitmap); + break; + case DOCT_TAB: + HtmlPutS(doc_out,doc_e->settings.final_u32_attr, + &old_u32_attr,"\t",&col,style_bitmap); + break; + case DOCT_HTML_CODE: + if (old_u32_attr!=-1) { + DocPrint(doc_out,""); + old_u32_attr=-1; + } + DocPrint(doc_out,"%s",doc_e->tag); + break; + case DOCT_SPRITE: + HtmlPutS(doc_out,doc_e->settings.final_u32_attr, + &old_u32_attr,doc_e->tag,&col,style_bitmap); + HtmlPutS(doc_out,doc_e->settings.final_u32_attr, + &old_u32_attr,"/* Graphics Not Rendered in HTML */", + &col,style_bitmap); + break; + default: + if (doc_e->de_flags&DOCEF_TAG) + HtmlPutS(doc_out,doc_e->settings.final_u32_attr, + &old_u32_attr,doc_e->tag,&col,style_bitmap); + } + if (link_st) { + if (old_u32_attr!=-1) { + DocPrint(doc_out,""); + old_u32_attr=-1; + } + DocPrint(doc_out,""); + Free(link_st); + } + } + doc_e=doc_e->next; + } + while (y++y) { + HtmlPutS(doc_out,doc_e->settings.final_u32_attr, + &old_u32_attr,"\n",&col,style_bitmap); + col=0; + } + if (old_u32_attr!=-1) { + if (old_u32_attr&DOCET_BLINK) + DocPrint(doc_out,""); + DocPrint(doc_out,""); + old_u32_attr=-1; + } + DocPrint(doc_out,"%s",body_footer); + DocPrint(doc_out,"%s",html_footer); + + doc_out->cur_entry=style->next; + for (i=0;i<256;i++) + if (Bt(style_bitmap,i)) + DocPrint(doc_out, + ".c%02X{color:#%02x%02x%02x;background-color:#%02x%02x%02x;}\n", + i,p[i&15].r>>8,p[i&15].g>>8,p[i&15].b>>8, + p[i/16].r>>8,p[i/16].g>>8,p[i/16].b>>8); + doc_out->cur_entry=&doc_out->head; + DocRecalc(doc_out); + + doc_in->win_task->text_attr=old_attr; + + if (unlock_doc_in) + DocUnlock(doc_in); + return doc_out; +} + +#help_index "Cmd Line (Typically);DolDoc/Conversion;DolDoc/Cmd Line (Typically)" +public U0 ToHtml(U8 *_in_name,U8 *_out_name=NULL,U8 *html_header=NULL, + U8 *body_header=NULL,U8 *body_footer=NULL,U8 *html_footer=NULL, + I64 width=80,Bool line_anchors=TRUE, + U8 (*link_cvt)(U8 *link_st)=&TOSLinkCvt1) +{//Convert $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$file to HTML. +//Supply your own link_cvt routine. + U8 *in_name,*out_name; + CDoc *doc_in,*doc_out; + + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + WinHorz(0,width-1); //Sets doc width for word wrap. + + in_name=DftExt(_in_name,"HC.Z"); + if (_out_name) + out_name=DftExt(_out_name,"html"); + else + out_name=ChgExt(_in_name,"html"); + + doc_in=DocRead(in_name); + doc_out=Doc2Html(doc_in,html_header,body_header,body_footer,html_footer, + line_anchors,link_cvt); + StrCpy(&doc_out->filename.name,out_name); + + SettingsPop; + + DocWrite(doc_out); + DocDel(doc_in); + DocDel(doc_out); + Free(in_name); + Free(out_name); +} diff --git a/Demo/WebLogDemo/WebLogRep.CPP b/Demo/WebLogDemo/WebLogRep.CPP deleted file mode 100644 index 2b619d7..0000000 --- a/Demo/WebLogDemo/WebLogRep.CPP +++ /dev/null @@ -1,524 +0,0 @@ -#define DOWNLOAD_FILE1 "TempleOSCD.ISO" -#define DOWNLOAD_FILE1_SIZE 17000000 -#define DOWNLOAD_FILE2 "TempleOSUltra.ISO" -#define DOWNLOAD_FILE2_SIZE 1900000 -#define DOWNLOAD_FILE3 "TempleOSCDRS.ISO" -#define DOWNLOAD_FILE3_SIZE 16000000 -#define DOWNLOAD_FILE4 "TempleOSUltraRS.ISO" -#define DOWNLOAD_FILE4_SIZE 1600000 - -#define MAX_HOURS (24*3) - -class LogStruct -{ - LogStruct *next,*last; - LogStruct *ip_num_left,*ip_num_right; - U32 ip_num,code; - I64 size; - U8 *file,*link; - CDate datetime; -}; - -class LinkStruct -{ - LinkStruct *left,*right; - U8 *link,*file; - I64 cnt; -}; - -class BlockedStruct -{ - BlockedStruct *next,*last; - U32 ip_num; -}; - -U0 LogStructDel(LogStruct *templg) -{ - Free(templg->file); - Free(templg->link); - Free(templg); -} - -U0 PrsSingleLogFile(LogStruct *head,U8 *name,CDate *_start,CDate *_end) -{ - CDoc *doc=DocRead(name, - DOCF_PLAIN_TEXT_TABS|DOCF_DBL_DOLLARS|DOCF_NO_CURSOR); - CDocEntry *doc_e=doc->head.next; - U8 *src,*src2,*mon_lst=Define("ST_MONTHS"); - LogStruct *templg; - CDateStruct ds; - I64 i; - "%Q\n",name; - while (doc_e!=doc) { - if (doc_e->type_u8==DOCT_TEXT) { - templg=CAlloc(sizeof(LogStruct)); - try { - src=doc_e->tag; - templg->ip_num.u8[3]=Str2I64(src,10,&src); - if (*src++!='.') throw; - templg->ip_num.u8[2]=Str2I64(src,10,&src); - if (*src++!='.') throw; - templg->ip_num.u8[1]=Str2I64(src,10,&src); - if (*src++!='.') throw; - templg->ip_num.u8[0]=Str2I64(src,10,&src); - - do if (!*src) throw; - while (*src++!='['); - MemSet(&ds,0,sizeof(CDateStruct)); - ds.day_of_mon=Str2I64(src,10,&src); - if (*src++!='/') throw; - src2=src; - do if (!*src2) throw; - while (*src2++!='/'); - * --src2=0; - ds.mon=1+LstMatch(src,mon_lst,LMF_IGNORE_CASE); - src=++src2; - ds.year=Str2I64(src,10,&src); - if (*src++!=':') throw; - ds.hour=Str2I64(src,10,&src); - if (*src++!=':') throw; - ds.min=Str2I64(src,10,&src); - if (*src++!=':') throw; - ds.sec=Str2I64(src,10,&src); - templg->datetime=Struct2Date(&ds); - if (*src++!=CH_SPACE) throw; - i=Str2I64(src,10,&src); - templg->datetime-=(i/100+i%100/60.0)*CDATE_FREQ*60*60; - - if (templg->datetime<*_start) *_start=templg->datetime; - if (templg->datetime>*_end) *_end =templg->datetime; - - do if (!*src) throw; - while (*src++!=']'); - - if (*src++!=CH_SPACE) throw; - if (*src++!='\"') throw; - if (!StrNCmp(src,"GET ",4)) { - src2=src+=4; - do if (!*src2) throw; - while (*src2++!=CH_SPACE); - * --src2=0; - templg->file=StrNew(src); - src=++src2; - - do if (!*src) throw; - while (*src++!='\"'); - - templg->code=Str2I64(src,10,&src); - if (*src++!=CH_SPACE) throw; - templg->size=Str2I64(src,10,&src); - if (*src++!=CH_SPACE) throw; - - if (*src++!='\"') throw; - src2=src; - do if (!*src2) throw; - while (*src2++!='\"'); - * --src2=0; - templg->link=StrNew(src); - src=++src2; - - QueIns(templg,head->last); - } else if (!StrNCmp(src,"HEAD ",5)) { - LogStructDel(templg); - } else - throw; - } catch { - Fs->catch_except=TRUE; - "%Q\n",doc_e->tag; - LogStructDel(templg); - } - } - doc_e=doc_e->next; - } - DocDel(doc); -} - -LogStruct *PrsLogFiles(U8 *files_find_mask,CDate *_start,CDate *_end) -{ - LogStruct *head=CAlloc(sizeof(LogStruct)); - CDirEntry *tempde=FilesFind(files_find_mask),*tempde1=tempde; - QueInit(head); - while (tempde) { - PrsSingleLogFile(head,tempde->full_name,_start,_end); - tempde=tempde->next; - } - DirTreeDel(tempde1); - return head; -} - -U0 LogLstDel(LogStruct *head) -{ - LogStruct *templg=head->next,*templg1; - while (templg!=head) { - templg1=templg->next; - LogStructDel(templg); - templg=templg1; - } -} - -U0 BlockedStructAdd(BlockedStruct *head,U32 ip_num) -{ - BlockedStruct *tempb=CAlloc(sizeof(BlockedStruct)); - tempb->ip_num=ip_num; - QueIns(tempb,head->last); -} - -Bool IsBlocked(BlockedStruct *head,U32 ip_num) -{ - BlockedStruct *tempb=head->next; - while (tempb!=head) { - if (tempb->ip_num==ip_num) - return TRUE; - tempb=tempb->next; - } - return FALSE; -} - -U0 BlockIPNums(LogStruct *head) -{ - BlockedStruct blocked_head; - LogStruct *templg=head->next,*templg1; - - QueInit(&blocked_head); - - BlockedStructAdd(&blocked_head,70<<24+173<<16+110<<8+214); - BlockedStructAdd(&blocked_head,68<<24+224<<16+130<<8+96); - BlockedStructAdd(&blocked_head,68<<24+96<<16+100<<8+126); - BlockedStructAdd(&blocked_head,68<<24+96<<16+110<<8+213); - BlockedStructAdd(&blocked_head,68<<24+96<<16+242<<8+108); - BlockedStructAdd(&blocked_head,68<<24+227<<16+61<<8+11); - BlockedStructAdd(&blocked_head,68<<24+227<<16+61<<8+139); - - //pass 1: collect robot lst - while (templg!=head) { - if (StrIMatch("ROBOT",templg->file) && - !IsBlocked(&blocked_head,templg->ip_num)) - BlockedStructAdd(&blocked_head,templg->ip_num); - templg=templg->next; - } - - //pass 2: removed blocked ip_nums - templg=head->next; - while (templg!=head) { - templg1=templg->next; - if (IsBlocked(&blocked_head,templg->ip_num)) { - QueRem(templg); - LogStructDel(templg); - } - templg=templg1; - } - - QueDel(&blocked_head); -} - -Bool IsDownLoad(LogStruct *templg) -{ - if (StrMatch(DOWNLOAD_FILE1,templg->file)&&templg->size>= - DOWNLOAD_FILE1_SIZE || - StrMatch(DOWNLOAD_FILE2,templg->file)&&templg->size>= - DOWNLOAD_FILE2_SIZE || - StrMatch(DOWNLOAD_FILE3,templg->file)&&templg->size>= - DOWNLOAD_FILE3_SIZE || - StrMatch(DOWNLOAD_FILE4,templg->file)&&templg->size>= - DOWNLOAD_FILE4_SIZE) - return TRUE; - else - return FALSE; -} - -Bool IsIndex(LogStruct *templg) -{ - if (!StrCmp(templg->file,"/index.html") || - !StrNCmp(templg->file+StrLen(templg->file)-14,"/TempleOS.html",14) || - !StrCmp(templg->file,"/")) - return TRUE; - else - return FALSE; -} - -Bool IPNumTreeAdd(LogStruct **_head,LogStruct *templg) -{ - LogStruct *head; - if (UnusedStk<0x200) { - PrintErr("Stk Overflow"); - ThrowBreak; - } - if (head=*_head) { - if (templg->ip_num==head->ip_num) - return TRUE; - else if (templg->ip_numip_num) - return IPNumTreeAdd(&head->ip_num_left,templg); - else - return IPNumTreeAdd(&head->ip_num_right,templg); - } else { - templg->ip_num_left=NULL; - templg->ip_num_right=NULL; - *_head=templg; - return FALSE; - } -} - -U0 LinkTreeAdd(LinkStruct **_root,LogStruct *templg) -{ - I64 i; - LinkStruct *root,*templk; - if (UnusedStk<0x200) { - PrintErr("Stk Overflow"); - ThrowBreak; - } - if (root=*_root) { - if (!(i=StrCmp(templg->link,root->link))) - root->cnt++; - else if (i<0) - LinkTreeAdd(&root->left,templg); - else - LinkTreeAdd(&root->right,templg); - } else { - templk=CAlloc(sizeof(LinkStruct)); - templk->link=templg->link; - templk->cnt=1; - *_root=templk; - } -} - -U0 FileTreeAdd(LinkStruct **_root,LogStruct *templg) -{ - I64 i; - LinkStruct *root,*templk; - if (UnusedStk<0x200) { - PrintErr("Stk Overflow"); - ThrowBreak; - } - if (root=*_root) { - if (!(i=StrCmp(templg->file,root->file))) - root->cnt++; - else if (i<0) - FileTreeAdd(&root->left,templg); - else - FileTreeAdd(&root->right,templg); - } else { - templk=CAlloc(sizeof(LinkStruct)); - templk->file=templg->file; - templk->cnt=1; - *_root=templk; - } -} - -U0 LinkTreeDel(LinkStruct *root) -{ - if (root) { - LinkTreeDel(root->left); - LinkTreeDel(root->right); - Free(root); - } -} - -U0 LinkTreeTraverse(LinkStruct *root) -{ - if (root) { - LinkTreeTraverse(root->left); - "%3d:%Q\n",root->cnt,root->link; - LinkTreeTraverse(root->right); - } -} - -U0 FileTreeDel(LinkStruct *root) -{ - if (root) { - FileTreeDel(root->left); - FileTreeDel(root->right); - Free(root); - } -} - -U0 FileTreeTraverse(LinkStruct *root) -{ - if (root) { - FileTreeTraverse(root->left); - "%3d:%Q\n",root->cnt,root->file; - FileTreeTraverse(root->right); - } -} - -U0 DownLoadRep(LogStruct *head,CDate start,CDate end) -{ - I64 i,j,cnt,dups, - hours_start,hours_end,*hour_cnts,*dup_cnts, - days_start,days_end,*day_cnts,*day_dup_cnts; - LogStruct *templg=head->next,*dup_head=NULL; - LinkStruct *link_root=NULL; - CDateStruct ds; - - i=start*24;hours_start=i.u32[1]; - i=end *24;hours_end =i.u32[1]; - - days_start=(start+local_time_offset)>>32; - days_end =(end+local_time_offset)>>32; - - hour_cnts=CAlloc((hours_end-hours_start+1)*sizeof(I64)); - dup_cnts =CAlloc((hours_end-hours_start+1)*sizeof(I64)); - day_cnts =CAlloc((days_end-days_start+1)*sizeof(I64)); - day_dup_cnts=CAlloc((days_end-days_start+1)*sizeof(I64)); - dups=cnt=0; - while (templg!=head) { - if (start<=templg->datetime<=end && IsDownLoad(templg)) { - i=templg->datetime*24; - hour_cnts[i.u32[1]-hours_start]++; - day_cnts[(templg->datetime+local_time_offset)>>32-days_start]++; - cnt++; - if (IPNumTreeAdd(&dup_head,templg)) { - day_dup_cnts[(templg->datetime+local_time_offset)>>32-days_start]++; - dup_cnts[i.u32[1]-hours_start]++; - dups++; - } - LinkTreeAdd(&link_root,templg); - } - templg=templg->next; - } - - "\n\nDownloads of /TempleOSCD.ISO\n"; - for (i=start;i<=end;i+=1<<32) - "%D:%5d%5d\n",i,day_dup_cnts[(i+local_time_offset)>>32-days_start], - day_cnts[(i+local_time_offset)>>32-days_start]; - - "\n\nDownloads of /TempleOSCD.ISO\n" - "'-' is a dup. '+' is not a dup.\n"; - if (hours_end-hours_start>=MAX_HOURS) - i=hours_end-MAX_HOURS+1; - else - i=hours_start; - for (;i<=hours_end;i++) { - Date2Struct(&ds,i<<32/24+local_time_offset); - "%D %02d: ",i<<32/24,ds.hour; - for (j=0;jnext; - LinkStruct *file_root=NULL; - while (templg!=head) { - if (start<=templg->datetime<=end) - FileTreeAdd(&file_root,templg); - templg=templg->next; - } - "\n\nFile Hits\n"; - FileTreeTraverse(file_root); - '\n'; - FileTreeDel(file_root); -} - -U0 IndexRep(LogStruct *head,CDate start,CDate end) -{ - I64 i,j,cnt,dups, - hours_start,hours_end,*hour_cnts,*dup_cnts, - days_start,days_end,*day_cnts,*day_dup_cnts; - LogStruct *templg=head->next,*dup_head=NULL; - LinkStruct *link_root=NULL; - CDateStruct ds; - - i=start*24;hours_start=i.u32[1]; - i=end *24;hours_end =i.u32[1]; - - days_start=(start+local_time_offset)>>32; - days_end =(end+local_time_offset)>>32; - - hour_cnts=CAlloc((hours_end-hours_start+1)*sizeof(I64)); - dup_cnts =CAlloc((hours_end-hours_start+1)*sizeof(I64)); - day_cnts =CAlloc((days_end-days_start+1)*sizeof(I64)); - day_dup_cnts=CAlloc((days_end-days_start+1)*sizeof(I64)); - dups=cnt=0; - while (templg!=head) { - if (start<=templg->datetime<=end && IsIndex(templg)) { - i=templg->datetime*24; - hour_cnts[i.u32[1]-hours_start]++; - day_cnts[(templg->datetime+local_time_offset)>>32-days_start]++; - cnt++; - if (IPNumTreeAdd(&dup_head,templg)) { - day_dup_cnts[(templg->datetime+local_time_offset)>>32-days_start]++; - dup_cnts[i.u32[1]-hours_start]++; - dups++; - } - LinkTreeAdd(&link_root,templg); - } - templg=templg->next; - } - - "\n\nHits on /index.html\n" - "'-' is a dup. '+' is not a dup.\n"; - for (i=start;i<=end;i+=1<<32) - "%D:%5d%5d\n",i,day_dup_cnts[(i+local_time_offset)>>32-days_start], - day_cnts[(i+local_time_offset)>>32-days_start]; - - "\n\nHits on /index.html\n"; - if (hours_end-hours_start>=MAX_HOURS) - i=hours_end-MAX_HOURS+1; - else - i=hours_start; - for (;i<=hours_end;i++) { - Date2Struct(&ds,i<<32/24+local_time_offset); - "%D %02d: ",i<<32/24,ds.hour; - for (j=0;jfilename.name,output_filename); - DocWrite(DocPut,TRUE); - - "$$WW,1$$"; - LogLstDel(head); -} - -#if __CMD_LINE__ -Cd(__DIR__);; -WebLogRep("*.LOG*","~/DemoWebLog.TXT.Z"); -#endif diff --git a/Demo/WebLogDemo/WebLogRep.HC b/Demo/WebLogDemo/WebLogRep.HC new file mode 100644 index 0000000..36542bd --- /dev/null +++ b/Demo/WebLogDemo/WebLogRep.HC @@ -0,0 +1,524 @@ +#define DOWNLOAD_FILE1 "TempleOSCD.ISO" +#define DOWNLOAD_FILE1_SIZE 17000000 +#define DOWNLOAD_FILE2 "TempleOSUltra.ISO" +#define DOWNLOAD_FILE2_SIZE 1900000 +#define DOWNLOAD_FILE3 "TempleOSCDRS.ISO" +#define DOWNLOAD_FILE3_SIZE 16000000 +#define DOWNLOAD_FILE4 "TempleOSUltraRS.ISO" +#define DOWNLOAD_FILE4_SIZE 1600000 + +#define MAX_HOURS (24*3) + +class LogStruct +{ + LogStruct *next,*last; + LogStruct *ip_num_left,*ip_num_right; + U32 ip_num,code; + I64 size; + U8 *file,*link; + CDate datetime; +}; + +class LinkStruct +{ + LinkStruct *left,*right; + U8 *link,*file; + I64 cnt; +}; + +class BlockedStruct +{ + BlockedStruct *next,*last; + U32 ip_num; +}; + +U0 LogStructDel(LogStruct *templg) +{ + Free(templg->file); + Free(templg->link); + Free(templg); +} + +U0 PrsSingleLogFile(LogStruct *head,U8 *name,CDate *_start,CDate *_end) +{ + CDoc *doc=DocRead(name, + DOCF_PLAIN_TEXT_TABS|DOCF_DBL_DOLLARS|DOCF_NO_CURSOR); + CDocEntry *doc_e=doc->head.next; + U8 *src,*src2,*mon_lst=Define("ST_MONTHS"); + LogStruct *templg; + CDateStruct ds; + I64 i; + "%Q\n",name; + while (doc_e!=doc) { + if (doc_e->type_u8==DOCT_TEXT) { + templg=CAlloc(sizeof(LogStruct)); + try { + src=doc_e->tag; + templg->ip_num.u8[3]=Str2I64(src,10,&src); + if (*src++!='.') throw; + templg->ip_num.u8[2]=Str2I64(src,10,&src); + if (*src++!='.') throw; + templg->ip_num.u8[1]=Str2I64(src,10,&src); + if (*src++!='.') throw; + templg->ip_num.u8[0]=Str2I64(src,10,&src); + + do if (!*src) throw; + while (*src++!='['); + MemSet(&ds,0,sizeof(CDateStruct)); + ds.day_of_mon=Str2I64(src,10,&src); + if (*src++!='/') throw; + src2=src; + do if (!*src2) throw; + while (*src2++!='/'); + * --src2=0; + ds.mon=1+LstMatch(src,mon_lst,LMF_IGNORE_CASE); + src=++src2; + ds.year=Str2I64(src,10,&src); + if (*src++!=':') throw; + ds.hour=Str2I64(src,10,&src); + if (*src++!=':') throw; + ds.min=Str2I64(src,10,&src); + if (*src++!=':') throw; + ds.sec=Str2I64(src,10,&src); + templg->datetime=Struct2Date(&ds); + if (*src++!=CH_SPACE) throw; + i=Str2I64(src,10,&src); + templg->datetime-=(i/100+i%100/60.0)*CDATE_FREQ*60*60; + + if (templg->datetime<*_start) *_start=templg->datetime; + if (templg->datetime>*_end) *_end =templg->datetime; + + do if (!*src) throw; + while (*src++!=']'); + + if (*src++!=CH_SPACE) throw; + if (*src++!='\"') throw; + if (!StrNCmp(src,"GET ",4)) { + src2=src+=4; + do if (!*src2) throw; + while (*src2++!=CH_SPACE); + * --src2=0; + templg->file=StrNew(src); + src=++src2; + + do if (!*src) throw; + while (*src++!='\"'); + + templg->code=Str2I64(src,10,&src); + if (*src++!=CH_SPACE) throw; + templg->size=Str2I64(src,10,&src); + if (*src++!=CH_SPACE) throw; + + if (*src++!='\"') throw; + src2=src; + do if (!*src2) throw; + while (*src2++!='\"'); + * --src2=0; + templg->link=StrNew(src); + src=++src2; + + QueIns(templg,head->last); + } else if (!StrNCmp(src,"HEAD ",5)) { + LogStructDel(templg); + } else + throw; + } catch { + Fs->catch_except=TRUE; + "%Q\n",doc_e->tag; + LogStructDel(templg); + } + } + doc_e=doc_e->next; + } + DocDel(doc); +} + +LogStruct *PrsLogFiles(U8 *files_find_mask,CDate *_start,CDate *_end) +{ + LogStruct *head=CAlloc(sizeof(LogStruct)); + CDirEntry *tempde=FilesFind(files_find_mask),*tempde1=tempde; + QueInit(head); + while (tempde) { + PrsSingleLogFile(head,tempde->full_name,_start,_end); + tempde=tempde->next; + } + DirTreeDel(tempde1); + return head; +} + +U0 LogLstDel(LogStruct *head) +{ + LogStruct *templg=head->next,*templg1; + while (templg!=head) { + templg1=templg->next; + LogStructDel(templg); + templg=templg1; + } +} + +U0 BlockedStructAdd(BlockedStruct *head,U32 ip_num) +{ + BlockedStruct *tempb=CAlloc(sizeof(BlockedStruct)); + tempb->ip_num=ip_num; + QueIns(tempb,head->last); +} + +Bool IsBlocked(BlockedStruct *head,U32 ip_num) +{ + BlockedStruct *tempb=head->next; + while (tempb!=head) { + if (tempb->ip_num==ip_num) + return TRUE; + tempb=tempb->next; + } + return FALSE; +} + +U0 BlockIPNums(LogStruct *head) +{ + BlockedStruct blocked_head; + LogStruct *templg=head->next,*templg1; + + QueInit(&blocked_head); + + BlockedStructAdd(&blocked_head,70<<24+173<<16+110<<8+214); + BlockedStructAdd(&blocked_head,68<<24+224<<16+130<<8+96); + BlockedStructAdd(&blocked_head,68<<24+96<<16+100<<8+126); + BlockedStructAdd(&blocked_head,68<<24+96<<16+110<<8+213); + BlockedStructAdd(&blocked_head,68<<24+96<<16+242<<8+108); + BlockedStructAdd(&blocked_head,68<<24+227<<16+61<<8+11); + BlockedStructAdd(&blocked_head,68<<24+227<<16+61<<8+139); + + //pass 1: collect robot lst + while (templg!=head) { + if (StrIMatch("ROBOT",templg->file) && + !IsBlocked(&blocked_head,templg->ip_num)) + BlockedStructAdd(&blocked_head,templg->ip_num); + templg=templg->next; + } + + //pass 2: removed blocked ip_nums + templg=head->next; + while (templg!=head) { + templg1=templg->next; + if (IsBlocked(&blocked_head,templg->ip_num)) { + QueRem(templg); + LogStructDel(templg); + } + templg=templg1; + } + + QueDel(&blocked_head); +} + +Bool IsDownLoad(LogStruct *templg) +{ + if (StrMatch(DOWNLOAD_FILE1,templg->file)&&templg->size>= + DOWNLOAD_FILE1_SIZE || + StrMatch(DOWNLOAD_FILE2,templg->file)&&templg->size>= + DOWNLOAD_FILE2_SIZE || + StrMatch(DOWNLOAD_FILE3,templg->file)&&templg->size>= + DOWNLOAD_FILE3_SIZE || + StrMatch(DOWNLOAD_FILE4,templg->file)&&templg->size>= + DOWNLOAD_FILE4_SIZE) + return TRUE; + else + return FALSE; +} + +Bool IsIndex(LogStruct *templg) +{ + if (!StrCmp(templg->file,"/index.html") || + !StrNCmp(templg->file+StrLen(templg->file)-14,"/TempleOS.html",14) || + !StrCmp(templg->file,"/")) + return TRUE; + else + return FALSE; +} + +Bool IPNumTreeAdd(LogStruct **_head,LogStruct *templg) +{ + LogStruct *head; + if (UnusedStk<0x200) { + PrintErr("Stk Overflow"); + ThrowBreak; + } + if (head=*_head) { + if (templg->ip_num==head->ip_num) + return TRUE; + else if (templg->ip_numip_num) + return IPNumTreeAdd(&head->ip_num_left,templg); + else + return IPNumTreeAdd(&head->ip_num_right,templg); + } else { + templg->ip_num_left=NULL; + templg->ip_num_right=NULL; + *_head=templg; + return FALSE; + } +} + +U0 LinkTreeAdd(LinkStruct **_root,LogStruct *templg) +{ + I64 i; + LinkStruct *root,*templk; + if (UnusedStk<0x200) { + PrintErr("Stk Overflow"); + ThrowBreak; + } + if (root=*_root) { + if (!(i=StrCmp(templg->link,root->link))) + root->cnt++; + else if (i<0) + LinkTreeAdd(&root->left,templg); + else + LinkTreeAdd(&root->right,templg); + } else { + templk=CAlloc(sizeof(LinkStruct)); + templk->link=templg->link; + templk->cnt=1; + *_root=templk; + } +} + +U0 FileTreeAdd(LinkStruct **_root,LogStruct *templg) +{ + I64 i; + LinkStruct *root,*templk; + if (UnusedStk<0x200) { + PrintErr("Stk Overflow"); + ThrowBreak; + } + if (root=*_root) { + if (!(i=StrCmp(templg->file,root->file))) + root->cnt++; + else if (i<0) + FileTreeAdd(&root->left,templg); + else + FileTreeAdd(&root->right,templg); + } else { + templk=CAlloc(sizeof(LinkStruct)); + templk->file=templg->file; + templk->cnt=1; + *_root=templk; + } +} + +U0 LinkTreeDel(LinkStruct *root) +{ + if (root) { + LinkTreeDel(root->left); + LinkTreeDel(root->right); + Free(root); + } +} + +U0 LinkTreeTraverse(LinkStruct *root) +{ + if (root) { + LinkTreeTraverse(root->left); + "%3d:%Q\n",root->cnt,root->link; + LinkTreeTraverse(root->right); + } +} + +U0 FileTreeDel(LinkStruct *root) +{ + if (root) { + FileTreeDel(root->left); + FileTreeDel(root->right); + Free(root); + } +} + +U0 FileTreeTraverse(LinkStruct *root) +{ + if (root) { + FileTreeTraverse(root->left); + "%3d:%Q\n",root->cnt,root->file; + FileTreeTraverse(root->right); + } +} + +U0 DownLoadRep(LogStruct *head,CDate start,CDate end) +{ + I64 i,j,cnt,dups, + hours_start,hours_end,*hour_cnts,*dup_cnts, + days_start,days_end,*day_cnts,*day_dup_cnts; + LogStruct *templg=head->next,*dup_head=NULL; + LinkStruct *link_root=NULL; + CDateStruct ds; + + i=start*24;hours_start=i.u32[1]; + i=end *24;hours_end =i.u32[1]; + + days_start=(start+local_time_offset)>>32; + days_end =(end+local_time_offset)>>32; + + hour_cnts=CAlloc((hours_end-hours_start+1)*sizeof(I64)); + dup_cnts =CAlloc((hours_end-hours_start+1)*sizeof(I64)); + day_cnts =CAlloc((days_end-days_start+1)*sizeof(I64)); + day_dup_cnts=CAlloc((days_end-days_start+1)*sizeof(I64)); + dups=cnt=0; + while (templg!=head) { + if (start<=templg->datetime<=end && IsDownLoad(templg)) { + i=templg->datetime*24; + hour_cnts[i.u32[1]-hours_start]++; + day_cnts[(templg->datetime+local_time_offset)>>32-days_start]++; + cnt++; + if (IPNumTreeAdd(&dup_head,templg)) { + day_dup_cnts[(templg->datetime+local_time_offset)>>32-days_start]++; + dup_cnts[i.u32[1]-hours_start]++; + dups++; + } + LinkTreeAdd(&link_root,templg); + } + templg=templg->next; + } + + "\n\nDownloads of /TempleOSCD.ISO\n"; + for (i=start;i<=end;i+=1<<32) + "%D:%5d%5d\n",i,day_dup_cnts[(i+local_time_offset)>>32-days_start], + day_cnts[(i+local_time_offset)>>32-days_start]; + + "\n\nDownloads of /TempleOSCD.ISO\n" + "'-' is a dup. '+' is not a dup.\n"; + if (hours_end-hours_start>=MAX_HOURS) + i=hours_end-MAX_HOURS+1; + else + i=hours_start; + for (;i<=hours_end;i++) { + Date2Struct(&ds,i<<32/24+local_time_offset); + "%D %02d: ",i<<32/24,ds.hour; + for (j=0;jnext; + LinkStruct *file_root=NULL; + while (templg!=head) { + if (start<=templg->datetime<=end) + FileTreeAdd(&file_root,templg); + templg=templg->next; + } + "\n\nFile Hits\n"; + FileTreeTraverse(file_root); + '\n'; + FileTreeDel(file_root); +} + +U0 IndexRep(LogStruct *head,CDate start,CDate end) +{ + I64 i,j,cnt,dups, + hours_start,hours_end,*hour_cnts,*dup_cnts, + days_start,days_end,*day_cnts,*day_dup_cnts; + LogStruct *templg=head->next,*dup_head=NULL; + LinkStruct *link_root=NULL; + CDateStruct ds; + + i=start*24;hours_start=i.u32[1]; + i=end *24;hours_end =i.u32[1]; + + days_start=(start+local_time_offset)>>32; + days_end =(end+local_time_offset)>>32; + + hour_cnts=CAlloc((hours_end-hours_start+1)*sizeof(I64)); + dup_cnts =CAlloc((hours_end-hours_start+1)*sizeof(I64)); + day_cnts =CAlloc((days_end-days_start+1)*sizeof(I64)); + day_dup_cnts=CAlloc((days_end-days_start+1)*sizeof(I64)); + dups=cnt=0; + while (templg!=head) { + if (start<=templg->datetime<=end && IsIndex(templg)) { + i=templg->datetime*24; + hour_cnts[i.u32[1]-hours_start]++; + day_cnts[(templg->datetime+local_time_offset)>>32-days_start]++; + cnt++; + if (IPNumTreeAdd(&dup_head,templg)) { + day_dup_cnts[(templg->datetime+local_time_offset)>>32-days_start]++; + dup_cnts[i.u32[1]-hours_start]++; + dups++; + } + LinkTreeAdd(&link_root,templg); + } + templg=templg->next; + } + + "\n\nHits on /index.html\n" + "'-' is a dup. '+' is not a dup.\n"; + for (i=start;i<=end;i+=1<<32) + "%D:%5d%5d\n",i,day_dup_cnts[(i+local_time_offset)>>32-days_start], + day_cnts[(i+local_time_offset)>>32-days_start]; + + "\n\nHits on /index.html\n"; + if (hours_end-hours_start>=MAX_HOURS) + i=hours_end-MAX_HOURS+1; + else + i=hours_start; + for (;i<=hours_end;i++) { + Date2Struct(&ds,i<<32/24+local_time_offset); + "%D %02d: ",i<<32/24,ds.hour; + for (j=0;jfilename.name,output_filename); + DocWrite(DocPut,TRUE); + + "$$WW,1$$"; + LogLstDel(head); +} + +#if __CMD_LINE__ +Cd(__DIR__);; +WebLogRep("*.LOG*","~/DemoWebLog.DD.Z"); +#endif diff --git a/Demo/WebLogDemo/WebLogScramble.CPP b/Demo/WebLogDemo/WebLogScramble.HC similarity index 100% rename from Demo/WebLogDemo/WebLogScramble.CPP rename to Demo/WebLogDemo/WebLogScramble.HC diff --git a/Demo/WebLogDemo/access_150211.LOG b/Demo/WebLogDemo/access_150211.LOG index e8291c9..7abe4b7 100644 --- a/Demo/WebLogDemo/access_150211.LOG +++ b/Demo/WebLogDemo/access_150211.LOG @@ -47,7 +47,7 @@ 131.8.134.171 - - [10/Feb/2015:01:00:01 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2015/11/Rant150210.html HTTP/1.1" 404 89 "-" "curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2" "www.templeos.org" 225.87.79.148 - - [10/Feb/2015:01:00:34 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0" "www.templeos.org" 225.87.79.148 - - [10/Feb/2015:01:00:34 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0" "www.templeos.org" -52.53.176.173 - - [10/Feb/2015:01:00:37 -0800] "GET /Wb/Apps/Psalmody/Examples/valued.CPP.Z HTTP/1.1" 200 766 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.173 - - [10/Feb/2015:01:00:37 -0800] "GET /Wb/Apps/Psalmody/Examples/valued.HC.Z HTTP/1.1" 200 766 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 225.87.79.148 - - [10/Feb/2015:01:00:54 -0800] "GET /Wb/Home/Web/Downloads.html HTTP/1.1" 200 7086 "http://www.templeos.org/" "Mozilla/5.0 (X11; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0" "www.templeos.org" 217.132.100.186 - - [10/Feb/2015:01:02:19 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 217.132.100.186 - - [10/Feb/2015:01:02:20 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" @@ -108,7 +108,7 @@ 87.180.246.184 - - [10/Feb/2015:02:08:07 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 211.88.221.103 - - [10/Feb/2015:02:09:05 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko" "www.templeos.org" 52.87.77.86 - - [10/Feb/2015:02:09:09 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko" "www.templeos.org" -52.53.176.225 - - [10/Feb/2015:02:09:13 -0800] "GET /Wb/Demo/DolDoc/Data.CPP.Z HTTP/1.1" 200 950 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.225 - - [10/Feb/2015:02:09:13 -0800] "GET /Wb/Demo/DolDoc/Data.HC.Z HTTP/1.1" 200 950 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 52.87.77.86 - - [10/Feb/2015:02:09:43 -0800] "GET /Wb/Home/Web/TOSVideos.html HTTP/1.1" 200 40105 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko" "www.templeos.org" 119.225.240.174 - - [10/Feb/2015:02:10:24 -0800] "GET /Wb/Accts/TS/Web/TempleOSV0218A.BMP HTTP/1.1" 404 89 "-" "facebookexternalhit/1.0 (+http://www.facebook.com/externalhit_uatext.php)" "www.templeos.org" 14.6.26.253 - - [10/Feb/2015:02:10:59 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0" "www.templeos.org" @@ -138,7 +138,7 @@ 189.3.229.39 - - [10/Feb/2015:02:27:36 -0800] "HEAD / HTTP/1.1" 200 0 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506)" "www.templeos.org" 52.53.176.9 - - [10/Feb/2015:02:28:08 -0800] "GET /Wb/Demo/SortFileDemo/ HTTP/1.1" 200 2022 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 228.48.95.108 - - [10/Feb/2015:02:28:20 -0800] "GET /Wb/Accts/TS/Web/TempleOS.html HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Page2RSS/0.7; +http://page2rss.com/)" "www.templeos.org" -52.53.176.32 - - [10/Feb/2015:02:29:32 -0800] "GET /Wb/Adam/Gr/GrTextBase.CPP.Z HTTP/1.1" 200 3554 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.32 - - [10/Feb/2015:02:29:32 -0800] "GET /Wb/Adam/Gr/GrTextBase.HC.Z HTTP/1.1" 200 3554 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 74.51.144.148 - - [10/Feb/2015:02:36:28 -0800] "GET /Wb/Accts/TS/Web/TAD/2014/11/Rant141120.html HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" "www.templeos.org" 207.244.87.211 - - [10/Feb/2015:02:37:36 -0800] "GET / HTTP/1.1" 200 6329 "https://www.google.com.au/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36" "www.templeos.org" 207.244.87.211 - - [10/Feb/2015:02:37:37 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36" "www.templeos.org" @@ -177,7 +177,7 @@ 228.141.141.213 - - [10/Feb/2015:03:13:19 -0800] "GET /Wb/Apps/Psalmody/Examples/elijah.html HTTP/1.1" 200 34593 "-" "Mozilla/5.0 (compatible; DotBot/1.1; http://www.opensiteexplorer.org/dotbot, help@moz.com)" "www.templeos.org" 34.222.78.124 - - [10/Feb/2015:03:13:44 -0800] "GET /TempleOSCD.ISO HTTP/1.1" 200 655360 "-" "Mozilla/5.0 Gecko/20100115 Firefox/3.6" "www.templeos.org" 34.222.78.124 - - [10/Feb/2015:03:13:45 -0800] "GET /TempleOSCD.ISO HTTP/1.1" 200 655360 "-" "Mozilla/5.0 Gecko/20100115 Firefox/3.6" "www.templeos.org" -52.53.176.247 - - [10/Feb/2015:03:16:57 -0800] "GET /Wb/Apps/ToTheFront/AIs/SimpleAI.CPP.Z HTTP/1.1" 200 1094 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.247 - - [10/Feb/2015:03:16:57 -0800] "GET /Wb/Apps/ToTheFront/AIs/SimpleAI.HC.Z HTTP/1.1" 200 1094 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 58.128.177.232 - - [10/Feb/2015:03:21:29 -0800] "GET /Wb/Accts/TS/Web/AfterEgypt01.html HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org" 223.88.111.165 - - [10/Feb/2015:03:21:53 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)" "www.templeos.org" 58.128.177.232 - - [10/Feb/2015:03:22:04 -0800] "GET /Wb/Temp/ScreenShots/?M=D HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org" @@ -199,7 +199,7 @@ 88.71.36.79 - - [10/Feb/2015:03:44:09 -0800] "GET / HTTP/1.1" 200 6329 "http://www.google.fr/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0CCkQFjAB&url=http%3A%2F%2Fwww.templeos.org%2F&ei=Au_ZVNrlK4LqaPCagvAF&usg=AFQjCNFKL3We7L8wuY5up5gkGZtpKv4qtA&sig2=5_XFhPnKn69eq3N9e0rndA&bvm=bv.85464276,d.d2s" "Mozilla/5.0 (Windows NT 6.1; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 175.87.155.92 - - [10/Feb/2015:03:44:34 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/37.0.2062.120 Chrome/37.0.2062.120 Safari/537.36" "www.templeos.org" 199.202.179.206 - - [10/Feb/2015:03:46:58 -0800] "GET /Wb/Doc/Charter.html HTTP/1.1" 200 10431 "http://m.facebook.com/" "Mozilla/5.0 (Linux; U; Android 4.3; en-us; MT2L03 Build/HuaweiMT2L03) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 [FB_IAB/FB4A;FBAV/27.0.0.13.15;]" "www.templeos.org" -52.53.176.129 - - [10/Feb/2015:03:47:42 -0800] "GET /Wb/Apps/Psalmody/Examples/shield.CPP.Z HTTP/1.1" 200 1149 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.129 - - [10/Feb/2015:03:47:42 -0800] "GET /Wb/Apps/Psalmody/Examples/shield.HC.Z HTTP/1.1" 200 1149 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 58.128.177.232 - - [10/Feb/2015:03:50:33 -0800] "GET /Certs/virtual-notary-cert-randomnum-39917.p12 HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org" 155.156.205.175 - - [10/Feb/2015:03:52:44 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0" "www.templeos.org" 52.53.176.225 - - [10/Feb/2015:03:53:00 -0800] "GET /Wb/Adam/DolDoc/DocMacro.html HTTP/1.1" 200 114437 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" @@ -264,7 +264,7 @@ 228.141.169.196 - - [10/Feb/2015:05:13:38 -0800] "GET /Wb/Apps/Psalmody/Examples/exiled.html HTTP/1.1" 200 33724 "-" "Mozilla/5.0 (compatible; DotBot/1.1; http://www.opensiteexplorer.org/dotbot, help@moz.com)" "www.templeos.org" 228.141.169.196 - - [10/Feb/2015:05:13:39 -0800] "GET /Wb/Apps/Psalmody/Examples/advantage.html HTTP/1.1" 200 11415 "-" "Mozilla/5.0 (compatible; DotBot/1.1; http://www.opensiteexplorer.org/dotbot, help@moz.com)" "www.templeos.org" 226.174.2.211 - - [10/Feb/2015:05:16:23 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0" "www.templeos.org" -52.53.176.32 - - [10/Feb/2015:05:20:15 -0800] "GET /Wb/Adam/ABlkDev/ADskB.CPP.Z HTTP/1.1" 200 5591 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.32 - - [10/Feb/2015:05:20:15 -0800] "GET /Wb/Adam/ABlkDev/ADskB.HC.Z HTTP/1.1" 200 5591 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 69.189.218.252 - - [10/Feb/2015:05:22:11 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "templeos.org" 52.53.176.225 - - [10/Feb/2015:05:23:21 -0800] "GET /Wb/Demo/Games/Stadium/?D=A HTTP/1.1" 200 1576 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 129.226.244.66 - - [10/Feb/2015:05:24:19 -0800] "GET /TempleOS.html HTTP/1.1" 200 12669 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)" "www.templeos.org" @@ -362,11 +362,11 @@ 228.141.169.196 - - [10/Feb/2015:08:28:16 -0800] "GET /robots.txt HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; DotBot/1.1; http://www.opensiteexplorer.org/dotbot, help@moz.com)" "www.templeos.org" 199.55.138.47 - - [10/Feb/2015:08:48:17 -0800] "GET /Wb/Home/Sup1/ HTTP/1.1" 200 5204 "-" "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16" "www.templeos.org" 254.67.161.241 - - [10/Feb/2015:08:51:05 -0800] "GET /Wb/Accts/TS/Web/TAD/2014/05/Rant140501.html HTTP/1.1" 404 89 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.1.25 (KHTML, like Gecko) QuickLook/5.0" "www.templeos.org" -254.67.161.241 - - [10/Feb/2015:08:51:06 -0800] "GET /files/BIBLE.TXT HTTP/1.1" 200 655360 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.1.25 (KHTML, like Gecko) QuickLook/5.0" "www.templeos.org" +254.67.161.241 - - [10/Feb/2015:08:51:06 -0800] "GET /files/BIBLE.DD HTTP/1.1" 200 655360 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.1.25 (KHTML, like Gecko) QuickLook/5.0" "www.templeos.org" 254.67.161.241 - - [10/Feb/2015:08:51:08 -0800] "GET /Wb/Accts/TS/Web/TAD/2014/05/Rant140501.html HTTP/1.1" 404 89 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.1.25 (KHTML, like Gecko) QuickLook/5.0" "www.templeos.org" 254.67.161.241 - - [10/Feb/2015:08:51:08 -0800] "GET /Wb/Accts/TS/Web/TAD/2014/05/Rant140501.html HTTP/1.1" 404 89 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.1.25 (KHTML, like Gecko) QuickLook/5.0" "www.templeos.org" -254.67.161.241 - - [10/Feb/2015:08:51:09 -0800] "GET /files/BIBLE.TXT HTTP/1.1" 200 589824 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.1.25 (KHTML, like Gecko) QuickLook/5.0" "www.templeos.org" -52.53.176.0 - - [10/Feb/2015:08:57:04 -0800] "GET /Wb/Demo/Games/Coach.CPP.Z HTTP/1.1" 200 2714 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +254.67.161.241 - - [10/Feb/2015:08:51:09 -0800] "GET /files/BIBLE.DD HTTP/1.1" 200 589824 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.1.25 (KHTML, like Gecko) QuickLook/5.0" "www.templeos.org" +52.53.176.0 - - [10/Feb/2015:08:57:04 -0800] "GET /Wb/Demo/Games/Coach.HC.Z HTTP/1.1" 200 2714 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 70.185.231.76 - - [10/Feb/2015:08:58:22 -0800] "GET / HTTP/1.1" 200 6329 "https://www.google.com/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" 131.8.134.171 - - [10/Feb/2015:09:00:01 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2015/11/Rant150210.html HTTP/1.1" 404 89 "-" "curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2" "www.templeos.org" 216.240.124.161 - - [10/Feb/2015:09:04:03 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" @@ -376,7 +376,7 @@ 229.137.198.53 - - [10/Feb/2015:09:09:32 -0800] "GET /TempleOSCD.ISO HTTP/1.1" 200 589824 "-" "Mozilla/5.0 Gecko/20100115 Firefox/3.6" "www.templeos.org" 70.185.231.76 - - [10/Feb/2015:09:11:15 -0800] "GET /Wb/Doc/Demands.html HTTP/1.1" 200 11835 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" 131.55.71.47 - - [10/Feb/2015:09:11:16 -0800] "GET /Wb/Doc/Charter.html HTTP/1.1" 200 10431 "http://www.templeos.org/Wb/Doc/Charter.html" "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36" "www.templeos.org" -52.53.176.173 - - [10/Feb/2015:09:12:03 -0800] "GET /Wb/Apps/Psalmody/Examples/exiled.CPP.Z HTTP/1.1" 200 1041 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.173 - - [10/Feb/2015:09:12:03 -0800] "GET /Wb/Apps/Psalmody/Examples/exiled.HC.Z HTTP/1.1" 200 1041 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 52.53.176.46 - - [10/Feb/2015:09:12:47 -0800] "GET /Wb/Apps/X-Caliber/X-Caliber.html HTTP/1.1" 200 615592 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 189.30.24.0 - - [10/Feb/2015:09:13:02 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (Windows NT 6.1; rv:15.0) Gecko/20120716 Firefox/15.0a2" "www.templeos.org" 34.222.78.124 - - [10/Feb/2015:09:13:49 -0800] "GET /TempleOSCD.ISO HTTP/1.1" 200 655360 "-" "Mozilla/5.0 Gecko/20100115 Firefox/3.6" "www.templeos.org" @@ -403,7 +403,7 @@ 222.179.215.31 - - [10/Feb/2015:09:33:46 -0800] "GET /Wb/Home/Web/Downloads.html HTTP/1.1" 200 7086 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" 222.179.215.31 - - [10/Feb/2015:09:33:56 -0800] "GET /TempleOSCD.ISO HTTP/1.1" 200 18122752 "http://www.templeos.org/Wb/Home/Web/Downloads.html" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" 12.137.124.46 - - [10/Feb/2015:09:34:30 -0800] "GET /Wb/Misc/PCIDevices.html HTTP/1.1" 200 65536 "-" "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)" "www.templeos.org" -52.53.176.46 - - [10/Feb/2015:09:37:10 -0800] "GET /Wb/Apps/Psalmody/Examples/compassions.CPP.Z HTTP/1.1" 200 485 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.46 - - [10/Feb/2015:09:37:10 -0800] "GET /Wb/Apps/Psalmody/Examples/compassions.HC.Z HTTP/1.1" 200 485 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 49.113.231.145 - - [10/Feb/2015:09:37:18 -0800] "GET /wordpress/wp-admin/ HTTP/1.1" 404 89 "-" "-" "templeos.org" 196.243.153.174 - - [10/Feb/2015:09:38:19 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" 247.15.200.231 - - [10/Feb/2015:09:39:18 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" @@ -423,7 +423,7 @@ 112.129.154.164 - - [10/Feb/2015:09:53:47 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 6.1; rv:37.0) Gecko/20100101 Firefox/37.0" "www.templeos.org" 112.129.154.164 - - [10/Feb/2015:09:54:42 -0800] "GET /files/ASU_Transcripts.pdf HTTP/1.1" 200 13602 "http://www.templeos.org/Wb/Doc/AboutTempleOS.html" "Mozilla/5.0 (Windows NT 6.1; rv:37.0) Gecko/20100101 Firefox/37.0" "www.templeos.org" 112.129.154.164 - - [10/Feb/2015:09:56:19 -0800] "GET /Wb/Doc/HolyC.html HTTP/1.1" 200 30095 "http://www.reddit.com/r/TempleOS_Official/comments/2q0k2l/how_can_i_learn_holyc/" "Mozilla/5.0 (Windows NT 6.1; rv:37.0) Gecko/20100101 Firefox/37.0" "www.templeos.org" -58.128.177.232 - - [10/Feb/2015:09:57:53 -0800] "GET /Wb/Kernel/BlkDev/Dsk1c.CPP.Z HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org" +58.128.177.232 - - [10/Feb/2015:09:57:53 -0800] "GET /Wb/Kernel/BlkDev/Dsk1c.HC.Z HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org" 136.179.22.32 - - [10/Feb/2015:10:00:34 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0" "www.templeos.org" 232.74.241.219 - - [10/Feb/2015:10:01:18 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 127.173.116.46 - - [10/Feb/2015:10:01:59 -0800] "GET /old/wp-admin/ HTTP/1.1" 404 89 "-" "-" "templeos.org" @@ -439,7 +439,7 @@ 124.36.115.160 - - [10/Feb/2015:10:17:13 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0" "www.templeos.org" 119.156.166.145 - - [10/Feb/2015:10:19:03 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" 130.15.226.45 - - [10/Feb/2015:10:21:04 -0800] "GET / HTTP/1.1" 200 6329 "http://disqus.com/embed/comments/?base=default&version=d1b39333cdab5cb490d069fe62825a04&f=hausdorff&t_u=http%3A%2F%2Fblog.nullspace.io%2Fkernel-latency.html&t_d=84%25%20of%20a%20single-threaded%201KB%20write%20in%20Redis%20is%20spent%20in%20the%20kernel&t_t=84%25%20of%20a%20single-threaded%201KB%20write%20in%20Redis%20is%20spent%20in%20the%20kernel&s_o=default" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36" "www.templeos.org" -52.53.176.137 - - [10/Feb/2015:10:27:25 -0800] "GET /Wb/Apps/Psalmody/Examples/readier.CPP.Z HTTP/1.1" 200 348 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.137 - - [10/Feb/2015:10:27:25 -0800] "GET /Wb/Apps/Psalmody/Examples/readier.HC.Z HTTP/1.1" 200 348 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 136.232.213.50 - - [10/Feb/2015:10:33:47 -0800] "GET /Wb/Home/Web/TOSVideos.html HTTP/1.1" 200 40265 "http://www.templeos.org/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2301.0 Safari/537.36" "www.templeos.org" 136.232.213.50 - - [10/Feb/2015:10:34:11 -0800] "GET /Wb/Doc/HolyC.html HTTP/1.1" 200 30095 "http://www.reddit.com/r/TempleOS_Official/comments/2q0k2l/how_can_i_learn_holyc/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2301.0 Safari/537.36" "www.templeos.org" 222.211.142.20 - - [10/Feb/2015:10:37:15 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" @@ -476,13 +476,13 @@ 58.71.218.57 - - [10/Feb/2015:11:17:11 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 127.77.137.39 - - [10/Feb/2015:11:17:40 -0800] "GET / HTTP/1.1" 200 6329 "http://disqus.com/embed/comments/?base=default&version=d1b39333cdab5cb490d069fe62825a04&f=hausdorff&t_u=http%3A%2F%2Fblog.nullspace.io%2Fkernel-latency.html&t_d=84%25%20of%20a%20single-threaded%201KB%20write%20in%20Redis%20is%20spent%20in%20the%20kernel&t_t=84%25%20of%20a%20single-threaded%201KB%20write%20in%20Redis%20is%20spent%20in%20the%20kernel&s_o=default" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 127.167.182.31 - - [10/Feb/2015:11:17:44 -0800] "GET /Wb/Home/Web/Downloads.html HTTP/1.1" 200 7102 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" -52.53.176.173 - - [10/Feb/2015:11:17:45 -0800] "GET /Wb/Demo/Graphics/PanText.CPP.Z HTTP/1.1" 200 234 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.173 - - [10/Feb/2015:11:17:45 -0800] "GET /Wb/Demo/Graphics/PanText.HC.Z HTTP/1.1" 200 234 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 127.77.137.39 - - [10/Feb/2015:11:17:47 -0800] "GET /Wb/Adam/God/HSNotes.html HTTP/1.1" 200 35828 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 119.225.240.88 - - [10/Feb/2015:11:18:33 -0800] "GET /Wb/Accts/TS/Web/TempleOSV0218A.BMP HTTP/1.1" 404 89 "-" "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)" "www.templeos.org" 39.252.113.221 - - [10/Feb/2015:11:18:40 -0800] "GET / HTTP/1.1" 200 6329 "-" "NetLyzer FastProbe" "www.templeos.org" 127.167.182.31 - - [10/Feb/2015:11:23:08 -0800] "GET /Wb/Doc/DemoIndex.html HTTP/1.1" 200 32945 "http://www.reddit.com/r/TempleOS_Official/comments/2q0k2l/how_can_i_learn_holyc/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" 127.167.182.31 - - [10/Feb/2015:11:23:25 -0800] "GET /Wb/Demo/Graphics/Speedline.html HTTP/1.1" 200 25142 "http://www.templeos.org/Wb/Doc/DemoIndex.html" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" -52.53.176.53 - - [10/Feb/2015:11:23:39 -0800] "GET /Wb/Apps/Budget/Load.CPP.Z HTTP/1.1" 200 136 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.53 - - [10/Feb/2015:11:23:39 -0800] "GET /Wb/Apps/Budget/Load.HC.Z HTTP/1.1" 200 136 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 58.128.177.232 - - [10/Feb/2015:11:25:53 -0800] "GET /beacon.nist.gov/rest/record/1417188660 HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org" 58.71.218.57 - - [10/Feb/2015:11:26:06 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 58.71.218.57 - - [10/Feb/2015:11:26:10 -0800] "GET /Wb/Home/Web/TOSVideos.html HTTP/1.1" 200 40440 "http://www.templeos.org/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" @@ -583,7 +583,7 @@ 58.71.218.57 - - [10/Feb/2015:13:41:50 -0800] "GET /Wb/Home/Web/TADRant.html HTTP/1.1" 200 50958 "http://www.templeos.org/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 52.53.176.137 - - [10/Feb/2015:13:44:27 -0800] "GET /files/?D=A HTTP/1.1" 200 1522 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 52.81.208.207 - - [10/Feb/2015:13:45:31 -0800] "GET /Wb/Adam/Gr/GrPrimatives.html HTTP/1.1" 200 743387 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0" "www.templeos.org" -130.158.66.124 - - [10/Feb/2015:13:47:09 -0800] "GET /files/BIBLE.TXT HTTP/1.1" 200 4345143 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.63 Safari/537.36" "www.templeos.org" +130.158.66.124 - - [10/Feb/2015:13:47:09 -0800] "GET /files/BIBLE.DD HTTP/1.1" 200 4345143 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.63 Safari/537.36" "www.templeos.org" 150.176.164.55 - - [10/Feb/2015:13:47:55 -0800] "GET /Wb/Demo/Graphics/CharAnimation.html HTTP/1.1" 200 15754 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 150.176.164.55 - - [10/Feb/2015:13:51:30 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 150.176.164.55 - - [10/Feb/2015:13:51:58 -0800] "GET /Wb/Home/Web/History.html HTTP/1.1" 200 7745 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" @@ -676,7 +676,7 @@ 69.206.243.192 - - [10/Feb/2015:16:21:17 -0800] "GET /Wb/Doc/AboutTempleOS.html HTTP/1.1" 200 4925 "http://www.templeos.org/" "Mozilla/5.0 (Linux; U; Android 4.4.4; pl-pl; GT-I9505 Build/KTU84Q) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 XiaoMi/MiuiBrowser/2.0.1" "www.templeos.org" 52.53.176.53 - - [10/Feb/2015:16:26:28 -0800] "GET /Wb/Kernel/Mem/HeapCtrl.html HTTP/1.1" 200 173397 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 202.176.251.67 - - [10/Feb/2015:16:33:00 -0800] "GET /Wb/Adam/Opt/Utils/S2T.html HTTP/1.1" 200 38162 "-" "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)" "www.templeos.org" -52.53.176.179 - - [10/Feb/2015:16:39:02 -0800] "GET /Wb/Adam/DolDoc/DocInit.CPP.Z HTTP/1.1" 200 1786 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.179 - - [10/Feb/2015:16:39:02 -0800] "GET /Wb/Adam/DolDoc/DocInit.HC.Z HTTP/1.1" 200 1786 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 141.23.85.107 - - [10/Feb/2015:16:43:09 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 192.93.245.183 - - [10/Feb/2015:16:46:14 -0800] "GET / HTTP/1.1" 200 6329 "http://disqus.com/embed/comments/?base=default&version=d1b39333cdab5cb490d069fe62825a04&f=hausdorff&t_u=http%3A%2F%2Fblog.nullspace.io%2Fkernel-latency.html&t_d=84%25%20of%20a%20single-threaded%201KB%20write%20in%20Redis%20is%20spent%20in%20the%20kernel&t_t=84%25%20of%20a%20single-threaded%201KB%20write%20in%20Redis%20is%20spent%20in%20the%20kernel&s_o=default" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36" "www.templeos.org" 78.19.21.206 - - [10/Feb/2015:16:46:41 -0800] "GET /TempleOSCD.ISO HTTP/1.1" 200 589824 "-" "Mozilla/5.0 Gecko/20100115 Firefox/3.6" "www.templeos.org" @@ -700,7 +700,7 @@ 108.25.30.75 - - [10/Feb/2015:17:27:09 -0800] "GET / HTTP/1.1" 200 6329 "https://www.google.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" 108.25.30.75 - - [10/Feb/2015:17:27:10 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" 108.25.30.75 - - [10/Feb/2015:17:30:17 -0800] "GET /Wb/Home/Sup1/ HTTP/1.1" 200 5204 "http://t.co/9n6tiOcMYh" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" -108.25.30.75 - - [10/Feb/2015:17:30:37 -0800] "GET /Wb/Home/Sup1/DocIDE.CPP.Z HTTP/1.1" 200 6028 "http://www.templeos.org/Wb/Home/Sup1/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" +108.25.30.75 - - [10/Feb/2015:17:30:37 -0800] "GET /Wb/Home/Sup1/DocIDE.HC.Z HTTP/1.1" 200 6028 "http://www.templeos.org/Wb/Home/Sup1/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" 189.40.12.106 - - [10/Feb/2015:17:35:40 -0800] "GET /robots.txt HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; linkdexbot/2.0; +http://www.linkdex.com/bots/)" "templeos.org" 202.176.251.73 - - [10/Feb/2015:17:37:54 -0800] "GET /Wb/Adam/DolDoc/DocNew.html HTTP/1.1" 200 448384 "-" "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)" "www.templeos.org" 58.128.177.232 - - [10/Feb/2015:17:39:45 -0800] "GET /beacon.nist.gov/rest/record/1416785100 HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org" @@ -799,7 +799,7 @@ 52.53.176.137 - - [10/Feb/2015:20:44:58 -0800] "GET /Wb/Demo/?N=A HTTP/1.1" 200 10926 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 241.159.189.144 - - [10/Feb/2015:20:47:35 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko" "www.templeos.org" 240.94.100.138 - - [10/Feb/2015:20:47:39 -0800] "GET /Wb/Home/Sup1/Sup1Texts/Yankee.TXT HTTP/1.1" 200 663207 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36" "www.templeos.org" -58.128.177.232 - - [10/Feb/2015:20:50:23 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2014/08/Rant140831.TXT.Z HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org" +58.128.177.232 - - [10/Feb/2015:20:50:23 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2014/08/Rant140831.DD.Z HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org" 112.233.185.37 - - [10/Feb/2015:20:51:08 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36" "www.templeos.org" 87.5.200.32 - - [10/Feb/2015:20:52:55 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2014/06/Rant140618.html HTTP/1.1" 404 89 "http://na-verh.ru/" "Opera/7.54 (Windows NT 5.1; U) [pl]" "www.templeos.org" 87.5.200.32 - - [10/Feb/2015:20:52:56 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2014/06/Rant140618.html HTTP/1.1" 404 89 "http://na-verh.ru/" "Opera/7.54 (Windows NT 5.1; U) [pl]" "www.templeos.org" @@ -845,8 +845,8 @@ 222.248.144.106 - - [10/Feb/2015:21:49:57 -0800] "GET /Wb/Doc/Demands.html HTTP/1.1" 200 11835 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" 222.248.144.106 - - [10/Feb/2015:21:50:03 -0800] "GET /Wb/Home/Web/History.html HTTP/1.1" 200 7745 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" 131.8.134.171 - - [10/Feb/2015:21:55:02 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2015/11/Rant150211.html HTTP/1.1" 404 89 "-" "curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2" "www.templeos.org" -52.53.176.53 - - [10/Feb/2015:21:55:06 -0800] "GET /Wb/Demo/MultiCore/Interrupts.CPP.Z HTTP/1.1" 200 297 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" -52.53.176.247 - - [10/Feb/2015:21:57:55 -0800] "GET /Wb/Adam/Gr/MakeGr.CPP.Z HTTP/1.1" 200 2714 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.53 - - [10/Feb/2015:21:55:06 -0800] "GET /Wb/Demo/MultiCore/Interrupts.HC.Z HTTP/1.1" 200 297 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.247 - - [10/Feb/2015:21:57:55 -0800] "GET /Wb/Adam/Gr/MakeGr.HC.Z HTTP/1.1" 200 2714 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 131.8.134.171 - - [10/Feb/2015:22:00:02 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2015/11/Rant150211.html HTTP/1.1" 404 89 "-" "curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2" "www.templeos.org" 58.128.177.232 - - [10/Feb/2015:22:03:00 -0800] "GET /Wb/Demo/OldSchool/MultiFileAOT/?D=A HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org" 190.136.225.24 - - [10/Feb/2015:22:04:29 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (X11; Linux i686; rv:34.0) Gecko/20100101 Firefox/34.0" "www.templeos.org" diff --git a/Demo/WebLogDemo/access_150212.LOG b/Demo/WebLogDemo/access_150212.LOG index ab7ba97..d229d5c 100644 --- a/Demo/WebLogDemo/access_150212.LOG +++ b/Demo/WebLogDemo/access_150212.LOG @@ -20,7 +20,7 @@ 74.51.215.137 - - [11/Feb/2015:00:28:06 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20110814 Firefox/6.0 Google favicon" "www.templeos.org" 213.217.218.176 - - [11/Feb/2015:00:33:53 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:25.2) Gecko/20150122 PaleMoon/25.2.1" "www.templeos.org" 130.41.233.58 - - [11/Feb/2015:00:34:50 -0800] "GET /Wb/Demo/WebLogDemo/access_090509.html HTTP/1.1" 200 217406 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 OPR/26.0.1656.60" "www.templeos.org" -52.53.176.32 - - [11/Feb/2015:00:35:13 -0800] "GET /Wb/Compiler/BackA.CPP.Z HTTP/1.1" 200 7144 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.32 - - [11/Feb/2015:00:35:13 -0800] "GET /Wb/Compiler/BackA.HC.Z HTTP/1.1" 200 7144 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 108.204.215.78 - - [11/Feb/2015:00:35:15 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 108.204.215.78 - - [11/Feb/2015:00:35:15 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 58.128.177.232 - - [11/Feb/2015:00:37:06 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2013/11/Rant131108.html HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org" @@ -56,7 +56,7 @@ 104.74.160.63 - - [11/Feb/2015:01:15:46 -0800] "GET /Wb/Home/Web/Downloads.html HTTP/1.1" 200 7086 "http://www.templeos.org/" "Mozilla/5.0 (X11; Linux x86_64; rv:25.2) Gecko/20150123 Firefox/31.9 PaleMoon/25.2.1" "www.templeos.org" 119.225.151.151 - - [11/Feb/2015:01:16:35 -0800] "GET /Wb/Accts/TS/Web/TempleOSV0218A.BMP HTTP/1.1" 404 89 "-" "facebookexternalhit/1.0 (+http://www.facebook.com/externalhit_uatext.php)" "www.templeos.org" 25.28.235.97 - - [11/Feb/2015:01:18:12 -0800] "GET / HTTP/1.1" 200 6329 "https://www.google.com.hk/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" -52.53.176.32 - - [11/Feb/2015:01:21:05 -0800] "GET /Wb/Adam/Opt/Utils/LineRep.CPP.Z HTTP/1.1" 200 1599 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.32 - - [11/Feb/2015:01:21:05 -0800] "GET /Wb/Adam/Opt/Utils/LineRep.HC.Z HTTP/1.1" 200 1599 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 56.179.101.97 - - [11/Feb/2015:01:21:14 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36 OPR/27.0.1689.66" "www.templeos.org" 56.179.101.97 - - [11/Feb/2015:01:21:16 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36 OPR/27.0.1689.66" "www.templeos.org" 214.200.131.51 - - [11/Feb/2015:01:22:20 -0800] "GET / HTTP/1.1" 200 6329 "http://www.google.com/" "Mozilla/5.0 (Linux; Android 4.4.2; ALCATEL ONE TOUCH 4037T Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.141 Mobile Safari/537.36" "www.templeos.org" @@ -149,7 +149,7 @@ 52.220.146.124 - - [11/Feb/2015:02:41:35 -0800] "GET /Wb/Adam/God/HSNotes.html HTTP/1.1" 200 35828 "http://www.templeos.org/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10) AppleWebKit/600.1.25 (KHTML, like Gecko) Version/8.0 Safari/600.1.25" "www.templeos.org" 52.220.146.124 - - [11/Feb/2015:02:42:47 -0800] "GET /Wb/Misc/Bible.html HTTP/1.1" 200 6439170 "http://www.templeos.org/Wb/Adam/God/HSNotes.html" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10) AppleWebKit/600.1.25 (KHTML, like Gecko) Version/8.0 Safari/600.1.25" "www.templeos.org" 58.128.177.232 - - [11/Feb/2015:02:49:43 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2014/03/Rant140322.html HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org" -52.53.176.32 - - [11/Feb/2015:02:50:32 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses58.TXT.Z HTTP/1.1" 200 498 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.32 - - [11/Feb/2015:02:50:32 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses58.DD.Z HTTP/1.1" 200 498 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 27.8.224.47 - - [11/Feb/2015:02:54:17 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.5; http://www.majestic12.co.uk/bot.php?+)" "www.templeos.org" 52.220.146.124 - - [11/Feb/2015:02:54:47 -0800] "GET /Wb/Apps/AfterEgypt/Comics/ HTTP/1.1" 200 20959 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10) AppleWebKit/600.1.25 (KHTML, like Gecko) Version/8.0 Safari/600.1.25" "www.templeos.org" 52.220.146.124 - - [11/Feb/2015:02:54:54 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses01.html HTTP/1.1" 200 2935 "http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10) AppleWebKit/600.1.25 (KHTML, like Gecko) Version/8.0 Safari/600.1.25" "www.templeos.org" @@ -210,7 +210,7 @@ 82.164.220.94 - - [11/Feb/2015:03:14:46 -0800] "GET / HTTP/1.1" 200 6329 "http://www.developpez.com/actu/77604/TempleOS-un-systeme-d-exploitation-pour-parler-a-Dieu-developpe-par-un-programmeur-schizophrene/" "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 130.195.45.202 - - [11/Feb/2015:03:20:16 -0800] "GET /Wb/Misc/Bible.html HTTP/1.1" 200 6439170 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 OPR/26.0.1656.60" "www.templeos.org" 106.255.105.30 - - [11/Feb/2015:03:22:03 -0800] "GET / HTTP/1.1" 200 6329 "http://disqus.com/embed/comments/?base=default&version=d1b39333cdab5cb490d069fe62825a04&f=hausdorff&t_u=http%3A%2F%2Fblog.nullspace.io%2Fkernel-latency.html&t_d=84%25%20of%20a%20single-threaded%201KB%20write%20in%20Redis%20is%20spent%20in%20the%20kernel&t_t=84%25%20of%20a%20single-threaded%201KB%20write%20in%20Redis%20is%20spent%20in%20the%20kernel&s_o=default" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2236.0 Safari/537.36" "www.templeos.org" -52.53.176.129 - - [11/Feb/2015:03:24:32 -0800] "GET /Wb/Home/Sup1/Sup1HDAudio/Examples/BeatFreq.CPP.Z HTTP/1.1" 200 1167 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.129 - - [11/Feb/2015:03:24:32 -0800] "GET /Wb/Home/Sup1/Sup1HDAudio/Examples/BeatFreq.HC.Z HTTP/1.1" 200 1167 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 164.225.231.69 - - [11/Feb/2015:03:27:05 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36" "www.templeos.org" 228.48.95.108 - - [11/Feb/2015:03:31:51 -0800] "GET /Wb/Accts/TS/Web/TempleOS.html HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Page2RSS/0.7; +http://page2rss.com/)" "www.templeos.org" 131.17.77.111 - - [11/Feb/2015:03:32:40 -0800] "GET /robots.txt HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.5; http://www.majestic12.co.uk/bot.php?+)" "www.templeos.org" @@ -237,7 +237,7 @@ 217.220.156.197 - - [11/Feb/2015:03:42:14 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 16.160.56.10 - - [11/Feb/2015:03:42:39 -0800] "GET /Wb/Home/Web/TempleOS.html HTTP/1.1" 200 12669 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0" "www.templeos.org" 210.182.97.43 - - [11/Feb/2015:03:43:00 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0" "www.templeos.org" -52.53.176.247 - - [11/Feb/2015:03:43:33 -0800] "GET /Wb/Apps/Psalmody/Examples/reposes.CPP.Z HTTP/1.1" 200 444 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.247 - - [11/Feb/2015:03:43:33 -0800] "GET /Wb/Apps/Psalmody/Examples/reposes.HC.Z HTTP/1.1" 200 444 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 210.182.97.43 - - [11/Feb/2015:03:45:55 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0" "www.templeos.org" 52.53.176.137 - - [11/Feb/2015:03:49:15 -0800] "GET /Wb/Apps/Logic/Load.html HTTP/1.1" 200 3967 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 129.226.244.66 - - [11/Feb/2015:03:49:24 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2013/12/Rant131220.html HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)" "www.templeos.org" @@ -650,7 +650,7 @@ 74.51.214.50 - - [11/Feb/2015:13:44:52 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20110814 Firefox/6.0 Google favicon" "www.templeos.org" 240.92.54.138 - - [11/Feb/2015:13:46:25 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" 240.92.54.138 - - [11/Feb/2015:13:46:34 -0800] "GET /Wb/Home/Web/TOSVideos.html HTTP/1.1" 200 40440 "http://www.templeos.org/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" -38.191.148.193 - - [11/Feb/2015:13:55:13 -0800] "GET /files/DICTIONARY.TXT HTTP/1.1" 200 2555904 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 OPR/26.0.1656.60" "www.templeos.org" +38.191.148.193 - - [11/Feb/2015:13:55:13 -0800] "GET /files/DICTIONARY.DD HTTP/1.1" 200 2555904 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 OPR/26.0.1656.60" "www.templeos.org" 27.210.37.110 - - [11/Feb/2015:13:59:05 -0800] "GET /Wb/Kernel/Memory.html HTTP/1.1" 404 89 "-" "Twitterbot/1.0" "www.templeos.org" 82.39.137.4 - - [11/Feb/2015:14:01:26 -0800] "GET / HTTP/1.1" 200 6329 "http://disqus.com/embed/comments/?base=default&version=d1756393434cb7a7170f4fceda22c860&f=hausdorff&t_u=http%3A%2F%2Fblog.nullspace.io%2Fkernel-latency.html&t_d=84%25%20of%20a%20single-threaded%201KB%20write%20in%20Redis%20is%20spent%20in%20the%20kernel&t_t=84%25%20of%20a%20single-threaded%201KB%20write%20in%20Redis%20is%20spent%20in%20the%20kernel&s_o=default" "Mozilla/5.0 (X11; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 82.39.137.4 - - [11/Feb/2015:14:01:27 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" @@ -691,7 +691,7 @@ 130.183.182.159 - - [11/Feb/2015:14:32:02 -0800] "GET /Wb/Doc/DolDocOverview.html HTTP/1.1" 200 48077 "http://www.templeos.org/Wb/Doc/DolDocOverview.html" "Mozilla/5.0 (Windows NT 6.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36" "www.templeos.org" 38.15.199.17 - - [11/Feb/2015:14:35:18 -0800] "GET / HTTP/1.1" 200 6329 "http://www.chimerarevo.com/hardware/templeos-il-sistema-operativo-richiesto-da-dio-182037/" "Mozilla/5.0 (Linux; Android 4.4.3; HTC One Build/KTU84L) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/33.0.0.0 Mobile Safari/537.36" "www.templeos.org" 38.15.199.17 - - [11/Feb/2015:14:35:27 -0800] "GET /Wb/Adam/God/HSNotes.html HTTP/1.1" 200 35828 "http://www.templeos.org/" "Mozilla/5.0 (Linux; Android 4.4.3; HTC One Build/KTU84L) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/33.0.0.0 Mobile Safari/537.36" "www.templeos.org" -58.128.177.232 - - [11/Feb/2015:14:39:30 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2013/10/Rant131031.TXT.Z HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org" +58.128.177.232 - - [11/Feb/2015:14:39:30 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2013/10/Rant131031.DD.Z HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org" 172.141.73.216 - - [11/Feb/2015:14:43:48 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2014/06/Rant140618.html HTTP/1.1" 404 89 "http://cpa-partnerki.ru/" "Opera/7.54 (Windows NT 5.1; U) [pl]" "www.templeos.org" 172.141.73.216 - - [11/Feb/2015:14:43:48 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2014/06/Rant140618.html HTTP/1.1" 404 89 "http://taihouse.ru/" "Opera/7.54 (Windows NT 5.1; U) [pl]" "www.templeos.org" 172.141.73.216 - - [11/Feb/2015:14:43:48 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2014/06/Rant140618.html HTTP/1.1" 404 89 "http://cpa-partnerki.ru/" "Opera/7.54 (Windows NT 5.1; U) [pl]" "www.templeos.org" @@ -744,9 +744,9 @@ 27.210.37.166 - - [11/Feb/2015:15:49:25 -0800] "GET /robots.txt HTTP/1.1" 404 89 "-" "Twitterbot/1.0" "www.templeos.org" 27.210.37.166 - - [11/Feb/2015:15:49:25 -0800] "GET /Wb/Accts/TS/Web/TempleOS.html HTTP/1.1" 404 89 "-" "Twitterbot/1.0" "www.templeos.org" 68.126.105.238 - - [11/Feb/2015:15:51:53 -0800] "GET /Wb/Apps/AfterEgypt/Comics/ HTTP/1.1" 200 20959 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" -68.126.105.238 - - [11/Feb/2015:15:52:02 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses01.TXT.Z HTTP/1.1" 200 324 "-" "curl/7.40.0" "www.templeos.org" -68.126.105.238 - - [11/Feb/2015:15:52:05 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses01.TXT.Z HTTP/1.1" 200 324 "-" "curl/7.40.0" "www.templeos.org" -68.126.105.238 - - [11/Feb/2015:15:52:06 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses01.TXT.Z HTTP/1.1" 200 324 "-" "curl/7.40.0" "www.templeos.org" +68.126.105.238 - - [11/Feb/2015:15:52:02 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses01.DD.Z HTTP/1.1" 200 324 "-" "curl/7.40.0" "www.templeos.org" +68.126.105.238 - - [11/Feb/2015:15:52:05 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses01.DD.Z HTTP/1.1" 200 324 "-" "curl/7.40.0" "www.templeos.org" +68.126.105.238 - - [11/Feb/2015:15:52:06 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses01.DD.Z HTTP/1.1" 200 324 "-" "curl/7.40.0" "www.templeos.org" 131.8.134.171 - - [11/Feb/2015:15:55:02 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2015/11/Rant150211.html HTTP/1.1" 404 89 "-" "curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2" "www.templeos.org" 74.51.144.214 - - [11/Feb/2015:15:57:39 -0800] "GET /Wb/Doc/Install.html HTTP/1.1" 200 10714 "-" "SAMSUNG-SGH-E250/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.Browser/6.2.3.3.c.1.101 (GUI) MMP/2.0 (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)" "www.templeos.org" 189.117.13.223 - - [11/Feb/2015:16:01:30 -0800] "HEAD / HTTP/1.1" 200 0 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506)" "www.templeos.org" @@ -881,7 +881,7 @@ 202.176.251.156 - - [11/Feb/2015:20:01:18 -0800] "GET /Wb/Adam/Opt/Boot/ HTTP/1.1" 200 2521 "-" "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)" "www.templeos.org" 190.163.176.154 - - [11/Feb/2015:20:01:54 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.78.2 (KHTML, like Gecko) Version/7.0.6 Safari/537.78.2" "www.templeos.org" 215.120.48.236 - - [11/Feb/2015:20:04:14 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20110814 Firefox/6.0 Google favicon" "www.templeos.org" -52.53.176.160 - - [11/Feb/2015:20:08:46 -0800] "GET /Wb/Doc/Start.TXT.Z HTTP/1.1" 200 202 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.160 - - [11/Feb/2015:20:08:46 -0800] "GET /Wb/Doc/Start.DD.Z HTTP/1.1" 200 202 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 121.139.44.4 - - [11/Feb/2015:20:12:12 -0800] "HEAD /robots.txt HTTP/1.1" 404 0 "-" "creepyCrawler" "www.templeos.org" 241.159.120.16 - - [11/Feb/2015:20:24:42 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko" "www.templeos.org" 81.253.5.237 - - [11/Feb/2015:20:26:45 -0800] "GET /wb/home/wb2/videos.html HTTP/1.1" 404 89 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36" "www.templeos.org" @@ -898,11 +898,11 @@ 47.31.174.175 - - [11/Feb/2015:20:54:15 -0800] "GET /TempleOSCD.ISO HTTP/1.1" 200 720896 "-" "YisouSpider" "www.templeos.org" 131.8.134.171 - - [11/Feb/2015:20:55:02 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2015/11/Rant150211.html HTTP/1.1" 404 89 "-" "curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2" "www.templeos.org" 130.41.233.161 - - [11/Feb/2015:20:55:54 -0800] "GET /Wb/Demo/WebLogDemo/access_090509.html HTTP/1.1" 200 217406 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 OPR/26.0.1656.60" "www.templeos.org" -52.53.176.185 - - [11/Feb/2015:20:56:12 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2013/12/Rant131201.TXT.Z HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.185 - - [11/Feb/2015:20:56:12 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2013/12/Rant131201.DD.Z HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 58.128.177.232 - - [11/Feb/2015:20:57:41 -0800] "GET /Certs/virtual-notary-cert-randomnum-46487.p12 HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org" 129.226.244.80 - - [11/Feb/2015:21:00:24 -0800] "GET /robots.txt HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)" "www.templeos.org" 241.159.225.120 - - [11/Feb/2015:21:02:04 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko" "www.templeos.org" -52.53.176.58 - - [11/Feb/2015:21:10:47 -0800] "GET /Wb/Kernel/Sched.CPP.Z HTTP/1.1" 200 4669 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.58 - - [11/Feb/2015:21:10:47 -0800] "GET /Wb/Kernel/Sched.HC.Z HTTP/1.1" 200 4669 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 52.53.176.100 - - [11/Feb/2015:21:11:33 -0800] "GET /Wb/Demo/Games/Squirt.html HTTP/1.1" 200 183425 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 199.153.192.55 - - [11/Feb/2015:21:12:18 -0800] "HEAD / HTTP/1.1" 200 0 "-" "Python-urllib/2.7 AppEngine-Google; (+http://code.google.com/appengine; appid: s~jkirchartz)" "www.templeos.org" 229.137.198.53 - - [11/Feb/2015:21:17:39 -0800] "GET /TempleOSCD.ISO HTTP/1.1" 200 589824 "-" "Mozilla/5.0 Gecko/20100115 Firefox/3.6" "www.templeos.org" @@ -915,7 +915,7 @@ 52.53.176.58 - - [11/Feb/2015:21:32:22 -0800] "GET /Wb/Demo/Progress.html HTTP/1.1" 200 23466 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 228.141.169.196 - - [11/Feb/2015:21:34:13 -0800] "GET /Wb/Adam/AMath.html HTTP/1.1" 200 60604 "-" "Mozilla/5.0 (compatible; DotBot/1.1; http://www.opensiteexplorer.org/dotbot, help@moz.com)" "www.templeos.org" 228.141.169.196 - - [11/Feb/2015:21:34:51 -0800] "GET /Wb/Adam/DolDoc/DocInit.html HTTP/1.1" 200 73019 "-" "Mozilla/5.0 (compatible; DotBot/1.1; http://www.opensiteexplorer.org/dotbot, help@moz.com)" "www.templeos.org" -52.53.176.185 - - [11/Feb/2015:21:35:35 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses25.TXT.Z HTTP/1.1" 200 376 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.185 - - [11/Feb/2015:21:35:35 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses25.DD.Z HTTP/1.1" 200 376 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 228.141.169.196 - - [11/Feb/2015:21:36:24 -0800] "GET /Wb/Apps/Budget/Accts.html HTTP/1.1" 200 2736 "-" "Mozilla/5.0 (compatible; DotBot/1.1; http://www.opensiteexplorer.org/dotbot, help@moz.com)" "www.templeos.org" 89.137.79.96 - - [11/Feb/2015:21:37:02 -0800] "GET /Wb/Doc/AboutTempleOS.html HTTP/1.1" 200 4925 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" 222.214.252.177 - - [11/Feb/2015:21:37:40 -0800] "GET / HTTP/1.1" 200 6329 "http://t.co/hheHFEwFTV" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" @@ -973,7 +973,7 @@ 52.53.176.235 - - [11/Feb/2015:22:04:02 -0800] "GET /Wb/Apps/ToTheFront/?N=A HTTP/1.1" 200 1814 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 129.226.244.238 - - [11/Feb/2015:22:04:51 -0800] "GET /files/ASU_Transcripts.pdf HTTP/1.1" 200 13602 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53 (compatible; bingbot/2.0; http://www.bing.com/bingbot.htm)" "www.templeos.org" 92.101.67.98 - - [11/Feb/2015:22:07:35 -0800] "GET /apple-touch-icon.png HTTP/1.1" 404 89 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3" "www.templeos.org" -58.128.177.232 - - [11/Feb/2015:22:10:44 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2014/06/Rant140626.TXT.Z HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org" +58.128.177.232 - - [11/Feb/2015:22:10:44 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2014/06/Rant140626.DD.Z HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org" 129.226.244.66 - - [11/Feb/2015:22:12:30 -0800] "GET /Wb/Adam/Gr/SpriteEd.html HTTP/1.1" 200 639471 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)" "www.templeos.org" 52.53.176.73 - - [11/Feb/2015:22:13:39 -0800] "GET /Wb/Compiler/Back1b.html HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 98.159.204.65 - - [11/Feb/2015:22:13:40 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2014/10/Rant141012.html HTTP/1.1" 404 89 "http://doska-vsem.ru/" "Mozilla/5.0 (compatible; Add Catalog/2.1;)" "www.templeos.org" @@ -1042,7 +1042,7 @@ 131.8.134.171 - - [11/Feb/2015:23:00:01 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2015/11/Rant150212.html HTTP/1.1" 404 89 "-" "curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2" "www.templeos.org" 52.53.176.242 - - [11/Feb/2015:23:04:32 -0800] "GET /Wb/Apps/Logic/Logic.html HTTP/1.1" 200 320827 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 56.200.27.17 - - [11/Feb/2015:23:08:10 -0800] "GET /Wb/Doc/AboutTempleOS.html HTTP/1.1" 200 4925 "http://www.templeos.org/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" -149.76.214.50 - - [11/Feb/2015:23:08:19 -0800] "GET /files/DICTIONARY.TXT HTTP/1.1" 200 8060928 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 OPR/26.0.1656.60" "www.templeos.org" +149.76.214.50 - - [11/Feb/2015:23:08:19 -0800] "GET /files/DICTIONARY.DD HTTP/1.1" 200 8060928 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 OPR/26.0.1656.60" "www.templeos.org" 27.210.37.110 - - [11/Feb/2015:23:15:49 -0800] "GET /Wb/Adam/Gr/GrBitMap.html HTTP/1.1" 200 1037461 "-" "Twitterbot/1.0" "www.templeos.org" 151.69.116.248 - - [11/Feb/2015:23:18:55 -0800] "GET /robots.txt HTTP/1.1" 404 89 "http://www.templeos.org/robots.txt" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2)" "www.templeos.org" 122.43.121.5 - - [11/Feb/2015:23:19:26 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" @@ -1056,7 +1056,7 @@ 108.204.215.78 - - [11/Feb/2015:23:32:44 -0800] "GET /Wb/Home/Sup1/ HTTP/1.1" 200 5204 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 228.141.141.213 - - [11/Feb/2015:23:36:28 -0800] "GET /Wb/Demo/Carry.html HTTP/1.1" 200 14681 "-" "Mozilla/5.0 (compatible; DotBot/1.1; http://www.opensiteexplorer.org/dotbot, help@moz.com)" "www.templeos.org" 58.128.177.232 - - [11/Feb/2015:23:50:51 -0800] "GET /Wb/Accts/TS/Web/TAD/2014/03/Rant140305.html HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org" -52.53.176.185 - - [11/Feb/2015:23:51:52 -0800] "GET /Wb/Adam/AExts.HPP.Z HTTP/1.1" 200 2002 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +52.53.176.185 - - [11/Feb/2015:23:51:52 -0800] "GET /Wb/Adam/AExts.HH.Z HTTP/1.1" 200 2002 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 70.90.114.220 - - [11/Feb/2015:23:53:53 -0800] "GET /Wb/Accts/TS/Web/TempleOSV0213A.BMP HTTP/1.1" 404 89 "-" "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)" "www.templeos.org" 70.90.114.220 - - [11/Feb/2015:23:53:53 -0800] "GET /Wb/Accts/TS/Web/TempleOSV0213A.BMP HTTP/1.1" 404 89 "-" "facebookexternalhit/1.0 (+http://www.facebook.com/externalhit_uatext.php)" "www.templeos.org" 131.8.134.171 - - [11/Feb/2015:23:55:02 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2015/11/Rant150212.html HTTP/1.1" 404 89 "-" "curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2" "www.templeos.org" diff --git a/Demo/WebLogDemo/access_150213.LOG b/Demo/WebLogDemo/access_150213.LOG index eaafe85..c254c0e 100644 --- a/Demo/WebLogDemo/access_150213.LOG +++ b/Demo/WebLogDemo/access_150213.LOG @@ -84,13 +84,13 @@ 132.112.187.174 - - [12/Feb/2015:01:37:25 -0800] "GET /Wb/Home/Web/TADRant.html HTTP/1.1" 200 3616 "http://www.templeos.org/" "Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B466 Safari/600.1.4" "www.templeos.org" 132.112.187.174 - - [12/Feb/2015:01:38:46 -0800] "GET /Wb/Apps/AfterEgypt/Comics/ HTTP/1.1" 200 20959 "http://www.templeos.org/Wb/Adam/God/HSNotes.html" "Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B466 Safari/600.1.4" "www.templeos.org" 132.112.187.174 - - [12/Feb/2015:01:38:52 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses10.html HTTP/1.1" 200 2819 "http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/" "Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B466 Safari/600.1.4" "www.templeos.org" -132.112.187.174 - - [12/Feb/2015:01:39:02 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses08.TXT.Z HTTP/1.1" 200 334 "http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/" "Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B466 Safari/600.1.4" "www.templeos.org" +132.112.187.174 - - [12/Feb/2015:01:39:02 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses08.DD.Z HTTP/1.1" 200 334 "http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/" "Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B466 Safari/600.1.4" "www.templeos.org" 132.112.187.174 - - [12/Feb/2015:01:39:08 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses01.html HTTP/1.1" 200 2935 "http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/" "Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B466 Safari/600.1.4" "www.templeos.org" 132.112.187.174 - - [12/Feb/2015:01:39:27 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses02.html HTTP/1.1" 200 3489 "http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/" "Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B466 Safari/600.1.4" "www.templeos.org" 105.108.89.16 - - [12/Feb/2015:01:39:38 -0800] "GET /Wb/Home/Web/History.html HTTP/1.1" 200 7745 "-" "mifetcher/1.0" "www.templeos.org" 132.112.187.174 - - [12/Feb/2015:01:39:43 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses04.html HTTP/1.1" 200 2928 "http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/" "Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B466 Safari/600.1.4" "www.templeos.org" 132.112.187.174 - - [12/Feb/2015:01:40:09 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses16.html HTTP/1.1" 200 3688 "http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/" "Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B466 Safari/600.1.4" "www.templeos.org" -132.112.187.174 - - [12/Feb/2015:01:40:36 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses19.TXT.Z HTTP/1.1" 200 337 "http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/" "Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B466 Safari/600.1.4" "www.templeos.org" +132.112.187.174 - - [12/Feb/2015:01:40:36 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses19.DD.Z HTTP/1.1" 200 337 "http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/" "Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B466 Safari/600.1.4" "www.templeos.org" 46.48.190.210 - - [12/Feb/2015:01:40:46 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2013/10/Img057.BMP HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)" "www.templeos.org" 46.48.190.210 - - [12/Feb/2015:01:40:48 -0800] "GET /images/Frosting.jpg HTTP/1.1" 200 21326 "-" "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)" "www.templeos.org" 132.112.187.174 - - [12/Feb/2015:01:40:59 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses21.html HTTP/1.1" 200 2793 "http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/" "Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B466 Safari/600.1.4" "www.templeos.org" @@ -102,7 +102,7 @@ 132.112.187.174 - - [12/Feb/2015:01:41:47 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses81.html HTTP/1.1" 200 2882 "http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/" "Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B466 Safari/600.1.4" "www.templeos.org" 132.112.187.174 - - [12/Feb/2015:01:42:00 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses79.html HTTP/1.1" 200 3113 "http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/" "Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B466 Safari/600.1.4" "www.templeos.org" 132.112.187.174 - - [12/Feb/2015:01:42:05 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses76.html HTTP/1.1" 200 2797 "http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/" "Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B466 Safari/600.1.4" "www.templeos.org" -132.112.187.174 - - [12/Feb/2015:01:42:13 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses76.TXT.Z HTTP/1.1" 200 256 "http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/" "Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B466 Safari/600.1.4" "www.templeos.org" +132.112.187.174 - - [12/Feb/2015:01:42:13 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses76.DD.Z HTTP/1.1" 200 256 "http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/" "Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B466 Safari/600.1.4" "www.templeos.org" 132.112.187.174 - - [12/Feb/2015:01:42:15 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses73.html HTTP/1.1" 200 3025 "http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/" "Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B466 Safari/600.1.4" "www.templeos.org" 132.112.187.174 - - [12/Feb/2015:01:42:27 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses72.html HTTP/1.1" 200 2907 "http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/" "Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B466 Safari/600.1.4" "www.templeos.org" 132.112.187.174 - - [12/Feb/2015:01:42:33 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses71.html HTTP/1.1" 200 3232 "http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/" "Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B466 Safari/600.1.4" "www.templeos.org" @@ -131,7 +131,7 @@ 147.255.165.35 - - [12/Feb/2015:01:55:51 -0800] "HEAD / HTTP/1.1" 200 0 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506)" "www.templeos.org" 129.14.210.30 - - [12/Feb/2015:01:56:13 -0800] "GET /Wb/Adam/God/HSNotes.html HTTP/1.1" 200 35828 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko" "www.templeos.org" 129.14.210.30 - - [12/Feb/2015:01:56:17 -0800] "GET /Wb/Home/Web/History.html HTTP/1.1" 200 7745 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko" "www.templeos.org" -18.199.184.33 - - [12/Feb/2015:01:57:18 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses01.TXT.Z HTTP/1.1" 200 324 "http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" +18.199.184.33 - - [12/Feb/2015:01:57:18 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses01.DD.Z HTTP/1.1" 200 324 "http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 96.11.7.225 - - [12/Feb/2015:01:58:16 -0800] "GET /Wb/Home/Sup1/Sup1Texts/Darwin.TXT HTTP/1.1" 200 851968 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 13.92.170.164 - - [12/Feb/2015:01:59:23 -0800] "GET / HTTP/1.1" 200 6329 "http://forum.ubuntu-it.org/viewtopic.php?f=13&t=304452&start=2940" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 13.92.170.164 - - [12/Feb/2015:01:59:24 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" @@ -160,7 +160,7 @@ 137.214.97.64 - - [12/Feb/2015:02:24:49 -0800] "GET / HTTP/1.1" 200 6329 "http://www.losethos.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36" "www.templeos.org" 137.214.97.64 - - [12/Feb/2015:02:24:50 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36" "www.templeos.org" 42.122.6.164 - - [12/Feb/2015:02:29:05 -0800] "GET /Wb/Accts/TS/Web/WalkThru.html HTTP/1.1" 404 89 "-" "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16" "www.templeos.org" -96.11.7.217 - - [12/Feb/2015:02:30:08 -0800] "GET /Wb/Demo/ScreenCodes.CPP.Z HTTP/1.1" 200 500 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +96.11.7.217 - - [12/Feb/2015:02:30:08 -0800] "GET /Wb/Demo/ScreenCodes.HC.Z HTTP/1.1" 200 500 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 40.200.113.75 - - [12/Feb/2015:02:30:17 -0800] "GET / HTTP/1.1" 200 6329 "https://www.google.hu/" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" 40.200.113.75 - - [12/Feb/2015:02:30:18 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" 42.122.6.164 - - [12/Feb/2015:02:31:47 -0800] "GET /Wb/Accts/TS/Web/WalkThru.html HTTP/1.1" 404 89 "-" "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16" "www.templeos.org" @@ -226,7 +226,7 @@ 121.145.150.227 - - [12/Feb/2015:03:30:49 -0800] "GET /Wb/Doc/AboutTempleOS.html HTTP/1.1" 200 4925 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" 92.78.238.59 - - [12/Feb/2015:03:30:59 -0800] "GET / HTTP/1.1" 200 6329 "-" "NetLyzer FastProbe" "www.templeos.org" 117.45.170.127 - - [12/Feb/2015:03:33:40 -0800] "GET /Wb/Compiler/ HTTP/1.1" 200 8721 "http://www.reddit.com/user/TempleOS_Terry_Davis" "Mozilla/5.0 (Windows NT 6.3; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" -117.45.170.127 - - [12/Feb/2015:03:34:24 -0800] "GET /Wb/Compiler/UAsm.CPP.Z HTTP/1.1" 200 6806 "http://www.templeos.org/Wb/Compiler/" "Mozilla/5.0 (Windows NT 6.3; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" +117.45.170.127 - - [12/Feb/2015:03:34:24 -0800] "GET /Wb/Compiler/UAsm.HC.Z HTTP/1.1" 200 6806 "http://www.templeos.org/Wb/Compiler/" "Mozilla/5.0 (Windows NT 6.3; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 231.231.121.111 - - [12/Feb/2015:03:40:51 -0800] "GET /Wb/Accts/TS/TAD/Adam3cKeyPlugIns.html HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)" "www.templeos.org" 231.231.121.111 - - [12/Feb/2015:03:40:51 -0800] "GET /Wb/Home/Web/TOSVideos.html HTTP/1.1" 200 40440 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)" "www.templeos.org" 52.209.44.154 - - [12/Feb/2015:03:42:20 -0800] "GET /Wb/Accts/TS/Web/TempleOS.html HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)" "www.templeos.org" @@ -302,7 +302,7 @@ 179.165.230.173 - - [12/Feb/2015:05:52:16 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0" "templeos.org" 39.62.80.146 - - [12/Feb/2015:05:53:22 -0800] "GET / HTTP/1.1" 200 6329 "http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CCAQFjAA&url=http%3A%2F%2Fwww.templeos.org%2F&ei=T7DcVKbOKYLIsQTPz4CgAg&usg=AFQjCNFKL3We7L8wuY5up5gkGZtpKv4qtA&bvm=bv.85761416,d.cWc" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 96.11.7.217 - - [12/Feb/2015:05:56:55 -0800] "GET /Wb/Home/Sup1/VanGogh/BMPView.html HTTP/1.1" 200 17528 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" -96.11.7.121 - - [12/Feb/2015:05:58:36 -0800] "GET /Wb/Doc/FileMgrPullDown.TXT.Z HTTP/1.1" 200 245 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +96.11.7.121 - - [12/Feb/2015:05:58:36 -0800] "GET /Wb/Doc/FileMgrPullDown.DD.Z HTTP/1.1" 200 245 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 179.165.230.173 - - [12/Feb/2015:05:59:54 -0800] "GET /Wb/Home/Web/ScreenShots.html HTTP/1.1" 200 3353 "http://www.templeos.org/Wb/Home/Web/TempleOS.html" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 179.165.230.173 - - [12/Feb/2015:05:59:54 -0800] "GET /Wb/Home/Web/Imgs/MenuV0401.BMP HTTP/1.1" 200 153718 "http://www.templeos.org/Wb/Home/Web/ScreenShots.html" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 179.165.230.173 - - [12/Feb/2015:06:00:08 -0800] "GET /Wb/Doc/HelpIndex.html HTTP/1.1" 200 19954 "http://www.templeos.org/Wb/Home/Web/TempleOS.html" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" @@ -320,7 +320,7 @@ 181.97.102.9 - - [12/Feb/2015:06:43:00 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 142.64.195.181 - - [12/Feb/2015:06:44:54 -0800] "GET /robots.txt HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Blekkobot; ScoutJet; +http://blekko.com/about/blekkobot)" "www.templeos.org" 181.168.34.254 - - [12/Feb/2015:06:45:00 -0800] "HEAD / HTTP/1.1" 200 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0" "www.templeos.org" -35.18.127.92 - - [12/Feb/2015:06:48:19 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2014/08/Rant140826.TXT.Z HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org" +35.18.127.92 - - [12/Feb/2015:06:48:19 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2014/08/Rant140826.DD.Z HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org" 126.95.99.251 - - [12/Feb/2015:06:49:41 -0800] "GET /TempleOSCD.ISO HTTP/1.1" 200 18120704 "http://www.templeos.org/Wb/Home/Web/Downloads.html" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" 167.185.206.253 - - [12/Feb/2015:06:50:24 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0" "www.templeos.org" 210.5.31.191 - - [12/Feb/2015:06:59:22 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/600.3.18 (KHTML, like Gecko) Version/8.0.3 Safari/600.3.18" "www.templeos.org" @@ -402,7 +402,7 @@ 194.117.217.157 - - [12/Feb/2015:09:25:14 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36" "www.templeos.org" 194.117.217.157 - - [12/Feb/2015:09:28:10 -0800] "GET /Wb/Doc/DemoIndex.html HTTP/1.1" 200 32945 "http://www.reddit.com/r/TempleOS_Official/comments/2q0k2l/how_can_i_learn_holyc/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36" "www.templeos.org" 194.117.217.157 - - [12/Feb/2015:09:28:45 -0800] "GET /Wb/Demo/Games/Rocket.html HTTP/1.1" 200 84868 "http://www.templeos.org/Wb/Doc/DemoIndex.html" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36" "www.templeos.org" -96.11.7.33 - - [12/Feb/2015:09:29:14 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses66.TXT.Z HTTP/1.1" 200 321 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +96.11.7.33 - - [12/Feb/2015:09:29:14 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses66.DD.Z HTTP/1.1" 200 321 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 35.18.127.92 - - [12/Feb/2015:09:35:55 -0800] "GET /Certs/virtual-notary-cert-randomnum-39951.p12 HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org" 119.252.163.148 - - [12/Feb/2015:09:36:33 -0800] "GET /Wb/Home/Web/Downloads.html HTTP/1.1" 200 7086 "https://www.facebook.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" 90.249.171.8 - - [12/Feb/2015:09:36:34 -0800] "GET /Wb/Home/Web/Downloads.html HTTP/1.1" 200 7086 "-" "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)" "www.templeos.org" @@ -423,7 +423,7 @@ 35.132.148.108 - - [12/Feb/2015:10:03:08 -0800] "GET /Wb/Home/Web/TADRant.html HTTP/1.1" 200 4129 "http://www.templeos.org/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 35.132.148.108 - - [12/Feb/2015:10:05:37 -0800] "GET /logs/access.log HTTP/1.1" 200 94300 "-" "Wget/1.15 (linux-gnu)" "www.templeos.org" 212.49.142.67 - - [12/Feb/2015:10:09:40 -0800] "GET /TempleOSCD.ISO HTTP/1.1" 200 18120704 "http://www.templeos.org/Wb/Home/Web/Downloads.html" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.53 Safari/537.36" "www.templeos.org" -96.11.7.221 - - [12/Feb/2015:10:12:05 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2013/12/Rant131219.TXT.Z HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +96.11.7.221 - - [12/Feb/2015:10:12:05 -0800] "GET /Wb/Accts/TS/Web/Rants/TAD/2013/12/Rant131219.DD.Z HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 35.18.127.92 - - [12/Feb/2015:10:14:08 -0800] "GET /Wb/Accts/TS/Web/TAD/2014/07/Rant140704.html HTTP/1.1" 404 89 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)" "www.templeos.org" 91.143.212.182 - - [12/Feb/2015:10:16:33 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.91 Safari/537.36" "templeos.org" 91.143.212.182 - - [12/Feb/2015:10:16:57 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.91 Safari/537.36" "www.templeos.org" @@ -442,7 +442,7 @@ 147.21.37.102 - - [12/Feb/2015:10:33:33 -0800] "GET /Wb/Adam/God/HSNotes.html HTTP/1.1" 200 35828 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.1.25 (KHTML, like Gecko) Version/8.0 Safari/600.1.25" "www.templeos.org" 70.111.135.77 - - [12/Feb/2015:10:34:46 -0800] "GET /Wb/Accts/TS/Web/TempleOS.html HTTP/1.1" 404 89 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/600.3.18 (KHTML, like Gecko) Version/8.0.3 Safari/600.3.18" "www.templeos.org" 70.111.135.77 - - [12/Feb/2015:10:34:47 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "http://www.templeos.org/Wb/Accts/TS/Web/TempleOS.html" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/600.3.18 (KHTML, like Gecko) Version/8.0.3 Safari/600.3.18" "www.templeos.org" -96.11.7.221 - - [12/Feb/2015:10:35:07 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses59.TXT.Z HTTP/1.1" 200 347 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" +96.11.7.221 - - [12/Feb/2015:10:35:07 -0800] "GET /Wb/Apps/AfterEgypt/Comics/Moses59.DD.Z HTTP/1.1" 200 347 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org" 94.32.56.190 - - [12/Feb/2015:10:36:00 -0800] "GET / HTTP/1.1" 200 6329 "http://www.best-sport-videoclips.com/sport=sportnews" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36" "www.templeos.org" 94.32.56.190 - - [12/Feb/2015:10:36:01 -0800] "GET / HTTP/1.1" 200 6329 "http://www.best-sport-videoclips.com/sport=sportnews" "Mozilla/4.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/5.0)" "www.templeos.org" 147.255.165.35 - - [12/Feb/2015:10:37:25 -0800] "HEAD / HTTP/1.1" 200 0 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506)" "www.templeos.org" @@ -542,7 +542,7 @@ 238.136.58.235 - - [12/Feb/2015:13:36:28 -0800] "GET / HTTP/1.1" 200 6329 "https://www.google.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36" "www.templeos.org" 238.136.58.235 - - [12/Feb/2015:13:36:29 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36" "www.templeos.org" 135.220.37.139 - - [12/Feb/2015:13:37:44 -0800] "GET /TempleOSCD.ISO HTTP/1.1" 200 18122752 "http://www.templeos.org/Wb/Home/Web/Downloads.html" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org" -249.107.121.250 - - [12/Feb/2015:13:38:10 -0800] "GET /files/DICTIONARY.TXT HTTP/1.1" 200 2686976 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Dragon/36.1.1.21 Chrome/36.0.1985.97 Safari/537.36" "www.templeos.org" +249.107.121.250 - - [12/Feb/2015:13:38:10 -0800] "GET /files/DICTIONARY.DD HTTP/1.1" 200 2686976 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Dragon/36.1.1.21 Chrome/36.0.1985.97 Safari/537.36" "www.templeos.org" 185.209.131.243 - - [12/Feb/2015:13:39:16 -0800] "GET /Wb/Doc/ChangeLog.html HTTP/1.1" 200 39177 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org" 164.36.111.235 - - [12/Feb/2015:13:44:49 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/600.3.18 (KHTML, like Gecko) Version/8.0.3 Safari/600.3.18" "www.templeos.org" 227.33.59.91 - - [12/Feb/2015:13:45:47 -0800] "GET /Wb/Doc/Welcome.html HTTP/1.1" 200 24269 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 8_1_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B440 Safari/600.1.4" "www.templeos.org" diff --git a/Demo/WordSearch.CPP b/Demo/WordSearch.CPP deleted file mode 100644 index 3d30e94..0000000 --- a/Demo/WordSearch.CPP +++ /dev/null @@ -1,153 +0,0 @@ -//Simple and fancy way of searching - -//See ::/Apps/Vocabulary/VocabQuiz.CPP.Z -//for another example of dictionary usage. - -#define NUM_ROWS 20 -#define NUM_COLS 20 -#define MAX_DIMENSION MaxI64(NUM_ROWS,NUM_COLS) - -U8 m[NUM_ROWS][NUM_COLS]; - -U0 Init() -{ - I64 x,y; - for (y=0;y2;i--) { - buf[i]=0; - if ((ptr=ACDWordPtAt(buf)) && *ptr++==ACD_WORD_CHAR && - !StrICmp(ptr,buf)) { - "%s ",buf; - } - } - } -} - -U0 SimpleWordSearch() -{ - Search(1,0); - Search(0,1); - Search(-1,0); - Search(0,-1); - Search(1,1); - Search(-1,-1); - Search(1,-1); - Search(-1,1); - '\n'; -} - -//************************************ -U8 words[NUM_ROWS*NUM_COLS*8][MAX_DIMENSION+1]; -U8 *word_ptrs[NUM_ROWS*NUM_COLS*8]; - -U0 CollectWords(I64 dx,I64 dy,I64 *_n) -{ - I64 x,y,n=*_n; - for (y=0;y*w1) - break; - if (!*w2) { - if (StrLen(dict+1)>2) { - k=i; - while (k2;i--) { + buf[i]=0; + if ((ptr=ACDWordPtAt(buf)) && *ptr++==ACD_WORD_CHAR && + !StrICmp(ptr,buf)) { + "%s ",buf; + } + } + } +} + +U0 SimpleWordSearch() +{ + Search(1,0); + Search(0,1); + Search(-1,0); + Search(0,-1); + Search(1,1); + Search(-1,-1); + Search(1,-1); + Search(-1,1); + '\n'; +} + +//************************************ +U8 words[NUM_ROWS*NUM_COLS*8][MAX_DIMENSION+1]; +U8 *word_ptrs[NUM_ROWS*NUM_COLS*8]; + +U0 CollectWords(I64 dx,I64 dy,I64 *_n) +{ + I64 x,y,n=*_n; + for (y=0;y*w1) + break; + if (!*w2) { + if (StrLen(dict+1)>2) { + k=i; + while (k\"\""$ + +8144 Sickle Lane +Las Vegas, NV 89128 +(702)254-4223 + +$TX,"tdavis@templeos.org",HTML="mailto:tdavis@templeos.org"$ + + +$FG,5$About Me:$FG$ + +$TX,"ASU_Transcripts",HTML="http://www.templeos.org/files/ASU_Transcripts.pdf"$ $TX,"ASU Course Catalog (See page 261)",HTML="https://catalog.asu.edu/files/shared/archives/1994-1996/general/UG1994-1996.pdf/1994-1996-UG-241-267.pdf"$ $TX,"Dr. David Pheanis",HTML="https://webapp4.asu.edu/directory/person/77201"$ + +I was a National Merit Scholar with a 1440 SAT at Arizona State University. I have a bachelor's in Computer System Engineering from ASU, basically, embedded systems, and a master's in Electrical Engineering from ASU, control systems. I worked as a software, hardware and mechanical engineer at Ticketmaster from 1990-1996. + +I designed a 3 axis stepper-motor-driven milling machine 1996-1997 with a CAD/CAM package for a company I started called Home Automation and Robotic Equipment. + +$HC,"
\"\"
"$ + +I worked for a company named Xytec Corp. 1997-1999. We made FPGA-based image processing equipment. I wrote $FG,2$$TX,"SimStructure",HTML="http://www.templeos.org/files/SimStrSetUp.zip"$$FG$ from 2000-2001 for H.A.R.E. I worked as head software/electrical engineer for a company called Graphic Technologies, 2001-2002, making replacement chips for toner printer cartridges so they could be refilled. + +$FG,5$Credits:$FG$ +See $LK,"::/Doc/Credits.DD"$. + diff --git a/Doc/AboutTempleOS.TXT b/Doc/AboutTempleOS.TXT deleted file mode 100644 index 70bb422..0000000 --- a/Doc/AboutTempleOS.TXT +++ /dev/null @@ -1,33 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"TempleOS"$$FG$ - - -$FG,5$Websites:$FG$ -$TX,"www.templeos.org",HTML="http://www.templeos.org"$ - -$FG,5$Owner/President:$FG$ -$TX,"Terry A. Davis",HTML="mailto:tdavis@templeos.org"$ - -$HC,"
\"\"
"$ - -8144 Sickle Lane -Las Vegas, NV 89128 -(702)254-4223 - -$TX,"tdavis@templeos.org",HTML="mailto:tdavis@templeos.org"$ - - -$FG,5$About Me:$FG$ - -$TX,"ASU_Transcripts",HTML="http://www.templeos.org/files/ASU_Transcripts.pdf"$ $TX,"ASU Course Catalog (See page 261)",HTML="https://catalog.asu.edu/files/shared/archives/1994-1996/general/UG1994-1996.pdf/1994-1996-UG-241-267.pdf"$ $TX,"Dr. David Pheanis",HTML="https://webapp4.asu.edu/directory/person/77201"$ - -I was a National Merit Scholar with a 1440 SAT at Arizona State University. I have a bachelor's in Computer System Engineering from ASU, basically, embedded systems, and a master's in Electrical Engineering from ASU, control systems. I worked as a software, hardware and mechanical engineer at Ticketmaster from 1990-1996. - -I designed a 3 axis stepper-motor-driven milling machine 1996-1997 with a CAD/CAM package for a company I started called Home Automation and Robotic Equipment. - -$HC,"
\"\"
"$ - -I worked for a company named Xytec Corp. 1997-1999. We made FPGA-based image processing equipment. I wrote $FG,2$$TX,"SimStructure",HTML="http://www.templeos.org/files/SimStrSetUp.zip"$$FG$ from 2000-2001 for H.A.R.E. I worked as head software/electrical engineer for a company called Graphic Technologies, 2001-2002, making replacement chips for toner printer cartridges so they could be refilled. - -$FG,5$Credits:$FG$ -See $LK,"::/Doc/Credits.TXT"$. - diff --git a/Doc/Asm.DD b/Doc/Asm.DD new file mode 100644 index 0000000..2f63962 --- /dev/null +++ b/Doc/Asm.DD @@ -0,0 +1,47 @@ +$WW,1$$FG,5$$TX+CX,"Assembler"$$FG$ + +See $LK,"::/Compiler/OpCodes.DD"$ for opcodes. They're not standard. Some invalid insts are not flagged and some valid insts are not implemented. 16-bit asm support is limited. + +Here are example inst formats: +$HL,1$ ADD RAX,I64 FS:DISP[RSI+RDI*8] +$HL,0$$HL,1$ ADD RAX,I64 [DISP] +$HL,0$ +$FG,2$$$$FG$ Current compiler output pos (inst ptr). Even works in HolyC expressions. + +$FG,2$$$$FG$ works in $FG,2$class$FG$es. + $FG,2$class MyFun + { + $$=-16; + I64 local1; + I64 local2; + $$=$$+256; + I64 crazy; + };$FG$ + +$FG,4$LABEL$FG,2$:: +$FG$ Defines an exported glbl label. + +$FG,4$LABEL$FG,2$: +$FG$ Defines an non-exported glbl label. + +$FG,2$@@$FG,4$LABEL$FG,2$: +$FG$ Defines a local label with scope valid between two global labels. + +$FG,2$DU8$FG$, $FG,2$DU16$FG$, $FG,2$DU32$FG$, $FG,2$DU64$FG$ + Define BYTE, WORD, DWORD or QWORD. Can be used with $FG,2$DUP()$FG$ and ASCII strings. For your convenience, the ASCII strings do not have terminating zeros. Define cmds must end with a semicolon. + +$FG,2$USE16$FG$, $FG,2$USE32$FG$, $FG,2$USE64$FG$ + +$FG,2$IMPORT$FG$ $FG,4$sym1name$FG$, $FG,4$sym2name$FG$; + +$FG,2$LIST$FG$, $FG,2$NOLIST$FG$ + +$FG,2$ALIGN$FG$ $FG,4$num$FG$, $FG,4$fill_byte$FG$ + Align to $FG,4$num$FG$ boundary and fill with $FG,4$fill_byte$FG$. + +$FG,2$MODULE_ORG$FG$ $FG,4$num$FG$ + Set code addr for JIT or set module $LK,"Load",A="MN:Load"$() addr -- has 16-byte $LK,"CBinFile",A="MN:CBinFile"$ header and patch table trailing. + +$FG,2$BINFILE$FG,4$ "FileName.BIN"$FG$; + +See $LK,"Assembly Language",A="FF:::/Doc/GuideLines.DD,Assembly Language"$, $LK,"::/Demo/Asm/AsmAndC1.HC"$, $LK,"::/Demo/Asm/AsmAndC2.HC"$ and $LK,"::/Demo/Asm/AsmAndC3.HC"$. diff --git a/Doc/Asm.TXT b/Doc/Asm.TXT deleted file mode 100644 index e480f5c..0000000 --- a/Doc/Asm.TXT +++ /dev/null @@ -1,47 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"Assembler"$$FG$ - -See $LK,"::/Compiler/OpCodes.TXT"$ for opcodes. They're not standard. Some invalid insts are not flagged and some valid insts are not implemented. 16-bit asm support is limited. - -Here are example inst formats: -$HL,1$ ADD RAX,I64 FS:DISP[RSI+RDI*8] -$HL,0$$HL,1$ ADD RAX,I64 [DISP] -$HL,0$ -$FG,2$$$$FG$ Current compiler output pos (inst ptr). Even works in HolyC expressions. - -$FG,2$$$$FG$ works in $FG,2$class$FG$es. - $FG,2$class MyFun - { - $$=-16; - I64 local1; - I64 local2; - $$=$$+256; - I64 crazy; - };$FG$ - -$FG,4$LABEL$FG,2$:: -$FG$ Defines an exported glbl label. - -$FG,4$LABEL$FG,2$: -$FG$ Defines an non-exported glbl label. - -$FG,2$@@$FG,4$LABEL$FG,2$: -$FG$ Defines a local label with scope valid between two global labels. - -$FG,2$DU8$FG$, $FG,2$DU16$FG$, $FG,2$DU32$FG$, $FG,2$DU64$FG$ - Define BYTE, WORD, DWORD or QWORD. Can be used with $FG,2$DUP()$FG$ and ASCII strings. For your convenience, the ASCII strings do not have terminating zeros. Define cmds must end with a semicolon. - -$FG,2$USE16$FG$, $FG,2$USE32$FG$, $FG,2$USE64$FG$ - -$FG,2$IMPORT$FG$ $FG,4$sym1name$FG$, $FG,4$sym2name$FG$; - -$FG,2$LIST$FG$, $FG,2$NOLIST$FG$ - -$FG,2$ALIGN$FG$ $FG,4$num$FG$, $FG,4$fill_byte$FG$ - Align to $FG,4$num$FG$ boundary and fill with $FG,4$fill_byte$FG$. - -$FG,2$MODULE_ORG$FG$ $FG,4$num$FG$ - Set code addr for JIT or set module $LK,"Load",A="MN:Load"$() addr -- has 16-byte $LK,"CBinFile",A="MN:CBinFile"$ header and patch table trailing. - -$FG,2$BINFILE$FG,4$ "FileName.BIN"$FG$; - -See $LK,"Assembly Language",A="FF:::/Doc/GuideLines.TXT,Assembly Language"$, $LK,"::/Demo/Asm/AsmAndC1.CPP"$, $LK,"::/Demo/Asm/AsmAndC2.CPP"$ and $LK,"::/Demo/Asm/AsmAndC3.CPP"$. diff --git a/Doc/AutoComplete.DD b/Doc/AutoComplete.DD new file mode 100644 index 0000000..df837c7 --- /dev/null +++ b/Doc/AutoComplete.DD @@ -0,0 +1,19 @@ +$FG,2$$WW,1$AutoComplete$FG$ is the $FG,7$LTGRAY$FG$ window on the right of the screen. $LK,"ACInit",A="MN:ACInit"$() collects words from all text files in subdirectories. Normally, the call to $LK,"ACInit",A="MN:ACInit"$() is in $LK,"HomeSys.HC",A="FF:~/HomeSys.HC,ACInit"$. It provides auto-complete for typing, jump-to-code and jump-to-dictionary functionality. + +$FG,2$$FG$ Closes the $FG,7$LTGRAY$FG$ AutoComplete window. +$FG,2$$FG$ Opens the $FG,7$LTGRAY$FG$ AutoComplete window. + +$FG,2$$FG$ Jumps to the source code for 1st symbol in the window. +$FG,2$$FG$ Jumps to the source code for 2nd symbol in the window. +$FG,2$$FG$ Jumps to the source code for n-th symbol in the window. +$FG,2$$FG$ Autocompletes the 1st symbol in the window. +$FG,2$$FG$ Autocompletes the 2nd symbol in the window. +$FG,2$$FG$ Autocompletes the n-th symbol in the window. +$FG,2$$FG$ Jumps to the dictionary for 1st symbol in the window. +$FG,2$$FG$ Jumps to the dictionary for 2nd symbol in the window. +$FG,2$$FG$ Jumps to the dictionary for n-th symbol in the window. +$FG,2$$FG$ Autocompletes the 1st dictionary word in the window. +$FG,2$$FG$ Autocompletes the 2nd dictionary word in the window. +$FG,2$$FG$ Autocompletes the n-th dictionary word in the window. + +If you have the raw Project Gutenberg dictionary file, you can generate the TempleOS processed dictionary files with the stand-alone program $LK,"::/Adam/AutoComplete/ACDictGen.HC"$. diff --git a/Doc/AutoComplete.TXT b/Doc/AutoComplete.TXT deleted file mode 100644 index f9e1482..0000000 --- a/Doc/AutoComplete.TXT +++ /dev/null @@ -1,19 +0,0 @@ -$FG,2$$WW,1$AutoComplete$FG$ is the $FG,7$LTGRAY$FG$ window on the right of the screen. $LK,"ACInit",A="MN:ACInit"$() collects words from all text files in subdirectories. Normally, the call to $LK,"ACInit",A="MN:ACInit"$() is in $LK,"HomeSys.CPP",A="FF:~/HomeSys.CPP,ACInit"$. It provides auto-complete for typing, jump-to-code and jump-to-dictionary functionality. - -$FG,2$$FG$ Closes the $FG,7$LTGRAY$FG$ AutoComplete window. -$FG,2$$FG$ Opens the $FG,7$LTGRAY$FG$ AutoComplete window. - -$FG,2$$FG$ Jumps to the source code for 1st symbol in the window. -$FG,2$$FG$ Jumps to the source code for 2nd symbol in the window. -$FG,2$$FG$ Jumps to the source code for n-th symbol in the window. -$FG,2$$FG$ Autocompletes the 1st symbol in the window. -$FG,2$$FG$ Autocompletes the 2nd symbol in the window. -$FG,2$$FG$ Autocompletes the n-th symbol in the window. -$FG,2$$FG$ Jumps to the dictionary for 1st symbol in the window. -$FG,2$$FG$ Jumps to the dictionary for 2nd symbol in the window. -$FG,2$$FG$ Jumps to the dictionary for n-th symbol in the window. -$FG,2$$FG$ Autocompletes the 1st dictionary word in the window. -$FG,2$$FG$ Autocompletes the 2nd dictionary word in the window. -$FG,2$$FG$ Autocompletes the n-th dictionary word in the window. - -If you have the raw Project Gutenberg dictionary file, you can generate the TempleOS processed dictionary files with the stand-alone program $LK,"::/Adam/AutoComplete/ACDictGen.CPP"$. diff --git a/Doc/AutoFile.DD b/Doc/AutoFile.DD new file mode 100644 index 0000000..356182e --- /dev/null +++ b/Doc/AutoFile.DD @@ -0,0 +1,7 @@ +$WW,1$$FG,2$AutoFiles$FG$ are used to generate user input to automate operations. The TempleOS tour is done with an $FG,2$AutoFile$FG$. It reminds me of a Unix pipe because $FG,2$StdOut$FG$ of one gets chained into $FG,2$StdIn$FG$ of another. + +When an $FG,2$AutoFile$FG$ runs, a child task is $LK,"Spawn",A="MN:Spawn"$()ed which intercepts real user input and generates fake input. AutoFiles are $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ programs run by the child whose stdout goes to the parent's input buffer. $LK,"Msg",A="MN:Msg"$() can be included in an $FG,2$AutoFile$FG$ to send special keys or mouse cmds to the parent. While an $FG,2$AutoFile$FG$ is running, the normal input gets diverted to the AutoFile task and can be filtered and sent back to the parent task. Unless you are driving functions which prompt for data, you can probably use an $FG,2$#include$FG$ file in place of an $FG,2$AutoFile$FG$. + +See $LK,"::/Demo/AutoFile/AFDir.AUT"$. + +Note: $LK,"Auto",A="MN:Auto"$("") can be used if all you need is to send ASCII characters. It differs from $LK,"AutoStr",A="MN:AutoStr"$(). You'll probably use $LK,"Auto",A="MN:Auto"$() a lot and not $LK,"AutoStr",A="MN:AutoStr"$(). With $LK,"Auto",A="MN:Auto"$(), for example, you can place answers to the prompts for recompiling the $FG,2$Kernel$FG$ module during $LK,"BootHDIns",A="MN:BootHDIns"$(). diff --git a/Doc/AutoFile.TXT b/Doc/AutoFile.TXT deleted file mode 100644 index 3accf73..0000000 --- a/Doc/AutoFile.TXT +++ /dev/null @@ -1,7 +0,0 @@ -$WW,1$$FG,2$AutoFiles$FG$ are used to generate user input to automate operations. The TempleOS tour is done with an $FG,2$AutoFile$FG$. It reminds me of a Unix pipe because $FG,2$StdOut$FG$ of one gets chained into $FG,2$StdIn$FG$ of another. - -When an $FG,2$AutoFile$FG$ runs, a child task is $LK,"Spawn",A="MN:Spawn"$()ed which intercepts real user input and generates fake input. AutoFiles are $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ programs run by the child whose stdout goes to the parent's input buffer. $LK,"Msg",A="MN:Msg"$() can be included in an $FG,2$AutoFile$FG$ to send special keys or mouse cmds to the parent. While an $FG,2$AutoFile$FG$ is running, the normal input gets diverted to the AutoFile task and can be filtered and sent back to the parent task. Unless you are driving functions which prompt for data, you can probably use an $FG,2$#include$FG$ file in place of an $FG,2$AutoFile$FG$. - -See $LK,"::/Demo/AutoFile/AFDir.AUT"$. - -Note: $LK,"Auto",A="MN:Auto"$("") can be used if all you need is to send ASCII characters. It differs from $LK,"AutoStr",A="MN:AutoStr"$(). You'll probably use $LK,"Auto",A="MN:Auto"$() a lot and not $LK,"AutoStr",A="MN:AutoStr"$(). With $LK,"Auto",A="MN:Auto"$(), for example, you can place answers to the prompts for recompiling the $FG,2$Kernel$FG$ module during $LK,"BootHDIns",A="MN:BootHDIns"$(). diff --git a/Doc/Bit.TXT b/Doc/Bit.DD similarity index 100% rename from Doc/Bit.TXT rename to Doc/Bit.DD diff --git a/Doc/Boot.DD b/Doc/Boot.DD new file mode 100644 index 0000000..b8829e9 Binary files /dev/null and b/Doc/Boot.DD differ diff --git a/Doc/Boot.TXT b/Doc/Boot.TXT deleted file mode 100644 index f4e7173..0000000 Binary files a/Doc/Boot.TXT and /dev/null differ diff --git a/Doc/ChangeLog.DD b/Doc/ChangeLog.DD new file mode 100644 index 0000000..1a966f6 --- /dev/null +++ b/Doc/ChangeLog.DD @@ -0,0 +1,345 @@ +$WW,1$$FG,5$$TX+CX,"Change Log"$$FG$ + +Use $LK,"R",A="MN:R"$() to rename if I change a label. + +$IV,1$----09/18/16 17:15:54----$IV,0$ + +$IV,1$----09/18/16 12:52:03----$IV,0$ +* $BK,1$TempleOS version 4.11 Released$BK,0$ +* Fixed bug in $LK,"IsDotZ",A="MN:IsDotZ"$() and $LK,"IsDotC",A="MN:IsDotC"$(). +* $LK,"R",A="MN:R"$("CPP","HC"); +* $LK,"R",A="MN:R"$("HPP","HH"); +* $LK,"R",A="MN:R"$("TXT","DD"); + +$IV,1$----09/06/16 13:01:42----$IV,0$ +* Added $LK,"OPTf_WARN_HEADER_MISMATCH",A="MN:OPTf_WARN_HEADER_MISMATCH"$. +* Changed $LK,"WinInside",A="MN:WinInside"$(). +* Got rid of $FG,4$MSG_FOCUS$FG$, $FG,4$MSG_MOVE$FG$, and $FG,4$MSG_SIZE$FG$. There are no longer messages for moving and sizing windows. + +$IV,1$----09/06/16 02:40:43----$IV,0$ +* Improved $LK,"::/Demo/MagicPairs.HC"$. + +$IV,1$----08/27/16 09:45:39----$IV,0$ +* Improved $LK,"CPURep",A="MN:CPURep"$(). +* Improved $LK,"::/Misc/OSTestSuite.HC"$. +* Added $LK,"BirthWait",A="MN:BirthWait"$() and $LK,"DeathWait",A="MN:DeathWait"$(). + +$IV,1$----08/22/16 04:14:47----$IV,0$ +* $LK,"R",A="MN:R"$("TK_DOT_DOT_DOT","TK_ELLIPSIS"); + +$IV,1$----07/17/16 13:03:12----$IV,0$ +* Improved $LK,"DocOpt",A="MN:DocOpt"$(). + +$IV,1$----07/17/16 03:23:53----$IV,0$ +* Improved $LK,"::/Demo/Games/RawHide.HC"$. + +$IV,1$----07/15/16 10:11:10----$IV,0$ +* $BK,1$TempleOS version 4.10 Released$BK,0$ +* Improved $LK,"::/Demo/Games/EagleDive.HC"$. + +$IV,1$----07/15/16 05:17:24----$IV,0$ +* Created $LK,"CDevGlbls",A="MN:CDevGlbls"$.uncached_alias. +* Added 1 Gig page table support. + +$IV,1$----07/13/16 17:21:19----$IV,0$ +* Added multicore report to $LK,"CPURep",A="MN:CPURep"$(). + +$IV,1$----07/09/16 08:46:36----$IV,0$ +* Changed scoring in $LK,"::/Demo/Games/EagleDive.HC"$. +* Replaced many $FG,2$"%Q"$FG$ with $FG,2$"%$$Q"$FG$. +* Fixed $FG,2$'\x24'$FG$. +* Added $FG,2$'\d'$FG$ for $FG,2$'$$'$FG$. + +$IV,1$----07/08/16 14:30:19----$IV,0$ +* $LK,"R",A="MN:R"$("root","head"); +* Fixed $FG,2$REP_STOSB$FG$ and $LK,"MemSet",A="MN:MemSet"$() for 64-bit. + +$IV,1$----07/07/16 07:21:03----$IV,0$ +* $LK,"DocRead",A="MN:DocRead"$() changes to file's dir so relative filenames work. +* Added AppStore to website with Supplemental #1 ISO for download. + +$IV,1$----07/06/16 23:45:30----$IV,0$ +* Fixed multicore bug in $LK,"Sprite3",A="MN:Sprite3"$(). +* Improved $LK,"::/Demo/Games/EagleDive.HC"$. + +$IV,1$----07/05/16 06:03:47----$IV,0$ +* $BK,1$TempleOS version 4.09 Released$BK,0$ +* Improved $LK,"::/Demo/Games/EagleDive.HC"$. +* Improved $LK,"GrFillTri0",A="MN:GrFillTri0"$(). + +$IV,1$----07/03/16 04:30:05----$IV,0$ +* Added $LK,"Unmount",A="MN:Unmount"$(). +* Made BootLoader mandatory in $LK,"RedSeaISO",A="MN:RedSeaISO"$(). +* Added $LK,"BDT_ISO_FILE_READ",A="MN:BDT_ISO_FILE_READ"$. + +$IV,1$----07/01/16 05:29:08----$IV,0$ +* Made underscore mandatory on $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ callable asm functions. + +$IV,1$----06/28/16 13:15:08----$IV,0$ +* Changed $LK,"TaskRep",A="MN:TaskRep"$() and $LK,"MemRep",A="MN:MemRep"$(). +* Changed $LK,"::/Adam/WallPaper.HC"$. + +$IV,1$----06/26/16 14:01:16----$IV,0$ +* Added $LK,"LastFun",A="MN:LastFun"$(), $LK,"RunFile",A="MN:RunFile"$(), $LK,"RunFile2",A="MN:RunFile2"$() and $LK,"PopUpRunFile",A="MN:PopUpRunFile"$(). +* Made boot code modular. + +$IV,1$----06/24/16 14:15:13----$IV,0$ +* Added A.I. to $LK,"::/Apps/KeepAway/KeepAway.HC"$ and changed scoring. + +$IV,1$----06/24/16 02:55:42----$IV,0$ +* $BK,1$TempleOS version 4.08 Released$BK,0$ +* Added $FG,2$Polygon$FG$, $FG,2$Fence$FG$, $FG,2$Prism$FG$ and $FG,2$ResetColor$FG$ commands to $LK,"SpriteMeshEd",A="MN:SpriteMeshEd"$(). +* $LK,"R",A="MN:R"$("Reverse","Rev"); +* $LK,"R",A="MN:R"$("Select","Sel"); + +$IV,1$----06/23/16 01:03:36----$IV,0$ +* Added $LK,"GrFillCircle",A="MN:GrFillCircle"$(). +* Added $LK,"GrVLine",A="MN:GrVLine"$() and $LK,"GrLineFat3",A="MN:GrLineFat3"$(). + +$IV,1$----06/18/16 16:16:22----$IV,0$ +* Modified $LK,"KeyDevAdd",A="MN:KeyDevAdd"$(). +* $LK,"R",A="MN:R"$("nounusedwarn","no_warn"); +* $LK,"R",A="MN:R"$("sub_switch_start","start"); +* $LK,"R",A="MN:R"$("sub_switch_end","end"); +* Changed args to $LK,"PutDirLink",A="MN:PutDirLink"$() and $LK,"PutFileLink",A="MN:PutFileLink"$(). +* Added $LK,"HomeSet",A="MN:HomeSet"$(). Added $FG,2$"~"$FG$ as special directory designator. +* Changed filename exclude mask char from $FG,2$'~'$FG$ to $FG,2$'!'$FG$. See $LK,"File Utils",A="FI:::/Doc/FileUtils.DD"$. +* Got rid of $FG,4$/Home/HomePkgs.HC$FG$. + +$IV,1$----06/16/16 20:59:41----$IV,0$ +* $FG,2$$FG$ is terminal window. +* $FG,2$$FG$ is next task. + +$IV,1$----06/16/16 19:49:39----$IV,0$ +* Added $LK,"::/Doc/Comm.HC"$. +* Added $LK,"::/Doc/StdTempleOSPC.DD"$. +* Added $LK,"::/Kernel/FontCyrillic.HC"$. $FG,2$$FG$ + +$IV,1$----06/02/16 03:20:56----$IV,0$ +* $BK,1$TempleOS version 4.07 Released$BK,0$ +* Added claws to $LK,"::/Demo/Games/EagleDive.HC"$. + +$IV,1$----05/30/16 21:16:44----$IV,0$ +* Added waterfall to $LK,"::/Demo/Games/RawHide.HC"$. + +$IV,1$----05/23/16 01:30:28----$IV,0$ +* Added $LK,"RedSeaISO",A="MN:RedSeaISO"$(). +* $LK,"R",A="MN:R"$("ISOFileCreate","$LK,"ISO9660ISO",A="MN:ISO9660ISO"$"); + +$IV,1$----05/19/16 02:16:09----$IV,0$ +* Added $LK,"BDT_ISO_FILE_WRITE",A="MN:BDT_ISO_FILE_WRITE"$. + +$IV,1$----05/17/16 07:16:38----$IV,0$ +* Worked on compiler $LK,"CICArg",A="MN:CICArg"$.a1_type_pointed_to. + +$IV,1$----05/13/16 14:35:14----$IV,0$ +* Improved $LK,"::/Demo/Games/Wenceslas.HC"$. + +$IV,1$----05/12/16 05:18:56----$IV,0$ +* Added $LK,"CCF_CMD_LINE",A="MN:CCF_CMD_LINE"$ +* Replaced $FG,4$__DEPTH__$FG$ with $LK,"__CMD_LINE__",A="MN:__CMD_LINE__"$. + +$IV,1$----05/10/16 06:23:05----$IV,0$ +* Compiler bug fixes and optimizations. + +$IV,1$----05/07/16 08:55:59----$IV,0$ +* $BK,1$TempleOS version 4.06 Released$BK,0$ + +$IV,1$----05/03/16 19:26:45----$IV,0$ +* Made $LK,"FunSegFind",A="MN:FunSegFind"$() search all hash tables when $LK,"IsDbg",A="MN:IsDbg"$. +* Added missiles to $LK,"::/Apps/X-Caliber/X-Caliber.HC"$. +* Fixed bug in $LK,"D3Unit",A="MN:D3Unit"$(). + +$IV,1$----05/01/16 15:12:31----$IV,0$ +* $LK,"R",A="MN:R"$("Identical","Ident"); +* $LK,"R",A="MN:R"$("Previous","Prev"); +* $LK,"R",A="MN:R"$("Result","Res"); +* Started assembler MMX/SSE. Not done. +* Changed a couple Bible related things. + +$IV,1$----04/26/16 01:18:57----$IV,0$ +* $LK,"R",A="MN:R"$("MapDrv","$LK,"DrvMap",A="MN:DrvMap"$"); + +$IV,1$----04/25/16 13:17:49----$IV,0$ +* Changed args in $LK,"CAdd",A="MN:CAdd"$(), $LK,"CSub",A="MN:CSub"$(), $LK,"CMul",A="MN:CMul"$(), $LK,"CDiv",A="MN:CDiv"$() and $LK,"CPoly",A="MN:CPoly"$(). +* Changed args in $LK,"D3Add",A="MN:D3Add"$(), $LK,"D3Sub",A="MN:D3Sub"$(), $LK,"D3Mul",A="MN:D3Mul"$(), $LK,"D3Div",A="MN:D3Div"$() and $LK,"D3Cross",A="MN:D3Cross"$(). + +$IV,1$----04/25/16 03:42:30----$IV,0$ +* $LK,"R",A="MN:R"$("TK_INT","TK_I64"); +* Added $LK,"::/Demo/Templates/Game1.HC"$. +* Added $LK,"::/Demo/Templates/Lex1.HC"$. +* Added $LK,"::/Demo/Templates/MultiCore1.HC"$. +* Added $LK,"::/Demo/Templates/ODE1.HC"$. +* Added $LK,"::/Demo/Templates/Registry1.HC"$. +* Added $LK,"::/Demo/Templates/Util1.HC"$. +* Added $LK,"::/Demo/Templates/Util2.HC"$. + +$IV,1$----04/23/16 13:20:24----$IV,0$ +* Got rid of low protected memory area that caught NULL deref. +* Got rid of 4K page tables by making $LK,"text",A="MN:text"$.vga_alias. All pages are 2Meg size. + +$IV,1$----04/15/16 13:39:25----$IV,0$ +* Fixed bug in $LK,"EdCodeTools",A="MN:EdCodeTools"$(). +* Fixed double $FG,2$ASCII#5$FG$ cursor bug. + +$IV,1$----04/01/16 14:59:49----$IV,0$ +* Changed $LK,"SpriteInterpolate",A="MN:SpriteInterpolate"$() args. +* $LK,"R",A="MN:R"$("Index","Idx"); + +$IV,1$----03/31/16 11:20:13----$IV,0$ +* Changed $LK,"::/Adam/WallPaper.HC"$. +* Got rid of $FG,4$CTask.time_slice_start$FG$ and $FG,4$CTask.total_time$FG$. + +$IV,1$----03/29/16 05:53:45----$IV,0$ +* $BK,1$TempleOS version 4.05 Released$BK,0$ + +$IV,1$----03/24/16 16:26:50----$IV,0$ +* Added $LK,"::/Demo/Games/CharDemo.HC"$. + +$IV,1$----03/22/16 16:58:25----$IV,0$ +* Added $LK,"DOCEF_DFT_RAW_TYPE",A="MN:DOCEF_DFT_RAW_TYPE"$. Modified $LK,"DocForm",A="MN:DocForm"$() to look-up raw type automatically from the compiler's class information. +* Added $LK,"DOCEF_DFT_LEN",A="MN:DOCEF_DFT_LEN"$. Modified $LK,"DocForm",A="MN:DocForm"$() to look-up string length automatically from the compiler's class information. + +$IV,1$----03/21/16 07:28:35----$IV,0$ +* Added $LK,"OCF_ALIAS",A="MN:OCF_ALIAS"$. +* $LK,"R",A="MN:R"$("Integer","Int"); +* Added aliases to $LK,"::/Compiler/OpCodes.DD"$. + +$IV,1$----03/21/16 02:12:08----$IV,0$ +* Added $LK,"DOCT_MARKER",A="MN:DOCT_MARKER"$. +* Added $LK,"CICType",A="MN:CICType"$. +* Optimized $LK,"MDG_MASK",A="MN:MDG_MASK"$ and $LK,"RTG_MASK",A="MN:RTG_MASK"$ values. + +$IV,1$----03/19/16 09:15:11----$IV,0$ +* Fixed bug in $LK,"EdFindReplace",A="MN:EdFindReplace"$(). + +$IV,1$----03/19/16 06:22:36----$IV,0$ +* Fixed $LK,"UAsm",A="MN:Ui"$() bug. +* Got rids of $FG,4$ICF_A1_FIRST$FG$. +* Cleaned-up compiler $LK,"REGG_CLOBBERED",A="MN:REGG_CLOBBERED"$ and $LK,"REGG_STK_TEMP",A="MN:REGG_STK_TEMP"$. + +$IV,1$----03/18/16 09:53:33----$IV,0$ +* Made $LK,"SpriteEd",A="MN:SpriteEd"$() sel foreground elem. + +$IV,1$----03/14/16 05:57:27----$IV,0$ +* $BK,1$TempleOS version 4.04 Released$BK,0$ +* Changed $FG,2$nobound_switch$FG$ so it uses []. +* Changed $LK,"KbdMouseCmdAck",A="MN:KbdMouseCmdAck"$(). + +$IV,1$----02/19/16 18:48:51----$IV,0$ +* Fixed bug in $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$. + +$IV,1$----02/15/16 23:31:15----$IV,0$ +* Improved $LK,"::/Demo/Games/RawHide.HC"$. + +$IV,1$----02/13/16 17:02:34----$IV,0$ +* Added $FG,2$$$CL+H$$$FG$ to clear all, including hold entries. + +$IV,1$----02/10/16 08:56:49----$IV,0$ +* Improved $FG,2$$FG$ prompting. + +$IV,1$----02/09/16 23:54:23----$IV,0$ +* Created $LK,"DOCEF_LEN",A="MN:DOCEF_LEN"$ with arg. $LK,"DOCT_DATA",A="MN:DOCT_DATA"$ has default 64 len. + +$IV,1$----02/09/16 09:34:32----$IV,0$ +* $BK,1$TempleOS version 4.03 Released$BK,0$ +* Added $LK,"DOCEF_REMALLOC_DATA",A="MN:DOCEF_REMALLOC_DATA"$. + +$IV,1$----02/05/16 23:00:53----$IV,0$ +* Moved $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$. +* Added $LK,"::/Demo/AcctExample/TOSToHtml.HC"$. + +$IV,1$----02/03/16 18:47:00----$IV,0$ +* Refactored $LK,"SpriteMainEd",A="MN:SpriteMainEd"$(). +* Added tag edit to main sprite edit menu. + +$IV,1$----02/01/16 21:01:15----$IV,0$ +* Cleaned-up $LK,"TaskKillDying",A="MN:TaskKillDying"$(). +* Made multicore more professional. + +$IV,1$----02/01/16 06:02:41----$IV,0$ +* Moved $LK,"Mem2Meg.HC",A="FI:::/Demo/Lectures/Mem/Mem2Meg.HC"$ out of kernel. + +$IV,1$----01/31/16 04:07:50----$IV,0$ +* Fixed scheduler, so doesn't idle so high. +* Fixed many memory leaks. +* Changed args to $LK,"Mem512Alloc",A="MN:Mem512Alloc"$(), $LK,"Mem512Free",A="MN:Mem512Free"$(), and $LK,"Mem512TaskAlloc",A="MN:Mem512TaskAlloc"$(). + +$IV,1$----01/30/16 11:14:29----$IV,0$ +* Changed arg in $LK,"DocEntryNewTag",A="MN:DocEntryNewTag"$(). +* Added $LK,"DocEntryNewBase",A="MN:DocEntryNewBase"$(). + +$IV,1$----01/29/16 02:44:38----$IV,0$ +* Overhauled $LK,"DocSave",A="MN:DocSave"$() and $LK,"DocRecalc",A="MN:DocRecalc"$(). + +$IV,1$----01/28/16 20:45:35----$IV,0$ +* Fixed bug in locate sprite elem code. +* Overhauled $FG,2$$FG$ sprite editor. +* Added $LK,"DocHighlightCursor",A="MN:DocHighlightCursor"$() and $LK,"DOCf_DONT_HIGHLIGHT_CURSOR",A="MN:DOCf_DONT_HIGHLIGHT_CURSOR"$. + +$IV,1$----01/28/16 14:05:52----$IV,0$ +* Fixed bug in $LK,"AutoComplete",A="MN:AutoComplete"$() init. +* Added $LK,"HeapLogSizeRep",A="MN:HeapLogSizeRep"$(). + +$IV,1$----01/27/16 20:41:54----$IV,0$ +* $BK,1$TempleOS version 4.02 Released$BK,0$ + +$IV,1$----01/27/16 06:40:46----$IV,0$ +* Added $FG,2$$FG$ macro to $LK,"TestSuite",A="FI:::/Misc/OSTestSuite.HC"$. +* Added compiler err for $FG,2$break;$FG$ in a subswitch preface. + +$IV,1$----01/27/16 04:14:08----$IV,0$ +* Added $LK,"::/Demo/ToHtmlToTXTDemo/HtmlGen.HC"$ and $LK,"::/Demo/ToHtmlToTXTDemo/TXTGen.HC"$. +* Now, $LK,"Plain",A="MN:Plain"$() doesn't save with $LK,"CH_CURSOR",A="MN:CH_CURSOR"$. +* $LK,"R",A="MN:R"$("DOCF_PLAIN_TEXT_WITH_TABS","DOCF_PLAIN_TEXT_TABS"); +* Change $LK,"Document Links",A="FF:::/Adam/DolDoc/DocLink.HC,AD"$ "DF:word" to "DN:word". +* Merged documentation into $LK,"::/Doc/FAQ.DD"$. + +$IV,1$----01/26/16 17:51:45----$IV,0$ +* $LK,"R",A="MN:R"$("PSect","FunSeg"); +* $LK,"R",A="MN:R"$("Equal","Equ"); +* $LK,"R",A="MN:R"$("Binary","Bin"); + +$IV,1$----01/26/16 14:09:45----$IV,0$ +* Changed $LK,"DirContextNew",A="MN:DirContextNew"$(), $LK,"FilesFindMatch",A="MN:FilesFindMatch"$() and $LK,"FilesFind",A="MN:FilesFind"$() to use full_name. +* $LK,"R",A="MN:R"$("Statement","Stmt"); + +$IV,1$----01/18/16 15:19:43----$IV,0$ +* Added except arg to $LK,"Let2BlkDev",A="MN:Let2BlkDev"$(), $LK,"BlkDevChk",A="MN:BlkDevChk"$(), $LK,"Let2Drv",A="MN:Let2Drv"$(), $LK,"DrvChk",A="MN:DrvChk"$() and $LK,"DrvIsWritable",A="MN:DrvIsWritable"$(). + +$IV,1$----01/16/16 08:20:00----$IV,0$ +* Added $LK,"DrvTextAttrGet",A="MN:DrvTextAttrGet"$(). +* Removed $FG,4$DrvTextAttrSet$FG$(). + +$IV,1$----01/15/16 00:47:31----$IV,0$ +* $LK,"KeyboardPlug-Ins '9','0'",A="FF:::/HomeKeyPlugIns.HC,'9'"$. +* $LK,"R",A="MN:R"$("$$$$LM,5$$$$","$$$$ID,5$$$$"); + +$IV,1$----01/15/16 00:12:02----$IV,0$ +* Added $LK,"Let2BlkDevType",A="MN:Let2BlkDevType"$(). +* Added $LK,"WIF_SELF_FOCUS",A="MN:WIF_SELF_FOCUS"$ to $LK,"::/Misc/OSInstall.HC"$. +* Added $FG,2$%$$F$FG$ to $LK,"Print(\"\") Fmt Strings",A="FI:::/Doc/Print.DD"$. + +$IV,1$----01/12/16 19:17:12----$IV,0$ +* Overhauled $LK,"Mount",A="MN:Mount"$() and $LK,"::/Kernel/KCfg.HC"$. + +$IV,1$----01/12/16 10:06:18----$IV,0$ +* $BK,1$TempleOS version 4.01 Released$BK,0$ +* Standardized drive letters. Your $LK,"Auto",A="MN:Auto"$() config scripts for compiling the kernel with $LK,"BootHDIns",A="MN:BootHDIns"$() must be changed. +* Added $LK,"CCF_QUESTION_HELP",A="MN:CCF_QUESTION_HELP"$. + +$IV,1$----01/11/16 00:04:38----$IV,0$ +* $LK,"R",A="MN:R"$("PAGE_SIZE","MEM_PAGE_SIZE"); etc. +* $LK,"R",A="MN:R"$("DFT_STK","MEM_DFT_STK"); etc. +* Added $LK,"::/Demo/MemDemo.HC"$. + +$IV,1$----01/08/16 17:04:58----$IV,0$ +* Added $LK,"FUF_RISKY",A="MN:FUF_RISKY"$ to $LK,"DocOpt",A="MN:DocOpt"$(). +* Fixed $LK,"::/Doc/CompilerOverview.DD"$. + +$IV,1$----01/06/16 11:01:57----$IV,0$ +* Got rid of $FG,4$DOCEF_HARD_SKIP$FG$. + +$IV,1$----01/03/16 17:15:41----$IV,0$ +* Updated $LK,"::/Misc/PCIDevices.DD"$. +* Added null case option. Next higher int with "$FG,2$case:$FG$" in $FG,2$switch$FG$ stmts. See $LK,"::/Demo/NullCase.HC"$. diff --git a/Doc/ChangeLog.TXT b/Doc/ChangeLog.TXT deleted file mode 100644 index 9eec6ee..0000000 --- a/Doc/ChangeLog.TXT +++ /dev/null @@ -1,322 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"Change Log"$$FG$ - -Use $LK,"R",A="MN:R"$() to rename if I change a label. - -$IV,1$----08/08/16 08:32:26----$IV,0$ - -$IV,1$----07/17/16 13:03:12----$IV,0$ -* Improved $LK,"DocOpt",A="MN:DocOpt"$(). - -$IV,1$----07/17/16 03:23:53----$IV,0$ -* Improved $LK,"::/Demo/Games/RawHide.CPP"$. - -$IV,1$----07/15/16 10:11:10----$IV,0$ -* $BK,1$TempleOS version 4.10 Released$BK,0$ -* Improved $LK,"::/Demo/Games/EagleDive.CPP"$. - -$IV,1$----07/15/16 05:17:24----$IV,0$ -* Created $LK,"CDevGlbls",A="MN:CDevGlbls"$.uncached_alias. -* Added 1 Gig page table support. - -$IV,1$----07/13/16 17:21:19----$IV,0$ -* Added $LK,"::/Demo/MultiCore/RateCores.CPP"$. - -$IV,1$----07/09/16 08:46:36----$IV,0$ -* Changed scoring in $LK,"::/Demo/Games/EagleDive.CPP"$. -* Replaced many $FG,2$"%Q"$FG$ with $FG,2$"%$$Q"$FG$. -* Fixed $FG,2$'\x24'$FG$. -* Added $FG,2$'\d'$FG$ for $FG,2$'$$'$FG$. - -$IV,1$----07/08/16 14:30:19----$IV,0$ -* $LK,"R",A="MN:R"$("root","head"); -* Fixed $FG,2$REP_STOSB$FG$ and $LK,"MemSet",A="MN:MemSet"$() for 64-bit. - -$IV,1$----07/07/16 07:21:03----$IV,0$ -* $LK,"DocRead",A="MN:DocRead"$() changes to file's dir so relative filenames work. -* Added AppStore to website with Supplemental #1 ISO for download. - -$IV,1$----07/06/16 23:45:30----$IV,0$ -* Fixed multicore bug in $LK,"Sprite3",A="MN:Sprite3"$(). -* Improved $LK,"::/Demo/Games/EagleDive.CPP"$. - -$IV,1$----07/05/16 06:03:47----$IV,0$ -* $BK,1$TempleOS version 4.09 Released$BK,0$ -* Improved $LK,"::/Demo/Games/EagleDive.CPP"$. -* Improved $LK,"GrFillTri0",A="MN:GrFillTri0"$(). - -$IV,1$----07/03/16 04:30:05----$IV,0$ -* Added $LK,"Unmount",A="MN:Unmount"$(). -* Made BootLoader mandatory in $LK,"RedSeaISO",A="MN:RedSeaISO"$(). -* Added $LK,"BDT_ISO_FILE_READ",A="MN:BDT_ISO_FILE_READ"$. - -$IV,1$----07/01/16 05:29:08----$IV,0$ -* Made underscore mandatory on $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ callable asm functions. - -$IV,1$----06/28/16 13:15:08----$IV,0$ -* Changed $LK,"TaskRep",A="MN:TaskRep"$() and $LK,"MemRep",A="MN:MemRep"$(). -* Changed $LK,"::/Adam/WallPaper.CPP"$. - -$IV,1$----06/26/16 14:01:16----$IV,0$ -* Added $LK,"LastFun",A="MN:LastFun"$(), $LK,"RunFile",A="MN:RunFile"$(), $LK,"RunFile2",A="MN:RunFile2"$() and $LK,"PopUpRunFile",A="MN:PopUpRunFile"$(). -* Made boot code modular. - -$IV,1$----06/24/16 14:15:13----$IV,0$ -* Added A.I. to $LK,"::/Apps/KeepAway/KeepAway.CPP"$ and changed scoring. - -$IV,1$----06/24/16 02:55:42----$IV,0$ -* $BK,1$TempleOS version 4.08 Released$BK,0$ -* Added $FG,2$Polygon$FG$, $FG,2$Fence$FG$, $FG,2$Prism$FG$ and $FG,2$ResetColor$FG$ commands to $LK,"SpriteMeshEd",A="MN:SpriteMeshEd"$(). -* $LK,"R",A="MN:R"$("Reverse","Rev"); -* $LK,"R",A="MN:R"$("Select","Sel"); - -$IV,1$----06/23/16 01:03:36----$IV,0$ -* Added $LK,"GrFillCircle",A="MN:GrFillCircle"$(). -* Added $LK,"GrVLine",A="MN:GrVLine"$() and $LK,"GrLineFat3",A="MN:GrLineFat3"$(). - -$IV,1$----06/18/16 16:16:22----$IV,0$ -* Modified $LK,"KeyDevAdd",A="MN:KeyDevAdd"$(). -* $LK,"R",A="MN:R"$("nounusedwarn","no_warn"); -* $LK,"R",A="MN:R"$("sub_switch_start","start"); -* $LK,"R",A="MN:R"$("sub_switch_end","end"); -* Changed args to $LK,"PutDirLink",A="MN:PutDirLink"$() and $LK,"PutFileLink",A="MN:PutFileLink"$(). -* Added $LK,"HomeSet",A="MN:HomeSet"$(). Added $FG,2$"~"$FG$ as special directory designator. -* Changed filename exclude mask char from $FG,2$'~'$FG$ to $FG,2$'!'$FG$. See $LK,"File Utils",A="FI:::/Doc/FileUtils.TXT"$. -* Got rid of $FG,4$/Home/HomePkgs.CPP$FG$. - -$IV,1$----06/16/16 20:59:41----$IV,0$ -* $FG,2$$FG$ is terminal window. -* $FG,2$$FG$ is next task. - -$IV,1$----06/16/16 19:49:39----$IV,0$ -* Added $LK,"::/Doc/Comm.CPP"$. -* Added $LK,"::/Doc/StdTempleOSPC.TXT"$. -* Added $LK,"::/Kernel/FontCyrillic.CPP"$. $FG,2$$FG$ - -$IV,1$----06/02/16 03:20:56----$IV,0$ -* $BK,1$TempleOS version 4.07 Released$BK,0$ -* Added claws to $LK,"::/Demo/Games/EagleDive.CPP"$. - -$IV,1$----05/30/16 21:16:44----$IV,0$ -* Added waterfall to $LK,"::/Demo/Games/RawHide.CPP"$. - -$IV,1$----05/23/16 01:30:28----$IV,0$ -* Added $LK,"RedSeaISO",A="MN:RedSeaISO"$(). -* $LK,"R",A="MN:R"$("ISOFileCreate","$LK,"ISO9660ISO",A="MN:ISO9660ISO"$"); - -$IV,1$----05/19/16 02:16:09----$IV,0$ -* Added $LK,"BDT_ISO_FILE_WRITE",A="MN:BDT_ISO_FILE_WRITE"$. - -$IV,1$----05/17/16 07:16:38----$IV,0$ -* Worked on compiler $LK,"CICArg",A="MN:CICArg"$.a1_type_pointed_to. - -$IV,1$----05/13/16 14:35:14----$IV,0$ -* Improved $LK,"::/Demo/Games/Wenceslas.CPP"$. - -$IV,1$----05/12/16 05:18:56----$IV,0$ -* Added $LK,"CCF_CMD_LINE",A="MN:CCF_CMD_LINE"$ -* Replaced $FG,4$__DEPTH__$FG$ with $LK,"__CMD_LINE__",A="MN:__CMD_LINE__"$. - -$IV,1$----05/10/16 06:23:05----$IV,0$ -* Compiler bug fixes and optimizations. - -$IV,1$----05/07/16 08:55:59----$IV,0$ -* $BK,1$TempleOS version 4.06 Released$BK,0$ - -$IV,1$----05/03/16 19:26:45----$IV,0$ -* Made $LK,"FunSegFind",A="MN:FunSegFind"$() search all hash tables when $LK,"IsDbg",A="MN:IsDbg"$. -* Added missiles to $LK,"::/Apps/X-Caliber/X-Caliber.CPP"$. -* Fixed bug in $LK,"D3Unit",A="MN:D3Unit"$(). - -$IV,1$----05/01/16 15:12:31----$IV,0$ -* $LK,"R",A="MN:R"$("Identical","Ident"); -* $LK,"R",A="MN:R"$("Previous","Prev"); -* $LK,"R",A="MN:R"$("Result","Res"); -* Started assembler MMX/SSE. Not done. -* Changed a couple Bible related things. - -$IV,1$----04/26/16 01:18:57----$IV,0$ -* $LK,"R",A="MN:R"$("MapDrv","$LK,"DrvMap",A="MN:DrvMap"$"); - -$IV,1$----04/25/16 13:17:49----$IV,0$ -* Changed args in $LK,"CAdd",A="MN:CAdd"$(), $LK,"CSub",A="MN:CSub"$(), $LK,"CMul",A="MN:CMul"$(), $LK,"CDiv",A="MN:CDiv"$() and $LK,"CPoly",A="MN:CPoly"$(). -* Changed args in $LK,"D3Add",A="MN:D3Add"$(), $LK,"D3Sub",A="MN:D3Sub"$(), $LK,"D3Mul",A="MN:D3Mul"$(), $LK,"D3Div",A="MN:D3Div"$() and $LK,"D3Cross",A="MN:D3Cross"$(). - -$IV,1$----04/25/16 03:42:30----$IV,0$ -* $LK,"R",A="MN:R"$("TK_INT","TK_I64"); -* Added $LK,"::/Demo/Templates/Game1.CPP"$. -* Added $LK,"::/Demo/Templates/Lex1.CPP"$. -* Added $LK,"::/Demo/Templates/MultiCore1.CPP"$. -* Added $LK,"::/Demo/Templates/ODE1.CPP"$. -* Added $LK,"::/Demo/Templates/Registry1.CPP"$. -* Added $LK,"::/Demo/Templates/Util1.CPP"$. -* Added $LK,"::/Demo/Templates/Util2.CPP"$. - -$IV,1$----04/23/16 13:20:24----$IV,0$ -* Got rid of low protected memory area that caught NULL deref. -* Got rid of 4K page tables by making $LK,"text",A="MN:text"$.vga_alias. All pages are 2Meg size. - -$IV,1$----04/15/16 13:39:25----$IV,0$ -* Fixed bug in $LK,"EdCodeTools",A="MN:EdCodeTools"$(). -* Fixed double $FG,2$ASCII#5$FG$ cursor bug. - -$IV,1$----04/01/16 14:59:49----$IV,0$ -* Changed $LK,"SpriteInterpolate",A="MN:SpriteInterpolate"$() args. -* $LK,"R",A="MN:R"$("Index","Idx"); - -$IV,1$----03/31/16 11:20:13----$IV,0$ -* Changed $LK,"::/Adam/WallPaper.CPP"$. -* Got rid of $FG,4$CTask.time_slice_start$FG$ and $FG,4$CTask.total_time$FG$. - -$IV,1$----03/29/16 05:53:45----$IV,0$ -* $BK,1$TempleOS version 4.05 Released$BK,0$ - -$IV,1$----03/24/16 16:26:50----$IV,0$ -* Added $LK,"::/Demo/Games/CharDemo.CPP"$. - -$IV,1$----03/22/16 16:58:25----$IV,0$ -* Added $LK,"DOCEF_DFT_RAW_TYPE",A="MN:DOCEF_DFT_RAW_TYPE"$. Modified $LK,"DocForm",A="MN:DocForm"$() to look-up raw type automatically from the compiler's class information. -* Added $LK,"DOCEF_DFT_LEN",A="MN:DOCEF_DFT_LEN"$. Modified $LK,"DocForm",A="MN:DocForm"$() to look-up string length automatically from the compiler's class information. - -$IV,1$----03/21/16 07:28:35----$IV,0$ -* Added $LK,"OCF_ALIAS",A="MN:OCF_ALIAS"$. -* $LK,"R",A="MN:R"$("Integer","Int"); -* Added aliases to $LK,"::/Compiler/OpCodes.TXT"$. - -$IV,1$----03/21/16 02:12:08----$IV,0$ -* Added $LK,"DOCT_MARKER",A="MN:DOCT_MARKER"$. -* Added $LK,"CICType",A="MN:CICType"$. -* Optimized $LK,"MDG_MASK",A="MN:MDG_MASK"$ and $LK,"RTG_MASK",A="MN:RTG_MASK"$ values. - -$IV,1$----03/19/16 09:15:11----$IV,0$ -* Fixed bug in $LK,"EdFindReplace",A="MN:EdFindReplace"$(). - -$IV,1$----03/19/16 06:22:36----$IV,0$ -* Fixed $LK,"UAsm",A="MN:Ui"$() bug. -* Got rids of $FG,4$ICF_A1_FIRST$FG$. -* Cleaned-up compiler $LK,"REGG_CLOBBERED",A="MN:REGG_CLOBBERED"$ and $LK,"REGG_STK_TEMP",A="MN:REGG_STK_TEMP"$. - -$IV,1$----03/18/16 09:53:33----$IV,0$ -* Made $LK,"SpriteEd",A="MN:SpriteEd"$() sel foreground elem. - -$IV,1$----03/14/16 05:57:27----$IV,0$ -* $BK,1$TempleOS version 4.04 Released$BK,0$ -* Changed $FG,2$nobound_switch$FG$ so it uses []. -* Changed $LK,"KbdMouseCmdAck",A="MN:KbdMouseCmdAck"$(). - -$IV,1$----02/19/16 18:48:51----$IV,0$ -* Fixed bug in $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.CPP"$. - -$IV,1$----02/15/16 23:31:15----$IV,0$ -* Improved $LK,"::/Demo/Games/RawHide.CPP"$. - -$IV,1$----02/13/16 17:02:34----$IV,0$ -* Added $FG,2$$$CL+H$$$FG$ to clear all, including hold entries. - -$IV,1$----02/10/16 08:56:49----$IV,0$ -* Improved $FG,2$$FG$ prompting. - -$IV,1$----02/09/16 23:54:23----$IV,0$ -* Created $LK,"DOCEF_LEN",A="MN:DOCEF_LEN"$ with arg. $LK,"DOCT_DATA",A="MN:DOCT_DATA"$ has default 64 len. - -$IV,1$----02/09/16 09:34:32----$IV,0$ -* $BK,1$TempleOS version 4.03 Released$BK,0$ -* Added $LK,"DOCEF_REMALLOC_DATA",A="MN:DOCEF_REMALLOC_DATA"$. - -$IV,1$----02/05/16 23:00:53----$IV,0$ -* Moved $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.CPP"$. -* Added $LK,"::/Demo/AcctExample/TOSToHtml.CPP"$. - -$IV,1$----02/03/16 18:47:00----$IV,0$ -* Refactored $LK,"SpriteMainEd",A="MN:SpriteMainEd"$(). -* Added tag edit to main sprite edit menu. - -$IV,1$----02/01/16 21:01:15----$IV,0$ -* Cleaned-up $LK,"TaskKillDying",A="MN:TaskKillDying"$(). -* Made multicore more professional. - -$IV,1$----02/01/16 06:02:41----$IV,0$ -* Moved $LK,"Mem2Meg.CPP",A="FI:::/Demo/Lectures/Mem/Mem2Meg.CPP"$ out of kernel. - -$IV,1$----01/31/16 04:07:50----$IV,0$ -* Fixed scheduler, so doesn't idle so high. -* Fixed many memory leaks. -* Changed args to $LK,"Mem512Alloc",A="MN:Mem512Alloc"$(), $LK,"Mem512Free",A="MN:Mem512Free"$(), and $LK,"Mem512TaskAlloc",A="MN:Mem512TaskAlloc"$(). - -$IV,1$----01/30/16 11:14:29----$IV,0$ -* Changed arg in $LK,"DocEntryNewTag",A="MN:DocEntryNewTag"$(). -* Added $LK,"DocEntryNewBase",A="MN:DocEntryNewBase"$(). - -$IV,1$----01/29/16 02:44:38----$IV,0$ -* Overhauled $LK,"DocSave",A="MN:DocSave"$() and $LK,"DocRecalc",A="MN:DocRecalc"$(). - -$IV,1$----01/28/16 20:45:35----$IV,0$ -* Fixed bug in locate sprite elem code. -* Overhauled $FG,2$$FG$ sprite editor. -* Added $LK,"DocHighlightCursor",A="MN:DocHighlightCursor"$() and $LK,"DOCf_DONT_HIGHLIGHT_CURSOR",A="MN:DOCf_DONT_HIGHLIGHT_CURSOR"$. - -$IV,1$----01/28/16 14:05:52----$IV,0$ -* Fixed bug in $LK,"AutoComplete",A="MN:AutoComplete"$() init. -* Added $LK,"HeapLogSizeRep",A="MN:HeapLogSizeRep"$(). - -$IV,1$----01/27/16 20:41:54----$IV,0$ -* $BK,1$TempleOS version 4.02 Released$BK,0$ - -$IV,1$----01/27/16 06:40:46----$IV,0$ -* Added $FG,2$$FG$ macro to $LK,"TestSuite",A="FI:::/Misc/OSTestSuite.CPP"$. -* Added compiler err for $FG,2$break;$FG$ in a subswitch preface. - -$IV,1$----01/27/16 04:14:08----$IV,0$ -* Added $LK,"::/Demo/ToHtmlToTXTDemo/HtmlGen.CPP"$ and $LK,"::/Demo/ToHtmlToTXTDemo/TXTGen.CPP"$. -* Now, $LK,"Plain",A="MN:Plain"$() doesn't save with $LK,"CH_CURSOR",A="MN:CH_CURSOR"$. -* $LK,"R",A="MN:R"$("DOCF_PLAIN_TEXT_WITH_TABS","DOCF_PLAIN_TEXT_TABS"); -* Change $LK,"Document Links",A="FF:::/Adam/DolDoc/DocLink.CPP,AD"$ "DF:word" to "DN:word". -* Merged documentation into $LK,"::/Doc/FAQ.TXT"$. - -$IV,1$----01/26/16 17:51:45----$IV,0$ -* $LK,"R",A="MN:R"$("PSect","FunSeg"); -* $LK,"R",A="MN:R"$("Equal","Equ"); -* $LK,"R",A="MN:R"$("Binary","Bin"); - -$IV,1$----01/26/16 14:09:45----$IV,0$ -* Changed $LK,"DirContextNew",A="MN:DirContextNew"$(), $LK,"FilesFindMatch",A="MN:FilesFindMatch"$() and $LK,"FilesFind",A="MN:FilesFind"$() to use full_name. -* $LK,"R",A="MN:R"$("Statement","Stmt"); - -$IV,1$----01/18/16 15:19:43----$IV,0$ -* Added except arg to $LK,"Let2BlkDev",A="MN:Let2BlkDev"$(), $LK,"BlkDevChk",A="MN:BlkDevChk"$(), $LK,"Let2Drv",A="MN:Let2Drv"$(), $LK,"DrvChk",A="MN:DrvChk"$() and $LK,"DrvIsWritable",A="MN:DrvIsWritable"$(). - -$IV,1$----01/16/16 08:20:00----$IV,0$ -* Added $LK,"DrvTextAttrGet",A="MN:DrvTextAttrGet"$(). -* Removed $FG,4$DrvTextAttrSet$FG$(). - -$IV,1$----01/15/16 00:47:31----$IV,0$ -* $LK,"KeyboardPlug-Ins '9','0'",A="FF:::/HomeKeyPlugIns.CPP,'9'"$. -* $LK,"R",A="MN:R"$("$$$$LM,5$$$$","$$$$ID,5$$$$"); - -$IV,1$----01/15/16 00:12:02----$IV,0$ -* Added $LK,"Let2BlkDevType",A="MN:Let2BlkDevType"$(). -* Added $LK,"WIF_SELF_FOCUS",A="MN:WIF_SELF_FOCUS"$ to $LK,"::/Misc/OSInstall.CPP"$. -* Added $FG,2$%$$F$FG$ to $LK,"Print(\"\") Fmt Strings",A="FI:::/Doc/Print.TXT"$. - -$IV,1$----01/12/16 19:17:12----$IV,0$ -* Overhauled $LK,"Mount",A="MN:Mount"$() and $LK,"::/Kernel/KCfg.CPP"$. - -$IV,1$----01/12/16 10:06:18----$IV,0$ -* $BK,1$TempleOS version 4.01 Released$BK,0$ -* Standardized drive letters. Your $LK,"Auto",A="MN:Auto"$() config scripts for compiling the kernel with $LK,"BootHDIns",A="MN:BootHDIns"$() must be changed. -* Added $LK,"CCF_QUESTION_HELP",A="MN:CCF_QUESTION_HELP"$. - -$IV,1$----01/11/16 00:04:38----$IV,0$ -* $LK,"R",A="MN:R"$("PAGE_SIZE","MEM_PAGE_SIZE"); etc. -* $LK,"R",A="MN:R"$("DFT_STK","MEM_DFT_STK"); etc. -* Added $LK,"::/Demo/MemDemo.CPP"$. - -$IV,1$----01/08/16 17:04:58----$IV,0$ -* Added $LK,"FUF_RISKY",A="MN:FUF_RISKY"$ to $LK,"DocOpt",A="MN:DocOpt"$(). -* Fixed $LK,"::/Doc/CompilerOverview.TXT"$. - -$IV,1$----01/06/16 11:01:57----$IV,0$ -* Got rid of $FG,4$DOCEF_HARD_SKIP$FG$. - -$IV,1$----01/03/16 17:15:41----$IV,0$ -* Updated $LK,"::/Misc/PCIDevices.TXT"$. -* Added null case option. Next higher int with "$FG,2$case:$FG$" in $FG,2$switch$FG$ stmts. See $LK,"::/Demo/NullCase.CPP"$. diff --git a/Doc/CharOverview.DD b/Doc/CharOverview.DD new file mode 100644 index 0000000..8b7a5d5 --- /dev/null +++ b/Doc/CharOverview.DD @@ -0,0 +1,27 @@ +$WW,1$$FG,5$$TX+CX,"Char Overview"$$FG$ + +A $FG,2$Char$FG$acter is a single byte holding an ASCII code for a letter, num or sym. The $FG,2$TempleOS$FG$ term is a $FG,2$U8$FG$. + +Standard ASCII values range from 0 to 127. Values below 32 are ctrl key's. So, an ASCII #3 is a $FG,2$$FG$. TempleOS uses a few nonstandard values below 32. See $LK,"Char Definitions",A="MN:CH_SHIFT_SPACE"$. + +ASCII #5 is the cursor location in a saved file. +ASCII #28 is $FG,2$$FG$. +ASCII #31 is a $FG,2$$FG$. + +TempleOS ASCII is 8-bit instead of 7-bit, so it also uses the range from 128-255. Press $FG,2$$FG$ to see shapes for 128-255. Technically, $FG,2$$FG$ are $LK,"screen codes",A="HI:TextBase Layer"$. + +A $FG,2$Key$FG$ is typically specified with a scan code. TempleOS scan codes contain the key value in the lowest $FG,2$U8$FG$, and flags in the upper 3 bytes. See $LK,"Scan Code Flags",A="MN:SCF_CTRL"$ and $LK,"Scan Codes",A="MN:SC_INS"$. + +TempleOS stores scan codes in 8 bytes. + $FG,2$Byte 0$FG$ is the code. NumPad keys, SHIFT, ALT, CTRL and GUI keys combined. + $FG,2$Byte 1-3$FG$ are $LK,"flags",A="MN:SCf_KEY_UP"$ + +The upper 4-bytes are copied from lower 4-bytes. + $FG,2$Byte 4$FG$ is the code. Left, Right and NumPad keys distinct. + $FG,2$Byte 5-7$FG$ are $LK,"flags",A="MN:SCf_KEY_UP"$ + +Run the program $LK,"::/Demo/MsgLoop.HC"$ to examine scan code. Press $FG,2$$FG$ and "Insert ASCII/ScanCode".$FG$ + +See $LK,"Key Allocations",A="FI:::/Doc/KeyAlloc.DD"$ and $LK,"CKbdStateGlbls",A="MN:CKbdStateGlbls"$. + +A $FG,2$String$FG$ is a bunch of ASCII characters terminated with a zero. diff --git a/Doc/CharOverview.TXT b/Doc/CharOverview.TXT deleted file mode 100644 index 931cd18..0000000 --- a/Doc/CharOverview.TXT +++ /dev/null @@ -1,27 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"Char Overview"$$FG$ - -A $FG,2$Char$FG$acter is a single byte holding an ASCII code for a letter, num or sym. The $FG,2$TempleOS$FG$ term is a $FG,2$U8$FG$. - -Standard ASCII values range from 0 to 127. Values below 32 are ctrl key's. So, an ASCII #3 is a $FG,2$$FG$. TempleOS uses a few nonstandard values below 32. See $LK,"Char Definitions",A="MN:CH_SHIFT_SPACE"$. - -ASCII #5 is the cursor location in a saved file. -ASCII #28 is $FG,2$$FG$. -ASCII #31 is a $FG,2$$FG$. - -TempleOS ASCII is 8-bit instead of 7-bit, so it also uses the range from 128-255. Press $FG,2$$FG$ to see shapes for 128-255. Technically, $FG,2$$FG$ are $LK,"screen codes",A="HI:TextBase Layer"$. - -A $FG,2$Key$FG$ is typically specified with a scan code. TempleOS scan codes contain the key value in the lowest $FG,2$U8$FG$, and flags in the upper 3 bytes. See $LK,"Scan Code Flags",A="MN:SCF_CTRL"$ and $LK,"Scan Codes",A="MN:SC_INS"$. - -TempleOS stores scan codes in 8 bytes. - $FG,2$Byte 0$FG$ is the code. NumPad keys, SHIFT, ALT, CTRL and GUI keys combined. - $FG,2$Byte 1-3$FG$ are $LK,"flags",A="MN:SCf_KEY_UP"$ - -The upper 4-bytes are copied from lower 4-bytes. - $FG,2$Byte 4$FG$ is the code. Left, Right and NumPad keys distinct. - $FG,2$Byte 5-7$FG$ are $LK,"flags",A="MN:SCf_KEY_UP"$ - -Run the program $LK,"::/Demo/MsgLoop.CPP"$ to examine scan code. Press $FG,2$$FG$ and "Insert ASCII/ScanCode".$FG$ - -See $LK,"Key Allocations",A="FI:::/Doc/KeyAlloc.TXT"$ and $LK,"CKbdStateGlbls",A="MN:CKbdStateGlbls"$. - -A $FG,2$String$FG$ is a bunch of ASCII characters terminated with a zero. diff --git a/Doc/Charter.TXT b/Doc/Charter.DD similarity index 100% rename from Doc/Charter.TXT rename to Doc/Charter.DD diff --git a/Doc/CmdLineOverview.DD b/Doc/CmdLineOverview.DD new file mode 100644 index 0000000..bcdba02 --- /dev/null +++ b/Doc/CmdLineOverview.DD @@ -0,0 +1,42 @@ +$WW,1$$FG,5$$TX+CX,"Command Line Overview"$$FG$ + +The cmd line feeds into the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ compiler as you type. A stmt outside a function executes immediately. Remember to add a semicolon.$WW,1$ + +Look-up the function headers with $FG,2$AutoComplete$FG$ by hitting $FG,2$$FG$ after typing the first few letters. + +$LK,"Click Here",A="MN:Dir"$ to see the directory cmd header. It accepts default args from C++. + +>$FG,2$Dir("*.DD.Z");$FG$ + +If you don't have args, you don't need parenthesis. + +>$FG,2$Dir;$FG$ + +Directories are referenced with $FG,2$/$FG$ not $FG,2$\$FG$. There is a current directory, but not a path. To run a program, you typically $FG,2$#include $FG$it. There are several shortcuts for $FG,2$#include$FG$ing files. Right-click or hit $FG,2$$FG$ on a directory listing or press $FG,2$$FG$ while editing. + +>$FG,2$Ed("NewFile.HC.Z");$FG$ Invokes the editor. See $LK,"Doc Link Type",A="MN:LK_FILE"$. + +Most filenames end in $FG,2$.Z$FG$ because they are stored compressed. + +Drives are specified with a letter. The boot drive is specified with a '$FG,2$:$FG$'. The home dir drive is specified with a $FG,2$'~'$FG$. + +>$FG,2$Drv('B');$FG$ B drive + +The drive can be specified in a $LK,"Cd",A="MN:Cd"$() command as in: + +>$FG,2$Cd("B:/Temp");$FG$ B drive +>$FG,2$Cd("::/Demo");$FG$ Boot drive + +The home directory is specified with a $FG,2$'~'$FG$. + +>$FG,2$Cd("~/Psalmody");$FG$ See $LK,"::/Home dir",A="FF:::/Doc/GuideLines.DD,/Home Files"$. + +If a file is not found, $FG,2$.Z$FG$ is added or removed and a search is done, again. If a file is still not found, all parent directories are searched. + +You can place macros in your $LK,"PersonalMenu",A="FI:~/PersonalMenu.DD"$ for $LK,"Cd",A="MN:Cd"$() commands. $FG,2$$FG$ to access your menu. + +>$FG,2$Find("needle","/Demo/*.HC.Z;*.DD.Z;");$FG$ See $LK,"File Utils",A="FI:::/Doc/FileUtils.DD"$. + +$LK,"Cmd Line Routines",A="HI:Cmd Line (Typically)"$ + +$MA-X+PU,"Take Tour",LM="User(\"Cd(\\\"::/Misc/Tour\\\");;AutoFile(\\\"Tour\\\");\n\");"$ diff --git a/Doc/CmdLineOverview.TXT b/Doc/CmdLineOverview.TXT deleted file mode 100644 index c8e3c53..0000000 --- a/Doc/CmdLineOverview.TXT +++ /dev/null @@ -1,42 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"Command Line Overview"$$FG$ - -The cmd line feeds into the $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ compiler as you type. A stmt outside a function executes immediately. Remember to add a semicolon.$WW,1$ - -Look-up the function headers with $FG,2$AutoComplete$FG$ by hitting $FG,2$$FG$ after typing the first few letters. - -$LK,"Click Here",A="MN:Dir"$ to see the directory cmd header. It accepts default args from C++. - ->$FG,2$Dir("*.TXT.Z");$FG$ - -If you don't have args, you don't need parenthesis. - ->$FG,2$Dir;$FG$ - -Directories are referenced with $FG,2$/$FG$ not $FG,2$\$FG$. There is a current directory, but not a path. To run a program, you typically $FG,2$#include $FG$it. There are several shortcuts for $FG,2$#include$FG$ing files. Right-click or hit $FG,2$$FG$ on a directory listing or press $FG,2$$FG$ while editing. - ->$FG,2$Ed("NewFile.CPP.Z");$FG$ Invokes the editor. See $LK,"Doc Link Type",A="MN:LK_FILE"$. - -Most filenames end in $FG,2$.Z$FG$ because they are stored compressed. - -Drives are specified with a letter. The boot drive is specified with a '$FG,2$:$FG$'. The home dir drive is specified with a $FG,2$'~'$FG$. - ->$FG,2$Drv('B');$FG$ B drive - -The drive can be specified in a $LK,"Cd",A="MN:Cd"$() command as in: - ->$FG,2$Cd("B:/Temp");$FG$ B drive ->$FG,2$Cd("::/Demo");$FG$ Boot drive - -The home directory is specified with a $FG,2$'~'$FG$. - ->$FG,2$Cd("~/Psalmody");$FG$ See $LK,"::/Home dir",A="FF:::/Doc/GuideLines.TXT,/Home Files"$. - -If a file is not found, $FG,2$.Z$FG$ is added or removed and a search is done, again. If a file is still not found, all parent directories are searched. - -You can place macros in your $LK,"PersonalMenu",A="FI:~/PersonalMenu.TXT"$ for $LK,"Cd",A="MN:Cd"$() commands. $FG,2$$FG$ to access your menu. - ->$FG,2$Find("needle","/Demo/*.CPP.Z;*.TXT.Z;");$FG$ See $LK,"File Utils",A="FI:::/Doc/FileUtils.TXT"$. - -$LK,"Cmd Line Routines",A="HI:Cmd Line (Typically)"$ - -$MA-X+PU,"Take Tour",LM="User(\"Cd(\\\"::/Misc/Tour\\\");;AutoFile(\\\"Tour\\\");\n\");"$ diff --git a/Doc/Comm.CPP b/Doc/Comm.CPP deleted file mode 100644 index 2fb0ab2..0000000 --- a/Doc/Comm.CPP +++ /dev/null @@ -1,116 +0,0 @@ -/* RS232 serial ports no longer exist. -Be sure to Adam Include this by placing -it in your start-up scripts. -*/ - -#help_index "Comm" - -#define COM1_BASE 0x3F8 -#define COM2_BASE 0x2F8 -#define COM3_BASE 0x3E8 -#define COM4_BASE 0x2E8 - -#define UART_THR 0 -#define UART_RDR 0 -#define UART_BRDL 0 -#define UART_IER 1 -#define UART_BRDH 1 -#define UART_IIR 2 -#define UART_LCR 3 -#define UART_MCR 4 -#define UART_LSR 5 -#define UART_MSR 6 - -I64 comm_base[5]={0,0x3F8,0x2F8,0x3E8,0x2E8}; - -CFifoU8 *comm_fifos[5]={NULL,NULL,NULL,NULL,NULL}; - -interrupt U0 IRQComm3() -{ - I64 base=comm_base[2]; - if (comm_fifos[2] && (InU8(base+UART_IIR) & 0xFE)==4) //RX IRQ - FifoU8Ins(comm_fifos[2],InU8(base+UART_RDR)); - - base=comm_base[4]; - if (comm_fifos[4] && (InU8(base+UART_IIR) & 0xFE)==4) //RX IRQ - FifoU8Ins(comm_fifos[4],InU8(base+UART_RDR)); - OutU8(0x20,0x20); -} - -interrupt U0 IRQComm4() -{ - I64 base=comm_base[1]; - if (comm_fifos[1] && (InU8(base+UART_IIR) & 0xFE)==4) //RX IRQ - FifoU8Ins(comm_fifos[1],InU8(base+UART_RDR)); - - base=comm_base[3]; - if (comm_fifos[3] && (InU8(base+UART_IIR) & 0xFE)==4) //RX IRQ - FifoU8Ins(comm_fifos[3],InU8(base+UART_RDR)); - OutU8(0x20,0x20); -} - -IntEntrySet(0x23,&IRQComm3); -IntEntrySet(0x24,&IRQComm4); - -public U0 CommInit8n1(I64 port,I64 baud) -{ - I64 base=comm_base[port]; - - PUSHFD - CLI - if (comm_fifos[port]) - FifoU8Del(comm_fifos[port]); - comm_fifos[port]=FifoU8New(256); - OutU8(base+UART_LCR,0); //Set for IER - OutU8(base+UART_IER,0); //DIsable all IRQ - OutU8(base+UART_LCR,0x80); //Enable baud rate control - OutU8(base+UART_BRDL,(0x180/(baud/300)) & 0xFF); //LSB - OutU8(base+UART_BRDH,(0x180/(baud/300)) / 256); //MSB - OutU8(base+UART_LCR,3); // 8-none-1 - - InU8(base+UART_RDR); //read garbage - InU8(base+UART_LSR); - - OutU8(base+UART_MCR,4); - OutU8(base+UART_IER,0); //DIsable all IRQ - OutU8(base+UART_MCR,0xA); //out2 and rts - OutU8(0x21,InU8(0x21) & (0xFF-0x18)); //Enable 8259 IRQ 3 & 4 - OutU8(base+UART_IER,1); //Enable RX IRQ - POPFD -} - -public U0 CommBusyPutChar(I64 port,U8 b) -{ - I64 base=comm_base[port]; - while (!(InU8(base+UART_LSR) & 0x20)) - Yield; - OutU8(base+UART_THR,b); - while (!(InU8(base+UART_LSR) & 0x20)) - Yield; -} - -public U0 CommBusyPutS(I64 port,U8 *st) -{ - I64 b,base=comm_base[port]; - while (b=*(st++)) { - while (!(InU8(base+UART_LSR) & 0x20)) - Yield; - OutU8(base+UART_THR,b); - } - while (!(InU8(base+UART_LSR) & 0x20)) - Yield; -} - -public U0 CommBusyWriteBlk(I64 port,U8 *buf,I64 count) -{ - I64 base=comm_base[port]; - while (count--) { - while (!(InU8(base+UART_LSR) & 0x20)) - Yield; - OutU8(base+UART_THR,*(buf++)); - } - while (!(InU8(base+UART_LSR) & 0x20)) - Yield; -} - -#help_index "" diff --git a/Doc/Comm.HC b/Doc/Comm.HC new file mode 100644 index 0000000..e33126b --- /dev/null +++ b/Doc/Comm.HC @@ -0,0 +1,116 @@ +/* RS232 serial ports no longer exist. +Be sure to Adam Include this by placing +it in your start-up scripts. +*/ + +#help_index "Comm" + +#define COM1_BASE 0x3F8 +#define COM2_BASE 0x2F8 +#define COM3_BASE 0x3E8 +#define COM4_BASE 0x2E8 + +#define UART_THR 0 +#define UART_RDR 0 +#define UART_BRDL 0 +#define UART_IER 1 +#define UART_BRDH 1 +#define UART_IIR 2 +#define UART_LCR 3 +#define UART_MCR 4 +#define UART_LSR 5 +#define UART_MSR 6 + +I64 comm_base[5]={0,0x3F8,0x2F8,0x3E8,0x2E8}; + +CFifoU8 *comm_fifos[5]={NULL,NULL,NULL,NULL,NULL}; + +interrupt U0 IRQComm3() +{ + I64 base=comm_base[2]; + if (comm_fifos[2] && (InU8(base+UART_IIR) & 0xFE)==4) //RX IRQ + FifoU8Ins(comm_fifos[2],InU8(base+UART_RDR)); + + base=comm_base[4]; + if (comm_fifos[4] && (InU8(base+UART_IIR) & 0xFE)==4) //RX IRQ + FifoU8Ins(comm_fifos[4],InU8(base+UART_RDR)); + OutU8(0x20,0x20); +} + +interrupt U0 IRQComm4() +{ + I64 base=comm_base[1]; + if (comm_fifos[1] && (InU8(base+UART_IIR) & 0xFE)==4) //RX IRQ + FifoU8Ins(comm_fifos[1],InU8(base+UART_RDR)); + + base=comm_base[3]; + if (comm_fifos[3] && (InU8(base+UART_IIR) & 0xFE)==4) //RX IRQ + FifoU8Ins(comm_fifos[3],InU8(base+UART_RDR)); + OutU8(0x20,0x20); +} + +IntEntrySet(0x23,&IRQComm3); +IntEntrySet(0x24,&IRQComm4); + +public U0 CommInit8n1(I64 port,I64 baud) +{ + I64 base=comm_base[port]; + + PUSHFD + CLI + if (comm_fifos[port]) + FifoU8Del(comm_fifos[port]); + comm_fifos[port]=FifoU8New(256); + OutU8(base+UART_LCR,0); //Set for IER + OutU8(base+UART_IER,0); //Disable all IRQ + OutU8(base+UART_LCR,0x80); //Enable baud rate control + OutU8(base+UART_BRDL,(0x180/(baud/300)) & 0xFF); //LSB + OutU8(base+UART_BRDH,(0x180/(baud/300)) / 256); //MSB + OutU8(base+UART_LCR,3); // 8-none-1 + + InU8(base+UART_RDR); //read garbage + InU8(base+UART_LSR); + + OutU8(base+UART_MCR,4); + OutU8(base+UART_IER,0); //Disable all IRQ + OutU8(base+UART_MCR,0xA); //out2 and rts + OutU8(0x21,InU8(0x21) & (0xFF-0x18)); //Enable 8259 IRQ 3 & 4 + OutU8(base+UART_IER,1); //Enable RX IRQ + POPFD +} + +public U0 CommBusyPutChar(I64 port,U8 b) +{ + I64 base=comm_base[port]; + while (!(InU8(base+UART_LSR) & 0x20)) + Yield; + OutU8(base+UART_THR,b); + while (!(InU8(base+UART_LSR) & 0x20)) + Yield; +} + +public U0 CommBusyPutS(I64 port,U8 *st) +{ + I64 b,base=comm_base[port]; + while (b=*(st++)) { + while (!(InU8(base+UART_LSR) & 0x20)) + Yield; + OutU8(base+UART_THR,b); + } + while (!(InU8(base+UART_LSR) & 0x20)) + Yield; +} + +public U0 CommBusyWriteBlk(I64 port,U8 *buf,I64 count) +{ + I64 base=comm_base[port]; + while (count--) { + while (!(InU8(base+UART_LSR) & 0x20)) + Yield; + OutU8(base+UART_THR,*(buf++)); + } + while (!(InU8(base+UART_LSR) & 0x20)) + Yield; +} + +#help_index "" diff --git a/Doc/CompilerOverview.DD b/Doc/CompilerOverview.DD new file mode 100644 index 0000000..7870214 --- /dev/null +++ b/Doc/CompilerOverview.DD @@ -0,0 +1,13 @@ +$WW,1$$FG,5$$TX+CX,"Compiler Index"$$FG$ + +$LK,"::/Doc/Asm.DD"$ + +$LK,"::/Doc/Directives.DD"$ + +$LK,"::/Doc/Options.DD"$ + +$LK,"::/Doc/PreProcessor.DD"$ + +$LK,"::/Doc/ScopingLinkage.DD"$ + +See $LK,"Hello World",A="FI:::/Doc/HelloWorld.DD"$. diff --git a/Doc/CompilerOverview.TXT b/Doc/CompilerOverview.TXT deleted file mode 100644 index 68c1050..0000000 --- a/Doc/CompilerOverview.TXT +++ /dev/null @@ -1,13 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"Compiler Index"$$FG$ - -$LK,"::/Doc/Asm.TXT"$ - -$LK,"::/Doc/Directives.TXT"$ - -$LK,"::/Doc/Options.TXT"$ - -$LK,"::/Doc/PreProcessor.TXT"$ - -$LK,"::/Doc/ScopingLinkage.TXT"$ - -See $LK,"Hello World",A="FI:::/Doc/HelloWorld.TXT"$. diff --git a/Doc/Credits.DD b/Doc/Credits.DD new file mode 100644 index 0000000..03c24f2 --- /dev/null +++ b/Doc/Credits.DD @@ -0,0 +1,61 @@ +$WW,1$$FG,5$$TX+CX,"Credits"$$FG$ + +I, $FG,2$Terry A. Davis$FG$, wrote all $TX,"120,264",D="DD_TEMPLEOS_LOC"$ lines of TempleOS over the past $TX,"13.1",D="DD_TEMPLEOS_AGE"$ years (full-time). It can run on some bare metal 64-bit PC's from about 2005-2010 with no layering, libraries, tools, modules or anything from other sources. Otherwise, you run it in a virtual machine, like $FG,2$VMware$FG$, $FG,2$QEMU$FG$ or $FG,2$VirtualBox$FG$. It is independent and stands alone. It has no networking, so it certainly doesn't call home. 100% of the src code is including on all distro's, from the kernel to the compiler to the boot loaders! It is public domain, not GPL. + +*) $LK,"::/Kernel/FontStd.HC"$, is taken from $FG,4$$TX,"FreeDOS",HTML="http://www.freedos.org"$$FG$. It's public domain. + +*) $LK,"::/Kernel/FontCyrillic.HC"$, is taken from $FG,4$$TX,"OrientDisplay",HTML="http://www.orientdisplay.com/images/cyrillic-Russian-fonts.gif"$$FG$ without permission. + +*) $LK,"ATA Reg and Cmd Definitions",A="MN:ATA_NOP"$ are originally from Linux. Later, I got the spec. + +*) The heap algorithm, $LK,"::/Kernel/Mem/MAllocFree.HC"$, is adapted from one I saw at Ticketmaster when I worked on their VAX operating system. + +*) The LZW compression algorithm, $LK,"::/Kernel/Compress.HC"$, came from a magazine and I implemented it when I worked for Ticketmaster. + +*) The adaptive-step-size-Runge-Kutta algorithm, $LK,"::/Adam/AMathODE.HC"$, is adapted from the book, $UL,1$Numeric Recipies in C$UL,0$. + +*) The mountain, palm trees, sheep and goats in AfterEgypt are from $FG,4$$TX,"http://www.public-domain-photos.com",HTML="http://www.public-domain-photos.com"$$FG$. The wolf in BlackDiamond is also from there. I took watermarked photos and converted to 16 color. + +*) The $FG,2$FAT32$FG$ file system is owned by MicroSoft. + +*) A few features were inspired by $FG,2$MATLAB$FG$, such as $FG,2$ans$FG$ in expressions at the command-line. There is a lot of $FG,2$MSDOS$FG$ , $FG,2$Windows$FG$, $FG,2$VAXTMOS$FG$ (VAX Ticketmaster O.S.) and $FG,2$Unix$FG$ inspiration, too, such as drive letters, command names, etc. + +*) I included $LK,"PCIDevice Lst File",A="FI:::/Misc/PCIDevices.DD",HTML="http://www.pcidatabase.com/reports.php?type=tab-delimeted"$. + +*) Thanks to whoever wrote this $FG,4$$TX,"CppHtml.HC.Z",HTML="http://web.archive.org/web/20100325153025/http://home.scarlet.be/zoetrope/cpphtml.htm"$$FG$. I'm a novice on web stuff and you helped me with html. See $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$. + +*) I used $FG,4$$TX,"MagicISO",HTML="http://www.magiciso.com"$$FG$ to burn test CD's to help me understand the ISO9660 file system format. I mostly used the $FG,4$$TX,"ISO9660",HTML="http://users.telenet.be/it3.consultants.bvba/handouts/ISO9960.html"$$FG$ spec. + +*) I looked at bootable CD boot sects, but didn't learn anything, finding it easier to make my own. + +*) I think I got my original PC speaker code from $FG,2$Borland C$FG$. + +*) I found PS/2 keyboard and mouse code on the net and documentation. My code is very different. I found VGA reg info on the net. + +*) Thanks to $FG,4$$TX,"http://www.osdev.org",HTML="http://www.osdev.org"$$FG$ for a couple tips. + +*) God told me to stick with 640x480 16 color, a single audio voice and kept me from zombie-walking into making child windows like $FG,2$Windows$FG$. Instead, I made one window per task with no child windows. He also guided my progress, very obviously. + +*) I got $FG,4$$TX,"Webster's Dictionary",HTML="http://www.templeos.org/files/DICTIONARY.DD"$$FG$ and $FG,4$$TX,"The King James Bible",HTML="http://www.templeos.org/files/BIBLE.DD"$$FG$ from $FG,4$$TX,"Project Gutenberg",HTML="http://web.archive.org/web/20110730111436/http://promo.net/pg/"$$FG$. + +*) John Carmack inspired me to use "$LK,"Clamp",A="MN:Clamp"$" as a name instead of "Limit". He inspired me to use "needle" and "haystack" as names. He inspired me to simplify my Frames-Per-Second code. + +*) Bill Gates inspired me to add comments to my $LK,"Help & Index",A="FI:::/Doc/HelpIndex.DD"$. + +*) I hired an artist, Cody Rigby, for $$3,000 worth of pixel art. + +*) Erik van der Karbargenbok wrote /Linux shell scripts -- GodPassage, GodWords. + +*) The random number generator is from Donald Knuth in the wikipedia entry for $TX,"Linear_congruential_generator",HTML="http://en.wikipedia.org/wiki/Linear_congruential_generator"$. + +$FG,8$ +* "MSDOS", "Windows", "MovieMaker", "MS Paint" and "FAT32" are trademarks owned by MicroSoft Corp. +* "SiteBuilder" is a trademark owned by Yahoo! Inc. +* "MagicISO" is a trademark owned by MagicISO Corp. +* "MATLAB" is a trademark owned by The Math Works, Inc. +* "$TX,"FreeDOS",HTML="http://www.freedos.org"$" is a trademark owned by Jim Hall. +* "QEMU" is a trademark owned by Fabrice Bellard. +* "VAX" is a trademark owned by Digital Equipment Corp. +* "Linux" is a trademark owned by Linus Torvalds. +* "VAXTMOS" is a trademark owned by Ticketmaster. +$FG$ \ No newline at end of file diff --git a/Doc/Credits.TXT b/Doc/Credits.TXT deleted file mode 100644 index 0adfc5b..0000000 --- a/Doc/Credits.TXT +++ /dev/null @@ -1,61 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"Credits"$$FG$ - -I, $FG,2$Terry A. Davis$FG$, wrote all $TX,"121,193",D="DD_TEMPLEOS_LOC"$ lines of TempleOS over the past $TX,"12.9",D="DD_TEMPLEOS_AGE"$ years (full-time). It can run on some bare metal 64-bit PC's from about 2005-2010 with no layering, libraries, tools, modules or anything from other sources. Otherwise, you run it in a virtual machine, like $FG,2$VMware$FG$, $FG,2$QEMU$FG$ or $FG,2$VirtualBox$FG$. It is independent and stands alone. It has no networking, so it certainly doesn't call home. 100% of the src code is including on all distro's, from the kernel to the compiler to the boot loaders! It is public domain, not GPL. - -*) $LK,"::/Kernel/FontStd.CPP"$, is taken from $FG,4$$TX,"FreeDOS",HTML="http://www.freedos.org"$$FG$. It's public domain. - -*) $LK,"::/Kernel/FontCyrillic.CPP"$, is taken from $FG,4$$TX,"OrientDisplay",HTML="http://www.orientdisplay.com/images/cyrillic-Russian-fonts.gif"$$FG$ without permission. - -*) $LK,"ATA Reg and Cmd Definitions",A="MN:ATA_NOP"$ are originally from Linux. Later, I got the spec. - -*) The heap algorithm, $LK,"::/Kernel/Mem/MAllocFree.CPP"$, is adapted from one I saw at Ticketmaster when I worked on their VAX operating system. - -*) The LZW compression algorithm, $LK,"::/Kernel/Compress.CPP"$, came from a magazine and I implemented it when I worked for Ticketmaster. - -*) The adaptive-step-size-Runge-Kutta algorithm, $LK,"::/Adam/AMathODE.CPP"$, is adapted from the book, $UL,1$Numeric Recipies in C$UL,0$. - -*) The mountain, palm trees, sheep and goats in AfterEgypt are from $FG,4$$TX,"http://www.public-domain-photos.com",HTML="http://www.public-domain-photos.com"$$FG$. The wolf in BlackDiamond is also from there. I took watermarked photos and converted to 16 color. - -*) The $FG,2$FAT32$FG$ file system is owned by MicroSoft. - -*) A few features were inspired by $FG,2$MATLAB$FG$, such as $FG,2$ans$FG$ in expressions at the command-line. There is a lot of $FG,2$MSDOS$FG$ , $FG,2$Windows$FG$, $FG,2$VAXTMOS$FG$ (VAX Ticketmaster O.S.) and $FG,2$Unix$FG$ inspiration, too, such as drive letters, command names, etc. - -*) I included $LK,"PCIDevice Lst File",A="FI:::/Misc/PCIDevices.TXT",HTML="http://www.pcidatabase.com/reports.php?type=tab-delimeted"$. - -*) Thanks to whoever wrote this $FG,4$$TX,"CppHtml.CPP.Z",HTML="http://web.archive.org/web/20100325153025/http://home.scarlet.be/zoetrope/cpphtml.htm"$$FG$. I'm a novice on web stuff and you helped me with html. See $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.CPP"$. - -*) I used $FG,4$$TX,"MagicISO",HTML="http://www.magiciso.com"$$FG$ to burn test CD's to help me understand the ISO9660 file system format. I mostly used the $FG,4$$TX,"ISO9660",HTML="http://users.telenet.be/it3.consultants.bvba/handouts/ISO9960.html"$$FG$ spec. - -*) I looked at bootable CD boot sects, but didn't learn anything, finding it easier to make my own. - -*) I think I got my original PC speaker code from $FG,2$Borland C$FG$. - -*) I found PS/2 keyboard and mouse code on the net and documentation. My code is very different. I found VGA reg info on the net. - -*) Thanks to $FG,4$$TX,"http://www.osdev.org",HTML="http://www.osdev.org"$$FG$ for a couple tips. - -*) God told me to stick with 640x480 16 color, a single audio voice and kept me from zombie-walking into making child windows like $FG,2$Windows$FG$. Instead, I made one window per task with no child windows. He also guided my progress, very obviously. - -*) I got $FG,4$$TX,"Webster's Dictionary",HTML="http://www.templeos.org/files/DICTIONARY.TXT"$$FG$ and $FG,4$$TX,"The King James Bible",HTML="http://www.templeos.org/files/BIBLE.TXT"$$FG$ from $FG,4$$TX,"Project Gutenberg",HTML="http://web.archive.org/web/20110730111436/http://promo.net/pg/"$$FG$. - -*) John Carmack inspired me to use "$LK,"Clamp",A="MN:Clamp"$" as a name instead of "Limit". He inspired me to use "needle" and "haystack" as names. He inspired me to simplify my Frames-Per-Second code. - -*) Bill Gates inspired me to add comments to my $LK,"Help & Index",A="FI:::/Doc/HelpIndex.TXT"$. - -*) I hired an artist, Cody Rigby, for $$3,000 worth of pixel art. - -*) Erik van der Karbargenbok made $LK,"TempleBot",A="PI:::/Linux/TempleBot",HTML="http://www.templeos.org/Wb/Home/Sup1/Sup1Bin/TempleBot.html"$. - -*) The random number generator is from Donald Knuth in the wikipedia entry for $TX,"Linear_congruential_generator",HTML="http://en.wikipedia.org/wiki/Linear_congruential_generator"$. - -$FG,8$ -* "MSDOS", "Windows", "MovieMaker", "MS Paint" and "FAT32" are trademarks owned by MicroSoft Corp. -* "SiteBuilder" is a trademark owned by Yahoo! Inc. -* "MagicISO" is a trademark owned by MagicISO Corp. -* "MATLAB" is a trademark owned by The Math Works, Inc. -* "$TX,"FreeDOS",HTML="http://www.freedos.org"$" is a trademark owned by Jim Hall. -* "QEMU" is a trademark owned by Fabrice Bellard. -* "VAX" is a trademark owned by Digital Equipment Corp. -* "Linux" is a trademark owned by Linus Torvalds. -* "VAXTMOS" is a trademark owned by Ticketmaster. -$FG$ \ No newline at end of file diff --git a/Doc/Ctrls.DD b/Doc/Ctrls.DD new file mode 100644 index 0000000..91e5a18 --- /dev/null +++ b/Doc/Ctrls.DD @@ -0,0 +1 @@ +$WW,1$To create a TempleOS graphic ctrl, you define callback functions and insert a $LK,"CCtrl",A="MN:CCtrl"$ structure in the $LK,"CTask",A="MN:CTask"$ queue. See $LK,"::/Demo/Graphics/Slider.HC"$, $LK,"::/Demo/Graphics/ScrollBars.HC"$ and $LK,"TermButtonNew",A="FF:::/Adam/WallPaper.HC,TermButtonNew"$. There is a template-code ctrl generator, if you press $FG,2$$FG$. diff --git a/Doc/Ctrls.TXT b/Doc/Ctrls.TXT deleted file mode 100644 index b52e12e..0000000 --- a/Doc/Ctrls.TXT +++ /dev/null @@ -1 +0,0 @@ -$WW,1$To create a TempleOS graphic ctrl, you define callback functions and insert a $LK,"CCtrl",A="MN:CCtrl"$ structure in the $LK,"CTask",A="MN:CTask"$ queue. See $LK,"::/Demo/Graphics/Slider.CPP"$, $LK,"::/Demo/Graphics/ScrollBars.CPP"$ and $LK,"TermButtonNew",A="FF:::/Adam/WallPaper.CPP,TermButtonNew"$. There is a template-code ctrl generator, if you press $FG,2$$FG$. diff --git a/Doc/Customize.DD b/Doc/Customize.DD new file mode 100644 index 0000000..beb052a --- /dev/null +++ b/Doc/Customize.DD @@ -0,0 +1,6 @@ + +$WW,1$* You can adjust the mouse movement rate by setting global vars in your start-up file. See $LK,"mouse scale",A="FF:~/HomeLocalize.HC,mouse.scale"$. + +* You can set your local time zone by setting the $FG,4$local_time_offset$FG$ global var in a start-up file. It's units are $LK,"CDATE_FREQ",A="MN:CDATE_FREQ"$. See $LK,"local time",A="FF:~/HomeLocalize.HC,local_time"$. + +* Get rid of this msg $LK,"here",A="FF:~/DoOnce.HC,Customize.DD"$. diff --git a/Doc/Customize.TXT b/Doc/Customize.TXT deleted file mode 100644 index 05277b2..0000000 --- a/Doc/Customize.TXT +++ /dev/null @@ -1,6 +0,0 @@ - -$WW,1$* You can adjust the mouse movement rate by setting global vars in your start-up file. See $LK,"mouse scale",A="FF:~/HomeLocalize.CPP,mouse.scale"$. - -* You can set your local time zone by setting the $FG,4$local_time_offset$FG$ global var in a start-up file. It's units are $LK,"CDATE_FREQ",A="MN:CDATE_FREQ"$. See $LK,"local time",A="FF:~/HomeLocalize.CPP,local_time"$. - -* Get rid of this msg $LK,"here",A="FF:~/DoOnce.CPP,Customize.TXT"$. diff --git a/Doc/CutCorners.DD b/Doc/CutCorners.DD new file mode 100644 index 0000000..d624075 --- /dev/null +++ b/Doc/CutCorners.DD @@ -0,0 +1,20 @@ +$WW,1$$FG,5$$TX+CX,"Cut Corners"$ +$FG$ +There are a few places where I cut corners in the interest of not junking-up code. This is part of the TempleOS mentality. I try not to let stupid legacy compatibility issues enter and junk-up TempleOS. + +* I made my type-casting operator post-fix because it makes the compiler way cleaner. + +* TempleOS does not figure-out $FG,2$FAT32$FG$ short name alias numbers. $LK,"FAT32DirNew",A="MN:FAT32DirNew"$(). It can cause hard drive corruption, so I might have to do it. It would really take a lot of junky code for this hatefully, detestable, legacy issue. "Please don't make me ruin my beautiful shiny-new TempleOS with that!" I am also not enthused about $FG,2$FAT32$FG$ because it is in patent limbo. $FG,2$FAT32$FG$ might get removed from TempleOS. There is the $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ 64-bit file system that works perfectly well. $FG,2$FAT32$FG$ is useful, however, because it assists in transferring between dual booted operating systems. + +* I changed the $LK,"asm opcodes",A="FI:::/Compiler/OpCodes.DD"$ names to remove the ambiguity between insts with different numbers of arguments, making my $LK,"assembler",A="FI:::/Compiler/Asm.HC"$ simpler and I did minimal 16-bit asm support, since 64-bit is what you should be using, unless you're doing a $LK,"boot loader",A="FI:::/Adam/Opt/Boot/BootDVD.HC"$. + +* There are no user-controlled file-sharing locks. However, the drive and file system have locks and concurrent operations should be fine. + +* A hidden window is never refreshed. Certain tasks are never done, therefore. During refresh, the entry count limit of the document buffer is, normally, checked and enforced. If you print to the command-line in a task whose window is covered, no limit on buffer exists and it will alloc memory for the document buffer until the system runs out of memory and crashes. + +* Even if a local function variable is declared less than 64 bits, the compiler does calculations with 64-bit. + +* $LK,"Print",A="FI:::/Doc/Print.DD"$() uses $LK,"StrPrintJoin",A="MN:StrPrintJoin"$(). You cannot use vastly over-sized fields for %f. + +* $LK,"GrEllipse3",A="MN:GrEllipse3"$() is broken on transformations. + \ No newline at end of file diff --git a/Doc/CutCorners.TXT b/Doc/CutCorners.TXT deleted file mode 100644 index 82a3a2f..0000000 --- a/Doc/CutCorners.TXT +++ /dev/null @@ -1,20 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"Cut Corners"$ -$FG$ -There are a few places where I cut corners in the interest of not junking-up code. This is part of the TempleOS mentality. I try not to let stupid legacy compatibility issues enter and junk-up TempleOS. - -* I made my type-casting operator post-fix because it makes the compiler way cleaner. - -* TempleOS does not figure-out $FG,2$FAT32$FG$ short name alias numbers. $LK,"FAT32DirNew",A="MN:FAT32DirNew"$(). It can cause hard drive corruption, so I might have to do it. It would really take a lot of junky code for this hatefully, detestable, legacy issue. "Please don't make me ruin my beautiful shiny-new TempleOS with that!" I am also not enthused about $FG,2$FAT32$FG$ because it is in patent limbo. $FG,2$FAT32$FG$ might get removed from TempleOS. There is the $LK,"RedSea",A="FI:::/Doc/RedSea.TXT"$ 64-bit file system that works perfectly well. $FG,2$FAT32$FG$ is useful, however, because it assists in transferring between dual booted operating systems. - -* I changed the $LK,"asm opcodes",A="FI:::/Compiler/OpCodes.TXT"$ names to remove the ambiguity between insts with different numbers of arguments, making my $LK,"assembler",A="FI:::/Compiler/Asm.CPP"$ simpler and I did minimal 16-bit asm support, since 64-bit is what you should be using, unless you're doing a $LK,"boot loader",A="FI:::/Adam/Opt/Boot/BootDVD.CPP"$. - -* There are no user-controlled file-sharing locks. However, the drive and file system have locks and concurrent operations should be fine. - -* A hidden window is never refreshed. Certain tasks are never done, therefore. During refresh, the entry count limit of the document buffer is, normally, checked and enforced. If you print to the command-line in a task whose window is covered, no limit on buffer exists and it will alloc memory for the document buffer until the system runs out of memory and crashes. - -* Even if a local function variable is declared less than 64 bits, the compiler does calculations with 64-bit. - -* $LK,"Print",A="FI:::/Doc/Print.TXT"$() uses $LK,"StrPrintJoin",A="MN:StrPrintJoin"$(). You cannot use vastly over-sized fields for %f. - -* $LK,"GrEllipse3",A="MN:GrEllipse3"$() is broken on transformations. - \ No newline at end of file diff --git a/Doc/D3.TXT b/Doc/D3.DD similarity index 100% rename from Doc/D3.TXT rename to Doc/D3.DD diff --git a/Doc/Date.TXT b/Doc/Date.DD similarity index 100% rename from Doc/Date.TXT rename to Doc/Date.DD diff --git a/Doc/DbgFunSeg.TXT b/Doc/DbgFunSeg.DD similarity index 100% rename from Doc/DbgFunSeg.TXT rename to Doc/DbgFunSeg.DD diff --git a/Doc/DbgOverview.DD b/Doc/DbgOverview.DD new file mode 100644 index 0000000..7cd33e5 --- /dev/null +++ b/Doc/DbgOverview.DD @@ -0,0 +1,42 @@ +$WW,1$$FG,5$$TX+CX,"Debugging Overview"$$FG$ + +* You can enter the debugger with $LK,"Dbg",A="MN:Dbg"$() or $FG,2$$FG$. You might enter the debugger through a fault. Enter $LK,"G",A="MN:G"$() or $LK,"G2",A="MN:G2"$() to continue execution. Place a call to $LK,"Dbg",A="MN:Dbg"$() in your code at fatal error points to enter the debugger. If you see a stk dump, record the label+offset and unassemble, $LK,"U",A="MN:U"$(). $LK,"U",A="MN:U"$($LK,"_RIP",A="MN:_RIP"$); + +* $LK,"U",A="MN:U"$(&FunName+offset) to unassemble mem or $LK,"Uf",A="MN:Uf"$("FunName") to unassemble a function. $LK,"U",A="MN:U"$($LK,"_RIP",A="MN:_RIP"$-16); + +* While debugging, you specify addresses of assembly routines with just the label, as in $FG,2$_MALLOC+0x20$FG$. You specify $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ function names with $FG,2$&$FG$ before functions as in $FG,2$&Print+0x10$FG$. + +* I use $LK,"progress1",A="MN:progress1"$-$LK,"progress4",A="MN:progress4"$ for debugging because they show on the wallpaper. They're just global int vars. + +* You can use $LK,"AdamLog",A="MN:AdamLog"$() to send text to the Adam task window. It works like $LK,"Print",A="MN:Print"$(). I never use that. Instead, I use $LK,"RawPrint",A="MN:RawPrint"$(). + +* $LK,"D",A="MN:D"$(), $LK,"DocD",A="MN:DocD"$(), $LK,"RawD",A="MN:RawD"$() to do 16 column hex dump mem with numbering from zero. With $LK,"DocD",A="MN:DocD"$ the values are updated continually and you can alter mem by editing. + +* $LK,"Dm",A="MN:Dm"$(), $LK,"DocDm",A="MN:DocDm"$(), $LK,"RawDm",A="MN:RawDm"$() to do 16 column hex dump mem with addresses showing. + +* $LK,"Da",A="MN:Da"$() to do one column address dump (for stk, etc.) with symbolic addresses. + +* $LK,"Dr",A="MN:Dr"$() dumps regs. You can display and modify regs in the debugger with var-like labels, $FG,4$_RAX$FG$, $FG,4$_RBX$FG$, etc. + +* $LK,"ClassRep",A="MN:ClassRep"$() and the dynamic version $LK,"ClassRepD",A="MN:ClassRepD"$() can be used to dump structures. + +* $LK,"Prof",A="MN:Prof"$() and $LK,"ProfRep",A="MN:ProfRep"$() provide code profiling. See $LK,"::/Demo/AutoFile/AFProfile.AUT"$ (This is an $LK,"AutoFile",A="FF:::/Doc/Glossary.DD,AutoFile"$.) + +* Use $LK,"RawPrint",A="MN:RawPrint"$() to print debug info bypassing the window framework. You pass these routines a count in milliseconds for how long it should be displayed. You can use $LK,"Raw",A="MN:Raw"$($FG,2$TRUE$FG$) to make all output bypass the window framework. The $FG,2$WinMgr$FG$ runs on $FG,2$core0$FG$ and will overwrite raw text from other cores when it updates the screen. + +* Use $LK,"SysDbg",A="MN:SysDbg"$() to set a flag which you can read with $LK,"IsSysDbg",A="MN:IsSysDbg"$() when you wish to trigger some debug activity. It's just a handy simple flag, nothing fancy. + +* There are flags for various trace options that can help debugging when there are compiler bugs. Often, you place them in $FG,2$#exe{}$FG$ blocks. +$ID,2$ +$LK,"Echo",A="MN:Echo"$() turns on or off raw data going into the lexical analyzer. + +$LK,"Trace",A="MN:Trace"$() unassembles code generated from the HolyC compiler. + +$LK,"PassTrace",A="MN:PassTrace"$() shows intermediate code coming-out after optimization. The bits ctrl which passes are displayed. +$ID,-2$ + +* There is a heap check utility which can find leaks. Use $LK,"HeapLog",A="MN:HeapLog"$(), $LK,"HeapLogAddrRep",A="MN:HeapLogAddrRep"$() and $LK,"HeapLogSizeRep",A="MN:HeapLogSizeRep"$(). It's a really simple program which intercepts $LK,"MAlloc",A="MN:MAlloc"$() and $LK,"Free",A="MN:Free"$(). You can customize the code to find other heap issues. + +* You can define handler functions for $FG,2$$FG$ keys with $LK,"CtrlAltCBSet",A="MN:CtrlAltCBSet"$(). They operate either in a interrupt environment or in the window mgr when it queues kbd msgs. You can do $LK,"Raw",A="MN:Raw"$() output. $FG,2$$FG$ handlers take a scan_code as an arg. + +* If you recompile $FG,2$Kernel$FG,2$$FG$ with $LK,"BootHDIns",A="MN:BootHDIns"$(), you can set the $FG,4$MemInit$FG$, option to initialize memory to a value at boot, the $FG,4$HeapInit$FG$ option to cause mem alloced off the heap to be initialized or $FG,4$VarInit$FG$ option so both global and local vars will be initialized to a value. Pick a non-zero value to discover uninitialized var bugs. You can set $LK,"sys_var_init_flag",A="MN:sys_var_init_flag"$, and $LK,"sys_heap_init_flag",A="MN:sys_heap_init_flag"$ directly after booting. diff --git a/Doc/DbgOverview.TXT b/Doc/DbgOverview.TXT deleted file mode 100644 index fc1af72..0000000 --- a/Doc/DbgOverview.TXT +++ /dev/null @@ -1,42 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"Debugging Overview"$$FG$ - -* You can enter the debugger with $LK,"Dbg",A="MN:Dbg"$() or $FG,2$$FG$. You might enter the debugger through a fault. Enter $LK,"G",A="MN:G"$() or $LK,"G2",A="MN:G2"$() to continue execution. Place a call to $LK,"Dbg",A="MN:Dbg"$() in your code at fatal error points to enter the debugger. If you see a stk dump, record the label+offset and unassemble, $LK,"U",A="MN:U"$(). $LK,"U",A="MN:U"$($LK,"_RIP",A="MN:_RIP"$); - -* $LK,"U",A="MN:U"$(&FunName+offset) to unassemble mem or $LK,"Uf",A="MN:Uf"$("FunName") to unassemble a function. $LK,"U",A="MN:U"$($LK,"_RIP",A="MN:_RIP"$-16); - -* While debugging, you specify addresses of assembly routines with just the label, as in $FG,2$_MALLOC+0x20$FG$. You specify $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ function names with $FG,2$&$FG$ before functions as in $FG,2$&Print+0x10$FG$. - -* I use $LK,"progress1",A="MN:progress1"$-$LK,"progress4",A="MN:progress4"$ for debugging because they show on the wallpaper. They're just global int vars. - -* You can use $LK,"AdamLog",A="MN:AdamLog"$() to send text to the Adam task window. It works like $LK,"Print",A="MN:Print"$(). I never use that. Instead, I use $LK,"RawPrint",A="MN:RawPrint"$(). - -* $LK,"D",A="MN:D"$(), $LK,"DocD",A="MN:DocD"$(), $LK,"RawD",A="MN:RawD"$() to do 16 column hex dump mem with numbering from zero. With $LK,"DocD",A="MN:DocD"$ the values are updated continually and you can alter mem by editing. - -* $LK,"Dm",A="MN:Dm"$(), $LK,"DocDm",A="MN:DocDm"$(), $LK,"RawDm",A="MN:RawDm"$() to do 16 column hex dump mem with addresses showing. - -* $LK,"Da",A="MN:Da"$() to do one column address dump (for stk, etc.) with symbolic addresses. - -* $LK,"Dr",A="MN:Dr"$() dumps regs. You can display and modify regs in the debugger with var-like labels, $FG,4$_RAX$FG$, $FG,4$_RBX$FG$, etc. - -* $LK,"ClassRep",A="MN:ClassRep"$() and the dynamic version $LK,"ClassRepD",A="MN:ClassRepD"$() can be used to dump structures. - -* $LK,"Prof",A="MN:Prof"$() and $LK,"ProfRep",A="MN:ProfRep"$() provide code profiling. See $LK,"::/Demo/AutoFile/AFProfile.AUT"$ (This is an $LK,"AutoFile",A="FF:::/Doc/Glossary.TXT,AutoFile"$.) - -* Use $LK,"RawPrint",A="MN:RawPrint"$() to print debug info bypassing the window framework. You pass these routines a count in milliseconds for how long it should be displayed. You can use $LK,"Raw",A="MN:Raw"$($FG,2$TRUE$FG$) to make all output bypass the window framework. The $FG,2$WinMgr$FG$ runs on $FG,2$core0$FG$ and will overwrite raw text from other cores when it updates the screen. - -* Use $LK,"SysDbg",A="MN:SysDbg"$() to set a flag which you can read with $LK,"IsSysDbg",A="MN:IsSysDbg"$() when you wish to trigger some debug activity. It's just a handy simple flag, nothing fancy. - -* There are flags for various trace options that can help debugging when there are compiler bugs. Often, you place them in $FG,2$#exe{}$FG$ blocks. -$ID,2$ -$LK,"Echo",A="MN:Echo"$() turns on or off raw data going into the lexical analyzer. - -$LK,"Trace",A="MN:Trace"$() unassembles code generated from the HolyC compiler. - -$LK,"PassTrace",A="MN:PassTrace"$() shows intermediate code coming-out after optimization. The bits ctrl which passes are displayed. -$ID,-2$ - -* There is a heap check utility which can find leaks. Use $LK,"HeapLog",A="MN:HeapLog"$(), $LK,"HeapLogAddrRep",A="MN:HeapLogAddrRep"$() and $LK,"HeapLogSizeRep",A="MN:HeapLogSizeRep"$(). It's a really simple program which intercepts $LK,"MAlloc",A="MN:MAlloc"$() and $LK,"Free",A="MN:Free"$(). You can customize the code to find other heap issues. - -* You can define handler functions for $FG,2$$FG$ keys with $LK,"CtrlAltCBSet",A="MN:CtrlAltCBSet"$(). They operate either in a interrupt environment or in the window mgr when it queues kbd msgs. You can do $LK,"Raw",A="MN:Raw"$() output. $FG,2$$FG$ handlers take a scan_code as an arg. - -* If you recompile $FG,2$Kernel$FG,2$$FG$ with $LK,"BootHDIns",A="MN:BootHDIns"$(), you can set the $FG,4$MemInit$FG$, option to initialize memory to a value at boot, the $FG,4$HeapInit$FG$ option to cause mem alloced off the heap to be initialized or $FG,4$VarInit$FG$ option so both global and local vars will be initialized to a value. Pick a non-zero value to discover uninitialized var bugs. You can set $LK,"sys_var_init_flag",A="MN:sys_var_init_flag"$, and $LK,"sys_heap_init_flag",A="MN:sys_heap_init_flag"$ directly after booting. diff --git a/Doc/Define.DD b/Doc/Define.DD new file mode 100644 index 0000000..55f8147 --- /dev/null +++ b/Doc/Define.DD @@ -0,0 +1,9 @@ +$WW,1$TempleOS has a string indirection feature implemented with the same hash symbol table entry as $FG,2$#define$FG$ macros, $LK,"HTT_DEFINE_STR",A="MN:HTT_DEFINE_STR"$. Support for string lists is also provided, but it's not very efficient, though, you can make a hash table with a list using $LK,"HashDefineLstAdd",A="MN:HashDefineLstAdd"$(). See $LK,"::/Adam/DolDoc/DocInit.HC",A="FF:::/Adam/DolDoc/DocInit.HC,HashDefineLstAdd"$. + +If you have an $FG,2$@$FG$ as the first char of a define list entry, it is an alias for the prev entry num. + +Each task can load its own Define strings. Remember, when a $LK,"Hash",A="HI:Hash"$ table is searched for a string, if it is not found, the parent task's table is searched. + +The $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ framework supports text that changes based on entries in the task's symbol table. Set a text entry with a $FG,2$D=$FG$ arg, as in $FG,2$$$TX,"",D="DD_MYSTRING"$$$FG$. See $LK,"::/Demo/DolDoc/DefineStr.HC"$, $LK,"::/Adam/ADefine.HC"$ and $LK,"::/Doc/MemOverview.DD"$. + +See $LK,"::/Demo/Define.HC"$. diff --git a/Doc/Define.TXT b/Doc/Define.TXT deleted file mode 100644 index dabb3d4..0000000 --- a/Doc/Define.TXT +++ /dev/null @@ -1,9 +0,0 @@ -$WW,1$TempleOS has a string indirection feature implemented with the same hash symbol table entry as $FG,2$#define$FG$ macros, $LK,"HTT_DEFINE_STR",A="MN:HTT_DEFINE_STR"$. Support for string lists is also provided, but it's not very efficient, though, you can make a hash table with a list using $LK,"HashDefineLstAdd",A="MN:HashDefineLstAdd"$(). See $LK,"::/Adam/DolDoc/DocInit.CPP",A="FF:::/Adam/DolDoc/DocInit.CPP,HashDefineLstAdd"$. - -If you have an $FG,2$@$FG$ as the first char of a define list entry, it is an alias for the prev entry num. - -Each task can load its own Define strings. Remember, when a $LK,"Hash",A="HI:Hash"$ table is searched for a string, if it is not found, the parent task's table is searched. - -The $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$ framework supports text that changes based on entries in the task's symbol table. Set a text entry with a $FG,2$D=$FG$ arg, as in $FG,2$$$TX,"",D="DD_MYSTRING"$$$FG$. See $LK,"::/Demo/DolDoc/DefineStr.CPP"$, $LK,"::/Adam/ADefine.CPP"$ and $LK,"::/Doc/MemOverview.TXT"$. - -See $LK,"::/Demo/Define.CPP"$. diff --git a/Doc/Demands.DD b/Doc/Demands.DD new file mode 100644 index 0000000..34d4642 --- /dev/null +++ b/Doc/Demands.DD @@ -0,0 +1,57 @@ +$WW,1$$FG,5$$TX+CX,"Demands"$$FG$ + +I, Terry Davis, am high priest of God's $FG,4$$TX,"official third temple",HTML="http://www.jewishvirtuallibrary.org/jsource/Judaism/The_Temple.html"$$FG$, TempleOS. TempleOS is an operating system for IBM PC x86_64 desktops that will always dual boot along-side Windows or Linux. I am in charge of the core 100,000 lines of TempleOS code and I do continual offerings to keep God entertained. I have divine authority to command any company in the computer industry to do anything that I deem necessary to make God's temple more beautiful, glorious and perfect. I have oversight authority similar to a building inspector or a person enforcing the Americans with Disability Act -- I make commands, God signs-off with a miraculous authentication from an oracle, and Intel, Microsoft or VMware obeys. + +$HC,""$ + +* Windows, Linux and VMware (because of mounted drives) must support $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ file system so I can get rid of 2,000 lines of redundant, blemished code -- FAT32 and ISO9660. God's temple must be perfect. Redundant code for multiple file systems is imperfect. For this operating system, we want low line count. More than one file system type is actually bad, just as more than one driver for the same type of device is bad. + +See $LK,"::/Kernel/BlkDev/FileSysRedSea.HC"$ and $LK,"::/Adam/Opt/Boot/DskISORedSea.HC"$. + +$LK,"::/Kernel/BlkDev/FileSysFAT.HC"$ :974 lines for FAT32 gets eliminated. +$LK,"::/Kernel/BlkDev/FileSysISO.HC"$ :233 lines for ISO9660 gets eliminated. +$LK,"::/Adam/Opt/Boot/DskISO9660.HC"$ :507 lines for making ISO files. +$LK,"::/Kernel/BlkDev/DskCluster.HC"$ :152 All the cluster operations become blk. + +* Microsoft must cancel SecureBoot because it makes dual booting impossible. TempleOS is an additional operating system that must be used along-side Windows or Linux, not as a replacement. It must dual boot because it has no networking. Real hardware as opposed to VMware is like the difference between looking in a telescope eye piece vs just looking at an off-line image. God said the C64/Apple II generation owned ancestral lands. VMware is like being taken off of our land and moved onto a reservation. In this case, however, it will not stand. + +* VMware needs to support ATAPI CD/DVD/Blu-ray disk burning, directly to real hardware. + +* VMware has a bug stretching 640x480 16 color to full screen. + +* VMware PC speaker's distortion is a good idea, but it is too much for hymns. VMware should make an adjustment for distortion and an adjustment for reverb. + +* VMware and others must list TempleOS as an official 64-bit operating system. + +* VMware needs to support more than 16 cores. + +* VMware allocated memory too slowly. + +* Until super-simple block devices are available, hard disk should be placed at IDE primary master 1F0/3F6 and CD/DVD/Blu-ray should be placed at the IDE secondary master 170/376. +$LK,"/Kernel/BlkDev/DskATAId.HC",A="FI:::/Kernel/BlkDev/DskATAId.HC"$ :286 lines to figure-out I/O ports is gone. +$LK,"/Kernel/PCIBIOS.HC",A="FI:::/Kernel/PCIBIOS.HC"$ :290 could be eliminated, but maybe we will keep it so people can play with PCI devices. + +* Until super-simple serial ports are available, PS/2 emulated keyboard and mouse must work. The BIOS must enable these. + +* The x86 IN/OUT port instructions, normally have a delay. Perhaps, VMware & Intel can enable faster x86 IN/OUT instruction timing for ATA/ATAPI PIO, so bandwidth isn't bad when doing port I/O. See $LK,"ATAGetRes",A="MN:ATAGetRes"$(). We don't want to do DMA. Perhaps, x86 CPU chips need a new TempleOS mode for fast IN/OUT instructions? I think VMware already does something to speed disk I/O to faster than native speed. + +* Perhaps, a new interrupt descriptor table entry type or a new x86 CPU mode can be made that cause fast software interrupts, doing exactly what the CALL REL32 does, but with IDT as indirection. We don't need to change privilege levels or stacks. + +* Since I don't use paging (for anything), Intel should have an option for no-paging long mode, and optimize it! +$LK,"::/Kernel/Mem/PageTables.HC"$ :135 lines to identity-map gets eliminated. + +* Desktop computers must have a reset switch and a fast reboot option, skipping diagnostics. I recommend booting TempleOS from a ROM when the reset button is pressed and booting UEFI when the power button is pressed. Or, we could build UEFI on a TempleOS layer. Intel must burn TempleOS into a ROM in the factory for all desktop x86 CPUs to ensure tamper-proof trust in the oracle and because God deserves the glory. There will be just an English version. A new ROM version is released every seven years. The ROM should boot like the DVD boots, but with $LK,"BOOT_SRC_ROM",A="MN:BOOT_SRC_ROM"$. + +* We do not want UTF, just 8-bit characters. $FG,2$$FG$ toggles between Cyrillic and Std Fonts. We need the twelve window $LK,"TextBorder",A="MN:TextBorder"$ characters added to the VGA font 0x02-0x0D. Japan, China and Korea must switch to alphabets. Maybe, the United States will change to metric, out of good will. + +* Microsoft Paint and Linux's Gimp must support TempleOS $LK,"GRA Files",A="FI:::/Doc/GRAFiles.DD"$. They are blemish free, unlike $TX,"BMP files",HTML="http://en.wikipedia.org/wiki/BMP_file_format"$. + +* We must have a nice dictionary. Someone needs to do a $LK,"Spell Checker",A="FI:::/Demo/SuggestSpelling.HC"$, too. + +* We must have the ultimate Bible search engine. Currently, all we have is $TX,"filter search",HTML="https://www.youtube.com/watch?v=ULJU8DzvQFo"$. In the end, it should be a low line-count technique. + +* We will make a $LK,"Standard TempleOS PC",A="FI:::/Doc/StdTempleOSPC.DD"$. +$FG,8$ +* "VMware" is a trademark owned by VMware, Inc. +* "Linux" is a trademark owned by Linus Torvalds. +* "Windows" and "Paint" are trademarks owned by MicroSoft Corp.$FG$ diff --git a/Doc/Demands.TXT b/Doc/Demands.TXT deleted file mode 100644 index 007cf5a..0000000 --- a/Doc/Demands.TXT +++ /dev/null @@ -1,55 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"Demands"$$FG$ - -I, Terry Davis, am high priest of God's $FG,4$$TX,"official third temple",HTML="http://www.jewishvirtuallibrary.org/jsource/Judaism/The_Temple.html"$$FG$, TempleOS. TempleOS is an operating system for IBM PC x86_64 desktops that will always dual boot along-side Windows or Linux. I am in charge of the core 100,000 lines of TempleOS code and I do continual offerings to keep God entertained. I have divine authority to command any company in the computer industry to do anything that I deem necessary to make God's temple more beautiful, glorious and perfect. I have oversight authority similar to a building inspector or a person enforcing the Americans with Disability Act -- I make commands, God signs-off with a miraculous authentication from an oracle, and Intel, Microsoft or VMware obeys. - -$HC,""$ - -* Windows, Linux and VMware (because of mounted drives) must support $LK,"RedSea",A="FI:::/Doc/RedSea.TXT"$ file system so I can get rid of 2,000 lines of redundant, blemished code -- FAT32 and ISO9660. God's temple must be perfect. Redundant code for multiple file systems is imperfect. For this operating system, we want low line count. More than one file system type is actually bad, just as more than one driver for the same type of device is bad. - -See $LK,"::/Kernel/BlkDev/FileSysRedSea.CPP"$ and $LK,"::/Adam/Opt/Boot/DskISORedSea.CPP"$. - -$LK,"::/Kernel/BlkDev/FileSysFAT.CPP"$ :974 lines for FAT32 gets eliminated. -$LK,"::/Kernel/BlkDev/FileSysISO.CPP"$ :233 lines for ISO9660 gets eliminated. -$LK,"::/Adam/Opt/Boot/DskISO9660.CPP"$ :507 lines for making ISO files. -$LK,"::/Kernel/BlkDev/DskCluster.CPP"$ :152 All the cluster operations become blk. - -* Microsoft must cancel SecureBoot because it makes dual booting impossible. TempleOS is an additional operating system that must be used along-side Windows or Linux, not as a replacement. It must dual boot because it has no networking. Real hardware as opposed to VMware is like the difference between looking in a telescope eye piece vs just looking at an off-line image. God said the C64/Apple II generation owned ancestral lands. VMware is like being taken off of our land and moved onto a reservation. In this case, however, it will not stand. - -* VMware needs to support ATAPI CD/DVD/Blu-ray disk burning, directly to real hardware. - -* VMware has a bug stretching 640x480 16 color to full screen. - -* VMware PC speaker's distortion is a good idea, but it is too much for hymns. VMware should make an adjustment for distortion and an adjustment for reverb. - -* VMware and others must list TempleOS as an official 64-bit operating system. - -* VMware needs to support more than 16 cores. - -* Until super-simple block devices are available, hard disk should be placed at IDE primary master 1F0/3F6 and CD/DVD/Blu-ray should be placed at the IDE secondary master 170/376. -$LK,"/Kernel/BlkDev/DskATAId.CPP",A="FI:::/Kernel/BlkDev/DskATAId.CPP"$ :286 lines to figure-out I/O ports is gone. -$LK,"/Kernel/PCIBIOS.CPP",A="FI:::/Kernel/PCIBIOS.CPP"$ :290 could be eliminated, but maybe we will keep it so people can play with PCI devices. - -* Until super-simple serial ports are available, PS/2 emulated keyboard and mouse must work. The BIOS must enable these. - -* The x86 IN/OUT port instructions, normally have a delay. Perhaps, VMware & Intel can enable faster x86 IN/OUT instruction timing for ATA/ATAPI PIO, so bandwidth isn't bad when doing port I/O. See $LK,"ATAGetRes",A="MN:ATAGetRes"$(). We don't want to do DMA. Perhaps, x86 CPU chips need a new TempleOS mode for fast IN/OUT instructions? I think VMware already does something to speed disk I/O to faster than native speed. - -* Perhaps, a new interrupt descriptor table entry type or a new x86 CPU mode can be made that cause fast software interrupts, doing exactly what the CALL REL32 does, but with IDT as indirection. We don't need to change privilege levels or stacks. - -* Since I don't use paging (for anything), Intel should have an option for no-paging long mode, and optimize it! -$LK,"::/Kernel/Mem/PageTables.CPP"$ :135 lines to identity-map gets eliminated. - -* Desktop computers must have a reset switch and a fast reboot option, skipping diagnostics. I recommend booting TempleOS from a ROM when the reset button is pressed and booting UEFI when the power button is pressed. Or, we could build UEFI on a TempleOS layer. Intel must burn TempleOS into a ROM in the factory for all desktop x86 CPUs to ensure tamper-proof trust in the oracle and because God deserves the glory. There will be just an English version. A new ROM version is released every seven years. The ROM should boot like the DVD boots, but with $LK,"BOOT_SRC_ROM",A="MN:BOOT_SRC_ROM"$. - -* We do not want UTF, just 8-bit characters. $FG,2$$FG$ toggles between Cyrillic and Std Fonts. We need the twelve window $LK,"TextBorder",A="MN:TextBorder"$ characters added to the VGA font 0x02-0x0D. Japan, China and Korea must switch to alphabets. Maybe, the United States will change to metric, out of good will. - -* Microsoft Paint and Linux's Gimp must support TempleOS $LK,"GRA Files",A="FI:::/Doc/GRAFiles.TXT"$. They are blemish free, unlike $TX,"BMP files",HTML="http://en.wikipedia.org/wiki/BMP_file_format"$. - -* We must have a nice dictionary. Someone needs to do a $LK,"Spell Checker",A="FI:::/Demo/SuggestSpelling.CPP"$, too. - -* We must have the ultimate Bible search engine. Currently, all we have is $TX,"filter search",HTML="https://www.youtube.com/watch?v=ULJU8DzvQFo"$. In the end, it should be a low line-count technique. - -* We will make a $LK,"Standard TempleOS PC",A="FI:::/Doc/StdTempleOSPC.TXT"$. -$FG,8$ -* "VMware" is a trademark owned by VMware, Inc. -* "Linux" is a trademark owned by Linus Torvalds. -* "Windows" and "Paint" are trademarks owned by MicroSoft Corp.$FG$ diff --git a/Doc/DemoIndex.DD b/Doc/DemoIndex.DD new file mode 100644 index 0000000..4ffbe0a --- /dev/null +++ b/Doc/DemoIndex.DD @@ -0,0 +1,195 @@ +$FG,5$$TX+CX,"TempleOS Demo Index"$$FG$ + +$WW,1$These are arranged in increasing order of difficulty, more or less. This can be used as a tutorial if you start at the beginning and work your way fwd. + +$FG,2$$FG$ to edit a file and $FG,2$F5$FG$ to run it. + +$LK,"::/Doc/HelloWorld.DD"$ + +$WW,0$$TR,"Games: Beginner"$ +$ID,2$$LK,"::/Demo/Graphics/NetOfDots.HC"$ +$LK,"::/Demo/Graphics/InputPointer.HC"$ +$LK,"::/Demo/Graphics/Lines.HC"$ +$LK,"::/Demo/Graphics/SunMoon.HC"$ +$LK,"::/Demo/Graphics/LowPassFilter.HC"$ +$LK,"::/Demo/Graphics/MathAudioDemo.HC"$ +$LK,"::/Demo/Games/TicTacToe.HC"$ +$LK,"::/Demo/Graphics/SpritePlot.HC"$ +$LK,"::/Demo/Games/ElephantWalk.HC"$ +$LK,"::/Demo/Graphics/SpritePut.HC"$ +$LK,"::/Demo/Graphics/SpritePutExt.HC"$ +$LK,"::/Demo/Snd/ASCIIOrgan.HC"$ +$LK,"::/Demo/MsgLoop.HC"$ +$LK,"::/Demo/Graphics/Doodle.HC"$ +$LK,"::/Demo/Graphics/Speedline.HC"$ +$LK,"::/Demo/Graphics/Bounce.HC"$ +$LK,"::/Demo/RandDemo.HC"$ +$LK,"::/Demo/KeyBitMap.HC"$ +$LK,"::/Demo/Graphics/WinZBuf.HC"$ +$LK,"::/Demo/Graphics/Elephant.HC"$ +$LK,"::/Demo/Graphics/Mountain.HC"$ +$LK,"::/Demo/Graphics/WallPaperFish.HC"$ //Press SHIFT-F5 to Adam Include +$LK,"::/Demo/Games/Digits.HC"$ +$LK,"::/Demo/Progress.HC"$ //has some ASM, just ignore +$LK,"::/Demo/Graphics/Symmetry.HC"$ +$LK,"::/Demo/Graphics/Blot.HC"$ +$LK,"::/Demo/Graphics/ScreenCapture.HC"$ +$LK,"::/Demo/Graphics/EdSprite.HC"$ +$LK,"::/Demo/PullDownMenu.HC"$ +$LK,"::/Demo/Graphics/Palette.HC"$ +$LK,"::/Demo/Games/CircleTrace.HC"$ +$LK,"::/Demo/Games/Halogen.HC"$ +$LK,"::/Demo/Games/TheDead.HC"$ +$LK,"::/Demo/Games/RainDrops.HC"$ +$LK,"::/Demo/Snd/MorseCode.HC"$ +$MA-X+PU,"::/Demo/Games/Stadium",LM="Cd(\"::/Demo/Games/Stadium\");Dir;View;\n"$ +$LK,"::/Demo/Graphics/Lattice.HC"$ +$LK,"::/Demo/Graphics/Collision.HC"$ +$LK,"::/Demo/Games/BlackDiamond.HC"$ +$ID,-2$$TR,"Games: Intermediate"$ +$ID,2$$LK,"::/Demo/Graphics/Box.HC"$ +$LK,"::/Demo/Graphics/Pick.HC"$ +$LK,"::/Demo/Graphics/3DPoly.HC"$ +$LK,"::/Demo/Graphics/BSpline.HC"$ +$LK,"::/Demo/Graphics/Extents.HC"$ +$LK,"::/Demo/Graphics/SpritePlot3D.HC"$ +$LK,"::/Demo/Graphics/Balloon.HC"$ +$LK,"::/Demo/Graphics/RotateTank.HC"$ +$LK,"::/Demo/Games/Wenceslas.HC"$ +$LK,"::/Demo/ScreenCodes.HC"$ +$LK,"::/Demo/Graphics/PanText.HC"$ +$LK,"::/Demo/Graphics/CharAnimation.HC"$ +$LK,"::/Demo/Games/Maze.HC"$ +$LK,"::/Demo/Games/CharDemo.HC"$ +$LK,"::/Demo/Graphics/FontEd.HC"$ +$LK,"::/Demo/ExtChars.HC"$ +$LK,"::/Demo/TimeIns.HC"$ +$LK,"::/Demo/Snd/WaterFowl.HC"$ +$MA-X+PU,"::/Apps/Psalmody/Examples",LM="Cd(\"::/Apps/Psalmody/Examples\");Dir;View;\n"$ +$LK,"CPURep",A="MN:CPURep"$ +$LK,"::/Demo/MultiCore/MPPrint.HC"$ +$LK,"::/Demo/Graphics/PredatorPrey.HC"$ +$LK,"::/Demo/Graphics/Cartesian.HC"$ +$LK,"::/Demo/Graphics/Hanoi.HC"$ +$LK,"::/Demo/Graphics/Life.HC"$ +$LK,"::/Demo/Games/Zing.HC"$ +$LK,"::/Demo/Graphics/Grid.HC"$ +$LK,"::/Demo/Games/TreeCheckers.HC"$ +$LK,"::/Demo/MultiCore/Palindrome.HC"$ +$LK,"::/Demo/MultiCore/MPAdd.HC"$ +$LK,"::/Demo/MultiCore/Lock.HC"$ +$LK,"::/Demo/MultiCore/Clouds.HC"$ +$LK,"::/Demo/Graphics/Slider.HC"$ +$LK,"::/Demo/Graphics/WallPaperCtrl.HC"$ //Press SHIFT-F5 to Adam Include +$LK,"::/Demo/Graphics/ScrollBars.HC"$ +$LK,"::/Demo/RegistryDemo.HC"$ +$LK,"::/Demo/Games/FlapBat.HC"$ +$LK,"::/Demo/Games/BattleLines.HC"$ +$LK,"::/Demo/Games/BigGuns.HC"$ +$LK,"::/Demo/Games/FlatTops.HC"$ +$LK,"::/Demo/Games/RawHide.HC"$ +$LK,"::/Demo/Games/DunGen.HC"$ +$MA-X+PU,"::/Apps/TimeOut",LM="Cd(\"::/Apps/TimeOut\");Dir;View;\n"$ +$LK,"::/Demo/Games/Collision.HC"$ +$ID,-2$$TR,"Games: Advanced"$ +$ID,2$$LK,"::/Demo/MultiCore/LoadTest.HC"$ +$LK,"::/Demo/MultiCore/Primes.HC"$ +$LK,"::/Demo/MultiCore/RadixSort.HC"$ +$LK,"::/Demo/MultiCore/Interrupts.HC"$ +$MA-X+PU,"::/Apps/AfterEgypt",LM="Cd(\"::/Apps/AfterEgypt\");Dir;View;\n"$ +$LK,"::/Demo/Games/Varoom.HC"$ +$LK,"::/Demo/Graphics/Shading.HC"$ +$LK,"::/Demo/Graphics/Transform.HC"$ +$LK,"::/Demo/Games/BomberGolf.HC"$ +$LK,"::/Demo/Graphics/Shadow.HC"$ +$LK,"::/Demo/Graphics/Pick3D.HC"$ +$MA-X+PU,"::/Apps/ToTheFront",LM="Cd(\"::/Apps/ToTheFront\");Dir;View;\n"$ +$LK,"::/Demo/Graphics/SpriteText.HC"$ +$LK,"::/Demo/Graphics/SpriteRaw.HC"$ +$MA-X+PU,"::/Apps/GrModels",LM="Cd(\"::/Apps/GrModels\");Dir;View;\n"$ +$MA-X+PU,"::/Apps/KeepAway",LM="Cd(\"::/Apps/KeepAway\");Dir;View;\n"$ +$LK,"::/Demo/Graphics/Camp.HC"$ +$LK,"::/Demo/Games/Rocket.HC"$ +$LK,"::/Demo/Games/RocketScience.HC"$ +$LK,"::/Demo/Games/MassSpring.HC"$ +$LK,"::/Demo/Games/Whap.HC"$ +$LK,"::/Demo/Games/Squirt.HC"$ +$MA-X+PU,"::/Apps/X-Caliber",LM="Cd(\"::/Apps/X-Caliber\");Dir;View;\n"$ +$LK,"::/Demo/Games/ZoneOut.HC"$ +$LK,"::/Demo/Games/CastleFrankenstein.HC"$ +$LK,"::/Demo/Games/EagleDive.HC"$ +$MA-X+PU,"::/Apps/Strut",LM="Cd(\"::/Apps/Strut\");Dir;View;\n"$ +$MA-X+PU,"::/Apps/Span",LM="Cd(\"::/Apps/Span\");Dir;View;\n"$ +$MA-X+PU,"::/Apps/Psalmody",LM="Cd(\"::/Apps/Psalmody\");Dir;View;\n"$ +$ID,-2$$TR,"Non-Game"$ +$ID,2$$LK,"::/Misc/DoDistro.HC"$ +$LK,"::/Demo/DbgDemo.HC"$ +$LK,"::/Demo/SubSwitch.HC"$ +$LK,"::/Demo/DateTime.HC"$ +$LK,"::/Demo/RevFileDemo/Rev.HC"$ +$LK,"::/Demo/ToHtmlToTXTDemo/HtmlGen.HC"$ +$LK,"::/Demo/ToHtmlToTXTDemo/TXTGen.HC"$ +$LK,"::/Demo/SortFileDemo/F64FileGen.HC"$ +$LK,"::/Demo/SortFileDemo/F64FileSort.HC"$ +$LK,"::/Demo/PhoneNumWords.HC"$ +$LK,"::/Demo/SuggestSpelling.HC"$ +$LK,"::/Demo/WordSearch.HC"$ +$LK,"::/Demo/Graphics/CommonAncestor.HC"$ +$LK,"::/Demo/Directives.HC"$ +$LK,"::/Demo/Carry.HC"$ +$LK,"::/Demo/Dsk/DataBase.HC"$ +$LK,"::/Demo/Dsk/FPrintF.HC"$ +$LK,"::/Demo/Dsk/DskRaw.HC"$ +$LK,"::/Demo/Dsk/UnusedSpaceRep.HC"$ +$LK,"::/Demo/Lectures/MiniGrLib.HC"$ +$LK,"::/Demo/Lectures/MiniCompiler.HC"$ +$LK,"::/Demo/MagicPairs.HC"$ +$LK,"::/Demo/Graphics/PoleZeros.HC"$ +$LK,"::/Demo/WebLogDemo/WebLogRep.HC"$ +$LK,"::/Demo/WebLogDemo/WebLogScramble.HC"$ +$MA-X+PU,"::/Apps/TimeClock",LM="Cd(\"::/Apps/TimeClock\");Dir;View;\n"$ +$MA-X+PU,"::/Apps/Logic",LM="Cd(\"::/Apps/Logic\");Dir;View;\n"$ +$MA-X+PU,"::/Demo/Lectures",LM="Cd(\"::/Demo/Lectures\");Dir;View;\n"$ +$MA-X+PU,"::/Apps/Budget",LM="Cd(\"::/Apps/Budget\");Dir;View;\n"$ +$ID,-2$$TR,"TempleOS Specific"$ +$ID,2$$MA-X+PU,"::/Demo/AutoFile",LM="Cd(\"::/Demo/AutoFile\");Dir;View;\n"$ +$LK,"::/Demo/Print.HC"$ +$LK,"::/Demo/SubIntAccess.HC"$ +$LK,"::/Demo/ParenWarn.HC"$ +$LK,"::/Demo/CompileDemo.HC"$ +$LK,"::/Demo/Prompt.HC"$ +$LK,"::/Demo/ClassMeta.HC"$ +$LK,"::/Demo/LastClass.HC"$ +$LK,"::/Demo/DolDoc/NumBible.HC"$ +$LK,"::/Demo/DolDoc/Form.HC"$ +$LK,"::/Demo/DolDoc/MenuButton.HC"$ +$LK,"::/Demo/DolDoc/MenuSprite.HC"$ +$LK,"::/Demo/DolDoc/ClickCallBack.HC"$ +$LK,"::/Demo/DolDoc/TreeDemo.HC"$ +$LK,"::/Demo/Exceptions.HC"$ +$LK,"::/Demo/Dsk/SerializeTree.HC"$ +$LK,"::/Demo/MemDemo.HC"$ +$LK,"::/Demo/StkGrow.HC"$ +$LK,"::/Demo/DolDoc/TextDemo.HC"$ +$LK,"::/Demo/DolDoc/CursorMove.HC"$ +$LK,"::/Demo/DolDoc/DemoDoc.DD"$ +$LK,"::/Demo/Spy.HC"$ +$LK,"::/Demo/DolDoc/FileRead.HC"$ +$LK,"::/Demo/DolDoc/Data.HC"$ +$LK,"::/Demo/DolDoc/DefineStr.HC"$ +$LK,"::/Demo/DolDoc/CallBack.HC"$ +$LK,"::/Demo/Define.HC"$ +$LK,"EdRenumAsm",A="MN:EdRenumAsm"$ +$LK,"::/Demo/DolDoc/UnusedDefine.HC"$ +$LK,"::/Demo/Asm/AsmHelloWorld.HC"$ +$LK,"::/Demo/Asm/BuzzFizz.HC"$ +$LK,"::/Demo/Asm/PutDec.HC"$ +$LK,"::/Demo/Asm/MulByHand.HC"$ +$LK,"::/Demo/Asm/DivByHand.HC"$ +$LK,"::/Demo/Asm/AsmAndC1.HC"$ +$LK,"::/Demo/Asm/AsmAndC2.HC"$ +$LK,"::/Demo/Asm/AsmAndC3.HC"$ +$LK,"::/Demo/GlblVars.HC"$ +$LK,"::/Misc/OSTestSuite.HC"$ +$MA-X+PU,"::/Adam",LM="Cd(\"::/Adam\");Dir;View;\n"$ +$ID,-2$ diff --git a/Doc/DemoIndex.TXT b/Doc/DemoIndex.TXT deleted file mode 100644 index f28bd2e..0000000 --- a/Doc/DemoIndex.TXT +++ /dev/null @@ -1,195 +0,0 @@ -$FG,5$$TX+CX,"TempleOS Demo Index"$$FG$ - -$WW,1$These are arranged in increasing order of difficulty, more or less. This can be used as a tutorial if you start at the beginning and work your way fwd. - -$FG,2$$FG$ to edit a file and $FG,2$F5$FG$ to run it. - -$LK,"::/Doc/HelloWorld.TXT"$ - -$WW,0$$TR,"Games: Beginner"$ -$ID,2$$LK,"::/Demo/Graphics/NetOfDots.CPP"$ -$LK,"::/Demo/Graphics/InputPointer.CPP"$ -$LK,"::/Demo/Graphics/Lines.CPP"$ -$LK,"::/Demo/Graphics/SunMoon.CPP"$ -$LK,"::/Demo/Graphics/LowPassFilter.CPP"$ -$LK,"::/Demo/Graphics/MathAudioDemo.CPP"$ -$LK,"::/Demo/Games/TicTacToe.CPP"$ -$LK,"::/Demo/Graphics/SpritePlot.CPP"$ -$LK,"::/Demo/Games/ElephantWalk.CPP"$ -$LK,"::/Demo/Graphics/SpritePut.CPP"$ -$LK,"::/Demo/Graphics/SpritePutExt.CPP"$ -$LK,"::/Demo/Snd/ASCIIOrgan.CPP"$ -$LK,"::/Demo/MsgLoop.CPP"$ -$LK,"::/Demo/Graphics/Doodle.CPP"$ -$LK,"::/Demo/Graphics/Speedline.CPP"$ -$LK,"::/Demo/Graphics/Bounce.CPP"$ -$LK,"::/Demo/RandDemo.CPP"$ -$LK,"::/Demo/KeyBitMap.CPP"$ -$LK,"::/Demo/Graphics/WinZBuf.CPP"$ -$LK,"::/Demo/Graphics/Elephant.CPP"$ -$LK,"::/Demo/Graphics/Mountain.CPP"$ -$LK,"::/Demo/Graphics/WallPaperFish.CPP"$ //Press SHIFT-F5 to Adam Include -$LK,"::/Demo/Games/Digits.CPP"$ -$LK,"::/Demo/Progress.CPP"$ //has some ASM, just ignore -$LK,"::/Demo/Graphics/Symmetry.CPP"$ -$LK,"::/Demo/Graphics/Blot.CPP"$ -$LK,"::/Demo/Graphics/ScreenCapture.CPP"$ -$LK,"::/Demo/Graphics/EdSprite.CPP"$ -$LK,"::/Demo/PullDownMenu.CPP"$ -$LK,"::/Demo/Graphics/Palette.CPP"$ -$LK,"::/Demo/Games/CircleTrace.CPP"$ -$LK,"::/Demo/Games/Halogen.CPP"$ -$LK,"::/Demo/Games/TheDead.CPP"$ -$LK,"::/Demo/Games/RainDrops.CPP"$ -$LK,"::/Demo/Snd/MorseCode.CPP"$ -$MA-X+PU,"::/Demo/Games/Stadium",LM="Cd(\"::/Demo/Games/Stadium\");Dir;View;\n"$ -$LK,"::/Demo/Graphics/Lattice.CPP"$ -$LK,"::/Demo/Graphics/Collision.CPP"$ -$LK,"::/Demo/Games/BlackDiamond.CPP"$ -$ID,-2$$TR,"Games: Intermediate"$ -$ID,2$$LK,"::/Demo/Graphics/Box.CPP"$ -$LK,"::/Demo/Graphics/Pick.CPP"$ -$LK,"::/Demo/Graphics/3DPoly.CPP"$ -$LK,"::/Demo/Graphics/BSpline.CPP"$ -$LK,"::/Demo/Graphics/Extents.CPP"$ -$LK,"::/Demo/Graphics/SpritePlot3D.CPP"$ -$LK,"::/Demo/Graphics/Balloon.CPP"$ -$LK,"::/Demo/Graphics/RotateTank.CPP"$ -$LK,"::/Demo/Games/Wenceslas.CPP"$ -$LK,"::/Demo/ScreenCodes.CPP"$ -$LK,"::/Demo/Graphics/PanText.CPP"$ -$LK,"::/Demo/Graphics/CharAnimation.CPP"$ -$LK,"::/Demo/Games/Maze.CPP"$ -$LK,"::/Demo/Games/CharDemo.CPP"$ -$LK,"::/Demo/Graphics/FontEd.CPP"$ -$LK,"::/Demo/ExtendedChars.CPP"$ -$LK,"::/Demo/TimeIns.CPP"$ -$LK,"::/Demo/Snd/WaterFowl.CPP"$ -$MA-X+PU,"::/Apps/Psalmody/Examples",LM="Cd(\"::/Apps/Psalmody/Examples\");Dir;View;\n"$ -$LK,"::/Demo/MultiCore/RateCores.CPP"$ -$LK,"::/Demo/MultiCore/MPPrint.CPP"$ -$LK,"::/Demo/Graphics/PredatorPrey.CPP"$ -$LK,"::/Demo/Graphics/Cartesian.CPP"$ -$LK,"::/Demo/Graphics/Hanoi.CPP"$ -$LK,"::/Demo/Graphics/Life.CPP"$ -$LK,"::/Demo/Games/Zing.CPP"$ -$LK,"::/Demo/Graphics/Grid.CPP"$ -$LK,"::/Demo/Games/TreeCheckers.CPP"$ -$LK,"::/Demo/MultiCore/Palindrome.CPP"$ -$LK,"::/Demo/MultiCore/MPAdd.CPP"$ -$LK,"::/Demo/MultiCore/Lock.CPP"$ -$LK,"::/Demo/MultiCore/Clouds.CPP"$ -$LK,"::/Demo/Graphics/Slider.CPP"$ -$LK,"::/Demo/Graphics/WallPaperCtrl.CPP"$ //Press SHIFT-F5 to Adam Include -$LK,"::/Demo/Graphics/ScrollBars.CPP"$ -$LK,"::/Demo/RegistryDemo.CPP"$ -$LK,"::/Demo/Games/FlapBat.CPP"$ -$LK,"::/Demo/Games/BattleLines.CPP"$ -$LK,"::/Demo/Games/BigGuns.CPP"$ -$LK,"::/Demo/Games/FlatTops.CPP"$ -$LK,"::/Demo/Games/RawHide.CPP"$ -$LK,"::/Demo/Games/DunGen.CPP"$ -$MA-X+PU,"::/Apps/TimeOut",LM="Cd(\"::/Apps/TimeOut\");Dir;View;\n"$ -$LK,"::/Demo/Games/Collision.CPP"$ -$ID,-2$$TR,"Games: Advanced"$ -$ID,2$$LK,"::/Demo/MultiCore/LoadTest.CPP"$ -$LK,"::/Demo/MultiCore/Primes.CPP"$ -$LK,"::/Demo/MultiCore/RadixSort.CPP"$ -$LK,"::/Demo/MultiCore/Interrupts.CPP"$ -$MA-X+PU,"::/Apps/AfterEgypt",LM="Cd(\"::/Apps/AfterEgypt\");Dir;View;\n"$ -$LK,"::/Demo/Games/Varoom.CPP"$ -$LK,"::/Demo/Graphics/Shading.CPP"$ -$LK,"::/Demo/Graphics/Transform.CPP"$ -$LK,"::/Demo/Games/BomberGolf.CPP"$ -$LK,"::/Demo/Graphics/Shadow.CPP"$ -$LK,"::/Demo/Graphics/Pick3D.CPP"$ -$MA-X+PU,"::/Apps/ToTheFront",LM="Cd(\"::/Apps/ToTheFront\");Dir;View;\n"$ -$LK,"::/Demo/Graphics/SpriteText.CPP"$ -$LK,"::/Demo/Graphics/SpriteRaw.CPP"$ -$MA-X+PU,"::/Apps/GrModels",LM="Cd(\"::/Apps/GrModels\");Dir;View;\n"$ -$MA-X+PU,"::/Apps/KeepAway",LM="Cd(\"::/Apps/KeepAway\");Dir;View;\n"$ -$LK,"::/Demo/Graphics/Camp.CPP"$ -$LK,"::/Demo/Games/Rocket.CPP"$ -$LK,"::/Demo/Games/RocketScience.CPP"$ -$LK,"::/Demo/Games/MassSpring.CPP"$ -$LK,"::/Demo/Games/Whap.CPP"$ -$LK,"::/Demo/Games/Squirt.CPP"$ -$MA-X+PU,"::/Apps/X-Caliber",LM="Cd(\"::/Apps/X-Caliber\");Dir;View;\n"$ -$LK,"::/Demo/Games/ZoneOut.CPP"$ -$LK,"::/Demo/Games/CastleFrankenstein.CPP"$ -$LK,"::/Demo/Games/EagleDive.CPP"$ -$MA-X+PU,"::/Apps/Strut",LM="Cd(\"::/Apps/Strut\");Dir;View;\n"$ -$MA-X+PU,"::/Apps/Span",LM="Cd(\"::/Apps/Span\");Dir;View;\n"$ -$MA-X+PU,"::/Apps/Psalmody",LM="Cd(\"::/Apps/Psalmody\");Dir;View;\n"$ -$ID,-2$$TR,"Non-Game"$ -$ID,2$$LK,"::/Misc/DoDistro.CPP"$ -$LK,"::/Demo/DbgDemo.CPP"$ -$LK,"::/Demo/SubSwitch.CPP"$ -$LK,"::/Demo/DateTime.CPP"$ -$LK,"::/Demo/RevFileDemo/Rev.CPP"$ -$LK,"::/Demo/ToHtmlToTXTDemo/HtmlGen.CPP"$ -$LK,"::/Demo/ToHtmlToTXTDemo/TXTGen.CPP"$ -$LK,"::/Demo/SortFileDemo/F64FileGen.CPP"$ -$LK,"::/Demo/SortFileDemo/F64FileSort.CPP"$ -$LK,"::/Demo/PhoneNumWords.CPP"$ -$LK,"::/Demo/SuggestSpelling.CPP"$ -$LK,"::/Demo/WordSearch.CPP"$ -$LK,"::/Demo/Graphics/CommonAncestor.CPP"$ -$LK,"::/Demo/Directives.CPP"$ -$LK,"::/Demo/Carry.CPP"$ -$LK,"::/Demo/Dsk/DataBase.CPP"$ -$LK,"::/Demo/Dsk/FPrintF.CPP"$ -$LK,"::/Demo/Dsk/DskRaw.CPP"$ -$LK,"::/Demo/Dsk/UnusedSpaceRep.CPP"$ -$LK,"::/Demo/Lectures/MiniGrLib.CPP"$ -$LK,"::/Demo/Lectures/MiniCompiler.CPP"$ -$LK,"::/Demo/MagicPairs.CPP"$ -$LK,"::/Demo/Graphics/PoleZeros.CPP"$ -$LK,"::/Demo/WebLogDemo/WebLogRep.CPP"$ -$LK,"::/Demo/WebLogDemo/WebLogScramble.CPP"$ -$MA-X+PU,"::/Apps/TimeClock",LM="Cd(\"::/Apps/TimeClock\");Dir;View;\n"$ -$MA-X+PU,"::/Apps/Logic",LM="Cd(\"::/Apps/Logic\");Dir;View;\n"$ -$MA-X+PU,"::/Demo/Lectures",LM="Cd(\"::/Demo/Lectures\");Dir;View;\n"$ -$MA-X+PU,"::/Apps/Budget",LM="Cd(\"::/Apps/Budget\");Dir;View;\n"$ -$ID,-2$$TR,"TempleOS Specific"$ -$ID,2$$MA-X+PU,"::/Demo/AutoFile",LM="Cd(\"::/Demo/AutoFile\");Dir;View;\n"$ -$LK,"::/Demo/Print.CPP"$ -$LK,"::/Demo/SubIntAccess.CPP"$ -$LK,"::/Demo/ParenWarn.CPP"$ -$LK,"::/Demo/CompileDemo.CPP"$ -$LK,"::/Demo/Prompt.CPP"$ -$LK,"::/Demo/ClassMeta.CPP"$ -$LK,"::/Demo/LastClass.CPP"$ -$LK,"::/Demo/DolDoc/NumBible.CPP"$ -$LK,"::/Demo/DolDoc/Form.CPP"$ -$LK,"::/Demo/DolDoc/MenuButton.CPP"$ -$LK,"::/Demo/DolDoc/MenuSprite.CPP"$ -$LK,"::/Demo/DolDoc/ClickCallBack.CPP"$ -$LK,"::/Demo/DolDoc/TreeDemo.CPP"$ -$LK,"::/Demo/Exceptions.CPP"$ -$LK,"::/Demo/Dsk/SerializeTree.CPP"$ -$LK,"::/Demo/MemDemo.CPP"$ -$LK,"::/Demo/StkGrow.CPP"$ -$LK,"::/Demo/DolDoc/TextDemo.CPP"$ -$LK,"::/Demo/DolDoc/CursorMove.CPP"$ -$LK,"::/Demo/DolDoc/DemoDoc.TXT"$ -$LK,"::/Demo/Spy.CPP"$ -$LK,"::/Demo/DolDoc/FileRead.CPP"$ -$LK,"::/Demo/DolDoc/Data.CPP"$ -$LK,"::/Demo/DolDoc/DefineStr.CPP"$ -$LK,"::/Demo/DolDoc/CallBack.CPP"$ -$LK,"::/Demo/Define.CPP"$ -$LK,"EdRenumAsm",A="MN:EdRenumAsm"$ -$LK,"::/Demo/DolDoc/UnusedDefine.CPP"$ -$LK,"::/Demo/Asm/AsmHelloWorld.CPP"$ -$LK,"::/Demo/Asm/BuzzFizz.CPP"$ -$LK,"::/Demo/Asm/PutDec.CPP"$ -$LK,"::/Demo/Asm/MulByHand.CPP"$ -$LK,"::/Demo/Asm/DivByHand.CPP"$ -$LK,"::/Demo/Asm/AsmAndC1.CPP"$ -$LK,"::/Demo/Asm/AsmAndC2.CPP"$ -$LK,"::/Demo/Asm/AsmAndC3.CPP"$ -$LK,"::/Demo/GlblVars.CPP"$ -$LK,"::/Misc/OSTestSuite.CPP"$ -$MA-X+PU,"::/Adam",LM="Cd(\"::/Adam\");Dir;View;\n"$ -$ID,-2$ diff --git a/Doc/Directives.DD b/Doc/Directives.DD new file mode 100644 index 0000000..32c10eb --- /dev/null +++ b/Doc/Directives.DD @@ -0,0 +1,8 @@ +$HL,1$$WW,0$#define __DATE__ #exe{StreamPrint("\"%D\"",Now);} +#define __TIME__ #exe{StreamPrint("\"%T\"",Now);} +#define __LINE__ #exe{StreamPrint("%d",Fs->last_cc->lex_include_stk->line_num);} +#define __CMD_LINE__ #exe{StreamPrint("%d",Fs->last_cc->flags&CCF_CMD_LINE && Fs->last_cc->lex_include_stk->depth<2);} +#define __FILE__ #exe{StreamPrint("\"%s\"",Fs->last_cc->lex_include_stk->full_name);} +#define __DIR__ #exe{StreamDir;} + +See $LK,"::/Demo/Directives.HC"$.$HL,0$$WW,1$ diff --git a/Doc/Directives.TXT b/Doc/Directives.TXT deleted file mode 100644 index a5ff89e..0000000 --- a/Doc/Directives.TXT +++ /dev/null @@ -1,8 +0,0 @@ -$HL,1$$WW,0$#define __DATE__ #exe{StreamPrint("\"%D\"",Now);} -#define __TIME__ #exe{StreamPrint("\"%T\"",Now);} -#define __LINE__ #exe{StreamPrint("%d",Fs->last_cc->lex_include_stk->line_num);} -#define __CMD_LINE__ #exe{StreamPrint("%d",Fs->last_cc->flags&CCF_CMD_LINE && Fs->last_cc->lex_include_stk->depth<2);} -#define __FILE__ #exe{StreamPrint("\"%s\"",Fs->last_cc->lex_include_stk->full_name);} -#define __DIR__ #exe{StreamDir;} - -See $LK,"::/Demo/Directives.CPP"$.$HL,0$$WW,1$ diff --git a/Doc/DolDoc.DD b/Doc/DolDoc.DD new file mode 100644 index 0000000..466314e --- /dev/null +++ b/Doc/DolDoc.DD @@ -0,0 +1,3 @@ +$WW,1$A $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ in memory is a $LK,"Circular Queue",A="HI:Data Types/Circular Queue"$ of cmds and graphics. See $LK,"CDocEntry",A="MN:CDocEntry"$ for the entry structure. See $LK,"TipOfDay",A="MN:TipOfDay"$() for a nice example. + +$LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$'s are used for the editor, viewer, browser, and cmd line. diff --git a/Doc/DolDoc.TXT b/Doc/DolDoc.TXT deleted file mode 100644 index 2caec96..0000000 --- a/Doc/DolDoc.TXT +++ /dev/null @@ -1,3 +0,0 @@ -$WW,1$A $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$ in memory is a $LK,"Circular Queue",A="HI:Data Types/Circular Queue"$ of cmds and graphics. See $LK,"CDocEntry",A="MN:CDocEntry"$ for the entry structure. See $LK,"TipOfDay",A="MN:TipOfDay"$() for a nice example. - -$LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$'s are used for the editor, viewer, browser, and cmd line. diff --git a/Doc/DolDocOverview.DD b/Doc/DolDocOverview.DD new file mode 100644 index 0000000..d89d0d8 --- /dev/null +++ b/Doc/DolDocOverview.DD @@ -0,0 +1,288 @@ +$WW,1$$FG,5$$TX+CX,"DolDoc Overview"$$FG$ + +DolDoc is a TempleOS document type supported by $LK,"DolDoc Routines",A="HI:DolDoc"$. In a document, commands are bracketed with '$FG,2$$$$FG$'s. Use $FG,2$$FG$ to experiment inserting a command. Then, use $FG,2$$FG$ to toggle to plain text to see it. + +Here is the grammar: + + := $FG,2$$$$FG$<$LK,"TwoLetterCmd",A="FF:::/Adam/DolDoc/DocInit.HC,ST_DOC_CMDS"$>[][$FG,2$,$FG$]$FG,2$$$$FG$ | $FG,2$$$$FG$$LK,"ColorName",A="MN:ST_COLORS"$$FG,2$$$$FG$ + + := $FG,2$+$FG$|$FG,2$-$FG$ <$LK,"FlagCode",A="FF:::/Adam/DolDoc/DocInit.HC,ST_DOC_FLAGS"$>[$FG$] + + := <$LK,"ArgCode",A="FF:::/Adam/DolDoc/DocInit.HC,ST_DOC_FLAGS"$>$FG,2$=$FG$[$FG,2$,$FG$] + + +The format of DolDoc cmds is a two character code, +/-flags, a comma and args separated by commas. Some commands have mandatory args. Optional args are indicated with <$LK,"ArgCode",A="FF:::/Adam/DolDoc/DocInit.HC,ST_DOC_FLAGS"$>$FG,2$=$FG$. A $LK,"ColorName",A="MN:ST_COLORS"$ bracked by dollars, will change the foreground color. + +See $LK,"::/Doc/Widget.DD"$ and $LK,"::/Demo/DolDoc/DemoDoc.DD"$. + +<$LK,"TwoLetterCmd",A="FF:::/Adam/DolDoc/DocInit.HC,ST_DOC_CMDS"$> See $LK,"Type Defines",A="MN:DOCT_TEXT"$ and $LK,"PrsDollarCmd",A="MN:PrsDollarCmd"$(). +$TR,"TX Text"$ +$ID,2$Normally, text is not bracketed with '$FG,2$$$$FG$', but if you wish to specify flag attr, such as centering text, you can bracket them with '$FG,2$$$$FG$' and enter flags such as "$FG,2$+CX$FG$". You can't edit them normally if they are bracketed by '$FG,2$$$$FG$' unless you toggle to plain text mode with $FG,2$$FG$. +$ID,-2$$TR,"CR Hard New Line"$ +$ID,2$New lines are normally not bracketed with '$FG,2$$$$FG$'. +$ID,-2$$TR,"SR Soft New Line"$ +$ID,2$Word wrap uses temporary soft new lines. Users never place soft new lines. +$ID,-2$$TR,"CU Cursor pos"$ +$ID,2$The cursor pos is stored as a ASCII#5 character and is not bracketed with '$FG,2$$$$FG$'. Users normally do not enter cursor pos. +$ID,-2$$TR,"TB Tab"$ +$ID,2$Tabs are normally not bracketed with '$FG,2$$$$FG$', but are ASCII#9. +$ID,-2$$TR,"CL Clear"$ +$ID,2$Clear all prev entries except ones with hold($FG,2$+H$FG$) flags. You might want $FG,2$+H$FG$ on word wrap entries. Alternatively, you can use $LK,"DocClear",A="MN:DocClear"$(). +$ID,-2$$TR,"PB Page Break"$ +$ID,2$Page break. +$ID,-2$$TR,"PL Page Length"$ +$ID,2$Page length. +$ID,-2$$TR,"LM Left Margin"$ +$ID,2$Left margin. +$ID,-2$$TR,"RM Right Margin"$ +$ID,2$Right margin. +$ID,-2$$TR,"HD Header"$ +$ID,2$Top margin. +$ID,-2$$TR,"FO Footer"$ +$ID,2$Bottom margin. +$ID,-2$$TR,"ID Indent +/- num"$ +$ID,2$Changes the indentation deeper if positive, or shallower if negative. It effects the behavior of trees. + +$FG,2$$$ID,2$$$FG$ indents 2 columns. +$ID,-2$$TR,"Text Colors"$ +$ID,2$You place an expression(usually a color define--see $LK,"color defines",A="MN:BLACK"$) to indicate which of the 16 colors to use. If you enter no num, color returns to the default. + +$FG,2$FD$FG$ Default Foreground Color +$FG,2$BD$FG$ Default Background Color +$FG,2$FG$FG$ Foreground Color +$FG,2$BG$FG$ Background Color + +$FG,2$$$FD,BLUE$$$FG$ will set the default foreground color to BLUE. + +$ID,-2$$TR,"PT User Prompt"$ +$ID,2$Start of a user prompt. +$ID,-2$$TR,"WW Word Wrap"$ +$ID,2$Include a $FG,2$1$FG$ or $FG,2$0$FG$. + +$FG,2$$$WW,1$$$FG$ turns word-wrap on. +$ID,-2$$TR,"UL Underline"$ +$ID,2$Include a $FG,2$1$FG$ or $FG,2$0$FG$. + +$FG,2$$$UL,1$$$FG$ turns underline on. +$ID,-2$$TR,"IV Invert"$ +$ID,2$Include a $FG,2$1$FG$ or $FG,2$0$FG$. + +$FG,2$$$IV,1$$$FG$ turns invert on.$FG$ +$ID,-2$$TR,"BK Blink"$ +$ID,2$Include a $FG,2$1$FG$ or $FG,2$0$FG$. + +$FG,2$$$BK,1$$$FG$ turns blink on. +$ID,-2$$TR,"SX Shift X pos"$ +$ID,2$Include a num from $FG,2$-7$FG$ to $FG,2$7$FG$. Only foreground is shifted. Positive right. + +$FG,2$$$SX,3$$$FG$ shifts characters 3 pixels right. +$ID,-2$$TR,"SY Shift Y pos"$ +$ID,2$Include a num from $FG,2$-7$FG$ to $FG,2$7$FG$. Only foreground is shifted. Positive down. + +$FG,2$$$SY,3$$$FG$ shifts characters 3 pixels down.$FG$ +$ID,-2$$TR,"CM Cursor Movement"$ +$ID,2$This has two expressions, one for X offset and one for Y. You can remove one or the other with $FG,2$-LE$FG$ or $FG,2$-RE$FG$. + +The expressions are relative to the current cursor location, unless you make them relative to: + + $FG,2$+LX$FG$ left + $FG,2$+CX$FG$ center + $FG,2$+RX$FG$ right + $FG,2$+MRX$FG$ margin relative + + $FG,2$+TY$FG$ top + $FG,2$+CY$FG$ center + $FG,2$+BY$FG$ bottom + $FG,2$+PRY$FG$ page relative + +See $LK,"::/Demo/DolDoc/CursorMove.HC"$. + +$ID,-2$$TR,"AN Anchor"$ +$ID,2$The $LK,"CDocEntry",A="MN:CDocEntry"$.aux_str arg $FG,2$A=""$FG$ is used for the anchor. I don't use these very often, but they're good sometimes. +$ID,-2$$TR,"LK Link"$ +$ID,2$The $LK,"CDocEntry",A="MN:CDocEntry"$.aux_str arg $FG,2$A=""$FG$ is used for the link text. With no aux the tag becomes the link text, as in example 3. + +See $LK,"Link Types",A="MN:LK_FILE"$. + +Examples: to see + +1)$LK,"File link to HelpIndex.DD",A="::/Doc/HelpIndex.DD"$ +2)$LK,"File link to HelpIndex.DD with link type file",A="FI:::/Doc/HelpIndex.DD"$ +3)File link with same tag str. $LK,"::/Doc/HelpIndex.DD"$ +4)$LK,"File find link searching for 'Admin'",A="FF:::/Doc/HelpIndex.DD,Admin"$ +5)$LK,"File find link searching for 5th 'CTRL'",A="FF:::/Kernel/KernelA.HH,CTRL:5"$ +6)$LK,"Manual page link",A="MN:Print"$ +7)$LK,"File line num link",A="FL:::/Kernel/KernelA.HH,200"$ +8)$LK,"File anchor link -- to see anchor after you click",A="FA:::/Kernel/KEnd.HC,Independent HeapCtrl Example"$ +9)$LK,"Bible Link",A="BF:Acts,2:3"$ The chapter:verse actually just does a text search. +10) $LK,"Help Index Link",A="HI:Doc"$. +11) $LK,"Address Link",A="AD:0x12000"$. + +12) For in-memory document address links, see $LK,"SpriteEdText",A="MN:SpriteEdText"$(). + +$ID,-2$$TR,"BT Button"$ +$ID,2$See $LK,"::/Demo/DolDoc/MenuButton.HC"$. +$ID,-2$$TR,"DA Data"$ +$ID,2$Used for forms that prompt for data or just displaying a value. Use $FG,2$$FG$ to help you generate the DolDoc command text you need in your $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's $FG,2$fmtstr$FG$ meta-data for $LK,"DocForm",A="MN:DocForm"$(). See $LK,"::/Demo/DolDoc/Form.HC"$, $LK,"::/Demo/Dsk/DataBase.HC"$, and $LK,"::/Adam/DolDoc/DocWidgetWiz.HC"$. + +If you are not using $LK,"DocForm",A="MN:DocForm"$(), make a $FG,2$$$DA...$$$FG$ statement with $LK,"DocPrint",A="MN:DocPrint"$() and fill-in the $FG,2$->data$FG$ addr. See $LK,"task_title",A="FF:::/Adam/DolDoc/DocEd.HC,&Fs->task_title"$. + +The default raw data type for the $FG,2$$$DA...$$$FG$ command is $FG,2$RT=I64$FG$. $LK,"DocForm",A="MN:DocForm"$() will automatically reset the raw type to the value from the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's definition if you leave it set to the default. Or, if not using $LK,"DocForm",A="MN:DocForm"$(), specify a raw data type of $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFmt",A="MN:DocDataFmt"$() and $LK,"DocDataScan",A="MN:DocDataScan"$(). + +The $LK,"CDocEntry",A="MN:CDocEntry"$.aux_str arg $FG,2$A=""$FG$ is used for the print/scan format string. + +The default field length is $FG,2$LEN=64$FG$ characters. For U8 arrays[], $LK,"DocForm",A="MN:DocForm"$() will automatically reset the field length to the string length from the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's definition. The length measures starting after the ':' in the $FG,2$A=""$FG$ format string. + +The space after the first ':' in the format string marks the first valid cursor pos. See $LK,"Data Tag Width",A="FA:::/Adam/DolDoc/DocPlain.HC,DataTagWidth"$. +$ID,-2$$TR,"CB Check Box"$ +$ID,2$Used for forms. Use $FG,2$$FG$ to help you generate the DolDoc command text you need in your $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's $FG,2$fmtstr$FG$ meta-data for $LK,"DocForm",A="MN:DocForm"$(). See $LK,"::/Demo/DolDoc/Form.HC"$$FG$ and $LK,"CEdFindText",A="MN:CEdFindText"$. + +If you are not using $LK,"DocForm",A="MN:DocForm"$(), make a $FG,2$$$CB...$$$FG$ statement with $LK,"DocPrint",A="MN:DocPrint"$() and fill-in the $FG,2$->data$FG$ addr. See $LK,"task_title",A="FF:::/Adam/DolDoc/DocEd.HC,&Fs->task_title"$. + +The default raw data type for the $FG,2$$$CB...$$$FG$ command is $FG,2$RT=I8$FG$ which is $FG,2$Bool$FG$. $LK,"DocForm",A="MN:DocForm"$() will automatically reset the raw type to the value from the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's definition if you leave it set to the default. Or, if not using $LK,"DocForm",A="MN:DocForm"$(), specify a raw data type of $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFmt",A="MN:DocDataFmt"$() and $LK,"DocDataScan",A="MN:DocDataScan"$(). +$ID,-2$$TR,"LS List Widget"$ +$ID,2$Used for forms that prompt for data. You must specify a define list, $FG,2$D=""$FG$. Use $FG,2$$FG$ to help you generate the DolDoc command text you need in your $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's $FG,2$fmtstr$FG$ meta-data for $LK,"DocForm",A="MN:DocForm"$(). See $LK,"::/Demo/DolDoc/Form.HC"$. + +If you are not using $LK,"DocForm",A="MN:DocForm"$(), make a $FG,2$$$LS...$$$FG$ statement with $LK,"DocPrint",A="MN:DocPrint"$() and fill-in the data addr. See $LK,"task_title",A="FF:::/Adam/DolDoc/DocEd.HC,&Fs->task_title"$. + +The default raw data type for the $FG,2$$$LS...$$$FG$ command is $FG,2$RT=I64$FG$. $LK,"DocForm",A="MN:DocForm"$() will automatically reset the raw type to the value from the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's definition if you leave it set to the default. Or, if not using $LK,"DocForm",A="MN:DocForm"$(), specify a raw data type of $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFmt",A="MN:DocDataFmt"$() and $LK,"DocDataScan",A="MN:DocDataScan"$(). +$ID,-2$$TR,"MA Macro"$ +$ID,2$A left macro arg, $FG,2$LM=""$FG$, will send text when the left mouse is clicked. + +A left auto string, $FG,2$+LA$FG$, flag will cause text to be sent to $LK,"AutoStr",A="MN:AutoStr"$() instead of $LK,"Auto",A="MN:Auto"$(). An AutoStr runs code. Literal text is in quotes and messages are sent with $LK,"Msg",A="MN:Msg"$(). See $MA-X+PU,LM="Dir(\"::/Demo/AutoFile\");View;"$. + +Macro's are usually in your $LK,"~/PersonalMenu.DD"$ and have the '$FG,2$+X$FG$' flag set by $LK,"default",A="MN:DocInit"$. Adding '$FG,2$-X$FG$' prevents the usual $FG,2$$FG$ from being sent (which exits the PersonalMenu screen). Note: When you click a macro on the cmd line, it will go to the bottom and execute unless you cancel the $FG,2$$FG$ with a '$FG,2$-X$FG$'. +$ID,-2$$TR,"MU Menu Value"$ +$ID,2$A left expression arg, $FG,2$LE=$FG$, will return a number when clicked with the left mouse. + +See $LK,"PopUpRangeI64",A="MN:PopUpRangeI64"$(). +$ID,-2$$TR,"HX Hex Edit"$ +$ID,2$See $LK,"DocD",A="MN:DocD"$(). +$ID,-2$$TR,"TR Tree Widget"$ +$ID,2$A tree widget is a branch in a collapsable tree. The domain of the branch extends from the first +indent until enough -indents bring it back to where it started. Tree's begin collapsed unless a $FG,2$-C$FG$ flag is present. + +You might want to use $LK,"DocPrintAtomic",A="MN:DocPrintAtomic"$(). + +See $LK,"::/Demo/DolDoc/TreeDemo.HC"$. +$ID,-2$$TR,"SP Sprite"$ +$ID,2$Insert a sprite into text with $FG,2$$FG$. The cursor location at the time you press $FG,2$$FG$ is critical because the sprite will be offset from that location. This is important when adding images to programs. Numbers for sprites are automatically chosen because copying to and from the clipboard requires this. You can insert another sprite with the same image by hitting $FG,2$$FG$ and manually adding a $FG,2$$$SP...$$$FG$ entry with the same $FG,2$BI=$FG$ num. + +You can add a text tag to the $FG,2$$$SP...$$$FG$ cmd by manually adding text into the $FG,2$$$SP...$$$FG$ cmd, as in $FG,2$$$SP,"pic 2",BI=2$$$FG$. If you enter a tag of the form $FG,2$"<1>"$FG$ then the number in the tag will be updated to match the $FG,2$BI=$FG$ number. +$ID,-2$$TR,"IB Insert Binary"$ +$ID,2$Tells the compiler to insert a pointer to some binary data stored after the end of text in the document. There is just one type of binary data in DOC's at this point -- sprites -- created with $FG,2$$FG$. They have a number associated with them. This number is automatically chosen, because copying to the clip-board and back requires renuming. To use a $FG,2$$$IB...$$$FG$ cmd, toggle to plain text ($FG,2$$FG$) after inserting a sprite and check the number in the $FG,2$$$SP...$$$FG$ cmd. Create a $FG,2$$$IB...$$$FG$ cmd with the same $FG,2$BI=$FG$ number and the sprite will be inserted into the compiled stream like a string const. + +You can, optionally, include tag text to be displayed for the $FG,2$$$IB...$$$FG$ cmd. If you set the tag to "<1>", then the editor will automatically update the tag if the $FG,2$BI=$FG$ number changes. + +The reason for the $FG,2$$$IB...$$$FG$ cmd is to pass a arg to $LK,"Sprite",A="MN:Sprite"$() and $LK,"Sprite3",A="MN:Sprite3"$(). See $LK,"::/Demo/Graphics/SpritePlot.HC"$. + +$ID,-2$$TR,"IS Insert Binary Size"$ +$ID,2$Inserts a number into the compiled stream describing the size of binary data associated with a bin number. I never use this. +$ID,-2$$TR,"SO Song"$ +$ID,2$See $LK,"Play",A="MN:Play"$(). $LK,"CDocEntry",A="MN:CDocEntry"$.aux_str $FG,2$A=""$FG$ stores the song note text. +$ID,-2$$TR,"HL Highlighting"$ +$ID,2$Include a $FG,2$1$FG$ or $FG,2$0$FG$. + +$FG,2$$$HL,1$$$FG$ will turn syntax highlighting on. +$ID,-2$$TR,"HC html"$ +$ID,2$See $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$ to generate a html version of a document. You can cause html code to be injected with $FG,2$HC$FG$. Use the $FG,2$+HTML$FG$ flag to inject a html link. +$ID,-2$$TR,"ER Error"$ +$ID,2$When errors are detected in DolDoc cmds, an $FG,2$ER$FG$ entry is generated. +$ID,-2$ +<$LK,"FlagCode",A="FF:::/Adam/DolDoc/DocInit.HC,ST_DOC_FLAGS"$> See $LK,"Flag Defines",A="MN:DOCEf_LEFT_CB"$ and $LK,"Simple Flags",A="FI:::/Doc/Widget.DD"$. +$TR,"+H Hold"$ +$ID,2$Causes not to delete this cmd when cleared with $FG,2$CL$FG$ or when the doc->max_entries is exceeded. Word wrap is a good to hold. There is no way to delete these entries, at this point. +$ID,-2$$TR,"+L Link"$ +$ID,2$Make a cmd behave as a link. Perhaps, use this on a $FG,2$$$SP...$$$FG$ cmd. +$ID,-2$$TR,"+TR Tree"$ +$ID,2$Make a cmd behave as a tree branch. Usually, this is placed on a $FG,2$TX$FG$ entry. The tree extends from the start until another tree entry or when indentation has been expanded and reduced back to the starting value. + +A $FG,2$+C$FG$ flag on a tree will start it collapsed. +$ID,-2$$TR,"+LS List"$ +$ID,2$Make a cmd behave as a list widget. See above. Usually, this is placed on a $FG,2$TX$FG$ entry. +$ID,-2$$TR,"+PU PopUp"$ +$ID,2$A PopUp flag on a $FG,2$MA$FG$ will cause the cmds to run in a new task, a pop-up window. +$ID,-2$$TR,"+C Collapsed"$ +$ID,2$A collapsed flag on a $FG,2$TR$FG$ entry will cause it to start collapsed. A $FG,2$-C$FG$ flag will make it start open. +$ID,-2$$TR,"+X (Exit)"$ +$ID,2$The exit flag will cause a $FG,2$$$MA...$$$FG$ macro to send an $FG,2$$FG$ before running to exit the PersonalMenu screen and return to the cmd prompt. Actually, the default $FG,2$$$MA...$$$FG$ has an exit flag set so you add a $FG,2$-X$FG$ to turn-off $FG,2$ESC$FG$, for a $FG,2$+PU$FG$ pop-up macro. If an entry is already at the cmd prompt, the $FG,2$+X$FG$ will movement to the bottom of the window. +$ID,-2$$TR,"+Q (Abort Quit)"$ +$ID,2$A quit flag is similar to a $FG,2$+X$FG$ except a $FG,2$$FG$ instead of an $FG,2$$FG$ to exit. +$ID,-2$$TR,"+Z Zero"$ +$ID,2$A zero flag on a $FG,2$HX$FG$ entry will cause the offset from zero. A $FG,2$-X$FG$ will show the actual memory addr. By default, $FG,2$HX$FG$ has the zero flag set. +$ID,-2$$TR,"+RD Refresh Data"$ +$ID,2$The Refresh Data flag on a $FG,2$DA$FG$ or a $FG,2$CB$FG$ makes the value on the screen updated continuously. +$ID,-2$$TR,"+UD Update Data"$ +$ID,2$The Update Data flag on a $FG,2$DA$FG$ or a $FG,2$CB$FG$ makes the value in the $LK,"CDocEntry",A="MN:CDocEntry"$ updated when keys are typed on it. +$ID,-2$$TR,"+TC Tag CallBack"$ +$ID,2$See $LK,"::/Demo/DolDoc/CallBack.HC"$. +$ID,-2$$TR,"+LC Left CallBack"$ +$ID,2$See $LK,"::/Demo/DolDoc/ClickCallBack.HC"$. +$ID,-2$$TR,"+RC Right CallBack"$ +$ID,2$See $LK,"::/Demo/DolDoc/ClickCallBack.HC"$. +$ID,-2$ +<$LK,"ArgCode",A="FF:::/Adam/DolDoc/DocInit.HC,ST_DOC_FLAGS"$> See $LK,"Arg Defines",A="MN:DOCEf_TAG"$. +$TR,"T=\"\" Tag Str"$ +$ID,2$Some cmds have a tag by default. See $LK,"TX+T",A="FF:::/Adam/DolDoc/DocInit.HC,TX+T"$. You can code $FG,2$T="tag_text"$FG$ as just $FG,2$"tag_text"$FG$ with no $FG,2$T=$FG$. +$ID,-2$$TR,"LEN=\"\" Field Length"$ +$ID,2$The default field length for $FG,2$$$DA...$$$FG$ commands is $FG,2$LEN=64$FG$ characters. For U8 arrays[], $LK,"DocForm",A="MN:DocForm"$() will automatically reset the field length to the string length from the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's definition. The length measures starting after the ':' in the $FG,2$A=""$FG$ format string. + +The space after the first ':' in the format string marks the first valid cursor pos. See $LK,"Data Tag Width",A="FA:::/Adam/DolDoc/DocPlain.HC,DataTagWidth"$. +$ID,-2$$TR,"A=\"\" Auxilliary Str"$ +$ID,2$Some cmds need auxilliary strings. $FG,2$A="str"$FG$ means an $LK,"CDocEntry",A="MN:CDocEntry"$.aux_str is present. aux_str is used for song note text, link text, anchor text, and $FG,2$$$DA...$$$FG$ format string text. +$ID,-2$$TR,"D=\"\" Define Str"$ +$ID,2$A $FG,2$D=""$FG$ means either a $LK,"define",A="HI:Define"$ str indirection is present on a text widget, or a define list is present on a list widget. + +For indirection, the tag will be regenerated by substituting the value of a system $FG,2$#define$FG$ or $LK,"DefineLoad",A="MN:DefineLoad"$() string. See $LK,"::/Demo/DolDoc/DefineStr.HC"$, $LK,"::/Adam/ADefine.HC"$ and $LK,"::/Doc/MemOverview.DD"$. + +For $FG,2$LS$FG$ widgets, see $LK,"::/Demo/DolDoc/Form.HC"$. +$ID,-2$$TR,"HTML=\"\""$ +$ID,2$See $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$ to generate a html version of a document. You can cause html link on an item with $FG,2$HTML=""$FG$. +$ID,-2$$TR,"LE= Left Expression"$ +$ID,2$Left expression. $FG,2$CM$FG$ has this by default for X offset and you can leave-off the $FG,2$LE=$FG$, just putting the $FG,2$$FG$. + +See $LK,"::/Demo/DolDoc/MenuButton.HC"$. +$ID,-2$$TR,"LM=\"\" Left Macro Str"$ +$ID,2$Left macro string. +$ID,-2$$TR,"RE= Right Expression"$ +$ID,2$Right expression. $FG,2$CM$FG$ has this by default for Y offset and you can leave-off the $FG,2$RE=$FG$, just putting the $FG,2$$FG$. + +See $LK,"::/Demo/DolDoc/MenuButton.HC"$. +$ID,-2$$TR,"RM=\"\" Right Macro Str"$ +$ID,2$Right macro string. +$ID,-2$$TR,"BI= Bin Number"$ +$ID,2$Binary data item number. +$ID,-2$$TR,"BP=\"\" Bin Ptr"$ +$ID,2$The BinPtrLink flags lets you specify a filename and bin num to import a bin$FG$. + +$FG,2$$$SP,"",BI=1,BP="filename,1"$$$FG$ will import bin num "1" from filename. +$FG,2$$$SP,"<1>",BI=1,BP="::/Demo/Graphics/Mountain.HC.Z,Mountain"$$$FG$ will import bin with tag name "Mountain" from "::/Demo/Graphics/Mountain.HC.Z". +$ID,-2$$TR,"RT="$ +$ID,2$The default data-type for the $FG,2$$$DA...$$$FG$ and $FG,2$$$LS...$$$FG$ commands is $FG,2$RT=I64$FG$. If you do not specify a raw type and are using $LK,"DocForm",A="MN:DocForm"$(), it will use the $FG,2$class$FG$ member's raw type, automatically. The default for the $FG,2$$$CB...$$$FG$ command is $FG,2$RT=I8$FG$ which is $FG,2$Bool$FG$. + +If not using $LK,"DocForm",A="MN:DocForm"$(), change it to $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFmt",A="MN:DocDataFmt"$() and $LK,"DocDataScan",A="MN:DocDataScan"$(). +$ID,-2$$TR,"SX= Shift X"$ +$ID,2$Shift tag text $FG,2$+$FG$/$FG,2$- 7$FG$ X pixels off the grid. +$ID,-2$$TR,"SY= Shift Y"$ +$ID,2$Shift tag text $FG,2$+$FG$/$FG,2$- 7$FG$ Y pixels off the grid. +$ID,-2$$TR,"SCX= Scroll X"$ +$ID,2$Scroll text in a marquee of so many columns. +$ID,-2$$TR,"U= User Data"$ +$ID,2$User Data. + +See $LK,"::/Demo/DolDoc/MenuButton.HC"$. +$ID,-2$ +$FG,5$EXAMPLES: + +$FG$ to see how the following were done. +$UL,1$Underlined$UL,0$ $IV,1$Inverted$IV,0$ $BK,1$Blinking$BK,0$ $SY,-3$super$SY,0$ $SY,0$$SY,3$sub$SY,0$ +$TX,"This is a big long scrolling msg.",SCX=10$ + +$FG,5$Cursor Movements:$FG$ +$CM+LX,LE=3,RE=3$Cursor moved 3 rows down and to 3rd column from left. +$CM+RX,LE=-40,RE=3$Note mandatory comma after flags + +The following may be changed to modes instead of attr with flags. + +$TX+CX,"This is centered"$ + +$TX+RX,"This is right justified"$ diff --git a/Doc/DolDocOverview.TXT b/Doc/DolDocOverview.TXT deleted file mode 100644 index 8402d26..0000000 --- a/Doc/DolDocOverview.TXT +++ /dev/null @@ -1,288 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"DolDoc Overview"$$FG$ - -DolDoc is a TempleOS document type supported by $LK,"DolDoc Routines",A="HI:DolDoc"$. In a document, commands are bracketed with '$FG,2$$$$FG$'s. Use $FG,2$$FG$ to experiment inserting a command. Then, use $FG,2$$FG$ to toggle to plain text to see it. - -Here is the grammar: - - := $FG,2$$$$FG$<$LK,"TwoLetterCmd",A="FF:::/Adam/DolDoc/DocInit.CPP,ST_DOC_CMDS"$>[][$FG,2$,$FG$]$FG,2$$$$FG$ | $FG,2$$$$FG$$LK,"ColorName",A="MN:ST_COLORS"$$FG,2$$$$FG$ - - := $FG,2$+$FG$|$FG,2$-$FG$ <$LK,"FlagCode",A="FF:::/Adam/DolDoc/DocInit.CPP,ST_DOC_FLAGS"$>[$FG$] - - := <$LK,"ArgCode",A="FF:::/Adam/DolDoc/DocInit.CPP,ST_DOC_FLAGS"$>$FG,2$=$FG$[$FG,2$,$FG$] - - -The format of DolDoc cmds is a two character code, +/-flags, a comma and args separated by commas. Some commands have mandatory args. Optional args are indicated with <$LK,"ArgCode",A="FF:::/Adam/DolDoc/DocInit.CPP,ST_DOC_FLAGS"$>$FG,2$=$FG$. A $LK,"ColorName",A="MN:ST_COLORS"$ bracked by dollars, will change the foreground color. - -See $LK,"::/Doc/Widget.TXT"$ and $LK,"::/Demo/DolDoc/DemoDoc.TXT"$. - -<$LK,"TwoLetterCmd",A="FF:::/Adam/DolDoc/DocInit.CPP,ST_DOC_CMDS"$> See $LK,"Type Defines",A="MN:DOCT_TEXT"$ and $LK,"PrsDollarCmd",A="MN:PrsDollarCmd"$(). -$TR,"TX Text"$ -$ID,2$Normally, text is not bracketed with '$FG,2$$$$FG$', but if you wish to specify flag attr, such as centering text, you can bracket them with '$FG,2$$$$FG$' and enter flags such as "$FG,2$+CX$FG$". You can't edit them normally if they are bracketed by '$FG,2$$$$FG$' unless you toggle to plain text mode with $FG,2$$FG$. -$ID,-2$$TR,"CR Hard New Line"$ -$ID,2$New lines are normally not bracketed with '$FG,2$$$$FG$'. -$ID,-2$$TR,"SR Soft New Line"$ -$ID,2$Word wrap uses temporary soft new lines. Users never place soft new lines. -$ID,-2$$TR,"CU Cursor pos"$ -$ID,2$The cursor pos is stored as a ASCII#5 character and is not bracketed with '$FG,2$$$$FG$'. Users normally do not enter cursor pos. -$ID,-2$$TR,"TB Tab"$ -$ID,2$Tabs are normally not bracketed with '$FG,2$$$$FG$', but are ASCII#9. -$ID,-2$$TR,"CL Clear"$ -$ID,2$Clear all prev entries except ones with hold($FG,2$+H$FG$) flags. You might want $FG,2$+H$FG$ on word wrap entries. Alternatively, you can use $LK,"DocClear",A="MN:DocClear"$(). -$ID,-2$$TR,"PB Page Break"$ -$ID,2$Page break. -$ID,-2$$TR,"PL Page Length"$ -$ID,2$Page length. -$ID,-2$$TR,"LM Left Margin"$ -$ID,2$Left margin. -$ID,-2$$TR,"RM Right Margin"$ -$ID,2$Right margin. -$ID,-2$$TR,"HD Header"$ -$ID,2$Top margin. -$ID,-2$$TR,"FO Footer"$ -$ID,2$Bottom margin. -$ID,-2$$TR,"ID Indent +/- num"$ -$ID,2$Changes the indentation deeper if positive, or shallower if negative. It effects the behavior of trees. - -$FG,2$$$ID,2$$$FG$ indents 2 columns. -$ID,-2$$TR,"Text Colors"$ -$ID,2$You place an expression(usually a color define--see $LK,"color defines",A="MN:BLACK"$) to indicate which of the 16 colors to use. If you enter no num, color returns to the default. - -$FG,2$FD$FG$ Default Foreground Color -$FG,2$BD$FG$ Default Background Color -$FG,2$FG$FG$ Foreground Color -$FG,2$BG$FG$ Background Color - -$FG,2$$$FD,BLUE$$$FG$ will set the default foreground color to BLUE. - -$ID,-2$$TR,"PT User Prompt"$ -$ID,2$Start of a user prompt. -$ID,-2$$TR,"WW Word Wrap"$ -$ID,2$Include a $FG,2$1$FG$ or $FG,2$0$FG$. - -$FG,2$$$WW,1$$$FG$ turns word-wrap on. -$ID,-2$$TR,"UL Underline"$ -$ID,2$Include a $FG,2$1$FG$ or $FG,2$0$FG$. - -$FG,2$$$UL,1$$$FG$ turns underline on. -$ID,-2$$TR,"IV Invert"$ -$ID,2$Include a $FG,2$1$FG$ or $FG,2$0$FG$. - -$FG,2$$$IV,1$$$FG$ turns invert on.$FG$ -$ID,-2$$TR,"BK Blink"$ -$ID,2$Include a $FG,2$1$FG$ or $FG,2$0$FG$. - -$FG,2$$$BK,1$$$FG$ turns blink on. -$ID,-2$$TR,"SX Shift X pos"$ -$ID,2$Include a num from $FG,2$-7$FG$ to $FG,2$7$FG$. Only foreground is shifted. Positive right. - -$FG,2$$$SX,3$$$FG$ shifts characters 3 pixels right. -$ID,-2$$TR,"SY Shift Y pos"$ -$ID,2$Include a num from $FG,2$-7$FG$ to $FG,2$7$FG$. Only foreground is shifted. Positive down. - -$FG,2$$$SY,3$$$FG$ shifts characters 3 pixels down.$FG$ -$ID,-2$$TR,"CM Cursor Movement"$ -$ID,2$This has two expressions, one for X offset and one for Y. You can remove one or the other with $FG,2$-LE$FG$ or $FG,2$-RE$FG$. - -The expressions are relative to the current cursor location, unless you make them relative to: - - $FG,2$+LX$FG$ left - $FG,2$+CX$FG$ center - $FG,2$+RX$FG$ right - $FG,2$+MRX$FG$ margin relative - - $FG,2$+TY$FG$ top - $FG,2$+CY$FG$ center - $FG,2$+BY$FG$ bottom - $FG,2$+PRY$FG$ page relative - -See $LK,"::/Demo/DolDoc/CursorMove.CPP"$. - -$ID,-2$$TR,"AN Anchor"$ -$ID,2$The $LK,"CDocEntry",A="MN:CDocEntry"$.aux_str arg $FG,2$A=""$FG$ is used for the anchor. I don't use these very often, but they're good sometimes. -$ID,-2$$TR,"LK Link"$ -$ID,2$The $LK,"CDocEntry",A="MN:CDocEntry"$.aux_str arg $FG,2$A=""$FG$ is used for the link text. With no aux the tag becomes the link text, as in example 3. - -See $LK,"Link Types",A="MN:LK_FILE"$. - -Examples: to see - -1)$LK,"File link to HelpIndex.TXT",A="::/Doc/HelpIndex.TXT"$ -2)$LK,"File link to HelpIndex.TXT with link type file",A="FI:::/Doc/HelpIndex.TXT"$ -3)File link with same tag str. $LK,"::/Doc/HelpIndex.TXT"$ -4)$LK,"File find link searching for 'Admin'",A="FF:::/Doc/HelpIndex.TXT,Admin"$ -5)$LK,"File find link searching for 5th 'CTRL'",A="FF:::/Kernel/KernelA.HPP,CTRL:5"$ -6)$LK,"Manual page link",A="MN:Print"$ -7)$LK,"File line num link",A="FL:::/Kernel/KernelA.HPP,200"$ -8)$LK,"File anchor link -- to see anchor after you click",A="FA:::/Kernel/KEnd.CPP,Independent HeapCtrl Example"$ -9)$LK,"Bible Link",A="BF:Acts,2:3"$ The chapter:verse actually just does a text search. -10) $LK,"Help Index Link",A="HI:Doc"$. -11) $LK,"Address Link",A="AD:0x12000"$. - -12) For in-memory document address links, see $LK,"SpriteEdText",A="MN:SpriteEdText"$(). - -$ID,-2$$TR,"BT Button"$ -$ID,2$See $LK,"::/Demo/DolDoc/MenuButton.CPP"$. -$ID,-2$$TR,"DA Data"$ -$ID,2$Used for forms that prompt for data or just displaying a value. Use $FG,2$$FG$ to help you generate the DolDoc command text you need in your $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ $FG,2$class$FG$ member's $FG,2$fmtstr$FG$ meta-data for $LK,"DocForm",A="MN:DocForm"$(). See $LK,"::/Demo/DolDoc/Form.CPP"$, $LK,"::/Demo/Dsk/DataBase.CPP"$, and $LK,"::/Adam/DolDoc/DocWidgetWiz.CPP"$. - -If you are not using $LK,"DocForm",A="MN:DocForm"$(), make a $FG,2$$$DA...$$$FG$ statement with $LK,"DocPrint",A="MN:DocPrint"$() and fill-in the $FG,2$->data$FG$ addr. See $LK,"task_title",A="FF:::/Adam/DolDoc/DocEd.CPP,&Fs->task_title"$. - -The default raw data type for the $FG,2$$$DA...$$$FG$ command is $FG,2$RT=I64$FG$. $LK,"DocForm",A="MN:DocForm"$() will automatically reset the raw type to the value from the $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ $FG,2$class$FG$ member's definition if you leave it set to the default. Or, if not using $LK,"DocForm",A="MN:DocForm"$(), specify a raw data type of $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFmt",A="MN:DocDataFmt"$() and $LK,"DocDataScan",A="MN:DocDataScan"$(). - -The $LK,"CDocEntry",A="MN:CDocEntry"$.aux_str arg $FG,2$A=""$FG$ is used for the print/scan format string. - -The default field length is $FG,2$LEN=64$FG$ characters. For U8 arrays[], $LK,"DocForm",A="MN:DocForm"$() will automatically reset the field length to the string length from the $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ $FG,2$class$FG$ member's definition. The length measures starting after the ':' in the $FG,2$A=""$FG$ format string. - -The space after the first ':' in the format string marks the first valid cursor pos. See $LK,"Data Tag Width",A="FA:::/Adam/DolDoc/DocPlain.CPP,DataTagWidth"$. -$ID,-2$$TR,"CB Check Box"$ -$ID,2$Used for forms. Use $FG,2$$FG$ to help you generate the DolDoc command text you need in your $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ $FG,2$class$FG$ member's $FG,2$fmtstr$FG$ meta-data for $LK,"DocForm",A="MN:DocForm"$(). See $LK,"::/Demo/DolDoc/Form.CPP"$$FG$ and $LK,"CEdFindText",A="MN:CEdFindText"$. - -If you are not using $LK,"DocForm",A="MN:DocForm"$(), make a $FG,2$$$CB...$$$FG$ statement with $LK,"DocPrint",A="MN:DocPrint"$() and fill-in the $FG,2$->data$FG$ addr. See $LK,"task_title",A="FF:::/Adam/DolDoc/DocEd.CPP,&Fs->task_title"$. - -The default raw data type for the $FG,2$$$CB...$$$FG$ command is $FG,2$RT=I8$FG$ which is $FG,2$Bool$FG$. $LK,"DocForm",A="MN:DocForm"$() will automatically reset the raw type to the value from the $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ $FG,2$class$FG$ member's definition if you leave it set to the default. Or, if not using $LK,"DocForm",A="MN:DocForm"$(), specify a raw data type of $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFmt",A="MN:DocDataFmt"$() and $LK,"DocDataScan",A="MN:DocDataScan"$(). -$ID,-2$$TR,"LS List Widget"$ -$ID,2$Used for forms that prompt for data. You must specify a define list, $FG,2$D=""$FG$. Use $FG,2$$FG$ to help you generate the DolDoc command text you need in your $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ $FG,2$class$FG$ member's $FG,2$fmtstr$FG$ meta-data for $LK,"DocForm",A="MN:DocForm"$(). See $LK,"::/Demo/DolDoc/Form.CPP"$. - -If you are not using $LK,"DocForm",A="MN:DocForm"$(), make a $FG,2$$$LS...$$$FG$ statement with $LK,"DocPrint",A="MN:DocPrint"$() and fill-in the data addr. See $LK,"task_title",A="FF:::/Adam/DolDoc/DocEd.CPP,&Fs->task_title"$. - -The default raw data type for the $FG,2$$$LS...$$$FG$ command is $FG,2$RT=I64$FG$. $LK,"DocForm",A="MN:DocForm"$() will automatically reset the raw type to the value from the $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ $FG,2$class$FG$ member's definition if you leave it set to the default. Or, if not using $LK,"DocForm",A="MN:DocForm"$(), specify a raw data type of $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFmt",A="MN:DocDataFmt"$() and $LK,"DocDataScan",A="MN:DocDataScan"$(). -$ID,-2$$TR,"MA Macro"$ -$ID,2$A left macro arg, $FG,2$LM=""$FG$, will send text when the left mouse is clicked. - -A left auto string, $FG,2$+LA$FG$, flag will cause text to be sent to $LK,"AutoStr",A="MN:AutoStr"$() instead of $LK,"Auto",A="MN:Auto"$(). An AutoStr runs code. Literal text is in quotes and messages are sent with $LK,"Msg",A="MN:Msg"$(). See $MA-X+PU,LM="Dir(\"::/Demo/AutoFile\");View;"$. - -Macro's are usually in your $LK,"~/PersonalMenu.TXT"$ and have the '$FG,2$+X$FG$' flag set by $LK,"default",A="MN:DocInit"$. Adding '$FG,2$-X$FG$' prevents the usual $FG,2$$FG$ from being sent (which exits the PersonalMenu screen). Note: When you click a macro on the cmd line, it will go to the bottom and execute unless you cancel the $FG,2$$FG$ with a '$FG,2$-X$FG$'. -$ID,-2$$TR,"MU Menu Value"$ -$ID,2$A left expression arg, $FG,2$LE=$FG$, will return a number when clicked with the left mouse. - -See $LK,"PopUpRangeI64",A="MN:PopUpRangeI64"$(). -$ID,-2$$TR,"HX Hex Edit"$ -$ID,2$See $LK,"DocD",A="MN:DocD"$(). -$ID,-2$$TR,"TR Tree Widget"$ -$ID,2$A tree widget is a branch in a collapsable tree. The domain of the branch extends from the first +indent until enough -indents bring it back to where it started. Tree's begin collapsed unless a $FG,2$-C$FG$ flag is present. - -You might want to use $LK,"DocPrintAtomic",A="MN:DocPrintAtomic"$(). - -See $LK,"::/Demo/DolDoc/TreeDemo.CPP"$. -$ID,-2$$TR,"SP Sprite"$ -$ID,2$Insert a sprite into text with $FG,2$$FG$. The cursor location at the time you press $FG,2$$FG$ is critical because the sprite will be offset from that location. This is important when adding images to programs. Numbers for sprites are automatically chosen because copying to and from the clipboard requires this. You can insert another sprite with the same image by hitting $FG,2$$FG$ and manually adding a $FG,2$$$SP...$$$FG$ entry with the same $FG,2$BI=$FG$ num. - -You can add a text tag to the $FG,2$$$SP...$$$FG$ cmd by manually adding text into the $FG,2$$$SP...$$$FG$ cmd, as in $FG,2$$$SP,"pic 2",BI=2$$$FG$. If you enter a tag of the form $FG,2$"<1>"$FG$ then the number in the tag will be updated to match the $FG,2$BI=$FG$ number. -$ID,-2$$TR,"IB Insert Binary"$ -$ID,2$Tells the compiler to insert a pointer to some binary data stored after the end of text in the document. There is just one type of binary data in DOC's at this point -- sprites -- created with $FG,2$$FG$. They have a number associated with them. This number is automatically chosen, because copying to the clip-board and back requires renuming. To use a $FG,2$$$IB...$$$FG$ cmd, toggle to plain text ($FG,2$$FG$) after inserting a sprite and check the number in the $FG,2$$$SP...$$$FG$ cmd. Create a $FG,2$$$IB...$$$FG$ cmd with the same $FG,2$BI=$FG$ number and the sprite will be inserted into the compiled stream like a string const. - -You can, optionally, include tag text to be displayed for the $FG,2$$$IB...$$$FG$ cmd. If you set the tag to "<1>", then the editor will automatically update the tag if the $FG,2$BI=$FG$ number changes. - -The reason for the $FG,2$$$IB...$$$FG$ cmd is to pass a arg to $LK,"Sprite",A="MN:Sprite"$() and $LK,"Sprite3",A="MN:Sprite3"$(). See $LK,"::/Demo/Graphics/SpritePlot.CPP"$. - -$ID,-2$$TR,"IS Insert Binary Size"$ -$ID,2$Inserts a number into the compiled stream describing the size of binary data associated with a bin number. I never use this. -$ID,-2$$TR,"SO Song"$ -$ID,2$See $LK,"Play",A="MN:Play"$(). $LK,"CDocEntry",A="MN:CDocEntry"$.aux_str $FG,2$A=""$FG$ stores the song note text. -$ID,-2$$TR,"HL Highlighting"$ -$ID,2$Include a $FG,2$1$FG$ or $FG,2$0$FG$. - -$FG,2$$$HL,1$$$FG$ will turn syntax highlighting on. -$ID,-2$$TR,"HC html"$ -$ID,2$See $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.CPP"$ to generate a html version of a document. You can cause html code to be injected with $FG,2$HC$FG$. Use the $FG,2$+HTML$FG$ flag to inject a html link. -$ID,-2$$TR,"ER Error"$ -$ID,2$When errors are detected in DolDoc cmds, an $FG,2$ER$FG$ entry is generated. -$ID,-2$ -<$LK,"FlagCode",A="FF:::/Adam/DolDoc/DocInit.CPP,ST_DOC_FLAGS"$> See $LK,"Flag Defines",A="MN:DOCEf_LEFT_CB"$ and $LK,"Simple Flags",A="FI:::/Doc/Widget.TXT"$. -$TR,"+H Hold"$ -$ID,2$Causes not to delete this cmd when cleared with $FG,2$CL$FG$ or when the doc->max_entries is exceeded. Word wrap is a good to hold. There is no way to delete these entries, at this point. -$ID,-2$$TR,"+L Link"$ -$ID,2$Make a cmd behave as a link. Perhaps, use this on a $FG,2$$$SP...$$$FG$ cmd. -$ID,-2$$TR,"+TR Tree"$ -$ID,2$Make a cmd behave as a tree branch. Usually, this is placed on a $FG,2$TX$FG$ entry. The tree extends from the start until another tree entry or when indentation has been expanded and reduced back to the starting value. - -A $FG,2$+C$FG$ flag on a tree will start it collapsed. -$ID,-2$$TR,"+LS List"$ -$ID,2$Make a cmd behave as a list widget. See above. Usually, this is placed on a $FG,2$TX$FG$ entry. -$ID,-2$$TR,"+PU PopUp"$ -$ID,2$A PopUp flag on a $FG,2$MA$FG$ will cause the cmds to run in a new task, a pop-up window. -$ID,-2$$TR,"+C Collapsed"$ -$ID,2$A collapsed flag on a $FG,2$TR$FG$ entry will cause it to start collapsed. A $FG,2$-C$FG$ flag will make it start open. -$ID,-2$$TR,"+X (Exit)"$ -$ID,2$The exit flag will cause a $FG,2$$$MA...$$$FG$ macro to send an $FG,2$$FG$ before running to exit the PersonalMenu screen and return to the cmd prompt. Actually, the default $FG,2$$$MA...$$$FG$ has an exit flag set so you add a $FG,2$-X$FG$ to turn-off $FG,2$ESC$FG$, for a $FG,2$+PU$FG$ pop-up macro. If an entry is already at the cmd prompt, the $FG,2$+X$FG$ will movement to the bottom of the window. -$ID,-2$$TR,"+Q (Abort Quit)"$ -$ID,2$A quit flag is similar to a $FG,2$+X$FG$ except a $FG,2$$FG$ instead of an $FG,2$$FG$ to exit. -$ID,-2$$TR,"+Z Zero"$ -$ID,2$A zero flag on a $FG,2$HX$FG$ entry will cause the offset from zero. A $FG,2$-X$FG$ will show the actual memory addr. By default, $FG,2$HX$FG$ has the zero flag set. -$ID,-2$$TR,"+RD Refresh Data"$ -$ID,2$The Refresh Data flag on a $FG,2$DA$FG$ or a $FG,2$CB$FG$ makes the value on the screen updated continuously. -$ID,-2$$TR,"+UD Update Data"$ -$ID,2$The Update Data flag on a $FG,2$DA$FG$ or a $FG,2$CB$FG$ makes the value in the $LK,"CDocEntry",A="MN:CDocEntry"$ updated when keys are typed on it. -$ID,-2$$TR,"+TC Tag CallBack"$ -$ID,2$See $LK,"::/Demo/DolDoc/CallBack.CPP"$. -$ID,-2$$TR,"+LC Left CallBack"$ -$ID,2$See $LK,"::/Demo/DolDoc/ClickCallBack.CPP"$. -$ID,-2$$TR,"+RC Right CallBack"$ -$ID,2$See $LK,"::/Demo/DolDoc/ClickCallBack.CPP"$. -$ID,-2$ -<$LK,"ArgCode",A="FF:::/Adam/DolDoc/DocInit.CPP,ST_DOC_FLAGS"$> See $LK,"Arg Defines",A="MN:DOCEf_TAG"$. -$TR,"T=\"\" Tag Str"$ -$ID,2$Some cmds have a tag by default. See $LK,"TX+T",A="FF:::/Adam/DolDoc/DocInit.CPP,TX+T"$. You can code $FG,2$T="tag_text"$FG$ as just $FG,2$"tag_text"$FG$ with no $FG,2$T=$FG$. -$ID,-2$$TR,"LEN=\"\" Field Length"$ -$ID,2$The default field length for $FG,2$$$DA...$$$FG$ commands is $FG,2$LEN=64$FG$ characters. For U8 arrays[], $LK,"DocForm",A="MN:DocForm"$() will automatically reset the field length to the string length from the $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ $FG,2$class$FG$ member's definition. The length measures starting after the ':' in the $FG,2$A=""$FG$ format string. - -The space after the first ':' in the format string marks the first valid cursor pos. See $LK,"Data Tag Width",A="FA:::/Adam/DolDoc/DocPlain.CPP,DataTagWidth"$. -$ID,-2$$TR,"A=\"\" Auxilliary Str"$ -$ID,2$Some cmds need auxilliary strings. $FG,2$A="str"$FG$ means an $LK,"CDocEntry",A="MN:CDocEntry"$.aux_str is present. aux_str is used for song note text, link text, anchor text, and $FG,2$$$DA...$$$FG$ format string text. -$ID,-2$$TR,"D=\"\" Define Str"$ -$ID,2$A $FG,2$D=""$FG$ means either a $LK,"define",A="HI:Define"$ str indirection is present on a text widget, or a define list is present on a list widget. - -For indirection, the tag will be regenerated by substituting the value of a system $FG,2$#define$FG$ or $LK,"DefineLoad",A="MN:DefineLoad"$() string. See $LK,"::/Demo/DolDoc/DefineStr.CPP"$, $LK,"::/Adam/ADefine.CPP"$ and $LK,"::/Doc/MemOverview.TXT"$. - -For $FG,2$LS$FG$ widgets, see $LK,"::/Demo/DolDoc/Form.CPP"$. -$ID,-2$$TR,"HTML=\"\""$ -$ID,2$See $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.CPP"$ to generate a html version of a document. You can cause html link on an item with $FG,2$HTML=""$FG$. -$ID,-2$$TR,"LE= Left Expression"$ -$ID,2$Left expression. $FG,2$CM$FG$ has this by default for X offset and you can leave-off the $FG,2$LE=$FG$, just putting the $FG,2$$FG$. - -See $LK,"::/Demo/DolDoc/MenuButton.CPP"$. -$ID,-2$$TR,"LM=\"\" Left Macro Str"$ -$ID,2$Left macro string. -$ID,-2$$TR,"RE= Right Expression"$ -$ID,2$Right expression. $FG,2$CM$FG$ has this by default for Y offset and you can leave-off the $FG,2$RE=$FG$, just putting the $FG,2$$FG$. - -See $LK,"::/Demo/DolDoc/MenuButton.CPP"$. -$ID,-2$$TR,"RM=\"\" Right Macro Str"$ -$ID,2$Right macro string. -$ID,-2$$TR,"BI= Bin Number"$ -$ID,2$Binary data item number. -$ID,-2$$TR,"BP=\"\" Bin Ptr"$ -$ID,2$The BinPtrLink flags lets you specify a filename and bin num to import a bin$FG$. - -$FG,2$$$SP,"",BI=1,BP="filename,1"$$$FG$ will import bin num "1" from filename. -$FG,2$$$SP,"<1>",BI=1,BP="::/Demo/Graphics/Mountain.CPP.Z,Mountain"$$$FG$ will import bin with tag name "Mountain" from "::/Demo/Graphics/Mountain.CPP.Z". -$ID,-2$$TR,"RT="$ -$ID,2$The default data-type for the $FG,2$$$DA...$$$FG$ and $FG,2$$$LS...$$$FG$ commands is $FG,2$RT=I64$FG$. If you do not specify a raw type and are using $LK,"DocForm",A="MN:DocForm"$(), it will use the $FG,2$class$FG$ member's raw type, automatically. The default for the $FG,2$$$CB...$$$FG$ command is $FG,2$RT=I8$FG$ which is $FG,2$Bool$FG$. - -If not using $LK,"DocForm",A="MN:DocForm"$(), change it to $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFmt",A="MN:DocDataFmt"$() and $LK,"DocDataScan",A="MN:DocDataScan"$(). -$ID,-2$$TR,"SX= Shift X"$ -$ID,2$Shift tag text $FG,2$+$FG$/$FG,2$- 7$FG$ X pixels off the grid. -$ID,-2$$TR,"SY= Shift Y"$ -$ID,2$Shift tag text $FG,2$+$FG$/$FG,2$- 7$FG$ Y pixels off the grid. -$ID,-2$$TR,"SCX= Scroll X"$ -$ID,2$Scroll text in a marquee of so many columns. -$ID,-2$$TR,"U= User Data"$ -$ID,2$User Data. - -See $LK,"::/Demo/DolDoc/MenuButton.CPP"$. -$ID,-2$ -$FG,5$EXAMPLES: - -$FG$ to see how the following were done. -$UL,1$Underlined$UL,0$ $IV,1$Inverted$IV,0$ $BK,1$Blinking$BK,0$ $SY,-3$super$SY,0$ $SY,0$$SY,3$sub$SY,0$ -$TX,"This is a big long scrolling msg.",SCX=10$ - -$FG,5$Cursor Movements:$FG$ -$CM+LX,LE=3,RE=3$Cursor moved 3 rows down and to 3rd column from left. -$CM+RX,LE=-40,RE=3$Note mandatory comma after flags - -The following may be changed to modes instead of attr with flags. - -$TX+CX,"This is centered"$ - -$TX+RX,"This is right justified"$ diff --git a/Doc/EdPullDown.DD b/Doc/EdPullDown.DD new file mode 100644 index 0000000..95255c9 --- /dev/null +++ b/Doc/EdPullDown.DD @@ -0,0 +1,77 @@ +File +{ + Save(,CH_CTRLS); + SaveAs(,CH_CTRLA); + Abort(,CH_SHIFT_ESC); + Exit(,CH_ESC); +} + +Edit +{ + Undo(,CH_CTRLH,0x80E0000080E); + Cut(,CH_CTRLX); + Copy(,CH_CTRLC); + Paste(,CH_CTRLV); + DelLine(,CH_CTRLY); + FindReplace(,CH_CTRLF); + FindNext(,,0x3D0000003D); + FindLast(,,0x23D0000023D); + GoLine(,CH_CTRLG,0x42200000422); + GoBegin(,,0x4C800000448); + GoEnd(,,0x4D000000450); + GoLeft(,,0x4CB0000044B); + GoRight(,,0x4CD0000044D); + GoLBrace(,0x5B,0x61A0000061A); + GoRBrace(,0x5D,0x61B0000061B); + Macro(,,0x3C0000003C); + PlayMacro(,,0x23C0000023C); +} + +Insert +{ + TextWidgets(,CH_CTRLL,0x42600000426); + GraphicResource(,CH_CTRLR,0x41300000413); + FileName(,,0x3E0000003E); + DirName(,,0x23E0000023E); + GodWord(,,0x4100000041); + GodBiblePassage(,,0x24100000241); + GodSong(,,0x4000000040); + GodDoodle(,,0x24000000240); + IndentIn(,CH_CTRLI,0x41700000417); + IndentOut(,CH_CTRLI,0x61700000617); + WordWrapOn(,CH_CTRLW,0x41100000411); + WordWrapOff(,CH_CTRLW,0x61100000611); + UnderlineOn(,CH_CTRLU,0x41600000416); + UnderlineOff(,CH_CTRLU,0x61600000616); + BlinkOn(,CH_CTRLK,0x42500000425); + BlinkOff(2,CH_CTRLK,0x62500000625); + InvertOn(,CH_CTRLZ,0x42C0000042C); + InvertOff(,CH_CTRLZ,0x62C0000062C); + SuperToggle(,CH_CTRLP,0x41900000419); + SubToggle(,CH_CTRLP,0x61900000619); + PageBreak(,CH_CTRLJ,0x41C0000041C); +} + +Program +{ + CodeTools(,CH_CTRLL,0x62600000626); + Include(,0,0x3F0000003F); + AdamInclude(,0,0x23F0000023F); +} + +View +{ + PlainText(,CH_CTRLT); + Collapse(,CH_CTRLO,0x61800000618); + Uncollapse(,CH_CTRLO,0x41800000418); + Border(,CH_CTRLB); + FileMgr(,CH_CTRLD,0x42000000420); + Search(,CH_CTRLF,0x62100000621); +} + +Help +{ + Menu(,CH_CTRLM,0x43200000432); + Help(,,0x3B0000003B); + About(,,0x23B0000023B); +} diff --git a/Doc/EdPullDown.TXT b/Doc/EdPullDown.TXT deleted file mode 100644 index 8438283..0000000 --- a/Doc/EdPullDown.TXT +++ /dev/null @@ -1,77 +0,0 @@ -File -{ - Save(,CH_CTRLS); - SaveAs(,CH_CTRLA); - Abort(,CH_SHIFT_ESC); - Exit(,CH_ESC); -} - -Edit -{ - Undo(,CH_CTRLH,0x80E0000080E); - Cut(,CH_CTRLX); - Copy(,CH_CTRLC); - Paste(,CH_CTRLV); - DelLine(,CH_CTRLY); - FindReplace(,CH_CTRLF); - FindNext(,,0x3D0000003D); - FindLast(,,0x23D0000023D); - GoLine(,CH_CTRLG,0x42200000422); - GoBegin(,,0x4C800000448); - GoEnd(,,0x4D000000450); - GoLeft(,,0x4CB0000044B); - GoRight(,,0x4CD0000044D); - GoLBrace(,0x5B,0x61A0000061A); - GoRBrace(,0x5D,0x61B0000061B); - Macro(,,0x3C0000003C); - PlayMacro(,,0x23C0000023C); -} - -Insert -{ - TextWidgets(,CH_CTRLL,0x42600000426); - GraphicResource(,CH_CTRLR,0x41300000413); - FileName(,,0x3E0000003E); - DirName(,,0x23E0000023E); - GodWord(,,0x4100000041); - GodPassage(,,0x24100000241); - GodSong(,,0x4000000040); - GodDoodle(,,0x24000000240); - IndentIn(,CH_CTRLI,0x41700000417); - IndentOut(,CH_CTRLI,0x61700000617); - WordWrapOn(,CH_CTRLW,0x41100000411); - WordWrapOff(,CH_CTRLW,0x61100000611); - UnderlineOn(,CH_CTRLU,0x41600000416); - UnderlineOff(,CH_CTRLU,0x61600000616); - BlinkOn(,CH_CTRLK,0x42500000425); - BlinkOff(2,CH_CTRLK,0x62500000625); - InvertOn(,CH_CTRLZ,0x42C0000042C); - InvertOff(,CH_CTRLZ,0x62C0000062C); - SuperToggle(,CH_CTRLP,0x41900000419); - SubToggle(,CH_CTRLP,0x61900000619); - PageBreak(,CH_CTRLJ,0x41C0000041C); -} - -Program -{ - CodeTools(,CH_CTRLL,0x62600000626); - Include(,0,0x3F0000003F); - AdamInclude(,0,0x23F0000023F); -} - -View -{ - PlainText(,CH_CTRLT); - Collapse(,CH_CTRLO,0x61800000618); - Uncollapse(,CH_CTRLO,0x41800000418); - Border(,CH_CTRLB); - FileMgr(,CH_CTRLD,0x42000000420); - Search(,CH_CTRLF,0x62100000621); -} - -Help -{ - Menu(,CH_CTRLM,0x43200000432); - Help(,,0x3B0000003B); - About(,,0x23B0000023B); -} diff --git a/Doc/FAQ.DD b/Doc/FAQ.DD new file mode 100644 index 0000000..0ca2180 --- /dev/null +++ b/Doc/FAQ.DD @@ -0,0 +1,96 @@ +$WW,1$$FG,5$$TX+CX,"Frequently Asked Questions"$$FG$ + +$TR,"How come it is public domain, not GPL?"$ +$ID,2$I, $FG,2$Terry A. Davis$FG$, wrote all $TX,"118,851",D="DD_TEMPLEOS_LOC"$ lines of TempleOS over the past $TX,"12.5",D="DD_TEMPLEOS_AGE"$ years (full-time). It can run on some bare metal 64-bit PC's from about 2005-2010 with no layering, libraries, tools, modules or anything from other sources. Otherwise, you run it in a virtual machine, like $FG,2$VMware$FG$, $FG,2$QEMU$FG$ or $FG,2$VirtualBox$FG$. It is independent and stands alone. It has no networking, so it certainly doesn't call home. 100% of the src code is including on all distro's, from the kernel to the compiler to the boot loaders! See $LK,"::/Doc/Credits.DD"$. +$ID,-2$$TR,"Shouldn't it be GNU/TempleOS?"$ +$ID,2$TempleOS executes no code not written by me at any time except for a few $FG,2$BIOS$FG$ calls for configuration. I even wrote boot-loaders, so I do not need Grub. See $LK,"::/Doc/Credits.DD"$. +$ID,-2$$TR,"Don't you use GNU's gcc?"$ +$ID,2$TempleOS was written from scratch, starting with $FG,2$TASM$FG$ long ago, launching from real-mode DOS. Now, there is no $FG,2$Linux$FG$ or $FG,2$GNU$FG$ or any other code in TempleOS. Yes, I wrote the compiler from scratch. See $LK,"::/Doc/Credits.DD"$. +$ID,-2$$TR,"Why do you dual boot?"$ +$ID,2$TempleOS is 100% independent -- it does not access the files of your primary operating system and TempleOS will work as the only operating system on your computer, but it has no networking. In your off hours, you will use your other operating system. +$ID,-2$$TR,"It has links, so is it a browser?"$ +$ID,2$TempleOS is an operating system, not a browser. $LK,"TempleOS links",A="MN:LK_FILE"$ are a special format and only link too local files and symbol source addresses. +$ID,-2$$TR,"Where are the animated 3D icon GIFs?"$ +$ID,2$3D $LK,"Sprites",A="FI:::/Doc/Sprite.DD"$ are stored as a mesh of triangles. There are no GIF files. It $LK,"rotates",A="MN:Mat4x4MulXYZ"$ 3D sprite objects on the fly. +$ID,-2$$TR,"If the compiler is JIT, isn't it an interpretor?"$ +$ID,2$TempleOS compiles, doesn't $FG,2$interpret$FG$, and uses no $FG,2$byte code$FG$ anywhere. I loosely use the word $FG,2$script$FG$ sometimes, but it's actually compiled. The compiler's $LK,"optimization",A="MN:OptPass012"$ code is actually where the compiler evaluates constants to simplify them, like every optimizing compiler. +$ID,-2$$TR,"Are you a Creationist?"$ +$ID,2$I am an evolutionist. $FG,2$Adam$FG$ is a better term for the first father of all tasks than $FG,2$root$FG$ was! +$ID,-2$$TR,"Is 'Bt()' in the code Bit Torrent?"$ +$ID,2$$LK,"Bt",A="MN:Bt"$() is $FG,2$bit test$FG$, like the $FG,2$x86$FG$ inst, not $FG,2$bit torrent$FG$. +$ID,-2$$TR,"Is 'Fs->' in the code file system?"$ +$ID,2$$LK,"Fs",A="MN:Fs"$ is a segment reg, not $FG,2$file system$FG$. ($LK,"Fs",A="MN:Fs"$ is kept pointing to the current task's record.) There is no memory segmentation. It is 64-bit and flat. FS and GS are used as general purpose regs, more or less. +$ID,-2$$TR,"Is it Pascal?"$ +$ID,2$TempleOS uses a dialect of C/C++ called $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$. It is not $FG,2$Pascal$FG$. I altered the syntax making parenthesis optional on function calls with no paramaters. +$ID,-2$$TR,"Why doesn't Sleep() make my laptop hibernate?"$ +$ID,2$$LK,"Sleep",A="MN:Sleep"$() makes a program pause. It is not hibernation for a laptop. +$ID,-2$$TR,"What is Yield() for in loops?"$ +$ID,2$$LK,"Yield",A="MN:Yield"$() saves the current task's regs (context) and loads in the next task. In a loop waiting for disk IO, it executes $LK,"Yield",A="MN:Yield"$() which pegs the CPU load, yet the system is responsive. +$ID,-2$$TR,"What is JIT Compiled Mode?"$ +$ID,2$The term $LK,"JIT Compile Mode",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$ means it compiles and executes code placed into mem, not stored on disk. +$ID,-2$$TR,"Why do files end in .Z? Are they encrypted?"$ +$ID,2$Files with names ending in $FG,2$.Z$FG$ are individually compressed using $LK,"TempleOS Compression",A="FI:::/Kernel/Compress.HC"$. They are not encrypted. $LK,"Copy",A="MN:Copy"$() or rename them with $LK,"Move",A="MN:Move"$() to a name without $FG,2$.Z$FG$ and they will be stored in an uncompressed form. See $LK,"TOSZ",A="FI:::/Doc/TOSZ.DD"$ for Linux or Windows uncompress C/C++ code. +$ID,-2$$TR,"Is it open source? How do I build it?"$ +$ID,2$TempleOS is 100% open src. All the src code is included in the distro. Use $LK,"BootHDIns",A="MN:BootHDIns"$() to compile the kernel and compiler. The rest is $LK,"JIT Compiled",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$ during boot. See $LK,"::/StartOS.HC"$. +$ID,-2$$TR,"Where are object files? How do I link?"$ +$ID,2$TempleOS does not use object files or a linker. $LK,"AOT Compile Mode",A="FF:::/Doc/Glossary.DD,AOT Compile Mode"$ is used to directly create flat binary files, $FG,2$/Kernel.BIN.C$FG$ and $FG,2$/Compiler/Compiler.BIN.Z$FG$ with no object files and linking.$FG$ $LK,"JIT Compile Mode",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$ place code in memory, ready to run, with no object files or linking. Linking is done when $FG,2$BIN$FG$ modules are $LK,"Load",A="MN:Load"$()ed. +$ID,-2$$TR,"What is the FPS refresh rate?"$ +$ID,2$The refresh rate is $TX,"30",D="WINMGR_FPS"$ frames-per-second. That is how often TempleOS updates screen mem. It is not syncronized to the hardware. +$ID,-2$$TR,"How does a task own the speaker?"$ +$ID,2$No task or application has a lock on the speaker so apps will interfere with each other. +$ID,-2$$TR,"Why does it leak memory?"$ +$ID,2$TempleOS allocs mem as more items are displayed in the window. Also, TempleOS allocs mem for code as it is compiled at the cmd line. If you $FG,2$#include$FG$ a file twice, it allocs more mem for it. If you have a 50,000 line program with each line taking twenty bytes on a machine with 1 Gig, you could $FG,2$#include$FG$ it a thousand times if it had no data or graphics and no other use of mem. If it bothers you, hit $FG,2$$FG$ and $FG,2$, $FG$periodically, to kill and recreate the task$FG$. Use the pop-up flag on macros in your $LK,"PersonalMenu",A="FI:::Home/PersonalMenu.DD"$ to spawn new tasks, run applications and free the applications when they are finished. Small mem chunks stick to the task when they are freed until it is killed. The only way to get in trouble is allocating multiple Meg chunks and freeing them. These can only be reused if the same size gets alloced again. Use $LK,"HeapLog",A="MN:HeapLog"$(), $LK,"HeapLogAddrRep",A="MN:HeapLogAddrRep"$() and $LK,"HeapLogSizeRep",A="MN:HeapLogSizeRep"$() to see who alloced mem and didn't free it. See $LK,"MemOverview",A="FI:::/Doc/MemOverview.DD"$. +$ID,-2$$TR,"Why do I get a memory leak when editing big files?"$ +$ID,2$The editor periodically takes a snap-shot of the document for $FG,2$UNDO$FG$ and this looks like a memory leak. +$ID,-2$$TR,"Why is it in text mode?"$ +$ID,2$TempleOS runs in $FG,2$VGA 640x480 16 color$FG$ graphics mode, not text mode. It changes to this mode with a $LK,"BIOS call",A="FF:::/Kernel/KStart16.HC,INT 0x10"$ while in real-mode before it switches to 64-bit mode. The text is $LK,"drawn by hand",A="MN:GrUpdateTextFG"$. See $LK,"::/Kernel/FontStd.HC"$. If graphics mode fails, it falls-back on text mode. You can force text mode with an $LK,"Kernel config",A="FI:::/Kernel/KCfg.HC"$ option. +$ID,-2$$TR,"Where is the kernel memory?"$ +$ID,2$TempleOS identity-maps all memory, all the time. It is like paging is not used. There is no special kernel $FG,2$high half$FG$ memory space. TempleOS is ring-0-only, so everything is kernel, even user programs. There is a special task called $FG,2$Adam$FG$ and he doesn't die, so his heap never gets freed. That's as close to $FG,2$kernel memory$FG$ as it gets. All code goes in the lowest 2 Gig of addresses, known as the $LK,"Code Heap",A="FF:::/Doc/Glossary.DD,Code and Data Heaps"$, so that the $FG,2$REL32$FG$ addressing mode can be used. See $LK,"MemOverview",A="FI:::/Doc/MemOverview.DD"$. +$ID,-2$$TR,"Why does it run code from stack addresses?"$ +$ID,2$TempleOS puts all code in the lowest 2 Gig, known as the $LK,"Code Heap",A="FF:::/Doc/Glossary.DD,Code and Data Heaps"$, so that the $FG,2$REL32$FG$ addressing mode can be used. TempleOS is 64-bit, but $FG,2$2 Gig$FG$ is enough for code. It actually puts global variables there, too, but you can turn that off with $LK,"OPTf_GLBLS_ON_DATA_HEAP",A="MN:OPTf_GLBLS_ON_DATA_HEAP"$. $LK,"MAlloc",A="MN:MAlloc"$() allocs higher memory. +$ID,-2$$TR,"How does it SYSCALL?"$ +$ID,2$TempleOS doesn't use software interrupts or $FG,2$SYSCALL$FG$ insts because it never needs to change out of ring-0, even running user programs. Calls are always $FG,2$CALL REL32$FG$ insts. +$ID,-2$$TR,"How do you fault-in stack?"$ +$ID,2$The stack does not grow, so do not do deep recursion. In theory, memory gets fragmented, too. +$ID,-2$$TR,"How do I set the PATH?"$ +$ID,2$There is no $FG,2$PATH$FG$. You do not enter filenames at the command-line and expect them to run. You enter C-like code. $LK,"Get Started Here",A="FI:::/Doc/CmdLineOverview.DD"$. +$ID,-2$$TR,"How do I boot it with Grub?"$ +$ID,2$If you use Grub, you $FG,2$chain-load$FG$ like Windows. See $LK,"Boot",A="FI:::/Doc/Boot.DD"$. You can use the TempleOS boot-loader. $LK,"Master-Boot-Loader-Stage1",A="FI:::/Adam/Opt/Boot/BootMHD.HC"$, $LK,"Master-Boot-Loader-Stage2",A="FI:::/Adam/Opt/Boot/BootMHD2.HC"$, $LK,"Partition-Boot-Loader",A="FI:::/Adam/Opt/Boot/BootHD.HC"$, $LK,"CD-DVD-Boot-Loader",A="FI:::/Adam/Opt/Boot/BootDVD.HC"$. +$ID,-2$$TR,"How do I get Kernel.BIN to boot?"$ +$ID,2$The boot-loaders must be patched by you running $LK,"BootHDIns",A="MN:BootHDIns"$() or $LK,"BootMHDIns",A="MN:BootMHDIns"$(). Those will write the block address into the boot-loader because the boot-loaders do not navigate file systems to find the $LK,"Stage2",A="FI:::/Kernel/KStart16.HC"$ if you relocate it. +$ID,-2$$TR,"Why is there some 16-Bit code?"$ +$ID,2$TempleOS is 64-bit. Like all PC operating systems, the boot-loader starts in 16-bit real-mode. TempleOS calls a few $FG,2$BIOS$FG$ info routines, switches to VGA-640x480x4bit, switches to 32-bit, then, 64-bit mode. There is an odd thing called a $FG,2$$TX,"PCI BIOS",HTML="http://www.o3one.org/hwdocs/bios_doc/pci_bios_21.pdf"$$FG$ which is 32-bit used for $FG,2$PCI$FG$ config space access. TempleOS calls $LK,"that",A="FI:::/Kernel/PCIBIOS.HC"$ a couple times. It must temporarily drop-out-of 64-bit mode for that and stop multi-tasking. +$ID,-2$$TR,"Why are you pushing 32-bit values on the stack?"$ +$ID,2$$FG,2$PUSH EAX$FG$ : All stack operations in 64-bit mode are 64-bits. +$ID,-2$$TR,"Why are you using 32-bit insts and not setting high 32-bits?"$ +$ID,2$$FG,2$XOR EAX,EAX$FG$ : Operations on 32-bit regs clear the high 32-bits. +$ID,-2$$TR,"How do you use the FS and GS segment registers."$ +$ID,2$$FG,2$MOV RAX,FS:[RAX]$FG$ : FS can be set with a $FG,2$WRMSR$FG$, but displacement is RIP relative, so it's tricky to use. FS is used for the current $LK,"CTask",A="MN:CTask"$, GS for $LK,"CCPU",A="MN:CCPU"$. +$ID,-2$$TR,"How do I set ORG for position of code?"$ +$ID,2$The compiler creates $FG,2$pos independent$FG$ code. Don't create code which is loaded at a fixed, specified location. Code in a BIN file is $FG,2$pos independent$FG$ by virtue of a table in the BIN file for patching absolute addresses. +$ID,-2$$TR,"How are symbols loaded?"$ +$ID,2$Binary executable files have export syms which are loaded into the sym tables. The operating system $FG,2$Kernel$FG$ has such an export table. In addition, some map files are processed to provide more information on syms -- src file links. This is how the $LK,"Man",A="MN:Man"$()/$FG,2$AutoComplete$FG$ feature can find src lines. +$ID,-2$$TR,"Why doesn't assert work?"$ +$ID,2$$FG,2$#assert$FG$ might print a message at COMPILE time, not run time. +$ID,-2$$TR,"Why doesn't C++ public work?"$ +$ID,2$The word $FG,2$public$FG$ in $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ does very little except allow the $LK,"Help & Index",A="FI:::/Doc/HelpIndex.DD"$ and $LK,"Who",A="MN:Who"$() to exclude meaningless syms. If you wish a full report of public and nonpublic syms $MA-X+PU,"Click Here",LM="DocMax(1000000);Who;View;\n"$. +$ID,-2$$TR,"How does the debugger do source debugging?"$ +$ID,2$When compilation takes place, the structures used by the compiler stick around. Data on classes can be accessed. See $LK,"ClassRep",A="MN:ClassRep"$(). +$ID,-2$$TR,"What are the ASCII 5 and ASCII 31 chars doing in my text files?"$ +$ID,2$The cursor location is stored as an $FG,2$ASCII 5$FG$ in files. $FG,2$ASCII 31$FG$ is $FG,2$SHIFT-SPACE$FG$, a character which does not get converted to tabs by space-to-tabs, $LK,"S2T",A="MN:S2T"$(). The $FG,2$ASCII 28$FG$ is $FG,2$SHIFT-ESC$FG$. +$ID,-2$$TR,"Why is there garbage at the end of my text files?"$ +$ID,2$Binary sprite data is stored beyond the terminating $FG,2$NULL$FG$ in text files. Map files store debug src line addresses. +$ID,-2$$TR,"Why are sprites so small?"$ +$ID,2$Sprites can be stored as vector graphics so they might take shockingly little room. They can be converted to bitmaps. +$ID,-2$$TR,"Why don't I need to recompile /Adam and /Home files?"$ +$ID,2$If you change code in the $FG,2$/Adam$FG$ or your $FG,2$/Home$FG$ directory, you don't need to recompile, you just need to reboot because those directories get recompiled when you boot. It uses $LK,"JIT Compile Mode",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$. There is no $FG,2$.BIN$FG$ file for $FG,2$JIT$FG$ compilation. See $LK,"::/StartOS.HC"$. +$ID,-2$$TR,"Why does it finds files that aren't there?"$ +$ID,2$If not found, $FG,2$.Z$FG$ is added or removed from filename and a search is done again. If a file is still not found, the parent directories are searched for a file of the same name. +$ID,-2$ +$FG,8$ +* "Windows" is a trademark owned by MicroSoft Corp. +* "Linux" is a trademark owned by Linus Torvalds. +* "QEMU" is a trademark owned by Fabrice Bellard. +* "VMware" is a trademark owned by VMware, Inc. +* "VirtualBox" is a trademark owned by Oracle. +$FG$ \ No newline at end of file diff --git a/Doc/FAQ.TXT b/Doc/FAQ.TXT deleted file mode 100644 index 24a4d06..0000000 --- a/Doc/FAQ.TXT +++ /dev/null @@ -1,96 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"Frequently Asked Questions"$$FG$ - -$TR,"How come it is public domain, not GPL?"$ -$ID,2$I, $FG,2$Terry A. Davis$FG$, wrote all $TX,"118,851",D="DD_TEMPLEOS_LOC"$ lines of TempleOS over the past $TX,"12.5",D="DD_TEMPLEOS_AGE"$ years (full-time). It can run on some bare metal 64-bit PC's from about 2005-2010 with no layering, libraries, tools, modules or anything from other sources. Otherwise, you run it in a virtual machine, like $FG,2$VMware$FG$, $FG,2$QEMU$FG$ or $FG,2$VirtualBox$FG$. It is independent and stands alone. It has no networking, so it certainly doesn't call home. 100% of the src code is including on all distro's, from the kernel to the compiler to the boot loaders! See $LK,"::/Doc/Credits.TXT"$. -$ID,-2$$TR,"Shouldn't it be GNU/TempleOS?"$ -$ID,2$TempleOS executes no code not written by me at any time except for a few $FG,2$BIOS$FG$ calls for configuration. I even wrote boot-loaders, so I do not need Grub. See $LK,"::/Doc/Credits.TXT"$. -$ID,-2$$TR,"Don't you use GNU's gcc?"$ -$ID,2$TempleOS was written from scratch, starting with $FG,2$TASM$FG$ long ago, launching from real-mode DOS. Now, there is no $FG,2$Linux$FG$ or $FG,2$GNU$FG$ or any other code in TempleOS. Yes, I wrote the compiler from scratch. See $LK,"::/Doc/Credits.TXT"$. -$ID,-2$$TR,"Why do you dual boot?"$ -$ID,2$TempleOS is 100% independent -- it does not access the files of your primary operating system and TempleOS will work as the only operating system on your computer, but it has no networking. In your off hours, you will use your other operating system. -$ID,-2$$TR,"It has links, so is it a browser?"$ -$ID,2$TempleOS is an operating system, not a browser. $LK,"TempleOS links",A="MN:LK_FILE"$ are a special format and only link too local files and symbol source addresses. -$ID,-2$$TR,"Where are the animated 3D icon GIFs?"$ -$ID,2$3D $LK,"Sprites",A="FI:::/Doc/Sprite.TXT"$ are stored as a mesh of triangles. There are no GIF files. It $LK,"rotates",A="MN:Mat4x4MulXYZ"$ 3D sprite objects on the fly. -$ID,-2$$TR,"If the compiler is JIT, isn't it an interpretor?"$ -$ID,2$TempleOS compiles, doesn't $FG,2$interpret$FG$, and uses no $FG,2$byte code$FG$ anywhere. I loosely use the word $FG,2$script$FG$ sometimes, but it's actually compiled. The compiler's $LK,"optimization",A="MN:OptPass012"$ code is actually where the compiler evaluates constants to simplify them, like every optimizing compiler. -$ID,-2$$TR,"Are you a Creationist?"$ -$ID,2$I am an evolutionist. $FG,2$Adam$FG$ is a better term for the first father of all tasks than $FG,2$root$FG$ was! -$ID,-2$$TR,"Is 'Bt()' in the code Bit Torrent?"$ -$ID,2$$LK,"Bt",A="MN:Bt"$() is $FG,2$bit test$FG$, like the $FG,2$x86$FG$ inst, not $FG,2$bit torrent$FG$. -$ID,-2$$TR,"Is 'Fs->' in the code file system?"$ -$ID,2$$LK,"Fs",A="MN:Fs"$ is a segment reg, not $FG,2$file system$FG$. ($LK,"Fs",A="MN:Fs"$ is kept pointing to the current task's record.) There is no memory segmentation. It is 64-bit and flat. FS and GS are used as general purpose regs, more or less. -$ID,-2$$TR,"Is it Pascal?"$ -$ID,2$TempleOS uses a dialect of C/C++ called $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$. It is not $FG,2$Pascal$FG$. I altered the syntax making parenthesis optional on function calls with no paramaters. -$ID,-2$$TR,"Why doesn't Sleep() make my laptop hibernate?"$ -$ID,2$$LK,"Sleep",A="MN:Sleep"$() makes a program pause. It is not hibernation for a laptop. -$ID,-2$$TR,"What is Yield() for in loops?"$ -$ID,2$$LK,"Yield",A="MN:Yield"$() saves the current task's regs (context) and loads in the next task. In a loop waiting for disk IO, it executes $LK,"Yield",A="MN:Yield"$() which pegs the CPU load, yet the system is responsive. -$ID,-2$$TR,"What is JIT Compiled Mode?"$ -$ID,2$The term $LK,"JIT Compile Mode",A="FF:::/Doc/Glossary.TXT,JIT Compile Mode"$ means it compiles and executes code placed into mem, not stored on disk. -$ID,-2$$TR,"Why do files end in .Z? Are they encrypted?"$ -$ID,2$Files with names ending in $FG,2$.Z$FG$ are individually compressed using $LK,"TempleOS Compression",A="FI:::/Kernel/Compress.CPP"$. They are not encrypted. $LK,"Copy",A="MN:Copy"$() or rename them with $LK,"Move",A="MN:Move"$() to a name without $FG,2$.Z$FG$ and they will be stored in an uncompressed form. See $LK,"TOSZ",A="FI:::/Doc/TOSZ.TXT"$ for Linux or Windows uncompress C/C++ code. -$ID,-2$$TR,"Is it open source? How do I build it?"$ -$ID,2$TempleOS is 100% open src. All the src code is included in the distro. Use $LK,"BootHDIns",A="MN:BootHDIns"$() to compile the kernel and compiler. The rest is $LK,"JIT Compiled",A="FF:::/Doc/Glossary.TXT,JIT Compile Mode"$ during boot. See $LK,"::/StartOS.CPP"$. -$ID,-2$$TR,"Where are object files? How do I link?"$ -$ID,2$TempleOS does not use object files or a linker. $LK,"AOT Compile Mode",A="FF:::/Doc/Glossary.TXT,AOT Compile Mode"$ is used to directly create flat binary files, $FG,2$/Kernel.BIN.C$FG$ and $FG,2$/Compiler/Compiler.BIN.Z$FG$ with no object files and linking.$FG$ $LK,"JIT Compile Mode",A="FF:::/Doc/Glossary.TXT,JIT Compile Mode"$ place code in memory, ready to run, with no object files or linking. Linking is done when $FG,2$BIN$FG$ modules are $LK,"Load",A="MN:Load"$()ed. -$ID,-2$$TR,"What is the FPS refresh rate?"$ -$ID,2$The refresh rate is $TX,"30",D="WINMGR_FPS"$ frames-per-second. That is how often TempleOS updates screen mem. It is not syncronized to the hardware. -$ID,-2$$TR,"How does a task own the speaker?"$ -$ID,2$No task or application has a lock on the speaker so apps will interfere with each other. -$ID,-2$$TR,"Why does it leak memory?"$ -$ID,2$TempleOS allocs mem as more items are displayed in the window. Also, TempleOS allocs mem for code as it is compiled at the cmd line. If you $FG,2$#include$FG$ a file twice, it allocs more mem for it. If you have a 50,000 line program with each line taking twenty bytes on a machine with 1 Gig, you could $FG,2$#include$FG$ it a thousand times if it had no data or graphics and no other use of mem. If it bothers you, hit $FG,2$$FG$ and $FG,2$, $FG$periodically, to kill and recreate the task$FG$. Use the pop-up flag on macros in your $LK,"PersonalMenu",A="FI:::Home/PersonalMenu.TXT"$ to spawn new tasks, run applications and free the applications when they are finished. Small mem chunks stick to the task when they are freed until it is killed. The only way to get in trouble is allocating multiple Meg chunks and freeing them. These can only be reused if the same size gets alloced again. Use $LK,"HeapLog",A="MN:HeapLog"$(), $LK,"HeapLogAddrRep",A="MN:HeapLogAddrRep"$() and $LK,"HeapLogSizeRep",A="MN:HeapLogSizeRep"$() to see who alloced mem and didn't free it. See $LK,"MemOverview",A="FI:::/Doc/MemOverview.TXT"$. -$ID,-2$$TR,"Why do I get a memory leak when editing big files?"$ -$ID,2$The editor periodically takes a snap-shot of the document for $FG,2$UNDO$FG$ and this looks like a memory leak. -$ID,-2$$TR,"Why is it in text mode?"$ -$ID,2$TempleOS runs in $FG,2$VGA 640x480 16 color$FG$ graphics mode, not text mode. It changes to this mode with a $LK,"BIOS call",A="FF:::/Kernel/KStart16.CPP,INT 0x10"$ while in real-mode before it switches to 64-bit mode. The text is $LK,"drawn by hand",A="MN:GrUpdateTextFG"$. See $LK,"::/Kernel/FontStd.CPP"$. If graphics mode fails, it falls-back on text mode. You can force text mode with an $LK,"Kernel config",A="FI:::/Kernel/KCfg.CPP"$ option. -$ID,-2$$TR,"Where is the kernel memory?"$ -$ID,2$TempleOS identity-maps all memory, all the time. It is like paging is not used. There is no special kernel $FG,2$high half$FG$ memory space. TempleOS is ring-0-only, so everything is kernel, even user programs. There is a special task called $FG,2$Adam$FG$ and he doesn't die, so his heap never gets freed. That's as close to $FG,2$kernel memory$FG$ as it gets. All code goes in the lowest 2 Gig of addresses, known as the $LK,"Code Heap",A="FF:::/Doc/Glossary.TXT,Code and Data Heaps"$, so that the $FG,2$REL32$FG$ addressing mode can be used. See $LK,"MemOverview",A="FI:::/Doc/MemOverview.TXT"$. -$ID,-2$$TR,"Why does it run code from stack addresses?"$ -$ID,2$TempleOS puts all code in the lowest 2 Gig, known as the $LK,"Code Heap",A="FF:::/Doc/Glossary.TXT,Code and Data Heaps"$, so that the $FG,2$REL32$FG$ addressing mode can be used. TempleOS is 64-bit, but $FG,2$2 Gig$FG$ is enough for code. It actually puts global variables there, too, but you can turn that off with $LK,"OPTf_GLBLS_ON_DATA_HEAP",A="MN:OPTf_GLBLS_ON_DATA_HEAP"$. $LK,"MAlloc",A="MN:MAlloc"$() allocs higher memory. -$ID,-2$$TR,"How does it SYSCALL?"$ -$ID,2$TempleOS doesn't use software interrupts or $FG,2$SYSCALL$FG$ insts because it never needs to change out of ring-0, even running user programs. Calls are always $FG,2$CALL REL32$FG$ insts. -$ID,-2$$TR,"How do you fault-in stack?"$ -$ID,2$The stack does not grow, so do not do deep recursion. In theory, memory gets fragmented, too. -$ID,-2$$TR,"How do I set the PATH?"$ -$ID,2$There is no $FG,2$PATH$FG$. You do not enter filenames at the command-line and expect them to run. You enter C-like code. $LK,"Get Started Here",A="FI:::/Doc/CmdLineOverview.TXT"$. -$ID,-2$$TR,"How do I boot it with Grub?"$ -$ID,2$If you use Grub, you $FG,2$chain-load$FG$ like Windows. See $LK,"Boot",A="FI:::/Doc/Boot.TXT"$. You can use the TempleOS boot-loader. $LK,"Master-Boot-Loader-Stage1",A="FI:::/Adam/Opt/Boot/BootMHD.CPP"$, $LK,"Master-Boot-Loader-Stage2",A="FI:::/Adam/Opt/Boot/BootMHD2.CPP"$, $LK,"Partition-Boot-Loader",A="FI:::/Adam/Opt/Boot/BootHD.CPP"$, $LK,"CD-DVD-Boot-Loader",A="FI:::/Adam/Opt/Boot/BootDVD.CPP"$. -$ID,-2$$TR,"How do I get Kernel.BIN to boot?"$ -$ID,2$The boot-loaders must be patched by you running $LK,"BootHDIns",A="MN:BootHDIns"$() or $LK,"BootMHDIns",A="MN:BootMHDIns"$(). Those will write the block address into the boot-loader because the boot-loaders do not navigate file systems to find the $LK,"Stage2",A="FI:::/Kernel/KStart16.CPP"$ if you relocate it. -$ID,-2$$TR,"Why is there some 16-Bit code?"$ -$ID,2$TempleOS is 64-bit. Like all PC operating systems, the boot-loader starts in 16-bit real-mode. TempleOS calls a few $FG,2$BIOS$FG$ info routines, switches to VGA-640x480x4bit, switches to 32-bit, then, 64-bit mode. There is an odd thing called a $FG,2$$TX,"PCI BIOS",HTML="http://www.o3one.org/hwdocs/bios_doc/pci_bios_21.pdf"$$FG$ which is 32-bit used for $FG,2$PCI$FG$ config space access. TempleOS calls $LK,"that",A="FI:::/Kernel/PCIBIOS.CPP"$ a couple times. It must temporarily drop-out-of 64-bit mode for that and stop multi-tasking. -$ID,-2$$TR,"Why are you pushing 32-bit values on the stack?"$ -$ID,2$$FG,2$PUSH EAX$FG$ : All stack operations in 64-bit mode are 64-bits. -$ID,-2$$TR,"Why are you using 32-bit insts and not setting high 32-bits?"$ -$ID,2$$FG,2$XOR EAX,EAX$FG$ : Operations on 32-bit regs clear the high 32-bits. -$ID,-2$$TR,"How do you use the FS and GS segment registers."$ -$ID,2$$FG,2$MOV RAX,FS:[RAX]$FG$ : FS can be set with a $FG,2$WRMSR$FG$, but displacement is RIP relative, so it's tricky to use. FS is used for the current $LK,"CTask",A="MN:CTask"$, GS for $LK,"CCPU",A="MN:CCPU"$. -$ID,-2$$TR,"How do I set ORG for position of code?"$ -$ID,2$The compiler creates $FG,2$pos independent$FG$ code. Don't create code which is loaded at a fixed, specified location. Code in a BIN file is $FG,2$pos independent$FG$ by virtue of a table in the BIN file for patching absolute addresses. -$ID,-2$$TR,"How are symbols loaded?"$ -$ID,2$Binary executable files have export syms which are loaded into the sym tables. The operating system $FG,2$Kernel$FG$ has such an export table. In addition, some map files are processed to provide more information on syms -- src file links. This is how the $LK,"Man",A="MN:Man"$()/$FG,2$AutoComplete$FG$ feature can find src lines. -$ID,-2$$TR,"Why doesn't assert work?"$ -$ID,2$$FG,2$#assert$FG$ might print a message at COMPILE time, not run time. -$ID,-2$$TR,"Why doesn't C++ public work?"$ -$ID,2$The word $FG,2$public$FG$ in $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ does very little except allow the $LK,"Help & Index",A="FI:::/Doc/HelpIndex.TXT"$ and $LK,"Who",A="MN:Who"$() to exclude meaningless syms. If you wish a full report of public and nonpublic syms $MA-X+PU,"Click Here",LM="DocMax(1000000);Who;View;\n"$. -$ID,-2$$TR,"How does the debugger do source debugging?"$ -$ID,2$When compilation takes place, the structures used by the compiler stick around. Data on classes can be accessed. See $LK,"ClassRep",A="MN:ClassRep"$(). -$ID,-2$$TR,"What are the ASCII 5 and ASCII 31 chars doing in my text files?"$ -$ID,2$The cursor location is stored as an $FG,2$ASCII 5$FG$ in files. $FG,2$ASCII 31$FG$ is $FG,2$SHIFT-SPACE$FG$, a character which does not get converted to tabs by space-to-tabs, $LK,"S2T",A="MN:S2T"$(). The $FG,2$ASCII 28$FG$ is $FG,2$SHIFT-ESC$FG$. -$ID,-2$$TR,"Why is there garbage at the end of my text files?"$ -$ID,2$Binary sprite data is stored beyond the terminating $FG,2$NULL$FG$ in text files. Map files store debug src line addresses. -$ID,-2$$TR,"Why are sprites so small?"$ -$ID,2$Sprites can be stored as vector graphics so they might take shockingly little room. They can be converted to bitmaps. -$ID,-2$$TR,"Why don't I need to recompile /Adam and /Home files?"$ -$ID,2$If you change code in the $FG,2$/Adam$FG$ or your $FG,2$/Home$FG$ directory, you don't need to recompile, you just need to reboot because those directories get recompiled when you boot. It uses $LK,"JIT Compile Mode",A="FF:::/Doc/Glossary.TXT,JIT Compile Mode"$. There is no $FG,2$.BIN$FG$ file for $FG,2$JIT$FG$ compilation. See $LK,"::/StartOS.CPP"$. -$ID,-2$$TR,"Why does it finds files that aren't there?"$ -$ID,2$If not found, $FG,2$.Z$FG$ is added or removed from filename and a search is done again. If a file is still not found, the parent directories are searched for a file of the same name. -$ID,-2$ -$FG,8$ -* "Windows" is a trademark owned by MicroSoft Corp. -* "Linux" is a trademark owned by Linus Torvalds. -* "QEMU" is a trademark owned by Fabrice Bellard. -* "VMware" is a trademark owned by VMware, Inc. -* "VirtualBox" is a trademark owned by Oracle. -$FG$ \ No newline at end of file diff --git a/Doc/Features.DD b/Doc/Features.DD new file mode 100644 index 0000000..9daec2e --- /dev/null +++ b/Doc/Features.DD @@ -0,0 +1,53 @@ + $WW,1$$FG,5$$TX+CX,"TempleOS' Features"$$FG$ + +* Oracle in program, $FG,2$AfterEgypt$FG$, for $LK,"tongues",A="FI:::/Adam/God/HSNotes.DD"$. + +* $FG,4$$TX,"x86_64",HTML="http://en.wikipedia.org/wiki/Amd64#AMD64"$$FG$, ring-0-only, single-address-map (identity), multitasking kernel with multicore support. + +* Master/Slave MultiCore + +* Free, $FG,2$public domain$FG$, $FG,2$100% open source$FG$. + +* 64-bit $FG,2$compiler/assembler$FG$ for $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$. Truly compiles, doesn't interpret. $FG,2$Just-in-Time$FG$ and $FG,2$Ahead-of-Time$FG$ compilation. With $FG,2$JIT$FG$, no need for object or exe files. + +* No 32-bit krufty code. + +* 640x480 16 color $FG,2$VGA$FG$ graphics. + +* Keyboard & Mouse support. + +* ATA PIO Hard drives, support for $FG,2$FAT32$FG$ and $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ file systems with file compression. + +* ATAPI PIO $FG,2$CD/DVD$FG$ support with $FG,2$ISO9660$FG$ file system. Can make bootable $FG,2$ISO9660$FG$ ISO files so you can roll-your-own distro's. + +* $LK,"Partitioning",A="MN:PrtDsk"$ tool, installer, $FG,2$boot loaders$FG$ for CD/DVD and hard disk. + +* $FG,2$Editor/Browser$FG$ for a new $LK,"Document Format",A="FI:::/Doc/DolDocOverview.DD"$. Source files and the command line window can have graphics, links, icons, trees, colors, super/sub scripts, margins. Everything is seamless through-out the tool chain. No need for separate resource files. + +* 8-bit $FG,2$ASCII$FG$, not just 7-bit. Supported in entire tool chain. $FG,2$$FG$ + +* $FG,2$Graphics in source code$FG$, no resource files, $FG,2$graphic sprite editor$FG$. $FG,2$$FG$ + +* $FG,2$64-bit pointers$FG$. All memory, even more than 4 Gig, can be directly accessed by all tasks on all cores at all times. + +* $FG,2$Ring-0-only$FG$. Highest CPU privileged mode at all times. No off-limits insts. No time lost changing modes or address maps. Switches tasks in half a microsecond. + +* $FG,2$2D/3D$FG$ graphics library + +* Real-time fancy $FG,2$differential-equation solver$FG$ for physics engines, to use in games. (Adaptive step-size Runge-Kutta, interpolated for real-time.) + +* Auto-completion, jump-to-source tool called $FG,2$AutoComplete$FG$ with Dictionary. + +* Window Manager. Pan screen with $FG,2$$FG$. Zoom screen on mouse cursor with $FG,2$$FG$/$FG,2$$FG$. + +* File Manager, $FG,2$$FG$. + +* Code $LK,"profiler",A="MN:Prof"$, $LK,"merge",A="MN:Merge"$, $LK,"diff",A="MN:Diff"$ utils. + +* $FG,2$PC Speaker$FG$ support with many hymns. + +* Music composing tool. + +* Many games, $LK,"demos",A="FI:::/Doc/DemoIndex.DD"$ and $LK,"documentation",A="FI:::/Doc/HelpIndex.DD"$. + +* $FG,2$All source code$FG$ included. Only compiles with the included TempleOS compiler and assembler. diff --git a/Doc/Features.TXT b/Doc/Features.TXT deleted file mode 100644 index 226e080..0000000 --- a/Doc/Features.TXT +++ /dev/null @@ -1,53 +0,0 @@ - $WW,1$$FG,5$$TX+CX,"TempleOS' Features"$$FG$ - -* Oracle in program, $FG,2$AfterEgypt$FG$, for $LK,"tongues",A="FI:::/Adam/God/HSNotes.TXT"$. - -* $FG,4$$TX,"x86_64",HTML="http://en.wikipedia.org/wiki/Amd64#AMD64"$$FG$, ring-0-only, single-address-map (identity), multitasking kernel with multicore support. - -* Master/Slave MultiCore - -* Free, $FG,2$public domain$FG$, $FG,2$100% open source$FG$. - -* 64-bit $FG,2$compiler/assembler$FG$ for $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$. Truly compiles, doesn't interpret. $FG,2$Just-in-Time$FG$ and $FG,2$Ahead-of-Time$FG$ compilation. With $FG,2$JIT$FG$, no need for object or exe files. - -* No 32-bit krufty code. - -* 640x480 16 color $FG,2$VGA$FG$ graphics. - -* Keyboard & Mouse support. - -* ATA PIO Hard drives, support for $FG,2$FAT32$FG$ and $LK,"RedSea",A="FI:::/Doc/RedSea.TXT"$ file systems with file compression. - -* ATAPI PIO $FG,2$CD/DVD$FG$ support with $FG,2$ISO9660$FG$ file system. Can make bootable $FG,2$ISO9660$FG$ ISO files so you can roll-your-own distro's. - -* $LK,"Partitioning",A="MN:PrtDsk"$ tool, installer, $FG,2$boot loaders$FG$ for CD/DVD and hard disk. - -* $FG,2$Editor/Browser$FG$ for a new $LK,"Document Format",A="FI:::/Doc/DolDocOverview.TXT"$. Source files and the command line window can have graphics, links, icons, trees, colors, super/sub scripts, margins. Everything is seamless through-out the tool chain. No need for separate resource files. - -* 8-bit $FG,2$ASCII$FG$, not just 7-bit. Supported in entire tool chain. $FG,2$$FG$ - -* $FG,2$Graphics in source code$FG$, no resource files, $FG,2$graphic sprite editor$FG$. $FG,2$$FG$ - -* $FG,2$64-bit pointers$FG$. All memory, even more than 4 Gig, can be directly accessed by all tasks on all cores at all times. - -* $FG,2$Ring-0-only$FG$. Highest CPU privileged mode at all times. No off-limits insts. No time lost changing modes or address maps. Switches tasks in half a microsecond. - -* $FG,2$2D/3D$FG$ graphics library - -* Real-time fancy $FG,2$differential-equation solver$FG$ for physics engines, to use in games. (Adaptive step-size Runge-Kutta, interpolated for real-time.) - -* Auto-completion, jump-to-source tool called $FG,2$AutoComplete$FG$ with Dictionary. - -* Window Manager. Pan screen with $FG,2$$FG$. Zoom screen on mouse cursor with $FG,2$$FG$/$FG,2$$FG$. - -* File Manager, $FG,2$$FG$. - -* Code $LK,"profiler",A="MN:Prof"$, $LK,"merge",A="MN:Merge"$, $LK,"diff",A="MN:Diff"$ utils. - -* $FG,2$PC Speaker$FG$ support with many hymns. - -* Music composing tool. - -* Many games, $LK,"demos",A="FI:::/Doc/DemoIndex.TXT"$ and $LK,"documentation",A="FI:::/Doc/HelpIndex.TXT"$. - -* $FG,2$All source code$FG$ included. Only compiles with the included TempleOS compiler and assembler. diff --git a/Doc/FileLowLevel.TXT b/Doc/FileLowLevel.DD similarity index 100% rename from Doc/FileLowLevel.TXT rename to Doc/FileLowLevel.DD diff --git a/Doc/FileMgr.DD b/Doc/FileMgr.DD new file mode 100644 index 0000000..e003a0d --- /dev/null +++ b/Doc/FileMgr.DD @@ -0,0 +1,66 @@ +$WW,1$$FG,5$$TX+CX,"File Manager"$$FG$ + +$FG,2$$FG$ +$ID,2$Sel files. +$ID,-2$ +$FG,2$ or $FG$ +$ID,2$Delete file or tree. +$ID,-2$ +$FG,2$ or $FG$ +$ID,2$Copy sel files to clipboard. +$ID,-2$ +$FG,2$ or $FG$ +$ID,2$Paste clipboard. +$ID,-2$ +$FG,2$LEFT-CLICK,drag-drop$FG$ +$ID,2$Move a file or tree to a dir. +$ID,-2$ +$FG,2$LEFT-CLICK,same file or $FG$ +$ID,2$Edit file. +$ID,-2$ +$FG,2$$FG$ +$ID,2$Edit Plain Text File. +$ID,-2$ +$FG,2$RIGHT-CLICK or $FG$ +$ID,2$Bring-up menu. +$ID,-2$ +$FG,2$$FG$ +$ID,2$#include file. +$ID,-2$ +$FG,2$$FG$ +$ID,2$Adam #include file. +$ID,-2$ +$FG,2$'r'$FG$ +$ID,2$Rename file. +$ID,-2$ +$FG,2$'d'$FG$ +$ID,2$Make Dir. +$ID,-2$ +$FG,2$'m'$FG$ +$ID,2$ChgDsk (Remount removable media). Do not do this on blank disks. +$ID,-2$ +$FG,2$'f'$FG$ +$ID,2$Format drive. +$ID,-2$ +$FG,2$'i'$FG$ +$ID,2$Mount ISO.C file. +$ID,-2$ +$FG,2$'u'$FG$ +$ID,2$Unmount drive(s). +$ID,-2$ +$FG,2$'M'$FG$ +$ID,2$Make CD/DVD ISO file. This creates a file image of the dir the cursor is on. The name of the ISO file is $LK,"blkdev.dft_iso_filename",A="MN:CBlkDevGlbls"$ and can be redefined in your start-up scripts. You may wish to place it on a different drive. +$ID,-2$ +$FG,2$'B'$FG$ +$ID,2$Burn CD/DVD ISO file. This burns a CD/DVD using the image file, $LK,"blkdev.dft_iso_filename",A="MN:CBlkDevGlbls"$ to the drive the cursor is on. +$ID,-2$ + +$FG,5$Instructions on Using CD/DVD's$FG$ +$ID,2$If you have not recompiled Kernel and defined your CD/DVD drive, exit the file mgr and use $LK,"Mount",A="MN:Mount"$ to define your CD/DVD drive. Place a CD/DVD in the drive and press $FG,2$'m'$FG$ when on top of the CD/DVD drive letter to mount the drive. It will call $LK,"ChgDsk",A="MN:ChgDsk"$(), the TempleOS cmd to mount removable media. +$ID,-2$ + +$FG,5$Instructions on Burning CD/DVD's$FG$ +$ID,2$Create a temporary dir to hold files and copy files into the holding dir. Make an ISO image of the dir by pressing $FG,2$'M'$FG$ when on top of the dir. Press $FG,2$'B'$FG$ when on top of the CD/DVD ROM drive to burn the ISO, $LK,"blkdev.dft_iso_filename",A="MN:CBlkDevGlbls"$, to disk. If you have not recompiled $FG,2$Kernel$FG$ and defined your CD/DVD drive, exit the file mgr and use $LK,"Mount",A="MN:Mount"$. + +$LK,"Making Your Own Distro",A="FI:::/Misc/DoDistro.HC"$ +$ID,-2$ \ No newline at end of file diff --git a/Doc/FileMgr.TXT b/Doc/FileMgr.TXT deleted file mode 100644 index 48291f5..0000000 --- a/Doc/FileMgr.TXT +++ /dev/null @@ -1,66 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"File Manager"$$FG$ - -$FG,2$$FG$ -$ID,2$Sel files. -$ID,-2$ -$FG,2$ or $FG$ -$ID,2$Delete file or tree. -$ID,-2$ -$FG,2$ or $FG$ -$ID,2$Copy sel files to clipboard. -$ID,-2$ -$FG,2$ or $FG$ -$ID,2$Paste clipboard. -$ID,-2$ -$FG,2$LEFT-CLICK,drag-drop$FG$ -$ID,2$Move a file or tree to a dir. -$ID,-2$ -$FG,2$LEFT-CLICK,same file or $FG$ -$ID,2$Edit file. -$ID,-2$ -$FG,2$$FG$ -$ID,2$Edit Plain Text File. -$ID,-2$ -$FG,2$RIGHT-CLICK or $FG$ -$ID,2$Bring-up menu. -$ID,-2$ -$FG,2$$FG$ -$ID,2$#include file. -$ID,-2$ -$FG,2$$FG$ -$ID,2$Adam #include file. -$ID,-2$ -$FG,2$'r'$FG$ -$ID,2$Rename file. -$ID,-2$ -$FG,2$'d'$FG$ -$ID,2$Make Dir. -$ID,-2$ -$FG,2$'m'$FG$ -$ID,2$ChgDsk (Remount removable media). Do not do this on blank disks. -$ID,-2$ -$FG,2$'f'$FG$ -$ID,2$Format drive. -$ID,-2$ -$FG,2$'i'$FG$ -$ID,2$Mount ISO.C file. -$ID,-2$ -$FG,2$'u'$FG$ -$ID,2$Unmount drive(s). -$ID,-2$ -$FG,2$'M'$FG$ -$ID,2$Make CD/DVD ISO file. This creates a file image of the dir the cursor is on. The name of the ISO file is $LK,"blkdev.dft_iso_filename",A="MN:CBlkDevGlbls"$ and can be redefined in your start-up scripts. You may wish to place it on a different drive. -$ID,-2$ -$FG,2$'B'$FG$ -$ID,2$Burn CD/DVD ISO file. This burns a CD/DVD using the image file, $LK,"blkdev.dft_iso_filename",A="MN:CBlkDevGlbls"$ to the drive the cursor is on. -$ID,-2$ - -$FG,5$Instructions on Using CD/DVD's$FG$ -$ID,2$If you have not recompiled Kernel and defined your CD/DVD drive, exit the file mgr and use $LK,"Mount",A="MN:Mount"$ to define your CD/DVD drive. Place a CD/DVD in the drive and press $FG,2$'m'$FG$ when on top of the CD/DVD drive letter to mount the drive. It will call $LK,"ChgDsk",A="MN:ChgDsk"$(), the TempleOS cmd to mount removable media. -$ID,-2$ - -$FG,5$Instructions on Burning CD/DVD's$FG$ -$ID,2$Create a temporary dir to hold files and copy files into the holding dir. Make an ISO image of the dir by pressing $FG,2$'M'$FG$ when on top of the dir. Press $FG,2$'B'$FG$ when on top of the CD/DVD ROM drive to burn the ISO, $LK,"blkdev.dft_iso_filename",A="MN:CBlkDevGlbls"$, to disk. If you have not recompiled $FG,2$Kernel$FG$ and defined your CD/DVD drive, exit the file mgr and use $LK,"Mount",A="MN:Mount"$. - -$LK,"Making Your Own Distro",A="FI:::/Misc/DoDistro.CPP"$ -$ID,-2$ \ No newline at end of file diff --git a/Doc/FileMgrPullDown.TXT b/Doc/FileMgrPullDown.DD similarity index 100% rename from Doc/FileMgrPullDown.TXT rename to Doc/FileMgrPullDown.DD diff --git a/Doc/FileUtils.DD b/Doc/FileUtils.DD new file mode 100644 index 0000000..8e16514 --- /dev/null +++ b/Doc/FileUtils.DD @@ -0,0 +1,26 @@ +$WW,1$$FG,5$$TX+CX,"File Utils"$$FG$ + +File util $LK,"FilesFind",A="MN:FilesFind"$() wildcard mask consists of a single base dir with multiple file masks separated by $FG,2$';'$FG$. The $FG,2$'*'$FG$ and $FG,2$'?'$FG$ wildcard chars are accepted. The $FG,2$'~'$FG$ is your home directory and $FG,2$'!'$FG$ indicates an exclusion mask. + + +$FG,2$"/Kernel/*"$FG$ BaseDir: $FG,2$/Kernel$FG$ Mask: $FG,2$*$FG$ +$FG,2$"/Demo/*.BMP*;*.GRA*"$FG$ BaseDir: $FG,2$/Demo$FG$ Mask: $FG,2$*.BMP*$FG$ | $FG,2$*.GRA*$FG$ +$FG,2$"/*.DD*;!*/Bible*"$FG$ BaseDir: $FG,2$Root$FG$ Mask: $FG,2$*.DD*$FG$ but not $FG,2$*/Bible*$FG$ + +See $LK,"FilesFindMatch",A="MN:FilesFindMatch"$(). + +Flags are either text or int values. + + $LK,"FUF_RECURSE",A="MN:FUF_RECURSE"$ $FG,2$+r$FG$ Recurse + $LK,"FUF_SINGLE",A="MN:FUF_SINGLE"$ $FG,2$+s$FG$ Single File (Optimization for one file in mask.) + $LK,"FUF_FLATTEN_TREE",A="MN:FUF_FLATTEN_TREE"$ $FG,2$+f$FG$ use with '$FG,2$+F$FG$'. Just use $FG,2$+F$FG$, probably. + $LK,"FUF_JUST_DIRS",A="MN:FUF_JUST_DIRS"$ $FG,2$+D$FG$ just directories + $LK,"FUF_JUST_FILES",A="MN:FUF_JUST_FILES"$ $FG,2$+F$FG$ just files (Flattens trees) + $LK,"FUF_CLUSTER_ORDER",A="MN:FUF_CLUSTER_ORDER"$ $FG,2$+O$FG$ sort by cluster (move head one direction) + $LK,"FUF_JUST_TXT",A="MN:FUF_JUST_TXT"$ $FG,2$+T$FG$ just text files : $LK,"FILEMASK_TXT",A="MN:FILEMASK_TXT"$ + $LK,"FUF_JUST_SRC",A="MN:FUF_JUST_SRC"$ $FG,2$+S$FG$ just src files : $LK,"FILEMASK_SRC",A="MN:FILEMASK_SRC"$ + $LK,"FUF_JUST_AOT",A="MN:FUF_JUST_AOT"$ $FG,2$+A$FG$ just aot files : $LK,"FILEMASK_AOT",A="MN:FILEMASK_AOT"$ + $LK,"FUF_JUST_JIT",A="MN:FUF_JUST_JIT"$ $FG,2$+J$FG$ just jit files : $LK,"FILEMASK_JIT",A="MN:FILEMASK_JIT"$ + $LK,"FUF_JUST_GRA",A="MN:FUF_JUST_GRA"$ $FG,2$+G$FG$ just graphic files : $LK,"FILEMASK_GRA",A="MN:FILEMASK_GRA"$ + +See $LK,"ST_FILE_UTIL_FLAGS",A="MN:ST_FILE_UTIL_FLAGS"$ when used in calling program taking text flags. diff --git a/Doc/FileUtils.TXT b/Doc/FileUtils.TXT deleted file mode 100644 index 99d68c8..0000000 --- a/Doc/FileUtils.TXT +++ /dev/null @@ -1,26 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"File Utils"$$FG$ - -File util $LK,"FilesFind",A="MN:FilesFind"$() wildcard mask consists of a single base dir with multiple file masks separated by $FG,2$';'$FG$. The $FG,2$'*'$FG$ and $FG,2$'?'$FG$ wildcard chars are accepted. The $FG,2$'~'$FG$ is your home directory and $FG,2$'!'$FG$ indicates an exclusion mask. - - -$FG,2$"/Kernel/*"$FG$ BaseDir: $FG,2$/Kernel$FG$ Mask: $FG,2$*$FG$ -$FG,2$"/Demo/*.BMP*;*.GRA*"$FG$ BaseDir: $FG,2$/Demo$FG$ Mask: $FG,2$*.BMP*$FG$ | $FG,2$*.GRA*$FG$ -$FG,2$"/*.TXT*;!*/Bible*"$FG$ BaseDir: $FG,2$Root$FG$ Mask: $FG,2$*.TXT*$FG$ but not $FG,2$*/Bible*$FG$ - -See $LK,"FilesFindMatch",A="MN:FilesFindMatch"$(). - -Flags are either text or int values. - - $LK,"FUF_RECURSE",A="MN:FUF_RECURSE"$ $FG,2$+r$FG$ Recurse - $LK,"FUF_SINGLE",A="MN:FUF_SINGLE"$ $FG,2$+s$FG$ Single File (Optimization for one file in mask.) - $LK,"FUF_FLATTEN_TREE",A="MN:FUF_FLATTEN_TREE"$ $FG,2$+f$FG$ use with '$FG,2$+F$FG$'. Just use $FG,2$+F$FG$, probably. - $LK,"FUF_JUST_DIRS",A="MN:FUF_JUST_DIRS"$ $FG,2$+D$FG$ just directories - $LK,"FUF_JUST_FILES",A="MN:FUF_JUST_FILES"$ $FG,2$+F$FG$ just files (Flattens trees) - $LK,"FUF_CLUSTER_ORDER",A="MN:FUF_CLUSTER_ORDER"$ $FG,2$+O$FG$ sort by cluster (move head one direction) - $LK,"FUF_JUST_TXT",A="MN:FUF_JUST_TXT"$ $FG,2$+T$FG$ just text files : $LK,"FILEMASK_TXT",A="MN:FILEMASK_TXT"$ - $LK,"FUF_JUST_SRC",A="MN:FUF_JUST_SRC"$ $FG,2$+S$FG$ just src files : $LK,"FILEMASK_SRC",A="MN:FILEMASK_SRC"$ - $LK,"FUF_JUST_AOT",A="MN:FUF_JUST_AOT"$ $FG,2$+A$FG$ just aot files : $LK,"FILEMASK_AOT",A="MN:FILEMASK_AOT"$ - $LK,"FUF_JUST_JIT",A="MN:FUF_JUST_JIT"$ $FG,2$+J$FG$ just jit files : $LK,"FILEMASK_JIT",A="MN:FILEMASK_JIT"$ - $LK,"FUF_JUST_GRA",A="MN:FUF_JUST_GRA"$ $FG,2$+G$FG$ just graphic files : $LK,"FILEMASK_GRA",A="MN:FILEMASK_GRA"$ - -See $LK,"ST_FILE_UTIL_FLAGS",A="MN:ST_FILE_UTIL_FLAGS"$ when used in calling program taking text flags. diff --git a/Doc/Frame.DD b/Doc/Frame.DD new file mode 100644 index 0000000..18d51d3 --- /dev/null +++ b/Doc/Frame.DD @@ -0,0 +1 @@ +$WW,1$If you require separate global vars for multiple instances of a routine, you can use $FG,4$Frame$FG$s. See $LK,"SpriteMeshEd",A="MN:SpriteMeshEd"$(), $LK,"::/Demo/Graphics/Pick3D.HC"$ or $LK,"Noise",A="MN:Noise"$(). diff --git a/Doc/Frame.TXT b/Doc/Frame.TXT deleted file mode 100644 index 78aa77f..0000000 --- a/Doc/Frame.TXT +++ /dev/null @@ -1 +0,0 @@ -$WW,1$If you require separate global vars for multiple instances of a routine, you can use $FG,4$Frame$FG$s. See $LK,"SpriteMeshEd",A="MN:SpriteMeshEd"$(), $LK,"::/Demo/Graphics/Pick3D.CPP"$ or $LK,"Noise",A="MN:Noise"$(). diff --git a/Doc/GRAFiles.DD b/Doc/GRAFiles.DD new file mode 100644 index 0000000..27f04f2 --- /dev/null +++ b/Doc/GRAFiles.DD @@ -0,0 +1,45 @@ +$WW,1$GRA graphics files are 8-bits-per-pixels but only 4-bits of color, with transparency and no palette. Compression is the standard TempleOS$FG$ LZW compression. +$HL,1$ +#define DCF_COMPRESSED 1 //This is the only saved flag. +#define DCF_PALETTE 2 + +#define TRANSPARENT 0xFF +#define BLACK 0 +#define BLUE 1 +#define GREEN 2 +#define CYAN 3 +#define RED 4 +#define PURPLE 5 +#define BROWN 6 +#define LTGRAY 7 +#define DKGRAY 8 +#define LTBLUE 9 +#define LTGREEN 10 +#define LTCYAN 11 +#define LTRED 12 +#define LTPURPLE 13 +#define YELLOW 14 +#define WHITE 15 + +class CBGR48 +{ + U16 r,g,b,pad; +}; + +CBGR48 gr_palette_std[16]={ +0x000000000000,0x00000000AAAA,0x0000AAAA0000,0x0000AAAAAAAA, +0xAAAA00000000,0xAAAA0000AAAA,0xAAAA55550000,0xAAAAAAAAAAAA, +0x555555555555,0x55555555FFFF,0x5555FFFF5555,0x5555FFFFFFFF, +0xFFFF55555555,0xFFFF5555FFFF,0xFFFFFFFF5555,0xFFFFFFFFFFFF}; + +class GRAFile +{ + I32 width; + I32 width_internal; //Rounded-up to multiple of 8. + I32 height; + I32 flags; //DCF_COMPRESSED? See $LK,"::/Kernel/Compress.HC"$. + CBGR48 palette[16]; //Included if DCF_PALETTE. + U8 body[]; +};$HL,0$ + +See $LK,"DCSave",A="MN:DCSave"$(), $LK,"GRAWrite",A="MN:GRAWrite"$(), $LK,"DCLoad",A="MN:DCLoad"$(), and $LK,"GRARead",A="MN:GRARead"$(). diff --git a/Doc/GRAFiles.TXT b/Doc/GRAFiles.TXT deleted file mode 100644 index ffa365f..0000000 --- a/Doc/GRAFiles.TXT +++ /dev/null @@ -1,45 +0,0 @@ -$WW,1$GRA graphics files are 8-bits-per-pixels but only 4-bits of color, with transparency and no palette. Compression is the standard TempleOS$FG$ LZW compression. -$HL,1$ -#define DCF_COMPRESSED 1 //This is the only saved flag. -#define DCF_PALETTE 2 - -#define TRANSPARENT 0xFF -#define BLACK 0 -#define BLUE 1 -#define GREEN 2 -#define CYAN 3 -#define RED 4 -#define PURPLE 5 -#define BROWN 6 -#define LTGRAY 7 -#define DKGRAY 8 -#define LTBLUE 9 -#define LTGREEN 10 -#define LTCYAN 11 -#define LTRED 12 -#define LTPURPLE 13 -#define YELLOW 14 -#define WHITE 15 - -class CBGR48 -{ - U16 r,g,b,pad; -}; - -CBGR48 gr_palette_std[16]={ -0x000000000000,0x00000000AAAA,0x0000AAAA0000,0x0000AAAAAAAA, -0xAAAA00000000,0xAAAA0000AAAA,0xAAAA55550000,0xAAAAAAAAAAAA, -0x555555555555,0x55555555FFFF,0x5555FFFF5555,0x5555FFFFFFFF, -0xFFFF55555555,0xFFFF5555FFFF,0xFFFFFFFF5555,0xFFFFFFFFFFFF}; - -class GRAFile -{ - I32 width; - I32 width_internal; //Rounded-up to multiple of 8. - I32 height; - I32 flags; //DCF_COMPRESSED? See $LK,"::/Kernel/Compress.CPP"$. - CBGR48 palette[16]; //Included if DCF_PALETTE. - U8 body[]; -};$HL,0$ - -See $LK,"DCSave",A="MN:DCSave"$(), $LK,"GRAWrite",A="MN:GRAWrite"$(), $LK,"DCLoad",A="MN:DCLoad"$(), and $LK,"GRARead",A="MN:GRARead"$(). diff --git a/Doc/Glossary.DD b/Doc/Glossary.DD new file mode 100644 index 0000000..97e36d2 --- /dev/null +++ b/Doc/Glossary.DD @@ -0,0 +1,264 @@ +$WW,1$$FG,5$$TX+CX,"Glossery"$$FG$ + +$TR,"Abbreviations"$ +$ID,2$$FG,2$Abs$FG$ Absolute +$FG,2$AC$FG$ AutoComplete +$FG,2$Acct$FG$ Account +$FG,2$ACD$FG$ AutoComplete Dictionary +$FG,2$Addr$FG$ Address +$FG,2$Alloc$FG$ Allocate +$FG,2$Alt$FG$ Alternate +$FG,2$AOT$FG$ Ahead-of-Time +$FG,2$AP$FG$ ApplicationProcessor (Core1 - Core7) +$FG,2$Arg$FG$ Argument +$FG,2$Asm$FG$ Assemble, Assembler or Assembly +$FG,2$Attr$FG$ Attribute +$FG,2$Aux$FG$ Auxilliary +$FG,2$BG$FG$ Backround +$FG,2$Bin$FG$ Binary +$FG,2$Blk$FG$ Block +$FG,2$Bmp$FG$ BitMap +$FG,2$Buf$FG$ Buffer +$FG,2$Bwd$FG$ Backward +$FG,2$CB$FG$ Call-Back, Code Block +$FG,2$Cfg$FG$ Config +$FG,2$Chg$FG$ Change +$FG,2$Chk$FG$ Check +$FG,2$Const$FG$ Consant +$FG,2$Cmd$FG$ Command +$FG,2$Cmp$FG$ Compiler +$FG,2$Cnt$FG$ Count +$FG,2$Ctrl$FG$ Control. The ctrl key is indicated with "$FG,2$^$FG$" in documentation. +$FG,2$Cur$FG$ Current +$FG,2$Cvt$FG$ Convert +$FG,2$Dbg$FG$ Debug +$FG,2$Dbl$FG$ Double +$FG,2$DC$FG$ Device Context +$FG,2$Del$FG$ Delete +$FG,2$Desc$FG$ Descriptor, Description +$FG,2$Dev$FG$ Device +$FG,2$Dft$FG$ Default +$FG,2$Dir$FG$ Directory, Direction +$FG,2$Div$FG$ Divide +$FG,2$Doc$FG$ Document +$FG,2$Drv$FG$ Drive +$FG,2$Dsk$FG$ Disk +$FG,2$Dst$FG$ Destination +$FG,2$Ed$FG$ Edit, Editor +$FG,2$Elem$FG$ Element +$FG,2$Equ$FG$ Equal +$FG,2$Evt$FG$ Event +$FG,2$Exe$FG$ Execute +$FG,2$Ext$FG$ Extern, Extended, Extract +$FG,2$Feat$FG$ Feature +$FG,2$FG$FG$ Foreground +$FG,2$Fmt$FG$ Format +$FG,2$Fwd$FG$ Forward +$FG,2$FPS$FG$ Frames per Second, First Person Shooter +$FG,2$fp_$FG$ Function ptr +$FG,2$Fun$FG$ Function +$FG,2$Gen$FG$ Generate +$FG,2$Glbl$FG$ Global +$FG,2$Gr$FG$ Graphic +$FG,2$IDE$FG$ Integrated Drive Electronics, Integrated Development Environment +$FG,2$Id$FG$ Identification +$FG,2$Ident$FG$ Identifier, Identity, Identical +$FG,2$IDT$FG$ Interrupt Descriptor Table +$FG,2$Idx$FG$ Index +$FG,2$Init$FG$ Initialize +$FG,2$Ins$FG$ Insert, Install +$FG,2$Inst$FG$ Instruction +$FG,2$Int$FG$ Interrupt, Integer +$FG,2$ip_$FG$ Input Pointer. See $LK,"InputPointer.HC",A="FI:::/Kernel/SerialDev/InputPointer.HC"$. +$FG,2$Irq$FG$ Interrupt (Request) +$FG,2$JIT$FG$ Just-in-Time +$FG,2$Kbd$FG$ Keyboard +$FG,2$KD$FG$ Keyboard Device +$FG,2$Len$FG$ Length +$FG,2$Let$FG$ Letter +$FG,2$Lex$FG$ Lexical Analyser +$FG,2$Loc$FG$ Location, Lines of Code +$FG,2$Log$FG$ Logarithm, Logical +$FG,2$Lst$FG$ List +$FG,2$Man$FG$ Manual +$FG,2$Mem$FG$ Memory +$FG,2$Mgd$FG$ Managed +$FG,2$Mgr$FG$ Manager +$FG,2$Mon$FG$ Month +$FG,2$MP$FG$ MultiProcessor +$FG,2$Msg$FG$ Message +$FG,2$Num$FG$ Number +$FG,2$Obj$FG$ Object +$FG,2$Occ$FG$ Occurrence +$FG,2$ODE$FG$ Ordinary Differential Equation +$FG,2$Opt$FG$ Option, Optimize +$FG,2$Paren$FG$ Parenthesis +$FG,2$Pix$FG$ Pixel +$FG,2$Pkg$FG$ Package +$FG,2$Poly$FG$ Polygon +$FG,2$Pos$FG$ Position +$FG,2$Pow$FG$ Power +$FG,2$Prec$FG$ Precedence +$FG,2$Prev$FG$ Previous +$FG,2$Pri$FG$ Primary +$FG,2$Prod$FG$ Product, Production +$FG,2$Prof$FG$ Profile, Profiler +$FG,2$Prs$FG$ Parse, Parser +$FG,2$Prt$FG$ Partition +$FG,2$FunSeg$FG$ Program Section +$FG,2$Pt$FG$ Point +$FG,2$Ptr$FG$ Pointer +$FG,2$Que$FG$ Queue +$FG,2$Rand$FG$ Random +$FG,2$Ref$FG$ Reference +$FG,2$Reg$FG$ Register, Registry, Regular +$FG,2$Rem$FG$ Remove +$FG,2$Rep$FG$ Report, Repeat +$FG,2$Res$FG$ Result +$FG,2$Rev$FG$ Reverse, Reversed +$FG,2$Rqst$FG$ Request +$FG,2$Rst$FG$ Reset +$FG,2$Rot$FG$ Rotation +$FG,2$Rx$FG$ Receive +$FG,2$Sched$FG$ Sceduler +$FG,2$Sec$FG$ Second, Secondary +$FG,2$Sect$FG$ Sector +$FG,2$Sel$FG$ Select, Selected +$FG,2$Seq$FG$ Sequence +$FG,2$Snd$FG$ Sound +$FG,2$SP$FG$ SingleProcessor +$FG,2$Src$FG$ Source +$FG,2$Srv$FG$ Servant +$FG,2$Stat$FG$ Status, Statistic +$FG,2$Std$FG$ Standard +$FG,2$Stk$FG$ Stack +$FG,2$Stmt$FG$ Statement +$FG,2$Str$FG$ String +$FG,2$Sym$FG$ Symbol +$FG,2$Sync$FG$ Synchronization +$FG,2$Sys$FG$ System +$FG,2$Tbl$FG$ Table +$FG,2$Term$FG$ Terminal +$FG,2$Tri$FG$ Triangle +$FG,2$Tx$FG$ Transmit +$FG,2$UAsm$FG$ Unassemble +$FG,2$Val$FG$ Value +$FG,2$Var$FG$ Variable +$FG,2$Vect$FG$ Vector +$FG,2$Vol$FG$ Volume +$FG,2$Win$FG$ Window +$FG,2$Wiz$FG$ Wizard +$ID,-2$$TR,"Task/Process/Thread"$ +$ID,2$There is no distinction between $FG,2$task$FG$, $FG,2$process$FG$ or $FG,2$thread$FG$. The $FG,2$Fs$FG$ segment reg is kept pointing to the current task's $LK,"CTask",A="MN:CTask"$. There is only one window per task, and only $FG,2$core0$FG$ tasks can have windows. Each task has a code and data heap so memory is returned when it dies. Each task has a $LK,"hash",A="HI:Hash"$ symbol table. +$ID,-2$$TR,"Adam Task"$ +$ID,2$This is Adam, as in Adam and Eve, the parent of all tasks and immortal. This task is created at start-up and appears in the small window at the top beneath the user windows. On it's heap are all memory objects which you don't want destroyed by a task's death. When created, Adam runs the file $LK,"::/StartOS.HC"$. When start-up is finished, the adam task enters a server mode where it accepts requests from other tasks. The $LK,"Adam",A="MN:Adam"$("") routine will make Adam compile and run text src code. $FG,2$#include$FG$ stmts can be sent to $LK,"Adam",A="MN:Adam"$(""), creating system-wide code and data which don't disappear when any particular task ends. +$ID,-2$$TR,"Seth Task"$ +$ID,2$$FG,2$Seth$FG$ is Adam and Eve's child. Each CPU core has an executive task called $FG,2$Seth$FG$ that is immortal. The Adam task on $FG,2$CPU#0$FG$ is also it's $FG,2$Seth$FG$ task. +$ID,-2$$TR,"Code and Data Heaps"$ +$ID,2$TempleOS uses the asm $FG,2$CALL$FG$ inst, exclusively, and that inst is limited to calling routines $FG,2$+/-2 Gig$FG$ from the current code location. To prevent out-of-range issues, I decided to separate code and data, placing all code within the lowest $FG,2$2 Gig$FG$ of memory, addresses $FG,2$00000000$FG$-$FG,2$7FFFFFFF$FG$. The compiler and $LK,"Load",A="MN:Load"$()er alloc memory from the code heap to store code and glbl vars, unless the compiler option $LK,"OPTf_GLBLS_ON_DATA_HEAP",A="MN:OPTf_GLBLS_ON_DATA_HEAP"$ is used. When programs call $LK,"MAlloc",A="MN:MAlloc"$() is from the data heap, which in not limited in size, except by physical RAM memory. You can alloc from any heap in any task at any time on any core, even making $LK,"independent",A="MN:Mem512Alloc"$ heaps. +$ID,-2$$TR,"Parent, Child and PopUp Tasks"$ +$ID,2$Often a task will $LK,"Spawn",A="MN:Spawn"$() or $LK,"PopUp",A="MN:PopUp"$() a task as a helper. The helper is known as a child Task, though you can $LK,"Spawn",A="MN:Spawn"$ a task and assign it a different parent... like $FG,2$Adam$FG$. Links are kept as to who's whose child, so when one task is $LK,"Kill",A="MN:Kill"$()ed the child helper tasks die, too. You can get a report of current system tasks with $LK,"TaskRep",A="MN:TaskRep"$(). There is just one window per task, so child tasks are needed for pop-ups. +$ID,-2$$TR,"HolyC"$ +$ID,2$$LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ is more than $FG,2$C$FG$ and less than $FG,2$C++$FG$. It has the default args of $FG,2$C++$FG$ and uses $FG,2$class$FG$ in place of $FG,2$struct$FG$. It uses $FG,2$U0,U8,U16,U32,I64$FG$ and $FG,2$I0,I8,I16,I32,I64$FG$ for signed and unsigned ints. It has different $LK,"operator precedence",A="FF:::/Doc/HolyC.DD,operator precedence"$. It has $FG,2$PASCAL$FG$-like function calls with no parens, but requires an $FG,2$&$FG,2$$FG$ when referring to function addresses. +$ID,-2$$TR,"AOT Compile Mode"$ +$ID,2$$FG,2$Ahead-of-Time$FG$ compiling is conventional compilation mode. Do not use $FG,2$AOT$FG$, use $FG,2$JIT$FG$ compiling. + +In $FG,2$AOT$FG$ mode, $FG,2$.PRJ$FG$ files are compiled to $FG,2$.BIN$FG$ files, skipping $FG,2$.OBJ$FG$ files. After compiling, $FG,2$.BIN$FG$ files are $LK,"Load",A="MN:Load"$()ed. + +There is no $FG,2$main()$FG$ routine. Instead, stmts outside functions are automatically executed upon loading. There is no way to unload except by killing the task. To invoke $FG,2$AOT Compiled Mode$FG$, $LK,"Cmp",A="MN:Cmp"$() is used. The $FG,2$Kernel$FG$ module and compiler are made in $FG,2$AOT$FG$ compiled mode. See $LK,"BootHDIns",A="MN:BootHDIns"$() which calls $LK,"MakeAll",A="MN:MakeAll"$() where $FG,2$Kernel.BIN.C$FG$ and $FG,2$Compiler.BIN.Z$FG$ are created. +$ID,-2$$TR,"JIT Compile Mode"$ +$ID,2$In $FG,2$just-in-time$FG$ mode, the compiler places code and data in memory alloced from the heap, incrementally, making them immediately ready for in-place execution. This mode is used during cmd line operations. When you $FG,2$#include$FG$ a file, it is compiled function by function and code ends-up all over in the memory, at least in the first 2Gig of memory. The $LK,"ExeFile",A="MN:ExeFile"$() routine is the same as $FG,2$#include$FG$ but can be used in programs. $LK,"ExePrint",A="MN:ExePrint"$() routine will compile and run a string. +$ID,-2$$TR,"Compiler Intermediate Code"$ +$ID,2$The compiler generates insts one step before making actual assembly (machine) language insts. This code is rev polish stack machine in nature and can be viewed with $LK,"PassTrace",A="MN:PassTrace"$(). The compiler does not $FG,2$interpret$FG$ code, except in the process of optimization to make the final machine code. Assembly language output can be viewed when code is compiled with the $LK,"Trace",A="MN:Trace"$(), or, afterward, with $LK,"U",A="MN:U"$() or $LK,"Uf",A="MN:Uf"$(""). +$ID,-2$$TR,"Drive/Partition"$ +$ID,2$There is no distinction between $FG,2$drive$FG$ or $FG,2$partition$FG$. They are specified with a single letter from $FG,2$A$FG$-$FG,2$Z$FG$. + +'$FG,2$:$FG$' is the boot drive. + +For commands taking a drive letter as an argument, char $FG,2$0$FG$ is the current drive. +$ID,-2$$LK,"AutoFile",A="HI:AutoFile"$ +$LK,"Bt, Bts, Btr, Btc, BEqu",A="HI:Bit"$ +$LK,"Define",A="HI:Define"$ +$LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ +$LK,"Editor Link Types",A="MN:LK_FILE"$ +$LK,"files_find_mask",A="FI:::/Doc/FileUtils.DD"$ +$LK,"Hash Table",A="HI:Hash"$ +$LK,"RedSea File System",A="FI:::/Doc/RedSea.DD"$ +$LK,"Sprite",A="HI:Graphics/Sprite"$ +$TR,"CLI, STI, PUSHFD, POPFD"$ +$ID,2$These are x86 assembly insts. +$FG,2$CLI$FG$ disable interrupts. +$FG,2$STI$FG$ enable interrupts. +$FG,2$PUSHFD$FG$ pushes the CPU flags. +$FG,2$POPFD$FG$ pops the CPU flags. +$ID,-2$$TR,"Filename Extention Types"$ +$ID,2$$FG,5$*.???.Z$FG$ + These files are automatically compressed or uncompresses files when read or written. +$FG,5$*.???.C$FG$ + Contiguous files--NOT compressed. +$FG,5$*.DD.Z;*.DD;*.LOG.Z;*.LOG$FG$ + Text Files +$FG,5$*.HC.Z;*.HC$FG$ + HolyC src files. The default HolyC compiler type is $FG,2$.HC.Z$FG$. +$FG,5$*.PRJ.Z;*.PRJ$FG$ + HolyC src files to be compiled $FG,2$AOT$FG$. +$FG,5$*.HH.Z;*.HH$FG$ + HolyC src header files. +$FG,5$*.MAP.Z;*.MAP$FG$ + Compiler "map" files +$FG,5$*.BIN.Z;*.BIN.C;*.BIN$FG$ + Binary executable files, created by $LK,"Cmp",A="MN:Cmp"$() and read by $LK,"Load",A="MN:Load"$(). +$FG,5$*.DAT.Z;*.DAT$FG$ + Data files +$FG,5$*.ISO$FG$ + CD/DVD image file--ISO9660. +$FG,5$*.AUT.Z;*.AUT$FG$ + $FG,2$AutoFile$FG$ Basically a HolyC program whose stdout goes to the input of a task when $LK,"AutoFile",A="MN:AutoFile"$() is called. +$FG,5$*.GRA.Z;*.GRA$FG$ + Graphics file + +$LK,"FILEMASK_TXT",A="MN:FILEMASK_TXT"$ +$LK,"FILEMASK_SRC",A="MN:FILEMASK_SRC"$ +$LK,"FILEMASK_AOT",A="MN:FILEMASK_AOT"$ +$LK,"FILEMASK_JIT",A="MN:FILEMASK_JIT"$ +$LK,"FILEMASK_GRA",A="MN:FILEMASK_GRA"$ +$ID,-2$$TR-C,"Naming Convention"$ +$ID,2$Since there are no $FG,2$namespaces$FG$ and I don't plan to implement name spaces, I highly recommend putting a 2-3 character module code prefix on syms. e.g. $FG,2$WS$FG$, $FG,2$Doc$FG$, $FG,2$Lex$FG$ + +$FG,5$ALL_CAPS$FG$ + Assembly Language labels are capitalized with underscores between words. So are $FG,2$#define$FG$'s. + +$FG,5$_ALL_CAPS$FG$ + Asm routines which are $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ callable must have a leading underscore. + +$FG,5$MixedCaps$FG$ + $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ Functions and class names are MixedCaps. + +$FG,5$lower_case$FG$ + Local function vars and glbl vars are lower case. Class member names are also lower_case. + +$FG,5$_lower_case$FG$ + Function args which are outputs (passed as ptrs) have leading underscores. Also, args which have idently named local variable counterparts have leading underscores. + +$FG,5$DOCf_????$FG$ + Flags bit nums instead of bit values are designated with a lower case $FG,2$f$FG$. + +$FG,5$DOCG_????$FG$ + Flag groups are designated with "$FG,2$G$FG$". + +$FG,5$res$FG$ is reserved for local variables that hold the function return val. + +$FG,5$*$FG$ I used C++ like naming. I place $FG,2$New$FG$, $FG,2$Del$FG$, $FG,2$Init$FG$, $FG,2$Rst$FG$, ect. on the end of a function name instead of at the beginning. $FG,2$RstMusicSettings$FG$ should be $FG,2$MusicSettingsRst$FG$. +$ID,-2$$TR,"Fs"$ +$ID,2$The CPU FS segment reg. This reg points to the current task's $LK,"CTask",A="MN:CTask"$. +$ID,-2$$TR,"Gs"$ +$ID,2$The CPU GS segment reg. This reg points to the current core's $LK,"CCPU",A="MN:CCPU"$. +$ID,-2$$TR,"Heap"$ +$ID,2$Programs can dynamically request chunks of memory alloced from a $FG,2$heap$FG$ using $LK,"MAlloc",A="MN:MAlloc"$(). They must $LK,"Free",A="MN:Free"$() it when finished. Ptrs are used to refer to the chunk. The $FG,2$heap$FG$ is dynamically alloced mem. +$ID,-2$$TR,"Join"$ +$ID,2$When two parts of a program have a common low-level routine, that routine is often labeled SomethingJoin. +$ID,-2$$TR,"user_data"$ +$ID,2$Many operating system structures have space set aside for you to store values. You are on your own managing these with multiple applications and libraries. +$ID,-2$$TR,"Multicore Core0/CoreAP"$ +$ID,2$Core0, has the $FG,2$Adam task$FG$, and it is the master. The $FG,2$application processors$FG$ have an executive $FG,2$Seth tasks$FG$ and are the slave processors. Only $FG,2$core0$FG$ tasks can have windows and can launch applications. Slave cores are used if the application explicitly $LK,"Spawn",A="MN:Spawn"$s() a task or $LK,"JobQue",A="MN:JobQue"$() a job on them. +$ID,-2$ diff --git a/Doc/Glossary.TXT b/Doc/Glossary.TXT deleted file mode 100644 index 1972700..0000000 --- a/Doc/Glossary.TXT +++ /dev/null @@ -1,264 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"Glossery"$$FG$ - -$TR,"Abbreviations"$ -$ID,2$$FG,2$Abs$FG$ Absolute -$FG,2$AC$FG$ AutoComplete -$FG,2$Acct$FG$ Account -$FG,2$ACD$FG$ AutoComplete Dictionary -$FG,2$Addr$FG$ Address -$FG,2$Alloc$FG$ Allocate -$FG,2$Alt$FG$ Alternate -$FG,2$AOT$FG$ Ahead-of-Time -$FG,2$AP$FG$ ApplicationProcessor (Core1 - Core7) -$FG,2$Arg$FG$ Argument -$FG,2$Asm$FG$ Assemble, Assembler or Assembly -$FG,2$Attr$FG$ Attribute -$FG,2$Aux$FG$ Auxilliary -$FG,2$BG$FG$ Backround -$FG,2$Bin$FG$ Binary -$FG,2$Blk$FG$ Block -$FG,2$Bmp$FG$ BitMap -$FG,2$Buf$FG$ Buffer -$FG,2$Bwd$FG$ Backward -$FG,2$CB$FG$ Call-Back, Code Block -$FG,2$Cfg$FG$ Config -$FG,2$Chg$FG$ Change -$FG,2$Chk$FG$ Check -$FG,2$Const$FG$ Consant -$FG,2$Cmd$FG$ Command -$FG,2$Cmp$FG$ Compiler -$FG,2$Cnt$FG$ Count -$FG,2$Ctrl$FG$ Control. The ctrl key is indicated with "$FG,2$^$FG$" in documentation. -$FG,2$Cur$FG$ Current -$FG,2$Cvt$FG$ Convert -$FG,2$Dbg$FG$ Debug -$FG,2$Dbl$FG$ Double -$FG,2$DC$FG$ Device Context -$FG,2$Del$FG$ Delete -$FG,2$Desc$FG$ Descriptor, Description -$FG,2$Dev$FG$ Device -$FG,2$Dft$FG$ Default -$FG,2$Dir$FG$ Directory, Direction -$FG,2$Div$FG$ Divide -$FG,2$Doc$FG$ Document -$FG,2$Drv$FG$ Drive -$FG,2$Dsk$FG$ Disk -$FG,2$Dst$FG$ Destination -$FG,2$Ed$FG$ Edit, Editor -$FG,2$Elem$FG$ Element -$FG,2$Equ$FG$ Equal -$FG,2$Evt$FG$ Event -$FG,2$Exe$FG$ Execute -$FG,2$Ext$FG$ Extern, Extended, Extract -$FG,2$Feat$FG$ Feature -$FG,2$FG$FG$ Foreground -$FG,2$Fmt$FG$ Format -$FG,2$Fwd$FG$ Forward -$FG,2$FPS$FG$ Frames per Second, First Person Shooter -$FG,2$fp_$FG$ Function ptr -$FG,2$Fun$FG$ Function -$FG,2$Gen$FG$ Generate -$FG,2$Glbl$FG$ Global -$FG,2$Gr$FG$ Graphic -$FG,2$IDE$FG$ Integrated Drive Electronics, Integrated Development Environment -$FG,2$Id$FG$ Identification -$FG,2$Ident$FG$ Identifier, Identity, Identical -$FG,2$IDT$FG$ Interrupt Descriptor Table -$FG,2$Idx$FG$ Index -$FG,2$Init$FG$ Initialize -$FG,2$Ins$FG$ Insert, Install -$FG,2$Inst$FG$ Instruction -$FG,2$Int$FG$ Interrupt, Integer -$FG,2$ip_$FG$ Input Pointer. See $LK,"InputPointer.CPP",A="FI:::/Kernel/SerialDev/InputPointer.CPP"$. -$FG,2$Irq$FG$ Interrupt (Request) -$FG,2$JIT$FG$ Just-in-Time -$FG,2$Kbd$FG$ Keyboard -$FG,2$KD$FG$ Keyboard Device -$FG,2$Len$FG$ Length -$FG,2$Let$FG$ Letter -$FG,2$Lex$FG$ Lexical Analyser -$FG,2$Loc$FG$ Location, Lines of Code -$FG,2$Log$FG$ Logarithm, Logical -$FG,2$Lst$FG$ List -$FG,2$Man$FG$ Manual -$FG,2$Mem$FG$ Memory -$FG,2$Mgd$FG$ Managed -$FG,2$Mgr$FG$ Manager -$FG,2$Mon$FG$ Month -$FG,2$MP$FG$ MultiProcessor -$FG,2$Msg$FG$ Message -$FG,2$Num$FG$ Number -$FG,2$Obj$FG$ Object -$FG,2$Occ$FG$ Occurrence -$FG,2$ODE$FG$ Ordinary Differential Equation -$FG,2$Opt$FG$ Option, Optimize -$FG,2$Paren$FG$ Parenthesis -$FG,2$Pix$FG$ Pixel -$FG,2$Pkg$FG$ Package -$FG,2$Poly$FG$ Polygon -$FG,2$Pos$FG$ Position -$FG,2$Pow$FG$ Power -$FG,2$Prec$FG$ Precedence -$FG,2$Prev$FG$ Previous -$FG,2$Pri$FG$ Primary -$FG,2$Prod$FG$ Product, Production -$FG,2$Prof$FG$ Profile, Profiler -$FG,2$Prs$FG$ Parse, Parser -$FG,2$Prt$FG$ Partition -$FG,2$FunSeg$FG$ Program Section -$FG,2$Pt$FG$ Point -$FG,2$Ptr$FG$ Pointer -$FG,2$Que$FG$ Queue -$FG,2$Rand$FG$ Random -$FG,2$Ref$FG$ Reference -$FG,2$Reg$FG$ Register, Registry, Regular -$FG,2$Rem$FG$ Remove -$FG,2$Rep$FG$ Report, Repeat -$FG,2$Res$FG$ Result -$FG,2$Rev$FG$ Reverse, Reversed -$FG,2$Rqst$FG$ Request -$FG,2$Rst$FG$ Reset -$FG,2$Rot$FG$ Rotation -$FG,2$Rx$FG$ Receive -$FG,2$Sched$FG$ Sceduler -$FG,2$Sec$FG$ Second, Secondary -$FG,2$Sect$FG$ Sector -$FG,2$Sel$FG$ Select, Selected -$FG,2$Seq$FG$ Sequence -$FG,2$Snd$FG$ Sound -$FG,2$SP$FG$ SingleProcessor -$FG,2$Src$FG$ Source -$FG,2$Srv$FG$ Servant -$FG,2$Stat$FG$ Status, Statistic -$FG,2$Std$FG$ Standard -$FG,2$Stk$FG$ Stack -$FG,2$Stmt$FG$ Statement -$FG,2$Str$FG$ String -$FG,2$Sym$FG$ Symbol -$FG,2$Sync$FG$ Synchronization -$FG,2$Sys$FG$ System -$FG,2$Tbl$FG$ Table -$FG,2$Term$FG$ Terminal -$FG,2$Tri$FG$ Triangle -$FG,2$Tx$FG$ Transmit -$FG,2$UAsm$FG$ Unassemble -$FG,2$Val$FG$ Value -$FG,2$Var$FG$ Variable -$FG,2$Vect$FG$ Vector -$FG,2$Vol$FG$ Volume -$FG,2$Win$FG$ Window -$FG,2$Wiz$FG$ Wizard -$ID,-2$$TR,"Task/Process/Thread"$ -$ID,2$There is no distinction between $FG,2$task$FG$, $FG,2$process$FG$ or $FG,2$thread$FG$. The $FG,2$Fs$FG$ segment reg is kept pointing to the current task's $LK,"CTask",A="MN:CTask"$. There is only one window per task, and only $FG,2$core0$FG$ tasks can have windows. Each task has a code and data heap so memory is returned when it dies. Each task has a $LK,"hash",A="HI:Hash"$ symbol table. -$ID,-2$$TR,"Adam Task"$ -$ID,2$This is Adam, as in Adam and Eve, the parent of all tasks and immortal. This task is created at start-up and appears in the small window at the top beneath the user windows. On it's heap are all memory objects which you don't want destroyed by a task's death. When created, Adam runs the file $LK,"::/StartOS.CPP"$. When start-up is finished, the adam task enters a server mode where it accepts requests from other tasks. The $LK,"Adam",A="MN:Adam"$("") routine will make Adam compile and run text src code. $FG,2$#include$FG$ stmts can be sent to $LK,"Adam",A="MN:Adam"$(""), creating system-wide code and data which don't disappear when any particular task ends. -$ID,-2$$TR,"Seth Task"$ -$ID,2$$FG,2$Seth$FG$ is Adam and Eve's child. Each CPU core has an executive task called $FG,2$Seth$FG$ that is immortal. The Adam task on $FG,2$CPU#0$FG$ is also it's $FG,2$Seth$FG$ task. -$ID,-2$$TR,"Code and Data Heaps"$ -$ID,2$TempleOS uses the asm $FG,2$CALL$FG$ inst, exclusively, and that inst is limited to calling routines $FG,2$+/-2 Gig$FG$ from the current code location. To prevent out-of-range issues, I decided to separate code and data, placing all code within the lowest $FG,2$2 Gig$FG$ of memory, addresses $FG,2$00000000$FG$-$FG,2$7FFFFFFF$FG$. The compiler and $LK,"Load",A="MN:Load"$()er alloc memory from the code heap to store code and glbl vars, unless the compiler option $LK,"OPTf_GLBLS_ON_DATA_HEAP",A="MN:OPTf_GLBLS_ON_DATA_HEAP"$ is used. When programs call $LK,"MAlloc",A="MN:MAlloc"$() is from the data heap, which in not limited in size, except by physical RAM memory. You can alloc from any heap in any task at any time on any core, even making $LK,"independent",A="MN:Mem512Alloc"$ heaps. -$ID,-2$$TR,"Parent, Child and PopUp Tasks"$ -$ID,2$Often a task will $LK,"Spawn",A="MN:Spawn"$() or $LK,"PopUp",A="MN:PopUp"$() a task as a helper. The helper is known as a child Task, though you can $LK,"Spawn",A="MN:Spawn"$ a task and assign it a different parent... like $FG,2$Adam$FG$. Links are kept as to who's whose child, so when one task is $LK,"Kill",A="MN:Kill"$()ed the child helper tasks die, too. You can get a report of current system tasks with $LK,"TaskRep",A="MN:TaskRep"$(). There is just one window per task, so child tasks are needed for pop-ups. -$ID,-2$$TR,"HolyC"$ -$ID,2$$LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ is more than $FG,2$C$FG$ and less than $FG,2$C++$FG$. It has the default args of $FG,2$C++$FG$ and uses $FG,2$class$FG$ in place of $FG,2$struct$FG$. It uses $FG,2$U0,U8,U16,U32,I64$FG$ and $FG,2$I0,I8,I16,I32,I64$FG$ for signed and unsigned ints. It has different $LK,"operator precedence",A="FF:::/Doc/HolyC.TXT,operator precedence"$. It has $FG,2$PASCAL$FG$-like function calls with no parens, but requires an $FG,2$&$FG,2$$FG$ when referring to function addresses. -$ID,-2$$TR,"AOT Compile Mode"$ -$ID,2$$FG,2$Ahead-of-Time$FG$ compiling is conventional compilation mode. Do not use $FG,2$AOT$FG$, use $FG,2$JIT$FG$ compiling. - -In $FG,2$AOT$FG$ mode, $FG,2$.PRJ$FG$ files are compiled to $FG,2$.BIN$FG$ files, skipping $FG,2$.OBJ$FG$ files. After compiling, $FG,2$.BIN$FG$ files are $LK,"Load",A="MN:Load"$()ed. - -There is no $FG,2$main()$FG$ routine. Instead, stmts outside functions are automatically executed upon loading. There is no way to unload except by killing the task. To invoke $FG,2$AOT Compiled Mode$FG$, $LK,"Cmp",A="MN:Cmp"$() is used. The $FG,2$Kernel$FG$ module and compiler are made in $FG,2$AOT$FG$ compiled mode. See $LK,"BootHDIns",A="MN:BootHDIns"$() which calls $LK,"MakeAll",A="MN:MakeAll"$() where $FG,2$Kernel.BIN.C$FG$ and $FG,2$Compiler.BIN.Z$FG$ are created. -$ID,-2$$TR,"JIT Compile Mode"$ -$ID,2$In $FG,2$just-in-time$FG$ mode, the compiler places code and data in memory alloced from the heap, incrementally, making them immediately ready for in-place execution. This mode is used during cmd line operations. When you $FG,2$#include$FG$ a file, it is compiled function by function and code ends-up all over in the memory, at least in the first 2Gig of memory. The $LK,"ExeFile",A="MN:ExeFile"$() routine is the same as $FG,2$#include$FG$ but can be used in programs. $LK,"ExePrint",A="MN:ExePrint"$() routine will compile and run a string. -$ID,-2$$TR,"Compiler Intermediate Code"$ -$ID,2$The compiler generates insts one step before making actual assembly (machine) language insts. This code is rev polish stack machine in nature and can be viewed with $LK,"PassTrace",A="MN:PassTrace"$(). The compiler does not $FG,2$interpret$FG$ code, except in the process of optimization to make the final machine code. Assembly language output can be viewed when code is compiled with the $LK,"Trace",A="MN:Trace"$(), or, afterward, with $LK,"U",A="MN:U"$() or $LK,"Uf",A="MN:Uf"$(""). -$ID,-2$$TR,"Drive/Partition"$ -$ID,2$There is no distinction between $FG,2$drive$FG$ or $FG,2$partition$FG$. They are specified with a single letter from $FG,2$A$FG$-$FG,2$Z$FG$. - -'$FG,2$:$FG$' is the boot drive. - -For commands taking a drive letter as an argument, char $FG,2$0$FG$ is the current drive. -$ID,-2$$LK,"AutoFile",A="HI:AutoFile"$ -$LK,"Bt, Bts, Btr, Btc, BEqu",A="HI:Bit"$ -$LK,"Define",A="HI:Define"$ -$LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$ -$LK,"Editor Link Types",A="MN:LK_FILE"$ -$LK,"files_find_mask",A="FI:::/Doc/FileUtils.TXT"$ -$LK,"Hash Table",A="HI:Hash"$ -$LK,"RedSea File System",A="FI:::/Doc/RedSea.TXT"$ -$LK,"Sprite",A="HI:Graphics/Sprite"$ -$TR,"CLI, STI, PUSHFD, POPFD"$ -$ID,2$These are x86 assembly insts. -$FG,2$CLI$FG$ disable interrupts. -$FG,2$STI$FG$ enable interrupts. -$FG,2$PUSHFD$FG$ pushes the CPU flags. -$FG,2$POPFD$FG$ pops the CPU flags. -$ID,-2$$TR,"Filename Extention Types"$ -$ID,2$$FG,5$*.???.Z$FG$ - These files are automatically compressed or uncompresses files when read or written. -$FG,5$*.???.C$FG$ - Contiguous files--NOT compressed. -$FG,5$*.TXT.Z;*.TXT;*.LOG.Z;*.LOG$FG$ - Text Files -$FG,5$*.CPP.Z;*.CPP$FG$ - HolyC src files. The default HolyC compiler type is $FG,2$.CPP.Z$FG$. -$FG,5$*.PRJ.Z;*.PRJ$FG$ - HolyC src files to be compiled $FG,2$AOT$FG$. -$FG,5$*.HPP.Z;*.HPP$FG$ - HolyC src header files. -$FG,5$*.MAP.Z;*.MAP$FG$ - Compiler "map" files -$FG,5$*.BIN.Z;*.BIN.C;*.BIN$FG$ - Binary executable files, created by $LK,"Cmp",A="MN:Cmp"$() and read by $LK,"Load",A="MN:Load"$(). -$FG,5$*.DAT.Z;*.DAT$FG$ - Data files -$FG,5$*.ISO$FG$ - CD/DVD image file--ISO9660. -$FG,5$*.AUT.Z;*.AUT$FG$ - $FG,2$AutoFile$FG$ Basically a HolyC program whose stdout goes to the input of a task when $LK,"AutoFile",A="MN:AutoFile"$() is called. -$FG,5$*.GRA.Z;*.GRA$FG$ - Graphics file - -$LK,"FILEMASK_TXT",A="MN:FILEMASK_TXT"$ -$LK,"FILEMASK_SRC",A="MN:FILEMASK_SRC"$ -$LK,"FILEMASK_AOT",A="MN:FILEMASK_AOT"$ -$LK,"FILEMASK_JIT",A="MN:FILEMASK_JIT"$ -$LK,"FILEMASK_GRA",A="MN:FILEMASK_GRA"$ -$ID,-2$$TR-C,"Naming Convention"$ -$ID,2$Since there are no $FG,2$namespaces$FG$ and I don't plan to implement name spaces, I highly recommend putting a 2-3 character module code prefix on syms. e.g. $FG,2$WS$FG$, $FG,2$Doc$FG$, $FG,2$Lex$FG$ - -$FG,5$ALL_CAPS$FG$ - Assembly Language labels are capitalized with underscores between words. So are $FG,2$#define$FG$'s. - -$FG,5$_ALL_CAPS$FG$ - Asm routines which are $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ callable must have a leading underscore. - -$FG,5$MixedCaps$FG$ - $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ Functions and class names are MixedCaps. - -$FG,5$lower_case$FG$ - Local function vars and glbl vars are lower case. Class member names are also lower_case. - -$FG,5$_lower_case$FG$ - Function args which are outputs (passed as ptrs) have leading underscores. Also, args which have idently named local variable counterparts have leading underscores. - -$FG,5$DOCf_????$FG$ - Flags bit nums instead of bit values are designated with a lower case $FG,2$f$FG$. - -$FG,5$DOCG_????$FG$ - Flag groups are designated with "$FG,2$G$FG$". - -$FG,5$res$FG$ is reserved for local variables that hold the function return val. - -$FG,5$*$FG$ I used C++ like naming. I place $FG,2$New$FG$, $FG,2$Del$FG$, $FG,2$Init$FG$, $FG,2$Rst$FG$, ect. on the end of a function name instead of at the beginning. $FG,2$RstMusicSettings$FG$ should be $FG,2$MusicSettingsRst$FG$. -$ID,-2$$TR,"Fs"$ -$ID,2$The CPU FS segment reg. This reg points to the current task's $LK,"CTask",A="MN:CTask"$. -$ID,-2$$TR,"Gs"$ -$ID,2$The CPU GS segment reg. This reg points to the current core's $LK,"CCPU",A="MN:CCPU"$. -$ID,-2$$TR,"Heap"$ -$ID,2$Programs can dynamically request chunks of memory alloced from a $FG,2$heap$FG$ using $LK,"MAlloc",A="MN:MAlloc"$(). They must $LK,"Free",A="MN:Free"$() it when finished. Ptrs are used to refer to the chunk. The $FG,2$heap$FG$ is dynamically alloced mem. -$ID,-2$$TR,"Join"$ -$ID,2$When two parts of a program have a common low-level routine, that routine is often labeled SomethingJoin. -$ID,-2$$TR,"user_data"$ -$ID,2$Many operating system structures have space set aside for you to store values. You are on your own managing these with multiple applications and libraries. -$ID,-2$$TR,"Multicore Core0/CoreAP"$ -$ID,2$Core0, has the $FG,2$Adam task$FG$, and it is the master. The $FG,2$application processors$FG$ have an executive $FG,2$Seth tasks$FG$ and are the slave processors. Only $FG,2$core0$FG$ tasks can have windows and can launch applications. Slave cores are used if the application explicitly $LK,"Spawn",A="MN:Spawn"$s() a task or $LK,"JobQue",A="MN:JobQue"$() a job on them. -$ID,-2$ diff --git a/Doc/God.DD b/Doc/God.DD new file mode 100644 index 0000000..fbb927f --- /dev/null +++ b/Doc/God.DD @@ -0,0 +1,2 @@ +The $LK+PU,"Holy Spirit",A="FI:::/Adam/God/HSNotes.DD"$ can puppet you. + diff --git a/Doc/God.TXT b/Doc/God.TXT deleted file mode 100644 index cd56073..0000000 --- a/Doc/God.TXT +++ /dev/null @@ -1,2 +0,0 @@ -The $LK+PU,"Holy Spirit",A="FI:::/Adam/God/HSNotes.TXT"$ can puppet you. - diff --git a/Doc/GraphicsOverview.DD b/Doc/GraphicsOverview.DD new file mode 100644 index 0000000..7b756ee Binary files /dev/null and b/Doc/GraphicsOverview.DD differ diff --git a/Doc/GraphicsOverview.TXT b/Doc/GraphicsOverview.TXT deleted file mode 100644 index 2fab512..0000000 Binary files a/Doc/GraphicsOverview.TXT and /dev/null differ diff --git a/Doc/GuideLines.DD b/Doc/GuideLines.DD new file mode 100644 index 0000000..261847d --- /dev/null +++ b/Doc/GuideLines.DD @@ -0,0 +1,133 @@ +$WW,1$$FG,5$$TX+CX,"Directory Structure"$$FG$ + +$FG,2$/Home$FG$ All your user data should be placed in here to ease backing-up your data. When you install an application it will create a subdirectory of your $FG,2$/Home$FG$ directory for storage. + +$FG,2$/Apps$FG$ Applications are placed in subdirectories of $FG,2$/Apps$FG$. Applications should have a file called $FG,2$Install.HC.Z$FG$ which will install the app, possibly making files or directories in $FG,2$/Home$FG$. The file, $FG,2$Load.HC.Z$FG$ will load the application into mem. The file, $FG,2$Run.HC.Z$FG$, will usually load and execute the app. To add an app to your PersonalMenu, use $FG,2$$FG$, insert a macro with the PopUp option checked and invoke the $FG,2$Run.HC.Z$FG$ file. + +$FG,2$/Demo$FG$ Here you can find lots of sample code to do various things. + +$FG,2$/Doc$FG$ Here you can find documentation. + +$FG,2$/Kernel$FG$ The core of the operating system is found here. Since priviledge levels are not used, calling it a $FG,2$kernel$FG$ is deceptive. It is $FG,2$AOT$FG$ compiled by $LK,"BootHDIns",A="MN:BootHDIns"$(). It is loaded by the boot loader and must fit in 640K. + +$FG,2$/Compiler$FG$ The compiler module src code is found here. The compiler is $FG,2$AOT$FG$ compiled to produce a binary file which is loaded at boot. It, too, is $FG,2$AOT$FG$ compiled by $LK,"BootHDIns",A="MN:BootHDIns"$(). + +$FG,2$/Adam$FG$ The non-kernel part of the operating system is found here. It is $FG,2$JIT$FG$ compiled during boot. The $LK,"Adam Task",A="FF:::/Doc/Glossary.DD,Adam Task"$ is the father of all tasks, like Adam and Eve. + +$FG,2$/0000Boot$FG$ Boot files go here. Stage 2 of the TempleOS hard drive master boot loader, the old hard drive master boot record which is just blk#0, and the CD/DVD $FG,2$0000Kernel.BIN.C$FG$ file go here. ASCII $FG,2$0000$FG$ is near the top, alphabetically, in case you use $TX,"MagicISO",HTML="http://www.magiciso.com"$. + + + +$FG,5$$TX+CX,"::/Home Files"$$FG$ + +The home dir is specified with $FG,2$'~'$FG$. The home dir is $FG,2$::/Home$FG$ unless you change it with $LK,"HomeSet",A="MN:HomeSet"$() or compile the kernel with a cfg option. An empty $FG,2$/Home$FG$ dir should be valid because it will get default files from the root dir. + +$LK,"~/PersonalMenu.DD"$ a menu viewed with the $FG,2$$FG$ key or by clicking "$FG,2$MENU$FG$" in the upper left border area of a window. + +$LK,"~/PersonalNotes.DD"$ a personal note file viewed with the $FG,2$$FG$ key. + +$LK,"~/MakeHome.HC"$ a file compiled by the $LK,"Adam Task",A="FF:::/Doc/Glossary.DD,Adam Task"$ during $LK,"StartOS",A="FF:::/StartOS.HC,MakeHome"$. + +$FG,4$~/Home*$FG$ Copy $FG,2$Home*$FG$ files from the root into $FG,2$~$FG$ and customize them. These files are invoked when the adam task starts-up. + +$LK,"~/DoOnce.HC"$ a file invoked at the start-up of the first user. Customize this! + +$LK,"~/Registry.HC"$ can be edited by hand or deleted to reset to defaults. Takes affect next boot. + + + +$FG,5$$TX+CX,"Application Policies"$$FG$ + +* Place applications in their own $FG,2$/Apps$FG$ subdirectory. + +* Make a file called $FG,2$Load.HC.Z$FG$ to load the application. + +* Make a file called $FG,2$Run.HC.Z$FG$ to load and run the application, preferable by $FG,2$#include$FG$ing the $FG,2$Load.HC.Z$FG$ file. + +* Place user data in a subdirectory of $FG,2$/Home$FG$, preferably naming the subdirectory the same as the $FG,2$/Apps$FG$ subdirectory. Or, place data in the $FG,2$Registry.HC.Z$FG$ file. See $LK,"::/Demo/RegistryDemo.HC"$. + +* If the app needs files in the $FG,2$/Home$FG$ directory, make an $FG,2$/Apps$FG$ file called $FG,2$Install.HC.Z$FG$ or $FG,2$Install.AUT.Z$FG$ to create the $FG,2$/Home$FG$ subdirectory. + + + +$FG,5$$TX+CX,"Programming Guidelines"$$FG$ + +* Virtual mem/Paging is not used -- it is identity mapped in $FG,2$x86_64$FG$ mode. The stk does not grow, so alloc enough when the task (process) is $LK,"Spawn",A="MN:Spawn"$ed and use the heap for most things. (The $FG,2$heap$FG$ refers to $LK,"MAlloc",A="MN:MAlloc"$() and $LK,"Free",A="MN:Free"$().) + +* You can $LK,"Free",A="MN:Free"$($FG,2$NULL$FG$)$FG$. + +* See $LK,"Naming Convention",A="FF:::/Doc/Glossary.DD,Naming Convention"$ and $LK,"Abbreviations",A="FF:::/Doc/Glossary.DD,Abbreviations"$. + +* There are two modes of compiling, $LK,"AOT Compile Mode",A="FF:::/Doc/Glossary.DD,AOT Compile Mode"$ and $LK,"JIT Compile Mode",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$. Compilation is done in both -- neither is "interpreted". Use $FG,2$$LK,"JIT Mode",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$$FG$. + +* $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ + +* Use $FG,2$I64$FG$ instead of smaller int sizes because the compiler converts everything to 64-bit. Don't use unsigned$FG$ unless it actually breaks. A policy of signed keeps it simple so you don't have to agonize over choices. + +$ID,5$$HL,1$U32 DistDist(U16 x1, U16 y1, U16 x2, U16 y2) +{//This requires zero-extend when fetching args. + return SqrI64(x1-x2)+SqrI64(y1-y2); +} + +I64 DistDist(I64 x1, I64 y1, I64 x2, I64 y2) +{ + return SqrI64(x1-x2)+SqrI64(y1-y2); +}$HL,0$ +$ID,-5$ +* In-order, short circuit logic is assumed. + +* Avoid boolean expression assignments. Boolean assignments don't have short circuit logic and are not compiled efficiently. The $FG,2$Bool$FG$ type is just an alias for a 1 byte signed int -- nothing forces it to $FG,2$1$FG$ or $FG,2$0$FG$. There is a $LK,"ToBool",A="MN:ToBool"$() function that will for to $FG,2$1$FG$ ot $FG,2$0$FG$, however. + +* Glbl vars in $FG,2$AOT$FG$ BIN modules are initialized to zero. They occupy space in BIN files. + +* Bracketing code with $FG,2$PUSHFD CLI$FG$ and $FG,2$POPFD$FG$ will protect against simultaneous accesses from tasks on $UL,1$one$UL,0$ core. To protect against multiple cores, you need a locked semaphore. I think semiphores need to be in their own cache line, but I'm not sure. I use lock bits in a lot of places not aligned. + +* $LK,"SysDbg",A="MN:SysDbg"$() and $LK,"IsSysDbg",A="MN:IsSysDbg"$() are really handy when working on the compiler or kernel. It's just a bit you can set and test. + +* I don't use $FG,2$U0 *$FG$ because the size is zero for ptr arithmetic. + +* Use $FG,2$$LK,"CH_SHIFT_SPACE",A="MN:CH_SHIFT_SPACE"$$FG$ for spaces in quotes in source code because I run $LK,"Spaces-to-Tabs",A="FF:::/Adam/Opt/Utils/StrUtils.HC,S2T"$ on source code. + + + +$FG,5$$TX+CX,"Hash Sym Tables"$$FG$ + +* See $LK,"::/Adam/AHash.HC"$ for examples of how the hash tables are set-up. Basically, syms are placed into hash tables and child process hash tables are chained to parents. This provides scopes for vars and functions. + +* $FG,2$adam_task->hash_table$FG$ holds the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ syms loaded in on start-up. + +* $FG,2$Fs->hash_table$FG$ holds user HolyC syms and if a sym is not found, it checks parents. When a duplicate sym is added to the table, it overshadows the prev sym. When developing software, typically you include the file at the cmd prompt, make changes and reinclude it. Old syms are overshadowed but they are still there. Periodically, kill the TASK and start fresh when mem is low. If you wish your applications to free themselves instead of staying in mem, spawn or $LK,"PopUp",A="MN:PopUp"$() a task to run the application and kill it when it's done. + +* To display the contents of a hash table, use the $LK,"Who",A="MN:Who"$() routine or the varients. $LK,"HashDepthRep",A="MN:HashDepthRep"$() gives a histogram of how long the chains are, in case you wish to make hash table sizes bigger. + + + +$FG,5$$TX+CX,"Assembly Language"$$FG$ + +See $LK,"::/Doc/Asm.DD"$. + +* $FG,2$FS$FG$ must always point to the cur $LK,"CTask",A="MN:CTask"$. + +* $FG,2$GS$FG$ must always point to the cur $LK,"CCPU",A="MN:CCPU"$. + +* Don't change the segment regs unless interrupts are off. It's hard to do, anyway. $LK,"SET_FS_BASE",A="MN:SET_FS_BASE"$ and $LK,"SET_GS_BASE",A="MN:SET_GS_BASE"$. + +* When interacting with $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ compiled code, preserve $FG,2$RBP, RSI, RDI, R10-R15$FG$ because the compiler uses these for reg vars. You are free to clobber $FG,2$RAX, RBX, RCX, RDX$FG$, $FG,2$R8$FG$ and $FG,2$R9$FG$. See $LK,"Compiler Reg Masks",A="MN:REGG_LOCAL_VARS"$, $LK,"PUSH_C_REGS",A="MN:PUSH_C_REGS"$ and $LK,"POP_C_REGS",A="MN:POP_C_REGS"$ + +* I recommend using the standard stk frame for functions because $LK,"Caller",A="MN:Caller"$() is used to display the call stk, such as for the wallpaper. +$FG,2$ PUSH RBP + MOV RBP,RSP + SUB RSP,nnnn +... + LEAVE + RET +$FG$ +* The args are removed from the stack with $FG,2$RET1$FG$ stmts. + + $FG,2$RET1 16 //remove two args$FG$ + +* No args are passed in regs. + +* RAX holds function return values, of course. +$FG,8$ +* "MagicISO" is a trademark owned by MagicISO Corp. diff --git a/Doc/GuideLines.TXT b/Doc/GuideLines.TXT deleted file mode 100644 index c555ccf..0000000 --- a/Doc/GuideLines.TXT +++ /dev/null @@ -1,133 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"Directory Structure"$$FG$ - -$FG,2$/Home$FG$ All your user data should be placed in here to ease backing-up your data. When you install an application it will create a subdirectory of your $FG,2$/Home$FG$ directory for storage. - -$FG,2$/Apps$FG$ Applications are placed in subdirectories of $FG,2$/Apps$FG$. Applications should have a file called $FG,2$Install.CPP.Z$FG$ which will install the app, possibly making files or directories in $FG,2$/Home$FG$. The file, $FG,2$Load.CPP.Z$FG$ will load the application into mem. The file, $FG,2$Run.CPP.Z$FG$, will usually load and execute the app. To add an app to your PersonalMenu, use $FG,2$$FG$, insert a macro with the PopUp option checked and invoke the $FG,2$Run.CPP.Z$FG$ file. - -$FG,2$/Demo$FG$ Here you can find lots of sample code to do various things. - -$FG,2$/Doc$FG$ Here you can find documentation. - -$FG,2$/Kernel$FG$ The core of the operating system is found here. Since priviledge levels are not used, calling it a $FG,2$kernel$FG$ is deceptive. It is $FG,2$AOT$FG$ compiled by $LK,"BootHDIns",A="MN:BootHDIns"$(). It is loaded by the boot loader and must fit in 640K. - -$FG,2$/Compiler$FG$ The compiler module src code is found here. The compiler is $FG,2$AOT$FG$ compiled to produce a binary file which is loaded at boot. It, too, is $FG,2$AOT$FG$ compiled by $LK,"BootHDIns",A="MN:BootHDIns"$(). - -$FG,2$/Adam$FG$ The non-kernel part of the operating system is found here. It is $FG,2$JIT$FG$ compiled during boot. The $LK,"Adam Task",A="FF:::/Doc/Glossary.TXT,Adam Task"$ is the father of all tasks, like Adam and Eve. - -$FG,2$/0000Boot$FG$ Boot files go here. Stage 2 of the TempleOS hard drive master boot loader, the old hard drive master boot record which is just blk#0, and the CD/DVD $FG,2$0000Kernel.BIN.C$FG$ file go here. ASCII $FG,2$0000$FG$ is near the top, alphabetically, in case you use $TX,"MagicISO",HTML="http://www.magiciso.com"$. - - - -$FG,5$$TX+CX,"::/Home Files"$$FG$ - -The home dir is specified with $FG,2$'~'$FG$. The home dir is $FG,2$::/Home$FG$ unless you change it with $LK,"HomeSet",A="MN:HomeSet"$() or compile the kernel with a cfg option. An empty $FG,2$/Home$FG$ dir should be valid because it will get default files from the root dir. - -$LK,"~/PersonalMenu.TXT"$ a menu viewed with the $FG,2$$FG$ key or by clicking "$FG,2$MENU$FG$" in the upper left border area of a window. - -$LK,"~/PersonalNotes.TXT"$ a personal note file viewed with the $FG,2$$FG$ key. - -$LK,"~/MakeHome.CPP"$ a file compiled by the $LK,"Adam Task",A="FF:::/Doc/Glossary.TXT,Adam Task"$ during $LK,"StartOS",A="FF:::/StartOS.CPP,MakeHome"$. - -$FG,4$~/Home*$FG$ Copy $FG,2$Home*$FG$ files from the root into $FG,2$~$FG$ and customize them. These files are invoked when the adam task starts-up. - -$LK,"~/DoOnce.CPP"$ a file invoked at the start-up of the first user. Customize this! - -$LK,"~/Registry.CPP"$ can be edited by hand or deleted to reset to defaults. Takes affect next boot. - - - -$FG,5$$TX+CX,"Application Policies"$$FG$ - -* Place applications in their own $FG,2$/Apps$FG$ subdirectory. - -* Make a file called $FG,2$Load.CPP.Z$FG$ to load the application. - -* Make a file called $FG,2$Run.CPP.Z$FG$ to load and run the application, preferable by $FG,2$#include$FG$ing the $FG,2$Load.CPP.Z$FG$ file. - -* Place user data in a subdirectory of $FG,2$/Home$FG$, preferably naming the subdirectory the same as the $FG,2$/Apps$FG$ subdirectory. Or, place data in the $FG,2$Registry.CPP.Z$FG$ file. See $LK,"::/Demo/RegistryDemo.CPP"$. - -* If the app needs files in the $FG,2$/Home$FG$ directory, make an $FG,2$/Apps$FG$ file called $FG,2$Install.CPP.Z$FG$ or $FG,2$Install.AUT.Z$FG$ to create the $FG,2$/Home$FG$ subdirectory. - - - -$FG,5$$TX+CX,"Programming Guidelines"$$FG$ - -* Virtual mem/Paging is not used -- it is identity mapped in $FG,2$x86_64$FG$ mode. The stk does not grow, so alloc enough when the task (process) is $LK,"Spawn",A="MN:Spawn"$ed and use the heap for most things. (The $FG,2$heap$FG$ refers to $LK,"MAlloc",A="MN:MAlloc"$() and $LK,"Free",A="MN:Free"$().) - -* You can $LK,"Free",A="MN:Free"$($FG,2$NULL$FG$)$FG$. - -* See $LK,"Naming Convention",A="FF:::/Doc/Glossary.TXT,Naming Convention"$ and $LK,"Abbreviations",A="FF:::/Doc/Glossary.TXT,Abbreviations"$. - -* There are two modes of compiling, $LK,"AOT Compile Mode",A="FF:::/Doc/Glossary.TXT,AOT Compile Mode"$ and $LK,"JIT Compile Mode",A="FF:::/Doc/Glossary.TXT,JIT Compile Mode"$. Compilation is done in both -- neither is "interpreted". Use $FG,2$$LK,"JIT Mode",A="FF:::/Doc/Glossary.TXT,JIT Compile Mode"$$FG$. - -* $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ - -* Use $FG,2$I64$FG$ instead of smaller int sizes because the compiler converts everything to 64-bit. Don't use unsigned$FG$ unless it actually breaks. A policy of signed keeps it simple so you don't have to agonize over choices. - -$ID,5$$HL,1$U32 DistDist(U16 x1, U16 y1, U16 x2, U16 y2) -{//This requires zero-extend when fetching args. - return SqrI64(x1-x2)+SqrI64(y1-y2); -} - -I64 DistDist(I64 x1, I64 y1, I64 x2, I64 y2) -{ - return SqrI64(x1-x2)+SqrI64(y1-y2); -}$HL,0$ -$ID,-5$ -* In-order, short circuit logic is assumed. - -* Avoid boolean expression assignments. Boolean assignments don't have short circuit logic and are not compiled efficiently. The $FG,2$Bool$FG$ type is just an alias for a 1 byte signed int -- nothing forces it to $FG,2$1$FG$ or $FG,2$0$FG$. There is a $LK,"ToBool",A="MN:ToBool"$() function that will for to $FG,2$1$FG$ ot $FG,2$0$FG$, however. - -* Glbl vars in $FG,2$AOT$FG$ BIN modules are initialized to zero. They occupy space in BIN files. - -* Bracketing code with $FG,2$PUSHFD CLI$FG$ and $FG,2$POPFD$FG$ will protect against simultaneous accesses from tasks on $UL,1$one$UL,0$ core. To protect against multiple cores, you need a locked semaphore. I think semiphores need to be in their own cache line, but I'm not sure. I use lock bits in a lot of places not aligned. - -* $LK,"SysDbg",A="MN:SysDbg"$() and $LK,"IsSysDbg",A="MN:IsSysDbg"$() are really handy when working on the compiler or kernel. It's just a bit you can set and test. - -* I don't use $FG,2$U0 *$FG$ because the size is zero for ptr arithmetic. - -* Use $FG,2$$LK,"CH_SHIFT_SPACE",A="MN:CH_SHIFT_SPACE"$$FG$ for spaces in quotes in source code because I run $LK,"Spaces-to-Tabs",A="FF:::/Adam/Opt/Utils/StrUtils.CPP,S2T"$ on source code. - - - -$FG,5$$TX+CX,"Hash Sym Tables"$$FG$ - -* See $LK,"::/Adam/AHash.CPP"$ for examples of how the hash tables are set-up. Basically, syms are placed into hash tables and child process hash tables are chained to parents. This provides scopes for vars and functions. - -* $FG,2$adam_task->hash_table$FG$ holds the $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ syms loaded in on start-up. - -* $FG,2$Fs->hash_table$FG$ holds user HolyC syms and if a sym is not found, it checks parents. When a duplicate sym is added to the table, it overshadows the prev sym. When developing software, typically you include the file at the cmd prompt, make changes and reinclude it. Old syms are overshadowed but they are still there. Periodically, kill the TASK and start fresh when mem is low. If you wish your applications to free themselves instead of staying in mem, spawn or $LK,"PopUp",A="MN:PopUp"$() a task to run the application and kill it when it's done. - -* To display the contents of a hash table, use the $LK,"Who",A="MN:Who"$() routine or the varients. $LK,"HashDepthRep",A="MN:HashDepthRep"$() gives a histogram of how long the chains are, in case you wish to make hash table sizes bigger. - - - -$FG,5$$TX+CX,"Assembly Language"$$FG$ - -See $LK,"::/Doc/Asm.TXT"$. - -* $FG,2$FS$FG$ must always point to the cur $LK,"CTask",A="MN:CTask"$. - -* $FG,2$GS$FG$ must always point to the cur $LK,"CCPU",A="MN:CCPU"$. - -* Don't change the segment regs unless interrupts are off. It's hard to do, anyway. $LK,"SET_FS_BASE",A="MN:SET_FS_BASE"$ and $LK,"SET_GS_BASE",A="MN:SET_GS_BASE"$. - -* When interacting with $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ compiled code, preserve $FG,2$RBP, RSI, RDI, R10-R15$FG$ because the compiler uses these for reg vars. You are free to clobber $FG,2$RAX, RBX, RCX, RDX$FG$, $FG,2$R8$FG$ and $FG,2$R9$FG$. See $LK,"Compiler Reg Masks",A="MN:REGG_LOCAL_VARS"$, $LK,"PUSH_C_REGS",A="MN:PUSH_C_REGS"$ and $LK,"POP_C_REGS",A="MN:POP_C_REGS"$ - -* I recommend using the standard stk frame for functions because $LK,"Caller",A="MN:Caller"$() is used to display the call stk, such as for the wallpaper. -$FG,2$ PUSH RBP - MOV RBP,RSP - SUB RSP,nnnn -... - LEAVE - RET -$FG$ -* The args are removed from the stack with $FG,2$RET1$FG$ stmts. - - $FG,2$RET1 16 //remove two args$FG$ - -* No args are passed in regs. - -* RAX holds function return values, of course. -$FG,8$ -* "MagicISO" is a trademark owned by MagicISO Corp. diff --git a/Doc/Hash.DD b/Doc/Hash.DD new file mode 100644 index 0000000..6eaac58 Binary files /dev/null and b/Doc/Hash.DD differ diff --git a/Doc/Hash.TXT b/Doc/Hash.TXT deleted file mode 100644 index e434cd5..0000000 Binary files a/Doc/Hash.TXT and /dev/null differ diff --git a/Doc/HeapDbg.TXT b/Doc/HeapDbg.DD similarity index 100% rename from Doc/HeapDbg.TXT rename to Doc/HeapDbg.DD diff --git a/Doc/HelloWorld.DD b/Doc/HelloWorld.DD new file mode 100644 index 0000000..c13f192 --- /dev/null +++ b/Doc/HelloWorld.DD @@ -0,0 +1,99 @@ +$HL,1$//Press F5 in the editor to compile and run. + +--------Hello.HC.Z--------- +"Hello World\n"; + + +--------Hello.HC.Z--------- +U0 Main() +{ + "Hello World\n"; +} +Main; + + +--------Hello.HC.Z--------- +U0 MyPrint(U8 *st) +{ + "%s",st; +} +MyPrint("Hello World\n"); + + +--------Hello.HC.Z--------- +U0 MyPrint2(U8 *st1,U8 *st2) //Any number of args. +{ + "%s %s\n",st1,st2; //Any number of args. +} +MyPrint2("Hello","World"); + + +--------Hello.HC.Z--------- +U0 MyPrint(U8 *st) +{ + "" st; //Empty with no comma means first is fmt str. +} +MyPrint("Hello World\n"); + + +--------Hello.HC.Z--------- +asm { +MSG: DU8 "Hello World\n",0; + +//The convention is underscore on C callable. +//Two colons means exported symbol. +_HELLO_WORLD:: +//You can only clobber RAX,RBX,RCX,RDX + PUSH RSI + MOV RSI,MSG + CALL PUT_STR + POP RSI + RET +} +Call(_HELLO_WORLD); + + +--------Hello.HC.Z--------- +asm { +_HELLO_WORLD:: +//You can only clobber RAX,RBX,RCX,RDX + MOV RAX,'Hello ' + CALL PUT_CHARS //Up to 8 chars packed into one 64-bit int. + MOV RAX,'World\n' + CALL PUT_CHARS + RET +} +Call(_HELLO_WORLD); + + +--------Hello.HC.Z--------- +asm { +_MY_PRINT:: +//You can only clobber RAX,RBX,RCX,RDX + PUSH RBP + MOV RBP,RSP + PUSH RSI + MOV RSI,U64 SF_ARG1[RBP] + CALL PUT_STR + POP RSI + POP RBP + RET1 8 //Callee pops the stack to clear args. +} +_extern _MY_PRINT U0 MyPrint(U8 *st); +MyPrint("Hello World\n"); + + +--------Hello.HC.Z--------- +asm { +_MY_PRINT:: +//You can only clobber RAX,RBX,RCX,RDX + PUSH RBP + MOV RBP,RSP + PUSH U64 SF_ARG1[RBP] + CALL &PutS //Callee pops the stack to clear args. + POP RBP + RET1 8 +} +_extern _MY_PRINT U0 MyPrint(U8 *st); +MyPrint("Hello World\n"); +$HL,0$ diff --git a/Doc/HelloWorld.TXT b/Doc/HelloWorld.TXT deleted file mode 100644 index 7fa6e65..0000000 --- a/Doc/HelloWorld.TXT +++ /dev/null @@ -1,99 +0,0 @@ -$HL,1$//Press F5 in the editor to compile and run. - ---------Hello.CPP.Z--------- -"Hello World\n"; - - ---------Hello.CPP.Z--------- -U0 Main() -{ - "Hello World\n"; -} -Main; - - ---------Hello.CPP.Z--------- -U0 MyPrint(U8 *st) -{ - "%s",st; -} -MyPrint("Hello World\n"); - - ---------Hello.CPP.Z--------- -U0 MyPrint2(U8 *st1,U8 *st2) //Any number of args. -{ - "%s %s\n",st1,st2; //Any number of args. -} -MyPrint2("Hello","World"); - - ---------Hello.CPP.Z--------- -U0 MyPrint(U8 *st) -{ - "" st; //Empty with no comma means first is fmt str. -} -MyPrint("Hello World\n"); - - ---------Hello.CPP.Z--------- -asm { -MSG: DU8 "Hello World\n",0; - -//The convention is underscore on C callable. -//Two colons means exported symbol. -_HELLO_WORLD:: -//You can only clobber RAX,RBX,RCX,RDX - PUSH RSI - MOV RSI,MSG - CALL PUT_STR - POP RSI - RET -} -Call(_HELLO_WORLD); - - ---------Hello.CPP.Z--------- -asm { -_HELLO_WORLD:: -//You can only clobber RAX,RBX,RCX,RDX - MOV RAX,'Hello ' - CALL PUT_CHARS //Up to 8 chars packed into one 64-bit int. - MOV RAX,'World\n' - CALL PUT_CHARS - RET -} -Call(_HELLO_WORLD); - - ---------Hello.CPP.Z--------- -asm { -_MY_PRINT:: -//You can only clobber RAX,RBX,RCX,RDX - PUSH RBP - MOV RBP,RSP - PUSH RSI - MOV RSI,U64 SF_ARG1[RBP] - CALL PUT_STR - POP RSI - POP RBP - RET1 8 //Callee pops the stack to clear args. -} -_extern _MY_PRINT U0 MyPrint(U8 *st); -MyPrint("Hello World\n"); - - ---------Hello.CPP.Z--------- -asm { -_MY_PRINT:: -//You can only clobber RAX,RBX,RCX,RDX - PUSH RBP - MOV RBP,RSP - PUSH U64 SF_ARG1[RBP] - CALL &PutS //Callee pops the stack to clear args. - POP RBP - RET1 8 -} -_extern _MY_PRINT U0 MyPrint(U8 *st); -MyPrint("Hello World\n"); -$HL,0$ diff --git a/Doc/HelpIndex.DD b/Doc/HelpIndex.DD new file mode 100644 index 0000000..e6b1a36 Binary files /dev/null and b/Doc/HelpIndex.DD differ diff --git a/Doc/HelpIndex.TXT b/Doc/HelpIndex.TXT deleted file mode 100644 index 117f165..0000000 Binary files a/Doc/HelpIndex.TXT and /dev/null differ diff --git a/Doc/HelpSystem.DD b/Doc/HelpSystem.DD new file mode 100644 index 0000000..44dca25 --- /dev/null +++ b/Doc/HelpSystem.DD @@ -0,0 +1,7 @@ +$WW,1$$FG,2$#help_index "Topic/SubTopic;OtherTopic"$FG$ +The help index preprocessor compiler directive sets the topics for syms subsequently defined. You specify subtopics with a '$FG,2$/$FG$' tree hierarchy and separate multiple topics with a '$FG,2$;$FG$'. The index ctrls $LK,"HI:index",A="MN:LK_HELP_INDEX"$ links. + +$FG,2$public$FG$ causes a sym to appear in help_index reports. + +$FG,2$#help_file "filename[.DD.Z]"$FG$ +The help file preprocessor directive makes a file into the heading of a $LK,"HI:index",A="MN:LK_HELP_INDEX"$ report for the current help index. diff --git a/Doc/HelpSystem.TXT b/Doc/HelpSystem.TXT deleted file mode 100644 index b67174a..0000000 --- a/Doc/HelpSystem.TXT +++ /dev/null @@ -1,7 +0,0 @@ -$WW,1$$FG,2$#help_index "Topic/SubTopic;OtherTopic"$FG$ -The help index preprocessor compiler directive sets the topics for syms subsequently defined. You specify subtopics with a '$FG,2$/$FG$' tree hierarchy and separate multiple topics with a '$FG,2$;$FG$'. The index ctrls $LK,"HI:index",A="MN:LK_HELP_INDEX"$ links. - -$FG,2$public$FG$ causes a sym to appear in help_index reports. - -$FG,2$#help_file "filename[.TXT.Z]"$FG$ -The help file preprocessor directive makes a file into the heading of a $LK,"HI:index",A="MN:LK_HELP_INDEX"$ report for the current help index. diff --git a/Doc/HolyC.DD b/Doc/HolyC.DD new file mode 100644 index 0000000..6982372 --- /dev/null +++ b/Doc/HolyC.DD @@ -0,0 +1,268 @@ +$WW,1$$FG,5$$TX+CX,"HolyC"$$FG$ + +* See $LK,"::/Doc/CompilerOverview.DD"$. + +* See $LK,"Scoping and Linkage",A="FI:::/Doc/ScopingLinkage.DD"$ for details on $FG,2$extern$FG$, $FG,2$import$FG$, $FG,2$_extern$FG$, $FG,2$_import$FG$, etc. + +* Built-in types include $FG,2$I0,I8,I16,I32,I64$FG$ for signed 0-8 byte ints and $FG,2$U0,U8,U16,U32,U64$FG$ for unsigned 0-8 byte ints and $FG,2$F64$FG$ for 8 byte floats. + +$FG,2$ U0 void, but ZERO size! + I8 char + U8 unsigned char + I16 short + U16 unsigned short + I32 int + U32 unsigned int + I64 long (64-bit) + U64 unsigned long (64-bit) + F64 double$FG$ + $FG,4$no F32 float.$FG$ + +* Function with no args, or just default args can be called without parentheses. + + >$FG,2$Dir("*");$FG$ + >$FG,2$Dir();$FG$ + >$FG,2$Dir;$FG$ + +* Default args don't have to be on the end. This code is valid: +$ID,2$$FG,2$U0 Test(I64 i=4,I64 j,I64 k=5) +{ + Print("%X %X %X\n",i,j,k); +} + +Test(,3);$FG$ +$ID,-2$ +* A char const all alone is sent to $LK,"PutChars",A="MN:PutChars"$(). A string with or without args is sent to $LK,"Print",A="MN:Print"$(). An empty string literal signals a variable fmt_str follows. + +$ID,2$$FG,2$void DemoC(char drv,char *fmt,char *name,int age) +{ + printf("Hello World!\n"); + printf("%s age %d\n",name,age); + printf(fmt,name,age); + putchar(drv); + putchar('*'); +} + +U0 DemoHolyC(U8 drv,U8 *fmt,U8 *name,I64 age) +{ + "Hello World!\n"; + "%s age %d\n",name,age; + "" fmt,name,age; + '' drv; + '*'; +} +$FG$$ID,-2$ +* When dealing with function addresses such as for callbacks, precede the name with "$FG,2$&$FG$". + +* Type casting is postfix. To typecast int or F64, use $LK,"ToI64",A="MN:ToI64"$(), $LK,"ToBool",A="MN:ToBool"$() or $LK,"ToF64",A="MN:ToF64"$(). (TempleOS follows normal C float<-->int conversion, but sometimes you want to override. These functions are better than multiplying by "1.0" to convert to float.) + +* There is no $FG,2$main()$FG$ function. Any code outside of functions gets executed upon start-up, in order. + +* There are no bit fields, but there are $LK,"bit access",A="HI:Bit"$ routines and you can access bytes or words within any int. See $LK,"I64 declaration",A="MN:I64"$. A class can be accessed as a whole are subints, if you put a type in front of the $FG,2$class$FG$ declaration. +$ID,2$ +$FG,2$public I64i union I64 //"I64i" is intrinsic. We are defining "I64". +{ + I8i i8[8]; + U8i u8[8]; + I16 i16[4]; + U16 u16[4]; + I32 i32[2]; + U32 u32[2]; +}; + +I64 i=0x123456780000DEF0; +i.u16[1]=0x9ABC; +$FG$$ID,-2$ +* Variable arg count functions ($FG,2$...$FG$) can access their args with built-in variables similar to '$FG,2$this$FG$' in C++. They are '$FG,2$I64 argc$FG$' and '$FG,2$I64 argv[]$FG$'. +$ID,2$$WW,0$ +$FG,2$I64 AddNums(...) +{ + I64 i,res=0; + for (i=0;i$FG,2$AddNums(1,2,3);$FG$ +ans=6 +$FG,2$ + +public U0 GrPrint(CDC *dc,I64 x,I64 y,U8 *fmt,...) +{ + U8 *buf=$LK,"StrPrintJoin",A="MN:StrPrintJoin"$(NULL,fmt,argc,argv);//SPrintF() with $LK,"MAlloc",A="MN:MAlloc"$()ed string. + $LK,"GrPutS",A="MN:GrPutS"$(dc,x,y,buf); //Plot string at x,y pixels. GrPutS is not public. + Free(buf); +} + + ... + + GrPrint(gr.dc,(GR_WIDTH-10*FONT_WIDTH)>>1,(GR_HEIGHT-FONT_HEIGHT)>>1, + "Score:%4d",score); //Print score in the center of the screen. + ... + +$WW,1$$FG$$ID,-2$ +* Allows "$FG,2$5$FG,2$Zero [One] Two [Three] Four [Five]$FG$ +$ID,-2$ +* A $FG,2$no_warn$FG$ stmt will suppress an unused var warning. + +* You can have multiple member vars of a class named "$FG,2$pad$FG$" or "$FG,2$reserved$FG$", and it won't issue warnings. + +* $FG,2$noreg$FG$ or $FG,2$reg$FG$ can be placed before a function local var name. You can, optionally, specify a reg after the $FG,2$reg$FG$ keyword. + +$ID,2$$FG,2$U0 Main() +{ + //Only use $LK,"REGG_LOCAL_VARS",A="MN:REGG_LOCAL_VARS"$ or $LK,"REGG_LOCAL_NON_PTR_VARS",A="MN:REGG_LOCAL_NON_PTR_VARS"$ for reg vars or else clobbered. + I64 reg R15 i=5, noreg j=4; + no_warn i; + asm { + MOV RAX,R15 + CALL &PUT_HEX_U64 + MOV RAX,'\n' + CALL &PUT_CHARS + MOV RAX,U64 &j[RBP] + CALL &PUT_HEX_U64 + MOV RAX,'\n' + CALL &PUT_CHARS + } +} +$FG$$ID,-2$ +* $FG,2$interrupt$FG$, $FG,2$haserrcode$FG$, $FG,2$public$FG$, $FG,2$argpop$FG$ or $FG,2$noargpop$FG$ are function flags. See $LK,"::/Demo/Lectures/Mem/PageTableEntries.HC"$. + +* A single quote can encompass multiple characters. $FG,2$'ABC'$FG$ is equ to $FG,2$0x434241$FG$. $LK,"PutChars",A="MN:PutChars"$() takes multiple characters. + +$ID,2$$FG,2$asm { +HELLO_WORLD:: + PUSH RBP + MOV RBP,RSP + MOV RAX,'Hello ' + CALL &PUT_CHARS + MOV RAX,'World\n' + CALL &PUT_CHARS + LEAVE + RET +} +Call(HELLO_WORLD); +PutChars('Hello '); +PutChars('World\n'); +$FG$$ID,-2$ +* The "$FG,2$`$FG$" operator raises a base to a power. + +* There is no question-colon operator. + +* TempleOS $LK,"operator precedence",A="FF:::/Compiler/CInit.HC,cmp.binary_ops"$ + $FG,2$`$FG$,$FG,2$>>$FG$,$FG,2$<<$FG$ + $FG,2$*$FG$,$FG,2$/$FG$,$FG,2$%$FG$ + $FG,2$&$FG$ + $FG,2$^$FG$ + $FG,2$|$FG$ + $FG,2$+$FG$,$FG,2$-$FG$ + $FG,2$<$FG$,$FG,2$>$FG$,$FG,2$<=$FG$,$FG,2$>=$FG$ + $FG,2$==$FG$,$FG,2$!=$FG$ + $FG,2$&&$FG$ + $FG,2$^^$FG$ + $FG,2$||$FG$ + $FG,2$=$FG$,$FG,2$<<=$FG$,$FG,2$>>=$FG$,$FG,2$*=$FG$,$FG,2$/=$FG$,$FG,2$&=$FG$,$FG,2$|=$FG$,$FG,2$^=$FG$,$FG,2$+=$FG$,$FG,2$-=$FG$ + +* You can use $LK,"Option",A="MN:Option"$($LK,"OPTf_WARN_PAREN",A="MN:OPTf_WARN_PAREN"$,ON) to find unnecessary parentheses in code. + +* You can use $LK,"Option",A="MN:Option"$($LK,"OPTf_WARN_DUP_TYPES",A="MN:OPTf_WARN_DUP_TYPES"$,ON) to find dup local var type stmts. + +* With the $FG,2$#exe{}$FG$ feature in your src code, you can place programs that insert text into the stream of code being compiled. See $LK,"#exe {}",A="FF:::/Kernel/KEnd.HC,#exe {"$ for an example where the date/time and compile-time prompting for cfguration data is placed into a program. $LK,"StreamPrint",A="MN:StreamPrint"$() places text into a src program stream following the conclusion of the $FG,2$#exe{}$FG$ blk. + +* No $FG,2$#define$FG$ functions exist (I'm not a fan) + +* No $FG,2$typedef$FG$, use $FG,2$class$FG$. + +* No type-checking + +* Can't use $FG,2$<>$FG$ with $FG,2$#include$FG$, use $FG,2$""$FG$. + +* "$FG,2$$$$FG$" is an escape character. Two dollar signs signify an ordinary $$. See $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$. In $FG,2$asm$FG$ or $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ code, it also refers to the inst's address or the offset in a $FG,2$class$FG$ definition. + +* $FG,2$union$FG$ is more like a class, so you don't reference it with a $FG,2$union$FG$ label after you define it. Some common unions are declared in $LK,"KernelA.HH",A="MN:U16"$ for 1,2,4 and 8 byte objects. If you place a type in front of a union declaration, that is the type when used by itself. See $LK,"::/Demo/SubIntAccess.HC"$. + +* $FG,2$class$FG$ member vars can have meta data. $FG,2$fmtstr$FG$ and $FG,2$fmtdata$FG$ are two meta data types now used. All compiler structures are saved and you can access the compiler's info about classes and vars. See $LK,"::/Demo/ClassMeta.HC"$ and $LK,"DocForm",A="MN:DocForm"$(). + +* There is a keyword $FG,2$lastclass$FG$ you use as a dft arg. It is set to the class name of the prev arg. See $LK,"::/Demo/LastClass.HC"$, $LK,"ClassRep",A="MN:ClassRep"$(), $LK,"DocForm",A="MN:DocForm"$() and $LK,"::/Demo/Dsk/BlkDevRep.HC"$. + +* See $LK,"::/Demo/Exceptions.HC"$. $FG,2$try{} catch{}$FG$ and $FG,2$throw$FG$ are different from C++. $FG,2$throw$FG$ is a function with an 8-byte or less char arg. The char string passed in $FG,2$throw()$FG$ can be accessed from within a $FG,2$catch{}$FG$ using the $FG,2$Fs->except_ch$FG$. Within a $FG,2$catch {}$FG$ blk, set the var $FG,2$Fs->catch_except$FG$ to $FG,2$TRUE$FG$ if you want to terminate the search for a handler. Use $LK,"PutExcept",A="MN:PutExcept"$() as a handler, if you like. + +* A function is available similar to $FG,2$sizeof$FG$ which provides the offset of a member of a class. It's called $FG,2$offset$FG$. You place the class name and member inside as in $FG,2$offset(classname.membername)$FG$. It has nothing to do with 16-bit code. Both $FG,2$sizeof$FG$ and $FG,2$offset$FG$ only accept one level of member vars. That is, you can't do $FG,2$sizeof(classname.membername.submembername)$FG$.$FG$ + +* There is no $FG,2$continue$FG$ stmt. Use $FG,2$goto$FG$. + +* $FG,2$lock{}$FG$ can be used to apply asm $FG,2$LOCK$FG$ prefixes to code for safe multicore read-modify-write accesses. The code bracked with have $FG,2$LOCK$FG$ asm prefix's applied to relevant insts within. It's a little shoddy. See $LK,"::/Demo/MultiCore/Lock.HC"$. + +* There is a function called $LK,"MSize",A="MN:MSize"$() which gives the size of an object alloced off the heap. For larger size allocations, the system rounds-up to a power of two, so $FG,2$MSize()$FG$ lets you know the real size and you can take full advantage of it. + +* You CAN $LK,"Free",A="MN:Free"$() a $FG,2$NULL$FG$ ptr. Useful variants of $LK,"MAlloc",A="MN:MAlloc"$() can be found $LK,"Here",A="MN:CAlloc"$. Each task has a heap and you can $FG,2$MAlloc$FG$ and $FG,2$Free$FG$ off-of other task's heaps, or make an independent heap with $LK,"HeapCtrlInit",A="MN:HeapCtrlInit"$(). See $LK,"HeapLog",A="MN:HeapLog"$() for an example. + +* The stk does not grow because virtual mem is not used. I recommend allocating large local vars from the heap. You can change $LK,"MEM_DFT_STK",A="MN:MEM_DFT_STK"$ and recompile $FG,2$Kernel$FG$ or request more when doing a $LK,"Spawn",A="MN:Spawn"$(). You can use $LK,"CallStkGrow",A="MN:CallStkGrow"$(), but it's odd. See $LK,"::/Demo/StkGrow.HC"$. + +* Only one base class is allowed. + +* $FG,2$printf()$FG$ has new codes. See $LK,"Print(\"\") Fmt Strings",A="FI:::/Doc/Print.DD"$. + +* All values are extended to 64-bit when accessed. Intermediate calculations are done with 64-bit values. + +$ID,2$$FG,2$U0 Main() +{ + I16 i1; + I32 j1; + j1=i1=0x12345678; //Resulting i1 is 0x5678 but j1 is 0x12345678 + + I64 i2=0x8000000000000000; + Print("%X\n",i2>>1); //Res is 0xC000000000000000 as expected + + U64 u3=0x8000000000000000; + Print("%X\n",u3>>1); //Res is 0x4000000000000000 as expected + + I32 i4=0x80000000; //const is loaded into a 64-bit reg var. + Print("%X\n",i4>>1); //Res is 0x40000000 + + I32 i5=-0x80000000; + Print("%X\n",i5>>1); //Res is 0xFFFFFFFFC0000000 +} +$ID,-2$$FG$ diff --git a/Doc/HolyC.TXT b/Doc/HolyC.TXT deleted file mode 100644 index 5334ed3..0000000 --- a/Doc/HolyC.TXT +++ /dev/null @@ -1,268 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"HolyC"$$FG$ - -* See $LK,"::/Doc/CompilerOverview.TXT"$. - -* See $LK,"Scoping and Linkage",A="FI:::/Doc/ScopingLinkage.TXT"$ for details on $FG,2$extern$FG$, $FG,2$import$FG$, $FG,2$_extern$FG$, $FG,2$_import$FG$, etc. - -* Built-in types include $FG,2$I0,I8,I16,I32,I64$FG$ for signed 0-8 byte ints and $FG,2$U0,U8,U16,U32,U64$FG$ for unsigned 0-8 byte ints and $FG,2$F64$FG$ for 8 byte floats. - -$FG,2$ U0 void, but ZERO size! - I8 char - U8 unsigned char - I16 short - U16 unsigned short - I32 int - U32 unsigned int - I64 long (64-bit) - U64 unsigned long (64-bit) - F64 double$FG$ - $FG,4$no F32 float.$FG$ - -* Function with no args, or just default args can be called without parentheses. - - >$FG,2$Dir("*");$FG$ - >$FG,2$Dir();$FG$ - >$FG,2$Dir;$FG$ - -* Default args don't have to be on the end. This code is valid: -$ID,2$$FG,2$U0 Test(I64 i=4,I64 j,I64 k=5) -{ - Print("%X %X %X\n",i,j,k); -} - -Test(,3);$FG$ -$ID,-2$ -* A char const all alone is sent to $LK,"PutChars",A="MN:PutChars"$(). A string with or without args is sent to $LK,"Print",A="MN:Print"$(). An empty string literal signals a variable fmt_str follows. - -$ID,2$$FG,2$void DemoC(char drv,char *fmt,char *name,int age) -{ - printf("Hello World!\n"); - printf("%s age %d\n",name,age); - printf(fmt,name,age); - putchar(drv); - putchar('*'); -} - -U0 DemoHolyC(U8 drv,U8 *fmt,U8 *name,I64 age) -{ - "Hello World!\n"; - "%s age %d\n",name,age; - "" fmt,name,age; - '' drv; - '*'; -} -$FG$$ID,-2$ -* When dealing with function addresses such as for callbacks, precede the name with "$FG,2$&$FG$". - -* Type casting is postfix. To typecast int or F64, use $LK,"ToI64",A="MN:ToI64"$(), $LK,"ToBool",A="MN:ToBool"$() or $LK,"ToF64",A="MN:ToF64"$(). (TempleOS follows normal C float<-->int conversion, but sometimes you want to override. These functions are better than multiplying by "1.0" to convert to float.) - -* There is no $FG,2$main()$FG$ function. Any code outside of functions gets executed upon start-up, in order. - -* There are no bit fields, but there are $LK,"bit access",A="HI:Bit"$ routines and you can access bytes or words within any int. See $LK,"I64 declaration",A="MN:I64"$. A class can be accessed as a whole are subints, if you put a type in front of the $FG,2$class$FG$ declaration. -$ID,2$ -$FG,2$public I64i union I64 //"I64i" is intrinsic. We are defining "I64". -{ - I8i i8[8]; - U8i u8[8]; - I16 i16[4]; - U16 u16[4]; - I32 i32[2]; - U32 u32[2]; -}; - -I64 i=0x123456780000DEF0; -i.u16[1]=0x9ABC; -$FG$$ID,-2$ -* Variable arg count functions ($FG,2$...$FG$) can access their args with built-in variables similar to '$FG,2$this$FG$' in C++. They are '$FG,2$I64 argc$FG$' and '$FG,2$I64 argv[]$FG$'. -$ID,2$$WW,0$ -$FG,2$I64 AddNums(...) -{ - I64 i,res=0; - for (i=0;i$FG,2$AddNums(1,2,3);$FG$ -ans=6 -$FG,2$ - -public U0 GrPrint(CDC *dc,I64 x,I64 y,U8 *fmt,...) -{ - U8 *buf=$LK,"StrPrintJoin",A="MN:StrPrintJoin"$(NULL,fmt,argc,argv);//SPrintF() with $LK,"MAlloc",A="MN:MAlloc"$()ed string. - $LK,"GrPutS",A="MN:GrPutS"$(dc,x,y,buf); //Plot string at x,y pixels. GrPutS is not public. - Free(buf); -} - - ... - - GrPrint(gr.dc,(GR_WIDTH-10*FONT_WIDTH)>>1,(GR_HEIGHT-FONT_HEIGHT)>>1, - "Score:%4d",score); //Print score in the center of the screen. - ... - -$WW,1$$FG$$ID,-2$ -* Allows "$FG,2$5$FG,2$Zero [One] Two [Three] Four [Five]$FG$ -$ID,-2$ -* A $FG,2$no_warn$FG$ stmt will suppress an unused var warning. - -* You can have multiple member vars of a class named "$FG,2$pad$FG$" or "$FG,2$reserved$FG$", and it won't issue warnings. - -* $FG,2$noreg$FG$ or $FG,2$reg$FG$ can be placed before a function local var name. You can, optionally, specify a reg after the $FG,2$reg$FG$ keyword. - -$ID,2$$FG,2$U0 Main() -{ - //Only use $LK,"REGG_LOCAL_VARS",A="MN:REGG_LOCAL_VARS"$ or $LK,"REGG_LOCAL_NON_PTR_VARS",A="MN:REGG_LOCAL_NON_PTR_VARS"$ for reg vars or else clobbered. - I64 reg R15 i=5, noreg j=4; - no_warn i; - asm { - MOV RAX,R15 - CALL &PUT_HEX_U64 - MOV RAX,'\n' - CALL &PUT_CHARS - MOV RAX,U64 &j[RBP] - CALL &PUT_HEX_U64 - MOV RAX,'\n' - CALL &PUT_CHARS - } -} -$FG$$ID,-2$ -* $FG,2$interrupt$FG$, $FG,2$haserrcode$FG$, $FG,2$public$FG$, $FG,2$argpop$FG$ or $FG,2$noargpop$FG$ are function flags. See $LK,"::/Demo/Lectures/Mem/PageTableEntries.CPP"$. - -* A single quote can encompass multiple characters. $FG,2$'ABC'$FG$ is equ to $FG,2$0x434241$FG$. $LK,"PutChars",A="MN:PutChars"$() takes multiple characters. - -$ID,2$$FG,2$asm { -HELLO_WORLD:: - PUSH RBP - MOV RBP,RSP - MOV RAX,'Hello ' - CALL &PUT_CHARS - MOV RAX,'World\n' - CALL &PUT_CHARS - LEAVE - RET -} -Call(HELLO_WORLD); -PutChars('Hello '); -PutChars('World\n'); -$FG$$ID,-2$ -* The "$FG,2$`$FG$" operator raises a base to a power. - -* There is no question-colon operator. - -* TempleOS $LK,"operator precedence",A="FF:::/Compiler/CInit.CPP,cmp.binary_ops"$ - $FG,2$`$FG$,$FG,2$>>$FG$,$FG,2$<<$FG$ - $FG,2$*$FG$,$FG,2$/$FG$,$FG,2$%$FG$ - $FG,2$&$FG$ - $FG,2$^$FG$ - $FG,2$|$FG$ - $FG,2$+$FG$,$FG,2$-$FG$ - $FG,2$<$FG$,$FG,2$>$FG$,$FG,2$<=$FG$,$FG,2$>=$FG$ - $FG,2$==$FG$,$FG,2$!=$FG$ - $FG,2$&&$FG$ - $FG,2$^^$FG$ - $FG,2$||$FG$ - $FG,2$=$FG$,$FG,2$<<=$FG$,$FG,2$>>=$FG$,$FG,2$*=$FG$,$FG,2$/=$FG$,$FG,2$&=$FG$,$FG,2$|=$FG$,$FG,2$^=$FG$,$FG,2$+=$FG$,$FG,2$-=$FG$ - -* You can use $LK,"Option",A="MN:Option"$($LK,"OPTf_WARN_PAREN",A="MN:OPTf_WARN_PAREN"$,ON) to find unnecessary parentheses in code. - -* You can use $LK,"Option",A="MN:Option"$($LK,"OPTf_WARN_DUP_TYPES",A="MN:OPTf_WARN_DUP_TYPES"$,ON) to find dup local var type stmts. - -* With the $FG,2$#exe{}$FG$ feature in your src code, you can place programs that insert text into the stream of code being compiled. See $LK,"#exe {}",A="FF:::/Kernel/KEnd.CPP,#exe {"$ for an example where the date/time and compile-time prompting for cfguration data is placed into a program. $LK,"StreamPrint",A="MN:StreamPrint"$() places text into a src program stream following the conclusion of the $FG,2$#exe{}$FG$ blk. - -* No $FG,2$#define$FG$ functions exist (I'm not a fan) - -* No $FG,2$typedef$FG$, use $FG,2$class$FG$. - -* No type-checking - -* Can't use $FG,2$<>$FG$ with $FG,2$#include$FG$, use $FG,2$""$FG$. - -* "$FG,2$$$$FG$" is an escape character. Two dollar signs signify an ordinary $$. See $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$. In $FG,2$asm$FG$ or $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ code, it also refers to the inst's address or the offset in a $FG,2$class$FG$ definition. - -* $FG,2$union$FG$ is more like a class, so you don't reference it with a $FG,2$union$FG$ label after you define it. Some common unions are declared in $LK,"KernelA.HPP",A="MN:U16"$ for 1,2,4 and 8 byte objects. If you place a type in front of a union declaration, that is the type when used by itself. See $LK,"::/Demo/SubIntAccess.CPP"$. - -* $FG,2$class$FG$ member vars can have meta data. $FG,2$fmtstr$FG$ and $FG,2$fmtdata$FG$ are two meta data types now used. All compiler structures are saved and you can access the compiler's info about classes and vars. See $LK,"::/Demo/ClassMeta.CPP"$ and $LK,"DocForm",A="MN:DocForm"$(). - -* There is a keyword $FG,2$lastclass$FG$ you use as a dft arg. It is set to the class name of the prev arg. See $LK,"::/Demo/LastClass.CPP"$, $LK,"ClassRep",A="MN:ClassRep"$(), $LK,"DocForm",A="MN:DocForm"$() and $LK,"::/Demo/Dsk/BlkDevRep.CPP"$. - -* See $LK,"::/Demo/Exceptions.CPP"$. $FG,2$try{} catch{}$FG$ and $FG,2$throw$FG$ are different from C++. $FG,2$throw$FG$ is a function with an 8-byte or less char arg. The char string passed in $FG,2$throw()$FG$ can be accessed from within a $FG,2$catch{}$FG$ using the $FG,2$Fs->except_ch$FG$. Within a $FG,2$catch {}$FG$ blk, set the var $FG,2$Fs->catch_except$FG$ to $FG,2$TRUE$FG$ if you want to terminate the search for a handler. Use $LK,"PutExcept",A="MN:PutExcept"$() as a handler, if you like. - -* A function is available similar to $FG,2$sizeof$FG$ which provides the offset of a member of a class. It's called $FG,2$offset$FG$. You place the class name and member inside as in $FG,2$offset(classname.membername)$FG$. It has nothing to do with 16-bit code. Both $FG,2$sizeof$FG$ and $FG,2$offset$FG$ only accept one level of member vars. That is, you can't do $FG,2$sizeof(classname.membername.submembername)$FG$.$FG$ - -* There is no $FG,2$continue$FG$ stmt. Use $FG,2$goto$FG$. - -* $FG,2$lock{}$FG$ can be used to apply asm $FG,2$LOCK$FG$ prefixes to code for safe multicore read-modify-write accesses. The code bracked with have $FG,2$LOCK$FG$ asm prefix's applied to relevant insts within. It's a little shoddy. See $LK,"::/Demo/MultiCore/Lock.CPP"$. - -* There is a function called $LK,"MSize",A="MN:MSize"$() which gives the size of an object alloced off the heap. For larger size allocations, the system rounds-up to a power of two, so $FG,2$MSize()$FG$ lets you know the real size and you can take full advantage of it. - -* You CAN $LK,"Free",A="MN:Free"$() a $FG,2$NULL$FG$ ptr. Useful variants of $LK,"MAlloc",A="MN:MAlloc"$() can be found $LK,"Here",A="MN:CAlloc"$. Each task has a heap and you can $FG,2$MAlloc$FG$ and $FG,2$Free$FG$ off-of other task's heaps, or make an independent heap with $LK,"HeapCtrlInit",A="MN:HeapCtrlInit"$(). See $LK,"HeapLog",A="MN:HeapLog"$() for an example. - -* The stk does not grow because virtual mem is not used. I recommend allocating large local vars from the heap. You can change $LK,"MEM_DFT_STK",A="MN:MEM_DFT_STK"$ and recompile $FG,2$Kernel$FG$ or request more when doing a $LK,"Spawn",A="MN:Spawn"$(). You can use $LK,"CallStkGrow",A="MN:CallStkGrow"$(), but it's odd. See $LK,"::/Demo/StkGrow.CPP"$. - -* Only one base class is allowed. - -* $FG,2$printf()$FG$ has new codes. See $LK,"Print(\"\") Fmt Strings",A="FI:::/Doc/Print.TXT"$. - -* All values are extended to 64-bit when accessed. Intermediate calculations are done with 64-bit values. - -$ID,2$$FG,2$U0 Main() -{ - I16 i1; - I32 j1; - j1=i1=0x12345678; //Resulting i1 is 0x5678 but j1 is 0x12345678 - - I64 i2=0x8000000000000000; - Print("%X\n",i2>>1); //Res is 0xC000000000000000 as expected - - U64 u3=0x8000000000000000; - Print("%X\n",u3>>1); //Res is 0x4000000000000000 as expected - - I32 i4=0x80000000; //const is loaded into a 64-bit reg var. - Print("%X\n",i4>>1); //Res is 0x40000000 - - I32 i5=-0x80000000; - Print("%X\n",i5>>1); //Res is 0xFFFFFFFFC0000000 -} -$ID,-2$$FG$ diff --git a/Doc/InputPointer.DD b/Doc/InputPointer.DD new file mode 100644 index 0000000..55157dd --- /dev/null +++ b/Doc/InputPointer.DD @@ -0,0 +1,16 @@ +$WW,1$"Input Ptr" is the mouse. In the future, might be joystick or pad. + +$LK,"ip.pos.x",A="MN:ip"$ and $LK,"ip.pos.y",A="MN:ip"$ can be used to access the x and y coordinates of the input ptr. They are relative to the screen, not window. These can be used if you don't want to use msg passing. $LK,"ip.pos.z",A="MN:ip"$ is the wheel. + +$LK,"ip.pos_text.x",A="MN:CIPStateGlbls"$ and $LK,"ip.pos_text.y",A="MN:CIPStateGlbls"$ are the text column and row of the input ptr. See $LK,"::/Demo/Games/Maze.HC"$. + +See $LK,"CIPStateGlbls",A="MN:CIPStateGlbls"$ and $LK,"CMouseStateGlbls",A="MN:CMouseStateGlbls"$. + +$HL,1$//**** +mouse.pos.x=mouse.prescale.x*mouse.scale.x*ip_grid.x_speed; +ip.presnap.x=ToI64(ip.scale.x*mouse.pos.x)+ip.offset.x; +if (ip_grid.snap) + ip.pos.x=Trunc(ip.presnap.x/ip_grid.x)*ip_grid.x+ip_grid.x_offset; +else + ip.pos.x=ip.presnap.x; +//****$HL,0$ diff --git a/Doc/InputPointer.TXT b/Doc/InputPointer.TXT deleted file mode 100644 index 40916d8..0000000 --- a/Doc/InputPointer.TXT +++ /dev/null @@ -1,16 +0,0 @@ -$WW,1$"Input Ptr" is the mouse. In the future, might be joystick or pad. - -$LK,"ip.pos.x",A="MN:ip"$ and $LK,"ip.pos.y",A="MN:ip"$ can be used to access the x and y coordinates of the input ptr. They are relative to the screen, not window. These can be used if you don't want to use msg passing. $LK,"ip.pos.z",A="MN:ip"$ is the wheel. - -$LK,"ip.pos_text.x",A="MN:CIPStateGlbls"$ and $LK,"ip.pos_text.y",A="MN:CIPStateGlbls"$ are the text column and row of the input ptr. See $LK,"::/Demo/Games/Maze.CPP"$. - -See $LK,"CIPStateGlbls",A="MN:CIPStateGlbls"$ and $LK,"CMouseStateGlbls",A="MN:CMouseStateGlbls"$. - -$HL,1$//**** -mouse.pos.x=mouse.prescale.x*mouse.scale.x*ip_grid.x_speed; -ip.presnap.x=ToI64(ip.scale.x*mouse.pos.x)+ip.offset.x; -if (ip_grid.snap) - ip.pos.x=Trunc(ip.presnap.x/ip_grid.x)*ip_grid.x+ip_grid.x_offset; -else - ip.pos.x=ip.presnap.x; -//****$HL,0$ diff --git a/Doc/Install.DD b/Doc/Install.DD new file mode 100644 index 0000000..759af5b --- /dev/null +++ b/Doc/Install.DD @@ -0,0 +1,49 @@ +$WW,1$$FG,5$$TX+CX,"Installing TempleOS"$$FG$ + +Burn a CD with software that supports ISO files. Then, boot it. It's a live CD, so you can look around with or without installing. + +Dual booting with another operating system is the best way to use TempleOS. I only use it in a virtual machine because it won't boot natively on my machine, though. For native dual booting, you need a partition for TempleOS. Windows often comes with a restore disk that does not allow repartitioning. I recommend connecting a spare additional hard drive and using the $FG,2$BIOS$FG$ to sel which drive to boot. + +The $LK,"::/Misc/OSInstall.HC"$ script will automate much of this. It runs if you boot the CD/DVD-ROM. + +See $LK,"Boot.DD",A="FI:::/Doc/Boot.DD"$ for an overview of booting. See $LK,"Requirements",A="FI:::/Doc/Requirements.DD"$ for supported hardware. See $LK,"Upgrading",A="FI:::/Doc/Upgrade.DD"$ if you are upgrading. + +Two TempleOS partitions are highly recommended, so you can boot to a back-up and fix the primary when you work on it. Odds are, you only need a couple gigabytes for your TempleOS partitions. + +1) +$ID,2$$LK,"Mount",A="MN:Mount"$() use if the drive is partitioned. +$ID,2$This command mounts a drive making it accessible. For simplicity, sel $FG,2$'C'$FG$ as the first drive letter for your hard drive. The first partition will be $FG,2$'C'$FG$, second, $FG,2$'D'$FG$, etc. TempleOS needs 3 numbers to utilize a hard drive -- base0, base1, and unit. When you enter a hexadecimal number, do it like in $FG,2$C$FG$ with a $FG,2$0x$FG$ prefix. If the probe was successful, you can just enter the number in the probe box instead of base0. +$ID,-2$ +$LK,"PrtDsk",A="MN:PrtDsk"$($FG,2$'C'$FG$) use if drive is not partitioned + +$ID,2$This will perform a special $LK,"Mount",A="MN:Mount"$() automatically. + +$BK,1$WARNING:$BK,0$ This command erases everything on a hard drive. It repartitions a whole drive and formats the partitions$FG$. This command should be skipped if you already have your hard drive partitioned. + + +$BK,1$WARNING:$BK,0$ This command doesn't play well with other operating systems. You'll need to do a $LK,"BootMHDZero",A="MN:BootMHDZero"$() to restore your drive to a state where other operating systems can partition it. +$ID,-2$ +$ID,-2$2) $LK,"Fmt",A="MN:Fmt"$($FG,2$'D'$FG$,$FG,2$TRUE,FALSE,FSt_FAT32$FG$) +$ID,2$This command formats a drive with $FG,2$FAT32$FG$ or the $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ file system type. Use the drive letter of the partition in place of $FG,2$'D'$FG$. + +$BK,1$WARNING:$BK,0$ If you are upgrading, be sure not to lose the file, $FG,2$/0000Adam/Opt/Boot/OldMBR.BIN.C$FG$. + +$ID,-2$3) $LK,"CopyTree",A="MN:CopyTree"$($FG,2$"T:/"$FG$,$FG,2$"D:/"$FG$) +$ID,2$This command is used to copy files onto a hard drive partition from the CD/DVD. Use the drive letter of the partition in place of $FG,2$'D'$FG$. + +$ID,-2$4) $LK,"BootHDIns",A="MN:BootHDIns"$($FG,2$'D'$FG$) +$ID,2$This command recompiles the source code on a drive and writes to the $UL,1$drive's$UL,0$ boot record. You'll need to reenter the $LK,"Mount",A="MN:Mount"$ information so it can be stored in the kernel. + +$ID,-2$5) Use Linux's Grub or TempleOS' $LK,"BootMHDIns",A="MN:BootMHDIns"$($FG,2$'D'$FG$) +$ID,2$ +The $LK,"BootMHDIns",A="MN:BootMHDIns"$() command places a boot loader on a drive. It saves the old master boot record to $FG,2$/0000Adam/Opt/Boot/OldMBR.BIN.C$FG$ and replaces it. When you boot, you will have the option of booting the old master boot record. This command can be skipped if you already have a boot loader. Be sure not to lose the copy of the old boot record, like if you reformat the drive. + +Delete $FG,2$/0000Adam/Opt/Boot/OldMBR.BIN.C$FG$ if you want to get a fresh copy of a mbr, like if installing from your own custom CD containing it's own $FG,2$/0000Adam/Opt/Boot/OldMBR.BIN.C$FG$ onto a system with a non-TempleOS boot loader. + +If you have anti-virus software, it might object to having a different master boot record. +$ID,-2$ + +$FG,8$ +* "Windows" is a trademark owned by MicroSoft Corp. +* "Linux" is a trademark owned by Linus Torvalds. +$FG$ \ No newline at end of file diff --git a/Doc/Install.TXT b/Doc/Install.TXT deleted file mode 100644 index c3ecd4d..0000000 --- a/Doc/Install.TXT +++ /dev/null @@ -1,49 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"Installing TempleOS"$$FG$ - -Burn a CD with software that supports ISO files. Then, boot it. It's a live CD, so you can look around with or without installing. - -Dual booting with another operating system is the best way to use TempleOS. I only use it in a virtual machine because it won't boot natively on my machine, though. For native dual booting, you need a partition for TempleOS. Windows often comes with a restore disk that does not allow repartitioning. I recommend connecting a spare additional hard drive and using the $FG,2$BIOS$FG$ to sel which drive to boot. - -The $LK,"::/Misc/OSInstall.CPP"$ script will automate much of this. It runs if you boot the CD/DVD-ROM. - -See $LK,"Boot.TXT",A="FI:::/Doc/Boot.TXT"$ for an overview of booting. See $LK,"Requirements",A="FI:::/Doc/Requirements.TXT"$ for supported hardware. See $LK,"Upgrading",A="FI:::/Doc/Upgrade.TXT"$ if you are upgrading. - -Two TempleOS partitions are highly recommended, so you can boot to a back-up and fix the primary when you work on it. Odds are, you only need a couple gigabytes for your TempleOS partitions. - -1) -$ID,2$$LK,"Mount",A="MN:Mount"$() use if the drive is partitioned. -$ID,2$This command mounts a drive making it accessible. For simplicity, sel $FG,2$'C'$FG$ as the first drive letter for your hard drive. The first partition will be $FG,2$'C'$FG$, second, $FG,2$'D'$FG$, etc. TempleOS needs 3 numbers to utilize a hard drive -- base0, base1, and unit. When you enter a hexadecimal number, do it like in $FG,2$C$FG$ with a $FG,2$0x$FG$ prefix. If the probe was successful, you can just enter the number in the probe box instead of base0. -$ID,-2$ -$LK,"PrtDsk",A="MN:PrtDsk"$($FG,2$'C'$FG$) use if drive is not partitioned - -$ID,2$This will perform a special $LK,"Mount",A="MN:Mount"$() automatically. - -$BK,1$WARNING:$BK,0$ This command erases everything on a hard drive. It repartitions a whole drive and formats the partitions$FG$. This command should be skipped if you already have your hard drive partitioned. - - -$BK,1$WARNING:$BK,0$ This command doesn't play well with other operating systems. You'll need to do a $LK,"BootMHDZero",A="MN:BootMHDZero"$() to restore your drive to a state where other operating systems can partition it. -$ID,-2$ -$ID,-2$2) $LK,"Fmt",A="MN:Fmt"$($FG,2$'D'$FG$,$FG,2$TRUE,FALSE,FSt_FAT32$FG$) -$ID,2$This command formats a drive with $FG,2$FAT32$FG$ or the $LK,"RedSea",A="FI:::/Doc/RedSea.TXT"$ file system type. Use the drive letter of the partition in place of $FG,2$'D'$FG$. - -$BK,1$WARNING:$BK,0$ If you are upgrading, be sure not to lose the file, $FG,2$/0000Adam/Opt/Boot/OldMBR.BIN.C$FG$. - -$ID,-2$3) $LK,"CopyTree",A="MN:CopyTree"$($FG,2$"T:/"$FG$,$FG,2$"D:/"$FG$) -$ID,2$This command is used to copy files onto a hard drive partition from the CD/DVD. Use the drive letter of the partition in place of $FG,2$'D'$FG$. - -$ID,-2$4) $LK,"BootHDIns",A="MN:BootHDIns"$($FG,2$'D'$FG$) -$ID,2$This command recompiles the source code on a drive and writes to the $UL,1$drive's$UL,0$ boot record. You'll need to reenter the $LK,"Mount",A="MN:Mount"$ information so it can be stored in the kernel. - -$ID,-2$5) Use Linux's Grub or TempleOS' $LK,"BootMHDIns",A="MN:BootMHDIns"$($FG,2$'D'$FG$) -$ID,2$ -The $LK,"BootMHDIns",A="MN:BootMHDIns"$() command places a boot loader on a drive. It saves the old master boot record to $FG,2$/0000Adam/Opt/Boot/OldMBR.BIN.C$FG$ and replaces it. When you boot, you will have the option of booting the old master boot record. This command can be skipped if you already have a boot loader. Be sure not to lose the copy of the old boot record, like if you reformat the drive. - -Delete $FG,2$/0000Adam/Opt/Boot/OldMBR.BIN.C$FG$ if you want to get a fresh copy of a mbr, like if installing from your own custom CD containing it's own $FG,2$/0000Adam/Opt/Boot/OldMBR.BIN.C$FG$ onto a system with a non-TempleOS boot loader. - -If you have anti-virus software, it might object to having a different master boot record. -$ID,-2$ - -$FG,8$ -* "Windows" is a trademark owned by MicroSoft Corp. -* "Linux" is a trademark owned by Linus Torvalds. -$FG$ \ No newline at end of file diff --git a/Doc/KeyAlloc.TXT b/Doc/KeyAlloc.DD similarity index 100% rename from Doc/KeyAlloc.TXT rename to Doc/KeyAlloc.DD diff --git a/Doc/KeyDev.DD b/Doc/KeyDev.DD new file mode 100644 index 0000000..5b4a0d3 --- /dev/null +++ b/Doc/KeyDev.DD @@ -0,0 +1,14 @@ +$WW,1$The editor mostly stays in a $LK,"GetKey",A="MN:GetKey"$()/$LK,"PutKey",A="MN:PutKey"$() loop. The putkey portion is where keys are acted-upon. TempleOS has a chain of putkey handlers in a $LK,"Circular Queue",A="HI:Circular Queue"$ with priorities. The highest priority handlers can choose to terminate handling, otherwise, the keys get sent on down the chain. + +$LK,"KeyDevAdd",A="MN:KeyDevAdd"$() defines a putkey device with a priority. "Device" might be a misnomer. Currently, the following are defined: + +Priority Handler +---------- --------- +$FG,2$0x20000000$FG$ $LK,"MyPutKey",A="MN:MyPutKey"$() user handler +$FG,2$0x40000000$FG$ $LK,"KDInputFilterPutKey",A="MN:KDInputFilterPutKey"$() for $LK,"Auto",A="MN:Auto"$(), $LK,"AutoStr",A="MN:AutoStr"$(), and $LK,"AutoFile",A="MN:AutoFile"$() handling. +$FG,2$0x60000000$FG$ $LK,"KDRawPutKey",A="MN:KDRawPutKey"$() nonwindowed direct to video mem debug output. +$FG,2$0x80000000$FG$ $LK,"KDDocPutKey",A="MN:KDDocPutKey"$() standard document cmds + +Since handling individual keys is slow, TempleOS supports PutS() as well. If no puts handler is defined, individual keys are sent. + +$LK,"CDoc",A="MN:CDoc"$$FG,2$.user_put_key$FG$ and $LK,"CDoc",A="MN:CDoc"$$FG,2$.user_put_s$FG$ are call back routines which offer some neat tricks. See $LK,"::/Apps/Psalmody/JukeBox.HC"$. There is a var $LK,"CDoc",A="MN:CDoc"$$FG,2$.user_put_data$FG$ which gets passed to them. diff --git a/Doc/KeyDev.TXT b/Doc/KeyDev.TXT deleted file mode 100644 index be38b7b..0000000 --- a/Doc/KeyDev.TXT +++ /dev/null @@ -1,14 +0,0 @@ -$WW,1$The editor mostly stays in a $LK,"GetKey",A="MN:GetKey"$()/$LK,"PutKey",A="MN:PutKey"$() loop. The putkey portion is where keys are acted-upon. TempleOS has a chain of putkey handlers in a $LK,"Circular Queue",A="HI:Circular Queue"$ with priorities. The highest priority handlers can choose to terminate handling, otherwise, the keys get sent on down the chain. - -$LK,"KeyDevAdd",A="MN:KeyDevAdd"$() defines a putkey device with a priority. "Device" might be a misnomer. Currently, the following are defined: - -Priority Handler ----------- --------- -$FG,2$0x20000000$FG$ $LK,"MyPutKey",A="MN:MyPutKey"$() user handler -$FG,2$0x40000000$FG$ $LK,"KDInputFilterPutKey",A="MN:KDInputFilterPutKey"$() for $LK,"Auto",A="MN:Auto"$(), $LK,"AutoStr",A="MN:AutoStr"$(), and $LK,"AutoFile",A="MN:AutoFile"$() handling. -$FG,2$0x60000000$FG$ $LK,"KDRawPutKey",A="MN:KDRawPutKey"$() nonwindowed direct to video mem debug output. -$FG,2$0x80000000$FG$ $LK,"KDDocPutKey",A="MN:KDDocPutKey"$() standard document cmds - -Since handling individual keys is slow, TempleOS supports PutS() as well. If no puts handler is defined, individual keys are sent. - -$LK,"CDoc",A="MN:CDoc"$$FG,2$.user_put_key$FG$ and $LK,"CDoc",A="MN:CDoc"$$FG,2$.user_put_s$FG$ are call back routines which offer some neat tricks. See $LK,"::/Apps/Psalmody/JukeBox.CPP"$. There is a var $LK,"CDoc",A="MN:CDoc"$$FG,2$.user_put_data$FG$ which gets passed to them. diff --git a/Doc/Lex.DD b/Doc/Lex.DD new file mode 100644 index 0000000..a20324e --- /dev/null +++ b/Doc/Lex.DD @@ -0,0 +1,3 @@ +$WW,1$The compiler's lexical analyzer can be used in your programs to simplify parsing. See $LK,"Doc Parsing",A="FF:::/Adam/DolDoc/DocPlain.HC,CmpCtrlNew"$ or $LK,"Parse Opcode File",A="FF:::/Compiler/AsmInit.HC,Opcodes.DD"$. + +See $LK,"Tokens",A="MN:TK_IDENT"$. diff --git a/Doc/Lex.TXT b/Doc/Lex.TXT deleted file mode 100644 index 1c628c5..0000000 --- a/Doc/Lex.TXT +++ /dev/null @@ -1,3 +0,0 @@ -$WW,1$The compiler's lexical analyzer can be used in your programs to simplify parsing. See $LK,"Doc Parsing",A="FF:::/Adam/DolDoc/DocPlain.CPP,CmpCtrlNew"$ or $LK,"Parse Opcode File",A="FF:::/Compiler/AsmInit.CPP,Opcodes.TXT"$. - -See $LK,"Tokens",A="MN:TK_IDENT"$. diff --git a/Doc/MemOverview.DD b/Doc/MemOverview.DD new file mode 100644 index 0000000..9f3a1e9 --- /dev/null +++ b/Doc/MemOverview.DD @@ -0,0 +1,60 @@ +$WW,1$$FG,5$$TX+CX,"Memory Overview"$$FG$ + +Paging is practically not used. 64-bit mode requires paging, however, so it is identity-mapped, virtual identical to physical. All tasks on all cores use the same page table map, just as though all addresses are physical addresses. 2 Meg page table entries are used. Nothing swaps to disk. You can adjust $LK,"MEM_MAPPED_SPACE",A="MN:MEM_MAPPED_SPACE"$ for more RAM. + +In TempleOS, the lowest 2 Gig of memory is called the $FG,2$code heap$FG$. TempleOS's compiler always uses 32-bit signed relative JMP & CALL insts because 64-bit CALLs take two insts. With signed +/- 32-bit values, code can only call a function within 2 Gig distance. Therefore, TempleOS keeps all code in the lowest 2 Gig memory addresses including what would normally be called "the kernel". Two Gig is plenty for code, don't worry. + +You can create new, independent heaps using $LK,"HeapCtrlInit",A="MN:HeapCtrlInit"$(). Then, use the $LK,"CHeapCtrl",A="MN:CHeapCtrl"$ as the 2nd arg to $LK,"MAlloc",A="MN:MAlloc"$(). See $LK,"HeapLog",A="MN:HeapLog"$() for an example. + +Memory alloced by a task will be freed when the task is killed. + +Eventually, memory will become fragmented, requiring a reboot. + +See $LK,"MemRep",A="MN:MemRep"$() and $LK,"::/Demo/MemDemo.HC"$. + +$FG,5$$TX+CX,"Single System-wide Mem Map"$ + +$FG,2$ 0x00$TX,"00007C00",D="DD_KERNEL"$- 0x00$TX,"00035F3F",D="DD_KERNEL_END"$$FG$ +$ID,2$Kernel module, placed here by the boot-loader, $LK,"BOOT_RAM_BASE",A="MN:BOOT_RAM_BASE"$. +$ID,-2$ +$FG,2$ 0x00$TX,"00096600",D="DD_BOOT_HIGH_LOC_DVD"$- 0x00$TX,"00096FFF",D="DD_BOOT_HIGH_LOC_DVD_END"$$FG$ +$ID,2$$FG$Boot block relocated here before loading the Kernel module, $LK,"BootDVD",A="FI:::/Adam/Opt/Boot/BootDVD.HC"$ & $LK,"BootHD",A="FI:::/Adam/Opt/Boot/BootHD.HC"$. +$ID,-2$ +$FG,2$ 0x00$TX,"00097000",D="DD_MP_VECT"$- 0x00$TX,"00097030",D="DD_MP_VECT_END"$$FG$ +$ID,2$Multicore start-up vect code, $LK,"MPN_VECT",A="MN:MPN_VECT"$. +$ID,-2$ +$FG,2$~0x000009F000- 0x000009FFFF +$ID,2$$FG$Extended BIOS data area. +$ID,-2$ +$FG,2$ 0x00000A0000- 0x00000BFFFF$FG$ +$ID,2$VGA graphics mem, marked as write-through cache in $LK,"text",A="MN:text"$.vga_alias. +$ID,-2$ +$FG,2$ 0x00$TX,"00100000",D="DD_SYS_FIXED_AREA_BASE"$- 0x00$TX,"002037FF",D="DD_SYS_FIXED_AREA_END"$$FG$ +$ID,2$$LK,"CSysFixedArea",A="MN:CSysFixedArea"$ for page tables and misc. $TX,"256 Gig",D="DD_MEM_MAPPED_SPACE_GIG"$ of address space mapped. +$ID,-2$ +$FG,2$ 0x00$TX,"00203800",D="DD_SYS_HEAP_BASE"$- 0x00$TX,"7FFFFFFF",D="DD_SYS_HEAP_LIMIT"$$FG$ +$ID,2$Code Heap mem. +$ID,-2$ +$FG,2$ - 0x007FFFFFFF$FG$ +$ID,2$Data Heap mem. (This exists if there is less than 2 Gig of code heap.) +$ID,-2$ +$FG,2$ 0x00E0000000- 0x00FFFFFFFF$FG$ +$ID,2$32-bit devices could alloc memory at 0xF0000000 going up, but this is wrong, since some PCs already have devices at 0xF0000000. No PCI devices are supported, so $LK,"Mem32DevAlloc",A="MN:Mem32DevAlloc"$() flaws are not an issue. +$ID,-2$ +$FG,2$ 0x0080000000-~0x00DFFFFFFF$FG$ +$FG,2$ 0x0100000000-~0x$TX,"3FFFFFFFFF",D="DD_MEM_MAPPED_SPACE_END"$$FG$ +$ID,2$Data Heap mem. (The physical memory that exists in this range is data heap.) +$ID,-2$ +$FG,2$ 0x$TX,"3F00000000",D="DD_UNCACHED_ALIAS"$- 0x$TX,"3FFFFFFFFF",D="DD_MEM_MAPPED_SPACE_END"$$FG$ +$ID,2$Uncached alias of first 4 Gig. (For 32-bit device access.) +$ID,-2$ +$FG,2$ - 0x$TX,"3FFFFFFFFF",D="DD_MEM_MAPPED_SPACE_END"$$FG$ +$ID,2$64-bit devices are alloced with $LK,"Mem64DevAlloc",A="MN:Mem64DevAlloc"$() counting bwd from $TX,"256 Gig",D="DD_MEM_MAPPED_SPACE_GIG"$, but no PCI devices are actually supported$WW,0$. +$ID,-2$ + + +$WW,1$* Note: There is a break in the data-heap block pool. This has no effect except the obvious effect that fragmentation has on contiguous requests. I can $LK,"MAlloc",A="MN:MAlloc"$() an 8 Gig chunk on my 12 Gig machine. + +* Note: For systems with less than 2 Gig RAM, the code and data heap block pools are the same. For systems with 2-4 Gig of RAM, the code heap is 1/4 of the total. See $LK,"BlkPoolsInit",A="MN:BlkPoolsInit"$(). + +* See $LK,"Independent HeapCtrl Example",A="FA:::/Kernel/KEnd.HC,Independent HeapCtrl Example"$. diff --git a/Doc/MemOverview.TXT b/Doc/MemOverview.TXT deleted file mode 100644 index 80d3d59..0000000 --- a/Doc/MemOverview.TXT +++ /dev/null @@ -1,60 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"Memory Overview"$$FG$ - -Paging is practically not used. 64-bit mode requires paging, however, so it is identity-mapped, virtual identical to physical. All tasks on all cores use the same page table map, just as though all addresses are physical addresses. 2 Meg page table entries are used. Nothing swaps to disk. You can adjust $LK,"MEM_MAPPED_SPACE",A="MN:MEM_MAPPED_SPACE"$ for more RAM. - -In TempleOS, the lowest 2 Gig of memory is called the $FG,2$code heap$FG$. TempleOS's compiler always uses 32-bit signed relative JMP & CALL insts because 64-bit CALLs take two insts. With signed +/- 32-bit values, code can only call a function within 2 Gig distance. Therefore, TempleOS keeps all code in the lowest 2 Gig memory addresses including what would normally be called "the kernel". Two Gig is plenty for code, don't worry. - -You can create new, independent heaps using $LK,"HeapCtrlInit",A="MN:HeapCtrlInit"$(). Then, use the $LK,"CHeapCtrl",A="MN:CHeapCtrl"$ as the 2nd arg to $LK,"MAlloc",A="MN:MAlloc"$(). See $LK,"HeapLog",A="MN:HeapLog"$() for an example. - -Memory alloced by a task will be freed when the task is killed. - -Eventually, memory will become fragmented, requiring a reboot. - -See $LK,"MemRep",A="MN:MemRep"$() and $LK,"::/Demo/MemDemo.CPP"$. - -$FG,5$$TX+CX,"Single System-wide Mem Map"$ - -$FG,2$ 0x00$TX,"00007C00",D="DD_KERNEL"$- 0x00$TX,"00035F3F",D="DD_KERNEL_END"$$FG$ -$ID,2$Kernel module, placed here by the boot-loader, $LK,"BOOT_RAM_BASE",A="MN:BOOT_RAM_BASE"$. -$ID,-2$ -$FG,2$ 0x00$TX,"00096600",D="DD_BOOT_HIGH_LOC_DVD"$- 0x00$TX,"00096FFF",D="DD_BOOT_HIGH_LOC_DVD_END"$$FG$ -$ID,2$$FG$Boot block relocated here before loading the Kernel module, $LK,"BootDVD",A="FI:::/Adam/Opt/Boot/BootDVD.CPP"$ & $LK,"BootHD",A="FI:::/Adam/Opt/Boot/BootHD.CPP"$. -$ID,-2$ -$FG,2$ 0x00$TX,"00097000",D="DD_MP_VECT"$- 0x00$TX,"00097030",D="DD_MP_VECT_END"$$FG$ -$ID,2$Multicore start-up vect code, $LK,"MPN_VECT",A="MN:MPN_VECT"$. -$ID,-2$ -$FG,2$~0x000009F000- 0x000009FFFF -$ID,2$$FG$Extended BIOS data area. -$ID,-2$ -$FG,2$ 0x00000A0000- 0x00000BFFFF$FG$ -$ID,2$VGA graphics mem, marked as write-through cache in $LK,"text",A="MN:text"$.vga_alias. -$ID,-2$ -$FG,2$ 0x00$TX,"00100000",D="DD_SYS_FIXED_AREA_BASE"$- 0x00$TX,"002037FF",D="DD_SYS_FIXED_AREA_END"$$FG$ -$ID,2$$LK,"CSysFixedArea",A="MN:CSysFixedArea"$ for page tables and misc. $TX,"256 Gig",D="DD_MEM_MAPPED_SPACE_GIG"$ of address space mapped. -$ID,-2$ -$FG,2$ 0x00$TX,"00203800",D="DD_SYS_HEAP_BASE"$- 0x00$TX,"7FFFFFFF",D="DD_SYS_HEAP_LIMIT"$$FG$ -$ID,2$Code Heap mem. -$ID,-2$ -$FG,2$ - 0x007FFFFFFF$FG$ -$ID,2$Data Heap mem. (This exists if there is less than 2 Gig of code heap.) -$ID,-2$ -$FG,2$ 0x00E0000000- 0x00FFFFFFFF$FG$ -$ID,2$32-bit devices could alloc memory at 0xF0000000 going up, but this is wrong, since some PCs already have devices at 0xF0000000. No PCI devices are supported, so $LK,"Mem32DevAlloc",A="MN:Mem32DevAlloc"$() flaws are not an issue. -$ID,-2$ -$FG,2$ 0x0080000000-~0x00DFFFFFFF$FG$ -$FG,2$ 0x0100000000-~0x$TX,"3FFFFFFFFF",D="DD_MEM_MAPPED_SPACE_END"$$FG$ -$ID,2$Data Heap mem. (The physical memory that exists in this range is data heap.) -$ID,-2$ -$FG,2$ 0x$TX,"3F00000000",D="DD_UNCACHED_ALIAS"$- 0x$TX,"3FFFFFFFFF",D="DD_MEM_MAPPED_SPACE_END"$$FG$ -$ID,2$Uncached alias of first 4 Gig. (For 32-bit device access.) -$ID,-2$ -$FG,2$ - 0x$TX,"3FFFFFFFFF",D="DD_MEM_MAPPED_SPACE_END"$$FG$ -$ID,2$64-bit devices are alloced with $LK,"Mem64DevAlloc",A="MN:Mem64DevAlloc"$() counting bwd from $TX,"256 Gig",D="DD_MEM_MAPPED_SPACE_GIG"$, but no PCI devices are actually supported$WW,0$. -$ID,-2$ - - -$WW,1$* Note: There is a break in the data-heap block pool. This has no effect except the obvious effect that fragmentation has on contiguous requests. I can $LK,"MAlloc",A="MN:MAlloc"$() an 8 Gig chunk on my 12 Gig machine. - -* Note: For systems with less than 2 Gig RAM, the code and data heap block pools are the same. For systems with 2-4 Gig of RAM, the code heap is 1/4 of the total. See $LK,"BlkPoolsInit",A="MN:BlkPoolsInit"$(). - -* See $LK,"Independent HeapCtrl Example",A="FA:::/Kernel/KEnd.CPP,Independent HeapCtrl Example"$. diff --git a/Doc/Menus.DD b/Doc/Menus.DD new file mode 100644 index 0000000..ed946fc --- /dev/null +++ b/Doc/Menus.DD @@ -0,0 +1,28 @@ +$WW,1$A pull-down menu appears when you move the mouse to the top of the screen. Menus are created with $LK,"MenuPush",A="MN:MenuPush"$(), $LK,"MenuFilePush",A="MN:MenuFilePush"$(), $LK,"MenuNew",A="MN:MenuNew"$() or $LK,"MenuFile",A="MN:MenuFile"$() and assigned to $FG,4$Fs->cur_menu$FG$. The format is: + +$FG,2$ +File +{ + Open(,'O'); + Save(,'S'); + Exit(,CH_SHIFT_ESC); +} +Edit { + Cut(,,SC_DELETE|SCF_SHIFT); + Paste(,,SC_INS|SCF_SHIFT); +} +Misc { + Opt1(MSG_CMD,M_OPTION1); + Opt2(MSG_CMD,M_OPTION2); +} +Help +{ + Help(,'?'); + About(,'/'); +} +$FG$ +The first arg is the msg code and it is optional with the default being $LK,"MSG_KEY_DOWN_UP",A="MN:MSG_KEY_DOWN_UP"$. The second arg is the msg $FG,2$a1$FG$ value which is $LK,"ASCII",A="MN:CH_CTRLA"$ of the key in the case of $LK,"MSG_KEY_DOWN",A="MN:MSG_KEY_DOWN"$. The third arg is the msg $FG,2$a2$FG$ value which is the $LK,"scan_code",A="FI:::/Doc/CharOverview.DD"$$FG$ of the key in the case of $LK,"MSG_KEY_DOWN",A="MN:MSG_KEY_DOWN"$. + +Press $FG,2$$FG$ and "Insert ASCII/ScanCode". + +See $LK,"::/Demo/PullDownMenu.HC"$. diff --git a/Doc/Menus.TXT b/Doc/Menus.TXT deleted file mode 100644 index 3e42b17..0000000 --- a/Doc/Menus.TXT +++ /dev/null @@ -1,28 +0,0 @@ -$WW,1$A pull-down menu appears when you move the mouse to the top of the screen. Menus are created with $LK,"MenuPush",A="MN:MenuPush"$(), $LK,"MenuFilePush",A="MN:MenuFilePush"$(), $LK,"MenuNew",A="MN:MenuNew"$() or $LK,"MenuFile",A="MN:MenuFile"$() and assigned to $FG,4$Fs->cur_menu$FG$. The format is: - -$FG,2$ -File -{ - Open(,'O'); - Save(,'S'); - Exit(,CH_SHIFT_ESC); -} -Edit { - Cut(,,SC_DELETE|SCF_SHIFT); - Paste(,,SC_INS|SCF_SHIFT); -} -Misc { - Opt1(MSG_CMD,M_OPTION1); - Opt2(MSG_CMD,M_OPTION2); -} -Help -{ - Help(,'?'); - About(,'/'); -} -$FG$ -The first arg is the msg code and it is optional with the default being $LK,"MSG_KEY_DOWN_UP",A="MN:MSG_KEY_DOWN_UP"$. The second arg is the msg $FG,2$a1$FG$ value which is $LK,"ASCII",A="MN:CH_CTRLA"$ of the key in the case of $LK,"MSG_KEY_DOWN",A="MN:MSG_KEY_DOWN"$. The third arg is the msg $FG,2$a2$FG$ value which is the $LK,"scan_code",A="FI:::/Doc/CharOverview.TXT"$$FG$ of the key in the case of $LK,"MSG_KEY_DOWN",A="MN:MSG_KEY_DOWN"$. - -Press $FG,2$$FG$ and "Insert ASCII/ScanCode". - -See $LK,"::/Demo/PullDownMenu.CPP"$. diff --git a/Doc/Msgs.TXT b/Doc/Msgs.DD similarity index 100% rename from Doc/Msgs.TXT rename to Doc/Msgs.DD diff --git a/Doc/MultiCore.DD b/Doc/MultiCore.DD new file mode 100644 index 0000000..c12b77c --- /dev/null +++ b/Doc/MultiCore.DD @@ -0,0 +1,14 @@ +$WW,1$TempleOS does master-slave multicore instead of SMP. $FG,2$Core0$FG$ is the master. The master core's applications explicitly assign computational jobs to other cores and the TempleOS scheduler does not move tasks between cores. + +There are multicore safe locks for file access and heap allocations, however, so TempleOS is symmetrical in some sense. See $LK,"::/Demo/MultiCore/LoadTest.HC"$. + +Only tasks on $FG,2$core0$FG$ can have windows, but other cores can help render them. + +Each core has an executive $FG,2$seth task$FG$ which is the father of all tasks on that core. Adam is the seth task on core 0. + +You give a job to a seth task with $LK,"JobQue",A="MN:JobQue"$() and get the res with $LK,"JobResGet",A="MN:JobResGet"$(). You spawn a task on another core with $LK,"Spawn",A="MN:Spawn"$(). + +Note: You must use the $FG,2$LOCK$FG$ asm prefix when changing shared structures in a multicore environment. The $LK,"LBts",A="MN:LBts"$(), $LK,"LBtr",A="MN:LBtr"$() and $LK,"LBtc",A="MN:LBtc"$() insts have $FG,2$LOCK$FG$ prefixes. The compiler has a $FG,2$lock{}$FG$ feature but it doesn't work well. See $LK,"::/Demo/MultiCore/Lock.HC"$. + +See $LK,"::/Demo/Graphics/Transform.HC"$. +See $LK,"::/Kernel/MultiProc.HC"$. diff --git a/Doc/MultiCore.TXT b/Doc/MultiCore.TXT deleted file mode 100644 index dfe59cd..0000000 --- a/Doc/MultiCore.TXT +++ /dev/null @@ -1,14 +0,0 @@ -$WW,1$TempleOS does master-slave multicore instead of SMP. $FG,2$Core0$FG$ is the master. The master core's applications explicitly assign computational jobs to other cores and the TempleOS scheduler does not move tasks between cores. - -There are multicore safe locks for file access and heap allocations, however, so TempleOS is symmetrical in some sense. See $LK,"::/Demo/MultiCore/LoadTest.CPP"$. - -Only tasks on $FG,2$core0$FG$ can have windows, but other cores can help render them. - -Each core has an executive $FG,2$seth task$FG$ which is the father of all tasks on that core. Adam is the seth task on core 0. - -You give a job to a seth task with $LK,"JobQue",A="MN:JobQue"$() and get the res with $LK,"JobResGet",A="MN:JobResGet"$(). You spawn a task on another core with $LK,"Spawn",A="MN:Spawn"$(). - -Note: You must use the $FG,2$LOCK$FG$ asm prefix when changing shared structures in a multicore environment. The $LK,"LBts",A="MN:LBts"$(), $LK,"LBtr",A="MN:LBtr"$() and $LK,"LBtc",A="MN:LBtc"$() insts have $FG,2$LOCK$FG$ prefixes. The compiler has a $FG,2$lock{}$FG$ feature but it doesn't work well. See $LK,"::/Demo/MultiCore/Lock.CPP"$. - -See $LK,"::/Demo/Graphics/Transform.CPP"$. -See $LK,"::/Kernel/MultiProc.CPP"$. diff --git a/Doc/ODE.DD b/Doc/ODE.DD new file mode 100644 index 0000000..b7dc3d2 --- /dev/null +++ b/Doc/ODE.DD @@ -0,0 +1,6 @@ +$WW,1$TempleOS has an advanced algorithm for integrating ordinary differential equations suitable for use in video games. (Not scientific work.) It also has some support for systems of masses and springs, to save you some work. + +See $LK,"CMathODE",A="MN:CMathODE"$ and $LK,"ODEsUpdate",A="MN:ODEsUpdate"$ for an overview. +See $LK,"ODECallDerivative",A="MN:ODECallDerivative"$ to see what support there is for masses and springs. + +See $LK,"::/Demo/Games/Whap.HC"$, $LK,"::/Demo/Games/Rocket.HC"$, $LK,"::/Demo/Games/MassSpring.HC"$, $LK,"::/Apps/Span/SpanMain.HC"$ or $LK,"::/Apps/X-Caliber/X-Caliber.HC"$. diff --git a/Doc/ODE.TXT b/Doc/ODE.TXT deleted file mode 100644 index c9ee4fd..0000000 --- a/Doc/ODE.TXT +++ /dev/null @@ -1,6 +0,0 @@ -$WW,1$TempleOS has an advanced algorithm for integrating ordinary differential equations suitable for use in video games. (Not scientific work.) It also has some support for systems of masses and springs, to save you some work. - -See $LK,"CMathODE",A="MN:CMathODE"$ and $LK,"ODEsUpdate",A="MN:ODEsUpdate"$ for an overview. -See $LK,"ODECallDerivative",A="MN:ODECallDerivative"$ to see what support there is for masses and springs. - -See $LK,"::/Demo/Games/Whap.CPP"$, $LK,"::/Demo/Games/Rocket.CPP"$, $LK,"::/Demo/Games/MassSpring.CPP"$, $LK,"::/Apps/Span/SpanMain.CPP"$ or $LK,"::/Apps/X-Caliber/X-Caliber.CPP"$. diff --git a/Doc/Options.DD b/Doc/Options.DD new file mode 100644 index 0000000..27028bd --- /dev/null +++ b/Doc/Options.DD @@ -0,0 +1,19 @@ +$WW,1$$FG,5$$TX+CX,"Compiler Options"$$FG$ + +Use $LK,"Option",A="MN:Option"$(). You might need to do $FG,2$#exe {Option();}$FG$. + +$LK,"OPTf_GLBLS_ON_DATA_HEAP",A="MN:OPTf_GLBLS_ON_DATA_HEAP"$ without this option, global vars are placed in the code heap which is limited to 2 Gig. In $FG,2$AOT$FG$ modules, global vars take-up room in the $FG,2$.BIN$FG$ file, so you might want to use this option, instead. You might wish to turn it on and off around specific vars. A disadvantage of data heap global vars in $FG,2$AOT$FG$ modules is they can't be initialized. + +$LK,"OPTf_EXTERNS_TO_IMPORTS",A="MN:OPTf_EXTERNS_TO_IMPORTS"$ and $LK,"OPTf_KEEP_PRIVATE",A="MN:OPTf_KEEP_PRIVATE"$ are strange options, you'll never need. They're to allow the same header file for $FG,2$Kernel$FG$ to act as $FG,2$extern$FG$s when compiling itself and $FG,2$import$FG$s when compiled by $FG,2$AOT$FG$ modules. + +$LK,"OPTf_WARN_UNUSED_VAR",A="MN:OPTf_WARN_UNUSED_VAR"$ warning if unused var. It is applied to functions. + +$LK,"OPTf_WARN_PAREN",A="MN:OPTf_WARN_PAREN"$ warning if parenthesis are not needed. + +$LK,"OPTf_WARN_DUP_TYPES",A="MN:OPTf_WARN_DUP_TYPES"$ warning if dup local var type stmts. + +$LK,"OPTf_WARN_HEADER_MISMATCH",A="MN:OPTf_WARN_HEADER_MISMATCH"$ warning if fun header does not match. + +$LK,"OPTf_NO_REG_VAR",A="MN:OPTf_NO_REG_VAR"$ forces all function local vars to the stk not regs. Applied to functions. + +$LK,"OPTf_NO_BUILTIN_CONST",A="MN:OPTf_NO_BUILTIN_CONST"$ Disable 10-byte float consts for ã, log2_10, log10_2, loge_2. Applied to functions. diff --git a/Doc/Options.TXT b/Doc/Options.TXT deleted file mode 100644 index dc45a60..0000000 --- a/Doc/Options.TXT +++ /dev/null @@ -1,17 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"Compiler Options"$$FG$ - -Use $LK,"Option",A="MN:Option"$(). You might need to do $FG,2$#exe {Option();}$FG$. - -$LK,"OPTf_GLBLS_ON_DATA_HEAP",A="MN:OPTf_GLBLS_ON_DATA_HEAP"$ without this option, global vars are placed in the code heap which is limited to 2 Gig. In $FG,2$AOT$FG$ modules, global vars take-up room in the $FG,2$.BIN$FG$ file, so you might want to use this option, instead. You might wish to turn it on and off around specific vars. A disadvantage of data heap global vars in $FG,2$AOT$FG$ modules is they can't be initialized. - -$LK,"OPTf_EXTERNS_TO_IMPORTS",A="MN:OPTf_EXTERNS_TO_IMPORTS"$ and $LK,"OPTf_KEEP_PRIVATE",A="MN:OPTf_KEEP_PRIVATE"$ are strange options, you'll never need. They're to allow the same header file for $FG,2$Kernel$FG$ to act as $FG,2$extern$FG$s when compiling itself and $FG,2$import$FG$s when compiled by $FG,2$AOT$FG$ modules. - -$LK,"OPTf_WARN_UNUSED_VAR",A="MN:OPTf_WARN_UNUSED_VAR"$ warning if unused var. It is applied to functions. - -$LK,"OPTf_WARN_PAREN",A="MN:OPTf_WARN_PAREN"$ warning if parenthesis are not needed. - -$LK,"OPTf_WARN_DUP_TYPES",A="MN:OPTf_WARN_DUP_TYPES"$ warning if dup local var type stmts. - -$LK,"OPTf_NO_REG_VAR",A="MN:OPTf_NO_REG_VAR"$ forces all function local vars to the stk not regs. Applied to functions. - -$LK,"OPTf_NO_BUILTIN_CONST",A="MN:OPTf_NO_BUILTIN_CONST"$ Disable 10-byte float consts for ã, log2_10, log10_2, loge_2. Applied to functions. diff --git a/Doc/PreProcessor.DD b/Doc/PreProcessor.DD new file mode 100644 index 0000000..d9fb743 --- /dev/null +++ b/Doc/PreProcessor.DD @@ -0,0 +1,19 @@ +$WW,1$$FG,5$$TX+CX,"PreProcessor"$$FG$ + +There is no separate preprocessor pass. The parser front-end calls $LK,"Lex",A="MN:Lex"$() which has the preprocessor built-in. The compiler looks ahead a token, most of the time, so you might throw an extra semicolon after a directive if it's not taking affect right away. + +Put an extra semicolon $FG,2$#exe {Cd("DirName");;}$FG$ in case a $FG,2$#include$FG$ follows. + +$FG,2$#include ""$FG$ There is no angle bracket <> form of this directive. +$FG,2$#exe {}$FG$ Will execute code at compile-time and can be used to insert code into the stream being compiled using $LK,"StreamPrint",A="MN:StreamPrint"$(). +$FG,2$#define$FG$ Define string const +$FG,2$#assert$FG$ Print a warning during compilation if an expression is not true. +$FG,2$#if$FG$ Include code if an expresion is true. +$FG,2$#else +#endif +#ifdef,#ifndef $FG$Include code if a sym is defined. +$FG,2$#ifaot,#ifjit $FG$Include code if in $FG,2$AOT$FG$ compiler mode. +$FG,2$defined()$FG$ Is a function that can be used in expressions. +$FG,2$#help_index$FG$, $FG,2$#help_file$FG$ See $LK,"Help System",A="FI:::/Doc/HelpSystem.DD"$. + +See $LK,"PreProcessor",A="FF:::/Compiler/Lex.HC,KW_DEFINE"$. diff --git a/Doc/PreProcessor.TXT b/Doc/PreProcessor.TXT deleted file mode 100644 index d26baf6..0000000 --- a/Doc/PreProcessor.TXT +++ /dev/null @@ -1,19 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"PreProcessor"$$FG$ - -There is no separate preprocessor pass. The parser front-end calls $LK,"Lex",A="MN:Lex"$() which has the preprocessor built-in. The compiler looks ahead a token, most of the time, so you might throw an extra semicolon after a directive if it's not taking affect right away. - -Put an extra semicolon $FG,2$#exe {Cd("DirName");;}$FG$ in case a $FG,2$#include$FG$ follows. - -$FG,2$#include ""$FG$ There is no angle bracket <> form of this directive. -$FG,2$#exe {}$FG$ Will execute code at compile-time and can be used to insert code into the stream being compiled using $LK,"StreamPrint",A="MN:StreamPrint"$(). -$FG,2$#define$FG$ Define string const -$FG,2$#assert$FG$ Print a warning during compilation if an expression is not true. -$FG,2$#if$FG$ Include code if an expresion is true. -$FG,2$#else -#endif -#ifdef,#ifndef $FG$Include code if a sym is defined. -$FG,2$#ifaot,#ifjit $FG$Include code if in $FG,2$AOT$FG$ compiler mode. -$FG,2$defined()$FG$ Is a function that can be used in expressions. -$FG,2$#help_index$FG$, $FG,2$#help_file$FG$ See $LK,"Help System",A="FI:::/Doc/HelpSystem.TXT"$. - -See $LK,"PreProcessor",A="FF:::/Compiler/Lex.CPP,KW_DEFINE"$. diff --git a/Doc/Print.DD b/Doc/Print.DD new file mode 100644 index 0000000..5ea73f9 --- /dev/null +++ b/Doc/Print.DD @@ -0,0 +1,87 @@ +$WW,1$$FG,5$$TX+CX,"Print Fmt Strs"$$FG$ + + := $FG,2$%$FG$[$FG,2$-$FG$][$FG,2$0$FG$][][$FG,2$.$FG$][][$FG,2$h$FG$] + +See $LK,"StrPrintJoin",A="MN:StrPrintJoin"$(). + +: + +$ID,2$$FG,2$'t'$FG$ truncate to . +$FG,2$','$FG$ add commas every three digits or four nibbles. +$FG,2$'$$'$FG$ makes $FG,2$%Q$FG$ convert $FG,2$'$$'$FG$ to $FG,2$"\x24"$FG$. +$FG,2$'/'$FG$ makes $FG,2$%Q$FG$ and $FG,2$%q$FG$ convert $FG,2$'%'$FG$ to $FG,2$"%%"$FG$. +$ID,-2$ +: + +$ID,2$For $FG,2$"%n"$FG$, $FG,2$"%d"$FG$ or $FG,2$"%u"$FG$, the causes thousands mode. $FG,2$"%h?n"$FG$ will pick a var exponent multiples of three unit, while $FG,2$"%h-3n"$FG$ will display milli units or $FG,2$"%h6n"$FG$ will display mega units. The $FG,2$'k'$FG$ flag is always on for $FG,2$"%n"$FG$. See $LK,"::/Demo/Print.HC"$. + +For $FG,2$"%c"$FG$ or $FG,2$"%C"$FG$, the repeats the char that many times.$ID,-2$ + +: + +$ID,2$$FG,2$"%n"$FG$ floating point in engineering notation, exponents being multiples of three. If it has a code, it will display scientific units letters. + +$FG,2$"%S"$FG$ $LK,"Define",A="MN:Define"$() entry. + +$FG,2$"%C"$FG$ $LK,"ToUpper",A="MN:ToUpper"$() character. + +$FG,2$"%h25c",'\n';$FG$ 25 new-lines. + +$FG,2$"%h*c",25,'\n';$FG$ 25 new-lines. + +$FG,2$"%F"$FG$ text file by filename. + +$FG,2$"%$$F"$FG$ $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ file in memory. + +$FG,2$"%p"$FG$ ptr. + +$FG,2$"%P"$FG$ link to ptr. + +$FG,2$"%D"$FG$ date. Pass a $LK,"CDate",A="MN:CDate"$. + +$FG,2$"%T"$FG$ time. Pass a $LK,"CDate",A="MN:CDate"$. + +$FG,2$"%z"$FG$ sub_entry of an enumerated list of text entries. See $LK,"LstSub",A="MN:LstSub"$(). Pass sub_entry_num first, list second. + +$FG,2$"%Z"$FG$ $LK,"DefineLstLoad",A="MN:DefineLstLoad"$() subentry. Pass sub_entry_num first, define_name second. + +$FG,2$"%Q"$FG$ convert "\" to "\\" and quote to backslash quote. (For use in creating strs in strs.) + +$FG,2$"%q"$FG$ rev a $FG,2$"%Q"$FG$. +$ID,-2$ + +$FG,5$$TX+CX,"Print Family"$$FG$ + +$LK,"MStrPrint",A="MN:MStrPrint"$(U8 *fmt,...) is like $LK,"StrPrint",A="MN:StrPrint"$(U8 *dst,U8 *fmt,...) but it returns a $LK,"MAlloc",A="MN:MAlloc"$ated str. It is vary handy because you don't have to worry about overflow. + +$LK,"CatPrint",A="MN:CatPrint"$(U8 *_dst,U8 *fmt,...) concatenates a formated string. + +$LK,"Auto",A="MN:Auto"$(U8 *fmt,...) sends text to the current task's input buffer. +$LK,"AutoStr",A="MN:AutoStr"$(U8 *fmt,...) sends text of an $LK,"AutoFile",A="FF:::/Doc/Glossary.DD,AutoFile"$ to the keyboard stream of the current TASK but can also do mouse cmds. + +$LK,"XTalk",A="MN:XTalk"$(CTask *task,U8 *fmt,...) and text to another task's input buffer. +$LK,"XTalkStr",A="MN:XTalkStr"$(CTask *task,U8 *fmt,...) sends text of an $LK,"AutoFile",A="FF:::/Doc/Glossary.DD,AutoFile"$ to the keyboard stream of another TASK but can also do mouse cmds. + +$LK,"DocPrint",A="MN:DocPrint"$(CDoc *doc,U8 *fmt,...) sends text to a document. You can buffer to a Doc and save it, providing the functionality of $FG,2$fprintf$FG$. See $LK,"::/Demo/Dsk/FPrintF.HC"$. + +$LK,"Adam",A="MN:Adam"$(U8 *fmt,...) sends text to the adam task to be compiled and run. +$LK,"AdamLog",A="MN:AdamLog"$(U8 *fmt,...) and $LK,"AdamErr",A="MN:AdamErr"$(U8 *fmt,...) send text to the adam task to be displayed. + +$LK,"StreamPrint",A="MN:StreamPrint"$(U8 *fmt,...) sends text to the stream of code being compiled and must reside in a $FG,2$#exe{}$FG$ blk. + +$LK,"GrPrint",A="MN:GrPrint"$(CDC *dc,I64 x,I64 y,U8 *fmt,...) and $LK,"GrVPrint",A="MN:GrVPrint"$() plots text in graphics mode. + +$LK,"TextPrint",A="MN:TextPrint"$(CTask *task,I64 x,I64 y,I64 attr,U8 *fmt,...) plots to $LK,"gr.text_base",A="HI:TextBase Layer"$. + +$LK,"ExePrint",A="MN:ExePrint"$(U8 *fmt,...) compiles and execute a string. Note: It returns the res of the last executed expression. + +$LK,"AFPrint",A="MN:AFPrint"$(I64 ms,U8 *fmt,...) $LK,"PutChars",A="MN:PutChars"$()s one at a time with a delay. + +$LK,"RawPrint",A="MN:RawPrint"$(I64 ms,U8 *fmt,...) sends direct to screen memory, bypassing window manager. + +$LK,"User",A="MN:User"$(U8 *fmt,...) Spawns a user and execute a string on start-up. + +$LK,"PopUpPrint",A="MN:PopUpPrint"$(U8 *fmt,...) compiles and execute a string in a pop-up win. Note: It returns the res of the last executed expression. +$LK,"PopUpViewPrint",A="MN:PopUpViewPrint"$(U8 *fmt,...) creates a pop-up window and views text. + +$BK,1$Note:$BK,0$ Use $FG,2$Print("%s",src)$FG$ if you need an unmodified string. diff --git a/Doc/Print.TXT b/Doc/Print.TXT deleted file mode 100644 index 669fabb..0000000 --- a/Doc/Print.TXT +++ /dev/null @@ -1,87 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"Print Fmt Strs"$$FG$ - - := $FG,2$%$FG$[$FG,2$-$FG$][$FG,2$0$FG$][][$FG,2$.$FG$][][$FG,2$h$FG$] - -See $LK,"StrPrintJoin",A="MN:StrPrintJoin"$(). - -: - -$ID,2$$FG,2$'t'$FG$ truncate to . -$FG,2$','$FG$ add commas every three digits or four nibbles. -$FG,2$'$$'$FG$ makes $FG,2$%Q$FG$ convert $FG,2$'$$'$FG$ to $FG,2$"\x24"$FG$. -$FG,2$'/'$FG$ makes $FG,2$%Q$FG$ and $FG,2$%q$FG$ convert $FG,2$'%'$FG$ to $FG,2$"%%"$FG$. -$ID,-2$ -: - -$ID,2$For $FG,2$"%n"$FG$, $FG,2$"%d"$FG$ or $FG,2$"%u"$FG$, the causes thousands mode. $FG,2$"%h?n"$FG$ will pick a var exponent multiples of three unit, while $FG,2$"%h-3n"$FG$ will display milli units or $FG,2$"%h6n"$FG$ will display mega units. The $FG,2$'k'$FG$ flag is always on for $FG,2$"%n"$FG$. See $LK,"::/Demo/Print.CPP"$. - -For $FG,2$"%c"$FG$ or $FG,2$"%C"$FG$, the repeats the char that many times.$ID,-2$ - -: - -$ID,2$$FG,2$"%n"$FG$ floating point in engineering notation, exponents being multiples of three. If it has a code, it will display scientific units letters. - -$FG,2$"%S"$FG$ $LK,"Define",A="MN:Define"$() entry. - -$FG,2$"%C"$FG$ $LK,"ToUpper",A="MN:ToUpper"$() character. - -$FG,2$"%h25c",'\n';$FG$ 25 new-lines. - -$FG,2$"%h*c",25,'\n';$FG$ 25 new-lines. - -$FG,2$"%F"$FG$ text file by filename. - -$FG,2$"%$$F"$FG$ $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$ file in memory. - -$FG,2$"%p"$FG$ ptr. - -$FG,2$"%P"$FG$ link to ptr. - -$FG,2$"%D"$FG$ date. Pass a $LK,"CDate",A="MN:CDate"$. - -$FG,2$"%T"$FG$ time. Pass a $LK,"CDate",A="MN:CDate"$. - -$FG,2$"%z"$FG$ sub_entry of an enumerated list of text entries. See $LK,"LstSub",A="MN:LstSub"$(). Pass sub_entry_num first, list second. - -$FG,2$"%Z"$FG$ $LK,"DefineLstLoad",A="MN:DefineLstLoad"$() subentry. Pass sub_entry_num first, define_name second. - -$FG,2$"%Q"$FG$ convert "\" to "\\" and quote to backslash quote. (For use in creating strs in strs.) - -$FG,2$"%q"$FG$ rev a $FG,2$"%Q"$FG$. -$ID,-2$ - -$FG,5$$TX+CX,"Print Family"$$FG$ - -$LK,"MStrPrint",A="MN:MStrPrint"$(U8 *fmt,...) is like $LK,"StrPrint",A="MN:StrPrint"$(U8 *dst,U8 *fmt,...) but it returns a $LK,"MAlloc",A="MN:MAlloc"$ated str. It is vary handy because you don't have to worry about overflow. - -$LK,"CatPrint",A="MN:CatPrint"$(U8 *_dst,U8 *fmt,...) concatenates a formated string. - -$LK,"Auto",A="MN:Auto"$(U8 *fmt,...) sends text to the current task's input buffer. -$LK,"AutoStr",A="MN:AutoStr"$(U8 *fmt,...) sends text of an $LK,"AutoFile",A="FF:::/Doc/Glossary.TXT,AutoFile"$ to the keyboard stream of the current TASK but can also do mouse cmds. - -$LK,"XTalk",A="MN:XTalk"$(CTask *task,U8 *fmt,...) and text to another task's input buffer. -$LK,"XTalkStr",A="MN:XTalkStr"$(CTask *task,U8 *fmt,...) sends text of an $LK,"AutoFile",A="FF:::/Doc/Glossary.TXT,AutoFile"$ to the keyboard stream of another TASK but can also do mouse cmds. - -$LK,"DocPrint",A="MN:DocPrint"$(CDoc *doc,U8 *fmt,...) sends text to a document. You can buffer to a Doc and save it, providing the functionality of $FG,2$fprintf$FG$. See $LK,"::/Demo/Dsk/FPrintF.CPP"$. - -$LK,"Adam",A="MN:Adam"$(U8 *fmt,...) sends text to the adam task to be compiled and run. -$LK,"AdamLog",A="MN:AdamLog"$(U8 *fmt,...) and $LK,"AdamErr",A="MN:AdamErr"$(U8 *fmt,...) send text to the adam task to be displayed. - -$LK,"StreamPrint",A="MN:StreamPrint"$(U8 *fmt,...) sends text to the stream of code being compiled and must reside in a $FG,2$#exe{}$FG$ blk. - -$LK,"GrPrint",A="MN:GrPrint"$(CDC *dc,I64 x,I64 y,U8 *fmt,...) and $LK,"GrVPrint",A="MN:GrVPrint"$() plots text in graphics mode. - -$LK,"TextPrint",A="MN:TextPrint"$(CTask *task,I64 x,I64 y,I64 attr,U8 *fmt,...) plots to $LK,"gr.text_base",A="HI:TextBase Layer"$. - -$LK,"ExePrint",A="MN:ExePrint"$(U8 *fmt,...) compiles and execute a string. Note: It returns the res of the last executed expression. - -$LK,"AFPrint",A="MN:AFPrint"$(I64 mS,U8 *fmt,...) $LK,"PutChars",A="MN:PutChars"$()s one at a time with a delay. - -$LK,"RawPrint",A="MN:RawPrint"$(I64 mS,U8 *fmt,...) sends direct to screen memory, bypassing window manager. - -$LK,"User",A="MN:User"$(U8 *fmt,...) Spawns a user and execute a string on start-up. - -$LK,"PopUpPrint",A="MN:PopUpPrint"$(U8 *fmt,...) compiles and execute a string in a pop-up win. Note: It returns the res of the last executed expression. -$LK,"PopUpViewPrint",A="MN:PopUpViewPrint"$(U8 *fmt,...) creates a pop-up window and views text. - -$BK,1$Note:$BK,0$ Use $FG,2$Print("%s",src)$FG$ if you need an unmodified string. diff --git a/Doc/Profiler.TXT b/Doc/Profiler.DD similarity index 100% rename from Doc/Profiler.TXT rename to Doc/Profiler.DD diff --git a/Doc/Que.TXT b/Doc/Que.DD similarity index 100% rename from Doc/Que.TXT rename to Doc/Que.DD diff --git a/Doc/Quirks.TXT b/Doc/Quirks.DD similarity index 100% rename from Doc/Quirks.TXT rename to Doc/Quirks.DD diff --git a/Doc/RedSea.DD b/Doc/RedSea.DD new file mode 100644 index 0000000..b672c0a --- /dev/null +++ b/Doc/RedSea.DD @@ -0,0 +1,40 @@ +$WW,1$$FG,5$$TX+CX,"RedSea File System"$$FG$ + +The RedSea file system is a simple, 64-bit, file system which is similar to FAT32, but with absolute block addresses instead of clusters, fixed-sized 64-byte directory entries and no FAT table, just an allocation bitmap. A cluster is just one 512 byte sector. Files are stored in contiguous blocks and cannot grow in size. + +$HL,1$#define CDIR_FILENAME_LEN 38 //Must include terminator zero + +The following bit field shows valid 8-Bit ASCII filename characters. + +U32 chars_bmp_filename[8]= +{0x0000000, 0x03FF73FB, 0xEFFFFFFF, 0x2FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF}; + +public class CDirEntry //64-byte fixed-size +{ + U16 attr; //See $LK,"RS_ATTR_DIR",A="MN:RS_ATTR_DIR"$. I would like to change these. + U8 name[CDIR_FILENAME_LEN]; //See $LK,"chars_bmp_filename",A="MN:chars_bmp_filename"$, $LK,"FileNameChk",A="MN:FileNameChk"$ + I64 cluster; (blk) //One sector per cluster. + I64 size; //In bytes + CDate datetime; //See $LK,"DateTime",A="::/Doc/TimeDate.DD"$, $LK,"Implementation of DateTime",A="FI:::/Kernel/KDate.HC"$ +}; + +public class CRedSeaBoot //RedSea is type FAT32 in partition table to fool BIOS. +{ + U8 jump_and_nop[3]; + U8 signature,reserved[4]; //MBR_PT_REDSEA=0x88. Distinguish from real FAT32. + I64 drv_offset; //For CD/DVD image copy. + I64 sects; + I64 root_cluster; (root_blk) + I64 bitmap_sects; + I64 unique_id; + U8 code[462]; + U16 signature2; //0xAA55 +}; +$HL,0$ +See $LK,"::/Kernel/BlkDev/FileSysRedSea.HC"$ and $LK,"::/Adam/Opt/Boot/DskISORedSea.HC"$. + +Files with names ending in .Z are compressed. See $LK,"::/Kernel/Compress.HC"$. + +To replace ISO9660, make hard-drive partition image of a measured size and copy onto a CD/DVD starting at about sector 20, with EL TORITO booting. 512-byte sectors will be placed on top of 2048-byte CD/DCD sectors, so there will be four blocks per CD/DVD sector. + +RedSea file system has no bad block table and no redundant allocation table. diff --git a/Doc/RedSea.TXT b/Doc/RedSea.TXT deleted file mode 100644 index ae85556..0000000 --- a/Doc/RedSea.TXT +++ /dev/null @@ -1,40 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"RedSea File System"$$FG$ - -The RedSea file system is a simple, 64-bit, file system which is similar to FAT32, but with absolute block addresses instead of clusters, fixed-sized 64-byte directory entries and no FAT table, just an allocation bitmap. A cluster is just one 512 byte sector. Files are stored in contiguous blocks and cannot grow in size. - -$HL,1$#define CDIR_FILENAME_LEN 38 //Must include terminator zero - -The following bit field shows valid 8-Bit ASCII filename characters. - -U32 chars_bmp_filename[8]= -{0x0000000, 0x03FF73FB, 0xEFFFFFFF, 0x2FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF}; - -public class CDirEntry //64-byte fixed-size -{ - U16 attr; //See $LK,"RS_ATTR_DIR",A="MN:RS_ATTR_DIR"$. I would like to change these. - U8 name[CDIR_FILENAME_LEN]; //See $LK,"chars_bmp_filename",A="MN:chars_bmp_filename"$, $LK,"FileNameChk",A="MN:FileNameChk"$ - I64 cluster; (blk) //One sector per cluster. - I64 size; //In bytes - CDate datetime; //See $LK,"DateTime",A="::/Doc/TimeDate.TXT"$, $LK,"Implementation of DateTime",A="FI:::/Kernel/KDate.CPP"$ -}; - -public class CRedSeaBoot //RedSea is type FAT32 in partition table to fool BIOS. -{ - U8 jump_and_nop[3]; - U8 signature,reserved[4]; //MBR_PT_REDSEA=0x88. Distinguish from real FAT32. - I64 drv_offset; //For CD/DVD image copy. - I64 sects; - I64 root_cluster; (root_blk) - I64 bitmap_sects; - I64 unique_id; - U8 code[462]; - U16 signature2; //0xAA55 -}; -$HL,0$ -See $LK,"::/Kernel/BlkDev/FileSysRedSea.CPP"$ and $LK,"::/Adam/Opt/Boot/DskISORedSea.CPP"$. - -Files with names ending in .Z are compressed. See $LK,"::/Kernel/Compress.CPP"$. - -To replace ISO9660, make hard-drive partition image of a measured size and copy onto a CD/DVD starting at about sector 20, with EL TORITO booting. 512-byte sectors will be placed on top of 2048-byte CD/DCD sectors, so there will be four blocks per CD/DVD sector. - -RedSea file system has no bad block table and no redundant allocation table. diff --git a/Doc/Requirements.TXT b/Doc/Requirements.DD similarity index 100% rename from Doc/Requirements.TXT rename to Doc/Requirements.DD diff --git a/Doc/Resource.DD b/Doc/Resource.DD new file mode 100644 index 0000000..6796aaf --- /dev/null +++ b/Doc/Resource.DD @@ -0,0 +1,5 @@ +$WW,1$$FG,5$$TX+CX,"Graphic Sprite Resource Help"$$FG$ + +A sprite is an ordered list of elements such as lines, rectangles, bitmaps and color changes. In a program's source code, you first $FG,2$make a sprite$FG$ somewhere outside a function. Then, you $FG,2$insert a pointer$FG$ to the sprite as an "*elems" arg when calling $LK,"Sprite",A="MN:Sprite"$() or $LK,"Sprite3",A="MN:Sprite3"$(). See $LK,"Sprites",A="HI:Sprites"$. + +You can create a $FG,2$sprite macro$FG$ on your $LK,"PersonalMenu",A="FI:~/PersonalMenu.DD"$ with a payload of $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ source code to execute when it ESC's back to the cmd line. If you check "Pop-Up", it will spawn a new task and run the payload. A pop-up macro can be placed in any document. diff --git a/Doc/Resource.TXT b/Doc/Resource.TXT deleted file mode 100644 index 71f2f94..0000000 --- a/Doc/Resource.TXT +++ /dev/null @@ -1,5 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"Graphic Sprite Resource Help"$$FG$ - -A sprite is an ordered list of elements such as lines, rectangles, bitmaps and color changes. In a program's source code, you first $FG,2$make a sprite$FG$ somewhere outside a function. Then, you $FG,2$insert a pointer$FG$ to the sprite as an "*elems" arg when calling $LK,"Sprite",A="MN:Sprite"$() or $LK,"Sprite3",A="MN:Sprite3"$(). See $LK,"Sprites",A="HI:Sprites"$. - -You can create a $FG,2$sprite macro$FG$ on your $LK,"PersonalMenu",A="FI:~/PersonalMenu.TXT"$ with a payload of $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ source code to execute when it ESC's back to the cmd line. If you check "Pop-Up", it will spawn a new task and run the payload. A pop-up macro can be placed in any document. diff --git a/Doc/ScopingLinkage.DD b/Doc/ScopingLinkage.DD new file mode 100644 index 0000000..5a91f44 --- /dev/null +++ b/Doc/ScopingLinkage.DD @@ -0,0 +1,120 @@ +$PURPLE$$TX+CX,"Scoping and Linkage"$$FG$ +$WW,1$ +$LK,"JIT Compile Mode",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$ makes use of the current task's hash sym table and its parent tasks' tables. It fetches syms from parent tasks' tables if not found locally in the current task's table and it places new syms in the current task's table. Conceptually, syms are at the scope of environment vars in other operating systems. + +When a sym is placed into a table, older syms with ident names will be overshadowed if they exist. Duplicates are not allowed in many cases, especially in asm blks. Dupicates are allowed, by design in other cases, so that you can repeatedly $GREEN$#include$FG$ the same file from the cmd line while developing it. Or, so you can repeatedly declare a function with a standard name, like $GREEN$DrawIt()$FG$. This case might occur when the $GREEN$adam task$FG$ is starting-up loading-in many little utilities. + +$GREEN$extern$FG$ binds a new $LK,"HTT_FUN",A="MN:HTT_FUN"$ or $LK,"HTT_GLBL_VAR",A="MN:HTT_GLBL_VAR"$ sym to an existing sym of the same name if it exists in the sym table (just in just-in-time code). It also can be used to generate a fwd reference. + +$GREEN$import$FG$ binds a new $LK,"HTT_FUN",A="MN:HTT_FUN"$ or $LK,"HTT_GLBL_VAR",A="MN:HTT_GLBL_VAR"$ sym to a sym of the same name imported from the task's sym table at $LK,"Load",A="MN:Load"$() time. If no sym exists to bind to at $LK,"Load",A="MN:Load"$() time, the code using this sym will be left incomplete until the sym is defined. + +$WW,1$ +$GREEN$_extern$FG$ binds a new $LK,"HTT_FUN",A="MN:HTT_FUN"$ or $LK,"HTT_GLBL_VAR",A="MN:HTT_GLBL_VAR"$ sym to an existing sym, of a $BK,1$different$BK,0$ name. It must exists in the sym table. Basically, this binds C to asm. + +$GREEN$_import$FG$ binds a new $LK,"HTT_FUN",A="MN:HTT_FUN"$ or $LK,"HTT_GLBL_VAR",A="MN:HTT_GLBL_VAR"$ sym to a sym, of a $BK,1$different$BK,0$ name imported from the task's sym table at $LK,"Load",A="MN:Load"$() time. If no sym exists to bind to at $LK,"Load",A="MN:Load"$() time, the code using this sym will be left incomplete until the sym is defined. Basically, this binds C to asm from elsewhere. + + +$WW,0$$PURPLE$Ahead of Time Compilation$FG$ + $GREEN$G$FG$lobalScope/$GREEN$F$FG$unctionScope + | $GREEN$C$FG$odeHeap/$GREEN$D$FG$ataHeap/$GREEN$S$FG$tack/$GREEN$R$FG$egister + | | TaskHashEntry:Export$GREEN$S$FG$ysSym/$GREEN$D$FG$efine/$GREEN$F$FG$unction/$GREEN$C$FG$lass + | | | UsageScope: $GREEN$M$FG$odule/$GREEN$A$FG$smLocal/Asm$GREEN$B$FG$lk/$GREEN$T$FG$askAndChildren/$GREEN$F$FG$unction + | | | |UsageScope: $GREEN$G$FG$lbl/Asm$GREEN$L$FG$ocal/$GREEN$R$FG$emainder/$GREEN$g$FG$lblThisBlkAndRemainder + | | | || $GREEN$S$FG$taticVarInit/$GREEN$D$FG$ynamicVarInitAllowed/$GREEN$N$FG$oInitAllowed + | | | || | Are dups allowed within the namespace? A dup overshadows the original. + | | | || | $GREEN$D$FG$upsAllowed/$GREEN$N$FG$oDups/NoDupsBut$GREEN$P$FG$ad/$GREEN$W$FG$arningUnlessClosedOut + +asm export $GREEN$label::$FG$ G C S MG N +asm $GREEN$label:$FG$ G C MG N +asm local $GREEN$@@label:$FG$ G C AL N +asm $GREEN$IMPORT label;$FG$ G C MR N +asm export $GREEN$label::$FG$ F C S BG N +asm $GREEN$label:$FG$ F C BG N +asm local $GREEN$@@label:$FG$ F C AL N +asm $GREEN$IMPORT label;$FG$ F C BR N +C goto $GREEN$label:$FG$ F C FG N + + $GREEN$#define$FG$ x MR D + function G C S MR D + var F R FR N + var F S FR N +$GREEN$static$FG$ var F C FR D N + var G C S MR D D + var G D MR N D + $GREEN$class$FG$ G MR D +class member G MR P +$GREEN$extern class$FG$ G MR D +$GREEN$extern$FG$ function G C MR W +$GREEN$import$FG$ function G C MR D +$GREEN$import$FG$ var G C MR D +$GREEN$_extern$FG$ function G C MR D +$GREEN$_extern$FG$ var G C MR D +$GREEN$_import$FG$ function G C MR D +$GREEN$_import$FG$ var G C MR D + + +$PURPLE$Just in Time Compilation$FG$ + $GREEN$G$FG$lobalScope/$GREEN$F$FG$unctionScope + | $GREEN$C$FG$odeHeap/$GREEN$D$FG$ataHeap/$GREEN$S$FG$tack/$GREEN$R$FG$egister + | | TaskHashEntry:Export$GREEN$S$FG$ysSym/$GREEN$D$FG$efine/$GREEN$F$FG$unction/$GREEN$C$FG$lass + | | | UsageScope: $GREEN$M$FG$odule/$GREEN$A$FG$smLocal/Asm$GREEN$B$FG$lk/$GREEN$T$FG$askAndChildren/$GREEN$F$FG$unction + | | | |UsageScope: $GREEN$G$FG$lbl/Asm$GREEN$L$FG$ocal/$GREEN$R$FG$emainder/$GREEN$g$FG$lblThisBlkAndRemainder + | | | || $GREEN$S$FG$taticVarInit/$GREEN$D$FG$ynamicVarInitAllowed/$GREEN$N$FG$oInitAllowed + | | | || | Are dups allowed within the namespace? A dup overshadows the original. + | | | || | $GREEN$D$FG$upsAllowed/$GREEN$N$FG$oDups/NoDupsBut$GREEN$P$FG$ad/$GREEN$W$FG$arningUnlessClosedOut + +asm export $GREEN$label::$FG$ G C S Tg N +asm $GREEN$label:$FG$ G C BG N +asm local $GREEN$@@label:$FG$ G C AL N +asm $GREEN$IMPORT label;$FG$ G C TR N +asm export $GREEN$label::$FG$ F C BG N +asm $GREEN$label:$FG$ F C BG N +asm local $GREEN$@@label:$FG$ F C AL N +asm $GREEN$IMPORT label;$FG$ F C BR N +C goto $GREEN$label:$FG$ F C FG N + + $GREEN$#define$FG$ x D TR D + function G C F TR D + var F R FR N + var F S FR N +$GREEN$static$FG$ var F C FR D N + var G C G TR D D + var G D G TR S D + $GREEN$class$FG$ G C TR D +class member G TR P +$GREEN$extern class$FG$ G C TR D +$GREEN$extern$FG$ function G C F TR W +$GREEN$extern$FG$ var G C G TR D +$GREEN$extern$FG$ var G D G TR D +$GREEN$_extern$FG$ function G C F TR D +$GREEN$_extern$FG$ var G C G TR D + +$WW,1$ +* Goto labels must not have the same name as global scope objects. GoTo's are rare and I don't want to slow the compiler and add code to fix this. You will get errors if a collision happens, so it's not very dangerous, but the error message is baffling. + +* The member names $GREEN$pad$FG$ and $GREEN$reserved$FG$ are special because multiple instances with the same name are allowed in a class. + +* Use $GREEN$reg$FG$ or $GREEN$noreg$FG$ in front of local var names to override automatic reg var allocation. You can, optionally, specify a reg after the $GREEN$reg$FG$ keyword. + +* Local non-reg function vars can be accessed in asm blks with $GREEN$&i[RBP]$FG$ for example. + +* Glbl vars and functions can be accessed in asm with and $GREEN$&$FG$ as in + $GREEN$MOV RAX,I64 [&glbl_var] + CALL I32 &Fun + CALL I32 &SYS_SYM$FG$ + +* In $GREEN$JIT$FG$ asm code, &SYS_SYM and &Fun don't need $GREEN$IMPORT$FG$. + +* All offspring tasks of a task inherit syms. + +* The $GREEN$sizeof()$FG$ and HolyC structure members can be used in asm blks. + +* Using $GREEN$&i$FG$ in $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ or $GREEN$i.u8[2]$FG$ on a local var, $GREEN$i$FG$, will force it to $GREEN$noreg$FG$. + +* Using $GREEN$try$FG$/$GREEN$catch$FG$ in a function will force all local vars to $GREEN$noreg$FG$. + +* An unused gap on the stk is left for $GREEN$reg$FG$ vars. + +* Note: $GREEN$static$FG$ function vars do not go on the data heap, no matter the setting of the $LK,"OPTf_GLBLS_ON_DATA_HEAP",A="MN:OPTf_GLBLS_ON_DATA_HEAP"$$FG$. They may in the future. + +* $LK,"OPTf_EXTERNS_TO_IMPORTS",A="MN:OPTf_EXTERNS_TO_IMPORTS"$ will treat $GREEN$_extern$FG$ as $GREEN$_import$FG$ and $GREEN$extern$FG$ as $GREEN$import$FG$. This allows a header to be used either as a $GREEN$JIT compiled$FG$ or $GREEN$AOT compiled$FG$ header. diff --git a/Doc/ScopingLinkage.TXT b/Doc/ScopingLinkage.TXT deleted file mode 100644 index 46843e5..0000000 --- a/Doc/ScopingLinkage.TXT +++ /dev/null @@ -1,120 +0,0 @@ -$PURPLE$$TX+CX,"Scoping and Linkage"$$FG$ -$WW,1$ -$LK,"JIT Compile Mode",A="FF:::/Doc/Glossary.TXT,JIT Compile Mode"$ makes use of the current task's hash sym table and its parent tasks' tables. It fetches syms from parent tasks' tables if not found locally in the current task's table and it places new syms in the current task's table. Conceptually, syms are at the scope of environment vars in other operating systems. - -When a sym is placed into a table, older syms with ident names will be overshadowed if they exist. Duplicates are not allowed in many cases, especially in asm blks. Dupicates are allowed, by design in other cases, so that you can repeatedly $GREEN$#include$FG$ the same file from the cmd line while developing it. Or, so you can repeatedly declare a function with a standard name, like $GREEN$DrawIt()$FG$. This case might occur when the $GREEN$adam task$FG$ is starting-up loading-in many little utilities. - -$GREEN$extern$FG$ binds a new $LK,"HTT_FUN",A="MN:HTT_FUN"$ or $LK,"HTT_GLBL_VAR",A="MN:HTT_GLBL_VAR"$ sym to an existing sym of the same name if it exists in the sym table (just in just-in-time code). It also can be used to generate a fwd reference. - -$GREEN$import$FG$ binds a new $LK,"HTT_FUN",A="MN:HTT_FUN"$ or $LK,"HTT_GLBL_VAR",A="MN:HTT_GLBL_VAR"$ sym to a sym of the same name imported from the task's sym table at $LK,"Load",A="MN:Load"$() time. If no sym exists to bind to at $LK,"Load",A="MN:Load"$() time, the code using this sym will be left incomplete until the sym is defined. - -$WW,1$ -$GREEN$_extern$FG$ binds a new $LK,"HTT_FUN",A="MN:HTT_FUN"$ or $LK,"HTT_GLBL_VAR",A="MN:HTT_GLBL_VAR"$ sym to an existing sym, of a $BK,1$different$BK,0$ name. It must exists in the sym table. Basically, this binds C to asm. - -$GREEN$_import$FG$ binds a new $LK,"HTT_FUN",A="MN:HTT_FUN"$ or $LK,"HTT_GLBL_VAR",A="MN:HTT_GLBL_VAR"$ sym to a sym, of a $BK,1$different$BK,0$ name imported from the task's sym table at $LK,"Load",A="MN:Load"$() time. If no sym exists to bind to at $LK,"Load",A="MN:Load"$() time, the code using this sym will be left incomplete until the sym is defined. Basically, this binds C to asm from elsewhere. - - -$WW,0$$PURPLE$Ahead of Time Compilation$FG$ - $GREEN$G$FG$lobalScope/$GREEN$F$FG$unctionScope - | $GREEN$C$FG$odeHeap/$GREEN$D$FG$ataHeap/$GREEN$S$FG$tack/$GREEN$R$FG$egister - | | TaskHashEntry:Export$GREEN$S$FG$ysSym/$GREEN$D$FG$efine/$GREEN$F$FG$unction/$GREEN$C$FG$lass - | | | UsageScope: $GREEN$M$FG$odule/$GREEN$A$FG$smLocal/Asm$GREEN$B$FG$lk/$GREEN$T$FG$askAndChildren/$GREEN$F$FG$unction - | | | |UsageScope: $GREEN$G$FG$lbl/Asm$GREEN$L$FG$ocal/$GREEN$R$FG$emainder/$GREEN$g$FG$lblThisBlkAndRemainder - | | | || $GREEN$S$FG$taticVarInit/$GREEN$D$FG$ynamicVarInitAllowed/$GREEN$N$FG$oInitAllowed - | | | || | Are dups allowed within the namespace? A dup overshadows the original. - | | | || | $GREEN$D$FG$upsAllowed/$GREEN$N$FG$oDups/NoDupsBut$GREEN$P$FG$ad/$GREEN$W$FG$arningUnlessClosedOut - -asm export $GREEN$label::$FG$ G C S MG N -asm $GREEN$label:$FG$ G C MG N -asm local $GREEN$@@label:$FG$ G C AL N -asm $GREEN$IMPORT label;$FG$ G C MR N -asm export $GREEN$label::$FG$ F C S BG N -asm $GREEN$label:$FG$ F C BG N -asm local $GREEN$@@label:$FG$ F C AL N -asm $GREEN$IMPORT label;$FG$ F C BR N -C goto $GREEN$label:$FG$ F C FG N - - $GREEN$#define$FG$ x MR D - function G C S MR D - var F R FR N - var F S FR N -$GREEN$static$FG$ var F C FR D N - var G C S MR D D - var G D MR N D - $GREEN$class$FG$ G MR D -class member G MR P -$GREEN$extern class$FG$ G MR D -$GREEN$extern$FG$ function G C MR W -$GREEN$import$FG$ function G C MR D -$GREEN$import$FG$ var G C MR D -$GREEN$_extern$FG$ function G C MR D -$GREEN$_extern$FG$ var G C MR D -$GREEN$_import$FG$ function G C MR D -$GREEN$_import$FG$ var G C MR D - - -$PURPLE$Just in Time Compilation$FG$ - $GREEN$G$FG$lobalScope/$GREEN$F$FG$unctionScope - | $GREEN$C$FG$odeHeap/$GREEN$D$FG$ataHeap/$GREEN$S$FG$tack/$GREEN$R$FG$egister - | | TaskHashEntry:Export$GREEN$S$FG$ysSym/$GREEN$D$FG$efine/$GREEN$F$FG$unction/$GREEN$C$FG$lass - | | | UsageScope: $GREEN$M$FG$odule/$GREEN$A$FG$smLocal/Asm$GREEN$B$FG$lk/$GREEN$T$FG$askAndChildren/$GREEN$F$FG$unction - | | | |UsageScope: $GREEN$G$FG$lbl/Asm$GREEN$L$FG$ocal/$GREEN$R$FG$emainder/$GREEN$g$FG$lblThisBlkAndRemainder - | | | || $GREEN$S$FG$taticVarInit/$GREEN$D$FG$ynamicVarInitAllowed/$GREEN$N$FG$oInitAllowed - | | | || | Are dups allowed within the namespace? A dup overshadows the original. - | | | || | $GREEN$D$FG$upsAllowed/$GREEN$N$FG$oDups/NoDupsBut$GREEN$P$FG$ad/$GREEN$W$FG$arningUnlessClosedOut - -asm export $GREEN$label::$FG$ G C S Tg N -asm $GREEN$label:$FG$ G C BG N -asm local $GREEN$@@label:$FG$ G C AL N -asm $GREEN$IMPORT label;$FG$ G C TR N -asm export $GREEN$label::$FG$ F C BG N -asm $GREEN$label:$FG$ F C BG N -asm local $GREEN$@@label:$FG$ F C AL N -asm $GREEN$IMPORT label;$FG$ F C BR N -C goto $GREEN$label:$FG$ F C FG N - - $GREEN$#define$FG$ x D TR D - function G C F TR D - var F R FR N - var F S FR N -$GREEN$static$FG$ var F C FR D N - var G C G TR D D - var G D G TR S D - $GREEN$class$FG$ G C TR D -class member G TR P -$GREEN$extern class$FG$ G C TR D -$GREEN$extern$FG$ function G C F TR W -$GREEN$extern$FG$ var G C G TR D -$GREEN$extern$FG$ var G D G TR D -$GREEN$_extern$FG$ function G C F TR D -$GREEN$_extern$FG$ var G C G TR D - -$WW,1$ -* Goto labels must not have the same name as global scope objects. GoTo's are rare and I don't want to slow the compiler and add code to fix this. You will get errors if a collision happens, so it's not very dangerous, but the error message is baffling. - -* The member names $GREEN$pad$FG$ and $GREEN$reserved$FG$ are special because multiple instances with the same name are allowed in a class. - -* Use $GREEN$reg$FG$ or $GREEN$noreg$FG$ in front of local var names to override automatic reg var allocation. You can, optionally, specify a reg after the $GREEN$reg$FG$ keyword. - -* Local non-reg function vars can be accessed in asm blks with $GREEN$&i[RBP]$FG$ for example. - -* Glbl vars and functions can be accessed in asm with and $GREEN$&$FG$ as in - $GREEN$MOV RAX,I64 [&glbl_var] - CALL I32 &Fun - CALL I32 &SYS_SYM$FG$ - -* In $GREEN$JIT$FG$ asm code, &SYS_SYM and &Fun don't need $GREEN$IMPORT$FG$. - -* All offspring tasks of a task inherit syms. - -* The $GREEN$sizeof()$FG$ and HolyC structure members can be used in asm blks. - -* Using $GREEN$&i$FG$ in $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ or $GREEN$i.u8[2]$FG$ on a local var, $GREEN$i$FG$, will force it to $GREEN$noreg$FG$. - -* Using $GREEN$try$FG$/$GREEN$catch$FG$ in a function will force all local vars to $GREEN$noreg$FG$. - -* An unused gap on the stk is left for $GREEN$reg$FG$ vars. - -* Note: $GREEN$static$FG$ function vars do not go on the data heap, no matter the setting of the $LK,"OPTf_GLBLS_ON_DATA_HEAP",A="MN:OPTf_GLBLS_ON_DATA_HEAP"$$FG$. They may in the future. - -* $LK,"OPTf_EXTERNS_TO_IMPORTS",A="MN:OPTf_EXTERNS_TO_IMPORTS"$ will treat $GREEN$_extern$FG$ as $GREEN$_import$FG$ and $GREEN$extern$FG$ as $GREEN$import$FG$. This allows a header to be used either as a $GREEN$JIT compiled$FG$ or $GREEN$AOT compiled$FG$ header. diff --git a/Doc/Sprite.DD b/Doc/Sprite.DD new file mode 100644 index 0000000..8ae908f --- /dev/null +++ b/Doc/Sprite.DD @@ -0,0 +1,7 @@ +$WW,1$A $LK,"CSprite",A="MN:CSprite"$ is an ordered list of $LK,"these",A="MN:SPT_END"$ elements, created with $FG,2$$FG$. Normally, they are packed together in a list and the address of the first is passed to routines. + +See $LK,"::/Demo/Graphics/SpritePlot.HC"$, $LK,"::/Demo/Graphics/SpritePlot3D.HC"$, $LK,"::/Demo/Graphics/SpritePut.HC"$, $LK,"::/Demo/Graphics/SpriteRaw.HC"$ and $LK,"SpriteMeshEd",A="MN:SpriteMeshEd"$(). + +Be aware that copying $FG,2$SP$FG$, $FG,2$IB$FG$, or $FG,2$IS$FG$ entries with the clipboard ress in duplicate entries with different nums. You can manually remove dups by editing with $FG,2$$FG$ and setting to the original num. + +See $LK,"::/Adam/Gr/GrSpritePlot.HC",A="FL:::/Adam/Gr/GrSpritePlot.HC,1"$ for how CSprite are stored.$FG$ diff --git a/Doc/Sprite.TXT b/Doc/Sprite.TXT deleted file mode 100644 index 96352d5..0000000 --- a/Doc/Sprite.TXT +++ /dev/null @@ -1,7 +0,0 @@ -$WW,1$A $LK,"CSprite",A="MN:CSprite"$ is an ordered list of $LK,"these",A="MN:SPT_END"$ elements, created with $FG,2$$FG$. Normally, they are packed together in a list and the address of the first is passed to routines. - -See $LK,"::/Demo/Graphics/SpritePlot.CPP"$, $LK,"::/Demo/Graphics/SpritePlot3D.CPP"$, $LK,"::/Demo/Graphics/SpritePut.CPP"$, $LK,"::/Demo/Graphics/SpriteRaw.CPP"$ and $LK,"SpriteMeshEd",A="MN:SpriteMeshEd"$(). - -Be aware that copying $FG,2$SP$FG$, $FG,2$IB$FG$, or $FG,2$IS$FG$ entries with the clipboard ress in duplicate entries with different nums. You can manually remove dups by editing with $FG,2$$FG$ and setting to the original num. - -See $LK,"::/Adam/Gr/GrSpritePlot.CPP",A="FL:::/Adam/Gr/GrSpritePlot.CPP,1"$ for how CSprite are stored.$FG$ diff --git a/Doc/SpriteBitMap.TXT b/Doc/SpriteBitMap.DD similarity index 100% rename from Doc/SpriteBitMap.TXT rename to Doc/SpriteBitMap.DD diff --git a/Doc/SpriteEd.TXT b/Doc/SpriteEd.DD similarity index 100% rename from Doc/SpriteEd.TXT rename to Doc/SpriteEd.DD diff --git a/Doc/SpriteEdText.TXT b/Doc/SpriteEdText.DD similarity index 100% rename from Doc/SpriteEdText.TXT rename to Doc/SpriteEdText.DD diff --git a/Doc/SpriteMain.TXT b/Doc/SpriteMain.DD similarity index 100% rename from Doc/SpriteMain.TXT rename to Doc/SpriteMain.DD diff --git a/Doc/SpriteSideBar.TXT b/Doc/SpriteSideBar.DD similarity index 100% rename from Doc/SpriteSideBar.TXT rename to Doc/SpriteSideBar.DD diff --git a/Doc/StandBy.DD b/Doc/StandBy.DD new file mode 100644 index 0000000..85e8aaa --- /dev/null +++ b/Doc/StandBy.DD @@ -0,0 +1,18 @@ +$FG,5$$TX+CX,"AutoComplete is in StandBy"$$FG$ + +$FG,4$$TX+CX+L+PU+UL,"System Keys Quick Guide",A="::/Doc/HelpIndex.DD"$$FG$ +$FG,4$$TX+CX,"(Works Everywhere)"$$FG$ +$FG,2$ $FG$Left-Click +$FG,2$ $FG$Right-Click +$FG,2$ $FG$Help +$FG,2$ $FG$Personal Menu +$FG,2$ $FG$Save & Exit +$FG,2$ $FG$Abort & Exit +$FG,2$ $FG$Pull-Down Menu + +$FG,4$$TX+CX+L+PU+UL,"Tongues",A="::/Adam/God/HSNotes.DD"$$FG$ +$FG,4$$TX+CX,"(Works Everywhere)"$$FG$ +$FG,2$ $FG$God Word +$FG,2$ $FG$God Passage +$FG,2$ $FG$God Song +$FG,2$ $FG$God Doodle \ No newline at end of file diff --git a/Doc/StandBy.TXT b/Doc/StandBy.TXT deleted file mode 100644 index dcbf958..0000000 --- a/Doc/StandBy.TXT +++ /dev/null @@ -1,18 +0,0 @@ -$FG,5$$TX+CX,"AutoComplete is in StandBy"$$FG$ - -$FG,4$$TX+CX+L+PU+UL,"System Keys Quick Guide",A="::/Doc/HelpIndex.TXT"$$FG$ -$FG,4$$TX+CX,"(Works Everywhere)"$$FG$ -$FG,2$ $FG$Left-Click -$FG,2$ $FG$Right-Click -$FG,2$ $FG$Help -$FG,2$ $FG$Personal Menu -$FG,2$ $FG$Save & Exit -$FG,2$ $FG$Abort & Exit -$FG,2$ $FG$Pull-Down Menu - -$FG,4$$TX+CX+L+PU+UL,"Tongues",A="::/Adam/God/HSNotes.TXT"$$FG$ -$FG,4$$TX+CX,"(Works Everywhere)"$$FG$ -$FG,2$ $FG$God Word -$FG,2$ $FG$God Passage -$FG,2$ $FG$God Song -$FG,2$ $FG$God Doodle \ No newline at end of file diff --git a/Doc/Start.DD b/Doc/Start.DD new file mode 100644 index 0000000..58809b9 --- /dev/null +++ b/Doc/Start.DD @@ -0,0 +1,5 @@ +$WW+H,1$$PURPLE$$TX+CX,"TempleOS V2.18",D="DD_OS_NAME_VERSION"$$FG$ + +$TX+CX,"Public Domain Operating System"$ + +$LK,"Help & Index",A="FI:::/Doc/HelpIndex.DD"$, $LK,"Quick Start: Cmd line",A="FI:::/Doc/CmdLineOverview.DD"$ diff --git a/Doc/Start.TXT b/Doc/Start.TXT deleted file mode 100644 index 0757892..0000000 --- a/Doc/Start.TXT +++ /dev/null @@ -1,5 +0,0 @@ -$WW+H,1$$PURPLE$$TX+CX,"TempleOS V2.18",D="DD_OS_NAME_VERSION"$$FG$ - -$TX+CX,"Public Domain Operating System"$ - -$LK,"Help & Index",A="FI:::/Doc/HelpIndex.TXT"$, $LK,"Quick Start: Cmd line",A="FI:::/Doc/CmdLineOverview.TXT"$ diff --git a/Doc/StdOutTask.DD b/Doc/StdOutTask.DD new file mode 100644 index 0000000..ff3f396 --- /dev/null +++ b/Doc/StdOutTask.DD @@ -0,0 +1 @@ +$WW,1$There is one $LK,"CDoc",A="MN:CDoc"$ for the task's border: $GREEN$Fs->border_doc$FG$. There is a pair for the task's client area: $GREEN$Fs->put_doc$FG$ and $GREEN$Fs->display_doc$FG$. You can, optionally, do double buffering, otherwise $GREEN$Fs->put_doc$FG$ is the same as $GREEN$Fs->display_doc$FG$. See $LK,"::/Demo/Spy.HC"$. diff --git a/Doc/StdOutTask.TXT b/Doc/StdOutTask.TXT deleted file mode 100644 index 872897a..0000000 --- a/Doc/StdOutTask.TXT +++ /dev/null @@ -1 +0,0 @@ -$WW,1$There is one $LK,"CDoc",A="MN:CDoc"$ for the task's border: $GREEN$Fs->border_doc$FG$. There is a pair for the task's client area: $GREEN$Fs->put_doc$FG$ and $GREEN$Fs->display_doc$FG$. You can, optionally, do double buffering, otherwise $GREEN$Fs->put_doc$FG$ is the same as $GREEN$Fs->display_doc$FG$. See $LK,"::/Demo/Spy.CPP"$. diff --git a/Doc/StdTempleOSPC.DD b/Doc/StdTempleOSPC.DD new file mode 100644 index 0000000..02873e7 --- /dev/null +++ b/Doc/StdTempleOSPC.DD @@ -0,0 +1,86 @@ +$WW,1$$FG,5$$TX+CX,"The Standard TempleOS PC",HTML="http://www.templeos.org/Wb/Home/Web/TAD/TAD.html"$$FG$ + +All desktop PCs will have 8-channel OCTART super-simple high speed serial ports to replace USB. They are simpler because the driver is as simple as old school $LK,"RS232 Serial",A="FI:::/Doc/Comm.HC"$, they have no USB end-points and they have no USB human interface device reports. Computer mice will all have exactly two buttons and one wheel. Game controllers will all be the standard deluxe $TX,"game console controllers",HTML="http://www.gamestop.com/pc/accessories/steam-controller/121865"$ that are popular today. It will have 8 big TX and 8 big RX fifos that allow flow control characters to jump the queue. It should be locked-down to as few options as possible, like 8-1-N only, although hardware may use a USB frame, not an RS232, so stop bits might not be relevant. Perhaps, just two baud rates -- high and low speed are needed. Low speed is good for slow microcontrollers and allows longer cable length. Keyboard, mouse and game controller can be low speed. + +The USB creators banned generic devices, requiring a signed, certified driver for everything! That's no good. We allow any device and will communicate, generically, using a serial terminal program like the old school HyperTerminal, XTalk or Telnet. + +A mouse packet interface should be similar to this: + +$ID,5$TX: +RX: X:+3 Y:+0 Wheel:+0 LB:OFF RB:OFF +TX: +RX: X:+0 Y:-1 Wheel:+0 LB:ON RB:OFF +$ID,-5$ +We aspire to be as simple as a Commodore 64 joystick driver: + +$ID,5$VAL=PEEK(56321) +if VAL AND 1 THEN y=y-1 +if VAL AND 2 THEN y=y+1 +if VAL AND 4 THEN x=x-1 +if VAL AND 8 THEN x=x+1 +$ID,-5$ +The game controller will be more complicated, but much simpler than USB. It will use a standard text packet of some kind. + +On the other end, you might hook-up a thermostat microcontroller and interface as a generic serial device. The microcontroller in the thermostat would have something simple, not a crazy overkill ethernet connection. + +$ID,5$$HL,1$U8 b; +while (TRUE) { + b=ReadU8(2); //Read byte from high speed serial channel 2. +//(Has been configured for low baud because thermostat should be slow.) + if (b==CMD_UP) + temperature++; + else if (b==CMD_DOWN) + temperature--; +}$HL,0$ +$ID,-5$ +Super-simple block devices will replace ATA/ATAPI hard drives and CD/DVD/BlueRays. Today, the industry is in flux with nonvolitile memory just invented. We want a super-simple block device interface for non-volitile memory and for what is currently USB memory sticks, but only if they can be made without bad blocks. I don't think we want to deal with bad block memory, so maybe we will not do NV-memory. The standard TempleOS desktop will require a hard disk. + +There will be minimal commands: READ_BLOCK, WRITE_BLOCK, GET_CAPACITY, GET_MODEL, GET_SERIAL_NUM, and EJECT. + +We want a CPU mode with virtual IO port addresses similar to how paging creates virtual memory addresses. We want a 65536 word look-up table that converts virtual IO port numbers to physical IO port numbers. There will be a standard IO port configuration, so port numbers can be fixed in the code. We want the primary hard drive on one set of ports and the primary CD/DVD/Blu-ray on another set of ports. Choose a contiguous set of IO ports. + +Meanwhile, a complicated PCI interface can be designed along-side the TempleOS interface for Windows and Linux. It would almost be possible to carry-on separate lives, however, the super-simple serial requires getting rid of USB since super-simple serial is a new hardware standard. People can add USB ports with a PCI device card. + +God said He wants single audio voice for the sound. I think we want a word-sized IO port for period with zero causing it to be off. The period should allow for 20Hz to 20,000 Hz. The PIT period register for PC speaker seems okay, whatever it is. + +The video will be a linear frame buffer 640x480 16 color with one-byte-per-pixel even though it is only 16 color with is 4-bit. Perhaps, we have a interrupt to sync with the refresh. + +I am tempted to help amateur hardware device designers by making the hardware interface for the PC simple. I have fond memories of 1993, when I made a wire-wrapped ISA data acquisition card which plugged into my 486 and had some analog-to-digital and digital-to-analog convertors. I am not designing a bus. Earlier, I said the super-simple high speed serial port replacement could be USB-like in hardware as long as the software driver interface was simple like old school RS232 serial ports. Requiring a complicated hardware handshake raises the bar, slightly, for the lowest level hardware designers. Most people will be connecting a microcontroller or something that already has a serial communication design, but if it's not a problem, maybe we should keep it simple at all stages. It was nice putting an oscilloscope on my serial port wires. + +The original PC had general purpose digital IO through the parallel port. That was fun. I have enough battles to fight, so I'll leave being a savior to hobbiest hardware engineers to somebody else. + +Digital cameras will be super-simple high speed serial, but TempleOS is forever limited to 16 colors and multimedia is banned because large files being loaded into memory fragments memory, so cameras are somewhat unwelcome. I have enough problems without making the Brits anxious about autonomous gun turrets and killer robots. The reason I say cameras will be super-simple serial is because we are replacing USB ports with super-simple serial. Windows/Linux will have only super-simple serial ports unless people buy a USB PCI expansion card. So, the digital cameras will be super-simple serial. + + +$FG,5$$TX+CX,"Version One"$$FG$ + +We will make a spec for a $$4,000, perfectly standardized, cryogenically-cooled, monster desktop PC. It will have 16 cores, integrated 4K graphics, and, hopefully, 6 Ghz continuous operation. Perhaps, 64 Gig of RAM will be standard? God said to help to poor buy them. It is pointless to have a high powered machine if other people have wimpy machines and cannot run programs you write. Therefore, everybody in the developed world will buy a Standard TempleOS IBM PC over the next ten years, so that will be a quantity of 400 million, perhaps. God said to pay the US national debt with the revenue. We will standardize everything, not just the TempleOS related items. The display will be 4K (and of course 640x480 16 color) and no others. Everybody gets just one monitor, unless you buy special PCI cards. Everybody gets two speakers, a headphone, a mic, a webcam and touch screen. We make the audio one sample rate and one sample size, but TempleOS still gets just a square wave. (HD Audio is really screwed-up and requires complicated artificial intelligence, just to route output to speakers.) + +The Standard Temple IBM PC will be a full-sized tower. Perhaps, stain-glass will decorate the case because God is sentimentally attached to stained-glass. We should set the size at exactly 2.5 feet by 1.5 feet by 1.5 feet as in the $LK,"Exodus,25:10-10",A="BF:Exodus,25:10-10"$ for all time. If there is extra room, make a storage shelf for DVDs. We do not want a race-to-the-bottom, shrinking the size. Instead of making it smaller, make it more powerful. We want to remove all cost pressure from making things small. It must have a CD/DVD/Blu-ray drive. The vision is CD/DVDs used for a library of games, not installed on the hard-drive. We need a network connection, possibly implemented as a super-simple high speed serial device. What about standard monitor and speakers? The C64's success was partially due to wide spread, completely standard, hardware. I think TempleOS will not do bad block devices, so we need a hard drive, not just NV-memory or SSD. + +TempleOS will have the priority over Windows or Linux on hardware decisions. We could make it heterogenious multicore. I think we want 16 non-hyperthreaded cores. Core#0 is the only full-featured core needed. The other cores will have long mode, but not some of these: real mode, protected mode, ring-3, paging, interrupts, in/out port instructions, SSE instructions, MMX instructions. This $LK,"Graphics Job",A="FI:~/Web/TAD/GraphicsPerformance.DD"$ is what to optimize for. + +God said Intel should do a simulation of heat produced by gates and try spreading-out the heat producing gate circuits on the chip. + +God said Linux's Wine should replace Windows. We will install a standard software set-up on all Standard Temple IBM PC's. + + +$FG,5$$TX+CX,"Usage"$$FG$ + +TempleOS is primarily for user developers, like the Commodore 64 was. I created a total of 50 Meg of content over ten years, so you shouldn't need much room, either. The installed hard drive space should stay small because the resolution is low, multimedia is banned, 3rd party libraries are banned, and applications can be distributed with ISO files or DVDs. + +The ROM will have a command that copies the ROM onto the hard drive, creating identical C and D partitions, so you can have fun modifying TempleOS. You will have confidence you can fix it easily if you break it. It should be able to run everything from just the ROM, too. You will need to specify a /Home directory that is not in the ROM, but on the hard drive. + +The standard set-up will be a C primary drive and a D back-up drive. Keep the size on each hard drive under 512 Meg and periodically copy all of C to D, so they stay mirrored. The file manager and other programs read the entire directory structures, so too many files causes problems (unbearably slow). Third party software should be distributed as ISO files or DVDs, like $FG,4$$TX,"TextAdventure.ISO",HTML="https://github.com/jwhitham/frotz"$$FG$. No 3rd party libraries are permitted because they circumvent the intent of the 100,000 line of code limit which is keeping it cognatively small enough to see the light at the end of the tunnel and easily master everything. Therefore, 3rd party ISO files must bring all required software components with them, except what is found in the TempleOS ROM. + +Having all your 3rd party software on separate DVDs or ISO files and TempleOS running from a ROM, keeps it delightfully simple so you have complete understanding of what is going on. You will have complete confidence and it will be a joy to use. 3rd party applications can store saved data files into your /Home hard drive directory. + +The Temple PC will stay unchanged for seven years at a time. The Bible speaks of a seven year release in $LK,"Deuteronomy,15:1",A="BF:Deuteronomy,15:1",HTML="http://www.biblegateway.com/verse/en/Deutoronomy%2015:1"$. The Commodore stayed unchanged for many years and people became intimately familiar with every aspect. + +$HC,""$ + +I thought 2.5' x 1.5' x 1.5' was ridiculously big, but it looks like it is reasonable for super-cooled refrigeration systems! +$FG,8$ +* "Commodore 64" was a trademark owned by Commodore Business Machines. +* "Linux" is a trademark owned by Linus Torvalds. +* "Windows" is a trademark owned by MicroSoft Corp.$FG$ diff --git a/Doc/StdTempleOSPC.TXT b/Doc/StdTempleOSPC.TXT deleted file mode 100644 index e0b17d6..0000000 --- a/Doc/StdTempleOSPC.TXT +++ /dev/null @@ -1,86 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"The Standard TempleOS PC",HTML="http://www.templeos.org/Wb/Home/Web/TAD/TAD.html"$$FG$ - -All desktop PCs will have 8-channel OCTART super-simple high speed serial ports to replace USB. They are simpler because the driver is as simple as old school $LK,"RS232 Serial",A="FI:::/Doc/Comm.CPP"$, they have no USB end-points and they have no USB human interface device reports. Computer mice will all have exactly two buttons and one wheel. Game controllers will all be the standard deluxe $TX,"game console controllers",HTML="http://www.gamestop.com/pc/accessories/steam-controller/121865"$ that are popular today. It will have 8 big TX and 8 big RX fifos that allow flow control characters to jump the queue. It should be locked-down to as few options as possible, like 8-1-N only, although hardware may use a USB frame, not an RS232, so stop bits might not be relevant. Perhaps, just two baud rates -- high and low speed are needed. Low speed is good for slow microcontrollers and allows longer cable length. Keyboard, mouse and game controller can be low speed. - -The USB creators banned generic devices, requiring a signed, certified driver for everything! That's no good. We allow any device and will communicate, generically, using a serial terminal program like the old school HyperTerminal, XTalk or Telnet. - -A mouse packet interface should be similar to this: - -$ID,5$TX: -RX: X:+3 Y:+0 Wheel:+0 LB:OFF RB:OFF -TX: -RX: X:+0 Y:-1 Wheel:+0 LB:ON RB:OFF -$ID,-5$ -We aspire to be as simple as a Commodore 64 joystick driver: - -$ID,5$VAL=PEEK(56321) -if VAL AND 1 THEN y=y-1 -if VAL AND 2 THEN y=y+1 -if VAL AND 4 THEN x=x-1 -if VAL AND 8 THEN x=x+1 -$ID,-5$ -The game controller will be more complicated, but much simpler than USB. It will use a standard text packet of some kind. - -On the other end, you might hook-up a thermostat microcontroller and interface as a generic serial device. The microcontroller in the thermostat would have something simple, not a crazy overkill ethernet connection. - -$ID,5$$HL,1$U8 b; -while (TRUE) { - b=ReadU8(2); //Read byte from high speed serial channel 2. -//(Has been configured for low baud because thermostat should be slow.) - if (b==CMD_UP) - temperature++; - else if (b==CMD_DOWN) - temperature--; -}$HL,0$ -$ID,-5$ -Super-simple block devices will replace ATA/ATAPI hard drives and CD/DVD/BlueRays. Today, the industry is in flux with nonvolitile memory just invented. We want a super-simple block device interface for non-volitile memory and for what is currently USB memory sticks, but only if they can be made without bad blocks. I don't think we want to deal with bad block memory, so maybe we will not do NV-memory. The standard TempleOS desktop will require a hard disk. - -There will be minimal commands: READ_BLOCK, WRITE_BLOCK, GET_CAPACITY, GET_MODEL, GET_SERIAL_NUM, and EJECT. - -We want a CPU mode with virtual IO port addresses similar to how paging creates virtual memory addresses. We want a 65536 word look-up table that converts virtual IO port numbers to physical IO port numbers. There will be a standard IO port configuration, so port numbers can be fixed in the code. We want the primary hard drive on one set of ports and the primary CD/DVD/Blu-ray on another set of ports. Choose a contiguous set of IO ports. - -Meanwhile, a complicated PCI interface can be designed along-side the TempleOS interface for Windows and Linux. It would almost be possible to carry-on separate lives, however, the super-simple serial requires getting rid of USB since super-simple serial is a new hardware standard. People can add USB ports with a PCI device card. - -God said He wants single audio voice for the sound. I think we want a word-sized IO port for period with zero causing it to be off. The period should allow for 20Hz to 20,000 Hz. The PIT period register for PC speaker seems okay, whatever it is. - -The video will be a linear frame buffer 640x480 16 color with one-byte-per-pixel even though it is only 16 color with is 4-bit. Perhaps, we have a interrupt to sync with the refresh. - -I am tempted to help amateur hardware device designers by making the hardware interface for the PC simple. I have fond memories of 1993, when I made a wire-wrapped ISA data acquisition card which plugged into my 486 and had some analog-to-digital and digital-to-analog convertors. I am not designing a bus. Earlier, I said the super-simple high speed serial port replacement could be USB-like in hardware as long as the software driver interface was simple like old school RS232 serial ports. Requiring a complicated hardware handshake raises the bar, slightly, for the lowest level hardware designers. Most people will be connecting a microcontroller or something that already has a serial communication design, but if it's not a problem, maybe we should keep it simple at all stages. It was nice putting an oscilloscope on my serial port wires. - -The original PC had general purpose digital IO through the parallel port. That was fun. I have enough battles to fight, so I'll leave being a savior to hobbiest hardware engineers to somebody else. - -Digital cameras will be super-simple high speed serial, but TempleOS is forever limited to 16 colors and multimedia is banned because large files being loaded into memory fragments memory, so cameras are somewhat unwelcome. I have enough problems without making the Brits anxious about autonomous gun turrets and killer robots. The reason I say cameras will be super-simple serial is because we are replacing USB ports with super-simple serial. Windows/Linux will have only super-simple serial ports unless people buy a USB PCI expansion card. So, the digital cameras will be super-simple serial. - - -$FG,5$$TX+CX,"Version One"$$FG$ - -We will make a spec for a $$4,000, perfectly standardized, cryogenically-cooled, monster desktop PC. It will have 16 cores, integrated 4K graphics, and, hopefully, 6 Ghz continuous operation. Perhaps, 64 Gig of RAM will be standard? God said to help to poor buy them. It is pointless to have a high powered machine if other people have wimpy machines and cannot run programs you write. Therefore, everybody in the developed world will buy a Standard TempleOS IBM PC over the next ten years, so that will be a quantity of 400 million, perhaps. God said to pay the US national debt with the revenue. We will standardize everything, not just the TempleOS related items. The display will be 4K (and of course 640x480 16 color) and no others. Everybody gets just one monitor, unless you buy special PCI cards. Everybody gets two speakers, a headphone, a mic and a webcam. We make the audio one sample rate and one sample size, but TempleOS still gets just a square wave. (HD Audio is really screwed-up and requires complicated artificial intelligence, just to route output to speakers.) - -The Standard Temple IBM PC will be a full-sized tower. Perhaps, stain-glass will decorate the case because God is sentimentally attached to stained-glass. We should set the size at exactly 2.5 feet by 1.5 feet by 1.5 feet as in the $LK,"Exodus,25:10-10",A="BF:Exodus,25:10-10"$ for all time. If there is extra room, make a storage shelf for DVDs. We do not want a race-to-the-bottom, shrinking the size. Instead of making it smaller, make it more powerful. We want to remove all cost pressure from making things small. It must have a CD/DVD/Blu-ray drive. The vision is CD/DVDs used for a library of games, not installed on the hard-drive. We need a network connection, possibly implemented as a super-simple high speed serial device. What about standard monitor and speakers? The C64's success was partially due to wide spread, completely standard, hardware. I think TempleOS will not do bad block devices, so we need a hard drive, not just NV-memory or SSD. - -TempleOS will have the priority over Windows or Linux on hardware decisions. We could make it heterogenious multicore. I think we want 16 non-hyperthreaded cores. Core#0 is the only full-featured core needed. The other cores will have long mode, but not some of these: real mode, protected mode, ring-3, paging, interrupts, in/out port instructions, SSE instructions, MMX instructions. This $LK,"Graphics Job",A="FI:~/Web/TAD/GraphicsPerformance.TXT"$ is what to optimize for. - -God said Intel should do a simulation of heat produced by gates and try spreading-out the heat producing gate circuits on the chip. - -God said Linux's Wine should replace Windows. We will install a standard software set-up on all Standard Temple IBM PC's. - - -$FG,5$$TX+CX,"Usage"$$FG$ - -TempleOS is primarily for user developers, like the Commodore 64 was. I created a total of 50 Meg of content over ten years, so you shouldn't need much room, either. The installed hard drive space should stay small because the resolution is low, multimedia is banned, 3rd party libraries are banned, and applications can be distributed with ISO files or DVDs. - -The ROM will have a command that copies the ROM onto the hard drive, creating identical C and D partitions, so you can have fun modifying TempleOS. You will have confidence you can fix it easily if you break it. It should be able to run everything from just the ROM, too. You will need to specify a /Home directory that is not in the ROM, but on the hard drive. - -The standard set-up will be a C primary drive and a D back-up drive. Keep the size on each hard drive under 512 Meg and periodically copy all of C to D, so they stay mirrored. The file manager and other programs read the entire directory structures, so too many files causes problems (unbearably slow). Third party software should be distributed as ISO files or DVDs, like $FG,4$$TX,"TextAdventure.ISO",HTML="https://github.com/jwhitham/frotz"$$FG$. No 3rd party libraries are permitted because they circumvent the intent of the 100,000 line of code limit which is keeping it cognatively small enough to see the light at the end of the tunnel and easily master everything. Therefore, 3rd party ISO files must bring all required software components with them, except what is found in the TempleOS ROM. - -The Temple PC will stay unchanged for seven years at a time. The Bible speaks of a seven year release in $LK,"Deuteronomy,15:1",A="BF:Deuteronomy,15:1",HTML="http://www.biblegateway.com/verse/en/Deutoronomy%2015:1"$. The Commodore stayed unchanged for many years and people became intimately familiar with every aspect. - -Having all your 3rd party software on separate DVDs or ISO files and TempleOS running from a ROM, keeps it delightfully simple so you have complete understanding of what is going on. You will have complete confidence and it will be a joy to use. 3rd party applications can store saved data files into your /Home hard drive directory. - -$HC,""$ - -I thought 2.5' x 1.5' x 1.5' was ridiculously big, but it looks like it is reasonable for super-cooled refrigeration systems! -$FG,8$ -* "Commodore 64" was a trademark owned by Commodore Business Machines. -* "Linux" is a trademark owned by Linus Torvalds. -* "Windows" is a trademark owned by MicroSoft Corp.$FG$ diff --git a/Doc/Strategy.DD b/Doc/Strategy.DD new file mode 100644 index 0000000..5c3dd4f --- /dev/null +++ b/Doc/Strategy.DD @@ -0,0 +1,63 @@ +$WW,1$$FG,5$$TX+CX,"Decisions Making TempleOS Simple"$ +$FG$ +Everybody is obsessed, Jedi mind-tricked, by the notion that when you scale-up, it doesn't get bad, it gets worse. They automatically think things are going to get bigger. Guess what happens when you scale down? It doesn't get good, it gets better! + +I limited it to 100,000 lines of code, forever! I never need a linker or make utility and I can use small labels. + +People mock Bill Gates for, "640K should be enough." I say, "2 Gig for code should be enough." The same people who mock Bill Gates are probably just like the black woman who sued for a trillion dollars. + +My Dad worked on converting the Titan missile to the Gemini Mission rocket. It had to be "man-rated". You can bet that everything got an order of magnitude more complexity and documentation. My vision is a souped-up C64, not a 1970's mainframe; a kayak, not a Titanic. + +Linux is a semi-tractor -- you need professional drivers for 20 gears. Linux has file permissions. Common people are hurt by file permissions. + +Windows is a car. + +TempleOS is a motorcycle -- if you lean-over too far, a motorcycle will crash. Don't do that! There are no side air bags on a motorcycle. DOS and C64 had no memory protections and ran in ring-0, with no security. This saves an order of magnitude complexity. + +Linux and Windows are general purpose operating systems. They attempt to do any task you want. TempleOS cherry-picks tasks and is designed to do the same things a C64 did. This saves and order of magnitude complexity. For example, the $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ file system allocates just contiguous files -- you load and save whole files at once. A benefit is this allows compression. Also, TempleOS does not do networking or multimedia. In theory, memory will fragment with lots of big files. The system would fall to pieces with multimedia, but God said 640x480 16 color is a permanent covenant like circumcision. + +A three button mouse is like a leg you cannot put weight on. TempleOS just does hardware everybody has, with no divergent code bases for each machine's custom hardware. There is one graphics driver instead of 50 for different GPUs. This saves an order of magnitude complexity and makes for a delightful API, so developer's code is not like a frayed rope end. + + + +* Everything runs in kernel, $FG,2$ring 0$FG$, mode. + +* $FG,2$One memory map$FG$ for all tasks on all cores with virtual addresses set equ to physical, just as though paging is not used. + +* One platform -- $FG,4$$TX,"x86_64",HTML="http://en.wikipedia.org/wiki/Amd64#AMD64"$$FG$ PC's, no 32-bit support. + +* No security or cryptography. + +* No networking. + +* Least (greatest) common denominator hardware support. Mostly, one driver for each device class. I can't be in the business of different drivers. Compatibility is the greatest challenge for PC operating systems. Disk code does not use interrupts, avoiding compatibility risks. $FG,2$PS/2$FG$ keyboard/mouse is used instead of $FG,2$USB$FG$, also more compatible. + +* $FG,2$640x480$FG$ 16 colors. Updates whole screen at $FG,2$30 fps$FG$, optimized for full screen games where $FG,2$InvalidRectangle$FG$s are counter-productive. + +* One font, 8x8. Text and graphic layers done in software with text normally on an 8x8 grid. It can run in Text mode if graphic initialization fails. + +* Compiler extends all values to 64-bit when fetched and does only 64-bit computations intermediately. Assembler has minimal 16-bit support, good enough for compiling boot loaders. + +* No object files. Use $FG,2$JIT$FG$. + +* Whole files are processed almost exclusively, allowing compression. + +* $LK,"One language",A="FI:::/Doc/HolyC.DD"$ and compiler for command-line, scripts, songs, automations and code. + +* One editor/word processor/browser for the command-line window, source code, documentation browser, dialog forms. + +* No child windows. One window per task. Buttons are widgets, not child windows. There are child tasks, however. + +* No distinction between $FG,2$thread$FG$, $FG,2$process$FG$ or $FG,2$task$FG$. + +* The $LK,"Scheduler",A="FI:::/Kernel/Sched.HC"$ is for home systems. It is not preemptiove. Disk requests are not broken-up, so sharing is bad. It's wonderfully simple. + +* $LK,"MultiCore",A="FI:::/Doc/MultiCore.DD"$ is done $FG,2$master/slave$FG$, instead of $FG,2$SMP$FG$. $FG,2$Core0$FG$ applications explicitly assigns jobs. Locks are present allowing multicore file, heap, and hardware access, though. + +* $LK,"Music",A="MN:Play"$ is done with an elegant one-voice notation. + +* All tasks have a heap and a sym table. Scope is that of environment vars in other operating systems. As text is typed at the command line or you run programs by $FG,2$#include$FG$ing them, the syms go in the table. If a sym is not found, the parent task's table is checked. The father of all tasks has the API syms you'll need waiting in it's table. No need to $FG,2$#include$FG$ headers. + +* No need for namespaces -- scoping occurs automatically based on task symbol table hierarchy with the $FG,2$Adam task$FG$'s symbol system-wide global. + +* Sometimes, I $LK,"cut corners",A="FI:::/Doc/CutCorners.DD"$ in the interest of keeping the code beautiful. diff --git a/Doc/Strategy.TXT b/Doc/Strategy.TXT deleted file mode 100644 index 6498a1a..0000000 --- a/Doc/Strategy.TXT +++ /dev/null @@ -1,63 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"Decisions Making TempleOS Simple"$ -$FG$ -Everybody is obsessed, Jedi mind-tricked, by the notion that when you scale-up, it doesn't get bad, it gets worse. They automatically think things are going to get bigger. Guess what happens when you scale down? It doesn't get good, it gets better! - -I limited it to 100,000 lines of code, forever! I never need a linker or make utility and I can use small labels. - -People mock Bill Gates for, "640K should be enough." I say, "2 Gig for code should be enough." The same people who mock Bill Gates are probably just like the black woman who sued for a trillion dollars. - -My Dad worked on converting the Titan missile to the Gemini Mission rocket. It had to be "man-rated". You can bet that everything got an order of magnitude more complexity and documentation. My vision is a souped-up C64, not a 1970's mainframe; a kayak, not a Titanic. - -Linux is a semi-tractor -- you need professional drivers for 20 gears. Linux has file permissions. Common people are hurt by file permissions. - -Windows is a car. - -TempleOS is a motorcycle -- if you lean-over too far, a motorcycle will crash. Don't do that! There are no side air bags on a motorcycle. DOS and C64 had no memory protections and ran in ring-0, with no security. This saves an order of magnitude complexity. - -Linux and Windows are general purpose operating systems. They attempt to do any task you want. TempleOS cherry-picks tasks and is designed to do the same things a C64 did. This saves and order of magnitude complexity. For example, the $LK,"RedSea",A="FI:::/Doc/RedSea.TXT"$ file system allocates just contiguous files -- you load and save whole files at once. A benefit is this allows compression. Also, TempleOS does not do networking or multimedia. In theory, memory will fragment with lots of big files. The system would fall to pieces with multimedia, but God said 640x480 16 color is a permanent covenant like circumcision. - -A three button mouse is like a leg you cannot put weight on. TempleOS just does hardware everybody has, with no divergent code bases for each machine's custom hardware. There is one graphics driver instead of 50 for different GPUs. This saves an order of magnitude complexity and makes for a delightful API, so developer's code is not like a frayed rope end. - - - -* Everything runs in kernel, $FG,2$ring 0$FG$, mode. - -* $FG,2$One memory map$FG$ for all tasks on all cores with virtual addresses set equ to physical, just as though paging is not used. - -* One platform -- $FG,4$$TX,"x86_64",HTML="http://en.wikipedia.org/wiki/Amd64#AMD64"$$FG$ PC's, no 32-bit support. - -* No security or cryptography. - -* No networking. - -* Least (greatest) common denominator hardware support. Mostly, one driver for each device class. I can't be in the business of different drivers. Compatibility is the greatest challenge for PC operating systems. Disk code does not use interrupts, avoiding compatibility risks. $FG,2$PS/2$FG$ keyboard/mouse is used instead of $FG,2$USB$FG$, also more compatible. - -* $FG,2$640x480$FG$ 16 colors. Updates whole screen at $FG,2$30 fps$FG$, optimized for full screen games where $FG,2$InvalidRectangle$FG$s are counter-productive. - -* One font, 8x8. Text and graphic layers done in software with text normally on an 8x8 grid. It can run in Text mode if graphic initialization fails. - -* Compiler extends all values to 64-bit when fetched and does only 64-bit computations intermediately. Assembler has minimal 16-bit support, good enough for compiling boot loaders. - -* No object files. Use $FG,2$JIT$FG$. - -* Whole files are processed almost exclusively, allowing compression. - -* $LK,"One language",A="FI:::/Doc/HolyC.TXT"$ and compiler for command-line, scripts, songs, automations and code. - -* One editor/word processor/browser for the command-line window, source code, documentation browser, dialog forms. - -* No child windows. One window per task. Buttons are widgets, not child windows. There are child tasks, however. - -* No distinction between $FG,2$thread$FG$, $FG,2$process$FG$ or $FG,2$task$FG$. - -* The $LK,"Scheduler",A="FI:::/Kernel/Sched.CPP"$ is for home systems. It is not preemptiove. Disk requests are not broken-up, so sharing is bad. It's wonderfully simple. - -* $LK,"MultiCore",A="FI:::/Doc/MultiCore.TXT"$ is done $FG,2$master/slave$FG$, instead of $FG,2$SMP$FG$. $FG,2$Core0$FG$ applications explicitly assigns jobs. Locks are present allowing multicore file, heap, and hardware access, though. - -* $LK,"Music",A="MN:Play"$ is done with an elegant one-voice notation. - -* All tasks have a heap and a sym table. Scope is that of environment vars in other operating systems. As text is typed at the command line or you run programs by $FG,2$#include$FG$ing them, the syms go in the table. If a sym is not found, the parent task's table is checked. The father of all tasks has the API syms you'll need waiting in it's table. No need to $FG,2$#include$FG$ headers. - -* No need for namespaces -- scoping occurs automatically based on task symbol table hierarchy with the $FG,2$Adam task$FG$'s symbol system-wide global. - -* Sometimes, I $LK,"cut corners",A="FI:::/Doc/CutCorners.TXT"$ in the interest of keeping the code beautiful. diff --git a/Doc/Streams.DD b/Doc/Streams.DD new file mode 100644 index 0000000..5a7e11e --- /dev/null +++ b/Doc/Streams.DD @@ -0,0 +1,7 @@ +$WW,1$There are no streams in the traditional sense. The cmd line output gets sent to the cursor location of a document being edited and by using cursor keys, text can be injected all over the document. $LK,"Sprites",A="HI:Sprites"$ can be injected and are not serialized! Furthermore, the input can come from triggering macro widgets. See $LK,"Doc Overview",A="FI:::/Doc/DolDocOverview.DD"$ and $LK,"Doc Routines",A="HI:DolDoc"$. + +If you had a remote term and sent key $LK,"Scan Codes",A="MN:SC_INS"$, the user would press $FG,2$$FG$ to access his $FG,2$Personal Menu$FG$ to trigger his macros. However, the local $LK,"~/PersonalMenu.DD"$ might differ from the remote, causing loss of sync between local and remote sessions. Also, the window size of local and remote might differ, so word-wrapped text would be different. Injecting output text with different windows sizes would cause remote and local documents to not be in sync. + +See $LK,"Char Overview",A="FI:::/Doc/CharOverview.DD"$ and $LK,"Char Routines",A="HI:Char"$. + +You can send characters into $FG,2$StdIn$FG$. See $LK,"Auto",A="MN:Auto"$(), $LK,"XTalk",A="MN:XTalk"$() and $LK,"AutoFile",A="HI:AutoFile"$. diff --git a/Doc/Streams.TXT b/Doc/Streams.TXT deleted file mode 100644 index 93faf49..0000000 --- a/Doc/Streams.TXT +++ /dev/null @@ -1,7 +0,0 @@ -$WW,1$There are no streams in the traditional sense. The cmd line output gets sent to the cursor location of a document being edited and by using cursor keys, text can be injected all over the document. $LK,"Sprites",A="HI:Sprites"$ can be injected and are not serialized! Furthermore, the input can come from triggering macro widgets. See $LK,"Doc Overview",A="FI:::/Doc/DolDocOverview.TXT"$ and $LK,"Doc Routines",A="HI:DolDoc"$. - -If you had a remote term and sent key $LK,"Scan Codes",A="MN:SC_INS"$, the user would press $FG,2$$FG$ to access his $FG,2$Personal Menu$FG$ to trigger his macros. However, the local $LK,"~/PersonalMenu.TXT"$ might differ from the remote, causing loss of sync between local and remote sessions. Also, the window size of local and remote might differ, so word-wrapped text would be different. Injecting output text with different windows sizes would cause remote and local documents to not be in sync. - -See $LK,"Char Overview",A="FI:::/Doc/CharOverview.TXT"$ and $LK,"Char Routines",A="HI:Char"$. - -You can send characters into $FG,2$StdIn$FG$. See $LK,"Auto",A="MN:Auto"$(), $LK,"XTalk",A="MN:XTalk"$() and $LK,"AutoFile",A="HI:AutoFile"$. diff --git a/Doc/TOSZ.TXT b/Doc/TOSZ.DD similarity index 100% rename from Doc/TOSZ.TXT rename to Doc/TOSZ.DD diff --git a/Doc/TaskSrv.TXT b/Doc/TaskSrv.DD similarity index 100% rename from Doc/TaskSrv.TXT rename to Doc/TaskSrv.DD diff --git a/Doc/TextBase.DD b/Doc/TextBase.DD new file mode 100644 index 0000000..2a5c138 --- /dev/null +++ b/Doc/TextBase.DD @@ -0,0 +1,15 @@ +$WW,1$$LK,"gr.text_base",A="MN:CGrGlbls"$ must be updated 30fps in your Fs->draw_it() callback. You probably want $LK,"GrPrint",A="MN:GrPrint"$() or just $LK,"Print",A="MN:Print"$(). The $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ code takes care of plotting text to $LK,"gr.text_base",A="MN:CGrGlbls"$. + +Bits 0-7 8-Bit ASCII Screen Code +Bits 8-11 Foreground $LK,"color",A="MN:BLACK"$ +Bits 12-15 Background $LK,"color",A="MN:BLACK"$ +Bits 16-20 Signed X pos shift val +Bits 21-25 Signed Y pos shift val +Bit 28 $LK,"Blink",A="MN:ATTRF_BLINK"$ +Bit 29 $LK,"Invert",A="MN:ATTRF_INVERT"$ed (Swap foreground and background) +Bit 30 $LK,"Sel",A="MN:ATTRF_SEL"$ (XOR colors with FF) +Bit 31 $LK,"Underline",A="MN:ATTRF_UNDERLINE"$ + +$LK,"GrUpdateTaskWin",A="MN:GrUpdateTaskWin"$() calls $LK,"DocUpdateTaskDocs",A="MN:DocUpdateTaskDocs"$() which calls $LK,"DocRecalc",A="MN:DocRecalc"$() where the document text is plotted into $LK,"gr.text_base",A="MN:CGrGlbls"$. Then, $LK,"GrUpdateTextBG",A="MN:GrUpdateTextBG"$() and $LK,"GrUpdateTextFG",A="MN:GrUpdateTextFG"$() render the $LK,"gr.text_base",A="MN:CGrGlbls"$ onto $LK,"gr.dc2",A="MN:CGrGlbls"$, a raw graphic bitmap. + +See $LK,"::/Demo/Games/Maze.HC"$. diff --git a/Doc/TextBase.TXT b/Doc/TextBase.TXT deleted file mode 100644 index 22f061e..0000000 --- a/Doc/TextBase.TXT +++ /dev/null @@ -1,15 +0,0 @@ -$WW,1$$LK,"gr.text_base",A="MN:CGrGlbls"$ must be updated 30fps in your Fs->draw_it() callback. You probably want $LK,"GrPrint",A="MN:GrPrint"$() or just $LK,"Print",A="MN:Print"$(). The $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$ code takes care of plotting text to $LK,"gr.text_base",A="MN:CGrGlbls"$. - -Bits 0-7 8-Bit ASCII Screen Code -Bits 8-11 Foreground $LK,"color",A="MN:BLACK"$ -Bits 12-15 Background $LK,"color",A="MN:BLACK"$ -Bits 16-20 Signed X pos shift val -Bits 21-25 Signed Y pos shift val -Bit 28 $LK,"Blink",A="MN:ATTRF_BLINK"$ -Bit 29 $LK,"Invert",A="MN:ATTRF_INVERT"$ed (Swap foreground and background) -Bit 30 $LK,"Sel",A="MN:ATTRF_SEL"$ (XOR colors with FF) -Bit 31 $LK,"Underline",A="MN:ATTRF_UNDERLINE"$ - -$LK,"GrUpdateTaskWin",A="MN:GrUpdateTaskWin"$() calls $LK,"DocUpdateTaskDocs",A="MN:DocUpdateTaskDocs"$() which calls $LK,"DocRecalc",A="MN:DocRecalc"$() where the document text is plotted into $LK,"gr.text_base",A="MN:CGrGlbls"$. Then, $LK,"GrUpdateTextBG",A="MN:GrUpdateTextBG"$() and $LK,"GrUpdateTextFG",A="MN:GrUpdateTextFG"$() render the $LK,"gr.text_base",A="MN:CGrGlbls"$ onto $LK,"gr.dc2",A="MN:CGrGlbls"$, a raw graphic bitmap. - -See $LK,"::/Demo/Games/Maze.CPP"$. diff --git a/Doc/TimeCycles.TXT b/Doc/TimeCycles.DD similarity index 100% rename from Doc/TimeCycles.TXT rename to Doc/TimeCycles.DD diff --git a/Doc/TimeDate.TXT b/Doc/TimeDate.DD similarity index 100% rename from Doc/TimeDate.TXT rename to Doc/TimeDate.DD diff --git a/Doc/TimeHPET.TXT b/Doc/TimeHPET.DD similarity index 100% rename from Doc/TimeHPET.TXT rename to Doc/TimeHPET.DD diff --git a/Doc/TimeJiffy.TXT b/Doc/TimeJiffy.DD similarity index 100% rename from Doc/TimeJiffy.TXT rename to Doc/TimeJiffy.DD diff --git a/Doc/Tips.DD b/Doc/Tips.DD new file mode 100644 index 0000000..825ab3b --- /dev/null +++ b/Doc/Tips.DD @@ -0,0 +1,152 @@ +$WW,1$$FG,5$$TX+CX,"Tips"$$FG$ + +* Turn-off or reboot ($FG,2$$FG$) at any time, except during disk writes. Writes are not cached. + +* Use $LK,"Seed",A="MN:Seed"$() and the cmd line to switch $LK,"Rand",A="MN:Rand"$() to non-timer mode and replay games you like. + +* 64-bit values are most efficient for the compiler. + +* See $MA-X+PU,"Key Map",LM="KeyMap;View;\n"$ for a list of defined keys. Define your own keys in $LK,"MyPutKey",A="MN:MyPutKey"$(). See $LK,"Keyboard Devices",A="HI:Keyboard Devices/System"$. + +* $FG,2$$FG$ maximizes a window. $FG,2$$FG$ closes AutoComplete. $FG,2$$FG$ brings back AutoComplete. $FG,2$$FG$ vertically tiles windows. $FG,2$$FG$ horizontally tiles windows. The $FG,2$ALT$FG$ keys are defined in $LK,"~/HomeKeyPlugIns.HC"$. You can customize them. + +* If you make changes to TempleOS files in your $FG,2$/Home$FG$ directory, generally you reboot to make them take effect. (You don't compile anything.) You should have two TempleOS partitions on your hard drive because a syntax error in a start-up file will make the partition unbootable. Boot to the second partition or boot to a standard TempleOS CD/DVD and use $LK,"Mount",A="MN:Mount"$() to mount your hard drive. + +* I copy my files to a mirrored ident partition, periodically with $LK,"CopyTree",A="MN:CopyTree"$() commands in scripts. I do merge commands with a menu entry like this: +$FG,2$Merge(\"C:/*\",\"D:/*\",\"+r+d\");$FG$ to check my changes. + +* $FG,2$$FG$ at the cmd line to access your PersonalMenu. Place macros there with $FG,2$$FG$, or icon-like sprites with $FG,2$$FG$. Use the $FG,2$Pop-Up$FG$ option on macros to $LK,"Spawn",A="MN:Spawn"$() a task to run a file. It dies when it is finished. This returns mem to the system. Be sure to press $FG,2$$FG$ to save your macro/menu area after making changes. + +* You can use $FG,2$ans$FG$ in cmd line expressions. It holds the res the last cmd line operation. You can use the cmd prompt as a calculator by just entering expressions like $FG,2$1+2*3;$FG$. $FG,2$F64$FG$ ress can be accessed with $FG,2$ansf$FG$. + +* Use the PullDown menu at the top of the screen to learn commands, or for finding the keyboard controls to games. + +* You can adjust the mouse movement rate by setting global vars in your start-up file. See $LK,"mouse scale",A="FF:~/HomeLocalize.HC,mouse.scale"$. + +* You can set your local time zone by setting the $LK,"local_time_offset",A="MN:local_time_offset"$ global var in a start-up file. It's units are $LK,"CDATE_FREQ",A="MN:CDATE_FREQ"$. See $LK,"local time",A="FF:~/HomeLocalize.HC,local_time"$. + +* $FG,2$$FG$ in the editor to reindent a $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ function or renumber an asm routine's local labels. + +* You can use $FG,2$filter_lines$FG$ in the editor text search form ($FG,2$$FG$) to temporarily display just lines near each match. A value of $FG,2$filter lines$FG$ set to $FG,2$5$FG$ will display lines within 5 lines of matches. Then, you can do another find to a different string and achieve a $FG,2$AND$FG$ search. When finished, press $FG,2$$FG$. + +* You can recompile and reinstall the kernel with $LK,"BootHDIns",A="MN:BootHDIns"$(). You'll probably want to make a function for recompiling that uses the $LK,"Auto",A="MN:Auto"$() function to answer the cfg questions. See my technique $LK,"Cfg Strs",A="FL:::/Demo/AcctExample/TOSCfg.HC,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOSDistro.HC,1"$. + +* $LK,"Scale2Mem",A="MN:Scale2Mem"$(min,max,limit=2*1024*1024*1024) can be used for cfg questions when recompiling. The $LK,"BootHDIns",A="MN:BootHDIns"$() cfg prompts accept expressions, not just numbers. The dft disk cache is $FG,2$Scale2Mem(0x80000,0x8000000)$FG$. + +* You can permanently disable $FG,2$AutoComplete$FG$ commenting-out $LK,"ACInit",A="FF:/Home/HomeSys.HC,ACInit"$() in $LK,"~/HomeSys.HC",A="FF:/Home/HomeSys.HC,ACInit"$. + +* Boolean expressions $BK,1$not$BK,0$ in $FG,2$if$FG$ stmts don't have short circuit logic and are compiled inefficiently. + +* You can use $LK,"progress1",A="MN:progress1"$-$LK,"progress4",A="MN:progress4"$ in your programs for whatever you like. They're just global vars that are shown on the wallpaper. The original intent was to indicate how far along operations were. There's no coordination, so different apps might interfere. I use them most for debugging--just values easily viewed. See $LK,"::/Demo/Progress.HC"$. + +* Use $LK,"DocMax",A="MN:DocMax"$() to adjust the size of the cmd line buf. It counts $LK,"CDoc",A="MN:CDoc"$ entries, not lines. + +* Many data structures have a $FG,2$user_data$FG$ member. Those are available for you to store a data item, for convenience. $LK,"CTask",A="MN:CTask"$, $LK,"CDocEntry",A="MN:CDocEntry"$ and $LK,"CDirEntry",A="MN:CDirEntry"$ have them. You shouldn't encounter conflicts with TempleOS using them. + +* If, for some strange reason, you wanted to reduce mem usage, make a smaller disk cache when you recompile the kernel; disabling $FG,2$AutoComplete$FG$; Specify smaller stk sizes when doing $LK,"Spawn",A="MN:Spawn"$(), chang $LK,"MEM_DFT_STK",A="MN:MEM_DFT_STK"$, and using $LK,"DocMax",A="MN:DocMax"$() to reduce the cmd line buffer size. + +* Filenames ending in "$FG,2$.Z$FG$" will be automatically compressed and uncompressed when read or written. The compression method is not supported by other operating systems. You can store files uncompressed by $LK,"Move",A="MN:Move"$()ing them to a filename not ending in "$FG,2$.Z$FG$". See $LK,"::/Doc/TOSZ.DD"$ if you want to uncompress while in $FG,2$Linux$FG$. + +* $LK,"Merge",A="MN:Merge"$() can be used to see what's changed. The $FG,2$+d$FG$ flag will show differences of files which have changed and allow you to merge code. (The $FG,2$+r$FG$ flag will recurse.) + +* There is a utility $LK,"LinkChk",A="MN:LinkChk"$() which will check for broken links in documentation. + +* You can use $LK,"Option",A="MN:Option"$($LK,"OPTf_WARN_PAREN",A="MN:OPTf_WARN_PAREN"$,ON) to find unnecessary parentheses in code. + +* You can use $LK,"Option",A="MN:Option"$($LK,"OPTf_WARN_DUP_TYPES",A="MN:OPTf_WARN_DUP_TYPES"$,ON) to find unnecessary local var type stmts. + +* $LK,"Option",A="MN:Option"$($LK,"OPTf_ECHO",A="MN:OPTf_ECHO"$,ON) can be placed in $LK,"StartOS.HC",A="FI:::/StartOS.HC"$ to echo start-up scripts. + +* Use $LK,"Plain",A="MN:Plain"$() to edit a plain text file. You'll need this if your file has $FG,2$$$$FG$'s. Use the $LK,"ToDolDoc",A="MN:ToDolDoc"$() utility to convert plain text to DolDoc's by doubling $FG,2$$$$FG$'s. + +* Use $LK,"Silent",A="MN:Silent"$() to disable screen text output. + +* Grab-scroll any window at any time with $FG,2${CTRL-LEFT-MOUSE-DRAG}$FG$. Null grab-scrolling with $FG,2${CTRL-RIGHT-MOUSE}$FG$. + +* Use $FG,2$$FG$ to zoom-in and $FG,2$$FG$ to zoom-out. You can scroll by moving to the edge of the window. Set $LK,"gr.continuous_scroll",A="MN:CGrGlbls"$ to $FG,2$TRUE$FG$ if you want. + +* Use $FG,2$$FG$ and $FG,2$$FG$ to display a grid on the screen. + +* Use $FG,2$$FG$ to enter an extended ASCII char. + +* Use $FG,2$$FG$ to toggle between $LK,"Std Font",A="FI:::/Kernel/FontStd.HC"$ and $LK,"Cyrillic Font",A="FI:::/Kernel/FontCyrillic.HC"$. + +* Use $FG,2$$FG$ will capture the screen as a sprite on the clipboard. You can save the cmd line doc as text with $FG,2$$FG$. + +* You can save a sprite as a $FG,2$.BMP$FG$ file in $FG,2$$FG$ on the Sprite BitMap Menu. + +* You can eye-dropper colors in the $FG,2$$FG$ sprite editor by pressing $FG,2$'c'$FG$. Press $FG,2$'t'$FG$ for transparent. + +* There are handy functions--$FG,2$F(),R(),FD()$FG$ and $FG,2$RD()$FG$ which are defined in $LK,"~/HomeWrappers.HC"$. You are encouraged to change them and add more. They will perform find-and-replace operations accross multiple files. The $FG,2$+l$FG$ flag is particularly useful since it limits to whole labels. The $FG,2$+lb$FG$ and $FG,2$+la$FG$ flags limit to whole labels just before or after. You are encouraged to add or modify handy wrapper functions to make cmd line operations easier. + +* When using $LK,"Find",A="MN:Find"$() while modifying code, work from the bottom-up so that line numbers are correct. If you work top-down, then inserting or deleting lines causes the lower file links will be incorrect. + +* You can save files after making changes, anytime you are within the editor, like when viewing help/macro files. $FG,2$$FG$ saves as, $FG,2$$FG$ saves with the same name in the scrolling title bar. Hitting $FG,2$$FG$ will exit and save. ($FG,2$$FG$ will abort). You can save the cmd line window to a file, too, since you're actually in the editor when you're at the cmd line. + +* When using $FG,2$$FG$ to insert links in documents, you can usually leave the $FG,2$Tag Text$FG$ blank and it will be filled-in automatically based on other entries. + +* There is a feature of the precompiler that allows code to be executed in the middle of compilation and data inserted into the compilation stream. Click here for an example: $LK,"#exe {",A="FF:::/Kernel/KEnd.HC,#exe {"$. + +* If you output to the cmd line and wish to allow users to scroll around and view data, you can use $LK,"View",A="MN:View"$(). + +* Use $LK,"View",A="MN:View"$() in Pop-up macros to linger until the user presses $FG,2$$FG$ or $FG,2$$FG$. + +* You can access the word under the cursor at $LK,"ac.cur_word",A="MN:CAutoCompleteGlbls"$. + +* You can reactivate $FG,2$AutoComplete$FG$ after closing it by pressing $FG,2$$FG$ or $FG,2$$FG$ if you have it defined. + +* $FG,2$$FG$ to toggle to/from plain text just the $LK,"CDoc",A="MN:CDoc"$ cmd under the cursor. See $LK,"::/Demo/DolDoc/TextDemo.HC"$. + +* If you toggle to plain text when you are working with graphics in a document, you can add duplicate entries for sprites by entering a $FG,2$$$SP...$$$FG$ cmd with the same num. + +* If you toggle to plain text when working with graphics, you can add a str to the $FG,2$$$SP...$$$FG$ entry to keep track of it. Try $FG,2$$$SP,"<2>",BI=2$$$FG$ where '2' is the sprite num. + +* I use spaces-to-tab operations on all my src files to keep them small. You have to be careful, though, because spaces in strings will be converted. I use $FG,2$$FG$ ' ' in such cases. See $LK,"S2T",A="MN:S2T"$() for spaces-to-tabs. + +* You can edit an existing sprite by putting the cursor on it and pressing $FG,2$$FG$. + +* When editing a sprite, you can cut and paste the elements in the sidebar text list window. + +* I recommend keeping CSprite in vect format until you are done creating them, so you can edit the ctrl points. Then, convert them to bitmaps, so the flood fills work well. If you are doing interpolation, however, they must be vect. + +* $LK,"GrFloodFill",A="MN:GrFloodFill"$() is slow. $LK,"GrRect",A="MN:GrRect"$() is fast. + +* You can customize the $FG,2$wallpaper$FG$. See $LK,"::/Demo/Graphics/WallPaperFish.HC"$. + +* Your RAM disks will not be reformated when you reboot if the memory location has not changed and it finds the disk intacted. + +* $FG,2$try{} catch{}$FG$ in a function will cause all vars to be non-reg. + +* Using a sub-int array, $FG,2$i.u8[3]$FG$, for example, will force a local var to non-reg. + +* You can delete the $FG,4$~/Registry.HC.Z$FG$ file. The policy is that deleting it will restore defaults. It is a text doc, if you want to edit it. Be careful of tree indentations. + +* Study $LK,"::/Adam/Opt/Utils/MemRep.HC"$ and $LK,"WallPaper",A="MN:WallPaper"$() to learn how the system resources are put together. + +* The editor's sel-text mechanism allows for disjoint portions of sel text. This is a feature, not a bug -- you can cut-and-paste disjoint text. + +* $LK,"cnts.time_stamp_freq",A="MN:CCntsGlbls"$ is continuously calibrated. Be careful because expressions might decrease. Take a snap-shot, like this: $FG,2$timeout=$LK,"GetTSC",A="MN:GetTSC"$+$LK,"cnts.time_stamp_freq",A="MN:CCntsGlbls"$ x seconds;$FG$ and compare against $LK,"GetTSC",A="MN:GetTSC"$(). I recommend just using $LK,"tS",A="MN:tS"$ or $LK,"cnts.jiffies",A="MN:CCntsGlbls"$. + +* Use $LK,"HeapLog",A="MN:HeapLog"$(), $LK,"HeapLogAddrRep",A="MN:HeapLogAddrRep"$() and $LK,"HeapLogSizeRep",A="MN:HeapLogSizeRep"$() to find leaks. Don't be confused by $LK,"CDoc",A="MN:CDoc"$ allocations. Those are generated when text is written to the cmd line buffer. + +* For advanced heap debugging, play with $LK,"_CFG_HEAP_DBG",A="MN:_CFG_HEAP_DBG"$. You're on your own. + +* You can use $LK,"Type",A="MN:Type"$() to display $FG,2$.BMP$FG$ or $FG,2$.GRA$FG$ files. + +* Use $LK,"Man",A="MN:Man"$() to jump to short sym name src code. + +* Use $LK,"Fix",A="MN:Fix"$() to edit and fix the last compiler err. + +* You can use $FG,2$$FG$ to do a check for compile errors. + +* You can use $LK,"DocOpt",A="MN:DocOpt"$() to optimize links. (Mostly just removes .Z) + +* $LK,"ZipRep",A="MN:ZipRep"$() can highlight src files with lots of redundancy. + +* With $FG,2$start$FG$/$FG,2$end$FG$, common trailing code is fast. Common leading code is slow.$FG$ + +* The first line of the $MA-X+PU,"Psalmody",LM="#include \"::/Apps/Psalmody/Run\"\n"$ $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ song files is a comment with a category recognized by $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.HC,JukeBox"$(). The categories are $FG,2$"no nothing"$FG$, $FG,2$"has words"$FG$, $FG,2$"has graphics"$FG$, or $FG,2$"special"$FG$. The third character in the song comment is a digit rating number, shown in $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.HC,JukeBox"$(). You can set the song rating in $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.HC,JukeBox"$() by pressing $FG,2$0$FG$-$FG,2$9$FG$. You can press $FG,2$$FG$ to delete songs. + +$FG,8$ +* "Linux" is a trademark owned by Linus Torvalds. +$FG$ \ No newline at end of file diff --git a/Doc/Tips.TXT b/Doc/Tips.TXT deleted file mode 100644 index 67b4656..0000000 --- a/Doc/Tips.TXT +++ /dev/null @@ -1,152 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"Tips"$$FG$ - -* Turn-off or reboot ($FG,2$$FG$) at any time, except during disk writes. Writes are not cached. - -* Use $LK,"Seed",A="MN:Seed"$() and the cmd line to switch $LK,"Rand",A="MN:Rand"$() to non-timer mode and replay games you like. - -* 64-bit values are most efficient for the compiler. - -* See $MA-X+PU,"Key Map",LM="KeyMap;View;\n"$ for a list of defined keys. Define your own keys in $LK,"MyPutKey",A="MN:MyPutKey"$(). See $LK,"Keyboard Devices",A="HI:Keyboard Devices/System"$. - -* $FG,2$$FG$ maximizes a window. $FG,2$$FG$ closes AutoComplete. $FG,2$$FG$ brings back AutoComplete. $FG,2$$FG$ vertically tiles windows. $FG,2$$FG$ horizontally tiles windows. The $FG,2$ALT$FG$ keys are defined in $LK,"~/HomeKeyPlugIns.CPP"$. You can customize them. - -* If you make changes to TempleOS files in your $FG,2$/Home$FG$ directory, generally you reboot to make them take effect. (You don't compile anything.) You should have two TempleOS partitions on your hard drive because a syntax error in a start-up file will make the partition unbootable. Boot to the second partition or boot to a standard TempleOS CD/DVD and use $LK,"Mount",A="MN:Mount"$() to mount your hard drive. - -* I copy my files to a mirrored ident partition, periodically with $LK,"CopyTree",A="MN:CopyTree"$() commands in scripts. I do merge commands with a menu entry like this: -$FG,2$Merge(\"C:/*\",\"D:/*\",\"+r+d\");$FG$ to check my changes. - -* $FG,2$$FG$ at the cmd line to access your PersonalMenu. Place macros there with $FG,2$$FG$, or icon-like sprites with $FG,2$$FG$. Use the $FG,2$Pop-Up$FG$ option on macros to $LK,"Spawn",A="MN:Spawn"$() a task to run a file. It dies when it is finished. This returns mem to the system. Be sure to press $FG,2$$FG$ to save your macro/menu area after making changes. - -* You can use $FG,2$ans$FG$ in cmd line expressions. It holds the res the last cmd line operation. You can use the cmd prompt as a calculator by just entering expressions like $FG,2$1+2*3;$FG$. $FG,2$F64$FG$ ress can be accessed with $FG,2$ansf$FG$. - -* Use the PullDown menu at the top of the screen to learn commands, or for finding the keyboard controls to games. - -* You can adjust the mouse movement rate by setting global vars in your start-up file. See $LK,"mouse scale",A="FF:~/HomeLocalize.CPP,mouse.scale"$. - -* You can set your local time zone by setting the $LK,"local_time_offset",A="MN:local_time_offset"$ global var in a start-up file. It's units are $LK,"CDATE_FREQ",A="MN:CDATE_FREQ"$. See $LK,"local time",A="FF:~/HomeLocalize.CPP,local_time"$. - -* $FG,2$$FG$ in the editor to reindent a $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ function or renumber an asm routine's local labels. - -* You can use $FG,2$filter_lines$FG$ in the editor text search form ($FG,2$$FG$) to temporarily display just lines near each match. A value of $FG,2$filter lines$FG$ set to $FG,2$5$FG$ will display lines within 5 lines of matches. Then, you can do another find to a different string and achieve a $FG,2$AND$FG$ search. When finished, press $FG,2$$FG$. - -* You can recompile and reinstall the kernel with $LK,"BootHDIns",A="MN:BootHDIns"$(). You'll probably want to make a function for recompiling that uses the $LK,"Auto",A="MN:Auto"$() function to answer the cfg questions. See my technique $LK,"Cfg Strs",A="FL:::/Demo/AcctExample/TOSCfg.CPP,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOSDistro.CPP,1"$. - -* $LK,"Scale2Mem",A="MN:Scale2Mem"$(min,max,limit=2*1024*1024*1024) can be used for cfg questions when recompiling. The $LK,"BootHDIns",A="MN:BootHDIns"$() cfg prompts accept expressions, not just numbers. The dft disk cache is $FG,2$Scale2Mem(0x80000,0x8000000)$FG$. - -* You can permanently disable $FG,2$AutoComplete$FG$ commenting-out $LK,"ACInit",A="FF:/Home/HomeSys.CPP,ACInit"$() in $LK,"~/HomeSys.CPP",A="FF:/Home/HomeSys.CPP,ACInit"$. - -* Boolean expressions $BK,1$not$BK,0$ in $FG,2$if$FG$ stmts don't have short circuit logic and are compiled inefficiently. - -* You can use $LK,"progress1",A="MN:progress1"$-$LK,"progress4",A="MN:progress4"$ in your programs for whatever you like. They're just global vars that are shown on the wallpaper. The original intent was to indicate how far along operations were. There's no coordination, so different apps might interfere. I use them most for debugging--just values easily viewed. See $LK,"::/Demo/Progress.CPP"$. - -* Use $LK,"DocMax",A="MN:DocMax"$() to adjust the size of the cmd line buf. It counts $LK,"CDoc",A="MN:CDoc"$ entries, not lines. - -* Many data structures have a $FG,2$user_data$FG$ member. Those are available for you to store a data item, for convenience. $LK,"CTask",A="MN:CTask"$, $LK,"CDocEntry",A="MN:CDocEntry"$ and $LK,"CDirEntry",A="MN:CDirEntry"$ have them. You shouldn't encounter conflicts with TempleOS using them. - -* If, for some strange reason, you wanted to reduce mem usage, make a smaller disk cache when you recompile the kernel; disabling $FG,2$AutoComplete$FG$; Specify smaller stk sizes when doing $LK,"Spawn",A="MN:Spawn"$(), chang $LK,"MEM_DFT_STK",A="MN:MEM_DFT_STK"$, and using $LK,"DocMax",A="MN:DocMax"$() to reduce the cmd line buffer size. - -* Filenames ending in "$FG,2$.Z$FG$" will be automatically compressed and uncompressed when read or written. The compression method is not supported by other operating systems. You can store files uncompressed by $LK,"Move",A="MN:Move"$()ing them to a filename not ending in "$FG,2$.Z$FG$". See $LK,"::/Doc/TOSZ.TXT"$ if you want to uncompress while in $FG,2$Linux$FG$. - -* $LK,"Merge",A="MN:Merge"$() can be used to see what's changed. The $FG,2$+d$FG$ flag will show differences of files which have changed and allow you to merge code. (The $FG,2$+r$FG$ flag will recurse.) - -* There is a utility $LK,"LinkChk",A="MN:LinkChk"$() which will check for broken links in documentation. - -* You can use $LK,"Option",A="MN:Option"$($LK,"OPTf_WARN_PAREN",A="MN:OPTf_WARN_PAREN"$,ON) to find unnecessary parentheses in code. - -* You can use $LK,"Option",A="MN:Option"$($LK,"OPTf_WARN_DUP_TYPES",A="MN:OPTf_WARN_DUP_TYPES"$,ON) to find unnecessary local var type stmts. - -* $LK,"Option",A="MN:Option"$($LK,"OPTf_ECHO",A="MN:OPTf_ECHO"$,ON) can be placed in $LK,"StartOS.CPP",A="FI:::/StartOS.CPP"$ to echo start-up scripts. - -* Use $LK,"Plain",A="MN:Plain"$() to edit a plain text file. You'll need this if your file has $FG,2$$$$FG$'s. Use the $LK,"ToDolDoc",A="MN:ToDolDoc"$() utility to convert plain text to DolDoc's by doubling $FG,2$$$$FG$'s. - -* Use $LK,"Silent",A="MN:Silent"$() to disable screen text output. - -* Grab-scroll any window at any time with $FG,2${CTRL-LEFT-MOUSE-DRAG}$FG$. Null grab-scrolling with $FG,2${CTRL-RIGHT-MOUSE}$FG$. - -* Use $FG,2$$FG$ to zoom-in and $FG,2$$FG$ to zoom-out. You can scroll by moving to the edge of the window. Set $LK,"gr.continuous_scroll",A="MN:CGrGlbls"$ to $FG,2$TRUE$FG$ if you want. - -* Use $FG,2$$FG$ and $FG,2$$FG$ to display a grid on the screen. - -* Use $FG,2$$FG$ to enter an extended ASCII char. - -* Use $FG,2$$FG$ to toggle between $LK,"Std Font",A="FI:::/Kernel/FontStd.CPP"$ and $LK,"Cyrillic Font",A="FI:::/Kernel/FontCyrillic.CPP"$. - -* Use $FG,2$$FG$ will capture the screen as a sprite on the clipboard. You can save the cmd line doc as text with $FG,2$$FG$. - -* You can save a sprite as a $FG,2$.BMP$FG$ file in $FG,2$$FG$ on the Sprite BitMap Menu. - -* You can eye-dropper colors in the $FG,2$$FG$ sprite editor by pressing $FG,2$'c'$FG$. Press $FG,2$'t'$FG$ for transparent. - -* There are handy functions--$FG,2$F(),R(),FD()$FG$ and $FG,2$RD()$FG$ which are defined in $LK,"~/HomeWrappers.CPP"$. You are encouraged to change them and add more. They will perform find-and-replace operations accross multiple files. The $FG,2$+l$FG$ flag is particularly useful since it limits to whole labels. The $FG,2$+lb$FG$ and $FG,2$+la$FG$ flags limit to whole labels just before or after. You are encouraged to add or modify handy wrapper functions to make cmd line operations easier. - -* When using $LK,"Find",A="MN:Find"$() while modifying code, work from the bottom-up so that line numbers are correct. If you work top-down, then inserting or deleting lines causes the lower file links will be incorrect. - -* You can save files after making changes, anytime you are within the editor, like when viewing help/macro files. $FG,2$$FG$ saves as, $FG,2$$FG$ saves with the same name in the scrolling title bar. Hitting $FG,2$$FG$ will exit and save. ($FG,2$$FG$ will abort). You can save the cmd line window to a file, too, since you're actually in the editor when you're at the cmd line. - -* When using $FG,2$$FG$ to insert links in documents, you can usually leave the $FG,2$Tag Text$FG$ blank and it will be filled-in automatically based on other entries. - -* There is a feature of the precompiler that allows code to be executed in the middle of compilation and data inserted into the compilation stream. Click here for an example: $LK,"#exe {",A="FF:::/Kernel/KEnd.CPP,#exe {"$. - -* If you output to the cmd line and wish to allow users to scroll around and view data, you can use $LK,"View",A="MN:View"$(). - -* Use $LK,"View",A="MN:View"$() in Pop-up macros to linger until the user presses $FG,2$$FG$ or $FG,2$$FG$. - -* You can access the word under the cursor at $LK,"ac.cur_word",A="MN:CAutoCompleteGlbls"$. - -* You can reactivate $FG,2$AutoComplete$FG$ after closing it by pressing $FG,2$$FG$ or $FG,2$$FG$ if you have it defined. - -* $FG,2$$FG$ to toggle to/from plain text just the $LK,"CDoc",A="MN:CDoc"$ cmd under the cursor. See $LK,"::/Demo/DolDoc/TextDemo.CPP"$. - -* If you toggle to plain text when you are working with graphics in a document, you can add duplicate entries for sprites by entering a $FG,2$$$SP...$$$FG$ cmd with the same num. - -* If you toggle to plain text when working with graphics, you can add a str to the $FG,2$$$SP...$$$FG$ entry to keep track of it. Try $FG,2$$$SP,"<2>",BI=2$$$FG$ where '2' is the sprite num. - -* I use spaces-to-tab operations on all my src files to keep them small. You have to be careful, though, because spaces in strings will be converted. I use $FG,2$$FG$ ' ' in such cases. See $LK,"S2T",A="MN:S2T"$() for spaces-to-tabs. - -* You can edit an existing sprite by putting the cursor on it and pressing $FG,2$$FG$. - -* When editing a sprite, you can cut and paste the elements in the sidebar text list window. - -* I recommend keeping CSprite in vect format until you are done creating them, so you can edit the ctrl points. Then, convert them to bitmaps, so the flood fills work well. If you are doing interpolation, however, they must be vect. - -* $LK,"GrFloodFill",A="MN:GrFloodFill"$() is slow. $LK,"GrRect",A="MN:GrRect"$() is fast. - -* You can customize the $FG,2$wallpaper$FG$. See $LK,"::/Demo/Graphics/WallPaperFish.CPP"$. - -* Your RAM disks will not be reformated when you reboot if the memory location has not changed and it finds the disk intacted. - -* $FG,2$try{} catch{}$FG$ in a function will cause all vars to be non-reg. - -* Using a sub-int array, $FG,2$i.u8[3]$FG$, for example, will force a local var to non-reg. - -* You can delete the $FG,4$~/Registry.CPP.Z$FG$ file. The policy is that deleting it will restore defaults. It is a text doc, if you want to edit it. Be careful of tree indentations. - -* Study $LK,"::/Adam/Opt/Utils/MemRep.CPP"$ and $LK,"WallPaper",A="MN:WallPaper"$() to learn how the system resources are put together. - -* The editor's sel-text mechanism allows for disjoint portions of sel text. This is a feature, not a bug -- you can cut-and-paste disjoint text. - -* $LK,"cnts.time_stamp_freq",A="MN:CCntsGlbls"$ is continuously calibrated. Be careful because expressions might decrease. Take a snap-shot, like this: $FG,2$timeout=$LK,"GetTSC",A="MN:GetTSC"$+$LK,"cnts.time_stamp_freq",A="MN:CCntsGlbls"$ x seconds;$FG$ and compare against $LK,"GetTSC",A="MN:GetTSC"$(). I recommend just using $LK,"tS",A="MN:tS"$ or $LK,"cnts.jiffies",A="MN:CCntsGlbls"$. - -* Use $LK,"HeapLog",A="MN:HeapLog"$(), $LK,"HeapLogAddrRep",A="MN:HeapLogAddrRep"$() and $LK,"HeapLogSizeRep",A="MN:HeapLogSizeRep"$() to find leaks. Don't be confused by $LK,"CDoc",A="MN:CDoc"$ allocations. Those are generated when text is written to the cmd line buffer. - -* For advanced heap debugging, play with $LK,"_CFG_HEAP_DBG",A="MN:_CFG_HEAP_DBG"$. You're on your own. - -* You can use $LK,"Type",A="MN:Type"$() to display $FG,2$.BMP$FG$ or $FG,2$.GRA$FG$ files. - -* Use $LK,"Man",A="MN:Man"$() to jump to short sym name src code. - -* Use $LK,"Fix",A="MN:Fix"$() to edit and fix the last compiler err. - -* You can use $FG,2$$FG$ to do a check for compile errors. - -* You can use $LK,"DocOpt",A="MN:DocOpt"$() to optimize links. (Mostly just removes .Z) - -* $LK,"ZipRep",A="MN:ZipRep"$() can highlight src files with lots of redundancy. - -* With $FG,2$start$FG$/$FG,2$end$FG$, common trailing code is fast. Common leading code is slow.$FG$ - -* The first line of the $MA-X+PU,"Psalmody",LM="#include \"::/Apps/Psalmody/Run\"\n"$ $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ song files is a comment with a category recognized by $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.CPP,JukeBox"$(). The categories are $FG,2$"no nothing"$FG$, $FG,2$"has words"$FG$, $FG,2$"has graphics"$FG$, or $FG,2$"special"$FG$. The third character in the song comment is a digit rating number, shown in $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.CPP,JukeBox"$(). You can set the song rating in $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.CPP,JukeBox"$() by pressing $FG,2$0$FG$-$FG,2$9$FG$. You can press $FG,2$$FG$ to delete songs. - -$FG,8$ -* "Linux" is a trademark owned by Linus Torvalds. -$FG$ \ No newline at end of file diff --git a/Doc/Transform.DD b/Doc/Transform.DD new file mode 100644 index 0000000..dfca66a --- /dev/null +++ b/Doc/Transform.DD @@ -0,0 +1,13 @@ +$WW,1$$LK,"CDC",A="MN:CDC"$'s have a 4x4 matrix for rotating, scaling, skewing and shifting in 3 dimensions. To make the graphics routines use the transform, you must set the $LK,"DCF_TRANSFORMATION",A="MN:DCF_TRANSFORMATION"$ flag. + +The matrix consists of ints that have been scaled 32 bits ($LK,"GR_SCALE",A="MN:GR_SCALE"$). See $LK,"::/Demo/Lectures/FixedPoint.HC"$ to learn why. + +See $LK,"Mat4x4IdentEqu",A="MN:Mat4x4IdentEqu"$(), $LK,"Mat4x4IdentNew",A="MN:Mat4x4IdentNew"$(), $LK,"Mat4x4Equ",A="MN:Mat4x4Equ"$() and $LK,"Mat4x4New",A="MN:Mat4x4New"$(). See $LK,"Mat4x4RotX",A="MN:Mat4x4RotX"$(), $LK,"Mat4x4RotY",A="MN:Mat4x4RotY"$(), $LK,"Mat4x4RotZ",A="MN:Mat4x4RotZ"$() and $LK,"Mat4x4Scale",A="MN:Mat4x4Scale"$() to rotate about axes and scale. Combine them with $LK,"Mat4x4MulMat4x4Equ",A="MN:Mat4x4MulMat4x4Equ"$()/$LK,"Mat4x4MulMat4x4New",A="MN:Mat4x4MulMat4x4New"$() and assign them to the $LK,"CDC",A="MN:CDC"$.$FG,2$dc$FG$ with $LK,"DCMat4x4Set",A="MN:DCMat4x4Set"$(). See $LK,"::/Demo/Graphics/Box.HC"$. + +You can rotate single points using $LK,"Mat4x4MulXYZ",A="MN:Mat4x4MulXYZ"$(). + +The 4th dimension allows a neat trick where you can place pos shifts (translations), into the matrix and $LK,"Mat4x4MulMat4x4Equ",A="MN:Mat4x4MulMat4x4Equ"$/$LK,"Mat4x4MulMat4x4New",A="MN:Mat4x4MulMat4x4New"$ them to combine rotation/shift operations. Normally, you can't combine pos shift operations. See $LK,"Mat4x4TranslationEqu",A="MN:Mat4x4TranslationEqu"$() and $LK,"::/Demo/Graphics/Transform.HC"$. + +Finally, $LK,"CDC",A="MN:CDC"$'s have an $FG,2$x$FG$, $FG,2$y$FG$ and $FG,2$z$FG$ which is an additional shift (translation). + +The transformation is implemented as a callback on the $LK,"CDC",A="MN:CDC"$'s $FG,2$transform()$FG$ member. The default $FG,2$transform()$FG$ callback is $LK,"DCTransform",A="MN:DCTransform"$(). See $LK,"::/Demo/Games/EagleDive.HC"$ or $LK,"::/Demo/Games/CastleFrankenstein.HC"$ to see how to change the $FG,2$transform()$FG$ callback for foreshortening. diff --git a/Doc/Transform.TXT b/Doc/Transform.TXT deleted file mode 100644 index 1c06a1f..0000000 --- a/Doc/Transform.TXT +++ /dev/null @@ -1,13 +0,0 @@ -$WW,1$$LK,"CDC",A="MN:CDC"$'s have a 4x4 matrix for rotating, scaling, skewing and shifting in 3 dimensions. To make the graphics routines use the transform, you must set the $LK,"DCF_TRANSFORMATION",A="MN:DCF_TRANSFORMATION"$ flag. - -The matrix consists of ints that have been scaled 32 bits ($LK,"GR_SCALE",A="MN:GR_SCALE"$). See $LK,"::/Demo/Lectures/FixedPoint.CPP"$ to learn why. - -See $LK,"Mat4x4IdentEqu",A="MN:Mat4x4IdentEqu"$(), $LK,"Mat4x4IdentNew",A="MN:Mat4x4IdentNew"$(), $LK,"Mat4x4Equ",A="MN:Mat4x4Equ"$() and $LK,"Mat4x4New",A="MN:Mat4x4New"$(). See $LK,"Mat4x4RotX",A="MN:Mat4x4RotX"$(), $LK,"Mat4x4RotY",A="MN:Mat4x4RotY"$(), $LK,"Mat4x4RotZ",A="MN:Mat4x4RotZ"$() and $LK,"Mat4x4Scale",A="MN:Mat4x4Scale"$() to rotate about axes and scale. Combine them with $LK,"Mat4x4MulMat4x4Equ",A="MN:Mat4x4MulMat4x4Equ"$()/$LK,"Mat4x4MulMat4x4New",A="MN:Mat4x4MulMat4x4New"$() and assign them to the $LK,"CDC",A="MN:CDC"$.$FG,2$dc$FG$ with $LK,"DCMat4x4Set",A="MN:DCMat4x4Set"$(). See $LK,"::/Demo/Graphics/Box.CPP"$. - -You can rotate single points using $LK,"Mat4x4MulXYZ",A="MN:Mat4x4MulXYZ"$(). - -The 4th dimension allows a neat trick where you can place pos shifts (translations), into the matrix and $LK,"Mat4x4MulMat4x4Equ",A="MN:Mat4x4MulMat4x4Equ"$/$LK,"Mat4x4MulMat4x4New",A="MN:Mat4x4MulMat4x4New"$ them to combine rotation/shift operations. Normally, you can't combine pos shift operations. See $LK,"Mat4x4TranslationEqu",A="MN:Mat4x4TranslationEqu"$() and $LK,"::/Demo/Graphics/Transform.CPP"$. - -Finally, $LK,"CDC",A="MN:CDC"$'s have an $FG,2$x$FG$, $FG,2$y$FG$ and $FG,2$z$FG$ which is an additional shift (translation). - -The transformation is implemented as a callback on the $LK,"CDC",A="MN:CDC"$'s $FG,2$transform()$FG$ member. The default $FG,2$transform()$FG$ callback is $LK,"DCTransform",A="MN:DCTransform"$(). See $LK,"::/Demo/Games/EagleDive.CPP"$ or $LK,"::/Demo/Games/CastleFrankenstein.CPP"$ to see how to change the $FG,2$transform()$FG$ callback for foreshortening. diff --git a/Doc/Upgrade.DD b/Doc/Upgrade.DD new file mode 100644 index 0000000..66c3e9b --- /dev/null +++ b/Doc/Upgrade.DD @@ -0,0 +1,5 @@ +$WW,1$$FG,5$$TX+CX,"Upgrading TempleOS"$$FG$ + +To upgrade, you generally boot the new TempleOS CD/DVD, install on top of your drive, modify your files and set it to boot your account by executing $LK,"BootHDIns",A="MN:BootHDIns"$(). Often, your code will have to be modified to work with the new version. See $LK,"Change Log",A="FI:::/Doc/ChangeLog.DD"$. You might have to boot an alternate drive or the CD and modify your code until it boots okay. + +See the $LK,"Installing",A="FI:::/Doc/Install.DD"$ documentation. diff --git a/Doc/Upgrade.TXT b/Doc/Upgrade.TXT deleted file mode 100644 index 7e34343..0000000 --- a/Doc/Upgrade.TXT +++ /dev/null @@ -1,5 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"Upgrading TempleOS"$$FG$ - -To upgrade, you generally boot the new TempleOS CD/DVD, install on top of your drive, modify your files and set it to boot your account by executing $LK,"BootHDIns",A="MN:BootHDIns"$(). Often, your code will have to be modified to work with the new version. See $LK,"Change Log",A="FI:::/Doc/ChangeLog.TXT"$. You might have to boot an alternate drive or the CD and modify your code until it boots okay. - -See the $LK,"Installing",A="FI:::/Doc/Install.TXT"$ documentation. diff --git a/Doc/Welcome.DD b/Doc/Welcome.DD new file mode 100644 index 0000000..069c595 --- /dev/null +++ b/Doc/Welcome.DD @@ -0,0 +1,136 @@ +$WW,1$$FG,5$$TX+CX,"Welcome to TempleOS"$$FG$ + +TempleOS is a x86_64, multi-cored, non-preemptive multi-tasking, ring-0-only, single-address_mapped (identity-mapped), operating system for recreational programming. Paging is almost not used. + +The people whom can most benefit are: +$ID,2$* Professionals doing hobby projects +* Teenagers doing projects +* Non-professional, older-persons projects +$ID,-2$ +Simplicity is a goal to $LK,"keep the line count down",A="FI:::/Doc/Strategy.DD"$, so it's easy to tinker with. As it turns-out, simplicity makes it faster in some ways, too. It never switches privilege levels, never changes address maps, tends to load whole contiguous files and other, similar things which boost speed. It's only $TX,"81,125",D="DD_TEMPLEOS_LOC_OFFICIAL"$ lines of code including the kernel, the 64-bit compiler, the graphics library and all the tools. More importantly, it's designed to keep the user's line count down -- you can do a $LK,"Hello World",A="FI:::/Doc/HelloWorld.DD"$ application in one line of code and can put graphics on the screen with a three line program! + +It's a kayak, not a Titanic -- it will crash if you do something wrong. You quickly reboot, however. DOS and the 8-bit home computers of the 80's worked fine without memory protection and most computers in the world -- the embedded ones -- operate without protection. The resulting simplicity of no protections is why TempleOS has value. In facts, that's the point of TempleOS. See the $LK,"TempleOS Charter",A="FI:::/Doc/Charter.DD"$. + +Conventional thinking is "failure is not an option" for general purpose operating systems. Since this OS is used in addition to Windows or Linux, however, failure is an option -- just use Windows or Linux if you can't do something. I cherry-pick what it will and won't do, to make it maximally beautiful. The following applications more or less form a basis that spans the range of use that TempleOS is intended for: + +$LK,"/Demo/Games/BattleLines.HC",A="FI:::/Demo/Games/BattleLines.HC"$ +$LK,"/Demo/Games/BigGuns.HC",A="FI:::/Demo/Games/BigGuns.HC"$ +$LK,"/Demo/Games/BlackDiamond.HC",A="FI:::/Demo/Games/BlackDiamond.HC"$ +$LK,"/Demo/Games/BomberGolf.HC",A="FI:::/Demo/Games/BomberGolf.HC"$ +$LK,"/Demo/Games/CastleFrankenstein.HC",A="FI:::/Demo/Games/CastleFrankenstein.HC"$ +$LK,"/Demo/Games/CharDemo.HC",A="FI:::/Demo/Games/CharDemo.HC"$ +$LK,"/Demo/Games/CircleTrace.HC",A="FI:::/Demo/Games/CircleTrace.HC"$ +$LK,"/Demo/Games/Collision.HC",A="FI:::/Demo/Games/Collision.HC"$ +$LK,"/Demo/Games/Digits.HC",A="FI:::/Demo/Games/Digits.HC"$ +$LK,"/Demo/Games/DunGen.HC",A="FI:::/Demo/Games/DunGen.HC"$ +$LK,"/Demo/Games/EagleDive.HC",A="FI:::/Demo/Games/EagleDive.HC"$ +$LK,"/Demo/Games/ElephantWalk.HC",A="FI:::/Demo/Games/ElephantWalk.HC"$ +$LK,"/Demo/Games/FlapBat.HC",A="FI:::/Demo/Games/FlapBat.HC"$ +$LK,"/Demo/Games/FlatTops.HC",A="FI:::/Demo/Games/FlatTops.HC"$ +$LK,"/Demo/Games/Halogen.HC",A="FI:::/Demo/Games/Halogen.HC"$ +$LK,"/Demo/Games/MassSpring.HC",A="FI:::/Demo/Games/MassSpring.HC"$ +$LK,"/Demo/Games/Maze.HC",A="FI:::/Demo/Games/Maze.HC"$ +$LK,"/Demo/Games/RainDrops.HC",A="FI:::/Demo/Games/RainDrops.HC"$ +$LK,"/Demo/Games/RawHide.HC",A="FI:::/Demo/Games/RawHide.HC"$ +$LK,"/Demo/Games/Rocket.HC",A="FI:::/Demo/Games/Rocket.HC"$ +$LK,"/Demo/Games/RocketScience.HC",A="FI:::/Demo/Games/RocketScience.HC"$ +$LK,"/Demo/Games/Squirt.HC",A="FI:::/Demo/Games/Squirt.HC"$ +$LK,"/Demo/Games/TheDead.HC",A="FI:::/Demo/Games/TheDead.HC"$ +$LK,"/Demo/Games/TicTacToe.HC",A="FI:::/Demo/Games/TicTacToe.HC"$ +$LK,"/Demo/Games/TreeCheckers.HC",A="FI:::/Demo/Games/TreeCheckers.HC"$ +$LK,"/Demo/Games/Varoom.HC",A="FI:::/Demo/Games/Varoom.HC"$ +$LK,"/Demo/Games/Wenceslas.HC",A="FI:::/Demo/Games/Wenceslas.HC"$ +$LK,"/Demo/Games/Whap.HC",A="FI:::/Demo/Games/Whap.HC"$ +$LK,"/Demo/Games/Zing.HC",A="FI:::/Demo/Games/Zing.HC"$ +$LK,"/Demo/Games/ZoneOut.HC",A="FI:::/Demo/Games/ZoneOut.HC"$ +$LK,"/Apps/Psalmody/Examples/childish.HC",A="FI:::/Apps/Psalmody/Examples/childish.HC"$ +$LK,"/Apps/Psalmody/Examples/night.HC",A="FI:::/Apps/Psalmody/Examples/night.HC"$ +$LK,"/Apps/Psalmody/Examples/prosper.HC",A="FI:::/Apps/Psalmody/Examples/prosper.HC"$ + +Two things to know about TempleOS are that $UL,1$tasks$UL,0$ have $LK,"MAlloc",A="MN:MAlloc"$/$LK,"Free",A="MN:Free"$ heap memory, not applications, and tasks have compiler symbol tables that persist at a scope like environment variables in other operating systems, and the symbols can include functions. + +For other operating systems, I hated learning one language for command line scripts and another for programming. With $FG,2$TempleOS$FG$, the command line feeds right into the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ compiler, line by line, and it places code into memory it $LK,"MAlloc",A="MN:MAlloc"$()s. The compiler is paused at the command line, waiting for input. Naturally, you $FG,2$#include$FG$ a program to load it into memory and, usually, start it. + +During the boot process, many files get $LK,"compiled",A="FI:::/StartOS.HC"$ before you have access to the command line. (Don't worry, booting takes only two seconds.) All the header declarations for the operating system are compiled and are available for use in your programs without needing to $FG,2$#include $FG$them. Everything is truly compiled to native $FG,2$$TX,"x86_64",HTML="http://en.wikipedia.org/wiki/Amd64#AMD64"$$FG$ machine code, nothing is $FG,2$interpreted$FG$ and there is no $FG,2$byte code$FG$. + +Statements at the global scope -- outside the scope of functions -- execute immediately. There is no $FG,2$main()$FG$ function. Instead, you give meaningful names to what would be $FG,2$main()$FG$ functions and you invoke them by calling them with a statement in the global scope, usually at the bottom of your file. + +I started with $FG,2$C$FG$ syntax, but didn't like the command line for a directory listing looking like this: + +>$FG,2$Dir("*.*",FALSE); + +$FG$So, I added default args from $FG,2$C++$FG$ and it looked like this: + +>$FG,2$Dir(); + +$FG$I didn't like that, so I made parentheses optional on calls with no args and it, now, looks like this: + +>$FG,2$Dir;$FG$ + +The syntax change created an ambiguity when specifying function addresses, like for calling $LK,"QSort",A="MN:QSort"$(). To resolve it, I made a '$FG,2$&$FG$' required in front of function names when specifying an address of a function, which is better anyway. + +Once I was no longer using standard C/C++ syntax, I decided to change everything I didn't like and call it $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$. Here are the new $LK,"operator precedence",A="FF:::/Doc/HolyC.DD,operator precedence"$ rules. It's Biblical! See $LK,"Luke,5:37",A="BF:Luke,5:37"$. + +There are no object files in TempleOS and, normally, you don't make executable files either, but you can. That's known as $LK,"Ahead-of-Time",A="FF:::/Doc/Glossary.DD,AOT Compile Mode"$ compilation. Instead, you $LK,"Just in Time",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$ compile. + +Tasks have no priority and are never removed from the queue. Instead, they often poll whatever they are waiting on and swap-out. (Swapping tasks takes half a microsecond and does not involve disk activity or memory maps.) See $LK,"Scheduler",A="FL:::/Kernel/Sched.HC,1"$. Polling keeps it simple. It might be a problem if you had lots of tasks busy, which rarely happens on a home computer. The order of the tasks in the queue determines front-to-back window order. + +The $FG,2$FAT32$FG$ filesystem is supported to makes exchanging files with a dual booted other operating system easy and there is the simple, 64-bit TempleOS $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ filesystem. The $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ has allocation bitmap for clusters and all files are stored contiguously. You can't grow files. + +TempleOS is geared toward reading and writing whole files. Since whole files are processed, compression is possible. Filenames ending in "$FG,2$.Z$FG$" are automatically compressed or uncompressed when stored and fetched. TempleOS does support direct block random access into files, however -- $LK,"FRBlks",A="MN:FRBlks"$() and $LK,"FWBlks",A="MN:FWBlks"$(). + +If a file is not found, "$FG,2$.Z$FG$" is added or removed and a search is done, again. There is no $FG,2$PATH$FG$, but parent directories are searched when a file is not found. This feature is especially useful for default account files. + +The graphic resolution is poor, $FG,2$640x480 16 color$FG$, but God said it was a covenant like circumcision. Also, that's all I feel comfortable with without GPU acceleration supported. A $FG,2$1600x1200x24$FG$ bit screen takes 37 times more memory, implying 37 times the CPU power. Also, a fixed size keeps it simple with everybody machine having the same appearance. Look on the bright-side -- you won't spend as much time twiddling pixels for your game art and you'll have tons of CPU power available, especially with multicore systems. + +TempleOS is for hobbyist programmers on single user (at a time) home computers, not mainframes or servers. The focus task is all-important so symmetrical multiprocessing is almost pointless. Why does it matter running two apps at the same time twice as fast when you really want to run one faster? You could say TempleOS does master/slave multiprocessing. The anticipated use for multicore is primarily putting graphics on the screen. Hardware graphics acceleration is not used, so this is possible. See $LK,"TempleOS MultiCore",A="FI:::/Doc/MultiCore.DD"$. + +There is no distinction between the terms $FG,2$task$FG$, $FG,2$process$FG$ or $FG,2$thread$FG$. All have a task record, $LK,"CTask",A="MN:CTask"$, pointed to by the $FG,2$FS$FG$ segment reg and are accessed with $FG,4$Fs->$FG$ while $FG,4$Gs->$FG$ points to a $LK,"CCPU",A="MN:CCPU"$ for the current CPU core. Each task can have just one window, but a task can have children with windows. (The segment regs are just used as extra regs -- there is nothing segmented about TempleOS' memory.) It is approximately the case that $FG,2$TempleOS$FG$ is multi-threading, single-processing. + +In $FG,2$TempleOS$FG$, $LK,"Adam Task",A="FF:::/Doc/Glossary.DD,Adam Task"$$FG$ refers to the father of all tasks. He's never supposed to die. Since tasks inherit the symbols of parents, system-wide stuff is associated with $FG,2$Adam$FG$. His heap is like kernel memory in other operating systems. Since $FG,2$Adam$FG$ is immortal, it's safe to alloc objects, not tied to any mortal task, from $FG,2$Adam$FG$'s heap. He stays in a server mode, taking requests, so you can ask him to $FG,2$#include$FG$ something, placing that code system-wide. A funny story is that originally I called it the $FG,2$root$FG$ task and even had a $FG,2$/Root$FG$ directory :-) $FG,2$Adam$FG$ executes $LK,"::/StartOS.HC"$ at boot time. + +For easy back-ups, place everything you author in your $FG,2$/Home$FG$ directory and subdirectories. Then, use $LK,"CopyTree",A="MN:CopyTree"$(). That should make upgrading easy, too. Customizable start-up scripts go in your $FG,2$/Home$FG$ directory. The default start-up scripts are in the root directory. Copy the start-up files you wish to customize into $FG,2$/Home$FG$ and modify them. See $LK,"Home Files",A="FF:::/Doc/GuideLines.DD,/Home Files"$. You can make your own distro that includes everything and is a bootable live CD with $LK,"::/Misc/DoDistro.HC"$. + +Typically, your usage pattern through the day will be repeatedly left or right clicking on filenames in a cmd line $LK,"Dir",A="MN:Dir"$() listing. You left-click files to edit them and right-click to $FG,2$#include$FG$ them. To begin a project, type $LK,"Ed",A="MN:Ed"$("filename");, supplying a filename. You can also run programs with $FG,2$$FG$ when in the editor. $FG,2$$FG$ to save and exit the file. You'll need to do a new $LK,"Dir",A="MN:Dir"$() cmd, periodically, so make a macro on your PersonalMenu. Access your PersonalMenu by pressing $FG,2$$FG$, cursoring until you are on top of it and pressing $FG,2$$FG$. + +$FG,2$$FG$ toggles plain text mode, showing format commands, a little like viewing html code. +$FG,2$$FG$ inserts a text widgets. +$FG,2$$FG$ inserts or edit a graphic sprite resource at cursor location. +$FG,2$$FG$ brings-up the file manager. It's pretty crappy. I find I don't need it very often, believe it or not. +$FG,2$$FG$ toggles window border. + +$FG,2$$FG$ maximizes a window. +$FG,2$$FG$ closes AutoComplete. +$FG,2$$FG$ brings back AutoComplete. +$FG,2$$FG$ vertically tiles windows. +$FG,2$$FG$ horizontally tiles windows. +The $FG,2$ALT$FG$ keys are defined in $LK,"~/HomeKeyPlugIns.HC"$. You can customize them. + +$FG,2$$FG$ new terminal window. +$FG,2$$FG$ switches to the next window. +$FG,2$$FG$ kills a window. + +$LK,"Find",A="MN:Find"$() is your best friend. There's a wrapper function called $LK,"F",A="MN:F"$() in your $FG,2$~/HomeWrappers.HC.Z$FG$ file. Feel free to make wrapper functions for functions you use often and customize the args. By the way, $LK,"Find",A="MN:Find"$() or $LK,"R",A="MN:R"$() can be used to replace strings across multiple files. You can access $LK,"Find",A="MN:Find"$() using $FG,2$$FG$. + +As you browse code, use the $FG,2$AutoComplete$FG$ window to look-up functions, etc. $FG,2$$FG$ (or whatever number) to follow a sym to it's source. You can browse deeper and deeper. You go back with $FG,2$$FG$. + +Use the $LK,"Help & Index",A="FI:::/Doc/HelpIndex.DD"$ or $LK,"Demo Index",A="FI:::/Doc/DemoIndex.DD"$ to find-out what exists. Press $FG,2$$FG$ for help or use the links on your menu ($FG,2$$FG$). Also, look in the $FG,2$/Demo$FG$ or $FG,2$/Apps$FG$ directories for inspiration. + +Software is distributed as $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ ISO files. Burn a CD/DVD, or set your CD/DVD in $FG,2$QEMU$FG$, $FG,2$VMware$FG$ or $FG,2$VirtualBox$FG$ to the ISO file. Then, access the $FG,2$'T'$FG$ drive. Or, $LK,"Mount",A="MN:Mount"$() the ISO.C file and access the $FG,2$'M'$FG$ drive in TempleOS. It must be a contiguous ISO.C file, so rename it under TempleOS to ISO.C. + +Ideally, do not install applications such as games onto your hard drive because we wish to keep hard drive usage low, so the whole $FG,2$'C'$FG$ drive can be copied quickly to $FG,2$'D'$FG$. Also, the $LK,"FileMgr",A="MN:FileMgr"$() $FG,2$$FG$ starts too slowly when there are lots of hard drive files, but that is how we want it. + +3rd party libraries are banned, since they circumvent the 100,000 line of code limit in the $LK,"TempleOS Charter",A="FI:::/Doc/Charter.DD"$. All applications must only depend on the core TempleOS files and whatever they bring along in the ISO. This is similar to how Commodore 64 applications only depended on the ROM. + +Create a $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ ISO file with $LK,"RedSeaISO",A="MN:RedSeaISO"$(). Send an email to $TX,"tdavis@templeos.org",HTML="mailto:tdavis@templeos.org"$ if you want me to post a link to your TempleOS code in the App Store. + +$MA-X+PU,"Take Tour",LM="User(\"Cd(\\\"::/Misc/Tour\\\");;AutoFile(\\\"Tour\\\");\n\");"$ + +$FG,8$ +* "Linux" is a trademark owned by Linus Torvalds. +* "Windows" is a trademark owned by MicroSoft Corp. +* "Commodore 64" was a trademark owned by Commodore Business Machines. +* "QEMU" is a trademark owned by Fabrice Bellard. +* "VMware" is a trademark owned by VMware, Inc. +* "VirtualBox" is a trademark owned by Oracle. +$FG$ \ No newline at end of file diff --git a/Doc/Welcome.TXT b/Doc/Welcome.TXT deleted file mode 100644 index c948210..0000000 --- a/Doc/Welcome.TXT +++ /dev/null @@ -1,136 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"Welcome to TempleOS"$$FG$ - -TempleOS is a x86_64, multi-cored, non-preemptive multi-tasking, ring-0-only, single-address_mapped (identity-mapped), operating system for recreational programming. Paging is almost not used. - -The people whom can most benefit are: -$ID,2$* Professionals doing hobby projects -* Teenagers doing projects -* Non-professional, older-persons projects -$ID,-2$ -Simplicity is a goal to $LK,"keep the line count down",A="FI:::/Doc/Strategy.TXT"$, so it's easy to tinker with. As it turns-out, simplicity makes it faster in some ways, too. It never switches privilege levels, never changes address maps, tends to load whole contiguous files and other, similar things which boost speed. It's only $TX,"81,125",D="DD_TEMPLEOS_LOC_OFFICIAL"$ lines of code including the kernel, the 64-bit compiler, the graphics library and all the tools. More importantly, it's designed to keep the user's line count down -- you can do a $LK,"Hello World",A="FI:::/Doc/HelloWorld.TXT"$ application in one line of code and can put graphics on the screen with a three line program! - -It's a kayak, not a Titanic -- it will crash if you do something wrong. You quickly reboot, however. DOS and the 8-bit home computers of the 80's worked fine without memory protection and most computers in the world -- the embedded ones -- operate without protection. The resulting simplicity of no protections is why TempleOS has value. In facts, that's the point of TempleOS. See the $LK,"TempleOS Charter",A="FI:::/Doc/Charter.TXT"$. - -Conventional thinking is "failure is not an option" for general purpose operating systems. Since this OS is used in addition to Windows or Linux, however, failure is an option -- just use Windows or Linux if you can't do something. I cherry-pick what it will and won't do, to make it maximally beautiful. The following applications more or less form a basis that spans the range of use that TempleOS is intended for: - -$LK,"/Demo/Games/BattleLines.CPP",A="FI:::/Demo/Games/BattleLines.CPP"$ -$LK,"/Demo/Games/BigGuns.CPP",A="FI:::/Demo/Games/BigGuns.CPP"$ -$LK,"/Demo/Games/BlackDiamond.CPP",A="FI:::/Demo/Games/BlackDiamond.CPP"$ -$LK,"/Demo/Games/BomberGolf.CPP",A="FI:::/Demo/Games/BomberGolf.CPP"$ -$LK,"/Demo/Games/CastleFrankenstein.CPP",A="FI:::/Demo/Games/CastleFrankenstein.CPP"$ -$LK,"/Demo/Games/CharDemo.CPP",A="FI:::/Demo/Games/CharDemo.CPP"$ -$LK,"/Demo/Games/CircleTrace.CPP",A="FI:::/Demo/Games/CircleTrace.CPP"$ -$LK,"/Demo/Games/Collision.CPP",A="FI:::/Demo/Games/Collision.CPP"$ -$LK,"/Demo/Games/Digits.CPP",A="FI:::/Demo/Games/Digits.CPP"$ -$LK,"/Demo/Games/DunGen.CPP",A="FI:::/Demo/Games/DunGen.CPP"$ -$LK,"/Demo/Games/EagleDive.CPP",A="FI:::/Demo/Games/EagleDive.CPP"$ -$LK,"/Demo/Games/ElephantWalk.CPP",A="FI:::/Demo/Games/ElephantWalk.CPP"$ -$LK,"/Demo/Games/FlapBat.CPP",A="FI:::/Demo/Games/FlapBat.CPP"$ -$LK,"/Demo/Games/FlatTops.CPP",A="FI:::/Demo/Games/FlatTops.CPP"$ -$LK,"/Demo/Games/Halogen.CPP",A="FI:::/Demo/Games/Halogen.CPP"$ -$LK,"/Demo/Games/MassSpring.CPP",A="FI:::/Demo/Games/MassSpring.CPP"$ -$LK,"/Demo/Games/Maze.CPP",A="FI:::/Demo/Games/Maze.CPP"$ -$LK,"/Demo/Games/RainDrops.CPP",A="FI:::/Demo/Games/RainDrops.CPP"$ -$LK,"/Demo/Games/RawHide.CPP",A="FI:::/Demo/Games/RawHide.CPP"$ -$LK,"/Demo/Games/Rocket.CPP",A="FI:::/Demo/Games/Rocket.CPP"$ -$LK,"/Demo/Games/RocketScience.CPP",A="FI:::/Demo/Games/RocketScience.CPP"$ -$LK,"/Demo/Games/Squirt.CPP",A="FI:::/Demo/Games/Squirt.CPP"$ -$LK,"/Demo/Games/TheDead.CPP",A="FI:::/Demo/Games/TheDead.CPP"$ -$LK,"/Demo/Games/TicTacToe.CPP",A="FI:::/Demo/Games/TicTacToe.CPP"$ -$LK,"/Demo/Games/TreeCheckers.CPP",A="FI:::/Demo/Games/TreeCheckers.CPP"$ -$LK,"/Demo/Games/Varoom.CPP",A="FI:::/Demo/Games/Varoom.CPP"$ -$LK,"/Demo/Games/Wenceslas.CPP",A="FI:::/Demo/Games/Wenceslas.CPP"$ -$LK,"/Demo/Games/Whap.CPP",A="FI:::/Demo/Games/Whap.CPP"$ -$LK,"/Demo/Games/Zing.CPP",A="FI:::/Demo/Games/Zing.CPP"$ -$LK,"/Demo/Games/ZoneOut.CPP",A="FI:::/Demo/Games/ZoneOut.CPP"$ -$LK,"/Apps/Psalmody/Examples/childish.CPP",A="FI:::/Apps/Psalmody/Examples/childish.CPP"$ -$LK,"/Apps/Psalmody/Examples/night.CPP",A="FI:::/Apps/Psalmody/Examples/night.CPP"$ -$LK,"/Apps/Psalmody/Examples/prosper.CPP",A="FI:::/Apps/Psalmody/Examples/prosper.CPP"$ - -Two things to know about TempleOS are that $UL,1$tasks$UL,0$ have $LK,"MAlloc",A="MN:MAlloc"$/$LK,"Free",A="MN:Free"$ heap memory, not applications, and tasks have compiler symbol tables that persist at a scope like environment variables in other operating systems, and the symbols can include functions. - -For other operating systems, I hated learning one language for command line scripts and another for programming. With $FG,2$TempleOS$FG$, the command line feeds right into the $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ compiler, line by line, and it places code into memory it $LK,"MAlloc",A="MN:MAlloc"$()s. The compiler is paused at the command line, waiting for input. Naturally, you $FG,2$#include$FG$ a program to load it into memory and, usually, start it. - -During the boot process, many files get $LK,"compiled",A="FI:::/StartOS.CPP"$ before you have access to the command line. (Don't worry, booting takes only two seconds.) All the header declarations for the operating system are compiled and are available for use in your programs without needing to $FG,2$#include $FG$them. Everything is truly compiled to native $FG,2$$TX,"x86_64",HTML="http://en.wikipedia.org/wiki/Amd64#AMD64"$$FG$ machine code, nothing is $FG,2$interpreted$FG$ and there is no $FG,2$byte code$FG$. - -Statements at the global scope -- outside the scope of functions -- execute immediately. There is no $FG,2$main()$FG$ function. Instead, you give meaningful names to what would be $FG,2$main()$FG$ functions and you invoke them by calling them with a statement in the global scope, usually at the bottom of your file. - -I started with $FG,2$C$FG$ syntax, but didn't like the command line for a directory listing looking like this: - ->$FG,2$Dir("*.*",FALSE); - -$FG$So, I added default args from $FG,2$C++$FG$ and it looked like this: - ->$FG,2$Dir(); - -$FG$I didn't like that, so I made parentheses optional on calls with no args and it, now, looks like this: - ->$FG,2$Dir;$FG$ - -The syntax change created an ambiguity when specifying function addresses, like for calling $LK,"QSort",A="MN:QSort"$(). To resolve it, I made a '$FG,2$&$FG$' required in front of function names when specifying an address of a function, which is better anyway. - -Once I was no longer using standard C/C++ syntax, I decided to change everything I didn't like and call it $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$. Here are the new $LK,"operator precedence",A="FF:::/Doc/HolyC.TXT,operator precedence"$ rules. It's Biblical! See $LK,"Luke,5:37",A="BF:Luke,5:37"$. - -There are no object files in TempleOS and, normally, you don't make executable files either, but you can. That's known as $LK,"Ahead-of-Time",A="FF:::/Doc/Glossary.TXT,AOT Compile Mode"$ compilation. Instead, you $LK,"Just in Time",A="FF:::/Doc/Glossary.TXT,JIT Compile Mode"$ compile. - -Tasks have no priority and are never removed from the queue. Instead, they often poll whatever they are waiting on and swap-out. (Swapping tasks takes half a microsecond and does not involve disk activity or memory maps.) See $LK,"Scheduler",A="FL:::/Kernel/Sched.CPP,1"$. Polling keeps it simple. It might be a problem if you had lots of tasks busy, which rarely happens on a home computer. The order of the tasks in the queue determines front-to-back window order. - -The $FG,2$FAT32$FG$ filesystem is supported to makes exchanging files with a dual booted other operating system easy and there is the simple, 64-bit TempleOS $LK,"RedSea",A="FI:::/Doc/RedSea.TXT"$ filesystem. The $LK,"RedSea",A="FI:::/Doc/RedSea.TXT"$ has allocation bitmap for clusters and all files are stored contiguously. You can't grow files. - -TempleOS is geared toward reading and writing whole files. Since whole files are processed, compression is possible. Filenames ending in "$FG,2$.Z$FG$" are automatically compressed or uncompressed when stored and fetched. TempleOS does support direct block random access into files, however -- $LK,"FRBlks",A="MN:FRBlks"$() and $LK,"FWBlks",A="MN:FWBlks"$(). - -If a file is not found, "$FG,2$.Z$FG$" is added or removed and a search is done, again. There is no $FG,2$PATH$FG$, but parent directories are searched when a file is not found. This feature is especially useful for default account files. - -The graphic resolution is poor, $FG,2$640x480 16 color$FG$, but God said it was a covenant like circumcision. Also, that's all I feel comfortable with without GPU acceleration supported. A $FG,2$1600x1200x24$FG$ bit screen takes 37 times more memory, implying 37 times the CPU power. Also, a fixed size keeps it simple with everybody machine having the same appearance. Look on the bright-side -- you won't spend as much time twiddling pixels for your game art and you'll have tons of CPU power available, especially with multicore systems. - -TempleOS is for hobbyist programmers on single user (at a time) home computers, not mainframes or servers. The focus task is all-important so symmetrical multiprocessing is almost pointless. Why does it matter running two apps at the same time twice as fast when you really want to run one faster? You could say TempleOS does master/slave multiprocessing. The anticipated use for multicore is primarily putting graphics on the screen. Hardware graphics acceleration is not used, so this is possible. See $LK,"TempleOS MultiCore",A="FI:::/Doc/MultiCore.TXT"$. - -There is no distinction between the terms $FG,2$task$FG$, $FG,2$process$FG$ or $FG,2$thread$FG$. All have a task record, $LK,"CTask",A="MN:CTask"$, pointed to by the $FG,2$FS$FG$ segment reg and are accessed with $FG,4$Fs->$FG$ while $FG,4$Gs->$FG$ points to a $LK,"CCPU",A="MN:CCPU"$ for the current CPU core. Each task can have just one window, but a task can have children with windows. (The segment regs are just used as extra regs -- there is nothing segmented about TempleOS' memory.) It is approximately the case that $FG,2$TempleOS$FG$ is multi-threading, single-processing. - -In $FG,2$TempleOS$FG$, $LK,"Adam Task",A="FF:::/Doc/Glossary.TXT,Adam Task"$$FG$ refers to the father of all tasks. He's never supposed to die. Since tasks inherit the symbols of parents, system-wide stuff is associated with $FG,2$Adam$FG$. His heap is like kernel memory in other operating systems. Since $FG,2$Adam$FG$ is immortal, it's safe to alloc objects, not tied to any mortal task, from $FG,2$Adam$FG$'s heap. He stays in a server mode, taking requests, so you can ask him to $FG,2$#include$FG$ something, placing that code system-wide. A funny story is that originally I called it the $FG,2$root$FG$ task and even had a $FG,2$/Root$FG$ directory :-) $FG,2$Adam$FG$ executes $LK,"::/StartOS.CPP"$ at boot time. - -For easy back-ups, place everything you author in your $FG,2$/Home$FG$ directory and subdirectories. Then, use $LK,"CopyTree",A="MN:CopyTree"$(). That should make upgrading easy, too. Customizable start-up scripts go in your $FG,2$/Home$FG$ directory. The default start-up scripts are in the root directory. Copy the start-up files you wish to customize into $FG,2$/Home$FG$ and modify them. See $LK,"Home Files",A="FF:::/Doc/GuideLines.TXT,/Home Files"$. You can make your own distro that includes everything and is a bootable live CD with $LK,"::/Misc/DoDistro.CPP"$. - -Typically, your usage pattern through the day will be repeatedly left or right clicking on filenames in a cmd line $LK,"Dir",A="MN:Dir"$() listing. You left-click files to edit them and right-click to $FG,2$#include$FG$ them. To begin a project, type $LK,"Ed",A="MN:Ed"$("filename");, supplying a filename. You can also run programs with $FG,2$$FG$ when in the editor. $FG,2$$FG$ to save and exit the file. You'll need to do a new $LK,"Dir",A="MN:Dir"$() cmd, periodically, so make a macro on your PersonalMenu. Access your PersonalMenu by pressing $FG,2$$FG$, cursoring until you are on top of it and pressing $FG,2$$FG$. - -$FG,2$$FG$ toggles plain text mode, showing format commands, a little like viewing html code. -$FG,2$$FG$ inserts a text widgets. -$FG,2$$FG$ inserts or edit a graphic sprite resource at cursor location. -$FG,2$$FG$ brings-up the file manager. It's pretty crappy. I find I don't need it very often, believe it or not. -$FG,2$$FG$ toggles window border. - -$FG,2$$FG$ maximizes a window. -$FG,2$$FG$ closes AutoComplete. -$FG,2$$FG$ brings back AutoComplete. -$FG,2$$FG$ vertically tiles windows. -$FG,2$$FG$ horizontally tiles windows. -The $FG,2$ALT$FG$ keys are defined in $LK,"~/HomeKeyPlugIns.CPP"$. You can customize them. - -$FG,2$$FG$ new terminal window. -$FG,2$$FG$ switches to the next window. -$FG,2$$FG$ kills a window. - -$LK,"Find",A="MN:Find"$() is your best friend. There's a wrapper function called $LK,"F",A="MN:F"$() in your $FG,2$~/HomeWrappers.CPP.Z$FG$ file. Feel free to make wrapper functions for functions you use often and customize the args. By the way, $LK,"Find",A="MN:Find"$() or $LK,"R",A="MN:R"$() can be used to replace strings across multiple files. You can access $LK,"Find",A="MN:Find"$() using $FG,2$$FG$. - -As you browse code, use the $FG,2$AutoComplete$FG$ window to look-up functions, etc. $FG,2$$FG$ (or whatever number) to follow a sym to it's source. You can browse deeper and deeper. You go back with $FG,2$$FG$. - -Use the $LK,"Help & Index",A="FI:::/Doc/HelpIndex.TXT"$ or $LK,"Demo Index",A="FI:::/Doc/DemoIndex.TXT"$ to find-out what exists. Press $FG,2$$FG$ for help or use the links on your menu ($FG,2$$FG$). Also, look in the $FG,2$/Demo$FG$ or $FG,2$/Apps$FG$ directories for inspiration. - -Software is distributed as $LK,"RedSea",A="FI:::/Doc/RedSea.TXT"$ ISO files. Burn a CD/DVD, or set your CD/DVD in $FG,2$QEMU$FG$, $FG,2$VMware$FG$ or $FG,2$VirtualBox$FG$ to the ISO file. Then, access the $FG,2$'T'$FG$ drive. Or, $LK,"Mount",A="MN:Mount"$() the ISO.C file and access the $FG,2$'M'$FG$ drive in TempleOS. It must be a contiguous ISO.C file, so rename it under TempleOS to ISO.C. - -Ideally, do not install applications such as games onto your hard drive because we wish to keep hard drive usage low, so the whole $FG,2$'C'$FG$ drive can be copied quickly to $FG,2$'D'$FG$. Also, the $LK,"FileMgr",A="MN:FileMgr"$() $FG,2$$FG$ starts too slowly when there are lots of hard drive files, but that is how we want it. - -3rd party libraries are banned, since they circumvent the 100,000 line of code limit in the $LK,"TempleOS Charter",A="FI:::/Doc/Charter.TXT"$. All applications must only depend on the core TempleOS files and whatever they bring along in the ISO. This is similar to how Commodore 64 applications only depended on the ROM. - -Create a $LK,"RedSea",A="FI:::/Doc/RedSea.TXT"$ ISO file with $LK,"RedSeaISO",A="MN:RedSeaISO"$(). Send an email to $TX,"tdavis@templeos.org",HTML="mailto:tdavis@templeos.org"$ if you want me to post a link to your TempleOS code in the App Store. - -$MA-X+PU,"Take Tour",LM="User(\"Cd(\\\"::/Misc/Tour\\\");;AutoFile(\\\"Tour\\\");\n\");"$ - -$FG,8$ -* "Linux" is a trademark owned by Linus Torvalds. -* "Windows" is a trademark owned by MicroSoft Corp. -* "Commodore 64" was a trademark owned by Commodore Business Machines. -* "QEMU" is a trademark owned by Fabrice Bellard. -* "VMware" is a trademark owned by VMware, Inc. -* "VirtualBox" is a trademark owned by Oracle. -$FG$ \ No newline at end of file diff --git a/Doc/Widget.DD b/Doc/Widget.DD new file mode 100644 index 0000000..2fa9f19 --- /dev/null +++ b/Doc/Widget.DD @@ -0,0 +1,42 @@ +$WW,1$$FG,5$$TX+CX,"DolDoc Widget Help"$$FG$ + +$LK,"DolDoc",A="::/Doc/DolDocOverview.DD"$ is a TempleOS document type. + +$FG,2$"Expression"$FG$ a num or HolyC algebraic term with operators and HolyC syms can be entered. +$FG,2$"Macro"$FG$ Most entries can behave like macro entries if you assign them macro strs. +$FG,2$"AutoStr"$FG$ Like a macro except it is an $LK,"AutoFile",A="FF:::/Doc/Glossary.DD,AutoFile"$. You can't have both an autostr and macro text defined. + +$FG,5$Tag Text$FG$ is the text that will be displayed for the item. For links, you can leave it blank and the details of the link will be shown. +$FG,5$Hide$FG$ means display nothing, making an entry invisible. + +$FG,5$Left X$FG$ relative to the left margin. +$FG,5$Center X$FG$ relative to the horizontal center of the window. +$FG,5$Right X$FG$ relative to the right margin. +$FG,5$Top Y$FG$ relative to the top of the window. +$FG,5$Center Y$FG$ relative to the vertical center of the window. +$FG$$FG,5$Bottom Y$FG$ relative to the bottom of the window. + +$FG,5$Blink$FG$ make the text blink. +$FG,5$Invert$FG$ make the text inverted. +$FG,5$Underline$FG$ make the text underlined. + +$FG,5$Scroll X Length Expression$FG$ if a value is entered, the text will scroll in an area of this width. +$FG,5$Y Offset Expression$FG$ if a value is entered, the text will be shifted vertically by this many pixs, so you can make superscripts or subscripts. +$FG,5$X Offset Expression$FG$ if a value is entered, the text will be shifted horizontally by this many pixs. + +$FG,5$Tree$FG$ The item will behave like a tree widget, with this as the root. +$FG,5$Collapsed$FG$ The tree or hidden widget will begin collapsed. +$FG,5$Define Str$FG$ will substitute a $FG,2$#define$FG$ or $LK,"DefineLoad",A="MN:DefineLoad"$() string for the tag. + +$FG,5$Quote$FG$ Make the res suitable for including in a program, in quotes, especially $FG,2$fmtstr$FG$ entries in class definitions. + +$FG,5$X Expression$FG$ For cursor movements, the horizontal value. +$FG,5$Y Expression$FG$ For cursor movements, the vertical value. + +$FG,5$PopUp$FG$ For macro's, run the macro in a PopUp window. Do this when making a macro to run a program, so it doesn't tie-up memory. + +$FG,5$Escape$FG$ For macro's, send an $FG,2$$FG$ char to exit before running the macro. Without this, the macro runs in the wrong window, usually. + +$FG,5$Refresh Data$FG$ updates $FG,2$$$DA...$$$FG$ entry continuously. + +$FG,5$Html Link$FG$ stores a link which will be embedded if you generate a html version of a document with $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$. diff --git a/Doc/Widget.TXT b/Doc/Widget.TXT deleted file mode 100644 index 926773e..0000000 --- a/Doc/Widget.TXT +++ /dev/null @@ -1,42 +0,0 @@ -$WW,1$$FG,5$$TX+CX,"DolDoc Widget Help"$$FG$ - -$LK,"DolDoc",A="::/Doc/DolDocOverview.TXT"$ is a TempleOS document type. - -$FG,2$"Expression"$FG$ a num or HolyC algebraic term with operators and HolyC syms can be entered. -$FG,2$"Macro"$FG$ Most entries can behave like macro entries if you assign them macro strs. -$FG,2$"AutoStr"$FG$ Like a macro except it is an $LK,"AutoFile",A="FF:::/Doc/Glossary.TXT,AutoFile"$. You can't have both an autostr and macro text defined. - -$FG,5$Tag Text$FG$ is the text that will be displayed for the item. For links, you can leave it blank and the details of the link will be shown. -$FG,5$Hide$FG$ means display nothing, making an entry invisible. - -$FG,5$Left X$FG$ relative to the left margin. -$FG,5$Center X$FG$ relative to the horizontal center of the window. -$FG,5$Right X$FG$ relative to the right margin. -$FG,5$Top Y$FG$ relative to the top of the window. -$FG,5$Center Y$FG$ relative to the vertical center of the window. -$FG$$FG,5$Bottom Y$FG$ relative to the bottom of the window. - -$FG,5$Blink$FG$ make the text blink. -$FG,5$Invert$FG$ make the text inverted. -$FG,5$Underline$FG$ make the text underlined. - -$FG,5$Scroll X Length Expression$FG$ if a value is entered, the text will scroll in an area of this width. -$FG,5$Y Offset Expression$FG$ if a value is entered, the text will be shifted vertically by this many pixs, so you can make superscripts or subscripts. -$FG,5$X Offset Expression$FG$ if a value is entered, the text will be shifted horizontally by this many pixs. - -$FG,5$Tree$FG$ The item will behave like a tree widget, with this as the root. -$FG,5$Collapsed$FG$ The tree or hidden widget will begin collapsed. -$FG,5$Define Str$FG$ will substitute a $FG,2$#define$FG$ or $LK,"DefineLoad",A="MN:DefineLoad"$() string for the tag. - -$FG,5$Quote$FG$ Make the res suitable for including in a program, in quotes, especially $FG,2$fmtstr$FG$ entries in class definitions. - -$FG,5$X Expression$FG$ For cursor movements, the horizontal value. -$FG,5$Y Expression$FG$ For cursor movements, the vertical value. - -$FG,5$PopUp$FG$ For macro's, run the macro in a PopUp window. Do this when making a macro to run a program, so it doesn't tie-up memory. - -$FG,5$Escape$FG$ For macro's, send an $FG,2$$FG$ char to exit before running the macro. Without this, the macro runs in the wrong window, usually. - -$FG,5$Refresh Data$FG$ updates $FG,2$$$DA...$$$FG$ entry continuously. - -$FG,5$Html Link$FG$ stores a link which will be embedded if you generate a html version of a document with $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.CPP"$. diff --git a/Doc/Windows.TXT b/Doc/Windows.DD similarity index 100% rename from Doc/Windows.TXT rename to Doc/Windows.DD diff --git a/HomeKeyPlugIns.CPP b/HomeKeyPlugIns.CPP deleted file mode 100644 index 8c31d49..0000000 --- a/HomeKeyPlugIns.CPP +++ /dev/null @@ -1,202 +0,0 @@ -//Place this file in /Home and change -//anything you want. - -U0 InsTime() -{ - CDate cdt; - cdt=Now; - "$$IV,1$$----%D %T----$$IV,0$$\n",cdt,cdt; -} - -Bool MyPutKey(I64 ch,I64 sc) -{//ch=ASCII; sc=scan_code - - //See $LK,"Char",A="HI:Char"$ for definition of scan codes. - //See $LK,"Key Allocations",A="FI:::/Doc/KeyAlloc.TXT"$. - //See $LK,"Keyboard Devices",A="HI:Keyboard Devices/System"$. - - //You can customize keys. This routine - //is called before the main editor - //key handler $LK,"DocPutKey",A="MN:DocPutKey"$(). - //You can intercept any key. - - //Return TRUE if you completely - //handled the key. - I64 i; - U8 *st1,*st2; - if (sc&SCF_ALT && !(sc&SCF_CTRL)) { - switch (ch) { - case 0: - switch (sc.u8[0]) { - case SC_F1: - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /LTPURPLE"); - else - "$$LTPURPLE$$"; - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /PURPLE"); - else - "$$PURPLE$$"; - } - return TRUE; - case SC_F2: - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /LTRED"); - else - "$$LTRED$$"; - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /RED"); - else - "$$RED$$"; - } - return TRUE; - case SC_F3: - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /LTGREEN"); - else - "$$LTGREEN$$"; - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /GREEN"); - else - "$$GREEN$$"; - } - return TRUE; - case SC_F4: - if (sc&SCF_SHIFT) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /Default Color"); - else - "$$FG$$"; - } else { - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /BLUE"); - else - "$$BLUE$$"; - } - return TRUE; - case SC_F7: - if (!(sc&SCF_SHIFT)) { - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /Ins Datetime"); - else - InsTime; - } - return TRUE; - } - break; - case 'a': - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /AutoComplete On"); - else - AutoComplete(ON); - return TRUE; - case 'A': - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /AutoComplete Off"); - else - AutoComplete; - return TRUE; - case 'h': - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /Tile Horizontally"); - else - WinTileHorz; - return TRUE; - case 'm': - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /Maximize"); - else { - WinBorder; - WinMax; - } - return TRUE; - case 'v': - if (sc&SCF_KEY_DESC) - KeyDescSet("Cmd /Tile Vertically"); - else - WinTileVert; - return TRUE; - case 'l': - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/Put Link to Cur Pos on Clipboard"); - else { - ClipboardDel; - st1=FileNameAbs(BIBLE_FILENAME); - st2=FileNameAbs(DocPut->filename.name); - if (!StrCmp(st1,st2)) { - Free(st1); - st1=BibleLine2Verse(DocPut->cur_entry->y+1,','); - DocPrint(sys_clipboard_doc,"$$LK,\"BF:%s\"$$",st1); - } else - DocPrint(sys_clipboard_doc,"$$LK,\"FL:%s,%d\"$$", - st2,DocPut->cur_entry->y+1); - Free(st1); - Free(st2); - } - return TRUE; - case 'L': - if (sc&SCF_KEY_DESC) - KeyDescSet("Edit/Place Anchor, Put Link to Clipboard"); - else { - i=RandU32; - ClipboardDel; - DocPrint(sys_clipboard_doc,"$$LK,\"\",A=\"FA:%s,ANC%d\"$$", - DocPut->filename.name,i); - "$$AN,\"\",A=\"ANC%d\"$$",i; - } - return TRUE; - - //Ins your own ALT-key plug-ins - case '1': - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /ã"); - else - 'ã'; - return TRUE; - case '2': - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /é"); - else - 'é'; - return TRUE; - case '3': - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /è"); - else - 'è'; - return TRUE; - case '4': - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /ê"); - else - 'ê'; - return TRUE; - case '9': - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /Indent 5"); - else - "$$ID,5$$"; - return TRUE; - case '0': - if (sc&SCF_KEY_DESC) - KeyDescSet("Dol /Unindent 5"); - else - "$$ID,-5$$"; - return TRUE; - } - } - return FALSE; -} - -Bool MyPutS(U8 *) -{ - return FALSE; -} - -KeyDevAdd(&MyPutKey,&MyPutS,0x20000000,TRUE); diff --git a/HomeKeyPlugIns.HC b/HomeKeyPlugIns.HC new file mode 100644 index 0000000..d251a5b --- /dev/null +++ b/HomeKeyPlugIns.HC @@ -0,0 +1,202 @@ +//Place this file in /Home and change +//anything you want. + +U0 InsTime() +{ + CDate cdt; + cdt=Now; + "$$IV,1$$----%D %T----$$IV,0$$\n",cdt,cdt; +} + +Bool MyPutKey(I64 ch,I64 sc) +{//ch=ASCII; sc=scan_code + + //See $LK,"Char",A="HI:Char"$ for definition of scan codes. + //See $LK,"Key Allocations",A="FI:::/Doc/KeyAlloc.DD"$. + //See $LK,"Keyboard Devices",A="HI:Keyboard Devices/System"$. + + //You can customize keys. This routine + //is called before the main editor + //key handler $LK,"DocPutKey",A="MN:DocPutKey"$(). + //You can intercept any key. + + //Return TRUE if you completely + //handled the key. + I64 i; + U8 *st1,*st2; + if (sc&SCF_ALT && !(sc&SCF_CTRL)) { + switch (ch) { + case 0: + switch (sc.u8[0]) { + case SC_F1: + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /LTPURPLE"); + else + "$$LTPURPLE$$"; + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /PURPLE"); + else + "$$PURPLE$$"; + } + return TRUE; + case SC_F2: + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /LTRED"); + else + "$$LTRED$$"; + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /RED"); + else + "$$RED$$"; + } + return TRUE; + case SC_F3: + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /LTGREEN"); + else + "$$LTGREEN$$"; + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /GREEN"); + else + "$$GREEN$$"; + } + return TRUE; + case SC_F4: + if (sc&SCF_SHIFT) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /Default Color"); + else + "$$FG$$"; + } else { + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /BLUE"); + else + "$$BLUE$$"; + } + return TRUE; + case SC_F7: + if (!(sc&SCF_SHIFT)) { + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /Ins Datetime"); + else + InsTime; + } + return TRUE; + } + break; + case 'a': + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /AutoComplete On"); + else + AutoComplete(ON); + return TRUE; + case 'A': + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /AutoComplete Off"); + else + AutoComplete; + return TRUE; + case 'h': + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /Tile Horizontally"); + else + WinTileHorz; + return TRUE; + case 'm': + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /Maximize"); + else { + WinBorder; + WinMax; + } + return TRUE; + case 'v': + if (sc&SCF_KEY_DESC) + KeyDescSet("Cmd /Tile Vertically"); + else + WinTileVert; + return TRUE; + case 'l': + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/Put Link to Cur Pos on Clipboard"); + else { + ClipboardDel; + st1=FileNameAbs(BIBLE_FILENAME); + st2=FileNameAbs(DocPut->filename.name); + if (!StrCmp(st1,st2)) { + Free(st1); + st1=BibleLine2Verse(DocPut->cur_entry->y+1,','); + DocPrint(sys_clipboard_doc,"$$LK,\"BF:%s\"$$",st1); + } else + DocPrint(sys_clipboard_doc,"$$LK,\"FL:%s,%d\"$$", + st2,DocPut->cur_entry->y+1); + Free(st1); + Free(st2); + } + return TRUE; + case 'L': + if (sc&SCF_KEY_DESC) + KeyDescSet("Edit/Place Anchor, Put Link to Clipboard"); + else { + i=RandU32; + ClipboardDel; + DocPrint(sys_clipboard_doc,"$$LK,\"\",A=\"FA:%s,ANC%d\"$$", + DocPut->filename.name,i); + "$$AN,\"\",A=\"ANC%d\"$$",i; + } + return TRUE; + + //Ins your own ALT-key plug-ins + case '1': + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /ã"); + else + 'ã'; + return TRUE; + case '2': + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /é"); + else + 'é'; + return TRUE; + case '3': + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /è"); + else + 'è'; + return TRUE; + case '4': + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /ê"); + else + 'ê'; + return TRUE; + case '9': + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /Indent 5"); + else + "$$ID,5$$"; + return TRUE; + case '0': + if (sc&SCF_KEY_DESC) + KeyDescSet("Dol /Unindent 5"); + else + "$$ID,-5$$"; + return TRUE; + } + } + return FALSE; +} + +Bool MyPutS(U8 *) +{ + return FALSE; +} + +KeyDevAdd(&MyPutKey,&MyPutS,0x20000000,TRUE); diff --git a/HomeLocalize.CPP b/HomeLocalize.HC similarity index 100% rename from HomeLocalize.CPP rename to HomeLocalize.HC diff --git a/HomeSys.CPP b/HomeSys.CPP deleted file mode 100644 index 17b2c70..0000000 --- a/HomeSys.CPP +++ /dev/null @@ -1,38 +0,0 @@ -//Place this file in /Home and change -//anything you want. - -U0 UserStartUp() -{//Run each time a user a spawned - DocTermNew; - Type("::/Doc/Start.TXT"); - LBts(&Fs->display_flags,DISPLAYf_SHOW); - WinToTop; - WinZBufUpdate; - Dir; -} - -U0 SrvStartUp() -{//Run each time a srv task is spawned. - DocTermNew; - LBts(&Fs->display_flags,DISPLAYf_SHOW); - WinToTop; - WinZBufUpdate; -} - -U0 StartUpTasks() -{ - CTask *user1,*user2; - user1=User; - user2=User; - WinToTop(user1); - WinTileVert; - "Boot Time:%7.3fs\n",tS; - XTalk(user1,"Cd;#include \"DoOnce\";\n"); - Silent; //no output to screen - ACInit("/*;!*/Bible.TXT*"); - Silent(OFF); //no output to screen -} - -StartUpTasks; - -"\nOS Compile Time:%D %T\n",sys_compile_time,sys_compile_time; diff --git a/HomeSys.HC b/HomeSys.HC new file mode 100644 index 0000000..4134de8 --- /dev/null +++ b/HomeSys.HC @@ -0,0 +1,38 @@ +//Place this file in /Home and change +//anything you want. + +U0 UserStartUp() +{//Run each time a user a spawned + DocTermNew; + Type("::/Doc/Start.DD"); + LBts(&Fs->display_flags,DISPLAYf_SHOW); + WinToTop; + WinZBufUpdate; + Dir; +} + +U0 SrvStartUp() +{//Run each time a srv task is spawned. + DocTermNew; + LBts(&Fs->display_flags,DISPLAYf_SHOW); + WinToTop; + WinZBufUpdate; +} + +U0 StartUpTasks() +{ + CTask *user1,*user2; + user1=User; + user2=User; + WinToTop(user1); + WinTileVert; + "Boot Time:%7.3fs\n",tS; + XTalk(user1,"Cd;#include \"DoOnce\";\n"); + Silent; //no output to screen + ACInit("/*;!*/Bible.TXT*"); + Silent(OFF); //no output to screen +} + +StartUpTasks; + +"\nOS Compile Time:%D %T\n",sys_compile_time,sys_compile_time; diff --git a/HomeWrappers.CPP b/HomeWrappers.HC similarity index 100% rename from HomeWrappers.CPP rename to HomeWrappers.HC diff --git a/Kernel/BlkDev/DskATA.CPP b/Kernel/BlkDev/DskATA.HC similarity index 100% rename from Kernel/BlkDev/DskATA.CPP rename to Kernel/BlkDev/DskATA.HC diff --git a/Kernel/BlkDev/DskATAId.CPP b/Kernel/BlkDev/DskATAId.HC similarity index 100% rename from Kernel/BlkDev/DskATAId.CPP rename to Kernel/BlkDev/DskATAId.HC diff --git a/Kernel/BlkDev/DskAddDev.CPP b/Kernel/BlkDev/DskAddDev.HC similarity index 100% rename from Kernel/BlkDev/DskAddDev.CPP rename to Kernel/BlkDev/DskAddDev.HC diff --git a/Kernel/BlkDev/DskBlk.CPP b/Kernel/BlkDev/DskBlk.HC similarity index 100% rename from Kernel/BlkDev/DskBlk.CPP rename to Kernel/BlkDev/DskBlk.HC diff --git a/Kernel/BlkDev/DskBlkDev.CPP b/Kernel/BlkDev/DskBlkDev.HC similarity index 100% rename from Kernel/BlkDev/DskBlkDev.CPP rename to Kernel/BlkDev/DskBlkDev.HC diff --git a/Kernel/BlkDev/DskCDDVD.CPP b/Kernel/BlkDev/DskCDDVD.HC similarity index 100% rename from Kernel/BlkDev/DskCDDVD.CPP rename to Kernel/BlkDev/DskCDDVD.HC diff --git a/Kernel/BlkDev/DskCFile.CPP b/Kernel/BlkDev/DskCFile.HC similarity index 100% rename from Kernel/BlkDev/DskCFile.CPP rename to Kernel/BlkDev/DskCFile.HC diff --git a/Kernel/BlkDev/DskCache.CPP b/Kernel/BlkDev/DskCache.HC similarity index 100% rename from Kernel/BlkDev/DskCache.CPP rename to Kernel/BlkDev/DskCache.HC diff --git a/Kernel/BlkDev/DskCluster.CPP b/Kernel/BlkDev/DskCluster.HC similarity index 100% rename from Kernel/BlkDev/DskCluster.CPP rename to Kernel/BlkDev/DskCluster.HC diff --git a/Kernel/BlkDev/DskCopy.CPP b/Kernel/BlkDev/DskCopy.HC similarity index 100% rename from Kernel/BlkDev/DskCopy.CPP rename to Kernel/BlkDev/DskCopy.HC diff --git a/Kernel/BlkDev/DskDirA.CPP b/Kernel/BlkDev/DskDirA.CPP deleted file mode 100644 index 12edd14..0000000 --- a/Kernel/BlkDev/DskDirA.CPP +++ /dev/null @@ -1,214 +0,0 @@ -Bool DirNew(CDrv *dv,U8 *cur_dir,CDirEntry *tempde,Bool free_old_chain=TRUE) -{//Makes a directory entry in the directory from a $LK,"CDirEntry",A="MN:CDirEntry"$ node. - switch (dv->fs_type) { - case FSt_REDSEA: - return RedSeaDirNew(dv,cur_dir,tempde,free_old_chain); - case FSt_FAT32: - return FAT32DirNew(dv,cur_dir,tempde,free_old_chain); - case FSt_ISO9660: - PrintErr("Not Writable\n"); - return FALSE; - default: - PrintErr("File System Not Supported\n"); - return FALSE; - } -} - -U0 DirEntryDel(CDirEntry *tempde) -{//Free node returned from $LK,"FilesFind",A="MN:FilesFind"$(). Doesn't Free user_data. -//Does not change the directory on disk. - if (tempde) { - Free(tempde->full_name); - Free(tempde); - } -} - -U0 DirEntryDel2(CDirEntry *tempde) -{//Free node returned from $LK,"FilesFind",A="MN:FilesFind"$(). Frees user_data -//Does not change the directory on disk. - if (tempde) { - Free(tempde->full_name); - Free(tempde->user_data); - Free(tempde); - } -} - -U0 DirTreeDel(CDirEntry *tempde) -{//Free tree returned from $LK,"FilesFind",A="MN:FilesFind"$(). Doesn't Free user_data. -//Does not change the directory on disk. - CDirEntry *tempde2; - while (tempde) { - tempde2=tempde->next; - if (tempde->sub) - DirTreeDel(tempde->sub); - DirEntryDel(tempde); - tempde=tempde2; - } -} - -U0 DirTreeDel2(CDirEntry *tempde) -{//Free tree returned from $LK,"FilesFind",A="MN:FilesFind"$(). Frees user_data -//Does not change the directory on disk. - CDirEntry *tempde2; - while (tempde) { - tempde2=tempde->next; - if (tempde->sub) - DirTreeDel2(tempde->sub); - DirEntryDel2(tempde); - tempde=tempde2; - } -} - -I64 DirEntryCompareName(CDirEntry *e1,CDirEntry *e2) -{ - U8 buf1[CDIR_FILENAME_LEN],buf2[CDIR_FILENAME_LEN], - buf3[CDIR_FILENAME_LEN],buf4[CDIR_FILENAME_LEN]; - I64 d1=0,d2=0; - if (e1->attr & RS_ATTR_DIR) - d1=1; - if (e2->attr & RS_ATTR_DIR) - d2=1; - if (d1!=d2) - return d2-d1; - else { - StrCpy(buf1,e1->name); - StrCpy(buf2,e2->name); - FileExtRem(buf1,buf3); - FileExtRem(buf2,buf4); - if (d1=StrCmp(buf3,buf4)) - return d1; - return StrCmp(buf1,buf2); - } -} - -I64 DirEntryCompareCluster(CDirEntry *e1,CDirEntry *e2) -{ - return e1->cluster-e2->cluster; -} - -#define SK_NAME 0 -#define SK_CLUSTER 1 - -U0 DirFilesSort(CDirEntry **_tempde,I64 key) -{ - I64 i,cnt; - CDirEntry *tempde=*_tempde,*tempde1,**sort_buf; - if (tempde) { - cnt=LinkedLstCnt(tempde); - if (cnt>1) { - sort_buf=MAlloc(cnt*sizeof(U8 *)); - i=0; - tempde1=tempde; - while (tempde1) { - sort_buf[i++]=tempde1; - tempde1=tempde1->next; - } - switch [key] { - case SK_NAME: - QSortI64(sort_buf,cnt,&DirEntryCompareName); - break; - case SK_CLUSTER: - QSortI64(sort_buf,cnt,&DirEntryCompareCluster); - break; - } - tempde=sort_buf[0]; - *_tempde=tempde; - for (i=0;inext=sort_buf[i+1]; - } - tempde1=sort_buf[i]; - tempde1->next=NULL; - Free(sort_buf); - - tempde1=tempde; - while (tempde1) { - if (tempde1->sub) - DirFilesSort(&tempde1->sub,key); - tempde1=tempde1->next; - } - } else - if (tempde->sub) - DirFilesSort(&tempde->sub,key); - } -} - -CDirEntry *DirFilesFlatten(CDirEntry *tempde,CDirEntry **_res,I64 fuf_flags) -{//Returns last node - CDirEntry *tempde1; - Bool del; - if (tempde) - while (TRUE) { - tempde1=tempde->next; - if (!(tempde->attr&RS_ATTR_DIR)||!(fuf_flags&FUF_JUST_FILES)) { - _res=*_res=tempde; - del=FALSE; - } else - del=TRUE; - if (tempde->sub) { - _res=DirFilesFlatten(tempde->sub,_res,fuf_flags); - tempde->sub=NULL; - } - if (del) - DirEntryDel(tempde); - if (tempde1) - tempde=tempde1; - else - break; - } - *_res=NULL; - return _res; -} - -U0 PutFileLink(U8 *filename,U8 *full_name=NULL,I64 line=0,Bool plain_text=FALSE) -{//Put $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$ file,line link to StdOut, $LK,"DocPut",A="MN:DocPut"$. - U8 *st; - if (!filename) return; - if (IsRaw) { - if (line) - "%s,%04d",filename,line; - else - "%s",filename; - } else { -//LK_DOC,LK_DOC_ANCHOR,LK_DOC_FIND,LK_DOC_LINE - if (filename[0]=='A'&&filename[2]==':') { - if (line) //See $LK,"SpriteEdText",A="MN:SpriteEdText"$() - "$$LK,\"%s,%04d\",A=\"AL:%s,%d\"$$",filename+3,line,filename+3,line; - else - "$$LK,\"%s\",A=\"AI:%s\"$$",filename+3,filename+3; - } else { - if (!full_name) - full_name=st=FileNameAbs(filename); - else - st=NULL; - if (plain_text) { - if (line) - "$$LK,\"%s,%04d\",A=\"PL:%s,%d\"$$",filename,line,full_name,line; - else - "$$LK,\"%s\",A=\"PI:%s\"$$",filename,full_name; - } else { - if (line) - "$$LK,\"%s,%04d\",A=\"FL:%s,%d\"$$",filename,line,full_name,line; - else - "$$LK,\"%s\",A=\"FI:%s\"$$",filename,full_name; - } - Free(st); - } - } -} - -U0 PutDirLink(U8 *dirname,U8 *full_name=NULL) -{//Put $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$ dir macro to StdOut, $LK,"DocPut",A="MN:DocPut"$. - U8 *st; - if (!dirname) return; - if (IsRaw) - "%s",dirname; - else { - if (!full_name) - full_name=st=DirNameAbs(dirname); - else - st=NULL; - "$$MA,T=\"%s\",LM=\"Cd(\\\"%s\\\");Dir;\n\"$$",dirname,full_name; - Free(st); - } -} diff --git a/Kernel/BlkDev/DskDirA.HC b/Kernel/BlkDev/DskDirA.HC new file mode 100644 index 0000000..b4bcd8e --- /dev/null +++ b/Kernel/BlkDev/DskDirA.HC @@ -0,0 +1,214 @@ +Bool DirNew(CDrv *dv,U8 *cur_dir,CDirEntry *tempde,Bool free_old_chain=TRUE) +{//Makes a directory entry in the directory from a $LK,"CDirEntry",A="MN:CDirEntry"$ node. + switch (dv->fs_type) { + case FSt_REDSEA: + return RedSeaDirNew(dv,cur_dir,tempde,free_old_chain); + case FSt_FAT32: + return FAT32DirNew(dv,cur_dir,tempde,free_old_chain); + case FSt_ISO9660: + PrintErr("Not Writable\n"); + return FALSE; + default: + PrintErr("File System Not Supported\n"); + return FALSE; + } +} + +U0 DirEntryDel(CDirEntry *tempde) +{//Free node returned from $LK,"FilesFind",A="MN:FilesFind"$(). Doesn't Free user_data. +//Does not change the directory on disk. + if (tempde) { + Free(tempde->full_name); + Free(tempde); + } +} + +U0 DirEntryDel2(CDirEntry *tempde) +{//Free node returned from $LK,"FilesFind",A="MN:FilesFind"$(). Frees user_data +//Does not change the directory on disk. + if (tempde) { + Free(tempde->full_name); + Free(tempde->user_data); + Free(tempde); + } +} + +U0 DirTreeDel(CDirEntry *tempde) +{//Free tree returned from $LK,"FilesFind",A="MN:FilesFind"$(). Doesn't Free user_data. +//Does not change the directory on disk. + CDirEntry *tempde2; + while (tempde) { + tempde2=tempde->next; + if (tempde->sub) + DirTreeDel(tempde->sub); + DirEntryDel(tempde); + tempde=tempde2; + } +} + +U0 DirTreeDel2(CDirEntry *tempde) +{//Free tree returned from $LK,"FilesFind",A="MN:FilesFind"$(). Frees user_data +//Does not change the directory on disk. + CDirEntry *tempde2; + while (tempde) { + tempde2=tempde->next; + if (tempde->sub) + DirTreeDel2(tempde->sub); + DirEntryDel2(tempde); + tempde=tempde2; + } +} + +I64 DirEntryCompareName(CDirEntry *e1,CDirEntry *e2) +{ + U8 buf1[CDIR_FILENAME_LEN],buf2[CDIR_FILENAME_LEN], + buf3[CDIR_FILENAME_LEN],buf4[CDIR_FILENAME_LEN]; + I64 d1=0,d2=0; + if (e1->attr & RS_ATTR_DIR) + d1=1; + if (e2->attr & RS_ATTR_DIR) + d2=1; + if (d1!=d2) + return d2-d1; + else { + StrCpy(buf1,e1->name); + StrCpy(buf2,e2->name); + FileExtRem(buf1,buf3); + FileExtRem(buf2,buf4); + if (d1=StrCmp(buf3,buf4)) + return d1; + return StrCmp(buf1,buf2); + } +} + +I64 DirEntryCompareCluster(CDirEntry *e1,CDirEntry *e2) +{ + return e1->cluster-e2->cluster; +} + +#define SK_NAME 0 +#define SK_CLUSTER 1 + +U0 DirFilesSort(CDirEntry **_tempde,I64 key) +{ + I64 i,cnt; + CDirEntry *tempde=*_tempde,*tempde1,**sort_buf; + if (tempde) { + cnt=LinkedLstCnt(tempde); + if (cnt>1) { + sort_buf=MAlloc(cnt*sizeof(U8 *)); + i=0; + tempde1=tempde; + while (tempde1) { + sort_buf[i++]=tempde1; + tempde1=tempde1->next; + } + switch [key] { + case SK_NAME: + QSortI64(sort_buf,cnt,&DirEntryCompareName); + break; + case SK_CLUSTER: + QSortI64(sort_buf,cnt,&DirEntryCompareCluster); + break; + } + tempde=sort_buf[0]; + *_tempde=tempde; + for (i=0;inext=sort_buf[i+1]; + } + tempde1=sort_buf[i]; + tempde1->next=NULL; + Free(sort_buf); + + tempde1=tempde; + while (tempde1) { + if (tempde1->sub) + DirFilesSort(&tempde1->sub,key); + tempde1=tempde1->next; + } + } else + if (tempde->sub) + DirFilesSort(&tempde->sub,key); + } +} + +CDirEntry *DirFilesFlatten(CDirEntry *tempde,CDirEntry **_res,I64 fuf_flags) +{//Returns last node + CDirEntry *tempde1; + Bool del; + if (tempde) + while (TRUE) { + tempde1=tempde->next; + if (!(tempde->attr&RS_ATTR_DIR)||!(fuf_flags&FUF_JUST_FILES)) { + _res=*_res=tempde; + del=FALSE; + } else + del=TRUE; + if (tempde->sub) { + _res=DirFilesFlatten(tempde->sub,_res,fuf_flags); + tempde->sub=NULL; + } + if (del) + DirEntryDel(tempde); + if (tempde1) + tempde=tempde1; + else + break; + } + *_res=NULL; + return _res; +} + +U0 PutFileLink(U8 *filename,U8 *full_name=NULL,I64 line=0,Bool plain_text=FALSE) +{//Put $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ file,line link to StdOut, $LK,"DocPut",A="MN:DocPut"$. + U8 *st; + if (!filename) return; + if (IsRaw) { + if (line) + "%s,%04d",filename,line; + else + "%s",filename; + } else { +//LK_DOC,LK_DOC_ANCHOR,LK_DOC_FIND,LK_DOC_LINE + if (filename[0]=='A'&&filename[2]==':') { + if (line) //See $LK,"SpriteEdText",A="MN:SpriteEdText"$() + "$$LK,\"%s,%04d\",A=\"AL:%s,%d\"$$",filename+3,line,filename+3,line; + else + "$$LK,\"%s\",A=\"AI:%s\"$$",filename+3,filename+3; + } else { + if (!full_name) + full_name=st=FileNameAbs(filename); + else + st=NULL; + if (plain_text) { + if (line) + "$$LK,\"%s,%04d\",A=\"PL:%s,%d\"$$",filename,line,full_name,line; + else + "$$LK,\"%s\",A=\"PI:%s\"$$",filename,full_name; + } else { + if (line) + "$$LK,\"%s,%04d\",A=\"FL:%s,%d\"$$",filename,line,full_name,line; + else + "$$LK,\"%s\",A=\"FI:%s\"$$",filename,full_name; + } + Free(st); + } + } +} + +U0 PutDirLink(U8 *dirname,U8 *full_name=NULL) +{//Put $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ dir macro to StdOut, $LK,"DocPut",A="MN:DocPut"$. + U8 *st; + if (!dirname) return; + if (IsRaw) + "%s",dirname; + else { + if (!full_name) + full_name=st=DirNameAbs(dirname); + else + st=NULL; + "$$MA,T=\"%s\",LM=\"Cd(\\\"%s\\\");Dir;\n\"$$",dirname,full_name; + Free(st); + } +} diff --git a/Kernel/BlkDev/DskDirB.CPP b/Kernel/BlkDev/DskDirB.HC similarity index 100% rename from Kernel/BlkDev/DskDirB.CPP rename to Kernel/BlkDev/DskDirB.HC diff --git a/Kernel/BlkDev/DskDirContext.CPP b/Kernel/BlkDev/DskDirContext.HC similarity index 100% rename from Kernel/BlkDev/DskDirContext.CPP rename to Kernel/BlkDev/DskDirContext.HC diff --git a/Kernel/BlkDev/DskDrv.CPP b/Kernel/BlkDev/DskDrv.HC similarity index 100% rename from Kernel/BlkDev/DskDrv.CPP rename to Kernel/BlkDev/DskDrv.HC diff --git a/Kernel/BlkDev/DskFile.CPP b/Kernel/BlkDev/DskFile.HC similarity index 100% rename from Kernel/BlkDev/DskFile.CPP rename to Kernel/BlkDev/DskFile.HC diff --git a/Kernel/BlkDev/DskFind.CPP b/Kernel/BlkDev/DskFind.CPP deleted file mode 100644 index fbe7dcf..0000000 --- a/Kernel/BlkDev/DskFind.CPP +++ /dev/null @@ -1,162 +0,0 @@ -CDirEntry *FilesFind2(U8 *files_find_mask,I64 fuf_flags) -{ - CDrv *dv=Fs->cur_dv; - CDirEntry *res=NULL; - DrvChk(dv); - switch (dv->fs_type) { - case FSt_REDSEA: - res=RedSeaFilesFind(files_find_mask,fuf_flags); - break; - case FSt_FAT32: - res=FAT32FilesFind(files_find_mask,fuf_flags); - break; - case FSt_ISO9660: - res=ISO1FilesFind(files_find_mask,fuf_flags); - break; - default: - PrintErr("File System Not Supported\n"); - res=NULL; - } - if (res) { - DirFilesSort(&res,SK_NAME); - if (fuf_flags&(FUF_FLATTEN_TREE|FUF_JUST_FILES)) - DirFilesFlatten(res,&res,fuf_flags); - if (fuf_flags&FUF_CLUSTER_ORDER) - DirFilesSort(&res,SK_CLUSTER); - } - return res; -} - -CDirEntry *FilesFind(U8 *files_find_mask,I64 fuf_flags=0) -{/* See $LK,"::/Doc/FileUtils.TXT"$. - -Find files and make a directory tree in memory. - -When done, you free with $LK,"DirEntryDel",A="MN:DirEntryDel"$(),$LK,"DirEntryDel2",A="MN:DirEntryDel2"$(), -$LK,"DirTreeDel",A="MN:DirTreeDel"$() or $LK,"DirTreeDel2",A="MN:DirTreeDel2"$(). - -*/ - CDirEntry *res; - CDirContext *dirc; - if (fuf_flags&~FUG_FILES_FIND) - throw('FUF'); - if (fuf_flags&FUF_SINGLE) { - res=MAlloc(sizeof(CDirEntry)); - if (!FileFind(files_find_mask,res)) { - Free(res); - return NULL; - } - } else if (dirc=DirContextNew(files_find_mask,TRUE)) { - res=FilesFind2(dirc->mask,fuf_flags); - DirContextDel(dirc); - } else - return NULL; - return res; -} - -Bool FileFind(U8 *filename,CDirEntry *_de=NULL,I64 fuf_flags=0) -{//$LK,"FUF_JUST_DIRS",A="MN:FUF_JUST_DIRS"$, $LK,"FUF_JUST_FILES",A="MN:FUF_JUST_FILES"$, $LK,"FUF_Z_OR_NOT_Z",A="MN:FUF_Z_OR_NOT_Z"$, $LK,"FUF_SCAN_PARENTS",A="MN:FUF_SCAN_PARENTS"$ -//If you pass _de, you must Free(_de->full_name); - I64 i,j,cur_dir_cluster; - U8 *altname,*curname,*full_name=NULL; - CDirEntry de; - CDirContext *dirc; - Bool res=FALSE,old_silent; - if (fuf_flags&~FUG_FILE_FIND) - throw('FUF'); - if (!filename || *filename && filename[1]==':' && !Let2Drv(*filename,FALSE)) - return FALSE; - altname=ToggleZorNotZ(filename); - if (fuf_flags&FUF_Z_OR_NOT_Z) - j=2; - else - j=1; - for (i=0;idv,Fs->cur_dir); - switch (dirc->dv->fs_type) { - case FSt_REDSEA: - res=RedSeaFileFind(dirc->dv,cur_dir_cluster,dirc->mask, - &de,fuf_flags); - break; - case FSt_FAT32: - res=FAT32FileFind(dirc->dv,cur_dir_cluster,dirc->mask, - &de,fuf_flags); - break; - case FSt_ISO9660: - res=ISO1FileFind(dirc->dv,cur_dir_cluster,dirc->mask, - &de,fuf_flags); - break; - default: - PrintErr("File System Not Supported\n"); - } - if (res && _de) { - if (StrCmp(Fs->cur_dir,"/")) - full_name=MStrPrint("%C:%s/%s", - Drv2Let(Fs->cur_dv),Fs->cur_dir,de.name); - else - full_name=MStrPrint("%C:/%s",Drv2Let(Fs->cur_dv),de.name); - } - DirContextDel(dirc); - } - } - for (i=0;idv,Fs->cur_dir); - while (!res && StrCmp(Fs->cur_dir,"/")) { - Cd(".."); - cur_dir_cluster=Name2DirCluster(dirc->dv,Fs->cur_dir); - switch (dirc->dv->fs_type) { - case FSt_REDSEA: - res=RedSeaFileFind(dirc->dv,cur_dir_cluster, - dirc->mask,&de,fuf_flags); - break; - case FSt_FAT32: - res=FAT32FileFind(dirc->dv,cur_dir_cluster, - dirc->mask,&de,fuf_flags); - break; - case FSt_ISO9660: - res=ISO1FileFind(dirc->dv,cur_dir_cluster, - dirc->mask,&de,fuf_flags); - break; - default: - PrintErr("File System Not Supported\n"); - } - } - if (res && _de) { - if (StrCmp(Fs->cur_dir,"/")) - full_name=MStrPrint("%C:%s/%s", - Drv2Let(Fs->cur_dv),Fs->cur_dir,de.name); - else - full_name=MStrPrint("%C:/%s", - Drv2Let(Fs->cur_dv),de.name); - } - DirContextDel(dirc); - } - } - if (_de) { - if (res) { - MemCpy(_de,&de,sizeof(CDirEntry)); - _de->full_name=full_name; - } else - MemSet(_de,0,sizeof(CDirEntry)); - } - Free(altname); - return res; -} diff --git a/Kernel/BlkDev/DskFind.HC b/Kernel/BlkDev/DskFind.HC new file mode 100644 index 0000000..8684920 --- /dev/null +++ b/Kernel/BlkDev/DskFind.HC @@ -0,0 +1,162 @@ +CDirEntry *FilesFind2(U8 *files_find_mask,I64 fuf_flags) +{ + CDrv *dv=Fs->cur_dv; + CDirEntry *res=NULL; + DrvChk(dv); + switch (dv->fs_type) { + case FSt_REDSEA: + res=RedSeaFilesFind(files_find_mask,fuf_flags); + break; + case FSt_FAT32: + res=FAT32FilesFind(files_find_mask,fuf_flags); + break; + case FSt_ISO9660: + res=ISO1FilesFind(files_find_mask,fuf_flags); + break; + default: + PrintErr("File System Not Supported\n"); + res=NULL; + } + if (res) { + DirFilesSort(&res,SK_NAME); + if (fuf_flags&(FUF_FLATTEN_TREE|FUF_JUST_FILES)) + DirFilesFlatten(res,&res,fuf_flags); + if (fuf_flags&FUF_CLUSTER_ORDER) + DirFilesSort(&res,SK_CLUSTER); + } + return res; +} + +CDirEntry *FilesFind(U8 *files_find_mask,I64 fuf_flags=0) +{/* See $LK,"::/Doc/FileUtils.DD"$. + +Find files and make a directory tree in memory. + +When done, you free with $LK,"DirEntryDel",A="MN:DirEntryDel"$(),$LK,"DirEntryDel2",A="MN:DirEntryDel2"$(), +$LK,"DirTreeDel",A="MN:DirTreeDel"$() or $LK,"DirTreeDel2",A="MN:DirTreeDel2"$(). + +*/ + CDirEntry *res; + CDirContext *dirc; + if (fuf_flags&~FUG_FILES_FIND) + throw('FUF'); + if (fuf_flags&FUF_SINGLE) { + res=MAlloc(sizeof(CDirEntry)); + if (!FileFind(files_find_mask,res)) { + Free(res); + return NULL; + } + } else if (dirc=DirContextNew(files_find_mask,TRUE)) { + res=FilesFind2(dirc->mask,fuf_flags); + DirContextDel(dirc); + } else + return NULL; + return res; +} + +Bool FileFind(U8 *filename,CDirEntry *_de=NULL,I64 fuf_flags=0) +{//$LK,"FUF_JUST_DIRS",A="MN:FUF_JUST_DIRS"$, $LK,"FUF_JUST_FILES",A="MN:FUF_JUST_FILES"$, $LK,"FUF_Z_OR_NOT_Z",A="MN:FUF_Z_OR_NOT_Z"$, $LK,"FUF_SCAN_PARENTS",A="MN:FUF_SCAN_PARENTS"$ +//If you pass _de, you must Free(_de->full_name); + I64 i,j,cur_dir_cluster; + U8 *altname,*curname,*full_name=NULL; + CDirEntry de; + CDirContext *dirc; + Bool res=FALSE,old_silent; + if (fuf_flags&~FUG_FILE_FIND) + throw('FUF'); + if (!filename || *filename && filename[1]==':' && !Let2Drv(*filename,FALSE)) + return FALSE; + altname=ToggleZorNotZ(filename); + if (fuf_flags&FUF_Z_OR_NOT_Z) + j=2; + else + j=1; + for (i=0;idv,Fs->cur_dir); + switch (dirc->dv->fs_type) { + case FSt_REDSEA: + res=RedSeaFileFind(dirc->dv,cur_dir_cluster,dirc->mask, + &de,fuf_flags); + break; + case FSt_FAT32: + res=FAT32FileFind(dirc->dv,cur_dir_cluster,dirc->mask, + &de,fuf_flags); + break; + case FSt_ISO9660: + res=ISO1FileFind(dirc->dv,cur_dir_cluster,dirc->mask, + &de,fuf_flags); + break; + default: + PrintErr("File System Not Supported\n"); + } + if (res && _de) { + if (StrCmp(Fs->cur_dir,"/")) + full_name=MStrPrint("%C:%s/%s", + Drv2Let(Fs->cur_dv),Fs->cur_dir,de.name); + else + full_name=MStrPrint("%C:/%s",Drv2Let(Fs->cur_dv),de.name); + } + DirContextDel(dirc); + } + } + for (i=0;idv,Fs->cur_dir); + while (!res && StrCmp(Fs->cur_dir,"/")) { + Cd(".."); + cur_dir_cluster=Name2DirCluster(dirc->dv,Fs->cur_dir); + switch (dirc->dv->fs_type) { + case FSt_REDSEA: + res=RedSeaFileFind(dirc->dv,cur_dir_cluster, + dirc->mask,&de,fuf_flags); + break; + case FSt_FAT32: + res=FAT32FileFind(dirc->dv,cur_dir_cluster, + dirc->mask,&de,fuf_flags); + break; + case FSt_ISO9660: + res=ISO1FileFind(dirc->dv,cur_dir_cluster, + dirc->mask,&de,fuf_flags); + break; + default: + PrintErr("File System Not Supported\n"); + } + } + if (res && _de) { + if (StrCmp(Fs->cur_dir,"/")) + full_name=MStrPrint("%C:%s/%s", + Drv2Let(Fs->cur_dv),Fs->cur_dir,de.name); + else + full_name=MStrPrint("%C:/%s", + Drv2Let(Fs->cur_dv),de.name); + } + DirContextDel(dirc); + } + } + if (_de) { + if (res) { + MemCpy(_de,&de,sizeof(CDirEntry)); + _de->full_name=full_name; + } else + MemSet(_de,0,sizeof(CDirEntry)); + } + Free(altname); + return res; +} diff --git a/Kernel/BlkDev/DskFmt.CPP b/Kernel/BlkDev/DskFmt.HC similarity index 100% rename from Kernel/BlkDev/DskFmt.CPP rename to Kernel/BlkDev/DskFmt.HC diff --git a/Kernel/BlkDev/DskStrA.CPP b/Kernel/BlkDev/DskStrA.CPP deleted file mode 100644 index e3b1bd8..0000000 --- a/Kernel/BlkDev/DskStrA.CPP +++ /dev/null @@ -1,339 +0,0 @@ -U8 *FileExtDot(U8 *src) -{//Find dot char in name. - I64 ch; - while (ch=*src++) - if (ch=='.' && *src!='/' && *src!='.') - return src-1; - return NULL; -} - -U8 *FileExtRem(U8 *src,U8 *dst=NULL) -{//Remove filename extension from str. - U8 *ptr; - if (ptr=FileExtDot(src)) { - if (dst) - StrCpy(dst,ptr+1); - *ptr=0; - } else if (dst) - *dst=0; - return dst; -} - -Bool IsDotZ(U8 *filename) -{//Does name end in .Z? - I64 i=StrLen(filename); - if (i>6 && filename[i-1]=='Z' && filename[i-2]=='.' && filename[i-6]=='.') - return TRUE; - else - return FALSE; -} - -Bool IsDotC(U8 *filename) -{//Does name end in .C? - I64 i=StrLen(filename); - if (i>6 && filename[i-1]=='C' && filename[i-2]=='.' && filename[i-6]=='.') - return TRUE; - else - return FALSE; -} - -Bool FilesFindMatch(U8 *_test_name,U8 *files_find_mask,I64 fuf_flags=0) -{//Does filename meet $LK,"Files Find",A="FI:::/Doc/FileUtils.TXT"$ mask? - I64 tn_len=StrLen(_test_name),mask_len=StrLen(files_find_mask); - U8 *mask1=MAlloc(mask_len+1),*mask2=MAlloc(mask_len+1), - *ptr,*test_name1,*test_name2; - Bool res=FALSE; - StrCpy(mask1,files_find_mask); - if (StrOcc(_test_name,'/')) { - test_name1=MAlloc(tn_len+1); - test_name2=MAlloc(tn_len+1); - StrCpy(test_name1,_test_name); - StrLastRem(test_name1,"/",test_name2); - } else { - test_name1=NULL; - test_name2=NULL; - } - while (TRUE) { - StrFirstRem(mask1,";",mask2); - if (!test_name2 || StrOcc(mask2,'/')) - ptr=_test_name; - else - ptr=test_name2; - if (*mask2) { - if (*mask2=='!') { - if (WildMatch(ptr,mask2+1)) { - res=FALSE; - break; - } - } else { - if (WildMatch(ptr,mask2)) { - if (Bt(&fuf_flags,FUf_JUST_TXT) && - !FilesFindMatch(_test_name,FILEMASK_TXT)) { - res=FALSE; - break; - } else if (Bt(&fuf_flags,FUf_JUST_SRC) && - !FilesFindMatch(_test_name,FILEMASK_SRC)) { - res=FALSE; - break; - } else if (Bt(&fuf_flags,FUf_JUST_AOT) && - !FilesFindMatch(_test_name,FILEMASK_AOT)) { - res=FALSE; - break; - } else if (Bt(&fuf_flags,FUf_JUST_JIT) && - !FilesFindMatch(_test_name,FILEMASK_JIT)) { - res=FALSE; - break; - } else if (Bt(&fuf_flags,FUf_JUST_GRA) && - !FilesFindMatch(_test_name,FILEMASK_GRA)) { - res=FALSE; - break; - } else - res=TRUE; - } - } - } else - break; - } - Free(test_name1); - Free(test_name2); - Free(mask1); - Free(mask2); - return res; -} - -U8 *DirNameAbs(U8 *_dirname) -{//MAlloc absolute dir string with drv letter. - I64 maxlen; - U8 drv[3],*res,*buf,*buf2,*buf3,*buf4,*dirname,*free_dirname; - if (!Fs->cur_dir || !*Fs->cur_dir) - return StrNew(_dirname); - free_dirname=dirname=MStrUtil(_dirname, - SUF_REM_LEADING|SUF_REM_TRAILING|SUF_REM_CTRL_CHARS); - *drv=Drv2Let; - drv[1]=':'; - drv[2]=0; - if (*dirname && dirname[1]==':') { - if (*dirname==':') - *drv=blkdev.boot_drv_let; - else if (*dirname=='~') - *drv=*blkdev.home_dir; - else - *drv=*dirname; - dirname=dirname+2; - buf=StrNew("/"); - } else - buf=StrNew(Fs->cur_dir); - if (*dirname=='/') { - Free(buf); - buf=StrNew("/"); - dirname++; - } - buf2=StrNew(dirname); - maxlen=StrLen(buf)+1+StrLen(buf2)+1; - buf3=MAlloc(maxlen); - buf4=MAlloc(maxlen); - StrCpy(buf3,buf); - while (*buf2) { - StrFirstRem(buf2,"/",buf4); - if (!*buf4) - StrCpy(buf3,"/"); - else if (!StrCmp(buf4,"..")) { - StrLastRem(buf3,"/"); - if (!*buf3) - StrCpy(buf3,"/"); - } else if (!StrCmp(buf4,"~")) { - Free(buf3); - buf3=MAlloc(StrLen(blkdev.home_dir+2)+1+StrLen(buf2)+1); - StrCpy(buf3,blkdev.home_dir+2); - *drv=*blkdev.home_dir; - } else if (!StrCmp(buf4,".")); - else if (*buf4) { - if (StrCmp(buf3,"/")) - CatPrint(buf3,"/"); - CatPrint(buf3,buf4); - } - } - Free(buf); - res=MAlloc(StrLen(buf3)+3); - StrCpy(res,drv); - StrCpy(res+2,buf3); - Free(buf2); - Free(buf3); - Free(buf4); - Free(free_dirname); - return res; -} - -U8 *FileNameAbs(U8 *_filename,I64 fuf_flags=0) -{//Absolute filename. Accepts $LK,"FUF_Z_OR_NOT_Z",A="MN:FUF_Z_OR_NOT_Z"$, $LK,"FUF_SCAN_PARENTS",A="MN:FUF_SCAN_PARENTS"$. - U8 *res,*filename,*buf,*buf_file,*buf_dir,*free_filename,*free_buf; - CDirEntry de; - free_filename=filename=MStrUtil(_filename, - SUF_REM_LEADING|SUF_REM_TRAILING|SUF_REM_CTRL_CHARS); - free_buf=buf=StrNew(filename); - if (*buf && buf[1]==':') { - buf+=2; - filename+=2; - } - buf_file=MAlloc(StrLen(free_filename)+1); - StrLastRem(buf,"/",buf_file); - if (*filename=='/' && !*buf) - StrCpy(buf,"/"); - buf_dir=DirNameAbs(free_buf); - Free(free_buf); - res=MAlloc(StrLen(buf_dir)+1+StrLen(buf_file)+1); - StrCpy(res,buf_dir); - if (res[StrLen(res)-1]!='/') - CatPrint(res,"/"); - CatPrint(res,buf_file); - Free(buf_file); - Free(buf_dir); - Free(free_filename); - if (fuf_flags && FileFind(res,&de,fuf_flags|FUF_JUST_FILES)) { - Free(res); - res=de.full_name; - } - return res; -} - -U8 *ChgExt(U8 *filename,U8 *extension) -{//Change filename extension. - U8 *res=MAlloc(StrLen(filename)+1+StrLen(extension)+1); - StrCpy(res,filename); - if (FileExtDot(filename)) - FileExtRem(res); - return CatPrint(res,".%s",extension); -} - -U8 *DftExt(U8 *filename,U8 *extension) -{//Give extension if has none. - U8 *res=MAlloc(StrLen(filename)+1+StrLen(extension)+1); - StrCpy(res,filename); - if (!FileExtDot(filename)) - CatPrint(res,".%s",extension); - return res; -} - -CDirEntry *Cd2DirEntry(CDirEntry *tempde,U8 *abs_name) -{ - I64 i; - while (tempde) { - i=StrLen(tempde->full_name); - if (StrNCmp(tempde->full_name,abs_name,i)|| - i && tempde->full_name[i-1]!='/' && abs_name[i] && abs_name[i]!='/') - tempde=tempde->next; - else - if (StrLen(abs_name)==i) - return tempde; - else - return Cd2DirEntry(tempde->sub,abs_name); - } - return NULL; -} - -I64 FileAttr(U8 *name,I64 attr=0) -{ - if (IsDotZ(name)) - attr|=RS_ATTR_COMPRESSED; - else - attr&=~RS_ATTR_COMPRESSED; - if (IsDotC(name)) - attr|=RS_ATTR_CONTIGUOUS; - return attr; -} - -Bool FileNameChk(U8 *filename) -{//Return check for valid filename, not checking existence. - U8 *ptr=filename; - if (!filename) return FALSE; - if (!*ptr) return FALSE; - if (*ptr=='.') { - if (!ptr[1]) return TRUE; - if (ptr[1]=='.' && !ptr[2]) return TRUE; - } - if (StrLen(filename)>=CDIR_FILENAME_LEN) return FALSE; - while (*ptr) - if (!Bt(chars_bmp_filename,*ptr++)) - return FALSE; - return TRUE; -} - -U8 *ToggleZorNotZ(U8 *name) -{//MAlloc name with Z if not Z or vice versa. - U8 *res; - if (IsDotZ(name)) { - res=StrNew(name); - res[StrLen(name)-2]=0; - } else - res=MStrPrint("%s.Z",name); - return res; -} - -U8 *FileNameTempTxt() -{//Make pretty-safe temp filename in home dir. - return MStrPrint("~/SysTemp%X.TXT.Z",GetTSC>>8&0xFFFFFFFF); -} - -U8 *CurDir(CTask *task=NULL,CTask *mem_task=NULL) -{//MAlloc copy of cur dir with drv letter. - U8 *st; - if (!task) task=Fs; - if (!task->cur_dir) - return NULL; - st=MAlloc(StrLen(task->cur_dir)+3,mem_task); - *st=Drv2Let(task->cur_dv); - st[1]=':'; - StrCpy(st+2,task->cur_dir); - return st; -} - -U8 *DirFile(U8 *dirname,U8 *name=NULL,U8 *_extension=NULL) -{/*Strips file from dirname, scans for file upward until found or -returns default. - -("/Kernel/KHashA.CPP.Z",NULL,NULL) returns "D:/Kernel" -("/Kernel",NULL,"PRJ.Z") returns "D:/Kernel/Kernel.PRJ.Z" -("/Kernel/BlkDev",NULL,"PRJ.Z") returns "D:/Kernel/Kernel.PRJ.Z" -("/Apps/Psalmody","Load","CPP.Z") returns "D:/Apps/Psalmody/Load.CPP.Z" -*/ - U8 *st=DirNameAbs(dirname),*st2,*st3,*res,*dft=NULL,*ext; - if (_extension && *_extension) { - if (*_extension=='.') - ext=StrNew(_extension); - else - ext=MStrPrint(".%s",_extension); - } else - ext=StrNew(""); - while (StrOcc(st,'/')&&!IsDir(st)) - StrLastRem(st,"/"); - while (StrOcc(st,'/')) { - st2=StrNew(st); - st3=StrNew(st); - StrLastRem(st2,"/",st3); - - if (name) - res=MStrPrint("%s/%s%s",st,name,ext); - else { - if (*ext) - res=MStrPrint("%s/%s%s",st,st3,ext); - else - res=StrNew(st); - } - if (!dft) - dft=StrNew(res); - if (!*ext && (!name||!*name) || FileFind(res)) { - Free(st3); - Free(st2); - Free(st); - Free(dft); - Free(ext); - return res; - } - Free(st); - st=st2; - Free(st3); - } - Free(st); - Free(ext); - return dft; -} diff --git a/Kernel/BlkDev/DskStrA.HC b/Kernel/BlkDev/DskStrA.HC new file mode 100644 index 0000000..6ed1e7b --- /dev/null +++ b/Kernel/BlkDev/DskStrA.HC @@ -0,0 +1,339 @@ +U8 *FileExtDot(U8 *src) +{//Find dot char in name. + I64 ch; + while (ch=*src++) + if (ch=='.' && *src!='/' && *src!='.') + return src-1; + return NULL; +} + +U8 *FileExtRem(U8 *src,U8 *dst=NULL) +{//Remove filename extension from str. + U8 *ptr; + if (ptr=FileExtDot(src)) { + if (dst) + StrCpy(dst,ptr+1); + *ptr=0; + } else if (dst) + *dst=0; + return dst; +} + +Bool IsDotZ(U8 *filename) +{//Does name end in .Z? + I64 i=StrLen(filename); + if (StrOcc(filename,'.')>1 && filename[i-1]=='Z' && filename[i-2]=='.') + return TRUE; + else + return FALSE; +} + +Bool IsDotC(U8 *filename) +{//Does name end in .C? + I64 i=StrLen(filename); + if (StrOcc(filename,'.')>1 && filename[i-1]=='C' && filename[i-2]=='.') + return TRUE; + else + return FALSE; +} + +Bool FilesFindMatch(U8 *_test_name,U8 *files_find_mask,I64 fuf_flags=0) +{//Does filename meet $LK,"Files Find",A="FI:::/Doc/FileUtils.DD"$ mask? + I64 tn_len=StrLen(_test_name),mask_len=StrLen(files_find_mask); + U8 *mask1=MAlloc(mask_len+1),*mask2=MAlloc(mask_len+1), + *ptr,*test_name1,*test_name2; + Bool res=FALSE; + StrCpy(mask1,files_find_mask); + if (StrOcc(_test_name,'/')) { + test_name1=MAlloc(tn_len+1); + test_name2=MAlloc(tn_len+1); + StrCpy(test_name1,_test_name); + StrLastRem(test_name1,"/",test_name2); + } else { + test_name1=NULL; + test_name2=NULL; + } + while (TRUE) { + StrFirstRem(mask1,";",mask2); + if (!test_name2 || StrOcc(mask2,'/')) + ptr=_test_name; + else + ptr=test_name2; + if (*mask2) { + if (*mask2=='!') { + if (WildMatch(ptr,mask2+1)) { + res=FALSE; + break; + } + } else { + if (WildMatch(ptr,mask2)) { + if (Bt(&fuf_flags,FUf_JUST_TXT) && + !FilesFindMatch(_test_name,FILEMASK_TXT)) { + res=FALSE; + break; + } else if (Bt(&fuf_flags,FUf_JUST_SRC) && + !FilesFindMatch(_test_name,FILEMASK_SRC)) { + res=FALSE; + break; + } else if (Bt(&fuf_flags,FUf_JUST_AOT) && + !FilesFindMatch(_test_name,FILEMASK_AOT)) { + res=FALSE; + break; + } else if (Bt(&fuf_flags,FUf_JUST_JIT) && + !FilesFindMatch(_test_name,FILEMASK_JIT)) { + res=FALSE; + break; + } else if (Bt(&fuf_flags,FUf_JUST_GRA) && + !FilesFindMatch(_test_name,FILEMASK_GRA)) { + res=FALSE; + break; + } else + res=TRUE; + } + } + } else + break; + } + Free(test_name1); + Free(test_name2); + Free(mask1); + Free(mask2); + return res; +} + +U8 *DirNameAbs(U8 *_dirname) +{//MAlloc absolute dir string with drv letter. + I64 maxlen; + U8 drv[3],*res,*buf,*buf2,*buf3,*buf4,*dirname,*free_dirname; + if (!Fs->cur_dir || !*Fs->cur_dir) + return StrNew(_dirname); + free_dirname=dirname=MStrUtil(_dirname, + SUF_REM_LEADING|SUF_REM_TRAILING|SUF_REM_CTRL_CHARS); + *drv=Drv2Let; + drv[1]=':'; + drv[2]=0; + if (*dirname && dirname[1]==':') { + if (*dirname==':') + *drv=blkdev.boot_drv_let; + else if (*dirname=='~') + *drv=*blkdev.home_dir; + else + *drv=*dirname; + dirname=dirname+2; + buf=StrNew("/"); + } else + buf=StrNew(Fs->cur_dir); + if (*dirname=='/') { + Free(buf); + buf=StrNew("/"); + dirname++; + } + buf2=StrNew(dirname); + maxlen=StrLen(buf)+1+StrLen(buf2)+1; + buf3=MAlloc(maxlen); + buf4=MAlloc(maxlen); + StrCpy(buf3,buf); + while (*buf2) { + StrFirstRem(buf2,"/",buf4); + if (!*buf4) + StrCpy(buf3,"/"); + else if (!StrCmp(buf4,"..")) { + StrLastRem(buf3,"/"); + if (!*buf3) + StrCpy(buf3,"/"); + } else if (!StrCmp(buf4,"~")) { + Free(buf3); + buf3=MAlloc(StrLen(blkdev.home_dir+2)+1+StrLen(buf2)+1); + StrCpy(buf3,blkdev.home_dir+2); + *drv=*blkdev.home_dir; + } else if (!StrCmp(buf4,".")); + else if (*buf4) { + if (StrCmp(buf3,"/")) + CatPrint(buf3,"/"); + CatPrint(buf3,buf4); + } + } + Free(buf); + res=MAlloc(StrLen(buf3)+3); + StrCpy(res,drv); + StrCpy(res+2,buf3); + Free(buf2); + Free(buf3); + Free(buf4); + Free(free_dirname); + return res; +} + +U8 *FileNameAbs(U8 *_filename,I64 fuf_flags=0) +{//Absolute filename. Accepts $LK,"FUF_Z_OR_NOT_Z",A="MN:FUF_Z_OR_NOT_Z"$, $LK,"FUF_SCAN_PARENTS",A="MN:FUF_SCAN_PARENTS"$. + U8 *res,*filename,*buf,*buf_file,*buf_dir,*free_filename,*free_buf; + CDirEntry de; + free_filename=filename=MStrUtil(_filename, + SUF_REM_LEADING|SUF_REM_TRAILING|SUF_REM_CTRL_CHARS); + free_buf=buf=StrNew(filename); + if (*buf && buf[1]==':') { + buf+=2; + filename+=2; + } + buf_file=MAlloc(StrLen(free_filename)+1); + StrLastRem(buf,"/",buf_file); + if (*filename=='/' && !*buf) + StrCpy(buf,"/"); + buf_dir=DirNameAbs(free_buf); + Free(free_buf); + res=MAlloc(StrLen(buf_dir)+1+StrLen(buf_file)+1); + StrCpy(res,buf_dir); + if (res[StrLen(res)-1]!='/') + CatPrint(res,"/"); + CatPrint(res,buf_file); + Free(buf_file); + Free(buf_dir); + Free(free_filename); + if (fuf_flags && FileFind(res,&de,fuf_flags|FUF_JUST_FILES)) { + Free(res); + res=de.full_name; + } + return res; +} + +U8 *ChgExt(U8 *filename,U8 *extension) +{//Change filename extension. + U8 *res=MAlloc(StrLen(filename)+1+StrLen(extension)+1); + StrCpy(res,filename); + if (FileExtDot(filename)) + FileExtRem(res); + return CatPrint(res,".%s",extension); +} + +U8 *DftExt(U8 *filename,U8 *extension) +{//Give extension if has none. + U8 *res=MAlloc(StrLen(filename)+1+StrLen(extension)+1); + StrCpy(res,filename); + if (!FileExtDot(filename)) + CatPrint(res,".%s",extension); + return res; +} + +CDirEntry *Cd2DirEntry(CDirEntry *tempde,U8 *abs_name) +{ + I64 i; + while (tempde) { + i=StrLen(tempde->full_name); + if (StrNCmp(tempde->full_name,abs_name,i)|| + i && tempde->full_name[i-1]!='/' && abs_name[i] && abs_name[i]!='/') + tempde=tempde->next; + else + if (StrLen(abs_name)==i) + return tempde; + else + return Cd2DirEntry(tempde->sub,abs_name); + } + return NULL; +} + +I64 FileAttr(U8 *name,I64 attr=0) +{ + if (IsDotZ(name)) + attr|=RS_ATTR_COMPRESSED; + else + attr&=~RS_ATTR_COMPRESSED; + if (IsDotC(name)) + attr|=RS_ATTR_CONTIGUOUS; + return attr; +} + +Bool FileNameChk(U8 *filename) +{//Return check for valid filename, not checking existence. + U8 *ptr=filename; + if (!filename) return FALSE; + if (!*ptr) return FALSE; + if (*ptr=='.') { + if (!ptr[1]) return TRUE; + if (ptr[1]=='.' && !ptr[2]) return TRUE; + } + if (StrLen(filename)>=CDIR_FILENAME_LEN) return FALSE; + while (*ptr) + if (!Bt(chars_bmp_filename,*ptr++)) + return FALSE; + return TRUE; +} + +U8 *ToggleZorNotZ(U8 *name) +{//MAlloc name with Z if not Z or vice versa. + U8 *res; + if (IsDotZ(name)) { + res=StrNew(name); + res[StrLen(name)-2]=0; + } else + res=MStrPrint("%s.Z",name); + return res; +} + +U8 *FileNameTempTxt() +{//Make pretty-safe temp filename in home dir. + return MStrPrint("~/SysTemp%X.DD.Z",GetTSC>>8&0xFFFFFFFF); +} + +U8 *CurDir(CTask *task=NULL,CTask *mem_task=NULL) +{//MAlloc copy of cur dir with drv letter. + U8 *st; + if (!task) task=Fs; + if (!task->cur_dir) + return NULL; + st=MAlloc(StrLen(task->cur_dir)+3,mem_task); + *st=Drv2Let(task->cur_dv); + st[1]=':'; + StrCpy(st+2,task->cur_dir); + return st; +} + +U8 *DirFile(U8 *dirname,U8 *name=NULL,U8 *_extension=NULL) +{/*Strips file from dirname, scans for file upward until found or +returns default. + +("/Kernel/KHashA.HC.Z",NULL,NULL) returns "D:/Kernel" +("/Kernel",NULL,"PRJ.Z") returns "D:/Kernel/Kernel.PRJ.Z" +("/Kernel/BlkDev",NULL,"PRJ.Z") returns "D:/Kernel/Kernel.PRJ.Z" +("/Apps/Psalmody","Load","HC.Z") returns "D:/Apps/Psalmody/Load.HC.Z" +*/ + U8 *st=DirNameAbs(dirname),*st2,*st3,*res,*dft=NULL,*ext; + if (_extension && *_extension) { + if (*_extension=='.') + ext=StrNew(_extension); + else + ext=MStrPrint(".%s",_extension); + } else + ext=StrNew(""); + while (StrOcc(st,'/')&&!IsDir(st)) + StrLastRem(st,"/"); + while (StrOcc(st,'/')) { + st2=StrNew(st); + st3=StrNew(st); + StrLastRem(st2,"/",st3); + + if (name) + res=MStrPrint("%s/%s%s",st,name,ext); + else { + if (*ext) + res=MStrPrint("%s/%s%s",st,st3,ext); + else + res=StrNew(st); + } + if (!dft) + dft=StrNew(res); + if (!*ext && (!name||!*name) || FileFind(res)) { + Free(st3); + Free(st2); + Free(st); + Free(dft); + Free(ext); + return res; + } + Free(st); + st=st2; + Free(st3); + } + Free(st); + Free(ext); + return dft; +} diff --git a/Kernel/BlkDev/DskStrB.CPP b/Kernel/BlkDev/DskStrB.HC similarity index 100% rename from Kernel/BlkDev/DskStrB.CPP rename to Kernel/BlkDev/DskStrB.HC diff --git a/Kernel/BlkDev/FileSysFAT.CPP b/Kernel/BlkDev/FileSysFAT.CPP deleted file mode 100644 index 274200d..0000000 --- a/Kernel/BlkDev/FileSysFAT.CPP +++ /dev/null @@ -1,973 +0,0 @@ -U0 CDate2Dos(U16 *t,U16 *d,CDate cdt) -{ - CDateStruct ds; - Date2Struct(&ds,cdt); - *d=ds.day_of_mon+(ds.mon+(ds.year-1980)<<4)<<5; - *t=ds.sec>>1+(ds.min+ds.hour<<6)<<5; -} - -CDate Dos2CDate(U16 t,U16 d) -{ - CDateStruct ds; - MemSet(&ds,0,sizeof(CDateStruct)); - ds.day_of_mon=d&0x1F; d=d>>5; - ds.mon=d&0xF; - ds.year=d>>4+1980; - ds.sec=(t&0x1F)*2; t=t>>5; - ds.min=t&0x3F; - ds.hour=t>>6; - return Struct2Date(&ds); -} - -U0 FAT32DrvInit(CDrv *dv) -{ - CFAT32Boot br32; - Bool unlock; - try { - unlock=DrvLock(dv); - dv->fs_type=FSt_FAT32; - RBlks(dv,&br32,dv->drv_offset,1); - dv->file_system_info_sect=dv->drv_offset+br32.file_system_info_sect; - dv->fat1=dv->drv_offset+br32.reserved_sects; - dv->fat2=dv->fat1+br32.sects_per_fat; - dv->data_area=dv->fat2+br32.sects_per_fat - -2*br32.sects_per_cluster; //Starts at Cluster 2 - dv->spc=br32.sects_per_cluster; - dv->root_cluster=br32.root_cluster; - DrvFATBlkAlloc(dv); - Free(dv->fis); - dv->fis=AMAlloc(BLK_SIZE); - RBlks(dv,dv->fis,dv->file_system_info_sect,1); - if (unlock) - DrvUnlock(dv); - } catch - if (unlock) - DrvUnlock(dv); -} - -Bool FAT32DrvValidate(U8 drv_let) -{ - CDrv *dv; - CFAT32Boot br; - if ((dv=Let2Drv(drv_let,FALSE)) && dv->fs_type==FSt_FAT32 && - RBlks(dv,&br,dv->drv_offset,1) && br.signature==0xAA55 && - br.sects==dv->size) - return TRUE; - else - return FALSE; -} - -U0 FAT32Fmt(U8 drv_let,Bool quick=TRUE) -{ - CFAT32Boot *br=CAlloc(BLK_SIZE); - CFAT32FileInfoSect *fis=CAlloc(BLK_SIZE); - CDrv *dv=Let2Drv(drv_let); - I64 i,l; - try { - DrvLock(dv); - DrvTypeSet(drv_let,FSt_FAT32); - dv->fs_type=FSt_FAT32; - br->jump_and_nop[0]=OC_JMP_REL8; - br->jump_and_nop[1]=offset(CFAT32Boot.code)-2; - br->jump_and_nop[2]=OC_NOP; - br->oem_name[0](I64)='MSWIN4.1'; - br->bytes_per_sect=BLK_SIZE; - if (dv->size<= 500000) - br->sects_per_cluster=1; - else if (dv->size<=2000000) - br->sects_per_cluster=2; - else if (dv->size<=6000000) - br->sects_per_cluster=4; - else if (dv->size<=12000000) - br->sects_per_cluster=8; - else if (dv->size<=33000000) - br->sects_per_cluster=16; - else if (dv->size<=67000000) - br->sects_per_cluster=32; - else - br->sects_per_cluster=64; - - br->reserved_sects=32; - br->copies_of_fat=2; - br->media_desc=0xF8; - br->sects=dv->size; - l=(br->sects/br->sects_per_cluster)>>(BLK_SIZE_BITS-2)+1; - br->sects_per_fat=l; - br->root_cluster=2; - br->file_system_info_sect=1; - br->log_drv_num=0x80; - br->ext_signature=0x29; - br->serial_num=RandU32; - MemCpy(br->vol_name,"NO NAME ",11); - br->fat_name[0](I64)='FAT32 '; - br->signature=0xAA55; - fis->signature1='RRaA'; - fis->signature2='rrAa'; - fis->free_clusters=-1; - fis->most_recently_alloced=0; - fis->signature3=0xAA550000; - - if (quick) - i=br->reserved_sects+2*l+4*br->sects_per_cluster; - else - i=dv->size; - WZeroBlks(dv,dv->drv_offset,i); - - WBlks(dv,fis,dv->drv_offset+br->file_system_info_sect,1); - WBlks(dv,br,dv->drv_offset,1); - FAT32DrvInit(dv); - ClustersAlloc(dv,0,1,FALSE); //Alloc #1 - br->root_cluster=ClustersAlloc(dv,0,1,FALSE); - WBlks(dv,br,dv->drv_offset,1); - FAT32DrvInit(dv); - DrvUnlock(dv); - } catch - DrvUnlock(dv); - Free(br); - Free(fis); -} - -Bool FATNameTo(U8 *dst,U8 *src) -{ - I64 i; - MemSet(dst,CH_SPACE,11); - if (!FileNameChk(src)) - return FALSE; - if (!StrCmp(src,"..")) { - *dst='.'; - dst[1]='.'; - return TRUE; - } else if (!StrCmp(src,".")) { - *dst='.'; - return TRUE; - } - i=0; - while (i<8 && *src && *src!='.') - dst[i++]=ToUpper(*src++); - i=8; - if (*src=='.') src++; - while (*src) - if (*src!='.') - dst[i++]=ToUpper(*src++); - else - src++; - return TRUE; -} - -I64 FATNameXSum(U8 *src) -{ - I64 i,res=0; - for (i=0;i<11;i++) - if (res&1) - res.u8[0]=0x80+res>>1+*src++; - else - res.u8[0]=res>>1+*src++; - return res; -} - -Bool FATFromName(U8 *dst,U8 *src) -{ - I64 i,j,k=0; - for (j=7;j>=0 && src[j]==CH_SPACE;j--); - for(i=0;i<=j;i++) - dst[k++]=src[i]; - for (j=10;j>=8 && src[j]==CH_SPACE;j--); - if (*src!='.' && j!=7) - dst[k++]='.'; - for(i=8;i<=j;i++) - dst[k++]=src[i]; - dst[k++]=0; - return FileNameChk(dst); -} - -U8 fat_long_name_map[13]={ - offset(CFAT32DirEntryLong.name1), - offset(CFAT32DirEntryLong.name1)+2, - offset(CFAT32DirEntryLong.name1)+4, - offset(CFAT32DirEntryLong.name1)+6, - offset(CFAT32DirEntryLong.name1)+8, - offset(CFAT32DirEntryLong.name2), - offset(CFAT32DirEntryLong.name2)+2, - offset(CFAT32DirEntryLong.name2)+4, - offset(CFAT32DirEntryLong.name2)+6, - offset(CFAT32DirEntryLong.name2)+8, - offset(CFAT32DirEntryLong.name2)+10, - offset(CFAT32DirEntryLong.name3), - offset(CFAT32DirEntryLong.name3)+2 -}; - -Bool DirLongNameFill(CDirEntry *tempde,CFAT32DirEntryLong *de,I64 *xsum) -{ - I64 i; - U8 *ptr=de; - if (de->ord&0x40) { - MemSet(tempde,0,sizeof(CDirEntry)); - *xsum=de->xsum; - } else if (de->type || de->zero || de->xsum!=*xsum) { - MemSet(tempde,0,sizeof(CDirEntry)); - *xsum=0; - return FALSE; - } - switch (de->ord&0x3F) { - case 1: - for (i=0;i<13;i++) - if (!(tempde->name[i]=ptr[fat_long_name_map[i]])) - return TRUE; - break; - case 2: - for (i=0;i<12;i++) - if (!(tempde->name[i+13]=ptr[fat_long_name_map[i]])) - return TRUE; - break; - } - return TRUE; -} - -Bool FAT32CDirFill(CDirEntry *tempde, - CFAT32DirEntry *de,CDate _local_time_offset) -{ - Bool res; - if (*tempde->name) - res=TRUE; - else - res=FATFromName(tempde->name,de->name); - tempde->cluster=de->cluster_lo+de->cluster_hi<<16; - tempde->size=de->size; - tempde->attr=de->attr; - tempde->datetime=Dos2CDate(de->WrtTime,de->WrtDate)-_local_time_offset; - return res; -} - -Bool FAT32DirFill(CFAT32DirEntry *de, - CDirEntry *tempde,I64 *_de_cnt,CDate _local_time_offset) -{//Fill up to 3 entries and store cnt of entries. - I64 de_cnt=0,i,l,xsum,ord; - U8 *ptr,dname[16]; - CFAT32DirEntryLong *ld=de; - Bool res; - - MemSet(de,0,sizeof(CFAT32DirEntry)); - res=FATNameTo(de->name,tempde->name); - FATFromName(dname,de->name); - if (StrCmp(dname,tempde->name)) { - ord=0x41; - xsum=FATNameXSum(de->name); - if ((l=StrLen(tempde->name))>13) { - ptr=&ld[de_cnt]; - MemSet(ptr,0,sizeof(CFAT32DirEntryLong)); - ld[de_cnt].attr=RS_ATTR_LONG_NAME; - ld[de_cnt].xsum=xsum; - ld[de_cnt].ord=0x42; - for (i=13;iname[i]; - i++; - for (;i<26;i++) - ptr[fat_long_name_map[i-13]](U16)=0xFFFF; - ord=1; - l=13; - de_cnt++; - } - ptr=&de[de_cnt]; - MemSet(ptr,0,sizeof(CFAT32DirEntryLong)); - ld[de_cnt].attr=RS_ATTR_LONG_NAME; - ld[de_cnt].xsum=xsum; - ld[de_cnt].ord=ord; - for (i=0;iname[i]; - i++; - for (;i<13;i++) - ptr[fat_long_name_map[i]](U16)=0xFFFF; - de_cnt++; - MemSet(&de[de_cnt],0,sizeof(CFAT32DirEntry)); - res=FATNameTo(de[de_cnt].name,tempde->name); - } - de[de_cnt].cluster_lo=tempde->cluster.u16[0]; - de[de_cnt].cluster_hi=tempde->cluster.u16[1]; - if (!(tempde->attr&RS_ATTR_DIR)) - de[de_cnt].size=tempde->size; - de[de_cnt].attr=tempde->attr; - if (!tempde->datetime) - tempde->datetime=Now; - CDate2Dos(&de[de_cnt].WrtTime,&de[de_cnt].WrtDate, - tempde->datetime+_local_time_offset); - if (_de_cnt) - *_de_cnt=de_cnt+1; - return res; -} - -Bool FAT32FileFind(CDrv *dv,I64 cur_dir_cluster, - U8 *name,CDirEntry *_res,I64 fuf_flags=0) -{//$LK,"FUF_JUST_DIRS",A="MN:FUF_JUST_DIRS"$, $LK,"FUF_JUST_FILES",A="MN:FUF_JUST_FILES"$ - Bool res=FALSE,unlock; - CFAT32DirEntry *buf; - I64 xsum=0,attr,cur_dir_entry,entries_per_cluster; - U8 dname[CDIR_FILENAME_LEN],ch; - CDirEntry long_name; - if (fuf_flags&~FUG_FILE_FIND) - throw('FUF'); - MemSet(_res,0,sizeof(CDirEntry)); - MemSet(&long_name,0,sizeof(CDirEntry)); - DrvChk(dv); - if (dv->fs_type!=FSt_FAT32) - PrintErr("Not FAT32 Drv\n"); - else if (!CFileNameTo(dname,name)) - PrintErr("Invalid FileName.\n"); - else - try { - unlock=DrvLock(dv); - buf=MAlloc(BLK_SIZE*dv->spc); - entries_per_cluster=dv->spc<fat32_local_time_offset) && - !StrCmp(dname,_res->name)) { - res=TRUE; - goto fff_done; - } - } - MemSet(&long_name,0,sizeof(CDirEntry)); - } - } else - MemSet(&long_name,0,sizeof(CDirEntry)); - if (++cur_dir_entry==entries_per_cluster) { - cur_dir_cluster=ClusterNumNext(dv,cur_dir_cluster); - if (!(0fs_type!=FSt_FAT32) - PrintErr("Not FAT32 Drv\n"); - else - try { - DrvLock(dv); - cur_dir_cluster=Name2DirCluster(dv,cur_dir); - if (FAT32FileFind(dv,cur_dir_cluster,filename,&de,FUF_JUST_FILES)) { - blk_cnt=(de.size+BLK_SIZE-1)>>BLK_SIZE_BITS; - buf=MAlloc(blk_cnt<cur_dv->fs_type!=FSt_FAT32) - PrintErr("Not FAT32 Drv\n"); - else if (FAT32FileFind(Fs->cur_dv,cur_dir_cluster,name,&de,FUF_JUST_DIRS)) - return TRUE; - else { - "%s ",name; - PrintErr("File not found.\n"); - } - return FALSE; -} - -U0 FAT32FreeClusters(CDrv *dv,I64 c) -{ - I64 next,saved_c=c; - Bool unlock,unlock_break; - DrvChk(dv); - if (!(0fs_type!=FSt_FAT32) - PrintErr("Not FAT32 Drv\n"); - else - try { - unlock_break=BreakLock; - unlock=DrvLock(dv); - DrvFATBlkClean(dv); - do { - DrvFATBlkSet(dv,c,0); - next=dv->cur_fat_blk[c&(BLK_SIZE/4-1)]; - dv->cur_fat_blk[c&(BLK_SIZE/4-1)]=0; - LBts(&dv->fat_blk_dirty,0); - c=next; - } while (0cur_fat_blk[c&(BLK_SIZE/4-1)]; - dv->cur_fat_blk[c&(BLK_SIZE/4-1)]=0; - LBts(&dv->fat_blk_dirty,0); - c=next; - } while (0size+dv->drv_offset-dv->data_area)/dv->spc-1; - j=dv->fis->most_recently_alloced; - while (cnt-->0) { - while (TRUE) { - j++; - if (j<1) j=1; - if (j>=l) { - if (wrap_around) - throw('Drv'); - j=1; - wrap_around=TRUE; - } - DrvFATBlkSet(dv,j); - if (!dv->cur_fat_blk[j&(BLK_SIZE/4-1)]) - break; - } - if (!(0cur_fat_blk[c&(BLK_SIZE/4-1)]=j; - LBts(&dv->fat_blk_dirty,0); - } - c=j; - } - - if (0cur_fat_blk[c&(BLK_SIZE/4-1)]=0x0FFFFFFF; - LBts(&dv->fat_blk_dirty,0); - } - DrvFATBlkClean(dv); - - dv->fis->most_recently_alloced=j; - dv->fis->free_clusters=-1; - WBlks(dv,dv->fis,dv->file_system_info_sect,1); - } catch { - if (unlock) - DrvUnlock(dv); - if (unlock_break) - BreakUnlock; - } - if (unlock) - DrvUnlock(dv); - if (unlock_break) - BreakUnlock; - return first; -} - -I64 FAT32AllocContiguousClusters(CDrv *dv,I64 cnt) -{ - I64 i,first=1; - Bool cont,unlock,unlock_break; - - if (cnt<=0) return 0x0FFFFFFF; - try { - unlock_break=BreakLock; - unlock=DrvLock(dv); - while (TRUE) { - first++; - i=0; - cont=TRUE; - while (cont && ispc+dv->data_area>dv->size+dv->drv_offset) - throw('Drv'); - DrvFATBlkSet(dv,first+i); - if (dv->cur_fat_blk[(first+i)&(BLK_SIZE/4-1)]) - cont=FALSE; - else - i++; - } - if (!cont) - first=first+i; - else { - DrvFATBlkClean(dv); - - for (i=0;icur_fat_blk[(first+i)&(BLK_SIZE/4-1)]=0x0FFFFFFF; - else - dv->cur_fat_blk[(first+i)&(BLK_SIZE/4-1)]=first+i+1; - LBts(&dv->fat_blk_dirty,0); - } - DrvFATBlkClean(dv,0); - - for (i=0;icur_fat_blk[(first+i)&(BLK_SIZE/4-1)]=0x0FFFFFFF; - else - dv->cur_fat_blk[(first+i)&(BLK_SIZE/4-1)]=first+i+1; - LBts(&dv->fat_blk_dirty,0); - } - DrvFATBlkClean(dv,1); - break; - } - } - } catch { - if (unlock) - DrvUnlock(dv); - if (unlock_break) - BreakUnlock; - } - if (unlock) - DrvUnlock(dv); - if (unlock_break) - BreakUnlock; - return first; -} - -Bool FAT32DirNew(CDrv *dv,U8 *cur_dir,CDirEntry *tempde,Bool free_old_chain) -{ -//See $LK,"::/Doc/CutCorners.TXT"$. - CFAT32DirEntry *buf,*last_buf,*temp_buf,de[3]; - I64 i,attr,avail_cnt,de_cnt,c, - cur_dir_entry,entries_per_cluster, - cur_dir_cluster,xsum=0,last_dir_cluster=INVALID_CLUSTER; - U8 ch; - Bool written=FALSE,unlock,unlock_break; - CDirEntry long_name; - FAT32DirFill(&de,tempde,&de_cnt,dv->fat32_local_time_offset); - MemSet(&long_name,0,sizeof(CDirEntry)); - try { - unlock_break=BreakLock; - unlock=DrvLock(dv); - cur_dir_cluster=Name2DirCluster(dv,cur_dir); - buf =MAlloc(BLK_SIZE*dv->spc); - last_buf=CAlloc(BLK_SIZE*dv->spc); - entries_per_cluster=dv->spc<=de_cnt) { - MemCpy(&buf[cur_dir_entry],&de,de_cnt*sizeof(CFAT32DirEntry)); - WBlks(dv,&buf[cur_dir_entry & -FAT32_ENTRIES_PER_BLK], - dv->data_area+cur_dir_cluster*dv->spc - +cur_dir_entry>>FAT32_ENTRIES_BITS,1); - cur_dir_entry+=de_cnt-1; //gets inc'ed - written=TRUE; - } else if (ch!=0xE5 && !(attr&RS_ATTR_VOL_ID)) { - if (xsum!=FATNameXSum(buf[cur_dir_entry].name)) - MemSet(&long_name,0,sizeof(CDirEntry)); - if (!*long_name.name) - FATFromName(long_name.name,buf[cur_dir_entry].name); -//Del old entry with same name - if (!StrCmp(long_name.name,tempde->name)) { - if (free_old_chain) - FAT32FreeClusters(dv,buf[cur_dir_entry].cluster_lo+ - buf[cur_dir_entry].cluster_hi<<16); - if (!written) { - MemCpy(&buf[cur_dir_entry],&de[de_cnt-1],sizeof(CFAT32DirEntry)); - WBlks(dv,&buf[cur_dir_entry & -FAT32_ENTRIES_PER_BLK], - dv->data_area+cur_dir_cluster*dv->spc - +cur_dir_entry>>FAT32_ENTRIES_BITS,1); - written=TRUE; - } else { - *buf[cur_dir_entry].name=0xE5; - i=1; - while (i<=cur_dir_entry && - buf[cur_dir_entry-i].attr&RS_ATTR_LONG_NAME_MASK - ==RS_ATTR_LONG_NAME) - *buf[cur_dir_entry-i++].name=0xE5; - i--; - WBlks(dv,&buf[(cur_dir_entry-i)&-FAT32_ENTRIES_PER_BLK], - dv->data_area+cur_dir_cluster*dv->spc - +(cur_dir_entry-i)>>FAT32_ENTRIES_BITS, - (i+FAT32_ENTRIES_PER_BLK)>>FAT32_ENTRIES_BITS); - if (i==cur_dir_entry && 00) - WBlks(dv,&buf[(entries_per_cluster-i)&-FAT32_ENTRIES_PER_BLK], - dv->data_area+last_dir_cluster*dv->spc - +(entries_per_cluster-i)>>FAT32_ENTRIES_BITS, - (i+FAT32_ENTRIES_PER_BLK-1)>>FAT32_ENTRIES_BITS); - } - } - break; - } - } - MemSet(&long_name,0,sizeof(CDirEntry)); - } - if (++cur_dir_entry==entries_per_cluster) { - last_dir_cluster=cur_dir_cluster; - temp_buf=buf; buf=last_buf; last_buf=temp_buf; - c=ClusterNumNext(dv,cur_dir_cluster); - if (!(0spc); - WClusters(dv,buf,c,1); - } else - RClusters(dv,buf,c,1); - cur_dir_cluster=c; - cur_dir_entry=0; - } - } - if (!written) { - avail_cnt=FAT32_ENTRIES_PER_BLK-cur_dir_entry & (FAT32_ENTRIES_PER_BLK-1); - if (avail_cntdata_area+cur_dir_cluster*dv->spc - +cur_dir_entry>>FAT32_ENTRIES_BITS,1); - cur_dir_entry+=avail_cnt; - if (cur_dir_entry==entries_per_cluster) { - last_dir_cluster=cur_dir_cluster; - temp_buf=buf; buf=last_buf; last_buf=temp_buf; - cur_dir_cluster=ClustersAlloc(dv,cur_dir_cluster,1); - cur_dir_entry=0; - MemSet(buf,0,BLK_SIZE*dv->spc); - WClusters(dv,buf,cur_dir_cluster,1); - } - } - MemCpy(&buf[cur_dir_entry],&de,de_cnt*sizeof(CFAT32DirEntry)); - WBlks(dv,&buf[cur_dir_entry &-FAT32_ENTRIES_PER_BLK], - dv->data_area+cur_dir_cluster*dv->spc+ - cur_dir_entry>>FAT32_ENTRIES_BITS,1); - cur_dir_entry+=de_cnt; - if (cur_dir_entry==entries_per_cluster) { - cur_dir_cluster=ClustersAlloc(dv,cur_dir_cluster,1); - MemSet(buf,0,BLK_SIZE*dv->spc); - WClusters(dv,buf,cur_dir_cluster,1); - } else { - MemSet(&buf[cur_dir_entry],0,sizeof(CFAT32DirEntry)); - WBlks(dv,&buf[cur_dir_entry &-FAT32_ENTRIES_PER_BLK], - dv->data_area+cur_dir_cluster*dv->spc - +cur_dir_entry>>FAT32_ENTRIES_BITS,1); - } - } - Free(last_buf); - Free(buf); - if (unlock) - DrvUnlock(dv); - if (unlock_break) - BreakUnlock; - } catch { - if (unlock) - DrvUnlock(dv); - if (unlock_break) - BreakUnlock; - } - return FALSE; -} - -I64 FAT32FilesDel(CDrv *dv,U8 *cur_dir,U8 *files_find_mask,I64 fuf_flags, - Bool del_dir,Bool print_msg) -{ - CFAT32DirEntry *buf,*last_buf,*temp_buf; - I64 i,res=0,attr,xsum=0,last_dir_cluster=INVALID_CLUSTER, - cur_dir_entry,entries_per_cluster,cur_dir_cluster; - U8 ch; - Bool unlock_break; - CDirEntry long_name; - MemSet(&long_name,0,sizeof(CDirEntry)); - try { - unlock_break=BreakLock; - DrvLock(dv); - cur_dir_cluster=Name2DirCluster(dv,cur_dir); - buf =MAlloc(BLK_SIZE*dv->spc); - last_buf=CAlloc(BLK_SIZE*dv->spc); - entries_per_cluster=dv->spc<data_area+cur_dir_cluster*dv->spc - +(cur_dir_entry-i)>>FAT32_ENTRIES_BITS, - (i+FAT32_ENTRIES_PER_BLK)>>FAT32_ENTRIES_BITS); - if (i==cur_dir_entry && last_dir_cluster!=INVALID_CLUSTER) { - i=1; - while (i<=entries_per_cluster && - last_buf[entries_per_cluster-i].attr - &RS_ATTR_LONG_NAME_MASK==RS_ATTR_LONG_NAME) - *last_buf[entries_per_cluster-i++].name=0xE5; - if (--i>0) - WBlks(dv,&buf[(entries_per_cluster-i)&-FAT32_ENTRIES_PER_BLK], - dv->data_area+last_dir_cluster*dv->spc - +(entries_per_cluster-i)>>FAT32_ENTRIES_BITS, - (i+FAT32_ENTRIES_PER_BLK-1)>>FAT32_ENTRIES_BITS); - } - FAT32FreeClusters(dv,buf[cur_dir_entry].cluster_lo+ - buf[cur_dir_entry].cluster_hi<<16); - } - } - MemSet(&long_name,0,sizeof(CDirEntry)); - } - } else - MemSet(&long_name,0,sizeof(CDirEntry)); - if (++cur_dir_entry==entries_per_cluster) { - last_dir_cluster=cur_dir_cluster; - cur_dir_cluster=ClusterNumNext(dv,cur_dir_cluster,1); - temp_buf=buf; buf=last_buf; last_buf=temp_buf; - RClusters(dv,buf,cur_dir_cluster,1); - cur_dir_entry=0; - } - } - Free(buf); - Free(last_buf); - DrvUnlock(dv); - if (unlock_break) - BreakUnlock; - } catch { - DrvUnlock(dv); - if (unlock_break) - BreakUnlock; - } - return res; -} - -I64 FAT32FileWrite(CDrv *dv,U8 *cur_dir,U8 *name,U8 *buf,I64 size, - CDate cdt,I64 attr) -{ - CDirEntry de; - I64 c=0,blk_cnt; - Bool contiguous; - MemSet(&de,0,sizeof(CDirEntry)); - if (size<0) size=0; - if (dv->fs_type!=FSt_FAT32) - PrintErr("Not FAT32 Drv\n"); - else if (!CFileNameTo(de.name,name)) - PrintErr("Invalid FileName.\n"); - else { - FAT32FilesDel(dv,cur_dir,de.name,0,FALSE,FALSE); - if (attr & RS_ATTR_CONTIGUOUS) - contiguous=TRUE; - else - contiguous=FALSE; - de.size=size; - if (blk_cnt=(size+BLK_SIZE-1)>>BLK_SIZE_BITS) - c=ClustersAlloc(dv,0,(blk_cnt+dv->spc-1)/dv->spc,contiguous); - else - c=0x0FFFFFFF; - de.cluster=c; - de.attr=attr; - de.datetime=cdt; - if (blk_cnt) - WClustersBlks(dv,buf,c,blk_cnt); - FAT32DirNew(dv,cur_dir,&de,TRUE); - } - return c; -} - -CDirEntry *FAT32FilesFind(U8 *files_find_mask, - I64 fuf_flags,CDirEntry *parent=NULL,I64 *_dir_size=NULL) -{ - CDrv *dv=Fs->cur_dv; - CFAT32DirEntry *buf; - I64 attr,xsum=0,dir_size=0,sub_dir_size, - cur_dir_cluster,cur_dir_entry,entries_per_cluster; - U8 ch; - CDirEntry *res=NULL,*tempde,long_name; - if (fuf_flags&~FUG_FILES_FIND) - throw('FUF'); - try { - MemSet(&long_name,0,sizeof(CDirEntry)); - DrvLock(dv); - cur_dir_cluster=Name2DirCluster(dv,Fs->cur_dir); - buf=MAlloc(BLK_SIZE*dv->spc); - entries_per_cluster=dv->spc<spc*BLK_SIZE; - cur_dir_entry=0; - while (ch=*buf[cur_dir_entry].name) { - attr=buf[cur_dir_entry].attr; - if (ch!=0xE5) { - if (attr&RS_ATTR_LONG_NAME_MASK==RS_ATTR_LONG_NAME) - DirLongNameFill(&long_name,&buf[cur_dir_entry],&xsum); - else { - if (!(attr&RS_ATTR_VOL_ID)) { - tempde=MAlloc(sizeof(CDirEntry)); - if (xsum==FATNameXSum(buf[cur_dir_entry].name)) - MemCpy(tempde,&long_name,sizeof(CDirEntry)); - else - MemSet(tempde,0,sizeof(CDirEntry)); - if (FAT32CDirFill(tempde,&buf[cur_dir_entry], - dv->fat32_local_time_offset)) { - tempde->parent=parent; - if (Bt(&fuf_flags,FUf_RECURSE) && attr&RS_ATTR_DIR && - *tempde->name!='.') { - tempde->next=res; - res=tempde; - tempde->full_name=DirNameAbs(tempde->name); - DrvUnlock(dv); - if (Cd(tempde->name)) { - tempde->sub=FAT32FilesFind(files_find_mask,fuf_flags, - tempde,&sub_dir_size); - tempde->size=sub_dir_size; - Cd(".."); - } - DrvLock(dv); - } else { - tempde->full_name=FileNameAbs(tempde->name); - if ((attr&RS_ATTR_DIR || !Bt(&fuf_flags,FUf_JUST_DIRS)) && - !(Bt(&fuf_flags,FUf_RECURSE) && - *tempde->name=='.' && attr&RS_ATTR_DIR) && - FilesFindMatch(tempde->full_name,files_find_mask, - fuf_flags)) { - tempde->next=res; - res=tempde; - } else - DirEntryDel(tempde); - } - } else - DirEntryDel(tempde); - } - MemSet(&long_name,0,sizeof(CDirEntry)); - } - } else - MemSet(&long_name,0,sizeof(CDirEntry)); - if (++cur_dir_entry==entries_per_cluster) { - cur_dir_cluster=ClusterNumNext(dv,cur_dir_cluster); - if (cur_dir_cluster==INVALID_CLUSTER) - break; - else { - RClusters(dv,buf,cur_dir_cluster,1); - dir_size+=dv->spc*BLK_SIZE; - cur_dir_entry=0; - } - } - } - Free(buf); - DrvUnlock(dv); - } catch - DrvUnlock(dv); - if (_dir_size) - *_dir_size=dir_size; - return res; -} - -Bool FAT32MkDir(CDrv *dv,U8 *cur_dir,U8 *name,I64 entry_cnt) -{ - I64 c,cur_dir_cluster=Name2DirCluster(dv,cur_dir), -//Rough estimate of size - size=CeilU64((entry_cnt+2)<spc<fat32_local_time_offset); - dFAT++; - - MemSet(&d_native,0,sizeof(CDirEntry)); - d_native.attr=RS_ATTR_DIR; - *d_native.name='.'; - d_native.name[1]='.'; - d_native.name[2]=0; - d_native.cluster=cur_dir_cluster; - d_native.size=0; - d_native.datetime=Now; - FAT32DirFill(dFAT,&d_native,NULL,dv->fat32_local_time_offset); - WClusters(dv,buf,c,1); - Free(buf); - if (unlock_break) - BreakUnlock; - } catch - if (unlock_break) - BreakUnlock; - return TRUE; -} diff --git a/Kernel/BlkDev/FileSysFAT.HC b/Kernel/BlkDev/FileSysFAT.HC new file mode 100644 index 0000000..926111c --- /dev/null +++ b/Kernel/BlkDev/FileSysFAT.HC @@ -0,0 +1,973 @@ +U0 CDate2Dos(U16 *t,U16 *d,CDate cdt) +{ + CDateStruct ds; + Date2Struct(&ds,cdt); + *d=ds.day_of_mon+(ds.mon+(ds.year-1980)<<4)<<5; + *t=ds.sec>>1+(ds.min+ds.hour<<6)<<5; +} + +CDate Dos2CDate(U16 t,U16 d) +{ + CDateStruct ds; + MemSet(&ds,0,sizeof(CDateStruct)); + ds.day_of_mon=d&0x1F; d=d>>5; + ds.mon=d&0xF; + ds.year=d>>4+1980; + ds.sec=(t&0x1F)*2; t=t>>5; + ds.min=t&0x3F; + ds.hour=t>>6; + return Struct2Date(&ds); +} + +U0 FAT32DrvInit(CDrv *dv) +{ + CFAT32Boot br32; + Bool unlock; + try { + unlock=DrvLock(dv); + dv->fs_type=FSt_FAT32; + RBlks(dv,&br32,dv->drv_offset,1); + dv->file_system_info_sect=dv->drv_offset+br32.file_system_info_sect; + dv->fat1=dv->drv_offset+br32.reserved_sects; + dv->fat2=dv->fat1+br32.sects_per_fat; + dv->data_area=dv->fat2+br32.sects_per_fat + -2*br32.sects_per_cluster; //Starts at Cluster 2 + dv->spc=br32.sects_per_cluster; + dv->root_cluster=br32.root_cluster; + DrvFATBlkAlloc(dv); + Free(dv->fis); + dv->fis=AMAlloc(BLK_SIZE); + RBlks(dv,dv->fis,dv->file_system_info_sect,1); + if (unlock) + DrvUnlock(dv); + } catch + if (unlock) + DrvUnlock(dv); +} + +Bool FAT32DrvValidate(U8 drv_let) +{ + CDrv *dv; + CFAT32Boot br; + if ((dv=Let2Drv(drv_let,FALSE)) && dv->fs_type==FSt_FAT32 && + RBlks(dv,&br,dv->drv_offset,1) && br.signature==0xAA55 && + br.sects==dv->size) + return TRUE; + else + return FALSE; +} + +U0 FAT32Fmt(U8 drv_let,Bool quick=TRUE) +{ + CFAT32Boot *br=CAlloc(BLK_SIZE); + CFAT32FileInfoSect *fis=CAlloc(BLK_SIZE); + CDrv *dv=Let2Drv(drv_let); + I64 i,l; + try { + DrvLock(dv); + DrvTypeSet(drv_let,FSt_FAT32); + dv->fs_type=FSt_FAT32; + br->jump_and_nop[0]=OC_JMP_REL8; + br->jump_and_nop[1]=offset(CFAT32Boot.code)-2; + br->jump_and_nop[2]=OC_NOP; + br->oem_name[0](I64)='MSWIN4.1'; + br->bytes_per_sect=BLK_SIZE; + if (dv->size<= 500000) + br->sects_per_cluster=1; + else if (dv->size<=2000000) + br->sects_per_cluster=2; + else if (dv->size<=6000000) + br->sects_per_cluster=4; + else if (dv->size<=12000000) + br->sects_per_cluster=8; + else if (dv->size<=33000000) + br->sects_per_cluster=16; + else if (dv->size<=67000000) + br->sects_per_cluster=32; + else + br->sects_per_cluster=64; + + br->reserved_sects=32; + br->copies_of_fat=2; + br->media_desc=0xF8; + br->sects=dv->size; + l=(br->sects/br->sects_per_cluster)>>(BLK_SIZE_BITS-2)+1; + br->sects_per_fat=l; + br->root_cluster=2; + br->file_system_info_sect=1; + br->log_drv_num=0x80; + br->ext_signature=0x29; + br->serial_num=RandU32; + MemCpy(br->vol_name,"NO NAME ",11); + br->fat_name[0](I64)='FAT32 '; + br->signature=0xAA55; + fis->signature1='RRaA'; + fis->signature2='rrAa'; + fis->free_clusters=-1; + fis->most_recently_alloced=0; + fis->signature3=0xAA550000; + + if (quick) + i=br->reserved_sects+2*l+4*br->sects_per_cluster; + else + i=dv->size; + WZeroBlks(dv,dv->drv_offset,i); + + WBlks(dv,fis,dv->drv_offset+br->file_system_info_sect,1); + WBlks(dv,br,dv->drv_offset,1); + FAT32DrvInit(dv); + ClustersAlloc(dv,0,1,FALSE); //Alloc #1 + br->root_cluster=ClustersAlloc(dv,0,1,FALSE); + WBlks(dv,br,dv->drv_offset,1); + FAT32DrvInit(dv); + DrvUnlock(dv); + } catch + DrvUnlock(dv); + Free(br); + Free(fis); +} + +Bool FATNameTo(U8 *dst,U8 *src) +{ + I64 i; + MemSet(dst,CH_SPACE,11); + if (!FileNameChk(src)) + return FALSE; + if (!StrCmp(src,"..")) { + *dst='.'; + dst[1]='.'; + return TRUE; + } else if (!StrCmp(src,".")) { + *dst='.'; + return TRUE; + } + i=0; + while (i<8 && *src && *src!='.') + dst[i++]=ToUpper(*src++); + i=8; + if (*src=='.') src++; + while (*src) + if (*src!='.') + dst[i++]=ToUpper(*src++); + else + src++; + return TRUE; +} + +I64 FATNameXSum(U8 *src) +{ + I64 i,res=0; + for (i=0;i<11;i++) + if (res&1) + res.u8[0]=0x80+res>>1+*src++; + else + res.u8[0]=res>>1+*src++; + return res; +} + +Bool FATFromName(U8 *dst,U8 *src) +{ + I64 i,j,k=0; + for (j=7;j>=0 && src[j]==CH_SPACE;j--); + for(i=0;i<=j;i++) + dst[k++]=src[i]; + for (j=10;j>=8 && src[j]==CH_SPACE;j--); + if (*src!='.' && j!=7) + dst[k++]='.'; + for(i=8;i<=j;i++) + dst[k++]=src[i]; + dst[k++]=0; + return FileNameChk(dst); +} + +U8 fat_long_name_map[13]={ + offset(CFAT32DirEntryLong.name1), + offset(CFAT32DirEntryLong.name1)+2, + offset(CFAT32DirEntryLong.name1)+4, + offset(CFAT32DirEntryLong.name1)+6, + offset(CFAT32DirEntryLong.name1)+8, + offset(CFAT32DirEntryLong.name2), + offset(CFAT32DirEntryLong.name2)+2, + offset(CFAT32DirEntryLong.name2)+4, + offset(CFAT32DirEntryLong.name2)+6, + offset(CFAT32DirEntryLong.name2)+8, + offset(CFAT32DirEntryLong.name2)+10, + offset(CFAT32DirEntryLong.name3), + offset(CFAT32DirEntryLong.name3)+2 +}; + +Bool DirLongNameFill(CDirEntry *tempde,CFAT32DirEntryLong *de,I64 *xsum) +{ + I64 i; + U8 *ptr=de; + if (de->ord&0x40) { + MemSet(tempde,0,sizeof(CDirEntry)); + *xsum=de->xsum; + } else if (de->type || de->zero || de->xsum!=*xsum) { + MemSet(tempde,0,sizeof(CDirEntry)); + *xsum=0; + return FALSE; + } + switch (de->ord&0x3F) { + case 1: + for (i=0;i<13;i++) + if (!(tempde->name[i]=ptr[fat_long_name_map[i]])) + return TRUE; + break; + case 2: + for (i=0;i<12;i++) + if (!(tempde->name[i+13]=ptr[fat_long_name_map[i]])) + return TRUE; + break; + } + return TRUE; +} + +Bool FAT32CDirFill(CDirEntry *tempde, + CFAT32DirEntry *de,CDate _local_time_offset) +{ + Bool res; + if (*tempde->name) + res=TRUE; + else + res=FATFromName(tempde->name,de->name); + tempde->cluster=de->cluster_lo+de->cluster_hi<<16; + tempde->size=de->size; + tempde->attr=de->attr; + tempde->datetime=Dos2CDate(de->WrtTime,de->WrtDate)-_local_time_offset; + return res; +} + +Bool FAT32DirFill(CFAT32DirEntry *de, + CDirEntry *tempde,I64 *_de_cnt,CDate _local_time_offset) +{//Fill up to 3 entries and store cnt of entries. + I64 de_cnt=0,i,l,xsum,ord; + U8 *ptr,dname[16]; + CFAT32DirEntryLong *ld=de; + Bool res; + + MemSet(de,0,sizeof(CFAT32DirEntry)); + res=FATNameTo(de->name,tempde->name); + FATFromName(dname,de->name); + if (StrCmp(dname,tempde->name)) { + ord=0x41; + xsum=FATNameXSum(de->name); + if ((l=StrLen(tempde->name))>13) { + ptr=&ld[de_cnt]; + MemSet(ptr,0,sizeof(CFAT32DirEntryLong)); + ld[de_cnt].attr=RS_ATTR_LONG_NAME; + ld[de_cnt].xsum=xsum; + ld[de_cnt].ord=0x42; + for (i=13;iname[i]; + i++; + for (;i<26;i++) + ptr[fat_long_name_map[i-13]](U16)=0xFFFF; + ord=1; + l=13; + de_cnt++; + } + ptr=&de[de_cnt]; + MemSet(ptr,0,sizeof(CFAT32DirEntryLong)); + ld[de_cnt].attr=RS_ATTR_LONG_NAME; + ld[de_cnt].xsum=xsum; + ld[de_cnt].ord=ord; + for (i=0;iname[i]; + i++; + for (;i<13;i++) + ptr[fat_long_name_map[i]](U16)=0xFFFF; + de_cnt++; + MemSet(&de[de_cnt],0,sizeof(CFAT32DirEntry)); + res=FATNameTo(de[de_cnt].name,tempde->name); + } + de[de_cnt].cluster_lo=tempde->cluster.u16[0]; + de[de_cnt].cluster_hi=tempde->cluster.u16[1]; + if (!(tempde->attr&RS_ATTR_DIR)) + de[de_cnt].size=tempde->size; + de[de_cnt].attr=tempde->attr; + if (!tempde->datetime) + tempde->datetime=Now; + CDate2Dos(&de[de_cnt].WrtTime,&de[de_cnt].WrtDate, + tempde->datetime+_local_time_offset); + if (_de_cnt) + *_de_cnt=de_cnt+1; + return res; +} + +Bool FAT32FileFind(CDrv *dv,I64 cur_dir_cluster, + U8 *name,CDirEntry *_res,I64 fuf_flags=0) +{//$LK,"FUF_JUST_DIRS",A="MN:FUF_JUST_DIRS"$, $LK,"FUF_JUST_FILES",A="MN:FUF_JUST_FILES"$ + Bool res=FALSE,unlock; + CFAT32DirEntry *buf; + I64 xsum=0,attr,cur_dir_entry,entries_per_cluster; + U8 dname[CDIR_FILENAME_LEN],ch; + CDirEntry long_name; + if (fuf_flags&~FUG_FILE_FIND) + throw('FUF'); + MemSet(_res,0,sizeof(CDirEntry)); + MemSet(&long_name,0,sizeof(CDirEntry)); + DrvChk(dv); + if (dv->fs_type!=FSt_FAT32) + PrintErr("Not FAT32 Drv\n"); + else if (!CFileNameTo(dname,name)) + PrintErr("Invalid FileName.\n"); + else + try { + unlock=DrvLock(dv); + buf=MAlloc(BLK_SIZE*dv->spc); + entries_per_cluster=dv->spc<fat32_local_time_offset) && + !StrCmp(dname,_res->name)) { + res=TRUE; + goto fff_done; + } + } + MemSet(&long_name,0,sizeof(CDirEntry)); + } + } else + MemSet(&long_name,0,sizeof(CDirEntry)); + if (++cur_dir_entry==entries_per_cluster) { + cur_dir_cluster=ClusterNumNext(dv,cur_dir_cluster); + if (!(0fs_type!=FSt_FAT32) + PrintErr("Not FAT32 Drv\n"); + else + try { + DrvLock(dv); + cur_dir_cluster=Name2DirCluster(dv,cur_dir); + if (FAT32FileFind(dv,cur_dir_cluster,filename,&de,FUF_JUST_FILES)) { + blk_cnt=(de.size+BLK_SIZE-1)>>BLK_SIZE_BITS; + buf=MAlloc(blk_cnt<cur_dv->fs_type!=FSt_FAT32) + PrintErr("Not FAT32 Drv\n"); + else if (FAT32FileFind(Fs->cur_dv,cur_dir_cluster,name,&de,FUF_JUST_DIRS)) + return TRUE; + else { + "%s ",name; + PrintErr("File not found.\n"); + } + return FALSE; +} + +U0 FAT32FreeClusters(CDrv *dv,I64 c) +{ + I64 next,saved_c=c; + Bool unlock,unlock_break; + DrvChk(dv); + if (!(0fs_type!=FSt_FAT32) + PrintErr("Not FAT32 Drv\n"); + else + try { + unlock_break=BreakLock; + unlock=DrvLock(dv); + DrvFATBlkClean(dv); + do { + DrvFATBlkSet(dv,c,0); + next=dv->cur_fat_blk[c&(BLK_SIZE/4-1)]; + dv->cur_fat_blk[c&(BLK_SIZE/4-1)]=0; + LBts(&dv->fat_blk_dirty,0); + c=next; + } while (0cur_fat_blk[c&(BLK_SIZE/4-1)]; + dv->cur_fat_blk[c&(BLK_SIZE/4-1)]=0; + LBts(&dv->fat_blk_dirty,0); + c=next; + } while (0size+dv->drv_offset-dv->data_area)/dv->spc-1; + j=dv->fis->most_recently_alloced; + while (cnt-->0) { + while (TRUE) { + j++; + if (j<1) j=1; + if (j>=l) { + if (wrap_around) + throw('Drv'); + j=1; + wrap_around=TRUE; + } + DrvFATBlkSet(dv,j); + if (!dv->cur_fat_blk[j&(BLK_SIZE/4-1)]) + break; + } + if (!(0cur_fat_blk[c&(BLK_SIZE/4-1)]=j; + LBts(&dv->fat_blk_dirty,0); + } + c=j; + } + + if (0cur_fat_blk[c&(BLK_SIZE/4-1)]=0x0FFFFFFF; + LBts(&dv->fat_blk_dirty,0); + } + DrvFATBlkClean(dv); + + dv->fis->most_recently_alloced=j; + dv->fis->free_clusters=-1; + WBlks(dv,dv->fis,dv->file_system_info_sect,1); + } catch { + if (unlock) + DrvUnlock(dv); + if (unlock_break) + BreakUnlock; + } + if (unlock) + DrvUnlock(dv); + if (unlock_break) + BreakUnlock; + return first; +} + +I64 FAT32AllocContiguousClusters(CDrv *dv,I64 cnt) +{ + I64 i,first=1; + Bool cont,unlock,unlock_break; + + if (cnt<=0) return 0x0FFFFFFF; + try { + unlock_break=BreakLock; + unlock=DrvLock(dv); + while (TRUE) { + first++; + i=0; + cont=TRUE; + while (cont && ispc+dv->data_area>dv->size+dv->drv_offset) + throw('Drv'); + DrvFATBlkSet(dv,first+i); + if (dv->cur_fat_blk[(first+i)&(BLK_SIZE/4-1)]) + cont=FALSE; + else + i++; + } + if (!cont) + first=first+i; + else { + DrvFATBlkClean(dv); + + for (i=0;icur_fat_blk[(first+i)&(BLK_SIZE/4-1)]=0x0FFFFFFF; + else + dv->cur_fat_blk[(first+i)&(BLK_SIZE/4-1)]=first+i+1; + LBts(&dv->fat_blk_dirty,0); + } + DrvFATBlkClean(dv,0); + + for (i=0;icur_fat_blk[(first+i)&(BLK_SIZE/4-1)]=0x0FFFFFFF; + else + dv->cur_fat_blk[(first+i)&(BLK_SIZE/4-1)]=first+i+1; + LBts(&dv->fat_blk_dirty,0); + } + DrvFATBlkClean(dv,1); + break; + } + } + } catch { + if (unlock) + DrvUnlock(dv); + if (unlock_break) + BreakUnlock; + } + if (unlock) + DrvUnlock(dv); + if (unlock_break) + BreakUnlock; + return first; +} + +Bool FAT32DirNew(CDrv *dv,U8 *cur_dir,CDirEntry *tempde,Bool free_old_chain) +{ +//See $LK,"::/Doc/CutCorners.DD"$. + CFAT32DirEntry *buf,*last_buf,*temp_buf,de[3]; + I64 i,attr,avail_cnt,de_cnt,c, + cur_dir_entry,entries_per_cluster, + cur_dir_cluster,xsum=0,last_dir_cluster=INVALID_CLUSTER; + U8 ch; + Bool written=FALSE,unlock,unlock_break; + CDirEntry long_name; + FAT32DirFill(&de,tempde,&de_cnt,dv->fat32_local_time_offset); + MemSet(&long_name,0,sizeof(CDirEntry)); + try { + unlock_break=BreakLock; + unlock=DrvLock(dv); + cur_dir_cluster=Name2DirCluster(dv,cur_dir); + buf =MAlloc(BLK_SIZE*dv->spc); + last_buf=CAlloc(BLK_SIZE*dv->spc); + entries_per_cluster=dv->spc<=de_cnt) { + MemCpy(&buf[cur_dir_entry],&de,de_cnt*sizeof(CFAT32DirEntry)); + WBlks(dv,&buf[cur_dir_entry & -FAT32_ENTRIES_PER_BLK], + dv->data_area+cur_dir_cluster*dv->spc + +cur_dir_entry>>FAT32_ENTRIES_BITS,1); + cur_dir_entry+=de_cnt-1; //gets inc'ed + written=TRUE; + } else if (ch!=0xE5 && !(attr&RS_ATTR_VOL_ID)) { + if (xsum!=FATNameXSum(buf[cur_dir_entry].name)) + MemSet(&long_name,0,sizeof(CDirEntry)); + if (!*long_name.name) + FATFromName(long_name.name,buf[cur_dir_entry].name); +//Del old entry with same name + if (!StrCmp(long_name.name,tempde->name)) { + if (free_old_chain) + FAT32FreeClusters(dv,buf[cur_dir_entry].cluster_lo+ + buf[cur_dir_entry].cluster_hi<<16); + if (!written) { + MemCpy(&buf[cur_dir_entry],&de[de_cnt-1],sizeof(CFAT32DirEntry)); + WBlks(dv,&buf[cur_dir_entry & -FAT32_ENTRIES_PER_BLK], + dv->data_area+cur_dir_cluster*dv->spc + +cur_dir_entry>>FAT32_ENTRIES_BITS,1); + written=TRUE; + } else { + *buf[cur_dir_entry].name=0xE5; + i=1; + while (i<=cur_dir_entry && + buf[cur_dir_entry-i].attr&RS_ATTR_LONG_NAME_MASK + ==RS_ATTR_LONG_NAME) + *buf[cur_dir_entry-i++].name=0xE5; + i--; + WBlks(dv,&buf[(cur_dir_entry-i)&-FAT32_ENTRIES_PER_BLK], + dv->data_area+cur_dir_cluster*dv->spc + +(cur_dir_entry-i)>>FAT32_ENTRIES_BITS, + (i+FAT32_ENTRIES_PER_BLK)>>FAT32_ENTRIES_BITS); + if (i==cur_dir_entry && 00) + WBlks(dv,&buf[(entries_per_cluster-i)&-FAT32_ENTRIES_PER_BLK], + dv->data_area+last_dir_cluster*dv->spc + +(entries_per_cluster-i)>>FAT32_ENTRIES_BITS, + (i+FAT32_ENTRIES_PER_BLK-1)>>FAT32_ENTRIES_BITS); + } + } + break; + } + } + MemSet(&long_name,0,sizeof(CDirEntry)); + } + if (++cur_dir_entry==entries_per_cluster) { + last_dir_cluster=cur_dir_cluster; + temp_buf=buf; buf=last_buf; last_buf=temp_buf; + c=ClusterNumNext(dv,cur_dir_cluster); + if (!(0spc); + WClusters(dv,buf,c,1); + } else + RClusters(dv,buf,c,1); + cur_dir_cluster=c; + cur_dir_entry=0; + } + } + if (!written) { + avail_cnt=FAT32_ENTRIES_PER_BLK-cur_dir_entry & (FAT32_ENTRIES_PER_BLK-1); + if (avail_cntdata_area+cur_dir_cluster*dv->spc + +cur_dir_entry>>FAT32_ENTRIES_BITS,1); + cur_dir_entry+=avail_cnt; + if (cur_dir_entry==entries_per_cluster) { + last_dir_cluster=cur_dir_cluster; + temp_buf=buf; buf=last_buf; last_buf=temp_buf; + cur_dir_cluster=ClustersAlloc(dv,cur_dir_cluster,1); + cur_dir_entry=0; + MemSet(buf,0,BLK_SIZE*dv->spc); + WClusters(dv,buf,cur_dir_cluster,1); + } + } + MemCpy(&buf[cur_dir_entry],&de,de_cnt*sizeof(CFAT32DirEntry)); + WBlks(dv,&buf[cur_dir_entry &-FAT32_ENTRIES_PER_BLK], + dv->data_area+cur_dir_cluster*dv->spc+ + cur_dir_entry>>FAT32_ENTRIES_BITS,1); + cur_dir_entry+=de_cnt; + if (cur_dir_entry==entries_per_cluster) { + cur_dir_cluster=ClustersAlloc(dv,cur_dir_cluster,1); + MemSet(buf,0,BLK_SIZE*dv->spc); + WClusters(dv,buf,cur_dir_cluster,1); + } else { + MemSet(&buf[cur_dir_entry],0,sizeof(CFAT32DirEntry)); + WBlks(dv,&buf[cur_dir_entry &-FAT32_ENTRIES_PER_BLK], + dv->data_area+cur_dir_cluster*dv->spc + +cur_dir_entry>>FAT32_ENTRIES_BITS,1); + } + } + Free(last_buf); + Free(buf); + if (unlock) + DrvUnlock(dv); + if (unlock_break) + BreakUnlock; + } catch { + if (unlock) + DrvUnlock(dv); + if (unlock_break) + BreakUnlock; + } + return FALSE; +} + +I64 FAT32FilesDel(CDrv *dv,U8 *cur_dir,U8 *files_find_mask,I64 fuf_flags, + Bool del_dir,Bool print_msg) +{ + CFAT32DirEntry *buf,*last_buf,*temp_buf; + I64 i,res=0,attr,xsum=0,last_dir_cluster=INVALID_CLUSTER, + cur_dir_entry,entries_per_cluster,cur_dir_cluster; + U8 ch; + Bool unlock_break; + CDirEntry long_name; + MemSet(&long_name,0,sizeof(CDirEntry)); + try { + unlock_break=BreakLock; + DrvLock(dv); + cur_dir_cluster=Name2DirCluster(dv,cur_dir); + buf =MAlloc(BLK_SIZE*dv->spc); + last_buf=CAlloc(BLK_SIZE*dv->spc); + entries_per_cluster=dv->spc<data_area+cur_dir_cluster*dv->spc + +(cur_dir_entry-i)>>FAT32_ENTRIES_BITS, + (i+FAT32_ENTRIES_PER_BLK)>>FAT32_ENTRIES_BITS); + if (i==cur_dir_entry && last_dir_cluster!=INVALID_CLUSTER) { + i=1; + while (i<=entries_per_cluster && + last_buf[entries_per_cluster-i].attr + &RS_ATTR_LONG_NAME_MASK==RS_ATTR_LONG_NAME) + *last_buf[entries_per_cluster-i++].name=0xE5; + if (--i>0) + WBlks(dv,&buf[(entries_per_cluster-i)&-FAT32_ENTRIES_PER_BLK], + dv->data_area+last_dir_cluster*dv->spc + +(entries_per_cluster-i)>>FAT32_ENTRIES_BITS, + (i+FAT32_ENTRIES_PER_BLK-1)>>FAT32_ENTRIES_BITS); + } + FAT32FreeClusters(dv,buf[cur_dir_entry].cluster_lo+ + buf[cur_dir_entry].cluster_hi<<16); + } + } + MemSet(&long_name,0,sizeof(CDirEntry)); + } + } else + MemSet(&long_name,0,sizeof(CDirEntry)); + if (++cur_dir_entry==entries_per_cluster) { + last_dir_cluster=cur_dir_cluster; + cur_dir_cluster=ClusterNumNext(dv,cur_dir_cluster,1); + temp_buf=buf; buf=last_buf; last_buf=temp_buf; + RClusters(dv,buf,cur_dir_cluster,1); + cur_dir_entry=0; + } + } + Free(buf); + Free(last_buf); + DrvUnlock(dv); + if (unlock_break) + BreakUnlock; + } catch { + DrvUnlock(dv); + if (unlock_break) + BreakUnlock; + } + return res; +} + +I64 FAT32FileWrite(CDrv *dv,U8 *cur_dir,U8 *name,U8 *buf,I64 size, + CDate cdt,I64 attr) +{ + CDirEntry de; + I64 c=0,blk_cnt; + Bool contiguous; + MemSet(&de,0,sizeof(CDirEntry)); + if (size<0) size=0; + if (dv->fs_type!=FSt_FAT32) + PrintErr("Not FAT32 Drv\n"); + else if (!CFileNameTo(de.name,name)) + PrintErr("Invalid FileName.\n"); + else { + FAT32FilesDel(dv,cur_dir,de.name,0,FALSE,FALSE); + if (attr & RS_ATTR_CONTIGUOUS) + contiguous=TRUE; + else + contiguous=FALSE; + de.size=size; + if (blk_cnt=(size+BLK_SIZE-1)>>BLK_SIZE_BITS) + c=ClustersAlloc(dv,0,(blk_cnt+dv->spc-1)/dv->spc,contiguous); + else + c=0x0FFFFFFF; + de.cluster=c; + de.attr=attr; + de.datetime=cdt; + if (blk_cnt) + WClustersBlks(dv,buf,c,blk_cnt); + FAT32DirNew(dv,cur_dir,&de,TRUE); + } + return c; +} + +CDirEntry *FAT32FilesFind(U8 *files_find_mask, + I64 fuf_flags,CDirEntry *parent=NULL,I64 *_dir_size=NULL) +{ + CDrv *dv=Fs->cur_dv; + CFAT32DirEntry *buf; + I64 attr,xsum=0,dir_size=0,sub_dir_size, + cur_dir_cluster,cur_dir_entry,entries_per_cluster; + U8 ch; + CDirEntry *res=NULL,*tempde,long_name; + if (fuf_flags&~FUG_FILES_FIND) + throw('FUF'); + try { + MemSet(&long_name,0,sizeof(CDirEntry)); + DrvLock(dv); + cur_dir_cluster=Name2DirCluster(dv,Fs->cur_dir); + buf=MAlloc(BLK_SIZE*dv->spc); + entries_per_cluster=dv->spc<spc*BLK_SIZE; + cur_dir_entry=0; + while (ch=*buf[cur_dir_entry].name) { + attr=buf[cur_dir_entry].attr; + if (ch!=0xE5) { + if (attr&RS_ATTR_LONG_NAME_MASK==RS_ATTR_LONG_NAME) + DirLongNameFill(&long_name,&buf[cur_dir_entry],&xsum); + else { + if (!(attr&RS_ATTR_VOL_ID)) { + tempde=MAlloc(sizeof(CDirEntry)); + if (xsum==FATNameXSum(buf[cur_dir_entry].name)) + MemCpy(tempde,&long_name,sizeof(CDirEntry)); + else + MemSet(tempde,0,sizeof(CDirEntry)); + if (FAT32CDirFill(tempde,&buf[cur_dir_entry], + dv->fat32_local_time_offset)) { + tempde->parent=parent; + if (Bt(&fuf_flags,FUf_RECURSE) && attr&RS_ATTR_DIR && + *tempde->name!='.') { + tempde->next=res; + res=tempde; + tempde->full_name=DirNameAbs(tempde->name); + DrvUnlock(dv); + if (Cd(tempde->name)) { + tempde->sub=FAT32FilesFind(files_find_mask,fuf_flags, + tempde,&sub_dir_size); + tempde->size=sub_dir_size; + Cd(".."); + } + DrvLock(dv); + } else { + tempde->full_name=FileNameAbs(tempde->name); + if ((attr&RS_ATTR_DIR || !Bt(&fuf_flags,FUf_JUST_DIRS)) && + !(Bt(&fuf_flags,FUf_RECURSE) && + *tempde->name=='.' && attr&RS_ATTR_DIR) && + FilesFindMatch(tempde->full_name,files_find_mask, + fuf_flags)) { + tempde->next=res; + res=tempde; + } else + DirEntryDel(tempde); + } + } else + DirEntryDel(tempde); + } + MemSet(&long_name,0,sizeof(CDirEntry)); + } + } else + MemSet(&long_name,0,sizeof(CDirEntry)); + if (++cur_dir_entry==entries_per_cluster) { + cur_dir_cluster=ClusterNumNext(dv,cur_dir_cluster); + if (cur_dir_cluster==INVALID_CLUSTER) + break; + else { + RClusters(dv,buf,cur_dir_cluster,1); + dir_size+=dv->spc*BLK_SIZE; + cur_dir_entry=0; + } + } + } + Free(buf); + DrvUnlock(dv); + } catch + DrvUnlock(dv); + if (_dir_size) + *_dir_size=dir_size; + return res; +} + +Bool FAT32MkDir(CDrv *dv,U8 *cur_dir,U8 *name,I64 entry_cnt) +{ + I64 c,cur_dir_cluster=Name2DirCluster(dv,cur_dir), +//Rough estimate of size + size=CeilU64((entry_cnt+2)<spc<fat32_local_time_offset); + dFAT++; + + MemSet(&d_native,0,sizeof(CDirEntry)); + d_native.attr=RS_ATTR_DIR; + *d_native.name='.'; + d_native.name[1]='.'; + d_native.name[2]=0; + d_native.cluster=cur_dir_cluster; + d_native.size=0; + d_native.datetime=Now; + FAT32DirFill(dFAT,&d_native,NULL,dv->fat32_local_time_offset); + WClusters(dv,buf,c,1); + Free(buf); + if (unlock_break) + BreakUnlock; + } catch + if (unlock_break) + BreakUnlock; + return TRUE; +} diff --git a/Kernel/BlkDev/FileSysISO.CPP b/Kernel/BlkDev/FileSysISO.HC similarity index 100% rename from Kernel/BlkDev/FileSysISO.CPP rename to Kernel/BlkDev/FileSysISO.HC diff --git a/Kernel/BlkDev/FileSysRedSea.CPP b/Kernel/BlkDev/FileSysRedSea.CPP deleted file mode 100644 index 1bfa47f..0000000 --- a/Kernel/BlkDev/FileSysRedSea.CPP +++ /dev/null @@ -1,637 +0,0 @@ -// See $LK,"RedSea File System",A="FI:::/Doc/RedSea.TXT"$ - -U0 RedSeaFreeFreeLst(CDrv *dv) -{ - CFreeLst *tempf,*tempf1; - Bool unlock; - try { - unlock=DrvLock(dv); - if (tempf=dv->next_free) { - while (tempf!=&dv->next_free) { - tempf1=tempf->next; - Free(tempf); - tempf=tempf1; - } - } - dv->next_free=NULL; - if (unlock) - DrvUnlock(dv); - } catch - if (unlock) - DrvUnlock(dv); -} - -U0 RedSeaFreeLstBuild(CDrv *dv) -{ - Bool unlock; - CFreeLst *tempf; - I64 i,first=dv->data_area,max_blk=dv->size+dv->drv_offset; - try { - unlock=DrvLock(dv); - if (dv->next_free) - RedSeaFreeFreeLst(dv); - QueInit(&dv->next_free); - while (firstcur_fat_blk,(first+i-dv->data_area)&(BLK_SIZE<<3-1))) - break; - else - i++; - } - if (i) { - tempf=AMAlloc(sizeof(CFreeLst)); - tempf->size=i; - tempf->start=first; - QueIns(tempf,dv->last_free); - } - first+=i+1; - } - if (unlock) - DrvUnlock(dv); - } catch - if (unlock) - DrvUnlock(dv); -} - -U0 RedSeaDrvInit(CDrv *dv) -{ - CRedSeaBoot br; - Bool unlock; - try { - unlock=DrvLock(dv); - RBlks(dv,&br,dv->drv_offset,1); - if (br.signature!=MBR_PT_REDSEA || br.signature2!=0xAA55) - throw('Drv'); - dv->fs_type=FSt_REDSEA; - RedSeaFreeFreeLst(dv); - dv->spc=1; - dv->size=br.sects; - dv->data_area=dv->drv_offset+br.bitmap_sects; - dv->root_cluster=br.root_cluster; - dv->fat1=dv->fat2=dv->drv_offset+1; - DrvFATBlkAlloc(dv); - if (unlock) - DrvUnlock(dv); - } catch - if (unlock) - DrvUnlock(dv); -} - -Bool RedSeaDrvValidate(U8 drv_let) -{ - CDrv *dv; - CRedSeaBoot br; - if ((dv=Let2Drv(drv_let,FALSE)) && dv->fs_type==FSt_REDSEA && - RBlks(dv,&br,dv->drv_offset,1) && br.signature==MBR_PT_REDSEA && - br.signature2==0xAA55 && br.sects==dv->size) - return TRUE; - else - return FALSE; -} - -U0 RedSeaFmt(U8 drv_let,Bool quick=TRUE) -{ - U8 *root_dir; - CDirEntry *d_native; - CRedSeaBoot *br=CAlloc(BLK_SIZE); - CDrv *dv=Let2Drv(drv_let); - I64 i,n,root_dir_blks; - try { - DrvLock(dv); -// DrvTypeSet(drv_let,FSt_REDSEA); - DrvTypeSet(drv_let,FSt_FAT32); - dv->fs_type=FSt_REDSEA; - br->signature=MBR_PT_REDSEA; - br->signature2=0xAA55; - br->drv_offset=dv->drv_offset; //For CD/DVD image copy. - br->sects=dv->size; - n=(br->sects+BLK_SIZE<<3-1)/BLK_SIZE<<3; - br->bitmap_sects=n; - br->unique_id=GetTSC^Now()(U64); - br->root_cluster=0; - - if (quick) - i=n+1; - else - i=dv->size; - WZeroBlks(dv,dv->drv_offset,i); - - WBlks(dv,br,dv->drv_offset,1); - RedSeaDrvInit(dv); - ClustersAlloc(dv,0,1,FALSE); //Alloc #1 - - root_dir_blks=MaxI64(1,dv->bd->init_root_dir_blks); - br->root_cluster=ClustersAlloc(dv,0,root_dir_blks,FALSE); - WBlks(dv,br,dv->drv_offset,1); - root_dir=CAlloc(BLK_SIZE*root_dir_blks); - - d_native=root_dir-offset(CDirEntry.start); - - d_native->attr=RS_ATTR_DIR|RS_ATTR_CONTIGUOUS; - *d_native->name='.'; - d_native->cluster=br->root_cluster; - d_native->size=BLK_SIZE*root_dir_blks; - d_native->datetime=Now; - - d_native(U8 *)+=CDIR_SIZE; - - *d_native->name='.'; - d_native->name[1]='.'; - d_native->attr=RS_ATTR_DIR|RS_ATTR_CONTIGUOUS; - d_native->cluster=br->root_cluster; - d_native->datetime=Now; - - WBlks(dv,root_dir,br->root_cluster,root_dir_blks); - RedSeaDrvInit(dv); - DrvUnlock(dv); - } catch - DrvUnlock(dv); - Free(br); - Free(root_dir); -} - -Bool RedSeaFileFind(CDrv *dv,I64 cur_dir_cluster,U8 *name, - CDirEntry *_res,I64 fuf_flags=0) -{//$LK,"FUF_JUST_DIRS",A="MN:FUF_JUST_DIRS"$, $LK,"FUF_JUST_FILES",A="MN:FUF_JUST_FILES"$ - CDirEntry *buf,*buf2,*ptr; - U8 dname[CDIR_FILENAME_LEN]; - I64 ch; - Bool res=FALSE,unlock; - if (fuf_flags&~FUG_FILE_FIND) - throw('FUF'); - MemSet(_res,0,sizeof(CDirEntry)); - DrvChk(dv); - if (dv->fs_type!=FSt_REDSEA) - PrintErr("Not RedSea Drv\n"); - else if (!CFileNameTo(dname,name)) - PrintErr("Invalid FileName.\n"); - else - try { - unlock=DrvLock(dv); - buf2=MAlloc(BLK_SIZE); - RBlks(dv,buf2,cur_dir_cluster,1); - - ptr=buf2(U8 *)-offset(CDirEntry.start); - buf=MAlloc(ptr->size); - RBlks(dv,buf,cur_dir_cluster,ptr->size>>BLK_SIZE_BITS); - Free(buf2); - - ptr=buf(U8 *)-offset(CDirEntry.start); - *ptr->name='.'; - ptr->name[1]=0; - while (TRUE) { - if (!(ch=*ptr->name)) - break; - else if (!(ptr->attr & RS_ATTR_DELETED) && - !(fuf_flags&FUF_JUST_DIRS && !(ptr->attr & RS_ATTR_DIR)) && - !(fuf_flags&FUF_JUST_FILES && ptr->attr & RS_ATTR_DIR) && - !StrCmp(dname,ptr->name)) { - MemCpy(&_res->attr,&ptr->attr,CDIR_SIZE); - res=TRUE; - goto rsff_done; - } - ptr(U8 *)+=CDIR_SIZE; - } -rsff_done: - Free(buf); - if (unlock) - DrvUnlock(dv); - } catch - if (unlock) - DrvUnlock(dv); - return res; -} - -U8 *RedSeaFileRead(CDrv *dv,U8 *cur_dir,U8 *filename,I64 *_size,I64 *_attr) -{ - U8 *buf=NULL; - CDirEntry de; - I64 c,blk_cnt,cur_dir_cluster; - DrvChk(dv); - *_size=0; - *_attr=0; - if (dv->fs_type!=FSt_REDSEA) - PrintErr("Not RedSea Drv\n"); - else - try { - DrvLock(dv); - cur_dir_cluster=Name2DirCluster(dv,cur_dir); - if (RedSeaFileFind(dv,cur_dir_cluster,filename,&de,FUF_JUST_FILES)) { - blk_cnt=(de.size+BLK_SIZE-1)>>BLK_SIZE_BITS; - buf=MAlloc(blk_cnt<cur_dv->fs_type!=FSt_REDSEA) - PrintErr("Not RedSea Drv\n"); - else if (RedSeaFileFind(Fs->cur_dv,cur_dir_cluster,name,&de,FUF_JUST_DIRS)) - return TRUE; - else { - "%s ",name; - PrintErr("File not found.\n"); - } - return FALSE; -} - -U0 RedSeaFreeClusters(CDrv *dv,I64 c,I64 cnt) -{ - CFreeLst *tempf; - Bool found=FALSE,unlock,unlock_break; - DrvChk(dv); - if (!c) return; - if (dv->fs_type!=FSt_REDSEA) - PrintErr("Not RedSea Drv\n"); - else - try { - unlock_break=BreakLock; - unlock=DrvLock(dv); - if (!dv->next_free) - RedSeaFreeLstBuild(dv); - tempf=dv->next_free; - while (!found && tempf!=&dv->next_free) { - if (tempf->start+tempf->size==c) { - tempf->size+=cnt; - found=TRUE; - } else if (c+cnt==tempf->start) { - tempf->size+=cnt; - tempf->start=c; - found=TRUE; - } - tempf=tempf->next; - } - if (!found) { - tempf=AMAlloc(sizeof(CFreeLst)); - tempf->size=cnt; - tempf->start=c; - QueIns(tempf,dv->last_free); - } - while (cnt-->0) { - DrvFATBlkSet(dv,c); - LBtr(dv->cur_fat_blk,(c-dv->data_area)&(BLK_SIZE<<3-1)); - LBts(&dv->fat_blk_dirty,0); - c++; - } - DrvFATBlkClean(dv); - - if (unlock) - DrvUnlock(dv); - if (unlock_break) - BreakUnlock; - } catch { - if (unlock) - DrvUnlock(dv); - if (unlock_break) - BreakUnlock; - } -} - -I64 RedSeaAllocClusters(CDrv *dv,I64 cnt) -{ - CFreeLst *tempf,*best_free=NULL; - I64 i,first,best_size=MAX_I64; - Bool unlock,unlock_break; - if (cnt<=0) - throw('Drv'); - try { - unlock_break=BreakLock; - unlock=DrvLock(dv); - if (!dv->next_free) - RedSeaFreeLstBuild(dv); - tempf=dv->next_free; - while (tempf!=&dv->next_free) { - if (tempf->size>=cnt && tempf->sizesize; - if (tempf->size==cnt) - break; - } - tempf=tempf->next; - } - if (!best_free) - throw('Drv'); - first=best_free->start; - for (i=0;icur_fat_blk,(first+i-dv->data_area)&(BLK_SIZE<<3-1)); - LBts(&dv->fat_blk_dirty,0); - } - DrvFATBlkClean(dv); - if (best_free->size-=cnt) - best_free->start+=cnt; - else { - QueRem(best_free); - Free(best_free); - } - if (unlock) - DrvUnlock(dv); - if (unlock_break) - BreakUnlock; - } catch { - if (unlock) - DrvUnlock(dv); - if (unlock_break) - BreakUnlock; - } - return first; -} - -Bool RedSeaDirNew(CDrv *dv,U8 *cur_dir,CDirEntry *de,Bool free_old_chain) -{ - CDirEntry *buf,*buf2,*ptr,de2; - CRedSeaBoot *br; - I64 c,ch,i=1,j=0,n=BLK_SIZE/CDIR_SIZE,dir_size,cur_dir_cluster; - Bool written=FALSE,unlock,unlock_break; - U8 *temp,*parent_dir; - try { - unlock_break=BreakLock; - de->attr|=RS_ATTR_CONTIGUOUS; - unlock=DrvLock(dv); - cur_dir_cluster=Name2DirCluster(dv,cur_dir); - buf2=MAlloc(BLK_SIZE); - RBlks(dv,buf2,cur_dir_cluster,1); - - ptr=buf2(U8 *)-offset(CDirEntry.start); - buf=MAlloc(ptr->size); - RBlks(dv,buf,cur_dir_cluster,ptr->size>>BLK_SIZE_BITS); - - dir_size=ptr->size; - ptr=buf(U8 *)-offset(CDirEntry.start)+CDIR_SIZE; - Free(buf2); - while (TRUE) { - if (!(ch=*ptr->name)) { - if (!written) - MemCpy(&ptr->start,&de->start,CDIR_SIZE); - if ((i+1)*CDIR_SIZE+j<>BLK_SIZE_BITS); - dir_size+=BLK_SIZE; - c=ClustersAlloc(dv,0,dir_size>>BLK_SIZE_BITS,TRUE); - Free(buf); - buf=buf2; - ptr=buf(U8 *)-offset(CDirEntry.start); - ptr->size=dir_size; - ptr->cluster=c; - WBlks(dv,buf,c,dir_size>>BLK_SIZE_BITS); - if (cur_dir_cluster==dv->root_cluster) { - br=CAlloc(BLK_SIZE); - RBlks(dv,br,dv->drv_offset,1); - br->root_cluster=c; - WBlks(dv,br,dv->drv_offset,1); - Free(br); - dv->root_cluster=c; - } else { - temp=StrNew(cur_dir); - parent_dir=StrNew(cur_dir); - StrLastRem(parent_dir,"/",temp); - if (!*parent_dir) { - Free(parent_dir); - parent_dir=StrNew("/"); - } - if (RedSeaFileFind(dv,Name2DirCluster(dv,parent_dir), - temp,&de2,FUF_JUST_DIRS)) { - de2.cluster=c; - de2.size=dir_size; - RedSeaDirNew(dv,parent_dir,&de2,FALSE); - } else - throw('Drv'); - Free(temp); - Free(parent_dir); - } - } - break; - } else if (ptr->attr & RS_ATTR_DELETED) { - if (!written) { - MemCpy(&ptr->start,&de->start,CDIR_SIZE); - WBlks(dv,buf(U8 *)+j<name,ptr->name)) { - if (free_old_chain) - RedSeaFreeClusters(dv,ptr->cluster, - (ptr->size+BLK_SIZE-1)>>BLK_SIZE_BITS); - if (!written) - MemCpy(&ptr->start,&de->start,CDIR_SIZE); - else - ptr->attr|=RS_ATTR_DELETED; - WBlks(dv,buf(U8 *)+j<=n) { - j++; - i=0; - } - } - Free(buf); - if (unlock) - DrvUnlock(dv); - if (unlock_break) - BreakUnlock; - } catch { - if (unlock) - DrvUnlock(dv); - if (unlock_break) - BreakUnlock; - } - return FALSE; -} - -I64 RedSeaFilesDel(CDrv *dv,U8 *cur_dir,U8 *files_find_mask,I64 fuf_flags, - Bool del_dir,Bool print_msg) -{ - CDirEntry *buf,*buf2,*ptr; - I64 i=0,res=0,ch,j=0,n=BLK_SIZE/CDIR_SIZE,cur_dir_cluster; - Bool unlock_break; - try { - unlock_break=BreakLock; - DrvLock(dv); - cur_dir_cluster=Name2DirCluster(dv,cur_dir); - buf2=MAlloc(BLK_SIZE); - RBlks(dv,buf2,cur_dir_cluster,1); - - ptr=buf2(U8 *)-offset(CDirEntry.start); - buf=MAlloc(ptr->size); - RBlks(dv,buf,cur_dir_cluster,ptr->size>>BLK_SIZE_BITS); - Free(buf2); - - ptr=buf(U8 *)-offset(CDirEntry.start); - *ptr->name='.'; - ptr->name[1]=0; - while (TRUE) { - if (!(ch=*ptr->name)) - break; - else if (!(ptr->attr & RS_ATTR_DELETED) && ch!='.' && (del_dir || - !(ptr->attr & RS_ATTR_DIR)) && - FilesFindMatch(ptr->name,files_find_mask,fuf_flags)) { - if (!(ptr->attr & RS_ATTR_DIR)) res++; - if (print_msg) - "Del %s\n",ptr->name; - ptr->attr|=RS_ATTR_DELETED; - WBlks(dv,buf(U8 *)+j<cluster, - (ptr->size+BLK_SIZE-1)>>BLK_SIZE_BITS); - } - ptr(U8 *)+=CDIR_SIZE; - if (++i>=n) { - j++; - i=0; - } - } - Free(buf); - DrvUnlock(dv); - if (unlock_break) - BreakUnlock; - } catch { - DrvUnlock(dv); - if (unlock_break) - BreakUnlock; - } - return res; -} - -I64 RedSeaFileWrite(CDrv *dv,U8 *cur_dir,U8 *name,U8 *buf,I64 size, - CDate cdt,I64 attr) -{ - CDirEntry de; - I64 c=0,blk_cnt; - MemSet(&de,0,sizeof(CDirEntry)); - if (size<0) size=0; - if (dv->fs_type!=FSt_REDSEA) - PrintErr("Not RedSea Drv\n"); - else if (!CFileNameTo(de.name,name)) - PrintErr("Invalid FileName.\n"); - else { - RedSeaFilesDel(dv,cur_dir,de.name,0,FALSE,FALSE); - de.size=size; - if (blk_cnt=(size+BLK_SIZE-1)>>BLK_SIZE_BITS) - c=ClustersAlloc(dv,0,blk_cnt,TRUE); //Always contiguous - else - c=INVALID_CLUSTER; - de.cluster=c; - de.attr=attr|RS_ATTR_CONTIGUOUS; - de.datetime=cdt; - if (blk_cnt) - WBlks(dv,buf,c,blk_cnt); - RedSeaDirNew(dv,cur_dir,&de,TRUE); - } - return c; -} - -CDirEntry *RedSeaFilesFind(U8 *files_find_mask,I64 fuf_flags, - CDirEntry *parent=NULL) -{ - CDrv *dv=Fs->cur_dv; - CDirEntry *buf,*buf2,*ptr,*res=NULL,*tempde; - I64 ch,cur_dir_cluster; - if (fuf_flags&~FUG_FILES_FIND) - throw('FUF'); - try { - DrvLock(dv); - cur_dir_cluster=Name2DirCluster(dv,Fs->cur_dir); - buf2=MAlloc(BLK_SIZE); - RBlks(dv,buf2,cur_dir_cluster,1); - - ptr=buf2(U8 *)-offset(CDirEntry.start); - buf=MAlloc(ptr->size); - RBlks(dv,buf,cur_dir_cluster,ptr->size>>BLK_SIZE_BITS); - Free(buf2); - - ptr=buf(U8 *)-offset(CDirEntry.start); - *ptr->name='.'; - ptr->name[1]=0; - ptr(U8 *)+=CDIR_SIZE; - ptr->cluster=Name2ParentDirCluster(dv,Fs->cur_dir); - ptr(U8 *)-=CDIR_SIZE; - while (TRUE) { - if (!(ch=*ptr->name)) - break; - else if (!(ptr->attr & RS_ATTR_DELETED)) { - tempde=CAlloc(sizeof(CDirEntry)); - MemCpy(&tempde->start,&ptr->start,CDIR_SIZE); - tempde->parent=parent; - if (Bt(&fuf_flags,FUf_RECURSE) && tempde->attr&RS_ATTR_DIR && - *tempde->name!='.') { - tempde->next=res; - res=tempde; - tempde->full_name=DirNameAbs(tempde->name); - DrvUnlock(dv); - if (Cd(tempde->name)) { - tempde->sub=RedSeaFilesFind(files_find_mask,fuf_flags,tempde); - Cd(".."); - } - DrvLock(dv); - } else { - tempde->full_name=FileNameAbs(tempde->name); - if ((tempde->attr&RS_ATTR_DIR || - !Bt(&fuf_flags,FUf_JUST_DIRS)) && - !(Bt(&fuf_flags,FUf_RECURSE) && *tempde->name=='.' && - tempde->attr&RS_ATTR_DIR) && - FilesFindMatch(tempde->full_name,files_find_mask,fuf_flags)) { - tempde->next=res; - res=tempde; - } else - DirEntryDel(tempde); - } - } - ptr(U8 *)+=CDIR_SIZE; - } - Free(buf); - DrvUnlock(dv); - } catch - DrvUnlock(dv); - return res; -} - -Bool RedSeaMkDir(CDrv *dv,U8 *cur_dir,U8 *name,I64 entry_cnt) -{//entry_cnt is for preallocating dir blks. - I64 c,cur_dir_cluster=Name2DirCluster(dv,cur_dir), - size=CeilU64((entry_cnt+3)<<6,BLK_SIZE); -#assert CDIR_SIZE==64 - U8 *buf=CAlloc(size); - CDirEntry *d_native=buf-offset(CDirEntry.start); - Bool unlock_break; - try { - unlock_break=BreakLock; - c=FileWrite(name,buf,size,0,RS_ATTR_DIR); - d_native->attr=RS_ATTR_DIR|RS_ATTR_CONTIGUOUS; - StrCpy(d_native->name,name); - d_native->cluster=c; - d_native->size=size; - d_native->datetime=Now; - d_native(U8 *)+=CDIR_SIZE; - - d_native->attr=RS_ATTR_DIR|RS_ATTR_CONTIGUOUS; - *d_native->name='.'; - d_native->name[1]='.'; - d_native->name[2]=0; - d_native->cluster=cur_dir_cluster; - d_native->size=0; - d_native->datetime=Now; - WBlks(dv,buf,c,1); - Free(buf); - if (unlock_break) - BreakUnlock; - } catch - if (unlock_break) - BreakUnlock; - return TRUE; -} diff --git a/Kernel/BlkDev/FileSysRedSea.HC b/Kernel/BlkDev/FileSysRedSea.HC new file mode 100644 index 0000000..c0c0d7e --- /dev/null +++ b/Kernel/BlkDev/FileSysRedSea.HC @@ -0,0 +1,637 @@ +// See $LK,"RedSea File System",A="FI:::/Doc/RedSea.DD"$ + +U0 RedSeaFreeFreeLst(CDrv *dv) +{ + CFreeLst *tempf,*tempf1; + Bool unlock; + try { + unlock=DrvLock(dv); + if (tempf=dv->next_free) { + while (tempf!=&dv->next_free) { + tempf1=tempf->next; + Free(tempf); + tempf=tempf1; + } + } + dv->next_free=NULL; + if (unlock) + DrvUnlock(dv); + } catch + if (unlock) + DrvUnlock(dv); +} + +U0 RedSeaFreeLstBuild(CDrv *dv) +{ + Bool unlock; + CFreeLst *tempf; + I64 i,first=dv->data_area,max_blk=dv->size+dv->drv_offset; + try { + unlock=DrvLock(dv); + if (dv->next_free) + RedSeaFreeFreeLst(dv); + QueInit(&dv->next_free); + while (firstcur_fat_blk,(first+i-dv->data_area)&(BLK_SIZE<<3-1))) + break; + else + i++; + } + if (i) { + tempf=AMAlloc(sizeof(CFreeLst)); + tempf->size=i; + tempf->start=first; + QueIns(tempf,dv->last_free); + } + first+=i+1; + } + if (unlock) + DrvUnlock(dv); + } catch + if (unlock) + DrvUnlock(dv); +} + +U0 RedSeaDrvInit(CDrv *dv) +{ + CRedSeaBoot br; + Bool unlock; + try { + unlock=DrvLock(dv); + RBlks(dv,&br,dv->drv_offset,1); + if (br.signature!=MBR_PT_REDSEA || br.signature2!=0xAA55) + throw('Drv'); + dv->fs_type=FSt_REDSEA; + RedSeaFreeFreeLst(dv); + dv->spc=1; + dv->size=br.sects; + dv->data_area=dv->drv_offset+br.bitmap_sects; + dv->root_cluster=br.root_cluster; + dv->fat1=dv->fat2=dv->drv_offset+1; + DrvFATBlkAlloc(dv); + if (unlock) + DrvUnlock(dv); + } catch + if (unlock) + DrvUnlock(dv); +} + +Bool RedSeaDrvValidate(U8 drv_let) +{ + CDrv *dv; + CRedSeaBoot br; + if ((dv=Let2Drv(drv_let,FALSE)) && dv->fs_type==FSt_REDSEA && + RBlks(dv,&br,dv->drv_offset,1) && br.signature==MBR_PT_REDSEA && + br.signature2==0xAA55 && br.sects==dv->size) + return TRUE; + else + return FALSE; +} + +U0 RedSeaFmt(U8 drv_let,Bool quick=TRUE) +{ + U8 *root_dir; + CDirEntry *d_native; + CRedSeaBoot *br=CAlloc(BLK_SIZE); + CDrv *dv=Let2Drv(drv_let); + I64 i,n,root_dir_blks; + try { + DrvLock(dv); +// DrvTypeSet(drv_let,FSt_REDSEA); + DrvTypeSet(drv_let,FSt_FAT32); + dv->fs_type=FSt_REDSEA; + br->signature=MBR_PT_REDSEA; + br->signature2=0xAA55; + br->drv_offset=dv->drv_offset; //For CD/DVD image copy. + br->sects=dv->size; + n=(br->sects+BLK_SIZE<<3-1)/BLK_SIZE<<3; + br->bitmap_sects=n; + br->unique_id=GetTSC^Now()(U64); + br->root_cluster=0; + + if (quick) + i=n+1; + else + i=dv->size; + WZeroBlks(dv,dv->drv_offset,i); + + WBlks(dv,br,dv->drv_offset,1); + RedSeaDrvInit(dv); + ClustersAlloc(dv,0,1,FALSE); //Alloc #1 + + root_dir_blks=MaxI64(1,dv->bd->init_root_dir_blks); + br->root_cluster=ClustersAlloc(dv,0,root_dir_blks,FALSE); + WBlks(dv,br,dv->drv_offset,1); + root_dir=CAlloc(BLK_SIZE*root_dir_blks); + + d_native=root_dir-offset(CDirEntry.start); + + d_native->attr=RS_ATTR_DIR|RS_ATTR_CONTIGUOUS; + *d_native->name='.'; + d_native->cluster=br->root_cluster; + d_native->size=BLK_SIZE*root_dir_blks; + d_native->datetime=Now; + + d_native(U8 *)+=CDIR_SIZE; + + *d_native->name='.'; + d_native->name[1]='.'; + d_native->attr=RS_ATTR_DIR|RS_ATTR_CONTIGUOUS; + d_native->cluster=br->root_cluster; + d_native->datetime=Now; + + WBlks(dv,root_dir,br->root_cluster,root_dir_blks); + RedSeaDrvInit(dv); + DrvUnlock(dv); + } catch + DrvUnlock(dv); + Free(br); + Free(root_dir); +} + +Bool RedSeaFileFind(CDrv *dv,I64 cur_dir_cluster,U8 *name, + CDirEntry *_res,I64 fuf_flags=0) +{//$LK,"FUF_JUST_DIRS",A="MN:FUF_JUST_DIRS"$, $LK,"FUF_JUST_FILES",A="MN:FUF_JUST_FILES"$ + CDirEntry *buf,*buf2,*ptr; + U8 dname[CDIR_FILENAME_LEN]; + I64 ch; + Bool res=FALSE,unlock; + if (fuf_flags&~FUG_FILE_FIND) + throw('FUF'); + MemSet(_res,0,sizeof(CDirEntry)); + DrvChk(dv); + if (dv->fs_type!=FSt_REDSEA) + PrintErr("Not RedSea Drv\n"); + else if (!CFileNameTo(dname,name)) + PrintErr("Invalid FileName.\n"); + else + try { + unlock=DrvLock(dv); + buf2=MAlloc(BLK_SIZE); + RBlks(dv,buf2,cur_dir_cluster,1); + + ptr=buf2(U8 *)-offset(CDirEntry.start); + buf=MAlloc(ptr->size); + RBlks(dv,buf,cur_dir_cluster,ptr->size>>BLK_SIZE_BITS); + Free(buf2); + + ptr=buf(U8 *)-offset(CDirEntry.start); + *ptr->name='.'; + ptr->name[1]=0; + while (TRUE) { + if (!(ch=*ptr->name)) + break; + else if (!(ptr->attr & RS_ATTR_DELETED) && + !(fuf_flags&FUF_JUST_DIRS && !(ptr->attr & RS_ATTR_DIR)) && + !(fuf_flags&FUF_JUST_FILES && ptr->attr & RS_ATTR_DIR) && + !StrCmp(dname,ptr->name)) { + MemCpy(&_res->attr,&ptr->attr,CDIR_SIZE); + res=TRUE; + goto rsff_done; + } + ptr(U8 *)+=CDIR_SIZE; + } +rsff_done: + Free(buf); + if (unlock) + DrvUnlock(dv); + } catch + if (unlock) + DrvUnlock(dv); + return res; +} + +U8 *RedSeaFileRead(CDrv *dv,U8 *cur_dir,U8 *filename,I64 *_size,I64 *_attr) +{ + U8 *buf=NULL; + CDirEntry de; + I64 c,blk_cnt,cur_dir_cluster; + DrvChk(dv); + *_size=0; + *_attr=0; + if (dv->fs_type!=FSt_REDSEA) + PrintErr("Not RedSea Drv\n"); + else + try { + DrvLock(dv); + cur_dir_cluster=Name2DirCluster(dv,cur_dir); + if (RedSeaFileFind(dv,cur_dir_cluster,filename,&de,FUF_JUST_FILES)) { + blk_cnt=(de.size+BLK_SIZE-1)>>BLK_SIZE_BITS; + buf=MAlloc(blk_cnt<cur_dv->fs_type!=FSt_REDSEA) + PrintErr("Not RedSea Drv\n"); + else if (RedSeaFileFind(Fs->cur_dv,cur_dir_cluster,name,&de,FUF_JUST_DIRS)) + return TRUE; + else { + "%s ",name; + PrintErr("File not found.\n"); + } + return FALSE; +} + +U0 RedSeaFreeClusters(CDrv *dv,I64 c,I64 cnt) +{ + CFreeLst *tempf; + Bool found=FALSE,unlock,unlock_break; + DrvChk(dv); + if (!c) return; + if (dv->fs_type!=FSt_REDSEA) + PrintErr("Not RedSea Drv\n"); + else + try { + unlock_break=BreakLock; + unlock=DrvLock(dv); + if (!dv->next_free) + RedSeaFreeLstBuild(dv); + tempf=dv->next_free; + while (!found && tempf!=&dv->next_free) { + if (tempf->start+tempf->size==c) { + tempf->size+=cnt; + found=TRUE; + } else if (c+cnt==tempf->start) { + tempf->size+=cnt; + tempf->start=c; + found=TRUE; + } + tempf=tempf->next; + } + if (!found) { + tempf=AMAlloc(sizeof(CFreeLst)); + tempf->size=cnt; + tempf->start=c; + QueIns(tempf,dv->last_free); + } + while (cnt-->0) { + DrvFATBlkSet(dv,c); + LBtr(dv->cur_fat_blk,(c-dv->data_area)&(BLK_SIZE<<3-1)); + LBts(&dv->fat_blk_dirty,0); + c++; + } + DrvFATBlkClean(dv); + + if (unlock) + DrvUnlock(dv); + if (unlock_break) + BreakUnlock; + } catch { + if (unlock) + DrvUnlock(dv); + if (unlock_break) + BreakUnlock; + } +} + +I64 RedSeaAllocClusters(CDrv *dv,I64 cnt) +{ + CFreeLst *tempf,*best_free=NULL; + I64 i,first,best_size=MAX_I64; + Bool unlock,unlock_break; + if (cnt<=0) + throw('Drv'); + try { + unlock_break=BreakLock; + unlock=DrvLock(dv); + if (!dv->next_free) + RedSeaFreeLstBuild(dv); + tempf=dv->next_free; + while (tempf!=&dv->next_free) { + if (tempf->size>=cnt && tempf->sizesize; + if (tempf->size==cnt) + break; + } + tempf=tempf->next; + } + if (!best_free) + throw('Drv'); + first=best_free->start; + for (i=0;icur_fat_blk,(first+i-dv->data_area)&(BLK_SIZE<<3-1)); + LBts(&dv->fat_blk_dirty,0); + } + DrvFATBlkClean(dv); + if (best_free->size-=cnt) + best_free->start+=cnt; + else { + QueRem(best_free); + Free(best_free); + } + if (unlock) + DrvUnlock(dv); + if (unlock_break) + BreakUnlock; + } catch { + if (unlock) + DrvUnlock(dv); + if (unlock_break) + BreakUnlock; + } + return first; +} + +Bool RedSeaDirNew(CDrv *dv,U8 *cur_dir,CDirEntry *tempde,Bool free_old_chain) +{ + CDirEntry *buf,*buf2,*ptr,de2; + CRedSeaBoot *br; + I64 c,ch,i=1,j=0,n=BLK_SIZE/CDIR_SIZE,dir_size,cur_dir_cluster; + Bool written=FALSE,unlock,unlock_break; + U8 *temp,*parent_dir; + try { + unlock_break=BreakLock; + tempde->attr|=RS_ATTR_CONTIGUOUS; + unlock=DrvLock(dv); + cur_dir_cluster=Name2DirCluster(dv,cur_dir); + buf2=MAlloc(BLK_SIZE); + RBlks(dv,buf2,cur_dir_cluster,1); + + ptr=buf2(U8 *)-offset(CDirEntry.start); + buf=MAlloc(ptr->size); + RBlks(dv,buf,cur_dir_cluster,ptr->size>>BLK_SIZE_BITS); + + dir_size=ptr->size; + ptr=buf(U8 *)-offset(CDirEntry.start)+CDIR_SIZE; + Free(buf2); + while (TRUE) { + if (!(ch=*ptr->name)) { + if (!written) + MemCpy(&ptr->start,&tempde->start,CDIR_SIZE); + if ((i+1)*CDIR_SIZE+j<>BLK_SIZE_BITS); + dir_size+=BLK_SIZE; + c=ClustersAlloc(dv,0,dir_size>>BLK_SIZE_BITS,TRUE); + Free(buf); + buf=buf2; + ptr=buf(U8 *)-offset(CDirEntry.start); + ptr->size=dir_size; + ptr->cluster=c; + WBlks(dv,buf,c,dir_size>>BLK_SIZE_BITS); + if (cur_dir_cluster==dv->root_cluster) { + br=CAlloc(BLK_SIZE); + RBlks(dv,br,dv->drv_offset,1); + br->root_cluster=c; + WBlks(dv,br,dv->drv_offset,1); + Free(br); + dv->root_cluster=c; + } else { + temp=StrNew(cur_dir); + parent_dir=StrNew(cur_dir); + StrLastRem(parent_dir,"/",temp); + if (!*parent_dir) { + Free(parent_dir); + parent_dir=StrNew("/"); + } + if (RedSeaFileFind(dv,Name2DirCluster(dv,parent_dir), + temp,&de2,FUF_JUST_DIRS)) { + de2.cluster=c; + de2.size=dir_size; + RedSeaDirNew(dv,parent_dir,&de2,FALSE); + } else + throw('Drv'); + Free(temp); + Free(parent_dir); + } + } + break; + } else if (ptr->attr & RS_ATTR_DELETED) { + if (!written) { + MemCpy(&ptr->start,&tempde->start,CDIR_SIZE); + WBlks(dv,buf(U8 *)+j<name,ptr->name)) { + if (free_old_chain) + RedSeaFreeClusters(dv,ptr->cluster, + (ptr->size+BLK_SIZE-1)>>BLK_SIZE_BITS); + if (!written) + MemCpy(&ptr->start,&tempde->start,CDIR_SIZE); + else + ptr->attr|=RS_ATTR_DELETED; + WBlks(dv,buf(U8 *)+j<=n) { + j++; + i=0; + } + } + Free(buf); + if (unlock) + DrvUnlock(dv); + if (unlock_break) + BreakUnlock; + } catch { + if (unlock) + DrvUnlock(dv); + if (unlock_break) + BreakUnlock; + } + return FALSE; +} + +I64 RedSeaFilesDel(CDrv *dv,U8 *cur_dir,U8 *files_find_mask,I64 fuf_flags, + Bool del_dir,Bool print_msg) +{ + CDirEntry *buf,*buf2,*ptr; + I64 i=0,res=0,ch,j=0,n=BLK_SIZE/CDIR_SIZE,cur_dir_cluster; + Bool unlock_break; + try { + unlock_break=BreakLock; + DrvLock(dv); + cur_dir_cluster=Name2DirCluster(dv,cur_dir); + buf2=MAlloc(BLK_SIZE); + RBlks(dv,buf2,cur_dir_cluster,1); + + ptr=buf2(U8 *)-offset(CDirEntry.start); + buf=MAlloc(ptr->size); + RBlks(dv,buf,cur_dir_cluster,ptr->size>>BLK_SIZE_BITS); + Free(buf2); + + ptr=buf(U8 *)-offset(CDirEntry.start); + *ptr->name='.'; + ptr->name[1]=0; + while (TRUE) { + if (!(ch=*ptr->name)) + break; + else if (!(ptr->attr & RS_ATTR_DELETED) && ch!='.' && (del_dir || + !(ptr->attr & RS_ATTR_DIR)) && + FilesFindMatch(ptr->name,files_find_mask,fuf_flags)) { + if (!(ptr->attr & RS_ATTR_DIR)) res++; + if (print_msg) + "Del %s\n",ptr->name; + ptr->attr|=RS_ATTR_DELETED; + WBlks(dv,buf(U8 *)+j<cluster, + (ptr->size+BLK_SIZE-1)>>BLK_SIZE_BITS); + } + ptr(U8 *)+=CDIR_SIZE; + if (++i>=n) { + j++; + i=0; + } + } + Free(buf); + DrvUnlock(dv); + if (unlock_break) + BreakUnlock; + } catch { + DrvUnlock(dv); + if (unlock_break) + BreakUnlock; + } + return res; +} + +I64 RedSeaFileWrite(CDrv *dv,U8 *cur_dir,U8 *name,U8 *buf,I64 size, + CDate cdt,I64 attr) +{ + CDirEntry de; + I64 c=0,blk_cnt; + MemSet(&de,0,sizeof(CDirEntry)); + if (size<0) size=0; + if (dv->fs_type!=FSt_REDSEA) + PrintErr("Not RedSea Drv\n"); + else if (!CFileNameTo(de.name,name)) + PrintErr("Invalid FileName.\n"); + else { + RedSeaFilesDel(dv,cur_dir,de.name,0,FALSE,FALSE); + de.size=size; + if (blk_cnt=(size+BLK_SIZE-1)>>BLK_SIZE_BITS) + c=ClustersAlloc(dv,0,blk_cnt,TRUE); //Always contiguous + else + c=INVALID_CLUSTER; + de.cluster=c; + de.attr=attr|RS_ATTR_CONTIGUOUS; + de.datetime=cdt; + if (blk_cnt) + WBlks(dv,buf,c,blk_cnt); + RedSeaDirNew(dv,cur_dir,&de,TRUE); + } + return c; +} + +CDirEntry *RedSeaFilesFind(U8 *files_find_mask,I64 fuf_flags, + CDirEntry *parent=NULL) +{ + CDrv *dv=Fs->cur_dv; + CDirEntry *buf,*buf2,*ptr,*res=NULL,*tempde; + I64 ch,cur_dir_cluster; + if (fuf_flags&~FUG_FILES_FIND) + throw('FUF'); + try { + DrvLock(dv); + cur_dir_cluster=Name2DirCluster(dv,Fs->cur_dir); + buf2=MAlloc(BLK_SIZE); + RBlks(dv,buf2,cur_dir_cluster,1); + + ptr=buf2(U8 *)-offset(CDirEntry.start); + buf=MAlloc(ptr->size); + RBlks(dv,buf,cur_dir_cluster,ptr->size>>BLK_SIZE_BITS); + Free(buf2); + + ptr=buf(U8 *)-offset(CDirEntry.start); + *ptr->name='.'; + ptr->name[1]=0; + ptr(U8 *)+=CDIR_SIZE; + ptr->cluster=Name2ParentDirCluster(dv,Fs->cur_dir); + ptr(U8 *)-=CDIR_SIZE; + while (TRUE) { + if (!(ch=*ptr->name)) + break; + else if (!(ptr->attr & RS_ATTR_DELETED)) { + tempde=CAlloc(sizeof(CDirEntry)); + MemCpy(&tempde->start,&ptr->start,CDIR_SIZE); + tempde->parent=parent; + if (Bt(&fuf_flags,FUf_RECURSE) && tempde->attr&RS_ATTR_DIR && + *tempde->name!='.') { + tempde->next=res; + res=tempde; + tempde->full_name=DirNameAbs(tempde->name); + DrvUnlock(dv); + if (Cd(tempde->name)) { + tempde->sub=RedSeaFilesFind(files_find_mask,fuf_flags,tempde); + Cd(".."); + } + DrvLock(dv); + } else { + tempde->full_name=FileNameAbs(tempde->name); + if ((tempde->attr&RS_ATTR_DIR || + !Bt(&fuf_flags,FUf_JUST_DIRS)) && + !(Bt(&fuf_flags,FUf_RECURSE) && *tempde->name=='.' && + tempde->attr&RS_ATTR_DIR) && + FilesFindMatch(tempde->full_name,files_find_mask,fuf_flags)) { + tempde->next=res; + res=tempde; + } else + DirEntryDel(tempde); + } + } + ptr(U8 *)+=CDIR_SIZE; + } + Free(buf); + DrvUnlock(dv); + } catch + DrvUnlock(dv); + return res; +} + +Bool RedSeaMkDir(CDrv *dv,U8 *cur_dir,U8 *name,I64 entry_cnt) +{//entry_cnt is for preallocating dir blks. + I64 c,cur_dir_cluster=Name2DirCluster(dv,cur_dir), + size=CeilU64((entry_cnt+3)<<6,BLK_SIZE); +#assert CDIR_SIZE==64 + U8 *buf=CAlloc(size); + CDirEntry *d_native=buf-offset(CDirEntry.start); + Bool unlock_break; + try { + unlock_break=BreakLock; + c=FileWrite(name,buf,size,0,RS_ATTR_DIR); + d_native->attr=RS_ATTR_DIR|RS_ATTR_CONTIGUOUS; + StrCpy(d_native->name,name); + d_native->cluster=c; + d_native->size=size; + d_native->datetime=Now; + d_native(U8 *)+=CDIR_SIZE; + + d_native->attr=RS_ATTR_DIR|RS_ATTR_CONTIGUOUS; + *d_native->name='.'; + d_native->name[1]='.'; + d_native->name[2]=0; + d_native->cluster=cur_dir_cluster; + d_native->size=0; + d_native->datetime=Now; + WBlks(dv,buf,c,1); + Free(buf); + if (unlock_break) + BreakUnlock; + } catch + if (unlock_break) + BreakUnlock; + return TRUE; +} diff --git a/Kernel/BlkDev/MakeBlkDev.CPP b/Kernel/BlkDev/MakeBlkDev.HC similarity index 100% rename from Kernel/BlkDev/MakeBlkDev.CPP rename to Kernel/BlkDev/MakeBlkDev.HC diff --git a/Kernel/Compress.CPP b/Kernel/Compress.CPP deleted file mode 100644 index 53316d1..0000000 --- a/Kernel/Compress.CPP +++ /dev/null @@ -1,308 +0,0 @@ -//See $LK,"::/Doc/Credits.TXT"$. -//See $LK,"CArcCompress",A="MN:CArcCompress"$, $LK,"CArcEntry",A="MN:CArcEntry"$, and $LK,"CArcCtrl",A="MN:CArcCtrl"$ - -asm { -/**** -U0 ArcEntryGet(CArcCtrl *c) -{ - I64 i; - CArcEntry *temp,*temp1; - - if (c->entry_used) { - i=c->free_idx; - - c->entry_used=FALSE; - c->cur_entry=c->next_entry; - c->cur_bits_in_use=c->next_bits_in_use; - if (c->next_bits_in_usenext_entry = &c->compress[i++]; - if (i==c->free_limit) { - c->next_bits_in_use++; - c->free_limit=1<next_bits_in_use; - } - } else { - do if (++i==c->free_limit) - i=c->min_table_entry; - while (c->hash[i]); - temp=&c->compress[i]; - c->next_entry=temp; - temp1=&c->hash[temp->basecode]; - while (temp1) { - if (temp1->next==temp) { - temp1->next=temp->next; - break; - } else - temp1=temp1->next; - } - } - c->free_idx=i; - } -} -****/ -_ARC_ENTRY_GET:: - PUSH RBP - MOV RBP,RSP - PUSH RSI - PUSH RDI - MOV RSI,U64 SF_ARG1[RBP] - BTR U64 CArcCtrl.entry_used[RSI],0 - JNC I32 @@30 - MOV RDX,U64 CArcCtrl.free_idx[RSI] - MOV RAX,U64 CArcCtrl.next_entry[RSI] - MOV U64 CArcCtrl.cur_entry[RSI],RAX - MOV RCX,U64 CArcCtrl.next_bits_in_use[RSI] - MOV U64 CArcCtrl.cur_bits_in_use[RSI],RCX - CMP RCX,ARC_MAX_BITS - JAE @@05 - MOV RAX,RDX - SHL RAX,4 - LEA RAX,U64 CArcCtrl.compress[RSI+RAX] - MOV U64 CArcCtrl.next_entry[RSI],RAX - INC RDX - CMP U64 CArcCtrl.free_limit[RSI],RDX - JNE @@25 - INC RCX - MOV U64 CArcCtrl.next_bits_in_use[RSI],RCX - MOV RAX,1 - SHL RAX,CL - MOV U64 CArcCtrl.free_limit[RSI],RAX - JMP @@25 -@@05: INC RDX - CMP U64 CArcCtrl.free_limit[RSI],RDX - JNE @@10 - MOV RDX,U64 CArcCtrl.min_table_entry[RSI] -@@10: MOV RAX,U64 CArcCtrl.hash[RSI+RDX*8] - TEST RAX,RAX - JNZ @@05 - MOV RDI,RDX - SHL RDI,4 - LEA RDI,U64 CArcCtrl.compress[RSI+RDI] - MOV U32 CArcCtrl.next_entry[RSI],EDI - MOVZX RBX,U16 CArcEntry.basecode[RDI] - LEA RCX,U64 CArcCtrl.hash[RSI+RBX*8] -@@15: TEST RCX,RCX - JZ @@25 - MOV RAX,U64 CArcEntry.next[RCX] - CMP RDI,RAX - JNE @@20 - MOV RAX,U64 CArcEntry.next[RDI] - MOV U64 CArcEntry.next[RCX],RAX - JMP @@25 -@@20: MOV RCX,RAX - JMP @@15 -@@25: MOV U64 CArcCtrl.free_idx[RSI],RDX -@@30: POP RDI - POP RSI - POP RBP - RET1 8 -} - -_extern _ARC_ENTRY_GET U0 ArcEntryGet(CArcCtrl *c); - -I64 ArcDetermineCompressionType(U8 *src,I64 size) -{ - while (size--) - if (*src++&0x80) - return CT_8_BIT; - return CT_7_BIT; -} - -U0 ArcCompressBuf(CArcCtrl *c) -{//Use $LK,"CompressBuf",A="MN:CompressBuf"$() unless doing more than one buf. - CArcEntry *temp,*temp1; - I64 ch,basecode; - U8 *src_ptr,*src_limit; - - src_ptr=c->src_buf+c->src_pos; - src_limit=c->src_buf+c->src_size; - - if (c->saved_basecode==MAX_U32) - basecode=*src_ptr++; - else - basecode=c->saved_basecode; - - while (src_ptrdst_pos+c->cur_bits_in_use<=c->dst_size) { - ArcEntryGet(c); -ac_start: - if (src_ptr>=src_limit) goto ac_done; - ch=*src_ptr++; - if (temp=c->hash[basecode]) - do { - if (temp->ch==ch) { - basecode=temp-&c->compress[0]; - goto ac_start; - } - } while (temp=temp->next); - - BFieldOrU32(c->dst_buf,c->dst_pos,basecode); - c->dst_pos+=c->cur_bits_in_use; - - c->entry_used=TRUE; - temp=c->cur_entry; - temp->basecode=basecode; - temp->ch=ch; - temp1=&c->hash[basecode]; - temp->next=temp1->next; - temp1->next=temp; - - basecode=ch; - } -ac_done: - c->saved_basecode=basecode; - c->src_pos=src_ptr-c->src_buf; -} - -Bool ArcFinishCompression(CArcCtrl *c) -{//Do closing touch on archivew ctrl struct. - if (c->dst_pos+c->cur_bits_in_use<=c->dst_size) { - BFieldOrU32(c->dst_buf,c->dst_pos,c->saved_basecode); - c->dst_pos+=c->next_bits_in_use; - return TRUE; - } else - return FALSE; -} - -U0 ArcExpandBuf(CArcCtrl *c) -{//Use $LK,"ExpandBuf",A="MN:ExpandBuf"$() unless you know what you're doing. - U8 *dst_ptr,*dst_limit; - I64 basecode,lastcode,code; - CArcEntry *temp,*temp1; - - dst_ptr=c->dst_buf+c->dst_pos; - dst_limit=c->dst_buf+c->dst_size; - - while (dst_ptrstk_ptr!=c->stk_base) - *dst_ptr++ = * -- c->stk_ptr; - - if (c->stk_ptr==c->stk_base && dst_ptrsaved_basecode==MAX_U32) { - lastcode=BFieldExtU32(c->src_buf,c->src_pos, - c->next_bits_in_use); - c->src_pos+=c->next_bits_in_use; - *dst_ptr++=lastcode; - ArcEntryGet(c); - c->last_ch=lastcode; - } else - lastcode=c->saved_basecode; - while (dst_ptrsrc_pos+c->next_bits_in_use<=c->src_size) { - basecode=BFieldExtU32(c->src_buf,c->src_pos, - c->next_bits_in_use); - c->src_pos+=c->next_bits_in_use; - if (c->cur_entry==&c->compress[basecode]) { - *c->stk_ptr++=c->last_ch; - code=lastcode; - } else - code=basecode; - while (code>=c->min_table_entry) { - *c->stk_ptr++=c->compress[code].ch; - code=c->compress[code].basecode; - } - *c->stk_ptr++=code; - c->last_ch=code; - - c->entry_used=TRUE; - temp=c->cur_entry; - temp->basecode=lastcode; - temp->ch=c->last_ch; - temp1=&c->hash[lastcode]; - temp->next=temp1->next; - temp1->next=temp; - - ArcEntryGet(c); - while (dst_ptrstk_ptr!=c->stk_base) - *dst_ptr++ = * -- c->stk_ptr; - lastcode=basecode; - } - c->saved_basecode=lastcode; - } - c->dst_pos=dst_ptr-c->dst_buf; -} - -CArcCtrl *ArcCtrlNew(Bool expand,I64 compression_type=CT_8_BIT) -{//MAlloc archive ctrl struct. - CArcCtrl *c; - c=CAlloc(sizeof(CArcCtrl)); - if (expand) { - c->stk_base=MAlloc(1<stk_ptr=c->stk_base; - } - if (compression_type==CT_7_BIT) - c->min_bits=7; - else - c->min_bits=8; - c->min_table_entry=1<min_bits; - c->free_idx=c->min_table_entry; - c->next_bits_in_use=c->min_bits+1; - c->free_limit=1<next_bits_in_use; - c->saved_basecode=MAX_U32; - c->entry_used=TRUE; - ArcEntryGet(c); - c->entry_used=TRUE; - return c; -} - -U0 ArcCtrlDel(CArcCtrl *c) -{//Free archive ctrl struct. - Free(c->stk_base); - Free(c); -} - -U8 *ExpandBuf(CArcCompress *arc,CTask *mem_task=NULL) -{//See $LK,"::/Demo/Dsk/SerializeTree.CPP"$. - CArcCtrl *c; - U8 *res; - - if (!(CT_NONE<=arc->compression_type<=CT_8_BIT) || - arc->expanded_size>MEM_MAPPED_SPACE) - throw('Compress'); - - res=MAlloc(arc->expanded_size+1,mem_task); - res[arc->expanded_size]=0; //terminate - switch [arc->compression_type] { - case CT_NONE: - MemCpy(res,&arc->body,arc->expanded_size); - break; - case CT_7_BIT: - case CT_8_BIT: - c=ArcCtrlNew(TRUE,arc->compression_type); - c->src_size=arc->compressed_size<<3; - c->src_pos=sizeof(CArcCompress)<<3; - c->src_buf=arc; - c->dst_size=arc->expanded_size; - c->dst_buf=res; - c->dst_pos=0; - ArcExpandBuf(c); - ArcCtrlDel(c); - break; - } - return res; -} - -CArcCompress *CompressBuf(U8 *src,I64 size,CTask *mem_task=NULL) -{//See $LK,"::/Demo/Dsk/SerializeTree.CPP"$. - CArcCompress *arc; - I64 size_out,compression_type=ArcDetermineCompressionType(src,size); - CArcCtrl *c=ArcCtrlNew(FALSE,compression_type); - c->src_size=size; - c->src_buf=src; - c->dst_size=(size+sizeof(CArcCompress))<<3; - c->dst_buf=CAlloc(c->dst_size>>3); - c->dst_pos=sizeof(CArcCompress)<<3; - ArcCompressBuf(c); - if (ArcFinishCompression(c) && c->src_pos==c->src_size) { - size_out=(c->dst_pos+7)>>3; - arc=MAlloc(size_out,mem_task); - MemCpy(arc,c->dst_buf,size_out); - arc->compression_type=compression_type; - arc->compressed_size=size_out; - } else { - arc=MAlloc(size+sizeof(CArcCompress),mem_task); - MemCpy(&arc->body,src,size); - arc->compression_type=CT_NONE; - arc->compressed_size=size+sizeof(CArcCompress); - } - arc->expanded_size=size; - Free(c->dst_buf); - ArcCtrlDel(c); - return arc; -} diff --git a/Kernel/Compress.HC b/Kernel/Compress.HC new file mode 100644 index 0000000..a042613 --- /dev/null +++ b/Kernel/Compress.HC @@ -0,0 +1,308 @@ +//See $LK,"::/Doc/Credits.DD"$. +//See $LK,"CArcCompress",A="MN:CArcCompress"$, $LK,"CArcEntry",A="MN:CArcEntry"$, and $LK,"CArcCtrl",A="MN:CArcCtrl"$ + +asm { +/**** +U0 ArcEntryGet(CArcCtrl *c) +{ + I64 i; + CArcEntry *temp,*temp1; + + if (c->entry_used) { + i=c->free_idx; + + c->entry_used=FALSE; + c->cur_entry=c->next_entry; + c->cur_bits_in_use=c->next_bits_in_use; + if (c->next_bits_in_usenext_entry = &c->compress[i++]; + if (i==c->free_limit) { + c->next_bits_in_use++; + c->free_limit=1<next_bits_in_use; + } + } else { + do if (++i==c->free_limit) + i=c->min_table_entry; + while (c->hash[i]); + temp=&c->compress[i]; + c->next_entry=temp; + temp1=&c->hash[temp->basecode]; + while (temp1) { + if (temp1->next==temp) { + temp1->next=temp->next; + break; + } else + temp1=temp1->next; + } + } + c->free_idx=i; + } +} +****/ +_ARC_ENTRY_GET:: + PUSH RBP + MOV RBP,RSP + PUSH RSI + PUSH RDI + MOV RSI,U64 SF_ARG1[RBP] + BTR U64 CArcCtrl.entry_used[RSI],0 + JNC I32 @@30 + MOV RDX,U64 CArcCtrl.free_idx[RSI] + MOV RAX,U64 CArcCtrl.next_entry[RSI] + MOV U64 CArcCtrl.cur_entry[RSI],RAX + MOV RCX,U64 CArcCtrl.next_bits_in_use[RSI] + MOV U64 CArcCtrl.cur_bits_in_use[RSI],RCX + CMP RCX,ARC_MAX_BITS + JAE @@05 + MOV RAX,RDX + SHL RAX,4 + LEA RAX,U64 CArcCtrl.compress[RSI+RAX] + MOV U64 CArcCtrl.next_entry[RSI],RAX + INC RDX + CMP U64 CArcCtrl.free_limit[RSI],RDX + JNE @@25 + INC RCX + MOV U64 CArcCtrl.next_bits_in_use[RSI],RCX + MOV RAX,1 + SHL RAX,CL + MOV U64 CArcCtrl.free_limit[RSI],RAX + JMP @@25 +@@05: INC RDX + CMP U64 CArcCtrl.free_limit[RSI],RDX + JNE @@10 + MOV RDX,U64 CArcCtrl.min_table_entry[RSI] +@@10: MOV RAX,U64 CArcCtrl.hash[RSI+RDX*8] + TEST RAX,RAX + JNZ @@05 + MOV RDI,RDX + SHL RDI,4 + LEA RDI,U64 CArcCtrl.compress[RSI+RDI] + MOV U32 CArcCtrl.next_entry[RSI],EDI + MOVZX RBX,U16 CArcEntry.basecode[RDI] + LEA RCX,U64 CArcCtrl.hash[RSI+RBX*8] +@@15: TEST RCX,RCX + JZ @@25 + MOV RAX,U64 CArcEntry.next[RCX] + CMP RDI,RAX + JNE @@20 + MOV RAX,U64 CArcEntry.next[RDI] + MOV U64 CArcEntry.next[RCX],RAX + JMP @@25 +@@20: MOV RCX,RAX + JMP @@15 +@@25: MOV U64 CArcCtrl.free_idx[RSI],RDX +@@30: POP RDI + POP RSI + POP RBP + RET1 8 +} + +_extern _ARC_ENTRY_GET U0 ArcEntryGet(CArcCtrl *c); + +I64 ArcDetermineCompressionType(U8 *src,I64 size) +{ + while (size--) + if (*src++&0x80) + return CT_8_BIT; + return CT_7_BIT; +} + +U0 ArcCompressBuf(CArcCtrl *c) +{//Use $LK,"CompressBuf",A="MN:CompressBuf"$() unless doing more than one buf. + CArcEntry *temp,*temp1; + I64 ch,basecode; + U8 *src_ptr,*src_limit; + + src_ptr=c->src_buf+c->src_pos; + src_limit=c->src_buf+c->src_size; + + if (c->saved_basecode==MAX_U32) + basecode=*src_ptr++; + else + basecode=c->saved_basecode; + + while (src_ptrdst_pos+c->cur_bits_in_use<=c->dst_size) { + ArcEntryGet(c); +ac_start: + if (src_ptr>=src_limit) goto ac_done; + ch=*src_ptr++; + if (temp=c->hash[basecode]) + do { + if (temp->ch==ch) { + basecode=temp-&c->compress[0]; + goto ac_start; + } + } while (temp=temp->next); + + BFieldOrU32(c->dst_buf,c->dst_pos,basecode); + c->dst_pos+=c->cur_bits_in_use; + + c->entry_used=TRUE; + temp=c->cur_entry; + temp->basecode=basecode; + temp->ch=ch; + temp1=&c->hash[basecode]; + temp->next=temp1->next; + temp1->next=temp; + + basecode=ch; + } +ac_done: + c->saved_basecode=basecode; + c->src_pos=src_ptr-c->src_buf; +} + +Bool ArcFinishCompression(CArcCtrl *c) +{//Do closing touch on archivew ctrl struct. + if (c->dst_pos+c->cur_bits_in_use<=c->dst_size) { + BFieldOrU32(c->dst_buf,c->dst_pos,c->saved_basecode); + c->dst_pos+=c->next_bits_in_use; + return TRUE; + } else + return FALSE; +} + +U0 ArcExpandBuf(CArcCtrl *c) +{//Use $LK,"ExpandBuf",A="MN:ExpandBuf"$() unless you know what you're doing. + U8 *dst_ptr,*dst_limit; + I64 basecode,lastcode,code; + CArcEntry *temp,*temp1; + + dst_ptr=c->dst_buf+c->dst_pos; + dst_limit=c->dst_buf+c->dst_size; + + while (dst_ptrstk_ptr!=c->stk_base) + *dst_ptr++ = * -- c->stk_ptr; + + if (c->stk_ptr==c->stk_base && dst_ptrsaved_basecode==MAX_U32) { + lastcode=BFieldExtU32(c->src_buf,c->src_pos, + c->next_bits_in_use); + c->src_pos+=c->next_bits_in_use; + *dst_ptr++=lastcode; + ArcEntryGet(c); + c->last_ch=lastcode; + } else + lastcode=c->saved_basecode; + while (dst_ptrsrc_pos+c->next_bits_in_use<=c->src_size) { + basecode=BFieldExtU32(c->src_buf,c->src_pos, + c->next_bits_in_use); + c->src_pos+=c->next_bits_in_use; + if (c->cur_entry==&c->compress[basecode]) { + *c->stk_ptr++=c->last_ch; + code=lastcode; + } else + code=basecode; + while (code>=c->min_table_entry) { + *c->stk_ptr++=c->compress[code].ch; + code=c->compress[code].basecode; + } + *c->stk_ptr++=code; + c->last_ch=code; + + c->entry_used=TRUE; + temp=c->cur_entry; + temp->basecode=lastcode; + temp->ch=c->last_ch; + temp1=&c->hash[lastcode]; + temp->next=temp1->next; + temp1->next=temp; + + ArcEntryGet(c); + while (dst_ptrstk_ptr!=c->stk_base) + *dst_ptr++ = * -- c->stk_ptr; + lastcode=basecode; + } + c->saved_basecode=lastcode; + } + c->dst_pos=dst_ptr-c->dst_buf; +} + +CArcCtrl *ArcCtrlNew(Bool expand,I64 compression_type=CT_8_BIT) +{//MAlloc archive ctrl struct. + CArcCtrl *c; + c=CAlloc(sizeof(CArcCtrl)); + if (expand) { + c->stk_base=MAlloc(1<stk_ptr=c->stk_base; + } + if (compression_type==CT_7_BIT) + c->min_bits=7; + else + c->min_bits=8; + c->min_table_entry=1<min_bits; + c->free_idx=c->min_table_entry; + c->next_bits_in_use=c->min_bits+1; + c->free_limit=1<next_bits_in_use; + c->saved_basecode=MAX_U32; + c->entry_used=TRUE; + ArcEntryGet(c); + c->entry_used=TRUE; + return c; +} + +U0 ArcCtrlDel(CArcCtrl *c) +{//Free archive ctrl struct. + Free(c->stk_base); + Free(c); +} + +U8 *ExpandBuf(CArcCompress *arc,CTask *mem_task=NULL) +{//See $LK,"::/Demo/Dsk/SerializeTree.HC"$. + CArcCtrl *c; + U8 *res; + + if (!(CT_NONE<=arc->compression_type<=CT_8_BIT) || + arc->expanded_size>MEM_MAPPED_SPACE) + throw('Compress'); + + res=MAlloc(arc->expanded_size+1,mem_task); + res[arc->expanded_size]=0; //terminate + switch [arc->compression_type] { + case CT_NONE: + MemCpy(res,&arc->body,arc->expanded_size); + break; + case CT_7_BIT: + case CT_8_BIT: + c=ArcCtrlNew(TRUE,arc->compression_type); + c->src_size=arc->compressed_size<<3; + c->src_pos=sizeof(CArcCompress)<<3; + c->src_buf=arc; + c->dst_size=arc->expanded_size; + c->dst_buf=res; + c->dst_pos=0; + ArcExpandBuf(c); + ArcCtrlDel(c); + break; + } + return res; +} + +CArcCompress *CompressBuf(U8 *src,I64 size,CTask *mem_task=NULL) +{//See $LK,"::/Demo/Dsk/SerializeTree.HC"$. + CArcCompress *arc; + I64 size_out,compression_type=ArcDetermineCompressionType(src,size); + CArcCtrl *c=ArcCtrlNew(FALSE,compression_type); + c->src_size=size; + c->src_buf=src; + c->dst_size=(size+sizeof(CArcCompress))<<3; + c->dst_buf=CAlloc(c->dst_size>>3); + c->dst_pos=sizeof(CArcCompress)<<3; + ArcCompressBuf(c); + if (ArcFinishCompression(c) && c->src_pos==c->src_size) { + size_out=(c->dst_pos+7)>>3; + arc=MAlloc(size_out,mem_task); + MemCpy(arc,c->dst_buf,size_out); + arc->compression_type=compression_type; + arc->compressed_size=size_out; + } else { + arc=MAlloc(size+sizeof(CArcCompress),mem_task); + MemCpy(&arc->body,src,size); + arc->compression_type=CT_NONE; + arc->compressed_size=size+sizeof(CArcCompress); + } + arc->expanded_size=size; + Free(c->dst_buf); + ArcCtrlDel(c); + return arc; +} diff --git a/Kernel/Display.CPP b/Kernel/Display.CPP deleted file mode 100644 index 0f5cbc3..0000000 --- a/Kernel/Display.CPP +++ /dev/null @@ -1,139 +0,0 @@ -U0 RawPutChar(I64 ch) -{/*For RAW output during boot and in debugger. - -See $LK,"GrUpdateTextFG",A="MN:GrUpdateTextFG"$ for -the normal screen text output routine. - -See also $LK,"GrUpdateScreen",A="MN:GrUpdateScreen"$(). -*/ - I64 i,row,col; - U8 *ptr,*ptr1,*ptr2; - - if (!(text.raw_flags&RWF_SHOW_DOLLAR)) { - if (ch=='$$') { - if (text.raw_flags&RWF_IN_DOLLAR) { - text.raw_flags&=~RWF_IN_DOLLAR; - if (!(text.raw_flags & RWF_LAST_DOLLAR)) { - text.raw_flags&=~RWF_LAST_DOLLAR; - return; - } - } else { - text.raw_flags|=RWF_IN_DOLLAR|RWF_LAST_DOLLAR; - return; - } - } - text.raw_flags&=~RWF_LAST_DOLLAR; - if (text.raw_flags&RWF_IN_DOLLAR) - return; - } - if (ch=='\t') { - RawPutChar(CH_SPACE); - while (text.raw_col & 7) - RawPutChar(CH_SPACE); - } else if (ch==CH_BACKSPACE) { - text.raw_col--; - RawPutChar(CH_SPACE); - text.raw_col--; - } else if (ch=='\n') { - RawPutChar(CH_SPACE); - while (text.raw_col % text.cols) - RawPutChar(CH_SPACE); - - } else if (Bt(chars_bmp_displayable,ch)) { - row=text.raw_col/text.cols%text.rows; - col=text.raw_col%text.cols; - if (!Bt(&sys_run_level,RLf_VGA)) { //if text mode - if (text.raw_flags&RWF_SCROLL && text.raw_col && !row && !col) { - MemCpy(text.vga_text_alias,text.vga_text_alias+text.cols*2, - text.cols*(text.rows-1)*2); - MemSet(text.vga_text_alias+text.cols*(text.rows-1)*2,0,text.cols*2); - text.raw_col-=text.cols; - row=text.rows-1; - } - ptr=text.vga_text_alias+(row*text.cols+col)*2; - ptr[0]=ch; - ptr[1]=BLACK<<4+WHITE; - } else { - OutU8(VGAP_IDX,VGAR_MAP_MASK); - OutU8(VGAP_DATA,0x0F); //All planes -- WHITE - if (text.raw_flags&RWF_SCROLL && text.raw_col && !row && !col) { -//Scroll cached image - MemCpy(text.raw_screen_image, - text.raw_screen_image+GR_WIDTH*FONT_HEIGHT>>3, - GR_WIDTH*(GR_HEIGHT-FONT_HEIGHT)>>3); - MemSet(text.raw_screen_image+GR_WIDTH*(GR_HEIGHT-FONT_HEIGHT)>>3,0, - GR_WIDTH*FONT_HEIGHT>>3); - - MemCpy(text.vga_alias,text.raw_screen_image,GR_WIDTH*GR_HEIGHT>>3); - text.raw_col-=text.cols; - row=text.rows-1; - } - PUSHFD - CLI - ptr=ptr1=col+row*GR_WIDTH*FONT_HEIGHT>>3; - ptr+=text.vga_alias; - ptr1+=text.raw_screen_image; //Write to cached image as well - ptr2=&text.font[ch&255]; - for (i=0;i>3; - ptr1+=GR_WIDTH>>3; - } - POPFD - } - text.raw_col++; - } -} - -U0 VGAFlush() -{//Flush winmgr vga cache, so updates whole screen. - LBts(&sys_semas[SYS_SEMA_FLUSH_VGA_IMAGE],0); -} - -U0 WinDerivedValsUpdate(CTask *task=NULL) -{//Those things calculated from other variables. - if (!task) task=Fs; - - //Assert: This is called with TASKf_TASK_LOCK set - PUSHFD - CLI - task->win_width =task->win_right-task->win_left+1; - task->win_height=task->win_bottom-task->win_top+1; - - //Inside the Border - task->pix_left =FONT_WIDTH*task->win_left; - task->pix_right =FONT_WIDTH*(task->win_right+1)-1; - task->pix_width =task->pix_right-task->pix_left+1; - task->pix_top =FONT_HEIGHT*task->win_top; - task->pix_bottom =FONT_HEIGHT*(task->win_bottom+1)-1; - task->pix_height =task->pix_bottom-task->pix_top+1; - - //Outside the border - if (Bt(&task->display_flags,DISPLAYf_NO_BORDER)) { - task->border_pix_left =task->pix_left; - task->border_pix_right =task->pix_right; - task->border_pix_top =task->pix_top; - task->border_pix_bottom =task->pix_bottom; - } else { - task->border_pix_left =task->pix_left-FONT_WIDTH; - task->border_pix_right =task->pix_right+FONT_WIDTH; - task->border_pix_top =task->pix_top-FONT_HEIGHT; - task->border_pix_bottom =task->pix_bottom+FONT_HEIGHT; - } - POPFD -} - -Bool WinInside(I64 x,I64 y,CTask *task=NULL,Bool border=FALSE) -{//Is pixel (x,y) inside task's win? - if (!task) task=Fs; - if (TaskValidate(task) && Bt(&task->display_flags,DISPLAYf_SHOW)) { - if (border) { - if (task->border_pix_left<=x<=task->border_pix_right && - task->border_pix_top<=y<=task->border_pix_bottom) - return TRUE; - } else if (task->pix_left<=x<=task->pix_right && - task->pix_top<=y<=task->pix_bottom) - return TRUE; - } - return FALSE; -} diff --git a/Kernel/Display.HC b/Kernel/Display.HC new file mode 100644 index 0000000..984e51f --- /dev/null +++ b/Kernel/Display.HC @@ -0,0 +1,121 @@ +U0 RawPutChar(I64 ch) +{/*For RAW output during boot and in debugger. + +See $LK,"GrUpdateTextFG",A="MN:GrUpdateTextFG"$ for +the normal screen text output routine. + +See also $LK,"GrUpdateScreen",A="MN:GrUpdateScreen"$(). +*/ + I64 i,row,col; + U8 *ptr,*ptr1,*ptr2; + + if (!(text.raw_flags&RWF_SHOW_DOLLAR)) { + if (ch=='$$') { + if (text.raw_flags&RWF_IN_DOLLAR) { + text.raw_flags&=~RWF_IN_DOLLAR; + if (!(text.raw_flags & RWF_LAST_DOLLAR)) { + text.raw_flags&=~RWF_LAST_DOLLAR; + return; + } + } else { + text.raw_flags|=RWF_IN_DOLLAR|RWF_LAST_DOLLAR; + return; + } + } + text.raw_flags&=~RWF_LAST_DOLLAR; + if (text.raw_flags&RWF_IN_DOLLAR) + return; + } + if (ch=='\t') { + RawPutChar(CH_SPACE); + while (text.raw_col & 7) + RawPutChar(CH_SPACE); + } else if (ch==CH_BACKSPACE) { + text.raw_col--; + RawPutChar(CH_SPACE); + text.raw_col--; + } else if (ch=='\n') { + RawPutChar(CH_SPACE); + while (text.raw_col % text.cols) + RawPutChar(CH_SPACE); + + } else if (Bt(chars_bmp_displayable,ch)) { + row=text.raw_col/text.cols%text.rows; + col=text.raw_col%text.cols; + if (!Bt(&sys_run_level,RLf_VGA)) { //if text mode + if (text.raw_flags&RWF_SCROLL && text.raw_col && !row && !col) { + MemCpy(text.vga_text_alias,text.vga_text_alias+text.cols*2, + text.cols*(text.rows-1)*2); + MemSet(text.vga_text_alias+text.cols*(text.rows-1)*2,0,text.cols*2); + text.raw_col-=text.cols; + row=text.rows-1; + } + ptr=text.vga_text_alias+(row*text.cols+col)*2; + ptr[0]=ch; + ptr[1]=BLACK<<4+WHITE; + } else { + OutU8(VGAP_IDX,VGAR_MAP_MASK); + OutU8(VGAP_DATA,0x0F); //All planes -- WHITE + if (text.raw_flags&RWF_SCROLL && text.raw_col && !row && !col) { +//Scroll cached image + MemCpy(text.raw_screen_image, + text.raw_screen_image+GR_WIDTH*FONT_HEIGHT>>3, + GR_WIDTH*(GR_HEIGHT-FONT_HEIGHT)>>3); + MemSet(text.raw_screen_image+GR_WIDTH*(GR_HEIGHT-FONT_HEIGHT)>>3,0, + GR_WIDTH*FONT_HEIGHT>>3); + + MemCpy(text.vga_alias,text.raw_screen_image,GR_WIDTH*GR_HEIGHT>>3); + text.raw_col-=text.cols; + row=text.rows-1; + } + PUSHFD + CLI + ptr=ptr1=col+row*GR_WIDTH*FONT_HEIGHT>>3; + ptr+=text.vga_alias; + ptr1+=text.raw_screen_image; //Write to cached image as well + ptr2=&text.font[ch&255]; + for (i=0;i>3; + ptr1+=GR_WIDTH>>3; + } + POPFD + } + text.raw_col++; + } +} + +U0 VGAFlush() +{//Flush winmgr vga cache, so updates whole screen. + LBts(&sys_semas[SYS_SEMA_FLUSH_VGA_IMAGE],0); +} + +U0 WinDerivedValsUpdate(CTask *task) +{//Those things calculated from other variables. + if (!task) task=Fs; + //Assert: This is called with TASKf_TASK_LOCK set + PUSHFD + CLI + task->win_width =task->win_right-task->win_left+1; + task->win_height=task->win_bottom-task->win_top+1; + task->pix_left =FONT_WIDTH*task->win_left; + task->pix_right =FONT_WIDTH*(task->win_right+1)-1; + task->pix_width =task->pix_right-task->pix_left+1; + task->pix_top =FONT_HEIGHT*task->win_top; + task->pix_bottom =FONT_HEIGHT*(task->win_bottom+1)-1; + task->pix_height =task->pix_bottom-task->pix_top+1; + POPFD +} + +Bool WinInside(I64 x,I64 y,CTask *task=NULL,I64 border=0) +{//Is pixel (x,y) inside task's win? Border to FONT_WIDTH. + if (!task) task=Fs; + if (TaskValidate(task) && Bt(&task->display_flags,DISPLAYf_SHOW)) { + if (Bt(&task->display_flags,DISPLAYf_NO_BORDER)) + border=0; + if (task->pix_left-border<=x<=task->pix_right+border && + task->pix_top-border<=y<=task->pix_bottom+border) + return TRUE; + } + return FALSE; +} diff --git a/Kernel/EdLite.CPP b/Kernel/EdLite.CPP deleted file mode 100644 index 8a09a51..0000000 --- a/Kernel/EdLite.CPP +++ /dev/null @@ -1,355 +0,0 @@ -class CLine -{ - CLine *next,*last; - U8 *line; -}; - -U0 EdLiteUpdate(CLine *head,CLine *cur_line,I64 cur_col,I64 line_start_col) -{ - I64 ch,i,j,k,k2,cursor_col,cursor_row=-1; - U8 *st; - CLine *templ=cur_line; - Bool done_eof=FALSE; - text.raw_col=0; - for (i=0;ilast!=head) - templ=templ->last; - for (i=0;iline[j]=='\t') - k=(k+8)&~7; - else - k++; - cursor_col=k; - cursor_row=i; - } - if (templ!=head) { - st=templ->line; - k=0; - j=0; - while (ch=*st++) { - if (ch=='\t') - k2=(k+8)&~7; - else - k2=k+1; - if (line_start_col<=knext; - } else { - if (!done_eof) { - ''; - done_eof=TRUE; - } - '\n'; - } - } - text.raw_col=text.cols*cursor_row+cursor_col-line_start_col; - RawPutChar(0x7F); -} - -Bool EdLite(U8 *filename,I64 num=1,I64 edf_dof_flags=0) -{//Light weight text editor for debugging. - U8 *src,*src2,*src3,*dst,*buf,*bin_data=NULL; - I64 i,cnt=0,ch,sc,size,bin_size=0,line_start_col=0,cur_col=0, - old_raw_flags=text.raw_flags; - CLine head,*templ,*templ1,*cur_line; - Bool res=FALSE, - old_raw=Raw(ON), - old_debug=InDbg(ON), - old_single=SingleUser(ON); - - if (!filename) filename=blkdev.temp_filename; - buf=FileRead(filename,&size); - - PUSHFD - CLI - text.raw_flags=text.raw_flags&~RWF_SCROLL|RWF_SHOW_DOLLAR; - kbd.scan_code=0; - QueInit(&head); - head.line=StrNew(""); - - if (buf) { - src=buf; - while (*src) { - src2=src; - while ((ch=*src++) && ch!='\r' && ch!='\n'); - src--; - *src++=0; - if (!ch) - src--; - while (ch=='\r' && *src=='\n' || *src==CH_CURSOR) - src++; - dst=src3=src2; - while (ch=*src3++) - if (ch!='\n' && ch!=CH_CURSOR) - *dst++=ch; - *dst=0; - - templ=MAlloc(sizeof(CLine)); - templ->line=StrNew(src2); - QueIns(templ,head.last); - cnt++; - } - - if (src+1-bufnext; - else { - cur_line=&head; - res=FALSE; - } - } - do { - if (cur_line==&head) - cur_col=0; - while (cur_col-line_start_col<0) - line_start_col-=8; - while (cur_col-line_start_col>=text.cols) - line_start_col+=8; - EdLiteUpdate(&head,cur_line,cur_col,line_start_col); - switch (ch=GetKey(&sc,FALSE,TRUE)) { - case 0: - switch (sc.u8[0]) { - case SC_CURSOR_UP: - if (cur_line->last!=&head) - cur_line=cur_line->last; - if (cur_col>StrLen(cur_line->line)) - cur_col=StrLen(cur_line->line); - break; - case SC_CURSOR_DOWN: - if (cur_line!=&head) - cur_line=cur_line->next; - if (cur_col>StrLen(cur_line->line)) - cur_col=StrLen(cur_line->line); - break; - case SC_CURSOR_RIGHT: - cur_col++; - if (cur_col>StrLen(cur_line->line)) { - templ=cur_line->next; - if (templ!=&head) { - cur_col=0; - cur_line=templ; - } else - cur_col=StrLen(cur_line->line); - } - break; - case SC_CURSOR_LEFT: - if (cur_col) - cur_col--; - else { - templ=cur_line->last; - if (templ!=&head) { - cur_line=templ; - cur_col=StrLen(templ->line); - } - } - break; - case SC_PAGE_UP: - for (i=1;ilast!=&head) - cur_line=cur_line->last; - if (cur_col>StrLen(cur_line->line)) - cur_col=StrLen(cur_line->line); - } - break; - case SC_PAGE_DOWN: - for (i=1;inext; - if (cur_col>StrLen(cur_line->line)) - cur_col=StrLen(cur_line->line); - } - break; - case SC_DELETE: - if (cur_col==StrLen(cur_line->line)) { - templ=cur_line->next; - if (cur_line!=&head && templ!=&head) { - src=MStrPrint("%s%s",cur_line->line,templ->line); - Free(cur_line->line); - Free(templ->line); - cur_line->line=src; - QueRem(templ); - Free(templ); - } - } else - StrCpy(cur_line->line+cur_col,cur_line->line+cur_col+1); - break; - } - break; - case '\n': - case '\r': - templ=MAlloc(sizeof(CLine)); - templ->line=StrNew(cur_line->line+cur_col); - cur_line->line[cur_col]=0; - QueIns(templ,cur_line); - cur_line=templ; - cur_col=0; - break; - case CH_BACKSPACE: - if (cur_col) { - StrCpy(cur_line->line+cur_col-1,cur_line->line+cur_col); - cur_col--; - } else if (cur_line!=&head && cur_line->last!=&head) { - templ=cur_line->last; - src=MStrPrint("%s%s",templ->line,cur_line->line); - cur_col=StrLen(templ->line); - Free(cur_line->line); - Free(templ->line); - templ->line=src; - QueRem(cur_line); - Free(cur_line); - cur_line=templ; - } - break; - case CH_CTRLY: - if (cur_line!=&head) { - templ=cur_line; - cur_line=cur_line->next; - QueRem(templ); - Free(templ->line); - Free(templ); - cur_col=0; - } - break; - default: - if (Bt(chars_bmp_getkey,ch)) { - if (cur_line==&head) { - cur_line=MAlloc(sizeof(CLine)); - cur_line->line=StrNew(""); - QueIns(cur_line,head.last); - } - src=MAlloc(StrLen(cur_line->line)+2); - MemCpy(src,cur_line->line,cur_col); - src[cur_col]=ch; - if (cur_colline)) - StrCpy(src+cur_col+1,cur_line->line+cur_col); - else - src[cur_col+1]=0; - Free(cur_line->line); - cur_line->line=src; - cur_col++; - } - } - } while (ch!=CH_SHIFT_ESC && ch!=CH_ESC); - - if (ch!=CH_ESC) { - if (edf_dof_flags&EDF_WAS_WRITE) - res=FALSE; - } else { - size=bin_size; - - templ=head.next; - while (templ!=&head) { - size+=StrLen(templ->line)+1; - templ=templ->next; - } - - buf=dst=MAlloc(size); - templ=head.next; - while (templ!=&head) { - i=StrLen(templ->line); - MemCpy(dst,templ->line,i); - dst+=i; - *dst++='\n'; - templ=templ->next; - } - if (bin_data) - MemCpy(dst,bin_data,bin_size); - FileWrite(filename,buf,size); - Free(buf); - - if (edf_dof_flags&EDF_WAS_WRITE) - res=TRUE; - } - - templ=head.next; - while (templ!=&head) { - templ1=templ->next; - QueRem(templ); - Free(templ->line); - Free(templ); - templ=templ1; - } - Free(head.line); - Free(bin_data); - Raw(old_raw); - InDbg(old_debug); - SingleUser(old_single); - text.raw_flags=text.raw_flags&~RWF_SHOW_DOLLAR|old_raw_flags&RWF_SHOW_DOLLAR; - POPFD - return res; -} - -U0 ToFileLine(U8 *_fl_file_line,U8 **_filename,I64 *_linenum) -{//"FI:D:/Dir/File.CPP,123" to "D:/Dir/File.CPP" and 123. - U8 *st,*fl_file_line=StrNew(_fl_file_line); - I64 linenum; - StrFirstRem(fl_file_line,":"); - st=StrNew(fl_file_line); - StrLastRem(fl_file_line,",",st); - linenum=Str2I64(st); - Free(st); - *_filename=fl_file_line; - *_linenum=linenum; -} - -Bool EdLiteFileLine(U8 *fl_file_line,I64 edf_dof_flags=0) -{ - Bool res; - U8 *filename; - I64 linenum; - ToFileLine(fl_file_line,&filename,&linenum); - res=EdLite(filename,linenum,edf_dof_flags); - Free(filename); - return res; -} - -U0 FixSet(U8 *filename,I64 line) -{//Compiler calls this to set file line for Fix - U8 *st=MStrPrint("FL:%s,%d",filename,line); - while (LBts(&sys_semas[SYS_SEMA_FIX],0)) - Yield; - Free(dbg.fix_file_line); - dbg.fix_file_line=AStrNew(st); - LBtr(&sys_semas[SYS_SEMA_FIX],0); -} - -Bool Fix(I64 edf_dof_flags=0) -{//Jump to last err src code to fix it. - U8 *st; - Bool res=FALSE; - - while (LBts(&sys_semas[SYS_SEMA_FIX],0)) - Yield; - st=StrNew(dbg.fix_file_line); - LBtr(&sys_semas[SYS_SEMA_FIX],0); - - if (st) { - if (IsRaw) - res=EdLiteFileLine(st,edf_dof_flags); - else - res=Ed(st,edf_dof_flags); - } - Free(st); - return res; -} diff --git a/Kernel/EdLite.HC b/Kernel/EdLite.HC new file mode 100644 index 0000000..d8ebd39 --- /dev/null +++ b/Kernel/EdLite.HC @@ -0,0 +1,355 @@ +class CLine +{ + CLine *next,*last; + U8 *line; +}; + +U0 EdLiteUpdate(CLine *head,CLine *cur_line,I64 cur_col,I64 line_start_col) +{ + I64 ch,i,j,k,k2,cursor_col,cursor_row=-1; + U8 *st; + CLine *templ=cur_line; + Bool done_eof=FALSE; + text.raw_col=0; + for (i=0;ilast!=head) + templ=templ->last; + for (i=0;iline[j]=='\t') + k=(k+8)&~7; + else + k++; + cursor_col=k; + cursor_row=i; + } + if (templ!=head) { + st=templ->line; + k=0; + j=0; + while (ch=*st++) { + if (ch=='\t') + k2=(k+8)&~7; + else + k2=k+1; + if (line_start_col<=knext; + } else { + if (!done_eof) { + ''; + done_eof=TRUE; + } + '\n'; + } + } + text.raw_col=text.cols*cursor_row+cursor_col-line_start_col; + RawPutChar(0x7F); +} + +Bool EdLite(U8 *filename,I64 num=1,I64 edf_dof_flags=0) +{//Light weight text editor for debugging. + U8 *src,*src2,*src3,*dst,*buf,*bin_data=NULL; + I64 i,cnt=0,ch,sc,size,bin_size=0,line_start_col=0,cur_col=0, + old_raw_flags=text.raw_flags; + CLine head,*templ,*templ1,*cur_line; + Bool res=FALSE, + old_raw=Raw(ON), + old_debug=InDbg(ON), + old_single=SingleUser(ON); + + if (!filename) filename=blkdev.temp_filename; + buf=FileRead(filename,&size); + + PUSHFD + CLI + text.raw_flags=text.raw_flags&~RWF_SCROLL|RWF_SHOW_DOLLAR; + kbd.scan_code=0; + QueInit(&head); + head.line=StrNew(""); + + if (buf) { + src=buf; + while (*src) { + src2=src; + while ((ch=*src++) && ch!='\r' && ch!='\n'); + src--; + *src++=0; + if (!ch) + src--; + while (ch=='\r' && *src=='\n' || *src==CH_CURSOR) + src++; + dst=src3=src2; + while (ch=*src3++) + if (ch!='\n' && ch!=CH_CURSOR) + *dst++=ch; + *dst=0; + + templ=MAlloc(sizeof(CLine)); + templ->line=StrNew(src2); + QueIns(templ,head.last); + cnt++; + } + + if (src+1-bufnext; + else { + cur_line=&head; + res=FALSE; + } + } + do { + if (cur_line==&head) + cur_col=0; + while (cur_col-line_start_col<0) + line_start_col-=8; + while (cur_col-line_start_col>=text.cols) + line_start_col+=8; + EdLiteUpdate(&head,cur_line,cur_col,line_start_col); + switch (ch=GetKey(&sc,FALSE,TRUE)) { + case 0: + switch (sc.u8[0]) { + case SC_CURSOR_UP: + if (cur_line->last!=&head) + cur_line=cur_line->last; + if (cur_col>StrLen(cur_line->line)) + cur_col=StrLen(cur_line->line); + break; + case SC_CURSOR_DOWN: + if (cur_line!=&head) + cur_line=cur_line->next; + if (cur_col>StrLen(cur_line->line)) + cur_col=StrLen(cur_line->line); + break; + case SC_CURSOR_RIGHT: + cur_col++; + if (cur_col>StrLen(cur_line->line)) { + templ=cur_line->next; + if (templ!=&head) { + cur_col=0; + cur_line=templ; + } else + cur_col=StrLen(cur_line->line); + } + break; + case SC_CURSOR_LEFT: + if (cur_col) + cur_col--; + else { + templ=cur_line->last; + if (templ!=&head) { + cur_line=templ; + cur_col=StrLen(templ->line); + } + } + break; + case SC_PAGE_UP: + for (i=1;ilast!=&head) + cur_line=cur_line->last; + if (cur_col>StrLen(cur_line->line)) + cur_col=StrLen(cur_line->line); + } + break; + case SC_PAGE_DOWN: + for (i=1;inext; + if (cur_col>StrLen(cur_line->line)) + cur_col=StrLen(cur_line->line); + } + break; + case SC_DELETE: + if (cur_col==StrLen(cur_line->line)) { + templ=cur_line->next; + if (cur_line!=&head && templ!=&head) { + src=MStrPrint("%s%s",cur_line->line,templ->line); + Free(cur_line->line); + Free(templ->line); + cur_line->line=src; + QueRem(templ); + Free(templ); + } + } else + StrCpy(cur_line->line+cur_col,cur_line->line+cur_col+1); + break; + } + break; + case '\n': + case '\r': + templ=MAlloc(sizeof(CLine)); + templ->line=StrNew(cur_line->line+cur_col); + cur_line->line[cur_col]=0; + QueIns(templ,cur_line); + cur_line=templ; + cur_col=0; + break; + case CH_BACKSPACE: + if (cur_col) { + StrCpy(cur_line->line+cur_col-1,cur_line->line+cur_col); + cur_col--; + } else if (cur_line!=&head && cur_line->last!=&head) { + templ=cur_line->last; + src=MStrPrint("%s%s",templ->line,cur_line->line); + cur_col=StrLen(templ->line); + Free(cur_line->line); + Free(templ->line); + templ->line=src; + QueRem(cur_line); + Free(cur_line); + cur_line=templ; + } + break; + case CH_CTRLY: + if (cur_line!=&head) { + templ=cur_line; + cur_line=cur_line->next; + QueRem(templ); + Free(templ->line); + Free(templ); + cur_col=0; + } + break; + default: + if (Bt(chars_bmp_getkey,ch)) { + if (cur_line==&head) { + cur_line=MAlloc(sizeof(CLine)); + cur_line->line=StrNew(""); + QueIns(cur_line,head.last); + } + src=MAlloc(StrLen(cur_line->line)+2); + MemCpy(src,cur_line->line,cur_col); + src[cur_col]=ch; + if (cur_colline)) + StrCpy(src+cur_col+1,cur_line->line+cur_col); + else + src[cur_col+1]=0; + Free(cur_line->line); + cur_line->line=src; + cur_col++; + } + } + } while (ch!=CH_SHIFT_ESC && ch!=CH_ESC); + + if (ch!=CH_ESC) { + if (edf_dof_flags&EDF_WAS_WRITE) + res=FALSE; + } else { + size=bin_size; + + templ=head.next; + while (templ!=&head) { + size+=StrLen(templ->line)+1; + templ=templ->next; + } + + buf=dst=MAlloc(size); + templ=head.next; + while (templ!=&head) { + i=StrLen(templ->line); + MemCpy(dst,templ->line,i); + dst+=i; + *dst++='\n'; + templ=templ->next; + } + if (bin_data) + MemCpy(dst,bin_data,bin_size); + FileWrite(filename,buf,size); + Free(buf); + + if (edf_dof_flags&EDF_WAS_WRITE) + res=TRUE; + } + + templ=head.next; + while (templ!=&head) { + templ1=templ->next; + QueRem(templ); + Free(templ->line); + Free(templ); + templ=templ1; + } + Free(head.line); + Free(bin_data); + Raw(old_raw); + InDbg(old_debug); + SingleUser(old_single); + text.raw_flags=text.raw_flags&~RWF_SHOW_DOLLAR|old_raw_flags&RWF_SHOW_DOLLAR; + POPFD + return res; +} + +U0 ToFileLine(U8 *_fl_file_line,U8 **_filename,I64 *_linenum) +{//"FI:D:/Dir/File.HC,123" to "D:/Dir/File.HC" and 123. + U8 *st,*fl_file_line=StrNew(_fl_file_line); + I64 linenum; + StrFirstRem(fl_file_line,":"); + st=StrNew(fl_file_line); + StrLastRem(fl_file_line,",",st); + linenum=Str2I64(st); + Free(st); + *_filename=fl_file_line; + *_linenum=linenum; +} + +Bool EdLiteFileLine(U8 *fl_file_line,I64 edf_dof_flags=0) +{ + Bool res; + U8 *filename; + I64 linenum; + ToFileLine(fl_file_line,&filename,&linenum); + res=EdLite(filename,linenum,edf_dof_flags); + Free(filename); + return res; +} + +U0 FixSet(U8 *filename,I64 line) +{//Compiler calls this to set file line for Fix + U8 *st=MStrPrint("FL:%s,%d",filename,line); + while (LBts(&sys_semas[SYS_SEMA_FIX],0)) + Yield; + Free(dbg.fix_file_line); + dbg.fix_file_line=AStrNew(st); + LBtr(&sys_semas[SYS_SEMA_FIX],0); +} + +Bool Fix(I64 edf_dof_flags=0) +{//Jump to last err src code to fix it. + U8 *st; + Bool res=FALSE; + + while (LBts(&sys_semas[SYS_SEMA_FIX],0)) + Yield; + st=StrNew(dbg.fix_file_line); + LBtr(&sys_semas[SYS_SEMA_FIX],0); + + if (st) { + if (IsRaw) + res=EdLiteFileLine(st,edf_dof_flags); + else + res=Ed(st,edf_dof_flags); + } + Free(st); + return res; +} diff --git a/Kernel/FontCyrillic.CPP b/Kernel/FontCyrillic.CPP deleted file mode 100644 index daad62d..0000000 --- a/Kernel/FontCyrillic.CPP +++ /dev/null @@ -1,132 +0,0 @@ -//See $LK,"::/Doc/Credits.TXT"$. - -U64 sys_font_cyrillic[256]= { -0x0000000000000000,0x0000000000000000, -0x000000FF00000000,0x000000FF00FF0000,//ÄÍ -0x1818181818181818,0x6C6C6C6C6C6C6C6C,//³º -0x181818F800000000,0x6C6C6CEC0CFC0000,//ÚÉ -0x1818181F00000000,0x6C6C6C6F607F0000,//¿» -0x000000F818181818,0x000000FC0CEC6C6C,//ÀÈ -0x0000001F18181818,0x0000007F606F6C6C,//Ù¼ -0x0000000000000000,0x0000000000000000, -0x0000000000000000,0x0000000000000000, -0x0000000000000000,0x0000000000000000, -0x0000000000000000,0x0000000000000000, -0x0000000000000000,0x0000000000000000, -0x0000000000000000,0x0000000000000000, -0x0000000000000000,0x0000000000000000, -0x0000000000000000,0x0000000000000000, -0x0000000000000000,0x0008000000000000,// -0x0000000000000000,0x00180018183C3C18,// ! -0x0000000000363636,0x006C6CFE6CFE6C6C,//"# -0x00187ED07C16FC30,0x0060660C18306606,//$$% -0x00DC66B61C36361C,0x0000000000181818,//&' -0x0030180C0C0C1830,0x000C18303030180C,//() -0x0000187E3C7E1800,0x000018187E181800,//*+ -0x0C18180000000000,0x000000007E000000,//,- -0x0018180000000000,0x0000060C18306000,//./ -0x003C666E7E76663C,0x007E181818181C18,//01 -0x007E0C183060663C,0x003C66603860663C,//23 -0x0030307E363C3830,0x003C6660603E067E,//45 -0x003C66663E060C38,0x000C0C0C1830607E,//67 -0x003C66663C66663C,0x001C30607C66663C,//89 -0x0018180018180000,0x0C18180018180000,//:; -0x0030180C060C1830,0x0000007E007E0000,//<= -0x000C18306030180C,0x001800181830663C,//>? -0x003C06765676663C,0x006666667E66663C,//@A -0x003E66663E66663E,0x003C66060606663C,//BC -0x001E36666666361E,0x007E06063E06067E,//DE -0x000606063E06067E,0x003C66667606663C,//FG -0x006666667E666666,0x007E18181818187E,//HI -0x001C36303030307C,0x0066361E0E1E3666,//JK -0x007E060606060606,0x00C6C6D6D6FEEEC6,//LM -0x006666767E6E6666,0x003C66666666663C,//NO -0x000606063E66663E,0x006C36566666663C,//PQ -0x006666363E66663E,0x003C66603C06663C,//RS -0x001818181818187E,0x003C666666666666,//TU -0x00183C6666666666,0x00C6EEFED6D6C6C6,//VW -0x0066663C183C6666,0x001818183C666666,//XY -0x007E060C1830607E,0x003E06060606063E,//Z[ -0x00006030180C0600,0x007C60606060607C,//\] -0x000000000000663C,0xFFFF000000000000,//^_ -0x000000000030180C,0x007C667C603C0000,//`a -0x003E6666663E0606,0x003C6606663C0000,//bc -0x007C6666667C6060,0x003C067E663C0000,//de -0x000C0C0C3E0C0C38,0x3C607C66667C0000,//fg -0x00666666663E0606,0x003C1818181C0018,//hi -0x0E181818181C0018,0x0066361E36660606,//jk -0x003C18181818181C,0x00C6D6D6FE6C0000,//lm -0x00666666663E0000,0x003C6666663C0000,//no -0x06063E66663E0000,0xE0607C66667C0000,//pq -0x000606066E360000,0x003E603C067C0000,//rs -0x00380C0C0C3E0C0C,0x007C666666660000,//tu -0x00183C6666660000,0x006CFED6D6C60000,//vw -0x00663C183C660000,0x3C607C6666660000,//xy -0x007E0C18307E0000,0x003018180E181830,//z{ -0x0018181818181818,0x000C18187018180C,//|} -0x000000000062D68C,0xFFFFFFFFFFFFFFFF,//~ -0x1E30181E3303331E,0x007E333333003300,//€ -0x001E033F331E0038,0x00FC667C603CC37E,//‚ƒ -0x007E333E301E0033,0x007E333E301E0007,//„… -0x007E333E301E0C0C,0x3C603E03033E0000,//†‡ -0x003C067E663CC37E,0x001E033F331E0033,//ˆ‰ -0x001E033F331E0007,0x001E0C0C0C0E0033,//Š‹ -0x003C1818181C633E,0x001E0C0C0C0E0007,//Œ -0x00333F33331E0C33,0x00333F331E000C0C,//Ž -0x003F061E063F0038,0x00FE33FE30FE0000,//‘ -0x007333337F33367C,0x001E33331E00331E,//’“ -0x001E33331E003300,0x001E33331E000700,//”• -0x007E33333300331E,0x007E333333000700,//–— -0x1F303F3333003300,0x001C3E63633E1C63,//˜™ -0x001E333333330033,0x18187E03037E1818,//š› -0x003F67060F26361C,0x000C3F0C3F1E3333,//œ -0x70337B332F1B1B0F,0x0E1B18187E18D870,//žŸ -0x000F11110F01111F,0x000101010101111F,// ¡ -0x000F0107010F000A,0x001515150E151515,//¢£ -0x000F10100E10100F,0x0011111315191111,//¤¥ -0x001113151911040A,0x001215141414141E,//¦§ -0x001111111111111F,0x000102040A111111,//¨© -0x00040E1515150E04,0x001010101E111111,//ª« -0x001F151515151515,0x000E12120E020203,//¬­ -0x0013151513111111,0x000E11101C10110E,//®¯ -0x0009151517151509,0x001112141E11111E,//°± -0x000E11110F010618,0x0007090709070000,//²³ -0x00010101111F0000,0x000E011F110E000A,//´µ -0x0015150E15150000,0x000F100C100F0000,//¶· -0x0011131519110000,0x0013151911040A00,//¸¹ -0x0009050305090000,0x00121514141E0000,//º» -0x001111151B110000,0x0011111F11110000,//¼½ -0x00111111111F0000,0x00040404041F0000,//¾¿ -0x0010101E11110000,0x001F151515150000,//ÀÁ -0x000E120E02030000,0x0013151311110000,//Âà -0x0007090701010000,0x000E111C110E0000,//ÄÅ -0x0009151715090000,0x0012141E111E0000,//ÆÇ -0x0004120912040000,0x0004091209040000,//ÈÉ -0x001B091200000000,0x000000000009121B,//ÊË -0x001C141C090D0B09,0x000E110102040004,//ÌÍ -0x000304040E040418,0x001E02020F020A04,//ÎÏ -0x0004040000000000,0x0004040404000000,//ÐÑ -0x000E000A0A0A0000,0x000A000A0A0A0000,//ÒÓ -0x0001020408170005,0x00001B0E040E1B00,//ÔÕ -0x0001020408150205,0x00000E040404040E,//Ö× -0x00001F0A0A0A0A1F,0x0004040404150E04,//ØÙ -0x00040E1504040404,0x0001090D1F0D0901,//ÚÛ -0x001012161F161210,0x000111151F151101,//ÜÝ -0x0001020408110701,0x000000000C0C0000,//Þß -0x111F11121414141E,0x101F111111111111,//àá -0x101F151515151515,0x111F1112141E0000,//âã -0x040E15150E040400,0x101A111111110000,//äå -0x101F151515150000,0x0000000000000408,//æç -0x000000000000000A,0x0000000000000D12,//èé -0x000E011F110E0408,0x06040E11010E0000,//êë -0x0006080A0A0A000A,0x0000041F0E0E0E04,//ìí -0x00000A0011000A00,0x00000E1111110E00,//îï -0x0010101D1A150911,0x001C1019121D0911,//ðñ -0x001C0419121D0911,0x10101C1B12030203,//òó -0x00111F111F111F11,0x0000000600180003,//ôõ -0x041E141015070502,0x07020E021E020E02,//ö÷ -0x0E040E041F040E04,0x1C08160017001600,//øù -0x1C080E080F080E08,0x00040E041F040E04,//úû -0x1C08090A0C0A0908,0x0609040A0A04120C,//üý -0x001414141E15151E,0xFFFFFFFFFFFFFFFF,//þÿ -}; diff --git a/Kernel/FontCyrillic.HC b/Kernel/FontCyrillic.HC new file mode 100644 index 0000000..e5a8e13 --- /dev/null +++ b/Kernel/FontCyrillic.HC @@ -0,0 +1,132 @@ +//See $LK,"::/Doc/Credits.DD"$. + +U64 sys_font_cyrillic[256]= { +0x0000000000000000,0x0000000000000000, +0x000000FF00000000,0x000000FF00FF0000,//ÄÍ +0x1818181818181818,0x6C6C6C6C6C6C6C6C,//³º +0x181818F800000000,0x6C6C6CEC0CFC0000,//ÚÉ +0x1818181F00000000,0x6C6C6C6F607F0000,//¿» +0x000000F818181818,0x000000FC0CEC6C6C,//ÀÈ +0x0000001F18181818,0x0000007F606F6C6C,//Ù¼ +0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x0008000000000000,// +0x0000000000000000,0x00180018183C3C18,// ! +0x0000000000363636,0x006C6CFE6CFE6C6C,//"# +0x00187ED07C16FC30,0x0060660C18306606,//$$% +0x00DC66B61C36361C,0x0000000000181818,//&' +0x0030180C0C0C1830,0x000C18303030180C,//() +0x0000187E3C7E1800,0x000018187E181800,//*+ +0x0C18180000000000,0x000000007E000000,//,- +0x0018180000000000,0x0000060C18306000,//./ +0x003C666E7E76663C,0x007E181818181C18,//01 +0x007E0C183060663C,0x003C66603860663C,//23 +0x0030307E363C3830,0x003C6660603E067E,//45 +0x003C66663E060C38,0x000C0C0C1830607E,//67 +0x003C66663C66663C,0x001C30607C66663C,//89 +0x0018180018180000,0x0C18180018180000,//:; +0x0030180C060C1830,0x0000007E007E0000,//<= +0x000C18306030180C,0x001800181830663C,//>? +0x003C06765676663C,0x006666667E66663C,//@A +0x003E66663E66663E,0x003C66060606663C,//BC +0x001E36666666361E,0x007E06063E06067E,//DE +0x000606063E06067E,0x003C66667606663C,//FG +0x006666667E666666,0x007E18181818187E,//HI +0x001C36303030307C,0x0066361E0E1E3666,//JK +0x007E060606060606,0x00C6C6D6D6FEEEC6,//LM +0x006666767E6E6666,0x003C66666666663C,//NO +0x000606063E66663E,0x006C36566666663C,//PQ +0x006666363E66663E,0x003C66603C06663C,//RS +0x001818181818187E,0x003C666666666666,//TU +0x00183C6666666666,0x00C6EEFED6D6C6C6,//VW +0x0066663C183C6666,0x001818183C666666,//XY +0x007E060C1830607E,0x003E06060606063E,//Z[ +0x00006030180C0600,0x007C60606060607C,//\] +0x000000000000663C,0xFFFF000000000000,//^_ +0x000000000030180C,0x007C667C603C0000,//`a +0x003E6666663E0606,0x003C6606663C0000,//bc +0x007C6666667C6060,0x003C067E663C0000,//de +0x000C0C0C3E0C0C38,0x3C607C66667C0000,//fg +0x00666666663E0606,0x003C1818181C0018,//hi +0x0E181818181C0018,0x0066361E36660606,//jk +0x003C18181818181C,0x00C6D6D6FE6C0000,//lm +0x00666666663E0000,0x003C6666663C0000,//no +0x06063E66663E0000,0xE0607C66667C0000,//pq +0x000606066E360000,0x003E603C067C0000,//rs +0x00380C0C0C3E0C0C,0x007C666666660000,//tu +0x00183C6666660000,0x006CFED6D6C60000,//vw +0x00663C183C660000,0x3C607C6666660000,//xy +0x007E0C18307E0000,0x003018180E181830,//z{ +0x0018181818181818,0x000C18187018180C,//|} +0x000000000062D68C,0xFFFFFFFFFFFFFFFF,//~ +0x1E30181E3303331E,0x007E333333003300,//€ +0x001E033F331E0038,0x00FC667C603CC37E,//‚ƒ +0x007E333E301E0033,0x007E333E301E0007,//„… +0x007E333E301E0C0C,0x3C603E03033E0000,//†‡ +0x003C067E663CC37E,0x001E033F331E0033,//ˆ‰ +0x001E033F331E0007,0x001E0C0C0C0E0033,//Š‹ +0x003C1818181C633E,0x001E0C0C0C0E0007,//Œ +0x00333F33331E0C33,0x00333F331E000C0C,//Ž +0x003F061E063F0038,0x00FE33FE30FE0000,//‘ +0x007333337F33367C,0x001E33331E00331E,//’“ +0x001E33331E003300,0x001E33331E000700,//”• +0x007E33333300331E,0x007E333333000700,//–— +0x1F303F3333003300,0x001C3E63633E1C63,//˜™ +0x001E333333330033,0x18187E03037E1818,//š› +0x003F67060F26361C,0x000C3F0C3F1E3333,//œ +0x70337B332F1B1B0F,0x0E1B18187E18D870,//žŸ +0x000F11110F01111F,0x000101010101111F,// ¡ +0x000F0107010F000A,0x001515150E151515,//¢£ +0x000F10100E10100F,0x0011111315191111,//¤¥ +0x001113151911040A,0x001215141414141E,//¦§ +0x001111111111111F,0x000102040A111111,//¨© +0x00040E1515150E04,0x001010101E111111,//ª« +0x001F151515151515,0x000E12120E020203,//¬­ +0x0013151513111111,0x000E11101C10110E,//®¯ +0x0009151517151509,0x001112141E11111E,//°± +0x000E11110F010618,0x0007090709070000,//²³ +0x00010101111F0000,0x000E011F110E000A,//´µ +0x0015150E15150000,0x000F100C100F0000,//¶· +0x0011131519110000,0x0013151911040A00,//¸¹ +0x0009050305090000,0x00121514141E0000,//º» +0x001111151B110000,0x0011111F11110000,//¼½ +0x00111111111F0000,0x00040404041F0000,//¾¿ +0x0010101E11110000,0x001F151515150000,//ÀÁ +0x000E120E02030000,0x0013151311110000,//Âà +0x0007090701010000,0x000E111C110E0000,//ÄÅ +0x0009151715090000,0x0012141E111E0000,//ÆÇ +0x0004120912040000,0x0004091209040000,//ÈÉ +0x001B091200000000,0x000000000009121B,//ÊË +0x001C141C090D0B09,0x000E110102040004,//ÌÍ +0x000304040E040418,0x001E02020F020A04,//ÎÏ +0x0004040000000000,0x0004040404000000,//ÐÑ +0x000E000A0A0A0000,0x000A000A0A0A0000,//ÒÓ +0x0001020408170005,0x00001B0E040E1B00,//ÔÕ +0x0001020408150205,0x00000E040404040E,//Ö× +0x00001F0A0A0A0A1F,0x0004040404150E04,//ØÙ +0x00040E1504040404,0x0001090D1F0D0901,//ÚÛ +0x001012161F161210,0x000111151F151101,//ÜÝ +0x0001020408110701,0x000000000C0C0000,//Þß +0x111F11121414141E,0x101F111111111111,//àá +0x101F151515151515,0x111F1112141E0000,//âã +0x040E15150E040400,0x101A111111110000,//äå +0x101F151515150000,0x0000000000000408,//æç +0x000000000000000A,0x0000000000000D12,//èé +0x000E011F110E0408,0x06040E11010E0000,//êë +0x0006080A0A0A000A,0x0000041F0E0E0E04,//ìí +0x00000A0011000A00,0x00000E1111110E00,//îï +0x0010101D1A150911,0x001C1019121D0911,//ðñ +0x001C0419121D0911,0x10101C1B12030203,//òó +0x00111F111F111F11,0x0000000600180003,//ôõ +0x041E141015070502,0x07020E021E020E02,//ö÷ +0x0E040E041F040E04,0x1C08160017001600,//øù +0x1C080E080F080E08,0x00040E041F040E04,//úû +0x1C08090A0C0A0908,0x0609040A0A04120C,//üý +0x001414141E15151E,0xFFFFFFFFFFFFFFFF,//þÿ +}; diff --git a/Kernel/FontStd.CPP b/Kernel/FontStd.CPP deleted file mode 100644 index 2e8cafd..0000000 --- a/Kernel/FontStd.CPP +++ /dev/null @@ -1,132 +0,0 @@ -//See $LK,"::/Doc/Credits.TXT"$. - -U64 sys_font_std[256]= { -0x0000000000000000,0x0000000000000000, -0x000000FF00000000,0x000000FF00FF0000,//ÄÍ -0x1818181818181818,0x6C6C6C6C6C6C6C6C,//³º -0x181818F800000000,0x6C6C6CEC0CFC0000,//ÚÉ -0x1818181F00000000,0x6C6C6C6F607F0000,//¿» -0x000000F818181818,0x000000FC0CEC6C6C,//ÀÈ -0x0000001F18181818,0x0000007F606F6C6C,//Ù¼ -0x0000000000000000,0x0000000000000000, -0x0000000000000000,0x0000000000000000, -0x0000000000000000,0x0000000000000000, -0x0000000000000000,0x0000000000000000, -0x0000000000000000,0x0000000000000000, -0x0000000000000000,0x0000000000000000, -0x0000000000000000,0x0000000000000000, -0x0000000000000000,0x0000000000000000, -0x0000000000000000,0x0008000000000000,// -0x0000000000000000,0x00180018183C3C18,// ! -0x0000000000363636,0x006C6CFE6CFE6C6C,//"# -0x00187ED07C16FC30,0x0060660C18306606,//$$% -0x00DC66B61C36361C,0x0000000000181818,//&' -0x0030180C0C0C1830,0x000C18303030180C,//() -0x0000187E3C7E1800,0x000018187E181800,//*+ -0x0C18180000000000,0x000000007E000000,//,- -0x0018180000000000,0x0000060C18306000,//./ -0x003C666E7E76663C,0x007E181818181C18,//01 -0x007E0C183060663C,0x003C66603860663C,//23 -0x0030307E363C3830,0x003C6660603E067E,//45 -0x003C66663E060C38,0x000C0C0C1830607E,//67 -0x003C66663C66663C,0x001C30607C66663C,//89 -0x0018180018180000,0x0C18180018180000,//:; -0x0030180C060C1830,0x0000007E007E0000,//<= -0x000C18306030180C,0x001800181830663C,//>? -0x003C06765676663C,0x006666667E66663C,//@A -0x003E66663E66663E,0x003C66060606663C,//BC -0x001E36666666361E,0x007E06063E06067E,//DE -0x000606063E06067E,0x003C66667606663C,//FG -0x006666667E666666,0x007E18181818187E,//HI -0x001C36303030307C,0x0066361E0E1E3666,//JK -0x007E060606060606,0x00C6C6D6D6FEEEC6,//LM -0x006666767E6E6666,0x003C66666666663C,//NO -0x000606063E66663E,0x006C36566666663C,//PQ -0x006666363E66663E,0x003C66603C06663C,//RS -0x001818181818187E,0x003C666666666666,//TU -0x00183C6666666666,0x00C6EEFED6D6C6C6,//VW -0x0066663C183C6666,0x001818183C666666,//XY -0x007E060C1830607E,0x003E06060606063E,//Z[ -0x00006030180C0600,0x007C60606060607C,//\] -0x000000000000663C,0xFFFF000000000000,//^_ -0x000000000030180C,0x007C667C603C0000,//`a -0x003E6666663E0606,0x003C6606663C0000,//bc -0x007C6666667C6060,0x003C067E663C0000,//de -0x000C0C0C3E0C0C38,0x3C607C66667C0000,//fg -0x00666666663E0606,0x003C1818181C0018,//hi -0x0E181818181C0018,0x0066361E36660606,//jk -0x003C18181818181C,0x00C6D6D6FE6C0000,//lm -0x00666666663E0000,0x003C6666663C0000,//no -0x06063E66663E0000,0xE0607C66667C0000,//pq -0x000606066E360000,0x003E603C067C0000,//rs -0x00380C0C0C3E0C0C,0x007C666666660000,//tu -0x00183C6666660000,0x006CFED6D6C60000,//vw -0x00663C183C660000,0x3C607C6666660000,//xy -0x007E0C18307E0000,0x003018180E181830,//z{ -0x0018181818181818,0x000C18187018180C,//|} -0x000000000062D68C,0xFFFFFFFFFFFFFFFF,//~ -0x1E30181E3303331E,0x007E333333003300,//€ -0x001E033F331E0038,0x00FC667C603CC37E,//‚ƒ -0x007E333E301E0033,0x007E333E301E0007,//„… -0x007E333E301E0C0C,0x3C603E03033E0000,//†‡ -0x003C067E663CC37E,0x001E033F331E0033,//ˆ‰ -0x001E033F331E0007,0x001E0C0C0C0E0033,//Š‹ -0x003C1818181C633E,0x001E0C0C0C0E0007,//Œ -0x00333F33331E0C33,0x00333F331E000C0C,//Ž -0x003F061E063F0038,0x00FE33FE30FE0000,//‘ -0x007333337F33367C,0x001E33331E00331E,//’“ -0x001E33331E003300,0x001E33331E000700,//”• -0x007E33333300331E,0x007E333333000700,//–— -0x1F303F3333003300,0x001C3E63633E1C63,//˜™ -0x001E333333330033,0x18187E03037E1818,//š› -0x003F67060F26361C,0x000C3F0C3F1E3333,//œ -0x70337B332F1B1B0F,0x0E1B18187E18D870,//žŸ -0x007E333E301E0038,0x001E0C0C0C0E001C,// ¡ -0x001E33331E003800,0x007E333333003800,//¢£ -0x003333331F001F00,0x00333B3F3733003F,//¤¥ -0x00007E007C36363C,0x00007E003C66663C,//¦§ -0x001E3303060C000C,0x000003033F000000,//¨© -0x000030303F000000,0xF81973C67C1B3363,//ª« -0xC0F9F3E6CF1B3363,0x183C3C1818001800,//¬­ -0x0000CC663366CC00,0x00003366CC663300,//®¯ -0x1144114411441144,0x55AA55AA55AA55AA,//°± -0xEEBBEEBBEEBBEEBB,0x1818181818181818,//²³ -0x1818181F18181818,0x1818181F181F1818,//´µ -0x6C6C6C6F6C6C6C6C,0x6C6C6C7F00000000,//¶· -0x1818181F181F0000,0x6C6C6C6F606F6C6C,//¸¹ -0x6C6C6C6C6C6C6C6C,0x6C6C6C6F607F0000,//º» -0x0000007F606F6C6C,0x0000007F6C6C6C6C,//¼½ -0x0000001F181F1818,0x1818181F00000000,//¾¿ -0x000000F818181818,0x000000FF18181818,//ÀÁ -0x181818FF00000000,0x181818F818181818,//Âà -0x000000FF00000000,0x181818FF18181818,//ÄÅ -0x181818F818F81818,0x6C6C6CEC6C6C6C6C,//ÆÇ -0x000000FC0CEC6C6C,0x6C6C6CEC0CFC0000,//ÈÉ -0x000000FF00EF6C6C,0x6C6C6CEF00FF0000,//ÊË -0x6C6C6CEC0CEC6C6C,0x000000FF00FF0000,//ÌÍ -0x6C6C6CEF00EF6C6C,0x000000FF00FF1818,//ÎÏ -0x000000FF6C6C6C6C,0x181818FF00FF0000,//ÐÑ -0x6C6C6CFF00000000,0x000000FC6C6C6C6C,//ÒÓ -0x000000F818F81818,0x181818F818F80000,//ÔÕ -0x6C6C6CFC00000000,0x6C6C6CEF6C6C6C6C,//Ö× -0x181818FF00FF1818,0x0000001F18181818,//ØÙ -0x181818F800000000,0xFFFFFFFFFFFFFFFF,//ÚÛ -0xFFFFFFFF00000000,0x0F0F0F0F0F0F0F0F,//ÜÝ -0xF0F0F0F0F0F0F0F0,0x00000000FFFFFFFF,//Þß -0x006E3B133B6E0000,0x03031F331F331E00,//àá -0x0003030303637F00,0x0036363636367F00,//âã -0x007F660C180C667F,0x001E3333337E0000,//äå -0x03063E6666666600,0x00181818183B6E00,//æç -0x3F0C1E33331E0C3F,0x001C36637F63361C,//èé -0x007736366363361C,0x001E33333E180C38,//êë -0x00007EDBDB7E0000,0x03067EDBDB7E3060,//ìí -0x003C06033F03063C,0x003333333333331E,//îï -0x00003F003F003F00,0x003F000C0C3F0C0C,//ðñ -0x003F00060C180C06,0x003F00180C060C18,//òó -0x1818181818D8D870,0x0E1B1B1818181818,//ôõ -0x000C0C003F000C0C,0x0000394E00394E00,//ö÷ -0x000000001C36361C,0x0000001818000000,//øù -0x0000001800000000,0x383C3637303030F0,//úû -0x000000363636361E,0x0000003E061C301E,//üý -0x00003C3C3C3C0000,0xFFFFFFFFFFFFFFFF,//þÿ -}; diff --git a/Kernel/FontStd.HC b/Kernel/FontStd.HC new file mode 100644 index 0000000..38ceca4 --- /dev/null +++ b/Kernel/FontStd.HC @@ -0,0 +1,132 @@ +//See $LK,"::/Doc/Credits.DD"$. + +U64 sys_font_std[256]= { +0x0000000000000000,0x0000000000000000, +0x000000FF00000000,0x000000FF00FF0000,//ÄÍ +0x1818181818181818,0x6C6C6C6C6C6C6C6C,//³º +0x181818F800000000,0x6C6C6CEC0CFC0000,//ÚÉ +0x1818181F00000000,0x6C6C6C6F607F0000,//¿» +0x000000F818181818,0x000000FC0CEC6C6C,//ÀÈ +0x0000001F18181818,0x0000007F606F6C6C,//Ù¼ +0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x0000000000000000, +0x0000000000000000,0x0008000000000000,// +0x0000000000000000,0x00180018183C3C18,// ! +0x0000000000363636,0x006C6CFE6CFE6C6C,//"# +0x00187ED07C16FC30,0x0060660C18306606,//$$% +0x00DC66B61C36361C,0x0000000000181818,//&' +0x0030180C0C0C1830,0x000C18303030180C,//() +0x0000187E3C7E1800,0x000018187E181800,//*+ +0x0C18180000000000,0x000000007E000000,//,- +0x0018180000000000,0x0000060C18306000,//./ +0x003C666E7E76663C,0x007E181818181C18,//01 +0x007E0C183060663C,0x003C66603860663C,//23 +0x0030307E363C3830,0x003C6660603E067E,//45 +0x003C66663E060C38,0x000C0C0C1830607E,//67 +0x003C66663C66663C,0x001C30607C66663C,//89 +0x0018180018180000,0x0C18180018180000,//:; +0x0030180C060C1830,0x0000007E007E0000,//<= +0x000C18306030180C,0x001800181830663C,//>? +0x003C06765676663C,0x006666667E66663C,//@A +0x003E66663E66663E,0x003C66060606663C,//BC +0x001E36666666361E,0x007E06063E06067E,//DE +0x000606063E06067E,0x003C66667606663C,//FG +0x006666667E666666,0x007E18181818187E,//HI +0x001C36303030307C,0x0066361E0E1E3666,//JK +0x007E060606060606,0x00C6C6D6D6FEEEC6,//LM +0x006666767E6E6666,0x003C66666666663C,//NO +0x000606063E66663E,0x006C36566666663C,//PQ +0x006666363E66663E,0x003C66603C06663C,//RS +0x001818181818187E,0x003C666666666666,//TU +0x00183C6666666666,0x00C6EEFED6D6C6C6,//VW +0x0066663C183C6666,0x001818183C666666,//XY +0x007E060C1830607E,0x003E06060606063E,//Z[ +0x00006030180C0600,0x007C60606060607C,//\] +0x000000000000663C,0xFFFF000000000000,//^_ +0x000000000030180C,0x007C667C603C0000,//`a +0x003E6666663E0606,0x003C6606663C0000,//bc +0x007C6666667C6060,0x003C067E663C0000,//de +0x000C0C0C3E0C0C38,0x3C607C66667C0000,//fg +0x00666666663E0606,0x003C1818181C0018,//hi +0x0E181818181C0018,0x0066361E36660606,//jk +0x003C18181818181C,0x00C6D6D6FE6C0000,//lm +0x00666666663E0000,0x003C6666663C0000,//no +0x06063E66663E0000,0xE0607C66667C0000,//pq +0x000606066E360000,0x003E603C067C0000,//rs +0x00380C0C0C3E0C0C,0x007C666666660000,//tu +0x00183C6666660000,0x006CFED6D6C60000,//vw +0x00663C183C660000,0x3C607C6666660000,//xy +0x007E0C18307E0000,0x003018180E181830,//z{ +0x0018181818181818,0x000C18187018180C,//|} +0x000000000062D68C,0xFFFFFFFFFFFFFFFF,//~ +0x1E30181E3303331E,0x007E333333003300,//€ +0x001E033F331E0038,0x00FC667C603CC37E,//‚ƒ +0x007E333E301E0033,0x007E333E301E0007,//„… +0x007E333E301E0C0C,0x3C603E03033E0000,//†‡ +0x003C067E663CC37E,0x001E033F331E0033,//ˆ‰ +0x001E033F331E0007,0x001E0C0C0C0E0033,//Š‹ +0x003C1818181C633E,0x001E0C0C0C0E0007,//Œ +0x00333F33331E0C33,0x00333F331E000C0C,//Ž +0x003F061E063F0038,0x00FE33FE30FE0000,//‘ +0x007333337F33367C,0x001E33331E00331E,//’“ +0x001E33331E003300,0x001E33331E000700,//”• +0x007E33333300331E,0x007E333333000700,//–— +0x1F303F3333003300,0x001C3E63633E1C63,//˜™ +0x001E333333330033,0x18187E03037E1818,//š› +0x003F67060F26361C,0x000C3F0C3F1E3333,//œ +0x70337B332F1B1B0F,0x0E1B18187E18D870,//žŸ +0x007E333E301E0038,0x001E0C0C0C0E001C,// ¡ +0x001E33331E003800,0x007E333333003800,//¢£ +0x003333331F001F00,0x00333B3F3733003F,//¤¥ +0x00007E007C36363C,0x00007E003C66663C,//¦§ +0x001E3303060C000C,0x000003033F000000,//¨© +0x000030303F000000,0xF81973C67C1B3363,//ª« +0xC0F9F3E6CF1B3363,0x183C3C1818001800,//¬­ +0x0000CC663366CC00,0x00003366CC663300,//®¯ +0x1144114411441144,0x55AA55AA55AA55AA,//°± +0xEEBBEEBBEEBBEEBB,0x1818181818181818,//²³ +0x1818181F18181818,0x1818181F181F1818,//´µ +0x6C6C6C6F6C6C6C6C,0x6C6C6C7F00000000,//¶· +0x1818181F181F0000,0x6C6C6C6F606F6C6C,//¸¹ +0x6C6C6C6C6C6C6C6C,0x6C6C6C6F607F0000,//º» +0x0000007F606F6C6C,0x0000007F6C6C6C6C,//¼½ +0x0000001F181F1818,0x1818181F00000000,//¾¿ +0x000000F818181818,0x000000FF18181818,//ÀÁ +0x181818FF00000000,0x181818F818181818,//Âà +0x000000FF00000000,0x181818FF18181818,//ÄÅ +0x181818F818F81818,0x6C6C6CEC6C6C6C6C,//ÆÇ +0x000000FC0CEC6C6C,0x6C6C6CEC0CFC0000,//ÈÉ +0x000000FF00EF6C6C,0x6C6C6CEF00FF0000,//ÊË +0x6C6C6CEC0CEC6C6C,0x000000FF00FF0000,//ÌÍ +0x6C6C6CEF00EF6C6C,0x000000FF00FF1818,//ÎÏ +0x000000FF6C6C6C6C,0x181818FF00FF0000,//ÐÑ +0x6C6C6CFF00000000,0x000000FC6C6C6C6C,//ÒÓ +0x000000F818F81818,0x181818F818F80000,//ÔÕ +0x6C6C6CFC00000000,0x6C6C6CEF6C6C6C6C,//Ö× +0x181818FF00FF1818,0x0000001F18181818,//ØÙ +0x181818F800000000,0xFFFFFFFFFFFFFFFF,//ÚÛ +0xFFFFFFFF00000000,0x0F0F0F0F0F0F0F0F,//ÜÝ +0xF0F0F0F0F0F0F0F0,0x00000000FFFFFFFF,//Þß +0x006E3B133B6E0000,0x03031F331F331E00,//àá +0x0003030303637F00,0x0036363636367F00,//âã +0x007F660C180C667F,0x001E3333337E0000,//äå +0x03063E6666666600,0x00181818183B6E00,//æç +0x3F0C1E33331E0C3F,0x001C36637F63361C,//èé +0x007736366363361C,0x001E33333E180C38,//êë +0x00007EDBDB7E0000,0x03067EDBDB7E3060,//ìí +0x003C06033F03063C,0x003333333333331E,//îï +0x00003F003F003F00,0x003F000C0C3F0C0C,//ðñ +0x003F00060C180C06,0x003F00180C060C18,//òó +0x1818181818D8D870,0x0E1B1B1818181818,//ôõ +0x000C0C003F000C0C,0x0000394E00394E00,//ö÷ +0x000000001C36361C,0x0000001818000000,//øù +0x0000001800000000,0x383C3637303030F0,//úû +0x000000363636361E,0x0000003E061C301E,//üý +0x00003C3C3C3C0000,0xFFFFFFFFFFFFFFFF,//þÿ +}; diff --git a/Kernel/FunSeg.CPP b/Kernel/FunSeg.CPP deleted file mode 100644 index 3479817..0000000 --- a/Kernel/FunSeg.CPP +++ /dev/null @@ -1,338 +0,0 @@ -I64 HasLower(U8 *src) -{ - I64 ch; - while (ch=*src++) - if ('a'<=ch<='z') - return TRUE; - return FALSE; -} - -U0 HashFunSegFind(CHashTable *h,U8 *addr, - Bool *_has_lower,U64 *_best,CHash **_res) -{ - Bool *has_lower=*_has_lower; - CHashExport *tempex; - U64 i,j,best=*_best; - CHash *res=*_res; - for (i=0;i<=h->mask;i++) { - tempex=h->body[i]; - while (tempex) { - j=0; - if (tempex->type&HTT_FUN) { - if (!Bt(&tempex(CHashFun *)->flags,Cf_EXTERN) && - !Bt(&tempex(CHashFun *)->flags,Ff_INTERNAL)) - j=tempex(CHashFun *)->exe_addr; - } else if (tempex->type&HTT_EXPORT_SYS_SYM) - j=tempex->val; - if (j) { - j=addr(I64)-j; - if (0<=j<=best) { - if (tempex->type&HTT_EXPORT_SYS_SYM) { - if (jstr); - best=j; - res=tempex; - } - } else if (tempex->type&HTT_FUN) { - if (jtype&HTT_EXPORT_SYS_SYM||!has_lower)) { - has_lower=HasLower(tempex->str); - best=j; - res=tempex; - } - } - } - } - tempex=tempex->next; - } - } - *_has_lower=has_lower; - *_best=best; - *_res =res; -} - -CHash *FunSegFind(U8 *addr,I64 *_offset) -{//See $LK,"Hash",A="HI:Hash"$. - CHash *res=NULL; - Bool has_lower=FALSE; - CTask *task; - CHashTable *h; - CCPU *c; - U64 i,best=0xFFFF; - if (!ChkCodePtr(addr)) { - *_offset=best; - return NULL; - } - if (IsDbg) - for (i=0;iseth_task; - do { - if (!TaskValidate(task)) goto fs_abort_task; - h=task->hash_table; - while (h) { - HashFunSegFind(h,addr,&has_lower,&best,&res); - h=h->next; - } - task=task->next_task; - } while (task!=c->seth_task); -fs_abort_task: - } - else { - h=Fs->hash_table; - while (h) { - HashFunSegFind(h,addr,&has_lower,&best,&res); - h=h->next; - } - } - *_offset=best; - return res; -} - -U0 FunSegCacheAdd(CHash *temps,U8 *addr) -{ - I64 i; - CDbgInfo *dbg_info; - CFunSegCache *tempfsc; - if (temps && temps->type&HTT_FUN && - (dbg_info=temps(CHashFun *)->dbg_info)) { - lock i=dbg.fun_seg_cache_index++; - tempfsc=&dbg.fun_seg_cache[i&(FUN_SEG_CACHE_SIZE-1)]; - tempfsc->base=dbg_info->body[0]; - if (addrbase) - tempfsc->base=addr; - tempfsc->limit=dbg_info->body[dbg_info->max_line+1-dbg_info->min_line]; - if (addr>=tempfsc->limit) - tempfsc->limit=addr+1; - i=MinI64(StrLen(temps->str),FUN_SEG_CACHE_STR_LEN-1); - MemCpy(tempfsc->str,temps->str,i); - tempfsc->str[i]=0; - tempfsc->time_stamp=tS; - } -} - -U8 *FunSegCacheFind(U8 *addr,I64 *_offset) -{ - I64 i; - F64 timeout; - CFunSegCache *tempfsc=dbg.fun_seg_cache; - if (addr==SYS_IDLE_PT) { - *_offset=0; - return "SYS_IDLE_PT"; - } else { - timeout=tS+8.0; - for (i=0;ibase<=addrlimit && - tempfsc->time_stamp>timeout) { - *_offset=addr-tempfsc->base; - return tempfsc->str; - } - return NULL; - } -} - -U0 StrPrintFunSeg(U8 *buf,I64 addr,I64 field_len,I64 flags) -{ - I64 offset; - CHashExport *tempex; - U8 *str,*str2; - Bool is_fun=FALSE; - if (!(flags&SPF_TRUNCATE)) - field_len=0; - if (addr) { - if (str=FunSegCacheFind(addr,&offset)) { - if (addr!=SYS_IDLE_PT) - is_fun=TRUE; - } else { - if (tempex=FunSegFind(addr,&offset)) { - if (tempex->type&HTT_FUN) - is_fun=TRUE; - FunSegCacheAdd(tempex,addr); - str=tempex->str; - } - } - if (str) { - if (offset>0xFFFF) offset=0xFFFF; - if (is_fun) { - str2=MStrPrint("&%s",str); - if (field_len>7) { - if (flags&SPF_LEFT_JUSTIFY && StrLen(str2)7) { - if (flags&SPF_LEFT_JUSTIFY && StrLen(str)type&(HTT_FUN|HTT_EXPORT_SYS_SYM)) { - if (dbg_info=temph->dbg_info) { - num_lines=dbg_info->max_line-dbg_info->min_line+1; - body=dbg_info->body; - - //find first nonzero - first_line=0; - while (!body[first_line]) { - first_line++; - if (first_line>=num_lines) - return -1; - } - - //find last nonzero - last_line=num_lines-1; - while (!body[last_line] && last_line>first_line) - last_line--; - - //interpolate to guess line num - cur_line=ClampI64(ToF64(addr-body[first_line])*(last_line-first_line+1)/ - (body[last_line]-body[first_line]+1),first_line,last_line); - - //retreat while too high - while ((!body[cur_line] || body[cur_line]>=addr) && cur_line>first_line) - cur_line--; - - //advance while to low - while ((!body[cur_line] || body[cur_line]min_line; - - } else if (temph->src_link) { - src =StrNew(temph->src_link); - src2=StrNew(temph->src_link); - StrLastRem(src,",",src2); - cur_line=Str2I64(src2); - Free(src); - Free(src2); - return cur_line; - } - } - } - return -1; -} - -U8 *SrcFileName(U8 *addr,I64 cnt=1,CTask *mem_task=NULL) -{//MAlloc filename for src of addr. - CHashSrcSym *temph; - I64 i,j,ii,offset,best=NULL,d,best_d; - U32 *body; - CDbgInfo *dbg_info; - U8 *src; - if ((temph=FunSegFind(addr,&offset)) && - temph->type&(HTT_FUN|HTT_EXPORT_SYS_SYM)) { - if (dbg_info=temph->dbg_info) { - j=dbg_info->max_line-dbg_info->min_line+1; - body=dbg_info->body; - best_d=MAX_I64; - for (i=0;isrc_link; - } - } - } - } - } else - best=temph->src_link; - } - if (best) { - src=StrNew(best,mem_task); - StrFirstRem(src,":"); - StrLastRem(src,","); - return src; - } else - return NULL; -} - -U8 *SrcEdLink(U8 *addr,I64 cnt=1,CTask *mem_task=NULL) -{//MAlloc file,line link to src of addr. - U8 *filename,*st,*st2; - I64 linenum; - if (filename=SrcFileName(addr,cnt)) { - linenum=SrcLineNum(addr,cnt); - if (linenum<1) - linenum=1; - st2=MStrPrint("FL:%s,%d",filename,linenum); - Free(filename); - st=StrNew(st2,mem_task); - Free(st2); - return st; - } - return NULL; -} - -Bool PutSrcLink(U8 *addr,I64 cnt=1,U8 *buf=NULL) -{//Put to StdOut a $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$ file,line link to src of addr. - U8 *src; - if (src=SrcEdLink(addr,cnt)) { - if (buf) - StrPrint(buf,"$$LK,\"%p\",A=\"%s\"$$",addr,src); - else - "$$LK,\"%p\",A=\"%s\"$$",addr,src; - Free(src); - return TRUE; - } else if (buf) - *buf=0; - return FALSE; -} - -Bool E(U8 *addr,I64 cnt=512,I64 edf_dof_flags=0) -{//Edit src at addr. - U8 *st; - Bool res=FALSE; - if (st=SrcEdLink(addr,cnt)) { - if (IsRaw) - res=EdLiteFileLine(st,edf_dof_flags); - else - res=Ed(st,edf_dof_flags); - Free(st); - } - return res; -} - -Bool Man(U8 *st,I64 edf_dof_flags=0) -{//Owner's manual for symbol. Edit src code for symbol. - Bool res=FALSE; - U8 **st2; - CHashSrcSym *temph; - if (IsRaw) { - if ((temph=HashFind(st,Fs->hash_table,HTG_SRC_SYM)) && temph->src_link) - res=EdLiteFileLine(temph->src_link,edf_dof_flags); - } else { - st2=MStrPrint("MN:%s",st); - res=Ed(st2,edf_dof_flags); - Free(st2); - } - return res; -} diff --git a/Kernel/FunSeg.HC b/Kernel/FunSeg.HC new file mode 100644 index 0000000..c687c75 --- /dev/null +++ b/Kernel/FunSeg.HC @@ -0,0 +1,338 @@ +I64 HasLower(U8 *src) +{ + I64 ch; + while (ch=*src++) + if ('a'<=ch<='z') + return TRUE; + return FALSE; +} + +U0 HashFunSegFind(CHashTable *h,U8 *addr, + Bool *_has_lower,U64 *_best,CHash **_res) +{ + Bool *has_lower=*_has_lower; + CHashExport *tempex; + U64 i,j,best=*_best; + CHash *res=*_res; + for (i=0;i<=h->mask;i++) { + tempex=h->body[i]; + while (tempex) { + j=0; + if (tempex->type&HTT_FUN) { + if (!Bt(&tempex(CHashFun *)->flags,Cf_EXTERN) && + !Bt(&tempex(CHashFun *)->flags,Ff_INTERNAL)) + j=tempex(CHashFun *)->exe_addr; + } else if (tempex->type&HTT_EXPORT_SYS_SYM) + j=tempex->val; + if (j) { + j=addr(I64)-j; + if (0<=j<=best) { + if (tempex->type&HTT_EXPORT_SYS_SYM) { + if (jstr); + best=j; + res=tempex; + } + } else if (tempex->type&HTT_FUN) { + if (jtype&HTT_EXPORT_SYS_SYM||!has_lower)) { + has_lower=HasLower(tempex->str); + best=j; + res=tempex; + } + } + } + } + tempex=tempex->next; + } + } + *_has_lower=has_lower; + *_best=best; + *_res =res; +} + +CHash *FunSegFind(U8 *addr,I64 *_offset) +{//See $LK,"Hash",A="HI:Hash"$. + CHash *res=NULL; + Bool has_lower=FALSE; + CTask *task; + CHashTable *h; + CCPU *c; + U64 i,best=0xFFFF; + if (!ChkCodePtr(addr)) { + *_offset=best; + return NULL; + } + if (IsDbg) + for (i=0;iseth_task; + do { + if (!TaskValidate(task)) goto fs_abort_task; + h=task->hash_table; + while (h) { + HashFunSegFind(h,addr,&has_lower,&best,&res); + h=h->next; + } + task=task->next_task; + } while (task!=c->seth_task); +fs_abort_task: + } + else { + h=Fs->hash_table; + while (h) { + HashFunSegFind(h,addr,&has_lower,&best,&res); + h=h->next; + } + } + *_offset=best; + return res; +} + +U0 FunSegCacheAdd(CHash *temps,U8 *addr) +{ + I64 i; + CDbgInfo *dbg_info; + CFunSegCache *tempfsc; + if (temps && temps->type&HTT_FUN && + (dbg_info=temps(CHashFun *)->dbg_info)) { + lock i=dbg.fun_seg_cache_index++; + tempfsc=&dbg.fun_seg_cache[i&(FUN_SEG_CACHE_SIZE-1)]; + tempfsc->base=dbg_info->body[0]; + if (addrbase) + tempfsc->base=addr; + tempfsc->limit=dbg_info->body[dbg_info->max_line+1-dbg_info->min_line]; + if (addr>=tempfsc->limit) + tempfsc->limit=addr+1; + i=MinI64(StrLen(temps->str),FUN_SEG_CACHE_STR_LEN-1); + MemCpy(tempfsc->str,temps->str,i); + tempfsc->str[i]=0; + tempfsc->time_stamp=tS; + } +} + +U8 *FunSegCacheFind(U8 *addr,I64 *_offset) +{ + I64 i; + F64 timeout; + CFunSegCache *tempfsc=dbg.fun_seg_cache; + if (addr==SYS_IDLE_PT) { + *_offset=0; + return "SYS_IDLE_PT"; + } else { + timeout=tS+8.0; + for (i=0;ibase<=addrlimit && + tempfsc->time_stamp>timeout) { + *_offset=addr-tempfsc->base; + return tempfsc->str; + } + return NULL; + } +} + +U0 StrPrintFunSeg(U8 *buf,I64 addr,I64 field_len,I64 flags) +{ + I64 offset; + CHashExport *tempex; + U8 *str,*str2; + Bool is_fun=FALSE; + if (!(flags&SPF_TRUNCATE)) + field_len=0; + if (addr) { + if (str=FunSegCacheFind(addr,&offset)) { + if (addr!=SYS_IDLE_PT) + is_fun=TRUE; + } else { + if (tempex=FunSegFind(addr,&offset)) { + if (tempex->type&HTT_FUN) + is_fun=TRUE; + FunSegCacheAdd(tempex,addr); + str=tempex->str; + } + } + if (str) { + if (offset>0xFFFF) offset=0xFFFF; + if (is_fun) { + str2=MStrPrint("&%s",str); + if (field_len>7) { + if (flags&SPF_LEFT_JUSTIFY && StrLen(str2)7) { + if (flags&SPF_LEFT_JUSTIFY && StrLen(str)type&(HTT_FUN|HTT_EXPORT_SYS_SYM)) { + if (dbg_info=temph->dbg_info) { + num_lines=dbg_info->max_line-dbg_info->min_line+1; + body=dbg_info->body; + + //find first nonzero + first_line=0; + while (!body[first_line]) { + first_line++; + if (first_line>=num_lines) + return -1; + } + + //find last nonzero + last_line=num_lines-1; + while (!body[last_line] && last_line>first_line) + last_line--; + + //interpolate to guess line num + cur_line=ClampI64(ToF64(addr-body[first_line])*(last_line-first_line+1)/ + (body[last_line]-body[first_line]+1),first_line,last_line); + + //retreat while too high + while ((!body[cur_line] || body[cur_line]>=addr) && cur_line>first_line) + cur_line--; + + //advance while to low + while ((!body[cur_line] || body[cur_line]min_line; + + } else if (temph->src_link) { + src =StrNew(temph->src_link); + src2=StrNew(temph->src_link); + StrLastRem(src,",",src2); + cur_line=Str2I64(src2); + Free(src); + Free(src2); + return cur_line; + } + } + } + return -1; +} + +U8 *SrcFileName(U8 *addr,I64 cnt=1,CTask *mem_task=NULL) +{//MAlloc filename for src of addr. + CHashSrcSym *temph; + I64 i,j,ii,offset,best=NULL,d,best_d; + U32 *body; + CDbgInfo *dbg_info; + U8 *src; + if ((temph=FunSegFind(addr,&offset)) && + temph->type&(HTT_FUN|HTT_EXPORT_SYS_SYM)) { + if (dbg_info=temph->dbg_info) { + j=dbg_info->max_line-dbg_info->min_line+1; + body=dbg_info->body; + best_d=MAX_I64; + for (i=0;isrc_link; + } + } + } + } + } else + best=temph->src_link; + } + if (best) { + src=StrNew(best,mem_task); + StrFirstRem(src,":"); + StrLastRem(src,","); + return src; + } else + return NULL; +} + +U8 *SrcEdLink(U8 *addr,I64 cnt=1,CTask *mem_task=NULL) +{//MAlloc file,line link to src of addr. + U8 *filename,*st,*st2; + I64 linenum; + if (filename=SrcFileName(addr,cnt)) { + linenum=SrcLineNum(addr,cnt); + if (linenum<1) + linenum=1; + st2=MStrPrint("FL:%s,%d",filename,linenum); + Free(filename); + st=StrNew(st2,mem_task); + Free(st2); + return st; + } + return NULL; +} + +Bool PutSrcLink(U8 *addr,I64 cnt=1,U8 *buf=NULL) +{//Put to StdOut a $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ file,line link to src of addr. + U8 *src; + if (src=SrcEdLink(addr,cnt)) { + if (buf) + StrPrint(buf,"$$LK,\"%p\",A=\"%s\"$$",addr,src); + else + "$$LK,\"%p\",A=\"%s\"$$",addr,src; + Free(src); + return TRUE; + } else if (buf) + *buf=0; + return FALSE; +} + +Bool E(U8 *addr,I64 cnt=512,I64 edf_dof_flags=0) +{//Edit src at addr. + U8 *st; + Bool res=FALSE; + if (st=SrcEdLink(addr,cnt)) { + if (IsRaw) + res=EdLiteFileLine(st,edf_dof_flags); + else + res=Ed(st,edf_dof_flags); + Free(st); + } + return res; +} + +Bool Man(U8 *st,I64 edf_dof_flags=0) +{//Owner's manual for symbol. Edit src code for symbol. + Bool res=FALSE; + U8 **st2; + CHashSrcSym *temph; + if (IsRaw) { + if ((temph=HashFind(st,Fs->hash_table,HTG_SRC_SYM)) && temph->src_link) + res=EdLiteFileLine(temph->src_link,edf_dof_flags); + } else { + st2=MStrPrint("MN:%s",st); + res=Ed(st2,edf_dof_flags); + Free(st2); + } + return res; +} diff --git a/Kernel/KCfg.CPP b/Kernel/KCfg.HC similarity index 100% rename from Kernel/KCfg.CPP rename to Kernel/KCfg.HC diff --git a/Kernel/KDataTypes.CPP b/Kernel/KDataTypes.HC similarity index 100% rename from Kernel/KDataTypes.CPP rename to Kernel/KDataTypes.HC diff --git a/Kernel/KDate.CPP b/Kernel/KDate.CPP deleted file mode 100644 index 226633c..0000000 --- a/Kernel/KDate.CPP +++ /dev/null @@ -1,196 +0,0 @@ -//See $LK,"::/Doc/TimeDate.TXT"$ - -U16 mon_start_days1[12]={ -0,31,59,90,120,151,181,212,243,273,304,334}; -U16 mon_start_days2[12]={ -0,31,60,91,121,152,182,213,244,274,305,335}; - -I64 YearStartDate(I64 year) -{//32-bit day since AD 0, given year number. - I64 y1=year-1,yd4000=y1/4000,yd400=y1/400,yd100=y1/100,yd4=y1/4; - return year*365+yd4-yd100+yd400-yd4000; -} - -CDate Struct2Date(CDateStruct *_ds) -{//Cvt CDateStruct to CDate. - CDate cdt; - I64 i1,i2; - i1=YearStartDate(_ds->year); - i2=YearStartDate(_ds->year+1); - if (i2-i1==365) - i1+=mon_start_days1[_ds->mon-1]; - else - i1+=mon_start_days2[_ds->mon-1]; - cdt.date=i1+_ds->day_of_mon-1; - cdt.time=(_ds->sec10000+100*(_ds->sec100+100*(_ds->sec - +60*(_ds->min+60*_ds->hour))))<<21/(15*15*3*625); - return cdt; -} - -I64 DayOfWeek(I64 i) -{//Day of week, given 32-bit day since AD 0. - i+=CDATE_BASE_DAY_OF_WEEK; - if (i>=0) - return i % 7; - else - return 6-(6-i)%7; -} - -U0 Date2Struct(CDateStruct *_ds,CDate cdt) -{//Cvt CDate to CDateStruct. - I64 i,k,date=cdt.date; - _ds->day_of_week=DayOfWeek(date); - _ds->year=(date+1)*100000/CDATE_YEAR_DAYS_INT; - i=YearStartDate(_ds->year); - while (i>date) { - _ds->year--; - i=YearStartDate(_ds->year); - } - date-=i; - if (YearStartDate(_ds->year+1)-i==365) { - k=0; - while (date>=mon_start_days1[k+1] && k<11) - k++; - date-=mon_start_days1[k]; - } else { - k=0; - while (date>=mon_start_days2[k+1] && k<11) - k++; - date-=mon_start_days2[k]; - } - _ds->mon=k+1; - _ds->day_of_mon=date+1; - k=(625*15*15*3*cdt.time)>>21+1; - _ds->sec10000=ModU64(&k,100); - _ds->sec100=ModU64(&k,100); - _ds->sec=ModU64(&k,60); - _ds->min=ModU64(&k,60); - _ds->hour =k; -} - -I64 FirstDayOfMon(I64 i) -{//First day of month, given 32-bit day since AD 0. - CDateStruct ds; - CDate cdt=0; - cdt.date=i; - Date2Struct(&ds,cdt); - ds.day_of_mon=1; - cdt=Struct2Date(&ds); - return cdt.date; -} - -I64 LastDayOfMon(I64 i) -{//Last day of month, given 32-bit day since AD 0. - CDateStruct ds; - CDate cdt=0; - cdt.date=i; - Date2Struct(&ds,cdt); - ds.mon++; - if (ds.mon==13) { - ds.mon=0; - ds.year++; - } - ds.day_of_mon=1; - cdt=Struct2Date(&ds); - return cdt.date-1; -} - -I64 FirstDayOfYear(I64 i) -{//First day of year, given 32-bit day since AD 0. - CDateStruct ds; - CDate cdt=0; - cdt.date=i; - Date2Struct(&ds,cdt); - ds.day_of_mon=1; - ds.mon=1; - cdt=Struct2Date(&ds); - return cdt.date; -} - -I64 LastDayOfYear(I64 i) -{//Last day of year, given 32-bit day since AD 0. - CDateStruct ds; - CDate cdt=0; - cdt.date=i; - Date2Struct(&ds,cdt); - ds.day_of_mon=1; - ds.mon=1; - ds.year++; - cdt=Struct2Date(&ds); - return cdt.date-1; -} - -I64 Bcd2Bin(U64 b) -{ - I64 i,res=0; - for (i=0;i<16;i++) { - res=res*10+b>>60; - b<<=4; - } - return res; -} - -U0 NowDateTimeStruct(CDateStruct *_ds) -{ - I64 i; - U8 *b=_ds; - Bool is_bcd; - - MemSet(_ds,0,sizeof(CDateStruct)); - PUSHFD - CLI - while (LBts(&sys_semas[SYS_SEMA_SYS_DATE],0)) - PAUSE - - OutU8(0x70,0x0A); - do { - while (InU8(0x71) & 0x80) - PAUSE - - OutU8(0x70,0); - b[2]=InU8(0x71); - OutU8(0x70,2); - b[3]=InU8(0x71); - OutU8(0x70,4); - b[4]=InU8(0x71); - - OutU8(0x70,6); - b[5]=InU8(0x71); - OutU8(0x70,7); - b[6]=InU8(0x71); - OutU8(0x70,8); - b[7]=InU8(0x71); - OutU8(0x70,9); - b[8]=InU8(0x71); - - OutU8(0x70,0x0A); - } while (InU8(0x71) & 0x80); - - OutU8(0x70,0x0B); - if (InU8(0x71) & 4) - is_bcd=FALSE; - else - is_bcd=TRUE; - - LBtr(&sys_semas[SYS_SEMA_SYS_DATE],0); - POPFD - if (is_bcd) - for (i=2;i<9;i++) - b[i]=Bcd2Bin(b[i]); - - if (_ds->year>255) _ds->year=255; - _ds->year+=2000; - if (_ds->mon>12) _ds->mon=12; - if (_ds->day_of_mon>31) _ds->day_of_mon=31; - if (_ds->day_of_week>6) _ds->day_of_week=6; - if (_ds->hour>23) _ds->hour=23; - if (_ds->min>59) _ds->min=59; - if (_ds->sec>59) _ds->sec=59; -} - -CDate Now() -{//Current datetime. - CDateStruct ds; - NowDateTimeStruct(&ds); - return Struct2Date(&ds)-local_time_offset; -} diff --git a/Kernel/KDate.HC b/Kernel/KDate.HC new file mode 100644 index 0000000..38ac24c --- /dev/null +++ b/Kernel/KDate.HC @@ -0,0 +1,196 @@ +//See $LK,"::/Doc/TimeDate.DD"$ + +U16 mon_start_days1[12]={ +0,31,59,90,120,151,181,212,243,273,304,334}; +U16 mon_start_days2[12]={ +0,31,60,91,121,152,182,213,244,274,305,335}; + +I64 YearStartDate(I64 year) +{//32-bit day since AD 0, given year number. + I64 y1=year-1,yd4000=y1/4000,yd400=y1/400,yd100=y1/100,yd4=y1/4; + return year*365+yd4-yd100+yd400-yd4000; +} + +CDate Struct2Date(CDateStruct *_ds) +{//Cvt CDateStruct to CDate. + CDate cdt; + I64 i1,i2; + i1=YearStartDate(_ds->year); + i2=YearStartDate(_ds->year+1); + if (i2-i1==365) + i1+=mon_start_days1[_ds->mon-1]; + else + i1+=mon_start_days2[_ds->mon-1]; + cdt.date=i1+_ds->day_of_mon-1; + cdt.time=(_ds->sec10000+100*(_ds->sec100+100*(_ds->sec + +60*(_ds->min+60*_ds->hour))))<<21/(15*15*3*625); + return cdt; +} + +I64 DayOfWeek(I64 i) +{//Day of week, given 32-bit day since AD 0. + i+=CDATE_BASE_DAY_OF_WEEK; + if (i>=0) + return i % 7; + else + return 6-(6-i)%7; +} + +U0 Date2Struct(CDateStruct *_ds,CDate cdt) +{//Cvt CDate to CDateStruct. + I64 i,k,date=cdt.date; + _ds->day_of_week=DayOfWeek(date); + _ds->year=(date+1)*100000/CDATE_YEAR_DAYS_INT; + i=YearStartDate(_ds->year); + while (i>date) { + _ds->year--; + i=YearStartDate(_ds->year); + } + date-=i; + if (YearStartDate(_ds->year+1)-i==365) { + k=0; + while (date>=mon_start_days1[k+1] && k<11) + k++; + date-=mon_start_days1[k]; + } else { + k=0; + while (date>=mon_start_days2[k+1] && k<11) + k++; + date-=mon_start_days2[k]; + } + _ds->mon=k+1; + _ds->day_of_mon=date+1; + k=(625*15*15*3*cdt.time)>>21+1; + _ds->sec10000=ModU64(&k,100); + _ds->sec100=ModU64(&k,100); + _ds->sec=ModU64(&k,60); + _ds->min=ModU64(&k,60); + _ds->hour =k; +} + +I64 FirstDayOfMon(I64 i) +{//First day of month, given 32-bit day since AD 0. + CDateStruct ds; + CDate cdt=0; + cdt.date=i; + Date2Struct(&ds,cdt); + ds.day_of_mon=1; + cdt=Struct2Date(&ds); + return cdt.date; +} + +I64 LastDayOfMon(I64 i) +{//Last day of month, given 32-bit day since AD 0. + CDateStruct ds; + CDate cdt=0; + cdt.date=i; + Date2Struct(&ds,cdt); + ds.mon++; + if (ds.mon==13) { + ds.mon=0; + ds.year++; + } + ds.day_of_mon=1; + cdt=Struct2Date(&ds); + return cdt.date-1; +} + +I64 FirstDayOfYear(I64 i) +{//First day of year, given 32-bit day since AD 0. + CDateStruct ds; + CDate cdt=0; + cdt.date=i; + Date2Struct(&ds,cdt); + ds.day_of_mon=1; + ds.mon=1; + cdt=Struct2Date(&ds); + return cdt.date; +} + +I64 LastDayOfYear(I64 i) +{//Last day of year, given 32-bit day since AD 0. + CDateStruct ds; + CDate cdt=0; + cdt.date=i; + Date2Struct(&ds,cdt); + ds.day_of_mon=1; + ds.mon=1; + ds.year++; + cdt=Struct2Date(&ds); + return cdt.date-1; +} + +I64 Bcd2Bin(U64 b) +{ + I64 i,res=0; + for (i=0;i<16;i++) { + res=res*10+b>>60; + b<<=4; + } + return res; +} + +U0 NowDateTimeStruct(CDateStruct *_ds) +{ + I64 i; + U8 *b=_ds; + Bool is_bcd; + + MemSet(_ds,0,sizeof(CDateStruct)); + PUSHFD + CLI + while (LBts(&sys_semas[SYS_SEMA_SYS_DATE],0)) + PAUSE + + OutU8(0x70,0x0A); + do { + while (InU8(0x71) & 0x80) + PAUSE + + OutU8(0x70,0); + b[2]=InU8(0x71); + OutU8(0x70,2); + b[3]=InU8(0x71); + OutU8(0x70,4); + b[4]=InU8(0x71); + + OutU8(0x70,6); + b[5]=InU8(0x71); + OutU8(0x70,7); + b[6]=InU8(0x71); + OutU8(0x70,8); + b[7]=InU8(0x71); + OutU8(0x70,9); + b[8]=InU8(0x71); + + OutU8(0x70,0x0A); + } while (InU8(0x71) & 0x80); + + OutU8(0x70,0x0B); + if (InU8(0x71) & 4) + is_bcd=FALSE; + else + is_bcd=TRUE; + + LBtr(&sys_semas[SYS_SEMA_SYS_DATE],0); + POPFD + if (is_bcd) + for (i=2;i<9;i++) + b[i]=Bcd2Bin(b[i]); + + if (_ds->year>255) _ds->year=255; + _ds->year+=2000; + if (_ds->mon>12) _ds->mon=12; + if (_ds->day_of_mon>31) _ds->day_of_mon=31; + if (_ds->day_of_week>6) _ds->day_of_week=6; + if (_ds->hour>23) _ds->hour=23; + if (_ds->min>59) _ds->min=59; + if (_ds->sec>59) _ds->sec=59; +} + +CDate Now() +{//Current datetime. + CDateStruct ds; + NowDateTimeStruct(&ds); + return Struct2Date(&ds)-local_time_offset; +} diff --git a/Kernel/KDbg.CPP b/Kernel/KDbg.CPP deleted file mode 100644 index 434496f..0000000 --- a/Kernel/KDbg.CPP +++ /dev/null @@ -1,642 +0,0 @@ -Bool ChkPtr(U8 *ptr) -{//Check if addr is valid ptr. - if (sys_heap_base<=ptr<=MEM_MAPPED_SPACE) { - if (*MemPageTable(ptr)&1) - return TRUE; - else - return FALSE; - } else if (ptrstk->stk_base<=ptr<= - (&task->stk->stk_base)(U8 *)+task->stk->stk_size) - res=TRUE; - } else if (sys_heap_base<=ptr<=sys_heap_limit) - res=TRUE; - POPFD - return res; -} - -I64 UnusedStk(CTask *task=NULL) -{//Count of usused bytes in task's stk. - I64 res; - if (!task) task=Fs; - PUSHFD - CLI - if (task==Fs) - res=GetRSP()(U8 *)-(&task->stk->stk_base)(U8 *); - else - res=task->rsp(U8 *)-(&task->stk->stk_base)(U8 *); - POPFD - return res; -} - -U8 *Caller(I64 num=1) -{//Returns the addr of the fun which called this one, -//or the caller of the caller, etc. - U8 **rbp=GetRBP,**ptr; - while (num--) { - if (rbp>=*rbp) - return NULL; - rbp=*rbp; - if (!ChkOnStk(rbp,Fs)) - return NULL; - } - ptr=rbp+1; - return *ptr; -} - -U8 *TaskCaller(CTask *task=NULL,I64 num=0,Bool saved_context=FALSE) -{//Fetches addr of Nth caller on task's stk. - U8 **ptr,**rbp,**rsp; - if (!task) task=Fs; - if (!saved_context && task==Fs) - return Caller(num+1); - if (!TaskValidate(task)) - return NULL; - rbp=task->rbp; - rsp=task->rsp; - if (num) { - while (ChkOnStk(rbp,task)) { - ptr=rbp+1; - if (! --num) - return *ptr; - if (rbp>=*rbp) - break; - rbp=*rbp; - } - return NULL; - } else { - if (task->rip==_RET) - return *rsp; - else - return task->rip; - } -} -#define STK_REP_LEN 32 - -U0 StkRep(CTask *task=NULL) -{//Reports whats on the stk. - I64 i,j,addr, - **rbp,**rsp,*my_rsp[STK_REP_LEN]; - CHashTable *old_hash=Fs->hash_table; - if (!task) task=Fs; - if (!TaskValidate(task)) - return; - PUSHFD - CLI - if (task==Fs) { - rbp=GetRBP; - rsp=rbp+3; - rbp=*rbp; - } else { - rsp=task->rsp; - rbp=task->rbp; - } - if (task->rip==_RET) - addr=*rsp; - else - addr=task->rip; - MemCpy(my_rsp,rsp,STK_REP_LEN*sizeof(U8 *)); - POPFD - Fs->hash_table=task->hash_table; - for (i=0;istk->stk_base<=rbp< - (&task->stk->stk_base)(U8 *)+task->stk->stk_size)) - break; - j=rbp-rsp; - if (j>=i) - break; - addr=my_rsp[j+1]; - if (rbp>=my_rsp[j]) - break; - rbp=my_rsp[j]; - } - if (my_rsp[i]==addr) - "$$RED$$"; - "%P$$FG$$\n",my_rsp[i]; - } - '\n'; - Fs->hash_table=old_hash; -} - -U0 CallerRep(U8 **rbp=NULL,CTask *task=NULL) -{//Prints a report of calling routines. - I64 **ptr; - if (!task) task=Fs; - if (!rbp) { - if (task==Fs) - rbp=GetRBP; - else - rbp=task->rbp; - } - "CallerRep:\n"; - while (ChkOnStk(rbp,task)) { - ptr=rbp+1; - "%08X:%08tX:%P\n",ptr,*ptr,*ptr; - if (rbp>=*rbp) - break; - rbp=*rbp; - } -} - -U0 D(U8 *addr,I64 cnt=0x80,Bool show_offset=TRUE) -{//Dump mem, showing offsets. -//See $LK,"DocD",A="MN:DocD"$() for a live dump. - I64 i,j,ch; - U8 *ptr=addr; - while (cnt) { - if (show_offset) - "%08X ",ptr-addr; - else - "%010X ",ptr; - if (cnt>16) - j=16; - else - j=cnt; - for (i=0;i0) { - "%08X:%08X,%P\n",addr,*addr,*addr; - addr++; - } -} - -U0 RawPrint(I64 mS=100,U8 *fmt,...) -{//Print using $LK,"Raw",A="MN:Raw"$ screen output for a length of time. -//$BK,1$Your heap must be good.$BK,0$ - U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); - Bool old_raw,old_input_filter; - PUSHFD - CLI - old_raw=Raw(ON); - old_input_filter=LBtr(&Fs->task_flags,TASKf_INPUT_FILTER_TASK); - "%s",buf; - BusyWait(mS<<10); - POPFD - LBEqu(&Fs->task_flags,TASKf_INPUT_FILTER_TASK,old_input_filter); - Raw(old_raw); - Free(buf); -} - -U0 RawD(I64 mS=100,U8 *addr,I64 cnt=0x80) -{//Dumps a block of mem using $LK,"Raw",A="MN:Raw"$ -//screen output for a fixed length - //of time. - Bool old_raw,old_input_filter; - PUSHFD - CLI - old_raw=Raw(ON); - old_input_filter=LBtr(&Fs->task_flags,TASKf_INPUT_FILTER_TASK); - D(addr,cnt); - BusyWait(mS<<10); - POPFD - LBEqu(&Fs->task_flags,TASKf_INPUT_FILTER_TASK,old_input_filter); - Raw(old_raw); -} - -U0 RawDm(I64 mS=100,U8 *addr,I64 cnt=0x80) -{//Dumps a block of mem using $LK,"Raw",A="MN:Raw"$ -//screen output for a fixed length - //of time. - Bool old_raw,old_input_filter; - PUSHFD - CLI - old_raw=Raw(ON); - old_input_filter=LBtr(&Fs->task_flags,TASKf_INPUT_FILTER_TASK); - Dm(addr,cnt); - BusyWait(mS<<10); - POPFD - LBEqu(&Fs->task_flags,TASKf_INPUT_FILTER_TASK,old_input_filter); - Raw(old_raw); -} - -I64 *TaskRegAddr(CTask *task,I64 reg_num) -{ - switch (reg_num) { - case REG_RAX: return &task->rax; - case REG_RCX: return &task->rcx; - case REG_RDX: return &task->rdx; - case REG_RBX: return &task->rbx; - case REG_RSP: return &task->rsp; - case REG_RBP: return &task->rbp; - case REG_RSI: return &task->rsi; - case REG_RDI: return &task->rdi; - case 8 : return &task->r8; - case 9 : return &task->r9; - case 10: return &task->r10; - case 11: return &task->r11; - case 12: return &task->r12; - case 13: return &task->r13; - case 14: return &task->r14; - case 15: return &task->r15; - } - return NULL; -} - -#define RAWDR_COL 40 - -U0 RawDr(CTask *task=NULL) -{ - I64 i,j,old_col=text.raw_col; - Bool old_raw=Raw(ON); - U8 buf[200]; - - if (!task) task=Fs; - - for (i=0;i<16;i++) { - text.raw_col=i*text.cols+RAWDR_COL; - "º%3Z:%016X\n",i,"ST_U64_REGS",*TaskRegAddr(task,i); - } - - text.raw_col=i++*text.cols+RAWDR_COL; - "ºRIP:%016X\n",task->rip; - - text.raw_col=i++*text.cols+RAWDR_COL; - "º%-*tp\n",text.cols-(RAWDR_COL+1)-1,Fs->rip; - - text.raw_col=i++*text.cols+RAWDR_COL; - 'º'; - if (Bt(&sys_run_level,RLf_COMPILER)) { - j=Fs->rip; - Ui(buf,&j,,,TRUE); - "%s",buf; - } else - '\n'; - - text.raw_col=i*text.cols+RAWDR_COL; - 'È'; - for (j=0;jrip; -} - -U8 *SysGetStr2(I64) -{ - U8 buf[512]; - GetS(buf,512,FALSE); - return StrNew(buf); -} - -CBpt *BptFind(U8 *needle_addr,CTask *haystack_task=NULL,Bool rem=FALSE) -{ - CBpt *res=NULL,*tempb,*tempb1,*tempb2; - if (!haystack_task) haystack_task=Fs; - PUSHFD - CLI - tempb1=&haystack_task->bpt_lst; - tempb=haystack_task->bpt_lst; - while (tempb) { - tempb2=tempb->next; - if (tempb->addr==needle_addr) { - res=tempb; - if (rem) - tempb1->next=tempb2; - else - tempb1=&tempb->next; - } else - tempb1=&tempb->next; - tempb=tempb2; - } - POPFD - return res; -} - -Bool BptS(U8 *addr,CTask *task=NULL,Bool live=TRUE) -{//Set breakpoint. - CBpt *tempb; - Bool res=TRUE; - if (!task) task=Fs; - PUSHFD - CLI - if (!(tempb=BptFind(addr,task,FALSE))) { - tempb=CAlloc(sizeof(CBpt),task); - tempb->addr=addr; - tempb->val=*addr; - res=FALSE; - tempb->next=task->bpt_lst; - task->bpt_lst=tempb; - if (task==Fs && live) - *addr=OC_BPT; - } - POPFD - return res; -} - -Bool BptR(U8 *addr,CTask *task=NULL,Bool live=TRUE,Bool rem=TRUE) -{//Rem breakpoint. - CBpt *tempb; - Bool res=FALSE; - if (!task) task=Fs; - PUSHFD - CLI - if (tempb=BptFind(addr,task,rem)) { - if (task==Fs && live) - *tempb->addr=tempb->val; - res=TRUE; - if (rem) - Free(tempb); - } - POPFD - return res; -} - -Bool B(U8 *addr,CTask *task=NULL,Bool live=TRUE) -{//Toggle breakpoint. -//Return: TRUE if removed. - Bool res=FALSE; - PUSHFD - CLI - if (BptFind(addr,task,FALSE)) { - BptR(addr,task,live,TRUE); - res=TRUE; - } else - BptS(addr,task,live); - POPFD - return res; -} - -I64 B2(CTask *task=NULL,Bool live=TRUE) -{//Rem all breakpoints. -//Return: cnt of removed. - I64 res=0; - CBpt *tempb,*tempb1; - if (!task) task=Fs; - PUSHFD - CLI - tempb=task->bpt_lst; - task->bpt_lst=NULL; - while (tempb) { - tempb1=tempb->next; - if (task==Fs && live) - *tempb->addr=tempb->val; - Free(tempb); - tempb=tempb1; - res++; - } - POPFD - return res; -} - -U0 G(U8 *ip=INVALID_PTR,CTask *task=NULL) -{//Go - if (!task) task=Fs; - if (ip!=INVALID_PTR) task->rip=ip; - if (BptFind(task->rip,task)) - "\nDo one of the following, first:\n" - ">S;\t\t\t//Single step\n" - ">B2;\t\t\t//Clear all break points\n" - ">G2;\t\t\t//Clear all break points and Go\n\n" - "After resuming, next focus task\n" - "After resuming, flushes screen VGA cache\n"; - else { - LBtr(&task->task_flags,TASKf_DISABLE_BPTS); - LBtr(&task->rflags,RFLAGf_TRAP);//No single step - Suspend(task,FALSE); - if (task==Fs) { - if (IsDbg && task->next_cc!=&task->next_cc) { - "Exit Dbg\n"; - Btr(&task->last_cc->flags,CCf_PMT); - } - } else - Exit; - } -} - -U0 G2(U8 *ip=INVALID_PTR,CTask *task=NULL) -{//Rem all breakpoints and Go. - if (!task) task=Fs; - B2(task); - if (ext[EXT_WIN_FOCUS]) - CallExtNum(EXT_WIN_FOCUS,dbg.focus_task); - VGAFlush; - G(ip,task); -} - -public U0 S(U8 *ip=INVALID_PTR,CTask *task=NULL) //Single-step. -{//Single step. - if (!task) task=Fs; - PUSHFD - CLI - if (ip!=INVALID_PTR) task->rip=ip; - LBts(&task->task_flags,TASKf_DISABLE_BPTS); - LBts(&task->rflags,RFLAGf_TRAP); - Suspend(task,FALSE); - if (task==Fs) { - if (IsDbg) { - if (task->next_cc!=&task->next_cc) - Btr(&task->last_cc->flags,CCf_PMT); - } - } else - Exit; - POPFD -} - -U0 DbgHelp() -{ - "\n" - "The cmd line is basically the same as normal. Here are some common\n" - "debugging commands.\n\n" - ">EdLite(\"FileName\");\t\t//Edit file.\n" - ">D(0x100000);\t\t\t//Dump page tables.\n" - ">Dm(0x100000);\t\t\t//Dump page tables.\n" - ">Dm(Fs,sizeof(CTask));\t\t//Dump current task record.\n" - ">ClassRep(Fs,\"CTask\",1);\t//Dump current task record.\n" - ">ClassRep(Fs,,1);\t\t//(It knows lastclass.)\n" - ">CallerRep;\t\t\t//Stack trace report.\n" - ">Da(_RSP);\t\t\t//Dump stk.\n" - ">Dr;\t\t\t\t//Dump Regs.\n" - ">1+2*3+&Print;\t\t\t//Show calculation res.\n" - ">*(0x70000)(I64 *)=0x123456789;\t//Assign value to 0x70000-0x70007.\n" - ">_RAX=0x1234;\t\t\t//Set RAX to 0x1234.\n" - ">_RIP=&SysThrowBreak;\t\t//Set RIP.\n" - ">I64 i;\t\t\t\t//Declare variable.\n" - ">i=_RCX+_RDX;\t\t\t//Assign to variable.\n" - ">U(&Print+0x8);\t\t\t//Unassemble Print.\n" - ">Uf(\"Print\");\t\t\t//Unassembler function \"Print\".\n" - ">Man(\"Print\");\t\t\t//Edit Src for \"Print\".\n" - ">E(_RIP);\t\t\t//Edit Src Code.\n" - ">Fix;\t\t\t\t//Edit Last Err Src Code.\n" - ">B(&Main+0x20);\t\t\t//Toggle break point.\n" - ">B2;\t\t\t\t//Clear all break points.\n" - ">S;\t\t\t\t//Single step.\n" - ">G;\t\t\t\t//Resume execution.\n" - ">G2;\t\t\t\t//B2;VGAFlush;WinFocus;G;\n" - ">Exit;\t\t\t\t//Exit (kill) task.\n\n" - "After resuming, next focus task.\n" - "After resuming, flushes screen VGA cache.\n\n"; -} - -U0 Dbg2() -{ - Bool old_win_inhibit,old_waiting_msg,old_single; - I64 i,old_getstr2; - U8 buf[200]; - if (IsRaw) { - i=Fs->rip; - Ui(buf,&i); - "%s",buf; - } else - U(Fs->rip,1); - old_waiting_msg=LBtr(&Fs->task_flags,TASKf_AWAITING_MSG); - old_win_inhibit=Fs->win_inhibit; - Fs->win_inhibit=WIG_USER_TASK_DFT; - sys_focus_task=Fs; - kbd.scan_code=0; - old_getstr2=fp_getstr2; - fp_getstr2=&SysGetStr2; - old_single=SingleUser(OFF); - while (!mouse.install_attempts) - Yield; - SingleUser(old_single); - UserTaskCont; - fp_getstr2=old_getstr2; - Fs->win_inhibit=old_win_inhibit; - LBEqu(&Fs->task_flags,TASKf_AWAITING_MSG,old_waiting_msg); -} - -U0 Fault3(I64 fault_num,I64 fault_err_code) -{ - no_warn fault_err_code; - PUSHFD - CLI - if (Gs->num && dbg.mp_crash) { - mp_cnt=1; - dbg.mp_crash->cpu_num=Gs->num; - dbg.mp_crash->task=Fs; - dbg.mp_crash->rip=Fs->rip; - dbg.mp_crash->msg=dbg.msg; - dbg.mp_crash->msg_num=dbg.msg_num; - MPInt(I_MP_CRASH,0); - SysHlt; - } - "\n\tTempleOS Debugger\n\n" - ">Help;\t//For help.\n\n"; - Beep(500,TRUE); - if (fault_num==I_DBG) { - if (dbg.msg) { - "\n!!! %s",dbg.msg; - if (dbg.msg_num) - "%016X",dbg.msg_num; - " !!!\n\n"; - } - } - CallerRep; - Dbg2; - POPFD -} - -U0 Fault2(I64 fault_num,I64 fault_err_code) -{//Called from $LK,"Fault2",A="FF:::/Kernel/KInts.CPP,Fault2"$. -//$BK,1$Be careful not to swap-out and ruin the saved context$BK,0$ - Bool was_raw,was_single_user,was_silent,was_in_dbg; - I64 i,old_raw_flags=text.raw_flags; - was_single_user=SingleUser(ON); - if (!IsDbg) - dbg.focus_task=sys_focus_task; - sys_focus_task=NULL; - if (fault_num==I_BPT) - Fs->rip--; - if (Fs->dbg_task) - CallExtNum(EXT_DBG_RESUME,fault_num,fault_err_code); - else { - was_raw=Raw(ON); - was_silent=Silent(OFF); - text.raw_flags|=RWF_SHOW_DOLLAR|RWF_SCROLL; - - "Task \""; - "%s",Fs->task_title; - "\"\n"; - "Fault:0x%02X %Z\t\tErr Code:%08X\n", - fault_num,fault_num,"ST_INT_NAMES",fault_err_code; - was_in_dbg=InDbg(ON); - "RIP:%08X",Fs->rip; //Sometimes crashes on %p, so do this first - ":%p RSP:%08X\n",Fs->rip,Fs->rsp; - if (fault_num==I_PAGE_FAULT) { - MOV_RAX_CR2 - i=GetRAX; - "Fault Addr:%08X:%p\n",i,i; - } - Fault3(fault_num,fault_err_code); - InDbg(was_in_dbg); - Silent(was_silent); - Raw(was_raw); - text.raw_flags=old_raw_flags; - } - SingleUser(was_single_user); - if (LBtr(&Fs->task_flags,TASKf_KILL_AFTER_DBG)) - Exit; -} - -U0 Dbg(U8 *msg=NULL,I64 msg_num=0) -{//Enters the debugger.Can be used as a panic. - PUSHFD - CLI - dbg.msg=msg; - dbg.msg_num=msg_num; - INT I_DBG - POPFD -} diff --git a/Kernel/KDbg.HC b/Kernel/KDbg.HC new file mode 100644 index 0000000..fbec34b --- /dev/null +++ b/Kernel/KDbg.HC @@ -0,0 +1,642 @@ +Bool ChkPtr(U8 *ptr) +{//Check if addr is valid ptr. + if (sys_heap_base<=ptr<=MEM_MAPPED_SPACE) { + if (*MemPageTable(ptr)&1) + return TRUE; + else + return FALSE; + } else if (ptrstk->stk_base<=ptr<= + (&task->stk->stk_base)(U8 *)+task->stk->stk_size) + res=TRUE; + } else if (sys_heap_base<=ptr<=sys_heap_limit) + res=TRUE; + POPFD + return res; +} + +I64 UnusedStk(CTask *task=NULL) +{//Count of usused bytes in task's stk. + I64 res; + if (!task) task=Fs; + PUSHFD + CLI + if (task==Fs) + res=GetRSP()(U8 *)-(&task->stk->stk_base)(U8 *); + else + res=task->rsp(U8 *)-(&task->stk->stk_base)(U8 *); + POPFD + return res; +} + +U8 *Caller(I64 num=1) +{//Returns the addr of the fun which called this one, +//or the caller of the caller, etc. + U8 **rbp=GetRBP,**ptr; + while (num--) { + if (rbp>=*rbp) + return NULL; + rbp=*rbp; + if (!ChkOnStk(rbp,Fs)) + return NULL; + } + ptr=rbp+1; + return *ptr; +} + +U8 *TaskCaller(CTask *task=NULL,I64 num=0,Bool saved_context=FALSE) +{//Fetches addr of Nth caller on task's stk. + U8 **ptr,**rbp,**rsp; + if (!task) task=Fs; + if (!saved_context && task==Fs) + return Caller(num+1); + if (!TaskValidate(task)) + return NULL; + rbp=task->rbp; + rsp=task->rsp; + if (num) { + while (ChkOnStk(rbp,task)) { + ptr=rbp+1; + if (! --num) + return *ptr; + if (rbp>=*rbp) + break; + rbp=*rbp; + } + return NULL; + } else { + if (task->rip==_RET) + return *rsp; + else + return task->rip; + } +} +#define STK_REP_LEN 32 + +U0 StkRep(CTask *task=NULL) +{//Reports whats on the stk. + I64 i,j,addr, + **rbp,**rsp,*my_rsp[STK_REP_LEN]; + CHashTable *old_hash=Fs->hash_table; + if (!task) task=Fs; + if (!TaskValidate(task)) + return; + PUSHFD + CLI + if (task==Fs) { + rbp=GetRBP; + rsp=rbp+3; + rbp=*rbp; + } else { + rsp=task->rsp; + rbp=task->rbp; + } + if (task->rip==_RET) + addr=*rsp; + else + addr=task->rip; + MemCpy(my_rsp,rsp,STK_REP_LEN*sizeof(U8 *)); + POPFD + Fs->hash_table=task->hash_table; + for (i=0;istk->stk_base<=rbp< + (&task->stk->stk_base)(U8 *)+task->stk->stk_size)) + break; + j=rbp-rsp; + if (j>=i) + break; + addr=my_rsp[j+1]; + if (rbp>=my_rsp[j]) + break; + rbp=my_rsp[j]; + } + if (my_rsp[i]==addr) + "$$RED$$"; + "%P$$FG$$\n",my_rsp[i]; + } + '\n'; + Fs->hash_table=old_hash; +} + +U0 CallerRep(U8 **rbp=NULL,CTask *task=NULL) +{//Prints a report of calling routines. + I64 **ptr; + if (!task) task=Fs; + if (!rbp) { + if (task==Fs) + rbp=GetRBP; + else + rbp=task->rbp; + } + "CallerRep:\n"; + while (ChkOnStk(rbp,task)) { + ptr=rbp+1; + "%08X:%08tX:%P\n",ptr,*ptr,*ptr; + if (rbp>=*rbp) + break; + rbp=*rbp; + } +} + +U0 D(U8 *addr,I64 cnt=0x80,Bool show_offset=TRUE) +{//Dump mem, showing offsets. +//See $LK,"DocD",A="MN:DocD"$() for a live dump. + I64 i,j,ch; + U8 *ptr=addr; + while (cnt) { + if (show_offset) + "%08X ",ptr-addr; + else + "%010X ",ptr; + if (cnt>16) + j=16; + else + j=cnt; + for (i=0;i0) { + "%08X:%08X,%P\n",addr,*addr,*addr; + addr++; + } +} + +U0 RawPrint(I64 ms=100,U8 *fmt,...) +{//Print using $LK,"Raw",A="MN:Raw"$ screen output for a length of time. +//$BK,1$Your heap must be good.$BK,0$ + U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); + Bool old_raw,old_input_filter; + PUSHFD + CLI + old_raw=Raw(ON); + old_input_filter=LBtr(&Fs->task_flags,TASKf_INPUT_FILTER_TASK); + "%s",buf; + BusyWait(ms<<10); + POPFD + LBEqu(&Fs->task_flags,TASKf_INPUT_FILTER_TASK,old_input_filter); + Raw(old_raw); + Free(buf); +} + +U0 RawD(I64 ms=100,U8 *addr,I64 cnt=0x80) +{//Dumps a block of mem using $LK,"Raw",A="MN:Raw"$ +//screen output for a fixed length + //of time. + Bool old_raw,old_input_filter; + PUSHFD + CLI + old_raw=Raw(ON); + old_input_filter=LBtr(&Fs->task_flags,TASKf_INPUT_FILTER_TASK); + D(addr,cnt); + BusyWait(ms<<10); + POPFD + LBEqu(&Fs->task_flags,TASKf_INPUT_FILTER_TASK,old_input_filter); + Raw(old_raw); +} + +U0 RawDm(I64 ms=100,U8 *addr,I64 cnt=0x80) +{//Dumps a block of mem using $LK,"Raw",A="MN:Raw"$ +//screen output for a fixed length + //of time. + Bool old_raw,old_input_filter; + PUSHFD + CLI + old_raw=Raw(ON); + old_input_filter=LBtr(&Fs->task_flags,TASKf_INPUT_FILTER_TASK); + Dm(addr,cnt); + BusyWait(ms<<10); + POPFD + LBEqu(&Fs->task_flags,TASKf_INPUT_FILTER_TASK,old_input_filter); + Raw(old_raw); +} + +I64 *TaskRegAddr(CTask *task,I64 reg_num) +{ + switch (reg_num) { + case REG_RAX: return &task->rax; + case REG_RCX: return &task->rcx; + case REG_RDX: return &task->rdx; + case REG_RBX: return &task->rbx; + case REG_RSP: return &task->rsp; + case REG_RBP: return &task->rbp; + case REG_RSI: return &task->rsi; + case REG_RDI: return &task->rdi; + case 8 : return &task->r8; + case 9 : return &task->r9; + case 10: return &task->r10; + case 11: return &task->r11; + case 12: return &task->r12; + case 13: return &task->r13; + case 14: return &task->r14; + case 15: return &task->r15; + } + return NULL; +} + +#define RAWDR_COL 40 + +U0 RawDr(CTask *task=NULL) +{ + I64 i,j,old_col=text.raw_col; + Bool old_raw=Raw(ON); + U8 buf[200]; + + if (!task) task=Fs; + + for (i=0;i<16;i++) { + text.raw_col=i*text.cols+RAWDR_COL; + "º%3Z:%016X\n",i,"ST_U64_REGS",*TaskRegAddr(task,i); + } + + text.raw_col=i++*text.cols+RAWDR_COL; + "ºRIP:%016X\n",task->rip; + + text.raw_col=i++*text.cols+RAWDR_COL; + "º%-*tp\n",text.cols-(RAWDR_COL+1)-1,Fs->rip; + + text.raw_col=i++*text.cols+RAWDR_COL; + 'º'; + if (Bt(&sys_run_level,RLf_COMPILER)) { + j=Fs->rip; + Ui(buf,&j,,,TRUE); + "%s",buf; + } else + '\n'; + + text.raw_col=i*text.cols+RAWDR_COL; + 'È'; + for (j=0;jrip; +} + +U8 *SysGetStr2(I64) +{ + U8 buf[512]; + GetS(buf,512,FALSE); + return StrNew(buf); +} + +CBpt *BptFind(U8 *needle_addr,CTask *haystack_task=NULL,Bool rem=FALSE) +{ + CBpt *res=NULL,*tempb,*tempb1,*tempb2; + if (!haystack_task) haystack_task=Fs; + PUSHFD + CLI + tempb1=&haystack_task->bpt_lst; + tempb=haystack_task->bpt_lst; + while (tempb) { + tempb2=tempb->next; + if (tempb->addr==needle_addr) { + res=tempb; + if (rem) + tempb1->next=tempb2; + else + tempb1=&tempb->next; + } else + tempb1=&tempb->next; + tempb=tempb2; + } + POPFD + return res; +} + +Bool BptS(U8 *addr,CTask *task=NULL,Bool live=TRUE) +{//Set breakpoint. + CBpt *tempb; + Bool res=TRUE; + if (!task) task=Fs; + PUSHFD + CLI + if (!(tempb=BptFind(addr,task,FALSE))) { + tempb=CAlloc(sizeof(CBpt),task); + tempb->addr=addr; + tempb->val=*addr; + res=FALSE; + tempb->next=task->bpt_lst; + task->bpt_lst=tempb; + if (task==Fs && live) + *addr=OC_BPT; + } + POPFD + return res; +} + +Bool BptR(U8 *addr,CTask *task=NULL,Bool live=TRUE,Bool rem=TRUE) +{//Rem breakpoint. + CBpt *tempb; + Bool res=FALSE; + if (!task) task=Fs; + PUSHFD + CLI + if (tempb=BptFind(addr,task,rem)) { + if (task==Fs && live) + *tempb->addr=tempb->val; + res=TRUE; + if (rem) + Free(tempb); + } + POPFD + return res; +} + +Bool B(U8 *addr,CTask *task=NULL,Bool live=TRUE) +{//Toggle breakpoint. +//Return: TRUE if removed. + Bool res=FALSE; + PUSHFD + CLI + if (BptFind(addr,task,FALSE)) { + BptR(addr,task,live,TRUE); + res=TRUE; + } else + BptS(addr,task,live); + POPFD + return res; +} + +I64 B2(CTask *task=NULL,Bool live=TRUE) +{//Rem all breakpoints. +//Return: cnt of removed. + I64 res=0; + CBpt *tempb,*tempb1; + if (!task) task=Fs; + PUSHFD + CLI + tempb=task->bpt_lst; + task->bpt_lst=NULL; + while (tempb) { + tempb1=tempb->next; + if (task==Fs && live) + *tempb->addr=tempb->val; + Free(tempb); + tempb=tempb1; + res++; + } + POPFD + return res; +} + +U0 G(U8 *ip=INVALID_PTR,CTask *task=NULL) +{//Go + if (!task) task=Fs; + if (ip!=INVALID_PTR) task->rip=ip; + if (BptFind(task->rip,task)) + "\nDo one of the following, first:\n" + ">S;\t\t\t//Single step\n" + ">B2;\t\t\t//Clear all break points\n" + ">G2;\t\t\t//Clear all break points and Go\n\n" + "After resuming, next focus task\n" + "After resuming, flushes screen VGA cache\n"; + else { + LBtr(&task->task_flags,TASKf_DISABLE_BPTS); + LBtr(&task->rflags,RFLAGf_TRAP);//No single step + Suspend(task,FALSE); + if (task==Fs) { + if (IsDbg && task->next_cc!=&task->next_cc) { + "Exit Dbg\n"; + Btr(&task->last_cc->flags,CCf_PMT); + } + } else + Exit; + } +} + +U0 G2(U8 *ip=INVALID_PTR,CTask *task=NULL) +{//Rem all breakpoints and Go. + if (!task) task=Fs; + B2(task); + if (ext[EXT_WIN_FOCUS]) + CallExtNum(EXT_WIN_FOCUS,dbg.focus_task); + VGAFlush; + G(ip,task); +} + +public U0 S(U8 *ip=INVALID_PTR,CTask *task=NULL) //Single-step. +{//Single step. + if (!task) task=Fs; + PUSHFD + CLI + if (ip!=INVALID_PTR) task->rip=ip; + LBts(&task->task_flags,TASKf_DISABLE_BPTS); + LBts(&task->rflags,RFLAGf_TRAP); + Suspend(task,FALSE); + if (task==Fs) { + if (IsDbg) { + if (task->next_cc!=&task->next_cc) + Btr(&task->last_cc->flags,CCf_PMT); + } + } else + Exit; + POPFD +} + +U0 DbgHelp() +{ + "\n" + "The cmd line is basically the same as normal. Here are some common\n" + "debugging commands.\n\n" + ">EdLite(\"FileName\");\t\t//Edit file.\n" + ">D(0x100000);\t\t\t//Dump page tables.\n" + ">Dm(0x100000);\t\t\t//Dump page tables.\n" + ">Dm(Fs,sizeof(CTask));\t\t//Dump current task record.\n" + ">ClassRep(Fs,\"CTask\",1);\t//Dump current task record.\n" + ">ClassRep(Fs,,1);\t\t//(It knows lastclass.)\n" + ">CallerRep;\t\t\t//Stack trace report.\n" + ">Da(_RSP);\t\t\t//Dump stk.\n" + ">Dr;\t\t\t\t//Dump Regs.\n" + ">1+2*3+&Print;\t\t\t//Show calculation res.\n" + ">*(0x70000)(I64 *)=0x123456789;\t//Assign value to 0x70000-0x70007.\n" + ">_RAX=0x1234;\t\t\t//Set RAX to 0x1234.\n" + ">_RIP=&SysThrowBreak;\t\t//Set RIP.\n" + ">I64 i;\t\t\t\t//Declare variable.\n" + ">i=_RCX+_RDX;\t\t\t//Assign to variable.\n" + ">U(&Print+0x8);\t\t\t//Unassemble Print.\n" + ">Uf(\"Print\");\t\t\t//Unassembler function \"Print\".\n" + ">Man(\"Print\");\t\t\t//Edit Src for \"Print\".\n" + ">E(_RIP);\t\t\t//Edit Src Code.\n" + ">Fix;\t\t\t\t//Edit Last Err Src Code.\n" + ">B(&Main+0x20);\t\t\t//Toggle break point.\n" + ">B2;\t\t\t\t//Clear all break points.\n" + ">S;\t\t\t\t//Single step.\n" + ">G;\t\t\t\t//Resume execution.\n" + ">G2;\t\t\t\t//B2;VGAFlush;WinFocus;G;\n" + ">Exit;\t\t\t\t//Exit (kill) task.\n\n" + "After resuming, next focus task.\n" + "After resuming, flushes screen VGA cache.\n\n"; +} + +U0 Dbg2() +{ + Bool old_win_inhibit,old_waiting_msg,old_single; + I64 i,old_getstr2; + U8 buf[200]; + if (IsRaw) { + i=Fs->rip; + Ui(buf,&i); + "%s",buf; + } else + U(Fs->rip,1); + old_waiting_msg=LBtr(&Fs->task_flags,TASKf_AWAITING_MSG); + old_win_inhibit=Fs->win_inhibit; + Fs->win_inhibit=WIG_USER_TASK_DFT; + sys_focus_task=Fs; + kbd.scan_code=0; + old_getstr2=fp_getstr2; + fp_getstr2=&SysGetStr2; + old_single=SingleUser(OFF); + while (!mouse.install_attempts) + Yield; + SingleUser(old_single); + UserTaskCont; + fp_getstr2=old_getstr2; + Fs->win_inhibit=old_win_inhibit; + LBEqu(&Fs->task_flags,TASKf_AWAITING_MSG,old_waiting_msg); +} + +U0 Fault3(I64 fault_num,I64 fault_err_code) +{ + no_warn fault_err_code; + PUSHFD + CLI + if (Gs->num && dbg.mp_crash) { + mp_cnt=1; + dbg.mp_crash->cpu_num=Gs->num; + dbg.mp_crash->task=Fs; + dbg.mp_crash->rip=Fs->rip; + dbg.mp_crash->msg=dbg.msg; + dbg.mp_crash->msg_num=dbg.msg_num; + MPInt(I_MP_CRASH,0); + SysHlt; + } + "\n\tTempleOS Debugger\n\n" + ">Help;\t//For help.\n\n"; + Beep(500,TRUE); + if (fault_num==I_DBG) { + if (dbg.msg) { + "\n!!! %s",dbg.msg; + if (dbg.msg_num) + "%016X",dbg.msg_num; + " !!!\n\n"; + } + } + CallerRep; + Dbg2; + POPFD +} + +U0 Fault2(I64 fault_num,I64 fault_err_code) +{//Called from $LK,"Fault2",A="FF:::/Kernel/KInts.HC,Fault2"$. +//$BK,1$Be careful not to swap-out and ruin the saved context$BK,0$ + Bool was_raw,was_single_user,was_silent,was_in_dbg; + I64 i,old_raw_flags=text.raw_flags; + was_single_user=SingleUser(ON); + if (!IsDbg) + dbg.focus_task=sys_focus_task; + sys_focus_task=NULL; + if (fault_num==I_BPT) + Fs->rip--; + if (Fs->dbg_task) + CallExtNum(EXT_DBG_RESUME,fault_num,fault_err_code); + else { + was_raw=Raw(ON); + was_silent=Silent(OFF); + text.raw_flags|=RWF_SHOW_DOLLAR|RWF_SCROLL; + + "Task \""; + "%s",Fs->task_title; + "\"\n"; + "Fault:0x%02X %Z\t\tErr Code:%08X\n", + fault_num,fault_num,"ST_INT_NAMES",fault_err_code; + was_in_dbg=InDbg(ON); + "RIP:%08X",Fs->rip; //Sometimes crashes on %p, so do this first + ":%p RSP:%08X\n",Fs->rip,Fs->rsp; + if (fault_num==I_PAGE_FAULT) { + MOV_RAX_CR2 + i=GetRAX; + "Fault Addr:%08X:%p\n",i,i; + } + Fault3(fault_num,fault_err_code); + InDbg(was_in_dbg); + Silent(was_silent); + Raw(was_raw); + text.raw_flags=old_raw_flags; + } + SingleUser(was_single_user); + if (LBtr(&Fs->task_flags,TASKf_KILL_AFTER_DBG)) + Exit; +} + +U0 Dbg(U8 *msg=NULL,I64 msg_num=0) +{//Enters the debugger.Can be used as a panic. + PUSHFD + CLI + dbg.msg=msg; + dbg.msg_num=msg_num; + INT I_DBG + POPFD +} diff --git a/Kernel/KDefine.CPP b/Kernel/KDefine.CPP deleted file mode 100644 index 01178a1..0000000 --- a/Kernel/KDefine.CPP +++ /dev/null @@ -1,218 +0,0 @@ -CHashDefineStr *DefineLoad(U8 *dname,U8 *st) -{//Create DEFINE hash entry with string. - CHashDefineStr *temph=CAlloc(sizeof(CHashDefineStr)); - temph->type=HTT_DEFINE_STR; - temph->str=StrNew(dname); - temph->data=StrNew(st); - temph->cnt=-1; - temph->src_link=MStrPrint("AD:0x%X",Caller); - HashAdd(temph,Fs->hash_table); - return temph; -} - -CHashDefineStr *DefineLstLoad(U8 *dname,U8 *lst) -{//Create DEFINE list. Not efficient, but handy. - I64 cnt=0; - U8 *ptr,**idx; - CHashDefineStr *temph=CAlloc(sizeof(CHashDefineStr)); - temph->type=HTT_DEFINE_STR; - temph->str=StrNew(dname); - temph->src_link=MStrPrint("AD:0x%X",Caller); - ptr=lst; - while (*ptr) { - if (*ptr!='@') - cnt++; - while (*ptr++); - } - temph->data=MAlloc(ptr+1-lst); - MemCpy(temph->data,lst,ptr+1-lst); - temph->cnt=cnt; - - idx=temph->sub_idx=MAlloc(cnt*sizeof(U8 *)); - ptr=lst; - while (*ptr) { - if (*ptr!='@') - *idx++=ptr; - while (*ptr++); - } - - HashAdd(temph,Fs->hash_table); - return temph; -} - -U0 UndefinedDefine(U8 *dname) -{ - ST_ERR_ST "Undefined Define: '%s'.\n",dname; - throw('UndefDef'); -} - -U8 *Define(U8 *dname) -{//Look for DEFINE named in hash table, return ptr string. - CHashDefineStr *temph; - if (temph=HashFind(dname,Fs->hash_table,HTT_DEFINE_STR)) - return temph->data; - else if (dname) - UndefinedDefine(dname); - else - return NULL; -} - -U8 *DefineSub(I64 sub,U8 *dname) -{//Return DEFINE list entry indexed by number. - CHashDefineStr *temph; - if (temph=HashFind(dname,Fs->hash_table,HTT_DEFINE_STR)) { - if (0<=subcnt) - return temph->sub_idx[sub]; - else - return NULL; - } else if (dname) - UndefinedDefine(dname); - else - return NULL; -} - -I64 DefineCnt(U8 *dname) -{//Return cnt of entries in define list. - CHashDefineStr *temph; - if (temph=HashFind(dname,Fs->hash_table,HTT_DEFINE_STR)) - return temph->cnt; - else if (dname) - UndefinedDefine(dname); - else - return -1; -} - -I64 DefineMatch(U8 *needle,U8 *haystack_lst_dname,I64 flags=0) -{//Find match for string in define list. - return LstMatch(needle,Define(haystack_lst_dname),flags); -} - -U0 DefinePrint(U8 *dname,U8 *src,...) -{//Create DEFINE entry with $LK,"Print",A="FI:::/Doc/Print.TXT"$()ed string. - U8 *buf=StrPrintJoin(NULL,src,argc,argv); - DefineLoad(dname,buf); - Free(buf); -} - -U0 SysDefinesLoad() -{ - DefineLstLoad("ST_OFF_ON","Off\0On\0"); - DefineLstLoad("ST_HTT_TYPES","ExportSysSym\0ImportSysSym\0DefineStr\0GlbVar\0" - "Class\0IntType\0Funct\0Word\0DictWord\0KeyWord\0AsmKeyWord\0OpCode\0" - "Reg\0File\0Module\0HelpFile\0Frame Ptr\0 \0 \0 \0 \0 \0 \0Private\0" - "Public\0Export\0Import\0Imm\0Goto\0Res\0Unres\0Local\0"); - DefineLstLoad("ST_DAYS_OF_WEEK","Sunday\0Monday\0Tuesday\0Wednesday\0" - "Thursday\0Friday\0Saturday\0"); - DefineLstLoad("ST_MONTHS","January\0February\0March\0April\0May\0" - "June\0July\0August\0September\0October\0November\0December\0"); - DefineLstLoad("ST_FILE_ATTRS","R\0H\0S\0V\0D\0A\0 \0 \0X\0T\0Z\0C\0F\0"); - DefineLstLoad("ST_FILE_UTIL_FLAGS","r\0d\0i\0a\0c\0R\0p\0m\0x\0s\0" - "D\0F\0T\0S\0A\0J\0G\0Z\0O\0P\0f\0l\0lb\0la\0"); - DefineLstLoad("ST_BLKDEV_TYPES", - "NULL\0RAM\0ATA\0FILE_READ\0FILE_WRITE\0ATAPI\0"); - DefineLstLoad("ST_DRV_TYPES", - "NULL\0REDSEA\0FAT32\0ISO9660\0ISO13490\0ISO13346\0NTFS\0UNKNOWN\0"); - DefineLstLoad("ST_COLORS","BLACK\0BLUE\0GREEN\0CYAN\0" - "RED\0PURPLE\0BROWN\0LTGRAY\0DKGRAY\0LTBLUE\0LTGREEN\0" - "LTCYAN\0LTRED\0LTPURPLE\0YELLOW\0WHITE\0"); - DefineLstLoad("ST_INT_NAMES","Divide Error\0SingleStep\0NMI\0Breakpoint\0" - "Overflow\0BOUND Range Exceeded\0Invalid Opcode\0No Math Coprocessor\0" - "Double Fault\0Coprocessor Segment Fault\0Invalid TASK\0" - "Segment Not Present\0Stk Segment Fault\0General Protection\0" - "Page Fault\0 \0Math Fault\0Alignment Check\0Machine Check\0" - "SIMD Exception\0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0" - " \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0MP Crash\0Wake\0Dbg\0"); -} - -U8 *Color2Str(U8 *buf,CColorROPU32 c) -{//$LK,"CColorROPU32",A="MN:CColorROPU32"$ with flags to $LK,"DCLighting",A="MN:DCLighting"$ str. - *buf=0; - if (c.c0.rop&ROPBF_TWO_SIDED) - CatPrint(buf,"TWO|"); - if (c.c0.rop&ROPBF_HALF_RANGE_COLOR) - CatPrint(buf,"HALF|"); - if (0<=c.c0.color<16) - CatPrint(buf,DefineSub(c.c0.color,"ST_COLORS")); - else if (c.c0.color==TRANSPARENT) - CatPrint(buf,"TRANSPARENT"); - else - CatPrint(buf,"INVALID"); - if (c&ROPF_DITHER) { - CatPrint(buf,"/"); - if (c.c1.rop&ROPBF_TWO_SIDED) - CatPrint(buf,"TWO|"); - if (c.c1.rop&ROPBF_HALF_RANGE_COLOR) - CatPrint(buf,"HALF|"); - if (0<=c.c1.color<16) - CatPrint(buf,DefineSub(c.c1.color,"ST_COLORS")); - else if (c.c1.color==TRANSPARENT) - CatPrint(buf,"TRANSPARENT"); - else - CatPrint(buf,"INVALID"); - } - return buf; -} - -U8 *str2color_lst="/,)}>"; - -CColorROPU16 Str2ColorU16(U8 *st) -{//$LK,"DCLighting",A="MN:DCLighting"$ color str with flags to $LK,"CColorROPU16",A="MN:CColorROPU16"$. - CColorROPU16 res=COLOR_INVALID; - I64 i; - U8 *ptr,*ptr2,*st2; - if (!st) return COLOR_INVALID; - while (TRUE) { - if (!*st||StrOcc(str2color_lst,*st)) - return res; - if (Bt(chars_bmp_alpha,*st)) { - ptr=st; - while (Bt(chars_bmp_alpha_numeric,*ptr)) - ptr++; - st2=ptr2=MAlloc(ptr-st+1); - while (st=0) - res.color=i; - else if (!StrICmp(st2,"TRANSPARENT")) - res.color=TRANSPARENT; - else { - Free(st2); - return COLOR_INVALID; - } - Free(st2); - } else if (*st=='+'||*st=='|'||Bt(chars_bmp_white_space,*st)) - st++; - else if ('0'<=*st<='9') { - i=Str2I64(st,10,&ptr); - if (0<=i<=0xFF) { - res.color=i; - st=ptr; - } else - return COLOR_INVALID; - } else - return COLOR_INVALID; - } -} - -CColorROPU32 Str2ColorU32(U8 *st) -{//$LK,"DCLighting",A="MN:DCLighting"$ color str with flags to $LK,"CColorROPU32",A="MN:CColorROPU32"$. - U8 *st2; - CColorROPU32 res=0; - if (!st) return COLOR_INVALID; - st2=MAlloc(StrLen(st)+1); - StrFirstRem(st,str2color_lst,st2); - res.c0=Str2ColorU16(st2); - if (*st) { - res.c1=Str2ColorU16(st); - res|=ROPF_DITHER; - } - if (res.c0.color==COLOR_INVALID||res.c1.color==COLOR_INVALID) - return COLOR_INVALID; - else - return res; -} diff --git a/Kernel/KDefine.HC b/Kernel/KDefine.HC new file mode 100644 index 0000000..8a7e365 --- /dev/null +++ b/Kernel/KDefine.HC @@ -0,0 +1,218 @@ +CHashDefineStr *DefineLoad(U8 *dname,U8 *st) +{//Create DEFINE hash entry with string. + CHashDefineStr *temph=CAlloc(sizeof(CHashDefineStr)); + temph->type=HTT_DEFINE_STR; + temph->str=StrNew(dname); + temph->data=StrNew(st); + temph->cnt=-1; + temph->src_link=MStrPrint("AD:0x%X",Caller); + HashAdd(temph,Fs->hash_table); + return temph; +} + +CHashDefineStr *DefineLstLoad(U8 *dname,U8 *lst) +{//Create DEFINE list. Not efficient, but handy. + I64 cnt=0; + U8 *ptr,**idx; + CHashDefineStr *temph=CAlloc(sizeof(CHashDefineStr)); + temph->type=HTT_DEFINE_STR; + temph->str=StrNew(dname); + temph->src_link=MStrPrint("AD:0x%X",Caller); + ptr=lst; + while (*ptr) { + if (*ptr!='@') + cnt++; + while (*ptr++); + } + temph->data=MAlloc(ptr+1-lst); + MemCpy(temph->data,lst,ptr+1-lst); + temph->cnt=cnt; + + idx=temph->sub_idx=MAlloc(cnt*sizeof(U8 *)); + ptr=lst; + while (*ptr) { + if (*ptr!='@') + *idx++=ptr; + while (*ptr++); + } + + HashAdd(temph,Fs->hash_table); + return temph; +} + +U0 UndefinedDefine(U8 *dname) +{ + ST_ERR_ST "Undefined Define: '%s'.\n",dname; + throw('UndefDef'); +} + +U8 *Define(U8 *dname) +{//Look for DEFINE named in hash table, return ptr string. + CHashDefineStr *temph; + if (temph=HashFind(dname,Fs->hash_table,HTT_DEFINE_STR)) + return temph->data; + else if (dname) + UndefinedDefine(dname); + else + return NULL; +} + +U8 *DefineSub(I64 sub,U8 *dname) +{//Return DEFINE list entry indexed by number. + CHashDefineStr *temph; + if (temph=HashFind(dname,Fs->hash_table,HTT_DEFINE_STR)) { + if (0<=subcnt) + return temph->sub_idx[sub]; + else + return NULL; + } else if (dname) + UndefinedDefine(dname); + else + return NULL; +} + +I64 DefineCnt(U8 *dname) +{//Return cnt of entries in define list. + CHashDefineStr *temph; + if (temph=HashFind(dname,Fs->hash_table,HTT_DEFINE_STR)) + return temph->cnt; + else if (dname) + UndefinedDefine(dname); + else + return -1; +} + +I64 DefineMatch(U8 *needle,U8 *haystack_lst_dname,I64 flags=0) +{//Find match for string in define list. + return LstMatch(needle,Define(haystack_lst_dname),flags); +} + +U0 DefinePrint(U8 *dname,U8 *src,...) +{//Create DEFINE entry with $LK,"Print",A="FI:::/Doc/Print.DD"$()ed string. + U8 *buf=StrPrintJoin(NULL,src,argc,argv); + DefineLoad(dname,buf); + Free(buf); +} + +U0 SysDefinesLoad() +{ + DefineLstLoad("ST_OFF_ON","Off\0On\0"); + DefineLstLoad("ST_HTT_TYPES","ExportSysSym\0ImportSysSym\0DefineStr\0GlbVar\0" + "Class\0IntType\0Funct\0Word\0DictWord\0KeyWord\0AsmKeyWord\0OpCode\0" + "Reg\0File\0Module\0HelpFile\0Frame Ptr\0 \0 \0 \0 \0 \0 \0Private\0" + "Public\0Export\0Import\0Imm\0Goto\0Res\0Unres\0Local\0"); + DefineLstLoad("ST_DAYS_OF_WEEK","Sunday\0Monday\0Tuesday\0Wednesday\0" + "Thursday\0Friday\0Saturday\0"); + DefineLstLoad("ST_MONTHS","January\0February\0March\0April\0May\0" + "June\0July\0August\0September\0October\0November\0December\0"); + DefineLstLoad("ST_FILE_ATTRS","R\0H\0S\0V\0D\0A\0 \0 \0X\0T\0Z\0C\0F\0"); + DefineLstLoad("ST_FILE_UTIL_FLAGS","r\0d\0i\0a\0c\0R\0p\0m\0x\0s\0" + "D\0F\0T\0S\0A\0J\0G\0Z\0O\0P\0f\0l\0lb\0la\0"); + DefineLstLoad("ST_BLKDEV_TYPES", + "NULL\0RAM\0ATA\0FILE_READ\0FILE_WRITE\0ATAPI\0"); + DefineLstLoad("ST_DRV_TYPES", + "NULL\0REDSEA\0FAT32\0ISO9660\0ISO13490\0ISO13346\0NTFS\0UNKNOWN\0"); + DefineLstLoad("ST_COLORS","BLACK\0BLUE\0GREEN\0CYAN\0" + "RED\0PURPLE\0BROWN\0LTGRAY\0DKGRAY\0LTBLUE\0LTGREEN\0" + "LTCYAN\0LTRED\0LTPURPLE\0YELLOW\0WHITE\0"); + DefineLstLoad("ST_INT_NAMES","Divide Error\0SingleStep\0NMI\0Breakpoint\0" + "Overflow\0BOUND Range Exceeded\0Invalid Opcode\0No Math Coprocessor\0" + "Double Fault\0Coprocessor Segment Fault\0Invalid TASK\0" + "Segment Not Present\0Stk Segment Fault\0General Protection\0" + "Page Fault\0 \0Math Fault\0Alignment Check\0Machine Check\0" + "SIMD Exception\0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0" + " \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0MP Crash\0Wake\0Dbg\0"); +} + +U8 *Color2Str(U8 *buf,CColorROPU32 c) +{//$LK,"CColorROPU32",A="MN:CColorROPU32"$ with flags to $LK,"DCLighting",A="MN:DCLighting"$ str. + *buf=0; + if (c.c0.rop&ROPBF_TWO_SIDED) + CatPrint(buf,"TWO|"); + if (c.c0.rop&ROPBF_HALF_RANGE_COLOR) + CatPrint(buf,"HALF|"); + if (0<=c.c0.color<16) + CatPrint(buf,DefineSub(c.c0.color,"ST_COLORS")); + else if (c.c0.color==TRANSPARENT) + CatPrint(buf,"TRANSPARENT"); + else + CatPrint(buf,"INVALID"); + if (c&ROPF_DITHER) { + CatPrint(buf,"/"); + if (c.c1.rop&ROPBF_TWO_SIDED) + CatPrint(buf,"TWO|"); + if (c.c1.rop&ROPBF_HALF_RANGE_COLOR) + CatPrint(buf,"HALF|"); + if (0<=c.c1.color<16) + CatPrint(buf,DefineSub(c.c1.color,"ST_COLORS")); + else if (c.c1.color==TRANSPARENT) + CatPrint(buf,"TRANSPARENT"); + else + CatPrint(buf,"INVALID"); + } + return buf; +} + +U8 *str2color_lst="/,)}>"; + +CColorROPU16 Str2ColorU16(U8 *st) +{//$LK,"DCLighting",A="MN:DCLighting"$ color str with flags to $LK,"CColorROPU16",A="MN:CColorROPU16"$. + CColorROPU16 res=COLOR_INVALID; + I64 i; + U8 *ptr,*ptr2,*st2; + if (!st) return COLOR_INVALID; + while (TRUE) { + if (!*st||StrOcc(str2color_lst,*st)) + return res; + if (Bt(chars_bmp_alpha,*st)) { + ptr=st; + while (Bt(chars_bmp_alpha_numeric,*ptr)) + ptr++; + st2=ptr2=MAlloc(ptr-st+1); + while (st=0) + res.color=i; + else if (!StrICmp(st2,"TRANSPARENT")) + res.color=TRANSPARENT; + else { + Free(st2); + return COLOR_INVALID; + } + Free(st2); + } else if (*st=='+'||*st=='|'||Bt(chars_bmp_white_space,*st)) + st++; + else if ('0'<=*st<='9') { + i=Str2I64(st,10,&ptr); + if (0<=i<=0xFF) { + res.color=i; + st=ptr; + } else + return COLOR_INVALID; + } else + return COLOR_INVALID; + } +} + +CColorROPU32 Str2ColorU32(U8 *st) +{//$LK,"DCLighting",A="MN:DCLighting"$ color str with flags to $LK,"CColorROPU32",A="MN:CColorROPU32"$. + U8 *st2; + CColorROPU32 res=0; + if (!st) return COLOR_INVALID; + st2=MAlloc(StrLen(st)+1); + StrFirstRem(st,str2color_lst,st2); + res.c0=Str2ColorU16(st2); + if (*st) { + res.c1=Str2ColorU16(st); + res|=ROPF_DITHER; + } + if (res.c0.color==COLOR_INVALID||res.c1.color==COLOR_INVALID) + return COLOR_INVALID; + else + return res; +} diff --git a/Kernel/KEnd.CPP b/Kernel/KEnd.CPP deleted file mode 100644 index b1d78fc..0000000 --- a/Kernel/KEnd.CPP +++ /dev/null @@ -1,225 +0,0 @@ -U0 SysGlblsInit() -{ - I64 i,j; - CRAXRBCRCXRDX ee; - - CPUId(0x1,&ee); - sys_cache_line_width=ee.rbx.u8[1]*8; - - sys_focus_task=Fs; - QueInit(&sys_macro_head); - - blkdev.dft_iso_filename=AStrNew("::/Temp/CDDVD.ISO"); - blkdev.temp_filename=AStrNew("~/Temp.TXT.Z"); - blkdev.dvd_boot_is_good=TRUE; - #exe { - if (!kernel_cfg->auto_mount_ide_hd_let) - kernel_cfg->auto_mount_ide_hd_let='C'; - if (!kernel_cfg->auto_mount_ide_cd_let) - kernel_cfg->auto_mount_ide_cd_let='T'; - StreamPrint("blkdev.first_hd_drv_let=%d;", - kernel_cfg->auto_mount_ide_hd_let); - StreamPrint("blkdev.first_dvd_drv_let=%d;", - kernel_cfg->auto_mount_ide_cd_let); - } - - InDbg(ON); - rev_bits_table =CAlloc(256); - set_bits_table =CAlloc(256); - for (i=0;i<256;i++) - for (j=0;j<8;j++) { - if (Bt(&i,7-j)) LBts(rev_bits_table+i,j); - if (Bt(&i,j)) set_bits_table[i]++; - } - - ext=CAlloc(EXT_NUM_ENTRIES*sizeof(U8 *)); - fp_getstr2=&SysGetStr2; - KeyDevInit; - - #exe { - StreamPrint("blkdev.boot_drv_let='%C';",kernel_cfg->boot_drv_let); - StreamPrint("#exe{Option(OPTf_WARN_PAREN,OFF);}"); - StreamPrint("DskCacheInit(%s);",kernel_cfg->dsk_cache_size_exp); - StreamPrint("#exe{Option(OPTf_WARN_PAREN,ON);}"); - }; - - pow10_I64=CAlloc(sizeof(F64)*(308+308+1)); - for (i=-308;i<309;i++) - pow10_I64[i+309]=Pow10(i); - - QueInit(&snd.record_head); - snd.record_head.time=tS; - - ProgressBarsRst; - - //$AN,"Independent HeapCtrl Example",A="Independent HeapCtrl Example"$ - i=1; //Rqst 1 blk, we might get more. - QueInit(&dev.pci_head); - dev.mem64_ptr=MEM_MAPPED_SPACE; - - dbg.fun_seg_cache=CAlloc(FUN_SEG_CACHE_SIZE*sizeof(CFunSegCache)); - dbg.int_fault_code=IntFaultHandlersNew; -} - -U0 SysGrInit() -{ - text.font=sys_font_std; - text.aux_font=sys_font_cyrillic; - text.vga_alias =dev.uncached_alias+VGAM_GRAPHICS; - text.vga_text_alias =dev.uncached_alias+VGAM_TEXT; - if (!Bt(&sys_run_level,RLf_VGA)) { //if text mode - text.cols=80; - text.rows=25; - MemSet(text.vga_text_alias,0,text.rows*text.cols<<1); - text.border_chars[2] (I64)='ÄͳºÚÉ¿»'; - text.border_chars[10](U32)='ÀÈÙ¼'; - } else { //if 640x480 16 color - text.cols=GR_WIDTH/FONT_WIDTH; - text.rows=GR_HEIGHT/FONT_HEIGHT; - OutU8(VGAP_IDX,VGAR_MAP_MASK); - OutU8(VGAP_DATA,0x0F); - MemSet(text.vga_alias,0,GR_WIDTH*GR_HEIGHT>>3); - text.raw_screen_image=CAlloc(GR_WIDTH*GR_HEIGHT/8); - text.border_chars[2] (I64)=0x0908070605040302; - text.border_chars[10](U32)=0x0D0C0B0A; - } -} - -U0 TimersInit() -{ - I64 i,*_q; - U32 *_d; - - OutU8(0x43,0x34); - OutU8(0x40,SYS_TIMER0_PERIOD); - OutU8(0x40,SYS_TIMER0_PERIOD>>8); - - //High Precision Event Timer - if (PCIReadU16(0,31,0,0)==0x8086) {//Intel? -//D31 F0, cfg 0xF0=RCBA of PCI-LPC Bridge - _d=PCIReadU32(0,31,0,0xF0)(U8 *)&~0x3FFF+0x3404; //HPET cfg -//7 enable - //1:0 HPET is at 0xFED00000,0xFED01000, 0xFED02000 or 0xFED03000. - *_d=*_d&3|0x80; - } - - _q=dev.uncached_alias+HPET_GCAP_ID; - i=*_q; //i.u32[1]= period in femtoS (10e-15) - if (1000001) - MPHalt; - *0x472(U16 *)=0; - OutU8(0x70,0x8F); - OutU8(0x71,0x00); - OutU8(0x70,0x00); - OutU8(0x92,InU8(0x92)|1); - SysHlt; -} - -U0 KernelMain() -{//Continued from $LK,"Kernel",A="FF:::/Kernel/KStart64.CPP,I32 &Kernel"$ - OutU8(0x61,InU8(0x61)&~3); //Snd(0); - adam_task=Fs; - BlkPoolsInit; - LBts(&sys_run_level,RLf_FULL_HEAP); - SysGlblsInit; - Mem32DevInit; - MemPagesNotPresentMark; - UncachedAliasAlloc; - LoadKernel; - SysGrInit; - StrCpy(Fs->task_name,"Adam Task CPU#0"); - StrCpy(Fs->task_title,Fs->task_name); - Fs->title_src=TTS_TASK_NAME; - Fs->win_right=text.cols-2; - Fs->win_top++; - TaskDerivedValsUpdate; - - SysDefinesLoad; - Core0Init; - IntInit1; - - //Before this point use $LK,"Snd",A="MN:Snd"$() and $LK,"BusyWait",A="MN:BusyWait"$() - //to debug. After this point, use $LK,"RawPrint",A="MN:RawPrint"$() - LBts(&sys_run_level,RLf_RAW); - TimersInit; - if (BIOSTotalMemhome_dir);} - Gs->idle_task->cur_dv=blkdev.let_to_drv[*blkdev.home_dir-'A']; - DrvRep; - LBts(&sys_run_level,RLf_BLKDEV); - - #exe { - if (!kernel_cfg->opts[CFG_NO_MP]) - StreamPrint("\"MultiCore Start\\n\\n\";" - "Core0StartMP;" - "LBts(&sys_run_level,RLf_MP);"); - }; - - KbdMouseVarsInit; - IPVarsInit; - KbdInit; - Spawn(&MouseDriverInstall); - - "Loading Compiler\n"; - Cd("/Compiler"); - Load("Compiler",LDF_SILENT); - LBts(&sys_run_level,RLf_COMPILER); - - InDbg(OFF); - cnts.time_stamp_freq_initial=TimeStampFreqCal; - Cd("/"); - try ExeFile("StartOS"); //Continues $LK,"/StartOS.CPP",A="FL:/StartOS.CPP,1"$ - catch { - Raw(ON); - Silent(OFF); - GetOutOfDollar; - PutExcept; - Dbg; - } - - LBts(&sys_run_level,RLf_ADAM_SERVER); - SrvTaskCont; //Never to return -} - -asm { ALIGN 16,OC_NOP -SYS_KERNEL_END:: -#exe { - if (kernel_cfg->opts[CFG_BOOT_RESCUE_DRV]) - StreamPrint("DU8 0x%X-(SYS_KERNEL_END-SYS_KERNEL+" - "BOOT_RAM_BASE+sizeof(CBinFile)) DUP (0);" - "BINFILE \"%s\";",kernel_cfg->boot_rescue_drv_start, - kernel_cfg->boot_rescue_drv_file); -}; -} diff --git a/Kernel/KEnd.HC b/Kernel/KEnd.HC new file mode 100644 index 0000000..e5ca8e7 --- /dev/null +++ b/Kernel/KEnd.HC @@ -0,0 +1,225 @@ +U0 SysGlblsInit() +{ + I64 i,j; + CRAXRBCRCXRDX ee; + + CPUId(0x1,&ee); + sys_cache_line_width=ee.rbx.u8[1]*8; + + sys_focus_task=Fs; + QueInit(&sys_macro_head); + + blkdev.dft_iso_filename=AStrNew("::/Temp/CDDVD.ISO"); + blkdev.temp_filename=AStrNew("~/Temp.DD.Z"); + blkdev.dvd_boot_is_good=TRUE; + #exe { + if (!kernel_cfg->auto_mount_ide_hd_let) + kernel_cfg->auto_mount_ide_hd_let='C'; + if (!kernel_cfg->auto_mount_ide_cd_let) + kernel_cfg->auto_mount_ide_cd_let='T'; + StreamPrint("blkdev.first_hd_drv_let=%d;", + kernel_cfg->auto_mount_ide_hd_let); + StreamPrint("blkdev.first_dvd_drv_let=%d;", + kernel_cfg->auto_mount_ide_cd_let); + } + + InDbg(ON); + rev_bits_table =CAlloc(256); + set_bits_table =CAlloc(256); + for (i=0;i<256;i++) + for (j=0;j<8;j++) { + if (Bt(&i,7-j)) LBts(rev_bits_table+i,j); + if (Bt(&i,j)) set_bits_table[i]++; + } + + ext=CAlloc(EXT_NUM_ENTRIES*sizeof(U8 *)); + fp_getstr2=&SysGetStr2; + KeyDevInit; + + #exe { + StreamPrint("blkdev.boot_drv_let='%C';",kernel_cfg->boot_drv_let); + StreamPrint("#exe{Option(OPTf_WARN_PAREN,OFF);}"); + StreamPrint("DskCacheInit(%s);",kernel_cfg->dsk_cache_size_exp); + StreamPrint("#exe{Option(OPTf_WARN_PAREN,ON);}"); + }; + + pow10_I64=CAlloc(sizeof(F64)*(308+308+1)); + for (i=-308;i<309;i++) + pow10_I64[i+309]=Pow10(i); + + QueInit(&snd.record_head); + snd.record_head.time=tS; + + ProgressBarsRst; + + //$AN,"Independent HeapCtrl Example",A="Independent HeapCtrl Example"$ + i=1; //Rqst 1 blk, we might get more. + QueInit(&dev.pci_head); + dev.mem64_ptr=MEM_MAPPED_SPACE; + + dbg.fun_seg_cache=CAlloc(FUN_SEG_CACHE_SIZE*sizeof(CFunSegCache)); + dbg.int_fault_code=IntFaultHandlersNew; +} + +U0 SysGrInit() +{ + text.font=sys_font_std; + text.aux_font=sys_font_cyrillic; + text.vga_alias =dev.uncached_alias+VGAM_GRAPHICS; + text.vga_text_alias =dev.uncached_alias+VGAM_TEXT; + if (!Bt(&sys_run_level,RLf_VGA)) { //if text mode + text.cols=80; + text.rows=25; + MemSet(text.vga_text_alias,0,text.rows*text.cols<<1); + text.border_chars[2] (I64)='ÄͳºÚÉ¿»'; + text.border_chars[10](U32)='ÀÈÙ¼'; + } else { //if 640x480 16 color + text.cols=GR_WIDTH/FONT_WIDTH; + text.rows=GR_HEIGHT/FONT_HEIGHT; + OutU8(VGAP_IDX,VGAR_MAP_MASK); + OutU8(VGAP_DATA,0x0F); + MemSet(text.vga_alias,0,GR_WIDTH*GR_HEIGHT>>3); + text.raw_screen_image=CAlloc(GR_WIDTH*GR_HEIGHT/8); + text.border_chars[2] (I64)=0x0908070605040302; + text.border_chars[10](U32)=0x0D0C0B0A; + } +} + +U0 TimersInit() +{ + I64 i,*_q; + U32 *_d; + + OutU8(0x43,0x34); + OutU8(0x40,SYS_TIMER0_PERIOD); + OutU8(0x40,SYS_TIMER0_PERIOD>>8); + + //High Precision Event Timer + if (PCIReadU16(0,31,0,0)==0x8086) {//Intel? +//D31 F0, cfg 0xF0=RCBA of PCI-LPC Bridge + _d=PCIReadU32(0,31,0,0xF0)(U8 *)&~0x3FFF+0x3404; //HPET cfg +//7 enable + //1:0 HPET is at 0xFED00000,0xFED01000, 0xFED02000 or 0xFED03000. + *_d=*_d&3|0x80; + } + + _q=dev.uncached_alias+HPET_GCAP_ID; + i=*_q; //i.u32[1]= period in femtoS (10e-15) + if (1000001) + MPHalt; + *0x472(U16 *)=0; + OutU8(0x70,0x8F); + OutU8(0x71,0x00); + OutU8(0x70,0x00); + OutU8(0x92,InU8(0x92)|1); + SysHlt; +} + +U0 KernelMain() +{//Continued from $LK,"Kernel",A="FF:::/Kernel/KStart64.HC,I32 &Kernel"$ + OutU8(0x61,InU8(0x61)&~3); //Snd(0); + adam_task=Fs; + BlkPoolsInit; + LBts(&sys_run_level,RLf_FULL_HEAP); + SysGlblsInit; + Mem32DevInit; + MemPagesNotPresentMark; + UncachedAliasAlloc; + LoadKernel; + SysGrInit; + StrCpy(Fs->task_name,"Adam Task CPU#0"); + StrCpy(Fs->task_title,Fs->task_name); + Fs->title_src=TTS_TASK_NAME; + Fs->win_right=text.cols-2; + Fs->win_top++; + TaskDerivedValsUpdate; + + SysDefinesLoad; + Core0Init; + IntInit1; + + //Before this point use $LK,"Snd",A="MN:Snd"$() and $LK,"BusyWait",A="MN:BusyWait"$() + //to debug. After this point, use $LK,"RawPrint",A="MN:RawPrint"$() + LBts(&sys_run_level,RLf_RAW); + TimersInit; + if (BIOSTotalMemhome_dir);} + Gs->idle_task->cur_dv=blkdev.let_to_drv[*blkdev.home_dir-'A']; + DrvRep; + LBts(&sys_run_level,RLf_BLKDEV); + + #exe { + if (!kernel_cfg->opts[CFG_NO_MP]) + StreamPrint("\"MultiCore Start\\n\\n\";" + "Core0StartMP;" + "LBts(&sys_run_level,RLf_MP);"); + }; + + KbdMouseVarsInit; + IPVarsInit; + KbdInit; + Spawn(&MouseDriverInstall); + + "Loading Compiler\n"; + Cd("/Compiler"); + Load("Compiler",LDF_SILENT); + LBts(&sys_run_level,RLf_COMPILER); + + InDbg(OFF); + cnts.time_stamp_freq_initial=TimeStampFreqCal; + Cd("/"); + try ExeFile("StartOS"); //Continues $LK,"/StartOS.HC",A="FL:/StartOS.HC,1"$ + catch { + Raw(ON); + Silent(OFF); + GetOutOfDollar; + PutExcept; + Dbg; + } + + LBts(&sys_run_level,RLf_ADAM_SERVER); + SrvTaskCont; //Never to return +} + +asm { ALIGN 16,OC_NOP +SYS_KERNEL_END:: +#exe { + if (kernel_cfg->opts[CFG_BOOT_RESCUE_DRV]) + StreamPrint("DU8 0x%X-(SYS_KERNEL_END-SYS_KERNEL+" + "BOOT_RAM_BASE+sizeof(CBinFile)) DUP (0);" + "BINFILE \"%s\";",kernel_cfg->boot_rescue_drv_start, + kernel_cfg->boot_rescue_drv_file); +}; +} diff --git a/Kernel/KExcept.CPP b/Kernel/KExcept.HC similarity index 100% rename from Kernel/KExcept.CPP rename to Kernel/KExcept.HC diff --git a/Kernel/KExts.CPP b/Kernel/KExts.CPP deleted file mode 100644 index c40dde3..0000000 --- a/Kernel/KExts.CPP +++ /dev/null @@ -1,107 +0,0 @@ -/* -If you are sure a fun won't be called -before import is resolved, you can use -"import". Otherwise, use a fun pointer -var and check it before calling. -*/ -import U8 *DocSave(CDoc *doc,I64 *_size=NULL); -import Bool DocUnlock(CDoc *doc); -import Bool Ed(U8 *link_st,I64 edf_dof_flags=0); -extern U0 AdamErr(U8 *fmt,...); -extern U0 AdamLog(U8 *fmt,...); -extern I64 BIOSTotalMem(); -extern I64 BlkDevAdd(CBlkDev *bd,Bool one_drv,Bool make_free); -extern CBlkDev *BlkDevChk(CBlkDev *bd,Bool except=TRUE); -extern Bool BlkDevLock(CBlkDev *bd); -extern CBlkDev *BlkDevNextFreeSlot(U8 first_drv_let,I64 type); -extern Bool BlkDevUnlock(CBlkDev *bd,Bool rst=FALSE); -extern U0 BlkDevsRelease(); -extern U8 *Caller(I64 num=1); -extern U8 *CatPrint(U8 *dst,U8 *fmt,...); -extern Bool Cd(U8 *name,Bool make_dirs=FALSE); -extern U0 Dbg(U8 *msg=NULL,I64 msg_num=0); -extern U0 DbgHelp(); -extern U8 *Define(U8 *dname); -extern I64 DefineMatch(U8 *needle,U8 *haystack_lst_dname,I64 flags=0); -extern U8 *DefineSub(I64 sub,U8 *dname); -extern I64 Del(U8 *files_find_mask,Bool make_mask=FALSE, - Bool del_dir=FALSE,Bool print_msg=TRUE); -extern U8 *DftExt(U8 *name,U8 *extension); -extern Bool Drv(U8 drv_let); -extern U8 Drv2Let(CDrv *dv=NULL); -extern U0 DrvBlkDevDel(CBlkDev *bd); -extern CDrv *DrvChk(CDrv *dv,Bool except=TRUE); -extern U8 DrvTextAttrGet(U8 drv_let=0); -extern Bool DrvTypeSet(U8 drv_let,I64 type=FSt_REDSEA); -extern U0 DrvsRelease(); -extern U0 DskCacheInvalidate(CDrv *dv); -extern U0 Exit(); -extern I64 FAT32AllocClusters(CDrv *dv,I64 c,I64 cnt); -extern I64 FAT32AllocContiguousClusters(CDrv *dv,I64 cnt); -extern Bool FAT32DirNew(CDrv *dv,U8 *cur_dir,CDirEntry *tempdee, - Bool free_old_chain); -extern U0 FAT32DrvInit(CDrv *dv); -extern Bool FAT32FileFind(CDrv *dv,I64 cur_dir_cluster,U8 *name, - CDirEntry *_res,I64 fuf_flags=0); -extern U0 FClose(CFile *f); -extern CFile *FOpen(U8 *filename,U8 *flags,I64 cnt=0); -extern Bool FRBlks(CFile *f,U8 *buf,I64 blk=FFB_NEXT_BLK,I64 cnt=1); -extern Bool FWBlks(CFile *f,U8 *buf,I64 blk=FFB_NEXT_BLK,I64 cnt=1); -extern U8 *FileExtRem(U8 *src,U8 *dst=NULL); -extern Bool FileFind(U8 *filename,CDirEntry *_de=NULL,I64 fuf_flags=0); -extern U8 *FileNameAbs(U8 *name,I64 fuf_flags=0); -extern U8 *FileRead(U8 *filename,I64 *_size=NULL,I64 *_attr=NULL); -extern I64 FileWrite(U8 *filename,U8 *fbuf,I64 size,CDate cdt=0,I64 attr=0); -extern I64 FlushMsgs(CTask *task=NULL); -extern I64 GetChar(I64 *scan_code=NULL,Bool echo=TRUE,Bool raw_cursor=FALSE); -extern I64 GetS(U8 *buf,I64 size,Bool allow_ext=TRUE); -extern CHeapCtrl *HeapCtrlInit(CHeapCtrl *hc=NULL, - CTask *task=NULL,CBlkPool *bp); -extern Bool ISO1FileFind(CDrv *dv,I64 cur_dir_cluster,U8 *name, - CDirEntry *_res,I64 fuf_flags=0); -extern Bool ISODrvInit(CDrv *dv,I64 blk); -extern Bool IsDbg(); -extern Bool IsDir(U8 *dir_name); -extern Bool IsRaw(); -extern CBlkDev *Let2BlkDev(U8 drv_let=0,Bool except=TRUE); -extern I64 Let2BlkDevType(U8 drv_let=0); -extern CDrv *Let2Drv(U8 drv_let=0,Bool except=TRUE); -extern U0 MPInt(I64 num,I64 cpu_num=1); -extern U8 *MStrPrint(U8 *fmt,...); -extern Bool MkDir(U8 *filename,I64 entry_cnt=0); -extern U0 MouseIPSet(I64 x,I64 y,I64 z,I64 l,I64 r); -extern U0 Msg(I64 code,I64 a1,I64 a2,I64 flags=0); -extern I64 PopUp(U8 *buf,CTask *parent=NULL,CTask **_pu_task=NULL); -extern U0 Print(U8 *fmt,...); -extern U0 PutChars(U64 ch); -extern U0 PutS(U8 *st); //Use $LK,"Print",A="MN:Print"$() -extern Bool RBlks(CDrv *dv,U8 *buf, I64 blk, I64 cnt); -extern I64 RedSeaAllocClusters(CDrv *dv,I64 cnt); -extern Bool RedSeaDirNew(CDrv *dv,U8 *cur_dir,CDirEntry *tempdee, - Bool free_old_chain); -extern U0 RedSeaDrvInit(CDrv *dv); -extern Bool RedSeaDrvValidate(U8 drv_let); -extern Bool RedSeaFileFind(CDrv *dv,I64 cur_dir_cluster,U8 *name, - CDirEntry *_res,I64 fuf_flags=0); -extern U0 RedSeaFmt(U8 drv_let,Bool quick=TRUE); -extern U0 RedSeaFreeFreeLst(CDrv *dv); -extern CTask *SpawnQue(U0 (*fp_addr)(U8 *data),U8 *data=NULL, - U8 *task_name=NULL,I64 target_cpu,CTask *parent=NULL, //NULL means adam - I64 stk_size=0,I64 flags=1<type&HTG_TYPE_MASK); - else - return -1; -} - -I64 HashVal(CHash *temph) -{//Returns most likely desired value. - switch [HashTypeNum(temph)] { - case HTt_EXPORT_SYS_SYM: - return temph(CHashExport *)->val; - case HTt_IMPORT_SYS_SYM: - return temph(CHashImport *)->module_base; - case HTt_DEFINE_STR: - case HTt_CLASS: - case HTt_INTERNAL_TYPE: - case HTt_WORD: - case HTt_DICT_WORD: - case HTt_OPCODE: - case HTt_HELP_FILE: - return temph; - case HTt_GLBL_VAR: - if (temph(CHashGlblVar *)->flags&GVF_EXTERN) - return &temph(CHashGlblVar *)->data_addr; - else - return temph(CHashGlblVar *)->data_addr; - case HTt_FUN: - if (Bt(&temph(CHashFun *)->flags,Cf_EXTERN)) - return temph; - else - return temph(CHashFun *)->exe_addr; - case HTt_REG: - return temph(CHashReg *)->reg_num|temph(CHashReg *)->reg_type<<8; - case HTt_KEYWORD: - case HTt_ASM_KEYWORD: - case HTt_MODULE: - case HTt_FILE: - case HTt_FRAME_PTR: - return temph(CHashGeneric *)->user_data0; - - case -1: //nobound switch - case HTt_NUM_TYPES: //nobound switch - default: - return 0; - } -} - -CHashTable *HashTableNew(I64 size,CTask *mem_task=NULL) -{//New hash table, power-of-two in size. - CHashTable *table; - table=CAlloc(sizeof(CHashTable),mem_task); - table->body=CAlloc(size<<3,mem_task); - table->mask=size-1; - return table; -} - -U0 HashDel(CHashSrcSym *temph) -{//Free a std TempleOS system hash entry. - if (!temph) return; - if (!(temph->type&HTT_DICT_WORD)) - Free(temph->str); - if (temph->type & HTG_SRC_SYM) { - Free(temph->src_link); - Free(temph->idx); - Free(temph->import_name); - LinkedLstDel(temph->ie_lst); - if (temph->type & (HTT_FUN | HTT_EXPORT_SYS_SYM)) - Free(temph->dbg_info); - if (temph->type & (HTT_FUN | HTT_CLASS)) -//Assumes code not on heap, so doesn't Free. - //$LK,"MemberLstDel",A="MN:MemberLstDel"$() is an import to the Kernel module - MemberLstDel(temph); - else if (temph->type&HTT_DEFINE_STR) - Free(temph(CHashDefineStr *)->data); - else if (temph->type & HTT_GLBL_VAR) { - if (!(temph(CHashGlblVar *)->flags&GVF_ALIAS)) - Free(temph(CHashGlblVar *)->data_addr); - LinkedLstDel(temph(CHashGlblVar *)->dim.next); - if (temph(CHashGlblVar *)->fun_ptr) - HashDel(temph(CHashGlblVar *)->fun_ptr - -temph(CHashGlblVar *)->fun_ptr->ptr_stars_cnt); - } - } else if (temph->type & HTT_FILE) - Free(temph(CHashGeneric *)->user_data0); - Free(temph); -} - -U0 HashTableDel(CHashTable *table) -{//Free std system hash table, calling $LK,"HashDel",A="MN:HashDel"$() on entries. - I64 i; - CHashSrcSym *temph,*temph1; - if (!table) return; - for (i=0;i<=table->mask;i++) { - temph=table->body[i]; - while (temph) { - temph1=temph->next; - HashDel(temph); - temph=temph1; - } - } - Free(table->body); - Free(table); -} - -I64 HashTablePurge(CHashTable *table) -{//Eliminate ExportSysSyms that have been usurped. - I64 i,res=0; - CHashSrcSym *temph,*temph1,*temph2; - if (!table) return 0; - PUSHFD - CLI //Precaution - for (i=0;i<=table->mask;i++) { - temph=table->body[i]; - while (temph) { - temph1=temph->next; //We delete only older ones - if (temph->type&(HTT_FUN|HTT_GLBL_VAR)) { - temph2=temph->next; //Older always later in chain - while (temph2) { - if ((temph2->type&HTT_EXPORT_SYS_SYM || - temph2->type&HTG_TYPE_MASK==HTT_INVALID) && - !StrCmp(temph2->str,temph->str)) { - if (temph2->type&HTG_TYPE_MASK==HTT_INVALID) - temph2->type=HTT_KEYWORD;//Won't delete HTT_INVALID - HashRemDel(temph2,table); - res++; - break; - } - temph2=temph2->next; - } - } - temph=temph1; - } - } - POPFD - return res; -} - -CHashGeneric *HashGenericAdd(U8 *name,I64 type, - I64 u0=0,I64 u1=0,I64 u2=0,CTask *task=NULL) -{//Add any type to task hash_table, 3 user_data values. - if (!task) task=Fs; - CHashGeneric *res=CAlloc(sizeof(CHashGeneric),task); - res->type=type; - res->user_data0=u0; - res->user_data1=u1; - res->user_data2=u2; - res->str=StrNew(name,task); - HashAdd(res,task->hash_table); - return res; -} - -U0 HashSrcFileSet(CCmpCtrl *cc,CHashSrcSym *h,I64 line_num_offset=0) -{//Set $LK,"CHashSrcSym",A="MN:CHashSrcSym"$ link and help_index by cur cc pos. - CLexFile *tempf=cc->lex_include_stk; - I64 line_num=tempf->line_num+line_num_offset; - if (line_num<1) line_num=1; - Free(h->src_link); - h->src_link=MStrPrint("FL:%s,%d",tempf->full_name,line_num); - if (Bt(&cc->opts,OPTf_KEEP_PRIVATE)) - h->type|=HTF_PRIVATE; - Free(h->idx); - if (cc->cur_help_idx && *cc->cur_help_idx) - h->idx=StrNew(cc->cur_help_idx); - else - h->idx=NULL; -} - -CHashGeneric *HashPublic(U8 *st,I64 mask,Bool val=TRUE) -{//Mark a hash entry as public and $LK,"HashSrcFileSet",A="MN:HashSrcFileSet"$(). - CHashGeneric *res; - if (res=HashFind(st,Fs->hash_table,mask)) { - if (val) - res->type|=HTF_PUBLIC; - else - res->type&=~HTF_PUBLIC; - if (res->type&HTG_SRC_SYM) - HashSrcFileSet(Fs->last_cc,res); - return res; - } else - return NULL; -} - -I64 HashLstAdd(U8 *lst,I64 type,CHashTable *table) -{//Add a list to a hash table. - I64 i=0; - CHashGeneric *temph; - if (lst) { - while (*lst) { - if (*lst=='@') - lst++; - else - i++; - temph=CAlloc(sizeof(CHashGeneric)); - temph->user_data0=i-1; - temph->str=StrNew(lst); - temph->type=type; - HashAdd(temph,table); - while (*lst++); - } - } - return i; -} - -I64 HashDefineLstAdd(U8 *dname,I64 type,CHashTable *table) -{//Add define list to a hash table. See $LK,"::/Adam/DolDoc/DocInit.CPP",A="FF:::/Adam/DolDoc/DocInit.CPP,HashDefineLstAdd"$. - CHashDefineStr *temph; - if (temph=HashFind(dname,Fs->hash_table,HTT_DEFINE_STR)) - return HashLstAdd(temph->data,type,table); - else - return 0; -} - -I64 FramePtr(U8 *name,CTask *task=NULL) -{//Find entry in task->hash_table, Return user_data. - CHashGeneric *temph; - if (!task) task=Fs; - if (temph=HashFind(name,task->hash_table,HTT_FRAME_PTR)) - return temph->user_data0; - else - return 0; -} - -CHashGeneric *FramePtrAdd(U8 *name,I64 val=0,CTask *task=NULL) -{//Add named value to task->hash_table. - return HashGenericAdd(name,HTT_FRAME_PTR,val,0,0,task); -} - -I64 FramePtrSet(U8 *name,I64 val,CTask *task=NULL) -{//Find hash entry in task->hash_table. Change user_data0. - CHashGeneric *temph; - if (!task) task=Fs; - if (temph=HashFind(name,task->hash_table,HTT_FRAME_PTR)) - return LXchgI64(&temph->user_data0,val); - else - return 0; -} - -I64 FramePtrDel(U8 *name,CTask *task=NULL) -{//Remove entry and delete. - CHashGeneric *temph; - I64 res=0; - if (!task) task=Fs; - if (temph=HashFind(name,task->hash_table,HTT_FRAME_PTR)) { - res=temph->user_data0; - HashRemDel(temph,task->hash_table); - } - return res; -} diff --git a/Kernel/KHashB.HC b/Kernel/KHashB.HC new file mode 100644 index 0000000..aa08c35 --- /dev/null +++ b/Kernel/KHashB.HC @@ -0,0 +1,250 @@ +I64 HashTypeNum(CHash *temph) +{//Return bit num of hash type, limited to just types. + if (temph) + return Bsf(temph->type&HTG_TYPE_MASK); + else + return -1; +} + +I64 HashVal(CHash *temph) +{//Returns most likely desired value. + switch [HashTypeNum(temph)] { + case HTt_EXPORT_SYS_SYM: + return temph(CHashExport *)->val; + case HTt_IMPORT_SYS_SYM: + return temph(CHashImport *)->module_base; + case HTt_DEFINE_STR: + case HTt_CLASS: + case HTt_INTERNAL_TYPE: + case HTt_WORD: + case HTt_DICT_WORD: + case HTt_OPCODE: + case HTt_HELP_FILE: + return temph; + case HTt_GLBL_VAR: + if (temph(CHashGlblVar *)->flags&GVF_EXTERN) + return &temph(CHashGlblVar *)->data_addr; + else + return temph(CHashGlblVar *)->data_addr; + case HTt_FUN: + if (Bt(&temph(CHashFun *)->flags,Cf_EXTERN)) + return temph; + else + return temph(CHashFun *)->exe_addr; + case HTt_REG: + return temph(CHashReg *)->reg_num|temph(CHashReg *)->reg_type<<8; + case HTt_KEYWORD: + case HTt_ASM_KEYWORD: + case HTt_MODULE: + case HTt_FILE: + case HTt_FRAME_PTR: + return temph(CHashGeneric *)->user_data0; + + case -1: //nobound switch + case HTt_NUM_TYPES: //nobound switch + default: + return 0; + } +} + +CHashTable *HashTableNew(I64 size,CTask *mem_task=NULL) +{//New hash table, power-of-two in size. + CHashTable *table; + table=CAlloc(sizeof(CHashTable),mem_task); + table->body=CAlloc(size<<3,mem_task); + table->mask=size-1; + return table; +} + +U0 HashDel(CHashSrcSym *temph) +{//Free a std TempleOS system hash entry. + if (!temph) return; + if (!(temph->type&HTT_DICT_WORD)) + Free(temph->str); + if (temph->type & HTG_SRC_SYM) { + Free(temph->src_link); + Free(temph->idx); + Free(temph->import_name); + LinkedLstDel(temph->ie_lst); + if (temph->type & (HTT_FUN | HTT_EXPORT_SYS_SYM)) + Free(temph->dbg_info); + if (temph->type & (HTT_FUN | HTT_CLASS)) +//Assumes code not on heap, so doesn't Free. + //$LK,"ClassMemberLstDel",A="MN:ClassMemberLstDel"$() is an import to the Kernel module + ClassMemberLstDel(temph); + else if (temph->type&HTT_DEFINE_STR) + Free(temph(CHashDefineStr *)->data); + else if (temph->type & HTT_GLBL_VAR) { + if (!(temph(CHashGlblVar *)->flags&GVF_ALIAS)) + Free(temph(CHashGlblVar *)->data_addr); + LinkedLstDel(temph(CHashGlblVar *)->dim.next); + if (temph(CHashGlblVar *)->fun_ptr) + HashDel(temph(CHashGlblVar *)->fun_ptr + -temph(CHashGlblVar *)->fun_ptr->ptr_stars_cnt); + } + } else if (temph->type & HTT_FILE) + Free(temph(CHashGeneric *)->user_data0); + Free(temph); +} + +U0 HashTableDel(CHashTable *table) +{//Free std system hash table, calling $LK,"HashDel",A="MN:HashDel"$() on entries. + I64 i; + CHashSrcSym *temph,*temph1; + if (!table) return; + for (i=0;i<=table->mask;i++) { + temph=table->body[i]; + while (temph) { + temph1=temph->next; + HashDel(temph); + temph=temph1; + } + } + Free(table->body); + Free(table); +} + +I64 HashTablePurge(CHashTable *table) +{//Eliminate ExportSysSyms that have been usurped. + I64 i,res=0; + CHashSrcSym *temph,*temph1,*temph2; + if (!table) return 0; + PUSHFD + CLI //Precaution + for (i=0;i<=table->mask;i++) { + temph=table->body[i]; + while (temph) { + temph1=temph->next; //We delete only older ones + if (temph->type&(HTT_FUN|HTT_GLBL_VAR)) { + temph2=temph->next; //Older always later in chain + while (temph2) { + if ((temph2->type&HTT_EXPORT_SYS_SYM || + temph2->type&HTG_TYPE_MASK==HTT_INVALID) && + !StrCmp(temph2->str,temph->str)) { + if (temph2->type&HTG_TYPE_MASK==HTT_INVALID) + temph2->type=HTT_KEYWORD;//Won't delete HTT_INVALID + HashRemDel(temph2,table); + res++; + break; + } + temph2=temph2->next; + } + } + temph=temph1; + } + } + POPFD + return res; +} + +CHashGeneric *HashGenericAdd(U8 *name,I64 type, + I64 u0=0,I64 u1=0,I64 u2=0,CTask *task=NULL) +{//Add any type to task hash_table, 3 user_data values. + if (!task) task=Fs; + CHashGeneric *res=CAlloc(sizeof(CHashGeneric),task); + res->type=type; + res->user_data0=u0; + res->user_data1=u1; + res->user_data2=u2; + res->str=StrNew(name,task); + HashAdd(res,task->hash_table); + return res; +} + +U0 HashSrcFileSet(CCmpCtrl *cc,CHashSrcSym *h,I64 line_num_offset=0) +{//Set $LK,"CHashSrcSym",A="MN:CHashSrcSym"$ link and help_index by cur cc pos. + CLexFile *tempf=cc->lex_include_stk; + I64 line_num=tempf->line_num+line_num_offset; + if (line_num<1) line_num=1; + Free(h->src_link); + h->src_link=MStrPrint("FL:%s,%d",tempf->full_name,line_num); + if (Bt(&cc->opts,OPTf_KEEP_PRIVATE)) + h->type|=HTF_PRIVATE; + Free(h->idx); + if (cc->cur_help_idx && *cc->cur_help_idx) + h->idx=StrNew(cc->cur_help_idx); + else + h->idx=NULL; +} + +CHashGeneric *HashPublic(U8 *st,I64 mask,Bool val=TRUE) +{//Mark a hash entry as public and $LK,"HashSrcFileSet",A="MN:HashSrcFileSet"$(). + CHashGeneric *res; + if (res=HashFind(st,Fs->hash_table,mask)) { + if (val) + res->type|=HTF_PUBLIC; + else + res->type&=~HTF_PUBLIC; + if (res->type&HTG_SRC_SYM) + HashSrcFileSet(Fs->last_cc,res); + return res; + } else + return NULL; +} + +I64 HashLstAdd(U8 *lst,I64 type,CHashTable *table) +{//Add a list to a hash table. + I64 i=0; + CHashGeneric *temph; + if (lst) { + while (*lst) { + if (*lst=='@') + lst++; + else + i++; + temph=CAlloc(sizeof(CHashGeneric)); + temph->user_data0=i-1; + temph->str=StrNew(lst); + temph->type=type; + HashAdd(temph,table); + while (*lst++); + } + } + return i; +} + +I64 HashDefineLstAdd(U8 *dname,I64 type,CHashTable *table) +{//Add define list to a hash table. See $LK,"::/Adam/DolDoc/DocInit.HC",A="FF:::/Adam/DolDoc/DocInit.HC,HashDefineLstAdd"$. + CHashDefineStr *temph; + if (temph=HashFind(dname,Fs->hash_table,HTT_DEFINE_STR)) + return HashLstAdd(temph->data,type,table); + else + return 0; +} + +I64 FramePtr(U8 *name,CTask *task=NULL) +{//Find entry in task->hash_table, Return user_data. + CHashGeneric *temph; + if (!task) task=Fs; + if (temph=HashFind(name,task->hash_table,HTT_FRAME_PTR)) + return temph->user_data0; + else + return 0; +} + +CHashGeneric *FramePtrAdd(U8 *name,I64 val=0,CTask *task=NULL) +{//Add named value to task->hash_table. + return HashGenericAdd(name,HTT_FRAME_PTR,val,0,0,task); +} + +I64 FramePtrSet(U8 *name,I64 val,CTask *task=NULL) +{//Find hash entry in task->hash_table. Change user_data0. + CHashGeneric *temph; + if (!task) task=Fs; + if (temph=HashFind(name,task->hash_table,HTT_FRAME_PTR)) + return LXchgI64(&temph->user_data0,val); + else + return 0; +} + +I64 FramePtrDel(U8 *name,CTask *task=NULL) +{//Remove entry and delete. + CHashGeneric *temph; + I64 res=0; + if (!task) task=Fs; + if (temph=HashFind(name,task->hash_table,HTT_FRAME_PTR)) { + res=temph->user_data0; + HashRemDel(temph,task->hash_table); + } + return res; +} diff --git a/Kernel/KInts.CPP b/Kernel/KInts.CPP deleted file mode 100644 index ccfc14c..0000000 --- a/Kernel/KInts.CPP +++ /dev/null @@ -1,215 +0,0 @@ -asm { -INT_MP_CRASH_ADDR:: //Forward reference to work around compiler - DU32 &IntMPCrash; - -INT_WAKE:: - PUSH RDX - PUSH RAX - MOV EAX,&dev - MOV EDX,U32 LAPIC_EOI - MOV RAX,U64 CDevGlbls.uncached_alias[RAX] - MOV U32 [RAX+RDX],0 - POP RAX - POP RDX - IRET - -IRQ_TIMER:: //I_TIMER - CALL TASK_CONTEXT_SAVE - CLD - - MOV RAX,U64 [RSP] - MOV U64 CTask.rip[RSI],RAX - MOV RAX,U64 16[RSP] - MOV U64 CTask.rflags[RSI],RAX - MOV RAX,U64 24[RSP] - MOV U64 CTask.rsp[RSI],RAX - - XOR RAX,RAX - MOV RDI,U64 GS:CCPU.addr[RAX] - LOCK - INC U64 CCPU.total_jiffies[RDI] - - BT U64 CTask.task_flags[RSI],TASKf_IDLE - JNC @@05 - LOCK - INC U64 CCPU.idle_pt_hits[RDI] - -@@05: MOV RAX,U64 CCPU.profiler_timer_irq[RDI] - TEST RAX,RAX - JZ @@10 - PUSH RSI - CALL RAX //See $LK,"ProfTimerInt",A="MN:ProfTimerInt"$(). - JMP @@15 -@@10: ADD RSP,8 -@@15: CLI - MOV RAX,U64 CCPU.num[RDI] - TEST RAX,RAX - JZ @@20 - - MOV EAX,&dev - MOV EDX,U32 LAPIC_EOI - MOV RAX,U64 CDevGlbls.uncached_alias[RAX] - MOV U32 [RAX+RDX],0 - JMP @@25 - -@@20: CALL &IntCore0TimerHandler //Only Core 0 calls this. -@@25: XOR RAX,RAX - CMP RSI,U64 GS:CCPU.idle_task[RAX] - JE I32 RESTORE_SETH_TASK_IF_READY - JMP I32 RESTORE_RSI_TASK -//************************************ -INT_FAULT:: - PUSH RBX - PUSH RAX - MOV BL,U8 16[RSP] //We pushed fault_num $LK,"IntFaultHandlersNew",A="MN:IntFaultHandlersNew"$(). - XOR RAX,RAX - MOV FS:U8 CTask.fault_num[RAX],BL - POP RAX - POP RBX - ADD RSP,8 //Pop fault_num - - CALL TASK_CONTEXT_SAVE - - XOR RDX,RDX - MOV U64 CTask.fault_err_code[RSI],RDX - MOV EDX,U32 CTask.fault_num[RSI] - BT U64 [INT_FAULT_ERR_CODE_BITMAP],RDX - JNC @@1 - POP U64 CTask.fault_err_code[RSI] - -@@1: MOV RAX,U64 [RSP] - MOV U64 CTask.rip[RSI],RAX - MOV RAX,U64 16[RSP] - MOV U64 CTask.rflags[RSI],RAX - MOV RSP,U64 24[RSP] - MOV U64 CTask.rsp[RSI],RSP - MOV RBP,CTask.rbp[RSI] - PUSH U64 CTask.fault_err_code[RSI] - PUSH U64 CTask.fault_num[RSI] - MOV RSI,CTask.rsi[RSI] - CALL &Fault2 //See $LK,"Fault2",A="FF:::/Kernel/KDbg.CPP,Fault2"$ - JMP I32 RESTORE_FS_TASK - -INT_FAULT_ERR_CODE_BITMAP:: - DU32 0x00027D00,0,0,0,0,0,0,0; -} - -U8 *IntEntryGet(I64 irq) -{//Get interrupt vector. - U8 *res; - I64 *src; - src=dev.idt(U8 *)+irq*16; - res(I64).u16[0]=*src(U16 *); - src(U8 *)+=6; - res(I64).u16[1]=*src(U16 *)++; - res(I64).u32[1]=*src(U32 *); - return res; -} - -U8 *IntEntrySet(I64 irq,U0 (*fp_new_handler)(),I64 type=IDTET_IRQ,I64 dpl=0) -{//Set interrupt vector. See $LK,"IDTET_IRQ",A="MN:IDTET_IRQ"$. -//See $LK,"::/Demo/Lectures/InterruptDemo.CPP"$. - //See $LK,"::/Demo/MultiCore/Interrupts.CPP"$. - I64 fp=fp_new_handler; - U8 *res,*dst; - PUSHFD - CLI - res=IntEntryGet(irq); - dst=dev.idt(U8 *)+irq*16; - *dst(U16 *)++=fp.u16[0]; - *dst(U16 *)++=offset(CGDT.cs64); - *dst(U16 *)++=0x8000+type<<8+dpl<<13; - *dst(U16 *)++=fp.u16[1]; - *dst(U32 *)++=fp.u32[1]; - *dst(U32 *)=0; - POPFD - return res; -} - -U0 IntsInit() -{//Init 8259 - OutU8(0x20,0x11); //IW1 - OutU8(0xA0,0x11); //IW1 - OutU8(0x21,0x20); //IW2 - OutU8(0xA1,0x28); //IW2 - OutU8(0x21,0x04); //IW3 - OutU8(0xA1,0x02); //IW3 - OutU8(0x21,0x0D); //IW4 - OutU8(0xA1,0x09); //IW4 - OutU8(0x21,0xFA); //Mask all but IRQ0 (timer) and IRQ2 Cascade. - OutU8(0xA1,0xFF); -} - -interrupt U0 IntNop() -{//Make unplanned IRQs stop by all means! - OutU8(0xA0,0x20); - OutU8(0x20,0x20); - *(dev.uncached_alias+LAPIC_EOI)(U32 *)=0; -} - -interrupt U0 IntDivZero() -{ - if (Gs->num) { - mp_cnt=1; - dbg.mp_crash->cpu_num=Gs->num; - dbg.mp_crash->task=Fs; - MOV RAX,U64 8[RBP] //Get RIP off of stk. - dbg.mp_crash->rip=GetRAX; - dbg.mp_crash->msg="Div Zero"; - dbg.mp_crash->msg_num=0; - MPInt(I_MP_CRASH,0); - SysHlt; - } - throw('DivZero'); -} - -U8 *IntFaultHandlersNew() -{ - I64 i; - U8 *res=MAlloc(256*7,Fs->code_heap),*dst=res; - for (i=0;i<256;i++) { - *dst++=0x6A; //PUSH I8 xx - *dst(I8 *)++=i; - *dst++=0xE9; //JMP I32 xxxxxxxx - *dst(I32 *)=INT_FAULT-dst-4; - dst+=4; - } - return res; -} - -U0 IntInit1() -{//Interrupt descriptor table part1. - I64 i; - CSysLimitBase temp_ptr; - if (!Gs->num) {//Gs cur $LK,"CCPU",A="MN:CCPU"$ struct - dev.idt=CAlloc(16*256); - for (i=0;i<256;i++) - IntEntrySet(i,&IntNop); - } - temp_ptr.limit=256*16-1; - temp_ptr.base =dev.idt; - SetRAX(&temp_ptr); - LIDT U64 [RAX] -} - -U0 IntInit2() -{//Interrupt descriptor table part2: Core 0 Only. - I64 i; - PUSHFD - CLI - IntEntrySet(I_DIV_ZERO,&IntDivZero); - for (i=1;i<0x20;i++) - IntEntrySet(i,&dbg.int_fault_code[7*i]); -/*In theory, we use the PIC mask reg to insure we don't get -anything but keyboard, mouse and timer IRQs. In practice, I've -gotten IRQ 0x27, perhaps because I didn't initialize the APIC. -I go ahead and ACK PIC in $LK,"IntNop",A="MN:IntNop"$(). -I have no idea why I got a IRQ 0x27. -*/ - IntEntrySet(I_NMI,_SYS_HLT); - IntEntrySet(I_TIMER,IRQ_TIMER); - IntEntrySet(I_MP_CRASH,*INT_MP_CRASH_ADDR(U32 *)); - IntEntrySet(I_WAKE,INT_WAKE); - IntEntrySet(I_DBG,&dbg.int_fault_code[7*I_DBG]); - POPFD -} diff --git a/Kernel/KInts.HC b/Kernel/KInts.HC new file mode 100644 index 0000000..bfb39ba --- /dev/null +++ b/Kernel/KInts.HC @@ -0,0 +1,215 @@ +asm { +INT_MP_CRASH_ADDR:: //Forward reference to work around compiler + DU32 &IntMPCrash; + +INT_WAKE:: + PUSH RDX + PUSH RAX + MOV EAX,&dev + MOV EDX,U32 LAPIC_EOI + MOV RAX,U64 CDevGlbls.uncached_alias[RAX] + MOV U32 [RAX+RDX],0 + POP RAX + POP RDX + IRET + +IRQ_TIMER:: //I_TIMER + CALL TASK_CONTEXT_SAVE + CLD + + MOV RAX,U64 [RSP] + MOV U64 CTask.rip[RSI],RAX + MOV RAX,U64 16[RSP] + MOV U64 CTask.rflags[RSI],RAX + MOV RAX,U64 24[RSP] + MOV U64 CTask.rsp[RSI],RAX + + XOR RAX,RAX + MOV RDI,U64 GS:CCPU.addr[RAX] + LOCK + INC U64 CCPU.total_jiffies[RDI] + + BT U64 CTask.task_flags[RSI],TASKf_IDLE + JNC @@05 + LOCK + INC U64 CCPU.idle_pt_hits[RDI] + +@@05: MOV RAX,U64 CCPU.profiler_timer_irq[RDI] + TEST RAX,RAX + JZ @@10 + PUSH RSI + CALL RAX //See $LK,"ProfTimerInt",A="MN:ProfTimerInt"$(). + JMP @@15 +@@10: ADD RSP,8 +@@15: CLI + MOV RAX,U64 CCPU.num[RDI] + TEST RAX,RAX + JZ @@20 + + MOV EAX,&dev + MOV EDX,U32 LAPIC_EOI + MOV RAX,U64 CDevGlbls.uncached_alias[RAX] + MOV U32 [RAX+RDX],0 + JMP @@25 + +@@20: CALL &IntCore0TimerHandler //Only Core 0 calls this. +@@25: XOR RAX,RAX + CMP RSI,U64 GS:CCPU.idle_task[RAX] + JE I32 RESTORE_SETH_TASK_IF_READY + JMP I32 RESTORE_RSI_TASK +//************************************ +INT_FAULT:: + PUSH RBX + PUSH RAX + MOV BL,U8 16[RSP] //We pushed fault_num $LK,"IntFaultHandlersNew",A="MN:IntFaultHandlersNew"$(). + XOR RAX,RAX + MOV FS:U8 CTask.fault_num[RAX],BL + POP RAX + POP RBX + ADD RSP,8 //Pop fault_num + + CALL TASK_CONTEXT_SAVE + + XOR RDX,RDX + MOV U64 CTask.fault_err_code[RSI],RDX + MOV EDX,U32 CTask.fault_num[RSI] + BT U64 [INT_FAULT_ERR_CODE_BITMAP],RDX + JNC @@1 + POP U64 CTask.fault_err_code[RSI] + +@@1: MOV RAX,U64 [RSP] + MOV U64 CTask.rip[RSI],RAX + MOV RAX,U64 16[RSP] + MOV U64 CTask.rflags[RSI],RAX + MOV RSP,U64 24[RSP] + MOV U64 CTask.rsp[RSI],RSP + MOV RBP,CTask.rbp[RSI] + PUSH U64 CTask.fault_err_code[RSI] + PUSH U64 CTask.fault_num[RSI] + MOV RSI,CTask.rsi[RSI] + CALL &Fault2 //See $LK,"Fault2",A="FF:::/Kernel/KDbg.HC,Fault2"$ + JMP I32 RESTORE_FS_TASK + +INT_FAULT_ERR_CODE_BITMAP:: + DU32 0x00027D00,0,0,0,0,0,0,0; +} + +U8 *IntEntryGet(I64 irq) +{//Get interrupt vector. + U8 *res; + I64 *src; + src=dev.idt(U8 *)+irq*16; + res(I64).u16[0]=*src(U16 *); + src(U8 *)+=6; + res(I64).u16[1]=*src(U16 *)++; + res(I64).u32[1]=*src(U32 *); + return res; +} + +U8 *IntEntrySet(I64 irq,U0 (*fp_new_handler)(),I64 type=IDTET_IRQ,I64 dpl=0) +{//Set interrupt vector. See $LK,"IDTET_IRQ",A="MN:IDTET_IRQ"$. +//See $LK,"::/Demo/Lectures/InterruptDemo.HC"$. + //See $LK,"::/Demo/MultiCore/Interrupts.HC"$. + I64 fp=fp_new_handler; + U8 *res,*dst; + PUSHFD + CLI + res=IntEntryGet(irq); + dst=dev.idt(U8 *)+irq*16; + *dst(U16 *)++=fp.u16[0]; + *dst(U16 *)++=offset(CGDT.cs64); + *dst(U16 *)++=0x8000+type<<8+dpl<<13; + *dst(U16 *)++=fp.u16[1]; + *dst(U32 *)++=fp.u32[1]; + *dst(U32 *)=0; + POPFD + return res; +} + +U0 IntsInit() +{//Init 8259 + OutU8(0x20,0x11); //IW1 + OutU8(0xA0,0x11); //IW1 + OutU8(0x21,0x20); //IW2 + OutU8(0xA1,0x28); //IW2 + OutU8(0x21,0x04); //IW3 + OutU8(0xA1,0x02); //IW3 + OutU8(0x21,0x0D); //IW4 + OutU8(0xA1,0x09); //IW4 + OutU8(0x21,0xFA); //Mask all but IRQ0 (timer) and IRQ2 Cascade. + OutU8(0xA1,0xFF); +} + +interrupt U0 IntNop() +{//Make unplanned IRQs stop by all means! + OutU8(0xA0,0x20); + OutU8(0x20,0x20); + *(dev.uncached_alias+LAPIC_EOI)(U32 *)=0; +} + +interrupt U0 IntDivZero() +{ + if (Gs->num) { + mp_cnt=1; + dbg.mp_crash->cpu_num=Gs->num; + dbg.mp_crash->task=Fs; + MOV RAX,U64 8[RBP] //Get RIP off of stk. + dbg.mp_crash->rip=GetRAX; + dbg.mp_crash->msg="Div Zero"; + dbg.mp_crash->msg_num=0; + MPInt(I_MP_CRASH,0); + SysHlt; + } + throw('DivZero'); +} + +U8 *IntFaultHandlersNew() +{ + I64 i; + U8 *res=MAlloc(256*7,Fs->code_heap),*dst=res; + for (i=0;i<256;i++) { + *dst++=0x6A; //PUSH I8 xx + *dst(I8 *)++=i; + *dst++=0xE9; //JMP I32 xxxxxxxx + *dst(I32 *)=INT_FAULT-dst-4; + dst+=4; + } + return res; +} + +U0 IntInit1() +{//Interrupt descriptor table part1. + I64 i; + CSysLimitBase temp_ptr; + if (!Gs->num) {//Gs cur $LK,"CCPU",A="MN:CCPU"$ struct + dev.idt=CAlloc(16*256); + for (i=0;i<256;i++) + IntEntrySet(i,&IntNop); + } + temp_ptr.limit=256*16-1; + temp_ptr.base =dev.idt; + SetRAX(&temp_ptr); + LIDT U64 [RAX] +} + +U0 IntInit2() +{//Interrupt descriptor table part2: Core 0 Only. + I64 i; + PUSHFD + CLI + IntEntrySet(I_DIV_ZERO,&IntDivZero); + for (i=1;i<0x20;i++) + IntEntrySet(i,&dbg.int_fault_code[7*i]); +/*In theory, we use the PIC mask reg to insure we don't get +anything but keyboard, mouse and timer IRQs. In practice, I've +gotten IRQ 0x27, perhaps because I didn't initialize the APIC. +I go ahead and ACK PIC in $LK,"IntNop",A="MN:IntNop"$(). +I have no idea why I got a IRQ 0x27. +*/ + IntEntrySet(I_NMI,_SYS_HLT); + IntEntrySet(I_TIMER,IRQ_TIMER); + IntEntrySet(I_MP_CRASH,*INT_MP_CRASH_ADDR(U32 *)); + IntEntrySet(I_WAKE,INT_WAKE); + IntEntrySet(I_DBG,&dbg.int_fault_code[7*I_DBG]); + POPFD +} diff --git a/Kernel/KLoad.CPP b/Kernel/KLoad.CPP deleted file mode 100644 index 607f749..0000000 --- a/Kernel/KLoad.CPP +++ /dev/null @@ -1,250 +0,0 @@ -U0 LoadOneImport(U8 **_src,U8 *module_base,I64 ld_flags) -{ - U8 *src=*_src,*ptr2,*st_ptr; - I64 i,etype; - CHashExport *tempex=NULL; - CHashImport *tempiss; - Bool first=TRUE; - - while (etype=*src++) { - i=*src(U32 *)++; - st_ptr=src; - src+=StrLen(st_ptr)+1; - if (*st_ptr) { - if (!first) { - *_src=st_ptr-5; - return; - } else { - first=FALSE; - if (!(tempex=HashFind(st_ptr, - Fs->hash_table,HTG_ALL-HTT_IMPORT_SYS_SYM))) { - if (!(ld_flags & LDF_SILENT)) - "Unresolved Reference:%s\n",st_ptr; - tempiss=CAlloc(sizeof(CHashImport)); - tempiss->str=StrNew(st_ptr); - tempiss->type=HTT_IMPORT_SYS_SYM; - tempiss->module_header_entry=st_ptr-5; - tempiss->module_base=module_base; - HashAdd(tempiss,Fs->hash_table); - } - } - } - if (tempex) { - ptr2=module_base+i; - if (tempex->type & HTT_FUN) - i=tempex(CHashFun *)->exe_addr; - else if (tempex->type & HTT_GLBL_VAR) - i=tempex(CHashGlblVar *)->data_addr; - else - i=tempex->val; - switch (etype) { - case IET_REL_I8: *ptr2(U8 *) =i-ptr2-1; break; - case IET_IMM_U8: *ptr2(U8 *) =i; break; - case IET_REL_I16: *ptr2(U16 *)=i-ptr2-2; break; - case IET_IMM_U16: *ptr2(U16 *)=i; break; - case IET_REL_I32: *ptr2(U32 *)=i-ptr2-4; break; - case IET_IMM_U32: *ptr2(U32 *)=i; break; - case IET_REL_I64: *ptr2(I64 *)=i-ptr2-8; break; - case IET_IMM_I64: *ptr2(I64 *)=i; break; - } - } - } - *_src=src-1; -} - -U0 SysSymImportsResolve(U8 *st_ptr,I64 ld_flags) -{ - CHashImport *tempiss; - U8 *ptr; - while (tempiss=HashSingleTableFind(st_ptr, - Fs->hash_table,HTT_IMPORT_SYS_SYM)) { - ptr=tempiss->module_header_entry; - LoadOneImport(&ptr,tempiss->module_base,ld_flags); - tempiss->type=HTT_INVALID; - } -} - -U0 LoadPass1(U8 *src,U8 *module_base,I64 ld_flags) -{ - U8 *ptr2,*ptr3,*st_ptr; - I64 i,j,cnt,etype; - CHashExport *tempex=NULL; - while (etype=*src++) { - i=*src(U32 *)++; - st_ptr=src; - src+=StrLen(st_ptr)+1; - switch (etype) { - case IET_REL32_EXPORT: - case IET_IMM32_EXPORT: - case IET_REL64_EXPORT: - case IET_IMM64_EXPORT: - tempex=CAlloc(sizeof(CHashExport)); - tempex->str=StrNew(st_ptr); - tempex->type=HTT_EXPORT_SYS_SYM|HTF_IMM; - if (etype==IET_IMM32_EXPORT||etype==IET_IMM64_EXPORT) - tempex->val=i; - else - tempex->val=i+module_base; - HashAdd(tempex,Fs->hash_table); - SysSymImportsResolve(st_ptr,ld_flags); - break; - case IET_REL_I0...IET_IMM_I64: - src=st_ptr-5; - LoadOneImport(&src,module_base,ld_flags); - break; - case IET_ABS_ADDR: - if (ld_flags & LDF_NO_ABSS) - src+=i*sizeof(U32); - else { - cnt=i; - for (j=0;jcode_heap); - break; - case IET_ZEROED_CODE_HEAP: - ptr3=CAlloc(*src(I32 *)++,Fs->code_heap); - break; - end: - if (*st_ptr) { - tempex=CAlloc(sizeof(CHashExport)); - tempex->str=StrNew(st_ptr); - tempex->type=HTT_EXPORT_SYS_SYM|HTF_IMM; - tempex->val=ptr3; - HashAdd(tempex,Fs->hash_table); - } - cnt=i; - for (j=0;jstr=StrNew(st_ptr); - tempex->type=HTT_EXPORT_SYS_SYM|HTF_IMM; - tempex->val=ptr3; - HashAdd(tempex,Fs->hash_table); - } - cnt=i; - for (j=0;jmodule_align_bits; - if (!module_align || bfh->bin_signature!=BIN_SIGNATURE_VAL) { - Free(bfh); - Free(fbuf); - throw('BinModul'); - } - - if (bfh_addr==INVALID_PTR) { - if (bfh->module_org==INVALID_PTR) { - misalignment=module_align-sizeof(CBinFile); - if (misalignment<0) - misalignment&=module_align-1; - if (Fs->code_heap!=Fs->data_heap) { - if (module_align<16) - module_align=16; - bfh_addr=MAllocAligned(size,module_align,Fs->code_heap,misalignment); - } else if (module_align>8) - bfh_addr=MAllocAligned(size,module_align,,misalignment); - else {//Less than 2Gig system memory - bfh_addr=bfh; - goto lo_skip; //File is already in code heap area, don't copy. - } - } else - bfh_addr=bfh->module_org; - } - MemCpy(bfh_addr,bfh,size); - Free(bfh); - - lo_skip: - module_base=bfh_addr(U8 *)+sizeof(CBinFile); - - absname=FileNameAbs(fbuf); - Free(fbuf); - fbuf=StrNew(absname); - FileExtRem(fbuf); - if (fbuf[1]==':' && StrLen(fbuf)>2) - HashGenericAdd(fbuf+2,HTT_MODULE|HTF_PUBLIC,bfh_addr); - LoadPass1(bfh_addr(U8 *)+bfh_addr->patch_table_offset,module_base,ld_flags); - if (!(ld_flags&LDF_JUST_LOAD)) - LoadPass2(bfh_addr(U8 *)+bfh_addr->patch_table_offset,module_base,ld_flags); - Free(absname); - Free(fbuf); - return bfh_addr; -} - -U0 LoadKernel() -{ - HashGenericAdd(KERNEL_MODULE_NAME,HTT_MODULE|HTF_PUBLIC, - sys_boot_base-sizeof(CBinFile)); - - //Abs patches done here $LK,"CPatchTableAbsAddr",A="FF:D:/Kernel/KStart32.CPP,CPatchTableAbsAddr"$. - LoadPass1(sys_boot_patch_table_base,sys_boot_base,LDF_NO_ABSS|LDF_SILENT); - - //No main routines - // LoadPass2(sys_boot_patch_table_base,sys_boot_base,0); -} diff --git a/Kernel/KLoad.HC b/Kernel/KLoad.HC new file mode 100644 index 0000000..b9b8362 --- /dev/null +++ b/Kernel/KLoad.HC @@ -0,0 +1,250 @@ +U0 LoadOneImport(U8 **_src,U8 *module_base,I64 ld_flags) +{ + U8 *src=*_src,*ptr2,*st_ptr; + I64 i,etype; + CHashExport *tempex=NULL; + CHashImport *tempiss; + Bool first=TRUE; + + while (etype=*src++) { + i=*src(U32 *)++; + st_ptr=src; + src+=StrLen(st_ptr)+1; + if (*st_ptr) { + if (!first) { + *_src=st_ptr-5; + return; + } else { + first=FALSE; + if (!(tempex=HashFind(st_ptr, + Fs->hash_table,HTG_ALL-HTT_IMPORT_SYS_SYM))) { + if (!(ld_flags & LDF_SILENT)) + "Unresolved Reference:%s\n",st_ptr; + tempiss=CAlloc(sizeof(CHashImport)); + tempiss->str=StrNew(st_ptr); + tempiss->type=HTT_IMPORT_SYS_SYM; + tempiss->module_header_entry=st_ptr-5; + tempiss->module_base=module_base; + HashAdd(tempiss,Fs->hash_table); + } + } + } + if (tempex) { + ptr2=module_base+i; + if (tempex->type & HTT_FUN) + i=tempex(CHashFun *)->exe_addr; + else if (tempex->type & HTT_GLBL_VAR) + i=tempex(CHashGlblVar *)->data_addr; + else + i=tempex->val; + switch (etype) { + case IET_REL_I8: *ptr2(U8 *) =i-ptr2-1; break; + case IET_IMM_U8: *ptr2(U8 *) =i; break; + case IET_REL_I16: *ptr2(U16 *)=i-ptr2-2; break; + case IET_IMM_U16: *ptr2(U16 *)=i; break; + case IET_REL_I32: *ptr2(U32 *)=i-ptr2-4; break; + case IET_IMM_U32: *ptr2(U32 *)=i; break; + case IET_REL_I64: *ptr2(I64 *)=i-ptr2-8; break; + case IET_IMM_I64: *ptr2(I64 *)=i; break; + } + } + } + *_src=src-1; +} + +U0 SysSymImportsResolve(U8 *st_ptr,I64 ld_flags) +{ + CHashImport *tempiss; + U8 *ptr; + while (tempiss=HashSingleTableFind(st_ptr, + Fs->hash_table,HTT_IMPORT_SYS_SYM)) { + ptr=tempiss->module_header_entry; + LoadOneImport(&ptr,tempiss->module_base,ld_flags); + tempiss->type=HTT_INVALID; + } +} + +U0 LoadPass1(U8 *src,U8 *module_base,I64 ld_flags) +{ + U8 *ptr2,*ptr3,*st_ptr; + I64 i,j,cnt,etype; + CHashExport *tempex=NULL; + while (etype=*src++) { + i=*src(U32 *)++; + st_ptr=src; + src+=StrLen(st_ptr)+1; + switch (etype) { + case IET_REL32_EXPORT: + case IET_IMM32_EXPORT: + case IET_REL64_EXPORT: + case IET_IMM64_EXPORT: + tempex=CAlloc(sizeof(CHashExport)); + tempex->str=StrNew(st_ptr); + tempex->type=HTT_EXPORT_SYS_SYM|HTF_IMM; + if (etype==IET_IMM32_EXPORT||etype==IET_IMM64_EXPORT) + tempex->val=i; + else + tempex->val=i+module_base; + HashAdd(tempex,Fs->hash_table); + SysSymImportsResolve(st_ptr,ld_flags); + break; + case IET_REL_I0...IET_IMM_I64: + src=st_ptr-5; + LoadOneImport(&src,module_base,ld_flags); + break; + case IET_ABS_ADDR: + if (ld_flags & LDF_NO_ABSS) + src+=i*sizeof(U32); + else { + cnt=i; + for (j=0;jcode_heap); + break; + case IET_ZEROED_CODE_HEAP: + ptr3=CAlloc(*src(I32 *)++,Fs->code_heap); + break; + end: + if (*st_ptr) { + tempex=CAlloc(sizeof(CHashExport)); + tempex->str=StrNew(st_ptr); + tempex->type=HTT_EXPORT_SYS_SYM|HTF_IMM; + tempex->val=ptr3; + HashAdd(tempex,Fs->hash_table); + } + cnt=i; + for (j=0;jstr=StrNew(st_ptr); + tempex->type=HTT_EXPORT_SYS_SYM|HTF_IMM; + tempex->val=ptr3; + HashAdd(tempex,Fs->hash_table); + } + cnt=i; + for (j=0;jmodule_align_bits; + if (!module_align || bfh->bin_signature!=BIN_SIGNATURE_VAL) { + Free(bfh); + Free(fbuf); + throw('BinModul'); + } + + if (bfh_addr==INVALID_PTR) { + if (bfh->module_org==INVALID_PTR) { + misalignment=module_align-sizeof(CBinFile); + if (misalignment<0) + misalignment&=module_align-1; + if (Fs->code_heap!=Fs->data_heap) { + if (module_align<16) + module_align=16; + bfh_addr=MAllocAligned(size,module_align,Fs->code_heap,misalignment); + } else if (module_align>8) + bfh_addr=MAllocAligned(size,module_align,,misalignment); + else {//Less than 2Gig system memory + bfh_addr=bfh; + goto lo_skip; //File is already in code heap area, don't copy. + } + } else + bfh_addr=bfh->module_org; + } + MemCpy(bfh_addr,bfh,size); + Free(bfh); + + lo_skip: + module_base=bfh_addr(U8 *)+sizeof(CBinFile); + + absname=FileNameAbs(fbuf); + Free(fbuf); + fbuf=StrNew(absname); + FileExtRem(fbuf); + if (fbuf[1]==':' && StrLen(fbuf)>2) + HashGenericAdd(fbuf+2,HTT_MODULE|HTF_PUBLIC,bfh_addr); + LoadPass1(bfh_addr(U8 *)+bfh_addr->patch_table_offset,module_base,ld_flags); + if (!(ld_flags&LDF_JUST_LOAD)) + LoadPass2(bfh_addr(U8 *)+bfh_addr->patch_table_offset,module_base,ld_flags); + Free(absname); + Free(fbuf); + return bfh_addr; +} + +U0 LoadKernel() +{ + HashGenericAdd(KERNEL_MODULE_NAME,HTT_MODULE|HTF_PUBLIC, + sys_boot_base-sizeof(CBinFile)); + + //Abs patches done here $LK,"CPatchTableAbsAddr",A="FF:D:/Kernel/KStart32.HC,CPatchTableAbsAddr"$. + LoadPass1(sys_boot_patch_table_base,sys_boot_base,LDF_NO_ABSS|LDF_SILENT); + + //No main routines + // LoadPass2(sys_boot_patch_table_base,sys_boot_base,0); +} diff --git a/Kernel/KMathA.CPP b/Kernel/KMathA.HC similarity index 100% rename from Kernel/KMathA.CPP rename to Kernel/KMathA.HC diff --git a/Kernel/KMathB.CPP b/Kernel/KMathB.CPP deleted file mode 100644 index eb8536a..0000000 --- a/Kernel/KMathB.CPP +++ /dev/null @@ -1,138 +0,0 @@ -F64 Clamp(F64 d,F64 lo,F64 hi) -{//Clamp to F64 [] range. - if (dhi) - return hi; - return d; -} - -F64 Min(F64 n1,F64 n2) -{//Min of two F64s. - if (n1<=n2) - return n1; - else - return n2; -} - -F64 Max(F64 n1,F64 n2) -{//Max of two F64s. - if (n1>=n2) - return n1; - else - return n2; -} - -F64 Pow10I64(I64 i) -{//F64 int powers of ten. - if (i>308) - return ì; - else if (i<-308) - return 0.0; - else - return pow10_I64[i+309]; -} - -U64 FloorU64(U64 num,U64 to) -{//Int multiples of num. - return num-num%to; -} - -U64 CeilU64(U64 num,U64 to) -{//Int multiples of num. - num+=to-1; - return num-num%to; -} - -I64 RoundI64(I64 num,I64 to) -{//Int multiples of num. - return num-num%to; -} - -I64 FloorI64(I64 num,I64 to) -{//Int multiples of num. - if (num>=0) - return num-num%to; - else { - num++; - return num-num%to-to; - } -} - -I64 CeilI64(I64 num,I64 to) -{//Int multiples of num. - if (num>=0) { - num+=to-1; - return num-num%to; - } else { - num+=to-1; - return num-num%to-to; - } -} - -//See $LK,"::/Doc/Credits.TXT"$. -I16 RandI16() -{//Random I16. - Fs->rand_seed=6364136223846793005*Fs->rand_seed+1442695040888963407; - if (!Bt(&Fs->task_flags,TASKf_NONTIMER_RAND)) - Fs->rand_seed^=GetTSC>>4; - return Fs->rand_seed.i16[0]; -} - -U16 RandU16() -{//Random U16. - Fs->rand_seed=6364136223846793005*Fs->rand_seed+1442695040888963407; - if (!Bt(&Fs->task_flags,TASKf_NONTIMER_RAND)) - Fs->rand_seed^=GetTSC>>4; - return Fs->rand_seed.u16[0]; -} - -I32 RandI32() -{//Random I32. - Fs->rand_seed=6364136223846793005*Fs->rand_seed+1442695040888963407; - if (!Bt(&Fs->task_flags,TASKf_NONTIMER_RAND)) - Fs->rand_seed^=GetTSC>>4; - return Fs->rand_seed.i32[0]; -} - -U32 RandU32() -{//Random U32. - Fs->rand_seed=6364136223846793005*Fs->rand_seed+1442695040888963407; - if (!Bt(&Fs->task_flags,TASKf_NONTIMER_RAND)) - Fs->rand_seed^=GetTSC>>4; - return Fs->rand_seed.u32[0]; -} - -I64 RandI64() -{//Random I64. - Fs->rand_seed=6364136223846793005*Fs->rand_seed+1442695040888963407; - if (!Bt(&Fs->task_flags,TASKf_NONTIMER_RAND)) - Fs->rand_seed^=GetTSC>>4; - return Fs->rand_seed; -} - -U64 RandU64() -{//Random U64. - Fs->rand_seed=6364136223846793005*Fs->rand_seed+1442695040888963407; - if (!Bt(&Fs->task_flags,TASKf_NONTIMER_RAND)) - Fs->rand_seed^=GetTSC>>4; - return Fs->rand_seed; -} - -F64 Rand() -{//Random F64. - I64 res=RandI64&0x3FFFFFFFFFFFFFFF; - return res/ToF64(0x4000000000000000); -} - -I64 Seed(I64 seed=0,CTask *task=NULL) -{//Set $LK,"Rand",A="MN:Rand"$() seed. Zero for timer-based. - if (!task) task=Fs; - if (seed) { - LBts(&task->task_flags,TASKf_NONTIMER_RAND); - return task->rand_seed=seed; - } else { - LBtr(&task->task_flags,TASKf_NONTIMER_RAND); - return task->rand_seed=GetTSC>>4; - } -} diff --git a/Kernel/KMathB.HC b/Kernel/KMathB.HC new file mode 100644 index 0000000..aa53fcf --- /dev/null +++ b/Kernel/KMathB.HC @@ -0,0 +1,138 @@ +F64 Clamp(F64 d,F64 lo,F64 hi) +{//Clamp to F64 [] range. + if (dhi) + return hi; + return d; +} + +F64 Min(F64 n1,F64 n2) +{//Min of two F64s. + if (n1<=n2) + return n1; + else + return n2; +} + +F64 Max(F64 n1,F64 n2) +{//Max of two F64s. + if (n1>=n2) + return n1; + else + return n2; +} + +F64 Pow10I64(I64 i) +{//F64 int powers of ten. + if (i>308) + return ì; + else if (i<-308) + return 0.0; + else + return pow10_I64[i+309]; +} + +U64 FloorU64(U64 num,U64 to) +{//Int multiples of num. + return num-num%to; +} + +U64 CeilU64(U64 num,U64 to) +{//Int multiples of num. + num+=to-1; + return num-num%to; +} + +I64 RoundI64(I64 num,I64 to) +{//Int multiples of num. + return num-num%to; +} + +I64 FloorI64(I64 num,I64 to) +{//Int multiples of num. + if (num>=0) + return num-num%to; + else { + num++; + return num-num%to-to; + } +} + +I64 CeilI64(I64 num,I64 to) +{//Int multiples of num. + if (num>=0) { + num+=to-1; + return num-num%to; + } else { + num+=to-1; + return num-num%to-to; + } +} + +//See $LK,"::/Doc/Credits.DD"$. +I16 RandI16() +{//Random I16. + Fs->rand_seed=6364136223846793005*Fs->rand_seed+1442695040888963407; + if (!Bt(&Fs->task_flags,TASKf_NONTIMER_RAND)) + Fs->rand_seed^=GetTSC>>4; + return Fs->rand_seed.i16[0]; +} + +U16 RandU16() +{//Random U16. + Fs->rand_seed=6364136223846793005*Fs->rand_seed+1442695040888963407; + if (!Bt(&Fs->task_flags,TASKf_NONTIMER_RAND)) + Fs->rand_seed^=GetTSC>>4; + return Fs->rand_seed.u16[0]; +} + +I32 RandI32() +{//Random I32. + Fs->rand_seed=6364136223846793005*Fs->rand_seed+1442695040888963407; + if (!Bt(&Fs->task_flags,TASKf_NONTIMER_RAND)) + Fs->rand_seed^=GetTSC>>4; + return Fs->rand_seed.i32[0]; +} + +U32 RandU32() +{//Random U32. + Fs->rand_seed=6364136223846793005*Fs->rand_seed+1442695040888963407; + if (!Bt(&Fs->task_flags,TASKf_NONTIMER_RAND)) + Fs->rand_seed^=GetTSC>>4; + return Fs->rand_seed.u32[0]; +} + +I64 RandI64() +{//Random I64. + Fs->rand_seed=6364136223846793005*Fs->rand_seed+1442695040888963407; + if (!Bt(&Fs->task_flags,TASKf_NONTIMER_RAND)) + Fs->rand_seed^=GetTSC>>4; + return Fs->rand_seed; +} + +U64 RandU64() +{//Random U64. + Fs->rand_seed=6364136223846793005*Fs->rand_seed+1442695040888963407; + if (!Bt(&Fs->task_flags,TASKf_NONTIMER_RAND)) + Fs->rand_seed^=GetTSC>>4; + return Fs->rand_seed; +} + +F64 Rand() +{//Random F64. + I64 res=RandI64&0x3FFFFFFFFFFFFFFF; + return res/ToF64(0x4000000000000000); +} + +I64 Seed(I64 seed=0,CTask *task=NULL) +{//Set $LK,"Rand",A="MN:Rand"$() seed. Zero for timer-based. + if (!task) task=Fs; + if (seed) { + LBts(&task->task_flags,TASKf_NONTIMER_RAND); + return task->rand_seed=seed; + } else { + LBtr(&task->task_flags,TASKf_NONTIMER_RAND); + return task->rand_seed=GetTSC>>4; + } +} diff --git a/Kernel/KMisc.CPP b/Kernel/KMisc.CPP deleted file mode 100644 index df3408b..0000000 --- a/Kernel/KMisc.CPP +++ /dev/null @@ -1,278 +0,0 @@ -U0 PortNop() -{//Innoculous (reads IRQ Mask) which should take fixed time -//because it's an ISA-bus standard. It takes 1.0uS-2.0uS. - InU8(0x21); -} - -U16 EndianU16(U16 d) -{//Swap big<-->little endian. - I64 res=0; - res.u8[1]=d.u8[0]; - res.u8[0]=d.u8[1]; - return res; -} - -U32 EndianU32(U32 d) -{//Swap big<-->little endian. - I64 res=0; - res.u8[3]=d.u8[0]; - res.u8[2]=d.u8[1]; - res.u8[1]=d.u8[2]; - res.u8[0]=d.u8[3]; - return res; -} - -I64 EndianI64(I64 d) -{//Swap big<-->little endian. - U64 res; - res.u8[7]=d.u8[0]; - res.u8[6]=d.u8[1]; - res.u8[5]=d.u8[2]; - res.u8[4]=d.u8[3]; - res.u8[3]=d.u8[4]; - res.u8[2]=d.u8[5]; - res.u8[1]=d.u8[6]; - res.u8[0]=d.u8[7]; - return res; -} - -I64 BCnt(I64 d) -{//Count set bits in I64. - I64 res=0,i; - for (i=0;i<8;i++) - res+=set_bits_table[d.u8[i]]; - return res; -} - -U0 IntCore0TimerHandler(CTask *) -{//Called from $LK,"IntCore0TimerHandler",A="FF:::/Kernel/KInts.CPP,IntCore0TimerHandler"$ - I64 i; - if (mp_cnt>1) - while (LBts(&sys_semas[SYS_SEMA_SYS_TIMER],0)) - PAUSE - lock cnts.jiffies++; - cnts.timer+=SYS_TIMER0_PERIOD+1; - LBtr(&sys_semas[SYS_SEMA_SYS_TIMER],0); - for (i=1;i1) - while (LBts(&sys_semas[SYS_SEMA_SYS_TIMER],0)) - PAUSE - OutU8(0x43,0); //Latch Timer0 - if ((i=InU8(0x40)+InU8(0x40)<<8)==SYS_TIMER0_PERIOD) { - if (InU8(0x20) & 1) - i=-1; - } - res=cnts.timer+SYS_TIMER0_PERIOD-i; - LBtr(&sys_semas[SYS_SEMA_SYS_TIMER],0); - POPFD - return res; -} - -I64 HPET() -{ //Get high precision event timer. - return *(dev.uncached_alias+HPET_MAIN_CNT)(I64 *); -} - -I64 TimeStampFreqCal() -{ - static I64 time_stamp_start=0,timer_start=0,HPET_start=0; - I64 i; - if (time_stamp_start) { - PUSHFD - CLI - if (HPET_start) { - cnts.time_stamp_freq=cnts.HPET_freq*(GetTSC-time_stamp_start); - i=HPET-HPET_start; - } else { - cnts.time_stamp_freq=SYS_TIMER_FREQ*(GetTSC-time_stamp_start); - i=SysTimerRead-timer_start; - } - if (!i) - AdamErr("Timer Cal Error"); - else { - cnts.time_stamp_freq/=i; - cnts.time_stamp_kHz_freq=cnts.time_stamp_freq/1000; - cnts.time_stamp_calibrated=TRUE; - } - POPFD - } - PUSHFD - CLI - if (cnts.HPET_freq) { - timer_start=0; - HPET_start=HPET; - } else { - timer_start=SysTimerRead; - HPET_start=0; - } - time_stamp_start=GetTSC; - POPFD - return cnts.time_stamp_freq; -} - -F64 tS() -{//Time since boot in seconds as a float. - if (cnts.HPET_freq) - return ToF64(HPET-cnts.HPET_initial)/cnts.HPET_freq; - else - return SysTimerRead/ToF64(SYS_TIMER_FREQ); -} - -Bool Blink(F64 Hz=2.5) -{//Return TRUE, then FALSE, then TRUE at given frequency. - if (!Hz) return 0; - return ToI64(cnts.jiffies*2*Hz/JIFFY_FREQ)&1; -} - -U0 BusyWait(I64 æS) -{//Loosely timed. - I64 i; - if (cnts.HPET_freq) { - i=HPET+cnts.HPET_freq*æS/1000000; - while (HPETtask_flags,TASKf_IDLE); - Fs->wake_jiffy=wake_jiffy; - Yield; - LBEqu(&Fs->task_flags,TASKf_IDLE,old_idle); -} - -U0 Sleep(I64 mS) -{//Not for power-saving. It is to make a program pause without hogging the CPU. - if (!mS) - Yield; - else - SleepUntil(cnts.jiffies+mS*JIFFY_FREQ/1000); -} - -U0 Snd(F64 freq) -{//Play freq. Zero means off. - I64 period; - CSndData *d; - if (!Bt(&sys_semas[SYS_SEMA_MUTE],0) && - !LBts(&sys_semas[SYS_SEMA_SND],0)) { //Mutex. Just throw-out if in use - if (freq!=snd.freq) { - snd.freq=freq; - if (0freq=freq; - d->time=tS; - QueIns(d,snd.record_head.last); - } - LBtr(&sys_semas[SYS_SEMA_SND],0); - } -} - -U0 Beep(I64 freq=500,Bool busy=FALSE) -{//Make beep at given freq. - Snd(freq); - if (busy) - BusyWait(500000); - else - Sleep(500); - Snd(0); - if (busy) - BusyWait(200000); - else - Sleep(200); -} - -Bool Mute(Bool val) -{//Turn-off or on sound. - Bool res; - if (val) { - PUSHFD - CLI - Snd(0); - res=LBts(&sys_semas[SYS_SEMA_MUTE],0); - POPFD - } else - res=LBtr(&sys_semas[SYS_SEMA_MUTE],0); - return res; -} - -Bool IsMute() -{//Return is-mute flag. - return Bt(&sys_semas[SYS_SEMA_MUTE],0); -} - -Bool Silent(Bool val=ON) -{//Turns-off StdOut console text output, not sound. - return LBEqu(&Fs->display_flags,DISPLAYf_SILENT,val); -} - -Bool IsSilent() -{//Is StdOut turned-off? - return Bt(&Fs->display_flags,DISPLAYf_SILENT); -} - -Bool SysDbg(Bool val) -{//Sets or resets sysdbg bit you can use while debugging. - return LBEqu(&sys_semas[SYS_SEMA_DEBUG],0,val); -} - -Bool IsSysDbg() -{//Is sysdbg bit set? - return Bt(&sys_semas[SYS_SEMA_DEBUG],0); -} - -Bool Raw(Bool val) -{//Switches to direct screen, non-windowed output. - if (!val) - VGAFlush; - return !LBEqu(&Fs->display_flags,DISPLAYf_NOT_RAW,!val); -} - -Bool IsRaw() -{//Are we in BLACK & WHITE raw screen mode? - return !Bt(&Fs->display_flags,DISPLAYf_NOT_RAW); -} - -Bool SingleUser(Bool val) -{//Sets or resets single-user mode bit. - return LBEqu(&sys_semas[SYS_SEMA_SINGLE_USER],0,val); -} - -Bool IsSingleUser() -{//Are we in single-user mode? - return Bt(&sys_semas[SYS_SEMA_SINGLE_USER],0); -} - -Bool InDbg(Bool val) -{//Set in-debugger flag. - return LBEqu(&sys_semas[SYS_SEMA_IN_DEBUGGER],0,val); -} - -Bool IsDbg() -{//Return in-debugger flag. - return Bt(&sys_semas[SYS_SEMA_IN_DEBUGGER],0); -} - -U0 ProgressBarsRst() -{ - MemSet(sys_progresses,0,sizeof(sys_progresses)); -} diff --git a/Kernel/KMisc.HC b/Kernel/KMisc.HC new file mode 100644 index 0000000..2a3fa90 --- /dev/null +++ b/Kernel/KMisc.HC @@ -0,0 +1,278 @@ +U0 PortNop() +{//Innoculous (reads IRQ Mask) which should take fixed time +//because it's an ISA-bus standard. It takes 1.0uS-2.0uS. + InU8(0x21); +} + +U16 EndianU16(U16 d) +{//Swap big<-->little endian. + I64 res=0; + res.u8[1]=d.u8[0]; + res.u8[0]=d.u8[1]; + return res; +} + +U32 EndianU32(U32 d) +{//Swap big<-->little endian. + I64 res=0; + res.u8[3]=d.u8[0]; + res.u8[2]=d.u8[1]; + res.u8[1]=d.u8[2]; + res.u8[0]=d.u8[3]; + return res; +} + +I64 EndianI64(I64 d) +{//Swap big<-->little endian. + U64 res; + res.u8[7]=d.u8[0]; + res.u8[6]=d.u8[1]; + res.u8[5]=d.u8[2]; + res.u8[4]=d.u8[3]; + res.u8[3]=d.u8[4]; + res.u8[2]=d.u8[5]; + res.u8[1]=d.u8[6]; + res.u8[0]=d.u8[7]; + return res; +} + +I64 BCnt(I64 d) +{//Count set bits in I64. + I64 res=0,i; + for (i=0;i<8;i++) + res+=set_bits_table[d.u8[i]]; + return res; +} + +U0 IntCore0TimerHandler(CTask *) +{//Called from $LK,"IntCore0TimerHandler",A="FF:::/Kernel/KInts.HC,IntCore0TimerHandler"$ + I64 i; + if (mp_cnt>1) + while (LBts(&sys_semas[SYS_SEMA_SYS_TIMER],0)) + PAUSE + lock cnts.jiffies++; + cnts.timer+=SYS_TIMER0_PERIOD+1; + LBtr(&sys_semas[SYS_SEMA_SYS_TIMER],0); + for (i=1;i1) + while (LBts(&sys_semas[SYS_SEMA_SYS_TIMER],0)) + PAUSE + OutU8(0x43,0); //Latch Timer0 + if ((i=InU8(0x40)+InU8(0x40)<<8)==SYS_TIMER0_PERIOD) { + if (InU8(0x20) & 1) + i=-1; + } + res=cnts.timer+SYS_TIMER0_PERIOD-i; + LBtr(&sys_semas[SYS_SEMA_SYS_TIMER],0); + POPFD + return res; +} + +I64 HPET() +{ //Get high precision event timer. + return *(dev.uncached_alias+HPET_MAIN_CNT)(I64 *); +} + +I64 TimeStampFreqCal() +{ + static I64 time_stamp_start=0,timer_start=0,HPET_start=0; + I64 i; + if (time_stamp_start) { + PUSHFD + CLI + if (HPET_start) { + cnts.time_stamp_freq=cnts.HPET_freq*(GetTSC-time_stamp_start); + i=HPET-HPET_start; + } else { + cnts.time_stamp_freq=SYS_TIMER_FREQ*(GetTSC-time_stamp_start); + i=SysTimerRead-timer_start; + } + if (!i) + AdamErr("Timer Cal Error"); + else { + cnts.time_stamp_freq/=i; + cnts.time_stamp_kHz_freq=cnts.time_stamp_freq/1000; + cnts.time_stamp_calibrated=TRUE; + } + POPFD + } + PUSHFD + CLI + if (cnts.HPET_freq) { + timer_start=0; + HPET_start=HPET; + } else { + timer_start=SysTimerRead; + HPET_start=0; + } + time_stamp_start=GetTSC; + POPFD + return cnts.time_stamp_freq; +} + +F64 tS() +{//Time since boot in seconds as a float. + if (cnts.HPET_freq) + return ToF64(HPET-cnts.HPET_initial)/cnts.HPET_freq; + else + return SysTimerRead/ToF64(SYS_TIMER_FREQ); +} + +Bool Blink(F64 Hz=2.5) +{//Return TRUE, then FALSE, then TRUE at given frequency. + if (!Hz) return 0; + return ToI64(cnts.jiffies*2*Hz/JIFFY_FREQ)&1; +} + +U0 BusyWait(I64 æS) +{//Loosely timed. + I64 i; + if (cnts.HPET_freq) { + i=HPET+cnts.HPET_freq*æS/1000000; + while (HPETtask_flags,TASKf_IDLE); + Fs->wake_jiffy=wake_jiffy; + Yield; + LBEqu(&Fs->task_flags,TASKf_IDLE,old_idle); +} + +U0 Sleep(I64 ms) +{//Not for power-saving. It is to make a program pause without hogging the CPU. + if (!ms) + Yield; + else + SleepUntil(cnts.jiffies+ms*JIFFY_FREQ/1000); +} + +U0 Snd(F64 freq) +{//Play freq. Zero means off. + I64 period; + CSndData *d; + if (!Bt(&sys_semas[SYS_SEMA_MUTE],0) && + !LBts(&sys_semas[SYS_SEMA_SND],0)) { //Mutex. Just throw-out if in use + if (freq!=snd.freq) { + snd.freq=freq; + if (0freq=freq; + d->time=tS; + QueIns(d,snd.record_head.last); + } + LBtr(&sys_semas[SYS_SEMA_SND],0); + } +} + +U0 Beep(I64 freq=500,Bool busy=FALSE) +{//Make beep at given freq. + Snd(freq); + if (busy) + BusyWait(500000); + else + Sleep(500); + Snd(0); + if (busy) + BusyWait(200000); + else + Sleep(200); +} + +Bool Mute(Bool val) +{//Turn-off or on sound. + Bool res; + if (val) { + PUSHFD + CLI + Snd(0); + res=LBts(&sys_semas[SYS_SEMA_MUTE],0); + POPFD + } else + res=LBtr(&sys_semas[SYS_SEMA_MUTE],0); + return res; +} + +Bool IsMute() +{//Return is-mute flag. + return Bt(&sys_semas[SYS_SEMA_MUTE],0); +} + +Bool Silent(Bool val=ON) +{//Turns-off StdOut console text output, not sound. + return LBEqu(&Fs->display_flags,DISPLAYf_SILENT,val); +} + +Bool IsSilent() +{//Is StdOut turned-off? + return Bt(&Fs->display_flags,DISPLAYf_SILENT); +} + +Bool SysDbg(Bool val) +{//Sets or resets sysdbg bit you can use while debugging. + return LBEqu(&sys_semas[SYS_SEMA_DEBUG],0,val); +} + +Bool IsSysDbg() +{//Is sysdbg bit set? + return Bt(&sys_semas[SYS_SEMA_DEBUG],0); +} + +Bool Raw(Bool val) +{//Switches to direct screen, non-windowed output. + if (!val) + VGAFlush; + return !LBEqu(&Fs->display_flags,DISPLAYf_NOT_RAW,!val); +} + +Bool IsRaw() +{//Are we in BLACK & WHITE raw screen mode? + return !Bt(&Fs->display_flags,DISPLAYf_NOT_RAW); +} + +Bool SingleUser(Bool val) +{//Sets or resets single-user mode bit. + return LBEqu(&sys_semas[SYS_SEMA_SINGLE_USER],0,val); +} + +Bool IsSingleUser() +{//Are we in single-user mode? + return Bt(&sys_semas[SYS_SEMA_SINGLE_USER],0); +} + +Bool InDbg(Bool val) +{//Set in-debugger flag. + return LBEqu(&sys_semas[SYS_SEMA_IN_DEBUGGER],0,val); +} + +Bool IsDbg() +{//Return in-debugger flag. + return Bt(&sys_semas[SYS_SEMA_IN_DEBUGGER],0); +} + +U0 ProgressBarsRst() +{ + MemSet(sys_progresses,0,sizeof(sys_progresses)); +} diff --git a/Kernel/KStart16.CPP b/Kernel/KStart16.CPP deleted file mode 100644 index ac1671a..0000000 --- a/Kernel/KStart16.CPP +++ /dev/null @@ -1,177 +0,0 @@ -asm {/* See $LK,"::/Doc/Boot.TXT"$. -TempleOS starts in real, calls some BIOS -routines, switches to 32 bit, and 64 bit mode -and continues in $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ at $LK,"KernelMain",A="MN:KernelMain"$(). - -The boot loader jumps here in real-mode (16-bit). -It actually jumps to the $LK,"CBinFile",A="MN:CBinFile"$ header which is -placed just before this by $LK,"the compiler",A="FF:::/Compiler/CMain.CPP,16 ALIGN"$. -The header begins with a short jmp to -the start of this file's code which begins -with the following small jump past some data. - -This file is first in the Kernel image -because it is #included first. $LK,"Kernel.PRJ",A="FF:::/Kernel/Kernel.PRJ,KStart16:1"$ -*/ -USE16 -SYS_KERNEL:: //This must match $LK,"CKernel",A="MN:CKernel"$. - JMP U16 CORE0_16BIT_INIT - -//************************************ -// ASM Global vars required for 16-bit start-up - ALIGN 4,OC_NOP -SYS_BOOT_SRC:: DU32 BOOT_SRC_NULL; -SYS_BOOT_BLK:: DU32 0; -SYS_BOOT_PATCH_TABLE_BASE:: DU32 0; -SYS_RUN_LEVEL:: DU32 0; -#exe {StreamPrint("SYS_COMPILE_TIME:: DU64 0x%X;",Now);} //See $LK,"BootDVDProbe",A="MN:BootDVDProbe"$ -#assert SYS_COMPILE_TIME+sizeof(CDate)+sizeof(CBinFile)opts[CFG_TEXT_MODE]) - StreamPrint("INT 0x10"); //Enable VGA -}; - CMP AX,0x004F - JNE @@10 //Jmp if fail - BTS U32 [SYS_RUN_LEVEL],RLf_VGA -@@10: - -//Get mem maps - MOV AX,0xE801 - INT 0x15 - MOV U16 [SYS_MEM_E801],CX - MOV U16 [SYS_MEM_E801+2],DX - - MOV CX,MEM_NUM_E820_ENTRIES-1 //Leave one to terminate - XOR EBX,EBX - MOV AX,DS - MOV ES,AX - MOV DI,SYS_MEM_E820 -@@15: PUSH CX - MOV EAX,0xE820 - MOV ECX,MEM_E820_ENTRY_SIZE - MOV EDX,'PAMS' - INT 0x15 - JC @@20 - CMP EAX,'PAMS' - JNE @@20 - TEST EBX,EBX - JZ @@20 - ADD DI,MEM_E820_ENTRY_SIZE - POP CX - LOOP @@15 - JMP @@25 -@@20: ADD SP,2 - -//Get PCI Bus Info -@@25: MOV U16 [SYS_PCI_BUSES],256 - XOR DX,DX - MOV AX,0xB101 - INT 0x1A - CMP DX,'PC' - JNE @@30 - MOV CH,0 - INC CX - MOV U16 [SYS_PCI_BUSES],CX -@@30: - CLI -//Enable A20 - IN AL,0x92 - OR AL,2 - OUT 0x92,AL - - POP U32 [SYS_BOOT_BLK] - POP U32 [SYS_BOOT_SRC] //See $LK,"BootHD",A="FF:::/Adam/Opt/Boot/BootHD.CPP,BOOT_SRC_HARDDRV"$, $LK,"BootDVD",A="FF:::/Adam/Opt/Boot/BootDVD.CPP,BOOT_SRC_DVD"$, & $LK,"BootRAM",A="FF:::/Adam/Opt/Boot/BootRAM.CPP,BOOT_SRC_RAM"$. - - CLD - XOR EAX,EAX - MOV AX,CS - MOV DS,AX - MOV ES,AX - SHL EAX,4 - - MOV U32 [SYS_BOOT_BASE],EAX - - MOV DX,CS - SUB DX,sizeof(CBinFile)/16 -#assert !(sizeof(CBinFile)&15) - MOV GS,DX - - MOV EDX,EAX - ADD EDX,U32 GS:[CBinFile.patch_table_offset] - SUB EDX,sizeof(CBinFile) - MOV U32 [SYS_BOOT_PATCH_TABLE_BASE],EDX - - ADD U32 [GDT_BOOT_DS+2],EAX - ADD U32 [GDT_BOOT_CS+2],EAX - ADD EAX,I32 SYS_GDT - MOV U32 [SYS_GDT_PTR+CSysLimitBase.base],EAX - LGDT U32 [SYS_GDT_PTR] - - MOV EAX,SYS_START_CR0 - MOV_CR0_EAX - -/* The assembler doesn't support far jumps so -we hand code it. 16-bit code is not important -enough to fully implement in the assembler. - -To complete the switch to 32-bit mode, we have to load -the code segment with a far jump. -*/ - DU8 0x66,0xEA; //JMP CGDT.boot_cs:CORE0_32BIT_INIT - DU32 CORE0_32BIT_INIT; - DU16 CGDT.boot_cs; -#assert $$+16<=0xFFFF -} diff --git a/Kernel/KStart16.HC b/Kernel/KStart16.HC new file mode 100644 index 0000000..53fe4db --- /dev/null +++ b/Kernel/KStart16.HC @@ -0,0 +1,177 @@ +asm {/* See $LK,"::/Doc/Boot.DD"$. +TempleOS starts in real, calls some BIOS +routines, switches to 32 bit, and 64 bit mode +and continues in $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ at $LK,"KernelMain",A="MN:KernelMain"$(). + +The boot loader jumps here in real-mode (16-bit). +It actually jumps to the $LK,"CBinFile",A="MN:CBinFile"$ header which is +placed just before this by $LK,"the compiler",A="FF:::/Compiler/CMain.HC,16 ALIGN"$. +The header begins with a short jmp to +the start of this file's code which begins +with the following small jump past some data. + +This file is first in the Kernel image +because it is #included first. $LK,"Kernel.PRJ",A="FF:::/Kernel/Kernel.PRJ,KStart16:1"$ +*/ +USE16 +SYS_KERNEL:: //This must match $LK,"CKernel",A="MN:CKernel"$. + JMP U16 CORE0_16BIT_INIT + +//************************************ +// ASM Global vars required for 16-bit start-up + ALIGN 4,OC_NOP +SYS_BOOT_SRC:: DU32 BOOT_SRC_NULL; +SYS_BOOT_BLK:: DU32 0; +SYS_BOOT_PATCH_TABLE_BASE:: DU32 0; +SYS_RUN_LEVEL:: DU32 0; +#exe {StreamPrint("SYS_COMPILE_TIME:: DU64 0x%X;",Now);} //See $LK,"BootDVDProbe",A="MN:BootDVDProbe"$ +#assert SYS_COMPILE_TIME+sizeof(CDate)+sizeof(CBinFile)opts[CFG_TEXT_MODE]) + StreamPrint("INT 0x10"); //Enable VGA +}; + CMP AX,0x004F + JNE @@10 //Jmp if fail + BTS U32 [SYS_RUN_LEVEL],RLf_VGA +@@10: + +//Get mem maps + MOV AX,0xE801 + INT 0x15 + MOV U16 [SYS_MEM_E801],CX + MOV U16 [SYS_MEM_E801+2],DX + + MOV CX,MEM_NUM_E820_ENTRIES-1 //Leave one to terminate + XOR EBX,EBX + MOV AX,DS + MOV ES,AX + MOV DI,SYS_MEM_E820 +@@15: PUSH CX + MOV EAX,0xE820 + MOV ECX,MEM_E820_ENTRY_SIZE + MOV EDX,'PAMS' + INT 0x15 + JC @@20 + CMP EAX,'PAMS' + JNE @@20 + TEST EBX,EBX + JZ @@20 + ADD DI,MEM_E820_ENTRY_SIZE + POP CX + LOOP @@15 + JMP @@25 +@@20: ADD SP,2 + +//Get PCI Bus Info +@@25: MOV U16 [SYS_PCI_BUSES],256 + XOR DX,DX + MOV AX,0xB101 + INT 0x1A + CMP DX,'PC' + JNE @@30 + MOV CH,0 + INC CX + MOV U16 [SYS_PCI_BUSES],CX +@@30: + CLI +//Enable A20 + IN AL,0x92 + OR AL,2 + OUT 0x92,AL + + POP U32 [SYS_BOOT_BLK] + POP U32 [SYS_BOOT_SRC] //See $LK,"BootHD",A="FF:::/Adam/Opt/Boot/BootHD.HC,BOOT_SRC_HARDDRV"$, $LK,"BootDVD",A="FF:::/Adam/Opt/Boot/BootDVD.HC,BOOT_SRC_DVD"$, & $LK,"BootRAM",A="FF:::/Adam/Opt/Boot/BootRAM.HC,BOOT_SRC_RAM"$. + + CLD + XOR EAX,EAX + MOV AX,CS + MOV DS,AX + MOV ES,AX + SHL EAX,4 + + MOV U32 [SYS_BOOT_BASE],EAX + + MOV DX,CS + SUB DX,sizeof(CBinFile)/16 +#assert !(sizeof(CBinFile)&15) + MOV GS,DX + + MOV EDX,EAX + ADD EDX,U32 GS:[CBinFile.patch_table_offset] + SUB EDX,sizeof(CBinFile) + MOV U32 [SYS_BOOT_PATCH_TABLE_BASE],EDX + + ADD U32 [GDT_BOOT_DS+2],EAX + ADD U32 [GDT_BOOT_CS+2],EAX + ADD EAX,I32 SYS_GDT + MOV U32 [SYS_GDT_PTR+CSysLimitBase.base],EAX + LGDT U32 [SYS_GDT_PTR] + + MOV EAX,SYS_START_CR0 + MOV_CR0_EAX + +/* The assembler doesn't support far jumps so +we hand code it. 16-bit code is not important +enough to fully implement in the assembler. + +To complete the switch to 32-bit mode, we have to load +the code segment with a far jump. +*/ + DU8 0x66,0xEA; //JMP CGDT.boot_cs:CORE0_32BIT_INIT + DU32 CORE0_32BIT_INIT; + DU16 CGDT.boot_cs; +#assert $$+16<=0xFFFF +} diff --git a/Kernel/KStart32.CPP b/Kernel/KStart32.HC similarity index 100% rename from Kernel/KStart32.CPP rename to Kernel/KStart32.HC diff --git a/Kernel/KStart64.CPP b/Kernel/KStart64.CPP deleted file mode 100644 index 409002a..0000000 --- a/Kernel/KStart64.CPP +++ /dev/null @@ -1,100 +0,0 @@ -asm { -USE64 - BTS U32 [SYS_RUN_LEVEL],RLf_64BIT - - FNINIT - MOV RAX,SYS_FIXED_AREA+CSysFixedArea.init_fpu_mmx - FXSAVE U64 [RAX] - -//Init CPU0 Struct - PUSH SYS_FIXED_AREA+CSysFixedArea.adam - PUSH SYS_FIXED_AREA+CSysFixedArea.boot_cpu - PUSH 0 - CALL &CPUStructInit - CALL SET_GS_BASE - -//Init Adam HeapCtrl - MOV EDI,U32 SYS_FIXED_AREA+CSysFixedArea.adam_hc - MOV EAX,U32 SYS_FIXED_AREA+CSysFixedArea.adam_bp - MOV U64 CHeapCtrl.bp[RDI],RAX - MOV U32 CHeapCtrl.hc_signature[RDI],HEAP_CTRL_SIGNATURE_VAL - - LEA RAX,U64 CHeapCtrl.next_um-CMemUsed.next[RDI] - MOV U64 CHeapCtrl.next_um[RDI],RAX - MOV U64 CHeapCtrl.last_um[RDI],RAX - - MOV EAX,U32 SYS_FIXED_AREA+CSysFixedArea.adam - MOV U64 CHeapCtrl.mem_task[RDI],RAX - MOV U64 CTask.code_heap[RAX],RDI - MOV U64 CTask.data_heap[RAX],RDI - MOV U32 CTask.task_signature[RAX],TASK_SIGNATURE_VAL - - BTS U32 [SYS_RUN_LEVEL],RLf_BOOT_HEAP - - PUSH MEM_ADAM_STK - PUSH U32 SYS_FIXED_AREA+CSysFixedArea.adam - CALL &TaskInit - CALL SET_FS_BASE - MOV RSP,U64 CTask.rsp[RAX] - - JMP I32 &KernelMain - -//************************************ -USE32 -SYS_ENTER_LONG_MODE:: //Switch to long 64-bit mode - MOV_EAX_CR4 - OR EAX,0xB0 - MOV_CR4_EAX - - MOV EAX,SYS_FIXED_AREA+CSysFixedArea.pml4 - MOV_CR3_EAX - - MOV ECX,IA32_EFER - XOR EDX,EDX - MOV EAX,IA32F_LME - WRMSR - - MOV_EAX_CR0 - BTS EAX,31 //Enable paging (required for 64-bit mode) - MOV_CR0_EAX - - DU8 0xEA; //JMP CGDT.cs64:@@05 - DU32 @@05; - DU16 CGDT.cs64; -USE64 -@@05: MOV AX,CGDT.ds - MOV DS,AX - MOV ES,AX - MOV SS,AX - MOV FS,AX - MOV GS,AX - RET - -//************************************ -SYS_RAM_REBOOT:: //This gets copied high. $LK,"SYS_RAM_REBOOT",A="FF:::/Adam/Opt/Boot/BootRAM.CPP,SYS_RAM_REBOOT:2"$ - PUSH U32 CGDT.ds //stk seg - PUSH U32 BOOT_RAM_LIMIT //stk - PUSH U32 0 //flags - PUSH U32 CGDT.cs32 - LEA RAX,[@@10] - PUSH RAX - IRET -USE32 -@@10: WBINVD - -//Disable paging - MOV_EAX_CR0 - BTR EAX,31 - MOV_CR0_EAX - - MOV ECX,IA32_EFER - XOR EDX,EDX - XOR EAX,EAX - WRMSR - - MOV EBX,BOOT_SRC_RAM - MOV EAX,I32 CORE0_32BIT_INIT - JMP EAX -SYS_RAM_REBOOT_END:: -USE64 -} diff --git a/Kernel/KStart64.HC b/Kernel/KStart64.HC new file mode 100644 index 0000000..5947dce --- /dev/null +++ b/Kernel/KStart64.HC @@ -0,0 +1,100 @@ +asm { +USE64 + BTS U32 [SYS_RUN_LEVEL],RLf_64BIT + + FNINIT + MOV RAX,SYS_FIXED_AREA+CSysFixedArea.init_fpu_mmx + FXSAVE U64 [RAX] + +//Init CPU0 Struct + PUSH SYS_FIXED_AREA+CSysFixedArea.adam + PUSH SYS_FIXED_AREA+CSysFixedArea.boot_cpu + PUSH 0 + CALL &CPUStructInit + CALL SET_GS_BASE + +//Init Adam HeapCtrl + MOV EDI,U32 SYS_FIXED_AREA+CSysFixedArea.adam_hc + MOV EAX,U32 SYS_FIXED_AREA+CSysFixedArea.adam_bp + MOV U64 CHeapCtrl.bp[RDI],RAX + MOV U32 CHeapCtrl.hc_signature[RDI],HEAP_CTRL_SIGNATURE_VAL + + LEA RAX,U64 CHeapCtrl.next_um-CMemUsed.next[RDI] + MOV U64 CHeapCtrl.next_um[RDI],RAX + MOV U64 CHeapCtrl.last_um[RDI],RAX + + MOV EAX,U32 SYS_FIXED_AREA+CSysFixedArea.adam + MOV U64 CHeapCtrl.mem_task[RDI],RAX + MOV U64 CTask.code_heap[RAX],RDI + MOV U64 CTask.data_heap[RAX],RDI + MOV U32 CTask.task_signature[RAX],TASK_SIGNATURE_VAL + + BTS U32 [SYS_RUN_LEVEL],RLf_BOOT_HEAP + + PUSH MEM_ADAM_STK + PUSH U32 SYS_FIXED_AREA+CSysFixedArea.adam + CALL &TaskInit + CALL SET_FS_BASE + MOV RSP,U64 CTask.rsp[RAX] + + JMP I32 &KernelMain + +//************************************ +USE32 +SYS_ENTER_LONG_MODE:: //Switch to long 64-bit mode + MOV_EAX_CR4 + OR EAX,0xB0 + MOV_CR4_EAX + + MOV EAX,SYS_FIXED_AREA+CSysFixedArea.pml4 + MOV_CR3_EAX + + MOV ECX,IA32_EFER + XOR EDX,EDX + MOV EAX,IA32F_LME + WRMSR + + MOV_EAX_CR0 + BTS EAX,31 //Enable paging (required for 64-bit mode) + MOV_CR0_EAX + + DU8 0xEA; //JMP CGDT.cs64:@@05 + DU32 @@05; + DU16 CGDT.cs64; +USE64 +@@05: MOV AX,CGDT.ds + MOV DS,AX + MOV ES,AX + MOV SS,AX + MOV FS,AX + MOV GS,AX + RET + +//************************************ +SYS_RAM_REBOOT:: //This gets copied high. $LK,"SYS_RAM_REBOOT",A="FF:::/Adam/Opt/Boot/BootRAM.HC,SYS_RAM_REBOOT:2"$ + PUSH U32 CGDT.ds //stk seg + PUSH U32 BOOT_RAM_LIMIT //stk + PUSH U32 0 //flags + PUSH U32 CGDT.cs32 + LEA RAX,[@@10] + PUSH RAX + IRET +USE32 +@@10: WBINVD + +//Disable paging + MOV_EAX_CR0 + BTR EAX,31 + MOV_CR0_EAX + + MOV ECX,IA32_EFER + XOR EDX,EDX + XOR EAX,EAX + WRMSR + + MOV EBX,BOOT_SRC_RAM + MOV EAX,I32 CORE0_32BIT_INIT + JMP EAX +SYS_RAM_REBOOT_END:: +USE64 +} diff --git a/Kernel/KTask.CPP b/Kernel/KTask.CPP deleted file mode 100644 index b9bbe1b..0000000 --- a/Kernel/KTask.CPP +++ /dev/null @@ -1,515 +0,0 @@ -U0 Exit() -{//Terminate own task. - if (Fs==sys_focus_task && IsDbg) { - LBts(&Fs->task_flags,TASKf_KILL_AFTER_DBG); - G; - } else { - if (!Gs->num && !IsDbg) - SingleUser(OFF); - Fs->rflags=GetRFlags; - Fs->rsp=GetRSP; - Fs->rbp=GetRBP; - Fs->rip=$$; - CLI - LBts(&Fs->task_flags,TASKf_KILL_TASK); - TaskEndNow; - } -} - -Bool TaskValidate(CTask *task) -{//return TRUE if task looks valid. - if (!(0addr!=task || - task->task_signature!=TASK_SIGNATURE_VAL) - return FALSE; - else - return TRUE; -} - -Bool Kill(CTask *task,Bool wait=TRUE) -{//Terminate other task. - I64 i; - if (TaskValidate(task) && task!=sys_winmgr_task) { - for (i=0;itask_flags,TASKf_KILL_TASK); - if (wait) { - do Yield; - while (TaskValidate(task) && Bt(&task->task_flags,TASKf_KILL_TASK)); - } - return TRUE; - } - return FALSE; -} - -Bool Suspend(CTask *task=NULL,Bool state=TRUE) -{//Tell scheduler to skip task. - Bool res; - if (!task) task=Fs; - PUSHFD - CLI - if (TaskValidate(task)) - res=LBEqu(&task->task_flags,TASKf_SUSPENDED,state); - else - res=FALSE; - POPFD - return res; -} - -Bool IsSuspended(CTask *task=NULL) -{//You might use this in a DrawIt() or Animatetask(). - if (!task) task=Fs; - if (TaskValidate(task)) - return Bt(&task->task_flags,TASKf_SUSPENDED); - else - return FALSE; -} - -CTaskStk *TaskStkNew(I64 stk_size,CTask *task) -{ - CTaskStk *temps=MAlloc(stk_size+offset(CTaskStk.stk_base),task); - temps->next_stk=NULL; - temps->stk_ptr=NULL; - temps->stk_size=MSize(temps)-offset(CTaskStk.stk_base); - return temps; -} - -#exe {Option(OPTf_NO_REG_VAR,ON);}; -argpop I64 CallStkGrow(I64 stk_size_threshold,I64 stk_size, - /*argpop*/I64 (*fp_addr)(...),...) -{//Grow stk in call with any fixed num of args. -//See $LK,"::/Demo/StkGrow.CPP"$. - CTaskStk *temps,*temps2,**_stk; - I64 res,*rsp,*rsp2,*old_stk; - - if (UnusedStk>=stk_size_threshold) { - - asm { - LEAVE - POP RAX //return addr - ADD RSP,16 //pop threshold,stk_size - POP RBX // *f - ADD RSP,8 //pop ARGC - PUSH RAX - JMP RBX //CALL fp_addr() - }; - - } else { - - temps2=TaskStkNew(stk_size,Fs); - temps2->next_stk=temps=Fs->stk; - rsp2=(&temps2->stk_base)(U8 *)+temps2->stk_size; - old_stk=rsp=&argv[argc]; - while (argc-->0) - *--rsp2=*--rsp; - _stk=&Fs->stk; - temps->stk_ptr=rsp=GetRSP; - asm { - IMPORT _FREE; //We are in a function, not at glbl scope. -//The compiler treats these in isolation. - - PUSHFD - POP RDX //flags - CLI - MOV RBX,U64 &temps2[RBP] - MOV RAX,&_stk[RBP] - MOV U64 [RAX],RBX //Fs->stk=temps2 - MOV RSP,U64 &rsp2[RBP] - PUSH RDX - POPFD - - CALL U64 &fp_addr[RBP] - MOV U64 &res[RBP],RAX - - PUSHFD - POP RDX //flags - CLI - MOV RBX,U64 &temps[RBP] - MOV RAX,&_stk[RBP] - MOV U64 [RAX],RBX //Fs->stk=temps - MOV RSP,U64 &rsp[RBP] - PUSH RDX - POPFD - - PUSH U64 &temps2[RBP] - CALL _FREE - - MOV RDX,U64 &old_stk[RBP] - MOV RBX,U64 8[RBP] - MOV RAX,U64 &res[RBP] - MOV RBP,U64 [RBP] - MOV RSP,RDX - JMP RBX //return - }; - } - return 0; //dummy to get rid of warning -} -; -#exe {Option(OPTf_NO_REG_VAR,OFF);}; - -I64 TaskInit(CTask *task,I64 stk_size) -{//Returns Fs of task - CTaskStk *temps; - - QueInit(&task->code_heap->next_mem_blk); - task->code_heap->last_mergable=NULL; - if (task->code_heap!=task->data_heap) { - QueInit(&task->data_heap->next_mem_blk); - task->data_heap->last_mergable=NULL; - } - - task->addr=task->next_task=task->last_task= - task->next_input_filter_task=task->last_input_filter_task= - task; - - task->task_num=sys_num_spawned_tasks++; - - task->rflags=RFLAGG_NORMAL; - task->win_inhibit=WIG_TASK_DFT; - - task->next_child_task=task->last_child_task= - (&task->next_child_task)(U8 *)-offset(CTask.next_sibling_task); - - SrvCtrlInit(&task->srv_ctrl); - QueInit(&task->next_cc); - QueInit(&task->next_except); - QueInit(&task->next_ctrl); - QueInit(&task->next_ode); - - task->fpu_mmx=MAllocAligned(sizeof(CFPU),0x10,task); - MemCpy(task->fpu_mmx, - SYS_FIXED_AREA+offset(CSysFixedArea.init_fpu_mmx),sizeof(CFPU)); - - task->hash_table=HashTableNew(TASK_HASH_TABLE_SIZE,task); - - if (!stk_size) - stk_size=MEM_DFT_STK; - task->stk=temps=TaskStkNew(stk_size,task); - task->rsp=(&temps->stk_base)(U8 *)+temps->stk_size; - - task->text_attr =WHITE<<4+BLUE; - task->border_src =BDS_CONST; - task->border_attr =DrvTextAttrGet(':'); - task->title_src =TTS_CONST; - task->win_left =1; - task->win_right =text.cols-2; - task->win_top =13; - task->win_bottom =text.rows-2; - - if (blkdev.home_dir) {//Beware Adam $LK,"TaskInit",A="FF:::/Kernel/KStart64.CPP,TaskInit"$. I guess ok until $LK,"ChgDsk",A="FF:::/Kernel/KEnd.CPP,ChgDsk"$(). - task->cur_dv=blkdev.let_to_drv[*blkdev.home_dir-'A']; - task->cur_dir=StrNew(blkdev.home_dir+2,task); - } else - task->cur_dir=StrNew("/Home",task); - - Seed(,task); - - return task; -} - -CTask *Spawn(U0 (*fp_start_addr)(U8 *data),U8 *data=NULL,U8 *task_name=NULL, - I64 target_cpu=-1, //-1 for current CPU. See $LK,"multi-core",A="FI:::/Demo/MultiCore/LoadTest.CPP"$. - CTask *parent=NULL, //NULL means adam - I64 stk_size=0, //0=default - I64 flags=1<=0) - return SpawnQue(fp_start_addr,data,task_name,target_cpu, - parent,stk_size,flags); - task=CAlloc(sizeof(CTask),adam_task->code_heap); - task->task_signature=TASK_SIGNATURE_VAL; - if (!task_name) task_name="Unnamed Task"; - if (!parent) parent=Gs->seth_task; - task->parent_task=parent; - task->gs=parent->gs; - if (sys_code_bp) - task->code_heap=HeapCtrlInit(,task,sys_code_bp); - if (sys_data_bp) - task->data_heap=HeapCtrlInit(,task,sys_data_bp); - else - task->data_heap=task->code_heap; - TaskInit(task,stk_size); - task->rip=fp_start_addr; - task->rsp(U8 *)-=8; - *task->rsp=data; - task->rsp(U8 *)-=8; - *task->rsp=&Exit; - task->hash_table->next=parent->hash_table; - MemCpy(task->task_name,task_name,TASK_NAME_LEN); - StrCpy(task->task_title,task->task_name); - task->title_src=TTS_TASK_NAME; - PUSHFD - CLI - if (Bt(&flags,SVCf_ADD_TO_QUE)) { - TaskQueInsChild(task); - TaskQueIns(task); - } - POPFD - return task; -} - -U0 TaskDerivedValsUpdate(CTask *task=NULL,Bool update_z_buf=TRUE) -{//Those things calculated from other variables. - if (!task) task=Fs; - PUSHFD - CLI - while (LBts(&task->task_flags,TASKf_TASK_LOCK)) - PAUSE - WinDerivedValsUpdate(task); - if (fp_update_ctrls) - (*fp_update_ctrls)(task); - if (update_z_buf && Bt(&task->display_flags,DISPLAYf_SHOW)) - LBts(&sys_semas[SYS_SEMA_UPDATE_WIN_Z_BUF],0); - LBtr(&task->task_flags,TASKf_TASK_LOCK); - POPFD -} - -I64 ExeCmdLine(CCmpCtrl *cc) -{//Terminal JIT-compile-and-execute loop for CCmpCtrl. - I64 res=0,type,old_title_src=Fs->title_src; - U8 *ptr,*ptr2,*ptr3,*machine_code,*old_task_title=StrNew(Fs->task_title); - F64 t0; - CDocEntry *doc_e; - CDoc *doc; - if (Fs->title_src!=TTS_LOCKED_CONST) - Fs->title_src=TTS_CUR_LEX; - while (cc->token && - (cc->token!='}' || !(cc->flags & CCF_EXE_BLK)) ) { - if (Fs->title_src==TTS_CUR_LEX) { - ptr2=&Fs->task_title; - ptr3=ptr2+STR_LEN-1; - if (cc->lex_include_stk->flags & LFSF_DOC) { - doc_e=cc->lex_include_stk->cur_entry; - doc=cc->lex_include_stk->doc; - while (doc_e!=doc && ptr2type_u8) { - case DOCT_TEXT: - ptr=doc_e->tag; - while (*ptr && ptr2next; - } - if (ptr2lex_include_stk->line_start) && *ptr) - MemCpy(ptr2,ptr,STR_LEN-1); - } - cc->flags&=~CCF_HAS_MISC_DATA; - machine_code=LexStmt2Bin(cc,&type); - if (machine_code!=INVALID_PTR) { - if (!(cc->flags&CCF_JUST_LOAD)) { - t0=tS; - res=Call(machine_code); - Fs->answer=res; - Fs->answer_type=type; - Fs->answer_time=tS-t0; - Fs->new_answer=TRUE; - cc->pmt_line=0; - } - if (!(cc->flags&CCF_HAS_MISC_DATA)) - Free(machine_code); - } - } - if (Fs->title_src!=TTS_LOCKED_CONST) { - Fs->title_src=old_title_src; - StrCpy(Fs->task_title,old_task_title); - } - Free(old_task_title); - if (cc->flags&CCF_JUST_LOAD) { - if (cc->error_cnt) - return FALSE; - else - return TRUE; - } else - return res; -} - -U0 SrvTaskCont() -{//Act as server task in a loop handling commands. - I64 old_flags=GetRFlags; - FlushMsgs; - while (TRUE) { - CLI - if (SrvCmdsHandler(old_flags) && Fs->title_src==TTS_TASK_NAME) - MemCpy(Fs->task_title,Fs->task_name,TASK_NAME_LEN); - FlushMsgs; - LBts(&Fs->task_flags,TASKf_IDLE); - LBts(&Fs->task_flags,TASKf_AWAITING_MSG); - Yield; - SetRFlags(old_flags); - } -} - -U0 UserTaskCont() -{//Terminal key-input-execute loop. - CCmpCtrl *cc; - CDoc *doc; - Bool cont=TRUE; - do { - cc=CmpCtrlNew(,CCF_CMD_LINE|CCF_PMT|CCF_QUESTION_HELP); - QueIns(cc,Fs->last_cc); - try { - Lex(cc); - ExeCmdLine(cc); - cont=Bt(&cc->flags,CCf_PMT); - QueRem(cc); - CmpCtrlDel(cc); - } catch { - if ((doc=Fs->put_doc) && doc->doc_signature==DOC_SIGNATURE_VAL) - DocUnlock(doc); - PutExcept; - } - } while (cont); -} - -U0 SrvCmdLine(I64 dummy=0) -{ - no_warn dummy; - Fs->win_inhibit=WIG_USER_TASK_DFT; - if (HashFind("SrvStartUp",adam_task->hash_table,HTT_FUN)) - CallExtStr("SrvStartUp"); - SrvTaskCont; -} - -U0 UserCmdLine(I64 dummy=0) -{//A user task ends-up calling this. - no_warn dummy; - Fs->win_inhibit=WIG_USER_TASK_DFT; - if (HashFind("UserStartUp",adam_task->hash_table,HTT_FUN)) - CallExtStr("UserStartUp"); - if (!LBts(&Fs->display_flags,DISPLAYf_SHOW)) - Dbg; - UserTaskCont; -} - -CTask *User(U8 *fmt=NULL,...) -{//Create user term task. - U8 *st; - CTask *task=Spawn(&UserCmdLine); - TaskWait(task); - if (fmt) { - st=StrPrintJoin(NULL,fmt,argc,argv); - XTalk(task,st); - Free(st); - } - return task; -} - -U0 TaskDel(CTask *task) -{//We delay freeing in case lingering ptr to reincarnated. - HeapCtrlDel(task->code_heap); - if (task->data_heap!=task->code_heap) - HeapCtrlDel(task->data_heap); - Free(task); -} - -I64 TaskEnd() -{//Called with irq's off. - CTask *task=Fs,*tempt,*tempt1; - if (task==sys_task_being_screen_updated) { - LBts(&task->task_flags,TASKf_KILL_TASK); - return task->next_task; - } - if (task->task_end_cb) { - task->wake_jiffy=0; - LBtr(&task->task_flags,TASKf_KILL_TASK); - TaskRstAwaitingMsg(task); - Suspend(task,FALSE); - task->rip=task->task_end_cb; - task->task_end_cb=NULL; - return task; - } - if (task->parent_task && task->parent_task->popup_task==task) { - task->parent_task->popup_task=NULL; - Kill(task->parent_task,FALSE); - return task->parent_task; - } - - DrvsRelease; - BlkDevsRelease; - tempt1=(&task->next_child_task)(U8 *)-offset(CTask.next_sibling_task); - tempt=tempt1->next_sibling_task; - if (tempt!=tempt1) { - do { - LBts(&tempt->task_flags,TASKf_KILL_TASK); - tempt=tempt->next_sibling_task; - } while (tempt!=tempt1); - return task->next_task; - } - if (LBtr(&task->display_flags,DISPLAYf_SHOW)) - LBts(&sys_semas[SYS_SEMA_UPDATE_WIN_Z_BUF],0); - - while (LBts(&task->task_flags,TASKf_TASK_LOCK)) - PAUSE - while (LBts(&task->srv_ctrl.flags,SVCRf_LOCKED)) - PAUSE - - SrvCmdQueDel(&task->srv_ctrl.next_waiting); - SrvCmdQueDel(&task->srv_ctrl.next_done); - - if (IsRaw) - VGAFlush; - - if (sys_focus_task==task) { - if (!Gs->num) - SingleUser(OFF); - sys_focus_task=NULL; - if (fp_set_std_palette) - (*fp_set_std_palette)(); - } - - //QueRem - task->task_signature(I64)=0; - - tempt =task->next_input_filter_task; - tempt1=task->last_input_filter_task; - tempt1->next_input_filter_task=tempt; - tempt ->last_input_filter_task=tempt1; - - tempt =task->next_sibling_task; - tempt1=task->last_sibling_task; - tempt1->next_sibling_task=tempt; - tempt ->last_sibling_task=tempt1; - - tempt =task->next_task; //save to return - TaskQueRem(task); - - LBtr(&task->srv_ctrl.flags,SVCRf_LOCKED); - LBtr(&task->task_flags,TASKf_TASK_LOCK); - - task->wake_jiffy=cnts.jiffies+DYING_JIFFIES; - while (LBts(&Gs->cpu_flags,CPUf_DYING_TASK_QUE)) - PAUSE - QueIns(task,Gs->last_dying); - LBtr(&Gs->cpu_flags,CPUf_DYING_TASK_QUE); - - return tempt; -} - -U0 TaskKillDying() -{//Delay freeing to prevent asking for trouble with quick reincarnations. -//What if the user is doing this: $LK,"DoTreeCheckers",A="FF:::/Misc/OSTestSuite.CPP,DoTreeCheckers"$. - CTaskDying *task,*task1; - if (Gs->kill_jiffycpu_flags,CPUf_DYING_TASK_QUE)) - PAUSE - task=Gs->next_dying; - while (task!=&Gs->next_dying && task->wake_jiffynext; - QueRem(task); - TaskDel(task); - task=task1; - } - LBtr(&Gs->cpu_flags,CPUf_DYING_TASK_QUE); - Gs->kill_jiffy=cnts.jiffies+DYING_JIFFIES; - } -} diff --git a/Kernel/KTask.HC b/Kernel/KTask.HC new file mode 100644 index 0000000..d574cbe --- /dev/null +++ b/Kernel/KTask.HC @@ -0,0 +1,527 @@ +U0 Exit() +{//Terminate own task. + if (Fs==sys_focus_task && IsDbg) { + LBts(&Fs->task_flags,TASKf_KILL_AFTER_DBG); + G; + } else { + if (!Gs->num && !IsDbg) + SingleUser(OFF); + Fs->rflags=GetRFlags; + Fs->rsp=GetRSP; + Fs->rbp=GetRBP; + Fs->rip=$$; + CLI + LBts(&Fs->task_flags,TASKf_KILL_TASK); + TaskEndNow; + } +} + +Bool TaskValidate(CTask *task) +{//return TRUE if task looks valid. + if (!(0addr!=task || + task->task_signature!=TASK_SIGNATURE_VAL) + return FALSE; + else + return TRUE; +} + +U0 BirthWait(CTask **_task,I64 task_num=-1) +{//Wait for task valid and not task_num. + while (!TaskValidate(*_task)||(*_task)->task_num==task_num) + Yield; +} + +U0 DeathWait(CTask **_task) +{//Wait for task death. + while (TaskValidate(*_task)) + Yield; +} + +Bool Kill(CTask *task,Bool wait=TRUE) +{//Terminate other task. + I64 i; + if (TaskValidate(task) && task!=sys_winmgr_task) { + for (i=0;itask_flags,TASKf_KILL_TASK); + if (wait) { + do Yield; + while (TaskValidate(task) && Bt(&task->task_flags,TASKf_KILL_TASK)); + } + return TRUE; + } + return FALSE; +} + +Bool Suspend(CTask *task=NULL,Bool state=TRUE) +{//Tell scheduler to skip task. + Bool res; + if (!task) task=Fs; + PUSHFD + CLI + if (TaskValidate(task)) + res=LBEqu(&task->task_flags,TASKf_SUSPENDED,state); + else + res=FALSE; + POPFD + return res; +} + +Bool IsSuspended(CTask *task=NULL) +{//You might use this in a DrawIt() or Animatetask(). + if (!task) task=Fs; + if (TaskValidate(task)) + return Bt(&task->task_flags,TASKf_SUSPENDED); + else + return FALSE; +} + +CTaskStk *TaskStkNew(I64 stk_size,CTask *task) +{ + CTaskStk *temps=MAlloc(stk_size+offset(CTaskStk.stk_base),task); + temps->next_stk=NULL; + temps->stk_ptr=NULL; + temps->stk_size=MSize(temps)-offset(CTaskStk.stk_base); + return temps; +} + +#exe {Option(OPTf_NO_REG_VAR,ON);}; +argpop I64 CallStkGrow(I64 stk_size_threshold,I64 stk_size, + /*argpop*/I64 (*fp_addr)(...),...) +{//Grow stk in call with any fixed num of args. +//See $LK,"::/Demo/StkGrow.HC"$. + CTaskStk *temps,*temps2,**_stk; + I64 res,*rsp,*rsp2,*old_stk; + + if (UnusedStk>=stk_size_threshold) { + + asm { + LEAVE + POP RAX //return addr + ADD RSP,16 //pop threshold,stk_size + POP RBX // *f + ADD RSP,8 //pop ARGC + PUSH RAX + JMP RBX //CALL fp_addr() + }; + + } else { + + temps2=TaskStkNew(stk_size,Fs); + temps2->next_stk=temps=Fs->stk; + rsp2=(&temps2->stk_base)(U8 *)+temps2->stk_size; + old_stk=rsp=&argv[argc]; + while (argc-->0) + *--rsp2=*--rsp; + _stk=&Fs->stk; + temps->stk_ptr=rsp=GetRSP; + asm { + IMPORT _FREE; //We are in a function, not at glbl scope. +//The compiler treats these in isolation. + + PUSHFD + POP RDX //flags + CLI + MOV RBX,U64 &temps2[RBP] + MOV RAX,&_stk[RBP] + MOV U64 [RAX],RBX //Fs->stk=temps2 + MOV RSP,U64 &rsp2[RBP] + PUSH RDX + POPFD + + CALL U64 &fp_addr[RBP] + MOV U64 &res[RBP],RAX + + PUSHFD + POP RDX //flags + CLI + MOV RBX,U64 &temps[RBP] + MOV RAX,&_stk[RBP] + MOV U64 [RAX],RBX //Fs->stk=temps + MOV RSP,U64 &rsp[RBP] + PUSH RDX + POPFD + + PUSH U64 &temps2[RBP] + CALL _FREE + + MOV RDX,U64 &old_stk[RBP] + MOV RBX,U64 8[RBP] + MOV RAX,U64 &res[RBP] + MOV RBP,U64 [RBP] + MOV RSP,RDX + JMP RBX //return + }; + } + return 0; //dummy to get rid of warning +} +; +#exe {Option(OPTf_NO_REG_VAR,OFF);}; + +I64 TaskInit(CTask *task,I64 stk_size) +{//Returns Fs of task + CTaskStk *temps; + + QueInit(&task->code_heap->next_mem_blk); + task->code_heap->last_mergable=NULL; + if (task->code_heap!=task->data_heap) { + QueInit(&task->data_heap->next_mem_blk); + task->data_heap->last_mergable=NULL; + } + + task->addr=task->next_task=task->last_task= + task->next_input_filter_task=task->last_input_filter_task= + task; + + task->task_num=sys_num_spawned_tasks++; + + task->rflags=RFLAGG_NORMAL; + task->win_inhibit=WIG_TASK_DFT; + + task->next_child_task=task->last_child_task= + (&task->next_child_task)(U8 *)-offset(CTask.next_sibling_task); + + SrvCtrlInit(&task->srv_ctrl); + QueInit(&task->next_cc); + QueInit(&task->next_except); + QueInit(&task->next_ctrl); + QueInit(&task->next_ode); + + task->fpu_mmx=MAllocAligned(sizeof(CFPU),0x10,task); + MemCpy(task->fpu_mmx, + SYS_FIXED_AREA+offset(CSysFixedArea.init_fpu_mmx),sizeof(CFPU)); + + task->hash_table=HashTableNew(TASK_HASH_TABLE_SIZE,task); + + if (!stk_size) + stk_size=MEM_DFT_STK; + task->stk=temps=TaskStkNew(stk_size,task); + task->rsp=(&temps->stk_base)(U8 *)+temps->stk_size; + + task->text_attr =WHITE<<4+BLUE; + task->border_src =BDS_CONST; + task->border_attr =DrvTextAttrGet(':'); + task->title_src =TTS_CONST; + task->win_left =1; + task->win_right =text.cols-2; + task->win_top =13; + task->win_bottom =text.rows-2; + + if (blkdev.home_dir) {//Beware Adam $LK,"TaskInit",A="FF:::/Kernel/KStart64.HC,TaskInit"$. I guess ok until $LK,"ChgDsk",A="FF:::/Kernel/KEnd.HC,ChgDsk"$(). + task->cur_dv=blkdev.let_to_drv[*blkdev.home_dir-'A']; + task->cur_dir=StrNew(blkdev.home_dir+2,task); + } else + task->cur_dir=StrNew("/Home",task); + + Seed(,task); + + return task; +} + +CTask *Spawn(U0 (*fp_start_addr)(U8 *data),U8 *data=NULL,U8 *task_name=NULL, + I64 target_cpu=-1, //-1 for current CPU. See $LK,"multi-core",A="FI:::/Demo/MultiCore/LoadTest.HC"$. + CTask *parent=NULL, //NULL means adam + I64 stk_size=0, //0=default + I64 flags=1<=0) + return SpawnQue(fp_start_addr,data,task_name,target_cpu, + parent,stk_size,flags); + task=CAlloc(sizeof(CTask),adam_task->code_heap); + task->task_signature=TASK_SIGNATURE_VAL; + if (!task_name) task_name="Unnamed Task"; + if (!parent) parent=Gs->seth_task; + task->parent_task=parent; + task->gs=parent->gs; + if (sys_code_bp) + task->code_heap=HeapCtrlInit(,task,sys_code_bp); + if (sys_data_bp) + task->data_heap=HeapCtrlInit(,task,sys_data_bp); + else + task->data_heap=task->code_heap; + TaskInit(task,stk_size); + task->rip=fp_start_addr; + task->rsp(U8 *)-=8; + *task->rsp=data; + task->rsp(U8 *)-=8; + *task->rsp=&Exit; + task->hash_table->next=parent->hash_table; + MemCpy(task->task_name,task_name,TASK_NAME_LEN); + StrCpy(task->task_title,task->task_name); + task->title_src=TTS_TASK_NAME; + PUSHFD + CLI + if (Bt(&flags,SVCf_ADD_TO_QUE)) { + TaskQueInsChild(task); + TaskQueIns(task); + } + POPFD + return task; +} + +U0 TaskDerivedValsUpdate(CTask *task=NULL,Bool update_z_buf=TRUE) +{//Those things calculated from other variables. + if (!task) task=Fs; + PUSHFD + CLI + while (LBts(&task->task_flags,TASKf_TASK_LOCK)) + PAUSE + WinDerivedValsUpdate(task); + if (fp_update_ctrls) + (*fp_update_ctrls)(task); + if (update_z_buf && Bt(&task->display_flags,DISPLAYf_SHOW)) + LBts(&sys_semas[SYS_SEMA_UPDATE_WIN_Z_BUF],0); + LBtr(&task->task_flags,TASKf_TASK_LOCK); + POPFD +} + +I64 ExeCmdLine(CCmpCtrl *cc) +{//Terminal JIT-compile-and-execute loop for CCmpCtrl. + I64 res=0,type,old_title_src=Fs->title_src; + U8 *ptr,*ptr2,*ptr3,*machine_code,*old_task_title=StrNew(Fs->task_title); + F64 t0; + CDocEntry *doc_e; + CDoc *doc; + if (Fs->title_src!=TTS_LOCKED_CONST) + Fs->title_src=TTS_CUR_LEX; + while (cc->token && + (cc->token!='}' || !(cc->flags & CCF_EXE_BLK)) ) { + if (Fs->title_src==TTS_CUR_LEX) { + ptr2=&Fs->task_title; + ptr3=ptr2+STR_LEN-1; + if (cc->lex_include_stk->flags & LFSF_DOC) { + doc_e=cc->lex_include_stk->cur_entry; + doc=cc->lex_include_stk->doc; + while (doc_e!=doc && ptr2type_u8) { + case DOCT_TEXT: + ptr=doc_e->tag; + while (*ptr && ptr2next; + } + if (ptr2lex_include_stk->line_start) && *ptr) + MemCpy(ptr2,ptr,STR_LEN-1); + } + cc->flags&=~CCF_HAS_MISC_DATA; + machine_code=LexStmt2Bin(cc,&type); + if (machine_code!=INVALID_PTR) { + if (!(cc->flags&CCF_JUST_LOAD)) { + t0=tS; + res=Call(machine_code); + Fs->answer=res; + Fs->answer_type=type; + Fs->answer_time=tS-t0; + Fs->new_answer=TRUE; + cc->pmt_line=0; + } + if (!(cc->flags&CCF_HAS_MISC_DATA)) + Free(machine_code); + } + } + if (Fs->title_src!=TTS_LOCKED_CONST) { + Fs->title_src=old_title_src; + StrCpy(Fs->task_title,old_task_title); + } + Free(old_task_title); + if (cc->flags&CCF_JUST_LOAD) { + if (cc->error_cnt) + return FALSE; + else + return TRUE; + } else + return res; +} + +U0 SrvTaskCont() +{//Act as server task in a loop handling commands. + I64 old_flags=GetRFlags; + FlushMsgs; + while (TRUE) { + CLI + if (SrvCmdsHandler(old_flags) && Fs->title_src==TTS_TASK_NAME) + MemCpy(Fs->task_title,Fs->task_name,TASK_NAME_LEN); + FlushMsgs; + LBts(&Fs->task_flags,TASKf_IDLE); + LBts(&Fs->task_flags,TASKf_AWAITING_MSG); + Yield; + SetRFlags(old_flags); + } +} + +U0 UserTaskCont() +{//Terminal key-input-execute loop. + CCmpCtrl *cc; + CDoc *doc; + Bool cont=TRUE; + do { + cc=CmpCtrlNew(,CCF_CMD_LINE|CCF_PMT|CCF_QUESTION_HELP); + QueIns(cc,Fs->last_cc); + try { + Lex(cc); + ExeCmdLine(cc); + cont=Bt(&cc->flags,CCf_PMT); + QueRem(cc); + CmpCtrlDel(cc); + } catch { + if ((doc=Fs->put_doc) && doc->doc_signature==DOC_SIGNATURE_VAL) + DocUnlock(doc); + PutExcept; + } + } while (cont); +} + +U0 SrvCmdLine(I64 dummy=0) +{ + no_warn dummy; + Fs->win_inhibit=WIG_USER_TASK_DFT; + if (HashFind("SrvStartUp",adam_task->hash_table,HTT_FUN)) + CallExtStr("SrvStartUp"); + SrvTaskCont; +} + +U0 UserCmdLine(I64 dummy=0) +{//A user task ends-up calling this. + no_warn dummy; + Fs->win_inhibit=WIG_USER_TASK_DFT; + if (HashFind("UserStartUp",adam_task->hash_table,HTT_FUN)) + CallExtStr("UserStartUp"); + if (!LBts(&Fs->display_flags,DISPLAYf_SHOW)) + Dbg; + UserTaskCont; +} + +CTask *User(U8 *fmt=NULL,...) +{//Create user term task. + U8 *st; + CTask *task=Spawn(&UserCmdLine); + TaskWait(task); + if (fmt) { + st=StrPrintJoin(NULL,fmt,argc,argv); + XTalk(task,st); + Free(st); + } + return task; +} + +U0 TaskDel(CTask *task) +{//We delay freeing in case lingering ptr to reincarnated. + HeapCtrlDel(task->code_heap); + if (task->data_heap!=task->code_heap) + HeapCtrlDel(task->data_heap); + Free(task); +} + +I64 TaskEnd() +{//Called with irq's off. + CTask *task=Fs,*tempt,*tempt1; + if (task==sys_task_being_screen_updated) { + LBts(&task->task_flags,TASKf_KILL_TASK); + return task->next_task; + } + if (task->task_end_cb) { + task->wake_jiffy=0; + LBtr(&task->task_flags,TASKf_KILL_TASK); + TaskRstAwaitingMsg(task); + Suspend(task,FALSE); + task->rip=task->task_end_cb; + task->task_end_cb=NULL; + return task; + } + if (task->parent_task && task->parent_task->popup_task==task) { + task->parent_task->popup_task=NULL; + Kill(task->parent_task,FALSE); + return task->parent_task; + } + + DrvsRelease; + BlkDevsRelease; + tempt1=(&task->next_child_task)(U8 *)-offset(CTask.next_sibling_task); + tempt=tempt1->next_sibling_task; + if (tempt!=tempt1) { + do { + LBts(&tempt->task_flags,TASKf_KILL_TASK); + tempt=tempt->next_sibling_task; + } while (tempt!=tempt1); + return task->next_task; + } + if (LBtr(&task->display_flags,DISPLAYf_SHOW)) + LBts(&sys_semas[SYS_SEMA_UPDATE_WIN_Z_BUF],0); + + while (LBts(&task->task_flags,TASKf_TASK_LOCK)) + PAUSE + while (LBts(&task->srv_ctrl.flags,SVCRf_LOCKED)) + PAUSE + + SrvCmdQueDel(&task->srv_ctrl.next_waiting); + SrvCmdQueDel(&task->srv_ctrl.next_done); + + if (IsRaw) + VGAFlush; + + if (sys_focus_task==task) { + if (!Gs->num) + SingleUser(OFF); + sys_focus_task=NULL; + if (fp_set_std_palette) + (*fp_set_std_palette)(); + } + + //QueRem + task->task_signature(I64)=0; + + tempt =task->next_input_filter_task; + tempt1=task->last_input_filter_task; + tempt1->next_input_filter_task=tempt; + tempt ->last_input_filter_task=tempt1; + + tempt =task->next_sibling_task; + tempt1=task->last_sibling_task; + tempt1->next_sibling_task=tempt; + tempt ->last_sibling_task=tempt1; + + tempt =task->next_task; //save to return + TaskQueRem(task); + + LBtr(&task->srv_ctrl.flags,SVCRf_LOCKED); + LBtr(&task->task_flags,TASKf_TASK_LOCK); + + task->wake_jiffy=cnts.jiffies+DYING_JIFFIES; + while (LBts(&Gs->cpu_flags,CPUf_DYING_TASK_QUE)) + PAUSE + QueIns(task,Gs->last_dying); + LBtr(&Gs->cpu_flags,CPUf_DYING_TASK_QUE); + + return tempt; +} + +U0 TaskKillDying() +{//Delay freeing to prevent asking for trouble with quick reincarnations. +//What if the user is doing this: $LK,"DoTreeCheckers",A="FF:::/Misc/OSTestSuite.HC,DoTreeCheckers"$. + CTaskDying *task,*task1; + if (Gs->kill_jiffycpu_flags,CPUf_DYING_TASK_QUE)) + PAUSE + task=Gs->next_dying; + while (task!=&Gs->next_dying && task->wake_jiffynext; + QueRem(task); + TaskDel(task); + task=task1; + } + LBtr(&Gs->cpu_flags,CPUf_DYING_TASK_QUE); + Gs->kill_jiffy=cnts.jiffies+DYING_JIFFIES; + } +} diff --git a/Kernel/KUtils.CPP b/Kernel/KUtils.HC similarity index 100% rename from Kernel/KUtils.CPP rename to Kernel/KUtils.HC diff --git a/Kernel/Kernel.MAP b/Kernel/Kernel.MAP index f437cfd..130e8fc 100644 --- a/Kernel/Kernel.MAP +++ b/Kernel/Kernel.MAP @@ -1,2885 +1,2893 @@ -$LK,"DrvTextAttrGet",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,312",BI=1$ -$LK,"ARGT_R64",A="FL:::/Kernel/KernelA.HPP,1897"$ -$LK,"MAlloc",A="FL:::/Kernel/Mem/MAllocFree.CPP.Z,387"$ -$LK,"BOOT_SRC_NULL",A="FL:::/Kernel/KernelA.HPP,3890"$ -$LK,"KbdTypeMatic",A="FL:::/Kernel/SerialDev/Keyboard.CPP.Z,86",BI=2$ -$LK,"KbdLEDsSet",A="FL:::/Kernel/SerialDev/Keyboard.CPP.Z,52",BI=3$ -$LK,"LXchgU32",A="FL:::/Kernel/KernelB.HPP,255"$ -$LK,"LXchgU16",A="FL:::/Kernel/KernelB.HPP,254"$ -$LK,"BDS_CUR_DRV",A="FL:::/Kernel/KernelA.HPP,3271"$ -$LK,"DOCM_CANCEL",A="FL:::/Kernel/KernelA.HPP,1341"$ -$LK,"chars_bmp_word",A="FL:::/Kernel/StrA.CPP.Z,340"$ -$LK,"BLK_SIZE",A="FL:::/Kernel/KernelA.HPP,2297"$ -$LK,"ARGT_SS",A="FL:::/Kernel/KernelA.HPP,1928"$ -$LK,"c32_eax",A="FL:::/Kernel/PCIBIOS.CPP.Z,152"$ -$LK,"ARGT_EAX",A="FL:::/Kernel/KernelA.HPP,1921"$ -$LK,"DOCT_HEADER",A="FL:::/Kernel/KernelA.HPP,912"$ -$LK,"Ff__EXTERN",A="FL:::/Kernel/KernelA.HPP,852"$ -$LK,"c32_ebx",A="FL:::/Kernel/PCIBIOS.CPP.Z,153"$ -$LK,"MemPageSize",A="FL:::/Kernel/Mem/PageTables.CPP.Z,135",BI=4$ -$LK,"D3Add",A="FL:::/Kernel/KernelB.HPP,145"$ -$LK,"D3NormSqr",A="FL:::/Kernel/KernelB.HPP,158"$ -$LK,"ARf_PLANAR_SYMMETRY",A="FL:::/Kernel/KernelA.HPP,3903"$ -$LK,"DOCf_PLAIN_TEXT_TABS",A="FL:::/Kernel/KernelA.HPP,1295"$ -$LK,"RLF_BLKDEV",A="FL:::/Kernel/KernelA.HPP,466"$ -$LK,"RLf_BLKDEV",A="FL:::/Kernel/KernelA.HPP,447"$ -$LK,"c32_ecx",A="FL:::/Kernel/PCIBIOS.CPP.Z,154"$ -$LK,"CCF_USE_LAST_U16",A="FL:::/Kernel/KernelA.HPP,2157"$ -$LK,"SYSf_CTRL_ALT_DEL",A="FL:::/Kernel/KernelA.HPP,617"$ -$LK,"SSF_INACTIVE",A="FL:::/Kernel/KernelA.HPP,223"$ -$LK,"MSF_INACTIVE",A="FL:::/Kernel/KernelA.HPP,206"$ -$LK,"ATA_READ_MULTI",A="FL:::/Kernel/KernelA.HPP,2265"$ -$LK,"c32_edx",A="FL:::/Kernel/PCIBIOS.CPP.Z,155"$ -$LK,"FUf_WHOLE_LABELS_AFTER",A="FL:::/Kernel/KernelA.HPP,2593"$ -$LK,"CAOTBinBlk",A="FL:::/Kernel/KernelA.HPP,1800"$ -$LK,"DOCEf_HAS_TERMINATOR",A="FL:::/Kernel/KernelA.HPP,1099"$ -$LK,"KernelMain",A="FL:::/Kernel/KEnd.CPP.Z,134",BI=5$ -$LK,"KbdCmdSend",A="FL:::/Kernel/SerialDev/Keyboard.CPP.Z,24",BI=6$ -$LK,"_D3_NORM_SQR",A="FL:::/Kernel/KMathA.CPP.Z,22"$ -$LK,"TTS_CUR_LEX",A="FL:::/Kernel/KernelA.HPP,3279"$ -$LK,"RS_ATTR_COMPRESSED",A="FL:::/Kernel/KernelA.HPP,2537"$ -$LK,"CCf_USE_LAST_U16",A="FL:::/Kernel/KernelA.HPP,2158"$ -$LK,"CDocEntry",A="FL:::/Kernel/KernelA.HPP,1181"$ -$LK,"CAOT",A="FL:::/Kernel/KernelA.HPP,1998"$ -$LK,"sys_gig_pages",A="FL:::/Kernel/KernelB.HPP,179"$ -$LK,"SVCf_DISPATCHED",A="FL:::/Kernel/KernelA.HPP,3185"$ -$LK,"RLF_32BIT",A="FL:::/Kernel/KernelA.HPP,459"$ -$LK,"RLF_16BIT",A="FL:::/Kernel/KernelA.HPP,457"$ -$LK,"RLf_32BIT",A="FL:::/Kernel/KernelA.HPP,440"$ -$LK,"RLf_16BIT",A="FL:::/Kernel/KernelA.HPP,438"$ -$LK,"BreakUnlock",A="FL:::/Kernel/KExcept.CPP.Z,146",BI=7$ -$LK,"DOCT_BACKGROUND",A="FL:::/Kernel/KernelA.HPP,916"$ -$LK,"DOCT_FOREGROUND",A="FL:::/Kernel/KernelA.HPP,915"$ -$LK,"CGDT",A="FL:::/Kernel/KernelA.HPP,335"$ -$LK,"TSF_SAME_SONG",A="FL:::/Kernel/KernelA.HPP,3249"$ -$LK,"ICF_PUSH_CMP",A="FL:::/Kernel/KernelA.HPP,1609"$ -$LK,"MLF_NO_UNUSED_WARN",A="FL:::/Kernel/KernelA.HPP,779"$ -$LK,"I_MP_CRASH",A="FL:::/Kernel/KernelA.HPP,294"$ -$LK,"MEM_HEAP_HASH_SIZE",A="FL:::/Kernel/KernelA.HPP,2878"$ -$LK,"INVALID_PTR",A="FL:::/Kernel/KernelA.HPP,39"$ -$LK,"RECALCt_NORMAL",A="FL:::/Kernel/KernelA.HPP,1345"$ -$LK,"ATAInit",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,303",BI=8$ -$LK,"HashDefineLstAdd",A="FL:::/Kernel/KHashB.CPP.Z,206",BI=9$ -$LK,"StrUtil",A="FL:::/Kernel/StrA.CPP.Z,524",BI=10$ -$LK,"LstMatch",A="FL:::/Kernel/StrA.CPP.Z,421",BI=11$ -$LK,"IET_REL_I32",A="FL:::/Kernel/KernelA.HPP,400"$ -$LK,"IET_REL_I16",A="FL:::/Kernel/KernelA.HPP,398"$ -$LK,"CPrsStk",A="FL:::/Kernel/KernelA.HPP,1679"$ -$LK,"CCmpCtrl",A="FL:::/Kernel/KernelA.HPP,2168"$ -$LK,"ATAWBlks",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,579",BI=12$ -$LK,"CCPU",A="FL:::/Kernel/KernelA.HPP,3446"$ -$LK,"ATABlkSel",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,1",BI=13$ -$LK,"c32_esi",A="FL:::/Kernel/PCIBIOS.CPP.Z,156"$ -$LK,"CCF_JUST_LOAD",A="FL:::/Kernel/KernelA.HPP,2134"$ -$LK,"LDF_JUST_LOAD",A="FL:::/Kernel/KernelA.HPP,368"$ -$LK,"SYS_CACHE_LINE_WIDTH",A="FL:::/Kernel/KStart32.CPP.Z,52"$ -$LK,"CMF_I16_JMP_TABLE",A="FL:::/Kernel/KernelA.HPP,1700"$ -$LK,"FramePtrSet",A="FL:::/Kernel/KHashB.CPP.Z,230",BI=14$ -$LK,"CCf_PASS_TRACE_PRESENT",A="FL:::/Kernel/KernelA.HPP,2139"$ -$LK,"CMF_U16_JMP_TABLE",A="FL:::/Kernel/KernelA.HPP,1701"$ -$LK,"_STRICMP",A="FL:::/Kernel/StrA.CPP.Z,117"$ -$LK,"IET_REL_I64",A="FL:::/Kernel/KernelA.HPP,402"$ -$LK,"CFAT32Boot",A="FL:::/Kernel/KernelA.HPP,2336"$ -$LK,"DOCEF_NO_CLICK_ON",A="FL:::/Kernel/KernelA.HPP,1022"$ -$LK,"FILEMASK_TXT",A="FL:::/Kernel/KernelA.HPP,2292"$ -$LK,"TK_EOF",A="FL:::/Kernel/KernelA.HPP,2069"$ -$LK,"SPF_NEG",A="FL:::/Kernel/KernelA.HPP,3928"$ -$LK,"CWinScroll",A="FL:::/Kernel/KernelA.HPP,3100"$ -$LK,"DOCEf_NO_CLICK_ON",A="FL:::/Kernel/KernelA.HPP,1108"$ -$LK,"ARf_FLOODFILL",A="FL:::/Kernel/KernelA.HPP,3901"$ -$LK,"ICF_USE_F64",A="FL:::/Kernel/KernelA.HPP,1597"$ -$LK,"MemPagesNotPresentMark",A="FL:::/Kernel/Mem/MemPhysical.CPP.Z,58",BI=15$ -$LK,"CH_BACKSPACE",A="FL:::/Kernel/KernelA.HPP,3514"$ -$LK,"FloorI64",A="FL:::/Kernel/KMathB.CPP.Z,52",BI=16$ -$LK,"SC_BACKSPACE",A="FL:::/Kernel/KernelA.HPP,3560"$ -$LK,"FUf_WHOLE_LABELS_BEFORE",A="FL:::/Kernel/KernelA.HPP,2592"$ -$LK,"GVF_ARRAY",A="FL:::/Kernel/KernelA.HPP,871"$ -$LK,"DirEntryCompareCluster",A="FL:::/Kernel/BlkDev/DskDirA.CPP.Z,84",BI=17$ -$LK,"KbdCmdFlush",A="FL:::/Kernel/SerialDev/Keyboard.CPP.Z,45",BI=18$ -$LK,"CFPU",A="FL:::/Kernel/KernelA.HPP,3172"$ -$LK,"TASKf_IDLE",A="FL:::/Kernel/KernelA.HPP,3285"$ -$LK,"CDIR_SIZE",A="FL:::/Kernel/KernelA.HPP,2564"$ -$LK,"ARGT_UIMM32",A="FL:::/Kernel/KernelA.HPP,1891"$ -$LK,"ARGT_UIMM16",A="FL:::/Kernel/KernelA.HPP,1890"$ -$LK,"PCIWriteU8",A="FL:::/Kernel/PCIBIOS.CPP.Z,220",BI=19$ -$LK,"DefinePrint",A="FL:::/Kernel/KDefine.CPP.Z,90",BI=20$ -$LK,"FifoI64Del",A="FL:::/Kernel/KDataTypes.CPP.Z,252",BI=21$ -$LK,"CDocUndo",A="FL:::/Kernel/KernelA.HPP,1333"$ -$LK,"ROPB_XOR",A="FL:::/Kernel/KernelA.HPP,2934"$ -$LK,"FUF_JUST_FILES",A="FL:::/Kernel/KernelA.HPP,2607"$ -$LK,"ATA_SET_MAX",A="FL:::/Kernel/KernelA.HPP,2263"$ -$LK,"IEF_DFT",A="FL:::/Kernel/KernelA.HPP,1731"$ -$LK,"RT_F32",A="FL:::/Kernel/KernelA.HPP,1564"$ -$LK,"Let2BlkDev",A="FL:::/Kernel/BlkDev/DskBlkDev.CPP.Z,175",BI=22$ -$LK,"FUf_JUST_FILES",A="FL:::/Kernel/KernelA.HPP,2581"$ -$LK,"ARGT_M1632",A="FL:::/Kernel/KernelA.HPP,1909"$ -$LK,"DOF_MIN_SIZE",A="FL:::/Kernel/KernelA.HPP,1215"$ -$LK,"DOCEF_LEFT_X",A="FL:::/Kernel/KernelA.HPP,987"$ -$LK,"RFLAGf_AUX_CARRY",A="FL:::/Kernel/KernelA.HPP,309"$ -$LK,"DEF_PROCESSED",A="FL:::/Kernel/KernelA.HPP,2548"$ -$LK,"WIf_FOCUS_TASK_IP_L_D",A="FL:::/Kernel/KernelA.HPP,1451"$ -$LK,"DOCEf_LEFT_X",A="FL:::/Kernel/KernelA.HPP,1075"$ -$LK,"Mem64DevFree",A="FL:::/Kernel/Mem/MemPhysical.CPP.Z,150",BI=23$ -$LK,"Mem32DevFree",A="FL:::/Kernel/Mem/MemPhysical.CPP.Z,114",BI=24$ -$LK,"SYS_GIG_PAGES",A="FL:::/Kernel/KStart32.CPP.Z,22"$ -$LK,"ARGT_UIMM64",A="FL:::/Kernel/KernelA.HPP,1892"$ -$LK,"DOCf_MIN_SIZE",A="FL:::/Kernel/KernelA.HPP,1303"$ -$LK,"DOCF_MIN_SIZE",A="FL:::/Kernel/KernelA.HPP,1267"$ -$LK,"ATARepEntry",A="FL:::/Kernel/BlkDev/DskATAId.CPP.Z,91",BI=25$ -$LK,"BLUE",A="FL:::/Kernel/KernelA.HPP,2959"$ -$LK,"sys_ctrl_alt_flags",A="FL:::/Kernel/KernelB.HPP,203"$ -$LK,"D3Div",A="FL:::/Kernel/KernelB.HPP,151"$ -$LK,"RT_F64",A="FL:::/Kernel/KernelA.HPP,1566"$ -$LK,"EdLite",A="FL:::/Kernel/EdLite.CPP.Z,58",BI=26$ -$LK,"MBR_PT_FAT12",A="FL:::/Kernel/KernelA.HPP,2699"$ -$LK,"FramePtr",A="FL:::/Kernel/KHashB.CPP.Z,215",BI=27$ -$LK,"ARGT_RM8",A="FL:::/Kernel/KernelA.HPP,1899"$ -$LK,"ROPF_PROBABILITY_DITHER",A="FL:::/Kernel/KernelA.HPP,2954"$ -$LK,"RTF_UNSIGNED",A="FL:::/Kernel/KernelA.HPP,1569"$ -$LK,"DOCEF_HAS_BORDER",A="FL:::/Kernel/KernelA.HPP,1002"$ -$LK,"TK_EQU_EQU",A="FL:::/Kernel/KernelA.HPP,2084"$ -$LK,"RT_I32",A="FL:::/Kernel/KernelA.HPP,1559"$ -$LK,"RT_I16",A="FL:::/Kernel/KernelA.HPP,1557"$ -$LK,"DOCEf_HAS_BORDER",A="FL:::/Kernel/KernelA.HPP,1090"$ -$LK,"SysTry",A="FL:::/Kernel/KExcept.CPP.Z,63",BI=28$ -$LK,"POP_REGS",A="FL:::/Kernel/KernelA.HPP,1771"$ -$LK,"IEF_OP_SIZE32",A="FL:::/Kernel/KernelA.HPP,1728"$ -$LK,"IEF_OP_SIZE16",A="FL:::/Kernel/KernelA.HPP,1727"$ -$LK,"HTT_INTERNAL_TYPE",A="FL:::/Kernel/KernelA.HPP,687"$ -$LK,"BD_SIGNATURE_VAL",A="FL:::/Kernel/KernelA.HPP,2661"$ -$LK,"DOCEf_ESC",A="FL:::/Kernel/KernelA.HPP,1087"$ -$LK,"ScanCode2Char",A="FL:::/Kernel/SerialDev/Keyboard.CPP.Z,136",BI=29$ -$LK,"NUM_DRVS",A="FL:::/Kernel/KernelA.HPP,2715"$ -$LK,"FSt_ISO13346",A="FL:::/Kernel/KernelA.HPP,2691"$ -$LK,"_D3_ADD",A="FL:::/Kernel/KMathA.CPP.Z,131"$ -$LK,"SYSf_CTRL_ALT_TAB",A="FL:::/Kernel/KernelA.HPP,620"$ -$LK,"RCache",A="FL:::/Kernel/BlkDev/DskCache.CPP.Z,119",BI=30$ -$LK,"DOC_ATTR_DFT_TEXT",A="FL:::/Kernel/KernelA.HPP,1134"$ -$LK,"D3Dot",A="FL:::/Kernel/KernelB.HPP,153"$ -$LK,"CSrvCmd",A="FL:::/Kernel/KernelA.HPP,3196"$ -$LK,"ARGT_RAX",A="FL:::/Kernel/KernelA.HPP,1922"$ -$LK,"EDf_WAS_WRITE",A="FL:::/Kernel/KernelA.HPP,1255"$ -$LK,"EDF_WAS_WRITE",A="FL:::/Kernel/KernelA.HPP,1249"$ -$LK,"DOCF_NO_SCROLL_BARS",A="FL:::/Kernel/KernelA.HPP,1270"$ -$LK,"KbdMsgsQue",A="FL:::/Kernel/SerialDev/Keyboard.CPP.Z,467",BI=31$ -$LK,"ARGT_ST0",A="FL:::/Kernel/KernelA.HPP,1935"$ -$LK,"RT_I64",A="FL:::/Kernel/KernelA.HPP,1561"$ -$LK,"FifoI64Cnt",A="FL:::/Kernel/KDataTypes.CPP.Z,312",BI=32$ -$LK,"NUM_PROGRESS_BARS",A="FL:::/Kernel/KernelA.HPP,3910"$ -$LK,"SUF_SAFE_DOLLAR",A="FL:::/Kernel/KernelA.HPP,3803"$ -$LK,"RWF_SHOW_DOLLAR",A="FL:::/Kernel/KernelA.HPP,3600"$ -$LK,"_CFG_HEAP_DBG",A="FL:::/Kernel/KernelA.HPP,2797"$ -$LK,"HTt_INTERNAL_TYPE",A="FL:::/Kernel/KernelA.HPP,657"$ -$LK,"RedSeaFileWrite",A="FL:::/Kernel/BlkDev/FileSysRedSea.CPP.Z,511",BI=33$ -$LK,"AutoStr",A="FL:::/Kernel/SrvCmd.CPP.Z,465",BI=34$ -$LK,"CPatchTableAbsAddr",A="FL:::/Kernel/KernelA.HPP,383"$ -$LK,"DVDImageRead",A="FL:::/Kernel/BlkDev/DskCDDVD.CPP.Z,69",BI=35$ -$LK,"FSt_ISO13490",A="FL:::/Kernel/KernelA.HPP,2690"$ -$LK,"IET_CODE_HEAP",A="FL:::/Kernel/KernelA.HPP,411"$ -$LK,"ROPB_MONO",A="FL:::/Kernel/KernelA.HPP,2936"$ -$LK,"CAsmNum2",A="FL:::/Kernel/KernelA.HPP,1827"$ -$LK,"AutoFile",A="FL:::/Kernel/SrvCmd.CPP.Z,475",BI=36$ -$LK,"AMAlloc",A="FL:::/Kernel/Mem/MAllocFree.CPP.Z,390",BI=37$ -$LK,"ICF_R_TO_INT",A="FL:::/Kernel/KernelA.HPP,1592"$ -$LK,"DOCEf_LEN",A="FL:::/Kernel/KernelA.HPP,1054"$ -$LK,"B",A="FL:::/Kernel/KDbg.CPP.Z,407",BI=38$ -$LK,"ICF_PUSH_RES",A="FL:::/Kernel/KernelA.HPP,1604"$ -$LK,"chars_bmp_dec_numeric",A="FL:::/Kernel/StrA.CPP.Z,350"$ -$LK,"D3Equ",A="FL:::/Kernel/KernelB.HPP,154"$ -$LK,"FF_NEW_FILE",A="FL:::/Kernel/KernelA.HPP,2781"$ -$LK,"CMT_STR_CONST",A="FL:::/Kernel/KernelA.HPP,1690"$ -$LK,"WIf_FOCUS_TASK_IP_R_D",A="FL:::/Kernel/KernelA.HPP,1453"$ -$LK,"D",A="FL:::/Kernel/KDbg.CPP.Z,172",BI=39$ -$LK,"StrPrint",A="FL:::/Kernel/StrPrint.CPP.Z,876",BI=40$ -$LK,"WINMGR_FPS",A="FL:::/Kernel/KernelA.HPP,1467"$ -$LK,"E",A="FL:::/Kernel/FunSeg.CPP.Z,310",BI=41$ -$LK,"ICF_A2_TO_INT",A="FL:::/Kernel/KernelA.HPP,1596"$ -$LK,"CEdFileName",A="FL:::/Kernel/KernelA.HPP,1240"$ -$LK,"DOCT_LEFT_MARGIN",A="FL:::/Kernel/KernelA.HPP,910"$ -$LK,"_STRNCMP",A="FL:::/Kernel/StrA.CPP.Z,154"$ -$LK,"MEM_NUM_USED_1GIG",A="FL:::/Kernel/KernelA.HPP,3469"$ -$LK,"G",A="FL:::/Kernel/KDbg.CPP.Z,444",BI=42$ -$LK,"ScaleIndent",A="FL:::/Kernel/StrB.CPP.Z,35",BI=43$ -$LK,"IET_ABS_ADDR",A="FL:::/Kernel/KernelA.HPP,410"$ -$LK,"PressAKey",A="FL:::/Kernel/StrB.CPP.Z,103",BI=44$ -$LK,"DOF_WIN_MAX",A="FL:::/Kernel/KernelA.HPP,1218"$ -$LK,"CCodeCtrl",A="FL:::/Kernel/KernelA.HPP,2017"$ -$LK,"Char2ScanCode",A="FL:::/Kernel/SerialDev/Keyboard.CPP.Z,100",BI=45$ -$LK,"Mem32DevInit",A="FL:::/Kernel/Mem/MemPhysical.CPP.Z,30",BI=46$ -$LK,"_BIT_FIELD_OR_U32",A="FL:::/Kernel/KUtils.CPP.Z,154"$ -$LK,"DOCf_NO_SCROLL_BARS",A="FL:::/Kernel/KernelA.HPP,1306"$ -$LK,"SPutChar",A="FL:::/Kernel/StrPrint.CPP.Z,1",BI=47$ -$LK,"TaskQueIns",A="FL:::/Kernel/Sched.CPP.Z,287",BI=48$ -$LK,"CYAN",A="FL:::/Kernel/KernelA.HPP,2961"$ -$LK,"TK_SUPERSCRIPT",A="FL:::/Kernel/KernelA.HPP,2070"$ -$LK,"FileNameTempTxt",A="FL:::/Kernel/BlkDev/DskStrA.CPP.Z,272",BI=49$ -$LK,"RS_ATTR_DELETED",A="FL:::/Kernel/KernelA.HPP,2535"$ -$LK,"CMT_ASM_LABEL",A="FL:::/Kernel/KernelA.HPP,1688"$ -$LK,"RLF_64BIT",A="FL:::/Kernel/KernelA.HPP,461"$ -$LK,"RLf_64BIT",A="FL:::/Kernel/KernelA.HPP,442"$ -$LK,"RedSeaFreeLstBuild",A="FL:::/Kernel/BlkDev/FileSysRedSea.CPP.Z,24",BI=50$ -$LK,"TK_SHL",A="FL:::/Kernel/KernelA.HPP,2082"$ -$LK,"DOCf_HAS_SONG",A="FL:::/Kernel/KernelA.HPP,1309"$ -$LK,"DOCF_HAS_SONG",A="FL:::/Kernel/KernelA.HPP,1273"$ -$LK,"CH_CTRLA",A="FL:::/Kernel/KernelA.HPP,3487"$ -$LK,"CHashGlblVar",A="FL:::/Kernel/KernelA.HPP,873"$ -$LK,"CH_CTRLB",A="FL:::/Kernel/KernelA.HPP,3488"$ -$LK,"MEM_NUM_1GIG",A="FL:::/Kernel/KernelA.HPP,3470"$ -$LK,"DOCEf_TAG",A="FL:::/Kernel/KernelA.HPP,1053"$ -$LK,"S",A="FL:::/Kernel/KDbg.CPP.Z,479",BI=51$ -$LK,"CH_CTRLC",A="FL:::/Kernel/KernelA.HPP,3489"$ -$LK,"FifoI64Ins",A="FL:::/Kernel/KDataTypes.CPP.Z,258",BI=52$ -$LK,"FloorU64",A="FL:::/Kernel/KMathB.CPP.Z,36",BI=53$ -$LK,"CH_CTRLD",A="FL:::/Kernel/KernelA.HPP,3490"$ -$LK,"DOCF_WORD_WRAP",A="FL:::/Kernel/KernelA.HPP,1282"$ -$LK,"DOCT_WORD_WRAP",A="FL:::/Kernel/KernelA.HPP,919"$ -$LK,"CH_CTRLE",A="FL:::/Kernel/KernelA.HPP,3491"$ -$LK,"BLACK",A="FL:::/Kernel/KernelA.HPP,2958"$ -$LK,"ARGT_STI",A="FL:::/Kernel/KernelA.HPP,1936"$ -$LK,"NUM_REGS",A="FL:::/Kernel/KernelA.HPP,1774"$ -$LK,"DOCf_WORD_WRAP",A="FL:::/Kernel/KernelA.HPP,1319"$ -$LK,"DOCEf_BOTTOM_Y",A="FL:::/Kernel/KernelA.HPP,1080"$ -$LK,"DOCEF_BOTTOM_Y",A="FL:::/Kernel/KernelA.HPP,992"$ -$LK,"FileNameAbs",A="FL:::/Kernel/BlkDev/DskStrA.CPP.Z,167",BI=54$ -$LK,"CH_CTRLF",A="FL:::/Kernel/KernelA.HPP,3492"$ -$LK,"TK_SHR",A="FL:::/Kernel/KernelA.HPP,2083"$ -$LK,"AutoMountIDE",A="FL:::/Kernel/BlkDev/DskATAId.CPP.Z,254",BI=55$ -$LK,"CH_CTRLG",A="FL:::/Kernel/KernelA.HPP,3493"$ -$LK,"DOCEF_REMALLOC_DATA",A="FL:::/Kernel/KernelA.HPP,1012"$ -$LK,"_HASH_REM_DEL",A="FL:::/Kernel/KHashA.CPP.Z,208"$ -$LK,"TaskQueRem",A="FL:::/Kernel/Sched.CPP.Z,301",BI=56$ -$LK,"CH_CTRLH",A="FL:::/Kernel/KernelA.HPP,3494"$ -$LK,"CPalindromeU32",A="FL:::/Kernel/KernelA.HPP,2416"$ -$LK,"CPalindromeU16",A="FL:::/Kernel/KernelA.HPP,2411"$ -$LK,"DOCT_CHECK_BOX",A="FL:::/Kernel/KernelA.HPP,931"$ -$LK,"CH_CTRLI",A="FL:::/Kernel/KernelA.HPP,3495"$ -$LK,"FifoI64New",A="FL:::/Kernel/KDataTypes.CPP.Z,240",BI=57$ -$LK,"CH_CTRLJ",A="FL:::/Kernel/KernelA.HPP,3496"$ -$LK,"ARGT_XMM128",A="FL:::/Kernel/KernelA.HPP,1945"$ -$LK,"SC_CURSOR_UP",A="FL:::/Kernel/KernelA.HPP,3569"$ -$LK,"CH_CTRLK",A="FL:::/Kernel/KernelA.HPP,3497"$ -$LK,"TASKf_HAS_SONG",A="FL:::/Kernel/KernelA.HPP,3288"$ -$LK,"DOCEf_SEL",A="FL:::/Kernel/KernelA.HPP,1049"$ -$LK,"RandI32",A="FL:::/Kernel/KMathB.CPP.Z,90",BI=58$ -$LK,"RandI16",A="FL:::/Kernel/KMathB.CPP.Z,74",BI=59$ -$LK,"CH_CTRLL",A="FL:::/Kernel/KernelA.HPP,3498"$ -$LK,"CH_CTRLM",A="FL:::/Kernel/KernelA.HPP,3499"$ -$LK,"ICf_LOCK",A="FL:::/Kernel/KernelA.HPP,1616"$ -$LK,"ICF_LOCK",A="FL:::/Kernel/KernelA.HPP,1615"$ -$LK,"PutFileLink",A="FL:::/Kernel/BlkDev/DskDirA.CPP.Z,163",BI=60$ -$LK,"BreakLock",A="FL:::/Kernel/KExcept.CPP.Z,140",BI=61$ -$LK,"HPET",A="FL:::/Kernel/KMisc.CPP.Z,80",BI=62$ -$LK,"CORE0_32BIT_INIT",A="FL:::/Kernel/KStart32.CPP.Z,57"$ -$LK,"CORE0_16BIT_INIT",A="FL:::/Kernel/KStart16.CPP.Z,56"$ -$LK,"CH_CTRLN",A="FL:::/Kernel/KernelA.HPP,3500"$ -$LK,"BDf_FMT",A="FL:::/Kernel/KernelA.HPP,2653"$ -$LK,"CCF_KEEP_DOT",A="FL:::/Kernel/KernelA.HPP,2136"$ -$LK,"Let2BlkDevType",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,161",BI=63$ -$LK,"CH_CTRLO",A="FL:::/Kernel/KernelA.HPP,3501"$ -$LK,"ARGT_XMM",A="FL:::/Kernel/KernelA.HPP,1941"$ -$LK,"DOCEf_REMALLOC_DATA",A="FL:::/Kernel/KernelA.HPP,1098"$ -$LK,"DOCEf_WIN_REL",A="FL:::/Kernel/KernelA.HPP,1085"$ -$LK,"DOCEF_WIN_REL",A="FL:::/Kernel/KernelA.HPP,997"$ -$LK,"FifoI64Rem",A="FL:::/Kernel/KDataTypes.CPP.Z,275",BI=64$ -$LK,"_D3_DIV",A="FL:::/Kernel/KMathA.CPP.Z,184"$ -$LK,"CH_CTRLP",A="FL:::/Kernel/KernelA.HPP,3502"$ -$LK,"chars_bmp_non_eol",A="FL:::/Kernel/StrA.CPP.Z,396"$ -$LK,"CH_CTRLQ",A="FL:::/Kernel/KernelA.HPP,3503"$ -$LK,"CTSS",A="FL:::/Kernel/KernelA.HPP,3410"$ -$LK,"HomeSet",A="FL:::/Kernel/BlkDev/DskDirB.CPP.Z,1",BI=65$ -$LK,"FileNameChk",A="FL:::/Kernel/BlkDev/DskStrA.CPP.Z,245",BI=66$ -$LK,"D3Mul",A="FL:::/Kernel/KernelB.HPP,155"$ -$LK,"CH_CTRLR",A="FL:::/Kernel/KernelA.HPP,3504"$ -$LK,"SK_NAME",A="FL:::/Kernel/BlkDev/DskDirA.CPP.Z,89"$ -$LK,"CtrlAltC",A="FL:::/Kernel/KeyDev.CPP.Z,133",BI=67$ -$LK,"CallerRep",A="FL:::/Kernel/KDbg.CPP.Z,152",BI=68$ -$LK,"CH_CTRLS",A="FL:::/Kernel/KernelA.HPP,3505"$ -$LK,"ROP_EQU",A="FL:::/Kernel/KernelA.HPP,2942"$ -$LK,"DOCEf_LST",A="FL:::/Kernel/KernelA.HPP,1103"$ -$LK,"CtrlAltD",A="FL:::/Kernel/KeyDev.CPP.Z,138",BI=69$ -$LK,"RandI64",A="FL:::/Kernel/KMathB.CPP.Z,106",BI=70$ -$LK,"CH_CTRLT",A="FL:::/Kernel/KernelA.HPP,3506"$ -$LK,"MBS_UNUSED_SIGNATURE_VAL",A="FL:::/Kernel/KernelA.HPP,2857"$ -$LK,"CCmpGlbls",A="FL:::/Kernel/KernelA.HPP,2215"$ -$LK,"RT_U32",A="FL:::/Kernel/KernelA.HPP,1560"$ -$LK,"RT_U16",A="FL:::/Kernel/KernelA.HPP,1558"$ -$LK,"CExternUsage",A="FL:::/Kernel/KernelA.HPP,817"$ -$LK,"FAT32FreeClusters",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,413",BI=71$ -$LK,"CH_CTRLU",A="FL:::/Kernel/KernelA.HPP,3507"$ -$LK,"ARGT_MM32",A="FL:::/Kernel/KernelA.HPP,1939"$ -$LK,"DOCSS_COMMENT",A="FL:::/Kernel/KernelA.HPP,1131"$ -$LK,"CtrlAltF",A="FL:::/Kernel/KeyDev.CPP.Z,148",BI=72$ -$LK,"ip_grid",A="FL:::/Kernel/KGlbls.CPP.Z,23"$ -$LK,"CH_CTRLV",A="FL:::/Kernel/KernelA.HPP,3508"$ -$LK,"CCodeMisc",A="FL:::/Kernel/KernelA.HPP,1705"$ -$LK,"DOF_DONT_TEXT_ATTR",A="FL:::/Kernel/KernelA.HPP,1219"$ -$LK,"DOCEf_WORD_WRAP",A="FL:::/Kernel/KernelA.HPP,1046"$ -$LK,"DOCEF_WORD_WRAP",A="FL:::/Kernel/KernelA.HPP,1040"$ -$LK,"DrvFATBlkSet",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,117",BI=73$ -$LK,"ISODrvInit",A="FL:::/Kernel/BlkDev/DskCDDVD.CPP.Z,5",BI=74$ -$LK,"CH_CTRLW",A="FL:::/Kernel/KernelA.HPP,3509"$ -$LK,"FFB_NEXT_BLK",A="FL:::/Kernel/KernelA.HPP,2778"$ -$LK,"ISO1FromName",A="FL:::/Kernel/BlkDev/FileSysISO.CPP.Z,28",BI=75$ -$LK,"MPIntAll",A="FL:::/Kernel/MultiProc.CPP.Z,149",BI=76$ -$LK,"TaskContextRestore",A="FL:::/Kernel/Sched.CPP.Z,283"$ -$LK,"SCf_ALT",A="FL:::/Kernel/KernelA.HPP,3529"$ -$LK,"CH_CTRLX",A="FL:::/Kernel/KernelA.HPP,3510"$ -$LK,"CH_CTRLY",A="FL:::/Kernel/KernelA.HPP,3511"$ -$LK,"CDoc",A="FL:::/Kernel/KernelA.HPP,1354"$ -$LK,"MemSetU8",A="FL:::/Kernel/KernelB.HPP,178"$ -$LK,"_FCLEX",A="FL:::/Kernel/KMathA.CPP.Z,646"$ -$LK,"_D3_DOT",A="FL:::/Kernel/KMathA.CPP.Z,113"$ -$LK,"ARf_CSPRITE_INS_CLIPBOARD",A="FL:::/Kernel/KernelA.HPP,3902"$ -$LK,"CH_CTRLZ",A="FL:::/Kernel/KernelA.HPP,3512"$ -$LK,"MEM_NUM_2MEG",A="FL:::/Kernel/KernelA.HPP,3468"$ -$LK,"CHashGeneric",A="FL:::/Kernel/KernelA.HPP,733"$ -$LK,"SYS_FIND_PCIBIOS_SERVICE_DIR",A="FL:::/Kernel/PCIBIOS.CPP.Z,8"$ -$LK,"CTRLF_CLICKED",A="FL:::/Kernel/KernelA.HPP,3096"$ -$LK,"HTF_RESOLVE",A="FL:::/Kernel/KernelA.HPP,707"$ -$LK,"BCnt",A="FL:::/Kernel/KMisc.CPP.Z,39",BI=77$ -$LK,"Mem64DevAlloc",A="FL:::/Kernel/Mem/MemPhysical.CPP.Z,131",BI=78$ -$LK,"Mem32DevAlloc",A="FL:::/Kernel/Mem/MemPhysical.CPP.Z,81",BI=79$ -$LK,"RT_U64",A="FL:::/Kernel/KernelA.HPP,1563"$ -$LK,"DOCT_TAB",A="FL:::/Kernel/KernelA.HPP,903"$ -$LK,"HTT_FRAME_PTR",A="FL:::/Kernel/KernelA.HPP,698"$ -$LK,"HTt_FRAME_PTR",A="FL:::/Kernel/KernelA.HPP,668"$ -$LK,"ISO1FilesFind",A="FL:::/Kernel/BlkDev/FileSysISO.CPP.Z,173",BI=80$ -$LK,"CtrlAltM",A="FL:::/Kernel/KeyDev.CPP.Z,153",BI=81$ -$LK,"DefineLstLoad",A="FL:::/Kernel/KDefine.CPP.Z,13",BI=82$ -$LK,"ARGT_MM64",A="FL:::/Kernel/KernelA.HPP,1940"$ -$LK,"DOCEf_LEFT_CB",A="FL:::/Kernel/KernelA.HPP,1071"$ -$LK,"DOCEF_LEFT_CB",A="FL:::/Kernel/KernelA.HPP,983"$ -$LK,"RFLAGf_DIR",A="FL:::/Kernel/KernelA.HPP,314"$ -$LK,"ClusterNumNext",A="FL:::/Kernel/BlkDev/DskCluster.CPP.Z,1",BI=83$ -$LK,"KbdMouseEvtTime",A="FL:::/Kernel/SerialDev/Keyboard.CPP.Z,486",BI=84$ -$LK,"CtrlAltN",A="FL:::/Kernel/KeyDev.CPP.Z,158",BI=85$ -$LK,"ip_last",A="FL:::/Kernel/KGlbls.CPP.Z,24"$ -$LK,"CDirEntry",A="FL:::/Kernel/KernelA.HPP,2552"$ -$LK,"TK_STR",A="FL:::/Kernel/KernelA.HPP,2074"$ -$LK,"ACD_DEF_END",A="FL:::/Kernel/KernelA.HPP,1506"$ -$LK,"PROGRESS_DESC_LEN",A="FL:::/Kernel/KernelA.HPP,3911"$ -$LK,"CCF_ASM_EXPRESSIONS",A="FL:::/Kernel/KernelA.HPP,2146"$ -$LK,"D3Sub",A="FL:::/Kernel/KernelB.HPP,159"$ -$LK,"SC_CURSOR_RIGHT",A="FL:::/Kernel/KernelA.HPP,3572"$ -$LK,"KeyDevAdd",A="FL:::/Kernel/KeyDev.CPP.Z,70",BI=86$ -$LK,"CTRLF_BORDER",A="FL:::/Kernel/KernelA.HPP,3093"$ -$LK,"_D3_EQU",A="FL:::/Kernel/KMathA.CPP.Z,226"$ -$LK,"VGAP_ATTR_DATA_READ",A="FL:::/Kernel/KernelA.HPP,3732"$ -$LK,"ATA_PACKET",A="FL:::/Kernel/KernelA.HPP,2260"$ -$LK,"HTF_LOCAL",A="FL:::/Kernel/KernelA.HPP,709"$ -$LK,"HTT_ASM_KEYWORD",A="FL:::/Kernel/KernelA.HPP,692"$ -$LK,"HTf_LOCAL",A="FL:::/Kernel/KernelA.HPP,679"$ -$LK,"CtrlAltT",A="FL:::/Kernel/KeyDev.CPP.Z,163",BI=87$ -$LK,"IsSilent",A="FL:::/Kernel/KMisc.CPP.Z,228",BI=88$ -$LK,"CBpt",A="FL:::/Kernel/KernelA.HPP,3158"$ -$LK,"HTt_ASM_KEYWORD",A="FL:::/Kernel/KernelA.HPP,662"$ -$LK,"PCIWriteU32",A="FL:::/Kernel/PCIBIOS.CPP.Z,250",BI=89$ -$LK,"PCIWriteU16",A="FL:::/Kernel/PCIBIOS.CPP.Z,235",BI=90$ -$LK,"CtrlAltV",A="FL:::/Kernel/KeyDev.CPP.Z,168",BI=91$ -$LK,"CISO1DirEntry",A="FL:::/Kernel/KernelA.HPP,2458"$ -$LK,"_LXCHG_U8",A="FL:::/Kernel/KUtils.CPP.Z,244"$ -$LK,"CtrlAltX",A="FL:::/Kernel/KeyDev.CPP.Z,173",BI=92$ -$LK,"ChgDsk",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,230",BI=93$ -$LK,"UserTaskCont",A="FL:::/Kernel/KTask.CPP.Z,352",BI=94$ -$LK,"RFLAGf_NESTED_TASK",A="FL:::/Kernel/KernelA.HPP,318"$ -$LK,"BEqu",A="FL:::/Kernel/KernelB.HPP,28"$ -$LK,"ISO1T_PRI_VOL_DESC",A="FL:::/Kernel/KernelA.HPP,2479"$ -$LK,"FAT32MkDir",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,933",BI=95$ -$LK,"DCS_SIGNATURE_VAL",A="FL:::/Kernel/KernelA.HPP,3652"$ -$LK,"ICF_USE_INT",A="FL:::/Kernel/KernelA.HPP,1599"$ -$LK,"DOCT_NEW_LINE",A="FL:::/Kernel/KernelA.HPP,901"$ -$LK,"BIN_SIGNATURE_VAL",A="FL:::/Kernel/KernelA.HPP,371"$ -$LK,"ARGT_IMM8",A="FL:::/Kernel/KernelA.HPP,1884"$ -$LK,"SYS_HASH_SINGLE_TABLE_FIND1",A="FL:::/Kernel/KHashA.CPP.Z,30"$ -$LK,"DOC_SIGNATURE_VAL",A="FL:::/Kernel/KernelA.HPP,1343"$ -$LK,"DOCEF_INVERT",A="FL:::/Kernel/KernelA.HPP,1042"$ -$LK,"CDateStruct",A="FL:::/Kernel/KernelA.HPP,192"$ -$LK,"CHashFun",A="FL:::/Kernel/KernelA.HPP,856"$ -$LK,"SV_I_REG",A="FL:::/Kernel/KernelA.HPP,1741"$ -$LK,"DOCEf_INVERT",A="FL:::/Kernel/KernelA.HPP,1048"$ -$LK,"DayOfWeek",A="FL:::/Kernel/KDate.CPP.Z,30",BI=96$ -$LK,"CDrv",A="FL:::/Kernel/KernelA.HPP,2718"$ -$LK,"TK_MINUS_MINUS",A="FL:::/Kernel/KernelA.HPP,2079"$ -$LK,"DOCT_LST",A="FL:::/Kernel/KernelA.HPP,932"$ -$LK,"JobResGet",A="FL:::/Kernel/SrvCmd.CPP.Z,198",BI=97$ -$LK,"sys_heap_init_flag",A="FL:::/Kernel/KernelB.HPP,181"$ -$LK,"FUF_CANCEL",A="FL:::/Kernel/KernelA.HPP,2599"$ -$LK,"FUf_CANCEL",A="FL:::/Kernel/KernelA.HPP,2573"$ -$LK,"FALSE",A="FL:::/Kernel/KernelA.HPP,20"$ -$LK,"VGAP_REG_READ",A="FL:::/Kernel/KernelA.HPP,3737"$ -$LK,"SVCf_ADD_TO_QUE",A="FL:::/Kernel/KernelA.HPP,3187"$ -$LK,"CUAsmGlbls",A="FL:::/Kernel/KernelA.HPP,2230"$ -$LK,"TK_ADD_EQU",A="FL:::/Kernel/KernelA.HPP,2098"$ -$LK,"TK_XOR_EQU",A="FL:::/Kernel/KernelA.HPP,2097"$ -$LK,"StrPrintHex",A="FL:::/Kernel/StrA.CPP.Z,1",BI=98$ -$LK,"_D3_ADD_EQU",A="FL:::/Kernel/KMathA.CPP.Z,239"$ -$LK,"DRV_SIGNATURE_VAL",A="FL:::/Kernel/KernelA.HPP,2717"$ -$LK,"DOCT_PMT",A="FL:::/Kernel/KernelA.HPP,907"$ -$LK,"Cf_EXTERN",A="FL:::/Kernel/KernelA.HPP,830"$ -$LK,"HPET_GCAP_ID",A="FL:::/Kernel/KernelA.HPP,533"$ -$LK,"ATan",A="FL:::/Kernel/KernelB.HPP,95"$ -$LK,"MEM_NUM_512GIG",A="FL:::/Kernel/KernelA.HPP,3471"$ -$LK,"SysBadFree",A="FL:::/Kernel/Mem/Mem512.CPP.Z,1",BI=99$ -$LK,"ATA_ID_DEV",A="FL:::/Kernel/KernelA.HPP,2269"$ -$LK,"CHashReg",A="FL:::/Kernel/KernelA.HPP,748"$ -$LK,"SCf_INS",A="FL:::/Kernel/KernelA.HPP,3537"$ -$LK,"LAPIC_LVT_ERR",A="FL:::/Kernel/KernelA.HPP,503"$ -$LK,"Scale2Mem",A="FL:::/Kernel/Mem/MemPhysical.CPP.Z,192",BI=100$ -$LK,"Mem512TaskFree",A="FL:::/Kernel/Mem/Mem512.CPP.Z,154",BI=101$ -$LK,"RandU32",A="FL:::/Kernel/KMathB.CPP.Z,98",BI=102$ -$LK,"RandU16",A="FL:::/Kernel/KMathB.CPP.Z,82",BI=103$ -$LK,"_FLDCW",A="FL:::/Kernel/KMathA.CPP.Z,625"$ -$LK,"__DIR__",A="FL:::/Kernel/KernelA.HPP,2033"$ -$LK,"ARGT_RM32",A="FL:::/Kernel/KernelA.HPP,1901"$ -$LK,"ARGT_RM16",A="FL:::/Kernel/KernelA.HPP,1900"$ -$LK,"RFLAGf_INT",A="FL:::/Kernel/KernelA.HPP,313"$ -$LK,"WIf_SELF_DOC",A="FL:::/Kernel/KernelA.HPP,1445"$ -$LK,"WIF_SELF_DOC",A="FL:::/Kernel/KernelA.HPP,1419"$ -$LK,"MLF_STATIC",A="FL:::/Kernel/KernelA.HPP,780"$ -$LK,"ChgExt",A="FL:::/Kernel/BlkDev/DskStrA.CPP.Z,199",BI=104$ -$LK,"str2color_lst",A="FL:::/Kernel/KDefine.CPP.Z,156"$ -$LK,"local_time_offset",A="FL:::/Kernel/KGlbls.CPP.Z,14"$ -$LK,"RedSeaFilesFind",A="FL:::/Kernel/BlkDev/FileSysRedSea.CPP.Z,539",BI=105$ -$LK,"TK_INS_BIN",A="FL:::/Kernel/KernelA.HPP,2110"$ -$LK,"_D3_MUL",A="FL:::/Kernel/KMathA.CPP.Z,167"$ -$LK,"ISO1_BASE_YEAR",A="FL:::/Kernel/KernelA.HPP,2521"$ -$LK,"TK_ELSE",A="FL:::/Kernel/KernelA.HPP,2106"$ -$LK,"RandU64",A="FL:::/Kernel/KMathB.CPP.Z,114",BI=106$ -$LK,"PostMsgWait",A="FL:::/Kernel/SrvCmd.CPP.Z,251",BI=107$ -$LK,"UndefinedDefine",A="FL:::/Kernel/KDefine.CPP.Z,43",BI=108$ -$LK,"ARGT_RM64",A="FL:::/Kernel/KernelA.HPP,1902"$ -$LK,"ATAGetRes",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,67",BI=109$ -$LK,"ATAWaitDRQ",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,36",BI=110$ -$LK,"TaskInit",A="FL:::/Kernel/KTask.CPP.Z,150",BI=111$ -$LK,"DOCEf_RIGHT_CB",A="FL:::/Kernel/KernelA.HPP,1073"$ -$LK,"DOCEF_RIGHT_CB",A="FL:::/Kernel/KernelA.HPP,985"$ -$LK,"HTT_DICT_WORD",A="FL:::/Kernel/KernelA.HPP,690"$ -$LK,"HTt_DICT_WORD",A="FL:::/Kernel/KernelA.HPP,660"$ -$LK,"RLf_MP",A="FL:::/Kernel/KernelA.HPP,448"$ -$LK,"CSpring",A="FL:::/Kernel/KernelA.HPP,226"$ -$LK,"CBGR24",A="FL:::/Kernel/KernelA.HPP,2990"$ -$LK,"FONT_WIDTH",A="FL:::/Kernel/KernelA.HPP,3613"$ -$LK,"CHeapCtrl",A="FL:::/Kernel/KernelA.HPP,2907"$ -$LK,"LastDayOfYear",A="FL:::/Kernel/KDate.CPP.Z,110",BI=112$ -$LK,"SYS_IDLE_PT",A="FL:::/Kernel/Sched.CPP.Z,204"$ -$LK,"mp_cnt_initial",A="FL:::/Kernel/KernelB.HPP,229"$ -$LK,"STD_DISTRO_DVD_CFG",A="FL:::/Kernel/KernelA.HPP,3897"$ -$LK,"CAbsCntsI64",A="FL:::/Kernel/KernelA.HPP,1806"$ -$LK,"Core0StartMP",A="FL:::/Kernel/MultiProc.CPP.Z,284",BI=113$ -$LK,"_D3_SUB",A="FL:::/Kernel/KMathA.CPP.Z,149"$ -$LK,"CBGR48",A="FL:::/Kernel/KernelA.HPP,2994"$ -$LK,"DOCEF_BORDER_PLOT",A="FL:::/Kernel/KernelA.HPP,1004"$ -$LK,"IntCore0TimerHandler",A="FL:::/Kernel/KMisc.CPP.Z,47",BI=114$ -$LK,"__DATE__",A="FL:::/Kernel/KernelA.HPP,2025"$ -$LK,"chars_bmp_safe_dollar",A="FL:::/Kernel/StrA.CPP.Z,391"$ -$LK,"AdamErr",A="FL:::/Kernel/SrvCmd.CPP.Z,434",BI=115$ -$LK,"sys_focus_task",A="FL:::/Kernel/KernelB.HPP,197"$ -$LK,"DOCEf_BORDER_PLOT",A="FL:::/Kernel/KernelA.HPP,1092"$ -$LK,"HTT_MODULE",A="FL:::/Kernel/KernelA.HPP,696"$ -$LK,"HTt_MODULE",A="FL:::/Kernel/KernelA.HPP,666"$ -$LK,"SVCf_HIGHEST_PRIORITY",A="FL:::/Kernel/KernelA.HPP,3182"$ -$LK,"ARGT_REL8",A="FL:::/Kernel/KernelA.HPP,1880"$ -$LK,"GridInit",A="FL:::/Kernel/SerialDev/InputPointer.CPP.Z,1",BI=116$ -$LK,"FirstDayOfYear",A="FL:::/Kernel/KDate.CPP.Z,98",BI=117$ -$LK,"CCf_PMT",A="FL:::/Kernel/KernelA.HPP,2129"$ -$LK,"ACD_EXTRA",A="FL:::/Kernel/KernelA.HPP,1511"$ -$LK,"WIf_SELF_ODE",A="FL:::/Kernel/KernelA.HPP,1446"$ -$LK,"WIF_SELF_ODE",A="FL:::/Kernel/KernelA.HPP,1420"$ -$LK,"MLF_DFT_AVAILABLE",A="FL:::/Kernel/KernelA.HPP,774"$ -$LK,"COREAP_16BIT_INIT",A="FL:::/Kernel/MultiProc.CPP.Z,9"$ -$LK,"SCf_NUM",A="FL:::/Kernel/KernelA.HPP,3531"$ -$LK,"RS_ATTR_RESIDENT",A="FL:::/Kernel/KernelA.HPP,2536"$ -$LK,"Dbg2",A="FL:::/Kernel/KDbg.CPP.Z,533",BI=118$ -$LK,"HashSrcFileSet",A="FL:::/Kernel/KHashB.CPP.Z,154",BI=119$ -$LK,"ROP_XOR",A="FL:::/Kernel/KernelA.HPP,2943"$ -$LK,"NULL",A="FL:::/Kernel/KernelA.HPP,18"$ -$LK,"BlkPoolInit",A="FL:::/Kernel/Mem/BlkPool.CPP.Z,18",BI=120$ -$LK,"BDF_EXT_SIZE",A="FL:::/Kernel/KernelA.HPP,2645"$ -$LK,"ProgressBarsRst",A="FL:::/Kernel/KMisc.CPP.Z,275",BI=121$ -$LK,"sys_boot_blk",A="FL:::/Kernel/KernelB.HPP,38"$ -$LK,"TASKf_PENDING_BREAK",A="FL:::/Kernel/KernelA.HPP,3292"$ -$LK,"BDf_EXT_SIZE",A="FL:::/Kernel/KernelA.HPP,2655"$ -$LK,"RedSeaAllocClusters",A="FL:::/Kernel/BlkDev/FileSysRedSea.CPP.Z,302",BI=122$ -$LK,"CQue",A="FL:::/Kernel/KernelA.HPP,121"$ -$LK,"MEM_ADAM_STK",A="FL:::/Kernel/KernelA.HPP,2884"$ -$LK,"DOCEF_UPDATE_DATA",A="FL:::/Kernel/KernelA.HPP,1008"$ -$LK,"AdamLog",A="FL:::/Kernel/SrvCmd.CPP.Z,424",BI=123$ -$LK,"TASKf_KILL_TASK",A="FL:::/Kernel/KernelA.HPP,3283"$ -$LK,"ACD_H1",A="FL:::/Kernel/KernelA.HPP,1503"$ -$LK,"Ff_RET1",A="FL:::/Kernel/KernelA.HPP,854"$ -$LK,"SVCT_SPAWN_TASK",A="FL:::/Kernel/KernelA.HPP,3194"$ -$LK,"RS_ATTR_ARCHIVE",A="FL:::/Kernel/KernelA.HPP,2531"$ -$LK,"DOCEf_UPDATE_DATA",A="FL:::/Kernel/KernelA.HPP,1096"$ -$LK,"EXT_DBG_RESUME",A="FL:::/Kernel/KernelA.HPP,579"$ -$LK,"FSt_FAT32",A="FL:::/Kernel/KernelA.HPP,2688"$ -$LK,"OPTf_WARN_PAREN",A="FL:::/Kernel/KernelA.HPP,1539"$ -$LK,"TaskStkNew",A="FL:::/Kernel/KTask.CPP.Z,68",BI=124$ -$LK,"RT_PTR",A="FL:::/Kernel/KernelA.HPP,1562"$ -$LK,"HashTableDel",A="FL:::/Kernel/KHashB.CPP.Z,90",BI=125$ -$LK,"LBtc",A="FL:::/Kernel/KernelB.HPP,22"$ -$LK,"FUF_Z_OR_NOT_Z",A="FL:::/Kernel/KernelA.HPP,2613"$ -$LK,"ClampI64",A="FL:::/Kernel/KernelB.HPP,125"$ -$LK,"FUf_Z_OR_NOT_Z",A="FL:::/Kernel/KernelA.HPP,2587"$ -$LK,"B2",A="FL:::/Kernel/KDbg.CPP.Z,422",BI=126$ -$LK,"SLOP",A="FL:::/Kernel/StrPrint.CPP.Z,206"$ -$LK,"FF_BUF_DIRTY",A="FL:::/Kernel/KernelA.HPP,2782"$ -$LK,"ICF_SWAP",A="FL:::/Kernel/KernelA.HPP,1611"$ -$LK,"_STRMATCH",A="FL:::/Kernel/StrA.CPP.Z,223"$ -$LK,"MSF_FIXED",A="FL:::/Kernel/KernelA.HPP,207"$ -$LK,"_CPUID",A="FL:::/Kernel/KUtils.CPP.Z,319"$ -$LK,"SYS_HEAP_BASE",A="FL:::/Kernel/KStart32.CPP.Z,6"$ -$LK,"_LBEQU",A="FL:::/Kernel/KUtils.CPP.Z,104"$ -$LK,"Caller",A="FL:::/Kernel/KDbg.CPP.Z,60",BI=127$ -$LK,"SUF_S2T",A="FL:::/Kernel/KernelA.HPP,3800"$ -$LK,"ATA_DEV_RST",A="FL:::/Kernel/KernelA.HPP,2259"$ -$LK,"INT_MP_CRASH_ADDR",A="FL:::/Kernel/KInts.CPP.Z,2"$ -$LK,"RWF_LAST_DOLLAR",A="FL:::/Kernel/KernelA.HPP,3599"$ -$LK,"RS_ATTR_CONTIGUOUS",A="FL:::/Kernel/KernelA.HPP,2538"$ -$LK,"HPET_MAIN_CNT",A="FL:::/Kernel/KernelA.HPP,535"$ -$LK,"ARGT_NONE",A="FL:::/Kernel/KernelA.HPP,1879"$ -$LK,"DOCT_DATA",A="FL:::/Kernel/KernelA.HPP,930"$ -$LK,"SUF_T2S",A="FL:::/Kernel/KernelA.HPP,3801"$ -$LK,"MEM_MIN_MEG",A="FL:::/Kernel/KernelA.HPP,3466"$ -$LK,"exp_1",A="FL:::/Kernel/KernelA.HPP,51"$ -$LK,"CTRL_KEY_SCAN_DECODE_TABLE",A="FL:::/Kernel/SerialDev/Keyboard.CPP.Z,15"$ -$LK,"KeyDevRem",A="FL:::/Kernel/KeyDev.CPP.Z,64",BI=128$ -$LK,"G2",A="FL:::/Kernel/KDbg.CPP.Z,469",BI=129$ -$LK,"DOCEG_HAS_ARG",A="FL:::/Kernel/KernelA.HPP,1031"$ -$LK,"TSSNew",A="FL:::/Kernel/MultiProc.CPP.Z,76",BI=130$ -$LK,"SYS_PROGRESS1_DESC",A="FL:::/Kernel/KStart32.CPP.Z,33"$ -$LK,"LBtr",A="FL:::/Kernel/KernelB.HPP,24"$ -$LK,"FStf_DISABLE",A="FL:::/Kernel/KernelA.HPP,2697"$ -$LK,"HTT_OPCODE",A="FL:::/Kernel/KernelA.HPP,693"$ -$LK,"HTt_OPCODE",A="FL:::/Kernel/KernelA.HPP,663"$ -$LK,"CDATE_YEAR_DAYS_INT",A="FL:::/Kernel/KernelA.HPP,183"$ -$LK,"FAT32AllocContiguousClusters",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,514",BI=131$ -$LK,"LBts",A="FL:::/Kernel/KernelB.HPP,26"$ -$LK,"ArcEntryGet",A="FL:::/Kernel/Compress.CPP.Z,100"$ -$LK,"_LOG10",A="FL:::/Kernel/KMathA.CPP.Z,592"$ -$LK,"Adam",A="FL:::/Kernel/SrvCmd.CPP.Z,407",BI=132$ -$LK,"CTryStk",A="FL:::/Kernel/KExcept.CPP.Z,55"$ -$LK,"DCF_PALETTE",A="FL:::/Kernel/KernelA.HPP,3628"$ -$LK,"set_bits_table",A="FL:::/Kernel/KGlbls.CPP.Z,13"$ -$LK,"rev_bits_table",A="FL:::/Kernel/KGlbls.CPP.Z,12"$ -$LK,"KBD_CTRL",A="FL:::/Kernel/KernelA.HPP,3001"$ -$LK,"HTt_FUN",A="FL:::/Kernel/KernelA.HPP,658"$ -$LK,"RS_ATTR_LONG_NAME",A="FL:::/Kernel/KernelA.HPP,2532"$ -$LK,"TK_XOR_XOR",A="FL:::/Kernel/KernelA.HPP,2090"$ -$LK,"DOCEf_HOLD",A="FL:::/Kernel/KernelA.HPP,1101"$ -$LK,"DOCEF_HOLD",A="FL:::/Kernel/KernelA.HPP,1015"$ -$LK,"KDInputFilterPutKey",A="FL:::/Kernel/KeyDev.CPP.Z,108",BI=133$ -$LK,"GetOutOfDollar",A="FL:::/Kernel/StrB.CPP.Z,75",BI=134$ -$LK,"DOC_COLOR_ALT_TEXT",A="FL:::/Kernel/KernelA.HPP,1135"$ -$LK,"MBR_PT_FAT32a",A="FL:::/Kernel/KernelA.HPP,2700"$ -$LK,"DbgHelp",A="FL:::/Kernel/KDbg.CPP.Z,498",BI=135$ -$LK,"_FLOOR",A="FL:::/Kernel/KMathA.CPP.Z,420"$ -$LK,"MBR_PT_FAT32b",A="FL:::/Kernel/KernelA.HPP,2701"$ -$LK,"MBR_PT_FAT32c",A="FL:::/Kernel/KernelA.HPP,2702"$ -$LK,"D3Dist",A="FL:::/Kernel/KernelB.HPP,149"$ -$LK,"MBR_PT_FAT32d",A="FL:::/Kernel/KernelA.HPP,2703"$ -$LK,"TK_INS_BIN_SIZE",A="FL:::/Kernel/KernelA.HPP,2111"$ -$LK,"LMF_EXACT",A="FL:::/Kernel/KernelA.HPP,3813"$ -$LK,"MBR_PT_FAT32e",A="FL:::/Kernel/KernelA.HPP,2704"$ -$LK,"FSt_NTFS",A="FL:::/Kernel/KernelA.HPP,2692"$ -$LK,"MBR_PT_FAT32f",A="FL:::/Kernel/KernelA.HPP,2705"$ -$LK,"CM_MAX_CONSTS",A="FL:::/Kernel/KernelA.HPP,1703"$ -$LK,"DOCEF_TAG_CB",A="FL:::/Kernel/KernelA.HPP,994"$ -$LK,"Str2Date",A="FL:::/Kernel/StrScan.CPP.Z,138",BI=136$ -$LK,"ICF_PASS_TRACE",A="FL:::/Kernel/KernelA.HPP,1605"$ -$LK,"DOCEf_TAG_CB",A="FL:::/Kernel/KernelA.HPP,1082"$ -$LK,"HTt_REG",A="FL:::/Kernel/KernelA.HPP,664"$ -$LK,"ChkPtr",A="FL:::/Kernel/KDbg.CPP.Z,1",BI=137$ -$LK,"TaskWait",A="FL:::/Kernel/SrvCmd.CPP.Z,220",BI=138$ -$LK,"_R10",A="FL:::/Kernel/KernelA.HPP,3435"$ -$LK,"SYS_MEM_INIT_VAL",A="FL::/Temp.TXT.Z,1"$ -$LK,"_R11",A="FL:::/Kernel/KernelA.HPP,3436"$ -$LK,"BOOT_RAM_LIMIT",A="FL:::/Kernel/KernelA.HPP,3887"$ -$LK,"_R12",A="FL:::/Kernel/KernelA.HPP,3437"$ -$LK,"SK_CLUSTER",A="FL:::/Kernel/BlkDev/DskDirA.CPP.Z,90"$ -$LK,"SysGetI64",A="FL:::/Kernel/BlkDev/DskAddDev.CPP.Z,169",BI=139$ -$LK,"MemSetI64",A="FL:::/Kernel/KernelB.HPP,172"$ -$LK,"_R13",A="FL:::/Kernel/KernelA.HPP,3438"$ -$LK,"DEF_NOT_INITIALIZED",A="FL:::/Kernel/KernelA.HPP,2549"$ -$LK,"SYS_BOOT_PATCH_TABLE_BASE",A="FL:::/Kernel/KStart16.CPP.Z,25"$ -$LK,"_R14",A="FL:::/Kernel/KernelA.HPP,3439"$ -$LK,"CTRLT_WIN_VSCROLL",A="FL:::/Kernel/KernelA.HPP,3089"$ -$LK,"TK_LESS_EQU",A="FL:::/Kernel/KernelA.HPP,2086"$ -$LK,"ODEF_HAS_MASSES",A="FL:::/Kernel/KernelA.HPP,240"$ -$LK,"_R15",A="FL:::/Kernel/KernelA.HPP,3440"$ -$LK,"FUG_FILES_FIND",A="FL:::/Kernel/KernelA.HPP,2621"$ -$LK,"TRUE",A="FL:::/Kernel/KernelA.HPP,19"$ -$LK,"FSt_NULL",A="FL:::/Kernel/KernelA.HPP,2686"$ -$LK,"chars_bmp_zero_tab_ff_cr_nl_cursor",A="FL:::/Kernel/StrA.CPP.Z,365"$ -$LK,"CEdFindText",A="FL:::/Kernel/KernelA.HPP,1224"$ -$LK,"MEM_FREE_PAGE_HASH_SIZE",A="FL:::/Kernel/KernelA.HPP,2879"$ -$LK,"LDF_NO_ABSS",A="FL:::/Kernel/KernelA.HPP,367"$ -$LK,"DOCEf_LINK",A="FL:::/Kernel/KernelA.HPP,1086"$ -$LK,"DOCEF_LINK",A="FL:::/Kernel/KernelA.HPP,998"$ -$LK,"D3Copy",A="FL:::/Kernel/KernelB.HPP,147"$ -$LK,"Beep",A="FL:::/Kernel/KMisc.CPP.Z,190",BI=140$ -$LK,"_STRNICMP",A="FL:::/Kernel/StrA.CPP.Z,183"$ -$LK,"_MEMSET_I64",A="FL:::/Kernel/KUtils.CPP.Z,42"$ -$LK,"CH_SPACE",A="FL:::/Kernel/KernelA.HPP,3519"$ -$LK,"AAT_SUB_U8",A="FL:::/Kernel/KernelA.HPP,1970"$ -$LK,"IET_IMM64_EXPORT",A="FL:::/Kernel/KernelA.HPP,409"$ -$LK,"IET_IMM32_EXPORT",A="FL:::/Kernel/KernelA.HPP,407"$ -$LK,"sys_gdt",A="FL:::/Kernel/KernelB.HPP,266"$ -$LK,"Call",A="FL:::/Kernel/KernelB.HPP,44"$ -$LK,"SYS_FIXED_AREA",A="FL:::/Kernel/KernelA.HPP,3473"$ -$LK,"ICF_CODE_FINAL",A="FL:::/Kernel/KernelA.HPP,1601"$ -$LK,"SYS_PROGRESS2_DESC",A="FL:::/Kernel/KStart32.CPP.Z,36"$ -$LK,"BlkDevLockFwdingSet",A="FL:::/Kernel/BlkDev/DskAddDev.CPP.Z,1",BI=141$ -$LK,"InU8",A="FL:::/Kernel/KernelB.HPP,77"$ -$LK,"ARGT_SREG",A="FL:::/Kernel/KernelA.HPP,1926"$ -$LK,"CMemUnused",A="FL:::/Kernel/KernelA.HPP,2816"$ -$LK,"IEF_48_REX",A="FL:::/Kernel/KernelA.HPP,1733"$ -$LK,"RECALCt_TO_SCREEN",A="FL:::/Kernel/KernelA.HPP,1347"$ -$LK,"ã",A="FL:::/Kernel/KernelA.HPP,50"$ -$LK,"Suspend",A="FL:::/Kernel/KTask.CPP.Z,45",BI=142$ -$LK,"ClampU64",A="FL:::/Kernel/KernelB.HPP,127"$ -$LK,"ARC_MAX_BITS",A="FL:::/Kernel/KernelA.HPP,3748"$ -$LK,"TK_MOD_EQU",A="FL:::/Kernel/KernelA.HPP,2107"$ -$LK,"FunSegFind",A="FL:::/Kernel/FunSeg.CPP.Z,54",BI=143$ -$LK,"Define",A="FL:::/Kernel/KDefine.CPP.Z,49",BI=144$ -$LK,"FAT32Fmt",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,60",BI=145$ -$LK,"SrvCmdLine",A="FL:::/Kernel/KTask.CPP.Z,374",BI=146$ -$LK,"HashTableNew",A="FL:::/Kernel/KHashB.CPP.Z,50",BI=147$ -$LK,"DOCT_INDENT",A="FL:::/Kernel/KernelA.HPP,914"$ -$LK,"_ARG",A="FL:::/Kernel/KMathA.CPP.Z,366"$ -$LK,"COLORROP_NO_ROP0_MASK",A="FL:::/Kernel/KernelA.HPP,2988"$ -$LK,"CDualBuf",A="FL:::/Kernel/BlkDev/DskCDDVD.CPP.Z,109"$ -$LK,"TaskText",A="FL:::/Kernel/SrvCmd.CPP.Z,75",BI=148$ -$LK,"COLORROP_BITS",A="FL:::/Kernel/KernelA.HPP,2989"$ -$LK,"BROWN",A="FL:::/Kernel/KernelA.HPP,2964"$ -$LK,"Da",A="FL:::/Kernel/KDbg.CPP.Z,209",BI=149$ -$LK,"SUF_REM_TRAILING",A="FL:::/Kernel/KernelA.HPP,3795"$ -$LK,"Cd",A="FL:::/Kernel/BlkDev/DskDirB.CPP.Z,9",BI=150$ -$LK,"Ceil",A="FL:::/Kernel/KernelB.HPP,123"$ -$LK,"DOCEF_SKIP_IN_FORM",A="FL:::/Kernel/KernelA.HPP,1020"$ -$LK,"CCF_DONT_FREE_BUF",A="FL:::/Kernel/KernelA.HPP,2131"$ -$LK,"IET_ZEROED_CODE_HEAP",A="FL:::/Kernel/KernelA.HPP,412"$ -$LK,"SrcEdLink",A="FL:::/Kernel/FunSeg.CPP.Z,278",BI=151$ -$LK,"GetRBP",A="FL:::/Kernel/KernelB.HPP,242"$ -$LK,"GREEN",A="FL:::/Kernel/KernelA.HPP,2960"$ -$LK,"RECALCF_TO_HTML",A="FL:::/Kernel/KernelA.HPP,1352"$ -$LK,"ì",A="FL:::/Kernel/KernelA.HPP,48"$ -$LK,"ON",A="FL:::/Kernel/KernelA.HPP,21"$ -$LK,"_LXCHG_I64",A="FL:::/Kernel/KUtils.CPP.Z,217"$ -$LK,"MDG_DISP_SIB_RIP",A="FL:::/Kernel/KernelA.HPP,1588"$ -$LK,"DOCEt_BLINK",A="FL:::/Kernel/KernelA.HPP,953"$ -$LK,"DOCET_BLINK",A="FL:::/Kernel/KernelA.HPP,947"$ -$LK,"sys_clipboard_doc",A="FL:::/Kernel/KGlbls.CPP.Z,6"$ -$LK,"CCF_NO_DEFINES",A="FL:::/Kernel/KernelA.HPP,2132"$ -$LK,"DOCEf_SKIP_IN_FORM",A="FL:::/Kernel/KernelA.HPP,1106"$ -$LK,"CGDTEntry",A="FL:::/Kernel/KernelA.HPP,330"$ -$LK,"ARGT_XMM0",A="FL:::/Kernel/KernelA.HPP,1946"$ -$LK,"_TASK_END_NOW",A="FL:::/Kernel/Sched.CPP.Z,151"$ -$LK,"HTT_INVALID",A="FL:::/Kernel/KernelA.HPP,681"$ -$LK,"_REP_OUT_U8",A="FL:::/Kernel/KUtils.CPP.Z,308"$ -$LK,"GetRAX",A="FL:::/Kernel/KernelB.HPP,241"$ -$LK,"sys_boot_src",A="FL:::/Kernel/KernelB.HPP,40"$ -$LK,"SCF_DELETE",A="FL:::/Kernel/KernelA.HPP,3551"$ -$LK,"SCf_DELETE",A="FL:::/Kernel/KernelA.HPP,3536"$ -$LK,"ARGT_M32N32",A="FL:::/Kernel/KernelA.HPP,1912"$ -$LK,"ARGT_M16N16",A="FL:::/Kernel/KernelA.HPP,1911"$ -$LK,"ARGT_M16N32",A="FL:::/Kernel/KernelA.HPP,1910"$ -$LK,"SV_STI_LIKE",A="FL:::/Kernel/KernelA.HPP,1742"$ -$LK,"ICG_NO_CVT_MASK",A="FL:::/Kernel/KernelA.HPP,1621"$ -$LK,"RECALCG_MASK",A="FL:::/Kernel/KernelA.HPP,1348"$ -$LK,"HTF_PRIVATE",A="FL:::/Kernel/KernelA.HPP,701"$ -$LK,"ESTIMATED_MISC_ALLOCS",A="FL:::/Kernel/Mem/PageTables.CPP.Z,97"$ -$LK,"Pow10I64",A="FL:::/Kernel/KMathB.CPP.Z,26",BI=152$ -$LK,"IEF_STI_LIKE",A="FL:::/Kernel/KernelA.HPP,1736"$ -$LK,"HTf_PRIVATE",A="FL:::/Kernel/KernelA.HPP,671"$ -$LK,"Dm",A="FL:::/Kernel/KDbg.CPP.Z,204",BI=153$ -$LK,"CCF_EXE_BLK",A="FL:::/Kernel/KernelA.HPP,2143"$ -$LK,"CQueD3I32",A="FL:::/Kernel/KernelA.HPP,131"$ -$LK,"BDf_REMOVABLE",A="FL:::/Kernel/KernelA.HPP,2647"$ -$LK,"BDF_REMOVABLE",A="FL:::/Kernel/KernelA.HPP,2637"$ -$LK,"COLOR_INVALID",A="FL:::/Kernel/KernelA.HPP,2976"$ -$LK,"DftExt",A="FL:::/Kernel/BlkDev/DskStrA.CPP.Z,208",BI=154$ -$LK,"Bt",A="FL:::/Kernel/KernelB.HPP,14"$ -$LK,"OPTf_EXTERNS_TO_IMPORTS",A="FL:::/Kernel/KernelA.HPP,1541"$ -$LK,"HashFunSegFind",A="FL:::/Kernel/FunSeg.CPP.Z,10",BI=155$ -$LK,"Dr",A="FL:::/Kernel/KDbg.CPP.Z,328",BI=156$ -$LK,"CPUId",A="FL:::/Kernel/KernelB.HPP,252"$ -$LK,"FilesFind2",A="FL:::/Kernel/BlkDev/DskFind.CPP.Z,1",BI=157$ -$LK,"TaskKillDying",A="FL:::/Kernel/KTask.CPP.Z,498",BI=158$ -$LK,"scan_code_map",A="FL:::/Kernel/SerialDev/Keyboard.CPP.Z,157"$ -$LK,"UncachedAliasAlloc",A="FL:::/Kernel/Mem/MemPhysical.CPP.Z,161",BI=159$ -$LK,"MSize2",A="FL:::/Kernel/Mem/MAllocFree.CPP.Z,385"$ -$LK,"MemSetU32",A="FL:::/Kernel/KernelB.HPP,176"$ -$LK,"MemSetU16",A="FL:::/Kernel/KernelB.HPP,174"$ -$LK,"DirTreeDel",A="FL:::/Kernel/BlkDev/DskDirA.CPP.Z,36",BI=160$ -$LK,"Fs",A="FL:::/Kernel/KernelB.HPP,276"$ -$LK,"SCF_CAPS",A="FL:::/Kernel/KernelA.HPP,3545"$ -$LK,"SCf_CAPS",A="FL:::/Kernel/KernelA.HPP,3530"$ -$LK,"SYS_SEMA_FAR_CALL32",A="FL:::/Kernel/KernelA.HPP,605"$ -$LK,"ACD_DEF_CHAR",A="FL:::/Kernel/KernelA.HPP,1517"$ -$LK,"Gs",A="FL:::/Kernel/KernelB.HPP,234"$ -$LK,"SYS_PROGRESS3_DESC",A="FL:::/Kernel/KStart32.CPP.Z,39"$ -$LK,"RWF_SCROLL",A="FL:::/Kernel/KernelA.HPP,3601"$ -$LK,"REGG_LOCAL_VARS",A="FL:::/Kernel/KernelA.HPP,1794"$ -$LK,"DrvModelNum",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,294",BI=161$ -$LK,"RepInU8",A="FL:::/Kernel/KernelB.HPP,86"$ -$LK,"MSG_FOCUS",A="FL:::/Kernel/KernelA.HPP,3238"$ -$LK,"IsSysDbg",A="FL:::/Kernel/KMisc.CPP.Z,238",BI=162$ -$LK,"CDbgGlbls",A="FL:::/Kernel/KernelA.HPP,3872"$ -$LK,"_TEST_EXCEPT",A="FL:::/Kernel/KExcept.CPP.Z,4"$ -$LK,"_FSTCW",A="FL:::/Kernel/KMathA.CPP.Z,632"$ -$LK,"MSG_IP_R_DOWN_UP",A="FL:::/Kernel/KernelA.HPP,3245"$ -$LK,"ScanFlags",A="FL:::/Kernel/StrB.CPP.Z,123",BI=163$ -$LK,"Ln",A="FL:::/Kernel/KernelB.HPP,134"$ -$LK,"INT_WAKE",A="FL:::/Kernel/KInts.CPP.Z,6"$ -$LK,"GetS",A="FL:::/Kernel/SerialDev/Message.CPP.Z,209",BI=164$ -$LK,"_MEMSET_U32",A="FL:::/Kernel/KUtils.CPP.Z,29"$ -$LK,"_MEMSET_U16",A="FL:::/Kernel/KUtils.CPP.Z,16"$ -$LK,"SYS_MP_CNT_LOCK",A="FL:::/Kernel/KStart32.CPP.Z,49"$ -$LK,"SYS_COMPILE_TIME",A="FL::/Temp.TXT.Z,1"$ -$LK,"GetTSC",A="FL:::/Kernel/KernelB.HPP,280"$ -$LK,"BptR",A="FL:::/Kernel/KDbg.CPP.Z,389",BI=165$ -$LK,"DOCT_MARKER",A="FL:::/Kernel/KernelA.HPP,906"$ -$LK,"BptS",A="FL:::/Kernel/KDbg.CPP.Z,368",BI=166$ -$LK,"_HASH_BUCKET_FIND",A="FL:::/Kernel/KHashA.CPP.Z,158"$ -$LK,"_MHEAP_CTRL",A="FL:::/Kernel/Mem/MAllocFree.CPP.Z,368"$ -$LK,"ATAMount",A="FL:::/Kernel/BlkDev/DskATAId.CPP.Z,239",BI=167$ -$LK,"FifoI64Peek",A="FL:::/Kernel/KDataTypes.CPP.Z,290",BI=168$ -$LK,"_EXP",A="FL:::/Kernel/KMathA.CPP.Z,558"$ -$LK,"SYS_SEMA_SYS_TIMER",A="FL:::/Kernel/KernelA.HPP,595"$ -$LK,"IET_END",A="FL:::/Kernel/KernelA.HPP,392"$ -$LK,"KbdHandler",A="FL:::/Kernel/SerialDev/Keyboard.CPP.Z,441",BI=169$ -$LK,"GSF_WITH_NEW_LINE",A="FL:::/Kernel/KernelA.HPP,3789"$ -$LK,"SYS_HASH_FIND1",A="FL:::/Kernel/KHashA.CPP.Z,81"$ -$LK,"GetRSP",A="FL:::/Kernel/KernelB.HPP,244"$ -$LK,"_D3_DIST",A="FL:::/Kernel/KMathA.CPP.Z,39"$ -$LK,"SPF_TRUNCATE",A="FL:::/Kernel/KernelA.HPP,3921"$ -$LK,"ScanKey",A="FL:::/Kernel/SerialDev/Message.CPP.Z,123",BI=170$ -$LK,"MouseDriverInstall",A="FL:::/Kernel/SerialDev/Mouse.CPP.Z,217",BI=171$ -$LK,"mouse_last",A="FL:::/Kernel/KGlbls.CPP.Z,27"$ -$LK,"D3DistSqr",A="FL:::/Kernel/KernelB.HPP,150"$ -$LK,"_RDI",A="FL:::/Kernel/KernelA.HPP,3429"$ -$LK,"SV_R_REG",A="FL:::/Kernel/KernelA.HPP,1740"$ -$LK,"ATARepExitAllApplications",A="FL:::/Kernel/BlkDev/DskATAId.CPP.Z,120",BI=172$ -$LK,"CeilI64",A="FL:::/Kernel/KMathB.CPP.Z,62",BI=173$ -$LK,"_RBP",A="FL:::/Kernel/KernelA.HPP,3430"$ -$LK,"CCacheBlk",A="FL:::/Kernel/KernelA.HPP,2746"$ -$LK,"OPTf_WARN_DUP_TYPES",A="FL:::/Kernel/KernelA.HPP,1540"$ -$LK,"ATAProbe",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,373",BI=174$ -$LK,"_LXCHG_U16",A="FL:::/Kernel/KUtils.CPP.Z,235"$ -$LK,"_LXCHG_U32",A="FL:::/Kernel/KUtils.CPP.Z,226"$ -$LK,"SYS_PROGRESS1",A="FL:::/Kernel/KStart32.CPP.Z,31"$ -$LK,"DOCT_FOOTER",A="FL:::/Kernel/KernelA.HPP,913"$ -$LK,"MEM_NUM_E820_ENTRIES",A="FL:::/Kernel/KernelA.HPP,356"$ -$LK,"MPAPICInit",A="FL:::/Kernel/MultiProc.CPP.Z,171",BI=175$ -$LK,"SYS_PROGRESS2",A="FL:::/Kernel/KStart32.CPP.Z,34"$ -$LK,"DOCEf_SKIP",A="FL:::/Kernel/KernelA.HPP,1104"$ -$LK,"DOCEF_SKIP",A="FL:::/Kernel/KernelA.HPP,1018"$ -$LK,"SYS_PROGRESS3",A="FL:::/Kernel/KStart32.CPP.Z,37"$ -$LK,"SPF_COMMA",A="FL:::/Kernel/KernelA.HPP,3922"$ -$LK,"CCF_DONT_MAKE_RES",A="FL:::/Kernel/KernelA.HPP,2166"$ -$LK,"CSrvCtrl",A="FL:::/Kernel/KernelA.HPP,3216"$ -$LK,"DirNew",A="FL:::/Kernel/BlkDev/DskDirA.CPP.Z,1",BI=176$ -$LK,"SYS_PROGRESS4",A="FL:::/Kernel/KStart32.CPP.Z,40"$ -$LK,"_RAX",A="FL:::/Kernel/KernelA.HPP,3424"$ -$LK,"FAT32DirNew",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,576",BI=177$ -$LK,"HTf_RESOLVED",A="FL:::/Kernel/KernelA.HPP,677"$ -$LK,"LinkedLstDel",A="FL:::/Kernel/KDataTypes.CPP.Z,1",BI=178$ -$LK,"Help",A="FL:::/Kernel/StrB.CPP.Z,115",BI=179$ -$LK,"Log2",A="FL:::/Kernel/KernelB.HPP,136"$ -$LK,"_RBX",A="FL:::/Kernel/KernelA.HPP,3425"$ -$LK,"DOCT_HEX_ED",A="FL:::/Kernel/KernelA.HPP,935"$ -$LK,"DOCT_LINK",A="FL:::/Kernel/KernelA.HPP,928"$ -$LK,"_D3_COPY",A="FL:::/Kernel/KMathA.CPP.Z,212"$ -$LK,"PUT_STR",A="FL:::/Kernel/StrA.CPP.Z,58"$ -$LK,"_RET",A="FL:::/Kernel/KUtils.CPP.Z,456"$ -$LK,"_RCX",A="FL:::/Kernel/KernelA.HPP,3426"$ -$LK,"BIOSTotalMem",A="FL:::/Kernel/Mem/MemPhysical.CPP.Z,174",BI=180$ -$LK,"_RDX",A="FL:::/Kernel/KernelA.HPP,3427"$ -$LK,"RLF_FULL_HEAP",A="FL:::/Kernel/KernelA.HPP,463"$ -$LK,"RLf_FULL_HEAP",A="FL:::/Kernel/KernelA.HPP,444"$ -$LK,"ScanMsg",A="FL:::/Kernel/SerialDev/Message.CPP.Z,37",BI=181$ -$LK,"SYS_PROGRESS4_DESC",A="FL:::/Kernel/KStart32.CPP.Z,42"$ -$LK,"__FILE__",A="FL:::/Kernel/KernelA.HPP,2031"$ -$LK,"CDate",A="FL:::/Kernel/KernelA.HPP,185"$ -$LK,"CLFlush",A="FL:::/Kernel/KernelB.HPP,269"$ -$LK,"SYS_HEAP_DBG_FLAG",A="FL:::/Kernel/KStart32.CPP.Z,21"$ -$LK,"_RIP",A="FL:::/Kernel/KernelA.HPP,3432"$ -$LK,"IEF_REX_ONLY_R8_R15",A="FL:::/Kernel/KernelA.HPP,1734"$ -$LK,"MDF_IMM",A="FL:::/Kernel/KernelA.HPP,1581"$ -$LK,"DOCSS_SINGLE_QUOTE",A="FL:::/Kernel/KernelA.HPP,1129"$ -$LK,"KBD_PORT",A="FL:::/Kernel/KernelA.HPP,3000"$ -$LK,"NUM_COLORS",A="FL:::/Kernel/KernelA.HPP,2975"$ -$LK,"ac",A="FL:::/Kernel/KGlbls.CPP.Z,18"$ -$LK,"C:/Doc/TimeCycles.TXT.Z",A="FL:::/Kernel/KernelB.HPP,280"$ -$LK,"_FSTSW",A="FL:::/Kernel/KMathA.CPP.Z,641"$ -$LK,"ARGT_IMM32",A="FL:::/Kernel/KernelA.HPP,1886"$ -$LK,"ARGT_IMM16",A="FL:::/Kernel/KernelA.HPP,1885"$ -$LK,"MouseSpeedSet",A="FL:::/Kernel/SerialDev/Mouse.CPP.Z,109",BI=182$ -$LK,"Name2ParentDirCluster",A="FL:::/Kernel/BlkDev/DskStrB.CPP.Z,54",BI=183$ -$LK,"Free",A="FL:::/Kernel/Mem/MAllocFree.CPP.Z,383"$ -$LK,"DOCEf_AUX_STR",A="FL:::/Kernel/KernelA.HPP,1055"$ -$LK,"DOCEF_AUX_STR",A="FL:::/Kernel/KernelA.HPP,967"$ -$LK,"Char2KeyName",A="FL:::/Kernel/SerialDev/Keyboard.CPP.Z,201",BI=184$ -$LK,"Mem512Free",A="FL:::/Kernel/Mem/Mem512.CPP.Z,84",BI=185$ -$LK,"blkdev",A="FL:::/Kernel/KGlbls.CPP.Z,19"$ -$LK,"TK_NUM_TK",A="FL:::/Kernel/KernelA.HPP,2112"$ -$LK,"CWinMgrGlbls",A="FL:::/Kernel/KernelA.HPP,1469"$ -$LK,"DOCEf_TREE",A="FL:::/Kernel/KernelA.HPP,1102"$ -$LK,"DOCEF_TREE",A="FL:::/Kernel/KernelA.HPP,1016"$ -$LK,"MouseUpdatePre",A="FL:::/Kernel/SerialDev/Mouse.CPP.Z,119",BI=186$ -$LK,"ISO1FileFind",A="FL:::/Kernel/BlkDev/FileSysISO.CPP.Z,70",BI=187$ -$LK,"TASK_SIGNATURE_VAL",A="FL:::/Kernel/KernelA.HPP,3305"$ -$LK,"SysDefinesLoad",A="FL:::/Kernel/KDefine.CPP.Z,97",BI=188$ -$LK,"Mem512TaskAlloc",A="FL:::/Kernel/Mem/Mem512.CPP.Z,115",BI=189$ -$LK,"MEM_MAPPED_SPACE",A="FL:::/Kernel/KernelA.HPP,3467"$ -$LK,"D3Norm",A="FL:::/Kernel/KernelB.HPP,157"$ -$LK,"_POW",A="FL:::/Kernel/KMathA.CPP.Z,515"$ -$LK,"MSG_KEY_DOWN",A="FL:::/Kernel/KernelA.HPP,3227"$ -$LK,"ARGT_IMM64",A="FL:::/Kernel/KernelA.HPP,1887"$ -$LK,"RTG_MASK",A="FL:::/Kernel/KernelA.HPP,1570"$ -$LK,"TASK_HASH_TABLE_SIZE",A="FL:::/Kernel/KernelA.HPP,2889"$ -$LK,"DOCT_BUTTON",A="FL:::/Kernel/KernelA.HPP,929"$ -$LK,"drv_text_attr",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,310"$ -$LK,"PUT_HEX_U8",A="FL:::/Kernel/StrA.CPP.Z,44"$ -$LK,"_RSI",A="FL:::/Kernel/KernelA.HPP,3428"$ -$LK,"CTRLF_CAPTURE_RIGHT_IP",A="FL:::/Kernel/KernelA.HPP,3095"$ -$LK,"CPUStructInit",A="FL:::/Kernel/MultiProc.CPP.Z,116",BI=190$ -$LK,"WIf_FOCUS_TASK_GRAB_SCROLL",A="FL:::/Kernel/KernelA.HPP,1456"$ -$LK,"WIF_FOCUS_TASK_GRAB_SCROLL",A="FL:::/Kernel/KernelA.HPP,1431"$ -$LK,"CIntermediateCode",A="FL:::/Kernel/KernelA.HPP,1655"$ -$LK,"MDF_REG",A="FL:::/Kernel/KernelA.HPP,1582"$ -$LK,"DOC_COLOR_ANCHOR",A="FL:::/Kernel/KernelA.HPP,1138"$ -$LK,"Str2ColorU32",A="FL:::/Kernel/KDefine.CPP.Z,202",BI=191$ -$LK,"Str2ColorU16",A="FL:::/Kernel/KDefine.CPP.Z,158",BI=192$ -$LK,"LinkedLstCnt",A="FL:::/Kernel/KDataTypes.CPP.Z,21",BI=193$ -$LK,"Auto",A="FL:::/Kernel/SrvCmd.CPP.Z,483",BI=194$ -$LK,"CTRLT_VIEWING_ANGLES",A="FL:::/Kernel/KernelA.HPP,3090"$ -$LK,"DOCEf_QUIT",A="FL:::/Kernel/KernelA.HPP,1088"$ -$LK,"DOCEF_QUIT",A="FL:::/Kernel/KernelA.HPP,1000"$ -$LK,"Tabs2Spaces",A="FL:::/Kernel/StrB.CPP.Z,1",BI=195$ -$LK,"MaxI64",A="FL:::/Kernel/KernelB.HPP,99"$ -$LK,"SYS_GDT_PTR",A="FL:::/Kernel/KStart16.CPP.Z,34"$ -$LK,"_RSP",A="FL:::/Kernel/KernelA.HPP,3431"$ -$LK,"DOCT_INS_BIN_SIZE",A="FL:::/Kernel/KernelA.HPP,939"$ -$LK,"FSetCluster",A="FL:::/Kernel/BlkDev/DskCFile.CPP.Z,99",BI=196$ -$LK,"WinDerivedValsUpdate",A="FL:::/Kernel/Display.CPP.Z,93",BI=197$ -$LK,"fp_update_ctrls",A="FL:::/Kernel/KGlbls.CPP.Z,32"$ -$LK,"DSK_CACHE_HASH_SIZE",A="FL:::/Kernel/KernelA.HPP,2744"$ -$LK,"RS_ATTR_VOL_ID",A="FL:::/Kernel/KernelA.HPP,2529"$ -$LK,"DOCf_UNDERLINE",A="FL:::/Kernel/KernelA.HPP,1323"$ -$LK,"DOCF_UNDERLINE",A="FL:::/Kernel/KernelA.HPP,1286"$ -$LK,"DOCT_UNDERLINE",A="FL:::/Kernel/KernelA.HPP,923"$ -$LK,"IntDivZero",A="FL:::/Kernel/KInts.CPP.Z,150",BI=198$ -$LK,"_SQR",A="FL:::/Kernel/KMathA.CPP.Z,337"$ -$LK,"DISPLAYf_SILENT",A="FL:::/Kernel/KernelA.HPP,3300"$ -$LK,"MDF_SIB",A="FL:::/Kernel/KernelA.HPP,1584"$ -$LK,"REGT_R32",A="FL:::/Kernel/KernelA.HPP,741"$ -$LK,"REGT_R16",A="FL:::/Kernel/KernelA.HPP,740"$ -$LK,"IEF_NOT_IN_64_BIT",A="FL:::/Kernel/KernelA.HPP,1732"$ -$LK,"RedSeaFileFind",A="FL:::/Kernel/BlkDev/FileSysRedSea.CPP.Z,155",BI=199$ -$LK,"SYS_PCIBIOS_SERVICE_DIR",A="FL:::/Kernel/PCIBIOS.CPP.Z,4"$ -$LK,"tS",A="FL:::/Kernel/KMisc.CPP.Z,122",BI=200$ -$LK,"LBEqu",A="FL:::/Kernel/KernelB.HPP,34"$ -$LK,"ICF_RES_NOT_USED",A="FL:::/Kernel/KernelA.HPP,1600"$ -$LK,"DOCEt_SEL",A="FL:::/Kernel/KernelA.HPP,955"$ -$LK,"ArcDetermineCompressionType",A="FL:::/Kernel/Compress.CPP.Z,102",BI=201$ -$LK,"SYS_SEMA_REFRESH_IN_PROGRESS",A="FL:::/Kernel/KernelA.HPP,601"$ -$LK,"IntInit1",A="FL:::/Kernel/KInts.CPP.Z,180",BI=202$ -$LK,"CH_CURSOR",A="FL:::/Kernel/KernelA.HPP,3513"$ -$LK,"IntInit2",A="FL:::/Kernel/KInts.CPP.Z,195",BI=203$ -$LK,"DOCT_CURSOR",A="FL:::/Kernel/KernelA.HPP,905"$ -$LK,"GetKey",A="FL:::/Kernel/SerialDev/Message.CPP.Z,142",BI=204$ -$LK,"ROP_MONO",A="FL:::/Kernel/KernelA.HPP,2945"$ -$LK,"CFAT32DirEntryLong",A="FL:::/Kernel/KernelA.HPP,2396"$ -$LK,"Kill",A="FL:::/Kernel/KTask.CPP.Z,28",BI=205$ -$LK,"RS_ATTR_FIXED",A="FL:::/Kernel/KernelA.HPP,2539"$ -$LK,"TK_IFDEF",A="FL:::/Kernel/KernelA.HPP,2101"$ -$LK,"REGT_R64",A="FL:::/Kernel/KernelA.HPP,742"$ -$LK,"SingleUser",A="FL:::/Kernel/KMisc.CPP.Z,255",BI=206$ -$LK,"Date2Struct",A="FL:::/Kernel/KDate.CPP.Z,39",BI=207$ -$LK,"CFile",A="FL:::/Kernel/KernelA.HPP,2787"$ -$LK,"Fault2",A="FL:::/Kernel/KDbg.CPP.Z,592",BI=208$ -$LK,"Load",A="FL:::/Kernel/KLoad.CPP.Z,181",BI=209$ -$LK,"ip",A="FL:::/Kernel/KGlbls.CPP.Z,24"$ -$LK,"CFreeLst",A="FL:::/Kernel/KernelA.HPP,2709"$ -$LK,"DOCEF_CHECKED_COLLAPSED",A="FL:::/Kernel/KernelA.HPP,1005"$ -$LK,"CHash",A="FL:::/Kernel/KernelA.HPP,623"$ -$LK,"RedSeaFreeClusters",A="FL:::/Kernel/BlkDev/FileSysRedSea.CPP.Z,250",BI=210$ -$LK,"Fault3",A="FL:::/Kernel/KDbg.CPP.Z,561",BI=211$ -$LK,"CompressBuf",A="FL:::/Kernel/Compress.CPP.Z,281",BI=212$ -$LK,"chars_bmp_hex_numeric",A="FL:::/Kernel/StrA.CPP.Z,353"$ -$LK,"CCF_NOT_CONST",A="FL:::/Kernel/KernelA.HPP,2140"$ -$LK,"CeilU64",A="FL:::/Kernel/KMathB.CPP.Z,41",BI=213$ -$LK,"BPlf_LOCKED",A="FL:::/Kernel/KernelA.HPP,2892"$ -$LK,"BDlf_LOCKED",A="FL:::/Kernel/KernelA.HPP,2658"$ -$LK,"TK_OR_EQU",A="FL:::/Kernel/KernelA.HPP,2096"$ -$LK,"sys_neg_pows_lst",A="FL:::/Kernel/StrPrint.CPP.Z,203"$ -$LK,"sys_pos_pows_lst",A="FL:::/Kernel/StrPrint.CPP.Z,202"$ -$LK,"MStrPrint",A="FL:::/Kernel/StrPrint.CPP.Z,898",BI=214$ -$LK,"DVlf_LOCKED",A="FL:::/Kernel/KernelA.HPP,2683"$ -$LK,"SrcFileName",A="FL:::/Kernel/FunSeg.CPP.Z,239",BI=215$ -$LK,"RawD",A="FL:::/Kernel/KDbg.CPP.Z,234",BI=216$ -$LK,"IsSingleUser",A="FL:::/Kernel/KMisc.CPP.Z,260",BI=217$ -$LK,"adam_task",A="FL:::/Kernel/KGlbls.CPP.Z,8"$ -$LK,"_POW10",A="FL:::/Kernel/KMathA.CPP.Z,524"$ -$LK,"SVCRf_LOCKED",A="FL:::/Kernel/KernelA.HPP,3215"$ -$LK,"BDF_LAST_WAS_WRITE",A="FL:::/Kernel/KernelA.HPP,2641"$ -$LK,"DOCT_CURSOR_MOVEMENT",A="FL:::/Kernel/KernelA.HPP,926"$ -$LK,"SCF_CTRL",A="FL:::/Kernel/KernelA.HPP,3543"$ -$LK,"SCf_CTRL",A="FL:::/Kernel/KernelA.HPP,3528"$ -$LK,"TK_ENDIF",A="FL:::/Kernel/KernelA.HPP,2105"$ -$LK,"RT_UF32",A="FL:::/Kernel/KernelA.HPP,1565"$ -$LK,"CCF_NO_REG_OPT",A="FL:::/Kernel/KernelA.HPP,2141"$ -$LK,"DOCEf_UNDERLINE",A="FL:::/Kernel/KernelA.HPP,1050"$ -$LK,"DOCEF_UNDERLINE",A="FL:::/Kernel/KernelA.HPP,1044"$ -$LK,"DOCEt_UNDERLINE",A="FL:::/Kernel/KernelA.HPP,956"$ -$LK,"DOCET_UNDERLINE",A="FL:::/Kernel/KernelA.HPP,950"$ -$LK,"RLf_DOC",A="FL:::/Kernel/KernelA.HPP,450"$ -$LK,"pi",A="FL:::/Kernel/KernelA.HPP,49"$ -$LK,"ATTRF_UNDERLINE",A="FL:::/Kernel/KernelA.HPP,892"$ -$LK,"ATTRf_UNDERLINE",A="FL:::/Kernel/KernelA.HPP,897"$ -$LK,"KbdMouseVarsInit",A="FL:::/Kernel/SerialDev/Mouse.CPP.Z,271",BI=218$ -$LK,"DOCF_BWD_MOVEMENT",A="FL:::/Kernel/KernelA.HPP,1275"$ -$LK,"SYS_SEMA_UPDATE_WIN_Z_BUF",A="FL:::/Kernel/KernelA.HPP,608"$ -$LK,"Exit",A="FL:::/Kernel/KTask.CPP.Z,1",BI=219$ -$LK,"TASKf_BREAK_TO_SHIFT_ESC",A="FL:::/Kernel/KernelA.HPP,3293"$ -$LK,"HTT_KEYWORD",A="FL:::/Kernel/KernelA.HPP,691"$ -$LK,"CopySingleZ",A="FL:::/Kernel/BlkDev/DskCopy.CPP.Z,1",BI=220$ -$LK,"DCF_NO_TRANSPARENTS",A="FL:::/Kernel/KernelA.HPP,3629"$ -$LK,"HTt_KEYWORD",A="FL:::/Kernel/KernelA.HPP,661"$ -$LK,"SYS_SEMA_IN_DEBUGGER",A="FL:::/Kernel/KernelA.HPP,597"$ -$LK,"RT_UF64",A="FL:::/Kernel/KernelA.HPP,1567"$ -$LK,"DOCf_BWD_MOVEMENT",A="FL:::/Kernel/KernelA.HPP,1311"$ -$LK,"GetMsg",A="FL:::/Kernel/SerialDev/Message.CPP.Z,95",BI=221$ -$LK,"CMPCrash",A="FL:::/Kernel/KernelA.HPP,3863"$ -$LK,"ROPBF_HALF_RANGE_COLOR",A="FL:::/Kernel/KernelA.HPP,2937"$ -$LK,"ICF_SHORT_JMP",A="FL:::/Kernel/KernelA.HPP,1603"$ -$LK,"IA32_FS_BASE",A="FL:::/Kernel/KernelA.HPP,522"$ -$LK,"Rand",A="FL:::/Kernel/KMathB.CPP.Z,122",BI=222$ -$LK,"FAT32_ENTRIES_BITS",A="FL:::/Kernel/KernelA.HPP,2409"$ -$LK,"TK_IDENT",A="FL:::/Kernel/KernelA.HPP,2073"$ -$LK,"ArcCompressBuf",A="FL:::/Kernel/Compress.CPP.Z,110",BI=223$ -$LK,"MDG_REG_DISP_SIB_RIP",A="FL:::/Kernel/KernelA.HPP,1589"$ -$LK,"ToFileLine",A="FL:::/Kernel/EdLite.CPP.Z,303",BI=224$ -$LK,"D3Unit",A="FL:::/Kernel/KernelB.HPP,161"$ -$LK,"CTRLT_WIN_HSCROLL",A="FL:::/Kernel/KernelA.HPP,3088"$ -$LK,"TK_IFAOT",A="FL:::/Kernel/KernelA.HPP,2103"$ -$LK,"IsDotC",A="FL:::/Kernel/BlkDev/DskStrA.CPP.Z,31",BI=225$ -$LK,"BDf_LAST_WAS_WRITE",A="FL:::/Kernel/KernelA.HPP,2651"$ -$LK,"TK_GREATER_EQU",A="FL:::/Kernel/KernelA.HPP,2087"$ -$LK,"CICArg",A="FL:::/Kernel/KernelA.HPP,1632"$ -$LK,"MDF_STK",A="FL:::/Kernel/KernelA.HPP,1580"$ -$LK,"DOCEf_CENTER_X",A="FL:::/Kernel/KernelA.HPP,1076"$ -$LK,"DOCEF_CENTER_X",A="FL:::/Kernel/KernelA.HPP,988"$ -$LK,"SYS_TIMER_FREQ",A="FL:::/Kernel/KernelA.HPP,552"$ -$LK,"HashTablePurge",A="FL:::/Kernel/KHashB.CPP.Z,107",BI=226$ -$LK,"GR_HEIGHT",A="FL:::/Kernel/KernelA.HPP,3618"$ -$LK,"DOCEf_CENTER_Y",A="FL:::/Kernel/KernelA.HPP,1079"$ -$LK,"DOCEF_CENTER_Y",A="FL:::/Kernel/KernelA.HPP,991"$ -$LK,"Seed",A="FL:::/Kernel/KMathB.CPP.Z,128",BI=227$ -$LK,"DrvsRelease",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,27",BI=228$ -$LK,"BlkDevNextFreeSlot",A="FL:::/Kernel/BlkDev/DskBlkDev.CPP.Z,120",BI=229$ -$LK,"TASKf_FILTER_INPUT",A="FL:::/Kernel/KernelA.HPP,3287"$ -$LK,"DOCEF_REFRESH_DATA",A="FL:::/Kernel/KernelA.HPP,1007"$ -$LK,"DOCf_DONT_HIGHLIGHT_CURSOR",A="FL:::/Kernel/KernelA.HPP,1305"$ -$LK,"DOCF_DONT_HIGHLIGHT_CURSOR",A="FL:::/Kernel/KernelA.HPP,1269"$ -$LK,"SYS_SEMA_FLUSH_VGA_IMAGE",A="FL:::/Kernel/KernelA.HPP,602"$ -$LK,"OPTf_NO_REG_VAR",A="FL:::/Kernel/KernelA.HPP,1543"$ -$LK,"CTRLF_SHOW",A="FL:::/Kernel/KernelA.HPP,3092"$ -$LK,"DOCEf_REFRESH_DATA",A="FL:::/Kernel/KernelA.HPP,1095"$ -$LK,"DOCEf_LEFT_EXP",A="FL:::/Kernel/KernelA.HPP,1058"$ -$LK,"DOCEF_LEFT_EXP",A="FL:::/Kernel/KernelA.HPP,970"$ -$LK,"ISO1FileRead",A="FL:::/Kernel/BlkDev/FileSysISO.CPP.Z,130",BI=230$ -$LK,"ATAPIWaitReady",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,334",BI=231$ -$LK,"SC_PRTSCRN1",A="FL:::/Kernel/KernelA.HPP,3593"$ -$LK,"FUF_ALL",A="FL:::/Kernel/KernelA.HPP,2598"$ -$LK,"STR_LEN",A="FL:::/Kernel/KernelA.HPP,40"$ -$LK,"DskCacheQueIns",A="FL:::/Kernel/BlkDev/DskCache.CPP.Z,53",BI=232$ -$LK,"SC_PRTSCRN2",A="FL:::/Kernel/KernelA.HPP,3594"$ -$LK,"sys_semas",A="FL:::/Kernel/KernelB.HPP,231"$ -$LK,"InputFilterTask",A="FL:::/Kernel/SerialDev/Message.CPP.Z,1",BI=233$ -$LK,"SYS_HASH_STR",A="FL:::/Kernel/KHashA.CPP.Z,4"$ -$LK,"ATAR0_CMD",A="FL:::/Kernel/KernelA.HPP,2285"$ -$LK,"I_DBG",A="FL:::/Kernel/KernelA.HPP,296"$ -$LK,"FATNameTo",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,130",BI=234$ -$LK,"SrvCmdQueDel",A="FL:::/Kernel/SrvCmd.CPP.Z,7",BI=235$ -$LK,"MinI64",A="FL:::/Kernel/KernelB.HPP,101"$ -$LK,"MaxU64",A="FL:::/Kernel/KernelB.HPP,100"$ -$LK,"CallInd",A="FL:::/Kernel/KernelB.HPP,49"$ -$LK,"EndianI64",A="FL:::/Kernel/KMisc.CPP.Z,25",BI=236$ -$LK,"_MSIZE",A="FL:::/Kernel/Mem/MAllocFree.CPP.Z,337"$ -$LK,"AC_MAX_FILLINS",A="FL:::/Kernel/KernelA.HPP,1485"$ -$LK,"GVF_IMPORT",A="FL:::/Kernel/KernelA.HPP,867"$ -$LK,"HTF_IMPORT",A="FL:::/Kernel/KernelA.HPP,704"$ -$LK,"HTf_IMPORT",A="FL:::/Kernel/KernelA.HPP,674"$ -$LK,"NUM_BLKDEVS",A="FL:::/Kernel/KernelA.HPP,2660"$ -$LK,"IEF_PLUS_OPCODE",A="FL:::/Kernel/KernelA.HPP,1729"$ -$LK,"LAPIC_ICR_LOW",A="FL:::/Kernel/KernelA.HPP,495"$ -$LK,"mouse",A="FL:::/Kernel/KGlbls.CPP.Z,27"$ -$LK,"D3Zero",A="FL:::/Kernel/KernelB.HPP,162"$ -$LK,"ST_WARN_ST",A="FL:::/Kernel/KernelA.HPP,3522"$ -$LK,"FUF_SCAN_PARENTS",A="FL:::/Kernel/KernelA.HPP,2615"$ -$LK,"DskCacheInvalidate2",A="FL:::/Kernel/BlkDev/DskCache.CPP.Z,97",BI=237$ -$LK,"CCtrl",A="FL:::/Kernel/KernelA.HPP,3114"$ -$LK,"CBlkDev",A="FL:::/Kernel/KernelA.HPP,2662"$ -$LK,"DOCT_SONG",A="FL:::/Kernel/KernelA.HPP,940"$ -$LK,"DOCT_TREE",A="FL:::/Kernel/KernelA.HPP,936"$ -$LK,"progress1_desc",A="FL:::/Kernel/KernelB.HPP,208"$ -$LK,"BDS_ED_FILENAME_DRV",A="FL:::/Kernel/KernelA.HPP,3272"$ -$LK,"DOCT_TEXT",A="FL:::/Kernel/KernelA.HPP,900"$ -$LK,"CMathODE",A="FL:::/Kernel/KernelA.HPP,244"$ -$LK,"WinInside",A="FL:::/Kernel/Display.CPP.Z,126",BI=238$ -$LK,"RFLAGf_ALIGN_CHECK",A="FL:::/Kernel/KernelA.HPP,321"$ -$LK,"FUf_SCAN_PARENTS",A="FL:::/Kernel/KernelA.HPP,2589"$ -$LK,"DOCF_ALLOW_UNDO",A="FL:::/Kernel/KernelA.HPP,1271"$ -$LK,"CMemberLst",A="FL:::/Kernel/KernelA.HPP,797"$ -$LK,"DOCf_ALLOW_UNDO",A="FL:::/Kernel/KernelA.HPP,1307"$ -$LK,"DskCacheQueRem",A="FL:::/Kernel/BlkDev/DskCache.CPP.Z,46",BI=239$ -$LK,"_D3_NORM",A="FL:::/Kernel/KMathA.CPP.Z,4"$ -$LK,"DOCEf_BLINK",A="FL:::/Kernel/KernelA.HPP,1047"$ -$LK,"DOCEF_BLINK",A="FL:::/Kernel/KernelA.HPP,1041"$ -$LK,"IsDotZ",A="FL:::/Kernel/BlkDev/DskStrA.CPP.Z,22",BI=240$ -$LK,"HashGenericAdd",A="FL:::/Kernel/KHashB.CPP.Z,140",BI=241$ -$LK,"_TASK_CONTEXT_RESTORE",A="FL:::/Kernel/Sched.CPP.Z,100"$ -$LK,"BFieldOrU32",A="FL:::/Kernel/KernelB.HPP,32"$ -$LK,"TK_IFJIT",A="FL:::/Kernel/KernelA.HPP,2104"$ -$LK,"RedSeaFileRead",A="FL:::/Kernel/BlkDev/FileSysRedSea.CPP.Z,207",BI=242$ -$LK,"MousePktRead",A="FL:::/Kernel/SerialDev/Mouse.CPP.Z,1",BI=243$ -$LK,"VGAP_CRTC_DATA",A="FL:::/Kernel/KernelA.HPP,3741"$ -$LK,"ARGT_REL32",A="FL:::/Kernel/KernelA.HPP,1882"$ -$LK,"ARGT_REL16",A="FL:::/Kernel/KernelA.HPP,1881"$ -$LK,"cpu_structs",A="FL:::/Kernel/KernelB.HPP,227"$ -$LK,"SC_DELETE",A="FL:::/Kernel/KernelA.HPP,3578"$ -$LK,"MAX_U64_F64",A="FL:::/Kernel/KernelA.HPP,44"$ -$LK,"CLine",A="FL:::/Kernel/EdLite.CPP.Z,1"$ -$LK,"ACD_MAX_FILLINS",A="FL:::/Kernel/KernelA.HPP,1522"$ -$LK,"REGT_SEG",A="FL:::/Kernel/KernelA.HPP,743"$ -$LK,"CMass",A="FL:::/Kernel/KernelA.HPP,208"$ -$LK,"GetStr",A="FL:::/Kernel/SerialDev/Message.CPP.Z,193",BI=244$ -$LK,"LTRED",A="FL:::/Kernel/KernelA.HPP,2970"$ -$LK,"FSG_TYPE_MASK",A="FL:::/Kernel/KernelA.HPP,2695"$ -$LK,"StrIMatch",A="FL:::/Kernel/StrA.CPP.Z,319"$ -$LK,"HTG_TYPE_MASK",A="FL:::/Kernel/KernelA.HPP,699"$ -$LK,"Sign",A="FL:::/Kernel/KernelB.HPP,140"$ -$LK,"ExpandBuf",A="FL:::/Kernel/Compress.CPP.Z,250",BI=245$ -$LK,"ICF_ALT_TEMPLATE",A="FL:::/Kernel/KernelA.HPP,1614"$ -$LK,"DOCT_PAGE_LEN",A="FL:::/Kernel/KernelA.HPP,909"$ -$LK,"RLf_RAW",A="FL:::/Kernel/KernelA.HPP,445"$ -$LK,"BootDVDProbe",A="FL:::/Kernel/BlkDev/DskATAId.CPP.Z,1",BI=246$ -$LK,"ToggleZorNotZ",A="FL:::/Kernel/BlkDev/DskStrA.CPP.Z,261",BI=247$ -$LK,"VGAP_ATTR_INDEX",A="FL:::/Kernel/KernelA.HPP,3730"$ -$LK,"D3MulEqu",A="FL:::/Kernel/KernelB.HPP,156"$ -$LK,"BDS_CONST",A="FL:::/Kernel/KernelA.HPP,3270"$ -$LK,"MP_MAX_PROCESSORS",A="FL:::/Kernel/KernelA.HPP,303"$ -$LK,"SysGlblsInit",A="FL:::/Kernel/KEnd.CPP.Z,1",BI=248$ -$LK,"PutSrcLink",A="FL:::/Kernel/FunSeg.CPP.Z,295",BI=249$ -$LK,"CMenu",A="FL:::/Kernel/KernelA.HPP,3148"$ -$LK,"BDT_ATAPI",A="FL:::/Kernel/KernelA.HPP,2634"$ -$LK,"FUF_MAP",A="FL:::/Kernel/KernelA.HPP,2603"$ -$LK,"CFAT32DirEntry",A="FL:::/Kernel/KernelA.HPP,2380"$ -$LK,"ACD_POS_END",A="FL:::/Kernel/KernelA.HPP,1510"$ -$LK,"DOCT_INVERT",A="FL:::/Kernel/KernelA.HPP,922"$ -$LK,"CMT_HASH_ENTRY",A="FL:::/Kernel/KernelA.HPP,1694"$ -$LK,"RLf_VGA",A="FL:::/Kernel/KernelA.HPP,439"$ -$LK,"WIf_FOCUS_TASK_IP_WHEEL",A="FL:::/Kernel/KernelA.HPP,1454"$ -$LK,"LAPIC_LVT_PERF",A="FL:::/Kernel/KernelA.HPP,500"$ -$LK,"SC_F1",A="FL:::/Kernel/KernelA.HPP,3579"$ -$LK,"SYS_SEMAS",A="FL:::/Kernel/KStart32.CPP.Z,54"$ -$LK,"SC_F2",A="FL:::/Kernel/KernelA.HPP,3580"$ -$LK,"SYS_VAR_INIT_FLAG",A="FL::/Temp.TXT.Z,1"$ -$LK,"SYS_MEM_INIT_FLAG",A="FL::/Temp.TXT.Z,1"$ -$LK,"SC_F3",A="FL:::/Kernel/KernelA.HPP,3581"$ -$LK,"SignI64",A="FL:::/Kernel/KernelB.HPP,104"$ -$LK,"SC_F4",A="FL:::/Kernel/KernelA.HPP,3582"$ -$LK,"WSSf_SET_TO_POS",A="FL:::/Kernel/KernelA.HPP,3098"$ -$LK,"RS_ATTR_SYSTEM",A="FL:::/Kernel/KernelA.HPP,2528"$ -$LK,"SYS_SEMA_MUTE",A="FL:::/Kernel/KernelA.HPP,610"$ -$LK,"I_BPT",A="FL:::/Kernel/KernelA.HPP,289"$ -$LK,"_TAKE_EXCEPT",A="FL:::/Kernel/KExcept.CPP.Z,20"$ -$LK,"DefineCnt",A="FL:::/Kernel/KDefine.CPP.Z,74",BI=250$ -$LK,"SC_F5",A="FL:::/Kernel/KernelA.HPP,3583"$ -$LK,"WIF_FOCUS_TASK_MENU",A="FL:::/Kernel/KernelA.HPP,1423"$ -$LK,"RedSeaCd",A="FL:::/Kernel/BlkDev/FileSysRedSea.CPP.Z,236",BI=251$ -$LK,"C:/Doc/Bit.TXT.Z",A="FL:::/Kernel/KernelB.HPP,9"$ -$LK,"SC_F6",A="FL:::/Kernel/KernelA.HPP,3584"$ -$LK,"SysGrInit",A="FL:::/Kernel/KEnd.CPP.Z,64",BI=252$ -$LK,"ArcCtrlDel",A="FL:::/Kernel/Compress.CPP.Z,244",BI=253$ -$LK,"SysBadMAlloc",A="FL:::/Kernel/Mem/Mem512.CPP.Z,6",BI=254$ -$LK,"SC_F7",A="FL:::/Kernel/KernelA.HPP,3585"$ -$LK,"DOCSS_NORMAL",A="FL:::/Kernel/KernelA.HPP,1128"$ -$LK,"GVF_EXTERN",A="FL:::/Kernel/KernelA.HPP,868"$ -$LK,"blkdev_text_attr",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,309"$ -$LK,"SPF_NEG_E",A="FL:::/Kernel/KernelA.HPP,3929"$ -$LK,"SC_F8",A="FL:::/Kernel/KernelA.HPP,3586"$ -$LK,"Mute",A="FL:::/Kernel/KMisc.CPP.Z,204",BI=255$ -$LK,"INT_FAULT",A="FL:::/Kernel/KInts.CPP.Z,62"$ -$LK,"progress2_desc",A="FL:::/Kernel/KernelB.HPP,212"$ -$LK,"DCSF_PALETTE_GET",A="FL:::/Kernel/KernelA.HPP,3650"$ -$LK,"SC_F9",A="FL:::/Kernel/KernelA.HPP,3587"$ -$LK,"DOCEF_SOLID_BORDER",A="FL:::/Kernel/KernelA.HPP,1003"$ -$LK,"KbdBuildSC",A="FL:::/Kernel/SerialDev/Keyboard.CPP.Z,301",BI=256$ -$LK,"CInst",A="FL:::/Kernel/KernelA.HPP,1744"$ -$LK,"IOAPICID",A="FL:::/Kernel/KernelA.HPP,512"$ -$LK,"RFLAGf_SIGN",A="FL:::/Kernel/KernelA.HPP,311"$ -$LK,"DKGRAY",A="FL:::/Kernel/KernelA.HPP,2966"$ -$LK,"DOCEF_MARGIN_REL_X",A="FL:::/Kernel/KernelA.HPP,996"$ -$LK,"PutDirLink",A="FL:::/Kernel/BlkDev/DskDirA.CPP.Z,200",BI=257$ -$LK,"EndianU32",A="FL:::/Kernel/KMisc.CPP.Z,15",BI=258$ -$LK,"EndianU16",A="FL:::/Kernel/KMisc.CPP.Z,7",BI=259$ -$LK,"DOCEf_SOLID_BORDER",A="FL:::/Kernel/KernelA.HPP,1091"$ -$LK,"sys_pci_busses",A="FL:::/Kernel/KernelB.HPP,237"$ -$LK,"SPF_NEG_AUX_FMT_NUM",A="FL:::/Kernel/KernelA.HPP,3930"$ -$LK,"BOOT_STK_SIZE",A="FL:::/Kernel/KernelA.HPP,3888"$ -$LK,"TTS_LOCKED_CONST",A="FL:::/Kernel/KernelA.HPP,3276"$ -$LK,"CCf_FUN_EXP",A="FL:::/Kernel/KernelA.HPP,2150"$ -$LK,"CCF_FUN_EXP",A="FL:::/Kernel/KernelA.HPP,2149"$ -$LK,"LAPIC_APIC_VERSION",A="FL:::/Kernel/KernelA.HPP,480"$ -$LK,"PutS",A="FL:::/Kernel/KeyDev.CPP.Z,29",BI=260$ -$LK,"DOCEf_MARGIN_REL_X",A="FL:::/Kernel/KernelA.HPP,1084"$ -$LK,"CDocBin",A="FL:::/Kernel/KernelA.HPP,1114"$ -$LK,"LAPIC_BASE",A="FL:::/Kernel/KernelA.HPP,477"$ -$LK,"MAX_F64",A="FL:::/Kernel/KernelA.HPP,45"$ -$LK,"StrPrintJoin",A="FL:::/Kernel/StrPrint.CPP.Z,208",BI=261$ -$LK,"IA32_GS_BASE",A="FL:::/Kernel/KernelA.HPP,523"$ -$LK,"log2_e",A="FL:::/Kernel/KernelA.HPP,53"$ -$LK,"CurDir",A="FL:::/Kernel/BlkDev/DskStrA.CPP.Z,277",BI=262$ -$LK,"MinU64",A="FL:::/Kernel/KernelB.HPP,102"$ -$LK,"_SYS_HLT",A="FL:::/Kernel/KUtils.CPP.Z,468"$ -$LK,"CCF_AOT_COMPILE",A="FL:::/Kernel/KernelA.HPP,2160"$ -$LK,"OPTf_KEEP_PRIVATE",A="FL:::/Kernel/KernelA.HPP,1542"$ -$LK,"MAX_I32",A="FL:::/Kernel/KernelA.HPP,32"$ -$LK,"MAX_I16",A="FL:::/Kernel/KernelA.HPP,28"$ -$LK,"HTF_EXPORT",A="FL:::/Kernel/KernelA.HPP,703"$ -$LK,"HTf_EXPORT",A="FL:::/Kernel/KernelA.HPP,673"$ -$LK,"DrvDel",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,69",BI=263$ -$LK,"ATAPIReadBlks2",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,385",BI=264$ -$LK,"_D3_UNIT",A="FL:::/Kernel/KMathA.CPP.Z,305"$ -$LK,"CCf_AOT_COMPILE",A="FL:::/Kernel/KernelA.HPP,2161"$ -$LK,"POP_C_REGS",A="FL:::/Kernel/KernelA.HPP,1767"$ -$LK,"_STRIMATCH",A="FL:::/Kernel/StrA.CPP.Z,262"$ -$LK,"DrvChk",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,142",BI=265$ -$LK,"CSema",A="FL:::/Kernel/KernelA.HPP,587"$ -$LK,"EXT_HEAPLOG_MALLOC",A="FL:::/Kernel/KernelA.HPP,577"$ -$LK,"GR_WIDTH",A="FL:::/Kernel/KernelA.HPP,3617"$ -$LK,"DOCT_SOFT_NEW_LINE",A="FL:::/Kernel/KernelA.HPP,902"$ -$LK,"GetBaseUnit",A="FL:::/Kernel/BlkDev/DskAddDev.CPP.Z,176",BI=266$ -$LK,"FixSet",A="FL:::/Kernel/EdLite.CPP.Z,327",BI=267$ -$LK,"IPSet",A="FL:::/Kernel/SerialDev/InputPointer.CPP.Z,43",BI=268$ -$LK,"DOCf_SEL",A="FL:::/Kernel/KernelA.HPP,1322"$ -$LK,"SYS_SEMA_HEAPLOG_LOCK",A="FL:::/Kernel/KernelA.HPP,600"$ -$LK,"sqrt2",A="FL:::/Kernel/KernelA.HPP,56"$ -$LK,"ATAR0_SEL",A="FL:::/Kernel/KernelA.HPP,2283"$ -$LK,"CQueVectU8",A="FL:::/Kernel/KernelA.HPP,162"$ -$LK,"IntFaultHandlersNew",A="FL:::/Kernel/KInts.CPP.Z,166",BI=269$ -$LK,"TASKf_INPUT_FILTER_TASK",A="FL:::/Kernel/KernelA.HPP,3286"$ -$LK,"OM_CB",A="FL:::/Kernel/KernelA.HPP,1871"$ -$LK,"MAX_I64",A="FL:::/Kernel/KernelA.HPP,36"$ -$LK,"throw",A="FL:::/Kernel/KExcept.CPP.Z,83",BI=270$ -$LK,"sys_boot_base",A="FL:::/Kernel/KernelB.HPP,37"$ -$LK,"BDF_READ_ONLY_OVERRIDE",A="FL:::/Kernel/KernelA.HPP,2640"$ -$LK,"TK_AND_AND",A="FL:::/Kernel/KernelA.HPP,2088"$ -$LK,"REG_NONE",A="FL:::/Kernel/KernelA.HPP,1787"$ -$LK,"OC_LOCK_PREFIX",A="FL:::/Kernel/KernelA.HPP,1759"$ -$LK,"WIF_SELF_IP_WHEEL",A="FL:::/Kernel/KernelA.HPP,1416"$ -$LK,"Ff_INTERRUPT",A="FL:::/Kernel/KernelA.HPP,847"$ -$LK,"CFunSegCache",A="FL:::/Kernel/KernelA.HPP,3853"$ -$LK,"OM_CD",A="FL:::/Kernel/KernelA.HPP,1873"$ -$LK,"AAT_ADD_U8",A="FL:::/Kernel/KernelA.HPP,1969"$ -$LK,"REGT_XMM",A="FL:::/Kernel/KernelA.HPP,746"$ -$LK,"DOCSS_CPP_Z_COMMENT",A="FL:::/Kernel/KernelA.HPP,1132"$ -$LK,"DOCT_SHIFTED_X",A="FL:::/Kernel/KernelA.HPP,924"$ -$LK,"PutExcept",A="FL:::/Kernel/KExcept.CPP.Z,45",BI=271$ -$LK,"TestExcept",A="FL:::/Kernel/KExcept.CPP.Z,41"$ -$LK,"CColorROPU32",A="FL:::/Kernel/KernelA.HPP,2983"$ -$LK,"CColorROPU16",A="FL:::/Kernel/KernelA.HPP,2979"$ -$LK,"DOCT_SHIFTED_Y",A="FL:::/Kernel/KernelA.HPP,925"$ -$LK,"HTT_FILE",A="FL:::/Kernel/KernelA.HPP,695"$ -$LK,"HTT_DEFINE_STR",A="FL:::/Kernel/KernelA.HPP,684"$ -$LK,"HTt_FILE",A="FL:::/Kernel/KernelA.HPP,665"$ -$LK,"Push",A="FL:::/Kernel/KernelB.HPP,246"$ -$LK,"SVCf_FREE_ON_COMPLETE",A="FL:::/Kernel/KernelA.HPP,3186"$ -$LK,"HTt_DEFINE_STR",A="FL:::/Kernel/KernelA.HPP,654"$ -$LK,"STK_REP_LEN",A="FL:::/Kernel/KDbg.CPP.Z,102"$ -$LK,"I_NMI",A="FL:::/Kernel/KernelA.HPP,288"$ -$LK,"Date2ISO1",A="FL:::/Kernel/BlkDev/FileSysISO.CPP.Z,1",BI=272$ -$LK,"ModU64",A="FL:::/Kernel/KernelB.HPP,103"$ -$LK,"SVCf_EXIT_ON_COMPLETE",A="FL:::/Kernel/KernelA.HPP,3180"$ -$LK,"DOCG_DBL_BUF_FLAGS",A="FL:::/Kernel/KernelA.HPP,958"$ -$LK,"JobResScan",A="FL:::/Kernel/SrvCmd.CPP.Z,163",BI=273$ -$LK,"WIf_FOCUS_TASK_MENU",A="FL:::/Kernel/KernelA.HPP,1448"$ -$LK,"WIf_SELF_IP_WHEEL",A="FL:::/Kernel/KernelA.HPP,1442"$ -$LK,"CTask",A="FL:::/Kernel/KernelA.HPP,3321"$ -$LK,"OC_JMP_REL8",A="FL:::/Kernel/KernelA.HPP,1763"$ -$LK,"_HASH_SINGLE_TABLE_FIND",A="FL:::/Kernel/KHashA.CPP.Z,143"$ -$LK,"_D3_ZERO",A="FL:::/Kernel/KMathA.CPP.Z,201"$ -$LK,"Str2F64",A="FL:::/Kernel/StrScan.CPP.Z,55",BI=274$ -$LK,"_YIELD",A="FL:::/Kernel/Sched.CPP.Z,157"$ -$LK,"OM_IB",A="FL:::/Kernel/KernelA.HPP,1875"$ -$LK,"progress3_desc",A="FL:::/Kernel/KernelB.HPP,216"$ -$LK,"DCF_SYMMETRY",A="FL:::/Kernel/KernelA.HPP,3634"$ -$LK,"OM_ID",A="FL:::/Kernel/KernelA.HPP,1877"$ -$LK,"OM_CP",A="FL:::/Kernel/KernelA.HPP,1874"$ -$LK,"WIF_FOCUS_TASK_IP_L",A="FL:::/Kernel/KernelA.HPP,1425"$ -$LK,"_ROUND",A="FL:::/Kernel/KMathA.CPP.Z,380"$ -$LK,"RFLAGf_TRAP",A="FL:::/Kernel/KernelA.HPP,312"$ -$LK,"SYS_HASH_BUCKET_FIND",A="FL:::/Kernel/KHashA.CPP.Z,109"$ -$LK,"BOOT_SRC_DVD",A="FL:::/Kernel/KernelA.HPP,3894"$ -$LK,"FUF_RECURSE",A="FL:::/Kernel/KernelA.HPP,2595"$ -$LK,"FUf_RECURSE",A="FL:::/Kernel/KernelA.HPP,2569"$ -$LK,"MemCmp",A="FL:::/Kernel/KernelB.HPP,166"$ -$LK,"SVCf_DONE",A="FL:::/Kernel/KernelA.HPP,3184"$ -$LK,"SC_PAGE_UP",A="FL:::/Kernel/KernelA.HPP,3573"$ -$LK,"User",A="FL:::/Kernel/KTask.CPP.Z,394",BI=275$ -$LK,"WIF_FOCUS_TASK_IP_R",A="FL:::/Kernel/KernelA.HPP,1427"$ -$LK,"DOCEf_RIGHT_EXP",A="FL:::/Kernel/KernelA.HPP,1060"$ -$LK,"DOCEF_RIGHT_EXP",A="FL:::/Kernel/KernelA.HPP,972"$ -$LK,"DirEntryDel",A="FL:::/Kernel/BlkDev/DskDirA.CPP.Z,17",BI=276$ -$LK,"CLexFile",A="FL:::/Kernel/KernelA.HPP,2037"$ -$LK,"OM_CW",A="FL:::/Kernel/KernelA.HPP,1872"$ -$LK,"DOCF_DONT_SWAP_OUT",A="FL:::/Kernel/KernelA.HPP,1277"$ -$LK,"IA32_LAPIC_BASE",A="FL:::/Kernel/KernelA.HPP,520"$ -$LK,"ATACmd",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,59",BI=277$ -$LK,"BusyWait",A="FL:::/Kernel/KMisc.CPP.Z,136",BI=278$ -$LK,"DOCEf_SHIFTED_X",A="FL:::/Kernel/KernelA.HPP,1065"$ -$LK,"DOCEG_DONT_EDIT",A="FL:::/Kernel/KernelA.HPP,1035"$ -$LK,"DOCEF_SHIFTED_X",A="FL:::/Kernel/KernelA.HPP,977"$ -$LK,"DOCEf_SHIFTED_Y",A="FL:::/Kernel/KernelA.HPP,1066"$ -$LK,"DOCEF_SHIFTED_Y",A="FL:::/Kernel/KernelA.HPP,978"$ -$LK,"Str2I64",A="FL:::/Kernel/StrScan.CPP.Z,1",BI=279$ -$LK,"Sqrt",A="FL:::/Kernel/KernelB.HPP,109"$ -$LK,"DrvMap",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,242",BI=280$ -$LK,"NowDateTimeStruct",A="FL:::/Kernel/KDate.CPP.Z,133",BI=281$ -$LK,"YorN",A="FL:::/Kernel/StrB.CPP.Z,87",BI=282$ -$LK,"MT_CD",A="FL:::/Kernel/KernelA.HPP,2543"$ -$LK,"RFLAGf_VINT",A="FL:::/Kernel/KernelA.HPP,322"$ -$LK,"DCF_ON_TOP",A="FL:::/Kernel/KernelA.HPP,3646"$ -$LK,"ACD_DEF",A="FL:::/Kernel/KernelA.HPP,1505"$ -$LK,"DOCEF_BIN_PTR_LINK",A="FL:::/Kernel/KernelA.HPP,975"$ -$LK,"SYS_CPU_STRUCTS",A="FL:::/Kernel/KStart32.CPP.Z,46"$ -$LK,"SVCT_MSG",A="FL:::/Kernel/KernelA.HPP,3190"$ -$LK,"DOCf_DONT_SWAP_OUT",A="FL:::/Kernel/KernelA.HPP,1313"$ -$LK,"CDocEntryBase",A="FL:::/Kernel/KernelA.HPP,1159"$ -$LK,"MLF_STR_DFT_AVAILABLE",A="FL:::/Kernel/KernelA.HPP,776"$ -$LK,"ArcCtrlNew",A="FL:::/Kernel/Compress.CPP.Z,221",BI=283$ -$LK,"DCF_DONT_DRAW",A="FL:::/Kernel/KernelA.HPP,3641"$ -$LK,"SYS_SEMA_HEAPLOG_ACTIVE",A="FL:::/Kernel/KernelA.HPP,599"$ -$LK,"DOC_SCROLL_SPEED",A="FL:::/Kernel/KernelA.HPP,1126"$ -$LK,"ATTRf_SEL",A="FL:::/Kernel/KernelA.HPP,896"$ -$LK,"DOCEf_BIN_PTR_LINK",A="FL:::/Kernel/KernelA.HPP,1063"$ -$LK,"SSF_NO_TENSION",A="FL:::/Kernel/KernelA.HPP,225"$ -$LK,"I32",A="FL:::/Kernel/KernelA.HPP,86"$ -$LK,"I16",A="FL:::/Kernel/KernelA.HPP,72"$ -$LK,"MemCpy",A="FL:::/Kernel/KernelB.HPP,168"$ -$LK,"CT_NONE",A="FL:::/Kernel/KernelA.HPP,3750"$ -$LK,"OM_IW",A="FL:::/Kernel/KernelA.HPP,1876"$ -$LK,"VGAP_DATA",A="FL:::/Kernel/KernelA.HPP,3735"$ -$LK,"OM_NO",A="FL:::/Kernel/KernelA.HPP,1870"$ -$LK,"IET_DATA_HEAP",A="FL:::/Kernel/KernelA.HPP,413"$ -$LK,"GVF_DATA_HEAP",A="FL:::/Kernel/KernelA.HPP,869"$ -$LK,"DefineSub",A="FL:::/Kernel/KDefine.CPP.Z,60",BI=284$ -$LK,"WHITE",A="FL:::/Kernel/KernelA.HPP,2973"$ -$LK,"ATA_READ_MULTI_EXT",A="FL:::/Kernel/KernelA.HPP,2266"$ -$LK,"DOCEF_SCROLLING_X",A="FL:::/Kernel/KernelA.HPP,979"$ -$LK,"DOCEf_CHECKED_COLLAPSED",A="FL:::/Kernel/KernelA.HPP,1093"$ -$LK,"ISO1T_SUPPLEMENTARY_DESC",A="FL:::/Kernel/KernelA.HPP,2480"$ -$LK,"DOCEf_SCROLLING_X",A="FL:::/Kernel/KernelA.HPP,1067"$ -$LK,"MPInt",A="FL:::/Kernel/MultiProc.CPP.Z,132",BI=285$ -$LK,"BOOT_SRC_RAM",A="FL:::/Kernel/KernelA.HPP,3892"$ -$LK,"TK_AND_EQU",A="FL:::/Kernel/KernelA.HPP,2095"$ -$LK,"I64",A="FL:::/Kernel/KernelA.HPP,104"$ -$LK,"MAX_U32",A="FL:::/Kernel/KernelA.HPP,34"$ -$LK,"MAX_U16",A="FL:::/Kernel/KernelA.HPP,30"$ -$LK,"PopUpPrint",A="FL:::/Kernel/SrvCmd.CPP.Z,398",BI=286$ -$LK,"IntEntryGet",A="FL:::/Kernel/KInts.CPP.Z,97",BI=287$ -$LK,"CD2",A="FL:::/Kernel/KernelA.HPP,149"$ -$LK,"KeyDevInit",A="FL:::/Kernel/KeyDev.CPP.Z,201",BI=288$ -$LK,"CCF_HAS_RETURN",A="FL:::/Kernel/KernelA.HPP,2145"$ -$LK,"CAsmArg",A="FL:::/Kernel/KernelA.HPP,1846"$ -$LK,"CD3",A="FL:::/Kernel/KernelA.HPP,155"$ -$LK,"SYS_BOOT_BLK",A="FL:::/Kernel/KStart16.CPP.Z,24"$ -$LK,"progress4_desc",A="FL:::/Kernel/KernelB.HPP,220"$ -$LK,"RFLAGf_ZERO",A="FL:::/Kernel/KernelA.HPP,310"$ -$LK,"DrvFATBlkClean",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,99",BI=289$ -$LK,"CCF_CLASS_IP",A="FL:::/Kernel/KernelA.HPP,2165"$ -$LK,"WIf_FOCUS_TASK_IP_L",A="FL:::/Kernel/KernelA.HPP,1450"$ -$LK,"PCIReadU8",A="FL:::/Kernel/PCIBIOS.CPP.Z,163",BI=290$ -$LK,"SYS_SEMA_SYS_DATE",A="FL:::/Kernel/KernelA.HPP,596"$ -$LK,"EXT_WIN_FOCUS",A="FL:::/Kernel/KernelA.HPP,576"$ -$LK,"ClustersAlloc",A="FL:::/Kernel/BlkDev/DskCluster.CPP.Z,134",BI=291$ -$LK,"WIF_SELF_IP_L",A="FL:::/Kernel/KernelA.HPP,1412"$ -$LK,"MAX_U64",A="FL:::/Kernel/KernelA.HPP,38"$ -$LK,"WIf_SELF_IP_L",A="FL:::/Kernel/KernelA.HPP,1440"$ -$LK,"CHashAC",A="FL:::/Kernel/KernelA.HPP,753"$ -$LK,"DOCf_NO_CURSOR",A="FL:::/Kernel/KernelA.HPP,1296"$ -$LK,"DOCF_NO_CURSOR",A="FL:::/Kernel/KernelA.HPP,1260"$ -$LK,"PrintWarn",A="FL:::/Kernel/StrPrint.CPP.Z,914",BI=292$ -$LK,"LoadOneImport",A="FL:::/Kernel/KLoad.CPP.Z,1",BI=293$ -$LK,"FOpen",A="FL:::/Kernel/BlkDev/DskCFile.CPP.Z,9",BI=294$ -$LK,"CCF_LAST_WAS_DOT",A="FL:::/Kernel/KernelA.HPP,2159"$ -$LK,"CMF_DEFINED",A="FL:::/Kernel/KernelA.HPP,1697"$ -$LK,"WIf_FOCUS_TASK_IP_R",A="FL:::/Kernel/KernelA.HPP,1452"$ -$LK,"HTG_ALL",A="FL:::/Kernel/KernelA.HPP,714"$ -$LK,"sys_var_init_val",A="FL:::/Kernel/KernelB.HPP,186"$ -$LK,"FUF_REPLACE",A="FL:::/Kernel/KernelA.HPP,2600"$ -$LK,"FUf_REPLACE",A="FL:::/Kernel/KernelA.HPP,2574"$ -$LK,"DrvRep",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,328",BI=295$ -$LK,"BlkDevUnlock",A="FL:::/Kernel/BlkDev/DskBlkDev.CPP.Z,15",BI=296$ -$LK,"CMemUsed",A="FL:::/Kernel/KernelA.HPP,2823"$ -$LK,"WIF_SELF_IP_R",A="FL:::/Kernel/KernelA.HPP,1414"$ -$LK,"IntMPCrash",A="FL:::/Kernel/MultiProc.CPP.Z,380",BI=297$ -$LK,"JobQue",A="FL:::/Kernel/MultiProc.CPP.Z,213",BI=298$ -$LK,"TSSBusy",A="FL:::/Kernel/MultiProc.CPP.Z,71",BI=299$ -$LK,"DrvTypeSet",A="FL:::/Kernel/BlkDev/DskFmt.CPP.Z,1",BI=300$ -$LK,"FUF_JUST_AOT",A="FL:::/Kernel/KernelA.HPP,2610"$ -$LK,"FUf_JUST_AOT",A="FL:::/Kernel/KernelA.HPP,2584"$ -$LK,"WIf_SELF_IP_R",A="FL:::/Kernel/KernelA.HPP,1441"$ -$LK,"DirNameAbs",A="FL:::/Kernel/BlkDev/DskStrA.CPP.Z,104",BI=301$ -$LK,"DOF_DONT_HOME",A="FL:::/Kernel/KernelA.HPP,1217"$ -$LK,"CH_ESC",A="FL:::/Kernel/KernelA.HPP,3516"$ -$LK,"DOCEf_DONT_DRAW",A="FL:::/Kernel/KernelA.HPP,1109"$ -$LK,"DOCEF_DONT_DRAW",A="FL:::/Kernel/KernelA.HPP,1023"$ -$LK,"DrvFATBlkAlloc",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,89",BI=302$ -$LK,"WildMatch",A="FL:::/Kernel/StrA.CPP.Z,656",BI=303$ -$LK,"CDC",A="FL:::/Kernel/KernelA.HPP,3661"$ -$LK,"SC_CURSOR_LEFT",A="FL:::/Kernel/KernelA.HPP,3571"$ -$LK,"IsMute",A="FL:::/Kernel/KMisc.CPP.Z,218",BI=304$ -$LK,"DOCT_CLEAR",A="FL:::/Kernel/KernelA.HPP,908"$ -$LK,"DVDImageWrite",A="FL:::/Kernel/BlkDev/DskCDDVD.CPP.Z,147",BI=305$ -$LK,"MouseRst",A="FL:::/Kernel/SerialDev/Mouse.CPP.Z,37",BI=306$ -$LK,"HashTypeNum",A="FL:::/Kernel/KHashB.CPP.Z,1",BI=307$ -$LK,"CPUf_DYING_TASK_QUE",A="FL:::/Kernel/KernelA.HPP,3444"$ -$LK,"BDf_READ_ONLY",A="FL:::/Kernel/KernelA.HPP,2649"$ -$LK,"BDF_READ_ONLY",A="FL:::/Kernel/KernelA.HPP,2639"$ -$LK,"DCF_JUST_MIRROR",A="FL:::/Kernel/KernelA.HPP,3638"$ -$LK,"FSt_UNKNOWN",A="FL:::/Kernel/KernelA.HPP,2693"$ -$LK,"WIG_USER_TASK_DFT",A="FL:::/Kernel/KernelA.HPP,1436"$ -$LK,"sys_cache_line_width",A="FL:::/Kernel/KernelB.HPP,265"$ -$LK,"XchgI64",A="FL:::/Kernel/KernelB.HPP,260"$ -$LK,"SC_CURSOR_DOWN",A="FL:::/Kernel/KernelA.HPP,3570"$ -$LK,"DOF_DONT_WINMGR_SYNC",A="FL:::/Kernel/KernelA.HPP,1220"$ -$LK,"I_SINGLE_STEP",A="FL:::/Kernel/KernelA.HPP,287"$ -$LK,"KbdMouseRst",A="FL:::/Kernel/SerialDev/Mouse.CPP.Z,207",BI=308$ -$LK,"ATA_WRITE_MULTI",A="FL:::/Kernel/KernelA.HPP,2267"$ -$LK,"DOC_COLOR_KEYWORD",A="FL:::/Kernel/KernelA.HPP,1142"$ -$LK,"XTalkStr",A="FL:::/Kernel/SrvCmd.CPP.Z,490",BI=309$ -$LK,"FUF_JUST_GRA",A="FL:::/Kernel/KernelA.HPP,2612"$ -$LK,"FUf_JUST_GRA",A="FL:::/Kernel/KernelA.HPP,2586"$ -$LK,"CCF_IN_QUOTES",A="FL:::/Kernel/KernelA.HPP,2142"$ -$LK,"CFifoU8",A="FL:::/Kernel/KernelA.HPP,170"$ -$LK,"ATAReadNativeMax",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,187",BI=310$ -$LK,"BOOT_SRC_ROM",A="FL:::/Kernel/KernelA.HPP,3891"$ -$LK,"RLF_AUTO_COMPLETE",A="FL:::/Kernel/KernelA.HPP,473"$ -$LK,"SYS_KERNEL_END",A="FL:::/Kernel/KEnd.CPP.Z,218"$ -$LK,"TakeExcept",A="FL:::/Kernel/KExcept.CPP.Z,42"$ -$LK,"_MALLOC",A="FL:::/Kernel/Mem/MAllocFree.CPP.Z,5"$ -$LK,"CHashDefineStr",A="FL:::/Kernel/KernelA.HPP,824"$ -$LK,"MemSet",A="FL:::/Kernel/KernelB.HPP,170"$ -$LK,"_TRUNC",A="FL:::/Kernel/KMathA.CPP.Z,400"$ -$LK,"SPF_SLASH",A="FL:::/Kernel/KernelA.HPP,3924"$ -$LK,"HTF_IMM",A="FL:::/Kernel/KernelA.HPP,705"$ -$LK,"FUF_IGNORE",A="FL:::/Kernel/KernelA.HPP,2597"$ -$LK,"FUf_IGNORE",A="FL:::/Kernel/KernelA.HPP,2571"$ -$LK,"AAT_SUB_U32",A="FL:::/Kernel/KernelA.HPP,1974"$ -$LK,"AAT_SUB_U16",A="FL:::/Kernel/KernelA.HPP,1972"$ -$LK,"IP_MOUSE",A="FL:::/Kernel/KernelA.HPP,3044"$ -$LK,"ATAIDDrvs",A="FL:::/Kernel/BlkDev/DskATAId.CPP.Z,205",BI=311$ -$LK,"UserCmdLine",A="FL:::/Kernel/KTask.CPP.Z,383",BI=312$ -$LK,"GVF_FUN",A="FL:::/Kernel/KernelA.HPP,866"$ -$LK,"IA32F_LME",A="FL:::/Kernel/KernelA.HPP,519"$ -$LK,"LAPICF_APIC_ENABLED",A="FL:::/Kernel/KernelA.HPP,489"$ -$LK,"RLf_AUTO_COMPLETE",A="FL:::/Kernel/KernelA.HPP,454"$ -$LK,"PCIClassFind",A="FL:::/Kernel/PCIBIOS.CPP.Z,265",BI=313$ -$LK,"RECALCF_HAS_CURSOR",A="FL:::/Kernel/KernelA.HPP,1350"$ -$LK,"ATARep",A="FL:::/Kernel/BlkDev/DskATAId.CPP.Z,131",BI=314$ -$LK,"KDInputFilterPutS",A="FL:::/Kernel/KeyDev.CPP.Z,117",BI=315$ -$LK,"D3SubEqu",A="FL:::/Kernel/KernelB.HPP,160"$ -$LK,"FUF_JUST_JIT",A="FL:::/Kernel/KernelA.HPP,2611"$ -$LK,"FUf_JUST_JIT",A="FL:::/Kernel/KernelA.HPP,2585"$ -$LK,"CAsmIns",A="FL:::/Kernel/KernelA.HPP,1834"$ -$LK,"InU32",A="FL:::/Kernel/KernelB.HPP,76"$ -$LK,"InU16",A="FL:::/Kernel/KernelB.HPP,75"$ -$LK,"TK_IF",A="FL:::/Kernel/KernelA.HPP,2100"$ -$LK,"DOCT_BLINK",A="FL:::/Kernel/KernelA.HPP,921"$ -$LK,"U32",A="FL:::/Kernel/KernelA.HPP,78"$ -$LK,"U16",A="FL:::/Kernel/KernelA.HPP,66"$ -$LK,"_XCHG_I64",A="FL:::/Kernel/KUtils.CPP.Z,184"$ -$LK,"ATANop",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,48",BI=316$ -$LK,"TaskDel",A="FL:::/Kernel/KTask.CPP.Z,407",BI=317$ -$LK,"LXchgU8",A="FL:::/Kernel/KernelB.HPP,256"$ -$LK,"AAT_SUB_U64",A="FL:::/Kernel/KernelA.HPP,1976"$ -$LK,"HasLower",A="FL:::/Kernel/FunSeg.CPP.Z,1",BI=318$ -$LK,"_CALL",A="FL:::/Kernel/KUtils.CPP.Z,145"$ -$LK,"IA32F_SCE",A="FL:::/Kernel/KernelA.HPP,518"$ -$LK,"MIN_F64",A="FL:::/Kernel/KernelA.HPP,46"$ -$LK,"__LINE__",A="FL:::/Kernel/KernelA.HPP,2027"$ -$LK,"FUF_FLATTEN_TREE",A="FL:::/Kernel/KernelA.HPP,2616"$ -$LK,"KeyDescSet",A="FL:::/Kernel/KeyDev.CPP.Z,56",BI=319$ -$LK,"U64",A="FL:::/Kernel/KernelA.HPP,94"$ -$LK,"MIN_I32",A="FL:::/Kernel/KernelA.HPP,31"$ -$LK,"MIN_I16",A="FL:::/Kernel/KernelA.HPP,27"$ -$LK,"FSize",A="FL:::/Kernel/BlkDev/DskCFile.CPP.Z,1",BI=320$ -$LK,"IntEntrySet",A="FL:::/Kernel/KInts.CPP.Z,109",BI=321$ -$LK,"Mem32DevIns",A="FL:::/Kernel/Mem/MemPhysical.CPP.Z,1",BI=322$ -$LK,"SYS_MP_CNT_INITIAL",A="FL:::/Kernel/KStart32.CPP.Z,48"$ -$LK,"FUf_FLATTEN_TREE",A="FL:::/Kernel/KernelA.HPP,2590"$ -$LK,"_CEIL",A="FL:::/Kernel/KMathA.CPP.Z,441"$ -$LK,"INVALID_CLUSTER",A="FL:::/Kernel/KernelA.HPP,2300"$ -$LK,"TaskEnd",A="FL:::/Kernel/KTask.CPP.Z,415",BI=323$ -$LK,"MIN_I64",A="FL:::/Kernel/KernelA.HPP,35"$ -$LK,"TaskCaller",A="FL:::/Kernel/KDbg.CPP.Z,75",BI=324$ -$LK,"SV_NONE",A="FL:::/Kernel/KernelA.HPP,1743"$ -$LK,"QUE_VECT_U8_CNT",A="FL:::/Kernel/KernelA.HPP,161"$ -$LK,"RT_I0",A="FL:::/Kernel/KernelA.HPP,1553"$ -$LK,"DOCEF_LEFT_MACRO",A="FL:::/Kernel/KernelA.HPP,971"$ -$LK,"TK_DEREFERENCE",A="FL:::/Kernel/KernelA.HPP,2080"$ -$LK,"ARGT_UIMM8",A="FL:::/Kernel/KernelA.HPP,1889"$ -$LK,"DOCF_NULL_GRAB_SCROLL",A="FL:::/Kernel/KernelA.HPP,1276"$ -$LK,"DOCEf_LEFT_MACRO",A="FL:::/Kernel/KernelA.HPP,1059"$ -$LK,"SYS_GDT",A="FL:::/Kernel/KStart16.CPP.Z,39"$ -$LK,"CDate2Dos",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,1",BI=325$ -$LK,"SrvCmdRunOne",A="FL:::/Kernel/SrvCmd.CPP.Z,267",BI=326$ -$LK,"MRT_UNUSED",A="FL:::/Kernel/KernelA.HPP,2864"$ -$LK,"MDG_REG_DISP_SIB",A="FL:::/Kernel/KernelA.HPP,1587"$ -$LK,"RedSeaFilesDel",A="FL:::/Kernel/BlkDev/FileSysRedSea.CPP.Z,458",BI=327$ -$LK,"XchgU32",A="FL:::/Kernel/KernelB.HPP,262"$ -$LK,"XchgU16",A="FL:::/Kernel/KernelB.HPP,261"$ -$LK,"TK_SHL_EQU",A="FL:::/Kernel/KernelA.HPP,2091"$ -$LK,"CCntsGlbls",A="FL:::/Kernel/KernelA.HPP,537"$ -$LK,"TEMP_BUF_LEN",A="FL:::/Kernel/StrPrint.CPP.Z,205"$ -$LK,"LastDayOfMon",A="FL:::/Kernel/KDate.CPP.Z,82",BI=328$ -$LK,"RT_I8",A="FL:::/Kernel/KernelA.HPP,1555"$ -$LK,"SVCf_WAKE_MASTER",A="FL:::/Kernel/KernelA.HPP,3178"$ -$LK,"CAsmNum",A="FL:::/Kernel/KernelA.HPP,1819"$ -$LK,"_REP_OUT_U16",A="FL:::/Kernel/KUtils.CPP.Z,297"$ -$LK,"_REP_OUT_U32",A="FL:::/Kernel/KUtils.CPP.Z,286"$ -$LK,"VGAM_TEXT",A="FL:::/Kernel/KernelA.HPP,3727"$ -$LK,"ACD_POS",A="FL:::/Kernel/KernelA.HPP,1509"$ -$LK,"FirstDayOfMon",A="FL:::/Kernel/KDate.CPP.Z,71",BI=329$ -$LK,"PutChars",A="FL:::/Kernel/KeyDev.CPP.Z,20",BI=330$ -$LK,"_BEQU",A="FL:::/Kernel/KUtils.CPP.Z,89"$ -$LK,"DOCEf_RAW_TYPE",A="FL:::/Kernel/KernelA.HPP,1064"$ -$LK,"DOCEF_RAW_TYPE",A="FL:::/Kernel/KernelA.HPP,976"$ -$LK,"ansf",A="FL:::/Kernel/KernelA.HPP,3422"$ -$LK,"BlkDevsInitAll",A="FL:::/Kernel/BlkDev/DskAddDev.CPP.Z,216",BI=331$ -$LK,"SysUntry",A="FL:::/Kernel/KExcept.CPP.Z,76",BI=332$ -$LK,"WIF_FOCUS_TASK_BORDER",A="FL:::/Kernel/KernelA.HPP,1430"$ -$LK,"_MEMCMP",A="FL:::/Kernel/KUtils.CPP.Z,70"$ -$LK,"DISPLAYf_NO_BORDER",A="FL:::/Kernel/KernelA.HPP,3301"$ -$LK,"OFF",A="FL:::/Kernel/KernelA.HPP,22"$ -$LK,"DOCF_DO_FULL_REFRESH",A="FL:::/Kernel/KernelA.HPP,1278"$ -$LK,"SYS_BOOT_SRC",A="FL:::/Kernel/KStart16.CPP.Z,23"$ -$LK,"FUF_JUST_SRC",A="FL:::/Kernel/KernelA.HPP,2609"$ -$LK,"FUf_JUST_SRC",A="FL:::/Kernel/KernelA.HPP,2583"$ -$LK,"OC_CALL",A="FL:::/Kernel/KernelA.HPP,1762"$ -$LK,"TaskExe",A="FL:::/Kernel/SrvCmd.CPP.Z,39",BI=333$ -$LK,"ThrowBreak",A="FL:::/Kernel/KExcept.CPP.Z,129",BI=334$ -$LK,"FileWrite",A="FL:::/Kernel/BlkDev/DskFile.CPP.Z,87",BI=335$ -$LK,"ARf_CSPRITE_PTS_RECTANGLES",A="FL:::/Kernel/KernelA.HPP,3906"$ -$LK,"RFLAGf_ID",A="FL:::/Kernel/KernelA.HPP,324"$ -$LK,"SCF_E0_PREFIX",A="FL:::/Kernel/KernelA.HPP,3540"$ -$LK,"SCf_E0_PREFIX",A="FL:::/Kernel/KernelA.HPP,3525"$ -$LK,"ATAWaitNotBUSY",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,24",BI=336$ -$LK,"_XCHG_U16",A="FL:::/Kernel/KUtils.CPP.Z,200"$ -$LK,"_XCHG_U32",A="FL:::/Kernel/KUtils.CPP.Z,192"$ -$LK,"SUF_TO_LOWER",A="FL:::/Kernel/KernelA.HPP,3799"$ -$LK,"ARGT_XMM32",A="FL:::/Kernel/KernelA.HPP,1943"$ -$LK,"WIF_SELF_GRAB_SCROLL",A="FL:::/Kernel/KernelA.HPP,1418"$ -$LK,"LDF_SILENT",A="FL:::/Kernel/KernelA.HPP,369"$ -$LK,"RED",A="FL:::/Kernel/KernelA.HPP,2962"$ -$LK,"RT_U0",A="FL:::/Kernel/KernelA.HPP,1554"$ -$LK,"SYS_SEMA_DEBUG",A="FL:::/Kernel/KernelA.HPP,593"$ -$LK,"SrvCmdDel",A="FL:::/Kernel/SrvCmd.CPP.Z,1",BI=337$ -$LK,"VGAR_MAP_MASK",A="FL:::/Kernel/KernelA.HPP,3745"$ -$LK,"CAOTCtrl",A="FL:::/Kernel/KernelA.HPP,2051"$ -$LK,"SCF_NEW_KEY",A="FL:::/Kernel/KernelA.HPP,3548"$ -$LK,"TASK_CONTEXT_SAVE",A="FL:::/Kernel/Sched.CPP.Z,56"$ -$LK,"SCf_NEW_KEY",A="FL:::/Kernel/KernelA.HPP,3533"$ -$LK,"CDirContext",A="FL:::/Kernel/KernelA.HPP,2771"$ -$LK,"BootDVDProbeAll",A="FL:::/Kernel/BlkDev/DskATAId.CPP.Z,29",BI=338$ -$LK,"SysThrowBreak",A="FL:::/Kernel/KExcept.CPP.Z,115",BI=339$ -$LK,"_MEMCPY",A="FL:::/Kernel/KUtils.CPP.Z,55"$ -$LK,"_D3_DIST_SQR",A="FL:::/Kernel/KMathA.CPP.Z,61"$ -$LK,"ARGT_XMM64",A="FL:::/Kernel/KernelA.HPP,1944"$ -$LK,"ATAWriteBlks",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,461",BI=340$ -$LK,"RT_U8",A="FL:::/Kernel/KernelA.HPP,1556"$ -$LK,"DOCEf_USER_DATA",A="FL:::/Kernel/KernelA.HPP,1068"$ -$LK,"DOCEF_USER_DATA",A="FL:::/Kernel/KernelA.HPP,980"$ -$LK,"COPY_BUF_BLKS",A="FL:::/Kernel/BlkDev/DskCopy.CPP.Z,22"$ -$LK,"FAT32FileWrite",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,813",BI=341$ -$LK,"CISO1Date",A="FL:::/Kernel/KernelA.HPP,2453"$ -$LK,"EDf_BAIL",A="FL:::/Kernel/KernelA.HPP,1252"$ -$LK,"EDF_BAIL",A="FL:::/Kernel/KernelA.HPP,1246"$ -$LK,"ChkCodePtr",A="FL:::/Kernel/KDbg.CPP.Z,16",BI=342$ -$LK,"SYS_RAM_REBOOT",A="FL:::/Kernel/KStart64.CPP.Z,74"$ -$LK,"ISO1T_BOOT_RECORD",A="FL:::/Kernel/KernelA.HPP,2478"$ -$LK,"FileFind",A="FL:::/Kernel/BlkDev/DskFind.CPP.Z,57",BI=343$ -$LK,"SYS_FIND_PCI_SERVICES",A="FL:::/Kernel/PCIBIOS.CPP.Z,38"$ -$LK,"VGAP_ATTR_DATA_WRITE",A="FL:::/Kernel/KernelA.HPP,3731"$ -$LK,"FUF_WHOLE_LABELS_BEFORE",A="FL:::/Kernel/KernelA.HPP,2618"$ -$LK,"TK_MUL_EQU",A="FL:::/Kernel/KernelA.HPP,2093"$ -$LK,"TK_NOT_EQU",A="FL:::/Kernel/KernelA.HPP,2085"$ -$LK,"MIN_U32",A="FL:::/Kernel/KernelA.HPP,33"$ -$LK,"MIN_U16",A="FL:::/Kernel/KernelA.HPP,29"$ -$LK,"CFileNameTo",A="FL:::/Kernel/BlkDev/DskStrB.CPP.Z,1",BI=344$ -$LK,"IntNop",A="FL:::/Kernel/KInts.CPP.Z,143",BI=345$ -$LK,"_D3_MUL_EQU",A="FL:::/Kernel/KMathA.CPP.Z,273"$ -$LK,"DISPLAYf_SHOW",A="FL:::/Kernel/KernelA.HPP,3298"$ -$LK,"DOF_DONT_SHOW",A="FL:::/Kernel/KernelA.HPP,1221"$ -$LK,"HTF_PUBLIC",A="FL:::/Kernel/KernelA.HPP,702"$ -$LK,"HTf_PUBLIC",A="FL:::/Kernel/KernelA.HPP,672"$ -$LK,"SYS_HASH_SINGLE_TABLE_FIND",A="FL:::/Kernel/KHashA.CPP.Z,41"$ -$LK,"OC_OP_SIZE_PREFIX",A="FL:::/Kernel/KernelA.HPP,1757"$ -$LK,"CCF_UNRESOLVED",A="FL:::/Kernel/KernelA.HPP,2147"$ -$LK,"MLF_FUN",A="FL:::/Kernel/KernelA.HPP,777"$ -$LK,"TaskMsg",A="FL:::/Kernel/SrvCmd.CPP.Z,119",BI=346$ -$LK,"RBlks",A="FL:::/Kernel/BlkDev/DskBlk.CPP.Z,31",BI=347$ -$LK,"DOCEF_ZERO_BASED",A="FL:::/Kernel/KernelA.HPP,1014"$ -$LK,"HTF_UNRESOLVED",A="FL:::/Kernel/KernelA.HPP,708"$ -$LK,"FAT32Cd",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,399",BI=348$ -$LK,"DOCEf_ZERO_BASED",A="FL:::/Kernel/KernelA.HPP,1100"$ -$LK,"HTf_UNRESOLVED",A="FL:::/Kernel/KernelA.HPP,678"$ -$LK,"CAP16BitInit",A="FL:::/Kernel/KernelA.HPP,525"$ -$LK,"ATAPIWriteBlks",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,535",BI=349$ -$LK,"cnts",A="FL:::/Kernel/KGlbls.CPP.Z,20"$ -$LK,"chars_bmp_displayable",A="FL:::/Kernel/StrA.CPP.Z,386"$ -$LK,"SYS_HEAP_INIT_FLAG",A="FL::/Temp.TXT.Z,1"$ -$LK,"FUF_WHOLE_LABELS",A="FL:::/Kernel/KernelA.HPP,2617"$ -$LK,"ScanChar",A="FL:::/Kernel/SerialDev/Message.CPP.Z,110",BI=350$ -$LK,"RepInU32",A="FL:::/Kernel/KernelB.HPP,84"$ -$LK,"RepInU16",A="FL:::/Kernel/KernelB.HPP,82"$ -$LK,"loge_2",A="FL:::/Kernel/KernelA.HPP,55"$ -$LK,"MIN_U64",A="FL:::/Kernel/KernelA.HPP,37"$ -$LK,"chars_bmp_white_space",A="FL:::/Kernel/StrA.CPP.Z,356"$ -$LK,"FAT32FileFind",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,298",BI=351$ -$LK,"GSF_SHIFT_ESC_EXIT",A="FL:::/Kernel/KernelA.HPP,3788"$ -$LK,"SFG_WHOLE_LABELS",A="FL:::/Kernel/KernelA.HPP,3809"$ -$LK,"FUf_WHOLE_LABELS",A="FL:::/Kernel/KernelA.HPP,2591"$ -$LK,"DOCf_DO_FULL_REFRESH",A="FL:::/Kernel/KernelA.HPP,1314"$ -$LK,"DOCf_DONT_SHOW",A="FL:::/Kernel/KernelA.HPP,1308"$ -$LK,"DOCF_DONT_SHOW",A="FL:::/Kernel/KernelA.HPP,1272"$ -$LK,"DirTreeDel2",A="FL:::/Kernel/BlkDev/DskDirA.CPP.Z,49",BI=352$ -$LK,"FUF_JUST_TXT",A="FL:::/Kernel/KernelA.HPP,2608"$ -$LK,"FUf_JUST_TXT",A="FL:::/Kernel/KernelA.HPP,2582"$ -$LK,"DOCT_DFT_BACKGROUND",A="FL:::/Kernel/KernelA.HPP,918"$ -$LK,"DOCT_DFT_FOREGROUND",A="FL:::/Kernel/KernelA.HPP,917"$ -$LK,"BOOT_SRC_HARDDRV",A="FL:::/Kernel/KernelA.HPP,3893"$ -$LK,"HashFind",A="FL:::/Kernel/KHashA.CPP.Z,255"$ -$LK,"D3Cross",A="FL:::/Kernel/KernelB.HPP,148"$ -$LK,"MAX_PTR_STARS",A="FL:::/Kernel/KernelA.HPP,771"$ -$LK,"DOCEF_ESC",A="FL:::/Kernel/KernelA.HPP,999"$ -$LK,"_FREE",A="FL:::/Kernel/Mem/MAllocFree.CPP.Z,224"$ -$LK,"SrcLineNum",A="FL:::/Kernel/FunSeg.CPP.Z,184",BI=353$ -$LK,"ATAPIClose",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,521",BI=354$ -$LK,"DOCT_MACRO",A="FL:::/Kernel/KernelA.HPP,933"$ -$LK,"CH_SHIFT_ESC",A="FL:::/Kernel/KernelA.HPP,3517"$ -$LK,"InDbg",A="FL:::/Kernel/KMisc.CPP.Z,265",BI=355$ -$LK,"Dbg",A="FL:::/Kernel/KDbg.CPP.Z,634",BI=356$ -$LK,"Abs",A="FL:::/Kernel/KernelB.HPP,96"$ -$LK,"CDATE_YEAR_DAYS",A="FL:::/Kernel/KernelA.HPP,182"$ -$LK,"RFLAGf_OVERFLOW",A="FL:::/Kernel/KernelA.HPP,315"$ -$LK,"SYS_POW",A="FL:::/Kernel/KMathA.CPP.Z,462"$ -$LK,"StrNICmp",A="FL:::/Kernel/StrA.CPP.Z,315"$ -$LK,"DOCf_NULL_GRAB_SCROLL",A="FL:::/Kernel/KernelA.HPP,1312"$ -$LK,"DOCEf_RIGHT_X",A="FL:::/Kernel/KernelA.HPP,1077"$ -$LK,"DOCEF_RIGHT_X",A="FL:::/Kernel/KernelA.HPP,989"$ -$LK,"DCF_FILL_NOT_COLOR",A="FL:::/Kernel/KernelA.HPP,3644"$ -$LK,"DOCEF_LEN",A="FL:::/Kernel/KernelA.HPP,966"$ -$LK,"FileAttr",A="FL:::/Kernel/BlkDev/DskStrA.CPP.Z,234",BI=357$ -$LK,"_MEMSET",A="FL:::/Kernel/KUtils.CPP.Z,3"$ -$LK,"ROP_COLLISION",A="FL:::/Kernel/KernelA.HPP,2944"$ -$LK,"TK_PLUS_PLUS",A="FL:::/Kernel/KernelA.HPP,2078"$ -$LK,"sys_heap_init_val",A="FL:::/Kernel/KernelB.HPP,182"$ -$LK,"DOCEF_DEREF_DATA",A="FL:::/Kernel/KernelA.HPP,1011"$ -$LK,"VGAP_REG_WRITE",A="FL:::/Kernel/KernelA.HPP,3738"$ -$LK,"FUF_EXPAND",A="FL:::/Kernel/KernelA.HPP,2604"$ -$LK,"FUf_EXPAND",A="FL:::/Kernel/KernelA.HPP,2578"$ -$LK,"DOCEf_DEREF_DATA",A="FL:::/Kernel/KernelA.HPP,1097"$ -$LK,"Del",A="FL:::/Kernel/BlkDev/DskCopy.CPP.Z,82",BI=358$ -$LK,"IDTET_TASK",A="FL:::/Kernel/KernelA.HPP,280"$ -$LK,"TaskValidate",A="FL:::/Kernel/KTask.CPP.Z,19",BI=359$ -$LK,"LAPIC_ARIBITRATION_PRIORITY",A="FL:::/Kernel/KernelA.HPP,482"$ -$LK,"fp_set_std_palette",A="FL:::/Kernel/KGlbls.CPP.Z,34"$ -$LK,"keydev",A="FL:::/Kernel/KGlbls.CPP.Z,26"$ -$LK,"HashBucketFind",A="FL:::/Kernel/KHashA.CPP.Z,260"$ -$LK,"OCF_ALIAS",A="FL:::/Kernel/KernelA.HPP,1949"$ -$LK,"IC_BODY_SIZE",A="FL:::/Kernel/KernelA.HPP,1623"$ -$LK,"chars_bmp_alpha_numeric",A="FL:::/Kernel/StrA.CPP.Z,330"$ -$LK,"_LOG2",A="FL:::/Kernel/KMathA.CPP.Z,603"$ -$LK,"ROPB_COLLISION",A="FL:::/Kernel/KernelA.HPP,2935"$ -$LK,"HTT_WORD",A="FL:::/Kernel/KernelA.HPP,689"$ -$LK,"HTt_WORD",A="FL:::/Kernel/KernelA.HPP,659"$ -$LK,"FUG_FILE_FIND",A="FL:::/Kernel/KernelA.HPP,2624"$ -$LK,"I_PAGE_FAULT",A="FL:::/Kernel/KernelA.HPP,290"$ -$LK,"DrvUnlock",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,14",BI=360$ -$LK,"CProgress",A="FL:::/Kernel/KernelA.HPP,3912"$ -$LK,"Arg",A="FL:::/Kernel/KernelB.HPP,122"$ -$LK,"FSt_ISO9660",A="FL:::/Kernel/KernelA.HPP,2689"$ -$LK,"CallExtNum",A="FL:::/Kernel/KernelB.HPP,55"$ -$LK,"DirFile",A="FL:::/Kernel/BlkDev/DskStrA.CPP.Z,290",BI=361$ -$LK,"DOCEF_TAG",A="FL:::/Kernel/KernelA.HPP,965"$ -$LK,"Btc",A="FL:::/Kernel/KernelB.HPP,16"$ -$LK,"CCF_KEEP_NEW_LINES",A="FL:::/Kernel/KernelA.HPP,2135"$ -$LK,"MDF_RIP_DISP32",A="FL:::/Kernel/KernelA.HPP,1585"$ -$LK,"Dir",A="FL:::/Kernel/BlkDev/DskDirB.CPP.Z,105",BI=362$ -$LK,"Bsf",A="FL:::/Kernel/KernelB.HPP,10"$ -$LK,"MDf_RIP_DISP32",A="FL:::/Kernel/KernelA.HPP,1577"$ -$LK,"ECF_HAS_PUSH_CMP",A="FL:::/Kernel/KernelA.HPP,1625"$ -$LK,"WIf_SELF_GRAB_SCROLL",A="FL:::/Kernel/KernelA.HPP,1444"$ -$LK,"DOCT_PAGE_BREAK",A="FL:::/Kernel/KernelA.HPP,904"$ -$LK,"SYS_SEMA_RECORD_MACRO",A="FL:::/Kernel/KernelA.HPP,594"$ -$LK,"IPVarsUpdate",A="FL:::/Kernel/SerialDev/InputPointer.CPP.Z,9",BI=363$ -$LK,"MLF_LASTCLASS",A="FL:::/Kernel/KernelA.HPP,775"$ -$LK,"_R8",A="FL:::/Kernel/KernelA.HPP,3433"$ -$LK,"_R9",A="FL:::/Kernel/KernelA.HPP,3434"$ -$LK,"FileRead",A="FL:::/Kernel/BlkDev/DskFile.CPP.Z,1",BI=364$ -$LK,"DOCf_HIGHLIGHT",A="FL:::/Kernel/KernelA.HPP,1318"$ -$LK,"DOCF_HIGHLIGHT",A="FL:::/Kernel/KernelA.HPP,1281"$ -$LK,"DOCT_HIGHLIGHT",A="FL:::/Kernel/KernelA.HPP,920"$ -$LK,"_FAR_CALL32",A="FL:::/Kernel/PCIBIOS.CPP.Z,69"$ -$LK,"KbdMouseCmdAck",A="FL:::/Kernel/SerialDev/Keyboard.CPP.Z,65",BI=365$ -$LK,"CAOTHeapGlblRef",A="FL:::/Kernel/KernelA.HPP,1984"$ -$LK,"DOCEF_SEL",A="FL:::/Kernel/KernelA.HPP,1043"$ -$LK,"IEF_IMM_NOT_REL",A="FL:::/Kernel/KernelA.HPP,404"$ -$LK,"FAT32DirFill",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,241",BI=366$ -$LK,"QueCopy",A="FL:::/Kernel/KDataTypes.CPP.Z,53",BI=367$ -$LK,"Carry",A="FL:::/Kernel/KernelB.HPP,240"$ -$LK,"Cos",A="FL:::/Kernel/KernelB.HPP,98"$ -$LK,"Clamp",A="FL:::/Kernel/KMathB.CPP.Z,1",BI=368$ -$LK,"BDF_FMT",A="FL:::/Kernel/KernelA.HPP,2643"$ -$LK,"Name2DirCluster",A="FL:::/Kernel/BlkDev/DskStrB.CPP.Z,10",BI=369$ -$LK,"Bsr",A="FL:::/Kernel/KernelB.HPP,12"$ -$LK,"SYS_PROGRESS1_MAX",A="FL:::/Kernel/KStart32.CPP.Z,32"$ -$LK,"GR_Z_ALL",A="FL:::/Kernel/KernelA.HPP,3623"$ -$LK,"CMasterBoot",A="FL:::/Kernel/KernelA.HPP,2314"$ -$LK,"Fix",A="FL:::/Kernel/EdLite.CPP.Z,337",BI=370$ -$LK,"Btr",A="FL:::/Kernel/KernelB.HPP,18"$ -$LK,"_LN",A="FL:::/Kernel/KMathA.CPP.Z,614"$ -$LK,"OPTf_WARN_UNUSED_VAR",A="FL:::/Kernel/KernelA.HPP,1538"$ -$LK,"DOCF_SUPERSCRIPT_MODE",A="FL:::/Kernel/KernelA.HPP,1290"$ -$LK,"RFLAGf_CARRY",A="FL:::/Kernel/KernelA.HPP,307"$ -$LK,"FAT32FileRead",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,367",BI=371$ -$LK,"DirFilesFlatten",A="FL:::/Kernel/BlkDev/DskDirA.CPP.Z,136",BI=372$ -$LK,"FileExtDot",A="FL:::/Kernel/BlkDev/DskStrA.CPP.Z,1",BI=373$ -$LK,"IsDbg",A="FL:::/Kernel/KMisc.CPP.Z,270",BI=374$ -$LK,"Bts",A="FL:::/Kernel/KernelB.HPP,20"$ -$LK,"CMemBlk",A="FL:::/Kernel/KernelA.HPP,2858"$ -$LK,"DOCEF_LST",A="FL:::/Kernel/KernelA.HPP,1017"$ -$LK,"Man",A="FL:::/Kernel/FunSeg.CPP.Z,324",BI=375$ -$LK,"Mem512Alloc",A="FL:::/Kernel/Mem/Mem512.CPP.Z,11",BI=376$ -$LK,"TK_SHR_EQU",A="FL:::/Kernel/KernelA.HPP,2092"$ -$LK,"CDATE_FREQ",A="FL:::/Kernel/KernelA.HPP,551"$ -$LK,"FilesFind",A="FL:::/Kernel/BlkDev/DskFind.CPP.Z,30",BI=377$ -$LK,"_HASH_FIND",A="FL:::/Kernel/KHashA.CPP.Z,129"$ -$LK,"MSize",A="FL:::/Kernel/Mem/MAllocFree.CPP.Z,384"$ -$LK,"CSysFixedArea",A="FL:::/Kernel/KernelA.HPP,3474"$ -$LK,"Fmt",A="FL:::/Kernel/BlkDev/DskFmt.CPP.Z,53",BI=378$ -$LK,"ExeCmdLine",A="FL:::/Kernel/KTask.CPP.Z,270",BI=379$ -$LK,"Log10",A="FL:::/Kernel/KernelB.HPP,135"$ -$LK,"FifoI64Flush",A="FL:::/Kernel/KDataTypes.CPP.Z,304",BI=380$ -$LK,"InvlPg",A="FL:::/Kernel/KernelB.HPP,273"$ -$LK,"CallExtStr",A="FL:::/Kernel/KernelB.HPP,46"$ -$LK,"VGAM_GRAPHICS",A="FL:::/Kernel/KernelA.HPP,3726"$ -$LK,"DCF_LOCATE_NEAREST",A="FL:::/Kernel/KernelA.HPP,3640"$ -$LK,"Ff_ARGPOP",A="FL:::/Kernel/KernelA.HPP,849"$ -$LK,"SCF_ALT",A="FL:::/Kernel/KernelA.HPP,3544"$ -$LK,"CViewAngles",A="FL:::/Kernel/KernelA.HPP,3107"$ -$LK,"CArrayDim",A="FL:::/Kernel/KernelA.HPP,782"$ -$LK,"DOCEf_NUM_FLAGS",A="FL:::/Kernel/KernelA.HPP,1112"$ -$LK,"Ff_INTERNAL",A="FL:::/Kernel/KernelA.HPP,851"$ -$LK,"Drv",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,253",BI=381$ -$LK,"Fclex",A="FL:::/Kernel/KernelB.HPP,129"$ -$LK,"MDF_DISP",A="FL:::/Kernel/KernelA.HPP,1583"$ -$LK,"MDf_DISP",A="FL:::/Kernel/KernelA.HPP,1575"$ -$LK,"Blink",A="FL:::/Kernel/KMisc.CPP.Z,130",BI=382$ -$LK,"CDbgInfo",A="FL:::/Kernel/KernelA.HPP,718"$ -$LK,"IET_ZEROED_DATA_HEAP",A="FL:::/Kernel/KernelA.HPP,414"$ -$LK,"RFLAGf_V8086",A="FL:::/Kernel/KernelA.HPP,320"$ -$LK,"IDTET_TRAP",A="FL:::/Kernel/KernelA.HPP,282"$ -$LK,"SetRBP",A="FL:::/Kernel/KernelB.HPP,248"$ -$LK,"LTGREEN",A="FL:::/Kernel/KernelA.HPP,2968"$ -$LK,"DOCf_BLINK",A="FL:::/Kernel/KernelA.HPP,1320"$ -$LK,"DOCF_BLINK",A="FL:::/Kernel/KernelA.HPP,1283"$ -$LK,"DOCEf_HIGHLIGHT",A="FL:::/Kernel/KernelA.HPP,1045"$ -$LK,"DOCEF_HIGHLIGHT",A="FL:::/Kernel/KernelA.HPP,1039"$ -$LK,"SysSymImportsResolve",A="FL:::/Kernel/KLoad.CPP.Z,55",BI=383$ -$LK,"RS_ATTR_HIDDEN",A="FL:::/Kernel/KernelA.HPP,2527"$ -$LK,"TaskEndNow",A="FL:::/Kernel/Sched.CPP.Z,285"$ -$LK,"Max",A="FL:::/Kernel/KMathB.CPP.Z,18",BI=384$ -$LK,"SYS_HASH_FIND",A="FL:::/Kernel/KHashA.CPP.Z,89"$ -$LK,"ROPF_DITHER",A="FL:::/Kernel/KernelA.HPP,2953"$ -$LK,"ICF_PREV_DELETED",A="FL:::/Kernel/KernelA.HPP,1619"$ -$LK,"WIG_DBL_CLICK",A="FL:::/Kernel/KernelA.HPP,1433"$ -$LK,"SYS_SEMA_FIX",A="FL:::/Kernel/KernelA.HPP,614"$ -$LK,"ToF64",A="FL:::/Kernel/KernelB.HPP,120"$ -$LK,"SYS_PROGRESS2_MAX",A="FL:::/Kernel/KStart32.CPP.Z,35"$ -$LK,"CH_SHIFT_SPACE",A="FL:::/Kernel/KernelA.HPP,3518"$ -$LK,"ROPBF_DITHER",A="FL:::/Kernel/KernelA.HPP,2939"$ -$LK,"FF_WRITE",A="FL:::/Kernel/KernelA.HPP,2780"$ -$LK,"SetRAX",A="FL:::/Kernel/KernelB.HPP,247"$ -$LK,"Min",A="FL:::/Kernel/KMathB.CPP.Z,10",BI=385$ -$LK,"mp_cnt",A="FL:::/Kernel/KernelB.HPP,228"$ -$LK,"Exp",A="FL:::/Kernel/KernelB.HPP,128"$ -$LK,"DCF_RECORD_EXTENTS",A="FL:::/Kernel/KernelA.HPP,3645"$ -$LK,"FAT32FilesFind",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,846",BI=386$ -$LK,"ISO1Cd",A="FL:::/Kernel/BlkDev/FileSysISO.CPP.Z,159",BI=387$ -$LK,"_HASH_ADD_AFTER",A="FL:::/Kernel/KHashA.CPP.Z,191"$ -$LK,"QueInit",A="FL:::/Kernel/KernelB.HPP,66"$ -$LK,"SrvTaskCont",A="FL:::/Kernel/KTask.CPP.Z,336",BI=388$ -$LK,"RS_ATTR_READ_ONLY",A="FL:::/Kernel/KernelA.HPP,2526"$ -$LK,"ICF_USE_UNSIGNED",A="FL:::/Kernel/KernelA.HPP,1598"$ -$LK,"ATAGetDevId",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,163",BI=389$ -$LK,"WBlks",A="FL:::/Kernel/BlkDev/DskBlk.CPP.Z,71",BI=390$ -$LK,"DOCT_ERROR",A="FL:::/Kernel/KernelA.HPP,942"$ -$LK,"CopySingle",A="FL:::/Kernel/BlkDev/DskCopy.CPP.Z,23",BI=391$ -$LK,"EXT_WIN_TO_TOP",A="FL:::/Kernel/KernelA.HPP,575"$ -$LK,"MouseIPSet",A="FL:::/Kernel/SerialDev/Mouse.CPP.Z,195",BI=392$ -$LK,"ATAPIReadCapacity",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,253",BI=393$ -$LK,"MkDir",A="FL:::/Kernel/BlkDev/DskDirB.CPP.Z,165",BI=394$ -$LK,"IsDir",A="FL:::/Kernel/BlkDev/DskDirB.CPP.Z,90",BI=395$ -$LK,"SetMSR",A="FL:::/Kernel/KernelB.HPP,258"$ -$LK,"ToI64",A="FL:::/Kernel/KernelB.HPP,121"$ -$LK,"IET_MAIN",A="FL:::/Kernel/KernelA.HPP,415"$ -$LK,"ScanCode2KeyName",A="FL:::/Kernel/SerialDev/Keyboard.CPP.Z,248",BI=396$ -$LK,"DOCf_INVERT",A="FL:::/Kernel/KernelA.HPP,1321"$ -$LK,"DOCF_INVERT",A="FL:::/Kernel/KernelA.HPP,1284"$ -$LK,"sys_heap_limit",A="FL:::/Kernel/KernelB.HPP,194"$ -$LK,"FileExtRem",A="FL:::/Kernel/BlkDev/DskStrA.CPP.Z,10",BI=397$ -$LK,"Tan",A="FL:::/Kernel/KernelB.HPP,118"$ -$LK,"SYS_PROGRESS3_MAX",A="FL:::/Kernel/KStart32.CPP.Z,38"$ -$LK,"SUF_REM_LEADING",A="FL:::/Kernel/KernelA.HPP,3794"$ -$LK,"OPTf_USE_IMM64",A="FL:::/Kernel/KernelA.HPP,1547"$ -$LK,"Raw",A="FL:::/Kernel/KMisc.CPP.Z,243",BI=398$ -$LK,"Msg",A="FL:::/Kernel/SrvCmd.CPP.Z,257",BI=399$ -$LK,"OPTf_GLBLS_ON_DATA_HEAP",A="FL:::/Kernel/KernelA.HPP,1544"$ -$LK,"KbdInit",A="FL:::/Kernel/SerialDev/Keyboard.CPP.Z,424",BI=400$ -$LK,"chars_bmp_zero_tab_ff_cr_nl_cursor_dollar",A="FL:::/Kernel/StrA.CPP.Z,368"$ -$LK,"ToBool",A="FL:::/Kernel/KernelB.HPP,119"$ -$LK,"TASKf_KILL_AFTER_DBG",A="FL:::/Kernel/KernelA.HPP,3294"$ -$LK,"IRQMouse",A="FL:::/Kernel/SerialDev/Mouse.CPP.Z,13",BI=401$ -$LK,"PUT_HEX_U16",A="FL:::/Kernel/StrA.CPP.Z,37"$ -$LK,"PUT_HEX_U32",A="FL:::/Kernel/StrA.CPP.Z,30"$ -$LK,"ATAPIStartStop",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,144",BI=402$ -$LK,"_SIGN",A="FL:::/Kernel/KMathA.CPP.Z,347"$ -$LK,"REGT_R8",A="FL:::/Kernel/KernelA.HPP,739"$ -$LK,"log10_2",A="FL:::/Kernel/KernelA.HPP,54"$ -$LK,"PrintErr",A="FL:::/Kernel/StrPrint.CPP.Z,906",BI=403$ -$LK,"ROPF_TWO_SIDED",A="FL:::/Kernel/KernelA.HPP,2950"$ -$LK,"BDF_READ_CACHE",A="FL:::/Kernel/KernelA.HPP,2642"$ -$LK,"SCF_INS",A="FL:::/Kernel/KernelA.HPP,3552"$ -$LK,"CPUf_RAN_A_TASK",A="FL:::/Kernel/KernelA.HPP,3443"$ -$LK,"BDf_READ_CACHE",A="FL:::/Kernel/KernelA.HPP,2652"$ -$LK,"Snd",A="FL:::/Kernel/KMisc.CPP.Z,163",BI=404$ -$LK,"GetChar",A="FL:::/Kernel/SerialDev/Message.CPP.Z,182",BI=405$ -$LK,"Sin",A="FL:::/Kernel/KernelB.HPP,105"$ -$LK,"SPF_PAD_ZERO",A="FL:::/Kernel/KernelA.HPP,3919"$ -$LK,"TK_OR_OR",A="FL:::/Kernel/KernelA.HPP,2089"$ -$LK,"SYS_PCIBIOS_SERVICE_CALL",A="FL:::/Kernel/PCIBIOS.CPP.Z,46"$ -$LK,"Now",A="FL:::/Kernel/KDate.CPP.Z,191",BI=406$ -$LK,"Fldcw",A="FL:::/Kernel/KernelB.HPP,130"$ -$LK,"TTS_ED_FILENAME",A="FL:::/Kernel/KernelA.HPP,3278"$ -$LK,"WIf_FOCUS_TASK_BORDER",A="FL:::/Kernel/KernelA.HPP,1455"$ -$LK,"IA32_EFER",A="FL:::/Kernel/KernelA.HPP,521"$ -$LK,"SetRSP",A="FL:::/Kernel/KernelB.HPP,250"$ -$LK,"Pop",A="FL:::/Kernel/KernelB.HPP,245"$ -$LK,"sys_progresses",A="FL:::/Kernel/KernelB.HPP,223"$ -$LK,"CMenuEntry",A="FL:::/Kernel/KernelA.HPP,3139"$ -$LK,"OC_NOP2",A="FL:::/Kernel/KernelA.HPP,1764"$ -$LK,"DOCT_RIGHT_MARGIN",A="FL:::/Kernel/KernelA.HPP,911"$ -$LK,"PUT_HEX_U64",A="FL:::/Kernel/StrA.CPP.Z,23"$ -$LK,"SYS_KERNEL",A="FL:::/Kernel/KStart16.CPP.Z,17"$ -$LK,"RFLAGf_PARITY",A="FL:::/Kernel/KernelA.HPP,308"$ -$LK,"SYS_PROGRESS4_MAX",A="FL:::/Kernel/KStart32.CPP.Z,41"$ -$LK,"SUF_TO_UPPER",A="FL:::/Kernel/KernelA.HPP,3798"$ -$LK,"MBR_PT_REDSEA",A="FL:::/Kernel/KernelA.HPP,2707"$ -$LK,"MBR_PT_NTFS",A="FL:::/Kernel/KernelA.HPP,2706"$ -$LK,"MouseHandler",A="FL:::/Kernel/SerialDev/Mouse.CPP.Z,158",BI=407$ -$LK,"SCF_IP_L_DOWN",A="FL:::/Kernel/KernelA.HPP,3549"$ -$LK,"SCf_IP_L_DOWN",A="FL:::/Kernel/KernelA.HPP,3534"$ -$LK,"MSG_IP_L_DOWN",A="FL:::/Kernel/KernelA.HPP,3230"$ -$LK,"LAPIC_TASK_PRIORITY",A="FL:::/Kernel/KernelA.HPP,481"$ -$LK,"REGT_MM",A="FL:::/Kernel/KernelA.HPP,745"$ -$LK,"DOCEf_POPUP",A="FL:::/Kernel/KernelA.HPP,1105"$ -$LK,"DOCEF_POPUP",A="FL:::/Kernel/KernelA.HPP,1019"$ -$LK,"SYS_SEMA_VGA",A="FL:::/Kernel/KernelA.HPP,607"$ -$LK,"ODEF_PAUSED",A="FL:::/Kernel/KernelA.HPP,241"$ -$LK,"FATNameXSum",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,157",BI=408$ -$LK,"Pow",A="FL:::/Kernel/KernelB.HPP,137"$ -$LK,"sys_boot_patch_table_base",A="FL:::/Kernel/KernelB.HPP,39"$ -$LK,"SPF_DOLLAR",A="FL:::/Kernel/KernelA.HPP,3923"$ -$LK,"WIF_SELF_BORDER",A="FL:::/Kernel/KernelA.HPP,1417"$ -$LK,"DOCF_UNDO_DIRTY",A="FL:::/Kernel/KernelA.HPP,1292"$ -$LK,"MStrUtil",A="FL:::/Kernel/StrB.CPP.Z,58",BI=409$ -$LK,"_D3_CROSS",A="FL:::/Kernel/KMathA.CPP.Z,82"$ -$LK,"VGAP_INPUT_STAT",A="FL:::/Kernel/KernelA.HPP,3742"$ -$LK,"DOCf_UNDO_DIRTY",A="FL:::/Kernel/KernelA.HPP,1329"$ -$LK,"SYS_HEAP_LIMIT",A="FL:::/Kernel/KStart32.CPP.Z,7"$ -$LK,"WIf_SELF_BORDER",A="FL:::/Kernel/KernelA.HPP,1443"$ -$LK,"text",A="FL:::/Kernel/KGlbls.CPP.Z,29"$ -$LK,"ATA_READ_NATIVE_MAX_EXT",A="FL:::/Kernel/KernelA.HPP,2262"$ -$LK,"MPrintQ",A="FL:::/Kernel/StrPrint.CPP.Z,56",BI=410$ -$LK,"MHeapCtrl",A="FL:::/Kernel/Mem/MAllocFree.CPP.Z,386"$ -$LK,"CCF_CMD_LINE",A="FL:::/Kernel/KernelA.HPP,2127"$ -$LK,"RECALCt_FIND_CURSOR",A="FL:::/Kernel/KernelA.HPP,1346"$ -$LK,"SYS_SEMA_SND",A="FL:::/Kernel/KernelA.HPP,598"$ -$LK,"CCF_RAX",A="FL:::/Kernel/KernelA.HPP,2156"$ -$LK,"DskCacheInvalidate",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,211",BI=411$ -$LK,"DOCG_BL_IV_UL",A="FL:::/Kernel/KernelA.HPP,951"$ -$LK,"HashSingleTableFind",A="FL:::/Kernel/KHashA.CPP.Z,257"$ -$LK,"sys_data_bp",A="FL:::/Kernel/KernelB.HPP,190"$ -$LK,"SYS_PCI_BUSES",A="FL:::/Kernel/KStart16.CPP.Z,36"$ -$LK,"sys_heap_base",A="FL:::/Kernel/KernelB.HPP,193"$ -$LK,"_CLAMP_I64",A="FL:::/Kernel/KUtils.CPP.Z,121"$ -$LK,"VGAP_MISC_OUTPUT",A="FL:::/Kernel/KernelA.HPP,3733"$ -$LK,"BDf_READ_ONLY_OVERRIDE",A="FL:::/Kernel/KernelA.HPP,2650"$ -$LK,"Spaces2Tabs",A="FL:::/Kernel/StrA.CPP.Z,477",BI=412$ -$LK,"Drv2Let",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,153",BI=413$ -$LK,"ROPBF_TWO_SIDED",A="FL:::/Kernel/KernelA.HPP,2938"$ -$LK,"MEM_E820_ENTRY_SIZE",A="FL:::/Kernel/KernelA.HPP,357"$ -$LK,"KDRawPutS",A="FL:::/Kernel/KeyDev.CPP.Z,97",BI=414$ -$LK,"Sqr",A="FL:::/Kernel/KernelB.HPP,106"$ -$LK,"REG_RDI",A="FL:::/Kernel/KernelA.HPP,1783"$ -$LK,"REG_ALLOC",A="FL:::/Kernel/KernelA.HPP,1788"$ -$LK,"DOCf_SUPERSCRIPT_MODE",A="FL:::/Kernel/KernelA.HPP,1327"$ -$LK,"SrvCmdsHandler",A="FL:::/Kernel/SrvCmd.CPP.Z,350",BI=415$ -$LK,"progress1_max",A="FL:::/Kernel/KernelB.HPP,209"$ -$LK,"CCF_ARRAY",A="FL:::/Kernel/KernelA.HPP,2155"$ -$LK,"REG_RBP",A="FL:::/Kernel/KernelA.HPP,1781"$ -$LK,"DOCEF_FILTER_SKIP",A="FL:::/Kernel/KernelA.HPP,1021"$ -$LK,"FifoU8Flush",A="FL:::/Kernel/KDataTypes.CPP.Z,219",BI=416$ -$LK,"MSG_MOVE",A="FL:::/Kernel/KernelA.HPP,3240"$ -$LK,"SYS_PROGRESSES",A="FL:::/Kernel/KStart32.CPP.Z,31"$ -$LK,"SUF_REM_SPACES",A="FL:::/Kernel/KernelA.HPP,3796"$ -$LK,"CCF_PMT",A="FL:::/Kernel/KernelA.HPP,2128"$ -$LK,"DOCEf_FILTER_SKIP",A="FL:::/Kernel/KernelA.HPP,1107"$ -$LK,"DskCacheHash",A="FL:::/Kernel/BlkDev/DskCache.CPP.Z,40",BI=417$ -$LK,"SCF_NUM",A="FL:::/Kernel/KernelA.HPP,3546"$ -$LK,"ACD_DEF_FILENAME",A="FL:::/Kernel/KernelA.HPP,1500"$ -$LK,"fp_doc_put",A="FL:::/Kernel/KGlbls.CPP.Z,33"$ -$LK,"DskCacheFind",A="FL:::/Kernel/BlkDev/DskCache.CPP.Z,64",BI=418$ -$LK,"IsRaw",A="FL:::/Kernel/KMisc.CPP.Z,250",BI=419$ -$LK,"TK_DBL_COLON",A="FL:::/Kernel/KernelA.HPP,2081"$ -$LK,"ATAPIReadTrackInfo",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,277",BI=420$ -$LK,"CATARep",A="FL:::/Kernel/KernelA.HPP,2251"$ -$LK,"REG_RAX",A="FL:::/Kernel/KernelA.HPP,1776"$ -$LK,"ATAReadBlks",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,350",BI=421$ -$LK,"D3AddEqu",A="FL:::/Kernel/KernelB.HPP,146"$ -$LK,"ToUpper",A="FL:::/Kernel/KernelB.HPP,58"$ -$LK,"REG_RBX",A="FL:::/Kernel/KernelA.HPP,1779"$ -$LK,"SCR_DONE",A="FL:::/Kernel/SrvCmd.CPP.Z,263"$ -$LK,"MDG_MASK",A="FL:::/Kernel/KernelA.HPP,1586"$ -$LK,"ACD_EXTRA_CHAR",A="FL:::/Kernel/KernelA.HPP,1520"$ -$LK,"Reboot",A="FL:::/Kernel/KEnd.CPP.Z,121",BI=422$ -$LK,"acd",A="FL:::/Kernel/KGlbls.CPP.Z,17"$ -$LK,"TK_DOT_DOT_DOT",A="FL:::/Kernel/KernelA.HPP,2109"$ -$LK,"REG_RCX",A="FL:::/Kernel/KernelA.HPP,1777"$ -$LK,"Ff_DOT_DOT_DOT",A="FL:::/Kernel/KernelA.HPP,853"$ -$LK,"CHashClass",A="FL:::/Kernel/KernelA.HPP,833"$ -$LK,"ZERO_BUF_SIZE",A="FL:::/Kernel/BlkDev/DskBlk.CPP.Z,1"$ -$LK,"LoadKernel",A="FL:::/Kernel/KLoad.CPP.Z,240",BI=423$ -$LK,"SCF_KEY_UP",A="FL:::/Kernel/KernelA.HPP,3541"$ -$LK,"SCf_KEY_UP",A="FL:::/Kernel/KernelA.HPP,3526"$ -$LK,"MSG_IP_R_D_DOWN",A="FL:::/Kernel/KernelA.HPP,3236"$ -$LK,"ICF_BY_VAL",A="FL:::/Kernel/KernelA.HPP,1602"$ -$LK,"REG_RDX",A="FL:::/Kernel/KernelA.HPP,1778"$ -$LK,"ATAPIReadBlks",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,413",BI=424$ -$LK,"REG_RIP",A="FL:::/Kernel/KernelA.HPP,1785"$ -$LK,"DOCEF_FROM_START",A="FL:::/Kernel/KernelA.HPP,1001"$ -$LK,"SEMA_STRUCT_SIZE",A="FL:::/Kernel/KernelA.HPP,584"$ -$LK,"SCR_CONT",A="FL:::/Kernel/SrvCmd.CPP.Z,264"$ -$LK,"progress2_max",A="FL:::/Kernel/KernelB.HPP,213"$ -$LK,"DOCEf_FROM_START",A="FL:::/Kernel/KernelA.HPP,1089"$ -$LK,"SYS_SEMA_TMBEAT",A="FL:::/Kernel/KernelA.HPP,613"$ -$LK,"RLF_WINMGR",A="FL:::/Kernel/KernelA.HPP,470"$ -$LK,"RLf_WINMGR",A="FL:::/Kernel/KernelA.HPP,451"$ -$LK,"SUF_SCALE_INDENT",A="FL:::/Kernel/KernelA.HPP,3802"$ -$LK,"CT_7_BIT",A="FL:::/Kernel/KernelA.HPP,3751"$ -$LK,"PUSH_REGS",A="FL:::/Kernel/KernelA.HPP,1769"$ -$LK,"MAX_I8",A="FL:::/Kernel/KernelA.HPP,24"$ -$LK,"KbdMouseHandler",A="FL:::/Kernel/SerialDev/Mouse.CPP.Z,236",BI=425$ -$LK,"Color2Str",A="FL:::/Kernel/KDefine.CPP.Z,127",BI=426$ -$LK,"MAllocIdent",A="FL:::/Kernel/Mem/MAllocFree.CPP.Z,407",BI=427$ -$LK,"EDF_COLLAPSE",A="FL:::/Kernel/KernelA.HPP,1247"$ -$LK,"LAPIC_DFR",A="FL:::/Kernel/KernelA.HPP,486"$ -$LK,"CDATE_BASE_DAY_OF_WEEK",A="FL:::/Kernel/KernelA.HPP,184"$ -$LK,"StrFirstOcc",A="FL:::/Kernel/StrA.CPP.Z,572",BI=428$ -$LK,"MSG_NULL",A="FL:::/Kernel/KernelA.HPP,3225"$ -$LK,"CCF_QUESTION_HELP",A="FL:::/Kernel/KernelA.HPP,2130"$ -$LK,"EDf_COLLAPSE",A="FL:::/Kernel/KernelA.HPP,1253"$ -$LK,"MPrintq",A="FL:::/Kernel/StrPrint.CPP.Z,113",BI=429$ -$LK,"AMAllocIdent",A="FL:::/Kernel/Mem/MAllocFree.CPP.Z,418",BI=430$ -$LK,"MEM_DFT_STK",A="FL:::/Kernel/KernelA.HPP,2887"$ -$LK,"sys_font_cyrillic",A="FL:::/Kernel/FontCyrillic.CPP.Z,3"$ -$LK,"SYS_FOCUS_TASK",A="FL:::/Kernel/KStart32.CPP.Z,45"$ -$LK,"DYING_JIFFIES",A="FL:::/Kernel/KernelA.HPP,3314"$ -$LK,"dbg",A="FL:::/Kernel/KGlbls.CPP.Z,21"$ -$LK,"QSort",A="FL:::/Kernel/QSort.CPP.Z,85",BI=431$ -$LK,"OutU32",A="FL:::/Kernel/KernelB.HPP,79"$ -$LK,"OutU16",A="FL:::/Kernel/KernelB.HPP,78"$ -$LK,"SYS_SEMA_JUST_PUMP_MSGS",A="FL:::/Kernel/KernelA.HPP,612"$ -$LK,"LAPIC_ICR_HIGH",A="FL:::/Kernel/KernelA.HPP,496"$ -$LK,"LMF_IGNORE_CASE",A="FL:::/Kernel/KernelA.HPP,3812"$ -$LK,"SFF_IGNORE_CASE",A="FL:::/Kernel/KernelA.HPP,3806"$ -$LK,"HashRemDel",A="FL:::/Kernel/KHashA.CPP.Z,264"$ -$LK,"REG_RSI",A="FL:::/Kernel/KernelA.HPP,1782"$ -$LK,"HashAdd",A="FL:::/Kernel/KHashA.CPP.Z,262"$ -$LK,"mp_cnt_lock",A="FL:::/Kernel/KernelB.HPP,230"$ -$LK,"MLF_DOT_DOT_DOT",A="FL:::/Kernel/KernelA.HPP,778"$ -$LK,"IsSuspended",A="FL:::/Kernel/KTask.CPP.Z,59",BI=432$ -$LK,"CAlloc",A="FL:::/Kernel/Mem/MAllocFree.CPP.Z,395",BI=433$ -$LK,"BDF_INITIALIZED",A="FL:::/Kernel/KernelA.HPP,2638"$ -$LK,"CAsmUnresolvedRef",A="FL:::/Kernel/KernelA.HPP,1856"$ -$LK,"BDf_INITIALIZED",A="FL:::/Kernel/KernelA.HPP,2648"$ -$LK,"DOCT_SPRITE",A="FL:::/Kernel/KernelA.HPP,937"$ -$LK,"WClustersBlks",A="FL:::/Kernel/BlkDev/DskCluster.CPP.Z,92",BI=434$ -$LK,"RClustersBlks",A="FL:::/Kernel/BlkDev/DskCluster.CPP.Z,46",BI=435$ -$LK,"sys_neg_pows_lets",A="FL:::/Kernel/StrPrint.CPP.Z,201"$ -$LK,"progress3_max",A="FL:::/Kernel/KernelB.HPP,217"$ -$LK,"SqrI64",A="FL:::/Kernel/KernelB.HPP,107"$ -$LK,"BDF_INIT_IN_PROGRESS",A="FL:::/Kernel/KernelA.HPP,2644"$ -$LK,"OPTF_ECHO",A="FL:::/Kernel/KernelA.HPP,1549"$ -$LK,"OPTf_ECHO",A="FL:::/Kernel/KernelA.HPP,1536"$ -$LK,"LAPIC_EOI",A="FL:::/Kernel/KernelA.HPP,484"$ -$LK,"sys_pos_pows_lets",A="FL:::/Kernel/StrPrint.CPP.Z,200"$ -$LK,"QueSize",A="FL:::/Kernel/KDataTypes.CPP.Z,76",BI=436$ -$LK,"C:/Doc/Que.TXT.Z",A="FL:::/Kernel/KernelB.HPP,65"$ -$LK,"CT_8_BIT",A="FL:::/Kernel/KernelA.HPP,3752"$ -$LK,"REG_RSP",A="FL:::/Kernel/KernelA.HPP,1780"$ -$LK,"CtrlAltDel",A="FL:::/Kernel/KeyDev.CPP.Z,128",BI=437$ -$LK,"CTRLF_CAPTURE_LEFT_IP",A="FL:::/Kernel/KernelA.HPP,3094"$ -$LK,"LFSF_DEFINE",A="FL:::/Kernel/KernelA.HPP,2036"$ -$LK,"BLK_SIZE_BITS",A="FL:::/Kernel/KernelA.HPP,2296"$ -$LK,"AOT_BIN_BLK_BITS",A="FL:::/Kernel/KernelA.HPP,1797"$ -$LK,"HTT_FUN",A="FL:::/Kernel/KernelA.HPP,688"$ -$LK,"I_DIV_ZERO",A="FL:::/Kernel/KernelA.HPP,286"$ -$LK,"SrvCtrlInit",A="FL:::/Kernel/SrvCmd.CPP.Z,18",BI=438$ -$LK,"DOCEF_DEFINE",A="FL:::/Kernel/KernelA.HPP,968"$ -$LK,"SPF_LEFT_JUSTIFY",A="FL:::/Kernel/KernelA.HPP,3920"$ -$LK,"DOCEf_DEFINE",A="FL:::/Kernel/KernelA.HPP,1056"$ -$LK,"HeapCtrlInit",A="FL:::/Kernel/Mem/HeapCtrl.CPP.Z,1",BI=439$ -$LK,"progress1",A="FL:::/Kernel/KernelB.HPP,206"$ -$LK,"Floor",A="FL:::/Kernel/KernelB.HPP,131"$ -$LK,"CIPStateGlbls",A="FL:::/Kernel/KernelA.HPP,3045"$ -$LK,"SYSf_CTRL_ALT_C",A="FL:::/Kernel/KernelA.HPP,618"$ -$LK,"progress2",A="FL:::/Kernel/KernelB.HPP,210"$ -$LK,"_CLAMP_U64",A="FL:::/Kernel/KUtils.CPP.Z,133"$ -$LK,"progress3",A="FL:::/Kernel/KernelB.HPP,214"$ -$LK,"MPN_VECT",A="FL:::/Kernel/KernelA.HPP,505"$ -$LK,"MAX_U8",A="FL:::/Kernel/KernelA.HPP,26"$ -$LK,"RAWDR_COL",A="FL:::/Kernel/KDbg.CPP.Z,289"$ -$LK,"progress4",A="FL:::/Kernel/KernelB.HPP,218"$ -$LK,"CtrlAltCBSet",A="FL:::/Kernel/KeyDev.CPP.Z,178",BI=440$ -$LK,"SysTimerRead",A="FL:::/Kernel/KMisc.CPP.Z,61",BI=441$ -$LK,"dev",A="FL:::/Kernel/KGlbls.CPP.Z,22"$ -$LK,"MSG_IP_L_D_UP",A="FL:::/Kernel/KernelA.HPP,3233"$ -$LK,"FunSegCacheFind",A="FL:::/Kernel/FunSeg.CPP.Z,114",BI=442$ -$LK,"HTT_REG",A="FL:::/Kernel/KernelA.HPP,694"$ -$LK,"StrFirstRem",A="FL:::/Kernel/StrA.CPP.Z,582",BI=443$ -$LK,"SYS_VAR_INIT_VAL",A="FL::/Temp.TXT.Z,1"$ -$LK,"DCF_COMPRESSED",A="FL:::/Kernel/KernelA.HPP,3627"$ -$LK,"ans",A="FL:::/Kernel/KernelA.HPP,3421"$ -$LK,"ICF_DEL_PREV_INS",A="FL:::/Kernel/KernelA.HPP,1618"$ -$LK,"LAPIC_LDR",A="FL:::/Kernel/KernelA.HPP,487"$ -$LK,"BptFind",A="FL:::/Kernel/KDbg.CPP.Z,344",BI=444$ -$LK,"kbd",A="FL:::/Kernel/KGlbls.CPP.Z,25"$ -$LK,"progress4_max",A="FL:::/Kernel/KernelB.HPP,221"$ -$LK,"MouseUpdatePost",A="FL:::/Kernel/SerialDev/Mouse.CPP.Z,126",BI=445$ -$LK,"HashDel",A="FL:::/Kernel/KHashB.CPP.Z,59",BI=446$ -$LK,"CKbdStateGlbls",A="FL:::/Kernel/KernelA.HPP,3002"$ -$LK,"sys_font_std",A="FL:::/Kernel/FontStd.CPP.Z,3"$ -$LK,"LinkedLstCopy",A="FL:::/Kernel/KDataTypes.CPP.Z,11",BI=447$ -$LK,"IP_NULL",A="FL:::/Kernel/KernelA.HPP,3043"$ -$LK,"MDF_NULL",A="FL:::/Kernel/KernelA.HPP,1579"$ -$LK,"SYS_SEMA_DEV_MEM",A="FL:::/Kernel/KernelA.HPP,606"$ -$LK,"ICF_A1_WAS_STK",A="FL:::/Kernel/KernelA.HPP,1607"$ -$LK,"Let2Drv",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,177",BI=448$ -$LK,"fat_long_name_map",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,183"$ -$LK,"DskCacheInit",A="FL:::/Kernel/BlkDev/DskCache.CPP.Z,1",BI=449$ -$LK,"CCF_NO_ABSS",A="FL:::/Kernel/KernelA.HPP,2162"$ -$LK,"DOC_COLOR_MACRO",A="FL:::/Kernel/KernelA.HPP,1137"$ -$LK,"LAPIC_LOG_DST",A="FL:::/Kernel/KernelA.HPP,485"$ -$LK,"RLF_ADAM_SERVER",A="FL:::/Kernel/KernelA.HPP,474"$ -$LK,"RClusters",A="FL:::/Kernel/BlkDev/DskCluster.CPP.Z,87",BI=450$ -$LK,"VGAP_IDX",A="FL:::/Kernel/KernelA.HPP,3734"$ -$LK,"ISO1CDirFill",A="FL:::/Kernel/BlkDev/FileSysISO.CPP.Z,56",BI=451$ -$LK,"RLf_ADAM_SERVER",A="FL:::/Kernel/KernelA.HPP,455"$ -$LK,"SCR_EXIT",A="FL:::/Kernel/SrvCmd.CPP.Z,265"$ -$LK,"QueDel",A="FL:::/Kernel/KDataTypes.CPP.Z,41",BI=452$ -$LK,"ICF_DONT_RESTORE",A="FL:::/Kernel/KernelA.HPP,1620"$ -$LK,"RedSeaDirNew",A="FL:::/Kernel/BlkDev/FileSysRedSea.CPP.Z,352",BI=453$ -$LK,"IET_REL64_EXPORT",A="FL:::/Kernel/KernelA.HPP,408"$ -$LK,"IET_REL32_EXPORT",A="FL:::/Kernel/KernelA.HPP,406"$ -$LK,"CExcept",A="FL:::/Kernel/KernelA.HPP,3165"$ -$LK,"QueInsRev",A="FL:::/Kernel/KernelB.HPP,70"$ -$LK,"SYSf_CTRL_ALT_X",A="FL:::/Kernel/KernelA.HPP,619"$ -$LK,"SYS_EXTERN_TABLE",A="FL:::/Kernel/KStart32.CPP.Z,25"$ -$LK,"FUF_CLUSTER_ORDER",A="FL:::/Kernel/KernelA.HPP,2614"$ -$LK,"DOCT_HTML_CODE",A="FL:::/Kernel/KernelA.HPP,941"$ -$LK,"LAPIC_IRR",A="FL:::/Kernel/KernelA.HPP,494"$ -$LK,"chars_bmp_getkey",A="FL:::/Kernel/StrA.CPP.Z,371"$ -$LK,"sys_run_level",A="FL:::/Kernel/KernelB.HPP,41"$ -$LK,"JIFFY_FREQ",A="FL:::/Kernel/KernelA.HPP,550"$ -$LK,"COrder2D3",A="FL:::/Kernel/KernelA.HPP,200"$ -$LK,"TaskRegAddr",A="FL:::/Kernel/KDbg.CPP.Z,266",BI=454$ -$LK,"DCSF_COMPRESSED",A="FL:::/Kernel/KernelA.HPP,3649"$ -$LK,"LAPIC_ISR",A="FL:::/Kernel/KernelA.HPP,492"$ -$LK,"c32_eflags",A="FL:::/Kernel/PCIBIOS.CPP.Z,158"$ -$LK,"Pow10",A="FL:::/Kernel/KernelB.HPP,138"$ -$LK,"ATA_WRITE_MULTI_EXT",A="FL:::/Kernel/KernelA.HPP,2268"$ -$LK,"CCF_PREDEC",A="FL:::/Kernel/KernelA.HPP,2154"$ -$LK,"inf",A="FL:::/Kernel/KernelA.HPP,47"$ -$LK,"MIN_I8",A="FL:::/Kernel/KernelA.HPP,23"$ -$LK,"sys_macro_head",A="FL:::/Kernel/KGlbls.CPP.Z,4"$ -$LK,"XTalk",A="FL:::/Kernel/SrvCmd.CPP.Z,446",BI=455$ -$LK,"SYS_ENTER_LONG_MODE",A="FL:::/Kernel/KStart64.CPP.Z,44"$ -$LK,"DOCEf_LEFT_AUTO",A="FL:::/Kernel/KernelA.HPP,1072"$ -$LK,"DOCEF_LEFT_AUTO",A="FL:::/Kernel/KernelA.HPP,984"$ -$LK,"eps",A="FL:::/Kernel/KernelA.HPP,57"$ -$LK,"LstSub",A="FL:::/Kernel/StrA.CPP.Z,402",BI=456$ -$LK,"RLF_PATCHED",A="FL:::/Kernel/KernelA.HPP,460"$ -$LK,"TaskDerivedValsUpdate",A="FL:::/Kernel/KTask.CPP.Z,254",BI=457$ -$LK,"_HASH_ADD",A="FL:::/Kernel/KHashA.CPP.Z,170"$ -$LK,"FRBlks",A="FL:::/Kernel/BlkDev/DskCFile.CPP.Z,129",BI=458$ -$LK,"__TIME__",A="FL:::/Kernel/KernelA.HPP,2026"$ -$LK,"RLf_PATCHED",A="FL:::/Kernel/KernelA.HPP,441"$ -$LK,"FUf_CLUSTER_ORDER",A="FL:::/Kernel/KernelA.HPP,2588"$ -$LK,"ACD_WORD_FILENAME",A="FL:::/Kernel/KernelA.HPP,1499"$ -$LK,"ATTRf_BLINK",A="FL:::/Kernel/KernelA.HPP,894"$ -$LK,"ATTRF_BLINK",A="FL:::/Kernel/KernelA.HPP,889"$ -$LK,"XchgU8",A="FL:::/Kernel/KernelB.HPP,263"$ -$LK,"TTS_TASK_NAME",A="FL:::/Kernel/KernelA.HPP,3277"$ -$LK,"CKernel",A="FL:::/Kernel/KernelA.HPP,418"$ -$LK,"IET_IMM_I64",A="FL:::/Kernel/KernelA.HPP,403"$ -$LK,"log2_10",A="FL:::/Kernel/KernelA.HPP,52"$ -$LK,"LTBLUE",A="FL:::/Kernel/KernelA.HPP,2967"$ -$LK,"FAT32AllocClusters",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,456",BI=459$ -$LK,"DOCEf_TOP_Y",A="FL:::/Kernel/KernelA.HPP,1078"$ -$LK,"DOCEF_TOP_Y",A="FL:::/Kernel/KernelA.HPP,990"$ -$LK,"_CALLEXTNUM",A="FL:::/Kernel/KUtils.CPP.Z,362"$ -$LK,"SCF_KEY_DESC",A="FL:::/Kernel/KernelA.HPP,3554"$ -$LK,"SCf_KEY_DESC",A="FL:::/Kernel/KernelA.HPP,3539"$ -$LK,"MSG_CMD",A="FL:::/Kernel/KernelA.HPP,3226"$ -$LK,"IDTET_IRQ",A="FL:::/Kernel/KernelA.HPP,281"$ -$LK,"CCF_LOCAL",A="FL:::/Kernel/KernelA.HPP,2148"$ -$LK,"QueCnt",A="FL:::/Kernel/KDataTypes.CPP.Z,65",BI=460$ -$LK,"chars_bmp_alpha",A="FL:::/Kernel/StrA.CPP.Z,325"$ -$LK,"SwapI64",A="FL:::/Kernel/KernelB.HPP,111"$ -$LK,"SqrU64",A="FL:::/Kernel/KernelB.HPP,108"$ -$LK,"OPTf_NO_BUILTIN_CONST",A="FL:::/Kernel/KernelA.HPP,1546"$ -$LK,"HTG_SRC_SYM",A="FL:::/Kernel/KernelA.HPP,712"$ -$LK,"LAPIC_LVT_THERMAL",A="FL:::/Kernel/KernelA.HPP,499"$ -$LK,"RFLAGf_IOPL0",A="FL:::/Kernel/KernelA.HPP,316"$ -$LK,"IntsInit",A="FL:::/Kernel/KInts.CPP.Z,129",BI=461$ -$LK,"_XCHG_U8",A="FL:::/Kernel/KUtils.CPP.Z,208"$ -$LK,"DOCEF_CHECK_COLLAPSABLE",A="FL:::/Kernel/KernelA.HPP,1006"$ -$LK,"RFLAGf_IOPL1",A="FL:::/Kernel/KernelA.HPP,317"$ -$LK,"FAT32FilesDel",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,726",BI=462$ -$LK,"DOCT_MENU_VAL",A="FL:::/Kernel/KernelA.HPP,934"$ -$LK,"Bcd2Bin",A="FL:::/Kernel/KDate.CPP.Z,123",BI=463$ -$LK,"CAllocAligned",A="FL:::/Kernel/Mem/MAllocFree.CPP.Z,434",BI=464$ -$LK,"MAllocAligned",A="FL:::/Kernel/Mem/MAllocFree.CPP.Z,423",BI=465$ -$LK,"ext",A="FL:::/Kernel/KernelB.HPP,53"$ -$LK,"FUN_SEG_CACHE_SIZE",A="FL:::/Kernel/KernelA.HPP,3852"$ -$LK,"ACf_INIT_IN_PROGRESS",A="FL:::/Kernel/KernelA.HPP,1484"$ -$LK,"RawDm",A="FL:::/Kernel/KDbg.CPP.Z,250",BI=466$ -$LK,"ICf_DONT_POP_FLOAT0",A="FL:::/Kernel/KernelA.HPP,1613"$ -$LK,"DskCacheAdd",A="FL:::/Kernel/BlkDev/DskCache.CPP.Z,76",BI=467$ -$LK,"MPNMInt",A="FL:::/Kernel/MultiProc.CPP.Z,159",BI=468$ -$LK,"_MSIZE2",A="FL:::/Kernel/Mem/MAllocFree.CPP.Z,353"$ -$LK,"LTPURPLE",A="FL:::/Kernel/KernelA.HPP,2971"$ -$LK,"RawDr",A="FL:::/Kernel/KDbg.CPP.Z,291",BI=469$ -$LK,"StrICmp",A="FL:::/Kernel/StrA.CPP.Z,311"$ -$LK,"ATAR0_DATA",A="FL:::/Kernel/KernelA.HPP,2277"$ -$LK,"MIN_U8",A="FL:::/Kernel/KernelA.HPP,25"$ -$LK,"OPTf_TRACE",A="FL:::/Kernel/KernelA.HPP,1537"$ -$LK,"HTG_FLAGS_MASK",A="FL:::/Kernel/KernelA.HPP,710"$ -$LK,"DirFilesSort",A="FL:::/Kernel/BlkDev/DskDirA.CPP.Z,92",BI=470$ -$LK,"HashLstAdd",A="FL:::/Kernel/KHashB.CPP.Z,185",BI=471$ -$LK,"ACAlloc",A="FL:::/Kernel/Mem/MAllocFree.CPP.Z,402",BI=472$ -$LK,"SYS_RUN_LEVEL",A="FL:::/Kernel/KStart16.CPP.Z,26"$ -$LK,"SCF_SCROLL",A="FL:::/Kernel/KernelA.HPP,3547"$ -$LK,"SCf_SCROLL",A="FL:::/Kernel/KernelA.HPP,3532"$ -$LK,"BDf_INIT_IN_PROGRESS",A="FL:::/Kernel/KernelA.HPP,2654"$ -$LK,"TK_SUB_EQU",A="FL:::/Kernel/KernelA.HPP,2099"$ -$LK,"TK_DIV_EQU",A="FL:::/Kernel/KernelA.HPP,2094"$ -$LK,"OC_BPT",A="FL:::/Kernel/KernelA.HPP,1761"$ -$LK,"DOCF_HIDE_CURSOR",A="FL:::/Kernel/KernelA.HPP,1268"$ -$LK,"IOREDTAB",A="FL:::/Kernel/KernelA.HPP,515"$ -$LK,"Fstcw",A="FL:::/Kernel/KernelB.HPP,132"$ -$LK,"MSG_IP_L_DOWN_UP",A="FL:::/Kernel/KernelA.HPP,3243"$ -$LK,"LAPIC_TMR",A="FL:::/Kernel/KernelA.HPP,493"$ -$LK,"C32_EFLAGS",A="FL:::/Kernel/PCIBIOS.CPP.Z,64"$ -$LK,"sys_compile_time",A="FL:::/Kernel/KernelB.HPP,201"$ -$LK,"_D3_DIV_EQU",A="FL:::/Kernel/KMathA.CPP.Z,289"$ -$LK,"_D3_SUB_EQU",A="FL:::/Kernel/KMathA.CPP.Z,256"$ -$LK,"TASKf_SUSPENDED",A="FL:::/Kernel/KernelA.HPP,3284"$ -$LK,"FUF_DIFF",A="FL:::/Kernel/KernelA.HPP,2596"$ -$LK,"FUf_DIFF",A="FL:::/Kernel/KernelA.HPP,2570"$ -$LK,"DOCf_HIDE_CURSOR",A="FL:::/Kernel/KernelA.HPP,1304"$ -$LK,"CHashImport",A="FL:::/Kernel/KernelA.HPP,764"$ -$LK,"CMT_LABEL",A="FL:::/Kernel/KernelA.HPP,1687"$ -$LK,"C32_ADD",A="FL:::/Kernel/PCIBIOS.CPP.Z,122"$ -$LK,"MEM_PAGE_BITS",A="FL:::/Kernel/KernelA.HPP,2876"$ -$LK,"MBS_USED_SIGNATURE_VAL",A="FL:::/Kernel/KernelA.HPP,2856"$ -$LK,"HeapCtrlDel",A="FL:::/Kernel/Mem/HeapCtrl.CPP.Z,15",BI=473$ -$LK,"_CALLEXTSTR",A="FL:::/Kernel/KUtils.CPP.Z,392"$ -$LK,"FF_USE_OLD_DATETIME",A="FL:::/Kernel/KernelA.HPP,2785"$ -$LK,"BDT_ISO_FILE_READ",A="FL:::/Kernel/KernelA.HPP,2632"$ -$LK,"CCf_PAREN",A="FL:::/Kernel/KernelA.HPP,2164"$ -$LK,"CCF_PAREN",A="FL:::/Kernel/KernelA.HPP,2163"$ -$LK,"ACD_BLK_SIZE",A="FL:::/Kernel/KernelA.HPP,1513"$ -$LK,"CSysLimitBase",A="FL:::/Kernel/KernelA.HPP,349"$ -$LK,"DVD_BLK_SIZE",A="FL:::/Kernel/KernelA.HPP,2298"$ -$LK,"QueIns",A="FL:::/Kernel/KernelB.HPP,68"$ -$LK,"CGrSym",A="FL:::/Kernel/KernelA.HPP,3654"$ -$LK,"ATAR0_FEAT",A="FL:::/Kernel/KernelA.HPP,2278"$ -$LK,"RLF_HOME",A="FL:::/Kernel/KernelA.HPP,472"$ -$LK,"RLf_HOME",A="FL:::/Kernel/KernelA.HPP,453"$ -$LK,"snd",A="FL:::/Kernel/KGlbls.CPP.Z,28"$ -$LK,"SC_ENTER",A="FL:::/Kernel/KernelA.HPP,3562"$ -$LK,"LTCYAN",A="FL:::/Kernel/KernelA.HPP,2969"$ -$LK,"FUF_WHOLE_LABELS_AFTER",A="FL:::/Kernel/KernelA.HPP,2619"$ -$LK,"CCF_PREINC",A="FL:::/Kernel/KernelA.HPP,2153"$ -$LK,"HTT_IMPORT_SYS_SYM",A="FL:::/Kernel/KernelA.HPP,683"$ -$LK,"HTT_EXPORT_SYS_SYM",A="FL:::/Kernel/KernelA.HPP,682"$ -$LK,"FunSegCacheAdd",A="FL:::/Kernel/FunSeg.CPP.Z,92",BI=474$ -$LK,"CTRLT_GENERIC",A="FL:::/Kernel/KernelA.HPP,3087"$ -$LK,"CCF_KEEP_AT_SIGN",A="FL:::/Kernel/KernelA.HPP,2138"$ -$LK,"RS_ATTR_DIR",A="FL:::/Kernel/KernelA.HPP,2530"$ -$LK,"CCF_POSTDEC",A="FL:::/Kernel/KernelA.HPP,2152"$ -$LK,"DirContextDel",A="FL:::/Kernel/BlkDev/DskDirContext.CPP.Z,1",BI=475$ -$LK,"StrPrintFlags",A="FL:::/Kernel/StrB.CPP.Z,177",BI=476$ -$LK,"TK_IFNDEF",A="FL:::/Kernel/KernelA.HPP,2102"$ -$LK,"CMT_FLOAT_CONSTS",A="FL:::/Kernel/KernelA.HPP,1692"$ -$LK,"CBinFile",A="FL:::/Kernel/KernelA.HPP,372"$ -$LK,"SpawnQue",A="FL:::/Kernel/MultiProc.CPP.Z,248",BI=477$ -$LK,"LAPIC_SVR",A="FL:::/Kernel/KernelA.HPP,490"$ -$LK,"CMouseStateGlbls",A="FL:::/Kernel/KernelA.HPP,3023"$ -$LK,"StrPrintFunSeg",A="FL:::/Kernel/FunSeg.CPP.Z,134",BI=478$ -$LK,"ISO1_ATTR_DIR",A="FL:::/Kernel/KernelA.HPP,2522"$ -$LK,"HashVal",A="FL:::/Kernel/KHashB.CPP.Z,9",BI=479$ -$LK,"C:/Doc/MultiCore.TXT.Z",A="FL:::/Kernel/KernelB.HPP,227"$ -$LK,"DOCEF_DFT_RAW_TYPE",A="FL:::/Kernel/KernelA.HPP,1025"$ -$LK,"IET_IMM_U32",A="FL:::/Kernel/KernelA.HPP,401"$ -$LK,"IET_IMM_U16",A="FL:::/Kernel/KernelA.HPP,399"$ -$LK,"QueRem",A="FL:::/Kernel/KernelB.HPP,72"$ -$LK,"TASKf_DISABLE_BPTS",A="FL:::/Kernel/KernelA.HPP,3289"$ -$LK,"BDT_NULL",A="FL:::/Kernel/KernelA.HPP,2629"$ -$LK,"FarCall32",A="FL:::/Kernel/PCIBIOS.CPP.Z,161"$ -$LK,"SCF_NO_SHIFT",A="FL:::/Kernel/KernelA.HPP,3553"$ -$LK,"SCf_NO_SHIFT",A="FL:::/Kernel/KernelA.HPP,3538"$ -$LK,"ARGT_MOFFS32",A="FL:::/Kernel/KernelA.HPP,1916"$ -$LK,"ARGT_MOFFS16",A="FL:::/Kernel/KernelA.HPP,1915"$ -$LK,"sys_heap_dbg",A="FL:::/Kernel/KernelB.HPP,180"$ -$LK,"FUF_SINGLE",A="FL:::/Kernel/KernelA.HPP,2605"$ -$LK,"FUf_SINGLE",A="FL:::/Kernel/KernelA.HPP,2579"$ -$LK,"DOCEf_DFT_RAW_TYPE",A="FL:::/Kernel/KernelA.HPP,1111"$ -$LK,"DVDImageWriteTask",A="FL:::/Kernel/BlkDev/DskCDDVD.CPP.Z,117",BI=480$ -$LK,"LTGRAY",A="FL:::/Kernel/KernelA.HPP,2965"$ -$LK,"CoreAPSethInit",A="FL:::/Kernel/MultiProc.CPP.Z,276",BI=481$ -$LK,"IRQKbd",A="FL:::/Kernel/SerialDev/Keyboard.CPP.Z,411",BI=482$ -$LK,"QueVectU8Del",A="FL:::/Kernel/KDataTypes.CPP.Z,132",BI=483$ -$LK,"SwapU32",A="FL:::/Kernel/KernelB.HPP,115"$ -$LK,"SwapU16",A="FL:::/Kernel/KernelB.HPP,113"$ -$LK,"ARf_MESH_ED",A="FL:::/Kernel/KernelA.HPP,3905"$ -$LK,"CAsmUndefHash",A="FL:::/Kernel/KernelA.HPP,1813"$ -$LK,"HTt_IMPORT_SYS_SYM",A="FL:::/Kernel/KernelA.HPP,653"$ -$LK,"HTt_EXPORT_SYS_SYM",A="FL:::/Kernel/KernelA.HPP,652"$ -$LK,"C32_EDI",A="FL:::/Kernel/PCIBIOS.CPP.Z,63"$ -$LK,"pow10_I64",A="FL:::/Kernel/KGlbls.CPP.Z,15"$ -$LK,"sys_num_spawned_tasks",A="FL:::/Kernel/KGlbls.CPP.Z,9"$ -$LK,"LAPIC_LVT_LINT0",A="FL:::/Kernel/KernelA.HPP,501"$ -$LK,"Cluster2Blk",A="FL:::/Kernel/BlkDev/DskCluster.CPP.Z,32",BI=484$ -$LK,"ArcFinishCompression",A="FL:::/Kernel/Compress.CPP.Z,155",BI=485$ -$LK,"LAPIC_LVT_LINT1",A="FL:::/Kernel/KernelA.HPP,502"$ -$LK,"sys_winmgr_task",A="FL:::/Kernel/KGlbls.CPP.Z,11"$ -$LK,"SC_CAPS",A="FL:::/Kernel/KernelA.HPP,3566"$ -$LK,"SYS_RAM_REBOOT_END",A="FL:::/Kernel/KStart64.CPP.Z,99"$ -$LK,"REG_R8",A="FL:::/Kernel/KernelA.HPP,1784"$ -$LK,"CMT_ARRAY_DIM",A="FL:::/Kernel/KernelA.HPP,1693"$ -$LK,"ACD_POS_CHAR",A="FL:::/Kernel/KernelA.HPP,1519"$ -$LK,"REGT_FSTK",A="FL:::/Kernel/KernelA.HPP,744"$ -$LK,"ARGT_MOFFS64",A="FL:::/Kernel/KernelA.HPP,1917"$ -$LK,"DOCF_COLOR_NAMES",A="FL:::/Kernel/KernelA.HPP,1263"$ -$LK,"CRAXRBCRCXRDX",A="FL:::/Kernel/KernelA.HPP,568"$ -$LK,"_SAVE_EXCEPT_REGS",A="FL:::/Kernel/KExcept.CPP.Z,26"$ -$LK,"MDf_IMM",A="FL:::/Kernel/KernelA.HPP,1573"$ -$LK,"DOCf_COLOR_NAMES",A="FL:::/Kernel/KernelA.HPP,1299"$ -$LK,"RoundI64",A="FL:::/Kernel/KMathB.CPP.Z,47",BI=486$ -$LK,"CSndGlbls",A="FL:::/Kernel/KernelA.HPP,3844"$ -$LK,"EXT_HEAPLOG_FREE",A="FL:::/Kernel/KernelA.HPP,578"$ -$LK,"DrvSerialNum",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,279",BI=487$ -$LK,"Fstsw",A="FL:::/Kernel/KernelB.HPP,133"$ -$LK,"TASKf_TASK_LOCK",A="FL:::/Kernel/KernelA.HPP,3282"$ -$LK,"BDT_ATA",A="FL:::/Kernel/KernelA.HPP,2631"$ -$LK,"RFLAGf_RESUME",A="FL:::/Kernel/KernelA.HPP,319"$ -$LK,"C32_EAX",A="FL:::/Kernel/PCIBIOS.CPP.Z,58"$ -$LK,"PortNop",A="FL:::/Kernel/KMisc.CPP.Z,1",BI=488$ -$LK,"StrNCmp",A="FL:::/Kernel/StrA.CPP.Z,313"$ -$LK,"FUF_PUBLIC",A="FL:::/Kernel/KernelA.HPP,2602"$ -$LK,"FUf_PUBLIC",A="FL:::/Kernel/KernelA.HPP,2576"$ -$LK,"CFAT32FileInfoSect",A="FL:::/Kernel/KernelA.HPP,2369"$ -$LK,"SYS_HEAP_INIT_VAL",A="FL::/Temp.TXT.Z,1"$ -$LK,"CATAPITrack",A="FL:::/Kernel/KernelA.HPP,2421"$ -$LK,"C32_EBX",A="FL:::/Kernel/PCIBIOS.CPP.Z,59"$ -$LK,"CCF_HAS_MISC_DATA",A="FL:::/Kernel/KernelA.HPP,2144"$ -$LK,"LFSF_DOC",A="FL:::/Kernel/KernelA.HPP,2035"$ -$LK,"ACD_PRONUNCIATION_CHAR",A="FL:::/Kernel/KernelA.HPP,1518"$ -$LK,"ACD_PRONUNCIATION",A="FL:::/Kernel/KernelA.HPP,1507"$ -$LK,"C32_ECX",A="FL:::/Kernel/PCIBIOS.CPP.Z,60"$ -$LK,"FifoU8Peek",A="FL:::/Kernel/KDataTypes.CPP.Z,205",BI=489$ -$LK,"C32_EDX",A="FL:::/Kernel/PCIBIOS.CPP.Z,61"$ -$LK,"LoadPass1",A="FL:::/Kernel/KLoad.CPP.Z,67",BI=490$ -$LK,"LoadPass2",A="FL:::/Kernel/KLoad.CPP.Z,154",BI=491$ -$LK,"ARf_MANAGE_SLIDER",A="FL:::/Kernel/KernelA.HPP,3907"$ -$LK,"CSndData",A="FL:::/Kernel/KernelA.HPP,3837"$ -$LK,"SC_PAGE_DOWN",A="FL:::/Kernel/KernelA.HPP,3574"$ -$LK,"OC_NOP",A="FL:::/Kernel/KernelA.HPP,1760"$ -$LK,"SPF_AUX_FMT_NUM",A="FL:::/Kernel/KernelA.HPP,3926"$ -$LK,"MSG_KEY_UP",A="FL:::/Kernel/KernelA.HPP,3228"$ -$LK,"SYS_SEMA_SINGLE_USER",A="FL:::/Kernel/KernelA.HPP,603"$ -$LK,"TimeStampFreqCal",A="FL:::/Kernel/KMisc.CPP.Z,85",BI=492$ -$LK,"QueVectU8Get",A="FL:::/Kernel/KDataTypes.CPP.Z,140",BI=493$ -$LK,"DOCF_CARRIAGE_RETURN",A="FL:::/Kernel/KernelA.HPP,1261"$ -$LK,"PostMsg",A="FL:::/Kernel/SrvCmd.CPP.Z,240",BI=494$ -$LK,"SVCT_CALL",A="FL:::/Kernel/KernelA.HPP,3193"$ -$LK,"MDf_REG",A="FL:::/Kernel/KernelA.HPP,1574"$ -$LK,"ATAPISeek",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,131",BI=495$ -$LK,"MPrintDate",A="FL:::/Kernel/StrPrint.CPP.Z,49",BI=496$ -$LK,"_BIT_FIELD_EXT_U32",A="FL:::/Kernel/KUtils.CPP.Z,167"$ -$LK,"SC_F10",A="FL:::/Kernel/KernelA.HPP,3588"$ -$LK,"SC_F11",A="FL:::/Kernel/KernelA.HPP,3589"$ -$LK,"SYS_SEMA_TT",A="FL:::/Kernel/KernelA.HPP,609"$ -$LK,"Silent",A="FL:::/Kernel/KMisc.CPP.Z,223",BI=497$ -$LK,"SC_F12",A="FL:::/Kernel/KernelA.HPP,3590"$ -$LK,"WIF_FOCUS_TASK_CTRLS",A="FL:::/Kernel/KernelA.HPP,1424"$ -$LK,"CCF_POSTINC",A="FL:::/Kernel/KernelA.HPP,2151"$ -$LK,"CCF_IN_IF",A="FL:::/Kernel/KernelA.HPP,2133"$ -$LK,"DrvMakeFreeSlot",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,38",BI=498$ -$LK,"HashStr",A="FL:::/Kernel/KHashA.CPP.Z,254"$ -$LK,"CHashExport",A="FL:::/Kernel/KernelA.HPP,759"$ -$LK,"FifoU8Del",A="FL:::/Kernel/KDataTypes.CPP.Z,167",BI=499$ -$LK,"DrvIsWritable",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,199",BI=500$ -$LK,"MDf_SIB",A="FL:::/Kernel/KernelA.HPP,1576"$ -$LK,"chars_bmp_printable",A="FL:::/Kernel/StrA.CPP.Z,381"$ -$LK,"FWBlks",A="FL:::/Kernel/BlkDev/DskCFile.CPP.Z,181",BI=501$ -$LK,"RLF_COMPILER",A="FL:::/Kernel/KernelA.HPP,468"$ -$LK,"RLf_COMPILER",A="FL:::/Kernel/KernelA.HPP,449"$ -$LK,"SYS_INIT_PAGE_TABLES",A="FL:::/Kernel/Mem/PageTables.CPP.Z,6"$ -$LK,"TASK_NAME_LEN",A="FL:::/Kernel/KernelA.HPP,3306"$ -$LK,"COLORROP_COLORS_MASK",A="FL:::/Kernel/KernelA.HPP,2987"$ -$LK,"C32_ESI",A="FL:::/Kernel/PCIBIOS.CPP.Z,62"$ -$LK,"BlkPoolsInit",A="FL:::/Kernel/Mem/BlkPool.CPP.Z,29",BI=502$ -$LK,"SYS_DATA_BP",A="FL:::/Kernel/KStart32.CPP.Z,28"$ -$LK,"VGAP_PALETTE_DATA",A="FL:::/Kernel/KernelA.HPP,3739"$ -$LK,"ATAR0_HCYL",A="FL:::/Kernel/KernelA.HPP,2282"$ -$LK,"DOCET_SEL",A="FL:::/Kernel/KernelA.HPP,949"$ -$LK,"sys_code_bp",A="FL:::/Kernel/KernelB.HPP,189"$ -$LK,"RepOutU32",A="FL:::/Kernel/KernelB.HPP,90"$ -$LK,"RepOutU16",A="FL:::/Kernel/KernelB.HPP,88"$ -$LK,"TK_SUBSCRIPT",A="FL:::/Kernel/KernelA.HPP,2071"$ -$LK,"WIG_TASK_DFT",A="FL:::/Kernel/KernelA.HPP,1434"$ -$LK,"REGT_NONE",A="FL:::/Kernel/KernelA.HPP,738"$ -$LK,"ARf_PSALMODY_JUKEBOX",A="FL:::/Kernel/KernelA.HPP,3904"$ -$LK,"DOCEf_HTML_LINK",A="FL:::/Kernel/KernelA.HPP,1057"$ -$LK,"DOCEF_HTML_LINK",A="FL:::/Kernel/KernelA.HPP,969"$ -$LK,"NORMAL_KEY_SCAN_DECODE_TABLE",A="FL:::/Kernel/SerialDev/Keyboard.CPP.Z,3"$ -$LK,"LinkedLstSize",A="FL:::/Kernel/KDataTypes.CPP.Z,31",BI=503$ -$LK,"SSF_NO_COMPRESSION",A="FL:::/Kernel/KernelA.HPP,224"$ -$LK,"DirContextNew",A="FL:::/Kernel/BlkDev/DskDirContext.CPP.Z,21",BI=504$ -$LK,"_SET_MSR",A="FL:::/Kernel/KUtils.CPP.Z,458"$ -$LK,"HClf_LOCKED",A="FL:::/Kernel/KernelA.HPP,2904"$ -$LK,"SPF_QUESTION",A="FL:::/Kernel/KernelA.HPP,3925"$ -$LK,"ACD_EXTRA_END",A="FL:::/Kernel/KernelA.HPP,1512"$ -$LK,"SetRFlags",A="FL:::/Kernel/KernelB.HPP,249"$ -$LK,"GetRFlags",A="FL:::/Kernel/KernelB.HPP,243"$ -$LK,"DOCEF_RIGHT_MACRO",A="FL:::/Kernel/KernelA.HPP,973"$ -$LK,"MSG_IP_MOVE",A="FL:::/Kernel/KernelA.HPP,3229"$ -$LK,"SVCT_TEXT_INPUT",A="FL:::/Kernel/KernelA.HPP,3189"$ -$LK,"DOClf_LOCKED",A="FL:::/Kernel/KernelA.HPP,1332"$ -$LK,"CallStkGrow",A="FL:::/Kernel/KTask.CPP.Z,78",BI=505$ -$LK,"ATAR0_NSECT",A="FL:::/Kernel/KernelA.HPP,2279"$ -$LK,"DOCEf_RIGHT_MACRO",A="FL:::/Kernel/KernelA.HPP,1061"$ -$LK,"RLF_DOC",A="FL:::/Kernel/KernelA.HPP,469"$ -$LK,"chars_bmp_macro",A="FL:::/Kernel/StrA.CPP.Z,376"$ -$LK,"OutU8",A="FL:::/Kernel/KernelB.HPP,80"$ -$LK,"DCF_ALIAS",A="FL:::/Kernel/KernelA.HPP,3642"$ -$LK,"CoreAPSethTask",A="FL:::/Kernel/MultiProc.CPP.Z,194",BI=506$ -$LK,"Ff_HASERRCODE",A="FL:::/Kernel/KernelA.HPP,848"$ -$LK,"REGG_LOCAL_NON_PTR_VARS",A="FL:::/Kernel/KernelA.HPP,1795"$ -$LK,"DOCF_PLAIN_TEXT",A="FL:::/Kernel/KernelA.HPP,1258"$ -$LK,"RawPutChar",A="FL:::/Kernel/Display.CPP.Z,1",BI=507$ -$LK,"FifoU8Cnt",A="FL:::/Kernel/KDataTypes.CPP.Z,227",BI=508$ -$LK,"DOCf_PLAIN_TEXT",A="FL:::/Kernel/KernelA.HPP,1294"$ -$LK,"CArcEntry",A="FL:::/Kernel/KernelA.HPP,3753"$ -$LK,"BDT_ISO_FILE_WRITE",A="FL:::/Kernel/KernelA.HPP,2633"$ -$LK,"AOT_BIN_BLK_SIZE",A="FL:::/Kernel/KernelA.HPP,1798"$ -$LK,"DOCf_FORM",A="FL:::/Kernel/KernelA.HPP,1302"$ -$LK,"DOCF_FORM",A="FL:::/Kernel/KernelA.HPP,1266"$ -$LK,"CHashTable",A="FL:::/Kernel/KernelA.HPP,642"$ -$LK,"QueVectU8New",A="FL:::/Kernel/KDataTypes.CPP.Z,87",BI=509$ -$LK,"MEM_INTERRUPT_STK",A="FL:::/Kernel/KernelA.HPP,2886"$ -$LK,"BDT_RAM",A="FL:::/Kernel/KernelA.HPP,2630"$ -$LK,"CMF_POP_CMP",A="FL:::/Kernel/KernelA.HPP,1696"$ -$LK,"ICF_POP_CMP",A="FL:::/Kernel/KernelA.HPP,1610"$ -$LK,"DOCf_CARRIAGE_RETURN",A="FL:::/Kernel/KernelA.HPP,1297"$ -$LK,"MLMF_IS_STR",A="FL:::/Kernel/KernelA.HPP,788"$ -$LK,"SYS_TIMER0_PERIOD",A="FL:::/Kernel/KernelA.HPP,553"$ -$LK,"SET_FS_BASE",A="FL:::/Kernel/KUtils.CPP.Z,445"$ -$LK,"CISO1PriDesc",A="FL:::/Kernel/KernelA.HPP,2484"$ -$LK,"PutHex",A="FL:::/Kernel/StrA.CPP.Z,12",BI=510$ -$LK,"PopUp",A="FL:::/Kernel/SrvCmd.CPP.Z,377",BI=511$ -$LK,"SCF_IP_R_DOWN",A="FL:::/Kernel/KernelA.HPP,3550"$ -$LK,"SCf_IP_R_DOWN",A="FL:::/Kernel/KernelA.HPP,3535"$ -$LK,"MSG_IP_R_DOWN",A="FL:::/Kernel/KernelA.HPP,3234"$ -$LK,"SVCT_EXE_STR",A="FL:::/Kernel/KernelA.HPP,3191"$ -$LK,"DOCF_OVERSTRIKE",A="FL:::/Kernel/KernelA.HPP,1288"$ -$LK,"IOAPICARB",A="FL:::/Kernel/KernelA.HPP,514"$ -$LK,"DOCf_OVERSTRIKE",A="FL:::/Kernel/KernelA.HPP,1325"$ -$LK,"COREAP_16BIT_INIT_END",A="FL:::/Kernel/MultiProc.CPP.Z,27"$ -$LK,"SCF_SHIFT",A="FL:::/Kernel/KernelA.HPP,3542"$ -$LK,"SCf_SHIFT",A="FL:::/Kernel/KernelA.HPP,3527"$ -$LK,"WIF_SELF_FOCUS",A="FL:::/Kernel/KernelA.HPP,1409"$ -$LK,"StrLastOcc",A="FL:::/Kernel/StrA.CPP.Z,599",BI=512$ -$LK,"WIf_SELF_FOCUS",A="FL:::/Kernel/KernelA.HPP,1438"$ -$LK,"FClose",A="FL:::/Kernel/BlkDev/DskCFile.CPP.Z,73",BI=513$ -$LK,"MDf_STK",A="FL:::/Kernel/KernelA.HPP,1572"$ -$LK,"IEF_GOTO_LABEL",A="FL:::/Kernel/KernelA.HPP,1958"$ -$LK,"CMT_GOTO_LABEL",A="FL:::/Kernel/KernelA.HPP,1689"$ -$LK,"mon_start_days1",A="FL:::/Kernel/KDate.CPP.Z,3"$ -$LK,"HTF_GOTO_LABEL",A="FL:::/Kernel/KernelA.HPP,706"$ -$LK,"mon_start_days2",A="FL:::/Kernel/KDate.CPP.Z,5"$ -$LK,"FONT_HEIGHT",A="FL:::/Kernel/KernelA.HPP,3614"$ -$LK,"SVCf_FOCUS_MASTER",A="FL:::/Kernel/KernelA.HPP,3179"$ -$LK,"HTf_GOTO_LABEL",A="FL:::/Kernel/KernelA.HPP,676"$ -$LK,"DFT_CACHE_LINE_WIDTH",A="FL:::/Kernel/KernelA.HPP,583"$ -$LK,"ATAR0_LCYL",A="FL:::/Kernel/KernelA.HPP,2281"$ -$LK,"MemPagePresentMark",A="FL:::/Kernel/Mem/PageTables.CPP.Z,143",BI=514$ -$LK,"ICf_DONT_PUSH_FLOAT0",A="FL:::/Kernel/KernelA.HPP,1612"$ -$LK,"Sleep",A="FL:::/Kernel/KMisc.CPP.Z,155",BI=515$ -$LK,"RedSeaMkDir",A="FL:::/Kernel/BlkDev/FileSysRedSea.CPP.Z,604",BI=516$ -$LK,"PutKey",A="FL:::/Kernel/KeyDev.CPP.Z,1",BI=517$ -$LK,"_HASH_STR",A="FL:::/Kernel/KHashA.CPP.Z,120"$ -$LK,"FUf_ALL",A="FL:::/Kernel/KernelA.HPP,2572"$ -$LK,"sys_macro_task",A="FL:::/Kernel/KGlbls.CPP.Z,5"$ -$LK,"CArcCompress",A="FL:::/Kernel/KernelA.HPP,3779"$ -$LK,"CHashOpcode",A="FL:::/Kernel/KernelA.HPP,1950"$ -$LK,"FifoU8Ins",A="FL:::/Kernel/KDataTypes.CPP.Z,173",BI=518$ -$LK,"CGridGlbls",A="FL:::/Kernel/KernelA.HPP,3070"$ -$LK,"FATFromName",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,168",BI=519$ -$LK,"AAT_ADD_U32",A="FL:::/Kernel/KernelA.HPP,1973"$ -$LK,"AAT_ADD_U16",A="FL:::/Kernel/KernelA.HPP,1971"$ -$LK,"SC_PAUSE",A="FL:::/Kernel/KernelA.HPP,3591"$ -$LK,"TRANSPARENT",A="FL:::/Kernel/KernelA.HPP,2957"$ -$LK,"XTalkStrWait",A="FL:::/Kernel/SrvCmd.CPP.Z,497",BI=520$ -$LK,"CArcCtrl",A="FL:::/Kernel/KernelA.HPP,3761"$ -$LK,"SC_CTRL",A="FL:::/Kernel/KernelA.HPP,3564"$ -$LK,"RS_ATTR_LONG_NAME_MASK",A="FL:::/Kernel/KernelA.HPP,2534"$ -$LK,"ATAR1_CTRL",A="FL:::/Kernel/KernelA.HPP,2286"$ -$LK,"ICF_A1_TO_F64",A="FL:::/Kernel/KernelA.HPP,1593"$ -$LK,"RECALCF_ADD_CURSOR",A="FL:::/Kernel/KernelA.HPP,1351"$ -$LK,"DOC_COLOR_BIN",A="FL:::/Kernel/KernelA.HPP,1141"$ -$LK,"Ff_NOARGPOP",A="FL:::/Kernel/KernelA.HPP,850"$ -$LK,"EdLiteFileLine",A="FL:::/Kernel/EdLite.CPP.Z,316",BI=521$ -$LK,"FifoU8New",A="FL:::/Kernel/KDataTypes.CPP.Z,155",BI=522$ -$LK,"SC_HOME",A="FL:::/Kernel/KernelA.HPP,3575"$ -$LK,"ATAPIWritePktWord",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,106",BI=523$ -$LK,"FilesFindMatch",A="FL:::/Kernel/BlkDev/DskStrA.CPP.Z,40",BI=524$ -$LK,"BlkDevsRelease",A="FL:::/Kernel/BlkDev/DskBlkDev.CPP.Z,109",BI=525$ -$LK,"DOC_COLOR_LINK",A="FL:::/Kernel/KernelA.HPP,1136"$ -$LK,"AAT_ADD_U64",A="FL:::/Kernel/KernelA.HPP,1975"$ -$LK,"HTT_CLASS",A="FL:::/Kernel/KernelA.HPP,686"$ -$LK,"HTt_CLASS",A="FL:::/Kernel/KernelA.HPP,656"$ -$LK,"Cd2DirEntry",A="FL:::/Kernel/BlkDev/DskStrA.CPP.Z,217",BI=526$ -$LK,"IET_IMM_U0",A="FL:::/Kernel/KernelA.HPP,395"$ -$LK,"FifoU8Rem",A="FL:::/Kernel/KDataTypes.CPP.Z,190",BI=527$ -$LK,"StrLastRem",A="FL:::/Kernel/StrA.CPP.Z,609",BI=528$ -$LK,"RedSeaDrvInit",A="FL:::/Kernel/BlkDev/FileSysRedSea.CPP.Z,58",BI=529$ -$LK,"BlkDevAdd",A="FL:::/Kernel/BlkDev/DskAddDev.CPP.Z,27",BI=530$ -$LK,"REGG_CLOBBERED",A="FL:::/Kernel/KernelA.HPP,1791"$ -$LK,"ROPF_HALF_RANGE_COLOR",A="FL:::/Kernel/KernelA.HPP,2949"$ -$LK,"DirLongNameFill",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,199",BI=531$ -$LK,"QueVectU8Put",A="FL:::/Kernel/KDataTypes.CPP.Z,96",BI=532$ -$LK,"StrFind",A="FL:::/Kernel/StrA.CPP.Z,624",BI=533$ -$LK,"CMemRange",A="FL:::/Kernel/KernelA.HPP,2868"$ -$LK,"WIf_FOCUS_TASK_CTRLS",A="FL:::/Kernel/KernelA.HPP,1449"$ -$LK,"C32_RSP",A="FL:::/Kernel/PCIBIOS.CPP.Z,66"$ -$LK,"OutStr",A="FL:::/Kernel/StrPrint.CPP.Z,20",BI=534$ -$LK,"DOCEf_CHECK_COLLAPSABLE",A="FL:::/Kernel/KernelA.HPP,1094"$ -$LK,"DOCEF_PAGE_REL_Y",A="FL:::/Kernel/KernelA.HPP,995"$ -$LK,"TimersInit",A="FL:::/Kernel/KEnd.CPP.Z,88",BI=535$ -$LK,"ATAR0_SECT",A="FL:::/Kernel/KernelA.HPP,2280"$ -$LK,"__CMD_LINE__",A="FL:::/Kernel/KernelA.HPP,2029"$ -$LK,"WIF_SELF_CTRLS",A="FL:::/Kernel/KernelA.HPP,1411"$ -$LK,"DOCEf_PAGE_REL_Y",A="FL:::/Kernel/KernelA.HPP,1083"$ -$LK,"IET_IMM_U8",A="FL:::/Kernel/KernelA.HPP,397"$ -$LK,"SC_ALT",A="FL:::/Kernel/KernelA.HPP,3565"$ -$LK,"ARGT_MOFFS8",A="FL:::/Kernel/KernelA.HPP,1914"$ -$LK,"REGG_STK_TEMP",A="FL:::/Kernel/KernelA.HPP,1793"$ -$LK,"WIf_SELF_CTRLS",A="FL:::/Kernel/KernelA.HPP,1439"$ -$LK,"EXT_NUM_ENTRIES",A="FL:::/Kernel/KernelA.HPP,580"$ -$LK,"DefineMatch",A="FL:::/Kernel/KDefine.CPP.Z,85",BI=536$ -$LK,"CLexHashTableContext",A="FL:::/Kernel/KernelA.HPP,2114"$ -$LK,"RLF_RAW",A="FL:::/Kernel/KernelA.HPP,464"$ -$LK,"WZeroBlks",A="FL:::/Kernel/BlkDev/DskBlk.CPP.Z,2",BI=537$ -$LK,"ATAPISetMaxSpeed",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,118",BI=538$ -$LK,"StkRep",A="FL:::/Kernel/KDbg.CPP.Z,104",BI=539$ -$LK,"SwapU8",A="FL:::/Kernel/KernelB.HPP,117"$ -$LK,"FUN_SEG_CACHE_STR_LEN",A="FL:::/Kernel/KernelA.HPP,3860"$ -$LK,"DCF_TRANSFORMATION",A="FL:::/Kernel/KernelA.HPP,3631"$ -$LK,"FF_CONTIGUOUS",A="FL:::/Kernel/KernelA.HPP,2784"$ -$LK,"TTS_CONST",A="FL:::/Kernel/KernelA.HPP,3275"$ -$LK,"ISO1T_VOL_DRV_DESC",A="FL:::/Kernel/KernelA.HPP,2481"$ -$LK,"SaveExceptRegs",A="FL:::/Kernel/KExcept.CPP.Z,43"$ -$LK,"SC_END",A="FL:::/Kernel/KernelA.HPP,3576"$ -$LK,"CAOTHeapGlbl",A="FL:::/Kernel/KernelA.HPP,1990"$ -$LK,"ArcExpandBuf",A="FL:::/Kernel/Compress.CPP.Z,165",BI=540$ -$LK,"FUf_MAP",A="FL:::/Kernel/KernelA.HPP,2577"$ -$LK,"DOCf_MORE",A="FL:::/Kernel/KernelA.HPP,1310"$ -$LK,"DOCF_MORE",A="FL:::/Kernel/KernelA.HPP,1274"$ -$LK,"chars_bmp_non_eol_white_space",A="FL:::/Kernel/StrA.CPP.Z,359"$ -$LK,"CISO1PathEntry",A="FL:::/Kernel/KernelA.HPP,2469"$ -$LK,"REGG_SAVED",A="FL:::/Kernel/KernelA.HPP,1792"$ -$LK,"SF_ARG1",A="FL:::/Kernel/KernelA.HPP,559"$ -$LK,"RLF_VGA",A="FL:::/Kernel/KernelA.HPP,458"$ -$LK,"COLOR_MONO",A="FL:::/Kernel/KernelA.HPP,2977"$ -$LK,"ACD_END_CHAR",A="FL:::/Kernel/KernelA.HPP,1515"$ -$LK,"WIF_FOCUS_TASK_IP_WHEEL",A="FL:::/Kernel/KernelA.HPP,1429"$ -$LK,"DOCET_INVERT",A="FL:::/Kernel/KernelA.HPP,948"$ -$LK,"SF_ARG2",A="FL:::/Kernel/KernelA.HPP,560"$ -$LK,"SC_SCROLL",A="FL:::/Kernel/KernelA.HPP,3568"$ -$LK,"DISPLAYf_NOT_RAW",A="FL:::/Kernel/KernelA.HPP,3299"$ -$LK,"DOCEt_INVERT",A="FL:::/Kernel/KernelA.HPP,954"$ -$LK,"ATTRf_INVERT",A="FL:::/Kernel/KernelA.HPP,895"$ -$LK,"ATTRF_INVERT",A="FL:::/Kernel/KernelA.HPP,890"$ -$LK,"SF_ARG3",A="FL:::/Kernel/KernelA.HPP,561"$ -$LK,"ACD_PRONUNCIATION_END",A="FL:::/Kernel/KernelA.HPP,1508"$ -$LK,"SF_ARG4",A="FL:::/Kernel/KernelA.HPP,562"$ -$LK,"SF_ARG5",A="FL:::/Kernel/KernelA.HPP,563"$ -$LK,"ODEF_STARTED",A="FL:::/Kernel/KernelA.HPP,242"$ -$LK,"TaskFocusNext",A="FL:::/Kernel/Sched.CPP.Z,38",BI=541$ -$LK,"Print",A="FL:::/Kernel/StrPrint.CPP.Z,890",BI=542$ -$LK,"SFF_WHOLE_LABELS_BEFORE",A="FL:::/Kernel/KernelA.HPP,3807"$ -$LK,"FUF_RISKY",A="FL:::/Kernel/KernelA.HPP,2601"$ -$LK,"FUf_RISKY",A="FL:::/Kernel/KernelA.HPP,2575"$ -$LK,"CAOTAbsAddr",A="FL:::/Kernel/KernelA.HPP,1977"$ -$LK,"SF_ARG6",A="FL:::/Kernel/KernelA.HPP,564"$ -$LK,"SC_ESC",A="FL:::/Kernel/KernelA.HPP,3559"$ -$LK,"ACD_WORD_CHAR",A="FL:::/Kernel/KernelA.HPP,1516"$ -$LK,"SF_ARG7",A="FL:::/Kernel/KernelA.HPP,565"$ -$LK,"FAT32DrvValidate",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,48",BI=543$ -$LK,"StrCmp",A="FL:::/Kernel/StrA.CPP.Z,309"$ -$LK,"MSG_RESIZE",A="FL:::/Kernel/KernelA.HPP,3239"$ -$LK,"DOF_INTERCEPT_TASK_END",A="FL:::/Kernel/KernelA.HPP,1216"$ -$LK,"SF_ARG8",A="FL:::/Kernel/KernelA.HPP,566"$ -$LK,"BlkDevDel",A="FL:::/Kernel/BlkDev/DskBlkDev.CPP.Z,154",BI=544$ -$LK,"ST_ERR_ST",A="FL:::/Kernel/KernelA.HPP,3521"$ -$LK,"BlkDevChk",A="FL:::/Kernel/BlkDev/DskBlkDev.CPP.Z,163",BI=545$ -$LK,"MSG_IP_L_UP",A="FL:::/Kernel/KernelA.HPP,3231"$ -$LK,"FSt_REDSEA",A="FL:::/Kernel/KernelA.HPP,2687"$ -$LK,"CPCIDev",A="FL:::/Kernel/KernelA.HPP,2241"$ -$LK,"DOCEf_DFT_LEN",A="FL:::/Kernel/KernelA.HPP,1110"$ -$LK,"DOCEF_DFT_LEN",A="FL:::/Kernel/KernelA.HPP,1024"$ -$LK,"RepOutU8",A="FL:::/Kernel/KernelB.HPP,92"$ -$LK,"DOCEF_RIGHT_AUTO",A="FL:::/Kernel/KernelA.HPP,986"$ -$LK,"DrvBlkDevDel",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,78",BI=546$ -$LK,"VGAP_PALETTE_MASK",A="FL:::/Kernel/KernelA.HPP,3736"$ -$LK,"DOCEf_RIGHT_AUTO",A="FL:::/Kernel/KernelA.HPP,1074"$ -$LK,"NUM_SYS_SEMAS",A="FL:::/Kernel/KernelA.HPP,615"$ -$LK,"ATAPISync",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,501",BI=547$ -$LK,"TO_UPPER",A="FL:::/Kernel/StrA.CPP.Z,110"$ -$LK,"RFLAGG_NORMAL",A="FL:::/Kernel/KernelA.HPP,327"$ -$LK,"KERNEL_MODULE_NAME",A="FL:::/Kernel/KernelA.HPP,716"$ -$LK,"SYS_SEMA_DSK_CACHE",A="FL:::/Kernel/KernelA.HPP,604"$ -$LK,"MEM_PAGE_SIZE",A="FL:::/Kernel/KernelA.HPP,2877"$ -$LK,"SleepUntil",A="FL:::/Kernel/KMisc.CPP.Z,147",BI=548$ -$LK,"Spawn",A="FL:::/Kernel/KTask.CPP.Z,210",BI=549$ -$LK,"CTaskDying",A="FL:::/Kernel/KernelA.HPP,3315"$ -$LK,"MSG_IP_R_D_UP",A="FL:::/Kernel/KernelA.HPP,3237"$ -$LK,"CRedSeaBoot",A="FL:::/Kernel/KernelA.HPP,2323"$ -$LK,"WIF_SELF_KEY_DESC",A="FL:::/Kernel/KernelA.HPP,1421"$ -$LK,"SET_GS_BASE",A="FL:::/Kernel/KUtils.CPP.Z,433"$ -$LK,"RFLAGf_VINT_PENDING",A="FL:::/Kernel/KernelA.HPP,323"$ -$LK,"DirEntryDel2",A="FL:::/Kernel/BlkDev/DskDirA.CPP.Z,26",BI=550$ -$LK,"DefineLoad",A="FL:::/Kernel/KDefine.CPP.Z,1",BI=551$ -$LK,"INT_FAULT_ERR_CODE_BITMAP",A="FL:::/Kernel/KInts.CPP.Z,94"$ -$LK,"ICF_NO_RIP",A="FL:::/Kernel/KernelA.HPP,1617"$ -$LK,"SUF_REM_CTRL_CHARS",A="FL:::/Kernel/KernelA.HPP,3793"$ -$LK,"SC_SHIFT",A="FL:::/Kernel/KernelA.HPP,3563"$ -$LK,"ATA_SET_MAX_EXT",A="FL:::/Kernel/KernelA.HPP,2264"$ -$LK,"StrOcc",A="FL:::/Kernel/StrA.CPP.Z,467",BI=552$ -$LK,"StrCpy",A="FL:::/Kernel/StrA.CPP.Z,321"$ -$LK,"DOCT_INS_BIN",A="FL:::/Kernel/KernelA.HPP,938"$ -$LK,"StrMatch",A="FL:::/Kernel/StrA.CPP.Z,317"$ -$LK,"FlushMsgs",A="FL:::/Kernel/SerialDev/Message.CPP.Z,87",BI=553$ -$LK,"CMT_JMP_TABLE",A="FL:::/Kernel/KernelA.HPP,1691"$ -$LK,"RLF_MP",A="FL:::/Kernel/KernelA.HPP,467"$ -$LK,"SC_GUI",A="FL:::/Kernel/KernelA.HPP,3592"$ -$LK,"RLF_INTERRUPTS",A="FL:::/Kernel/KernelA.HPP,465"$ -$LK,"StrLen",A="FL:::/Kernel/KernelB.HPP,61"$ -$LK,"ATA_READ_NATIVE_MAX",A="FL:::/Kernel/KernelA.HPP,2261"$ -$LK,"PUSH_C_REGS",A="FL:::/Kernel/KernelA.HPP,1766"$ -$LK,"IEF_REX_XOR_LIKE",A="FL:::/Kernel/KernelA.HPP,1735"$ -$LK,"WIf_SELF_KEY_DESC",A="FL:::/Kernel/KernelA.HPP,1447"$ -$LK,"RLf_INTERRUPTS",A="FL:::/Kernel/KernelA.HPP,446"$ -$LK,"ISO1DateStruct2CDate",A="FL:::/Kernel/BlkDev/FileSysISO.CPP.Z,14",BI=554$ -$LK,"DOCF_SEL",A="FL:::/Kernel/KernelA.HPP,1285"$ -$LK,"RLF_REGISTRY",A="FL:::/Kernel/KernelA.HPP,471"$ -$LK,"RLf_REGISTRY",A="FL:::/Kernel/KernelA.HPP,452"$ -$LK,"SC_INS",A="FL:::/Kernel/KernelA.HPP,3577"$ -$LK,"TK_DOT_DOT",A="FL:::/Kernel/KernelA.HPP,2108"$ -$LK,"RT_NUM_IT",A="FL:::/Kernel/KernelA.HPP,1568"$ -$LK,"AbsI64",A="FL:::/Kernel/KernelB.HPP,97"$ -$LK,"SC_TAB",A="FL:::/Kernel/KernelA.HPP,3561"$ -$LK,"SPF_DECIMAL",A="FL:::/Kernel/KernelA.HPP,3927"$ -$LK,"IOAPICVER",A="FL:::/Kernel/KernelA.HPP,513"$ -$LK,"LAPIC_LVT_TIMER",A="FL:::/Kernel/KernelA.HPP,498"$ -$LK,"sys_mem_init_flag",A="FL:::/Kernel/KernelB.HPP,183"$ -$LK,"RWF_IN_DOLLAR",A="FL:::/Kernel/KernelA.HPP,3598"$ -$LK,"DISPLAYf_CHILDREN_NOT_ON_TOP",A="FL:::/Kernel/KernelA.HPP,3303"$ -$LK,"RedSeaFmt",A="FL:::/Kernel/BlkDev/FileSysRedSea.CPP.Z,94",BI=555$ -$LK,"sys_var_init_flag",A="FL:::/Kernel/KernelB.HPP,185"$ -$LK,"IOAPIC_DATA",A="FL:::/Kernel/KernelA.HPP,510"$ -$LK,"SysGetStr2",A="FL:::/Kernel/KDbg.CPP.Z,337",BI=556$ -$LK,"fp_getstr2",A="FL:::/Kernel/KGlbls.CPP.Z,31"$ -$LK,"KDRawPutKey",A="FL:::/Kernel/KeyDev.CPP.Z,88",BI=557$ -$LK,"DOCF_SUBSCRIPT_MODE",A="FL:::/Kernel/KernelA.HPP,1291"$ -$LK,"Dos2CDate",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,9",BI=558$ -$LK,"SYS_START_CR0",A="FL:::/Kernel/KernelA.HPP,305"$ -$LK,"QSortI64",A="FL:::/Kernel/QSort.CPP.Z,1",BI=559$ -$LK,"RawPrint",A="FL:::/Kernel/KDbg.CPP.Z,217",BI=560$ -$LK,"CTextGlbls",A="FL:::/Kernel/KernelA.HPP,3603"$ -$LK,"CDevGlbls",A="FL:::/Kernel/KernelA.HPP,2921"$ -$LK,"chars_bmp_zero_cr_nl_cursor",A="FL:::/Kernel/StrA.CPP.Z,362"$ -$LK,"AreYouSure",A="FL:::/Kernel/StrB.CPP.Z,109",BI=561$ -$LK,"C:/Doc/D3.TXT.Z",A="FL:::/Kernel/KernelB.HPP,145"$ -$LK,"DOCf_IN_DOLLAR",A="FL:::/Kernel/KernelA.HPP,1326"$ -$LK,"DOCF_IN_DOLLAR",A="FL:::/Kernel/KernelA.HPP,1289"$ -$LK,"_REP_IN_U16",A="FL:::/Kernel/KUtils.CPP.Z,264"$ -$LK,"_REP_IN_U32",A="FL:::/Kernel/KUtils.CPP.Z,253"$ -$LK,"CH_FORM_FEED",A="FL:::/Kernel/KernelA.HPP,3515"$ -$LK,"MP_VECT_ADDR",A="FL:::/Kernel/KernelA.HPP,506"$ -$LK,"I_WAKE",A="FL:::/Kernel/KernelA.HPP,295"$ -$LK,"Yield",A="FL:::/Kernel/Sched.CPP.Z,284"$ -$LK,"CKeyDevGlbls",A="FL:::/Kernel/KernelA.HPP,3825"$ -$LK,"MRT_DEV",A="FL:::/Kernel/KernelA.HPP,2866"$ -$LK,"CBlkDevGlbls",A="FL:::/Kernel/KernelA.HPP,2756"$ -$LK,"CMBRPrt",A="FL:::/Kernel/KernelA.HPP,2302"$ -$LK,"StrNew",A="FL:::/Kernel/Mem/MAllocFree.CPP.Z,446",BI=562$ -$LK,"HTT_GLBL_VAR",A="FL:::/Kernel/KernelA.HPP,685"$ -$LK,"HTt_GLBL_VAR",A="FL:::/Kernel/KernelA.HPP,655"$ -$LK,"WIF_FOCUS_TASK_IP_L_D",A="FL:::/Kernel/KernelA.HPP,1426"$ -$LK,"HTT_HELP_FILE",A="FL:::/Kernel/KernelA.HPP,697"$ -$LK,"HTt_HELP_FILE",A="FL:::/Kernel/KernelA.HPP,667"$ -$LK,"Round",A="FL:::/Kernel/KernelB.HPP,139"$ -$LK,"TaskRstAwaitingMsg",A="FL:::/Kernel/SrvCmd.CPP.Z,25",BI=563$ -$LK,"MSG_IP_L_D_DOWN",A="FL:::/Kernel/KernelA.HPP,3232"$ -$LK,"ATAR0_STAT",A="FL:::/Kernel/KernelA.HPP,2284"$ -$LK,"DOC_COLOR_PMT",A="FL:::/Kernel/KernelA.HPP,1140"$ -$LK,"HPET_GEN_CONF",A="FL:::/Kernel/KernelA.HPP,534"$ -$LK,"MPHalt",A="FL:::/Kernel/MultiProc.CPP.Z,164",BI=564$ -$LK,"UnusedStk",A="FL:::/Kernel/KDbg.CPP.Z,46",BI=565$ -$LK,"DirEntryCompareName",A="FL:::/Kernel/BlkDev/DskDirA.CPP.Z,62",BI=566$ -$LK,"BFieldExtU32",A="FL:::/Kernel/KernelB.HPP,30"$ -$LK,"DOCf_SUBSCRIPT_MODE",A="FL:::/Kernel/KernelA.HPP,1328"$ -$LK,"ATAS_DF",A="FL:::/Kernel/KernelA.HPP,2273"$ -$LK,"ROPBF_PROBABILITY_DITHER",A="FL:::/Kernel/KernelA.HPP,2940"$ -$LK,"StrScan",A="FL:::/Kernel/StrScan.CPP.Z,212",BI=567$ -$LK,"CONSERVATIVE_16MEG_SIZE",A="FL:::/Kernel/Mem/PageTables.CPP.Z,96"$ -$LK,"ACD_DEF_FILENAME_Z",A="FL:::/Kernel/KernelA.HPP,1501"$ -$LK,"ATARepFind",A="FL:::/Kernel/BlkDev/DskATAId.CPP.Z,195",BI=568$ -$LK,"QSort2a",A="FL:::/Kernel/QSort.CPP.Z,32",BI=569$ -$LK,"num_lock_map",A="FL:::/Kernel/SerialDev/Keyboard.CPP.Z,179"$ -$LK,"QSort2b",A="FL:::/Kernel/QSort.CPP.Z,55",BI=570$ -$LK,"KDF_HAS_DESCS",A="FL:::/Kernel/KernelA.HPP,3816"$ -$LK,"CBlkPool",A="FL:::/Kernel/KernelA.HPP,2893"$ -$LK,"SC_NUM",A="FL:::/Kernel/KernelA.HPP,3567"$ -$LK,"MSG_IP_R_UP",A="FL:::/Kernel/KernelA.HPP,3235"$ -$LK,"IEF_DONT_SWITCH_MODES",A="FL:::/Kernel/KernelA.HPP,1730"$ -$LK,"I_TIMER",A="FL:::/Kernel/KernelA.HPP,292"$ -$LK,"IRQ_TIMER",A="FL:::/Kernel/KInts.CPP.Z,16"$ -$LK,"DOC_COLOR_TREE",A="FL:::/Kernel/KernelA.HPP,1139"$ -$LK,"DOCEf_HAS_BIN",A="FL:::/Kernel/KernelA.HPP,1062"$ -$LK,"DOCEF_HAS_BIN",A="FL:::/Kernel/KernelA.HPP,974"$ -$LK,"SYS_BOOT_BASE",A="FL:::/Kernel/KStart16.CPP.Z,30"$ -$LK,"VGAP_CRTC_INDEX",A="FL:::/Kernel/KernelA.HPP,3740"$ -$LK,"ATTRF_SEL",A="FL:::/Kernel/KernelA.HPP,891"$ -$LK,"DrvNextFreeLet",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,51",BI=571$ -$LK,"SFF_WHOLE_LABELS_AFTER",A="FL:::/Kernel/KernelA.HPP,3808"$ -$LK,"CDIR_FILENAME_LEN",A="FL:::/Kernel/KernelA.HPP,2551"$ -$LK,"CFifoI64",A="FL:::/Kernel/KernelA.HPP,175"$ -$LK,"PCIReadU32",A="FL:::/Kernel/PCIBIOS.CPP.Z,201",BI=572$ -$LK,"PCIReadU16",A="FL:::/Kernel/PCIBIOS.CPP.Z,182",BI=573$ -$LK,"YearStartDate",A="FL:::/Kernel/KDate.CPP.Z,8",BI=574$ -$LK,"ACD_H1_END",A="FL:::/Kernel/KernelA.HPP,1504"$ -$LK,"_REP_IN_U8",A="FL:::/Kernel/KUtils.CPP.Z,275"$ -$LK,"SHIFT_KEY_SCAN_DECODE_TABLE",A="FL:::/Kernel/SerialDev/Keyboard.CPP.Z,9"$ -$LK,"DOCF_BREAK_UNLOCKED",A="FL:::/Kernel/KernelA.HPP,1279"$ -$LK,"REG_UNDEF",A="FL:::/Kernel/KernelA.HPP,1789"$ -$LK,"VGAFlush",A="FL:::/Kernel/Display.CPP.Z,88",BI=575$ -$LK,"FILEMASK_AOT",A="FL:::/Kernel/KernelA.HPP,2290"$ -$LK,"SysDbg",A="FL:::/Kernel/KMisc.CPP.Z,233",BI=576$ -$LK,"FramePtrAdd",A="FL:::/Kernel/KHashB.CPP.Z,225",BI=577$ -$LK,"DCF_SCREEN_BITMAP",A="FL:::/Kernel/KernelA.HPP,3643"$ -$LK,"FF_NEEDS_WRITE",A="FL:::/Kernel/KernelA.HPP,2783"$ -$LK,"WIF_FOCUS_TASK_IP_R_D",A="FL:::/Kernel/KernelA.HPP,1428"$ -$LK,"DOCF_DBL_DOLLARS",A="FL:::/Kernel/KernelA.HPP,1262"$ -$LK,"LAPIC_APIC_ID",A="FL:::/Kernel/KernelA.HPP,479"$ -$LK,"MPrintTime",A="FL:::/Kernel/StrPrint.CPP.Z,42",BI=578$ -$LK,"CatPrint",A="FL:::/Kernel/StrPrint.CPP.Z,881",BI=579$ -$LK,"TK_CHAR_CONST",A="FL:::/Kernel/KernelA.HPP,2076"$ -$LK,"TASKf_AWAITING_MSG",A="FL:::/Kernel/KernelA.HPP,3290"$ -$LK,"ICF_A1_TO_INT",A="FL:::/Kernel/KernelA.HPP,1594"$ -$LK,"DOCf_DBL_DOLLARS",A="FL:::/Kernel/KernelA.HPP,1298"$ -$LK,"EDF_UNCOLLAPSE",A="FL:::/Kernel/KernelA.HPP,1248"$ -$LK,"DOCEG_HAS_ALLOC",A="FL:::/Kernel/KernelA.HPP,1027"$ -$LK,"CHashSrcSym",A="FL:::/Kernel/KernelA.HPP,724"$ -$LK,"HashPublic",A="FL:::/Kernel/KHashB.CPP.Z,170",BI=580$ -$LK,"HEAP_CTRL_SIGNATURE_VAL",A="FL:::/Kernel/KernelA.HPP,2906"$ -$LK,"EDf_UNCOLLAPSE",A="FL:::/Kernel/KernelA.HPP,1254"$ -$LK,"CDocSettings",A="FL:::/Kernel/KernelA.HPP,1147"$ -$LK,"BlkDevInit",A="FL:::/Kernel/BlkDev/DskBlkDev.CPP.Z,31",BI=581$ -$LK,"CTaskStk",A="FL:::/Kernel/KernelA.HPP,3307"$ -$LK,"CWinMgrTimingGlbls",A="FL:::/Kernel/KernelA.HPP,1458"$ -$LK,"FAT32_ENTRIES_PER_BLK",A="FL:::/Kernel/KernelA.HPP,2408"$ -$LK,"ATARBlks",A="FL:::/Kernel/BlkDev/DskATA.CPP.Z,442",BI=582$ -$LK,"GVF_ALIAS",A="FL:::/Kernel/KernelA.HPP,870"$ -$LK,"CTaskSettings",A="FL:::/Kernel/KernelA.HPP,3250"$ -$LK,"IEF_ENDING_ZERO",A="FL:::/Kernel/KernelA.HPP,1737"$ -$LK,"PUT_CHARS",A="FL:::/Kernel/StrA.CPP.Z,51"$ -$LK,"CMemE820",A="FL:::/Kernel/KernelA.HPP,358"$ -$LK,"DVD_BOOT_LOADER_SIZE",A="FL:::/Kernel/KernelA.HPP,2299"$ -$LK,"FILEMASK_GRA",A="FL:::/Kernel/KernelA.HPP,2293"$ -$LK,"ATAS_DRQ",A="FL:::/Kernel/KernelA.HPP,2272"$ -$LK,"DOCF_BORDER_DOC",A="FL:::/Kernel/KernelA.HPP,1265"$ -$LK,"DrvEnable",A="FL:::/Kernel/BlkDev/DskAddDev.CPP.Z,160",BI=583$ -$LK,"BlkDevLock",A="FL:::/Kernel/BlkDev/DskBlkDev.CPP.Z,1",BI=584$ -$LK,"BDT_NUM_TYPES",A="FL:::/Kernel/KernelA.HPP,2635"$ -$LK,"DOCf_BORDER_DOC",A="FL:::/Kernel/KernelA.HPP,1301"$ -$LK,"MRT_RAM",A="FL:::/Kernel/KernelA.HPP,2865"$ -$LK,"FSt_NUM_TYPES",A="FL:::/Kernel/KernelA.HPP,2694"$ -$LK,"ATAS_BSY",A="FL:::/Kernel/KernelA.HPP,2275"$ -$LK,"HTt_NUM_TYPES",A="FL:::/Kernel/KernelA.HPP,669"$ -$LK,"ICF_R_WAS_STK",A="FL:::/Kernel/KernelA.HPP,1606"$ -$LK,"DOCf_BREAK_UNLOCKED",A="FL:::/Kernel/KernelA.HPP,1315"$ -$LK,"sys_mem_init_val",A="FL:::/Kernel/KernelB.HPP,184"$ -$LK,"SYS_SEMA_FORCE_WINMGR",A="FL:::/Kernel/KernelA.HPP,611"$ -$LK,"ATAS_ERR",A="FL:::/Kernel/KernelA.HPP,2271"$ -$LK,"Struct2Date",A="FL:::/Kernel/KDate.CPP.Z,14",BI=585$ -$LK,"ISO1T_TERMINATOR",A="FL:::/Kernel/KernelA.HPP,2482"$ -$LK,"SF_RBP",A="FL:::/Kernel/KernelA.HPP,557"$ -$LK,"SYS_MP_CNT",A="FL:::/Kernel/KStart32.CPP.Z,47"$ -$LK,"CMF_U8_JMP_TABLE",A="FL:::/Kernel/KernelA.HPP,1699"$ -$LK,"CMF_I8_JMP_TABLE",A="FL:::/Kernel/KernelA.HPP,1698"$ -$LK,"EdLiteUpdate",A="FL:::/Kernel/EdLite.CPP.Z,7",BI=586$ -$LK,"_ARC_ENTRY_GET",A="FL:::/Kernel/Compress.CPP.Z,43"$ -$LK,"DOCT_NUM_TYPES",A="FL:::/Kernel/KernelA.HPP,944"$ -$LK,"SYS_CTRL_ALT_FLAGS",A="FL:::/Kernel/KStart32.CPP.Z,24"$ -$LK,"BOOT_RAM_BASE",A="FL:::/Kernel/KernelA.HPP,3886"$ -$LK,"MT_DVD",A="FL:::/Kernel/KernelA.HPP,2544"$ -$LK,"FramePtrDel",A="FL:::/Kernel/KHashB.CPP.Z,240",BI=587$ -$LK,"chars_bmp_filename",A="FL:::/Kernel/StrA.CPP.Z,345"$ -$LK,"CICType",A="FL:::/Kernel/KernelA.HPP,1627"$ -$LK,"ICF_A2_WAS_STK",A="FL:::/Kernel/KernelA.HPP,1608"$ -$LK,"FILEMASK_JIT",A="FL:::/Kernel/KernelA.HPP,2289"$ -$LK,"ATAS_DRDY",A="FL:::/Kernel/KernelA.HPP,2274"$ -$LK,"ARGT_AL",A="FL:::/Kernel/KernelA.HPP,1919"$ -$LK,"CIntermediateCodeBase",A="FL:::/Kernel/KernelA.HPP,1646"$ -$LK,"CAutoCompleteDictGlbls",A="FL:::/Kernel/KernelA.HPP,1523"$ -$LK,"SYS_CODE_BP",A="FL:::/Kernel/KStart32.CPP.Z,27"$ -$LK,"WClusters",A="FL:::/Kernel/BlkDev/DskCluster.CPP.Z,129",BI=588$ -$LK,"LXchgI64",A="FL:::/Kernel/KernelB.HPP,253"$ -$LK,"MSG_KEY_DOWN_UP",A="FL:::/Kernel/KernelA.HPP,3242"$ -$LK,"TASKf_NONTIMER_RAND",A="FL:::/Kernel/KernelA.HPP,3295"$ -$LK,"ARGT_CL",A="FL:::/Kernel/KernelA.HPP,1924"$ -$LK,"ARGT_M8",A="FL:::/Kernel/KernelA.HPP,1904"$ -$LK,"ChkOnStk",A="FL:::/Kernel/KDbg.CPP.Z,31",BI=589$ -$LK,"TaskQueInsChild",A="FL:::/Kernel/Sched.CPP.Z,314",BI=590$ -$LK,"TK_F64",A="FL:::/Kernel/KernelA.HPP,2077"$ -$LK,"RLF_BOOT_HEAP",A="FL:::/Kernel/KernelA.HPP,462"$ -$LK,"RLf_BOOT_HEAP",A="FL:::/Kernel/KernelA.HPP,443"$ -$LK,"I_USER",A="FL:::/Kernel/KernelA.HPP,301"$ -$LK,"FAT32CDirFill",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,226",BI=591$ -$LK,"BlkPoolAdd",A="FL:::/Kernel/Mem/BlkPool.CPP.Z,1",BI=592$ -$LK,"sys_task_being_screen_updated",A="FL:::/Kernel/KGlbls.CPP.Z,11"$ -$LK,"TK_NORMALSCRIPT",A="FL:::/Kernel/KernelA.HPP,2072"$ -$LK,"SF_RIP",A="FL:::/Kernel/KernelA.HPP,558"$ -$LK,"IOAPIC_REG",A="FL:::/Kernel/KernelA.HPP,509"$ -$LK,"Complex",A="FL:::/Kernel/KernelA.HPP,115"$ -$LK,"Trunc",A="FL:::/Kernel/KernelB.HPP,141"$ -$LK,"ROPB_EQU",A="FL:::/Kernel/KernelA.HPP,2933"$ -$LK,"HTf_IMM",A="FL:::/Kernel/KernelA.HPP,675"$ -$LK,"sys_pci_services",A="FL:::/Kernel/PCIBIOS.CPP.Z,159"$ -$LK,"CStreamBlk",A="FL:::/Kernel/KernelA.HPP,2011"$ -$LK,"ARGT_M32",A="FL:::/Kernel/KernelA.HPP,1906"$ -$LK,"ARGT_M16",A="FL:::/Kernel/KernelA.HPP,1905"$ -$LK,"MEM_EXTRA_HASH2_PAGES",A="FL:::/Kernel/KernelA.HPP,2882"$ -$LK,"ARGT_CS",A="FL:::/Kernel/KernelA.HPP,1934"$ -$LK,"ICF_R_TO_F64",A="FL:::/Kernel/KernelA.HPP,1591"$ -$LK,"DOC_COLOR_QUOTE",A="FL:::/Kernel/KernelA.HPP,1145"$ -$LK,"DOCSS_DBL_QUOTE",A="FL:::/Kernel/KernelA.HPP,1130"$ -$LK,"SYS_PCI_SERVICES",A="FL:::/Kernel/PCIBIOS.CPP.Z,5"$ -$LK,"_STRCMP",A="FL:::/Kernel/StrA.CPP.Z,86"$ -$LK,"ARGT_AX",A="FL:::/Kernel/KernelA.HPP,1920"$ -$LK,"LAPIC_PROCESSOR_PRIORITY",A="FL:::/Kernel/KernelA.HPP,483"$ -$LK,"Core0Init",A="FL:::/Kernel/MultiProc.CPP.Z,355",BI=593$ -$LK,"ARGT_DS",A="FL:::/Kernel/KernelA.HPP,1929"$ -$LK,"ARGT_R8",A="FL:::/Kernel/KernelA.HPP,1894"$ -$LK,"AStrNew",A="FL:::/Kernel/Mem/MAllocFree.CPP.Z,461",BI=594$ -$LK,"ARGT_ES",A="FL:::/Kernel/KernelA.HPP,1930"$ -$LK,"ICF_A2_TO_F64",A="FL:::/Kernel/KernelA.HPP,1595"$ -$LK,"DOCF_PLAIN_TEXT_TABS",A="FL:::/Kernel/KernelA.HPP,1259"$ -$LK,"Cf_INTERNAL_TYPE",A="FL:::/Kernel/KernelA.HPP,831"$ -$LK,"FAT32DrvInit",A="FL:::/Kernel/BlkDev/FileSysFAT.CPP.Z,22",BI=595$ -$LK,"DOCT_ANCHOR",A="FL:::/Kernel/KernelA.HPP,927"$ -$LK,"KbdPktRead",A="FL:::/Kernel/SerialDev/Keyboard.CPP.Z,388",BI=596$ -$LK,"KbdCmdRead",A="FL:::/Kernel/SerialDev/Keyboard.CPP.Z,36",BI=597$ -$LK,"D3DivEqu",A="FL:::/Kernel/KernelB.HPP,152"$ -$LK,"ARGT_FS",A="FL:::/Kernel/KernelA.HPP,1931"$ -$LK,"TK_I64",A="FL:::/Kernel/KernelA.HPP,2075"$ -$LK,"ARGT_DX",A="FL:::/Kernel/KernelA.HPP,1925"$ -$LK,"ARGT_M64",A="FL:::/Kernel/KernelA.HPP,1907"$ -$LK,"DOCE_LEN_DFT",A="FL:::/Kernel/KernelA.HPP,1179"$ -$LK,"DOC_COLOR_KEYWORD2",A="FL:::/Kernel/KernelA.HPP,1143"$ -$LK,"CD2I32",A="FL:::/Kernel/KernelA.HPP,137"$ -$LK,"DrvLock",A="FL:::/Kernel/BlkDev/DskDrv.CPP.Z,1",BI=598$ -$LK,"ARGT_GS",A="FL:::/Kernel/KernelA.HPP,1933"$ -$LK,"CICTreeLinks",A="FL:::/Kernel/KernelA.HPP,1639"$ -$LK,"DOC_COLOR_COMMENT",A="FL:::/Kernel/KernelA.HPP,1144"$ -$LK,"SYS_MEM_E801",A="FL:::/Kernel/KStart16.CPP.Z,31"$ -$LK,"ATA_NOP",A="FL:::/Kernel/KernelA.HPP,2258"$ -$LK,"SVCf_DONT_FILTER",A="FL:::/Kernel/KernelA.HPP,3181"$ -$LK,"IET_REL_I0",A="FL:::/Kernel/KernelA.HPP,394"$ -$LK,"OC_ADDR_SIZE_PREFIX",A="FL:::/Kernel/KernelA.HPP,1758"$ -$LK,"SYS_MEM_E820",A="FL:::/Kernel/KStart16.CPP.Z,32"$ -$LK,"SUF_SINGLE_SPACE",A="FL:::/Kernel/KernelA.HPP,3797"$ -$LK,"RFLAGG_START",A="FL:::/Kernel/KernelA.HPP,326"$ -$LK,"CKeyDevEntry",A="FL:::/Kernel/KernelA.HPP,3817"$ -$LK,"MSG_IP_R_D_DOWN_UP",A="FL:::/Kernel/KernelA.HPP,3246"$ -$LK,"MSG_IP_L_D_DOWN_UP",A="FL:::/Kernel/KernelA.HPP,3244"$ -$LK,"XTalkWait",A="FL:::/Kernel/SrvCmd.CPP.Z,455",BI=599$ -$LK,"MemPageTable",A="FL:::/Kernel/Mem/PageTables.CPP.Z,127",BI=600$ -$LK,"CCF_KEEP_NUM_SIGN",A="FL:::/Kernel/KernelA.HPP,2137"$ -$LK,"ARGT_MM",A="FL:::/Kernel/KernelA.HPP,1938"$ -$LK,"chars_bmp_alpha_numeric_no_at",A="FL:::/Kernel/StrA.CPP.Z,335"$ -$LK,"SysHlt",A="FL:::/Kernel/KernelB.HPP,259"$ -$LK,"FUF_JUST_DIRS",A="FL:::/Kernel/KernelA.HPP,2606"$ -$LK,"CD2I64",A="FL:::/Kernel/KernelA.HPP,141"$ -$LK,"CD3I32",A="FL:::/Kernel/KernelA.HPP,127"$ -$LK,"_STRCPY",A="FL:::/Kernel/StrA.CPP.Z,65"$ -$LK,"RedSeaDrvValidate",A="FL:::/Kernel/BlkDev/FileSysRedSea.CPP.Z,82",BI=601$ -$LK,"YELLOW",A="FL:::/Kernel/KernelA.HPP,2972"$ -$LK,"FUf_JUST_DIRS",A="FL:::/Kernel/KernelA.HPP,2580"$ -$LK,"RedSeaFreeFreeLst",A="FL:::/Kernel/BlkDev/FileSysRedSea.CPP.Z,3",BI=602$ -$LK,"IPVarsInit",A="FL:::/Kernel/SerialDev/InputPointer.CPP.Z,68",BI=603$ -$LK,"IET_REL_I8",A="FL:::/Kernel/KernelA.HPP,396"$ -$LK,"MouseGetDevType",A="FL:::/Kernel/SerialDev/Mouse.CPP.Z,26",BI=604$ -$LK,"ARGT_R32",A="FL:::/Kernel/KernelA.HPP,1896"$ -$LK,"ARGT_R16",A="FL:::/Kernel/KernelA.HPP,1895"$ -$LK,"DOC_DFT",A="FL:::/Kernel/KernelA.HPP,1157"$ -$LK,"CMemberLstMeta",A="FL:::/Kernel/KernelA.HPP,789"$ -$LK,"DISPLAYf_WIN_ON_TOP",A="FL:::/Kernel/KernelA.HPP,3302"$ -$LK,"CAutoCompleteGlbls",A="FL:::/Kernel/KernelA.HPP,1486"$ -$LK,"CAOTImportExport",A="FL:::/Kernel/KernelA.HPP,1959"$ -$LK,"MEM_SETH_STK",A="FL:::/Kernel/KernelA.HPP,2885"$ -$LK,"DOCEF_HAS_TERMINATOR",A="FL:::/Kernel/KernelA.HPP,1013"$ -$LK,"CD3I64",A="FL:::/Kernel/KernelA.HPP,145"$ -$LK,"c32_edi",A="FL:::/Kernel/PCIBIOS.CPP.Z,157"$ -$LK,"_CALL_IND",A="FL:::/Kernel/KUtils.CPP.Z,332"$ -$LK,"PURPLE",A="FL:::/Kernel/KernelA.HPP,2963"$ -$LK,"TASKf_BREAK_LOCKED",A="FL:::/Kernel/KernelA.HPP,3291"$ -$LK,"FILEMASK_SRC",A="FL:::/Kernel/KernelA.HPP,2291"$ -L8Gû×û×ØØØ)Ø+Ø<ØRØaØ{ةححزØDVc££§¶ÂÎÚèôû    @4@SS[_v¤³¿ÍÔåæê,‡ŽMMM'M,M0MT†×¨•¨•¬•ĕѕ֕ߕä•é•î•ó•ø•ý•–6–G–a–n–w–|––†––”–œ–º–º–¿–Ï–Õ–ß–ä–í–ô–ò–———(—]—b—‰—Ž—“—˜—¹—·—Ç—Ó—ê—ó—ú—˜˜4˜4˜;˜B˜G˜N˜W˜X˜a˜f˜$™<###6Piv}ˆ–D’Ÿããñÿ '::Cˆ/MJ¬J¬Z¬e¬p¬w¬w¬š¬¦¬µ¬¬ϬÔ¬Ú¬é¬ï¬ö¬ö¬ú¬ú¬ú¬ú¬­ -­­ 0ÎÖÓÓí‘‘‘‘$‘ -Ì ;X3X3p3v33“3Ÿ3´3º3À3Æ3å3ê3ò3ò344 4046484G4K4Z4`4c4e4t4x4‡444’4¢4¦4º4½4À4Â4Ñ4Ô4à4 Ä¥Òà0à01 11 171A1G1J1M1P1Œ11’1”1§1ª1­1µ1»1À1À1Æ1Ò1Ô1Ý1Ý1Ý1Ý1ã1æ1ë1î1ö12 ˆCa:·:·`·d·l·r·{·ƒ·‰·Œ·˜·˜·Æ·Ó·Ý·à·ã·ê·ò·ø·¸¸¸ h"Ÿ"Ÿ+Ÿ9ŸHŸSŸcŸsŸƒŸ“Ÿ¢Ÿ±ŸÁŸÑŸòŸôŸ  " 2 ^ ^ c 4æï«‘«‘őӑë‘þ‘’’ -’h:P [ [.[0[=[J[Q[X[`[d[{[—[«[º[Â[Ë[Í[Í[Õ[44=`C`CnCŠCŠCC§C§C­C TX#ô#ô1ô?ô(-3 %-BDNHÜê™p™p¹pÆpËp×p÷pýpqqqq&q(Z`®Õ®ÕÈÕÚÕâÕèÕðÕ$ü²‚²‚»‚Âɂ΂0¯·‚͂ͣ͘ʹͶ;Í8– Ð]Ð]Þ]å]ð]õ]÷]^^^^Pr‚È\È\Ö\Ý\è\í\ö\] ]]]]"](]€[wb¼b¼¼”¼˜¼¯¼¿¼Õ¼ë¼ý¼ý¼½½*½0½3½:½>½B½F½J½J½J½¾à:.’€’€«€³€΀Ù€à€í€ú€.LWeu~‹ª¯¶¾ÐÓáð‚‚ ‚‚(‚@‚D‚I‚\‚|‚‹‚’‚™‚™‚ ‚¨‚µ‚·‚ɂтӂ݂ä‚ä‚ä‚ë‚ó‚ý‚ƒƒ"ƒ8ƒgƒgƒ‹ƒ‹ƒ’ƒœƒ²ƒÔƒÙƒÙƒàƒèƒþƒ „%„%„(„G„J„V„Y„\„z„z„„„‡„Œ„„ „£„¼„¼„Á„Á„Ô„Û„å„û„…………1…8…@…V…t…w…y…y…”…—…·…Ò…Û…ä…è…ö…ü…ü…††††††*†=†H†Y†\†_†d†d†i††„†ª†®†Ɇâ†ë†ô†ø†‡ ‡‡‡‡$‡'‡*‡8‡A‡G‡J‡O‡O‡c‡o‡{‡‹‡£‡ȇÕ‡Ù‡ï‡ ˆˆ$ˆ(ˆ+ˆ+ˆ;ˆAˆSˆXˆ`ˆgˆsˆˆ“ˆ•ˆ¦ˆ­ˆ¹ˆÒˆ߈âˆéˆìˆîˆ‰‰ ‰.‰.‰.‰5‰A‰K‰Y‰b‰h‰o‰z‰ƒ‰’‰¡‰°‰ЉÙ‰CŠ4×à+‘+‘?‘M‘e‘p‘r‘r‘z‘@?K[[cjw†•ª¾ÍÖõù`ˆœc c q ~ ˆ ˆ › £ ¶ ¸ Ë Ë Ï Ù Þ Þ ä |w’žž:žJžUžZž\žbžtž†ž–ž§ž·ž¹ž¹ž¹ž¿žØžõžŸŸŸŸŸ XÓå£2£2¯2±2À2Ö2â2é2333333$3 @8DÚƒÚƒèƒêƒ „„„#„!|ÿƒƒ´·ÅÎÎåö #'8KTdl|‹ŽÃ"4ÑÚkk'k9kHkYklkrk{k#¬ElP{P{f{w{{{Š{œ{°{»{Á{Ù{Ù{í{û{||||%|%|+|+|•|š|š|Â|Â|Ð|Ó|Ö|ä|ê|ó|}$,Ûâ{k{k‰k¬k—k¼kÂkék% †Š V V)V6V;V&H—¥6û6ûQûSûdûpûuûûû…ûû'Œ¬Ë®ò®òÏòÒòÛò÷ò -ó -óóó"ó<óDóWóaófóróxóóŒóó˜ó›óžó£óÊó( lpîÄîÄÅÅÅ)D6Cààüþ&39<H*p¼Ôüü$ü2üHüWü\ülünütü}ü…üüªüºüÉüÉüÐüÐüÐüÁý+h#9°p°pÆpÈp×pëpípöpøpøpûpqWqdqnq~qˆq“q–q¤q,$gl(s(s,s PT~æ~æ‚æ”æ–æ?L¡°ÂÒÂÒÌÒâÒñÒ÷ÒÓ ÓÓ!Ó0Ó6ÓEÓKÓMÓRÓ@H!*ƒ*ƒ8ƒDƒIƒIƒZƒlƒqƒqƒwƒA,€X€X‰X’XžX«X±X¶XBLõ’–’– –£–¯–¹–¿–Ì–à–à–—— —#—'—-—C …‰ö ö ú   D\˜«òòò(ò-ò3ò>òGòGòWòcògòò†ò‰ò‹ò®òE4Š“    , M b b b f F,jqFFFSFcF‰F“F•FG¸Çx1x1€1ˆ1“1²1»1Ñ1å1ï1û122262[2h2p2†2‘2™2™2¨2É2î2û233$36363D3K3]3]3k3k3l33H ”˜f f j  ‘ IpuŠÑŠÑ¤Ñ¶ÑÒÑÒÑÙÑÛÑÛÑéÑëÑëÑ÷Ñ÷ÑýÑÒ ÒÒ,ÒFÒFÒFÒSÒJ DÀuÀuÈuÔuüuvv#v/v=vLv‘v‘v½vÚvävóvñv w wFwFwKwPwPw_wsw˜w³wÁwãwûwx x#x%x%x1x1x3x3xCxOxOxSxXxaxsxzxˆx—xÏxØxêxêxðxK{K|7SùSùkùuù|ùˆù‹ù™ùœù ù¢ù¥ù¨ù°ù³ù»ùÏùÙùïùõùøùúùú úL4•žww ww w'wGwHwMwM,'.NåNåXåZåbå|åå‡åNXƒ•(](]:]=]H]M]Z]l]l]u]‰]“]œ]²]½]Ä]Î]OQqØ[Ø[ò[ý[\ \\6\>\F\S\]\d\k\o\s\~\„\\‘\š\ \£\±\³\Á\P­é ÿ ÿ%ÿ,ÿ=ÿ@ÿaÿtÿÿÿ¸ÿÑÿÝÿäÿæÿéÿïÿóÿ(8@FSVYgxˆ”–¦³¹ÆÚÝàèèèð÷þþ $Q ™– – š ¯ ³ R„ *öÒöÒÓÓ&Ó3ÓOÓRÓXÓaÓmÓoÓ…Ó›ÓŸÓºÓ½ÓÃÓÐÓÜÓÞÓÞÓîÓñÓÔSˆ {ß{߃ߎߞ߭߹ßÝßÝßÝßåßêßêßàà>àVà^à`à`àlàlà~à…à…à—àœà¤àT,æí+3+3/3H3O3Q3U ž¢¶ ¶ º É Í VTFWn -n -‘ -˜ -¢ -¦ -ª -® -¸ -¸ - -Õ -á -ä -ò -W £§Î Î Ò ß ã X äèÖëÖëÚëðëòëYHú¹q¹qÙqæqëq÷qrr#r0r9r:rFrZHëù)q)qIqVq[qgq‡qq“q q©qªq¶q[ ¨¬æ æ ê ï ó \ ­±ö ö ú   ]<æñ*Õ*Õ;ÕGÕKÕWÕYÕeÕlÕrÕzÕ^d`u£U£U«U¯U¯U¾UÝUìUõUþUV'V0V7V[VdVkVwVyV_´¥Î@M@MKM\MMŽM™M¨MµMÎMåMéMíMõMýMN$N,NCNGNKNONWN_NhN†N™N¢N³NºNºNËNÔN`0&$œ$œ-œ-œDœgœgœlœadÆÛ›`›`©`®`¾`Ã`Ò`×`Ù`ß`î`ó`õ`aaaab8 “(“(­(±(´(¿(Ü(à(å()c ’M’M›M¦MµMdDÀÍ__2_I_V_V_`_€_Š_eLš©ªPªP¸P½P¿PÎPÐPÞPéPòPòPóPùPf,bi˜E˜EœEÓEãE FFFg,RYDD”DËDÛDEEEh0ÇÏŠ”Š”ž”Ý”ä”ê”÷” -••i[ÃÃËÖÞÿ+;N[nŒ•¢®º¿Üááîø 2ATq|„Ÿª¿Ýéò÷*9Nhs{†††‹™¤«¶»Âj,ry˜F˜FœFÓFãF GGGk$ûûaûab(b.b:bl$+0ÔÔÔ(Ô:ÔvÔm¨Ci*¢*¢S¢X¢b¢l¢v¢‚¢‚¢Š¢³¢¼¢Á¢Ê¢Í¢Ò¢Ò¢ê¢ÿ¢££ £££E£I£Q£S£^£^£c£c£r£‚£n<$/ê ê ø ¡¡¡$¡.¡]¡_¡e¡oü–ÑCNCNWNfNuNNŽNNNÃNØNãNêN OO(O6ODOROrOhO~OO›O­O¿OÆOÍOÚOáOéOùOPPPGP]PnPnPvPyP‡Pp@nz,Ÿ,Ÿ9ŸAŸDŸRŸVŸZŸ]ŸkŸrŸwŸq(bÒzÒzåzëzúz{ { {{{!{+{<{M{a{c{~{®{Å{Þ{é{û{ |!|:|D|]|g|€|Š|•|£|ª|¸|¸|Â|Û|}}%}*},}6}R}[}c}~}rD/<ŽåŽå—å¬å¸åÃåÌåÚåååíåòås<²½;i;iQidixii›i¢i¸i¾iÄiúit,CCGt›ÈÝßu<bmäžäžñžùžüž -ŸŸŸ Ÿ$Ÿ)Ÿv|0VVgq—¯ÄÞåö&00AINUbvwLš©/6=IRlw|…›ª´´Éx8rQrQˆQ•Q§QÁQÏQØQâQy &í&í*íCízÔ._SS[cq„“©´ÂÑâþ""-/DPbv¨¹Æáþ--;BTTbbgk{4¨±»h»hÏháhêhi i!i'i:i|0DL£L£L«LÁLÌLÛLõLýL}PZjSSeluƒˆ‹‘”™¤ª´~d¦»–û–û¯û²ûÀûÀûÉûÔûÙûÜûìû÷ûýûüüü üüH<Jöîöîï ïï ï#ï0ï9ï9ï=ï@ïHï€$@EF -F -O -] -c -h -4ÕÞÆýÆýÔýâýêýõýþþþ þ‚¬Lsêsêsüs tt%t8tOtbtytŒt£tºtÑtìtðt÷týtuu,u9u?uZu^ueukuouušu§u­u°uºuƒ?666 616@6J6V6V6Z6b6f66¹6Ë6ß67 7777-727=7S7g7n7 7Ó7ä7ô7 -88%8W8Š8›8«8«8²8Ä8Ä8Ò8Ò8Ó8å8å8ó8÷8û8„P—§hh)hLTLXLXL\LdL¤6[˜†˜†²†º†¾†ƆÒ†Ù†à†å†ú† ‡‡‡‡#‡(‡?‡B‡K‡Q‡T‡V‡`‡e‡|‡‡‡ˆ‡Œ‡š‡81;vÔvÔ„Ô›Ô¦Ô¦Ô±ÔµÔµÔ»Ô‘$<;!;!C!S!c!u!„!!›!©!°!»!Ç!Ü!ê!ò!"")"6"K"U"j"t"‰"“"¨"¶"¶"Ä"Ð"Ü"ð"#&#5#C#O#[#l##–#§#±#Ã#Õ#ç#ù#,$:$O$t$‹$”$£$¾$Õ$Þ$é$ð$û$%%%’0v~{V{VVV¬VÁVÆVàV“02:ŒŒ/Œ:ŒLŒTŒWŒ_Œ”¼KvÛ\Û\÷\]*]1]>]J]R]]]e]p]{]Ÿ]®]µ]¼]Í]Ï]×]â]í]ü]^^^^^,^5^5^9^R^•,ÑØîóîóüóô ô#ô%ô9ô–P Y¸X¸XÒXÕXÛXçXéXøXÿXY.Y5YbYiYmY…Y‘Y®Y·Y·Y·YÄYýY ZZ"Z5ZCZTZgZtZ…ZœZ¢ZéZûZ([/[N[U[`[|[|[ˆ[Š[Š[–[˜[˜[¤[¦[¦[¶[¹[¹[Å[Ñ[ê[ö[ÿ[ -\ \.\.\.\?\X\_\f\l\o\·\—P&¨Ž¨ŽÈŽÛŽçŽóŽ  %'@˜4#˜B˜B¡B¶B¶BÃBØBØBÝB™ ÌÐÎóÎóÜóåóëóš0ÐØ••.•m•t•z•’•••¡•›¼ -5h…h…†…Š…‘…˜…¥…³…¼…¿…Å…Ë…Ò…Ù…Û…å…ê…ô…†††#†&†)†1†6†L†X†[†^†^†^†^†a†i†q†x††‘†œ0HPÎøÎøÜøêøòøù.ùVù€ R R4R;RCRKRgRgRuRwRwR‡R‰R‰R—R™R™R©R±R±RºRÆRãRãRõRõRùR SžXò[Z[ZeZyZŠZ•Z±Z´ZÂZÈZËZÜZ÷ZûZŸ@¡­ ^*^2^J^J^S^g^m^v^’^–^ @$0ãòãòñòöòùò óóóóó¡H&4j×j×׋׎חף׫×È×××Ý×à×ì×¢ îòìì"ì/ì1ì£ä{°èsèstt2tuPuPuPuPu[u[uiu¤ Ñõ“E“E²E´EÅEÊEØEùEFF F8F?FAFAFSFYF_FaFgFmFpFvFxFFF–F–F–FF®F¥T…–®ú®úÒúÕúãúãú÷úûûû#û#û#û'û5û¦`p„úú3ú9úGúGú[úfújúqútú~ú…ú•ú™ú™ú™úú©ú§Hïý’ĒĹÄ×ÄåÄðÄôÄøÄüÄÅÅÅŠŨD"/zƒzƒˆƒ”ƒ™ƒ™ƒªƒ¯ƒ¯ƒµƒ©t¹Òs1s1{1Œ1°1·1È1ì1ú122$2+252C2Y2o2q2‡2222Ÿ2ªX{ÃBÃBÜBìBCCCC.C4C4C@CLCNCNCVC«XÙë+<4<;<Q<f<|<„<›<¥<Â<Ç<Î<ã<ê<ò<÷<¬8x‚ -¾ -¾¾¾¾<¾H¾J¾J¾ξ­8>H°C°C¾CÄCËCáCáCèCDDD®<u€b®b®}®‹®’®–®™®®¤®È®Ø®¯`«¿’w’w–w­wßwx+x:xIxNxTxVx°LÛñÛñöñòò ò ò,ò,ò<ò@ò@òPòRòRò‰ò±d@Õ99 9!9(9F9W9f9s9‚9–9®9Æ9Ù9ï9ú9$:?:\::†:Ÿ:´:Ô:ë:û:ý:3;Š;[;Y;©;º;Á;á;ö;<<7<7<V<]<™<§<=Ø<Ö<&=-=2=H=P=P=u=…=¦=ì=¹=Á=¬=>G>O>O>o>„>¥>¯>Æ>Î>¹>"?"?"?'?'?8?S?a?y?’?«?Æ?Þ?ô? @@%@%@8@Q@e@z@˜@œ@š@ê@ø@AA.AIATAlA‚A‚AÙAªA¨AøABB1BIB_BaB«B|BzBÊBÊBÓBÜBñBñBC CCC/C/C2C6C²4 -Ê|Ê|Ø|Ý|à|æ|é|ë|ñ|³,sz˜s˜sœs¡s«s»s»sçs´T®¿˜^˜^¦^³^À^Þ^á^è^ï^ý^__ __µÔ%V³@³@Ó@á@æ@ð@ð@÷@AAAAA$A'A+A7A7ACAIAVAdAfAfAfAiAnAzAzA†AŸA¢AµAµA¸A»AËA¶4mvû6û67757K7‡7•7™7·À6b‹ç‹ç–çšç¾çÉçØçäçøçè è7èGèkèkèè‘è‘èµè·è·èÛèÝèÝèéèéèñèñèýèé!é)é)é;éBéBéTéaéméé¸ÈÉ÷ë"ë"# ###0#5#5#G#L#L#^#c#c#u#z#z#Œ#‘#‘#‘#‘#˜###¯#´#´#Æ#Ë#Ë#â#$$$$$6$=$D$M$\$¿$¹ˆTr:O:OPOUOaOaOmOuO}OˆO‘O™OžO O¤O³O¾OÆOÎOÏOÏOÙOº(w}›7›7¤7«7Ë7Ò7Õ7»üF‹ú‹ú“ú—ú¸úÃúÌúâúöúûû-ûNû„û¦û»ûÄûÆûÎûÖûíûõûü üüüü*ü1üDüTü[üqü‡ü‰üüüü™ü¥ü¥üªü³üÅüÌüÌüÞüäüùü¼„a~öÕöÕúÕ Ö ÖÖÖ'Ö'Ö6ÖEÖEÖYÖTÖhÖcÖrÖrÖÖÖÖüÚ½¨s™ÚOÚOôO P!P(P3P9P9PvAvSv¿TÊÛ†Þ†Þ”Þ›Þ¦ÞÉÞ×ÞáÞçÞñÞöÞß -ß ßßÀ¼žÉ®Ü®ÜÀÜÆÜÔÜÔÜñÜûÜÝÝ/Ý3ÝMÝMÝ`ÝiÝtÝ}݊ݓݨݲݿÝÈÝÊÝÐÝÙÝßÝÞÞ Þ/Þ@ÞDÞHÞSÞSÞWÞWÞWÞ€ÞÁ4:}:}H}J}O}R}U}Z}`}Â(ãéëkëkll/l5lPlÔ"ooªoÉoÕoèoîoÿop pp(p5p;p>pApDpIpKpOp[plp{pp„p‡pŠpŠp”p—p©pÄ„c€kk;k?kLkQkUkhk‰k“k“k©kµk¼kÏkÔkØkëk lll*l*l-l;lÅ]}nânâwâ…â…ââ³âÂâÛâ÷âã ã;ãAãOã]ãkãyã{ã‘ã§ã½ãÓãÓãÔãÙãÆL–¥rzrz€zŒz—z¨z¼zÀzÎzãzõzþz{{+{Çܛλ»ÃÇèõ  2G[gwŠ—ªÈÑÞêöö   3 I a z ~ € … Š “ ¥ ¬ ¬ ¾ Ä ë È,zöçöçúç1èHèHèRèÉ,fmë„ë„ù„ÿ„ ………!…ÊH´Âš{š{£{¯{Â{Í{å{ç{í{ø{ü{||ËdÃØ -| -||+|6|R|T|j|€|“|©|Ã|Ç|̬޵[C[CwCyC“C¢CÏCÙCÞC DDDD%D/D:D?DBDQDVDeD~D…D…D—D£D§D±DÍP,‹K‹K K´K¿KÑKÚKåKêKïKLLLLÎ ÿ¦ì¦ì°ìÃìÈìÏŒ'Flœlœ|œ€œ‰œ¤œ²œ·œºœÈœÍœìœôœ"BDLvzš¤«ÁÜøž0ž7ž?žÐ´Pyþþ#-2EPfp…Š”ž¨¦¶Ôîäþ"FLSgou|ƒŠ‘¢§§ ÑøµïK˜K˜i˜z˜˜•˜œ˜œ˜ª˜¹˜À˜Æ˜Ø˜Ø˜ë˜û˜™™$™0™G™I™a™c™f™h™h™l™l™x™™™ƒ™Ž™”™ ™¨™Í™ã™ô™ šššš3šÒÜú-û û     ) ? S ] i t ‚ ‘ ± Î æ ê   * . 9 E P _ n Ž œ « × ä è õ ..<<=QÓˆ1O††±¼Íáù#,11AMS_v™©©²·¸üÔ€5KŠKŠkŠwŠƒŠ‡Š‹ŠšŠ®Š¶Š¼ŠÐŠßŠëŠ÷ŠûŠþŠ‹‹ ‹$‹.‹2‹;‹A‹T‹Õ$).CCCC1C7CÖ,‚‰–ŖŬſÅÊÅÐÅÓÅÛÅרïppŠ¥°ÀÒÖä펎Ž!Ž,Ž:ŽDŽLŽPŽPŽPŽSŽUŽYŽYŽ^ŽlŽzŽˆŽŽŽŽ¥ŽØLêùæôæôõõ(õ3õ@õTõZõfõÙ ÎìÎìÒìßìáìÚ`#Û=Û=ß=ö=>>)>0>G>W>g>x>‰>š>»>Ü>ó>þ> ?C?ÛTƒJƒJ‡J£J²JÄJÉJßJæJøJ KK8KHKMKMKOKÜ`0qIqKqSqoqxq‹qšqŸq²qÉqÏqÛqëqëqýq=rÝH_mBB#B1B7BKBQBVB^BaBmBÞ$zGG!G6GDGOGßÀnš#…#…;…B…J…_…h…h…ƒ…‰…‰…“…š…¥…ª…´…È…Ê…Õ…Õ…ä…ì…÷…û…†††††† †'†1†A†à@/;JŠJŠhŠtŠŠŒŠ˜Š¥Š«Š®Š±ŠÊá0 '(agiioâk‹»»ÑÔààâïýŽŽŽŽŽ.Ž@ŽKŽWŽaŽdŽfŽiŽkŽnŽsŽxŽ|ŽŠŽã<€‹PGPG^GlGqGwG‡G‡GG¡G§Gä8%rÎrÎ|΄ΘέεθκξÎå”x™ÌÌÌÌ%Ì<Ì<ÌMÌVÌ`ÌdÌhÌoÌvÌÌ–Ì–Ì›ÌỊ̡̧̣̮̮̳̀ÌÃÌÕÌ×ÌçÌæ€‚žûüûüýýý$ý/ý8ýNýbýkýý¦ý¼ýÖýÞýúýþþ)þ4þ;þFþKþ`þçLN]­­#­#­2­A­R­V­f­}­­­†­è85?œœ*œFœRœVœZœ^œjœrœéœ$C?C?K?Q?b?q??¨?¨?´?Å?Ð?Ü?Ü?é?û?@'@.@?@I@N@N@N@n@Ž@¨@­@²@êx‚œ#%#%7%A%G%S%c%f%j%s%ƒ%†%%’%¤%Ê%Ò%Û%Û%á% &&&%&ë8[[+[.[3[6[D[J[M[O[W[ìD&þäþäåååå&å.å6å>åFåJåNåídavrr‚’¢¯¸¼ÂÈÐØäžžžžžîH~ŒÞãÞãùãäää)äGäMäYäwä}ä}ä‰äï(.4Ú›Ú›ã›ñ›œœœð0’Œ’Œ Œ¸ŒñŒ÷ŒùŒùŒÿŒñDŒ™‹Ž‹Ž·ŽÅŽÐŽÔŽØŽÜŽàŽìŽùŽüŽ ò€Ïëë ë ö þ  - - -( -> -R -[ -o -– -¬ -Æ -Î -ê -ö -  $ + 6 ; O ó< S3S3[3y3Š3š3«3º3Ô3ì3î3ð3ôLÁÐEE-E@EUE[EaEpE~E~EEŒEõˆú[‰[‰q‰•‰§‰§‰¹‰Ä‰Ú‰Ú‰ê‰ì‰ì‰ì‰ý‰ŠŠŠŠ Š'Š-Š3Š3Š6ŠDŠö|"¸"¸4¸C¸F¸g¸Џš¸øÓ¸à¸¹ ¹,¹<¹B¹R¹R¹d¹g¹l¹l¹|¹‚¹…¹é¹÷82—2—@—K—V—y——’——ø?ààéõ‘‘#‘4‘E‘Z‘a‘t‘‡‘™‘¡‘‘Ö‘Ù‘á‘ñ‘’)’<’N’ƒ’…’–’¢’§’¯’Ñ’ä’ð’“ùH'5@@Zm†›¡§§¯±Ýú8JT.Õ.Õ<ÕSÕ^Õ^ÕiÕqÕqÕwÕûDìùS S e q ‡ ¡ ¬ ¬ ½ Í Ï ú ül@W“““-“>“W“p“y“„““²“Ó͓ϓړå“î“÷“ -””.”8”8”:”ý$ôù;‰;‰D‰M‰S‰X‰þ  -ºMºMÃMÎMßMÿDÌÙFëFëUëZëcëtëuëˆë‹ë‘ëh-ƒƒ+ƒ+«+­+¶+Ê+Í+Ò+Ö+õ+ , ,,&,-,L,U,W,v,,,,„,º,Ä,Î,Ø,â,é,õ,- - - -,-,-5-7-7-@-B-B-K-M-M-R-T-T-Y-Y-Y-]-x-Ž-™-°-¹-¾-È-Ô-à-ì-ÿ-.(.,.7.M.]..œ.º.º.º.º.º.Ä.Í.Ô.T/LÈ×ó÷ó÷øøø)ø+ø<ø@øSøYø†ø4ÆäÆäÎäÖäÞäæäîäöäúäþä,žäžä¦ä®ä¶ä¾äÂäÆäx7  * / 9 @ S l l { ‘ š © ° ° ³ ½ Ó Ú Ü ß á á í | -Ðkö¨ö¨©©0©9©D©O©Q©d©r©}©ˆ©œ©§©ª©°©´©·©½©Á©Ä©Ç©Ú©ï©÷©ú©ª"ª%ª+ª.ªAªVª^ªaªyª‰ªŽªŽª–ª–ª¹ª¹ª¹ª½ª¿ª¿ªÃªÅªÅªÉªËªËªÏªÏªÏªÒªÔªÔª×ªÜªâªåªéªëªñªôª « «%«+«.«3«F«a«c«y«y«y«~«~«€«€«…«ˆ«®«®«®«Æ«Ì«ã«ò«¬¬(¬M¬R¬R¬j¬ˆ¬¬¬¥¬Ã¬Å¬Å¬Ý¬ù¬û¬û¬­/­/­M­Y­^­^­v­­’­’­ª­Æ­Ë­Ë­Ï­ç­® ® ® ®®'®E®I®I®g®l®l®„®›®¢®§®§®¿®Ö®Ý®ë®û® ¯&¯(¯(¯6¯>¯g¯i¯i¯¯¢¯Á¯Æ¯Æ¯Þ¯ó¯° °-°L°m°p°u°u°°¤°®°³°Ä°Ä°Ê°Õ°ê°ï°ù° ± ±?±M±S±j±r±{±{±‡±‹±‹±”±£±¬±¬±µ±¿±Û±ù±²%²+²@²H²T²^²^²v²x²ƒ²›²²½²½²Â²Â²ø²³³³³ ³ ³(³7³@³@³I³O³k³v³Ž³³›³³³µ³Ñ³Ñ³Ñ³á³´´´´3´8´8´P´g´q´v´Œ´Œ´£´£´¯´³´¹´Â´Ñ´Ú´Ú´ã´î´µµ$µ/µJµLµLµUµmµxµŽµ›µ£µÄµÆµÎµèµëµôµùµ¶$¶$¶?¶I¶T¶p¶ƒ¶š¶¢¶¬¶¬¶µ¶¹¶Ð¶····'·0·4·K·ƒ·ƒ·…·…·¡·«·³·³·¼·À·×·¸ ¸&¸=¸E¸R¸W¸W¸`¸d¸{¸³¸Ä¸Í¸Ò¸Ò¸Ý¸á¸ù¸¹¹ ¹5¹M¹M¹w¹¹¹ž¹¢¹µ¹½¹Ä¹Ï¹Ô¹Û¹Û¹à¹º'ºEº\ºfºpºpº€ºªºººÌºØºÜºöº»»»»»»»!»!»,»0»H»_»i»n»„»œ»œ»Æ»Ð»õ»ú»ú»ú»¼ ¼!¼8¼B¼G¼]¼]¼u¼u¼§¼±¼Î¼Õ¼à¼å¼ -½½0½B½J½L½e½s½½ ½ ½Í½Ï½ù½û½¾"¾,¾6¾=¾Z¾c¾c¾¾¨¾«¾Æ¾Æ¾Æ¾Ë¾Ð¾¿¿5¿L¿Q¿[¿e¿’¿¦¿©¿À¿À¿À¿À¿Ê¿à¿÷¿ÀÀÀÀ5À?ÀOÀOÀkÀÀ‚À”ÀžÀ¤À»ÀÃÀÌÀÑÀÑÀÑÀíÀÁÁÁ(Á-Á-ÁEÁ\ÁfÁvÁvÁ’Á¦Á©Á»ÁÅÁËÁâÁêÁóÁøÁøÁøÁÂ(Â+Â=ÂOÂTÂTÂTÂlƒÂÂÂÂÂÂÓÂÝÂãÂúÂà ÃÃÃÃ5ÃFÃXÃ]Ã]ÃrÃrÃrÎÎèïÃìÄ@!ê—ê—þ— ˜ ˜˜>˜I˜M˜[˜^˜f˜0EMòÏòÏûÏÐÐ Ð)Ð6Ð;Ð|œÚ®Ú®÷®ù®¯¯¯(¯P¯s¯¯‘¯´¯œ¯ί°°°°°)° 8Ž˜ZÒZÒiÒwÒˆÒŒÒŒÒ‘Ò‘Ò—Ò -¬°×ÓîÓîãîùîï ïï%ï,ï0ï8ïHïVïeïkïsïï…ï…ïŒïïï’ïùð 4GP‹‹.‹D‹O‹T‹b‹o‹x‹‰‹ p+CÃÃãôû ))7?MUU€«Öã D¦³2{2{>{U{`{f{l{r{ˆ{{”{š{„Sp33JTdšµÐãôù3OT_iv€Ž” §³î,-4ÓÓ×ñ)Z@ ‹ø‹øø¨øµø½øÅøÍøÕøÝøåøëø˜£ÅÓ_Ó_ë_ú_````)`4`7`<`F`T`[`\`h`n`t`w`€`````›`X7‰¦È¦ÈÄÈÊÈÑÈáÈèÈðÈöÈýÈÉ!É%É*É0É>ÉAÉFÉIÉIÉYÉjÉlÉ~É€ÉɒəɛɨɪɪɺÉËÉÎÉÐÉÜÉÞÉþÉÊ -ÊÊÊ Ê&Ê)Ê)Ê9ÊJÊLÊwʙʛʢʤʰʰÊÄÊÈÊÈÊÞÊ@Š–kWkWW£W©W®WÁWÎWÔW×WßW0‹ò‹ò”ò™ò¢ò¨ò¨ò­ò,;Bê¡ê¡ù¡¢¢¢!¢'¢8ˆ’®è®è¼èÈèóèéé ééééä6¾Æ¾ÆÜÆßÆâÆöÆþÆÇÇÇÇAÇAÇDÇTÇVÇVÇYÇ[Ç[Ç^ÇuNJǥǯǹÇÁÇÁÇÁÇÃÇÃÇÈÇçÇíÇüÇ È È0È2ÈDÈTÈYÈYÈeÈeÈrÈuÈuÈ È8òüzÕzÕ‰ÕŸÕ®ÕÌÕÐÕÖÕØÕØÕÞÕô…¾ÄŸÄŸÖŸÙŸãŸðŸôŸúŸúŸ       # ) 0 6 = C J P W ] d j w } „  • • ž Ÿ ° Ã Å Õ Ü ç ò ý ¡¡¡¡(¡LWfrr™r©r©rÇrÍrÝrãrérùrûrûrûr"shÝó{ˆ{ˆˆŸˆ¤ˆ´ˆ¼ˆ¼ˆÊˆÔˆãˆëˆ÷ˆ‰‰‰#‰.‰1‰9‰D<I¾Ô¾ÔÒÔîÔüÔ ÕÕÕÕ Õ Õ'ÕP„”ZvZvivrv|vv“v“v“v•v§v®vßvûvüvw0Ž–ÃgÃgÙgìgþghhh <alúxúxyy!y%y1y6y:y@y \ÉÜ..2EXkvŠ›½ßú0KfœX!TctâÐâÐðÐÑÑÑ*Ñ0Ñ2Ñ=ÑUÑaÑyÑÑÑÑÑ…Ñ"X£µ¹n¹nÙnænën÷noo*o7o>oGoKoWo#X†˜ÓäÓäîäöäååå&å&å+å<åEåPåPå\åiå$,’™NÆNÆbÆtÆyÆŠÆ·Æ%ä6s’s’’’“’™’­’´’·’Ò’Ü’á’è’í’í’þ’ð’ “#“/“C“L“T“e“e“e“n“u“ƒ“…““–“µ“œ͓ߓè“ù“””””””"”e”&  H¸g¸gØgçgógþg hh0h;hGhXh]hihnhrh{h”h h h»hÍhàhîhi i-i5i5iAiEiIiaioišiui©i´iËiÏiÖiÛiÛiðiöijjj&j,j2j4jDj' Hl³Ø³ØÇØרëØøØüØÙ ÙÙÙ'Ù/ÙyÙTÙ9ى٘٪ٱÙÀÙÒÙÙÙåÙùÙÚ#ÚûÚ(LÂÆÂÆÑÆÙÆÙÆæÆøÆÇ ÇÇÇÇ Ç Ç%Ç)<|‡*~*~8~Q~\~c~~k~›~ç~*˜Õ÷ÒxÒxüx y y,yHLP]np„‘ ³¹ÀÏÒÝ‘‘*‘2‘<‘J‘[‘n‘{‘Œ‘Ÿ‘¥‘ì‘þ‘ ’"’1’<’R’`’`’l’’œ’§’®’´’»’Ä’Ç’î’.4YbŠÐŠÐ“ЛЧиÐÀÐÈÐÛÐàÐ/ ´H7H7b7h7h7w7ƒ7Š777š7£7£7©7­7°7º7Å7Å7Ô7Ý7Ý7è7í7ð7ó7ö7ù78888880 ÚÞ–ë–ëšë§ë©ë1¤“ø~~~"~*~;~?~S~e~s~…~Š~~•~¬~µ~Í~Ý~Ý~ê~ø~&&*08BBFJYim’’¡£©±ÃØâñöö€€€€€(€V€Z€]€a€h€s€‰€ž€­€¼€Ç€É€Ï€Ü€â€é€ö€ü€ü€!)1:AJ¹2,%l‹4‹4“4—4ž4¥4°4¸4¿4¿4Î4Ó4ß4ë4û45$5)51585I5c5w5~555³5¸5Ê5Ï5ò5ö5ÿ566/666G6H6L6n66”6Ÿ6¬6¬6³6Õ6æ6ì6ö63,[‹[‹d‹‹…‹…‹Š‹44ÏØã;ã;ç;ì;ø;<<<"<$<5(êðSlSlmll‹l‘l™l6»ü -§ -§§ §%§+§S§v§~§†§‘§–§¬§¹§§ǧö§ý§¨¨¨ ¨&¨L¨L¨U¨l¨{¨œ¨¤¨·¨Ǩרç¨ö¨©©&©@©E©M©M©R©`©o©©›©ª©º©Ê©Ú©ô©ô©ô©ªª7”ÍîJÃJÃbÃoÃyÅÌÕèÃÂÃÈÃÐÃíÃóÃóÃÄ ÄÄ,Ä/Ä8Ä=Ä[Ä^Ä^Ä^ÄaÄnÄ~ÄÄ‘Ä88‰ãVãVçVøVW)W:WCWHWdW9p !IrIr]rjror{rrˆr¤rÚrãrìrør: ƒÂÒ¾Ò¾ñ¾¿¿¿!¿(¿(¿1¿C¿L¿m¿r¿‹¿’¿’¿¨¿´¿´¿Û¿Þ¿ý¿À;ÀGÀ^ÀuÀwÀˆÀŸÀ¶ÀÕÀôÀÁÁ.Á3ÁDÁ[ÁrÁrÁzÁˆÁ™Á°ÁÇÁØÁïÁ Â6Â?ÂÃ;8u– – ¤ ³ ½ Î Ö Ø Ø Þ <80:j¡j¡s¡›¡¾¡Ê¡סá¡æ¡=,—žãWãWìWõWXXX>0 (…(…6…@…T…Z…\…b…?,8?î î  +$LK,"DrvTextAttrGet",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,312",BI=1$ +$LK,"ARGT_R64",A="FL:::/Kernel/KernelA.HH,1897"$ +$LK,"MAlloc",A="FL:::/Kernel/Mem/MAllocFree.HC.Z,387"$ +$LK,"BOOT_SRC_NULL",A="FL:::/Kernel/KernelA.HH,3882"$ +$LK,"KbdTypeMatic",A="FL:::/Kernel/SerialDev/Keyboard.HC.Z,86",BI=2$ +$LK,"KbdLEDsSet",A="FL:::/Kernel/SerialDev/Keyboard.HC.Z,52",BI=3$ +$LK,"LXchgU32",A="FL:::/Kernel/KernelB.HH,255"$ +$LK,"LXchgU16",A="FL:::/Kernel/KernelB.HH,254"$ +$LK,"BDS_CUR_DRV",A="FL:::/Kernel/KernelA.HH,3268"$ +$LK,"DOCM_CANCEL",A="FL:::/Kernel/KernelA.HH,1341"$ +$LK,"chars_bmp_word",A="FL:::/Kernel/StrA.HC.Z,340"$ +$LK,"BLK_SIZE",A="FL:::/Kernel/KernelA.HH,2297"$ +$LK,"ARGT_SS",A="FL:::/Kernel/KernelA.HH,1928"$ +$LK,"c32_eax",A="FL:::/Kernel/PCIBIOS.HC.Z,152"$ +$LK,"ARGT_EAX",A="FL:::/Kernel/KernelA.HH,1921"$ +$LK,"DOCT_HEADER",A="FL:::/Kernel/KernelA.HH,912"$ +$LK,"Ff__EXTERN",A="FL:::/Kernel/KernelA.HH,852"$ +$LK,"c32_ebx",A="FL:::/Kernel/PCIBIOS.HC.Z,153"$ +$LK,"MemPageSize",A="FL:::/Kernel/Mem/PageTables.HC.Z,135",BI=4$ +$LK,"D3Add",A="FL:::/Kernel/KernelB.HH,145"$ +$LK,"D3NormSqr",A="FL:::/Kernel/KernelB.HH,158"$ +$LK,"ARf_PLANAR_SYMMETRY",A="FL:::/Kernel/KernelA.HH,3895"$ +$LK,"DOCf_PLAIN_TEXT_TABS",A="FL:::/Kernel/KernelA.HH,1295"$ +$LK,"RLF_BLKDEV",A="FL:::/Kernel/KernelA.HH,466"$ +$LK,"RLf_BLKDEV",A="FL:::/Kernel/KernelA.HH,447"$ +$LK,"c32_ecx",A="FL:::/Kernel/PCIBIOS.HC.Z,154"$ +$LK,"CCF_USE_LAST_U16",A="FL:::/Kernel/KernelA.HH,2157"$ +$LK,"SYSf_CTRL_ALT_DEL",A="FL:::/Kernel/KernelA.HH,617"$ +$LK,"SSF_INACTIVE",A="FL:::/Kernel/KernelA.HH,223"$ +$LK,"MSF_INACTIVE",A="FL:::/Kernel/KernelA.HH,206"$ +$LK,"ATA_READ_MULTI",A="FL:::/Kernel/KernelA.HH,2265"$ +$LK,"c32_edx",A="FL:::/Kernel/PCIBIOS.HC.Z,155"$ +$LK,"FUf_WHOLE_LABELS_AFTER",A="FL:::/Kernel/KernelA.HH,2593"$ +$LK,"CAOTBinBlk",A="FL:::/Kernel/KernelA.HH,1800"$ +$LK,"DOCEf_HAS_TERMINATOR",A="FL:::/Kernel/KernelA.HH,1099"$ +$LK,"KernelMain",A="FL:::/Kernel/KEnd.HC.Z,134",BI=5$ +$LK,"KbdCmdSend",A="FL:::/Kernel/SerialDev/Keyboard.HC.Z,24",BI=6$ +$LK,"_D3_NORM_SQR",A="FL:::/Kernel/KMathA.HC.Z,22"$ +$LK,"TTS_CUR_LEX",A="FL:::/Kernel/KernelA.HH,3276"$ +$LK,"RS_ATTR_COMPRESSED",A="FL:::/Kernel/KernelA.HH,2537"$ +$LK,"CCf_USE_LAST_U16",A="FL:::/Kernel/KernelA.HH,2158"$ +$LK,"CDocEntry",A="FL:::/Kernel/KernelA.HH,1181"$ +$LK,"CAOT",A="FL:::/Kernel/KernelA.HH,1998"$ +$LK,"sys_gig_pages",A="FL:::/Kernel/KernelB.HH,179"$ +$LK,"SVCf_DISPATCHED",A="FL:::/Kernel/KernelA.HH,3185"$ +$LK,"RLF_32BIT",A="FL:::/Kernel/KernelA.HH,459"$ +$LK,"RLF_16BIT",A="FL:::/Kernel/KernelA.HH,457"$ +$LK,"RLf_32BIT",A="FL:::/Kernel/KernelA.HH,440"$ +$LK,"RLf_16BIT",A="FL:::/Kernel/KernelA.HH,438"$ +$LK,"BreakUnlock",A="FL:::/Kernel/KExcept.HC.Z,146",BI=7$ +$LK,"DOCT_BACKGROUND",A="FL:::/Kernel/KernelA.HH,916"$ +$LK,"DOCT_FOREGROUND",A="FL:::/Kernel/KernelA.HH,915"$ +$LK,"CGDT",A="FL:::/Kernel/KernelA.HH,335"$ +$LK,"TSF_SAME_SONG",A="FL:::/Kernel/KernelA.HH,3246"$ +$LK,"ICF_PUSH_CMP",A="FL:::/Kernel/KernelA.HH,1609"$ +$LK,"MLF_NO_UNUSED_WARN",A="FL:::/Kernel/KernelA.HH,779"$ +$LK,"I_MP_CRASH",A="FL:::/Kernel/KernelA.HH,294"$ +$LK,"MEM_HEAP_HASH_SIZE",A="FL:::/Kernel/KernelA.HH,2878"$ +$LK,"INVALID_PTR",A="FL:::/Kernel/KernelA.HH,39"$ +$LK,"RECALCt_NORMAL",A="FL:::/Kernel/KernelA.HH,1345"$ +$LK,"ATAInit",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,303",BI=8$ +$LK,"HashDefineLstAdd",A="FL:::/Kernel/KHashB.HC.Z,206",BI=9$ +$LK,"StrUtil",A="FL:::/Kernel/StrA.HC.Z,524",BI=10$ +$LK,"LstMatch",A="FL:::/Kernel/StrA.HC.Z,421",BI=11$ +$LK,"IET_REL_I32",A="FL:::/Kernel/KernelA.HH,400"$ +$LK,"IET_REL_I16",A="FL:::/Kernel/KernelA.HH,398"$ +$LK,"CPrsStk",A="FL:::/Kernel/KernelA.HH,1679"$ +$LK,"CCmpCtrl",A="FL:::/Kernel/KernelA.HH,2168"$ +$LK,"ATAWBlks",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,579",BI=12$ +$LK,"CCPU",A="FL:::/Kernel/KernelA.HH,3438"$ +$LK,"ATABlkSel",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,1",BI=13$ +$LK,"c32_esi",A="FL:::/Kernel/PCIBIOS.HC.Z,156"$ +$LK,"CCF_JUST_LOAD",A="FL:::/Kernel/KernelA.HH,2134"$ +$LK,"LDF_JUST_LOAD",A="FL:::/Kernel/KernelA.HH,368"$ +$LK,"SYS_CACHE_LINE_WIDTH",A="FL:::/Kernel/KStart32.HC.Z,52"$ +$LK,"CMF_I16_JMP_TABLE",A="FL:::/Kernel/KernelA.HH,1700"$ +$LK,"FramePtrSet",A="FL:::/Kernel/KHashB.HC.Z,230",BI=14$ +$LK,"CCf_PASS_TRACE_PRESENT",A="FL:::/Kernel/KernelA.HH,2139"$ +$LK,"CMF_U16_JMP_TABLE",A="FL:::/Kernel/KernelA.HH,1701"$ +$LK,"_STRICMP",A="FL:::/Kernel/StrA.HC.Z,117"$ +$LK,"IET_REL_I64",A="FL:::/Kernel/KernelA.HH,402"$ +$LK,"CFAT32Boot",A="FL:::/Kernel/KernelA.HH,2336"$ +$LK,"DOCEF_NO_CLICK_ON",A="FL:::/Kernel/KernelA.HH,1022"$ +$LK,"FILEMASK_TXT",A="FL:::/Kernel/KernelA.HH,2292"$ +$LK,"TK_EOF",A="FL:::/Kernel/KernelA.HH,2069"$ +$LK,"SPF_NEG",A="FL:::/Kernel/KernelA.HH,3920"$ +$LK,"CWinScroll",A="FL:::/Kernel/KernelA.HH,3100"$ +$LK,"DOCEf_NO_CLICK_ON",A="FL:::/Kernel/KernelA.HH,1108"$ +$LK,"ARf_FLOODFILL",A="FL:::/Kernel/KernelA.HH,3893"$ +$LK,"ICF_USE_F64",A="FL:::/Kernel/KernelA.HH,1597"$ +$LK,"MemPagesNotPresentMark",A="FL:::/Kernel/Mem/MemPhysical.HC.Z,58",BI=15$ +$LK,"CH_BACKSPACE",A="FL:::/Kernel/KernelA.HH,3506"$ +$LK,"FloorI64",A="FL:::/Kernel/KMathB.HC.Z,52",BI=16$ +$LK,"SC_BACKSPACE",A="FL:::/Kernel/KernelA.HH,3552"$ +$LK,"FUf_WHOLE_LABELS_BEFORE",A="FL:::/Kernel/KernelA.HH,2592"$ +$LK,"GVF_ARRAY",A="FL:::/Kernel/KernelA.HH,871"$ +$LK,"DirEntryCompareCluster",A="FL:::/Kernel/BlkDev/DskDirA.HC.Z,84",BI=17$ +$LK,"KbdCmdFlush",A="FL:::/Kernel/SerialDev/Keyboard.HC.Z,45",BI=18$ +$LK,"CFPU",A="FL:::/Kernel/KernelA.HH,3172"$ +$LK,"TASKf_IDLE",A="FL:::/Kernel/KernelA.HH,3282"$ +$LK,"CDIR_SIZE",A="FL:::/Kernel/KernelA.HH,2564"$ +$LK,"ARGT_UIMM32",A="FL:::/Kernel/KernelA.HH,1891"$ +$LK,"ARGT_UIMM16",A="FL:::/Kernel/KernelA.HH,1890"$ +$LK,"PCIWriteU8",A="FL:::/Kernel/PCIBIOS.HC.Z,220",BI=19$ +$LK,"DefinePrint",A="FL:::/Kernel/KDefine.HC.Z,90",BI=20$ +$LK,"FifoI64Del",A="FL:::/Kernel/KDataTypes.HC.Z,252",BI=21$ +$LK,"CDocUndo",A="FL:::/Kernel/KernelA.HH,1333"$ +$LK,"ROPB_XOR",A="FL:::/Kernel/KernelA.HH,2934"$ +$LK,"FUF_JUST_FILES",A="FL:::/Kernel/KernelA.HH,2607"$ +$LK,"ATA_SET_MAX",A="FL:::/Kernel/KernelA.HH,2263"$ +$LK,"IEF_DFT",A="FL:::/Kernel/KernelA.HH,1731"$ +$LK,"RT_F32",A="FL:::/Kernel/KernelA.HH,1564"$ +$LK,"Let2BlkDev",A="FL:::/Kernel/BlkDev/DskBlkDev.HC.Z,175",BI=22$ +$LK,"FUf_JUST_FILES",A="FL:::/Kernel/KernelA.HH,2581"$ +$LK,"ARGT_M1632",A="FL:::/Kernel/KernelA.HH,1909"$ +$LK,"DOF_MIN_SIZE",A="FL:::/Kernel/KernelA.HH,1215"$ +$LK,"DOCEF_LEFT_X",A="FL:::/Kernel/KernelA.HH,987"$ +$LK,"RFLAGf_AUX_CARRY",A="FL:::/Kernel/KernelA.HH,309"$ +$LK,"DEF_PROCESSED",A="FL:::/Kernel/KernelA.HH,2548"$ +$LK,"WIf_FOCUS_TASK_IP_L_D",A="FL:::/Kernel/KernelA.HH,1451"$ +$LK,"DOCEf_LEFT_X",A="FL:::/Kernel/KernelA.HH,1075"$ +$LK,"Mem64DevFree",A="FL:::/Kernel/Mem/MemPhysical.HC.Z,150",BI=23$ +$LK,"Mem32DevFree",A="FL:::/Kernel/Mem/MemPhysical.HC.Z,114",BI=24$ +$LK,"SYS_GIG_PAGES",A="FL:::/Kernel/KStart32.HC.Z,22"$ +$LK,"ARGT_UIMM64",A="FL:::/Kernel/KernelA.HH,1892"$ +$LK,"DOCf_MIN_SIZE",A="FL:::/Kernel/KernelA.HH,1303"$ +$LK,"DOCF_MIN_SIZE",A="FL:::/Kernel/KernelA.HH,1267"$ +$LK,"ATARepEntry",A="FL:::/Kernel/BlkDev/DskATAId.HC.Z,91",BI=25$ +$LK,"BLUE",A="FL:::/Kernel/KernelA.HH,2959"$ +$LK,"sys_ctrl_alt_flags",A="FL:::/Kernel/KernelB.HH,203"$ +$LK,"D3Div",A="FL:::/Kernel/KernelB.HH,151"$ +$LK,"RT_F64",A="FL:::/Kernel/KernelA.HH,1566"$ +$LK,"EdLite",A="FL:::/Kernel/EdLite.HC.Z,58",BI=26$ +$LK,"MBR_PT_FAT12",A="FL:::/Kernel/KernelA.HH,2699"$ +$LK,"FramePtr",A="FL:::/Kernel/KHashB.HC.Z,215",BI=27$ +$LK,"ARGT_RM8",A="FL:::/Kernel/KernelA.HH,1899"$ +$LK,"ROPF_PROBABILITY_DITHER",A="FL:::/Kernel/KernelA.HH,2954"$ +$LK,"RTF_UNSIGNED",A="FL:::/Kernel/KernelA.HH,1569"$ +$LK,"DOCEF_HAS_BORDER",A="FL:::/Kernel/KernelA.HH,1002"$ +$LK,"TK_EQU_EQU",A="FL:::/Kernel/KernelA.HH,2084"$ +$LK,"RT_I32",A="FL:::/Kernel/KernelA.HH,1559"$ +$LK,"RT_I16",A="FL:::/Kernel/KernelA.HH,1557"$ +$LK,"DOCEf_HAS_BORDER",A="FL:::/Kernel/KernelA.HH,1090"$ +$LK,"SysTry",A="FL:::/Kernel/KExcept.HC.Z,63",BI=28$ +$LK,"POP_REGS",A="FL:::/Kernel/KernelA.HH,1771"$ +$LK,"IEF_OP_SIZE32",A="FL:::/Kernel/KernelA.HH,1728"$ +$LK,"IEF_OP_SIZE16",A="FL:::/Kernel/KernelA.HH,1727"$ +$LK,"HTT_INTERNAL_TYPE",A="FL:::/Kernel/KernelA.HH,687"$ +$LK,"BD_SIGNATURE_VAL",A="FL:::/Kernel/KernelA.HH,2661"$ +$LK,"DOCEf_ESC",A="FL:::/Kernel/KernelA.HH,1087"$ +$LK,"ScanCode2Char",A="FL:::/Kernel/SerialDev/Keyboard.HC.Z,136",BI=29$ +$LK,"NUM_DRVS",A="FL:::/Kernel/KernelA.HH,2715"$ +$LK,"FSt_ISO13346",A="FL:::/Kernel/KernelA.HH,2691"$ +$LK,"_D3_ADD",A="FL:::/Kernel/KMathA.HC.Z,131"$ +$LK,"SYSf_CTRL_ALT_TAB",A="FL:::/Kernel/KernelA.HH,620"$ +$LK,"RCache",A="FL:::/Kernel/BlkDev/DskCache.HC.Z,119",BI=30$ +$LK,"DOC_ATTR_DFT_TEXT",A="FL:::/Kernel/KernelA.HH,1134"$ +$LK,"D3Dot",A="FL:::/Kernel/KernelB.HH,153"$ +$LK,"CSrvCmd",A="FL:::/Kernel/KernelA.HH,3196"$ +$LK,"ARGT_RAX",A="FL:::/Kernel/KernelA.HH,1922"$ +$LK,"EDf_WAS_WRITE",A="FL:::/Kernel/KernelA.HH,1255"$ +$LK,"EDF_WAS_WRITE",A="FL:::/Kernel/KernelA.HH,1249"$ +$LK,"DOCF_NO_SCROLL_BARS",A="FL:::/Kernel/KernelA.HH,1270"$ +$LK,"KbdMsgsQue",A="FL:::/Kernel/SerialDev/Keyboard.HC.Z,467",BI=31$ +$LK,"ARGT_ST0",A="FL:::/Kernel/KernelA.HH,1935"$ +$LK,"RT_I64",A="FL:::/Kernel/KernelA.HH,1561"$ +$LK,"FifoI64Cnt",A="FL:::/Kernel/KDataTypes.HC.Z,312",BI=32$ +$LK,"NUM_PROGRESS_BARS",A="FL:::/Kernel/KernelA.HH,3902"$ +$LK,"SUF_SAFE_DOLLAR",A="FL:::/Kernel/KernelA.HH,3795"$ +$LK,"RWF_SHOW_DOLLAR",A="FL:::/Kernel/KernelA.HH,3592"$ +$LK,"_CFG_HEAP_DBG",A="FL:::/Kernel/KernelA.HH,2797"$ +$LK,"HTt_INTERNAL_TYPE",A="FL:::/Kernel/KernelA.HH,657"$ +$LK,"RedSeaFileWrite",A="FL:::/Kernel/BlkDev/FileSysRedSea.HC.Z,511",BI=33$ +$LK,"AutoStr",A="FL:::/Kernel/SrvCmd.HC.Z,465",BI=34$ +$LK,"CPatchTableAbsAddr",A="FL:::/Kernel/KernelA.HH,383"$ +$LK,"DVDImageRead",A="FL:::/Kernel/BlkDev/DskCDDVD.HC.Z,69",BI=35$ +$LK,"FSt_ISO13490",A="FL:::/Kernel/KernelA.HH,2690"$ +$LK,"IET_CODE_HEAP",A="FL:::/Kernel/KernelA.HH,411"$ +$LK,"ROPB_MONO",A="FL:::/Kernel/KernelA.HH,2936"$ +$LK,"CAsmNum2",A="FL:::/Kernel/KernelA.HH,1827"$ +$LK,"AutoFile",A="FL:::/Kernel/SrvCmd.HC.Z,475",BI=36$ +$LK,"AMAlloc",A="FL:::/Kernel/Mem/MAllocFree.HC.Z,390",BI=37$ +$LK,"ICF_R_TO_INT",A="FL:::/Kernel/KernelA.HH,1592"$ +$LK,"DOCEf_LEN",A="FL:::/Kernel/KernelA.HH,1054"$ +$LK,"B",A="FL:::/Kernel/KDbg.HC.Z,407",BI=38$ +$LK,"ICF_PUSH_RES",A="FL:::/Kernel/KernelA.HH,1604"$ +$LK,"chars_bmp_dec_numeric",A="FL:::/Kernel/StrA.HC.Z,350"$ +$LK,"D3Equ",A="FL:::/Kernel/KernelB.HH,154"$ +$LK,"FF_NEW_FILE",A="FL:::/Kernel/KernelA.HH,2781"$ +$LK,"CMT_STR_CONST",A="FL:::/Kernel/KernelA.HH,1690"$ +$LK,"WIf_FOCUS_TASK_IP_R_D",A="FL:::/Kernel/KernelA.HH,1453"$ +$LK,"D",A="FL:::/Kernel/KDbg.HC.Z,172",BI=39$ +$LK,"StrPrint",A="FL:::/Kernel/StrPrint.HC.Z,876",BI=40$ +$LK,"WINMGR_FPS",A="FL:::/Kernel/KernelA.HH,1467"$ +$LK,"E",A="FL:::/Kernel/FunSeg.HC.Z,310",BI=41$ +$LK,"ICF_A2_TO_INT",A="FL:::/Kernel/KernelA.HH,1596"$ +$LK,"CEdFileName",A="FL:::/Kernel/KernelA.HH,1240"$ +$LK,"DOCT_LEFT_MARGIN",A="FL:::/Kernel/KernelA.HH,910"$ +$LK,"_STRNCMP",A="FL:::/Kernel/StrA.HC.Z,154"$ +$LK,"MEM_NUM_USED_1GIG",A="FL:::/Kernel/KernelA.HH,3461"$ +$LK,"G",A="FL:::/Kernel/KDbg.HC.Z,444",BI=42$ +$LK,"ScaleIndent",A="FL:::/Kernel/StrB.HC.Z,35",BI=43$ +$LK,"IET_ABS_ADDR",A="FL:::/Kernel/KernelA.HH,410"$ +$LK,"PressAKey",A="FL:::/Kernel/StrB.HC.Z,103",BI=44$ +$LK,"DOF_WIN_MAX",A="FL:::/Kernel/KernelA.HH,1218"$ +$LK,"CCodeCtrl",A="FL:::/Kernel/KernelA.HH,2017"$ +$LK,"Char2ScanCode",A="FL:::/Kernel/SerialDev/Keyboard.HC.Z,100",BI=45$ +$LK,"Mem32DevInit",A="FL:::/Kernel/Mem/MemPhysical.HC.Z,30",BI=46$ +$LK,"_BIT_FIELD_OR_U32",A="FL:::/Kernel/KUtils.HC.Z,154"$ +$LK,"DOCf_NO_SCROLL_BARS",A="FL:::/Kernel/KernelA.HH,1306"$ +$LK,"SPutChar",A="FL:::/Kernel/StrPrint.HC.Z,1",BI=47$ +$LK,"TaskQueIns",A="FL:::/Kernel/Sched.HC.Z,287",BI=48$ +$LK,"CYAN",A="FL:::/Kernel/KernelA.HH,2961"$ +$LK,"TK_SUPERSCRIPT",A="FL:::/Kernel/KernelA.HH,2070"$ +$LK,"FileNameTempTxt",A="FL:::/Kernel/BlkDev/DskStrA.HC.Z,272",BI=49$ +$LK,"RS_ATTR_DELETED",A="FL:::/Kernel/KernelA.HH,2535"$ +$LK,"CMT_ASM_LABEL",A="FL:::/Kernel/KernelA.HH,1688"$ +$LK,"RLF_64BIT",A="FL:::/Kernel/KernelA.HH,461"$ +$LK,"RLf_64BIT",A="FL:::/Kernel/KernelA.HH,442"$ +$LK,"RedSeaFreeLstBuild",A="FL:::/Kernel/BlkDev/FileSysRedSea.HC.Z,24",BI=50$ +$LK,"TK_SHL",A="FL:::/Kernel/KernelA.HH,2082"$ +$LK,"DOCf_HAS_SONG",A="FL:::/Kernel/KernelA.HH,1309"$ +$LK,"DOCF_HAS_SONG",A="FL:::/Kernel/KernelA.HH,1273"$ +$LK,"CH_CTRLA",A="FL:::/Kernel/KernelA.HH,3479"$ +$LK,"CHashGlblVar",A="FL:::/Kernel/KernelA.HH,873"$ +$LK,"CH_CTRLB",A="FL:::/Kernel/KernelA.HH,3480"$ +$LK,"MEM_NUM_1GIG",A="FL:::/Kernel/KernelA.HH,3462"$ +$LK,"DOCEf_TAG",A="FL:::/Kernel/KernelA.HH,1053"$ +$LK,"S",A="FL:::/Kernel/KDbg.HC.Z,479",BI=51$ +$LK,"CH_CTRLC",A="FL:::/Kernel/KernelA.HH,3481"$ +$LK,"FifoI64Ins",A="FL:::/Kernel/KDataTypes.HC.Z,258",BI=52$ +$LK,"FloorU64",A="FL:::/Kernel/KMathB.HC.Z,36",BI=53$ +$LK,"CH_CTRLD",A="FL:::/Kernel/KernelA.HH,3482"$ +$LK,"DOCF_WORD_WRAP",A="FL:::/Kernel/KernelA.HH,1282"$ +$LK,"DOCT_WORD_WRAP",A="FL:::/Kernel/KernelA.HH,919"$ +$LK,"CH_CTRLE",A="FL:::/Kernel/KernelA.HH,3483"$ +$LK,"BLACK",A="FL:::/Kernel/KernelA.HH,2958"$ +$LK,"ARGT_STI",A="FL:::/Kernel/KernelA.HH,1936"$ +$LK,"NUM_REGS",A="FL:::/Kernel/KernelA.HH,1774"$ +$LK,"DOCf_WORD_WRAP",A="FL:::/Kernel/KernelA.HH,1319"$ +$LK,"DOCEf_BOTTOM_Y",A="FL:::/Kernel/KernelA.HH,1080"$ +$LK,"DOCEF_BOTTOM_Y",A="FL:::/Kernel/KernelA.HH,992"$ +$LK,"FileNameAbs",A="FL:::/Kernel/BlkDev/DskStrA.HC.Z,167",BI=54$ +$LK,"CH_CTRLF",A="FL:::/Kernel/KernelA.HH,3484"$ +$LK,"TK_SHR",A="FL:::/Kernel/KernelA.HH,2083"$ +$LK,"AutoMountIDE",A="FL:::/Kernel/BlkDev/DskATAId.HC.Z,254",BI=55$ +$LK,"CH_CTRLG",A="FL:::/Kernel/KernelA.HH,3485"$ +$LK,"DOCEF_REMALLOC_DATA",A="FL:::/Kernel/KernelA.HH,1012"$ +$LK,"_HASH_REM_DEL",A="FL:::/Kernel/KHashA.HC.Z,208"$ +$LK,"TaskQueRem",A="FL:::/Kernel/Sched.HC.Z,301",BI=56$ +$LK,"CH_CTRLH",A="FL:::/Kernel/KernelA.HH,3486"$ +$LK,"CPalindromeU32",A="FL:::/Kernel/KernelA.HH,2416"$ +$LK,"CPalindromeU16",A="FL:::/Kernel/KernelA.HH,2411"$ +$LK,"DOCT_CHECK_BOX",A="FL:::/Kernel/KernelA.HH,931"$ +$LK,"CH_CTRLI",A="FL:::/Kernel/KernelA.HH,3487"$ +$LK,"FifoI64New",A="FL:::/Kernel/KDataTypes.HC.Z,240",BI=57$ +$LK,"CH_CTRLJ",A="FL:::/Kernel/KernelA.HH,3488"$ +$LK,"ARGT_XMM128",A="FL:::/Kernel/KernelA.HH,1945"$ +$LK,"SC_CURSOR_UP",A="FL:::/Kernel/KernelA.HH,3561"$ +$LK,"CH_CTRLK",A="FL:::/Kernel/KernelA.HH,3489"$ +$LK,"TASKf_HAS_SONG",A="FL:::/Kernel/KernelA.HH,3285"$ +$LK,"DOCEf_SEL",A="FL:::/Kernel/KernelA.HH,1049"$ +$LK,"RandI32",A="FL:::/Kernel/KMathB.HC.Z,90",BI=58$ +$LK,"RandI16",A="FL:::/Kernel/KMathB.HC.Z,74",BI=59$ +$LK,"CH_CTRLL",A="FL:::/Kernel/KernelA.HH,3490"$ +$LK,"CH_CTRLM",A="FL:::/Kernel/KernelA.HH,3491"$ +$LK,"ICf_LOCK",A="FL:::/Kernel/KernelA.HH,1616"$ +$LK,"ICF_LOCK",A="FL:::/Kernel/KernelA.HH,1615"$ +$LK,"PutFileLink",A="FL:::/Kernel/BlkDev/DskDirA.HC.Z,163",BI=60$ +$LK,"BreakLock",A="FL:::/Kernel/KExcept.HC.Z,140",BI=61$ +$LK,"HPET",A="FL:::/Kernel/KMisc.HC.Z,80",BI=62$ +$LK,"CORE0_32BIT_INIT",A="FL:::/Kernel/KStart32.HC.Z,57"$ +$LK,"CORE0_16BIT_INIT",A="FL:::/Kernel/KStart16.HC.Z,56"$ +$LK,"CH_CTRLN",A="FL:::/Kernel/KernelA.HH,3492"$ +$LK,"BDf_FMT",A="FL:::/Kernel/KernelA.HH,2653"$ +$LK,"CCF_KEEP_DOT",A="FL:::/Kernel/KernelA.HH,2136"$ +$LK,"Let2BlkDevType",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,161",BI=63$ +$LK,"CH_CTRLO",A="FL:::/Kernel/KernelA.HH,3493"$ +$LK,"ARGT_XMM",A="FL:::/Kernel/KernelA.HH,1941"$ +$LK,"DOCEf_REMALLOC_DATA",A="FL:::/Kernel/KernelA.HH,1098"$ +$LK,"DOCEf_WIN_REL",A="FL:::/Kernel/KernelA.HH,1085"$ +$LK,"DOCEF_WIN_REL",A="FL:::/Kernel/KernelA.HH,997"$ +$LK,"FifoI64Rem",A="FL:::/Kernel/KDataTypes.HC.Z,275",BI=64$ +$LK,"_D3_DIV",A="FL:::/Kernel/KMathA.HC.Z,184"$ +$LK,"CH_CTRLP",A="FL:::/Kernel/KernelA.HH,3494"$ +$LK,"chars_bmp_non_eol",A="FL:::/Kernel/StrA.HC.Z,396"$ +$LK,"CH_CTRLQ",A="FL:::/Kernel/KernelA.HH,3495"$ +$LK,"CTSS",A="FL:::/Kernel/KernelA.HH,3402"$ +$LK,"HomeSet",A="FL:::/Kernel/BlkDev/DskDirB.HC.Z,1",BI=65$ +$LK,"FileNameChk",A="FL:::/Kernel/BlkDev/DskStrA.HC.Z,245",BI=66$ +$LK,"D3Mul",A="FL:::/Kernel/KernelB.HH,155"$ +$LK,"CH_CTRLR",A="FL:::/Kernel/KernelA.HH,3496"$ +$LK,"SK_NAME",A="FL:::/Kernel/BlkDev/DskDirA.HC.Z,89"$ +$LK,"CtrlAltC",A="FL:::/Kernel/KeyDev.HC.Z,133",BI=67$ +$LK,"CallerRep",A="FL:::/Kernel/KDbg.HC.Z,152",BI=68$ +$LK,"CH_CTRLS",A="FL:::/Kernel/KernelA.HH,3497"$ +$LK,"ROP_EQU",A="FL:::/Kernel/KernelA.HH,2942"$ +$LK,"DOCEf_LST",A="FL:::/Kernel/KernelA.HH,1103"$ +$LK,"CtrlAltD",A="FL:::/Kernel/KeyDev.HC.Z,138",BI=69$ +$LK,"RandI64",A="FL:::/Kernel/KMathB.HC.Z,106",BI=70$ +$LK,"CH_CTRLT",A="FL:::/Kernel/KernelA.HH,3498"$ +$LK,"MBS_UNUSED_SIGNATURE_VAL",A="FL:::/Kernel/KernelA.HH,2857"$ +$LK,"CCmpGlbls",A="FL:::/Kernel/KernelA.HH,2215"$ +$LK,"RT_U32",A="FL:::/Kernel/KernelA.HH,1560"$ +$LK,"RT_U16",A="FL:::/Kernel/KernelA.HH,1558"$ +$LK,"CExternUsage",A="FL:::/Kernel/KernelA.HH,817"$ +$LK,"FAT32FreeClusters",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,413",BI=71$ +$LK,"CH_CTRLU",A="FL:::/Kernel/KernelA.HH,3499"$ +$LK,"ARGT_MM32",A="FL:::/Kernel/KernelA.HH,1939"$ +$LK,"DOCSS_COMMENT",A="FL:::/Kernel/KernelA.HH,1131"$ +$LK,"CtrlAltF",A="FL:::/Kernel/KeyDev.HC.Z,148",BI=72$ +$LK,"ip_grid",A="FL:::/Kernel/KGlbls.HC.Z,23"$ +$LK,"CH_CTRLV",A="FL:::/Kernel/KernelA.HH,3500"$ +$LK,"CCodeMisc",A="FL:::/Kernel/KernelA.HH,1705"$ +$LK,"DOF_DONT_TEXT_ATTR",A="FL:::/Kernel/KernelA.HH,1219"$ +$LK,"DOCEf_WORD_WRAP",A="FL:::/Kernel/KernelA.HH,1046"$ +$LK,"DOCEF_WORD_WRAP",A="FL:::/Kernel/KernelA.HH,1040"$ +$LK,"DrvFATBlkSet",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,117",BI=73$ +$LK,"ISODrvInit",A="FL:::/Kernel/BlkDev/DskCDDVD.HC.Z,5",BI=74$ +$LK,"CH_CTRLW",A="FL:::/Kernel/KernelA.HH,3501"$ +$LK,"FFB_NEXT_BLK",A="FL:::/Kernel/KernelA.HH,2778"$ +$LK,"ISO1FromName",A="FL:::/Kernel/BlkDev/FileSysISO.HC.Z,28",BI=75$ +$LK,"MPIntAll",A="FL:::/Kernel/MultiProc.HC.Z,149",BI=76$ +$LK,"TaskContextRestore",A="FL:::/Kernel/Sched.HC.Z,283"$ +$LK,"SCf_ALT",A="FL:::/Kernel/KernelA.HH,3521"$ +$LK,"CH_CTRLX",A="FL:::/Kernel/KernelA.HH,3502"$ +$LK,"CH_CTRLY",A="FL:::/Kernel/KernelA.HH,3503"$ +$LK,"CDoc",A="FL:::/Kernel/KernelA.HH,1354"$ +$LK,"MemSetU8",A="FL:::/Kernel/KernelB.HH,178"$ +$LK,"_FCLEX",A="FL:::/Kernel/KMathA.HC.Z,646"$ +$LK,"_D3_DOT",A="FL:::/Kernel/KMathA.HC.Z,113"$ +$LK,"ARf_CSPRITE_INS_CLIPBOARD",A="FL:::/Kernel/KernelA.HH,3894"$ +$LK,"CH_CTRLZ",A="FL:::/Kernel/KernelA.HH,3504"$ +$LK,"MEM_NUM_2MEG",A="FL:::/Kernel/KernelA.HH,3460"$ +$LK,"CHashGeneric",A="FL:::/Kernel/KernelA.HH,733"$ +$LK,"SYS_FIND_PCIBIOS_SERVICE_DIR",A="FL:::/Kernel/PCIBIOS.HC.Z,8"$ +$LK,"CTRLF_CLICKED",A="FL:::/Kernel/KernelA.HH,3096"$ +$LK,"HTF_RESOLVE",A="FL:::/Kernel/KernelA.HH,707"$ +$LK,"BCnt",A="FL:::/Kernel/KMisc.HC.Z,39",BI=77$ +$LK,"Mem64DevAlloc",A="FL:::/Kernel/Mem/MemPhysical.HC.Z,131",BI=78$ +$LK,"Mem32DevAlloc",A="FL:::/Kernel/Mem/MemPhysical.HC.Z,81",BI=79$ +$LK,"RT_U64",A="FL:::/Kernel/KernelA.HH,1563"$ +$LK,"DOCT_TAB",A="FL:::/Kernel/KernelA.HH,903"$ +$LK,"HTT_FRAME_PTR",A="FL:::/Kernel/KernelA.HH,698"$ +$LK,"HTt_FRAME_PTR",A="FL:::/Kernel/KernelA.HH,668"$ +$LK,"ISO1FilesFind",A="FL:::/Kernel/BlkDev/FileSysISO.HC.Z,173",BI=80$ +$LK,"CtrlAltM",A="FL:::/Kernel/KeyDev.HC.Z,153",BI=81$ +$LK,"DefineLstLoad",A="FL:::/Kernel/KDefine.HC.Z,13",BI=82$ +$LK,"ARGT_MM64",A="FL:::/Kernel/KernelA.HH,1940"$ +$LK,"DOCEf_LEFT_CB",A="FL:::/Kernel/KernelA.HH,1071"$ +$LK,"DOCEF_LEFT_CB",A="FL:::/Kernel/KernelA.HH,983"$ +$LK,"RFLAGf_DIR",A="FL:::/Kernel/KernelA.HH,314"$ +$LK,"ClusterNumNext",A="FL:::/Kernel/BlkDev/DskCluster.HC.Z,1",BI=83$ +$LK,"KbdMouseEvtTime",A="FL:::/Kernel/SerialDev/Keyboard.HC.Z,486",BI=84$ +$LK,"CtrlAltN",A="FL:::/Kernel/KeyDev.HC.Z,158",BI=85$ +$LK,"ip_last",A="FL:::/Kernel/KGlbls.HC.Z,24"$ +$LK,"C:/Doc/MultiCore.DD.Z",A="FL:::/Kernel/KernelB.HH,227"$ +$LK,"CDirEntry",A="FL:::/Kernel/KernelA.HH,2552"$ +$LK,"TK_STR",A="FL:::/Kernel/KernelA.HH,2074"$ +$LK,"ACD_DEF_END",A="FL:::/Kernel/KernelA.HH,1505"$ +$LK,"PROGRESS_DESC_LEN",A="FL:::/Kernel/KernelA.HH,3903"$ +$LK,"CCF_ASM_EXPRESSIONS",A="FL:::/Kernel/KernelA.HH,2146"$ +$LK,"D3Sub",A="FL:::/Kernel/KernelB.HH,159"$ +$LK,"SC_CURSOR_RIGHT",A="FL:::/Kernel/KernelA.HH,3564"$ +$LK,"KeyDevAdd",A="FL:::/Kernel/KeyDev.HC.Z,70",BI=86$ +$LK,"CTRLF_BORDER",A="FL:::/Kernel/KernelA.HH,3093"$ +$LK,"_D3_EQU",A="FL:::/Kernel/KMathA.HC.Z,226"$ +$LK,"VGAP_ATTR_DATA_READ",A="FL:::/Kernel/KernelA.HH,3724"$ +$LK,"ATA_PACKET",A="FL:::/Kernel/KernelA.HH,2260"$ +$LK,"HTF_LOCAL",A="FL:::/Kernel/KernelA.HH,709"$ +$LK,"HTT_ASM_KEYWORD",A="FL:::/Kernel/KernelA.HH,692"$ +$LK,"HTf_LOCAL",A="FL:::/Kernel/KernelA.HH,679"$ +$LK,"CtrlAltT",A="FL:::/Kernel/KeyDev.HC.Z,163",BI=87$ +$LK,"IsSilent",A="FL:::/Kernel/KMisc.HC.Z,228",BI=88$ +$LK,"CBpt",A="FL:::/Kernel/KernelA.HH,3158"$ +$LK,"HTt_ASM_KEYWORD",A="FL:::/Kernel/KernelA.HH,662"$ +$LK,"PCIWriteU32",A="FL:::/Kernel/PCIBIOS.HC.Z,250",BI=89$ +$LK,"PCIWriteU16",A="FL:::/Kernel/PCIBIOS.HC.Z,235",BI=90$ +$LK,"CtrlAltV",A="FL:::/Kernel/KeyDev.HC.Z,168",BI=91$ +$LK,"CISO1DirEntry",A="FL:::/Kernel/KernelA.HH,2458"$ +$LK,"_LXCHG_U8",A="FL:::/Kernel/KUtils.HC.Z,244"$ +$LK,"CtrlAltX",A="FL:::/Kernel/KeyDev.HC.Z,173",BI=92$ +$LK,"ChgDsk",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,230",BI=93$ +$LK,"UserTaskCont",A="FL:::/Kernel/KTask.HC.Z,364",BI=94$ +$LK,"RFLAGf_NESTED_TASK",A="FL:::/Kernel/KernelA.HH,318"$ +$LK,"BEqu",A="FL:::/Kernel/KernelB.HH,28"$ +$LK,"ISO1T_PRI_VOL_DESC",A="FL:::/Kernel/KernelA.HH,2479"$ +$LK,"FAT32MkDir",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,933",BI=95$ +$LK,"DCS_SIGNATURE_VAL",A="FL:::/Kernel/KernelA.HH,3644"$ +$LK,"ICF_USE_INT",A="FL:::/Kernel/KernelA.HH,1599"$ +$LK,"DOCT_NEW_LINE",A="FL:::/Kernel/KernelA.HH,901"$ +$LK,"BIN_SIGNATURE_VAL",A="FL:::/Kernel/KernelA.HH,371"$ +$LK,"ARGT_IMM8",A="FL:::/Kernel/KernelA.HH,1884"$ +$LK,"SYS_HASH_SINGLE_TABLE_FIND1",A="FL:::/Kernel/KHashA.HC.Z,30"$ +$LK,"DOC_SIGNATURE_VAL",A="FL:::/Kernel/KernelA.HH,1343"$ +$LK,"DOCEF_INVERT",A="FL:::/Kernel/KernelA.HH,1042"$ +$LK,"CDateStruct",A="FL:::/Kernel/KernelA.HH,192"$ +$LK,"CHashFun",A="FL:::/Kernel/KernelA.HH,856"$ +$LK,"SV_I_REG",A="FL:::/Kernel/KernelA.HH,1741"$ +$LK,"DOCEf_INVERT",A="FL:::/Kernel/KernelA.HH,1048"$ +$LK,"DayOfWeek",A="FL:::/Kernel/KDate.HC.Z,30",BI=96$ +$LK,"CDrv",A="FL:::/Kernel/KernelA.HH,2718"$ +$LK,"TK_MINUS_MINUS",A="FL:::/Kernel/KernelA.HH,2079"$ +$LK,"DOCT_LST",A="FL:::/Kernel/KernelA.HH,932"$ +$LK,"JobResGet",A="FL:::/Kernel/SrvCmd.HC.Z,198",BI=97$ +$LK,"sys_heap_init_flag",A="FL:::/Kernel/KernelB.HH,181"$ +$LK,"FUF_CANCEL",A="FL:::/Kernel/KernelA.HH,2599"$ +$LK,"FUf_CANCEL",A="FL:::/Kernel/KernelA.HH,2573"$ +$LK,"FALSE",A="FL:::/Kernel/KernelA.HH,20"$ +$LK,"VGAP_REG_READ",A="FL:::/Kernel/KernelA.HH,3729"$ +$LK,"SVCf_ADD_TO_QUE",A="FL:::/Kernel/KernelA.HH,3187"$ +$LK,"CUAsmGlbls",A="FL:::/Kernel/KernelA.HH,2230"$ +$LK,"TK_ADD_EQU",A="FL:::/Kernel/KernelA.HH,2098"$ +$LK,"TK_XOR_EQU",A="FL:::/Kernel/KernelA.HH,2097"$ +$LK,"StrPrintHex",A="FL:::/Kernel/StrA.HC.Z,1",BI=98$ +$LK,"_D3_ADD_EQU",A="FL:::/Kernel/KMathA.HC.Z,239"$ +$LK,"DRV_SIGNATURE_VAL",A="FL:::/Kernel/KernelA.HH,2717"$ +$LK,"DOCT_PMT",A="FL:::/Kernel/KernelA.HH,907"$ +$LK,"Cf_EXTERN",A="FL:::/Kernel/KernelA.HH,830"$ +$LK,"HPET_GCAP_ID",A="FL:::/Kernel/KernelA.HH,533"$ +$LK,"ATan",A="FL:::/Kernel/KernelB.HH,95"$ +$LK,"MEM_NUM_512GIG",A="FL:::/Kernel/KernelA.HH,3463"$ +$LK,"SysBadFree",A="FL:::/Kernel/Mem/Mem512.HC.Z,1",BI=99$ +$LK,"ATA_ID_DEV",A="FL:::/Kernel/KernelA.HH,2269"$ +$LK,"CHashReg",A="FL:::/Kernel/KernelA.HH,748"$ +$LK,"SCf_INS",A="FL:::/Kernel/KernelA.HH,3529"$ +$LK,"LAPIC_LVT_ERR",A="FL:::/Kernel/KernelA.HH,503"$ +$LK,"Scale2Mem",A="FL:::/Kernel/Mem/MemPhysical.HC.Z,192",BI=100$ +$LK,"Mem512TaskFree",A="FL:::/Kernel/Mem/Mem512.HC.Z,154",BI=101$ +$LK,"RandU32",A="FL:::/Kernel/KMathB.HC.Z,98",BI=102$ +$LK,"RandU16",A="FL:::/Kernel/KMathB.HC.Z,82",BI=103$ +$LK,"_FLDCW",A="FL:::/Kernel/KMathA.HC.Z,625"$ +$LK,"__DIR__",A="FL:::/Kernel/KernelA.HH,2033"$ +$LK,"ARGT_RM32",A="FL:::/Kernel/KernelA.HH,1901"$ +$LK,"ARGT_RM16",A="FL:::/Kernel/KernelA.HH,1900"$ +$LK,"RFLAGf_INT",A="FL:::/Kernel/KernelA.HH,313"$ +$LK,"WIf_SELF_DOC",A="FL:::/Kernel/KernelA.HH,1445"$ +$LK,"WIF_SELF_DOC",A="FL:::/Kernel/KernelA.HH,1419"$ +$LK,"MLF_STATIC",A="FL:::/Kernel/KernelA.HH,780"$ +$LK,"ChgExt",A="FL:::/Kernel/BlkDev/DskStrA.HC.Z,199",BI=104$ +$LK,"str2color_lst",A="FL:::/Kernel/KDefine.HC.Z,156"$ +$LK,"local_time_offset",A="FL:::/Kernel/KGlbls.HC.Z,14"$ +$LK,"RedSeaFilesFind",A="FL:::/Kernel/BlkDev/FileSysRedSea.HC.Z,539",BI=105$ +$LK,"TK_INS_BIN",A="FL:::/Kernel/KernelA.HH,2110"$ +$LK,"_D3_MUL",A="FL:::/Kernel/KMathA.HC.Z,167"$ +$LK,"ISO1_BASE_YEAR",A="FL:::/Kernel/KernelA.HH,2521"$ +$LK,"TK_ELSE",A="FL:::/Kernel/KernelA.HH,2106"$ +$LK,"RandU64",A="FL:::/Kernel/KMathB.HC.Z,114",BI=106$ +$LK,"PostMsgWait",A="FL:::/Kernel/SrvCmd.HC.Z,251",BI=107$ +$LK,"UndefinedDefine",A="FL:::/Kernel/KDefine.HC.Z,43",BI=108$ +$LK,"ARGT_RM64",A="FL:::/Kernel/KernelA.HH,1902"$ +$LK,"ATAGetRes",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,67",BI=109$ +$LK,"ATAWaitDRQ",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,36",BI=110$ +$LK,"TaskInit",A="FL:::/Kernel/KTask.HC.Z,162",BI=111$ +$LK,"DOCEf_RIGHT_CB",A="FL:::/Kernel/KernelA.HH,1073"$ +$LK,"DOCEF_RIGHT_CB",A="FL:::/Kernel/KernelA.HH,985"$ +$LK,"HTT_DICT_WORD",A="FL:::/Kernel/KernelA.HH,690"$ +$LK,"HTt_DICT_WORD",A="FL:::/Kernel/KernelA.HH,660"$ +$LK,"RLf_MP",A="FL:::/Kernel/KernelA.HH,448"$ +$LK,"CSpring",A="FL:::/Kernel/KernelA.HH,226"$ +$LK,"CBGR24",A="FL:::/Kernel/KernelA.HH,2990"$ +$LK,"FONT_WIDTH",A="FL:::/Kernel/KernelA.HH,3605"$ +$LK,"CHeapCtrl",A="FL:::/Kernel/KernelA.HH,2907"$ +$LK,"LastDayOfYear",A="FL:::/Kernel/KDate.HC.Z,110",BI=112$ +$LK,"SYS_IDLE_PT",A="FL:::/Kernel/Sched.HC.Z,204"$ +$LK,"mp_cnt_initial",A="FL:::/Kernel/KernelB.HH,229"$ +$LK,"STD_DISTRO_DVD_CFG",A="FL:::/Kernel/KernelA.HH,3889"$ +$LK,"CAbsCntsI64",A="FL:::/Kernel/KernelA.HH,1806"$ +$LK,"Core0StartMP",A="FL:::/Kernel/MultiProc.HC.Z,284",BI=113$ +$LK,"_D3_SUB",A="FL:::/Kernel/KMathA.HC.Z,149"$ +$LK,"CBGR48",A="FL:::/Kernel/KernelA.HH,2994"$ +$LK,"DOCEF_BORDER_PLOT",A="FL:::/Kernel/KernelA.HH,1004"$ +$LK,"IntCore0TimerHandler",A="FL:::/Kernel/KMisc.HC.Z,47",BI=114$ +$LK,"__DATE__",A="FL:::/Kernel/KernelA.HH,2025"$ +$LK,"chars_bmp_safe_dollar",A="FL:::/Kernel/StrA.HC.Z,391"$ +$LK,"AdamErr",A="FL:::/Kernel/SrvCmd.HC.Z,434",BI=115$ +$LK,"sys_focus_task",A="FL:::/Kernel/KernelB.HH,197"$ +$LK,"DOCEf_BORDER_PLOT",A="FL:::/Kernel/KernelA.HH,1092"$ +$LK,"HTT_MODULE",A="FL:::/Kernel/KernelA.HH,696"$ +$LK,"HTt_MODULE",A="FL:::/Kernel/KernelA.HH,666"$ +$LK,"SVCf_HIGHEST_PRIORITY",A="FL:::/Kernel/KernelA.HH,3182"$ +$LK,"ARGT_REL8",A="FL:::/Kernel/KernelA.HH,1880"$ +$LK,"GridInit",A="FL:::/Kernel/SerialDev/InputPointer.HC.Z,1",BI=116$ +$LK,"FirstDayOfYear",A="FL:::/Kernel/KDate.HC.Z,98",BI=117$ +$LK,"CCf_PMT",A="FL:::/Kernel/KernelA.HH,2129"$ +$LK,"ACD_EXTRA",A="FL:::/Kernel/KernelA.HH,1510"$ +$LK,"WIf_SELF_ODE",A="FL:::/Kernel/KernelA.HH,1446"$ +$LK,"WIF_SELF_ODE",A="FL:::/Kernel/KernelA.HH,1420"$ +$LK,"MLF_DFT_AVAILABLE",A="FL:::/Kernel/KernelA.HH,774"$ +$LK,"COREAP_16BIT_INIT",A="FL:::/Kernel/MultiProc.HC.Z,9"$ +$LK,"SCf_NUM",A="FL:::/Kernel/KernelA.HH,3523"$ +$LK,"RS_ATTR_RESIDENT",A="FL:::/Kernel/KernelA.HH,2536"$ +$LK,"Dbg2",A="FL:::/Kernel/KDbg.HC.Z,533",BI=118$ +$LK,"HashSrcFileSet",A="FL:::/Kernel/KHashB.HC.Z,154",BI=119$ +$LK,"ROP_XOR",A="FL:::/Kernel/KernelA.HH,2943"$ +$LK,"NULL",A="FL:::/Kernel/KernelA.HH,18"$ +$LK,"BlkPoolInit",A="FL:::/Kernel/Mem/BlkPool.HC.Z,18",BI=120$ +$LK,"BDF_EXT_SIZE",A="FL:::/Kernel/KernelA.HH,2645"$ +$LK,"ProgressBarsRst",A="FL:::/Kernel/KMisc.HC.Z,275",BI=121$ +$LK,"sys_boot_blk",A="FL:::/Kernel/KernelB.HH,38"$ +$LK,"TASKf_PENDING_BREAK",A="FL:::/Kernel/KernelA.HH,3289"$ +$LK,"BDf_EXT_SIZE",A="FL:::/Kernel/KernelA.HH,2655"$ +$LK,"RedSeaAllocClusters",A="FL:::/Kernel/BlkDev/FileSysRedSea.HC.Z,302",BI=122$ +$LK,"CQue",A="FL:::/Kernel/KernelA.HH,121"$ +$LK,"MEM_ADAM_STK",A="FL:::/Kernel/KernelA.HH,2884"$ +$LK,"DOCEF_UPDATE_DATA",A="FL:::/Kernel/KernelA.HH,1008"$ +$LK,"AdamLog",A="FL:::/Kernel/SrvCmd.HC.Z,424",BI=123$ +$LK,"TASKf_KILL_TASK",A="FL:::/Kernel/KernelA.HH,3280"$ +$LK,"ACD_H1",A="FL:::/Kernel/KernelA.HH,1502"$ +$LK,"Ff_RET1",A="FL:::/Kernel/KernelA.HH,854"$ +$LK,"SVCT_SPAWN_TASK",A="FL:::/Kernel/KernelA.HH,3194"$ +$LK,"RS_ATTR_ARCHIVE",A="FL:::/Kernel/KernelA.HH,2531"$ +$LK,"DOCEf_UPDATE_DATA",A="FL:::/Kernel/KernelA.HH,1096"$ +$LK,"EXT_DBG_RESUME",A="FL:::/Kernel/KernelA.HH,579"$ +$LK,"FSt_FAT32",A="FL:::/Kernel/KernelA.HH,2688"$ +$LK,"OPTf_WARN_PAREN",A="FL:::/Kernel/KernelA.HH,1538"$ +$LK,"TaskStkNew",A="FL:::/Kernel/KTask.HC.Z,80",BI=124$ +$LK,"RT_PTR",A="FL:::/Kernel/KernelA.HH,1562"$ +$LK,"HashTableDel",A="FL:::/Kernel/KHashB.HC.Z,90",BI=125$ +$LK,"LBtc",A="FL:::/Kernel/KernelB.HH,22"$ +$LK,"FUF_Z_OR_NOT_Z",A="FL:::/Kernel/KernelA.HH,2613"$ +$LK,"ClampI64",A="FL:::/Kernel/KernelB.HH,125"$ +$LK,"FUf_Z_OR_NOT_Z",A="FL:::/Kernel/KernelA.HH,2587"$ +$LK,"B2",A="FL:::/Kernel/KDbg.HC.Z,422",BI=126$ +$LK,"SLOP",A="FL:::/Kernel/StrPrint.HC.Z,206"$ +$LK,"FF_BUF_DIRTY",A="FL:::/Kernel/KernelA.HH,2782"$ +$LK,"ICF_SWAP",A="FL:::/Kernel/KernelA.HH,1611"$ +$LK,"_STRMATCH",A="FL:::/Kernel/StrA.HC.Z,223"$ +$LK,"MSF_FIXED",A="FL:::/Kernel/KernelA.HH,207"$ +$LK,"_CPUID",A="FL:::/Kernel/KUtils.HC.Z,319"$ +$LK,"SYS_HEAP_BASE",A="FL:::/Kernel/KStart32.HC.Z,6"$ +$LK,"_LBEQU",A="FL:::/Kernel/KUtils.HC.Z,104"$ +$LK,"Caller",A="FL:::/Kernel/KDbg.HC.Z,60",BI=127$ +$LK,"SUF_S2T",A="FL:::/Kernel/KernelA.HH,3792"$ +$LK,"ATA_DEV_RST",A="FL:::/Kernel/KernelA.HH,2259"$ +$LK,"INT_MP_CRASH_ADDR",A="FL:::/Kernel/KInts.HC.Z,2"$ +$LK,"RWF_LAST_DOLLAR",A="FL:::/Kernel/KernelA.HH,3591"$ +$LK,"RS_ATTR_CONTIGUOUS",A="FL:::/Kernel/KernelA.HH,2538"$ +$LK,"HPET_MAIN_CNT",A="FL:::/Kernel/KernelA.HH,535"$ +$LK,"ARGT_NONE",A="FL:::/Kernel/KernelA.HH,1879"$ +$LK,"DOCT_DATA",A="FL:::/Kernel/KernelA.HH,930"$ +$LK,"SUF_T2S",A="FL:::/Kernel/KernelA.HH,3793"$ +$LK,"MEM_MIN_MEG",A="FL:::/Kernel/KernelA.HH,3458"$ +$LK,"exp_1",A="FL:::/Kernel/KernelA.HH,51"$ +$LK,"CTRL_KEY_SCAN_DECODE_TABLE",A="FL:::/Kernel/SerialDev/Keyboard.HC.Z,15"$ +$LK,"KeyDevRem",A="FL:::/Kernel/KeyDev.HC.Z,64",BI=128$ +$LK,"G2",A="FL:::/Kernel/KDbg.HC.Z,469",BI=129$ +$LK,"DOCEG_HAS_ARG",A="FL:::/Kernel/KernelA.HH,1031"$ +$LK,"TSSNew",A="FL:::/Kernel/MultiProc.HC.Z,76",BI=130$ +$LK,"SYS_PROGRESS1_DESC",A="FL:::/Kernel/KStart32.HC.Z,33"$ +$LK,"LBtr",A="FL:::/Kernel/KernelB.HH,24"$ +$LK,"FStf_DISABLE",A="FL:::/Kernel/KernelA.HH,2697"$ +$LK,"HTT_OPCODE",A="FL:::/Kernel/KernelA.HH,693"$ +$LK,"HTt_OPCODE",A="FL:::/Kernel/KernelA.HH,663"$ +$LK,"CDATE_YEAR_DAYS_INT",A="FL:::/Kernel/KernelA.HH,183"$ +$LK,"FAT32AllocContiguousClusters",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,514",BI=131$ +$LK,"LBts",A="FL:::/Kernel/KernelB.HH,26"$ +$LK,"ArcEntryGet",A="FL:::/Kernel/Compress.HC.Z,100"$ +$LK,"_LOG10",A="FL:::/Kernel/KMathA.HC.Z,592"$ +$LK,"Adam",A="FL:::/Kernel/SrvCmd.HC.Z,407",BI=132$ +$LK,"CTryStk",A="FL:::/Kernel/KExcept.HC.Z,55"$ +$LK,"DCF_PALETTE",A="FL:::/Kernel/KernelA.HH,3620"$ +$LK,"set_bits_table",A="FL:::/Kernel/KGlbls.HC.Z,13"$ +$LK,"rev_bits_table",A="FL:::/Kernel/KGlbls.HC.Z,12"$ +$LK,"KBD_CTRL",A="FL:::/Kernel/KernelA.HH,3001"$ +$LK,"HTt_FUN",A="FL:::/Kernel/KernelA.HH,658"$ +$LK,"RS_ATTR_LONG_NAME",A="FL:::/Kernel/KernelA.HH,2532"$ +$LK,"TK_XOR_XOR",A="FL:::/Kernel/KernelA.HH,2090"$ +$LK,"DOCEf_HOLD",A="FL:::/Kernel/KernelA.HH,1101"$ +$LK,"DOCEF_HOLD",A="FL:::/Kernel/KernelA.HH,1015"$ +$LK,"KDInputFilterPutKey",A="FL:::/Kernel/KeyDev.HC.Z,108",BI=133$ +$LK,"GetOutOfDollar",A="FL:::/Kernel/StrB.HC.Z,75",BI=134$ +$LK,"DOC_COLOR_ALT_TEXT",A="FL:::/Kernel/KernelA.HH,1135"$ +$LK,"MBR_PT_FAT32a",A="FL:::/Kernel/KernelA.HH,2700"$ +$LK,"DbgHelp",A="FL:::/Kernel/KDbg.HC.Z,498",BI=135$ +$LK,"_FLOOR",A="FL:::/Kernel/KMathA.HC.Z,420"$ +$LK,"MBR_PT_FAT32b",A="FL:::/Kernel/KernelA.HH,2701"$ +$LK,"MBR_PT_FAT32c",A="FL:::/Kernel/KernelA.HH,2702"$ +$LK,"D3Dist",A="FL:::/Kernel/KernelB.HH,149"$ +$LK,"MBR_PT_FAT32d",A="FL:::/Kernel/KernelA.HH,2703"$ +$LK,"TK_INS_BIN_SIZE",A="FL:::/Kernel/KernelA.HH,2111"$ +$LK,"LMF_EXACT",A="FL:::/Kernel/KernelA.HH,3805"$ +$LK,"MBR_PT_FAT32e",A="FL:::/Kernel/KernelA.HH,2704"$ +$LK,"FSt_NTFS",A="FL:::/Kernel/KernelA.HH,2692"$ +$LK,"MBR_PT_FAT32f",A="FL:::/Kernel/KernelA.HH,2705"$ +$LK,"CM_MAX_CONSTS",A="FL:::/Kernel/KernelA.HH,1703"$ +$LK,"DOCEF_TAG_CB",A="FL:::/Kernel/KernelA.HH,994"$ +$LK,"Str2Date",A="FL:::/Kernel/StrScan.HC.Z,138",BI=136$ +$LK,"ICF_PASS_TRACE",A="FL:::/Kernel/KernelA.HH,1605"$ +$LK,"DOCEf_TAG_CB",A="FL:::/Kernel/KernelA.HH,1082"$ +$LK,"HTt_REG",A="FL:::/Kernel/KernelA.HH,664"$ +$LK,"ChkPtr",A="FL:::/Kernel/KDbg.HC.Z,1",BI=137$ +$LK,"TaskWait",A="FL:::/Kernel/SrvCmd.HC.Z,220",BI=138$ +$LK,"_R10",A="FL:::/Kernel/KernelA.HH,3427"$ +$LK,"SYS_MEM_INIT_VAL",A="FL::/Temp.DD.Z,1"$ +$LK,"_R11",A="FL:::/Kernel/KernelA.HH,3428"$ +$LK,"BOOT_RAM_LIMIT",A="FL:::/Kernel/KernelA.HH,3879"$ +$LK,"_R12",A="FL:::/Kernel/KernelA.HH,3429"$ +$LK,"SK_CLUSTER",A="FL:::/Kernel/BlkDev/DskDirA.HC.Z,90"$ +$LK,"SysGetI64",A="FL:::/Kernel/BlkDev/DskAddDev.HC.Z,169",BI=139$ +$LK,"MemSetI64",A="FL:::/Kernel/KernelB.HH,172"$ +$LK,"_R13",A="FL:::/Kernel/KernelA.HH,3430"$ +$LK,"DEF_NOT_INITIALIZED",A="FL:::/Kernel/KernelA.HH,2549"$ +$LK,"SYS_BOOT_PATCH_TABLE_BASE",A="FL:::/Kernel/KStart16.HC.Z,25"$ +$LK,"_R14",A="FL:::/Kernel/KernelA.HH,3431"$ +$LK,"CTRLT_WIN_VSCROLL",A="FL:::/Kernel/KernelA.HH,3089"$ +$LK,"TK_LESS_EQU",A="FL:::/Kernel/KernelA.HH,2086"$ +$LK,"ODEF_HAS_MASSES",A="FL:::/Kernel/KernelA.HH,240"$ +$LK,"_R15",A="FL:::/Kernel/KernelA.HH,3432"$ +$LK,"FUG_FILES_FIND",A="FL:::/Kernel/KernelA.HH,2621"$ +$LK,"TRUE",A="FL:::/Kernel/KernelA.HH,19"$ +$LK,"FSt_NULL",A="FL:::/Kernel/KernelA.HH,2686"$ +$LK,"chars_bmp_zero_tab_ff_cr_nl_cursor",A="FL:::/Kernel/StrA.HC.Z,365"$ +$LK,"CEdFindText",A="FL:::/Kernel/KernelA.HH,1224"$ +$LK,"MEM_FREE_PAGE_HASH_SIZE",A="FL:::/Kernel/KernelA.HH,2879"$ +$LK,"LDF_NO_ABSS",A="FL:::/Kernel/KernelA.HH,367"$ +$LK,"DOCEf_LINK",A="FL:::/Kernel/KernelA.HH,1086"$ +$LK,"DOCEF_LINK",A="FL:::/Kernel/KernelA.HH,998"$ +$LK,"D3Copy",A="FL:::/Kernel/KernelB.HH,147"$ +$LK,"Beep",A="FL:::/Kernel/KMisc.HC.Z,190",BI=140$ +$LK,"_STRNICMP",A="FL:::/Kernel/StrA.HC.Z,183"$ +$LK,"_MEMSET_I64",A="FL:::/Kernel/KUtils.HC.Z,42"$ +$LK,"CH_SPACE",A="FL:::/Kernel/KernelA.HH,3511"$ +$LK,"AAT_SUB_U8",A="FL:::/Kernel/KernelA.HH,1970"$ +$LK,"IET_IMM64_EXPORT",A="FL:::/Kernel/KernelA.HH,409"$ +$LK,"IET_IMM32_EXPORT",A="FL:::/Kernel/KernelA.HH,407"$ +$LK,"sys_gdt",A="FL:::/Kernel/KernelB.HH,266"$ +$LK,"Call",A="FL:::/Kernel/KernelB.HH,44"$ +$LK,"SYS_FIXED_AREA",A="FL:::/Kernel/KernelA.HH,3465"$ +$LK,"ICF_CODE_FINAL",A="FL:::/Kernel/KernelA.HH,1601"$ +$LK,"SYS_PROGRESS2_DESC",A="FL:::/Kernel/KStart32.HC.Z,36"$ +$LK,"BlkDevLockFwdingSet",A="FL:::/Kernel/BlkDev/DskAddDev.HC.Z,1",BI=141$ +$LK,"InU8",A="FL:::/Kernel/KernelB.HH,77"$ +$LK,"ARGT_SREG",A="FL:::/Kernel/KernelA.HH,1926"$ +$LK,"CMemUnused",A="FL:::/Kernel/KernelA.HH,2816"$ +$LK,"IEF_48_REX",A="FL:::/Kernel/KernelA.HH,1733"$ +$LK,"RECALCt_TO_SCREEN",A="FL:::/Kernel/KernelA.HH,1347"$ +$LK,"ã",A="FL:::/Kernel/KernelA.HH,50"$ +$LK,"Suspend",A="FL:::/Kernel/KTask.HC.Z,57",BI=142$ +$LK,"ClampU64",A="FL:::/Kernel/KernelB.HH,127"$ +$LK,"ARC_MAX_BITS",A="FL:::/Kernel/KernelA.HH,3740"$ +$LK,"TK_MOD_EQU",A="FL:::/Kernel/KernelA.HH,2107"$ +$LK,"FunSegFind",A="FL:::/Kernel/FunSeg.HC.Z,54",BI=143$ +$LK,"Define",A="FL:::/Kernel/KDefine.HC.Z,49",BI=144$ +$LK,"FAT32Fmt",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,60",BI=145$ +$LK,"SrvCmdLine",A="FL:::/Kernel/KTask.HC.Z,386",BI=146$ +$LK,"HashTableNew",A="FL:::/Kernel/KHashB.HC.Z,50",BI=147$ +$LK,"DOCT_INDENT",A="FL:::/Kernel/KernelA.HH,914"$ +$LK,"_ARG",A="FL:::/Kernel/KMathA.HC.Z,366"$ +$LK,"COLORROP_NO_ROP0_MASK",A="FL:::/Kernel/KernelA.HH,2988"$ +$LK,"CDualBuf",A="FL:::/Kernel/BlkDev/DskCDDVD.HC.Z,109"$ +$LK,"TaskText",A="FL:::/Kernel/SrvCmd.HC.Z,75",BI=148$ +$LK,"COLORROP_BITS",A="FL:::/Kernel/KernelA.HH,2989"$ +$LK,"BROWN",A="FL:::/Kernel/KernelA.HH,2964"$ +$LK,"Da",A="FL:::/Kernel/KDbg.HC.Z,209",BI=149$ +$LK,"SUF_REM_TRAILING",A="FL:::/Kernel/KernelA.HH,3787"$ +$LK,"Cd",A="FL:::/Kernel/BlkDev/DskDirB.HC.Z,9",BI=150$ +$LK,"Ceil",A="FL:::/Kernel/KernelB.HH,123"$ +$LK,"DOCEF_SKIP_IN_FORM",A="FL:::/Kernel/KernelA.HH,1020"$ +$LK,"CCF_DONT_FREE_BUF",A="FL:::/Kernel/KernelA.HH,2131"$ +$LK,"IET_ZEROED_CODE_HEAP",A="FL:::/Kernel/KernelA.HH,412"$ +$LK,"SrcEdLink",A="FL:::/Kernel/FunSeg.HC.Z,278",BI=151$ +$LK,"GetRBP",A="FL:::/Kernel/KernelB.HH,242"$ +$LK,"GREEN",A="FL:::/Kernel/KernelA.HH,2960"$ +$LK,"RECALCF_TO_HTML",A="FL:::/Kernel/KernelA.HH,1352"$ +$LK,"ì",A="FL:::/Kernel/KernelA.HH,48"$ +$LK,"ON",A="FL:::/Kernel/KernelA.HH,21"$ +$LK,"_LXCHG_I64",A="FL:::/Kernel/KUtils.HC.Z,217"$ +$LK,"MDG_DISP_SIB_RIP",A="FL:::/Kernel/KernelA.HH,1588"$ +$LK,"DOCEt_BLINK",A="FL:::/Kernel/KernelA.HH,953"$ +$LK,"DOCET_BLINK",A="FL:::/Kernel/KernelA.HH,947"$ +$LK,"sys_clipboard_doc",A="FL:::/Kernel/KGlbls.HC.Z,6"$ +$LK,"CCF_NO_DEFINES",A="FL:::/Kernel/KernelA.HH,2132"$ +$LK,"DOCEf_SKIP_IN_FORM",A="FL:::/Kernel/KernelA.HH,1106"$ +$LK,"CGDTEntry",A="FL:::/Kernel/KernelA.HH,330"$ +$LK,"ARGT_XMM0",A="FL:::/Kernel/KernelA.HH,1946"$ +$LK,"_TASK_END_NOW",A="FL:::/Kernel/Sched.HC.Z,151"$ +$LK,"HTT_INVALID",A="FL:::/Kernel/KernelA.HH,681"$ +$LK,"_REP_OUT_U8",A="FL:::/Kernel/KUtils.HC.Z,308"$ +$LK,"GetRAX",A="FL:::/Kernel/KernelB.HH,241"$ +$LK,"sys_boot_src",A="FL:::/Kernel/KernelB.HH,40"$ +$LK,"SCF_DELETE",A="FL:::/Kernel/KernelA.HH,3543"$ +$LK,"SCf_DELETE",A="FL:::/Kernel/KernelA.HH,3528"$ +$LK,"ARGT_M32N32",A="FL:::/Kernel/KernelA.HH,1912"$ +$LK,"ARGT_M16N16",A="FL:::/Kernel/KernelA.HH,1911"$ +$LK,"ARGT_M16N32",A="FL:::/Kernel/KernelA.HH,1910"$ +$LK,"SV_STI_LIKE",A="FL:::/Kernel/KernelA.HH,1742"$ +$LK,"ICG_NO_CVT_MASK",A="FL:::/Kernel/KernelA.HH,1621"$ +$LK,"RECALCG_MASK",A="FL:::/Kernel/KernelA.HH,1348"$ +$LK,"HTF_PRIVATE",A="FL:::/Kernel/KernelA.HH,701"$ +$LK,"ESTIMATED_MISC_ALLOCS",A="FL:::/Kernel/Mem/PageTables.HC.Z,97"$ +$LK,"Pow10I64",A="FL:::/Kernel/KMathB.HC.Z,26",BI=152$ +$LK,"IEF_STI_LIKE",A="FL:::/Kernel/KernelA.HH,1736"$ +$LK,"HTf_PRIVATE",A="FL:::/Kernel/KernelA.HH,671"$ +$LK,"Dm",A="FL:::/Kernel/KDbg.HC.Z,204",BI=153$ +$LK,"CCF_EXE_BLK",A="FL:::/Kernel/KernelA.HH,2143"$ +$LK,"CQueD3I32",A="FL:::/Kernel/KernelA.HH,131"$ +$LK,"BDf_REMOVABLE",A="FL:::/Kernel/KernelA.HH,2647"$ +$LK,"BDF_REMOVABLE",A="FL:::/Kernel/KernelA.HH,2637"$ +$LK,"COLOR_INVALID",A="FL:::/Kernel/KernelA.HH,2976"$ +$LK,"DftExt",A="FL:::/Kernel/BlkDev/DskStrA.HC.Z,208",BI=154$ +$LK,"Bt",A="FL:::/Kernel/KernelB.HH,14"$ +$LK,"OPTf_EXTERNS_TO_IMPORTS",A="FL:::/Kernel/KernelA.HH,1541"$ +$LK,"HashFunSegFind",A="FL:::/Kernel/FunSeg.HC.Z,10",BI=155$ +$LK,"Dr",A="FL:::/Kernel/KDbg.HC.Z,328",BI=156$ +$LK,"CPUId",A="FL:::/Kernel/KernelB.HH,252"$ +$LK,"FilesFind2",A="FL:::/Kernel/BlkDev/DskFind.HC.Z,1",BI=157$ +$LK,"TaskKillDying",A="FL:::/Kernel/KTask.HC.Z,510",BI=158$ +$LK,"scan_code_map",A="FL:::/Kernel/SerialDev/Keyboard.HC.Z,157"$ +$LK,"UncachedAliasAlloc",A="FL:::/Kernel/Mem/MemPhysical.HC.Z,161",BI=159$ +$LK,"MSize2",A="FL:::/Kernel/Mem/MAllocFree.HC.Z,385"$ +$LK,"MemSetU32",A="FL:::/Kernel/KernelB.HH,176"$ +$LK,"MemSetU16",A="FL:::/Kernel/KernelB.HH,174"$ +$LK,"DirTreeDel",A="FL:::/Kernel/BlkDev/DskDirA.HC.Z,36",BI=160$ +$LK,"Fs",A="FL:::/Kernel/KernelB.HH,276"$ +$LK,"SCF_CAPS",A="FL:::/Kernel/KernelA.HH,3537"$ +$LK,"SCf_CAPS",A="FL:::/Kernel/KernelA.HH,3522"$ +$LK,"SYS_SEMA_FAR_CALL32",A="FL:::/Kernel/KernelA.HH,605"$ +$LK,"ACD_DEF_CHAR",A="FL:::/Kernel/KernelA.HH,1516"$ +$LK,"Gs",A="FL:::/Kernel/KernelB.HH,234"$ +$LK,"SYS_PROGRESS3_DESC",A="FL:::/Kernel/KStart32.HC.Z,39"$ +$LK,"RWF_SCROLL",A="FL:::/Kernel/KernelA.HH,3593"$ +$LK,"REGG_LOCAL_VARS",A="FL:::/Kernel/KernelA.HH,1794"$ +$LK,"DrvModelNum",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,294",BI=161$ +$LK,"RepInU8",A="FL:::/Kernel/KernelB.HH,86"$ +$LK,"IsSysDbg",A="FL:::/Kernel/KMisc.HC.Z,238",BI=162$ +$LK,"CDbgGlbls",A="FL:::/Kernel/KernelA.HH,3864"$ +$LK,"_TEST_EXCEPT",A="FL:::/Kernel/KExcept.HC.Z,4"$ +$LK,"_FSTCW",A="FL:::/Kernel/KMathA.HC.Z,632"$ +$LK,"MSG_IP_R_DOWN_UP",A="FL:::/Kernel/KernelA.HH,3242"$ +$LK,"ScanFlags",A="FL:::/Kernel/StrB.HC.Z,123",BI=163$ +$LK,"Ln",A="FL:::/Kernel/KernelB.HH,134"$ +$LK,"INT_WAKE",A="FL:::/Kernel/KInts.HC.Z,6"$ +$LK,"GetS",A="FL:::/Kernel/SerialDev/Message.HC.Z,209",BI=164$ +$LK,"_MEMSET_U32",A="FL:::/Kernel/KUtils.HC.Z,29"$ +$LK,"_MEMSET_U16",A="FL:::/Kernel/KUtils.HC.Z,16"$ +$LK,"SYS_MP_CNT_LOCK",A="FL:::/Kernel/KStart32.HC.Z,49"$ +$LK,"SYS_COMPILE_TIME",A="FL::/Temp.DD.Z,1"$ +$LK,"GetTSC",A="FL:::/Kernel/KernelB.HH,280"$ +$LK,"BptR",A="FL:::/Kernel/KDbg.HC.Z,389",BI=165$ +$LK,"DOCT_MARKER",A="FL:::/Kernel/KernelA.HH,906"$ +$LK,"BptS",A="FL:::/Kernel/KDbg.HC.Z,368",BI=166$ +$LK,"_HASH_BUCKET_FIND",A="FL:::/Kernel/KHashA.HC.Z,158"$ +$LK,"_MHEAP_CTRL",A="FL:::/Kernel/Mem/MAllocFree.HC.Z,368"$ +$LK,"ATAMount",A="FL:::/Kernel/BlkDev/DskATAId.HC.Z,239",BI=167$ +$LK,"FifoI64Peek",A="FL:::/Kernel/KDataTypes.HC.Z,290",BI=168$ +$LK,"_EXP",A="FL:::/Kernel/KMathA.HC.Z,558"$ +$LK,"SYS_SEMA_SYS_TIMER",A="FL:::/Kernel/KernelA.HH,595"$ +$LK,"IET_END",A="FL:::/Kernel/KernelA.HH,392"$ +$LK,"KbdHandler",A="FL:::/Kernel/SerialDev/Keyboard.HC.Z,441",BI=169$ +$LK,"GSF_WITH_NEW_LINE",A="FL:::/Kernel/KernelA.HH,3781"$ +$LK,"SYS_HASH_FIND1",A="FL:::/Kernel/KHashA.HC.Z,81"$ +$LK,"GetRSP",A="FL:::/Kernel/KernelB.HH,244"$ +$LK,"_D3_DIST",A="FL:::/Kernel/KMathA.HC.Z,39"$ +$LK,"SPF_TRUNCATE",A="FL:::/Kernel/KernelA.HH,3913"$ +$LK,"ScanKey",A="FL:::/Kernel/SerialDev/Message.HC.Z,123",BI=170$ +$LK,"MouseDriverInstall",A="FL:::/Kernel/SerialDev/Mouse.HC.Z,217",BI=171$ +$LK,"mouse_last",A="FL:::/Kernel/KGlbls.HC.Z,27"$ +$LK,"D3DistSqr",A="FL:::/Kernel/KernelB.HH,150"$ +$LK,"_RDI",A="FL:::/Kernel/KernelA.HH,3421"$ +$LK,"SV_R_REG",A="FL:::/Kernel/KernelA.HH,1740"$ +$LK,"ATARepExitAllApplications",A="FL:::/Kernel/BlkDev/DskATAId.HC.Z,120",BI=172$ +$LK,"CeilI64",A="FL:::/Kernel/KMathB.HC.Z,62",BI=173$ +$LK,"_RBP",A="FL:::/Kernel/KernelA.HH,3422"$ +$LK,"CCacheBlk",A="FL:::/Kernel/KernelA.HH,2746"$ +$LK,"OPTf_WARN_DUP_TYPES",A="FL:::/Kernel/KernelA.HH,1539"$ +$LK,"ATAProbe",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,373",BI=174$ +$LK,"_LXCHG_U16",A="FL:::/Kernel/KUtils.HC.Z,235"$ +$LK,"_LXCHG_U32",A="FL:::/Kernel/KUtils.HC.Z,226"$ +$LK,"SYS_PROGRESS1",A="FL:::/Kernel/KStart32.HC.Z,31"$ +$LK,"DOCT_FOOTER",A="FL:::/Kernel/KernelA.HH,913"$ +$LK,"MEM_NUM_E820_ENTRIES",A="FL:::/Kernel/KernelA.HH,356"$ +$LK,"MPAPICInit",A="FL:::/Kernel/MultiProc.HC.Z,171",BI=175$ +$LK,"SYS_PROGRESS2",A="FL:::/Kernel/KStart32.HC.Z,34"$ +$LK,"DOCEf_SKIP",A="FL:::/Kernel/KernelA.HH,1104"$ +$LK,"DOCEF_SKIP",A="FL:::/Kernel/KernelA.HH,1018"$ +$LK,"SYS_PROGRESS3",A="FL:::/Kernel/KStart32.HC.Z,37"$ +$LK,"SPF_COMMA",A="FL:::/Kernel/KernelA.HH,3914"$ +$LK,"CCF_DONT_MAKE_RES",A="FL:::/Kernel/KernelA.HH,2166"$ +$LK,"CSrvCtrl",A="FL:::/Kernel/KernelA.HH,3216"$ +$LK,"DirNew",A="FL:::/Kernel/BlkDev/DskDirA.HC.Z,1",BI=176$ +$LK,"SYS_PROGRESS4",A="FL:::/Kernel/KStart32.HC.Z,40"$ +$LK,"_RAX",A="FL:::/Kernel/KernelA.HH,3416"$ +$LK,"FAT32DirNew",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,576",BI=177$ +$LK,"HTf_RESOLVED",A="FL:::/Kernel/KernelA.HH,677"$ +$LK,"LinkedLstDel",A="FL:::/Kernel/KDataTypes.HC.Z,1",BI=178$ +$LK,"Help",A="FL:::/Kernel/StrB.HC.Z,115",BI=179$ +$LK,"Log2",A="FL:::/Kernel/KernelB.HH,136"$ +$LK,"_RBX",A="FL:::/Kernel/KernelA.HH,3417"$ +$LK,"DOCT_HEX_ED",A="FL:::/Kernel/KernelA.HH,935"$ +$LK,"DOCT_LINK",A="FL:::/Kernel/KernelA.HH,928"$ +$LK,"_D3_COPY",A="FL:::/Kernel/KMathA.HC.Z,212"$ +$LK,"PUT_STR",A="FL:::/Kernel/StrA.HC.Z,58"$ +$LK,"_RET",A="FL:::/Kernel/KUtils.HC.Z,456"$ +$LK,"_RCX",A="FL:::/Kernel/KernelA.HH,3418"$ +$LK,"BIOSTotalMem",A="FL:::/Kernel/Mem/MemPhysical.HC.Z,174",BI=180$ +$LK,"_RDX",A="FL:::/Kernel/KernelA.HH,3419"$ +$LK,"RLF_FULL_HEAP",A="FL:::/Kernel/KernelA.HH,463"$ +$LK,"RLf_FULL_HEAP",A="FL:::/Kernel/KernelA.HH,444"$ +$LK,"ScanMsg",A="FL:::/Kernel/SerialDev/Message.HC.Z,37",BI=181$ +$LK,"SYS_PROGRESS4_DESC",A="FL:::/Kernel/KStart32.HC.Z,42"$ +$LK,"__FILE__",A="FL:::/Kernel/KernelA.HH,2031"$ +$LK,"CDate",A="FL:::/Kernel/KernelA.HH,185"$ +$LK,"CLFlush",A="FL:::/Kernel/KernelB.HH,269"$ +$LK,"SYS_HEAP_DBG_FLAG",A="FL:::/Kernel/KStart32.HC.Z,21"$ +$LK,"_RIP",A="FL:::/Kernel/KernelA.HH,3424"$ +$LK,"IEF_REX_ONLY_R8_R15",A="FL:::/Kernel/KernelA.HH,1734"$ +$LK,"MDF_IMM",A="FL:::/Kernel/KernelA.HH,1581"$ +$LK,"DOCSS_SINGLE_QUOTE",A="FL:::/Kernel/KernelA.HH,1129"$ +$LK,"KBD_PORT",A="FL:::/Kernel/KernelA.HH,3000"$ +$LK,"NUM_COLORS",A="FL:::/Kernel/KernelA.HH,2975"$ +$LK,"ac",A="FL:::/Kernel/KGlbls.HC.Z,18"$ +$LK,"_FSTSW",A="FL:::/Kernel/KMathA.HC.Z,641"$ +$LK,"ARGT_IMM32",A="FL:::/Kernel/KernelA.HH,1886"$ +$LK,"ARGT_IMM16",A="FL:::/Kernel/KernelA.HH,1885"$ +$LK,"MouseSpeedSet",A="FL:::/Kernel/SerialDev/Mouse.HC.Z,109",BI=182$ +$LK,"Name2ParentDirCluster",A="FL:::/Kernel/BlkDev/DskStrB.HC.Z,54",BI=183$ +$LK,"Free",A="FL:::/Kernel/Mem/MAllocFree.HC.Z,383"$ +$LK,"DOCEf_AUX_STR",A="FL:::/Kernel/KernelA.HH,1055"$ +$LK,"DOCEF_AUX_STR",A="FL:::/Kernel/KernelA.HH,967"$ +$LK,"Char2KeyName",A="FL:::/Kernel/SerialDev/Keyboard.HC.Z,201",BI=184$ +$LK,"Mem512Free",A="FL:::/Kernel/Mem/Mem512.HC.Z,84",BI=185$ +$LK,"blkdev",A="FL:::/Kernel/KGlbls.HC.Z,19"$ +$LK,"TK_NUM_TK",A="FL:::/Kernel/KernelA.HH,2112"$ +$LK,"CWinMgrGlbls",A="FL:::/Kernel/KernelA.HH,1469"$ +$LK,"DOCEf_TREE",A="FL:::/Kernel/KernelA.HH,1102"$ +$LK,"DOCEF_TREE",A="FL:::/Kernel/KernelA.HH,1016"$ +$LK,"MouseUpdatePre",A="FL:::/Kernel/SerialDev/Mouse.HC.Z,119",BI=186$ +$LK,"ISO1FileFind",A="FL:::/Kernel/BlkDev/FileSysISO.HC.Z,70",BI=187$ +$LK,"TASK_SIGNATURE_VAL",A="FL:::/Kernel/KernelA.HH,3302"$ +$LK,"SysDefinesLoad",A="FL:::/Kernel/KDefine.HC.Z,97",BI=188$ +$LK,"Mem512TaskAlloc",A="FL:::/Kernel/Mem/Mem512.HC.Z,115",BI=189$ +$LK,"MEM_MAPPED_SPACE",A="FL:::/Kernel/KernelA.HH,3459"$ +$LK,"D3Norm",A="FL:::/Kernel/KernelB.HH,157"$ +$LK,"_POW",A="FL:::/Kernel/KMathA.HC.Z,515"$ +$LK,"MSG_KEY_DOWN",A="FL:::/Kernel/KernelA.HH,3227"$ +$LK,"ARGT_IMM64",A="FL:::/Kernel/KernelA.HH,1887"$ +$LK,"RTG_MASK",A="FL:::/Kernel/KernelA.HH,1570"$ +$LK,"TASK_HASH_TABLE_SIZE",A="FL:::/Kernel/KernelA.HH,2889"$ +$LK,"DOCT_BUTTON",A="FL:::/Kernel/KernelA.HH,929"$ +$LK,"drv_text_attr",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,310"$ +$LK,"PUT_HEX_U8",A="FL:::/Kernel/StrA.HC.Z,44"$ +$LK,"_RSI",A="FL:::/Kernel/KernelA.HH,3420"$ +$LK,"CTRLF_CAPTURE_RIGHT_IP",A="FL:::/Kernel/KernelA.HH,3095"$ +$LK,"CPUStructInit",A="FL:::/Kernel/MultiProc.HC.Z,116",BI=190$ +$LK,"WIf_FOCUS_TASK_GRAB_SCROLL",A="FL:::/Kernel/KernelA.HH,1456"$ +$LK,"WIF_FOCUS_TASK_GRAB_SCROLL",A="FL:::/Kernel/KernelA.HH,1431"$ +$LK,"CIntermediateCode",A="FL:::/Kernel/KernelA.HH,1655"$ +$LK,"MDF_REG",A="FL:::/Kernel/KernelA.HH,1582"$ +$LK,"DOC_COLOR_ANCHOR",A="FL:::/Kernel/KernelA.HH,1138"$ +$LK,"Str2ColorU32",A="FL:::/Kernel/KDefine.HC.Z,202",BI=191$ +$LK,"Str2ColorU16",A="FL:::/Kernel/KDefine.HC.Z,158",BI=192$ +$LK,"LinkedLstCnt",A="FL:::/Kernel/KDataTypes.HC.Z,21",BI=193$ +$LK,"Auto",A="FL:::/Kernel/SrvCmd.HC.Z,483",BI=194$ +$LK,"CTRLT_VIEWING_ANGLES",A="FL:::/Kernel/KernelA.HH,3090"$ +$LK,"DOCEf_QUIT",A="FL:::/Kernel/KernelA.HH,1088"$ +$LK,"DOCEF_QUIT",A="FL:::/Kernel/KernelA.HH,1000"$ +$LK,"Tabs2Spaces",A="FL:::/Kernel/StrB.HC.Z,1",BI=195$ +$LK,"MaxI64",A="FL:::/Kernel/KernelB.HH,99"$ +$LK,"SYS_GDT_PTR",A="FL:::/Kernel/KStart16.HC.Z,34"$ +$LK,"_RSP",A="FL:::/Kernel/KernelA.HH,3423"$ +$LK,"DOCT_INS_BIN_SIZE",A="FL:::/Kernel/KernelA.HH,939"$ +$LK,"FSetCluster",A="FL:::/Kernel/BlkDev/DskCFile.HC.Z,99",BI=196$ +$LK,"WinDerivedValsUpdate",A="FL:::/Kernel/Display.HC.Z,93",BI=197$ +$LK,"fp_update_ctrls",A="FL:::/Kernel/KGlbls.HC.Z,32"$ +$LK,"DSK_CACHE_HASH_SIZE",A="FL:::/Kernel/KernelA.HH,2744"$ +$LK,"RS_ATTR_VOL_ID",A="FL:::/Kernel/KernelA.HH,2529"$ +$LK,"DOCf_UNDERLINE",A="FL:::/Kernel/KernelA.HH,1323"$ +$LK,"DOCF_UNDERLINE",A="FL:::/Kernel/KernelA.HH,1286"$ +$LK,"DOCT_UNDERLINE",A="FL:::/Kernel/KernelA.HH,923"$ +$LK,"IntDivZero",A="FL:::/Kernel/KInts.HC.Z,150",BI=198$ +$LK,"_SQR",A="FL:::/Kernel/KMathA.HC.Z,337"$ +$LK,"DISPLAYf_SILENT",A="FL:::/Kernel/KernelA.HH,3297"$ +$LK,"MDF_SIB",A="FL:::/Kernel/KernelA.HH,1584"$ +$LK,"REGT_R32",A="FL:::/Kernel/KernelA.HH,741"$ +$LK,"REGT_R16",A="FL:::/Kernel/KernelA.HH,740"$ +$LK,"IEF_NOT_IN_64_BIT",A="FL:::/Kernel/KernelA.HH,1732"$ +$LK,"RedSeaFileFind",A="FL:::/Kernel/BlkDev/FileSysRedSea.HC.Z,155",BI=199$ +$LK,"SYS_PCIBIOS_SERVICE_DIR",A="FL:::/Kernel/PCIBIOS.HC.Z,4"$ +$LK,"tS",A="FL:::/Kernel/KMisc.HC.Z,122",BI=200$ +$LK,"LBEqu",A="FL:::/Kernel/KernelB.HH,34"$ +$LK,"ICF_RES_NOT_USED",A="FL:::/Kernel/KernelA.HH,1600"$ +$LK,"DOCEt_SEL",A="FL:::/Kernel/KernelA.HH,955"$ +$LK,"ArcDetermineCompressionType",A="FL:::/Kernel/Compress.HC.Z,102",BI=201$ +$LK,"SYS_SEMA_REFRESH_IN_PROGRESS",A="FL:::/Kernel/KernelA.HH,601"$ +$LK,"IntInit1",A="FL:::/Kernel/KInts.HC.Z,180",BI=202$ +$LK,"CH_CURSOR",A="FL:::/Kernel/KernelA.HH,3505"$ +$LK,"IntInit2",A="FL:::/Kernel/KInts.HC.Z,195",BI=203$ +$LK,"DOCT_CURSOR",A="FL:::/Kernel/KernelA.HH,905"$ +$LK,"GetKey",A="FL:::/Kernel/SerialDev/Message.HC.Z,142",BI=204$ +$LK,"ROP_MONO",A="FL:::/Kernel/KernelA.HH,2945"$ +$LK,"CFAT32DirEntryLong",A="FL:::/Kernel/KernelA.HH,2396"$ +$LK,"Kill",A="FL:::/Kernel/KTask.HC.Z,40",BI=205$ +$LK,"RS_ATTR_FIXED",A="FL:::/Kernel/KernelA.HH,2539"$ +$LK,"TK_IFDEF",A="FL:::/Kernel/KernelA.HH,2101"$ +$LK,"REGT_R64",A="FL:::/Kernel/KernelA.HH,742"$ +$LK,"SingleUser",A="FL:::/Kernel/KMisc.HC.Z,255",BI=206$ +$LK,"Date2Struct",A="FL:::/Kernel/KDate.HC.Z,39",BI=207$ +$LK,"CFile",A="FL:::/Kernel/KernelA.HH,2787"$ +$LK,"Fault2",A="FL:::/Kernel/KDbg.HC.Z,592",BI=208$ +$LK,"Load",A="FL:::/Kernel/KLoad.HC.Z,181",BI=209$ +$LK,"ip",A="FL:::/Kernel/KGlbls.HC.Z,24"$ +$LK,"CFreeLst",A="FL:::/Kernel/KernelA.HH,2709"$ +$LK,"DOCEF_CHECKED_COLLAPSED",A="FL:::/Kernel/KernelA.HH,1005"$ +$LK,"CHash",A="FL:::/Kernel/KernelA.HH,623"$ +$LK,"RedSeaFreeClusters",A="FL:::/Kernel/BlkDev/FileSysRedSea.HC.Z,250",BI=210$ +$LK,"DeathWait",A="FL:::/Kernel/KTask.HC.Z,34",BI=211$ +$LK,"Fault3",A="FL:::/Kernel/KDbg.HC.Z,561",BI=212$ +$LK,"CompressBuf",A="FL:::/Kernel/Compress.HC.Z,281",BI=213$ +$LK,"chars_bmp_hex_numeric",A="FL:::/Kernel/StrA.HC.Z,353"$ +$LK,"CCF_NOT_CONST",A="FL:::/Kernel/KernelA.HH,2140"$ +$LK,"CeilU64",A="FL:::/Kernel/KMathB.HC.Z,41",BI=214$ +$LK,"BPlf_LOCKED",A="FL:::/Kernel/KernelA.HH,2892"$ +$LK,"BDlf_LOCKED",A="FL:::/Kernel/KernelA.HH,2658"$ +$LK,"TK_ELLIPSIS",A="FL:::/Kernel/KernelA.HH,2109"$ +$LK,"TK_OR_EQU",A="FL:::/Kernel/KernelA.HH,2096"$ +$LK,"sys_neg_pows_lst",A="FL:::/Kernel/StrPrint.HC.Z,203"$ +$LK,"sys_pos_pows_lst",A="FL:::/Kernel/StrPrint.HC.Z,202"$ +$LK,"MStrPrint",A="FL:::/Kernel/StrPrint.HC.Z,898",BI=215$ +$LK,"DVlf_LOCKED",A="FL:::/Kernel/KernelA.HH,2683"$ +$LK,"SrcFileName",A="FL:::/Kernel/FunSeg.HC.Z,239",BI=216$ +$LK,"RawD",A="FL:::/Kernel/KDbg.HC.Z,234",BI=217$ +$LK,"IsSingleUser",A="FL:::/Kernel/KMisc.HC.Z,260",BI=218$ +$LK,"adam_task",A="FL:::/Kernel/KGlbls.HC.Z,8"$ +$LK,"_POW10",A="FL:::/Kernel/KMathA.HC.Z,524"$ +$LK,"SVCRf_LOCKED",A="FL:::/Kernel/KernelA.HH,3215"$ +$LK,"BDF_LAST_WAS_WRITE",A="FL:::/Kernel/KernelA.HH,2641"$ +$LK,"DOCT_CURSOR_MOVEMENT",A="FL:::/Kernel/KernelA.HH,926"$ +$LK,"SCF_CTRL",A="FL:::/Kernel/KernelA.HH,3535"$ +$LK,"SCf_CTRL",A="FL:::/Kernel/KernelA.HH,3520"$ +$LK,"TK_ENDIF",A="FL:::/Kernel/KernelA.HH,2105"$ +$LK,"RT_UF32",A="FL:::/Kernel/KernelA.HH,1565"$ +$LK,"CCF_NO_REG_OPT",A="FL:::/Kernel/KernelA.HH,2141"$ +$LK,"DOCEf_UNDERLINE",A="FL:::/Kernel/KernelA.HH,1050"$ +$LK,"DOCEF_UNDERLINE",A="FL:::/Kernel/KernelA.HH,1044"$ +$LK,"DOCEt_UNDERLINE",A="FL:::/Kernel/KernelA.HH,956"$ +$LK,"DOCET_UNDERLINE",A="FL:::/Kernel/KernelA.HH,950"$ +$LK,"RLf_DOC",A="FL:::/Kernel/KernelA.HH,450"$ +$LK,"pi",A="FL:::/Kernel/KernelA.HH,49"$ +$LK,"ATTRF_UNDERLINE",A="FL:::/Kernel/KernelA.HH,892"$ +$LK,"ATTRf_UNDERLINE",A="FL:::/Kernel/KernelA.HH,897"$ +$LK,"KbdMouseVarsInit",A="FL:::/Kernel/SerialDev/Mouse.HC.Z,271",BI=219$ +$LK,"DOCF_BWD_MOVEMENT",A="FL:::/Kernel/KernelA.HH,1275"$ +$LK,"SYS_SEMA_UPDATE_WIN_Z_BUF",A="FL:::/Kernel/KernelA.HH,608"$ +$LK,"Exit",A="FL:::/Kernel/KTask.HC.Z,1",BI=220$ +$LK,"TASKf_BREAK_TO_SHIFT_ESC",A="FL:::/Kernel/KernelA.HH,3290"$ +$LK,"HTT_KEYWORD",A="FL:::/Kernel/KernelA.HH,691"$ +$LK,"CopySingleZ",A="FL:::/Kernel/BlkDev/DskCopy.HC.Z,1",BI=221$ +$LK,"DCF_NO_TRANSPARENTS",A="FL:::/Kernel/KernelA.HH,3621"$ +$LK,"HTt_KEYWORD",A="FL:::/Kernel/KernelA.HH,661"$ +$LK,"SYS_SEMA_IN_DEBUGGER",A="FL:::/Kernel/KernelA.HH,597"$ +$LK,"RT_UF64",A="FL:::/Kernel/KernelA.HH,1567"$ +$LK,"DOCf_BWD_MOVEMENT",A="FL:::/Kernel/KernelA.HH,1311"$ +$LK,"GetMsg",A="FL:::/Kernel/SerialDev/Message.HC.Z,95",BI=222$ +$LK,"CMPCrash",A="FL:::/Kernel/KernelA.HH,3855"$ +$LK,"ROPBF_HALF_RANGE_COLOR",A="FL:::/Kernel/KernelA.HH,2937"$ +$LK,"ICF_SHORT_JMP",A="FL:::/Kernel/KernelA.HH,1603"$ +$LK,"IA32_FS_BASE",A="FL:::/Kernel/KernelA.HH,522"$ +$LK,"Rand",A="FL:::/Kernel/KMathB.HC.Z,122",BI=223$ +$LK,"FAT32_ENTRIES_BITS",A="FL:::/Kernel/KernelA.HH,2409"$ +$LK,"TK_IDENT",A="FL:::/Kernel/KernelA.HH,2073"$ +$LK,"ArcCompressBuf",A="FL:::/Kernel/Compress.HC.Z,110",BI=224$ +$LK,"MDG_REG_DISP_SIB_RIP",A="FL:::/Kernel/KernelA.HH,1589"$ +$LK,"ToFileLine",A="FL:::/Kernel/EdLite.HC.Z,303",BI=225$ +$LK,"D3Unit",A="FL:::/Kernel/KernelB.HH,161"$ +$LK,"CTRLT_WIN_HSCROLL",A="FL:::/Kernel/KernelA.HH,3088"$ +$LK,"TK_IFAOT",A="FL:::/Kernel/KernelA.HH,2103"$ +$LK,"IsDotC",A="FL:::/Kernel/BlkDev/DskStrA.HC.Z,31",BI=226$ +$LK,"BDf_LAST_WAS_WRITE",A="FL:::/Kernel/KernelA.HH,2651"$ +$LK,"TK_GREATER_EQU",A="FL:::/Kernel/KernelA.HH,2087"$ +$LK,"CICArg",A="FL:::/Kernel/KernelA.HH,1632"$ +$LK,"MDF_STK",A="FL:::/Kernel/KernelA.HH,1580"$ +$LK,"DOCEf_CENTER_X",A="FL:::/Kernel/KernelA.HH,1076"$ +$LK,"DOCEF_CENTER_X",A="FL:::/Kernel/KernelA.HH,988"$ +$LK,"SYS_TIMER_FREQ",A="FL:::/Kernel/KernelA.HH,552"$ +$LK,"HashTablePurge",A="FL:::/Kernel/KHashB.HC.Z,107",BI=227$ +$LK,"GR_HEIGHT",A="FL:::/Kernel/KernelA.HH,3610"$ +$LK,"DOCEf_CENTER_Y",A="FL:::/Kernel/KernelA.HH,1079"$ +$LK,"DOCEF_CENTER_Y",A="FL:::/Kernel/KernelA.HH,991"$ +$LK,"Seed",A="FL:::/Kernel/KMathB.HC.Z,128",BI=228$ +$LK,"DrvsRelease",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,27",BI=229$ +$LK,"BlkDevNextFreeSlot",A="FL:::/Kernel/BlkDev/DskBlkDev.HC.Z,120",BI=230$ +$LK,"TASKf_FILTER_INPUT",A="FL:::/Kernel/KernelA.HH,3284"$ +$LK,"DOCEF_REFRESH_DATA",A="FL:::/Kernel/KernelA.HH,1007"$ +$LK,"DOCf_DONT_HIGHLIGHT_CURSOR",A="FL:::/Kernel/KernelA.HH,1305"$ +$LK,"DOCF_DONT_HIGHLIGHT_CURSOR",A="FL:::/Kernel/KernelA.HH,1269"$ +$LK,"SYS_SEMA_FLUSH_VGA_IMAGE",A="FL:::/Kernel/KernelA.HH,602"$ +$LK,"OPTf_NO_REG_VAR",A="FL:::/Kernel/KernelA.HH,1543"$ +$LK,"CTRLF_SHOW",A="FL:::/Kernel/KernelA.HH,3092"$ +$LK,"DOCEf_REFRESH_DATA",A="FL:::/Kernel/KernelA.HH,1095"$ +$LK,"DOCEf_LEFT_EXP",A="FL:::/Kernel/KernelA.HH,1058"$ +$LK,"DOCEF_LEFT_EXP",A="FL:::/Kernel/KernelA.HH,970"$ +$LK,"ISO1FileRead",A="FL:::/Kernel/BlkDev/FileSysISO.HC.Z,130",BI=231$ +$LK,"ATAPIWaitReady",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,334",BI=232$ +$LK,"SC_PRTSCRN1",A="FL:::/Kernel/KernelA.HH,3585"$ +$LK,"FUF_ALL",A="FL:::/Kernel/KernelA.HH,2598"$ +$LK,"STR_LEN",A="FL:::/Kernel/KernelA.HH,40"$ +$LK,"DskCacheQueIns",A="FL:::/Kernel/BlkDev/DskCache.HC.Z,53",BI=233$ +$LK,"SC_PRTSCRN2",A="FL:::/Kernel/KernelA.HH,3586"$ +$LK,"sys_semas",A="FL:::/Kernel/KernelB.HH,231"$ +$LK,"InputFilterTask",A="FL:::/Kernel/SerialDev/Message.HC.Z,1",BI=234$ +$LK,"SYS_HASH_STR",A="FL:::/Kernel/KHashA.HC.Z,4"$ +$LK,"ATAR0_CMD",A="FL:::/Kernel/KernelA.HH,2285"$ +$LK,"I_DBG",A="FL:::/Kernel/KernelA.HH,296"$ +$LK,"FATNameTo",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,130",BI=235$ +$LK,"SrvCmdQueDel",A="FL:::/Kernel/SrvCmd.HC.Z,7",BI=236$ +$LK,"MinI64",A="FL:::/Kernel/KernelB.HH,101"$ +$LK,"MaxU64",A="FL:::/Kernel/KernelB.HH,100"$ +$LK,"CallInd",A="FL:::/Kernel/KernelB.HH,49"$ +$LK,"EndianI64",A="FL:::/Kernel/KMisc.HC.Z,25",BI=237$ +$LK,"_MSIZE",A="FL:::/Kernel/Mem/MAllocFree.HC.Z,337"$ +$LK,"AC_MAX_FILLINS",A="FL:::/Kernel/KernelA.HH,1484"$ +$LK,"GVF_IMPORT",A="FL:::/Kernel/KernelA.HH,867"$ +$LK,"HTF_IMPORT",A="FL:::/Kernel/KernelA.HH,704"$ +$LK,"HTf_IMPORT",A="FL:::/Kernel/KernelA.HH,674"$ +$LK,"NUM_BLKDEVS",A="FL:::/Kernel/KernelA.HH,2660"$ +$LK,"IEF_PLUS_OPCODE",A="FL:::/Kernel/KernelA.HH,1729"$ +$LK,"LAPIC_ICR_LOW",A="FL:::/Kernel/KernelA.HH,495"$ +$LK,"mouse",A="FL:::/Kernel/KGlbls.HC.Z,27"$ +$LK,"D3Zero",A="FL:::/Kernel/KernelB.HH,162"$ +$LK,"ST_WARN_ST",A="FL:::/Kernel/KernelA.HH,3514"$ +$LK,"FUF_SCAN_PARENTS",A="FL:::/Kernel/KernelA.HH,2615"$ +$LK,"DskCacheInvalidate2",A="FL:::/Kernel/BlkDev/DskCache.HC.Z,97",BI=238$ +$LK,"CCtrl",A="FL:::/Kernel/KernelA.HH,3114"$ +$LK,"CBlkDev",A="FL:::/Kernel/KernelA.HH,2662"$ +$LK,"DOCT_SONG",A="FL:::/Kernel/KernelA.HH,940"$ +$LK,"DOCT_TREE",A="FL:::/Kernel/KernelA.HH,936"$ +$LK,"progress1_desc",A="FL:::/Kernel/KernelB.HH,208"$ +$LK,"BDS_ED_FILENAME_DRV",A="FL:::/Kernel/KernelA.HH,3269"$ +$LK,"DOCT_TEXT",A="FL:::/Kernel/KernelA.HH,900"$ +$LK,"CMathODE",A="FL:::/Kernel/KernelA.HH,244"$ +$LK,"WinInside",A="FL:::/Kernel/Display.HC.Z,110",BI=239$ +$LK,"RFLAGf_ALIGN_CHECK",A="FL:::/Kernel/KernelA.HH,321"$ +$LK,"FUf_SCAN_PARENTS",A="FL:::/Kernel/KernelA.HH,2589"$ +$LK,"DOCF_ALLOW_UNDO",A="FL:::/Kernel/KernelA.HH,1271"$ +$LK,"CMemberLst",A="FL:::/Kernel/KernelA.HH,797"$ +$LK,"DOCf_ALLOW_UNDO",A="FL:::/Kernel/KernelA.HH,1307"$ +$LK,"DskCacheQueRem",A="FL:::/Kernel/BlkDev/DskCache.HC.Z,46",BI=240$ +$LK,"_D3_NORM",A="FL:::/Kernel/KMathA.HC.Z,4"$ +$LK,"DOCEf_BLINK",A="FL:::/Kernel/KernelA.HH,1047"$ +$LK,"DOCEF_BLINK",A="FL:::/Kernel/KernelA.HH,1041"$ +$LK,"IsDotZ",A="FL:::/Kernel/BlkDev/DskStrA.HC.Z,22",BI=241$ +$LK,"HashGenericAdd",A="FL:::/Kernel/KHashB.HC.Z,140",BI=242$ +$LK,"_TASK_CONTEXT_RESTORE",A="FL:::/Kernel/Sched.HC.Z,100"$ +$LK,"BFieldOrU32",A="FL:::/Kernel/KernelB.HH,32"$ +$LK,"TK_IFJIT",A="FL:::/Kernel/KernelA.HH,2104"$ +$LK,"RedSeaFileRead",A="FL:::/Kernel/BlkDev/FileSysRedSea.HC.Z,207",BI=243$ +$LK,"MousePktRead",A="FL:::/Kernel/SerialDev/Mouse.HC.Z,1",BI=244$ +$LK,"VGAP_CRTC_DATA",A="FL:::/Kernel/KernelA.HH,3733"$ +$LK,"ARGT_REL32",A="FL:::/Kernel/KernelA.HH,1882"$ +$LK,"ARGT_REL16",A="FL:::/Kernel/KernelA.HH,1881"$ +$LK,"cpu_structs",A="FL:::/Kernel/KernelB.HH,227"$ +$LK,"SC_DELETE",A="FL:::/Kernel/KernelA.HH,3570"$ +$LK,"MAX_U64_F64",A="FL:::/Kernel/KernelA.HH,44"$ +$LK,"CLine",A="FL:::/Kernel/EdLite.HC.Z,1"$ +$LK,"C:/Doc/TimeCycles.DD.Z",A="FL:::/Kernel/KernelB.HH,280"$ +$LK,"ACD_MAX_FILLINS",A="FL:::/Kernel/KernelA.HH,1521"$ +$LK,"REGT_SEG",A="FL:::/Kernel/KernelA.HH,743"$ +$LK,"CMass",A="FL:::/Kernel/KernelA.HH,208"$ +$LK,"GetStr",A="FL:::/Kernel/SerialDev/Message.HC.Z,193",BI=245$ +$LK,"LTRED",A="FL:::/Kernel/KernelA.HH,2970"$ +$LK,"FSG_TYPE_MASK",A="FL:::/Kernel/KernelA.HH,2695"$ +$LK,"StrIMatch",A="FL:::/Kernel/StrA.HC.Z,319"$ +$LK,"HTG_TYPE_MASK",A="FL:::/Kernel/KernelA.HH,699"$ +$LK,"Sign",A="FL:::/Kernel/KernelB.HH,140"$ +$LK,"ExpandBuf",A="FL:::/Kernel/Compress.HC.Z,250",BI=246$ +$LK,"ICF_ALT_TEMPLATE",A="FL:::/Kernel/KernelA.HH,1614"$ +$LK,"DOCT_PAGE_LEN",A="FL:::/Kernel/KernelA.HH,909"$ +$LK,"RLf_RAW",A="FL:::/Kernel/KernelA.HH,445"$ +$LK,"BootDVDProbe",A="FL:::/Kernel/BlkDev/DskATAId.HC.Z,1",BI=247$ +$LK,"ToggleZorNotZ",A="FL:::/Kernel/BlkDev/DskStrA.HC.Z,261",BI=248$ +$LK,"VGAP_ATTR_INDEX",A="FL:::/Kernel/KernelA.HH,3722"$ +$LK,"D3MulEqu",A="FL:::/Kernel/KernelB.HH,156"$ +$LK,"BDS_CONST",A="FL:::/Kernel/KernelA.HH,3267"$ +$LK,"MP_MAX_PROCESSORS",A="FL:::/Kernel/KernelA.HH,303"$ +$LK,"SysGlblsInit",A="FL:::/Kernel/KEnd.HC.Z,1",BI=249$ +$LK,"PutSrcLink",A="FL:::/Kernel/FunSeg.HC.Z,295",BI=250$ +$LK,"CMenu",A="FL:::/Kernel/KernelA.HH,3148"$ +$LK,"BDT_ATAPI",A="FL:::/Kernel/KernelA.HH,2634"$ +$LK,"FUF_MAP",A="FL:::/Kernel/KernelA.HH,2603"$ +$LK,"CFAT32DirEntry",A="FL:::/Kernel/KernelA.HH,2380"$ +$LK,"ACD_POS_END",A="FL:::/Kernel/KernelA.HH,1509"$ +$LK,"DOCT_INVERT",A="FL:::/Kernel/KernelA.HH,922"$ +$LK,"CMT_HASH_ENTRY",A="FL:::/Kernel/KernelA.HH,1694"$ +$LK,"RLf_VGA",A="FL:::/Kernel/KernelA.HH,439"$ +$LK,"WIf_FOCUS_TASK_IP_WHEEL",A="FL:::/Kernel/KernelA.HH,1454"$ +$LK,"LAPIC_LVT_PERF",A="FL:::/Kernel/KernelA.HH,500"$ +$LK,"SC_F1",A="FL:::/Kernel/KernelA.HH,3571"$ +$LK,"SYS_SEMAS",A="FL:::/Kernel/KStart32.HC.Z,54"$ +$LK,"SC_F2",A="FL:::/Kernel/KernelA.HH,3572"$ +$LK,"BirthWait",A="FL:::/Kernel/KTask.HC.Z,28",BI=251$ +$LK,"SYS_VAR_INIT_FLAG",A="FL::/Temp.DD.Z,1"$ +$LK,"SYS_MEM_INIT_FLAG",A="FL::/Temp.DD.Z,1"$ +$LK,"SC_F3",A="FL:::/Kernel/KernelA.HH,3573"$ +$LK,"SignI64",A="FL:::/Kernel/KernelB.HH,104"$ +$LK,"SC_F4",A="FL:::/Kernel/KernelA.HH,3574"$ +$LK,"WSSf_SET_TO_POS",A="FL:::/Kernel/KernelA.HH,3098"$ +$LK,"RS_ATTR_SYSTEM",A="FL:::/Kernel/KernelA.HH,2528"$ +$LK,"SYS_SEMA_MUTE",A="FL:::/Kernel/KernelA.HH,610"$ +$LK,"I_BPT",A="FL:::/Kernel/KernelA.HH,289"$ +$LK,"_TAKE_EXCEPT",A="FL:::/Kernel/KExcept.HC.Z,20"$ +$LK,"DefineCnt",A="FL:::/Kernel/KDefine.HC.Z,74",BI=252$ +$LK,"SC_F5",A="FL:::/Kernel/KernelA.HH,3575"$ +$LK,"WIF_FOCUS_TASK_MENU",A="FL:::/Kernel/KernelA.HH,1423"$ +$LK,"RedSeaCd",A="FL:::/Kernel/BlkDev/FileSysRedSea.HC.Z,236",BI=253$ +$LK,"SC_F6",A="FL:::/Kernel/KernelA.HH,3576"$ +$LK,"SysGrInit",A="FL:::/Kernel/KEnd.HC.Z,64",BI=254$ +$LK,"ArcCtrlDel",A="FL:::/Kernel/Compress.HC.Z,244",BI=255$ +$LK,"SysBadMAlloc",A="FL:::/Kernel/Mem/Mem512.HC.Z,6",BI=256$ +$LK,"SC_F7",A="FL:::/Kernel/KernelA.HH,3577"$ +$LK,"DOCSS_NORMAL",A="FL:::/Kernel/KernelA.HH,1128"$ +$LK,"GVF_EXTERN",A="FL:::/Kernel/KernelA.HH,868"$ +$LK,"blkdev_text_attr",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,309"$ +$LK,"SPF_NEG_E",A="FL:::/Kernel/KernelA.HH,3921"$ +$LK,"SC_F8",A="FL:::/Kernel/KernelA.HH,3578"$ +$LK,"Mute",A="FL:::/Kernel/KMisc.HC.Z,204",BI=257$ +$LK,"INT_FAULT",A="FL:::/Kernel/KInts.HC.Z,62"$ +$LK,"progress2_desc",A="FL:::/Kernel/KernelB.HH,212"$ +$LK,"DCSF_PALETTE_GET",A="FL:::/Kernel/KernelA.HH,3642"$ +$LK,"SC_F9",A="FL:::/Kernel/KernelA.HH,3579"$ +$LK,"DOCEF_SOLID_BORDER",A="FL:::/Kernel/KernelA.HH,1003"$ +$LK,"KbdBuildSC",A="FL:::/Kernel/SerialDev/Keyboard.HC.Z,301",BI=258$ +$LK,"CInst",A="FL:::/Kernel/KernelA.HH,1744"$ +$LK,"IOAPICID",A="FL:::/Kernel/KernelA.HH,512"$ +$LK,"RFLAGf_SIGN",A="FL:::/Kernel/KernelA.HH,311"$ +$LK,"DKGRAY",A="FL:::/Kernel/KernelA.HH,2966"$ +$LK,"DOCEF_MARGIN_REL_X",A="FL:::/Kernel/KernelA.HH,996"$ +$LK,"PutDirLink",A="FL:::/Kernel/BlkDev/DskDirA.HC.Z,200",BI=259$ +$LK,"EndianU32",A="FL:::/Kernel/KMisc.HC.Z,15",BI=260$ +$LK,"EndianU16",A="FL:::/Kernel/KMisc.HC.Z,7",BI=261$ +$LK,"DOCEf_SOLID_BORDER",A="FL:::/Kernel/KernelA.HH,1091"$ +$LK,"sys_pci_busses",A="FL:::/Kernel/KernelB.HH,237"$ +$LK,"SPF_NEG_AUX_FMT_NUM",A="FL:::/Kernel/KernelA.HH,3922"$ +$LK,"BOOT_STK_SIZE",A="FL:::/Kernel/KernelA.HH,3880"$ +$LK,"TTS_LOCKED_CONST",A="FL:::/Kernel/KernelA.HH,3273"$ +$LK,"CCf_FUN_EXP",A="FL:::/Kernel/KernelA.HH,2150"$ +$LK,"CCF_FUN_EXP",A="FL:::/Kernel/KernelA.HH,2149"$ +$LK,"LAPIC_APIC_VERSION",A="FL:::/Kernel/KernelA.HH,480"$ +$LK,"PutS",A="FL:::/Kernel/KeyDev.HC.Z,29",BI=262$ +$LK,"DOCEf_MARGIN_REL_X",A="FL:::/Kernel/KernelA.HH,1084"$ +$LK,"CDocBin",A="FL:::/Kernel/KernelA.HH,1114"$ +$LK,"LAPIC_BASE",A="FL:::/Kernel/KernelA.HH,477"$ +$LK,"MAX_F64",A="FL:::/Kernel/KernelA.HH,45"$ +$LK,"StrPrintJoin",A="FL:::/Kernel/StrPrint.HC.Z,208",BI=263$ +$LK,"IA32_GS_BASE",A="FL:::/Kernel/KernelA.HH,523"$ +$LK,"log2_e",A="FL:::/Kernel/KernelA.HH,53"$ +$LK,"CurDir",A="FL:::/Kernel/BlkDev/DskStrA.HC.Z,277",BI=264$ +$LK,"MinU64",A="FL:::/Kernel/KernelB.HH,102"$ +$LK,"_SYS_HLT",A="FL:::/Kernel/KUtils.HC.Z,468"$ +$LK,"CCF_AOT_COMPILE",A="FL:::/Kernel/KernelA.HH,2160"$ +$LK,"OPTf_KEEP_PRIVATE",A="FL:::/Kernel/KernelA.HH,1542"$ +$LK,"MAX_I32",A="FL:::/Kernel/KernelA.HH,32"$ +$LK,"MAX_I16",A="FL:::/Kernel/KernelA.HH,28"$ +$LK,"HTF_EXPORT",A="FL:::/Kernel/KernelA.HH,703"$ +$LK,"HTf_EXPORT",A="FL:::/Kernel/KernelA.HH,673"$ +$LK,"DrvDel",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,69",BI=265$ +$LK,"ATAPIReadBlks2",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,385",BI=266$ +$LK,"_D3_UNIT",A="FL:::/Kernel/KMathA.HC.Z,305"$ +$LK,"CCf_AOT_COMPILE",A="FL:::/Kernel/KernelA.HH,2161"$ +$LK,"POP_C_REGS",A="FL:::/Kernel/KernelA.HH,1767"$ +$LK,"_STRIMATCH",A="FL:::/Kernel/StrA.HC.Z,262"$ +$LK,"DrvChk",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,142",BI=267$ +$LK,"CSema",A="FL:::/Kernel/KernelA.HH,587"$ +$LK,"EXT_HEAPLOG_MALLOC",A="FL:::/Kernel/KernelA.HH,577"$ +$LK,"GR_WIDTH",A="FL:::/Kernel/KernelA.HH,3609"$ +$LK,"DOCT_SOFT_NEW_LINE",A="FL:::/Kernel/KernelA.HH,902"$ +$LK,"GetBaseUnit",A="FL:::/Kernel/BlkDev/DskAddDev.HC.Z,176",BI=268$ +$LK,"FixSet",A="FL:::/Kernel/EdLite.HC.Z,327",BI=269$ +$LK,"IPSet",A="FL:::/Kernel/SerialDev/InputPointer.HC.Z,43",BI=270$ +$LK,"DOCf_SEL",A="FL:::/Kernel/KernelA.HH,1322"$ +$LK,"SYS_SEMA_HEAPLOG_LOCK",A="FL:::/Kernel/KernelA.HH,600"$ +$LK,"sqrt2",A="FL:::/Kernel/KernelA.HH,56"$ +$LK,"ATAR0_SEL",A="FL:::/Kernel/KernelA.HH,2283"$ +$LK,"CQueVectU8",A="FL:::/Kernel/KernelA.HH,162"$ +$LK,"IntFaultHandlersNew",A="FL:::/Kernel/KInts.HC.Z,166",BI=271$ +$LK,"TASKf_INPUT_FILTER_TASK",A="FL:::/Kernel/KernelA.HH,3283"$ +$LK,"OM_CB",A="FL:::/Kernel/KernelA.HH,1871"$ +$LK,"MAX_I64",A="FL:::/Kernel/KernelA.HH,36"$ +$LK,"throw",A="FL:::/Kernel/KExcept.HC.Z,83",BI=272$ +$LK,"sys_boot_base",A="FL:::/Kernel/KernelB.HH,37"$ +$LK,"BDF_READ_ONLY_OVERRIDE",A="FL:::/Kernel/KernelA.HH,2640"$ +$LK,"TK_AND_AND",A="FL:::/Kernel/KernelA.HH,2088"$ +$LK,"REG_NONE",A="FL:::/Kernel/KernelA.HH,1787"$ +$LK,"OC_LOCK_PREFIX",A="FL:::/Kernel/KernelA.HH,1759"$ +$LK,"WIF_SELF_IP_WHEEL",A="FL:::/Kernel/KernelA.HH,1416"$ +$LK,"Ff_INTERRUPT",A="FL:::/Kernel/KernelA.HH,847"$ +$LK,"CFunSegCache",A="FL:::/Kernel/KernelA.HH,3845"$ +$LK,"OM_CD",A="FL:::/Kernel/KernelA.HH,1873"$ +$LK,"AAT_ADD_U8",A="FL:::/Kernel/KernelA.HH,1969"$ +$LK,"REGT_XMM",A="FL:::/Kernel/KernelA.HH,746"$ +$LK,"DOCSS_CPP_Z_COMMENT",A="FL:::/Kernel/KernelA.HH,1132"$ +$LK,"DOCT_SHIFTED_X",A="FL:::/Kernel/KernelA.HH,924"$ +$LK,"PutExcept",A="FL:::/Kernel/KExcept.HC.Z,45",BI=273$ +$LK,"TestExcept",A="FL:::/Kernel/KExcept.HC.Z,41"$ +$LK,"CColorROPU32",A="FL:::/Kernel/KernelA.HH,2983"$ +$LK,"CColorROPU16",A="FL:::/Kernel/KernelA.HH,2979"$ +$LK,"DOCT_SHIFTED_Y",A="FL:::/Kernel/KernelA.HH,925"$ +$LK,"HTT_FILE",A="FL:::/Kernel/KernelA.HH,695"$ +$LK,"HTT_DEFINE_STR",A="FL:::/Kernel/KernelA.HH,684"$ +$LK,"HTt_FILE",A="FL:::/Kernel/KernelA.HH,665"$ +$LK,"Push",A="FL:::/Kernel/KernelB.HH,246"$ +$LK,"SVCf_FREE_ON_COMPLETE",A="FL:::/Kernel/KernelA.HH,3186"$ +$LK,"HTt_DEFINE_STR",A="FL:::/Kernel/KernelA.HH,654"$ +$LK,"STK_REP_LEN",A="FL:::/Kernel/KDbg.HC.Z,102"$ +$LK,"I_NMI",A="FL:::/Kernel/KernelA.HH,288"$ +$LK,"Date2ISO1",A="FL:::/Kernel/BlkDev/FileSysISO.HC.Z,1",BI=274$ +$LK,"ModU64",A="FL:::/Kernel/KernelB.HH,103"$ +$LK,"SVCf_EXIT_ON_COMPLETE",A="FL:::/Kernel/KernelA.HH,3180"$ +$LK,"DOCG_DBL_BUF_FLAGS",A="FL:::/Kernel/KernelA.HH,958"$ +$LK,"JobResScan",A="FL:::/Kernel/SrvCmd.HC.Z,163",BI=275$ +$LK,"WIf_FOCUS_TASK_MENU",A="FL:::/Kernel/KernelA.HH,1448"$ +$LK,"WIf_SELF_IP_WHEEL",A="FL:::/Kernel/KernelA.HH,1442"$ +$LK,"CTask",A="FL:::/Kernel/KernelA.HH,3318"$ +$LK,"C:/Doc/Bit.DD.Z",A="FL:::/Kernel/KernelB.HH,9"$ +$LK,"OC_JMP_REL8",A="FL:::/Kernel/KernelA.HH,1763"$ +$LK,"_HASH_SINGLE_TABLE_FIND",A="FL:::/Kernel/KHashA.HC.Z,143"$ +$LK,"_D3_ZERO",A="FL:::/Kernel/KMathA.HC.Z,201"$ +$LK,"Str2F64",A="FL:::/Kernel/StrScan.HC.Z,55",BI=276$ +$LK,"_YIELD",A="FL:::/Kernel/Sched.HC.Z,157"$ +$LK,"OM_IB",A="FL:::/Kernel/KernelA.HH,1875"$ +$LK,"progress3_desc",A="FL:::/Kernel/KernelB.HH,216"$ +$LK,"DCF_SYMMETRY",A="FL:::/Kernel/KernelA.HH,3626"$ +$LK,"OM_ID",A="FL:::/Kernel/KernelA.HH,1877"$ +$LK,"OM_CP",A="FL:::/Kernel/KernelA.HH,1874"$ +$LK,"WIF_FOCUS_TASK_IP_L",A="FL:::/Kernel/KernelA.HH,1425"$ +$LK,"_ROUND",A="FL:::/Kernel/KMathA.HC.Z,380"$ +$LK,"RFLAGf_TRAP",A="FL:::/Kernel/KernelA.HH,312"$ +$LK,"SYS_HASH_BUCKET_FIND",A="FL:::/Kernel/KHashA.HC.Z,109"$ +$LK,"BOOT_SRC_DVD",A="FL:::/Kernel/KernelA.HH,3886"$ +$LK,"FUF_RECURSE",A="FL:::/Kernel/KernelA.HH,2595"$ +$LK,"FUf_RECURSE",A="FL:::/Kernel/KernelA.HH,2569"$ +$LK,"MemCmp",A="FL:::/Kernel/KernelB.HH,166"$ +$LK,"SVCf_DONE",A="FL:::/Kernel/KernelA.HH,3184"$ +$LK,"SC_PAGE_UP",A="FL:::/Kernel/KernelA.HH,3565"$ +$LK,"User",A="FL:::/Kernel/KTask.HC.Z,406",BI=277$ +$LK,"WIF_FOCUS_TASK_IP_R",A="FL:::/Kernel/KernelA.HH,1427"$ +$LK,"DOCEf_RIGHT_EXP",A="FL:::/Kernel/KernelA.HH,1060"$ +$LK,"DOCEF_RIGHT_EXP",A="FL:::/Kernel/KernelA.HH,972"$ +$LK,"DirEntryDel",A="FL:::/Kernel/BlkDev/DskDirA.HC.Z,17",BI=278$ +$LK,"CLexFile",A="FL:::/Kernel/KernelA.HH,2037"$ +$LK,"OM_CW",A="FL:::/Kernel/KernelA.HH,1872"$ +$LK,"DOCF_DONT_SWAP_OUT",A="FL:::/Kernel/KernelA.HH,1277"$ +$LK,"IA32_LAPIC_BASE",A="FL:::/Kernel/KernelA.HH,520"$ +$LK,"ATACmd",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,59",BI=279$ +$LK,"BusyWait",A="FL:::/Kernel/KMisc.HC.Z,136",BI=280$ +$LK,"DOCEf_SHIFTED_X",A="FL:::/Kernel/KernelA.HH,1065"$ +$LK,"DOCEG_DONT_EDIT",A="FL:::/Kernel/KernelA.HH,1035"$ +$LK,"DOCEF_SHIFTED_X",A="FL:::/Kernel/KernelA.HH,977"$ +$LK,"DOCEf_SHIFTED_Y",A="FL:::/Kernel/KernelA.HH,1066"$ +$LK,"DOCEF_SHIFTED_Y",A="FL:::/Kernel/KernelA.HH,978"$ +$LK,"Str2I64",A="FL:::/Kernel/StrScan.HC.Z,1",BI=281$ +$LK,"Sqrt",A="FL:::/Kernel/KernelB.HH,109"$ +$LK,"DrvMap",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,242",BI=282$ +$LK,"NowDateTimeStruct",A="FL:::/Kernel/KDate.HC.Z,133",BI=283$ +$LK,"YorN",A="FL:::/Kernel/StrB.HC.Z,87",BI=284$ +$LK,"MT_CD",A="FL:::/Kernel/KernelA.HH,2543"$ +$LK,"RFLAGf_VINT",A="FL:::/Kernel/KernelA.HH,322"$ +$LK,"DCF_ON_TOP",A="FL:::/Kernel/KernelA.HH,3638"$ +$LK,"ACD_DEF",A="FL:::/Kernel/KernelA.HH,1504"$ +$LK,"DOCEF_BIN_PTR_LINK",A="FL:::/Kernel/KernelA.HH,975"$ +$LK,"SYS_CPU_STRUCTS",A="FL:::/Kernel/KStart32.HC.Z,46"$ +$LK,"SVCT_MSG",A="FL:::/Kernel/KernelA.HH,3190"$ +$LK,"DOCf_DONT_SWAP_OUT",A="FL:::/Kernel/KernelA.HH,1313"$ +$LK,"CDocEntryBase",A="FL:::/Kernel/KernelA.HH,1159"$ +$LK,"MLF_STR_DFT_AVAILABLE",A="FL:::/Kernel/KernelA.HH,776"$ +$LK,"ArcCtrlNew",A="FL:::/Kernel/Compress.HC.Z,221",BI=285$ +$LK,"DCF_DONT_DRAW",A="FL:::/Kernel/KernelA.HH,3633"$ +$LK,"SYS_SEMA_HEAPLOG_ACTIVE",A="FL:::/Kernel/KernelA.HH,599"$ +$LK,"DOC_SCROLL_SPEED",A="FL:::/Kernel/KernelA.HH,1126"$ +$LK,"ATTRf_SEL",A="FL:::/Kernel/KernelA.HH,896"$ +$LK,"DOCEf_BIN_PTR_LINK",A="FL:::/Kernel/KernelA.HH,1063"$ +$LK,"SSF_NO_TENSION",A="FL:::/Kernel/KernelA.HH,225"$ +$LK,"I32",A="FL:::/Kernel/KernelA.HH,86"$ +$LK,"I16",A="FL:::/Kernel/KernelA.HH,72"$ +$LK,"MemCpy",A="FL:::/Kernel/KernelB.HH,168"$ +$LK,"CT_NONE",A="FL:::/Kernel/KernelA.HH,3742"$ +$LK,"OM_IW",A="FL:::/Kernel/KernelA.HH,1876"$ +$LK,"VGAP_DATA",A="FL:::/Kernel/KernelA.HH,3727"$ +$LK,"OM_NO",A="FL:::/Kernel/KernelA.HH,1870"$ +$LK,"IET_DATA_HEAP",A="FL:::/Kernel/KernelA.HH,413"$ +$LK,"GVF_DATA_HEAP",A="FL:::/Kernel/KernelA.HH,869"$ +$LK,"DefineSub",A="FL:::/Kernel/KDefine.HC.Z,60",BI=286$ +$LK,"WHITE",A="FL:::/Kernel/KernelA.HH,2973"$ +$LK,"ATA_READ_MULTI_EXT",A="FL:::/Kernel/KernelA.HH,2266"$ +$LK,"DOCEF_SCROLLING_X",A="FL:::/Kernel/KernelA.HH,979"$ +$LK,"DOCEf_CHECKED_COLLAPSED",A="FL:::/Kernel/KernelA.HH,1093"$ +$LK,"ISO1T_SUPPLEMENTARY_DESC",A="FL:::/Kernel/KernelA.HH,2480"$ +$LK,"DOCEf_SCROLLING_X",A="FL:::/Kernel/KernelA.HH,1067"$ +$LK,"MPInt",A="FL:::/Kernel/MultiProc.HC.Z,132",BI=287$ +$LK,"BOOT_SRC_RAM",A="FL:::/Kernel/KernelA.HH,3884"$ +$LK,"TK_AND_EQU",A="FL:::/Kernel/KernelA.HH,2095"$ +$LK,"I64",A="FL:::/Kernel/KernelA.HH,104"$ +$LK,"MAX_U32",A="FL:::/Kernel/KernelA.HH,34"$ +$LK,"MAX_U16",A="FL:::/Kernel/KernelA.HH,30"$ +$LK,"PopUpPrint",A="FL:::/Kernel/SrvCmd.HC.Z,398",BI=288$ +$LK,"IntEntryGet",A="FL:::/Kernel/KInts.HC.Z,97",BI=289$ +$LK,"CD2",A="FL:::/Kernel/KernelA.HH,149"$ +$LK,"KeyDevInit",A="FL:::/Kernel/KeyDev.HC.Z,201",BI=290$ +$LK,"CCF_HAS_RETURN",A="FL:::/Kernel/KernelA.HH,2145"$ +$LK,"CAsmArg",A="FL:::/Kernel/KernelA.HH,1846"$ +$LK,"CD3",A="FL:::/Kernel/KernelA.HH,155"$ +$LK,"SYS_BOOT_BLK",A="FL:::/Kernel/KStart16.HC.Z,24"$ +$LK,"progress4_desc",A="FL:::/Kernel/KernelB.HH,220"$ +$LK,"RFLAGf_ZERO",A="FL:::/Kernel/KernelA.HH,310"$ +$LK,"DrvFATBlkClean",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,99",BI=291$ +$LK,"CCF_CLASS_IP",A="FL:::/Kernel/KernelA.HH,2165"$ +$LK,"WIf_FOCUS_TASK_IP_L",A="FL:::/Kernel/KernelA.HH,1450"$ +$LK,"PCIReadU8",A="FL:::/Kernel/PCIBIOS.HC.Z,163",BI=292$ +$LK,"SYS_SEMA_SYS_DATE",A="FL:::/Kernel/KernelA.HH,596"$ +$LK,"EXT_WIN_FOCUS",A="FL:::/Kernel/KernelA.HH,576"$ +$LK,"ClustersAlloc",A="FL:::/Kernel/BlkDev/DskCluster.HC.Z,134",BI=293$ +$LK,"WIF_SELF_IP_L",A="FL:::/Kernel/KernelA.HH,1412"$ +$LK,"MAX_U64",A="FL:::/Kernel/KernelA.HH,38"$ +$LK,"WIf_SELF_IP_L",A="FL:::/Kernel/KernelA.HH,1440"$ +$LK,"CHashAC",A="FL:::/Kernel/KernelA.HH,753"$ +$LK,"DOCf_NO_CURSOR",A="FL:::/Kernel/KernelA.HH,1296"$ +$LK,"DOCF_NO_CURSOR",A="FL:::/Kernel/KernelA.HH,1260"$ +$LK,"PrintWarn",A="FL:::/Kernel/StrPrint.HC.Z,914",BI=294$ +$LK,"LoadOneImport",A="FL:::/Kernel/KLoad.HC.Z,1",BI=295$ +$LK,"FOpen",A="FL:::/Kernel/BlkDev/DskCFile.HC.Z,9",BI=296$ +$LK,"CCF_LAST_WAS_DOT",A="FL:::/Kernel/KernelA.HH,2159"$ +$LK,"CMF_DEFINED",A="FL:::/Kernel/KernelA.HH,1697"$ +$LK,"WIf_FOCUS_TASK_IP_R",A="FL:::/Kernel/KernelA.HH,1452"$ +$LK,"HTG_ALL",A="FL:::/Kernel/KernelA.HH,714"$ +$LK,"sys_var_init_val",A="FL:::/Kernel/KernelB.HH,186"$ +$LK,"FUF_REPLACE",A="FL:::/Kernel/KernelA.HH,2600"$ +$LK,"FUf_REPLACE",A="FL:::/Kernel/KernelA.HH,2574"$ +$LK,"DrvRep",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,328",BI=297$ +$LK,"BlkDevUnlock",A="FL:::/Kernel/BlkDev/DskBlkDev.HC.Z,15",BI=298$ +$LK,"CMemUsed",A="FL:::/Kernel/KernelA.HH,2823"$ +$LK,"WIF_SELF_IP_R",A="FL:::/Kernel/KernelA.HH,1414"$ +$LK,"IntMPCrash",A="FL:::/Kernel/MultiProc.HC.Z,380",BI=299$ +$LK,"JobQue",A="FL:::/Kernel/MultiProc.HC.Z,213",BI=300$ +$LK,"TSSBusy",A="FL:::/Kernel/MultiProc.HC.Z,71",BI=301$ +$LK,"DrvTypeSet",A="FL:::/Kernel/BlkDev/DskFmt.HC.Z,1",BI=302$ +$LK,"FUF_JUST_AOT",A="FL:::/Kernel/KernelA.HH,2610"$ +$LK,"FUf_JUST_AOT",A="FL:::/Kernel/KernelA.HH,2584"$ +$LK,"WIf_SELF_IP_R",A="FL:::/Kernel/KernelA.HH,1441"$ +$LK,"DirNameAbs",A="FL:::/Kernel/BlkDev/DskStrA.HC.Z,104",BI=303$ +$LK,"DOF_DONT_HOME",A="FL:::/Kernel/KernelA.HH,1217"$ +$LK,"CH_ESC",A="FL:::/Kernel/KernelA.HH,3508"$ +$LK,"DOCEf_DONT_DRAW",A="FL:::/Kernel/KernelA.HH,1109"$ +$LK,"DOCEF_DONT_DRAW",A="FL:::/Kernel/KernelA.HH,1023"$ +$LK,"DrvFATBlkAlloc",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,89",BI=304$ +$LK,"WildMatch",A="FL:::/Kernel/StrA.HC.Z,656",BI=305$ +$LK,"CDC",A="FL:::/Kernel/KernelA.HH,3653"$ +$LK,"SC_CURSOR_LEFT",A="FL:::/Kernel/KernelA.HH,3563"$ +$LK,"IsMute",A="FL:::/Kernel/KMisc.HC.Z,218",BI=306$ +$LK,"DOCT_CLEAR",A="FL:::/Kernel/KernelA.HH,908"$ +$LK,"DVDImageWrite",A="FL:::/Kernel/BlkDev/DskCDDVD.HC.Z,147",BI=307$ +$LK,"MouseRst",A="FL:::/Kernel/SerialDev/Mouse.HC.Z,37",BI=308$ +$LK,"HashTypeNum",A="FL:::/Kernel/KHashB.HC.Z,1",BI=309$ +$LK,"CPUf_DYING_TASK_QUE",A="FL:::/Kernel/KernelA.HH,3436"$ +$LK,"BDf_READ_ONLY",A="FL:::/Kernel/KernelA.HH,2649"$ +$LK,"BDF_READ_ONLY",A="FL:::/Kernel/KernelA.HH,2639"$ +$LK,"DCF_JUST_MIRROR",A="FL:::/Kernel/KernelA.HH,3630"$ +$LK,"FSt_UNKNOWN",A="FL:::/Kernel/KernelA.HH,2693"$ +$LK,"WIG_USER_TASK_DFT",A="FL:::/Kernel/KernelA.HH,1436"$ +$LK,"sys_cache_line_width",A="FL:::/Kernel/KernelB.HH,265"$ +$LK,"XchgI64",A="FL:::/Kernel/KernelB.HH,260"$ +$LK,"SC_CURSOR_DOWN",A="FL:::/Kernel/KernelA.HH,3562"$ +$LK,"DOF_DONT_WINMGR_SYNC",A="FL:::/Kernel/KernelA.HH,1220"$ +$LK,"I_SINGLE_STEP",A="FL:::/Kernel/KernelA.HH,287"$ +$LK,"KbdMouseRst",A="FL:::/Kernel/SerialDev/Mouse.HC.Z,207",BI=310$ +$LK,"ATA_WRITE_MULTI",A="FL:::/Kernel/KernelA.HH,2267"$ +$LK,"DOC_COLOR_KEYWORD",A="FL:::/Kernel/KernelA.HH,1142"$ +$LK,"XTalkStr",A="FL:::/Kernel/SrvCmd.HC.Z,490",BI=311$ +$LK,"FUF_JUST_GRA",A="FL:::/Kernel/KernelA.HH,2612"$ +$LK,"FUf_JUST_GRA",A="FL:::/Kernel/KernelA.HH,2586"$ +$LK,"CCF_IN_QUOTES",A="FL:::/Kernel/KernelA.HH,2142"$ +$LK,"CFifoU8",A="FL:::/Kernel/KernelA.HH,170"$ +$LK,"ATAReadNativeMax",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,187",BI=312$ +$LK,"BOOT_SRC_ROM",A="FL:::/Kernel/KernelA.HH,3883"$ +$LK,"RLF_AUTO_COMPLETE",A="FL:::/Kernel/KernelA.HH,473"$ +$LK,"SYS_KERNEL_END",A="FL:::/Kernel/KEnd.HC.Z,218"$ +$LK,"TakeExcept",A="FL:::/Kernel/KExcept.HC.Z,42"$ +$LK,"_MALLOC",A="FL:::/Kernel/Mem/MAllocFree.HC.Z,5"$ +$LK,"CHashDefineStr",A="FL:::/Kernel/KernelA.HH,824"$ +$LK,"MemSet",A="FL:::/Kernel/KernelB.HH,170"$ +$LK,"_TRUNC",A="FL:::/Kernel/KMathA.HC.Z,400"$ +$LK,"SPF_SLASH",A="FL:::/Kernel/KernelA.HH,3916"$ +$LK,"HTF_IMM",A="FL:::/Kernel/KernelA.HH,705"$ +$LK,"FUF_IGNORE",A="FL:::/Kernel/KernelA.HH,2597"$ +$LK,"FUf_IGNORE",A="FL:::/Kernel/KernelA.HH,2571"$ +$LK,"AAT_SUB_U32",A="FL:::/Kernel/KernelA.HH,1974"$ +$LK,"AAT_SUB_U16",A="FL:::/Kernel/KernelA.HH,1972"$ +$LK,"IP_MOUSE",A="FL:::/Kernel/KernelA.HH,3044"$ +$LK,"ATAIDDrvs",A="FL:::/Kernel/BlkDev/DskATAId.HC.Z,205",BI=313$ +$LK,"UserCmdLine",A="FL:::/Kernel/KTask.HC.Z,395",BI=314$ +$LK,"GVF_FUN",A="FL:::/Kernel/KernelA.HH,866"$ +$LK,"IA32F_LME",A="FL:::/Kernel/KernelA.HH,519"$ +$LK,"LAPICF_APIC_ENABLED",A="FL:::/Kernel/KernelA.HH,489"$ +$LK,"RLf_AUTO_COMPLETE",A="FL:::/Kernel/KernelA.HH,454"$ +$LK,"PCIClassFind",A="FL:::/Kernel/PCIBIOS.HC.Z,265",BI=315$ +$LK,"RECALCF_HAS_CURSOR",A="FL:::/Kernel/KernelA.HH,1350"$ +$LK,"ATARep",A="FL:::/Kernel/BlkDev/DskATAId.HC.Z,131",BI=316$ +$LK,"KDInputFilterPutS",A="FL:::/Kernel/KeyDev.HC.Z,117",BI=317$ +$LK,"D3SubEqu",A="FL:::/Kernel/KernelB.HH,160"$ +$LK,"FUF_JUST_JIT",A="FL:::/Kernel/KernelA.HH,2611"$ +$LK,"FUf_JUST_JIT",A="FL:::/Kernel/KernelA.HH,2585"$ +$LK,"CAsmIns",A="FL:::/Kernel/KernelA.HH,1834"$ +$LK,"InU32",A="FL:::/Kernel/KernelB.HH,76"$ +$LK,"InU16",A="FL:::/Kernel/KernelB.HH,75"$ +$LK,"TK_IF",A="FL:::/Kernel/KernelA.HH,2100"$ +$LK,"DOCT_BLINK",A="FL:::/Kernel/KernelA.HH,921"$ +$LK,"U32",A="FL:::/Kernel/KernelA.HH,78"$ +$LK,"U16",A="FL:::/Kernel/KernelA.HH,66"$ +$LK,"_XCHG_I64",A="FL:::/Kernel/KUtils.HC.Z,184"$ +$LK,"ATANop",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,48",BI=318$ +$LK,"TaskDel",A="FL:::/Kernel/KTask.HC.Z,419",BI=319$ +$LK,"LXchgU8",A="FL:::/Kernel/KernelB.HH,256"$ +$LK,"AAT_SUB_U64",A="FL:::/Kernel/KernelA.HH,1976"$ +$LK,"HasLower",A="FL:::/Kernel/FunSeg.HC.Z,1",BI=320$ +$LK,"_CALL",A="FL:::/Kernel/KUtils.HC.Z,145"$ +$LK,"IA32F_SCE",A="FL:::/Kernel/KernelA.HH,518"$ +$LK,"MIN_F64",A="FL:::/Kernel/KernelA.HH,46"$ +$LK,"__LINE__",A="FL:::/Kernel/KernelA.HH,2027"$ +$LK,"FUF_FLATTEN_TREE",A="FL:::/Kernel/KernelA.HH,2616"$ +$LK,"KeyDescSet",A="FL:::/Kernel/KeyDev.HC.Z,56",BI=321$ +$LK,"U64",A="FL:::/Kernel/KernelA.HH,94"$ +$LK,"MIN_I32",A="FL:::/Kernel/KernelA.HH,31"$ +$LK,"MIN_I16",A="FL:::/Kernel/KernelA.HH,27"$ +$LK,"FSize",A="FL:::/Kernel/BlkDev/DskCFile.HC.Z,1",BI=322$ +$LK,"IntEntrySet",A="FL:::/Kernel/KInts.HC.Z,109",BI=323$ +$LK,"Mem32DevIns",A="FL:::/Kernel/Mem/MemPhysical.HC.Z,1",BI=324$ +$LK,"SYS_MP_CNT_INITIAL",A="FL:::/Kernel/KStart32.HC.Z,48"$ +$LK,"FUf_FLATTEN_TREE",A="FL:::/Kernel/KernelA.HH,2590"$ +$LK,"_CEIL",A="FL:::/Kernel/KMathA.HC.Z,441"$ +$LK,"INVALID_CLUSTER",A="FL:::/Kernel/KernelA.HH,2300"$ +$LK,"TaskEnd",A="FL:::/Kernel/KTask.HC.Z,427",BI=325$ +$LK,"MIN_I64",A="FL:::/Kernel/KernelA.HH,35"$ +$LK,"TaskCaller",A="FL:::/Kernel/KDbg.HC.Z,75",BI=326$ +$LK,"SV_NONE",A="FL:::/Kernel/KernelA.HH,1743"$ +$LK,"QUE_VECT_U8_CNT",A="FL:::/Kernel/KernelA.HH,161"$ +$LK,"RT_I0",A="FL:::/Kernel/KernelA.HH,1553"$ +$LK,"DOCEF_LEFT_MACRO",A="FL:::/Kernel/KernelA.HH,971"$ +$LK,"TK_DEREFERENCE",A="FL:::/Kernel/KernelA.HH,2080"$ +$LK,"ARGT_UIMM8",A="FL:::/Kernel/KernelA.HH,1889"$ +$LK,"DOCF_NULL_GRAB_SCROLL",A="FL:::/Kernel/KernelA.HH,1276"$ +$LK,"DOCEf_LEFT_MACRO",A="FL:::/Kernel/KernelA.HH,1059"$ +$LK,"SYS_GDT",A="FL:::/Kernel/KStart16.HC.Z,39"$ +$LK,"CDate2Dos",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,1",BI=327$ +$LK,"SrvCmdRunOne",A="FL:::/Kernel/SrvCmd.HC.Z,267",BI=328$ +$LK,"MRT_UNUSED",A="FL:::/Kernel/KernelA.HH,2864"$ +$LK,"MDG_REG_DISP_SIB",A="FL:::/Kernel/KernelA.HH,1587"$ +$LK,"RedSeaFilesDel",A="FL:::/Kernel/BlkDev/FileSysRedSea.HC.Z,458",BI=329$ +$LK,"XchgU32",A="FL:::/Kernel/KernelB.HH,262"$ +$LK,"XchgU16",A="FL:::/Kernel/KernelB.HH,261"$ +$LK,"TK_SHL_EQU",A="FL:::/Kernel/KernelA.HH,2091"$ +$LK,"CCntsGlbls",A="FL:::/Kernel/KernelA.HH,537"$ +$LK,"TEMP_BUF_LEN",A="FL:::/Kernel/StrPrint.HC.Z,205"$ +$LK,"LastDayOfMon",A="FL:::/Kernel/KDate.HC.Z,82",BI=330$ +$LK,"RT_I8",A="FL:::/Kernel/KernelA.HH,1555"$ +$LK,"SVCf_WAKE_MASTER",A="FL:::/Kernel/KernelA.HH,3178"$ +$LK,"CAsmNum",A="FL:::/Kernel/KernelA.HH,1819"$ +$LK,"_REP_OUT_U16",A="FL:::/Kernel/KUtils.HC.Z,297"$ +$LK,"_REP_OUT_U32",A="FL:::/Kernel/KUtils.HC.Z,286"$ +$LK,"VGAM_TEXT",A="FL:::/Kernel/KernelA.HH,3719"$ +$LK,"ACD_POS",A="FL:::/Kernel/KernelA.HH,1508"$ +$LK,"FirstDayOfMon",A="FL:::/Kernel/KDate.HC.Z,71",BI=331$ +$LK,"PutChars",A="FL:::/Kernel/KeyDev.HC.Z,20",BI=332$ +$LK,"_BEQU",A="FL:::/Kernel/KUtils.HC.Z,89"$ +$LK,"DOCEf_RAW_TYPE",A="FL:::/Kernel/KernelA.HH,1064"$ +$LK,"DOCEF_RAW_TYPE",A="FL:::/Kernel/KernelA.HH,976"$ +$LK,"ansf",A="FL:::/Kernel/KernelA.HH,3414"$ +$LK,"BlkDevsInitAll",A="FL:::/Kernel/BlkDev/DskAddDev.HC.Z,216",BI=333$ +$LK,"SysUntry",A="FL:::/Kernel/KExcept.HC.Z,76",BI=334$ +$LK,"WIF_FOCUS_TASK_BORDER",A="FL:::/Kernel/KernelA.HH,1430"$ +$LK,"_MEMCMP",A="FL:::/Kernel/KUtils.HC.Z,70"$ +$LK,"DISPLAYf_NO_BORDER",A="FL:::/Kernel/KernelA.HH,3298"$ +$LK,"OFF",A="FL:::/Kernel/KernelA.HH,22"$ +$LK,"DOCF_DO_FULL_REFRESH",A="FL:::/Kernel/KernelA.HH,1278"$ +$LK,"SYS_BOOT_SRC",A="FL:::/Kernel/KStart16.HC.Z,23"$ +$LK,"FUF_JUST_SRC",A="FL:::/Kernel/KernelA.HH,2609"$ +$LK,"FUf_JUST_SRC",A="FL:::/Kernel/KernelA.HH,2583"$ +$LK,"OC_CALL",A="FL:::/Kernel/KernelA.HH,1762"$ +$LK,"TaskExe",A="FL:::/Kernel/SrvCmd.HC.Z,39",BI=335$ +$LK,"ThrowBreak",A="FL:::/Kernel/KExcept.HC.Z,129",BI=336$ +$LK,"FileWrite",A="FL:::/Kernel/BlkDev/DskFile.HC.Z,87",BI=337$ +$LK,"ARf_CSPRITE_PTS_RECTANGLES",A="FL:::/Kernel/KernelA.HH,3898"$ +$LK,"RFLAGf_ID",A="FL:::/Kernel/KernelA.HH,324"$ +$LK,"SCF_E0_PREFIX",A="FL:::/Kernel/KernelA.HH,3532"$ +$LK,"SCf_E0_PREFIX",A="FL:::/Kernel/KernelA.HH,3517"$ +$LK,"ATAWaitNotBUSY",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,24",BI=338$ +$LK,"_XCHG_U16",A="FL:::/Kernel/KUtils.HC.Z,200"$ +$LK,"_XCHG_U32",A="FL:::/Kernel/KUtils.HC.Z,192"$ +$LK,"SUF_TO_LOWER",A="FL:::/Kernel/KernelA.HH,3791"$ +$LK,"ARGT_XMM32",A="FL:::/Kernel/KernelA.HH,1943"$ +$LK,"WIF_SELF_GRAB_SCROLL",A="FL:::/Kernel/KernelA.HH,1418"$ +$LK,"LDF_SILENT",A="FL:::/Kernel/KernelA.HH,369"$ +$LK,"RED",A="FL:::/Kernel/KernelA.HH,2962"$ +$LK,"RT_U0",A="FL:::/Kernel/KernelA.HH,1554"$ +$LK,"SYS_SEMA_DEBUG",A="FL:::/Kernel/KernelA.HH,593"$ +$LK,"SrvCmdDel",A="FL:::/Kernel/SrvCmd.HC.Z,1",BI=339$ +$LK,"VGAR_MAP_MASK",A="FL:::/Kernel/KernelA.HH,3737"$ +$LK,"CAOTCtrl",A="FL:::/Kernel/KernelA.HH,2051"$ +$LK,"SCF_NEW_KEY",A="FL:::/Kernel/KernelA.HH,3540"$ +$LK,"TASK_CONTEXT_SAVE",A="FL:::/Kernel/Sched.HC.Z,56"$ +$LK,"SCf_NEW_KEY",A="FL:::/Kernel/KernelA.HH,3525"$ +$LK,"CDirContext",A="FL:::/Kernel/KernelA.HH,2771"$ +$LK,"BootDVDProbeAll",A="FL:::/Kernel/BlkDev/DskATAId.HC.Z,29",BI=340$ +$LK,"SysThrowBreak",A="FL:::/Kernel/KExcept.HC.Z,115",BI=341$ +$LK,"_MEMCPY",A="FL:::/Kernel/KUtils.HC.Z,55"$ +$LK,"_D3_DIST_SQR",A="FL:::/Kernel/KMathA.HC.Z,61"$ +$LK,"ARGT_XMM64",A="FL:::/Kernel/KernelA.HH,1944"$ +$LK,"ATAWriteBlks",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,461",BI=342$ +$LK,"RT_U8",A="FL:::/Kernel/KernelA.HH,1556"$ +$LK,"DOCEf_USER_DATA",A="FL:::/Kernel/KernelA.HH,1068"$ +$LK,"DOCEF_USER_DATA",A="FL:::/Kernel/KernelA.HH,980"$ +$LK,"COPY_BUF_BLKS",A="FL:::/Kernel/BlkDev/DskCopy.HC.Z,22"$ +$LK,"FAT32FileWrite",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,813",BI=343$ +$LK,"CISO1Date",A="FL:::/Kernel/KernelA.HH,2453"$ +$LK,"EDf_BAIL",A="FL:::/Kernel/KernelA.HH,1252"$ +$LK,"EDF_BAIL",A="FL:::/Kernel/KernelA.HH,1246"$ +$LK,"ChkCodePtr",A="FL:::/Kernel/KDbg.HC.Z,16",BI=344$ +$LK,"SYS_RAM_REBOOT",A="FL:::/Kernel/KStart64.HC.Z,74"$ +$LK,"ISO1T_BOOT_RECORD",A="FL:::/Kernel/KernelA.HH,2478"$ +$LK,"FileFind",A="FL:::/Kernel/BlkDev/DskFind.HC.Z,57",BI=345$ +$LK,"SYS_FIND_PCI_SERVICES",A="FL:::/Kernel/PCIBIOS.HC.Z,38"$ +$LK,"VGAP_ATTR_DATA_WRITE",A="FL:::/Kernel/KernelA.HH,3723"$ +$LK,"FUF_WHOLE_LABELS_BEFORE",A="FL:::/Kernel/KernelA.HH,2618"$ +$LK,"TK_MUL_EQU",A="FL:::/Kernel/KernelA.HH,2093"$ +$LK,"TK_NOT_EQU",A="FL:::/Kernel/KernelA.HH,2085"$ +$LK,"MIN_U32",A="FL:::/Kernel/KernelA.HH,33"$ +$LK,"MIN_U16",A="FL:::/Kernel/KernelA.HH,29"$ +$LK,"CFileNameTo",A="FL:::/Kernel/BlkDev/DskStrB.HC.Z,1",BI=346$ +$LK,"IntNop",A="FL:::/Kernel/KInts.HC.Z,143",BI=347$ +$LK,"_D3_MUL_EQU",A="FL:::/Kernel/KMathA.HC.Z,273"$ +$LK,"DISPLAYf_SHOW",A="FL:::/Kernel/KernelA.HH,3295"$ +$LK,"DOF_DONT_SHOW",A="FL:::/Kernel/KernelA.HH,1221"$ +$LK,"HTF_PUBLIC",A="FL:::/Kernel/KernelA.HH,702"$ +$LK,"HTf_PUBLIC",A="FL:::/Kernel/KernelA.HH,672"$ +$LK,"SYS_HASH_SINGLE_TABLE_FIND",A="FL:::/Kernel/KHashA.HC.Z,41"$ +$LK,"OC_OP_SIZE_PREFIX",A="FL:::/Kernel/KernelA.HH,1757"$ +$LK,"CCF_UNRESOLVED",A="FL:::/Kernel/KernelA.HH,2147"$ +$LK,"MLF_FUN",A="FL:::/Kernel/KernelA.HH,777"$ +$LK,"TaskMsg",A="FL:::/Kernel/SrvCmd.HC.Z,119",BI=348$ +$LK,"RBlks",A="FL:::/Kernel/BlkDev/DskBlk.HC.Z,31",BI=349$ +$LK,"DOCEF_ZERO_BASED",A="FL:::/Kernel/KernelA.HH,1014"$ +$LK,"HTF_UNRESOLVED",A="FL:::/Kernel/KernelA.HH,708"$ +$LK,"FAT32Cd",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,399",BI=350$ +$LK,"DOCEf_ZERO_BASED",A="FL:::/Kernel/KernelA.HH,1100"$ +$LK,"HTf_UNRESOLVED",A="FL:::/Kernel/KernelA.HH,678"$ +$LK,"CAP16BitInit",A="FL:::/Kernel/KernelA.HH,525"$ +$LK,"ATAPIWriteBlks",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,535",BI=351$ +$LK,"cnts",A="FL:::/Kernel/KGlbls.HC.Z,20"$ +$LK,"chars_bmp_displayable",A="FL:::/Kernel/StrA.HC.Z,386"$ +$LK,"SYS_HEAP_INIT_FLAG",A="FL::/Temp.DD.Z,1"$ +$LK,"FUF_WHOLE_LABELS",A="FL:::/Kernel/KernelA.HH,2617"$ +$LK,"ScanChar",A="FL:::/Kernel/SerialDev/Message.HC.Z,110",BI=352$ +$LK,"RepInU32",A="FL:::/Kernel/KernelB.HH,84"$ +$LK,"RepInU16",A="FL:::/Kernel/KernelB.HH,82"$ +$LK,"loge_2",A="FL:::/Kernel/KernelA.HH,55"$ +$LK,"MIN_U64",A="FL:::/Kernel/KernelA.HH,37"$ +$LK,"chars_bmp_white_space",A="FL:::/Kernel/StrA.HC.Z,356"$ +$LK,"FAT32FileFind",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,298",BI=353$ +$LK,"GSF_SHIFT_ESC_EXIT",A="FL:::/Kernel/KernelA.HH,3780"$ +$LK,"SFG_WHOLE_LABELS",A="FL:::/Kernel/KernelA.HH,3801"$ +$LK,"FUf_WHOLE_LABELS",A="FL:::/Kernel/KernelA.HH,2591"$ +$LK,"DOCf_DO_FULL_REFRESH",A="FL:::/Kernel/KernelA.HH,1314"$ +$LK,"DOCf_DONT_SHOW",A="FL:::/Kernel/KernelA.HH,1308"$ +$LK,"DOCF_DONT_SHOW",A="FL:::/Kernel/KernelA.HH,1272"$ +$LK,"DirTreeDel2",A="FL:::/Kernel/BlkDev/DskDirA.HC.Z,49",BI=354$ +$LK,"FUF_JUST_TXT",A="FL:::/Kernel/KernelA.HH,2608"$ +$LK,"FUf_JUST_TXT",A="FL:::/Kernel/KernelA.HH,2582"$ +$LK,"DOCT_DFT_BACKGROUND",A="FL:::/Kernel/KernelA.HH,918"$ +$LK,"DOCT_DFT_FOREGROUND",A="FL:::/Kernel/KernelA.HH,917"$ +$LK,"BOOT_SRC_HARDDRV",A="FL:::/Kernel/KernelA.HH,3885"$ +$LK,"HashFind",A="FL:::/Kernel/KHashA.HC.Z,255"$ +$LK,"D3Cross",A="FL:::/Kernel/KernelB.HH,148"$ +$LK,"MAX_PTR_STARS",A="FL:::/Kernel/KernelA.HH,771"$ +$LK,"DOCEF_ESC",A="FL:::/Kernel/KernelA.HH,999"$ +$LK,"_FREE",A="FL:::/Kernel/Mem/MAllocFree.HC.Z,224"$ +$LK,"SrcLineNum",A="FL:::/Kernel/FunSeg.HC.Z,184",BI=355$ +$LK,"ATAPIClose",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,521",BI=356$ +$LK,"DOCT_MACRO",A="FL:::/Kernel/KernelA.HH,933"$ +$LK,"CH_SHIFT_ESC",A="FL:::/Kernel/KernelA.HH,3509"$ +$LK,"InDbg",A="FL:::/Kernel/KMisc.HC.Z,265",BI=357$ +$LK,"Dbg",A="FL:::/Kernel/KDbg.HC.Z,634",BI=358$ +$LK,"Abs",A="FL:::/Kernel/KernelB.HH,96"$ +$LK,"CDATE_YEAR_DAYS",A="FL:::/Kernel/KernelA.HH,182"$ +$LK,"RFLAGf_OVERFLOW",A="FL:::/Kernel/KernelA.HH,315"$ +$LK,"SYS_POW",A="FL:::/Kernel/KMathA.HC.Z,462"$ +$LK,"StrNICmp",A="FL:::/Kernel/StrA.HC.Z,315"$ +$LK,"DOCf_NULL_GRAB_SCROLL",A="FL:::/Kernel/KernelA.HH,1312"$ +$LK,"DOCEf_RIGHT_X",A="FL:::/Kernel/KernelA.HH,1077"$ +$LK,"DOCEF_RIGHT_X",A="FL:::/Kernel/KernelA.HH,989"$ +$LK,"DCF_FILL_NOT_COLOR",A="FL:::/Kernel/KernelA.HH,3636"$ +$LK,"DOCEF_LEN",A="FL:::/Kernel/KernelA.HH,966"$ +$LK,"FileAttr",A="FL:::/Kernel/BlkDev/DskStrA.HC.Z,234",BI=359$ +$LK,"_MEMSET",A="FL:::/Kernel/KUtils.HC.Z,3"$ +$LK,"ROP_COLLISION",A="FL:::/Kernel/KernelA.HH,2944"$ +$LK,"TK_PLUS_PLUS",A="FL:::/Kernel/KernelA.HH,2078"$ +$LK,"sys_heap_init_val",A="FL:::/Kernel/KernelB.HH,182"$ +$LK,"DOCEF_DEREF_DATA",A="FL:::/Kernel/KernelA.HH,1011"$ +$LK,"VGAP_REG_WRITE",A="FL:::/Kernel/KernelA.HH,3730"$ +$LK,"FUF_EXPAND",A="FL:::/Kernel/KernelA.HH,2604"$ +$LK,"FUf_EXPAND",A="FL:::/Kernel/KernelA.HH,2578"$ +$LK,"DOCEf_DEREF_DATA",A="FL:::/Kernel/KernelA.HH,1097"$ +$LK,"Del",A="FL:::/Kernel/BlkDev/DskCopy.HC.Z,82",BI=360$ +$LK,"C:/Doc/Que.DD.Z",A="FL:::/Kernel/KernelB.HH,65"$ +$LK,"IDTET_TASK",A="FL:::/Kernel/KernelA.HH,280"$ +$LK,"TaskValidate",A="FL:::/Kernel/KTask.HC.Z,19",BI=361$ +$LK,"LAPIC_ARIBITRATION_PRIORITY",A="FL:::/Kernel/KernelA.HH,482"$ +$LK,"fp_set_std_palette",A="FL:::/Kernel/KGlbls.HC.Z,34"$ +$LK,"keydev",A="FL:::/Kernel/KGlbls.HC.Z,26"$ +$LK,"HashBucketFind",A="FL:::/Kernel/KHashA.HC.Z,260"$ +$LK,"OCF_ALIAS",A="FL:::/Kernel/KernelA.HH,1949"$ +$LK,"IC_BODY_SIZE",A="FL:::/Kernel/KernelA.HH,1623"$ +$LK,"chars_bmp_alpha_numeric",A="FL:::/Kernel/StrA.HC.Z,330"$ +$LK,"_LOG2",A="FL:::/Kernel/KMathA.HC.Z,603"$ +$LK,"ROPB_COLLISION",A="FL:::/Kernel/KernelA.HH,2935"$ +$LK,"HTT_WORD",A="FL:::/Kernel/KernelA.HH,689"$ +$LK,"HTt_WORD",A="FL:::/Kernel/KernelA.HH,659"$ +$LK,"FUG_FILE_FIND",A="FL:::/Kernel/KernelA.HH,2624"$ +$LK,"I_PAGE_FAULT",A="FL:::/Kernel/KernelA.HH,290"$ +$LK,"DrvUnlock",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,14",BI=362$ +$LK,"CProgress",A="FL:::/Kernel/KernelA.HH,3904"$ +$LK,"Arg",A="FL:::/Kernel/KernelB.HH,122"$ +$LK,"FSt_ISO9660",A="FL:::/Kernel/KernelA.HH,2689"$ +$LK,"CallExtNum",A="FL:::/Kernel/KernelB.HH,55"$ +$LK,"DirFile",A="FL:::/Kernel/BlkDev/DskStrA.HC.Z,290",BI=363$ +$LK,"DOCEF_TAG",A="FL:::/Kernel/KernelA.HH,965"$ +$LK,"Btc",A="FL:::/Kernel/KernelB.HH,16"$ +$LK,"CCF_KEEP_NEW_LINES",A="FL:::/Kernel/KernelA.HH,2135"$ +$LK,"MDF_RIP_DISP32",A="FL:::/Kernel/KernelA.HH,1585"$ +$LK,"Dir",A="FL:::/Kernel/BlkDev/DskDirB.HC.Z,105",BI=364$ +$LK,"Bsf",A="FL:::/Kernel/KernelB.HH,10"$ +$LK,"MDf_RIP_DISP32",A="FL:::/Kernel/KernelA.HH,1577"$ +$LK,"ECF_HAS_PUSH_CMP",A="FL:::/Kernel/KernelA.HH,1625"$ +$LK,"WIf_SELF_GRAB_SCROLL",A="FL:::/Kernel/KernelA.HH,1444"$ +$LK,"DOCT_PAGE_BREAK",A="FL:::/Kernel/KernelA.HH,904"$ +$LK,"SYS_SEMA_RECORD_MACRO",A="FL:::/Kernel/KernelA.HH,594"$ +$LK,"IPVarsUpdate",A="FL:::/Kernel/SerialDev/InputPointer.HC.Z,9",BI=365$ +$LK,"MLF_LASTCLASS",A="FL:::/Kernel/KernelA.HH,775"$ +$LK,"_R8",A="FL:::/Kernel/KernelA.HH,3425"$ +$LK,"_R9",A="FL:::/Kernel/KernelA.HH,3426"$ +$LK,"FileRead",A="FL:::/Kernel/BlkDev/DskFile.HC.Z,1",BI=366$ +$LK,"DOCf_HIGHLIGHT",A="FL:::/Kernel/KernelA.HH,1318"$ +$LK,"DOCF_HIGHLIGHT",A="FL:::/Kernel/KernelA.HH,1281"$ +$LK,"DOCT_HIGHLIGHT",A="FL:::/Kernel/KernelA.HH,920"$ +$LK,"_FAR_CALL32",A="FL:::/Kernel/PCIBIOS.HC.Z,69"$ +$LK,"KbdMouseCmdAck",A="FL:::/Kernel/SerialDev/Keyboard.HC.Z,65",BI=367$ +$LK,"CAOTHeapGlblRef",A="FL:::/Kernel/KernelA.HH,1984"$ +$LK,"DOCEF_SEL",A="FL:::/Kernel/KernelA.HH,1043"$ +$LK,"IEF_IMM_NOT_REL",A="FL:::/Kernel/KernelA.HH,404"$ +$LK,"FAT32DirFill",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,241",BI=368$ +$LK,"QueCopy",A="FL:::/Kernel/KDataTypes.HC.Z,53",BI=369$ +$LK,"Carry",A="FL:::/Kernel/KernelB.HH,240"$ +$LK,"Cos",A="FL:::/Kernel/KernelB.HH,98"$ +$LK,"Clamp",A="FL:::/Kernel/KMathB.HC.Z,1",BI=370$ +$LK,"BDF_FMT",A="FL:::/Kernel/KernelA.HH,2643"$ +$LK,"Name2DirCluster",A="FL:::/Kernel/BlkDev/DskStrB.HC.Z,10",BI=371$ +$LK,"Bsr",A="FL:::/Kernel/KernelB.HH,12"$ +$LK,"SYS_PROGRESS1_MAX",A="FL:::/Kernel/KStart32.HC.Z,32"$ +$LK,"GR_Z_ALL",A="FL:::/Kernel/KernelA.HH,3615"$ +$LK,"CMasterBoot",A="FL:::/Kernel/KernelA.HH,2314"$ +$LK,"Fix",A="FL:::/Kernel/EdLite.HC.Z,337",BI=372$ +$LK,"Btr",A="FL:::/Kernel/KernelB.HH,18"$ +$LK,"_LN",A="FL:::/Kernel/KMathA.HC.Z,614"$ +$LK,"OPTf_WARN_UNUSED_VAR",A="FL:::/Kernel/KernelA.HH,1537"$ +$LK,"DOCF_SUPERSCRIPT_MODE",A="FL:::/Kernel/KernelA.HH,1290"$ +$LK,"RFLAGf_CARRY",A="FL:::/Kernel/KernelA.HH,307"$ +$LK,"FAT32FileRead",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,367",BI=373$ +$LK,"DirFilesFlatten",A="FL:::/Kernel/BlkDev/DskDirA.HC.Z,136",BI=374$ +$LK,"FileExtDot",A="FL:::/Kernel/BlkDev/DskStrA.HC.Z,1",BI=375$ +$LK,"IsDbg",A="FL:::/Kernel/KMisc.HC.Z,270",BI=376$ +$LK,"Bts",A="FL:::/Kernel/KernelB.HH,20"$ +$LK,"CMemBlk",A="FL:::/Kernel/KernelA.HH,2858"$ +$LK,"DOCEF_LST",A="FL:::/Kernel/KernelA.HH,1017"$ +$LK,"Man",A="FL:::/Kernel/FunSeg.HC.Z,324",BI=377$ +$LK,"Mem512Alloc",A="FL:::/Kernel/Mem/Mem512.HC.Z,11",BI=378$ +$LK,"TK_SHR_EQU",A="FL:::/Kernel/KernelA.HH,2092"$ +$LK,"CDATE_FREQ",A="FL:::/Kernel/KernelA.HH,551"$ +$LK,"FilesFind",A="FL:::/Kernel/BlkDev/DskFind.HC.Z,30",BI=379$ +$LK,"_HASH_FIND",A="FL:::/Kernel/KHashA.HC.Z,129"$ +$LK,"MSize",A="FL:::/Kernel/Mem/MAllocFree.HC.Z,384"$ +$LK,"CSysFixedArea",A="FL:::/Kernel/KernelA.HH,3466"$ +$LK,"Fmt",A="FL:::/Kernel/BlkDev/DskFmt.HC.Z,53",BI=380$ +$LK,"ExeCmdLine",A="FL:::/Kernel/KTask.HC.Z,282",BI=381$ +$LK,"Log10",A="FL:::/Kernel/KernelB.HH,135"$ +$LK,"FifoI64Flush",A="FL:::/Kernel/KDataTypes.HC.Z,304",BI=382$ +$LK,"InvlPg",A="FL:::/Kernel/KernelB.HH,273"$ +$LK,"CallExtStr",A="FL:::/Kernel/KernelB.HH,46"$ +$LK,"VGAM_GRAPHICS",A="FL:::/Kernel/KernelA.HH,3718"$ +$LK,"DCF_LOCATE_NEAREST",A="FL:::/Kernel/KernelA.HH,3632"$ +$LK,"Ff_ARGPOP",A="FL:::/Kernel/KernelA.HH,849"$ +$LK,"SCF_ALT",A="FL:::/Kernel/KernelA.HH,3536"$ +$LK,"CViewAngles",A="FL:::/Kernel/KernelA.HH,3107"$ +$LK,"CArrayDim",A="FL:::/Kernel/KernelA.HH,782"$ +$LK,"DOCEf_NUM_FLAGS",A="FL:::/Kernel/KernelA.HH,1112"$ +$LK,"Ff_INTERNAL",A="FL:::/Kernel/KernelA.HH,851"$ +$LK,"Drv",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,253",BI=383$ +$LK,"Fclex",A="FL:::/Kernel/KernelB.HH,129"$ +$LK,"MDF_DISP",A="FL:::/Kernel/KernelA.HH,1583"$ +$LK,"MDf_DISP",A="FL:::/Kernel/KernelA.HH,1575"$ +$LK,"Blink",A="FL:::/Kernel/KMisc.HC.Z,130",BI=384$ +$LK,"CDbgInfo",A="FL:::/Kernel/KernelA.HH,718"$ +$LK,"IET_ZEROED_DATA_HEAP",A="FL:::/Kernel/KernelA.HH,414"$ +$LK,"RFLAGf_V8086",A="FL:::/Kernel/KernelA.HH,320"$ +$LK,"IDTET_TRAP",A="FL:::/Kernel/KernelA.HH,282"$ +$LK,"SetRBP",A="FL:::/Kernel/KernelB.HH,248"$ +$LK,"LTGREEN",A="FL:::/Kernel/KernelA.HH,2968"$ +$LK,"DOCf_BLINK",A="FL:::/Kernel/KernelA.HH,1320"$ +$LK,"DOCF_BLINK",A="FL:::/Kernel/KernelA.HH,1283"$ +$LK,"DOCEf_HIGHLIGHT",A="FL:::/Kernel/KernelA.HH,1045"$ +$LK,"DOCEF_HIGHLIGHT",A="FL:::/Kernel/KernelA.HH,1039"$ +$LK,"SysSymImportsResolve",A="FL:::/Kernel/KLoad.HC.Z,55",BI=385$ +$LK,"RS_ATTR_HIDDEN",A="FL:::/Kernel/KernelA.HH,2527"$ +$LK,"TaskEndNow",A="FL:::/Kernel/Sched.HC.Z,285"$ +$LK,"Max",A="FL:::/Kernel/KMathB.HC.Z,18",BI=386$ +$LK,"SYS_HASH_FIND",A="FL:::/Kernel/KHashA.HC.Z,89"$ +$LK,"ROPF_DITHER",A="FL:::/Kernel/KernelA.HH,2953"$ +$LK,"ICF_PREV_DELETED",A="FL:::/Kernel/KernelA.HH,1619"$ +$LK,"WIG_DBL_CLICK",A="FL:::/Kernel/KernelA.HH,1433"$ +$LK,"SYS_SEMA_FIX",A="FL:::/Kernel/KernelA.HH,614"$ +$LK,"ToF64",A="FL:::/Kernel/KernelB.HH,120"$ +$LK,"SYS_PROGRESS2_MAX",A="FL:::/Kernel/KStart32.HC.Z,35"$ +$LK,"CH_SHIFT_SPACE",A="FL:::/Kernel/KernelA.HH,3510"$ +$LK,"ROPBF_DITHER",A="FL:::/Kernel/KernelA.HH,2939"$ +$LK,"FF_WRITE",A="FL:::/Kernel/KernelA.HH,2780"$ +$LK,"SetRAX",A="FL:::/Kernel/KernelB.HH,247"$ +$LK,"Min",A="FL:::/Kernel/KMathB.HC.Z,10",BI=387$ +$LK,"mp_cnt",A="FL:::/Kernel/KernelB.HH,228"$ +$LK,"Exp",A="FL:::/Kernel/KernelB.HH,128"$ +$LK,"DCF_RECORD_EXTENTS",A="FL:::/Kernel/KernelA.HH,3637"$ +$LK,"FAT32FilesFind",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,846",BI=388$ +$LK,"ISO1Cd",A="FL:::/Kernel/BlkDev/FileSysISO.HC.Z,159",BI=389$ +$LK,"_HASH_ADD_AFTER",A="FL:::/Kernel/KHashA.HC.Z,191"$ +$LK,"QueInit",A="FL:::/Kernel/KernelB.HH,66"$ +$LK,"SrvTaskCont",A="FL:::/Kernel/KTask.HC.Z,348",BI=390$ +$LK,"RS_ATTR_READ_ONLY",A="FL:::/Kernel/KernelA.HH,2526"$ +$LK,"ICF_USE_UNSIGNED",A="FL:::/Kernel/KernelA.HH,1598"$ +$LK,"ATAGetDevId",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,163",BI=391$ +$LK,"WBlks",A="FL:::/Kernel/BlkDev/DskBlk.HC.Z,71",BI=392$ +$LK,"DOCT_ERROR",A="FL:::/Kernel/KernelA.HH,942"$ +$LK,"CopySingle",A="FL:::/Kernel/BlkDev/DskCopy.HC.Z,23",BI=393$ +$LK,"EXT_WIN_TO_TOP",A="FL:::/Kernel/KernelA.HH,575"$ +$LK,"MouseIPSet",A="FL:::/Kernel/SerialDev/Mouse.HC.Z,195",BI=394$ +$LK,"ATAPIReadCapacity",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,253",BI=395$ +$LK,"MkDir",A="FL:::/Kernel/BlkDev/DskDirB.HC.Z,165",BI=396$ +$LK,"IsDir",A="FL:::/Kernel/BlkDev/DskDirB.HC.Z,90",BI=397$ +$LK,"SetMSR",A="FL:::/Kernel/KernelB.HH,258"$ +$LK,"ToI64",A="FL:::/Kernel/KernelB.HH,121"$ +$LK,"IET_MAIN",A="FL:::/Kernel/KernelA.HH,415"$ +$LK,"ScanCode2KeyName",A="FL:::/Kernel/SerialDev/Keyboard.HC.Z,248",BI=398$ +$LK,"DOCf_INVERT",A="FL:::/Kernel/KernelA.HH,1321"$ +$LK,"DOCF_INVERT",A="FL:::/Kernel/KernelA.HH,1284"$ +$LK,"sys_heap_limit",A="FL:::/Kernel/KernelB.HH,194"$ +$LK,"FileExtRem",A="FL:::/Kernel/BlkDev/DskStrA.HC.Z,10",BI=399$ +$LK,"Tan",A="FL:::/Kernel/KernelB.HH,118"$ +$LK,"SYS_PROGRESS3_MAX",A="FL:::/Kernel/KStart32.HC.Z,38"$ +$LK,"SUF_REM_LEADING",A="FL:::/Kernel/KernelA.HH,3786"$ +$LK,"OPTf_USE_IMM64",A="FL:::/Kernel/KernelA.HH,1547"$ +$LK,"Raw",A="FL:::/Kernel/KMisc.HC.Z,243",BI=400$ +$LK,"Msg",A="FL:::/Kernel/SrvCmd.HC.Z,257",BI=401$ +$LK,"OPTf_GLBLS_ON_DATA_HEAP",A="FL:::/Kernel/KernelA.HH,1544"$ +$LK,"KbdInit",A="FL:::/Kernel/SerialDev/Keyboard.HC.Z,424",BI=402$ +$LK,"chars_bmp_zero_tab_ff_cr_nl_cursor_dollar",A="FL:::/Kernel/StrA.HC.Z,368"$ +$LK,"ToBool",A="FL:::/Kernel/KernelB.HH,119"$ +$LK,"TASKf_KILL_AFTER_DBG",A="FL:::/Kernel/KernelA.HH,3291"$ +$LK,"IRQMouse",A="FL:::/Kernel/SerialDev/Mouse.HC.Z,13",BI=403$ +$LK,"PUT_HEX_U16",A="FL:::/Kernel/StrA.HC.Z,37"$ +$LK,"PUT_HEX_U32",A="FL:::/Kernel/StrA.HC.Z,30"$ +$LK,"ATAPIStartStop",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,144",BI=404$ +$LK,"_SIGN",A="FL:::/Kernel/KMathA.HC.Z,347"$ +$LK,"REGT_R8",A="FL:::/Kernel/KernelA.HH,739"$ +$LK,"log10_2",A="FL:::/Kernel/KernelA.HH,54"$ +$LK,"PrintErr",A="FL:::/Kernel/StrPrint.HC.Z,906",BI=405$ +$LK,"ROPF_TWO_SIDED",A="FL:::/Kernel/KernelA.HH,2950"$ +$LK,"BDF_READ_CACHE",A="FL:::/Kernel/KernelA.HH,2642"$ +$LK,"SCF_INS",A="FL:::/Kernel/KernelA.HH,3544"$ +$LK,"CPUf_RAN_A_TASK",A="FL:::/Kernel/KernelA.HH,3435"$ +$LK,"BDf_READ_CACHE",A="FL:::/Kernel/KernelA.HH,2652"$ +$LK,"Snd",A="FL:::/Kernel/KMisc.HC.Z,163",BI=406$ +$LK,"GetChar",A="FL:::/Kernel/SerialDev/Message.HC.Z,182",BI=407$ +$LK,"Sin",A="FL:::/Kernel/KernelB.HH,105"$ +$LK,"SPF_PAD_ZERO",A="FL:::/Kernel/KernelA.HH,3911"$ +$LK,"TK_OR_OR",A="FL:::/Kernel/KernelA.HH,2089"$ +$LK,"SYS_PCIBIOS_SERVICE_CALL",A="FL:::/Kernel/PCIBIOS.HC.Z,46"$ +$LK,"Now",A="FL:::/Kernel/KDate.HC.Z,191",BI=408$ +$LK,"Fldcw",A="FL:::/Kernel/KernelB.HH,130"$ +$LK,"TTS_ED_FILENAME",A="FL:::/Kernel/KernelA.HH,3275"$ +$LK,"WIf_FOCUS_TASK_BORDER",A="FL:::/Kernel/KernelA.HH,1455"$ +$LK,"IA32_EFER",A="FL:::/Kernel/KernelA.HH,521"$ +$LK,"SetRSP",A="FL:::/Kernel/KernelB.HH,250"$ +$LK,"Pop",A="FL:::/Kernel/KernelB.HH,245"$ +$LK,"sys_progresses",A="FL:::/Kernel/KernelB.HH,223"$ +$LK,"CMenuEntry",A="FL:::/Kernel/KernelA.HH,3139"$ +$LK,"OC_NOP2",A="FL:::/Kernel/KernelA.HH,1764"$ +$LK,"DOCT_RIGHT_MARGIN",A="FL:::/Kernel/KernelA.HH,911"$ +$LK,"PUT_HEX_U64",A="FL:::/Kernel/StrA.HC.Z,23"$ +$LK,"SYS_KERNEL",A="FL:::/Kernel/KStart16.HC.Z,17"$ +$LK,"RFLAGf_PARITY",A="FL:::/Kernel/KernelA.HH,308"$ +$LK,"SYS_PROGRESS4_MAX",A="FL:::/Kernel/KStart32.HC.Z,41"$ +$LK,"SUF_TO_UPPER",A="FL:::/Kernel/KernelA.HH,3790"$ +$LK,"MBR_PT_REDSEA",A="FL:::/Kernel/KernelA.HH,2707"$ +$LK,"MBR_PT_NTFS",A="FL:::/Kernel/KernelA.HH,2706"$ +$LK,"MouseHandler",A="FL:::/Kernel/SerialDev/Mouse.HC.Z,158",BI=409$ +$LK,"SCF_IP_L_DOWN",A="FL:::/Kernel/KernelA.HH,3541"$ +$LK,"SCf_IP_L_DOWN",A="FL:::/Kernel/KernelA.HH,3526"$ +$LK,"MSG_IP_L_DOWN",A="FL:::/Kernel/KernelA.HH,3230"$ +$LK,"LAPIC_TASK_PRIORITY",A="FL:::/Kernel/KernelA.HH,481"$ +$LK,"REGT_MM",A="FL:::/Kernel/KernelA.HH,745"$ +$LK,"DOCEf_POPUP",A="FL:::/Kernel/KernelA.HH,1105"$ +$LK,"DOCEF_POPUP",A="FL:::/Kernel/KernelA.HH,1019"$ +$LK,"SYS_SEMA_VGA",A="FL:::/Kernel/KernelA.HH,607"$ +$LK,"ODEF_PAUSED",A="FL:::/Kernel/KernelA.HH,241"$ +$LK,"FATNameXSum",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,157",BI=410$ +$LK,"Pow",A="FL:::/Kernel/KernelB.HH,137"$ +$LK,"sys_boot_patch_table_base",A="FL:::/Kernel/KernelB.HH,39"$ +$LK,"SPF_DOLLAR",A="FL:::/Kernel/KernelA.HH,3915"$ +$LK,"WIF_SELF_BORDER",A="FL:::/Kernel/KernelA.HH,1417"$ +$LK,"DOCF_UNDO_DIRTY",A="FL:::/Kernel/KernelA.HH,1292"$ +$LK,"MStrUtil",A="FL:::/Kernel/StrB.HC.Z,58",BI=411$ +$LK,"_D3_CROSS",A="FL:::/Kernel/KMathA.HC.Z,82"$ +$LK,"VGAP_INPUT_STAT",A="FL:::/Kernel/KernelA.HH,3734"$ +$LK,"DOCf_UNDO_DIRTY",A="FL:::/Kernel/KernelA.HH,1329"$ +$LK,"SYS_HEAP_LIMIT",A="FL:::/Kernel/KStart32.HC.Z,7"$ +$LK,"WIf_SELF_BORDER",A="FL:::/Kernel/KernelA.HH,1443"$ +$LK,"text",A="FL:::/Kernel/KGlbls.HC.Z,29"$ +$LK,"ATA_READ_NATIVE_MAX_EXT",A="FL:::/Kernel/KernelA.HH,2262"$ +$LK,"MPrintQ",A="FL:::/Kernel/StrPrint.HC.Z,56",BI=412$ +$LK,"MHeapCtrl",A="FL:::/Kernel/Mem/MAllocFree.HC.Z,386"$ +$LK,"CCF_CMD_LINE",A="FL:::/Kernel/KernelA.HH,2127"$ +$LK,"RECALCt_FIND_CURSOR",A="FL:::/Kernel/KernelA.HH,1346"$ +$LK,"SYS_SEMA_SND",A="FL:::/Kernel/KernelA.HH,598"$ +$LK,"CCF_RAX",A="FL:::/Kernel/KernelA.HH,2156"$ +$LK,"DskCacheInvalidate",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,211",BI=413$ +$LK,"DOCG_BL_IV_UL",A="FL:::/Kernel/KernelA.HH,951"$ +$LK,"HashSingleTableFind",A="FL:::/Kernel/KHashA.HC.Z,257"$ +$LK,"sys_data_bp",A="FL:::/Kernel/KernelB.HH,190"$ +$LK,"SYS_PCI_BUSES",A="FL:::/Kernel/KStart16.HC.Z,36"$ +$LK,"sys_heap_base",A="FL:::/Kernel/KernelB.HH,193"$ +$LK,"_CLAMP_I64",A="FL:::/Kernel/KUtils.HC.Z,121"$ +$LK,"VGAP_MISC_OUTPUT",A="FL:::/Kernel/KernelA.HH,3725"$ +$LK,"BDf_READ_ONLY_OVERRIDE",A="FL:::/Kernel/KernelA.HH,2650"$ +$LK,"Spaces2Tabs",A="FL:::/Kernel/StrA.HC.Z,477",BI=414$ +$LK,"Drv2Let",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,153",BI=415$ +$LK,"ROPBF_TWO_SIDED",A="FL:::/Kernel/KernelA.HH,2938"$ +$LK,"MEM_E820_ENTRY_SIZE",A="FL:::/Kernel/KernelA.HH,357"$ +$LK,"KDRawPutS",A="FL:::/Kernel/KeyDev.HC.Z,97",BI=416$ +$LK,"Sqr",A="FL:::/Kernel/KernelB.HH,106"$ +$LK,"REG_RDI",A="FL:::/Kernel/KernelA.HH,1783"$ +$LK,"REG_ALLOC",A="FL:::/Kernel/KernelA.HH,1788"$ +$LK,"DOCf_SUPERSCRIPT_MODE",A="FL:::/Kernel/KernelA.HH,1327"$ +$LK,"SrvCmdsHandler",A="FL:::/Kernel/SrvCmd.HC.Z,350",BI=417$ +$LK,"progress1_max",A="FL:::/Kernel/KernelB.HH,209"$ +$LK,"CCF_ARRAY",A="FL:::/Kernel/KernelA.HH,2155"$ +$LK,"REG_RBP",A="FL:::/Kernel/KernelA.HH,1781"$ +$LK,"DOCEF_FILTER_SKIP",A="FL:::/Kernel/KernelA.HH,1021"$ +$LK,"FifoU8Flush",A="FL:::/Kernel/KDataTypes.HC.Z,219",BI=418$ +$LK,"SYS_PROGRESSES",A="FL:::/Kernel/KStart32.HC.Z,31"$ +$LK,"SUF_REM_SPACES",A="FL:::/Kernel/KernelA.HH,3788"$ +$LK,"CCF_PMT",A="FL:::/Kernel/KernelA.HH,2128"$ +$LK,"DOCEf_FILTER_SKIP",A="FL:::/Kernel/KernelA.HH,1107"$ +$LK,"DskCacheHash",A="FL:::/Kernel/BlkDev/DskCache.HC.Z,40",BI=419$ +$LK,"SCF_NUM",A="FL:::/Kernel/KernelA.HH,3538"$ +$LK,"ACD_DEF_FILENAME",A="FL:::/Kernel/KernelA.HH,1499"$ +$LK,"fp_doc_put",A="FL:::/Kernel/KGlbls.HC.Z,33"$ +$LK,"DskCacheFind",A="FL:::/Kernel/BlkDev/DskCache.HC.Z,64",BI=420$ +$LK,"IsRaw",A="FL:::/Kernel/KMisc.HC.Z,250",BI=421$ +$LK,"TK_DBL_COLON",A="FL:::/Kernel/KernelA.HH,2081"$ +$LK,"ATAPIReadTrackInfo",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,277",BI=422$ +$LK,"CATARep",A="FL:::/Kernel/KernelA.HH,2251"$ +$LK,"REG_RAX",A="FL:::/Kernel/KernelA.HH,1776"$ +$LK,"ATAReadBlks",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,350",BI=423$ +$LK,"D3AddEqu",A="FL:::/Kernel/KernelB.HH,146"$ +$LK,"ToUpper",A="FL:::/Kernel/KernelB.HH,58"$ +$LK,"REG_RBX",A="FL:::/Kernel/KernelA.HH,1779"$ +$LK,"SCR_DONE",A="FL:::/Kernel/SrvCmd.HC.Z,263"$ +$LK,"MDG_MASK",A="FL:::/Kernel/KernelA.HH,1586"$ +$LK,"ACD_EXTRA_CHAR",A="FL:::/Kernel/KernelA.HH,1519"$ +$LK,"Reboot",A="FL:::/Kernel/KEnd.HC.Z,121",BI=424$ +$LK,"acd",A="FL:::/Kernel/KGlbls.HC.Z,17"$ +$LK,"REG_RCX",A="FL:::/Kernel/KernelA.HH,1777"$ +$LK,"Ff_DOT_DOT_DOT",A="FL:::/Kernel/KernelA.HH,853"$ +$LK,"CHashClass",A="FL:::/Kernel/KernelA.HH,833"$ +$LK,"ZERO_BUF_SIZE",A="FL:::/Kernel/BlkDev/DskBlk.HC.Z,1"$ +$LK,"LoadKernel",A="FL:::/Kernel/KLoad.HC.Z,240",BI=425$ +$LK,"SCF_KEY_UP",A="FL:::/Kernel/KernelA.HH,3533"$ +$LK,"SCf_KEY_UP",A="FL:::/Kernel/KernelA.HH,3518"$ +$LK,"MSG_IP_R_D_DOWN",A="FL:::/Kernel/KernelA.HH,3236"$ +$LK,"ICF_BY_VAL",A="FL:::/Kernel/KernelA.HH,1602"$ +$LK,"REG_RDX",A="FL:::/Kernel/KernelA.HH,1778"$ +$LK,"ATAPIReadBlks",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,413",BI=426$ +$LK,"REG_RIP",A="FL:::/Kernel/KernelA.HH,1785"$ +$LK,"DOCEF_FROM_START",A="FL:::/Kernel/KernelA.HH,1001"$ +$LK,"SEMA_STRUCT_SIZE",A="FL:::/Kernel/KernelA.HH,584"$ +$LK,"SCR_CONT",A="FL:::/Kernel/SrvCmd.HC.Z,264"$ +$LK,"progress2_max",A="FL:::/Kernel/KernelB.HH,213"$ +$LK,"DOCEf_FROM_START",A="FL:::/Kernel/KernelA.HH,1089"$ +$LK,"SYS_SEMA_TMBEAT",A="FL:::/Kernel/KernelA.HH,613"$ +$LK,"RLF_WINMGR",A="FL:::/Kernel/KernelA.HH,470"$ +$LK,"RLf_WINMGR",A="FL:::/Kernel/KernelA.HH,451"$ +$LK,"C:/Doc/D3.DD.Z",A="FL:::/Kernel/KernelB.HH,145"$ +$LK,"SUF_SCALE_INDENT",A="FL:::/Kernel/KernelA.HH,3794"$ +$LK,"CT_7_BIT",A="FL:::/Kernel/KernelA.HH,3743"$ +$LK,"PUSH_REGS",A="FL:::/Kernel/KernelA.HH,1769"$ +$LK,"MAX_I8",A="FL:::/Kernel/KernelA.HH,24"$ +$LK,"KbdMouseHandler",A="FL:::/Kernel/SerialDev/Mouse.HC.Z,236",BI=427$ +$LK,"Color2Str",A="FL:::/Kernel/KDefine.HC.Z,127",BI=428$ +$LK,"MAllocIdent",A="FL:::/Kernel/Mem/MAllocFree.HC.Z,407",BI=429$ +$LK,"EDF_COLLAPSE",A="FL:::/Kernel/KernelA.HH,1247"$ +$LK,"LAPIC_DFR",A="FL:::/Kernel/KernelA.HH,486"$ +$LK,"CDATE_BASE_DAY_OF_WEEK",A="FL:::/Kernel/KernelA.HH,184"$ +$LK,"StrFirstOcc",A="FL:::/Kernel/StrA.HC.Z,572",BI=430$ +$LK,"MSG_NULL",A="FL:::/Kernel/KernelA.HH,3225"$ +$LK,"CCF_QUESTION_HELP",A="FL:::/Kernel/KernelA.HH,2130"$ +$LK,"EDf_COLLAPSE",A="FL:::/Kernel/KernelA.HH,1253"$ +$LK,"MPrintq",A="FL:::/Kernel/StrPrint.HC.Z,113",BI=431$ +$LK,"AMAllocIdent",A="FL:::/Kernel/Mem/MAllocFree.HC.Z,418",BI=432$ +$LK,"MEM_DFT_STK",A="FL:::/Kernel/KernelA.HH,2887"$ +$LK,"sys_font_cyrillic",A="FL:::/Kernel/FontCyrillic.HC.Z,3"$ +$LK,"SYS_FOCUS_TASK",A="FL:::/Kernel/KStart32.HC.Z,45"$ +$LK,"DYING_JIFFIES",A="FL:::/Kernel/KernelA.HH,3311"$ +$LK,"dbg",A="FL:::/Kernel/KGlbls.HC.Z,21"$ +$LK,"QSort",A="FL:::/Kernel/QSort.HC.Z,85",BI=433$ +$LK,"OutU32",A="FL:::/Kernel/KernelB.HH,79"$ +$LK,"OutU16",A="FL:::/Kernel/KernelB.HH,78"$ +$LK,"SYS_SEMA_JUST_PUMP_MSGS",A="FL:::/Kernel/KernelA.HH,612"$ +$LK,"LAPIC_ICR_HIGH",A="FL:::/Kernel/KernelA.HH,496"$ +$LK,"LMF_IGNORE_CASE",A="FL:::/Kernel/KernelA.HH,3804"$ +$LK,"SFF_IGNORE_CASE",A="FL:::/Kernel/KernelA.HH,3798"$ +$LK,"HashRemDel",A="FL:::/Kernel/KHashA.HC.Z,264"$ +$LK,"REG_RSI",A="FL:::/Kernel/KernelA.HH,1782"$ +$LK,"HashAdd",A="FL:::/Kernel/KHashA.HC.Z,262"$ +$LK,"mp_cnt_lock",A="FL:::/Kernel/KernelB.HH,230"$ +$LK,"MLF_DOT_DOT_DOT",A="FL:::/Kernel/KernelA.HH,778"$ +$LK,"IsSuspended",A="FL:::/Kernel/KTask.HC.Z,71",BI=434$ +$LK,"CAlloc",A="FL:::/Kernel/Mem/MAllocFree.HC.Z,395",BI=435$ +$LK,"BDF_INITIALIZED",A="FL:::/Kernel/KernelA.HH,2638"$ +$LK,"CAsmUnresolvedRef",A="FL:::/Kernel/KernelA.HH,1856"$ +$LK,"BDf_INITIALIZED",A="FL:::/Kernel/KernelA.HH,2648"$ +$LK,"DOCT_SPRITE",A="FL:::/Kernel/KernelA.HH,937"$ +$LK,"WClustersBlks",A="FL:::/Kernel/BlkDev/DskCluster.HC.Z,92",BI=436$ +$LK,"RClustersBlks",A="FL:::/Kernel/BlkDev/DskCluster.HC.Z,46",BI=437$ +$LK,"sys_neg_pows_lets",A="FL:::/Kernel/StrPrint.HC.Z,201"$ +$LK,"progress3_max",A="FL:::/Kernel/KernelB.HH,217"$ +$LK,"SqrI64",A="FL:::/Kernel/KernelB.HH,107"$ +$LK,"BDF_INIT_IN_PROGRESS",A="FL:::/Kernel/KernelA.HH,2644"$ +$LK,"OPTF_ECHO",A="FL:::/Kernel/KernelA.HH,1549"$ +$LK,"OPTf_ECHO",A="FL:::/Kernel/KernelA.HH,1535"$ +$LK,"LAPIC_EOI",A="FL:::/Kernel/KernelA.HH,484"$ +$LK,"sys_pos_pows_lets",A="FL:::/Kernel/StrPrint.HC.Z,200"$ +$LK,"QueSize",A="FL:::/Kernel/KDataTypes.HC.Z,76",BI=438$ +$LK,"CT_8_BIT",A="FL:::/Kernel/KernelA.HH,3744"$ +$LK,"REG_RSP",A="FL:::/Kernel/KernelA.HH,1780"$ +$LK,"CtrlAltDel",A="FL:::/Kernel/KeyDev.HC.Z,128",BI=439$ +$LK,"CTRLF_CAPTURE_LEFT_IP",A="FL:::/Kernel/KernelA.HH,3094"$ +$LK,"LFSF_DEFINE",A="FL:::/Kernel/KernelA.HH,2036"$ +$LK,"OPTf_WARN_HEADER_MISMATCH",A="FL:::/Kernel/KernelA.HH,1540"$ +$LK,"BLK_SIZE_BITS",A="FL:::/Kernel/KernelA.HH,2296"$ +$LK,"AOT_BIN_BLK_BITS",A="FL:::/Kernel/KernelA.HH,1797"$ +$LK,"HTT_FUN",A="FL:::/Kernel/KernelA.HH,688"$ +$LK,"I_DIV_ZERO",A="FL:::/Kernel/KernelA.HH,286"$ +$LK,"SrvCtrlInit",A="FL:::/Kernel/SrvCmd.HC.Z,18",BI=440$ +$LK,"DOCEF_DEFINE",A="FL:::/Kernel/KernelA.HH,968"$ +$LK,"SPF_LEFT_JUSTIFY",A="FL:::/Kernel/KernelA.HH,3912"$ +$LK,"DOCEf_DEFINE",A="FL:::/Kernel/KernelA.HH,1056"$ +$LK,"HeapCtrlInit",A="FL:::/Kernel/Mem/HeapCtrl.HC.Z,1",BI=441$ +$LK,"progress1",A="FL:::/Kernel/KernelB.HH,206"$ +$LK,"Floor",A="FL:::/Kernel/KernelB.HH,131"$ +$LK,"CIPStateGlbls",A="FL:::/Kernel/KernelA.HH,3045"$ +$LK,"SYSf_CTRL_ALT_C",A="FL:::/Kernel/KernelA.HH,618"$ +$LK,"progress2",A="FL:::/Kernel/KernelB.HH,210"$ +$LK,"_CLAMP_U64",A="FL:::/Kernel/KUtils.HC.Z,133"$ +$LK,"progress3",A="FL:::/Kernel/KernelB.HH,214"$ +$LK,"MPN_VECT",A="FL:::/Kernel/KernelA.HH,505"$ +$LK,"MAX_U8",A="FL:::/Kernel/KernelA.HH,26"$ +$LK,"RAWDR_COL",A="FL:::/Kernel/KDbg.HC.Z,289"$ +$LK,"progress4",A="FL:::/Kernel/KernelB.HH,218"$ +$LK,"CtrlAltCBSet",A="FL:::/Kernel/KeyDev.HC.Z,178",BI=442$ +$LK,"SysTimerRead",A="FL:::/Kernel/KMisc.HC.Z,61",BI=443$ +$LK,"dev",A="FL:::/Kernel/KGlbls.HC.Z,22"$ +$LK,"MSG_IP_L_D_UP",A="FL:::/Kernel/KernelA.HH,3233"$ +$LK,"FunSegCacheFind",A="FL:::/Kernel/FunSeg.HC.Z,114",BI=444$ +$LK,"HTT_REG",A="FL:::/Kernel/KernelA.HH,694"$ +$LK,"StrFirstRem",A="FL:::/Kernel/StrA.HC.Z,582",BI=445$ +$LK,"SYS_VAR_INIT_VAL",A="FL::/Temp.DD.Z,1"$ +$LK,"DCF_COMPRESSED",A="FL:::/Kernel/KernelA.HH,3619"$ +$LK,"ans",A="FL:::/Kernel/KernelA.HH,3413"$ +$LK,"ICF_DEL_PREV_INS",A="FL:::/Kernel/KernelA.HH,1618"$ +$LK,"LAPIC_LDR",A="FL:::/Kernel/KernelA.HH,487"$ +$LK,"BptFind",A="FL:::/Kernel/KDbg.HC.Z,344",BI=446$ +$LK,"kbd",A="FL:::/Kernel/KGlbls.HC.Z,25"$ +$LK,"progress4_max",A="FL:::/Kernel/KernelB.HH,221"$ +$LK,"MouseUpdatePost",A="FL:::/Kernel/SerialDev/Mouse.HC.Z,126",BI=447$ +$LK,"HashDel",A="FL:::/Kernel/KHashB.HC.Z,59",BI=448$ +$LK,"CKbdStateGlbls",A="FL:::/Kernel/KernelA.HH,3002"$ +$LK,"sys_font_std",A="FL:::/Kernel/FontStd.HC.Z,3"$ +$LK,"LinkedLstCopy",A="FL:::/Kernel/KDataTypes.HC.Z,11",BI=449$ +$LK,"IP_NULL",A="FL:::/Kernel/KernelA.HH,3043"$ +$LK,"MDF_NULL",A="FL:::/Kernel/KernelA.HH,1579"$ +$LK,"SYS_SEMA_DEV_MEM",A="FL:::/Kernel/KernelA.HH,606"$ +$LK,"ICF_A1_WAS_STK",A="FL:::/Kernel/KernelA.HH,1607"$ +$LK,"Let2Drv",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,177",BI=450$ +$LK,"fat_long_name_map",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,183"$ +$LK,"DskCacheInit",A="FL:::/Kernel/BlkDev/DskCache.HC.Z,1",BI=451$ +$LK,"CCF_NO_ABSS",A="FL:::/Kernel/KernelA.HH,2162"$ +$LK,"DOC_COLOR_MACRO",A="FL:::/Kernel/KernelA.HH,1137"$ +$LK,"LAPIC_LOG_DST",A="FL:::/Kernel/KernelA.HH,485"$ +$LK,"RLF_ADAM_SERVER",A="FL:::/Kernel/KernelA.HH,474"$ +$LK,"RClusters",A="FL:::/Kernel/BlkDev/DskCluster.HC.Z,87",BI=452$ +$LK,"VGAP_IDX",A="FL:::/Kernel/KernelA.HH,3726"$ +$LK,"ISO1CDirFill",A="FL:::/Kernel/BlkDev/FileSysISO.HC.Z,56",BI=453$ +$LK,"RLf_ADAM_SERVER",A="FL:::/Kernel/KernelA.HH,455"$ +$LK,"SCR_EXIT",A="FL:::/Kernel/SrvCmd.HC.Z,265"$ +$LK,"QueDel",A="FL:::/Kernel/KDataTypes.HC.Z,41",BI=454$ +$LK,"ICF_DONT_RESTORE",A="FL:::/Kernel/KernelA.HH,1620"$ +$LK,"RedSeaDirNew",A="FL:::/Kernel/BlkDev/FileSysRedSea.HC.Z,352",BI=455$ +$LK,"IET_REL64_EXPORT",A="FL:::/Kernel/KernelA.HH,408"$ +$LK,"IET_REL32_EXPORT",A="FL:::/Kernel/KernelA.HH,406"$ +$LK,"CExcept",A="FL:::/Kernel/KernelA.HH,3165"$ +$LK,"QueInsRev",A="FL:::/Kernel/KernelB.HH,70"$ +$LK,"SYSf_CTRL_ALT_X",A="FL:::/Kernel/KernelA.HH,619"$ +$LK,"SYS_EXTERN_TABLE",A="FL:::/Kernel/KStart32.HC.Z,25"$ +$LK,"FUF_CLUSTER_ORDER",A="FL:::/Kernel/KernelA.HH,2614"$ +$LK,"DOCT_HTML_CODE",A="FL:::/Kernel/KernelA.HH,941"$ +$LK,"LAPIC_IRR",A="FL:::/Kernel/KernelA.HH,494"$ +$LK,"chars_bmp_getkey",A="FL:::/Kernel/StrA.HC.Z,371"$ +$LK,"sys_run_level",A="FL:::/Kernel/KernelB.HH,41"$ +$LK,"JIFFY_FREQ",A="FL:::/Kernel/KernelA.HH,550"$ +$LK,"COrder2D3",A="FL:::/Kernel/KernelA.HH,200"$ +$LK,"TaskRegAddr",A="FL:::/Kernel/KDbg.HC.Z,266",BI=456$ +$LK,"DCSF_COMPRESSED",A="FL:::/Kernel/KernelA.HH,3641"$ +$LK,"LAPIC_ISR",A="FL:::/Kernel/KernelA.HH,492"$ +$LK,"c32_eflags",A="FL:::/Kernel/PCIBIOS.HC.Z,158"$ +$LK,"Pow10",A="FL:::/Kernel/KernelB.HH,138"$ +$LK,"ATA_WRITE_MULTI_EXT",A="FL:::/Kernel/KernelA.HH,2268"$ +$LK,"CCF_PREDEC",A="FL:::/Kernel/KernelA.HH,2154"$ +$LK,"inf",A="FL:::/Kernel/KernelA.HH,47"$ +$LK,"MIN_I8",A="FL:::/Kernel/KernelA.HH,23"$ +$LK,"sys_macro_head",A="FL:::/Kernel/KGlbls.HC.Z,4"$ +$LK,"XTalk",A="FL:::/Kernel/SrvCmd.HC.Z,446",BI=457$ +$LK,"SYS_ENTER_LONG_MODE",A="FL:::/Kernel/KStart64.HC.Z,44"$ +$LK,"DOCEf_LEFT_AUTO",A="FL:::/Kernel/KernelA.HH,1072"$ +$LK,"DOCEF_LEFT_AUTO",A="FL:::/Kernel/KernelA.HH,984"$ +$LK,"eps",A="FL:::/Kernel/KernelA.HH,57"$ +$LK,"LstSub",A="FL:::/Kernel/StrA.HC.Z,402",BI=458$ +$LK,"RLF_PATCHED",A="FL:::/Kernel/KernelA.HH,460"$ +$LK,"TaskDerivedValsUpdate",A="FL:::/Kernel/KTask.HC.Z,266",BI=459$ +$LK,"_HASH_ADD",A="FL:::/Kernel/KHashA.HC.Z,170"$ +$LK,"FRBlks",A="FL:::/Kernel/BlkDev/DskCFile.HC.Z,129",BI=460$ +$LK,"__TIME__",A="FL:::/Kernel/KernelA.HH,2026"$ +$LK,"RLf_PATCHED",A="FL:::/Kernel/KernelA.HH,441"$ +$LK,"FUf_CLUSTER_ORDER",A="FL:::/Kernel/KernelA.HH,2588"$ +$LK,"ACD_WORD_FILENAME",A="FL:::/Kernel/KernelA.HH,1498"$ +$LK,"ATTRf_BLINK",A="FL:::/Kernel/KernelA.HH,894"$ +$LK,"ATTRF_BLINK",A="FL:::/Kernel/KernelA.HH,889"$ +$LK,"XchgU8",A="FL:::/Kernel/KernelB.HH,263"$ +$LK,"TTS_TASK_NAME",A="FL:::/Kernel/KernelA.HH,3274"$ +$LK,"CKernel",A="FL:::/Kernel/KernelA.HH,418"$ +$LK,"IET_IMM_I64",A="FL:::/Kernel/KernelA.HH,403"$ +$LK,"log2_10",A="FL:::/Kernel/KernelA.HH,52"$ +$LK,"LTBLUE",A="FL:::/Kernel/KernelA.HH,2967"$ +$LK,"FAT32AllocClusters",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,456",BI=461$ +$LK,"DOCEf_TOP_Y",A="FL:::/Kernel/KernelA.HH,1078"$ +$LK,"DOCEF_TOP_Y",A="FL:::/Kernel/KernelA.HH,990"$ +$LK,"_CALLEXTNUM",A="FL:::/Kernel/KUtils.HC.Z,362"$ +$LK,"SCF_KEY_DESC",A="FL:::/Kernel/KernelA.HH,3546"$ +$LK,"SCf_KEY_DESC",A="FL:::/Kernel/KernelA.HH,3531"$ +$LK,"MSG_CMD",A="FL:::/Kernel/KernelA.HH,3226"$ +$LK,"IDTET_IRQ",A="FL:::/Kernel/KernelA.HH,281"$ +$LK,"CCF_LOCAL",A="FL:::/Kernel/KernelA.HH,2148"$ +$LK,"QueCnt",A="FL:::/Kernel/KDataTypes.HC.Z,65",BI=462$ +$LK,"chars_bmp_alpha",A="FL:::/Kernel/StrA.HC.Z,325"$ +$LK,"SwapI64",A="FL:::/Kernel/KernelB.HH,111"$ +$LK,"SqrU64",A="FL:::/Kernel/KernelB.HH,108"$ +$LK,"OPTf_NO_BUILTIN_CONST",A="FL:::/Kernel/KernelA.HH,1546"$ +$LK,"HTG_SRC_SYM",A="FL:::/Kernel/KernelA.HH,712"$ +$LK,"LAPIC_LVT_THERMAL",A="FL:::/Kernel/KernelA.HH,499"$ +$LK,"RFLAGf_IOPL0",A="FL:::/Kernel/KernelA.HH,316"$ +$LK,"IntsInit",A="FL:::/Kernel/KInts.HC.Z,129",BI=463$ +$LK,"_XCHG_U8",A="FL:::/Kernel/KUtils.HC.Z,208"$ +$LK,"DOCEF_CHECK_COLLAPSABLE",A="FL:::/Kernel/KernelA.HH,1006"$ +$LK,"RFLAGf_IOPL1",A="FL:::/Kernel/KernelA.HH,317"$ +$LK,"FAT32FilesDel",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,726",BI=464$ +$LK,"DOCT_MENU_VAL",A="FL:::/Kernel/KernelA.HH,934"$ +$LK,"Bcd2Bin",A="FL:::/Kernel/KDate.HC.Z,123",BI=465$ +$LK,"CAllocAligned",A="FL:::/Kernel/Mem/MAllocFree.HC.Z,434",BI=466$ +$LK,"MAllocAligned",A="FL:::/Kernel/Mem/MAllocFree.HC.Z,423",BI=467$ +$LK,"ext",A="FL:::/Kernel/KernelB.HH,53"$ +$LK,"FUN_SEG_CACHE_SIZE",A="FL:::/Kernel/KernelA.HH,3844"$ +$LK,"ACf_INIT_IN_PROGRESS",A="FL:::/Kernel/KernelA.HH,1483"$ +$LK,"RawDm",A="FL:::/Kernel/KDbg.HC.Z,250",BI=468$ +$LK,"ICf_DONT_POP_FLOAT0",A="FL:::/Kernel/KernelA.HH,1613"$ +$LK,"DskCacheAdd",A="FL:::/Kernel/BlkDev/DskCache.HC.Z,76",BI=469$ +$LK,"MPNMInt",A="FL:::/Kernel/MultiProc.HC.Z,159",BI=470$ +$LK,"_MSIZE2",A="FL:::/Kernel/Mem/MAllocFree.HC.Z,353"$ +$LK,"LTPURPLE",A="FL:::/Kernel/KernelA.HH,2971"$ +$LK,"RawDr",A="FL:::/Kernel/KDbg.HC.Z,291",BI=471$ +$LK,"StrICmp",A="FL:::/Kernel/StrA.HC.Z,311"$ +$LK,"ATAR0_DATA",A="FL:::/Kernel/KernelA.HH,2277"$ +$LK,"MIN_U8",A="FL:::/Kernel/KernelA.HH,25"$ +$LK,"OPTf_TRACE",A="FL:::/Kernel/KernelA.HH,1536"$ +$LK,"HTG_FLAGS_MASK",A="FL:::/Kernel/KernelA.HH,710"$ +$LK,"DirFilesSort",A="FL:::/Kernel/BlkDev/DskDirA.HC.Z,92",BI=472$ +$LK,"HashLstAdd",A="FL:::/Kernel/KHashB.HC.Z,185",BI=473$ +$LK,"ACAlloc",A="FL:::/Kernel/Mem/MAllocFree.HC.Z,402",BI=474$ +$LK,"SYS_RUN_LEVEL",A="FL:::/Kernel/KStart16.HC.Z,26"$ +$LK,"SCF_SCROLL",A="FL:::/Kernel/KernelA.HH,3539"$ +$LK,"SCf_SCROLL",A="FL:::/Kernel/KernelA.HH,3524"$ +$LK,"BDf_INIT_IN_PROGRESS",A="FL:::/Kernel/KernelA.HH,2654"$ +$LK,"TK_SUB_EQU",A="FL:::/Kernel/KernelA.HH,2099"$ +$LK,"TK_DIV_EQU",A="FL:::/Kernel/KernelA.HH,2094"$ +$LK,"OC_BPT",A="FL:::/Kernel/KernelA.HH,1761"$ +$LK,"DOCF_HIDE_CURSOR",A="FL:::/Kernel/KernelA.HH,1268"$ +$LK,"IOREDTAB",A="FL:::/Kernel/KernelA.HH,515"$ +$LK,"Fstcw",A="FL:::/Kernel/KernelB.HH,132"$ +$LK,"MSG_IP_L_DOWN_UP",A="FL:::/Kernel/KernelA.HH,3240"$ +$LK,"LAPIC_TMR",A="FL:::/Kernel/KernelA.HH,493"$ +$LK,"C32_EFLAGS",A="FL:::/Kernel/PCIBIOS.HC.Z,64"$ +$LK,"sys_compile_time",A="FL:::/Kernel/KernelB.HH,201"$ +$LK,"_D3_DIV_EQU",A="FL:::/Kernel/KMathA.HC.Z,289"$ +$LK,"_D3_SUB_EQU",A="FL:::/Kernel/KMathA.HC.Z,256"$ +$LK,"TASKf_SUSPENDED",A="FL:::/Kernel/KernelA.HH,3281"$ +$LK,"FUF_DIFF",A="FL:::/Kernel/KernelA.HH,2596"$ +$LK,"FUf_DIFF",A="FL:::/Kernel/KernelA.HH,2570"$ +$LK,"DOCf_HIDE_CURSOR",A="FL:::/Kernel/KernelA.HH,1304"$ +$LK,"CHashImport",A="FL:::/Kernel/KernelA.HH,764"$ +$LK,"CMT_LABEL",A="FL:::/Kernel/KernelA.HH,1687"$ +$LK,"C32_ADD",A="FL:::/Kernel/PCIBIOS.HC.Z,122"$ +$LK,"MEM_PAGE_BITS",A="FL:::/Kernel/KernelA.HH,2876"$ +$LK,"MBS_USED_SIGNATURE_VAL",A="FL:::/Kernel/KernelA.HH,2856"$ +$LK,"HeapCtrlDel",A="FL:::/Kernel/Mem/HeapCtrl.HC.Z,15",BI=475$ +$LK,"_CALLEXTSTR",A="FL:::/Kernel/KUtils.HC.Z,392"$ +$LK,"FF_USE_OLD_DATETIME",A="FL:::/Kernel/KernelA.HH,2785"$ +$LK,"BDT_ISO_FILE_READ",A="FL:::/Kernel/KernelA.HH,2632"$ +$LK,"CCf_PAREN",A="FL:::/Kernel/KernelA.HH,2164"$ +$LK,"CCF_PAREN",A="FL:::/Kernel/KernelA.HH,2163"$ +$LK,"ACD_BLK_SIZE",A="FL:::/Kernel/KernelA.HH,1512"$ +$LK,"CSysLimitBase",A="FL:::/Kernel/KernelA.HH,349"$ +$LK,"DVD_BLK_SIZE",A="FL:::/Kernel/KernelA.HH,2298"$ +$LK,"QueIns",A="FL:::/Kernel/KernelB.HH,68"$ +$LK,"CGrSym",A="FL:::/Kernel/KernelA.HH,3646"$ +$LK,"ATAR0_FEAT",A="FL:::/Kernel/KernelA.HH,2278"$ +$LK,"RLF_HOME",A="FL:::/Kernel/KernelA.HH,472"$ +$LK,"RLf_HOME",A="FL:::/Kernel/KernelA.HH,453"$ +$LK,"snd",A="FL:::/Kernel/KGlbls.HC.Z,28"$ +$LK,"SC_ENTER",A="FL:::/Kernel/KernelA.HH,3554"$ +$LK,"LTCYAN",A="FL:::/Kernel/KernelA.HH,2969"$ +$LK,"FUF_WHOLE_LABELS_AFTER",A="FL:::/Kernel/KernelA.HH,2619"$ +$LK,"CCF_PREINC",A="FL:::/Kernel/KernelA.HH,2153"$ +$LK,"HTT_IMPORT_SYS_SYM",A="FL:::/Kernel/KernelA.HH,683"$ +$LK,"HTT_EXPORT_SYS_SYM",A="FL:::/Kernel/KernelA.HH,682"$ +$LK,"FunSegCacheAdd",A="FL:::/Kernel/FunSeg.HC.Z,92",BI=476$ +$LK,"CTRLT_GENERIC",A="FL:::/Kernel/KernelA.HH,3087"$ +$LK,"CCF_KEEP_AT_SIGN",A="FL:::/Kernel/KernelA.HH,2138"$ +$LK,"RS_ATTR_DIR",A="FL:::/Kernel/KernelA.HH,2530"$ +$LK,"CCF_POSTDEC",A="FL:::/Kernel/KernelA.HH,2152"$ +$LK,"DirContextDel",A="FL:::/Kernel/BlkDev/DskDirContext.HC.Z,1",BI=477$ +$LK,"StrPrintFlags",A="FL:::/Kernel/StrB.HC.Z,177",BI=478$ +$LK,"TK_IFNDEF",A="FL:::/Kernel/KernelA.HH,2102"$ +$LK,"CMT_FLOAT_CONSTS",A="FL:::/Kernel/KernelA.HH,1692"$ +$LK,"CBinFile",A="FL:::/Kernel/KernelA.HH,372"$ +$LK,"SpawnQue",A="FL:::/Kernel/MultiProc.HC.Z,248",BI=479$ +$LK,"LAPIC_SVR",A="FL:::/Kernel/KernelA.HH,490"$ +$LK,"CMouseStateGlbls",A="FL:::/Kernel/KernelA.HH,3023"$ +$LK,"StrPrintFunSeg",A="FL:::/Kernel/FunSeg.HC.Z,134",BI=480$ +$LK,"ISO1_ATTR_DIR",A="FL:::/Kernel/KernelA.HH,2522"$ +$LK,"HashVal",A="FL:::/Kernel/KHashB.HC.Z,9",BI=481$ +$LK,"DOCEF_DFT_RAW_TYPE",A="FL:::/Kernel/KernelA.HH,1025"$ +$LK,"IET_IMM_U32",A="FL:::/Kernel/KernelA.HH,401"$ +$LK,"IET_IMM_U16",A="FL:::/Kernel/KernelA.HH,399"$ +$LK,"QueRem",A="FL:::/Kernel/KernelB.HH,72"$ +$LK,"TASKf_DISABLE_BPTS",A="FL:::/Kernel/KernelA.HH,3286"$ +$LK,"BDT_NULL",A="FL:::/Kernel/KernelA.HH,2629"$ +$LK,"FarCall32",A="FL:::/Kernel/PCIBIOS.HC.Z,161"$ +$LK,"SCF_NO_SHIFT",A="FL:::/Kernel/KernelA.HH,3545"$ +$LK,"SCf_NO_SHIFT",A="FL:::/Kernel/KernelA.HH,3530"$ +$LK,"ARGT_MOFFS32",A="FL:::/Kernel/KernelA.HH,1916"$ +$LK,"ARGT_MOFFS16",A="FL:::/Kernel/KernelA.HH,1915"$ +$LK,"sys_heap_dbg",A="FL:::/Kernel/KernelB.HH,180"$ +$LK,"FUF_SINGLE",A="FL:::/Kernel/KernelA.HH,2605"$ +$LK,"FUf_SINGLE",A="FL:::/Kernel/KernelA.HH,2579"$ +$LK,"DOCEf_DFT_RAW_TYPE",A="FL:::/Kernel/KernelA.HH,1111"$ +$LK,"DVDImageWriteTask",A="FL:::/Kernel/BlkDev/DskCDDVD.HC.Z,117",BI=482$ +$LK,"LTGRAY",A="FL:::/Kernel/KernelA.HH,2965"$ +$LK,"CoreAPSethInit",A="FL:::/Kernel/MultiProc.HC.Z,276",BI=483$ +$LK,"IRQKbd",A="FL:::/Kernel/SerialDev/Keyboard.HC.Z,411",BI=484$ +$LK,"QueVectU8Del",A="FL:::/Kernel/KDataTypes.HC.Z,132",BI=485$ +$LK,"SwapU32",A="FL:::/Kernel/KernelB.HH,115"$ +$LK,"SwapU16",A="FL:::/Kernel/KernelB.HH,113"$ +$LK,"ARf_MESH_ED",A="FL:::/Kernel/KernelA.HH,3897"$ +$LK,"CAsmUndefHash",A="FL:::/Kernel/KernelA.HH,1813"$ +$LK,"HTt_IMPORT_SYS_SYM",A="FL:::/Kernel/KernelA.HH,653"$ +$LK,"HTt_EXPORT_SYS_SYM",A="FL:::/Kernel/KernelA.HH,652"$ +$LK,"C32_EDI",A="FL:::/Kernel/PCIBIOS.HC.Z,63"$ +$LK,"pow10_I64",A="FL:::/Kernel/KGlbls.HC.Z,15"$ +$LK,"sys_num_spawned_tasks",A="FL:::/Kernel/KGlbls.HC.Z,9"$ +$LK,"LAPIC_LVT_LINT0",A="FL:::/Kernel/KernelA.HH,501"$ +$LK,"Cluster2Blk",A="FL:::/Kernel/BlkDev/DskCluster.HC.Z,32",BI=486$ +$LK,"ArcFinishCompression",A="FL:::/Kernel/Compress.HC.Z,155",BI=487$ +$LK,"LAPIC_LVT_LINT1",A="FL:::/Kernel/KernelA.HH,502"$ +$LK,"sys_winmgr_task",A="FL:::/Kernel/KGlbls.HC.Z,11"$ +$LK,"SC_CAPS",A="FL:::/Kernel/KernelA.HH,3558"$ +$LK,"SYS_RAM_REBOOT_END",A="FL:::/Kernel/KStart64.HC.Z,99"$ +$LK,"REG_R8",A="FL:::/Kernel/KernelA.HH,1784"$ +$LK,"CMT_ARRAY_DIM",A="FL:::/Kernel/KernelA.HH,1693"$ +$LK,"ACD_POS_CHAR",A="FL:::/Kernel/KernelA.HH,1518"$ +$LK,"REGT_FSTK",A="FL:::/Kernel/KernelA.HH,744"$ +$LK,"ARGT_MOFFS64",A="FL:::/Kernel/KernelA.HH,1917"$ +$LK,"DOCF_COLOR_NAMES",A="FL:::/Kernel/KernelA.HH,1263"$ +$LK,"CRAXRBCRCXRDX",A="FL:::/Kernel/KernelA.HH,568"$ +$LK,"_SAVE_EXCEPT_REGS",A="FL:::/Kernel/KExcept.HC.Z,26"$ +$LK,"MDf_IMM",A="FL:::/Kernel/KernelA.HH,1573"$ +$LK,"DOCf_COLOR_NAMES",A="FL:::/Kernel/KernelA.HH,1299"$ +$LK,"RoundI64",A="FL:::/Kernel/KMathB.HC.Z,47",BI=488$ +$LK,"CSndGlbls",A="FL:::/Kernel/KernelA.HH,3836"$ +$LK,"EXT_HEAPLOG_FREE",A="FL:::/Kernel/KernelA.HH,578"$ +$LK,"DrvSerialNum",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,279",BI=489$ +$LK,"Fstsw",A="FL:::/Kernel/KernelB.HH,133"$ +$LK,"TASKf_TASK_LOCK",A="FL:::/Kernel/KernelA.HH,3279"$ +$LK,"BDT_ATA",A="FL:::/Kernel/KernelA.HH,2631"$ +$LK,"RFLAGf_RESUME",A="FL:::/Kernel/KernelA.HH,319"$ +$LK,"C32_EAX",A="FL:::/Kernel/PCIBIOS.HC.Z,58"$ +$LK,"PortNop",A="FL:::/Kernel/KMisc.HC.Z,1",BI=490$ +$LK,"StrNCmp",A="FL:::/Kernel/StrA.HC.Z,313"$ +$LK,"FUF_PUBLIC",A="FL:::/Kernel/KernelA.HH,2602"$ +$LK,"FUf_PUBLIC",A="FL:::/Kernel/KernelA.HH,2576"$ +$LK,"CFAT32FileInfoSect",A="FL:::/Kernel/KernelA.HH,2369"$ +$LK,"SYS_HEAP_INIT_VAL",A="FL::/Temp.DD.Z,1"$ +$LK,"CATAPITrack",A="FL:::/Kernel/KernelA.HH,2421"$ +$LK,"C32_EBX",A="FL:::/Kernel/PCIBIOS.HC.Z,59"$ +$LK,"CCF_HAS_MISC_DATA",A="FL:::/Kernel/KernelA.HH,2144"$ +$LK,"LFSF_DOC",A="FL:::/Kernel/KernelA.HH,2035"$ +$LK,"ACD_PRONUNCIATION_CHAR",A="FL:::/Kernel/KernelA.HH,1517"$ +$LK,"ACD_PRONUNCIATION",A="FL:::/Kernel/KernelA.HH,1506"$ +$LK,"C32_ECX",A="FL:::/Kernel/PCIBIOS.HC.Z,60"$ +$LK,"FifoU8Peek",A="FL:::/Kernel/KDataTypes.HC.Z,205",BI=491$ +$LK,"C32_EDX",A="FL:::/Kernel/PCIBIOS.HC.Z,61"$ +$LK,"LoadPass1",A="FL:::/Kernel/KLoad.HC.Z,67",BI=492$ +$LK,"LoadPass2",A="FL:::/Kernel/KLoad.HC.Z,154",BI=493$ +$LK,"ARf_MANAGE_SLIDER",A="FL:::/Kernel/KernelA.HH,3899"$ +$LK,"CSndData",A="FL:::/Kernel/KernelA.HH,3829"$ +$LK,"SC_PAGE_DOWN",A="FL:::/Kernel/KernelA.HH,3566"$ +$LK,"OC_NOP",A="FL:::/Kernel/KernelA.HH,1760"$ +$LK,"SPF_AUX_FMT_NUM",A="FL:::/Kernel/KernelA.HH,3918"$ +$LK,"MSG_KEY_UP",A="FL:::/Kernel/KernelA.HH,3228"$ +$LK,"SYS_SEMA_SINGLE_USER",A="FL:::/Kernel/KernelA.HH,603"$ +$LK,"TimeStampFreqCal",A="FL:::/Kernel/KMisc.HC.Z,85",BI=494$ +$LK,"QueVectU8Get",A="FL:::/Kernel/KDataTypes.HC.Z,140",BI=495$ +$LK,"DOCF_CARRIAGE_RETURN",A="FL:::/Kernel/KernelA.HH,1261"$ +$LK,"PostMsg",A="FL:::/Kernel/SrvCmd.HC.Z,240",BI=496$ +$LK,"SVCT_CALL",A="FL:::/Kernel/KernelA.HH,3193"$ +$LK,"MDf_REG",A="FL:::/Kernel/KernelA.HH,1574"$ +$LK,"ATAPISeek",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,131",BI=497$ +$LK,"MPrintDate",A="FL:::/Kernel/StrPrint.HC.Z,49",BI=498$ +$LK,"_BIT_FIELD_EXT_U32",A="FL:::/Kernel/KUtils.HC.Z,167"$ +$LK,"SC_F10",A="FL:::/Kernel/KernelA.HH,3580"$ +$LK,"SC_F11",A="FL:::/Kernel/KernelA.HH,3581"$ +$LK,"SYS_SEMA_TT",A="FL:::/Kernel/KernelA.HH,609"$ +$LK,"Silent",A="FL:::/Kernel/KMisc.HC.Z,223",BI=499$ +$LK,"SC_F12",A="FL:::/Kernel/KernelA.HH,3582"$ +$LK,"WIF_FOCUS_TASK_CTRLS",A="FL:::/Kernel/KernelA.HH,1424"$ +$LK,"CCF_POSTINC",A="FL:::/Kernel/KernelA.HH,2151"$ +$LK,"CCF_IN_IF",A="FL:::/Kernel/KernelA.HH,2133"$ +$LK,"DrvMakeFreeSlot",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,38",BI=500$ +$LK,"HashStr",A="FL:::/Kernel/KHashA.HC.Z,254"$ +$LK,"CHashExport",A="FL:::/Kernel/KernelA.HH,759"$ +$LK,"FifoU8Del",A="FL:::/Kernel/KDataTypes.HC.Z,167",BI=501$ +$LK,"DrvIsWritable",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,199",BI=502$ +$LK,"MDf_SIB",A="FL:::/Kernel/KernelA.HH,1576"$ +$LK,"chars_bmp_printable",A="FL:::/Kernel/StrA.HC.Z,381"$ +$LK,"FWBlks",A="FL:::/Kernel/BlkDev/DskCFile.HC.Z,181",BI=503$ +$LK,"RLF_COMPILER",A="FL:::/Kernel/KernelA.HH,468"$ +$LK,"RLf_COMPILER",A="FL:::/Kernel/KernelA.HH,449"$ +$LK,"SYS_INIT_PAGE_TABLES",A="FL:::/Kernel/Mem/PageTables.HC.Z,6"$ +$LK,"TASK_NAME_LEN",A="FL:::/Kernel/KernelA.HH,3303"$ +$LK,"COLORROP_COLORS_MASK",A="FL:::/Kernel/KernelA.HH,2987"$ +$LK,"C32_ESI",A="FL:::/Kernel/PCIBIOS.HC.Z,62"$ +$LK,"BlkPoolsInit",A="FL:::/Kernel/Mem/BlkPool.HC.Z,29",BI=504$ +$LK,"SYS_DATA_BP",A="FL:::/Kernel/KStart32.HC.Z,28"$ +$LK,"VGAP_PALETTE_DATA",A="FL:::/Kernel/KernelA.HH,3731"$ +$LK,"ATAR0_HCYL",A="FL:::/Kernel/KernelA.HH,2282"$ +$LK,"DOCET_SEL",A="FL:::/Kernel/KernelA.HH,949"$ +$LK,"sys_code_bp",A="FL:::/Kernel/KernelB.HH,189"$ +$LK,"RepOutU32",A="FL:::/Kernel/KernelB.HH,90"$ +$LK,"RepOutU16",A="FL:::/Kernel/KernelB.HH,88"$ +$LK,"TK_SUBSCRIPT",A="FL:::/Kernel/KernelA.HH,2071"$ +$LK,"WIG_TASK_DFT",A="FL:::/Kernel/KernelA.HH,1434"$ +$LK,"REGT_NONE",A="FL:::/Kernel/KernelA.HH,738"$ +$LK,"ARf_PSALMODY_JUKEBOX",A="FL:::/Kernel/KernelA.HH,3896"$ +$LK,"DOCEf_HTML_LINK",A="FL:::/Kernel/KernelA.HH,1057"$ +$LK,"DOCEF_HTML_LINK",A="FL:::/Kernel/KernelA.HH,969"$ +$LK,"NORMAL_KEY_SCAN_DECODE_TABLE",A="FL:::/Kernel/SerialDev/Keyboard.HC.Z,3"$ +$LK,"LinkedLstSize",A="FL:::/Kernel/KDataTypes.HC.Z,31",BI=505$ +$LK,"SSF_NO_COMPRESSION",A="FL:::/Kernel/KernelA.HH,224"$ +$LK,"DirContextNew",A="FL:::/Kernel/BlkDev/DskDirContext.HC.Z,21",BI=506$ +$LK,"_SET_MSR",A="FL:::/Kernel/KUtils.HC.Z,458"$ +$LK,"HClf_LOCKED",A="FL:::/Kernel/KernelA.HH,2904"$ +$LK,"SPF_QUESTION",A="FL:::/Kernel/KernelA.HH,3917"$ +$LK,"ACD_EXTRA_END",A="FL:::/Kernel/KernelA.HH,1511"$ +$LK,"SetRFlags",A="FL:::/Kernel/KernelB.HH,249"$ +$LK,"GetRFlags",A="FL:::/Kernel/KernelB.HH,243"$ +$LK,"DOCEF_RIGHT_MACRO",A="FL:::/Kernel/KernelA.HH,973"$ +$LK,"MSG_IP_MOVE",A="FL:::/Kernel/KernelA.HH,3229"$ +$LK,"SVCT_TEXT_INPUT",A="FL:::/Kernel/KernelA.HH,3189"$ +$LK,"DOClf_LOCKED",A="FL:::/Kernel/KernelA.HH,1332"$ +$LK,"CallStkGrow",A="FL:::/Kernel/KTask.HC.Z,90",BI=507$ +$LK,"ATAR0_NSECT",A="FL:::/Kernel/KernelA.HH,2279"$ +$LK,"DOCEf_RIGHT_MACRO",A="FL:::/Kernel/KernelA.HH,1061"$ +$LK,"RLF_DOC",A="FL:::/Kernel/KernelA.HH,469"$ +$LK,"chars_bmp_macro",A="FL:::/Kernel/StrA.HC.Z,376"$ +$LK,"OutU8",A="FL:::/Kernel/KernelB.HH,80"$ +$LK,"DCF_ALIAS",A="FL:::/Kernel/KernelA.HH,3634"$ +$LK,"CoreAPSethTask",A="FL:::/Kernel/MultiProc.HC.Z,194",BI=508$ +$LK,"Ff_HASERRCODE",A="FL:::/Kernel/KernelA.HH,848"$ +$LK,"REGG_LOCAL_NON_PTR_VARS",A="FL:::/Kernel/KernelA.HH,1795"$ +$LK,"DOCF_PLAIN_TEXT",A="FL:::/Kernel/KernelA.HH,1258"$ +$LK,"RawPutChar",A="FL:::/Kernel/Display.HC.Z,1",BI=509$ +$LK,"FifoU8Cnt",A="FL:::/Kernel/KDataTypes.HC.Z,227",BI=510$ +$LK,"DOCf_PLAIN_TEXT",A="FL:::/Kernel/KernelA.HH,1294"$ +$LK,"CArcEntry",A="FL:::/Kernel/KernelA.HH,3745"$ +$LK,"BDT_ISO_FILE_WRITE",A="FL:::/Kernel/KernelA.HH,2633"$ +$LK,"AOT_BIN_BLK_SIZE",A="FL:::/Kernel/KernelA.HH,1798"$ +$LK,"DOCf_FORM",A="FL:::/Kernel/KernelA.HH,1302"$ +$LK,"DOCF_FORM",A="FL:::/Kernel/KernelA.HH,1266"$ +$LK,"CHashTable",A="FL:::/Kernel/KernelA.HH,642"$ +$LK,"QueVectU8New",A="FL:::/Kernel/KDataTypes.HC.Z,87",BI=511$ +$LK,"MEM_INTERRUPT_STK",A="FL:::/Kernel/KernelA.HH,2886"$ +$LK,"BDT_RAM",A="FL:::/Kernel/KernelA.HH,2630"$ +$LK,"CMF_POP_CMP",A="FL:::/Kernel/KernelA.HH,1696"$ +$LK,"ICF_POP_CMP",A="FL:::/Kernel/KernelA.HH,1610"$ +$LK,"DOCf_CARRIAGE_RETURN",A="FL:::/Kernel/KernelA.HH,1297"$ +$LK,"MLMF_IS_STR",A="FL:::/Kernel/KernelA.HH,788"$ +$LK,"SYS_TIMER0_PERIOD",A="FL:::/Kernel/KernelA.HH,553"$ +$LK,"SET_FS_BASE",A="FL:::/Kernel/KUtils.HC.Z,445"$ +$LK,"CISO1PriDesc",A="FL:::/Kernel/KernelA.HH,2484"$ +$LK,"PutHex",A="FL:::/Kernel/StrA.HC.Z,12",BI=512$ +$LK,"PopUp",A="FL:::/Kernel/SrvCmd.HC.Z,377",BI=513$ +$LK,"SCF_IP_R_DOWN",A="FL:::/Kernel/KernelA.HH,3542"$ +$LK,"SCf_IP_R_DOWN",A="FL:::/Kernel/KernelA.HH,3527"$ +$LK,"MSG_IP_R_DOWN",A="FL:::/Kernel/KernelA.HH,3234"$ +$LK,"SVCT_EXE_STR",A="FL:::/Kernel/KernelA.HH,3191"$ +$LK,"DOCF_OVERSTRIKE",A="FL:::/Kernel/KernelA.HH,1288"$ +$LK,"IOAPICARB",A="FL:::/Kernel/KernelA.HH,514"$ +$LK,"DOCf_OVERSTRIKE",A="FL:::/Kernel/KernelA.HH,1325"$ +$LK,"COREAP_16BIT_INIT_END",A="FL:::/Kernel/MultiProc.HC.Z,27"$ +$LK,"SCF_SHIFT",A="FL:::/Kernel/KernelA.HH,3534"$ +$LK,"SCf_SHIFT",A="FL:::/Kernel/KernelA.HH,3519"$ +$LK,"WIF_SELF_FOCUS",A="FL:::/Kernel/KernelA.HH,1409"$ +$LK,"StrLastOcc",A="FL:::/Kernel/StrA.HC.Z,599",BI=514$ +$LK,"WIf_SELF_FOCUS",A="FL:::/Kernel/KernelA.HH,1438"$ +$LK,"FClose",A="FL:::/Kernel/BlkDev/DskCFile.HC.Z,73",BI=515$ +$LK,"MDf_STK",A="FL:::/Kernel/KernelA.HH,1572"$ +$LK,"IEF_GOTO_LABEL",A="FL:::/Kernel/KernelA.HH,1958"$ +$LK,"CMT_GOTO_LABEL",A="FL:::/Kernel/KernelA.HH,1689"$ +$LK,"mon_start_days1",A="FL:::/Kernel/KDate.HC.Z,3"$ +$LK,"HTF_GOTO_LABEL",A="FL:::/Kernel/KernelA.HH,706"$ +$LK,"mon_start_days2",A="FL:::/Kernel/KDate.HC.Z,5"$ +$LK,"FONT_HEIGHT",A="FL:::/Kernel/KernelA.HH,3606"$ +$LK,"SVCf_FOCUS_MASTER",A="FL:::/Kernel/KernelA.HH,3179"$ +$LK,"HTf_GOTO_LABEL",A="FL:::/Kernel/KernelA.HH,676"$ +$LK,"DFT_CACHE_LINE_WIDTH",A="FL:::/Kernel/KernelA.HH,583"$ +$LK,"ATAR0_LCYL",A="FL:::/Kernel/KernelA.HH,2281"$ +$LK,"MemPagePresentMark",A="FL:::/Kernel/Mem/PageTables.HC.Z,143",BI=516$ +$LK,"ICf_DONT_PUSH_FLOAT0",A="FL:::/Kernel/KernelA.HH,1612"$ +$LK,"Sleep",A="FL:::/Kernel/KMisc.HC.Z,155",BI=517$ +$LK,"RedSeaMkDir",A="FL:::/Kernel/BlkDev/FileSysRedSea.HC.Z,604",BI=518$ +$LK,"PutKey",A="FL:::/Kernel/KeyDev.HC.Z,1",BI=519$ +$LK,"_HASH_STR",A="FL:::/Kernel/KHashA.HC.Z,120"$ +$LK,"FUf_ALL",A="FL:::/Kernel/KernelA.HH,2572"$ +$LK,"sys_macro_task",A="FL:::/Kernel/KGlbls.HC.Z,5"$ +$LK,"CArcCompress",A="FL:::/Kernel/KernelA.HH,3771"$ +$LK,"CHashOpcode",A="FL:::/Kernel/KernelA.HH,1950"$ +$LK,"FifoU8Ins",A="FL:::/Kernel/KDataTypes.HC.Z,173",BI=520$ +$LK,"CGridGlbls",A="FL:::/Kernel/KernelA.HH,3070"$ +$LK,"FATFromName",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,168",BI=521$ +$LK,"AAT_ADD_U32",A="FL:::/Kernel/KernelA.HH,1973"$ +$LK,"AAT_ADD_U16",A="FL:::/Kernel/KernelA.HH,1971"$ +$LK,"SC_PAUSE",A="FL:::/Kernel/KernelA.HH,3583"$ +$LK,"TRANSPARENT",A="FL:::/Kernel/KernelA.HH,2957"$ +$LK,"XTalkStrWait",A="FL:::/Kernel/SrvCmd.HC.Z,497",BI=522$ +$LK,"CArcCtrl",A="FL:::/Kernel/KernelA.HH,3753"$ +$LK,"SC_CTRL",A="FL:::/Kernel/KernelA.HH,3556"$ +$LK,"RS_ATTR_LONG_NAME_MASK",A="FL:::/Kernel/KernelA.HH,2534"$ +$LK,"ATAR1_CTRL",A="FL:::/Kernel/KernelA.HH,2286"$ +$LK,"ICF_A1_TO_F64",A="FL:::/Kernel/KernelA.HH,1593"$ +$LK,"RECALCF_ADD_CURSOR",A="FL:::/Kernel/KernelA.HH,1351"$ +$LK,"DOC_COLOR_BIN",A="FL:::/Kernel/KernelA.HH,1141"$ +$LK,"Ff_NOARGPOP",A="FL:::/Kernel/KernelA.HH,850"$ +$LK,"EdLiteFileLine",A="FL:::/Kernel/EdLite.HC.Z,316",BI=523$ +$LK,"FifoU8New",A="FL:::/Kernel/KDataTypes.HC.Z,155",BI=524$ +$LK,"SC_HOME",A="FL:::/Kernel/KernelA.HH,3567"$ +$LK,"ATAPIWritePktWord",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,106",BI=525$ +$LK,"FilesFindMatch",A="FL:::/Kernel/BlkDev/DskStrA.HC.Z,40",BI=526$ +$LK,"BlkDevsRelease",A="FL:::/Kernel/BlkDev/DskBlkDev.HC.Z,109",BI=527$ +$LK,"DOC_COLOR_LINK",A="FL:::/Kernel/KernelA.HH,1136"$ +$LK,"AAT_ADD_U64",A="FL:::/Kernel/KernelA.HH,1975"$ +$LK,"HTT_CLASS",A="FL:::/Kernel/KernelA.HH,686"$ +$LK,"HTt_CLASS",A="FL:::/Kernel/KernelA.HH,656"$ +$LK,"Cd2DirEntry",A="FL:::/Kernel/BlkDev/DskStrA.HC.Z,217",BI=528$ +$LK,"IET_IMM_U0",A="FL:::/Kernel/KernelA.HH,395"$ +$LK,"FifoU8Rem",A="FL:::/Kernel/KDataTypes.HC.Z,190",BI=529$ +$LK,"StrLastRem",A="FL:::/Kernel/StrA.HC.Z,609",BI=530$ +$LK,"RedSeaDrvInit",A="FL:::/Kernel/BlkDev/FileSysRedSea.HC.Z,58",BI=531$ +$LK,"BlkDevAdd",A="FL:::/Kernel/BlkDev/DskAddDev.HC.Z,27",BI=532$ +$LK,"REGG_CLOBBERED",A="FL:::/Kernel/KernelA.HH,1791"$ +$LK,"ROPF_HALF_RANGE_COLOR",A="FL:::/Kernel/KernelA.HH,2949"$ +$LK,"DirLongNameFill",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,199",BI=533$ +$LK,"QueVectU8Put",A="FL:::/Kernel/KDataTypes.HC.Z,96",BI=534$ +$LK,"StrFind",A="FL:::/Kernel/StrA.HC.Z,624",BI=535$ +$LK,"CMemRange",A="FL:::/Kernel/KernelA.HH,2868"$ +$LK,"WIf_FOCUS_TASK_CTRLS",A="FL:::/Kernel/KernelA.HH,1449"$ +$LK,"C32_RSP",A="FL:::/Kernel/PCIBIOS.HC.Z,66"$ +$LK,"OutStr",A="FL:::/Kernel/StrPrint.HC.Z,20",BI=536$ +$LK,"DOCEf_CHECK_COLLAPSABLE",A="FL:::/Kernel/KernelA.HH,1094"$ +$LK,"DOCEF_PAGE_REL_Y",A="FL:::/Kernel/KernelA.HH,995"$ +$LK,"TimersInit",A="FL:::/Kernel/KEnd.HC.Z,88",BI=537$ +$LK,"ATAR0_SECT",A="FL:::/Kernel/KernelA.HH,2280"$ +$LK,"__CMD_LINE__",A="FL:::/Kernel/KernelA.HH,2029"$ +$LK,"WIF_SELF_CTRLS",A="FL:::/Kernel/KernelA.HH,1411"$ +$LK,"DOCEf_PAGE_REL_Y",A="FL:::/Kernel/KernelA.HH,1083"$ +$LK,"IET_IMM_U8",A="FL:::/Kernel/KernelA.HH,397"$ +$LK,"SC_ALT",A="FL:::/Kernel/KernelA.HH,3557"$ +$LK,"ARGT_MOFFS8",A="FL:::/Kernel/KernelA.HH,1914"$ +$LK,"REGG_STK_TEMP",A="FL:::/Kernel/KernelA.HH,1793"$ +$LK,"WIf_SELF_CTRLS",A="FL:::/Kernel/KernelA.HH,1439"$ +$LK,"EXT_NUM_ENTRIES",A="FL:::/Kernel/KernelA.HH,580"$ +$LK,"DefineMatch",A="FL:::/Kernel/KDefine.HC.Z,85",BI=538$ +$LK,"CLexHashTableContext",A="FL:::/Kernel/KernelA.HH,2114"$ +$LK,"RLF_RAW",A="FL:::/Kernel/KernelA.HH,464"$ +$LK,"WZeroBlks",A="FL:::/Kernel/BlkDev/DskBlk.HC.Z,2",BI=539$ +$LK,"ATAPISetMaxSpeed",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,118",BI=540$ +$LK,"StkRep",A="FL:::/Kernel/KDbg.HC.Z,104",BI=541$ +$LK,"SwapU8",A="FL:::/Kernel/KernelB.HH,117"$ +$LK,"FUN_SEG_CACHE_STR_LEN",A="FL:::/Kernel/KernelA.HH,3852"$ +$LK,"DCF_TRANSFORMATION",A="FL:::/Kernel/KernelA.HH,3623"$ +$LK,"FF_CONTIGUOUS",A="FL:::/Kernel/KernelA.HH,2784"$ +$LK,"TTS_CONST",A="FL:::/Kernel/KernelA.HH,3272"$ +$LK,"ISO1T_VOL_DRV_DESC",A="FL:::/Kernel/KernelA.HH,2481"$ +$LK,"SaveExceptRegs",A="FL:::/Kernel/KExcept.HC.Z,43"$ +$LK,"SC_END",A="FL:::/Kernel/KernelA.HH,3568"$ +$LK,"CAOTHeapGlbl",A="FL:::/Kernel/KernelA.HH,1990"$ +$LK,"ArcExpandBuf",A="FL:::/Kernel/Compress.HC.Z,165",BI=542$ +$LK,"FUf_MAP",A="FL:::/Kernel/KernelA.HH,2577"$ +$LK,"DOCf_MORE",A="FL:::/Kernel/KernelA.HH,1310"$ +$LK,"DOCF_MORE",A="FL:::/Kernel/KernelA.HH,1274"$ +$LK,"chars_bmp_non_eol_white_space",A="FL:::/Kernel/StrA.HC.Z,359"$ +$LK,"CISO1PathEntry",A="FL:::/Kernel/KernelA.HH,2469"$ +$LK,"REGG_SAVED",A="FL:::/Kernel/KernelA.HH,1792"$ +$LK,"SF_ARG1",A="FL:::/Kernel/KernelA.HH,559"$ +$LK,"RLF_VGA",A="FL:::/Kernel/KernelA.HH,458"$ +$LK,"COLOR_MONO",A="FL:::/Kernel/KernelA.HH,2977"$ +$LK,"ACD_END_CHAR",A="FL:::/Kernel/KernelA.HH,1514"$ +$LK,"WIF_FOCUS_TASK_IP_WHEEL",A="FL:::/Kernel/KernelA.HH,1429"$ +$LK,"DOCET_INVERT",A="FL:::/Kernel/KernelA.HH,948"$ +$LK,"SF_ARG2",A="FL:::/Kernel/KernelA.HH,560"$ +$LK,"SC_SCROLL",A="FL:::/Kernel/KernelA.HH,3560"$ +$LK,"DISPLAYf_NOT_RAW",A="FL:::/Kernel/KernelA.HH,3296"$ +$LK,"DOCEt_INVERT",A="FL:::/Kernel/KernelA.HH,954"$ +$LK,"ATTRf_INVERT",A="FL:::/Kernel/KernelA.HH,895"$ +$LK,"ATTRF_INVERT",A="FL:::/Kernel/KernelA.HH,890"$ +$LK,"SF_ARG3",A="FL:::/Kernel/KernelA.HH,561"$ +$LK,"ACD_PRONUNCIATION_END",A="FL:::/Kernel/KernelA.HH,1507"$ +$LK,"SF_ARG4",A="FL:::/Kernel/KernelA.HH,562"$ +$LK,"SF_ARG5",A="FL:::/Kernel/KernelA.HH,563"$ +$LK,"ODEF_STARTED",A="FL:::/Kernel/KernelA.HH,242"$ +$LK,"TaskFocusNext",A="FL:::/Kernel/Sched.HC.Z,38",BI=543$ +$LK,"Print",A="FL:::/Kernel/StrPrint.HC.Z,890",BI=544$ +$LK,"SFF_WHOLE_LABELS_BEFORE",A="FL:::/Kernel/KernelA.HH,3799"$ +$LK,"FUF_RISKY",A="FL:::/Kernel/KernelA.HH,2601"$ +$LK,"FUf_RISKY",A="FL:::/Kernel/KernelA.HH,2575"$ +$LK,"CAOTAbsAddr",A="FL:::/Kernel/KernelA.HH,1977"$ +$LK,"SF_ARG6",A="FL:::/Kernel/KernelA.HH,564"$ +$LK,"SC_ESC",A="FL:::/Kernel/KernelA.HH,3551"$ +$LK,"ACD_WORD_CHAR",A="FL:::/Kernel/KernelA.HH,1515"$ +$LK,"SF_ARG7",A="FL:::/Kernel/KernelA.HH,565"$ +$LK,"FAT32DrvValidate",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,48",BI=545$ +$LK,"StrCmp",A="FL:::/Kernel/StrA.HC.Z,309"$ +$LK,"DOF_INTERCEPT_TASK_END",A="FL:::/Kernel/KernelA.HH,1216"$ +$LK,"SF_ARG8",A="FL:::/Kernel/KernelA.HH,566"$ +$LK,"BlkDevDel",A="FL:::/Kernel/BlkDev/DskBlkDev.HC.Z,154",BI=546$ +$LK,"ST_ERR_ST",A="FL:::/Kernel/KernelA.HH,3513"$ +$LK,"BlkDevChk",A="FL:::/Kernel/BlkDev/DskBlkDev.HC.Z,163",BI=547$ +$LK,"MSG_IP_L_UP",A="FL:::/Kernel/KernelA.HH,3231"$ +$LK,"FSt_REDSEA",A="FL:::/Kernel/KernelA.HH,2687"$ +$LK,"CPCIDev",A="FL:::/Kernel/KernelA.HH,2241"$ +$LK,"DOCEf_DFT_LEN",A="FL:::/Kernel/KernelA.HH,1110"$ +$LK,"DOCEF_DFT_LEN",A="FL:::/Kernel/KernelA.HH,1024"$ +$LK,"RepOutU8",A="FL:::/Kernel/KernelB.HH,92"$ +$LK,"DOCEF_RIGHT_AUTO",A="FL:::/Kernel/KernelA.HH,986"$ +$LK,"DrvBlkDevDel",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,78",BI=548$ +$LK,"VGAP_PALETTE_MASK",A="FL:::/Kernel/KernelA.HH,3728"$ +$LK,"DOCEf_RIGHT_AUTO",A="FL:::/Kernel/KernelA.HH,1074"$ +$LK,"NUM_SYS_SEMAS",A="FL:::/Kernel/KernelA.HH,615"$ +$LK,"ATAPISync",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,501",BI=549$ +$LK,"TO_UPPER",A="FL:::/Kernel/StrA.HC.Z,110"$ +$LK,"RFLAGG_NORMAL",A="FL:::/Kernel/KernelA.HH,327"$ +$LK,"KERNEL_MODULE_NAME",A="FL:::/Kernel/KernelA.HH,716"$ +$LK,"SYS_SEMA_DSK_CACHE",A="FL:::/Kernel/KernelA.HH,604"$ +$LK,"MEM_PAGE_SIZE",A="FL:::/Kernel/KernelA.HH,2877"$ +$LK,"SleepUntil",A="FL:::/Kernel/KMisc.HC.Z,147",BI=550$ +$LK,"Spawn",A="FL:::/Kernel/KTask.HC.Z,222",BI=551$ +$LK,"CTaskDying",A="FL:::/Kernel/KernelA.HH,3312"$ +$LK,"MSG_IP_R_D_UP",A="FL:::/Kernel/KernelA.HH,3237"$ +$LK,"CRedSeaBoot",A="FL:::/Kernel/KernelA.HH,2323"$ +$LK,"WIF_SELF_KEY_DESC",A="FL:::/Kernel/KernelA.HH,1421"$ +$LK,"SET_GS_BASE",A="FL:::/Kernel/KUtils.HC.Z,433"$ +$LK,"RFLAGf_VINT_PENDING",A="FL:::/Kernel/KernelA.HH,323"$ +$LK,"DirEntryDel2",A="FL:::/Kernel/BlkDev/DskDirA.HC.Z,26",BI=552$ +$LK,"DefineLoad",A="FL:::/Kernel/KDefine.HC.Z,1",BI=553$ +$LK,"INT_FAULT_ERR_CODE_BITMAP",A="FL:::/Kernel/KInts.HC.Z,94"$ +$LK,"ICF_NO_RIP",A="FL:::/Kernel/KernelA.HH,1617"$ +$LK,"SUF_REM_CTRL_CHARS",A="FL:::/Kernel/KernelA.HH,3785"$ +$LK,"SC_SHIFT",A="FL:::/Kernel/KernelA.HH,3555"$ +$LK,"ATA_SET_MAX_EXT",A="FL:::/Kernel/KernelA.HH,2264"$ +$LK,"StrOcc",A="FL:::/Kernel/StrA.HC.Z,467",BI=554$ +$LK,"StrCpy",A="FL:::/Kernel/StrA.HC.Z,321"$ +$LK,"DOCT_INS_BIN",A="FL:::/Kernel/KernelA.HH,938"$ +$LK,"StrMatch",A="FL:::/Kernel/StrA.HC.Z,317"$ +$LK,"FlushMsgs",A="FL:::/Kernel/SerialDev/Message.HC.Z,87",BI=555$ +$LK,"CMT_JMP_TABLE",A="FL:::/Kernel/KernelA.HH,1691"$ +$LK,"RLF_MP",A="FL:::/Kernel/KernelA.HH,467"$ +$LK,"SC_GUI",A="FL:::/Kernel/KernelA.HH,3584"$ +$LK,"RLF_INTERRUPTS",A="FL:::/Kernel/KernelA.HH,465"$ +$LK,"StrLen",A="FL:::/Kernel/KernelB.HH,61"$ +$LK,"ATA_READ_NATIVE_MAX",A="FL:::/Kernel/KernelA.HH,2261"$ +$LK,"PUSH_C_REGS",A="FL:::/Kernel/KernelA.HH,1766"$ +$LK,"IEF_REX_XOR_LIKE",A="FL:::/Kernel/KernelA.HH,1735"$ +$LK,"WIf_SELF_KEY_DESC",A="FL:::/Kernel/KernelA.HH,1447"$ +$LK,"RLf_INTERRUPTS",A="FL:::/Kernel/KernelA.HH,446"$ +$LK,"ISO1DateStruct2CDate",A="FL:::/Kernel/BlkDev/FileSysISO.HC.Z,14",BI=556$ +$LK,"DOCF_SEL",A="FL:::/Kernel/KernelA.HH,1285"$ +$LK,"RLF_REGISTRY",A="FL:::/Kernel/KernelA.HH,471"$ +$LK,"RLf_REGISTRY",A="FL:::/Kernel/KernelA.HH,452"$ +$LK,"SC_INS",A="FL:::/Kernel/KernelA.HH,3569"$ +$LK,"TK_DOT_DOT",A="FL:::/Kernel/KernelA.HH,2108"$ +$LK,"RT_NUM_IT",A="FL:::/Kernel/KernelA.HH,1568"$ +$LK,"AbsI64",A="FL:::/Kernel/KernelB.HH,97"$ +$LK,"SC_TAB",A="FL:::/Kernel/KernelA.HH,3553"$ +$LK,"SPF_DECIMAL",A="FL:::/Kernel/KernelA.HH,3919"$ +$LK,"IOAPICVER",A="FL:::/Kernel/KernelA.HH,513"$ +$LK,"LAPIC_LVT_TIMER",A="FL:::/Kernel/KernelA.HH,498"$ +$LK,"sys_mem_init_flag",A="FL:::/Kernel/KernelB.HH,183"$ +$LK,"RWF_IN_DOLLAR",A="FL:::/Kernel/KernelA.HH,3590"$ +$LK,"DISPLAYf_CHILDREN_NOT_ON_TOP",A="FL:::/Kernel/KernelA.HH,3300"$ +$LK,"RedSeaFmt",A="FL:::/Kernel/BlkDev/FileSysRedSea.HC.Z,94",BI=557$ +$LK,"sys_var_init_flag",A="FL:::/Kernel/KernelB.HH,185"$ +$LK,"IOAPIC_DATA",A="FL:::/Kernel/KernelA.HH,510"$ +$LK,"SysGetStr2",A="FL:::/Kernel/KDbg.HC.Z,337",BI=558$ +$LK,"fp_getstr2",A="FL:::/Kernel/KGlbls.HC.Z,31"$ +$LK,"KDRawPutKey",A="FL:::/Kernel/KeyDev.HC.Z,88",BI=559$ +$LK,"DOCF_SUBSCRIPT_MODE",A="FL:::/Kernel/KernelA.HH,1291"$ +$LK,"Dos2CDate",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,9",BI=560$ +$LK,"SYS_START_CR0",A="FL:::/Kernel/KernelA.HH,305"$ +$LK,"QSortI64",A="FL:::/Kernel/QSort.HC.Z,1",BI=561$ +$LK,"RawPrint",A="FL:::/Kernel/KDbg.HC.Z,217",BI=562$ +$LK,"CTextGlbls",A="FL:::/Kernel/KernelA.HH,3595"$ +$LK,"CDevGlbls",A="FL:::/Kernel/KernelA.HH,2921"$ +$LK,"chars_bmp_zero_cr_nl_cursor",A="FL:::/Kernel/StrA.HC.Z,362"$ +$LK,"AreYouSure",A="FL:::/Kernel/StrB.HC.Z,109",BI=563$ +$LK,"DOCf_IN_DOLLAR",A="FL:::/Kernel/KernelA.HH,1326"$ +$LK,"DOCF_IN_DOLLAR",A="FL:::/Kernel/KernelA.HH,1289"$ +$LK,"_REP_IN_U16",A="FL:::/Kernel/KUtils.HC.Z,264"$ +$LK,"_REP_IN_U32",A="FL:::/Kernel/KUtils.HC.Z,253"$ +$LK,"CH_FORM_FEED",A="FL:::/Kernel/KernelA.HH,3507"$ +$LK,"MP_VECT_ADDR",A="FL:::/Kernel/KernelA.HH,506"$ +$LK,"I_WAKE",A="FL:::/Kernel/KernelA.HH,295"$ +$LK,"Yield",A="FL:::/Kernel/Sched.HC.Z,284"$ +$LK,"CKeyDevGlbls",A="FL:::/Kernel/KernelA.HH,3817"$ +$LK,"MRT_DEV",A="FL:::/Kernel/KernelA.HH,2866"$ +$LK,"CBlkDevGlbls",A="FL:::/Kernel/KernelA.HH,2756"$ +$LK,"CMBRPrt",A="FL:::/Kernel/KernelA.HH,2302"$ +$LK,"StrNew",A="FL:::/Kernel/Mem/MAllocFree.HC.Z,446",BI=564$ +$LK,"HTT_GLBL_VAR",A="FL:::/Kernel/KernelA.HH,685"$ +$LK,"HTt_GLBL_VAR",A="FL:::/Kernel/KernelA.HH,655"$ +$LK,"WIF_FOCUS_TASK_IP_L_D",A="FL:::/Kernel/KernelA.HH,1426"$ +$LK,"HTT_HELP_FILE",A="FL:::/Kernel/KernelA.HH,697"$ +$LK,"HTt_HELP_FILE",A="FL:::/Kernel/KernelA.HH,667"$ +$LK,"Round",A="FL:::/Kernel/KernelB.HH,139"$ +$LK,"TaskRstAwaitingMsg",A="FL:::/Kernel/SrvCmd.HC.Z,25",BI=565$ +$LK,"MSG_IP_L_D_DOWN",A="FL:::/Kernel/KernelA.HH,3232"$ +$LK,"ATAR0_STAT",A="FL:::/Kernel/KernelA.HH,2284"$ +$LK,"DOC_COLOR_PMT",A="FL:::/Kernel/KernelA.HH,1140"$ +$LK,"HPET_GEN_CONF",A="FL:::/Kernel/KernelA.HH,534"$ +$LK,"MPHalt",A="FL:::/Kernel/MultiProc.HC.Z,164",BI=566$ +$LK,"UnusedStk",A="FL:::/Kernel/KDbg.HC.Z,46",BI=567$ +$LK,"DirEntryCompareName",A="FL:::/Kernel/BlkDev/DskDirA.HC.Z,62",BI=568$ +$LK,"BFieldExtU32",A="FL:::/Kernel/KernelB.HH,30"$ +$LK,"DOCf_SUBSCRIPT_MODE",A="FL:::/Kernel/KernelA.HH,1328"$ +$LK,"ATAS_DF",A="FL:::/Kernel/KernelA.HH,2273"$ +$LK,"ROPBF_PROBABILITY_DITHER",A="FL:::/Kernel/KernelA.HH,2940"$ +$LK,"StrScan",A="FL:::/Kernel/StrScan.HC.Z,212",BI=569$ +$LK,"CONSERVATIVE_16MEG_SIZE",A="FL:::/Kernel/Mem/PageTables.HC.Z,96"$ +$LK,"ACD_DEF_FILENAME_Z",A="FL:::/Kernel/KernelA.HH,1500"$ +$LK,"ATARepFind",A="FL:::/Kernel/BlkDev/DskATAId.HC.Z,195",BI=570$ +$LK,"QSort2a",A="FL:::/Kernel/QSort.HC.Z,32",BI=571$ +$LK,"num_lock_map",A="FL:::/Kernel/SerialDev/Keyboard.HC.Z,179"$ +$LK,"QSort2b",A="FL:::/Kernel/QSort.HC.Z,55",BI=572$ +$LK,"KDF_HAS_DESCS",A="FL:::/Kernel/KernelA.HH,3808"$ +$LK,"CBlkPool",A="FL:::/Kernel/KernelA.HH,2893"$ +$LK,"SC_NUM",A="FL:::/Kernel/KernelA.HH,3559"$ +$LK,"MSG_IP_R_UP",A="FL:::/Kernel/KernelA.HH,3235"$ +$LK,"IEF_DONT_SWITCH_MODES",A="FL:::/Kernel/KernelA.HH,1730"$ +$LK,"I_TIMER",A="FL:::/Kernel/KernelA.HH,292"$ +$LK,"IRQ_TIMER",A="FL:::/Kernel/KInts.HC.Z,16"$ +$LK,"DOC_COLOR_TREE",A="FL:::/Kernel/KernelA.HH,1139"$ +$LK,"DOCEf_HAS_BIN",A="FL:::/Kernel/KernelA.HH,1062"$ +$LK,"DOCEF_HAS_BIN",A="FL:::/Kernel/KernelA.HH,974"$ +$LK,"SYS_BOOT_BASE",A="FL:::/Kernel/KStart16.HC.Z,30"$ +$LK,"VGAP_CRTC_INDEX",A="FL:::/Kernel/KernelA.HH,3732"$ +$LK,"ATTRF_SEL",A="FL:::/Kernel/KernelA.HH,891"$ +$LK,"DrvNextFreeLet",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,51",BI=573$ +$LK,"SFF_WHOLE_LABELS_AFTER",A="FL:::/Kernel/KernelA.HH,3800"$ +$LK,"CDIR_FILENAME_LEN",A="FL:::/Kernel/KernelA.HH,2551"$ +$LK,"CFifoI64",A="FL:::/Kernel/KernelA.HH,175"$ +$LK,"PCIReadU32",A="FL:::/Kernel/PCIBIOS.HC.Z,201",BI=574$ +$LK,"PCIReadU16",A="FL:::/Kernel/PCIBIOS.HC.Z,182",BI=575$ +$LK,"YearStartDate",A="FL:::/Kernel/KDate.HC.Z,8",BI=576$ +$LK,"ACD_H1_END",A="FL:::/Kernel/KernelA.HH,1503"$ +$LK,"_REP_IN_U8",A="FL:::/Kernel/KUtils.HC.Z,275"$ +$LK,"SHIFT_KEY_SCAN_DECODE_TABLE",A="FL:::/Kernel/SerialDev/Keyboard.HC.Z,9"$ +$LK,"DOCF_BREAK_UNLOCKED",A="FL:::/Kernel/KernelA.HH,1279"$ +$LK,"REG_UNDEF",A="FL:::/Kernel/KernelA.HH,1789"$ +$LK,"VGAFlush",A="FL:::/Kernel/Display.HC.Z,88",BI=577$ +$LK,"FILEMASK_AOT",A="FL:::/Kernel/KernelA.HH,2290"$ +$LK,"SysDbg",A="FL:::/Kernel/KMisc.HC.Z,233",BI=578$ +$LK,"FramePtrAdd",A="FL:::/Kernel/KHashB.HC.Z,225",BI=579$ +$LK,"DCF_SCREEN_BITMAP",A="FL:::/Kernel/KernelA.HH,3635"$ +$LK,"FF_NEEDS_WRITE",A="FL:::/Kernel/KernelA.HH,2783"$ +$LK,"WIF_FOCUS_TASK_IP_R_D",A="FL:::/Kernel/KernelA.HH,1428"$ +$LK,"DOCF_DBL_DOLLARS",A="FL:::/Kernel/KernelA.HH,1262"$ +$LK,"LAPIC_APIC_ID",A="FL:::/Kernel/KernelA.HH,479"$ +$LK,"MPrintTime",A="FL:::/Kernel/StrPrint.HC.Z,42",BI=580$ +$LK,"CatPrint",A="FL:::/Kernel/StrPrint.HC.Z,881",BI=581$ +$LK,"TK_CHAR_CONST",A="FL:::/Kernel/KernelA.HH,2076"$ +$LK,"TASKf_AWAITING_MSG",A="FL:::/Kernel/KernelA.HH,3287"$ +$LK,"ICF_A1_TO_INT",A="FL:::/Kernel/KernelA.HH,1594"$ +$LK,"DOCf_DBL_DOLLARS",A="FL:::/Kernel/KernelA.HH,1298"$ +$LK,"EDF_UNCOLLAPSE",A="FL:::/Kernel/KernelA.HH,1248"$ +$LK,"DOCEG_HAS_ALLOC",A="FL:::/Kernel/KernelA.HH,1027"$ +$LK,"CHashSrcSym",A="FL:::/Kernel/KernelA.HH,724"$ +$LK,"HashPublic",A="FL:::/Kernel/KHashB.HC.Z,170",BI=582$ +$LK,"HEAP_CTRL_SIGNATURE_VAL",A="FL:::/Kernel/KernelA.HH,2906"$ +$LK,"EDf_UNCOLLAPSE",A="FL:::/Kernel/KernelA.HH,1254"$ +$LK,"CDocSettings",A="FL:::/Kernel/KernelA.HH,1147"$ +$LK,"BlkDevInit",A="FL:::/Kernel/BlkDev/DskBlkDev.HC.Z,31",BI=583$ +$LK,"CTaskStk",A="FL:::/Kernel/KernelA.HH,3304"$ +$LK,"CWinMgrTimingGlbls",A="FL:::/Kernel/KernelA.HH,1458"$ +$LK,"FAT32_ENTRIES_PER_BLK",A="FL:::/Kernel/KernelA.HH,2408"$ +$LK,"ATARBlks",A="FL:::/Kernel/BlkDev/DskATA.HC.Z,442",BI=584$ +$LK,"GVF_ALIAS",A="FL:::/Kernel/KernelA.HH,870"$ +$LK,"CTaskSettings",A="FL:::/Kernel/KernelA.HH,3247"$ +$LK,"IEF_ENDING_ZERO",A="FL:::/Kernel/KernelA.HH,1737"$ +$LK,"PUT_CHARS",A="FL:::/Kernel/StrA.HC.Z,51"$ +$LK,"CMemE820",A="FL:::/Kernel/KernelA.HH,358"$ +$LK,"DVD_BOOT_LOADER_SIZE",A="FL:::/Kernel/KernelA.HH,2299"$ +$LK,"FILEMASK_GRA",A="FL:::/Kernel/KernelA.HH,2293"$ +$LK,"ATAS_DRQ",A="FL:::/Kernel/KernelA.HH,2272"$ +$LK,"DOCF_BORDER_DOC",A="FL:::/Kernel/KernelA.HH,1265"$ +$LK,"DrvEnable",A="FL:::/Kernel/BlkDev/DskAddDev.HC.Z,160",BI=585$ +$LK,"BlkDevLock",A="FL:::/Kernel/BlkDev/DskBlkDev.HC.Z,1",BI=586$ +$LK,"BDT_NUM_TYPES",A="FL:::/Kernel/KernelA.HH,2635"$ +$LK,"DOCf_BORDER_DOC",A="FL:::/Kernel/KernelA.HH,1301"$ +$LK,"MRT_RAM",A="FL:::/Kernel/KernelA.HH,2865"$ +$LK,"FSt_NUM_TYPES",A="FL:::/Kernel/KernelA.HH,2694"$ +$LK,"ATAS_BSY",A="FL:::/Kernel/KernelA.HH,2275"$ +$LK,"HTt_NUM_TYPES",A="FL:::/Kernel/KernelA.HH,669"$ +$LK,"ICF_R_WAS_STK",A="FL:::/Kernel/KernelA.HH,1606"$ +$LK,"DOCf_BREAK_UNLOCKED",A="FL:::/Kernel/KernelA.HH,1315"$ +$LK,"sys_mem_init_val",A="FL:::/Kernel/KernelB.HH,184"$ +$LK,"SYS_SEMA_FORCE_WINMGR",A="FL:::/Kernel/KernelA.HH,611"$ +$LK,"ATAS_ERR",A="FL:::/Kernel/KernelA.HH,2271"$ +$LK,"Struct2Date",A="FL:::/Kernel/KDate.HC.Z,14",BI=587$ +$LK,"ISO1T_TERMINATOR",A="FL:::/Kernel/KernelA.HH,2482"$ +$LK,"SF_RBP",A="FL:::/Kernel/KernelA.HH,557"$ +$LK,"SYS_MP_CNT",A="FL:::/Kernel/KStart32.HC.Z,47"$ +$LK,"CMF_U8_JMP_TABLE",A="FL:::/Kernel/KernelA.HH,1699"$ +$LK,"CMF_I8_JMP_TABLE",A="FL:::/Kernel/KernelA.HH,1698"$ +$LK,"EdLiteUpdate",A="FL:::/Kernel/EdLite.HC.Z,7",BI=588$ +$LK,"_ARC_ENTRY_GET",A="FL:::/Kernel/Compress.HC.Z,43"$ +$LK,"DOCT_NUM_TYPES",A="FL:::/Kernel/KernelA.HH,944"$ +$LK,"SYS_CTRL_ALT_FLAGS",A="FL:::/Kernel/KStart32.HC.Z,24"$ +$LK,"BOOT_RAM_BASE",A="FL:::/Kernel/KernelA.HH,3878"$ +$LK,"MT_DVD",A="FL:::/Kernel/KernelA.HH,2544"$ +$LK,"FramePtrDel",A="FL:::/Kernel/KHashB.HC.Z,240",BI=589$ +$LK,"chars_bmp_filename",A="FL:::/Kernel/StrA.HC.Z,345"$ +$LK,"CICType",A="FL:::/Kernel/KernelA.HH,1627"$ +$LK,"ICF_A2_WAS_STK",A="FL:::/Kernel/KernelA.HH,1608"$ +$LK,"FILEMASK_JIT",A="FL:::/Kernel/KernelA.HH,2289"$ +$LK,"ATAS_DRDY",A="FL:::/Kernel/KernelA.HH,2274"$ +$LK,"ARGT_AL",A="FL:::/Kernel/KernelA.HH,1919"$ +$LK,"CIntermediateCodeBase",A="FL:::/Kernel/KernelA.HH,1646"$ +$LK,"CAutoCompleteDictGlbls",A="FL:::/Kernel/KernelA.HH,1522"$ +$LK,"SYS_CODE_BP",A="FL:::/Kernel/KStart32.HC.Z,27"$ +$LK,"WClusters",A="FL:::/Kernel/BlkDev/DskCluster.HC.Z,129",BI=590$ +$LK,"LXchgI64",A="FL:::/Kernel/KernelB.HH,253"$ +$LK,"MSG_KEY_DOWN_UP",A="FL:::/Kernel/KernelA.HH,3239"$ +$LK,"TASKf_NONTIMER_RAND",A="FL:::/Kernel/KernelA.HH,3292"$ +$LK,"ARGT_CL",A="FL:::/Kernel/KernelA.HH,1924"$ +$LK,"ARGT_M8",A="FL:::/Kernel/KernelA.HH,1904"$ +$LK,"ChkOnStk",A="FL:::/Kernel/KDbg.HC.Z,31",BI=591$ +$LK,"TaskQueInsChild",A="FL:::/Kernel/Sched.HC.Z,314",BI=592$ +$LK,"TK_F64",A="FL:::/Kernel/KernelA.HH,2077"$ +$LK,"RLF_BOOT_HEAP",A="FL:::/Kernel/KernelA.HH,462"$ +$LK,"RLf_BOOT_HEAP",A="FL:::/Kernel/KernelA.HH,443"$ +$LK,"I_USER",A="FL:::/Kernel/KernelA.HH,301"$ +$LK,"FAT32CDirFill",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,226",BI=593$ +$LK,"BlkPoolAdd",A="FL:::/Kernel/Mem/BlkPool.HC.Z,1",BI=594$ +$LK,"sys_task_being_screen_updated",A="FL:::/Kernel/KGlbls.HC.Z,11"$ +$LK,"TK_NORMALSCRIPT",A="FL:::/Kernel/KernelA.HH,2072"$ +$LK,"SF_RIP",A="FL:::/Kernel/KernelA.HH,558"$ +$LK,"IOAPIC_REG",A="FL:::/Kernel/KernelA.HH,509"$ +$LK,"Complex",A="FL:::/Kernel/KernelA.HH,115"$ +$LK,"Trunc",A="FL:::/Kernel/KernelB.HH,141"$ +$LK,"ROPB_EQU",A="FL:::/Kernel/KernelA.HH,2933"$ +$LK,"HTf_IMM",A="FL:::/Kernel/KernelA.HH,675"$ +$LK,"sys_pci_services",A="FL:::/Kernel/PCIBIOS.HC.Z,159"$ +$LK,"CStreamBlk",A="FL:::/Kernel/KernelA.HH,2011"$ +$LK,"ARGT_M32",A="FL:::/Kernel/KernelA.HH,1906"$ +$LK,"ARGT_M16",A="FL:::/Kernel/KernelA.HH,1905"$ +$LK,"MEM_EXTRA_HASH2_PAGES",A="FL:::/Kernel/KernelA.HH,2882"$ +$LK,"ARGT_CS",A="FL:::/Kernel/KernelA.HH,1934"$ +$LK,"ICF_R_TO_F64",A="FL:::/Kernel/KernelA.HH,1591"$ +$LK,"DOC_COLOR_QUOTE",A="FL:::/Kernel/KernelA.HH,1145"$ +$LK,"DOCSS_DBL_QUOTE",A="FL:::/Kernel/KernelA.HH,1130"$ +$LK,"SYS_PCI_SERVICES",A="FL:::/Kernel/PCIBIOS.HC.Z,5"$ +$LK,"_STRCMP",A="FL:::/Kernel/StrA.HC.Z,86"$ +$LK,"ARGT_AX",A="FL:::/Kernel/KernelA.HH,1920"$ +$LK,"LAPIC_PROCESSOR_PRIORITY",A="FL:::/Kernel/KernelA.HH,483"$ +$LK,"Core0Init",A="FL:::/Kernel/MultiProc.HC.Z,355",BI=595$ +$LK,"ARGT_DS",A="FL:::/Kernel/KernelA.HH,1929"$ +$LK,"ARGT_R8",A="FL:::/Kernel/KernelA.HH,1894"$ +$LK,"AStrNew",A="FL:::/Kernel/Mem/MAllocFree.HC.Z,461",BI=596$ +$LK,"ARGT_ES",A="FL:::/Kernel/KernelA.HH,1930"$ +$LK,"ICF_A2_TO_F64",A="FL:::/Kernel/KernelA.HH,1595"$ +$LK,"DOCF_PLAIN_TEXT_TABS",A="FL:::/Kernel/KernelA.HH,1259"$ +$LK,"Cf_INTERNAL_TYPE",A="FL:::/Kernel/KernelA.HH,831"$ +$LK,"FAT32DrvInit",A="FL:::/Kernel/BlkDev/FileSysFAT.HC.Z,22",BI=597$ +$LK,"DOCT_ANCHOR",A="FL:::/Kernel/KernelA.HH,927"$ +$LK,"KbdPktRead",A="FL:::/Kernel/SerialDev/Keyboard.HC.Z,388",BI=598$ +$LK,"KbdCmdRead",A="FL:::/Kernel/SerialDev/Keyboard.HC.Z,36",BI=599$ +$LK,"D3DivEqu",A="FL:::/Kernel/KernelB.HH,152"$ +$LK,"ARGT_FS",A="FL:::/Kernel/KernelA.HH,1931"$ +$LK,"TK_I64",A="FL:::/Kernel/KernelA.HH,2075"$ +$LK,"ARGT_DX",A="FL:::/Kernel/KernelA.HH,1925"$ +$LK,"ARGT_M64",A="FL:::/Kernel/KernelA.HH,1907"$ +$LK,"DOCE_LEN_DFT",A="FL:::/Kernel/KernelA.HH,1179"$ +$LK,"DOC_COLOR_KEYWORD2",A="FL:::/Kernel/KernelA.HH,1143"$ +$LK,"CD2I32",A="FL:::/Kernel/KernelA.HH,137"$ +$LK,"DrvLock",A="FL:::/Kernel/BlkDev/DskDrv.HC.Z,1",BI=600$ +$LK,"ARGT_GS",A="FL:::/Kernel/KernelA.HH,1933"$ +$LK,"CICTreeLinks",A="FL:::/Kernel/KernelA.HH,1639"$ +$LK,"DOC_COLOR_COMMENT",A="FL:::/Kernel/KernelA.HH,1144"$ +$LK,"SYS_MEM_E801",A="FL:::/Kernel/KStart16.HC.Z,31"$ +$LK,"ATA_NOP",A="FL:::/Kernel/KernelA.HH,2258"$ +$LK,"SVCf_DONT_FILTER",A="FL:::/Kernel/KernelA.HH,3181"$ +$LK,"IET_REL_I0",A="FL:::/Kernel/KernelA.HH,394"$ +$LK,"OC_ADDR_SIZE_PREFIX",A="FL:::/Kernel/KernelA.HH,1758"$ +$LK,"SYS_MEM_E820",A="FL:::/Kernel/KStart16.HC.Z,32"$ +$LK,"SUF_SINGLE_SPACE",A="FL:::/Kernel/KernelA.HH,3789"$ +$LK,"RFLAGG_START",A="FL:::/Kernel/KernelA.HH,326"$ +$LK,"CKeyDevEntry",A="FL:::/Kernel/KernelA.HH,3809"$ +$LK,"MSG_IP_R_D_DOWN_UP",A="FL:::/Kernel/KernelA.HH,3243"$ +$LK,"MSG_IP_L_D_DOWN_UP",A="FL:::/Kernel/KernelA.HH,3241"$ +$LK,"XTalkWait",A="FL:::/Kernel/SrvCmd.HC.Z,455",BI=601$ +$LK,"MemPageTable",A="FL:::/Kernel/Mem/PageTables.HC.Z,127",BI=602$ +$LK,"CCF_KEEP_NUM_SIGN",A="FL:::/Kernel/KernelA.HH,2137"$ +$LK,"ARGT_MM",A="FL:::/Kernel/KernelA.HH,1938"$ +$LK,"chars_bmp_alpha_numeric_no_at",A="FL:::/Kernel/StrA.HC.Z,335"$ +$LK,"SysHlt",A="FL:::/Kernel/KernelB.HH,259"$ +$LK,"FUF_JUST_DIRS",A="FL:::/Kernel/KernelA.HH,2606"$ +$LK,"CD2I64",A="FL:::/Kernel/KernelA.HH,141"$ +$LK,"CD3I32",A="FL:::/Kernel/KernelA.HH,127"$ +$LK,"_STRCPY",A="FL:::/Kernel/StrA.HC.Z,65"$ +$LK,"RedSeaDrvValidate",A="FL:::/Kernel/BlkDev/FileSysRedSea.HC.Z,82",BI=603$ +$LK,"YELLOW",A="FL:::/Kernel/KernelA.HH,2972"$ +$LK,"FUf_JUST_DIRS",A="FL:::/Kernel/KernelA.HH,2580"$ +$LK,"RedSeaFreeFreeLst",A="FL:::/Kernel/BlkDev/FileSysRedSea.HC.Z,3",BI=604$ +$LK,"IPVarsInit",A="FL:::/Kernel/SerialDev/InputPointer.HC.Z,68",BI=605$ +$LK,"IET_REL_I8",A="FL:::/Kernel/KernelA.HH,396"$ +$LK,"MouseGetDevType",A="FL:::/Kernel/SerialDev/Mouse.HC.Z,26",BI=606$ +$LK,"ARGT_R32",A="FL:::/Kernel/KernelA.HH,1896"$ +$LK,"ARGT_R16",A="FL:::/Kernel/KernelA.HH,1895"$ +$LK,"DOC_DFT",A="FL:::/Kernel/KernelA.HH,1157"$ +$LK,"CMemberLstMeta",A="FL:::/Kernel/KernelA.HH,789"$ +$LK,"DISPLAYf_WIN_ON_TOP",A="FL:::/Kernel/KernelA.HH,3299"$ +$LK,"CAutoCompleteGlbls",A="FL:::/Kernel/KernelA.HH,1485"$ +$LK,"CAOTImportExport",A="FL:::/Kernel/KernelA.HH,1959"$ +$LK,"MEM_SETH_STK",A="FL:::/Kernel/KernelA.HH,2885"$ +$LK,"DOCEF_HAS_TERMINATOR",A="FL:::/Kernel/KernelA.HH,1013"$ +$LK,"CD3I64",A="FL:::/Kernel/KernelA.HH,145"$ +$LK,"c32_edi",A="FL:::/Kernel/PCIBIOS.HC.Z,157"$ +$LK,"_CALL_IND",A="FL:::/Kernel/KUtils.HC.Z,332"$ +$LK,"PURPLE",A="FL:::/Kernel/KernelA.HH,2963"$ +$LK,"TASKf_BREAK_LOCKED",A="FL:::/Kernel/KernelA.HH,3288"$ +$LK,"FILEMASK_SRC",A="FL:::/Kernel/KernelA.HH,2291"$ +L8G›Ý›Ý¥Ý¹Ý»ÝÉÝËÝÜÝòÝÞÞIÞMÞMÞRÞDVcû#û#ÿ#$$&$2$@$L$S$X$i$j$n$@4@«"«"³"·"Î"å"ü" ##%#,#=#>#B#,‡ŽSSS'S,S0ST†×H›H›L›d›q›v››„›‰›Ž›“›˜››µ›Ö›ç›œœœœ!œ&œ/œ4œ<œZœZœ_œoœuœœ„œœ”œ’œ¢œ§œ·œÈœýœ).38YWgsŠ“š¦²ÔÔÛâçî÷øžžÄž<#{!{!Ž!¨!Á!Î!Õ!×!×!à!î!D’Ÿ;;IWems’’›ˆ/Mê±ê±ú±²²²²:²F²U²b²o²t²z²‰²²–²–²š²š²š²š²§²ª²º² 0ÎÖÓ–Ó–í–————$— +Ì ;X9X9p9v99“9Ÿ9´9º9À9Æ9å9ê9ò9ò9:: :0:6:8:G:K:Z:`:c:e:t:x:‡:::’:¢:¦:º:½:À:Â:Ñ:Ô:à: Ä¥Òà6à67 77 777A7G7J7M7P7Œ77’7”7§7ª7­7µ7»7À7À7Æ7Ò7Ô7Ý7Ý7Ý7Ý7ã7æ7ë7î7ö78 ˆCaÚ¼Ú¼½½ ½½½#½)½,½8½8½f½s½}½€½ƒ½н’½˜½¥½¥½»½ h¤¤ˤÙ¤è¤ó¤¥¥#¥3¥B¥Q¥a¥q¥’¥”¥£¥²¥Â¥Ò¥þ¥þ¥¦4æï«—«—Å—Ó—ë—þ—˜˜ +˜h:P a a.a0a=aJaQaXa`ada{a—a«aºaÂaËaÍaÍaÕa44=`I`InIŠIŠII§I§I­I TXÃùÃùÑùßù(-3["["c"}"…"š"œ"¦"HÜêQvQvqv~vƒvv¯vµv»vÈvÑvÒvÞv(Z`®Û®ÛÈÛÚÛâÛèÛðÛ$ü²ˆ²ˆ»ˆÃˆÉˆÎˆ0¯·"Ó"Ó8ÓCÓTÓVÓ^Ó8– ÐcÐcÞcåcðcõc÷cddddPr‚ÈbÈbÖbÝbèbíböbc cccc"c(c€[wÂÂ0Â4Â8ÂOÂ_Âu‹Â¹¾ÂÊÂÐÂÓÂÚÂÞÂâÂæÂêÂêÂê§Ãà:.R†R†k†s†ކ™† †­†º†džÛ†î† ‡‡%‡5‡>‡A‡K‡O‡j‡o‡v‡~‡‡“‡¡‡°‡Á‡LJ͇ه臈ˆ ˆˆ<ˆKˆRˆYˆYˆ`ˆhˆuˆwˆ‰ˆ‘ˆ“ˆˆ¤ˆ¤ˆ¤ˆ«ˆ³ˆ½ˆȈÔˆâˆøˆ'‰'‰K‰K‰R‰\‰r‰”‰™‰™‰ ‰¨‰¾‰à‰å‰å‰è‰Š +ŠŠŠŠ:Š:Š?Š?ŠGŠLŠPŠ`ŠcŠ|Š|ŠŠŠ”Š›Š¥Š»ŠÙŠÜŠÞŠÞŠñŠøŠ‹‹4‹7‹9‹9‹T‹W‹w‹’‹›‹¤‹¨‹¶‹¼‹¼‹Ù‹Ù‹Ù‹Þ‹Þ‹Þ‹ê‹ý‹ŒŒŒ Œ$Œ$Œ)ŒAŒDŒjŒnŒ‰Œ¢Œ«Œ´Œ¸ŒÆŒÌŒÏŒÔŒÔŒäŒçŒêŒøŒ +#/;Kcˆ•™¯ÉÛäèëëûŽŽŽ Ž'Ž3ŽPŽSŽUŽfŽmŽyŽ’ŽŸŽ¢Ž©Ž¬Ž®ŽÆŽÙŽàŽîŽîŽîŽõŽ "(/:CRap™4×à+—+—?—M—e—p—r—r—z—@?K³³»ÂÏÞí%.MQ`ˆœ»%»%É%Ö%à%à%ó%û%&&#&#&'&1&6&6&<&|w’º£º£Ú£ê£õ£ú£ü£¤¤&¤6¤G¤W¤Y¤Y¤Y¤_¤x¤•¤¥¤§¤§¤°¤¼¤ XÓåû7û78 88.8:8A8X8Z8q8q8s8v8|8 @8DÚ‰Ú‰è‰ê‰ ŠŠŠ#Š!|ÿ##TWenn…–«°ÃÇØëô   + . c "4ÑÚËpËpßpñpqq$q*q3q#¬Elð€ð€*<P[ayy›¥´¹¹ÅÅËË5‚:‚:‚b‚b‚p‚s‚v‚„‚Š‚“‚»‚$,Ûâ3q3qAqdqOqtqzq¡q% †Š \ \)\6\;\&H—¥ŽŽ©«¼ÈÍÙÙÝç'Œ¬Ëøø'ø*ø3øOøbøbømørøzø”øœø¯ø¹ø¾øÊøÐø×øäøçøðøóøöøûø"ù( lpîÊîÊËËË)D6C€•€•œ•ž•±•¶•ƕӕٕܕè•*p¼Ônn|Š ¯´ÄÆÌÕÝè!!(((+h#9°v°vÆvÈv×vëvívövøvøvûvwWwdwnw~wˆw“w–w¤w,$gl(y(y,yËAËJËxË{ËË„Ë˗˹˼˾ËÅËçËêËêËíËøËÿËÌ8@-9QQQQ%Q,Q3Q4Q PTÖëÖëÚëìëîë?L¡°bØbØl؂ؑؗئجػØÁØÐØÖØåØëØíØòØ@H!*‰*‰8‰D‰I‰I‰Z‰l‰q‰q‰w‰A, ^ ^)^2^>^K^Q^V^BLõ:œ:œHœKœWœaœgœtœˆœˆœªœªœÇœËœÏœÕœC …‰NNRaeD\˜«^÷^÷r÷€÷…÷‹÷–÷Ÿ÷Ÿ÷¯÷»÷¿÷×÷Þ÷á÷ã÷øE4Š“ffjt„¥ººº¾F,jqLLLSLcL‰L“L•LG¸Ç77 7(737R7[7q7…77›7¦7¦7µ7Ö7û788&8189898H8i8Ž8›8£8¹8Ä8Ö8Ö8ä8ë8ý8ý8 9 9 9 9H ”˜¾¾ÂåéIpu*×*×D×V×r×r×y×{×{׉׋׋חח×ץש״×Ì׿׿׿×ó×J D`{`{h{t{œ{°{´{Ã{Ï{Ý{ì{1|1|]|z|„|“|‘|À|À|æ|æ|ë|ð|ð|ÿ|}8}S}a}ƒ}›}¶}¿}Ã}Å}Å}Ñ}Ñ}Ó}Ó}ã}ï}ï}ó}ø}~~~(~7~o~x~Š~Š~~ë€K|7óþóþ ÿÿÿ(ÿ+ÿ9ÿ<ÿ@ÿBÿEÿHÿPÿSÿ[ÿoÿyÿÿ•ÿ˜ÿšÿ ÿ¬ÿL4•žÂ|Â|Ì|Î|à|ç|}} }M,'.¦ê¦ê°ê²êºêÔêÙêßêNXƒ•(c(c:c=cHcMcZclclcuc‰c“cœc²c½cÄcÎcOQqØaØaòaýab bb6b>bFbSb]bdbkbobsb~b„bb‘bšb b£b±b³bÁbP­é««ÅÌÝà!/Xq}„†‰“¤®´·º¼ÈØàæóöù(46FSYfz}€ˆˆˆ—žž¬ÄQ ™îîò R„ *öØöØÙÙ&Ù3ÙOÙRÙXÙaÙmÙoمٟٛٺٽÙÃÙÐÙÜÙÞÙÞÙîÙñÙÚSˆ åå#å.å>åMåYå}å}å}å…åŠåŠå®å½åÞåöåþåææ æ ææ%æ%æ7æ<æDæT,æíƒ8ƒ8‡8 8§8©8U ž¢!%VTFWÆÆéðúþ-9<JW £§&&*7;X äè.ñ.ñ2ñHñJñYHúqwqw‘wžw£w¯wÏwÕwÛwèwñwòwþwZHëùávávwww w?wEwKwXwawbwnw[ ¨¬>>BGK\ ­±NNRae]<æñÊÚÊÚÛÚçÚëÚ÷ÚùÚÛ ÛÛÛ^dl[[[[c[g[g[v[•[¤[­[¶[Í[ß[è[ï[\\#\/\1\_´¥ÎàRàRëRüR S.S9SHSUSnS…S‰SS•SS¦SÄSÌSãSçSëSïS÷SÿST&T9TBTSTZTZTkTtT`0&$¢$¢-¢-¢D¢g¢g¢l¢adÆÛSfSfafffvf{fŠff‘f—f¦f«f­f¼fÇfËfÑfb8 “.“.­.±.´.¿.Ü.à.å./c ’S’S›S¦SµSdDÀÍee2eIeVeVe`e€eŠeeLš©ªVªV¸V½V¿VÎVÐVÞVéVòVòVóVùVf,bi˜K˜KœKÓKãK LLLg,RYJJ”JËJÛJKKKh0ÇÏ2š2šFš…šŒš’šŸš²š¾ši[c c k v ~ Ÿ ® · Ë Û î û  , 5 B N Z _ |   Ž ˜ ¬ ¹ Ò á ô !!$!?!J!_!}!‰!’!—!´!½!Ê!Ù!î!"""&"&"&"+"9"D"K"V"["b"j,ry˜L˜LœLÓLãL MMMk$û³g³gÓgàgægògl$+0ÚÚÚ(Ú:ÚvÚm¨Ciʧʧó§ø§¨ ¨¨"¨"¨*¨S¨\¨a¨j¨m¨r¨r¨ЍŸ¨¢¨¥¨«¨²¨¶¨å¨é¨ñ¨ó¨þ¨þ¨©©©"©n<$/ЦЦ˜¦ ¦¨¦¸¦ĦΦý¦ÿ¦§oü¢ÝûSûSTT-T7TFTUTUT{TT›T¢TÅTÒTàTîTüT +U*U U6UHUSUeUwU~U…U’U™U¡U±U¹UÉUÕUÿUV&V&V.V1V?Vp@nz,¥,¥9¥A¥D¥R¥V¥Z¥]¥k¥r¥w¥q(b’€’€¥€«€º€Ä€É€É€Õ€Ü€á€ë€ü€ !#>n…ž©»ßáú‚‚'‚@‚J‚U‚c‚j‚x‚x‚‚‚›‚Â΂å‚ê‚ì‚ö‚ƒƒ#ƒ>ƒrD/<æêæêïêëëë$ë2ë=ëEëJës<²½ónón oo0o9oSoZopovo|o²ot,››ŸÌó 57u<bmä¤ä¤ñ¤ù¤ü¤ +¥¥¥ ¥$¥)¥v|0®®¿É×ï  6 = N [ f m ~ ˆ ˆ ™ ¡ ¦ ­ º Î Ù wLš©••/•6•=•I•R•l•w•|•…•›•ª•´•´•É•x8rWrWˆW•W§WÁWÏWØWâWy ~ò~ò‚ò›òzÔ._óóû$3=ITbq‚ž¦²ºÂÂÍÏäðHYfž ²»»ÍÍÛâôô {4¨±snsn‡n™n¢n¼nÃnÙnßnòn|0PX[R[RcRyR„R“R­RµR}PZjS“S“e“l“u“ƒ“ˆ“‹“‘“”“™“¤“ª“´“~d¦»îî +!,14DOUX[]amH<JNôNô^ôdôoôxô{ôˆô‘ô‘ô•ô˜ô ô€$@Ežž§µ»À4ÕÞ,:BMfkrx‚¬Lsªyªy¼yËyÑyåyøyz"z9zLzczzz‘z¬z°z·z½zÁzÓzìzùzÿz{{%{+{/{A{Z{g{m{p{z{ƒ?°;°;¸;À;Ñ;à;ê;ö;ö;ú;<< <Y<k<<£<¬<µ<µ<º<Í<Ò<Ý<ó<==@=s=„=”=ª=¾=Å=÷=*>;>K>K>R>d>d>r>r>s>…>…>“>—>›>„P—§ËmËmámômn n)n+n7nPn[nanenmn…0lt¶¶ÄÓÞäææì†<KV(x(x1x;xKxMx€x‡x‡x‡xŠx‡˜ò"©ˆ4ŠÓÞÐÞÐöÐþÐ ÑÑÑ!Ñ'Ñ5ÑJÑOÑUÑlÑqÑwюѓљѰѵѻÑÉÑÍÑéÑüÑÒÒ#Ò0Ò@ÒOÒ\ÒoÒuÒ|Ò~Ò‘Ò«Ò²ÒÀÒÒÒÒÒåÒçÒúÒüÒÓÓ$Ó$Ó@ÓWÓ]ÓcÓnÓ’Ó‰Hžòžò§òÂòËò×òÙòÛòêòêòùòûòûòóŠ\ÜïÓfÓfãfñfüfþfgg%g0g2g7g9g:g:gBg‹(©¯;ô;ôFôZôkômôŒD¾Ë>ð>ðMð[ðjðvð}ðŒð˜ð˜ðžðt3ï3ïCï]ï]ï_ï_ï_ïsïuïuïuï~ïï˜ï©ï´ï·ï¹ï¼ï¾ï¾ï¾ïÌïŽD9FËQËQàQîQîQöQ RRRRR¤6[8Œ8ŒRŒZŒ^ŒfŒrŒyŒ€Œ…ŒšŒ«Œ¯Œ¯Œ¼ŒÃŒÈŒߌâŒëŒñŒôŒöŒ !(,:81;vÚvÚ„Ú›Ú¦Ú¦Ú±ÚµÚµÚ»Ú‘$<Û&Û&ã&ó&''$'-';'I'P'['g'|'Š'’'§'´'É'Ö'ë'õ' +(()(3(H(V(V(d(p(|((·(Æ(Õ(ã(ï(û( )!)6)G)Q)c)u)‡)™)Ì)Ú)ï)*+*4*C*^*u*~*‰**›*¥*®*¾*’0‚Š3\3\7\H\d\y\~\˜\“02:’’/’:’L’T’W’_’”¼Kv“b“b¯bÐbâbéböbc +ccc(c3cWcfcmctc…c‡ccšc¥c´c»c¾cÀcÆcÌcäcícícñc +d•,ÑØFùFùTù`ùwù{ù}ù‘ù–P YX^X^r^u^{^‡^‰^˜^Ÿ^¥^Î^Õ^_ _ _%_1_N_W_W_W_d__©_µ_Â_Õ_ã_ô_``%`<`B`‰`›`È`Ï`î`õ`aaa(a*a*a6a8a8aDaFaFaVaYaYaeaqaŠa–aŸaªaÀaÎaÎaÎaßaøaÿab bbWb—P&H”H”h”{”‡”“”©”¯”º”À”Å”Ç”à”˜4#˜H˜H¡H¶H¶HÃHØHØHÝH™ ÌÐ&ù&ù4ù=ùCùš0ÐØÂššÖš››"›:›=›I››¼ +5‹‹&‹*‹1‹8‹E‹S‹\‹_‹e‹k‹r‹y‹{‹…‹Š‹”‹¢‹¨‹·‹ËÆ‹É‹Ñ‹Ö‹ì‹ø‹û‹þ‹þ‹þ‹þ‹Œ ŒŒŒ Œ1Œœ0HP&þ&þ4þBþJþmþ†þ®þ€ÀWÀWÔWÛWãWëWXXXXX'X)X)X7X9X9XIXQXQXZXfXƒXƒX•X•X™XÀXžXþ```1`B`M`i`l`z`€`ƒ`”`¯`³`Ÿ@¡­ d*d2dJdJdSdgdmdvd’d–d @$0ƒøƒø‘ø–ø™ø«ø±ø´ø¶ø¼ø¡H&4 +Ý +Ý Ý+Ý.Ý7ÝCÝKÝhÝwÝ}݀݌ݢ îòvñvñzñ‡ñ‰ñ£ä{°èyèyzz2z{P{P{P{P{[{[{i{¤ ÑõëJëJ +K KK"K0KQK_KmKxKK—K™K™K«K±K·K¹K¿KÅKÈKÎKÐKÙKèKîKîKîKõKL¥T…–*-;;O_jp{{{¦`p„nÿnÿ‹ÿ‘ÿŸÿŸÿ³ÿ¾ÿÂÿÉÿÌÿÖÿÝÿíÿñÿñÿñÿõÿ§Hïý2Ê2ÊYÊwÊ…ÊʔʘʜʦʰʰʲÊÀʨD"/z‰z‰ˆ‰”‰™‰™‰ª‰¯‰¯‰µ‰©t¹ÒË6Ë6Ó6ä677 7D7R7`7i7|7ƒ77›7±7Ç7É7ß7õ7õ7õ7÷7ªX{HH4HDH\HhHtHtH†HŒHŒH˜H¤H¦H¦H®H«XÙëƒAŒA“A©A¾AÔAÜAóAýAB B&B;BBBJBOB¬8x‚ªÃªÃ°Ã®Ã¾ÃÜÃèÃêÃêÃnÄ­8>H°I°I¾IÄIËIáIáIèIJJJ®<u€´´´+´2´6´9´=´D´h´x´¯`«¿R}R}V}m}Ÿ}Ò}ë}ú} ~~~~°L{÷{÷–÷²÷²÷¿÷¿÷Ì÷Ì÷Ü÷à÷à÷ð÷ò÷ò÷)ø±d@Õ > >«>Á>È>æ>÷>??"?6?N?f?y??š?Ä?ß?ü?!@&@?@T@t@‹@›@@Ó@*Aû@ù@IAZAaAA–A°A°A×A×AöAýA9BGB§BxBvBÆBÍBÒBèBðBðBC%CFCŒCYCaCLCµCçCïCïCD$DEDODfDnDYDÂDÂDÂDÇDÇDØDóDEE2EKEfE~E”E¬EºEÅEÅEØEñEFF8FFHFHFOF]F`FgFgFnF|FFƒFFF›F¡F®F¼F¾F¾F¾FÁFÆFÒFÒFÞF÷FúF G GGG#G¶4mvS<S<]<]<<£<ß<í<ñ<·À6b+í+í6í:í^íiíxí„í˜í·í¿í×íçí î î/î1î1îUîWîWî{î}î}î‰î‰î‘î‘îî±îÁîÉîÉîÛîâîâîôîï ï0ï¸ÈÉ÷C(C([(e(v(v(ˆ(((Ÿ(¤(¤(¶(»(»(Í(Ò(Ò(ä(é(é(é(é(ð(õ(õ() ) ))#)#):)g)|)|)Ž)•)œ)¥)´)*¹ˆTr:U:UPUUUaUaUmUuU}UˆU‘U™UžU U¤U³U¾UÆUÎUÏUÏUÙUº(w}ó<ó<ü<=#=*=-=»üF++37Xcl‚–¢ºÍî$F[dfnv• ­±µ·ÊÑäôû')---9EEJSell~„™¼„a~öÛöÛúÛ Ü ÜÜÜ'Ü'Ü6ÜEÜEÜYÜTÜhÜcÜrÜrÜÜÜÜüཨs™ÚUÚUôU V!V(V3V9V9VvAvDvIvKvOv[vlv{vv„v‡vŠvŠv”v—v©vÄ„c€¸p¸pÛpßpìpñpõpq)q3q3qIqUq\qoqtqxq‹q¬q¶q¶qÊqÊqÍqÛqÅP]mnènèwè…è…èè³èÂèÛè÷èé é;é<éAéÆL–¥r€r€€€Œ€—€¨€¼€À€Î€ã€õ€þ€+ÇÜ›Î[ [ c g ˆ •   © ¿ Ò ç û *7Jhq~Š––£­½Óé %*3ELL^d‹È,zNíNíRí‰í í íªíÉ,fmëŠëŠùŠÿŠ ‹‹‹!‹ÊH´Âšš£¯ÂÍåçíøü‚‚ËdÃØ +‚ +‚‚+‚6‚R‚T‚j‚€‚“‚©‚Âǂ̬޵³H³HÏHÑHëHúH'I1I6IeIlInInI}I‡I’I—IšI©I®I½IÖIÝIÝIïIûIÿI JÍP(8CQCQXQlQwQ‰Q’QQ¢Q§Q¸Q¾QÀQÈQÎ ÿþñþñòò òÏŒ'Fl¢l¢|¢€¢‰¢¤¢²¢·¢º¢È¢Í¢ì¢ô¢£"£B£D£L£v£z£š£¤£«£Á£Ü£ø£¤0¤7¤?¤Ð´PyV V t { … Š  ¨ ¾ È Ý â ì ö  þ  , F < V ` z ž ¤ « ¿ Ç Í Ô Û â é ú ÿ ÿ w ÑøµïKžKžižzžž•žœžœžªž¹žÀžÆžØžØžëžûžŸŸ$Ÿ0ŸGŸIŸaŸcŸfŸhŸhŸlŸlŸxŸŸŸƒŸŽŸ”Ÿ Ÿ¨ŸÍŸãŸôŸ     3 ÒÜú-››£§²ÀÉßóý "1Qn†Š£»ÊÎÙåðÿ.<Kw„ˆ•§§µ¼ÎÎÜÜÝñÓ$"'QQ$Q,Q6Q8Q=QÔˆ1OÞ Þ ç   % -3 -9 -? -@,˜g˜g¡g¬g®g®g³gA\m€ByBydyhyty…y‘yšy¹yÅyÎyÔyØyæyB€HYHYXY_YrY~Y¥Y¯Y¹YÁYÉYÑYÝYïYZZ'Z0Z>ZDZJZMZTZ\ZCXŸñXX X(X1X7XCXOXWX]XcXkXyX„XŒX¥X·XÂXËXËXÐXÕXãXêXïXïXõXüXY YYYY&Y5Y9YFYSYXYbYbYkYrY~Y‰Y¥Y¥Y¥Y­Y´Y»YÂYÉYÐY×YÞYåYìYòYûYZZ%ZAZPZSZYZD|KfNïNïmï{ï‹ï—ïï¦ï­ï´ï¹ïÅïÉïÓïÓïÚïÝïãïãïíïûïððððE,KKcn”¸ÀFX ]sbsb{b†b˜bžb¦b°bÓbÓbåbòbccc)cdcrcªc¯c¯cÁcÎcâcïcôcd8d?dPdVd[d[dmdzdŽd›d d¯dãdêdûdeee e ee-e3eFejewe‡eŒe’eŸeªe°e»e»eÁeÊeÕeåeêe ff#f(f(f,fEfGàÊþ##+KZdm~Ž¡®Áßèõ  $J]|¯¼ñÝ%%3>LS^llq}HLRaŒžŒž™ž¡ž¤ž²žµž¼žÀžÃžÇžÕžÜžážI8GQDžDžQžYž\žjžnž|ž€ž…žJ0îî÷ü    KTØéûðûðññ+ñ3ñdñÔñL(LRûû#,.Mœ'JË[Ë[å[\\ \,\8\@\K\V\c\r\{\‚\†\†\Œ\’\ª\³\¹\Â\Ç\Ç\Ç\Ë\Õ\N8‹ccl|‰‰Ÿ¦¦«O¼W‚¨e¨eÎeÑeßeúefff f#f-f:fZfZfxfzfzf˜fšfšfªf¬f¬f¼f¼fàfçfðfúfþfgg>gGgMgTg–gP<#j j x € ˆ ˜ ¤ ® Ý ß å Q$ûZûZ[ [[[RZê¹ê¹þ¹ºººº2º>ºeº„º£º¯ºúǺͺÛºߺåºóºóºóº»1»E»]»a»g»u»y»»‘»‘»‘»‘»”»™»ž»¤»¸»¼»»Í»Ñ»×»â»â»â»ç»í»¼¼ ¼¼¼ ¼)¼)¼)¼^¼SDs€óó÷ 07<AHZZ\T¬ÍôJ²J²l²q²z²z²†²•²¢²¦²°²ƲƲÖ²â²ç²ç²³ ³³³*³*³*³2³@³N³X³[³`³m³z³z³Œ³U-MðGðGH H.H7H7HNH_HtHyHŒH™HžH¢H³HÝHåHéHîHöHIIINIVH®í®í·íÌíÕíáíãíåíôíôíîîî -îW¸9£ÀSÀSáSäSçST(T/T:THTRThTpTvTƒT“T§T¬T»TÎTîT÷TîT U UU U&U(U1U(UCUEUEUUUUUcUtUyU¥UÌUÌUÒUÕUúUVVV%V9V>VMV`VƒVV¢VÂVÏVÂVÝVâVïVâVýVWWWW"W"W2W2WEWVW[W‡W‰W®W®W´W·WÅWÊWÝWèW÷W÷WX|XX0 kåkåyåƒå‰å’å™åå£åY(•2z2z>zDzJzcznzZ¼w¢S^S^}^€^œ^®^µ^Â^Î^Ý^á^å^í^÷^__(_(_/_5_<_I_T_c_i_k_m_s_y_‘_š_š_¡_¼_¿_Ñ_[¬ FóÛóÛûÛÿÛ ÜÜ&Ü5ÜAÜJÜ_܈ܔܜܺÜÅÜäÜäÜ Ý Ý Ý Ý&Ý(Ý(Ý(Ý@Ý@ÝRÝZÝuÝuÝu݇ݎݎݠݦݰÝ\DœÐ0Ð0â0î011)1)1:1J1L1v1]¼Bµµ(µ0µ:µFµTµdµŒµ¯µ¾µéµíµõµÿµ'¶J¶X¶h¶s¶ž¶®¶³¶»¶æ¶ê¶ü¶···&·&·0·:·^@nzsBsB{BœB B³B¼BÀBÂB_ *n8,8,C,G,O,p,},Ž,™,¢,¸,Ë,à,ô,--(-;-C-d-y-„-Ž-³-¸-Â-Ô-í-ü- ...9.Q.U.Z.Z.k.k.~..£.¹.».».Î.Ö.Ö.Ö.è.è.ñ./ -/ -//"/H/`@1=#ó#ó1ó6ó9óKóQóTóVó\óaè¸î°‹°‹Ê‹â‹î‹þ‹ŒŒŒ Œ#Œ4Œ4Œ4Œ;ŒHŒKŒPŒMŒªŒÁŒÄŒÆŒÝŒàŒâŒêŒúŒúŒ 0>GNSSSYmbD b´b´v´ž´Á´δÛ´æ´µ -µµc   æìæìðìííd4zƒ&&4=DMe8êôR–R–`–f–o–u–{–„–‡––ftRk¸t¸tÝtßtøtuuu5u7u=u7uTuVuVufuhuhuxuxu~u¼ug0SKSK\KnK|K€K„K„K‰Kh@ÎÎ)Î1ÎEÎOÎWÎ_ÎdÎjÎlÎlÎrÎiØ"Tj˜j˜€˜˜š˜¬˜ØØÔ˜ì˜ù˜ ™™#™3™U™W™t™™™™’™¾™Å™ΙÔ™Û™á™æ™ì™ð™÷™šš2šjüi¤0]0]O]Q]`]l]x]]’]›]¢]°]¾]Ô]Ô]×]Ü]æ]æ]ð]ó] ^!^^/^4^R^k^t^w^z^^£^¥^Á^»^í^í^___"_%_*_:_A_D_`k” *ãã-U}‹ÎTVdr€€š´Ñãó!3CXqx›·ÃldV¨a¨a¼a¾aÎaÜaæa -b.b6bHbVbabrbwbb•bšb³bÓbÓbôböböbccc:c+C+W+o+†++¸+Î+à+à+ ,",%,7,o<5@â}â}ú} ~~~ ~5~8~=~I~p0 B B$B8B8BLBPBTBq¼ -5£å£å®å²åÖåáåðåüåæ'æ?æOæoæoææ’æ’æ³æµæµæÖæØæØæäæäæìæìæøæ çç$ç$ç6ç=ç=çOç\çhçlç‹çr\QdŠ‹Š‹š‹œ‹§‹¬‹¿‹È‹Í‹Ò‹â‹ï‹ï‹õ‹ŒsŒoŽH/H/S/[/f/q/|/…/›/¯/¸/Ì/ó/ 0#0+0A0I0g0s0~0–0¡0¨0³0¸0Ë0txˆ¢{õ{õ—õœõŸõ¬õ²õµõ½õÆõÕõÝõÝõèõèõðõòõòõùõüõöu0 ŒŒŒŒ1Œ7Œ9Œ?Œv ííí í!íwLDSHH`bl•£¥ºÅËàx0 SâMâMúMüMNNN!N.N6N;NANCNGNWNeNuN€N…N…NŒNŒN—N—N¶NÄNÏNÑN×NÙNÛNÝNÝNèNêNòNøNúNúNOOOOOOOO&O*O6Oyx8 S S6SSSZSfSuS{SS”S¢S¨S®S±S»Sz´5^˜ƒ˜ƒ¼ƒǃσÞƒãƒèƒøƒýƒ„„&„-„3„:„B„P„V„X„h„h„o„u„|„„„’„˜„š„š„ª„¬„¬„¼„!…{O‹R‹R¥R³RÌR×RîRûR S"S2S9SJSUSdSoS‹S‹SSšS¦S¨S¨S¨S®S®S±S»S»SÖSãSãSèSøS TTT$T4THTpTTŒTŒTžTžTžT´TÄTÛTäTêTúTþTþTUUU|,07ºƒºƒÃƒÍƒÎƒÓƒ}týâÕâÕóÕÿÕ ÖÖ%Ö1Ö1ÖCÖIÖIÖVÖbÖÖ›Ö›Ö›Ö›Ö¡Ö¡Ö±Ö³Ö³ÖÜÖ~$‚‡VèVèZègèè©è<7Bk”k”””›”£”³”º”¼”Ä”€,xBxB|BB”B”B˜B, -XBXB\BpBtBtBxB‚hN¤PIPI[IfIvI~IŸI®I¿IÈIÜIôIJJ'J/JPJeJpJzJŸJ¤J®J»JÍJæJõJõJK+K5KRK]KeK€K‹K K©KÃKÒKÞKçKìK LLL5L1LKLVL^LiLiLiLtLtL…L…L˜LªL½LÆLÆLÙLéLñLñLñLÿL -MMMM1M5Ma>aDa¦a‹HZh¸\¸\Ì\á\ë\ÿ\] ]]]] ]0]Œàø,Ã$Ã$Ö$Ý$û$û$%%7%7%U%j%v% %¦%«%Ò%ï% &)&F&c&€&&º&×&ô&'.'K'h'…'¢'¿'Ü'ù'(3(P(m(Š(¤(¾(Ø(ò( -) -) -))+< -BŒBŒVŒeŒuŒxŒzŒ‚Œ…ŒŒŽ(óù6ì6ì@ìJìtìyì$;b;bUbqbP¨¸Ë0Ë0Ï0Þ0ã0ï0û0111#1(191P1h1j1‘@ ó3ó34444)4042474D4’X¢B¥B¥W¥a¥e¥e¥¥°¥»¥Ù¥ê¥ì¥ì¥ô¥“,Š‘ÞÅÞÅòÅÆ ÆÆ ÆGÆ”x£½¶é¶é¿éÌéÛéìé÷éê2ê8ê>êEêXêzêzêŽê˜ê ê©êÁêÊêÊêßê•8¶À³D³DÏDÜDáD÷DúDE–(¿Å,¡,¡4¡>¡T¡— žÂÛ9Û9é9î9ö9þ9 ::':,:>:S:i::•:§:®:®:Ä:Ñ:Ñ:ç:ö:ö:ý:; ;;;˜8§+&+&9&A&I&j&€&‰&&™P:J¨q¨qÀqÌqÔqÛqäqêqíqíqrrrr#ršð8p”£”£®£¾£Å£Í£Ô£ð£ ¤ ¤¤¤#¤%¤.¤7¤9¤9¤B¤Q¤S¤S¤\¤e¤j¤j¤s¤|¤¤¤Š¤“¤˜¤˜¤˜¤¡¤ª¤¯¤¯¤»¤Ä¤É¤à¤ä¤ä¤þ¤¥¥¥¥„¥›XÓåRÔRÔZÔfÔqԀԌԕÔÔ¬ÔÈÔùÔùÔ ÕÕÕ$Õ%Õ)ÕœÈÝ P2P2l2r2|222ˆ2“22§2³2µ2»2Â2Å2È2Ð2Ü2â2ç2í2ð2ò2ý23 3333#3)32323232383@3C3S3,™ šÒšÒ£Ò¯Ò·Ò¼ÒÁÒž8ak  , 6 @ K S U U [ Ÿx^xKfKfafhfvfvf‚ff¿f¿fÂfÄfÄfÉfÉfËfËfËfÍfÍfÍfÖfÙfÜféf ,ÛâÚÚãíîó¡$(-ª›ª›¸›À›Ò›Ø›¢<@Krœrœˆœ’œ–œ›œ§œ¬œ°œ´œ¾œ£ úþ~ì~ì‚ì¢ì¤ì¤t.:«:«J«V«_«p«˜«»«Ê«׫ë«â« ¬ ¬&¬(¬*¬0¬2¬?¬B¬J¬¥h^tŠ­Š­¬­²­»­»­Ä­Ó­à­®®"®$®6®6®6®G®T®T®b®¦@y…`•`•d•e•t•}•ƒ•‡•‹•¡•¦•¨•§<ðû3š3šHš7šWšš¨€¹*°*°H°Y°a°t°†°‘°œ°²°¾°Ô°ê°ò°ò°A±F±F±i±i±€± ±§±ɱ©˜ìû<û< === = =.=3=L=U=`=b=c=c=o=z=|=‹==™=£=±=¶=Å=Ì=Î=Î=Î=Ô=ª€›þÚþÚÛ -Û!Û!Û8ÛLÛjÛlÛ„Û—Û¢Û³ÛÊÛÊÛáÛõÛÜÜ-Ü@Ü@ÜCܜܫ8—¡˜V˜V®V·VÁVÌVÕVØVâV¬4<Eà4à4ô4555 5 5'5­hqÇ„¥„¥¢¥²¥¹¥Á¥È¥ä¥è¥¦¦)¦)¦)¦2¦4¦4¦=¦?¦?¦H¦J¦J¦S¦U¦U¦^¦`¦`¦i¦k¦k¦t¦v¦v¦¦¦¦Š¦Š¦¦’¦’¦’¦•¦˜¦¡¦»¦Ë¦â¦õ¦÷¦ú¦ü¦ÿ¦ -§§§§§§§&§3§8§8§A§U§X§]§]§f§f§t§x§S¨® ¢¦èVèVñVþVW¯`UiJJ3J>JDJOJQJbJoJuJuJJ°0;CkLkLtL‚LˆL™L›L›L L±(‹‘@V@VTV_VhVkVsV² \€#ã#ã+ã6ãFãUãaã…ã…ãšã¢ã§ã§ã´ãÊãÖãÞãæãøã%ä1äDäLäQäQä]ä]äoäväväˆää”ä³°.V á ááá.á=áIámámášá¿áÄáÄáÙáááæáæá âââ/â\âhâ{âƒâˆââŸâŸâ«â«â½âÄâÄâÖâÛâçâ´8LVz~z~Š~~~”~~ ~¥~­~µ €„Þ Þ â ñ õ ¶([[[[d[n[y[[†[·DˆXˆXœX®XµX¹X¼XÇXÏXãXæXîX¸h²È  0 G Q e { Ÿ ¹ ¹ Ï ò     +¹X=Oöåöåæææ æ@æGæTæTækætæxæ|æº\r…ˆˆ¦ˆ­ˆ¼ˆÈ̈̈æˆñˆùˆ ‰‰‰'‰'‰E‰»PFV(5(5F5L5Q5m5s5x5–5˜5¦5¬5¯5½5¼lXoŽùŽù¯ù²ùÀùÀùÌùÓùØùÛùáùäùìùñùñùöùùùûùÿùú½Œ~Û7Û7ä78:8e8´8Á8Ã8Û8Û8*97999Q9Q9a99ˆ99—9Ä9Ë9Í9Ò9Õ9¾ˆ;YcŒcŒlŒvŒvŒ†Œ“ŒœŒ¥Œ®Œ·ŒËŒËŒÖŒÜŒÞŒíŒõŒ 668HNS¿4 ò|ò|}}}(}+}1}9}Àd±ÆRÓRÓhÓtÓyÓ‡Ó‰ÓšÓ°Ó¿ÓÐÓÖÓÖÓñÓùÓÔÁ¨'2š2šDšOšTšbšnšzšƒšŽš™š¤š©š·šÅšÓšòšýš››4›@›H›S›U›f›q›x›†›•›—› ›ª›Â W[ëâëâãã!ãÃD8Eúú'ú1úCúJúQúaúlúzú}ú…úÄ<)4’}’}©}¬}±}´}Ç}Í}Ð}Ò}Ü}Å´`Ékkv—ž­ºÇÖêú0Q`mvv²Ó %9U`€‰‘š¬¾Þó 5O[mr„–®¾ÊÝÝ&@NZffk{‰¢ÌÓØøÿ$$GV€‚‚‡¢©´´Â××èï Æh - æõæõôõöö'ö3ö<öEöNöWö`öiörö{ö„öö–öŸö¨ö¨öÀöÇ0¾Æûiûij5jLjXj^jdjƒjÈX’¤€0€0Ž0—0£0©0¬0±0·0º0¿0¿0Ì0Ð0Ó0Ó0Ù0ÉLþ RR*R8R8RBRLRiRtR}RƒR„RŠRÊÜ´@l@lflnlzlll¥l­l½lÌlÌlÑlïlòl÷lmm m*m*m?m?mUmcmimqm|mšm¤m§mªm¯m½mÓmÝmàmãmëmùmnnnn#n'n9nËôÈ€3€3ˆ3Œ3”3¥3´3¾3Ê344)4)4-4<4F4Y4a4e4t4‘4–4–4¬4´4Ç4Ö4û4555(575\5i5t5Š5 5»5Â5Ô5Ô5â5â5ã5õ5õ566 6Ì8AKJ~J~Z~]~_~d~g~j~o~w~ÍDŽêyêyîyôyúyzz zzzz$z*z,zÎhÖ,8C8CCC[ClC{C…CŽCŸC·CÏCßCòCúCD0DFDPDuDzD„D•D§D¾D¾DâDE -E -E)E÷@÷_÷v÷•÷»÷Ú÷ä÷î÷ü÷ø,ø5ø5øNøXøqøøøˆøøÈøÖ¼\‡CôCô_ôbôkôtô~ôô“ô–ô›ô®ô±ôÄôÄôØôÚôÚôîôîôñôôôõõõ"õ)õ0õ3õ8õMõPõRõRõgõgõgõyõ×`¹ÍKKgjou~ƒ—£§¯»½½ÀÌØ ’–xVxVVŽV“VÙ\"ðXðXYYYY Y#Y*Y-Y5YR>RHRaRoRxRƒRŽR‘R˜RR¥RªR·R¼RÎRÕRûRþRSSSS"S0S÷4 (b}b}p}r}w}€}ƒ}ˆ}Ž}øV€O€O›O¡OºOÆOØOâOòOõOP/P2P6PaPdPoPzPŒP”P§PµPÄPÖPßPìPûPQQ)Q)Q5Q@Q@QSQVQfQsQ|QŒQŽQ¡Q«Q»QÄQÔQàQàQàQæQíQòQøQúQ Rù$N“MM MM*M/MCM`MyM–MžM½MÐMìM:N>ELSY\é 8mw²Ë²Ë¼ËÄËÕËêËòËõË÷ËûËPÙ颕¢•¶•¿•ؕ镖–+–5–B–B–D–L–H¾ÌRR`lqq~••›Hao66"636C6F6H6U6Y6\6f6l:QKKVet¡­»ÄÓå;DY``uvz Ÿ3ê3êUêXê_êuêŽê’êšê¬êÊêÊêÊêÊê×êÝêåêñêöêöêýêëëëë"ë)ë2ëDëVë[ë^ëeëeëwë‡ëŽë›ëºëÐëéëíë ì$ìXìXì_ìhìnìpìpìpìpìpìpìpì„ì‹ìŽìžì¤ì¬ì²ì´ì´ì»ìÄìÆìÆìÆìÉìËìËìÒìÕìÛìÛìÞìôìíí í í'í-íBíEíeíeíjíjíjíqízí‚í‚í‚íí•í˜íCîxÇáp'p'Œ''”'Ÿ'§'Ä'Ï'Ö'Ý'(( (3(>(C(C(K(w(‚(‡(‡(‹(š(œ`ƒú~ú~'-007=QVY^gggku„Œ¡¬ÂÆÈÝáááëŒph6h6†6‰6¡6¡6£6´6Á6Æ6Ì6é6ì6÷6û6û6777)7-7-76797G7d)ܡܡ¢ ¢&¢1¢4¢:¢B¢V¢f¢s¢u¢ƒ¢¢ ¢´¢¶¢¶¢Æ¢Xx@”@”J”P”W”]”v”›”¯”¯”Á”È”à”ù”•$•(•4•6•A•L•W•W•[• UY~Õ~Õ’Õ¡Õ©Õ€ûÚûÚÛ(Û?ÛQÛfÛlÛqÛwÛzÛˆÛ”Û—ÛšÛ¦Û«Û´Û¹ÛÀÛÙÛÙÛïÛ@v‚â£â£ë£¤6¤C¤P¤[¤~¤†¤‹¤Ìh—ðð1ð;ðIðOðYðYðfðlðpðsðuð|ðƒðð™ð¢ð¶ðÎðëðÛðñññ6ñ8ñEñLñcñoñwñyñ“ñ®ñºñÊñòì¥Üƒ†ƒ††¥†­†¼†Í†Ï†æ†ø†ô†‡‡‡#‡*‡3‡Q‡M‡`‡p‡‡‡˜‡›‡ ‡¦‡Æ‡Ü‡é‡ð‡û‡ÿ‡ˆˆˆ ˆ#ˆ)ˆ8ˆIˆNˆZˆeˆwˆL&5¨G¨G²G¹GÄGÐG×G×GÝGäGôGöGýGHH,z^Å^ÅrńŊÅÅ–Å <0;Ó Ó å õ !)!/!1!1!7! 0š¢êÌêÌóÌùÌÍ ÍÍÍ#Í!<£®*Í*Í9Í>ÍYÍpÍtÍtÍyÍyÍÍ"8NXBÐBÐRÐZÐnÐzÐ}ÐЇÐ#\õ’³’³ ³¥³­³´³¹³á³´´´)´F´N´U´U´X´^´$,“šéé,éFéSéXékéqé%¼Òý‹P‹P·P½PÖPîPõPQ QQ Q>Q>Q]QgQoQvQ~QˆQQ¤QµQÆQÛQâQëQñQùQùQýQR&4#³ò³ò¼òÁòÊòÓòÙòÙòÞò'< nÒnÒ‚Ò•Ò¢Ò®Ò¶ÒÒÒâÒåÒõÒ(4ÓÜ2222'2'242<2A2I2),W^ËAËAÙAÛAíAõAúAB*Dëøëøøøùùù$ù,ù4ù<ùDùNùSù+^šëëó$-;IUf{§¶Öåø2;Jeƒš®»ÉÕêÿ".<Qc|…—¢¬µ¹,(QWVùVùaùuù„ùˆù-0X`ö -ö -ÿ -      .@ ÃÃ×åóý  ) 3 = C /ˆ ³F³FÓFÝFàFèFøFøF GG,G6G8GWG\GmG{G†G—G¥G¯G¯G¯G¿G0PÙé>ô>ô\ôoô{ô•ô¦ô³ôÇôÎôÔôãô1$mrhshsls|ss‘s2H¾ÌXXXX4X?XHXJXVXYX\XfX3D&‹[‹[”[¢[¢[¤[ª[µ[µ[Ä[Å[Ê[4(¤ªrwrwvww†ww’w5D.;ŽîŽîœîªîªî²îÑîëîëîïîõî6d>Scócó|ó€óŒóŒó˜ó˜ó¥ó¥ó´óÃóÒóäóùóôôôô7ÔT–͖ʹ͸ͻÍÌÍßÍéÍïÍóÍöÍøÍþÍÎÎ ÎÎ!Î9ÎAÎDÎUÎiÎpÎzÎ~Î‘Î”Î Î¥Î«Î³ÎÆÎàÎèÎëÎüÎÏÏÏ*Ï8ÏRÏ_Ï~Ï~ÏϧϴϹϹÏÊÏÞÏåÏêÏêÏûÏÐ&Ð+Ð+Ð1ÐBÐVÐuÐzÐzЀБХÐÄÐÉÐÉÐÚÐîÐûÐÑÑÑ%Ñ2Ñ7Ñ7ÑHÑ\ÑiÑkÑkÑkÑkÑkÑ|єѣѥѥѶÑÊÑÓÑÓÑÙÑÙÑâÑâÑkÒ84ÃÌÃÃ(Ã-Ã8Ã;Ã?ÃEÃ9l 7ÃGÃGáGäGìGHHH H6H@HBHaHfHwH…HH¡H¯H¹H¹HÇH:ˆ7UËHËHñHõHøHI!I!I4I=IRI[IbIgIqIzI„I‡IŠII§IµIÆIàIîIþIþIJ;T3D:Ï:ÏKÏlÏzφφϤϱÏÂÏÊÏÊÏÖÏâÏäÏìÏ<XÉÛùoùop&p+p7pWp]pjpup|p…p‰p•p=X¶ÈYoYoyo†o‹o—o·o½oÊo×oÞoçoëo÷o>$ ´š´šÊš›#›1›? X\^â^âbâkâmâ@ éíöëöëìììA áå{‘{‘‘¡‘©‘B(*0̢̢٢'£C0qyÅÅ0Å3Å3Å<ÅMÅPÅXÅDHª¸ËËæ 38::DED l*Ç*Ç5ÇNÇUÇhÇuǘǘǥÇÇÇèÇùÇ$È4ÈEÈYÈ`ÈeÈeÈ…ÈÈ×ÈÞÈïÈÉÉ=ÉVÉbÉiÉiÉiÉnÉnÉÉ{ɨÉÂÉÊÉßÉ -ÊÊFÊXÊ_ÊdÊdÊsʂʑʖʖʥʹÊßÊçÊÿÊË%ËEËEËEË]ËiËvˡ˭ËFXºÌʱʱì±ð±ö±ù±²²²"²,²/²2²8²F²G0 ¨CîCîYîeîî’î’îšîHDjÆjÆsÆ{Æ{ƈƚƢƧƳƹƻƻÆÀÆIL4›4›D›R›b›h›“›·›È›œœ œJØ9ê~ê~ /=Q]`it‹™œ¦®±´Èßçþ€€€€#€&€(€/€?€C€J€M€s€z€Œ€K<ðû ’ ’!’#’1’N’R’b’o’L …›ä›äµäÇäÑäMH -îî"î$î+î9îaîfî}î‚î‚î†îŽîN@:F=K=KMKZKaKvK}K„KKOHâð ( (º(Ç(×(ì(ó(ü())&)PPúPúPQ0Q0QU`k’¿Êñøÿ -+2\8$K4K4T4d4l4y4{4ˆ4ˆ4‹4 \ No newline at end of file +9 +Q +f +{ +„ +‰ +‰ +™ +¥ +« +· +Î +ñ +   +   T Õ€5KKkwƒ‡‹š®¶¼Ðßë÷ûþ‘‘ ‘$‘.‘2‘;‘A‘T‘Ö$).IIII1I7I×,‚‰–˖ˬ˿ËÊËÐËÓËÛËØ¨ï““*“-“E“P“`“r“v“„““¯“µ“µ“Á“̓ړä“ì“ð“ð“ð“ó“õ“ù“ù“þ“ ””(”-”/”/”E”ÙLêù>ú>úZúfú€ú‹ú˜ú¬ú²ú¾úÚ &ò&ò*ò7ò9òÛ`#3C3C7CNC^CnCCˆCŸC¯C¿CÐCáCòCD4DKDVDaD›DÜTÛOÛOßOûO +PP!P7P>PPPcPvPP P¥P¥P§PÝ`Ðvévëvóvww+w:w?wRwiwow{w‹w‹wwÝwÞH_m[G[G{G‰GG£G©G®G¶G¹GÅGß$zMM!M6MDMOMàÀnš#‹#‹;‹B‹J‹_‹h‹h‹ƒ‹‰‹‰‹“‹š‹¥‹ª‹´‹È‹Ê‹Õ‹Õ‹ä‹ì‹÷‹û‹ŒŒŒŒŒŒ Œ'Œ1ŒAŒá@/; + +(4ALXeknqƒâ0 'º’º’È’à’““““!“ãk‹»“»“ѓԓà“à“â“ï“ý“”””””.”@”K”W”a”d”f”i”k”n”s”x”|”Š”ä<€‹PMPM^MlMqMwM‡M‡MM¡M§Må8%ÔÔÔ$Ô8ÔMÔUÔXÔZÔ^Ôæ”x™¢Ñ¢Ñ¹Ñ»ÑÅÑÜÑÜÑíÑöÑÒÒÒÒÒ Ò6Ò6Ò;Ò=Ò=ÒAÒCÒCÒGÒNÒNÒSÒcÒuÒwÒ‡Ò瀂ž››¦®¹ÄÏØî  F\v~š¦±ÉÔÛæëèLN]º²º²òòÒ²á²ò²ö²³³!³!³&³é85?º¡º¡Ê¡æ¡ò¡ö¡ú¡þ¡ +¢¢êœ$›D›D£D©DºDÉDçDEE EE(E4E4EAESEXEE†E—E¡E¦E¦E¦EÆEæEFF +Fëx‚œÃ*Ã*×*á*ç*ó*++ +++#+&+/+2+D+j+r+{+{++­+²+¸+Å+ì8Ó`Ó`ã`æ`ë`î`ü`aaaaíD&VêVê^êfênêvê~ê†êŽê–êžê¢ê¦êîdav££"£2£=£B£O£X£\£b£h£p£x£„£ £££®£®£¶£ï@nzFéFé`énéé…é‡éœéÏéÕéÕéáéð(.4z¡z¡ƒ¡‘¡ ¡¯¡´¡ñ0R’R’`’x’«’±’³’³’¹’òDŒ™‹”‹”·”ŔДԔؔܔà”ì”ù”ü” •ó€Ïë‹‹–ž©´¿ÈÞòû6LfnŠ–¡¹ÄËÖÛïô< «8«8³8Ñ8â8ò899,9D9F9H9õLÁÐkJkJ…J˜J­J³J¹JÈJÖJÖJÙJäJöˆú[[q•§§¹ÄÚÚêìììý '-336D÷|½½Ô½ã½æ½¾*¾:¾c¾s¾€¾°¾¿¾ܾ̾â¾ò¾ò¾¿¿ ¿ ¿¿"¿%¿‰¿ø8ڜڜèœóœþœ!7:Eù?€–€–‰–•–¥–²–ÖÔ–å–ú–——'—9—A—b—v—y——‘—¢—É—Ü—î—#˜%˜6˜B˜G˜O˜q˜„˜˜±˜úH'5à”à”ú” •&•;•A•G•G•O•Q•}•û$!ãPãPñP QQQQü8JT.Û.Û<ÛSÛ^Û^ÛiÛqÛqÛwÛýDìùóó'ALL]mošþl@W¸˜¸˜¼˜͘Þ˜÷˜™™$™/™R™c™m™o™z™…™Ž™—™ª™½™Ιؙؙڙÿ$ôù;;DMSX  +ºSºSÃSÎSßSDÌÙžðžð­ð²ð»ðÌðÍðàðãðéðh-ƒÛ0Û0111"1%1*1.1M1a1d1v1~1…1¤1­1¯1Î1×1×1×1Ü122&202:2A2M2Y2c2c2c2„2„2222˜2š2š2£2¥2¥2ª2¬2¬2±2±2±2µ2Ð2æ2ñ2333 3,383D3W3n3€3„33¥3µ3×3ô3444444%4,4¬4LÈדý“ý§ý®ý³ýÉýËýÜýàýóýùý&þ4êê&ê.ê6ê>êFêNêRêVê,öéöéþéêêêêêx7nn‚‡‘˜«ÄÄÓéò +24799E| +Ðkö®ö®¯¯0¯9¯D¯O¯Q¯d¯r¯}¯ˆ¯œ¯§¯ª¯°¯´¯·¯½¯Á¯Ä¯Ç¯Ú¯ï¯÷¯ú¯°"°%°+°.°A°V°^°a°y°‰°Ž°Ž°–°–°¹°¹°¹°½°¿°¿°Ã°Å°Å°É°Ë°Ë°Ï°Ï°Ï°Ò°Ô°Ô°×°Ü°â°å°é°ë°ñ°ô° ± ±%±+±.±3±F±a±c±y±y±y±~±~±€±€±…±ˆ±®±®±®±Æ±Ì±ã±ò±²²(²M²R²R²j²ˆ²²²¥²Ã²Å²Å²Ý²ù²û²û²³/³/³M³Y³^³^³v³³’³’³ª³Æ³Ë³Ë³Ï³ç³´ ´ ´ ´´'´E´I´I´g´l´l´„´›´¢´§´§´¿´Ö´Ý´ë´û´ µ&µ(µ(µ6µ>µgµiµiµµ¢µÁµÆµÆµÞµóµ¶ ¶-¶L¶m¶p¶u¶u¶¶¤¶®¶³¶Ä¶Ä¶Ê¶Õ¶ê¶ï¶ù¶ · ·?·M·S·j·r·{·{·‡·‹·‹·”·£·¬·¬·µ·¿·Û·ù·¸%¸+¸@¸H¸T¸^¸^¸v¸x¸ƒ¸›¸¸½¸½¸Â¸Â¸ø¸¹¹¹¹ ¹ ¹(¹7¹@¹@¹I¹O¹k¹v¹Ž¹¹›¹³¹µ¹Ñ¹Ñ¹Ñ¹á¹ºººº3º8º8ºPºgºqºvºŒºŒº£º£º¯º³º¹ºÂºÑºÚºÚºãºîº»»$»/»J»L»L»U»m»x»Ž»›»£»Ä»Æ»Î»è»ë»ô»ù»¼$¼$¼?¼I¼T¼p¼ƒ¼š¼¢¼¬¼¬¼µ¼¹¼Ð¼½½½½'½0½4½K½ƒ½ƒ½…½…½¡½«½³½³½¼½À½×½¾ ¾&¾=¾E¾R¾W¾W¾`¾d¾{¾³¾Ä¾Í¾Ò¾Ò¾Ý¾á¾ù¾¿¿ ¿5¿M¿M¿w¿¿¿ž¿¢¿µ¿½¿Ä¿Ï¿Ô¿Û¿Û¿à¿À'ÀEÀ\ÀfÀpÀpÀ€ÀªÀºÀÌÀØÀÜÀöÀÁÁÁÁÁÁÁ!Á!Á,Á0ÁHÁ_ÁiÁnÁ„ÁœÁœÁÆÁÐÁõÁúÁúÁúÁ Â!Â8ÂBÂGÂ]Â]ÂuÂu§±ÂÎÂÕÂàÂå +ÃÃ0ÃBÃJÃLÃeÃsÃààÃÍÃÏÃùÃûÃÄ"Ä,Ä6Ä=ÄZÄcÄcÄčīįįįÄËÄÐÄÅÅ5ÅLÅQÅ[ÅeŒŦũÅÀÅÀÅÀÅÀÅÊÅàÅ÷ÅÆÆÆÆ5Æ?ÆOÆOÆkÆƂƔƞƤƻÆÃÆÌÆÑÆÑÆÑÆíÆÇÇÇ(Ç-Ç-ÇEÇ\ÇfÇvÇvǒǦǩǻÇÅÇËÇâÇêÇóÇøÇøÇøÇÈ(È+È=ÈOÈTÈTÈTÈlȃÈÈÈÈÂÈÓÈÝÈãÈúÈÉ ÉÉÉÉ5ÉFÉXÉ]É]ÉrÉrÉrɎɎɨɯÉìÊ@!ŠŠž¬¬¹Þéíûþž 0EM’Õ’Õ›Õ®Õ´ÕÀÕÉÕÖÕÛÕ +|œz´z´—´™´§´§´µ´È´ð´µ!µ1µTµ<µnµ޵£µ¨µ¨µ¨µºµ½µɵ 8Ž˜ú×ú× ØØ(Ø,Ø,Ø1Ø1Ø7Ø ¬°×sôsôƒô™ô¯ô­ô½ôÅôÌôÐôØôèôöôõ õõ õ%õ%õ,õ0õ0õ2õ™ö 4GPÚÚî‘‘‘"‘/‘8‘I‘p+C;LSdkk—¥­­Ø . ; Y Y f f f t D¦³22>U`flrˆ”š„Sp‹‹¢¬¼×ò (;LQ‹§¬·ÁÎØæìøÿ F,-4++/]I²@ +þ+þ=þHþUþ]þeþmþuþ}þ…þ‹þ˜£Å‹e‹e£e²eÀeÐeÖeÖeáeìeïeôeþe fff f&f,f/f8f9f9fEfGfSfX7‰¦Î¦ÎÄÎÊÎÑÎáÎèÎðÎöÎýÎÏ!Ï%Ï*Ï0Ï>ÏAÏFÏIÏIÏYÏjÏlÏ~Ï€ÏϒϙϛϨϪϪϺÏËÏÎÏÐÏÜÏÞÏþÏÐ +ÐÐÐ Ð&Ð)Ð)Ð9ÐJÐLÐwЙЛТФааÐÄÐÈÐÈÐÞÐ@–¢#]#]9][]a]f]y]†]Œ]]—]0+ø+ø4ø9øBøHøHøMø,;BЧЧ™§¥§³§¼§Á§ǧ8ˆ’îîî îKîXîZîaîiîkîqîä6¾Ì¾ÌÜÌßÌâÌöÌþÌÍÍÍÍAÍAÍDÍTÍVÍVÍYÍ[Í[Í^Íu͊ͥͯ͹ÍÁÍÁÍÁÍÃÍÃÍÈÍçÍíÍüÍ Î Î0Î2ÎDÎTÎYÎYÎeÎeÎrÎuÎuΠÎ8òüÛÛ)Û?ÛNÛlÛpÛvÛxÛxÛ~Ûô…¾Ä¥Ä¥Ö¥Ù¥ã¥ð¥ô¥ú¥ú¥¦¦ ¦¦¦¦#¦)¦0¦6¦=¦C¦J¦P¦W¦]¦d¦j¦w¦}¦„¦¦•¦•¦ž¦Ÿ¦°¦Ã¦Å¦Õ¦Ü¦ç¦ò¦ý¦§§§§(§LWfxx™x©x©xÇxÍxÝxãxéxùxûxûxûx"yhÝó{Ž{ŽŽŸŽ¤Ž´Ž¼Ž¼ŽÊŽÔŽãŽëŽ÷Ž#.19D<I¾Ú¾ÚÒÚîÚüÚ ÛÛÛÛ Û Û'Û P„”||)|2|<|A|S|S|S|U|g|n|Ÿ|»|¼|Â| 0Ž–{m{m‘m¤m¶m¼m¿mÇm!<alú~ú~!%16:@"\É܆†Š°ÃÎâó7Rmˆ£¾Ùô°#Tct‚Ö‚ÖÖ¢Ö¨Ö²ÖÊÖÐÖÒÖÝÖõÖ×× × × × ×%×$X£µqtqt‘tžt£t¯tÏtÕtâtïtötÿtuu%X†˜sêsêŽê–ê¡ê½ê½êÆêÆêËêÜêåêðêðêüê ë&,’™NÌNÌbÌtÌyÌŠÌ·Ì'ä6s˜s˜˜˜“˜™˜­˜´˜·˜Ò˜Ü˜á˜è˜í˜í˜þ˜ð˜ ™#™/™C™L™T™e™e™e™n™u™ƒ™…™™–™µ™Å™Í™ß™è™ù™šššššš"šeš(  HXmXmxm‡m“mžm©m½mÐmÛmçmømým nnnn4n@n@n[nmn€nŽn£n©nÍnÕnÕnánånénoo:ooIoTokooovo{o{oo–oµoºoºoÆoÌoÒoÔoäo) HlSÞSÞgÞwދޘޜޥެ޲޴ÞÇÞÏÞßôÞÙÞ)ß8ßJßQß`ßrßy߅ߙ߹ßÃß›à*LbÌbÌqÌyÌy̷̘̤̬̲̆̽̿̿ÌÅÌ+<|‡êƒêƒøƒ„„#„M„+„[„§„,˜Õ÷’~’~¼~Í~ß~ì~ü~ $6DNScl‡‹- GKryryyžy¤y.Ü4`‡`‡~‡Ї“‡±‡±‡³‡º‡º‡ˇÒ‡߇ò‡û‡ˆ +ˆˆ/ˆJˆJˆ`ˆbˆbˆxˆzˆzˆ†ˆ†ˆ›ˆ¬ˆ²ˆµˆµˆ¸ˆ½ˆňÖˆ݈ãˆôˆ÷ˆ‰‰‰‰‰4‰/h¦’•’•¦••Ò•Ò•æ•ð•ô•ø•–––,–5–9–H–[–a–h–w–z–…–º–Æ–Ò–Ú–ä–ò–——#—4—G—M—”—¦—´—Ê—Ù—ä—ú—˜˜˜8˜D˜O˜V˜\˜c˜l˜o˜–˜04Yb*Ö*Ö3Ö;ÖGÖXÖ`ÖhÖ{Ö€Ö1 ´H=H=b=h=h=w=ƒ=Š===š=£=£=©=­=°=º=Å=Å=Ô=Ý=Ý=è=í=ð=ó=ö=ù=>>>>>>2 ÚÞîðîðòðÿðñ3¤“ø ƒ ƒ¶ƒƒʃÛƒ߃󃄄%„*„0„5„L„U„m„}„}„Š„˜„¤„´„ƄƄʄЄØ„â„â„æ„ê„ù„ … …2…2…A…C…I…Q…c…x…‚…‘…–…–…¢…¢…°…¹…¹…È…ö…ú…ý…†††)†>†M†\†g†i†o†|†‚†‰†–†œ†œ†£†¼†Á†ɆцÚ†á†ê†Y‡4,%lã9ã9ë9ï9ö9ý9::::&:+:7:C:S:m:|::‰::¡:»:Ï:Ö:ç:è: ;;";';J;N;W;_;h;‡;Ž;Ÿ; ;¤;Æ;×;ì;÷;<< <-<><D<N<5,[‘[‘d‘‘…‘…‘Š‘64ÏØ;A;A?ADAPA\AhAsAzA|A7(êð r r%r7rCrIrQr8»üª¬ª¬¸¬À¬Ŭˬó¬­­&­1­6­L­Y­b­g­–­­¥­§­°­¿­Æ­ì­ì­õ­ ®®<®D®W®g®w®‡®–®¦®¶®Æ®à®å®í®í®ò®¯¯0¯;¯J¯Z¯j¯z¯”¯”¯”¯ ¯¦¯9”ÍîêÈêÈÉÉÉ%É,É5ÉHÉbÉhÉpÉɓɓɢɩɮÉÌÉÏÉØÉÝÉûÉþÉþÉþÉÊÊÊ!Ê1Ê:8‹•›\›\Ÿ\°\Ì\á\ò\û\]];p !xxx"x'x3x9x@x\x’x›x¤x°x< ƒÂrÄrđĤİİÄÁÄÈÄÈÄÑÄãÄìÄ ÅÅ+Å2Å2ÅHÅTÅTÅ{Å~ÅżÅÛÅçÅþÅÆÆ(Æ?ÆVÆuƔƠƷÆÎÆÓÆäÆûÆÇÇÇ(Ç9ÇPÇgÇxÇǦǰǹÇÀÇÖÇßÇ·È=8uîîü &.006>80: +§ +§§;§^§j§w§§†§?,£ª›]›]¤]­]À]Æ]Ë]@0 ÈŠÈŠÖŠàŠôŠúŠüŠ‹A,8?FFZl}‹‘—B,8m8mAmLmNmNmSmC\m€BBdht…‘š¹ÅÎÔØæD€H_H_X___r_~_¥_¯_¹_Á_É_Ñ_Ý_ï_``'`0`>`D`J`M`T`\`EX«ýË]Ë]×]à]é]ï]û]^^^^#^1^<^D^]^o^z^ƒ^ƒ^ˆ^^›^¢^§^§^­^´^¹^Å^Í^Ö^Ö^Þ^í^ñ^þ^ ____#_*_6_A_]_]_]_e_l_s_z__ˆ__–__¤_ª_³_¹_Ì_Ý_ù_` ``F|Kf¦ô¦ôÅôÓôãôïôõôþôõ õõõ!õ+õ+õ2õ5õ;õ;õEõSõZõZõZõhõG,ë#ë#$$4$X$`$HX ]+h+h3h>hPhVh^hhh‹h‹hhªh¾hËhÓháhi*ibigigiyi†iši§i¬i»iði÷ijjjj%j2jFjSjXjgj›j¢j³j¹j»j»jÃjÃjÐjåjëjþj"k/k?kDkJkWkbkhkskskyk‚kkk¢kÁkÎkÛkàkàkäkýkIàÊþÃÃËëú .ANaˆ•¡­­ºÄêý//O\‘}¢§¹½ÅÅÓÞìóþ  JLRaŒ¤Œ¤™¤¡¤¤¤²¤µ¤¼¤À¤Ã¤Ç¤Õ¤Ü¤á¤K8GQD¤D¤Q¤Y¤\¤j¤n¤|¤€¤…¤L0FFOTcginMTØé›ö›ö¥ö¸öËöÓö÷t÷N(LRSS[i{„†Oœ'Jƒaƒaa¾aÐa×aäaðaøabbb*b3b:b>b>bDbJbbbkbqbzbbbbƒbbP8‹»»ÄÔááè÷þþQ¼W‚HkHknkqkkšk¨k¯k¼k¿kÃkÍkÚkúkúklll8l:l:lJlLlLl\l\l€l‡llšlžl·l¹lÞlçlílôl6mR<# +¦ +¦¦ ¦(¦8¦D¦N¦}¦¦…¦S$³`³`¼`Å`Ë`Ð`TZŠ¿Š¿ž¿¥¿µ¿¼¿¼¿Ò¿Þ¿À$ÀCÀOÀcÀgÀmÀ{ÀÀ…À“À“À“À²ÀÑÀåÀýÀÁÁÁÁ Á1Á1Á1Á1Á4Á9Á>ÁDÁXÁ\ÁbÁmÁqÁwÁ‚Á‚Á‚Á‡ÁÁ¡Á¥Á«Á¶ÁºÁÀÁÉÁÉÁÉÁþÁUDs€KKO_uwˆ”™ ²²´V¬Íôê·ê· ¸¸¸¸&¸5¸B¸F¸P¸f¸f¸v¸‚¸‡¸‡¸ ¸«¸³¸¸¸ʸʸʸÒ¸à¸î¸ø¸û¸¹ ¹¹¹,¹W-MMM½MÀMÎM×M×MîMÿMNN,N9N>NBNSN}N…N‰NŽN–N¨N·NºNîNXHóóó$ó-ó9ó;ó=óLóLó[ó]ó]óbóY¸9£`Y`YY„Y‡Y¤YÈYÏYÚYèYòYZZZ#Z3ZGZLZ[ZnZŽZ—ZŽZ©Z«Z´Z«ZÆZÈZÑZÈZãZåZåZõZõZ[[[E[l[l[r[u[š[¢[¨[µ[Å[Ù[Þ[í[\#\/\B\b\o\b\}\‚\\‚\\¢\¯\¢\½\Â\Â\Ò\Ò\å\ö\û\'])]N]N]T]W]e]j]}]ˆ]—]—] ]^Z0 ë ëë#ë)ë2ë9ë=ëCë[(•2€2€>€D€J€c€n€\¼w¢ d d5d8dTdfdmdzd†d•d™dd¥d¯d¾dÇdàdàdçdídôde ee!e#e%e+e1eIeReReYetewe‰e]¬ F“á“á›áŸá«á»áÆáÕáááêáÿá(â4â<âZâeâ„â„â«â­â­â­âÆâÈâÈâÈâàâàâòâúâããã'ã.ã.ã@ãFãPã^Dœp6p6‚6Ž6¤6¾6É6É6Ú6ê6ì67_¼B²º²ºȺкÚºæºôº»,»O»^»‰»»•»Ÿ»Ç»ê»ø»¼¼>¼N¼S¼[¼†¼мœ¼¡¼®¼¸¼ƼƼмÚ¼`@nzËGËGÓGôGøG HHHHa *nØ1Ø1ã1ç1ï122.292B2X2k2€2”2 2¸2È2Û2ã233$3.3S3X3b3t33œ3©3¾3¶3Ù3ñ3õ3ú3ú3 4 4404C4Y4[4[4n4v4v4v4ˆ4ˆ4‘4£4ª4ª4¼4Â4è4b@1=ÃøÃøÑøÖøÙøëøñøôøöøüøcè¸îP‘P‘j‘‚‘Ž‘ž‘°‘´‘·‘À‘ÑÔ‘Ô‘Ô‘Û‘è‘ë‘ð‘í‘J’a’d’f’}’€’‚’Š’š’š’£’²’À’Ð’Þ’ç’î’ó’ó’ó’ù’ “dD ººº>ºaºnº{º†º¢ºªº²ºe   >ò>òHò[ò`òf4zƒ~ ~ Œ • œ ¥ g8êôú›ú›œœœœ#œ,œ/œ5œhtRkXzXz}zz˜z¸z¾z¸zÕz×zÝz×zôzözöz{{{{{{\{i0«P«P´PÆPÔPØPÜPÜPáPj@ºÓºÓÉÓÑÓåÓïÓ÷ÓÿÓÔ +Ô Ô ÔÔkØ"T +ž +ž ž/ž:žLžcžcžtžŒž™ž¬ž¸žÞÓžõž÷žŸ!Ÿ!Ÿ!Ÿ2Ÿ^ŸeŸnŸtŸ{ŸŸ†ŸŒŸŸ—Ÿ¢Ÿ¨ŸÒŸlüi¤ÐbÐbïbñbc cc-c2c;cBcPc^ctctcwc|c†c†cc“c©cÁc½cÏcÔcòc dddd dCdEdad[ddd¡dµd¼dÂdÅdÊdÚdádädºem” *;;]…­Õã&i¬®¼ÊØØò );K`y‹›°ÉÐ×óndVHgHg\g^gng|g†gªgÎgÖgègöghhh-h5h:hShshsh”h–h–h·h¹h¹hÚhÜhÜhìhìhòhõhúhiii6iYieiŒiŒi­i¯i¯iÐiÕiÕiöiûiûi j jjj#j7jGjSjsjsjjƒjjj¦jºjÎjÕjÜjßjGko`AUC#C#K#a#i#i#q#€#Œ#§#°#·#¼#Í#Þ#ð#ô#ù#û#pðñ)È.È.æ.é.ì.ö.//'///9/_/l/w/‰/ž/¯/º/ç/ì/ò/0&0,0/0<0G0Y0n0‚0Š0°0µ0»0Þ0ã0÷01&1=1X1n1€1€1¬1Â1Å1×1q<5@âƒâƒúƒ „„„ „5„8„=„I„r0 H H$H8H8HLHPHTHs¼ +5CëCëNëRëvëëëœë¨ëÇëßëïëìì0ì2ì2ìSìUìUìvìxìxì„ì„ìŒìŒì˜ì¬ì¼ìÄìÄìÖìÝìÝìïìüìí í+ít\QdJ‘J‘Z‘\‘g‘l‘‘ˆ‘‘’‘¢‘¯‘¯‘µ‘À‘uŒoŽè4è4ó4û4555%5;5O5X5l5“5©5Ã5Ë5á5é566666A6H6S6X6k6vxˆ¢ûû7û<û?ûLûRûUû]ûfûuû}û}ûˆûˆûû’û’û™ûœû¨ûw0 ‘‘БÚ‘ñ‘÷‘ù‘ÿ‘x fòfòjòwòyòyLDSè•è•–– –5–C–E–Z–e–k–€–z0 SâSâSúSüSTTT!T.T6T;TATCTGTWTeTuT€T…T…TŒTŒT—T—T¶TÄTÏTÑT×TÙTÛTÝTÝTèTêTòTøTúTúTUUUUUUUU&U*U6U{x8ÀXÀXÖXóXúXYYY Y4YBYHYNYQY[Y|´5^8‰8‰\‰g‰o‰~‰ƒ‰ˆ‰˜‰‰¸‰¸‰Ɖ͉Ó‰Ú‰â‰ð‰ö‰ø‰ŠŠŠŠŠ$Š2Š8Š:Š:ŠJŠLŠLŠ\ŠÁŠ}[CXCX]XkX„XX¦X³XÅXÚXêXñXY YY'YCYCYGYRY^Y`Y`Y`YfYfYiYsYsYŽY›Y›Y Y°YÃYÉYÒYÜYìYZ(Z9ZDZDZVZVZVZlZ|Z“ZœZ¢Z²Z¶Z¶Z»Z»ZÑZ~,07º‰º‰Ã‰Í‰Î‰Ó‰tý‚Û‚Û“ÛŸÛ­Û¹ÛÅÛÑÛÑÛãÛéÛéÛöÛÜ Ü;Ü;Ü;Ü;ÜAÜAÜQÜSÜSÜ|Ü€$‚‡®í®í²í¿íõíî<7Bkškššš›š£š³šºš¼šÄš‚,xHxH|HH”H”H˜Hƒ, +XHXH\HpHtHtHxH„hN¤ðNðNûNOOO?ONO_OhO|O”O¤O·OÇOÏOðOPPP?PDPNP[PmP†P•P•P¼PËPÕPòPýPQ Q+Q@QIQcQrQ~Q‡QŒQ©Q¶Q¼QÕQÑQëQöQþQ R R RRR%R%R8RJR]RfRfRyR‰R‘R‘R‘RŸRªR±R¼R½RÑRÕRÜR…DŸ¬!7Q\\m}«†L\kÓZÓZÜZáZèZèZ[*[1[@[O[T[V[X[X[‡l£ºš«š«®«º«È«׫׫ÿ«"¬-¬7¬@¬P¬\¬i¬…¬‹¬¬—¬›¬£¬ˆ¬GnSãSã[ã_ãkã{ã†ã•ã¡ãªãÆãØãíãä"ä-äLäLäsäuäuäuäŽääää¨ä¨äºäÂäÝäÝäÝäïäöäöäå剸Qàwþwx2x6xHxQxZxaxjxsx‹xšx²xÅxÎx×xåxýxyy-y1y7y@yFyQySyVy^ysyˆy‹y–yœy¤y¨yºyÀyÆyÍyÓyãyéyûyzzTzŠ<ÃÎs@s@“@£@¨@Î@ô@A!A(A-A9A‹lýª¯ª¯¾¯ǯد°#°2°?°J°g°z°“°“°©°©°¶°ȰÒ°Ú°Œ ¥ÉÀeÀeØeÚeèeôe ff'f§T§™ žÂ3?3?A?F?N?V?c?u??„?–?«?Á?×?í?ÿ?@@@)@)@?@N@N@U@\@c@h@p@š8§Ë+Ë+Ù+á+é+ +, ,),/,›P:J¨w¨wÀwÌwÔwÛwäwêwíwíwxxxx#xœð8p”©”©®©¾©Å©Í©Ô©ð© ª ªªª#ª%ª.ª7ª9ª9ªBªQªSªSª\ªeªjªjªsª|ªªªŠª“ª˜ª˜ª˜ª¡ªªª¯ª¯ª»ªÄªÉªàªäªäªþª««««„«XÓåòÙòÙúÙÚÚ Ú,Ú5Ú=ÚLÚhÚ™Ú™Ú«Ú²Ú²ÚÄÚÅÚÉÚžÈÝ P8P8l8r8|888ˆ8“88§8³8µ8»8Â8Å8È8Ð8Ü8â8ç8í8ð8ò8ý89 9999#9)92929292989@9C9S9Ÿ,™ :Ø:ØCØOØWØ\ØaØ 8akvv„Ž˜£«­­³¡x^xlll l.l.l:lElwlwlzl|l|lllƒlƒlƒl…l…l…lŽl‘l”l¡l¢,ÛâÚ‡Ú‡ã‡í‡î‡ó‡£$(-J¡J¡X¡`¡r¡x¡¤<@K¢¢(¢2¢6¢;¢G¢L¢P¢T¢^¢¥ úþÖñÖñÚñúñüñ¦t.Ú°Ú°ê°ö°ÿ°±8±[±j±w±‹±‚±¬±À±Ʊȱʱбұ߱â±ê±§h^t*³*³L³R³[³[³d³s³€³¯³º³³ijÖ³Ö³Ö³ç³ô³ô³´¨@y…››››››#›'›+›A›F›H›©<ðû3 3 H 7 W  ª€¹ʵʵèµùµ¶¶&¶1¶<¶R¶^¶t¶ж’¶’¶á¶æ¶æ¶ · · ·@·G·i·«˜ìSBSBcBmBrBwBwB†B‹B¤B­B¸BºB»B»BÇBÒBÔBãBåBñBûB CCC$C&C&C&C,C¬€›þàþàá +á!á!á8áLájálá„á—á¢á³áÊáÊáááõáââ-â@â@âCâœâ­8—¡˜\˜\®\·\Á\Ì\Õ\Ø\â\®4<Eà:à:ô:;;; ; ;';¯hqÇ„«„«¢«²«¹«Á«È«ä«è«¬¬)¬)¬)¬2¬4¬4¬=¬?¬?¬H¬J¬J¬S¬U¬U¬^¬`¬`¬i¬k¬k¬t¬v¬v¬¬¬¬Š¬Š¬¬’¬’¬’¬•¬˜¬¡¬»¬Ë¬â¬õ¬÷¬ú¬ü¬ÿ¬ +­­­­­­­&­3­8­8­A­U­X­]­]­f­f­t­x­S®° ¢¦è\è\ñ\þ\]±`UikOkO‹O–OœO§O©OºOÇOÍOÍOÙO²0GO#R#R,R:R@RQRSRSRXR³(‹‘@\@\T\_\h\k\s\´ \€ÃèÃèËèÖèæèõèé%é%é:éBéGéGéTéjévé~é†é˜éÅéÑéäéìéñéñéýéýéêêê(ê-ê4êµ°.V«æ«æ³æ¾æÎæÝæéæ ç ç:ç_çdçdçyçç†ç†ç­çµç½çÏçüçèè#è(è=è?è?èKèKè]èdèdèvè{è‡è¶8LVz„z„Š„„„”„„ „¥„­„· €„66:IM¸(aaa&a1a9a>a¹Dˆ^ˆ^œ^®^µ^¹^¼^Ç^Ï^ã^æ^î^ºh²ÈffˆŸ©½Ó÷'Jddwwƒ»X=ONëNëXëZëoëwë˜ëŸë¬ë¬ëÃëÌëÐëÔë¼\r…0Ž0ŽFŽMŽ\ŽcŽlŽlކޑޙޭ޶޼ŽÇŽÇŽå޽PFV(;(;F;L;Q;m;s;x;–;˜;¦;¬;¯;½;¾lXoæþæþÿ +ÿÿÿ$ÿ+ÿ0ÿ3ÿ9ÿ<ÿDÿIÿIÿNÿQÿSÿWÿgÿ¿Œ~3=3=<=g=’=½= >>>3>3>‚>>‘>©>©>¹>Ù>à>å>ï>?#?%?*?-?Àˆ;Yc’c’l’v’v’†’“’œ’¥’®’·’Ë’Ë’Ö’Ü’Þ’í’õ’“ ““6“6“8“H“N“S“Á4 ò‚ò‚ƒƒƒ(ƒ+ƒ1ƒ9ƒÂd±ÆòØòØÙÙÙ'Ù)Ù:ÙPÙ_ÙpÙvÙvÙ‘Ù™Ù¡Ùè'ÒŸÒŸäŸïŸôŸ   # . 9 D I W e s ’  ¤ ¸ Ô à è ó õ ¡¡¡&¡5¡7¡@¡J¡Ä W[‹è‹è¥è·èÁèÅD8E³ÿ³ÿÇÿÑÿãÿêÿñÿ %Æ<)4’ƒ’ƒ©ƒ¬ƒ±ƒ´ƒÇƒÍƒÐƒÒƒÜƒÇ´`É  7>MZgvŠš°½Ðñ /Rs¦«ÅÙõ )1:L^~“¦ÀÕïû $6N^j}}°»Æàîú )Blsx˜ŸÄÄçö ""'BITTbwwˆ¤¤µµ¸ÀÈh + >û>ûLûgûsûû‹û”ûû¦û¯û¸ûÁûÊûÓûÜûåûîû÷ûüüüÉ0¾Æ³o³oÑoíopppp;pÊX’¤€6€6Ž6—6£6©6¬6±6·6º6¿6¿6Ì6Ð6Ó6Ó6Ù6ËL +ÓWÓWâWðWðWúWX!X,X5X;XtNtNtZtitntŠtt’t—t§t²t¹t½tÁtÏtãtêtôtútýt uu!u8u:u=u=u?uYueukutu€u¡u¥u±u¸u¿uÅuÈuÖuìuìuìuñuýuvv$v'v*v0v3vAvWvWvWv_vkvƒv‡v’v•vœv­v­v´vÊvøÀIâWâWöWX XXX X6X>X>XHXaXoXxXƒXŽX‘X˜XX¥XªX·X¼XÎXÕXûXþXYYYY"Y0Yù4 (bƒbƒpƒrƒwƒ€ƒƒƒˆƒŽƒúV U U;UAUZUfUxU‚U’U•U¢UÏUÒUÖUVVVV,V4VGVUVdVvVVŒV›V±V¸VÉVÉVÕVàVàVóVöVWWW,W.WAWKW[WdWtW€W€W€W†WW’W˜WšW¿Wû$ZŸ»R»RÃRÓRâRçRûRS1SNSVSuSˆS¤SòSôSøSüXÂÔ~~#~3~3~4~9~9~C~V~f~l~{~€~~‘~‘~ýhWåå.å7å=åFåNåWå_ådådålåqåqåyå‡å‡åå”å”åªå²å¹åÀåÇåÒåÙåïåÿåææ=æSæ`æ§ææÅæöæçç+ç.ç2ç7ç@çIç€çqçlç‘çŒç§ç¿çÍç×ç×çìçöçèèè5è9è@èBèCèJèJèZèþ@ãïú‡ú‡ˆ +ˆ,ˆ9ˆ9ˆ=ˆCˆÿ0W_²„²„À„τքæ„ê„í„ó„, /// /3/H/Q/`y£l£l¿lälélølmmmm#m+m7mKmSm_mcmcmwm4W`À;À;Ö;Ø;â;ï;ø;ý;<tIbèoèoöoÿopp!p&p=pKpKpgp€p†p”p”p p©p¯p¯pµp<š2S2SISSS[SjSxS~S‹S,›¢ÎîÎî×îáîïï ï˜\~c"c"k"|"—"¦"³"Â"Ì"å"ó"####5#:#H#T#`#l#{#Š#œ#¯#¸#Æ#Í#Í#Û#ä#X¦ ¦ º Ä Ë Ú ó ó  469;;;CP­½‡‡‡'‡-‡2‡2‡<‡@‡E‡E‡M‡ H¨¶3,3,K,N,c,l,ƒ,š,¨,¸,Â,Ù,ë,ò,þ, +,ñøSrSrmr€r‹r‘rŸr 8<FŠŠž®ÀÉÌÔ <›¦‚†‚†–†¤†¯†º†Â†Ê†Ò†Õ†Ý† <ju"©"©6©=©G©P©e©q©w©}© (g"“"“<“n“’“•“ “­“¾“Ï“דå“ç“ê“í“í“ú“ ””””$”5”8”=”=”J”Q”c”f”k”r”„”‡”‰””¢”¥”§”®”À”ÔŔ̔ޔá”ã”é”é”é”é”î”î”õ”ü”• • ••8mwRÑRÑ\ÑdÑuъђѕїћÑPÙéJ›J›^›g›€›‘›¶›¹›Ó›Ý›ê›ê›ì›ô›H¾ÌR‡R‡`‡l‡q‡q‡~‡‡•‡•‡›‡Hao<<"<3<C<F<H<U<Y<\<f<l:Qëëö  / A M [ d s … ¤ ¶ Û ä ù  + + + + + ŸÓïÓïõïøïÿïð.ð2ð:ðLðjðjðjðjðwð}ð…ð‘ð–ð–ðð£ð¯ð´ð»ðÂðÉðÒðäðöðûðþðñññ'ñ.ñ;ñZñpñ‰ññ¬ñÄñøñøñÿñòòòòòòòòò$ò+ò.ò>òDòLòRòTòTò[òdòfòfòfòiòkòkòròuò{ò{ò~ò”ò¡ò¡ò¬òÀòÇòÍòâòåòóó +ó +ó +óóó"ó"ó"ó-ó5ó8óãóxÇá--,-/-4-?-G-d-o-v-}-¥-¥-­-Ó-Þ-ã-ã-ë-.".'.'.+.:.œ`ƒú„ú„……'…-…0…0…7…=…Q…V…Y…^…g…g…g…k…u…„…Œ…¡…¬…Â…Æ…È…Ý…á…á…á…ë…Œph<h<†<‰<¡<¡<£<´<Á<Æ<Ì<é<ì<÷<û<û<===)=-=-=6=9=G=d)ܧܧ¨ ¨&¨1¨4¨:¨B¨V¨f¨s¨u¨ƒ¨¨ ¨´¨¶¨¶¨Æ¨Xxà™à™ê™ð™÷™ý™š;šOšOšašhš€š™š²šÄšÈšÔšÖšášìš÷š÷šûš UY~Û~Û’Û¡Û©Û€›à›à¹àÈàßàñàá áááá(á4á7á:áFáKáTáYá`áyáyáá@v‚‚©‚©‹©³©Ö©ã©ð©û©ª&ª+ªÌh—nõnõ‰õ“õ¡õ§õ±õ±õ¾õÄõÈõËõÍõÔõÛõåõñõúõö&öCö3öXöXöföŽööö¤ö»öÇöÏöÑöëö÷÷"÷X÷ì¥ÜƒŒƒŒŒ¥Œ­Œ¼ŒÍŒÏŒæŒøŒôŒ#*3QM`p‡˜› ¦ÆÜéðûÿŽŽŽ Ž#Ž)Ž8ŽIŽNŽZŽeŽwŽ L&5¨M¨M²M¹MÄMÐM×M×MÝMäMôMöMýMNN ,z^Ë^Ër˄ˊËË–Ë!<0;s&s&…&•&µ&É&Ï&Ñ&Ñ&×&"0š¢ŠÒŠÒ“Ò™Ò¢Ò«Ò´Ò¾ÒÃÒ#<£®ÊÒÊÒÙÒÞÒùÒÓÓÓÓÓ Ó$8NXâÕâÕòÕúÕÖÖÖ Ö'Ö%\õ2¹2¹@¹E¹M¹T¹Y¹¹¤¹±¹¾¹ɹæ¹î¹õ¹õ¹ø¹þ¹&,“švîvî„îžî«î°îÃîÉî'¼Þ CVCVoVuVŽV¦V­V¹VÅVÉV×VöVöVW W'W.W6W@WHW\WmW~W“WšW£W©W±W±WµWÒW(4#SøSø\øaøjøsøyøyø~ø)< nØn؂ؕآخضØÒØâØåØõØ*4ÓÜ8888'8'848<8A8I8+,W^#G#G1G3GEGMGRGXG,D‹þ‹þ˜þ¦þ®þ¶þÄþÌþÔþÜþäþîþóþ-^š‹ +‹ +“ +£ +µ +Ä +Í +Û +é +õ +  0 G V v … ˜ ¦ » Ò Û ê  # : N [ i u Š Ÿ ± ¶  Î Ü ñ   % 0 7 B L U Y .(QW®þ®þ¹þÍþÜþàþ/0X`NNWagmoot0@ c$c$w$…$“$$®$¿$É$Ó$Ý$ã$1ˆ L L+L5L8L@LPLPLdLnL„LŽLL¯L´LÅLÓLÞLïLýLMMMM2PÙé–ù–ù´ùÇùÓùíùþù ú ú&ú,ú;ú3$mrhyhyly|yy‘y4H¾Ì^^^^4^?^H^J^V^Y^\^f^5D&CaCaLaZaZa\abamama|a}a‚a6(¤ª2}2}6}A}F}P}R}7D.;æóæóôóôô +ô)ôCôCôGôMô8d>Sùùù ù,ù,ù8ù8ùEùEùTùcùrù„ù™ù£ù²ù²ù¼ù9ÔT–Ó–Ó´Ó¸Ó»ÓÌÓßÓéÓïÓóÓöÓøÓþÓÔÔ ÔÔ!Ô9ÔAÔDÔUÔiÔpÔzÔ~Ô‘Ô”Ô Ô¥Ô«Ô³ÔÆÔàÔèÔëÔüÔÕÕÕ*Õ8ÕRÕ_Õ~Õ~ÕÕ§Õ´Õ¹Õ¹ÕÊÕÞÕåÕêÕêÕûÕÖ&Ö+Ö+Ö1ÖBÖVÖuÖzÖzÖ€Ö‘Ö¥ÖÄÖÉÖÉÖÚÖîÖûÖ×××%×2×7×7×H×\×i×k×k×k×k×k×|×”×£×¥×¥×¶×Ê×Ó×Ó×Ù×Ù×â×â×kØ:4Ã̺ȺÈÈÈÍÈØÈÛÈßÈåÈ;l 7MM9MXÉÛ±u±uÑuÞuãuïuvv"v-v4v=vAvMv?X¶Èuu1u>uCuOuouuu‚uu–uŸu£u¯u@$ ´ ´ Ê ¡#¡1¡A X\^è^èbèkèmèB éíNñNñXñkñpñC áå{—{——¡—©—D(*0̨̨٨'©E0qyËË0Ë3Ë3Ë<ËMËPËXËFHª¸Ë•˕敖 –––3–8–:–:–D–GD lÊÌÊÌÕÌîÌõÌÍÍ8Í8ÍEÍg͈͙ÍÄÍÔÍåÍùÍÎÎÎ%Î=ÎwÎ~ÎΡβÎÝÎöÎÏ Ï Ï ÏÏÏ0ÏÏHÏbÏjÏÏªÏ»ÏæÏøÏÿÏÐÐÐ"Ð1Ð6Ð6ÐEÐYÐЇПЮÐÅÐåÐåÐåÐýÐ ÑÑ Ñ'ÑMÑHXºÌj·j·Œ··–·™·¤·¤·µ··Ì·Ï·Ò·Ø·æ·I0 ¨ãóãóùóô0ô2ô2ô:ôJD +Ì +ÌÌÌÌ(Ì:ÌBÌGÌSÌYÌ[Ì[Ì`ÌKL4¡4¡D¡R¡b¡h¡“¡·¡È¡¢¢ ¢LØ9ª„ª„Ą˄τӄބï„ý„…… …)…4…K…P…Y…\…f…n…q…t…ˆ…Ÿ…§…¾…Å…Î…Ñ…Ó…ã…æ…è…ï…ÿ…† +† †3†:†L†M<ðû ˜ ˜!˜#˜1˜N˜R˜b˜o˜N …;ê;êUêgêqêOH -fófózó|óƒó‘ó¹ó¾óÕóÚóÚóÞóæóP@:F=Q=QMQZQaQvQ}Q„QQQHâð@.@.Z.g.w.Œ.“.œ.¹.¼.Æ.RPúVúVW0W0W (Exit and Save) +#define DOCEF_QUIT 0x4000000000 //Send (Abort) +#define DOCEF_FROM_START 0x8000000000 +#define DOCEF_HAS_BORDER 0x10000000000 +#define DOCEF_SOLID_BORDER 0x20000000000 +#define DOCEF_BORDER_PLOT 0x40000000000 +#define DOCEF_CHECKED_COLLAPSED 0x80000000000 //Checked or Collapsed +#define DOCEF_CHECK_COLLAPSABLE 0x100000000000 +#define DOCEF_REFRESH_DATA 0x200000000000 +#define DOCEF_UPDATE_DATA 0x400000000000 +//$LK,"DOCEF_DEREF_DATA",A="MN:DOCEF_DEREF_DATA"$ is confusing. $LK,"DocForm",A="MN:DocForm"$() makes doc_e->data point to members +//of class. For ints, it derefs doc_e->data as a ptr. For strings, it doesn't. +#define DOCEF_DEREF_DATA 0x800000000000 +#define DOCEF_REMALLOC_DATA 0x1000000000000 +#define DOCEF_HAS_TERMINATOR 0x2000000000000 +#define DOCEF_ZERO_BASED 0x4000000000000 +#define DOCEF_HOLD 0x8000000000000 +#define DOCEF_TREE 0x10000000000000 +#define DOCEF_LST 0x20000000000000 +#define DOCEF_SKIP 0x40000000000000 +#define DOCEF_POPUP 0x80000000000000 +#define DOCEF_SKIP_IN_FORM 0x100000000000000 +#define DOCEF_FILTER_SKIP 0x200000000000000 +#define DOCEF_NO_CLICK_ON 0x400000000000000 +#define DOCEF_DONT_DRAW 0x800000000000000 //only works on sprites +#define DOCEF_DFT_LEN 0x1000000000000000 +#define DOCEF_DFT_RAW_TYPE 0x2000000000000000 + +#define DOCEG_HAS_ALLOC (DOCEF_TAG|DOCEF_AUX_STR|DOCEF_DEFINE|\ + DOCEF_HTML_LINK|DOCEF_LEFT_MACRO|DOCEF_RIGHT_MACRO|DOCEF_BIN_PTR_LINK|\ + DOCEF_REMALLOC_DATA) + +#define DOCEG_HAS_ARG ((DOCEG_HAS_ALLOC&~DOCEF_REMALLOC_DATA)|\ + DOCEF_LEN|DOCEF_LEFT_EXP|DOCEF_RIGHT_EXP|DOCEF_HAS_BIN|DOCEF_RAW_TYPE|\ + DOCEF_SHIFTED_X|DOCEF_SHIFTED_Y|DOCEF_SCROLLING_X|DOCEF_USER_DATA) + +#define DOCEG_DONT_EDIT (DOCEF_DEFINE|DOCEF_HTML_LINK|\ + DOCEF_AUX_STR|DOCEF_BIN_PTR_LINK|DOCEF_SCROLLING_X|DOCEF_TAG_CB) + +//These are ident to Doc flags +#define DOCEF_HIGHLIGHT 0x4000000 +#define DOCEF_WORD_WRAP 0x8000000 +#define DOCEF_BLINK ATTRF_BLINK +#define DOCEF_INVERT ATTRF_INVERT +#define DOCEF_SEL ATTRF_SEL +#define DOCEF_UNDERLINE ATTRF_UNDERLINE +#define DOCEf_HIGHLIGHT 26 +#define DOCEf_WORD_WRAP 27 +#define DOCEf_BLINK ATTRf_BLINK +#define DOCEf_INVERT ATTRf_INVERT +#define DOCEf_SEL ATTRf_SEL +#define DOCEf_UNDERLINE ATTRf_UNDERLINE + +//CDocEntry.de_flags. These first 16 are arg= +#define DOCEf_TAG 0 +#define DOCEf_LEN 1 +#define DOCEf_AUX_STR 2 +#define DOCEf_DEFINE 3 +#define DOCEf_HTML_LINK 4 +#define DOCEf_LEFT_EXP 5 +#define DOCEf_LEFT_MACRO 6 +#define DOCEf_RIGHT_EXP 7 +#define DOCEf_RIGHT_MACRO 8 +#define DOCEf_HAS_BIN 9 +#define DOCEf_BIN_PTR_LINK 10 +#define DOCEf_RAW_TYPE 11 +#define DOCEf_SHIFTED_X 12 +#define DOCEf_SHIFTED_Y 13 +#define DOCEf_SCROLLING_X 14 +#define DOCEf_USER_DATA 15 + +//CDocEntry.de_flags. These are +/- flags +#define DOCEf_LEFT_CB 16 +#define DOCEf_LEFT_AUTO 17 +#define DOCEf_RIGHT_CB 18 +#define DOCEf_RIGHT_AUTO 19 +#define DOCEf_LEFT_X 20 +#define DOCEf_CENTER_X 21 +#define DOCEf_RIGHT_X 22 +#define DOCEf_TOP_Y 23 +#define DOCEf_CENTER_Y 24 +#define DOCEf_BOTTOM_Y 25 +//HL...UL +#define DOCEf_TAG_CB 32 +#define DOCEf_PAGE_REL_Y 33 +#define DOCEf_MARGIN_REL_X 34 +#define DOCEf_WIN_REL 35 +#define DOCEf_LINK 36 +#define DOCEf_ESC 37 //Send (Exit and Save) +#define DOCEf_QUIT 38 //Send (Abort) +#define DOCEf_FROM_START 39 +#define DOCEf_HAS_BORDER 40 +#define DOCEf_SOLID_BORDER 41 +#define DOCEf_BORDER_PLOT 42 +#define DOCEf_CHECKED_COLLAPSED 43 //Checked or Collapsed +#define DOCEf_CHECK_COLLAPSABLE 44 +#define DOCEf_REFRESH_DATA 45 +#define DOCEf_UPDATE_DATA 46 +#define DOCEf_DEREF_DATA 47 +#define DOCEf_REMALLOC_DATA 48 +#define DOCEf_HAS_TERMINATOR 49 +#define DOCEf_ZERO_BASED 50 +#define DOCEf_HOLD 51 +#define DOCEf_TREE 52 +#define DOCEf_LST 53 +#define DOCEf_SKIP 54 +#define DOCEf_POPUP 55 +#define DOCEf_SKIP_IN_FORM 56 +#define DOCEf_FILTER_SKIP 57 +#define DOCEf_NO_CLICK_ON 58 +#define DOCEf_DONT_DRAW 59 //only works on sprites +#define DOCEf_DFT_LEN 60 +#define DOCEf_DFT_RAW_TYPE 61 +#define DOCEf_NUM_FLAGS 62 + +public class CDocBin +{ + CDocBin *next,*last; + I32 temp_use_cnt,renum_num; + U8 *tag; + U0 start; + U32 num,flags,size,use_cnt; + U0 end; + U8 *data; + U0 pad;#assert !($$&7) //(compiler lags one token) +}; + +#define DOC_SCROLL_SPEED 8 + +#define DOCSS_NORMAL 0 +#define DOCSS_SINGLE_QUOTE 1 +#define DOCSS_DBL_QUOTE 2 +#define DOCSS_COMMENT 3 +#define DOCSS_CPP_Z_COMMENT 4 + +#define DOC_ATTR_DFT_TEXT WHITE<<4+BLACK +#define DOC_COLOR_ALT_TEXT LTGRAY +#define DOC_COLOR_LINK RED +#define DOC_COLOR_MACRO LTBLUE +#define DOC_COLOR_ANCHOR DKGRAY +#define DOC_COLOR_TREE PURPLE +#define DOC_COLOR_PMT GREEN +#define DOC_COLOR_BIN CYAN +#define DOC_COLOR_KEYWORD BLUE +#define DOC_COLOR_KEYWORD2 LTRED +#define DOC_COLOR_COMMENT GREEN +#define DOC_COLOR_QUOTE BROWN + +public class CDocSettings +{ + U32 final_u32_attr; + I16 left_margin,right_margin,indent; + U16 page_len,header,footer; + I8 shifted_x,shifted_y; + U8 state,comment_depth,paren_depth,brace_depth, + cur_text_attr,dft_text_attr; +}; + +#define DOC_DFT MIN_I32 + +public class CDocEntryBase +{ +//This is a shortened structure for + //cmds like the text cmd which + //don't require the full CDocEntry structure. + CDocEntryBase *next,*last; + U8 *tag; + union { + U8 type_u8; //this stores the code + U32 type; //these store attr flags + }; + I32 page_line_num; + I64 de_flags; + I32 x,y; + U32 min_col,max_col; + CDocSettings settings; + I64 user_data; + U0 pad;#assert !($$&7) //(compiler lags one token) +}; + +#define DOCE_LEN_DFT 64 + +public class CDocEntry:CDocEntryBase +{ + union { + I64 attr; + I64 cursor_x_offset; + I64 (*left_cb)(CDoc *doc,CDocEntry *doc_e); + I64 left_exp; + }; + U8 *left_macro; + + union { + I64 cursor_y_offset; + I64 (*right_cb)(CDoc *doc,CDocEntry *doc_e); + I64 right_exp; + }; + U8 *right_macro; + + U8 *(*tag_cb)(CDoc *doc,CDocEntry *doc_e,CTask *mem_task); + U8 *define_str, + *aux_str, + *bin_ptr_link, + *html_link, + *my_fmt_data; + I64 hex_ed_width; + I32 scroll_len, + len, //$LK,"DOCE_LEN_DFT",A="MN:DOCE_LEN_DFT"$ + bin_num; + U8 raw_type,pad[3]; + CDocBin *bin_data; + U8 *data; + U0 pad;#assert !($$&7) //(compiler lags one token) +}; + +//$LK,"DocForm",A="MN:DocForm"$() $LK,"DocMenu",A="MN:DocMenu"$() $LK,"DocEd",A="MN:DocEd"$() $LK,"PopUpMenu",A="MN:PopUpMenu"$() +#define DOF_MIN_SIZE 0x01 +#define DOF_INTERCEPT_TASK_END 0x02 +#define DOF_DONT_HOME 0x04 +#define DOF_WIN_MAX 0x08 +#define DOF_DONT_TEXT_ATTR 0x10 +#define DOF_DONT_WINMGR_SYNC 0x20 +#define DOF_DONT_SHOW 0x40 +//Combines with $LK,"Editor Flags",A="MN:EDF_BAIL"$ + +class CEdFindText +{ + U8 find_text[STR_LEN] fmtstr "$$DA-P," + "A=\"Find :%s\"$$\n", + replace_text[STR_LEN] fmtstr "$$DA-P," + "A=\"Replace :%s\"$$\n"; + Bool replace fmtstr "$$CB,\"Replace\"$$\n", + scan_fwd fmtstr "$$CB,\"Fwd\"$$\n", + scan_sel_text fmtstr "$$CB,\"Selection\"$$\n", + match_case fmtstr "$$CB,\"Match Case\"$$\n", + whole_labels fmtstr "$$CB,\"Whole Labels\"$$\n", + local_var fmtstr "$$CB,\"Rename Local Var\"$$\n", + pmt,pad; + I64 filter_lines fmtstr "$$DA,A=\"Filter Lines:%d\"$$\n"; +}; + +class CEdFileName +{ + U8 name[256] fmtstr "$$DA-P,LEN=255,A=\"FileName:%s\"$$"; +}; + +//$LK,"Ed",A="MN:Ed"$() +#define EDF_BAIL 0x100 +#define EDF_COLLAPSE 0x200 +#define EDF_UNCOLLAPSE 0x400 +#define EDF_WAS_WRITE 0x800 //Was exit ESC or SHIFT_ESC? +//Combines with $LK,"Document Flags",A="MN:DOF_MIN_SIZE"$ + +#define EDf_BAIL 8 +#define EDf_COLLAPSE 9 +#define EDf_UNCOLLAPSE 10 +#define EDf_WAS_WRITE 11 + +// DOC header flags +#define DOCF_PLAIN_TEXT 0x1 +#define DOCF_PLAIN_TEXT_TABS 0x2 //has '\t', not DOCT_TAB +#define DOCF_NO_CURSOR 0x4 +#define DOCF_CARRIAGE_RETURN 0x8 +#define DOCF_DBL_DOLLARS 0x10 +#define DOCF_COLOR_NAMES 0x20 +//Reserved x2 +#define DOCF_BORDER_DOC 0x100 +#define DOCF_FORM 0x200 +#define DOCF_MIN_SIZE 0x400 +#define DOCF_HIDE_CURSOR 0x800 //use $LK,"DocCursor",A="MN:DocCursor"$ +#define DOCF_DONT_HIGHLIGHT_CURSOR 0x1000 //use $LK,"DocHighlightCursor",A="MN:DocHighlightCursor"$ +#define DOCF_NO_SCROLL_BARS 0x2000 //use $LK,"DocScroll",A="MN:DocScroll"$ +#define DOCF_ALLOW_UNDO 0x4000 +#define DOCF_DONT_SHOW 0x8000 +#define DOCF_HAS_SONG 0x10000 +#define DOCF_MORE 0x20000 +#define DOCF_BWD_MOVEMENT 0x40000 +#define DOCF_NULL_GRAB_SCROLL 0x80000 +#define DOCF_DONT_SWAP_OUT 0x100000 +#define DOCF_DO_FULL_REFRESH 0x200000 +#define DOCF_BREAK_UNLOCKED 0x400000 +//Reserved x1 +#define DOCF_HIGHLIGHT DOCEF_HIGHLIGHT +#define DOCF_WORD_WRAP DOCEF_WORD_WRAP +#define DOCF_BLINK DOCEF_BLINK +#define DOCF_INVERT DOCEF_INVERT +#define DOCF_SEL DOCEF_SEL +#define DOCF_UNDERLINE DOCEF_UNDERLINE + +#define DOCF_OVERSTRIKE 0x100000000 +#define DOCF_IN_DOLLAR 0x200000000 +#define DOCF_SUPERSCRIPT_MODE 0x400000000 +#define DOCF_SUBSCRIPT_MODE 0x800000000 +#define DOCF_UNDO_DIRTY 0x1000000000 + +#define DOCf_PLAIN_TEXT 0 +#define DOCf_PLAIN_TEXT_TABS 1 //has '\t', not DOCT_TAB +#define DOCf_NO_CURSOR 2 +#define DOCf_CARRIAGE_RETURN 3 +#define DOCf_DBL_DOLLARS 4 +#define DOCf_COLOR_NAMES 5 +//Reserved x2 +#define DOCf_BORDER_DOC 8 +#define DOCf_FORM 9 +#define DOCf_MIN_SIZE 10 +#define DOCf_HIDE_CURSOR 11 //use $LK,"DocCursor",A="MN:DocCursor"$ +#define DOCf_DONT_HIGHLIGHT_CURSOR 12 //use $LK,"DocHighlightCursor",A="MN:DocHighlightCursor"$ +#define DOCf_NO_SCROLL_BARS 13 //use $LK,"DocScroll",A="MN:DocScroll"$ +#define DOCf_ALLOW_UNDO 14 +#define DOCf_DONT_SHOW 15 +#define DOCf_HAS_SONG 16 +#define DOCf_MORE 17 +#define DOCf_BWD_MOVEMENT 18 +#define DOCf_NULL_GRAB_SCROLL 19 +#define DOCf_DONT_SWAP_OUT 20 +#define DOCf_DO_FULL_REFRESH 21 +#define DOCf_BREAK_UNLOCKED 22 +//Reserved x1 + +#define DOCf_HIGHLIGHT DOCEf_HIGHLIGHT +#define DOCf_WORD_WRAP DOCEf_WORD_WRAP +#define DOCf_BLINK DOCEf_BLINK +#define DOCf_INVERT DOCEf_INVERT +#define DOCf_SEL DOCEf_SEL +#define DOCf_UNDERLINE DOCEf_UNDERLINE + +#define DOCf_OVERSTRIKE 32 +#define DOCf_IN_DOLLAR 33 +#define DOCf_SUPERSCRIPT_MODE 34 +#define DOCf_SUBSCRIPT_MODE 35 +#define DOCf_UNDO_DIRTY 36 + +//locked flags +#define DOClf_LOCKED 0 +class CDocUndo +{ + CDocUndo *next,*last; + I64 size,doc_flags,time_stamp; + U8 *body; +}; + +//See $LK,"DocMenu",A="MN:DocMenu"$() +#define DOCM_CANCEL (-1) + +#define DOC_SIGNATURE_VAL 'DocS' + +#define RECALCt_NORMAL 0x00 +#define RECALCt_FIND_CURSOR 0x01 +#define RECALCt_TO_SCREEN 0x02 +#define RECALCG_MASK 0xFF + +#define RECALCF_HAS_CURSOR 0x100 +#define RECALCF_ADD_CURSOR 0x200 +#define RECALCF_TO_HTML 0x400 + +public class CDoc //Linked Text File header +{//See $LK,"Doc",A="HI:Doc"$ for documentation. + CDocEntryBase head; + I64 flags,locked_flags; + CDocEntry *cur_entry,*old_cur_entry; + I32 cur_col,old_cur_col, + line_start_col,top_line_num, + dollar_buf_size,dollar_buf_ptr; + U8 *dollar_buf; //When entering $$ cmds, it buffers them until the end $$. + + CTask *win_task,*mem_task,*owning_task; + I32 page_line_num,undo_cnt, + x,y,min_x,max_x,min_y,max_y; + I64 line,col,best_d, + old_win_top,old_win_bottom, + old_win_left,old_win_right, + cmd_U8; + U32 doc_signature,cur_bin_num; + I64 max_entries, + updates_cnt; + CEdFindText *find_replace; + + U8 *cur_sprite;//Set cur_sprite use (ip.pos.x,ip.pos.y) as input. +//Output is nearest. See $LK,"*_cur_elem_num=",A="FF:::/Adam/Gr/SpriteEd.HC,*_cur_elem_num=doc->"$ and $LK,"::/Demo/Graphics/Pick.HC"$. + I64 nearest_sprite_elem_num; + + CEdFileName filename; + I64 file_attr; + I64 (*left_click_link)(CDoc *doc,CDocEntry *doc_e); + I64 (*right_click_link)(CDoc *doc,CDocEntry *doc_e); + + //See $LK,"::/Apps/Psalmody/JukeBox.HC"$ + U8 *user_put_data; //Passed to user_put_key() and user_put_s() + Bool (*user_put_key)(CDoc *doc,U8 *data,I64 ch,I64 sc); + Bool (*user_put_s)(CDoc *doc,U8 *data,U8 *st); + + CDoc *parent_doc; //(When browsing deeper, opening deeper docs.) + U64 desc; //8 characters. See $LK,"DocBorderLstDraw",A="MN:DocBorderLstDraw"$(). + + CDocBin bin_head; + CDocSettings settings_head; + CDocUndo undo_head; + + I64 user_data; + U0 pad;#assert !($$&7) //(compiler lags one token) +}; + +#help_index "Windows" +/* +Fs->win_inhibit mask + +Some inhibit actions on the task itself. +Some inhibit actions if the focus task +tries to do something. +*/ +#define WIF_SELF_FOCUS 0x0001 //If active this task cannot have focus + //MENU 0x0002 +#define WIF_SELF_CTRLS 0x0004 +#define WIF_SELF_IP_L 0x0008 + //IP_L_D 0x0010 +#define WIF_SELF_IP_R 0x0020 + //IP_R_D 0x0040 +#define WIF_SELF_IP_WHEEL 0x0080 //Does nothing, yet +#define WIF_SELF_BORDER 0x0100 +#define WIF_SELF_GRAB_SCROLL 0x0200 +#define WIF_SELF_DOC 0x0400 +#define WIF_SELF_ODE 0x0800 +#define WIF_SELF_KEY_DESC 0x1000 + //FOCUS 0x00010000 +#define WIF_FOCUS_TASK_MENU 0x00020000 +#define WIF_FOCUS_TASK_CTRLS 0x00040000 +#define WIF_FOCUS_TASK_IP_L 0x00080000 +#define WIF_FOCUS_TASK_IP_L_D 0x00100000 +#define WIF_FOCUS_TASK_IP_R 0x00200000 +#define WIF_FOCUS_TASK_IP_R_D 0x00400000 +#define WIF_FOCUS_TASK_IP_WHEEL 0x00800000 //Does nothing, yet +#define WIF_FOCUS_TASK_BORDER 0x01000000 +#define WIF_FOCUS_TASK_GRAB_SCROLL 0x02000000 + +#define WIG_DBL_CLICK (WIF_FOCUS_TASK_IP_L_D|WIF_FOCUS_TASK_IP_R_D) +#define WIG_TASK_DFT (WIF_FOCUS_TASK_MENU|WIG_DBL_CLICK|\ + 0xFFFF-WIF_SELF_DOC-WIF_SELF_ODE) +#define WIG_USER_TASK_DFT WIF_SELF_KEY_DESC + +#define WIf_SELF_FOCUS 0 +#define WIf_SELF_CTRLS 2 +#define WIf_SELF_IP_L 3 +#define WIf_SELF_IP_R 5 +#define WIf_SELF_IP_WHEEL 7 +#define WIf_SELF_BORDER 8 +#define WIf_SELF_GRAB_SCROLL 9 +#define WIf_SELF_DOC 10 +#define WIf_SELF_ODE 11 +#define WIf_SELF_KEY_DESC 12 +#define WIf_FOCUS_TASK_MENU 17 +#define WIf_FOCUS_TASK_CTRLS 18 +#define WIf_FOCUS_TASK_IP_L 19 +#define WIf_FOCUS_TASK_IP_L_D 20 +#define WIf_FOCUS_TASK_IP_R 21 +#define WIf_FOCUS_TASK_IP_R_D 22 +#define WIf_FOCUS_TASK_IP_WHEEL 23 +#define WIf_FOCUS_TASK_BORDER 24 +#define WIf_FOCUS_TASK_GRAB_SCROLL 25 + +class CWinMgrTimingGlbls +{ + I64 last_total_jiffies, + last_idle_pt_hits[MP_MAX_PROCESSORS], + last_swap_cnter[MP_MAX_PROCESSORS]; + F64 last_calc_idle_time,calc_idle_delta_time; + I64 calc_idle_cnt; +}; + +#define WINMGR_FPS 30 + +public class CWinMgrGlbls +{ + I64 updates; + F64 ode_time, + last_ode_time, + fps, //You can read but not write this. You have no control. + last_refresh_tS; + CWinMgrTimingGlbls *t; + Bool show_menu, + grab_scroll, + grab_scroll_closed; +}; + +#help_index "AutoComplete" +#define ACf_INIT_IN_PROGRESS 0 +#define AC_MAX_FILLINS 10 +public class CAutoCompleteGlbls +{ + I64 num_words; + CHashTable *hash_table; + U8 *cur_word; + I64 flags; + CTask *task; + I64 partial_len,num_fillins, + fillin_hits [AC_MAX_FILLINS+1]; + CHashAC *fillin_matches[AC_MAX_FILLINS+1]; +}; + +#help_index "AutoComplete/Dictionary" +#define ACD_WORD_FILENAME "/Adam/AutoComplete/ACWords.DAT.Z" +#define ACD_DEF_FILENAME "/Adam/AutoComplete/ACDefs.DAT" +#define ACD_DEF_FILENAME_Z "/Adam/AutoComplete/ACDefs.DAT.Z" + +#define ACD_H1 0 +#define ACD_H1_END 1 +#define ACD_DEF 2 +#define ACD_DEF_END 3 +#define ACD_PRONUNCIATION 4 +#define ACD_PRONUNCIATION_END 5 +#define ACD_POS 6 +#define ACD_POS_END 7 +#define ACD_EXTRA 8 +#define ACD_EXTRA_END 9 +#define ACD_BLK_SIZE 0x4000 + +#define ACD_END_CHAR 0x00 +#define ACD_WORD_CHAR 0x01 +#define ACD_DEF_CHAR 0x02 +#define ACD_PRONUNCIATION_CHAR 0x03 +#define ACD_POS_CHAR 0x04 +#define ACD_EXTRA_CHAR 0x05 + +#define ACD_MAX_FILLINS 10 +public class CAutoCompleteDictGlbls +{ + U8 *word_lst; + I64 word_lst_size,num_words,num_fillins; + U8 *fillins[ACD_MAX_FILLINS]; + Bool has_words,has_defs; +}; + +#help_index "Compiler/Directive" +//Compiler $LK,"Option",A="MN:Option"$()s +//You might need to do #exe {Option();} +//Note: The #exe stmt is lexed-ahead, +//so it takes effect earlier than you might expect. +#define OPTf_ECHO 0x00 +#define OPTf_TRACE 0x01 +#define OPTf_WARN_UNUSED_VAR 0x10 //Applied to funs, not stmts +#define OPTf_WARN_PAREN 0x11 //Warn unnecessary parens +#define OPTf_WARN_DUP_TYPES 0x12 //Warn dup local var type stmts +#define OPTf_WARN_HEADER_MISMATCH 0x13 +#define OPTf_EXTERNS_TO_IMPORTS 0x20 +#define OPTf_KEEP_PRIVATE 0x21 +#define OPTf_NO_REG_VAR 0x22 //Applied to funs, not stmts +#define OPTf_GLBLS_ON_DATA_HEAP 0x23 +//Disable 10-byte float consts for ã,log2_10,log10_2,loge_2 +#define OPTf_NO_BUILTIN_CONST 0x24 //Applied to funs, not stmts +#define OPTf_USE_IMM64 0x25 //Not completely implemented + +#define OPTF_ECHO (1<last_cc->lex_include_stk->line_num);} +#define __CMD_LINE__ #exe{StreamPrint("%d",Fs->last_cc->flags&CCF_CMD_LINE &&\ + Fs->last_cc->lex_include_stk->depth<2);} +#define __FILE__ #exe{StreamPrint("\"%s\"",\ + Fs->last_cc->lex_include_stk->full_name);} +#define __DIR__ #exe{StreamDir;} + +#define LFSF_DOC 1 +#define LFSF_DEFINE 2 +class CLexFile +{ + CLexFile *next; + U8 *buf, + *buf_ptr; + I64 line_num,flags; + U8 *full_name, + *line_start; + CDoc *doc; + CDocEntry *cur_entry; + I32 depth; + U8 last_U16,pad[3]; +}; + +class CAOTCtrl +{ + I64 ip; //Inst ptr + CAsmArg arg1,arg2; + CAOTBinBlk *bin; + I64 num_bin_U8s, + max_align_bits,module_org; + CAsmUnresolvedRef *local_unresolved,*glbl_unresolved; + CAOTAbsAddr *abss; + CAOTHeapGlbl *heap_glbls; + I64 lst_col,lst_last_ip; + U8 *last_label,*lst_last_line; + CLexFile *lst_last_lfn; + I64 seg_size; + Bool lst; +}; + +//Tokens +#define TK_EOF 0 +#define TK_SUPERSCRIPT 0x001 +#define TK_SUBSCRIPT 0x002 +#define TK_NORMALSCRIPT 0x003 +#define TK_IDENT 0x100 +#define TK_STR 0x101 +#define TK_I64 0x102 +#define TK_CHAR_CONST 0x103 +#define TK_F64 0x104 +#define TK_PLUS_PLUS 0x105 +#define TK_MINUS_MINUS 0x106 +#define TK_DEREFERENCE 0x107 +#define TK_DBL_COLON 0x108 +#define TK_SHL 0x109 +#define TK_SHR 0x10A +#define TK_EQU_EQU 0x10B +#define TK_NOT_EQU 0x10C +#define TK_LESS_EQU 0x10D +#define TK_GREATER_EQU 0x10E +#define TK_AND_AND 0x10F +#define TK_OR_OR 0x110 +#define TK_XOR_XOR 0x111 +#define TK_SHL_EQU 0x112 +#define TK_SHR_EQU 0x113 +#define TK_MUL_EQU 0x114 +#define TK_DIV_EQU 0x115 +#define TK_AND_EQU 0x116 +#define TK_OR_EQU 0x117 +#define TK_XOR_EQU 0x118 +#define TK_ADD_EQU 0x119 +#define TK_SUB_EQU 0x11A +#define TK_IF 0x11B +#define TK_IFDEF 0x11C +#define TK_IFNDEF 0x11D +#define TK_IFAOT 0x11E +#define TK_IFJIT 0x11F +#define TK_ENDIF 0x120 +#define TK_ELSE 0x121 +#define TK_MOD_EQU 0x122 +#define TK_DOT_DOT 0x123 +#define TK_ELLIPSIS 0x124 +#define TK_INS_BIN 0x125 +#define TK_INS_BIN_SIZE 0x126 +#define TK_NUM_TK 0x127 + +class CLexHashTableContext +{ + CLexHashTableContext *next; + I64 old_flags,hash_mask; + CHashFun *local_var_lst, + *fun; + CHashTable *hash_table_lst, + *define_hash_table, + *local_hash_table, + *glbl_hash_table; +}; + +//CmpCtrl flags +#define CCF_CMD_LINE 0x001 +#define CCF_PMT 0x002 +#define CCf_PMT 1 +#define CCF_QUESTION_HELP 0x004 +#define CCF_DONT_FREE_BUF 0x008 +#define CCF_NO_DEFINES 0x010 +#define CCF_IN_IF 0x020 +#define CCF_JUST_LOAD 0x040 +#define CCF_KEEP_NEW_LINES 0x080 +#define CCF_KEEP_DOT 0x100 +#define CCF_KEEP_NUM_SIGN 0x200 +#define CCF_KEEP_AT_SIGN 0x400 +#define CCf_PASS_TRACE_PRESENT 11 +#define CCF_NOT_CONST 0x0000010000 +#define CCF_NO_REG_OPT 0x0000020000 +#define CCF_IN_QUOTES 0x0000040000 +#define CCF_EXE_BLK 0x0000080000 +#define CCF_HAS_MISC_DATA 0x0000100000 +#define CCF_HAS_RETURN 0x0000200000 +#define CCF_ASM_EXPRESSIONS 0x0000400000 +#define CCF_UNRESOLVED 0x0000800000 +#define CCF_LOCAL 0x0001000000 +#define CCF_FUN_EXP 0x0002000000 +#define CCf_FUN_EXP 25 +#define CCF_POSTINC 0x0004000000 +#define CCF_POSTDEC 0x0008000000 +#define CCF_PREINC 0x0010000000 +#define CCF_PREDEC 0x0020000000 +#define CCF_ARRAY 0x0040000000 +#define CCF_RAX 0x0080000000 +#define CCF_USE_LAST_U16 0x0100000000 +#define CCf_USE_LAST_U16 32 +#define CCF_LAST_WAS_DOT 0x0200000000 +#define CCF_AOT_COMPILE 0x0400000000 +#define CCf_AOT_COMPILE 34 +#define CCF_NO_ABSS 0x0800000000 +#define CCF_PAREN 0x1000000000 +#define CCf_PAREN 36 +#define CCF_CLASS_IP 0x2000000000 +#define CCF_DONT_MAKE_RES 0x4000000000 + +public class CCmpCtrl +{ + CCmpCtrl *next,*last; + I64 token, + flags, + cur_i64; + F64 cur_f64; + U8 *cur_str; + I64 cur_str_len, + class_ip; + U8 *dollar_buf; + I64 dollar_cnt; + U8 *cur_help_idx; + I64 last_U16, + min_line,max_line,last_line_num, + lock_cnt; + U32 *chars_bmp_alpha_numeric; + CLexHashTableContext htc; + CHashGeneric *hash_entry; + CAbsCntsI64 abs_cnts; + CAsmUndefHash *asm_undef_hash; + CMemberLst *local_var_entry; + CCodeMisc *lb_leave; + U8 *cur_buf_ptr; + CLexFile *lex_include_stk, + *lex_prs_stk, + *fun_lex_file; + CStreamBlk *next_stream_blk,*last_stream_blk; + CAOT *aot; + + I64 pass,opts,pass_trace,saved_pass_trace, + error_cnt,warning_cnt; + + //For intermediate codes with multiple float ops (int<->float conversions) + I64 cur_ic_float_op_num,last_ic_float_op_num; + CIntermediateCode *last_float_op_ic; + Bool last_dont_pushable,last_dont_popable,last_float_op_pos, + dont_push_float,pad[4]; + + CCodeCtrl coc; + CPrsStk *ps; + CAOTCtrl *aotc; + I64 aot_depth,pmt_line; + U0 pad;#assert !($$&7) //(compiler lags one token) +}; + +#help_index "Compiler" +public class CCmpGlbls +{ + CHashTable *asm_hash; + CHashClass *internal_types[RT_NUM_IT]; + CIntermediateCode ic_nop; + U32 *dual_U16_tokens1,*dual_U16_tokens2,*dual_U16_tokens3, + *binary_ops; + I64 num_reg_vars,num_non_ptr_vars, + stk_temps_mask,reg_vars_mask,non_ptr_vars_mask; + U8 *to_reg_vars_map,*non_ptr_vars_map; + I64 size_arg_mask[9], + compiled_lines; +}; + +#help_index "Debugging/Unassemble" +class CUAsmGlbls +{ + CInst **table_16_32,**table_64; + I64 table_16_32_entries, + table_64_entries, + ins64_arg_mask, + signed_arg_mask, + mem_arg_mask; +}; + +#help_index "Devices;PCI" +class CPCIDev +{ + CPCIDev *next,*last; + U16 vendor,dev_id; + U8 bus,dev,fun,pad, + sub_code,base_code,pad[6], + *vendor_str,*dev_id_str; +}; + +#help_index "Devices;File/System;PCI" +public class CATARep +{ + CATARep *next; + I64 num,type,base0,base1,unit,irq; +}; + +//See $LK,"::/Doc/Credits.DD"$. +#define ATA_NOP 0x00 +#define ATA_DEV_RST 0x08 +#define ATA_PACKET 0xA0 +#define ATA_READ_NATIVE_MAX 0xF8 +#define ATA_READ_NATIVE_MAX_EXT 0x27 +#define ATA_SET_MAX 0xF9 +#define ATA_SET_MAX_EXT 0x37 +#define ATA_READ_MULTI 0xC4 +#define ATA_READ_MULTI_EXT 0x29 +#define ATA_WRITE_MULTI 0xC5 +#define ATA_WRITE_MULTI_EXT 0x39 +#define ATA_ID_DEV 0xEC + +#define ATAS_ERR 0x01 +#define ATAS_DRQ 0x08 +#define ATAS_DF 0x20 +#define ATAS_DRDY 0x40 +#define ATAS_BSY 0x80 + +#define ATAR0_DATA 0 +#define ATAR0_FEAT 1 +#define ATAR0_NSECT 2 +#define ATAR0_SECT 3 +#define ATAR0_LCYL 4 +#define ATAR0_HCYL 5 +#define ATAR0_SEL 6 +#define ATAR0_STAT 7 +#define ATAR0_CMD 7 +#define ATAR1_CTRL 2 + +#help_index "File/FileNames" +#define FILEMASK_JIT "*.HC*;*.HH*" +#define FILEMASK_AOT "*.HC*;*.HH*;*.PRJ*" +#define FILEMASK_SRC "*.HC*;*.HH*;*.AUT*;*.PRJ*" +#define FILEMASK_TXT FILEMASK_SRC ";*.DD*;*.TXT*" +#define FILEMASK_GRA "*.GRA*;*.BMP*" + +#help_index "File/Low Level" +#define BLK_SIZE_BITS 9 +#define BLK_SIZE (1<drv_let directly in case a drive has been remapped. + //Use $LK,"Drv2Let",A="MN:Drv2Let"$(). + I64 locked_flags; + U32 dv_signature; + U8 drv_let,pad; + U16 fs_type; + I64 drv_offset, + size, + file_system_info_sect, + fat1,fat2, + root_cluster, + data_area, + spc; //sectors per cluster + CDate fat32_local_time_offset; + CTask *owning_task; + CBlkDev *bd; + + CFAT32FileInfoSect *fis; + I64 fat_blk_dirty, + cur_fat_blk_num; + U32 *cur_fat_blk; + CFreeLst *next_free,*last_free; +}; + +#define DSK_CACHE_HASH_SIZE 0x2000 + +class CCacheBlk +{ + CCacheBlk *next_lru,*last_lru; + CCacheBlk *next_hash,*last_hash; + CDrv *dv; + I64 blk; + U8 body[BLK_SIZE]; +}; + +#help_index "File/System" +public class CBlkDevGlbls +{ + CBlkDev *blkdevs; + U8 *dft_iso_filename; //See $LK,"blkdev.dft_iso_filename",A="FF:::/Kernel/KEnd.HC,blkdev.dft_iso_filename"$ + U8 *temp_filename; + U8 *home_dir; + CCacheBlk *cache_base,*cache_ctrl,**cache_hash_table; + I64 cache_size,read_cnt,write_cnt; + CDrv *drvs,*let_to_drv[32]; + I64 auto_mount_ide_cnt; + U8 boot_drv_let,first_hd_drv_let,first_dvd_drv_let; + Bool dvd_boot_is_good,pad[4]; +}; + +#help_index "File/Internal" +public class CDirContext +{ + CDrv *old_dv,*dv; + U8 *old_dir,*mask; +}; + +#help_index "File/CFile" +#define FFB_NEXT_BLK MAX_I64 + +#define FF_WRITE 1 +#define FF_NEW_FILE 2 +#define FF_BUF_DIRTY 4 +#define FF_NEEDS_WRITE 8 +#define FF_CONTIGUOUS 16 +#define FF_USE_OLD_DATETIME 32 + +public class CFile //See $LK,"::/Demo/Dsk/DataBase.HC"$. +{ + I64 flags; + CDirEntry de; + CDrv *dv; + I64 fblk_num,cluster,file_cluster_num,max_blk; + U8 *cluster_buf; +}; + +#help_index "Memory/Heap" +#define _CFG_HEAP_DBG FALSE + +#if _CFG_HEAP_DBG +class CMemUnused +{ + CHeapCtrl *hc; + U8 *caller1,*caller2; + CMemUnused *next; + I64 size; +}; +class CMemUsed +{ + CHeapCtrl *hc; + U8 *caller1,*caller2; + CMemUsed *next,*last; + I64 size; + U0 start; +}; +#else +class CMemUnused +{ + U0 hc; + U0 caller1,caller2; + CMemUnused *next; + I64 size; +}; +class CMemUsed +{ + CHeapCtrl *hc; + U0 caller1,caller2; + U0 next,last; + I64 size; + U0 start; +}; +#endif + +#help_index "Memory/BlkPool" +/*TempleOS does not mess with page tables after setting them up +during boot -- $LK,"SYS_INIT_PAGE_TABLES",A="MN:SYS_INIT_PAGE_TABLES"$. + +$LK,"MEM_PAGE_SIZE",A="MN:MEM_PAGE_SIZE"$, the unit size for alloications, is arbitrary, +and is not related to CPU hardware. + +All virtual addresses are ident to physical at all times. +text.vga_alias is not identity-mapped, however. + +There is no high kernel memory because RAM's physical +addresses are low. (All motherboards that I know of +put RAM in low addresses of 64-bit address space.) +It's ring-0-only so all (or none) is kernel, remember. +2 Meg hardware pages are used. Only the caching bits matter. +Remember, it is ring-0-only and identity-mapped! + +All code is placed in just the lowest 2 Gig, so the CALL REL32 +inst always works. It never changes out of ring-0, remember, +so I don't need to waste cycles on use SYSCALL or software interrupts. +Everything just uses CALL REL32. +*/ + +#define MBS_USED_SIGNATURE_VAL 'MBUs' +#define MBS_UNUSED_SIGNATURE_VAL 'MBUn' +class CMemBlk +{ + CMemBlk *next,*last; + U32 mb_signature,pages; +}; + +#define MRT_UNUSED 0 +#define MRT_RAM 1 +#define MRT_DEV 2 + +class CMemRange +{ + CMemRange *next,*last; + U32 type,flags; + U8 *base; + I64 size; +}; + +#define MEM_PAGE_BITS 9 +#define MEM_PAGE_SIZE (1< +#define MSG_KEY_UP 3 //($LK,"ASCII",A="MN:CH_CTRLA"$,$LK,"scan code",A="FI:::/Doc/CharOverview.DD"$) Press +#define MSG_IP_MOVE 4 //(x,y) +#define MSG_IP_L_DOWN 5 //(x,y) +#define MSG_IP_L_UP 6 //(x,y) +#define MSG_IP_L_D_DOWN 7 //(x,y) +#define MSG_IP_L_D_UP 8 //(x,y) +#define MSG_IP_R_DOWN 9 //(x,y) +#define MSG_IP_R_UP 10 //(x,y) +#define MSG_IP_R_D_DOWN 11 //(x,y) +#define MSG_IP_R_D_UP 12 //(x,y) + +#define MSG_KEY_DOWN_UP -2 //Down & UP +#define MSG_IP_L_DOWN_UP -5 //Down & Up +#define MSG_IP_L_D_DOWN_UP -7 //Down & Up +#define MSG_IP_R_DOWN_UP -9 //Down & Up +#define MSG_IP_R_D_DOWN_UP -11 //Down & Up + +#help_index "Task/Settings" +#define TSF_SAME_SONG 1 +public class CTaskSettings +{ + CTaskSettings *next; + U8 *cur_dir; + I64 left,right,top,bottom; + U0 (*draw_it)(CTask *task,CDC *dc); + U0 (*task_end_cb)(); + CTask *song_task,*animate_task; + I64 scroll_x,scroll_y,scroll_z; + CBGR48 palette[NUM_COLORS]; + U32 win_inhibit; + U8 text_attr,title_src, + border_attr,border_src, + task_title[STR_LEN]; + Bool border,hide_cursor,highlight_cursor,scroll,autocomplete,pad[3]; + U0 pad;#assert !($$&7) //(compiler lags one token) +}; + +#help_index "Task" +//CTask.border_src +#define BDS_CONST 0 +#define BDS_CUR_DRV 1 +#define BDS_ED_FILENAME_DRV 2 + +//CTask.title_src +#define TTS_CONST 0 +#define TTS_LOCKED_CONST 1 //This is not strictly enforced +#define TTS_TASK_NAME 2 +#define TTS_ED_FILENAME 3 +#define TTS_CUR_LEX 4 + +//CTask.task_flags +#define TASKf_TASK_LOCK 0 +#define TASKf_KILL_TASK 1 +#define TASKf_SUSPENDED 2 +#define TASKf_IDLE 3 +#define TASKf_INPUT_FILTER_TASK 4 +#define TASKf_FILTER_INPUT 5 +#define TASKf_HAS_SONG 6 +#define TASKf_DISABLE_BPTS 7 +#define TASKf_AWAITING_MSG 8 +#define TASKf_BREAK_LOCKED 9 +#define TASKf_PENDING_BREAK 10 +#define TASKf_BREAK_TO_SHIFT_ESC 11 +#define TASKf_KILL_AFTER_DBG 12 +#define TASKf_NONTIMER_RAND 13 + +//CTask.display_flags +#define DISPLAYf_SHOW 0 +#define DISPLAYf_NOT_RAW 1 +#define DISPLAYf_SILENT 2 +#define DISPLAYf_NO_BORDER 3 +#define DISPLAYf_WIN_ON_TOP 4 +#define DISPLAYf_CHILDREN_NOT_ON_TOP 5 + +#define TASK_SIGNATURE_VAL 'TskS' +#define TASK_NAME_LEN 32 +class CTaskStk +{ + CTaskStk *next_stk; + I64 stk_size,stk_ptr; + U0 stk_base; +}; + +#define DYING_JIFFIES ToI64(JIFFY_FREQ/5) +class CTaskDying +{ + CTask *next,*last; + I64 wake_jiffy; +}; + +public class CTask //The Fs segment reg points to current CTask. +{ + CTask *addr; //Self-addressed ptr + U32 task_signature,win_inhibit; +U0 pad;#assert $$==offset(CTaskDying.wake_jiffy) + I64 wake_jiffy; + U32 task_flags,display_flags; + + CHeapCtrl *code_heap,*data_heap; + + CDoc *put_doc,*display_doc, //When double buffering, these two differ. + *border_doc; + I64 win_left,win_right,win_top,win_bottom; + + CDrv *cur_dv; + U8 *cur_dir; + + CTask *parent_task, + *next_task,*last_task, + *next_input_filter_task,*last_input_filter_task, + *next_sibling_task,*last_sibling_task, + *next_child_task,*last_child_task; + + //These are derived from left,top,right,bottom + I64 win_width,win_height, + pix_left,pix_right,pix_width, //These are in pixs, not characters + pix_top,pix_bottom,pix_height, + scroll_x,scroll_y,scroll_z; + + //These must be in this order + //for $LK,"TASK_CONTEXT_SAVE",A="FF:::/Kernel/Sched.HC,TASK_CONTEXT_SAVE"$ and $LK,"_TASK_CONTEXT_RESTORE",A="FF:::/Kernel/Sched.HC,_TASK_CONTEXT_RESTORE"$ + I64 rip,rflags,rsp,rsi,rax,rcx,rdx,rbx,rbp,rdi, + r8,r9,r10,r11,r12,r13,r14,r15; + CCPU *gs; + CFPU *fpu_mmx; + I64 swap_cnter; + + U0 (*draw_it)(CTask *task,CDC *dc); + + U8 task_title[STR_LEN], + task_name[TASK_NAME_LEN], + wallpaper_data[STR_LEN], + + title_src,border_src, + text_attr,border_attr; + U16 win_z_num,pad; + + CTaskStk *stk; + + CExcept *next_except,*last_except; + I64 except_rbp, //throw routine's RBP + except_ch; //throw(ch) + U8 *except_caller1,*except_caller2,*except_caller3,*except_caller4; + + Bool catch_except; + Bool new_answer; + U8 answer_type,pad[5]; + I64 answer; + F64 answer_time; + CBpt *bpt_lst; + CCtrl *next_ctrl,*last_ctrl; + CMenu *cur_menu; + CTaskSettings *next_settings; + CMathODE *next_ode,*last_ode; + F64 last_ode_time; + CHashTable *hash_table; + + CSrvCtrl srv_ctrl; + CCmpCtrl *next_cc,*last_cc; + CHashFun *last_fun; + + U0 (*task_end_cb)(); + CTask *song_task,*animate_task; + I64 rand_seed, + task_num, + fault_num,fault_err_code; + CTask *popup_task, + *dbg_task; + CWinScroll horz_scroll,vert_scroll; + + I64 user_data; + U0 pad;#assert !($$&7) //(compiler lags one token) +}; + +class CTSS +{ + U32 res1; + I64 rsp0,rsp1,rsp2,res2, + ist1,ist2,ist3,ist4,ist5,ist6,ist7,res3; + U16 res4,io_map_offset; + U8 io_map[0x10000/8]; + I64 *st0,*st1,*st2; + U16 tr,tr_ring3; +}; + +#define ans (Fs->answer) +#define ansf (Fs->answer(F64)) + +#define _RAX Fs->rax +#define _RBX Fs->rbx +#define _RCX Fs->rcx +#define _RDX Fs->rdx +#define _RSI Fs->rsi +#define _RDI Fs->rdi +#define _RBP Fs->rbp +#define _RSP Fs->rsp +#define _RIP Fs->rip +#define _R8 Fs->r8 +#define _R9 Fs->r9 +#define _R10 Fs->r10 +#define _R11 Fs->r11 +#define _R12 Fs->r12 +#define _R13 Fs->r13 +#define _R14 Fs->r14 +#define _R15 Fs->r15 + +#help_index "MultiCore" +#define CPUf_RAN_A_TASK 0 +#define CPUf_DYING_TASK_QUE 1 + +public class CCPU //The Gs segment reg points to current CCPU. +{ + CCPU *addr; //Self-addressed ptr + I64 num,cpu_flags, + startup_rip, + idle_pt_hits; + F64 idle_factor; + I64 total_jiffies; + CTask *seth_task,*idle_task; + I64 tr, //task reg + swap_cnter; + U0 (*profiler_timer_irq)(CTask *task); + CTaskDying *next_dying,*last_dying; + I64 kill_jiffy; + CTSS *tss; + I64 start_stk[16]; + U0 pad;#assert !($$&7) //(compiler lags one token) +}; + +#help_index "Memory/Page Tables" +#define MEM_MIN_MEG 512 //512 Meg minimum. +#define MEM_MAPPED_SPACE 0x4000000000 //Arbitrarily set to 256 Gig. +#define MEM_NUM_2MEG (MEM_MAPPED_SPACE>>21) +#define MEM_NUM_USED_1GIG (MEM_MAPPED_SPACE>>(21+9)) +#define MEM_NUM_1GIG (0x1000/8) +#define MEM_NUM_512GIG (0x1000/8) + +#define SYS_FIXED_AREA 0x100000 +public class CSysFixedArea +{ + U8 pml2[MEM_NUM_2MEG*8],pml3[MEM_NUM_1GIG*8],pml4[MEM_NUM_512GIG*8]; + $$=($$+15)&-16; + CFPU init_fpu_mmx; + CCPU boot_cpu; + CTask adam; + CBlkPool adam_bp; + CHeapCtrl adam_hc; + $$=($$+MEM_PAGE_SIZE-1)&-MEM_PAGE_SIZE; +}; + +#help_index "Char" +#define CH_CTRLA 0x01 +#define CH_CTRLB 0x02 +#define CH_CTRLC 0x03 +#define CH_CTRLD 0x04 +#define CH_CTRLE 0x05 +#define CH_CTRLF 0x06 +#define CH_CTRLG 0x07 +#define CH_CTRLH 0x08 +#define CH_CTRLI 0x09 +#define CH_CTRLJ 0x0A +#define CH_CTRLK 0x0B +#define CH_CTRLL 0x0C +#define CH_CTRLM 0x0D +#define CH_CTRLN 0x0E +#define CH_CTRLO 0x0F +#define CH_CTRLP 0x10 +#define CH_CTRLQ 0x11 +#define CH_CTRLR 0x12 +#define CH_CTRLS 0x13 +#define CH_CTRLT 0x14 +#define CH_CTRLU 0x15 +#define CH_CTRLV 0x16 +#define CH_CTRLW 0x17 +#define CH_CTRLX 0x18 +#define CH_CTRLY 0x19 +#define CH_CTRLZ 0x1A +#define CH_CURSOR 0x05 +#define CH_BACKSPACE 0x08 +#define CH_FORM_FEED 0x0C +#define CH_ESC 0x1B +#define CH_SHIFT_ESC 0x1C +#define CH_SHIFT_SPACE 0x1F +#define CH_SPACE 0x20 + +#define ST_ERR_ST "$$LTRED$$$$BK,1$$ERROR:$$FG$$$$BK,0$$ " +#define ST_WARN_ST "$$RED$$$$BK,1$$WARNING:$$FG$$$$BK,0$$ " + +//Scan code flags +#define SCf_E0_PREFIX 7 +#define SCf_KEY_UP 8 +#define SCf_SHIFT 9 +#define SCf_CTRL 10 +#define SCf_ALT 11 +#define SCf_CAPS 12 +#define SCf_NUM 13 +#define SCf_SCROLL 14 +#define SCf_NEW_KEY 15 +#define SCf_IP_L_DOWN 16 +#define SCf_IP_R_DOWN 17 +#define SCf_DELETE 18 +#define SCf_INS 19 +#define SCf_NO_SHIFT 30 +#define SCf_KEY_DESC 31 +#define SCF_E0_PREFIX (1< +#define GSF_WITH_NEW_LINE 2 + +#define "Char/Operations" +//Flags for StrUtil and MStrUtil +#define SUF_REM_CTRL_CHARS 0x001 +#define SUF_REM_LEADING 0x002 +#define SUF_REM_TRAILING 0x004 +#define SUF_REM_SPACES 0x008 +#define SUF_SINGLE_SPACE 0x010 +#define SUF_TO_UPPER 0x020 +#define SUF_TO_LOWER 0x040 +#define SUF_S2T 0x080 +#define SUF_T2S 0x100 // Only works with MStrUtil +#define SUF_SCALE_INDENT 0x200 +#define SUF_SAFE_DOLLAR 0x400 + +//Flags for StrFind +#define SFF_IGNORE_CASE 1 +#define SFF_WHOLE_LABELS_BEFORE 2 +#define SFF_WHOLE_LABELS_AFTER 4 +#define SFG_WHOLE_LABELS (SFF_WHOLE_LABELS_BEFORE|SFF_WHOLE_LABELS_AFTER) + +//Flags for LstMatch +#define LMF_IGNORE_CASE 1 +#define LMF_EXACT 2 + +#help_index "Keyboard Devices/System" +#define KDF_HAS_DESCS 1 +class CKeyDevEntry +{ + CKeyDevEntry *next,*last; + I64 priority,flags; + Bool (*put_key)(I64 ch,I64 sc); + Bool (*put_s)(U8 *st); +}; + +class CKeyDevGlbls +{ + CKeyDevEntry put_key_head; + U0 (**fp_ctrl_alt_cbs)(I64 sc); + I64 ctrl_alt_in_irq_flags, + **ctrl_alt_ret_addr; //addr of ret addr on stack in kbd irq + U8 **ctrl_alt_no_shift_descs,**ctrl_alt_shift_descs, + desc[STR_LEN], + *handler; +}; + +#help_index "Snd" +class CSndData +{ + CSndData *next,*last; + F64 freq, //Hz + time; +}; + +public class CSndGlbls +{ + F64 freq; + CSndData record_head; + Bool record; +}; + +#help_index "Debugging/FunSeg" +#define FUN_SEG_CACHE_SIZE 256 +class CFunSegCache +{ + I64 base,limit; + F64 time_stamp; + U8 str[1]; //FUN_SEG_CACHE_STR_LEN +$$=64; +}; +#define FUN_SEG_CACHE_STR_LEN (sizeof(CFunSegCache)-offset(CFunSegCache.str)) + +#help_index "Debugging" +class CMPCrash +{ + I64 cpu_num; + CTask *task; + I64 rip; + U8 *msg; + I64 msg_num; +}; + +public class CDbgGlbls +{ + CTask *focus_task; + U8 *msg; + I64 msg_num; + CMPCrash *mp_crash; + U8 *int_fault_code, + *fix_file_line; + CFunSegCache *fun_seg_cache; + I64 fun_seg_cache_index; +}; + +#help_index "Boot" +//Boot related +#define BOOT_RAM_BASE 0x07C00 +#define BOOT_RAM_LIMIT 0x97000 +#define BOOT_STK_SIZE BLK_SIZE + +#define BOOT_SRC_NULL 0 +#define BOOT_SRC_ROM 1 +#define BOOT_SRC_RAM 2 +#define BOOT_SRC_HARDDRV 3 +#define BOOT_SRC_DVD 4 + +// $LK,"Auto",A="MN:Auto"$("") StdIn for call to $LK,"BootHDIns",A="MN:BootHDIns"$(). +#define STD_DISTRO_DVD_CFG "Tb\nScale2Mem(2048,0x40000)\nt \n\n\n\n" + +#help_index "Misc/Registry" +//Registry sys_msg_flags. $LK,"RegOneTimePopUp",A="MN:RegOneTimePopUp"$() +#define ARf_FLOODFILL 0 +#define ARf_CSPRITE_INS_CLIPBOARD 1 +#define ARf_PLANAR_SYMMETRY 2 +#define ARf_PSALMODY_JUKEBOX 3 +#define ARf_MESH_ED 4 +#define ARf_CSPRITE_PTS_RECTANGLES 5 +#define ARf_MANAGE_SLIDER 6 + +#help_index "Misc/Progress Bars" +#define NUM_PROGRESS_BARS 4 +#define PROGRESS_DESC_LEN (64-8-8) +class CProgress +{ + I64 val,max; + U8 desc[PROGRESS_DESC_LEN]; +}; + +#help_index "Char/Operations" +#define SPF_PAD_ZERO 0x001 +#define SPF_LEFT_JUSTIFY 0x002 +#define SPF_TRUNCATE 0x004 +#define SPF_COMMA 0x008 +#define SPF_DOLLAR 0x010 +#define SPF_SLASH 0x020 +#define SPF_QUESTION 0x040 +#define SPF_AUX_FMT_NUM 0x080 +#define SPF_DECIMAL 0x100 +#define SPF_NEG 0x200 +#define SPF_NEG_E 0x400 +#define SPF_NEG_AUX_FMT_NUM 0x800 + +#help_index "" diff --git a/Kernel/KernelA.HPP b/Kernel/KernelA.HPP deleted file mode 100644 index 1262b95..0000000 --- a/Kernel/KernelA.HPP +++ /dev/null @@ -1,3932 +0,0 @@ -// Main TempleOS header - -#help_index "" -extern class CAOT; -extern class CAOTHeapGlbl; -extern class CAOTImportExport; -extern class CCPU; -extern class CDC; -extern class CDoc; -extern class CFile; -extern class CHashClass; -extern class CHashFun; -extern class CHeapCtrl; -extern class CIntermediateCode; -extern class CSrvCtrl; -extern class CTask; - -#define NULL 0 -#define TRUE 1 -#define FALSE 0 -#define ON 1 -#define OFF 0 -#define MIN_I8 (-0x80) -#define MAX_I8 0x7F -#define MIN_U8 0 -#define MAX_U8 0xFF -#define MIN_I16 (-0x8000) -#define MAX_I16 0x7FFF -#define MIN_U16 0 -#define MAX_U16 0xFFFF -#define MIN_I32 (-0x80000000) -#define MAX_I32 0x7FFFFFFF -#define MIN_U32 0 -#define MAX_U32 0xFFFFFFFF -#define MIN_I64 (-0x8000000000000000) -#define MAX_I64 0x7FFFFFFFFFFFFFFF -#define MIN_U64 0 -#define MAX_U64 0xFFFFFFFFFFFFFFFF -#define INVALID_PTR MAX_I64 -#define STR_LEN 144 - -//(Int to F64 conversion is signed) -//Turn off 80-bit float constants with $LK,"OPTf_NO_BUILTIN_CONST",A="MN:OPTf_NO_BUILTIN_CONST"$. -#define MAX_U64_F64 (0x43F0000000000000(F64)) -#define MAX_F64 (0x7FEFFFFFFFFFFFFF(F64)) -#define MIN_F64 (0xFFEFFFFFFFFFFFFF(F64)) -#define inf (0x7FF0000000000000(F64)) -#define ì (0x7FF0000000000000(F64)) -#define pi (0x400921FB54442D18(F64)) -#define ã (0x400921FB54442D18(F64)) -#define exp_1 (0x4005BF0A8B145769(F64)) //The number "e" -#define log2_10 (0x400A934F0979A371(F64)) -#define log2_e (0x3FF71547652B82FE(F64)) -#define log10_2 (0x3FD34413509F79FF(F64)) -#define loge_2 (0x3FE62E42FEFA39EF(F64)) -#define sqrt2 (0x3FF6A09E667F3BCD(F64)) -#define eps (0x3CB0000000000000(F64)) - -#help_index "Data Types/Simple" -/*HolyC union structure is treated as a -whole if no member is specified, -similar to bit fields. - -See $LK,"EndianI64",A="MN:EndianI64"$() and $LK,"::/Demo/SubIntAccess.CPP"$. -*/ -U16i union U16 -{ - I8i i8[2]; - U8i u8[2]; -}; - -I16i union I16 -{ - I8i i8[2]; - U8i u8[2]; -}; - -U32i union U32 -{ - I8i i8[4]; - U8i u8[4]; - I16 i16[2]; - U16 u16[2]; -}; - -I32i union I32 -{ - I8i i8[4]; - U8i u8[4]; - I16 i16[2]; - U16 u16[2]; -}; - -U64i union U64 -{ - I8i i8[8]; - U8i u8[8]; - I16 i16[4]; - U16 u16[4]; - I32 i32[2]; - U32 u32[2]; -}; - -I64i union I64 -{ - I8i i8[8]; - U8i u8[8]; - I16 i16[4]; - U16 u16[4]; - I32 i32[2]; - U32 u32[2]; -}; - -#help_index "Math/Complex;Data Types/Complex" -public class Complex -{ - F64 x,y; -}; - -#help_index "Data Types/Circular Queue" -public class CQue -{ - CQue *next,*last; -}; - -#help_index "Graphics/Data Types/D3I32;Math/Data Types/D3I32;Data Types/D3I32" -public class CD3I32 //Three dimensional I32 pt -{ - I32 x,y,z; -}; -public class CQueD3I32 //Que of three dimensional I32 pts -{ - CQueD3I32 *next,*last; - CD3I32 p; -}; -#help_index "Math/Data Types;Data Types" -public class CD2I32 //Two dimensional I32 pt -{ - I32 x,y; -}; -public class CD2I64 //Two dimensional I64 pt -{ - I64 x,y; -}; -public class CD3I64 //Three dimensional I64 pt -{ - I64 x,y,z; -}; -public class CD2 //Two dimensional F64 pt -{ - F64 x,y; -}; - -#help_index "Math/CD3;Data Types/CD3" -public class CD3 //Three dimensional F64 pt -{ - F64 x,y,z; -}; - -#help_index "Data Types/Queue Vector" -#define QUE_VECT_U8_CNT 512 -public class CQueVectU8 -{ - CQueVectU8 *next,*last; - I64 total_cnt,node_cnt,min_idx; - U8 body[QUE_VECT_U8_CNT]; -}; - -#help_index "Data Types/Fifo" -public class CFifoU8 -{ - U8 *buf; - I64 mask,in_ptr,out_ptr; -}; -public class CFifoI64 -{ - I64 *buf; - I64 mask,in_ptr,out_ptr; -}; - -#help_index "Date/CDate" -#define CDATE_YEAR_DAYS 365.24225 -#define CDATE_YEAR_DAYS_INT 36524225 -#define CDATE_BASE_DAY_OF_WEEK 0 -public I64 class CDate -{ - U32 time; - I32 date; -}; - -#help_index "Date;Date/CDate" -public class CDateStruct -{ - U8 sec10000,sec100,sec,min,hour, - day_of_week,day_of_mon,mon; - I32 year; -}; - -#help_index "Math/ODE" -public class COrder2D3 -{ - F64 x,y,z, - DxDt,DyDt,DzDt; -}; - -#define MSF_INACTIVE 1 -#define MSF_FIXED 2 -public class CMass -{ - CMass *next,*last; - COrder2D3 *state, //Point to entries in $LK,"CMathODE",A="MN:CMathODE"$.state[] - *DstateDt; //Point to entries in $LK,"CMathODE",A="MN:CMathODE"$.DstateDt[] - - U0 start; - U32 flags,num; - F64 mass,drag_profile_factor; - U0 saved_state; - F64 x,y,z, - DxDt,DyDt,DzDt; - U0 end; -}; - -#define SSF_INACTIVE 1 -#define SSF_NO_COMPRESSION 2 -#define SSF_NO_TENSION 4 -public class CSpring -{ - CSpring *next,*last; - CMass *end1,*end2; - F64 f,displacement; //set for you to check - - U0 start; - U32 flags,num, - end1_num,end2_num; - F64 const,rest_len; - U0 end; -}; - -//Ordinary Differential Equations -#define ODEF_HAS_MASSES 1 -#define ODEF_PAUSED 2 -#define ODEF_STARTED 4 - -public class CMathODE -{ - CMathODE *next,*last; - I64 flags,n,n_internal; - CMass *next_mass,*last_mass; - CSpring *next_spring,*last_spring; - F64 drag_v, //drag proportional to velocity - drag_v2, //drag proportional to velocity squared - drag_v3, //drag proportional to velocity cubed - acceleration_limit, //This clips acceleration - base_t, - t,t_scale, - h,h_min,h_max; - - //This is not precise, just a ballpark. - //TempleOS CMathODE's are for video games - //not science. It bails if it takes - //too long. - F64 min_tolerance,max_tolerance; - - F64 tolerance_internal, - *array_base, - *state, - *state_internal, - *DstateDt, - *state_scale, - *initial_state, - *temp0,*temp1,*temp2,*temp3, - *temp4,*temp5,*temp6,*temp7; - CTask *mem_task,*win_task; - U0 (*derivative)(CMathODE *o,F64 t,F64 *state,F64 *DstateDt); - I64 user_data; -}; - -#help_index "Processor" -//IDT entry types -#define IDTET_TASK 0x05 -#define IDTET_IRQ 0x0E -#define IDTET_TRAP 0x0F //Same as IRQ but doesnt do CLI. - -//Interrupts -//0x00-0x1F are reserved by Intel -#define I_DIV_ZERO 0x00 -#define I_SINGLE_STEP 0x01 -#define I_NMI 0x02 -#define I_BPT 0x03 -#define I_PAGE_FAULT 0x0E -//0x20-0x2F are used for hardware -#define I_TIMER 0x20 -//Software Interrupts -#define I_MP_CRASH 0x30 -#define I_WAKE 0x31 -#define I_DBG 0x32 -//See $LK,"ST_INT_NAMES",A="MN:ST_INT_NAMES"$ - -//You might want to start bwd from -//0xFF for your own interrupts. -#define I_USER 0x40 - -#define MP_MAX_PROCESSORS 128 - -#define SYS_START_CR0 0x0031 - -#define RFLAGf_CARRY 0 -#define RFLAGf_PARITY 2 -#define RFLAGf_AUX_CARRY 4 -#define RFLAGf_ZERO 6 -#define RFLAGf_SIGN 7 -#define RFLAGf_TRAP 8 //Single Step -#define RFLAGf_INT 9 -#define RFLAGf_DIR 10 -#define RFLAGf_OVERFLOW 11 -#define RFLAGf_IOPL0 12 // I/O Privilege Level -#define RFLAGf_IOPL1 13 -#define RFLAGf_NESTED_TASK 14 -#define RFLAGf_RESUME 16 -#define RFLAGf_V8086 17 -#define RFLAGf_ALIGN_CHECK 18 -#define RFLAGf_VINT 19 //Virtual Interrupt -#define RFLAGf_VINT_PENDING 20 -#define RFLAGf_ID 21 - -#define RFLAGG_START 0x0000 -#define RFLAGG_NORMAL (1< (Exit and Save) -#define DOCEF_QUIT 0x4000000000 //Send (Abort) -#define DOCEF_FROM_START 0x8000000000 -#define DOCEF_HAS_BORDER 0x10000000000 -#define DOCEF_SOLID_BORDER 0x20000000000 -#define DOCEF_BORDER_PLOT 0x40000000000 -#define DOCEF_CHECKED_COLLAPSED 0x80000000000 //Checked or Collapsed -#define DOCEF_CHECK_COLLAPSABLE 0x100000000000 -#define DOCEF_REFRESH_DATA 0x200000000000 -#define DOCEF_UPDATE_DATA 0x400000000000 -//$LK,"DOCEF_DEREF_DATA",A="MN:DOCEF_DEREF_DATA"$ is confusing. $LK,"DocForm",A="MN:DocForm"$() makes doc_e->data point to members -//of class. For ints, it derefs doc_e->data as a ptr. For strings, it doesn't. -#define DOCEF_DEREF_DATA 0x800000000000 -#define DOCEF_REMALLOC_DATA 0x1000000000000 -#define DOCEF_HAS_TERMINATOR 0x2000000000000 -#define DOCEF_ZERO_BASED 0x4000000000000 -#define DOCEF_HOLD 0x8000000000000 -#define DOCEF_TREE 0x10000000000000 -#define DOCEF_LST 0x20000000000000 -#define DOCEF_SKIP 0x40000000000000 -#define DOCEF_POPUP 0x80000000000000 -#define DOCEF_SKIP_IN_FORM 0x100000000000000 -#define DOCEF_FILTER_SKIP 0x200000000000000 -#define DOCEF_NO_CLICK_ON 0x400000000000000 -#define DOCEF_DONT_DRAW 0x800000000000000 //only works on sprites -#define DOCEF_DFT_LEN 0x1000000000000000 -#define DOCEF_DFT_RAW_TYPE 0x2000000000000000 - -#define DOCEG_HAS_ALLOC (DOCEF_TAG|DOCEF_AUX_STR|DOCEF_DEFINE|\ - DOCEF_HTML_LINK|DOCEF_LEFT_MACRO|DOCEF_RIGHT_MACRO|DOCEF_BIN_PTR_LINK|\ - DOCEF_REMALLOC_DATA) - -#define DOCEG_HAS_ARG ((DOCEG_HAS_ALLOC&~DOCEF_REMALLOC_DATA)|\ - DOCEF_LEN|DOCEF_LEFT_EXP|DOCEF_RIGHT_EXP|DOCEF_HAS_BIN|DOCEF_RAW_TYPE|\ - DOCEF_SHIFTED_X|DOCEF_SHIFTED_Y|DOCEF_SCROLLING_X|DOCEF_USER_DATA) - -#define DOCEG_DONT_EDIT (DOCEF_DEFINE|DOCEF_HTML_LINK|\ - DOCEF_AUX_STR|DOCEF_BIN_PTR_LINK|DOCEF_SCROLLING_X|DOCEF_TAG_CB) - -//These are ident to Doc flags -#define DOCEF_HIGHLIGHT 0x4000000 -#define DOCEF_WORD_WRAP 0x8000000 -#define DOCEF_BLINK ATTRF_BLINK -#define DOCEF_INVERT ATTRF_INVERT -#define DOCEF_SEL ATTRF_SEL -#define DOCEF_UNDERLINE ATTRF_UNDERLINE -#define DOCEf_HIGHLIGHT 26 -#define DOCEf_WORD_WRAP 27 -#define DOCEf_BLINK ATTRf_BLINK -#define DOCEf_INVERT ATTRf_INVERT -#define DOCEf_SEL ATTRf_SEL -#define DOCEf_UNDERLINE ATTRf_UNDERLINE - -//CDocEntry.de_flags. These first 16 are arg= -#define DOCEf_TAG 0 -#define DOCEf_LEN 1 -#define DOCEf_AUX_STR 2 -#define DOCEf_DEFINE 3 -#define DOCEf_HTML_LINK 4 -#define DOCEf_LEFT_EXP 5 -#define DOCEf_LEFT_MACRO 6 -#define DOCEf_RIGHT_EXP 7 -#define DOCEf_RIGHT_MACRO 8 -#define DOCEf_HAS_BIN 9 -#define DOCEf_BIN_PTR_LINK 10 -#define DOCEf_RAW_TYPE 11 -#define DOCEf_SHIFTED_X 12 -#define DOCEf_SHIFTED_Y 13 -#define DOCEf_SCROLLING_X 14 -#define DOCEf_USER_DATA 15 - -//CDocEntry.de_flags. These are +/- flags -#define DOCEf_LEFT_CB 16 -#define DOCEf_LEFT_AUTO 17 -#define DOCEf_RIGHT_CB 18 -#define DOCEf_RIGHT_AUTO 19 -#define DOCEf_LEFT_X 20 -#define DOCEf_CENTER_X 21 -#define DOCEf_RIGHT_X 22 -#define DOCEf_TOP_Y 23 -#define DOCEf_CENTER_Y 24 -#define DOCEf_BOTTOM_Y 25 -//HL...UL -#define DOCEf_TAG_CB 32 -#define DOCEf_PAGE_REL_Y 33 -#define DOCEf_MARGIN_REL_X 34 -#define DOCEf_WIN_REL 35 -#define DOCEf_LINK 36 -#define DOCEf_ESC 37 //Send (Exit and Save) -#define DOCEf_QUIT 38 //Send (Abort) -#define DOCEf_FROM_START 39 -#define DOCEf_HAS_BORDER 40 -#define DOCEf_SOLID_BORDER 41 -#define DOCEf_BORDER_PLOT 42 -#define DOCEf_CHECKED_COLLAPSED 43 //Checked or Collapsed -#define DOCEf_CHECK_COLLAPSABLE 44 -#define DOCEf_REFRESH_DATA 45 -#define DOCEf_UPDATE_DATA 46 -#define DOCEf_DEREF_DATA 47 -#define DOCEf_REMALLOC_DATA 48 -#define DOCEf_HAS_TERMINATOR 49 -#define DOCEf_ZERO_BASED 50 -#define DOCEf_HOLD 51 -#define DOCEf_TREE 52 -#define DOCEf_LST 53 -#define DOCEf_SKIP 54 -#define DOCEf_POPUP 55 -#define DOCEf_SKIP_IN_FORM 56 -#define DOCEf_FILTER_SKIP 57 -#define DOCEf_NO_CLICK_ON 58 -#define DOCEf_DONT_DRAW 59 //only works on sprites -#define DOCEf_DFT_LEN 60 -#define DOCEf_DFT_RAW_TYPE 61 -#define DOCEf_NUM_FLAGS 62 - -public class CDocBin -{ - CDocBin *next,*last; - I32 temp_use_cnt,renum_num; - U8 *tag; - U0 start; - U32 num,flags,size,use_cnt; - U0 end; - U8 *data; - U0 pad;#assert !($$&7) //(compiler lags one token) -}; - -#define DOC_SCROLL_SPEED 8 - -#define DOCSS_NORMAL 0 -#define DOCSS_SINGLE_QUOTE 1 -#define DOCSS_DBL_QUOTE 2 -#define DOCSS_COMMENT 3 -#define DOCSS_CPP_Z_COMMENT 4 - -#define DOC_ATTR_DFT_TEXT WHITE<<4+BLACK -#define DOC_COLOR_ALT_TEXT LTGRAY -#define DOC_COLOR_LINK RED -#define DOC_COLOR_MACRO LTBLUE -#define DOC_COLOR_ANCHOR DKGRAY -#define DOC_COLOR_TREE PURPLE -#define DOC_COLOR_PMT GREEN -#define DOC_COLOR_BIN CYAN -#define DOC_COLOR_KEYWORD BLUE -#define DOC_COLOR_KEYWORD2 LTRED -#define DOC_COLOR_COMMENT GREEN -#define DOC_COLOR_QUOTE BROWN - -public class CDocSettings -{ - U32 final_u32_attr; - I16 left_margin,right_margin,indent; - U16 page_len,header,footer; - I8 shifted_x,shifted_y; - U8 state,comment_depth,paren_depth,brace_depth, - cur_text_attr,dft_text_attr; -}; - -#define DOC_DFT MIN_I32 - -public class CDocEntryBase -{ -//This is a shortened structure for - //cmds like the text cmd which - //don't require the full CDocEntry structure. - CDocEntryBase *next,*last; - U8 *tag; - union { - U8 type_u8; //this stores the code - U32 type; //these store attr flags - }; - I32 page_line_num; - I64 de_flags; - I32 x,y; - U32 min_col,max_col; - CDocSettings settings; - I64 user_data; - U0 pad;#assert !($$&7) //(compiler lags one token) -}; - -#define DOCE_LEN_DFT 64 - -public class CDocEntry:CDocEntryBase -{ - union { - I64 attr; - I64 cursor_x_offset; - I64 (*left_cb)(CDoc *doc,CDocEntry *doc_e); - I64 left_exp; - }; - U8 *left_macro; - - union { - I64 cursor_y_offset; - I64 (*right_cb)(CDoc *doc,CDocEntry *doc_e); - I64 right_exp; - }; - U8 *right_macro; - - U8 *(*tag_cb)(CDoc *doc,CDocEntry *doc_e,CTask *mem_task); - U8 *define_str, - *aux_str, - *bin_ptr_link, - *html_link, - *my_fmt_data; - I64 hex_ed_width; - I32 scroll_len, - len, //$LK,"DOCE_LEN_DFT",A="MN:DOCE_LEN_DFT"$ - bin_num; - U8 raw_type,pad[3]; - CDocBin *bin_data; - U8 *data; - U0 pad;#assert !($$&7) //(compiler lags one token) -}; - -//$LK,"DocForm",A="MN:DocForm"$() $LK,"DocMenu",A="MN:DocMenu"$() $LK,"DocEd",A="MN:DocEd"$() $LK,"PopUpMenu",A="MN:PopUpMenu"$() -#define DOF_MIN_SIZE 0x01 -#define DOF_INTERCEPT_TASK_END 0x02 -#define DOF_DONT_HOME 0x04 -#define DOF_WIN_MAX 0x08 -#define DOF_DONT_TEXT_ATTR 0x10 -#define DOF_DONT_WINMGR_SYNC 0x20 -#define DOF_DONT_SHOW 0x40 -//Combines with $LK,"Editor Flags",A="MN:EDF_BAIL"$ - -class CEdFindText -{ - U8 find_text[STR_LEN] fmtstr "$$DA-P," - "A=\"Find :%s\"$$\n", - replace_text[STR_LEN] fmtstr "$$DA-P," - "A=\"Replace :%s\"$$\n"; - Bool replace fmtstr "$$CB,\"Replace\"$$\n", - scan_fwd fmtstr "$$CB,\"Fwd\"$$\n", - scan_sel_text fmtstr "$$CB,\"Sellection\"$$\n", - match_case fmtstr "$$CB,\"Match Case\"$$\n", - whole_labels fmtstr "$$CB,\"Whole Labels\"$$\n", - local_var fmtstr "$$CB,\"Rename Local Var\"$$\n", - pmt,pad; - I64 filter_lines fmtstr "$$DA,A=\"Filter Lines:%d\"$$\n"; -}; - -class CEdFileName -{ - U8 name[256] fmtstr "$$DA-P,LEN=255,A=\"FileName:%s\"$$"; -}; - -//$LK,"Ed",A="MN:Ed"$() -#define EDF_BAIL 0x100 -#define EDF_COLLAPSE 0x200 -#define EDF_UNCOLLAPSE 0x400 -#define EDF_WAS_WRITE 0x800 //Was exit ESC or SHIFT_ESC? -//Combines with $LK,"Document Flags",A="MN:DOF_MIN_SIZE"$ - -#define EDf_BAIL 8 -#define EDf_COLLAPSE 9 -#define EDf_UNCOLLAPSE 10 -#define EDf_WAS_WRITE 11 - -// DOC header flags -#define DOCF_PLAIN_TEXT 0x1 -#define DOCF_PLAIN_TEXT_TABS 0x2 //has '\t', not DOCT_TAB -#define DOCF_NO_CURSOR 0x4 -#define DOCF_CARRIAGE_RETURN 0x8 -#define DOCF_DBL_DOLLARS 0x10 -#define DOCF_COLOR_NAMES 0x20 -//Reserved x2 -#define DOCF_BORDER_DOC 0x100 -#define DOCF_FORM 0x200 -#define DOCF_MIN_SIZE 0x400 -#define DOCF_HIDE_CURSOR 0x800 //use $LK,"DocCursor",A="MN:DocCursor"$ -#define DOCF_DONT_HIGHLIGHT_CURSOR 0x1000 //use $LK,"DocHighlightCursor",A="MN:DocHighlightCursor"$ -#define DOCF_NO_SCROLL_BARS 0x2000 //use $LK,"DocScroll",A="MN:DocScroll"$ -#define DOCF_ALLOW_UNDO 0x4000 -#define DOCF_DONT_SHOW 0x8000 -#define DOCF_HAS_SONG 0x10000 -#define DOCF_MORE 0x20000 -#define DOCF_BWD_MOVEMENT 0x40000 -#define DOCF_NULL_GRAB_SCROLL 0x80000 -#define DOCF_DONT_SWAP_OUT 0x100000 -#define DOCF_DO_FULL_REFRESH 0x200000 -#define DOCF_BREAK_UNLOCKED 0x400000 -//Reserved x1 -#define DOCF_HIGHLIGHT DOCEF_HIGHLIGHT -#define DOCF_WORD_WRAP DOCEF_WORD_WRAP -#define DOCF_BLINK DOCEF_BLINK -#define DOCF_INVERT DOCEF_INVERT -#define DOCF_SEL DOCEF_SEL -#define DOCF_UNDERLINE DOCEF_UNDERLINE - -#define DOCF_OVERSTRIKE 0x100000000 -#define DOCF_IN_DOLLAR 0x200000000 -#define DOCF_SUPERSCRIPT_MODE 0x400000000 -#define DOCF_SUBSCRIPT_MODE 0x800000000 -#define DOCF_UNDO_DIRTY 0x1000000000 - -#define DOCf_PLAIN_TEXT 0 -#define DOCf_PLAIN_TEXT_TABS 1 //has '\t', not DOCT_TAB -#define DOCf_NO_CURSOR 2 -#define DOCf_CARRIAGE_RETURN 3 -#define DOCf_DBL_DOLLARS 4 -#define DOCf_COLOR_NAMES 5 -//Reserved x2 -#define DOCf_BORDER_DOC 8 -#define DOCf_FORM 9 -#define DOCf_MIN_SIZE 10 -#define DOCf_HIDE_CURSOR 11 //use $LK,"DocCursor",A="MN:DocCursor"$ -#define DOCf_DONT_HIGHLIGHT_CURSOR 12 //use $LK,"DocHighlightCursor",A="MN:DocHighlightCursor"$ -#define DOCf_NO_SCROLL_BARS 13 //use $LK,"DocScroll",A="MN:DocScroll"$ -#define DOCf_ALLOW_UNDO 14 -#define DOCf_DONT_SHOW 15 -#define DOCf_HAS_SONG 16 -#define DOCf_MORE 17 -#define DOCf_BWD_MOVEMENT 18 -#define DOCf_NULL_GRAB_SCROLL 19 -#define DOCf_DONT_SWAP_OUT 20 -#define DOCf_DO_FULL_REFRESH 21 -#define DOCf_BREAK_UNLOCKED 22 -//Reserved x1 - -#define DOCf_HIGHLIGHT DOCEf_HIGHLIGHT -#define DOCf_WORD_WRAP DOCEf_WORD_WRAP -#define DOCf_BLINK DOCEf_BLINK -#define DOCf_INVERT DOCEf_INVERT -#define DOCf_SEL DOCEf_SEL -#define DOCf_UNDERLINE DOCEf_UNDERLINE - -#define DOCf_OVERSTRIKE 32 -#define DOCf_IN_DOLLAR 33 -#define DOCf_SUPERSCRIPT_MODE 34 -#define DOCf_SUBSCRIPT_MODE 35 -#define DOCf_UNDO_DIRTY 36 - -//locked flags -#define DOClf_LOCKED 0 -class CDocUndo -{ - CDocUndo *next,*last; - I64 size,doc_flags,time_stamp; - U8 *body; -}; - -//See $LK,"DocMenu",A="MN:DocMenu"$() -#define DOCM_CANCEL (-1) - -#define DOC_SIGNATURE_VAL 'DocS' - -#define RECALCt_NORMAL 0x00 -#define RECALCt_FIND_CURSOR 0x01 -#define RECALCt_TO_SCREEN 0x02 -#define RECALCG_MASK 0xFF - -#define RECALCF_HAS_CURSOR 0x100 -#define RECALCF_ADD_CURSOR 0x200 -#define RECALCF_TO_HTML 0x400 - -public class CDoc //Linked Text File header -{//See $LK,"Doc",A="HI:Doc"$ for documentation. - CDocEntryBase head; - I64 flags,locked_flags; - CDocEntry *cur_entry,*old_cur_entry; - I32 cur_col,old_cur_col, - line_start_col,top_line_num, - dollar_buf_size,dollar_buf_ptr; - U8 *dollar_buf; //When entering $$ cmds, it buffers them until the end $$. - - CTask *win_task,*mem_task,*owning_task; - I32 page_line_num,undo_cnt, - x,y,min_x,max_x,min_y,max_y; - I64 line,col,best_d, - old_win_top,old_win_bottom, - old_win_left,old_win_right, - cmd_U8; - U32 doc_signature,cur_bin_num; - I64 max_entries, - updates_cnt; - CEdFindText *find_replace; - - U8 *cur_sprite;//Set cur_sprite use (ip.pos.x,ip.pos.y) as input. -//Output is nearest. See $LK,"*_cur_elem_num=",A="FF:::/Adam/Gr/SpriteEd.CPP,*_cur_elem_num=doc->"$ and $LK,"::/Demo/Graphics/Pick.CPP"$. - I64 nearest_sprite_elem_num; - - CEdFileName filename; - I64 file_attr; - I64 (*left_click_link)(CDoc *doc,CDocEntry *doc_e); - I64 (*right_click_link)(CDoc *doc,CDocEntry *doc_e); - - //See $LK,"::/Apps/Psalmody/JukeBox.CPP"$ - U8 *user_put_data; //Passed to user_put_key() and user_put_s() - Bool (*user_put_key)(CDoc *doc,U8 *data,I64 ch,I64 sc); - Bool (*user_put_s)(CDoc *doc,U8 *data,U8 *st); - - CDoc *parent_doc; //(When browsing deeper, opening deeper docs.) - U64 desc; //8 characters. See $LK,"DocBorderLstDraw",A="MN:DocBorderLstDraw"$(). - - CDocBin bin_head; - CDocSettings settings_head; - CDocUndo undo_head; - - I64 user_data; - U0 pad;#assert !($$&7) //(compiler lags one token) -}; - -#help_index "Windows" -/* -Fs->win_inhibit mask - -Some inhibit actions on the task itself. -Some inhibit actions if the focus task -tries to do something. -*/ -#define WIF_SELF_FOCUS 0x0001 //If active this task cannot have focus - //MENU 0x0002 -#define WIF_SELF_CTRLS 0x0004 -#define WIF_SELF_IP_L 0x0008 - //IP_L_D 0x0010 -#define WIF_SELF_IP_R 0x0020 - //IP_R_D 0x0040 -#define WIF_SELF_IP_WHEEL 0x0080 //Does nothing, yet -#define WIF_SELF_BORDER 0x0100 -#define WIF_SELF_GRAB_SCROLL 0x0200 -#define WIF_SELF_DOC 0x0400 -#define WIF_SELF_ODE 0x0800 -#define WIF_SELF_KEY_DESC 0x1000 - //FOCUS 0x00010000 -#define WIF_FOCUS_TASK_MENU 0x00020000 -#define WIF_FOCUS_TASK_CTRLS 0x00040000 -#define WIF_FOCUS_TASK_IP_L 0x00080000 -#define WIF_FOCUS_TASK_IP_L_D 0x00100000 -#define WIF_FOCUS_TASK_IP_R 0x00200000 -#define WIF_FOCUS_TASK_IP_R_D 0x00400000 -#define WIF_FOCUS_TASK_IP_WHEEL 0x00800000 //Does nothing, yet -#define WIF_FOCUS_TASK_BORDER 0x01000000 -#define WIF_FOCUS_TASK_GRAB_SCROLL 0x02000000 - -#define WIG_DBL_CLICK (WIF_FOCUS_TASK_IP_L_D|WIF_FOCUS_TASK_IP_R_D) -#define WIG_TASK_DFT (WIF_FOCUS_TASK_MENU|WIG_DBL_CLICK|\ - 0xFFFF-WIF_SELF_DOC-WIF_SELF_ODE) -#define WIG_USER_TASK_DFT WIF_SELF_KEY_DESC - -#define WIf_SELF_FOCUS 0 -#define WIf_SELF_CTRLS 2 -#define WIf_SELF_IP_L 3 -#define WIf_SELF_IP_R 5 -#define WIf_SELF_IP_WHEEL 7 -#define WIf_SELF_BORDER 8 -#define WIf_SELF_GRAB_SCROLL 9 -#define WIf_SELF_DOC 10 -#define WIf_SELF_ODE 11 -#define WIf_SELF_KEY_DESC 12 -#define WIf_FOCUS_TASK_MENU 17 -#define WIf_FOCUS_TASK_CTRLS 18 -#define WIf_FOCUS_TASK_IP_L 19 -#define WIf_FOCUS_TASK_IP_L_D 20 -#define WIf_FOCUS_TASK_IP_R 21 -#define WIf_FOCUS_TASK_IP_R_D 22 -#define WIf_FOCUS_TASK_IP_WHEEL 23 -#define WIf_FOCUS_TASK_BORDER 24 -#define WIf_FOCUS_TASK_GRAB_SCROLL 25 - -class CWinMgrTimingGlbls -{ - I64 last_total_jiffies, - last_idle_pt_hits[MP_MAX_PROCESSORS], - last_swap_cnter[MP_MAX_PROCESSORS]; - F64 last_calc_idle_time,calc_idle_delta_time; - I64 calc_idle_cnt; -}; - -#define WINMGR_FPS 30 - -public class CWinMgrGlbls -{ - I64 updates; - F64 ode_time, - last_ode_time, - fps, //You can read but not write this. You have no control. - last_refresh_tS; - CTask *old_focus_task; - CWinMgrTimingGlbls *t; - Bool show_menu, - grab_scroll, - grab_scroll_closed; -}; - -#help_index "AutoComplete" -#define ACf_INIT_IN_PROGRESS 0 -#define AC_MAX_FILLINS 10 -public class CAutoCompleteGlbls -{ - I64 num_words; - CHashTable *hash_table; - U8 *cur_word; - I64 flags; - CTask *task; - I64 partial_len,num_fillins, - fillin_hits [AC_MAX_FILLINS+1]; - CHashAC *fillin_matches[AC_MAX_FILLINS+1]; -}; - -#help_index "AutoComplete/Dictionary" -#define ACD_WORD_FILENAME "/Adam/AutoComplete/ACWords.DAT.Z" -#define ACD_DEF_FILENAME "/Adam/AutoComplete/ACDefs.DAT" -#define ACD_DEF_FILENAME_Z "/Adam/AutoComplete/ACDefs.DAT.Z" - -#define ACD_H1 0 -#define ACD_H1_END 1 -#define ACD_DEF 2 -#define ACD_DEF_END 3 -#define ACD_PRONUNCIATION 4 -#define ACD_PRONUNCIATION_END 5 -#define ACD_POS 6 -#define ACD_POS_END 7 -#define ACD_EXTRA 8 -#define ACD_EXTRA_END 9 -#define ACD_BLK_SIZE 0x4000 - -#define ACD_END_CHAR 0x00 -#define ACD_WORD_CHAR 0x01 -#define ACD_DEF_CHAR 0x02 -#define ACD_PRONUNCIATION_CHAR 0x03 -#define ACD_POS_CHAR 0x04 -#define ACD_EXTRA_CHAR 0x05 - -#define ACD_MAX_FILLINS 10 -public class CAutoCompleteDictGlbls -{ - U8 *word_lst; - I64 word_lst_size,num_words,num_fillins; - U8 *fillins[ACD_MAX_FILLINS]; - Bool has_words,has_defs; -}; - -#help_index "Compiler/Directive" -//Compiler $LK,"Option",A="MN:Option"$()s -//You might need to do #exe {Option();} -//Note: The #exe stmt is lexed-ahead, -//so it takes effect earlier than you might expect. -#define OPTf_ECHO 0x00 -#define OPTf_TRACE 0x01 -#define OPTf_WARN_UNUSED_VAR 0x10 //Applied to funs, not stmts -#define OPTf_WARN_PAREN 0x11 //Warn unnecessary parens -#define OPTf_WARN_DUP_TYPES 0x12 //Warn dup local var type stmts -#define OPTf_EXTERNS_TO_IMPORTS 0x20 -#define OPTf_KEEP_PRIVATE 0x21 -#define OPTf_NO_REG_VAR 0x22 //Applied to funs, not stmts -#define OPTf_GLBLS_ON_DATA_HEAP 0x23 -//Disable 10-byte float consts for ã,log2_10,log10_2,loge_2 -#define OPTf_NO_BUILTIN_CONST 0x24 //Applied to funs, not stmts -#define OPTf_USE_IMM64 0x25 //Not completely implemented - -#define OPTF_ECHO (1<last_cc->lex_include_stk->line_num);} -#define __CMD_LINE__ #exe{StreamPrint("%d",Fs->last_cc->flags&CCF_CMD_LINE &&\ - Fs->last_cc->lex_include_stk->depth<2);} -#define __FILE__ #exe{StreamPrint("\"%s\"",\ - Fs->last_cc->lex_include_stk->full_name);} -#define __DIR__ #exe{StreamDir;} - -#define LFSF_DOC 1 -#define LFSF_DEFINE 2 -class CLexFile -{ - CLexFile *next; - U8 *buf, - *buf_ptr; - I64 line_num,flags; - U8 *full_name, - *line_start; - CDoc *doc; - CDocEntry *cur_entry; - I32 depth; - U8 last_U16,pad[3]; -}; - -class CAOTCtrl -{ - I64 ip; //Inst ptr - CAsmArg arg1,arg2; - CAOTBinBlk *bin; - I64 num_bin_U8s, - max_align_bits,module_org; - CAsmUnresolvedRef *local_unresolved,*glbl_unresolved; - CAOTAbsAddr *abss; - CAOTHeapGlbl *heap_glbls; - I64 lst_col,lst_last_ip; - U8 *last_label,*lst_last_line; - CLexFile *lst_last_lfn; - I64 seg_size; - Bool lst; -}; - -//Tokens -#define TK_EOF 0 -#define TK_SUPERSCRIPT 0x001 -#define TK_SUBSCRIPT 0x002 -#define TK_NORMALSCRIPT 0x003 -#define TK_IDENT 0x100 -#define TK_STR 0x101 -#define TK_I64 0x102 -#define TK_CHAR_CONST 0x103 -#define TK_F64 0x104 -#define TK_PLUS_PLUS 0x105 -#define TK_MINUS_MINUS 0x106 -#define TK_DEREFERENCE 0x107 -#define TK_DBL_COLON 0x108 -#define TK_SHL 0x109 -#define TK_SHR 0x10A -#define TK_EQU_EQU 0x10B -#define TK_NOT_EQU 0x10C -#define TK_LESS_EQU 0x10D -#define TK_GREATER_EQU 0x10E -#define TK_AND_AND 0x10F -#define TK_OR_OR 0x110 -#define TK_XOR_XOR 0x111 -#define TK_SHL_EQU 0x112 -#define TK_SHR_EQU 0x113 -#define TK_MUL_EQU 0x114 -#define TK_DIV_EQU 0x115 -#define TK_AND_EQU 0x116 -#define TK_OR_EQU 0x117 -#define TK_XOR_EQU 0x118 -#define TK_ADD_EQU 0x119 -#define TK_SUB_EQU 0x11A -#define TK_IF 0x11B -#define TK_IFDEF 0x11C -#define TK_IFNDEF 0x11D -#define TK_IFAOT 0x11E -#define TK_IFJIT 0x11F -#define TK_ENDIF 0x120 -#define TK_ELSE 0x121 -#define TK_MOD_EQU 0x122 -#define TK_DOT_DOT 0x123 -#define TK_DOT_DOT_DOT 0x124 -#define TK_INS_BIN 0x125 -#define TK_INS_BIN_SIZE 0x126 -#define TK_NUM_TK 0x127 - -class CLexHashTableContext -{ - CLexHashTableContext *next; - I64 old_flags,hash_mask; - CHashFun *local_var_lst, - *fun; - CHashTable *hash_table_lst, - *define_hash_table, - *local_hash_table, - *glbl_hash_table; -}; - -//CmpCtrl flags -#define CCF_CMD_LINE 0x001 -#define CCF_PMT 0x002 -#define CCf_PMT 1 -#define CCF_QUESTION_HELP 0x004 -#define CCF_DONT_FREE_BUF 0x008 -#define CCF_NO_DEFINES 0x010 -#define CCF_IN_IF 0x020 -#define CCF_JUST_LOAD 0x040 -#define CCF_KEEP_NEW_LINES 0x080 -#define CCF_KEEP_DOT 0x100 -#define CCF_KEEP_NUM_SIGN 0x200 -#define CCF_KEEP_AT_SIGN 0x400 -#define CCf_PASS_TRACE_PRESENT 11 -#define CCF_NOT_CONST 0x0000010000 -#define CCF_NO_REG_OPT 0x0000020000 -#define CCF_IN_QUOTES 0x0000040000 -#define CCF_EXE_BLK 0x0000080000 -#define CCF_HAS_MISC_DATA 0x0000100000 -#define CCF_HAS_RETURN 0x0000200000 -#define CCF_ASM_EXPRESSIONS 0x0000400000 -#define CCF_UNRESOLVED 0x0000800000 -#define CCF_LOCAL 0x0001000000 -#define CCF_FUN_EXP 0x0002000000 -#define CCf_FUN_EXP 25 -#define CCF_POSTINC 0x0004000000 -#define CCF_POSTDEC 0x0008000000 -#define CCF_PREINC 0x0010000000 -#define CCF_PREDEC 0x0020000000 -#define CCF_ARRAY 0x0040000000 -#define CCF_RAX 0x0080000000 -#define CCF_USE_LAST_U16 0x0100000000 -#define CCf_USE_LAST_U16 32 -#define CCF_LAST_WAS_DOT 0x0200000000 -#define CCF_AOT_COMPILE 0x0400000000 -#define CCf_AOT_COMPILE 34 -#define CCF_NO_ABSS 0x0800000000 -#define CCF_PAREN 0x1000000000 -#define CCf_PAREN 36 -#define CCF_CLASS_IP 0x2000000000 -#define CCF_DONT_MAKE_RES 0x4000000000 - -public class CCmpCtrl -{ - CCmpCtrl *next,*last; - I64 token, - flags, - cur_i64; - F64 cur_f64; - U8 *cur_str; - I64 cur_str_len, - class_ip; - U8 *dollar_buf; - I64 dollar_cnt; - U8 *cur_help_idx; - I64 last_U16, - min_line,max_line,last_line_num, - lock_cnt; - U32 *chars_bmp_alpha_numeric; - CLexHashTableContext htc; - CHashGeneric *hash_entry; - CAbsCntsI64 abs_cnts; - CAsmUndefHash *asm_undef_hash; - CMemberLst *local_var_entry; - CCodeMisc *lb_leave; - U8 *cur_buf_ptr; - CLexFile *lex_include_stk, - *lex_prs_stk, - *fun_lex_file; - CStreamBlk *next_stream_blk,*last_stream_blk; - CAOT *aot; - - I64 pass,opts,pass_trace,saved_pass_trace, - error_cnt,warning_cnt; - - //For intermediate codes with multiple float ops (int<->float conversions) - I64 cur_ic_float_op_num,last_ic_float_op_num; - CIntermediateCode *last_float_op_ic; - Bool last_dont_pushable,last_dont_popable,last_float_op_pos, - dont_push_float,pad[4]; - - CCodeCtrl coc; - CPrsStk *ps; - CAOTCtrl *aotc; - I64 aot_depth,pmt_line; - U0 pad;#assert !($$&7) //(compiler lags one token) -}; - -#help_index "Compiler" -public class CCmpGlbls -{ - CHashTable *asm_hash; - CHashClass *internal_types[RT_NUM_IT]; - CIntermediateCode ic_nop; - U32 *dual_U16_tokens1,*dual_U16_tokens2,*dual_U16_tokens3, - *binary_ops; - I64 num_reg_vars,num_non_ptr_vars, - stk_temps_mask,reg_vars_mask,non_ptr_vars_mask; - U8 *to_reg_vars_map,*non_ptr_vars_map; - I64 size_arg_mask[9], - compiled_lines; -}; - -#help_index "Debugging/Unassemble" -class CUAsmGlbls -{ - CInst **table_16_32,**table_64; - I64 table_16_32_entries, - table_64_entries, - ins64_arg_mask, - signed_arg_mask, - mem_arg_mask; -}; - -#help_index "Devices;PCI" -class CPCIDev -{ - CPCIDev *next,*last; - U16 vendor,dev_id; - U8 bus,dev,fun,pad, - sub_code,base_code,pad[6], - *vendor_str,*dev_id_str; -}; - -#help_index "Devices;File/System;PCI" -public class CATARep -{ - CATARep *next; - I64 num,type,base0,base1,unit,irq; -}; - -//See $LK,"::/Doc/Credits.TXT"$. -#define ATA_NOP 0x00 -#define ATA_DEV_RST 0x08 -#define ATA_PACKET 0xA0 -#define ATA_READ_NATIVE_MAX 0xF8 -#define ATA_READ_NATIVE_MAX_EXT 0x27 -#define ATA_SET_MAX 0xF9 -#define ATA_SET_MAX_EXT 0x37 -#define ATA_READ_MULTI 0xC4 -#define ATA_READ_MULTI_EXT 0x29 -#define ATA_WRITE_MULTI 0xC5 -#define ATA_WRITE_MULTI_EXT 0x39 -#define ATA_ID_DEV 0xEC - -#define ATAS_ERR 0x01 -#define ATAS_DRQ 0x08 -#define ATAS_DF 0x20 -#define ATAS_DRDY 0x40 -#define ATAS_BSY 0x80 - -#define ATAR0_DATA 0 -#define ATAR0_FEAT 1 -#define ATAR0_NSECT 2 -#define ATAR0_SECT 3 -#define ATAR0_LCYL 4 -#define ATAR0_HCYL 5 -#define ATAR0_SEL 6 -#define ATAR0_STAT 7 -#define ATAR0_CMD 7 -#define ATAR1_CTRL 2 - -#help_index "File/FileNames" -#define FILEMASK_JIT "*.CPP*;*.HPP*" -#define FILEMASK_AOT "*.CPP*;*.HPP*;*.PRJ*" -#define FILEMASK_SRC "*.CPP*;*.HPP*;*.AUT*;*.PRJ*" -#define FILEMASK_TXT FILEMASK_SRC ";*.TXT*;*.LOG*" -#define FILEMASK_GRA "*.GRA*;*.BMP*" - -#help_index "File/Low Level" -#define BLK_SIZE_BITS 9 -#define BLK_SIZE (1<drv_let directly in case a drive has been remapped. - //Use $LK,"Drv2Let",A="MN:Drv2Let"$(). - I64 locked_flags; - U32 dv_signature; - U8 drv_let,pad; - U16 fs_type; - I64 drv_offset, - size, - file_system_info_sect, - fat1,fat2, - root_cluster, - data_area, - spc; //sectors per cluster - CDate fat32_local_time_offset; - CTask *owning_task; - CBlkDev *bd; - - CFAT32FileInfoSect *fis; - I64 fat_blk_dirty, - cur_fat_blk_num; - U32 *cur_fat_blk; - CFreeLst *next_free,*last_free; -}; - -#define DSK_CACHE_HASH_SIZE 0x2000 - -class CCacheBlk -{ - CCacheBlk *next_lru,*last_lru; - CCacheBlk *next_hash,*last_hash; - CDrv *dv; - I64 blk; - U8 body[BLK_SIZE]; -}; - -#help_index "File/System" -public class CBlkDevGlbls -{ - CBlkDev *blkdevs; - U8 *dft_iso_filename; //See $LK,"blkdev.dft_iso_filename",A="FF:::/Kernel/KEnd.CPP,blkdev.dft_iso_filename"$ - U8 *temp_filename; - U8 *home_dir; - CCacheBlk *cache_base,*cache_ctrl,**cache_hash_table; - I64 cache_size,read_cnt,write_cnt; - CDrv *drvs,*let_to_drv[32]; - I64 auto_mount_ide_cnt; - U8 boot_drv_let,first_hd_drv_let,first_dvd_drv_let; - Bool dvd_boot_is_good,pad[4]; -}; - -#help_index "File/Internal" -public class CDirContext -{ - CDrv *old_dv,*dv; - U8 *old_dir,*mask; -}; - -#help_index "File/CFile" -#define FFB_NEXT_BLK MAX_I64 - -#define FF_WRITE 1 -#define FF_NEW_FILE 2 -#define FF_BUF_DIRTY 4 -#define FF_NEEDS_WRITE 8 -#define FF_CONTIGUOUS 16 -#define FF_USE_OLD_DATETIME 32 - -public class CFile //See $LK,"::/Demo/Dsk/DataBase.CPP"$. -{ - I64 flags; - CDirEntry de; - CDrv *dv; - I64 fblk_num,cluster,file_cluster_num,max_blk; - U8 *cluster_buf; -}; - -#help_index "Memory/Heap" -#define _CFG_HEAP_DBG FALSE - -#if _CFG_HEAP_DBG -class CMemUnused -{ - CHeapCtrl *hc; - U8 *caller1,*caller2; - CMemUnused *next; - I64 size; -}; -class CMemUsed -{ - CHeapCtrl *hc; - U8 *caller1,*caller2; - CMemUsed *next,*last; - I64 size; - U0 start; -}; -#else -class CMemUnused -{ - U0 hc; - U0 caller1,caller2; - CMemUnused *next; - I64 size; -}; -class CMemUsed -{ - CHeapCtrl *hc; - U0 caller1,caller2; - U0 next,last; - I64 size; - U0 start; -}; -#endif - -#help_index "Memory/BlkPool" -/*TempleOS does not mess with page tables after setting them up -during boot -- $LK,"SYS_INIT_PAGE_TABLES",A="MN:SYS_INIT_PAGE_TABLES"$. - -$LK,"MEM_PAGE_SIZE",A="MN:MEM_PAGE_SIZE"$, the unit size for alloications, is arbitrary, -and is not related to CPU hardware. - -All virtual addresses are ident to physical at all times. -text.vga_alias is not identity-mapped, however. - -There is no high kernel memory because RAM's physical -addresses are low. (All motherboards that I know of -put RAM in low addresses of 64-bit address space.) -It's ring-0-only so all (or none) is kernel, remember. -2 Meg hardware pages are used. Only the caching bits matter. -Remember, it is ring-0-only and identity-mapped! - -All code is placed in just the lowest 2 Gig, so the CALL REL32 -inst always works. It never changes out of ring-0, remember, -so I don't need to waste cycles on use SYSCALL or software interrupts. -Everything just uses CALL REL32. -*/ - -#define MBS_USED_SIGNATURE_VAL 'MBUs' -#define MBS_UNUSED_SIGNATURE_VAL 'MBUn' -class CMemBlk -{ - CMemBlk *next,*last; - U32 mb_signature,pages; -}; - -#define MRT_UNUSED 0 -#define MRT_RAM 1 -#define MRT_DEV 2 - -class CMemRange -{ - CMemRange *next,*last; - U32 type,flags; - U8 *base; - I64 size; -}; - -#define MEM_PAGE_BITS 9 -#define MEM_PAGE_SIZE (1< -#define MSG_KEY_UP 3 //($LK,"ASCII",A="MN:CH_CTRLA"$,$LK,"scan code",A="FI:::/Doc/CharOverview.TXT"$) Press -#define MSG_IP_MOVE 4 //(x,y) -#define MSG_IP_L_DOWN 5 //(x,y) -#define MSG_IP_L_UP 6 //(x,y) -#define MSG_IP_L_D_DOWN 7 //(x,y) -#define MSG_IP_L_D_UP 8 //(x,y) -#define MSG_IP_R_DOWN 9 //(x,y) -#define MSG_IP_R_UP 10 //(x,y) -#define MSG_IP_R_D_DOWN 11 //(x,y) -#define MSG_IP_R_D_UP 12 //(x,y) -#define MSG_FOCUS 13 //(flag,0) TRUE gaining focus, FALSE losing. -#define MSG_RESIZE 14 //(new columns,new rows). -#define MSG_MOVE 15 //(new left,new top). - -#define MSG_KEY_DOWN_UP -2 //Down & UP -#define MSG_IP_L_DOWN_UP -5 //Down & Up -#define MSG_IP_L_D_DOWN_UP -7 //Down & Up -#define MSG_IP_R_DOWN_UP -9 //Down & Up -#define MSG_IP_R_D_DOWN_UP -11 //Down & Up - -#help_index "Task/Settings" -#define TSF_SAME_SONG 1 -public class CTaskSettings -{ - CTaskSettings *next; - U8 *cur_dir; - I64 left,right,top,bottom; - U0 (*draw_it)(CTask *task,CDC *dc); - U0 (*task_end_cb)(); - CTask *song_task,*animate_task; - I64 scroll_x,scroll_y,scroll_z; - CBGR48 palette[NUM_COLORS]; - U32 win_inhibit; - U8 text_attr,title_src, - border_attr,border_src, - task_title[STR_LEN]; - Bool border,hide_cursor,highlight_cursor,scroll,autocomplete,pad[3]; - U0 pad;#assert !($$&7) //(compiler lags one token) -}; - -#help_index "Task" -//CTask.border_src -#define BDS_CONST 0 -#define BDS_CUR_DRV 1 -#define BDS_ED_FILENAME_DRV 2 - -//CTask.title_src -#define TTS_CONST 0 -#define TTS_LOCKED_CONST 1 //This is not strictly enforced -#define TTS_TASK_NAME 2 -#define TTS_ED_FILENAME 3 -#define TTS_CUR_LEX 4 - -//CTask.task_flags -#define TASKf_TASK_LOCK 0 -#define TASKf_KILL_TASK 1 -#define TASKf_SUSPENDED 2 -#define TASKf_IDLE 3 -#define TASKf_INPUT_FILTER_TASK 4 -#define TASKf_FILTER_INPUT 5 -#define TASKf_HAS_SONG 6 -#define TASKf_DISABLE_BPTS 7 -#define TASKf_AWAITING_MSG 8 -#define TASKf_BREAK_LOCKED 9 -#define TASKf_PENDING_BREAK 10 -#define TASKf_BREAK_TO_SHIFT_ESC 11 -#define TASKf_KILL_AFTER_DBG 12 -#define TASKf_NONTIMER_RAND 13 - -//CTask.display_flags -#define DISPLAYf_SHOW 0 -#define DISPLAYf_NOT_RAW 1 -#define DISPLAYf_SILENT 2 -#define DISPLAYf_NO_BORDER 3 -#define DISPLAYf_WIN_ON_TOP 4 -#define DISPLAYf_CHILDREN_NOT_ON_TOP 5 - -#define TASK_SIGNATURE_VAL 'TskS' -#define TASK_NAME_LEN 32 -class CTaskStk -{ - CTaskStk *next_stk; - I64 stk_size,stk_ptr; - U0 stk_base; -}; - -#define DYING_JIFFIES ToI64(JIFFY_FREQ/5) -class CTaskDying -{ - CTask *next,*last; - I64 wake_jiffy; -}; - -public class CTask //The Fs segment reg points to current CTask. -{ - CTask *addr; //Self-addressed ptr - U32 task_signature,win_inhibit; -U0 pad;#assert $$==offset(CTaskDying.wake_jiffy) - I64 wake_jiffy; - U32 task_flags,display_flags; - - CHeapCtrl *code_heap,*data_heap; - - CDoc *put_doc,*display_doc, //When double buffering, these two differ. - *border_doc; - I64 win_left,win_right,win_top,win_bottom; - - CDrv *cur_dv; - U8 *cur_dir; - - CTask *parent_task, - *next_task,*last_task, - *next_input_filter_task,*last_input_filter_task, - *next_sibling_task,*last_sibling_task, - *next_child_task,*last_child_task; - - //These are derived from left,top,right,bottom - I64 win_width,win_height, - pix_left,pix_right,pix_width, //These are in pixs, not characters - pix_top,pix_bottom,pix_height, - border_pix_left,border_pix_right, - border_pix_top,border_pix_bottom, - - scroll_x,scroll_y,scroll_z; - - //These must be in this order - //for $LK,"TASK_CONTEXT_SAVE",A="FF:::/Kernel/Sched.CPP,TASK_CONTEXT_SAVE"$ and $LK,"_TASK_CONTEXT_RESTORE",A="FF:::/Kernel/Sched.CPP,_TASK_CONTEXT_RESTORE"$ - I64 rip,rflags,rsp,rsi,rax,rcx,rdx,rbx,rbp,rdi, - r8,r9,r10,r11,r12,r13,r14,r15; - CCPU *gs; - CFPU *fpu_mmx; - I64 swap_cnter; - - U0 (*draw_it)(CTask *task,CDC *dc); - - U8 task_title[STR_LEN], - task_name[TASK_NAME_LEN], - wallpaper_data[STR_LEN], - - title_src,border_src, - text_attr,border_attr; - U16 win_z_num,pad; - - CTaskStk *stk; - - CExcept *next_except,*last_except; - I64 except_rbp, //throw routine's RBP - except_ch; //throw(ch) - U8 *except_caller1,*except_caller2,*except_caller3,*except_caller4; - - Bool catch_except; - Bool new_answer; - U8 answer_type,pad[5]; - I64 answer; - F64 answer_time; - CBpt *bpt_lst; - CCtrl *next_ctrl,*last_ctrl; - CMenu *cur_menu; - CTaskSettings *next_settings; - CMathODE *next_ode,*last_ode; - F64 last_ode_time; - CHashTable *hash_table; - - CSrvCtrl srv_ctrl; - CCmpCtrl *next_cc,*last_cc; - CHashFun *last_fun; - - I64 win_old_left,win_old_right,win_old_top,win_old_bottom; - - U0 (*task_end_cb)(); - CTask *song_task,*animate_task; - I64 rand_seed, - task_num, - fault_num,fault_err_code; - CTask *popup_task, - *dbg_task; - CWinScroll horz_scroll,vert_scroll; - - I64 user_data; - U0 pad;#assert !($$&7) //(compiler lags one token) -}; - -class CTSS -{ - U32 res1; - I64 rsp0,rsp1,rsp2,res2, - ist1,ist2,ist3,ist4,ist5,ist6,ist7,res3; - U16 res4,io_map_offset; - U8 io_map[0x10000/8]; - I64 *st0,*st1,*st2; - U16 tr,tr_ring3; -}; - -#define ans (Fs->answer) -#define ansf (Fs->answer(F64)) - -#define _RAX Fs->rax -#define _RBX Fs->rbx -#define _RCX Fs->rcx -#define _RDX Fs->rdx -#define _RSI Fs->rsi -#define _RDI Fs->rdi -#define _RBP Fs->rbp -#define _RSP Fs->rsp -#define _RIP Fs->rip -#define _R8 Fs->r8 -#define _R9 Fs->r9 -#define _R10 Fs->r10 -#define _R11 Fs->r11 -#define _R12 Fs->r12 -#define _R13 Fs->r13 -#define _R14 Fs->r14 -#define _R15 Fs->r15 - -#help_index "MultiCore" -#define CPUf_RAN_A_TASK 0 -#define CPUf_DYING_TASK_QUE 1 - -public class CCPU //The Gs segment reg points to current CCPU. -{ - CCPU *addr; //Self-addressed ptr - I64 num,cpu_flags, - startup_rip, - idle_pt_hits; - F64 idle_factor; - I64 total_jiffies; - CTask *seth_task,*idle_task; - I64 tr, //task reg - swap_cnter; - U0 (*profiler_timer_irq)(CTask *task); - CTaskDying *next_dying,*last_dying; - I64 kill_jiffy; - CTSS *tss; - I64 start_stk[16]; - U0 pad;#assert !($$&7) //(compiler lags one token) -}; - -#help_index "Memory/Page Tables" -#define MEM_MIN_MEG 512 //512 Meg minimum. -#define MEM_MAPPED_SPACE 0x4000000000 //Arbitrarily set to 256 Gig. -#define MEM_NUM_2MEG (MEM_MAPPED_SPACE>>21) -#define MEM_NUM_USED_1GIG (MEM_MAPPED_SPACE>>(21+9)) -#define MEM_NUM_1GIG (0x1000/8) -#define MEM_NUM_512GIG (0x1000/8) - -#define SYS_FIXED_AREA 0x100000 -public class CSysFixedArea -{ - U8 pml2[MEM_NUM_2MEG*8],pml3[MEM_NUM_1GIG*8],pml4[MEM_NUM_512GIG*8]; - $$=($$+15)&-16; - CFPU init_fpu_mmx; - CCPU boot_cpu; - CTask adam; - CBlkPool adam_bp; - CHeapCtrl adam_hc; - $$=($$+MEM_PAGE_SIZE-1)&-MEM_PAGE_SIZE; -}; - -#help_index "Char" -#define CH_CTRLA 0x01 -#define CH_CTRLB 0x02 -#define CH_CTRLC 0x03 -#define CH_CTRLD 0x04 -#define CH_CTRLE 0x05 -#define CH_CTRLF 0x06 -#define CH_CTRLG 0x07 -#define CH_CTRLH 0x08 -#define CH_CTRLI 0x09 -#define CH_CTRLJ 0x0A -#define CH_CTRLK 0x0B -#define CH_CTRLL 0x0C -#define CH_CTRLM 0x0D -#define CH_CTRLN 0x0E -#define CH_CTRLO 0x0F -#define CH_CTRLP 0x10 -#define CH_CTRLQ 0x11 -#define CH_CTRLR 0x12 -#define CH_CTRLS 0x13 -#define CH_CTRLT 0x14 -#define CH_CTRLU 0x15 -#define CH_CTRLV 0x16 -#define CH_CTRLW 0x17 -#define CH_CTRLX 0x18 -#define CH_CTRLY 0x19 -#define CH_CTRLZ 0x1A -#define CH_CURSOR 0x05 -#define CH_BACKSPACE 0x08 -#define CH_FORM_FEED 0x0C -#define CH_ESC 0x1B -#define CH_SHIFT_ESC 0x1C -#define CH_SHIFT_SPACE 0x1F -#define CH_SPACE 0x20 - -#define ST_ERR_ST "$$LTRED$$$$BK,1$$ERROR:$$FG$$$$BK,0$$ " -#define ST_WARN_ST "$$RED$$$$BK,1$$WARNING:$$FG$$$$BK,0$$ " - -//Scan code flags -#define SCf_E0_PREFIX 7 -#define SCf_KEY_UP 8 -#define SCf_SHIFT 9 -#define SCf_CTRL 10 -#define SCf_ALT 11 -#define SCf_CAPS 12 -#define SCf_NUM 13 -#define SCf_SCROLL 14 -#define SCf_NEW_KEY 15 -#define SCf_IP_L_DOWN 16 -#define SCf_IP_R_DOWN 17 -#define SCf_DELETE 18 -#define SCf_INS 19 -#define SCf_NO_SHIFT 30 -#define SCf_KEY_DESC 31 -#define SCF_E0_PREFIX (1< -#define GSF_WITH_NEW_LINE 2 - -#define "Char/Operations" -//Flags for StrUtil and MStrUtil -#define SUF_REM_CTRL_CHARS 0x001 -#define SUF_REM_LEADING 0x002 -#define SUF_REM_TRAILING 0x004 -#define SUF_REM_SPACES 0x008 -#define SUF_SINGLE_SPACE 0x010 -#define SUF_TO_UPPER 0x020 -#define SUF_TO_LOWER 0x040 -#define SUF_S2T 0x080 -#define SUF_T2S 0x100 // Only works with MStrUtil -#define SUF_SCALE_INDENT 0x200 -#define SUF_SAFE_DOLLAR 0x400 - -//Flags for StrFind -#define SFF_IGNORE_CASE 1 -#define SFF_WHOLE_LABELS_BEFORE 2 -#define SFF_WHOLE_LABELS_AFTER 4 -#define SFG_WHOLE_LABELS (SFF_WHOLE_LABELS_BEFORE|SFF_WHOLE_LABELS_AFTER) - -//Flags for LstMatch -#define LMF_IGNORE_CASE 1 -#define LMF_EXACT 2 - -#help_index "Keyboard Devices/System" -#define KDF_HAS_DESCS 1 -class CKeyDevEntry -{ - CKeyDevEntry *next,*last; - I64 priority,flags; - Bool (*put_key)(I64 ch,I64 sc); - Bool (*put_s)(U8 *st); -}; - -class CKeyDevGlbls -{ - CKeyDevEntry put_key_head; - U0 (**fp_ctrl_alt_cbs)(I64 sc); - I64 ctrl_alt_in_irq_flags, - **ctrl_alt_ret_addr; //addr of ret addr on stack in kbd irq - U8 **ctrl_alt_no_shift_descs,**ctrl_alt_shift_descs, - desc[STR_LEN], - *handler; -}; - -#help_index "Snd" -class CSndData -{ - CSndData *next,*last; - F64 freq, //Hz - time; -}; - -public class CSndGlbls -{ - F64 freq; - CSndData record_head; - Bool record; -}; - -#help_index "Debugging/FunSeg" -#define FUN_SEG_CACHE_SIZE 256 -class CFunSegCache -{ - I64 base,limit; - F64 time_stamp; - U8 str[1]; //FUN_SEG_CACHE_STR_LEN -$$=64; -}; -#define FUN_SEG_CACHE_STR_LEN (sizeof(CFunSegCache)-offset(CFunSegCache.str)) - -#help_index "Debugging" -class CMPCrash -{ - I64 cpu_num; - CTask *task; - I64 rip; - U8 *msg; - I64 msg_num; -}; - -public class CDbgGlbls -{ - CTask *focus_task; - U8 *msg; - I64 msg_num; - CMPCrash *mp_crash; - U8 *int_fault_code, - *fix_file_line; - CFunSegCache *fun_seg_cache; - I64 fun_seg_cache_index; -}; - -#help_index "Boot" -//Boot related -#define BOOT_RAM_BASE 0x07C00 -#define BOOT_RAM_LIMIT 0x97000 -#define BOOT_STK_SIZE BLK_SIZE - -#define BOOT_SRC_NULL 0 -#define BOOT_SRC_ROM 1 -#define BOOT_SRC_RAM 2 -#define BOOT_SRC_HARDDRV 3 -#define BOOT_SRC_DVD 4 - -// $LK,"Auto",A="MN:Auto"$("") StdIn for call to $LK,"BootHDIns",A="MN:BootHDIns"$(). -#define STD_DISTRO_DVD_CFG "Tb\nScale2Mem(2048,0x40000)\nt \n\n\n\n" - -#help_index "Misc/Registry" -//Registry sys_msg_flags. $LK,"RegOneTimePopUp",A="MN:RegOneTimePopUp"$() -#define ARf_FLOODFILL 0 -#define ARf_CSPRITE_INS_CLIPBOARD 1 -#define ARf_PLANAR_SYMMETRY 2 -#define ARf_PSALMODY_JUKEBOX 3 -#define ARf_MESH_ED 4 -#define ARf_CSPRITE_PTS_RECTANGLES 5 -#define ARf_MANAGE_SLIDER 6 - -#help_index "Misc/Progress Bars" -#define NUM_PROGRESS_BARS 4 -#define PROGRESS_DESC_LEN (64-8-8) -class CProgress -{ - I64 val,max; - U8 desc[PROGRESS_DESC_LEN]; -}; - -#help_index "Char/Operations" -#define SPF_PAD_ZERO 0x001 -#define SPF_LEFT_JUSTIFY 0x002 -#define SPF_TRUNCATE 0x004 -#define SPF_COMMA 0x008 -#define SPF_DOLLAR 0x010 -#define SPF_SLASH 0x020 -#define SPF_QUESTION 0x040 -#define SPF_AUX_FMT_NUM 0x080 -#define SPF_DECIMAL 0x100 -#define SPF_NEG 0x200 -#define SPF_NEG_E 0x400 -#define SPF_NEG_AUX_FMT_NUM 0x800 - -#help_index "" diff --git a/Kernel/KernelB.HH b/Kernel/KernelB.HH new file mode 100644 index 0000000..2f6e930 --- /dev/null +++ b/Kernel/KernelB.HH @@ -0,0 +1,282 @@ +/* Kernel ASM symbols. +$LK,"KernelB",A="FF:::/Kernel/Kernel.PRJ,KernelB"$ Kernel.PRJ +$LK,"KernelB",A="FF:::/Compiler/Compiler.PRJ,KernelB"$ Compiler.PRJ +$LK,"KernelB",A="FF:::/StartOS.HC,KernelB"$ StartOS.HC +*/ + +#help_index "Bit" +#help_file "::/Doc/Bit" +public _intern IC_BSF I64 Bsf( + I64 bit_field_val);//Scan fwd from lowest for 1st set. -1 if not found. +public _intern IC_BSR I64 Bsr( + I64 bit_field_val);//Scan rev from highest for 1st set. -1 if not found. +public _intern IC_BT Bool Bt( + U8 *bit_field,I64 bit); //Bit test. +public _intern IC_BTC Bool Btc( + U8 *bit_field,I64 bit); //Bit test and complement (same as xor with 1). +public _intern IC_BTR Bool Btr( + U8 *bit_field,I64 bit); //Bit test and reset to zero. +public _intern IC_BTS Bool Bts( + U8 *bit_field,I64 bit); //Bit test and set to one. +public _intern IC_LBTC Bool LBtc( + U8 *bit_field,I64 bit); //Locked bit test and complement (xor with 1). +public _intern IC_LBTR Bool LBtr( + U8 *bit_field,I64 bit); //Locked bit test and reset to zero. +public _intern IC_LBTS Bool LBts( + U8 *bit_field,I64 bit); //Locked bit test and set to one. +public _extern _BEQU Bool BEqu( + U8 *bit_field,I64 bit,Bool val);//Set bit equ to val. +public _extern _BIT_FIELD_EXT_U32 U32 BFieldExtU32( + U8 *bit_field,I64 bit,I64 size); //Extract U32 from bit field. +public _extern _BIT_FIELD_OR_U32 U0 BFieldOrU32( + U8 *bit_field,I64 bit,U32 pattern); //Or U32 into bit field. +public _extern _LBEQU Bool LBEqu( + U8 *bit_field,I64 bit,Bool val); //Locked Set bit equ to val. + +#help_index "Boot" +_extern SYS_BOOT_BASE U32 sys_boot_base; +_extern SYS_BOOT_BLK U32 sys_boot_blk; +_extern SYS_BOOT_PATCH_TABLE_BASE U32 sys_boot_patch_table_base; +_extern SYS_BOOT_SRC U32 sys_boot_src; +_extern SYS_RUN_LEVEL U32 sys_run_level; + +#help_index "Call" +public _extern _CALL I64 Call(U8 *machine_code); //Call addr with no args. +public _extern _CALLEXTSTR I64 CallExtStr( + /*argpop*/ U8 *name,...); //Search sym table for fun and pass it args. +//Can have any fixed number of arguments. +public _extern _CALL_IND I64 CallInd( + /*argpop*/I64 (*fp_addr)(...),...); //Call with fixed number of args. + +#help_index "Call/System Extern Num" +public _extern SYS_EXTERN_TABLE /*argpop*/ + I64 (**ext)(...); //Array of fun ptrs. See $LK,"Extern Num Definitions",A="MN:EXT_NUM_ENTRIES"$ +public _extern _CALLEXTNUM + I64 CallExtNum(I64 num,...); //Call ext num with fixed number of args. + +#help_index "Char/Conversion" +public _intern IC_TOUPPER I64 ToUpper(U8 ch); //Cvt char to upper case. + +#help_index "Char/Operations" +public _intern IC_STRLEN I64 StrLen(U8 *st); //String length. + +#help_index "Data Types/Circular Queue" +#help_file "::/Doc/Que" +public _intern IC_QUE_INIT U0 QueInit( + CQue *head); //Init queue head links. +public _intern IC_QUE_INS U0 QueIns( + CQue *entry,CQue *pred);//Insert item into que after predecessor. +public _intern IC_QUE_INS_REV U0 QueInsRev( + CQue *entry,CQue *succ);//Revd insert into que. +//Ins item into que before successor. +public _intern IC_QUE_REM U0 QueRem(CQue *entry); //Remove item from queue. + +#help_index "I/O;Processor/IO Port" +public _intern IC_IN_U16 U16 InU16(I64 port); //Read U16 from I/O port. +public _intern IC_IN_U32 U32 InU32(I64 port); //Read U32 from I/O port. +public _intern IC_IN_U8 U8 InU8(I64 port); //Read U8 from I/O port. +public _intern IC_OUT_U16 U0 OutU16(I64 port, I64 val); //Write U16 to I/O port. +public _intern IC_OUT_U32 U0 OutU32(I64 port, I64 val); //Write U32 to I/O port. +public _intern IC_OUT_U8 U0 OutU8(I64 port, I64 val); //Write U8 to I/O port. +public _extern _REP_IN_U16 U0 RepInU16( + U8 *buf,I64 cnt,I64 port); //Repeated read U16 from I/O port. +public _extern _REP_IN_U32 U0 RepInU32( + U8 *buf,I64 cnt,I64 port); //Repeated read U32 from I/O port. +public _extern _REP_IN_U8 U0 RepInU8( + U8 *buf,I64 cnt,I64 port); //Repeated read U8 from I/O port. +public _extern _REP_OUT_U16 U0 RepOutU16( + U8 *buf,I64 cnt,I64 port); //Repeated write U16 to I/O port. +public _extern _REP_OUT_U32 U0 RepOutU32( + U8 *buf,I64 cnt,I64 port); //Repeated write U32 to I/O port. +public _extern _REP_OUT_U8 U0 RepOutU8( + U8 *buf,I64 cnt,I64 port); //Repeated write U8 to I/O port. + +#help_index "Math" +public _intern IC_ATAN F64 ATan(F64 d); //Arc Tan (Inverse Tan). +public _intern IC_ABS F64 Abs(F64 d); //Absolute F64. +public _intern IC_ABS_I64 I64 AbsI64(I64 i); //Absolute I64. +public _intern IC_COS F64 Cos(F64 d); //Cosine. +public _intern IC_MAX_I64 I64 MaxI64(I64 n1,I64 n2); //Max of two I64s. +public _intern IC_MAX_U64 U64 MaxU64(U64 n1,U64 n2); //Max of two U64s. +public _intern IC_MIN_I64 I64 MinI64(I64 n1,I64 n2); //Min of two I64s. +public _intern IC_MIN_U64 U64 MinU64(U64 n1,U64 n2); //Min of two U64s. +public _intern IC_MOD_U64 U64 ModU64(U64 *q,U64 d); //Div and return U64 Modulo. +public _intern IC_SIGN_I64 I64 SignI64(I64 i); //Sign of I64: -1,0,1. +public _intern IC_SIN F64 Sin(F64 d); //Sine. +public _intern IC_SQR F64 Sqr(F64 d); //Square of F64. +public _intern IC_SQR_I64 I64 SqrI64(I64 i); //Square of I64. +public _intern IC_SQR_U64 U64 SqrU64(U64 i); //Square of U64. +public _intern IC_SQRT F64 Sqrt(F64 d); //Square head of F64. +public _intern IC_SWAP_I64 U0 SwapI64( + I64 *n1,I64 *n2); //Swap two I64s. Not atomic. +public _intern IC_SWAP_U16 U0 SwapU16( + U16 *n1,U16 *n2); //Swap two U16s. Not atomic. +public _intern IC_SWAP_U32 U0 SwapU32( + U32 *n1,U32 *n2); //Swap two U32s. Not atomic. +public _intern IC_SWAP_U8 U0 SwapU8( + U8 *n1,U8 *n2); //Swap two U8s. Not atomic. +public _intern IC_TAN F64 Tan(F64 d); //Tangent. +public _intern IC_TO_BOOL Bool ToBool(I64 i); //Convert to Boolean. +public _intern IC_TO_F64 F64 ToF64(I64 i); //Convert to F64. +public _intern IC_TO_I64 I64 ToI64(F64 d); //Convert to I64. Truncates. +public _extern _ARG F64 Arg(F64 x,F64 y); //Polar coordinate angle. +public _extern _CEIL F64 Ceil(F64 d); //Ceiling of F64. +public _extern _CLAMP_I64 I64 ClampI64( + I64 num,I64 lo,I64 hi); //Clamp to I64 [] range. +public _extern _CLAMP_U64 U64 ClampU64( + U64 num,U64 lo,U64 hi); //Clamp to U64 [] range. +public _extern _EXP F64 Exp(F64 d); //Exponential function. +_extern _FCLEX U0 Fclex(); +_extern _FLDCW U0 Fldcw(U16 w); +public _extern _FLOOR F64 Floor(F64 d); //Floor of F64. +_extern _FSTCW U16 Fstcw(); +_extern _FSTSW U16 Fstsw(); +public _extern _LN F64 Ln(F64 d); //Logarithm. +public _extern _LOG10 F64 Log10(F64 d); //Log base 10. +public _extern _LOG2 F64 Log2(F64 d); //Log base 2. +public _extern _POW F64 Pow(F64 base,F64 power); //F64 base to a power. +public _extern _POW10 F64 Pow10(F64 d); //Ten to the dth power. +public _extern _ROUND F64 Round(F64 d); //Round F64 to whole number. +public _extern _SIGN F64 Sign(F64 d); //Sign of F64: -1,0,1 +public _extern _TRUNC F64 Trunc(F64 d); //Truncate F64. + +#help_index "Math/CD3;Data Types/CD3" +#help_file "::/Doc/D3" +public _extern _D3_ADD CD3 *D3Add(CD3 *sum,CD3 *d1,CD3 *d2); //sum=d1+d2 +public _extern _D3_ADD_EQU CD3 *D3AddEqu(CD3 *sum,CD3 *d); //sum+=d +public _extern _D3_COPY CD3 *D3Copy(CD3 *dst,CD3 *src); //dst=src +public _extern _D3_CROSS CD3 *D3Cross(CD3 *prod,CD3 *d1,CD3 *d2); //prod=d1xd2 +public _extern _D3_DIST F64 D3Dist(CD3 *d1,CD3 *d2); //Distance +public _extern _D3_DIST_SQR F64 D3DistSqr(CD3 *d1,CD3 *d2); //Distance Squared +public _extern _D3_DIV CD3 *D3Div(CD3 *quot,CD3 *d,F64 s); //quot=d/s +public _extern _D3_DIV_EQU CD3 *D3DivEqu(CD3 *quot,F64 s); //quot/=s +public _extern _D3_DOT F64 D3Dot(CD3 *d1,CD3 *d2); //d1 dot d2 +public _extern _D3_EQU CD3 *D3Equ(CD3 *dst,F64 x,F64 y,F64 z); //dst=(x,y,z) +public _extern _D3_MUL CD3 *D3Mul(CD3 *prod,F64 s,CD3 *d); //prod=s*d +public _extern _D3_MUL_EQU CD3 *D3MulEqu(CD3 *prod,F64 s); //prod*=s +public _extern _D3_NORM F64 D3Norm(CD3 *d); //Norm +public _extern _D3_NORM_SQR F64 D3NormSqr(CD3 *d); //Norm Squared +public _extern _D3_SUB CD3 *D3Sub(CD3 *diff,CD3 *d1,CD3 *d2); //diff=d1-d2 +public _extern _D3_SUB_EQU CD3 *D3SubEqu(CD3 *diff,CD3 *d); //diff-=d +public _extern _D3_UNIT CD3 *D3Unit(CD3 *d); //To unit vect +public _extern _D3_ZERO CD3 *D3Zero(CD3 *dst); //To zero + +#help_index "Memory" +public _extern _MEMCMP I64 MemCmp( + U8 *ptr1,U8 *ptr2,I64 cnt); //Compare chunk of memory. +public _extern _MEMCPY U8 *MemCpy( + U8 *dst,U8 *src,I64 cnt); //Copy chunk of memory. Only goes fwd. +public _extern _MEMSET U8 *MemSet( + U8 *dst,I64 val,I64 cnt); //Set chunk of U8s to value. +public _extern _MEMSET_I64 I64 *MemSetI64( + I64 *dst,I64 val,I64 I64cnt); //Set chunk of I64s to value. +public _extern _MEMSET_U16 U16 *MemSetU16( + U16 *dst,I64 val,I64 U16cnt); //Set chunk of U16s to value. +public _extern _MEMSET_U32 U32 *MemSetU32( + U32 *dst,I64 val,I64 U32cnt); //Set chunk of U32s to value. +public _extern _MEMSET U8 *MemSetU8( + U8 *dst,I64 val,I64 U8cnt); //Set chunk of U8s to value. +_extern SYS_GIG_PAGES U8 sys_gig_pages; +_extern SYS_HEAP_DBG_FLAG U8 sys_heap_dbg; +_extern SYS_HEAP_INIT_FLAG U8 sys_heap_init_flag; +_extern SYS_HEAP_INIT_VAL U8 sys_heap_init_val; +_extern SYS_MEM_INIT_FLAG U8 sys_mem_init_flag; +_extern SYS_MEM_INIT_VAL U8 sys_mem_init_val; +_extern SYS_VAR_INIT_FLAG U8 sys_var_init_flag; +_extern SYS_VAR_INIT_VAL U8 sys_var_init_val; + +#help_index "Memory/BlkPool" +public _extern SYS_CODE_BP CBlkPool *sys_code_bp; //System's BlkPool for code. +public _extern SYS_DATA_BP CBlkPool *sys_data_bp; //System's BlkPool for data. + +#help_index "Memory/Info" +_extern SYS_HEAP_BASE U8 *sys_heap_base; +_extern SYS_HEAP_LIMIT U8 *sys_heap_limit; + +#help_index "Messages;Windows" +public _extern SYS_FOCUS_TASK CTask *sys_focus_task; //Current focus task. + +#help_index "Misc" +public _extern SYS_COMPILE_TIME + CDate sys_compile_time; //Date and time kernel was compiled. +_extern SYS_CTRL_ALT_FLAGS + I64 sys_ctrl_alt_flags[1]; //Should be semiphores? + +#help_index "Misc/Progress Bars" +public _extern SYS_PROGRESS1 I64 progress1; //Current progress 1. +public _extern SYS_PROGRESS1_DESC + U8 progress1_desc[PROGRESS_DESC_LEN]; //Progress 1 desc. +public _extern SYS_PROGRESS1_MAX I64 progress1_max; //Max progress 1. +public _extern SYS_PROGRESS2 I64 progress2; //Current progress 2. +public _extern SYS_PROGRESS2_DESC + U8 progress2_desc[PROGRESS_DESC_LEN]; //Progress 2 desc. +public _extern SYS_PROGRESS2_MAX I64 progress2_max; //Max progress 2. +public _extern SYS_PROGRESS3 I64 progress3; //Current progress 3. +public _extern SYS_PROGRESS3_DESC + U8 progress3_desc[PROGRESS_DESC_LEN]; //Progress 3 desc. +public _extern SYS_PROGRESS3_MAX I64 progress3_max; //Max progress 3. +public _extern SYS_PROGRESS4 I64 progress4; //Current progress 4. +public _extern SYS_PROGRESS4_DESC + U8 progress4_desc[PROGRESS_DESC_LEN]; //Progress 4 desc. +public _extern SYS_PROGRESS4_MAX I64 progress4_max; //Max progress 4. +public _extern SYS_PROGRESSES + CProgress sys_progresses[NUM_PROGRESS_BARS]; //All progress bars. + +#help_index "MultiCore" +#help_file "::/Doc/MultiCore" +public _extern SYS_CPU_STRUCTS CCPU *cpu_structs; //$LK,"Gs",A="MN:Gs"$ points to cur $LK,"CCPU",A="MN:CCPU"$. +public _extern SYS_MP_CNT I64 mp_cnt; //Count of cores +_extern SYS_MP_CNT_INITIAL I64 mp_cnt_initial; //only used during $LK,"Core0StartMP",A="MN:Core0StartMP"$ +_extern SYS_MP_CNT_LOCK I64 mp_cnt_lock; +_extern SYS_SEMAS CSema sys_semas[NUM_SYS_SEMAS]; + +#help_index "MultiCore;Processor" +public _intern IC_GS CCPU *Gs(); //GS points to current $LK,"CCPU",A="MN:CCPU"$. + +#help_index "PCI" +public _extern SYS_PCI_BUSES U16 sys_pci_busses; //Number of PCI buses. + +#help_index "Processor" +public _intern IC_CARRY I64 Carry(); //See $LK,"::/Demo/Carry.HC"$ +public _intern IC_GET_RAX I64 GetRAX(); //Get RAX register value. +public _intern IC_GET_RBP U8 *GetRBP(); //Get RBP register value. +public _intern IC_GET_RFLAGS I64 GetRFlags(); //Get RFlags register value. +public _intern IC_GET_RSP U8 *GetRSP(); //Get RSP register value. +public _intern IC_POP I64 Pop(); //Pop value from stk. +public _intern IC_PUSH U0 Push(I64 d); //Push value on stk. +public _intern IC_SET_RAX U0 SetRAX(I64 d); //Set RAX register value. +public _intern IC_SET_RBP U0 SetRBP(U8 *d); //Set RBP register value. +public _intern IC_SET_RFLAGS U0 SetRFlags(I64 d); //Set RFlags register value. +public _intern IC_SET_RSP U0 SetRSP(U8 *d); //Set RSP register value. +public _extern _CPUID U0 CPUId( + U32 rax,CRAXRBCRCXRDX *res); //Do CPUID inst. +public _extern _LXCHG_I64 I64 LXchgI64(I64 *dst,I64 d); //Locked eXchange I64s. +public _extern _LXCHG_U16 U16 LXchgU16(U16 *dst,U16 d); //Locked eXchange U16s. +public _extern _LXCHG_U32 U32 LXchgU32(U32 *dst,U32 d); //Locked eXchange U32s. +public _extern _LXCHG_U8 U8 LXchgU8(U8 *dst,U8 d); //Locked eXchange U8s. +public _extern _SET_MSR U0 SetMSR( + I64 model_specific_reg,I64 val); //Model Specific Reg See $LK,"MSRs",A="MN:IA32_EFER"$. +public _extern _SYS_HLT U0 SysHlt(); //Loops doing HLT inst. +public _extern _XCHG_I64 I64 XchgI64(I64 *dst,I64 d); //eXchange I64s. +public _extern _XCHG_U16 U16 XchgU16(U16 *dst,U16 d); //eXchange U16s. +public _extern _XCHG_U32 U32 XchgU32(U32 *dst,U32 d); //eXchange U32s. +public _extern _XCHG_U8 U8 XchgU8(U8 *dst,U8 d); //eXchange U8s. +public _extern SYS_CACHE_LINE_WIDTH + I64 sys_cache_line_width; //CPU's Cache line width. +_extern SYS_GDT CGDT sys_gdt; + +#help_index "Processor/Cache;Memory/Cache" +public _intern IC_CLFLUSH U0 CLFlush(U8 *a); //Flush cache line inst. + +#help_index "Processor/Page Tables;Memory/Page Tables" +public _intern IC_INVLPG + U0 InvlPg(U8 *a); //Invalidate page at addr inst. + +#help_index "Task;Processor" +public _intern IC_FS CTask *Fs(); //FS seg reg points to the current $LK,"CTask",A="MN:CTask"$. + +#help_index "Time/CPU Cycles" +#help_file "::/Doc/TimeCycles" +public _intern IC_RDTSC I64 GetTSC(); //Get time stamp counter. + +#help_index "" diff --git a/Kernel/KernelB.HPP b/Kernel/KernelB.HPP deleted file mode 100644 index 38220b9..0000000 --- a/Kernel/KernelB.HPP +++ /dev/null @@ -1,282 +0,0 @@ -/* Kernel ASM symbols. -$LK,"KernelB",A="FF:::/Kernel/Kernel.PRJ,KernelB"$ Kernel.PRJ -$LK,"KernelB",A="FF:::/Compiler/Compiler.PRJ,KernelB"$ Compiler.PRJ -$LK,"KernelB",A="FF:::/StartOS.CPP,KernelB"$ StartOS.CPP -*/ - -#help_index "Bit" -#help_file "::/Doc/Bit" -public _intern IC_BSF I64 Bsf( - I64 bit_field_val);//Scan fwd from lowest for 1st set. -1 if not found. -public _intern IC_BSR I64 Bsr( - I64 bit_field_val);//Scan rev from highest for 1st set. -1 if not found. -public _intern IC_BT Bool Bt( - U8 *bit_field,I64 bit); //Bit test. -public _intern IC_BTC Bool Btc( - U8 *bit_field,I64 bit); //Bit test and complement (same as xor with 1). -public _intern IC_BTR Bool Btr( - U8 *bit_field,I64 bit); //Bit test and reset to zero. -public _intern IC_BTS Bool Bts( - U8 *bit_field,I64 bit); //Bit test and set to one. -public _intern IC_LBTC Bool LBtc( - U8 *bit_field,I64 bit); //Locked bit test and complement (xor with 1). -public _intern IC_LBTR Bool LBtr( - U8 *bit_field,I64 bit); //Locked bit test and reset to zero. -public _intern IC_LBTS Bool LBts( - U8 *bit_field,I64 bit); //Locked bit test and set to one. -public _extern _BEQU Bool BEqu( - U8 *bit_field,I64 bit,Bool val);//Set bit equ to val. -public _extern _BIT_FIELD_EXT_U32 U32 BFieldExtU32( - U8 *bit_field,I64 bit,I64 size); //Extract U32 from bit field. -public _extern _BIT_FIELD_OR_U32 U0 BFieldOrU32( - U8 *bit_field,I64 bit,U32 pattern); //Or U32 into bit field. -public _extern _LBEQU Bool LBEqu( - U8 *bit_field,I64 bit,Bool val); //Locked Set bit equ to val. - -#help_index "Boot" -_extern SYS_BOOT_BASE U32 sys_boot_base; -_extern SYS_BOOT_BLK U32 sys_boot_blk; -_extern SYS_BOOT_PATCH_TABLE_BASE U32 sys_boot_patch_table_base; -_extern SYS_BOOT_SRC U32 sys_boot_src; -_extern SYS_RUN_LEVEL U32 sys_run_level; - -#help_index "Call" -public _extern _CALL I64 Call(U8 *machine_code); //Call addr with no args. -public _extern _CALLEXTSTR I64 CallExtStr( - /*argpop*/ U8 *name,...); //Search sym table for fun and pass it args. -//Can have any fixed number of arguments. -public _extern _CALL_IND I64 CallInd( - /*argpop*/I64 (*fp_addr)(...),...); //Call with fixed number of args. - -#help_index "Call/System Extern Num" -public _extern SYS_EXTERN_TABLE /*argpop*/ - I64 (**ext)(...); //Array of fun ptrs. See $LK,"Extern Num Definitions",A="MN:EXT_NUM_ENTRIES"$ -public _extern _CALLEXTNUM - I64 CallExtNum(I64 num,...); //Call ext num with fixed number of args. - -#help_index "Char/Conversion" -public _intern IC_TOUPPER I64 ToUpper(U8 ch); //Cvt char to upper case. - -#help_index "Char/Operations" -public _intern IC_STRLEN I64 StrLen(U8 *st); //String length. - -#help_index "Data Types/Circular Queue" -#help_file "::/Doc/Que" -public _intern IC_QUE_INIT U0 QueInit( - CQue *head); //Init queue head links. -public _intern IC_QUE_INS U0 QueIns( - CQue *entry,CQue *pred);//Insert item into que after predecessor. -public _intern IC_QUE_INS_REV U0 QueInsRev( - CQue *entry,CQue *succ);//Revd insert into que. -//Ins item into que before successor. -public _intern IC_QUE_REM U0 QueRem(CQue *entry); //Remove item from queue. - -#help_index "I/O;Processor/IO Port" -public _intern IC_IN_U16 U16 InU16(I64 port); //Read U16 from I/O port. -public _intern IC_IN_U32 U32 InU32(I64 port); //Read U32 from I/O port. -public _intern IC_IN_U8 U8 InU8(I64 port); //Read U8 from I/O port. -public _intern IC_OUT_U16 U0 OutU16(I64 port, I64 val); //Write U16 to I/O port. -public _intern IC_OUT_U32 U0 OutU32(I64 port, I64 val); //Write U32 to I/O port. -public _intern IC_OUT_U8 U0 OutU8(I64 port, I64 val); //Write U8 to I/O port. -public _extern _REP_IN_U16 U0 RepInU16( - U8 *buf,I64 cnt,I64 port); //Repeated read U16 from I/O port. -public _extern _REP_IN_U32 U0 RepInU32( - U8 *buf,I64 cnt,I64 port); //Repeated read U32 from I/O port. -public _extern _REP_IN_U8 U0 RepInU8( - U8 *buf,I64 cnt,I64 port); //Repeated read U8 from I/O port. -public _extern _REP_OUT_U16 U0 RepOutU16( - U8 *buf,I64 cnt,I64 port); //Repeated write U16 to I/O port. -public _extern _REP_OUT_U32 U0 RepOutU32( - U8 *buf,I64 cnt,I64 port); //Repeated write U32 to I/O port. -public _extern _REP_OUT_U8 U0 RepOutU8( - U8 *buf,I64 cnt,I64 port); //Repeated write U8 to I/O port. - -#help_index "Math" -public _intern IC_ATAN F64 ATan(F64 d); //Arc Tan (Inverse Tan). -public _intern IC_ABS F64 Abs(F64 d); //Absolute F64. -public _intern IC_ABS_I64 I64 AbsI64(I64 i); //Absolute I64. -public _intern IC_COS F64 Cos(F64 d); //Cosine. -public _intern IC_MAX_I64 I64 MaxI64(I64 n1,I64 n2); //Max of two I64s. -public _intern IC_MAX_U64 U64 MaxU64(U64 n1,U64 n2); //Max of two U64s. -public _intern IC_MIN_I64 I64 MinI64(I64 n1,I64 n2); //Min of two I64s. -public _intern IC_MIN_U64 U64 MinU64(U64 n1,U64 n2); //Min of two U64s. -public _intern IC_MOD_U64 U64 ModU64(U64 *q,U64 d); //Div and return U64 Modulo. -public _intern IC_SIGN_I64 I64 SignI64(I64 i); //Sign of I64: -1,0,1. -public _intern IC_SIN F64 Sin(F64 d); //Sine. -public _intern IC_SQR F64 Sqr(F64 d); //Square of F64. -public _intern IC_SQR_I64 I64 SqrI64(I64 i); //Square of I64. -public _intern IC_SQR_U64 U64 SqrU64(U64 i); //Square of U64. -public _intern IC_SQRT F64 Sqrt(F64 d); //Square head of F64. -public _intern IC_SWAP_I64 U0 SwapI64( - I64 *n1,I64 *n2); //Swap two I64s. Not atomic. -public _intern IC_SWAP_U16 U0 SwapU16( - U16 *n1,U16 *n2); //Swap two U16s. Not atomic. -public _intern IC_SWAP_U32 U0 SwapU32( - U32 *n1,U32 *n2); //Swap two U32s. Not atomic. -public _intern IC_SWAP_U8 U0 SwapU8( - U8 *n1,U8 *n2); //Swap two U8s. Not atomic. -public _intern IC_TAN F64 Tan(F64 d); //Tangent. -public _intern IC_TO_BOOL Bool ToBool(I64 i); //Convert to Boolean. -public _intern IC_TO_F64 F64 ToF64(I64 i); //Convert to F64. -public _intern IC_TO_I64 I64 ToI64(F64 d); //Convert to I64. Truncates. -public _extern _ARG F64 Arg(F64 x,F64 y); //Polar coordinate angle. -public _extern _CEIL F64 Ceil(F64 d); //Ceiling of F64. -public _extern _CLAMP_I64 I64 ClampI64( - I64 num,I64 lo,I64 hi); //Clamp to I64 [] range. -public _extern _CLAMP_U64 U64 ClampU64( - U64 num,U64 lo,U64 hi); //Clamp to U64 [] range. -public _extern _EXP F64 Exp(F64 d); //Exponential function. -_extern _FCLEX U0 Fclex(); -_extern _FLDCW U0 Fldcw(U16 w); -public _extern _FLOOR F64 Floor(F64 d); //Floor of F64. -_extern _FSTCW U16 Fstcw(); -_extern _FSTSW U16 Fstsw(); -public _extern _LN F64 Ln(F64 d); //Logarithm. -public _extern _LOG10 F64 Log10(F64 d); //Log base 10. -public _extern _LOG2 F64 Log2(F64 d); //Log base 2. -public _extern _POW F64 Pow(F64 base,F64 power); //F64 base to a power. -public _extern _POW10 F64 Pow10(F64 d); //Ten to the dth power. -public _extern _ROUND F64 Round(F64 d); //Round F64 to whole number. -public _extern _SIGN F64 Sign(F64 d); //Sign of F64: -1,0,1 -public _extern _TRUNC F64 Trunc(F64 d); //Truncate F64. - -#help_index "Math/CD3;Data Types/CD3" -#help_file "::/Doc/D3" -public _extern _D3_ADD CD3 *D3Add(CD3 *sum,CD3 *d1,CD3 *d2); //sum=d1+d2 -public _extern _D3_ADD_EQU CD3 *D3AddEqu(CD3 *sum,CD3 *d); //sum+=d -public _extern _D3_COPY CD3 *D3Copy(CD3 *dst,CD3 *src); //dst=src -public _extern _D3_CROSS CD3 *D3Cross(CD3 *prod,CD3 *d1,CD3 *d2); //prod=d1xd2 -public _extern _D3_DIST F64 D3Dist(CD3 *d1,CD3 *d2); //Distance -public _extern _D3_DIST_SQR F64 D3DistSqr(CD3 *d1,CD3 *d2); //Distance Squared -public _extern _D3_DIV CD3 *D3Div(CD3 *quot,CD3 *d,F64 s); //quot=d/s -public _extern _D3_DIV_EQU CD3 *D3DivEqu(CD3 *quot,F64 s); //quot/=s -public _extern _D3_DOT F64 D3Dot(CD3 *d1,CD3 *d2); //d1 dot d2 -public _extern _D3_EQU CD3 *D3Equ(CD3 *dst,F64 x,F64 y,F64 z); //dst=(x,y,z) -public _extern _D3_MUL CD3 *D3Mul(CD3 *prod,F64 s,CD3 *d); //prod=s*d -public _extern _D3_MUL_EQU CD3 *D3MulEqu(CD3 *prod,F64 s); //prod*=s -public _extern _D3_NORM F64 D3Norm(CD3 *d); //Norm -public _extern _D3_NORM_SQR F64 D3NormSqr(CD3 *d); //Norm Squared -public _extern _D3_SUB CD3 *D3Sub(CD3 *diff,CD3 *d1,CD3 *d2); //diff=d1-d2 -public _extern _D3_SUB_EQU CD3 *D3SubEqu(CD3 *diff,CD3 *d); //diff-=d -public _extern _D3_UNIT CD3 *D3Unit(CD3 *d); //To unit vect -public _extern _D3_ZERO CD3 *D3Zero(CD3 *dst); //To zero - -#help_index "Memory" -public _extern _MEMCMP I64 MemCmp( - U8 *ptr1,U8 *ptr2,I64 cnt); //Compare chunk of memory. -public _extern _MEMCPY U8 *MemCpy( - U8 *dst,U8 *src,I64 cnt); //Copy chunk of memory. Only goes fwd. -public _extern _MEMSET U8 *MemSet( - U8 *dst,I64 val,I64 cnt); //Set chunk of U8s to value. -public _extern _MEMSET_I64 I64 *MemSetI64( - I64 *dst,I64 val,I64 I64cnt); //Set chunk of I64s to value. -public _extern _MEMSET_U16 U16 *MemSetU16( - U16 *dst,I64 val,I64 U16cnt); //Set chunk of U16s to value. -public _extern _MEMSET_U32 U32 *MemSetU32( - U32 *dst,I64 val,I64 U32cnt); //Set chunk of U32s to value. -public _extern _MEMSET U8 *MemSetU8( - U8 *dst,I64 val,I64 U8cnt); //Set chunk of U8s to value. -_extern SYS_GIG_PAGES U8 sys_gig_pages; -_extern SYS_HEAP_DBG_FLAG U8 sys_heap_dbg; -_extern SYS_HEAP_INIT_FLAG U8 sys_heap_init_flag; -_extern SYS_HEAP_INIT_VAL U8 sys_heap_init_val; -_extern SYS_MEM_INIT_FLAG U8 sys_mem_init_flag; -_extern SYS_MEM_INIT_VAL U8 sys_mem_init_val; -_extern SYS_VAR_INIT_FLAG U8 sys_var_init_flag; -_extern SYS_VAR_INIT_VAL U8 sys_var_init_val; - -#help_index "Memory/BlkPool" -public _extern SYS_CODE_BP CBlkPool *sys_code_bp; //System's BlkPool for code. -public _extern SYS_DATA_BP CBlkPool *sys_data_bp; //System's BlkPool for data. - -#help_index "Memory/Info" -_extern SYS_HEAP_BASE U8 *sys_heap_base; -_extern SYS_HEAP_LIMIT U8 *sys_heap_limit; - -#help_index "Messages;Windows" -public _extern SYS_FOCUS_TASK CTask *sys_focus_task; //Current focus task. - -#help_index "Misc" -public _extern SYS_COMPILE_TIME - CDate sys_compile_time; //Date and time kernel was compiled. -_extern SYS_CTRL_ALT_FLAGS - I64 sys_ctrl_alt_flags[1]; //Should be semiphores? - -#help_index "Misc/Progress Bars" -public _extern SYS_PROGRESS1 I64 progress1; //Current progress 1. -public _extern SYS_PROGRESS1_DESC - U8 progress1_desc[PROGRESS_DESC_LEN]; //Progress 1 desc. -public _extern SYS_PROGRESS1_MAX I64 progress1_max; //Max progress 1. -public _extern SYS_PROGRESS2 I64 progress2; //Current progress 2. -public _extern SYS_PROGRESS2_DESC - U8 progress2_desc[PROGRESS_DESC_LEN]; //Progress 2 desc. -public _extern SYS_PROGRESS2_MAX I64 progress2_max; //Max progress 2. -public _extern SYS_PROGRESS3 I64 progress3; //Current progress 3. -public _extern SYS_PROGRESS3_DESC - U8 progress3_desc[PROGRESS_DESC_LEN]; //Progress 3 desc. -public _extern SYS_PROGRESS3_MAX I64 progress3_max; //Max progress 3. -public _extern SYS_PROGRESS4 I64 progress4; //Current progress 4. -public _extern SYS_PROGRESS4_DESC - U8 progress4_desc[PROGRESS_DESC_LEN]; //Progress 4 desc. -public _extern SYS_PROGRESS4_MAX I64 progress4_max; //Max progress 4. -public _extern SYS_PROGRESSES - CProgress sys_progresses[NUM_PROGRESS_BARS]; //All progress bars. - -#help_index "MultiCore" -#help_file "::/Doc/MultiCore" -public _extern SYS_CPU_STRUCTS CCPU *cpu_structs; //$LK,"Gs",A="MN:Gs"$ points to cur $LK,"CCPU",A="MN:CCPU"$. -public _extern SYS_MP_CNT I64 mp_cnt; //Count of cores -_extern SYS_MP_CNT_INITIAL I64 mp_cnt_initial; //only used during $LK,"Core0StartMP",A="MN:Core0StartMP"$ -_extern SYS_MP_CNT_LOCK I64 mp_cnt_lock; -_extern SYS_SEMAS CSema sys_semas[NUM_SYS_SEMAS]; - -#help_index "MultiCore;Processor" -public _intern IC_GS CCPU *Gs(); //GS points to current $LK,"CCPU",A="MN:CCPU"$. - -#help_index "PCI" -public _extern SYS_PCI_BUSES U16 sys_pci_busses; //Number of PCI buses. - -#help_index "Processor" -public _intern IC_CARRY I64 Carry(); //See $LK,"::/Demo/Carry.CPP"$ -public _intern IC_GET_RAX I64 GetRAX(); //Get RAX register value. -public _intern IC_GET_RBP U8 *GetRBP(); //Get RBP register value. -public _intern IC_GET_RFLAGS I64 GetRFlags(); //Get RFlags register value. -public _intern IC_GET_RSP U8 *GetRSP(); //Get RSP register value. -public _intern IC_POP I64 Pop(); //Pop value from stk. -public _intern IC_PUSH U0 Push(I64 d); //Push value on stk. -public _intern IC_SET_RAX U0 SetRAX(I64 d); //Set RAX register value. -public _intern IC_SET_RBP U0 SetRBP(U8 *d); //Set RBP register value. -public _intern IC_SET_RFLAGS U0 SetRFlags(I64 d); //Set RFlags register value. -public _intern IC_SET_RSP U0 SetRSP(U8 *d); //Set RSP register value. -public _extern _CPUID U0 CPUId( - U32 rax,CRAXRBCRCXRDX *res); //Do CPUID inst. -public _extern _LXCHG_I64 I64 LXchgI64(I64 *dst,I64 d); //Locked eXchange I64s. -public _extern _LXCHG_U16 U16 LXchgU16(U16 *dst,U16 d); //Locked eXchange U16s. -public _extern _LXCHG_U32 U32 LXchgU32(U32 *dst,U32 d); //Locked eXchange U32s. -public _extern _LXCHG_U8 U8 LXchgU8(U8 *dst,U8 d); //Locked eXchange U8s. -public _extern _SET_MSR U0 SetMSR( - I64 model_specific_reg,I64 val); //Model Specific Reg See $LK,"MSRs",A="MN:IA32_EFER"$. -public _extern _SYS_HLT U0 SysHlt(); //Loops doing HLT inst. -public _extern _XCHG_I64 I64 XchgI64(I64 *dst,I64 d); //eXchange I64s. -public _extern _XCHG_U16 U16 XchgU16(U16 *dst,U16 d); //eXchange U16s. -public _extern _XCHG_U32 U32 XchgU32(U32 *dst,U32 d); //eXchange U32s. -public _extern _XCHG_U8 U8 XchgU8(U8 *dst,U8 d); //eXchange U8s. -public _extern SYS_CACHE_LINE_WIDTH - I64 sys_cache_line_width; //CPU's Cache line width. -_extern SYS_GDT CGDT sys_gdt; - -#help_index "Processor/Cache;Memory/Cache" -public _intern IC_CLFLUSH U0 CLFlush(U8 *a); //Flush cache line inst. - -#help_index "Processor/Page Tables;Memory/Page Tables" -public _intern IC_INVLPG - U0 InvlPg(U8 *a); //Invalidate page at addr inst. - -#help_index "Task;Processor" -public _intern IC_FS CTask *Fs(); //FS seg reg points to the current $LK,"CTask",A="MN:CTask"$. - -#help_index "Time/CPU Cycles" -#help_file "::/Doc/TimeCycles" -public _intern IC_RDTSC I64 GetTSC(); //Get time stamp counter. - -#help_index "" diff --git a/Kernel/KernelC.HH b/Kernel/KernelC.HH new file mode 100644 index 0000000..8e60d72 --- /dev/null +++ b/Kernel/KernelC.HH @@ -0,0 +1,759 @@ +#help_index "AutoComplete" +#help_file "::/Doc/AutoComplete" +public extern CAutoCompleteGlbls ac; + +#help_index "AutoComplete/Dictionary" +public extern CAutoCompleteDictGlbls acd; + +#help_index "Bit" +public extern I64 BCnt(I64 d); +public extern U8 *rev_bits_table,*set_bits_table; + +#help_index "Boot" +#help_file "::/Doc/Boot" +public extern U0 Reboot(); + +#help_index "Call" +public argpop extern I64 CallStkGrow(I64 stk_size_threshold,I64 stk_size, + /*argpop*/I64 (*fp_addr)(...),...); +//fp_addr can have any fixed number of arguments. + +#help_index "Call/FarCall32" +public _extern _FAR_CALL32 Bool FarCall32(U0 (*fp_addr)());//Not reentrant +public _extern C32_EAX U32 c32_eax; +public _extern C32_EBX U32 c32_ebx; +public _extern C32_ECX U32 c32_ecx; +public _extern C32_EDI U32 c32_edi; +public _extern C32_EDX U32 c32_edx; +public _extern C32_EFLAGS U32 c32_eflags; +public _extern C32_ESI U32 c32_esi; + +#help_index "Char/BitMaps" +public extern U32 chars_bmp_alpha[16],chars_bmp_alpha_numeric[16], +chars_bmp_alpha_numeric_no_at[16], chars_bmp_word[16], +chars_bmp_dec_numeric[16], chars_bmp_hex_numeric[16], +chars_bmp_white_space[16], chars_bmp_non_eol_white_space[16], +chars_bmp_zero_cr_nl_cursor[16], chars_bmp_zero_tab_ff_cr_nl_cursor[16], +chars_bmp_zero_tab_ff_cr_nl_cursor_dollar[16],chars_bmp_getkey[16], +chars_bmp_macro[16], chars_bmp_printable[16], +chars_bmp_displayable[16], chars_bmp_safe_dollar[16], +chars_bmp_filename[16], chars_bmp_non_eol[16]; + +#help_index "Char/Conversion" +public extern U8 *Char2KeyName(I64 ch,Bool include_ctrl=TRUE); +public extern I64 Char2ScanCode(I64 ch,I64 sc_flags=0); +public extern U8 ScanCode2Char(I64 sc); +public extern U8 *ScanCode2KeyName(I64 sc); +public extern F64 Str2F64(U8 *src,U8 **_end_ptr=NULL); +public extern I64 Str2I64(U8 *st,I64 radix=10,U8 **_end_ptr=NULL); +public extern U8 *StrScan(U8 *src,U8 *fmt,...); + +#help_index "Char/Conversion;Time/Date/CDate;Date/CDate" +public extern CDate Str2Date(U8 *src); + +#help_index "Char/Flags" +public extern U0 ScanFlags(U8 *_dst_flags,U8 *lst,U8 *src); +public extern U8 *StrPrintFlags(U8 *dst,U8 *lst,I64 flags); + +#help_index "Char/Lists" +public extern I64 LstMatch(U8 *needle, U8 *haystack_lst,I64 flags=0); +public extern U8 *LstSub(I64 sub, U8 *lst); + +#help_index "Char/Operations" +public extern U8 *MStrPrint(U8 *fmt,...); +public extern U8 *MStrUtil(U8 *src,I64 flags,F64 indent_scale_factor=0); +public extern U8 *ScaleIndent(U8 *src,F64 indent_scale_factor); +public extern I64 Spaces2Tabs(U8 *dst,U8 *src); +public _extern _STRCMP I64 StrCmp(U8 *st1,U8 *st2); +public _extern _STRCPY U0 StrCpy(U8 *dst,U8 *src); +public extern U8 *StrFind(U8 *needle,U8 *haystack_str,I64 flags=0); +public extern U8 *StrFirstOcc(U8 *src,U8 *marker); +public extern U8 *StrFirstRem(U8 *src,U8 *marker,U8 *dst=NULL); +public _extern _STRICMP I64 StrICmp(U8 *st1,U8 *st2); +public _extern _STRIMATCH U8 *StrIMatch(U8 *needle,U8 *haystack_str); +public extern U8 *StrLastOcc(U8 *src,U8 *marker); +public extern U8 *StrLastRem(U8 *src,U8 *marker,U8 *dst=NULL); +public _extern _STRMATCH U8 *StrMatch(U8 *needle,U8 *haystack_str); +public _extern _STRNCMP I64 StrNCmp(U8 *st1,U8 *st2,I64 n); +public _extern _STRNICMP I64 StrNICmp(U8 *st1,U8 *st2,I64 n); +public extern I64 StrOcc(U8 *src, U8 ch); +public extern U8 *StrPrint(U8 *dst,U8 *fmt,...); +public extern U8 *StrPrintJoin(U8 *dst,U8 *fmt,I64 argc,I64 *argv); +public extern U8 *StrUtil(U8 *_src,I64 flags); +public extern U8 *Tabs2Spaces(U8 *src); +public extern Bool WildMatch(U8 *test_str,U8 *wild_str); + +#help_index "Char/Operations;Memory" +public extern U8 *CatPrint(U8 *dst,U8 *fmt,...); + +#help_index "Char/Operations;Memory/Adam Heap" +public extern U8 *AStrNew(U8 *buf); + +#help_index "Char/Operations;Memory/Heap" +public extern U8 *StrNew(U8 *buf,CTask *mem_task=NULL); + +#help_index "Char/Output;StdOut" +public extern U0 GetOutOfDollar(); +public extern Bool IsSilent(); +public extern U0 Print(U8 *fmt,...); +public extern U0 PrintErr(U8 *fmt,...); +public extern U0 PrintWarn(U8 *fmt,...); +public extern U0 PutChars(U64 ch); +extern U0 PutHex(I64 num,I64 width); +public extern U0 PutKey(I64 ch=0,I64 sc=0); +extern U0 PutS(U8 *st); //Use $LK,"Print",A="MN:Print"$() +public extern Bool Silent(Bool val=ON); +extern U8 *StrPrintHex(U8 *dst,I64 num;I64 width); + +#help_index "Char;Debugging/Raw Output;TextBase Layer/Char" +public extern CTextGlbls text; + +#help_index "Compiler/Lex" +public extern U0 HashSrcFileSet(CCmpCtrl *cc, + CHashSrcSym *h,I64 line_num_offset=0); + +#help_index "Compiler;Cmd Line (Typically)" +extern U8 *Load(U8 *filename,I64 ld_flags=0, + CBinFile *bfh_addr=INVALID_PTR); //INVALID_PTR=don't care what load addr + +#help_index "Compression" +public extern CArcCompress *CompressBuf(U8 *src,I64 size,CTask *mem_task=NULL); +public extern U8 *ExpandBuf(CArcCompress *arc,CTask *mem_task=NULL); + +#help_index "Compression/Piece by Piece" +public extern U0 ArcCompressBuf(CArcCtrl *c); +public extern U0 ArcCtrlDel(CArcCtrl *c); +public extern CArcCtrl *ArcCtrlNew(Bool expand,I64 compression_type=CT_8_BIT); +public extern U0 ArcExpandBuf(CArcCtrl *c); +public extern Bool ArcFinishCompression(CArcCtrl *c); + +#help_index "Data Types/Circular Queue" +public extern I64 QueCnt(CQue *head); +public extern CQue *QueCopy(CQue *head,CTask *mem_task=NULL); +public extern U0 QueDel(CQue *head,Bool querem=FALSE); +public extern I64 QueSize(CQue *head); + +#help_index "Data Types/Fifo" +public extern I64 FifoI64Cnt(CFifoI64 *f); +public extern U0 FifoI64Del(CFifoI64 *f); +public extern U0 FifoI64Flush(CFifoI64 *f); +public extern Bool FifoI64Ins(CFifoI64 *f,I64 q); +public extern CFifoI64 *FifoI64New(I64 size,CTask *mem_task=NULL); +public extern Bool FifoI64Peek(CFifoI64 *f,I64 *_q); +public extern Bool FifoI64Rem(CFifoI64 *f,I64 *_q); +public extern I64 FifoU8Cnt(CFifoU8 *f); +public extern U0 FifoU8Del(CFifoU8 *f); +public extern U0 FifoU8Flush(CFifoU8 *f); +public extern Bool FifoU8Ins(CFifoU8 *f,U8 b); +public extern CFifoU8 *FifoU8New(I64 size,CTask *mem_task=NULL); +public extern Bool FifoU8Peek(CFifoU8 *f,U8 *_b); +public extern Bool FifoU8Rem(CFifoU8 *f,U8 *_b); + +#help_index "Data Types/Linked List" +public extern I64 LinkedLstCnt(U8 **_lst); +public extern U8 *LinkedLstCopy(U8 **_lst,CTask *mem_task=NULL); +public extern U0 LinkedLstDel(U8 **_lst); +public extern I64 LinkedLstSize(U8 **_lst); + +#help_index "Data Types/Queue Vector" +public extern U0 QueVectU8Del(CQueVectU8 *v); +public extern I64 QueVectU8Get(CQueVectU8 *v,I64 idx); +public extern CQueVectU8 *QueVectU8New(I64 min_idx=0); +public extern U0 QueVectU8Put(CQueVectU8 *v,I64 idx,U8 ch); + +#help_index "Debugging" +public extern U8 *Caller(I64 num=1); +public extern Bool ChkCodePtr(U8 *ptr); +public extern Bool ChkOnStk(U8 *ptr,CTask *task=NULL); +public extern Bool ChkPtr(U8 *ptr); +public extern Bool IsSingleUser(); +public extern Bool IsSysDbg(); +public extern Bool SingleUser(Bool val); +public extern Bool SysDbg(Bool val); +public extern U8 *TaskCaller(CTask *task=NULL, + I64 num=0,Bool saved_context=FALSE); +public extern I64 UnusedStk(CTask *task=NULL); +public extern CDbgGlbls dbg; + +#help_index "Debugging/Debugger" +public extern Bool B(U8 *addr,CTask *task=NULL,Bool live=TRUE) //Toggle bpt. +public extern I64 B2(CTask *task=NULL,Bool live=TRUE); +extern CBpt *BptFind(U8 *needle_addr,CTask *haystack_task=NULL,Bool rem=FALSE); +public extern Bool BptR(U8 *addr,CTask *task=NULL,Bool live=TRUE,Bool rem=TRUE); +public extern Bool BptS(U8 *addr,CTask *task=NULL,Bool live=TRUE); +public extern Bool E(U8 *addr,I64 cnt=512,I64 edf_dof_flags=0); +public extern Bool EdLite(U8 *filename,I64 num=1,I64 edf_dof_flags=0); +extern Bool EdLiteFileLine(U8 *fl_file_line,I64 edf_dof_flags=0); +public extern Bool Fix(I64 edf_dof_flags=0); +public extern U0 FixSet(U8 *filename,I64 line); +public extern U0 G(U8 *ip=INVALID_PTR,CTask *task=NULL); +public extern U0 G2(U8 *ip=INVALID_PTR,CTask *task=NULL); +public extern Bool InDbg(Bool val); +public extern Bool IsDbg(); +public extern U0 S(U8 *ip=INVALID_PTR,CTask *task=NULL); + +#help_index "Debugging/Debugger;DolDoc/Cmd Line (Typically);"\ + "Cmd Line (Typically);Help System" +public extern Bool Man(U8 *st,I64 edf_dof_flags=0); + +#help_index "Debugging/Dump" +public extern U0 CallerRep(U8 **rbp=NULL,CTask *task=NULL); +public extern U0 D(U8 *addr,I64 cnt=0x80,Bool show_offset=TRUE); +public extern U0 Da(U8 **addr,I64 cnt=0x10); +public extern U0 Dm(U8 *addr,I64 cnt=0x80); +public extern U0 Dr(CTask *task=NULL); +public extern U0 StkRep(CTask *task=NULL); +extern I64 *TaskRegAddr(CTask *task,I64 reg_num); + +#help_index "Debugging/FunSeg" +#help_file "::/Doc/DbgFunSeg" +public extern Bool PutSrcLink(U8 *addr,I64 cnt=1,U8 *buf=NULL); +public extern U8 *SrcEdLink(U8 *addr,I64 cnt=1,CTask *mem_task=NULL); +public extern U8 *SrcFileName(U8 *addr,I64 cnt=1,CTask *mem_task=NULL); +public extern I64 SrcLineNum(U8 *addr,I64 cnt=1); + +#help_index "Debugging/FunSeg;Hash/System" +public extern CHash *FunSegFind(U8 *addr,I64 *_offset); + +#help_index "Debugging/Raw Output" +public extern Bool IsRaw(); +public extern Bool Raw(Bool val); +public extern U0 RawD(I64 ms=100,U8 *addr,I64 cnt=0x80); +public extern U0 RawDm(I64 ms=100,U8 *addr,I64 cnt=0x80); +extern U0 RawDr(CTask *task=NULL); +public extern U0 RawPrint(I64 ms=100,U8 *fmt,...); +public extern U0 RawPutChar(I64 ch); +public extern U0 VGAFlush(); + +#help_index "Debugging;Debugging/Debugger" +public extern U0 Dbg(U8 *msg=NULL,I64 msg_num=0); + +#help_index "Define;Char/Define" +#help_file "::/Doc/Define" +public extern U8 *Define(U8 *dname); +public extern CHashDefineStr *DefineLoad(U8 *dname,U8 *st); +public extern U0 DefinePrint(U8 *dname,U8 *src,...); + +#help_index "Define;Char/Define;Char/Lists" +public extern I64 DefineCnt(U8 *dname); +public extern CHashDefineStr *DefineLstLoad(U8 *dname,U8 *lst); +public extern I64 DefineMatch(U8 *needle,U8 *haystack_lst_dname,I64 flags=0); +public extern U8 *DefineSub(I64 sub,U8 *dname); + +#help_index "Devices;Memory/Page Tables" +public extern U8 *Mem32DevAlloc(I64 size,I64 alignment); +public extern U0 Mem32DevFree(U8 *base); +public extern U8 *Mem64DevAlloc(I64 *_pages1Gig); +public extern U0 Mem64DevFree(U8 *base,I64 pages1Gig); +public extern CDevGlbls dev; + +#help_index "DolDoc/Clipboard" +public extern CDoc *sys_clipboard_doc; + +#help_index "DolDoc/Task;StdOut/Task" +#help_file "::/Doc/StdOutTask" +extern CDoc *(*fp_doc_put)(CTask *task=NULL); + +#help_index "Exceptions" +public extern Bool BreakLock(CTask *task=NULL); +public extern Bool BreakUnlock(CTask *task=NULL); +public extern U0 PutExcept(Bool catch_it=TRUE); +extern U0 SysTry(U8 *start_label,U8 *skip_label); +extern U0 SysUntry(); +public extern U0 ThrowBreak(CTask *task=NULL); +public extern U0 throw(I64 ch=0,Bool no_log=FALSE); + +#help_index "File/CD DVD" +public extern U0 DVDImageRead(U8 dvd_drv_let,U8 *out_name); +public extern U0 DVDImageWrite(U8 dvd_drv_let, + U8 *in_name=NULL,I64 media_type=MT_DVD); + +#help_index "File/CFile" +public extern U0 FClose(CFile *f); +public extern CFile *FOpen(U8 *filename,U8 *flags,I64 cnt=0); +public extern Bool FRBlks(CFile *f,U8 *buf,I64 blk=FFB_NEXT_BLK,I64 cnt=1); +public extern I64 FSize(CFile *f); +public extern Bool FWBlks(CFile *f,U8 *buf,I64 blk=FFB_NEXT_BLK,I64 cnt=1); + +#help_index "File/Cmd Line (Typically);Cmd Line (Typically)" +public extern Bool Cd(U8 *dirname=NULL,Bool make_dirs=FALSE); +public extern U0 ChgDsk(U8 drv_let=0); +public extern I64 Del(U8 *files_find_mask,Bool make_mask=FALSE, + Bool del_dir=FALSE,Bool print_msg=TRUE); +public extern I64 Dir(U8 *files_find_mask="*",Bool full=FALSE); +public extern Bool Drv(U8 drv_let); +public extern U0 HomeSet(U8 *dirname); +public extern Bool MkDir(U8 *filename,I64 entry_cnt=0); + +#help_index "File/Cmd Line (Typically);Cmd Line (Typically);Install" +public extern Bool DrvMap(U8 drv_let,CDrv *dv); + +#help_index "File/FileNames" +extern CDirEntry *Cd2DirEntry(CDirEntry *tempde,U8 *abs_name); +public extern U8 *ChgExt(U8 *filename,U8 *extension); +public extern U8 *CurDir(CTask *task=NULL,CTask *mem_task=NULL); +public extern U8 *DftExt(U8 *filename,U8 *extension); +public extern U8 *DirFile(U8 *dirname,U8 *name=NULL,U8 *_extension=NULL); +public extern U8 *DirNameAbs(U8 *dirname); +public extern CBlkDev *DrvIsWritable(U8 drv_let=0,Bool except=FALSE); +public extern U8 *FileExtDot(U8 *src); +public extern U8 *FileExtRem(U8 *src,U8 *dst=NULL); +public extern U8 *FileNameAbs(U8 *filename,I64 fuf_flags=0); +public extern Bool FileNameChk(U8 *filename); +public extern Bool FilesFindMatch(U8 *_test_name, + U8 *files_find_mask,I64 fuf_flags=0); +public extern Bool IsDir(U8 *dir_name); +public extern Bool IsDotC(U8 *filename); +public extern Bool IsDotZ(U8 *filename); +public extern U0 PutDirLink(U8 *dirname,U8 *full_name=NULL); +public extern U0 PutFileLink(U8 *filename,U8 *full_name=NULL, + I64 line=0,Bool plain_text=FALSE); +public extern U0 ToFileLine(U8 *_fl_file_line,U8 **_filename,I64 *_linenum); +public extern U8 *ToggleZorNotZ(U8 *name); +#help_index "File/FileNames;Misc" +public extern U8 *FileNameTempTxt(); + +#help_index "File/Internal" +public extern U0 DirContextDel(CDirContext *dirc); +public extern CDirContext *DirContextNew(U8 *mask, + Bool make_mask=FALSE,Bool make_dirs=FALSE,Bool no_mask=FALSE); +public extern Bool DirNew(CDrv *dv,U8 *cur_dir, + CDirEntry *tempde,Bool free_old_chain=TRUE); +extern I64 FileAttr(U8 *name,I64 old_attr=0); + +#help_index "File/Low Level" +#help_file "::/Doc/FileLowLevel" +public extern CBlkDev *BlkDevChk(CBlkDev *bd,Bool except=TRUE); +public extern U0 BlkDevDel(CBlkDev *bd); +public extern Bool BlkDevLock(CBlkDev *bd); +public extern CBlkDev *BlkDevNextFreeSlot(U8 first_drv_let,I64 type); +public extern Bool BlkDevUnlock(CBlkDev *bd,Bool rst=FALSE); +public extern U0 BlkDevsRelease(); +public extern I64 Cluster2Blk(CDrv *dv,I64 c); +public extern I64 ClusterNumNext(CDrv *dv,I64 c,I64 cnt=1); +public extern I64 ClustersAlloc(CDrv *dv,I64 c=0, + I64 cnt=1,Bool contiguous=FALSE); +extern Bool CopySingle(U8 *f1,U8 *f2); //Just one file +public extern U8 Drv2Let(CDrv *dv=NULL); +public extern CDrv *DrvChk(CDrv *dv,Bool except=TRUE); +public extern U0 DrvDel(CDrv *dv); +public extern Bool DrvLock(CDrv *dv); +public extern CDrv *DrvMakeFreeSlot(U8 drv_let); +public extern U8 *DrvModelNum(U8 drv_let=0); +public extern U8 DrvNextFreeLet(U8 first_drv_let='C'); +public extern U8 *DrvSerialNum(U8 drv_let=0); +public extern U8 DrvTextAttrGet(U8 drv_let=0); +public extern Bool DrvUnlock(CDrv *dv,Bool rst=FALSE); +public extern U0 DrvsRelease(); +extern U0 FAT32FreeClusters(CDrv *dv,I64 c); +public extern CBlkDev *Let2BlkDev(U8 drv_let=0,Bool except=TRUE); +public extern I64 Let2BlkDevType(U8 drv_let); +public extern CDrv *Let2Drv(U8 drv_let=0,Bool except=TRUE); +extern I64 Name2DirCluster(CDrv *dv,U8 *dirname); +extern I64 Name2ParentDirCluster(CDrv *dv,U8 *dirname); +public extern Bool RBlks(CDrv *dv,U8 *buf, I64 blk, I64 cnt); +public extern I64 RClusters(CDrv *dv,U8 *buf,I64 c,I64 cnt); +public extern I64 RClustersBlks(CDrv *dv,U8 *buf,I64 c,I64 blks); +extern U0 RedSeaFreeClusters(CDrv *dv,I64 c,I64 cnt); +public extern Bool WBlks(CDrv *dv,U8 *buf, I64 blk, I64 cnt); +public extern I64 WClusters(CDrv *dv,U8 *buf,I64 c,I64 cnt); +public extern I64 WClustersBlks(CDrv *dv,U8 *buf,I64 c,I64 blks); +public extern U0 WZeroBlks(CDrv *dv,I64 blk,I64 cnt); + +#help_index "File/Program Routines" +public extern U0 DirEntryDel(CDirEntry *tempde); +public extern U0 DirEntryDel2(CDirEntry *tempde); +public extern U0 DirTreeDel(CDirEntry *tempde); +public extern U0 DirTreeDel2(CDirEntry *tempde); +public extern Bool FileFind(U8 *filename,CDirEntry *_de=NULL,I64 fuf_flags=0); +public extern U8 *FileRead(U8 *filename,I64 *_size=NULL,I64 *_attr=NULL); +public extern I64 FileWrite(U8 *filename, + U8 *fbuf,I64 size,CDate cdt=0,I64 attr=0); + +#help_index "File/Program Routines;File/FileNames" +public extern CDirEntry *FilesFind(U8 *files_find_mask,I64 fuf_flags=0); + +#help_index "File/System" +public extern CATARep *ATAIDDrvs(CATARep *head,CATARep **_ata_drv, + CATARep **_atapi_drv); +extern CBlkDev *ATAMount(U8 first_drv_let, + I64 type,I64 base0,I64 base1,I64 unit); +extern Bool ATAPIStartStop(CBlkDev *bd,F64 timeout,Bool start); +extern I64 ATAProbe(I64 base0,I64 base1,I64 unit); +extern U0 ATAReadBlks(CBlkDev *bd,U8 *buf, I64 blk, I64 cnt); +extern U0 ATAWriteBlks(CBlkDev *bd,U8 *buf, I64 blk, I64 cnt); +public extern I64 AutoMountIDE(); +extern I64 BlkDevAdd(CBlkDev *bd,Bool one_drv,Bool make_free); +extern U0 DskCacheInit(I64 size_in_U8s); +public extern U0 DskCacheInvalidate(CDrv *dv); +public extern CBlkDevGlbls blkdev; + +#help_index "Graphics/Color" +extern U0 (*fp_set_std_palette)(); +public extern U8 *Color2Str(U8 *buf,CColorROPU32 c); +public extern CColorROPU16 Str2ColorU16(U8 *st); +public extern CColorROPU32 Str2ColorU32(U8 *st); + +#help_index "Hash" +#help_file "::/Doc/Hash" +public _extern _HASH_ADD U0 HashAdd(CHash *temph,CHashTable *table); +public _extern _HASH_ADD_AFTER U0 HashAddAfter(CHash *temph, + CHash *pred,CHashTable *table); //Add hash entry after entry. +public _extern _HASH_BUCKET_FIND CHash **HashBucketFind( + U8 *needle_str,CHashTable *haystack_table); +public _extern _HASH_FIND CHash *HashFind(U8 *needle_str, + CHashTable *haystack_table,I64 mask,I64 instance=1); +public _extern _HASH_SINGLE_TABLE_FIND CHash *HashSingleTableFind( + U8 *needle_str,CHashTable *haystack_table,I64 mask,I64 instance=1); +public _extern _HASH_STR I64 HashStr(U8 *st); +public extern CHashTable *HashTableNew(I64 size,CTask *mem_task=NULL); + +#help_index "Hash/Frame" +#help_file "::/Doc/Frame" +public extern I64 FramePtr(U8 *name,CTask *task=NULL); +public extern CHashGeneric *FramePtrAdd(U8 *name,I64 val=0,CTask *task=NULL); +public extern I64 FramePtrDel(U8 *name,CTask *task=NULL); +public extern I64 FramePtrSet(U8 *name,I64 val,CTask *task=NULL); + +#help_index "Hash/System" +public extern U0 HashDel(CHashSrcSym *temph); +public extern CHashGeneric *HashGenericAdd(U8 *name, + I64 type,I64 val=0,I64 u8=0,I64 u16=0,CTask *task=NULL); +public extern CHashGeneric *HashPublic(U8 *st,I64 mask,Bool val=TRUE); +public _extern _HASH_REM_DEL Bool HashRemDel(CHash *temph,CHashTable *table, + I64 instance=1);//instance must match temph's +public extern U0 HashTableDel(CHashTable *table); +public extern I64 HashTablePurge(CHashTable *table); +public extern I64 HashTypeNum(CHash *temph); +public extern I64 HashVal(CHash *temph); +extern U0 SysSymImportsResolve(U8 *sptr,I64 ld_flags=0); + +#help_index "Hash/System;Char/Lists" +public extern I64 HashLstAdd(U8 *lst,I64 type,CHashTable *table); + +#help_index "Hash/System;Define;Char/Define;Char/Lists" +public extern I64 HashDefineLstAdd(U8 *dname,I64 type,CHashTable *table); + +#help_index "Help System;Debugging/Debugger" +public extern U0 Help(); + +#help_index "Info;File/Cmd Line (Typically);Cmd Line (Typically);Install" +public extern U0 DrvRep(); + +#help_index "Input Pointer" +#help_file "::/Doc/InputPointer" +public extern U0 GridInit(); +public extern U0 IPSet(I64 x=MAX_I64,I64 y=MAX_I64,I64 z=MAX_I64, + I64 l=MAX_I64,I64 r=MAX_I64); +public extern CIPStateGlbls ip; +public extern CGridGlbls ip_grid; +extern CIPStateGlbls ip_last; + +#help_index "Input Pointer/Displayed Image" +extern U0 IPVarsInit(); +extern U0 IPVarsUpdate(I64 x,I64 y,I64 z,Bool l,Bool r); + +#help_index "Input Pointer/Mouse" +public extern CMouseStateGlbls mouse; +extern CMouseStateGlbls mouse_last; + +#help_index "Install" +#help_file "::/Doc/Install" +extern CATARep *ATARepFind(CATARep *haystack_head,I64 needle_num); +public extern Bool DrvEnable(U8 drv_let,Bool val); + +#help_index "Install;File/Cmd Line (Typically);Cmd Line (Typically);" +public extern U0 Fmt(U8 drv_let,Bool quick=TRUE, + Bool confirm=TRUE,I64 type=FSt_FAT32); + +#help_index "Install;Memory/BlkPool" +public extern I64 Scale2Mem(I64 min,I64 max,I64 limit=2*1024*1024*1024); + +#help_index "Keyboard Devices/System;Char/System" +#help_file "::/Doc/KeyDev" +public extern U0 CtrlAltCBSet(U8 ch,U0 (*fp_handler)(I64 sc), + U8 *no_shift_desc=NULL,U8 *shift_desc=NULL,Bool in_irq=FALSE); +public extern U0 KeyDescSet(U8 *fmt,...); +public extern CKeyDevEntry *KeyDevAdd(Bool (*fp_put_key)(I64 ch,I64 sc), + Bool (*fp_puts)(U8 *st),I64 priority,Bool key_descs=FALSE); +public extern U0 KeyDevRem(CKeyDevEntry *tempp); +extern CKeyDevGlbls keydev; +extern CSrvCmd sys_macro_head; +extern CTask *sys_macro_task; + +#help_index "Keyboard Devices;Char/Input;StdIn" +extern U8 *(*fp_getstr2)(I64 flags=0); //GetStr $LK,"Flags",A="MN:GSF_SHIFT_ESC_EXIT"$ +public extern Bool AreYouSure(); +public extern I64 GetChar(I64 *_scan_code=NULL,Bool echo=TRUE, + Bool raw_cursor=FALSE); +public extern I64 GetKey(I64 *_scan_code=NULL,Bool echo=FALSE, + Bool raw_cursor=FALSE); +public extern I64 GetS(U8 *buf,I64 size,Bool allow_ext=TRUE); +public extern U8 *GetStr(U8 *msg=NULL,U8 *dft=NULL,I64 flags=0); +extern U0 KbdInit(); +public extern I64 KbdMouseEvtTime(); +extern U0 KbdMouseHandler(Bool poll_kbd,Bool poll_mouse); +extern U0 KbdMouseVarsInit(); +extern I64 KbdMsgsQue(); +public extern U0 KbdTypeMatic(U8 delay); +extern Bool MouseDriverInstall(); +public extern I64 PressAKey(); +public extern I64 ScanChar(); +public extern Bool ScanKey(I64 *_ch=NULL,I64 *_scan_code=NULL,Bool echo=FALSE); +public extern Bool YorN(); +public extern CKbdStateGlbls kbd; + +#help_index "Math" +public extern I64 CeilI64(I64 num,I64 to); +public extern U64 CeilU64(U64 num,U64 to); +public extern F64 Clamp(F64 d,F64 lo,F64 hi); +public extern I64 FloorI64(I64 num,I64 to); +public extern U64 FloorU64(U64 num,U64 to); +public extern F64 Max(F64 n1,F64 n2); +public extern F64 Min(F64 n1,F64 n2); +public extern F64 Pow10I64(I64 i); +public extern F64 Rand(); //With timestamp +public extern I16 RandI16(); +public extern I32 RandI32(); +public extern I64 RandI64(); +public extern U16 RandU16(); +public extern U32 RandU32(); +public extern U64 RandU64(); +public extern I64 RoundI64(I64 num,I64 to); +public extern I64 Seed(I64 seed=0,CTask *task=NULL); + +#help_index "Memory/Adam Heap" +public extern U8 *ACAlloc(I64 size); +public extern U8 *AMAlloc(I64 size); +public extern U8 *AMAllocIdent(U8 *src); + +#help_index "Memory/BlkPool" +public extern U0 BlkPoolAdd(CBlkPool *bp,CMemBlk *m,I64 pages512); +public extern U0 BlkPoolInit(CBlkPool *bp,I64 pages512); +public extern U8 *Mem512Alloc(I64 pages512,CBlkPool *bp=NULL); +public extern U0 Mem512Free(CMemBlk *m,CBlkPool *bp=NULL); + +#help_index "Memory/Heap" +public extern U8 *CAlloc(I64 size,CTask *mem_task=NULL); +public extern U8 *CAllocAligned(I64 size,I64 alignment, + CTask *mem_task=NULL,I64 misalignment=0); +public _extern _FREE U0 Free(U8 *addr); +public _extern _MALLOC U8 *MAlloc(I64 size,CTask *mem_task=NULL); +public extern U8 *MAllocAligned(I64 size,I64 alignment, + CTask *mem_task=NULL,I64 misalignment=0); +public extern U8 *MAllocIdent(U8 *src,CTask *mem_task=NULL); +public _extern _MHEAP_CTRL CHeapCtrl *MHeapCtrl(U8 *src); +public _extern _MSIZE I64 MSize(U8 *src); //size of heap object +public _extern _MSIZE2 I64 MSize2(U8 *src); //Internal size + +#help_index "Memory/HeapCtrl" +public extern U0 HeapCtrlDel(CHeapCtrl *hc); +public extern CHeapCtrl *HeapCtrlInit(CHeapCtrl *hc=NULL, + CTask *task=NULL,CBlkPool *bp); + +#help_index "Memory/Page Tables" +public extern Bool MemPagePresentMark(U8 *a,Bool val); +public extern I64 MemPageSize(U8 *a); +public extern I64 *MemPageTable(U8 *a); + +#help_index "Messages" +#help_file "::/Doc/Msgs" +public extern I64 FlushMsgs(CTask *task=NULL); +public extern I64 GetMsg(I64 *_a1=NULL,I64 *_a2=NULL, + I64 mask=~1,CTask *task=NULL); +extern U0 InputFilterTask(); +public extern I64 ScanMsg(I64 *_a1=NULL,I64 *_a2=NULL, + I64 mask=~1,CTask *task=NULL); + +#help_index "Misc" +public extern I64 EndianI64(I64 d); +public extern U16 EndianU16(U16 d); +public extern U32 EndianU32(U32 d); +public extern U0 QSort(U8 *base,I64 num, I64 width, + I64 (*fp_compare)(U8 *e1,U8 *e2)); +public extern U0 QSortI64(I64 *base,I64 num, + I64 (*fp_compare)(I64 e1,I64 e2)); + +#help_index "Misc/Progress Bars" +public extern U0 ProgressBarsRst(); + +#help_index "MultiCore" +extern U0 Core0StartMP(); +extern U0 CoreAPSethTask(); +public extern U0 MPInt(U8 num,I64 cpu_num=1); +public extern U0 MPIntAll(U8 num); +public extern U0 MPNMInt(); +extern CTask *SpawnQue(U0 (*fp_addr)(U8 *data),U8 *data=NULL, + U8 *task_name=NULL,I64 target_cpu, + CTask *parent=NULL, //NULL means adam + I64 stk_size=0,I64 flags=1<display_flags,DISPLAYf_SILENT)) { - if (kbd.scan_code & SCF_SCROLL && sys_focus_task==Fs) - while (kbd.scan_code & SCF_SCROLL) - Yield; //Wait on SCROLL LOCK Key - while (tempp!=&keydev.put_key_head) { - if ((!(sc&SCF_KEY_DESC) || tempp->flags & KDF_HAS_DESCS) && - (*tempp->put_key)(ch,sc)) - break; - tempp=tempp->next; - } - } - } -} - -U0 PutChars(U64 ch) -{//Output chars. Up to 8 chars in a single U64. -//Don't use this. $LK,"See Print() shortcut.",A="FF:::/Doc/HolyC.TXT,DemoHolyC"$ - while (ch) { - PutKey(ch&255,0); - ch>>=8; - } -} - -U0 PutS(U8 *st) -{//Use $LK,"Print",A="MN:Print"$(). See $LK,"Keyboard Devices",A="HI:Keyboard Devices/System"$. -//Don't use this. $LK,"See Print() shortcut.",A="FF:::/Doc/HolyC.TXT,DemoHolyC"$ - I64 ch; - U8 *ptr; - Bool cont=TRUE; - if (!st) return; - CKeyDevEntry *tempp=keydev.put_key_head.next; - if (!Bt(&Fs->display_flags,DISPLAYf_SILENT)) { - if (kbd.scan_code & SCF_SCROLL && sys_focus_task==Fs) - while (kbd.scan_code & SCF_SCROLL) - Yield; - while (cont && tempp!=&keydev.put_key_head) { - if (tempp->put_s) { - if ((*tempp->put_s)(st)) - break; - } else { - ptr=st; - while (ch=*ptr++) - if ((*tempp->put_key)(ch,0)) - cont=FALSE; - } - tempp=tempp->next; - } - } -} - -U0 KeyDescSet(U8 *fmt,...) -{//Call this from key handler to report desc in $LK,"KeyMap",A="MN:KeyMap"$(). - U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); - StrCpy(keydev.desc,buf); - keydev.handler=Caller; - Free(buf); -} - -U0 KeyDevRem(CKeyDevEntry *tempp) -{//Remove StdOut hook and free. - QueRem(tempp); - Free(tempp); -} - -CKeyDevEntry *KeyDevAdd(Bool (*fp_put_key)(I64 ch,I64 sc), - Bool (*fp_puts)(U8 *st),I64 priority,Bool key_descs=FALSE) -{//Places hook in StdOut chain. See $LK,"Keyboard Devices",A="HI:Keyboard Devices/System"$. - CKeyDevEntry *tempp=keydev.put_key_head.last, - *tempp1=ACAlloc(sizeof(CKeyDevEntry)); - tempp1->put_key=fp_put_key; - tempp1->put_s=fp_puts; - tempp1->priority=priority; - if (key_descs) - tempp1->flags|=KDF_HAS_DESCS; - while (tempp->priority>priority) - tempp=tempp->last; - QueIns(tempp1,tempp); - if (tempp->priority==priority) - KeyDevRem(tempp); - return tempp1; -} - -Bool KDRawPutKey(I64 ch,I64) -{ - if (IsRaw) { - RawPutChar(ch); - return TRUE; - } else - return FALSE; -} - -Bool KDRawPutS(U8 *st) -{ - I64 ch; - if (IsRaw) { - while (ch=*st++) - RawPutChar(ch); - return TRUE; - } else - return FALSE; -} - -Bool KDInputFilterPutKey(I64 ch,I64 scan_code) -{ - if (Bt(&Fs->task_flags,TASKf_INPUT_FILTER_TASK)) { - Msg(MSG_KEY_DOWN,ch,scan_code); - return TRUE; - } else - return FALSE; -} - -Bool KDInputFilterPutS(U8 *st) -{ - I64 ch; - if (Bt(&Fs->task_flags,TASKf_INPUT_FILTER_TASK)) { - while (ch=*st++) - Msg(MSG_KEY_DOWN,ch,0); - return TRUE; - } else - return FALSE; -} - -U0 CtrlAltDel(I64) -{ - LBts(sys_ctrl_alt_flags,SYSf_CTRL_ALT_DEL); -} - -U0 CtrlAltC(I64) -{ - LBts(sys_ctrl_alt_flags,SYSf_CTRL_ALT_C); -} - -U0 CtrlAltD(I64) -{ - if (!IsDbg) { - if (Fs==Gs->idle_task) - BptS(sys_winmgr_task->rip,sys_winmgr_task); - else - BptS(*keydev.ctrl_alt_ret_addr); - } -} - -U0 CtrlAltF(I64) -{ - SwapI64(&text.font,&text.aux_font); -} - -U0 CtrlAltM(I64) -{ - Mute(!IsMute); -} - -U0 CtrlAltN(I64) -{ - LBts(sys_ctrl_alt_flags,SYSf_CTRL_ALT_TAB); -} - -U0 CtrlAltT(I64) -{ - User; -} - -U0 CtrlAltV(I64) -{ - VGAFlush; -} - -U0 CtrlAltX(I64) -{ - LBts(sys_ctrl_alt_flags,SYSf_CTRL_ALT_X); -} - -U0 CtrlAltCBSet(U8 ch,U0 (*fp_handler)(I64 sc), - U8 *no_shift_desc=NULL,U8 *shift_desc=NULL,Bool in_irq=FALSE) -{//Set callback for . - ch=ToUpper(ch)-'A'; - if (ch<26) { - keydev.fp_ctrl_alt_cbs[ch]=fp_handler; - - Free(keydev.ctrl_alt_no_shift_descs[ch]); - if (no_shift_desc) - keydev.ctrl_alt_no_shift_descs[ch]=AStrNew(no_shift_desc); - else - keydev.ctrl_alt_no_shift_descs[ch]=NULL; - - Free(keydev.ctrl_alt_shift_descs[ch]); - if (shift_desc) - keydev.ctrl_alt_shift_descs[ch]=AStrNew(shift_desc); - else - keydev.ctrl_alt_shift_descs[ch]=NULL; - - BEqu(&keydev.ctrl_alt_in_irq_flags,ch,in_irq); - } -} - -U0 KeyDevInit() -{ - keydev.fp_ctrl_alt_cbs =CAlloc(26*sizeof(U8 *)); - keydev.ctrl_alt_no_shift_descs=CAlloc(26*sizeof(U8 *)); - keydev.ctrl_alt_shift_descs =CAlloc(26*sizeof(U8 *)); - keydev.ctrl_alt_in_irq_flags =0; - MemSet(&keydev.put_key_head,0,sizeof(CKeyDevEntry)); - QueInit(&keydev.put_key_head); - KeyDevAdd(&KDInputFilterPutKey,&KDInputFilterPutS,0x40000000,FALSE); - KeyDevAdd(&KDRawPutKey,&KDRawPutS,0x60000000,FALSE); - CtrlAltCBSet('C',&CtrlAltC,"Cmd /Break Execution",,TRUE); - CtrlAltCBSet('D',&CtrlAltD,"Cmd /Enter Debugger",,TRUE); - CtrlAltCBSet('F',&CtrlAltF,"Cmd /Toggle Aux Font"); - CtrlAltCBSet('M',&CtrlAltM,"Cmd /Toggle Mute"); - CtrlAltCBSet('N',&CtrlAltN,"Cmd /Next Focus Task",,TRUE); - CtrlAltCBSet('T',&CtrlAltT,"Cmd /Terminal Window"); - CtrlAltCBSet('V',&CtrlAltV,"Cmd /VGA Flush",,TRUE); - CtrlAltCBSet('X',&CtrlAltX,"Cmd /Kill Focused Task",,TRUE); -} diff --git a/Kernel/KeyDev.HC b/Kernel/KeyDev.HC new file mode 100644 index 0000000..d98fe5f --- /dev/null +++ b/Kernel/KeyDev.HC @@ -0,0 +1,219 @@ +U0 PutKey(I64 ch=0,I64 sc=0) +{//See $LK,"Keyboard Devices",A="HI:Keyboard Devices/System"$. + CKeyDevEntry *tempp; + if (ch||sc) { + tempp=keydev.put_key_head.next; + if (!Bt(&Fs->display_flags,DISPLAYf_SILENT)) { + if (kbd.scan_code & SCF_SCROLL && sys_focus_task==Fs) + while (kbd.scan_code & SCF_SCROLL) + Yield; //Wait on SCROLL LOCK Key + while (tempp!=&keydev.put_key_head) { + if ((!(sc&SCF_KEY_DESC) || tempp->flags & KDF_HAS_DESCS) && + (*tempp->put_key)(ch,sc)) + break; + tempp=tempp->next; + } + } + } +} + +U0 PutChars(U64 ch) +{//Output chars. Up to 8 chars in a single U64. +//Don't use this. $LK,"See Print() shortcut.",A="FF:::/Doc/HolyC.DD,DemoHolyC"$ + while (ch) { + PutKey(ch&255,0); + ch>>=8; + } +} + +U0 PutS(U8 *st) +{//Use $LK,"Print",A="MN:Print"$(). See $LK,"Keyboard Devices",A="HI:Keyboard Devices/System"$. +//Don't use this. $LK,"See Print() shortcut.",A="FF:::/Doc/HolyC.DD,DemoHolyC"$ + I64 ch; + U8 *ptr; + Bool cont=TRUE; + if (!st) return; + CKeyDevEntry *tempp=keydev.put_key_head.next; + if (!Bt(&Fs->display_flags,DISPLAYf_SILENT)) { + if (kbd.scan_code & SCF_SCROLL && sys_focus_task==Fs) + while (kbd.scan_code & SCF_SCROLL) + Yield; + while (cont && tempp!=&keydev.put_key_head) { + if (tempp->put_s) { + if ((*tempp->put_s)(st)) + break; + } else { + ptr=st; + while (ch=*ptr++) + if ((*tempp->put_key)(ch,0)) + cont=FALSE; + } + tempp=tempp->next; + } + } +} + +U0 KeyDescSet(U8 *fmt,...) +{//Call this from key handler to report desc in $LK,"KeyMap",A="MN:KeyMap"$(). + U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); + StrCpy(keydev.desc,buf); + keydev.handler=Caller; + Free(buf); +} + +U0 KeyDevRem(CKeyDevEntry *tempp) +{//Remove StdOut hook and free. + QueRem(tempp); + Free(tempp); +} + +CKeyDevEntry *KeyDevAdd(Bool (*fp_put_key)(I64 ch,I64 sc), + Bool (*fp_puts)(U8 *st),I64 priority,Bool key_descs=FALSE) +{//Places hook in StdOut chain. See $LK,"Keyboard Devices",A="HI:Keyboard Devices/System"$. + CKeyDevEntry *tempp=keydev.put_key_head.last, + *tempp1=ACAlloc(sizeof(CKeyDevEntry)); + tempp1->put_key=fp_put_key; + tempp1->put_s=fp_puts; + tempp1->priority=priority; + if (key_descs) + tempp1->flags|=KDF_HAS_DESCS; + while (tempp->priority>priority) + tempp=tempp->last; + QueIns(tempp1,tempp); + if (tempp->priority==priority) + KeyDevRem(tempp); + return tempp1; +} + +Bool KDRawPutKey(I64 ch,I64) +{ + if (IsRaw) { + RawPutChar(ch); + return TRUE; + } else + return FALSE; +} + +Bool KDRawPutS(U8 *st) +{ + I64 ch; + if (IsRaw) { + while (ch=*st++) + RawPutChar(ch); + return TRUE; + } else + return FALSE; +} + +Bool KDInputFilterPutKey(I64 ch,I64 scan_code) +{ + if (Bt(&Fs->task_flags,TASKf_INPUT_FILTER_TASK)) { + Msg(MSG_KEY_DOWN,ch,scan_code); + return TRUE; + } else + return FALSE; +} + +Bool KDInputFilterPutS(U8 *st) +{ + I64 ch; + if (Bt(&Fs->task_flags,TASKf_INPUT_FILTER_TASK)) { + while (ch=*st++) + Msg(MSG_KEY_DOWN,ch,0); + return TRUE; + } else + return FALSE; +} + +U0 CtrlAltDel(I64) +{ + LBts(sys_ctrl_alt_flags,SYSf_CTRL_ALT_DEL); +} + +U0 CtrlAltC(I64) +{ + LBts(sys_ctrl_alt_flags,SYSf_CTRL_ALT_C); +} + +U0 CtrlAltD(I64) +{ + if (!IsDbg) { + if (Fs==Gs->idle_task) + BptS(sys_winmgr_task->rip,sys_winmgr_task); + else + BptS(*keydev.ctrl_alt_ret_addr); + } +} + +U0 CtrlAltF(I64) +{ + SwapI64(&text.font,&text.aux_font); +} + +U0 CtrlAltM(I64) +{ + Mute(!IsMute); +} + +U0 CtrlAltN(I64) +{ + LBts(sys_ctrl_alt_flags,SYSf_CTRL_ALT_TAB); +} + +U0 CtrlAltT(I64) +{ + User; +} + +U0 CtrlAltV(I64) +{ + VGAFlush; +} + +U0 CtrlAltX(I64) +{ + LBts(sys_ctrl_alt_flags,SYSf_CTRL_ALT_X); +} + +U0 CtrlAltCBSet(U8 ch,U0 (*fp_handler)(I64 sc), + U8 *no_shift_desc=NULL,U8 *shift_desc=NULL,Bool in_irq=FALSE) +{//Set callback for . + ch=ToUpper(ch)-'A'; + if (ch<26) { + keydev.fp_ctrl_alt_cbs[ch]=fp_handler; + + Free(keydev.ctrl_alt_no_shift_descs[ch]); + if (no_shift_desc) + keydev.ctrl_alt_no_shift_descs[ch]=AStrNew(no_shift_desc); + else + keydev.ctrl_alt_no_shift_descs[ch]=NULL; + + Free(keydev.ctrl_alt_shift_descs[ch]); + if (shift_desc) + keydev.ctrl_alt_shift_descs[ch]=AStrNew(shift_desc); + else + keydev.ctrl_alt_shift_descs[ch]=NULL; + + BEqu(&keydev.ctrl_alt_in_irq_flags,ch,in_irq); + } +} + +U0 KeyDevInit() +{ + keydev.fp_ctrl_alt_cbs =CAlloc(26*sizeof(U8 *)); + keydev.ctrl_alt_no_shift_descs=CAlloc(26*sizeof(U8 *)); + keydev.ctrl_alt_shift_descs =CAlloc(26*sizeof(U8 *)); + keydev.ctrl_alt_in_irq_flags =0; + MemSet(&keydev.put_key_head,0,sizeof(CKeyDevEntry)); + QueInit(&keydev.put_key_head); + KeyDevAdd(&KDInputFilterPutKey,&KDInputFilterPutS,0x40000000,FALSE); + KeyDevAdd(&KDRawPutKey,&KDRawPutS,0x60000000,FALSE); + CtrlAltCBSet('C',&CtrlAltC,"Cmd /Break Execution",,TRUE); + CtrlAltCBSet('D',&CtrlAltD,"Cmd /Enter Debugger",,TRUE); + CtrlAltCBSet('F',&CtrlAltF,"Cmd /Toggle Aux Font"); + CtrlAltCBSet('M',&CtrlAltM,"Cmd /Toggle Mute"); + CtrlAltCBSet('N',&CtrlAltN,"Cmd /Next Focus Task",,TRUE); + CtrlAltCBSet('T',&CtrlAltT,"Cmd /Terminal Window"); + CtrlAltCBSet('V',&CtrlAltV,"Cmd /VGA Flush",,TRUE); + CtrlAltCBSet('X',&CtrlAltX,"Cmd /Kill Focused Task",,TRUE); +} diff --git a/Kernel/Mem/BlkPool.CPP b/Kernel/Mem/BlkPool.HC similarity index 100% rename from Kernel/Mem/BlkPool.CPP rename to Kernel/Mem/BlkPool.HC diff --git a/Kernel/Mem/HeapCtrl.CPP b/Kernel/Mem/HeapCtrl.CPP deleted file mode 100644 index e259540..0000000 --- a/Kernel/Mem/HeapCtrl.CPP +++ /dev/null @@ -1,33 +0,0 @@ -CHeapCtrl *HeapCtrlInit(CHeapCtrl *hc=NULL,CTask *task=NULL,CBlkPool *bp) -{//See $LK,"HeapLog",A="MN:HeapLog"$() for an example. -//Duplicated for $LK,"Adam Task",A="FF:::/Kernel/KStart64.CPP,CHeapCtrl.bp"$. - if (!hc) - hc=ACAlloc(sizeof(CHeapCtrl)); - hc->hc_signature=HEAP_CTRL_SIGNATURE_VAL; - hc->mem_task=task; - hc->bp=bp; - QueInit(&hc->next_mem_blk); - hc->last_mergable=NULL; - hc->next_um=hc->last_um=(&hc->next_um)(U8 *)-offset(CMemUsed.next); - return hc; -} - -U0 HeapCtrlDel(CHeapCtrl *hc) -{//Free all blks alloced to a HeapCtrl. - CMemBlk *m,*m1; - if (hc) { - PUSHFD - CLI - while (LBts(&hc->locked_flags,HClf_LOCKED)) - PAUSE - m=hc->next_mem_blk; - while (m!=&hc->next_mem_blk) { - m1=m->next; - Mem512TaskFree(m,hc); - m=m1; - } - LBtr(&hc->locked_flags,HClf_LOCKED); - POPFD - Free(hc); - } -} diff --git a/Kernel/Mem/HeapCtrl.HC b/Kernel/Mem/HeapCtrl.HC new file mode 100644 index 0000000..d4e2939 --- /dev/null +++ b/Kernel/Mem/HeapCtrl.HC @@ -0,0 +1,33 @@ +CHeapCtrl *HeapCtrlInit(CHeapCtrl *hc=NULL,CTask *task=NULL,CBlkPool *bp) +{//See $LK,"HeapLog",A="MN:HeapLog"$() for an example. +//Duplicated for $LK,"Adam Task",A="FF:::/Kernel/KStart64.HC,CHeapCtrl.bp"$. + if (!hc) + hc=ACAlloc(sizeof(CHeapCtrl)); + hc->hc_signature=HEAP_CTRL_SIGNATURE_VAL; + hc->mem_task=task; + hc->bp=bp; + QueInit(&hc->next_mem_blk); + hc->last_mergable=NULL; + hc->next_um=hc->last_um=(&hc->next_um)(U8 *)-offset(CMemUsed.next); + return hc; +} + +U0 HeapCtrlDel(CHeapCtrl *hc) +{//Free all blks alloced to a HeapCtrl. + CMemBlk *m,*m1; + if (hc) { + PUSHFD + CLI + while (LBts(&hc->locked_flags,HClf_LOCKED)) + PAUSE + m=hc->next_mem_blk; + while (m!=&hc->next_mem_blk) { + m1=m->next; + Mem512TaskFree(m,hc); + m=m1; + } + LBtr(&hc->locked_flags,HClf_LOCKED); + POPFD + Free(hc); + } +} diff --git a/Kernel/Mem/MAllocFree.CPP b/Kernel/Mem/MAllocFree.CPP deleted file mode 100644 index ee74c77..0000000 --- a/Kernel/Mem/MAllocFree.CPP +++ /dev/null @@ -1,464 +0,0 @@ -asm { -//************************************ -//See $LK,"::/Doc/Credits.TXT"$. -_MALLOC:: -// Throws 'OutMem' - PUSH RBP - MOV RBP,RSP - PUSH RSI - PUSH RDI - - XOR RBX,RBX - MOV RDX,U64 SF_ARG2[RBP] - TEST RDX,RDX - JNZ @@05 - MOV RDX,U64 FS:CTask.addr[RBX] -@@05: CMP U32 CTask.task_signature[RDX],TASK_SIGNATURE_VAL - -#assert CTask.task_signature==CHeapCtrl.hc_signature //location signature same - - JNE @@10 - MOV RDX,U64 CTask.data_heap[RDX] -@@10: CMP U32 CHeapCtrl.hc_signature[RDX],HEAP_CTRL_SIGNATURE_VAL - JE @@15 - PUSH RDX - CALL &SysBadMAlloc - JMP I32 _SYS_HLT - -@@15: MOV RAX,U64 SF_ARG1[RBP] - PUSHFD - ADD RAX,CMemUsed.start+7 //round-up to I64 - AND AL,0xF8 -#assert CMemUsed.start>=sizeof(CMemUnused) - CMP RAX,CMemUsed.start - JAE @@20 - MOV RAX,CMemUsed.start -@@20: - - CLI -@@25: LOCK - BTS U32 CHeapCtrl.locked_flags[RDX],HClf_LOCKED - PAUSE //don't know if this inst helps - JC @@25 - - CMP RAX,MEM_HEAP_HASH_SIZE - JAE @@30 - MOV RSI,U64 CHeapCtrl.heap_hash[RAX+RDX] - TEST RSI,RSI - JZ @@35 - MOV RCX,U64 CMemUnused.next[RSI] - MOV U64 CHeapCtrl.heap_hash[RAX+RDX],RCX - JMP I32 MALLOC_ALMOST_DONE - -//Big allocation -@@30: ADD RAX,sizeof(CMemBlk)+MEM_PAGE_SIZE-1 - SHR RAX,MEM_PAGE_BITS - - PUSH RDX //preserve HeapCtrl - PUSH RDX - PUSH RAX - CALL &Mem512TaskAlloc - POP RDX - TEST RAX,RAX - JZ @@45 //Out of memory - MOV RSI,RAX - MOV EAX,U32 CMemBlk.pages[RSI] - - SHL RAX,MEM_PAGE_BITS - SUB RAX,sizeof(CMemBlk) - ADD RSI,sizeof(CMemBlk) - JMP I32 MALLOC_ALMOST_DONE - -//Little allocation, chunk-off piece from free lst chunks -@@35: LEA RSI,U64 CHeapCtrl.malloc_free_lst-CMemUnused.next[RDX] - -@@40: MOV RBX,RSI - MOV RSI,U64 CMemUnused.next[RBX] - TEST RSI,RSI - JNZ I32 @@60 - PUSH RAX //-**** save byte size - ADD RAX,16*MEM_PAGE_SIZE-1 - SHR RAX,MEM_PAGE_BITS - - PUSH RDX //preserve HeapCtrl - PUSH RDX - PUSH RAX - CALL &Mem512TaskAlloc - POP RDX - TEST RAX,RAX - JNZ @@50 - -//Out of memory -@@45: LOCK - BTR U32 CHeapCtrl.locked_flags[RDX],HClf_LOCKED - POPFD - PUSH TRUE - MOV RAX,'OutMem' - PUSH RAX - CALL I32 &throw - JMP I32 MALLOC_FINAL_EXIT //Never gets here, hopefully. - -@@50: MOV RSI,RAX - MOV EAX,U32 CMemBlk.pages[RSI] - SHL RAX,MEM_PAGE_BITS - -//Can it be combined with last chunk? (Never Free these chunks.) - MOV RDI,U64 CHeapCtrl.last_mergable[RDX] - LEA RBX,U64 [RSI+RAX] - CMP RDI,RBX - JNE @@55 - - PUSH RAX - MOV EAX,U32 CMemBlk.pages[RDI] - ADD U32 CMemBlk.pages[RSI],EAX -//QueRem - MOV RAX,U64 CMemBlk.next[RDI] - MOV RBX,U64 CMemBlk.last[RDI] - MOV U64 CMemBlk.last[RAX],RBX - MOV U64 CMemBlk.next[RBX],RAX - POP RAX - -@@55: MOV U64 CHeapCtrl.last_mergable[RDX],RSI - LEA RSI,U64 sizeof(CMemBlk)[RSI] - SUB RAX,sizeof(CMemBlk) - LEA RBX,U64 CHeapCtrl.malloc_free_lst-CMemUnused.next[RDX] - MOV RDI,U64 CMemUnused.next[RBX] - MOV U64 CMemUnused.next[RSI],RDI - MOV U64 CMemUnused.size[RSI],RAX - MOV U64 CMemUnused.next[RBX],RSI - POP RAX //+**** - JMP @@70 -@@60: CMP U64 CMemUnused.size[RSI],RAX - JB I32 @@40 - JNE @@70 - -@@65: MOV RDI,U64 CMemUnused.next[RSI] - MOV U64 CMemUnused.next[RBX],RDI - JMP MALLOC_ALMOST_DONE - -@@70: SUB U64 CMemUnused.size[RSI],RAX //UPDATE FREE ENTRY - CMP U64 CMemUnused.size[RSI],sizeof(CMemUnused) - JAE @@75 //take from top of block - ADD U64 CMemUnused.size[RSI],RAX //doesn't fit, undo - JMP I32 @@40 - -@@75: ADD RSI,U64 CMemUnused.size[RSI] - -MALLOC_ALMOST_DONE: -//RSI=res-CMemUsed.size -//RAX=size+CMemUsed.size -//RDX=HeapCtrl - ADD U64 CHeapCtrl.used_u8s[RDX],RAX - -#if _CFG_HEAP_DBG -//QueIns - MOV RDI,U64 CHeapCtrl.last_um[RDX] - MOV U64 CMemUsed.next[RDI],RSI - MOV U64 CHeapCtrl.last_um[RDX],RSI - MOV U64 CMemUsed.last[RSI],RDI - LEA RDI,U64 CHeapCtrl.next_um-CMemUsed.next[RDX] - MOV U64 CMemUsed.next[RSI],RDI - -//Caller1/Caller2 - PUSH RDX - MOV RDX,U64 [SYS_HEAP_LIMIT] - MOV RDI,U64 SF_RIP[RBP] - CMP RDI,RDX - JB @@80 - XOR RDI,RDI - MOV U64 CMemUsed.caller1[RSI],RDI - JMP @@90 -@@80: MOV U64 CMemUsed.caller1[RSI],RDI - MOV RDI,U64 SF_RBP[RBP] - CMP RDI,RDX - JB @@85 - XOR RDI,RDI - JMP @@90 -@@85: MOV RDI,U64 SF_RIP[RDI] - CMP RDI,RDX - JB @@90 - XOR RDI,RDI -@@90: MOV U64 CMemUsed.caller2[RSI],RDI - POP RDX - -#endif - LOCK - BTR U32 CHeapCtrl.locked_flags[RDX],HClf_LOCKED - POPFD - - MOV U64 CMemUsed.size[RSI],RAX - MOV U64 CMemUsed.hc[RSI],RDX - LEA RAX,U64 CMemUsed.start[RSI] - - TEST U8 [SYS_SEMAS+SYS_SEMA_HEAPLOG_ACTIVE*SEMA_STRUCT_SIZE],1 - JZ @@105 - PUSH RAX - PUSH RAX - MOV RAX,U64 [SYS_EXTERN_TABLE] - MOV RAX,U64 EXT_HEAPLOG_MALLOC*8[RAX] - TEST RAX,RAX - JZ @@95 - CALL RAX - JMP @@100 -@@95: ADD RSP,8 -@@100: POP RAX - -@@105: TEST U8 [SYS_HEAP_INIT_FLAG],1 - JZ MALLOC_FINAL_EXIT - - PUSH RAX - MOV RCX,U64 CMemUsed.size-CMemUsed.start[RAX] - SUB RCX,CMemUsed.start - MOV RDI,RAX - MOV AL,U8 [SYS_HEAP_INIT_VAL] - REP_STOSB - POP RAX - -MALLOC_FINAL_EXIT: - POP RDI - POP RSI - POP RBP - RET1 16 -//************************************ -_FREE:: -//Be aware of $LK,"heap_hash",A="FF:::/Kernel/Mem/MAllocFree.CPP,heap_hash"$ in $LK,"Mem512TaskAlloc",A="MN:Mem512TaskAlloc"$(). - PUSH RBP - MOV RBP,RSP - PUSH RSI - PUSH RDI - - TEST U8 [SYS_SEMAS+SYS_SEMA_HEAPLOG_ACTIVE*SEMA_STRUCT_SIZE],1 - JZ @@15 - MOV RBX,U64 SF_ARG1[RBP] - TEST RBX,RBX - JZ @@05 - MOV RAX,U64 CMemUsed.size-CMemUsed.start[RBX] - TEST RAX,RAX - JGE @@05 //Aligned alloced chunks have neg size - ADD RBX,RAX -@@05: PUSH RBX - MOV RAX,U64 [SYS_EXTERN_TABLE] - MOV RAX,U64 EXT_HEAPLOG_FREE*8[RAX] - TEST RAX,RAX - JZ @@10 - CALL RAX - JMP @@15 -@@10: ADD RSP,8 - -@@15: MOV RSI,U64 SF_ARG1[RBP] - TEST RSI,RSI - -#if _CFG_HEAP_DBG - JZ I32 FREE_DONE -#else - JZ FREE_DONE -#endif - - MOV RAX,U64 CMemUsed.size-CMemUsed.start[RSI] - TEST RAX,RAX - JGE @@20 //Aligned alloced chunks have neg size. - //The neg size is offset to start of $LK,"CMemUsed",A="MN:CMemUsed"$ struct. - ADD RSI,RAX - -@@20: PUSHFD - SUB RSI,CMemUsed.start - MOV RDX,U64 CMemUsed.hc[RSI] - CMP U32 CHeapCtrl.hc_signature[RDX],HEAP_CTRL_SIGNATURE_VAL - JE @@25 - ADD RSI,CMemUsed.start - PUSH RSI - CALL &SysBadFree - JMP I32 _SYS_HLT - -@@25: MOV RAX,U64 CMemUsed.size[RSI] - SUB U64 CHeapCtrl.used_u8s[RDX],RAX - CLI -@@30: LOCK - BTS U32 CHeapCtrl.locked_flags[RDX],HClf_LOCKED - PAUSE - JC @@30 -#if _CFG_HEAP_DBG -//QueRem - MOV RDX,U64 CMemUsed.next[RSI] - MOV RDI,U64 CMemUsed.last[RSI] - MOV U64 CMemUsed.last[RDX],RDI - MOV U64 CMemUsed.next[RDI],RDX - -//Caller1/Caller2 - MOV RDX,U64 [SYS_HEAP_LIMIT] - MOV RDI,U64 SF_RIP[RBP] - CMP RDI,RDX - JB @@35 - XOR RDI,RDI - MOV U64 CMemUnused.caller1[RSI],RDI - JMP @@45 -@@35: MOV U64 CMemUnused.caller1[RSI],RDI - MOV RDI,U64 SF_RBP[RBP] - CMP RDI,RDX - JB @@40 - XOR RDI,RDI - JMP @@45 -@@40: MOV RDI,U64 SF_RIP[RDI] - CMP RDI,RDX - JB @@45 - XOR RDI,RDI -@@45: MOV U64 CMemUnused.caller2[RSI],RDI - - MOV RDX,U64 CMemUsed.hc[RSI] -#endif - CMP RAX,MEM_HEAP_HASH_SIZE - JAE @@50 - -#assert CMemUnused.size==CMemUsed.size -// MOV U64 CMemUnused.size[RSI],RAX - - MOV RBX,U64 CHeapCtrl.heap_hash[RAX+RDX] - MOV U64 CMemUnused.next[RSI],RBX - MOV U64 CHeapCtrl.heap_hash[RAX+RDX],RSI - JMP @@55 - -@@50: SUB RSI,sizeof(CMemBlk) - PUSH RDX - PUSH RDX - PUSH RSI - CALL &Mem512TaskFree - POP RDX - -@@55: LOCK - BTR U32 CHeapCtrl.locked_flags[RDX],HClf_LOCKED - POPFD -FREE_DONE: - POP RDI - POP RSI - POP RBP - RET1 8 -//************************************ -_MSIZE:: - PUSH RBP - MOV RBP,RSP - MOV RBX,U64 SF_ARG1[RBP] - XOR RAX,RAX - TEST RBX,RBX - JZ @@10 - MOV RAX,U64 CMemUsed.size-CMemUsed.start[RBX] - TEST RAX,RAX - JGE @@05 //Aligned alloced chunks have neg size - ADD RBX,RAX - MOV RAX,U64 CMemUsed.size-CMemUsed.start[RBX] -@@05: SUB RAX,CMemUsed.start -@@10: POP RBP - RET1 8 -//************************************ -_MSIZE2:: - PUSH RBP - MOV RBP,RSP - MOV RBX,U64 SF_ARG1[RBP] - XOR RAX,RAX - TEST RBX,RBX - JZ @@10 - MOV RAX,U64 CMemUsed.size-CMemUsed.start[RBX] - TEST RAX,RAX - JGE @@05 //Aligned alloced chunks have neg size - ADD RBX,RAX -@@05: MOV RAX,U64 CMemUsed.size-CMemUsed.start[RBX] -@@10: POP RBP - RET1 8 -//************************************ -_MHEAP_CTRL:: - PUSH RBP - MOV RBP,RSP - MOV RBX,U64 SF_ARG1[RBP] - XOR RAX,RAX - TEST RBX,RBX - JZ @@10 - MOV RAX,U64 CMemUsed.size-CMemUsed.start[RBX] - TEST RAX,RAX - JGE @@05 //Aligned alloced chunks have neg size - ADD RBX,RAX -@@05: MOV RAX,U64 CMemUsed.hc-CMemUsed.start[RBX] -@@10: POP RBP - RET1 8 -} - -_extern _FREE U0 Free(U8 *addr); //Free $LK,"MAlloc",A="MN:MAlloc"$()ed memory chunk. -_extern _MSIZE I64 MSize(U8 *src); //Size of heap object. -_extern _MSIZE2 I64 MSize2(U8 *src); //Internal size of heap object. -_extern _MHEAP_CTRL CHeapCtrl *MHeapCtrl(U8 *src); //$LK,"CHeapCtrl",A="MN:CHeapCtrl"$ of object. -_extern _MALLOC U8 *MAlloc(I64 size,CTask *mem_task=NULL); //Alloc memory chunk. -//Accepts a $LK,"CTask",A="MN:CTask"$ or $LK,"CHeapCtrl",A="MN:CHeapCtrl"$. NULL allocs off current task's heap. - -U8 *AMAlloc(I64 size) -{//Alloc memory in Adam's heap. - return MAlloc(size,adam_task); -} - -U8 *CAlloc(I64 size,CTask *mem_task=NULL) -{//Accepts a $LK,"CTask",A="MN:CTask"$ or $LK,"CHeapCtrl",A="MN:CHeapCtrl"$. NULL allocs off current task's heap. - U8 *res=MAlloc(size,mem_task); - MemSet(res,0,size); - return res; -} - -U8 *ACAlloc(I64 size) -{//Alloc and set to zero memory in Adam's heap. - return CAlloc(size,adam_task); -} - -U8 *MAllocIdent(U8 *src,CTask *mem_task=NULL) -{//Accepts a $LK,"CTask",A="MN:CTask"$ or $LK,"CHeapCtrl",A="MN:CHeapCtrl"$. NULL allocs off current task's heap. - U8 *res; - I64 size; - if (!src) return NULL; - size=MSize(src); - res=MAlloc(size,mem_task); - MemCpy(res,src,size); - return res; -} - -U8 *AMAllocIdent(U8 *src) -{//Alloc in Adam's heap, ident copy of heap node. - return MAllocIdent(src,adam_task); -} - -U8 *MAllocAligned(I64 size,I64 alignment, - CTask *mem_task=NULL,I64 misalignment=0) -{//Only powers of two alignment. This is awful. - I64 mask=alignment-1; - U8 *ptr=MAlloc(size+mask+sizeof(I64)+misalignment,mem_task), - *res=(ptr+sizeof(I64)+mask)&~mask+misalignment; - res(I64 *)[-1]=ptr-res; -#assert offset(CMemUsed.size)==offset(CMemUsed.start)-sizeof(I64) - return res; -} - -U8 *CAllocAligned(I64 size,I64 alignment, - CTask *mem_task=NULL,I64 misalignment=0) -{//Only powers of two alignment. This is awful. - I64 mask=alignment-1; - U8 *ptr=MAlloc(size+mask+sizeof(I64)+misalignment,mem_task), - *res=(ptr+sizeof(I64)+mask)&~mask+misalignment; - res(I64 *)[-1]=ptr-res; -#assert offset(CMemUsed.size)==offset(CMemUsed.start)-sizeof(I64) - MemSet(res,0,size); - return res; -} - -U8 *StrNew(U8 *buf,CTask *mem_task=NULL) -{//Accepts a $LK,"CTask",A="MN:CTask"$ or $LK,"CHeapCtrl",A="MN:CHeapCtrl"$. NULL allocs off current task's heap. - U8 *res; - I64 size; - if (buf) { - size=StrLen(buf)+1; - res=MAlloc(size,mem_task); - MemCpy(res,buf,size); - } else { - res=MAlloc(1,mem_task); - *res=0; - } - return res; -} - -U8 *AStrNew(U8 *buf) -{//Alloc copy of string in Adam's heap. - return StrNew(buf,adam_task); -} diff --git a/Kernel/Mem/MAllocFree.HC b/Kernel/Mem/MAllocFree.HC new file mode 100644 index 0000000..76c5bc7 --- /dev/null +++ b/Kernel/Mem/MAllocFree.HC @@ -0,0 +1,464 @@ +asm { +//************************************ +//See $LK,"::/Doc/Credits.DD"$. +_MALLOC:: +// Throws 'OutMem' + PUSH RBP + MOV RBP,RSP + PUSH RSI + PUSH RDI + + XOR RBX,RBX + MOV RDX,U64 SF_ARG2[RBP] + TEST RDX,RDX + JNZ @@05 + MOV RDX,U64 FS:CTask.addr[RBX] +@@05: CMP U32 CTask.task_signature[RDX],TASK_SIGNATURE_VAL + +#assert CTask.task_signature==CHeapCtrl.hc_signature //location signature same + + JNE @@10 + MOV RDX,U64 CTask.data_heap[RDX] +@@10: CMP U32 CHeapCtrl.hc_signature[RDX],HEAP_CTRL_SIGNATURE_VAL + JE @@15 + PUSH RDX + CALL &SysBadMAlloc + JMP I32 _SYS_HLT + +@@15: MOV RAX,U64 SF_ARG1[RBP] + PUSHFD + ADD RAX,CMemUsed.start+7 //round-up to I64 + AND AL,0xF8 +#assert CMemUsed.start>=sizeof(CMemUnused) + CMP RAX,CMemUsed.start + JAE @@20 + MOV RAX,CMemUsed.start +@@20: + + CLI +@@25: LOCK + BTS U32 CHeapCtrl.locked_flags[RDX],HClf_LOCKED + PAUSE //don't know if this inst helps + JC @@25 + + CMP RAX,MEM_HEAP_HASH_SIZE + JAE @@30 + MOV RSI,U64 CHeapCtrl.heap_hash[RAX+RDX] + TEST RSI,RSI + JZ @@35 + MOV RCX,U64 CMemUnused.next[RSI] + MOV U64 CHeapCtrl.heap_hash[RAX+RDX],RCX + JMP I32 MALLOC_ALMOST_DONE + +//Big allocation +@@30: ADD RAX,sizeof(CMemBlk)+MEM_PAGE_SIZE-1 + SHR RAX,MEM_PAGE_BITS + + PUSH RDX //preserve HeapCtrl + PUSH RDX + PUSH RAX + CALL &Mem512TaskAlloc + POP RDX + TEST RAX,RAX + JZ @@45 //Out of memory + MOV RSI,RAX + MOV EAX,U32 CMemBlk.pages[RSI] + + SHL RAX,MEM_PAGE_BITS + SUB RAX,sizeof(CMemBlk) + ADD RSI,sizeof(CMemBlk) + JMP I32 MALLOC_ALMOST_DONE + +//Little allocation, chunk-off piece from free lst chunks +@@35: LEA RSI,U64 CHeapCtrl.malloc_free_lst-CMemUnused.next[RDX] + +@@40: MOV RBX,RSI + MOV RSI,U64 CMemUnused.next[RBX] + TEST RSI,RSI + JNZ I32 @@60 + PUSH RAX //-**** save byte size + ADD RAX,16*MEM_PAGE_SIZE-1 + SHR RAX,MEM_PAGE_BITS + + PUSH RDX //preserve HeapCtrl + PUSH RDX + PUSH RAX + CALL &Mem512TaskAlloc + POP RDX + TEST RAX,RAX + JNZ @@50 + +//Out of memory +@@45: LOCK + BTR U32 CHeapCtrl.locked_flags[RDX],HClf_LOCKED + POPFD + PUSH TRUE + MOV RAX,'OutMem' + PUSH RAX + CALL I32 &throw + JMP I32 MALLOC_FINAL_EXIT //Never gets here, hopefully. + +@@50: MOV RSI,RAX + MOV EAX,U32 CMemBlk.pages[RSI] + SHL RAX,MEM_PAGE_BITS + +//Can it be combined with last chunk? (Never Free these chunks.) + MOV RDI,U64 CHeapCtrl.last_mergable[RDX] + LEA RBX,U64 [RSI+RAX] + CMP RDI,RBX + JNE @@55 + + PUSH RAX + MOV EAX,U32 CMemBlk.pages[RDI] + ADD U32 CMemBlk.pages[RSI],EAX +//QueRem + MOV RAX,U64 CMemBlk.next[RDI] + MOV RBX,U64 CMemBlk.last[RDI] + MOV U64 CMemBlk.last[RAX],RBX + MOV U64 CMemBlk.next[RBX],RAX + POP RAX + +@@55: MOV U64 CHeapCtrl.last_mergable[RDX],RSI + LEA RSI,U64 sizeof(CMemBlk)[RSI] + SUB RAX,sizeof(CMemBlk) + LEA RBX,U64 CHeapCtrl.malloc_free_lst-CMemUnused.next[RDX] + MOV RDI,U64 CMemUnused.next[RBX] + MOV U64 CMemUnused.next[RSI],RDI + MOV U64 CMemUnused.size[RSI],RAX + MOV U64 CMemUnused.next[RBX],RSI + POP RAX //+**** + JMP @@70 +@@60: CMP U64 CMemUnused.size[RSI],RAX + JB I32 @@40 + JNE @@70 + +@@65: MOV RDI,U64 CMemUnused.next[RSI] + MOV U64 CMemUnused.next[RBX],RDI + JMP MALLOC_ALMOST_DONE + +@@70: SUB U64 CMemUnused.size[RSI],RAX //UPDATE FREE ENTRY + CMP U64 CMemUnused.size[RSI],sizeof(CMemUnused) + JAE @@75 //take from top of block + ADD U64 CMemUnused.size[RSI],RAX //doesn't fit, undo + JMP I32 @@40 + +@@75: ADD RSI,U64 CMemUnused.size[RSI] + +MALLOC_ALMOST_DONE: +//RSI=res-CMemUsed.size +//RAX=size+CMemUsed.size +//RDX=HeapCtrl + ADD U64 CHeapCtrl.used_u8s[RDX],RAX + +#if _CFG_HEAP_DBG +//QueIns + MOV RDI,U64 CHeapCtrl.last_um[RDX] + MOV U64 CMemUsed.next[RDI],RSI + MOV U64 CHeapCtrl.last_um[RDX],RSI + MOV U64 CMemUsed.last[RSI],RDI + LEA RDI,U64 CHeapCtrl.next_um-CMemUsed.next[RDX] + MOV U64 CMemUsed.next[RSI],RDI + +//Caller1/Caller2 + PUSH RDX + MOV RDX,U64 [SYS_HEAP_LIMIT] + MOV RDI,U64 SF_RIP[RBP] + CMP RDI,RDX + JB @@80 + XOR RDI,RDI + MOV U64 CMemUsed.caller1[RSI],RDI + JMP @@90 +@@80: MOV U64 CMemUsed.caller1[RSI],RDI + MOV RDI,U64 SF_RBP[RBP] + CMP RDI,RDX + JB @@85 + XOR RDI,RDI + JMP @@90 +@@85: MOV RDI,U64 SF_RIP[RDI] + CMP RDI,RDX + JB @@90 + XOR RDI,RDI +@@90: MOV U64 CMemUsed.caller2[RSI],RDI + POP RDX + +#endif + LOCK + BTR U32 CHeapCtrl.locked_flags[RDX],HClf_LOCKED + POPFD + + MOV U64 CMemUsed.size[RSI],RAX + MOV U64 CMemUsed.hc[RSI],RDX + LEA RAX,U64 CMemUsed.start[RSI] + + TEST U8 [SYS_SEMAS+SYS_SEMA_HEAPLOG_ACTIVE*SEMA_STRUCT_SIZE],1 + JZ @@105 + PUSH RAX + PUSH RAX + MOV RAX,U64 [SYS_EXTERN_TABLE] + MOV RAX,U64 EXT_HEAPLOG_MALLOC*8[RAX] + TEST RAX,RAX + JZ @@95 + CALL RAX + JMP @@100 +@@95: ADD RSP,8 +@@100: POP RAX + +@@105: TEST U8 [SYS_HEAP_INIT_FLAG],1 + JZ MALLOC_FINAL_EXIT + + PUSH RAX + MOV RCX,U64 CMemUsed.size-CMemUsed.start[RAX] + SUB RCX,CMemUsed.start + MOV RDI,RAX + MOV AL,U8 [SYS_HEAP_INIT_VAL] + REP_STOSB + POP RAX + +MALLOC_FINAL_EXIT: + POP RDI + POP RSI + POP RBP + RET1 16 +//************************************ +_FREE:: +//Be aware of $LK,"heap_hash",A="FF:::/Kernel/Mem/MAllocFree.HC,heap_hash"$ in $LK,"Mem512TaskAlloc",A="MN:Mem512TaskAlloc"$(). + PUSH RBP + MOV RBP,RSP + PUSH RSI + PUSH RDI + + TEST U8 [SYS_SEMAS+SYS_SEMA_HEAPLOG_ACTIVE*SEMA_STRUCT_SIZE],1 + JZ @@15 + MOV RBX,U64 SF_ARG1[RBP] + TEST RBX,RBX + JZ @@05 + MOV RAX,U64 CMemUsed.size-CMemUsed.start[RBX] + TEST RAX,RAX + JGE @@05 //Aligned alloced chunks have neg size + ADD RBX,RAX +@@05: PUSH RBX + MOV RAX,U64 [SYS_EXTERN_TABLE] + MOV RAX,U64 EXT_HEAPLOG_FREE*8[RAX] + TEST RAX,RAX + JZ @@10 + CALL RAX + JMP @@15 +@@10: ADD RSP,8 + +@@15: MOV RSI,U64 SF_ARG1[RBP] + TEST RSI,RSI + +#if _CFG_HEAP_DBG + JZ I32 FREE_DONE +#else + JZ FREE_DONE +#endif + + MOV RAX,U64 CMemUsed.size-CMemUsed.start[RSI] + TEST RAX,RAX + JGE @@20 //Aligned alloced chunks have neg size. + //The neg size is offset to start of $LK,"CMemUsed",A="MN:CMemUsed"$ struct. + ADD RSI,RAX + +@@20: PUSHFD + SUB RSI,CMemUsed.start + MOV RDX,U64 CMemUsed.hc[RSI] + CMP U32 CHeapCtrl.hc_signature[RDX],HEAP_CTRL_SIGNATURE_VAL + JE @@25 + ADD RSI,CMemUsed.start + PUSH RSI + CALL &SysBadFree + JMP I32 _SYS_HLT + +@@25: MOV RAX,U64 CMemUsed.size[RSI] + SUB U64 CHeapCtrl.used_u8s[RDX],RAX + CLI +@@30: LOCK + BTS U32 CHeapCtrl.locked_flags[RDX],HClf_LOCKED + PAUSE + JC @@30 +#if _CFG_HEAP_DBG +//QueRem + MOV RDX,U64 CMemUsed.next[RSI] + MOV RDI,U64 CMemUsed.last[RSI] + MOV U64 CMemUsed.last[RDX],RDI + MOV U64 CMemUsed.next[RDI],RDX + +//Caller1/Caller2 + MOV RDX,U64 [SYS_HEAP_LIMIT] + MOV RDI,U64 SF_RIP[RBP] + CMP RDI,RDX + JB @@35 + XOR RDI,RDI + MOV U64 CMemUnused.caller1[RSI],RDI + JMP @@45 +@@35: MOV U64 CMemUnused.caller1[RSI],RDI + MOV RDI,U64 SF_RBP[RBP] + CMP RDI,RDX + JB @@40 + XOR RDI,RDI + JMP @@45 +@@40: MOV RDI,U64 SF_RIP[RDI] + CMP RDI,RDX + JB @@45 + XOR RDI,RDI +@@45: MOV U64 CMemUnused.caller2[RSI],RDI + + MOV RDX,U64 CMemUsed.hc[RSI] +#endif + CMP RAX,MEM_HEAP_HASH_SIZE + JAE @@50 + +#assert CMemUnused.size==CMemUsed.size +// MOV U64 CMemUnused.size[RSI],RAX + + MOV RBX,U64 CHeapCtrl.heap_hash[RAX+RDX] + MOV U64 CMemUnused.next[RSI],RBX + MOV U64 CHeapCtrl.heap_hash[RAX+RDX],RSI + JMP @@55 + +@@50: SUB RSI,sizeof(CMemBlk) + PUSH RDX + PUSH RDX + PUSH RSI + CALL &Mem512TaskFree + POP RDX + +@@55: LOCK + BTR U32 CHeapCtrl.locked_flags[RDX],HClf_LOCKED + POPFD +FREE_DONE: + POP RDI + POP RSI + POP RBP + RET1 8 +//************************************ +_MSIZE:: + PUSH RBP + MOV RBP,RSP + MOV RBX,U64 SF_ARG1[RBP] + XOR RAX,RAX + TEST RBX,RBX + JZ @@10 + MOV RAX,U64 CMemUsed.size-CMemUsed.start[RBX] + TEST RAX,RAX + JGE @@05 //Aligned alloced chunks have neg size + ADD RBX,RAX + MOV RAX,U64 CMemUsed.size-CMemUsed.start[RBX] +@@05: SUB RAX,CMemUsed.start +@@10: POP RBP + RET1 8 +//************************************ +_MSIZE2:: + PUSH RBP + MOV RBP,RSP + MOV RBX,U64 SF_ARG1[RBP] + XOR RAX,RAX + TEST RBX,RBX + JZ @@10 + MOV RAX,U64 CMemUsed.size-CMemUsed.start[RBX] + TEST RAX,RAX + JGE @@05 //Aligned alloced chunks have neg size + ADD RBX,RAX +@@05: MOV RAX,U64 CMemUsed.size-CMemUsed.start[RBX] +@@10: POP RBP + RET1 8 +//************************************ +_MHEAP_CTRL:: + PUSH RBP + MOV RBP,RSP + MOV RBX,U64 SF_ARG1[RBP] + XOR RAX,RAX + TEST RBX,RBX + JZ @@10 + MOV RAX,U64 CMemUsed.size-CMemUsed.start[RBX] + TEST RAX,RAX + JGE @@05 //Aligned alloced chunks have neg size + ADD RBX,RAX +@@05: MOV RAX,U64 CMemUsed.hc-CMemUsed.start[RBX] +@@10: POP RBP + RET1 8 +} + +_extern _FREE U0 Free(U8 *addr); //Free $LK,"MAlloc",A="MN:MAlloc"$()ed memory chunk. +_extern _MSIZE I64 MSize(U8 *src); //Size of heap object. +_extern _MSIZE2 I64 MSize2(U8 *src); //Internal size of heap object. +_extern _MHEAP_CTRL CHeapCtrl *MHeapCtrl(U8 *src); //$LK,"CHeapCtrl",A="MN:CHeapCtrl"$ of object. +_extern _MALLOC U8 *MAlloc(I64 size,CTask *mem_task=NULL); //Alloc memory chunk. +//Accepts a $LK,"CTask",A="MN:CTask"$ or $LK,"CHeapCtrl",A="MN:CHeapCtrl"$. NULL allocs off current task's heap. + +U8 *AMAlloc(I64 size) +{//Alloc memory in Adam's heap. + return MAlloc(size,adam_task); +} + +U8 *CAlloc(I64 size,CTask *mem_task=NULL) +{//Accepts a $LK,"CTask",A="MN:CTask"$ or $LK,"CHeapCtrl",A="MN:CHeapCtrl"$. NULL allocs off current task's heap. + U8 *res=MAlloc(size,mem_task); + MemSet(res,0,size); + return res; +} + +U8 *ACAlloc(I64 size) +{//Alloc and set to zero memory in Adam's heap. + return CAlloc(size,adam_task); +} + +U8 *MAllocIdent(U8 *src,CTask *mem_task=NULL) +{//Accepts a $LK,"CTask",A="MN:CTask"$ or $LK,"CHeapCtrl",A="MN:CHeapCtrl"$. NULL allocs off current task's heap. + U8 *res; + I64 size; + if (!src) return NULL; + size=MSize(src); + res=MAlloc(size,mem_task); + MemCpy(res,src,size); + return res; +} + +U8 *AMAllocIdent(U8 *src) +{//Alloc in Adam's heap, ident copy of heap node. + return MAllocIdent(src,adam_task); +} + +U8 *MAllocAligned(I64 size,I64 alignment, + CTask *mem_task=NULL,I64 misalignment=0) +{//Only powers of two alignment. This is awful. + I64 mask=alignment-1; + U8 *ptr=MAlloc(size+mask+sizeof(I64)+misalignment,mem_task), + *res=(ptr+sizeof(I64)+mask)&~mask+misalignment; + res(I64 *)[-1]=ptr-res; +#assert offset(CMemUsed.size)==offset(CMemUsed.start)-sizeof(I64) + return res; +} + +U8 *CAllocAligned(I64 size,I64 alignment, + CTask *mem_task=NULL,I64 misalignment=0) +{//Only powers of two alignment. This is awful. + I64 mask=alignment-1; + U8 *ptr=MAlloc(size+mask+sizeof(I64)+misalignment,mem_task), + *res=(ptr+sizeof(I64)+mask)&~mask+misalignment; + res(I64 *)[-1]=ptr-res; +#assert offset(CMemUsed.size)==offset(CMemUsed.start)-sizeof(I64) + MemSet(res,0,size); + return res; +} + +U8 *StrNew(U8 *buf,CTask *mem_task=NULL) +{//Accepts a $LK,"CTask",A="MN:CTask"$ or $LK,"CHeapCtrl",A="MN:CHeapCtrl"$. NULL allocs off current task's heap. + U8 *res; + I64 size; + if (buf) { + size=StrLen(buf)+1; + res=MAlloc(size,mem_task); + MemCpy(res,buf,size); + } else { + res=MAlloc(1,mem_task); + *res=0; + } + return res; +} + +U8 *AStrNew(U8 *buf) +{//Alloc copy of string in Adam's heap. + return StrNew(buf,adam_task); +} diff --git a/Kernel/Mem/MakeMem.CPP b/Kernel/Mem/MakeMem.HC similarity index 100% rename from Kernel/Mem/MakeMem.CPP rename to Kernel/Mem/MakeMem.HC diff --git a/Kernel/Mem/Mem512.CPP b/Kernel/Mem/Mem512.HC similarity index 100% rename from Kernel/Mem/Mem512.CPP rename to Kernel/Mem/Mem512.HC diff --git a/Kernel/Mem/MemPhysical.CPP b/Kernel/Mem/MemPhysical.HC similarity index 100% rename from Kernel/Mem/MemPhysical.CPP rename to Kernel/Mem/MemPhysical.HC diff --git a/Kernel/Mem/PageTables.CPP b/Kernel/Mem/PageTables.CPP deleted file mode 100644 index 10fa384..0000000 --- a/Kernel/Mem/PageTables.CPP +++ /dev/null @@ -1,154 +0,0 @@ -asm { -// $LK,"::/Doc/MemOverview.TXT"$ - -USE32 -SYS_INIT_PAGE_TABLES:: -//Set page tables to identity map everything. - MOV EDI,SYS_FIXED_AREA - XOR EAX,EAX - MOV ECX,sizeof(CSysFixedArea)/4 - REP_STOSD //Init entire SYS_FIXED_AREA to zero - - MOV EAX,0x80000001 - CPUID - BT EDX,26 - JC @@15 - - MOV U8 [SYS_GIG_PAGES],FALSE -//PML2: Use 2Meg PAges - MOV EAX,0x87 //bit 7 is page size (2Meg) - XOR EDX,EDX - MOV EDI,SYS_FIXED_AREA+CSysFixedArea.pml2 - MOV ECX,MEM_NUM_2MEG -@@05: MOV U32 [EDI],EAX - ADD EDI,4 - MOV U32 [EDI],EDX - ADD EDI,4 - ADD EAX,0x200000 - ADC EDX,0 - LOOP @@05 -//PML3: Use 2Meg Pages - MOV EAX,SYS_FIXED_AREA+CSysFixedArea.pml2+7 - XOR EDX,EDX - MOV EDI,SYS_FIXED_AREA+CSysFixedArea.pml3 - MOV ECX,MEM_NUM_USED_1GIG -@@10: MOV U32 [EDI],EAX - ADD EDI,4 - MOV U32 [EDI],EDX - ADD EDI,4 - ADD EAX,0x1000 - ADC EDX,0 - LOOP @@10 - JMP @@25 - -@@15: MOV U8 [SYS_GIG_PAGES],TRUE -//PML3: Use 1Gig Pages - MOV EAX,0x87 //bit 7 is page size (1Gig) - XOR EDX,EDX - MOV EDI,SYS_FIXED_AREA+CSysFixedArea.pml3 - MOV ECX,MEM_NUM_USED_1GIG -@@20: MOV U32 [EDI],EAX - ADD EDI,4 - MOV U32 [EDI],EDX - ADD EDI,4 - ADD EAX,0x40000000 - ADC EDX,0 - LOOP @@20 - -//PML4 -@@25: MOV EAX,SYS_FIXED_AREA+CSysFixedArea.pml3+7 - XOR EDX,EDX - MOV EDI,SYS_FIXED_AREA+CSysFixedArea.pml4 - MOV ECX,MEM_NUM_1GIG/(0x1000/8) -@@30: MOV U32 [EDI],EAX - ADD EDI,4 - MOV U32 [EDI],EDX - ADD EDI,4 - ADD EAX,0x1000 - ADC EDX,0 - LOOP @@30 - - MOV U32 [SYS_CODE_BP],SYS_FIXED_AREA+CSysFixedArea.adam_bp - MOV U32 [SYS_CODE_BP+4],0 - - MOV U32 [SYS_DATA_BP],0 - MOV U32 [SYS_DATA_BP+4],0 - - XOR EAX,EAX - MOV AX,U16 [SYS_MEM_E801] //1 Kb blks between 1M and 16M - SHL EAX,10 - ADD EAX,0x100000 - MOV EBX,U32 [SYS_HEAP_BASE] //SYS_FIXED_AREA+sizeof(CSysFixedArea) - SUB EAX,EBX - -/*$AN,"ExpandHeap",A="ExpandHeap"$ -TempleOS initializes the heap to the val -of the BIOS E801 lowest 16Meg val. It -later adds the rest to the heap. There -are a few allocations which occur while -it is set to this small val. - -At some point, it might be nice to -initialize to the full val but it is a -pain without MAlloc up-and-running. -*/ - -#define CONSERVATIVE_16MEG_SIZE 0xF00000 -#define ESTIMATED_MISC_ALLOCS 0x100000 - -#assert CONSERVATIVE_16MEG_SIZE- - (SYS_FIXED_AREA+sizeof(CSysFixedArea))>MEM_ADAM_STK+ - ESTIMATED_MISC_ALLOCS - -//EBX=BASE EAX=SIZE - TEST U8 [SYS_MEM_INIT_FLAG],1 - JZ @@35 - PUSH EAX - MOV EDI,EBX - MOV ECX,EAX - MOV AL,U8 [SYS_MEM_INIT_VAL] - REP_STOSB - POP EAX - -@@35: SHR EAX,MEM_PAGE_BITS - MOV ESI,SYS_FIXED_AREA+CSysFixedArea.adam_bp - MOV EDI,U32 CBlkPool.mem_free_lst[ESI] - MOV U32 CMemBlk.next[EBX],EDI - MOV U32 CMemBlk.next+4[EBX],0 - MOV U32 CBlkPool.mem_free_lst[ESI],EBX - MOV U32 CBlkPool.mem_free_lst+4[ESI],0 - MOV U32 CMemBlk.mb_signature[EBX],MBS_UNUSED_SIGNATURE_VAL - MOV U32 CMemBlk.pages[EBX],EAX - SHL EAX,MEM_PAGE_BITS - ADD U32 CBlkPool.alloced_u8s[ESI],EAX - RET -} - -I64 *MemPageTable(U8 *a) -{//Point to page table entry for addr. - if (sys_gig_pages) - return SYS_FIXED_AREA+offset(CSysFixedArea.pml3)+a>>30*8; - else - return SYS_FIXED_AREA+offset(CSysFixedArea.pml2)+a>>21*8; -} - -I64 MemPageSize(U8 *) -{//Page table entry size for addr. - if (sys_gig_pages) - return 1<<30; //1Gig - else - return 1<<21; //2Meg -} - -Bool MemPagePresentMark(U8 *a,Bool val) -{//Mark an addr's page present or not-present. - I64 *pte=MemPageTable(a); - Bool res=*pte&1; - if (val) - *pte=*pte|1; //Mark present - else - *pte=*pte&~1; //Mark not present - InvlPg(a); - return res; -} - diff --git a/Kernel/Mem/PageTables.HC b/Kernel/Mem/PageTables.HC new file mode 100644 index 0000000..be8720f --- /dev/null +++ b/Kernel/Mem/PageTables.HC @@ -0,0 +1,154 @@ +asm { +// $LK,"::/Doc/MemOverview.DD"$ + +USE32 +SYS_INIT_PAGE_TABLES:: +//Set page tables to identity map everything. + MOV EDI,SYS_FIXED_AREA + XOR EAX,EAX + MOV ECX,sizeof(CSysFixedArea)/4 + REP_STOSD //Init entire SYS_FIXED_AREA to zero + + MOV EAX,0x80000001 + CPUID + BT EDX,26 + JC @@15 + + MOV U8 [SYS_GIG_PAGES],FALSE +//PML2: Use 2Meg PAges + MOV EAX,0x87 //bit 7 is page size (2Meg) + XOR EDX,EDX + MOV EDI,SYS_FIXED_AREA+CSysFixedArea.pml2 + MOV ECX,MEM_NUM_2MEG +@@05: MOV U32 [EDI],EAX + ADD EDI,4 + MOV U32 [EDI],EDX + ADD EDI,4 + ADD EAX,0x200000 + ADC EDX,0 + LOOP @@05 +//PML3: Use 2Meg Pages + MOV EAX,SYS_FIXED_AREA+CSysFixedArea.pml2+7 + XOR EDX,EDX + MOV EDI,SYS_FIXED_AREA+CSysFixedArea.pml3 + MOV ECX,MEM_NUM_USED_1GIG +@@10: MOV U32 [EDI],EAX + ADD EDI,4 + MOV U32 [EDI],EDX + ADD EDI,4 + ADD EAX,0x1000 + ADC EDX,0 + LOOP @@10 + JMP @@25 + +@@15: MOV U8 [SYS_GIG_PAGES],TRUE +//PML3: Use 1Gig Pages + MOV EAX,0x87 //bit 7 is page size (1Gig) + XOR EDX,EDX + MOV EDI,SYS_FIXED_AREA+CSysFixedArea.pml3 + MOV ECX,MEM_NUM_USED_1GIG +@@20: MOV U32 [EDI],EAX + ADD EDI,4 + MOV U32 [EDI],EDX + ADD EDI,4 + ADD EAX,0x40000000 + ADC EDX,0 + LOOP @@20 + +//PML4 +@@25: MOV EAX,SYS_FIXED_AREA+CSysFixedArea.pml3+7 + XOR EDX,EDX + MOV EDI,SYS_FIXED_AREA+CSysFixedArea.pml4 + MOV ECX,MEM_NUM_1GIG/(0x1000/8) +@@30: MOV U32 [EDI],EAX + ADD EDI,4 + MOV U32 [EDI],EDX + ADD EDI,4 + ADD EAX,0x1000 + ADC EDX,0 + LOOP @@30 + + MOV U32 [SYS_CODE_BP],SYS_FIXED_AREA+CSysFixedArea.adam_bp + MOV U32 [SYS_CODE_BP+4],0 + + MOV U32 [SYS_DATA_BP],0 + MOV U32 [SYS_DATA_BP+4],0 + + XOR EAX,EAX + MOV AX,U16 [SYS_MEM_E801] //1 Kb blks between 1M and 16M + SHL EAX,10 + ADD EAX,0x100000 + MOV EBX,U32 [SYS_HEAP_BASE] //SYS_FIXED_AREA+sizeof(CSysFixedArea) + SUB EAX,EBX + +/*$AN,"ExpandHeap",A="ExpandHeap"$ +TempleOS initializes the heap to the val +of the BIOS E801 lowest 16Meg val. It +later adds the rest to the heap. There +are a few allocations which occur while +it is set to this small val. + +At some point, it might be nice to +initialize to the full val but it is a +pain without MAlloc up-and-running. +*/ + +#define CONSERVATIVE_16MEG_SIZE 0xF00000 +#define ESTIMATED_MISC_ALLOCS 0x100000 + +#assert CONSERVATIVE_16MEG_SIZE- + (SYS_FIXED_AREA+sizeof(CSysFixedArea))>MEM_ADAM_STK+ + ESTIMATED_MISC_ALLOCS + +//EBX=BASE EAX=SIZE + TEST U8 [SYS_MEM_INIT_FLAG],1 + JZ @@35 + PUSH EAX + MOV EDI,EBX + MOV ECX,EAX + MOV AL,U8 [SYS_MEM_INIT_VAL] + REP_STOSB + POP EAX + +@@35: SHR EAX,MEM_PAGE_BITS + MOV ESI,SYS_FIXED_AREA+CSysFixedArea.adam_bp + MOV EDI,U32 CBlkPool.mem_free_lst[ESI] + MOV U32 CMemBlk.next[EBX],EDI + MOV U32 CMemBlk.next+4[EBX],0 + MOV U32 CBlkPool.mem_free_lst[ESI],EBX + MOV U32 CBlkPool.mem_free_lst+4[ESI],0 + MOV U32 CMemBlk.mb_signature[EBX],MBS_UNUSED_SIGNATURE_VAL + MOV U32 CMemBlk.pages[EBX],EAX + SHL EAX,MEM_PAGE_BITS + ADD U32 CBlkPool.alloced_u8s[ESI],EAX + RET +} + +I64 *MemPageTable(U8 *a) +{//Point to page table entry for addr. + if (sys_gig_pages) + return SYS_FIXED_AREA+offset(CSysFixedArea.pml3)+a>>30*8; + else + return SYS_FIXED_AREA+offset(CSysFixedArea.pml2)+a>>21*8; +} + +I64 MemPageSize(U8 *) +{//Page table entry size for addr. + if (sys_gig_pages) + return 1<<30; //1Gig + else + return 1<<21; //2Meg +} + +Bool MemPagePresentMark(U8 *a,Bool val) +{//Mark an addr's page present or not-present. + I64 *pte=MemPageTable(a); + Bool res=*pte&1; + if (val) + *pte=*pte|1; //Mark present + else + *pte=*pte&~1; //Mark not present + InvlPg(a); + return res; +} + diff --git a/Kernel/MultiProc.CPP b/Kernel/MultiProc.CPP deleted file mode 100644 index 4347444..0000000 --- a/Kernel/MultiProc.CPP +++ /dev/null @@ -1,390 +0,0 @@ -asm { - ALIGN 16,OC_NOP -USE16 -//See $LK,"TempleOS MultiCore",A="FI:::/Doc/MultiCore.TXT"$. - -//This code gets copied to $LK,"MP_VECT_ADDR",A="MN:MP_VECT_ADDR"$. -//See $LK,"MemCpy(MP_VECT_ADDR",A="FF:::/Kernel/MultiProc.CPP,MemCpy(mp:2"$. -COREAP_16BIT_INIT:: - JMP @@05 - - ALIGN 4,OC_NOP -AP_GDT_PTR: DU16 sizeof(CGDT)-1; - DU64 0; - -@@05: CLI - WBINVD - MOV AX,MP_VECT_ADDR/16 - MOV DS,AX - LGDT U32 [CAP16BitInit.ap_gdt_ptr] //See $LK,"mp->ap_gdt_ptr",A="FF:::/Kernel/MultiProc.CPP,mp->ap_gdt_ptr:2"$ - - MOV EAX,SYS_START_CR0 - MOV_CR0_EAX - DU8 0x66,0xEA; //JMP CGDT.cs32:AP_32BIT_INIT - DU32 AP_32BIT_INIT; - DU16 CGDT.cs32; -COREAP_16BIT_INIT_END:: - -USE32 -AP_32BIT_INIT: - MOV AX,CGDT.ds - MOV DS,AX - MOV ES,AX - MOV FS,AX - MOV GS,AX - MOV SS,AX - -@@05: LOCK - BTS U32 [SYS_MP_CNT_LOCK],0 - JC @@05 - - MOV ESI,U32 [SYS_MP_CNT_INITIAL] - LOCK - INC U32 [SYS_MP_CNT_INITIAL] - LOCK - BTR U32 [SYS_MP_CNT_LOCK],0 - - CMP ESI,MP_MAX_PROCESSORS - JAE I32 _SYS_HLT - - IMUL2 ESI,sizeof(CCPU) - ADD ESI,U32 [SYS_CPU_STRUCTS] - - LEA ESP,U32 CCPU.start_stk+sizeof(CCPU.start_stk)[ESI] - PUSH U32 RFLAGG_START - POPFD - PUSH U32 0 //Return from next call will be 64-bit - CALL SYS_ENTER_LONG_MODE -USE64 - FNINIT - MOV RAX,RSI - CALL SET_GS_BASE -@@10: MOV RAX,U64 CCPU.seth_task[RSI] - TEST RAX,RAX - JZ @@10 - MOV U64 CTask.gs[RAX],RSI - CALL SET_FS_BASE - - JMP I32 _TASK_CONTEXT_RESTORE -} - -U0 TSSBusy(I64 tr,Bool val=OFF) -{//See $LK,"::/Demo/Lectures/Ring3.CPP"$. - LBEqu((&sys_gdt)(U8 *)+tr+4,9,val); -} - -CTSS *TSSNew(I64 cpu_num) -{ - U32 *d,*d1; - CTSS *tss=CAlloc(sizeof(CTSS)); - tss->io_map_offset=offset(CTSS.io_map); - MemSet(tss->io_map,0xFF,0x10000/8); - - tss->st0=MAlloc(MEM_INTERRUPT_STK); - tss->rsp0=tss->st0(U8 *)+MSize(tss->st0); - tss->st1=MAlloc(MEM_INTERRUPT_STK); - tss->rsp1=tss->st1(U8 *)+MSize(tss->st1); - tss->st2=MAlloc(MEM_INTERRUPT_STK); - tss->rsp2=tss->st2(U8 *)+MSize(tss->st2); - - tss->tr =offset(CGDT.tr)+cpu_num*16; - tss->tr_ring3=offset(CGDT.tr_ring3)+cpu_num*16; - - d=(&sys_gdt)(U8 *)+tss->tr; - d1=d(U8 *)+4; - *d =0x0000FFFF; - *d1=0x008F8900; - d(U8 *)+=2; - *d|=tss & 0x00FFFFFF; - *d1++|=tss & 0xFF000000; - *d1++=tss>>32; - *d1=0; - - d=(&sys_gdt)(U8 *)+tss->tr_ring3; - d1=d(U8 *)+4; - *d =0x0000FFFF; - *d1=0x008FE900; - d(U8 *)+=2; - *d|=tss & 0x00FFFFFF; - *d1++|=tss & 0xFF000000; - *d1++=tss>>32; - *d1=0; - - return tss; -} - -CCPU *CPUStructInit(I64 num,CCPU *c,CTask *seth_task) -{//Seth is null when called by adam on CSysFixedArea.boot_cpu0 - MemSet(c,0,sizeof(CCPU)); - c->addr=c; - c->num=num; - c->idle_factor=0.01; - QueInit(&c->next_dying); - if (Bt(&sys_run_level,RLf_BOOT_HEAP)) { - c->idle_task=Spawn(0,NULL,"Idle Task",,Fs,,0); - LBts(&c->idle_task->task_flags,TASKf_IDLE); - c->tss=TSSNew(num); - } - c->seth_task=seth_task;// It waits for this to be filled-in: $LK,"seth_task",A="FF:::/Kernel/MultiProc.CPP,seth_task"$ - return c; -} - -U0 MPInt(U8 num,I64 cpu_num=1) -{//Generate interrupt for specified core. - if (cpu_num>=mp_cnt) { - if (!Bt(&sys_run_level,RLf_MP)) - return; - else - throw('MultCore'); - } - PUSHFD - CLI //Multitasking safe because each core has a local apic and IRQ's are off - while (*(dev.uncached_alias+LAPIC_ICR_LOW)(U32 *)&0x1000) - PAUSE - *(dev.uncached_alias+LAPIC_ICR_HIGH)(U32 *)=dev.mp_apic_ids[cpu_num]<<24; - *(dev.uncached_alias+LAPIC_ICR_LOW)(U32 *)=0x4000+num; - POPFD -} - -U0 MPIntAll(U8 num) -{//Generate interrupt for all but own core. - PUSHFD - CLI //Multitasking safe because each core has a local apic and IRQ's are off - while (*(dev.uncached_alias+LAPIC_ICR_LOW)(U32 *)&0x1000) - PAUSE - *(dev.uncached_alias+LAPIC_ICR_LOW)(U32 *)=0xC4800+num; - POPFD -} - -U0 MPNMInt() -{//Generate nonmaskable interrupt. - *(dev.uncached_alias+LAPIC_ICR_LOW)(U32 *)=0xC4400; -} - -U0 MPHalt() -{//Halt all other cores. - mp_cnt=1; - MPNMInt; - BusyWait(10000); -} - -U0 MPAPICInit() -{//Called by adam during start-up -//and other cores during initialization - //after $LK,"Core0StartMP",A="MN:Core0StartMP"$(). - *(dev.uncached_alias+LAPIC_SVR)(U32 *)|=LAPICF_APIC_ENABLED; - dev.mp_apic_ids[Gs->num]=*(dev.uncached_alias+LAPIC_APIC_ID)(U32 *)>>24; - *(dev.uncached_alias+LAPIC_LDR)(U32 *)=dev.mp_apic_ids[Gs->num]<<24; - *(dev.uncached_alias+LAPIC_DFR)(U32 *)=0xF0000000; - - // MemSet(dev.uncached_alias+LAPIC_IRR,0,0x20); - // MemSet(dev.uncached_alias+LAPIC_ISR,0,0x20); - // MemSet(dev.uncached_alias+LAPIC_TMR,0,0x20); - - SetRAX(Gs->tss->tr); - LTR AX - if (Gs->num) { - IntInit1; - SetRFlags(RFLAGG_NORMAL); - } -} - -#assert !offset(CSrvCtrl.next_waiting) - -U0 CoreAPSethTask() -{ - CSrvCtrl *ctrl=&Fs->srv_ctrl; - while (TRUE) { - STI - do { - TaskKillDying; - do PAUSE - while (LBts(&ctrl->flags,SVCRf_LOCKED)); - } while (ctrl->next_waiting!=ctrl && SrvCmdRunOne(GetRFlags,ctrl)); - CLI - LBts(&Fs->task_flags,TASKf_AWAITING_MSG); - LBtr(&ctrl->flags,SVCRf_LOCKED); - LBts(&Fs->task_flags,TASKf_IDLE); - Yield; - LBtr(&Fs->task_flags,TASKf_IDLE); - } -} - -CSrvCmd *JobQue(I64 (*fp_addr)(U8 *data),U8 *data=NULL, - I64 target_cpu=1,I64 flags=1<aux_str=AStrNew(aux_str); - tempc->cmd_code=cmd_code; - tempc->addr=fp_addr; - tempc->fun_arg=data; - tempc->target_cpu=target_cpu; - tempc->flags=flags; - tempc->aux1=aux1; - tempc->aux2=aux2; - seth=cpu_structs[target_cpu].seth_task; - tempc->ctrl=ctrl=&seth->srv_ctrl; - PUSHFD - CLI - while (LBts(&ctrl->flags,SVCRf_LOCKED)) - Yield; - if (ctrl->next_waiting==ctrl && LBtr(&seth->task_flags,TASKf_AWAITING_MSG)) - MPInt(I_WAKE,target_cpu); - QueIns(tempc,ctrl->last_waiting); - LBtr(&ctrl->flags,SVCRf_LOCKED); - POPFD - return tempc; -} - -CTask *SpawnQue(U0 (*fp_addr)(U8 *data),U8 *data=NULL,U8 *task_name=NULL, - I64 target_cpu, CTask *parent=NULL, //NULL means adam - I64 stk_size=0,I64 flags=1<flags,SVCf_DONE)) { - LBts(&Fs->task_flags,TASKf_IDLE); - Yield; - } - LBtr(&Fs->task_flags,TASKf_IDLE); - - res=tempc->spawned_task; - ctrl=tempc->ctrl; - PUSHFD - CLI - while (LBts(&ctrl->flags,SVCRf_LOCKED)) - Yield; - QueRem(tempc); - LBtr(&ctrl->flags,SVCRf_LOCKED); - POPFD - SrvCmdDel(tempc); - return res; -} - -U0 CoreAPSethInit() -{//Called by multicore's seth task after $LK,"Core0StartMP",A="MN:Core0StartMP"$() -//as the first thing a CPU does before waiting for jobs. - MPAPICInit; - Fs->rip=&CoreAPSethTask; - TaskContextRestore; -} - -U0 Core0StartMP() -{//Called by adam during $LK,"start-up",A="FF:::/Kernel/KEnd.CPP,Core0StartMP"$. - CTask *task; - U8 buf[STR_LEN]; - CAP16BitInit *mp=MP_VECT_ADDR; - CCPU *c; - I64 i,my_mp_cnt; - CRAXRBCRCXRDX ee; - - CPUId(0x1,&ee); - if (!Bt(&ee.rdx,9)) - return; - - PUSHFD - CLI - if (mp_cnt>1) { - my_mp_cnt=mp_cnt; - MPHalt; //sets mp_cnt to 1 - for (i=1;iseth_task->srv_ctrl.next_waiting); - SrvCmdQueDel(&c->seth_task->srv_ctrl.next_done); - } - } - MemSet(&cpu_structs[1],0,sizeof(CCPU)*(MP_MAX_PROCESSORS-1)); - - //When you start-up other cores, they jump to an addr - //specified by a byte vect number, $LK,"MPN_VECT",A="MN:MPN_VECT"$ which corresponds - //to a location 4096*vect number, $LK,"MP_VECT_ADDR",A="MN:MP_VECT_ADDR"$$WW,0$. - MemCpy(mp,COREAP_16BIT_INIT,COREAP_16BIT_INIT_END-COREAP_16BIT_INIT); - MemCpy(&mp->ap_gdt_ptr,SYS_GDT_PTR,sizeof(CSysLimitBase)); - mp_cnt_initial=mp_cnt=1; - mp_cnt_lock=0; - - *(dev.uncached_alias+LAPIC_LVT_ERR)(U32 *)= - *(dev.uncached_alias+LAPIC_LVT_ERR)(U32 *)&0xFFFFFF00+MPN_VECT; - WBINVD //Not sure why this is needed. Might just need delay. $LK,"MemCpy",A="MN:MemCpy"$ above? - - *(dev.uncached_alias+LAPIC_ICR_LOW)(U32 *)=0xC4500; //assert init IPI - BusyWait(10000); - - *(dev.uncached_alias+LAPIC_ICR_LOW)(U32 *)=0xC4600+MPN_VECT; //start-up - BusyWait(200); - *(dev.uncached_alias+LAPIC_ICR_LOW)(U32 *)=0xC4600+MPN_VECT; - - BusyWait(100000); - for (i=0;i<10000;i++) - LBts(&mp_cnt_lock,0); //Don't let more through - my_mp_cnt=mp_cnt_initial; - - if (my_mp_cnt>MP_MAX_PROCESSORS) - my_mp_cnt=MP_MAX_PROCESSORS; - - for (i=1;irflags=RFLAGG_START; -//$LK,"CTask",A="MN:CTask"$ alloced off this core's seth_task's heap (Which is Adam) - CPUStructInit(i,&cpu_structs[i],task); - WBINVD //Not sure why this is needed. Might just need delay. - } - - //Make sure they're all up-and-running - for (i=1;itask_flags,TASKf_AWAITING_MSG)) - PAUSE; - - POPFD - mp_cnt=my_mp_cnt; //Finalize cnt -} - -U0 Core0Init() -{//Called by adam during start-up - CRAXRBCRCXRDX ee; - CPUId(0x1,&ee); - - mp_cnt_initial=mp_cnt=1; - mp_cnt_lock=0; - - dbg.mp_crash=ACAlloc(sizeof(CMPCrash)); - - //Must be in code heap because init code uses 32 bit addr of cpu_struct - adam_task->gs=cpu_structs= - CAlloc(sizeof(CCPU)*MP_MAX_PROCESSORS,Fs->code_heap); - CPUStructInit(0,cpu_structs,adam_task); - asm {//RAX has GS - IMPORT SET_GS_BASE; - CALL SET_GS_BASE - } - if (Bt(&ee.rdx,9)) { -//Unnecessary? - // SetMSR(IA32_LAPIC_BASE,dev.uncached_alias+LAPIC_BASE+0x900); - MPAPICInit; - } -} - -interrupt U0 IntMPCrash() -{//Entering the debugger from another core causes an interrupt on core0 -//Which calls this routine. - *(dev.uncached_alias+LAPIC_EOI)(U32 *)=0; - mp_cnt=1; - Raw(ON); - text.raw_flags|=RWF_SHOW_DOLLAR; - "MP Crash CPU#%02X Task:%08X\n" - "RIP:%P\n",dbg.mp_crash->cpu_num,dbg.mp_crash->task,dbg.mp_crash->rip; - Dbg(dbg.mp_crash->msg,dbg.mp_crash->msg_num); -} diff --git a/Kernel/MultiProc.HC b/Kernel/MultiProc.HC new file mode 100644 index 0000000..9dbf3a7 --- /dev/null +++ b/Kernel/MultiProc.HC @@ -0,0 +1,390 @@ +asm { + ALIGN 16,OC_NOP +USE16 +//See $LK,"TempleOS MultiCore",A="FI:::/Doc/MultiCore.DD"$. + +//This code gets copied to $LK,"MP_VECT_ADDR",A="MN:MP_VECT_ADDR"$. +//See $LK,"MemCpy(MP_VECT_ADDR",A="FF:::/Kernel/MultiProc.HC,MemCpy(mp:2"$. +COREAP_16BIT_INIT:: + JMP @@05 + + ALIGN 4,OC_NOP +AP_GDT_PTR: DU16 sizeof(CGDT)-1; + DU64 0; + +@@05: CLI + WBINVD + MOV AX,MP_VECT_ADDR/16 + MOV DS,AX + LGDT U32 [CAP16BitInit.ap_gdt_ptr] //See $LK,"mp->ap_gdt_ptr",A="FF:::/Kernel/MultiProc.HC,mp->ap_gdt_ptr:2"$ + + MOV EAX,SYS_START_CR0 + MOV_CR0_EAX + DU8 0x66,0xEA; //JMP CGDT.cs32:AP_32BIT_INIT + DU32 AP_32BIT_INIT; + DU16 CGDT.cs32; +COREAP_16BIT_INIT_END:: + +USE32 +AP_32BIT_INIT: + MOV AX,CGDT.ds + MOV DS,AX + MOV ES,AX + MOV FS,AX + MOV GS,AX + MOV SS,AX + +@@05: LOCK + BTS U32 [SYS_MP_CNT_LOCK],0 + JC @@05 + + MOV ESI,U32 [SYS_MP_CNT_INITIAL] + LOCK + INC U32 [SYS_MP_CNT_INITIAL] + LOCK + BTR U32 [SYS_MP_CNT_LOCK],0 + + CMP ESI,MP_MAX_PROCESSORS + JAE I32 _SYS_HLT + + IMUL2 ESI,sizeof(CCPU) + ADD ESI,U32 [SYS_CPU_STRUCTS] + + LEA ESP,U32 CCPU.start_stk+sizeof(CCPU.start_stk)[ESI] + PUSH U32 RFLAGG_START + POPFD + PUSH U32 0 //Return from next call will be 64-bit + CALL SYS_ENTER_LONG_MODE +USE64 + FNINIT + MOV RAX,RSI + CALL SET_GS_BASE +@@10: MOV RAX,U64 CCPU.seth_task[RSI] + TEST RAX,RAX + JZ @@10 + MOV U64 CTask.gs[RAX],RSI + CALL SET_FS_BASE + + JMP I32 _TASK_CONTEXT_RESTORE +} + +U0 TSSBusy(I64 tr,Bool val=OFF) +{//See $LK,"::/Demo/Lectures/Ring3.HC"$. + LBEqu((&sys_gdt)(U8 *)+tr+4,9,val); +} + +CTSS *TSSNew(I64 cpu_num) +{ + U32 *d,*d1; + CTSS *tss=CAlloc(sizeof(CTSS)); + tss->io_map_offset=offset(CTSS.io_map); + MemSet(tss->io_map,0xFF,0x10000/8); + + tss->st0=MAlloc(MEM_INTERRUPT_STK); + tss->rsp0=tss->st0(U8 *)+MSize(tss->st0); + tss->st1=MAlloc(MEM_INTERRUPT_STK); + tss->rsp1=tss->st1(U8 *)+MSize(tss->st1); + tss->st2=MAlloc(MEM_INTERRUPT_STK); + tss->rsp2=tss->st2(U8 *)+MSize(tss->st2); + + tss->tr =offset(CGDT.tr)+cpu_num*16; + tss->tr_ring3=offset(CGDT.tr_ring3)+cpu_num*16; + + d=(&sys_gdt)(U8 *)+tss->tr; + d1=d(U8 *)+4; + *d =0x0000FFFF; + *d1=0x008F8900; + d(U8 *)+=2; + *d|=tss & 0x00FFFFFF; + *d1++|=tss & 0xFF000000; + *d1++=tss>>32; + *d1=0; + + d=(&sys_gdt)(U8 *)+tss->tr_ring3; + d1=d(U8 *)+4; + *d =0x0000FFFF; + *d1=0x008FE900; + d(U8 *)+=2; + *d|=tss & 0x00FFFFFF; + *d1++|=tss & 0xFF000000; + *d1++=tss>>32; + *d1=0; + + return tss; +} + +CCPU *CPUStructInit(I64 num,CCPU *c,CTask *seth_task) +{//Seth is null when called by adam on CSysFixedArea.boot_cpu0 + MemSet(c,0,sizeof(CCPU)); + c->addr=c; + c->num=num; + c->idle_factor=0.01; + QueInit(&c->next_dying); + if (Bt(&sys_run_level,RLf_BOOT_HEAP)) { + c->idle_task=Spawn(0,NULL,"Idle Task",,Fs,,0); + LBts(&c->idle_task->task_flags,TASKf_IDLE); + c->tss=TSSNew(num); + } + c->seth_task=seth_task;// It waits for this to be filled-in: $LK,"seth_task",A="FF:::/Kernel/MultiProc.HC,seth_task"$ + return c; +} + +U0 MPInt(U8 num,I64 cpu_num=1) +{//Generate interrupt for specified core. + if (cpu_num>=mp_cnt) { + if (!Bt(&sys_run_level,RLf_MP)) + return; + else + throw('MultCore'); + } + PUSHFD + CLI //Multitasking safe because each core has a local apic and IRQ's are off + while (*(dev.uncached_alias+LAPIC_ICR_LOW)(U32 *)&0x1000) + PAUSE + *(dev.uncached_alias+LAPIC_ICR_HIGH)(U32 *)=dev.mp_apic_ids[cpu_num]<<24; + *(dev.uncached_alias+LAPIC_ICR_LOW)(U32 *)=0x4000+num; + POPFD +} + +U0 MPIntAll(U8 num) +{//Generate interrupt for all but own core. + PUSHFD + CLI //Multitasking safe because each core has a local apic and IRQ's are off + while (*(dev.uncached_alias+LAPIC_ICR_LOW)(U32 *)&0x1000) + PAUSE + *(dev.uncached_alias+LAPIC_ICR_LOW)(U32 *)=0xC4800+num; + POPFD +} + +U0 MPNMInt() +{//Generate nonmaskable interrupt. + *(dev.uncached_alias+LAPIC_ICR_LOW)(U32 *)=0xC4400; +} + +U0 MPHalt() +{//Halt all other cores. + mp_cnt=1; + MPNMInt; + BusyWait(10000); +} + +U0 MPAPICInit() +{//Called by adam during start-up +//and other cores during initialization + //after $LK,"Core0StartMP",A="MN:Core0StartMP"$(). + *(dev.uncached_alias+LAPIC_SVR)(U32 *)|=LAPICF_APIC_ENABLED; + dev.mp_apic_ids[Gs->num]=*(dev.uncached_alias+LAPIC_APIC_ID)(U32 *)>>24; + *(dev.uncached_alias+LAPIC_LDR)(U32 *)=dev.mp_apic_ids[Gs->num]<<24; + *(dev.uncached_alias+LAPIC_DFR)(U32 *)=0xF0000000; + + // MemSet(dev.uncached_alias+LAPIC_IRR,0,0x20); + // MemSet(dev.uncached_alias+LAPIC_ISR,0,0x20); + // MemSet(dev.uncached_alias+LAPIC_TMR,0,0x20); + + SetRAX(Gs->tss->tr); + LTR AX + if (Gs->num) { + IntInit1; + SetRFlags(RFLAGG_NORMAL); + } +} + +#assert !offset(CSrvCtrl.next_waiting) + +U0 CoreAPSethTask() +{ + CSrvCtrl *ctrl=&Fs->srv_ctrl; + while (TRUE) { + STI + do { + TaskKillDying; + do PAUSE + while (LBts(&ctrl->flags,SVCRf_LOCKED)); + } while (ctrl->next_waiting!=ctrl && SrvCmdRunOne(GetRFlags,ctrl)); + CLI + LBts(&Fs->task_flags,TASKf_AWAITING_MSG); + LBtr(&ctrl->flags,SVCRf_LOCKED); + LBts(&Fs->task_flags,TASKf_IDLE); + Yield; + LBtr(&Fs->task_flags,TASKf_IDLE); + } +} + +CSrvCmd *JobQue(I64 (*fp_addr)(U8 *data),U8 *data=NULL, + I64 target_cpu=1,I64 flags=1<aux_str=AStrNew(aux_str); + tempc->cmd_code=cmd_code; + tempc->addr=fp_addr; + tempc->fun_arg=data; + tempc->target_cpu=target_cpu; + tempc->flags=flags; + tempc->aux1=aux1; + tempc->aux2=aux2; + seth=cpu_structs[target_cpu].seth_task; + tempc->ctrl=ctrl=&seth->srv_ctrl; + PUSHFD + CLI + while (LBts(&ctrl->flags,SVCRf_LOCKED)) + Yield; + if (ctrl->next_waiting==ctrl && LBtr(&seth->task_flags,TASKf_AWAITING_MSG)) + MPInt(I_WAKE,target_cpu); + QueIns(tempc,ctrl->last_waiting); + LBtr(&ctrl->flags,SVCRf_LOCKED); + POPFD + return tempc; +} + +CTask *SpawnQue(U0 (*fp_addr)(U8 *data),U8 *data=NULL,U8 *task_name=NULL, + I64 target_cpu, CTask *parent=NULL, //NULL means adam + I64 stk_size=0,I64 flags=1<flags,SVCf_DONE)) { + LBts(&Fs->task_flags,TASKf_IDLE); + Yield; + } + LBtr(&Fs->task_flags,TASKf_IDLE); + + res=tempc->spawned_task; + ctrl=tempc->ctrl; + PUSHFD + CLI + while (LBts(&ctrl->flags,SVCRf_LOCKED)) + Yield; + QueRem(tempc); + LBtr(&ctrl->flags,SVCRf_LOCKED); + POPFD + SrvCmdDel(tempc); + return res; +} + +U0 CoreAPSethInit() +{//Called by multicore's seth task after $LK,"Core0StartMP",A="MN:Core0StartMP"$() +//as the first thing a CPU does before waiting for jobs. + MPAPICInit; + Fs->rip=&CoreAPSethTask; + TaskContextRestore; +} + +U0 Core0StartMP() +{//Called by adam during $LK,"start-up",A="FF:::/Kernel/KEnd.HC,Core0StartMP"$. + CTask *task; + U8 buf[STR_LEN]; + CAP16BitInit *mp=MP_VECT_ADDR; + CCPU *c; + I64 i,my_mp_cnt; + CRAXRBCRCXRDX ee; + + CPUId(0x1,&ee); + if (!Bt(&ee.rdx,9)) + return; + + PUSHFD + CLI + if (mp_cnt>1) { + my_mp_cnt=mp_cnt; + MPHalt; //sets mp_cnt to 1 + for (i=1;iseth_task->srv_ctrl.next_waiting); + SrvCmdQueDel(&c->seth_task->srv_ctrl.next_done); + } + } + MemSet(&cpu_structs[1],0,sizeof(CCPU)*(MP_MAX_PROCESSORS-1)); + + //When you start-up other cores, they jump to an addr + //specified by a byte vect number, $LK,"MPN_VECT",A="MN:MPN_VECT"$ which corresponds + //to a location 4096*vect number, $LK,"MP_VECT_ADDR",A="MN:MP_VECT_ADDR"$$WW,0$. + MemCpy(mp,COREAP_16BIT_INIT,COREAP_16BIT_INIT_END-COREAP_16BIT_INIT); + MemCpy(&mp->ap_gdt_ptr,SYS_GDT_PTR,sizeof(CSysLimitBase)); + mp_cnt_initial=mp_cnt=1; + mp_cnt_lock=0; + + *(dev.uncached_alias+LAPIC_LVT_ERR)(U32 *)= + *(dev.uncached_alias+LAPIC_LVT_ERR)(U32 *)&0xFFFFFF00+MPN_VECT; + WBINVD //Not sure why this is needed. Might just need delay. $LK,"MemCpy",A="MN:MemCpy"$ above? + + *(dev.uncached_alias+LAPIC_ICR_LOW)(U32 *)=0xC4500; //assert init IPI + BusyWait(10000); + + *(dev.uncached_alias+LAPIC_ICR_LOW)(U32 *)=0xC4600+MPN_VECT; //start-up + BusyWait(200); + *(dev.uncached_alias+LAPIC_ICR_LOW)(U32 *)=0xC4600+MPN_VECT; + + BusyWait(100000); + for (i=0;i<10000;i++) + LBts(&mp_cnt_lock,0); //Don't let more through + my_mp_cnt=mp_cnt_initial; + + if (my_mp_cnt>MP_MAX_PROCESSORS) + my_mp_cnt=MP_MAX_PROCESSORS; + + for (i=1;irflags=RFLAGG_START; +//$LK,"CTask",A="MN:CTask"$ alloced off this core's seth_task's heap (Which is Adam) + CPUStructInit(i,&cpu_structs[i],task); + WBINVD //Not sure why this is needed. Might just need delay. + } + + //Make sure they're all up-and-running + for (i=1;itask_flags,TASKf_AWAITING_MSG)) + PAUSE; + + POPFD + mp_cnt=my_mp_cnt; //Finalize cnt +} + +U0 Core0Init() +{//Called by adam during start-up + CRAXRBCRCXRDX ee; + CPUId(0x1,&ee); + + mp_cnt_initial=mp_cnt=1; + mp_cnt_lock=0; + + dbg.mp_crash=ACAlloc(sizeof(CMPCrash)); + + //Must be in code heap because init code uses 32 bit addr of cpu_struct + adam_task->gs=cpu_structs= + CAlloc(sizeof(CCPU)*MP_MAX_PROCESSORS,Fs->code_heap); + CPUStructInit(0,cpu_structs,adam_task); + asm {//RAX has GS + IMPORT SET_GS_BASE; + CALL SET_GS_BASE + } + if (Bt(&ee.rdx,9)) { +//Unnecessary? + // SetMSR(IA32_LAPIC_BASE,dev.uncached_alias+LAPIC_BASE+0x900); + MPAPICInit; + } +} + +interrupt U0 IntMPCrash() +{//Entering the debugger from another core causes an interrupt on core0 +//Which calls this routine. + *(dev.uncached_alias+LAPIC_EOI)(U32 *)=0; + mp_cnt=1; + Raw(ON); + text.raw_flags|=RWF_SHOW_DOLLAR; + "MP Crash CPU#%02X Task:%08X\n" + "RIP:%P\n",dbg.mp_crash->cpu_num,dbg.mp_crash->task,dbg.mp_crash->rip; + Dbg(dbg.mp_crash->msg,dbg.mp_crash->msg_num); +} diff --git a/Kernel/PCIBIOS.CPP b/Kernel/PCIBIOS.HC similarity index 100% rename from Kernel/PCIBIOS.CPP rename to Kernel/PCIBIOS.HC diff --git a/Kernel/QSort.CPP b/Kernel/QSort.CPP deleted file mode 100644 index fd0e347..0000000 --- a/Kernel/QSort.CPP +++ /dev/null @@ -1,104 +0,0 @@ -U0 QSortI64(I64 *base,I64 num, I64 (*fp_compare)(I64 e1,I64 e2)) -{/*Quick Sort for width==8. -fp_compare() passes by value instead of ref. - -For ascending strings: return StrCmp(e1,e2); -For ascending ints : return e1-e2; - -Maybe, look at $LK,"::/Demo/MultiCore/RadixSort.CPP"$. -*/ - I64 i,*left,*right,pivot; - if (num>1) { - left =base; - right=base+num-1; - pivot=base[num/2]; - do { - while ((*fp_compare)(*left,pivot)<0) - left++; - while ((*fp_compare)(*right,pivot)>0) - right--; - if (left<=right) - SwapI64(left++,right--); - } while (left<=right); - i=right+1-base; - if (10) - right--; - if (left<=right) - SwapI64(left++,right--); - } while (left<=right); - i=right+1-base; - if (10) - right-=width; - if (left<=right) { - if (left!=right) { - MemCpy(temp,right,width); - MemCpy(right,left,width); - MemCpy(left,temp,width); - } - left+=width; - right-=width; - } - } while (left<=right); - i=1+(right-base)/width; - if (11) { - if (width==sizeof(U8 *)) //assign instead of MemCpy for width 8 - QSort2a(base,num,fp_compare); - else { - temp=MAlloc(width*2); - QSort2b(base,num,width,fp_compare,temp); - Free(temp); - } - } -} diff --git a/Kernel/QSort.HC b/Kernel/QSort.HC new file mode 100644 index 0000000..a5e973f --- /dev/null +++ b/Kernel/QSort.HC @@ -0,0 +1,104 @@ +U0 QSortI64(I64 *base,I64 num, I64 (*fp_compare)(I64 e1,I64 e2)) +{/*Quick Sort for width==8. +fp_compare() passes by value instead of ref. + +For ascending strings: return StrCmp(e1,e2); +For ascending ints : return e1-e2; + +Maybe, look at $LK,"::/Demo/MultiCore/RadixSort.HC"$. +*/ + I64 i,*left,*right,pivot; + if (num>1) { + left =base; + right=base+num-1; + pivot=base[num/2]; + do { + while ((*fp_compare)(*left,pivot)<0) + left++; + while ((*fp_compare)(*right,pivot)>0) + right--; + if (left<=right) + SwapI64(left++,right--); + } while (left<=right); + i=right+1-base; + if (10) + right--; + if (left<=right) + SwapI64(left++,right--); + } while (left<=right); + i=right+1-base; + if (10) + right-=width; + if (left<=right) { + if (left!=right) { + MemCpy(temp,right,width); + MemCpy(right,left,width); + MemCpy(left,temp,width); + } + left+=width; + right-=width; + } + } while (left<=right); + i=1+(right-base)/width; + if (11) { + if (width==sizeof(U8 *)) //assign instead of MemCpy for width 8 + QSort2a(base,num,fp_compare); + else { + temp=MAlloc(width*2); + QSort2b(base,num,width,fp_compare,temp); + Free(temp); + } + } +} diff --git a/Kernel/Sched.CPP b/Kernel/Sched.HC similarity index 100% rename from Kernel/Sched.CPP rename to Kernel/Sched.HC diff --git a/Kernel/SerialDev/InputPointer.CPP b/Kernel/SerialDev/InputPointer.CPP deleted file mode 100644 index 58c8a4f..0000000 --- a/Kernel/SerialDev/InputPointer.CPP +++ /dev/null @@ -1,84 +0,0 @@ -U0 GridInit() -{//Init input pointer grid struct. See $LK,"::/Demo/Graphics/Grid.CPP"$. - ip_grid.x=ip_grid.y=ip_grid.z=8; - ip_grid.x_offset=ip_grid.y_offset=ip_grid.z_offset=0; - ip_grid.x_speed =ip_grid.y_speed =ip_grid.z_speed =1; - ip_grid.show=ip_grid.snap=FALSE; -} - -U0 IPVarsUpdate(I64 x,I64 y,I64 z,Bool l,Bool r) -{ - ip.presnap.x=ToI64(ip.scale.x*x)+ip.offset.x; - ip.presnap.y=ToI64(ip.scale.y*y)+ip.offset.y; - ip.presnap.z=ToI64(ip.scale.z*z)+ip.offset.z; - if (ip_grid.snap) { - ip.pos.x=Trunc(ip.presnap.x/ip_grid.x)*ip_grid.x+ip_grid.x_offset; - ip.pos.y=Trunc(ip.presnap.y/ip_grid.y)*ip_grid.y+ip_grid.y_offset; - ip.pos.z=Trunc(ip.presnap.z/ip_grid.z)*ip_grid.z+ip_grid.z_offset; - } else { - ip.pos.x=ip.presnap.x; - ip.pos.y=ip.presnap.y; - ip.pos.z=ip.presnap.z; - } - - ip.pos.x=ClampI64(ip.pos.x,0,GR_WIDTH-1); - ip.pos.y=ClampI64(ip.pos.y,0,GR_HEIGHT-1); - ip.throttle=ClampI64(ip.throttle,MIN_I32,MAX_I32); - ip.pos_text.x=ip.pos.x/FONT_WIDTH; - if (ip.pos_text.x>=text.cols) { - ip.pos_text.x=text.cols-1; - ip.pos.x=text.cols*FONT_WIDTH-1; - } - ip.pos_text.y=ip.pos.y/FONT_HEIGHT; - if (ip.pos_text.y>=text.rows) { - ip.pos_text.y=text.rows-1; - ip.pos.y=text.rows*FONT_HEIGHT-1; - } - ip.lb=l; - ip.rb=r; - LBEqu(&kbd.scan_code,SCf_IP_L_DOWN,ip.lb); - LBEqu(&kbd.scan_code,SCf_IP_R_DOWN,ip.rb); -} - -U0 IPSet(I64 x=MAX_I64,I64 y=MAX_I64,I64 z=MAX_I64,I64 l=MAX_I64,I64 r=MAX_I64) -{//Note: Generates a message. See $LK,"IPSet",A="FF:::/Demo/Games/Zing.CPP,IPSet"$(). - if (!(0<=x>3; - ip.offset.x=ip.offset.y=ip.offset.z=0; - ip.scale.x=ip.scale.y=ip.scale.z=1.0; - ip.dev=IP_NULL; - ip.pos_text.x=ip.pos_text.y=ip.pos_text.z=0; - ip.has_wheel=FALSE; - ip.show=TRUE; - ip.speed=0; - ip.timestamp=GetTSC; - ip.dbl_time=0.350; - GridInit; -} diff --git a/Kernel/SerialDev/InputPointer.HC b/Kernel/SerialDev/InputPointer.HC new file mode 100644 index 0000000..b0cff71 --- /dev/null +++ b/Kernel/SerialDev/InputPointer.HC @@ -0,0 +1,84 @@ +U0 GridInit() +{//Init input pointer grid struct. See $LK,"::/Demo/Graphics/Grid.HC"$. + ip_grid.x=ip_grid.y=ip_grid.z=8; + ip_grid.x_offset=ip_grid.y_offset=ip_grid.z_offset=0; + ip_grid.x_speed =ip_grid.y_speed =ip_grid.z_speed =1; + ip_grid.show=ip_grid.snap=FALSE; +} + +U0 IPVarsUpdate(I64 x,I64 y,I64 z,Bool l,Bool r) +{ + ip.presnap.x=ToI64(ip.scale.x*x)+ip.offset.x; + ip.presnap.y=ToI64(ip.scale.y*y)+ip.offset.y; + ip.presnap.z=ToI64(ip.scale.z*z)+ip.offset.z; + if (ip_grid.snap) { + ip.pos.x=Trunc(ip.presnap.x/ip_grid.x)*ip_grid.x+ip_grid.x_offset; + ip.pos.y=Trunc(ip.presnap.y/ip_grid.y)*ip_grid.y+ip_grid.y_offset; + ip.pos.z=Trunc(ip.presnap.z/ip_grid.z)*ip_grid.z+ip_grid.z_offset; + } else { + ip.pos.x=ip.presnap.x; + ip.pos.y=ip.presnap.y; + ip.pos.z=ip.presnap.z; + } + + ip.pos.x=ClampI64(ip.pos.x,0,GR_WIDTH-1); + ip.pos.y=ClampI64(ip.pos.y,0,GR_HEIGHT-1); + ip.throttle=ClampI64(ip.throttle,MIN_I32,MAX_I32); + ip.pos_text.x=ip.pos.x/FONT_WIDTH; + if (ip.pos_text.x>=text.cols) { + ip.pos_text.x=text.cols-1; + ip.pos.x=text.cols*FONT_WIDTH-1; + } + ip.pos_text.y=ip.pos.y/FONT_HEIGHT; + if (ip.pos_text.y>=text.rows) { + ip.pos_text.y=text.rows-1; + ip.pos.y=text.rows*FONT_HEIGHT-1; + } + ip.lb=l; + ip.rb=r; + LBEqu(&kbd.scan_code,SCf_IP_L_DOWN,ip.lb); + LBEqu(&kbd.scan_code,SCf_IP_R_DOWN,ip.rb); +} + +U0 IPSet(I64 x=MAX_I64,I64 y=MAX_I64,I64 z=MAX_I64,I64 l=MAX_I64,I64 r=MAX_I64) +{//Note: Generates a message. See $LK,"IPSet",A="FF:::/Demo/Games/Zing.HC,IPSet"$(). + if (!(0<=x>3; + ip.offset.x=ip.offset.y=ip.offset.z=0; + ip.scale.x=ip.scale.y=ip.scale.z=1.0; + ip.dev=IP_NULL; + ip.pos_text.x=ip.pos_text.y=ip.pos_text.z=0; + ip.has_wheel=FALSE; + ip.show=TRUE; + ip.speed=0; + ip.timestamp=GetTSC; + ip.dbl_time=0.350; + GridInit; +} diff --git a/Kernel/SerialDev/Keyboard.CPP b/Kernel/SerialDev/Keyboard.HC similarity index 100% rename from Kernel/SerialDev/Keyboard.CPP rename to Kernel/SerialDev/Keyboard.HC diff --git a/Kernel/SerialDev/MakeSerialDev.CPP b/Kernel/SerialDev/MakeSerialDev.HC similarity index 100% rename from Kernel/SerialDev/MakeSerialDev.CPP rename to Kernel/SerialDev/MakeSerialDev.HC diff --git a/Kernel/SerialDev/Message.CPP b/Kernel/SerialDev/Message.CPP deleted file mode 100644 index 38c507d..0000000 --- a/Kernel/SerialDev/Message.CPP +++ /dev/null @@ -1,244 +0,0 @@ -U0 InputFilterTask() -{ - CSrvCmd *tempc,*tempc1; - Bool old_filter; - I64 old_flags=GetRFlags; - Fs->win_inhibit=WIG_USER_TASK_DFT; - LBts(&Fs->task_flags,TASKf_INPUT_FILTER_TASK); - old_filter=LBts(&Fs->last_input_filter_task->task_flags,TASKf_FILTER_INPUT); - LBEqu(&Fs->task_flags,TASKf_FILTER_INPUT,old_filter); - while (TRUE) { - CLI - SrvCmdsHandler(old_flags); - tempc1=&Fs->srv_ctrl.next_waiting; - tempc=tempc1->next; - if (tempc==tempc1) - break; - else { - if (tempc->cmd_code==SVCT_TEXT_INPUT) { - QueRem(tempc); - SetRFlags(old_flags); - try - ExePrint("%s",tempc->aux_str); - catch - Fs->catch_except=TRUE; - SrvCmdDel(tempc); - } else - break; - } - } - Fs->next_input_filter_task->last_input_filter_task=Fs->last_input_filter_task; - Fs->last_input_filter_task->next_input_filter_task=Fs->next_input_filter_task; - if (!old_filter) - LBtr(&Fs->last_input_filter_task->task_flags,TASKf_FILTER_INPUT); - SetRFlags(old_flags); -} - -I64 ScanMsg(I64 *_a1=NULL,I64 *_a2=NULL,I64 mask=~1,CTask *task=NULL) -{/*Check for a message of type specified by a one in the mask. -Throw-out messages not in mask. -If no message fit mask, return NULL immediately. -Remove desired message, return $LK,"msg_code",A="MN:MSG_CMD"$. -Note: This delivers messages from parent down to pop-up. -*/ - I64 res,old_flags; - CSrvCmd *tempc,*tempc1; - if (!task) task=Fs; - old_flags=GetRFlags; - tempc1=&task->srv_ctrl.next_waiting; - while (TRUE) { - CLI - if (task==Fs) - SrvCmdsHandler(old_flags); - tempc=tempc1->next; - if (tempc==tempc1) - break; - else { - if (tempc->cmd_code==SVCT_MSG) { - QueRem(tempc); - SetRFlags(old_flags); - res=tempc->msg_code; - if (_a1) - *_a1=tempc->aux1; - if (_a2) - *_a2=tempc->aux2; - SrvCmdDel(tempc); - if ((res!=MSG_KEY_DOWN || !(tempc->aux2&SCF_KEY_DESC) || - !Bt(&task->win_inhibit,WIf_SELF_KEY_DESC)) && Bt(&mask,res)) - goto sm_done; - } - } - SetRFlags(old_flags); - } - res=MSG_NULL; - if (_a1) - *_a1=0; - if (_a2) - *_a2=0; - if (task->parent_task&&task->parent_task->popup_task==task) { - SetRFlags(old_flags); - return ScanMsg(_a1,_a2,mask,task->parent_task); - } -sm_done: - SetRFlags(old_flags); - return res; -} - -I64 FlushMsgs(CTask *task=NULL) -{//Throw away all messages. Return count. - I64 res=0,a1,a2; - while (ScanMsg(&a1,&a2,~1,task)) - res++; - return res; -} - -I64 GetMsg(I64 *_a1=NULL,I64 *_a2=NULL,I64 mask=~1,CTask *task=NULL) -{//Wait for a message of type specified by a one in the mask. -//Throw-out all messages not in mask. - //Returns $LK,"msg_code",A="MN:MSG_CMD"$. See $LK,"::/Demo/MsgLoop.CPP"$. - I64 res; - if (!task) task=Fs; - LBtr(&task->task_flags,TASKf_IDLE); - while (!(res=ScanMsg(_a1,_a2,mask,task))) { - LBts(&task->task_flags,TASKf_IDLE); - Yield; - } - LBtr(&task->task_flags,TASKf_IDLE); - return res; -} - -I64 ScanChar() -{//Checks for $LK,"MSG_KEY_DOWN",A="MN:MSG_KEY_DOWN"$ and returns 0 immediately if no key. -//Waits for $LK,"MSG_KEY_UP",A="MN:MSG_KEY_UP"$ of non-zero $LK,"ASCII",A="MN:CH_CTRLA"$ key and returns $LK,"ASCII",A="MN:CH_CTRLA"$ if key. - //$LK,"ScanMsg",A="MN:ScanMsg"$() throws away other message types. - I64 a1a,a2a,a1b,a2b; - if (!ScanMsg(&a1a,&a2a,1<task_flags,TASKf_IDLE); - if (IsDbg) { -//We don't want interrupt-driven keyboard when in debugger - //because that could have side-effects or crash, so we poll - //keyboard when in debugger with interrupts off. - PUSHFD - CLI - KbdMouseHandler(TRUE,FALSE); - KbdMsgsQue; - POPFD - } else { - LBts(&Fs->task_flags,TASKf_AWAITING_MSG); - Yield; - } - LBtr(&Fs->task_flags,TASKf_IDLE); - } - if (IsRaw && raw_cursor && cursor_on) - '' CH_BACKSPACE; - if (echo) - PutKey(ch,sc); - if (_scan_code) *_scan_code=sc; - return ch; -} - -I64 GetChar(I64 *_scan_code=NULL,Bool echo=TRUE,Bool raw_cursor=FALSE) -{//Waits for non-zero $LK,"ASCII",A="MN:CH_CTRLA"$ key. -//Sets $LK,"scan_code",A="FI:::/Doc/CharOverview.TXT"$. - I64 ch1; - do ch1=GetKey(_scan_code,FALSE,raw_cursor); - while (!ch1); - if (echo) - "$$PT$$%c$$FG$$",ch1; - return ch1; -} - -U8 *GetStr(U8 *msg=NULL,U8 *dft=NULL,I64 flags=0) -{//Returns a $LK,"MAlloc",A="MN:MAlloc"$()ed prompted string. See $LK,"Flags",A="MN:GSF_SHIFT_ESC_EXIT"$. - U8 *st; - if (msg) - "" msg,dft; - st=(*fp_getstr2)(flags); - if (!*st) { - Free(st); - if (dft) - return StrNew(dft); - else - return StrNew(""); - } - return st; -} - -I64 GetS(U8 *buf,I64 size,Bool allow_ext=TRUE) -{//Prompt into fixed length string. Size must include terminator. - U8 *st; - I64 ch,i=0; - if (!size || !buf) return 0; - if (allow_ext) { - st=GetStr; - if (StrLen(st)>size-1) { - MemCpy(buf,st,size-1); - buf[size-1]=0; - } else - StrCpy(buf,st); - i=StrLen(buf); - Free(st); - } else { - while (TRUE) { - ch=GetChar(,FALSE,IsDbg); - if (ch=='\n') { - '' ch; - break; - } else if (ch==CH_BACKSPACE) { - if (i>0) { - i--; - '' ch; - } - } else { - if (iwin_inhibit=WIG_USER_TASK_DFT; + LBts(&Fs->task_flags,TASKf_INPUT_FILTER_TASK); + old_filter=LBts(&Fs->last_input_filter_task->task_flags,TASKf_FILTER_INPUT); + LBEqu(&Fs->task_flags,TASKf_FILTER_INPUT,old_filter); + while (TRUE) { + CLI + SrvCmdsHandler(old_flags); + tempc1=&Fs->srv_ctrl.next_waiting; + tempc=tempc1->next; + if (tempc==tempc1) + break; + else { + if (tempc->cmd_code==SVCT_TEXT_INPUT) { + QueRem(tempc); + SetRFlags(old_flags); + try + ExePrint("%s",tempc->aux_str); + catch + Fs->catch_except=TRUE; + SrvCmdDel(tempc); + } else + break; + } + } + Fs->next_input_filter_task->last_input_filter_task=Fs->last_input_filter_task; + Fs->last_input_filter_task->next_input_filter_task=Fs->next_input_filter_task; + if (!old_filter) + LBtr(&Fs->last_input_filter_task->task_flags,TASKf_FILTER_INPUT); + SetRFlags(old_flags); +} + +I64 ScanMsg(I64 *_a1=NULL,I64 *_a2=NULL,I64 mask=~1,CTask *task=NULL) +{/*Check for a message of type specified by a one in the mask. +Throw-out messages not in mask. +If no message fit mask, return NULL immediately. +Remove desired message, return $LK,"msg_code",A="MN:MSG_CMD"$. +Note: This delivers messages from parent down to pop-up. +*/ + I64 res,old_flags; + CSrvCmd *tempc,*tempc1; + if (!task) task=Fs; + old_flags=GetRFlags; + tempc1=&task->srv_ctrl.next_waiting; + while (TRUE) { + CLI + if (task==Fs) + SrvCmdsHandler(old_flags); + tempc=tempc1->next; + if (tempc==tempc1) + break; + else { + if (tempc->cmd_code==SVCT_MSG) { + QueRem(tempc); + SetRFlags(old_flags); + res=tempc->msg_code; + if (_a1) + *_a1=tempc->aux1; + if (_a2) + *_a2=tempc->aux2; + SrvCmdDel(tempc); + if ((res!=MSG_KEY_DOWN || !(tempc->aux2&SCF_KEY_DESC) || + !Bt(&task->win_inhibit,WIf_SELF_KEY_DESC)) && Bt(&mask,res)) + goto sm_done; + } + } + SetRFlags(old_flags); + } + res=MSG_NULL; + if (_a1) + *_a1=0; + if (_a2) + *_a2=0; + if (task->parent_task&&task->parent_task->popup_task==task) { + SetRFlags(old_flags); + return ScanMsg(_a1,_a2,mask,task->parent_task); + } +sm_done: + SetRFlags(old_flags); + return res; +} + +I64 FlushMsgs(CTask *task=NULL) +{//Throw away all messages. Return count. + I64 res=0,a1,a2; + while (ScanMsg(&a1,&a2,~1,task)) + res++; + return res; +} + +I64 GetMsg(I64 *_a1=NULL,I64 *_a2=NULL,I64 mask=~1,CTask *task=NULL) +{//Wait for a message of type specified by a one in the mask. +//Throw-out all messages not in mask. + //Returns $LK,"msg_code",A="MN:MSG_CMD"$. See $LK,"::/Demo/MsgLoop.HC"$. + I64 res; + if (!task) task=Fs; + LBtr(&task->task_flags,TASKf_IDLE); + while (!(res=ScanMsg(_a1,_a2,mask,task))) { + LBts(&task->task_flags,TASKf_IDLE); + Yield; + } + LBtr(&task->task_flags,TASKf_IDLE); + return res; +} + +I64 ScanChar() +{//Checks for $LK,"MSG_KEY_DOWN",A="MN:MSG_KEY_DOWN"$ and returns 0 immediately if no key. +//Waits for $LK,"MSG_KEY_UP",A="MN:MSG_KEY_UP"$ of non-zero $LK,"ASCII",A="MN:CH_CTRLA"$ key and returns $LK,"ASCII",A="MN:CH_CTRLA"$ if key. + //$LK,"ScanMsg",A="MN:ScanMsg"$() throws away other message types. + I64 a1a,a2a,a1b,a2b; + if (!ScanMsg(&a1a,&a2a,1<task_flags,TASKf_IDLE); + if (IsDbg) { +//We don't want interrupt-driven keyboard when in debugger + //because that could have side-effects or crash, so we poll + //keyboard when in debugger with interrupts off. + PUSHFD + CLI + KbdMouseHandler(TRUE,FALSE); + KbdMsgsQue; + POPFD + } else { + LBts(&Fs->task_flags,TASKf_AWAITING_MSG); + Yield; + } + LBtr(&Fs->task_flags,TASKf_IDLE); + } + if (IsRaw && raw_cursor && cursor_on) + '' CH_BACKSPACE; + if (echo) + PutKey(ch,sc); + if (_scan_code) *_scan_code=sc; + return ch; +} + +I64 GetChar(I64 *_scan_code=NULL,Bool echo=TRUE,Bool raw_cursor=FALSE) +{//Waits for non-zero $LK,"ASCII",A="MN:CH_CTRLA"$ key. +//Sets $LK,"scan_code",A="FI:::/Doc/CharOverview.DD"$. + I64 ch1; + do ch1=GetKey(_scan_code,FALSE,raw_cursor); + while (!ch1); + if (echo) + "$$PT$$%c$$FG$$",ch1; + return ch1; +} + +U8 *GetStr(U8 *msg=NULL,U8 *dft=NULL,I64 flags=0) +{//Returns a $LK,"MAlloc",A="MN:MAlloc"$()ed prompted string. See $LK,"Flags",A="MN:GSF_SHIFT_ESC_EXIT"$. + U8 *st; + if (msg) + "" msg,dft; + st=(*fp_getstr2)(flags); + if (!*st) { + Free(st); + if (dft) + return StrNew(dft); + else + return StrNew(""); + } + return st; +} + +I64 GetS(U8 *buf,I64 size,Bool allow_ext=TRUE) +{//Prompt into fixed length string. Size must include terminator. + U8 *st; + I64 ch,i=0; + if (!size || !buf) return 0; + if (allow_ext) { + st=GetStr; + if (StrLen(st)>size-1) { + MemCpy(buf,st,size-1); + buf[size-1]=0; + } else + StrCpy(buf,st); + i=StrLen(buf); + Free(st); + } else { + while (TRUE) { + ch=GetChar(,FALSE,IsDbg); + if (ch=='\n') { + '' ch; + break; + } else if (ch==CH_BACKSPACE) { + if (i>0) { + i--; + '' ch; + } + } else { + if (iaux_str); - Free(tempc); -} - -U0 SrvCmdQueDel(CSrvCmd *head) -{ - CSrvCmd *tempc=head->next,*tempc1; - while (tempc!=head) { - tempc1=tempc->next; - QueRem(tempc); - SrvCmdDel(tempc); - tempc=tempc1; - } -} - -U0 SrvCtrlInit(CSrvCtrl *ctrl) -{ - QueInit(&ctrl->next_waiting); - QueInit(&ctrl->next_done); - ctrl->flags=0; -} - -U0 TaskRstAwaitingMsg(CTask *task=NULL) -{//Pop-ups get parent messages so wake-up our pop-ups if we got a msg. - if (!task) task=Fs; - PUSHFD - CLI - do { - if (TaskValidate(task)) - LBtr(&task->task_flags,TASKf_AWAITING_MSG); - else - break; - } while (task=task->popup_task); - POPFD -} - -CSrvCmd *TaskExe(CTask *srv,CTask *master,U8 *data,I64 flags) -{//Queues a request to compile and execute src code text. - CSrvCmd *res; - if (!data || !TaskValidate(srv) || master && !TaskValidate(master) || - srv->popup_task && !Bt(&srv->task_flags,TASKf_FILTER_INPUT)) - return NULL; - res=ACAlloc(sizeof(CSrvCmd)); - res->master_task=master; - res->cmd_code=SVCT_EXE_STR; - res->flags=flags; - res->aux_str=AStrNew(data); - res->ctrl=&srv->srv_ctrl; - - PUSHFD - CLI - while (LBts(&srv->srv_ctrl.flags,SVCRf_LOCKED)) - PAUSE - if (!TaskValidate(srv)) { - LBtr(&srv->srv_ctrl.flags,SVCRf_LOCKED); - POPFD - SrvCmdDel(res); - return NULL; - } else { - LBtr(&srv->task_flags,TASKf_IDLE); - TaskRstAwaitingMsg(srv); - QueIns(res,srv->srv_ctrl.last_waiting); - LBtr(&srv->srv_ctrl.flags,SVCRf_LOCKED); - if (Bt(&flags,SVCf_WAKE_MASTER)) { - Suspend(master); - Yield; - } - } - POPFD - return res; -} - -CSrvCmd *TaskText(CTask *srv,CTask *master,U8 *data,I64 flags) -{//Post StdIn text to servant task. Tell who the master task is. - CSrvCmd *res; - CTask *task; - if (!data || !TaskValidate(srv) || master && !TaskValidate(master) || - srv->popup_task && !Bt(&srv->task_flags,TASKf_FILTER_INPUT)) - return NULL; - res=ACAlloc(sizeof(CSrvCmd)); - res->master_task=master; //in case somebody cares - res->cmd_code=SVCT_TEXT_INPUT; - res->flags=flags; - res->aux_str=AStrNew(data); - - PUSHFD - task=srv->last_input_filter_task; - if (Bt(&flags,SVCf_HIGHEST_PRIORITY) || task==srv) { - if (task!=srv) - TaskWait(srv); - task=Spawn(&InputFilterTask,NULL,"Input Filter",,srv); - CLI - task->next_input_filter_task=srv->next_input_filter_task; - task->last_input_filter_task=srv; - srv->next_input_filter_task=task; - task->next_input_filter_task->last_input_filter_task=task; - } else { - CLI - task=srv->next_input_filter_task; - } - res->ctrl=&task->srv_ctrl; - while (LBts(&task->srv_ctrl.flags,SVCRf_LOCKED)) - PAUSE - if (!TaskValidate(task)) { - SrvCmdDel(res); - res=NULL; - } else { - LBtr(&task->task_flags,TASKf_IDLE); - TaskRstAwaitingMsg(task); - QueIns(res,task->srv_ctrl.last_waiting); - LBtr(&task->srv_ctrl.flags,SVCRf_LOCKED); - } - POPFD - return res; -} - -CSrvCmd *TaskMsg(CTask *_srv,CTask *master,I64 msg_code,I64 a1,I64 a2,I64 flags) -{//Post message to servant task. Tell who the master task is. -//See $LK,"flags",A="MN:SVCf_WAKE_MASTER"$ and $LK,"msg_code",A="MN:MSG_CMD"$. - CSrvCmd *tempc1,*tempc; - CTask *srv=_srv; - if (!TaskValidate(srv) || master && !TaskValidate(master)|| - srv->popup_task && !Bt(&srv->task_flags,TASKf_FILTER_INPUT)) - return NULL; - tempc=ACAlloc(sizeof(CSrvCmd)); - tempc->master_task=master; - tempc->cmd_code=SVCT_MSG; - tempc->msg_code=AbsI64(msg_code); //negative means do a down and up - tempc->aux1=a1; - tempc->aux2=a2; - tempc->flags=flags; - PUSHFD - if (Bt(&sys_semas[SYS_SEMA_RECORD_MACRO],0) && - srv!=sys_macro_task && msg_code==MSG_KEY_DOWN) { - tempc1=AMAllocIdent(tempc); - CLI - QueIns(tempc1,sys_macro_head.last); - } - CLI - while (Bt(&srv->task_flags,TASKf_FILTER_INPUT) && - !Bt(&flags,SVCf_DONT_FILTER)) - srv=srv->next_input_filter_task; - tempc->ctrl=&srv->srv_ctrl; - while (LBts(&srv->srv_ctrl.flags,SVCRf_LOCKED)) - PAUSE - if (!TaskValidate(srv)) { - SrvCmdDel(tempc); - tempc=NULL; - } else { - LBtr(&srv->task_flags,TASKf_IDLE); - TaskRstAwaitingMsg(srv); - QueIns(tempc,srv->srv_ctrl.last_waiting); - LBtr(&srv->srv_ctrl.flags,SVCRf_LOCKED); - } - POPFD - if (msg_code<0) //Down-Up - TaskMsg(_srv,master,-msg_code+1,a1,a2,flags); - return tempc; -} - -Bool JobResScan(CSrvCmd *rqst=NULL,I64 *_res=NULL) -{//Check rqst complete, return with or without. - CSrvCtrl *ctrl; - CSrvCmd *tempc,*tempc1; - if (!rqst || Bt(&rqst->flags,SVCf_DONE)) { - if (!rqst || rqst->master_task) - ctrl=&Fs->srv_ctrl; - else - ctrl=rqst->ctrl; - PUSHFD - CLI - while (LBts(&ctrl->flags,SVCRf_LOCKED)) - PAUSE - tempc1=&ctrl->next_done; - tempc=tempc1->next; - while (tempc!=tempc1) { - if (!rqst || rqst==tempc) { - QueRem(tempc); - LBtr(&ctrl->flags,SVCRf_LOCKED); - POPFD - if (_res) - *_res=tempc->res; - SrvCmdDel(tempc); - return TRUE; - } - tempc=tempc->next; - } - LBtr(&ctrl->flags,SVCRf_LOCKED); - POPFD - } - if (_res) - *_res=0; - return FALSE; -} - -I64 JobResGet(CSrvCmd *rqst=NULL) -{//See $LK,"::/Demo/MultiCore/Lock.CPP"$ - I64 res; - CSrvCmd *tempc1; - if (!rqst) { - tempc1=&Fs->srv_ctrl.next_done; - while (tempc1==tempc1->next) { - LBts(&Fs->task_flags,TASKf_IDLE); - Yield; - } - } else { - while (!Bt(&rqst->flags,SVCf_DONE)) { - LBts(&Fs->task_flags,TASKf_IDLE); - Yield; - } - } - LBtr(&Fs->task_flags,TASKf_IDLE); -//Could get taken by someone else. - JobResScan(rqst,&res); - return res; -} - -U0 TaskWait(CTask *task=NULL) -{//Wait for idle. - CTask *task1; - CSrvCmd *tempc1; - if (!task) task=Fs; - if (TaskValidate(task)) { - PUSHFD - CLI - while (TRUE) { - task1=task->last_input_filter_task; - tempc1=&task1->srv_ctrl.next_waiting; - if (task1==Fs || !TaskValidate(task1) || - tempc1==tempc1->next && Bt(&task1->task_flags,TASKf_IDLE)) - break; - Yield; - } - POPFD - } -} - -U0 PostMsg(CTask *task,I64 msg_code,I64 a1,I64 a2,I64 flags=0) -{//Post message to a task and return immediately. See $LK,"msg_code",A="MN:MSG_CMD"$. - if (TaskValidate(task)) { - if (Bt(&task->task_flags,TASKf_INPUT_FILTER_TASK)) - TaskMsg(task->last_input_filter_task,NULL,msg_code,a1,a2, - flags|1<flags,SVCRf_LOCKED. - CSrvCmd *tempc=ctrl->next_waiting; - CTask *master; - I64 res,flags=tempc->flags,old_flags=GetRFlags; - if (Bt(&flags,SVCf_EXIT_ON_COMPLETE)) - res=SCR_EXIT; - else - res=SCR_CONT; - switch (tempc->cmd_code) { - case SVCT_SPAWN_TASK: - QueRem(tempc); - LBts(&tempc->flags,SVCf_DISPATCHED); - tempc->servant_cpu_num=Gs->num; - LBtr(&ctrl->flags,SVCRf_LOCKED); - if (tempc->aux_str) - tempc->spawned_task=Spawn(tempc->addr,tempc->fun_arg, - tempc->aux_str,,tempc->aux1,tempc->aux2,tempc->flags); - else - tempc->spawned_task=Spawn(tempc->addr,tempc->fun_arg, - "Unnamed",,tempc->aux1,tempc->aux2,tempc->flags); - break; - case SVCT_CALL: - QueRem(tempc); - LBts(&tempc->flags,SVCf_DISPATCHED); - tempc->servant_cpu_num=Gs->num; - LBtr(&ctrl->flags,SVCRf_LOCKED); - SetRFlags(run_flags); - LBtr(&Fs->task_flags,TASKf_IDLE); - try - tempc->res=(*tempc->addr)(tempc->fun_arg); - catch - Fs->catch_except=TRUE; - SetRFlags(old_flags); - break; - case SVCT_EXE_STR: - QueRem(tempc); - LBts(&tempc->flags,SVCf_DISPATCHED); - tempc->servant_cpu_num=Gs->num; - LBtr(&ctrl->flags,SVCRf_LOCKED); - SetRFlags(run_flags); - LBtr(&Fs->task_flags,TASKf_IDLE); - try - tempc->res=ExePrint("%s",tempc->aux_str); - catch - Fs->catch_except=TRUE; - SetRFlags(old_flags); - break; - default: - res=SCR_DONE; - } - if (res) { - if (master=tempc->master_task) { - if (!Bt(&flags,SVCf_FREE_ON_COMPLETE)) { - CLI - while (LBts(&master->srv_ctrl.flags,SVCRf_LOCKED)) - PAUSE - QueIns(tempc,master->srv_ctrl.last_done); - LBts(&tempc->flags,SVCf_DONE); - LBtr(&master->srv_ctrl.flags,SVCRf_LOCKED); - SetRFlags(old_flags); - } - if (Bt(&flags,SVCf_FOCUS_MASTER) && - !Bt(&master->win_inhibit,WIf_SELF_FOCUS)) - sys_focus_task=master; - if (Bt(&flags,SVCf_WAKE_MASTER)) - Suspend(master,FALSE); - } - if (Bt(&flags,SVCf_FREE_ON_COMPLETE)) - SrvCmdDel(tempc); - else if (!master) { - CLI - while (LBts(&ctrl->flags,SVCRf_LOCKED)) - Yield; - QueIns(tempc,ctrl->last_done); - LBts(&tempc->flags,SVCf_DONE); - LBtr(&ctrl->flags,SVCRf_LOCKED); - SetRFlags(old_flags); - } - } - return res; -} - -I64 SrvCmdsHandler(I64 run_flags,CTask *task=NULL) -{//Handle all waiting cmds and return. - I64 cnt=0,old_flags=GetRFlags; - if (!task) task=Fs; - while (TRUE) { - CLI - while (LBts(&task->srv_ctrl.flags,SVCRf_LOCKED)) - PAUSE - if (task->srv_ctrl.next_waiting!=&task->srv_ctrl) - switch (SrvCmdRunOne(run_flags,&task->srv_ctrl)) { - case SCR_CONT: - cnt++; - break; - case SCR_EXIT: - Exit; - case SCR_DONE: - goto sch_done; - } - else - goto sch_done; - } -sch_done: - LBtr(&task->srv_ctrl.flags,SVCRf_LOCKED); - SetRFlags(old_flags); - return cnt; -} - -I64 PopUp(U8 *buf,CTask *parent=NULL,CTask **_pu_task=NULL) -{//Execute code in $LK,"PopUp",A="MN:PopUp"$ task. - I64 res; - CSrvCmd *tempc; - CTask *task=Spawn(&SrvCmdLine,NULL,"Servant",,parent); - if (!parent) { - TaskExe(task,parent,buf,1<popup_task=task; - tempc=TaskExe(task,parent,buf,1<popup_task=NULL; - Kill(task); - if (_pu_task) *_pu_task=NULL; - return res; - } -} - -I64 PopUpPrint(U8 *fmt,...) -{//Execute code in $LK,"PopUp",A="MN:PopUp"$ task. - U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); - I64 res; - res=PopUp(buf,Fs); - Free(buf); - return res; -} - -I64 Adam(U8 *fmt,...) -{//Make adam_task execute code. - I64 res; - U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); - CSrvCmd *tempc; - if (Fs==adam_task) { - tempc=TaskExe(adam_task,Fs,buf,0); - SrvCmdsHandler(GetRFlags); - } else { - TaskWait(adam_task); - tempc=TaskExe(adam_task,Fs,buf,1<task_flags,TASKf_INPUT_FILTER_TASK)) - ExePrint("%s",buf); - else - TaskText(Fs,NULL,buf,1<cur_dv),Fs->cur_dir,name); - Free(name); -} - -U0 Auto(U8 *fmt,...) -{//Send text to own input buffer. See $LK,"::/Demo/AcctExample/TOSDistro.CPP"$. - U8 *buf=StrPrintJoin(NULL,fmt,argc,argv),*st=AStrNew(buf); - AutoStr("\"%%s\",%d;Free(%d);",st,st); - Free(buf); -} - -U0 XTalkStr(CTask *task,U8 *fmt,...) -{//Send AutoFile code to other task. - U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); - TaskText(task,NULL,buf,0); - Free(buf); -} - -U0 XTalkStrWait(CTask *task,U8 *fmt,...) -{//Send AutoFile code to other task and wait for it to idle. - U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); - TaskText(task,NULL,buf,0); - Free(buf); - TaskWait(task); -} diff --git a/Kernel/SrvCmd.HC b/Kernel/SrvCmd.HC new file mode 100644 index 0000000..cbeea88 --- /dev/null +++ b/Kernel/SrvCmd.HC @@ -0,0 +1,503 @@ +U0 SrvCmdDel(CSrvCmd *tempc) +{//Free one cmd node. + Free(tempc->aux_str); + Free(tempc); +} + +U0 SrvCmdQueDel(CSrvCmd *head) +{ + CSrvCmd *tempc=head->next,*tempc1; + while (tempc!=head) { + tempc1=tempc->next; + QueRem(tempc); + SrvCmdDel(tempc); + tempc=tempc1; + } +} + +U0 SrvCtrlInit(CSrvCtrl *ctrl) +{ + QueInit(&ctrl->next_waiting); + QueInit(&ctrl->next_done); + ctrl->flags=0; +} + +U0 TaskRstAwaitingMsg(CTask *task=NULL) +{//Pop-ups get parent messages so wake-up our pop-ups if we got a msg. + if (!task) task=Fs; + PUSHFD + CLI + do { + if (TaskValidate(task)) + LBtr(&task->task_flags,TASKf_AWAITING_MSG); + else + break; + } while (task=task->popup_task); + POPFD +} + +CSrvCmd *TaskExe(CTask *srv,CTask *master,U8 *data,I64 flags) +{//Queues a request to compile and execute src code text. + CSrvCmd *res; + if (!data || !TaskValidate(srv) || master && !TaskValidate(master) || + srv->popup_task && !Bt(&srv->task_flags,TASKf_FILTER_INPUT)) + return NULL; + res=ACAlloc(sizeof(CSrvCmd)); + res->master_task=master; + res->cmd_code=SVCT_EXE_STR; + res->flags=flags; + res->aux_str=AStrNew(data); + res->ctrl=&srv->srv_ctrl; + + PUSHFD + CLI + while (LBts(&srv->srv_ctrl.flags,SVCRf_LOCKED)) + PAUSE + if (!TaskValidate(srv)) { + LBtr(&srv->srv_ctrl.flags,SVCRf_LOCKED); + POPFD + SrvCmdDel(res); + return NULL; + } else { + LBtr(&srv->task_flags,TASKf_IDLE); + TaskRstAwaitingMsg(srv); + QueIns(res,srv->srv_ctrl.last_waiting); + LBtr(&srv->srv_ctrl.flags,SVCRf_LOCKED); + if (Bt(&flags,SVCf_WAKE_MASTER)) { + Suspend(master); + Yield; + } + } + POPFD + return res; +} + +CSrvCmd *TaskText(CTask *srv,CTask *master,U8 *data,I64 flags) +{//Post StdIn text to servant task. Tell who the master task is. + CSrvCmd *res; + CTask *task; + if (!data || !TaskValidate(srv) || master && !TaskValidate(master) || + srv->popup_task && !Bt(&srv->task_flags,TASKf_FILTER_INPUT)) + return NULL; + res=ACAlloc(sizeof(CSrvCmd)); + res->master_task=master; //in case somebody cares + res->cmd_code=SVCT_TEXT_INPUT; + res->flags=flags; + res->aux_str=AStrNew(data); + + PUSHFD + task=srv->last_input_filter_task; + if (Bt(&flags,SVCf_HIGHEST_PRIORITY) || task==srv) { + if (task!=srv) + TaskWait(srv); + task=Spawn(&InputFilterTask,NULL,"Input Filter",,srv); + CLI + task->next_input_filter_task=srv->next_input_filter_task; + task->last_input_filter_task=srv; + srv->next_input_filter_task=task; + task->next_input_filter_task->last_input_filter_task=task; + } else { + CLI + task=srv->next_input_filter_task; + } + res->ctrl=&task->srv_ctrl; + while (LBts(&task->srv_ctrl.flags,SVCRf_LOCKED)) + PAUSE + if (!TaskValidate(task)) { + SrvCmdDel(res); + res=NULL; + } else { + LBtr(&task->task_flags,TASKf_IDLE); + TaskRstAwaitingMsg(task); + QueIns(res,task->srv_ctrl.last_waiting); + LBtr(&task->srv_ctrl.flags,SVCRf_LOCKED); + } + POPFD + return res; +} + +CSrvCmd *TaskMsg(CTask *_srv,CTask *master,I64 msg_code,I64 a1,I64 a2,I64 flags) +{//Post message to servant task. Tell who the master task is. +//See $LK,"flags",A="MN:SVCf_WAKE_MASTER"$ and $LK,"msg_code",A="MN:MSG_CMD"$. + CSrvCmd *tempc1,*tempc; + CTask *srv=_srv; + if (!TaskValidate(srv) || master && !TaskValidate(master)|| + srv->popup_task && !Bt(&srv->task_flags,TASKf_FILTER_INPUT)) + return NULL; + tempc=ACAlloc(sizeof(CSrvCmd)); + tempc->master_task=master; + tempc->cmd_code=SVCT_MSG; + tempc->msg_code=AbsI64(msg_code); //negative means do a down and up + tempc->aux1=a1; + tempc->aux2=a2; + tempc->flags=flags; + PUSHFD + if (Bt(&sys_semas[SYS_SEMA_RECORD_MACRO],0) && + srv!=sys_macro_task && msg_code==MSG_KEY_DOWN) { + tempc1=AMAllocIdent(tempc); + CLI + QueIns(tempc1,sys_macro_head.last); + } + CLI + while (Bt(&srv->task_flags,TASKf_FILTER_INPUT) && + !Bt(&flags,SVCf_DONT_FILTER)) + srv=srv->next_input_filter_task; + tempc->ctrl=&srv->srv_ctrl; + while (LBts(&srv->srv_ctrl.flags,SVCRf_LOCKED)) + PAUSE + if (!TaskValidate(srv)) { + SrvCmdDel(tempc); + tempc=NULL; + } else { + LBtr(&srv->task_flags,TASKf_IDLE); + TaskRstAwaitingMsg(srv); + QueIns(tempc,srv->srv_ctrl.last_waiting); + LBtr(&srv->srv_ctrl.flags,SVCRf_LOCKED); + } + POPFD + if (msg_code<0) //Down-Up + TaskMsg(_srv,master,-msg_code+1,a1,a2,flags); + return tempc; +} + +Bool JobResScan(CSrvCmd *rqst=NULL,I64 *_res=NULL) +{//Check rqst complete, return with or without. + CSrvCtrl *ctrl; + CSrvCmd *tempc,*tempc1; + if (!rqst || Bt(&rqst->flags,SVCf_DONE)) { + if (!rqst || rqst->master_task) + ctrl=&Fs->srv_ctrl; + else + ctrl=rqst->ctrl; + PUSHFD + CLI + while (LBts(&ctrl->flags,SVCRf_LOCKED)) + PAUSE + tempc1=&ctrl->next_done; + tempc=tempc1->next; + while (tempc!=tempc1) { + if (!rqst || rqst==tempc) { + QueRem(tempc); + LBtr(&ctrl->flags,SVCRf_LOCKED); + POPFD + if (_res) + *_res=tempc->res; + SrvCmdDel(tempc); + return TRUE; + } + tempc=tempc->next; + } + LBtr(&ctrl->flags,SVCRf_LOCKED); + POPFD + } + if (_res) + *_res=0; + return FALSE; +} + +I64 JobResGet(CSrvCmd *rqst=NULL) +{//See $LK,"::/Demo/MultiCore/Lock.HC"$ + I64 res; + CSrvCmd *tempc1; + if (!rqst) { + tempc1=&Fs->srv_ctrl.next_done; + while (tempc1==tempc1->next) { + LBts(&Fs->task_flags,TASKf_IDLE); + Yield; + } + } else { + while (!Bt(&rqst->flags,SVCf_DONE)) { + LBts(&Fs->task_flags,TASKf_IDLE); + Yield; + } + } + LBtr(&Fs->task_flags,TASKf_IDLE); +//Could get taken by someone else. + JobResScan(rqst,&res); + return res; +} + +U0 TaskWait(CTask *task=NULL) +{//Wait for idle. + CTask *task1; + CSrvCmd *tempc1; + if (!task) task=Fs; + if (TaskValidate(task)) { + PUSHFD + CLI + while (TRUE) { + task1=task->last_input_filter_task; + tempc1=&task1->srv_ctrl.next_waiting; + if (task1==Fs || !TaskValidate(task1) || + tempc1==tempc1->next && Bt(&task1->task_flags,TASKf_IDLE)) + break; + Yield; + } + POPFD + } +} + +U0 PostMsg(CTask *task,I64 msg_code,I64 a1,I64 a2,I64 flags=0) +{//Post message to a task and return immediately. See $LK,"msg_code",A="MN:MSG_CMD"$. + if (TaskValidate(task)) { + if (Bt(&task->task_flags,TASKf_INPUT_FILTER_TASK)) + TaskMsg(task->last_input_filter_task,NULL,msg_code,a1,a2, + flags|1<flags,SVCRf_LOCKED. + CSrvCmd *tempc=ctrl->next_waiting; + CTask *master; + I64 res,flags=tempc->flags,old_flags=GetRFlags; + if (Bt(&flags,SVCf_EXIT_ON_COMPLETE)) + res=SCR_EXIT; + else + res=SCR_CONT; + switch (tempc->cmd_code) { + case SVCT_SPAWN_TASK: + QueRem(tempc); + LBts(&tempc->flags,SVCf_DISPATCHED); + tempc->servant_cpu_num=Gs->num; + LBtr(&ctrl->flags,SVCRf_LOCKED); + if (tempc->aux_str) + tempc->spawned_task=Spawn(tempc->addr,tempc->fun_arg, + tempc->aux_str,,tempc->aux1,tempc->aux2,tempc->flags); + else + tempc->spawned_task=Spawn(tempc->addr,tempc->fun_arg, + "Unnamed",,tempc->aux1,tempc->aux2,tempc->flags); + break; + case SVCT_CALL: + QueRem(tempc); + LBts(&tempc->flags,SVCf_DISPATCHED); + tempc->servant_cpu_num=Gs->num; + LBtr(&ctrl->flags,SVCRf_LOCKED); + SetRFlags(run_flags); + LBtr(&Fs->task_flags,TASKf_IDLE); + try + tempc->res=(*tempc->addr)(tempc->fun_arg); + catch + Fs->catch_except=TRUE; + SetRFlags(old_flags); + break; + case SVCT_EXE_STR: + QueRem(tempc); + LBts(&tempc->flags,SVCf_DISPATCHED); + tempc->servant_cpu_num=Gs->num; + LBtr(&ctrl->flags,SVCRf_LOCKED); + SetRFlags(run_flags); + LBtr(&Fs->task_flags,TASKf_IDLE); + try + tempc->res=ExePrint("%s",tempc->aux_str); + catch + Fs->catch_except=TRUE; + SetRFlags(old_flags); + break; + default: + res=SCR_DONE; + } + if (res) { + if (master=tempc->master_task) { + if (!Bt(&flags,SVCf_FREE_ON_COMPLETE)) { + CLI + while (LBts(&master->srv_ctrl.flags,SVCRf_LOCKED)) + PAUSE + QueIns(tempc,master->srv_ctrl.last_done); + LBts(&tempc->flags,SVCf_DONE); + LBtr(&master->srv_ctrl.flags,SVCRf_LOCKED); + SetRFlags(old_flags); + } + if (Bt(&flags,SVCf_FOCUS_MASTER) && + !Bt(&master->win_inhibit,WIf_SELF_FOCUS)) + sys_focus_task=master; + if (Bt(&flags,SVCf_WAKE_MASTER)) + Suspend(master,FALSE); + } + if (Bt(&flags,SVCf_FREE_ON_COMPLETE)) + SrvCmdDel(tempc); + else if (!master) { + CLI + while (LBts(&ctrl->flags,SVCRf_LOCKED)) + Yield; + QueIns(tempc,ctrl->last_done); + LBts(&tempc->flags,SVCf_DONE); + LBtr(&ctrl->flags,SVCRf_LOCKED); + SetRFlags(old_flags); + } + } + return res; +} + +I64 SrvCmdsHandler(I64 run_flags,CTask *task=NULL) +{//Handle all waiting cmds and return. + I64 cnt=0,old_flags=GetRFlags; + if (!task) task=Fs; + while (TRUE) { + CLI + while (LBts(&task->srv_ctrl.flags,SVCRf_LOCKED)) + PAUSE + if (task->srv_ctrl.next_waiting!=&task->srv_ctrl) + switch (SrvCmdRunOne(run_flags,&task->srv_ctrl)) { + case SCR_CONT: + cnt++; + break; + case SCR_EXIT: + Exit; + case SCR_DONE: + goto sch_done; + } + else + goto sch_done; + } +sch_done: + LBtr(&task->srv_ctrl.flags,SVCRf_LOCKED); + SetRFlags(old_flags); + return cnt; +} + +I64 PopUp(U8 *buf,CTask *parent=NULL,CTask **_pu_task=NULL) +{//Execute code in $LK,"PopUp",A="MN:PopUp"$ task. + I64 res; + CSrvCmd *tempc; + CTask *task=Spawn(&SrvCmdLine,NULL,"Servant",,parent); + if (!parent) { + TaskExe(task,parent,buf,1<popup_task=task; + tempc=TaskExe(task,parent,buf,1<popup_task=NULL; + Kill(task); + if (_pu_task) *_pu_task=NULL; + return res; + } +} + +I64 PopUpPrint(U8 *fmt,...) +{//Execute code in $LK,"PopUp",A="MN:PopUp"$ task. + U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); + I64 res; + res=PopUp(buf,Fs); + Free(buf); + return res; +} + +I64 Adam(U8 *fmt,...) +{//Make adam_task execute code. + I64 res; + U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); + CSrvCmd *tempc; + if (Fs==adam_task) { + tempc=TaskExe(adam_task,Fs,buf,0); + SrvCmdsHandler(GetRFlags); + } else { + TaskWait(adam_task); + tempc=TaskExe(adam_task,Fs,buf,1<task_flags,TASKf_INPUT_FILTER_TASK)) + ExePrint("%s",buf); + else + TaskText(Fs,NULL,buf,1<cur_dv),Fs->cur_dir,name); + Free(name); +} + +U0 Auto(U8 *fmt,...) +{//Send text to own input buffer. See $LK,"::/Demo/AcctExample/TOSDistro.HC"$. + U8 *buf=StrPrintJoin(NULL,fmt,argc,argv),*st=AStrNew(buf); + AutoStr("\"%%s\",%d;Free(%d);",st,st); + Free(buf); +} + +U0 XTalkStr(CTask *task,U8 *fmt,...) +{//Send AutoFile code to other task. + U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); + TaskText(task,NULL,buf,0); + Free(buf); +} + +U0 XTalkStrWait(CTask *task,U8 *fmt,...) +{//Send AutoFile code to other task and wait for it to idle. + U8 *buf=StrPrintJoin(NULL,fmt,argc,argv); + TaskText(task,NULL,buf,0); + Free(buf); + TaskWait(task); +} diff --git a/Kernel/StrA.CPP b/Kernel/StrA.HC similarity index 100% rename from Kernel/StrA.CPP rename to Kernel/StrA.HC diff --git a/Kernel/StrB.CPP b/Kernel/StrB.CPP deleted file mode 100644 index 1791847..0000000 --- a/Kernel/StrB.CPP +++ /dev/null @@ -1,187 +0,0 @@ -U8 *Tabs2Spaces(U8 *src) -{//MAlloc str with tabs to spaces. - I64 ch,i,j,l=StrLen(src)<<1+2,col=0; - U8 *dst=MAlloc(l),*temp; - while (ch=*src++) { - if (ch=='\t') { - j=(col+8) & ~7; - for (i=col;i=l-2) { - temp=MAlloc(l<<1); - MemCpy(temp,dst,i+1); - Free(dst); - l<<=1; - dst=temp; - } - } - col=j; - } else { - dst[col]=ch; - if (col>=l-2) { - temp=MAlloc(l<<1); - MemCpy(temp,dst,col+1); - Free(dst); - l<<=1; - dst=temp; - } - col++; - } - } - dst[col]=0; - return dst; -} - -U8 *ScaleIndent(U8 *src,F64 indent_scale_factor) -{//MAlloced str. 8*0.25-->2 or 8*2.0-->16 - I64 ch,i,col=0; - U8 *dst,*dst2; - while (ch=*src++) { - if (ch=='\t') - col=(col+8) & -0x8; - else if (ch==CH_SPACE) - col++; - else - break; - } - src--; - col=Round(indent_scale_factor*col); - dst=dst2=MAlloc(StrLen(src)+col/8+col&7+1); - for (i=col/8;i>0;i--) - *dst2++='\t'; - for (i=col&7;i>0;i--) - *dst2++=CH_SPACE; - StrCpy(dst2,src); - return dst; -} - -U8 *MStrUtil(U8 *src,I64 flags,F64 indent_scale_factor=0) -{//MAlloc $LK,"StrUtil",A="MN:StrUtil"$(). - U8 *dst=StrNew(src),*dst2,*temp; - StrUtil(dst,flags); - if (flags & SUF_T2S) { - temp=Tabs2Spaces(dst); - Free(dst); - dst=temp; - } - if (flags & SUF_SCALE_INDENT) - dst2=ScaleIndent(dst,indent_scale_factor); - else - dst2=StrNew(dst); //Shorten to just right size. - Free(dst); - return dst2; -} - -U0 GetOutOfDollar() -{//If a $$ has been printed, print another $$ to exit mode. - CDoc *doc; - if (IsRaw) { - if (text.raw_flags&RWF_IN_DOLLAR) - '$$'; - } else { - if (fp_doc_put && (doc=(*fp_doc_put)(Fs)) && doc->flags&DOCF_IN_DOLLAR) - '$$'; - } -} - -Bool YorN() -{//Wait for user to answer Y or N. - I64 ch; - "(y or n)? "; - while (TRUE) { - ch=ToUpper(GetChar(,FALSE)); - if (ch=='Y') { - "$$PT$$YES$$FG$$\n"; - return TRUE; - } else if (ch=='N') { - "$$PT$$NO$$FG$$\n"; - return FALSE; - } - } -} - -I64 PressAKey() -{//Print "Press a key" and wait for non-zero $LK,"ASCII",A="MN:CH_CTRLA"$ key. - "$$BK,1$$PRESS A KEY$$BK,0$$\n"; - return GetChar(,FALSE); -} - -Bool AreYouSure() -{//Print "Are you sure" and waits for Y or N. - "ARE YOU SURE "; - return YorN; -} - -U0 Help() -{//Dbg help or master help index file. - if (IsDbg) - DbgHelp; - else - PopUp("Type(\"::/Doc/HelpIndex.TXT\");DocTop;View;"); -} - -U0 ScanFlags(U8 *_dst_flags,U8 *lst,U8 *src) -{/*More than 64 flags. Flags passed by ref. - -Examples: -$LK,"ScanFlags",A="FF:::/Adam/Opt/Utils/Diff.CPP,ScanFlags:2"$(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); - -I64 flags=0; -ScanFlags(&flags,"R\0L\0Dump\0Scan\0","+Dump-R"); //Sets Bit#2, Clears Bit#0. -*/ - I64 i; - U8 *buf,*ptr; - if (src) { - buf=MAlloc(StrLen(src)+1); - while (*src) { - while (*src && *src!='+' && *src!='-') - src++; - if (*src=='+') { - src++; - if (*src) { - ptr=buf; - while (*src && *src!='+' && *src!='-' && - *src!=CH_SPACE && *src!=CH_SHIFT_SPACE) - *ptr++=*src++; - *ptr=0; - i=LstMatch(buf,lst); - if (i>=0) - LBts(_dst_flags,i); - else { - Free(buf); - throw('ScanFlag'); - } - } - } else if (*src=='-') { - src++; - if (*src) { - ptr=buf; - while (*src && *src!='+' && *src!='-' && - *src!=CH_SPACE && *src!=CH_SHIFT_SPACE) - *ptr++=*src++; - *ptr=0; - i=LstMatch(buf,lst); - if (i>=0) - LBtr(_dst_flags,i); - else { - Free(buf); - throw('ScanFlag'); - } - } - } - } - Free(buf); - } -} - -U8 *StrPrintFlags(U8 *dst,U8 *lst,I64 flags) -{//Only 64 flags. Flags passed by value. - I64 i; - *dst=0; - while (flags) { - i=Bsf(flags); - Btr(&flags,i); - CatPrint(dst,"+%z",i,lst); - } - return dst; -} diff --git a/Kernel/StrB.HC b/Kernel/StrB.HC new file mode 100644 index 0000000..24ca2c4 --- /dev/null +++ b/Kernel/StrB.HC @@ -0,0 +1,187 @@ +U8 *Tabs2Spaces(U8 *src) +{//MAlloc str with tabs to spaces. + I64 ch,i,j,l=StrLen(src)<<1+2,col=0; + U8 *dst=MAlloc(l),*temp; + while (ch=*src++) { + if (ch=='\t') { + j=(col+8) & ~7; + for (i=col;i=l-2) { + temp=MAlloc(l<<1); + MemCpy(temp,dst,i+1); + Free(dst); + l<<=1; + dst=temp; + } + } + col=j; + } else { + dst[col]=ch; + if (col>=l-2) { + temp=MAlloc(l<<1); + MemCpy(temp,dst,col+1); + Free(dst); + l<<=1; + dst=temp; + } + col++; + } + } + dst[col]=0; + return dst; +} + +U8 *ScaleIndent(U8 *src,F64 indent_scale_factor) +{//MAlloced str. 8*0.25-->2 or 8*2.0-->16 + I64 ch,i,col=0; + U8 *dst,*dst2; + while (ch=*src++) { + if (ch=='\t') + col=(col+8) & -0x8; + else if (ch==CH_SPACE) + col++; + else + break; + } + src--; + col=Round(indent_scale_factor*col); + dst=dst2=MAlloc(StrLen(src)+col/8+col&7+1); + for (i=col/8;i>0;i--) + *dst2++='\t'; + for (i=col&7;i>0;i--) + *dst2++=CH_SPACE; + StrCpy(dst2,src); + return dst; +} + +U8 *MStrUtil(U8 *src,I64 flags,F64 indent_scale_factor=0) +{//MAlloc $LK,"StrUtil",A="MN:StrUtil"$(). + U8 *dst=StrNew(src),*dst2,*temp; + StrUtil(dst,flags); + if (flags & SUF_T2S) { + temp=Tabs2Spaces(dst); + Free(dst); + dst=temp; + } + if (flags & SUF_SCALE_INDENT) + dst2=ScaleIndent(dst,indent_scale_factor); + else + dst2=StrNew(dst); //Shorten to just right size. + Free(dst); + return dst2; +} + +U0 GetOutOfDollar() +{//If a $$ has been printed, print another $$ to exit mode. + CDoc *doc; + if (IsRaw) { + if (text.raw_flags&RWF_IN_DOLLAR) + '$$'; + } else { + if (fp_doc_put && (doc=(*fp_doc_put)(Fs)) && doc->flags&DOCF_IN_DOLLAR) + '$$'; + } +} + +Bool YorN() +{//Wait for user to answer Y or N. + I64 ch; + "(y or n)? "; + while (TRUE) { + ch=ToUpper(GetChar(,FALSE)); + if (ch=='Y') { + "$$PT$$YES$$FG$$\n"; + return TRUE; + } else if (ch=='N') { + "$$PT$$NO$$FG$$\n"; + return FALSE; + } + } +} + +I64 PressAKey() +{//Print "Press a key" and wait for non-zero $LK,"ASCII",A="MN:CH_CTRLA"$ key. + "$$BK,1$$PRESS A KEY$$BK,0$$\n"; + return GetChar(,FALSE); +} + +Bool AreYouSure() +{//Print "Are you sure" and waits for Y or N. + "ARE YOU SURE "; + return YorN; +} + +U0 Help() +{//Dbg help or master help index file. + if (IsDbg) + DbgHelp; + else + PopUp("Type(\"::/Doc/HelpIndex.DD\");DocTop;View;"); +} + +U0 ScanFlags(U8 *_dst_flags,U8 *lst,U8 *src) +{/*More than 64 flags. Flags passed by ref. + +Examples: +$LK,"ScanFlags",A="FF:::/Adam/Opt/Utils/Diff.HC,ScanFlags:2"$(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags); + +I64 flags=0; +ScanFlags(&flags,"R\0L\0Dump\0Scan\0","+Dump-R"); //Sets Bit#2, Clears Bit#0. +*/ + I64 i; + U8 *buf,*ptr; + if (src) { + buf=MAlloc(StrLen(src)+1); + while (*src) { + while (*src && *src!='+' && *src!='-') + src++; + if (*src=='+') { + src++; + if (*src) { + ptr=buf; + while (*src && *src!='+' && *src!='-' && + *src!=CH_SPACE && *src!=CH_SHIFT_SPACE) + *ptr++=*src++; + *ptr=0; + i=LstMatch(buf,lst); + if (i>=0) + LBts(_dst_flags,i); + else { + Free(buf); + throw('ScanFlag'); + } + } + } else if (*src=='-') { + src++; + if (*src) { + ptr=buf; + while (*src && *src!='+' && *src!='-' && + *src!=CH_SPACE && *src!=CH_SHIFT_SPACE) + *ptr++=*src++; + *ptr=0; + i=LstMatch(buf,lst); + if (i>=0) + LBtr(_dst_flags,i); + else { + Free(buf); + throw('ScanFlag'); + } + } + } + } + Free(buf); + } +} + +U8 *StrPrintFlags(U8 *dst,U8 *lst,I64 flags) +{//Only 64 flags. Flags passed by value. + I64 i; + *dst=0; + while (flags) { + i=Bsf(flags); + Btr(&flags,i); + CatPrint(dst,"+%z",i,lst); + } + return dst; +} diff --git a/Kernel/StrPrint.CPP b/Kernel/StrPrint.CPP deleted file mode 100644 index 971556e..0000000 --- a/Kernel/StrPrint.CPP +++ /dev/null @@ -1,920 +0,0 @@ -U0 SPutChar(U8 **_dst,U8 ch,U8 **_buf) -{ - I64 i; - U8 *dst=*_dst,*buf; - if (_buf) { - buf=*_buf; - i=dst-buf; - if (i>=MSize(buf)) { - buf=MAlloc(i<<1+1); - MemCpy(buf,*_buf,i); - Free(*_buf); - dst=buf+i; - *_buf=buf; - } - } - *dst++=ch; - *_dst=dst; -} - -U0 OutStr(U8 *ptr,U8 **_buf,U8 **_dst,I64 len,I64 flags) -{ - I64 i,j; - if (!ptr) - i=0; - else - i=StrLen(ptr); - if (flags&SPF_TRUNCATE && i>len) - i=len; - if (flags&SPF_LEFT_JUSTIFY) { - for (j=0;j=CH_SHIFT_SPACE && ch!=0x7F) - SPutChar(_dst,ch,_buf); - else { - StrPrint(buf2,"\\x%02X",ch); - ptr2=buf2; - while (*ptr2) - SPutChar(_dst,*ptr2++,_buf); - } - } - } - SPutChar(_dst,0,_buf); - return buf; -} - -U8 *MPrintq(U8 *ptr,I64 flags) -{ - U8 **_buf,*buf,**_dst,*dst; - I64 i,j,ch,ch1; - buf=MAlloc(STR_LEN); - _buf=&buf; - dst=buf; - _dst=&dst; - if (ptr) - while (ch=*ptr++) { - ch1=*ptr; - switch (ch) { - case '\\': - switch (ch1) { - start: - case '0': - SPutChar(_dst,0,_buf); - break; - case '\'': - SPutChar(_dst,'\'',_buf); - break; - case '\`': - SPutChar(_dst,'\`',_buf); - break; - case '"': - SPutChar(_dst,'"',_buf); - break; - case '\\': - SPutChar(_dst,'\\',_buf); - break; - case 'd': - SPutChar(_dst,'$$',_buf); - break; - case 'n': - SPutChar(_dst,'\n',_buf); - break; - case 'r': - SPutChar(_dst,'\r',_buf); - break; - case 't': - SPutChar(_dst,'\t',_buf); - break; - end: - ptr++; - break; - - case 'x': - case 'X': - i=0; - ptr++; - for (j=0;j<2;j++) { - ch1=ToUpper(*ptr++); - if (Bt(chars_bmp_hex_numeric,ch1)) { - if (ch1<='9') - i=i<<4+ch1-'0'; - else - i=i<<4+ch1-'A'+10; - } else { - ptr--; - break; - } - } - SPutChar(_dst,i,_buf); - break; - - default: - SPutChar(_dst,ch,_buf); - } - break; - case '$$': - SPutChar(_dst,ch,_buf); - if (ch1=='$$') - ptr++; - break; - case '%': - SPutChar(_dst,ch,_buf); - if (flags&SPF_SLASH && ch1=='%') - ptr++; - break; - default: - SPutChar(_dst,ch,_buf); - } - } - SPutChar(_dst,0,_buf); - return buf; -} - -U8 *sys_pos_pows_lets=" KMGTPEZY", - *sys_neg_pows_lets=" mænpfazy", - *sys_pos_pows_lst="kilo\0mega\0giga\0tera\0peta\0exa\0zetta\0yotta\0", - *sys_neg_pows_lst="milli\0micro\0nano\0pico\0femto\0atto\0zepto\0yocto\0"; - -#define TEMP_BUF_LEN 256 -#define SLOP 8 - -U8 *StrPrintJoin(U8 *dst,U8 *fmt,I64 argc,I64 *argv) -{/*$LK,"Print(\"\") Fmt Strings",A="FI:::/Doc/Print.TXT"$ -In float formatting, do not exceed 18-digits -before or after the decimal point -because the numbers before and after -the decimal point are stored -in 64-bits. Use exponentiated forms -to avoid this. -*/ - I64 i,j,l,ch,k,k0,n,n0,len,dec_len,flags,old_flags, - aux_fmt_num,comma_cnt,comma_fmt_cnt,cur_arg=0; - U64 m; - F64 d,d1; - CDoc *doc; - U8 *ptr,**_buf,*buf,**_dst,temp_buf[TEMP_BUF_LEN],temp_buf2[TEMP_BUF_LEN*2]; - - if (!fmt) - throw('StrPrint'); - if (dst) { - _buf=NULL; - buf=dst; - } else { - buf=MAlloc(STR_LEN); - _buf=&buf; - dst=buf; - } - _dst=&dst; - - while (ch = *fmt++) { - if (ch=='%') { - flags=0; - if (*fmt=='-') { - flags|=SPF_LEFT_JUSTIFY; - fmt++; - } - if (*fmt=='0') { - flags|=SPF_PAD_ZERO; - fmt++; - } - len=0; - while ('0'<=*fmt<='9') - len=len*10+ *fmt++ -'0'; - if (*fmt=='*') { - fmt++; - if (cur_arg>=argc) - throw('StrPrint'); - len=argv[cur_arg++]; - } - dec_len=0; - if (*fmt=='.') { - fmt++; - while ('0'<=*fmt<='9') - dec_len=dec_len*10+ *fmt++ -'0'; - if (*fmt=='*') { - fmt++; - if (cur_arg>=argc) - throw('StrPrint'); - dec_len=argv[cur_arg++]; - } - flags|=SPF_DECIMAL; - } - - aux_fmt_num=0; - while (TRUE) { - switch (*fmt) { - start: - case '$$': - flags|=SPF_DOLLAR; - break; - case '/': - flags|=SPF_SLASH; - break; - case ',': - flags|=SPF_COMMA; - break; - case 't': - flags|=SPF_TRUNCATE; - break; - case 'l': //harmless - break; - end: - fmt++; - break; - - case 'h': - fmt++; - flags|=SPF_AUX_FMT_NUM; - if (*fmt=='?') { - fmt++; - flags|=SPF_QUESTION; - } else { - if (*fmt=='*') { - fmt++; - if (cur_arg>=argc) - throw('StrPrint'); - aux_fmt_num=argv[cur_arg++]; - } else { - if (*fmt=='-') { - fmt++; - flags|=SPF_NEG_AUX_FMT_NUM; - } - while ('0'<=*fmt<='9') - aux_fmt_num=aux_fmt_num*10+ *fmt++ -'0'; - if (flags&SPF_NEG_AUX_FMT_NUM) - aux_fmt_num=-aux_fmt_num; - } - } - break; - default: - goto sp_arg; - } - } - - sp_arg: - k=0; - switch (*fmt++) { - start: - case 'F': - if (cur_arg>=argc) - throw('StrPrint'); - if (flags&SPF_DOLLAR) { - doc=argv[cur_arg++]; - old_flags=doc->flags; - doc->flags|=DOCF_NO_CURSOR; - ptr=DocSave(doc); - doc->flags=old_flags; - } else - ptr=FileRead(argv[cur_arg++]); - break; - case 'Q': - if (cur_arg>=argc) - throw('StrPrint'); - ptr=MPrintQ(argv[cur_arg++],flags); - break; - case 'q': - if (cur_arg>=argc) - throw('StrPrint'); - ptr=MPrintq(argv[cur_arg++],flags); - break; - case 'D': - if (cur_arg>=argc) - throw('StrPrint'); - ptr=MPrintDate(argv[cur_arg++]); - break; - case 'T': - if (cur_arg>=argc) - throw('StrPrint'); - ptr=MPrintTime(argv[cur_arg++]); - break; - end: - OutStr(ptr,_buf,_dst,len,flags); - Free(ptr); - break; - - start: - case 's': - if (cur_arg>=argc) - throw('StrPrint'); - ptr=argv[cur_arg++]; - break; - case 'S': - if (cur_arg>=argc) - throw('StrPrint'); - ptr=Define(argv[cur_arg++]); - break; - case 'z': - if (cur_arg+1>=argc) - throw('StrPrint'); - ptr=LstSub(argv[cur_arg],argv[cur_arg+1]); - cur_arg=cur_arg+2; - break; - case 'Z': - if (cur_arg+1>=argc) - throw('StrPrint'); - ptr=DefineSub(argv[cur_arg],argv[cur_arg+1]); - cur_arg=cur_arg+2; - break; - end: - OutStr(ptr,_buf,_dst,len,flags); - break; - - start: - case 'c': - if (cur_arg>=argc) - throw('StrPrint'); - temp_buf[0](I64)=argv[cur_arg++]; - temp_buf[8]=0; - break; - case 'C': - if (cur_arg>=argc) - throw('StrPrint'); - temp_buf[0](I64)=argv[cur_arg++]; - temp_buf[8]=0; - ptr=temp_buf; - while (*ptr) { - *ptr=ToUpper(*ptr); - ptr++; - } - break; - end: - if (!(flags&SPF_AUX_FMT_NUM)) - aux_fmt_num=1; - while (aux_fmt_num-->0) - OutStr(temp_buf,_buf,_dst,len,flags); - break; - - case 'p': - if (cur_arg>=argc) - throw('StrPrint'); - StrPrintFunSeg(temp_buf,argv[cur_arg++],len,flags); - OutStr(temp_buf,_buf,_dst,len,flags); - break; - case 'P': - if (cur_arg>=argc) - throw('StrPrint'); - StrPrintFunSeg(temp_buf,argv[cur_arg],len,flags); - if (!IsRaw || !_buf) { - StrPrint(temp_buf2,"$$LK,\"%s\",A=\"AD:0x%X\"$$", - temp_buf,argv[cur_arg]); - OutStr(temp_buf2,_buf,_dst,len,flags); - } else - OutStr(temp_buf,_buf,_dst,len,flags); - cur_arg++; - break; - case 'd': - if (cur_arg>=argc) - throw('StrPrint'); - m=argv[cur_arg++]; - if (m(I64)<0) { - flags|=SPF_NEG; - m=-m; - } -sp_out_dec: - if (flags&SPF_AUX_FMT_NUM) { - if (!len) len=12; - d=m; - goto sp_out_eng; - } - if (flags&SPF_COMMA) { - comma_fmt_cnt=comma_cnt=3; - do { - temp_buf[k++]=ModU64(&m,10)+'0'; - if (!m) break; - if (!--comma_cnt) { - temp_buf[k++]=','; - comma_cnt=3; - } - } while (klen) - k=len-i; - if (k<0) - k=0; - if (flags&SPF_PAD_ZERO) { - if (flags&SPF_NEG) - SPutChar(_dst,'-',_buf); - comma_cnt=(len-k-i+comma_fmt_cnt-comma_cnt+1) - %(comma_fmt_cnt+1)+1; - for (;i=len-k) - break; - } - SPutChar(_dst,'0',_buf); - } - } else { - for (;ilen) - k=len-i; - if (k<0) - k=0; - if (flags&SPF_PAD_ZERO) { - if (flags&SPF_NEG) - SPutChar(_dst,'-',_buf); - for (;i=0;i--) - SPutChar(_dst,temp_buf[i],_buf); - break; - case 'u': - if (cur_arg>=argc) - throw('StrPrint'); - m=argv[cur_arg++]; - goto sp_out_dec; - case 'f': - if (cur_arg>=argc) - throw('StrPrint'); - d=argv[cur_arg++](F64); - if (d<0) { - flags|=SPF_NEG; - d=-d; - } - - if (d==ì) { -sp_out_inf: - if (flags&SPF_NEG) - i=1; - else - i=0; - k=1; - if (len<0) - len=0; - if (flags&SPF_TRUNCATE && k+i>len) - k=len-i; - if (k<0) - k=0; - for (;i17) { - n+=i-17; - d*=Pow10I64(i-n); - } else { - n=0; - d*=Pow10I64(i); - } - i=dec_len; - } else if (n>17) { - n-=17; - d*=Pow10I64(-n); - } else - n=0; - - m=Round(d); - if (flags&SPF_COMMA) { - comma_cnt=i&3; - while (i-- && k2 && !comma_cnt--) { - temp_buf[k++]=','; - comma_cnt=2; - if (!--i) break; - } - if (n) { - n--; - temp_buf[k++]='0'; - } else - temp_buf[k++]=ModU64(&m,10)+'0'; - if (!i) break; - } - } else { - while (i-- && k=argc) - throw('StrPrint'); - d=argv[cur_arg++](F64); - if (d<0) { - flags|=SPF_NEG; - d=-d; - } - if (d==ì) goto sp_out_inf; - - if (d) - n=Floor(Log10(d)); - else - n=0; -sp_out_e: - d/=Pow10I64(n); - - k0=k; - for (l=0;l<2;l++) { - n0=n; - if (n<0) { - n=-n; - flags|=SPF_NEG_E; - } else - flags&=~SPF_NEG_E; - - i=3; - do temp_buf[k++]=ModU64(&n,10)+'0'; - while (n && i--); - if (flags&SPF_NEG_E) - temp_buf[k++]='-'; - temp_buf[k++]='e'; - dec_len=len-k-2; - if (flags&SPF_NEG) - dec_len--; - - if (d) { - d1=d+Pow10I64(-dec_len)/2; - if (d1<1.0) { - d*=10; - n=n0-1; - k=k0; - } else if (d1>=10) { - d/=10; - n=n0+1; - k=k0; - } else - break; - } else - break; - } - - goto sp_out_f; - case 'g': - if (!len) len=12; - flags|=SPF_TRUNCATE; - if (cur_arg>=argc) - throw('StrPrint'); - d=argv[cur_arg++](F64); - if (d<0) { - flags|=SPF_NEG; - d=-d; - } - if (d==ì) goto sp_out_inf; - if (d) - n=Floor(Log10(d)); - else - n=0; - if (n>=len-1-dec_len || n<-(dec_len-1)) - goto sp_out_e; - else - goto sp_out_f; - case 'n': - if (!len) len=12; - flags|=SPF_TRUNCATE; - if (cur_arg>=argc) - throw('StrPrint'); - d=argv[cur_arg++](F64); - if (d<0) { - flags|=SPF_NEG; - d=-d; - } -sp_out_eng: //Engineering notation - if (d==ì) goto sp_out_inf; - if (d) - n=FloorI64(Floor(Log10(d)),3); - else - n=0; - d/=Pow10I64(n); - - if (n<0) { - n=-n; - flags|=SPF_NEG_E; - } - if (flags&SPF_AUX_FMT_NUM && -24<=n<=24) { - if (flags&SPF_QUESTION) { - if (flags&SPF_NEG_E) - i=-n/3; - else - i=n/3; - j=0; - } else { - if (flags&SPF_NEG_E) - j=-n-aux_fmt_num; - else - j=n-aux_fmt_num; - d*=Pow10I64(j); - i=aux_fmt_num/3; - } - if (i<0) - temp_buf[k++]=sys_neg_pows_lets[-i]; - else if (i>0) - temp_buf[k++]=sys_pos_pows_lets[i]; - else if (len!=0) - temp_buf[k++]=CH_SPACE; - if (!(flags&SPF_DECIMAL)) { - dec_len=len-k-2; - if (flags&SPF_NEG) - dec_len--; - if (j>0) { - if (flags&SPF_COMMA) - dec_len-=4*j/3; - else - dec_len-=j; - } - d1=d+Pow10I64(-dec_len+1)/2; - if (d1>=10) { - dec_len--; - if (d1>=100) - dec_len--; - } - } - } else { - i=3; - do temp_buf[k++]=ModU64(&n,10)+'0'; - while (n && i--); - if (flags&SPF_NEG_E) - temp_buf[k++]='-'; - temp_buf[k++]='e'; - if (!dec_len) { - dec_len=len-k-2; - if (flags&SPF_NEG) - dec_len--; - d1=d+Pow10I64(-dec_len+1)/2; - if (d1>=10) { - dec_len--; - if (d1>=100) - dec_len--; - } - } - } - if (flags&SPF_COMMA) { - if (len && dec_len>0 && !(dec_len&3)) - temp_buf[k++]=','; - dec_len-=dec_len/4; - } - goto sp_out_f; - case 'X': - if (cur_arg>=argc) - throw('StrPrint'); - m=argv[cur_arg++]; - if (flags&SPF_COMMA) { - comma_fmt_cnt=comma_cnt=4; - do { - temp_buf[k]= m&15 +'0'; - if (temp_buf[k]>'9') temp_buf[k]+='A'-0x3A; - k++; - m>>=4; - if (!m) break; - if (!--comma_cnt) { - temp_buf[k++]=','; - comma_cnt=4; - } - } while (k'9') temp_buf[k]+='A'-0x3A; - k++; - m>>=4; - } while (m && k=argc) - throw('StrPrint'); - m=argv[cur_arg++]; - if (flags&SPF_COMMA) { - comma_fmt_cnt=comma_cnt=4; - do { - temp_buf[k]= m&15 +'0'; - if (temp_buf[k]>'9') temp_buf[k]+='a'-0x3A; - k++; - m>>=4; - if (!m) break; - if (!--comma_cnt) { - temp_buf[k++]=','; - comma_cnt=4; - } - } while (k'9') temp_buf[k]+='a'-0x3A; - k++; - m>>=4; - } while (m && k=argc) - throw('StrPrint'); - m=argv[cur_arg++]; - if (flags&SPF_COMMA) { - comma_fmt_cnt=comma_cnt=4; - do { - temp_buf[k++]= m&1 +'0'; - m>>=1; - if (!m) break; - if (!--comma_cnt) { - temp_buf[k++]=','; - comma_cnt=4; - } - } while (k>=1; - } while (m && k=MSize(buf)) { + buf=MAlloc(i<<1+1); + MemCpy(buf,*_buf,i); + Free(*_buf); + dst=buf+i; + *_buf=buf; + } + } + *dst++=ch; + *_dst=dst; +} + +U0 OutStr(U8 *ptr,U8 **_buf,U8 **_dst,I64 len,I64 flags) +{ + I64 i,j; + if (!ptr) + i=0; + else + i=StrLen(ptr); + if (flags&SPF_TRUNCATE && i>len) + i=len; + if (flags&SPF_LEFT_JUSTIFY) { + for (j=0;j=CH_SHIFT_SPACE && ch!=0x7F) + SPutChar(_dst,ch,_buf); + else { + StrPrint(buf2,"\\x%02X",ch); + ptr2=buf2; + while (*ptr2) + SPutChar(_dst,*ptr2++,_buf); + } + } + } + SPutChar(_dst,0,_buf); + return buf; +} + +U8 *MPrintq(U8 *ptr,I64 flags) +{ + U8 **_buf,*buf,**_dst,*dst; + I64 i,j,ch,ch1; + buf=MAlloc(STR_LEN); + _buf=&buf; + dst=buf; + _dst=&dst; + if (ptr) + while (ch=*ptr++) { + ch1=*ptr; + switch (ch) { + case '\\': + switch (ch1) { + start: + case '0': + SPutChar(_dst,0,_buf); + break; + case '\'': + SPutChar(_dst,'\'',_buf); + break; + case '\`': + SPutChar(_dst,'\`',_buf); + break; + case '"': + SPutChar(_dst,'"',_buf); + break; + case '\\': + SPutChar(_dst,'\\',_buf); + break; + case 'd': + SPutChar(_dst,'$$',_buf); + break; + case 'n': + SPutChar(_dst,'\n',_buf); + break; + case 'r': + SPutChar(_dst,'\r',_buf); + break; + case 't': + SPutChar(_dst,'\t',_buf); + break; + end: + ptr++; + break; + + case 'x': + case 'X': + i=0; + ptr++; + for (j=0;j<2;j++) { + ch1=ToUpper(*ptr++); + if (Bt(chars_bmp_hex_numeric,ch1)) { + if (ch1<='9') + i=i<<4+ch1-'0'; + else + i=i<<4+ch1-'A'+10; + } else { + ptr--; + break; + } + } + SPutChar(_dst,i,_buf); + break; + + default: + SPutChar(_dst,ch,_buf); + } + break; + case '$$': + SPutChar(_dst,ch,_buf); + if (ch1=='$$') + ptr++; + break; + case '%': + SPutChar(_dst,ch,_buf); + if (flags&SPF_SLASH && ch1=='%') + ptr++; + break; + default: + SPutChar(_dst,ch,_buf); + } + } + SPutChar(_dst,0,_buf); + return buf; +} + +U8 *sys_pos_pows_lets=" KMGTPEZY", + *sys_neg_pows_lets=" mænpfazy", + *sys_pos_pows_lst="kilo\0mega\0giga\0tera\0peta\0exa\0zetta\0yotta\0", + *sys_neg_pows_lst="milli\0micro\0nano\0pico\0femto\0atto\0zepto\0yocto\0"; + +#define TEMP_BUF_LEN 256 +#define SLOP 8 + +U8 *StrPrintJoin(U8 *dst,U8 *fmt,I64 argc,I64 *argv) +{/*$LK,"Print(\"\") Fmt Strings",A="FI:::/Doc/Print.DD"$ +In float formatting, do not exceed 18-digits +before or after the decimal point +because the numbers before and after +the decimal point are stored +in 64-bits. Use exponentiated forms +to avoid this. +*/ + I64 i,j,l,ch,k,k0,n,n0,len,dec_len,flags,old_flags, + aux_fmt_num,comma_cnt,comma_fmt_cnt,cur_arg=0; + U64 m; + F64 d,d1; + CDoc *doc; + U8 *ptr,**_buf,*buf,**_dst,temp_buf[TEMP_BUF_LEN],temp_buf2[TEMP_BUF_LEN*2]; + + if (!fmt) + throw('StrPrint'); + if (dst) { + _buf=NULL; + buf=dst; + } else { + buf=MAlloc(STR_LEN); + _buf=&buf; + dst=buf; + } + _dst=&dst; + + while (ch = *fmt++) { + if (ch=='%') { + flags=0; + if (*fmt=='-') { + flags|=SPF_LEFT_JUSTIFY; + fmt++; + } + if (*fmt=='0') { + flags|=SPF_PAD_ZERO; + fmt++; + } + len=0; + while ('0'<=*fmt<='9') + len=len*10+ *fmt++ -'0'; + if (*fmt=='*') { + fmt++; + if (cur_arg>=argc) + throw('StrPrint'); + len=argv[cur_arg++]; + } + dec_len=0; + if (*fmt=='.') { + fmt++; + while ('0'<=*fmt<='9') + dec_len=dec_len*10+ *fmt++ -'0'; + if (*fmt=='*') { + fmt++; + if (cur_arg>=argc) + throw('StrPrint'); + dec_len=argv[cur_arg++]; + } + flags|=SPF_DECIMAL; + } + + aux_fmt_num=0; + while (TRUE) { + switch (*fmt) { + start: + case '$$': + flags|=SPF_DOLLAR; + break; + case '/': + flags|=SPF_SLASH; + break; + case ',': + flags|=SPF_COMMA; + break; + case 't': + flags|=SPF_TRUNCATE; + break; + case 'l': //harmless + break; + end: + fmt++; + break; + + case 'h': + fmt++; + flags|=SPF_AUX_FMT_NUM; + if (*fmt=='?') { + fmt++; + flags|=SPF_QUESTION; + } else { + if (*fmt=='*') { + fmt++; + if (cur_arg>=argc) + throw('StrPrint'); + aux_fmt_num=argv[cur_arg++]; + } else { + if (*fmt=='-') { + fmt++; + flags|=SPF_NEG_AUX_FMT_NUM; + } + while ('0'<=*fmt<='9') + aux_fmt_num=aux_fmt_num*10+ *fmt++ -'0'; + if (flags&SPF_NEG_AUX_FMT_NUM) + aux_fmt_num=-aux_fmt_num; + } + } + break; + default: + goto sp_arg; + } + } + + sp_arg: + k=0; + switch (*fmt++) { + start: + case 'F': + if (cur_arg>=argc) + throw('StrPrint'); + if (flags&SPF_DOLLAR) { + doc=argv[cur_arg++]; + old_flags=doc->flags; + doc->flags|=DOCF_NO_CURSOR; + ptr=DocSave(doc); + doc->flags=old_flags; + } else + ptr=FileRead(argv[cur_arg++]); + break; + case 'Q': + if (cur_arg>=argc) + throw('StrPrint'); + ptr=MPrintQ(argv[cur_arg++],flags); + break; + case 'q': + if (cur_arg>=argc) + throw('StrPrint'); + ptr=MPrintq(argv[cur_arg++],flags); + break; + case 'D': + if (cur_arg>=argc) + throw('StrPrint'); + ptr=MPrintDate(argv[cur_arg++]); + break; + case 'T': + if (cur_arg>=argc) + throw('StrPrint'); + ptr=MPrintTime(argv[cur_arg++]); + break; + end: + OutStr(ptr,_buf,_dst,len,flags); + Free(ptr); + break; + + start: + case 's': + if (cur_arg>=argc) + throw('StrPrint'); + ptr=argv[cur_arg++]; + break; + case 'S': + if (cur_arg>=argc) + throw('StrPrint'); + ptr=Define(argv[cur_arg++]); + break; + case 'z': + if (cur_arg+1>=argc) + throw('StrPrint'); + ptr=LstSub(argv[cur_arg],argv[cur_arg+1]); + cur_arg=cur_arg+2; + break; + case 'Z': + if (cur_arg+1>=argc) + throw('StrPrint'); + ptr=DefineSub(argv[cur_arg],argv[cur_arg+1]); + cur_arg=cur_arg+2; + break; + end: + OutStr(ptr,_buf,_dst,len,flags); + break; + + start: + case 'c': + if (cur_arg>=argc) + throw('StrPrint'); + temp_buf[0](I64)=argv[cur_arg++]; + temp_buf[8]=0; + break; + case 'C': + if (cur_arg>=argc) + throw('StrPrint'); + temp_buf[0](I64)=argv[cur_arg++]; + temp_buf[8]=0; + ptr=temp_buf; + while (*ptr) { + *ptr=ToUpper(*ptr); + ptr++; + } + break; + end: + if (!(flags&SPF_AUX_FMT_NUM)) + aux_fmt_num=1; + while (aux_fmt_num-->0) + OutStr(temp_buf,_buf,_dst,len,flags); + break; + + case 'p': + if (cur_arg>=argc) + throw('StrPrint'); + StrPrintFunSeg(temp_buf,argv[cur_arg++],len,flags); + OutStr(temp_buf,_buf,_dst,len,flags); + break; + case 'P': + if (cur_arg>=argc) + throw('StrPrint'); + StrPrintFunSeg(temp_buf,argv[cur_arg],len,flags); + if (!IsRaw || !_buf) { + StrPrint(temp_buf2,"$$LK,\"%s\",A=\"AD:0x%X\"$$", + temp_buf,argv[cur_arg]); + OutStr(temp_buf2,_buf,_dst,len,flags); + } else + OutStr(temp_buf,_buf,_dst,len,flags); + cur_arg++; + break; + case 'd': + if (cur_arg>=argc) + throw('StrPrint'); + m=argv[cur_arg++]; + if (m(I64)<0) { + flags|=SPF_NEG; + m=-m; + } +sp_out_dec: + if (flags&SPF_AUX_FMT_NUM) { + if (!len) len=12; + d=m; + goto sp_out_eng; + } + if (flags&SPF_COMMA) { + comma_fmt_cnt=comma_cnt=3; + do { + temp_buf[k++]=ModU64(&m,10)+'0'; + if (!m) break; + if (!--comma_cnt) { + temp_buf[k++]=','; + comma_cnt=3; + } + } while (klen) + k=len-i; + if (k<0) + k=0; + if (flags&SPF_PAD_ZERO) { + if (flags&SPF_NEG) + SPutChar(_dst,'-',_buf); + comma_cnt=(len-k-i+comma_fmt_cnt-comma_cnt+1) + %(comma_fmt_cnt+1)+1; + for (;i=len-k) + break; + } + SPutChar(_dst,'0',_buf); + } + } else { + for (;ilen) + k=len-i; + if (k<0) + k=0; + if (flags&SPF_PAD_ZERO) { + if (flags&SPF_NEG) + SPutChar(_dst,'-',_buf); + for (;i=0;i--) + SPutChar(_dst,temp_buf[i],_buf); + break; + case 'u': + if (cur_arg>=argc) + throw('StrPrint'); + m=argv[cur_arg++]; + goto sp_out_dec; + case 'f': + if (cur_arg>=argc) + throw('StrPrint'); + d=argv[cur_arg++](F64); + if (d<0) { + flags|=SPF_NEG; + d=-d; + } + + if (d==ì) { +sp_out_inf: + if (flags&SPF_NEG) + i=1; + else + i=0; + k=1; + if (len<0) + len=0; + if (flags&SPF_TRUNCATE && k+i>len) + k=len-i; + if (k<0) + k=0; + for (;i17) { + n+=i-17; + d*=Pow10I64(i-n); + } else { + n=0; + d*=Pow10I64(i); + } + i=dec_len; + } else if (n>17) { + n-=17; + d*=Pow10I64(-n); + } else + n=0; + + m=Round(d); + if (flags&SPF_COMMA) { + comma_cnt=i&3; + while (i-- && k2 && !comma_cnt--) { + temp_buf[k++]=','; + comma_cnt=2; + if (!--i) break; + } + if (n) { + n--; + temp_buf[k++]='0'; + } else + temp_buf[k++]=ModU64(&m,10)+'0'; + if (!i) break; + } + } else { + while (i-- && k=argc) + throw('StrPrint'); + d=argv[cur_arg++](F64); + if (d<0) { + flags|=SPF_NEG; + d=-d; + } + if (d==ì) goto sp_out_inf; + + if (d) + n=Floor(Log10(d)); + else + n=0; +sp_out_e: + d/=Pow10I64(n); + + k0=k; + for (l=0;l<2;l++) { + n0=n; + if (n<0) { + n=-n; + flags|=SPF_NEG_E; + } else + flags&=~SPF_NEG_E; + + i=3; + do temp_buf[k++]=ModU64(&n,10)+'0'; + while (n && i--); + if (flags&SPF_NEG_E) + temp_buf[k++]='-'; + temp_buf[k++]='e'; + dec_len=len-k-2; + if (flags&SPF_NEG) + dec_len--; + + if (d) { + d1=d+Pow10I64(-dec_len)/2; + if (d1<1.0) { + d*=10; + n=n0-1; + k=k0; + } else if (d1>=10) { + d/=10; + n=n0+1; + k=k0; + } else + break; + } else + break; + } + + goto sp_out_f; + case 'g': + if (!len) len=12; + flags|=SPF_TRUNCATE; + if (cur_arg>=argc) + throw('StrPrint'); + d=argv[cur_arg++](F64); + if (d<0) { + flags|=SPF_NEG; + d=-d; + } + if (d==ì) goto sp_out_inf; + if (d) + n=Floor(Log10(d)); + else + n=0; + if (n>=len-1-dec_len || n<-(dec_len-1)) + goto sp_out_e; + else + goto sp_out_f; + case 'n': + if (!len) len=12; + flags|=SPF_TRUNCATE; + if (cur_arg>=argc) + throw('StrPrint'); + d=argv[cur_arg++](F64); + if (d<0) { + flags|=SPF_NEG; + d=-d; + } +sp_out_eng: //Engineering notation + if (d==ì) goto sp_out_inf; + if (d) + n=FloorI64(Floor(Log10(d)),3); + else + n=0; + d/=Pow10I64(n); + + if (n<0) { + n=-n; + flags|=SPF_NEG_E; + } + if (flags&SPF_AUX_FMT_NUM && -24<=n<=24) { + if (flags&SPF_QUESTION) { + if (flags&SPF_NEG_E) + i=-n/3; + else + i=n/3; + j=0; + } else { + if (flags&SPF_NEG_E) + j=-n-aux_fmt_num; + else + j=n-aux_fmt_num; + d*=Pow10I64(j); + i=aux_fmt_num/3; + } + if (i<0) + temp_buf[k++]=sys_neg_pows_lets[-i]; + else if (i>0) + temp_buf[k++]=sys_pos_pows_lets[i]; + else if (len!=0) + temp_buf[k++]=CH_SPACE; + if (!(flags&SPF_DECIMAL)) { + dec_len=len-k-2; + if (flags&SPF_NEG) + dec_len--; + if (j>0) { + if (flags&SPF_COMMA) + dec_len-=4*j/3; + else + dec_len-=j; + } + d1=d+Pow10I64(-dec_len+1)/2; + if (d1>=10) { + dec_len--; + if (d1>=100) + dec_len--; + } + } + } else { + i=3; + do temp_buf[k++]=ModU64(&n,10)+'0'; + while (n && i--); + if (flags&SPF_NEG_E) + temp_buf[k++]='-'; + temp_buf[k++]='e'; + if (!dec_len) { + dec_len=len-k-2; + if (flags&SPF_NEG) + dec_len--; + d1=d+Pow10I64(-dec_len+1)/2; + if (d1>=10) { + dec_len--; + if (d1>=100) + dec_len--; + } + } + } + if (flags&SPF_COMMA) { + if (len && dec_len>0 && !(dec_len&3)) + temp_buf[k++]=','; + dec_len-=dec_len/4; + } + goto sp_out_f; + case 'X': + if (cur_arg>=argc) + throw('StrPrint'); + m=argv[cur_arg++]; + if (flags&SPF_COMMA) { + comma_fmt_cnt=comma_cnt=4; + do { + temp_buf[k]= m&15 +'0'; + if (temp_buf[k]>'9') temp_buf[k]+='A'-0x3A; + k++; + m>>=4; + if (!m) break; + if (!--comma_cnt) { + temp_buf[k++]=','; + comma_cnt=4; + } + } while (k'9') temp_buf[k]+='A'-0x3A; + k++; + m>>=4; + } while (m && k=argc) + throw('StrPrint'); + m=argv[cur_arg++]; + if (flags&SPF_COMMA) { + comma_fmt_cnt=comma_cnt=4; + do { + temp_buf[k]= m&15 +'0'; + if (temp_buf[k]>'9') temp_buf[k]+='a'-0x3A; + k++; + m>>=4; + if (!m) break; + if (!--comma_cnt) { + temp_buf[k++]=','; + comma_cnt=4; + } + } while (k'9') temp_buf[k]+='a'-0x3A; + k++; + m>>=4; + } while (m && k=argc) + throw('StrPrint'); + m=argv[cur_arg++]; + if (flags&SPF_COMMA) { + comma_fmt_cnt=comma_cnt=4; + do { + temp_buf[k++]= m&1 +'0'; + m>>=1; + if (!m) break; + if (!--comma_cnt) { + temp_buf[k++]=','; + comma_cnt=4; + } + } while (k>=1; + } while (m && k> $outfile & - -echo "Please wait 10 seconds while we connect to the server." -sleep 10s -echo ":j $channel" >> $infile -echo "Channel joined." - -tail -f -n 0 $outfile | \ - while read -r chan char date time nick cmd msg; do - case $cmd in - !bible|!Bible) - sleep 0.5s - LINE=$(shuf -en 1 {1..100000} --random-source=/dev/urandom) - echo "Line $LINE:" >> $infile - tail -n $LINE Bible.TXT | head -n 16 >> $infile - sleep 0.5s - echo >> $infile - ;; - !god*|!God*) - sleep 0.5s - echo "$nick: $(shuf -n 10 /usr/share/dict/words --random-source=/dev/urandom | tr '\n' ' ')" >> $infile - ;; - !help|!Help) - echo 'Oracle for IRC. Lets you talk with God. Available commands: !bible !God !help !source. This bot uses random numbers to pick lines and words from a few files. Be witty and charming, not earnest. God likes soap operas and hates arrogance.' >> $infile - ;; - !source|!Source) - echo "http://www.templeos.org/Wb/Home/Wb2/Files/Bin/TempleBot.html" >> $infile - ;; - esac - done - - diff --git a/MakeHome.CPP b/MakeHome.HC similarity index 100% rename from MakeHome.CPP rename to MakeHome.HC diff --git a/Misc/DoDistro.CPP b/Misc/DoDistro.CPP deleted file mode 100644 index 749ed1c..0000000 --- a/Misc/DoDistro.CPP +++ /dev/null @@ -1,52 +0,0 @@ -//Make Your own Distro by #include-ing this file. - -#define STD_DISTRO_DVD_CFG "Tb\nScale2Mem(2048,0x40000)\nt \n\n\n\n" - -U0 MakeMyISO(U8 *_out_iso_filename) -{//Does everything with current drive. -//If you have not recompiled $FG,2$Kernel$FG$ and defined your CD/DVD drive, use $LK,"Mount",A="MN:Mount"$. - U8 *out_iso_filename=FileNameAbs(_out_iso_filename); - if (!DrvIsWritable) { - "Drive must be writable. Install on Hard drive, first.\n"; - return; - } - DelTree("/Distro"); - Del(out_iso_filename); - - MkDir("/Distro"); - Auto(STD_DISTRO_DVD_CFG); - BootDVDIns; - - Copy("/*","/Distro"); - Del("/Distro/" KERNEL_BIN_C); - - CopyTree(BOOT_DIR, "/Distro" BOOT_DIR); - CopyTree("/Home", "/Distro/Home"); - CopyTree("/Adam", "/Distro/Adam"); - CopyTree("/Apps", "/Distro/Apps"); - CopyTree("/Compiler", "/Distro/Compiler"); - CopyTree("/Demo", "/Distro/Demo"); - CopyTree("/Doc", "/Distro/Doc"); - CopyTree("/Kernel", "/Distro/Kernel"); - CopyTree("/Misc", "/Distro/Misc"); - - //To save space, optionally delete dictionary. - //Del("/Distro/Adam/AutoComplete/ACDefs.DAT"); - CopyTree("/Linux","/Distro/Linux"); //You can leave this out. - MkDir("/Distro/Temp"); - MkDir("/Distro/Temp/ScreenShots"); - ISO9660ISO(out_iso_filename,"/Distro/*",,"/Distro" BOOT_DIR_KERNEL_BIN_C); - - //If you want $LK,"RedSea",A="FI:::/Doc/RedSea.TXT"$ filesystem, use this instead but make it ISO.C. - //RedSeaISO(out_iso_filename,"/Distro","/Distro" BOOT_DIR_KERNEL_BIN_C); - - //If CD-ROM use MT_CD instead of MT_DVD. - //DVDImageWrite('T',out_iso_filename,MT_DVD); //Uncomment to burn. - - //DelTree("/Distro"); - Free(out_iso_filename); -} - -MakeMyISO("/Temp/MyDistro.ISO"); - -// Study my account examples $LK,"Cfg Strs",A="FL:::/Demo/AcctExample/TOSCfg.CPP,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOSDistro.CPP,1"$. diff --git a/Misc/DoDistro.HC b/Misc/DoDistro.HC new file mode 100644 index 0000000..324898c --- /dev/null +++ b/Misc/DoDistro.HC @@ -0,0 +1,52 @@ +//Make Your own Distro by #include-ing this file. + +#define STD_DISTRO_DVD_CFG "Tb\nScale2Mem(2048,0x40000)\nt \n\n\n\n" + +U0 MakeMyISO(U8 *_out_iso_filename) +{//Does everything with current drive. +//If you have not recompiled $FG,2$Kernel$FG$ and defined your CD/DVD drive, use $LK,"Mount",A="MN:Mount"$. + U8 *out_iso_filename=FileNameAbs(_out_iso_filename); + if (!DrvIsWritable) { + "Drive must be writable. Install on Hard drive, first.\n"; + return; + } + DelTree("/Distro"); + Del(out_iso_filename); + + MkDir("/Distro"); + Auto(STD_DISTRO_DVD_CFG); + BootDVDIns; + + Copy("/*","/Distro"); + Del("/Distro/" KERNEL_BIN_C); + + CopyTree(BOOT_DIR, "/Distro" BOOT_DIR); + CopyTree("/Home", "/Distro/Home"); + CopyTree("/Adam", "/Distro/Adam"); + CopyTree("/Apps", "/Distro/Apps"); + CopyTree("/Compiler", "/Distro/Compiler"); + CopyTree("/Demo", "/Distro/Demo"); + CopyTree("/Doc", "/Distro/Doc"); + CopyTree("/Kernel", "/Distro/Kernel"); + CopyTree("/Misc", "/Distro/Misc"); + + //To save space, optionally delete dictionary. + //Del("/Distro/Adam/AutoComplete/ACDefs.DAT"); + CopyTree("/Linux","/Distro/Linux"); //You can leave this out. + MkDir("/Distro/Temp"); + MkDir("/Distro/Temp/ScreenShots"); + ISO9660ISO(out_iso_filename,"/Distro/*",,"/Distro" BOOT_DIR_KERNEL_BIN_C); + + //If you want $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ filesystem, use this instead but make it ISO.C. + //RedSeaISO(out_iso_filename,"/Distro","/Distro" BOOT_DIR_KERNEL_BIN_C); + + //If CD-ROM use MT_CD instead of MT_DVD. + //DVDImageWrite('T',out_iso_filename,MT_DVD); //Uncomment to burn. + + //DelTree("/Distro"); + Free(out_iso_filename); +} + +MakeMyISO("/Temp/MyDistro.ISO"); + +// Study my account examples $LK,"Cfg Strs",A="FL:::/Demo/AcctExample/TOSCfg.HC,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOSDistro.HC,1"$. diff --git a/Misc/OSInstall.CPP b/Misc/OSInstall.CPP deleted file mode 100644 index a842d39..0000000 --- a/Misc/OSInstall.CPP +++ /dev/null @@ -1,217 +0,0 @@ -U0 InstallDrv(U8 drv_let) -{ - U8 *st; - ExePrint("CopyTree(\"::/\",\"%C:/\");",drv_let); - ExePrint("MkDir(\"%C:/Temp\");",drv_let); - ExePrint("MkDir(\"%C:/Temp/ScreenShots\");",drv_let); - ExePrint("MkDir(\"%C:/Home\");",drv_let); - - st=MStrPrint("%C:/Home/DoDistro.CPP.Z",drv_let); - if (!FileFind(st)) - Copy("::/Misc/DoDistro.CPP.Z",st); - Free(st); - - st=MStrPrint("%C:/Home/MakeHome.CPP.Z",drv_let); - if (!FileFind(st)) - Copy("::/MakeHome.CPP.Z",st); - Free(st); -} - -Bool VMPrtDsk(CTask *task,CATARep *ata_drv) -{ - if (ata_drv) { - XTalkWait(task,"PrtDsk;\nYCp%d\nYYY",ata_drv->num); - XTalkWait(task,"%d\nY\nY\n",(drv_dsk_dsk_size-DRV_HEADER)/2); - return TRUE; - } else - return FALSE; -} - -U0 VMInstallDrv(CTask *task,U8 drv_let, - CATARep *ata_drv,CATARep *atapi_drv) -{ - InstallDrv(drv_let); - XTalkWait(task,"BootHDIns('%C');\n\nB\n0x20000\n",drv_let); - if (ata_drv) - XTalkWait(task,"Cp%d\n",ata_drv->num); - if (atapi_drv) - XTalkWait(task,"Tp%d\n",atapi_drv->num); - XTalkWait(task,"\n\n\n"); //Exit Drives,Dsk Cache,Options -} - -U0 VMInstallWiz() -{ - CATARep *head=NULL,*ata_drv=NULL,*atapi_drv=NULL; - CTask *task; - "\nIt's normal for this to freeze for a moment or two.\n"; - PressAKey; - - task=User; - TaskWait(task); - task->border_src=BDS_CONST; - task->border_attr=LTGRAY<<4+DrvTextAttrGet(':')&15; - task->text_attr =LTGRAY<<4+BLUE; - task->win_inhibit=WIG_TASK_DFT-WIF_SELF_BORDER; - WinHorz(Fs->win_left,Fs->win_right,task); - WinVert(Fs->win_top,(Fs->win_top+Fs->win_bottom)>>2-1,task); - WinVert(task->win_bottom+3,Fs->win_bottom); - WinToTop(Fs); - - ATARep(FALSE,TRUE,&head); - ATAIDDrvs(head,&ata_drv,&atapi_drv); - if (VMPrtDsk(task,ata_drv)) { - VMInstallDrv(task,'C',ata_drv,atapi_drv); - VMInstallDrv(task,'D',ata_drv,atapi_drv); - BootMHDIns('C'); - } - LinkedLstDel(head); - WinVert(task->win_top,Fs->win_bottom); - Kill(task); -} - -U0 RegularInstallWiz() -{ - I64 unit,drv_let; - U8 *st,*base0,*base1; - CATARep *head=NULL,*tempha; - I64 ch,num_hints; - CTask *task; - - "\nIt's normal for this to freeze for a moment or two.\n"; - PressAKey; - - task=User; - TaskWait(task); - task->border_src=BDS_CONST; - task->border_attr=LTGRAY<<4+DrvTextAttrGet(':')&15; - task->text_attr =LTGRAY<<4+BLUE; - task->win_inhibit=WIG_TASK_DFT-WIF_SELF_BORDER; - WinHorz(Fs->win_left,Fs->win_right,task); - WinVert(Fs->win_top,(Fs->win_top+Fs->win_bottom)>>2-1,task); - WinVert(task->win_bottom+3,Fs->win_bottom); - WinToTop(Fs); - XTalk(task,"Mount;\nCp"); - - num_hints=ATARep(FALSE,,&head); - "\nInclude '$$PURPLE$$0x$$FG$$' for hexidecimal numbers.\n\n"; - while (TRUE) { - base0=GetStr("Hard Drive I/O Port Base0 : "); - if (0base0); - base1=MStrPrint("0x%X",tempha->base1); - st =MStrPrint("0x%X",tempha->unit); - unit=Str2I64(st); - Free(st); - } else { - while (TRUE) { - base1=GetStr("Hard Drive I/O Port Base1 : "); - if (0win_top,Fs->win_bottom); - Kill(task); -} - -U0 DoInstructions() -{ - CTask *task; - AutoComplete; - task=Fs->next_task; - while (task!=Fs) { - if (task!=adam_task && task!=sys_winmgr_task && task!=ac.task) { - XTalk(task,"Ed(\"::/Doc/Install.TXT.Z\");\n"); - break; - } - task=task->next_task; - } -} - -Bool DoInstall(Bool pmt_reboot) -{ - I64 res=FALSE,vm_install; - "\n\n\n\n\nAre you installing inside VMware, QEMU, VirtualBox " - "or a similar virtual machine? "; - vm_install=YorN; - DocBottom; - - if (vm_install) { - VMInstallWiz(); - res=TRUE; - } else { - "\n\nThis wizard works if you have a partition ready. " - "You can partition the drive or BootHDIns() " - "with more options if you do it by hand, not using this wizard.\n\n" - "Continue Install Wizard "; - if (YorN) { - RegularInstallWiz(); - res=TRUE; - } else - pmt_reboot=FALSE; - } - if (pmt_reboot) { - "Reboot Now "; - if (YorN) - Reboot; - } - return res; -} - -Bool OSInstall(Bool pmt_reboot=TRUE) -{ - DoInstructions; - return DoInstall(pmt_reboot); -} - -#if __CMD_LINE__ -OSInstall(TRUE); -#endif diff --git a/Misc/OSInstall.HC b/Misc/OSInstall.HC new file mode 100644 index 0000000..a3c2d18 --- /dev/null +++ b/Misc/OSInstall.HC @@ -0,0 +1,217 @@ +U0 InstallDrv(U8 drv_let) +{ + U8 *st; + ExePrint("CopyTree(\"::/\",\"%C:/\");",drv_let); + ExePrint("MkDir(\"%C:/Temp\");",drv_let); + ExePrint("MkDir(\"%C:/Temp/ScreenShots\");",drv_let); + ExePrint("MkDir(\"%C:/Home\");",drv_let); + + st=MStrPrint("%C:/Home/DoDistro.HC.Z",drv_let); + if (!FileFind(st)) + Copy("::/Misc/DoDistro.HC.Z",st); + Free(st); + + st=MStrPrint("%C:/Home/MakeHome.HC.Z",drv_let); + if (!FileFind(st)) + Copy("::/MakeHome.HC.Z",st); + Free(st); +} + +Bool VMPrtDsk(CTask *task,CATARep *ata_drv) +{ + if (ata_drv) { + XTalkWait(task,"PrtDsk;\nYCp%d\nYYY",ata_drv->num); + XTalkWait(task,"%d\nY\nY\n",(drv_dsk_dsk_size-DRV_HEADER)/2); + return TRUE; + } else + return FALSE; +} + +U0 VMInstallDrv(CTask *task,U8 drv_let, + CATARep *ata_drv,CATARep *atapi_drv) +{ + InstallDrv(drv_let); + XTalkWait(task,"BootHDIns('%C');\n\nB\n0x20000\n",drv_let); + if (ata_drv) + XTalkWait(task,"Cp%d\n",ata_drv->num); + if (atapi_drv) + XTalkWait(task,"Tp%d\n",atapi_drv->num); + XTalkWait(task,"\n\n\n"); //Exit Drives,Dsk Cache,Options +} + +U0 VMInstallWiz() +{ + CATARep *head=NULL,*ata_drv=NULL,*atapi_drv=NULL; + CTask *task; + "\nIt's normal for this to freeze for a moment or two.\n"; + PressAKey; + + task=User; + TaskWait(task); + task->border_src=BDS_CONST; + task->border_attr=LTGRAY<<4+DrvTextAttrGet(':')&15; + task->text_attr =LTGRAY<<4+BLUE; + task->win_inhibit=WIG_TASK_DFT-WIF_SELF_BORDER; + WinHorz(Fs->win_left,Fs->win_right,task); + WinVert(Fs->win_top,(Fs->win_top+Fs->win_bottom)>>2-1,task); + WinVert(task->win_bottom+3,Fs->win_bottom); + WinToTop(Fs); + + ATARep(FALSE,TRUE,&head); + ATAIDDrvs(head,&ata_drv,&atapi_drv); + if (VMPrtDsk(task,ata_drv)) { + VMInstallDrv(task,'C',ata_drv,atapi_drv); + VMInstallDrv(task,'D',ata_drv,atapi_drv); + BootMHDIns('C'); + } + LinkedLstDel(head); + WinVert(task->win_top,Fs->win_bottom); + Kill(task); +} + +U0 RegularInstallWiz() +{ + I64 unit,drv_let; + U8 *st,*base0,*base1; + CATARep *head=NULL,*tempha; + I64 ch,num_hints; + CTask *task; + + "\nIt's normal for this to freeze for a moment or two.\n"; + PressAKey; + + task=User; + TaskWait(task); + task->border_src=BDS_CONST; + task->border_attr=LTGRAY<<4+DrvTextAttrGet(':')&15; + task->text_attr =LTGRAY<<4+BLUE; + task->win_inhibit=WIG_TASK_DFT-WIF_SELF_BORDER; + WinHorz(Fs->win_left,Fs->win_right,task); + WinVert(Fs->win_top,(Fs->win_top+Fs->win_bottom)>>2-1,task); + WinVert(task->win_bottom+3,Fs->win_bottom); + WinToTop(Fs); + XTalk(task,"Mount;\nCp"); + + num_hints=ATARep(FALSE,,&head); + "\nInclude '$$PURPLE$$0x$$FG$$' for hexidecimal numbers.\n\n"; + while (TRUE) { + base0=GetStr("Hard Drive I/O Port Base0 : "); + if (0base0); + base1=MStrPrint("0x%X",tempha->base1); + st =MStrPrint("0x%X",tempha->unit); + unit=Str2I64(st); + Free(st); + } else { + while (TRUE) { + base1=GetStr("Hard Drive I/O Port Base1 : "); + if (0win_top,Fs->win_bottom); + Kill(task); +} + +U0 DoInstructions() +{ + CTask *task; + AutoComplete; + task=Fs->next_task; + while (task!=Fs) { + if (task!=adam_task && task!=sys_winmgr_task && task!=ac.task) { + XTalk(task,"Ed(\"::/Doc/Install.DD.Z\");\n"); + break; + } + task=task->next_task; + } +} + +Bool DoInstall(Bool pmt_reboot) +{ + I64 res=FALSE,vm_install; + "\n\n\n\n\nAre you installing inside VMware, QEMU, VirtualBox " + "or a similar virtual machine? "; + vm_install=YorN; + DocBottom; + + if (vm_install) { + VMInstallWiz(); + res=TRUE; + } else { + "\n\nThis wizard works if you have a partition ready. " + "You can partition the drive or BootHDIns() " + "with more options if you do it by hand, not using this wizard.\n\n" + "Continue Install Wizard "; + if (YorN) { + RegularInstallWiz(); + res=TRUE; + } else + pmt_reboot=FALSE; + } + if (pmt_reboot) { + "Reboot Now "; + if (YorN) + Reboot; + } + return res; +} + +Bool OSInstall(Bool pmt_reboot=TRUE) +{ + DoInstructions; + return DoInstall(pmt_reboot); +} + +#if __CMD_LINE__ +OSInstall(TRUE); +#endif diff --git a/Misc/OSTestSuite.CPP b/Misc/OSTestSuite.CPP deleted file mode 100644 index f122b65..0000000 --- a/Misc/OSTestSuite.CPP +++ /dev/null @@ -1,2447 +0,0 @@ -$PL,1000$I64 ts_num; -U0 TSStart() -{ - ts_num=0; -} -U0 TS() -{ - progress4=ts_num++; - progress4_max=168; - *progress4_desc=0; -} -U0 TSEnd() -{ - if (ts_num!=progress4_max) - ST_ERR_ST "Cnt %d should be %d.\n",ts_num,progress4_max; - else - "$$GREEN$$Test Suite Completed$$FG$$\n"; - ProgressBarsRst; -} - -U0 DoSpritePlot() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/SpritePlot\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoElephant() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/Elephant\";\n"); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoSpritePlot3D() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/SpritePlot3D\";\n"); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoSpritePut() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/SpritePut\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoSpritePutExt() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/SpritePutExt\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoSpriteText() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/SpriteText\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoSpriteRaw() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/SpriteRaw\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoCarry() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Carry\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoDirectives() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Directives\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoRandDemo() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/RandDemo\";\n"); - XTalkWait(task," "); - XTalkWait(task," "); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoBalloon() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/Balloon\";\n"); - XTalk(task,"Exit;\n"); -} - -U0 DoEdCSprite() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/EdSprite\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoExtents() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/Extents\";\n"); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoDotNet() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/NetOfDots\";\n"); - Sleep(300); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoSunMoon() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/SunMoon\";\n"); - Sleep(300); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoLowPassFilter() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/LowPassFilter\";\n"); - Sleep(300); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(300); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(300); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(300); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(300); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoMathAudioDemo() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/MathAudioDemo\";\n"); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoLines() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/Lines\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoBounce() -{ - CTask *task=User; - XTalk(task,"#include \"::/Demo/Graphics/Bounce\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoMsgLoop() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/MsgLoop\";\n"); - Sleep(300); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(300); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoASCIIOrgan() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Snd/ASCIIOrgan\";\n"); - Sleep(100); - PostMsgWait(task,MSG_KEY_DOWN_UP,'A',0); - Sleep(200); - PostMsgWait(task,MSG_KEY_DOWN_UP,'B',0); - Sleep(200); - PostMsgWait(task,MSG_KEY_DOWN_UP,'C',0); - Sleep(200); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoDoodle() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/Doodle\";\n"); - PostMsgWait(task,MSG_IP_L_DOWN,10,10); - PostMsgWait(task,MSG_IP_L_UP,100,200); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoSpeedLine() -{ - I64 i=PURPLE; - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/Speedline\";\n"); - PostMsgWait(task,MSG_IP_L_DOWN,10,10); - PostMsgWait(task,MSG_IP_L_UP,100,200); - PostMsg(task,MSG_IP_R_DOWN_UP,0,0); - while (!TaskValidate(task->popup_task)) - Yield; - while (i--) - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - Sleep(100); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_ESC,0); - TaskWait(task); - PostMsgWait(task,MSG_IP_L_DOWN,50,10); - PostMsgWait(task,MSG_IP_L_UP,150,200); - Sleep(1000); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoKeyBitMap() -{ - I64 i_sc=Char2ScanCode('i'); - CTask *task=User; - XTalk(task,"#include \"::/Demo/KeyBitMap\";\n"); - Sleep(50); - LBts(kbd.down_bitmap,i_sc); - Sleep(500); - LBtr(kbd.down_bitmap,i_sc); - Sleep(50); - XTalk(task,"Exit;\n"); -} - -U0 DoMountain() -{ - CTask *task=User; - XTalk(task,"#include \"::/Demo/Graphics/Mountain\";\n"); - Sleep(1500); - Kill(task); -} - -U0 DoDigits() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Games/Digits\";\n"); - Sleep(100); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(100); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(250); - PostMsgWait(task,MSG_KEY_DOWN_UP,'1',0); - Sleep(250); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoSymmetry() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/Symmetry\";\n"); - PostMsgWait(task,MSG_IP_R_DOWN,100,100); - PostMsgWait(task,MSG_IP_R_UP,200,200); - Sleep(100); - PostMsgWait(task,MSG_IP_L_DOWN,10,10); - PostMsgWait(task,MSG_IP_L_UP,100,200); - Sleep(250); - PostMsgWait(task,MSG_IP_L_DOWN,100,200); - PostMsgWait(task,MSG_IP_L_UP,400,400); - Sleep(250); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoBSpline() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/BSpline\";\n"); - PostMsgWait(task,MSG_IP_L_DOWN_UP,50,50); - PostMsgWait(task,MSG_IP_L_DOWN_UP,300,100); - PostMsgWait(task,MSG_IP_L_DOWN_UP,150,300); - PostMsgWait(task,MSG_IP_R_DOWN_UP,0,0); - Sleep(1500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoBlot() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/Blot\";\n"); - Sleep(1800); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoScreenCapture() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/ScreenCapture\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); - Del("~/DemoScreenShot.GRA*"); -} - -/* -U0 DoPullDownMenu() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/PullDownMenu\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} -*/ - -U0 DoStadium() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Games/Stadium/Stadium\";\n"); - Sleep(50); - PostMsgWait(task,MSG_IP_L_DOWN_UP,100,10); - Sleep(300); - PostMsgWait(task,MSG_IP_L_DOWN_UP,320,20); - Sleep(300); - PostMsgWait(task,MSG_IP_L_DOWN_UP,520,10); - Sleep(300); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoPalette() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/Palette\";\n"); - Sleep(400); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(400); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoElephantWalk() -{ - I64 i; - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Games/ElephantWalk\";\n"); - for (i=0;i<15;i++) { - PostMsgWait(task,MSG_KEY_DOWN,0,SC_CURSOR_RIGHT); - Sleep(50); - } - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoHalogen() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Games/Halogen\";\n"); - PostMsgWait(task,MSG_KEY_DOWN,0,SC_CURSOR_UP); - Sleep(1000); - PostMsgWait(task,MSG_KEY_UP,0,SC_CURSOR_UP); - PostMsgWait(task,MSG_KEY_DOWN,0,SC_CURSOR_RIGHT); - Sleep(333); - PostMsgWait(task,MSG_KEY_UP,0,SC_CURSOR_RIGHT); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoTheDead() -{ - I64 i; - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Games/TheDead\";\n"); - for (i=0;i<15;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(50); - } - for (i=0;i<15;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(50); - } - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoBomberGolf() -{ - I64 i; - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Games/BomberGolf\";\n"); - for (i=0;i<7;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); - Sleep(100); - } - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - for (i=0;i<7;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_LEFT); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_LEFT); - Sleep(200); - } - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoZoneOut() -{ - I64 i; - CTask *task=User; - XTalk(task,"#include \"::/Demo/Games/ZoneOut\";\n"); - while (!TaskValidate(task->popup_task)) - Yield; - TaskWait(task->popup_task); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - for (i=0;i<15;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(100); - } - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoVaroom() -{ - I64 i; - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Games/Varoom\";\n"); - for (i=0;i<10;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); - Sleep(50); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); - Sleep(50); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_LEFT); - Sleep(50); - } - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoFlatTops() -{ - CTask *task=User; - XTalk(task,"#include \"::/Demo/Games/FlatTops\";\n"); - while (!TaskValidate(task->popup_task)) - Yield; - TaskWait(task->popup_task); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - while (TaskValidate(task->popup_task)) - Yield; - PostMsgWait(task,MSG_IP_R_DOWN_UP,RandI16%400+200,RandI16%300+150); - Sleep(1500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoWenceslas() -{ - I64 i; - CTask *task=User; - XTalk(task,"#include \"::/Demo/Games/Wenceslas\";\n"); - while (!TaskValidate(task->popup_task)) - Yield; - TaskWait(task->popup_task); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(100); - while (!TaskValidate(task->popup_task)) - Yield; - TaskWait(task->popup_task); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(100); - while (!TaskValidate(task->popup_task)) - Yield; - TaskWait(task->popup_task); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(100); - for (i=0;i<25;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); - Sleep(25); - } - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoTreeCheckers() -{ - I64 task_num; - CTask *task=User; - XTalk(task,"#include \"::/Demo/Games/TreeCheckers\";\n"); - - while (!TaskValidate(task->popup_task)) - Yield; - TaskWait(task->popup_task); - task_num=task->popup_task->task_num; - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - - while (!TaskValidate(task->popup_task)||task->popup_task->task_num==task_num) - Yield; - TaskWait(task->popup_task); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - - Sleep(500); - - PostMsgWait(task,MSG_KEY_DOWN_UP,'\n',0); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoRainDrops() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Games/RainDrops\";\n"); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoMorseCode() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Snd/MorseCode\";\n"); - Sleep(50); - - PostMsg(task,MSG_KEY_DOWN,CH_SPACE,0); - Sleep(200); - PostMsg(task,MSG_KEY_UP,CH_SPACE,0); - Sleep(350); - - PostMsg(task,MSG_KEY_DOWN,CH_SPACE,0); - Sleep(50); - PostMsg(task,MSG_KEY_UP,CH_SPACE,0); - Sleep(350); - - PostMsg(task,MSG_KEY_DOWN,CH_SPACE,0); - Sleep(50); - PostMsg(task,MSG_KEY_UP,CH_SPACE,0); - Sleep(25); - PostMsg(task,MSG_KEY_DOWN,CH_SPACE,0); - Sleep(200); - PostMsg(task,MSG_KEY_UP,CH_SPACE,0); - Sleep(25); - PostMsg(task,MSG_KEY_DOWN,CH_SPACE,0); - Sleep(50); - PostMsg(task,MSG_KEY_UP,CH_SPACE,0); - Sleep(500); - - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoPixCollision() -{ - I64 w,h; - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/Collision\";\n"); - w=task->pix_width>>1 +task->pix_left+task->scroll_x; - h=task->pix_height>>1+task->pix_top +task->scroll_y; - IPSet(w-35,h-35); - AFSetIP(10,w+35,w+35); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoBlackDiamond() -{ - I64 i; - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Games/BlackDiamond\";\n"); - for (i=0;i<15;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); - Sleep(75); - } - for (i=0;i<12;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - Sleep(75); - } - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoCtrlR1() -{ - I64 i,task_num=-1; - CTask *task=User; - XTalkWait(task,"//"); - PostMsg(task,MSG_KEY_DOWN_UP,CH_CTRLR,0); - while (!TaskValidate(task->popup_task)) - Yield; - TaskWait(task->popup_task); - task_num=task->popup_task->task_num; - for (i=0;i<1;i++) - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsg(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - while (TaskValidate(task->popup_task)) - Yield; - //Color - while (!TaskValidate(task->popup_task)) - Yield; - TaskWait(task->popup_task); - task_num=task->popup_task->task_num; - for (i=0;i<2;i++) - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsg(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - while (!TaskValidate(task->popup_task)||task->popup_task->task_num==task_num) - Yield; - TaskWait(task->popup_task); - for (i=0;i<2;i++) - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - task_num=task->popup_task->task_num; - PostMsg(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - - //Width - while (!TaskValidate(task->popup_task)||task->popup_task->task_num==task_num) - Yield; - TaskWait(task->popup_task); - task_num=task->popup_task->task_num; - for (i=0;i<4;i++) - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsg(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - while (!TaskValidate(task->popup_task)||task->popup_task->task_num==task_num) - Yield; - TaskWait(task->popup_task); - for (i=0;i<4;i++) - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - task_num=task->popup_task->task_num; - PostMsg(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - - //Line - while (!TaskValidate(task->popup_task)||task->popup_task->task_num==task_num) - Yield; - TaskWait(task->popup_task); - task_num=task->popup_task->task_num; - for (i=0;i<7;i++) - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsg(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - while (TaskValidate(task->popup_task)) - Yield; - PostMsgWait(task,MSG_IP_L_DOWN,150,150); - PostMsgWait(task,MSG_IP_L_UP,150,95); - Sleep(250); - PostMsgWait(task,MSG_IP_L_DOWN,150,150); - PostMsgWait(task,MSG_IP_L_UP,190,190); - Sleep(250); - PostMsgWait(task,MSG_IP_L_DOWN,150,150); - PostMsgWait(task,MSG_IP_L_UP,110,190); - Sleep(250); - PostMsg(task,MSG_IP_R_DOWN_UP,100,100); - - //Color - while (!TaskValidate(task->popup_task)) - Yield; - TaskWait(task->popup_task); - task_num=task->popup_task->task_num; - for (i=0;i<2;i++) - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsg(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - while (!TaskValidate(task->popup_task)||task->popup_task->task_num==task_num) - Yield; - TaskWait(task->popup_task); - for (i=0;i<3;i++) - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - task_num=task->popup_task->task_num; - PostMsg(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - - //Circle - while (!TaskValidate(task->popup_task)||task->popup_task->task_num==task_num) - Yield; - TaskWait(task->popup_task); - task_num=task->popup_task->task_num; - for (i=0;i<10;i++) - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsg(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - while (TaskValidate(task->popup_task)) - Yield; - PostMsgWait(task,MSG_IP_L_DOWN,150,150); - PostMsgWait(task,MSG_IP_L_UP,190,190); - Sleep(250); - PostMsg(task,MSG_IP_R_DOWN_UP,100,100); - - //Exit - while (!TaskValidate(task->popup_task)) - Yield; - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN+SCF_CTRL); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); - PostMsg(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - while (TaskValidate(task->popup_task)) - Yield; - Sleep(1000); - XTalk(task,"\nExit;\n"); -} - -U0 DoF2Macro() -{ - I64 i; - U8 *ptr="\"Boo!\\n\";\n"; - CTask *task=User; - while (TaskValidate(sys_macro_task)) - Yield; - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_F2); - while (!TaskValidate(sys_macro_task)) - Yield; - TaskWait(sys_macro_task); - - PostMsgWait(sys_macro_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT|SCF_CTRL); - PostMsgWait(sys_macro_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsgWait(sys_macro_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); - PostMsgWait(sys_macro_task,MSG_KEY_DOWN_UP,CH_SPACE,0); //Press RECORD - while (!Bt(&sys_semas[SYS_SEMA_RECORD_MACRO],0)) - Yield; - - while (*ptr) - PostMsgWait(task,MSG_KEY_DOWN,*ptr++,0); - - PostMsgWait(sys_macro_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsgWait(sys_macro_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsgWait(sys_macro_task,MSG_KEY_DOWN_UP,CH_SPACE,0); //Press STOP - - for (i=0;i<10;i++) - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_F2|SCF_SHIFT); - - PostMsg(sys_macro_task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - while (TaskValidate(sys_macro_task)) - Yield; - - Sleep(1000); - XTalk(task,"\nExit;\n"); -} - -/* -U0 DoTicTacToe() -{ -} -*/ - -U0 DoBox() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/Box\";\n"); - Sleep(1500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoShadow() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/Shadow\";\n"); - Sleep(1500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoPredatorPrey() -{ - CTask *task=User; - XTalk(task,"#include \"::/Demo/Graphics/PredatorPrey\";\n"); - while (!TaskValidate(task->popup_task)) - Yield; - TaskWait(task->popup_task); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(1500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 Do3DPoly() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/3DPoly\";\n"); - Sleep(1500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoRotateTank() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/RotateTank\";\n"); - Sleep(1500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoScreenCodes() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/ScreenCodes\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoPanText() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/PanText\";\n"); - XTalk(task,"Exit;\n"); -} - -U0 DoExtendedChars() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/ExtendedChars\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoCharAnimation() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/CharAnimation\";\n"); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoCharDemo() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Games/CharDemo\";\n"); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_LEFT); - Sleep(750); - PostMsg(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoDateTime() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/DateTime\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoSubSwitch() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/SubSwitch\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoNullCase() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/NullCase\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoMaze() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Games/Maze\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoFontEd() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/FontEd\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoLattice() -{ - I64 i; - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/Lattice\";\n"); - for (i=0;i<20;i++) - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); - for (i=0;i<6;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,'+',0); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_LEFT); - } - for (i=0;i<6;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_LEFT); - } - for (i=0;i<16;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); - } - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoTimeIns() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/TimeIns\";\n"); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoWaterFowl() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Snd/WaterFowl\";\n"); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -/* -U0 Do() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Apps/Psalmody/Examples\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -*/ - -U0 DoRateCores() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/MultiCore/RateCores\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoMPPrint() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/MultiCore/MPPrint\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoCartesian() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/Cartesian\";\n"); - XTalkWait(task,"0.2*x`1.5\n"); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoHanoi() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/Hanoi\";\n"); - Sleep(3000); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -/* -U0 DoLife() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/Life\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoZing() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Games/Zing\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -*/ - -U0 DoCommonAncestor() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/CommonAncestor\";\n"); - Sleep(1500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoPalindrome() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/MultiCore/Palindrome\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoMagicPairs() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/MagicPairs\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoMPAdd() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/MultiCore/MPAdd\";\n"); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoLock() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/MultiCore/Lock\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoClouds() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/MultiCore/Clouds\";\n"); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -/* -U0 Do() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/Slider\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 Do() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/ScrollBars\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} -*/ - -U0 DoRegistryDemo() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/RegistryDemo\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoBugFlapper() -{ - I64 i; - CTask *task=User; - XTalk(task,"#include \"::/Demo/Games/FlapBat\";\n"); - while (!TaskValidate(task->popup_task)) - Yield; - TaskWait(task->popup_task); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(500); - for (i=0;i<4;i++) { - PostMsgWait(task,MSG_KEY_DOWN,CH_SPACE,0); - Sleep(100); - PostMsgWait(task,MSG_KEY_UP,CH_SPACE,0); - Sleep(100); - } - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoBattleLines() -{ - CTask *task=User; - XTalk(task,"#include \"::/Demo/Games/BattleLines\";\n"); - while (!TaskValidate(task->popup_task)) - Yield; - TaskWait(task->popup_task); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - while (TaskValidate(task->popup_task)) - Yield; - IPSet(430,300,,TRUE); - AFSetIP(10,530,400); - IPSet(,,,FALSE); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoBigGuns() -{ - I64 i; - CTask *task=User; - XTalk(task,"#include \"::/Demo/Games/BigGuns\";\n"); - while (!TaskValidate(task->popup_task)) - Yield; - task->popup_task->user_data=Fs; - TaskWait(task->popup_task); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - while (!TaskValidate(task->popup_task)||task->popup_task->user_data==Fs) - Yield; - TaskWait(task->popup_task); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - for (i=0;i<5;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_LEFT); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_LEFT); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_LEFT); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_LEFT); - Sleep(200); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - } - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoDunGen() -{ - I64 i; - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Games/DunGen\";\n"); - for (i=0;i<10;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); - Sleep(100); - } - for (i=0;i<12;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - Sleep(100); - } - for (i=0;i<6;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); - Sleep(100); - } - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoTimeOut() -{ - I64 i; - CTask *task=User; - XTalkWait(task,"#include \"::/Apps/TimeOut/Run\";\n"); - Sleep(200); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - for (i=0;i<3;i++) { - PostMsgWait(task,MSG_KEY_DOWN,CH_SPACE,0); - LBts(kbd.down_bitmap,SC_CURSOR_RIGHT); - Sleep(200); - PostMsgWait(task,MSG_KEY_UP,CH_SPACE,0); - LBtr(kbd.down_bitmap,SC_CURSOR_RIGHT); - Sleep(200); - PostMsgWait(task,MSG_KEY_DOWN,CH_SPACE,0); - LBts(kbd.down_bitmap,SC_CURSOR_LEFT); - Sleep(200); - PostMsgWait(task,MSG_KEY_UP,CH_SPACE,0); - LBtr(kbd.down_bitmap,SC_CURSOR_LEFT); - Sleep(200); - } - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoCollision() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Games/Collision\";\n"); - Sleep(1500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoLoadTest() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/MultiCore/LoadTest\";\n"); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); - while (TaskValidate(task)) - Yield; -} - -U0 DoPrimes() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/MultiCore/Primes\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoRadixSort() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/MultiCore/RadixSort\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoPageTableEntries() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Lectures/Mem/PageTableEntries\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoInterrupts() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/MultiCore/Interrupts\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoStkGrow() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/StkGrow\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoMemDemo() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/MemDemo\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoSpan() -{ - CTask *task=User; - XTalk(task,"#include \"::/Apps/Span/Run\";\n"); - while (!TaskValidate(task->popup_task)) - Yield; - TaskWait(task->popup_task); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(1500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoStrut() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Apps/Strut/Run\";\n"); - - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - - IPSet(200,200,,TRUE); - PostMsgWait(task,MSG_IP_L_DOWN,0,0); - WinMgrSync(2); - - IPSet(GR_WIDTH-200,200,,TRUE); - PostMsgWait(task,MSG_IP_L_DOWN,0,0); - - IPSet(GR_WIDTH/2,400,,TRUE); - PostMsgWait(task,MSG_IP_L_DOWN,0,0); - - PostMsgWait(task,MSG_KEY_DOWN_UP,'s',0); - - IPSet(200,200,,TRUE); - PostMsgWait(task,MSG_IP_L_DOWN,0,0); - IPSet(GR_WIDTH-200,200,,TRUE); - PostMsgWait(task,MSG_IP_L_UP,0,0); - - IPSet(200,200,,TRUE); - PostMsgWait(task,MSG_IP_L_DOWN,0,0); - IPSet(GR_WIDTH/2,400,,TRUE); - PostMsgWait(task,MSG_IP_L_UP,0,0); - - IPSet(GR_WIDTH-200,200,,TRUE); - PostMsgWait(task,MSG_IP_L_DOWN,0,0); - IPSet(GR_WIDTH/2,400,,TRUE); - PostMsgWait(task,MSG_IP_L_UP,0,0); - - IPSet(GR_WIDTH/2,GR_HEIGHT/2,,TRUE); - PostMsgWait(task,MSG_IP_L_DOWN,0,0); - IPSet(GR_WIDTH-200,200,,TRUE); - PostMsgWait(task,MSG_IP_L_UP,0,0); - - IPSet(GR_WIDTH/2,GR_HEIGHT/2,,TRUE); - PostMsgWait(task,MSG_IP_L_DOWN,0,0); - IPSet(GR_WIDTH/2,400,,TRUE); - PostMsgWait(task,MSG_IP_L_UP,0,0); - - IPSet(GR_WIDTH/2,GR_HEIGHT/2,,TRUE); - PostMsgWait(task,MSG_IP_L_DOWN,0,0); - IPSet(200,200,,TRUE); - PostMsgWait(task,MSG_IP_L_UP,0,0); - - PostMsgWait(task,MSG_KEY_DOWN_UP,'t',0); - - IPSet(GR_WIDTH/2,400,,TRUE); - PostMsgWait(task,MSG_IP_L_DOWN,0,0); - IPSet(GR_WIDTH-200,200,,TRUE); - PostMsgWait(task,MSG_IP_L_UP,0,0); - - IPSet(GR_WIDTH/2,400,,TRUE); - PostMsgWait(task,MSG_IP_L_DOWN,0,0); - IPSet(200,200,,TRUE); - PostMsgWait(task,MSG_IP_L_UP,0,0); - - IPSet(,,,FALSE); - - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - LBts(kbd.down_bitmap,Char2ScanCode('1')); - Sleep(600); - LBtr(kbd.down_bitmap,Char2ScanCode('1')); - PostMsgWait(task,MSG_KEY_DOWN_UP,'Z',0); - Sleep(200); - PostMsgWait(task,MSG_KEY_DOWN_UP,'Z',0); - Sleep(200); - PostMsgWait(task,MSG_KEY_DOWN_UP,'Z',0); - Sleep(200); - - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoRawHide() -{ - CTask *task=User; - XTalk(task,"#include \"::/Demo/Games/RawHide\";\n"); - while (!TaskValidate(task->popup_task)) - Yield; - TaskWait(task->popup_task); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(2500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoAfterEgypt() -{ - CTask *task=User; - XTalk(task,"#include \"::/Apps/AfterEgypt/Run\";\n"); - while (!TaskValidate(task->popup_task)) - Yield; - Sleep(600); //It flushes messages! - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - while (TaskValidate(task->popup_task)) - Yield; - TaskWait(task); - Sleep(1000); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); //Camp - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); //Map - Sleep(1000); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); //Map - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); //Camp - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); //Main Menu - XTalk(task,"Exit;\n"); -} - -U0 DoShading() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/Shading\";\n"); - Sleep(1500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoPoleZeros() -{ - CTask *task=User; - XTalk(task,"#include \"::/Demo/Graphics/PoleZeros\";\n"); - while (!TaskValidate(task->popup_task)) - Yield; - TaskWait(task->popup_task); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoWhap() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Games/Whap\";\n"); - IPSet(300,200); - Sleep(500); - AFSetIP(3,350,300); - Sleep(500); - AFSetIP(3,450,200); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoGrid() -{ - CTask *task=User; - XTalk(task,"#include \"::/Demo/Graphics/Grid\";\n"); - IPSet(200,200); - Sleep(150); - AFSetIP(2,400,400); - AFSetIP(2,200,400); - AFSetIP(2,200,200); - IPSet(,,,TRUE); - Sleep(50); - IPSet(,,,FALSE); - DocBottom(DocPut(task)); - XTalk(task,"Exit;\n"); -} - -U0 DoPick() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/Pick\";\n"); - IPSet(200,200); - Sleep(500); - IPSet(,,,TRUE); - AFSetIP(4,400,400); - IPSet(,,,FALSE); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoPick3D() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/Pick3D\";\n"); - IPSet(200,200); - Sleep(500); - IPSet(,,,TRUE); - AFSetIP(4,400,400); - IPSet(,,,FALSE); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoTransform() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Graphics/Transform\";\n"); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -/* -U0 Do() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Apps/ToTheFront\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} -*/ - -U0 DoGrModels() -{ - CTask *task=User; - I64 i,j,task_num=-1; - XTalkWait(task,"#include \"::/Apps/GrModels/Run\";\n"); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - PostMsg(task,MSG_KEY_DOWN_UP,CH_ESC,0); - for (i=0;i<4;i++) { - while (!TaskValidate(task->popup_task) || - task->popup_task->task_num==task_num) - Yield; - TaskWait(task->popup_task); - task_num=task->popup_task->task_num; - for (j=0;j<=i;j++) - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - } - Sleep(1000); - PostMsgWait(task,MSG_KEY_DOWN_UP,'n',0); - XTalk(task,"Exit;\n"); -} - -U0 DoKeepAway() -{ - CTask *task=User; - XTalk(task,"#include \"::/Apps/KeepAway/Run\";\n"); - while (!TaskValidate(task->popup_task)) - Yield; - TaskWait(task->popup_task); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - IPSet(100,100); - Sleep(1500); - PostMsgWait(task,MSG_IP_R_DOWN_UP,ip.pos.x,ip.pos.y); - Sleep(1000); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoRocket() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Games/Rocket\";\n"); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); - Bts(kbd.down_bitmap,SC_CURSOR_UP); - Sleep(1000); - Btr(kbd.down_bitmap,SC_CURSOR_UP); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); - Bts(kbd.down_bitmap,SC_CURSOR_RIGHT); - Sleep(1000); - Btr(kbd.down_bitmap,SC_CURSOR_RIGHT); - Sleep(1000); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoRocketScience() -{ - CTask *task=User; - XTalk(task,"#include \"::/Demo/Games/RocketScience\";\n"); - while (!TaskValidate(task->popup_task)) - Yield; - TaskWait(task->popup_task); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(2000); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoMassSpring() -{ - CTask *task=User; - XTalk(task,"#include \"::/Demo/Games/MassSpring\";\n"); - while (!TaskValidate(task->popup_task)) - Yield; - TaskWait(task->popup_task); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - while (TaskValidate(task->popup_task)) - Yield; - PostMsgWait(task,MSG_IP_L_DOWN_UP,50,50); //#1 - PostMsgWait(task,MSG_IP_L_DOWN_UP,50,200); //#2 - PostMsgWait(task,MSG_IP_L_DOWN_UP,210,50); //#3 - PostMsgWait(task,MSG_IP_L_DOWN_UP,310,200);//#4 - Sleep(500); - PostMsgWait(task,MSG_IP_R_DOWN,50,50); //1-2 - PostMsgWait(task,MSG_IP_R_UP,50,200); - Sleep(500); - PostMsgWait(task,MSG_IP_R_DOWN,210,50);//3-4 - PostMsgWait(task,MSG_IP_R_UP,310,200); - Sleep(500); - PostMsgWait(task,MSG_IP_R_DOWN,50,200);//2-4 - PostMsgWait(task,MSG_IP_R_UP,310,200); - Sleep(500); - PostMsgWait(task,MSG_IP_R_DOWN,50,50); //1-3 - PostMsgWait(task,MSG_IP_R_UP,210,50); - Sleep(1500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -/* -U0 Do() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Games/Whap\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} -*/ - -U0 DoSquirt() -{ - I64 i; - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Games/Squirt\";\n"); - for (i=0;i<5;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); - Sleep(100); - } - for (i=0;i<5;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_LEFT); - Sleep(100); - } - for (i=0;i<5;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - Sleep(100); - } - for (i=0;i<5;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); - Sleep(100); - } - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoXCaliber() -{ - I64 i; - CTask *task=User; - XTalkWait(task,"#include \"::/Apps/X-Caliber/Run\";\n"); - for (i=0;i<5;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SCF_SHIFT|SC_CURSOR_UP); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SCF_SHIFT|SC_CURSOR_RIGHT); - } - for (i=0;i<10;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - PostMsgWait(task,MSG_KEY_DOWN,0,SC_CURSOR_RIGHT,0); - Sleep(100); - PostMsgWait(task,MSG_KEY_UP,0,SC_CURSOR_RIGHT,0); - Sleep(50); - } - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoFPS() -{ - I64 i; - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Games/CastleFrankenstein\";\n"); - for (i=0;i<15;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); - Sleep(50); - } - for (i=0;i<8;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); - Sleep(50); - } - for (i=0;i<9;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); - Sleep(50); - } - for (i=0;i<6;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); - Sleep(50); - } - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoEagleDive() -{ - I64 i; - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Games/EagleDive\";\n"); - Sleep(500); - for (i=0;i<10;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); - Sleep(50); - } - for (i=0;i<10;i++) { - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - Sleep(50); - } - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -/* -U0 Do() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Apps/Psalmody\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} -*/ - -U0 DoPhoneNumWords() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/PhoneNumWords\";\n"); - XTalkWait(task,"702-254-4223\n\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoSuggestedSpelling() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/SuggestSpelling\";\n"); - XTalkWait(task,"effecient\n\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoWordSearch() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/WordSearch\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoFPrintF() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Dsk/FPrintF\";\n"); - XTalkWait(task,"~/DemoFPrintF.TXT.Z"); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_ESC,0); - XTalkWait(task,"Type(\"~/DemoFPrintF.TXT.Z\");\n"); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_CTRLO,0); - XTalkWait(task,"Del(\"~/DemoFPrintF.TXT*\");\n"); - Sleep(500); - XTalk(task,"Exit;\n"); -} - -U0 DoSerializeTree() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Dsk/SerializeTree\";\n"); - Sleep(500); - XTalk(task,"Exit;\n"); -} - -/* -U0 Do() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Dsk/DataBase\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoRaw() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Dsk/Raw\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} -*/ - -U0 DoUnusedSpaceRep() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Dsk/UnusedSpaceRep\";\n"); - Sleep(500); - XTalk(task,"Exit;\n"); -} - -U0 DoBlkDevRep() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Dsk/BlkDevRep\";\n"); - Sleep(500); - XTalk(task,"Exit;\n"); -} - -U0 DoLastClass() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/LastClass\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(500); - XTalk(task,"Exit;\n"); -} - -U0 DoMiniCompiler() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Lectures/MiniCompiler\";\n"); - XTalkWait(task,"1+2*(3+4)\n"); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoMiniGrLib() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Lectures/MiniGrLib\";\n"); - XTalk(task,"Exit;\n"); -} - -U0 DoWebLog() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/WebLogDemo/WebLogRep\";\n"); - PostMsgWait(task,MSG_KEY_DOWN_UP,'\n',0); - PostMsgWait(task,MSG_KEY_DOWN_UP,'\n',0); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_ESC,0); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoRevFile() -{ - CTask *task=User; - Del("~/DemoPoemForward.TXT*"); - XTalkWait(task,"#include \"::/Demo/RevFileDemo/Rev\";\n"); - XTalkWait(task,"Type(\"~/DemoPoemFwd.TXT.Z\");\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoSortFile() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/SortFileDemo/F64FileGen\";\n"); - XTalkWait(task,"#include \"::/Demo/SortFileDemo/F64FileSort\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoToHtmlToTXT() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/ToHtmlToTXTDemo/HtmlGen\";\n"); - XTalkWait(task,"#include \"::/Demo/ToHtmlToTXTDemo/TXTGen\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -/* -U0 Do() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Apps/TimeClock\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} -*/ - -U0 DoLogic() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Apps/Logic/Run\";\n"); - XTalkWait(task,"NAND\nNOR\n\n0x100\n0xF0\n0xCC\n0xAA\n\n0x12\n\n"); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -/* -U0 Do() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Lectures\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 Do() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/AutoFile\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} -*/ - -U0 DoPrint() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Print\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoSubIntAccess() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/SubIntAccess\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoParenWarn() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/ParenWarn\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoCompileDemo() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/CompileDemo\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoPrompt() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Prompt\";\n"); - XTalkWait(task,"1+2*3<<4\n"); - XTalkWait(task,"1.0+2*3`2\n"); - XTalkWait(task,"Terry Davis\n"); - XTalkWait(task,"*-1\n"); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoClassMeta() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/ClassMeta\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoNumBible() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/DolDoc/NumBible\";\n"); - Del("~/DemoNumBible.TXT*"); - XTalk(task,"Exit;\n"); -} - -U0 DoForm() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/DolDoc/Form\";\n"); - Sleep(250); - XTalk(task,"54321"); - Sleep(250); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - Sleep(250); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SCF_CTRL|SC_CURSOR_LEFT); - XTalk(task,"77777"); - Sleep(250); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); - Sleep(250); - XTalk(task,"MyName"); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_ESC,0); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoClickCallBack() -{ - I64 i; - CTask *task=User; - XTalk(task,"#include \"::/Demo/DolDoc/ClickCallBack\";\n"); - for (i=0;i<3;i++) { - while (!TaskValidate(task->popup_task)) - Yield; - TaskWait(task->popup_task); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(250); - } - Sleep(500); - XTalk(task,"Exit;\n"); -} - -U0 DoMenuButton() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/DolDoc/MenuButton\";\n"); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN,0); - Sleep(500); - PostMsg(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - while (!TaskValidate(task->popup_task)) - Yield; - TaskWait(task->popup_task); - Sleep(500); - PostMsgWait(sys_focus_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); - Sleep(500); - PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); - while (TaskValidate(task->popup_task)) - Yield; - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoMenuSprite() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/DolDoc/MenuSprite\";\n"); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN,0); - Sleep(50); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(300); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN,0); - Sleep(50); - PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN,0); - Sleep(50); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(300); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -U0 DoTreeDemo() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/DolDoc/TreeDemo\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoExceptions() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Exceptions\";\n"); - XTalkWait(task,"yy"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoTextDemo() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/DolDoc/TextDemo\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoCursorMove() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/DolDoc/CursorMove\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoDemoDoc() -{ - CTask *task=User; - XTalkWait(task,"Ed(\"::/Demo/DolDoc/DemoDoc.TXT\");\n"); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_CTRLG,0); - XTalkWait(task,"100"); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_ESC,0); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); - XTalk(task,"Exit;\n"); -} - -/* -U0 Do() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Spy\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} -*/ - -U0 DoFileRead() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/DolDoc/FileRead\";\n"); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} - -U0 DoData() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/DolDoc/Data\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoDefineStr() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/DolDoc/DefineStr\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoCallBack() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/DolDoc/CallBack\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoDefine() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Define\";\n"); - XTalkWait(task,"YS\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -/* -U0 Do() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/DolDoc/UnusedDefine\";\n"); - Sleep(500); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - XTalk(task,"Exit;\n"); -} -*/ - -U0 DoAsmHelloWorld() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Asm/AsmHelloWorld\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoAsmAndC1() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Asm/AsmAndC1\";\n2\n"); - XTalk(task,"Exit;\n"); - while (TaskValidate(task)) - Yield; -} - -U0 DoAsmAndC2() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Asm/AsmAndC2\";\n2\n"); - XTalk(task,"Exit;\n"); - while (TaskValidate(task)) - Yield; -} - -U0 DoAsmAndC3() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Asm/AsmAndC3\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoBuzzFizz() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Asm/BuzzFizz\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoMulByHand() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Asm/MulByHand\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoDivByHand() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Asm/DivByHand\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoPutDec() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/Asm/PutDec\";\n"); - Sleep(750); - XTalk(task,"Exit;\n"); -} - -U0 DoGlblVars() -{ - CTask *task=User; - XTalkWait(task,"#include \"::/Demo/GlblVars\";\n"); - Sleep(1000); - XTalk(task,"Exit;\n"); -} - -U0 DoReps() -{ - CTask *task=User; - TS; XTalkWait(task,"DocMax;Prof;HeapLog(ON);\n"); - TS; XTalkWait(task,"PCIRep;Sleep(750);\n"); - TS; XTalkWait(task,"MemBIOSRep;Sleep(750);\n"); - TS; XTalkWait(task,"MemRep;Sleep(750);\n"); - TS; XTalkWait(task,"ZipRep;Sleep(750);\n"); - TS; XTalkWait(task,"ProfRep;Sleep(750);\n"); - TS; XTalkWait(task,"HeapLogSizeRep;Sleep(750);\n"); - TS; if (DrvIsWritable(':')) XTalkWait(task,"ChkDsk;Sleep(750);\n"); - TS; if (DrvIsWritable(':')) { - XTalkWait(task,"DrvView;\n"); - Sleep(750); - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - } - TS; if (DrvIsWritable(':')) { - XTalkWait(task,"DskView;\n"); - Sleep(250); //Short because ATARep takes time. - PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); - } - TS; XTalkWait(task,"ATARep;\npSleep(750);\n"); - TS; XTalkWait(task,"HashDepthRep(adam_task->hash_table);Sleep(750);\n"); - TS; XTalkWait(task,"Who;Sleep(750);\n"); - TS; XTalkWait(task,"DrvRep;Sleep(750);\n"); - TS; XTalkWait(task,"TaskRep;Sleep(750);\n"); - XTalk(task,"Exit;\n"); -} - -U0 OSTestSuite() -{ - TSStart; - TS; DoBlackDiamond; - TS; DoEagleDive; - TS; DoFlatTops; - TS; DoDunGen; - TS; DoFPS; - TS; DoZoneOut; - TS; DoVaroom; - TS; DoRocket; - TS; DoRocketScience; - TS; DoBattleLines; - TS; DoBigGuns; - TS; DoBugFlapper; - TS; DoTimeOut; - TS; if (!sys_heap_init_flag) /* FloodFill */ DoSpan; - TS; DoStrut; - TS; DoRawHide; - TS; DoKeepAway; - TS; DoAfterEgypt; - TS; DoXCaliber; - TS; DoWenceslas; - TS; DoBomberGolf; - TS; DoTheDead; - TS; DoTreeCheckers; - TS; DoMPAdd; - TS; DoPrimes; - TS; if (FileFind(BIBLE_FILENAME)) DoPalindrome; - TS; DoClouds; - TS; if (mp_cnt>1) DoRadixSort; - TS; if (mp_cnt>1 && DrvIsWritable(':')) DoLoadTest; - TS; if (mp_cnt>1) DoRateCores; - TS; if (mp_cnt>1) DoMPPrint; - TS; if (mp_cnt>1) DoLock; - TS; if (mp_cnt>1) DoInterrupts; - TS; DoSpritePlot; - TS; DoElephant; - TS; DoSpritePlot3D; - TS; DoSpritePut; - TS; DoSpritePutExt; - TS; DoSpriteText; - TS; DoSpriteRaw; - TS; DoEdCSprite; - TS; DoBalloon; - TS; DoCarry; - TS; DoDirectives; - TS; DoRandDemo; - TS; DoExtents; - TS; DoDotNet; - TS; DoSunMoon; - TS; DoLowPassFilter; - TS; DoMathAudioDemo; - TS; DoLines; - TS; DoBounce; - TS; DoMsgLoop; - TS; DoASCIIOrgan; - TS; DoMorseCode; - TS; DoPixCollision; - TS; DoDoodle; - TS; DoMassSpring; - TS; DoSpeedLine; - TS; DoKeyBitMap; - TS; DoMountain; - TS; DoBSpline; - TS; DoGrModels; - TS; DoBlot; - TS; if (DrvIsWritable('~')) DoScreenCapture; - TS; DoGrid; - TS; DoPick; - TS; DoPick3D; - TS; DoWhap; - TS; DoPalette; - TS; DoPrint; - TS; DoShading; - TS; DoRotateTank; - TS; Do3DPoly; - TS; DoBox; - TS; DoSymmetry; - TS; DoShadow; - TS; DoTransform; - TS; DoPredatorPrey; - TS; DoPoleZeros; - TS; DoDigits; - TS; DoStadium; - TS; DoElephantWalk; - TS; DoHalogen; - TS; DoMaze; - TS; DoFontEd; - TS; DoLattice; - TS; DoCtrlR1; - TS; DoF2Macro; - TS; DoSubIntAccess; - TS; DoDemoDoc; - TS; DoTreeDemo; - TS; DoTextDemo; - TS; DoCursorMove; - TS; DoMiniCompiler; - TS; DoMiniGrLib; - TS; DoPhoneNumWords; - TS; DoUnusedSpaceRep; - TS; DoBlkDevRep; - TS; DoLastClass; - TS; if (DrvIsWritable('~')) DoFPrintF; - TS; DoSerializeTree; - TS; DoExceptions; - TS; DoScreenCodes; - TS; DoExtendedChars; - TS; DoPanText; - TS; DoCharAnimation; - TS; DoCharDemo; - TS; DoDateTime; - TS; DoSubSwitch; - TS; DoNullCase; - TS; DoMagicPairs; - TS; DoHanoi; - TS; DoSquirt; - TS; DoCommonAncestor; - TS; DoCartesian; - TS; DoRainDrops; - TS; DoCollision; - TS; DoLogic; - TS; DoCompileDemo; - TS; DoPrompt; - TS; if (DrvIsWritable('~')) DoWebLog; - TS; if (DrvIsWritable('~')) DoRevFile; - TS; if (DrvIsWritable('~')) DoSortFile; - TS; if (DrvIsWritable('~')) DoToHtmlToTXT; - TS; if (DrvIsWritable('~')) DoRegistryDemo; - TS; DoDefine; - TS; DoGlblVars; - TS; DoFileRead; - TS; DoParenWarn; - TS; DoDefineStr; - TS; DoData; - TS; DoCallBack; - TS; DoClassMeta; - TS; if (DrvIsWritable('~')) DoNumBible; - TS; DoForm; - TS; DoClickCallBack; - TS; DoMenuButton; - TS; DoMenuSprite; - TS; DoSuggestedSpelling; - TS; DoWordSearch; - TS; DoStkGrow; - TS; DoMemDemo; - TS; DoWaterFowl; - TS; DoAsmHelloWorld; - TS; DoAsmAndC1; - TS; DoAsmAndC2; - TS; DoAsmAndC3; - TS; DoMulByHand; - TS; DoDivByHand; - TS; DoBuzzFizz; - TS; DoPutDec; - TS; DoPageTableEntries; - DoReps; - TSEnd; -} - -OSTestSuite; - -//$LK,"::/Demo/Dsk/DskRaw.CPP"$ -//$LK,"::/Demo/Graphics/InputPointer.CPP"$ diff --git a/Misc/OSTestSuite.HC b/Misc/OSTestSuite.HC new file mode 100644 index 0000000..8040767 --- /dev/null +++ b/Misc/OSTestSuite.HC @@ -0,0 +1,1779 @@ +$PL,1000$I64 ts_num; +U0 TSStart() +{ + ts_num=0; +} +U0 TS() +{ + progress4=ts_num++; + progress4_max=169; + *progress4_desc=0; +} +U0 TSFile(U8 *name,I64 ms=750) +{ + CTask *task=User("#include \"%s\";Sleep(%d);Exit;\n",name,ms); + DeathWait(&task); +} +U0 TSFileChar(U8 *name,I64 ms=750,I64 ch=CH_SPACE,Bool wait=TRUE) +{ + CTask *task=User; + if (wait) + XTalkWait(task,"#include \"%s\";\n",name); + else + XTalk(task,"#include \"%s\";\n",name); + Sleep(ms); + PostMsgWait(task,MSG_KEY_DOWN_UP,ch,0); + XTalk(task,"Exit;\n"); +// DeathWait(&task); +} +U0 TSEnd() +{ + if (ts_num!=progress4_max) + ST_ERR_ST "Cnt %d should be %d.\n",ts_num,progress4_max; + else + "$$GREEN$$Test Suite Completed$$FG$$\n"; + ProgressBarsRst; +} + +U0 DoRandDemo() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/RandDemo\";\n"); + XTalkWait(task," "); + XTalkWait(task," "); + Sleep(750); + XTalk(task,"Exit;\n"); +} + +U0 DoLowPassFilter() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Graphics/LowPassFilter\";\n"); + Sleep(300); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(300); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(300); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(300); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(300); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} + +U0 DoMathAudioDemo() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Graphics/MathAudioDemo\";\n"); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} + +U0 DoMsgLoop() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/MsgLoop\";\n"); + Sleep(300); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(300); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoASCIIOrgan() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Snd/ASCIIOrgan\";\n"); + Sleep(100); + PostMsgWait(task,MSG_KEY_DOWN_UP,'A',0); + Sleep(200); + PostMsgWait(task,MSG_KEY_DOWN_UP,'B',0); + Sleep(200); + PostMsgWait(task,MSG_KEY_DOWN_UP,'C',0); + Sleep(200); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoDoodle() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Graphics/Doodle\";\n"); + PostMsgWait(task,MSG_IP_L_DOWN,10,10); + PostMsgWait(task,MSG_IP_L_UP,100,200); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoSpeedLine() +{ + I64 i=PURPLE; + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Graphics/Speedline\";\n"); + PostMsgWait(task,MSG_IP_L_DOWN,10,10); + PostMsgWait(task,MSG_IP_L_UP,100,200); + PostMsg(task,MSG_IP_R_DOWN_UP,0,0); + BirthWait(&task->popup_task); + while (i--) + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + Sleep(100); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_ESC,0); + TaskWait(task); + PostMsgWait(task,MSG_IP_L_DOWN,50,10); + PostMsgWait(task,MSG_IP_L_UP,150,200); + Sleep(1000); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoKeyBitMap() +{ + I64 i_sc=Char2ScanCode('i'); + CTask *task=User; + XTalk(task,"#include \"::/Demo/KeyBitMap\";\n"); + Sleep(50); + LBts(kbd.down_bitmap,i_sc); + Sleep(500); + LBtr(kbd.down_bitmap,i_sc); + Sleep(50); + XTalk(task,"Exit;\n"); +} + +U0 DoMountain() +{ + CTask *task=User("#include \"::/Demo/Graphics/Mountain\";\n"); + Sleep(1500); + Kill(task); +} + +U0 DoDigits() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Games/Digits\";\n"); + Sleep(100); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(100); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(250); + PostMsgWait(task,MSG_KEY_DOWN_UP,'1',0); + Sleep(250); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoSymmetry() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Graphics/Symmetry\";\n"); + PostMsgWait(task,MSG_IP_R_DOWN,100,100); + PostMsgWait(task,MSG_IP_R_UP,200,200); + Sleep(100); + PostMsgWait(task,MSG_IP_L_DOWN,10,10); + PostMsgWait(task,MSG_IP_L_UP,100,200); + Sleep(250); + PostMsgWait(task,MSG_IP_L_DOWN,100,200); + PostMsgWait(task,MSG_IP_L_UP,400,400); + Sleep(250); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoBSpline() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Graphics/BSpline\";\n"); + PostMsgWait(task,MSG_IP_L_DOWN_UP,50,50); + PostMsgWait(task,MSG_IP_L_DOWN_UP,300,100); + PostMsgWait(task,MSG_IP_L_DOWN_UP,150,300); + PostMsgWait(task,MSG_IP_R_DOWN_UP,0,0); + Sleep(1500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} + +U0 DoScreenCapture() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Graphics/ScreenCapture\";\n"); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(750); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); + Del("~/DemoScreenShot.GRA*"); +} + +/* +U0 DoPullDownMenu() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/PullDownMenu\";\n"); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} +*/ + +U0 DoStadium() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Games/Stadium/Stadium\";\n"); + Sleep(50); + PostMsgWait(task,MSG_IP_L_DOWN_UP,100,10); + Sleep(300); + PostMsgWait(task,MSG_IP_L_DOWN_UP,320,20); + Sleep(300); + PostMsgWait(task,MSG_IP_L_DOWN_UP,520,10); + Sleep(300); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoPalette() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Graphics/Palette\";\n"); + Sleep(400); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(400); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} + +U0 DoElephantWalk() +{ + I64 i; + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Games/ElephantWalk\";\n"); + for (i=0;i<15;i++) { + PostMsgWait(task,MSG_KEY_DOWN,0,SC_CURSOR_RIGHT); + Sleep(50); + } + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoHalogen() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Games/Halogen\";\n"); + PostMsgWait(task,MSG_KEY_DOWN,0,SC_CURSOR_UP); + Sleep(1000); + PostMsgWait(task,MSG_KEY_UP,0,SC_CURSOR_UP); + PostMsgWait(task,MSG_KEY_DOWN,0,SC_CURSOR_RIGHT); + Sleep(333); + PostMsgWait(task,MSG_KEY_UP,0,SC_CURSOR_RIGHT); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoTheDead() +{ + I64 i; + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Games/TheDead\";\n"); + for (i=0;i<15;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(50); + } + for (i=0;i<15;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(50); + } + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoBomberGolf() +{ + I64 i; + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Games/BomberGolf\";\n"); + for (i=0;i<7;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); + Sleep(100); + } + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + for (i=0;i<7;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_LEFT); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_LEFT); + Sleep(200); + } + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoZoneOut() +{ + I64 i; + CTask *task=User; + XTalk(task,"#include \"::/Demo/Games/ZoneOut\";\n"); + BirthWait(&task->popup_task); + TaskWait(task->popup_task); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + for (i=0;i<15;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(100); + } + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoVaroom() +{ + I64 i; + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Games/Varoom\";\n"); + for (i=0;i<10;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); + Sleep(50); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); + Sleep(50); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_LEFT); + Sleep(50); + } + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoFlatTops() +{ + CTask *task=User; + XTalk(task,"#include \"::/Demo/Games/FlatTops\";\n"); + BirthWait(&task->popup_task); + TaskWait(task->popup_task); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + DeathWait(&task->popup_task); + PostMsgWait(task,MSG_IP_R_DOWN_UP,RandI16%400+200,RandI16%300+150); + Sleep(1500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoWenceslas() +{ + I64 i; + CTask *task=User; + XTalk(task,"#include \"::/Demo/Games/Wenceslas\";\n"); + BirthWait(&task->popup_task); + TaskWait(task->popup_task); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(100); + BirthWait(&task->popup_task); + TaskWait(task->popup_task); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(100); + BirthWait(&task->popup_task); + TaskWait(task->popup_task); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(100); + for (i=0;i<25;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); + Sleep(25); + } + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoTreeCheckers() +{ + I64 task_num; + CTask *task=User; + XTalk(task,"#include \"::/Demo/Games/TreeCheckers\";\n"); + + BirthWait(&task->popup_task); + TaskWait(task->popup_task); + task_num=task->popup_task->task_num; + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + + BirthWait(&task->popup_task,task_num); + TaskWait(task->popup_task); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + + Sleep(500); + + PostMsgWait(task,MSG_KEY_DOWN_UP,'\n',0); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoMorseCode() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Snd/MorseCode\";\n"); + Sleep(50); + + PostMsg(task,MSG_KEY_DOWN,CH_SPACE,0); + Sleep(200); + PostMsg(task,MSG_KEY_UP,CH_SPACE,0); + Sleep(350); + + PostMsg(task,MSG_KEY_DOWN,CH_SPACE,0); + Sleep(50); + PostMsg(task,MSG_KEY_UP,CH_SPACE,0); + Sleep(350); + + PostMsg(task,MSG_KEY_DOWN,CH_SPACE,0); + Sleep(50); + PostMsg(task,MSG_KEY_UP,CH_SPACE,0); + Sleep(25); + PostMsg(task,MSG_KEY_DOWN,CH_SPACE,0); + Sleep(200); + PostMsg(task,MSG_KEY_UP,CH_SPACE,0); + Sleep(25); + PostMsg(task,MSG_KEY_DOWN,CH_SPACE,0); + Sleep(50); + PostMsg(task,MSG_KEY_UP,CH_SPACE,0); + Sleep(500); + + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoPixCollision() +{ + I64 w,h; + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Graphics/Collision\";\n"); + w=task->pix_width>>1 +task->pix_left+task->scroll_x; + h=task->pix_height>>1+task->pix_top +task->scroll_y; + IPSet(w-35,h-35); + AFSetIP(10,w+35,w+35); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} + +U0 DoBlackDiamond() +{ + I64 i; + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Games/BlackDiamond\";\n"); + for (i=0;i<15;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); + Sleep(75); + } + for (i=0;i<12;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + Sleep(75); + } + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoCtrlR1() +{ + I64 i,task_num=-1; + CTask *task=User; + XTalkWait(task,"//"); + PostMsg(task,MSG_KEY_DOWN_UP,CH_CTRLR,0); + BirthWait(&task->popup_task); + TaskWait(task->popup_task); + task_num=task->popup_task->task_num; + for (i=0;i<1;i++) + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsg(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + DeathWait(&task->popup_task); + //Color + BirthWait(&task->popup_task,task_num); + TaskWait(task->popup_task); + task_num=task->popup_task->task_num; + for (i=0;i<2;i++) + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsg(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + BirthWait(&task->popup_task,task_num); + TaskWait(task->popup_task); + for (i=0;i<2;i++) + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + task_num=task->popup_task->task_num; + PostMsg(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + + //Width + BirthWait(&task->popup_task,task_num); + TaskWait(task->popup_task); + task_num=task->popup_task->task_num; + for (i=0;i<4;i++) + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsg(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + BirthWait(&task->popup_task,task_num); + TaskWait(task->popup_task); + for (i=0;i<4;i++) + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + task_num=task->popup_task->task_num; + PostMsg(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + + //Line + BirthWait(&task->popup_task,task_num); + TaskWait(task->popup_task); + task_num=task->popup_task->task_num; + for (i=0;i<7;i++) + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsg(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + DeathWait(&task->popup_task); + PostMsgWait(task,MSG_IP_L_DOWN,150,150); + PostMsgWait(task,MSG_IP_L_UP,150,95); + Sleep(250); + PostMsgWait(task,MSG_IP_L_DOWN,150,150); + PostMsgWait(task,MSG_IP_L_UP,190,190); + Sleep(250); + PostMsgWait(task,MSG_IP_L_DOWN,150,150); + PostMsgWait(task,MSG_IP_L_UP,110,190); + Sleep(250); + PostMsg(task,MSG_IP_R_DOWN_UP,100,100); + + //Color + BirthWait(&task->popup_task); + TaskWait(task->popup_task); + task_num=task->popup_task->task_num; + for (i=0;i<2;i++) + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsg(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + BirthWait(&task->popup_task,task_num); + TaskWait(task->popup_task); + for (i=0;i<3;i++) + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + task_num=task->popup_task->task_num; + PostMsg(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + + //Circle + BirthWait(&task->popup_task,task_num); + TaskWait(task->popup_task); + task_num=task->popup_task->task_num; + for (i=0;i<10;i++) + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsg(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + DeathWait(&task->popup_task); + PostMsgWait(task,MSG_IP_L_DOWN,150,150); + PostMsgWait(task,MSG_IP_L_UP,190,190); + Sleep(250); + PostMsg(task,MSG_IP_R_DOWN_UP,100,100); + + //Exit + BirthWait(&task->popup_task); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN+SCF_CTRL); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); + PostMsg(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + DeathWait(&task->popup_task); + Sleep(1000); + XTalk(task,"\nExit;\n"); +} + +U0 DoF2Macro() +{ + I64 i; + U8 *ptr="\"Boo!\\n\";\n"; + CTask *task=User; + DeathWait(&sys_macro_task); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_F2); + BirthWait(&sys_macro_task); + TaskWait(sys_macro_task); + + PostMsgWait(sys_macro_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT|SCF_CTRL); + PostMsgWait(sys_macro_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsgWait(sys_macro_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); + PostMsgWait(sys_macro_task,MSG_KEY_DOWN_UP,CH_SPACE,0); //Press RECORD + while (!Bt(&sys_semas[SYS_SEMA_RECORD_MACRO],0)) + Yield; + + while (*ptr) + PostMsgWait(task,MSG_KEY_DOWN,*ptr++,0); + + PostMsgWait(sys_macro_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsgWait(sys_macro_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsgWait(sys_macro_task,MSG_KEY_DOWN_UP,CH_SPACE,0); //Press STOP + + for (i=0;i<10;i++) + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_F2|SCF_SHIFT); + + PostMsg(sys_macro_task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + DeathWait(&sys_macro_task); + + Sleep(1000); + XTalk(task,"\nExit;\n"); +} + +/* +U0 DoTicTacToe() +{ +} +*/ + +U0 DoPredatorPrey() +{ + CTask *task=User; + XTalk(task,"#include \"::/Demo/Graphics/PredatorPrey\";\n"); + BirthWait(&task->popup_task); + TaskWait(task->popup_task); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(1500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} + +U0 DoCharDemo() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Games/CharDemo\";\n"); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_LEFT); + Sleep(750); + PostMsg(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoLattice() +{ + I64 i; + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Graphics/Lattice\";\n"); + for (i=0;i<20;i++) + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); + for (i=0;i<6;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,'+',0); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_LEFT); + } + for (i=0;i<6;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_LEFT); + } + for (i=0;i<16;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); + } + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +/* +U0 Do() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Apps/Psalmody/Examples\";\n"); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} + +U0 DoLife() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Graphics/Life\";\n"); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} + +U0 DoZing() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Games/Zing\";\n"); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} + +U0 Do() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Graphics/Slider\";\n"); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} + +U0 Do() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Graphics/ScrollBars\";\n"); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} +*/ + +U0 DoCartesian() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Graphics/Cartesian\";\n"); + XTalkWait(task,"0.2*x`1.5\n"); + Sleep(750); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoMPAdd() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/MultiCore/MPAdd\";\n"); + Sleep(750); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(750); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} + +U0 DoFlapBat() +{ + I64 i; + CTask *task=User; + XTalk(task,"#include \"::/Demo/Games/FlapBat\";\n"); + BirthWait(&task->popup_task); + TaskWait(task->popup_task); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(500); + for (i=0;i<4;i++) { + PostMsgWait(task,MSG_KEY_DOWN,CH_SPACE,0); + Sleep(100); + PostMsgWait(task,MSG_KEY_UP,CH_SPACE,0); + Sleep(100); + } + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoBattleLines() +{ + CTask *task=User; + XTalk(task,"#include \"::/Demo/Games/BattleLines\";\n"); + BirthWait(&task->popup_task); + TaskWait(task->popup_task); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + DeathWait(&task->popup_task); + IPSet(430,300,,TRUE); + AFSetIP(10,530,400); + IPSet(,,,FALSE); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoBigGuns() +{ + I64 i,task_num; + CTask *task=User; + XTalk(task,"#include \"::/Demo/Games/BigGuns\";\n"); + BirthWait(&task->popup_task); + task_num=task->popup_task->task_num; + TaskWait(task->popup_task); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + BirthWait(&task->popup_task,task_num); + TaskWait(task->popup_task); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + for (i=0;i<5;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_LEFT); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_LEFT); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_LEFT); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_LEFT); + Sleep(200); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + } + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoDunGen() +{ + I64 i; + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Games/DunGen\";\n"); + for (i=0;i<10;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); + Sleep(100); + } + for (i=0;i<12;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + Sleep(100); + } + for (i=0;i<6;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); + Sleep(100); + } + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoTimeOut() +{ + I64 i; + CTask *task=User; + XTalkWait(task,"#include \"::/Apps/TimeOut/Run\";\n"); + Sleep(200); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + for (i=0;i<3;i++) { + PostMsgWait(task,MSG_KEY_DOWN,CH_SPACE,0); + LBts(kbd.down_bitmap,SC_CURSOR_RIGHT); + Sleep(200); + PostMsgWait(task,MSG_KEY_UP,CH_SPACE,0); + LBtr(kbd.down_bitmap,SC_CURSOR_RIGHT); + Sleep(200); + PostMsgWait(task,MSG_KEY_DOWN,CH_SPACE,0); + LBts(kbd.down_bitmap,SC_CURSOR_LEFT); + Sleep(200); + PostMsgWait(task,MSG_KEY_UP,CH_SPACE,0); + LBtr(kbd.down_bitmap,SC_CURSOR_LEFT); + Sleep(200); + } + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoSpan() +{ + CTask *task=User; + XTalk(task,"#include \"::/Apps/Span/Run\";\n"); + BirthWait(&task->popup_task); + TaskWait(task->popup_task); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(1500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoStrut() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Apps/Strut/Run\";\n"); + + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + + IPSet(200,200,,TRUE); + PostMsgWait(task,MSG_IP_L_DOWN,0,0); + WinMgrSync(2); + + IPSet(GR_WIDTH-200,200,,TRUE); + PostMsgWait(task,MSG_IP_L_DOWN,0,0); + + IPSet(GR_WIDTH/2,400,,TRUE); + PostMsgWait(task,MSG_IP_L_DOWN,0,0); + + PostMsgWait(task,MSG_KEY_DOWN_UP,'s',0); + + IPSet(200,200,,TRUE); + PostMsgWait(task,MSG_IP_L_DOWN,0,0); + IPSet(GR_WIDTH-200,200,,TRUE); + PostMsgWait(task,MSG_IP_L_UP,0,0); + + IPSet(200,200,,TRUE); + PostMsgWait(task,MSG_IP_L_DOWN,0,0); + IPSet(GR_WIDTH/2,400,,TRUE); + PostMsgWait(task,MSG_IP_L_UP,0,0); + + IPSet(GR_WIDTH-200,200,,TRUE); + PostMsgWait(task,MSG_IP_L_DOWN,0,0); + IPSet(GR_WIDTH/2,400,,TRUE); + PostMsgWait(task,MSG_IP_L_UP,0,0); + + IPSet(GR_WIDTH/2,GR_HEIGHT/2,,TRUE); + PostMsgWait(task,MSG_IP_L_DOWN,0,0); + IPSet(GR_WIDTH-200,200,,TRUE); + PostMsgWait(task,MSG_IP_L_UP,0,0); + + IPSet(GR_WIDTH/2,GR_HEIGHT/2,,TRUE); + PostMsgWait(task,MSG_IP_L_DOWN,0,0); + IPSet(GR_WIDTH/2,400,,TRUE); + PostMsgWait(task,MSG_IP_L_UP,0,0); + + IPSet(GR_WIDTH/2,GR_HEIGHT/2,,TRUE); + PostMsgWait(task,MSG_IP_L_DOWN,0,0); + IPSet(200,200,,TRUE); + PostMsgWait(task,MSG_IP_L_UP,0,0); + + PostMsgWait(task,MSG_KEY_DOWN_UP,'t',0); + + IPSet(GR_WIDTH/2,400,,TRUE); + PostMsgWait(task,MSG_IP_L_DOWN,0,0); + IPSet(GR_WIDTH-200,200,,TRUE); + PostMsgWait(task,MSG_IP_L_UP,0,0); + + IPSet(GR_WIDTH/2,400,,TRUE); + PostMsgWait(task,MSG_IP_L_DOWN,0,0); + IPSet(200,200,,TRUE); + PostMsgWait(task,MSG_IP_L_UP,0,0); + + IPSet(,,,FALSE); + + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + LBts(kbd.down_bitmap,Char2ScanCode('1')); + Sleep(600); + LBtr(kbd.down_bitmap,Char2ScanCode('1')); + PostMsgWait(task,MSG_KEY_DOWN_UP,'Z',0); + Sleep(200); + PostMsgWait(task,MSG_KEY_DOWN_UP,'Z',0); + Sleep(200); + PostMsgWait(task,MSG_KEY_DOWN_UP,'Z',0); + Sleep(200); + + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoRawHide() +{ + CTask *task=User; + XTalk(task,"#include \"::/Demo/Games/RawHide\";\n"); + BirthWait(&task->popup_task); + TaskWait(task->popup_task); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(2500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoAfterEgypt() +{ + CTask *task=User; + XTalk(task,"#include \"::/Apps/AfterEgypt/Run\";\n"); + BirthWait(&task->popup_task); + Sleep(600); //It flushes messages! + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + DeathWait(&task->popup_task); + TaskWait(task); + Sleep(1000); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); //Camp + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); //Map + Sleep(1000); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); //Map + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); //Camp + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); //Main Menu + XTalk(task,"Exit;\n"); +} + +U0 DoPoleZeros() +{ + CTask *task=User; + XTalk(task,"#include \"::/Demo/Graphics/PoleZeros\";\n"); + BirthWait(&task->popup_task); + TaskWait(task->popup_task); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(750); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoWhap() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Games/Whap\";\n"); + IPSet(300,200); + Sleep(500); + AFSetIP(3,350,300); + Sleep(500); + AFSetIP(3,450,200); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoGrid() +{ + CTask *task=User; + XTalk(task,"#include \"::/Demo/Graphics/Grid\";\n"); + IPSet(200,200); + Sleep(150); + AFSetIP(2,400,400); + AFSetIP(2,200,400); + AFSetIP(2,200,200); + IPSet(,,,TRUE); + Sleep(50); + IPSet(,,,FALSE); + DocBottom(DocPut(task)); + XTalk(task,"Exit;\n"); +} + +U0 DoPick() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Graphics/Pick\";\n"); + IPSet(200,200); + Sleep(500); + IPSet(,,,TRUE); + AFSetIP(4,400,400); + IPSet(,,,FALSE); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoPick3D() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Graphics/Pick3D\";\n"); + IPSet(200,200); + Sleep(500); + IPSet(,,,TRUE); + AFSetIP(4,400,400); + IPSet(,,,FALSE); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +/* +U0 Do() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Apps/ToTheFront\";\n"); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} +*/ + +U0 DoGrModels() +{ + CTask *task=User; + I64 i,j,task_num=-1; + XTalkWait(task,"#include \"::/Apps/GrModels/Run\";\n"); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + PostMsg(task,MSG_KEY_DOWN_UP,CH_ESC,0); + for (i=0;i<4;i++) { + BirthWait(&task->popup_task,task_num); + TaskWait(task->popup_task); + task_num=task->popup_task->task_num; + for (j=0;j<=i;j++) + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + } + Sleep(1000); + PostMsgWait(task,MSG_KEY_DOWN_UP,'n',0); + XTalk(task,"Exit;\n"); +} + +U0 DoKeepAway() +{ + CTask *task=User; + XTalk(task,"#include \"::/Apps/KeepAway/Run\";\n"); + BirthWait(&task->popup_task); + TaskWait(task->popup_task); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + IPSet(100,100); + Sleep(1500); + PostMsgWait(task,MSG_IP_R_DOWN_UP,ip.pos.x,ip.pos.y); + Sleep(1000); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoRocket() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Games/Rocket\";\n"); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); + Bts(kbd.down_bitmap,SC_CURSOR_UP); + Sleep(1000); + Btr(kbd.down_bitmap,SC_CURSOR_UP); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); + Bts(kbd.down_bitmap,SC_CURSOR_RIGHT); + Sleep(1000); + Btr(kbd.down_bitmap,SC_CURSOR_RIGHT); + Sleep(1000); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoRocketScience() +{ + CTask *task=User; + XTalk(task,"#include \"::/Demo/Games/RocketScience\";\n"); + BirthWait(&task->popup_task); + TaskWait(task->popup_task); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(750); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(2000); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoMassSpring() +{ + CTask *task=User; + XTalk(task,"#include \"::/Demo/Games/MassSpring\";\n"); + BirthWait(&task->popup_task); + TaskWait(task->popup_task); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + DeathWait(&task->popup_task); + PostMsgWait(task,MSG_IP_L_DOWN_UP,50,50); //#1 + PostMsgWait(task,MSG_IP_L_DOWN_UP,50,200); //#2 + PostMsgWait(task,MSG_IP_L_DOWN_UP,210,50); //#3 + PostMsgWait(task,MSG_IP_L_DOWN_UP,310,200);//#4 + Sleep(500); + PostMsgWait(task,MSG_IP_R_DOWN,50,50); //1-2 + PostMsgWait(task,MSG_IP_R_UP,50,200); + Sleep(500); + PostMsgWait(task,MSG_IP_R_DOWN,210,50);//3-4 + PostMsgWait(task,MSG_IP_R_UP,310,200); + Sleep(500); + PostMsgWait(task,MSG_IP_R_DOWN,50,200);//2-4 + PostMsgWait(task,MSG_IP_R_UP,310,200); + Sleep(500); + PostMsgWait(task,MSG_IP_R_DOWN,50,50); //1-3 + PostMsgWait(task,MSG_IP_R_UP,210,50); + Sleep(1500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +/* +U0 Do() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Games/Whap\";\n"); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} +*/ + +U0 DoSquirt() +{ + I64 i; + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Games/Squirt\";\n"); + for (i=0;i<5;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); + Sleep(100); + } + for (i=0;i<5;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_LEFT); + Sleep(100); + } + for (i=0;i<5;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + Sleep(100); + } + for (i=0;i<5;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); + Sleep(100); + } + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoXCaliber() +{ + I64 i; + CTask *task=User; + XTalkWait(task,"#include \"::/Apps/X-Caliber/Run\";\n"); + for (i=0;i<5;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SCF_SHIFT|SC_CURSOR_UP); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SCF_SHIFT|SC_CURSOR_RIGHT); + } + for (i=0;i<10;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + PostMsgWait(task,MSG_KEY_DOWN,0,SC_CURSOR_RIGHT,0); + Sleep(100); + PostMsgWait(task,MSG_KEY_UP,0,SC_CURSOR_RIGHT,0); + Sleep(50); + } + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoFPS() +{ + I64 i; + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Games/CastleFrankenstein\";\n"); + for (i=0;i<15;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); + Sleep(50); + } + for (i=0;i<8;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); + Sleep(50); + } + for (i=0;i<9;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); + Sleep(50); + } + for (i=0;i<6;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); + Sleep(50); + } + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoEagleDive() +{ + I64 i; + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Games/EagleDive\";\n"); + Sleep(500); + for (i=0;i<10;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP); + Sleep(50); + } + for (i=0;i<10;i++) { + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + Sleep(50); + } + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +/* +U0 Do() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Apps/Psalmody\";\n"); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} +*/ + +U0 DoPhoneNumWords() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/PhoneNumWords\";\n"); + XTalkWait(task,"702-254-4223\n\n"); + Sleep(750); + XTalk(task,"Exit;\n"); +} + +U0 DoSuggestedSpelling() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/SuggestSpelling\";\n"); + XTalkWait(task,"effecient\n\n"); + Sleep(750); + XTalk(task,"Exit;\n"); +} + +U0 DoFPrintF() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Dsk/FPrintF\";\n"); + XTalkWait(task,"~/DemoFPrintF.DD.Z"); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_ESC,0); + XTalkWait(task,"Type(\"~/DemoFPrintF.DD.Z\");\n"); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_CTRLO,0); + XTalkWait(task,"Del(\"~/DemoFPrintF.DD*\");\n"); + Sleep(500); + XTalk(task,"Exit;\n"); +} + +/* +U0 Do() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Dsk/DataBase\";\n"); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} + +U0 DoRaw() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Dsk/Raw\";\n"); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} +*/ + +U0 DoLastClass() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/LastClass\";\n"); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(500); + XTalk(task,"Exit;\n"); +} + +U0 DoMiniCompiler() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Lectures/MiniCompiler\";\n"); + XTalkWait(task,"1+2*(3+4)\n"); + Sleep(750); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoWebLog() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/WebLogDemo/WebLogRep\";\n"); + PostMsgWait(task,MSG_KEY_DOWN_UP,'\n',0); + PostMsgWait(task,MSG_KEY_DOWN_UP,'\n',0); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_ESC,0); + Sleep(750); + XTalk(task,"Exit;\n"); +} + +U0 DoRevFile() +{ + CTask *task; + Del("~/DemoPoemFwd.DD*"); + task=User("#include \"::/Demo/RevFileDemo/Rev\";" + "Type(\"~/DemoPoemFwd.DD.Z\");Sleep(750);Exit;\n"); + DeathWait(&task); +} + +U0 DoSortFile() +{ + CTask *task=User("#include \"::/Demo/SortFileDemo/F64FileGen\";" + "#include \"::/Demo/SortFileDemo/F64FileSort\";Sleep(750);Exit;\n"); + DeathWait(&task); +} + +U0 DoToHtmlToTXT() +{ + CTask *task=User("#include \"::/Demo/ToHtmlToTXTDemo/HtmlGen\";" + "#include \"::/Demo/ToHtmlToTXTDemo/TXTGen\";Sleep(750);Exit;\n"); + DeathWait(&task); +} + +/* +U0 Do() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Apps/TimeClock\";\n"); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} +*/ + +U0 DoLogic() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Apps/Logic/Run\";\n"); + XTalkWait(task,"NAND\nNOR\n\n0x100\n0xF0\n0xCC\n0xAA\n\n0x12\n\n"); + Sleep(750); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} + +/* +U0 Do() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Lectures\";\n"); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} + +U0 Do() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/AutoFile\";\n"); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} +*/ + +U0 DoPrompt() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Prompt\";\n"); + XTalkWait(task,"1+2*3<<4\n"); + XTalkWait(task,"1.0+2*3`2\n"); + XTalkWait(task,"Terry Davis\n"); + XTalkWait(task,"*-1\n"); + Sleep(750); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} + +U0 DoNumBible() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/DolDoc/NumBible\";\n"); + Del("~/DemoNumBible.DD*"); + XTalk(task,"Exit;\n"); +} + +U0 DoForm() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/DolDoc/Form\";\n"); + Sleep(250); + XTalk(task,"54321"); + Sleep(250); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + Sleep(250); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SCF_CTRL|SC_CURSOR_LEFT); + XTalk(task,"77777"); + Sleep(250); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN); + Sleep(250); + XTalk(task,"MyName"); + Sleep(750); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_ESC,0); + Sleep(750); + XTalk(task,"Exit;\n"); +} + +U0 DoClickCallBack() +{ + I64 i; + CTask *task=User; + XTalk(task,"#include \"::/Demo/DolDoc/ClickCallBack\";\n"); + for (i=0;i<3;i++) { + BirthWait(&task->popup_task); + TaskWait(task->popup_task); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(250); + } + Sleep(500); + XTalk(task,"Exit;\n"); +} + +U0 DoMenuButton() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/DolDoc/MenuButton\";\n"); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN,0); + Sleep(500); + PostMsg(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + BirthWait(&task->popup_task); + TaskWait(task->popup_task); + Sleep(500); + PostMsgWait(sys_focus_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT); + Sleep(500); + PostMsgWait(task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0); + DeathWait(&task->popup_task); + Sleep(750); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoMenuSprite() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/DolDoc/MenuSprite\";\n"); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN,0); + Sleep(50); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(300); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN,0); + Sleep(50); + PostMsgWait(task,MSG_KEY_DOWN_UP,0,SC_CURSOR_DOWN,0); + Sleep(50); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(300); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +U0 DoExceptions() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Exceptions\";\n"); + XTalkWait(task,"yy"); + Sleep(750); + XTalk(task,"Exit;\n"); +} + +U0 DoDemoDoc() +{ + CTask *task=User; + XTalkWait(task,"Ed(\"::/Demo/DolDoc/DemoDoc.DD\");\n"); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_CTRLG,0); + XTalkWait(task,"100"); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_ESC,0); + Sleep(750); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0); + XTalk(task,"Exit;\n"); +} + +/* +U0 Do() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Spy\";\n"); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} +*/ + +U0 DoFileRead() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/DolDoc/FileRead\";\n"); + Sleep(750); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + Sleep(750); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} + +U0 DoDefine() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Define\";\n"); + XTalkWait(task,"YS\n"); + Sleep(750); + XTalk(task,"Exit;\n"); +} + +/* +U0 Do() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/DolDoc/UnusedDefine\";\n"); + Sleep(500); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + XTalk(task,"Exit;\n"); +} +*/ + +U0 DoAsmAndC1() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Asm/AsmAndC1\";\n2\n"); + XTalk(task,"Exit;\n"); + DeathWait(&task); +} + +U0 DoAsmAndC2() +{ + CTask *task=User; + XTalkWait(task,"#include \"::/Demo/Asm/AsmAndC2\";\n2\n"); + XTalk(task,"Exit;\n"); + DeathWait(&task); +} + +U0 DoReps() +{ + CTask *task=User; + TS; XTalkWait(task,"DocMax;Prof;HeapLog(ON);\n"); + TS; XTalkWait(task,"PCIRep;Sleep(750);\n"); + TS; XTalkWait(task,"MemBIOSRep;Sleep(750);\n"); + TS; XTalkWait(task,"MemRep;Sleep(750);\n"); + TS; XTalkWait(task,"ZipRep;Sleep(750);\n"); + TS; XTalkWait(task,"ProfRep;Sleep(750);\n"); + TS; XTalkWait(task,"HeapLogSizeRep;Sleep(750);\n"); + TS; if (mp_cnt>1) XTalkWait(task,"CPURep(TRUE);Sleep(750);\n"); + TS; if (DrvIsWritable(':')) XTalkWait(task,"ChkDsk;Sleep(750);\n"); + TS; if (DrvIsWritable(':')) { + XTalkWait(task,"DrvView;\n"); + Sleep(750); + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + } + TS; if (DrvIsWritable(':')) { + XTalkWait(task,"DskView;\n"); + Sleep(250); //Short because ATARep takes time. + PostMsgWait(task,MSG_KEY_DOWN_UP,CH_SPACE,0); + } + TS; XTalkWait(task,"ATARep;\npSleep(750);\n"); + TS; XTalkWait(task,"HashDepthRep(adam_task->hash_table);Sleep(750);\n"); + TS; XTalkWait(task,"Who;Sleep(750);\n"); + TS; XTalkWait(task,"DrvRep;Sleep(750);\n"); + TS; XTalkWait(task,"TaskRep;Sleep(750);\n"); + XTalk(task,"Exit;\n"); +} + +U0 OSTestSuite() +{ + TSStart; + TS; DoBlackDiamond; + TS; DoEagleDive; + TS; DoFlatTops; + TS; DoDunGen; + TS; DoFPS; + TS; DoZoneOut; + TS; DoVaroom; + TS; DoRocket; + TS; DoRocketScience; + TS; DoBattleLines; + TS; DoBigGuns; + TS; DoFlapBat; + TS; DoTimeOut; + TS; if (!sys_heap_init_flag) /* FloodFill */ DoSpan; + TS; DoStrut; + TS; DoRawHide; + TS; DoKeepAway; + TS; DoAfterEgypt; + TS; DoXCaliber; + TS; DoWenceslas; + TS; DoBomberGolf; + TS; DoTheDead; + TS; DoTreeCheckers; + TS; DoMPAdd; + TS; TSFile("::/Demo/MultiCore/Primes"); + TS; if (FileFind(BIBLE_FILENAME)) TSFile("::/Demo/MultiCore/Palindrome"); + TS; TSFileChar("::/Demo/MultiCore/Clouds"); + TS; if (mp_cnt>1) TSFile("::/Demo/MultiCore/RadixSort"); + TS; if (mp_cnt>1 && DrvIsWritable(':')) + TSFileChar("::/Demo/MultiCore/LoadTest"); + TS; if (mp_cnt>1) TSFile("::/Demo/MultiCore/MPPrint"); + TS; if (mp_cnt>1) TSFile("::/Demo/MultiCore/Lock"); + TS; if (mp_cnt>1) TSFile("::/Demo/MultiCore/Interrupts"); + TS; TSFileChar("::/Demo/Graphics/SpritePlot"); + TS; TSFileChar("::/Demo/Graphics/Elephant",,CH_SHIFT_ESC); + TS; TSFileChar("::/Demo/Graphics/SpritePlot3D"); + TS; TSFile("::/Demo/Graphics/SpritePut"); + TS; TSFile("::/Demo/Graphics/SpritePutExt"); + TS; TSFile("::/Demo/Graphics/SpriteText"); + TS; TSFile("::/Demo/Graphics/SpriteRaw"); + TS; TSFile("::/Demo/Graphics/EdSprite"); + TS; TSFile("::/Demo/Graphics/Balloon",0); + TS; TSFile("::/Demo/Carry"); + TS; TSFile("::/Demo/Directives"); + TS; DoRandDemo; + TS; TSFileChar("::/Demo/Graphics/Extents"); + TS; TSFileChar("::/Demo/Graphics/NetOfDots"); + TS; TSFileChar("::/Demo/Graphics/SunMoon"); + TS; DoLowPassFilter; + TS; DoMathAudioDemo; + TS; TSFileChar("::/Demo/Graphics/Lines"); + TS; TSFileChar("::/Demo/Graphics/Bounce",,CH_SHIFT_ESC,FALSE); + TS; DoMsgLoop; + TS; DoASCIIOrgan; + TS; DoMorseCode; + TS; DoPixCollision; + TS; DoDoodle; + TS; DoMassSpring; + TS; DoSpeedLine; + TS; DoKeyBitMap; + TS; DoMountain; + TS; DoBSpline; + TS; DoGrModels; + TS; TSFileChar("::/Demo/Graphics/Blot",1800); + TS; if (DrvIsWritable('~')) DoScreenCapture; + TS; DoGrid; + TS; DoPick; + TS; DoPick3D; + TS; DoWhap; + TS; DoPalette; + TS; TSFile("::/Demo/Print"); + TS; TSFileChar("::/Demo/Graphics/Shading",1500); + TS; TSFileChar("::/Demo/Graphics/RotateTank",1500); + TS; TSFileChar("::/Demo/Graphics/3DPoly",1500); + TS; TSFileChar("::/Demo/Graphics/Box",1500); + TS; DoSymmetry; + TS; TSFileChar("::/Demo/Graphics/Shadow",1500); + TS; TSFileChar("::/Demo/Graphics/Transform",,CH_SHIFT_ESC); + TS; DoPredatorPrey; + TS; DoPoleZeros; + TS; DoDigits; + TS; DoStadium; + TS; DoElephantWalk; + TS; DoHalogen; + TS; TSFileChar("::/Demo/Games/Maze",,CH_SHIFT_ESC); + TS; TSFileChar("::/Demo/Graphics/FontEd",,CH_SHIFT_ESC); + TS; DoLattice; + TS; DoCtrlR1; + TS; DoF2Macro; + TS; TSFile("::/Demo/SubIntAccess"); + TS; DoDemoDoc; + TS; TSFile("::/Demo/DolDoc/TreeDemo"); + TS; TSFile("::/Demo/DolDoc/TextDemo"); + TS; TSFile("::/Demo/DolDoc/CursorMove"); + TS; DoMiniCompiler; + TS; TSFile("::/Demo/Lectures/MiniGrLib",0); + TS; TSFileChar("::/Demo/TimeIns"); + TS; DoPhoneNumWords; + TS; TSFile("::/Demo/Dsk/UnusedSpaceRep"); + TS; TSFile("::/Demo/Dsk/BlkDevRep"); + TS; DoLastClass; + TS; if (DrvIsWritable('~')) DoFPrintF; + TS; TSFile("::/Demo/Dsk/SerializeTree"); + TS; DoExceptions; + TS; TSFileChar("::/Demo/ScreenCodes"); + TS; TSFile("::/Demo/ExtChars"); + TS; TSFile("::/Demo/Graphics/PanText",0); + TS; TSFileChar("::/Demo/Graphics/CharAnimation"); + TS; DoCharDemo; + TS; TSFile("::/Demo/DateTime"); + TS; TSFile("::/Demo/SubSwitch"); + TS; TSFile("::/Demo/NullCase"); + TS; TSFile("::/Demo/MagicPairs"); + TS; TSFileChar("::/Demo/Graphics/Hanoi",3000); + TS; DoSquirt; + TS; TSFileChar("::/Demo/Graphics/CommonAncestor",1500,CH_SHIFT_ESC); + TS; DoCartesian; + TS; TSFileChar("::/Demo/Games/RainDrops",,CH_SHIFT_ESC); + TS; TSFileChar("::/Demo/Games/Collision",1500); + TS; DoLogic; + TS; TSFile("::/Demo/CompileDemo"); + TS; DoPrompt; + TS; if (DrvIsWritable('~')) DoWebLog; + TS; if (DrvIsWritable('~')) DoRevFile; + TS; if (DrvIsWritable('~')) DoSortFile; + TS; if (DrvIsWritable('~')) DoToHtmlToTXT; + TS; if (DrvIsWritable('~')) TSFile("::/Demo/RegistryDemo"); + TS; DoDefine; + TS; TSFile("::/Demo/GlblVars"); + TS; DoFileRead; + TS; TSFile("::/Demo/ParenWarn"); + TS; TSFile("::/Demo/DolDoc/DefineStr"); + TS; TSFile("::/Demo/DolDoc/Data"); + TS; TSFile("::/Demo/DolDoc/CallBack"); + TS; TSFile("::/Demo/ClassMeta"); + TS; if (DrvIsWritable('~')) DoNumBible; + TS; DoForm; + TS; DoClickCallBack; + TS; DoMenuButton; + TS; DoMenuSprite; + TS; DoSuggestedSpelling; + TS; TSFileChar("::/Demo/WordSearch"); + TS; TSFile("::/Demo/StkGrow"); + TS; TSFile("::/Demo/MemDemo"); + TS; TSFileChar("::/Demo/Snd/WaterFowl"); + TS; TSFile("::/Demo/Asm/AsmHelloWorld"); + TS; DoAsmAndC1; + TS; DoAsmAndC2; + TS; TSFile("::/Demo/Asm/AsmAndC3"); + TS; TSFile("::/Demo/Asm/MulByHand"); + TS; TSFile("::/Demo/Asm/DivByHand"); + TS; TSFile("::/Demo/Asm/BuzzFizz"); + TS; TSFile("::/Demo/Asm/PutDec"); + TS; TSFile("::/Demo/Lectures/Mem/PageTableEntries"); + DoReps; + TSEnd; +} + +OSTestSuite; + +//$LK,"::/Demo/Dsk/DskRaw.HC"$ +//$LK,"::/Demo/Graphics/InputPointer.HC"$ diff --git a/Misc/PCIDevices.TXT b/Misc/PCIDevices.DD similarity index 100% rename from Misc/PCIDevices.TXT rename to Misc/PCIDevices.DD diff --git a/Misc/Tour/Tour1.AUT b/Misc/Tour/Tour1.AUT index 10b73cf..bbed626 100644 --- a/Misc/Tour/Tour1.AUT +++ b/Misc/Tour/Tour1.AUT @@ -7,7 +7,7 @@ TourPut("Press $$GREEN$$$$FG$$ for the main help index.\n" "The $$GREEN$$$$FG$$ key works both in " "the editor and at the command line.\n" "\n" - "You can find the $LK+PU,"Demo Index",A="FI:::/Doc/DemoIndex.TXT"$ on the help index.\n"); + "You can find the $LK+PU,"Demo Index",A="FI:::/Doc/DemoIndex.DD"$ on the help index.\n"); AFGetKey(SC_F1); TourPut( diff --git a/Misc/Tour/Tour3.AUT b/Misc/Tour/Tour3.AUT index 9250f7c..3108bc1 100644 --- a/Misc/Tour/Tour3.AUT +++ b/Misc/Tour/Tour3.AUT @@ -22,7 +22,7 @@ TourPut( "type it on the command line.\n\n" "$$GREEN$$$$FG$$ to complete the command.\n"); -AFPrint(25,"Ed(\"CastleFrankenstein.CPP.Z\");"); +AFPrint(25,"Ed(\"CastleFrankenstein.HC.Z\");"); AFGetStr("\n"); Msg(MSG_KEY_DOWN_UP,0,SC_CURSOR_UP|SCF_CTRL); @@ -43,7 +43,7 @@ TourPut("Press $$GREEN$$$$FG$$ to abort the editor.\n"); AFGetChar(CH_ESC,CH_SHIFT_ESC); TourPut( -"Now, run the CastleFrankenstein.CPP.Z program. Press $$GREEN$$$$FG$$.\n"); +"Now, run the CastleFrankenstein.HC.Z program. Press $$GREEN$$$$FG$$.\n"); AFPrint(25,"#include \"CastleFrankenstein\";"); AFGetStr("\n"); @@ -72,7 +72,7 @@ TourPut( "$$GREEN$$$$FG$$\tTerminal window.\n" "$$GREEN$$$$FG$$\tKill task (window).\n",TRUE); -AFPrint(50,"Ed(\"CastleFrankenstein.CPP.Z\");\n"); +AFPrint(50,"Ed(\"CastleFrankenstein.HC.Z\");\n"); TourPut("Press $$GREEN$$$$FG$$ in the editor to run the file being edited.\n"); @@ -84,15 +84,14 @@ TourPut( "Press $$GREEN$$$$FG$$ to abort the application. " "Then, press $$GREEN$$$$FG$$ to kill the task.\n"); WinToTop(task); -while (TaskValidate(task)) - Sleep(10); +DeathWait(&task); TourPut("Press $$GREEN$$$$FG$$ to abort the editor.\n"); AFUntilChar(CH_ESC,CH_SHIFT_ESC); TourPut( -"Explore the $$RED$$$TX+L+PU+UL,"DemoIndex",A="FI:::/Doc/DemoIndex.TXT"$$$FG$$. " +"Explore the $$RED$$$TX+L+PU+UL,"DemoIndex",A="FI:::/Doc/DemoIndex.DD"$$$FG$$. " "You'll find it on your menu. It's arranged by difficulty. " "Hit $$GREEN$$$$FG$$ on a demo index listing " "and $$GREEN$$$$FG$$ to run from the editor.\n",TRUE); diff --git a/Misc/Tour/Tour4.AUT b/Misc/Tour/Tour4.AUT index 8134b76..49a79d5 100644 --- a/Misc/Tour/Tour4.AUT +++ b/Misc/Tour/Tour4.AUT @@ -3,7 +3,7 @@ Msg(MSG_KEY_DOWN,0,SC_CURSOR_DOWN|SCF_CTRL); "\nCd(\"::/Demo/Games\");Dir;\n"; TourPut( -"Now, we're going to add the CastleFrankenstein.CPP.Z program " +"Now, we're going to add the CastleFrankenstein.HC.Z program " "to your PersonalMenu.\n\n" "Press $$GREEN$$$$FG$$ to get to your PersonalMenu.\n"); AFGetChar(CH_CTRLM); diff --git a/Misc/Tour/Tour7.AUT b/Misc/Tour/Tour7.AUT index 36e8fd0..d3946b9 100644 --- a/Misc/Tour/Tour7.AUT +++ b/Misc/Tour/Tour7.AUT @@ -48,7 +48,7 @@ Sleep(2000); TourPut("Notice the number of matches.\n",TRUE); TourPut( -"The wrapper function is in your $$RED$$~/HomeWrappers.CPP.Z$$FG$$ file. " +"The wrapper function is in your $$RED$$~/HomeWrappers.HC.Z$$FG$$ file. " "There is a function $$RED$$$$TX+L+PU+UL,\"R\",A=\"MN:R\"$$$$FG$$() for " "find and replace. Feel free to customize.\n",TRUE); @@ -58,7 +58,7 @@ TourPut("Press $$GREEN$$$$FG$$.\n"); Msg(MSG_KEY_DOWN,0,SC_CURSOR_DOWN|SCF_CTRL); "\n"; -"Ed(\"~/HomeWrappers.CPP.Z\");"; +"Ed(\"~/HomeWrappers.HC.Z\");"; AFGetStr("\n"); TourPut("Press $$GREEN$$$$FG$$ to abort the source code.\n"); diff --git a/Misc/Tour/Tour8.AUT b/Misc/Tour/Tour8.AUT index 19ea966..02f9658 100644 --- a/Misc/Tour/Tour8.AUT +++ b/Misc/Tour/Tour8.AUT @@ -11,13 +11,13 @@ TourPut( "Press $$GREEN$$$$FG$$.\n"); AFGetStr("\n"); -"FF(\"/Kernel/St*;*.HPP*\");"; +"FF(\"/Kernel/St*;*.HH*\");"; TourPut( -"Let's have two mask of $$GREEN$$St*$$FG$$ plus $$GREEN$$*.HPP*$$FG$$\n\n" +"Let's have two mask of $$GREEN$$St*$$FG$$ plus $$GREEN$$*.HH*$$FG$$\n\n" "Press $$GREEN$$$$FG$$.\n"); AFGetStr("\n"); -"FF(\"/Kernel/St*;*.HPP*;!*Print*\");"; +"FF(\"/Kernel/St*;*.HH*;!*Print*\");"; TourPut( "Let's unsel $$GREEN$$*Print*$$FG$$.\n\n" "Press $$GREEN$$$$FG$$.\n"); diff --git a/Misc/Tour/TourA.AUT b/Misc/Tour/TourA.AUT index c169a47..e6d71d6 100644 --- a/Misc/Tour/TourA.AUT +++ b/Misc/Tour/TourA.AUT @@ -34,7 +34,7 @@ TourPut( AFGetStr("\n"); TourPut("The opcodes are slightly nonstandard.\n",TRUE); -"Ed(\"::/Compiler/OpCodes.TXT.Z\");\n"; +"Ed(\"::/Compiler/OpCodes.DD.Z\");\n"; Msg(MSG_KEY_DOWN,CH_CTRLF,0x42100000421); "MOV"; diff --git a/Misc/Tour/TourB.AUT b/Misc/Tour/TourB.AUT index 932e592..84de28a 100644 --- a/Misc/Tour/TourB.AUT +++ b/Misc/Tour/TourB.AUT @@ -9,7 +9,7 @@ TourPut( Msg(MSG_KEY_DOWN,0,SC_CURSOR_DOWN|SCF_CTRL); "\n"; -"Type(\"~/PersonalMenu.TXT\");"; +"Type(\"~/PersonalMenu.DD\");"; AFGetStr("\n"); Sleep(1500); diff --git a/PersonalMenu.DD b/PersonalMenu.DD new file mode 100644 index 0000000..1449dc1 Binary files /dev/null and b/PersonalMenu.DD differ diff --git a/PersonalMenu.TXT b/PersonalMenu.TXT deleted file mode 100644 index 70fe79f..0000000 Binary files a/PersonalMenu.TXT and /dev/null differ diff --git a/PersonalNotes.TXT b/PersonalNotes.DD similarity index 100% rename from PersonalNotes.TXT rename to PersonalNotes.DD diff --git a/StartOS.CPP b/StartOS.CPP deleted file mode 100644 index 0ceaf64..0000000 --- a/StartOS.CPP +++ /dev/null @@ -1,47 +0,0 @@ -//This is executed by the Adam task at boot. -//See $LK,"Adam Start-up",A="FF:::/Kernel/KEnd.CPP,\"StartOS"$. - -#help_index "Compiler/Directive" -public extern I8i Option(I64i num,I8i val); -Option(0,0); //(0,0)=EchoOff (0,1)=EchoOn - -#include "/Kernel/KernelA.HPP" -#include "/Compiler/CompilerA.HPP" -#include "/Kernel/KernelB.HPP" -#include "/Kernel/KernelC.HPP" -#include "/Compiler/CompilerB.HPP" - -Option(OPTf_WARN_PAREN,ON); -Option(OPTf_WARN_DUP_TYPES,ON); -HashTablePurge(adam_task->hash_table); - -#help_index "Misc" -//Use Dbg("Type 'G;'"); to debug before window mgr is running. -public F64 os_version=4.100;//Operating system version. - -#include "/Adam/MakeAdam" - -//Dbg("Type 'G;'"); -DocTermNew; -WinVert(2,10); - -sys_winmgr_task=Spawn(&WinMgrTask,NULL,"Window Mgr"); -Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_BORDER - -WIF_SELF_GRAB_SCROLL-WIF_SELF_CTRLS; -LBts(&Fs->display_flags,DISPLAYf_CHILDREN_NOT_ON_TOP); -LBts(&Fs->display_flags,DISPLAYf_SHOW); -RegInit; -LBts(&sys_run_level,RLf_REGISTRY); -WallPaperInit; - -if (DrvIsWritable) - MkDir("/Temp"); //Good to have a Temp - -Option(OPTf_WARN_PAREN,OFF); -Option(OPTf_WARN_DUP_TYPES,OFF); -LBts(&sys_run_level,RLf_HOME); - -#help_index "" -#include "/Home/MakeHome" - -//After this file, the Adam task enters $LK,"server mode",A="HI:Task/Srv"$. diff --git a/StartOS.HC b/StartOS.HC new file mode 100644 index 0000000..2accb2f --- /dev/null +++ b/StartOS.HC @@ -0,0 +1,47 @@ +//This is executed by the Adam task at boot. +//See $LK,"Adam Start-up",A="FF:::/Kernel/KEnd.HC,\"StartOS"$. + +#help_index "Compiler/Directive" +public extern I8i Option(I64i num,I8i val); +Option(0,0); //(0,0)=EchoOff (0,1)=EchoOn + +#include "/Kernel/KernelA.HH" +#include "/Compiler/CompilerA.HH" +#include "/Kernel/KernelB.HH" +#include "/Kernel/KernelC.HH" +#include "/Compiler/CompilerB.HH" + +Option(OPTf_WARN_PAREN,ON); +Option(OPTf_WARN_DUP_TYPES,ON); +HashTablePurge(adam_task->hash_table); + +#help_index "Misc" +//Use Dbg("Type 'G;'"); to debug before window mgr is running. +public F64 os_version=4.110;//Operating system version. + +#include "/Adam/MakeAdam" + +//Dbg("Type 'G;'"); +DocTermNew; +WinVert(2,10); + +sys_winmgr_task=Spawn(&WinMgrTask,NULL,"Window Mgr"); +Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_BORDER + -WIF_SELF_GRAB_SCROLL-WIF_SELF_CTRLS; +LBts(&Fs->display_flags,DISPLAYf_CHILDREN_NOT_ON_TOP); +LBts(&Fs->display_flags,DISPLAYf_SHOW); +RegInit; +LBts(&sys_run_level,RLf_REGISTRY); +WallPaperInit; + +if (DrvIsWritable) + MkDir("/Temp"); //Good to have a Temp + +Option(OPTf_WARN_PAREN,OFF); +Option(OPTf_WARN_DUP_TYPES,OFF); +LBts(&sys_run_level,RLf_HOME); + +#help_index "" +#include "/Home/MakeHome" + +//After this file, the Adam task enters $LK,"server mode",A="HI:Task/Srv"$.