1
0
Fork 0
Commit graph

5012 commits

Author SHA1 Message Date
krcroft
9d576b5cb7 Statically link libasan during ASAN builds
Some deployments of GCC won't link ASAN build without explicitly
specifying the library, and report:

  "ASan runtime does not come first in initial library list;
   you should either link runtime to your application or
   manually preload it with LD_PRELOAD"

This commit includes the asan library by default for respective
builds.
2020-04-13 14:15:07 +02:00
krcroft
85517f82a9 Add memory-count instrumentation to Clang MSAN builds 2020-04-13 14:15:07 +02:00
krcroft
e1d2fe3135 Make sanitizers platform-agnostic 2020-04-13 14:15:07 +02:00
ripsaw8080
d09f74cae8 Correct an oversight of r4186 when floppy disks are mounted.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4336
2020-04-12 20:21:12 +00:00
Patryk Obara
f5b0b0736c Update allowed warnings limits 2020-04-10 11:20:17 +02:00
Patryk Obara
e4b19ccd37 Fix window size and position when leaving fullscreen
Overrides previous, Windows-only hack used for the same purpose.

After initial window position, OS or window manager will take care of
emplacing window - this change takes care only of situation, when there
is NO initial window position.

Additionally, avoid re-setting the window size on every SetSDLWindowMode
call. This prevents a number of issues with the window being set to
incorrect size while switching between fullscreen and window.

Overally this change takes care of number of small issues happening on
macOS, Windows (without need for an ifdef), and Linux with KDE and MATE.
Also makes the behaviour more consistent for Gnome when starting dosbox
via XWayland.
2020-04-10 09:57:29 +02:00
Patryk Obara
803d65dd23 Log SDL window events
SDL2 introduced a bunch of new events, that old SDL1.2 implementation
did not have. We probably should start using some of them…

It's also extremely helpful for comparing order/number of window events
arriving on different OSes and WMs.
2020-04-10 09:57:29 +02:00
Patryk Obara
b6959e2e4c Add DEBUG_LOG_MSG macro
For printing logs only when DEBUG macro is turned on (without sprinkling
idefs all around the code).
2020-04-10 09:57:29 +02:00
Patryk Obara
86d6647b4e Improved windowresolution handling
Move the code to a separate function to make it easier to understand and
modify. Remove traces of windowresolution=X% support - this option
causes more harm than benefit.

Add bound checks to prevent user from setting up window size bigger then
configured display allows.
2020-04-10 09:57:29 +02:00
Patryk Obara
d0bf1ee09b Allow selecting windowresolution only on start
Changing this option dynamically via "config" built-in never worked, it
was always broken.  Set it to change'able only on start, otherwise all
broken edge-cases would need to be fixed.
2020-04-10 09:57:29 +02:00
Patryk Obara
294b1a5297 Change default render.scaler to "none"
And do small cleanup in surrounding area.

Using normal2x has several undesired side-effects:

- slightly slower performance (I did some perf flamegraphs and turns out
  scaler code is a significant bottleneck, even when using normal1x aka
  none) - we should limit it as much as possible before addressing the
  problem directly.
- it makes default glshader=sharp less precise
- it will negatively affect window resizing code
2020-04-10 09:57:29 +02:00
Patryk Obara
b1c69bebff Wrap description of sdl.mapperfile in .conf file 2020-04-10 09:57:29 +02:00
Patryk Obara
bf514eebfe Make HandleVideoResize a static function 2020-04-10 09:57:29 +02:00
krcroft
6d308e1129 Append to lists to avoid clobbering 2020-04-09 11:59:04 +02:00
krcroft
de3958fd74 Add an 'optinfo' build target
The 'optinfo' build target asks GCC to print optimizations that
could not be performed to local 'missing.txt' files; these will
appear in each repsective subdirectory having source files.

Both GCC and Clang will now print Verbose vectorization information
during the build process, often describing why vectorization
cannot be performed.

This commit also enables basic instruction and math vectorization
for both the 'release' and 'optinfo' targets. This includes making
use of altivec instructions (available on all powerpc processors),
and at a minimum sse4.2 on all x86_64 processors (circa-2008+ AMD
and Intel CPUs).

Vectorization is also re-enabled for GCC FDO builds, which would
otherwise be disabled when we switch to -O2 optimizations.
2020-04-09 11:58:51 +02:00
Patryk Obara
c7287e116e Fix Coverity warnings about BlockRead/Write
These are false-positive findings, but they touch flimsy part of code,
that could very easily break.

In all 4 cases the code looked like this:

    uint8_t buf[MEM_PAGE_SIZE];  // old lines 600, 601
    …
    if (region.bytes > MEM_PAGE_SIZE)
            toread = MEM_PAGE_SIZE; // old line 635
    else
            toread = region.bytes;

    // assert toread <= MEM_PAGE_SIZE
    if (toread < remain) {
            MEM_BlockWrite(…, buf, toread);
    } else {
            MEM_BlockWrite(…, buf, remain);
            MEM_BlockWrite(…, &buf[remain], toread - remain);
            //                ~~~~~~~~~~~~
            //                ^
            //                Coverity flags buffer overrun here
            //                when: toread == remain == MEM_PAGE_SIZE
            //                because buf has size MEM_PAGE_SIZE
            //
            // Sometimes it's MEM_BlockRead, but the problem is the same
    }

In such cases, second MEM_BlockWrite is a no-op because
(toread - remain == 0), but Coverity did not reach this point in
analysis (Coverity is right to check the corner case, but didn't know,
that we can assert toread <= MEM_PAGE_SIZE, so the corner case is the
only value triggering this buffer overrun).

