1
0
Fork 0
Commit graph

4605 commits

Author SHA1 Message Date
krcroft
36e3789e91
Remove unecessary check and zeroing of arguments
This function uses its boolean return code to indicate success
or failure, which all callers check prior to using any of the
referenced arguments.  Therefore it's unecessary to zero-out
referenced arguments or use intermediate variables.
2020-02-07 00:23:36 -08:00
krcroft
8382eb0e7e
Reduce the track number's type to comply with MSCDEX 2020-02-07 00:23:36 -08:00
krcroft
95dc9db727
Update allowed warnings limits 2020-02-07 00:23:35 -08:00
krcroft
e1fec4beb7
Refactor slightly to clarify the flow and move to one return-point
This also squashes a PVS high issue mentioning that 'subUnit'
is checked after it was used.
2020-02-07 00:23:35 -08:00
krcroft
0272145955
Make the MSCDEX Audio Disk Info return compliant track-ranges
The specification says that legal track values range from 1 to 99,
where as the prior code would return 0 if any issue was encountered.
The spec has no allowance for issues in this function, and therefore
we're bound to simply return 1 instead.
2020-02-07 00:23:34 -08:00
krcroft
1cc88953de
Simplify Pause and Stop CD states 2020-02-07 00:23:34 -08:00
krcroft
7cac8e4c4f
Mimick CD players when first positioning the play head
For example, audio CD players will typically position themselves in
preparation to play the first audio track when "Play" is pushed.
This even occurs for mixed-mode CDs, where the player will start
playing at the first audio track. Therefore, we try to find the most
viable audio track and only fall back to defaults if needed.
(instead of "all zeros" like before).
2020-02-07 00:23:34 -08:00
krcroft
7f39fe86b4
Use "=" assignment when creating references and iterators 2020-02-07 00:23:31 -08:00
krcroft
eb1a9285fd
Simplify some combersome math statements
With types refined, we can switch to cleaner integer
math and avoid casting (to float and back to ints), and also
avoid ceil((float) a / b) by using the pure-integer form
of (a + b - 1) / b
2020-02-07 00:22:46 -08:00
krcroft
0dd9eca6d6
Reformat a couple statements and improve some log messages 2020-02-07 00:22:46 -08:00
krcroft
55f6e4307f
Simplify ISO size calculation
This is simplified by no longer retaining the read position,
which is unecessary because all read operations are offset
from an initial absolute position (so this was unecessary code).
2020-02-07 00:22:45 -08:00
krcroft
4aa3311021
Refine types and sizes to more accurately reflect the values they hold
This allows for fewer casts, simpler math, and more readable code
in subsequent commits.
2020-02-07 00:22:40 -08:00
Patryk Obara
81954dfe28 Use safe_strcat 2020-02-06 09:24:05 +01:00
Patryk Obara
2983de4db4 Use unsigned for numbers in shortened filenames
Bitu (aka uintptr_t) is not necessary for handling shortened files,
as we can represent max 10^7 shortened files anyway; unsigned is good
enough.

This allows use to use simple %u for conversion instead of PRIuPTR,
which caused a bug on AmigaOS on PPC.

Fixes: #162
2020-02-06 09:24:05 +01:00
Patryk Obara
4a6704367b Reorder includes for drive_cache
Class DOS_Drive_Cache is declared in dos_system.h, but this header was
indirectly included.  Remove faulty windows.h include (the correct one
exists in cross.h already).
2020-02-06 09:24:05 +01:00
Patryk Obara
079e1e1aa0 Remove pointless GCC_UNLIKELY from name shortener 2020-02-06 09:24:05 +01:00
Patryk Obara
d354727ac5 Update allowed warnings limits 2020-02-06 09:23:18 +01:00
Patryk Obara
a1ceacb6f1 Unifdef unused function in mame implementation 2020-02-06 09:23:18 +01:00
Patryk Obara
a7a9f84ae2 Annotate auto_free with 'inline' to prevent redefinition
This way we prevent unused function warning coming from some files
including this header.
2020-02-06 09:23:18 +01:00
Patryk Obara
f5bf769522 Unifdef unused scaler implementations
A number of "templated" scaler implementations are unused in the
implementation.  If any single one of them needs to be brought back
(unlikely), then it's a simple matter of removing an ifdef.

These templates turn off compilation of following scaler
implementations:

