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

Function DebuggerMouseClick

source/Debugger/Debugger_Win32.cpp:320–447  ·  view source on GitHub ↗

===========================================================================

Source from the content-addressed store, hash-verified

318
319//===========================================================================
320void DebuggerMouseClick(int x, int y)
321{
322 if (g_nAppMode != MODE_DEBUG)
323 return;
324
325 KeybUpdateCtrlShiftStatus();
326 int iAltCtrlShift = 0;
327 iAltCtrlShift |= KeybGetAltStatus() ? 1 << 0 : 0;
328 iAltCtrlShift |= KeybGetCtrlStatus() ? 1 << 1 : 0;
329 iAltCtrlShift |= KeybGetShiftStatus() ? 1 << 2 : 0;
330
331 // GH#462 disasm click #
332 if (iAltCtrlShift != g_bConfigDisasmClick)
333 return;
334
335 Win32Frame& win32Frame = Win32Frame::GetWin32Frame();
336
337 int nFontWidth = g_aFontConfig[FONT_DISASM_DEFAULT]._nFontWidthAvg * win32Frame.GetViewportScale();
338 int nFontHeight = g_aFontConfig[FONT_DISASM_DEFAULT]._nLineHeight * win32Frame.GetViewportScale();
339
340 // do picking
341
342 // NB. Full-screen + VidHD isn't centred yet
343 const int nOffsetX = win32Frame.IsFullScreen() ? win32Frame.GetFullScreenOffsetX() : win32Frame.Get3DBorderWidth() + GetVideo().GetFrameBufferCentringOffsetX() * win32Frame.GetViewportScale();
344 const int nOffsetY = win32Frame.IsFullScreen() ? win32Frame.GetFullScreenOffsetY() : win32Frame.Get3DBorderHeight();
345
346 const int nOffsetInScreenX = x - nOffsetX;
347 const int nOffsetInScreenY = y - nOffsetY;
348
349 if (nOffsetInScreenX < 0 || nOffsetInScreenY < 0)
350 return;
351
352 int cx = nOffsetInScreenX / nFontWidth;
353 int cy = nOffsetInScreenY / nFontHeight;
354
355#if _DEBUG
356 ConsoleDisplayPushFormat("x:%d y:%d cx:%d cy:%d", x, y, cx, cy);
357 DebugDisplay();
358#endif
359
360 if (g_iWindowThis == WINDOW_CODE)
361 {
362 // Display_AssemblyLine -- need Tabs
363
364 if (g_bConfigDisasmAddressView)
365 {
366 // HACK: hard-coded from DrawDisassemblyLine::aTabs[] !!!
367 if (cx < 4) // ####
368 {
369 g_bConfigDisasmAddressView ^= true;
370 DebugDisplay();
371 }
372 else
373 if (cx == 4) // :
374 {
375 g_bConfigDisasmAddressColon ^= true;
376 DebugDisplay();
377 }

Callers 1

WndProcMethod · 0.85

Calls 14

KeybGetAltStatusFunction · 0.85
KeybGetCtrlStatusFunction · 0.85
KeybGetShiftStatusFunction · 0.85
ConsoleDisplayPushFormatFunction · 0.85
DebugDisplayFunction · 0.85
CmdCursorJumpPCFunction · 0.85
GetViewportScaleMethod · 0.80
IsFullScreenMethod · 0.80
GetFullScreenOffsetXMethod · 0.80
Get3DBorderWidthMethod · 0.80

Tested by

no test coverage detected