Skip to content

Commit 5e9a493

Browse files
committed
Vsync, some refactoring, RPI4 improvements
1 parent 1572da3 commit 5e9a493

File tree

173 files changed

+4686
-1731
lines changed

Some content is hidden

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

173 files changed

+4686
-1731
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
autom4te.cache
88
*.autosave
99
/base-dir
10+
/benchmark.txt
1011
/build/
1112
build68k
1213
/cef/

.vscode/c_cpp_properties.json

+36
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"${workspaceFolder}",
77
"${workspaceFolder}/fsemu/src",
88
"${workspaceFolder}/gen",
9+
"${workspaceFolder}/glad/include",
910
"${workspaceFolder}/src",
1011
"${workspaceFolder}/src/jit",
1112
"${workspaceFolder}/src/include",
@@ -33,6 +34,41 @@
3334
"cStandard": "c11",
3435
"cppStandard": "c++17",
3536
"intelliSenseMode": "clang-x64"
37+
},
38+
{
39+
"name": "Mac",
40+
"includePath": [
41+
"${workspaceFolder}",
42+
"${workspaceFolder}/fsemu/src",
43+
"${workspaceFolder}/gen",
44+
"${workspaceFolder}/glad/include",
45+
"${workspaceFolder}/src",
46+
"${workspaceFolder}/src/jit",
47+
"${workspaceFolder}/src/include",
48+
"${workspaceFolder}/src/od-fs",
49+
"${workspaceFolder}/src/od-fs/include",
50+
"${workspaceFolder}/src/od-win32",
51+
"${workspaceFolder}/src/od-win32/caps",
52+
"${workspaceFolder}/libfsemu/include",
53+
"${workspaceFolder}/libnfd/src/include",
54+
"${workspaceFolder}/libudis86/include",
55+
"${workspaceFolder}/prowizard/include",
56+
"/opt/fs-sdk/macos-x86-64/include",
57+
"/opt/fs-sdk/macos-x86-64/include/glib-2.0",
58+
"/opt/fs-sdk/macos-x86-64/lib/glib-2.0/include"
59+
],
60+
"defines": [
61+
"FSEMU=1",
62+
"FSEMU_INTERNAL=1",
63+
"FSUAE=1",
64+
"MACOS=1",
65+
"HAVE_CONFIG_H=1",
66+
"UAE=1"
67+
],
68+
"compilerPath": "/usr/bin/gcc",
69+
"cStandard": "c11",
70+
"cppStandard": "c++17",
71+
"intelliSenseMode": "clang-x64"
3672
}
3773
],
3874
"version": 4

Makefile.am

