Skip to content

Commit

Permalink
naomi: increase dma xfer rate except for force five
Browse files Browse the repository at this point in the history
Revert 54ac9c6 but make an exception
for force five. Issue #141
Fixes loud music in beach spikers and soul surfers. Issue #1513
Fixes some menu textures not being loaded in F355.
  • Loading branch information
flyinghead committed Oct 5, 2024
1 parent 5d719e0 commit d689c50
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
13 changes: 11 additions & 2 deletions core/hw/naomi/naomi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ static X76F100SerialFlash mainSerialId;
static X76F100SerialFlash romSerialId;

static int dmaSchedId = -1;
static int dmaXferDelay = 10; // cart dma xfer speed, in cycles/byte (default 20 MB/s)

void NaomiBoardIDWrite(const u16 data)
{
Expand Down Expand Up @@ -162,8 +163,8 @@ static void Naomi_DmaStart(u32 addr, u32 data)
SB_GDLEND = 0;
// Max G1 bus rate: 50 MHz x 16 bits
// SH4_access990312_e.xls: 14.4 MB/s from GD-ROM to system RAM
// Here: 7 MB/s
sh4_sched_request(dmaSchedId, std::min<int>(SB_GDLEN * 27, SH4_MAIN_CLOCK));
// Here: 20 MB/s
sh4_sched_request(dmaSchedId, std::min<int>(SB_GDLEN * dmaXferDelay, SH4_MAIN_CLOCK));
return;
}
else
Expand All @@ -174,6 +175,14 @@ static void Naomi_DmaStart(u32 addr, u32 data)
asic_RaiseInterrupt(holly_GDROM_DMA);
}

void Naomi_setDmaDelay()
{
if (settings.content.gameId == "FORCE FIVE")
// 7 MB/s
dmaXferDelay = 27;
else
dmaXferDelay = 10;
}

static void Naomi_DmaEnable(u32 addr, u32 data)
{
Expand Down
1 change: 1 addition & 0 deletions core/hw/naomi/naomi.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ void NaomiGameIDWrite(u16 data);
void setGameSerialId(const u8 *data);

void initDriveSimSerialPipe();
void Naomi_setDmaDelay();

namespace midiffb {

Expand Down
1 change: 1 addition & 0 deletions core/hw/naomi/naomi_cart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ void naomi_cart_LoadRom(const std::string& path, const std::string& fileName, Lo
{
hopper::init();
}
Naomi_setDmaDelay();

#ifdef NAOMI_MULTIBOARD
// Not a multiboard game but needs the same desktop environment
Expand Down

0 comments on commit d689c50

Please sign in to comment.