Commit Graph

2472 Commits

Author SHA1 Message Date
Volker Ruppert
c81df659c1 Some work on the Voodoo Banshee BitBlt code.
- Implemented ternary raster operations. With 3 binary input values we have 8
  possible combinations und the ROP code is the binary representation of the
  result table. Instead of implementing cascades of binary operations at byte
  level, we simply build a 3-bit value from D, S and P. This is the bit number
  of the ROP code to use as the result. This is performed for each bit of color
  data. We still keep the existing binary operations at byte level, since the
  code is faster for that case.
- Inplemented the "row #0 only" flag handling in pattern fill operations. This
  flags seems to have an undocumented effect on the source pitch of
  host-to-screen operations. This issue needs to be investigated.
- TODO: Some bits of the srcXY register seem to have an undocumented effect on
  host-to-screen operations, too.
2017-11-15 22:13:37 +00:00
Volker Ruppert
7ad81ace40 Some work on the Voodoo Banshee emulation.
- Added basic support for the tiled desktop space. Win95 now starts building
  the desktop, but without icons and it is not yet usable in 16 bpp mode.
- Fixed 32 to 24 bpp format conversion in host-to-screen operations.
- Fixed some raster operations.
- Now allocate buffer for launch area writes dynamicly.
- Added error messages for undocumented features.
2017-11-12 18:27:39 +00:00
Volker Ruppert
49885211ad Unified screen update code of all Voodoo models and prepared Voodoo 1/2 for
tile-based updates and screen update locking. Some related changes in the init
and save/restore code are also included. The main update code has been moved
from bx_voodoo_vga_c to bx_voodoo_c and the required parameters are set up
depending on the model. The BX_LOCK/BX_UNLOCK and SET_TILE_UPDATED stuff still
needs to be added in the 3D core. Currently a redraw_area() hack makes the
Voodoo 1/2 screen updates work as expected.
2017-11-09 17:58:53 +00:00
Volker Ruppert
b25ec2adcf Some work on the Voodoo Banshee emulation.
- Fixes and optimizations in the BitBlt code.
- Added mutex for display updates and lock some register writes and the BitBlt
  methods during screen update.
- Improved some debug messages.
TODO: Use the render_mutex for the Voodoo1/2 update code, too.
2017-11-07 22:07:39 +00:00
Volker Ruppert
205ac13582 Some work on the Voodoo Banshee emulation. Win95 with Banshee driver is now
almost usable in 8 bpp mode, but there are still issues (see below).
- Added basic support for pattern fill functions.
- Added some more ROPs (all S/D and P/D ones).
- Now using the ROP functions in rectangle, pattern and host-to-screen code.
- Several other related changes.
TODO:
- Implement remaining binary (P/S) and all of the ternary ROPs.
- Some Windows icons are still black or messy (e.g. start button) and screen
  are missing in some cases. Shutdown background is wrong, although the correct
  ROP is used.
- Cleanups and optimiations when the code is known to work as expected.
2017-11-06 17:01:30 +00:00
Volker Ruppert
ca9120655b Some work on the Voodoo Banshee emulation.
- Moved basic BitBlt stuff from the Cirrus code to a separate header file to
  make it usable for the Voodoo Banshee, too.
- Rewrite of the screen-to-screen BitBlt code for the new ROP code.
- Calculate redraw parameters based on the screen start.
- Set "Banshee busy" bit in the status register when 2D is busy.
- Added some error messages for unimplemented features.
2017-11-04 23:43:38 +00:00
Volker Ruppert
b1aefb0b6c Some work on the Voodoo Banshee emulation.
- Host-to-screen and screen-to-screen copy operations implemented (ROP 0xcc).
- Rectangle fill command now handles clipping.
- Attempt to fix the redraw_area() location after bitblt operations.
- Update the host palette entries when writing to CLUT (fixes screenshot).
- Added 2D register names for debug messages.
2017-11-01 21:32:41 +00:00
Volker Ruppert
815b8238c7 Some work on the Voodoo Banshee emulation.
- Fixed hardware cursor bottom/right edge display bug.
- Started splitting 2D code in different methods (no functional changes).
- Added hardware cursor to save/restore list.
TODO #1: Implement bitblt engine similar to the Cirrus one.
TODO #2: Voodoo code reorganization: base class with Voodoo core, one subclass
         for Voodoo1/2 and one for Banshee.
