1 /* ======================================================================== */
\r
2 /* ========================= LICENSING & COPYRIGHT ======================== */
\r
3 /* ======================================================================== */
\r
8 * A portable Motorola M680x0 processor emulation engine.
\r
9 * Copyright 1998-2001 Karl Stenerud. All rights reserved.
\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
15 * All other lisencing terms must be negotiated with the author
\r
18 * The latest version of this code can be obtained at:
\r
19 * http://kstenerud.cjb.net
\r
23 // notaz: kill some stupid VC warnings
\r
25 #pragma warning (disable:4100) // unreferenced formal parameter
\r
26 #pragma warning (disable:4127) // conditional expression is constant
\r
27 #pragma warning (disable:4245) // type conversion
\r
28 #pragma warning (disable:4514) // unreferenced inline function has been removed
\r
32 #ifndef M68KCONF__HEADER
\r
33 #define M68KCONF__HEADER
\r
36 /* Configuration switches.
\r
37 * Use OPT_SPECIFY_HANDLER for configuration options that allow callbacks.
\r
38 * OPT_SPECIFY_HANDLER causes the core to link directly to the function
\r
39 * or macro you specify, rather than using callback functions whose pointer
\r
40 * must be passed in using m68k_set_xxx_callback().
\r
44 #define OPT_SPECIFY_HANDLER 2
\r
47 /* ======================================================================== */
\r
48 /* ============================== MAME STUFF ============================== */
\r
49 /* ======================================================================== */
\r
51 /* If you're compiling this for MAME, only change M68K_COMPILE_FOR_MAME
\r
52 * to OPT_ON and use m68kmame.h to configure the 68k core.
\r
54 #ifndef M68K_COMPILE_FOR_MAME
\r
55 #define M68K_COMPILE_FOR_MAME OPT_OFF
\r
56 #endif /* M68K_COMPILE_FOR_MAME */
\r
59 #if M68K_COMPILE_FOR_MAME == OPT_OFF
\r
62 /* ======================================================================== */
\r
63 /* ============================= CONFIGURATION ============================ */
\r
64 /* ======================================================================== */
\r
66 /* Turn ON if you want to use the following M68K variants */
\r
67 #define M68K_EMULATE_008 OPT_OFF
\r
68 #define M68K_EMULATE_010 OPT_OFF
\r
69 #define M68K_EMULATE_EC020 OPT_OFF
\r
70 #define M68K_EMULATE_020 OPT_OFF
\r
71 #define M68K_EMULATE_040 OPT_OFF
\r
74 /* If ON, the CPU will call m68k_read_immediate_xx() for immediate addressing
\r
75 * and m68k_read_pcrelative_xx() for PC-relative addressing.
\r
76 * If off, all read requests from the CPU will be redirected to m68k_read_xx()
\r
78 #define M68K_SEPARATE_READS OPT_OFF
\r
80 /* If ON, the CPU will call m68k_write_32_pd() when it executes move.l with a
\r
81 * predecrement destination EA mode instead of m68k_write_32().
\r
82 * To simulate real 68k behavior, m68k_write_32_pd() must first write the high
\r
83 * word to [address+2], and then write the low word to [address].
\r
85 #define M68K_SIMULATE_PD_WRITES OPT_OFF
\r
87 /* If ON, CPU will call the interrupt acknowledge callback when it services an
\r
89 * If off, all interrupts will be autovectored and all interrupt requests will
\r
90 * auto-clear when the interrupt is serviced.
\r
92 #define M68K_EMULATE_INT_ACK OPT_ON
\r
93 #define M68K_INT_ACK_CALLBACK(A) your_int_ack_handler_function(A)
\r
96 /* If ON, CPU will call the breakpoint acknowledge callback when it encounters
\r
97 * a breakpoint instruction and it is running a 68010+.
\r
99 #define M68K_EMULATE_BKPT_ACK OPT_OFF
\r
100 #define M68K_BKPT_ACK_CALLBACK() your_bkpt_ack_handler_function()
\r
103 /* If ON, the CPU will monitor the trace flags and take trace exceptions
\r
105 #define M68K_EMULATE_TRACE OPT_ON
\r
108 /* If ON, CPU will call the output reset callback when it encounters a reset
\r
111 #define M68K_EMULATE_RESET OPT_OFF
\r
112 #define M68K_RESET_CALLBACK() your_reset_handler_function()
\r
115 /* If ON, CPU will call the callback when it encounters a cmpi.l #v, dn
\r
118 #define M68K_CMPILD_HAS_CALLBACK OPT_OFF
\r
119 #define M68K_CMPILD_CALLBACK(v,r) your_cmpild_handler_function(v,r)
\r
122 /* If ON, CPU will call the callback when it encounters a rte
\r
125 #define M68K_RTE_HAS_CALLBACK OPT_OFF
\r
126 #define M68K_RTE_CALLBACK() your_rte_handler_function()
\r
129 /* If ON, CPU will call the callback when it encounters a tas
\r
132 #define M68K_TAS_HAS_CALLBACK OPT_ON
\r
133 #define M68K_TAS_CALLBACK() your_tas_handler_function()
\r
136 /* If ON, CPU will call the set fc callback on every memory access to
\r
137 * differentiate between user/supervisor, program/data access like a real
\r
138 * 68000 would. This should be enabled and the callback should be set if you
\r
139 * want to properly emulate the m68010 or higher. (moves uses function codes
\r
140 * to read/write data from different address spaces)
\r
142 #define M68K_EMULATE_FC OPT_OFF
\r
143 #define M68K_SET_FC_CALLBACK(A) your_set_fc_handler_function(A)
\r
146 /* If ON, CPU will call the pc changed callback when it changes the PC by a
\r
147 * large value. This allows host programs to be nicer when it comes to
\r
148 * fetching immediate data and instructions on a banked memory system.
\r
150 #define M68K_MONITOR_PC OPT_OFF
\r
151 #define M68K_SET_PC_CALLBACK(A) your_pc_changed_handler_function(A)
\r
154 /* If ON, CPU will call the instruction hook callback before every
\r
157 #define M68K_INSTRUCTION_HOOK OPT_OFF
\r
158 //#define M68K_INSTRUCTION_HOOK OPT_SPECIFY_HANDLER
\r
159 #define M68K_INSTRUCTION_CALLBACK() instruction_hook()
\r
162 /* If ON, the CPU will emulate the 4-byte prefetch queue of a real 68000 */
\r
163 #define M68K_EMULATE_PREFETCH OPT_OFF
\r
166 /* If ON, the CPU will generate address error exceptions if it tries to
\r
167 * access a word or longword at an odd address.
\r
168 * NOTE: This is only emulated properly for 68000 mode.
\r
170 #define M68K_EMULATE_ADDRESS_ERROR OPT_OFF
\r
173 /* Turn ON to enable logging of illegal instruction calls.
\r
174 * M68K_LOG_FILEHANDLE must be #defined to a stdio file stream.
\r
175 * Turn on M68K_LOG_1010_1111 to log all 1010 and 1111 calls.
\r
177 #define M68K_LOG_ENABLE OPT_OFF
\r
178 #define M68K_LOG_1010_1111 OPT_OFF
\r
179 #define M68K_LOG_FILEHANDLE some_file_handle
\r
182 /* ----------------------------- COMPATIBILITY ---------------------------- */
\r
184 /* The following options set optimizations that violate the current ANSI
\r
185 * standard, but will be compliant under the forthcoming C9X standard.
\r
189 /* If ON, the enulation core will use 64-bit integers to speed up some
\r
192 #define M68K_USE_64_BIT OPT_OFF
\r
195 /* Set to your compiler's static inline keyword to enable it, or
\r
196 * set it to blank to disable it.
\r
197 * If you define INLINE in the makefile, it will override this value.
\r
198 * NOTE: not enabling inline functions will SEVERELY slow down emulation.
\r
201 #define INLINE static __inline
\r
202 #endif /* INLINE */
\r
204 #endif /* M68K_COMPILE_FOR_MAME */
\r
207 /* ======================================================================== */
\r
208 /* ============================== END OF FILE ============================= */
\r
209 /* ======================================================================== */
\r
211 #endif /* M68KCONF__HEADER */
\r