Change `if (toread < remain)` to `if (toread <= remain)`, so corner case
will never trigger second (no-op) MEM_BlockRead/Write inside `else`.
2020-04-06 20:39:05 +02:00
Patryk Obara
a6792a44ad Fix effc++ warnings in ems.cpp 2020-04-06 20:39:05 +02:00
krcroft
278d699128
Update allowed warnings limits 2020-04-05 21:40:22 -07:00
David Reid
50df2eb641
Bump dr_flac to v0.12.9 2020-04-05 21:30:00 -07:00
David Reid
7236ea552d
Bump dr_mp3 to v0.6.1 2020-04-05 21:19:23 -07:00
Patryk Obara
fcf78f0e6c
Use more reference links in the readme file
This improves the readability of the file when viewed as plain text.
2020-04-05 08:48:02 +02:00
Patryk Obara
9b03029f96
Update URLs in README.md
To reflect transfer of the repository to an organization name.
2020-04-05 08:27:54 +02:00
krcroft
6e18ca4cfa Remove a couple erroneous null-pointer assertions 2020-04-04 18:05:04 +02:00
krcroft
d09f6ae665 Add AUTOTYPE to DOSBox's programs 2020-04-04 06:17:28 +02:00
Patryk Obara
f243f585ed Change Config::PrintConfig to use std::string 2020-04-04 04:20:28 +02:00
Patryk Obara
5a41709a47 Cleanup windows title 2020-04-04 04:20:28 +02:00
Patryk Obara
e3559f98ee Update program name in shell startup messages 2020-04-04 04:20:28 +02:00
Patryk Obara
726f024546 Update --version information 2020-04-04 04:20:28 +02:00
Patryk Obara
6b24ff7dee Reformat OpenGL log line 2020-04-04 04:20:28 +02:00
Patryk Obara
e46604f4a2 Reformat texture_renderer log 2020-04-04 04:20:28 +02:00
Patryk Obara
a032e1acb0 Reformat pixel-perfect related logs
Now they are using the same format as other lines, making the output
more readable.
2020-04-04 04:20:28 +02:00
Patryk Obara
72d33df24b Remove SDL 1.2 SDL_DISABLE_LOCK_KEYS hack
Such environment variable is nowhere to be found in SDL2 source code.
2020-04-04 04:20:28 +02:00
Patryk Obara
3aadf84a00 Restore display setting property
This property can be used for selecting which display dosbox should
initially use. Number 0 can be either primary display or left-most
display, depending on OS and user settings.
2020-04-04 04:20:28 +02:00
Patryk Obara
6f76a1e38d Remove misleading comment 2020-04-04 04:20:28 +02:00
krcroft
690a4f4efd Conform to white-space convention in GPL's copyright line 2020-04-04 04:10:06 +02:00
krcroft
1d353843b3 Add header guard 2020-04-04 04:10:06 +02:00
krcroft
cc80c19193 Add copyright header 2020-04-04 04:10:06 +02:00
krcroft
11643631f5 Apply clang-format rules 2020-04-04 04:10:06 +02:00
krcroft
ce369221e7 Update allowed warnings limits 2020-04-04 04:10:06 +02:00
krcroft
a8a0e5fa91 Cleanup PVS warning about uninitialized members 2020-04-04 04:10:06 +02:00
krcroft
f1d197ec5f Cleanup PVS warning unecessary code 2020-04-04 04:10:06 +02:00
krcroft
233cf5089b Cleanup PVS warning regarding combersome empty checks 2020-04-04 04:10:06 +02:00
krcroft
dad002203c Cleanup PVS warning regarding unecessary copy 2020-04-04 04:10:06 +02:00
krcroft
73e22747e7 Use references when catching polymorphic exceptions 2020-04-04 04:10:06 +02:00
krcroft
3aa27e0491 Mark a function const 2020-04-04 04:10:06 +02:00
krcroft
3df2734b52 Clarify choice of wrap-width 2020-04-04 04:10:06 +02:00
krcroft
9e086a882e Use WriteOut_NoParsing where possible 2020-04-04 04:10:06 +02:00
krcroft
75dd033cb0 Validate string to double using std::isfinite 2020-04-04 04:10:06 +02:00
krcroft
239396fec8 Add AUTOTYPE to DOSBox's programs
AUTOTYPE performs scripted keyboard entry into the running
DOS program.

It can be used to reliably skip intros, answer Q&A style questions
that some games ask on startup, or conduct a simple demo.

It allows for delaying input by any number of fractional seconds,
as well defining the pacing between keystrokes. It uses the
comma character "," to insert additional delays similar to modern
phone numbers.

It uses key_* names as defined by the mapper to avoid using SDL
scancodes[1], which are unstable across platforms. This approach
also allows the triggering of custom key bindings the use has
defined.

[1] https://wiki.libsdl.org/SDL_GetScancodeName

"Warning: The returned name is by design not stable across
platforms, e.g. the name for SDL_SCANCODE_LGUI is "Left GUI" under
Linux but "Left Windows" under Microsoft Windows, and some
scancodes like SDL_SCANCODE_NONUSBACKSLASH don't have any name at
all. There are even scancodes that share names, e.g.
SDL_SCANCODE_RETURN and SDL_SCANCODE_RETURN2 (both called
"Return"). This function is therefore unsuitable for creating a
stable cross-platform two-way mapping between strings and
scancodes."
2020-04-04 04:10:06 +02:00
Patryk Obara
ee7107470e
Update README sections
Change repo description to reflect relation with upstream.
Update information for developers, and provide few tiny clarifications.
2020-04-02 07:24:43 +02:00