fix compatibility with ancient gas
[cyclone68000.git] / config.h
CommitLineData
d9d77995 1\r
2\r
3/**\r
4 * Cyclone 68000 configuration file\r
5**/\r
6\r
7\r
19881760 8/*\r
9 * By default, only ARMv4 instructions are used.\r
10 * If you want Cyclone to make use of newer ARM instructions, enable the\r
11 * options(s) below. You can also override this using make argument:\r
12 * make HAVE_ARMv6=1\r
13 */\r
14#ifndef HAVE_ARMv6\r
15#define HAVE_ARMv6 0\r
16#endif\r
17\r
d9d77995 18/*\r
19 * If this option is enabled, Microsoft ARMASM compatible output is generated\r
20 * (output file - Cyclone.asm). Otherwise GNU as syntax is used (Cyclone.s).\r
21 */\r
22#define USE_MS_SYNTAX 0\r
23\r
24/*\r
25 * Enable this option if you are going to use Cyclone to emulate Genesis /\r
26 * Mega Drive system. As VDP chip in these systems had control of the bus,\r
27 * several instructions were acting differently, for example TAS did'n have\r
28 * the write-back phase. That will be emulated, if this option is enabled.\r
29 */\r
30#define CYCLONE_FOR_GENESIS 0\r
31\r
32/*\r
33 * This option compresses Cyclone's jumptable. Because of this the executable\r
34 * will be smaller and load slightly faster and less relocations will be needed.\r
35 * This also fixes the crash problem with 0xfffe and 0xffff opcodes.\r
36 * Warning: if you enable this, you MUST call CycloneInit() before calling\r
37 * CycloneRun(), or else it will crash.\r
38 */\r
39#define COMPRESS_JUMPTABLE 1\r
40\r
41/*\r
42 * Address mask for memory hadlers. The bits set will be masked out of address\r
43 * parameter, which is passed to r/w memory handlers.\r
44 * Using 0xff000000 means that only 24 least significant bits should be used.\r
45 * Set to 0 if you want to mask unused address bits in the memory handlers yourself.\r
46 */\r
47#define MEMHANDLERS_ADDR_MASK 0\r
48\r
49/*\r
50 * Cyclone keeps the 4 least significant bits of SR, PC+membase and it's cycle\r
51 * counter in ARM registers instead of the context for performance reasons. If you for\r
52 * any reason need to access them in your memory handlers, enable the options below,\r
53 * otherwise disable them to improve performance.\r
54 *\r
55 * MEMHANDLERS_NEED_PC updates .pc context field with PC value effective at the time\r
56 * when memhandler was called (opcode address + 2-10 bytes).\r
57 * MEMHANDLERS_NEED_PREV_PC updates .prev_pc context field to currently executed\r
58 * opcode address + 2.\r
59 * Note that .pc and .prev_pc values are always real pointers to memory, so you must\r
60 * subtract .membase to get M68k PC value.\r
61 *\r
62 * Warning: updating PC in memhandlers is dangerous, as Cyclone may internally\r
63 * increment the PC before fetching the next instruction and continue executing\r
64 * at wrong location. It's better to wait until Cyclone CycloneRun() finishes.\r
65 *\r
66 * Warning: if you enable MEMHANDLERS_CHANGE_CYCLES, you must also enable\r
67 * MEMHANDLERS_NEED_CYCLES, or else Cyclone will keep reloading the same cycle\r
68 * count and this will screw timing (if not cause a deadlock).\r
69 */\r
70#define MEMHANDLERS_NEED_PC 0\r
71#define MEMHANDLERS_NEED_PREV_PC 0\r
72#define MEMHANDLERS_NEED_FLAGS 0\r
73#define MEMHANDLERS_NEED_CYCLES 0\r
74#define MEMHANDLERS_CHANGE_PC 0\r
75#define MEMHANDLERS_CHANGE_FLAGS 0\r
76#define MEMHANDLERS_CHANGE_CYCLES 0\r
77\r
78/*\r
79 * If the following macro is defined, Cyclone no longer calls read*, write*,\r
80 * fetch* and checkpc from it's context, it calls these functions directly\r
81 * instead, prefixed with prefix selected below. For example, if\r
82 * MEMHANDLERS_DIRECT_PREFIX is set to cyclone_, it will call cyclone_read8\r
83 * on byte reads.\r
84 * This is to avoid indirect jumps, which are slower. It also saves one ARM\r
85 * instruction.\r
86 */\r
87/* MEMHANDLERS_DIRECT_PREFIX "cyclone_" */\r
88\r
89/*\r
90 * If enabled, Cyclone will call .IrqCallback routine from it's context whenever it\r
91 * acknowledges an IRQ. IRQ level (.irq) is not cleared automatically, do this in your\r
92 * handler if needed.\r
93 * This function must either return vector number to use for interrupt exception,\r
94 * CYCLONE_INT_ACK_AUTOVECTOR to use autovector (this is the most common case), or\r
95 * CYCLONE_INT_ACK_SPURIOUS (least common case).\r
96 * If disabled, it simply uses appropriate autovector, clears the IRQ level and\r
97 * continues execution.\r
98 */\r
99#define USE_INT_ACK_CALLBACK 0\r
100\r
101/*\r
102 * Enable this if you need old PC, flags or cycles;\r
103 * or you change cycles in your IrqCallback function.\r
104 */\r
105#define INT_ACK_NEEDS_STUFF 0\r
106#define INT_ACK_CHANGES_CYCLES 0\r
107\r
108/*\r
109 * If enabled, .ResetCallback is called from the context, whenever RESET opcode is\r
110 * encountered. All context members are valid and can be changed.\r
111 * If disabled, RESET opcode acts as an NOP.\r
112 */\r
113#define USE_RESET_CALLBACK 0\r
114\r
115/*\r
116 * If enabled, UnrecognizedCallback is called if an invalid opcode is\r
117 * encountered. All context members are valid and can be changed. The handler\r
118 * should return zero if you want Cyclone to gererate "Illegal Instruction"\r
119 * exception after this, or nonzero if not. In the later case you should change\r
120 * the PC by yourself, or else Cyclone will keep executing that opcode all over\r
121 * again.\r
122 * If disabled, "Illegal Instruction" exception is generated and execution is\r
123 * continued.\r
124 */\r
125#define USE_UNRECOGNIZED_CALLBACK 0\r
126\r
127/*\r
128 * This option will also call UnrecognizedCallback for a-line and f-line\r
129 * (0xa*** and 0xf***) opcodes the same way as described above, only appropriate\r
130 * exceptions will be generated.\r
131 */\r
132#define USE_AFLINE_CALLBACK 0\r
133\r
134/*\r
135 * This makes Cyclone to call checkpc from it's context whenever it changes the PC\r
136 * by a large value. It takes and should return the PC value in PC+membase form.\r
137 * The flags and cycle counter are not valid in this function.\r
138 */\r
139#define USE_CHECKPC_CALLBACK 1\r
140\r
141/*\r
142 * This determines if checkpc() should be called after jumps when 8 and 16 bit\r
143 * displacement values were used.\r
144 */\r
145#define USE_CHECKPC_OFFSETBITS_16 1\r
146#define USE_CHECKPC_OFFSETBITS_8 0\r
147\r
148/*\r
149 * Call checkpc() after DBcc jumps (which use 16bit displacement). Cyclone prior to\r
150 * 0.0087 never did that.\r
151 */\r
152#define USE_CHECKPC_DBRA 0\r
153\r
154/*\r
155 * When this option is enabled Cyclone will do two word writes instead of one\r
156 * long write when handling MOVE.L or MOVEM.L with pre-decrementing destination,\r
157 * as described in Bart Trzynadlowski's doc (http://www.trzy.org/files/68knotes.txt).\r
158 * Enable this if you are emulating a 16 bit system.\r
159 */\r
160#define SPLIT_MOVEL_PD 1\r
161\r
162/*\r
163 * Enable emulation of trace mode. Shouldn't cause any performance decrease, so it\r
164 * should be safe to keep this ON.\r
165 */\r
166#define EMULATE_TRACE 1\r
167\r
168/*\r
169 * If enabled, address error exception will be generated if 68k code jumps to an\r
170 * odd address. Causes very small performance hit (2 ARM instructions for every\r
171 * emulated jump/return/exception in normal case).\r
172 * Note: checkpc() must not clear least significant bit of rebased address\r
173 * for this to work, as checks are performed after calling checkpc().\r
174 */\r
175#define EMULATE_ADDRESS_ERRORS_JUMP 1\r
176\r
177/*\r
178 * If enabled, address error exception will be generated if 68k code tries to\r
179 * access a word or longword at an odd address. The performance cost is also 2 ARM\r
180 * instructions per access (for address error checks).\r
181 */\r
182#define EMULATE_ADDRESS_ERRORS_IO 0\r
183\r
184/*\r
185 * If an address error happens during another address error processing,\r
186 * the processor halts until it is reset (catastrophic system failure, as the manual\r
187 * states). This option enables halt emulation.\r
188 * Note that this might be not desired if it is known that emulated system should\r
189 * never reach this state.\r
190 */\r
191#define EMULATE_HALT 0\r
192\r