mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-01-10 13:29:56 +00:00
Custom ROM: minor refactor
This commit is contained in:
parent
3659603228
commit
ec8e758c79
@ -1651,20 +1651,13 @@ void MemInitializeCustomROM(void)
|
|||||||
if (g_hCustomRom == INVALID_HANDLE_VALUE)
|
if (g_hCustomRom == INVALID_HANDLE_VALUE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::vector<BYTE> oldRom;
|
|
||||||
oldRom.resize(Apple2RomSize);
|
|
||||||
memcpy(&oldRom[0], memrom, Apple2RomSize);
|
|
||||||
|
|
||||||
std::vector<BYTE> oldRomC0;
|
|
||||||
oldRomC0.resize(CxRomSize);
|
|
||||||
memcpy(&oldRomC0[0], pCxRomInternal, CxRomSize);
|
|
||||||
|
|
||||||
SetFilePointer(g_hCustomRom, 0, NULL, FILE_BEGIN);
|
SetFilePointer(g_hCustomRom, 0, NULL, FILE_BEGIN);
|
||||||
DWORD uNumBytesRead;
|
DWORD uNumBytesRead;
|
||||||
BOOL bRes = TRUE;
|
BOOL bRes = TRUE;
|
||||||
|
|
||||||
if (GetFileSize(g_hCustomRom, NULL) == Apple2eRomSize)
|
if (GetFileSize(g_hCustomRom, NULL) == Apple2eRomSize)
|
||||||
{
|
{
|
||||||
|
std::vector<BYTE> oldRomC0(pCxRomInternal, pCxRomInternal+CxRomSize); // range ctor: [first,last)
|
||||||
bRes = ReadFile(g_hCustomRom, pCxRomInternal, CxRomSize, &uNumBytesRead, NULL);
|
bRes = ReadFile(g_hCustomRom, pCxRomInternal, CxRomSize, &uNumBytesRead, NULL);
|
||||||
if (uNumBytesRead != CxRomSize)
|
if (uNumBytesRead != CxRomSize)
|
||||||
{
|
{
|
||||||
@ -1675,6 +1668,7 @@ void MemInitializeCustomROM(void)
|
|||||||
|
|
||||||
if (bRes)
|
if (bRes)
|
||||||
{
|
{
|
||||||
|
std::vector<BYTE> oldRom(memrom, memrom+Apple2RomSize); // range ctor: [first,last)
|
||||||
bRes = ReadFile(g_hCustomRom, memrom, Apple2RomSize, &uNumBytesRead, NULL);
|
bRes = ReadFile(g_hCustomRom, memrom, Apple2RomSize, &uNumBytesRead, NULL);
|
||||||
if (uNumBytesRead != Apple2RomSize)
|
if (uNumBytesRead != Apple2RomSize)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user