src/video/ps2gs/SDL_gsvideo.h
author Sam Lantinga <slouken@libsdl.org>
Wed, 01 Feb 2006 06:32:25 +0000
changeset 1312 c9b51268668f
parent 252 e8157fcb3114
child 1361 19418e4422cb
permissions -rw-r--r--
Updated copyright information and removed rcs id lines (problematic in branch merges)
I batch edited these files, so please let me know if I've accidentally removed anybody's
credit here.
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2006 Sam Lantinga
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Lesser General Public
     7     License as published by the Free Software Foundation; either
     8     version 2.1 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Lesser General Public License for more details.
    14 
    15     You should have received a copy of the GNU Lesser General Public
    16     License along with this library; if not, write to the Free Software
    17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 
    23 #ifndef _SDL_gsvideo_h
    24 #define _SDL_gsvideo_h
    25 
    26 #include <sys/types.h>
    27 #include <termios.h>
    28 #include <linux/ps2/dev.h>
    29 #include <linux/ps2/gs.h>
    30 
    31 #include "SDL_mouse.h"
    32 #include "SDL_mutex.h"
    33 #include "SDL_sysvideo.h"
    34 
    35 /* Hidden "this" pointer for the video functions */
    36 #define _THIS	SDL_VideoDevice *this
    37 
    38 
    39 /* Private display data */
    40 struct SDL_PrivateVideoData {
    41 	/* Gotta love that simple PS2 graphics interface. :) */
    42 	int console_fd;
    43 	int memory_fd;
    44 	struct ps2_screeninfo saved_vinfo;
    45 
    46 	/* Ye olde linux keyboard code */
    47 	int current_vt;
    48 	int saved_vt;
    49 	int keyboard_fd;
    50 	int saved_kbd_mode;
    51 	struct termios saved_kbd_termios;
    52 
    53 	/* Ye olde linux mouse code */
    54 	int mouse_fd;
    55 	int cursor_drawn;
    56 
    57 	/* The memory mapped DMA area and associated variables */
    58 	caddr_t mapped_mem;
    59 	int pixels_len;
    60 	int mapped_len;
    61 	struct ps2_image screen_image;
    62 	int screen_image_size;
    63 	unsigned long long *head_tags_mem;
    64 	unsigned long long *image_tags_mem;
    65 	unsigned long long *tex_tags_mem;
    66 	unsigned long long *scale_tags_mem;
    67 	int dma_pending;
    68 };
    69 /* Old variable names */
    70 #define console_fd		(this->hidden->console_fd)
    71 #define memory_fd		(this->hidden->memory_fd)
    72 #define saved_vinfo		(this->hidden->saved_vinfo)
    73 #define current_vt		(this->hidden->current_vt)
    74 #define saved_vt		(this->hidden->saved_vt)
    75 #define keyboard_fd		(this->hidden->keyboard_fd)
    76 #define saved_kbd_mode		(this->hidden->saved_kbd_mode)
    77 #define saved_kbd_termios	(this->hidden->saved_kbd_termios)
    78 #define mouse_fd		(this->hidden->mouse_fd)
    79 #define cursor_drawn		(this->hidden->cursor_drawn)
    80 #define mapped_mem		(this->hidden->mapped_mem)
    81 #define pixels_len		(this->hidden->pixels_len)
    82 #define mapped_len		(this->hidden->mapped_len)
    83 #define screen_image		(this->hidden->screen_image)
    84 #define screen_image_size	(this->hidden->screen_image_size)
    85 #define head_tags_mem		(this->hidden->head_tags_mem)
    86 #define image_tags_mem		(this->hidden->image_tags_mem)
    87 #define tex_tags_mem		(this->hidden->tex_tags_mem)
    88 #define scale_tags_mem		(this->hidden->scale_tags_mem)
    89 #define dma_pending		(this->hidden->dma_pending)
    90 
    91 /* Shared between the mouse and video code for screen update scaling */
    92 extern int scaleimage_nonblock(int fd,
    93                                unsigned long long *tm, unsigned long long *sm);
    94 #endif /* _SDL_gsvideo_h */