+16-4
Original file line numberDiff line numberDiff line change
@@ -847,10 +847,10 @@ libfsemu2_a_SOURCES = \
847847
fsemu/src/fsemu-action.c \
848848
fsemu/src/fsemu-action.h \
849849
fsemu/src/fsemu-actions.h \
850-
fsemu/src/fsemu-audio-alsa.c \
851-
fsemu/src/fsemu-audio-alsa.h \
852-
fsemu/src/fsemu-audio-buffer.c \
853-
fsemu/src/fsemu-audio-buffer.h \
850+
fsemu/src/fsemu-alsaaudio.c \
851+
fsemu/src/fsemu-alsaaudio.h \
852+
fsemu/src/fsemu-audiobuffer.c \
853+
fsemu/src/fsemu-audiobuffer.h \
854854
fsemu/src/fsemu-audio.c \
855855
fsemu/src/fsemu-audio.h \
856856
fsemu/src/fsemu-axis.h \
@@ -880,6 +880,8 @@ libfsemu2_a_SOURCES = \
880880
fsemu/src/fsemu-fontcache.h \
881881
fsemu/src/fsemu-frame.c \
882882
fsemu/src/fsemu-frame.h \
883+
fsemu/src/fsemu-frameinfo.c \
884+
fsemu/src/fsemu-frameinfo.h \
883885
fsemu/src/fsemu-gamemode.c \
884886
fsemu/src/fsemu-gamemode.h \
885887
fsemu/src/fsemu-glib.h \
@@ -912,8 +914,14 @@ libfsemu2_a_SOURCES = \
912914
fsemu/src/fsemu-layer.h \
913915
fsemu/src/fsemu-layout.c \
914916
fsemu/src/fsemu-layout.h \
917+
fsemu/src/fsemu-led.c \
918+
fsemu/src/fsemu-led.h \
919+
fsemu/src/fsemu-leds.c \
920+
fsemu/src/fsemu-leds.h \
915921
fsemu/src/fsemu-log.c \
916922
fsemu/src/fsemu-log.h \
923+
fsemu/src/fsemu-main.c \
924+
fsemu/src/fsemu-main.h \
917925
fsemu/src/fsemu-mainmenu.c \
918926
fsemu/src/fsemu-mainmenu.h \
919927
fsemu/src/fsemu-manymouse.c \
@@ -945,6 +953,8 @@ libfsemu2_a_SOURCES = \
945953
fsemu/src/fsemu-perfgui.h \
946954
fsemu/src/fsemu-quit.c \
947955
fsemu/src/fsemu-quit.h \
956+
fsemu/src/fsemu-recording.c \
957+
fsemu/src/fsemu-recording.h \
948958
fsemu/src/fsemu-refable.c \
949959
fsemu/src/fsemu-refable.h \
950960
fsemu/src/fsemu-render.c \
@@ -964,6 +974,8 @@ libfsemu2_a_SOURCES = \
964974
fsemu/src/fsemu-sdlvideo.h \
965975
fsemu/src/fsemu-sdlwindow.c \
966976
fsemu/src/fsemu-sdlwindow.h \
977+
fsemu/src/fsemu-semaphore.c \
978+
fsemu/src/fsemu-semaphore.h \
967979
fsemu/src/fsemu-shader.c \
968980
fsemu/src/fsemu-shader.h \
969981
fsemu/src/fsemu-startupinfo.c \

STATUS

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Status
2+
3+
In general, the focus has been to make the core functionality better, i.e. to
4+
create a better foundation for FS-UAE going forward. This means that right
5+
now, FS-UAE it less configurable (*) than before, but also hopefully works
6+
better out of the box.
7+
8+
(*) Amiga emulation-related options are still support. Only host options such
9+
as display, input and audio options are affected by this.
10+
11+
If you want to try, please make sure to read the section "Things you cannot do
12+
right now" If there are any deal-breakers there for you, you might want to
13+
wait.
14+
15+
## Notable changes
16+
17+
- Rewritten video/audio/input system. Should be easier to understand and
18+
extend with new features (at least for me).
19+
- Includes support for hotpluggable devices.
20+
- Can be more easily extended with other audio/video drivers (such as using
21+
ALSA directly), but current version uses SDL for audio and SDL+OpenGL for
22+
video.
23+
- Making better use of high-resolution timers to ensure the emulation runs
24+
smoothly also in fastest-possible CPU mode. This allows for v-sync in
25+
fastest possible mode and emulated CPU cycle count is much more stable.
26+
- Audio latency can also generally be lower due to timing improvements.
27+
- FS-UAE should work better with G-SYNC and FreeSync monitors.
28+
- New GUI look all over (not complete yet).
29+
- Truetype font rendering for better readability and internationalization.
30+
- Make the user interface adapt better to non-16:9 displays.
31+
- Better support for high-DPI displays.
32+
- New standard bezel which tries to frame the 4:3 output while being pleasant.
33+
- On-screen LEDs by default (TODO).
34+
- On-screen keyboard (F11 or SELECT to toggle) - Visual look not done yet.
35+
- New performance overlay (Alt/Cmd+O) which makes it easier to identify
36+
performance issues.
37+
- Much improved support for Raspberry Pi 4.
38+
- Replaced QEMU-UAE-based slirp with latest libslirp from QEMU, and also
39+
fixed a race condition causing crash or corrupt data transfer. This improves
40+
the stabiliy of the A2065 emulation.
41+
- Integrated MIDI output support via portmidi (tested on Linux). Can use to
42+
for example play Sierra games with an external MT-32 emulator.
43+
- Updated emulation code from WinUAE 4.2.1. Allows for use of UAE expansions
44+
with AmigaOS 4.1 (for example directory hard drives). Also enabled
45+
x86 bridgeboard emulation (tested and works, not officially supported yet).
46+
47+
## Issues and things you cannot do right now!
48+
49+
Video:
50+
51+
- Only a fixed viewport / zoom is support for now.
52+
- Scaling / zoom options do not have any effect yet.
53+
- No shader support, only bilinear filtering (always on).
54+
- No support for themes right now.
55+
- Monitor selection does not work.
56+
57+
Audio:
58+
59+
- Audio buffer size and output frequency is not configurable right now.
60+
- CD audio does not work.
61+
62+
Input:
63+
64+
- Input mapping is not configurable at this time.
65+
- Most input-related options will have no effect at this point.
66+
- Not using Raw input on Windows right now; some keys may not be intercepted
67+
properly on Windows for full keyboard emulation.
68+
- Support for multiple mice is not ready yet.
69+
- Joystick support may be limited to gamepad-like devices right now.
70+
71+
Other:
72+
73+
- Translations not supported at this time.
74+
- Net play support is not ready yet.
75+
- GUI rendering is not optimized yet, GUI element textures are created for
76+
each frame and not reused. This can negatively affect performance on slower
77+
systems when GUI elements are shown on-screen.
78+
79+
## Raspberry Pi 4
80+
81+
- Efficiency improvements related to rendering makes FS-UAE run better on the RPI4.
82+
- Official build supports running under both X11 and in console (KMSDRM).
83+
- Requires FKMS / experimental OpenGL support to be enabled on the Raspberry Pi.
84+
- Automatically switches to 1920x1080p @50Hz if the mode is available.
85+
- Overclocking to 2 Ghz is recommended (that's what I've been testing with).
86+
- Make sure the RPI4 can run cool enough constantly without throttling the CPU;
87+
An active/passive cooling solution - or a Raspberry Pi 400 is recommended.
88+
- Run `sudo cpufreq-set -g performance` to make sure all cores run at full speed
89+
while FS-UAE is running (install with `sudo apt install cpufrequtils`).

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ AM_INIT_AUTOMAKE([tar-ustar subdir-objects])
2222

2323
AC_SUBST([PACKAGE_SERIES], [devel])
2424

