some optimizations
[picodrive.git] / cpu / Cyclone / config.h
CommitLineData
cc68a136 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 * Otherwise GNU as syntax is used.\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
a6785576 18 * the write-back phase. That will be emulated, if this option is enabled.\r
cc68a136 19 * This option also alters timing slightly.\r
20 */\r
a9a5a6e0 21#define CYCLONE_FOR_GENESIS 2\r
cc68a136 22\r
23/*\r
24 * This option compresses Cyclone's jumptable. Because of this the executable\r
25 * will be smaller and load slightly faster and less relocations will be needed.\r
26 * This also fixes the crash problem with 0xfffe and 0xffff opcodes.\r
27 * Warning: if you enable this, you MUST call CycloneInit() before calling\r
28 * CycloneRun(), or else it will crash.\r
29 */\r
30#define COMPRESS_JUMPTABLE 1\r
31\r
a6785576 32/*\r
33 * Address mask for memory hadlers. The bits set will be masked out of address\r
34 * parameter, which is passed to r/w memory handlers.\r
35 * Using 0xff000000 means that only 24 least significant bits should be used.\r
36 * Set to 0 if you want to mask unused address bits in the memory handlers yourself.\r
37 */\r
a9a5a6e0 38#define MEMHANDLERS_ADDR_MASK 0\r
a6785576 39\r
cc68a136 40/*\r
41 * Cyclone keeps the 4 least significant bits of SR, PC+membase and it's cycle\r
42 * count in ARM registers instead of the context for performance reasons. If you for\r
43 * any reason need to access them in your memory handlers, enable the options below,\r
44 * otherwise disable them to improve performance.\r
cfb3dfa0 45 * MEMHANDLERS_NEED_PC updates .pc context field with PC value effective at the time\r
46 * when memhandler was called (opcode address + unknown amount).\r
47 * MEMHANDLERS_NEED_PREV_PC updates .prev_pc context field to currently executed\r
b637c56a 48 * opcode address + 2.\r
cfb3dfa0 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
a6785576 51 * Warning: updating PC in memhandlers is dangerous, as Cyclone may internally\r
52 * increment the PC before fetching the next instruction and continue executing\r
53 * at wrong location.\r
cc68a136 54 */\r
55#define MEMHANDLERS_NEED_PC 0\r
cfb3dfa0 56#define MEMHANDLERS_NEED_PREV_PC 0\r
cc68a136 57#define MEMHANDLERS_NEED_FLAGS 0\r
58#define MEMHANDLERS_NEED_CYCLES 1\r
59#define MEMHANDLERS_CHANGE_PC 0\r
60#define MEMHANDLERS_CHANGE_FLAGS 0\r
61#define MEMHANDLERS_CHANGE_CYCLES 0\r
62\r
63/*\r
64 * If enabled, Cyclone will call IrqCallback routine from it's context whenever it\r
65 * acknowledges an IRQ. IRQ level is not cleared automatically, do this in your\r
66 * hadler if needed. PC, flags and cycles are valid in the context and can be read.\r
67 * If disabled, it simply clears the IRQ level and continues execution.\r
68 */\r
69#define USE_INT_ACK_CALLBACK 1\r
70\r
71/*\r
72 * Enable this if you need/change PC, flags or cycles in your IrqCallback function.\r
73 */\r
74#define INT_ACK_NEEDS_STUFF 0\r
75#define INT_ACK_CHANGES_STUFF 0\r
76\r
77/*\r
78 * If enabled, ResetCallback is called from the context, whenever RESET opcode is\r
79 * encountered. All context members are valid and can be changed.\r
80 * If disabled, RESET opcode acts as an NOP.\r
81 */\r
82#define USE_RESET_CALLBACK 1\r
83\r
84/*\r
85 * If enabled, UnrecognizedCallback is called if an invalid opcode is\r
86 * encountered. All context members are valid and can be changed. The handler\r
87 * should return zero if you want Cyclone to gererate "Illegal Instruction"\r
a6785576 88 * exception after this, or nonzero if not. In the later case you should change\r
cc68a136 89 * the PC by yourself, or else Cyclone will keep executing that opcode all over\r
90 * again.\r
91 * If disabled, "Illegal Instruction" exception is generated and execution is\r
92 * continued.\r
93 */\r
94#define USE_UNRECOGNIZED_CALLBACK 1\r
95\r
96/*\r
97 * This option will also call UnrecognizedCallback for a-line and f-line\r
98 * (0xa*** and 0xf***) opcodes the same way as described above, only appropriate\r
99 * exceptions will be generated.\r
100 */\r
101#define USE_AFLINE_CALLBACK 1\r
102\r
103/*\r
104 * This makes Cyclone to call checkpc from it's context whenever it changes the PC\r
105 * by a large value. It takes and should return the PC value in PC+membase form.\r
106 * The flags and cycle counter are not valid in this function.\r
107 */\r
108#define USE_CHECKPC_CALLBACK 1\r
109\r
110/*\r
111 * When this option is enabled Cyclone will do two word writes instead of one\r
112 * long write when handling MOVE.L with pre-decrementing destination, as described in\r
113 * Bart Trzynadlowski's doc (http://www.trzy.org/files/68knotes.txt).\r
114 * Enable this if you are emulating a 16 bit system.\r
115 */\r
116#define SPLIT_MOVEL_PD 1\r