;Implementation of SoftMMU - Options ;=================================== ; Options are set according to compile-time flags. ; Therefore, if you change your expansion(s), you ; need to recompile SoftMMU. This keeps the ; executable small and fast. #ifndef SM_H #define SM_H ;Unless you overwrite your zero page registers, or screw up the tsp, ;sanity checks should never catch an error. If this is defined, the ;checks don't get compiled in. Saves a couple bytes and a couple of ;cycles per system call. ;#define always_sane ;The first byte in the TSP that's available to SoftMMU. #define sm_tspbase $2b ;Define your base system & expansions in order from ;fastest to slowest. Make sure the names match ;the filenames of the respective source code. #define exp0 georam #define exp1 6502 ;Highest expansion number #define numexp 1 ;---Do-not-edit-below-this-line---- ;Set up tables #ifdef exp5 # define _table .byte $00,$00,$00,$00,$00,$00 #elif exp4 # define _table .byte $00,$00,$00,$00,$00 #elif exp3 # define _table .byte $00,$00,$00,$00 #elif exp2 # define _table .byte $00,$00,$00 #elif exp1 # define _table .byte $00,$00 #elif exp0 # define _table .byte $00 #else # msg *** Error: No expansions defined in sm.h # msg # error #endif #ifndef sm_tspbase # msg *** Error: sm_tspbase not defined in sm.h # msg # error #endif #msg #msg SoftMMU Compile-time options: #msg ----------------------------- ;Set up each expansion #define routine setup #include "sm_include.h.txt" #msg . done #msg #define tsp_smget (sm_tspbase + 0) #define tsp_smlose (sm_tspbase + 1) ;Get tsp allocation pointer #ifdef exp5 # define tsp_smptr (sm_tspbase + 2 + exp0tsp + exp1tsp + exp2tsp + exp3tsp + exp4tsp + exp5tsp) #elif exp4 # define tsp_smptr (sm_tspbase + 2 + exp0tsp + exp1tsp + exp2tsp + exp3tsp + exp4tsp) #elif exp3 # define tsp_smptr (sm_tspbase + 2 + exp0tsp + exp1tsp + exp2tsp + exp3tsp) #elif exp2 # define tsp_smptr (sm_tspbase + 2 + exp0tsp + exp1tsp + exp2tsp) #elif exp1 # define tsp_smptr (sm_tspbase + 2 + exp0tsp + exp1tsp) #elif exp0 # define tsp_smptr (sm_tspbase + 2 + exp0tsp) #else # msg *** Error: No expansions defined in sm.h # msg # error #endif #endif