Commit Graph

2151 Commits

Author SHA1 Message Date
Volker Ruppert
542e55a06b Method startwaveplayback() now completely replaced by set_pcm_params(). 2015-02-01 12:33:21 +00:00
Volker Ruppert
7dbb5185bf ALSA / OSS sound modules: startwaveplayback() rewritten to set_pcm_params()
and some related cleanups.
TODO: Replace startwaveplayback() completely.
2015-01-31 10:48:22 +00:00
Volker Ruppert
d2a85e576f Some work on the lowlevel sound code
- Moved audio buffer code and the pcm_callback function to soundlow.cc.
- Added framework for the mixer thread.
2015-01-30 22:52:56 +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
12d60f5aaf Some work on the lowlevel sound code.
- soundlow: prepared code for 2 pcm parameter sets:
            emulated: requested by sendwavepacket()
            real: used for the sound output
- soundsdl: startwaveplayback() rewritten to set_pcm_data().
- soundmod: some beep init code fixes.
2015-01-26 21:10:51 +00:00
Stanislav Shwartsman
b5a603c8c7 fixed %d->%u format found by cppcheck (patch by Maxim Derbasov) 2015-01-25 21:24:13 +00:00
Volker Ruppert
23ea69f1b2 Rewrite of the audio buffer handling and small code reorganization. 2015-01-25 20:03:11 +00:00
Volker Ruppert
10cf06afbd Added pcm format conversion support to the win32 and OSX sound modules.
Changed name of the pcm conversion method and minor cleanups.
2015-01-25 11:45:13 +00:00
Volker Ruppert
2c621601cb Moved wave format conversion code to the sound lowlevel base class and added
format conversion support to the ALSA and OSS sound modules.
2015-01-24 21:01:45 +00:00
Volker Ruppert
e37498025e Some small changes in the SDL sound module.
- Store conversion multiplier in the C++ class.
- Moved wave callback structure to soundlow.h for future use.
- Removed unused methods.
2015-01-23 19:10:49 +00:00
Volker Ruppert
add5b1e61d Some work on the Bochs sound support.
- OPL3: Added support to change the samplerate of the generator.
- SDL sound: convert wave packet to 16 Bit signed stereo format.
- Increased the maximum size of a single wave packet for playbck/recording.
2015-01-22 20:28:14 +00:00
Volker Ruppert
3dca0bd8cf Some work in the soundmod beep code and multithreading improvements.
- Beep thread now only started one per simulation.
- Added some more multithreading macros and use them in rfb, vncsrv and soundmod.
- TODO: implement mixer thread and remove beep thread.
2015-01-17 19:53:03 +00:00
Volker Ruppert
dd56a4d1d3 OPL3: improved save/restore support and added SVN Id line. 2015-01-16 18:55:25 +00:00
Volker Ruppert
cf888edf81 Removed most of the incomplete legacy FM OPL emulation part of the SB16.
Only keep the OPL timer code required for chip detection. Started implementing
save/restore support in the OPL3 code ported from DOSBox.
2015-01-15 20:25:27 +00:00
Volker Ruppert
fb265dc532 Ported OPL3 emulation from DOSBox.
The code currently only works with the SDL sound output module and at 44100 Hz,
with 16 bit stereo signed little endian format. FM volume control and
save/restore support are not implemented yet. The legacy code for generating
MIDI notes still works and will be removed when mixing support is implemented
in all sound modules.
2015-01-12 21:20:18 +00:00
Volker Ruppert
f9ff6ece2d Applied some parts of the floppy patch by Ben Lunt.
- The "Read ID" command must return an error when reading with non-existant head.
- Some BX_DEBUG improvements and minor other changes.
2015-01-12 18:52:39 +00:00
Volker Ruppert
fe49c73a6b Some work on the lowlevel sound support.
- Define new structure bx_pcm_param_t and use it as a parameter for the method
  sendwavepacket(). The method startwavepacket() is now called from
  sendwavepacket() in case of a parameter change (temporary solution).
