summaryrefslogtreecommitdiff
path: root/apps/plugins/sdl/src/video/xbios/SDL_xbios_blowup.c
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2017-01-21 15:18:31 -0500
committerFranklin Wei <git@fwei.tk>2017-12-23 21:01:26 -0500
commita855d6202536ff28e5aae4f22a0f31d8f5b325d0 (patch)
tree8c75f224dd64ed360505afa8843d016b0d75000b /apps/plugins/sdl/src/video/xbios/SDL_xbios_blowup.c
parent01c6dcf6c7b9bb1ad2fa0450f99bacc5f3d3e04b (diff)
downloadrockbox-a855d6202536ff28e5aae4f22a0f31d8f5b325d0.tar.gz
rockbox-a855d6202536ff28e5aae4f22a0f31d8f5b325d0.zip
Port of Duke Nukem 3D
This ports Fabien Sanglard's Chocolate Duke to run on a version of SDL for Rockbox. Change-Id: I8f2c4c78af19de10c1633ed7bb7a997b43256dd9
Diffstat (limited to 'apps/plugins/sdl/src/video/xbios/SDL_xbios_blowup.c')
-rw-r--r--apps/plugins/sdl/src/video/xbios/SDL_xbios_blowup.c77
1 files changed, 77 insertions, 0 deletions
diff --git a/apps/plugins/sdl/src/video/xbios/SDL_xbios_blowup.c b/apps/plugins/sdl/src/video/xbios/SDL_xbios_blowup.c
new file mode 100644
index 0000000000..2950b84f17
--- /dev/null
+++ b/apps/plugins/sdl/src/video/xbios/SDL_xbios_blowup.c
@@ -0,0 +1,77 @@
1/*
2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2012 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 Blowup extension definitions
26
27 Patrice Mandin
28*/
29
30#include <mint/falcon.h>
31
32#include "SDL_xbios.h"
33#include "SDL_xbios_blowup.h"
34
35void SDL_XBIOS_ListBlowupModes(_THIS, int actually_add, blow_cookie_t *cookie_blow)
36{
37 int i, j, num_mode, bank;
38 blow_mode_t *blow_mode;
39 xbiosmode_t modeinfo;
40
41 if (actually_add) {
42 /* Set bit 15 for old modes */
43 for (i=0;i<NUM_MODELISTS;i++) {
44 if ( SDL_xbiosmode[i] != NULL ) {
45 for ( j=0; SDL_xbiosmode[i][j]; ++j ) {
46 SDL_xbiosmode[i][j]->number |= 1<<15;
47 }
48 }
49 }
50 }
51
52 /* Add Blowup modes for 8 and 16 bpp */
53 for (num_mode=3; num_mode<5; num_mode++) {
54 bank = cookie_blow->num_mode[num_mode];
55 blow_mode = &(cookie_blow->blowup_modes[num_mode+(bank*5)]);
56
57 /* Check extended mode enabled */
58 if (blow_mode->enabled == 0) {
59 /* Check monitor needed for this mode */
60 if ((blow_mode->monitor == cookie_blow->montype)
61 || ((blow_mode->monitor == MONITOR_TV)
62 && (cookie_blow->montype == MONITOR_RGB))
63 || ((blow_mode->monitor == MONITOR_RGB)
64 && (cookie_blow->montype == MONITOR_TV)))
65 {
66 /* we can use this extended mode */
67 modeinfo.number = (num_mode == 3 ? BPS8 : BPS16);
68 modeinfo.width = blow_mode->width + 1;
69 modeinfo.height = blow_mode->height + 1;
70 modeinfo.depth = (num_mode == 3 ? 8 : 16);
71 modeinfo.flags = (modeinfo.depth == 8 ? XBIOSMODE_C2P : 0);
72
73 SDL_XBIOS_AddMode(this, actually_add, &modeinfo);
74 }
75 }
76 }
77}