diff src/video/xbios/SDL_xbios.c @ 1064:fba6b67b4d60

Add Centscreen extended modes support
author Patrice Mandin <patmandin@gmail.com>
date Tue, 31 May 2005 12:31:11 +0000
parents 5023cde12cbd
children 24470ffe8ee4
line wrap: on
line diff
--- a/src/video/xbios/SDL_xbios.c	Fri May 20 20:37:28 2005 +0000
+++ b/src/video/xbios/SDL_xbios.c	Tue May 31 12:31:11 2005 +0000
@@ -283,6 +283,7 @@
 	/* and save current screen status (palette, screen address, video mode) */
 	XBIOS_nummodes = 0;
 	XBIOS_modelist = NULL;
+	XBIOS_centscreen = SDL_FALSE;
 
 	switch (XBIOS_cvdo >>16) {
 		case VDO_ST:
@@ -411,14 +412,16 @@
 				current_mode++;
 			}
 
-			/* Initialize BlowUp or SB3 stuff if present */
+			/* Initialize BlowUp/SB3/Centscreen stuff if present */
 			if (Getcookie(C_BLOW, &cookie_blow) == C_FOUND) {
 				SDL_XBIOS_BlowupInit(this, (blow_cookie_t *)cookie_blow);
 			} else if (Getcookie(C_SCPN, &cookie_scpn) == C_FOUND) {
 				SDL_XBIOS_SB3Init(this, (scpn_cookie_t *)cookie_scpn);
 			} else if (Getcookie(C_CNTS, &cookie_cnts) == C_FOUND) {
-				SDL_XBIOS_CentscreenInit(this);
+				XBIOS_oldvmode = SDL_XBIOS_CentscreenInit(this);
+				XBIOS_centscreen = SDL_TRUE;
 			}
+
 			break;
 	}
 
@@ -680,7 +683,11 @@
 			break;
 		case VDO_F30:
 #ifndef DEBUG_VIDEO_XBIOS
-			Vsetmode(new_video_mode->number);
+			if (XBIOS_centscreen) {
+				SDL_XBIOS_CentscreenSetmode(this, width, height, new_depth);
+			} else {
+				Vsetmode(new_video_mode->number);
+			}
 #endif
 			break;
 	}
@@ -892,7 +899,11 @@
 			break;
 		case VDO_F30:
 			Setscreen(-1, XBIOS_oldvbase, -1);
-			Vsetmode(XBIOS_oldvmode);
+			if (XBIOS_centscreen) {
+				SDL_XBIOS_CentscreenRestore(this, XBIOS_oldvmode);
+			} else {
+				Vsetmode(XBIOS_oldvmode);
+			}
 			if (XBIOS_oldnumcol) {
 				VsetRGB(0, XBIOS_oldnumcol, XBIOS_oldpalette);
 			}