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