Mercurial > sdl-ios-xcode
comparison src/video/ps2gs/SDL_gsvideo.c @ 135:0bfcf0d2b874
Added initial support for TV output modes
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 01 Aug 2001 05:01:08 +0000 |
parents | f590dd383b5d |
children | 717f739d6ec1 |
comparison
equal
deleted
inserted
replaced
134:f1550e1c4916 | 135:0bfcf0d2b874 |
---|---|
259 close(console_fd); | 259 close(console_fd); |
260 console_fd = -1; | 260 console_fd = -1; |
261 SDL_SetError("Couldn't get console pixel format"); | 261 SDL_SetError("Couldn't get console pixel format"); |
262 return(-1); | 262 return(-1); |
263 } | 263 } |
264 #if 0 | |
264 if ( vinfo.mode != PS2_GS_VESA ) { | 265 if ( vinfo.mode != PS2_GS_VESA ) { |
265 GS_VideoQuit(this); | 266 GS_VideoQuit(this); |
266 SDL_SetError("Console must be in VESA video mode"); | 267 SDL_SetError("Console must be in VESA video mode"); |
267 return(-1); | 268 return(-1); |
268 } | 269 } |
270 #endif | |
269 switch (vinfo.psm) { | 271 switch (vinfo.psm) { |
270 /* Supported pixel formats */ | 272 /* Supported pixel formats */ |
271 case PS2_GS_PSMCT32: | 273 case PS2_GS_PSMCT32: |
272 case PS2_GS_PSMCT24: | 274 case PS2_GS_PSMCT24: |
273 case PS2_GS_PSMCT16: | 275 case PS2_GS_PSMCT16: |
304 return(0); | 306 return(0); |
305 } | 307 } |
306 | 308 |
307 static SDL_Rect **GS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags) | 309 static SDL_Rect **GS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags) |
308 { | 310 { |
309 static SDL_Rect GS_mode_list[] = { | 311 static SDL_Rect GS_tvout_mode; |
312 static SDL_Rect *GS_tvout_modes[] = { | |
313 &GS_tvout_mode, | |
314 NULL | |
315 }; | |
316 static SDL_Rect GS_vesa_mode_list[] = { | |
310 { 0, 0, 1280, 1024 }, | 317 { 0, 0, 1280, 1024 }, |
311 { 0, 0, 1024, 768 }, | 318 { 0, 0, 1024, 768 }, |
312 { 0, 0, 800, 600 }, | 319 { 0, 0, 800, 600 }, |
313 { 0, 0, 640, 480 } | 320 { 0, 0, 640, 480 } |
314 }; | 321 }; |
315 static SDL_Rect *GS_modes[] = { | 322 static SDL_Rect *GS_vesa_modes[] = { |
316 &GS_mode_list[0], | 323 &GS_vesa_mode_list[0], |
317 &GS_mode_list[1], | 324 &GS_vesa_mode_list[1], |
318 &GS_mode_list[2], | 325 &GS_vesa_mode_list[2], |
319 &GS_mode_list[3], | 326 &GS_vesa_mode_list[3], |
320 NULL | 327 NULL |
321 }; | 328 }; |
322 SDL_Rect **modes; | 329 SDL_Rect **modes = NULL; |
323 | 330 |
324 switch (format->BitsPerPixel) { | 331 if ( saved_vinfo.mode == PS2_GS_VESA ) { |
325 case 16: | 332 switch (format->BitsPerPixel) { |
326 case 24: | 333 case 16: |
327 case 32: | 334 case 24: |
328 modes = GS_modes; | 335 case 32: |
329 break; | 336 modes = GS_vesa_modes; |
330 default: | 337 break; |
331 modes = NULL; | 338 default: |
332 break; | 339 break; |
340 } | |
341 } else { | |
342 if ( GS_formatmap[format->BitsPerPixel/8] == saved_vinfo.psm ) { | |
343 GS_tvout_mode.w = saved_vinfo.w; | |
344 GS_tvout_mode.h = saved_vinfo.h; | |
345 modes = GS_tvout_modes; | |
346 } | |
333 } | 347 } |
334 return(modes); | 348 return(modes); |
335 } | 349 } |
336 | 350 |
337 /* Various screen update functions available */ | 351 /* Various screen update functions available */ |