Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Core/NES/Mappers/Audio/Mmc5Audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ class Mmc5Audio : public BaseExpansionAudio
_pcmOutput = 0;
}

void PCMReadModeDataRead(char dacval) {
if(_pcmReadMode && dacval) {
_pcmOutput = dacval;
}
}

uint8_t ReadRegister(uint16_t addr)
{
switch(addr) {
Expand Down Expand Up @@ -139,7 +145,7 @@ class Mmc5Audio : public BaseExpansionAudio
break;

case 0x5010:
//TODO: Read mode & PCM IRQs are not implemented
//TODO: PCM IRQ
_pcmReadMode = (value & 0x01) == 0x01;
_pcmIrqEnabled = (value & 0x80) == 0x80;
break;
Expand Down
8 changes: 8 additions & 0 deletions Core/NES/Mappers/Nintendo/MMC5.h
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,14 @@ class MMC5 : public BaseMapper, public IExtModeMapperDebug
BaseMapper::WriteRam(addr, value);
}

uint8_t ReadRam(uint16_t addr) override
{
if((addr & 0xC000) == 0x8000) {
_audio->PCMReadModeDataRead(InternalReadRam(addr));
}
return BaseMapper::ReadRam(addr);
}

void DetectScanlineStart(uint16_t addr)
{
if(_ntReadCounter >= 2) {
Expand Down
Loading