mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-09-13 06:53:22 -06:00
fix possible crash in SD/MMC code
This commit is contained in:
@ -287,8 +287,10 @@ void DSi_SDHost::SetCardIRQ()
|
|||||||
u16 oldflags = CardIRQStatus & ~CardIRQMask;
|
u16 oldflags = CardIRQStatus & ~CardIRQMask;
|
||||||
DSi_SDDevice* dev = Ports[PortSelect & 0x1].get();
|
DSi_SDDevice* dev = Ports[PortSelect & 0x1].get();
|
||||||
|
|
||||||
if (dev->IRQ) CardIRQStatus |= (1<<0);
|
if (dev && dev->IRQ)
|
||||||
else CardIRQStatus &= ~(1<<0);
|
CardIRQStatus |= (1<<0);
|
||||||
|
else
|
||||||
|
CardIRQStatus &= ~(1<<0);
|
||||||
|
|
||||||
u16 newflags = CardIRQStatus & ~CardIRQMask;
|
u16 newflags = CardIRQStatus & ~CardIRQMask;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user