termux-packages/x11-packages/sdl/SDL-1.2.15_src_video_fbcon_...

50 lines
1.4 KiB
Diff

diff -uNr SDL-1.2.15/src/video/fbcon/SDL_fbvideo.c SDL-1.2.15.mod/src/video/fbcon/SDL_fbvideo.c
--- SDL-1.2.15/src/video/fbcon/SDL_fbvideo.c 2012-01-19 08:30:06.000000000 +0200
+++ SDL-1.2.15.mod/src/video/fbcon/SDL_fbvideo.c 2018-10-26 23:20:45.212057874 +0300
@@ -27,6 +27,7 @@
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
+#include <sys/syscall.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
@@ -52,16 +53,15 @@
#if defined(i386) && defined(FB_TYPE_VGA_PLANES)
#define VGA16_FBCON_SUPPORT
-#include <sys/io.h> /* For ioperm() */
#ifndef FB_AUX_VGA_PLANES_VGA4
#define FB_AUX_VGA_PLANES_VGA4 0
#endif
-/*
+
static inline void outb (unsigned char value, unsigned short port)
{
__asm__ __volatile__ ("outb %b0,%w1"::"a" (value), "Nd" (port));
-}
-*/
+}
+
#endif /* FB_TYPE_VGA_PLANES */
/* A list of video resolutions that we query for (sorted largest to smallest) */
@@ -280,7 +280,7 @@
FB_Available, FB_CreateDevice
};
-#define FB_MODES_DB "/etc/fb.modes"
+#define FB_MODES_DB "@TERMUX_PREFIX@/etc/fb.modes"
static int read_fbmodes_line(FILE*f, char* line, int length)
{
@@ -541,7 +541,7 @@
case FB_TYPE_VGA_PLANES:
/* VGA16 is supported, but that's it */
if ( finfo.type_aux == FB_AUX_VGA_PLANES_VGA4 ) {
- if ( ioperm(0x3b4, 0x3df - 0x3b4 + 1, 1) < 0 ) {
+ if ( syscall(__NR_ioperm, 0x3b4, 0x3df - 0x3b4 + 1, 1) < 0 ) {
SDL_SetError("No I/O port permissions");
FB_VideoQuit(this);
return(-1);