| 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 Library General Public |
| 7 | License as published by the Free Software Foundation; either |
| 8 | version 2 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 | Library General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU Library General Public |
| 16 | License along with this library; if not, write to the Free |
| 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 18 | |
| 19 | Sam Lantinga |
| 20 | slouken@libsdl.org |
| 21 | */ |
| 22 | #include "SDL_config.h" |
| 23 | |
| 24 | /* |
| 25 | Centscreen extension definitions |
| 26 | |
| 27 | Patrice Mandin |
| 28 | */ |
| 29 | |
| 30 | #ifndef _SDL_xbios_centscreen_h |
| 31 | #define _SDL_xbios_centscreen_h |
| 32 | |
| 33 | #include <mint/falcon.h> /* for trap_14_xxx macros */ |
| 34 | |
| 35 | #include "SDL_xbios.h" |
| 36 | |
| 37 | /*--- Defines ---*/ |
| 38 | |
| 39 | #ifndef C_CNTS |
| 40 | #define C_CNTS 0x434e5453L |
| 41 | #endif |
| 42 | |
| 43 | #define CSCREEN_ENERGYSTAR (1<<9) |
| 44 | #define CSCREEN_SAVER (1<<10) |
| 45 | #define CSCREEN_VIRTUAL (1<<11) |
| 46 | #define CSCREEN_EXTCLOCK_CT2 (1<<12) |
| 47 | #define CSCREEN_EXTCLOCK (1<<13) |
| 48 | #define CSCREEN_STANDARD (1<<14) |
| 49 | #define CSCREEN_DEFAULT (1<<15) |
| 50 | |
| 51 | /*--- Structures ---*/ |
| 52 | |
| 53 | typedef struct { |
| 54 | unsigned short handle; /* videomode handle */ |
| 55 | unsigned short mode; /* Falcon videomode code */ |
| 56 | unsigned short physx; /* visible width */ |
| 57 | unsigned short physy; /* visible height */ |
| 58 | unsigned short plan; /* bitplanes */ |
| 59 | unsigned short logx; /* virtual width */ |
| 60 | unsigned short logy; /* virtual height */ |
| 61 | unsigned short eco; /* screen saver delay */ |
| 62 | unsigned short eco2; /* energy star screen saver delay */ |
| 63 | unsigned short wsize; /* screen width (mm) */ |
| 64 | unsigned short hsize; /* screen height (mm) */ |
| 65 | unsigned short dummy[21]; |
| 66 | unsigned char name[32]; /* videomode name */ |
| 67 | } __attribute__((packed)) centscreen_mode_t; |
| 68 | |
| 69 | /*--- Functions prototypes ---*/ |
| 70 | |
| 71 | #define Vread(current_mode) \ |
| 72 | (void)trap_14_wl((short)0x41,(long)(current_mode)) |
| 73 | #define Vwrite(init_vdi, inparam, outparam) \ |
| 74 | (long)trap_14_wwll((short)0x42,(short)(init_vdi),(long)(inparam),(long)(outparam)) |
| 75 | #define Vattrib(inparam, outparam) \ |
| 76 | (void)trap_14_wll((short)0x43,(long)(inparam),(long)(outparam)) |
| 77 | #define Vcreate(inparam, outparam) \ |
| 78 | (void)trap_14_wll((short)0x44,(long)(inparam),(long)(outparam)) |
| 79 | #define Vdelete(handle) \ |
| 80 | (long)trap_14_ww((short)0x45,(short)(handle)) |
| 81 | #define Vfirst(mask,mode) \ |
| 82 | (long)trap_14_wll((short)0x46,(long)(mask),(long)(mode)) |
| 83 | #define Vnext(mask,mode) \ |
| 84 | (long)trap_14_wll((short)0x47,(long)(mask),(long)(mode)) |
| 85 | #define Vvalid(handle) \ |
| 86 | (long)trap_14_ww((short)0x48,(short)(handle)) |
| 87 | #define Vload() \ |
| 88 | (long)trap_14_w((short)0x49) |
| 89 | #define Vsave() \ |
| 90 | (long)trap_14_w((short)0x4a) |
| 91 | #define Vopen() \ |
| 92 | (long)trap_14_w((short)0x4b) |
| 93 | #define Vclose() \ |
| 94 | (long)trap_14_w((short)0x4c) |
| 95 | #define Vscroll(scrollmode) \ |
| 96 | (long)trap_14_ww((short)0x4d,(short)(scrollmode)) |
| 97 | #define Voffset() \ |
| 98 | (long)trap_14_w((short)0x4e) |
| 99 | #define Vseek() \ |
| 100 | (long)trap_14_w((short)0x4f) |
| 101 | #define Vlock(cmd) \ |
| 102 | (long)trap_14_ww((short)0x50,(short)(cmd)) |
| 103 | #define SetMon(montype) \ |
| 104 | (long)trap_14_ww((short)0x51,(short)(montype)) |
| 105 | #define MultiMon(cmd) \ |
| 106 | (long)trap_14_ww((short)0x52,(short)(cmd)) |
| 107 | #define VSizeComp() \ |
| 108 | (long)trap_14_w((short)0x53) |
| 109 | #define Vsize(mode) \ |
| 110 | (long)trap_14_wl((short)0x54,(long)(mode)) |
| 111 | |
| 112 | /*--- Functions prototypes ---*/ |
| 113 | |
| 114 | int SDL_XBIOS_ListCentscreenModes(_THIS, int actually_add); |
| 115 | void SDL_XBIOS_CentscreenSetmode(_THIS, int width, int height, int planes); |
| 116 | void SDL_XBIOS_CentscreenRestore(_THIS, int prev_handle); |
| 117 | |
| 118 | #endif /* _SDL_xbios_centscreen_h */ |