Commit Graph

160 Commits

Author SHA1 Message Date
Volker Ruppert
21fce8c2f2 Fixed compilation failure if ES1370 is enabled, but gameport disabled in config.h. 2017-08-04 18:09:26 +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
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
1ffac6a461 Moved method release_keys() to the common devices code to make sure this
feature also affects the removable (USB) keyboard.
2017-04-22 15:32:07 +00:00
Volker Ruppert
1d27d67ccd Added initial version of the High Precision Event Timer (HPET) ported from Qemu.
- Created framework based on our I/O APIC code and ported HPET core from Qemu
  with some required changes for the Bochs timer and IRQ handling.
- Enabled HPET-specific code in the ACPI and rombios32 sources and generated
  new ACPI table with iasl.
- The HPET device plugin is now always loaded if the i440FX chipset is selected
  (same as ACPI). We have to rethink this when we have implemented a more
  modern chipset.
- TODO: Rewrite of the virtual timer code for nanosecond support to make the
  realtime synchronization possible with HPET.
2017-04-17 07:26:00 +00:00
Volker Ruppert
89654a4beb Prepared devices and timer code for HPET support
- PIT / CMOS: added methods to control IRQ generation (for HPET legacy mode).
- Added method for activating timer with nanosecond value.
- Removed unused declaration in the keyboard code.
- TODO: virtual timer code also needs to handle nanosecond values.
2017-04-15 20:31:07 +00:00
Volker Ruppert
e023b5896f Partial rewrite of the optional keyboard handling. Now the BX_KEY_* events are
directly sent to the optional keyboard (USB keypad). It is now independent
from the legacy keyboard and the check for supported keys is simplified. The
legacy keyboard still receives the unhandled key event, but now sent from the
common devices code.
2017-03-31 21:32:58 +00:00
Volker Ruppert
c897ffa619 Cleanups in the Bochs system timer code
- Now using macro DEV_register_timer() in all devices and lowlevel modules.
- Removed unused timer stuff from the plugin.cc/.h code.
2017-03-30 18:08:15 +00:00
Volker Ruppert
880564f6ee Revoved obsolete macros and device stub methods. 2017-03-25 15:23:29 +00:00
Volker Ruppert
0ac2150920 Network and sound driver plugins are no devmodel devices. 2017-03-17 20:53:31 +00:00
Volker Ruppert
eeec43d811 Implemented self-registering static objects in the lowlevel sound code similar
to the network module handling. Now the 'dummy' sound driver can be a real
plugin, too.
2017-03-14 18:21:05 +00:00
Volker Ruppert
18e138b0b4 Fixes and improvements for the network plugins changes in previous commit.
- In "non-plugin" mode loading and unloading network module is not necessary.
  Now enabled loading for the plugin mode only and removed unloading function
  for that case. The "pseudo plugin" entries of the dummy entry points are
  necessary to make sure the self-registering network driver objects are not
  optimized out.
- slirp / vnet: Since the plugin init function is not called in non-plugin
  mode, revert the instance count init change.
- Fixed a makefile dependecy.
- TODO: Implement self-registering objects in the sound driver code.
2017-03-12 20:26:42 +00:00
Volker Ruppert
758f4de4d4 Rewrite of the network driver plugin code.
- Removed "pseudo device plugin" containing common code and specific drivers.
- Moved network module base classes and module handling to the Bochs core.
  Now loading network driver plugins in netmod.cc.
- Moved shared networking code used by the 'vnet' driver and 'bxhub' from
  netmod.cc/.h to new files netutil.cc/.h.
