From 44c2a8c2438bddc8d5e82fcb269ed019e62d1cc4 Mon Sep 17 00:00:00 2001 From: SuuperW Date: Mon, 30 Sep 2019 11:38:24 -0500 Subject: [PATCH] bug fix --- desmume/src/NDSSystem.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index af04a922a..92799baf9 100755 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -582,7 +582,9 @@ bool GameInfo::loadROM(u8* file, s32 fileSize) closeROM(); // create memory stream - reader = MemROMReaderRead_TrueInit(file, fileSize); + romdataForReader = new u8[fileSize]; + memcpy(romdataForReader, file, fileSize); + reader = MemROMReaderRead_TrueInit(romdataForReader, fileSize); fROM = reader->Init(NULL); headerOffset = 0;