1
0
Fork 0
Commit graph

634 commits

Author SHA1 Message Date
Joshua Fern
f2029d71d8 Update copyright dates to 2020 2020-03-07 00:18:01 +01:00
Patryk Obara
2bbe181ccb Avoid integer overflow in bios_disk
Coverity warns about potential integer overflow on 32-bit value before
widening the calculation result to 64-bit.
2020-03-01 21:23:04 +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
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
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
Patryk Obara
5c2a279935 Cleanup int10 includes in ints module 2020-01-11 20:52:55 +01:00
Patryk Obara
6421fc4c8b Avoid switch warnings in SetVideoMode* functions
There are two functions: one for handling EGA and VGA machines, and
"other" handling all remaining cases. This makes it somewhat clear which
cases should be handled where.

M_TANDY16 seems incorrectly handled in 2 places; this patch decides not
preserve existing behaviour (and adds TODOs). Runtime behaviour changed
only for debug builds.
2020-01-11 20:52:55 +01:00
Patryk Obara
c4dba16740 Move drives.h to common include dir
Judging by the usage, this header belongs in there instead of being
limited to dos module only.  This change makes it easier to reuse code
for new features related to drives mounting/unmounting.
2020-01-04 08:26:22 +01:00
Patryk Obara
6cd5f84466 Silence switch warnings for int10 scanline 2019-12-29 08:12:28 +01:00
Patryk Obara
3a68ba2b26 Indicate system includes for relevant SDL headers 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
c81269eebe Remove extern global variable from bios_disk.h
This way interface of swapInDisks function is cleaner and we avoid a
warning when comparing (previously) signed swap position with an
unsigned array size or index.

Also, add some documentation to swapInDisks function.
2019-12-18 23:56:28 +01:00
Patryk Obara
8f81eb199a Simplify swapInDisks function
After introducing shared_ptr, previous implementation of this function
confused Clang static analyzer into reporting a false-positive "use
after free".

Also, do small cleanup in lines touching diskSwap array.
2019-12-18 23:56:28 +01:00
Patryk Obara
5f282f6015 Use shared_ptr to prevent double free on imageDisk
Also, replacing unique_ptr with shared_ptr makes it unnecessary to move
a pointer when swapping boot disks; moving shared_ptr would lead to
inconsistent internal state.

Fixes: #94
2019-12-18 23:56:28 +01:00
Patryk Obara
07fc74cff4 Silence 12 switch warnings
Author's intention was sufficiently explained in the comment
in this case.
2019-12-10 12:40:07 +01:00
Patryk Obara
fe519d0344 Merge branch 'svn/trunk' r4297 2019-12-10 00:07:41 +01:00
ripsaw8080
0987fb6f0c Correct an oversight in INT10_GetDACPage; fixes blank screen in Blue Force on vgaonly machine type.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4297
2019-12-09 18:03:55 +00:00
krcroft
ef2686ac02 Switch from std::vector to std::array 2019-12-09 09:11:16 +01:00
krcroft
c9198b2944 Fix unsafe memory operations and warnings in the fatDrive class
- Move imageDiskList from pointer to vector of unique_ptr
- Replace string operations with size-limited versions
- Initialize members
- Eliminate unecessary casts
- Eliminate memory-leak on pointer assignment
2019-12-09 08:19:26 +01:00
Patryk Obara
f3b8bff3f5 Remove unused private field in device_EMM 2019-11-29 06:27:14 +01:00
Patryk Obara
7afc052550 Silence "unused-const-variable" warning
This register dump looks useful, but it was never used for anything…
2019-11-29 06:27:14 +01:00
Patryk Obara
e831d0b090 Remove pointless switch causing warnings 2019-11-29 06:27:14 +01:00
Patryk Obara
2487242011 Silence compiler warnings introduced in r4277 2019-11-02 19:29:03 +01:00
Patryk Obara
b42a1b31ba Merge branch 'svn/trunk' r4277 2019-10-29 20:22:32 +01:00
ripsaw8080
0622d45e38 Remove cases not needed after r4276
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4277
2019-10-29 14:39:02 +00:00
Patryk Obara
b87966cd11 Merge branch 'svn/trunk' r4276 2019-10-28 05:37:16 +01:00
ripsaw8080
b79f76ad4d Remove defunct code related to the initial display mode of the system BIOS during video mode changes.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4276
2019-10-27 19:08:57 +00:00
Patryk Obara
a323e173c2 Merge branch 'svn/trunk' 2019-10-03 23:44:48 +02:00
Peter Veenstra
60204619d0 - Fix url to forum.
- Fix Bit8u instead of char weirdness for imageDisk (dreamer_)
- Give device_t a virtual empty destructor so some warning program
  doesn't go crazy.
