Skip to content

Commit f0655e6

Browse files
committed
Update roll-up for the last few weeks
1 parent 350bdda commit f0655e6

File tree

129 files changed

+3548
-970
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+3548
-970
lines changed

Makefile.am

+10-10
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,8 @@ libfsemu2_a_SOURCES = \
848848
fsemu/manymouse/manymouse.h \
849849
fsemu/manymouse/windows_wminput.c \
850850
fsemu/manymouse/x11_xinput2.c \
851+
fsemu/src/fsemu.c \
852+
fsemu/src/fsemu.h \
851853
fsemu/src/fsemu-all.h \
852854
fsemu/src/fsemu-button.h \
853855
fsemu/src/fsemu-action.c \
@@ -1049,13 +1051,11 @@ fsuae_data_files = \
10491051
libfsemu2_a_SOURCES += $(fsemu_data_files)
10501052

10511053
data/.fsemu: $(fsemu_data_files) ${fsuae_data_files}
1052-
mkdir -p $(b)/data/Fonts
1053-
cp $(s)/fsemu/fonts/saira/* $(b)/data/Fonts/
1054-
mkdir -p $(b)/data/Icons
1055-
cp $(s)/fsemu/icons/fontawesome/* $(b)/data/Icons/
1056-
mkdir -p $(b)/data/Images
1057-
cp $(s)/fsemu/images/* $(b)/data/Images/
1058-
cp $(s)/src/fsuae/images/* $(b)/data/Images/
1054+
mkdir -p $(b)/data/
1055+
cp $(s)/fsemu/fonts/saira/* $(b)/data/
1056+
cp $(s)/fsemu/icons/fontawesome/* $(b)/data/
1057+
cp $(s)/fsemu/images/* $(b)/data/
1058+
cp $(s)/src/fsuae/images/* $(b)/data/
10591059
touch data/.fsemu
10601060

10611061
fsemu-data: data/.fsemu
@@ -1731,14 +1731,14 @@ EXTRA_DIST = $(TESTS) $(EXTRA_TESTS) \
17311731
flac/include/FLAC/stream_encoder.h \
17321732
fsemu/gamemode/LICENSE.txt \
17331733
fsemu/gamemode/README.md \
1734+
fsemu/libinih/ini.c \
1735+
fsemu/libinih/ini.h \
1736+
fsemu/libinih/LICENSE.txt \
17341737
fs-uae.spec \
17351738
icon/fs-uae.ico \
17361739
glad/include/glad/glad.h \
17371740
glad/include/KHR/khrplatform.h \
17381741
glad/LICENSE \
1739-
libinih/ini.c \
1740-
libinih/ini.h \
1741-
libinih/LICENSE.txt \
17421742
libnfd/build/dont_run_premake.txt \
17431743
libnfd/build/gmake_linux/Makefile \
17441744
libnfd/build/gmake_linux/nfd.make \

dist/macos/Info.plist.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<key>NSAppleScriptEnabled</key>
4747
<false/>
4848
<key>NSHumanReadableCopyright</key>
49-
<string>Copyright 2011-2019 Frode Solheim</string>
49+
<string>Copyright 2011-2021 Frode Solheim</string>
5050
<key>NSMainNibFile</key>
5151
<string></string>
5252
<key>NSPrincipalClass</key>

docs/compiling.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Install dependencies for bootstrapping and building FS-UAE:
2828
sudo zypper install autoconf automake freetype2-devel gcc gcc-c++ gettext \
2929
glib2-devel libpng-devel libtool libXi-devel openal-devel SDL2-devel zip
3030

31-
## Fedora
31+
### Fedora
3232

3333
Install dependencies for running bootstrap:
3434

@@ -38,7 +38,7 @@ Install dependencies for building FS-UAE:
3838

3939
sudo dnf install SDL2-devel glib2-devel libpng-devel gcc gcc-c++ openal-devel libXi-devel zip libmpeg2-devel SDL2_ttf-devel glew-devel zlib-devel freetype-devel hicolor-icon-theme
4040

41-
## Windows
41+
### Windows
4242

4343
Install latest msys2-x86_64 from www.msys2.org/ and follow the installation
4444
instructions to get an updated MSYS2 installation. Then start

docs/options/uae_rtg_modes

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Summary: RTG color modes
2+
Type: Choice
3+
Default: 0x212
4+
5+
The value is really a bit mask, and other combinations are available.
6+
7+
Value: 0x212 (8bit + 16bit PC + 32bit BGRA)
8+
Value: 0x602 (8bit + 16bit + 32bit BGRA)
9+
Value: 0x112 (8bit + 16bit + 32bit RGBA)

docs/scripts/update.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ def main():
360360
f.close()
361361

362362
with open(
363-
"../fs-uae-launcher/fsgs/options/constants.py", "w", encoding="UTF-8"
363+
"../fs-uae-launcher-private/fsgamesys/options/constants.py", "w", encoding="UTF-8"
364364
) as f:
365365
f.write(
366366
"""\
@@ -375,7 +375,7 @@ def main():
375375
f.write('{} = "{}"\n'.format(key.upper().strip("__"), key))
376376

377377
with open(
378-
"../fs-uae-launcher/fsgs/options/option.py", "w", encoding="UTF-8"
378+
"../fs-uae-launcher-private/fsgamesys/options/option.py", "w", encoding="UTF-8"
379379
) as f:
380380
f.write(
381381
"""\
@@ -394,13 +394,13 @@ class Option(object):
394394
f.write(' {} = "{}"\n'.format(key.upper().strip("__"), key))
395395

396396
with open(
397-
"../fs-uae-launcher/launcher/option.py", "w", encoding="UTF-8"
397+
"../fs-uae-launcher-private/launcher/option.py", "w", encoding="UTF-8"
398398
) as f:
399399
f.write(
400400
"""\
401401
# Automatically generated - do not edit by hand
402402
403-
from fsgs.options.option import Option as BaseOption
403+
from fsgamesys.options.option import Option as BaseOption
404404
405405
406406
# noinspection PyClassHasNoInit
@@ -546,7 +546,7 @@ def lower(s):
546546
for option in sorted(codes.keys()):
547547
write_option(f, option)
548548
shutil.move(
549-
"doc/options2.py", "../fs-uae-launcher/launcher/ui/config/expand.py"
549+
"doc/options2.py", "../fs-uae-launcher-private/launcher/ui/config/expand.py"
550550
)
551551

552552

fsemu/.vscode/c_cpp_properties.json

-24
This file was deleted.

fsemu/.vscode/settings.json

-5
This file was deleted.

fsemu/libinih/LICENSE.txt

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
The "inih" library is distributed under the New BSD license:
3+
4+
Copyright (c) 2009, Ben Hoyt
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without
8+
modification, are permitted provided that the following conditions are met:
9+
* Redistributions of source code must retain the above copyright
10+
notice, this list of conditions and the following disclaimer.
11+
* Redistributions in binary form must reproduce the above copyright
12+
notice, this list of conditions and the following disclaimer in the
13+
documentation and/or other materials provided with the distribution.
14+
* Neither the name of Ben Hoyt nor the names of its contributors
15+
may be used to endorse or promote products derived from this software
16+
without specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY BEN HOYT ''AS IS'' AND ANY
19+
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
DISCLAIMED. IN NO EVENT SHALL BEN HOYT BE LIABLE FOR ANY
22+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

fsemu/libinih/ini.c

+199
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
/* inih -- simple .INI file parser
2+
3+
inih is released under the New BSD license (see LICENSE.txt). Go to the project
4+
home page for more info:
5+
6+
https://github.com/benhoyt/inih
7+
8+
*/
9+
10+
#ifdef HAVE_CONFIG_H
11+
#include "config.h"
12+
#endif
13+
14+
#ifdef USE_GLIB
15+
#include <glib.h>
16+
#endif
17+
18+
#ifdef _MSC_VER
19+
#define _CRT_SECURE_NO_WARNINGS
20+
#endif
21+
22+
#include <stdio.h>
23+
#include <ctype.h>
24+
#include <string.h>
25+
26+
#include "ini.h"
27+
28+
#if !INI_USE_STACK
29+
#include <stdlib.h>
30+
#endif
31+
32+
#define MAX_SECTION 50
33+
#define MAX_NAME 50
34+
35+
/* Strip whitespace chars off end of given string, in place. Return s. */
36+
static char* rstrip(char* s)
37+
{
38+
char* p = s + strlen(s);
39+
while (p > s && isspace((unsigned char)(*--p)))
40+
*p = '\0';
41+
return s;
42+
}
43+
44+
/* Return pointer to first non-whitespace char in given string. */
45+
static char* lskip(const char* s)
46+
{
47+
while (*s && isspace((unsigned char)(*s)))
48+
s++;
49+
return (char*)s;
50+
}
51+
52+
/* Return pointer to first char c or ';' comment in given string, or pointer to
53+
null at end of string if neither found. ';' must be prefixed by a whitespace
54+
character to register as a comment. */
55+
static char* find_char_or_comment(const char* s, char c)
56+
{
57+
int was_whitespace = 0;
58+
while (*s && *s != c && !(was_whitespace && *s == ';')) {
59+
was_whitespace = isspace((unsigned char)(*s));
60+
s++;
61+
}
62+
return (char*)s;
63+
}
64+
65+
/* Version of strncpy that ensures dest (size bytes) is null-terminated. */
66+
static char* strncpy0(char* dest, const char* src, size_t size)
67+
{
68+
strncpy(dest, src, size);
69+
dest[size - 1] = '\0';
70+
return dest;
71+
}
72+
73+
/* See documentation in header file. */
74+
int ini_parse_stream(ini_reader reader, void* stream, ini_handler handler,
75+
void* user)
76+
{
77+
/* Uses a fair bit of stack (use heap instead if you need to) */
78+
#if INI_USE_STACK
79+
char line[INI_MAX_LINE];
80+
#else
81+
char* line;
82+
#endif
83+
char section[MAX_SECTION] = "";
84+
char prev_name[MAX_NAME] = "";
85+
86+
char* start;
87+
char* end;
88+
char* name;
89+
char* value;
90+
int lineno = 0;
91+
int error = 0;
92+
93+
#if !INI_USE_STACK
94+
line = (char*)malloc(INI_MAX_LINE);
95+
if (!line) {
96+
return -2;
97+
}
98+
#endif
99+
100+
/* Scan through stream line by line */
101+
while (reader(line, INI_MAX_LINE, stream) != NULL) {
102+
lineno++;
103+
104+
start = line;
105+
#if INI_ALLOW_BOM
106+
if (lineno == 1 && (unsigned char)start[0] == 0xEF &&
107+
(unsigned char)start[1] == 0xBB &&
108+
(unsigned char)start[2] == 0xBF) {
109+
start += 3;
110+
}
111+
#endif
112+
start = lskip(rstrip(start));
113+
114+
if (*start == ';' || *start == '#') {
115+
/* Per Python ConfigParser, allow '#' comments at start of line */
116+
}
117+
#if INI_ALLOW_MULTILINE
118+
else if (*prev_name && *start && start > line) {
119+
/* Non-black line with leading whitespace, treat as continuation
120+
of previous name's value (as per Python ConfigParser). */
121+
if (!handler(user, section, prev_name, start) && !error)
122+
error = lineno;
123+
}
124+
#endif
125+
else if (*start == '[') {
126+
/* A "[section]" line */
127+
end = find_char_or_comment(start + 1, ']');
128+
if (*end == ']') {
129+
*end = '\0';
130+
strncpy0(section, start + 1, sizeof(section));
131+
*prev_name = '\0';
132+
}
133+
else if (!error) {
134+
/* No ']' found on section line */
135+
error = lineno;
136+
}
137+
}
138+
else if (*start && *start != ';') {
139+
/* Not a comment, must be a name[=:]value pair */
140+
end = find_char_or_comment(start, '=');
141+
if (*end != '=') {
142+
end = find_char_or_comment(start, ':');
143+
}
144+
if (*end == '=' || *end == ':') {
145+
*end = '\0';
146+
name = rstrip(start);
147+
value = lskip(end + 1);
148+
end = find_char_or_comment(value, '\0');
149+
if (*end == ';')
150+
*end = '\0';
151+
rstrip(value);
152+
153+
/* Valid name[=:]value pair found, call handler */
154+
strncpy0(prev_name, name, sizeof(prev_name));
155+
if (!handler(user, section, name, value) && !error)
156+
error = lineno;
157+
}
158+
else if (!error) {
159+
/* No '=' or ':' found on name[=:]value line */
160+
error = lineno;
161+
}
162+
}
163+
164+
#if INI_STOP_ON_FIRST_ERROR
165+
if (error)
166+
break;
167+
#endif
168+
}
169+
170+
#if !INI_USE_STACK
171+
free(line);
172+
#endif
173+
174+
return error;
175+
}
176+
177+
/* See documentation in header file. */
178+
int ini_parse_file(FILE* file, ini_handler handler, void* user)
179+
{
180+
return ini_parse_stream((ini_reader)fgets, file, handler, user);
181+
}
182+
183+
/* See documentation in header file. */
184+
int ini_parse(const char* filename, ini_handler handler, void* user)
185+
{
186+
FILE* file;
187+
int error;
188+
189+
#ifdef USE_GLIB
190+
file = g_fopen(filename, "r");
191+
#else
192+
file = fopen(filename, "r");
193+
#endif
194+
if (!file)
195+
return -1;
196+
error = ini_parse_file(file, handler, user);
197+
fclose(file);
198+
return error;
199+
}

0 commit comments

Comments
 (0)