/* Global declarations and macros for Sim. */ /* Must be included by every file. */ #ifndef HAVE_SIM_H #define HAVE_SIM_H /* Sim switches */ //#define USE_TI92PLUS //#define USE_V200 //#define USE_TI89 #if (defined(USE_TI92PLUS) || defined(USE_V200)) && defined(USE_TI89) #error Cannot create an executable for both models #endif //#define CHECK_MEM_LEAK /* uncomment when debugging. */ //#define CHECK_89_SCREEN_WIDTH /* For xST_helpMsg(). uncomment when debugging. */ //#define USE_PEDROM /* TIGCCLIB switches */ #ifdef USE_PEDROM #define MIN_AMS 101 /* for RemainingArgCnt() */ #define NO_AMS_CHECK #define USE_FLINE_ROM_CALLS #define USE_FLINE_EMULATOR #else /* not USE_PEDROM */ #define MIN_AMS 204 /* USE_FLINE_ROM_CALLS and TokenizeName() are used. */ #define USE_FLINE_ROM_CALLS #define EXECUTE_IN_GHOST_SPACE /* We are running asm programs. */ #endif /* not USE_PEDROM */ #include /* macros */ #if defined CHECK_89_SCREEN_WIDTH #define xST_helpMsg(s) do { \ /* don't forget the 'busy' indicator */ \ if (DrawStrWidth (s, F_4x6) >= 140 ) { \ ST_helpMsg ("/!\\ The following help msg is too long."); \ ngetchx(); } \ ST_helpMsg (s); } while (0) #else #define xST_helpMsg(s) ST_helpMsg (s) #endif /* not CHECK_89_SCREEN_WIDTH */ #ifdef CHECK_MEM_LEAK #define xatexit(f) do { \ /* Avoid showing a warning if a function is registered with atexit(). */ \ atexit ((atexit_t)f); \ old_mem_state -= 4; /* atexit() eats 4 bytes. */ \ } while (0) #else #define xatexit(f) atexit ((atexit_t)f) #endif /* not CHECK_MEM_LEAK */ #define CCST(val89,val92p) (TI89 ? (val89) : (val92p)) #define fatal(s) do {xST_helpMsg(s); exit(0);} while (0) #define MAX_SYM_LEN (8*2+3) /* for TokenizeName() */ // for debugging purposes : #define DB_msg(s) {ST_helpMsg(s);} #define DB_msg_pause(s) {DB_msg(s); ngetchx(); ST_eraseHelp();} #define DB_msg_break(s) {DB_msg(s); DB_break();} #define DB_break() {asm ("0: bra.s 0b");} #define DB_pause() {ngetchx();} #define DB_mark(s) {asm ("/* MARK : "#s" */");} /* strings */ extern char NO_MEM_STR[]; /* global variables */ #ifdef CHECK_MEM_LEAK extern unsigned long old_mem_state; #endif /*structures and enums */ typedef struct { short row_mask; /* to select the row (see _rowread in TIGCCLIB) */ unsigned short col_bit; /* to select the column */ } REMAP_ONE_KEY; #define REMAP_MATRIX_H 10u #define REMAP_MATRIX_W 8u /* There are as much elements as in the keyboard matrix (see _rowread) */ #define REMAP_MATRIX_SIZE (REMAP_MATRIX_H*REMAP_MATRIX_W) /* See AddToRemapMatrix() of parser.c for details on T_REMAP_MATRIX. */ typedef REMAP_ONE_KEY T_REMAP_MATRIX[REMAP_MATRIX_H][REMAP_MATRIX_W]; #define REMAP_KEY_NOT_USED 0 #endif /* not HAVE_SIM_H */