Don't call addreadlookup() from get_phys() unless the address being translated is in RAM. Fixes Windows 95 install on Packard Bell PB410.
This commit is contained in:
parent
8cb5c5eff2
commit
16bc3bb6ec
2 changed files with 11 additions and 2 deletions
|
|
@ -54,6 +54,13 @@ uint32_t mem_logical_addr;
|
|||
int mmuflush=0;
|
||||
int mmu_perm=4;
|
||||
|
||||
int mem_addr_is_ram(uint32_t addr)
|
||||
{
|
||||
mem_mapping_t *mapping = read_mapping[addr >> 14];
|
||||
|
||||
return (mapping == &ram_low_mapping) || (mapping == &ram_high_mapping) || (mapping == &ram_mid_mapping) || (mapping == &ram_remapped_mapping);
|
||||
}
|
||||
|
||||
void resetreadlookup()
|
||||
{
|
||||
int c;
|
||||
|
|
|
|||
|
|
@ -153,6 +153,8 @@ static inline int page_in_evict_list(page_t *p)
|
|||
void page_remove_from_evict_list(page_t *p);
|
||||
void page_add_to_evict_list(page_t *p);
|
||||
|
||||
int mem_addr_is_ram(uint32_t addr);
|
||||
|
||||
uint32_t mmutranslate_noabrt(uint32_t addr, int rw);
|
||||
extern uint32_t get_phys_virt,get_phys_phys;
|
||||
static inline uint32_t get_phys(uint32_t addr)
|
||||
|
|
@ -173,7 +175,7 @@ static inline uint32_t get_phys(uint32_t addr)
|
|||
else
|
||||
{
|
||||
get_phys_phys = (mmutranslatereal(addr, 0) & rammask) & ~0xfff;
|
||||
if (!cpu_state.abrt)
|
||||
if (!cpu_state.abrt && mem_addr_is_ram(get_phys_phys))
|
||||
addreadlookup(get_phys_virt, get_phys_phys);
|
||||
}
|
||||
|
||||
|
|
@ -192,7 +194,7 @@ static inline uint32_t get_phys_noabrt(uint32_t addr)
|
|||
return ((uintptr_t)readlookup2[addr >> 12] + addr) - (uintptr_t)ram;
|
||||
|
||||
phys_addr = mmutranslate_noabrt(addr, 0) & rammask;
|
||||
if (phys_addr != 0xffffffff)
|
||||
if (phys_addr != 0xffffffff && mem_addr_is_ram(phys_addr))
|
||||
addreadlookup(addr, phys_addr);
|
||||
|
||||
return phys_addr;
|
||||
|
|
|
|||
Loading…
Reference in a new issue