- soundsdl: Replaced waveready() call by some more accurate code for buffer
            space check in sendwavepacket().
- soundsdl: Moved code for reading from audio buffer to a new function.
- soundsdl: Temporarily increase the audio buffer size.
- Preparing the SB16 code for the OPL emulation port from DOSBox.
2015-01-11 20:13:50 +00:00
Volker Ruppert
7bd5eeaa87 Mix the wave input using SDL_MixAudio() (addition and clipping).
NOTE: This function is not correct in case of more than 2 active sources.
2015-01-11 07:57:35 +00:00
Volker Ruppert
15ccdef0d1 Fixed register/unregister wave callback (found while testing OPL code). 2015-01-10 19:36:50 +00:00
Volker Ruppert
fe953485b1 Some more work in the lowlevel sound code.
- Reworked wave callback code to support 2 input sources (no mixing yet).
- Fixed SDL sound output.
- Beep generator fixes.
- Prepared the SB16 code for FM OPL output support (to be ported from DOSBox).
2015-01-08 19:12:01 +00:00
Stanislav Shwartsman
055da948a0 fixed problems found by cppcheck tool (patch by Maxim Derbasov) - second round 2015-01-07 16:17:40 +00:00
Volker Ruppert
2ca192eef7 Some more work in the lowlevel sound code.
- Renamed wavedata callback type.
- Handle sample rate in the beep generator (TODO: handle data format).
- Don't call waveready() in the SB16 code.
- Attempt to fix SDL2 wave output using SDL_LockAudio() / SDL_UnlockAudio().
- SDL specific code in the beep thread no longer needed.
2015-01-05 22:07:03 +00:00
Volker Ruppert
0c205fce26 Some work in the lowlevel sound code.
- Added framework for polling wave data and use it for beep output in sdl.
- Some work in the beep thread code (to be continued).
- Moved macros required for multithreading to bochs.h.
2015-01-04 21:12:41 +00:00
Stanislav Shwartsman
1f4d3e7194 fixed problems found by cppcheck tool (patch by Maxim Derbasov) 2015-01-03 13:53:52 +00:00
Volker Ruppert
c7c92bb62b Fixed OPL chip detection.
- Increment timer counter before checking for overflow.
- Implemented ISA bus delay in the pc_system code and use it for the SB16.
  This makes OPL chip detection work at ips values > 4 Mips.
