1
0
Fork 0
No description
Find a file
Patryk Obara e4d3188c7a Add clang-format rules
Rules are defined for all C/C++ code, except src/libs.

These rules are designed to emulate kernel coding convention with some
adaptations for C++11. Configuration file uses options available in
clang-format 8.0 (the newest version in 10.0) to provide compatibility
with older environments and operating systems.  Some options are
commented out and marked with TODOs - those need to be investigated and
enabled/disabled during upgrade to clang-format 9.0.

DOSBox codebase is a mix of various styles with only few consistent
rules seen throughout the codebase, these clang-format rules preserve
some of existing conventions and conciously break with others.

Some unwritten upstream rules, that are now encoded in clang-format:

- Using tab for indentation.
- K&R-like indentation for control statements.
- Indentation rules for structs, classes, and non-anonymous enums.
- Case labels in switch statements are aligned the same way goto
  statements would be (also K&R rule).

Some formatting aspects that were not followed consistently throughout
old DOSBox code, but are now encoded in clang-format:

- Space placing in control statements and function calls (makes the code
  much more readable).
- Control statements (if-else, while) must be broken into multiple lines
  (makes the code more readable, helps with debugging, reading compiler
  logs and static analysis reports).

Some unwritten upstream rules, that are now changed by these rules:

