1.1 diff -r 000000000000 -r 8bf1bf91a36d src/musashi/m68kconf.h 1.2 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.3 +++ b/src/musashi/m68kconf.h Sat Nov 27 01:13:12 2010 +0000 1.4 @@ -0,0 +1,183 @@ 1.5 +/* ======================================================================== */ 1.6 +/* ========================= LICENSING & COPYRIGHT ======================== */ 1.7 +/* ======================================================================== */ 1.8 +/* 1.9 + * MUSASHI 1.10 + * Version 3.3 1.11 + * 1.12 + * A portable Motorola M680x0 processor emulation engine. 1.13 + * Copyright 1998-2001 Karl Stenerud. All rights reserved. 1.14 + * 1.15 + * This code may be freely used for non-commercial purposes as long as this 1.16 + * copyright notice remains unaltered in the source code and any binary files 1.17 + * containing this code in compiled form. 1.18 + * 1.19 + * All other lisencing terms must be negotiated with the author 1.20 + * (Karl Stenerud). 1.21 + * 1.22 + * The latest version of this code can be obtained at: 1.23 + * http://kstenerud.cjb.net 1.24 + */ 1.25 + 1.26 + 1.27 + 1.28 +#ifndef M68KCONF__HEADER 1.29 +#define M68KCONF__HEADER 1.30 + 1.31 + 1.32 +/* Configuration switches. 1.33 + * Use OPT_SPECIFY_HANDLER for configuration options that allow callbacks. 1.34 + * OPT_SPECIFY_HANDLER causes the core to link directly to the function 1.35 + * or macro you specify, rather than using callback functions whose pointer 1.36 + * must be passed in using m68k_set_xxx_callback(). 1.37 + */ 1.38 +#define OPT_OFF 0 1.39 +#define OPT_ON 1 1.40 +#define OPT_SPECIFY_HANDLER 2 1.41 + 1.42 + 1.43 +/* ======================================================================== */ 1.44 +/* ============================== MAME STUFF ============================== */ 1.45 +/* ======================================================================== */ 1.46 + 1.47 +/* If you're compiling this for MAME, only change M68K_COMPILE_FOR_MAME 1.48 + * to OPT_ON and use m68kmame.h to configure the 68k core. 1.49 + */ 1.50 +#ifndef M68K_COMPILE_FOR_MAME 1.51 +#define M68K_COMPILE_FOR_MAME OPT_OFF 1.52 +#endif /* M68K_COMPILE_FOR_MAME */ 1.53 + 1.54 +#if M68K_COMPILE_FOR_MAME == OPT_ON 1.55 +#include "m68kmame.h" 1.56 +#else 1.57 + 1.58 + 1.59 + 1.60 +/* ======================================================================== */ 1.61 +/* ============================= CONFIGURATION ============================ */ 1.62 +/* ======================================================================== */ 1.63 + 1.64 +/* Turn on if you want to use the following M68K variants */ 1.65 +#define M68K_EMULATE_010 OPT_ON 1.66 +#define M68K_EMULATE_EC020 OPT_ON 1.67 +#define M68K_EMULATE_020 OPT_ON 1.68 + 1.69 + 1.70 +/* If on, the CPU will call m68k_read_immediate_xx() for immediate addressing 1.71 + * and m68k_read_pcrelative_xx() for PC-relative addressing. 1.72 + * If off, all read requests from the CPU will be redirected to m68k_read_xx() 1.73 + */ 1.74 +#define M68K_SEPARATE_READS OPT_OFF 1.75 + 1.76 + 1.77 +/* If on, CPU will call the interrupt acknowledge callback when it services an 1.78 + * interrupt. 1.79 + * If off, all interrupts will be autovectored and all interrupt requests will 1.80 + * auto-clear when the interrupt is serviced. 1.81 + */ 1.82 +#define M68K_EMULATE_INT_ACK OPT_OFF 1.83 +#define M68K_INT_ACK_CALLBACK(A) your_int_ack_handler_function(A) 1.84 + 1.85 + 1.86 +/* If on, CPU will call the breakpoint acknowledge callback when it encounters 1.87 + * a breakpoint instruction and it is running a 68010+. 1.88 + */ 1.89 +#define M68K_EMULATE_BKPT_ACK OPT_OFF 1.90 +#define M68K_BKPT_ACK_CALLBACK() your_bkpt_ack_handler_function() 1.91 + 1.92 + 1.93 +/* If on, the CPU will monitor the trace flags and take trace exceptions 1.94 + */ 1.95 +#define M68K_EMULATE_TRACE OPT_OFF 1.96 + 1.97 + 1.98 +/* If on, CPU will call the output reset callback when it encounters a reset 1.99 + * instruction. 1.100 + */ 1.101 +#define M68K_EMULATE_RESET OPT_OFF 1.102 +#define M68K_RESET_CALLBACK() your_reset_handler_function() 1.103 + 1.104 + 1.105 +/* If on, CPU will call the set fc callback on every memory access to 1.106 + * differentiate between user/supervisor, program/data access like a real 1.107 + * 68000 would. This should be enabled and the callback should be set if you 1.108 + * want to properly emulate the m68010 or higher. (moves uses function codes 1.109 + * to read/write data from different address spaces) 1.110 + */ 1.111 +#define M68K_EMULATE_FC OPT_OFF 1.112 +#define M68K_SET_FC_CALLBACK(A) your_set_fc_handler_function(A) 1.113 + 1.114 + 1.115 +/* If on, CPU will call the pc changed callback when it changes the PC by a 1.116 + * large value. This allows host programs to be nicer when it comes to 1.117 + * fetching immediate data and instructions on a banked memory system. 1.118 + */ 1.119 +#define M68K_MONITOR_PC OPT_OFF 1.120 +#define M68K_SET_PC_CALLBACK(A) your_pc_changed_handler_function(A) 1.121 + 1.122 + 1.123 +/* If on, CPU will call the instruction hook callback before every 1.124 + * instruction. 1.125 + */ 1.126 +#define M68K_INSTRUCTION_HOOK OPT_OFF 1.127 +#define M68K_INSTRUCTION_CALLBACK() your_instruction_hook_function() 1.128 + 1.129 + 1.130 +/* If on, the CPU will emulate the 4-byte prefetch queue of a real 68000 */ 1.131 +#define M68K_EMULATE_PREFETCH OPT_OFF 1.132 + 1.133 + 1.134 +/* If on, the CPU will generate address error exceptions if it tries to 1.135 + * access a word or longword at an odd address. 1.136 + * NOTE: Do not enable this! It is not working! 1.137 + */ 1.138 +#define M68K_EMULATE_ADDRESS_ERROR OPT_OFF 1.139 + 1.140 + 1.141 +/* Turn on to enable logging of illegal instruction calls. 1.142 + * M68K_LOG_FILEHANDLE must be #defined to a stdio file stream. 1.143 + * Turn on M68K_LOG_1010_1111 to log all 1010 and 1111 calls. 1.144 + */ 1.145 +#define M68K_LOG_ENABLE OPT_OFF 1.146 +#define M68K_LOG_1010_1111 OPT_OFF 1.147 +#define M68K_LOG_FILEHANDLE some_file_handle 1.148 + 1.149 + 1.150 +/* ----------------------------- COMPATIBILITY ---------------------------- */ 1.151 + 1.152 +/* The following options set optimizations that violate the current ANSI 1.153 + * standard, but will be compliant under the forthcoming C9X standard. 1.154 + */ 1.155 + 1.156 + 1.157 +/* If on, the enulation core will use 64-bit integers to speed up some 1.158 + * operations. 1.159 +*/ 1.160 +#define M68K_USE_64_BIT OPT_OFF 1.161 + 1.162 + 1.163 +/* Set to your compiler's static inline keyword to enable it, or 1.164 + * set it to blank to disable it. 1.165 + * If you define INLINE in the makefile, it will override this value. 1.166 + * NOTE: not enabling inline functions will SEVERELY slow down emulation. 1.167 + */ 1.168 +#ifndef INLINE 1.169 +#define INLINE static __inline__ 1.170 +#endif /* INLINE */ 1.171 + 1.172 + 1.173 +/* If your environment requires special prefixes for system callback functions 1.174 + * such as the argument to qsort(), then set them here or in the makefile. 1.175 + */ 1.176 +#ifndef DECL_SPEC 1.177 +#define DECL_SPEC 1.178 +#endif 1.179 + 1.180 +#endif /* M68K_COMPILE_FOR_MAME */ 1.181 + 1.182 + 1.183 +/* ======================================================================== */ 1.184 +/* ============================== END OF FILE ============================= */ 1.185 +/* ======================================================================== */ 1.186 + 1.187 +#endif /* M68KCONF__HEADER */