This removes the last warnings in this area; in this case changing endianess
is not used for accessing emulated memory, just to flip few values to
low endian for storage.
Judging by the usage, this header belongs in there instead of being
limited to dos module only. This change makes it easier to reuse code
for new features related to drives mounting/unmounting.
This is old, and disabled by default in new MSVC compilers.
It was purely infomational warning:
"object name was truncated to 'number' characters in the debug
information"
Regardless, even if we'll decide to silence it again for any reason,
then it should be configured in VS project and not using ifdefed
pragma in the code.
Warning C4290 informs users, that MSVC ignores throw specification. This
is very good warning, because 'throw' specifications were faulty design
and got deprecated in C++11 and REMOVED from the language in C++20.
Throw specifications were replaced by much better 'noexcept' keyword,
which allows for compile-time checks, unlike 'throw', which might
silently inject exception 'std::unexpected'.
There's no point in hardcoding these values - they can be different to
every user (it depends on hardware, OS, SDL version, etc).
Also, future versions of SDL might introduce more renderers, so this way
the code is more future-proof.
This way interface of swapInDisks function is cleaner and we avoid a
warning when comparing (previously) signed swap position with an
unsigned array size or index.
Also, add some documentation to swapInDisks function.
Also, replacing unique_ptr with shared_ptr makes it unnecessary to move
a pointer when swapping boot disks; moving shared_ptr would lead to
inconsistent internal state.
Fixes: #94
Cleanup before replacing SDL1.2 with SDL2.
OS/2 support was introduced in DOSBox in March 2006. OS/2 reached EOL
in December 2006.
As of 2019, OS/2 is being continued by proprietary 32-bit only ArcaOS,
although there is no official SDL2 support, despite pledges from SDL2
maintainers.
- Move imageDiskList from pointer to vector of unique_ptr
- Replace string operations with size-limited versions
- Initialize members
- Eliminate unecessary casts
- Eliminate memory-leak on pointer assignment
- Limit write length into buffer, and add comment about corner-case
- Use C++11's syntax to explicitly remove private copy and assignment operators
- Use C++11 container loop syntax to shorting a cleanup function
- Fix Bitu printf format type
- Check a pointer prior to dereferencing it
- Prevent writing one-beyond the last index
- Replace strcpy with with helper safe_strcpy, provided by @dreamer - thank you!
- Replace strcat with strncat
- Add constructor intializers for scalars and arrays
- Initialize and replace 0-value pointers with nullptr
- Pass in the buffer length when strncpy'ing into a function variable
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.
- Fix Bit8u instead of char weirdness for imageDisk (dreamer_)
- Give device_t a virtual empty destructor so some warning program
doesn't go crazy.
- Give the code that moves the Z drive its own function for readability.
- Give sizes arrays default values again for warning program.
- Rewrite IMGMOUNT in order to exit early for clarity and attempt
to group things together.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4267
Overflow is still treated as Exit.
Underflow is ignored in release mode as it happens every now and then and doesn't seem to cause issues if ignored, thus restoring 0.74 behaviour.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4199
When active, this drive redirects new and changed files to a different location.
The files in the overlay and normal drive are merged on startup and kept up to date when the game changes something.
Files in the overlay are priotizedi, if they exists, above the normal files.
The drive will switch to an overlayed version of the file on the first write! (Not when opening the file in write-mode).
The overlay is capable of creating missing directories.
With the help of DBOVERLAY files, the drive keeps track of files that are present in the normal directory but deleted by the game.
All changes are preserved between sessions.
Current design principles/limitations/requirements:
1) All directories that can be used for saving, must exist already in the base before mounting. (they will be created by DOSBox if missing in the overlay)
2) All filenames inside the overlay directories are UPPERCASE and conform to the 8.3 standard except for the special DBOVERLAY files.
3) To keep point 1 valid at all times, support for creating/renaming/removing directories has been disabled.
Thanks for the help GOG.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4196