Commit c0384c9c authored by Sam Lantinga's avatar Sam Lantinga

Added Linux PlayStation 2 Graphics Synthesizer support

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%4071
parent 1b535a71
......@@ -666,6 +666,32 @@ CheckFBCON()
fi
}
dnl See if we're running on PlayStation 2 hardware
CheckPS2GS()
{
dnl AC_ARG_ENABLE(video-ps2gs,
dnl[ --enable-video-ps2gs use PlayStation 2 GS video driver [default=yes]],
dnl , enable_video_ps2gs=yes)
enable_video_ps2gs=yes
if test x$enable_video = xyes -a x$enable_video_ps2gs = xyes; then
dnl AC_MSG_CHECKING(for PlayStation 2 GS support)
video_ps2gs=no
AC_TRY_COMPILE([
#include <linux/ps2/dev.h>
#include <linux/ps2/gs.h>
],[
],[
video_ps2gs=yes
])
dnl AC_MSG_RESULT($video_ps2gs)
if test x$video_ps2gs = xyes; then
CFLAGS="$CFLAGS -DENABLE_PS2GS"
VIDEO_SUBDIRS="$VIDEO_SUBDIRS ps2gs"
VIDEO_DRIVERS="$VIDEO_DRIVERS ps2gs/libvideo_ps2gs.la"
fi
fi
}
dnl Find the GGI includes
CheckGGI()
{
......@@ -1111,6 +1137,7 @@ case "$target" in
CheckNANOX
CheckDGA
CheckFBCON
CheckPS2GS
CheckGGI
CheckSVGA
CheckAAlib
......@@ -2011,6 +2038,7 @@ src/video/x11/Makefile
src/video/dga/Makefile
src/video/nanox/Makefile
src/video/fbcon/Makefile
src/video/ps2gs/Makefile
src/video/ggi/Makefile
src/video/maccommon/Makefile
src/video/macdsp/Makefile
......
......@@ -16,6 +16,7 @@ be found at the <A HREF="http://www.libsdl.org/"> main SDL page</A>.
Major changes since SDL 1.0.0:
</H2>
<UL>
<LI> 1.2.1: Added Linux PlayStation 2 Graphics Synthesizer support
<LI> 1.2.1: Added an audio driver that writes to disk (thanks Ryan!)
<LI> 1.2.1: Mouse wheel sends mouse button (4/5) events on Windows
<LI> 1.2.1: Added MacOS X Project Builder projects (thanks Darrell!)
......
Makefile.in
Makefile
.libs
*.o
*.lo
*.la
## Makefile.am for SDL using the framebuffer console video driver
noinst_LTLIBRARIES = libvideo_ps2gs.la
libvideo_ps2gs_la_SOURCES = $(PS2GS_SRCS)
# The SDL framebuffer console video driver sources
PS2GS_SRCS = \
SDL_gsevents.c \
SDL_gsevents_c.h \
SDL_gskeys.h \
SDL_gsmouse.c \
SDL_gsmouse_c.h \
SDL_gsvideo.c \
SDL_gsvideo.h \
SDL_gsyuv.c \
SDL_gsyuv_c.h
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@devolution.com
*/
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id$";
#endif
#include "SDL_gsvideo.h"
/* Variables and functions exported by SDL_sysevents.c to other parts
of the native video subsystem (SDL_sysvideo.c)
*/
extern int GS_OpenKeyboard(_THIS);
extern void GS_CloseKeyboard(_THIS);
extern int GS_OpenMouse(_THIS);
extern void GS_CloseMouse(_THIS);
extern int GS_EnterGraphicsMode(_THIS);
extern int GS_InGraphicsMode(_THIS);
extern void GS_LeaveGraphicsMode(_THIS);
extern void GS_InitOSKeymap(_THIS);
extern void GS_PumpEvents(_THIS);
/* Scancodes for the Linux framebuffer console
- Taken with thanks from SVGAlib 1.4.0
*/
#define SCANCODE_ESCAPE 1
#define SCANCODE_1 2
#define SCANCODE_2 3
#define SCANCODE_3 4
#define SCANCODE_4 5
#define SCANCODE_5 6
#define SCANCODE_6 7
#define SCANCODE_7 8
#define SCANCODE_8 9
#define SCANCODE_9 10
#define SCANCODE_0 11
#define SCANCODE_MINUS 12
#define SCANCODE_EQUAL 13
#define SCANCODE_BACKSPACE 14
#define SCANCODE_TAB 15
#define SCANCODE_Q 16
#define SCANCODE_W 17
#define SCANCODE_E 18
#define SCANCODE_R 19
#define SCANCODE_T 20
#define SCANCODE_Y 21
#define SCANCODE_U 22
#define SCANCODE_I 23
#define SCANCODE_O 24
#define SCANCODE_P 25
#define SCANCODE_BRACKET_LEFT 26
#define SCANCODE_BRACKET_RIGHT 27
#define SCANCODE_ENTER 28
#define SCANCODE_LEFTCONTROL 29
#define SCANCODE_A 30
#define SCANCODE_S 31
#define SCANCODE_D 32
#define SCANCODE_F 33
#define SCANCODE_G 34
#define SCANCODE_H 35
#define SCANCODE_J 36
#define SCANCODE_K 37
#define SCANCODE_L 38
#define SCANCODE_SEMICOLON 39
#define SCANCODE_APOSTROPHE 40
#define SCANCODE_GRAVE 41
#define SCANCODE_LEFTSHIFT 42
#define SCANCODE_BACKSLASH 43
#define SCANCODE_Z 44
#define SCANCODE_X 45
#define SCANCODE_C 46
#define SCANCODE_V 47
#define SCANCODE_B 48
#define SCANCODE_N 49
#define SCANCODE_M 50
#define SCANCODE_COMMA 51
#define SCANCODE_PERIOD 52
#define SCANCODE_SLASH 53
#define SCANCODE_RIGHTSHIFT 54
#define SCANCODE_KEYPADMULTIPLY 55
#define SCANCODE_LEFTALT 56
#define SCANCODE_SPACE 57
#define SCANCODE_CAPSLOCK 58
#define SCANCODE_F1 59
#define SCANCODE_F2 60
#define SCANCODE_F3 61
#define SCANCODE_F4 62
#define SCANCODE_F5 63
#define SCANCODE_F6 64
#define SCANCODE_F7 65
#define SCANCODE_F8 66
#define SCANCODE_F9 67
#define SCANCODE_F10 68
#define SCANCODE_NUMLOCK 69
#define SCANCODE_SCROLLLOCK 70
#define SCANCODE_KEYPAD7 71
#define SCANCODE_CURSORUPLEFT 71
#define SCANCODE_KEYPAD8 72
#define SCANCODE_CURSORUP 72
#define SCANCODE_KEYPAD9 73
#define SCANCODE_CURSORUPRIGHT 73
#define SCANCODE_KEYPADMINUS 74
#define SCANCODE_KEYPAD4 75
#define SCANCODE_CURSORLEFT 75
#define SCANCODE_KEYPAD5 76
#define SCANCODE_KEYPAD6 77
#define SCANCODE_CURSORRIGHT 77
#define SCANCODE_KEYPADPLUS 78
#define SCANCODE_KEYPAD1 79
#define SCANCODE_CURSORDOWNLEFT 79
#define SCANCODE_KEYPAD2 80
#define SCANCODE_CURSORDOWN 80
#define SCANCODE_KEYPAD3 81
#define SCANCODE_CURSORDOWNRIGHT 81
#define SCANCODE_KEYPAD0 82
#define SCANCODE_KEYPADPERIOD 83
#define SCANCODE_LESS 86
#define SCANCODE_F11 87
#define SCANCODE_F12 88
#define SCANCODE_KEYPADENTER 96
#define SCANCODE_RIGHTCONTROL 97
#define SCANCODE_CONTROL 97
#define SCANCODE_KEYPADDIVIDE 98
#define SCANCODE_PRINTSCREEN 99
#define SCANCODE_RIGHTALT 100
#define SCANCODE_BREAK 101 /* Beware: is 119 */
#define SCANCODE_BREAK_ALTERNATIVE 119 /* on some keyboards! */
#define SCANCODE_HOME 102
#define SCANCODE_CURSORBLOCKUP 103 /* Cursor key block */
#define SCANCODE_PAGEUP 104
#define SCANCODE_CURSORBLOCKLEFT 105 /* Cursor key block */
#define SCANCODE_CURSORBLOCKRIGHT 106 /* Cursor key block */
#define SCANCODE_END 107
#define SCANCODE_CURSORBLOCKDOWN 108 /* Cursor key block */
#define SCANCODE_PAGEDOWN 109
#define SCANCODE_INSERT 110
#define SCANCODE_REMOVE 111
#define SCANCODE_RIGHTWIN 126
#define SCANCODE_LEFTWIN 125
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@devolution.com
*/
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id$";
#endif
#include <stdlib.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include "SDL_error.h"
#include "SDL_mouse.h"
#include "SDL_events_c.h"
#include "SDL_cursor_c.h"
#include "SDL_gsvideo.h"
#include "SDL_gsmouse_c.h"
/* The implementation dependent data for the window manager cursor */
struct WMcursor {
int unused;
};
/* There isn't any implementation dependent data */
void GS_FreeWMCursor(_THIS, WMcursor *cursor)
{
return;
}
/* There isn't any implementation dependent data */
WMcursor *GS_CreateWMCursor(_THIS,
Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y)
{
return((WMcursor *)0x01);
}
static void GS_MoveCursor(_THIS, SDL_Cursor *cursor, int x, int y)
{
SDL_Surface *screen;
struct ps2_image image;
SDL_Rect area;
int mouse_y1, mouse_y2;
void *saved_pixels;
int screen_updated;
/* Lock so we don't interrupt an update with mouse motion */
SDL_LockCursor();
/* Make sure any pending DMA has completed */
if ( dma_pending ) {
ioctl(console_fd, PS2IOC_SENDQCT, 1);
dma_pending = 0;
}
/* Remove the cursor image from the DMA area */
screen = this->screen;
saved_pixels = screen->pixels;
screen->pixels = mapped_mem + screen->offset;
screen_updated = 0;
if ( cursor_drawn ) {
SDL_EraseCursorNoLock(this->screen);
cursor_drawn = 0;
screen_updated = 1;
}
/* Save the current mouse area */
SDL_MouseRect(&area);
mouse_y1 = area.y;
mouse_y2 = area.y+area.h;
/* Only draw the new cursor if there was one passed in */
if ( cursor ) {
/* Set the new location */
cursor->area.x = (x - cursor->hot_x);
cursor->area.y = (y - cursor->hot_y);
/* Draw the cursor at the new location */
if ( (SDL_cursorstate & CURSOR_VISIBLE) && screen->pixels ) {
SDL_DrawCursorNoLock(screen);
cursor_drawn = 1;
screen_updated = 1;
}
}
screen->pixels = saved_pixels;
/* Update the affected area of the screen */
if ( screen_updated ) {
SDL_MouseRect(&area);
if ( area.y < mouse_y1 ) {
mouse_y1 = area.y;
}
if ( (area.y+area.h) > mouse_y2 ) {
mouse_y2 = area.y+area.h;
}
image = screen_image;
image.y = screen->offset / screen->pitch + mouse_y1;
image.h = mouse_y2 - mouse_y1;
image.ptr = mapped_mem + image.y * screen->pitch;
ioctl(console_fd, PS2IOC_LOADIMAGE, &image);
}
/* We're finished */
SDL_UnlockCursor();
}
void GS_MoveWMCursor(_THIS, int x, int y)
{
GS_MoveCursor(this, SDL_cursor, x, y);
}
int GS_ShowWMCursor(_THIS, WMcursor *wmcursor)
{
SDL_Cursor *cursor;
int x, y;
/* Draw the cursor at the appropriate location */
SDL_GetMouseState(&x, &y);
if ( wmcursor ) {
cursor = SDL_cursor;
} else {
cursor = NULL;
}
GS_MoveCursor(this, cursor, x, y);
return(1);
}
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@devolution.com
*/
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id$";
#endif
#include "SDL_gsvideo.h"
/* This is the maximum size of the cursor sprite */
#define CURSOR_W 32
#define CURSOR_H 32
#define CURSOR_W_POW 5 /* 32 = 2^5 */
#define CURSOR_H_POW 5 /* 32 = 2^5 */
/* Functions to be exported */
extern void GS_FreeWMCursor(_THIS, WMcursor *cursor);
extern WMcursor *GS_CreateWMCursor(_THIS,
Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
extern void GS_DrawCursor(SDL_Surface *screen);
extern void GS_EraseCursor(SDL_Surface *screen);
extern void GS_MoveWMCursor(_THIS, int x, int y);
extern int GS_ShowWMCursor(_THIS, WMcursor *cursor);
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@devolution.com
*/
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id$";
#endif
#ifndef _SDL_gsvideo_h
#define _SDL_gsvideo_h
#include <sys/types.h>
#include <termios.h>
#include <linux/ps2/dev.h>
#include <linux/ps2/gs.h>
#include "SDL_mouse.h"
#include "SDL_mutex.h"
#include "SDL_sysvideo.h"
/* Hidden "this" pointer for the video functions */
#define _THIS SDL_VideoDevice *this
/* Private display data */
struct SDL_PrivateVideoData {
/* Gotta love that simple PS2 graphics interface. :) */
int console_fd;
int memory_fd;
struct ps2_screeninfo saved_vinfo;
/* Ye olde linux keyboard code */
int current_vt;
int saved_vt;
int keyboard_fd;
int saved_kbd_mode;
struct termios saved_kbd_termios;
/* Ye olde linux mouse code */
int mouse_fd;
int cursor_drawn;
/* The memory mapped DMA area and associated variables */
caddr_t mapped_mem;
int pixels_len;
int mapped_len;
struct ps2_image screen_image;
int screen_image_size;
unsigned long long *head_tags_mem;
unsigned long long *image_tags_mem;
int dma_pending;
};
/* Old variable names */
#define console_fd (this->hidden->console_fd)
#define memory_fd (this->hidden->memory_fd)
#define saved_vinfo (this->hidden->saved_vinfo)
#define current_vt (this->hidden->current_vt)
#define saved_vt (this->hidden->saved_vt)
#define keyboard_fd (this->hidden->keyboard_fd)
#define saved_kbd_mode (this->hidden->saved_kbd_mode)
#define saved_kbd_termios (this->hidden->saved_kbd_termios)
#define mouse_fd (this->hidden->mouse_fd)
#define cursor_drawn (this->hidden->cursor_drawn)
#define mapped_mem (this->hidden->mapped_mem)
#define pixels_len (this->hidden->pixels_len)
#define mapped_len (this->hidden->mapped_len)
#define screen_image (this->hidden->screen_image)
#define screen_image_size (this->hidden->screen_image_size)
#define head_tags_mem (this->hidden->head_tags_mem)
#define image_tags_mem (this->hidden->image_tags_mem)
#define dma_pending (this->hidden->dma_pending)
#endif /* _SDL_gsvideo_h */
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997, 1998, 1999, 2000 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@devolution.com
*/
#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id$";
#endif
/* This is the Playstation 2 implementation of YUV video overlays */
#include "SDL_video.h"
#include "SDL_gsvideo.h"
extern SDL_Overlay *GS_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display);
extern int GS_LockYUVOverlay(_THIS, SDL_Overlay *overlay);
extern void GS_UnlockYUVOverlay(_THIS, SDL_Overlay *overlay);
extern int GS_DisplayYUVOverlay(_THIS, SDL_Overlay *overlay, SDL_Rect *dstrect);
extern void GS_FreeYUVOverlay(_THIS, SDL_Overlay *overlay);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment