/* If ON, the CPU will emulate the 4-byte prefetch queue of a real 68000 */
-#define M68K_EMULATE_PREFETCH OPT_OFF
+#define M68K_EMULATE_PREFETCH OPT_ON
/* If ON, the CPU will generate address error exceptions if it tries to
/* Main loop. Keep going until we run out of clock cycles */
do
{
+#ifdef M68K_BUSERR_THING
int i;
+#endif
/* Set tracing accodring to T1. (T0 is done inside instruction) */
m68ki_trace_t1(); /* auto-disable (see m68kcpu.h) */
/* Read data immediately following the PC */
inline unsigned int m68k_read_immediate_16(unsigned int address) {
+#ifndef M68K_EMULATE_PREFETCH
+ for (int i = 0; i < read_ranges; i++) {
+ if(address >= read_addr[i] && address < read_upper[i]) {
+ return be16toh(((unsigned short *)(read_data[i] + (address - read_addr[i])))[0]);
+ }
+ }
+#endif
+
return m68k_read_memory_16(address);
}
inline unsigned int m68k_read_immediate_32(unsigned int address) {
+#ifndef M68K_EMULATE_PREFETCH
+ for (int i = 0; i < read_ranges; i++) {
+ if(address >= read_addr[i] && address < read_upper[i]) {
+ return be32toh(((unsigned int *)(read_data[i] + (address - read_addr[i])))[0]);
+ }
+ }
+#endif
+
return m68k_read_memory_32(address);
}
#if M68K_EMULATE_PREFETCH
uint temp_val;
- uint32_t address = ADDRESS_68K(CPU_PREF_ADDR);
m68ki_set_fc(FLAG_S | FUNCTION_CODE_USER_PROGRAM); /* auto-disable (see m68kcpu.h) */
m68ki_check_address_error(REG_PC, MODE_READ, FLAG_S | FUNCTION_CODE_USER_PROGRAM); /* auto-disable (see m68kcpu.h) */