19682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* 29682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall SDL - Simple DirectMedia Layer 39682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Copyright (C) 1997-2012 Sam Lantinga 49682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 59682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall This library is free software; you can redistribute it and/or 69682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall modify it under the terms of the GNU Library General Public 79682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall License as published by the Free Software Foundation; either 89682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall version 2 of the License, or (at your option) any later version. 99682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 109682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall This library is distributed in the hope that it will be useful, 119682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall but WITHOUT ANY WARRANTY; without even the implied warranty of 129682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 139682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Library General Public License for more details. 149682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 159682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall You should have received a copy of the GNU Library General Public 169682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall License along with this library; if not, write to the Free 179682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 189682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 199682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Sam Lantinga 209682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall slouken@libsdl.org 219682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall*/ 229682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "SDL_config.h" 239682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 249682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall/* 259682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Blowup extension definitions 269682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 279682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall Patrice Mandin 289682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall*/ 299682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 309682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include <mint/falcon.h> 319682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 329682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "SDL_xbios.h" 339682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall#include "SDL_xbios_blowup.h" 349682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 359682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hallvoid SDL_XBIOS_ListBlowupModes(_THIS, int actually_add, blow_cookie_t *cookie_blow) 369682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall{ 379682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall int i, j, num_mode, bank; 389682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall blow_mode_t *blow_mode; 399682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall xbiosmode_t modeinfo; 409682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 419682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall if (actually_add) { 429682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall /* Set bit 15 for old modes */ 439682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall for (i=0;i<NUM_MODELISTS;i++) { 449682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall if ( SDL_xbiosmode[i] != NULL ) { 459682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall for ( j=0; SDL_xbiosmode[i][j]; ++j ) { 469682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall SDL_xbiosmode[i][j]->number |= 1<<15; 479682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall } 489682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall } 499682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall } 509682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall } 519682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 529682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall /* Add Blowup modes for 8 and 16 bpp */ 539682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall for (num_mode=3; num_mode<5; num_mode++) { 549682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall bank = cookie_blow->num_mode[num_mode]; 559682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall blow_mode = &(cookie_blow->blowup_modes[num_mode+(bank*5)]); 569682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 579682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall /* Check extended mode enabled */ 589682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall if (blow_mode->enabled == 0) { 599682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall /* Check monitor needed for this mode */ 609682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall if ((blow_mode->monitor == cookie_blow->montype) 619682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall || ((blow_mode->monitor == MONITOR_TV) 629682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall && (cookie_blow->montype == MONITOR_RGB)) 639682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall || ((blow_mode->monitor == MONITOR_RGB) 649682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall && (cookie_blow->montype == MONITOR_TV))) 659682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall { 669682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall /* we can use this extended mode */ 679682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall modeinfo.number = (num_mode == 3 ? BPS8 : BPS16); 689682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall modeinfo.width = blow_mode->width + 1; 699682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall modeinfo.height = blow_mode->height + 1; 709682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall modeinfo.depth = (num_mode == 3 ? 8 : 16); 719682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall modeinfo.flags = (modeinfo.depth == 8 ? XBIOSMODE_C2P : 0); 729682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall 739682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall SDL_XBIOS_AddMode(this, actually_add, &modeinfo); 749682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall } 759682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall } 769682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall } 779682c8870b8ff5e4ac2e4c70b759f791c6f38c1fJesse Hall} 78