- Give the code that moves the Z drive its own function for readability.
- Give sizes arrays default values again for warning program.
- Rewrite IMGMOUNT in order to exit early for clarity and attempt
  to group things together.



Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4267
2019-10-03 20:03:43 +00:00
Patryk Obara
b62a637157 Import svn:ignore props to .gitignore files 2019-09-15 20:34:57 +02:00
Peter Veenstra
ad88f982c0 Add some size checks when accessing Drives[], mostly needed when DOS_DRIVES is not set to 26, make size parsing not go outside the target array.
Let's not try to assign a drive in the switchlist to a too high number.
Don't access imagelist for drives >D when unmounting. 


Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4239
2019-06-25 06:12:13 +00:00
ripsaw8080
911cc38865 Add logic in mouse driver to ignore button events that are out of sequence. Fixes International Rugby Challenge when clicking to lock the mouse.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4214
2019-04-20 22:50:31 +00:00
ripsaw8080
8688dc9702 Add IBM signature in EGA video BIOS for compatibility. Fixes EGA detection in 221 B Baker Street. Also include trailing space in signature in case it is checked with word values.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4204
2019-04-08 21:13:00 +00:00
ripsaw8080
45f28b12bd Only standard 3-byte mouse data packets are supported, so return an error for other packet sizes. MS Mouse driver versions 9.X and later use 1-byte packets for some obscure reason, and now they won't load instead of messing up.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4191
2019-02-04 15:27:26 +00:00
ripsaw8080
64d25c4be4 Acknowledge mouse interrupt before entering user routine; fixes sound stutter during mouse movement in Eye of the Beholder III and Casino Tournament of Champions. Clear button counters in the mouse driver reset function; prevents unintended skipping of intro in MechWarrior and others.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4188
2019-02-04 15:15:58 +00:00
ripsaw8080
014326476f CMOS equipment list startup display mode bits differ from BIOS on EGA/VGA; fixes Sauro.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4186
2019-02-04 15:09:56 +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
ripsaw8080
3a2b3c6d57 Reset write ops after drawing text in EGA graphics modes, consistent with EGA/VGA BIOS. Fixes Fun School 3.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4169
2018-11-12 16:39:49 +00:00
ripsaw8080
dd304cbef1 Return correct error code for verify sectors function when an invalid drive is specified. Fixes Hugo Troll game installers.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4137
2018-08-17 14:28:56 +00:00
ripsaw8080
01e3789c49 Leave attribute controller in index state after a mode change. Some video BIOS do this, some don't, but it works around a flaw in the Kukoo2 demo.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4134
2018-08-05 13:28:29 +00:00
ripsaw8080
66b813ef9c Support some installer disk detection methods: block device count, and specific MBR/boot sector contents. Fixes (original) SimCity, Amberstar, and later MicroProse installers.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4120
2018-06-21 17:46:52 +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
Peter Veenstra
a8633eff6a Slight corrections to r4091, CX and DX should not be changed for floppies. Changing reported floppy type to one without changeline as we don't support that call.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4101
2018-05-09 18:41:47 +00:00
Peter Veenstra
a4373c0995 Add basic support for INT 13 call 15. Used by korean powerdolls to detect harddrive.
SF bug #477

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4091
2018-04-04 11:14:03 +00:00
Peter Veenstra
aa8bf6041e Declare static functions in header file as static inline, as that reduces warnings quite a bit.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4071
2018-01-30 15:58:28 +00:00
ripsaw8080
34f99e9261 Remove some unnecessary things from prior commits; oops.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4063
2017-10-28 20:30:41 +00:00
ripsaw8080
29bb526d20 Implement update region in mouse driver; only text modes for now. Fixes mouse pointer problems in Microsoft Programmer's Library.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4062
2017-10-28 19:49:11 +00:00
ripsaw8080
e24b034d20 Add patch #265 to correct parameters and clock rate for some EGA modes. Also apply the yellow->brown fix to EGA text modes as well.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4061
2017-10-28 19:48:26 +00:00
Peter Veenstra
eca070fce9 silence warning 4018, unsigned char/unsigned char => (signed) int (thanks wjp)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4059
2017-10-10 15:07:25 +00:00
ripsaw8080
4aa821d0e6 Implement waiting for retrace in VBE functions. Remove range checks in protected mode functions, consistent with UniVBE and other VBE implementations. Fixes hang and graphics glitches in Jack Orlando.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4048
2017-09-10 11:29:34 +00:00