holly: crash when reading a write-only register
This commit is contained in:
parent
cdca559d99
commit
a0a9b5bbc5
|
@ -180,6 +180,10 @@ u32 sb_ReadMem(u32 addr)
|
||||||
|
|
||||||
if (!(sb_regs[offset].flags & REG_RF))
|
if (!(sb_regs[offset].flags & REG_RF))
|
||||||
rv = sb_regs[offset].data32;
|
rv = sb_regs[offset].data32;
|
||||||
|
else if (sb_regs[offset].flags & REG_WO) {
|
||||||
|
INFO_LOG(HOLLY, "sb_ReadMem write-only reg %s", regName(addr));
|
||||||
|
rv = 0;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
rv = sb_regs[offset].readFunctionAddr(addr);
|
rv = sb_regs[offset].readFunctionAddr(addr);
|
||||||
|
|
||||||
|
@ -248,7 +252,7 @@ void sb_rio_register(u32 reg_addr, RegIO flags, RegReadAddrFP* rf, RegWriteAddrF
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (flags & REG_RF)
|
if ((flags & REG_RF) && !(flags & REG_WO))
|
||||||
sb_regs[idx].readFunctionAddr = rf;
|
sb_regs[idx].readFunctionAddr = rf;
|
||||||
else
|
else
|
||||||
sb_regs[idx].data32 = 0;
|
sb_regs[idx].data32 = 0;
|
||||||
|
|
Loading…
Reference in New Issue