MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / MemGetPtrBANK1

Function MemGetPtrBANK1

source/Memory.cpp:1648–1658  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1646//===========================================================================
1647
1648static LPBYTE MemGetPtrBANK1(const WORD offset, const LPBYTE pMemBase)
1649{
1650 if ((offset & 0xF000) != 0xC000) // Requesting RAM at physical addr $Cxxx (ie. 4K RAM BANK1)
1651 return NULL;
1652
1653 // NB. This works for memaux when set to any RWpages[] value, ie. RamWork III "just works"
1654 const BYTE bank1page = (offset >> 8) & 0xF;
1655 return (g_isMemCacheValid && (memshadow[0xD0+bank1page] == pMemBase+(0xC0+bank1page)*_6502_PAGE_SIZE))
1656 ? mem+offset+0x1000 // Return ptr to $Dxxx address - 'mem' has (a potentially dirty) 4K RAM BANK1 mapped in at $D000
1657 : pMemBase+offset; // Else return ptr to $Cxxx address
1658}
1659
1660//-------------------------------------
1661

Callers 2

MemGetAuxPtrWithLCFunction · 0.85
MemGetMainPtrWithLCFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected