This massive patch is based on work of NY00123, which was published on
Vogons forum in 2013 and was waiting for inclusion in SVN since then:
https://www.vogons.org/viewtopic.php?f=41&t=34770
Revision from December 2018 was used to kickstart this work. However, a
number of changes were implemented:
- Original patch preserves all SDL 1.2 code by ifdefing it; this patch
completely removes all code ifdefed for several versions of SDL 1.2.*
This way the code will be easier to maintain going forward and
features enabled by SDL 2.0 do not need to be backported.
A side-effect of this change is almost-complete removal of DirectDraw
support - but users can now use Direct3D based acceleration (without
any ifdefs in code).
- Code ifdefed for Android was removed to make the project easier to
understand and modify. Android port should still be possible, but it
requires more work (mostly CI and buildsystem work).
Android-related functionalities that were cross-platform were
preserved.
- Code ifdefed for OpenGL ES (which was only used for Android) was
removed - this should not affect Android support, as
hardware-accelerated 2D should still be viable via "texture" output,
but it was not tested, as buildsystem does not support Android ATM.
- SDL_cdrom code is not included; it was outside of scope of SDL2
changes. Inclusion of that library did not justify supporting one
small usecase (playblack of CD audio from physical CDs).
- Few code warning were fixed (but new sdl_mapper implementation
introduces many, many new warnings).
- Some formatting changes were implemented.
Overall, the original patch had ~40k lines of code - here it was
trimmed to +769,-972 (so more old code got removed than new code added).
This implementation was extensively tested on Linux and somewhat tested
on Windows 10. It fixes numerous issues (too many too list).
Testing found two small regressions:
- Starting game in fullscreen makes it impossible to switch back to
windowed mode correctly (Windows 10)
- Scaling works a bit worse, only in text mode, only in window (Linux)
This implementation introduces revised user settings in sdl section - it
is only partly compatible with settings from SDL 1.2; this is an issue,
but it will need to be addressed in a separete commit.
Issue reported by Dagar and Pr3tty F1y, and confirmed as a bug by ripsaw8080.
Thank you!
This fixes the GoG release of Betrayal at Krondor which (either due to CD mastering
issues or a faulty rip), requests playback of a given track at the tail end
of the prior track.
In debugging and performing this fix, many debug messages were improved as well
as making some small small code adjustments, such as using iterators to point to
individual tracks (track->attribute) instead of using the tracks array
(tracks[track -1].attribute).
Thanks to @ripsaw8080 for insight into CD-DA channel mapping,
@hail-to-the-ryzen for testing and flagging a position-tracking bug,
and @dreamer_ for guidance and code review.
The CD-DA volume and channel mapping loops were moved to generic mixer
calls and no longer require a pre-processing loop:
- Application-controlled CD-DA volume adjustment is now applied using
an existing mixer volume scalar that was previously unused by the
CD-DA code.
- Mapping of CD-DA left and right channels is now applied at the tail
end of the mixer's sample ingest sequence.
The following have been removed:
- The CD-DA callback chunk-wise circular buffer
- The decode buffers in the Opus and MP3 decoders
- The decode buffer and conversion buffers in SDL_Sound
These removals and API changes allow the image player's buffer
to be passed-through ultimately to the audio codec, skipping multiple
intermediate buffers.
Add compiler testing for fastcall attribute
Add the FASTCALL define to visual c
Remove some overkill inline routines
Make sure that all the inline routines in headers are static
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3355