Improved USB debugger toolbar handling.

- Added XPM bitmap for the "trigger" state.
- Init toolbar with USB debugger disabled state and switch to enabled when
  setting up the USB debug type.
- USB debugger is now available with plugins enabled.
This commit is contained in:
Volker Ruppert 2024-06-28 22:04:14 +02:00
parent c0706da40c
commit dc05bec7e3
7 changed files with 60 additions and 5 deletions

View File

@ -18,6 +18,7 @@ Detailed change log :
- GUI and display libraries
- Debugger gui can now use ini file from BXSHARE path when using gui option
extension "gui_debug:globalini" (sdl, sdl2, win32, x11)
- added bitmap change support for the wxWidgets toolbar
- I/O Devices
- VGA

2
bochs/configure vendored
View File

@ -24747,7 +24747,7 @@ printf "%s\n" "no" >&6; }
fi
else $as_nop
if test "$bx_debugger" = 1 -a "$use_usb" = 1 -a "$bx_plugins" = 0; then
if test "$bx_debugger" = 1 -a "$use_usb" = 1; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
usb_debugger=1

View File

@ -1684,7 +1684,7 @@ AC_ARG_ENABLE(win32usbdbg,
usb_debugger=0
fi],
[
if test "$bx_debugger" = 1 -a "$use_usb" = 1 -a "$bx_plugins" = 0; then
if test "$bx_debugger" = 1 -a "$use_usb" = 1; then
AC_MSG_RESULT(yes)
usb_debugger=1
else

View File

@ -0,0 +1,40 @@
/* XPM */
static char *usbdbg_trigger_xpm[] = {
/* columns rows colors chars-per-pixel */
"32 32 2 1 ",
". c None",
"# c black",
/* pixels */
"...#...........................#",
"..#...........................#.",
".#....####################...#..",
"..#..######################...#.",
"...######..............#####...#",
"..#.####................####..#.",
".#..#####..............#####.#..",
"..#.########################..#.",
"...#########################...#",
"..#.########################..#.",
".#..########################.#..",
"..#.########################..#.",
"...#########################...#",
"..#.########################..#.",
".#..########################.#..",
"..#.########################..#.",
"...#########################...#",
"..#.########################..#.",
".#..########################.#..",
"..#.########################..#.",
"...#########################...#",
"..#.########################..#.",
".#...######################..#..",
"..#...##................##....#.",
"...#..##................##.....#",
"..#...##..##........##..##....#.",
".#....##..##........##..##...#..",
"..#...##..##........##..##....#.",
"...#..##..##........##..##.....#",
"..#...##................##....#.",
".#....####################...#..",
"..#....##################.....#."
};

View File

@ -1476,6 +1476,10 @@ void bx_wx_gui_c::replace_bitmap(unsigned hbar_id, unsigned bmap_id)
theFrame->SetToolBarBitmap(ID_Edit_FD_1, bmap_id == floppyB_bmap_id);
} else if (hbar_id == cdrom1_hbar_id) {
theFrame->SetToolBarBitmap(ID_Edit_Cdrom1, bmap_id == cdrom1_bmap_id);
#if BX_USE_WIN32USBDEBUG
} else if (hbar_id == usbdbg_hbar_id) {
theFrame->SetToolBarBitmap(ID_Toolbar_USB_Debug, bmap_id == usbdbg_trigger_bmap_id);
#endif
}
}

View File

@ -98,7 +98,8 @@
#include "bitmaps/userbutton.xpm"
#include "bitmaps/saverestore.xpm"
#if BX_USE_WIN32USBDEBUG
#include "bitmaps/usb.xpm"
#include "bitmaps/usbdbg.xpm"
#include "bitmaps/usbdbg_trigger.xpm"
#endif
#ifdef __WXGTK__
#include "icon_bochs.xpm"
@ -450,7 +451,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
BX_ADD_TOOL(ID_Edit_Cdrom1, cdrom1_eject_xpm, wxT("Change first CDROM media"));
BX_ADD_TOOL(ID_Toolbar_Mouse_en, mouse_dis_xpm, wxT("Enable mouse capture"));
#if BX_USE_WIN32USBDEBUG
BX_ADD_TOOL(ID_Toolbar_USB_Debug, usbdbg_xpm, wxT("Trigger the USB Debugger"));
BX_ADD_TOOL(ID_Toolbar_USB_Debug, usbdbg_xpm, wxT("USB Debugger support not enabled"));
#endif
bxToolBar->AddSeparator();
BX_ADD_TOOL(ID_Toolbar_User, userbutton_xpm, wxT("Send keyboard shortcut"));
@ -878,7 +879,7 @@ void MyFrame::UpdateToolBar(bool simPresent)
bxToolBar->SetToolShortHelp(ID_Toolbar_Power, wxT("Turn power on"));
}
#if BX_USE_WIN32USBDEBUG
bxToolBar->EnableTool(ID_Toolbar_USB_Debug, simPresent);
bxToolBar->EnableTool(ID_Toolbar_USB_Debug, false);
#endif
}
@ -1322,6 +1323,15 @@ void MyFrame::SetToolBarBitmap(int id, bool onoff)
case ID_Toolbar_Mouse_en:
bitmap = wxBitmap(onoff ? mouse_xpm : mouse_dis_xpm);
break;
#if BX_USE_WIN32USBDEBUG
case ID_Toolbar_USB_Debug:
if (!bxToolBar->GetToolEnabled(ID_Toolbar_USB_Debug)) {
bxToolBar->EnableTool(ID_Toolbar_USB_Debug, true);
bxToolBar->SetToolShortHelp(ID_Toolbar_USB_Debug, wxT("Trigger the USB debugger"));
}
bitmap = wxBitmap(onoff ? usbdbg_trigger_xpm : usbdbg_xpm);
break;
#endif
default:
return;
}