Commit Graph

1796 Commits

Author SHA1 Message Date
Volker Ruppert
533e2f7c76 Some USB debugger config parameter changes.
- Changed USB debug type defines to enum.
- Trigger options depend on the debug type parameter.
- Minor related changes.
2024-06-16 10:33:14 +02:00
Volker Ruppert
3118f0dec4 Some work on the USB debugger code.
- Moved USB debugger options to the "ports" subtree to make them available in
  the start menu dialog.
- Replaced direct device object access with save/restore tree access for
  compatiblity with the plugins support.
- Minor related changes (removed some hacks, added helper functions).
- FIXME: MSVC build fails to show dialog, closes Bochs session instead.
- FIXME: MSVC plugins version fails to link win32config DLL.
2024-06-15 14:57:10 +02:00
Volker Ruppert
f6975151f3 Removed trailing spaces from USB debugger code.
TODO: Rewrite of USB debugger code to make it compatible with Bochs plugin support.
2024-06-14 23:08:41 +02:00
Stanislav Shwartsman
8712a316d2 fix for issue #326 2024-06-14 19:43:46 +03:00
Volker Ruppert
730fe8e813 Enable debugger gui only if available (wx handling was incorrect). 2024-06-04 20:39:12 +02:00
Volker Ruppert
a23bac15e5 Fixed two legacy SDL key handling issues.
- Scroll lock release now works again (Formerly used as fullscreen toggle).
- Attempt to fix Pause / Ctrl+Break key handling (possibly SDL issue).
2024-06-02 19:28:08 +02:00
Volker Ruppert
3e8c074580 Fixed SDL2 fullscreen toggle. 2024-05-30 22:19:07 +02:00
Volker Ruppert
dc10a4195d Fullscreen mode fixes for the win32 gui.
Clear screen on top of dimension_update() to get rid of artifacts from previous resolution.
Adjust tile height at the bottom of the display if necessary.
2024-05-30 13:46:27 +02:00
Volker Ruppert
b84ebf5dfc Fixed text mode cursor rendering in win32 gui (issue #314). 2024-05-04 11:27:06 +02:00
Volker Ruppert
b18a1e7c48 Fixed text mode cursor blinking (not depending on text blink feature). 2024-05-04 08:40:00 +02:00
Volker Ruppert
89bfe81834 wx: Added support for gui options parser and gui debugger global ini. 2024-04-28 07:37:28 +02:00
Volker Ruppert
805bb6b985 Added structure for gui options and zero it out in constructor. 2024-04-27 23:06:02 +02:00
Stanislav Shwartsman
9d84b1086f fixed missing IPS in the status bar
the gui_hide_ips variable was never initialized :(
same for gui_nokeyrepeat and many others, fixed only what I knew ...
2024-04-27 10:00:23 +03:00
Stanislav Shwartsman
1255a0c585 remove fpu/softfloat.h, reduce include deprendencies, fix warnings
regenerate dep lists in all Makefile.in
2024-04-25 11:50:48 +03:00
Biswapriyo Nath
e1d67d9ce0
Fix checking Android platform with __ANDROID__ macro (#299)
This change fixes compiler errors in Android as following.
    
../../../iodev/sound/soundoss.cc:43:10: fatal error: 'sys/soundcard.h'
file not found
       43 | #include <sys/soundcard.h>
          |          ^~~~~~~~~~~~~~~~~
../../../iodev/network/slirp/misc.cc:195:12: error: use of undeclared
identifier 'getdtablesize'; did you mean 'getpagesize'?
      195 |                 for (s = getdtablesize() - 1; s >= 3; s--)
          |                          ^~~~~~~~~~~~~
          |                          getpagesize
/data/data/com.termux/files/usr/include/unistd.h:356:5: note:
'getpagesize' declared here
      356 | int getpagesize(void) __INTRODUCED_IN(21);
          |     ^
    
The official documentation also suggests to use __ANDROID__ macro which
is defined by the compiler irrespective of included headers and build
system.
https://android.googlesource.com/platform/bionic/+/HEAD/docs/defines.md
2024-04-06 23:18:01 +02:00
Volker Ruppert
78ce6be17d Fixed compilation of vncsrv gui in Cygwin. 2024-04-01 09:01:27 +02:00
Volker Ruppert
ba1a0441ab Setting GTK version number in config.h fixes GTK3 compilation.
GTK3 forbids to include gtkversion.h directly.
2024-03-30 16:59:06 +01:00
Volker Ruppert
676eb9f37d Added support for showing X dialog box when parsing options.
Changed init order to: XInitThreads(), XOpenDisplay(), SIM->set_notify_callback()
and then parse display library options.
2024-03-30 11:11:07 +01:00
Volker Ruppert
1924cd457e Gui options parser: Don't panic after showing error message box. 2024-03-30 08:05:53 +01:00
Volker Ruppert
51a73a00e8 Fixed compilation error with minimal configuration. 2024-03-29 20:29:58 +01:00
Volker Ruppert
ed20d44090 Added new gui method parse_common_gui_options().
Simplified gui option handling with it in sdl, sdl2, win32 and x11 guis.
The sdl and sdl2 guis now also support "gui_debug:globalini".
2024-03-29 20:12:41 +01:00
Stanislav Shwartsman
af18912529 GTK debugger: Set GTK_DISABLE_DEPRECATED only for GTK 2.
The current code fails to compile otherwise with GTK 3.
(was accidentially removed by prev commit)
2024-03-29 16:04:17 +03:00
Volker Ruppert
1bbd4ed535 Added gui debugger option extension "globalini" fur the win32 and x11 guis.
Use this display library line to read/write ini from BXSHARE path:

display_library: x, options="gui_debug:globalini"

NOTE: Using $BXSHARE at this point doesn't work yet since the common parser code
expands the variable and Bochs finally exits with a panic (needs to be reviewed).

TODO: Add shared parser code for all guis and add this feature for SDL, SDL2 and
wxWidgets guis.
2024-03-29 10:40:59 +01:00
Volker Ruppert
504f68e6bd Fixed warnings in the GTK debugger code. 2024-03-27 17:33:19 +01:00
Volker Ruppert
44d644c2c2 Some more user doc updates and updating Bochs website URL. 2024-03-26 19:36:12 +01:00
Volker Ruppert
ca8c9936b9 Debugger gui: Added support for using ini file from BXSHARE path.
If BXSHARE variable is defined (or BX_SHARE_PATH set in Windows registry)
and an existing ini file is copied to this location, the gui will use it
instead of the local ini file (issue #195).
TODO: Specify the ini file priority with an addition to the 'gui_debug'
parameter of the display library option.
2024-03-25 20:08:02 +01:00
Volker Ruppert
542a3f9b6a MSVC workspaces: Added new USB debugger files to gui.vcxproj.
Renamed USB EHCI and USB UHCI folders in plugin workspace files.
Attempt fix plugin version for compiling with Bochs debugger / USB debugger.
FIXME: USB debugger doesn't link yet.
2024-03-22 20:23:38 +01:00
Volker Ruppert
7d037af569 Fixed compilation of USB debugger if the win32 gui is not present. 2024-03-13 17:03:21 +01:00
Benjamin David Lunt
557976bee1
Initial start of the USB Debugger (#165)
This is the start of the Experimental USB Debugger (currently for the
Windows platform only).

Currently only supports the UHCI and xHCI controllers. The remaining
function of these two controllers and the two remaining controllers are
in the works and will be added to when time allows.

The User.dbk has been updated with (temporary) html files at
https://www.fysnet.net/bochs/user/index.html showing the process to
invoke and use the USB debugger (Section 5.8).

In its completion, this debugger will allow you to view and modify most
aspects of the specified USB controller. For example, currently you can
view and modify a TRB listed in the xHCI's Command or Event Ring. Other
aspects will be added.

I do not use and am not fluent in the use of `configure`,
`configure.ac`, and associated configuration files. I also don't use the
`gui/Makefile.in` file.

Someone that is more fluent in the way these files work, please add the
necessary items to successfully compile this PR.

---------

Co-authored-by: Shwartsman <stanislav.shwartsman@intel.com>
2024-03-10 13:05:41 +02:00
Volker Ruppert
be3e664dff Allow setting disabled parameters in the bochsrc / command line stage.
Dependencies should work completely in the config interface stage and coherency
check should be done in device init. This change should make the oder of parameters
in bochsrc / command line less strict (issue #263).
2024-02-25 11:08:11 +01:00
Volker Ruppert
4455da0e1b Perform win32 gui internal palette swapping only in case of a bpp change. 2024-02-18 18:20:49 +01:00
Volker Ruppert
0e5800bf98 VGA_MEM_FIX: Fixed cursor address of the invisible cursor.
Now using the highest address of the default text mode buffer.
2024-02-11 13:40:02 +01:00
Volker Ruppert
e5ff346368 Some fixes and cleanups after latest changes.
- Fixed Cirrus text mode output.
- VBE now using it's own 'line_offset' value.
- Since font change is now handled in update(), removing gui method set_text_charbyte().
2024-02-09 14:34:01 +01:00
Shwartsman
e960e574f4 this annoying message happens always when debugger is closed
change to BX_INFO
2024-01-21 17:44:17 +02:00
Vort
ba7c8ed57a
Cancel topmost mode after leaving fullscreen mode (#224)
`HWND_TOPMOST` should be cancelled with `HWND_NOTOPMOST` when it is not
needed anymore.

Co-authored-by: Volker Ruppert <Volker.Ruppert@t-online.de>
2024-01-16 00:03:32 +01:00
Volker Ruppert
77fffc1336 SDL: Cleaned up fullscreen toggle functions.
FIXME: Window height sometimes not restored correctly (observed on Linux / X11).
2024-01-14 17:49:44 +01:00
Volker Ruppert
103b4fa8eb SDL2: Save / restore window position when using fullscreen toggle.
FIXME: Display updates can fail after toggle (observed on Linux / X11).
2024-01-14 17:00:05 +01:00
Volker Ruppert
9fdb898dfe SDL / SDL2: change fullscreen toggle to key combination ALT+ENTER.
TODO: Fix some issues related to this feature.
2024-01-14 11:41:01 +01:00
Volker Ruppert
2585b6ff68 SDL2: Don't show dialog box if Bochs is killed with SIGTERM. 2024-01-14 07:01:31 +01:00
Volker Ruppert
7985fa1ebb X11: changed set_font() message to BX_DEBUG. 2024-01-01 11:20:05 +01:00
Volker Ruppert
be1baa295c Implemented secondary VGA charmap support.
All guis with 'new_text_api' and the graphical text snapshot working with it.
2023-12-29 17:47:44 +01:00
Shwartsman
f3053e49bd fixed warnings in x.cc 2023-12-23 16:44:00 +02:00
Volker Ruppert
664fdae152 Fixed mouse toggle check (issue #181).
Clear out other keys/buttons when pressing one of the modifier keys.
2023-12-23 10:32:15 +01:00
Volker Ruppert
8c89528617 Fixed assertion failure on exit (#164).
The io object should never been deleted.
2023-12-09 14:22:02 +01:00
Volker Ruppert
18d1e76444 X gui: a short delay makes it show the modeless message box correctly. 2023-12-03 15:28:23 +01:00
Volker Ruppert
7f420fc260 Added modeless message box in the restore code and some related fixes.
- Show message box while restoring hardware state.
- Set modeless message box handle to NULL after destroying it.
- Reset all config options to default before restoring config.
- Fixed CMOS RTC value after restore if in 12-hour-mode.
- Fixed possible segfault in the plugins code caused by Voodoo plugin in VGA mode
  (found at restore code testing).
2023-12-03 12:34:03 +01:00
Stanislav Shwartsman
ffc722f4e8
Porting #SF patch #565 Real Time Clock /CMOS fix (#4)
by Michele Giacomone

Detailed description:

  -Observed issues

   Due to some limitations only dates between 1980 and 2038 can be
   used in a reliable way.
   Also, bochs incorrectly assumes a linear correspondence between
   the data returned by the <time.h> functions localtime() and
   mktime(), and isn't setting the latter properly.
   Bochs keeps its internal time value dependent to these functions
   after setup, assuming that their internal settings won't change
   on the go - which is not the case.
   In my OS, and in my timezone, this leads to incorrect startup values
   for 5 months each year and unreliable values if the simulation is
   kept going for a long time. (a feedback between localtime() and
   mktime() is created which keeps shifting back the time)
   Also, the RTC simulation is not realistic since the clock fixes
   itself across DST changes, without updating any DST related flag,
   a behavior that no guest OS expects.

  -Proposed fix

   This is implemented in such way that no bochs' previous behavior
   is changed, a part from the broken ones, with legacy in mind
   == the user can keep using bochs exactly as before knowing nothing
      of this patch

   +Make the internal s.timeval variable a Bit64s, so it can fit all
    values that the cmos can correctly represent, reported below:
    MIN     setting  -62167219200 =>  0000/01/01 SAT  0:00:00
    MAX BCD setting  253402300799 =>  9999/12/31 FRI 23:59:59
    MAX BIN setting  745690751999 => 25599/12/31 FRI 23:59:59
    And then fix each reference to these so it can handle such values
    And make bochs correctly wrap around for under/overflows, so that
    only the most significant bits of the century are lost.

   +Do the same thing to the bochs time0 parameter, so all the above
    values can be chosen at startup (despite being now legal values,
    1 and 2 will still be treated as "local" and "utc"). Note that
    normally only BCD settings are valid since bochs' CMOS defaults
    to such operating mode - the only way to use the binary range
    is by loading a cmos memory map.

   +Make the internal s.timeval variable independent from external
    factors. This means providing a small set of time handling
    functions, contained in "iodev/utctime.h", which must work in
    any environment in which bochs compiles, accessing no external
    resource. This also means that after startup, s.timeval will only
    be changed internally, and no call to the OS time functions will
    be made.

   +Make the internal s.timeval variable timezone independent, to
    have a linear correlation between its values and valid CMOS
    settings. To make it easier, s.timeval is gonna be treated as
    if the current timezone was UTC: so,
     - if the user selects UTC as time0, s.timeval will become current
       time(NULL)
     - if the user selects localtime, s.timeval will be computed as
       the value which will display the same broken down time as
       localtime(&now)
     - if the user inputs a time formatted string the proper s.timeval
       to displayed will be easily calculated,
     - if the user inputs a starting time value, s.timeval will be
       computed as the value which will display the same broken down
       time as localtime(&user_input) to ensure the same operation as
       before.
    A "tz=utc" is displayed when bochs prints out the current time
    value, to warn users about the difference in meaning between the
    internally kept time value and the value they can set through
    the "time0=" parameter. This might be changed to communicate
    instead the time value they can input to get the same setting,
    but performing such calculation (except for the startup time)
    suffers from all the mktime()/localtime() problems listed above
    so I did not do it.
    The range of "time0" is automatically adjusted so all users in
    all time zones can set any legal value despite "time0=" having a
    local meaning.

  A thorough explanation of what I did and why can be found in the
  "iodev/utctime.h" library header.

---------

Co-authored-by: Stanislav Shwartsman <sshwarts@users.sourceforge.net>
Co-authored-by: Volker Ruppert <Volker.Ruppert@t-online.de>
2023-12-01 22:55:35 +01:00
Volker Ruppert
e82316c490 Memory leak fix in the win32 gui code.
In exit() method always call terminateEmul(), but the argument depends on the
value of bx_user_quit.
2023-11-26 22:04:07 +01:00
Volker Ruppert
b319a6cb5d Some more memory leak fixes.
- delete SIM object
- delete i/o port to handler tables
- free plugin tables for enum parameters
2023-11-26 15:44:38 +01:00
Volker Ruppert
ae107f2cb8 Some more memory leak fixes.
- added method for logfunctions cleanup on app exit
- delete default i/o handler names
- delete pluginlog
2023-11-26 13:41:19 +01:00