From ec8e758c7951e6993bc831f38606ea4021999d21 Mon Sep 17 00:00:00 2001 From: tomcw Date: Thu, 26 Mar 2020 22:16:00 +0000 Subject: [PATCH] Custom ROM: minor refactor --- source/Memory.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/source/Memory.cpp b/source/Memory.cpp index aad2aafa..586db799 100644 --- a/source/Memory.cpp +++ b/source/Memory.cpp @@ -1651,20 +1651,13 @@ void MemInitializeCustomROM(void) if (g_hCustomRom == INVALID_HANDLE_VALUE) return; - std::vector oldRom; - oldRom.resize(Apple2RomSize); - memcpy(&oldRom[0], memrom, Apple2RomSize); - - std::vector oldRomC0; - oldRomC0.resize(CxRomSize); - memcpy(&oldRomC0[0], pCxRomInternal, CxRomSize); - SetFilePointer(g_hCustomRom, 0, NULL, FILE_BEGIN); DWORD uNumBytesRead; BOOL bRes = TRUE; if (GetFileSize(g_hCustomRom, NULL) == Apple2eRomSize) { + std::vector oldRomC0(pCxRomInternal, pCxRomInternal+CxRomSize); // range ctor: [first,last) bRes = ReadFile(g_hCustomRom, pCxRomInternal, CxRomSize, &uNumBytesRead, NULL); if (uNumBytesRead != CxRomSize) { @@ -1675,6 +1668,7 @@ void MemInitializeCustomROM(void) if (bRes) { + std::vector oldRom(memrom, memrom+Apple2RomSize); // range ctor: [first,last) bRes = ReadFile(g_hCustomRom, memrom, Apple2RomSize, &uNumBytesRead, NULL); if (uNumBytesRead != Apple2RomSize) {