1
0
Fork 0
Commit graph

4075 commits

Author SHA1 Message Date
krcroft
5a9dd2866b
Refactor and pass-through the decode buffer 2019-11-11 13:27:19 -08:00
krcroft
83e1979f26
Eliminate buffers, conversions, and unused code 2019-11-11 13:20:11 -08:00
David Reid
3d8dceee57
Bump dr_mp3 codec to v0.5.2 2019-11-11 13:16:22 -08:00
Peter Veenstra
92da7c45ef Switch to a different way to calculate the table offsets. Thanks jmarsh
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4282
2019-11-11 17:23:05 +00:00
Peter Veenstra
8f3474ecfd Make it possible to compile without CoreMIDI and CoreAudio on Mac OS X using a non-Apple compiler. Give some feedback to user in this case. (modified version of patch by krcroft with input from jmarsh, Dominus and Qbix)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4281
2019-11-10 14:50:11 +00:00
Patryk Obara
fe7600baa9 Merge branch 'svn/trunk' r4280 2019-11-07 15:12:51 +01:00
Peter Veenstra
a2e7d257e5 GenerateDMASound can generate sound even with input size is 0, so lets not do that. Might even be an option to skip this call entirely depending on the sblaster configuration (not sb.dma.autoinit)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4280
2019-11-06 08:59:40 +00:00
krcroft
dfc9b2db31 Add the audio handling changes to build system and documentation 2019-11-06 05:47:03 +01:00
krcroft
edad78b5e0 Adapt and improve audio-handling in the CDROM sources
Runtime improvements:

- Replaces the existing audio callback routine with an efficient chunked
  circular-buffer audio reader
- Replaces assumptions that all audio tracks are 44.1 kHz & stereo.
  The mixer is now fed data at the actual compressed track's rate and
  channel count
- Eliminates all SDL locks in the audio code in favour of mixer state
  control
- Queries the codec for track-length instead of using hundreds of
  iterative decimating seeks to determine track length (loading
  a 99-track CUE now takes 0.1 user-seconds versus 3+ seconds
  previously)
- Seeks are performed within the already-decoded buffer (for all
  codecs) instead of discarding and re-running the decode sequence
- SDL_Sound's buffer-size is now set once and never resized, which
  eliminates repeated re-malloc'ing in the library
- Only one seek is performed per-playback sequence followed by
  sequential decodes, similar to a physical CDROM (The baseline dosbox
  performs a seek for every 2352-bytes of uncompressed audio)
- The DOSBox mixer is now only active during playback sequences and
  fully dormant otherwise (baseline dosbox instead performs hundreds of
  calls/second with empty data)
- When using Opus audio tracks, and if your dosbox.conf [mixer]
  rate=48000, then you will (very likely) achieve sample-exact
  unadulterated pass-through along your entire audio chain from the
  decoder, to DOSBox, to your operating system's software mixer,
  to your sound card driver, to your sound card, to your speakers,
  or to your digital receiver / USB speakers/headphones / or HDMI
  TV/screen.  This is because almost all modern hardware DACs use
  a native sample rate of 48000

Source-level maintenance improvements:

- It strips all pre-processor #ifdef branching for SDL_Sound from
  the code
- Fixes all codec compiler warnings (in the modified files); builds
  have been tested with GCC 4 to 10, Clang 6 to 10, and MSVC 14
- Tested on Linux, macOS (Xcode), and Windows (MinGW MSYS 1.0)
  operating systems
- Tested on i386, x86_64, ARM, and PowerPC (big-endian) architectures
2019-11-06 05:45:42 +01:00
krcroft
fd695b0948 Cleanup comments and NULL-handling in decoders 2019-11-06 05:15:42 +01:00
krcroft
b932a89f87
Adapt the vorbis library to SDL_Sound's needs 2019-11-05 17:21:39 -08:00
Patryk Obara
d68af8b650 Merge branch 'svn/trunk' r4279 2019-11-02 19:30:48 +01:00
Patryk Obara
1f16a164a6 Add DOSBox splash screen graphic in vector format
So far, a splash screen exists only in raster format, encoded with RLE
for easy inclusion in .cpp files (src/gui/dosbox_splash.h).

Vector format is easier to modify and can be used as basis for more
artwork, to provide splash screen in better resolutions, etc.

This vector was obtained by resizing raster image to high resolution,
using a set of Gimp filters to sharpen it, then converted in Inkscape
using Path Bitmap functionality and finally optimized by hand to e.g.
remove excessive path nodes.

To convert it to a format easily usable from C/C++: open the file in
Gimp, edit to fit your requirements and export as C header.
2019-11-02 19:29:03 +01:00
Patryk Obara
4a01b6a00d Prevent potential null pointer dereference
This null-check resolves a potential issue detected by static analysis.

It might be the case, that crash never happens due to the way this
static function is used at the moment, and because DYNFLG_CHANGED is being
cleared in dnew->genreg->Clear() few lines before, but the crash might
still happen if initial state of flags is inconsistent or surrounding
code will be changed even a little bit.

This nullcheck makes the code more robust at no performance penalty.
2019-11-02 19:29:03 +01:00
Patryk Obara
2487242011 Silence compiler warnings introduced in r4277 2019-11-02 19:29:03 +01:00
Patryk Obara
4af8459e80 Replace MSF_TO_FRAMES, FRAMES_TO_MSF macros
Also, add some style adjustments for readability.
2019-11-02 19:29:03 +01:00
Patryk Obara
fce61e33bb Implement frames/MSF conversion as functions
Macros FRAMES_TO_MSF and MSF_TO_FRAMES come from SDL_cdrom library.
SDL_cdrom was removed from SDL2 and these macros are used also in code
not directly related to SDL_cdrom library, so a replacement is needed.

