TempleOSTS_131005.ISO
This commit is contained in:
1 parent
1343005a29
commit
2d2a65d572
547 files changed
+33608
-12549
No files matched your search
+157
-180
@@ -4,7 +4,7 @@
|
||||
|
||||
//The internal types are U16i,I32i, etc.
|
||||
//They are defined $LK,"internal_types_table","MN:internal_types_table"$.
|
||||
//Holy C has a feature where a
|
||||
//HolyC has a feature where a
|
||||
//union structure is treated as a
|
||||
//whole if no member is specified.
|
||||
//See $LK-A,"::/TempleOS/Demo/SubIntAccess.CPP"$.
|
||||
@@ -149,6 +149,7 @@ public class CQue
|
||||
#define OC_BPT 0xCC
|
||||
#define OC_CALL 0xE8
|
||||
#define OC_JMP_REL8 0xEB
|
||||
#define OC_NOP2 (OC_NOP<<8+OC_OP_SIZE_PREFIX)
|
||||
|
||||
//Function Stack Frame
|
||||
#define SF_RBP 0x00
|
||||
@@ -319,7 +320,7 @@ public class CSpring
|
||||
U0 start_saved_area;
|
||||
U32 flags,num,
|
||||
end1_num,end2_num;
|
||||
F64 constant,rest_len;
|
||||
F64 const,rest_len;
|
||||
U0 end_saved_area;
|
||||
};
|
||||
|
||||
@@ -625,45 +626,40 @@ class CSema
|
||||
#define SYS_SEMA_DEBUG 0
|
||||
#define SYS_SEMA_DETERMINISTIC 1
|
||||
#define SYS_SEMA_RECORD_MACRO 2
|
||||
#define SYS_SEMA_NO_IO_SND 3
|
||||
#define SYS_SEMA_SYS_TIMER 4
|
||||
#define SYS_SEMA_SYS_DATE 5
|
||||
#define SYS_SEMA_IN_DEBUGGER 6
|
||||
#define SYS_SEMA_SND 7
|
||||
#define SYS_SEMA_HEAPLOG_ACTIVE 8
|
||||
#define SYS_SEMA_HEAPLOG_LOCK 9
|
||||
#define SYS_SEMA_REFRESH_IN_PROGRESS 10
|
||||
#define SYS_SEMA_FLUSH_VGA_IMAGE 11
|
||||
#define SYS_SEMA_SINGLE_USER 12
|
||||
#define SYS_SEMA_DSK_CACHE 13
|
||||
#define SYS_SEMA_FAR_CALL32 14
|
||||
#define SYS_SEMA_DEV_MEM 15
|
||||
#define SYS_SEMA_VGA 16
|
||||
#define SYS_SEMA_UPDATE_WIN_Z_BUF 17
|
||||
#define SYS_SEMA_TNP 18
|
||||
#define SYS_SEMA_MUTE 19
|
||||
#define SYS_SEMA_FORCE_WINMGR 20
|
||||
#define SYS_SEMA_TMBEAT 21
|
||||
#define SYS_SEMA_FIX 22
|
||||
#define NUM_SYS_SEMAS 23
|
||||
#define SYS_SEMA_SYS_TIMER 3
|
||||
#define SYS_SEMA_SYS_DATE 4
|
||||
#define SYS_SEMA_IN_DEBUGGER 5
|
||||
#define SYS_SEMA_SND 6
|
||||
#define SYS_SEMA_HEAPLOG_ACTIVE 7
|
||||
#define SYS_SEMA_HEAPLOG_LOCK 8
|
||||
#define SYS_SEMA_REFRESH_IN_PROGRESS 9
|
||||
#define SYS_SEMA_FLUSH_VGA_IMAGE 10
|
||||
#define SYS_SEMA_SINGLE_USER 11
|
||||
#define SYS_SEMA_DSK_CACHE 12
|
||||
#define SYS_SEMA_FAR_CALL32 13
|
||||
#define SYS_SEMA_DEV_MEM 14
|
||||
#define SYS_SEMA_VGA 15
|
||||
#define SYS_SEMA_UPDATE_WIN_Z_BUF 16
|
||||
#define SYS_SEMA_TT 17
|
||||
#define SYS_SEMA_MUTE 18
|
||||
#define SYS_SEMA_FORCE_WINMGR 19
|
||||
#define SYS_SEMA_TMBEAT 20
|
||||
#define SYS_SEMA_FIX 21
|
||||
#define NUM_SYS_SEMAS 22
|
||||
|
||||
#define SYSf_CTRL_ALT_DEL 0
|
||||
#define SYSf_CTRL_ALT_C 1
|
||||
#define SYSf_CTRL_ALT_X 2
|
||||
#define SYSf_CTRL_ALT_TAB 3
|
||||
|
||||
//Extern calls
|
||||
//I'm the only one allowed to create these.
|
||||
//They work with $LK,"CallExtNum","MN:CallExtNum"$().
|
||||
//I guess you could reallocate
|
||||
//and extend $LK,"ext","MN:ext"$[] and copy it.
|
||||
//Asm callable function pointers.
|
||||
//They work with $LK,"CallExtNum","MN:CallExtNum"$() when calling from HolyC.
|
||||
#define EXT_WIN_TO_TOP 0
|
||||
#define EXT_WIN_FOCUS 1
|
||||
#define EXT_HEAPLOG_MALLOC 2
|
||||
#define EXT_HEAPLOG_FREE 3
|
||||
#define EXT_RESUME_DBG 4
|
||||
|
||||
#define EXT_TABLE_SIZE 5
|
||||
#define EXT_NUM_ENTRIES 5
|
||||
|
||||
//Hash table types
|
||||
//$LK,"ST_HTT_TYPES","FF:::/TempleOS/Kernel/Define1a.CPP,ST_HTT_TYPES"$
|
||||
@@ -683,14 +679,14 @@ class CSema
|
||||
#define HTt_FILE 13
|
||||
#define HTt_MODULE 14
|
||||
#define HTt_HELP_FILE 15
|
||||
#define HTt_NAMED_FRAME_PTR 16
|
||||
#define HTt_FRAME_PTR 16
|
||||
#define HTt_NUM_TYPES 17
|
||||
|
||||
#define HTf_PRIVATE 25
|
||||
#define HTf_PUBLIC 26
|
||||
#define HTf_EXPORT 27
|
||||
#define HTf_IMPORT 28
|
||||
#define HTf_LIT 29
|
||||
#define HTf_IMM 29
|
||||
#define HTf_UNRESOLVED 30
|
||||
#define HTf_LOCAL 31
|
||||
|
||||
@@ -711,17 +707,17 @@ class CSema
|
||||
#define HTT_FILE 0x2000 //CHashGeneric
|
||||
#define HTT_MODULE 0x4000 //CHashGeneric
|
||||
#define HTT_HELP_FILE 0x8000 //CHashSrcSym
|
||||
#define HTT_NAMED_FRAME_PTR 0x10000 //CHashGeneric
|
||||
#define HTT_TYPE_MASK 0x1FFFF
|
||||
#define HTT_FRAME_PTR 0x10000 //CHashGeneric
|
||||
#define HTG_TYPE_MASK 0x1FFFF
|
||||
|
||||
#define HTF_PRIVATE 0x02000000
|
||||
#define HTF_PUBLIC 0x04000000
|
||||
#define HTF_EXPORT 0x08000000
|
||||
#define HTF_IMPORT 0x10000000
|
||||
#define HTF_LIT 0x20000000
|
||||
#define HTF_IMM 0x20000000
|
||||
#define HTF_UNRESOLVED 0x40000000
|
||||
#define HTF_LOCAL 0x80000000
|
||||
#define HTF_FLAGS_MASK 0xFE000000
|
||||
#define HTG_FLAGS_MASK 0xFE000000
|
||||
|
||||
#define HTG_SRC_SYM (HTT_DEFINE_STR|HTT_GLBL_VAR|HTT_FUN|HTT_CLASS|HTT_EXPORT_SYS_SYM|HTT_HELP_FILE)
|
||||
#define HTG_ALL -1
|
||||
@@ -751,7 +747,7 @@ public class CHash
|
||||
//each time a node is found in a hash search.
|
||||
//One place it is used is to tell if a externed function was unused
|
||||
//before being defined. It is also used for popularity measures
|
||||
//in wordstat. You can do a $LK,"HashRep","MN:HashRep"$() to see
|
||||
//in wordstat. You can do a $LK,"Who","MN:Who"$() to see
|
||||
//roughly how many times a symbol has been
|
||||
//referenced. Beware of instances where
|
||||
//a hash entry is continuously searched for and
|
||||
@@ -821,11 +817,12 @@ public class CHashDefineStr:CHashSrcSym
|
||||
|
||||
//Member Lst Flags
|
||||
#define MLF_DFT_AVAILABLE 1
|
||||
#define MLF_STR_DFT_AVAILABLE 2
|
||||
#define MLF_FUN 4
|
||||
#define MLF_DOT_DOT_DOT 8
|
||||
#define MLF_NO_UNUSED_WARN 16
|
||||
#define MLF_STATIC 32
|
||||
#define MLF_LASTCLASS 2
|
||||
#define MLF_STR_DFT_AVAILABLE 4
|
||||
#define MLF_FUN 8
|
||||
#define MLF_DOT_DOT_DOT 16
|
||||
#define MLF_NO_UNUSED_WARN 32
|
||||
#define MLF_STATIC 64
|
||||
|
||||
public class CArrayDim
|
||||
{
|
||||
@@ -889,10 +886,11 @@ class CExternUsage
|
||||
//Function flags
|
||||
#define Ff_INTERNAL 8
|
||||
#define Ff_INTERRUPT 9
|
||||
#define Ff_DOT_DOT_DOT 10
|
||||
#define Ff_RET1 11
|
||||
#define Ff_ARGPOP 12
|
||||
#define Ff_NOARGPOP 13
|
||||
#define Ff_HASERRCODE 10
|
||||
#define Ff_DOT_DOT_DOT 11
|
||||
#define Ff_RET1 12
|
||||
#define Ff_ARGPOP 13
|
||||
#define Ff_NOARGPOP 14
|
||||
|
||||
public class CHashFun:CHashClass
|
||||
{ //See $LK,"PrsFunNew","MN:PrsFunNew"$().
|
||||
@@ -955,16 +953,13 @@ public class CHashGlblVar:CHashSrcSym
|
||||
|
||||
//Acct Registry sys_msg_flags
|
||||
#define ARf_FLOODFILL 0
|
||||
//obsolete
|
||||
#define ARf_CSPRITE_INS_CLIPBOARD 2
|
||||
//obsolete
|
||||
#define ARf_CSPRITE_PICK_GRAPHICALLY 4
|
||||
#define ARf_PLANAR_SYMMETRY 5
|
||||
#define ARf_MUSIC_ORGAN_JUKEBOX 6
|
||||
#define ARf_MESH_ED 7
|
||||
//obsolete
|
||||
#define ARf_CSPRITE_PTS_RECTANGLES 9
|
||||
#define ARf_MANAGE_SLIDER 10
|
||||
#define ARf_CSPRITE_INS_CLIPBOARD 1
|
||||
#define ARf_CSPRITE_PICK_GRAPHICALLY 2
|
||||
#define ARf_PLANAR_SYMMETRY 3
|
||||
#define ARf_MUSIC_ORGAN_JUKEBOX 4
|
||||
#define ARf_MESH_ED 5
|
||||
#define ARf_CSPRITE_PTS_RECTANGLES 6
|
||||
#define ARf_MANAGE_SLIDER 7
|
||||
|
||||
#define SVCf_WAKE_MASTER 0
|
||||
#define SVCf_FOCUS_MASTER 1
|
||||
@@ -1067,24 +1062,22 @@ class CBpt
|
||||
#define DOCT_MACRO 30
|
||||
#define DOCT_MENU_VAL 31
|
||||
#define DOCT_HEX_ED 32
|
||||
#define DOCT_HIDE_START 33
|
||||
#define DOCT_HIDE_END 34
|
||||
#define DOCT_TREE 35
|
||||
#define DOCT_SPRITE 36
|
||||
#define DOCT_INS_BINARY 37
|
||||
#define DOCT_INS_BINARY_TYPE 38
|
||||
#define DOCT_INS_BINARY_SIZE 39
|
||||
#define DOCT_BPT 40
|
||||
#define DOCT_SONG 41
|
||||
#define DOCT_HIGHLIGHT 42
|
||||
#define DOCT_LOCK_TO_PAGE 43
|
||||
#define DOCT_LOCK_TO_CENTER 44
|
||||
#define DOCT_HTML_IMG 45
|
||||
#define DOCT_HTML_VIDEO 46
|
||||
#define DOCT_HTML_CODE 47
|
||||
#define DOCT_ERROR 48
|
||||
#define DOCT_TREE 33
|
||||
#define DOCT_SPRITE 34
|
||||
#define DOCT_INS_BINARY 35
|
||||
#define DOCT_INS_BINARY_TYPE 36
|
||||
#define DOCT_INS_BINARY_SIZE 37
|
||||
#define DOCT_BPT 38
|
||||
#define DOCT_SONG 39
|
||||
#define DOCT_HIGHLIGHT 40
|
||||
#define DOCT_LOCK_TO_PAGE 41
|
||||
#define DOCT_LOCK_TO_CENTER 42
|
||||
#define DOCT_HTML_IMG 43
|
||||
#define DOCT_HTML_VIDEO 44
|
||||
#define DOCT_HTML_CODE 45
|
||||
#define DOCT_ERROR 46
|
||||
|
||||
#define DOCT_NUM_TYPES 49
|
||||
#define DOCT_NUM_TYPES 47
|
||||
|
||||
//CDocEntry.type flags upper bits
|
||||
#define DOCET_BLINK ATTRF_BLINK
|
||||
@@ -1278,7 +1271,6 @@ public class CDocBin
|
||||
#define DOC_COLOR_LINK RED
|
||||
#define DOC_COLOR_MACRO LTBLUE
|
||||
#define DOC_COLOR_ANCHOR DKGRAY
|
||||
#define DOC_COLOR_HIDDEN DKGRAY
|
||||
#define DOC_COLOR_TREE PURPLE
|
||||
#define DOC_COLOR_PMT GREEN
|
||||
#define DOC_COLOR_BIN CYAN
|
||||
@@ -1377,8 +1369,8 @@ class CEdFindText
|
||||
{
|
||||
U8 find_text[136] fmtstr "$$DA-P,135,\"Find :%s\"$$\n";
|
||||
U8 replace_text[136] fmtstr "$$DA-P,135,\"Replace :%s\"$$\n";
|
||||
Bool replace fmtstr "$$CB,\"Replace\"$$\n";
|
||||
Bool scan_fwd fmtstr "$$CB,\"Fwd\"$$\n";
|
||||
Bool replace fmtstr "$$CB,\"Replace\"$$\n";
|
||||
Bool scan_fwd fmtstr "$$CB,\"Fwd\"$$\n";
|
||||
Bool scan_selected_text fmtstr "$$CB,\"Selection\"$$\n";
|
||||
Bool match_case fmtstr "$$CB,\"Match Case\"$$\n";
|
||||
Bool whole_labels fmtstr "$$CB,\"Whole Labels\"$$\n";
|
||||
@@ -1425,7 +1417,8 @@ class CEdFileName
|
||||
#define DOCF_BREAK_UNLOCKED 0x80000
|
||||
#define DOCF_BORDER_DOC 0x100000
|
||||
#define DOCF_HIDE_CURSOR 0x200000 //use $LK,"DocCursor","MN:DocCursor"$
|
||||
//2 unused flags
|
||||
#define DOCF_CARRIAGE_RETURN 0x400000
|
||||
#define DOCF_NO_SCROLL_BARS 0x800000 //use $LK,"DocScroll","MN:DocScroll"$
|
||||
|
||||
#define DOCF_HIGHLIGHT DOCEF1_HIGHLIGHT
|
||||
#define DOCF_LOCK_TO_PAGE DOCEF1_LOCK_TO_PAGE
|
||||
@@ -1436,9 +1429,6 @@ class CEdFileName
|
||||
#define DOCF_SELECTED DOCEF1_SELECTED
|
||||
#define DOCF_UNDERLINE DOCEF1_UNDERLINE
|
||||
|
||||
#define DOCF_CARRIAGE_RETURN 0x100000000
|
||||
#define DOCF_NO_SCROLL_BARS 0x200000000 //use $LK,"DocScroll","MN:DocScroll"$
|
||||
|
||||
#define DOCf_OVERSTRIKE 0
|
||||
#define DOCf_PLAIN_TEXT 1
|
||||
#define DOCf_PLAIN_TEXT_WITH_TABS 2 //has '\t', not DOCT_TAB
|
||||
@@ -1461,7 +1451,8 @@ class CEdFileName
|
||||
#define DOCf_BREAK_UNLOCKED 19
|
||||
#define DOCf_BORDER_DOC 20
|
||||
#define DOCf_HIDE_CURSOR 21 //use $LK,"DocCursor","MN:DocCursor"$
|
||||
//2 unused flags
|
||||
#define DOCf_CARRIAGE_RETURN 22
|
||||
#define DOCf_NO_SCROLL_BARS 23
|
||||
|
||||
#define DOCf_HIGHLIGHT DOCEf1_HIGHLIGHT
|
||||
#define DOCf_LOCK_TO_PAGE DOCEf1_LOCK_TO_PAGE
|
||||
@@ -1472,8 +1463,6 @@ class CEdFileName
|
||||
#define DOCf_SELECTED DOCEf1_SELECTED
|
||||
#define DOCf_UNDERLINE DOCEf1_UNDERLINE
|
||||
|
||||
#define DOCf_CARRIAGE_RETURN 32
|
||||
#define DOCf_NO_SCROLL_BARS 33
|
||||
|
||||
//locked flags
|
||||
#define DOClf_LOCKED 0
|
||||
@@ -1487,6 +1476,7 @@ class CDocUndo
|
||||
};
|
||||
|
||||
//See $LK,"DocMenuDo","MN:DocMenuDo"$()
|
||||
#define DOCM_EXIT 0
|
||||
#define DOCM_CANCEL (-1)
|
||||
|
||||
#define DOC_SIGNATURE_VAL 'DocS'
|
||||
@@ -1510,9 +1500,8 @@ public class CDoc //Linked Text File header
|
||||
U8 *dollar_buf;
|
||||
CTask *win_task,*mem_task;
|
||||
CDocEntry *recalc_start;
|
||||
I32 page_line_num;
|
||||
I32 page_line_num,undo_cnt;
|
||||
I32 x,y,min_x,max_x,min_y,max_y;
|
||||
I32 undo_cnt;
|
||||
I64 line,col,best_d;
|
||||
I64 old_win_top,old_win_bottom,
|
||||
old_win_left,old_win_right;
|
||||
@@ -1576,7 +1565,7 @@ U0 pad;#assert !($$&7) //(compiler lags one token)
|
||||
#define OPTf_GLBLS_ON_DATA_HEAP 0x24
|
||||
//Disable 10-byte float consts for ã,log2_10,log10_2,loge_2
|
||||
#define OPTf_NO_BUILTIN_CONST 0x25 //Applied to funs, not statements
|
||||
#define OPTf_USE_LIT64 0x26 //Not completely implemented
|
||||
#define OPTf_USE_IMM64 0x26 //Not completely implemented
|
||||
|
||||
#define OPTF_ECHO (1<<OPTf_ECHO)
|
||||
#define OPTF_PARSE_TRACE (1<<OPTf_PARSE_TRACE)
|
||||
@@ -1639,7 +1628,7 @@ class CLexUndef
|
||||
#define ICF_DEL_PREVIOUS_INS 0x100000000
|
||||
#define ICF_PREVIOUS_DELETED 0x200000000
|
||||
#define ICF_DONT_RESTORE 0x400000000
|
||||
#define ICF_NO_CVT_MASK 0x7FFFFFF00
|
||||
#define ICG_NO_CVT_MASK 0x7FFFFFF00
|
||||
|
||||
#define IC_BODY_SIZE 48
|
||||
|
||||
@@ -1660,16 +1649,19 @@ class CICTreeLinks
|
||||
CHashClass *class2;
|
||||
};
|
||||
|
||||
class CIntermediateCode
|
||||
class CIntermediateCodeBase
|
||||
{
|
||||
CIntermediateCode *next,*last;
|
||||
U16 ic_opcode;
|
||||
U16 ic_precedence;
|
||||
I16 ic_cnt;
|
||||
I16 ic_last_cnt;
|
||||
};
|
||||
|
||||
class CIntermediateCode:CIntermediateCodeBase
|
||||
{
|
||||
I64 ic_flags;
|
||||
I64 ic_data;
|
||||
|
||||
|
||||
CHashClass *ic_class;
|
||||
CHashClass *ic_class2;
|
||||
@@ -1685,7 +1677,7 @@ class CIntermediateCode
|
||||
//points back to its two earlier addend instructions -- not MAlloced,
|
||||
//just pointers to previous CIntermediate codes in the array.
|
||||
|
||||
//Tree links get destroyed during Pass789A when they get overwrites
|
||||
//Tree links get destroyed during Pass789 when they get overwrites
|
||||
//by machine code. (Saves room to union the output machine code buffer
|
||||
//with these links, since they are not needed after pass4.
|
||||
|
||||
@@ -1703,30 +1695,23 @@ class CPrsStk
|
||||
I64 stk2[255];
|
||||
};
|
||||
|
||||
#define CB_IC_CNT 511
|
||||
class CCodeBlk
|
||||
#define CMT_LABEL 0
|
||||
#define CMT_GOTO_LABEL 1
|
||||
#define CMT_STR_CONST 2
|
||||
#define CMT_JMP_TABLE 3
|
||||
#define CMT_FLOAT_CONSTS 4
|
||||
#define CMT_ARRAY_DIM 5
|
||||
#define CMT_HASH_ENTRY 6
|
||||
|
||||
#define CMF_USED 1
|
||||
#define CMF_POP_CMP 2
|
||||
#define CMF_DEFINED 4
|
||||
|
||||
#define CM_MAX_CONSTS 16
|
||||
|
||||
class CLexCodeMisc
|
||||
{
|
||||
CCodeBlk *next;
|
||||
CIntermediateCode data[CB_IC_CNT];
|
||||
};
|
||||
|
||||
#define CBMT_LABEL 0
|
||||
#define CBMT_GOTO_LABEL 1
|
||||
#define CBMT_STR_CONST 2
|
||||
#define CBMT_JMP_TABLE 3
|
||||
#define CBMT_FLOAT_CONSTS 4
|
||||
#define CBMT_ARRAY_DIM 5
|
||||
#define CBMT_HASH_ENTRY 6
|
||||
|
||||
#define CBMF_USED 1
|
||||
#define CBMF_POP_CMP 2
|
||||
#define CBMF_DEFINED 4
|
||||
|
||||
#define CBM_MAX_CONSTS 16
|
||||
|
||||
class CCodeBlkMisc
|
||||
{
|
||||
CCodeBlkMisc *next,*fwd,*dft;
|
||||
CLexCodeMisc *next,*last,*fwd,*dft;
|
||||
U8 *str;
|
||||
U32 type,flags;
|
||||
U8 *addr;
|
||||
@@ -1796,7 +1781,7 @@ I64 class CAbsCntsI64
|
||||
class CAsmNum
|
||||
{
|
||||
I64 i;
|
||||
U8 *exp;
|
||||
U8 *ex;
|
||||
CLexUndef *undef_local,*undef_glbl;
|
||||
CAbsCntsI64 abs_cnts;
|
||||
};
|
||||
@@ -1804,7 +1789,8 @@ class CAsmNum
|
||||
class CAsmNum2
|
||||
{
|
||||
CAsmNum num;
|
||||
I64 U8_cnt,rel,lit;
|
||||
I64 U8_cnt,rel;
|
||||
Bool imm_flag;
|
||||
};
|
||||
|
||||
class CAsmIns
|
||||
@@ -1831,27 +1817,27 @@ class CAsmUnresolvedRef
|
||||
{
|
||||
CAsmUnresolvedRef *next;
|
||||
I64 type,line_num;
|
||||
U8 *exp;
|
||||
U8 *ex;
|
||||
I64 ip,rel_ip;
|
||||
U8 *str; //Only for import glbls
|
||||
CLexUndef *undef_hash;
|
||||
Bool U8_avail;
|
||||
Bool lit; //Only for import glbls
|
||||
Bool imm_flag; //Only for import glbls
|
||||
};
|
||||
|
||||
|
||||
#define EIE_END 0
|
||||
//reserved
|
||||
#define EIE_REL_EXPORT 2
|
||||
#define EIE_LIT_EXPORT 3
|
||||
#define EIE_IMM_EXPORT 3
|
||||
#define EIE_REL_U8 4
|
||||
#define EIE_LIT_U8 5
|
||||
#define EIE_IMM_U8 5
|
||||
#define EIE_REL_U16 6
|
||||
#define EIE_LIT_U16 7
|
||||
#define EIE_IMM_U16 7
|
||||
#define EIE_REL_U32 8
|
||||
#define EIE_LIT_U32 9
|
||||
#define EIE_IMM_U32 9
|
||||
#define EIE_REL_U64 10
|
||||
#define EIE_LIT_U64 11
|
||||
#define EIE_IMM_U64 11
|
||||
//reserved
|
||||
#define EIE_MAIN 16
|
||||
#define EIE_MODULE_ALIGNMENT 17
|
||||
@@ -1901,8 +1887,8 @@ class CExeHeapGlbl
|
||||
|
||||
class CExe
|
||||
{
|
||||
U8 *code;
|
||||
I64 code_U8s;
|
||||
U8 *ex;
|
||||
I64 ex_U8s;
|
||||
I64 max_align,module_org;
|
||||
CExe *parent_exe;
|
||||
CExeImportExport *next_ie,*last_ie;
|
||||
@@ -1997,7 +1983,7 @@ class CExe
|
||||
#define TK_IDENT 0x100
|
||||
#define TK_STR 0x101
|
||||
#define TK_INTEGER 0x102
|
||||
#define TK_U8 0x103 // character(s) in single quotes
|
||||
#define TK_CHAR_CONST 0x103
|
||||
#define TK_F64 0x104
|
||||
#define TK_PLUS_PLUS 0x105
|
||||
#define TK_MINUS_MINUS 0x106
|
||||
@@ -2048,7 +2034,7 @@ class CExe
|
||||
#define LF_KEEP_NUM_SIGN 128
|
||||
#define LF_KEEP_AT_SIGN 256
|
||||
#define Lf_OPT_TRACE_PRESENT 9
|
||||
#define LF_NOT_CONSTANT 0x0000010000
|
||||
#define LF_NOT_CONST 0x0000010000
|
||||
#define LF_NO_REG_OPT 0x0000020000
|
||||
#define LF_IN_QUOTES 0x0000040000
|
||||
#define LF_EXE_BLK 0x0000080000
|
||||
@@ -2082,8 +2068,8 @@ class CAsmCtrl
|
||||
{
|
||||
I64 ip; //instruction ptr
|
||||
CAsmArg arg1,arg2;
|
||||
CAsmCodeBlk *code;
|
||||
I64 num_code_U8s;
|
||||
CAsmCodeBlk *cb;
|
||||
I64 num_ex_U8s;
|
||||
I64 max_align,module_org;
|
||||
CAsmUnresolvedRef *local_unresolved,*glbl_unresolved;
|
||||
CExeAbsAddr *abss;
|
||||
@@ -2101,18 +2087,11 @@ class CStreamBlk
|
||||
U8 *body;
|
||||
};
|
||||
|
||||
class CLexCodeBlkCtrl
|
||||
class CLexCodeCtrl
|
||||
{
|
||||
CLexCodeBlkCtrl *cb_next;
|
||||
CCodeBlk *cb_out_first;
|
||||
CCodeBlk *cb_out_last;
|
||||
CIntermediateCode *cb_out_end;
|
||||
CIntermediateCode *cb_out_ptr;
|
||||
CIntermediateCode *cb_last_out_ptr;
|
||||
CCodeBlk *cb_in_first;
|
||||
CIntermediateCode *cb_in_end;
|
||||
CIntermediateCode *cb_in_ptr;
|
||||
CCodeBlkMisc *cb_misc_lst,*cb_misc_lst_end;
|
||||
CLexCodeCtrl *lcc_next;
|
||||
CLexCodeMisc *lcc_next_misc,*lcc_last_misc;
|
||||
CIntermediateCodeBase lcc_root;
|
||||
};
|
||||
|
||||
#define NUM_REGS 16
|
||||
@@ -2153,7 +2132,7 @@ public class CLex
|
||||
CAbsCntsI64 abs_cnts;
|
||||
CLexUndef *undef_hash_entry;
|
||||
CMemberLst *local_var_entry;
|
||||
CCodeBlkMisc *lb_leave;
|
||||
CLexCodeMisc *lb_leave;
|
||||
U8 *cur_buf_ptr;
|
||||
CLexFile *cur_lfn,*fun_lfn;
|
||||
I64 stk_ptr;
|
||||
@@ -2171,7 +2150,7 @@ public class CLex
|
||||
Bool last_dont_pushable,last_dont_popable,last_float_op_pos,
|
||||
dont_push_float,pad[4];
|
||||
|
||||
CLexCodeBlkCtrl cbh;
|
||||
CLexCodeCtrl lcc;
|
||||
CAsmCtrl *a;
|
||||
I64 a_depth;
|
||||
|
||||
@@ -2191,12 +2170,13 @@ class CPCIDev
|
||||
U8 *vendor_str,*dev_id_str;
|
||||
};
|
||||
|
||||
#define TEMPLEOS_XSUM 0xA5CF3796
|
||||
#define FILENAME_MASK_JIT "*.CPP*;*.HPP*"
|
||||
#define FILENAME_MASK_AOT "*.CPP*;*.HPP*;*.PRJ*"
|
||||
#define FILENAME_MASK_SRC "*.CPP*;*.HPP*;*.AUT*;*.PRJ*"
|
||||
#define FILENAME_MASK_TXT FILENAME_MASK_SRC ";*.TXT*;*.LOG*"
|
||||
#define FILENAME_MASK_GRA "*.GRA*;*.BMP*"
|
||||
#define TEMPLEOS_XSUM 0xA5CF3796
|
||||
|
||||
#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*"
|
||||
|
||||
public class CMBRPrt
|
||||
{
|
||||
@@ -2306,6 +2286,7 @@ class CFAT32DirEntryLong
|
||||
};
|
||||
|
||||
#define FAT32_ENTRIES_PER_BLK (BLK_SIZE/sizeof(CFAT32DirEntry))
|
||||
#define FAT32_ENTRIES_BITS Bsf(FAT32_ENTRIES_PER_BLK)
|
||||
|
||||
public class CPalindromeU16
|
||||
{
|
||||
@@ -2441,7 +2422,7 @@ public class CDateStruct
|
||||
#define DEF_REMOVABLE 2
|
||||
#define DEF_NOT_INITIALIZED 4
|
||||
|
||||
#define CDIR_FILENAME_LEN 26
|
||||
#define CDIR_FILENAME_LEN 38 //Must have terminator
|
||||
public class CDirEntry
|
||||
{
|
||||
CDirEntry *next,*parent,*sub;
|
||||
@@ -2452,10 +2433,8 @@ public class CDirEntry
|
||||
U0 start;
|
||||
U16 attr;
|
||||
U8 name[CDIR_FILENAME_LEN];
|
||||
U32 xsum;
|
||||
I64 cluster;
|
||||
I64 size;
|
||||
I64 expanded_size;
|
||||
CDate datetime;
|
||||
};
|
||||
|
||||
@@ -2501,7 +2480,6 @@ public class CBlkDev
|
||||
U32 bd_signature;
|
||||
U8 first_drv_let,unit,pad[2];
|
||||
U32 base0,base1;
|
||||
U16 read_freq,write_freq;
|
||||
U32 blk_size;
|
||||
I64 offset,min_blk,max_blk;
|
||||
U16 *dev_id_record;
|
||||
@@ -2607,8 +2585,8 @@ public class CCacheBlk
|
||||
#define EXCEPT_PRT 10
|
||||
#define EXCEPT_BLKDEV 11
|
||||
#define EXCEPT_GRAPHICS 12
|
||||
#define EXCEPT_SPRINTF 13
|
||||
#define EXCEPT_GETF 14
|
||||
#define EXCEPT_SPRINT 13
|
||||
#define EXCEPT_SCAN 14
|
||||
#define EXCEPT_BIN_MODULE 15
|
||||
#define EXCEPT_MULTICORE 16
|
||||
#define EXCEPT_FUF 17
|
||||
@@ -3329,7 +3307,7 @@ class CTSS
|
||||
#define DCF_RECORD_EXTENTS 0x10000
|
||||
#define DCF_ON_TOP 0x20000
|
||||
|
||||
#define DCT_COLOR4 1
|
||||
#define DCT_COLOR4 1 //Don't use this
|
||||
#define DCT_COLOR8 3
|
||||
|
||||
#define DCS_SIGNATURE_VAL 'DvCS'
|
||||
@@ -3503,15 +3481,15 @@ public class CArcCompress
|
||||
#define SUF_SAFE_DOLLAR 0x400
|
||||
#define SUF_SCALE_INDENT 0x800
|
||||
|
||||
// Flags for SearchStr
|
||||
#define SRF_IGNORE_CASE 1
|
||||
#define SRF_WHOLE_LABELS_FRONT 2
|
||||
#define SRF_WHOLE_LABELS_BACK 4
|
||||
#define SRG_WHOLE_LABELS (SRF_WHOLE_LABELS_FRONT|SRF_WHOLE_LABELS_BACK)
|
||||
// Flags for StrFind
|
||||
#define SFF_IGNORE_CASE 1
|
||||
#define SFF_WHOLE_LABELS_FRONT 2
|
||||
#define SFF_WHOLE_LABELS_BACK 4
|
||||
#define SFG_WHOLE_LABELS (SFF_WHOLE_LABELS_FRONT|SFF_WHOLE_LABELS_BACK)
|
||||
|
||||
//Flags for LstEntryMatch
|
||||
#define LEF_IGNORE_CASE 1
|
||||
#define LEF_EXACT 2
|
||||
//Flags for LstMatch
|
||||
#define LMF_IGNORE_CASE 1
|
||||
#define LMF_EXACT 2
|
||||
|
||||
#define ISO1_ATTR_DIR 2
|
||||
|
||||
@@ -3566,11 +3544,11 @@ public class CFile
|
||||
#define FUf_MAP 7
|
||||
#define FUf_JUST_DIRS 8
|
||||
#define FUf_JUST_FILES 9
|
||||
#define FUf_JUST_TXT_FILES 10
|
||||
#define FUf_JUST_SRC_FILES 11
|
||||
#define FUf_JUST_AOT_FILES 12
|
||||
#define FUf_JUST_JIT_FILES 13
|
||||
#define FUf_JUST_GRA_FILES 14
|
||||
#define FUf_JUST_TXT 10
|
||||
#define FUf_JUST_SRC 11
|
||||
#define FUf_JUST_AOT 12
|
||||
#define FUf_JUST_JIT 13
|
||||
#define FUf_JUST_GRA 14
|
||||
#define FUf_Z_OR_NOT_Z 15
|
||||
#define FUf_SCAN_PARENTS 16
|
||||
#define FUf_FLATTEN_TREE 17
|
||||
@@ -3588,11 +3566,11 @@ public class CFile
|
||||
#define FUF_MAP 0x000080 //m
|
||||
#define FUF_JUST_DIRS 0x000100 //D
|
||||
#define FUF_JUST_FILES 0x000200 //F
|
||||
#define FUF_JUST_TXT_FILES 0x000400 //T
|
||||
#define FUF_JUST_SRC_FILES 0x000800 //S
|
||||
#define FUF_JUST_AOT_FILES 0x001000 //A
|
||||
#define FUF_JUST_JIT_FILES 0x002000 //J
|
||||
#define FUF_JUST_GRA_FILES 0x004000 //G
|
||||
#define FUF_JUST_TXT 0x000400 //T
|
||||
#define FUF_JUST_SRC 0x000800 //S
|
||||
#define FUF_JUST_AOT 0x001000 //A
|
||||
#define FUF_JUST_JIT 0x002000 //J
|
||||
#define FUF_JUST_GRA 0x004000 //G
|
||||
#define FUF_Z_OR_NOT_Z 0x008000 //Z
|
||||
#define FUF_SCAN_PARENTS 0x010000 //P
|
||||
#define FUF_FLATTEN_TREE 0x020000 //f
|
||||
@@ -3600,9 +3578,8 @@ public class CFile
|
||||
#define FUF_WHOLE_LABELS_FRONT 0x080000 //lf
|
||||
#define FUF_WHOLE_LABELS_BACK 0x100000 //lb
|
||||
|
||||
#define FUG_FILES_FIND (FUF_RECURSE|FUF_JUST_DIRS|FUF_JUST_FILES|\
|
||||
FUF_JUST_TXT_FILES|FUF_JUST_SRC_FILES|\
|
||||
FUF_JUST_AOT_FILES|FUF_JUST_JIT_FILES|FUF_JUST_GRA_FILES|FUF_FLATTEN_TREE)
|
||||
#define FUG_FILES_FIND (FUF_RECURSE|FUF_JUST_DIRS|FUF_JUST_FILES|FUF_JUST_TXT|\
|
||||
FUF_JUST_SRC|FUF_JUST_AOT|FUF_JUST_JIT|FUF_JUST_GRA|FUF_FLATTEN_TREE)
|
||||
#define FUG_FILE_FIND (FUF_JUST_DIRS|FUF_JUST_FILES|FUF_Z_OR_NOT_Z|FUF_SCAN_PARENTS)
|
||||
|
||||
#define CPU_WALLPAPER_DATA_SIZE 128
|
||||
@@ -3702,11 +3679,11 @@ class CSndData
|
||||
F64 time_stamp;
|
||||
};
|
||||
|
||||
//sys_raw_dc_flags flags
|
||||
#define RDCF_IN_DOLLAR 1
|
||||
#define RDCF_LAST_DOLLAR 2
|
||||
#define RDCF_SHOW_DOLLAR 4
|
||||
#define RDCF_SCROLL 8
|
||||
//sys_raw_flags flags
|
||||
#define RWF_IN_DOLLAR 1
|
||||
#define RWF_LAST_DOLLAR 2
|
||||
#define RWF_SHOW_DOLLAR 4
|
||||
#define RWF_SCROLL 8
|
||||
|
||||
//Input ptr types
|
||||
#define IP_NULL 0
|
||||
|
||||
+11
-11
@@ -3,7 +3,7 @@ In this file, syms defined Kernel assembly
|
||||
files are given C+ definitions. This file
|
||||
is included when you compile the kernel, after
|
||||
the assembly files have been assembled, making
|
||||
the Holy C definitions available for the Holy C Kernel
|
||||
the HolyC definitions available for the HolyC Kernel
|
||||
files. It is also included as part of booting.
|
||||
|
||||
The assembly global labels are stored as HTT_EXPORT_SYS_SYM
|
||||
@@ -118,8 +118,8 @@ public _extern _MEMSET_U32 U32 *MemSetU32(U32 *dst,I64 val,I64 U32cnt);
|
||||
public _extern _MEMSET_U64 U64 *MemSetU64(U64 *dst,I64 val,I64 U64cnt);
|
||||
public _extern SYS_CODE_BP CBlkPool *sys_code_bp;
|
||||
public _extern SYS_DATA_BP CBlkPool *sys_data_bp;
|
||||
public _extern SYS_HEAP_BASE U32 sys_heap_base;
|
||||
public _extern SYS_HEAP_LIMIT U32 sys_heap_limit;
|
||||
public _extern SYS_HEAP_BASE U8 *sys_heap_base;
|
||||
public _extern SYS_HEAP_LIMIT U8 *sys_heap_limit;
|
||||
|
||||
_extern SYS_HEAP_INIT_FLAG U8 sys_heap_init_flag;
|
||||
_extern SYS_HEAP_INIT_VAL U8 sys_heap_init_val;
|
||||
@@ -153,13 +153,13 @@ public _intern IC_POP I64 Pop();
|
||||
public _intern IC_PUSH U0 Push(I64 d);
|
||||
public _intern IC_CLD U0 Cld();
|
||||
public _intern IC_STD U0 Std();
|
||||
public _intern IC_GET_FLAGS I64 GetFlags();
|
||||
public _intern IC_GET_RFLAGS I64 GetRFlags();
|
||||
public _intern IC_CARRY I64 Carry();
|
||||
public _intern IC_SET_FLAGS U0 SetFlags(I64 d);
|
||||
public _intern IC_GET_STK_PTR U8 *GetStkPtr();
|
||||
public _intern IC_SET_STK_PTR U0 SetStkPtr(U8 *d);
|
||||
public _intern IC_GET_BASE_PTR U8 *GetBasePtr();
|
||||
public _intern IC_SET_BASE_PTR U0 SetBasePtr(U8 *d);
|
||||
public _intern IC_SET_RFLAGS U0 SetRFlags(I64 d);
|
||||
public _intern IC_GET_RSP U8 *GetRSP();
|
||||
public _intern IC_SET_RSP U0 SetRSP(U8 *d);
|
||||
public _intern IC_GET_RBP U8 *GetRBP();
|
||||
public _intern IC_SET_RBP U0 SetRBP(U8 *d);
|
||||
public _extern SYS_CACHE_LINE_WIDTH I64 sys_cache_line_width;
|
||||
_extern SYS_GDTTAB U8 sys_gdttab[GDT_SIZE];
|
||||
public _extern _XCHG_U64 U64 XchgU64(U64 *dst,U64 d);
|
||||
@@ -196,7 +196,7 @@ _extern SYS_SEMAS CSema sys_semas[NUM_SYS_SEMAS];
|
||||
public _intern IC_GS CCPU *Gs();
|
||||
|
||||
#help_index "Time/CPU Cycles"
|
||||
public _intern IC_RDTSC I64 GetTimeStamp();
|
||||
public _intern IC_RDTSC I64 GetTSC(); //Time Stamp Counter
|
||||
|
||||
#help_index "Time/HPET"
|
||||
public _intern IC_HPET I64 HPET();
|
||||
@@ -290,7 +290,7 @@ public _extern _CALL I64 Call(U8 *s);
|
||||
public _extern _CALLIND I64 CallInd(/*argpop*/I64 (*fp_add)(...),...);
|
||||
|
||||
//This is just an array of ptrs to funs.
|
||||
//See $LK,"Extern Num Definitions","MN:EXT_TABLE_SIZE"$
|
||||
//See $LK,"Extern Num Definitions","MN:EXT_NUM_ENTRIES"$
|
||||
public _extern SYS_EXTERN_TABLE /*argpop*/ I64 (**ext)(...);
|
||||
//Can have any fixed number of arguments.
|
||||
public _extern _CALLEXTNUM I64 CallExtNum(I64 num,...);
|
||||
|
||||
+68
-73
@@ -12,7 +12,6 @@ public extern U0 TSSBusy(I64 tr,Bool val=OFF);
|
||||
_extern SYS_CONTEXT_RESTORE U0 TaskContextRestore();
|
||||
_extern SYS_TASK_END_NOW U0 TaskEndNow();
|
||||
|
||||
|
||||
#help_index "Time/CPU Cycles"
|
||||
#help_file "::/TempleOS/Doc/TimeCycles"
|
||||
public extern I64 time_stamp_freq,time_stamp_kHz_freq;
|
||||
@@ -37,7 +36,6 @@ public extern Bool Mute(Bool val);
|
||||
public extern Bool IsMute();
|
||||
public extern F64 snd_freq;
|
||||
public extern U0 Beep(I64 freq=500,Bool busy=FALSE);
|
||||
public extern Bool IOSnd(Bool val);
|
||||
public extern Bool snd_record;
|
||||
extern CSndData snd_record_root;
|
||||
|
||||
@@ -99,17 +97,18 @@ public extern Bool BptR(U8 *add,CTask *task=NULL,Bool live=TRUE,Bool rem=TRUE);
|
||||
public extern Bool B(U8 *add,CTask *task=NULL,Bool live=TRUE) //Toggle breakpoint
|
||||
public extern I64 B2(CTask *task=NULL,Bool live=TRUE);
|
||||
#help_index "Debugging/Raw Output"
|
||||
public extern Bool Raw(Bool val);
|
||||
public extern Bool IsRaw();
|
||||
extern U0 RawDr(CTask *task=NULL);
|
||||
public extern U0 RawPutChar(I64 ch);
|
||||
public extern U0 VGAFlush();
|
||||
public extern Bool Raw(Bool val);
|
||||
public extern Bool IsRaw();
|
||||
public extern U0 DbgStr(U8 *st,I64 mS=100);
|
||||
public extern U0 DbgI64(I64 num,I64 mS=100);
|
||||
public extern U0 DbgF64(F64 d,I64 mS=100);
|
||||
public extern U0 DbgAdd(U8 *add,I64 mS=100);
|
||||
public extern U0 DbgD(U8 *add,I64 cnt=0x80,I64 mS=100);
|
||||
public extern U0 DbgDm(U8 *add,I64 cnt=0x80,I64 mS=100);
|
||||
public extern U0 RawStr(U8 *st,I64 mS=100);
|
||||
public extern U0 RawI64(I64 num,I64 mS=100);
|
||||
public extern U0 RawF64(F64 d,I64 mS=100);
|
||||
public extern U0 RawAdd(U8 *add,I64 mS=100);
|
||||
public extern U0 RawPrint(I64 mS=100,U8 *fmt,...);
|
||||
public extern U0 RawD(U8 *add,I64 cnt=0x80,I64 mS=100);
|
||||
public extern U0 RawDm(U8 *add,I64 cnt=0x80,I64 mS=100);
|
||||
|
||||
#help_index "Graphics/Color"
|
||||
extern U0 (*fp_set_std_palette)();
|
||||
@@ -124,11 +123,11 @@ extern I64 **ctrl_alt_let_ret_addr; //addr of ret add on stack in kbd irq
|
||||
extern CSrvCmd sys_macro_root;
|
||||
extern CKeyDev sys_put_key_root;
|
||||
extern CTask *sys_macro_util_task;
|
||||
extern I64 sys_raw_dc_col,sys_raw_dc_flags;
|
||||
extern U8 *sys_dc_screen_image;
|
||||
extern I64 sys_raw_col,sys_raw_flags;
|
||||
extern U8 *sys_raw_screen_image;
|
||||
public extern Bool text_mode;
|
||||
|
||||
//Constants are defined for these to
|
||||
//Consts are defined for these to
|
||||
//optimize. See $LK-A,"::/TempleOS/Adam/Gr/GrCfg.CPP"$.
|
||||
public extern I64 text_rows,text_cols,gr_width,gr_height;
|
||||
public extern U8 *gr_font;
|
||||
@@ -144,16 +143,16 @@ extern U8 *key_handler;
|
||||
public extern U0 PutDefineErr(U8 *st);
|
||||
public extern U0 PutDefineWarn(U8 *st);
|
||||
#help_index "Char/Output"
|
||||
public extern U0 PrintF(U8 *fmt,...);
|
||||
public extern U0 PrintFErr(U8 *fmt,...);
|
||||
public extern U0 PrintFWarn(U8 *fmt,...);
|
||||
public extern U0 Print(U8 *fmt,...);
|
||||
public extern U0 PrintErr(U8 *fmt,...);
|
||||
public extern U0 PrintWarn(U8 *fmt,...);
|
||||
public extern U0 NewLine(I64 cnt=1);
|
||||
public extern U0 Spaces(I64 cnt=1);
|
||||
public extern U0 PutErr(U8 *st=NULL);
|
||||
public extern U0 PutWarn(U8 *st=NULL);
|
||||
public extern U0 PutKey(I64 ch,I64 scancode);
|
||||
public extern U0 PutChar(U64 ch);
|
||||
public extern U0 PutS(U8 *st);
|
||||
extern U0 PutS(U8 *st); //Use $LK,"Print","MN:Print"$()
|
||||
public extern U8 *Bin2Hex(U8 *dst,I64 n;I64 width);
|
||||
public extern U0 PutHex(I64 n,I64 width);
|
||||
public extern Bool Silent(Bool val);
|
||||
@@ -167,7 +166,7 @@ extern I64 mouse_pkt_size;
|
||||
#help_index "Char/Input"
|
||||
public extern I64 kbd_evt_time;
|
||||
extern Bool kbd_irqs_working;
|
||||
public extern Bool PressAKey();
|
||||
public extern I64 PressAKey();
|
||||
public extern Bool AreYouSure();
|
||||
public extern I64 GetKey(I64 *_scancode=NULL,Bool echo=FALSE,Bool raw_cursor=FALSE);
|
||||
public extern I64 GetChar(I64 *_scancode=NULL,Bool echo=TRUE,Bool raw_cursor=FALSE);
|
||||
@@ -179,12 +178,12 @@ public extern I64 KbdMouseEvtTime();
|
||||
//Gets $LK,"Flags","MN:GETSF_SHIFT_ESC_EXIT"$
|
||||
public extern U8 *MGetS(I64 flags=0);
|
||||
extern U8 *(*fp_mgets)(I64 flags=0);
|
||||
extern U8 *GetFJoin(U8 *src,U8 *fmt,I64 argc,I64 *argv);
|
||||
public extern U8 *GetF(U8 *src,U8 *fmt,...);
|
||||
public extern U8 *ScanJoin(U8 *src,U8 *fmt,I64 argc,I64 *argv);
|
||||
public extern U8 *Scan(U8 *src,U8 *fmt,...);
|
||||
|
||||
#help_index "Char/Lists"
|
||||
public extern U8 *LstEntryPt(I64 entry_num, U8 *lst);
|
||||
public extern I64 LstEntryMatch(U8 *src, U8 *lst,I64 flags=0,I64 *_ambiguity_overkill=NULL);
|
||||
public extern U8 *LstSub(I64 sub, U8 *lst);
|
||||
public extern I64 LstMatch(U8 *pattern, U8 *lst,I64 flags=0);
|
||||
|
||||
#help_index "Char/Operations"
|
||||
public extern I64 StrOcc(U8 *src, U8 ch);
|
||||
@@ -197,24 +196,24 @@ public extern U8 *StrUtil(U8 *_src,I64 flags);
|
||||
public extern U8 *MStrUtil(U8 *src,I64 flags,F64 indent_scale_factor=0);
|
||||
public extern U8 *StrFirstRem(U8 *src,U8 *marker,U8 *dst=NULL);
|
||||
public extern U8 *StrLastRem(U8 *src,U8 *marker,U8 *dst=NULL);
|
||||
public extern Bool WildCardMatch(U8 *wild_st,U8 *src_st);
|
||||
public extern Bool WildMatch(U8 *pattern,U8 *wild);
|
||||
public extern U8 *StrAdd(U8 *base,U8 *addition); //frees base arg
|
||||
public extern U8 *SearchStr(U8 *src,U8 *pattern,I64 flags=0);
|
||||
extern U8 *SPrintFJoin(U8 *dst,U8 *fmt,I64 argc,I64 *argv);
|
||||
public extern U8 *SPrintF(U8 *dst,U8 *fmt,...);
|
||||
public extern U8 *MSPrintF(U8 *fmt,...);
|
||||
public extern U8 *StrFind(U8 *pattern,U8 *src,I64 flags=0);
|
||||
public extern U8 *SPrintJoin(U8 *dst,U8 *fmt,I64 argc,I64 *argv);
|
||||
public extern U8 *SPrint(U8 *dst,U8 *fmt,...);
|
||||
public extern U8 *MPrint(U8 *fmt,...);
|
||||
|
||||
#help_index "Char/Define"
|
||||
#help_file "::/TempleOS/Doc/Define"
|
||||
public extern CHashDefineStr *DefineLoad(U8 *name,U8 *st,Bool replace=FALSE);
|
||||
public extern U0 DefinePrintF(U8 *name,U8 *src,...);
|
||||
public extern U0 DefinePrint(U8 *name,U8 *src,...);
|
||||
public extern U8 *Define(U8 *name);
|
||||
public extern U0 PutDefine(U8 *name);
|
||||
#help_index "Char/Define;Char/Lists"
|
||||
public extern CHashDefineStr *DefineLstLoad(U8 *name,U8 *st,Bool replace=FALSE);
|
||||
public extern U8 *DefineSub(I64 sub,U8 *name);
|
||||
public extern I64 DefineSubCnt(U8 *name);
|
||||
public extern I64 DefineMatch(U8 *src,U8 *lst_name,I64 flags=0,I64 *_ambiguity_overkill=NULL);
|
||||
public extern I64 DefineMatch(U8 *pattern,U8 *lst_name,I64 flags=0);
|
||||
|
||||
#help_index "Memory"
|
||||
#help_file "::/TempleOS/Doc/Mem"
|
||||
@@ -280,10 +279,9 @@ extern U0 TaskFinishOff(CTask *task);
|
||||
public extern U0 OverRideSingleUserSwap();
|
||||
#help_index "Task;MultiCore"
|
||||
public extern CTask *Spawn(U0 (*fp_add)(U8 *data),U8 *data=NULL,
|
||||
U8 *task_name=NULL,
|
||||
I64 target_cpu=-1, //-1 means current CPU
|
||||
CTask *parent=NULL, //NULL means adam
|
||||
I64 stk_size=0,I64 flags=1<<SVCf_ADD_TO_QUE);
|
||||
U8 *task_name=NULL,I64 target_cpu=-1, //-1 means current CPU
|
||||
CTask *parent=NULL, //NULL means adam
|
||||
I64 stk_size=0,I64 flags=1<<SVCf_ADD_TO_QUE);
|
||||
|
||||
#help_index "Task/Requests"
|
||||
public extern U0 SrvCmdDel(CSrvCmd *tempc);
|
||||
@@ -298,9 +296,9 @@ public extern U0 AdamLogExcept(I64 argc,I64 *argv);
|
||||
public extern U0 AdamLog(U8 *fmt,...);
|
||||
public extern U0 AdamErr(U8 *fmt,...);
|
||||
#help_index "Task/Text Input"
|
||||
public extern CSrvCmd *
|
||||
TaskTextInputQue(CTask *srv,CTask *master,
|
||||
U8 *data,I64 flags);
|
||||
public extern CSrvCmd *TaskTextInputQue(CTask *srv,CTask *master,
|
||||
U8 *data,I64 flags);
|
||||
|
||||
#help_index "Task/Text Input;Messages"
|
||||
public extern CSrvCmd *TaskMsgQue(CTask *srv,CTask *master,
|
||||
I64 msg_code,I64 p1,I64 p2,I64 flags);
|
||||
@@ -329,8 +327,7 @@ public extern U0 ArcExpandBuf(CArcCtrl *c);
|
||||
public extern CArcCtrl *ArcCtrlNew(Bool expand,Bool text_only);
|
||||
public extern U0 ArcCtrlDel(CArcCtrl *c);
|
||||
#help_index "Compression"
|
||||
public extern CArcCompress *
|
||||
CompressBuf(U8 *src,I64 size,I64 flags=0,CTask *mem_task=NULL);
|
||||
public extern CArcCompress *CompressBuf(U8 *src,I64 size,I64 flags=0,CTask *mem_task=NULL);
|
||||
public extern U8 *ExpandBuf(CArcCompress *r,CTask *mem_task=NULL);
|
||||
//This is just an XOR checksum.
|
||||
extern I64 ArcXSum(U32 *buf,I64 size);
|
||||
@@ -400,7 +397,7 @@ public extern I64 LastDayOfMon(I64 i);
|
||||
public extern I64 FirstDayOfYear(I64 i);
|
||||
public extern I64 LastDayOfYear(I64 i);
|
||||
public extern I64 DayOfWeek(I64 i);
|
||||
public extern CDate GetCurTimeDate();
|
||||
public extern CDate GetDateTime();
|
||||
public extern U0 Date2ISO1(CISO1Date *dst,CDate cdt);
|
||||
public extern U8 *date_fmt_map,*time_fmt_map;
|
||||
public extern U0 DateTimeFmtMapsRst();
|
||||
@@ -466,7 +463,7 @@ public extern I64 RClustersBlks(CPrt *p,U8 *buf,I64 c,I64 blks);
|
||||
public extern I64 RClusters(CPrt *p,U8 *buf,I64 c,I64 cnt);
|
||||
public extern I64 WClustersBlks(CPrt *p,U8 *buf,I64 c,I64 blks);
|
||||
public extern I64 WClusters(CPrt *p,U8 *buf,I64 c,I64 cnt);
|
||||
public extern I64 ClusersAlloc(CPrt *p,I64 c=0,I64 cnt=1,Bool contiguous=FALSE);
|
||||
public extern I64 ClustersAlloc(CPrt *p,I64 c=0,I64 cnt=1,Bool contiguous=FALSE);
|
||||
public extern Bool RBlks(CPrt *p,U8 *buf, I64 blk, I64 cnt);
|
||||
public extern Bool WBlks(CPrt *p,U8 *buf, I64 blk, I64 cnt);
|
||||
public extern U0 WZeroBlks(CPrt *p,I64 blk,I64 cnt);
|
||||
@@ -494,7 +491,7 @@ public extern U8 *sys_dft_iso_name;
|
||||
|
||||
#help_index "File/FileNames"
|
||||
public extern U8 *sys_acct;
|
||||
public extern Bool FilesFindMatch(U8 *files_find_mask,U8 *filename,I64 fuf_flags=0);
|
||||
public extern Bool FilesFindMatch(U8 *pattern,U8 *files_find_mask,I64 fuf_flags=0);
|
||||
public extern Bool IsDotZ(U8 *filename);
|
||||
public extern Bool IsDotC(U8 *filename);
|
||||
public extern U8 *FileExtDot(U8 *src);
|
||||
@@ -511,30 +508,30 @@ public extern U8 *ChgExt(U8 *filename,U8 *extension);
|
||||
public extern U8 *DftExt(U8 *filename,U8 *extension);
|
||||
public extern Bool IsDir(U8 *dir_name);
|
||||
public extern Bool IsDrvWritable(U8 drv_let=0);
|
||||
extern CDirEntry *Cd2DirEntry(CDirEntry *tempm,U8 *abs_name);
|
||||
extern CDirEntry *Cd2DirEntry(CDirEntry *tempde,U8 *abs_name);
|
||||
public extern U0 ToFileLine(U8 *_fl_file_line,U8 **_filename,I64 *_linenum);
|
||||
|
||||
#help_index "File/Program Routines/Utils"
|
||||
public extern U0 GetFFlags(U8 *f,U8 *lst,U8 *st);
|
||||
public extern U8 *SPrintFFlags(U8 *dst,U8 *lst,I64 flags);
|
||||
public extern U0 ScanFlags(U8 *f,U8 *lst,U8 *st);
|
||||
public extern U8 *SPrintFlags(U8 *dst,U8 *lst,I64 flags);
|
||||
public extern U0 FileAccessDel(CFileAccess *fa);
|
||||
public extern CFileAccess *FileAccessNew(U8 *mask,Bool make_mask=FALSE,Bool make_dirs=FALSE);
|
||||
extern I64 FileAttr(U8 *name,I64 old_attr=0);
|
||||
public extern U0 CDirEntryDel(CDirEntry *tempm);
|
||||
public extern U0 CDirEntryDel2(CDirEntry *tempm);
|
||||
public extern U0 CDirLstDel(CDirEntry *tempm);
|
||||
public extern U0 CDirLstDel2(CDirEntry *tempm);
|
||||
public extern Bool CDirNew(CPrt *p,U8 *cur_dir,CDirEntry *tempm,Bool free_old_chain=TRUE);
|
||||
public extern U0 DirEntryDel(CDirEntry *tempde);
|
||||
public extern U0 DirEntryDel2(CDirEntry *tempde);
|
||||
public extern U0 DirLstDel(CDirEntry *tempde);
|
||||
public extern U0 DirLstDel2(CDirEntry *tempde);
|
||||
public extern Bool DirNew(CPrt *p,U8 *cur_dir,CDirEntry *tempde,Bool free_old_chain=TRUE);
|
||||
|
||||
#help_index "File/Program Routines"
|
||||
public extern CDirEntry *FilesFind(U8 *files_find_mask,I64 fuf_flags=0);
|
||||
public extern I64 FileSize(U8 *filename,I64 fuf_flags=0);
|
||||
public extern I64 FileSizeExpanded(U8 *filename,I64 fuf_flags=0);
|
||||
public extern Bool FileFind(U8 *filename,CDirEntry *de=NULL,I64 fuf_flags=0);
|
||||
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,Bool raw=FALSE);
|
||||
public extern U8 *TextFileRead(U8 *filename,I64 *_attr=NULL);
|
||||
public extern I64 FileWrite(U8 *filename,U8 *fbuf,
|
||||
I64 size,CDate cdt=0,I64 attr=0,Bool raw=FALSE);
|
||||
I64 size,CDate cdt=0,I64 attr=0,Bool raw=FALSE);
|
||||
public extern U0 TextFileWrite(U8 *filename,U8 *st,I64 attr=0);
|
||||
|
||||
#help_index "Install;File/Cmd Line (Typically);Cmd Line (Typically);"
|
||||
@@ -552,12 +549,11 @@ extern Bool boot_drv_pmt,cdrom_boot_is_good;
|
||||
#help_index "Hash"
|
||||
#help_file "::/TempleOS/Doc/Hash"
|
||||
public _extern _HASH_STR I64 HashStr(U8 *st);
|
||||
public _extern _HASH_FIND CHash *
|
||||
HashFind(U8 *st,CHashTable *table,I64 mask,I64 instance=1);
|
||||
public _extern _HASH_FIND CHash *HashFind(U8 *st,CHashTable *table,I64 mask,I64 instance=1);
|
||||
public _extern _HASH_SINGLE_TABLE_FIND CHash *
|
||||
HashSingleTableFind(U8 *st,CHashTable *table,I64 mask,I64 instance=1);
|
||||
HashSingleTableFind(U8 *st,CHashTable *table,I64 mask,I64 instance=1);
|
||||
public _extern _HASH_BUCKET_FIND CHash **
|
||||
HashBucketFind(U8 *st,CHashTable *table);
|
||||
HashBucketFind(U8 *st,CHashTable *table);
|
||||
public _extern _HASH_ADD U0 HashAdd(CHash *temph,CHashTable *table);
|
||||
public _extern _HASH_ADD_AFTER U0 HashAddAfter(CHash *temph,CHash *pred,CHashTable *table);
|
||||
public _extern _HASH_REPLACE U0 HashReplace(CHash *temph,CHashTable *table,
|
||||
@@ -572,16 +568,16 @@ public extern U0 HashDel(CHashSrcSym *temph);
|
||||
public extern U0 HashTableDel(CHashTable *table);
|
||||
extern U0 SysSymImportsResolve(U8 *sptr,I64 ld_flags=0);
|
||||
|
||||
#help_index "Hash/Named Frame"
|
||||
#help_file "::/TempleOS/Doc/NamedFrame"
|
||||
public extern I64 NamedFramePtr(U8 *name,CTask *task=NULL);
|
||||
public extern CHashGeneric *NamedFramePtrAdd(U8 *name,I64 val,CTask *task=NULL);
|
||||
public extern I64 NamedFramePtrSet(U8 *name,I64 val,CTask *task=NULL);
|
||||
public extern I64 NamedFramePtrDel(U8 *name,CTask *task=NULL);
|
||||
#help_index "Hash/Frame"
|
||||
#help_file "::/TempleOS/Doc/Frame"
|
||||
public extern I64 FramePtr(U8 *name,CTask *task=NULL);
|
||||
public extern CHashGeneric *FramePtrAdd(U8 *name,I64 val,CTask *task=NULL);
|
||||
public extern I64 FramePtrSet(U8 *name,I64 val,CTask *task=NULL);
|
||||
public extern I64 FramePtrDel(U8 *name,CTask *task=NULL);
|
||||
|
||||
#help_index "Compiler;Cmd Line (Typically)"
|
||||
public extern U8 *Load(U8 *filename,I64 ld_flags=0,
|
||||
CBinFile *bfh_addr=INVALID_PTR); //INVALID_PTR means don't care what load addr.
|
||||
CBinFile *bfh_addr=INVALID_PTR); //INVALID_PTR means don't care what load addr.
|
||||
|
||||
extern I64 sys_num_installed_compilers;
|
||||
#help_index "Compiler"
|
||||
@@ -593,8 +589,8 @@ public extern U0 Reboot();
|
||||
|
||||
#help_index "MultiCore;Task/Requests"
|
||||
public extern CSrvCmd *JobQue(I64 (*fp_add)(U8 *data),U8 *data=NULL,
|
||||
I64 target_cpu=1,I64 flags=1<<SVCf_FREE_ON_COMPLETE,
|
||||
I64 cmd_code=SVCT_CALL,U8 *aux_str=NULL,I64 aux1=0,I64 aux2=0);
|
||||
I64 target_cpu=1,I64 flags=1<<SVCf_FREE_ON_COMPLETE,
|
||||
I64 cmd_code=SVCT_CALL,U8 *aux_str=NULL,I64 aux1=0,I64 aux2=0);
|
||||
#help_index "MultiCore"
|
||||
extern U8 mp_apic_ids[MP_MAX_PROCESSORS];
|
||||
extern CMPCrash *mp_crash;
|
||||
@@ -604,10 +600,9 @@ public extern U0 MPIntAll(U8 num);
|
||||
public extern U0 MPWake(I64 target_cpu);
|
||||
extern U0 MPSethServerTask();
|
||||
extern CTask *SpawnQue(U0 (*fp_add)(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<<SVCf_ADD_TO_QUE);
|
||||
U8 *task_name=NULL,I64 target_cpu,
|
||||
CTask *parent=NULL, //NULL means adam
|
||||
I64 stk_size=0,I64 flags=1<<SVCf_ADD_TO_QUE);
|
||||
public extern U0 MPNMInt();
|
||||
public extern U0 MPStart();
|
||||
#help_index "Task/Requests;MultiCore"
|
||||
@@ -687,8 +682,8 @@ public _extern _STRCMP I64 StrCmp(U8 *st1,U8 *st2);
|
||||
public _extern _STRICMP I64 StrICmp(U8 *st1,U8 *st2);
|
||||
public _extern _STRNCMP I64 StrNCmp(U8 *st1,U8 *st2,I64 n);
|
||||
public _extern _STRNICMP I64 StrNICmp(U8 *st1,U8 *st2,I64 n);
|
||||
public _extern _STRSTR U8 *StrStr(U8 *st,U8 *pattern);
|
||||
public _extern _STRISTR U8 *StrIStr(U8 *st,U8 *pattern);
|
||||
public _extern _STRMATCH U8 *StrMatch(U8 *pattern,U8 *st);
|
||||
public _extern _STRIMATCH U8 *StrIMatch(U8 *pattern,U8 *st);
|
||||
public _extern _STRCPY U0 StrCpy(U8 *dst,U8 *src);
|
||||
public _extern _STRCAT U0 StrCat(U8 *dst,U8 *src);
|
||||
|
||||
@@ -738,8 +733,8 @@ public extern F64 mouse_speed;
|
||||
extern I64 old_mxx,old_myy,old_mzz;
|
||||
public extern Bool mouse_buttons[5];
|
||||
extern Bool mouse_installed;
|
||||
extern I64 mouse_install_attempts,
|
||||
mouse_last_evt_time;
|
||||
extern I64 mouse_install_attempts,
|
||||
mouse_last_evt_time;
|
||||
extern Bool mouse_has_wheel;
|
||||
extern Bool mouse_has_ext_buttons;
|
||||
extern Bool mouse_evt;
|
||||
@@ -789,7 +784,7 @@ extern CDoc *(*fp_doc_put)(CTask *task=NULL);
|
||||
#help_index "Char/Conversion"
|
||||
public extern F64 A2F64(U8 *src,U8 **_end_ptr=NULL);
|
||||
|
||||
#help_index "Char/Conversion;Time/Date"
|
||||
#help_index "Char/Conversion;Time/Date;Date"
|
||||
public extern CDate A2Date(U8 *src);
|
||||
|
||||
#help_index "Debugging/PSect;Hash"
|
||||
|
||||
@@ -22,7 +22,7 @@ SYS_FIND_BIOS32_SERVICE_DIR::
|
||||
DEC ECX
|
||||
JNZ @@15
|
||||
POP ECX
|
||||
OR AL,AL
|
||||
TEST AL,AL
|
||||
JNZ @@20
|
||||
MOV U32 [SYS_BIOS32_SERVICE_DIR],ESI
|
||||
MOV ESI,U32 4[ESI]
|
||||
@@ -36,7 +36,7 @@ SYS_FIND_BIOS32_SERVICE_DIR::
|
||||
|
||||
SYS_FIND_PCI_SERVICES::
|
||||
MOV ESI,U32 [SYS_BIOS32_SERVICE_DIR]
|
||||
OR ESI,ESI
|
||||
TEST ESI,ESI
|
||||
JNZ @@05
|
||||
MOV U32 [SYS_PCI_SERVICES],0
|
||||
RET
|
||||
@@ -45,7 +45,7 @@ SYS_FIND_PCI_SERVICES::
|
||||
DU8 0x9A; //CALL GDT_CS_SEL:BIOS32_SERVICE
|
||||
SYS_BIOS32_SERVICE_CALL:: DU32 0;
|
||||
DU16 GDT_CS_SEL;
|
||||
OR AL,AL
|
||||
TEST AL,AL
|
||||
JNZ @@05
|
||||
LEA ESI,U32 [EBX+EDX]
|
||||
MOV U32 [SYS_PCI_SERVICES],ESI
|
||||
@@ -76,7 +76,7 @@ _FAR_CALL32::
|
||||
//
|
||||
ENTER 0
|
||||
MOV RAX,U64 SF_ARG1[RBP]
|
||||
OR RAX,RAX
|
||||
TEST RAX,RAX
|
||||
JNZ @@05
|
||||
LEAVE
|
||||
RET1 8 //return FALSE
|
||||
|
||||
@@ -25,7 +25,3 @@
|
||||
#define BOOT_CODE_RAM 1
|
||||
#define BOOT_CODE_HARDDRV 2
|
||||
#define BOOT_CODE_CDROM 3
|
||||
|
||||
#define MAX_BOOT_LOADER_SIZE CD_BLK_SIZE
|
||||
#define MAX_KERNEL_PATCH_TABLE 0x8000
|
||||
#define KERNEL_BIN_LIMIT ((BOOT_RAM_LIMIT-(BOOT_STK_SIZE+MAX_BOOT_LOADER_SIZE))>>4)
|
||||
@@ -72,7 +72,7 @@ _ARC_GET_ENTRY::
|
||||
JNE @@10
|
||||
MOV RDX,U64 CArcCtrl.min_table_entry[RSI]
|
||||
@@10: MOV RAX,U64 CArcCtrl.hash[RSI+RDX*8]
|
||||
OR RAX,RAX
|
||||
TEST RAX,RAX
|
||||
JNZ @@05
|
||||
MOV RDI,RDX
|
||||
SHL RDI,4
|
||||
@@ -80,7 +80,7 @@ _ARC_GET_ENTRY::
|
||||
MOV U32 CArcCtrl.next_entry[RSI],EDI
|
||||
MOVZX RBX,U16 CArcEntry.basecode[RDI]
|
||||
LEA RCX,U64 CArcCtrl.hash[RSI+RBX*8]
|
||||
@@15: OR RCX,RCX
|
||||
@@15: TEST RCX,RCX
|
||||
JZ @@25
|
||||
MOV RAX,U64 CArcEntry.next[RCX]
|
||||
CMP RDI,RAX
|
||||
|
||||
+89
-89
@@ -131,7 +131,7 @@ I64 Bcd2Bin(U64 b)
|
||||
}
|
||||
|
||||
|
||||
U0 GetCurTimeCDateStruct(CDateStruct *_ds)
|
||||
U0 GetDateTimeStruct(CDateStruct *_ds)
|
||||
{
|
||||
I64 i;
|
||||
U8 *b=_ds;
|
||||
@@ -189,10 +189,10 @@ U0 GetCurTimeCDateStruct(CDateStruct *_ds)
|
||||
if (_ds->sec>59) _ds->sec=59;
|
||||
}
|
||||
|
||||
CDate GetCurTimeDate()
|
||||
CDate GetDateTime()
|
||||
{
|
||||
CDateStruct ds;
|
||||
GetCurTimeCDateStruct(&ds);
|
||||
GetDateTimeStruct(&ds);
|
||||
return DateStruct2Date(&ds)-local_time_offset;
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ U0 DateTimeFmtMapsRst()
|
||||
time_fmt_map[i]=i;
|
||||
}
|
||||
|
||||
U8 *MSPrintFTime(CDate cdt,I64 sub_fmt)
|
||||
U8 *MPrintTime(CDate cdt,I64 sub_fmt)
|
||||
{
|
||||
CDateStruct ds;
|
||||
if (sub_fmt<TF_NUM)
|
||||
@@ -213,90 +213,90 @@ U8 *MSPrintFTime(CDate cdt,I64 sub_fmt)
|
||||
switch (sub_fmt) {
|
||||
case TF_HH24_MM:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%02d:%02d",ds.hour,ds.min);
|
||||
return MPrint("%02d:%02d",ds.hour,ds.min);
|
||||
case TF_HH12_MM_SS_AM:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
if (ds.hour>=12)
|
||||
return MSPrintF("%02d:%02d:%02d pm",ds.hour-12,ds.min,ds.sec);
|
||||
return MPrint("%02d:%02d:%02d pm",ds.hour-12,ds.min,ds.sec);
|
||||
else
|
||||
return MSPrintF("%02d:%02d:%02d am",ds.hour,ds.min,ds.sec);
|
||||
return MPrint("%02d:%02d:%02d am",ds.hour,ds.min,ds.sec);
|
||||
case TF_HH12_MM_AM:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
if (ds.hour>=12)
|
||||
return MSPrintF("%02d:%02d pm",ds.hour-12,ds.min);
|
||||
return MPrint("%02d:%02d pm",ds.hour-12,ds.min);
|
||||
else
|
||||
return MSPrintF("%02d:%02d am",ds.hour,ds.min);
|
||||
return MPrint("%02d:%02d am",ds.hour,ds.min);
|
||||
case TF_HH12_MM_SSA:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
if (ds.hour>=12)
|
||||
return MSPrintF("%02d:%02d:%02dp",ds.hour-12,ds.min,ds.sec);
|
||||
return MPrint("%02d:%02d:%02dp",ds.hour-12,ds.min,ds.sec);
|
||||
else
|
||||
return MSPrintF("%02d:%02d:%02da",ds.hour,ds.min,ds.sec);
|
||||
return MPrint("%02d:%02d:%02da",ds.hour,ds.min,ds.sec);
|
||||
case TF_HH12_MMA:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
if (ds.hour>=12)
|
||||
return MSPrintF("%02d:%02dp",ds.hour-12,ds.min);
|
||||
return MPrint("%02d:%02dp",ds.hour-12,ds.min);
|
||||
else
|
||||
return MSPrintF("%02d:%02da",ds.hour,ds.min);
|
||||
return MPrint("%02d:%02da",ds.hour,ds.min);
|
||||
case TF_H_M:
|
||||
Date2DateStruct(&ds,cdt);
|
||||
return MSPrintF("%dh %02dm",ds.hour+cdt.date*24,ds.min);
|
||||
return MPrint("%dh %02dm",ds.hour+cdt.date*24,ds.min);
|
||||
case TF_H_M_S:
|
||||
Date2DateStruct(&ds,cdt);
|
||||
return MSPrintF("%dh %02dm %02ds",ds.hour+cdt.date*24,ds.min,ds.sec);
|
||||
return MPrint("%dh %02dm %02ds",ds.hour+cdt.date*24,ds.min,ds.sec);
|
||||
case TF_D_H_M:
|
||||
Date2DateStruct(&ds,cdt);
|
||||
return MSPrintF("%dd %02dh %02dm",cdt.date,ds.hour,ds.min);
|
||||
return MPrint("%dd %02dh %02dm",cdt.date,ds.hour,ds.min);
|
||||
case TF_D_H_M_S:
|
||||
Date2DateStruct(&ds,cdt);
|
||||
return MSPrintF("%dd %02dh %02dm %02ds",cdt.date,ds.hour,ds.min,ds.sec);
|
||||
return MPrint("%dd %02dh %02dm %02ds",cdt.date,ds.hour,ds.min,ds.sec);
|
||||
case TF_D_H_M_Sh:
|
||||
Date2DateStruct(&ds,cdt);
|
||||
return MSPrintF("%dd %02dh %02dm %02d.%02ds",cdt.date,ds.hour,ds.min,ds.sec,ds.sec100);
|
||||
return MPrint("%dd %02dh %02dm %02d.%02ds",cdt.date,ds.hour,ds.min,ds.sec,ds.sec100);
|
||||
case TF_H_M_Sh:
|
||||
Date2DateStruct(&ds,cdt);
|
||||
return MSPrintF("%dh %02dm %02d.%02ds",ds.hour+cdt.date*24,ds.min,ds.sec,ds.sec100);
|
||||
return MPrint("%dh %02dm %02d.%02ds",ds.hour+cdt.date*24,ds.min,ds.sec,ds.sec100);
|
||||
case TF_Sh:
|
||||
Date2DateStruct(&ds,cdt);
|
||||
return MSPrintF("%d.%02d",60*((cdt.date*24+ds.hour)*60+ds.min)+ds.sec,ds.sec100);
|
||||
return MPrint("%d.%02d",60*((cdt.date*24+ds.hour)*60+ds.min)+ds.sec,ds.sec100);
|
||||
case TF_M_Sh:
|
||||
Date2DateStruct(&ds,cdt);
|
||||
return MSPrintF("%02d:%02d.%02d",60*(cdt.date*24+ds.hour)+ds.min,ds.sec,ds.sec100);
|
||||
return MPrint("%02d:%02d.%02d",60*(cdt.date*24+ds.hour)+ds.min,ds.sec,ds.sec100);
|
||||
case TF_H_M_Sh2:
|
||||
Date2DateStruct(&ds,cdt);
|
||||
return MSPrintF("%02d:%02d:%02d.%02d",cdt.date*24+ds.hour,ds.min,ds.sec,ds.sec100);
|
||||
return MPrint("%02d:%02d:%02d.%02d",cdt.date*24+ds.hour,ds.min,ds.sec,ds.sec100);
|
||||
case TF_D_H_M_Sht:
|
||||
Date2DateStruct(&ds,cdt);
|
||||
return MSPrintF("%dd %02dh %02dm %02d.%04ds",cdt.date,ds.hour,ds.min,ds.sec,100*ds.sec100+ds.sec10000);
|
||||
return MPrint("%dd %02dh %02dm %02d.%04ds",cdt.date,ds.hour,ds.min,ds.sec,100*ds.sec100+ds.sec10000);
|
||||
case TF_H_M_Sht:
|
||||
Date2DateStruct(&ds,cdt);
|
||||
return MSPrintF("%dh %02dm %02d.%04ds",ds.hour+cdt.date*24,ds.min,ds.sec,100*ds.sec100+ds.sec10000);
|
||||
return MPrint("%dh %02dm %02d.%04ds",ds.hour+cdt.date*24,ds.min,ds.sec,100*ds.sec100+ds.sec10000);
|
||||
case TF_Sht:
|
||||
Date2DateStruct(&ds,cdt);
|
||||
return MSPrintF("%d.%04d",60*((cdt.date*24+ds.hour)*60+ds.min)+ds.sec,100*ds.sec100+ds.sec10000);
|
||||
return MPrint("%d.%04d",60*((cdt.date*24+ds.hour)*60+ds.min)+ds.sec,100*ds.sec100+ds.sec10000);
|
||||
case TF_M_Sht:
|
||||
Date2DateStruct(&ds,cdt);
|
||||
return MSPrintF("%02d:%02d.%04d",60*(cdt.date*24+ds.hour)+ds.min,ds.sec,100*ds.sec100+ds.sec10000);
|
||||
return MPrint("%02d:%02d.%04d",60*(cdt.date*24+ds.hour)+ds.min,ds.sec,100*ds.sec100+ds.sec10000);
|
||||
case TF_H_M_Sht2:
|
||||
Date2DateStruct(&ds,cdt);
|
||||
return MSPrintF("%02d:%02d:%02d.%04d",cdt.date*24+ds.hour,ds.min,ds.sec,100*ds.sec100+ds.sec10000);
|
||||
return MPrint("%02d:%02d:%02d.%04d",cdt.date*24+ds.hour,ds.min,ds.sec,100*ds.sec100+ds.sec10000);
|
||||
case TF_HH24:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%02d",ds.hour);
|
||||
return MPrint("%02d",ds.hour);
|
||||
case TF_MM:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%02d",ds.min);
|
||||
return MPrint("%02d",ds.min);
|
||||
case TF_SS:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%02d",ds.sec);
|
||||
return MPrint("%02d",ds.sec);
|
||||
case TF_HH24_MM_SS:
|
||||
default:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%02d:%02d:%02d",ds.hour,ds.min,ds.sec);
|
||||
return MPrint("%02d:%02d:%02d",ds.hour,ds.min,ds.sec);
|
||||
}
|
||||
}
|
||||
|
||||
U8 *MSPrintFDate(CDate cdt,I64 sub_fmt)
|
||||
U8 *MPrintDate(CDate cdt,I64 sub_fmt)
|
||||
{
|
||||
CDateStruct ds;
|
||||
if (sub_fmt<DF_NUM)
|
||||
@@ -304,180 +304,180 @@ U8 *MSPrintFDate(CDate cdt,I64 sub_fmt)
|
||||
switch (sub_fmt) {
|
||||
case DF_MM_DD:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%02d/%02d",ds.mon,ds.day_of_mon);
|
||||
return MPrint("%02d/%02d",ds.mon,ds.day_of_mon);
|
||||
case DF_wek_MM_DD:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%3tZ %02d/%02d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
return MPrint("%3tZ %02d/%02d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
ds.mon,ds.day_of_mon);
|
||||
case DF_wek_MM_DD_YY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%3tZ %02d/%02d/%02d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
return MPrint("%3tZ %02d/%02d/%02d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
ds.mon,ds.day_of_mon,ds.year%100);
|
||||
case DF_MM_DD_YYYY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%02d/%02d/%d",ds.mon,ds.day_of_mon,ds.year);
|
||||
return MPrint("%02d/%02d/%d",ds.mon,ds.day_of_mon,ds.year);
|
||||
case DF_wek_MM_DD_YYYY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%3tZ %02d/%02d/%d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
return MPrint("%3tZ %02d/%02d/%d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
ds.mon,ds.day_of_mon,ds.year);
|
||||
case DF_mon_DD:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%3tZ %02d",ds.mon-1,"ST_MONTHS",ds.day_of_mon);
|
||||
return MPrint("%3tZ %02d",ds.mon-1,"ST_MONTHS",ds.day_of_mon);
|
||||
case DF_wek_mon_DD:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%3tZ, %3tZ %02d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
return MPrint("%3tZ, %3tZ %02d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
ds.mon-1,"ST_MONTHS",ds.day_of_mon);
|
||||
case DF_mon_DD_YYYY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%3tZ %02d,%04d",ds.mon-1,"ST_MONTHS",ds.day_of_mon,ds.year);
|
||||
return MPrint("%3tZ %02d,%04d",ds.mon-1,"ST_MONTHS",ds.day_of_mon,ds.year);
|
||||
case DF_wek_mon_DD_YYYY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%3tZ, %3tZ %02d,%d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
return MPrint("%3tZ, %3tZ %02d,%d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
ds.mon-1,"ST_MONTHS",ds.day_of_mon,ds.year);
|
||||
case DF_month_DD:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%Z %d",ds.mon-1,"ST_MONTHS",ds.day_of_mon);
|
||||
return MPrint("%Z %d",ds.mon-1,"ST_MONTHS",ds.day_of_mon);
|
||||
case DF_week_month_DD:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%Z, %Z %d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
return MPrint("%Z, %Z %d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
ds.mon-1,"ST_MONTHS",ds.day_of_mon);
|
||||
case DF_month_DD_YYYY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%Z %d,%d",ds.mon-1,"ST_MONTHS",ds.day_of_mon,ds.year);
|
||||
return MPrint("%Z %d,%d",ds.mon-1,"ST_MONTHS",ds.day_of_mon,ds.year);
|
||||
case DF_week_month_DD_YYYY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%Z, %Z %d,%d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
return MPrint("%Z, %Z %d,%d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
ds.mon-1,"ST_MONTHS",ds.day_of_mon,ds.year);
|
||||
case DF_DD_MM_YY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%02d/%02d/%02d",ds.day_of_mon,ds.mon,ds.year%100);
|
||||
return MPrint("%02d/%02d/%02d",ds.day_of_mon,ds.mon,ds.year%100);
|
||||
case DF_DD_MM:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%02d/%02d",ds.day_of_mon,ds.mon);
|
||||
return MPrint("%02d/%02d",ds.day_of_mon,ds.mon);
|
||||
case DF_wek_DD_MM:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%3tZ %02d/%02d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
return MPrint("%3tZ %02d/%02d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
ds.day_of_mon,ds.mon);
|
||||
case DF_wek_DD_MM_YY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%3tZ %02d/%02d/%02d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
return MPrint("%3tZ %02d/%02d/%02d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
ds.day_of_mon,ds.mon,ds.year%100);
|
||||
case DF_DD_MM_YYYY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%02d/%02d/%d",ds.day_of_mon,ds.mon,ds.year);
|
||||
return MPrint("%02d/%02d/%d",ds.day_of_mon,ds.mon,ds.year);
|
||||
case DF_wek_DD_MM_YYYY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%3tZ %02d/%02d/%d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
return MPrint("%3tZ %02d/%02d/%d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
ds.day_of_mon,ds.mon,ds.year);
|
||||
case DF_DD_mon:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%02d %3tZ",ds.day_of_mon,ds.mon-1,"ST_MONTHS");
|
||||
return MPrint("%02d %3tZ",ds.day_of_mon,ds.mon-1,"ST_MONTHS");
|
||||
case DF_wek_DD_mon:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%3tZ, %02d %3tZ",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
return MPrint("%3tZ, %02d %3tZ",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
ds.day_of_mon,ds.mon-1,"ST_MONTHS");
|
||||
case DF_DD_mon_YYYY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%02d %3tZ,%04d",ds.day_of_mon,ds.mon-1,"ST_MONTHS",ds.year);
|
||||
return MPrint("%02d %3tZ,%04d",ds.day_of_mon,ds.mon-1,"ST_MONTHS",ds.year);
|
||||
case DF_wek_DD_mon_YYYY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%3tZ, %02d %3tZ,%d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
return MPrint("%3tZ, %02d %3tZ,%d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
ds.day_of_mon,ds.mon-1,"ST_MONTHS",ds.year);
|
||||
case DF_DD_month:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%d %Z",ds.day_of_mon,ds.mon-1,"ST_MONTHS");
|
||||
return MPrint("%d %Z",ds.day_of_mon,ds.mon-1,"ST_MONTHS");
|
||||
case DF_week_DD_month:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%Z, %d %Z",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
return MPrint("%Z, %d %Z",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
ds.day_of_mon,ds.mon-1,"ST_MONTHS");
|
||||
case DF_DD_month_YYYY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%d %Z,%d",ds.day_of_mon,ds.mon-1,"ST_MONTHS",ds.year);
|
||||
return MPrint("%d %Z,%d",ds.day_of_mon,ds.mon-1,"ST_MONTHS",ds.year);
|
||||
case DF_week_DD_month_YYYY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%Z, %d %Z,%d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
return MPrint("%Z, %d %Z,%d",ds.day_of_week,"ST_DAYS_OF_WEEK",
|
||||
ds.day_of_mon,ds.mon-1,"ST_MONTHS",ds.year);
|
||||
case DF_YY_MM_DD:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%02d/%02d/%02d",ds.year%100,ds.mon,ds.day_of_mon);
|
||||
return MPrint("%02d/%02d/%02d",ds.year%100,ds.mon,ds.day_of_mon);
|
||||
case DF_YYYY_MM_DD:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%d/%02d/%02d",ds.year,ds.mon,ds.day_of_mon);
|
||||
return MPrint("%d/%02d/%02d",ds.year,ds.mon,ds.day_of_mon);
|
||||
case DF_YYMMDD:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%02d%02d%02d",ds.year%100,ds.mon,ds.day_of_mon);
|
||||
return MPrint("%02d%02d%02d",ds.year%100,ds.mon,ds.day_of_mon);
|
||||
case DF_YYYYMMDD:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%d%02d%02d",ds.year,ds.mon,ds.day_of_mon);
|
||||
return MPrint("%d%02d%02d",ds.year,ds.mon,ds.day_of_mon);
|
||||
case DF_MMDDYY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%02d%02d%02d",ds.mon,ds.day_of_mon,ds.year%100);
|
||||
return MPrint("%02d%02d%02d",ds.mon,ds.day_of_mon,ds.year%100);
|
||||
case DF_MMDDYYYY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%02d%02d%d",ds.mon,ds.day_of_mon,ds.year);
|
||||
return MPrint("%02d%02d%d",ds.mon,ds.day_of_mon,ds.year);
|
||||
case DF_wek:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%3tZ",ds.day_of_week,"ST_DAYS_OF_WEEK");
|
||||
return MPrint("%3tZ",ds.day_of_week,"ST_DAYS_OF_WEEK");
|
||||
case DF_week:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%Z",ds.day_of_week,"ST_DAYS_OF_WEEK");
|
||||
return MPrint("%Z",ds.day_of_week,"ST_DAYS_OF_WEEK");
|
||||
case DF_mon:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%3tZ",ds.mon-1,"ST_MONTHS");
|
||||
return MPrint("%3tZ",ds.mon-1,"ST_MONTHS");
|
||||
case DF_month:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%Z",ds.mon-1,"ST_MONTHS");
|
||||
return MPrint("%Z",ds.mon-1,"ST_MONTHS");
|
||||
case DF_YYYY_mon:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%d %3tZ",ds.year,ds.mon-1,"ST_MONTHS");
|
||||
return MPrint("%d %3tZ",ds.year,ds.mon-1,"ST_MONTHS");
|
||||
case DF_YYYY_month:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%d %Z",ds.year,ds.mon-1,"ST_MONTHS");
|
||||
return MPrint("%d %Z",ds.year,ds.mon-1,"ST_MONTHS");
|
||||
case DF_YY_mon:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%02d %3tZ",ds.year%100,ds.mon-1,"ST_MONTHS");
|
||||
return MPrint("%02d %3tZ",ds.year%100,ds.mon-1,"ST_MONTHS");
|
||||
case DF_YY_month:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%02d %Z",ds.year%100,ds.mon-1,"ST_MONTHS");
|
||||
return MPrint("%02d %Z",ds.year%100,ds.mon-1,"ST_MONTHS");
|
||||
case DF_mon_YYYY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%3tZ %d",ds.mon-1,"ST_MONTHS",ds.year);
|
||||
return MPrint("%3tZ %d",ds.mon-1,"ST_MONTHS",ds.year);
|
||||
case DF_month_YYYY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%Z %d",ds.mon-1,"ST_MONTHS",ds.year);
|
||||
return MPrint("%Z %d",ds.mon-1,"ST_MONTHS",ds.year);
|
||||
case DF_mon_YY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%3tZ %02d",ds.mon-1,"ST_MONTHS",ds.year%100);
|
||||
return MPrint("%3tZ %02d",ds.mon-1,"ST_MONTHS",ds.year%100);
|
||||
case DF_month_YY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%Z %02d",ds.mon-1,"ST_MONTHS",ds.year%100);
|
||||
return MPrint("%Z %02d",ds.mon-1,"ST_MONTHS",ds.year%100);
|
||||
case DF_YY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%02d",ds.year%100);
|
||||
return MPrint("%02d",ds.year%100);
|
||||
case DF_YYYY:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%d",ds.year);
|
||||
return MPrint("%d",ds.year);
|
||||
case DF_D:
|
||||
return MSPrintF("%d days",cdt.date);
|
||||
return MPrint("%d days",cdt.date);
|
||||
case DF_M:
|
||||
return MSPrintF("%d mons",ToI64(cdt/(CDATE_YEAR_DAYS/12))>>32);
|
||||
return MPrint("%d mons",ToI64(cdt/(CDATE_YEAR_DAYS/12))>>32);
|
||||
case DF_Y:
|
||||
return MSPrintF("%d years",ToI64(cdt/CDATE_YEAR_DAYS)>>32);
|
||||
return MPrint("%d years",ToI64(cdt/CDATE_YEAR_DAYS)>>32);
|
||||
case DF_D2:
|
||||
return MSPrintF("%d",cdt.date);
|
||||
return MPrint("%d",cdt.date);
|
||||
case DF_M2:
|
||||
return MSPrintF("%d",ToI64(cdt/(CDATE_YEAR_DAYS/12))>>32);
|
||||
return MPrint("%d",ToI64(cdt/(CDATE_YEAR_DAYS/12))>>32);
|
||||
case DF_Y2:
|
||||
return MSPrintF("%d",ToI64(cdt/CDATE_YEAR_DAYS)>>32);
|
||||
return MPrint("%d",ToI64(cdt/CDATE_YEAR_DAYS)>>32);
|
||||
case DF_D3:
|
||||
return MSPrintF("%0.1f",cdt/ToF64(MAX_U32+1));
|
||||
return MPrint("%0.1f",cdt/ToF64(MAX_U32+1));
|
||||
case DF_M3:
|
||||
return MSPrintF("%0.1f",cdt/ToF64(MAX_U32+1)/(CDATE_YEAR_DAYS/12));
|
||||
return MPrint("%0.1f",cdt/ToF64(MAX_U32+1)/(CDATE_YEAR_DAYS/12));
|
||||
case DF_Y3:
|
||||
return MSPrintF("%0.1f",cdt/ToF64(MAX_U32+1)/CDATE_YEAR_DAYS);
|
||||
return MPrint("%0.1f",cdt/ToF64(MAX_U32+1)/CDATE_YEAR_DAYS);
|
||||
case DF_MM_DD_YY:
|
||||
default:
|
||||
Date2DateStruct(&ds,cdt+local_time_offset);
|
||||
return MSPrintF("%02d/%02d/%02d",ds.mon,ds.day_of_mon,ds.year%100);
|
||||
return MPrint("%02d/%02d/%02d",ds.mon,ds.day_of_mon,ds.year%100);
|
||||
}
|
||||
}
|
||||
+52
-34
@@ -58,7 +58,7 @@ I64 UnusedStk(CTask *task=NULL)
|
||||
PushFD;
|
||||
Cli;
|
||||
if (task==Fs)
|
||||
result=GetStkPtr()(U8 *)-(&task->stk->stk_base)(U8 *);
|
||||
result=GetRSP()(U8 *)-(&task->stk->stk_base)(U8 *);
|
||||
else
|
||||
result=task->rsp(U8 *)-(&task->stk->stk_base)(U8 *);
|
||||
PopFD;
|
||||
@@ -70,7 +70,7 @@ U8 *Caller(I64 num=1)
|
||||
//which called this one, or the caller
|
||||
//of the caller, etc.
|
||||
{
|
||||
U8 **rbp=GetBasePtr,**ptr;
|
||||
U8 **rbp=GetRBP,**ptr;
|
||||
while (num--) {
|
||||
if (rbp>=*rbp)
|
||||
return NULL;
|
||||
@@ -123,7 +123,7 @@ U0 StkRep(CTask *task=NULL)
|
||||
PushFD;
|
||||
Cli;
|
||||
if (task==Fs) {
|
||||
rbp=GetBasePtr;
|
||||
rbp=GetRBP;
|
||||
rsp=rbp+3;
|
||||
rbp=*rbp;
|
||||
} else {
|
||||
@@ -166,7 +166,7 @@ U0 CallerRep(U8 **rbp=NULL,CTask *task=NULL)
|
||||
if (!task) task=Fs;
|
||||
if (!rbp) {
|
||||
if (task==Fs)
|
||||
rbp=GetBasePtr;
|
||||
rbp=GetRBP;
|
||||
else
|
||||
rbp=task->rbp;
|
||||
}
|
||||
@@ -180,7 +180,7 @@ U0 CallerRep(U8 **rbp=NULL,CTask *task=NULL)
|
||||
}
|
||||
}
|
||||
|
||||
U0 DbgStr(U8 *st,I64 mS=100)
|
||||
U0 RawStr(U8 *st,I64 mS=100)
|
||||
//Shows a string using
|
||||
//$LK,"Raw","MN:Raw"$ screen output for a fixed length
|
||||
//of time.
|
||||
@@ -190,16 +190,14 @@ U0 DbgStr(U8 *st,I64 mS=100)
|
||||
Cli;
|
||||
old_raw=Raw(ON);
|
||||
old_input_filter=LBtr(&Fs->task_flags,TASKf_INPUT_FILTER_TASK);
|
||||
"DbgStr(";
|
||||
"" st;
|
||||
')';
|
||||
"RawStr(%s)",st;
|
||||
BusyWait(mS<<10);
|
||||
PopFD;
|
||||
LBEqu(&Fs->task_flags,TASKf_INPUT_FILTER_TASK,old_input_filter);
|
||||
Raw(old_raw);
|
||||
}
|
||||
|
||||
U0 DbgI64(I64 num,I64 mS=100)
|
||||
U0 RawI64(I64 num,I64 mS=100)
|
||||
//Shows a hex num using
|
||||
//$LK,"Raw","MN:Raw"$ screen output for a fixed length
|
||||
//of time.
|
||||
@@ -209,14 +207,14 @@ U0 DbgI64(I64 num,I64 mS=100)
|
||||
Cli;
|
||||
old_raw=Raw(ON);
|
||||
old_input_filter=LBtr(&Fs->task_flags,TASKf_INPUT_FILTER_TASK);
|
||||
"DbgI64(%016X)",num;
|
||||
"RawI64(%016X)",num;
|
||||
BusyWait(mS<<10);
|
||||
PopFD;
|
||||
LBEqu(&Fs->task_flags,TASKf_INPUT_FILTER_TASK,old_input_filter);
|
||||
Raw(old_raw);
|
||||
}
|
||||
|
||||
U0 DbgF64(F64 d,I64 mS=100)
|
||||
U0 RawF64(F64 d,I64 mS=100)
|
||||
//Shows a floating-point val using
|
||||
//$LK,"Raw","MN:Raw"$ screen output for a fixed length
|
||||
//of time.
|
||||
@@ -226,14 +224,14 @@ U0 DbgF64(F64 d,I64 mS=100)
|
||||
Cli;
|
||||
old_raw=Raw(ON);
|
||||
old_input_filter=LBtr(&Fs->task_flags,TASKf_INPUT_FILTER_TASK);
|
||||
"DbgF64(%15e)",d;
|
||||
"RawF64(%15e)",d;
|
||||
BusyWait(mS<<10);
|
||||
PopFD;
|
||||
LBEqu(&Fs->task_flags,TASKf_INPUT_FILTER_TASK,old_input_filter);
|
||||
Raw(old_raw);
|
||||
}
|
||||
|
||||
U0 DbgAdd(U8 *add,I64 mS=100)
|
||||
U0 RawAdd(U8 *add,I64 mS=100)
|
||||
//Shows an addr using $LK,"Raw","MN:Raw"$ screen
|
||||
//output for a length of time.
|
||||
{
|
||||
@@ -242,14 +240,33 @@ U0 DbgAdd(U8 *add,I64 mS=100)
|
||||
Cli;
|
||||
old_raw=Raw(ON);
|
||||
old_input_filter=LBtr(&Fs->task_flags,TASKf_INPUT_FILTER_TASK);
|
||||
"DbgAdd(%P)",add;
|
||||
"RawAdd(%P)",add;
|
||||
BusyWait(mS<<10);
|
||||
PopFD;
|
||||
LBEqu(&Fs->task_flags,TASKf_INPUT_FILTER_TASK,old_input_filter);
|
||||
Raw(old_raw);
|
||||
}
|
||||
|
||||
U0 DbgD(U8 *add,I64 cnt=0x80,I64 mS=100)
|
||||
U0 RawPrint(I64 mS=100,U8 *fmt,...)
|
||||
//Print using $LK,"Raw","MN:Raw"$ screen
|
||||
//output for a length of time.
|
||||
//$BK,1$Your heap must be good.$BK,0$
|
||||
{
|
||||
U8 *buf=SPrintJoin(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(U8 *add,I64 cnt=0x80,I64 mS=100)
|
||||
//Dumps a block of mem using $LK,"Raw","MN:Raw"$
|
||||
//screen output for a fixed length
|
||||
//of time.
|
||||
@@ -266,7 +283,7 @@ U0 DbgD(U8 *add,I64 cnt=0x80,I64 mS=100)
|
||||
Raw(old_raw);
|
||||
}
|
||||
|
||||
U0 DbgDm(U8 *add,I64 cnt=0x80,I64 mS=100)
|
||||
U0 RawDm(U8 *add,I64 cnt=0x80,I64 mS=100)
|
||||
//Dumps a block of mem using $LK,"Raw","MN:Raw"$
|
||||
//screen output for a fixed length
|
||||
//of time.
|
||||
@@ -358,38 +375,38 @@ I64 *TaskRegAdd(CTask *task,I64 reg_num)
|
||||
|
||||
U0 RawDr(CTask *task=NULL)
|
||||
{
|
||||
I64 i,j,old_col=sys_raw_dc_col;
|
||||
I64 i,j,old_col=sys_raw_col;
|
||||
Bool old_raw=Raw(ON);
|
||||
U8 buf[200];
|
||||
|
||||
if (!task) task=Fs;
|
||||
|
||||
for (i=0;i<16;i++) {
|
||||
sys_raw_dc_col=i*text_cols+RAWDR_COL;
|
||||
sys_raw_col=i*text_cols+RAWDR_COL;
|
||||
"º%3Z:%016X\n",i,"ST_U64_REGS",*TaskRegAdd(task,i);
|
||||
}
|
||||
|
||||
sys_raw_dc_col=i++*text_cols+RAWDR_COL;
|
||||
sys_raw_col=i++*text_cols+RAWDR_COL;
|
||||
"ºRIP:%016X\n",task->rip;
|
||||
|
||||
sys_raw_dc_col=i++*text_cols+RAWDR_COL;
|
||||
sys_raw_col=i++*text_cols+RAWDR_COL;
|
||||
"º%-*tT\n",text_cols-(RAWDR_COL+1)-1,Fs->rip;
|
||||
|
||||
sys_raw_dc_col=i++*text_cols+RAWDR_COL;
|
||||
sys_raw_col=i++*text_cols+RAWDR_COL;
|
||||
'º';
|
||||
if (Bt(&sys_run_level,RLf_COMPILER)) {
|
||||
j=Fs->rip;
|
||||
Ui(buf,&j,,,TRUE);
|
||||
"" buf;
|
||||
"%s",buf;
|
||||
} else
|
||||
NewLine;
|
||||
|
||||
sys_raw_dc_col=i*text_cols+RAWDR_COL;
|
||||
sys_raw_col=i*text_cols+RAWDR_COL;
|
||||
'È';
|
||||
for (j=0;j<text_cols-RAWDR_COL-1;j++)
|
||||
'Í';
|
||||
|
||||
sys_raw_dc_col=old_col;
|
||||
sys_raw_col=old_col;
|
||||
Raw(old_raw);
|
||||
}
|
||||
|
||||
@@ -581,19 +598,20 @@ U0 DbgHelp()
|
||||
">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(\"CTask\",Fs,1);\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 Registers.\n"
|
||||
">1+2*3+&PutS;\t\t\t//Show calculation result.\n"
|
||||
">1+2*3+&Print;\t\t\t//Show calculation result.\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(&PrintF+0x8);\t\t//Unassemble PrintF.\n"
|
||||
">Uf(\"PutS\");\t\t\t//Unassembler function \"PutS\".\n"
|
||||
">Man(\"PutS\");\t\t\t//Edit Src for \"PutS\".\n"
|
||||
">U(&Print+0x8);\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"
|
||||
@@ -614,7 +632,7 @@ U0 Dbg2()
|
||||
if (IsRaw) {
|
||||
i=Fs->rip;
|
||||
Ui(buf,&i);
|
||||
"" buf;
|
||||
"%s",buf;
|
||||
} else
|
||||
U(Fs->rip,1);
|
||||
|
||||
@@ -670,7 +688,7 @@ U0 Fault2(I64 fault_num,I64 fault_err_code) //Called from $LK,"Fault2","FF:::/Te
|
||||
{
|
||||
//$BK,1$Be careful not to swap-out and ruin the saved context$BK,0$
|
||||
Bool was_raw,was_single_user,was_silent;
|
||||
I64 i,old_dc_flags=sys_raw_dc_flags;
|
||||
I64 i,old_raw_flags=sys_raw_flags;
|
||||
if (fault_num==I_DIVIDE_BY_ZERO)
|
||||
throw(EXCEPT_DIVIDE_BY_ZERO,Fs->rip);
|
||||
was_single_user=SingleUser(ON);
|
||||
@@ -684,9 +702,9 @@ U0 Fault2(I64 fault_num,I64 fault_err_code) //Called from $LK,"Fault2","FF:::/Te
|
||||
else {
|
||||
was_raw=Raw(ON);
|
||||
was_silent=Silent(OFF);
|
||||
sys_raw_dc_flags|=RDCF_SHOW_DOLLAR|RDCF_SCROLL;
|
||||
sys_raw_flags|=RWF_SHOW_DOLLAR|RWF_SCROLL;
|
||||
"Task \"";
|
||||
"" Fs->task_title;
|
||||
"%s",Fs->task_title;
|
||||
"\"\n";
|
||||
"Fault:0x%02X %Z\t\tErr Code:%08X\n",fault_num,fault_num,"ST_INT_NAMES",fault_err_code;
|
||||
"RIP:%08X",Fs->rip; //Sometimes crashes on %P, so do this first
|
||||
@@ -699,7 +717,7 @@ U0 Fault2(I64 fault_num,I64 fault_err_code) //Called from $LK,"Fault2","FF:::/Te
|
||||
Fault3(fault_num,fault_err_code);
|
||||
Silent(was_silent);
|
||||
Raw(was_raw);
|
||||
sys_raw_dc_flags=old_dc_flags;
|
||||
sys_raw_flags=old_raw_flags;
|
||||
}
|
||||
SingleUser(was_single_user);
|
||||
if (LBtr(&Fs->task_flags,TASKf_KILL_AFTER_DBG))
|
||||
|
||||
@@ -24,8 +24,9 @@ U0 LoadSysStrs()
|
||||
DefineLstLoad("ST_OFF_ON","Off\0On\0");
|
||||
DefineLstLoad("ST_HTT_TYPES","ExportSysSym\0ImportSysSym\0DefineStr\0GlbVar\0Class\0"
|
||||
"IntType\0Funct\0Word\0DictWord\0KeyWord\0AsmKeyWord\0OpCode\0Reg\0"
|
||||
"File\0Module\0HelpFile\0Frame Ptr\0Private\0"
|
||||
"Public\0Export\0Import\0Lit\0Unres\0Local\0");
|
||||
"File\0Module\0HelpFile\0Frame Ptr\0"
|
||||
" \0 \0 \0 \0 \0 \0 \0 \0"
|
||||
"Private\0Public\0Export\0Import\0Imm\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"
|
||||
@@ -34,7 +35,7 @@ U0 LoadSysStrs()
|
||||
"Floating\0Compiler\0Undefined Define\0"
|
||||
"Undefined Extern\0File\0File Xsum\0"
|
||||
"Partition error\0Blk Dev error\0"
|
||||
"Graphics\0SPrintF\0GetF\0Bin Module\0"
|
||||
"Graphics\0SPrint\0Scan\0Bin Module\0"
|
||||
"MultiCore\0FUF\0Flags\0");
|
||||
|
||||
DefineLstLoad("ST_FILE_ATTRS","R\0H\0S\0V\0D\0A\0 \0 \0X\0Y\0T\0Z\0C\0F\0");
|
||||
|
||||
+25
-25
@@ -14,49 +14,49 @@ See also $LK,"GrUpdateScreen","MN:GrUpdateScreen"$().
|
||||
I64 i,row,col;
|
||||
U8 *ptr,*ptr1,*ptr2;
|
||||
|
||||
if (!(sys_raw_dc_flags&RDCF_SHOW_DOLLAR)) {
|
||||
if (!(sys_raw_flags&RWF_SHOW_DOLLAR)) {
|
||||
if (ch=='$$') {
|
||||
if (sys_raw_dc_flags&RDCF_IN_DOLLAR) {
|
||||
sys_raw_dc_flags&=~RDCF_IN_DOLLAR;
|
||||
if (!(sys_raw_dc_flags & RDCF_LAST_DOLLAR)) {
|
||||
sys_raw_dc_flags&=~RDCF_LAST_DOLLAR;
|
||||
if (sys_raw_flags&RWF_IN_DOLLAR) {
|
||||
sys_raw_flags&=~RWF_IN_DOLLAR;
|
||||
if (!(sys_raw_flags & RWF_LAST_DOLLAR)) {
|
||||
sys_raw_flags&=~RWF_LAST_DOLLAR;
|
||||
Preempt(old_preempt);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
sys_raw_dc_flags|=RDCF_IN_DOLLAR|RDCF_LAST_DOLLAR;
|
||||
sys_raw_flags|=RWF_IN_DOLLAR|RWF_LAST_DOLLAR;
|
||||
Preempt(old_preempt);
|
||||
return;
|
||||
}
|
||||
}
|
||||
sys_raw_dc_flags&=~RDCF_LAST_DOLLAR;
|
||||
if (sys_raw_dc_flags&RDCF_IN_DOLLAR) {
|
||||
sys_raw_flags&=~RWF_LAST_DOLLAR;
|
||||
if (sys_raw_flags&RWF_IN_DOLLAR) {
|
||||
Preempt(old_preempt);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (ch=='\t') {
|
||||
RawPutChar(CH_SPACE);
|
||||
while (sys_raw_dc_col & 7)
|
||||
while (sys_raw_col & 7)
|
||||
RawPutChar(CH_SPACE);
|
||||
} else if (ch==CH_BACKSPACE) {
|
||||
sys_raw_dc_col--;
|
||||
sys_raw_col--;
|
||||
RawPutChar(CH_SPACE);
|
||||
sys_raw_dc_col--;
|
||||
sys_raw_col--;
|
||||
} else if (ch=='\n') {
|
||||
RawPutChar(CH_SPACE);
|
||||
while (sys_raw_dc_col % text_cols)
|
||||
while (sys_raw_col % text_cols)
|
||||
RawPutChar(CH_SPACE);
|
||||
|
||||
} else if (Bt(displayable_chars_bitmap,ch)) {
|
||||
row=sys_raw_dc_col/text_cols%text_rows;
|
||||
col=sys_raw_dc_col%text_cols;
|
||||
row=sys_raw_col/text_cols%text_rows;
|
||||
col=sys_raw_col%text_cols;
|
||||
if (text_mode) {
|
||||
if (sys_raw_dc_flags&RDCF_SCROLL && sys_raw_dc_col && !row && !col) {
|
||||
if (sys_raw_flags&RWF_SCROLL && sys_raw_col && !row && !col) {
|
||||
MemCpy(VGA_TEXT_MEM_BASE,VGA_TEXT_MEM_BASE+text_cols,
|
||||
text_cols*(text_rows-1)*2);
|
||||
MemSet(VGA_TEXT_MEM_BASE+text_cols*(text_rows-1)*2,0,text_cols*2);
|
||||
sys_raw_dc_col-=text_cols;
|
||||
sys_raw_col-=text_cols;
|
||||
row=text_rows-1;
|
||||
}
|
||||
ptr=VGA_TEXT_MEM_BASE+(row*text_cols+col)*2;
|
||||
@@ -65,21 +65,21 @@ See also $LK,"GrUpdateScreen","MN:GrUpdateScreen"$().
|
||||
} else {
|
||||
OutU8(VGA_SC_INDEX,VGA_MAP_MASK);
|
||||
OutU8(VGA_SC_DATA,0x0F); //All planes -- WHITE
|
||||
if (sys_raw_dc_flags&RDCF_SCROLL && sys_raw_dc_col && !row && !col) {
|
||||
if (sys_raw_flags&RWF_SCROLL && sys_raw_col && !row && !col) {
|
||||
//Scroll cached image
|
||||
MemCpy(sys_dc_screen_image,sys_dc_screen_image+gr_width*FONT_HEIGHT>>3,
|
||||
MemCpy(sys_raw_screen_image,sys_raw_screen_image+gr_width*FONT_HEIGHT>>3,
|
||||
gr_width*(gr_height-FONT_HEIGHT)>>3);
|
||||
MemSet(sys_dc_screen_image+gr_width*(gr_height-FONT_HEIGHT)>>3,0,gr_width*FONT_HEIGHT>>3);
|
||||
MemSet(sys_raw_screen_image+gr_width*(gr_height-FONT_HEIGHT)>>3,0,gr_width*FONT_HEIGHT>>3);
|
||||
|
||||
MemCpy(VGA_GRAPHIC_MEM_BASE,sys_dc_screen_image,gr_width*gr_height>>3);
|
||||
sys_raw_dc_col-=text_cols;
|
||||
MemCpy(VGA_GRAPHIC_MEM_BASE,sys_raw_screen_image,gr_width*gr_height>>3);
|
||||
sys_raw_col-=text_cols;
|
||||
row=text_rows-1;
|
||||
}
|
||||
PushFD;
|
||||
Cli;
|
||||
ptr=ptr1=col+row*gr_width;
|
||||
ptr+=VGA_GRAPHIC_MEM_BASE;
|
||||
ptr1+=sys_dc_screen_image; //Write to cached image as well
|
||||
ptr1+=sys_raw_screen_image; //Write to cached image as well
|
||||
ptr2=&gr_font[(ch&255)*FONT_HEIGHT];
|
||||
for (i=0;i<FONT_HEIGHT;i++) {
|
||||
*ptr=*ptr1=reverse_bits_table[*ptr2++];
|
||||
@@ -88,7 +88,7 @@ See also $LK,"GrUpdateScreen","MN:GrUpdateScreen"$().
|
||||
}
|
||||
PopFD;
|
||||
}
|
||||
sys_raw_dc_col++;
|
||||
sys_raw_col++;
|
||||
}
|
||||
Preempt(old_preempt);
|
||||
}
|
||||
@@ -205,7 +205,7 @@ U0 PutChar(U64 ch)
|
||||
}
|
||||
|
||||
U0 PutS(U8 *st)
|
||||
{ //See $LK,"PutKeyHandling","FA:::/TempleOS/Doc/KeyBoard.TXT,PutKeyHandling"$
|
||||
{ //Use $LK,"Print","MN:Print"$(). See $LK,"PutKeyHandling","FA:::/TempleOS/Doc/KeyBoard.TXT,PutKeyHandling"$
|
||||
U8 ch,*ptr;
|
||||
Bool cont=TRUE;
|
||||
if (!st) return;
|
||||
@@ -232,7 +232,7 @@ U0 PutS(U8 *st)
|
||||
U0 SetKeyDesc(U8 *fmt,...)
|
||||
{
|
||||
I64 i;
|
||||
U8 *buf=SPrintFJoin(NULL,fmt,argc,argv);
|
||||
U8 *buf=SPrintJoin(NULL,fmt,argc,argv);
|
||||
StrCpy(key_desc,buf);
|
||||
key_handler=Caller;
|
||||
Free(buf);
|
||||
|
||||
@@ -31,11 +31,8 @@ Bool BlkDevUnlock(CBlkDev *bdev,Bool rst=FALSE)
|
||||
while (bdev->lock_fwding)
|
||||
bdev=bdev->lock_fwding;
|
||||
if (Bt(&bdev->locked_flags,BDlf_LOCKED) && bdev->owning_task==Fs) {
|
||||
if (rst) {
|
||||
if (!Bt(&sys_semas[SYS_SEMA_NO_IO_SND],0))
|
||||
Snd(0);
|
||||
if (rst)
|
||||
bdev->flags&=~(BDF_INITIALIZED|BDF_INIT_IN_PROGRESS);
|
||||
}
|
||||
bdev->owning_task=0;
|
||||
LBtr(&bdev->locked_flags,BDlf_LOCKED);
|
||||
Yield; //Prevent deadlock
|
||||
@@ -81,8 +78,6 @@ Bool BlkDevInit(CBlkDev *bdev)
|
||||
case BDT_ATA:
|
||||
bdev->max_reads=128;
|
||||
bdev->max_writes=1;
|
||||
bdev->read_freq=2000;
|
||||
bdev->write_freq=500;
|
||||
result=ATAInit(bdev);
|
||||
break;
|
||||
case BDT_ATAPI:
|
||||
@@ -94,8 +89,6 @@ Bool BlkDevInit(CBlkDev *bdev)
|
||||
if (bdev->max_reads<128)
|
||||
bdev->max_reads=128;
|
||||
bdev->max_writes=0xFFFF*4;
|
||||
bdev->read_freq=1000;
|
||||
bdev->write_freq=250;
|
||||
if (result=ATAInit(bdev))
|
||||
p->size=bdev->max_blk+1;
|
||||
break;
|
||||
@@ -220,7 +213,7 @@ U0 SetFSBuf(CPrt *p,I64 c,I64 map_select=-1)
|
||||
if (c==INVALID_CLUSTER)
|
||||
throw(EXCEPT_PRT,1);
|
||||
if (p->type==PT_FAT32)
|
||||
MAP_blk_num=c/(BLK_SIZE>>2);
|
||||
MAP_blk_num=c>>(BLK_SIZE_BITS-2);
|
||||
else
|
||||
MAP_blk_num=c>>(BLK_SIZE_BITS+3);
|
||||
if (MAP_blk_num!=p->cur_map_blk_num) {
|
||||
@@ -333,12 +326,8 @@ Bool RBlks(CPrt *p,U8 *buf, I64 blk, I64 cnt)
|
||||
if (bdev->flags & BDF_READ_CACHE)
|
||||
RCache(p,&buf,&blk,&cnt);
|
||||
if (cnt>0) {
|
||||
if (!Bt(&sys_semas[SYS_SEMA_NO_IO_SND],0))
|
||||
Snd(bdev->read_freq);
|
||||
result=(*p->rblks)(p,buf,blk,cnt);
|
||||
bdev->last_time=tS;
|
||||
if (!Bt(&sys_semas[SYS_SEMA_NO_IO_SND],0))
|
||||
Snd(0);
|
||||
if (bdev->flags & BDF_READ_CACHE)
|
||||
DskCacheAdd(p,buf,blk,cnt);
|
||||
}
|
||||
@@ -366,11 +355,7 @@ Bool WBlks(CPrt *p,U8 *buf, I64 blk, I64 cnt)
|
||||
throw(EXCEPT_PRT,3);
|
||||
blk+=bdev->offset;
|
||||
if (cnt>0) {
|
||||
if (!Bt(&sys_semas[SYS_SEMA_NO_IO_SND],0))
|
||||
Snd(bdev->write_freq);
|
||||
result=(*p->wblks)(p,buf,blk,cnt);
|
||||
if (!Bt(&sys_semas[SYS_SEMA_NO_IO_SND],0))
|
||||
Snd(0);
|
||||
bdev->last_time=tS;
|
||||
if (bdev->flags & BDF_READ_CACHE)
|
||||
DskCacheAdd(p,buf,blk,cnt);
|
||||
@@ -457,8 +442,7 @@ U0 PrtRep()
|
||||
I64 i;
|
||||
U8 *st,drv_let;
|
||||
"\nDefined Partitions:\n\n";
|
||||
p=sys_prts;
|
||||
for (i=0;i<NUM_PRTS;i++,p++) {
|
||||
for (i=0,p=sys_prts;i<NUM_PRTS;i++,p++) {
|
||||
if (p->pt_signature==PRT_SIGNATURE_VAL) {
|
||||
bdev=p->bdev;
|
||||
drv_let=Prt2Drv(p);
|
||||
@@ -629,8 +613,7 @@ I64 Name2ParentDirCluster(CPrt *p,U8 *dirname)
|
||||
PrtChk(p);
|
||||
try {
|
||||
unlock=PrtLock(p);
|
||||
cur_dir_cluster=p->root_cluster;
|
||||
cur_dir_cluster2=p->root_cluster;
|
||||
cur_dir_cluster=cur_dir_cluster2=p->root_cluster;
|
||||
while (*buf && cont) {
|
||||
cur_dir_cluster2=cur_dir_cluster;
|
||||
StrFirstRem(buf,"/",buf2);
|
||||
@@ -710,7 +693,7 @@ I64 WClusters(CPrt *p,U8 *buf,I64 c,I64 cnt)
|
||||
}
|
||||
|
||||
//c=0 means first cluster in chain
|
||||
I64 ClusersAlloc(CPrt *p,I64 c=0,I64 cnt=1,Bool contiguous=FALSE)
|
||||
I64 ClustersAlloc(CPrt *p,I64 c=0,I64 cnt=1,Bool contiguous=FALSE)
|
||||
{
|
||||
PrtChk(p);
|
||||
if (cnt<=0) return c;
|
||||
|
||||
@@ -154,7 +154,7 @@ CFileAccess *FileAccessNew(U8 *_mask,Bool make_mask=FALSE,Bool make_dirs=FALSE)
|
||||
if (!Drv(*mask)) valid=FALSE;
|
||||
mask+=2;
|
||||
}
|
||||
if (StrStr(mask,"HOME") && Fs->cur_prt!=Drv2Prt(*sys_acct))
|
||||
if (StrMatch("HOME",mask) && Fs->cur_prt!=Drv2Prt(*sys_acct))
|
||||
Drv(*sys_acct);
|
||||
fa->p=Fs->cur_prt;
|
||||
PrtChk(fa->p);
|
||||
@@ -197,12 +197,16 @@ CDirEntry *FilesFind(U8 *files_find_mask,I64 fuf_flags=0)
|
||||
{
|
||||
/*
|
||||
Flags:
|
||||
$LK,"FUF_RECURSE","MN:FUF_RECURSE"$ +r Recurse
|
||||
$LK,"FUF_FLATTEN_TREE","MN:FUF_FLATTEN_TREE"$ +f $BK,1$be sure to use this along with '+F'$BK,0$.
|
||||
$LK,"FUF_JUST_DIRS","MN:FUF_JUST_DIRS"$ +D just directories
|
||||
$LK,"FUF_JUST_FILES","MN:FUF_JUST_FILES"$ +F just files
|
||||
$LK,"FUF_JUST_TXT_FILES","MN:FUF_JUST_TXT_FILES"$ +T just text files: $LK,"FILENAME_MASK_TXT","MN:FILENAME_MASK_TXT"$
|
||||
$LK,"FUF_JUST_SRC_FILES","MN:FUF_JUST_SRC_FILES"$ +S just src files : $LK,"FILENAME_MASK_SRC","MN:FILENAME_MASK_SRC"$
|
||||
$LK,"FUF_RECURSE","MN:FUF_RECURSE"$ +r Recurse
|
||||
$LK,"FUF_FLATTEN_TREE","MN:FUF_FLATTEN_TREE"$ +f $BK,1$use with '+F'$BK,0$. Just use +F, probably.
|
||||
$LK,"FUF_JUST_DIRS","MN:FUF_JUST_DIRS"$ +D just directories
|
||||
$LK,"FUF_JUST_FILES","MN:FUF_JUST_FILES"$ +F just files (Flattens trees)
|
||||
$LK,"FUF_JUST_TXT","MN:FUF_JUST_TXT"$ +T just text files : $LK,"FILEMASK_TXT","MN:FILEMASK_TXT"$
|
||||
$LK,"FUF_JUST_SRC","MN:FUF_JUST_SRC"$ +S just src files : $LK,"FILEMASK_SRC","MN:FILEMASK_SRC"$
|
||||
$LK,"FUF_JUST_AOT","MN:FUF_JUST_AOT"$ +A just aot files : $LK,"FILEMASK_AOT","MN:FILEMASK_AOT"$
|
||||
$LK,"FUF_JUST_JIT","MN:FUF_JUST_JIT"$ +J just jit files : $LK,"FILEMASK_JIT","MN:FILEMASK_JIT"$
|
||||
$LK,"FUF_JUST_GRA","MN:FUF_JUST_GRA"$ +G just graphic files : $LK,"FILEMASK_GRA","MN:FILEMASK_GRA"$
|
||||
|
||||
See $LK,"ST_FILE_UTIL_FLAGS","MN:ST_FILE_UTIL_FLAGS"$ when used in calling program taking text flags.
|
||||
*/
|
||||
CDirEntry *result;
|
||||
@@ -219,7 +223,7 @@ See $LK,"ST_FILE_UTIL_FLAGS","MN:ST_FILE_UTIL_FLAGS"$ when used in calling progr
|
||||
|
||||
Bool IsDir(U8 *dir_name)
|
||||
{
|
||||
U8 *mask=MSPrintF("%s/*",dir_name);
|
||||
U8 *mask=MPrint("%s/*",dir_name);
|
||||
Bool result,old_silent=Silent(ON);
|
||||
CFileAccess *fa;
|
||||
if (fa=FileAccessNew(mask)) {
|
||||
@@ -359,9 +363,9 @@ U8 *TextFileRead(U8 *filename,I64 *_attr=NULL)
|
||||
}
|
||||
|
||||
|
||||
Bool FileFind(U8 *filename,CDirEntry *rde=NULL,I64 fuf_flags=0)
|
||||
Bool FileFind(U8 *filename,CDirEntry *_de=NULL,I64 fuf_flags=0)
|
||||
{ //$LK,"FUF_JUST_DIRS","MN:FUF_JUST_DIRS"$, $LK,"FUF_JUST_FILES","MN:FUF_JUST_FILES"$, $LK,"FUF_Z_OR_NOT_Z","MN:FUF_Z_OR_NOT_Z"$, $LK,"FUF_SCAN_PARENTS","MN:FUF_SCAN_PARENTS"$
|
||||
//If you pass rde, you must Free(rde->full_name);
|
||||
//If you pass _de, you must Free(_de->full_name);
|
||||
I64 i,j,cur_dir_cluster;
|
||||
U8 *altname,*curname,*full_name=NULL;
|
||||
CDirEntry de;
|
||||
@@ -395,8 +399,8 @@ Bool FileFind(U8 *filename,CDirEntry *rde=NULL,I64 fuf_flags=0)
|
||||
default:
|
||||
PutDefineErr("ST_UNSUPPORTED_FILE_SYSTEM");
|
||||
}
|
||||
if (result && rde)
|
||||
full_name=MSPrintF("%C:%s/%s",Fs->cur_prt->drv_let,Fs->cur_dir,de.name);
|
||||
if (result && _de)
|
||||
full_name=MPrint("%C:%s/%s",Fs->cur_prt->drv_let,Fs->cur_dir,de.name);
|
||||
FileAccessDel(fa);
|
||||
}
|
||||
}
|
||||
@@ -424,17 +428,17 @@ Bool FileFind(U8 *filename,CDirEntry *rde=NULL,I64 fuf_flags=0)
|
||||
PutDefineErr("ST_UNSUPPORTED_FILE_SYSTEM");
|
||||
}
|
||||
}
|
||||
if (result && rde)
|
||||
full_name=MSPrintF("%C:%s/%s",Fs->cur_prt->drv_let,Fs->cur_dir,de.name);
|
||||
if (result && _de)
|
||||
full_name=MPrint("%C:%s/%s",Fs->cur_prt->drv_let,Fs->cur_dir,de.name);
|
||||
FileAccessDel(fa);
|
||||
}
|
||||
}
|
||||
if (rde) {
|
||||
if (_de) {
|
||||
if (result) {
|
||||
MemCpy(rde,&de,sizeof(CDirEntry));
|
||||
rde->full_name=full_name;
|
||||
MemCpy(_de,&de,sizeof(CDirEntry));
|
||||
_de->full_name=full_name;
|
||||
} else
|
||||
MemSet(rde,0,sizeof(CDirEntry));
|
||||
MemSet(_de,0,sizeof(CDirEntry));
|
||||
}
|
||||
Free(altname);
|
||||
return result;
|
||||
@@ -458,15 +462,11 @@ I64 FileSizeExpanded(U8 *filename,I64 fuf_flags=0)
|
||||
if (FileFind(filename,&de,fuf_flags)) {
|
||||
p=Drv2Prt(*de.full_name);
|
||||
Free(de.full_name);
|
||||
if (p->type==PT_REDSEA && de.expanded_size)
|
||||
return de.expanded_size;
|
||||
else {
|
||||
if (de.size && FileAttr(de.name) & _ATTR_COMPRESSED) {
|
||||
RBlks(p,buf,Cluster2Blk(p,de.cluster),1);
|
||||
return (&buf)(CArcCompress *)->expanded_size;
|
||||
} else
|
||||
return de.size;
|
||||
}
|
||||
if (de.size && FileAttr(de.name) & _ATTR_COMPRESSED) {
|
||||
RBlks(p,buf,Cluster2Blk(p,de.cluster),1);
|
||||
return (&buf)(CArcCompress *)->expanded_size;
|
||||
} else
|
||||
return de.size;
|
||||
} else
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -30,8 +30,7 @@ Bool CopySingleZ(U8 *f1,U8 *f2) //Just one file
|
||||
Bool CopySingle(U8 *f1,U8 *f2) //Just one file
|
||||
{
|
||||
U8 *absf1=FileNameAbs(f1),*absf2=FileNameAbs(f2),*buf;
|
||||
I64 cnt,n,size,attr1=FileAttr(f1),attr2=FileAttr(f2),
|
||||
xsum=TEMPLEOS_XSUM,i,j;
|
||||
I64 cnt,n,size,attr1=FileAttr(f1),attr2=FileAttr(f2),i,j;
|
||||
CFile *in_file=NULL,*out_file=NULL;
|
||||
|
||||
if (!StrCmp(absf1,absf2)) { //onto self?
|
||||
@@ -68,19 +67,13 @@ Bool CopySingle(U8 *f1,U8 *f2) //Just one file
|
||||
i=j;
|
||||
}
|
||||
FRBlks(in_file, buf,FFB_NEXT_BLK,n);
|
||||
xsum^=ArcXSum(buf,i);
|
||||
FWBlks(out_file,buf,FFB_NEXT_BLK,n);
|
||||
cnt-=n;
|
||||
j-=n<<BLK_SIZE_BITS;
|
||||
}
|
||||
if (in_file->de.xsum &&
|
||||
in_file->de.xsum!=xsum)
|
||||
throw(EXCEPT_ARC_XSUM);
|
||||
out_file->de.xsum=xsum;
|
||||
out_file->flags|=FF_USE_OLD_DATETIME;
|
||||
out_file->de.datetime=in_file->de.datetime;
|
||||
out_file->de.size=size;
|
||||
out_file->de.expanded_size=in_file->de.expanded_size;
|
||||
out_file->de.attr=FileAttr(f2,in_file->de.attr);
|
||||
FClose(out_file);
|
||||
FClose(in_file);
|
||||
@@ -105,9 +98,7 @@ Bool MkDir(U8 *filename)
|
||||
if (!FileNameChk(fa->mask))
|
||||
PutDefineErr("ST_INVALID_FILENAME");
|
||||
else {
|
||||
"Make Directory:";
|
||||
"" filename;
|
||||
NewLine;
|
||||
"Make Directory:%s\n",filename;
|
||||
name=MStrUtil(fa->mask,
|
||||
SUF_REM_LEADING|SUF_REM_TRAILING|SUF_REM_CTRL_CHARS);
|
||||
switch (fa->p->type) {
|
||||
@@ -214,8 +205,6 @@ U0 CDImageRead(U8 cd_drv_let,U8 *out_name)
|
||||
n=cnt;
|
||||
if (n>bdev->max_reads)
|
||||
n=bdev->max_reads;
|
||||
if (!Bt(&sys_semas[SYS_SEMA_NO_IO_SND],0))
|
||||
Snd(bdev->read_freq);
|
||||
|
||||
retry=4;
|
||||
while (--retry)
|
||||
@@ -227,8 +216,6 @@ U0 CDImageRead(U8 cd_drv_let,U8 *out_name)
|
||||
if (!retry)
|
||||
ATAPIReadBlks2(bdev,buf,blk/spc,n/spc,TRUE,0);
|
||||
|
||||
if (!Bt(&sys_semas[SYS_SEMA_NO_IO_SND],0))
|
||||
Snd(0);
|
||||
FWBlks(f,buf,blk,n);
|
||||
cnt-=n;
|
||||
blk+=n;
|
||||
@@ -273,8 +260,6 @@ U0 CDImageWriteTask(CDualBuf *d)
|
||||
while (d->in_buf>d->out_buf+1)
|
||||
Yield;
|
||||
FRBlks(f,buf,blk,n);
|
||||
if (!Bt(&sys_semas[SYS_SEMA_NO_IO_SND],0))
|
||||
Snd(d->CD_bdev->write_freq);
|
||||
d->in_buf++;
|
||||
cnt-=n;
|
||||
blk+=n;
|
||||
@@ -334,8 +319,6 @@ U0 CDImageWrite(U8 cd_drv_let,U8 *in_name=NULL,I64 media_type=MT_CD)
|
||||
while (d->in_buf<=d->out_buf)
|
||||
Yield;
|
||||
|
||||
if (!Bt(&sys_semas[SYS_SEMA_NO_IO_SND],0))
|
||||
Snd(bdev->write_freq);
|
||||
BlkDevLock(bdev);
|
||||
ATAPIWaitReady(bdev,0);
|
||||
|
||||
@@ -381,8 +364,6 @@ U0 CDImageWrite(U8 cd_drv_let,U8 *in_name=NULL,I64 media_type=MT_CD)
|
||||
*progress1_desc=0;
|
||||
progress1=progress1_max=0;
|
||||
|
||||
if (!Bt(&sys_semas[SYS_SEMA_NO_IO_SND],0))
|
||||
Snd(0);
|
||||
bdev->flags&=~BDF_READ_ONLY_OVERRIDE;
|
||||
BlkDevUnlock(bdev);
|
||||
Free(d->buf0);
|
||||
|
||||
@@ -800,46 +800,46 @@ public I64 ATARep(Bool pmt=TRUE,Bool just_ide=FALSE,CATARep **_root=NULL)
|
||||
for (i=0;i<NUM_BLKDEVS;i++)
|
||||
if (sys_blkdevs[i].bd_signature==BD_SIGNATURE_VAL)
|
||||
BEqu(&unlock_flags,i,
|
||||
BlkDevLock(&sys_blkdevs[i]));
|
||||
BlkDevLock(&sys_blkdevs[i]));
|
||||
|
||||
if (!just_ide)
|
||||
for (k=0;k<256;k++) {
|
||||
i=-1;
|
||||
while (TRUE) {
|
||||
j=PCIClassFind(0x010100+k,++i);
|
||||
if (j<0)
|
||||
break;
|
||||
for (k=0;k<256;k++) {
|
||||
i=-1;
|
||||
while (TRUE) {
|
||||
j=PCIClassFind(0x010100+k,++i);
|
||||
if (j<0)
|
||||
break;
|
||||
|
||||
"\nSubcode:0x%X Bus:0x%X Dev:0x%X Fun:0x%X\n",k,j.u8[2],j.u8[1],j.u8[0];
|
||||
cnt++;
|
||||
"\nSubcode:0x%X Bus:0x%X Dev:0x%X Fun:0x%X\n",k,j.u8[2],j.u8[1],j.u8[0];
|
||||
cnt++;
|
||||
|
||||
d1=PCIReadU32(j.u8[2],j.u8[1],j.u8[0],0x10);
|
||||
d2=PCIReadU32(j.u8[2],j.u8[1],j.u8[0],0x14);
|
||||
d3=PCIReadU8(j.u8[2],j.u8[1],j.u8[0],0x3C);
|
||||
if (d1&1 && d2&1) {
|
||||
ATARepEntry(d1,d2,0,d3,"Primary IDE",_root,&num_hints);
|
||||
ATARepEntry(d1,d2,1,d3,"Primary IDE",_root,&num_hints);
|
||||
} else {
|
||||
d1=0x1F0;
|
||||
d2=0x3F6;
|
||||
d3=14;
|
||||
ATARepEntry(d1,d2,0,d3,"Primary IDE",_root,&num_hints);
|
||||
ATARepEntry(d1,d2,1,d3,"Primary IDE",_root,&num_hints);
|
||||
}
|
||||
d1=PCIReadU32(j.u8[2],j.u8[1],j.u8[0],0x18);
|
||||
d2=PCIReadU32(j.u8[2],j.u8[1],j.u8[0],0x1C);
|
||||
if (d1&1 && d2&1) {
|
||||
ATARepEntry(d1,d2,0,d3,"Secondary IDE",_root,&num_hints);
|
||||
ATARepEntry(d1,d2,1,d3,"Secondary IDE",_root,&num_hints);
|
||||
} else {
|
||||
d1=0x170;
|
||||
d2=0x376;
|
||||
d3=15;
|
||||
ATARepEntry(d1,d2,0,d3,"Secondary IDE",_root,&num_hints);
|
||||
ATARepEntry(d1,d2,1,d3,"Secondary IDE",_root,&num_hints);
|
||||
d1=PCIReadU32(j.u8[2],j.u8[1],j.u8[0],0x10);
|
||||
d2=PCIReadU32(j.u8[2],j.u8[1],j.u8[0],0x14);
|
||||
d3=PCIReadU8(j.u8[2],j.u8[1],j.u8[0],0x3C);
|
||||
if (d1&1 && d2&1) {
|
||||
ATARepEntry(d1,d2,0,d3,"Primary IDE",_root,&num_hints);
|
||||
ATARepEntry(d1,d2,1,d3,"Primary IDE",_root,&num_hints);
|
||||
} else {
|
||||
d1=0x1F0;
|
||||
d2=0x3F6;
|
||||
d3=14;
|
||||
ATARepEntry(d1,d2,0,d3,"Primary IDE",_root,&num_hints);
|
||||
ATARepEntry(d1,d2,1,d3,"Primary IDE",_root,&num_hints);
|
||||
}
|
||||
d1=PCIReadU32(j.u8[2],j.u8[1],j.u8[0],0x18);
|
||||
d2=PCIReadU32(j.u8[2],j.u8[1],j.u8[0],0x1C);
|
||||
if (d1&1 && d2&1) {
|
||||
ATARepEntry(d1,d2,0,d3,"Secondary IDE",_root,&num_hints);
|
||||
ATARepEntry(d1,d2,1,d3,"Secondary IDE",_root,&num_hints);
|
||||
} else {
|
||||
d1=0x170;
|
||||
d2=0x376;
|
||||
d3=15;
|
||||
ATARepEntry(d1,d2,0,d3,"Secondary IDE",_root,&num_hints);
|
||||
ATARepEntry(d1,d2,1,d3,"Secondary IDE",_root,&num_hints);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!cnt) {
|
||||
d1=0x1F0;
|
||||
d2=0x3F6;
|
||||
|
||||
@@ -211,8 +211,8 @@ U0 Mount(Bool repartition=FALSE)
|
||||
} while (!A2I(base0_buf));
|
||||
if (1<=A2I(base0_buf)<=num_hints) {
|
||||
tempha=ATARepFind(root,A2I(base0_buf));
|
||||
SPrintF(base0_buf,"0x%X",tempha->base0);
|
||||
SPrintF(base1_buf,"0x%X",tempha->base1);
|
||||
SPrint(base0_buf,"0x%X",tempha->base0);
|
||||
SPrint(base1_buf,"0x%X",tempha->base1);
|
||||
unit=tempha->unit;
|
||||
} else {
|
||||
if (type==BDT_ATAPI)
|
||||
@@ -287,9 +287,9 @@ Bool PmtBaseUnit(CBlkDev *bdev)
|
||||
" TempleOS\n\n\n";
|
||||
#exe {
|
||||
if (kernel_cfg->opts[CFG_DONT_PROBE])
|
||||
StreamPutS("probe=FALSE;");
|
||||
StreamPrint("probe=FALSE;");
|
||||
else
|
||||
StreamPutS("probe=TRUE;");
|
||||
StreamPrint("probe=TRUE;");
|
||||
};
|
||||
if (!probe || !BootCdProbeAll(bdev)) {
|
||||
PutDefine("ST_CDROM_PORTS_PMT1");
|
||||
@@ -320,13 +320,13 @@ U0 BlkDevsInitAll()
|
||||
sys_prts=CAlloc(sizeof(CPrt)*NUM_PRTS);
|
||||
for (i=0;i<NUM_PRTS;i++)
|
||||
drv_to_prt[i]=&sys_prts[i];
|
||||
sys_raw_dc_col=0;
|
||||
sys_raw_col=0;
|
||||
#exe {
|
||||
if (kernel_cfg->opts[CFG_AUTO_MOUNT_IDE])
|
||||
StreamPutS("AutoMountIDE;");
|
||||
StreamPutS("#exe {OptOff(OPTf_WARN_PAREN);}");
|
||||
StreamPrint("AutoMountIDE;");
|
||||
StreamPrint("#exe {OptOff(OPTf_WARN_PAREN);}");
|
||||
StreamDoc(kernel_cfg->add_dev);
|
||||
StreamPutS("#exe {OptOn(OPTf_WARN_PAREN);}");
|
||||
StreamPrint("#exe {OptOn(OPTf_WARN_PAREN);}");
|
||||
};
|
||||
PrtRep;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ I64 FSize(CFile *f)
|
||||
|
||||
CFile *FOpen(U8 *filename,U8 *flags,I64 cnt=0)
|
||||
{ //allows flags "r","w","w+". Include a "c" for contiguous.
|
||||
//(It uses $LK,"StrOcc","MN:StrOcc"$() for 'w', 'r', '+', 'c')
|
||||
CFile *f=CAlloc(sizeof(CFile));
|
||||
CFileAccess *fa;
|
||||
U8 *full_name;
|
||||
@@ -48,10 +49,10 @@ CFile *FOpen(U8 *filename,U8 *flags,I64 cnt=0)
|
||||
if (fa=FileAccessNew(full_name)) {
|
||||
StrCpy(f->de.name,fa->mask);
|
||||
if (cnt>0) { //We pre-alloc the whole thing.
|
||||
f->de.cluster=ClusersAlloc(f->p,0,
|
||||
f->de.cluster=ClustersAlloc(f->p,0,
|
||||
(cnt+f->p->spc-1)/f->p->spc,contiguous);
|
||||
f->de.expanded_size=f->de.size=cnt<<BLK_SIZE_BITS;
|
||||
CDirNew(fa->p,Fs->cur_dir,&f->de,TRUE);
|
||||
f->de.size=cnt<<BLK_SIZE_BITS;
|
||||
DirNew(fa->p,Fs->cur_dir,&f->de,TRUE);
|
||||
f->flags&=~FF_NEW_FILE;
|
||||
}
|
||||
FileAccessDel(fa);
|
||||
@@ -82,11 +83,11 @@ U0 FClose(CFile *f)
|
||||
if (f->flags & FF_NEEDS_WRITE) {
|
||||
if (fa=FileAccessNew(f->de.full_name)) {
|
||||
if (!(f->flags & FF_USE_OLD_DATETIME))
|
||||
f->de.datetime=GetCurTimeDate;
|
||||
f->de.datetime=GetDateTime;
|
||||
if (f->flags & FF_NEW_FILE)
|
||||
CDirNew(fa->p,Fs->cur_dir,&f->de,TRUE);
|
||||
DirNew(fa->p,Fs->cur_dir,&f->de,TRUE);
|
||||
else
|
||||
CDirNew(fa->p,Fs->cur_dir,&f->de,FALSE);
|
||||
DirNew(fa->p,Fs->cur_dir,&f->de,FALSE);
|
||||
FileAccessDel(fa);
|
||||
} else
|
||||
throw(EXCEPT_FILE,1);
|
||||
@@ -196,7 +197,7 @@ Bool FWBlks(CFile *f,U8 *buf,I64 blk=FFB_NEXT_BLK,I64 cnt=1)
|
||||
blk+=cnt;
|
||||
} else {
|
||||
if (!c) {
|
||||
c=ClusersAlloc(p,0,1,FALSE);
|
||||
c=ClustersAlloc(p,0,1,FALSE);
|
||||
f->file_cluster_num=0;
|
||||
f->cluster=c;
|
||||
f->de.cluster=c;
|
||||
@@ -211,7 +212,7 @@ Bool FWBlks(CFile *f,U8 *buf,I64 blk=FFB_NEXT_BLK,I64 cnt=1)
|
||||
c1=c;
|
||||
c=ClusterNumNext(p,c1,1);
|
||||
if (c==INVALID_CLUSTER) {
|
||||
c=ClusersAlloc(p,c1,i,FALSE);
|
||||
c=ClustersAlloc(p,c1,i,FALSE);
|
||||
if (i>1)
|
||||
c=ClusterNumNext(p,c,i-1);
|
||||
break;
|
||||
@@ -234,7 +235,7 @@ Bool FWBlks(CFile *f,U8 *buf,I64 blk=FFB_NEXT_BLK,I64 cnt=1)
|
||||
c1=c;
|
||||
c=ClusterNumNext(p,c1,1);
|
||||
if (c==INVALID_CLUSTER)
|
||||
c=ClusersAlloc(p,c1,1,FALSE);
|
||||
c=ClustersAlloc(p,c1,1,FALSE);
|
||||
}
|
||||
}
|
||||
while (cnt>=spc) {
|
||||
@@ -248,7 +249,7 @@ Bool FWBlks(CFile *f,U8 *buf,I64 blk=FFB_NEXT_BLK,I64 cnt=1)
|
||||
c1=c;
|
||||
c=ClusterNumNext(p,c1,1);
|
||||
if (c==INVALID_CLUSTER)
|
||||
c=ClusersAlloc(p,c1,1,FALSE);
|
||||
c=ClustersAlloc(p,c1,1,FALSE);
|
||||
}
|
||||
}
|
||||
if (cnt>0) {
|
||||
@@ -260,8 +261,6 @@ Bool FWBlks(CFile *f,U8 *buf,I64 blk=FFB_NEXT_BLK,I64 cnt=1)
|
||||
}
|
||||
if (f->de.size<blk<<BLK_SIZE_BITS)
|
||||
f->de.size=blk<<BLK_SIZE_BITS;
|
||||
if (f->de.expanded_size<blk<<BLK_SIZE_BITS)
|
||||
f->de.expanded_size=blk<<BLK_SIZE_BITS;
|
||||
}
|
||||
f->fblk_num=blk;
|
||||
return TRUE;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
Bool CDirNew(CPrt *p,U8 *cur_dir,CDirEntry *tempm,Bool free_old_chain=TRUE)
|
||||
Bool DirNew(CPrt *p,U8 *cur_dir,CDirEntry *tempde,Bool free_old_chain=TRUE)
|
||||
{
|
||||
switch (p->type) {
|
||||
case PT_REDSEA:
|
||||
return RedSeaFSDirNew(p,cur_dir,tempm,free_old_chain);
|
||||
return RedSeaFSDirNew(p,cur_dir,tempde,free_old_chain);
|
||||
case PT_FAT32:
|
||||
return FAT32DirNew(p,cur_dir,tempm,free_old_chain);
|
||||
return FAT32DirNew(p,cur_dir,tempde,free_old_chain);
|
||||
case PT_ISO9660:
|
||||
PutDefineErr("ST_NOT_WRITABLE");
|
||||
return FALSE;
|
||||
@@ -14,48 +14,48 @@ Bool CDirNew(CPrt *p,U8 *cur_dir,CDirEntry *tempm,Bool free_old_chain=TRUE)
|
||||
}
|
||||
}
|
||||
|
||||
U0 CDirEntryDel(CDirEntry *tempm)
|
||||
U0 DirEntryDel(CDirEntry *tempde)
|
||||
{ //Doesn't Free user_data
|
||||
if (tempm) {
|
||||
Free(tempm->full_name);
|
||||
Free(tempm);
|
||||
if (tempde) {
|
||||
Free(tempde->full_name);
|
||||
Free(tempde);
|
||||
}
|
||||
}
|
||||
|
||||
U0 CDirEntryDel2(CDirEntry *tempm)
|
||||
U0 DirEntryDel2(CDirEntry *tempde)
|
||||
{ //Frees user_data
|
||||
if (tempm) {
|
||||
Free(tempm->full_name);
|
||||
Free(tempm->user_data);
|
||||
Free(tempm);
|
||||
if (tempde) {
|
||||
Free(tempde->full_name);
|
||||
Free(tempde->user_data);
|
||||
Free(tempde);
|
||||
}
|
||||
}
|
||||
|
||||
U0 CDirLstDel(CDirEntry *tempm)
|
||||
U0 DirLstDel(CDirEntry *tempde)
|
||||
{ //Doesn't Free user_data
|
||||
CDirEntry *tempm2;
|
||||
while (tempm) {
|
||||
tempm2=tempm->next;
|
||||
if (tempm->sub)
|
||||
CDirLstDel(tempm->sub);
|
||||
CDirEntryDel(tempm);
|
||||
tempm=tempm2;
|
||||
CDirEntry *tempde2;
|
||||
while (tempde) {
|
||||
tempde2=tempde->next;
|
||||
if (tempde->sub)
|
||||
DirLstDel(tempde->sub);
|
||||
DirEntryDel(tempde);
|
||||
tempde=tempde2;
|
||||
}
|
||||
}
|
||||
|
||||
U0 CDirLstDel2(CDirEntry *tempm)
|
||||
U0 DirLstDel2(CDirEntry *tempde)
|
||||
{ //Frees user_data
|
||||
CDirEntry *tempm2;
|
||||
while (tempm) {
|
||||
tempm2=tempm->next;
|
||||
if (tempm->sub)
|
||||
CDirLstDel2(tempm->sub);
|
||||
CDirEntryDel2(tempm);
|
||||
tempm=tempm2;
|
||||
CDirEntry *tempde2;
|
||||
while (tempde) {
|
||||
tempde2=tempde->next;
|
||||
if (tempde->sub)
|
||||
DirLstDel2(tempde->sub);
|
||||
DirEntryDel2(tempde);
|
||||
tempde=tempde2;
|
||||
}
|
||||
}
|
||||
|
||||
I64 CDirEntryCompare(CDirEntry *e1,CDirEntry *e2)
|
||||
I64 DirEntryCompare(CDirEntry *e1,CDirEntry *e2)
|
||||
{
|
||||
U8 buf1[CDIR_FILENAME_LEN],buf2[CDIR_FILENAME_LEN],
|
||||
buf3[CDIR_FILENAME_LEN],buf4[CDIR_FILENAME_LEN];
|
||||
@@ -77,67 +77,67 @@ I64 CDirEntryCompare(CDirEntry *e1,CDirEntry *e2)
|
||||
}
|
||||
}
|
||||
|
||||
U0 CDirFilesSort(CDirEntry **_tempm)
|
||||
U0 DirFilesSort(CDirEntry **_tempde)
|
||||
{
|
||||
I64 i,cnt=0;
|
||||
CDirEntry *tempm=*_tempm,*tempm1,**sort_buf;
|
||||
if (tempm) {
|
||||
tempm1=tempm;
|
||||
while (tempm1) {
|
||||
CDirEntry *tempde=*_tempde,*tempde1,**sort_buf;
|
||||
if (tempde) {
|
||||
tempde1=tempde;
|
||||
while (tempde1) {
|
||||
cnt++;
|
||||
tempm1=tempm1->next;
|
||||
tempde1=tempde1->next;
|
||||
}
|
||||
if (cnt>1) {
|
||||
sort_buf=MAlloc(cnt*sizeof(U8 *));
|
||||
i=0;
|
||||
tempm1=tempm;
|
||||
while (tempm1) {
|
||||
sort_buf[i++]=tempm1;
|
||||
tempm1=tempm1->next;
|
||||
tempde1=tempde;
|
||||
while (tempde1) {
|
||||
sort_buf[i++]=tempde1;
|
||||
tempde1=tempde1->next;
|
||||
}
|
||||
QSortI64(sort_buf,cnt,&CDirEntryCompare);
|
||||
tempm=sort_buf[0];
|
||||
*_tempm=tempm;
|
||||
QSortI64(sort_buf,cnt,&DirEntryCompare);
|
||||
tempde=sort_buf[0];
|
||||
*_tempde=tempde;
|
||||
for (i=0;i<cnt-1;i++) {
|
||||
tempm1=sort_buf[i];
|
||||
tempm1->next=sort_buf[i+1];
|
||||
tempde1=sort_buf[i];
|
||||
tempde1->next=sort_buf[i+1];
|
||||
}
|
||||
tempm1=sort_buf[i];
|
||||
tempm1->next=NULL;
|
||||
tempde1=sort_buf[i];
|
||||
tempde1->next=NULL;
|
||||
Free(sort_buf);
|
||||
|
||||
tempm1=tempm;
|
||||
while (tempm1) {
|
||||
if (tempm1->sub)
|
||||
CDirFilesSort(&tempm1->sub);
|
||||
tempm1=tempm1->next;
|
||||
tempde1=tempde;
|
||||
while (tempde1) {
|
||||
if (tempde1->sub)
|
||||
DirFilesSort(&tempde1->sub);
|
||||
tempde1=tempde1->next;
|
||||
}
|
||||
} else
|
||||
if (tempm->sub)
|
||||
CDirFilesSort(&tempm->sub);
|
||||
if (tempde->sub)
|
||||
DirFilesSort(&tempde->sub);
|
||||
}
|
||||
}
|
||||
|
||||
CDirEntry *CDirFilesFlatten(CDirEntry *tempm,CDirEntry **_result,I64 fuf_flags)
|
||||
CDirEntry *DirFilesFlatten(CDirEntry *tempde,CDirEntry **_result,I64 fuf_flags)
|
||||
{ //returns last node
|
||||
CDirEntry *tempm1;
|
||||
CDirEntry *tempde1;
|
||||
Bool del;
|
||||
if (tempm)
|
||||
if (tempde)
|
||||
while (TRUE) {
|
||||
tempm1=tempm->next;
|
||||
if (!(tempm->attr&_ATTR_DIR)||!(fuf_flags&FUF_JUST_FILES)) {
|
||||
_result=*_result=tempm;
|
||||
tempde1=tempde->next;
|
||||
if (!(tempde->attr&_ATTR_DIR)||!(fuf_flags&FUF_JUST_FILES)) {
|
||||
_result=*_result=tempde;
|
||||
del=FALSE;
|
||||
} else
|
||||
del=TRUE;
|
||||
if (tempm->sub) {
|
||||
_result=CDirFilesFlatten(tempm->sub,_result,fuf_flags);
|
||||
tempm->sub=NULL;
|
||||
if (tempde->sub) {
|
||||
_result=DirFilesFlatten(tempde->sub,_result,fuf_flags);
|
||||
tempde->sub=NULL;
|
||||
}
|
||||
if (del)
|
||||
CDirEntryDel(tempm);
|
||||
if (tempm1)
|
||||
tempm=tempm1;
|
||||
DirEntryDel(tempde);
|
||||
if (tempde1)
|
||||
tempde=tempde1;
|
||||
else
|
||||
break;
|
||||
}
|
||||
@@ -165,9 +165,9 @@ CDirEntry *SysFilesFind(U8 *files_find_mask,I64 fuf_flags)
|
||||
result=NULL;
|
||||
}
|
||||
if (result) {
|
||||
CDirFilesSort(&result);
|
||||
DirFilesSort(&result);
|
||||
if (fuf_flags&(FUF_FLATTEN_TREE|FUF_JUST_FILES))
|
||||
CDirFilesFlatten(result,&result,fuf_flags);
|
||||
DirFilesFlatten(result,&result,fuf_flags);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -180,7 +180,7 @@ U0 PutFileLink(U8 *filename,I64 line=0,Bool plain_text=FALSE)
|
||||
if (line)
|
||||
"%s,%04d",filename,line;
|
||||
else
|
||||
"" filename;
|
||||
"%s",filename;
|
||||
} else {
|
||||
buf=FileNameAbs(filename);
|
||||
if (plain_text) {
|
||||
@@ -203,7 +203,7 @@ U0 PutDirLink(U8 *dirname)
|
||||
U8 *buf;
|
||||
if (!dirname) return;
|
||||
if (IsRaw)
|
||||
"" dirname;
|
||||
"%s",dirname;
|
||||
else {
|
||||
buf=DirNameAbs(dirname);
|
||||
"$$MA+A,\"%s\",\"Cd(\\\"%s\\\");Dir;\n\"$$",dirname,buf;
|
||||
@@ -213,53 +213,49 @@ U0 PutDirLink(U8 *dirname)
|
||||
|
||||
U0 Dir2(U8 *files_find_mask,I64 fuf_flags,Bool full)
|
||||
{
|
||||
CDirEntry *tempm1=NULL,*tempm2;
|
||||
CDirEntry *tempde1=NULL,*tempde2;
|
||||
U8 *st;
|
||||
I64 csize=0xFFFF,esize=0xFFFF,c=0xFFFF;
|
||||
tempm1=SysFilesFind(files_find_mask,fuf_flags);
|
||||
I64 csize=0xFFFF,c=0xFFFF;
|
||||
tempde1=SysFilesFind(files_find_mask,fuf_flags);
|
||||
|
||||
if (!(st=CurDir))
|
||||
PutDefine("ST_INVALID_DRV");
|
||||
else {
|
||||
if (tempm1) {
|
||||
if (tempde1) {
|
||||
//Find max columns
|
||||
tempm2=tempm1;
|
||||
while (tempm2) {
|
||||
if (tempm2->size>csize)
|
||||
csize=tempm2->size;
|
||||
if (tempm2->expanded_size>esize)
|
||||
esize=tempm2->expanded_size;
|
||||
if (tempm2->cluster>c)
|
||||
c=tempm2->cluster;
|
||||
tempm2=tempm2->next;
|
||||
tempde2=tempde1;
|
||||
while (tempde2) {
|
||||
if (tempde2->size>csize)
|
||||
csize=tempde2->size;
|
||||
if (tempde2->cluster>c)
|
||||
c=tempde2->cluster;
|
||||
tempde2=tempde2->next;
|
||||
}
|
||||
csize=Bsr(csize)/4+1;
|
||||
esize=Bsr(esize)/4+1;
|
||||
c=Bsr(c)/4+1;
|
||||
|
||||
"$$MA+A,\"Directory\",\"PopUpCd;Dir;\n\"$$ of %s\n",st;
|
||||
if (full)
|
||||
"__DATE__ __TIME__ %*ts %*ts %*ts\n",
|
||||
csize,"SIZE",esize,"UNCMPSIZE",c,"CLUSTER";
|
||||
"__DATE__ __TIME__ %*ts %*ts\n",
|
||||
csize,"SIZE",c,"CLUSTER";
|
||||
else
|
||||
"DATE_ TIME_ %*ts\n",csize,"SIZE";
|
||||
while (tempm1) {
|
||||
tempm2=tempm1->next;
|
||||
while (tempde1) {
|
||||
tempde2=tempde1->next;
|
||||
if (full)
|
||||
"%D %T %0*tX %0*tX %0*tX ",tempm1->datetime,tempm1->datetime,
|
||||
csize,tempm1->size,esize,tempm1->expanded_size,
|
||||
c, tempm1->cluster;
|
||||
"%D %T %0*tX %0*tX ",tempde1->datetime,tempde1->datetime,
|
||||
csize,tempde1->size,c,tempde1->cluster;
|
||||
else
|
||||
"%h1D %h1T %0*tX ",tempm1->datetime,tempm1->datetime,
|
||||
csize,tempm1->size;
|
||||
if (tempm1->attr & _ATTR_DIR)
|
||||
PutDirLink(tempm1->name);
|
||||
"%h1D %h1T %0*tX ",tempde1->datetime,tempde1->datetime,
|
||||
csize,tempde1->size;
|
||||
if (tempde1->attr & _ATTR_DIR)
|
||||
PutDirLink(tempde1->name);
|
||||
else
|
||||
PutFileLink(tempm1->name);
|
||||
PutFileLink(tempde1->name);
|
||||
|
||||
NewLine;
|
||||
CDirEntryDel(tempm1);
|
||||
tempm1=tempm2;
|
||||
DirEntryDel(tempde1);
|
||||
tempde1=tempde2;
|
||||
}
|
||||
} else
|
||||
PutDefine("ST_NO_MATCHING_ENTRIES");
|
||||
|
||||
@@ -37,7 +37,7 @@ Bool IsDotC(U8 *filename)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Bool FilesFindMatch(U8 *files_find_mask,U8 *filename,I64 fuf_flags=0)
|
||||
Bool FilesFindMatch(U8 *pattern,U8 *files_find_mask,I64 fuf_flags=0)
|
||||
{
|
||||
U8 *st1=StrNew(files_find_mask),
|
||||
*st2=MAlloc(StrLen(files_find_mask)+1);
|
||||
@@ -46,25 +46,25 @@ Bool FilesFindMatch(U8 *files_find_mask,U8 *filename,I64 fuf_flags=0)
|
||||
StrFirstRem(st1,";",st2);
|
||||
if (*st2) {
|
||||
if (*st2=='~') {
|
||||
if (WildCardMatch(st2+1,filename)) {
|
||||
if (WildMatch(pattern,st2+1)) {
|
||||
result=FALSE;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (WildCardMatch(st2,filename)) {
|
||||
if (Bt(&fuf_flags,FUf_JUST_TXT_FILES) && !FilesFindMatch(FILENAME_MASK_TXT,filename)) {
|
||||
if (WildMatch(pattern,st2)) {
|
||||
if (Bt(&fuf_flags,FUf_JUST_TXT) && !FilesFindMatch(pattern,FILEMASK_TXT)) {
|
||||
result=FALSE;
|
||||
break;
|
||||
} else if (Bt(&fuf_flags,FUf_JUST_SRC_FILES) && !FilesFindMatch(FILENAME_MASK_SRC,filename)) {
|
||||
} else if (Bt(&fuf_flags,FUf_JUST_SRC) && !FilesFindMatch(pattern,FILEMASK_SRC)) {
|
||||
result=FALSE;
|
||||
break;
|
||||
} else if (Bt(&fuf_flags,FUf_JUST_AOT_FILES) && !FilesFindMatch(FILENAME_MASK_AOT,filename)) {
|
||||
} else if (Bt(&fuf_flags,FUf_JUST_AOT) && !FilesFindMatch(pattern,FILEMASK_AOT)) {
|
||||
result=FALSE;
|
||||
break;
|
||||
} else if (Bt(&fuf_flags,FUf_JUST_JIT_FILES) && !FilesFindMatch(FILENAME_MASK_JIT,filename)) {
|
||||
} else if (Bt(&fuf_flags,FUf_JUST_JIT) && !FilesFindMatch(pattern,FILEMASK_JIT)) {
|
||||
result=FALSE;
|
||||
break;
|
||||
} else if (Bt(&fuf_flags,FUf_JUST_GRA_FILES) && !FilesFindMatch(FILENAME_MASK_GRA,filename)) {
|
||||
} else if (Bt(&fuf_flags,FUf_JUST_GRA) && !FilesFindMatch(pattern,FILEMASK_GRA)) {
|
||||
result=FALSE;
|
||||
break;
|
||||
} else
|
||||
@@ -246,7 +246,7 @@ U8 *FileNameAbs(U8 *_filename,I64 fuf_flags=0)
|
||||
}
|
||||
|
||||
U8 *ChgExt(U8 *filename,U8 *extension)
|
||||
{//Change file name extension
|
||||
{//Change filename extension
|
||||
U8 *result=MAlloc(StrLen(filename)+1+StrLen(extension)+1);
|
||||
StrCpy(result,filename);
|
||||
if (FileExtDot(filename))
|
||||
@@ -267,19 +267,19 @@ U8 *DftExt(U8 *filename,U8 *extension)
|
||||
return result;
|
||||
}
|
||||
|
||||
CDirEntry *Cd2DirEntry(CDirEntry *tempm,U8 *abs_name)
|
||||
CDirEntry *Cd2DirEntry(CDirEntry *tempde,U8 *abs_name)
|
||||
{
|
||||
I64 i;
|
||||
while (tempm) {
|
||||
i=StrLen(tempm->full_name);
|
||||
if (StrNCmp(tempm->full_name,abs_name,i)||
|
||||
i && tempm->full_name[i-1]!='/' && abs_name[i] && abs_name[i]!='/')
|
||||
tempm=tempm->next;
|
||||
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 tempm;
|
||||
return tempde;
|
||||
else
|
||||
return Cd2DirEntry(tempm->sub,abs_name);
|
||||
return Cd2DirEntry(tempde->sub,abs_name);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -325,7 +325,7 @@ Strips file from dirname, scans for file upward until found or returns default.
|
||||
if (*_extension=='.')
|
||||
ext=StrNew(_extension);
|
||||
else
|
||||
ext=MSPrintF(".%s",_extension);
|
||||
ext=MPrint(".%s",_extension);
|
||||
} else
|
||||
ext=StrNew("");
|
||||
while (StrOcc(st,'/')&&!IsDir(st))
|
||||
@@ -336,10 +336,10 @@ Strips file from dirname, scans for file upward until found or returns default.
|
||||
StrLastRem(st2,"/",st3);
|
||||
|
||||
if (name)
|
||||
result=MSPrintF("%s/%s%s",st,name,ext);
|
||||
result=MPrint("%s/%s%s",st,name,ext);
|
||||
else {
|
||||
if (*ext)
|
||||
result=MSPrintF("%s/%s%s",st,st3,ext);
|
||||
result=MPrint("%s/%s%s",st,st3,ext);
|
||||
else
|
||||
result=StrNew(st);
|
||||
}
|
||||
@@ -369,6 +369,6 @@ U8 *ToggleZorNotZ(U8 *name)
|
||||
result=StrNew(name);
|
||||
result[StrLen(name)-2]=0;
|
||||
} else
|
||||
result=MSPrintF("%s.Z",name);
|
||||
result=MPrint("%s.Z",name);
|
||||
return result;
|
||||
}
|
||||
@@ -95,7 +95,7 @@ U0 FAT32Fmt(U8 drv_let,Bool quick=TRUE)
|
||||
br->copies_of_fat=2;
|
||||
br->media_desc=0xF8;
|
||||
br->sects=p->size;
|
||||
l=br->sects/br->sects_per_cluster/(BLK_SIZE/4)+1;
|
||||
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;
|
||||
@@ -120,8 +120,8 @@ U0 FAT32Fmt(U8 drv_let,Bool quick=TRUE)
|
||||
WBlks(p,fis,p->offset+br->file_system_info_sect,1);
|
||||
WBlks(p,br,p->offset,1);
|
||||
FAT32PrtInit(p);
|
||||
ClusersAlloc(p,0,1,FALSE); //Allocate #1
|
||||
br->root_cluster=ClusersAlloc(p,0,1,FALSE);
|
||||
ClustersAlloc(p,0,1,FALSE); //Allocate #1
|
||||
br->root_cluster=ClustersAlloc(p,0,1,FALSE);
|
||||
WBlks(p,br,p->offset,1);
|
||||
FAT32PrtInit(p);
|
||||
PrtUnlock(p);
|
||||
@@ -201,27 +201,27 @@ U8 fat_long_name_map[13]={
|
||||
offset(CFAT32DirEntryLong.name3)+2
|
||||
};
|
||||
|
||||
Bool CDirLongNameFill(CDirEntry *tempm,CFAT32DirEntryLong *de,I64 *xsum)
|
||||
Bool DirLongNameFill(CDirEntry *tempde,CFAT32DirEntryLong *de,I64 *xsum)
|
||||
{
|
||||
I64 i;
|
||||
U8 *ptr=de;
|
||||
if (de->ord&0x40) {
|
||||
MemSet(tempm,0,sizeof(CDirEntry));
|
||||
MemSet(tempde,0,sizeof(CDirEntry));
|
||||
*xsum=de->xsum;
|
||||
} else if (de->type || de->zero || de->xsum!=*xsum) {
|
||||
MemSet(tempm,0,sizeof(CDirEntry));
|
||||
MemSet(tempde,0,sizeof(CDirEntry));
|
||||
*xsum=0;
|
||||
return FALSE;
|
||||
}
|
||||
switch (de->ord&0x3F) {
|
||||
case 1:
|
||||
for (i=0;i<13;i++)
|
||||
if (!(tempm->name[i]=ptr[fat_long_name_map[i]]))
|
||||
if (!(tempde->name[i]=ptr[fat_long_name_map[i]]))
|
||||
return TRUE;
|
||||
break;
|
||||
case 2:
|
||||
for (i=0;i<12;i++)
|
||||
if (!(tempm->name[i+13]=ptr[fat_long_name_map[i]]))
|
||||
if (!(tempde->name[i+13]=ptr[fat_long_name_map[i]]))
|
||||
return TRUE;
|
||||
break;
|
||||
}
|
||||
@@ -229,21 +229,21 @@ Bool CDirLongNameFill(CDirEntry *tempm,CFAT32DirEntryLong *de,I64 *xsum)
|
||||
}
|
||||
|
||||
|
||||
Bool FAT32CDirFill(CDirEntry *tempm,CFAT32DirEntry *de)
|
||||
Bool FAT32CDirFill(CDirEntry *tempde,CFAT32DirEntry *de)
|
||||
{
|
||||
Bool result;
|
||||
if (*tempm->name)
|
||||
if (*tempde->name)
|
||||
result=TRUE;
|
||||
else
|
||||
result=FATFromName(tempm->name,de->name);
|
||||
tempm->cluster=de->cluster_lo+de->cluster_hi<<16;
|
||||
tempm->size=de->size;
|
||||
tempm->attr=de->attr;
|
||||
tempm->datetime=Dos2CDate(de->WrtTime,de->WrtDate);
|
||||
result=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);
|
||||
return result;
|
||||
}
|
||||
|
||||
Bool FAT32DirFill(CFAT32DirEntry *de,CDirEntry *tempm,I64 *_de_cnt=NULL)
|
||||
Bool FAT32DirFill(CFAT32DirEntry *de,CDirEntry *tempde,I64 *_de_cnt=NULL)
|
||||
{ //Fill up to 3 entries and store cnt of entries.
|
||||
I64 de_cnt=0,i,l,xsum,ord;
|
||||
U8 *ptr,dname[16];
|
||||
@@ -251,19 +251,19 @@ Bool FAT32DirFill(CFAT32DirEntry *de,CDirEntry *tempm,I64 *_de_cnt=NULL)
|
||||
Bool result;
|
||||
|
||||
MemSet(de,0,sizeof(CFAT32DirEntry));
|
||||
result=FATNameTo(de->name,tempm->name);
|
||||
result=FATNameTo(de->name,tempde->name);
|
||||
FATFromName(dname,de->name);
|
||||
if (StrCmp(dname,tempm->name)) {
|
||||
if (StrCmp(dname,tempde->name)) {
|
||||
ord=0x41;
|
||||
xsum=FATNameXSum(de->name);
|
||||
if ((l=StrLen(tempm->name))>13) {
|
||||
if ((l=StrLen(tempde->name))>13) {
|
||||
ptr=&ld[de_cnt];
|
||||
MemSet(ptr,0,sizeof(CFAT32DirEntryLong));
|
||||
ld[de_cnt].attr=_ATTR_LONG_NAME;
|
||||
ld[de_cnt].xsum=xsum;
|
||||
ld[de_cnt].ord=0x42;
|
||||
for (i=13;i<l;i++)
|
||||
ptr[fat_long_name_map[i-13]]=tempm->name[i];
|
||||
ptr[fat_long_name_map[i-13]]=tempde->name[i];
|
||||
i++;
|
||||
for (;i<26;i++)
|
||||
ptr[fat_long_name_map[i-13]](U16)=0xFFFF;
|
||||
@@ -277,22 +277,22 @@ Bool FAT32DirFill(CFAT32DirEntry *de,CDirEntry *tempm,I64 *_de_cnt=NULL)
|
||||
ld[de_cnt].xsum=xsum;
|
||||
ld[de_cnt].ord=ord;
|
||||
for (i=0;i<l;i++)
|
||||
ptr[fat_long_name_map[i]]=tempm->name[i];
|
||||
ptr[fat_long_name_map[i]]=tempde->name[i];
|
||||
i++;
|
||||
for (;i<13;i++)
|
||||
ptr[fat_long_name_map[i]](U16)=0xFFFF;
|
||||
de_cnt++;
|
||||
MemSet(&de[de_cnt],0,sizeof(CFAT32DirEntry));
|
||||
result=FATNameTo(de[de_cnt].name,tempm->name);
|
||||
result=FATNameTo(de[de_cnt].name,tempde->name);
|
||||
}
|
||||
de[de_cnt].cluster_lo=tempm->cluster.u16[0];
|
||||
de[de_cnt].cluster_hi=tempm->cluster.u16[1];
|
||||
if (!(tempm->attr&_ATTR_DIR))
|
||||
de[de_cnt].size=tempm->size;
|
||||
de[de_cnt].attr=tempm->attr;
|
||||
if (!tempm->datetime)
|
||||
tempm->datetime=GetCurTimeDate;
|
||||
CDate2Dos(&de[de_cnt].WrtTime,&de[de_cnt].WrtDate,tempm->datetime);
|
||||
de[de_cnt].cluster_lo=tempde->cluster.u16[0];
|
||||
de[de_cnt].cluster_hi=tempde->cluster.u16[1];
|
||||
if (!(tempde->attr&_ATTR_DIR))
|
||||
de[de_cnt].size=tempde->size;
|
||||
de[de_cnt].attr=tempde->attr;
|
||||
if (!tempde->datetime)
|
||||
tempde->datetime=GetDateTime;
|
||||
CDate2Dos(&de[de_cnt].WrtTime,&de[de_cnt].WrtDate,tempde->datetime);
|
||||
if (_de_cnt)
|
||||
*_de_cnt=de_cnt+1;
|
||||
return result;
|
||||
@@ -319,14 +319,14 @@ Bool FAT32FileFind(CPrt *p,I64 cur_dir_cluster,U8 *name,CDirEntry *_result,I64 f
|
||||
try {
|
||||
unlock=PrtLock(p);
|
||||
buf=MAlloc(BLK_SIZE*p->spc);
|
||||
entries_per_cluster=FAT32_ENTRIES_PER_BLK*p->spc;
|
||||
entries_per_cluster=p->spc<<FAT32_ENTRIES_BITS;
|
||||
RClusters(p,buf,cur_dir_cluster,1);
|
||||
cur_dir_entry=0;
|
||||
while (ch=*buf[cur_dir_entry].name) {
|
||||
attr=buf[cur_dir_entry].attr;
|
||||
if (ch!=0xE5) {
|
||||
if (attr&_ATTR_LONG_NAME_MASK==_ATTR_LONG_NAME)
|
||||
CDirLongNameFill(&long_name,&buf[cur_dir_entry],&xsum);
|
||||
DirLongNameFill(&long_name,&buf[cur_dir_entry],&xsum);
|
||||
else {
|
||||
if (!(attr&_ATTR_VOL_ID)) {
|
||||
if (xsum==FATNameXSum(buf[cur_dir_entry].name))
|
||||
@@ -601,7 +601,7 @@ I64 FAT32AllocContiguousClusters(CPrt *p,I64 cnt)
|
||||
return first;
|
||||
}
|
||||
|
||||
Bool FAT32DirNew(CPrt *p,U8 *cur_dir,CDirEntry *tempm,Bool free_old_chain)
|
||||
Bool FAT32DirNew(CPrt *p,U8 *cur_dir,CDirEntry *tempde,Bool free_old_chain)
|
||||
{
|
||||
//See $LK-A,"::/TempleOS/Doc/CutCorners.TXT"$.
|
||||
CFAT32DirEntry *buf,*last_buf,*temp_buf,de[3];
|
||||
@@ -611,7 +611,7 @@ Bool FAT32DirNew(CPrt *p,U8 *cur_dir,CDirEntry *tempm,Bool free_old_chain)
|
||||
U8 ch;
|
||||
Bool written=FALSE,unlock,unlock_break;
|
||||
CDirEntry long_name;
|
||||
FAT32DirFill(&de,tempm,&de_cnt);
|
||||
FAT32DirFill(&de,tempde,&de_cnt);
|
||||
MemSet(&long_name,0,sizeof(CDirEntry));
|
||||
try {
|
||||
unlock_break=BreakLock;
|
||||
@@ -619,13 +619,13 @@ Bool FAT32DirNew(CPrt *p,U8 *cur_dir,CDirEntry *tempm,Bool free_old_chain)
|
||||
cur_dir_cluster=Name2DirCluster(p,cur_dir);
|
||||
buf =MAlloc(BLK_SIZE*p->spc);
|
||||
last_buf=CAlloc(BLK_SIZE*p->spc);
|
||||
entries_per_cluster=FAT32_ENTRIES_PER_BLK*p->spc;
|
||||
entries_per_cluster=p->spc<<FAT32_ENTRIES_BITS;
|
||||
RClusters(p,buf,cur_dir_cluster,1);
|
||||
cur_dir_entry=0;
|
||||
while (ch=*buf[cur_dir_entry].name) {
|
||||
attr=buf[cur_dir_entry].attr;
|
||||
if (ch!=0xE5 && attr&_ATTR_LONG_NAME_MASK==_ATTR_LONG_NAME)
|
||||
CDirLongNameFill(&long_name,&buf[cur_dir_entry],&xsum);
|
||||
DirLongNameFill(&long_name,&buf[cur_dir_entry],&xsum);
|
||||
else {
|
||||
avail_cnt=FAT32_ENTRIES_PER_BLK-cur_dir_entry & (FAT32_ENTRIES_PER_BLK-1);
|
||||
for (i=0;i<avail_cnt;i++)
|
||||
@@ -638,7 +638,7 @@ Bool FAT32DirNew(CPrt *p,U8 *cur_dir,CDirEntry *tempm,Bool free_old_chain)
|
||||
MemCpy(&buf[cur_dir_entry],&de,de_cnt*sizeof(CFAT32DirEntry));
|
||||
WBlks(p,&buf[cur_dir_entry & -FAT32_ENTRIES_PER_BLK],
|
||||
p->data+cur_dir_cluster*p->spc
|
||||
+cur_dir_entry/FAT32_ENTRIES_PER_BLK,1);
|
||||
+cur_dir_entry>>FAT32_ENTRIES_BITS,1);
|
||||
cur_dir_entry+=de_cnt-1; //gets inc'ed
|
||||
written=TRUE;
|
||||
} else if (ch!=0xE5 && !(attr&_ATTR_VOL_ID)) {
|
||||
@@ -647,7 +647,7 @@ Bool FAT32DirNew(CPrt *p,U8 *cur_dir,CDirEntry *tempm,Bool free_old_chain)
|
||||
if (!*long_name.name)
|
||||
FATFromName(long_name.name,buf[cur_dir_entry].name);
|
||||
//Del old entry with same name
|
||||
if (!StrCmp(long_name.name,tempm->name)) {
|
||||
if (!StrCmp(long_name.name,tempde->name)) {
|
||||
if (free_old_chain)
|
||||
FAT32FreeClusters(p,buf[cur_dir_entry].cluster_lo+
|
||||
buf[cur_dir_entry].cluster_hi<<16);
|
||||
@@ -655,7 +655,7 @@ Bool FAT32DirNew(CPrt *p,U8 *cur_dir,CDirEntry *tempm,Bool free_old_chain)
|
||||
MemCpy(&buf[cur_dir_entry],&de[de_cnt-1],sizeof(CFAT32DirEntry));
|
||||
WBlks(p,&buf[cur_dir_entry & -FAT32_ENTRIES_PER_BLK],
|
||||
p->data+cur_dir_cluster*p->spc
|
||||
+cur_dir_entry/FAT32_ENTRIES_PER_BLK,1);
|
||||
+cur_dir_entry>>FAT32_ENTRIES_BITS,1);
|
||||
written=TRUE;
|
||||
} else {
|
||||
*buf[cur_dir_entry].name=0xE5;
|
||||
@@ -666,8 +666,8 @@ Bool FAT32DirNew(CPrt *p,U8 *cur_dir,CDirEntry *tempm,Bool free_old_chain)
|
||||
i--;
|
||||
WBlks(p,&buf[(cur_dir_entry-i)&-FAT32_ENTRIES_PER_BLK],
|
||||
p->data+cur_dir_cluster*p->spc
|
||||
+(cur_dir_entry-i)/FAT32_ENTRIES_PER_BLK,
|
||||
(i+FAT32_ENTRIES_PER_BLK)/FAT32_ENTRIES_PER_BLK);
|
||||
+(cur_dir_entry-i)>>FAT32_ENTRIES_BITS,
|
||||
(i+FAT32_ENTRIES_PER_BLK)>>FAT32_ENTRIES_BITS);
|
||||
if (i==cur_dir_entry && 0<last_dir_cluster<0x0FFFFFF8) {
|
||||
i=1;
|
||||
while (i<=entries_per_cluster &&
|
||||
@@ -676,8 +676,8 @@ Bool FAT32DirNew(CPrt *p,U8 *cur_dir,CDirEntry *tempm,Bool free_old_chain)
|
||||
if (--i>0)
|
||||
WBlks(p,&buf[(entries_per_cluster-i)&-FAT32_ENTRIES_PER_BLK],
|
||||
p->data+last_dir_cluster*p->spc
|
||||
+(entries_per_cluster-i)/FAT32_ENTRIES_PER_BLK,
|
||||
(i+FAT32_ENTRIES_PER_BLK-1)/FAT32_ENTRIES_PER_BLK);
|
||||
+(entries_per_cluster-i)>>FAT32_ENTRIES_BITS,
|
||||
(i+FAT32_ENTRIES_PER_BLK-1)>>FAT32_ENTRIES_BITS);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -690,7 +690,7 @@ Bool FAT32DirNew(CPrt *p,U8 *cur_dir,CDirEntry *tempm,Bool free_old_chain)
|
||||
temp_buf=buf; buf=last_buf; last_buf=temp_buf;
|
||||
c=ClusterNumNext(p,cur_dir_cluster);
|
||||
if (!(0<c<0x0FFFFFF8)) {
|
||||
c=ClusersAlloc(p,cur_dir_cluster,1,FALSE);
|
||||
c=ClustersAlloc(p,cur_dir_cluster,1,FALSE);
|
||||
MemSet(buf,0,BLK_SIZE*p->spc);
|
||||
WClusters(p,buf,c,1);
|
||||
} else
|
||||
@@ -706,12 +706,12 @@ Bool FAT32DirNew(CPrt *p,U8 *cur_dir,CDirEntry *tempm,Bool free_old_chain)
|
||||
*buf[cur_dir_entry+i].name=0xE5;
|
||||
WBlks(p,&buf[cur_dir_entry &-FAT32_ENTRIES_PER_BLK],
|
||||
p->data+cur_dir_cluster*p->spc
|
||||
+cur_dir_entry/FAT32_ENTRIES_PER_BLK,1);
|
||||
+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=ClusersAlloc(p,cur_dir_cluster,1);
|
||||
cur_dir_cluster=ClustersAlloc(p,cur_dir_cluster,1);
|
||||
cur_dir_entry=0;
|
||||
MemSet(buf,0,BLK_SIZE*p->spc);
|
||||
WClusters(p,buf,cur_dir_cluster,1);
|
||||
@@ -720,17 +720,17 @@ Bool FAT32DirNew(CPrt *p,U8 *cur_dir,CDirEntry *tempm,Bool free_old_chain)
|
||||
MemCpy(&buf[cur_dir_entry],&de,de_cnt*sizeof(CFAT32DirEntry));
|
||||
WBlks(p,&buf[cur_dir_entry &-FAT32_ENTRIES_PER_BLK],
|
||||
p->data+cur_dir_cluster*p->spc+
|
||||
cur_dir_entry/FAT32_ENTRIES_PER_BLK,1);
|
||||
cur_dir_entry>>FAT32_ENTRIES_BITS,1);
|
||||
cur_dir_entry+=de_cnt;
|
||||
if (cur_dir_entry==entries_per_cluster) {
|
||||
cur_dir_cluster=ClusersAlloc(p,cur_dir_cluster,1);
|
||||
cur_dir_cluster=ClustersAlloc(p,cur_dir_cluster,1);
|
||||
MemSet(buf,0,BLK_SIZE*p->spc);
|
||||
WClusters(p,buf,cur_dir_cluster,1);
|
||||
} else {
|
||||
MemSet(&buf[cur_dir_entry],0,sizeof(CFAT32DirEntry));
|
||||
WBlks(p,&buf[cur_dir_entry &-FAT32_ENTRIES_PER_BLK],
|
||||
p->data+cur_dir_cluster*p->spc
|
||||
+cur_dir_entry/FAT32_ENTRIES_PER_BLK,1);
|
||||
+cur_dir_entry>>FAT32_ENTRIES_BITS,1);
|
||||
}
|
||||
}
|
||||
Free(last_buf);
|
||||
@@ -764,14 +764,14 @@ I64 FAT32FilesDel(CPrt *p,U8 *cur_dir,U8 *files_find_mask,I64 fuf_flags,
|
||||
cur_dir_cluster=Name2DirCluster(p,cur_dir);
|
||||
buf =MAlloc(BLK_SIZE*p->spc);
|
||||
last_buf=CAlloc(BLK_SIZE*p->spc);
|
||||
entries_per_cluster=FAT32_ENTRIES_PER_BLK*p->spc;
|
||||
entries_per_cluster=p->spc<<FAT32_ENTRIES_BITS;
|
||||
RClusters(p,buf,cur_dir_cluster,1);
|
||||
cur_dir_entry=0;
|
||||
while (ch=*buf[cur_dir_entry].name) {
|
||||
attr=buf[cur_dir_entry].attr;
|
||||
if (ch!=0xE5 && ch!='.') {
|
||||
if (attr&_ATTR_LONG_NAME_MASK==_ATTR_LONG_NAME)
|
||||
CDirLongNameFill(&long_name,&buf[cur_dir_entry],&xsum);
|
||||
DirLongNameFill(&long_name,&buf[cur_dir_entry],&xsum);
|
||||
else {
|
||||
if (!(attr & _ATTR_VOL_ID) &&
|
||||
(del_dir || !(attr & _ATTR_DIR))) {
|
||||
@@ -779,11 +779,11 @@ I64 FAT32FilesDel(CPrt *p,U8 *cur_dir,U8 *files_find_mask,I64 fuf_flags,
|
||||
MemSet(&long_name,0,sizeof(CDirEntry));
|
||||
if (!*long_name.name)
|
||||
FATFromName(long_name.name,buf[cur_dir_entry].name);
|
||||
if (FilesFindMatch(files_find_mask,long_name.name,fuf_flags)) {
|
||||
if (FilesFindMatch(long_name.name,files_find_mask,fuf_flags)) {
|
||||
if (!(attr & _ATTR_DIR)) result++;
|
||||
if (print_msg) {
|
||||
PutDefine("ST_DELETE");
|
||||
"" long_name.name;
|
||||
"%s",long_name.name;
|
||||
NewLine;
|
||||
}
|
||||
*buf[cur_dir_entry].name=0xE5;
|
||||
@@ -794,8 +794,8 @@ I64 FAT32FilesDel(CPrt *p,U8 *cur_dir,U8 *files_find_mask,I64 fuf_flags,
|
||||
i--;
|
||||
WBlks(p,&buf[(cur_dir_entry-i)&-FAT32_ENTRIES_PER_BLK],
|
||||
p->data+cur_dir_cluster*p->spc
|
||||
+(cur_dir_entry-i)/FAT32_ENTRIES_PER_BLK,
|
||||
(i+FAT32_ENTRIES_PER_BLK)/FAT32_ENTRIES_PER_BLK);
|
||||
+(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 &&
|
||||
@@ -804,8 +804,8 @@ I64 FAT32FilesDel(CPrt *p,U8 *cur_dir,U8 *files_find_mask,I64 fuf_flags,
|
||||
if (--i>0)
|
||||
WBlks(p,&buf[(entries_per_cluster-i)&-FAT32_ENTRIES_PER_BLK],
|
||||
p->data+last_dir_cluster*p->spc
|
||||
+(entries_per_cluster-i)/FAT32_ENTRIES_PER_BLK,
|
||||
(i+FAT32_ENTRIES_PER_BLK-1)/FAT32_ENTRIES_PER_BLK);
|
||||
+(entries_per_cluster-i)>>FAT32_ENTRIES_BITS,
|
||||
(i+FAT32_ENTRIES_PER_BLK-1)>>FAT32_ENTRIES_BITS);
|
||||
}
|
||||
FAT32FreeClusters(p,buf[cur_dir_entry].cluster_lo+
|
||||
buf[cur_dir_entry].cluster_hi<<16);
|
||||
@@ -848,7 +848,7 @@ I64 FAT32FileWrite(CPrt *p,U8 *cur_dir,U8 *name,U8 *buf,I64 size,
|
||||
if (_ac2) *_ac2=NULL;
|
||||
if (size<0) size=0;
|
||||
if (!cdt)
|
||||
cdt=GetCurTimeDate;
|
||||
cdt=GetDateTime;
|
||||
if (p->type!=PT_FAT32)
|
||||
PutDefine("ST_NOT_FAT32");
|
||||
else if (!CFileNameTo(de.name,name))
|
||||
@@ -867,7 +867,7 @@ I64 FAT32FileWrite(CPrt *p,U8 *cur_dir,U8 *name,U8 *buf,I64 size,
|
||||
}
|
||||
de.size=size;
|
||||
if (blk_cnt=(size+BLK_SIZE-1)>>BLK_SIZE_BITS)
|
||||
c=ClusersAlloc(p,0,(blk_cnt+p->spc-1)/p->spc,contiguous);
|
||||
c=ClustersAlloc(p,0,(blk_cnt+p->spc-1)/p->spc,contiguous);
|
||||
else
|
||||
c=0x0FFFFFFF;
|
||||
de.cluster=c;
|
||||
@@ -891,7 +891,7 @@ CDirEntry *FAT32FilesFind(U8 *files_find_mask,I64 fuf_flags,CDirEntry *parent=NU
|
||||
I64 attr,xsum=0,dir_size=0,sub_dir_size,
|
||||
cur_dir_cluster,cur_dir_entry,entries_per_cluster;
|
||||
U8 ch;
|
||||
CDirEntry *result=NULL,*tempm,long_name;
|
||||
CDirEntry *result=NULL,*tempde,long_name;
|
||||
if (fuf_flags&~FUG_FILES_FIND)
|
||||
throw(EXCEPT_FUF,7);
|
||||
try {
|
||||
@@ -899,7 +899,7 @@ CDirEntry *FAT32FilesFind(U8 *files_find_mask,I64 fuf_flags,CDirEntry *parent=NU
|
||||
PrtLock(p);
|
||||
cur_dir_cluster=Name2DirCluster(p,Fs->cur_dir);
|
||||
buf=MAlloc(BLK_SIZE*p->spc);
|
||||
entries_per_cluster=FAT32_ENTRIES_PER_BLK*p->spc;
|
||||
entries_per_cluster=p->spc<<FAT32_ENTRIES_BITS;
|
||||
RClusters(Fs->cur_prt,buf,cur_dir_cluster,1);
|
||||
dir_size+=Fs->cur_prt->spc*BLK_SIZE;
|
||||
cur_dir_entry=0;
|
||||
@@ -907,37 +907,37 @@ CDirEntry *FAT32FilesFind(U8 *files_find_mask,I64 fuf_flags,CDirEntry *parent=NU
|
||||
attr=buf[cur_dir_entry].attr;
|
||||
if (ch!=0xE5) {
|
||||
if (attr&_ATTR_LONG_NAME_MASK==_ATTR_LONG_NAME)
|
||||
CDirLongNameFill(&long_name,&buf[cur_dir_entry],&xsum);
|
||||
DirLongNameFill(&long_name,&buf[cur_dir_entry],&xsum);
|
||||
else {
|
||||
if (!(attr&_ATTR_VOL_ID)) {
|
||||
tempm=MAlloc(sizeof(CDirEntry));
|
||||
tempde=MAlloc(sizeof(CDirEntry));
|
||||
if (xsum==FATNameXSum(buf[cur_dir_entry].name))
|
||||
MemCpy(tempm,&long_name,sizeof(CDirEntry));
|
||||
MemCpy(tempde,&long_name,sizeof(CDirEntry));
|
||||
else
|
||||
MemSet(tempm,0,sizeof(CDirEntry));
|
||||
if (FAT32CDirFill(tempm,&buf[cur_dir_entry])) {
|
||||
tempm->parent=parent;
|
||||
if (Bt(&fuf_flags,FUf_RECURSE) && attr&_ATTR_DIR && *tempm->name!='.') {
|
||||
tempm->next=result;
|
||||
result=tempm;
|
||||
tempm->full_name=DirNameAbs(tempm->name);
|
||||
MemSet(tempde,0,sizeof(CDirEntry));
|
||||
if (FAT32CDirFill(tempde,&buf[cur_dir_entry])) {
|
||||
tempde->parent=parent;
|
||||
if (Bt(&fuf_flags,FUf_RECURSE) && attr&_ATTR_DIR && *tempde->name!='.') {
|
||||
tempde->next=result;
|
||||
result=tempde;
|
||||
tempde->full_name=DirNameAbs(tempde->name);
|
||||
PrtUnlock(p);
|
||||
if (Cd(tempm->name)) {
|
||||
tempm->sub=FAT32FilesFind(files_find_mask,fuf_flags,tempm,&sub_dir_size);
|
||||
tempm->size=tempm->expanded_size=sub_dir_size;
|
||||
if (Cd(tempde->name)) {
|
||||
tempde->sub=FAT32FilesFind(files_find_mask,fuf_flags,tempde,&sub_dir_size);
|
||||
tempde->size=sub_dir_size;
|
||||
Cd("..");
|
||||
}
|
||||
PrtLock(p);
|
||||
} else if ((attr&_ATTR_DIR || !Bt(&fuf_flags,FUf_JUST_DIRS)) &&
|
||||
!(Bt(&fuf_flags,FUf_RECURSE) && *tempm->name=='.' && attr&_ATTR_DIR) &&
|
||||
FilesFindMatch(files_find_mask,tempm->name,fuf_flags)) {
|
||||
tempm->next=result;
|
||||
result=tempm;
|
||||
tempm->full_name=FileNameAbs(tempm->name);
|
||||
!(Bt(&fuf_flags,FUf_RECURSE) && *tempde->name=='.' && attr&_ATTR_DIR) &&
|
||||
FilesFindMatch(tempde->name,files_find_mask,fuf_flags)) {
|
||||
tempde->next=result;
|
||||
result=tempde;
|
||||
tempde->full_name=FileNameAbs(tempde->name);
|
||||
} else
|
||||
CDirEntryDel(tempm);
|
||||
DirEntryDel(tempde);
|
||||
} else
|
||||
CDirEntryDel(tempm);
|
||||
DirEntryDel(tempde);
|
||||
}
|
||||
MemSet(&long_name,0,sizeof(CDirEntry));
|
||||
}
|
||||
@@ -982,7 +982,7 @@ Bool FAT32MkDir(CPrt *p,U8 *cur_dir,U8 *name)
|
||||
d_native.name[1]=0;
|
||||
d_native.cluster=c;
|
||||
d_native.size=0;
|
||||
d_native.datetime=GetCurTimeDate;
|
||||
d_native.datetime=GetDateTime;
|
||||
FAT32DirFill(dFAT,&d_native);
|
||||
dFAT++;
|
||||
|
||||
@@ -993,7 +993,7 @@ Bool FAT32MkDir(CPrt *p,U8 *cur_dir,U8 *name)
|
||||
d_native.name[2]=0;
|
||||
d_native.cluster=cur_dir_cluster;
|
||||
d_native.size=0;
|
||||
d_native.datetime=GetCurTimeDate;
|
||||
d_native.datetime=GetDateTime;
|
||||
FAT32DirFill(dFAT,&d_native);
|
||||
WClusters(p,buf,c,1);
|
||||
Free(buf);
|
||||
|
||||
@@ -21,7 +21,7 @@ Bool ISOPrtInit(CPrt *p,I64 blk)
|
||||
RBlks(p,iso,i*spc,spc);
|
||||
buf[0](U32)=iso->id[0](U32);
|
||||
buf[4](U16)=iso->id[4](U8);
|
||||
switch (LstEntryMatch(buf,"CD001\0CDW02\0BEA01\0BOOT2\0NSR02\0NSR03\0TEA01\0",LEF_EXACT)) {
|
||||
switch (LstMatch(buf,"CD001\0CDW02\0BEA01\0BOOT2\0NSR02\0NSR03\0TEA01\0",LMF_EXACT)) {
|
||||
case 0:
|
||||
p->type=PT_ISO9660;
|
||||
switch (iso->type) {
|
||||
@@ -112,25 +112,17 @@ Bool ISO1FromName(U8 *dst,U8 *src)
|
||||
return FileNameChk(dst);
|
||||
}
|
||||
|
||||
Bool ISO1CDirFill(CPrt *p,CDirEntry *tempm,CISO1DirEntry *de)
|
||||
Bool ISO1CDirFill(CDirEntry *tempde,CISO1DirEntry *de)
|
||||
{
|
||||
Bool result;
|
||||
CArcCompress *buf;
|
||||
MemSet(tempm,0,sizeof(CDirEntry));
|
||||
result=ISO1FromName(tempm->name,&de->name_len);
|
||||
tempm->cluster=de->loc.little;
|
||||
tempm->size=de->size.little;
|
||||
tempm->attr=FileAttr(tempm->name);
|
||||
MemSet(tempde,0,sizeof(CDirEntry));
|
||||
result=ISO1FromName(tempde->name,&de->name_len);
|
||||
tempde->cluster=de->loc.little;
|
||||
tempde->size=de->size.little;
|
||||
tempde->attr=FileAttr(tempde->name);
|
||||
if (de->flags & ISO1_ATTR_DIR)
|
||||
tempm->attr|=_ATTR_DIR;
|
||||
tempm->datetime=ISO1DateStruct2CDate(&de->date);
|
||||
if (tempm->attr & _ATTR_COMPRESSED) {
|
||||
buf=MAlloc(BLK_SIZE);
|
||||
RClustersBlks(p,buf,tempm->cluster,1);
|
||||
tempm->expanded_size=buf->expanded_size;
|
||||
Free(buf);
|
||||
} else
|
||||
tempm->expanded_size=tempm->size;
|
||||
tempde->attr|=_ATTR_DIR;
|
||||
tempde->datetime=ISO1DateStruct2CDate(&de->date);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -169,7 +161,7 @@ Bool ISO1FileFind(CPrt *p,I64 cur_dir_cluster,U8 *name,CDirEntry *_result,I64 fu
|
||||
ISO1FromName(dname,&isoptr->name_len);
|
||||
if (*dname) {
|
||||
if (!StrCmp(name,dname)) {
|
||||
result=ISO1CDirFill(p,_result,isoptr);
|
||||
result=ISO1CDirFill(_result,isoptr);
|
||||
if (result &&
|
||||
!(fuf_flags&FUF_JUST_DIRS && !(_result->attr & _ATTR_DIR)) &&
|
||||
!(fuf_flags&FUF_JUST_FILES && _result->attr & _ATTR_DIR) )
|
||||
@@ -262,7 +254,7 @@ CDirEntry *ISO1FilesFind(U8 *files_find_mask,I64 fuf_flags,CDirEntry *parent=NUL
|
||||
CPrt *p=Fs->cur_prt;
|
||||
CISO1DirEntry *buf,*buf2,*isoptr;
|
||||
I64 i,cur_dir_cluster=Name2DirCluster(p,Fs->cur_dir);
|
||||
CDirEntry *result=NULL,*tempm;
|
||||
CDirEntry *result=NULL,*tempde;
|
||||
if (fuf_flags&~FUG_FILES_FIND)
|
||||
throw(EXCEPT_FUF,9);
|
||||
isoptr=MAlloc(p->spc<<BLK_SIZE_BITS);
|
||||
@@ -283,27 +275,27 @@ CDirEntry *ISO1FilesFind(U8 *files_find_mask,I64 fuf_flags,CDirEntry *parent=NUL
|
||||
buf(U8 *)++;
|
||||
i--;
|
||||
} else {
|
||||
tempm=MAlloc(sizeof(CDirEntry));
|
||||
if (ISO1CDirFill(Fs->cur_prt,tempm,buf)) {
|
||||
tempm->parent=parent;
|
||||
if (Bt(&fuf_flags,FUf_RECURSE) && tempm->attr&_ATTR_DIR && *tempm->name!='.') {
|
||||
tempm->next=result;
|
||||
result=tempm;
|
||||
tempm->full_name=DirNameAbs(tempm->name);
|
||||
if (Cd(tempm->name)) {
|
||||
tempm->sub=ISO1FilesFind(files_find_mask,fuf_flags,tempm);
|
||||
tempde=MAlloc(sizeof(CDirEntry));
|
||||
if (ISO1CDirFill(tempde,buf)) {
|
||||
tempde->parent=parent;
|
||||
if (Bt(&fuf_flags,FUf_RECURSE) && tempde->attr&_ATTR_DIR && *tempde->name!='.') {
|
||||
tempde->next=result;
|
||||
result=tempde;
|
||||
tempde->full_name=DirNameAbs(tempde->name);
|
||||
if (Cd(tempde->name)) {
|
||||
tempde->sub=ISO1FilesFind(files_find_mask,fuf_flags,tempde);
|
||||
Cd("..");
|
||||
}
|
||||
} else if ((tempm->attr & _ATTR_DIR || !Bt(&fuf_flags,FUf_JUST_DIRS)) &&
|
||||
!(Bt(&fuf_flags,FUf_RECURSE) && *tempm->name=='.' && tempm->attr&_ATTR_DIR) &&
|
||||
FilesFindMatch(files_find_mask,tempm->name,fuf_flags)) {
|
||||
tempm->next=result;
|
||||
result=tempm;
|
||||
tempm->full_name=FileNameAbs(tempm->name);
|
||||
} else if ((tempde->attr & _ATTR_DIR || !Bt(&fuf_flags,FUf_JUST_DIRS)) &&
|
||||
!(Bt(&fuf_flags,FUf_RECURSE) && *tempde->name=='.' && tempde->attr&_ATTR_DIR) &&
|
||||
FilesFindMatch(tempde->name,files_find_mask,fuf_flags)) {
|
||||
tempde->next=result;
|
||||
result=tempde;
|
||||
tempde->full_name=FileNameAbs(tempde->name);
|
||||
} else
|
||||
CDirEntryDel(tempm);
|
||||
DirEntryDel(tempde);
|
||||
} else
|
||||
CDirEntryDel(tempm);
|
||||
DirEntryDel(tempde);
|
||||
i-=buf->len;
|
||||
buf(U8 *)+=buf->len;
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ U0 RedSeaFSFmt(U8 drv_let,Bool quick=TRUE)
|
||||
n=br->sects_per_cluster*(BLK_SIZE<<3);
|
||||
n=(br->sects+n-1)/n;
|
||||
br->bitmap_sects=n;
|
||||
br->unique_id=GetTimeStamp>>4;
|
||||
br->unique_id=GetTSC>>4;
|
||||
br->root_cluster=0;
|
||||
|
||||
if (quick)
|
||||
@@ -144,8 +144,8 @@ U0 RedSeaFSFmt(U8 drv_let,Bool quick=TRUE)
|
||||
|
||||
WBlks(p,br,p->offset,1);
|
||||
RedSeaFSPrtInit(p);
|
||||
ClusersAlloc(p,0,1,FALSE); //Alloc #1
|
||||
br->root_cluster=ClusersAlloc(p,0,1,FALSE);
|
||||
ClustersAlloc(p,0,1,FALSE); //Alloc #1
|
||||
br->root_cluster=ClustersAlloc(p,0,1,FALSE);
|
||||
WBlks(p,br,p->offset,1);
|
||||
root_dir=CAlloc(p->spc<<BLK_SIZE_BITS);
|
||||
|
||||
@@ -155,8 +155,7 @@ U0 RedSeaFSFmt(U8 drv_let,Bool quick=TRUE)
|
||||
*d_native->name='.';
|
||||
d_native->cluster=br->root_cluster;
|
||||
d_native->size=p->spc<<BLK_SIZE_BITS;
|
||||
d_native->expanded_size=d_native->size;
|
||||
d_native->datetime=GetCurTimeDate;
|
||||
d_native->datetime=GetDateTime;
|
||||
|
||||
d_native(U8 *)+=CDIR_SIZE;
|
||||
|
||||
@@ -164,7 +163,7 @@ U0 RedSeaFSFmt(U8 drv_let,Bool quick=TRUE)
|
||||
d_native->name[1]='.';
|
||||
d_native->attr=_ATTR_DIR|_ATTR_CONTIGUOUS;
|
||||
d_native->cluster=br->root_cluster;
|
||||
d_native->datetime=GetCurTimeDate;
|
||||
d_native->datetime=GetDateTime;
|
||||
|
||||
WBlks(p,root_dir,p->data+br->root_cluster*p->spc,p->spc);
|
||||
RedSeaFSPrtInit(p);
|
||||
@@ -253,10 +252,6 @@ U8 *RedSeaFSFileRead(CPrt *p,U8 *cur_dir,U8 *filename,I64 *_size,
|
||||
buf=MAlloc(blk_cnt<<BLK_SIZE_BITS+1);
|
||||
c=de.cluster;
|
||||
c=RClustersBlks(p,buf,c,blk_cnt);
|
||||
if (de.xsum) {
|
||||
if (de.xsum^ArcXSum(buf,de.size) !=TEMPLEOS_XSUM)
|
||||
throw(EXCEPT_ARC_XSUM);
|
||||
}
|
||||
if (FileAttr(de.name) & _ATTR_COMPRESSED && !raw) {
|
||||
ac=buf;
|
||||
if (_attr) *_attr=FileAttr(de.name,*_attr);
|
||||
@@ -437,12 +432,11 @@ Bool RedSeaFSDirNew(CPrt *p,U8 *cur_dir,CDirEntry *de,Bool free_old_chain)
|
||||
RedSeaFSFreeClusters(p,cur_dir_cluster,
|
||||
(dir_size>>BLK_SIZE_BITS+p->spc-1)/p->spc);
|
||||
dir_size+=p->spc<<BLK_SIZE_BITS;
|
||||
c=ClusersAlloc(p,0,(dir_size>>BLK_SIZE_BITS+p->spc-1)/p->spc,TRUE);
|
||||
c=ClustersAlloc(p,0,(dir_size>>BLK_SIZE_BITS+p->spc-1)/p->spc,TRUE);
|
||||
Free(buf);
|
||||
buf=buf2;
|
||||
ptr=buf(U8 *)-offset(CDirEntry.start);
|
||||
ptr->size=dir_size;
|
||||
ptr->expanded_size=dir_size;
|
||||
ptr->cluster=c;
|
||||
WClustersBlks(p,buf,c,dir_size>>BLK_SIZE_BITS);
|
||||
if (cur_dir_cluster==p->root_cluster) {
|
||||
@@ -464,7 +458,6 @@ Bool RedSeaFSDirNew(CPrt *p,U8 *cur_dir,CDirEntry *de,Bool free_old_chain)
|
||||
temp,&de2,FUF_JUST_DIRS)) {
|
||||
de2.cluster=c;
|
||||
de2.size=dir_size;
|
||||
de2.expanded_size=dir_size;
|
||||
RedSeaFSDirNew(p,parent_dir,&de2,FALSE);
|
||||
} else
|
||||
Dbg;
|
||||
@@ -540,11 +533,11 @@ I64 RedSeaFSFilesDel(CPrt *p,U8 *cur_dir,U8 *files_find_mask,I64 fuf_flags,
|
||||
break;
|
||||
else if (!(ptr->attr & _ATTR_DELETED) && ch!='.' && (del_dir ||
|
||||
!(ptr->attr & _ATTR_DIR)) &&
|
||||
FilesFindMatch(files_find_mask,ptr->name,fuf_flags)) {
|
||||
FilesFindMatch(ptr->name,files_find_mask,fuf_flags)) {
|
||||
if (!(ptr->attr & _ATTR_DIR)) result++;
|
||||
if (print_msg) {
|
||||
PutDefine("ST_DELETE");
|
||||
"" ptr->name;
|
||||
"%s",ptr->name;
|
||||
NewLine;
|
||||
}
|
||||
ptr->attr|=_ATTR_DELETED;
|
||||
@@ -583,7 +576,7 @@ I64 RedSeaFSFileWrite(CPrt *p,U8 *cur_dir,U8 *name,U8 *buf,I64 size,
|
||||
if (_ac2) *_ac2=NULL;
|
||||
if (size<0) size=0;
|
||||
if (!cdt)
|
||||
cdt=GetCurTimeDate;
|
||||
cdt=GetDateTime;
|
||||
|
||||
if (p->type!=PT_REDSEA)
|
||||
PutDefineErr("ST_NOT_REDSEA");
|
||||
@@ -594,16 +587,14 @@ I64 RedSeaFSFileWrite(CPrt *p,U8 *cur_dir,U8 *name,U8 *buf,I64 size,
|
||||
attr=FileAttr(name,attr);
|
||||
attr|=_ATTR_CONTIGUOUS;
|
||||
contiguous=TRUE;
|
||||
de.expanded_size=size;
|
||||
if (attr&_ATTR_COMPRESSED && !raw) {
|
||||
ac=CompressBuf(buf,size,flags);
|
||||
size=ac->compressed_size;
|
||||
buf=ac;
|
||||
}
|
||||
de.size=size;
|
||||
de.xsum=ArcXSum(buf,size)^TEMPLEOS_XSUM;
|
||||
if (blk_cnt=(size+BLK_SIZE-1)>>BLK_SIZE_BITS)
|
||||
c=ClusersAlloc(p,0,(blk_cnt+p->spc-1)/p->spc,contiguous);
|
||||
c=ClustersAlloc(p,0,(blk_cnt+p->spc-1)/p->spc,contiguous);
|
||||
else
|
||||
c=INVALID_CLUSTER;
|
||||
de.cluster=c;
|
||||
@@ -623,7 +614,7 @@ I64 RedSeaFSFileWrite(CPrt *p,U8 *cur_dir,U8 *name,U8 *buf,I64 size,
|
||||
CDirEntry *RedSeaFSFilesFind(U8 *files_find_mask,I64 fuf_flags,CDirEntry *parent=NULL)
|
||||
{
|
||||
CPrt *p=Fs->cur_prt;
|
||||
CDirEntry *buf,*buf2,*ptr,*result=NULL,*tempm;
|
||||
CDirEntry *buf,*buf2,*ptr,*result=NULL,*tempde;
|
||||
I64 ch,cur_dir_cluster;
|
||||
if (fuf_flags&~FUG_FILES_FIND)
|
||||
throw(EXCEPT_FUF,11);
|
||||
@@ -648,27 +639,27 @@ CDirEntry *RedSeaFSFilesFind(U8 *files_find_mask,I64 fuf_flags,CDirEntry *parent
|
||||
if (!(ch=*ptr->name))
|
||||
break;
|
||||
else if (!(ptr->attr & _ATTR_DELETED)) {
|
||||
tempm=CAlloc(sizeof(CDirEntry));
|
||||
MemCpy(&tempm->start,&ptr->start,CDIR_SIZE);
|
||||
tempm->parent=parent;
|
||||
if (Bt(&fuf_flags,FUf_RECURSE) && tempm->attr&_ATTR_DIR && *tempm->name!='.') {
|
||||
tempm->next=result;
|
||||
result=tempm;
|
||||
tempm->full_name=DirNameAbs(tempm->name);
|
||||
tempde=CAlloc(sizeof(CDirEntry));
|
||||
MemCpy(&tempde->start,&ptr->start,CDIR_SIZE);
|
||||
tempde->parent=parent;
|
||||
if (Bt(&fuf_flags,FUf_RECURSE) && tempde->attr&_ATTR_DIR && *tempde->name!='.') {
|
||||
tempde->next=result;
|
||||
result=tempde;
|
||||
tempde->full_name=DirNameAbs(tempde->name);
|
||||
PrtUnlock(p);
|
||||
if (Cd(tempm->name)) {
|
||||
tempm->sub=RedSeaFSFilesFind(files_find_mask,fuf_flags,tempm);
|
||||
if (Cd(tempde->name)) {
|
||||
tempde->sub=RedSeaFSFilesFind(files_find_mask,fuf_flags,tempde);
|
||||
Cd("..");
|
||||
}
|
||||
PrtLock(p);
|
||||
} else if ((tempm->attr&_ATTR_DIR || !Bt(&fuf_flags,FUf_JUST_DIRS)) &&
|
||||
!(Bt(&fuf_flags,FUf_RECURSE) && *tempm->name=='.' && tempm->attr&_ATTR_DIR) &&
|
||||
FilesFindMatch(files_find_mask,tempm->name,fuf_flags)) {
|
||||
tempm->next=result;
|
||||
result=tempm;
|
||||
tempm->full_name=FileNameAbs(tempm->name);
|
||||
} else if ((tempde->attr&_ATTR_DIR || !Bt(&fuf_flags,FUf_JUST_DIRS)) &&
|
||||
!(Bt(&fuf_flags,FUf_RECURSE) && *tempde->name=='.' && tempde->attr&_ATTR_DIR) &&
|
||||
FilesFindMatch(tempde->name,files_find_mask,fuf_flags)) {
|
||||
tempde->next=result;
|
||||
result=tempde;
|
||||
tempde->full_name=FileNameAbs(tempde->name);
|
||||
} else
|
||||
CDirEntryDel(tempm);
|
||||
DirEntryDel(tempde);
|
||||
}
|
||||
ptr(U8 *)+=CDIR_SIZE;
|
||||
}
|
||||
@@ -694,8 +685,7 @@ Bool RedSeaFSMkDir(CPrt *p,U8 *cur_dir,U8 *name)
|
||||
StrCpy(d_native->name,name);
|
||||
d_native->cluster=c;
|
||||
d_native->size=size;
|
||||
d_native->expanded_size=size;
|
||||
d_native->datetime=GetCurTimeDate;
|
||||
d_native->datetime=GetDateTime;
|
||||
d_native(U8 *)+=CDIR_SIZE;
|
||||
|
||||
d_native->attr=_ATTR_DIR|_ATTR_CONTIGUOUS;
|
||||
@@ -704,8 +694,7 @@ Bool RedSeaFSMkDir(CPrt *p,U8 *cur_dir,U8 *name)
|
||||
d_native->name[2]=0;
|
||||
d_native->cluster=cur_dir_cluster;
|
||||
d_native->size=0;
|
||||
d_native->expanded_size=0;
|
||||
d_native->datetime=GetCurTimeDate;
|
||||
d_native->datetime=GetDateTime;
|
||||
WClusters(p,buf,c,1);
|
||||
Free(buf);
|
||||
if (unlock_break)
|
||||
|
||||
@@ -10,7 +10,7 @@ U0 EdLiteUpdate(CLine *root,CLine *cur_line,I64 cur_col,I64 line_start_col)
|
||||
U8 *st;
|
||||
CLine *templ=cur_line;
|
||||
Bool done_eof=FALSE;
|
||||
sys_raw_dc_col=0;
|
||||
sys_raw_col=0;
|
||||
for (i=0;i<text_rows/2;i++)
|
||||
if (templ->last!=root)
|
||||
templ=templ->last;
|
||||
@@ -51,7 +51,7 @@ U0 EdLiteUpdate(CLine *root,CLine *cur_line,I64 cur_col,I64 line_start_col)
|
||||
NewLine;
|
||||
}
|
||||
}
|
||||
sys_raw_dc_col=text_cols*cursor_row+cursor_col-line_start_col;
|
||||
sys_raw_col=text_cols*cursor_row+cursor_col-line_start_col;
|
||||
RawPutChar(0x7F);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ U0 EdLite(U8 *filename,I64 num=1)
|
||||
//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_dc_flags=sys_raw_dc_flags;
|
||||
old_raw_flags=sys_raw_flags;
|
||||
CLine root,*templ,*templ1,*cur_line;
|
||||
Bool old_raw=Raw(ON),
|
||||
old_debug=InDbg(ON),
|
||||
@@ -72,7 +72,7 @@ U0 EdLite(U8 *filename,I64 num=1)
|
||||
|
||||
PushFD;
|
||||
Cli;
|
||||
sys_raw_dc_flags=sys_raw_dc_flags&~RDCF_SCROLL|RDCF_SHOW_DOLLAR;
|
||||
sys_raw_flags=sys_raw_flags&~RWF_SCROLL|RWF_SHOW_DOLLAR;
|
||||
sys_cur_scan_code=0;
|
||||
QueInit(&root);
|
||||
root.line=StrNew("");
|
||||
@@ -289,7 +289,7 @@ U0 EdLite(U8 *filename,I64 num=1)
|
||||
Raw(old_raw);
|
||||
InDbg(old_debug);
|
||||
SingleUser(old_single);
|
||||
sys_raw_dc_flags=sys_raw_dc_flags&~RDCF_SHOW_DOLLAR|old_dc_flags&RDCF_SHOW_DOLLAR;
|
||||
sys_raw_flags=sys_raw_flags&~RWF_SHOW_DOLLAR|old_raw_flags&RWF_SHOW_DOLLAR;
|
||||
PopFD;
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ U0 EdLiteFileLine(U8 *fl_file_line)
|
||||
|
||||
U0 SetFix(U8 *filename,I64 line)
|
||||
{
|
||||
U8 *st=MSPrintF("FL:%s,%d",filename,line);
|
||||
U8 *st=MPrint("FL:%s,%d",filename,line);
|
||||
while (LBts(&sys_semas[SYS_SEMA_FIX],0))
|
||||
Yield;
|
||||
Free(sys_fix_file_line);
|
||||
|
||||
@@ -67,7 +67,7 @@ class CTryStk
|
||||
|
||||
U0 SysTry(U8 *catch_start,U8 *untry_start)
|
||||
{
|
||||
I64 *rbp=GetBasePtr,old_flags=GetFlags;
|
||||
I64 *rbp=GetRBP,old_flags=GetRFlags;
|
||||
CExcept *tempt=MAlloc(sizeof(CExcept));
|
||||
tempt->handler_catch=catch_start;
|
||||
tempt->handler_untry=untry_start;
|
||||
@@ -77,7 +77,7 @@ U0 SysTry(U8 *catch_start,U8 *untry_start)
|
||||
SaveExceptRegs(tempt);
|
||||
Cli;
|
||||
QueIns(tempt,Fs->last_except);
|
||||
SetFlags(old_flags);
|
||||
SetRFlags(old_flags);
|
||||
}
|
||||
|
||||
U0 SysUntry()
|
||||
@@ -140,13 +140,13 @@ U0 throw_join(I64 argc,I64 *argv)
|
||||
|
||||
Fs->except_argc=argc;
|
||||
Fs->except_argv=argv;
|
||||
Fs->except_rbp=GetBasePtr;
|
||||
Fs->except_rbp=GetRBP;
|
||||
Fs->catch_except=FALSE;
|
||||
while (Fs->next_except!=&Fs->next_except) {
|
||||
TestExcept;
|
||||
if (Fs->catch_except)
|
||||
TakeExcept;
|
||||
SetBasePtr(Fs->except_rbp);
|
||||
SetRBP(Fs->except_rbp);
|
||||
tempt=Fs->last_except;
|
||||
QueRem(tempt);
|
||||
Free(tempt);
|
||||
@@ -197,7 +197,7 @@ U0 ThrowBreak(CTask *task=NULL)
|
||||
}
|
||||
|
||||
Bool BreakLock(CTask *task=NULL)
|
||||
{
|
||||
{ //This disables CTRL-ALT-C
|
||||
if (!task) task=Fs;
|
||||
return !LBts(&task->task_flags,TASKf_BREAK_LOCKED);
|
||||
}
|
||||
|
||||
+224
-225
@@ -32,230 +32,229 @@ U8 sys_font_8x8[256*8]= {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x18,0x3C,0x3C,0x18,0x18,0x00,0x18,0x00,
|
||||
0x36,0x36,0x36,0x00,0x00,0x00,0x00,0x00,
|
||||
0x6C,0x6C,0xFE,0x6C,0xFE,0x6C,0x6C,0x00,
|
||||
0x30,0xFC,0x16,0x7C,0xD0,0x7E,0x18,0x00,
|
||||
0x06,0x66,0x30,0x18,0x0C,0x66,0x60,0x00,
|
||||
0x1C,0x36,0x36,0x1C,0xB6,0x66,0xDC,0x00,
|
||||
0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
|
||||
0x30,0x18,0x0C,0x0C,0x0C,0x18,0x30,0x00,
|
||||
0x0C,0x18,0x30,0x30,0x30,0x18,0x0C,0x00,
|
||||
0x00,0x18,0x7E,0x3C,0x7E,0x18,0x00,0x00,
|
||||
0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x0C,
|
||||
0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,
|
||||
0x00,0x60,0x30,0x18,0x0C,0x06,0x00,0x00,
|
||||
0x3C,0x66,0x76,0x7E,0x6E,0x66,0x3C,0x00,
|
||||
0x18,0x1C,0x18,0x18,0x18,0x18,0x7E,0x00,
|
||||
0x3C,0x66,0x60,0x30,0x18,0x0C,0x7E,0x00,
|
||||
0x3C,0x66,0x60,0x38,0x60,0x66,0x3C,0x00,
|
||||
0x30,0x38,0x3C,0x36,0x7E,0x30,0x30,0x00,
|
||||
0x7E,0x06,0x3E,0x60,0x60,0x66,0x3C,0x00,
|
||||
0x38,0x0C,0x06,0x3E,0x66,0x66,0x3C,0x00,
|
||||
0x7E,0x60,0x30,0x18,0x0C,0x0C,0x0C,0x00,
|
||||
0x3C,0x66,0x66,0x3C,0x66,0x66,0x3C,0x00,
|
||||
0x3C,0x66,0x66,0x7C,0x60,0x30,0x1C,0x00,
|
||||
0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x00,
|
||||
0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x0C,
|
||||
0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x00,
|
||||
0x00,0x00,0x7E,0x00,0x7E,0x00,0x00,0x00,
|
||||
0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x00,
|
||||
0x3C,0x66,0x30,0x18,0x18,0x00,0x18,0x00,
|
||||
0x3C,0x66,0x76,0x56,0x76,0x06,0x3C,0x00,
|
||||
0x3C,0x66,0x66,0x7E,0x66,0x66,0x66,0x00,
|
||||
0x3E,0x66,0x66,0x3E,0x66,0x66,0x3E,0x00,
|
||||
0x3C,0x66,0x06,0x06,0x06,0x66,0x3C,0x00,
|
||||
0x1E,0x36,0x66,0x66,0x66,0x36,0x1E,0x00,
|
||||
0x7E,0x06,0x06,0x3E,0x06,0x06,0x7E,0x00,
|
||||
0x7E,0x06,0x06,0x3E,0x06,0x06,0x06,0x00,
|
||||
0x3C,0x66,0x06,0x76,0x66,0x66,0x3C,0x00,
|
||||
0x66,0x66,0x66,0x7E,0x66,0x66,0x66,0x00,
|
||||
0x7E,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,
|
||||
0x7C,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,
|
||||
0x66,0x36,0x1E,0x0E,0x1E,0x36,0x66,0x00,
|
||||
0x06,0x06,0x06,0x06,0x06,0x06,0x7E,0x00,
|
||||
0xC6,0xEE,0xFE,0xD6,0xD6,0xC6,0xC6,0x00,
|
||||
0x66,0x66,0x6E,0x7E,0x76,0x66,0x66,0x00,
|
||||
0x3C,0x66,0x66,0x66,0x66,0x66,0x3C,0x00,
|
||||
0x3E,0x66,0x66,0x3E,0x06,0x06,0x06,0x00,
|
||||
0x3C,0x66,0x66,0x66,0x56,0x36,0x6C,0x00,
|
||||
0x3E,0x66,0x66,0x3E,0x36,0x66,0x66,0x00,
|
||||
0x3C,0x66,0x06,0x3C,0x60,0x66,0x3C,0x00,
|
||||
0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x00,
|
||||
0x66,0x66,0x66,0x66,0x66,0x66,0x3C,0x00,
|
||||
0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x00,
|
||||
0xC6,0xC6,0xD6,0xD6,0xFE,0xEE,0xC6,0x00,
|
||||
0x66,0x66,0x3C,0x18,0x3C,0x66,0x66,0x00,
|
||||
0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x00,
|
||||
0x7E,0x60,0x30,0x18,0x0C,0x06,0x7E,0x00,
|
||||
0x3E,0x06,0x06,0x06,0x06,0x06,0x3E,0x00,
|
||||
0x00,0x06,0x0C,0x18,0x30,0x60,0x00,0x00,
|
||||
0x7C,0x60,0x60,0x60,0x60,0x60,0x7C,0x00,
|
||||
0x3C,0x66,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,
|
||||
0x0C,0x18,0x30,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x3C,0x60,0x7C,0x66,0x7C,0x00,
|
||||
0x06,0x06,0x3E,0x66,0x66,0x66,0x3E,0x00,
|
||||
0x00,0x00,0x3C,0x66,0x06,0x66,0x3C,0x00,
|
||||
0x60,0x60,0x7C,0x66,0x66,0x66,0x7C,0x00,
|
||||
0x00,0x00,0x3C,0x66,0x7E,0x06,0x3C,0x00,
|
||||
0x38,0x0C,0x0C,0x3E,0x0C,0x0C,0x0C,0x00,
|
||||
0x00,0x00,0x7C,0x66,0x66,0x7C,0x60,0x3C,
|
||||
0x06,0x06,0x3E,0x66,0x66,0x66,0x66,0x00,
|
||||
0x18,0x00,0x1C,0x18,0x18,0x18,0x3C,0x00,
|
||||
0x18,0x00,0x1C,0x18,0x18,0x18,0x18,0x0E,
|
||||
0x06,0x06,0x66,0x36,0x1E,0x36,0x66,0x00,
|
||||
0x1C,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,
|
||||
0x00,0x00,0x6C,0xFE,0xD6,0xD6,0xC6,0x00,
|
||||
0x00,0x00,0x3E,0x66,0x66,0x66,0x66,0x00,
|
||||
0x00,0x00,0x3C,0x66,0x66,0x66,0x3C,0x00,
|
||||
0x00,0x00,0x3E,0x66,0x66,0x3E,0x06,0x06,
|
||||
0x00,0x00,0x7C,0x66,0x66,0x7C,0x60,0xE0,
|
||||
0x00,0x00,0x36,0x6E,0x06,0x06,0x06,0x00,
|
||||
0x00,0x00,0x7C,0x06,0x3C,0x60,0x3E,0x00,
|
||||
0x0C,0x0C,0x3E,0x0C,0x0C,0x0C,0x38,0x00,
|
||||
0x00,0x00,0x66,0x66,0x66,0x66,0x7C,0x00,
|
||||
0x00,0x00,0x66,0x66,0x66,0x3C,0x18,0x00,
|
||||
0x00,0x00,0xC6,0xD6,0xD6,0xFE,0x6C,0x00,
|
||||
0x00,0x00,0x66,0x3C,0x18,0x3C,0x66,0x00,
|
||||
0x00,0x00,0x66,0x66,0x66,0x7C,0x60,0x3C,
|
||||
0x00,0x00,0x7E,0x30,0x18,0x0C,0x7E,0x00,
|
||||
0x30,0x18,0x18,0x0E,0x18,0x18,0x30,0x00,
|
||||
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,
|
||||
0x0C,0x18,0x18,0x70,0x18,0x18,0x0C,0x00,
|
||||
0x8C,0xD6,0x62,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,//
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//
|
||||
0x18,0x3C,0x3C,0x18,0x18,0x00,0x18,0x00,//!
|
||||
0x36,0x36,0x36,0x00,0x00,0x00,0x00,0x00,//"
|
||||
0x6C,0x6C,0xFE,0x6C,0xFE,0x6C,0x6C,0x00,//#
|
||||
0x30,0xFC,0x16,0x7C,0xD0,0x7E,0x18,0x00,//$$
|
||||
0x06,0x66,0x30,0x18,0x0C,0x66,0x60,0x00,//%
|
||||
0x1C,0x36,0x36,0x1C,0xB6,0x66,0xDC,0x00,//&
|
||||
0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,//'
|
||||
0x30,0x18,0x0C,0x0C,0x0C,0x18,0x30,0x00,//(
|
||||
0x0C,0x18,0x30,0x30,0x30,0x18,0x0C,0x00,//)
|
||||
0x00,0x18,0x7E,0x3C,0x7E,0x18,0x00,0x00,//*
|
||||
0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00,//+
|
||||
0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x0C,//,
|
||||
0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,//-
|
||||
0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,//.
|
||||
0x00,0x60,0x30,0x18,0x0C,0x06,0x00,0x00,///
|
||||
0x3C,0x66,0x76,0x7E,0x6E,0x66,0x3C,0x00,//0
|
||||
0x18,0x1C,0x18,0x18,0x18,0x18,0x7E,0x00,//1
|
||||
0x3C,0x66,0x60,0x30,0x18,0x0C,0x7E,0x00,//2
|
||||
0x3C,0x66,0x60,0x38,0x60,0x66,0x3C,0x00,//3
|
||||
0x30,0x38,0x3C,0x36,0x7E,0x30,0x30,0x00,//4
|
||||
0x7E,0x06,0x3E,0x60,0x60,0x66,0x3C,0x00,//5
|
||||
0x38,0x0C,0x06,0x3E,0x66,0x66,0x3C,0x00,//6
|
||||
0x7E,0x60,0x30,0x18,0x0C,0x0C,0x0C,0x00,//7
|
||||
0x3C,0x66,0x66,0x3C,0x66,0x66,0x3C,0x00,//8
|
||||
0x3C,0x66,0x66,0x7C,0x60,0x30,0x1C,0x00,//9
|
||||
0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x00,//:
|
||||
0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x0C,//;
|
||||
0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x00,//<
|
||||
0x00,0x00,0x7E,0x00,0x7E,0x00,0x00,0x00,//=
|
||||
0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x00,//>
|
||||
0x3C,0x66,0x30,0x18,0x18,0x00,0x18,0x00,//?
|
||||
0x3C,0x66,0x76,0x56,0x76,0x06,0x3C,0x00,//@
|
||||
0x3C,0x66,0x66,0x7E,0x66,0x66,0x66,0x00,//A
|
||||
0x3E,0x66,0x66,0x3E,0x66,0x66,0x3E,0x00,//B
|
||||
0x3C,0x66,0x06,0x06,0x06,0x66,0x3C,0x00,//C
|
||||
0x1E,0x36,0x66,0x66,0x66,0x36,0x1E,0x00,//D
|
||||
0x7E,0x06,0x06,0x3E,0x06,0x06,0x7E,0x00,//E
|
||||
0x7E,0x06,0x06,0x3E,0x06,0x06,0x06,0x00,//F
|
||||
0x3C,0x66,0x06,0x76,0x66,0x66,0x3C,0x00,//G
|
||||
0x66,0x66,0x66,0x7E,0x66,0x66,0x66,0x00,//H
|
||||
0x7E,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,//I
|
||||
0x7C,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,//J
|
||||
0x66,0x36,0x1E,0x0E,0x1E,0x36,0x66,0x00,//K
|
||||
0x06,0x06,0x06,0x06,0x06,0x06,0x7E,0x00,//L
|
||||
0xC6,0xEE,0xFE,0xD6,0xD6,0xC6,0xC6,0x00,//M
|
||||
0x66,0x66,0x6E,0x7E,0x76,0x66,0x66,0x00,//N
|
||||
0x3C,0x66,0x66,0x66,0x66,0x66,0x3C,0x00,//O
|
||||
0x3E,0x66,0x66,0x3E,0x06,0x06,0x06,0x00,//P
|
||||
0x3C,0x66,0x66,0x66,0x56,0x36,0x6C,0x00,//Q
|
||||
0x3E,0x66,0x66,0x3E,0x36,0x66,0x66,0x00,//R
|
||||
0x3C,0x66,0x06,0x3C,0x60,0x66,0x3C,0x00,//S
|
||||
0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x00,//T
|
||||
0x66,0x66,0x66,0x66,0x66,0x66,0x3C,0x00,//U
|
||||
0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x00,//V
|
||||
0xC6,0xC6,0xD6,0xD6,0xFE,0xEE,0xC6,0x00,//W
|
||||
0x66,0x66,0x3C,0x18,0x3C,0x66,0x66,0x00,//X
|
||||
0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x00,//Y
|
||||
0x7E,0x60,0x30,0x18,0x0C,0x06,0x7E,0x00,//Z
|
||||
0x3E,0x06,0x06,0x06,0x06,0x06,0x3E,0x00,//[
|
||||
0x00,0x06,0x0C,0x18,0x30,0x60,0x00,0x00,//\
|
||||
0x7C,0x60,0x60,0x60,0x60,0x60,0x7C,0x00,//]
|
||||
0x3C,0x66,0x00,0x00,0x00,0x00,0x00,0x00,//^
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,//_
|
||||
0x0C,0x18,0x30,0x00,0x00,0x00,0x00,0x00,//`
|
||||
0x00,0x00,0x3C,0x60,0x7C,0x66,0x7C,0x00,//a
|
||||
0x06,0x06,0x3E,0x66,0x66,0x66,0x3E,0x00,//b
|
||||
0x00,0x00,0x3C,0x66,0x06,0x66,0x3C,0x00,//c
|
||||
0x60,0x60,0x7C,0x66,0x66,0x66,0x7C,0x00,//d
|
||||
0x00,0x00,0x3C,0x66,0x7E,0x06,0x3C,0x00,//e
|
||||
0x38,0x0C,0x0C,0x3E,0x0C,0x0C,0x0C,0x00,//f
|
||||
0x00,0x00,0x7C,0x66,0x66,0x7C,0x60,0x3C,//g
|
||||
0x06,0x06,0x3E,0x66,0x66,0x66,0x66,0x00,//h
|
||||
0x18,0x00,0x1C,0x18,0x18,0x18,0x3C,0x00,//i
|
||||
0x18,0x00,0x1C,0x18,0x18,0x18,0x18,0x0E,//j
|
||||
0x06,0x06,0x66,0x36,0x1E,0x36,0x66,0x00,//k
|
||||
0x1C,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,//l
|
||||
0x00,0x00,0x6C,0xFE,0xD6,0xD6,0xC6,0x00,//m
|
||||
0x00,0x00,0x3E,0x66,0x66,0x66,0x66,0x00,//n
|
||||
0x00,0x00,0x3C,0x66,0x66,0x66,0x3C,0x00,//o
|
||||
0x00,0x00,0x3E,0x66,0x66,0x3E,0x06,0x06,//p
|
||||
0x00,0x00,0x7C,0x66,0x66,0x7C,0x60,0xE0,//q
|
||||
0x00,0x00,0x36,0x6E,0x06,0x06,0x06,0x00,//r
|
||||
0x00,0x00,0x7C,0x06,0x3C,0x60,0x3E,0x00,//s
|
||||
0x0C,0x0C,0x3E,0x0C,0x0C,0x0C,0x38,0x00,//t
|
||||
0x00,0x00,0x66,0x66,0x66,0x66,0x7C,0x00,//u
|
||||
0x00,0x00,0x66,0x66,0x66,0x3C,0x18,0x00,//v
|
||||
0x00,0x00,0xC6,0xD6,0xD6,0xFE,0x6C,0x00,//w
|
||||
0x00,0x00,0x66,0x3C,0x18,0x3C,0x66,0x00,//x
|
||||
0x00,0x00,0x66,0x66,0x66,0x7C,0x60,0x3C,//y
|
||||
0x00,0x00,0x7E,0x30,0x18,0x0C,0x7E,0x00,//z
|
||||
0x30,0x18,0x18,0x0E,0x18,0x18,0x30,0x00,//{
|
||||
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,//|
|
||||
0x0C,0x18,0x18,0x70,0x18,0x18,0x0C,0x00,//}
|
||||
0x8C,0xD6,0x62,0x00,0x00,0x00,0x00,0x00,//~
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
||||
|
||||
0x1E,0x33,0x03,0x33,0x1E,0x18,0x30,0x1E,
|
||||
0x00,0x33,0x00,0x33,0x33,0x33,0x7E,0x00,
|
||||
0x38,0x00,0x1E,0x33,0x3F,0x03,0x1E,0x00,
|
||||
0x7E,0xC3,0x3C,0x60,0x7C,0x66,0xFC,0x00,
|
||||
0x33,0x00,0x1E,0x30,0x3E,0x33,0x7E,0x00,
|
||||
0x07,0x00,0x1E,0x30,0x3E,0x33,0x7E,0x00,
|
||||
0x0C,0x0C,0x1E,0x30,0x3E,0x33,0x7E,0x00,
|
||||
0x00,0x00,0x3E,0x03,0x03,0x3E,0x60,0x3C,
|
||||
0x7E,0xC3,0x3C,0x66,0x7E,0x06,0x3C,0x00,
|
||||
0x33,0x00,0x1E,0x33,0x3F,0x03,0x1E,0x00,
|
||||
0x07,0x00,0x1E,0x33,0x3F,0x03,0x1E,0x00,
|
||||
0x33,0x00,0x0E,0x0C,0x0C,0x0C,0x1E,0x00,
|
||||
0x3E,0x63,0x1C,0x18,0x18,0x18,0x3C,0x00,
|
||||
0x07,0x00,0x0E,0x0C,0x0C,0x0C,0x1E,0x00,
|
||||
0x33,0x0C,0x1E,0x33,0x33,0x3F,0x33,0x00,
|
||||
0x0C,0x0C,0x00,0x1E,0x33,0x3F,0x33,0x00,
|
||||
0x38,0x00,0x3F,0x06,0x1E,0x06,0x3F,0x00,
|
||||
0x00,0x00,0xFE,0x30,0xFE,0x33,0xFE,0x00,
|
||||
0x7C,0x36,0x33,0x7F,0x33,0x33,0x73,0x00,
|
||||
0x1E,0x33,0x00,0x1E,0x33,0x33,0x1E,0x00,
|
||||
0x00,0x33,0x00,0x1E,0x33,0x33,0x1E,0x00,
|
||||
0x00,0x07,0x00,0x1E,0x33,0x33,0x1E,0x00,
|
||||
0x1E,0x33,0x00,0x33,0x33,0x33,0x7E,0x00,
|
||||
0x00,0x07,0x00,0x33,0x33,0x33,0x7E,0x00,
|
||||
0x00,0x33,0x00,0x33,0x33,0x3F,0x30,0x1F,
|
||||
0x63,0x1C,0x3E,0x63,0x63,0x3E,0x1C,0x00,
|
||||
0x33,0x00,0x33,0x33,0x33,0x33,0x1E,0x00,
|
||||
0x18,0x18,0x7E,0x03,0x03,0x7E,0x18,0x18,
|
||||
0x1C,0x36,0x26,0x0F,0x06,0x67,0x3F,0x00,
|
||||
0x33,0x33,0x1E,0x3F,0x0C,0x3F,0x0C,0x00,
|
||||
0x0F,0x1B,0x1B,0x2F,0x33,0x7B,0x33,0x70,
|
||||
0x70,0xD8,0x18,0x7E,0x18,0x18,0x1B,0x0E,
|
||||
0x38,0x00,0x1E,0x30,0x3E,0x33,0x7E,0x00,
|
||||
0x1C,0x00,0x0E,0x0C,0x0C,0x0C,0x1E,0x00,
|
||||
0x00,0x38,0x00,0x1E,0x33,0x33,0x1E,0x00,
|
||||
0x00,0x38,0x00,0x33,0x33,0x33,0x7E,0x00,
|
||||
0x00,0x1F,0x00,0x1F,0x33,0x33,0x33,0x00,
|
||||
0x3F,0x00,0x33,0x37,0x3F,0x3B,0x33,0x00,
|
||||
0x3C,0x36,0x36,0x7C,0x00,0x7E,0x00,0x00,
|
||||
0x3C,0x66,0x66,0x3C,0x00,0x7E,0x00,0x00,
|
||||
0x0C,0x00,0x0C,0x06,0x03,0x33,0x1E,0x00,
|
||||
0x00,0x00,0x00,0x3F,0x03,0x03,0x00,0x00,
|
||||
0x00,0x00,0x00,0x3F,0x30,0x30,0x00,0x00,
|
||||
0x63,0x33,0x1B,0x7C,0xC6,0x73,0x19,0xF8,
|
||||
0x63,0x33,0x1B,0xCF,0xE6,0xF3,0xF9,0xC0,
|
||||
0x00,0x18,0x00,0x18,0x18,0x3C,0x3C,0x18,
|
||||
0x00,0xCC,0x66,0x33,0x66,0xCC,0x00,0x00,
|
||||
0x00,0x33,0x66,0xCC,0x66,0x33,0x00,0x00,
|
||||
0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,
|
||||
0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,
|
||||
0xBB,0xEE,0xBB,0xEE,0xBB,0xEE,0xBB,0xEE,
|
||||
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
|
||||
0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18,
|
||||
0x18,0x18,0x1F,0x18,0x1F,0x18,0x18,0x18,
|
||||
0x6C,0x6C,0x6C,0x6C,0x6F,0x6C,0x6C,0x6C,
|
||||
0x00,0x00,0x00,0x00,0x7F,0x6C,0x6C,0x6C,
|
||||
0x00,0x00,0x1F,0x18,0x1F,0x18,0x18,0x18,
|
||||
0x6C,0x6C,0x6F,0x60,0x6F,0x6C,0x6C,0x6C,
|
||||
0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,
|
||||
0x00,0x00,0x7F,0x60,0x6F,0x6C,0x6C,0x6C,
|
||||
0x6C,0x6C,0x6F,0x60,0x7F,0x00,0x00,0x00,
|
||||
0x6C,0x6C,0x6C,0x6C,0x7F,0x00,0x00,0x00,
|
||||
0x18,0x18,0x1F,0x18,0x1F,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x1F,0x18,0x18,0x18,
|
||||
0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,
|
||||
0x18,0x18,0x18,0x18,0xFF,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xFF,0x18,0x18,0x18,
|
||||
0x18,0x18,0x18,0x18,0xF8,0x18,0x18,0x18,
|
||||
0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,
|
||||
0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,
|
||||
0x18,0x18,0xF8,0x18,0xF8,0x18,0x18,0x18,
|
||||
0x6C,0x6C,0x6C,0x6C,0xEC,0x6C,0x6C,0x6C,
|
||||
0x6C,0x6C,0xEC,0x0C,0xFC,0x00,0x00,0x00,
|
||||
0x00,0x00,0xFC,0x0C,0xEC,0x6C,0x6C,0x6C,
|
||||
0x6C,0x6C,0xEF,0x00,0xFF,0x00,0x00,0x00,
|
||||
0x00,0x00,0xFF,0x00,0xEF,0x6C,0x6C,0x6C,
|
||||
0x6C,0x6C,0xEC,0x0C,0xEC,0x6C,0x6C,0x6C,
|
||||
0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,
|
||||
0x6C,0x6C,0xEF,0x00,0xEF,0x6C,0x6C,0x6C,
|
||||
0x18,0x18,0xFF,0x00,0xFF,0x00,0x00,0x00,
|
||||
0x6C,0x6C,0x6C,0x6C,0xFF,0x00,0x00,0x00,
|
||||
0x00,0x00,0xFF,0x00,0xFF,0x18,0x18,0x18,
|
||||
0x00,0x00,0x00,0x00,0xFF,0x6C,0x6C,0x6C,
|
||||
0x6C,0x6C,0x6C,0x6C,0xFC,0x00,0x00,0x00,
|
||||
0x18,0x18,0xF8,0x18,0xF8,0x00,0x00,0x00,
|
||||
0x00,0x00,0xF8,0x18,0xF8,0x18,0x18,0x18,
|
||||
0x00,0x00,0x00,0x00,0xFC,0x6C,0x6C,0x6C,
|
||||
0x6C,0x6C,0x6C,0x6C,0xEF,0x6C,0x6C,0x6C,
|
||||
0x18,0x18,0xFF,0x00,0xFF,0x18,0x18,0x18,
|
||||
0x18,0x18,0x18,0x18,0x1F,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xF8,0x18,0x18,0x18,
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
||||
0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,
|
||||
0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
|
||||
0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,
|
||||
0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x6E,0x3B,0x13,0x3B,0x6E,0x00,
|
||||
0x00,0x1E,0x33,0x1F,0x33,0x1F,0x03,0x03,
|
||||
0x00,0x7F,0x63,0x03,0x03,0x03,0x03,0x00,
|
||||
0x00,0x7F,0x36,0x36,0x36,0x36,0x36,0x00,
|
||||
0x7F,0x66,0x0C,0x18,0x0C,0x66,0x7F,0x00,
|
||||
0x00,0x00,0x7E,0x33,0x33,0x33,0x1E,0x00,
|
||||
0x00,0x66,0x66,0x66,0x66,0x3E,0x06,0x03,
|
||||
0x00,0x6E,0x3B,0x18,0x18,0x18,0x18,0x00,
|
||||
0x3F,0x0C,0x1E,0x33,0x33,0x1E,0x0C,0x3F,
|
||||
0x1C,0x36,0x63,0x7F,0x63,0x36,0x1C,0x00,
|
||||
0x1C,0x36,0x63,0x63,0x36,0x36,0x77,0x00,
|
||||
0x38,0x0C,0x18,0x3E,0x33,0x33,0x1E,0x00,
|
||||
0x00,0x00,0x7E,0xDB,0xDB,0x7E,0x00,0x00,
|
||||
0x60,0x30,0x7E,0xDB,0xDB,0x7E,0x06,0x03,
|
||||
0x3C,0x06,0x03,0x3F,0x03,0x06,0x3C,0x00,
|
||||
0x1E,0x33,0x33,0x33,0x33,0x33,0x33,0x00,
|
||||
0x00,0x3F,0x00,0x3F,0x00,0x3F,0x00,0x00,
|
||||
0x0C,0x0C,0x3F,0x0C,0x0C,0x00,0x3F,0x00,
|
||||
0x06,0x0C,0x18,0x0C,0x06,0x00,0x3F,0x00,
|
||||
0x18,0x0C,0x06,0x0C,0x18,0x00,0x3F,0x00,
|
||||
0x70,0xD8,0xD8,0x18,0x18,0x18,0x18,0x18,
|
||||
0x18,0x18,0x18,0x18,0x18,0x1B,0x1B,0x0E,
|
||||
0x0C,0x0C,0x00,0x3F,0x00,0x0C,0x0C,0x00,
|
||||
0x00,0x4E,0x39,0x00,0x4E,0x39,0x00,0x00,
|
||||
0x1C,0x36,0x36,0x1C,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,
|
||||
0xF0,0x30,0x30,0x30,0x37,0x36,0x3C,0x38,
|
||||
0x1E,0x36,0x36,0x36,0x36,0x00,0x00,0x00,
|
||||
0x1E,0x30,0x1C,0x06,0x3E,0x00,0x00,0x00,
|
||||
0x00,0x00,0x3C,0x3C,0x3C,0x3C,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
0x1E,0x33,0x03,0x33,0x1E,0x18,0x30,0x1E,//€
|
||||
0x00,0x33,0x00,0x33,0x33,0x33,0x7E,0x00,//�
|
||||
0x38,0x00,0x1E,0x33,0x3F,0x03,0x1E,0x00,//‚
|
||||
0x7E,0xC3,0x3C,0x60,0x7C,0x66,0xFC,0x00,//ƒ
|
||||
0x33,0x00,0x1E,0x30,0x3E,0x33,0x7E,0x00,//„
|
||||
0x07,0x00,0x1E,0x30,0x3E,0x33,0x7E,0x00,//…
|
||||
0x0C,0x0C,0x1E,0x30,0x3E,0x33,0x7E,0x00,//†
|
||||
0x00,0x00,0x3E,0x03,0x03,0x3E,0x60,0x3C,//‡
|
||||
0x7E,0xC3,0x3C,0x66,0x7E,0x06,0x3C,0x00,//ˆ
|
||||
0x33,0x00,0x1E,0x33,0x3F,0x03,0x1E,0x00,//‰
|
||||
0x07,0x00,0x1E,0x33,0x3F,0x03,0x1E,0x00,//Š
|
||||
0x33,0x00,0x0E,0x0C,0x0C,0x0C,0x1E,0x00,//‹
|
||||
0x3E,0x63,0x1C,0x18,0x18,0x18,0x3C,0x00,//Œ
|
||||
0x07,0x00,0x0E,0x0C,0x0C,0x0C,0x1E,0x00,//�
|
||||
0x33,0x0C,0x1E,0x33,0x33,0x3F,0x33,0x00,//Ž
|
||||
0x0C,0x0C,0x00,0x1E,0x33,0x3F,0x33,0x00,//�
|
||||
0x38,0x00,0x3F,0x06,0x1E,0x06,0x3F,0x00,//�
|
||||
0x00,0x00,0xFE,0x30,0xFE,0x33,0xFE,0x00,//‘
|
||||
0x7C,0x36,0x33,0x7F,0x33,0x33,0x73,0x00,//’
|
||||
0x1E,0x33,0x00,0x1E,0x33,0x33,0x1E,0x00,//“
|
||||
0x00,0x33,0x00,0x1E,0x33,0x33,0x1E,0x00,//”
|
||||
0x00,0x07,0x00,0x1E,0x33,0x33,0x1E,0x00,//•
|
||||
0x1E,0x33,0x00,0x33,0x33,0x33,0x7E,0x00,//–
|
||||
0x00,0x07,0x00,0x33,0x33,0x33,0x7E,0x00,//—
|
||||
0x00,0x33,0x00,0x33,0x33,0x3F,0x30,0x1F,//˜
|
||||
0x63,0x1C,0x3E,0x63,0x63,0x3E,0x1C,0x00,//™
|
||||
0x33,0x00,0x33,0x33,0x33,0x33,0x1E,0x00,//š
|
||||
0x18,0x18,0x7E,0x03,0x03,0x7E,0x18,0x18,//›
|
||||
0x1C,0x36,0x26,0x0F,0x06,0x67,0x3F,0x00,//œ
|
||||
0x33,0x33,0x1E,0x3F,0x0C,0x3F,0x0C,0x00,//�
|
||||
0x0F,0x1B,0x1B,0x2F,0x33,0x7B,0x33,0x70,//ž
|
||||
0x70,0xD8,0x18,0x7E,0x18,0x18,0x1B,0x0E,//Ÿ
|
||||
0x38,0x00,0x1E,0x30,0x3E,0x33,0x7E,0x00,//
|
||||
0x1C,0x00,0x0E,0x0C,0x0C,0x0C,0x1E,0x00,//¡
|
||||
0x00,0x38,0x00,0x1E,0x33,0x33,0x1E,0x00,//¢
|
||||
0x00,0x38,0x00,0x33,0x33,0x33,0x7E,0x00,//£
|
||||
0x00,0x1F,0x00,0x1F,0x33,0x33,0x33,0x00,//¤
|
||||
0x3F,0x00,0x33,0x37,0x3F,0x3B,0x33,0x00,//¥
|
||||
0x3C,0x36,0x36,0x7C,0x00,0x7E,0x00,0x00,//¦
|
||||
0x3C,0x66,0x66,0x3C,0x00,0x7E,0x00,0x00,//§
|
||||
0x0C,0x00,0x0C,0x06,0x03,0x33,0x1E,0x00,//¨
|
||||
0x00,0x00,0x00,0x3F,0x03,0x03,0x00,0x00,//©
|
||||
0x00,0x00,0x00,0x3F,0x30,0x30,0x00,0x00,//ª
|
||||
0x63,0x33,0x1B,0x7C,0xC6,0x73,0x19,0xF8,//«
|
||||
0x63,0x33,0x1B,0xCF,0xE6,0xF3,0xF9,0xC0,//¬
|
||||
0x00,0x18,0x00,0x18,0x18,0x3C,0x3C,0x18,//
|
||||
0x00,0xCC,0x66,0x33,0x66,0xCC,0x00,0x00,//®
|
||||
0x00,0x33,0x66,0xCC,0x66,0x33,0x00,0x00,//¯
|
||||
0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,//°
|
||||
0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,//±
|
||||
0xBB,0xEE,0xBB,0xEE,0xBB,0xEE,0xBB,0xEE,//²
|
||||
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,//³
|
||||
0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18,//´
|
||||
0x18,0x18,0x1F,0x18,0x1F,0x18,0x18,0x18,//µ
|
||||
0x6C,0x6C,0x6C,0x6C,0x6F,0x6C,0x6C,0x6C,//¶
|
||||
0x00,0x00,0x00,0x00,0x7F,0x6C,0x6C,0x6C,//·
|
||||
0x00,0x00,0x1F,0x18,0x1F,0x18,0x18,0x18,//¸
|
||||
0x6C,0x6C,0x6F,0x60,0x6F,0x6C,0x6C,0x6C,//¹
|
||||
0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,0x6C,//º
|
||||
0x00,0x00,0x7F,0x60,0x6F,0x6C,0x6C,0x6C,//»
|
||||
0x6C,0x6C,0x6F,0x60,0x7F,0x00,0x00,0x00,//¼
|
||||
0x6C,0x6C,0x6C,0x6C,0x7F,0x00,0x00,0x00,//½
|
||||
0x18,0x18,0x1F,0x18,0x1F,0x00,0x00,0x00,//¾
|
||||
0x00,0x00,0x00,0x00,0x1F,0x18,0x18,0x18,//¿
|
||||
0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,//À
|
||||
0x18,0x18,0x18,0x18,0xFF,0x00,0x00,0x00,//Á
|
||||
0x00,0x00,0x00,0x00,0xFF,0x18,0x18,0x18,//Â
|
||||
0x18,0x18,0x18,0x18,0xF8,0x18,0x18,0x18,//Ã
|
||||
0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,//Ä
|
||||
0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,//Å
|
||||
0x18,0x18,0xF8,0x18,0xF8,0x18,0x18,0x18,//Æ
|
||||
0x6C,0x6C,0x6C,0x6C,0xEC,0x6C,0x6C,0x6C,//Ç
|
||||
0x6C,0x6C,0xEC,0x0C,0xFC,0x00,0x00,0x00,//È
|
||||
0x00,0x00,0xFC,0x0C,0xEC,0x6C,0x6C,0x6C,//É
|
||||
0x6C,0x6C,0xEF,0x00,0xFF,0x00,0x00,0x00,//Ê
|
||||
0x00,0x00,0xFF,0x00,0xEF,0x6C,0x6C,0x6C,//Ë
|
||||
0x6C,0x6C,0xEC,0x0C,0xEC,0x6C,0x6C,0x6C,//Ì
|
||||
0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,//Í
|
||||
0x6C,0x6C,0xEF,0x00,0xEF,0x6C,0x6C,0x6C,//Î
|
||||
0x18,0x18,0xFF,0x00,0xFF,0x00,0x00,0x00,//Ï
|
||||
0x6C,0x6C,0x6C,0x6C,0xFF,0x00,0x00,0x00,//Ð
|
||||
0x00,0x00,0xFF,0x00,0xFF,0x18,0x18,0x18,//Ñ
|
||||
0x00,0x00,0x00,0x00,0xFF,0x6C,0x6C,0x6C,//Ò
|
||||
0x6C,0x6C,0x6C,0x6C,0xFC,0x00,0x00,0x00,//Ó
|
||||
0x18,0x18,0xF8,0x18,0xF8,0x00,0x00,0x00,//Ô
|
||||
0x00,0x00,0xF8,0x18,0xF8,0x18,0x18,0x18,//Õ
|
||||
0x00,0x00,0x00,0x00,0xFC,0x6C,0x6C,0x6C,//Ö
|
||||
0x6C,0x6C,0x6C,0x6C,0xEF,0x6C,0x6C,0x6C,//×
|
||||
0x18,0x18,0xFF,0x00,0xFF,0x18,0x18,0x18,//Ø
|
||||
0x18,0x18,0x18,0x18,0x1F,0x00,0x00,0x00,//Ù
|
||||
0x00,0x00,0x00,0x00,0xF8,0x18,0x18,0x18,//Ú
|
||||
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,//Û
|
||||
0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,//Ü
|
||||
0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,//Ý
|
||||
0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,//Þ
|
||||
0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,//ß
|
||||
0x00,0x00,0x6E,0x3B,0x13,0x3B,0x6E,0x00,//à
|
||||
0x00,0x1E,0x33,0x1F,0x33,0x1F,0x03,0x03,//á
|
||||
0x00,0x7F,0x63,0x03,0x03,0x03,0x03,0x00,//â
|
||||
0x00,0x7F,0x36,0x36,0x36,0x36,0x36,0x00,//ã
|
||||
0x7F,0x66,0x0C,0x18,0x0C,0x66,0x7F,0x00,//ä
|
||||
0x00,0x00,0x7E,0x33,0x33,0x33,0x1E,0x00,//å
|
||||
0x00,0x66,0x66,0x66,0x66,0x3E,0x06,0x03,//æ
|
||||
0x00,0x6E,0x3B,0x18,0x18,0x18,0x18,0x00,//ç
|
||||
0x3F,0x0C,0x1E,0x33,0x33,0x1E,0x0C,0x3F,//è
|
||||
0x1C,0x36,0x63,0x7F,0x63,0x36,0x1C,0x00,//é
|
||||
0x1C,0x36,0x63,0x63,0x36,0x36,0x77,0x00,//ê
|
||||
0x38,0x0C,0x18,0x3E,0x33,0x33,0x1E,0x00,//ë
|
||||
0x00,0x00,0x7E,0xDB,0xDB,0x7E,0x00,0x00,//ì
|
||||
0x60,0x30,0x7E,0xDB,0xDB,0x7E,0x06,0x03,//í
|
||||
0x3C,0x06,0x03,0x3F,0x03,0x06,0x3C,0x00,//î
|
||||
0x1E,0x33,0x33,0x33,0x33,0x33,0x33,0x00,//ï
|
||||
0x00,0x3F,0x00,0x3F,0x00,0x3F,0x00,0x00,//ð
|
||||
0x0C,0x0C,0x3F,0x0C,0x0C,0x00,0x3F,0x00,//ñ
|
||||
0x06,0x0C,0x18,0x0C,0x06,0x00,0x3F,0x00,//ò
|
||||
0x18,0x0C,0x06,0x0C,0x18,0x00,0x3F,0x00,//ó
|
||||
0x70,0xD8,0xD8,0x18,0x18,0x18,0x18,0x18,//ô
|
||||
0x18,0x18,0x18,0x18,0x18,0x1B,0x1B,0x0E,//õ
|
||||
0x0C,0x0C,0x00,0x3F,0x00,0x0C,0x0C,0x00,//ö
|
||||
0x00,0x4E,0x39,0x00,0x4E,0x39,0x00,0x00,//÷
|
||||
0x1C,0x36,0x36,0x1C,0x00,0x00,0x00,0x00,//ø
|
||||
0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,//ù
|
||||
0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,//ú
|
||||
0xF0,0x30,0x30,0x30,0x37,0x36,0x3C,0x38,//û
|
||||
0x1E,0x36,0x36,0x36,0x36,0x00,0x00,0x00,//ü
|
||||
0x1E,0x30,0x1C,0x06,0x3E,0x00,0x00,0x00,//ý
|
||||
0x00,0x00,0x3C,0x3C,0x3C,0x3C,0x00,0x00,//þ
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//ÿ
|
||||
};
|
||||
+91
-72
@@ -77,7 +77,7 @@ USE64
|
||||
// OUT: RAX
|
||||
SYS_HASH_STR::
|
||||
XOR RAX,RAX
|
||||
OR RSI,RSI
|
||||
TEST RSI,RSI
|
||||
JZ @@15
|
||||
|
||||
PUSH RSI
|
||||
@@ -88,7 +88,7 @@ SYS_HASH_STR::
|
||||
@@05: SHL1 RBX
|
||||
ADC RBX,RAX
|
||||
@@10: LODSB
|
||||
OR AL,AL
|
||||
TEST AL,AL
|
||||
JNZ @@05
|
||||
|
||||
MOV RAX,RBX
|
||||
@@ -111,7 +111,7 @@ SYS_HASH_STR::
|
||||
SYS_HASH_SINGLE_TABLE_FIND1::
|
||||
MOV RCX,1
|
||||
SYS_HASH_SINGLE_TABLE_FIND::
|
||||
OR RCX,RCX
|
||||
TEST RCX,RCX
|
||||
JNZ @@05
|
||||
XOR RAX,RAX
|
||||
RET
|
||||
@@ -119,7 +119,7 @@ SYS_HASH_SINGLE_TABLE_FIND::
|
||||
MOV RDX,U64 CHashTable.body[RDI]
|
||||
LEA RDX,U64 [RDX+RAX*8]
|
||||
@@10: MOV RAX,U64 [RDX]
|
||||
OR RAX,RAX
|
||||
TEST RAX,RAX
|
||||
JNZ @@15
|
||||
RET
|
||||
|
||||
@@ -133,14 +133,14 @@ SYS_HASH_SINGLE_TABLE_FIND::
|
||||
CMP U8 [RDI],AL
|
||||
JNE @@25
|
||||
INC RDI
|
||||
OR AL,AL
|
||||
TEST AL,AL
|
||||
JNZ @@20
|
||||
POP RSI
|
||||
POP RDI
|
||||
POP RAX
|
||||
LOOP @@30
|
||||
INC U32 CHash.use_cnt[RAX]
|
||||
OR RAX,RAX
|
||||
TEST RAX,RAX
|
||||
RET
|
||||
|
||||
@@25: POP RSI
|
||||
@@ -167,7 +167,7 @@ SYS_HASH_FIND::
|
||||
JNZ @@15
|
||||
POP RAX
|
||||
@@10: MOV RDI,U64 CHashTable.next[RDI]
|
||||
OR RDI,RDI
|
||||
TEST RDI,RDI
|
||||
JNZ @@05
|
||||
POP RDI
|
||||
XOR RAX,RAX
|
||||
@@ -175,7 +175,7 @@ SYS_HASH_FIND::
|
||||
|
||||
@@15: ADD RSP,8
|
||||
POP RDI
|
||||
OR RAX,RAX
|
||||
TEST RAX,RAX
|
||||
RET
|
||||
// ************************************
|
||||
// IN: RSI=STR
|
||||
@@ -211,7 +211,7 @@ SYS_EXT_FIND::
|
||||
@@10: MOV RAX,U64 CHashExport.val[RAX]
|
||||
@@15: POP RBX
|
||||
POP RDI
|
||||
OR RAX,RAX
|
||||
TEST RAX,RAX
|
||||
RET
|
||||
_EXT_FIND::
|
||||
ENTER 0
|
||||
@@ -341,12 +341,12 @@ _HASH_REPLACE::
|
||||
PUSH RSI
|
||||
PUSH RDI
|
||||
MOV RCX,U64 SF_ARG1[RBP]
|
||||
OR RCX,RCX
|
||||
TEST RCX,RCX
|
||||
JZ @@15
|
||||
MOV RSI,U64 CHash.str[RCX]
|
||||
XOR RBX,RBX
|
||||
MOV EBX,U32 CHash.type[RCX]
|
||||
AND EBX,~HTF_FLAGS_MASK&0xFFFFFFFF
|
||||
AND EBX,~HTG_FLAGS_MASK&0xFFFFFFFF
|
||||
MOV RDI,U64 SF_ARG2[RBP]
|
||||
MOV RCX,U64 SF_ARG3[RBP]
|
||||
CALL SYS_HASH_STR
|
||||
@@ -381,7 +381,7 @@ _HASH_REPLACE::
|
||||
MOV U64 [RDX],RCX
|
||||
POPFD
|
||||
|
||||
OR RAX,RAX
|
||||
TEST RAX,RAX
|
||||
JZ @@15
|
||||
PUSH_C_REGS
|
||||
PUSH RAX
|
||||
@@ -398,12 +398,12 @@ _HASH_REM_DEL::
|
||||
PUSH RSI
|
||||
PUSH RDI
|
||||
MOV RCX,U64 SF_ARG1[RBP]
|
||||
OR RCX,RCX
|
||||
TEST RCX,RCX
|
||||
JZ @@10
|
||||
MOV RSI,U64 CHash.str[RCX]
|
||||
XOR RBX,RBX
|
||||
MOV EBX,U32 CHash.type[RCX]
|
||||
AND EBX,~HTF_FLAGS_MASK&0xFFFFFFFF
|
||||
AND EBX,~HTG_FLAGS_MASK&0xFFFFFFFF
|
||||
MOV RDI,U64 SF_ARG2[RBP]
|
||||
MOV RCX,U64 SF_ARG3[RBP]
|
||||
CALL SYS_HASH_STR
|
||||
@@ -461,7 +461,7 @@ _extern _HASH_REM_DEL Bool HashRemDel(CHash *temph,CHashTable *table,
|
||||
I64 HashTypeNum(CHash *temph)
|
||||
{
|
||||
if (temph)
|
||||
return Bsf(temph->type&HTT_TYPE_MASK);
|
||||
return Bsf(temph->type&HTG_TYPE_MASK);
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
@@ -533,37 +533,37 @@ CHashGeneric *HashGenericAdd(U8 *name,I64 type,I64 u0=0,I64 u1=0,I64 u2=0,CTask
|
||||
return result;
|
||||
}
|
||||
|
||||
I64 NamedFramePtr(U8 *name,CTask *task=NULL)
|
||||
I64 FramePtr(U8 *name,CTask *task=NULL)
|
||||
{
|
||||
CHashGeneric *temph;
|
||||
if (!task) task=Fs;
|
||||
if (temph=HashFind(name,task->hash_table,HTT_NAMED_FRAME_PTR))
|
||||
if (temph=HashFind(name,task->hash_table,HTT_FRAME_PTR))
|
||||
return temph->user_data0;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
CHashGeneric *NamedFramePtrAdd(U8 *name,I64 val,CTask *task=NULL)
|
||||
CHashGeneric *FramePtrAdd(U8 *name,I64 val,CTask *task=NULL)
|
||||
{
|
||||
return HashGenericAdd(name,HTT_NAMED_FRAME_PTR,val,0,0,task);
|
||||
return HashGenericAdd(name,HTT_FRAME_PTR,val,0,0,task);
|
||||
}
|
||||
|
||||
I64 NamedFramePtrSet(U8 *name,I64 val,CTask *task=NULL)
|
||||
I64 FramePtrSet(U8 *name,I64 val,CTask *task=NULL)
|
||||
{
|
||||
CHashGeneric *temph;
|
||||
if (!task) task=Fs;
|
||||
if (temph=HashFind(name,task->hash_table,HTT_NAMED_FRAME_PTR))
|
||||
if (temph=HashFind(name,task->hash_table,HTT_FRAME_PTR))
|
||||
return LXchgU64(&temph->user_data0,val);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
I64 NamedFramePtrDel(U8 *name,CTask *task=NULL)
|
||||
I64 FramePtrDel(U8 *name,CTask *task=NULL)
|
||||
{
|
||||
CHashGeneric *temph;
|
||||
I64 result=0;
|
||||
if (!task) task=Fs;
|
||||
if (temph=HashFind(name,task->hash_table,HTT_NAMED_FRAME_PTR)) {
|
||||
if (temph=HashFind(name,task->hash_table,HTT_FRAME_PTR)) {
|
||||
result=temph->user_data0;
|
||||
HashRemDel(temph,task->hash_table);
|
||||
}
|
||||
@@ -574,11 +574,9 @@ U0 LoadOneImport(U8 **_src,U8 *module_base,I64 ld_flags)
|
||||
{
|
||||
U8 *src=*_src,*ptr2,*st_ptr;
|
||||
I64 i,etype;
|
||||
CHashExport *tempess=NULL;
|
||||
CHashExport *tempex=NULL;
|
||||
CHashImport *tempiss;
|
||||
Bool first=TRUE;
|
||||
CHashFun *tempf;
|
||||
CHashGlblVar *tempg;
|
||||
|
||||
while (etype=*src++) {
|
||||
i=*src(U32 *)++;
|
||||
@@ -590,11 +588,10 @@ U0 LoadOneImport(U8 **_src,U8 *module_base,I64 ld_flags)
|
||||
return;
|
||||
} else {
|
||||
first=FALSE;
|
||||
if (!(tempess=HashFind(st_ptr,Fs->hash_table,HTG_ALL-HTT_IMPORT_SYS_SYM))) {
|
||||
if (!(tempex=HashFind(st_ptr,Fs->hash_table,HTG_ALL-HTT_IMPORT_SYS_SYM))) {
|
||||
if (!(ld_flags & LDF_SILENT)) {
|
||||
PutDefine("ST_UNRESOLVED_REFERENCE");
|
||||
"" st_ptr;
|
||||
NewLine;
|
||||
"%s\n",st_ptr;
|
||||
}
|
||||
tempiss=CAlloc(sizeof(CHashImport));
|
||||
tempiss->str=StrNew(st_ptr);
|
||||
@@ -605,34 +602,24 @@ U0 LoadOneImport(U8 **_src,U8 *module_base,I64 ld_flags)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (tempess) {
|
||||
if (tempex) {
|
||||
ptr2=module_base+i;
|
||||
if (tempess->type & HTT_FUN) {
|
||||
tempf=tempess;
|
||||
if (etype & 1)
|
||||
i=tempf->executable_addr;
|
||||
else
|
||||
i=tempf->executable_addr-module_base;
|
||||
} else if (tempess->type & HTT_GLBL_VAR) {
|
||||
tempg=tempess;
|
||||
if (etype & 1)
|
||||
i=tempg->data_addr;
|
||||
else
|
||||
i=tempg->data_addr-module_base;
|
||||
} else {
|
||||
if (etype & 1)
|
||||
i=tempess->val;
|
||||
else
|
||||
i=tempess->val(U8 *)-module_base;
|
||||
if (tempex->type & HTT_FUN)
|
||||
i=tempex(CHashFun *)->executable_addr;
|
||||
else if (tempex->type & HTT_GLBL_VAR)
|
||||
i=tempex(CHashGlblVar *)->data_addr;
|
||||
else
|
||||
i=tempex->val;
|
||||
switch (etype) {
|
||||
case EIE_REL_U8: *ptr2(U8 *) =i-ptr2-1; break;
|
||||
case EIE_IMM_U8: *ptr2(U8 *) =i; break;
|
||||
case EIE_REL_U16: *ptr2(U16 *)=i-ptr2-2; break;
|
||||
case EIE_IMM_U16: *ptr2(U16 *)=i; break;
|
||||
case EIE_REL_U32: *ptr2(U32 *)=i-ptr2-4; break;
|
||||
case EIE_IMM_U32: *ptr2(U32 *)=i; break;
|
||||
case EIE_REL_U64: *ptr2(I64 *)=i-ptr2-8; break;
|
||||
case EIE_IMM_U64: *ptr2(I64 *)=i; break;
|
||||
}
|
||||
if (etype<=EIE_LIT_U8)
|
||||
*ptr2(U8 *)+=i;
|
||||
else if (etype<=EIE_LIT_U16)
|
||||
*ptr2(U16 *)+=i;
|
||||
else if (etype<=EIE_LIT_U32)
|
||||
*ptr2(U32 *)+=i;
|
||||
else if (etype<=EIE_LIT_U64)
|
||||
*ptr2(I64 *)+=i;
|
||||
}
|
||||
}
|
||||
*_src=src-1;
|
||||
@@ -653,25 +640,25 @@ U0 LoadPass1(U8 *src,U8 *module_base,I64 ld_flags)
|
||||
{
|
||||
U8 *ptr2,*ptr3,*st_ptr;
|
||||
I64 i,j,cnt,etype;
|
||||
CHashExport *tempess=NULL;
|
||||
CHashExport *tempex=NULL;
|
||||
while (etype=*src++) {
|
||||
i=*src(U32 *)++;
|
||||
st_ptr=src;
|
||||
src+=StrLen(st_ptr)+1;
|
||||
switch (etype) {
|
||||
case EIE_REL_EXPORT:
|
||||
case EIE_LIT_EXPORT:
|
||||
tempess=CAlloc(sizeof(CHashExport));
|
||||
tempess->str=StrNew(st_ptr);
|
||||
tempess->type=HTT_EXPORT_SYS_SYM|HTF_LIT;
|
||||
if (etype==EIE_LIT_EXPORT)
|
||||
tempess->val=i;
|
||||
case EIE_IMM_EXPORT:
|
||||
tempex=CAlloc(sizeof(CHashExport));
|
||||
tempex->str=StrNew(st_ptr);
|
||||
tempex->type=HTT_EXPORT_SYS_SYM|HTF_IMM;
|
||||
if (etype==EIE_IMM_EXPORT)
|
||||
tempex->val=i;
|
||||
else
|
||||
tempess->val=i+module_base;
|
||||
HashAdd(tempess,Fs->hash_table);
|
||||
tempex->val=i+module_base;
|
||||
HashAdd(tempex,Fs->hash_table);
|
||||
SysSymImportsResolve(st_ptr,ld_flags);
|
||||
break;
|
||||
case EIE_REL_U8...EIE_LIT_U64:
|
||||
case EIE_REL_U8...EIE_IMM_U64:
|
||||
src=st_ptr-5;
|
||||
LoadOneImport(&src,module_base,ld_flags);
|
||||
break;
|
||||
@@ -690,11 +677,11 @@ U0 LoadPass1(U8 *src,U8 *module_base,I64 ld_flags)
|
||||
ptr3=MAlloc(*src(I64 *)++);
|
||||
|
||||
if (*st_ptr) {
|
||||
tempess=CAlloc(sizeof(CHashExport));
|
||||
tempess->str=StrNew(st_ptr);
|
||||
tempess->type=HTT_EXPORT_SYS_SYM|HTF_LIT;
|
||||
tempess->val=ptr3;
|
||||
HashAdd(tempess,Fs->hash_table);
|
||||
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;
|
||||
@@ -805,5 +792,37 @@ U0 LoadKernel()
|
||||
//No main routines
|
||||
// LoadPass2(sys_boot_patch_table_base,sys_boot_base,0);
|
||||
}
|
||||
| ||||