Commit Graph

1776 Commits

Author SHA1 Message Date
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
Volker Ruppert
890a1be2f2 Attempt to fix some memory leaks in the plugins and gui code (discussion #144).
- Added plugin_cleanup() code for the version with plugins disabled.
- Added PLUGIN_FINI code for the gui plugins (except wx) to delete bx_gui object.
2023-11-25 18:15:47 +01:00
Volker Ruppert
86e4675a1d Fixed some memory leaks in the paramtree code (discussion #144).
- root_param was never deleted
- modified set_format() and set_long_format() to get rid of strdup()
2023-11-25 13:28:51 +01:00
Stanislav Shwartsman
3cad5c3e84
address most of the memory leaks (#149)
the param tree, siminterface log and SIM were not released handle all
but SIM for now
should reduce the memory leaks list dramatically
2023-11-24 20:34:24 +01:00
Volker Ruppert
32c7c3815a Display lib options 'cmdmode' and 'gui_debug' are now ignored by the wxWidgets port.
Using a bochsrc config designed for another gui no longer causes a BX_PANIC for unknown option.
2023-11-23 09:56:42 +01:00
Benjamin David Lunt
5683da27e8
reset status bar items at reset (#142)
When the user presses the "Reset" button on the gui ribbon, we need to
clear the active status of all statusbar items or they remain set after
the reset occurs.
This is mentioned in issue https://github.com/bochs-emu/Bochs/issues/136
2023-11-21 08:58:21 +02:00
Volker Ruppert
a9a15d332b Modified error handling for display library option 'gui_debug'.
If Bochs debugger is not present now showing an error message box instead of a BX_PANIC for unknown option.
2023-11-19 16:16:09 +01:00
Stanislav Shwartsman
db17e4a4e2
Revert "reset status bar items at reset" (#137)
Reverts bochs-emu/Bochs#136
2023-11-17 09:37:46 +02:00
Benjamin David Lunt
c247b43718
reset status bar items at reset (#136)
When the user presses the "Reset" button on the gui ribbon, we need to
clear the active status of all statusbar items or they remain set after
the reset occurs.
This is mentioned in issue #123
2023-11-17 09:36:56 +02:00
Volker Ruppert
def53a2928 Fixed gui DLL name. 2023-11-15 23:33:27 +01:00
Volker Ruppert
75d076b990 Added modeless message box support for the wxWidgets port. 2023-11-05 19:05:24 +01:00
Volker Ruppert
f719dbe6d1 In case of failure restore_config() resets the restore flag. 2023-11-04 15:09:44 +01:00
Volker Ruppert
e896e71618 Fix for the fix: restore state from config interface works again (really fixes issue #37). 2023-11-03 23:58:40 +01:00
Volker Ruppert
f4af2d4e24 Added modeless message box support for the x gui. 2023-10-30 21:27:37 +01:00
Volker Ruppert
cc16aea6fb Added modeless message box stub for textconfig. 2023-10-29 21:59:18 +01:00
Benjamin David Lunt
1519076597
Add Modeless MessageBox capabilities (#109)
As an example, when saving the state of an emulation, especially one
that has large image files and a large memory setting, there is a pause
between the time you choose a directory to save to, and the MessageBox
that states that the state was saved. During this time, there is no
indication that Bochs is doing anything. As far as the user is
concerned, Bochs froze.

So, this PR adds the capability to display a _Modeless_ message box. To
do so, at any point you need a message box shown, allowing other things
to continue to happen (SYNCHRONOUS), simply call the following line:
`void *hwnd = SIM->ml_message_box("Message Box Title", "Message Box
Text");`
Then after the task has been performed, remove the message box:
`SIM->ml_message_box_kill(hwnd);`

The function is implemented in all configurations via virtual calls,
however, the creation of the message box is currently only implemented
in the Win32 configuration. Other configurations will need this
implemented, though I do not have those configurations to test with,
except the text only config. I may get around to it :-).

This also currently only displays as the state is being saved. To
display when the state is being restored should now be a simple task by
adding the two lines shown above to the associated function.

The only drawback with this is that if the state is considerably small,
the save will take just a second or less. If so, this window will show
and then instantly be removed, possibly confusing the user. _What was
that!!_
2023-10-29 21:47:12 +01:00
Shwartsman
325fb4bfe0 Change current directory before restoring from path bugfix 2023-10-28 11:35:49 +03:00
Stanislav Shwartsman
49a6d5bf0c coding style, initialize variables right before their use
remove redunant const in function params
2023-10-22 22:14:52 +03:00
Shwartsman
daa0e4506d add more features to configure scripts in repo (they are used for building release)
add SVM, EVEX, CET

reduce compilation dependencies
remove paramtree.h from bochs.h so many modules won't include it anymore

indentation fixes
2023-10-16 16:40:05 +03:00
Benjamin David Lunt
e7910a30a0
Xhci options (#92)
This adds a "hint" to the xHCI port configuration "option" entries,
hinting that the port number must or must not be super-speed.
2023-10-15 21:47:24 +03:00
Benjamin David Lunt
cc6ac48d6c
Wider statusbar elements
With newer wider screens, we can now have wider statusbar elements so that an element such as "USB-HD" isn't clipped on both sides.
2023-02-10 21:17:21 -07:00