@@ -45,6 +45,7 @@ byte surfcache[4*1024*1024];
4545char * screen1 = NULL ; // physical screen
4646
4747static qboolean isVideoInited = false;
48+ static qboolean isSvPresent = false;
4849
4950static char * screen2 = NULL ; // logical screen
5051static char * screen3 = NULL ; // temp screen
@@ -55,6 +56,33 @@ static qboolean vga;
5556unsigned short d_8to16table [256 ];
5657unsigned d_8to24table [256 ];
5758
59+ static long CheckSvPresence ( void )
60+ {
61+ typedef struct
62+ {
63+ long cookie ;
64+ long value ;
65+ } COOKIE ;
66+ COOKIE * pCookie ;
67+
68+ pCookie = * ( (COOKIE * * )0x5A0L );
69+
70+ if ( pCookie != NULL )
71+ {
72+ do
73+ {
74+ if ( pCookie -> cookie == 0x53757056 /*'SupV'*/ )
75+ {
76+ isSvPresent = true;
77+ break ;
78+ }
79+
80+ } while ( (pCookie ++ )-> cookie != 0L );
81+ }
82+
83+ return 0 ;
84+ }
85+
5886void VID_SetPalette (unsigned char * palette )
5987{
6088 #ifndef NO_ATARI_VIDEO
@@ -70,6 +98,7 @@ void VID_ShiftPalette (unsigned char *palette)
7098void VID_Init (unsigned char * palette )
7199{
72100 vga = VgetMonitor () == MON_VGA ;
101+ Supexec ( CheckSvPresence );
73102
74103 vid .maxwarpwidth = vid .width = vid .conwidth = BASEWIDTH ;
75104 vid .maxwarpheight = vid .height = vid .conheight = BASEHEIGHT ;
@@ -129,7 +158,8 @@ void VID_Update (vrect_t *rects)
129158 char * temp ;
130159
131160 #ifndef NO_ATARI_VIDEO
132- video_atari_c2p ( vid .buffer , screen + ( vga ? ( ( 240 - vid .height ) / 2 ) * vid .rowbytes : 0 ), vid .width * vid .height * sizeof ( pixel_t ) );
161+ temp = screen + ( isSvPresent ? 0xA0000000 : 0x00000000 );
162+ video_atari_c2p ( vid .buffer , temp + ( vga ? ( ( 240 - vid .height ) / 2 ) * vid .rowbytes : 0 ), vid .width * vid .height * sizeof ( pixel_t ) );
133163
134164 // cycle 3 screens
135165 temp = screen1 ;
0 commit comments