Usage of this function depends on the state of global sdl struct; and
it's very easy to make a mistake - documentation should lower this risk.
Change the type of output parameter 'pitch' and assure type safety with
internal SDL types via static asserts.
This used to have meaning for Windows 9x support via SDL 1.2; the issue
described in README was never mentioned in the context of SDL2.
Add missing include to video header while we're at it.
This will trigger CI jobs automatically when pull-request is
created/updated. Until now we used only push event, as it was enough to
handle all automatic jobs from repository maintainers, but this does not
work for pull requests triggered by external collaborators.
We can't simply turn on new event, as it results in duplicate jobs when
PR is created by maintainer, so additional "if" filter is needed to
prevent duplicates from running. GitHub still shows "empty jobs" in some
parts of UI, but at least they don't run and fight for resources.
Unfortunately, GitHub Actions "if" functionality is fairly limited at
the moment:
- it does not work on workflows, only specific jobs
- it does not support array literals (that's why maintainer list is
passed as a string)
- it can't access workflow env variables (that's why maintainer list is
duplicated)
- it does not support regular expressions
- seems to have problem with using unary "!" operator and nested boolean
expressions…
- … and official documentation is pretty misleading by suggesting it
can do many of those things :(
that's why this "if" line looks like it does and is duplicated in every
workflow.
&D0 may be needed for old apps which don't set DTR or set it to garbage.
DTR drop delay is required for Quake otherwise it doesn't disconnect
properly.
The previous function could only be effectively run one because
it changes the value of the global 'joytype' to something other
than AUTO, which is what this function looks for to re-query
the joysticks.
Second, if this function is run more than once, then it clobbers
the prior set number of joysticks back to zero (without
re-requerying for the actual quantity), rendering the joysticks
unuseable.
Finally, this function depends on several SDL calls to the joystick
subsystem, but fails to check or initialize it.
The commit:
- Checks for an initializes the joystick subsystem before using it
- Always re-queries the current state of the joystick (re-runnable)
- Simplifies the logic to determine useability (retains criteria)
- Conservatively writes the joysticks quantities at the end
There's no reason to use more than 32 bit for this parameter.
Also, limit scope of certain variables as much as possible without
bigger refactorizations.
There's no reason to use more than 32 bit for this parameter; source
values are 16 bit, and they occassionally shifted, but always to values
fitting in 32 bit.
In an earlier change, I removed appending newline outside of batch mode
in DOS shell code - that made DOSBox behave less like MS-DOS and more
like modern shells, that do not try to compensate for buggy
applications.
However, we should recognize that DOSBox (unlike e.g. FreeDOS) is designed
to run legacy applications, which might make assumptions about DOS
implementation. Some examples:
- PC Player Benchmark assumes, that help commands are displayed exactly
at 80x25 terminal and formats the output to fill the whole screen
(scrolling past DOS4GW messages).
- Quake and other ID games print shareware information on exit, but do
it via a direct memory dump (not interrupts to print DOS text), and
follow up with setting cursor exactly at line 22 (which is partly
written already), expecting shell to inject newline.
- PCC Compiler prints status message on exit without newline, depending
on MS-DOS shell behaviour.
- TEXTUTIL set of external commands do not print nothing to standard
output, and are designed to clear the screen, therefore writing a
newline after .COM commands would be a mistake.
Therefore we want to inject this newline, but not in every case.
New implementation reuses a static variable used by Program base class
(for purpose of translating UNIX newlines to DOS newlines) for detection
if it's appropriate to inject an additional newline or not.
Injecting the newline happens in function displaying the DOS prompt (so
we don't need to write additonal logic for separately handling batch
mode). When starting a non-COM, non-internal command the static variable
is set to the state indicating that next DOS prompt should inject the
newline.
Fixes: #208
Both new SVN commits are irrelevant to dosbox-staging:
- overlay output does not exist any more since SDL2
- we already switched to OpenGL on all OSes, not only macOS
Changes were removed during conflict resolution. Keeping empty merge
commit to aid in future imports.
Clang memory sanitizer needs all linked libraries (including STL) to be
compiled with msan option, otherwise analysis results are practically
unusable.
GCC undefined behaviour sanitizer analysis is already covered by build
running UASAN (undefined behaviour and address sanitizers).
In the current code, we assess the --disable-opus-cdda argument,
and if it's not present we run pkg-config to get the Opus CFLAGS
and LIBS. If it finds them, it sets the OPUSFILE_CFLAGS and
OPUSFILE_LIBS variables. We finally check for the presense of
one of these before actually enabling Opus.
However, if the user directly sets OPUSFILE_LIBS, then this final
check will become true regardless if the user passed --disable-opus-cdda
to configure.
The obvious fix is to move the final Opus check inside the
prior checks (for example, moving AM_CONDITIONAL(USE_OPUS) inside
AS_IF(..), however that results in the OPUS_USE conditional not
existing if the AS_IF test fails its check.
Therefore, we set a new variable HAVE_OPUS, if the pkg-config
check passes, and look for that instead of OPUSFILE_LIBS.
(Of course, the user could export HAVE_OPUS=yes in their
environment as well, but at that point they're deliberately
circumenting configure, in which case they can have at it!).