Skip to content

Commit

Permalink
add "break on bad opcodes" to menu
Browse files Browse the repository at this point in the history
  • Loading branch information
warmCabin committed Jun 28, 2021
1 parent d257a7e commit 9288c21
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/drivers/win/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1649,6 +1649,7 @@ inline void UpdateOptionsPopup(HMENU optionsPopup)
CheckMenuItem(optionsPopup, ID_DEBUGGER_AUTO_OPEN, CheckedFlag(debuggerAutoload));
CheckMenuItem(optionsPopup, ID_DEBUGGER_IDA_FONT, CheckedFlag(debuggerIDAFont));
CheckMenuItem(optionsPopup, ID_DEBUGGER_SHOW_ROM_OFFSETS, CheckedFlag(debuggerDisplayROMoffsets));
CheckMenuItem(optionsPopup, ID_DEBUGGER_BREAK_BAD_OPCODES, CheckedFlag(FCEUI_Debugger().badopbreak));
}

inline void UpdateSymbolsPopup(HMENU symbolsPopup)
Expand Down Expand Up @@ -1945,6 +1946,9 @@ void DebuggerBnClicked(HWND hwndDlg, uint16 btnId, HWND hwndBtn)
debuggerDisplayROMoffsets ^= 1;
UpdateDebugger(false);
break;
case ID_DEBUGGER_BREAK_BAD_OPCODES:
FCEUI_Debugger().badopbreak ^= 1;
break;
case ID_DEBUGGER_RESTORE_SIZE:
RestoreSize(hwndDlg);
break;
Expand Down Expand Up @@ -2121,6 +2125,7 @@ void DebuggerBnClicked(HWND hwndDlg, uint16 btnId, HWND hwndBtn)
}
break;
}
// TODO: delete/merge with ID_DEBUGGER_BREAK_BAD_OPCODES
case IDC_DEBUGGER_BREAK_ON_BAD_OP: //Break on bad opcode
FCEUI_Debugger().badopbreak ^= 1;
break;
Expand Down
2 changes: 2 additions & 0 deletions src/drivers/win/res.rc
Original file line number Diff line number Diff line change
Expand Up @@ -3047,6 +3047,8 @@ BEGIN
MENUITEM "Auto Open on ROM Load", ID_DEBUGGER_AUTO_OPEN, CHECKED
MENUITEM "IDA Font", ID_DEBUGGER_IDA_FONT, CHECKED
MENUITEM "ROM Offsets", ID_DEBUGGER_SHOW_ROM_OFFSETS, CHECKED
MENUITEM SEPARATOR
MENUITEM "Break on Bad Opcodes", ID_DEBUGGER_BREAK_BAD_OPCODES, CHECKED
MENUITEM SEPARATOR
MENUITEM "Reset Window Size", ID_DEBUGGER_RESTORE_SIZE
END
Expand Down
1 change: 1 addition & 0 deletions src/drivers/win/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,7 @@
#define ID_DUMPER_BROWSE 45550
#define ID_DUMPER_GO 45551
#define ID_DUMPER_NES_ADDR_TOGGLE 45552
#define ID_DEBUGGER_BREAK_BAD_OPCODES 45553
#define MW_VALUELABEL2 65423
#define MW_VALUELABEL1 65426
#define IDC_STATIC_SLASHTEXT 65442
Expand Down

0 comments on commit 9288c21

Please sign in to comment.