| 1 | /* |
| 2 | SDL - Simple DirectMedia Layer |
| 3 | Copyright (C) 1997-2009 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 | #include "SDL_config.h" |
| 23 | |
| 24 | #ifndef _SDL_gsvideo_h |
| 25 | #define _SDL_gsvideo_h |
| 26 | |
| 27 | #include <sys/types.h> |
| 28 | #include <termios.h> |
| 29 | #include <linux/ps2/dev.h> |
| 30 | #include <linux/ps2/gs.h> |
| 31 | |
| 32 | #include "SDL_mouse.h" |
| 33 | #include "SDL_mutex.h" |
| 34 | #include "../SDL_sysvideo.h" |
| 35 | |
| 36 | /* Hidden "this" pointer for the video functions */ |
| 37 | #define _THIS SDL_VideoDevice *this |
| 38 | |
| 39 | |
| 40 | /* Private display data */ |
| 41 | struct SDL_PrivateVideoData { |
| 42 | /* Gotta love that simple PS2 graphics interface. :) */ |
| 43 | int console_fd; |
| 44 | int memory_fd; |
| 45 | struct ps2_screeninfo saved_vinfo; |
| 46 | |
| 47 | /* Ye olde linux keyboard code */ |
| 48 | int current_vt; |
| 49 | int saved_vt; |
| 50 | int keyboard_fd; |
| 51 | int saved_kbd_mode; |
| 52 | struct termios saved_kbd_termios; |
| 53 | |
| 54 | /* Ye olde linux mouse code */ |
| 55 | int mouse_fd; |
| 56 | int cursor_drawn; |
| 57 | |
| 58 | /* The memory mapped DMA area and associated variables */ |
| 59 | caddr_t mapped_mem; |
| 60 | int pixels_len; |
| 61 | int mapped_len; |
| 62 | struct ps2_image screen_image; |
| 63 | int screen_image_size; |
| 64 | unsigned long long *head_tags_mem; |
| 65 | unsigned long long *image_tags_mem; |
| 66 | unsigned long long *tex_tags_mem; |
| 67 | unsigned long long *scale_tags_mem; |
| 68 | int dma_pending; |
| 69 | }; |
| 70 | /* Old variable names */ |
| 71 | #define console_fd (this->hidden->console_fd) |
| 72 | #define memory_fd (this->hidden->memory_fd) |
| 73 | #define saved_vinfo (this->hidden->saved_vinfo) |
| 74 | #define current_vt (this->hidden->current_vt) |
| 75 | #define saved_vt (this->hidden->saved_vt) |
| 76 | #define keyboard_fd (this->hidden->keyboard_fd) |
| 77 | #define saved_kbd_mode (this->hidden->saved_kbd_mode) |
| 78 | #define saved_kbd_termios (this->hidden->saved_kbd_termios) |
| 79 | #define mouse_fd (this->hidden->mouse_fd) |
| 80 | #define cursor_drawn (this->hidden->cursor_drawn) |
| 81 | #define mapped_mem (this->hidden->mapped_mem) |
| 82 | #define pixels_len (this->hidden->pixels_len) |
| 83 | #define mapped_len (this->hidden->mapped_len) |
| 84 | #define screen_image (this->hidden->screen_image) |
| 85 | #define screen_image_size (this->hidden->screen_image_size) |
| 86 | #define head_tags_mem (this->hidden->head_tags_mem) |
| 87 | #define image_tags_mem (this->hidden->image_tags_mem) |
| 88 | #define tex_tags_mem (this->hidden->tex_tags_mem) |
| 89 | #define scale_tags_mem (this->hidden->scale_tags_mem) |
| 90 | #define dma_pending (this->hidden->dma_pending) |
| 91 | |
| 92 | /* Shared between the mouse and video code for screen update scaling */ |
| 93 | extern int scaleimage_nonblock(int fd, |
| 94 | unsigned long long *tm, unsigned long long *sm); |
| 95 | #endif /* _SDL_gsvideo_h */ |