Merge branch 'snes9xgit:master' into master

This commit is contained in:
StanleyKid-22 2024-02-14 15:44:58 +02:00 committed by GitHub
commit 7b7f126f5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 98 additions and 32 deletions

View File

@ -965,6 +965,7 @@ void S9xDeinitDisplay()
if (driver) if (driver)
driver->deinit(); driver->deinit();
delete driver; delete driver;
driver = nullptr;
if (pool) if (pool)
{ {

View File

@ -1293,8 +1293,17 @@ void Snes9xWindow::leave_fullscreen_mode()
} }
#endif #endif
#ifdef GDK_WINDOWING_WAYLAND
if (GDK_IS_WAYLAND_WINDOW(gdk_window))
{
S9xDeinitDisplay();
}
#endif
window->unfullscreen(); window->unfullscreen();
window->show();
#ifdef GDK_WINDOWING_X11 #ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_WINDOW(gdk_window)) if (GDK_IS_X11_WINDOW(gdk_window))
{ {
@ -1310,6 +1319,15 @@ void Snes9xWindow::leave_fullscreen_mode()
config->rom_loaded = rom_loaded; config->rom_loaded = rom_loaded;
config->fullscreen = 0; config->fullscreen = 0;
configure_widgets(); configure_widgets();
window->show();
#ifdef GDK_WINDOWING_WAYLAND
if (GDK_IS_WAYLAND_WINDOW(gdk_window))
{
S9xReinitDisplay();
}
#endif
} }
void Snes9xWindow::resize_viewport(int width, int height) void Snes9xWindow::resize_viewport(int width, int height)

View File

@ -74,7 +74,7 @@ set(SNES9X_CORE_SOURCES
../fscompat.cpp) ../fscompat.cpp)
add_library(snes9x-core ${SNES9X_CORE_SOURCES}) add_library(snes9x-core ${SNES9X_CORE_SOURCES})
target_include_directories(snes9x-core PRIVATE ../) target_include_directories(snes9x-core PRIVATE ../)
target_compile_definitions(snes9x-core PRIVATE ZLIB HAVE_STDINT_H ALLOW_CPU_OVERCLOCK) target_compile_definitions(snes9x-core PRIVATE ${DEFINES} ZLIB HAVE_STDINT_H ALLOW_CPU_OVERCLOCK)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(PREBUILT_QT "${PROJECT_SOURCE_DIR}/../external/qt6-mingw-clang-bin") set(PREBUILT_QT "${PROJECT_SOURCE_DIR}/../external/qt6-mingw-clang-bin")

64
unix/configure vendored
View File

@ -7264,18 +7264,60 @@ fi
if test "x$enable_sound" = "xyes"; then if test "x$enable_sound" = "xyes"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether sound is supported on this platform" >&5 ac_fn_cxx_check_header_compile "$LINENO" "sys/soundcard.h" "ac_cv_header_sys_soundcard_h" "$ac_includes_default"
printf %s "checking whether sound is supported on this platform... " >&6; } if test "x$ac_cv_header_sys_soundcard_h" = xyes
if test "x$snes9x_cv_linux_os" = "xyes"; then then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _oss_ioctl in -lossaudio" >&5
else printf %s "checking for _oss_ioctl in -lossaudio... " >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 if test ${ac_cv_lib_ossaudio__oss_ioctl+y}
printf "%s\n" "no" >&6; } then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Your OS is not Linux. Build without sound support." >&5 printf %s "(cached) " >&6
printf "%s\n" "$as_me: WARNING: Your OS is not Linux. Build without sound support." >&2;} else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lossaudio $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
namespace conftest {
extern "C" int _oss_ioctl ();
}
int
main (void)
{
return conftest::_oss_ioctl ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"
then :
ac_cv_lib_ossaudio__oss_ioctl=yes
else $as_nop
ac_cv_lib_ossaudio__oss_ioctl=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ossaudio__oss_ioctl" >&5
printf "%s\n" "$ac_cv_lib_ossaudio__oss_ioctl" >&6; }
if test "x$ac_cv_lib_ossaudio__oss_ioctl" = xyes
then :
S9XLIBS="$S9XLIBS -lossaudio"
fi
else $as_nop
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Your OS does not have OSS. Build without sound support." >&5
printf "%s\n" "$as_me: WARNING: Your OS does not have OSS. Build without sound support." >&2;}
enable_sound="no" enable_sound="no"
fi
fi
fi fi
if test "x$enable_sound" = "xyes"; then if test "x$enable_sound" = "xyes"; then

View File

@ -479,14 +479,16 @@ AC_ARG_ENABLE([sound],
[], [enable_sound="yes"]) [], [enable_sound="yes"])
if test "x$enable_sound" = "xyes"; then if test "x$enable_sound" = "xyes"; then
AC_MSG_CHECKING([whether sound is supported on this platform]) AC_CHECK_HEADER([sys/soundcard.h],
if test "x$snes9x_cv_linux_os" = "xyes"; then [
AC_MSG_RESULT([yes]) AC_CHECK_LIB([ossaudio], [_oss_ioctl], [
else S9XLIBS="$S9XLIBS -lossaudio"
AC_MSG_RESULT([no]) ], [], [])
AC_MSG_WARN([Your OS is not Linux. Build without sound support.]) ],
[
AC_MSG_WARN([Your OS does not have OSS. Build without sound support.])
enable_sound="no" enable_sound="no"
fi ])
fi fi
if test "x$enable_sound" = "xyes"; then if test "x$enable_sound" = "xyes"; then

View File

@ -164,7 +164,7 @@ static bool8 ReadJoysticks (void);
void S9xLatchJSEvent(); void S9xLatchJSEvent();
#endif #endif
static long log2 (long num) static long snes9x_log2 (long num)
{ {
long n = 0; long n = 0;
@ -1456,7 +1456,7 @@ bool8 S9xOpenSoundDevice (void)
bool(unixSettings.ThreadSound) bool(unixSettings.ThreadSound)
); );
J = log2(unixSettings.SoundFragmentSize) | (4 << 16); J = snes9x_log2(unixSettings.SoundFragmentSize) | (4 << 16);
if (ioctl(so.sound_fd, SNDCTL_DSP_SETFRAGMENT, &J) == -1) if (ioctl(so.sound_fd, SNDCTL_DSP_SETFRAGMENT, &J) == -1)
return (FALSE); return (FALSE);

View File

@ -124,6 +124,9 @@ bool Swapchain::create(unsigned int desired_num_swapchain_images, int new_width,
else else
num_swapchain_images = desired_num_swapchain_images; num_swapchain_images = desired_num_swapchain_images;
// If extents aren't reported (Wayland), we have to rely on Wayland to report
// the size, so keep current extent.
if (surface_capabilities.currentExtent.width != -1)
extents = surface_capabilities.currentExtent; extents = surface_capabilities.currentExtent;
uint32_t graphics_queue_index = 0; uint32_t graphics_queue_index = 0;