- Created separate plugins for each network driver implementation.
- Modified Bochs plugin system to support new plugin type PLUGTYPE_NETWORK.
2017-03-12 07:48:08 +00:00
Volker Ruppert
a5dc4b050c Fixed compilation with plugins enabled and removed obsolete declaration. 2017-02-24 20:02:18 +00:00
Volker Ruppert
0456c1034f Rewrite of the "no-plugins" code for loading/unloading gui, optional and sound
plugins. Now the plugin type is stored in the structure, so we need only one
array and one load function for plugins of these types.
2017-02-24 19:45:23 +00:00
Volker Ruppert
60d24943c6 Rewrite of the sound driver plugin code.
- Renamed OSS sound driver files from soundlnx.cc/.h to soundoss.cc/.h.
- Removed "pseudo device plugin" containing common code and specific drivers.
- Moved common sound code, base classes of sound drivers and the dummy driver
  to the Bochs core. Now loading sound driver plugins in soundmod.cc.
- Created separate plugins for the platform/library specific drivers and the
  "file" driver.
- Modified Bochs plugin system to support now plugin type PLUGTYPE_SOUND.
2017-02-20 18:21:19 +00:00
Volker Ruppert
f33093549b Modified plugin system to support the new PLUGTYPE_GUI.
- Changed the name of the entry point of the gui plugin code to
  lib{gui_name}_gui_plugin_init(). It is used when loading plugin with the new
  type. Added gui init code for the non-plugin version in plugin.cc.
- Some related changes for the "wx" case.
- The function load_and_init_display_lib() now only returns 1 on success.
- Minor other changes.
2017-02-18 16:28:04 +00:00
Volker Ruppert
458f747b48 Removed unused argc and argv parameters from plugin init functions. 2017-01-28 09:52:09 +00:00
Volker Ruppert
877118954c Plugin system cleanup
- Removed unused functions and declarations.
- Removed unused command line argument handling.
- TODO: Modify the "plugin_init" and PLUGTYPE_* definitions.
2017-01-13 18:09:51 +00:00
Volker Ruppert
0ba744b9fe Started implementing USB EHCI support. The PCI and MMIO register behaviour is
almost implemented, the port owner handling and the UHCI companion controllers
are present. High speed devices are not yet supported, since the EHCI scheduler
code has not been written yet (e.g. porting from Qemu). Low and full speed
devices should be detected correctly and work after port ownership change to
UHCI. 6 ports are available and the bochsrc syntax is similar to other HCs.
2015-12-06 20:03:42 +00:00
Volker Ruppert
327f987a18 Added the capability to set up the sound driver per service. The global
sound option for setting up one driver for all services is still available.
2015-03-06 22:54:30 +00:00
Volker Ruppert
16d2957cd4 Rewrite of the ES1370 wave output code and related changes.
- Implemented wave output using the 'soundfile' driver including dual wave
  output in wavemode 3. Removed now obsolete output file handling and other
  cleanups. The wave input (recording) feature is not affected by the
  wavemode setting.
- Moved VOC file handling to the soundfile code.
- Updated iodev makefile dependencies.
2015-02-19 21:31:18 +00:00
Volker Ruppert
b1e8a6369c Some work on the sound module handling and the SB16 midi file output.
- Added the capability to load up to 4 sound drivers and added methods to
  get pointers to the waveout, wavein and midiout services of a driver.
- Rewrite of the SB16 midi file output code. In midimode 2 and 3 the midiout
  service of the 'file' driver is used. Removed obsolete midi file handling.
- Re-implemented the closemidioutput() method to make runtime changes of the
  midi setup work with the new code.
2015-02-17 18:28:25 +00:00
Volker Ruppert
f19e91e2f5 Moved speaker beep generator to the speaker code. 2015-02-16 08:48:11 +00:00
Volker Ruppert
38f85eaacb PCM volume now applied to the output packet in the format conversion code. 2015-01-27 19:33:28 +00:00
Volker Ruppert
227da0c6de Release all pressed keys when the simulation window gets back the keyboard
focus. This change will fix some keyboard-related bug reports (DONE for the
x and sdl2 guis / TODO for all others).
2014-12-26 20:25:27 +00:00
Volker Ruppert
3c0ad43092 Continued preparing Bochs for SDL2 support
- added new symbol BX_WITH_SDL2 and prepared build system
- TODO #1: add new option --with-sdl2 to configure script
- TODO #2: add new file sdl2.cc (porting seems hard to do - writing from scratch
  might be better)
