X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=m68kcpu.h;fp=m68kcpu.h;h=0be9551eb59f710ed440cd18cfbf22d80d99cd75;hb=83fa34909fc9212c461cba419159febcd22f95a9;hp=680aa714b3678b3c5c02a6b5576488b9a2971fa9;hpb=bf2bbbb7a3a84ad9f207cd9bcfc461e8ce7330b3;p=pistorm diff --git a/m68kcpu.h b/m68kcpu.h index 680aa71..0be9551 100644 --- a/m68kcpu.h +++ b/m68kcpu.h @@ -1154,6 +1154,14 @@ static inline uint32 m68ki_ic_readimm16(uint32 address) */ static inline uint m68ki_read_imm_16(void) { + uint32_t address = ADDRESS_68K(REG_PC); + for (int i = 0; i < read_ranges; i++) { + if(address >= read_addr[i] && address < read_upper[i]) { + REG_PC += 2; + return be16toh(((unsigned short *)(read_data[i] + (address - read_addr[i])))[0]); + } + } + m68ki_set_fc(FLAG_S | FUNCTION_CODE_USER_PROGRAM); /* auto-disable (see m68kcpu.h) */ m68ki_cpu.mmu_tmp_fc = FLAG_S | FUNCTION_CODE_USER_PROGRAM; m68ki_cpu.mmu_tmp_rw = 1; @@ -1208,6 +1216,13 @@ static inline uint m68ki_read_imm_32(void) // address = pmmu_translate_addr(address,1); #endif #endif + uint32_t address = ADDRESS_68K(REG_PC); + for (int i = 0; i < read_ranges; i++) { + if(address >= read_addr[i] && address < read_upper[i]) { + REG_PC += 4; + return be32toh(((unsigned int *)(read_data[i] + (address - read_addr[i])))[0]); + } + } #if M68K_EMULATE_PREFETCH uint temp_val;