Commit Graph

2450 Commits

Author SHA1 Message Date
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
Volker Ruppert
d22cdbdbf7 Some work on the bxhub utility.
- Added DNS service support for the server "vnet" and connected clients.
- Added command line option "-loglev=" to control whether or not there is
  BX_ERROR, BX_INFO or BX_DEBUG output. Default value is 1 (BX_ERROR only).
2017-06-17 12:40:13 +00:00
Volker Ruppert
2ae5fd563e Added destructors to some networking modules and call fclose() there for the
case the logging feature is enabled.
2017-06-16 08:27:55 +00:00
Volker Ruppert
bdd8875692 Reverted BX_THREAD_KILL() changes in the lowlevel sound code. Now using control
variables again to let the threads end normally. Re-implenented the method
closewaveoutput() for some modules, move the destructor code to it and call it
after leaving the mixer thread. This fixes a deadlock in the "soundwin" module
if Bochs is compiled with plugin support.
2017-06-02 16:56:58 +00:00
Volker Ruppert
726e39f854 Some work on the USB device plugin code.
- usb_common: init_device() now splits device name and primary option before
  detecting device type.
- usb_hub: now completely handle port option in constructor.
- plugin.h: removed obsolete defines.
2017-06-01 20:04:10 +00:00
Volker Ruppert
1de56aa05e Fixed plugins case (unloading module). 2017-05-28 08:45:23 +00:00
Volker Ruppert
bd1eb0f862 Rewrite of the USB devices plugin code similar to the network driver code.
- Removed "pseudo device plugin" containing common code and all connectable
  USB devices.
- Moved USB device base class and module handling to the Bochs core.
  Now loading USB device plugins in usb_common.cc.
- Created separate plugins for each USB device implementation.
- Modified Bochs plugin system to support new plugin type PLUGTYPE_USBDEV.
- Added entries for the non-plugin case similar to the network and sound stuff.
2017-05-28 08:13:06 +00:00
Volker Ruppert
431e9671a6 Code cleanup: removed unused definitions, functions and statistics code not
required for the emulation.
2017-05-21 18:30:25 +00:00
Volker Ruppert
5db2596317 The resampler and mixer threads are now stopped with BX_THREAD_KILL(). 2017-05-21 15:08:20 +00:00
Volker Ruppert
c160fd4830 Bochs thread handling improvements:
- Modified win32 thread macros to use the handle instead of the id.
- Added new macro BX_THREAD_KILL to terminate threads.
Voodoo thread changes:
- Let the cmdfifo_thread sleep while the CMDFIFO is disabled.
- Kill the cmdfifo_thread in destructor and removed old thread control code.
2017-05-18 18:34:00 +00:00
Volker Ruppert
495a8afeac Voodoo2 bitBLT: optimized SGRAM fill code a little bit. 2017-05-17 21:21:53 +00:00
Volker Ruppert
9912c99fd2 Continued work on Voodoo2 support (some demos now working).
- Added capability to save/restore float type values in paramtree / siminterface.
- Added Voodoo2 triangle generator data to save/restore list.
- Implemented bitBLT function "SGRAM fill".
- Minor other changes and cleanups.
- TODO: remaining bitBLT functions, thread handling improvements.
2017-05-16 20:37:01 +00:00
Volker Ruppert
9a705a3369 Fixed Voodoo2 CMDFIFO write handling (check address range first). 2017-05-15 20:55:49 +00:00
Volker Ruppert
da489b91ce Implemented CMDFIFO type 3 data support using some pieces of code from file
voodoo.h.txt which was a part of the original voodoo patch for DOSBox.
Some Voodoo2 specific parts were not integrated in the main patch file. I guess
they have been removed since Voodoo2 support was incomplete (2D stuff missing).
TODO: Voodoo2 2D support (bitblt engine), more testing, code cleanup...
2017-05-15 19:15:55 +00:00
Volker Ruppert
6265976a2c Some work on the Voodoo2 CMDFIFO support.
- Added CMDFIFO thread similar to the sound output thread.
- split register write function in 2 functions: register_w_common() handles
  the CMDFIFO writes and valid registers in CMDFIFO mode. It forwards write
  accesses to other registers to register_w() (Voodoo1 and non-CMDFIFO mode).
  The CMDFIFO thread also calls register_w() when processing data.
- The CMDFIFO thread processes all data, but it does not yet execute type 3
  requests (extended triangle generator missing).
- TODO #1: implement Voodoo2 specific triangle functions (for CMDFIFO).
- TODO #2: implement 2D bitblt engine.
2017-05-14 15:53:29 +00:00
Volker Ruppert
19f6cbc519 Continued preparing Voodoo2 CMDFIFO support.
- Zero out voodoo device state in init().
- Added the CMDFIFO state to save/restore list.
- Added CMDFIFO register handling in read/write functions.
- Added new function cmdfifo_put().
- TODO: CMDFIFO thread.
2017-05-13 11:52:49 +00:00
Volker Ruppert
a575b4aa2f Some work on the Voodoo2 CMDFIFO code.
- Fixed normal register access in CMDFIFO mode.
- Implemented cmdFifoBaseAddr register behaviour.
- Write CMDFIFO data to FBI memory (has no effect yet).
- Changed some log messages to BX_DEBUG.
- Report unimplemented Voodoo2 registers.
- TODO: Add FIFO thread to process the CMDFIFO data.
2017-05-09 19:18:58 +00:00
Volker Ruppert
e956100a60 Fixed possible segfault in win32 gui when switching back from Voodoo to VBE or
Cirrus mode. Set font height to 0 in graphics modes and fixed argument order.
2017-05-07 14:52:37 +00:00
Volker Ruppert
eb89cdaea4 It is valid to set up the PRD size larger than the IDE transfer size. Fixed
busmaster DMA code to handle this case.
2017-05-07 07:47:08 +00:00
Volker Ruppert
78ff38fcf3 Fixed check for unimplemented CMDFIFO and return for now if write would be
valid. The hRetrace value can be set now, since Bochs no longer crashes.
TODO: Implement enough of the FIFO stuff to make the Win9x driver for the
Voodoo2 work.
2017-05-06 10:07:28 +00:00
Volker Ruppert
8b96faf99e Some work on the timing code of the Bochs display adapters.
- Voodoo: Use the VGA/Cirrus timers to drive the gui screen update.
  The vertical retrace emulation is still driven by a separate timer.
- VGA/Cirrus: Since we are using the virtual timer, we also have to read
  time_usec() from it.
- vgacore: removed unused timer methods.
2017-05-01 11:54:12 +00:00
Volker Ruppert
73c914a7f6 - Some work on the Voodoo Graphics emulation (Voodoo2 specific)
- prepared hRetrace value implementation (cannot be enabled yet, since the
    driver passes this test and gets confused in next stage (segfault).
  - Detect CMDFIFO access (not present yet).
  - Report disabling Voodoo graphics mode.
  - TODO #1: Fix Voodoo2 to make it usable.
  - TODO #2: Split update code and drive gui screen updates from the VGA timer
    (finally remove new realtime option again).
2017-05-01 09:11:12 +00:00
Volker Ruppert
d462e52a9d Implemented 'realtime' option for the Voodoo update timer similar to the VGA
realtime option (enabled by default).
2017-04-30 09:07:25 +00:00