Skip to content

Commit

Permalink
gdrom: increase dma delay for small DMA transfers
Browse files Browse the repository at this point in the history
Fixes WSB 2K2 freezes.
Issue #1038
  • Loading branch information
flyinghead committed Jan 31, 2025
1 parent c143cae commit 914fa29
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/hw/gdrom/gdromv3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1209,9 +1209,12 @@ static int getGDROMTicks()
return 512;
u32 len = SB_GDLEN == 0 ? 0x02000000 : SB_GDLEN;
if (len - SB_GDLEND > 10240)
return 1100000; // Large transfers: GD-ROM transfer rate 1.8 MB/s
// Large transfers: GD-ROM transfer rate 1.8 MB/s
return sh4CyclesForXfer(10240, 1'800'000);
else
return std::min((u32)10240, len - SB_GDLEND) * 2; // Small transfers: Max G1 bus rate: 50 MHz x 16 bits
// Small transfers: Max G1 bus rate: 50 MHz x 16 bits
// ...slowed down to 25 MB/s for wsb2k2
return sh4CyclesForXfer(std::min<u32>(10240, len - SB_GDLEND), 25'000'000);
}
else
return 0;
Expand Down

0 comments on commit 914fa29

Please sign in to comment.