src/musashi/m68kconf.h

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