Revisions 4314 and 4315 were reverted:
- r4314 introduced several technical issues; keeping it away from
the master branch until some improvements will land in SVN.
- r4315 touches code related to overlay, which was completely removed when
porting to SDL2; this revert makes future merge commit cleaner.
This function uses its boolean return code to indicate success
or failure, which all callers check prior to using any of the
referenced arguments. Therefore it's unecessary to zero-out
referenced arguments or use intermediate variables.
The specification says that legal track values range from 1 to 99,
where as the prior code would return 0 if any issue was encountered.
The spec has no allowance for issues in this function, and therefore
we're bound to simply return 1 instead.
For example, audio CD players will typically position themselves in
preparation to play the first audio track when "Play" is pushed.
This even occurs for mixed-mode CDs, where the player will start
playing at the first audio track. Therefore, we try to find the most
viable audio track and only fall back to defaults if needed.
(instead of "all zeros" like before).
With types refined, we can switch to cleaner integer
math and avoid casting (to float and back to ints), and also
avoid ceil((float) a / b) by using the pure-integer form
of (a + b - 1) / b
This is simplified by no longer retaining the read position,
which is unecessary because all read operations are offset
from an initial absolute position (so this was unecessary code).
Bitu (aka uintptr_t) is not necessary for handling shortened files,
as we can represent max 10^7 shortened files anyway; unsigned is good
enough.
This allows use to use simple %u for conversion instead of PRIuPTR,
which caused a bug on AmigaOS on PPC.
Fixes: #162
Class DOS_Drive_Cache is declared in dos_system.h, but this header was
indirectly included. Remove faulty windows.h include (the correct one
exists in cross.h already).
A number of "templated" scaler implementations are unused in the
implementation. If any single one of them needs to be brought back
(unlikely), then it's a simple matter of removing an ifdef.
These templates turn off compilation of following scaler
implementations:
void Normal1x_9_8_L(const void*)
void Normal1x_9_8_R(const void*)
void Normal2x_9_8_L(const void*)
void Normal2x_9_8_R(const void*)
void Normal3x_9_8_L(const void*)
void Normal3x_9_8_R(const void*)
void NormalDw_9_8_L(const void*)
void NormalDw_9_8_R(const void*)
void NormalDh_9_8_L(const void*)
void NormalDh_9_8_R(const void*)
void HQ2x_15_L()
void HQ2x_15_R()
void HQ3x_15_L()
void HQ3x_15_R()
void Super2xSaI_15_L()
void Super2xSaI_15_R()
void SuperEagle_15_L()
void SuperEagle_15_R()
void _2xSaI_15_L()
void _2xSaI_15_R()
void AdvMame2x_15_L()
void AdvMame2x_15_R()
void AdvMame3x_15_L()
void AdvMame3x_15_R()
void Cache_9_8(const void*)
macOS utilities for creating .icns file are non-deterministic and
the resulting file has different checksum each time the file is
re-generated. We don't want this to influence reproducibility of
builds in the future.
Windows is missing necessary native utilities for generating .ico
files out of .png sources.
It's also easier to just copy generated file during snapshot build.
SVG icon as a source for other sizes, PNG icon 1024x1024 as source for
generating .icns file, and small 16x16 PNG icon.
Background circle uses size and colours recommended by Gnome HIG.
This keywords is only a hint, was used in C in 1970s, but is useless
nowadays. Some reports indicate, that GCC never used it to actually
treat variable as a register.
It was deprecated from C++ in 2009:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4193.html#809
It was removed from language in C++17, and will likely see new meaning
in some future standard, similar to how 'auto' got replaced in C++11.
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.
This is accomplished by clearing all the binds on the events, and
then re-parsing the file.
This allows batch scripts to change keybindings, and is useful for DOS
game menus, who can now change the mappings per-game.
ie: config -set sdl mapperfile=~/.dosbox/mario-and-luigi.map
or: config -r -conf ~/.dosbox/mario-and-luigi.conf
(with a mapperfile=mario-and-luigi.map line in mario-and-luigi.conf)
Warning: Because internal changes don't have access to the
current_config_path, paths set with config -set are relative to the
CWD. Relevant source lines are src/misc/setup.cpp lines 349 and 917
I'm unsure if this interacts well with the CAPS and NUMLOCK code at the
bottom of MAPPER_Init, as those now get run every time the mapper
reloads. If it does misbehave, those if statements can probably be
moved to the MAPPER_StartUp function, although it is called a bit earlier
than MAPPER_Init.
A natural extension of this would be to add the ability to change the
mapperfile from within the MAPPER UI.