2014-06-23 19:37:58 +00:00
Volker Ruppert
773ac518b3 Fixed broken MSVC plugins support (many CDECL additions required)
TODO: check for remaining CDECL issues (hdimage mode 'dll') and update project files
2014-06-08 08:40:08 +00:00
Volker Ruppert
7cb5729365 Seek delay implemented for ATA/ATAPI DMA read commands
TODO: seek delay for write commands
2014-01-19 18:13:12 +00:00
Volker Ruppert
ea7997210d Some work on the wave volume control support
- ES1370: implemented CODEC registers (AK4531 mixer) and wave volume control
- Moved wave volume application code to new method pcm_apply_volume() and use
  it for both soundcards
- TODO: stereo support
2013-12-14 17:43:12 +00:00
Volker Ruppert
9a1d889359 ES1370: implemented wave output to file (raw and VOC format)
- added parameters 'wavemode' and 'wavefile' to the 'es1370' option
- ES1370: added new method sendwavepacket() (similar to SB16)
- moved VOC file methods from sb16.cc to soundmod.cc and added macros for them
- SB16: minor fixes
2013-07-13 17:37:48 +00:00
Volker Ruppert
192aa1f369 Added global sound control option in bochsrc and config interface
- added 'sound' option to select the driver and the wave output device
  (see bochsrc sample for details)
- the wave device option of sb16 and es1370 is now only used to set up the
  wave input device (if necessary)
- cleaned up the speaker code to initialize the 'sound' case correctly
2013-06-24 19:19:12 +00:00
Volker Ruppert
17b7b87a61 Added new experimental gui 'vncsrv" using the LibVNCServer library. It supports
higher resolutions and > 8 bpp graphics modes. The RFB gui with limited
capabilities is still available.
TODO:
- fix random segfaults in dimension_update()
- Windows (MinGW) support
- fixes for clients not supporting 'rfbEncodingNewFBSize'
- fix cursor shape after dimension update()
2013-05-30 17:18:30 +00:00
Volker Ruppert
2ea45c0e4d implemented volatile BIOS memory write support (controlled by PIIX/PIIX3 XBCS register) 2012-12-02 19:59:23 +00:00
Volker Ruppert
2f036fe5ca added IOAPIC control from the PIIX3 (enable /disable and address relocation) 2012-11-25 19:06:03 +00:00
Volker Ruppert
f0a3679e34 moved function is_pci_device() to the siminterface class 2012-11-11 12:21:09 +00:00
Volker Ruppert
ab57eb3615 fixed compilation error with debugger enabled
- read PCI confAddr value from the devices code for debugger output
- PCI confData value isn't needed at all (changes by each read / write access)
- PCI framework methods don't need to be virtual
2012-11-09 13:30:52 +00:00
Volker Ruppert
46d09f3852 moved PCI framework to the common devices code
- PCI slot configuration, memory and i/o BAR registration, PCI i/o space
  handlers now present in devices.cc
- configure: E1000 emulation and USB support need PCI
- vga: fixes for the non-PCI case
2012-11-08 19:12:26 +00:00
Volker Ruppert
4bc41a51e6 - removed unused declarations 2012-11-03 23:18:14 +00:00
Volker Ruppert
9933ffa3d9 vga refresh framework changes
- renamed trigger_timer() methods to refresh_display()
- new argument 'redraw' added to force a refresh of the entire screen
  (used in snapshot mode)
- siminterface method refresh_vga() now checks if the Bochs gui init is complete
- use SIM->refresh_vga() in some more cases
2012-10-28 08:23:39 +00:00
Volker Ruppert
4eae421272 Graphics snapshot feature re-implemented for the new graphics API
- graphics_tile_info() split into a common and specific part
- store snapshot mode in structure bx_svga_tileinfo_t
- in snapshot mode, display adapters copy raw data to buffer
- rewrite of the trigger_timer() code to make it work in all cases
- added new class bx_nonvga_device_c to make forwarding refresh requests to the
  Voodoo adapter possible
