Skip to content

Commit

Permalink
md: Fix new emulator hang/crash in SRB2 32X port
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeUsher committed Feb 7, 2025
1 parent 7f625b6 commit 976b982
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ares/md/m32x/bus-internal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ auto M32X::readInternal(n1 upper, n1 lower, n32 address, n16 data) -> n16 {

if(address >= 0x0200'0000 && address <= 0x03ff'ffff) {
while(dreq.vram) {
// SH2 ROM accesses stall while RV is set
//SH2 ROM accesses stall while RV is set
if(shm.active()) { shm.internalStep(1); shm.syncM68k(true); }
if(shs.active()) { shs.internalStep(1); shs.syncM68k(true); }
}

// TODO: SH2 ROM accesses need to stall while the m68k is on the bus
//TODO: SH2 ROM accesses need to stall while the m68k is on the bus
if(shm.active()) shm.internalStep(6); if(shs.active()) shs.internalStep(6);
return cartridge.child->read(upper, lower, address, data);
}
Expand Down
8 changes: 4 additions & 4 deletions ares/md/m32x/io-internal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ auto M32X::readInternalIO(n1 upper, n1 lower, n29 address, n16 data) -> n16 {
if(address >= 0x4200 && address <= 0x43ff) {
if(!vdp.framebufferAccess) return data;
while(vdp.paletteEngaged()) {
if(shm.active()) { shm.internalStep(1); shm.syncAll(); }
if(shs.active()) { shs.internalStep(1); shs.syncAll(); }
if(shm.active()) { shm.internalStep(1); shm.syncAll(true); }
if(shs.active()) { shs.internalStep(1); shs.syncAll(true); }
}
if(shm.active()) shm.internalStep(4); if(shs.active()) shs.internalStep(4);
data = vdp.cram[address >> 1 & 0xff];
Expand Down Expand Up @@ -347,8 +347,8 @@ auto M32X::writeInternalIO(n1 upper, n1 lower, n29 address, n16 data) -> void {
if(address >= 0x4200 && address <= 0x43ff) {
if(!vdp.framebufferAccess) return;
while(vdp.paletteEngaged()) {
if(shm.active()) { shm.internalStep(1); shm.syncAll(); }
if(shs.active()) { shs.internalStep(1); shs.syncAll(); }
if(shm.active()) { shm.internalStep(1); shm.syncAll(true); }
if(shs.active()) { shs.internalStep(1); shs.syncAll(true); }
}
if(shm.active()) shm.internalStep(4); if(shs.active()) shs.internalStep(4);
if(upper) vdp.cram[address >> 1 & 0xff].byte(1) = data.byte(1);
Expand Down

0 comments on commit 976b982

Please sign in to comment.