public U2i union U2 { I1i i1[2]; U1i u1[2]; }; public I2i union I2 { I1i i1[2]; U1i u1[2]; }; public U4i union U4 { I1i i1[4]; U1i u1[4]; I2 i2[2]; U2 u2[2]; }; public I4i union I4 { I1i i1[4]; U1i u1[4]; I2 i2[2]; U2 u2[2]; }; public U8i union U8 { I1i i1[8]; U1i u1[8]; I2 i2[4]; U2 u2[4]; I4 i4[2]; U4 u4[2]; }; public I8i union I8 { I1i i1[8]; U1i u1[8]; I2 i2[4]; U2 u2[4]; I4 i4[2]; U4 u4[2]; }; public class P2I4 //two dimensional point { I4 x,y; }; public class P3I4 //three dimensional point { I4 x,y,z; }; public class P2I8 //two dimensional point { I8 x,y; }; public class P3I8 //three dimensional point { I8 x,y,z; }; public class P2d //two dimensional point { double x,y; }; public class P3d //three dimensional point { double x,y,z; }; #define NULL 0 #define TRUE 1 #define FALSE 0 #define ON 1 #define OFF 0 #define BoolU1 U1 #define BoolU2 U2 #define BoolU4 U4 #define BoolU8 U8 #define MAX_U1 0xFF #define MIN_U1 0 #define MAX_I1 0x7F #define MIN_I1 (-0x80) #define MAX_U2 0xFFFF #define MIN_U2 0 #define MAX_I2 0x7FFF #define MIN_I2 (-0x8000) #define MAX_U4 0xFFFFFFFF #define MIN_U4 0 #define MAX_I4 0x7FFFFFFF #define MIN_I4 (-0x80000000) #define MAX_U8 0xFFFFFFFFFFFFFFFF #define MIN_U8 0 #define MAX_I8 0x7FFFFFFFFFFFFFFF #define MIN_I8 (-0x8000000000000000) #define MAX_double 1.79e308 //TODO:make exact #define MIN_double -1.79e308 #define PTR_SIZE_BITS 3 #define INVALID_PTR 0x7FFFFFFF #define INVALID_CLUSTER -1 #define ALL_MASK -1 #define OC_NOP 0x90 extern class TssStruct; extern class Ltf; extern class CPUStruct; extern class ClassStruct; extern class LTFile; extern class GrElem; public class Ode { Ode *next,*last; I8 n; double base_t; double t; double h; double tolerance_start; double tolerance; double *state; double *internal_state; double *DstateDt; double *state_scale; double *initial_state; double *temp0,*temp1,*temp2,*temp3, *temp4,*temp5,*temp6,*temp7; TssStruct *mem_tss,*win_tss; void derivative(Ode *o,double t,double *state,double *DstateDt); }; public class Order2D3 { double x,y,z,DxDt,DyDt,DzDt; }; class BinFileHeaderStruct { U2 jmp; U2 type; U4 header_offset; U4 file_size; U4 xsum; }; //Software Interrupts #define I_NMI 0x02 #define I_COUT 0x34 #define I_COUTLN 0x35 #define I_UNARY_MINUS 0x40 #define I_INC 0x41 #define I_DEC 0x42 #define I_POWER 0x43 #define I_MUL 0x44 #define I_DIV 0x45 #define I_MOD 0x46 #define I_ADD 0x47 #define I_SUB 0x48 #define I_LESS 0x49 #define I_GREATER 0x4A #define I_LESS_EQUAL 0x4B #define I_GREATER_EQUAL 0x4C #define I_TO_INT_RAX 0x4D #define I_TO_DOUBLE_RAX 0x4E #define I_TO_INT_RDX 0x4F #define I_TO_DOUBLE_RDX 0x50 #define I_TO_INT_RCX 0x51 #define I_TO_DOUBLE_RCX 0x52 #define MAXIDT 0x53 #define MAXGDT 0x200 #define SYS_START_CR0 0x0031 #define SYS_START_RFLAGS 0x0000 #define SYS_NORMAL_RFLAGS 0x0200 class GdtTabStruct { U4 lo,hi,pad1,pad2; }; class OsMainStruct { BinFileHeaderStruct h; U4 jmp; U4 boot_base; U4 header_base; U4 os_32start; GdtTabStruct gdttab[MAXGDT]; U4 boot_code; U4 sys_memblks; //dbgo investigate if this is accurate }; #define MP_MAX_PROCESSORS 4 class MPMainStruct { U4 jmp; U8 sys_temp_ptr; }; #define JIFFY_FREQ 2000 // Hz #define LTDATE_FREQ 49710 // Hz #define SYS_TIMER_FREQ (18333*65536/1000) //Hz #define SYS_TIMER0_PERIOD (65536*182/10/JIFFY_FREQ) #define CPU_CACHE_LINE_WIDTH 64 #define SEMA_STRUCT_SIZE CPU_CACHE_LINE_WIDTH class sema { BoolU4 value; U4 pad[CPU_CACHE_LINE_WIDTH/4-1]; }; #define NUM_IRQ_SEMAS 32 #define SYS_SEMA_CLEAR_SCREEN_TEXT 0 #define SYS_SEMA_DEBUG 1 #define SYS_SEMA_RECORD_MACRO 2 #define SYS_SEMA_NO_SOUND 3 #define SYS_SEMA_NO_IO_SOUND 4 #define SYS_SEMA_MEM_BUSY 5 #define SYS_SEMA_SYS_TIMER 6 #define SYS_SEMA_SYS_DATE 7 #define SYS_SEMA_IN_DEBUGGER 8 #define SYS_SEMA_SOUND 9 #define SYS_SEMA_HEAPLOG 10 #define SYS_SEMA_TIMESTAMP 11 #define SYS_SEMA_KEY_PRESSED 12 #define NUM_SYS_SEMAS 13 #define SYSf_CTRL_ALT_DEL 0 #define SYSf_CTRL_ALT_C 1 #define SYSf_CTRL_ALT_ESC 2 #define SYSf_CTRL_ALT_X 3 #define SYSf_CTRL_ALT_TAB 4 //Extern calls #define EXT_IRQ01 1 // Keyboard #define EXT_IRQ03 3 // Comm #define EXT_IRQ04 4 // Comm #define EXT_IRQ06 6 // FDC0 #define EXT_IRQ07 7 // LPT1 #define EXT_IRQ0B 11 // SATA #define EXT_IRQ0C 12 // Mouse #define EXT_IRQ0E 14 // IDE0 #define EXT_IRQ0F 15 // IDE1 #define EXT_IRQ00 32 // Timer #define EXT_LTF_READ 33 #define EXT_LTF_WRITE 34 #define EXT_LTF_NEW 35 #define EXT_LTF_RESET 36 #define EXT_LTF_DEL 37 #define EXT_LTF_RECALC 38 #define EXT_SPRINTF_JOIN 39 #define EXT_GETF_JOIN 41 #define EXT_DEBUG 42 #define EXT_EXECUTE_FILE 43 #define EXT_EXECUTE_STR 44 #define EXT_WIN_TO_TOP 45 #define EXT_CMP_EXE_BLK 46 #define EXT_SCAN_KEY 47 #define EXT_MGETS 48 #define EXT_DEBUGGER 49 #define EXT_HEAPLOG_MALLOC 50 #define EXT_HEAPLOG_FREE 51 #define EXT_INPUT_FILTER_TASK 52 #define EXT_FLUSH_MSGS 53 #define EXT_WALLPAPER 54 #define EXT_RESUME_DBG 55 #define EXT_TABLE_SIZE 256 #define FLT_UNDEF_EXTERN 0x100 //Hash table types #define HTT_INVALID 0 #define HTT_ALL -1 #define HTT_STR_CONST 0x001 #define HTT_SYS_SYMBOL 0x002 #define HTT_KEYWORD 0x004 #define HTT_LOCAL_VAR 0x008 #define HTT_GLBL_VAR 0x010 #define HTT_CLASS 0x020 #define HTT_INTERNAL_TYPE 0x040 #define HTT_FUNCTION 0x080 #define HTT_WORD 0x100 #define HTT_DICT_WORD 0x200 #define HTT_OPCODE 0x400 #define HTT_R8 0x800 #define HTT_R16 0x1000 #define HTT_R32 0x2000 #define HTT_R64 0x4000 #define HTT_SEG 0x8000 #define HTT_SYSTEXT 0x10000 #define HTT_FILE 0x20000 #define HTT_MODULE 0x40000 #define HTT_HELP_FILE 0x80000 #define HTT_PIC_WORD 0x100000 #define HTT_PRIVATE 0x02000000 #define HTT_PUBLIC 0x04000000 #define HTT_EXPORT 0x08000000 #define HTT_IMPORT 0x10000000 #define HTT_LITERAL 0x20000000 #define HTT_UNRESOLVED_LOCAL 0x40000000 #define HTT_UNRESOLVED_GLBL 0x80000000 class DbgInfo { U4 min_line,max_line; void * body[1]; }; public class SysHashEntry //Don't forget to change WsHashEntry and asm stuff { SysHashEntry *next; I1 *str; U4 type,use_cnt; I1 *source_link; I1 *index; DbgInfo *debug; I8 user_data0,user_data1,user_data2; }; public class PicWordEntry { SysHashEntry *next; I1 *str; U4 type,use_cnt; I1 *source_link; I1 *index; DbgInfo *debug; GrElem *grelem; I8 size,width,height; I1 *txt; }; public class SysHashTable { SysHashTable *next; U8 mask; SysHashEntry *body[1]; //SysHashTable is var size }; public class WsHashEntry { WsHashEntry *next; I1 *word; U4 type,use_cnt; I1 *source_link; I1 *index; DbgInfo *debug; I4 num; U4 hits; U2 last_vowel,last_consonant; I1 *glossary; }; public class StrConstStruct { SysHashEntry *next; I1 *str; U4 type,use_cnt; I1 *source_link; I1 *index; I1 *data; }; #define LTFLT_BLINK 0x10000000 #define LTFLT_INVERT 0x20000000 #define LTFLT_SELECTED 0x40000000 #define LTFLT_UNDERLINE 0x80000000 #define MLF_DEFAULT_AVAILABLE 1 #define MLF_FUNCTION 2 #define MLF_DOT_DOT_DOT 4 #define MLF_NO_REG_VARIABLE 8 #define MLF_USE_REG_VARIABLE 16 #define MLF_NO_UNUSED_WARN 32 public class ArrayDimStruct { ArrayDimStruct *next; I8 cnt; }; public class MemberListStruct { MemberListStruct *next; I1 *str; ClassStruct *member_class; U4 use_cnt; I1 *fmtstr; I1 *fmtdata; U2 flags; U1 parameter_cnt; I1 register; U4 cnt; //for arrays I4 offset; ArrayDimStruct *dim_list; I8 default_value; ClassStruct *return_class; }; class ExternUsage { ExternUsage *next; I8 ip; }; #define Cf_INTERNAL 0 // Internal function #define Cf_EXTERN 1 public class ClassStruct //used for classes, functions and internal_data_types { SysHashEntry *next; I1 *str; U4 type,use_cnt; I1 *source_link; I1 *index; DbgInfo *debug; U2 member_cnt; U2 parameter_cnt; I4 size; MemberListStruct *member_list; MemberListStruct *last_in_member_list; void *executable_address; ClassStruct *return_class; U1 ptr_cnt; U1 sub_type,flags[2]; I1 *import_name; ExternUsage *ext_list; U4 used_reg_mask,trashed_reg_mask; }; //Internal type definitions #define IT_I0 0 #define IT_U0 1 #define IT_I1 2 #define IT_U1 3 #define IT_I2 4 #define IT_U2 5 #define IT_I4 6 #define IT_U4 7 #define IT_I8 8 #define IT_PTR 8 #define IT_U8 9 #define IT_DOUBLE 10 #define IT_UDOUBLE 11 // fictitious placeholder #define IT_NUM_IT 12 #define IT_MASK 0x0F #define TY_NULL 0x00 #define TY_IMM 0x10 #define TY_REG 0x20 #define TY_DISP 0x30 #define TY_RIP_DISP32 0x40 #define TY_STK 0x50 #define TY_MASK 0xF0 #define GVAF_FUNCTION 1 #define GVAF_IMPORT 2 #define GVAF_EXTERN 4 public class GlblVarStruct { SysHashEntry *next; I1 *str; U4 type,use_cnt; I1 *source_link; I1 *index; DbgInfo *debug; U2 flags; U2 parameter_cnt; U4 size; //must be in same spot as in class ClassStruct *var_class; U4 cnt; ArrayDimStruct *dim_list; I1 *import_name; void *data_address; I8 data; }; #define ARf_FLOODFILL_MSG 0 public class SysAccntRegistryStruct { U1 flags[1024]; double os_version; }; public class SysAccntStruct { SysAccntStruct *next,*last; I1 name[32]; SysAccntRegistryStruct *registry; }; #define TSSCf_WAKE_MASTER 0 #define TSSCf_FOCUS_MASTER 1 #define TSSCf_EXIT_ON_COMPLETE 2 #define TSSCf_DONT_FILTER 3 #define TSSCf_HIGHEST_PRIORITY 4 #define TSSCT_TEXT_INPUT 0 #define TSSCT_MSG 1 #define TSSCT_EXECUTE_STR 2 #define TSSCT_EXECUTE_FILE 3 class TssCmdStruct { TssCmdStruct *next,*last; U8 cmd_code; U8 msg_code; I8 p1,p2; U8 flags; I1 *data; I8 result; TssStruct *master_tss; }; #define MPCf_DONE 0 #define MPCf_DISPATCHED 1 #define MPCf_FREE_ON_COMPLETE 2 #define MPCT_CALL 1 #define MPCT_SPAWN_TASK 2 class MPCmdStruct { MPCmdStruct *next,*last; U8 cmd_code; U8 flags; void *add; I1 *data; I8 result; }; #define MPCCf_LOCKED 0 class MPCmdCtrl { MPCmdStruct *next_waiting,*last_waiting; MPCmdStruct *next_done,*last_done; U8 flags; }; #define SBPTf_DISABLE 0 #define SBPTF_BPT 2 class SysBpt { SysBpt *next; void *address; U4 flags; U1 b; }; #define MBS_USED_SIGNATURE 0x1020304 #define MBS_UNUSED_SIGNATURE 0x4030201 class MemBlk { MemBlk *next,*last; U4 signature; U4 pages; }; class UnusedAllocatedMem { UnusedAllocatedMem *next; U8 size; }; //LtfEntry.type codes (Low 8 bits) #define LTFT_TEXT 0 #define LTFT_CR 1 #define LTFT_SOFT_CR 2 #define LTFT_CURSOR 3 #define LTFT_TAB 4 #define LTFT_CLEAR 5 #define LTFT_PAGE_BREAK 6 #define LTFT_DATA 7 #define LTFT_PAGE_LENGTH 8 #define LTFT_LEFT_MARGIN 9 #define LTFT_RIGHT_MARGIN 10 #define LTFT_HEADER 11 #define LTFT_FOOTER 12 #define LTFT_INDENT 13 #define LTFT_FOREGROUND_COLOR 14 #define LTFT_BACKGROUND_COLOR 15 #define LTFT_DEFAULT_FOREGROUND_COLOR 16 #define LTFT_DEFAULT_BACKGROUND_COLOR 17 #define LTFT_LINK_FOREGROUND 18 #define LTFT_LINK_BACKGROUND 19 #define LTFT_MACRO_FOREGROUND 20 #define LTFT_MACRO_BACKGROUND 21 #define LTFT_ANCHOR_FOREGROUND 22 #define LTFT_ANCHOR_BACKGROUND 23 #define LTFT_HIDDEN_FOREGROUND 24 #define LTFT_HIDDEN_BACKGROUND 25 #define LTFT_TREE_FOREGROUND 26 #define LTFT_TREE_BACKGROUND 27 #define LTFT_USER_FOREGROUND 28 #define LTFT_USER_BACKGROUND 29 #define LTFT_WORD_WRAP 30 #define LTFT_UNDERLINED 31 #define LTFT_INVERTED 32 #define LTFT_BLINK 33 #define LTFT_SHIFTED_X 34 #define LTFT_SHIFTED_Y 35 #define LTFT_CURSOR_MOVEMENT 36 #define LTFT_ANCHOR 37 #define LTFT_LINK 38 #define LTFT_BUTTON 39 #define LTFT_CHECK_BOX 40 #define LTFT_MACRO 41 #define LTFT_MENU_VALUE 42 #define LTFT_HEX_EDIT 43 #define LTFT_HIDE_START 44 #define LTFT_HIDE_END 45 #define LTFT_TREE 46 #define LTFT_PICTURE 47 #define LTFT_INSERT_BINARY 48 #define LTFT_INSERT_BINARY_TYPE 49 #define LTFT_INSERT_BINARY_SIZE 50 #define LTFT_BPT 51 #define LTFT_SONG 52 #define LTFT_TOP_LEFT_TOOLBAR 53 #define LTFT_TOP_RIGHT_TOOLBAR 54 #define LTFT_PICWORD 55 #define LTFT_ERROR 56 //LtfEntry.flag flags #define LTFLF_AUX_STR 1 #define LTFLF_LINK 2 #define LTFLF_LEFT_CB 4 #define LTFLF_LEFT_EXP 8 #define LTFLF_LEFT_MACRO 0x10 #define LTFLF_SONG 0x10 #define LTFLF_LEFT_AUTO 0x20 #define LTFLF_RIGHT_CB 0x40 #define LTFLF_RIGHT_EXP 0x80 #define LTFLF_RIGHT_MACRO 0x100 #define LTFLF_RIGHT_AUTO 0x200 #define LTFLF_DISPLAY_CB 0x400 #define LTFLF_HAS_BIN 0x800 #define LTFLF_ESC 0x1000 #define LTFLF_QUIT 0x2000 #define LTFLF_LEFT_X 0x4000 #define LTFLF_CENTER_X 0x8000 #define LTFLF_RIGHT_X 0x10000 #define LTFLF_TOP_Y 0x20000 #define LTFLF_CENTER_Y 0x40000 #define LTFLF_BOTTOM_Y 0x80000 #define LTFLF_SHIFTED_X 0x100000 #define LTFLF_SHIFTED_Y 0x200000 #define LTFLF_SCROLLING_X 0x400000 #define LTFLF_SCROLLING_Y 0x800000 #define LTFLF_WIN_REL 0x1000000 #define LTFLF_WIDTH 0x2000000 #define LTFLF_HEIGHT 0x4000000 #define LTFLF_HAS_BORDER 0x100000000 #define LTFLF_SOLID_BORDER 0x200000000 #define LTFLF_BORDER_PLOT 0x400000000 #define LTFLF_COLLAPSED 0x800000000 #define LTFLF_CHECKED 0x1000000000 #define LTFLF_REFRESH_DATA 0x2000000000 #define LTFLF_DATA_IS_PTR 0x4000000000 #define LTFLF_HAS_TERMINATOR 0x8000000000 #define LTFLF_ZERO_BASED 0x10000000000 #define LTFLF_WORD_WRAP 0x20000000000 #define LTFLF_UNDERLINED 0x40000000000 #define LTFLF_INVERTED 0x80000000000 #define LTFLF_BLINK 0x100000000000 #define LTFLF_SELECTED 0x200000000000 #define LTFLF_HOLD 0x400000000000 #define LTFLF_TREE 0x800000000000 #define LTFLF_SKIP 0x1000000000000 #define LTFLF_ALIAS 0x2000000000000 #define LTFLF_POPUP 0x4000000000000 #define LTFLF_PAGE_REL_Y 0x8000000000000 #define LTFLF_MARGIN_REL_X 0x10000000000000 #define LTFLF_TOP_LEFT_MENU 0x20000000000000 #define LTFLF_TOP_RIGHT_MENU 0x40000000000000 #define LTFLF_FROM_START 0x80000000000000 #define LTFLf_AUX_STR 0 #define LTFLf_LINK 1 #define LTFLf_LEFT_CB 2 #define LTFLf_LEFT_EXP 3 #define LTFLf_LEFT_MACRO 4 #define LTFLf_LEFT_AUTO 5 #define LTFLf_RIGHT_CB 6 #define LTFLf_RIGHT_EXP 7 #define LTFLf_RIGHT_MACRO 8 #define LTFLf_RIGHT_AUTO 9 #define LTFLf_DISPLAY_CB 10 #define LTFLf_HAS_BIN 11 #define LTFLf_ESC 12 #define LTFLf_QUIT 13 #define LTFLf_LEFT_X 14 #define LTFLf_CENTER_X 15 #define LTFLf_RIGHT_X 16 #define LTFLf_TOP_Y 17 #define LTFLf_CENTER_Y 18 #define LTFLf_BOTTOM_Y 19 #define LTFLf_SHIFTED_X 20 #define LTFLf_SHIFTED_Y 21 #define LTFLf_SCROLLING_X 22 #define LTFLf_SCROLLING_Y 23 #define LTFLf_WIN_REL 24 #define LTFLf_WIDTH 25 #define LTFLf_HEIGHT 26 #define LTFLf_HAS_BORDER 32 #define LTFLf_SOLID_BORDER 33 #define LTFLf_BORDER_PLOT 34 #define LTFLf_COLLAPSED 35 #define LTFLf_CHECKED 36 #define LTFLf_REFRESH_DATA 37 #define LTFLf_DATA_IS_PTR 38 #define LTFLf_HAS_TERMINATOR 39 #define LTFLf_ZERO_BASED 40 #define LTFLf_WORD_WRAP 41 #define LTFLf_UNDERLINED 42 #define LTFLf_INVERTED 43 #define LTFLf_BLINK 44 #define LTFLf_SELECTED 45 #define LTFLf_HOLD 46 #define LTFLf_TREE 47 #define LTFLf_SKIP 48 #define LTFLf_ALIAS 49 #define LTFLf_POPUP 50 #define LTFLf_PAGE_REL_Y 51 #define LTFLf_MARGIN_REL_X 52 #define LTFLf_TOP_LEFT_MENU 53 #define LTFLf_TOP_RIGHT_MENU 54 #define LTFLf_FROM_START 55 #define LTFBT_GENERIC_DATA 1 #define LTFBT_GRELEM 2 public class LtfBinEntry { LtfBinEntry *next,*last; U8 temp_use_cnt; U0 start; U4 type,num,flags,size,use_cnt; void *data; }; #define LTF_DEFAULT MIN_I4 public class LtfEntryBase { //This is a shortened structure for //commands like the text command which //don't require the full LtfEntry structure. LtfEntryBase *next,*last; union { U1 btype; //this stores the code U4 type; //these store attribute flags }; U4 pad; U8 flags; I4 x,y; U4 min_col,max_col; //These are here to allow recalculating the Ltf //from a point other than the beginning. Without //these, you do not know the current state. //Margins will change to allow multiple columns //of text on the same page. (cursor move back up the page.) I4 indent,page_line_num; I4 left_margin,right_margin; I8 user_data; }; public class LtfEntry { LtfEntry *next,*last; union { U1 btype; //this stores the code U4 type; //these store attribute flags }; U4 pad; U8 flags; I4 x,y; I4 min_col,max_col; // These are stored so we can recalc // the document starting in the // middle. I4 indent,page_line_num; I4 left_margin,right_margin; I8 user_data; union { I1 *display; I8 hex_edit_width; }; union { I8 attr; I8 cursor_x_offset; I8 left_cb(Ltf *l,LtfEntry *ll); I8 left_exp; }; union { I1 *left_macro; I1 *song; } union { I8 cursor_y_offset; I8 right_cb(Ltf *l,LtfEntry *ll); I8 right_exp; }; I1 *right_macro; I1 *display_cb(Ltf *l,LtfEntry *ll, TssStruct *mem_tss); I1 *aux_str; I1 *my_format_data; union { I4 scroll_len; I4 width; } union { I4 len; I4 height; } I4 bin_num; I4 pad; LtfBinEntry *bin_data; void *data; }; class EditFindTextStruct { I1 find_text[132] fmtstr "$$DA-P,131,\"FIND :%s\"$$\r\n"; I1 replace_text[132] fmtstr "$$DA-P,131,\"REPLACE:%s\"$$\r\n"; BoolU4 replace fmtstr "$$CB,\"REPLACE\"$$\r\n"; BoolU4 scan_forward fmtstr "$$CB,\"FORWARD\"$$\r\n"; BoolU4 scan_selected_text fmtstr "$$CB,\"SELECTION\"$$\r\n"; BoolU4 match_case fmtstr "$$CB,\"CASE\"$$\r\n"; BoolU4 whole_labels fmtstr "$$CB,\"WHOLE LABELS\"$$\r\n"; }; class EditFileNameStruct { I1 name[256] fmtstr "$$DA-P,255,\"File Name:%s\"$$"; }; // LTF header flags #define LTFF_OVERSTRIKE 1 #define LTFF_PLAIN_TEXT 2 #define LTFF_PLAIN_TEXT_WITH_TABS 4 #define LTFF_MIN_SIZE 8 #define LTFF_NO_CURSOR 0x10 // Makes LtfInsertStr remove #define LTFF_IN_DOLLAR 0x20 #define LTFF_STATEMENT_WAS_RUN 0x40 #define LTFF_WORD_WRAP 0x80 #define LTFF_UNDERLINED 0x100 #define LTFF_INVERTED 0x200 #define LTFF_BLINK 0x400 #define LTFF_FORM 0x800 #define LTFF_ATTR_BY_PARTITION 0x1000 #define LTFF_ATTR_BY_FILENAME 0x2000 #define LTFF_INHIBIT_LEFT_CLICK 0x4000 #define LTFF_DOUBLE_DOLLARS 0x8000 #define LTFF_MODIFIED 0x10000 #define LTFF_BACKWARD_MOVEMENT 0x20000 #define LTFF_HAS_SONG 0x40000 #define LTFF_TOP_ENTRY_COPIED 0x80000 #define LTFF_UNDO_DIRTY 0x100000 #define LTFF_ALLOW_UNDO 0x200000 #define LTFF_NO_PICWORDS 0x400000 #define LTFF_SUPERSCRIPT_MODE 0x800000 #define LTFF_SUBSCRIPT_MODE 0x1000000 #define LTFF_DONT_SWAP_OUT 0x2000000 #define LTFF_DO_FULL_UPDATE 0x4000000 #define LTFf_OVERSTRIKE 0 #define LTFf_PLAIN_TEXT 1 #define LTFf_PLAIN_TEXT_WITH_TABS 2 #define LTFf_MIN_SIZE 3 #define LTFf_NO_CURSOR 4 // Makes LtfInsertStr remove #define LTFf_IN_DOLLAR 5 #define LTFf_STATEMENT_WAS_RUN 6 #define LTFf_WORD_WRAP 7 #define LTFf_UNDERLINED 8 #define LTFf_INVERTED 9 #define LTFf_BLINK 10 #define LTFf_FORM 11 #define LTFf_ATTR_BY_PARTITION 12 #define LTFf_ATTR_BY_FILENAME 13 #define LTFf_INHIBIT_LEFT_CLICK 14 #define LTFf_DOUBLE_DOLLARS 15 #define LTFf_MODIFIED 16 #define LTFf_BACKWARD_MOVEMENT 17 #define LTFf_HAS_SONG 18 #define LTFf_TOP_ENTRY_COPIED 19 #define LTFf_UNDO_DIRTY 20 #define LTFf_ALLOW_UNDO 21 #define LTFf_NO_PICWORDS 22 #define LTFf_SUPERSCRIPT_MODE 23 #define LTFf_SUBSCRIPT_MODE 24 #define LTFf_DONT_SWAP_OUT 25 #define LTFf_DO_FULL_UPDATE 26 class LtfUndo { LtfUndo *next,*last; U8 size; U8 ltf_flags; U8 timestamp; void *body; }; public class Ltf //Linked Text File header { LtfEntryBase dummy; I1 *dummy_display; LtfBinEntry bin_root; LtfUndo undo_root; U4 start_text_attribute; U8 w; U8 flags; U0 state_start; I4 shifted_x,shifted_y; I8 left_margin,right_margin; I4 indent,page_line_num,page_length; I4 header,footer,pad3; U1 text_attribute,link_attribute, macro_attribute,anchor_attribute, hidden_attribute,tree_attribute, user_attribute,pad2; U0 state_end; U8 top_flags; U0 top_line_state_start; I4 top_shifted_x,top_shifted_y; I8 top_left_margin,top_right_margin; I4 top_indent,top_page_line_num,top_page_length; I4 top_header,top_footer,top_pad3; U1 top_text_attribute,top_link_attribute, top_macro_attribute,top_anchor_attribute, top_hidden_attribute,top_tree_attribute, top_user_attribute,top_pad2; U0 top_line_state_end; LtfEntry *cur_entry,*top_entry; I4 cur_data_col, line_start_col,cur_top_line_num; I4 x,y,min_x,max_x,min_y,max_y; I4 old_cur_data_col; I8 undo_cnt; I8 old_win_top,old_win_bottom, old_win_left,old_win_right; LtfEntry *old_cur_entry; I8 line,col,best_d; I4 cmd_I1,pad4; U8 swap_out_time; I4 dollar_buf_size,dollar_buf_ptr; I1 *dollar_buf; I4 max_entries,ww_lines_back,cur_bin_num,pad1; I8 refresh_cnt; LtfEntry *recalc_start; EditFindTextStruct *find_replace; Ltf *menu_ltf; GrElem *cur_GrElem; I8 cur_sub_grelem; TssStruct *win_tss,*mem_tss; EditFileNameStruct filename; U8 file_attr; void LeftClickLink(Ltf *l,LtfEntry *cl,BoolU4 old_preempt); void RightClickLink(Ltf *l,LtfEntry *cl,BoolU4 old_preempt); I8 user_data; }; //LtfPopUpFlags #define LTFPUF_INTERCEPT_TASK_END 1 #define LFSF_IS_INCLUDED 1 #define LFSF_IS_LTF 2 class LexFileStruct { I1 *buf; I1 *buf_ptr; I8 line_num,flags; I1 *name; I1 *line_start; Ltf *l; LtfEntry *cur_entry; I1 last_I1,pad[7]; }; class LexUndefEntry { LexUndefEntry *next; SysHashEntry *hash; }; #define ICF_R_TO_DOUBLE 0x00000001 #define ICF_R_TO_INT 0x00000002 #define ICF_P1_TO_DOUBLE 0x00000004 #define ICF_P1_TO_INT 0x00000008 #define ICF_P2_TO_DOUBLE 0x00000010 #define ICF_P2_TO_INT 0x00000020 #define ICF_P3_TO_DOUBLE 0x00000040 #define ICF_P3_TO_INT 0x00000080 #define ICF_USE_DOUBLE 0x00000100 #define ICF_USE_UNSIGNED 0x00000200 #define ICF_USE_INT 0x00000400 //highest priority #define ICF_NO_DEPEND_RESULT 0x00000800 #define ICF_CODE_FINAL 0x00001000 #define ICF_NOT_ADDRESS 0x00002000 #define ICF_SHORT_JMP 0x00004000 #define ICF_P1_FIRST 0x00008000 #define ICF_PUSH_RESULT 0x00010000 #define ICF_TRACE 0x00020000 #define ICF_R_WAS_STK 0x00040000 #define ICF_P1_WAS_STK 0x00080000 #define ICF_P2_WAS_STK 0x00100000 #define ICF_P3_WAS_STK 0x00200000 #define ICF_PUSH_CMP 0x00400000 //for 507*sizeof(void *) class ParseStack {//dup code $LK,"CP_PRSPUSH","FF:::/LT/Compiler/CmpAsm.ASZ,CP_PRSPUSH"$ U8 ptr; I8 stk[255]; }; #define CB_IC_CNT 511 class CodeBlk { CodeBlk *next; IntermediateCode data[CB_IC_CNT]; }; #define CBMT_LABEL 0 #define CBMT_GOTO_LABEL 1 #define CBMT_STR_CONST 2 #define CBMT_JMP_TABLE 3 #define CBMF_USED 1 #define CBMF_POP_CMP 2 class CbMiscStruct { CbMiscStruct *next,*forward; I1 *str; U4 type,flags; void *address; U8 st_len; void **jmp_table; }; #define IEF_OP_SIZE16 1 #define IEF_OP_SIZE32 2 #define IEF_DONT_SWITCH_MODES 4 #define IEF_PLUS_OPCODE 8 #define IEF_DEFAULT 16 #define IEF_NO_REX 32 #define IEF_40_REX 64 #define IEF_48_REX 128 #define SV_REGISTER 8 #define SV_NONE 9 class InstructionEntry { U1 ins_entry_num; //This entry num in opcode hash entry U1 opcode_cnt; U1 opcode[4]; U1 flags,slash_value,opcode_modifier; U1 arg1,arg2; U1 pad[5]; }; class OpcodeHashEntry { SysHashEntry *next; I1 *str; U4 type,use_cnt; //AHT_OPCODE I1 *source_link; I1 *index; DbgInfo *debug; U1 instruction_entry_cnt; U1 pad[7]; InstructionEntry ins[1]; }; #define ASM_CODE_BLK_BITS 16 #define ASM_CODE_BLK_SIZE (1<answers[0]) #define ans0 (Fs->answers[0]) #define ans1 (Fs->answers[1]) #define ans2 (Fs->answers[2]) #define ans3 (Fs->answers[3]) #define ans4 (Fs->answers[4]) #define ans5 (Fs->answers[5]) #define ans6 (Fs->answers[6]) #define ans7 (Fs->answers[7]) #define ansd (Fs->double_answers[0]) #define ansd0 (Fs->double_answers[0]) #define ansd1 (Fs->double_answers[1]) #define ansd2 (Fs->double_answers[2]) #define ansd3 (Fs->double_answers[3]) #define ansd4 (Fs->double_answers[4]) #define ansd5 (Fs->double_answers[5]) #define ansd6 (Fs->double_answers[6]) #define ansd7 (Fs->double_answers[7]) #define KEYB_PORT 0x60 #define KEYB_CTRL 0x64 //SYS_CUR_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 16 #define SCF_E0_PREFIX (1<