Skip to content

Commit

Permalink
NES: Fixed crash when loading mapper 91 games
Browse files Browse the repository at this point in the history
  • Loading branch information
SourMesen committed Nov 2, 2023
1 parent 9492741 commit 1a5cadb
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Core/NES/Mappers/Nintendo/MMC3.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
class MMC3 : public BaseMapper
{
private:
NesCpu* _cpu = nullptr;

uint8_t _currentRegister = 0;

bool _wramEnabled = false;
Expand Down Expand Up @@ -195,8 +193,6 @@ class MMC3 : public BaseMapper

void InitMapper() override
{
_cpu = _console->GetCpu();

//Force MMC3A irqs for boards that are known to use the A revision.
//Some MMC3B boards also have the A behavior, but currently no way to tell them apart.
_forceMmc3RevAIrqs = _romInfo.DatabaseInfo.Chip.substr(0, 5).compare("MMC3A") == 0;
Expand Down Expand Up @@ -245,7 +241,7 @@ class MMC3 : public BaseMapper

case 0xE000:
_irqEnabled = false;
_cpu->ClearIrqSource(IRQSource::External);
_console->GetCpu()->ClearIrqSource(IRQSource::External);
break;

case 0xE001:
Expand All @@ -256,7 +252,7 @@ class MMC3 : public BaseMapper

virtual void TriggerIrq()
{
_cpu->SetIrqSource(IRQSource::External);
_console->GetCpu()->SetIrqSource(IRQSource::External);
}

vector<MapperStateEntry> GetMapperStateEntries() override
Expand Down

0 comments on commit 1a5cadb

Please sign in to comment.