1
0
Fork 0
Commit graph

4433 commits

Author SHA1 Message Date
Patryk Obara
f89f87ced5 Fix large number of effc++ warnings in sdl_mapper 2019-12-26 03:23:19 +01:00
Patryk Obara
6a0d712404 Re-enable screenshots feature for snapshot builds
With SDL2 in place, the silent dependency on libpng12 on Ubuntu 16.04 is
now gone. Unfortunately, development packages for libpng16 are named
differently for Ubuntu 16.04 and 18.04, so we can't add new package to
the global list.
2019-12-26 03:23:19 +01:00
Patryk Obara
bcc7bf326c Update README.md with SDL2 information 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
5df38b5cdc Update SDL2 description in INSTALL file 2019-12-26 03:23:19 +01:00
Patryk Obara
ac601ee019 Update the list of output values in README
Initial testing indicates, that problem described in this section in
README file might be fixed with SDL 2.0, but it is not fully confirmed
that it's fixed yet.
2019-12-26 03:23:19 +01:00
Patryk Obara
51d535bd66 Remove patch for SDL1 sources
We don't patch external projects before builds.
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
1a58ccb14f Reorder includes in sdl_mapper 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
f9f97573dd Update VS solution to target SDL2 2019-12-26 03:23:19 +01:00
Patryk Obara
58a4ff067d Update fake SDL headers for MSVC 2019-12-26 03:23:19 +01:00
Patryk Obara
44c7fb9165 Update CI to target SDL2 2019-12-26 03:23:19 +01:00
Patryk Obara
185c8af6f5 Update buildsystem to target SDL2
Replace sdl-config with sdl2-config, and add few smaller changes.
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
3eaabb41c1 Fix output formatting of 'dir' command
Adapt to 'pause' command working correctly (assuming the terminal height
is 25, this will need further adjustments for supporting 80x50 and
different modes).

Adjust "intro" by 1 space to make formatting the same as MS-DOS 'dir'
command - this makes intro not "merge" visually with the files listed.

Adjust placing of files and directories counters, to make it resemble
most 'dir' implementations.

Count intro lines for purpose of correct pagination with 'dir /p'.

Skip counting not printed lines with 'dir /b /p'.

Output of 'dir /w /p' is still broken, but fixing it will require more
invasive changes.

Fixes: #75
2019-12-23 21:52:37 +01:00
Patryk Obara
e68a64aade Adjust 'help /all' to fixed 'pause' 2019-12-23 21:52:37 +01:00
Patryk Obara
b0cdfa5161 Do not print newline after every command
This newline is already ommitted from batch files and noecho commands,
this change makes the behaviour consistent in interactive mode.

Additional newline is a behaviour inherited from MS-DOS, and even still
visible in Windows cmd.exe, but all modern DOS implementations,
PowerShell, unix terminals, etc - they all prefer consistent behaviour
over addtional newline. Also, there's no point in wasting 4% of screen
estate just to show empty line.

This fixes CLS command, which is now able to properly clean the screen
and place prompt in the first line.
2019-12-23 21:52:37 +01:00
Patryk Obara
c20579a835 Display newline after key was pressed in 'pause' cmd
Move newline from the string message to the WriteOut in command itself.
This makes the PAUSE command behave like the original, which is
important for commands like DIR /P.
2019-12-23 21:52:37 +01:00
krcroft
12ab0da9c8 Adjust time at which "Config heavy" runs
An unfortunately pattern has emerged where Chocolately's repository
servers have been offline or returning error-codes at roughly
5am GMT.

This commit moves the start inside "office hours" for the
majority of Chocolatey's user-base:
 - 9am in California & Vancouver
 - 11am in New York
 - 4pm in London
 - 5pm in Poland and Germany
2019-12-19 20:01:32 +01:00
Patryk Obara
15c694af21 Update allowed warnings limits 2019-12-19 00:09:44 +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
70a1f9f0d1 Remove PHYSICAL_CD from MountType enum 2019-12-18 22:31:19 +01:00
Patryk Obara
94b987b5b5 Update MSF conversion functions
All usecases, that required these functions to pass 3 values separately
are now gone, we can simply pass/return a struct now.
2019-12-18 22:31:19 +01:00
Patryk Obara
f66a4f5416 Fix a number of effc++ warnings 2019-12-18 22:31:19 +01:00
Patryk Obara
8b86910c33 Add user-visible warnings about removed options 2019-12-18 22:31:19 +01:00
Patryk Obara
d035c2cbd9 Move GetMountType to dos_mscdex file
This was the only user of this function.
2019-12-18 22:31:19 +01:00
Patryk Obara
3e6e97bf47 Create dos_mscdex header 2019-12-18 22:31:19 +01:00
Patryk Obara
28dd59e03e Introduce MountType enum for CDROM_GetMountType 2019-12-18 22:31:19 +01:00
Patryk Obara
f82a0a46da Remove dead code for force selecting CD drive 2019-12-18 22:31:19 +01:00
Patryk Obara
ac4411389b Remove CDROM_USE_SDL enum value 2019-12-18 22:31:19 +01:00
Patryk Obara
3e3c2c02b4 Update INTRO CDROM text 2019-12-18 22:31:19 +01:00
Patryk Obara
82dcb47b3c Remove all physical CD-ROM references from manual 2019-12-18 22:31: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
krcroft
12ee84cfd4 Fixed --enabled-debug on Windows MSYS2
This fixes the prior logic that relies on the (*)curses library
and header existing in compiler-derived default locations
such as /usr/include, and /usr/lib. However, if the package manager
happens to not install them there, then they will not be found
and the check will fail.