2017-10-31 22:58:10 +00:00
Volker Ruppert
78ef782b38 Some work on the Voodoo Banshee emulation.
- Added CMDFIFO extensions (CMDFIFO #1 still unhandled).
- Fixed voodoo plugin compilation on Windows.
- Fixed an MSVC warning.
2017-10-31 11:43:28 +00:00
Volker Ruppert
dcbca35ac7 Voodoo Banshee hardware cursor implemented. 2017-10-30 23:03:26 +00:00
Volker Ruppert
13d4f0ff65 Some work on the Voodoo Banshee emulation. Win95 boots now with Banshee driver
in 8 bpp mode, but it's not yet usable (no cursor, no text). List of changes:
- Added AGP/CMD/Misc register handling (CMDFIFO #0 is now usable).
- Started work on 2D register handling ("Rectangle fill" command implemented).
- Added Banshee specific code in redraw_area().
- Writing to VGA DAC registers also modifies the Banshee CLUT.
- Banshee now indicates that no TV-out and video-in device is connected.
- Some other related fixes and improvements.
2017-10-29 21:25:37 +00:00
Volker Ruppert
d7ab113a95 Improved video clock handling for the retrace timing emulation.
- Added VCLK array and removed hardcoded values.
- Added new method get_crtc_params() to retrieve htotal and vtotal values.
- Cirrus: Set up VCLK registers with default on reset (TODO: VGABIOS should do
  that when setting video mode).
- Voodoo Banshee: Set up VCLK #3 when writing to pllCtrl0 register. VCLK #0 and
  #1 are VGA compatible and VCLK #2 is fixed 50 MHz. Fixed maximum resolution
  based on PLL section of the spec.
2017-10-27 18:49:19 +00:00
Volker Ruppert
7bd6e6c7c2 Removed all of the pre-defined rasterizer functions and replaced it by a single
function. I guess the old stuff should be a speed optimization, but I don't see
a difference with the new code. The simulation output is also still the same.
Now Bochs compiles much faster with Voodoo support enabled and the binary is
much smaller. This patch has been written by Luigi B.
2017-10-23 20:01:25 +00:00
Volker Ruppert
e2245d98d3 Some work on the Voodoo Banshee emulation.
- Banshee Memory layout implemented (AGP/misc and 2D register behaviour not
  implemented yet). Now Win95 with Banshee driver can boot in standard VGA mode.
- Fixed memory allocation: Banshee has 16 MB shared LFB / TMU memory.
- Some work on save/restore support.
- Renamed Banshee VGA register handlers.
2017-10-23 18:45:16 +00:00
Volker Ruppert
539356ac13 Some changes and comments in the xHCI code by Ben Lunt. 2017-10-22 14:30:04 +00:00
Volker Ruppert
1b8c58ed58 Some work on the Voodoo Banshee emulation.
- tile-based VBE graphics updates implemented
- "half mode" support added (line doubling for low resultions)
- change screen resolution only after re-enabling the video processor
2017-10-22 12:16:20 +00:00
Volker Ruppert
26c6c3bfca Moved macros SET_TILE_UPDATED and GET_TILE_UPDATED to vgacore.h to reduce code
duplication.
2017-10-22 10:09:32 +00:00
Volker Ruppert
35684fa0f5 Started implementing the Voodoo Banshee display adapter based on the existing
"Voodoo VGA" framework. Most of the work is still to do.
- Added Banshee specific PCI write handler and related stuff. The device is
  initialzed properly by the Bochs BIOS (mem, lfb, rom and i/o).
- With Banshee specific VGA BIOS it passes the init stage and boots properly
  to DOS. Parts of the init code coming from file "voodoo.h.txt" (part of the
  original patch).
- Standard VGA modes are all usable (using the Bochs VGA core).
- VBE graphics modes with 8, 16, 24 and 32 BPP are usable (VBE drawing code is
  mostly copy&paste from the Bochs VBE code. DAC 6/8 bit switch is present.
- TODO list:
  - Voodoo Banshee memory layout (registers, 2D, 3D, LFB, textures)
  - 2D graphics engine must be written from scratch
  - interaction between new device and existing 3D core
  - non-VGA mode (Voodoo model "banshee" without VGA extension "voodoo")
  - save/restore support, move Banshee stuff to separate file, ...
2017-10-21 12:46:17 +00:00
Volker Ruppert
184324c8e8 Some small fixes in the display adapters code.
- Fixed missing bx_gui->flush() call after non-VGA update().
- Fixed a BX_DEBUG message in the Voodoo code.
- Re-define LOG_THIS for messages in the "Voodoo VGA" code.
2017-10-14 11:15:00 +00:00
Volker Ruppert
2b91dabfe5 Added new VGA extension choice "voodoo" to test the new VGA extension code. It
currently only implements an ISA standard VGA adapter with the selected Voodoo
model as it's extension. The methods of the "Voodoo VGA" device only call the
required methods of the Voodoo or VGA core.
TODO: Start implementing the Voodoo Banshee chipset based on this code.
2017-10-12 19:34:58 +00:00
Volker Ruppert
5ec78eaae2 Modified VGA extension init method. Now it returns 1 if the extension code has
initialized the VGA compatible video memory. If it has returned 0 the VGA core
code sets up the default VGA memory (256k).
2017-10-12 19:18:23 +00:00
Volker Ruppert
d25e85c21a Preparing improved VGA extension support and some VGA / Cirrus cleanups.
- Treat VGA extension name other than "none", "vbe" or "cirrus" as a VGA
  compatible device plugin and try to load it.
- Added new plugin type PLUGTYPE_VGA for such a plugins (interally handled like
  a core plugin).
- Added panic in devices init for the case no VGA compatible plugin is present.
- Added new method vga_redraw_area() that handles the non-VGA and null size
  case. The specific method redraw_area() is called otherwise.
- Moved init_systemtimer() call from extension code to init_standard_vga().
- TODO: Implement VGA subsystem in the Voodoo code to test the new feature.
  Voodoo Banshee 2D accelerator code needs to be written to make this really
  useful.
2017-10-10 18:06:16 +00:00
Volker Ruppert
6dba96d10a Some changes related to the PCI ROM handling.
- Added support for setting memory write handler to NULL (ROM case).
- Added new PCI device method after_restore_pci_state(). It currently handles
  the PCI ROM case only (could be extended).
2017-10-08 15:54:21 +00:00
Volker Ruppert
610cec209d Rewrite of the VGA/Cirrus code to reduce code duplication.
- Moved VGA timer handler to the VGA core and handle the non-VGA case there.
  It calls the specific update() code and finally bx_gui->flush().
- Moved the VGA update frequency parameter handler and the refresh_disply()
  method to the VGA core.
- Store the VGA extension parameter in the VGA core.
- Voodoo: Fixed graphics snapshot.
2017-10-08 07:55:04 +00:00
Volker Ruppert
ebbd952d3b Code cleananup: Since the Cirrus plugin device is only loaded in case the
VGA extension "cirrus" is selected, there is no need to check this parameter.
TODO: Implement new VGA extensions (e.g. Voodoo Banshee, Voodoo3).
2017-10-07 08:49:05 +00:00
Volker Ruppert
0311f47bc3 Moved all Bochs event / wait functions required for multi-threading to a new
file called "bxthread.cc".
2017-09-14 16:18:12 +00:00
Volker Ruppert
c889fcae87 Some improvements in the Voodoo2 CMDFIFO code.
TODO: Check whether or not there are still simulation freezes caused by CMDFIFO.
2017-09-12 16:29:02 +00:00
Volker Ruppert
b61b9d255a Moved all Bochs multi-threading definitions from bochs.h and osdep.h to a new
file called "bxthread.h".
2017-09-10 15:55:13 +00:00
Volker Ruppert
ad9f1c3417 Moved event / wait stuff from the Voodoo code to osdep.cc fot the usage in
other parts of Bochs.
2017-09-10 06:50:07 +00:00
Volker Ruppert
da48346f9d Implemented combined PCI / memory FIFO. This is required for running Voodoo1
games / demos correctly on the Voodoo2 model. I noticed a small slowdown
(2 or 3 percent) on the Voodoo1.
2017-09-08 16:17:20 +00:00
Volker Ruppert
c1d5947a80 Memory FIFO fix: 16-bit write support for the FBI video memory was missing. 2017-09-03 20:51:37 +00:00
Volker Ruppert
e063d282ac Voodoo2 CMDFIFO fix and cleanup.
- Fixed probing the CMDFIFO with Voodoo output disabled (send FIFO wakeup
  directly, otherwise driven by vertical retrace).
- Use the CMDFIFO member 'enabled' instead of reading the fbiInit7 register bit.
- TODO: The Voodoo2 freeze when testing a Voodoo1 demo is still not fixed.
2017-09-03 17:32:49 +00:00
Volker Ruppert
7c3dafc7f5 Some Voodoo emulation fixes.
- voodoo_init() must be called after initializing FIFO mutex.
- The 'op_pending' counter must be reset after resetting FIFOs.
- Fixed an MSVC warning and removed obsolete comment.
- FIXME: There are still some conditions that can freeze the Voodoo display.
2017-09-03 08:28:16 +00:00
Volker Ruppert
1f85292418 Implemented memory FIFO to speed up the Voodoo1 emulation. The PCI FIFO with
it's 64 entries is still not present, since it makes the emulation a few
percent slower due to the overhead of the FIFO code. The memory FIFO has 64k
entries and makes a speedup of around 75 % possible.
2017-09-01 17:30:49 +00:00
Volker Ruppert
ea8bfca53f Two USB modifications requested by Ben Lunt.
- usb_msd.cc: The Device Qualifier is valid for high speed devices only.
- uhci_core.cc: Don't report BX_DEBUG message if the current TD belongs to an
  async operation that is still not complete.
2017-08-26 08:10:21 +00:00
Volker Ruppert
bd40347963 Store FIFO presence in variable "enabled" and report the state change of the
currently unimplemented FIFOs.
2017-08-24 21:08:21 +00:00
Volker Ruppert
680189a548 Fixed Voodoo pixel clock calculation.
- Now using float type for the 'clk0_freq' variable.
- DAC register 6 can switch to half pixel clock (ported from PCem).
- Writing value 0xf8 to PLL register 0x0e completes clock #0 setup.
2017-08-21 19:33:29 +00:00
Volker Ruppert
4e80e2fbfc Started preparing the Voodoo code for the PCI FIFO / memory FIFO implementation.
- Initialize the thread and event stuff for both Voodoo models.
- Rewrite of the event handling code to manage different events.
2017-08-20 20:25:45 +00:00
Volker Ruppert
e187f3907a Removed Voodoo realtime option. Since the gui screen update timing is now
controlled by the 'vga' option and Voodoo2 CMDFIFO thread has the best
performance with realtime mode disabled, this option is now obsolete.
2017-08-18 15:19:30 +00:00
Volker Ruppert
9a1668ac36 First version of the Voodoo2 CMDFIFO thread using "pthread cond" code on
non-WIN32 platforms instead of BX_MSLEEP(). The donut demo is once again a
little bit slower, but on other tests the IPS values are still okay. Cleaned
up the code a little bit and added save/restore stuff for the new code.
2017-08-17 19:15:02 +00:00
Volker Ruppert
6361386e8b Reverted BX_LOCK/BX_UNLOCK changes from previous commit (don't lock CMDFIFO
completely while running cmdfifo_process()). The donut demo is now a little bit
slower on Linux host, but other test cases are faster again.
2017-08-17 17:15:12 +00:00
Volker Ruppert
fcb5f6d1d3 Voodoo2: Now only start processing of the CMDFIFO at the vertical retrace.
I noticed a speed improvement of around 10 % (tested with donut demo only).
2017-08-15 21:30:45 +00:00
Volker Ruppert
593141603d Small change in the non-WIN32 Voodoo2 thread code: Process all complete command
packets and then always sleep for 1 millisecond.
TODO: The first tests with pthread_cond_* stuff showed a slowdown of approx.
10 % compared with the IPS value of the current code.
2017-08-09 15:42:34 +00:00
Volker Ruppert
3cee1f74ee Now using WIN32 event / wait functions in the Voodoo2 thread. I noticed a speed
improvement of around 10 % (tested with donut demo only).
TODO: Use similar functions of the pthread library for improvements on other
platforms.
2017-08-08 18:23:12 +00:00
Volker Ruppert
ca3758423b Fixed some MSVC warnings. 2017-08-06 18:35:37 +00:00
Volker Ruppert
18dc09aaad Fixed possible CMDFIFO failure. 2017-07-18 18:03:16 +00:00
Volker Ruppert
7b5eca0cf2 Minimal improvement in the CMDFIFO code: calculate needed depth for current
command and execute it when there is enough data present (code partly ported
from voodoo.h.txt).
TODO: Use "wait for event / condition" functions instead of msleep() if there
is a performance improvement with it.
2017-07-17 18:07:28 +00:00
Volker Ruppert
2b92978728 Fixed save/restore failure. 2017-07-12 21:01:58 +00:00
Volker Ruppert
bc82bf9316 Removed unnecessary include. 2017-06-28 15:34:34 +00:00
Volker Ruppert
17abf11e85 Check requested maximum DHCP message size and report if invalid (networking
modules vnet / socket only).
2017-06-18 15:54:54 +00:00