1
0
Fork 0
Commit graph

4528 commits

Author SHA1 Message Date
krcroft
fb300c3762 Use GNU make < 4.x define syntax
Versions of GNU make prior to verion 4 do not support
'define =' syntax, but do however support 'define' without
the equals operator.  This commit removes the equals operator
to ensure this Makefile is compatible with older versions
of GNU make.

Reported and tested on Windows XP-MinGW with GNU make 3.81
by @ant-222; thank you!
2020-01-19 21:09:28 +01:00
Patryk Obara
f1f78df57c Disable screenshots in Linux snapshot builds again
Problem with libpng12/libpng16 strikes again - Steam Runtime is missing
libpng16, so users who want to test dosbox-staging via Steam are not
able to start it.

This is the only library, that needs to be disabled - all other
dependencies are included in Steam Runtime and work fine.
2020-01-17 06:03:06 +01:00
Patryk Obara
1f1e832a6c Use dosbox-staging splash screen
Users who test dosbox-staging via various GUI frontends might have a
problem distinguishing if the instance they have configured is really
dosbox-staging or some other version of DOSBox. Different splash screen
is a simple remedy for it.

Two graphical files are included: one in vector format to allow for
further refinements and one converted to necessary size in png format,
that is used as direct source of logo embedded in the source code. Use
GIMP to convert the png logo to a C file.

Notes about new design:

Orange background was replaced by black to make switch to black
background of empty terminal a little less jarring.

The box side is covered with the rainbow-like pattern to resemble logos
of various computer platforms popular in the 80s.  AFAIK IBM or
PC-clones never had such colourful logos, but the point is to resemble
a retro-computing platform while being aesthetically pleasing.

Some computing platforms, that used rainbow patterns are Sinclair,
Commodore, Amiga, Dragon 32, and Apple.  The pattern used for
dosbox-staging splash is deliberately different from all of these.

Word "staging" is rendered using excellent Raleway font:
https://www.theleagueofmoveabletype.com/raleway

This change is not supposed to be upstreamed.
2020-01-16 06:42:19 +01:00
krcroft
9df802fd56 Count the bugs reported by PVS-Studio 2020-01-15 18:30:45 +01:00
krcroft
7c4c246082 Make downloading more robust and helpful
This commit adds `wget` as a fall-back if `curl` fails.
Additionally, it lets the user override the curl and wget
arguments by passing `CURL_FLAGS="args"` and
`WGET_FLAGS="args"` to make.

If both curl and wget fail, it suggesting the user manually
fetch the files or try other curl or wget arguments.
2020-01-14 23:21:45 +01:00
krcroft
5f6d072a69 Set BASH shell in Config Heavy's commit-check
The commit-check step run a bash script however its `shell:`
directive was unset, meaning that under Windows the script
would be executed by PowerShell. This commit fixes this by
explicitly setting `shell: bash`.
2020-01-14 23:04:44 +01:00
Patryk Obara
62413b94c5 Disable line length rule for markdownlint
It's impossible to change the line length in .mdlrc file, it requires
writing a project-specific style ruby file. It seems like MD013 is
buggy, as we have tables with longer line lengths already, and the
warning shows up at column 85 and not 80, as documented in official
markdownlint.
2020-01-14 23:02:08 +01:00
Patryk Obara
91f43c9286
Add a note about Wayland support 2020-01-14 19:32:27 +01:00
krcroft
6e97004b62 Unify Windows installations
The commit switches from installing gcc or clang under Windows to
simply always installing clang (which also installs gcc as a dependency).
This ensures that cache's produced from a gcc-specific builds will
be compatible with clang builds.
2020-01-14 04:59:32 +01:00
Oldman
db02acfccf
Strip trailing white-space as a pre-commit hook 2020-01-13 11:27:27 -08:00
Patryk Obara
fb14b7ae5f
Re-create MSYS2 cache for Windows workflow 2020-01-13 03:46:04 +01:00
Patryk Obara
e5465cd0d5 Remove Visual Studio references from autoconf 2020-01-13 01:42:20 +01:00
Patryk Obara
3b14417257 Move autoheader bits to configure.ac 2020-01-13 01:42:20 +01:00
Patryk Obara
76c861a17b Move AM_PATH_SDL to m4 dir 2020-01-13 01:42:20 +01:00
Patryk Obara
9755699948 Move AM_PATH_ALSA macro to m4 dir 2020-01-13 01:42:20 +01:00
Patryk Obara
a110153fff Bundle autoconf ax_cxx_* macros
Users, who try to compile keep tripping over it, despite documentation
in the INSTALL file.  Also, autoconf-archive might be hard to install
for users, who opted not to use MSYS2 and stick to MinGW only.

