Used by: . Savestate: MemSaveSnapshotMemory(), MemLoadSnapshotAux() . VidHD : SaveSnapshot(), LoadSnapshot() . Debugger : CmdMemorySave(), CmdMemoryLoad()
| 1779 | // . VidHD : SaveSnapshot(), LoadSnapshot() |
| 1780 | // . Debugger : CmdMemorySave(), CmdMemoryLoad() |
| 1781 | LPBYTE MemGetBankPtr(const UINT nBank, const bool isSaveSnapshotOrDebugging/*=true*/) |
| 1782 | { |
| 1783 | // Only call BackMainImage() when a consistent 64K bank is needed, eg. for saving snapshot or debugging |
| 1784 | // - for snapshot *loads* it's redundant, and worse it can corrupt pages 0 & 1 for aux banks, so must be avoided (GH#1262) |
| 1785 | if (isSaveSnapshotOrDebugging) |
| 1786 | BackMainImage(); // Flush any dirty pages to back-buffer |
| 1787 | |
| 1788 | #ifdef RAMWORKS |
| 1789 | if (nBank > g_uMaxExBanks) |
| 1790 | return NULL; |
| 1791 | |
| 1792 | if (nBank == 0) |
| 1793 | return memmain; |
| 1794 | |
| 1795 | return RWpages[nBank-1]; |
| 1796 | #else |
| 1797 | return (nBank == 0) ? memmain : |
| 1798 | (nBank == 1) ? memaux : |
| 1799 | NULL; |
| 1800 | #endif |
| 1801 | } |
| 1802 | |
| 1803 | //=========================================================================== |
| 1804 |
no test coverage detected