Skip to content

Commit 1a5cadb

Browse files
committed
NES: Fixed crash when loading mapper 91 games
1 parent 9492741 commit 1a5cadb

File tree

1 file changed

+2
-6
lines changed
  • Core/NES/Mappers/Nintendo

1 file changed

+2
-6
lines changed

Core/NES/Mappers/Nintendo/MMC3.h

+2-6
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
class MMC3 : public BaseMapper
1111
{
1212
private:
13-
NesCpu* _cpu = nullptr;
14-
1513
uint8_t _currentRegister = 0;
1614

1715
bool _wramEnabled = false;
@@ -195,8 +193,6 @@ class MMC3 : public BaseMapper
195193

196194
void InitMapper() override
197195
{
198-
_cpu = _console->GetCpu();
199-
200196
//Force MMC3A irqs for boards that are known to use the A revision.
201197
//Some MMC3B boards also have the A behavior, but currently no way to tell them apart.
202198
_forceMmc3RevAIrqs = _romInfo.DatabaseInfo.Chip.substr(0, 5).compare("MMC3A") == 0;
@@ -245,7 +241,7 @@ class MMC3 : public BaseMapper
245241

246242
case 0xE000:
247243
_irqEnabled = false;
248-
_cpu->ClearIrqSource(IRQSource::External);
244+
_console->GetCpu()->ClearIrqSource(IRQSource::External);
249245
break;
250246

251247
case 0xE001:
@@ -256,7 +252,7 @@ class MMC3 : public BaseMapper
256252

257253
virtual void TriggerIrq()
258254
{
259-
_cpu->SetIrqSource(IRQSource::External);
255+
_console->GetCpu()->SetIrqSource(IRQSource::External);
260256
}
261257

262258
vector<MapperStateEntry> GetMapperStateEntries() override

0 commit comments

Comments
 (0)