There are two functions: one for handling EGA and VGA machines, and
"other" handling all remaining cases. This makes it somewhat clear which
cases should be handled where.
M_TANDY16 seems incorrectly handled in 2 places; this patch decides not
preserve existing behaviour (and adds TODOs). Runtime behaviour changed
only for debug builds.
This way we prevent pointless dynamic_cast; correct usage of
dynamic_cast requires a nullcheck, which was missing in this case
causing Coverity to complain.
Instead of changing cast, let's make this method a virtual one in base
class - this way we could reuse it in future for cases outside of CD-ROM
(e.g. write-protected floppies).
Coverity finds use after free on value pointed by sample_list, but fails
to detect, that this is a global variable, that is being updated by
Sound_FreeSample before freeing any memory.
This code is obviously written with the purpose of freeing whole list,
so there's nothing unexpected here - this is definitely a false
positive finding.
We could mark this issue as false-positive in Coverity, but I think it's
better to avoid tripping it in the first place.
Break lines in descriptions, so that generated .conf file have at most
~80 columns, making it easier to read. This change is made only in
sblaster section.
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.
This merge had serious conflicts; some of changes could be applied, but
others needed to be removed.
- Code for new SETMODE_RESTARTS_SUBSYSTEM was removed, as it depends on
SDL 1.2 functionality (SDL_SetVideoMode) and seems rather pointless
for SDL 2.0.
- Support for setting windowresolution as a percentage was retained, but
window centering of this feature likely won't work, as it depends on
SDL 1.2 env variable SDL_VIDEO_CENTERED.
- Support for applying windowresolution as a percentage was removed, as
it was implemented purely in code removed during transition to
SDL 2.0.
Unmounting single binary-file CDROM images would result in a
crash as flagged by @dreamer_ in issue #112, who noted that
multiple tracks point to the same TrackFile (track.file field).
During destruction, the pre-C++11 code used a temporary
`TrackFile* last` variable to store the currently deleted
track.file's value and only delete the next track.file if it's
not equal to `last`. The result of this is that only the
first-encountered track.file was deleted and all subsequent
and back-to-back duplicate track.file values were left as-is.
This commit replaces the Track object's 'file' member pointer
with a shared_ptr, which effectively does the same thing by
only deleting the last reference.
The shared_ptr simplifies some error-cases where we previously
had to delete the Track.file allocation, but can now simply
let the Track object go out-of-scope and let the shared_ptr
delete it's managed object (if it has one).
Add way to restart graphics subsystem on fullscreen/windowed mode transitions in OpenGL mode (disabled by default)
Add check for pixels being valid in OpenGL to prevent direct crash when the allocation fails.
Add define to turn off Pixel Buffer Object usage. (disabled by default)
Add a way to specify the windowresolution as percentage of your current resolution. (This centers the window.)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4306
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.
The single use from friended class is in public interface. Removal of
friend designators allows Clang to pinpoint few additional unused
private fields.
Latest change from upstream made removed last usage of these functions.
Only ifdef-out them, in case future versions in upstream will use these
functions again.
Static analyzer indicates that in this context `rem` can be NULL,
therefore should not be passed to strchr, but in this context `rem`
cannot be NULL becasuse `args` is not NULL (even after StripSpaces).
Previous implementation avoided invocation of 'pause' in many edge
cases, e.g.: when pause should be invoked between summary lines.
Avoid displaying '.' and '..' in root directory of mounted drive (just
like other dir implementations do).
Use C++11 for-each loop for iterating over directory entries.
Split code inside the loop by option, resulting in more readable
implementation.
Use "%*s" to inject empty whitespace of calculated size instead of
outputting spaces in a loop.
Leave some TODO notes describing further improvements.
This is in line with any other implementation of 'dir' command. It's
also very useful for identifying e.g. which floppy is currently mounted.
MS-DOS and cmd.exe display Volume Serial Number, but it emulating it in
DOSBox doesn't seem to be very useful.
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.
Otherwise users might easily miss, that this option is supposed to work
only for 'texture' output.
Also, do slight adjustments to formatting in generated .conf file.