1
0
Fork 0
Commit graph

5041 commits

Author SHA1 Message Date
Patryk Obara
dbc77a6f1c Prevent empty property names 2020-03-27 00:54:11 +01:00
Patryk Obara
4811193998 Initialize all members of Property class 2020-03-27 00:54:11 +01:00
Patryk Obara
dbfca7353e Cleanup MIDI/ALSA-related logs
We want logs to adhere to a common format.
2020-03-27 00:54:11 +01:00
Patryk Obara
9d2b7ea578 Adjust help strings for sdl options 2020-03-27 00:54:11 +01:00
Patryk Obara
193f2ed564 Declare sdl.vsync as deprecated/disabled
vsync is an option introduced by SDL2 patch, but the testing indicates,
that it very rarely (if ever) works.  We still want to support it, but
this might require serious implementation effort, so for the time being
we're removing broken option to prevent confusing the users.
2020-03-27 00:54:11 +01:00
Patryk Obara
04d2e9f3f1 Allow config properties to be deprecated
This allows us to show a warning to the user if the .conf file includes
a property that is no longer supported, or a property that is completely
unknown.  Actual handling of the property can still be implemented
(e.g. to use as a fallback for modern replacement), but doesn't need
to be.
2020-03-27 00:54:11 +01:00
Patryk Obara
779131d396 Skip splash screen if resolution is not large enough
It's the easiest way to prevent problems when user wants to play the
game using fullscreen while explicitly setting tiny resolution
for a specific game (e.g. 320x200).
2020-03-27 00:54:11 +01:00
Patryk Obara
5ac2567adc Rename gimp_image to splash_image 2020-03-27 00:54:11 +01:00
Patryk Obara
6f238c0d1a Fix splash screen for surface output
All rendering backends except output=surface assume input buffer row
with the same length as output buffer row. Surface is "special" and in
fullscreen uses pitch equal to *screen* width instead. Padding the
output rows with black pixels is necessary for splash screen to show up
correctly.
2020-03-27 00:54:11 +01:00
Patryk Obara
00ffbd0977 Remove dead code remains of "lazy_fullscreen" feature 2020-03-27 00:54:11 +01:00
Patryk Obara
1f62338610 Fix indirect memory leak of icon surface 2020-03-27 00:54:11 +01:00
Patryk Obara
d34378b621 Define SDL rgb-masks for creating surfaces 2020-03-27 00:54:11 +01:00
Patryk Obara
a5b65b3c8e Initialize default window size before GUI_StartUp 2020-03-27 00:54:11 +01:00
Patryk Obara
acb020147d Move "extern C" to ppscale header 2020-03-27 00:54:11 +01:00
Patryk Obara
facabcee2a Handle surface as the last option during update
SCREEN_SURFACE is no longer the default option, and it's usable only for
debugging purposes. Move it to the last position in switches, to make
texture and opengl a little bit faster.
2020-03-27 00:54:11 +01:00
Patryk Obara
8d5bc9537a Prevent a crash in Windows AMD drivers
Usually, when window is being created without SDL_WINDOW_OPENGL flag,
SDL2 internally re-creates it to support OpenGL during
SDL_CreateRenderer if needed.

This leads to crash in AMD OpenGL drivers (Windows only), which happens
for drivers: "opengl", "opengles", "opengles2".

When the window is created with correct flag from the get-go, the crash
does not happen.

On Linux, the code does not crash either way (at least not when using
Mesa and AMDGPU open source driver), so there's no point in propagating
the hack.

Also, remove a comment that is no longer relevant to the code below.
2020-03-27 00:54:11 +01:00
Patryk Obara
bb43294f68 Store SDL texture render driver as std::string 2020-03-27 00:54:11 +01:00
Patryk Obara
54a50d4231 Replace Lock/UnlockTexture with UpdateTexture
Lock/UnlockTexture is stable and works very well on Linux and with
OpenGL texture driver and on Linux and Windows, but it's usage caused
problems with content of updated texture when used with drivers:
'direct3d11' on Windows and 'metal' on macOS.

Also, Lock/Unlock turned out to be the root cause of deadlocks for
'opengl' driver on AmigaOS.

According to SDL2 documentation, using Lock/UnlockTexture is supposed to
be faster, but in DOSBox usecase we couldn't confirm significant
performance change - there are some community reports indicating, that
UpdateTexture might be actually faster (but we couldn't confirm it
either).

Discussion on this topic can be found on SDL forum:
https://forums.libsdl.org/viewtopic.php?t=9728

