Mercurial > sdl-ios-xcode
comparison src/video/xbios/SDL_xbios_centscreen.c @ 1668:4da1ee79c9af SDL-1.3
more tweaking indent options
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 29 May 2006 04:04:35 +0000 |
parents | 782fd950bd46 |
children |
comparison
equal
deleted
inserted
replaced
1667:1fddae038bc8 | 1668:4da1ee79c9af |
---|---|
31 | 31 |
32 #include "SDL_xbios.h" | 32 #include "SDL_xbios.h" |
33 #include "SDL_xbios_centscreen.h" | 33 #include "SDL_xbios_centscreen.h" |
34 | 34 |
35 int | 35 int |
36 SDL_XBIOS_CentscreenInit (_THIS) | 36 SDL_XBIOS_CentscreenInit(_THIS) |
37 { | 37 { |
38 centscreen_mode_t curmode, listedmode; | 38 centscreen_mode_t curmode, listedmode; |
39 unsigned long result; | 39 unsigned long result; |
40 int cur_handle; /* Current Centscreen mode handle */ | 40 int cur_handle; /* Current Centscreen mode handle */ |
41 | 41 |
42 /* Reset current mode list */ | 42 /* Reset current mode list */ |
43 if (XBIOS_modelist) { | 43 if (XBIOS_modelist) { |
44 SDL_free (XBIOS_modelist); | 44 SDL_free(XBIOS_modelist); |
45 XBIOS_nummodes = 0; | 45 XBIOS_nummodes = 0; |
46 XBIOS_modelist = NULL; | 46 XBIOS_modelist = NULL; |
47 } | 47 } |
48 | 48 |
49 /* Add Centscreen modes */ | 49 /* Add Centscreen modes */ |
50 Vread (&curmode); | 50 Vread(&curmode); |
51 cur_handle = curmode.handle; | 51 cur_handle = curmode.handle; |
52 curmode.mode = curmode.physx = curmode.physy = curmode.plan = | 52 curmode.mode = curmode.physx = curmode.physy = curmode.plan = |
53 curmode.logx = curmode.logy = -1; | 53 curmode.logx = curmode.logy = -1; |
54 | 54 |
55 result = Vfirst (&curmode, &listedmode); | 55 result = Vfirst(&curmode, &listedmode); |
56 if (result == 0) { | 56 if (result == 0) { |
57 while (result == 0) { | 57 while (result == 0) { |
58 /* Don't add modes with virtual screen */ | 58 /* Don't add modes with virtual screen */ |
59 if ((listedmode.mode & CSCREEN_VIRTUAL) == 0) { | 59 if ((listedmode.mode & CSCREEN_VIRTUAL) == 0) { |
60 /* Don't add modes with bpp<8 */ | 60 /* Don't add modes with bpp<8 */ |
61 if (listedmode.plan >= 8) { | 61 if (listedmode.plan >= 8) { |
62 SDL_XBIOS_AddMode (this, listedmode.mode, | 62 SDL_XBIOS_AddMode(this, listedmode.mode, |
63 listedmode.physx, | 63 listedmode.physx, |
64 listedmode.physy, | 64 listedmode.physy, |
65 listedmode.plan, SDL_FALSE); | 65 listedmode.plan, SDL_FALSE); |
66 } | 66 } |
67 } | 67 } |
68 SDL_memcpy (&curmode, &listedmode, sizeof (centscreen_mode_t)); | 68 SDL_memcpy(&curmode, &listedmode, sizeof(centscreen_mode_t)); |
69 curmode.mode = curmode.physx = curmode.physy = curmode.plan = | 69 curmode.mode = curmode.physx = curmode.physy = curmode.plan = |
70 curmode.logx = curmode.logy = -1; | 70 curmode.logx = curmode.logy = -1; |
71 result = Vnext (&curmode, &listedmode); | 71 result = Vnext(&curmode, &listedmode); |
72 } | 72 } |
73 } else { | 73 } else { |
74 fprintf (stderr, "No suitable Centscreen modes\n"); | 74 fprintf(stderr, "No suitable Centscreen modes\n"); |
75 } | 75 } |
76 | 76 |
77 return cur_handle; | 77 return cur_handle; |
78 } | 78 } |
79 | 79 |
80 void | 80 void |
81 SDL_XBIOS_CentscreenSetmode (_THIS, int width, int height, int planes) | 81 SDL_XBIOS_CentscreenSetmode(_THIS, int width, int height, int planes) |
82 { | 82 { |
83 centscreen_mode_t newmode, curmode; | 83 centscreen_mode_t newmode, curmode; |
84 | 84 |
85 newmode.handle = newmode.mode = newmode.logx = newmode.logy = -1; | 85 newmode.handle = newmode.mode = newmode.logx = newmode.logy = -1; |
86 newmode.physx = width; | 86 newmode.physx = width; |
87 newmode.physy = height; | 87 newmode.physy = height; |
88 newmode.plan = planes; | 88 newmode.plan = planes; |
89 Vwrite (0, &newmode, &curmode); | 89 Vwrite(0, &newmode, &curmode); |
90 | 90 |
91 /* Disable screensaver */ | 91 /* Disable screensaver */ |
92 Vread (&newmode); | 92 Vread(&newmode); |
93 newmode.mode &= ~(CSCREEN_SAVER | CSCREEN_ENERGYSTAR); | 93 newmode.mode &= ~(CSCREEN_SAVER | CSCREEN_ENERGYSTAR); |
94 Vwrite (0, &newmode, &curmode); | 94 Vwrite(0, &newmode, &curmode); |
95 } | 95 } |
96 | 96 |
97 void | 97 void |
98 SDL_XBIOS_CentscreenRestore (_THIS, int prev_handle) | 98 SDL_XBIOS_CentscreenRestore(_THIS, int prev_handle) |
99 { | 99 { |
100 centscreen_mode_t newmode, curmode; | 100 centscreen_mode_t newmode, curmode; |
101 | 101 |
102 /* Restore old video mode */ | 102 /* Restore old video mode */ |
103 newmode.handle = prev_handle; | 103 newmode.handle = prev_handle; |
104 newmode.mode = newmode.physx = newmode.physy = newmode.plan = | 104 newmode.mode = newmode.physx = newmode.physy = newmode.plan = |
105 newmode.logx = newmode.logy = -1; | 105 newmode.logx = newmode.logy = -1; |
106 Vwrite (0, &newmode, &curmode); | 106 Vwrite(0, &newmode, &curmode); |
107 } | 107 } |
108 | 108 |
109 /* vi: set ts=4 sw=4 expandtab: */ | 109 /* vi: set ts=4 sw=4 expandtab: */ |