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