mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-23 06:10:03 -06:00
fix bugs
This commit is contained in:
@ -365,12 +365,7 @@ void Write_Flash(u8 val, bool islast)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// CHECKME: does Flash also wraparound when the address is out of bounds?
|
Data = SRAM[Addr & (SRAMLength-1)];
|
||||||
if (Addr >= SRAMLength)
|
|
||||||
Data = 0;
|
|
||||||
else
|
|
||||||
Data = SRAM[Addr];
|
|
||||||
|
|
||||||
Addr++;
|
Addr++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -384,9 +379,7 @@ void Write_Flash(u8 val, bool islast)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (Addr < SRAMLength)
|
SRAM[Addr & (SRAMLength-1)] = val;
|
||||||
SRAM[Addr] = val;
|
|
||||||
|
|
||||||
Addr++;
|
Addr++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -454,7 +447,7 @@ void Write(u8 val, u32 hold)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (islast && (CurCmd == 0x02 || CurCmd == 0x0A))
|
if (islast && (CurCmd == 0x02 || CurCmd == 0x0A) && (SRAMLength > 0))
|
||||||
{
|
{
|
||||||
FILE* f = fopen(SRAMPath, "wb");
|
FILE* f = fopen(SRAMPath, "wb");
|
||||||
if (f)
|
if (f)
|
||||||
|
Reference in New Issue
Block a user