mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-11-28 23:49:23 +00:00
*** empty log message ***
This commit is contained in:
parent
f511d7ffc2
commit
baf8c9438c
428
BasiliskII/src/Unix/configure
vendored
428
BasiliskII/src/Unix/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -6,11 +6,12 @@ AC_PREREQ(2.12)
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Options.
|
||||
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(fbdev-dga, [ --enable-fbdev-dga use direct frame buffer access via /dev/fb [default=yes]], [WANT_FBDEV_DGA=$enableval], [WANT_FBDEV_DGA=yes])
|
||||
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]], [WANT_GTK=$withval], [WANT_GTK=yes])
|
||||
AC_ARG_WITH(mon, [ --with-mon use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=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(fbdev-dga, [ --enable-fbdev-dga use direct frame buffer access via /dev/fb [default=yes]], [WANT_FBDEV_DGA=$enableval], [WANT_FBDEV_DGA=yes])
|
||||
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]], [WANT_GTK=$withval], [WANT_GTK=yes])
|
||||
AC_ARG_WITH(mon, [ --with-mon use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes])
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
@ -86,6 +87,18 @@ else
|
||||
DEFINES="$DEFINES -DENABLE_FBDEV_DGA=0"
|
||||
fi
|
||||
|
||||
dnl We use XFree86 VidMode if possible.
|
||||
if [[ "x$WANT_XF86_VIDMODE" = "xyes" ]]; then
|
||||
AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, [
|
||||
DEFINES="$DEFINES -DENABLE_XF86_VIDMODE=1"
|
||||
LIBS="$LIBS -lXxf86vm"
|
||||
], [
|
||||
AC_MSG_WARN([Could not find XFree86 VidMode extension, ignoring --enable-xf86-vidmode.])
|
||||
WANT_XF86_VIDMODE=no
|
||||
DEFINES="$DEFINES -DENABLE_XF86_VIDMODE=0"
|
||||
])
|
||||
fi
|
||||
|
||||
dnl We use GTK+ if possible.
|
||||
UISRCS=../dummy/prefs_editor_dummy.cpp
|
||||
if [[ "x$WANT_GTK" = "xyes" ]]; then
|
||||
@ -294,6 +307,7 @@ echo
|
||||
echo Basilisk II configuration summary:
|
||||
echo
|
||||
echo XFree86 DGA support .............. : $WANT_XF86_DGA
|
||||
echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE
|
||||
echo fbdev DGA support ................ : $WANT_FBDEV_DGA
|
||||
echo ESD sound support ................ : $WANT_ESD
|
||||
echo GTK user interface ............... : $WANT_GTK
|
||||
|
@ -52,6 +52,10 @@
|
||||
#include <X11/extensions/xf86dga.h>
|
||||
#endif
|
||||
|
||||
#if ENABLE_XF86_VIDMODE
|
||||
#include <X11/extensions/xf86vmode.h>
|
||||
#endif
|
||||
|
||||
#if ENABLE_FBDEV_DGA
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
@ -82,6 +86,7 @@ static volatile bool redraw_thread_cancel = false; // Flag: Cancel Redraw thread
|
||||
static pthread_t redraw_thread; // Redraw thread
|
||||
|
||||
static bool has_dga = false; // Flag: Video DGA capable
|
||||
static bool has_vidmode = false; // Flag: VidMode extension available
|
||||
|
||||
static bool ctrl_down = false; // Flag: Ctrl key pressed
|
||||
static bool caps_on = false; // Flag: Caps Lock on
|
||||
@ -134,6 +139,12 @@ static pthread_mutex_t frame_buffer_lock = PTHREAD_MUTEX_INITIALIZER; // Mutex t
|
||||
const char FBDEVICE_FILE_NAME[] = "/dev/fb";
|
||||
static int fbdev_fd;
|
||||
|
||||
#if ENABLE_XF86_VIDMODE
|
||||
// Variables for XF86 VidMode support
|
||||
static XF86VidModeModeInfo **x_video_modes; // Array of all available modes
|
||||
static int num_x_video_modes;
|
||||
#endif
|
||||
|
||||
|
||||
// Prototypes
|
||||
static void *redraw_func(void *arg);
|
||||
@ -482,6 +493,21 @@ static bool init_xf86_dga(int width, int height)
|
||||
// Set relative mouse mode
|
||||
ADBSetRelMouseMode(true);
|
||||
|
||||
#if ENABLE_XF86_VIDMODE
|
||||
// Switch to best mode
|
||||
if (has_vidmode) {
|
||||
int best = 0;
|
||||
for (int i=1; i<num_x_video_modes; i++) {
|
||||
if (x_video_modes[i]->hdisplay >= width && x_video_modes[i]->vdisplay >= height &&
|
||||
x_video_modes[i]->hdisplay <= x_video_modes[best]->hdisplay && x_video_modes[i]->vdisplay <= x_video_modes[best]->vdisplay) {
|
||||
best = i;
|
||||
}
|
||||
}
|
||||
XF86VidModeSwitchToMode(x_display, screen, x_video_modes[best]);
|
||||
XF86VidModeSetViewPort(x_display, screen, 0, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Create window
|
||||
XSetWindowAttributes wattr;
|
||||
wattr.event_mask = eventmask = dga_eventmask;
|
||||
@ -635,11 +661,11 @@ bool VideoInit(bool classic)
|
||||
else
|
||||
has_dga = false;
|
||||
#endif
|
||||
|
||||
|
||||
#if ENABLE_XF86_DGA
|
||||
// DGA available?
|
||||
int event_base, error_base;
|
||||
if (XF86DGAQueryExtension(x_display, &event_base, &error_base)) {
|
||||
int dga_event_base, dga_error_base;
|
||||
if (XF86DGAQueryExtension(x_display, &dga_event_base, &dga_error_base)) {
|
||||
int dga_flags = 0;
|
||||
XF86DGAQueryDirectVideo(x_display, screen, &dga_flags);
|
||||
has_dga = dga_flags & XF86DGADirectPresent;
|
||||
@ -647,6 +673,14 @@ bool VideoInit(bool classic)
|
||||
has_dga = false;
|
||||
#endif
|
||||
|
||||
#if ENABLE_XF86_VIDMODE
|
||||
// VidMode available?
|
||||
int vm_event_base, vm_error_base;
|
||||
has_vidmode = XF86VidModeQueryExtension(x_display, &vm_event_base, &vm_error_base);
|
||||
if (has_vidmode)
|
||||
XF86VidModeGetAllModeLines(x_display, screen, &num_x_video_modes, &x_video_modes);
|
||||
#endif
|
||||
|
||||
// Find black and white colors
|
||||
XParseColor(x_display, DefaultColormap(x_display, screen), "rgb:00/00/00", &black);
|
||||
XAllocColor(x_display, DefaultColormap(x_display, screen), &black);
|
||||
@ -798,6 +832,11 @@ void VideoExit(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENABLE_XF86_VIDMODE
|
||||
if (has_vidmode && display_type == DISPLAY_DGA)
|
||||
XF86VidModeSwitchToMode(x_display, screen, x_video_modes[0]);
|
||||
#endif
|
||||
|
||||
#if ENABLE_FBDEV_DGA
|
||||
if (display_type == DISPLAY_DGA) {
|
||||
XUngrabPointer(x_display, CurrentTime);
|
||||
|
Loading…
Reference in New Issue
Block a user