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

Function DrawMemory

source/Debugger/Debugger_Display.cpp:2195–2466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2193}
2194
2195void DrawMemory ( int line, int iMemDump )
2196{
2197 if (! ((g_iWindowThis == WINDOW_CODE) || ((g_iWindowThis == WINDOW_DATA))))
2198 return;
2199
2200 MemoryDump_t* pMD = &g_aMemDump[ iMemDump ];
2201 bool bActive = pMD->bActive;
2202#if DEBUG_FORCE_DISPLAY
2203 bActive = true;
2204#endif
2205 if ( !bActive )
2206 return;
2207
2208 USHORT nAddr = pMD->nAddress;
2209 DEVICE_e eDevice = pMD->eDevice;
2210 MemoryView_e iView = pMD->eView;
2211
2212 MockingboardCard::DEBUGGER_MB_CARD MB;
2213 bool isMockingboardInSlot = false;
2214 const UINT slot = pMD->addrPrefix.nSlot;
2215 const UINT subUnit = nAddr & 1;
2216
2217 if (eDevice == DEV_MB_SUBUNIT || eDevice == DEV_AY8913_PAIR)
2218 {
2219 if (GetCardMgr().GetMockingboardCardMgr().IsMockingboard(slot))
2220 {
2221 dynamic_cast<MockingboardCard&>(GetCardMgr().GetRef(slot)).GetSnapshotForDebugger(&MB);
2222 isMockingboardInSlot = true;
2223 for (int i = 0; i < NUM_SUBUNITS_PER_MB; i++)
2224 {
2225 for (int j = 0; j < NUM_AY8913_PER_SUBUNIT; j++)
2226 {
2227 if (!MB.subUnit[i].isAYLatchedAddressValid[j])
2228 MB.subUnit[i].nAYCurrentRegister[j] = 0xff;
2229 }
2230 }
2231 }
2232 }
2233
2234 RECT rect = { 0 };
2235 rect.left = DISPLAY_MINIMEM_COLUMN;
2236 rect.top = (line * g_nFontHeight);
2237 rect.right = DISPLAY_WIDTH;
2238 rect.bottom = rect.top + g_nFontHeight;
2239
2240 RECT rect2 = rect;
2241
2242 const int MAX_MEM_VIEW_TXT = 16;
2243
2244 std::string sType = "Mem";
2245 if (eDevice == DEV_MB_SUBUNIT || eDevice == DEV_AY8913_PAIR)
2246 sType = StrFormat("Slot%d", slot);
2247
2248 std::string sAddress;
2249
2250 int iForeground = FG_INFO_OPCODE;
2251 int iBackground = BG_INFO;
2252

Callers 1

DrawSubWindow_InfoFunction · 0.85

Calls 15

StrFormatFunction · 0.85
WordToHexStrFunction · 0.85
DebuggerSetColorFGFunction · 0.85
DebuggerGetColorFunction · 0.85
DebuggerSetColorBGFunction · 0.85
PrintTextCursorXFunction · 0.85
PrintGlyphFunction · 0.85
PrintTextCursorYFunction · 0.85
DrawLine_MB_SUBUNITFunction · 0.85
DrawLine_AY8913_PAIRFunction · 0.85

Tested by

no test coverage detected