mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-01-15 21:32:12 +00:00
Merge pull request #220 from atsampson/fixsdl
Update SheepShaver for SDL2 support
This commit is contained in:
commit
d684527b27
@ -991,6 +991,7 @@ void driver_base::set_video_mode(int flags)
|
||||
void driver_base::init()
|
||||
{
|
||||
set_video_mode(display_type == DISPLAY_SCREEN ? SDL_WINDOW_FULLSCREEN : 0);
|
||||
#ifndef SHEEPSHAVER
|
||||
// manually set palette for 24bit ROM
|
||||
// 24 bit ROM Macintosh is BW screen. It doesn't setup palette by the ROM.
|
||||
if (TwentyFourBitAddressing && !sdl_palette) {
|
||||
@ -1003,6 +1004,7 @@ void driver_base::init()
|
||||
}
|
||||
update_palette();
|
||||
}
|
||||
#endif
|
||||
|
||||
int aligned_height = (VIDEO_MODE_Y + 15) & ~15;
|
||||
|
||||
|
@ -72,6 +72,7 @@ AC_ARG_ENABLE(sdl-video, [ --enable-sdl-video use SDL for video graphic
|
||||
AC_ARG_ENABLE(sdl-audio, [ --enable-sdl-audio use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no])
|
||||
AC_ARG_ENABLE(sdl-framework, [ --enable-sdl-framework use SDL framework [default=no]], [WANT_SDL_FRAMEWORK=$enableval], [WANT_SDL_FRAMEWORK=no])
|
||||
AC_ARG_ENABLE(sdl-framework-prefix, [ --enable-sdl-framework-prefix=PFX default=/Library/Frameworks], [SDL_FRAMEWORK="$enableval"], [SDL_FRAMEWORK=/Library/Frameworks])
|
||||
AC_ARG_WITH(sdl2, [ --with-sdl2 use SDL 2.x, rather than SDL 1.x [default=no]], [WANT_SDL_VERSION_MAJOR=2], [WANT_SDL_VERSION_MAJOR=1])
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
@ -144,7 +145,7 @@ dnl Checks for libraries.
|
||||
AC_CHECK_LIB(posix4, sem_init)
|
||||
AC_CHECK_LIB(m, cos)
|
||||
|
||||
dnl AC_CHECK_SDLFRAMEWORK($1=NAME, $2=INCLUDES)
|
||||
dnl AC_CHECK_SDLFRAMEWORK($1=NAME, $2=INCLUDES, $3=ACTION_IF_SUCCESSFUL, $4=ACTION_IF_UNSUCCESSFUL)
|
||||
dnl AC_TRY_LINK uses main() but SDL needs main to take args,
|
||||
dnl therefore main is undefined with #undef.
|
||||
dnl Framework can be in an custom location.
|
||||
@ -154,18 +155,16 @@ AC_DEFUN([AC_CHECK_SDLFRAMEWORK], [
|
||||
ac_Framework, [
|
||||
saved_LIBS="$LIBS"
|
||||
LIBS="$LIBS -framework $1"
|
||||
if [[ "x$SDL_FRAMEWORK" != "x/Library/Frameworks" ]]; then
|
||||
if [[ "x$SDL_FRAMEWORK" != "x/System/Library/Frameworks" ]]; then
|
||||
LIBS="$saved_LIBS -F$SDL_FRAMEWORK -framework $1"
|
||||
fi
|
||||
if [[ "x$SDL_FRAMEWORK" != "x/System/Library/Frameworks" ]]; then
|
||||
LIBS="$saved_LIBS -F$SDL_FRAMEWORK -framework $1"
|
||||
fi
|
||||
saved_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS -I$SDL_FRAMEWORK/SDL.framework/Headers"
|
||||
CPPFLAGS="$CPPFLAGS -I$SDL_FRAMEWORK/$1.framework/Headers"
|
||||
AC_TRY_LINK(
|
||||
[$2
|
||||
#undef main], [],
|
||||
[AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no);
|
||||
LIBS="$saved_LIBS"; CPPFLAGS="$saved_CPPFLAGS"]
|
||||
[AS_VAR_SET(ac_Framework, yes); $3], [AS_VAR_SET(ac_Framework, no);
|
||||
LIBS="$saved_LIBS"; CPPFLAGS="$saved_CPPFLAGS"; $4]
|
||||
)
|
||||
])
|
||||
AS_IF([test AS_VAR_GET(ac_Framework) = yes],
|
||||
@ -189,27 +188,66 @@ if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
|
||||
fi
|
||||
if [[ "x$WANT_SDL" = "xyes" ]]; then
|
||||
if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then
|
||||
AC_CHECK_SDLFRAMEWORK(SDL, [#include <SDL.h>])
|
||||
TEMP_WANT_SDL_VERSION_MAJOR=$WANT_SDL_VERSION_MAJOR
|
||||
if [[ "x$TEMP_WANT_SDL_VERSION_MAJOR" = "x" ]]; then
|
||||
TEMP_WANT_SDL_VERSION_MAJOR=2
|
||||
fi
|
||||
if [[ "x$TEMP_WANT_SDL_VERSION_MAJOR" = "x2" ]]; then
|
||||
AC_CHECK_SDLFRAMEWORK(SDL2, [#include <SDL.h>], [
|
||||
WANT_SDL_VERSION_MAJOR=2
|
||||
], [
|
||||
TEMP_WANT_SDL_VERSION_MAJOR=1
|
||||
])
|
||||
fi
|
||||
if [[ "x$TEMP_WANT_SDL_VERSION_MAJOR" = "x1" ]]; then
|
||||
AC_CHECK_SDLFRAMEWORK(SDL, [#include <SDL.h>], [
|
||||
WANT_SDL_VERSION_MAJOR=1
|
||||
])
|
||||
fi
|
||||
else
|
||||
ac_cv_framework_SDL=no
|
||||
fi
|
||||
if [[ "x$ac_cv_framework_SDL" = "xno" ]]; then
|
||||
AC_PATH_PROG(sdl_config, "sdl-config")
|
||||
if [[ -n "$sdl_config" ]]; then
|
||||
sdl_cflags=`$sdl_config --cflags`
|
||||
if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
|
||||
sdl_libs=`$sdl_config --static-libs`
|
||||
if [[ "x$WANT_SDL_VERSION_MAJOR" = "x1" ]]; then
|
||||
AC_DEFINE(ENABLE_SDL1, 1, [Define if using SDL1.])
|
||||
AC_PATH_PROG(sdl_config, "sdl-config")
|
||||
if [[ -n "$sdl_config" ]]; then
|
||||
sdl_cflags=`$sdl_config --cflags`
|
||||
if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
|
||||
sdl_libs=`$sdl_config --static-libs`
|
||||
else
|
||||
sdl_libs=`$sdl_config --libs`
|
||||
fi
|
||||
CFLAGS="$CFLAGS $sdl_cflags"
|
||||
CXXFLAGS="$CXXFLAGS $sdl_cflags"
|
||||
LIBS="$LIBS $sdl_libs"
|
||||
else
|
||||
sdl_libs=`$sdl_config --libs`
|
||||
WANT_SDL=no
|
||||
WANT_SDL_VIDEO=no
|
||||
WANT_SDL_AUDIO=no
|
||||
SDL_SUPPORT="none"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "x$WANT_SDL_VERSION_MAJOR" = "x2" ]]; then
|
||||
AC_DEFINE(ENABLE_SDL2, 1, [Define if using SDL2.])
|
||||
AC_PATH_PROG(sdl_config, "sdl2-config")
|
||||
if [[ -n "$sdl_config" ]]; then
|
||||
sdl_cflags=`$sdl_config --cflags`
|
||||
if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
|
||||
sdl_libs=`$sdl_config --static-libs`
|
||||
else
|
||||
sdl_libs=`$sdl_config --libs`
|
||||
fi
|
||||
CFLAGS="$CFLAGS $sdl_cflags"
|
||||
CXXFLAGS="$CXXFLAGS $sdl_cflags"
|
||||
LIBS="$LIBS $sdl_libs"
|
||||
else
|
||||
WANT_SDL=no
|
||||
WANT_SDL_VIDEO=no
|
||||
WANT_SDL_AUDIO=no
|
||||
SDL_SUPPORT="none"
|
||||
fi
|
||||
CFLAGS="$CFLAGS $sdl_cflags"
|
||||
CXXFLAGS="$CXXFLAGS $sdl_cflags"
|
||||
LIBS="$LIBS $sdl_libs"
|
||||
else
|
||||
WANT_SDL=no
|
||||
WANT_SDL_VIDEO=no
|
||||
WANT_SDL_AUDIO=no
|
||||
SDL_SUPPORT="none"
|
||||
fi
|
||||
fi
|
||||
SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"`
|
||||
@ -712,7 +750,7 @@ if [[ "x$WANT_SDL" = "xyes" ]]; then
|
||||
fi
|
||||
if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
|
||||
AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support.])
|
||||
VIDEOSRCS="../SDL/video_sdl.cpp"
|
||||
VIDEOSRCS="../SDL/video_sdl.cpp ../SDL/video_sdl2.cpp"
|
||||
KEYCODES="../SDL/keycodes"
|
||||
if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
|
||||
AC_MSG_CHECKING([whether __LP64__ is defined])
|
||||
@ -1704,6 +1742,7 @@ echo
|
||||
echo SheepShaver configuration summary:
|
||||
echo
|
||||
echo SDL support ...................... : $SDL_SUPPORT
|
||||
echo SDL major-version ................ : $WANT_SDL_VERSION_MAJOR
|
||||
echo BINCUE support ................... : $have_bincue
|
||||
echo LIBVHD support ................... : $have_libvhd
|
||||
echo FBDev DGA support ................ : $WANT_FBDEV_DGA
|
||||
|
@ -167,6 +167,11 @@ enum {
|
||||
STR_WINDOW_TITLE = 4000,
|
||||
STR_WINDOW_TITLE_FROZEN,
|
||||
STR_WINDOW_TITLE_GRABBED,
|
||||
STR_WINDOW_TITLE_GRABBED0,
|
||||
STR_WINDOW_TITLE_GRABBED1,
|
||||
STR_WINDOW_TITLE_GRABBED2,
|
||||
STR_WINDOW_TITLE_GRABBED3,
|
||||
STR_WINDOW_TITLE_GRABBED4,
|
||||
STR_WINDOW_MENU = 4050,
|
||||
STR_WINDOW_ITEM_ABOUT,
|
||||
STR_WINDOW_ITEM_REFRESH,
|
||||
|
@ -173,6 +173,16 @@ user_string_def common_strings[] = {
|
||||
{STR_WINDOW_TITLE, "SheepShaver"},
|
||||
{STR_WINDOW_TITLE_FROZEN, "SheepShaver *** FROZEN ***"},
|
||||
{STR_WINDOW_TITLE_GRABBED, "SheepShaver (mouse grabbed, press Ctrl-F5 to release)"},
|
||||
{STR_WINDOW_TITLE_GRABBED0, "SheepShaver (mouse grabbed, press "},
|
||||
{STR_WINDOW_TITLE_GRABBED1, "Ctrl-"},
|
||||
#ifdef __MACOSX__
|
||||
{STR_WINDOW_TITLE_GRABBED2, "Opt-"},
|
||||
{STR_WINDOW_TITLE_GRABBED3, "Cmd-"},
|
||||
#else
|
||||
{STR_WINDOW_TITLE_GRABBED2, "Alt-"},
|
||||
{STR_WINDOW_TITLE_GRABBED3, "Win-"},
|
||||
#endif
|
||||
{STR_WINDOW_TITLE_GRABBED4, "F5 to release)"},
|
||||
{STR_WINDOW_MENU, "SheepShaver"},
|
||||
{STR_WINDOW_ITEM_ABOUT, "About SheepShaver" ELLIPSIS},
|
||||
{STR_WINDOW_ITEM_REFRESH, "Refresh Rate"},
|
||||
|
Loading…
x
Reference in New Issue
Block a user