1
0
Fork 0
Commit graph

4136 commits

Author SHA1 Message Date
Peter Veenstra
51aecb14c6 Refinement of the checks, so no IRQ is raised when not in autodma mode.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4307
2020-01-12 17:51:04 +00:00
Patryk Obara
5c2a279935 Cleanup int10 includes in ints module 2020-01-11 20:52:55 +01:00
Patryk Obara
6421fc4c8b Avoid switch warnings in SetVideoMode* functions
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.
2020-01-11 20:52:55 +01:00
Patryk Obara
381dd8be87 Make setter for RO-medium flag a virtual method
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).
2020-01-11 20:52:55 +01:00
Patryk Obara
f3f33c5ea1 Prevent resource leak during screenshot
Using RAII would be a better solution, but it requires non-trivial
code refactor in this area.
2020-01-11 20:52:55 +01:00
Patryk Obara
0d71bf0ea4 Silence Coverity issue in SDL_sound
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.
2020-01-11 20:52:55 +01:00
Patryk Obara
cc6cd3af00 Fix format warnings in fpu
This should resolve the last two Coverity issues in this area as well.
2020-01-11 20:52:55 +01:00
Patryk Obara
1953d0880b Redefine fileno for Windows
This redefine prevents fake deprecation warning on Windows (C4996) and
prevents a compilation problem when using old MinGW and Windows XP.
2020-01-11 17:50:28 +01:00
Patryk Obara
a8833b7ad6 Remove unused RAW_SIZE define 2020-01-09 22:50:47 +01:00
Patryk Obara
afc07aefc5 Adjust formatting of sblaster section in .conf file
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.
2020-01-09 22:50:47 +01:00
Patryk Obara
efacda1966 Simplify creation of OPL handler 2020-01-09 22:50:47 +01:00
Patryk Obara
4c356de255 Include only necessary headers in nukedopl 2020-01-09 22:50:47 +01:00
Patryk Obara
f27e8762cb Update NukedOPL::Handler to C++11 2020-01-09 22:50:47 +01:00
Patryk Obara
f4609262bf Move nukedopl to libs
This way there's no need to reformat the nukedopl code to adhere to
DOSBox coding conventions.
2020-01-09 22:50:47 +01:00
Alexey Khokholov
64b90ab930 Add Nuked OPL3 emulator v1.8
Set oplemu to nuked in config file. Also set oplrate and mixer rate
to 49716 for best sound quality.

Changelog for v1.8:

- New envelope generator.
- Rhythm mode emulation is 100% correct now.

Vogons thread: https://www.vogons.org/viewtopic.php?f=9&t=37782