TODO: OPL chip should use wave output instead of MIDI (maybe port from DOSBox).
TODO: Use isa_bus_delay() for other legacy devices if required.
2014-12-31 12:27:32 +00:00
Volker Ruppert
ee5a416228 Now build rules for all gui and device plugins supported by MSVC nmake depend
on the related configure options.
2014-12-28 19:13:02 +00:00
Volker Ruppert
65d2bb11eb Release all pressed keys when the Bochs window gets back the keyboard focus.
- feature implemented in the wxWidgets gui
- feature not required for legacy SDL (releases keys on focus change)
- removed duplicate code in keyboard.cc
- TODO: implement feature in the win32 gui if required
2014-12-27 09:43:05 +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
e5e535dad2 Fixed slirp compilation on OpenBSD.
TODO: fix slirp support compiled with VS2013.
2014-12-25 17:58:26 +00:00
Volker Ruppert
f0b38ff643 Restore VGA core before the PCI / VBE stuff to avoid crash due to wrong dimension. 2014-12-24 19:44:47 +00:00
Volker Ruppert
88d9ad57bf Attempt to fix the win32 raw serial receive support using a critical section
(untested - code should be enabled after successful testing).
2014-12-23 17:13:29 +00:00
Volker Ruppert
c3b025e224 Fixed possible crash when compiled with VS2013.
TODO: fix slirp support compiled with VS2013.
2014-12-22 14:26:47 +00:00
Volker Ruppert
2ec57b8a6b Fixed some more C++11 warnings. 2014-12-18 17:52:40 +00:00
Volker Ruppert
22665b3225 Re-enable "bulk I/O" repeat speedups extension that has been accidently disabled
about 3 years ago.
2014-12-16 02:26:55 +00:00
Volker Ruppert
3d228c4f61 Fixed some other overlapping memcpy() issues. 2014-12-16 02:26:00 +00:00
Volker Ruppert
f35b9b23c8 Bugfix: use memmove() if source and destination range can overlap (found with valgrind). 2014-12-14 18:53:16 +00:00
Volker Ruppert
c8ef526143 Fixed some warnings. 2014-12-01 17:06:00 +00:00
Volker Ruppert
fba9145f66 Moved sources of the sound lowlevel base class ('dummy' driver) to separate files. 2014-11-24 18:25:14 +00:00
Volker Ruppert
7330f3a61c Changed to way to determine the default lowlevel sound driver (part of the
mixing3.patch by Dawn Teschendorf).
2014-11-22 11:43:40 +00:00
Volker Ruppert
9805324c42 Minor changes in the sound lowlevel code. 2014-11-21 23:03:19 +00:00
Volker Ruppert
524ba46c3d Added the capability to select the operation mode of the VGA update timer.
The realtime mode is enabled by default (patch by Dawn Teschendorf).
2014-11-15 10:22:27 +00:00
Volker Ruppert
3a1bb1f476 Bugfix: sound driver 'sdl' wasn't available if Bochs was compiled with SDL2 gui.
FIXME: wave output doesn't work properly in case of SDL2.
2014-11-14 18:25:37 +00:00
Volker Ruppert
59f5a03af6 Rewrite of the virtual timer code to support both modes at the same timer.
The timers now have a new member 'realtime' and they are driven by the
selected engine. The VGA update timer and the status LED timer now always use
the realtime mode, but the PIT and CMOS RTC depend on the clock options.
2014-10-19 08:54:16 +00:00
Volker Ruppert
3393a17c8f Fixed crash when using a "fixed" type VPC image. 2014-10-14 21:39:05 +00:00
Volker Ruppert
63665aa773 Removed unused define.
TODO: improve virtual timer to make operate in both modes at the same time.
The vga update code should always use the realtime mode and the pit timing
should depend on the clock option.
2014-10-13 18:34:21 +00:00
Volker Ruppert
cebff45fef Fixed two fields in xmit_seg() 2014-10-13 17:09:14 +00:00
Volker Ruppert
bb1def0ad2 Fixed WinPCap function declaration and assignment for MSVC using CDECL and
now using typedefs similar to the niclist utility.
2014-10-04 17:31:57 +00:00
Volker Ruppert
c1e54bcfbf Added USB port specific option 'size' for VVFAT disks (range 128M ... 128G).
If the size is not specified or invalid, it defaults to 504M.
2014-09-29 17:48:30 +00:00
Volker Ruppert
d012670927 Applied the usb_xhci part of the USB patch by Ben Lunt.
Notes by Ben:
This emulates a NEC/Renesas uPD720202 2-port (2 socket, 4-port register sets)
Root Hub xHCI Host Controller.
Many, many thanks to Renesas for their work and effort in helping my research.

I have tested in with my own tests and WinXP Home Edition SP3.

Use port1 and port2 to emulate a Super-speed device, and use port3 and port4
to emulate Low-, Full-, or High-speed devices.

NOTE: The Windows driver for this device uses a proprietary detection
mechanism and we don't have the permission to implement it. That's why it only
works fine with non-Windows guests.
2014-09-28 14:21:22 +00:00
Volker Ruppert
b8a633d0db Setting cylinders to 0 fixes runtime connecting an USB disk with 'vvfat' mode
(disk size is always set to 504M / could be a vvfat specific option).
2014-09-25 19:31:01 +00:00