This commit bundles macros:

AX_CXX_COMPILE_STDCXX (version/serial 10)
AX_CXX_COMPILE_STDCXX_11 (version/serial 18)
2020-01-13 01:42:20 +01:00
Patryk Obara
2310498f79 Merge branch 'svn/trunk' r4308 2020-01-13 00:52:10 +01:00
krcroft
d56afec70b Only run config heavy if our repo has commits 2020-01-13 00:26:11 +01:00
Peter Veenstra
8be4b7a850 Move already mounted checks upwards. (jmarsh)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4308
2020-01-12 18:14:14 +00:00
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
d859decccb Update allowed warnings limits 2020-01-11 20:52:55 +01:00
Patryk Obara
bc52faf4ed Fix MSVC stricmp-related warnings
MSVC replaced its own non-standard implementation of stricmp with
ISO-compliant _stricmp, and issues a security warnings when old name is
used.

This tiny redefine solves 129 warnings in Visual Studio 2019.
2020-01-11 20:52:55 +01: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
krcroft
35bebab0e6 Cache the PVS-Studio package 2020-01-11 20:10:43 +01:00
krcroft
5885ba0851 Add PVS-Studio to our static-analysis workflow
PVS-Studio is a tool for detecting bugs and security weaknesses in the
source code of programs, written in C, C++, C# and Java. It works under
64-bit systems in Windows, Linux and macOS environments, and can analyze
source code intended for 32-bit, 64-bit and embedded ARM platforms.

https://www.viva64.com/en/pvs-studio/

It's very easy to setup and run headless on Linux; although on Windows I
couldn't find instruction describing how to automate the install.

It quickly generates a relatively unique set of issues versus those
reported by Clang's and Coverity's checkers, so it's valuable in that
regard.

Output can be customized in various formats (stdout, gcc-error format,
or HTML), and it produces a nice summary of results that (for a later PR)
we can capture and compare against a maximum warning count similar
to our other checkers.

This PR generates a full HTML report with embedded source snippets,
which are uploaded as a zipped asset.
2020-01-11 20:10:43 +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
4bec644b88 Mention nuked in README.md 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
83b08895c2 Add nuked to main VS project file 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
eaf6970dbd Update allowed warnings limits 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
a9c2f3680f Create a combined Clang+GCC cache under Windows
GitHub's ongoing issue of limitting the cache size has recently
been fixed (https://github.com/actions/cache/issues/6), so this
PR create a combined Clang+GCC cache for separate 32-bit and 64-bit
architectures under Windows.
2020-01-07 23:41:46 +01:00
krcroft
0f37f30246 Remove ClearTracks() and fix ref-assignment 2020-01-07 19:46:32 +01:00
krcroft
c776239c3c Switch from static to dynamically-linked libstdc++
When using C++11 code that can possibly throw exceptions (such as
std::make_shared(...) linking libstdc++.a using Clang on MSYS2
will generate errors such as:

  libstdc++.a(eh_personality.o): duplicate section
  `.rdata$_ZTSSt9exception[_ZTSSt9exception]' has different size

Although potential suggested fixes involve allowing duplicate symbols,
-Wl,--allow-multiple-definition, this solution can introduce unexpected
behavior when one symbol clobbers another symbol.

To solve this, switching to dynamic linking of the libstdc++ library
appears to be all that's needed.
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
krcroft
a852fe3eab Make MD docs comply with markdownlint 2020-01-07 19:28:12 +01:00
krcroft
312a763509 Verify Markdown documents in linting workflow
Also re-order to perform shellcheck first because it
requires the least installation work compared to pylint
and markdownlint.  The reason being if we're going to fail
during shellcheck, then we fail faster (and leave heavier
tasks for further down the line).
2020-01-07 19:28:12 +01:00