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

Function MemGetMainPtr

source/Memory.cpp:1734–1757  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1732}
1733
1734LPBYTE MemGetMainPtr(const WORD offset)
1735{
1736#if 1
1737 return g_isMemCacheValid && (memshadow[(offset >> 8)] == (memmain + (offset & 0xFF00)))
1738 ? mem + offset // Return 'mem' copy if possible, as page could be dirty
1739 : memmain + offset;
1740#else
1741 // TODO: GH#1426
1742 if (!g_isMemCacheValid)
1743 return memmain + offset;
1744
1745 if (offset < 0xC000)
1746 {
1747 return memshadow[(offset >> 8)] == (memmain + (offset & 0xFF00))
1748 ? mem + offset // Return 'mem' copy if possible, as page could be dirty
1749 : memmain + offset;
1750 }
1751
1752 // Required for a II+ w/Saturn in SLOT0 or //e w/Saturn (in another slot)
1753 return memshadow[(offset >> 8)] == (g_pMemMainLanguageCard + (offset & 0xFF00) - 0xC000)
1754 ? mem + offset // Return 'mem' copy if possible, as page could be dirty
1755 : memmain + offset;
1756#endif
1757}
1758
1759//===========================================================================
1760

Callers 15

UpdateDHiResCellFunction · 0.85
UpdateDHiResCellRGBFunction · 0.85
UpdateDHiRes160CellFunction · 0.85
UpdateLoResCellFunction · 0.85
UpdateDLoResCellFunction · 0.85
MemGetMainPtrWithLCFunction · 0.85
ReadFloatingBusFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected