Mercurial > sdl-ios-xcode
comparison src/video/ps3/SDL_ps3modes.c @ 3157:cce01ba54174 gsoc2009_ps3
Added comments, clean up.
author | Martin Lowinski <martin@goldtopf.org> |
---|---|
date | Thu, 27 Aug 2009 11:33:56 +0000 |
parents | 7f3341cccf42 |
children |
comparison
equal
deleted
inserted
replaced
3156:4ead4cef6b7b | 3157:cce01ba54174 |
---|---|
36 modedata = (PS3_DisplayModeData *) SDL_malloc(sizeof(*modedata)); | 36 modedata = (PS3_DisplayModeData *) SDL_malloc(sizeof(*modedata)); |
37 if (!modedata) { | 37 if (!modedata) { |
38 return; | 38 return; |
39 } | 39 } |
40 | 40 |
41 /* Setting up the DisplayMode */ | 41 /* Setting up the DisplayMode based on current settings */ |
42 struct ps3fb_ioctl_res res; | 42 struct ps3fb_ioctl_res res; |
43 if (ioctl(data->fbdev, PS3FB_IOCTL_SCREENINFO, &res)) { | 43 if (ioctl(data->fbdev, PS3FB_IOCTL_SCREENINFO, &res)) { |
44 SDL_SetError("Can't get PS3FB_IOCTL_SCREENINFO"); | 44 SDL_SetError("Can't get PS3FB_IOCTL_SCREENINFO"); |
45 } | 45 } |
46 mode.format = SDL_PIXELFORMAT_RGB888; | 46 mode.format = SDL_PIXELFORMAT_RGB888; |
47 mode.refresh_rate = 0; | 47 mode.refresh_rate = 0; |
48 mode.w = res.xres; | 48 mode.w = res.xres; |
49 mode.h = res.yres; | 49 mode.h = res.yres; |
50 | 50 |
51 /* Setting up driver specific mode data */ | 51 /* Setting up driver specific mode data, |
52 * Get the current ps3 specific videmode number */ | |
52 if (ioctl(data->fbdev, PS3FB_IOCTL_GETMODE, (unsigned long)&vid)) { | 53 if (ioctl(data->fbdev, PS3FB_IOCTL_GETMODE, (unsigned long)&vid)) { |
53 SDL_SetError("Can't get PS3FB_IOCTL_GETMODE"); | 54 SDL_SetError("Can't get PS3FB_IOCTL_GETMODE"); |
54 } | 55 } |
55 deprintf(2, "PS3FB_IOCTL_GETMODE = %u\n", vid); | 56 deprintf(2, "PS3FB_IOCTL_GETMODE = %u\n", vid); |
56 modedata->mode = vid; | 57 modedata->mode = vid; |
57 mode.driverdata = modedata; | 58 mode.driverdata = modedata; |
58 | 59 |
60 /* Set display's videomode and add it */ | |
59 SDL_zero(display); | 61 SDL_zero(display); |
60 display.desktop_mode = mode; | 62 display.desktop_mode = mode; |
61 display.current_mode = mode; | 63 display.current_mode = mode; |
62 | 64 |
63 SDL_AddVideoDisplay(&display); | 65 SDL_AddVideoDisplay(&display); |
64 deprintf(1, "-PS3_InitModes()\n"); | 66 deprintf(1, "-PS3_InitModes()\n"); |
65 } | 67 } |
66 | 68 |
69 /* DisplayModes available on the PS3 */ | |
67 static SDL_DisplayMode ps3fb_modedb[] = { | 70 static SDL_DisplayMode ps3fb_modedb[] = { |
68 /* VESA */ | 71 /* VESA */ |
69 {SDL_PIXELFORMAT_RGB888, 1280, 768, 0, NULL}, // WXGA | 72 {SDL_PIXELFORMAT_RGB888, 1280, 768, 0, NULL}, // WXGA |
70 {SDL_PIXELFORMAT_RGB888, 1280, 1024, 0, NULL}, // SXGA | 73 {SDL_PIXELFORMAT_RGB888, 1280, 1024, 0, NULL}, // SXGA |
71 {SDL_PIXELFORMAT_RGB888, 1920, 1200, 0, NULL}, // WUXGA | 74 {SDL_PIXELFORMAT_RGB888, 1920, 1200, 0, NULL}, // WUXGA |
73 {SDL_PIXELFORMAT_RGB888, 720, 480, 0, NULL}, // 480p | 76 {SDL_PIXELFORMAT_RGB888, 720, 480, 0, NULL}, // 480p |
74 {SDL_PIXELFORMAT_RGB888, 1280, 720, 0, NULL}, // 720p | 77 {SDL_PIXELFORMAT_RGB888, 1280, 720, 0, NULL}, // 720p |
75 {SDL_PIXELFORMAT_RGB888, 1920, 1080, 0, NULL} // 1080p | 78 {SDL_PIXELFORMAT_RGB888, 1920, 1080, 0, NULL} // 1080p |
76 }; | 79 }; |
77 | 80 |
81 /* PS3 videomode number according to ps3fb_modedb */ | |
78 static PS3_DisplayModeData ps3fb_data[] = { | 82 static PS3_DisplayModeData ps3fb_data[] = { |
79 {11}, {12}, {13}, {130}, {131}, {133}, | 83 {11}, {12}, {13}, {130}, {131}, {133}, |
80 }; | 84 }; |
81 | 85 |
82 void | 86 void |