Imported-from: https://www.vogons.org/viewtopic.php?p=661417#p661417
2020-01-09 22:50:47 +01:00
Patryk Obara
4d674102d0 Prevent unaligned memory access in adlib
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.
2020-01-09 22:50:47 +01:00
Patryk Obara
72122b731b Fix effc++ warnings in adlib code 2020-01-09 22:50:47 +01:00
Patryk Obara
5e3535f1e5 Merge branch 'svn/trunk' r4306 (sans SDL 1.2 bits)
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.
2020-01-08 04:27:29 +01:00
krcroft
0f37f30246 Remove ClearTracks() and fix ref-assignment 2020-01-07 19:46:32 +01:00
krcroft
cc7d6b6e43 Fix double-free in destructor of CDROM_Interface_Image
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).
2020-01-07 19:46:32 +01:00
Patryk Obara
343b9babca Merge branch 'svn/trunk' r4305 2020-01-07 11:29:39 +01:00
Peter Veenstra
dbd6be2da0 Add OpenGL error reporting (disabled by default)
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
2020-01-06 17:23:38 +00:00
Peter Veenstra
b59d73f5b7 Log detected extensions and correct spacing.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4305
2020-01-05 19:10:32 +00:00
Peter Veenstra
114c820454 Force a flush, so the last data is there incase of a hard crash.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4304
2020-01-05 19:04:23 +00:00
Patryk Obara
fa48273663 Merge branch 'svn/trunk' r4303 2020-01-05 19:11:15 +01:00
Peter Veenstra
c5ad973795 Disable scaling by the OS on windows (scale != 100%). Could not get this working through the manifest, but this seems to work as well.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4303
2020-01-05 16:48:41 +00:00
Patryk Obara
2159cb9aec Use correct type for printf field size specifier
Formatting options for printf family of functions use int as a type
for formatting a field size.
2020-01-04 08:26:22 +01:00
Patryk Obara
c4dba16740 Move drives.h to common include dir
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.
2020-01-04 08:26:22 +01:00
Patryk Obara
2694aca2b2 Fix effc++ warnings in drives.cpp 2020-01-04 08:26:22 +01:00
Patryk Obara
8da42c5983 Remove false friend declarations
The single use from friended class is in public interface. Removal of
friend designators allows Clang to pinpoint few additional unused
private fields.
2020-01-04 08:26:22 +01:00
Patryk Obara
02414201e1 Remove unused functions in cpu area
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.
2019-12-29 22:43:07 +01:00
Patryk Obara
f2601b274f Merge branch 'svn/trunk' r4302 2019-12-29 22:33:33 +01:00
Peter Veenstra
19b9bde38a Fix xcmpchg in dyn_x86 core. Allows Quickview to work in that core; reported by krcroft. Fixed/patch by jmarsh. Thanks!
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4302
2019-12-29 19:53:09 +00:00
Patryk Obara
bbf4e80ac1 Stop silencing deprecation warnings in MSVC
Warning C4996 informs users about deprecation, using either MSVC
__declspec(deprecated) modifier, or the C++14 [[deprecated]]
attribute.
2019-12-29 20:04:39 +01:00
Patryk Obara
aff02450d1 Move GCC_ATTRIBUTE out of autoconf 2019-12-29 20:04:39 +01:00
Patryk Obara
ff2968df3f Move 'likely' macros to the compiler support header
This makes it easier to move away from autoconfig in the future.

Also, use '!!' C trick to prevent accidental incorrect usage of
these macros.
2019-12-29 20:04:39 +01:00
Patryk Obara
6cd5f84466 Silence switch warnings for int10 scanline 2019-12-29 08:12:28 +01:00
Patryk Obara
494eee2ea7 Silence format warning 2019-12-29 08:12:28 +01:00
Patryk Obara
bdac00740b Disable unused function in adlib 2019-12-29 08:12:28 +01:00
Patryk Obara
6ed2396a2e Print a newline after 'path' command 2019-12-29 08:12:28 +01:00
Patryk Obara
5c1c653098 Print a newline after user makes a choice
Previously, this command expected newline to be injected by the shell
(which was incorrect behaviour, as shell was skipping it in batch
files).
2019-12-29 08:12:28 +01:00
Patryk Obara
1bdb67b2c3 Add an assert in 'choice' command
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).
2019-12-29 08:12:28 +01:00
Patryk Obara
d726f59d83 Hide SoundBlaster autoexec line 2019-12-27 07:34:48 +01:00
Patryk Obara
bb2088eb72 Fix a number of effc++ warnings in shell code 2019-12-27 07:34:48 +01:00
Patryk Obara
08a7f47c2b Fix output of 'dir /w /p' and edge cases
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.
2019-12-27 07:34:48 +01:00
Patryk Obara
64949a6e8c Print volume/drive label in 'dir' cmd
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.
2019-12-27 07:34:48 +01:00
Patryk Obara
c3e7997f75 Fix conversion warnings after SDL2 transition
Detected by MSVC compiler; several warnings:
"(…) conversion from 'Sint64' to '<type>', possible loss of data"
2019-12-26 03:23:19 +01:00
Patryk Obara
dc0d174824 Remove unused macro definitions 2019-12-26 03:23:19 +01:00
Patryk Obara
a7280cf1f7 Query SDL for available texture renderers
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.
2019-12-26 03:23:19 +01:00
Patryk Obara
6ce7ff8b58 Change sdl.renderer to sdl.texture_renderer
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.
2019-12-26 03:23:19 +01:00