Mercurial > sdl-ios-xcode
comparison src/video/xbios/SDL_xbios_sb3.c @ 1895:c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 10 Jul 2006 21:04:37 +0000 |
parents | d910939febfa |
children | 0e751c1f83f5 |
comparison
equal
deleted
inserted
replaced
1894:c69cee13dd76 | 1895:c121d94672cb |
---|---|
33 #include "SDL_xbios.h" | 33 #include "SDL_xbios.h" |
34 #include "SDL_xbios_sb3.h" | 34 #include "SDL_xbios_sb3.h" |
35 | 35 |
36 /*--- Defines ---*/ | 36 /*--- Defines ---*/ |
37 | 37 |
38 const int SDL_XBIOS_scpn_planes_device[]={ | 38 const int SDL_XBIOS_scpn_planes_device[] = { |
39 SCPN_DEV_1BPP, | 39 SCPN_DEV_1BPP, |
40 SCPN_DEV_4BPP, | 40 SCPN_DEV_4BPP, |
41 SCPN_DEV_8BPP, | 41 SCPN_DEV_8BPP, |
42 SCPN_DEV_16BPP, | 42 SCPN_DEV_16BPP, |
43 SCPN_DEV_2BPP, | 43 SCPN_DEV_2BPP, |
44 SCPN_DEV_4BPP, | 44 SCPN_DEV_4BPP, |
45 SCPN_DEV_1BPP | 45 SCPN_DEV_1BPP |
46 }; | 46 }; |
47 | 47 |
48 /*--- Functions ---*/ | 48 /*--- Functions ---*/ |
49 | 49 |
50 int SDL_XBIOS_SB3Usable(scpn_cookie_t *cookie_scpn) | 50 int |
51 SDL_XBIOS_SB3Usable(scpn_cookie_t * cookie_scpn) | |
51 { | 52 { |
52 scpn_screeninfo_t *scrinfo; | 53 scpn_screeninfo_t *scrinfo; |
53 int bpp; | 54 int bpp; |
54 | 55 |
55 /* Check if current SB3 mode is usable, i.e. 8 or 16bpp */ | 56 /* Check if current SB3 mode is usable, i.e. 8 or 16bpp */ |
56 scrinfo = cookie_scpn->screen_info; | 57 scrinfo = cookie_scpn->screen_info; |
57 bpp = 1<<(SDL_XBIOS_scpn_planes_device[scrinfo->device]); | 58 bpp = 1 << (SDL_XBIOS_scpn_planes_device[scrinfo->device]); |
58 | 59 |
59 if ((bpp==8) || (bpp==16)) { | 60 if ((bpp == 8) || (bpp == 16)) { |
60 return 1; | 61 return 1; |
61 } | 62 } |
62 | 63 |
63 return 0; | 64 return 0; |
64 } | 65 } |
65 | 66 |
66 void SDL_XBIOS_SB3Init(_THIS, scpn_cookie_t *cookie_scpn) | 67 void |
68 SDL_XBIOS_SB3Init(_THIS, scpn_cookie_t * cookie_scpn) | |
67 { | 69 { |
68 scpn_screeninfo_t *scrinfo; | 70 scpn_screeninfo_t *scrinfo; |
69 | 71 |
70 /* SB3 prevent changing video modes, we can only use current one */ | 72 /* SB3 prevent changing video modes, we can only use current one */ |
71 if (XBIOS_modelist) { | 73 if (XBIOS_modelist) { |
72 SDL_free(XBIOS_modelist); | 74 SDL_free(XBIOS_modelist); |
73 XBIOS_nummodes = 0; | 75 XBIOS_nummodes = 0; |
74 XBIOS_modelist = NULL; | 76 XBIOS_modelist = NULL; |
75 } | 77 } |
76 | 78 |
77 scrinfo = cookie_scpn->screen_info; | 79 scrinfo = cookie_scpn->screen_info; |
78 scrinfo->h_pos = scrinfo->v_pos = 0; | 80 scrinfo->h_pos = scrinfo->v_pos = 0; |
79 | 81 |
80 SDL_XBIOS_AddMode(this, | 82 SDL_XBIOS_AddMode(this, |
81 -1, | 83 -1, |
82 scrinfo->virtual_width, scrinfo->virtual_height, | 84 scrinfo->virtual_width, scrinfo->virtual_height, |
83 1<<(SDL_XBIOS_scpn_planes_device[scrinfo->device]), | 85 1 << (SDL_XBIOS_scpn_planes_device[scrinfo->device]), |
84 SDL_FALSE | 86 SDL_FALSE); |
85 ); | |
86 } | 87 } |
88 | |
89 /* vi: set ts=4 sw=4 expandtab: */ |