25-
AC_DEFINE_UNQUOTED([UAE_BASE_VERSION], ["WinUAE 4210"],
25+
AC_DEFINE_UNQUOTED([UAE_BASE_VERSION], ["WinUAE 4.2.1"],
2626
[Which UAE core this version is based on.])
2727

2828
PACKAGE_MAJOR=`echo ${PACKAGE_VERSION} | sed -e 's,\(\.*\)\..*\..*,\1,g'`

fsemu/src/fsemu-action.c

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "fsemu-internal.h"
1+
#define FSEMU_INTERNAL 1
22
#include "fsemu-action.h"
33

44
#include <stdio.h>
@@ -10,6 +10,8 @@
1010
#include "fsemu-savestate.h"
1111
#include "fsemu-thread.h"
1212

13+
int fsemu_action_log_level = FSEMU_LOG_LEVEL_INFO;
14+
1315
void fsemu_action_post_from_main(uint16_t action)
1416
{
1517
fsemu_thread_assert_main();
@@ -29,7 +31,8 @@ void fsemu_action_process_non_emu(fsemu_action_t action,
2931
{
3032
fsemu_thread_assert_main();
3133

32-
printf("fsemu_action_process_non_emu %04x %04x\n", action, state);
34+
fsemu_action_log_debug(
35+
"fsemu_action_process_non_emu %04x %04x\n", action, state);
3336

3437
if (action == FSEMU_ACTION_OSKEYBOARD) {
3538
if (state) {
@@ -58,19 +61,19 @@ void fsemu_action_process_command_in_main(fsemu_action_t action,
5861

5962
switch (action) {
6063
case FSEMU_ACTION_PAUSE:
61-
fsemu_action_log("[MAIN] FSEMU_ACTION_PAUSE\n");
64+
fsemu_action_log_debug("FSEMU_ACTION_PAUSE\n");
6265
fsemu_control_set_paused_internal(state != 0);
6366
break;
6467

6568
case FSEMU_ACTION_PAUSE_DISABLE:
66-
fsemu_action_log("[MAIN] FSEMU_ACTION_PAUSE_DISABLE\n");
69+
fsemu_action_log_debug("FSEMU_ACTION_PAUSE_DISABLE\n");
6770
if (state) {
6871
fsemu_control_set_paused_internal(false);
6972
}
7073
break;
7174

7275
case FSEMU_ACTION_PAUSE_ENABLE:
73-
fsemu_action_log("[MAIN] FSEMU_ACTION_PAUSE_ENABLE\n");
76+
fsemu_action_log_debug("FSEMU_ACTION_PAUSE_ENABLE\n");
7477
if (state) {
7578
fsemu_control_set_paused_internal(true);
7679
}
@@ -81,27 +84,27 @@ void fsemu_action_process_command_in_main(fsemu_action_t action,
8184
// post a new event (or rewrite this one) based on previous pause
8285
// state and make the action explicit (enable or disable).
8386
// Otherwise we risk emu and main thread getting out of sync.
84-
fsemu_action_log("[MAIN] FSEMU_ACTION_PAUSE_DISABLE\n");
87+
fsemu_action_log_debug("FSEMU_ACTION_PAUSE_DISABLE\n");
8588
fsemu_warning("Pause toggle action not supported yet\n");
8689
// if (state) {
8790
// fsemu_control_set_paused_internal(!fsemu_control_paused());
8891
// }
8992
break;
9093

9194
case FSEMU_ACTION_WARP:
92-
fsemu_action_log("[MAIN] FSEMU_ACTION_WARP\n");
95+
fsemu_action_log_debug("FSEMU_ACTION_WARP\n");
9396
fsemu_control_set_warp_internal(state != 0);
9497
break;
9598

9699
case FSEMU_ACTION_WARP_DISABLE:
97-
fsemu_action_log("[MAIN] FSEMU_ACTION_WARP_DISABLE\n");
100+
fsemu_action_log_debug("FSEMU_ACTION_WARP_DISABLE\n");
98101
if (state) {
99102
fsemu_control_set_warp_internal(false);
100103
}
101104
break;
102105

103106
case FSEMU_ACTION_WARP_ENABLE:
104-
fsemu_action_log("[MAIN] FSEMU_ACTION_WARP_ENABLE\n");
107+
fsemu_action_log_debug("FSEMU_ACTION_WARP_ENABLE\n");
105108
if (state) {
106109
fsemu_control_set_warp_internal(true);
107110
}
@@ -112,7 +115,7 @@ void fsemu_action_process_command_in_main(fsemu_action_t action,
112115
// post a new event (or rewrite this one) based on previous warp
113116
// state and make the action explicit (enable or disable).
114117
// Otherwise we risk emu and main thread getting out of sync.
115-
fsemu_action_log("[MAIN] FSEMU_ACTION_WARP_DISABLE\n");
118+
fsemu_action_log_debug("FSEMU_ACTION_WARP_DISABLE\n");
116119
fsemu_warning("Warp toggle action not supported yet\n");
117120
// if (state) {
118121
// fsemu_control_set_paused_internal(!fsemu_control_paused());

fsemu/src/fsemu-action.h

+24-1
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,31 @@ void fsemu_action_process_non_emu(fsemu_action_t action,
4444
void fsemu_action_process_command_in_main(fsemu_action_t action,
4545
int16_t state);
4646

47+
// ----------------------------------------------------------------------------
48+
// Logging
49+
// ----------------------------------------------------------------------------
50+
51+
extern int fsemu_action_log_level;
52+
4753
#define fsemu_action_log(format, ...) \
48-
fsemu_log("[FSEMU] [ACTION] " format, ##__VA_ARGS__)
54+
FSEMU_LOG(action, "[FSE] [ACT]", format, ##__VA_ARGS__)
55+
56+
#define fsemu_action_log_debug(format, ...) \
57+
FSEMU_LOG_DEBUG(action, "[FSE] [ACT]", format, ##__VA_ARGS__)
58+
59+
#define fsemu_action_log_error(format, ...) \
60+
FSEMU_LOG_ERROR(action, "[FSE] [ACT]", format, ##__VA_ARGS__)
61+
62+
#define fsemu_action_log_info(format, ...) \
63+
FSEMU_LOG_INFO(action, "[FSE] [ACT]", format, ##__VA_ARGS__)
64+
65+
#define fsemu_action_log_trace(format, ...) \
66+
FSEMU_LOG_TRACE(action, "[FSE] [ACT]", format, ##__VA_ARGS__)
67+
68+
#define fsemu_action_log_warning(format, ...) \
69+
FSEMU_LOG_WARNING(action, "[FSE] [ACT]", format, ##__VA_ARGS__)
70+
71+
// ----------------------------------------------------------------------------
4972

5073
#ifdef __cplusplus
5174
}

fsemu/src/fsemu-actions.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ enum {
2626

2727
enum {
2828
FSEMU_ACTION_BEFORE_FIRST_COMMAND =
29-
0x0800 | FSEMU_ACTION_NONEMU_FLAG | FSEMU_ACTION_COMMAND_FLAG,
29+
0x0C00 | FSEMU_ACTION_NONEMU_FLAG | FSEMU_ACTION_COMMAND_FLAG,
3030
// FSEMU_ACTION_TOGGLE_PAUSE, // TOGGLEPAUSE
3131
// FSEMU_ACTION_NOPAUSE,
3232

@@ -339,6 +339,7 @@ enum {
339339
// FSEMU_ACTION_PORT2DISCONNECT,
340340
// FSEMU_ACTION_PORT3DISCONNECT,
341341

342+
// FIXME: PORTxDEVICEy are not really emu actions?
342343
FSEMU_ACTION_PORT0DEVICE0,
343344
FSEMU_ACTION_PORT0DEVICE1,
344345
FSEMU_ACTION_PORT0DEVICE2,

fsemu/src/fsemu-all.c

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ extern "C" {
4242
#include "fsemu-inputport.c"
4343
#include "fsemu-layout.c"
4444
#include "fsemu-log.c"
45+
#include "fsemu-main.c"
4546
#include "fsemu-mainmenu.c"
4647
#include "fsemu-manymouse.c"
4748
#include "fsemu-media.c"

fsemu/src/fsemu-all.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
#include "fsemu-action.h"
55
#include "fsemu-actions.h"
6-
#include "fsemu-audio-alsa.h"
7-
#include "fsemu-audio-buffer.h"
6+
#include "fsemu-alsaaudio.h"
87
#include "fsemu-audio.h"
8+
#include "fsemu-audiobuffer.h"
99
#include "fsemu-axis.h"
1010
#include "fsemu-background.h"
1111
#include "fsemu-button.h"
@@ -37,6 +37,7 @@
3737
#include "fsemu-layer.h"
3838
#include "fsemu-layout.h"
3939
#include "fsemu-log.h"
40+
#include "fsemu-main.h"
4041
#include "fsemu-mainmenu.h"
4142
#include "fsemu-manymouse.h"
4243
#include "fsemu-media.h"

0 commit comments

Comments
 (0)