In our case, switch to UpdateTexture has no serious negative impact, but
makes the behaviour more robust across the board.
2020-03-27 00:54:11 +01:00
Patryk Obara
fa4e8c28de Update description of sdl.windowresolution 2020-03-27 00:54:11 +01:00
Patryk Obara
3001ef240f Remove old splash screen 2020-03-27 00:54:11 +01:00
Patryk Obara
854c021cdc Update splash screen to use 4:3 aspect ratio
This way it matches the default window size when going into text mode
with aspect=true (default).
2020-03-27 00:54:11 +01:00
Patryk Obara
aed68e9e6e Destroy SDL resources in the proper order
Prevent internal SDL2 asserts on Windows 10 when using output=texture,
also improves stability on AmigaOS and Linux using Wayland.
2020-03-27 00:54:11 +01:00
Patryk Obara
d3f3833f2c Set icon after sdl.window is created
Otherwise internal SDL2 asserts are triggered in Windows debug builds.
2020-03-27 00:54:11 +01:00
Patryk Obara
bf1c7eef18 Fix effc++ warnings in control.h 2020-03-27 00:54:11 +01:00
Patryk Obara
919099c757 Start with the correct full/window resolution
Make the user settings affect splash screen as well as emulator; this
way, when user wants to start in fullscreen, the splash screen will be
displayed in fullscreen - making the startup process more streamlined.

This fixes long-standing problem on SteamOS (or Steam in Big Picture
mode), when starting dosbox moves the user out of fullscreen to window
(to show tiny splash screen), and then back to fullscreen.
2020-03-27 00:54:11 +01:00
Patryk Obara
600ccccd37 Display splash screen using GFX API
Simplify the code displaying the splash screen and extract it to a new
function. Using GFX_* functions avoids the problem of re-creating
the window from scratch after splash is shown, which solves a lot of
problems:

- application window is always visible on screen, it does not disappear
  for a moment between closing splash and starting emulator.
- seriously reduces resolution trashing on start
- user will not experience loss of window focus due to splash screen
  disappearing (this was happening e.g. on AmigaOS)
2020-03-27 00:54:11 +01:00
Patryk Obara
0b173eec08 Cleanup and document GFX_StartUpdate function
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.
2020-03-27 00:54:11 +01:00
Patryk Obara
08934b2972 Remove dead code remains of WinDIB usage
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.
2020-03-27 00:54:11 +01:00
krcroft
2fc6771046 Use ISO date format for ccache keys 2020-03-25 16:20:13 +01:00
krcroft
2c8db8fbe4 Use ccache in the CI workflows 2020-03-24 03:42:04 +01:00
Patryk Obara
7957396d32 Turn on CI jobs for pull_request event
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.
2020-03-24 01:48:45 +01:00
NicknineTheEagle
383c7e2e96 Describe phonebook feature in the manual 2020-03-23 01:15:28 +01:00
NicknineTheEagle
e905a6bd5d Implement phone book to remap phone numbers to addresses for modem 2020-03-23 01:05:03 +01:00
NicknineTheEagle
de45c413ae Fix auto-answer (S0) behavior in modem 2020-03-23 01:02:42 +01:00
NicknineTheEagle
880d2d2ceb Implement DTR drop actions (&Dn) and DTR drop delay (S25) in modem
&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.
2020-03-23 01:02:42 +01:00
NicknineTheEagle
9cb13f6158 Fix a bug with backspace handling in modem
Fixes a bug where entering backspace while command buffer was already
empty added backspace char to the buffer thus screwing it up.
2020-03-23 01:02:37 +01:00
krcroft
99a47bc590 Use ccache if available 2020-03-22 21:12:36 +01:00
krcroft
f1b9e5046d Update allowed warnings limits 2020-03-21 23:41:06 +01:00
krcroft
99e53a830f Track and free unassigned CStickBindGroup allocations 2020-03-21 23:41:06 +01:00
krcroft
a1a3e0203d Only initialize the mapper once during startup 2020-03-21 23:41:06 +01:00
krcroft
fba15b997e Add Code of Conduct
Signed-off-by: Patryk Obara <dreamer.tan@gmail.com>
Signed-off-by: krcroft <krcroft@users.noreply.github.com>
2020-03-21 23:38:49 +01:00
krcroft
f142509ac8 Selectively enable MarkDown line-length checking 2020-03-21 23:38:40 +01:00
krcroft
694e6f6cb1 Update allowed warnings limits 2020-03-20 01:06:23 +01:00
krcroft
5b8364148a Use prefix form of incrementing iterators 2020-03-20 01:06:23 +01:00
krcroft
c2fcc273da Explicitly ignore some return values 2020-03-20 01:06:23 +01:00
krcroft
269908cad0 Prevent undefined behavior while bit-shifting on 32bit systems 2020-03-20 01:06:23 +01:00
krcroft
b0d90db24a Simplify joystick type assignment logic 2020-03-20 01:06:23 +01:00
krcroft
81efce0862 Refactor and make the joystick querier re-runnable
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
2020-03-20 01:06:23 +01:00
krcroft
d815c52965 Move member initialization to the definition 2020-03-20 01:06:23 +01:00
krcroft
6c52c06a53 Cleanup leaks 2020-03-20 01:06:23 +01:00