void Normal1x_9_8_L(const void*)
void Normal1x_9_8_R(const void*)
void Normal2x_9_8_L(const void*)
void Normal2x_9_8_R(const void*)
void Normal3x_9_8_L(const void*)
void Normal3x_9_8_R(const void*)
void NormalDw_9_8_L(const void*)
void NormalDw_9_8_R(const void*)
void NormalDh_9_8_L(const void*)
void NormalDh_9_8_R(const void*)
void HQ2x_15_L()
void HQ2x_15_R()
void HQ3x_15_L()
void HQ3x_15_R()
void Super2xSaI_15_L()
void Super2xSaI_15_R()
void SuperEagle_15_L()
void SuperEagle_15_R()
void _2xSaI_15_L()
void _2xSaI_15_R()
void AdvMame2x_15_L()
void AdvMame2x_15_R()
void AdvMame3x_15_L()
void AdvMame3x_15_R()
void Cache_9_8(const void*)
2020-02-06 09:23:18 +01:00
Patryk Obara
ca11ff7d58
Mention macOS test snapshot issue in README.md 2020-02-03 21:45:12 +01:00
Patryk Obara
c2691b1d4f Update allowed warnings limits 2020-02-03 06:09:39 +01:00
Patryk Obara
2e43cf551f Swap bytes for 15bpp and 16bpp screenshots on PPC
Fixes broken colours in screenshots taken on PPC machines.
2020-02-03 05:58:12 +01:00
Patryk Obara
df5c6f6e05 Fix printf warning 2020-02-03 05:58:12 +01:00
Patryk Obara
fbeec78970 Store generated .ico and .icns files
macOS utilities for creating .icns file are non-deterministic and
the resulting file has different checksum each time the file is
re-generated. We don't want this to influence reproducibility of
builds in the future.

Windows is missing necessary native utilities for generating .ico
files out of .png sources.

It's also easier to just copy generated file during snapshot build.
2020-02-03 04:20:35 +01:00
Patryk Obara
a336b7a621 Track *.ico and *.icns files as LFS artefacts 2020-02-03 04:20:35 +01:00
Patryk Obara
b109495114 Add target for creating .ico file 2020-02-03 04:20:35 +01:00
Patryk Obara
b1187fd994 Add macOS dir prefs to gitignore 2020-02-03 04:20:35 +01:00
Patryk Obara
b7180e0b3a Add makefile for creating .icns file
It's macOS specific and depends on pre-rendered icon in png format,
but it makes it easy to re-generate .icns file in the future.
2020-02-03 04:20:35 +01:00
Patryk Obara
45ad1b06a5 Add dosbox-staging icon
SVG icon as a source for other sizes, PNG icon 1024x1024 as source for
generating .icns file, and small 16x16 PNG icon.

Background circle uses size and colours recommended by Gnome HIG.
2020-02-03 04:20:35 +01:00
krcroft
219ebc491c Fix six Coverity and PVS analysis bugs 2020-02-02 16:37:09 +01:00
Patryk Obara
08e8bfeec6 Update allowed warnings limits 2020-02-02 15:16:29 +01:00
Patryk Obara
ba2bffa396 Remove unused private field
This field was added in SVN r2162 and was never used for any purpose.
2020-02-02 15:16:29 +01:00
Patryk Obara
e7b8d546a4 Remove usage of register storage specifier
This keywords is only a hint, was used in C in 1970s, but is useless
nowadays. Some reports indicate, that GCC never used it to actually
treat variable as a register.

It was deprecated from C++ in 2009:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4193.html#809

It was removed from language in C++17, and will likely see new meaning
in some future standard, similar to how 'auto' got replaced in C++11.
2020-02-02 15:16:29 +01:00
krcroft
1666275515 Fixup all effc++ warnings 2020-02-02 00:43:24 +01:00
krcroft
3446db1ee9 Expand mouse control methods
Replace the [sdl] `autolock = true/false` configuration setting with [sdl]
`capture_mouse = ...` with a two-value setting.

The first value defines how the mouse is controlled:
- onclick:       The mouse will be captured with a click inside the window.
- onstart:       The mouse is captured immediately on start (similar to real DOS).
- seamless:      The mouse will move seamlessly in and out of DOSBox and cannot be captured.
- nomouse:       The mouse is disabled and hidden without any input sent to the game.

The second value defines how middle-clicks are handled:
- middlegame:    Middle-clicks are sent to the game (not used to uncapture the mouse).
- middlerelease: Middle-click will uncapture the mouse when windowed (not sent to the game).

Middle-clicks are sent to the game when fullscreen or when seamless control is set.

The default setting of "onclick middlegame" reproduces DOSBox's existing behavior.
2020-02-02 00:43:24 +01:00
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
2363ef9178 Update allowed issues limit 2020-01-31 15:22:00 +01:00
Patryk Obara
dfdee93c20 Update info about snapshot downloads
GitHub changed the user interface for status of specific workflows.
2020-01-30 17:48:00 +01:00
Patryk Obara
34b3549b41 Merge branch 'svn/trunk' r4313 2020-01-30 11:26:32 +01:00
Patryk Obara
1f86116581 Rename snapshot build artifacts
When uploading builds somewhere (e.g. to Vogons forum), the packages
need to be renamed to include the OS.
2020-01-29 23:51:54 +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
krcroft
65d8187595 Test more criteria during PVS analysis
This commit:

- Adds a separate analysis run against the MIRSA (Motor Industry
  Software Reliability Association) criteria, which is extremely
  thorough. This tally is not summarized or considered fatal to the
  workflow. It runs virtually instantly, and the results are very
  interesting; however are too numerous to include in our general
  analysis (ie: over 13,000 issues).

- Changes the PVS summary script output to a tally-per-file instead
  of trying to summarize the nature of the issue, which was mostly
  unhelpful without the full text.

- Adds the full list of possible supressible issue to the report
  directory, so if further suppressions are needed then these will be
  easy to find and use.

- Adds one dr_flac suppression per the resolution here:
  mackron/dr_libs#117
2020-01-29 14:59:50 +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