Four scenarios:
1. `./configure` or `./configure --enable-debug=no` produce:
    (no mention of debugger; configure continues)

2. `./configure --enable-debug=wrong` produces:
    configure: error: --enable-debug=wrong was requested but the value "wrong" is invalid
    (terminates with exit code 1)

3. `./configure --enable-debug` produces:

    config.h:
    defines C_DEBUG 1

    With only ncurses library installed:

    configure: debugger was requested, finding curses library ...
    checking for NCURSES... yes
    configure: debugger enabled using the ncurses library

    Makefile:
    CPPFLAGS = ... -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -I/usr/local/ncurses ...
    LIBS = ...  -L/usr/local/ncurses -lncurses -ltinfo ...

    With only ncursesw installed:

    configure: debugger was requested, finding curses library ...
    checking for NCURSES... no
    checking for NCURSESW... yes
    configure: debugger enabled using the ncursesw library

    Makefile:
    CPPFLAGS = ... -I/opt/ncursesw ...
    LIBS = ... -L/opt/ncursesw -lncursesw ...

    With only pdcurses isntalled:

    configure: debugger was requested, finding curses library ...
    checking for NCURSES... no
    checking for NCURSESW... no
    checking for PDCURSES... yes
    configure: debugger enabled using the pdcurses library

    Makefile:
    CPPFLAGS = ... -I/usr/local/pdcurses ...
    LIBS = ...  -L/usr/local/pdcurses -lpdcurses -ltinfo ...

    Without any curses library installed:

    configure: debugger was requested, finding curses library ...
    checking for NCURSES... no
    checking for NCURSESW... no
    checking for PDCURSES... no
    configure: error: Package requirements were not met:
    <pkg-info prints info about missing package>
    (terminates with exit code 1)

4. `./configure --enable-debug=heavy` produces same as above, but:

    config.h:
    defines C_DEBUG 1
    defines C_HEAVY_DEBUG 1

    The configure message mentions heavy, for example:

    configure: debugger was requested, finding curses library ...
    checking for NCURSES... yes
    configure: debugger with heavy debugging enabled using the ncurses library
2019-12-14 17:51:11 +01:00
Patryk Obara
5cc7e300e5 Remove inaccurate information from INTRO 2019-12-14 03:35:27 +01:00
Patryk Obara
b8fdf961ae Display a warning when user requests -ioctl 2019-12-14 03:35:27 +01:00
Patryk Obara
ddda555854 Remove MCI, DX, and DIO CD-ROM interfaces
Also, remove all traces of these interfaces from user manual (README
file) and man page (docs/dosbox.1).

MCI (Media Control Interface) was a primary Windows interface. Code
comments and documentation claimed, that it's only for "NT, 2000, XP"
but the code was enabled for Windows 2000 or later (version > 4.0).

DX (Digital audio eXtraction (?)) could be forced on any Windows with
autodetection working only on Vista and Windows 7 (code was disabled for
Windows 8 or later - probably unintentionally).

DIO used DeviceIoControl interface and Windows-specific ioctl calls.

All 3 interfaces depend on SDL and SDL_cdrom functionality to work.
SDL_cdrom 1.2 implementation uses MCI on Windows to provide the same
functionality.
2019-12-14 03:35:27 +01:00
Patryk Obara
ba88bd97d7 Avoid libpng 1.2 dependency for Ubuntu releases
This is a temporary fix for Ubuntu-based distributions. When SDL1 will
be replaced by SDL2, we'll be able to revert this change.

Fixes: #84
2019-12-12 22:52:19 +01:00
Patryk Obara
55b716f8ce Reverse sort by count and item name in the summary
When two files have the same number of warnings, they will appear
in the same order in the summary, making the diff between different
build logs smaller.
2019-12-12 21:24:40 +01:00
Patryk Obara
3b5c3beacf Add an option to list all warnings
Sorted list makes it easier to make a diff of two build logs.
2019-12-12 21:24:40 +01:00
Patryk Obara
c422854482 Add an option to group warnings by files
This change makes it easier to track code areas, that require attention.
2019-12-12 21:24:40 +01:00
Patryk Obara
1f67a5ee7a Set the default max limit of warnings to 0
Most linters behave this way, so it will fit the users' expectations.

Make -m optional, this makes the script a little bit easier to use.
Behaviour of MAX_WARNINGS and using -1 to disable the check is
preserved.
2019-12-12 21:24:40 +01:00
krcroft
3a930b639e Pull the entire repo for release bulds 2019-12-12 21:17:34 +01:00
krcroft
c11ef240b3 Back-out change for the release build (?) 2019-12-12 21:17:34 +01:00
krcroft
d698586779 Only checkout the target branch 2019-12-12 21:17:34 +01:00
krcroft
d22d48b527 Add all OSes to the workflow 2019-12-11 20:30:19 +01:00
krcroft
343c85fa17 Add empty file to hide automator warning 2019-12-11 20:30:19 +01:00