Implements #462 sans: help disasm

This commit is contained in:
michaelangel007 2017-08-25 07:22:08 -07:00
parent d9e9ef34ab
commit be41616359
5 changed files with 42 additions and 1 deletions

View File

@ -188,6 +188,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// Config - Disassembly
bool g_bConfigDisasmAddressView = true;
int g_bConfigDisasmClick = 0; // GH#462 alt=1, ctrl=2, shift=4 bitmask
bool g_bConfigDisasmAddressColon = true;
bool g_bConfigDisasmOpcodesView = true;
bool g_bConfigDisasmOpcodeSpaces = true;
@ -2505,6 +2506,30 @@ Update_t CmdConfigDisasm( int nArgs )
}
break;
case PARAM_CONFIG_CLICK: // GH#462
if ((nArgs > 1) && (! bDisplayCurrentSettings)) // set
{
iArg++;
g_bConfigDisasmClick = (g_aArgs[ iArg ].nValue) & 7; // MAGIC NUMBER
}
// else // Always show current setting -- TODO: Fix remaining disasm to show current setting when set
{
const char *aClickKey[8] =
{
"" // 0
,"Alt " // 1
,"Ctrl " // 2
,"Alt+Ctrl " // 3
,"Shift " // 4
,"Shift+Alt " // 5
,"Shift+Ctrl " // 6
,"Shift+Ctarl+Alt " // 7
};
ConsoleBufferPushFormat( sText, TEXT( "Click: %d = %sLeft click" ), g_bConfigDisasmClick, aClickKey[ g_bConfigDisasmClick & 7 ] );
ConsoleBufferToDisplay();
}
break;
case PARAM_CONFIG_COLON:
if ((nArgs > 1) && (! bDisplayCurrentSettings)) // set
{
@ -9647,6 +9672,16 @@ void DebuggerMouseClick( int x, int y )
if (g_nAppMode != MODE_DEBUG)
return;
// NOTE: KeybUpdateCtrlShiftStatus() should be called before
int iAltCtrlShift = 0;
iAltCtrlShift |= (g_bAltKey & 1) << 0;
iAltCtrlShift |= (g_bCtrlKey & 1) << 1;
iAltCtrlShift |= (g_bShiftKey & 1) << 2;
// GH#462 disasm click #
if (iAltCtrlShift != g_bConfigDisasmClick)
return;
int nFontWidth = g_aFontConfig[ FONT_DISASM_DEFAULT ]._nFontWidthAvg * GetViewportScale();
int nFontHeight = g_aFontConfig[ FONT_DISASM_DEFAULT ]._nLineHeight * GetViewportScale();

View File

@ -83,6 +83,7 @@
// Config - Disassembly
extern bool g_bConfigDisasmAddressView ;
extern int g_bConfigDisasmClick ; // GH#462
extern bool g_bConfigDisasmAddressColon ;
extern bool g_bConfigDisasmOpcodesView ;
extern bool g_bConfigDisasmOpcodeSpaces ;

View File

@ -420,6 +420,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{TEXT("N") , NULL, PARAM_FLAG_N }, // 1--- ---- Sign
// Disasm
{TEXT("BRANCH") , NULL, PARAM_CONFIG_BRANCH },
{TEXT("CLICK") , NULL, PARAM_CONFIG_CLICK }, // GH#462
{TEXT("COLON") , NULL, PARAM_CONFIG_COLON },
{TEXT("OPCODE") , NULL, PARAM_CONFIG_OPCODE },
{TEXT("POINTER") , NULL, PARAM_CONFIG_POINTER },

View File

@ -1319,6 +1319,7 @@ const DisasmData_t* pDisasmData; // If != NULL then bytes are marked up as data
// Disasm
, _PARAM_CONFIG_BEGIN = _PARAM_REGS_END // Daisy Chain
, PARAM_CONFIG_BRANCH = _PARAM_CONFIG_BEGIN // g_iConfigDisasmBranchType [0|1|2]
, PARAM_CONFIG_CLICK // g_bConfigDisasmClick [0..7] // GH#462
, PARAM_CONFIG_COLON // g_bConfigDisasmAddressColon [0|1]
, PARAM_CONFIG_OPCODE // g_bConfigDisasmOpcodesView [0|1]
, PARAM_CONFIG_POINTER // g_bConfigInfoTargetPointer [0|1]

View File

@ -1346,6 +1346,8 @@ LRESULT CALLBACK FrameWndProc (
break;
case WM_LBUTTONDOWN:
KeybUpdateCtrlShiftStatus();
if (buttondown == -1)
{
int x = LOWORD(lparam);
@ -1399,6 +1401,7 @@ LRESULT CALLBACK FrameWndProc (
}
}
}
DebuggerMouseClick( x, y );
}
RelayEvent(WM_LBUTTONDOWN,wparam,lparam);