mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-06-08 01:29:42 +00:00
Rename var
This commit is contained in:
parent
2d9f89f28c
commit
9bd1b0832d
|
@ -1543,7 +1543,7 @@ static LPBYTE AllocMemImage(void)
|
||||||
LPBYTE baseAddr = NULL;
|
LPBYTE baseAddr = NULL;
|
||||||
|
|
||||||
// Allocate memory for 'memimage' (and the alias 'mem')
|
// Allocate memory for 'memimage' (and the alias 'mem')
|
||||||
// . Setup so we have 2 consecutive virtual 64K pages pointing to the same physical 64K page.
|
// . Setup so we have 2 consecutive virtual 64K regions pointing to the same physical 64K region.
|
||||||
// . This is a fix (and optimisation) for 6502 opcodes that do a 16-bit read at 6502 address $FFFF. (GH#1285)
|
// . This is a fix (and optimisation) for 6502 opcodes that do a 16-bit read at 6502 address $FFFF. (GH#1285)
|
||||||
SYSTEM_INFO info;
|
SYSTEM_INFO info;
|
||||||
GetSystemInfo(&info);
|
GetSystemInfo(&info);
|
||||||
|
@ -1552,8 +1552,8 @@ static LPBYTE AllocMemImage(void)
|
||||||
if (res)
|
if (res)
|
||||||
{
|
{
|
||||||
res = false;
|
res = false;
|
||||||
const UINT num64KPages = 2;
|
const UINT num64KRegions = 2;
|
||||||
const SIZE_T totalVirtualSize = _6502_MEM_LEN * num64KPages;
|
const SIZE_T totalVirtualSize = _6502_MEM_LEN * num64KRegions;
|
||||||
|
|
||||||
g_hMemImage = CreateFileMapping(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, _6502_MEM_LEN, NULL);
|
g_hMemImage = CreateFileMapping(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, _6502_MEM_LEN, NULL);
|
||||||
// NB. Returns NULL on failure (not INVALID_HANDLE_VALUE)
|
// NB. Returns NULL on failure (not INVALID_HANDLE_VALUE)
|
||||||
|
@ -1568,7 +1568,7 @@ static LPBYTE AllocMemImage(void)
|
||||||
VirtualFree(baseAddr, 0, MEM_RELEASE);
|
VirtualFree(baseAddr, 0, MEM_RELEASE);
|
||||||
|
|
||||||
UINT count = 0;
|
UINT count = 0;
|
||||||
while (count < num64KPages)
|
while (count < num64KRegions)
|
||||||
{
|
{
|
||||||
// MSDN: "To specify a suggested base address for the view, use the MapViewOfFileEx function. However, this practice is not recommended."
|
// MSDN: "To specify a suggested base address for the view, use the MapViewOfFileEx function. However, this practice is not recommended."
|
||||||
// This is why we retry multiple times.
|
// This is why we retry multiple times.
|
||||||
|
@ -1577,7 +1577,7 @@ static LPBYTE AllocMemImage(void)
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = (count == num64KPages);
|
res = (count == num64KRegions);
|
||||||
if (res)
|
if (res)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user