From f05af652cfa21b17092b0567e55ced93f756fd1d Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Wed, 13 Mar 2019 17:24:27 +0100 Subject: [PATCH] crash when reading a write-only register --- core/hw/holly/sb.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/hw/holly/sb.cpp b/core/hw/holly/sb.cpp index 7c44ffba8..d67728e31 100644 --- a/core/hw/holly/sb.cpp +++ b/core/hw/holly/sb.cpp @@ -43,7 +43,7 @@ u32 sb_ReadMem(u32 addr,u32 sz) if (sb_regs[offset].flags & sz) { #endif - if (!(sb_regs[offset].flags & REG_RF) ) + if (!(sb_regs[offset].flags & (REG_RF|REG_WO))) { if (sz==4) return sb_regs[offset].data32; @@ -55,7 +55,7 @@ u32 sb_ReadMem(u32 addr,u32 sz) else { //printf("SB: %08X\n",addr); - if (sb_regs[offset].readFunctionAddr == NULL) + if ((sb_regs[offset].flags & REG_WO) || sb_regs[offset].readFunctionAddr == NULL) { EMUERROR("sb_ReadMem write-only reg %08x %d\n", addr, sz); return 0;