2012-10-25 15:53:04 +00:00
Volker Ruppert
1fd6745aea Started rewrite of the gui code to make the graphics snapshot independent from
the display adapter code. When ready, the common gui code should handle it
completely. The snapshot handler should set a flag 'snapshot_mode' and then it
should force a display update. The graphics update code should be redirected to
some code that 'draws' to a snapshot buffer. These first steps are done:

- store some guest display settings in the gui code (text / graphics switch,
  x / y resolution and bpp)
- split 8 bpp palette update code in a common and a specific part and store the
  palette values in the gui code
2012-10-14 18:29:44 +00:00
Volker Ruppert
5f5d8e2c33 Applied initial version of the 3dfx Voodoo Graphics emulation. The Voodoo core
is based on a patch originally designed for DOSBox. Currently only the Voodoo1
adapter model can be emulation. The emulation is currently slow, but we intend
to clean up and optimize the code. Running the 3D engine in a separate thread
is also planned. To compile with Voodoo support the configure option
"--enable-voodoo" must be used. Then the device can be activated with
"plugin_ctrl: voodoo=1" in bochsrc or on the command line. The device will be
assigned automatically to a PCI slot unless you do that manually. A specific bochsrc
option to select the adapter model will be added when the code has support for it.
2012-09-14 21:50:50 +00:00
Volker Ruppert
9189105a0b - prepared support for sending absolute x/y values from the gui to the mouse emulation
- new gui method set_mouse_mode_absxy() should switch the gui to absolute
    x/y mode
  - new DEV_mouse_motion() argument 'absxy' indicates whether or not the gui
    sends absolute x/y values
  - USB tablet code prepared to use the new feature
  - TODO: implement this feature for each gui (sdl, win32, wx, x, ...)
2012-06-21 17:33:37 +00:00
Volker Ruppert
d6e7be922b - prepared pc speaker beep support in the lowlevel sound module
- sound devices: moved wave output init to the init() method (required for
  beep support)
- TODO: implement beep using a separete thread
2012-05-20 14:19:49 +00:00
Volker Ruppert
f65c4e66b8 - debugger command 'info device': implemented support for additional arguments
- ne2k: replaced debugger command 'info ne2k' completely by a new version based
  on 'info device' with additional arguments and removed all of the now obsolete
  stuff (ne2k device stub, macro for print_info())
- pci: added option 'dump=full' for the debugger command 'info device' to show
  the whole PCI config space
- TODO: some other devices could have support for additional options in
  debug_dump()
2012-04-23 17:06:19 +00:00
Volker Ruppert
bdfe4ae1bb - added debug_dump() (prints the same as 'info ne2k' without arguments)
- removed FILE parameter from print_info() (unused - since dbg_printf() doesn't
  need it)
- converted tabs to spaces
- TODO: implement 'info device' with optional arguments to get rid of the
  print_info() method
2012-04-18 17:03:00 +00:00
Volker Ruppert
086266d033 - implemented new debugger command 'info device [string]' that shows the state
of the device specified in 'string'. Added register mechanism and chained
  list to store the device name and pointer. Replace hardcoded debug info
  implementations for pic, pci and vga by the new one.
- TODO #1: improve existing debug_dump() output and add more devices
- TODO #2: add support for additional arguments and replace the NE2k print_info()
2012-03-10 17:14:07 +00:00
Volker Ruppert
8ada8d66ff - simplyfied unloading of core plugins 2012-02-12 08:37:42 +00:00
Volker Ruppert
825edc4c64 - blinking in VGA graphics mode implemented (undocumented feature???)
- prepared function to override the VGA output (stops the update timer)
- minor cleanups the update() code
2012-01-27 18:50:07 +00:00