Home | History | Annotate | Download | only in xbios
      1 /*
      2     SDL - Simple DirectMedia Layer
      3     Copyright (C) 1997-2004 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 (at) 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 
     35 void SDL_XBIOS_BlowupInit(_THIS, blow_cookie_t *cookie_blow)
     36 {
     37 	int i, num_mode, bank;
     38 	blow_mode_t *blow_mode;
     39 
     40 	/* Add bit 15 for old modes */
     41 	for (i=0;i<XBIOS_nummodes;i++) {
     42 		XBIOS_modelist[i].number |= 1<<15;
     43 	}
     44 
     45 	/* Add Blowup modes for 8 and 16 bpp */
     46 	for (num_mode=3; num_mode<5; num_mode++) {
     47 		bank = cookie_blow->num_mode[num_mode];
     48 		blow_mode = &(cookie_blow->blowup_modes[num_mode+(bank*5)]);
     49 
     50 		/* Check extended mode enabled */
     51 		if (blow_mode->enabled == 0) {
     52 			/* Check monitor needed for this mode */
     53 			if ((blow_mode->monitor == cookie_blow->montype)
     54 				|| ((blow_mode->monitor == MONITOR_TV)
     55 					&& (cookie_blow->montype == MONITOR_RGB))
     56 				|| ((blow_mode->monitor == MONITOR_RGB)
     57 					&& (cookie_blow->montype == MONITOR_TV)))
     58 			{
     59 				/* we can use this extended mode */
     60 				SDL_XBIOS_AddMode(this,
     61 					num_mode == 3 ? BPS8 : BPS16,
     62 					blow_mode->width + 1,
     63 					blow_mode->height + 1,
     64 					num_mode == 3 ? 8 : 16,
     65 					SDL_FALSE
     66 				);
     67 			}
     68 		}
     69 	}
     70 }
     71