1
0
Fork 0
Commit graph

4070 commits

Author SHA1 Message Date
Nopey Nope
7dbf5cece4 Add and document KeyMapper reloading
This is accomplished by clearing all the binds on the events, and
then re-parsing the file.

This allows batch scripts to change keybindings, and is useful for DOS
game menus, who can now change the mappings per-game.
ie: config -set sdl mapperfile=~/.dosbox/mario-and-luigi.map
or: config -r -conf ~/.dosbox/mario-and-luigi.conf
(with a mapperfile=mario-and-luigi.map line in mario-and-luigi.conf)

Warning: Because internal changes don't have access to the
current_config_path, paths set with config -set are relative to the
CWD. Relevant source lines are src/misc/setup.cpp lines 349 and 917

I'm unsure if this interacts well with the CAPS and NUMLOCK code at the
bottom of MAPPER_Init, as those now get run every time the mapper
reloads. If it does misbehave, those if statements can probably be
moved to the MAPPER_StartUp function, although it is called a bit earlier
than MAPPER_Init.

A natural extension of this would be to add the ability to change the
mapperfile from within the MAPPER UI.
2020-02-01 22:31:27 +01:00
Patryk Obara
34b3549b41 Merge branch 'svn/trunk' r4313 2020-01-30 11:26:32 +01:00
krcroft
93f9cd7e4e Fix audio-related static analysis issues 2020-01-29 17:13:25 +01:00
David Reid
b040cb32c3 Sync dr_wav with upsteam (v0.11.4) 2020-01-29 17:13:25 +01:00
David Reid
a3c0d48865 Sync dr_mp3 with upsteam (v0.5.5) 2020-01-29 17:13:25 +01:00
David Reid
5d829d538d Sync dr_flac with upsteam (v0.12.4) 2020-01-29 17:13:25 +01:00
VileRancour
ffe3c5ab7f Add cga_mono machine
Emulates the user using a CGA card with a monochrome monitor.
Monochrome monitor options are: green, amber, white or paperwhite.
The color can be changed at runtime with F11.

Include paperwhite color by Basic <basic@vogons.org>
https://www.vogons.org/viewtopic.php?p=587382#p587382

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

Signed-off-by: Michael Zijlstra <mzijlstra@gmail.com>
Signed-off-by: Patryk Obara <dreamer.tan@gmail.com>

Imported-from: https://www.vogons.org/viewtopic.php?p=238045#p238045
2020-01-29 13:46:23 +01:00
Peter Veenstra
95a689013e Quick fix for vgaonly on BIGENDIAN.(jmarsh)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4313
2020-01-29 12:07:40 +00:00
Patryk Obara
46e5fdee69 Merge branch 'svn/trunk' r4312 2020-01-29 13:07:31 +01:00
Peter Veenstra
6d11dd5eac Fix unintentional change of union to struct.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4312
2020-01-29 07:38:18 +00:00
Patryk Obara
435cd6bf1f Merge branch 'svn/trunk' r4311 2020-01-28 18:15:48 +01:00
Peter Veenstra
ec8b59ab06 Make scalerwritecache sizes depend on the maximum scaler size.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4311
2020-01-28 12:25:15 +00:00
Patryk Obara
a7ce2b442a Merge branch 'svn/trunk' r4310 2020-01-28 12:06:02 +01:00
Peter Veenstra
80c7bb7cc1 Improve PMAKE on big endian machines and fix some bugs. Includes fix from #364. (jmarsh)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4310
2020-01-28 10:20:59 +00:00
krcroft
ec8fcb4af2 Fix autoconf nuances with AM_CONDITIONAL 2020-01-27 10:46:21 +01:00
krcroft
f6060a5148 Allow Opus CDDA support to be optionally disabled
Adds a `--disable-opus-cdda` flag that explicitly disables support
for Ogg Opus CDDA tracks and in turn avoid the need for the Opus package
dependencies such as the opusfile, opus, and ogg libraries.

This feature does not alter the default operation of ./configure, which
is to enable Opus CDDA support and quit if the Opus dependency package,
opusfile, is not found.  The user can then choose to either a) install
the package or b) explicitly disable Opus support.

This commit also includes:

- fixes for a double-free in the MP3 close routine that
  was discovered during testing

- a message if a CD audio track cannot be added during CDROM
  mounting (such as attempting to use Opus tracks when the binary
  does not support them).

- the --disable-opus-cdda flag in our config heavy workflow
2020-01-27 10:46:21 +01:00
krcroft
878959a0aa Formatting and review fixes 2020-01-22 09:40:00 +01:00
krcroft
c7484ceaaa Improve compliance when printing drive labels 2020-01-22 09:40:00 +01:00
krcroft
ec52c3ef3d Fix NULL issues in programs-related code 2020-01-22 09:40:00 +01:00
krcroft
3391651323 Fix NULL issues in shell code 2020-01-22 09:40:00 +01:00
krcroft
a0eafc9d8e Fix NULL issues in render_templates_hq.h 2020-01-22 09:40:00 +01:00
krcroft
02484abce3 Test NULL checks in dr_flac 2020-01-22 09:40:00 +01:00
krcroft
5da5c2931c Fix NULL issues in memory.cpp
There is no sense in testing the 'MemBase' pointer against null, as the memory was allocated
using the 'new' operator, which throws.
2020-01-22 09:40:00 +01:00
krcroft
fb6e0e88bb Fix NULL issues in zmbv.cpp
There is no sense in testing the pointers against null, as the memory was allocated using
the 'new' operator, which throws an exception.
2020-01-22 09:40:00 +01:00
krcroft
6a1c90b6d8 Fix NULL issues in OPL code
The 'ptr' pointer in the 'ptr += sizeof (FM_OPL)' expression could be nullptr. In such case,
resulting value will be senseless and it should not be used.
2020-01-22 09:40:00 +01:00
krcroft
9d69662001 Fix NULL issues in drive-related code 2020-01-22 09:40:00 +01:00
krcroft
df9fac4e61 Fix NULL issues in CPU emulation code 2020-01-22 09:40:00 +01:00
krcroft
02506d293e Fix static-analysis issues in cdrom_image
One issue in BinaryFile's constructor:
There is no sense in testing the 'file' pointer against null, as
the memory was allocated using the 'new' operator. The exception
will be generated in the case of memory allocation error.
'new'
 - https://www.viva64.com/en/w/v668/

Two issues relating to assigning a value that's already assigned
 - https://www.viva64.com/en/w/v1048/
2020-01-22 09:40:00 +01:00
Patryk Obara
da5e424dc7 Merge branch 'svn/trunk' r4309 2020-01-21 15:52:46 +01:00
Peter Veenstra
88ac8b2dd9 Copy working directory when mounting an overlay. Add some more strings to language file.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4309
2020-01-21 09:02:06 +00:00
ant-222
750b407801 Add a missing include of stdio.h for snprintf() 2020-01-19 22:54:28 +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
Patryk Obara
2310498f79 Merge branch 'svn/trunk' r4308 2020-01-13 00:52:10 +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
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