Update m68kconf.h, m68kcpu.c, and m68kcpu.h

This commit is contained in:
beeanyew
2021-02-20 08:33:40 +01:00
parent c7f54bc071
commit 902f4c4aa8
3 changed files with 19 additions and 2 deletions

View File

@@ -166,7 +166,7 @@
/* 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

View File

@@ -976,7 +976,9 @@ int m68k_execute(int num_cycles)
/* 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) */
@@ -1175,9 +1177,25 @@ void m68k_set_context(void* src)
/* 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);
}

View File

@@ -1107,7 +1107,6 @@ static inline uint m68ki_read_imm_32(void)
#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) */