/* Handles all immediate reads, does address error check, function code setting,
* and prefetching if they are enabled in m68kconf.h
*/
-uint m68ki_read_imm6_addr_slowpath(uint32_t address, address_translation_cache *cache);
+uint m68ki_read_imm6_addr_slowpath(uint32_t pc, address_translation_cache *cache);
static inline uint m68ki_read_imm_16(void)
{
- uint32_t address = ADDRESS_68K(REG_PC);
+ uint32_t pc = REG_PC;
address_translation_cache *cache = &code_translation_cache;
- if(address >= cache->lower && address < cache->upper)
+ if(pc >= cache->lower && pc < cache->upper)
{
REG_PC += 2;
- return be16toh(((unsigned short *)(cache->data + (address - cache->lower)))[0]);
+ return be16toh(((unsigned short *)(cache->data + (pc - cache->lower)))[0]);
}
- return m68ki_read_imm6_addr_slowpath(address, cache);
+ return m68ki_read_imm6_addr_slowpath(pc, cache);
}
-
static inline uint m68ki_read_imm_8(void)
{
/* map read immediate 8 to read immediate 16 */
return temp_val;
#else
- 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) */
- uint32_t address = ADDRESS_68K(REG_PC);
REG_PC += 4;
- 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]);
- }
- }
return m68k_read_immediate_32(address);
#endif /* M68K_EMULATE_PREFETCH */