mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-06-25 18:29:41 +00:00
Remove legacy APIs from SheepShaver
This commit is contained in:
parent
856a58ef61
commit
b0ef509c08
|
@ -1 +0,0 @@
|
|||
../../../../BasiliskII/src/Unix/Irix/audio_irix.cpp
|
|
@ -1 +0,0 @@
|
|||
../../../BasiliskII/src/Unix/audio_oss_esd.cpp
|
|
@ -31,12 +31,8 @@ esac
|
|||
dnl Options.
|
||||
AC_ARG_ENABLE(jit, [ --enable-jit enable JIT compiler [default=yes]], [WANT_JIT=$enableval], [WANT_JIT=yes])
|
||||
AC_ARG_ENABLE(ppc-emulator, [ --enable-ppc-emulator use the selected PowerPC emulator [default=auto]], [WANT_EMULATED_PPC=$enableval], [WANT_EMULATED_PPC=auto])
|
||||
AC_ARG_ENABLE(fbdev-dga, [ --enable-fbdev-dga use direct frame buffer access via /dev/fb0 [default=yes]], [WANT_FBDEV_DGA=$enableval], [WANT_FBDEV_DGA=yes])
|
||||
AC_ARG_ENABLE(xf86-dga, [ --enable-xf86-dga use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes])
|
||||
AC_ARG_ENABLE(xf86-vidmode, [ --enable-xf86-vidmode use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes])
|
||||
AC_ARG_ENABLE(vosf, [ --enable-vosf enable video on SEGV signals [default=no]], [WANT_VOSF=$enableval], [WANT_VOSF=no])
|
||||
AC_ARG_ENABLE(standalone-gui,[ --enable-standalone-gui enable a standalone GUI prefs editor [default=no]], [WANT_STANDALONE_GUI=$enableval], [WANT_STANDALONE_GUI=no])
|
||||
AC_ARG_WITH(esd, [ --with-esd support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes])
|
||||
AC_ARG_WITH(gtk, [ --with-gtk use GTK user interface [default=yes]],
|
||||
[case "$withval" in
|
||||
gtk1) WANT_GTK="gtk";;
|
||||
|
@ -177,9 +173,6 @@ dnl Do we need SDL?
|
|||
WANT_SDL=no
|
||||
if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
|
||||
WANT_SDL=yes
|
||||
WANT_XF86_DGA=no
|
||||
WANT_XF86_VIDMODE=no
|
||||
WANT_FBDEV_DGA=no
|
||||
SDL_SUPPORT="$SDL_SUPPORT video"
|
||||
fi
|
||||
if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
|
||||
|
@ -254,19 +247,6 @@ else
|
|||
SDL_SUPPORT="none"
|
||||
fi
|
||||
|
||||
dnl We need X11, if not using SDL.
|
||||
if [[ "x$WANT_SDL_VIDEO" != "xyes" ]]; then
|
||||
AC_PATH_XTRA
|
||||
if [[ "x$no_x" = "xyes" ]]; then
|
||||
AC_MSG_ERROR([You need X11 to run SheepShaver.])
|
||||
fi
|
||||
CFLAGS="$CFLAGS $X_CFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $X_CFLAGS"
|
||||
LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
dnl We need pthreads on non-PowerPC systems. Try libpthread first, then libc_r (FreeBSD), then PTL.
|
||||
HAVE_PTHREADS=yes
|
||||
case $EMULATED_PPC:$target_os in
|
||||
|
@ -302,38 +282,6 @@ if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
|
|||
AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
|
||||
fi
|
||||
|
||||
dnl We use FBDev DGA if possible.
|
||||
if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then
|
||||
AC_CHECK_HEADER(linux/fb.h, [
|
||||
AC_DEFINE(ENABLE_FBDEV_DGA, 1, [Define if using Linux fbdev extension.])
|
||||
], [
|
||||
AC_MSG_WARN([Could not find Linux FBDev extension, ignoring --enable-fbdev-dga.])
|
||||
WANT_FBDEV_DGA=no
|
||||
])
|
||||
fi
|
||||
|
||||
dnl We use XFree86 DGA if possible.
|
||||
if [[ "x$WANT_XF86_DGA" = "xyes" ]]; then
|
||||
AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, [
|
||||
AC_DEFINE(ENABLE_XF86_DGA, 1, [Define if using XFree86 DGA extension.])
|
||||
LIBS="$LIBS -lXxf86dga"
|
||||
], [
|
||||
AC_MSG_WARN([Could not find XFree86 DGA extension, ignoring --enable-xf86-dga.])
|
||||
WANT_XF86_DGA=no
|
||||
])
|
||||
fi
|
||||
|
||||
dnl We use XFree86 VidMode if possible.
|
||||
if [[ "x$WANT_XF86_VIDMODE" = "xyes" ]]; then
|
||||
AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, [
|
||||
AC_DEFINE(ENABLE_XF86_VIDMODE, 1, [Define if using XFree86 DGA extension.])
|
||||
LIBS="$LIBS -lXxf86vm"
|
||||
], [
|
||||
AC_MSG_WARN([Could not find XFree86 VidMode extension, ignoring --enable-xf86-vidmode.])
|
||||
WANT_XF86_VIDMODE=no
|
||||
])
|
||||
fi
|
||||
|
||||
dnl We use GTK+ if possible.
|
||||
UISRCS=../dummy/prefs_editor_dummy.cpp
|
||||
case "x$WANT_GTK" in
|
||||
|
@ -383,20 +331,6 @@ if [[ "$WANT_GTK" = "no" ]]; then
|
|||
fi
|
||||
AC_SUBST(STANDALONE_GUI, [$WANT_STANDALONE_GUI])
|
||||
|
||||
dnl We use ESD if possible.
|
||||
if [[ "x$WANT_ESD" = "xyes" ]]; then
|
||||
WANT_ESD=no
|
||||
AM_PATH_ESD(0.2.8, [
|
||||
AC_DEFINE(ENABLE_ESD, 1, [Define is using ESD.])
|
||||
CFLAGS="$CFLAGS $ESD_CFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $ESD_CFLAGS"
|
||||
LIBS="$LIBS $ESD_LIBS"
|
||||
WANT_ESD=yes
|
||||
], [
|
||||
AC_MSG_WARN([Could not find ESD, disabling ESD support.])
|
||||
])
|
||||
fi
|
||||
|
||||
dnl We use 64-bit file size support if possible.
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
|
@ -637,7 +571,6 @@ EXTRASYSSRCS=
|
|||
case "$target_os" in
|
||||
linux*)
|
||||
ETHERSRC=ether_unix.cpp
|
||||
AUDIOSRC=audio_oss_esd.cpp
|
||||
SCSISRC=Linux/scsi_linux.cpp
|
||||
if [[ "x$EMULATED_PPC" = "xno" ]]; then
|
||||
EXTRASYSSRCS="paranoia.cpp Linux/sheepthreads.c ppc_asm.S"
|
||||
|
@ -667,27 +600,11 @@ darwin*)
|
|||
CPPFLAGS="$CPPFLAGS -I../MacOSX/Launcher"
|
||||
fi
|
||||
fi
|
||||
if [[ "x$WANT_ESD" = "xno" -a "x$ac_cv_framework_CoreAudio" = "xyes" -a "x$WANT_SDL_AUDIO" = "xno" ]]; then
|
||||
if [[ "x$ac_cv_framework_CoreAudio" = "xyes" -a "x$WANT_SDL_AUDIO" = "xno" ]]; then
|
||||
AUDIOSRC="../MacOSX/audio_macosx.cpp ../MacOSX/AudioBackEnd.cpp ../MacOSX/AudioDevice.cpp ../MacOSX/MacOSX_sound_if.cpp"
|
||||
OSX_CORE_AUDIO="-DOSX_CORE_AUDIO"
|
||||
fi
|
||||
;;
|
||||
irix*)
|
||||
AUDIOSRC=Irix/audio_irix.cpp
|
||||
LIBS="$LIBS -laudio"
|
||||
WANT_ESD=no
|
||||
|
||||
dnl Check if our compiler supports -IPA (MIPSPro)
|
||||
HAVE_IPA=no
|
||||
ocflags="$CFLAGS"
|
||||
CFLAGS=`echo " $CFLAGS -IPA" | sed -e "s/ -g //g"`
|
||||
AC_MSG_CHECKING(if "-IPA" works)
|
||||
dnl Do a test compile of an empty function
|
||||
AC_TRY_COMPILE([#if defined __GNUC__
|
||||
# error GCC does not support IPA yet
|
||||
#endif],, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
|
||||
CFLAGS="$ocflags"
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl BINCUE
|
||||
|
@ -1744,13 +1661,9 @@ 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
|
||||
echo XFree86 DGA support .............. : $WANT_XF86_DGA
|
||||
echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE
|
||||
echo Using PowerPC emulator ........... : $EMULATED_PPC
|
||||
echo Enable JIT compiler .............. : $WANT_JIT
|
||||
echo Enable video on SEGV signals ..... : $WANT_VOSF
|
||||
echo ESD sound support ................ : $WANT_ESD
|
||||
echo GTK user interface ............... : $WANT_GTK
|
||||
echo mon debugger support ............. : $WANT_MON
|
||||
echo Addressing mode .................. : $WANT_ADDRESSING_MODE
|
||||
|
|
|
@ -125,21 +125,8 @@
|
|||
#include <string>
|
||||
#endif
|
||||
|
||||
#ifndef USE_SDL_VIDEO
|
||||
#include <X11/Xlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_GTK
|
||||
#include <gtk/gtk.h>
|
||||
#if !defined(GDK_WINDOWING_QUARTZ) && !defined(GDK_WINDOWING_WAYLAND)
|
||||
#include <X11/Xlib.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_XF86_DGA
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/extensions/Xxf86dga.h>
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_MON
|
||||
|
@ -199,14 +186,6 @@ uint8 gZeroPage[0x3000], gKernelData[0x2000];
|
|||
#endif
|
||||
|
||||
// Global variables
|
||||
#ifndef USE_SDL_VIDEO
|
||||
char *x_display_name = NULL; // X11 display name
|
||||
Display *x_display = NULL; // X11 display handle
|
||||
#ifdef X11_LOCK_TYPE
|
||||
X11_LOCK_TYPE x_display_lock = X11_LOCK_INIT; // X11 display lock
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static int zero_fd = 0; // FD of /dev/zero
|
||||
static bool lm_area_mapped = false; // Flag: Low Memory area mmap()ped
|
||||
static bool rom_area_mapped = false; // Flag: Mac ROM mmap()ped
|
||||
|
@ -680,8 +659,7 @@ static bool install_signal_handlers(void)
|
|||
|
||||
static std::string sdl_vmdir;
|
||||
|
||||
static bool init_sdl()
|
||||
{
|
||||
static bool init_sdl(){
|
||||
int sdl_flags = 0;
|
||||
#ifdef USE_SDL_VIDEO
|
||||
sdl_flags |= SDL_INIT_VIDEO;
|
||||
|
@ -727,11 +705,7 @@ static bool init_sdl()
|
|||
}
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#if defined(ENABLE_GTK) && !defined(GDK_WINDOWING_QUARTZ) && !defined(GDK_WINDOWING_WAYLAND)
|
||||
XInitThreads();
|
||||
#endif
|
||||
int main(int argc, char **argv){
|
||||
char str[256];
|
||||
bool memory_mapped_from_zero, ram_rom_areas_contiguous;
|
||||
const char *vmdir = NULL;
|
||||
|
@ -782,12 +756,6 @@ int main(int argc, char **argv)
|
|||
argv[i] = NULL;
|
||||
} else if (strcmp(argv[i], "--help") == 0) {
|
||||
usage(argv[0]);
|
||||
#ifndef USE_SDL_VIDEO
|
||||
} else if (strcmp(argv[i], "--display") == 0) {
|
||||
i++;
|
||||
if (i < argc)
|
||||
x_display_name = strdup(argv[i]);
|
||||
#endif
|
||||
} else if (strcmp(argv[i], "--gui-connection") == 0) {
|
||||
argv[i++] = NULL;
|
||||
if (i < argc) {
|
||||
|
@ -858,22 +826,6 @@ int main(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef USE_SDL_VIDEO
|
||||
// Open display
|
||||
x_display = XOpenDisplay(x_display_name);
|
||||
if (x_display == NULL) {
|
||||
char str[256];
|
||||
sprintf(str, GetString(STR_NO_XSERVER_ERR), XDisplayName(x_display_name));
|
||||
ErrorAlert(str);
|
||||
goto quit;
|
||||
}
|
||||
|
||||
#if defined(ENABLE_XF86_DGA) && !defined(ENABLE_MON)
|
||||
// Fork out, so we can return from fullscreen mode when things get ugly
|
||||
XF86DGAForkApp(DefaultScreen(x_display));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_MON
|
||||
// Initialize mon
|
||||
mon_init();
|
||||
|
@ -1200,12 +1152,6 @@ static void Quit(void)
|
|||
mon_exit();
|
||||
#endif
|
||||
|
||||
// Close X11 server connection
|
||||
#ifndef USE_SDL_VIDEO
|
||||
if (x_display)
|
||||
XCloseDisplay(x_display);
|
||||
#endif
|
||||
|
||||
// Notify GUI we are about to leave
|
||||
if (gui_connection) {
|
||||
if (rpc_method_invoke(gui_connection, RPC_METHOD_EXIT, RPC_TYPE_INVALID) == RPC_ERROR_NO_ERROR)
|
||||
|
@ -2303,20 +2249,18 @@ void display_alert(int title_id, int prefix_id, int button_id, const char *text)
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Display error alert
|
||||
*/
|
||||
|
||||
void ErrorAlert(const char *text)
|
||||
{
|
||||
void ErrorAlert(const char *text){
|
||||
if (gui_connection) {
|
||||
if (rpc_method_invoke(gui_connection, RPC_METHOD_ERROR_ALERT, RPC_TYPE_STRING, text, RPC_TYPE_INVALID) == RPC_ERROR_NO_ERROR &&
|
||||
rpc_method_wait_for_reply(gui_connection, RPC_TYPE_INVALID) == RPC_ERROR_NO_ERROR)
|
||||
return;
|
||||
}
|
||||
#if defined(ENABLE_GTK) && !defined(USE_SDL_VIDEO)
|
||||
if (PrefsFindBool("nogui") || x_display == NULL) {
|
||||
if (PrefsFindBool("nogui")) {
|
||||
printf(GetString(STR_SHELL_ERROR_PREFIX), text);
|
||||
return;
|
||||
}
|
||||
|
@ -2327,20 +2271,18 @@ void ErrorAlert(const char *text)
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Display warning alert
|
||||
*/
|
||||
|
||||
void WarningAlert(const char *text)
|
||||
{
|
||||
void WarningAlert(const char *text){
|
||||
if (gui_connection) {
|
||||
if (rpc_method_invoke(gui_connection, RPC_METHOD_WARNING_ALERT, RPC_TYPE_STRING, text, RPC_TYPE_INVALID) == RPC_ERROR_NO_ERROR &&
|
||||
rpc_method_wait_for_reply(gui_connection, RPC_TYPE_INVALID) == RPC_ERROR_NO_ERROR)
|
||||
return;
|
||||
}
|
||||
#if defined(ENABLE_GTK) && !defined(USE_SDL_VIDEO)
|
||||
if (PrefsFindBool("nogui") || x_display == NULL) {
|
||||
if (PrefsFindBool("nogui")) {
|
||||
printf(GetString(STR_SHELL_WARNING_PREFIX), text);
|
||||
return;
|
||||
}
|
||||
|
@ -2350,7 +2292,6 @@ void WarningAlert(const char *text)
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Display choice alert
|
||||
*/
|
||||
|
|
|
@ -711,7 +711,6 @@ static GtkWidget *w_frameskip, *w_display_x, *w_display_y;
|
|||
static GtkWidget *l_frameskip, *l_display_x, *l_display_y;
|
||||
static int display_type;
|
||||
static int dis_width, dis_height;
|
||||
static bool is_fbdev_dga_mode = false;
|
||||
|
||||
static GtkWidget *w_dspdevice_file, *w_mixerdevice_file;
|
||||
|
||||
|
@ -772,8 +771,7 @@ static void tb_nosound(GtkWidget *widget)
|
|||
}
|
||||
|
||||
// Read and convert graphics preferences
|
||||
static void parse_graphics_prefs(void)
|
||||
{
|
||||
static void parse_graphics_prefs(void){
|
||||
display_type = DISPLAY_WINDOW;
|
||||
dis_width = 640;
|
||||
dis_height = 480;
|
||||
|
@ -784,12 +782,6 @@ static void parse_graphics_prefs(void)
|
|||
display_type = DISPLAY_WINDOW;
|
||||
else if (sscanf(str, "dga/%d/%d", &dis_width, &dis_height) == 2)
|
||||
display_type = DISPLAY_SCREEN;
|
||||
#ifdef ENABLE_FBDEV_DGA
|
||||
else if (sscanf(str, "fbdev/%d/%d", &dis_width, &dis_height) == 2) {
|
||||
is_fbdev_dga_mode = true;
|
||||
display_type = DISPLAY_SCREEN;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
uint32 window_modes = PrefsFindInt32("windowmodes");
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user