Skip to content
Open
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
7 changes: 6 additions & 1 deletion Core/NES/Mappers/Audio/Mmc5Audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ 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 +144,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
6 changes: 3 additions & 3 deletions Core/NES/Mappers/Unlicensed/Nina01.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ class Nina01 : public BaseMapper
void WriteRegister(uint16_t addr, uint8_t value) override
{
switch(addr) {
case 0x7FFD: SelectPrgPage(0, value & 0x01); break;
case 0x7FFE: SelectChrPage(0, value & 0x0F); break;
case 0x7FFF: SelectChrPage(1, value & 0x0F); break;
case 0x7FFD: SelectPrgPage(0, value); break;
case 0x7FFE: SelectChrPage(0, value); break;
case 0x7FFF: SelectChrPage(1, value); break;
}

WritePrgRam(addr, value);
Expand Down
Loading