initial import
[picodrive.git] / cpu / musashi / m68kconf.h
diff --git a/cpu/musashi/m68kconf.h b/cpu/musashi/m68kconf.h
new file mode 100644 (file)
index 0000000..ced542d
--- /dev/null
@@ -0,0 +1,203 @@
+/* ======================================================================== */\r
+/* ========================= LICENSING & COPYRIGHT ======================== */\r
+/* ======================================================================== */\r
+/*\r
+ *                                  MUSASHI\r
+ *                                Version 3.3\r
+ *\r
+ * A portable Motorola M680x0 processor emulation engine.\r
+ * Copyright 1998-2001 Karl Stenerud.  All rights reserved.\r
+ *\r
+ * This code may be freely used for non-commercial purposes as long as this\r
+ * copyright notice remains unaltered in the source code and any binary files\r
+ * containing this code in compiled form.\r
+ *\r
+ * All other lisencing terms must be negotiated with the author\r
+ * (Karl Stenerud).\r
+ *\r
+ * The latest version of this code can be obtained at:\r
+ * http://kstenerud.cjb.net\r
+ */\r
+\r
+\r
+// notaz: kill some stupid VC warnings\r
+#ifndef __GNUC__\r
+#pragma warning (disable:4100) // unreferenced formal parameter\r
+#pragma warning (disable:4127) // conditional expression is constant\r
+#pragma warning (disable:4245) // type conversion\r
+#pragma warning (disable:4514) // unreferenced inline function has been removed\r
+#endif\r
+\r
+\r
+#ifndef M68KCONF__HEADER\r
+#define M68KCONF__HEADER\r
+\r
+\r
+/* Configuration switches.\r
+ * Use OPT_SPECIFY_HANDLER for configuration options that allow callbacks.\r
+ * OPT_SPECIFY_HANDLER causes the core to link directly to the function\r
+ * or macro you specify, rather than using callback functions whose pointer\r
+ * must be passed in using m68k_set_xxx_callback().\r
+ */\r
+#define OPT_OFF             0\r
+#define OPT_ON              1\r
+#define OPT_SPECIFY_HANDLER 2\r
+\r
+\r
+/* ======================================================================== */\r
+/* ============================== MAME STUFF ============================== */\r
+/* ======================================================================== */\r
+\r
+/* If you're compiling this for MAME, only change M68K_COMPILE_FOR_MAME\r
+ * to OPT_ON and use m68kmame.h to configure the 68k core.\r
+ */\r
+#ifndef M68K_COMPILE_FOR_MAME\r
+#define M68K_COMPILE_FOR_MAME      OPT_OFF\r
+#endif /* M68K_COMPILE_FOR_MAME */\r
+\r
+\r
+#if M68K_COMPILE_FOR_MAME == OPT_OFF\r
+\r
+\r
+/* ======================================================================== */\r
+/* ============================= CONFIGURATION ============================ */\r
+/* ======================================================================== */\r
+\r
+/* Turn ON if you want to use the following M68K variants */\r
+#define M68K_EMULATE_008            OPT_OFF\r
+#define M68K_EMULATE_010            OPT_OFF\r
+#define M68K_EMULATE_EC020          OPT_OFF\r
+#define M68K_EMULATE_020            OPT_OFF\r
+#define M68K_EMULATE_040            OPT_OFF\r
+\r
+\r
+/* If ON, the CPU will call m68k_read_immediate_xx() for immediate addressing\r
+ * and m68k_read_pcrelative_xx() for PC-relative addressing.\r
+ * If off, all read requests from the CPU will be redirected to m68k_read_xx()\r
+ */\r
+#define M68K_SEPARATE_READS         OPT_ON\r
+\r
+/* If ON, the CPU will call m68k_write_32_pd() when it executes move.l with a\r
+ * predecrement destination EA mode instead of m68k_write_32().\r
+ * To simulate real 68k behavior, m68k_write_32_pd() must first write the high\r
+ * word to [address+2], and then write the low word to [address].\r
+ */\r
+#define M68K_SIMULATE_PD_WRITES     OPT_OFF\r
+\r
+/* If ON, CPU will call the interrupt acknowledge callback when it services an\r
+ * interrupt.\r
+ * If off, all interrupts will be autovectored and all interrupt requests will\r
+ * auto-clear when the interrupt is serviced.\r
+ */\r
+#define M68K_EMULATE_INT_ACK        OPT_ON\r
+#define M68K_INT_ACK_CALLBACK(A)    your_int_ack_handler_function(A)\r
+\r
+\r
+/* If ON, CPU will call the breakpoint acknowledge callback when it encounters\r
+ * a breakpoint instruction and it is running a 68010+.\r
+ */\r
+#define M68K_EMULATE_BKPT_ACK       OPT_OFF\r
+#define M68K_BKPT_ACK_CALLBACK()    your_bkpt_ack_handler_function()\r
+\r
+\r
+/* If ON, the CPU will monitor the trace flags and take trace exceptions\r
+ */\r
+#define M68K_EMULATE_TRACE          OPT_OFF\r
+\r
+\r
+/* If ON, CPU will call the output reset callback when it encounters a reset\r
+ * instruction.\r
+ */\r
+#define M68K_EMULATE_RESET          OPT_OFF\r
+#define M68K_RESET_CALLBACK()       your_reset_handler_function()\r
+\r
+\r
+/* If ON, CPU will call the callback when it encounters a cmpi.l #v, dn\r
+ * instruction.\r
+ */\r
+#define M68K_CMPILD_HAS_CALLBACK     OPT_OFF\r
+#define M68K_CMPILD_CALLBACK(v,r)    your_cmpild_handler_function(v,r)\r
+\r
+\r
+/* If ON, CPU will call the callback when it encounters a rte\r
+ * instruction.\r
+ */\r
+#define M68K_RTE_HAS_CALLBACK       OPT_OFF\r
+#define M68K_RTE_CALLBACK()         your_rte_handler_function()\r
+\r
+\r
+/* If ON, CPU will call the set fc callback on every memory access to\r
+ * differentiate between user/supervisor, program/data access like a real\r
+ * 68000 would.  This should be enabled and the callback should be set if you\r
+ * want to properly emulate the m68010 or higher. (moves uses function codes\r
+ * to read/write data from different address spaces)\r
+ */\r
+#define M68K_EMULATE_FC             OPT_OFF\r
+#define M68K_SET_FC_CALLBACK(A)     your_set_fc_handler_function(A)\r
+\r
+\r
+/* If ON, CPU will call the pc changed callback when it changes the PC by a\r
+ * large value.  This allows host programs to be nicer when it comes to\r
+ * fetching immediate data and instructions on a banked memory system.\r
+ */\r
+#define M68K_MONITOR_PC             OPT_OFF\r
+#define M68K_SET_PC_CALLBACK(A)     your_pc_changed_handler_function(A)\r
+\r
+\r
+/* If ON, CPU will call the instruction hook callback before every\r
+ * instruction.\r
+ */\r
+#define M68K_INSTRUCTION_HOOK       OPT_OFF\r
+#define M68K_INSTRUCTION_CALLBACK() your_instruction_hook_function()\r
+\r
+\r
+/* If ON, the CPU will emulate the 4-byte prefetch queue of a real 68000 */\r
+#define M68K_EMULATE_PREFETCH       OPT_OFF\r
+\r
+\r
+/* If ON, the CPU will generate address error exceptions if it tries to\r
+ * access a word or longword at an odd address.\r
+ * NOTE: This is only emulated properly for 68000 mode.\r
+ */\r
+#define M68K_EMULATE_ADDRESS_ERROR  OPT_OFF\r
+\r
+\r
+/* Turn ON to enable logging of illegal instruction calls.\r
+ * M68K_LOG_FILEHANDLE must be #defined to a stdio file stream.\r
+ * Turn on M68K_LOG_1010_1111 to log all 1010 and 1111 calls.\r
+ */\r
+#define M68K_LOG_ENABLE             OPT_OFF\r
+#define M68K_LOG_1010_1111          OPT_OFF\r
+#define M68K_LOG_FILEHANDLE         some_file_handle\r
+\r
+\r
+/* ----------------------------- COMPATIBILITY ---------------------------- */\r
+\r
+/* The following options set optimizations that violate the current ANSI\r
+ * standard, but will be compliant under the forthcoming C9X standard.\r
+ */\r
+\r
+\r
+/* If ON, the enulation core will use 64-bit integers to speed up some\r
+ * operations.\r
+*/\r
+#define M68K_USE_64_BIT  OPT_OFF\r
+\r
+\r
+/* Set to your compiler's static inline keyword to enable it, or\r
+ * set it to blank to disable it.\r
+ * If you define INLINE in the makefile, it will override this value.\r
+ * NOTE: not enabling inline functions will SEVERELY slow down emulation.\r
+ */\r
+#ifndef INLINE\r
+#define INLINE static __inline\r
+#endif /* INLINE */\r
+\r
+#endif /* M68K_COMPILE_FOR_MAME */\r
+\r
+\r
+/* ======================================================================== */\r
+/* ============================== END OF FILE ============================= */\r
+/* ======================================================================== */\r
+\r
+#endif /* M68KCONF__HEADER */\r