- Placing opening function bracket in the same line as function
  declaration (not in line with K&R).  This rule makes it hard to make
  constructor formatting consistent - old code dealt with it by not
  formatting initializer lists at all.  Unformatted initializer list can
  result in lines hundreds of lines long and make it hard to add/remove
  class fields while assuring correct initialization order.
  In new clang-format rules K&R indentation is followed, allowing
  initalizer lists to be formatted one initializer per line (which makes
  it much easier to read and edit.
2020-04-01 07:38:05 +02:00
.github Cleanup workflow files 2020-03-31 11:11:26 +02:00
contrib Added Emulator category to desktop file 2020-03-14 16:50:45 +01:00
docs Remove all physical CD-ROM references from manual 2019-12-18 22:31:19 +01:00
include Change bpp to unsigned int around render code 2020-03-28 05:41:04 +01:00
m4 Add an option for static linking of SDL2 2020-03-08 03:28:37 +01:00
scripts Use ccache in the CI workflows 2020-03-24 03:42:04 +01:00
src Add clang-format rules 2020-04-01 07:38:05 +02:00
vs Enable parallel builds in VS for all configs 2020-03-30 19:31:03 +02:00
.clang-format Add clang-format rules 2020-04-01 07:38:05 +02:00
.gitignore Move PVS Studio static analysis to a separate file 2020-03-31 11:11:20 +02:00
.mdl-styles Selectively enable MarkDown line-length checking 2020-03-21 23:38:40 +01:00
.mdlrc Selectively enable MarkDown line-length checking 2020-03-21 23:38:40 +01:00
.pvs-suppress Update the existing PVS false-positives for xxHash v0.7.3 2020-03-07 01:46:55 +01:00
.pylint Allow maximum-issues to be set via command-line 2019-11-24 15:16:44 +01:00
AUTHORS Update authors 2010-04-20 12:51:03 +00:00
autogen.sh Provide aclocal with the path to additional .m4 files 2020-01-19 22:54:28 +01:00
CODE_OF_CONDUCT.md Add Code of Conduct 2020-03-21 23:38:49 +01:00
configure.ac Prevent env:OPUSFILE_LIBS from enabling Opus 2020-03-10 06:41:02 +01:00
COPYING Update year and address of FSF 2019-01-25 14:09:58 +00:00
INSTALL Bundle autoconf ax_cxx_* macros 2020-01-13 01:42:20 +01:00
Makefile.am Remove Visual Studio references from autoconf 2020-01-13 01:42:20 +01:00
README Remove dead code remains of WinDIB usage 2020-03-27 00:54:11 +01:00
README.md Cleanup workflow files 2020-03-31 11:11:26 +02:00
THANKS Updated 2010-05-09 11:07:51 +00:00

dosbox-staging

Linux build status Windows build status macOS build status

This repository attempts to modernize the DOSBox project by using current development practices and tools, fixing issues, adding features that better support today's systems, and sending patches upstream. Read more at Vogons thread.

Summary of differences compared to upstream

dosbox-staging DOSBox
Version control Git SVN
Language C++11 C++031
CI Yes No
Static analysis YesC,P,S No
Dynamic analysis Yes No
Automated regression tests No (WIP) No
SDL 2.0 1.2

dosbox-staging does not support audio playback using physical CDs. Using CD Digital Audio emulation (loading CD music via cue sheets or mounting ISO images) is preferred instead.

Codecs supported for CD-DA emulation:

dosbox-staging DOSBox
Opus Yes (libopus) No
OGG/Vorbis Yes (built-in) Yes - SDL_sound 1.2 (libvorbis)5,
MP3 Yes (built-in) Yes - SDL_sound 1.2 (libmpg123)5,
FLAC Yes (built-in) No§
WAV Yes (built-in) Yes - SDL_sound 1.2 (internal)6,
AIFF No Yes - SDL_sound 1.2 (internal)6,

- SDL 1.2 was last updated 2013-08-17 and SDL_sound 2008-04-20
† - 22.05 kHz, 44.1 kHz, 48 kHz; mono, stereo
‡ - 44.1 kHz stereo only
§ - Broken or unsupported in either SDL_sound or DOSBox

Other feature differences:

dosbox-staging DOSBox
Pixel-perfect mode Yes (output=texturepp)7 N/A
OPL emulators compat, fast, mame, nuked8 compat, fast, mame
CGA/mono support Yes (machine=cga_mono)9 Only CGA with colour
Wayland support Experimental (use SDL_VIDEODRIVER=wayland) N/A

Development snapshot builds

Pre-release builds can be downloaded from CI build artifacts. Go to Linux, Windows or macOS, select the newest build and download the package linked in the "Artifacts" section.

You need to be logged-in on GitHub to access these snapshot builds.

Linux

Snapshots are dynamically-linked x86_64 builds, you'll need additional packages installed via your package manager.

Fedora

sudo dnf install SDL2 SDL2_net opusfile

Debian, Ubuntu

sudo apt install libsdl2-2.0 libsdl2-net-2.0 libopusfile0

Arch, Manjaro

sudo pacman -S sdl2 sdl2_net opusfile

Windows

A dosbox.exe file in a snapshot package is not signed, therefore Windows 10 might prevent the program from starting.

If Windows displays the message "Windows Defender SmartScreen prevented an unrecognised app from starting", you have two options to dismiss it:

  1. Click "More info", and button "Run anyway" will appear.
  2. Right-click on dosbox.exe, select: Properties → General → Security → Unblock

Windows packages are built for "x86" architecture (in practice it means i686).

macOS

Due to GitHub CI and Apple SDKs limitations, the snapshots work only on macOS Catalina (10.15).

dosbox-staging app bundle is unsigned - click on app with right mouse button, select "Open" and the dialog will show a button to run and unsigned app.

Build instructions

Linux, macOS, MSYS2, MinGW, other OSes

Read INSTALL file for a general summary about dependencies and configure options. Read build.md for the comprehensive compilation guide.

git clone https://github.com/dreamer/dosbox-staging.git
cd dosbox-staging
./autogen.sh
./configure
make

You can also use a helper script ./scripts/build.sh, that performs builds for many useful scenarios (LTO, FDO, sanitizer builds, many others).

Visual Studio (2019 or newer)

First, you need to setup vcpkg to install build dependencies. Once vcpkg is installed and bootstrapped, open PowerShell, and run:

PS:\> .\vcpkg integrate install
PS:\> .\vcpkg install libpng sdl2 sdl2-net opusfile

These two steps will ensure that MSVC finds and links all dependencies.

Start Visual Studio, open file: vs\dosbox.sln and build all projects (Ctrl+Shift+B).

Interop with SVN

This repository is (deliberately) NOT git-svn compatible, this is a pure Git repo.

Commits landing in SVN upstream are imported to this repo in a timely manner, to the branches matching svn/* pattern. You can safely use those branches to rebase your changes, and prepare patches using Git format-patch for sending upstream (it is easier and faster, than preparing patches manually).

Other branch name patterns are also in use, e.g. vogons/* for various patches posted on the Vogons forum.

Git tags matching pattern svn/* are pointing to the commits referenced by SVN "tag" paths at the time of creation.

Additionally, we attach some optional metadata to the commits imported from SVN in the form of Git notes. To fetch them, run:

git fetch origin "refs/notes/*:refs/notes/*"