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