]> Shamusworld >> Repos - virtualjaguar/blob - src/m68kconf.h
Adding 1.0.1/2 uncompressed tarballs to tags for historical purposes.
[virtualjaguar] / src / m68kconf.h
1 /* ======================================================================== */\r
2 /* ========================= LICENSING & COPYRIGHT ======================== */\r
3 /* ======================================================================== */\r
4 /*\r
5  *                                  MUSASHI\r
6  *                                Version 3.3\r
7  *\r
8  * A portable Motorola M680x0 processor emulation engine.\r
9  * Copyright 1998-2001 Karl Stenerud.  All rights reserved.\r
10  *\r
11  * This code may be freely used for non-commercial purposes as long as this\r
12  * copyright notice remains unaltered in the source code and any binary files\r
13  * containing this code in compiled form.\r
14  *\r
15  * All other lisencing terms must be negotiated with the author\r
16  * (Karl Stenerud).\r
17  *\r
18  * The latest version of this code can be obtained at:\r
19  * http://kstenerud.cjb.net\r
20  */\r
21 \r
22 \r
23 \r
24 #ifndef M68KCONF__HEADER\r
25 #define M68KCONF__HEADER\r
26 \r
27 \r
28 /* Configuration switches.\r
29  * Use OPT_SPECIFY_HANDLER for configuration options that allow callbacks.\r
30  * OPT_SPECIFY_HANDLER causes the core to link directly to the function\r
31  * or macro you specify, rather than using callback functions whose pointer\r
32  * must be passed in using m68k_set_xxx_callback().\r
33  */\r
34 #define OPT_OFF             0\r
35 #define OPT_ON              1\r
36 #define OPT_SPECIFY_HANDLER 2\r
37 \r
38 \r
39 /* ======================================================================== */\r
40 /* ============================== MAME STUFF ============================== */\r
41 /* ======================================================================== */\r
42 \r
43 /* If you're compiling this for MAME, only change M68K_COMPILE_FOR_MAME\r
44  * to OPT_ON and use m68kmame.h to configure the 68k core.\r
45  */\r
46 #ifndef M68K_COMPILE_FOR_MAME\r
47 #define M68K_COMPILE_FOR_MAME      OPT_OFF\r
48 #endif /* M68K_COMPILE_FOR_MAME */\r
49 \r
50 #if M68K_COMPILE_FOR_MAME == OPT_ON\r
51 #include "m68kmame.h"\r
52 #else\r
53 \r
54 \r
55 \r
56 /* ======================================================================== */\r
57 /* ============================= CONFIGURATION ============================ */\r
58 /* ======================================================================== */\r
59 \r
60 /* Turn on if you want to use the following M68K variants */\r
61 #define M68K_EMULATE_010            OPT_OFF\r
62 #define M68K_EMULATE_EC020          OPT_OFF\r
63 #define M68K_EMULATE_020            OPT_OFF\r
64 \r
65 \r
66 /* If on, the CPU will call m68k_read_immediate_xx() for immediate addressing\r
67  * and m68k_read_pcrelative_xx() for PC-relative addressing.\r
68  * If off, all read requests from the CPU will be redirected to m68k_read_xx()\r
69  */\r
70 #define M68K_SEPARATE_READS         OPT_OFF\r
71 \r
72 \r
73 /* If on, CPU will call the interrupt acknowledge callback when it services an\r
74  * interrupt.\r
75  * If off, all interrupts will be autovectored and all interrupt requests will\r
76  * auto-clear when the interrupt is serviced.\r
77  */\r
78 //#define M68K_EMULATE_INT_ACK        OPT_OFF\r
79 //#define M68K_INT_ACK_CALLBACK(A)    your_int_ack_handler_function(A)\r
80 \r
81 //#ifdef __cplusplus\r
82 //extern "C" {\r
83 //#endif\r
84 int irq_ack_handler(int);\r
85 //#ifdef __cplusplus\r
86 //}\r
87 //#endif\r
88 \r
89 #define M68K_EMULATE_INT_ACK        OPT_SPECIFY_HANDLER\r
90 #define M68K_INT_ACK_CALLBACK(A)    irq_ack_handler(A)\r
91 \r
92 \r
93 /* If on, CPU will call the breakpoint acknowledge callback when it encounters\r
94  * a breakpoint instruction and it is running a 68010+.\r
95  */\r
96 #define M68K_EMULATE_BKPT_ACK       OPT_OFF\r
97 #define M68K_BKPT_ACK_CALLBACK()    your_bkpt_ack_handler_function()\r
98 \r
99 \r
100 /* If on, the CPU will monitor the trace flags and take trace exceptions\r
101  */\r
102 #define M68K_EMULATE_TRACE          OPT_OFF\r
103 \r
104 \r
105 /* If on, CPU will call the output reset callback when it encounters a reset\r
106  * instruction.\r
107  */\r
108 #define M68K_EMULATE_RESET          OPT_OFF\r
109 #define M68K_RESET_CALLBACK()       your_reset_handler_function()\r
110 \r
111 \r
112 /* If on, CPU will call the set fc callback on every memory access to\r
113  * differentiate between user/supervisor, program/data access like a real\r
114  * 68000 would.  This should be enabled and the callback should be set if you\r
115  * want to properly emulate the m68010 or higher. (moves uses function codes\r
116  * to read/write data from different address spaces)\r
117  */\r
118 #define M68K_EMULATE_FC             OPT_OFF\r
119 #define M68K_SET_FC_CALLBACK(A)     your_set_fc_handler_function(A)\r
120 \r
121 \r
122 /* If on, CPU will call the pc changed callback when it changes the PC by a\r
123  * large value.  This allows host programs to be nicer when it comes to\r
124  * fetching immediate data and instructions on a banked memory system.\r
125  */\r
126 #define M68K_MONITOR_PC             OPT_OFF\r
127 #define M68K_SET_PC_CALLBACK(A)     your_pc_changed_handler_function(A)\r
128 \r
129 \r
130 /* If on, CPU will call the instruction hook callback before every\r
131  * instruction.\r
132  */\r
133 #define M68K_INSTRUCTION_HOOK       OPT_OFF\r
134 #define M68K_INSTRUCTION_CALLBACK() your_instruction_hook_function()\r
135 \r
136 \r
137 /* If on, the CPU will emulate the 4-byte prefetch queue of a real 68000 */\r
138 #define M68K_EMULATE_PREFETCH       OPT_OFF\r
139 \r
140 \r
141 /* If on, the CPU will generate address error exceptions if it tries to\r
142  * access a word or longword at an odd address.\r
143  * NOTE: Do not enable this!  It is not working!\r
144  */\r
145 #define M68K_EMULATE_ADDRESS_ERROR  OPT_OFF\r
146 \r
147 \r
148 /* Turn on to enable logging of illegal instruction calls.\r
149  * M68K_LOG_FILEHANDLE must be #defined to a stdio file stream.\r
150  * Turn on M68K_LOG_1010_1111 to log all 1010 and 1111 calls.\r
151  */\r
152 #define M68K_LOG_ENABLE             OPT_OFF\r
153 #define M68K_LOG_1010_1111          OPT_OFF\r
154 #define M68K_LOG_FILEHANDLE         some_file_handle\r
155 \r
156 \r
157 /* ----------------------------- COMPATIBILITY ---------------------------- */\r
158 \r
159 /* The following options set optimizations that violate the current ANSI\r
160  * standard, but will be compliant under the forthcoming C9X standard.\r
161  */\r
162 \r
163 \r
164 /* If on, the enulation core will use 64-bit integers to speed up some\r
165  * operations.\r
166 */\r
167 #define M68K_USE_64_BIT  OPT_OFF\r
168 \r
169 \r
170 /* Set to your compiler's static inline keyword to enable it, or\r
171  * set it to blank to disable it.\r
172  * If you define INLINE in the makefile, it will override this value.\r
173  * NOTE: not enabling inline functions will SEVERELY slow down emulation.\r
174  */\r
175 #ifndef INLINE\r
176 #define INLINE static __inline__\r
177 #endif /* INLINE */\r
178 \r
179 \r
180 /* If your environment requires special prefixes for system callback functions\r
181  * such as the argument to qsort(), then set them here or in the makefile.\r
182  */\r
183 #ifndef DECL_SPEC\r
184 #define DECL_SPEC\r
185 #endif\r
186 \r
187 #endif /* M68K_COMPILE_FOR_MAME */\r
188 \r
189 \r
190 /* ======================================================================== */\r
191 /* ============================== END OF FILE ============================= */\r
192 /* ======================================================================== */\r
193 \r
194 #endif /* M68KCONF__HEADER */\r