Turns out output pointer type is different on Windows (int*) than it is on
Linux (unsigned char*); given choice between using void* for parameters and
a template function, I prefer template.
2019-11-02 19:29:03 +01:00
krcroft
f39b51fa78 Add SDL decoders for their corresponding codecs 2019-11-02 19:27:36 +01:00
Sjoerd van der Berg
e20e8fa92c Some dma changes to make the world a better place
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4279
2019-11-02 11:21:48 +00:00
Sjoerd van der Berg
95ac285db1 Fix sblaster autoinit restart and improve the auto into single cycle transfer handling
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4278
2019-10-31 20:00:08 +00:00
Patryk Obara
b42a1b31ba Merge branch 'svn/trunk' r4277 2019-10-29 20:22:32 +01:00
ripsaw8080
0622d45e38 Remove cases not needed after r4276
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4277
2019-10-29 14:39:02 +00:00
krcroft
1f193e14ab Simplify the task of making bit-field operations C and C++ compatible 2019-10-28 22:43:23 +01:00
krcroft
5736a7de9b Make comment match reality 2019-10-28 22:43:23 +01:00
krcroft
b99184d97e Replace SDL_RWFromMem with more applicable SDL_RWFromConstMem 2019-10-28 22:43:23 +01:00
krcroft
d9658b4788 Replace strncpy with snprintf 2019-10-28 22:43:23 +01:00
krcroft
d2333979cf Tailor SDL_Sound for interal use by DOSBox
- Removes extraneous (and unused) includes

 - Cleans up many compiler warnings

 - Fixes SDL include statements (using proper `#include <file.h>` directives
   given the prior `#include "file.h"` directives should only be used when
   including a projects' own header files instead of -Ipath-provided system
   headers)

 - Eliminates extraneous codecs

Many of these were made after building SDL_Sound under various compilers
and operating systems and hitting various issues. It currently builds
clean without errors or warnings on all our workflow compilers and
versions.
2019-10-28 22:43:23 +01:00
Patryk Obara
b87966cd11 Merge branch 'svn/trunk' r4276 2019-10-28 05:37:16 +01:00
ripsaw8080
b79f76ad4d Remove defunct code related to the initial display mode of the system BIOS during video mode changes.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4276
2019-10-27 19:08:57 +00:00
Ryan C. Gordon
0420181d59 Add built-in SDL_sound r599
This commit contains several files imported from SDL_sound Mercurial
repo: https://hg.icculus.org/icculus/SDL_sound/ r599 (also tagged as
"final-lgpl-revision").
2019-10-26 06:55:13 +02:00
Patryk Obara
e4d18f16ce Merge branch 'svn/trunk' r4275 2019-10-25 00:55:53 +02:00
Arthur Ouellet
db67ff2e3b Add built-in C++ object serializer [snapshot as of 2019-10-23] 2019-10-25 00:47:43 +02:00
Yann Collet
28cf402cae Add built-in Extremely Fast Hash algorithm: xxHash [snapshot as of 2019-10-23] 2019-10-25 00:47:43 +02:00
Sean Barrett
fd5aeab8b5 Add built-in Vorbis codec: stb_vorbis v1.17 2019-10-25 00:47:43 +02:00
David Reid
d66317a08e Add built-in WAV codec: dr_wav v0.11.1 2019-10-25 00:47:43 +02:00
David Reid
a5f1e3473f Add built-in MP3 codec: dr_mp3 v0.5.1 2019-10-25 00:47:43 +02:00
David Reid
a5d87fa8ce Add built-in FLAC codec: dr_flac v0.12.2 2019-10-25 00:47:43 +02:00
Peter Veenstra
2bf589f54f Make it easier to compile 64 builds with visual studio, (see comment for drawback).
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4275
2019-10-20 20:26:10 +00:00
Patryk Obara
9099f0620e Merge branch 'svn/trunk' 2019-10-20 07:15:43 +02:00
Peter Veenstra
5b690f936a fix externals.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4274
2019-10-19 20:08:46 +00:00
Peter Veenstra
276b187181 Make frameskip an integer.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4273
2019-10-19 19:52:24 +00:00
Patryk Obara
acbef2169d Merge branch 'svn/trunk' 2019-10-17 18:36:45 +02:00
Peter Veenstra
6ac1bcf9e7 Fix boundary checks for word/dword memory access. Speeds up dynamic 32 bit core a bit (thanks jmarsh).
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4272
2019-10-16 14:20:00 +00:00
Patryk Obara
e4044f7d8d Merge branch 'svn/trunk' 2019-10-10 18:43:08 +02:00
Peter Veenstra
26a9f75b50 A little cleanup and small speed up (jmarsh)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4271
2019-10-10 15:54:19 +00:00
Patryk Obara
79fe83ede6 Merge branch 'svn/trunk' 2019-10-10 00:16:04 +02:00
Peter Veenstra
195484d5e9 Change OpenGL drawing routine to draw one big oversized TRIANGLE instead of a QUAD in order to work around an Nvidia specific scaling bug. Fixes bug #515.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4270
2019-10-09 20:53:35 +00:00
Peter Veenstra
e1d8eb67a4 Use fabsf when return value is a float. Small warning fix.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4269
2019-10-09 20:49:21 +00:00
Peter Veenstra
19478d45f5 Fix several logic errors with regards to deleted directories.
Should fix that directories with the same length as a deleted directory had some small issues.
Also blocks the creation of files in directories marked as deleted.
Small speed up to MakeDir, so it doesn't rely on mkdir when a directory is created inside a deleted directory.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4268
2019-10-09 20:46:40 +00:00
Patryk Obara
a323e173c2 Merge branch 'svn/trunk' 2019-10-03 23:44:48 +02:00