// Main ZenithOS header #help_index "" extern class CAOT; extern class CAOTHeapGlobal; extern class CAOTImportExport; extern class CCPU; extern class CDC; extern class CDirContext; extern class CDoc; extern class CFile; extern class CHashClass; extern class CHashFun; extern class CHeapCtrl; extern class CIntermediateCode; extern class CJobCtrl; extern class CTask; #define NULL 0 #define TRUE 1 #define FALSE 0 #define ON 1 #define OFF 0 #define NONE 0 //for use in default arguments #define I8_MIN (-0x80) #define I8_MAX 0x7F #define U8_MIN 0 #define U8_MAX 0xFF #define I16_MIN (-0x8000) #define I16_MAX 0x7FFF #define U16_MIN 0 #define U16_MAX 0xFFFF #define I32_MIN (-0x80000000) #define I32_MAX 0x7FFFFFFF #define U32_MIN 0 #define U32_MAX 0xFFFFFFFF #define I64_MIN (-0x8000000000000000) #define I64_MAX 0x7FFFFFFFFFFFFFFF #define U64_MIN 0 #define U64_MAX 0xFFFFFFFFFFFFFFFF #define INVALID_PTR I64_MAX #define STR_LEN 144 //(Int to F64 conversion is signed) //Turn off 80-bit float constants with $LK,"OPTf_NO_BUILTIN_CONST",A="MN:OPTf_NO_BUILTIN_CONST"$. #define U64_F64_MAX (0x43F0000000000000(F64)) #define F64_MAX (0x7FEFFFFFFFFFFFFF(F64)) #define F64_MIN (0xFFEFFFFFFFFFFFFF(F64)) #define inf (0x7FF0000000000000(F64)) #define ì (0x7FF0000000000000(F64)) #define pi (0x400921FB54442D18(F64)) #define ã (0x400921FB54442D18(F64)) #define exp_1 (0x4005BF0A8B145769(F64)) //The number "e" #define log2_10 (0x400A934F0979A371(F64)) #define log2_e (0x3FF71547652B82FE(F64)) #define log10_2 (0x3FD34413509F79FF(F64)) #define loge_2 (0x3FE62E42FEFA39EF(F64)) #define sqrt2 (0x3FF6A09E667F3BCD(F64)) #define eps (0x3CB0000000000000(F64)) #help_index "Data Types/Simple" /*CosmiC union structure is treated as a whole if no member is specified, similar to bit fields. See $LK,"::/Demo/SubIntAccess.CC"$. */ U16i union U16 { I8i i8[2]; U8i u8[2]; }; I16i union I16 { I8i i8[2]; U8i u8[2]; }; U32i union U32 { I8i i8[4]; U8i u8[4]; I16 i16[2]; U16 u16[2]; }; I32i union I32 { I8i i8[4]; U8i u8[4]; I16 i16[2]; U16 u16[2]; }; U64i union U64 { I8i i8[8]; U8i u8[8]; I16 i16[4]; U16 u16[4]; I32 i32[2]; U32 u32[2]; }; I64i union I64 { I8i i8[8]; U8i u8[8]; I16 i16[4]; U16 u16[4]; I32 i32[2]; U32 u32[2]; }; #help_index "Math/Complex;Data Types/Complex" public class Complex { F64 x,y; }; #help_index "Data Types/Circular Queue" public class CQueue { CQueue *next,*last; }; #help_index "Graphics/Data Types/D3I32;Math/Data Types/D3I32;Data Types/D3I32" public class CD3I32 //Three dimensional I32 pt { I32 x,y,z; }; public class CQueueD3I32 //Queue of three dimensional I32 pts { CQueueD3I32 *next,*last; CD3I32 p; }; #help_index "Math/Data Types;Data Types" public class CD2I32 //Two dimensional I32 pt { I32 x,y; }; public class CD2I64 //Two dimensional I64 pt { I64 x,y; }; public class CD3I64 //Three dimensional I64 pt { I64 x,y,z; }; public class CD2 //Two dimensional F64 pt { F64 x,y; }; #help_index "Math/CD3;Data Types/CD3" public class CD3 //Three dimensional F64 pt { F64 x,y,z; }; #help_index "Data Types/Queue Vector" #define QUE_VECT_U8_COUNT 512 public class CQueueVectU8 { CQueueVectU8 *next,*last; I64 total_count,node_count,min_idx; U8 body[QUE_VECT_U8_COUNT]; }; #help_index "Data Types/Fifo" public class CFifoU8 { U8 *buf; I64 mask,in_ptr,out_ptr; }; public class CFifoI64 { I64 *buf; I64 mask,in_ptr,out_ptr; }; #help_index "Date/CMOS" #define CMOS_SEL 0x70 //select which reg to access using this port #define CMOS_DATA 0x71 //read from or write to reg using this port //CMOS registers #define CMOSR_SEC 0x0 #define CMOSR_MIN 0x2 #define CMOSR_HOUR 0x4 #define CMOSR_DAY_OF_WEEK 0x6 #define CMOSR_DAY_OF_MONTH 0x7 #define CMOSR_MONTH 0x8 #define CMOSR_YEAR 0x9 #define CMOSR_STATUS_A 0xA #define CMOSR_STATUS_B 0xB //CMOS status flags #define CMOSF_BINARY (1 << 2) #define CMOSF_UPDATING (1 << 7) #help_index "Date/CDate" #define CDATE_YEAR_DAYS 365.24225 #define CDATE_YEAR_DAYS_INT 36524225 #define CDATE_BASE_DAY_OF_WEEK 0 public I64 class CDate { U32 time; I32 date; }; #help_index "Date;Date/CDate" public class CDateStruct { U8 sec10000,sec100,sec,min,hour, day_of_week,day_of_mon,mon; I32 year; }; #help_index "Math/ODE" public class COrder2D3 { F64 x,y,z, DxDt,DyDt,DzDt; }; #define MSF_INACTIVE 1 #define MSF_FIXED 2 public class CMass { CMass *next,*last; COrder2D3 *state, //Point to entries in $LK,"CMathODE",A="MN:CMathODE"$.state[] *DstateDt; //Point to entries in $LK,"CMathODE",A="MN:CMathODE"$.DstateDt[] U0 start; U32 flags,num; F64 mass,drag_profile_factor; U0 saved_state; F64 x,y,z, DxDt,DyDt,DzDt; U0 end; }; #define SSF_INACTIVE 1 #define SSF_NO_COMPRESSION 2 #define SSF_NO_TENSION 4 public class CSpring { CSpring *next,*last; CMass *end1,*end2; F64 f,displacement; //set for you to check U0 start; U32 flags,num, end1_num,end2_num; F64 const,rest_len; U0 end; }; //Ordinary Differential Equations #define ODEF_HAS_MASSES 1 #define ODEF_PAUSED 2 #define ODEF_STARTED 4 #define ODEF_BUSY 8 #define ODEf_HAS_MASSES 0 #define ODEf_PAUSED 1 #define ODEf_STARTED 2 #define ODEf_BUSY 3 public class CMathODE { CMathODE *next,*last; I64 flags,n,n_internal; CMass *next_mass,*last_mass; CSpring *next_spring,*last_spring; F64 drag_v, //drag proportional to velocity drag_v2, //drag proportional to velocity squared drag_v3, //drag proportional to velocity cubed acceleration_limit, //This clips acceleration base_t, t,t_scale, h,h_min,h_max; //This is not precise, just a ballpark. //ZenithOS CMathODE's are for video games //not science. It bails if it takes //too long. F64 min_tolerance,max_tolerance; F64 tolerance_internal, *array_base, *state, *state_internal, *DstateDt, *state_scale, *initial_state, *tmp0,*tmp1,*tmp2,*tmp3, *tmp4,*tmp5,*tmp6,*tmp7; CTask *mem_task,*win_task; U0 (*derive)(CMathODE *o,F64 t,F64 *state,F64 *DstateDt); U0 (*mp_derive)(CMathODE *o,F64 t, //If break into parallel pieces. I64 cpu_num,F64 *state,F64 *DstateDt); CTask **slave_tasks; I64 mp_not_done_flags; F64 mp_t,*mp_state,*mp_DstateDt; I64 user_data; }; #help_index "Processor" //IDT entry types #define IDTET_TASK 0x05 #define IDTET_IRQ 0x0E #define IDTET_TRAP 0x0F //Same as IRQ but doesnt do CLI. //Interrupts //0x00-0x1F are reserved by Intel #define I_DIV_ZERO 0x00 #define I_SINGLE_STEP 0x01 #define I_NMI 0x02 #define I_BPT 0x03 #define I_PAGE_FAULT 0x0E //0x20-0x2F are used for hardware #define I_TIMER 0x20 //Software Interrupts #define I_MP_CRASH 0x30 #define I_WAKE 0x31 #define I_DEBUG 0x32 //See $LK,"ST_INT_NAMES",A="MN:ST_INT_NAMES"$ //You might want to start backward from //0xFF for your own interrupts. #define I_USER 0x40 #define MP_PROCESSORS_NUM 128 //Control register flag bits #define CR0f_PE 0 //Protection Enable (Protected mode) #define CR0f_MP 1 //Monitor coprocessor #define CR0f_EM 2 //Emulation of coprocessor #define CR0f_TS 3 //Task switched, some irrelevant x87 task management stuff #define CR0f_NE 5 //Numeric error #define CR0f_PG 31//Enable paging #define CR0F_PE (1< (Exit and Save) #define DOCEF_QUIT 0x4000000000 //Send (Abort) #define DOCEF_FROM_START 0x8000000000 #define DOCEF_HAS_BORDER 0x10000000000 #define DOCEF_SOLID_BORDER 0x20000000000 #define DOCEF_BORDER_PLOT 0x40000000000 #define DOCEF_CHECKED_COLLAPSED 0x80000000000 //Checked or Collapsed #define DOCEF_CHECK_COLLAPSABLE 0x100000000000 #define DOCEF_REFRESH_DATA 0x200000000000 #define DOCEF_UPDATE_DATA 0x400000000000 //$LK,"DOCEF_DEREF_DATA",A="MN:DOCEF_DEREF_DATA"$ is confusing. $LK,"DocForm",A="MN:DocForm"$() makes doc_e->data point to members //of class. For ints, it derefs doc_e->data as a ptr. For strings, it doesn't. #define DOCEF_DEREF_DATA 0x800000000000 #define DOCEF_REMALLOC_DATA 0x1000000000000 #define DOCEF_HAS_TERMINATOR 0x2000000000000 #define DOCEF_ZERO_BASED 0x4000000000000 #define DOCEF_HOLD 0x8000000000000 #define DOCEF_TREE 0x10000000000000 #define DOCEF_LIST 0x20000000000000 #define DOCEF_SKIP 0x40000000000000 #define DOCEF_POPUP 0x80000000000000 #define DOCEF_SKIP_IN_FORM 0x100000000000000 #define DOCEF_FILTER_SKIP 0x200000000000000 #define DOCEF_NO_CLICK_ON 0x400000000000000 #define DOCEF_DONT_DRAW 0x800000000000000 //only works on sprites #define DOCEF_DEFAULT_LEN 0x1000000000000000 #define DOCEF_DEFAULT_RAW_TYPE 0x2000000000000000 #define DOCEG_HAS_ALLOC (DOCEF_TAG|DOCEF_AUX_STR|DOCEF_DEFINE|\ DOCEF_HTML_LINK|DOCEF_LEFT_MACRO|DOCEF_RIGHT_MACRO|DOCEF_BIN_PTR_LINK|\ DOCEF_REMALLOC_DATA) #define DOCEG_HAS_ARG ((DOCEG_HAS_ALLOC&~DOCEF_REMALLOC_DATA)|\ DOCEF_LEN|DOCEF_LEFT_EXP|DOCEF_RIGHT_EXP|DOCEF_HAS_BIN|DOCEF_RAW_TYPE|\ DOCEF_SHIFTED_X|DOCEF_SHIFTED_Y|DOCEF_SCROLLING_X|DOCEF_USER_DATA) #define DOCEG_DONT_EDIT (DOCEF_DEFINE|DOCEF_HTML_LINK|\ DOCEF_AUX_STR|DOCEF_BIN_PTR_LINK|DOCEF_SCROLLING_X|DOCEF_TAG_CB) //These are ident to Doc flags #define DOCEF_HIGHLIGHT 0x4000000 #define DOCEF_WORD_WRAP 0x8000000 #define DOCEF_BLINK ATTRF_BLINK #define DOCEF_INVERT ATTRF_INVERT #define DOCEF_SEL ATTRF_SEL #define DOCEF_UNDERLINE ATTRF_UNDERLINE #define DOCEf_HIGHLIGHT 26 #define DOCEf_WORD_WRAP 27 #define DOCEf_BLINK ATTRf_BLINK #define DOCEf_INVERT ATTRf_INVERT #define DOCEf_SEL ATTRf_SEL #define DOCEf_UNDERLINE ATTRf_UNDERLINE //CDocEntry.de_flags. These first 16 are arg= #define DOCEf_TAG 0 #define DOCEf_LEN 1 #define DOCEf_AUX_STR 2 #define DOCEf_DEFINE 3 #define DOCEf_HTML_LINK 4 #define DOCEf_LEFT_EXP 5 #define DOCEf_LEFT_MACRO 6 #define DOCEf_RIGHT_EXP 7 #define DOCEf_RIGHT_MACRO 8 #define DOCEf_HAS_BIN 9 #define DOCEf_BIN_PTR_LINK 10 #define DOCEf_RAW_TYPE 11 #define DOCEf_SHIFTED_X 12 #define DOCEf_SHIFTED_Y 13 #define DOCEf_SCROLLING_X 14 #define DOCEf_USER_DATA 15 //CDocEntry.de_flags. These are +/- flags #define DOCEf_LEFT_CB 16 #define DOCEf_LEFT_IN_STR 17 #define DOCEf_RIGHT_CB 18 #define DOCEf_RIGHT_IN_STR 19 #define DOCEf_LEFT_X 20 #define DOCEf_CENTER_X 21 #define DOCEf_RIGHT_X 22 #define DOCEf_TOP_Y 23 #define DOCEf_CENTER_Y 24 #define DOCEf_BOTTOM_Y 25 //HL...UL #define DOCEf_TAG_CB 32 #define DOCEf_PAGE_REL_Y 33 #define DOCEf_MARGIN_REL_X 34 #define DOCEf_WIN_REL 35 #define DOCEf_LINK 36 #define DOCEf_ESC 37 //Send (Exit and Save) #define DOCEf_QUIT 38 //Send (Abort) #define DOCEf_FROM_START 39 #define DOCEf_HAS_BORDER 40 #define DOCEf_SOLID_BORDER 41 #define DOCEf_BORDER_PLOT 42 #define DOCEf_CHECKED_COLLAPSED 43 //Checked or Collapsed #define DOCEf_CHECK_COLLAPSABLE 44 #define DOCEf_REFRESH_DATA 45 #define DOCEf_UPDATE_DATA 46 #define DOCEf_DEREF_DATA 47 #define DOCEf_REMALLOC_DATA 48 #define DOCEf_HAS_TERMINATOR 49 #define DOCEf_ZERO_BASED 50 #define DOCEf_HOLD 51 #define DOCEf_TREE 52 #define DOCEf_LIST 53 #define DOCEf_SKIP 54 #define DOCEf_POPUP 55 #define DOCEf_SKIP_IN_FORM 56 #define DOCEf_FILTER_SKIP 57 #define DOCEf_NO_CLICK_ON 58 #define DOCEf_DONT_DRAW 59 //only works on sprites #define DOCEf_DEFAULT_LEN 60 #define DOCEf_DEFAULT_RAW_TYPE 61 #define DOCEf_FLAGS_NUM 62 public class CDocBin { CDocBin *next,*last; I32 tmp_use_count,renum_num; U8 *tag; U0 start; U32 num,flags,size,use_count; U0 end; U8 *data; #assert !($$&7) }; #define DOC_SCROLL_SPEED 8 #define DOCSS_NORMAL 0 #define DOCSS_SINGLE_QUOTE 1 #define DOCSS_DBL_QUOTE 2 #define DOCSS_COMMENT 3 #define DOCSS_CPP_Z_COMMENT 4 #define DOC_ATTR_DEFAULT_TEXT WHITE<<4+BLACK #define DOC_COLOR_ALT_TEXT LTGRAY #define DOC_COLOR_LINK RED #define DOC_COLOR_MACRO LTBLUE #define DOC_COLOR_ANCHOR DKGRAY #define DOC_COLOR_TREE PURPLE #define DOC_COLOR_PROMPT GREEN #define DOC_COLOR_COMMENT GREEN #define DOC_COLOR_BIN LTGREEN #define DOC_COLOR_STR BROWN #define DOC_COLOR_CHAR_CONST BROWN #define DOC_COLOR_EXPORT_SYS_SYM LTPURPLE #define DOC_COLOR_DEFINE_STR CYAN #define DOC_COLOR_GLBL_VAR LTCYAN #define DOC_COLOR_CLASS LTBLUE #define DOC_COLOR_FUN PURPLE #define DOC_COLOR_KEYWORD BLUE #define DOC_COLOR_REG LTRED #define DOC_COLOR_NUMBER YELLOW public class CDocSettings { U32 final_u32_attr; I16 left_margin,right_margin,indent; U16 page_len,header,footer; I8 shifted_x,shifted_y; U8 state,comment_depth,paren_depth,brace_depth, cur_text_attr,default_text_attr; }; #define DOC_DEFAULT I32_MIN public class CDocEntryBase { //This is a shortened structure for //cmds like the text cmd which //don't require the full CDocEntry structure. CDocEntryBase *next,*last; U8 *tag; union { U8 type_u8; //this stores the code U32 type; //these store attr flags }; I32 page_line_num; I64 de_flags; I32 x,y; U32 min_col,max_col; CDocSettings settings; I64 user_data; #assert !($$&7) }; #define DOCE_LEN_DEFAULT 64 public class CDocEntry:CDocEntryBase { union { I64 attr; I64 cursor_x_offset; I64 (*left_cb)(CDoc *doc,CDocEntry *doc_e); I64 left_exp; }; U8 *left_macro; union { I64 cursor_y_offset; I64 (*right_cb)(CDoc *doc,CDocEntry *doc_e); I64 right_exp; }; U8 *right_macro; U8 *(*tag_cb)(CDoc *doc,CDocEntry *doc_e,CTask *mem_task); U8 *define_str, *aux_str, *bin_ptr_link, *html_link, *my_format_data; I64 hex_ed_width; I32 scroll_len, len, //$LK,"DOCE_LEN_DEFAULT",A="MN:DOCE_LEN_DEFAULT"$ bin_num; U8 raw_type,pad[3]; CDocBin *bin_data; U8 *data; #assert !($$&7) }; //$LK,"DocForm",A="MN:DocForm"$() $LK,"DocMenu",A="MN:DocMenu"$() $LK,"DocEd",A="MN:DocEd"$() $LK,"PopUpMenu",A="MN:PopUpMenu"$() #define DOF_SIZE_MIN 0x01 #define DOF_INTERCEPT_TASK_END 0x02 #define DOF_DONT_HOME 0x04 #define DOF_WIN_MAX 0x08 #define DOF_DONT_TEXT_ATTR 0x10 #define DOF_DONT_WINMGR_SYNC 0x20 #define DOF_DONT_SHOW 0x40 //Combines with $LK,"Editor Flags",A="MN:EDF_BAIL"$ class CEdFindText { U8 find_text[STR_LEN] format "$$DA-P," "A=\"Find:%s\"$$\n", replace_text[STR_LEN] format "$$DA-P," "A=\"Replace:%s\"$$\n"; Bool replace format "$$CB,\"Replace\"$$\n", scan_fwd format "$$CB,\"Fwd\"$$\n", scan_sel_text format "$$CB,\"Selection\"$$\n", match_case format "$$CB,\"Match Case\"$$\n", whole_labels format "$$CB,\"Whole Labels\"$$\n", local_var format "$$CB,\"Rename Local Var\"$$\n", prompt,pad; I64 filter_lines format "$$DA,A=\"Filter Lines:%d\"$$\n"; }; class CEdFileName { CDirContext *dirc; U8 name[256] format "$$DA-P,LEN=255,A=\"FileName:%s\"$$"; }; //$LK,"Ed",A="MN:Ed"$() #define EDF_BAIL 0x100 #define EDF_COLLAPSE 0x200 #define EDF_UNCOLLAPSE 0x400 #define EDF_WAS_WRITE 0x800 //Was exit ESC or SHIFT_ESC? //Combines with $LK,"Document Flags",A="MN:DOF_SIZE_MIN"$ #define EDf_BAIL 8 #define EDf_COLLAPSE 9 #define EDf_UNCOLLAPSE 10 #define EDf_WAS_WRITE 11 // DOC header flags #define DOCF_PLAIN_TEXT 0x1 #define DOCF_PLAIN_TEXT_TABS 0x2 //has '\t', not DOCT_TAB #define DOCF_AUTO_SAVE 0x4 #define DOCF_NO_CURSOR 0x8 #define DOCF_CARRIAGE_RETURN 0x10 #define DOCF_DBL_DOLLARS 0x20 #define DOCF_COLOR_NAMES 0x40 //Reserved x1 #define DOCF_BORDER_DOC 0x100 #define DOCF_FORM 0x200 #define DOCF_SIZE_MIN 0x400 #define DOCF_HIDE_CURSOR 0x800 //use $LK,"DocCursor",A="MN:DocCursor"$ #define DOCF_DONT_HIGHLIGHT_CURSOR 0x1000 //use $LK,"DocHighlightCursor",A="MN:DocHighlightCursor"$ #define DOCF_NO_SCROLL_BARS 0x2000 //use $LK,"DocScroll",A="MN:DocScroll"$ #define DOCF_ALLOW_UNDO 0x4000 #define DOCF_DONT_SHOW 0x8000 #define DOCF_HAS_SONG 0x10000 #define DOCF_MORE 0x20000 #define DOCF_BWD_MOVEMENT 0x40000 #define DOCF_NULL_GRAB_SCROLL 0x80000 #define DOCF_DONT_SWAP_OUT 0x100000 #define DOCF_DO_FULL_REFRESH 0x200000 #define DOCF_BREAK_UNLOCKED 0x400000 //Reserved x1 #define DOCF_HIGHLIGHT DOCEF_HIGHLIGHT #define DOCF_WORD_WRAP DOCEF_WORD_WRAP #define DOCF_BLINK DOCEF_BLINK #define DOCF_INVERT DOCEF_INVERT #define DOCF_SEL DOCEF_SEL #define DOCF_UNDERLINE DOCEF_UNDERLINE #define DOCF_OVERSTRIKE 0x100000000 #define DOCF_IN_DOLLAR 0x200000000 #define DOCF_SUPERSCRIPT_MODE 0x400000000 #define DOCF_SUBSCRIPT_MODE 0x800000000 #define DOCF_UNDO_DIRTY 0x1000000000 #define DOCf_PLAIN_TEXT 0 #define DOCf_PLAIN_TEXT_TABS 1 //has '\t', not DOCT_TAB #define DOCf_AUTO_SAVE 2 #define DOCf_NO_CURSOR 3 #define DOCf_CARRIAGE_RETURN 4 #define DOCf_DBL_DOLLARS 5 #define DOCf_COLOR_NAMES 6 //Reserved x1 #define DOCf_BORDER_DOC 8 #define DOCf_FORM 9 #define DOCf_SIZE_MIN 10 #define DOCf_HIDE_CURSOR 11 //use $LK,"DocCursor",A="MN:DocCursor"$ #define DOCf_DONT_HIGHLIGHT_CURSOR 12 //use $LK,"DocHighlightCursor",A="MN:DocHighlightCursor"$ #define DOCf_NO_SCROLL_BARS 13 //use $LK,"DocScroll",A="MN:DocScroll"$ #define DOCf_ALLOW_UNDO 14 #define DOCf_DONT_SHOW 15 #define DOCf_HAS_SONG 16 #define DOCf_MORE 17 #define DOCf_BWD_MOVEMENT 18 #define DOCf_NULL_GRAB_SCROLL 19 #define DOCf_DONT_SWAP_OUT 20 #define DOCf_DO_FULL_REFRESH 21 #define DOCf_BREAK_UNLOCKED 22 //Reserved x1 #define DOCf_HIGHLIGHT DOCEf_HIGHLIGHT #define DOCf_WORD_WRAP DOCEf_WORD_WRAP #define DOCf_BLINK DOCEf_BLINK #define DOCf_INVERT DOCEf_INVERT #define DOCf_SEL DOCEf_SEL #define DOCf_UNDERLINE DOCEf_UNDERLINE #define DOCf_OVERSTRIKE 32 #define DOCf_IN_DOLLAR 33 #define DOCf_SUPERSCRIPT_MODE 34 #define DOCf_SUBSCRIPT_MODE 35 #define DOCf_UNDO_DIRTY 36 //locked flags #define DOClf_LOCKED 0 class CDocUndo { CDocUndo *next,*last; I64 size,doc_flags,time_stamp; U8 *body; }; //See $LK,"DocMenu",A="MN:DocMenu"$() #define DOCM_CANCEL (-1) #define DOC_SIGNATURE_VAL 'DocS' #define RECALCt_NORMAL 0x00 #define RECALCt_FIND_CURSOR 0x01 #define RECALCt_TO_SCREEN 0x02 #define RECALCG_MASK 0xFF #define RECALCF_HAS_CURSOR 0x100 #define RECALCF_ADD_CURSOR 0x200 #define RECALCF_TO_HTML 0x400 public class CDoc //Linked Text File header {//See $LK,"Doc",A="HI:Doc"$ for documentation. CDocEntryBase head; I64 flags,locked_flags; CDocEntry *cur_entry,*old_cur_entry; I32 cur_col,old_cur_col, line_start_col,top_line_num, dollar_buf_size,dollar_buf_ptr; U8 *dollar_buf; //When entering $$ cmds, it buffers them until the end $$. CTask *win_task,*mem_task,*owning_task; I32 page_line_num,undo_count, x,y,min_x,max_x,min_y,max_y; I64 line,col,best_d, old_win_top,old_win_bottom, old_win_left,old_win_right, cmd_U8; U32 doc_signature,cur_bin_num; I64 max_entries, updates_count; CEdFindText *find_replace; CEdFileName filename; I64 file_attr; I64 (*left_click_link)(CDoc *doc,CDocEntry *doc_e); I64 (*right_click_link)(CDoc *doc,CDocEntry *doc_e); //See $LK,"::/Apps/Psalmody/JukeBox.CC"$ U8 *user_put_data; //Passed to user_put_key() and user_put_s() Bool (*user_put_key)(CDoc *doc,U8 *data,I64 ch,I64 sc); Bool (*user_put_s)(CDoc *doc,U8 *data,U8 *st); CDoc *parent_doc; //(When browsing deeper, opening deeper docs.) U64 desc; //8 characters. See $LK,"DocBorderListDraw",A="MN:DocBorderListDraw"$(). CDocBin bin_head; CDocSettings settings_head; CDocUndo undo_head; I64 user_data; #assert !($$&7) }; #help_index "Windows" /* Fs->win_inhibit mask Some inhibit actions on the task itself. Some inhibit actions if the focus task tries to do something. */ #define WIF_SELF_FOCUS 0x0001 //If active this task cannot have focus //MENU 0x0002 #define WIF_SELF_CTRLS 0x0004 #define WIF_SELF_MS_L 0x0008 //MS_L_D 0x0010 #define WIF_SELF_MS_R 0x0020 //MS_R_D 0x0040 #define WIF_SELF_MS_WHEEL 0x0080 //Does nothing, yet #define WIF_SELF_BORDER 0x0100 #define WIF_SELF_GRAB_SCROLL 0x0200 #define WIF_SELF_DOC 0x0400 #define WIF_SELF_ODE 0x0800 #define WIF_SELF_KEY_DESC 0x1000 //FOCUS 0x00010000 #define WIF_FOCUS_TASK_MENU 0x00020000 #define WIF_FOCUS_TASK_CTRLS 0x00040000 #define WIF_FOCUS_TASK_MS_L 0x00080000 #define WIF_FOCUS_TASK_MS_L_D 0x00100000 #define WIF_FOCUS_TASK_MS_R 0x00200000 #define WIF_FOCUS_TASK_MS_R_D 0x00400000 #define WIF_FOCUS_TASK_MS_WHEEL 0x00800000 //Does nothing, yet #define WIF_FOCUS_TASK_BORDER 0x01000000 #define WIF_FOCUS_TASK_GRAB_SCROLL 0x02000000 #define WIG_DBL_CLICK (WIF_FOCUS_TASK_MS_L_D|WIF_FOCUS_TASK_MS_R_D) #define WIG_TASK_DEFAULT (WIF_FOCUS_TASK_MENU|WIG_DBL_CLICK|\ 0xFFFF-WIF_SELF_DOC-WIF_SELF_ODE) #define WIG_NO_FOCUS_TASK_DEFAULT (WIG_TASK_DEFAULT-WIF_SELF_BORDER\ -WIF_SELF_MS_L-WIF_SELF_MS_R-WIG_DBL_CLICK) #define WIG_USER_TASK_DEFAULT WIF_SELF_KEY_DESC #define WIf_SELF_FOCUS 0 #define WIf_SELF_CTRLS 2 #define WIf_SELF_MS_L 3 #define WIf_SELF_MS_R 5 #define WIf_SELF_MS_WHEEL 7 #define WIf_SELF_BORDER 8 #define WIf_SELF_GRAB_SCROLL 9 #define WIf_SELF_DOC 10 #define WIf_SELF_ODE 11 #define WIf_SELF_KEY_DESC 12 #define WIf_FOCUS_TASK_MENU 17 #define WIf_FOCUS_TASK_CTRLS 18 #define WIf_FOCUS_TASK_MS_L 19 #define WIf_FOCUS_TASK_MS_L_D 20 #define WIf_FOCUS_TASK_MS_R 21 #define WIf_FOCUS_TASK_MS_R_D 22 #define WIf_FOCUS_TASK_MS_WHEEL 23 #define WIf_FOCUS_TASK_BORDER 24 #define WIf_FOCUS_TASK_GRAB_SCROLL 25 class CWinMgrTimingGlobals { I64 last_total_jiffies, last_idle_pt_hits[MP_PROCESSORS_NUM], last_swap_counter[MP_PROCESSORS_NUM]; F64 last_calc_idle_time,calc_idle_delta_time; I64 calc_idle_count; }; #define WINMGR_FPS (30000.0/1001) #define WINMGR_PERIOD (1001/30000.0) public class CWinMgrGlobals { I64 updates; F64 ode_time, last_ode_time, fps, //You can read but not write this. You have no control. ideal_refresh_tS, last_refresh_tS; CWinMgrTimingGlobals *t; Bool show_menu,grab_scroll,grab_scroll_closed; }; #help_index "AutoComplete" #define ACf_INIT_IN_PROGRESS 0 #define ACf_LAST_WAS_KEYMAP 1 #define AC_FILLINS_NUM 12 public class CAutoCompleteGlobals { I64 col,row,old_col,old_row,num_words; CHashTable *hash_table; U8 *cur_word; I64 flags; CTask *task; I64 partial_len,num_fillins, fillin_hits [AC_FILLINS_NUM+1]; CHashAC *fillin_matches[AC_FILLINS_NUM+1]; }; #help_index "AutoComplete/Dictionary" #define ACD_WORD_FILENAME "/Zenith/AutoComplete/ACWords.DATA" #define ACD_DEF_FILENAME "/Zenith/AutoComplete/ACDefs.DATA" #define ACD_H1 0 #define ACD_H1_END 1 #define ACD_DEF 2 #define ACD_DEF_END 3 #define ACD_PRONUNCIATION 4 #define ACD_PRONUNCIATION_END 5 #define ACD_POS 6 #define ACD_POS_END 7 #define ACD_EXTRA 8 #define ACD_EXTRA_END 9 #define ACD_BLK_SIZE 0x4000 #define ACD_END_CHAR 0x00 #define ACD_WORD_CHAR 0x01 #define ACD_DEF_CHAR 0x02 #define ACD_PRONUNCIATION_CHAR 0x03 #define ACD_POS_CHAR 0x04 #define ACD_EXTRA_CHAR 0x05 #define ACD_FILLINS_NUM 10 public class CAutoCompleteDictGlobals { U8 *word_list; I64 word_list_size,num_words,num_fillins; U8 *fillins[ACD_FILLINS_NUM]; Bool has_words,has_defs; }; #help_index "Compiler/Directive" //Compiler $LK,"Option",A="MN:Option"$()s //You might need to do #exe {Option();} //Note: The #exe stmt is lexed-ahead, //so it takes effect earlier than you might expect. #define OPTf_ECHO 0x00 #define OPTf_TRACE 0x01 #define OPTf_WARN_UNUSED_VAR 0x10 //Applied to funs, not statements #define OPTf_WARN_PAREN 0x11 //Warn unnecessary parens #define OPTf_WARN_DUP_TYPES 0x12 //Warn dup local var type statements #define OPTf_WARN_HEADER_MISMATCH 0x13 #define OPTf_EXTERNS_TO_IMPORTS 0x20 #define OPTf_KEEP_PRIVATE 0x21 #define OPTf_NO_REG_VAR 0x22 //Applied to funs, not statements #define OPTf_GLBLS_ON_DATA_HEAP 0x23 //Disable 10-byte float consts for ã,log2_10,log10_2,loge_2 #define OPTf_NO_BUILTIN_CONST 0x24 //Applied to funs, not statements #define OPTf_USE_IMM64 0x25 //Not completely implemented #define OPTF_ECHO (1<last_cc->lex_include_stack->line_num);} #define __CMD_LINE__ #exe{StreamPrint("%d",Fs->last_cc->flags&CCF_CMD_LINE &&\ Fs->last_cc->lex_include_stack->depth<1);} #define __FILE__ #exe{StreamPrint("\"%s\"",\ Fs->last_cc->lex_include_stack->full_name);} #define __DIR__ #exe{StreamDir;} #define LFSF_DOC 1 #define LFSF_DEFINE 2 class CLexFile { CLexFile *next; U8 *buf, *buf_ptr; I64 line_num,flags; U8 *full_name, *line_start; CDoc *doc; CDocEntry *cur_entry; I32 depth; U8 last_U16,pad[3]; }; class CAOTCtrl { I64 rip; //Inst ptr CAsmArg arg1,arg2; CAOTBinBlk *bin; I64 num_bin_U8s, max_align_bits,org; CAsmUnresolvedRef *local_unresolved,*glbl_unresolved; CAOTAbsAddr *abss; CAOTHeapGlobal *heap_glbls; I64 list_col,list_last_rip; U8 *last_label,*list_last_line; CLexFile *list_last_lfn; I64 seg_size; Bool list; }; //Tokens #define TK_EOF 0 #define TK_SUPERSCRIPT 0x001 #define TK_SUBSCRIPT 0x002 #define TK_NORMALSCRIPT 0x003 #define TK_IDENT 0x100 #define TK_STR 0x101 #define TK_I64 0x102 #define TK_CHAR_CONST 0x103 #define TK_F64 0x104 #define TK_PLUS_PLUS 0x105 #define TK_MINUS_MINUS 0x106 #define TK_DEREFERENCE 0x107 #define TK_DBL_COLON 0x108 #define TK_SHL 0x109 #define TK_SHR 0x10A #define TK_EQU_EQU 0x10B #define TK_NOT_EQU 0x10C #define TK_LESS_EQU 0x10D #define TK_GREATER_EQU 0x10E #define TK_AND_AND 0x10F #define TK_OR_OR 0x110 #define TK_XOR_XOR 0x111 #define TK_SHL_EQU 0x112 #define TK_SHR_EQU 0x113 #define TK_MUL_EQU 0x114 #define TK_DIV_EQU 0x115 #define TK_AND_EQU 0x116 #define TK_OR_EQU 0x117 #define TK_XOR_EQU 0x118 #define TK_ADD_EQU 0x119 #define TK_SUB_EQU 0x11A #define TK_IF 0x11B #define TK_IFDEF 0x11C #define TK_IFNDEF 0x11D #define TK_IFAOT 0x11E #define TK_IFJIT 0x11F #define TK_ENDIF 0x120 #define TK_ELSE 0x121 #define TK_MOD_EQU 0x122 #define TK_DOT_DOT 0x123 #define TK_ELLIPSIS 0x124 #define TK_INS_BIN 0x125 #define TK_INS_BIN_SIZE 0x126 #define TK_TKS_NUM 0x127 class CLexHashTableContext { CLexHashTableContext *next; I64 old_flags,hash_mask; CHashFun *local_var_list, *fun; CHashTable *hash_table_list, *define_hash_table, *local_hash_table, *glbl_hash_table; }; //CompCtrl flags #define CCF_CMD_LINE 0x001 #define CCF_PROMPT 0x002 #define CCf_PROMPT 1 #define CCF_QUESTION_HELP 0x004 #define CCF_DONT_FREE_BUF 0x008 #define CCF_NO_DEFINES 0x010 #define CCF_IN_IF 0x020 #define CCF_JUST_LOAD 0x040 #define CCF_KEEP_NEW_LINES 0x080 #define CCF_KEEP_DOT 0x100 #define CCF_KEEP_SIGN_NUM 0x200 #define CCF_KEEP_AT_SIGN 0x400 #define CCF_NO_CHAR_CONST 0x800 #define CCf_PASS_TRACE_PRESENT 12 #define CCF_NOT_CONST 0x0000020000 #define CCF_NO_REG_OPT 0x0000040000 #define CCF_IN_QUOTES 0x0000080000 #define CCF_EXE_BLK 0x0000100000 #define CCF_HAS_MISC_DATA 0x0000200000 #define CCF_HAS_RETURN 0x0000400000 #define CCF_ASM_EXPRESSIONS 0x0000800000 #define CCF_UNRESOLVED 0x0001000000 #define CCF_LOCAL 0x0002000000 #define CCF_FUN_EXP 0x0004000000 #define CCf_FUN_EXP 26 #define CCF_POSTINC 0x0008000000 #define CCF_POSTDEC 0x0010000000 #define CCF_PREINC 0x0020000000 #define CCF_PREDEC 0x0040000000 #define CCF_ARRAY 0x0080000000 #define CCF_RAX 0x0100000000 #define CCF_USE_LAST_U16 0x0200000000 #define CCf_USE_LAST_U16 33 #define CCF_LAST_WAS_DOT 0x0400000000 #define CCF_AOT_COMPILE 0x0800000000 #define CCf_AOT_COMPILE 35 #define CCF_NO_ABSS 0x1000000000 #define CCF_PAREN 0x2000000000 #define CCf_PAREN 37 #define CCF_CLASS_DOL_OFFSET 0x4000000000 #define CCF_DONT_MAKE_RES 0x8000000000 public class CCompCtrl { CCompCtrl *next,*last; I64 token, flags, cur_i64; F64 cur_f64; U8 *cur_str; I64 cur_str_len, class_dol_offset; U8 *dollar_buf; I64 dollar_count; U8 *cur_help_idx; I64 last_U16, min_line,max_line,last_line_num, lock_count; U32 *char_bmp_alpha_numeric; CLexHashTableContext htc; CHashGeneric *hash_entry; CAbsCountsI64 abs_counts; CAsmUndefHash *asm_undef_hash; CMemberList *local_var_entry; CCodeMisc *lb_leave; U8 *cur_buf_ptr; CLexFile *lex_include_stack, *lex_parse_stack, *fun_lex_file; CStreamBlk *next_stream_blk,*last_stream_blk; CAOT *aot; I64 pass,opts,pass_trace,saved_pass_trace, error_count,warning_count; //For intermediate codes with multiple float ops (int<->float conversions) I64 cur_ic_float_op_num,last_ic_float_op_num; CIntermediateCode *last_float_op_ic; Bool last_dont_pushable,last_dont_popable,last_float_op_pos, dont_push_float,pad[4]; CCodeCtrl coc; CParseStack *ps; CAOTCtrl *aotc; I64 aot_depth,prompt_line; #assert !($$&7) }; #help_index "Compiler" public class CCompGlobals { CHashTable *asm_hash; CHashClass *internal_types[RT_RTS_NUM]; CIntermediateCode ic_nop; U32 *dual_U16_tokens1,*dual_U16_tokens2,*dual_U16_tokens3, *binary_ops; I64 num_reg_vars,num_non_ptr_vars, stack_tmps_mask,reg_vars_mask,non_ptr_vars_mask; U8 *to_reg_vars_map,*non_ptr_vars_map; I64 size_arg_mask[9], compiled_lines; }; #help_index "Debugging/Unassemble" class CUAsmGlobals { CInst **table_16_32,**table_64; I64 table_16_32_entries, table_64_entries, ins64_arg_mask, signed_arg_mask, mem_arg_mask; }; #help_index "Devices;PCI" //PCI Registers, used with $LK,"PCIRead",A="MN:PCIReadU16"$ functions. #define PCIR_VENDOR_ID 0x00 #define PCIR_DEVICE_ID 0x02 #define PCIR_COMMAND 0x04 #define PCIR_STATUS 0x06 #define PCIR_REVISION_ID 0x08 #define PCIR_PROG_IF 0x09 #define PCIR_SUB_CODE 0x0A #define PCIR_CLASS_CODE 0x0B #define PCIR_CACHE_LINE_SIZE 0x0C #define PCIR_LATENCY_TIMER 0x0D #define PCIR_HEADER_TYPE 0x0E #define PCIR_BIST 0x0F #define PCIR_BASE0 0x10 #define PCIR_BASE1 0x14 #define PCIR_BASE2 0x18 #define PCIR_BASE3 0x1C #define PCIR_BASE4 0x20 #define PCIR_BASE5 0x24 #define PCIR_SUBSYS_VENDOR_ID 0x2C #define PCIR_SUBSYS_ID 0x2E #define PCIR_EXPANSION_ROM 0x30 #define PCIR_CAPABILITIES 0x34 #define PCIR_INTERRUPT_LINE 0x3C #define PCIR_INTERRUPT_PIN 0x3D #define PCIR_MIN_GRANT 0x3E #define PCIR_MAX_LATENCY 0x3F //PCI class codes #define PCIC_STORAGE 0x1 #define PCIC_NETWORK 0x2 //PCI subclass codes #define PCISC_ETHERNET 0x0 #define PCISC_AHCI 0x6 class CPCIDev { CPCIDev *next, *last; U8 bus,dev,fun, *vendor_str, *dev_id_str, class_code, sub_code, prog_if, revision_id, bist, header_type, latency_timer, cache_line_size, capabilities, interrupt_line, interrupt_pin, min_grant, max_latency; U16 vendor_id, device_id, subsys_id, subsys_vendor_id; U32 base[6], erom; }; #help_index "Devices;File/System;PCI" public class CATARep { CATARep *next; I64 num,type,base0,base1,unit,irq; }; //See $LK,"::/Doc/Credits.DD"$. #define ATA_NOP 0x00 #define ATA_DEV_RST 0x08 #define ATA_PACKET 0xA0 #define ATA_READ_NATIVE_MAX 0xF8 #define ATA_READ_NATIVE_MAX_EXT 0x27 #define ATA_SET_MAX 0xF9 #define ATA_SET_MAX_EXT 0x37 #define ATA_READ_MULTI 0xC4 #define ATA_READ_MULTI_EXT 0x29 #define ATA_WRITE_MULTI 0xC5 #define ATA_WRITE_MULTI_EXT 0x39 #define ATA_ID_DEV 0xEC #define ATAS_ERR 0x01 #define ATAS_DRQ 0x08 #define ATAS_DF 0x20 #define ATAS_DRDY 0x40 #define ATAS_BSY 0x80 #define ATAR0_DATA 0 #define ATAR0_FEAT 1 #define ATAR0_NSECT 2 #define ATAR0_SECT 3 #define ATAR0_LCYL 4 #define ATAR0_HCYL 5 #define ATAR0_SEL 6 #define ATAR0_STAT 7 #define ATAR0_CMD 7 #define ATAR1_CTRL 2 #help_index "File/FileNames" #define FILEMASK_JIT "*.CC*;*.HH*" #define FILEMASK_AOT "*.CC*;*.HH*;*.PRJ*" #define FILEMASK_SRC "*.CC*;*.HH*;*.IN*;*.PRJ*" #define FILEMASK_DD FILEMASK_SRC ";*.DD*" #define FILEMASK_TXT FILEMASK_DD ";*.TXT*" #define FILEMASK_GR "*.GR*" #help_index "File/Low Level" #define BLK_SIZE_BITS 9 #define BLK_SIZE (1<drv_let directly in case a drive has been remapped. //Use $LK,"Drive2Letter",A="MN:Drive2Letter"$(). I64 locked_flags; U32 drive_signature; U8 drv_let,pad; U16 fs_type; I64 drv_offset, size, prt_num, file_system_info_sect, fat1,fat2, root_clus, data_area, spc; //sectors per clus CDate fat32_local_time_offset; CTask *owning_task; CBlkDev *bd; CFAT32FileInfoSect *fis; I64 fat_blk_dirty, cur_fat_blk_num; U32 *cur_fat_blk; CFreeList *next_free,*last_free; }; #define DISK_CACHE_HASH_SIZE 0x2000 class CCacheBlk { CCacheBlk *next_lru,*last_lru; CCacheBlk *next_hash,*last_hash; CDrive *drive; I64 blk; U8 body[BLK_SIZE]; }; #help_index "File/System" #define DEFAULT_ISO_FILENAME "::/Tmp/CDDVD.ISO" #define DEFAULT_ISO_C_FILENAME "::/Tmp/CDDVD.ISO.C" public class CBlkDevGlobals { CBlkDev *blkdevs; U8 *default_iso_filename; //$TX,"\"::/Tmp/CDDVD.ISO\"",D="DEFAULT_ISO_FILENAME"$ U8 *default_iso_c_filename; //$TX,"\"::/Tmp/CDDVD.ISO.C\"",D="DEFAULT_ISO_C_FILENAME"$ U8 *tmp_filename; U8 *home_dir; CCacheBlk *cache_base,*cache_ctrl,**cache_hash_table; I64 cache_size,read_count,write_count; CDrive *drvs,*let_to_drive[32]; I64 mount_ide_auto_count, ins_base0,ins_base1; //Install cd/dvd controller. U8 boot_drive_let,first_hd_drive_let,first_dvd_drive_let; Bool dvd_boot_is_good,ins_unit,pad[3]; }; #help_index "File/Internal" public class CDirContext { CDrive *old_dv,*drive; U8 *old_dir,*mask; }; #help_index "File/CFile" #define FFB_NEXT_BLK I64_MAX #define FF_WRITE 1 #define FF_NEW_FILE 2 #define FF_BUF_DIRTY 4 #define FF_NEEDS_WRITE 8 #define FF_CONTIGUOUS 16 #define FF_USE_OLD_DATETIME 32 public class CFile //See $LK,"::/Demo/Disk/DataBase.CC"$. { I64 flags; CDirEntry de; CDrive *drive; I64 fblk_num,clus,file_clus_num,max_blk; U8 *clus_buf; }; #help_index "Memory/Heap" #define _CONFIG_HEAP_DEBUG FALSE #if _CONFIG_HEAP_DEBUG class CMemUnused { CHeapCtrl *hc; U8 *caller1,*caller2; CMemUnused *next; I64 size; }; class CMemUsed { CHeapCtrl *hc; U8 *caller1,*caller2; CMemUsed *next,*last; I64 size; U0 start; }; #else class CMemUnused { U0 hc; U0 caller1,caller2; CMemUnused *next; I64 size; }; class CMemUsed { CHeapCtrl *hc; U0 caller1,caller2; U0 next,last; I64 size; U0 start; }; #endif #help_index "Memory/BlkPool" #help_file "::/Doc/Pags" #define MBS_USED_SIGNATURE_VAL 'MBUs' #define MBS_UNUSED_SIGNATURE_VAL 'MBUn' class CMemBlk { CMemBlk *next,*last; U32 mb_signature,pags; }; #define MRT_UNUSED 0 #define MRT_RAM 1 #define MRT_DEV 2 class CMemRange { CMemRange *next,*last; U32 type,flags; U8 *base; I64 size; }; #define MEM_PAG_BITS 9 #define MEM_PAG_SIZE (1< #define MESSAGE_KEY_UP 3 //($LK,"ASCII",A="MN:CH_CTRLA"$,$LK,"scan code",A="FI:::/Doc/CharOverview.DD"$) Press #define MESSAGE_MS_MOVE 4 //(x,y) #define MESSAGE_MS_L_DOWN 5 //(x,y) #define MESSAGE_MS_L_UP 6 //(x,y) #define MESSAGE_MS_L_D_DOWN 7 //(x,y) #define MESSAGE_MS_L_D_UP 8 //(x,y) #define MESSAGE_MS_R_DOWN 9 //(x,y) #define MESSAGE_MS_R_UP 10 //(x,y) #define MESSAGE_MS_R_D_DOWN 11 //(x,y) #define MESSAGE_MS_R_D_UP 12 //(x,y) //Fake messages used to send both an up and down. #define MESSAGE_KEY_DOWN_UP -2 //Down & UP #define MESSAGE_MS_L_DOWN_UP -5 //Down & Up #define MESSAGE_MS_L_D_DOWN_UP -7 //Down & Up #define MESSAGE_MS_R_DOWN_UP -9 //Down & Up #define MESSAGE_MS_R_D_DOWN_UP -11 //Down & Up #help_index "Task/Settings" #define TSF_SAME_SONG 1 public class CTaskSettings { CTaskSettings *next; U8 *cur_dir; I64 left,right,top,bottom; U0 (*draw_it)(CTask *task,CDC *dc); U0 (*task_end_cb)(); CTask *song_task,*animate_task; I64 scroll_x,scroll_y,scroll_z; CBGR24 palette[COLORS_NUM]; U32 win_inhibit; U8 text_attr,title_src, border_attr,border_src, task_title[STR_LEN]; Bool border,hide_cursor,highlight_cursor,scroll,autocomplete,pad[3]; #assert !($$&7) }; #help_index "Task" //CTask.border_src #define BDS_CONST 0 #define BDS_CUR_DRIVE 1 #define BDS_ED_FILENAME_DRIVE 2 //CTask.title_src #define TTS_CONST 0 #define TTS_LOCKED_CONST 1 //This is not strictly enforced #define TTS_TASK_NAME 2 #define TTS_ED_FILENAME 3 #define TTS_CUR_LEX 4 //CTask.task_flags #define TASKf_TASK_LOCK 0 #define TASKf_KILL_TASK 1 #define TASKf_SUSPENDED 2 #define TASKf_IDLE 3 #define TASKf_CMD_LINE_PROMPT 4 #define TASKf_INPUT_FILTER_TASK 5 #define TASKf_FILTER_INPUT 6 #define TASKf_HAS_SONG 7 #define TASKf_DISABLE_BPTS 8 #define TASKf_AWAITING_MESSAGE 9 #define TASKf_BREAK_LOCKED 10 #define TASKf_PENDING_BREAK 11 #define TASKf_BREAK_TO_SHIFT_ESC 12 #define TASKf_KILL_AFTER_DEBUG 13 #define TASKf_NONTIMER_RAND 14 //CTask.display_flags #define DISPLAYf_SHOW 0 #define DISPLAYf_NOT_RAW 1 #define DISPLAYf_SILENT 2 #define DISPLAYf_NO_BORDER 3 #define DISPLAYf_WIN_ON_TOP 4 #define DISPLAYf_CHILDREN_NOT_ON_TOP 5 #define TASK_SIGNATURE_VAL 'TskS' #define TASK_NAME_LEN 32 #define TASK_EXCEPT_CALLERS 8 class CTaskStack { CTaskStack *next_stack; I64 stack_size,stack_ptr; U0 stack_base; }; #define DYING_JIFFIES ToI64(JIFFY_FREQ/5) class CTaskDying { CTask *next,*last; I64 wake_jiffy; }; public class CTask //The Fs segment reg points to current CTask. { CTask *addr; //Self-addressed ptr U32 task_signature,win_inhibit; #assert $$==offset(CTaskDying.wake_jiffy) I64 wake_jiffy; U32 task_flags,display_flags; CHeapCtrl *code_heap,*data_heap; CDoc *put_doc,*display_doc, //When double buffering, these two differ. *border_doc; I64 win_left,win_right,win_top,win_bottom; CDrive *cur_dv; U8 *cur_dir; CTask *parent_task, *next_task,*last_task, *next_input_filter_task,*last_input_filter_task, *next_sibling_task,*last_sibling_task, *next_child_task,*last_child_task; //These are derived from left,top,right,bottom I64 win_width,win_height, pix_left,pix_right,pix_width, //These are in pixs, not characters pix_top,pix_bottom,pix_height, scroll_x,scroll_y,scroll_z; //These must be in this order //for $LK,"TASK_CONTEXT_SAVE",A="FF:::/Kernel/Sched.CC,TASK_CONTEXT_SAVE"$ and $LK,"_TASK_CONTEXT_RESTORE",A="FF:::/Kernel/Sched.CC,_TASK_CONTEXT_RESTORE"$ I64 rip,rflags,rsp,rsi,rax,rcx,rdx,rbx,rbp,rdi, r8,r9,r10,r11,r12,r13,r14,r15; CCPU *gs; CFPU *fpu_mmx; I64 swap_counter; U0 (*draw_it)(CTask *task,CDC *dc); U8 task_title[STR_LEN], task_name[TASK_NAME_LEN], wallpaper_data[STR_LEN], title_src,border_src, text_attr,border_attr; U16 win_z_num,pad; CTaskStack *stack; CExcept *next_except,*last_except; I64 except_rbp, //throw routine's RBP except_ch; //throw(ch) U8 *except_callers[TASK_EXCEPT_CALLERS]; Bool catch_except; Bool new_answer; U8 answer_type,pad[5]; I64 answer; F64 answer_time; CBpt *bpt_list; CCtrl *next_ctrl,*last_ctrl; CMenu *cur_menu; CTaskSettings *next_settings; CMathODE *next_ode,*last_ode; F64 last_ode_time; CHashTable *hash_table; CJobCtrl server_ctrl; CCompCtrl *next_cc,*last_cc; CHashFun *last_fun; U0 (*task_end_cb)(); CTask *song_task,*animate_task; I64 rand_seed, task_num, fault_num,fault_err_code; CTask *popup_task, *debug_task; CWinScroll horz_scroll,vert_scroll; I64 user_data; #assert !($$&7) }; class CTSS { U32 res1; I64 rsp0,rsp1,rsp2,res2, ist1,ist2,ist3,ist4,ist5,ist6,ist7,res3; U16 res4,io_map_offset; U8 io_map[0x10000/8]; I64 *st0,*st1,*st2; U16 tr,tr_ring3; }; #define ans (Fs->answer) #define ansf (Fs->answer(F64)) #define _RAX Fs->rax #define _RBX Fs->rbx #define _RCX Fs->rcx #define _RDX Fs->rdx #define _RSI Fs->rsi #define _RDI Fs->rdi #define _RBP Fs->rbp #define _RSP Fs->rsp #define _RIP Fs->rip #define _R8 Fs->r8 #define _R9 Fs->r9 #define _R10 Fs->r10 #define _R11 Fs->r11 #define _R12 Fs->r12 #define _R13 Fs->r13 #define _R14 Fs->r14 #define _R15 Fs->r15 #help_index "MultiCore" #define CPUf_RAN_A_TASK 0 #define CPUf_DYING_TASK_QUE 1 public class CCPU //The Gs segment reg points to current CCPU. { CCPU *addr; //Self-addressed ptr I64 num,cpu_flags, startup_rip, idle_pt_hits; F64 idle_factor; I64 total_jiffies; CTask *daemon_task,*idle_task; I64 tr, //task reg swap_counter; U0 (*profiler_timer_irq)(CTask *task); CTaskDying *next_dying,*last_dying; I64 kill_jiffy; CTSS *tss; I64 start_stack[16]; #assert !($$&7) }; #help_index "Memory/Page Tables" #define MEM_MIN_MEG 256 //256 Meg minimum. #define SYS_FIXED_AREA 0x100000 #define SYS_16MEG_AREA_LIMIT 0x1000000 public class CSysFixedArea { CFPU init_fpu_mmx; CCPU boot_cpu; CTask zenith; CBlkPool sys_code_bp; CHeapCtrl zenith_hc; $$=($$+0x1000-1)&-0x1000; }; #help_index "Char" #define CH_CTRLA 0x01 #define CH_CTRLB 0x02 #define CH_CTRLC 0x03 #define CH_CTRLD 0x04 #define CH_CTRLE 0x05 #define CH_CTRLF 0x06 #define CH_CTRLG 0x07 #define CH_CTRLH 0x08 #define CH_CTRLI 0x09 #define CH_CTRLJ 0x0A #define CH_CTRLK 0x0B #define CH_CTRLL 0x0C #define CH_CTRLM 0x0D #define CH_CTRLN 0x0E #define CH_CTRLO 0x0F #define CH_CTRLP 0x10 #define CH_CTRLQ 0x11 #define CH_CTRLR 0x12 #define CH_CTRLS 0x13 #define CH_CTRLT 0x14 #define CH_CTRLU 0x15 #define CH_CTRLV 0x16 #define CH_CTRLW 0x17 #define CH_CTRLX 0x18 #define CH_CTRLY 0x19 #define CH_CTRLZ 0x1A #define CH_CURSOR 0x05 #define CH_BACKSPACE 0x08 #define CH_ESC 0x1B #define CH_SHIFT_ESC 0x1C #define CH_SHIFT_SPACE 0x1F #define CH_SPACE 0x20 #define ST_ERR_ST "$$RED$$$$BK,1$$ERROR:$$FG$$$$BK,0$$ " #define ST_WARN_ST "$$LTRED$$$$BK,1$$WARNING:$$FG$$$$BK,0$$ " //Scan code flags #define SCf_E0_PREFIX 7 #define SCf_KEY_UP 8 #define SCf_SHIFT 9 #define SCf_CTRL 10 #define SCf_ALT 11 #define SCf_CAPS 12 #define SCf_NUM 13 #define SCf_SCROLL 14 #define SCf_NEW_KEY 15 #define SCf_MS_L_DOWN 16 #define SCf_MS_R_DOWN 17 #define SCf_DELETE 18 #define SCf_INS 19 #define SCf_NO_SHIFT 30 #define SCf_KEY_DESC 31 #define SCF_E0_PREFIX (1< #define GSF_WITH_NEW_LINE 2 #define "Char/Operations" //Flags for StrUtil and MStrUtil #define SUF_REM_CTRL_CHARS 0x001 #define SUF_REM_LEADING 0x002 #define SUF_REM_TRAILING 0x004 #define SUF_REM_SPACES 0x008 #define SUF_SINGLE_SPACE 0x010 #define SUF_TO_UPPER 0x020 #define SUF_TO_LOWER 0x040 #define SUF_S2T 0x080 #define SUF_T2S 0x100 // Only works with MStrUtil #define SUF_SCALE_INDENT 0x200 #define SUF_SAFE_DOLLAR 0x400 //Flags for StrFind #define SFF_IGNORE_CASE 1 #define SFF_WHOLE_LABELS_BEFORE 2 #define SFF_WHOLE_LABELS_AFTER 4 #define SFG_WHOLE_LABELS (SFF_WHOLE_LABELS_BEFORE|SFF_WHOLE_LABELS_AFTER) //Flags for ListMatch #define LMF_IGNORE_CASE 1 #define LMF_EXACT 2 #help_index "Keyboard Devices/System" #define KDF_HAS_DESCS 1 class CKeyDevEntry { CKeyDevEntry *next,*last; I64 priority,flags; Bool (*put_key)(I64 ch,I64 sc); Bool (*put_s)(U8 *st); }; class CKeyDevGlobals { CKeyDevEntry put_key_head; U0 (**fp_ctrl_alt_cbs)(I64 sc); I64 ctrl_alt_in_irq_flags, **ctrl_alt_ret_addr; //addr of ret addr on stack in kbd irq U8 **ctrl_alt_no_shift_descs,**ctrl_alt_shift_descs, desc[STR_LEN], *handler; }; #help_index "Sound" #define PCSPKR 0x61 #help_index "ScreenCast;Sound/AU Files" public class CAUData {//Format of AU files CDate cdt; I8 ona; }; class CSoundData {//Format recorded in mem CSoundData *next,*last; F64 tS; I8 ona; }; public class CScreenCastGlobals { CSoundData sound_head; CDate t0_now; F64 t0_tS; U8 *print_format; CDC *dc,*dc2_alias; Bool record,just_audio; I8 ona; }; #help_index "Debugging/FunSeg" #define FUN_SEG_CACHE_SIZE 256 class CFunSegCache { I64 base,limit; F64 time_stamp; U8 str[1]; //FUN_SEG_CACHE_STR_LEN $$=64; }; #define FUN_SEG_CACHE_STR_LEN (sizeof(CFunSegCache)-offset(CFunSegCache.str)) #help_index "Debugging" class CMPCrash { I64 cpu_num; CTask *task; I64 rip; U8 *message; I64 message_num; }; public class CDebugGlobals { CTask *focus_task; U8 *message; I64 message_num; CMPCrash *mp_crash; U8 *int_fault_code, *fix_file_line; CFunSegCache *fun_seg_cache; I64 fun_seg_cache_index; Bool panic; }; #help_index "Boot" //Boot related #define BOOT_RAM_BASE 0x07C00 #define BOOT_RAM_LIMIT 0x97000 #define BOOT_STACK_SIZE BLK_SIZE #define BOOT_SRC_NULL 0 #define BOOT_SRC_ROM 1 #define BOOT_SRC_RAM 2 #define BOOT_SRC_HARDDRIVE 3 #define BOOT_SRC_DVD 4 // $LK,"In",A="MN:In"$("") StdIn for call to $LK,"BootHDIns",A="MN:BootHDIns"$(). #define STD_DISTRO_DVD_CONFIG "TB\nScale2Mem(2048,0x40000)\nT\n\n\n\n" #help_index "Registry" //Registry sys_message_flags. $LK,"RegOneTimePopUp",A="MN:RegOneTimePopUp"$() #define ARf_FLOODFILL 0 #define ARf_CSPRITE_INS_CLIP 1 #define ARf_PLANAR_SYMMETRY 2 #define ARf_PSALMODY_JUKEBOX 3 #define ARf_MESH_ED 4 #define ARf_CSPRITE_PTS_RECTANGLES 5 #define ARf_MANAGE_SLIDER 6 #help_index "Misc/Progress Bars" #define PROGRESS_BARS_NUM 4 #define PROGRESS_DESC_LEN (64-8-8) class CProgress { I64 val,max; F64 t0,tf; U8 desc[PROGRESS_DESC_LEN]; }; #help_index "Char/Operations" #define PRINTF_PAD_ZERO 0x001 #define PRINTF_LEFT_JUSTIFY 0x002 #define PRINTF_TRUNCATE 0x004 #define PRINTF_COMMA 0x008 #define PRINTF_DOLLAR 0x010 #define PRINTF_SLASH 0x020 #define PRINTF_QUESTION 0x040 #define PRINTF_AUX_FORMAT_NUM 0x080 #define PRINTF_DECIMAL 0x100 #define PRINTF_NEG 0x200 #define PRINTF_NEG_E 0x400 #define PRINTF_NEG_AUX_FORMAT_NUM 0x800 #help_index ""