Commit Graph

2963 Commits

Author SHA1 Message Date
Volker Ruppert
aa23a09afd VGA mem_write(): moved and fixed CGA specific code.
Removed disabled BX_DEBUG code and VGA_TRACE_FEATURE symbol.
Some other small fixes and cleanups.
TODO #1: review MAP13 addressing in case start address > 0.
TODO #2: review chain4 code in medm_write().
2023-12-26 11:16:59 +01:00
Volker Ruppert
de4876e2c4 VGA mem_write(): in text mode don't mark graphics tiles for update.
TODO: Check special cases code in mem_write() for correctness.
2023-12-25 21:03:53 +01:00
Vort
aed0c5e954
Prevent output of fraction of sample (#193)
Fixes #134.
2023-12-25 12:00:31 +02:00
Volker Ruppert
8a4941f670 Some cleanups in the recently fixed code. 2023-12-24 14:41:47 +01:00
Volker Ruppert
e3eb603ad4 Some fixes for the VGA mode 0x13 (issue #188 and discussion #108).
- Shift start address by 2 in update() code and mem_write().
- Added split screen support for this mode.
- Some code cleanups.
2023-12-23 21:37:08 +01:00
Volker Ruppert
b63b1225a8 Fixed backward screen-to-screen copy operation for > 8 bpp modes. 2023-12-21 10:53:13 +01:00
Vort
75ea1c2222
Prevent crash in get_retrace (#185)
Fixes #184.
2023-12-20 13:35:51 +02:00
Vort
ee528baa03
Expand maximum resolution for Banshee and Voodoo 3 from 1600x1280 to 1920x1440 (#175)
Fixes #174.
2023-12-16 16:51:18 +02:00
Shwartsman
cd350d8548 adopting hack listed in https://github.com/bochs-emu/Bochs/issues/147 to solve hang 2023-12-16 08:45:53 +02:00
Vort
02704120a3
Implement Voodoo 3 writes with length 8 (#173)
Fixes #172

Co-authored-by: Stanislav Shwartsman <stlintel@gmail.com>
2023-12-16 08:28:59 +02:00
Shwartsman
0fbf559276 fix bx_banshee_c::mem_read unknown access length warning 2023-12-16 08:24:08 +02:00
Shwartsman
e67fb33443 fix potentially un-initialized value warning 2023-12-15 22:49:34 +02:00
Shwartsman
438fd787c3 attempt to warn (BX_ERROR) for unsupported read/write size 2023-12-15 22:31:49 +02:00
Vort
30db11d271
Fix memory corruption when reading Voodoo ROM (#169)
Fixes #131.
2023-12-15 22:24:57 +02:00
Volker Ruppert
5fec28cb17 Partly fixed display errors found in game Prehistorik 2 (issue #166).
- Fixes in MAP13 disabled mode (VGA mode 6): half dot clock, color support
- Modified method get_vga_pixel(): now using row start address as an argument
2023-12-13 17:15:09 +01:00
Volker Ruppert
7641d13614 E1000: Added support for i/o mapped register access to make DOS driver work. 2023-12-11 21:21:34 +01:00
Volker Ruppert
54aeba83d3 Moved CMOS image runtime options setup to cmos.cc. 2023-12-05 18:16:24 +01:00
Volker Ruppert
7fcf4a419a Added support for saving CMOS image at runtime.
- Added CMOS image options to runtime menu (except RTC init).
- Fixed default size of Bochs CMOS RAM (s.max_reg).
- Fixed bochsrc parse to make 'rtc_init' parameter work.
- In textconfig now using SERIES_ASK for CMOS image options.
2023-12-04 20:39:24 +01:00
Volker Ruppert
c8b370d206 Added split screen support to the 256-color VGA mode called "modeX". 2023-12-03 19:42:05 +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
fcea81a042 fixed compilation in cmos.cc 2023-12-02 08:43:56 +02: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
Shwartsman
4de6c097a4 use true/false instead of 0/1 for boolean variables
cleanups in code
2023-12-01 23:01:11 +02:00
Stanislav Shwartsman
9a5dfb10c1 fixed 'misleading indentation' warning
move variable definitions closer to their use
2023-11-27 19:05:12 +02: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
d63e048ec6 Memleak fix: IRQ handler names were not deleted on simulation exit. 2023-11-26 10:43:15 +01:00
Volker Ruppert
c525d9e5fc Consider half dot clock for h-panning (final fix for issue #114). 2023-11-24 23:08:17 +01:00
Volker Ruppert
68ff4be0b8 Fixed a memory leak in the slirp code. 2023-11-24 22:35:43 +01:00
Volker Ruppert
a2f7562b30 Fixed two memory leaks in the Voodoo code. 2023-11-24 21:47:41 +01:00
Shwartsman
7f04cfd8df fix for gcc warning 2023-11-24 19:30:00 +02:00
Volker Ruppert
99629f9207 Horizontal pixel panning implemented in VGA graphics mode.
This change should fix issue #114.
Added BX_ERROR for two other unimplemented features.
2023-11-24 16:54:15 +01:00
Volker Ruppert
e9cd258882 Fixed ATAPI device reset.
Clearing 'seek complete' bit makes some MS-DOS work again.
2023-11-24 14:43:52 +01:00
Volker Ruppert
32b8edafc5 Fixed some gcc 13.2 warnings. 2023-11-23 20:06:07 +01:00
Benjamin David Lunt
eae6bf9396
Close cdrom image file on eject (#145)
The WIN32 configuration for the cdrom was not closing the image file on
eject. This left the handle open while Bochs was running, not allowing
the image file to be modified.
2023-11-23 08:40:39 +02:00
Shwartsman
f47ed2a5f7 fixed one more gcc warning 2023-11-21 16:12:53 +02:00
Shwartsman
d39c93a3c6 fixed 'misleading indentation' warning and also make statement more clear 2023-11-21 16:11:48 +02:00
Benjamin David Lunt
01a262306f
Improved and enhanced the floppy emulation (#135)
This improves and enhances the floppy emulation.
This adds the ability to specify a controller type.
This adds all but one, known, controller command.
This fixes the format command. Issue #123 
This fixes the error with older Windows guests.
2023-11-21 09:35:07 +02: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
eec7a55c46 Fixed another gcc 13.2 warning (overloaded virtual). 2023-11-16 19:47:59 +01:00
Stanislav Shwartsman
a9d07b5a51 coding style, move variables definition closer to its use, use constants instead of defines 2023-11-14 20:14:38 +02:00
Benjamin David Lunt
a354d9aecc
fix ISO status change events (#125)
This allows you to change the CD-ROM via the Bochs Ribbon, as well as
properly "ejecting" a CD from the guest.
Before the CD path would change, but the guest (tested with WinXP and
DOS as guests) would not see the change.
This fix simulates an open tray and then a closed tray for all CD
changes.
2023-11-08 08:16:52 +02:00
Stanislav Shwartsman
6655fa9a41 fix assertion I added in virt_timer.cc 2023-11-08 07:10:19 +02:00
Volker Ruppert
fcaccf0585 Fixed two format warnings. 2023-11-07 22:48:33 +01:00
Shwartsman
5bb77620c3 coding style and #define cleanups
avoid using ull modifyer for consts, use BX_CONST64() instead
move definitions from header file to cpp file when possible
add 'const' modifyer for obviosly const methods and pointers
2023-11-05 15:37:39 +02:00
Volker Ruppert
83c71dd7a2 Renaming method fixes gcc 11 warning (overloaded virtual). 2023-11-05 11:01:41 +01:00
Shwartsman
7290fb1231 simplify code in bx_virt_timer_c::timer_handler + add assert 2023-11-04 14:50:56 +02:00
Volker Ruppert
828da97aa5 Attempt to fix issue #40 using calculated size for 'first_sectors' buffer insted of hardcoded value. 2023-11-01 09:38:05 +01:00
Benjamin David Lunt
586443f1ea
usb_ehci log fix (#116)
Simply change two BX_INFOs to BX_DEBUGs to keep from over populating the
log file.
2023-10-31 06:33:14 +02:00
Stanislav Shwartsman
8cc85b1133 fixed compilation warnings from CI/DI on github 2023-10-29 23:39:32 +02:00