mirror of https://github.com/Washi1337/Emux.git
Fixed exception being thrown when resizing external memory smaller
This commit is contained in:
parent
21fb6e3261
commit
5fce5f11cb
|
@ -45,7 +45,7 @@ namespace Emux.GameBoy.Cartridge
|
|||
{
|
||||
var backup = _externalMemory;
|
||||
_externalMemory = new byte[length];
|
||||
Array.Copy(backup, _externalMemory, length);
|
||||
Array.Copy(backup, _externalMemory, Math.Min(backup.Length, length));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue