1
0
Fork 0
Commit graph

236 commits

Author SHA1 Message Date
krcroft
219ebc491c Fix six Coverity and PVS analysis bugs 2020-02-02 16:37:09 +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
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
5e3535f1e5 Merge branch 'svn/trunk' r4306 (sans SDL 1.2 bits)
This merge had serious conflicts; some of changes could be applied, but
others needed to be removed.

- Code for new SETMODE_RESTARTS_SUBSYSTEM was removed, as it depends on
  SDL 1.2 functionality (SDL_SetVideoMode) and seems rather pointless
  for SDL 2.0.
- Support for setting windowresolution as a percentage was retained, but
  window centering of this feature likely won't work, as it depends on
  SDL 1.2 env variable SDL_VIDEO_CENTERED.
- Support for applying windowresolution as a percentage was removed, as
  it was implemented purely in code removed during transition to
  SDL 2.0.
2020-01-08 04:27:29 +01:00
Patryk Obara
343b9babca Merge branch 'svn/trunk' r4305 2020-01-07 11:29:39 +01:00
Peter Veenstra
dbd6be2da0 Add OpenGL error reporting (disabled by default)
Add way to restart graphics subsystem on fullscreen/windowed mode transitions in OpenGL mode (disabled by default)
Add check for pixels being valid in OpenGL to prevent direct crash when the allocation fails. 
Add define to turn off Pixel Buffer Object usage. (disabled by default)
Add a way to specify the windowresolution as percentage of your current resolution. (This centers the window.)

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4306
2020-01-06 17:23:38 +00:00
Peter Veenstra
b59d73f5b7 Log detected extensions and correct spacing.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4305
2020-01-05 19:10:32 +00:00
Patryk Obara
fa48273663 Merge branch 'svn/trunk' r4303 2020-01-05 19:11:15 +01:00
Peter Veenstra
c5ad973795 Disable scaling by the OS on windows (scale != 100%). Could not get this working through the manifest, but this seems to work as well.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4303
2020-01-05 16:48:41 +00:00
Patryk Obara
dc0d174824 Remove unused macro definitions 2019-12-26 03:23:19 +01:00
Patryk Obara
a7280cf1f7 Query SDL for available texture renderers
There's no point in hardcoding these values - they can be different to
every user (it depends on hardware, OS, SDL version, etc).

Also, future versions of SDL might introduce more renderers, so this way
the code is more future-proof.
2019-12-26 03:23:19 +01:00
Patryk Obara
6ce7ff8b58 Change sdl.renderer to sdl.texture_renderer
Otherwise users might easily miss, that this option is supposed to work
only for 'texture' output.

Also, do slight adjustments to formatting in generated .conf file.
2019-12-26 03:23:19 +01:00
Patryk Obara
3a68ba2b26 Indicate system includes for relevant SDL headers 2019-12-26 03:23:19 +01:00
Patryk Obara
0d108a7df5 Remove GFX_SetPalette
After move to SDL2, this function is no longer useful.
2019-12-26 03:23:19 +01:00
Patryk Obara
7a415e3b8d Remove last remains of DirectDraw renderer
SDL2 patch replaced it with output=texture renderer=direct3d
2019-12-26 03:23:19 +01:00
Patryk Obara
532345f70e Fix warnings related to misuse of SDL2 types
Use the opportunity to implement a bunch of formatting changes and fix
other warnings.
2019-12-26 03:23:19 +01:00
Patryk Obara
a06035a35e Replace SDL 1.2 with SDL 2.0
This massive patch is based on work of NY00123, which was published on
Vogons forum in 2013 and was waiting for inclusion in SVN since then:

https://www.vogons.org/viewtopic.php?f=41&t=34770

Revision from December 2018 was used to kickstart this work. However, a
number of changes were implemented:

- Original patch preserves all SDL 1.2 code by ifdefing it; this patch
  completely removes all code ifdefed for several versions of SDL 1.2.*
  This way the code will be easier to maintain going forward and
  features enabled by SDL 2.0 do not need to be backported.
  A side-effect of this change is almost-complete removal of DirectDraw
  support - but users can now use Direct3D based acceleration (without
  any ifdefs in code).
- Code ifdefed for Android was removed to make the project easier to
  understand and modify. Android port should still be possible, but it
  requires more work (mostly CI and buildsystem work).
  Android-related functionalities that were cross-platform were
  preserved.
- Code ifdefed for OpenGL ES (which was only used for Android) was
  removed - this should not affect Android support, as
  hardware-accelerated 2D should still be viable via "texture" output,
  but it was not tested, as buildsystem does not support Android ATM.
- SDL_cdrom code is not included; it was outside of scope of SDL2
  changes. Inclusion of that library did not justify supporting one
  small usecase (playblack of CD audio from physical CDs).
- Few code warning were fixed (but new sdl_mapper implementation
  introduces many, many new warnings).
- Some formatting changes were implemented.

Overall, the original patch had ~40k lines of code - here it was
trimmed to +769,-972 (so more old code got removed than new code added).

This implementation was extensively tested on Linux and somewhat tested
on Windows 10.  It fixes numerous issues (too many too list).

Testing found two small regressions:

- Starting game in fullscreen makes it impossible to switch back to
  windowed mode correctly (Windows 10)
- Scaling works a bit worse, only in text mode, only in window (Linux)

This implementation introduces revised user settings in sdl section - it
is only partly compatible with settings from SDL 1.2; this is an issue,
but it will need to be addressed in a separete commit.
2019-12-26 03:23:19 +01:00
Patryk Obara
e1286efca9 Remove SDL_cdrom 1.2 based CD-ROM interfaces
This removes a feature of mounting physical CD-ROMs in DOSBox.

SDL 2.0 removed SDL_cdrom from supported libraries, so to bring this
code back, either the functionality will need to be reimplemented or
SDL_cdrom code modernized for SDL 2.0, and bundled with the repo (the
same way SDL_sound is already bundled).
2019-12-18 22:31:19 +01:00
Patryk Obara
5f9ac5eeab Remove code ifdefed for OS/2
Cleanup before replacing SDL1.2 with SDL2.

OS/2 support was introduced in DOSBox in March 2006.  OS/2 reached EOL
in December 2006.

As of 2019, OS/2 is being continued by proprietary 32-bit only ArcaOS,
although there is no official SDL2 support, despite pledges from SDL2
maintainers.
2019-12-09 16:27:11 +01:00
Peter Veenstra
1521b7ad7d Fix bug #519
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4296
2019-11-26 16:52:04 +00:00
Peter Veenstra
276b187181 Make frameskip an integer.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4273
2019-10-19 19:52:24 +00:00
Peter Veenstra
195484d5e9 Change OpenGL drawing routine to draw one big oversized TRIANGLE instead of a QUAD in order to work around an Nvidia specific scaling bug. Fixes bug #515.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4270
2019-10-09 20:53:35 +00:00
Peter Veenstra
ca20ca3a3e use delete instead of free, although this code is never really used, as the running process should have been replaced at that point.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4263
2019-10-01 11:11:57 +00:00
Peter Veenstra
5803ea448c missed one
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4262
2019-10-01 06:14:42 +00:00
Peter Veenstra
4046dd8229 These actually use float as input.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4261
2019-09-30 18:43:28 +00:00
Peter Veenstra
ffdcc16af5 Always clear drawing area. Should fix certain linux instalations that use triple buffering
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4229
2019-06-02 19:40:59 +00:00
Peter Veenstra
ee236a7e5a Init texture with zeroes. Should fix the red border with pixel_buffer and nvidia cards on Mac OS X and Linux.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4228
2019-05-26 09:07:07 +00:00
Peter Veenstra
94113a7362 Change multi_remain to repeat last parsed value for non-string types if the next value is empty and of the same type as the last.
Use this to add an optional parameter to sensitivity which controls the y axis. When optional parameter is missing, x and y axis have the same value.
Change limits on sensitivity to allow for negative values so the Mouse Y-axis can be inversed. Similar to patch #276.


Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4197
2019-03-29 20:47:57 +00:00
Peter Veenstra
8d1c5b31e1 fix loading of configfiles specified with -conf but present in the userdir with -userconf present.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4194
2019-02-28 13:14:21 +00:00
Peter Veenstra
fdd8358de7 Make feature checks consistent, include right header for memset, correct one off error in paging table size compare for when not using USE_FULL_TLB (jmarsh)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4185
2019-01-28 14:26:19 +00:00
Peter Veenstra
1fbaff47fc Update year and address of FSF
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4183
2019-01-25 14:09:58 +00:00
Peter Veenstra
c9f79add62 no bilinearing filtering on exact multiples
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4178
2018-12-17 19:22:30 +00:00
Peter Veenstra
f5e4b9205f Add workaround for the problem of locking the mouse in windowed mode with X.org 1.20.1. (thanks to DosFreak and ny00123 for their help with testing and debugging)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4177
2018-12-11 15:45:37 +00:00
Peter Veenstra
c7e6b3ca86 Report when a -conf file can not be loaded. Make spacing similar between messages.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4166
2018-10-10 07:00:53 +00:00
Peter Veenstra
1ff6911b3c Let all multiline comments jump in. Pretty up value blocks
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4160
2018-09-04 13:51:09 +00:00
Peter Veenstra
e524d0f1c2 <erge 0.74-2 documentation changes into trunk
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4157
2018-08-31 17:43:09 +00:00
Peter Veenstra
3f7c70b2ad Keep it compiling.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4150
2018-08-28 11:59:41 +00:00
Peter Veenstra
b24425dfa4 Give a warning at startup if dpi scaling is detected.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4149
2018-08-28 11:48:53 +00:00
Peter Veenstra
01e0a45694 Use old style call to get window resolution on windows, fixes part of fullscreen being too large with no manifest and dpiscaling active. Can still go wrong though. dpiscaling is just bad news for dosbox overall. disabling it gives bad results as well for big screens..... Add opengl window centering for fullresolution=original..
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4147
2018-08-28 08:30:44 +00:00
Peter Veenstra
31063f868a disable swap control on all platforms and not just win32. Thanks for testing ny00123
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4132
2018-07-13 12:11:35 +00:00
Peter Veenstra
5bb10db88b Time keeps on ticking
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4109
2018-05-29 12:58:58 +00:00
Sjoerd van der Berg
a315f74074 Allow 15/16/32 bpp inputs to the opengl output
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4095
2018-04-16 20:24:30 +00:00
Peter Veenstra
48611d6141 Do we even use those timers ? Ticks are initted regardless. Please report problems! (helps with cpu usage on Macs)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4090
2018-04-04 10:05:50 +00:00
Peter Veenstra
81202c7dd3 Limit amount of polls per second a bit on MAC OS X, as it was quite high otherwise.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4089
2018-04-04 09:47:29 +00:00
Peter Veenstra
ee8d976ebc Move dddraw detection to a configure option. Requested by DosFreak.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4056
2017-10-10 13:51:13 +00:00
Peter Veenstra
6cf39c1fc6 Years update
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4021
2017-05-30 11:35:08 +00:00
Peter Veenstra
62a8ce4897 Frisbee compilation fix.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4007
2017-03-06 16:25:39 +00:00
Peter Veenstra
a3345eed24 Spaces in LOG_MSG and some at the end of the line.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3999
2016-10-02 14:12:32 +00:00
Peter Veenstra
9dc8581f4a Change name of the pause DOSBox key to avoid confusion.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3989
2016-06-24 21:21:36 +00:00