Changeset 6653 for trunk/src/opengl/glide/sst1/init
- Timestamp:
- Sep 5, 2001, 4:31:14 PM (24 years ago)
- Location:
- trunk/src/opengl/glide/sst1/init
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/opengl/glide/sst1/init/h3drvr.c
r2885 r6653 1 /* $Id: h3drvr.c,v 1.2 2001-09-05 14:31:00 bird Exp $ */ 1 2 /* 2 3 ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY 3 4 ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT 4 5 ** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX 5 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 6 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 7 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 6 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 7 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 8 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 8 9 ** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A 9 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 10 ** 10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 11 ** 11 12 ** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO 12 13 ** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN … … 14 15 ** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR 15 16 ** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF 16 ** THE UNITED STATES. 17 ** 17 ** THE UNITED STATES. 18 ** 18 19 ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED 19 20 ** 20 21 ** 21 ** $Revision: 1. 1 $22 ** $Date: 200 0-02-25 00:31:26 $22 ** $Revision: 1.2 $ 23 ** $Date: 2001-09-05 14:31:00 $ 23 24 ** 24 25 */ … … 56 57 static InitSwapType_t FX_CALL swapBuffers( FxU32 code ) { 57 58 return 0; 58 } 59 } 59 60 60 61 static FxU32 FX_CALL status( void ) { 61 62 return 0; 62 } 63 } 63 64 64 65 static FxBool FX_CALL busy(void) { 65 66 return 0; 66 } 67 } 67 68 68 69 static void FX_CALL idle( void ) { -
trunk/src/opengl/glide/sst1/init/init.c
r2885 r6653 1 /* $Id: init.c,v 1.2 2001-09-05 14:31:00 bird Exp $ */ 1 2 /* 2 3 ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY 3 4 ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT 4 5 ** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX 5 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 6 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 7 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 6 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 7 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 8 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 8 9 ** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A 9 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 10 ** 10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 11 ** 11 12 ** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO 12 13 ** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN … … 14 15 ** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR 15 16 ** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF 16 ** THE UNITED STATES. 17 ** 17 ** THE UNITED STATES. 18 ** 18 19 ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED 19 20 ** 20 21 ** 21 ** $Revision: 1. 1 $22 ** $Date: 200 0-02-25 00:31:26 $22 ** $Revision: 1.2 $ 23 ** $Date: 2001-09-05 14:31:00 $ 23 24 ** 24 25 */ … … 99 100 if ( !libInitialized ) { 100 101 101 /* When initializing the Library snoop out all 3Dfx devices 102 /* When initializing the Library snoop out all 3Dfx devices 102 103 and fill a static data structure with pertinant data. */ 103 104 … … 128 129 hwInfo[numDevicesInSystem-1].hwDep.vgInfo.slaveBaseAddr = 129 130 (FxU32)sst1InitMapBoard( numSst1s ); 130 hwInfo[numDevicesInSystem-1].regs.hwDep.VGRegDesc.slavePtr = 131 hwInfo[numDevicesInSystem-1].regs.hwDep.VGRegDesc.slavePtr = 131 132 (FxU32*)hwInfo[numDevicesInSystem-1].hwDep.vgInfo.slaveBaseAddr; 132 133 numSst1s++; … … 177 178 _outp(0x3d4, 0x3f); 178 179 regVal = _inp(0x3d5); 179 180 180 181 if (!(regVal & (1 << 2))) /* we're not there */ 181 182 continue; … … 196 197 #endif 197 198 198 hwInfo[numDevicesInSystem].hwDep.vg96Info.vgaBaseAddr = 199 hwInfo[numDevicesInSystem].hwDep.vg96Info.vgaBaseAddr = 199 200 (FxU32)hwInfo[numDevicesInSystem].regs.hwDep.VG96RegDesc.partnerRegPtr; 200 hwInfo[numDevicesInSystem].hwDep.vg96Info.vg96BaseAddr = 201 hwInfo[numDevicesInSystem].hwDep.vg96Info.vg96BaseAddr = 201 202 (FxU32)hwInfo[numDevicesInSystem].regs.hwDep.VG96RegDesc.baseAddress; 202 203 203 204 numDevicesInSystem++; 204 } 205 } 205 206 #else 206 207 # error "Do hardware enumeration for this chip!" … … 208 209 } 209 210 } 210 211 211 212 212 213 /* Sanity Check for SLI detection */ … … 228 229 libInitialized = FXTRUE; 229 230 } 230 231 231 232 if ( cb ) { 232 233 for( device = 0; device < numDevicesInSystem; device++ ) { 233 234 cb( &hwInfo[device] ); 234 } 235 } 235 236 } 236 237 return; … … 242 243 volatile FxU32* retVal = NULL; 243 244 FxBool okP = (boardNum < INIT_MAX_DEVICES); 244 245 245 246 if (okP) { 246 247 InitDeviceInfo* infoP = (hwInfo + boardNum); 247 248 const FxU32 vId = infoP->vendorID; 248 249 const FxU32 dId = infoP->deviceID; 249 250 250 251 #if defined(SST1) 251 252 okP = ((vId == TDFXVID) && … … 294 295 pciClose(); 295 296 libInitialized = FXFALSE; 296 } 297 } 297 298 } /* initClose */ 298 299 … … 334 335 Implementor(s): jdt 335 336 Library: init 336 Description: 337 Selects a 3Dfx device ( potentially from among many in the system ) and 337 Description: 338 Selects a 3Dfx device ( potentially from among many in the system ) and 338 339 initializes the internal init driver functions with behavior appropriate 339 340 to the type of the selected device. … … 346 347 347 348 FxBool 348 initDeviceSelect( FxU32 devNumber ) 349 initDeviceSelect( FxU32 devNumber ) 349 350 { 350 351 FxBool rv = FXFALSE; 351 352 352 353 if ( devNumber < numDevicesInSystem ) { 353 354 context = &contexts[hwInfo[devNumber].hwClass]; 354 355 context->info = hwInfo[devNumber]; 355 356 rv = FXTRUE; 356 } 357 357 } 358 358 359 return rv; 359 360 … … 390 391 prior to rendering. 391 392 Arguments: 392 hwnd - pointer to a window handle or null. If NULL, then 393 hwnd - pointer to a window handle or null. If NULL, then 393 394 the application window handle will be inferred though 394 395 the GetActiveWindow() api. … … 431 432 FxBool rv; 432 433 if ( context ) { 433 rv = context->setVideo( hWnd, sRes, vRefresh, cFormat, 434 rv = context->setVideo( hWnd, sRes, vRefresh, cFormat, 434 435 yOrigin, nColBuffers, nAuxBuffers, 435 436 xres, yres, fbStride, vidTimings); … … 454 455 -------------------------------------------------------------------*/ 455 456 void initRestoreVideo( void ) { 456 if ( context ) 457 if ( context ) 457 458 context->restoreVideo(); 458 459 } /* initRestoreVideo */ … … 464 465 Library: init 465 466 Description: 466 Enable the command transport mechanism for the underlying 467 Enable the command transport mechanism for the underlying 467 468 hardware and return information about accessing the transport 468 469 to the caller … … 496 497 -------------------------------------------------------------------*/ 497 498 void initDisableTransport( void ) { 498 if ( context ) 499 if ( context ) 499 500 context->disableTransport(); 500 501 } /* initDisableTransport */ … … 506 507 Library: init 507 508 Description: 508 Initiate a buffer swap. 509 Arguments: 509 Initiate a buffer swap. 510 Arguments: 510 511 code - code describing type of swap, wether to sync to vretrace, how 511 512 many vretraces to wait, etc. … … 567 568 Library: init 568 569 Description: 569 Returns only when graphics pipeline is completely idle. 570 Returns only when graphics pipeline is completely idle. 570 571 May hang software if hardware is permanently busy. 571 572 Arguments: … … 587 588 Get the current pointer to a particular buffer 588 589 Arguments: 589 buffer - which buffer to get pointer to 590 buffer - which buffer to get pointer to 590 591 Return: 591 592 integer pointer … … 602 603 Date: 2/25 603 604 Implementor(s): jdt 604 Library: init 605 Library: init 605 606 Description: 606 607 Sets the current render buffer … … 638 639 Library: init 639 640 Description: 640 CYA function so that emergency functionality may be added w/o 641 CYA function so that emergency functionality may be added w/o 641 642 corrupting dll interface 642 643 Arguments: … … 658 659 Description: 659 660 This will re-attach new buffers for the rendering context, used 660 typically only in a windowing system where buffers need to move 661 typically only in a windowing system where buffers need to move 661 662 and resize. Also, implicitly detach old associated buffers. 662 663 Arguments: -
trunk/src/opengl/glide/sst1/init/init96/dxdrvr.c
r2885 r6653 1 /* $Id: dxdrvr.c,v 1.2 2001-09-05 14:31:01 bird Exp $ */ 1 2 /* 2 3 ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY 3 4 ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT 4 5 ** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX 5 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 6 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 7 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 6 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 7 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 8 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 8 9 ** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A 9 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 10 ** 10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 11 ** 11 12 ** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO 12 13 ** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN … … 14 15 ** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR 15 16 ** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF 16 ** THE UNITED STATES. 17 ** 17 ** THE UNITED STATES. 18 ** 18 19 ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED 19 20 ** 20 21 ** $Log: dxdrvr.c,v $ 21 ** Revision 1.1 2000-02-25 00:31:28 sandervl 22 ** Revision 1.2 2001-09-05 14:31:01 bird 23 ** Added $Id:$ keyword. 24 ** 25 ** Revision 1.1 2000/02/25 00:31:28 sandervl 22 26 ** Created new Voodoo 1 Glide dir 23 27 ** 24 * 28 * 25 29 * 34 1/12/98 10:22p Dow 26 30 * H3D Stereo Support 27 * 31 * 28 32 * 33 11/06/97 9:51a Jdt 29 33 * Fixes window resize events to not crash/hang 30 * 34 * 31 35 * 32 10/01/97 3:21p Atai 32 36 * fix 819, DOS tests flicker on glide 33 * 37 * 34 38 * 31 9/08/97 12:05p Atai 35 39 * fixed resize problem in dxControl() 36 * 40 * 37 41 * 30 8/28/97 10:24a Odo 38 42 * moved debugging varaible 39 * 43 * 40 44 * 29 8/27/97 10:32a Dow 41 45 * added more debugging info 42 * 46 * 43 47 * 28 8/21/97 4:24p Dow 44 48 * Fixed @#$%! C++ Comments, Added Debugging info 45 49 ** 46 ** $Revision: 1. 1 $47 ** $Date: 200 0-02-25 00:31:28 $50 ** $Revision: 1.2 $ 51 ** $Date: 2001-09-05 14:31:01 $ 48 52 ** 49 53 */ … … 87 91 88 92 #if defined( __WIN32__) && defined(INIT_ACCESS_DDRAW) 89 #define WIN32_LEAN_AND_MEAN 90 #include <windows.h> 91 #include <ddraw.h> 93 #define WIN32_LEAN_AND_MEAN 94 #include <windows.h> 95 #include <ddraw.h> 92 96 93 97 #define NUM_BUFS 6 … … 95 99 static HWND hWndApp = 0; 96 100 static FxU32 FifoOffset = 0; 97 static FxU32 Width = 0; 101 static FxU32 Width = 0; 98 102 static FxU32 Height = 0; 99 103 static FxBool IsFullScreen = 0; … … 133 137 { 134 138 DDSURFACEDESC ddsd; 135 139 136 140 ddsd.dwSize = sizeof(ddsd); 137 if (IDirectDrawSurface2_Lock(lpSurf, NULL, &ddsd, DDLOCK_WAIT, NULL) 141 if (IDirectDrawSurface2_Lock(lpSurf, NULL, &ddsd, DDLOCK_WAIT, NULL) 138 142 !=DD_OK) { 139 143 return ErrorMessage(hWndApp, "_dxSurfaceToBufDesc: DdrawSurface Lock failed\n"); 140 144 } 141 145 142 146 /* pDesc->bufType should be filled in by caller */ 143 147 pDesc->bufOffset = (FxU32) (ddsd.lpSurface); /* virtual address. */ 144 148 pDesc->bufStride = (FxI32) (ddsd.lPitch); /* in bytes */ 145 149 pDesc->bufBPP = (FxI32) 16; 146 150 147 151 IDirectDrawSurface2_Unlock(lpSurf, NULL); 148 152 return FXTRUE; … … 163 167 InitBufDesc_t *dScreen = &pDesc[4]; 164 168 InitBufDesc_t *dTriple = &pDesc[5]; 165 169 166 170 GDBG_INFO((80, "_dxDDrawToGlide entry\n")); 167 171 168 172 /* Initialize all descriptors. */ 169 173 dScreen->bufMagic = VG96_BUF_MAGIC; … … 172 176 dScreen->bufStride = 0; 173 177 dScreen->bufBPP = 0; 174 178 175 179 /* Get info about screen (primary display) */ 176 180 dScreen->bufType = INIT_BUFFER_SCREENBUFFER; 177 181 if (!_dxSurfaceToBufDesc( lpFront, dScreen)) 178 182 return ErrorMessage(hWndApp, "Couldn't get Screen Info"); 179 183 180 184 *dFront = *dBack = *dAux = *dFifo = 181 185 *dTriple = 182 186 *dScreen; 183 187 184 188 dFront->bufType = INIT_BUFFER_FRONTBUFFER; 185 189 … … 188 192 if (!_dxSurfaceToBufDesc( lpBack, dBack)) 189 193 return ErrorMessage(hWndApp, "Couldn't get Backbuffer Info"); 190 194 191 195 /* Get info about aux buffer */ 192 196 dAux->bufType = INIT_BUFFER_AUXBUFFER; 193 if (!_dxSurfaceToBufDesc( lpAux, dAux)) 197 if (!_dxSurfaceToBufDesc( lpAux, dAux)) 194 198 return ErrorMessage(hWndApp, "Couldn't get AuxBuffer Info"); 195 199 196 200 /* Get info about triple buffer */ 197 201 if (tripleBuffering) { … … 205 209 dFifo->bufOffset = FifoOffset; 206 210 dFifo->bufStride = 65536 << 1; /* Fixme!!! what's this? */ 207 211 208 212 /* Now convert buf addresses for draw buffers into video memory offsets */ 209 213 dFront->bufOffset -= dScreen->bufOffset; … … 212 216 if (tripleBuffering) 213 217 dTriple->bufOffset -= dScreen->bufOffset; 214 218 215 219 GDBG_INFO((80, "_dxDDrawToGlideDesc: dFront->bufOffset = 0x%x\n", dFront->bufOffset)); 216 220 GDBG_INFO((80, "_dxDDrawToGlideDesc: dBack->bufOffset = 0x%x\n", dBack->bufOffset)); … … 243 247 { 244 248 DDSURFACEDESC ddsd; 245 249 246 250 #ifdef H3D 247 GDBG_INFO((80, "_dxAS: hWnd = %x, fs=%d, xRes=%d, yRes=%d, vRefresh=%d, pageFlip=%d\n", 251 GDBG_INFO((80, "_dxAS: hWnd = %x, fs=%d, xRes=%d, yRes=%d, vRefresh=%d, pageFlip=%d\n", 248 252 hWndApp, IsFullScreen, xRes, yRes, vRefresh, pageFlip)); 249 253 #else 250 GDBG_INFO((80, "_dxAS: hWnd = %x, fs=%d, xRes=%d, yRes=%d, vRefresh=%d\n", 254 GDBG_INFO((80, "_dxAS: hWnd = %x, fs=%d, xRes=%d, yRes=%d, vRefresh=%d\n", 251 255 hWndApp, IsFullScreen, xRes, yRes, vRefresh)); 252 256 #endif 253 257 254 258 if (lpDD1 == NULL) { 255 259 if (DirectDrawCreate( NULL, &lpDD1, NULL ) != DD_OK) { … … 262 266 } 263 267 264 if (IDirectDraw_QueryInterface( lpDD1, &IID_IDirectDraw2, 268 if (IDirectDraw_QueryInterface( lpDD1, &IID_IDirectDraw2, 265 269 (LPVOID*)&lpDD) !=DD_OK) { 266 270 … … 272 276 GDBG_INFO((80, "_dxAS: DDraw2 Obj created!\n")); 273 277 } 274 278 275 279 /* 276 280 * Make sure this is done after creating direct draw object!!! … … 281 285 FifoOffset = init96GetFBVram() - 65536*3; /* fixme!!! why 3? */ 282 286 } 283 287 284 288 /* 285 289 * If there are any previously allocated surfaces, free them now … … 291 295 if( lpTriple ) IDirectDrawSurface2_Release( lpTriple ); 292 296 if( lpFront ) IDirectDrawSurface2_Release( lpFront ); 293 297 294 298 lpClipper = NULL; 295 299 lpFront = NULL; … … 297 301 lpTriple = NULL; 298 302 lpAux = NULL; 299 303 300 304 if ( !IsFullScreen ) { /* In a window */ 301 305 … … 307 311 return ErrorMessage(hWndApp, "Couldn't get display mode!"); 308 312 309 if (ddsd.ddpfPixelFormat.dwRGBBitCount / 8 != 2) 313 if (ddsd.ddpfPixelFormat.dwRGBBitCount / 8 != 2) 310 314 return ErrorMessage(hWndApp, "Display is not in 16bpp format!"); 311 315 … … 317 321 ddsd.dwFlags = DDSD_CAPS; 318 322 ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE; 319 320 if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpFront, 0 ) != DD_OK) 323 324 if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpFront, 0 ) != DD_OK) 321 325 return ErrorMessage(hWndApp, "Couldn't allocate primary surface!"); 322 326 … … 324 328 xRes, yRes, ddsd.lPitch)); 325 329 /* From jdt */ 326 if (IDirectDraw2_CreateClipper( lpDD, 0, &lpClipper, 0 ) != DD_OK) 330 if (IDirectDraw2_CreateClipper( lpDD, 0, &lpClipper, 0 ) != DD_OK) 327 331 return ErrorMessage(hWndApp, "Create Clipper failed!\n"); 328 332 329 if (IDirectDrawClipper_SetHWnd( lpClipper, 0, hWndApp ) != DD_OK) 333 if (IDirectDrawClipper_SetHWnd( lpClipper, 0, hWndApp ) != DD_OK) 330 334 return ErrorMessage(hWndApp, "Clipper SethWnd failed!\n"); 331 335 332 if (IDirectDrawSurface2_SetClipper( lpFront, lpClipper ) != DD_OK) 336 if (IDirectDrawSurface2_SetClipper( lpFront, lpClipper ) != DD_OK) 333 337 return ErrorMessage(hWndApp, "Set Clipper failed!\n"); 334 338 … … 341 345 ddsd.ddsCaps.dwCaps = 342 346 DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE; 343 344 if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpBack, 0 ) != DD_OK) 347 348 if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpBack, 0 ) != DD_OK) 345 349 return ErrorMessage(hWndApp, "Couldn't allocate secondary surface!" ); 346 350 347 351 GDBG_INFO((80, "_dxAS: Back buffer allocated!\n")); 348 352 349 /* 350 * Always allocate Aux Buffer Surface 353 /* 354 * Always allocate Aux Buffer Surface 351 355 * XXX - (use nAuxBuffers, and deal with 8bpp for alpha) 352 356 */ … … 357 361 ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY 358 362 | DDSCAPS_3DDEVICE; 359 360 if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpAux, 0 ) != DD_OK) 363 364 if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpAux, 0 ) != DD_OK) 361 365 return ErrorMessage(hWndApp, "Couldn't allocate aux surface" ); 362 366 … … 364 368 365 369 } else { 366 370 367 371 /* Full screen - Set Exclusive Mode, change resolution, */ 368 372 GDBG_INFO((80, "_dxAS: Setting Full screen exclusive mode!\n")); 369 370 if (IDirectDraw2_SetCooperativeLevel(lpDD, hWndApp, 373 374 if (IDirectDraw2_SetCooperativeLevel(lpDD, hWndApp, 371 375 DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN ) != DD_OK) 372 376 return ErrorMessage(hWndApp, "Couldn't set cooperative level!"); 373 377 374 378 if (IDirectDraw2_SetDisplayMode( lpDD, xRes, yRes, 16, 0,0) != DD_OK) 375 379 return ErrorMessage(hWndApp, "Couldn't set display mode!"); 376 380 377 381 /* Allocate Front/Back Buffer Surfaces, skip triple buffer XXX */ 378 382 ddsd.dwSize = sizeof( ddsd ); 379 383 ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT; 380 384 ddsd.dwBackBufferCount = 1; 381 ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | 382 DDSCAPS_FLIP | 385 ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | 386 DDSCAPS_FLIP | 383 387 DDSCAPS_COMPLEX | 384 388 DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE; 385 386 if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpFront, 0 ) != DD_OK) 389 390 if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpFront, 0 ) != DD_OK) 387 391 return ErrorMessage(hWndApp, "Couldn't allocate primary surface!"); 388 392 389 393 /* Get back buffer information */ 390 394 ddsd.ddsCaps.dwCaps = DDSCAPS_BACKBUFFER; 391 if (IDirectDrawSurface2_GetAttachedSurface( lpFront, &ddsd.ddsCaps, 395 if (IDirectDrawSurface2_GetAttachedSurface( lpFront, &ddsd.ddsCaps, 392 396 &lpBack) != DD_OK) 393 397 return ErrorMessage(hWndApp, "Couldn't get back buffer info!\n"); 394 398 395 399 GDBG_INFO((80, "_dxAS: Full Screen: front/back buffer allocated!\n")); 396 400 397 401 /* Allocate Aux Buffer Surface - XXX */ 398 402 ddsd.dwSize = sizeof( ddsd ); … … 400 404 ddsd.dwWidth = xRes; 401 405 ddsd.dwHeight = yRes; 402 ddsd.ddsCaps.dwCaps = 406 ddsd.ddsCaps.dwCaps = 403 407 DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE; 404 405 if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpAux, 0 ) != DD_OK) 408 409 if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpAux, 0 ) != DD_OK) 406 410 return ErrorMessage(hWndApp, "Couldn't allocate aux surface" ); 407 411 408 412 GDBG_INFO((80, "_dxAS: Full Screen: aux buffer allocated!\n")); 409 413 410 414 /* 411 415 * Triple buffer hack: full-screen only for now. Allocate as Aux DD surf, … … 414 418 */ 415 419 if (tripleBuffering) { 416 if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpTriple, 0 ) != DD_OK) 420 if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpTriple, 0 ) != DD_OK) 417 421 return ErrorMessage(hWndApp, "Couldn't allocate triple buffer" ); 418 422 … … 420 424 } 421 425 } 422 426 423 427 /* Convert direct draw surfaces to Glide's idea of buffer descriptors */ 424 428 return _dxDDrawToGlideDesc(pDesc); … … 432 436 const char *errorMessage = "no error"; 433 437 434 /* for now this is a goddamn baseball bat 438 /* for now this is a goddamn baseball bat 435 439 it can be trimmed down */ 436 440 if ( !IsFullScreen ) { /* this *REALLY* should be called for fullscreen */ … … 440 444 if( lpTriple ) IDirectDrawSurface2_Release( lpTriple ); 441 445 if( lpFront ) IDirectDrawSurface2_Release( lpFront ); 442 446 443 447 lpClipper = NULL; 444 448 lpFront = NULL; … … 446 450 lpTriple = NULL; 447 451 lpAux = NULL; 448 452 449 453 /* Verify screen pixel format is 16bpp, and set cooperative level */ 450 454 ddsd.dwSize = sizeof( ddsd ); … … 454 458 ddsd.dwFlags = DDSD_CAPS; 455 459 ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE; 456 460 457 461 if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpFront, 0 ) != DD_OK) { 458 462 errorMessage = "Couldn't allocate primary surface!"; … … 484 488 ddsd.ddsCaps.dwCaps = 485 489 DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_3DDEVICE; 486 490 487 491 if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpBack, 0 ) != DD_OK) { 488 492 errorMessage = "Couldn't allocate secondary surface!"; … … 490 494 } 491 495 492 /* 493 * Always allocate Aux Buffer Surface 496 /* 497 * Always allocate Aux Buffer Surface 494 498 * XXX - (use nAuxBuffers, and deal with 8bpp for alpha) 495 499 */ … … 500 504 ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY 501 505 | DDSCAPS_3DDEVICE; 502 506 503 507 if (IDirectDraw2_CreateSurface( lpDD, &ddsd, &lpAux, 0 ) != DD_OK) { 504 508 errorMessage = "Couldn't allocate aux surface"; … … 531 535 { 532 536 if (lpDD == NULL) return TRUE; 533 537 534 538 if (IDirectDrawSurface2_IsLost(lpFront) == DDERR_SURFACELOST) { 535 if (IDirectDrawSurface2_Restore(lpFront) != DD_OK) 539 if (IDirectDrawSurface2_Restore(lpFront) != DD_OK) 536 540 return ErrorMessage(hWndApp, "Front Buffer restore failure\n"); 537 541 } 538 542 539 543 if (!IsFullScreen) { 540 544 if (IDirectDrawSurface2_IsLost(lpBack) == DDERR_SURFACELOST) { 541 if (IDirectDrawSurface2_Restore(lpBack) != DD_OK) 545 if (IDirectDrawSurface2_Restore(lpBack) != DD_OK) 542 546 return ErrorMessage(hWndApp, "Back Buffer restore failure\n"); 543 547 } 544 548 } 545 549 546 550 if (IDirectDrawSurface2_IsLost(lpAux) == DDERR_SURFACELOST) { 547 if (IDirectDrawSurface2_Restore(lpAux) != DD_OK) 551 if (IDirectDrawSurface2_Restore(lpAux) != DD_OK) 548 552 return ErrorMessage(hWndApp, "Aux Buffer restore failure\n"); 549 553 } 550 554 551 555 if (!IsFullScreen) { 552 556 if (IDirectDrawSurface2_IsLost(lpTriple) == DDERR_SURFACELOST) { 553 if (IDirectDrawSurface2_Restore(lpTriple) != DD_OK) 557 if (IDirectDrawSurface2_Restore(lpTriple) != DD_OK) 554 558 return ErrorMessage(hWndApp, "Back Buffer restore failure\n"); 555 559 } 556 560 } 557 561 558 562 GDBG_INFO((80, "_dxRS: restore surfaces OK\n")); 559 563 return _dxDDrawToGlideDesc(pDesc); … … 587 591 588 592 /* 589 * Get ourselves a valid window handle 593 * Get ourselves a valid window handle 590 594 */ 591 595 hWndApp = (hWindow == 0) ? GetActiveWindow() : (HWND) hWindow; … … 615 619 if ((sRes < GR_RESOLUTION_MIN) || 616 620 (sRes > GR_RESOLUTION_MAX) && 617 (!GR_RESOLUTION_IS_AUTOFLIPPED(sRes)) ) 621 (!GR_RESOLUTION_IS_AUTOFLIPPED(sRes)) ) 618 622 #else 619 623 if ((sRes < GR_RESOLUTION_320x200) || 620 (sRes > GR_RESOLUTION_512x256)) 624 (sRes > GR_RESOLUTION_512x256)) 621 625 #endif 622 626 return ErrorMessage(hWndApp, "Bad Fullscreen resolution"); … … 659 663 GDBG_INFO((80, "\tbufType = 0x%x\n", pBufDesc[i].bufType)); 660 664 GDBG_INFO((80, "\tbufOffset = 0x%x\n", pBufDesc[i].bufOffset)); 661 GDBG_INFO((80, "\tbufStride = 0x%x\n", pBufDesc[i].bufStride)); 665 GDBG_INFO((80, "\tbufStride = 0x%x\n", pBufDesc[i].bufStride)); 662 666 GDBG_INFO((80, "\tbufBPP = 0x%x\n", pBufDesc[i].bufBPP)); 663 667 } … … 668 672 669 673 if ( curHALData->initSetVideo ) { 670 curHALData->initSetVideo( sRes, vRefresh, 674 curHALData->initSetVideo( sRes, vRefresh, 671 675 (FxU32*)width, (FxU32*)height ); 672 676 } … … 683 687 RECT rect; 684 688 int i; 685 689 686 690 GDBG_INFO((80, "dxControl: code = %d\n", code)); 687 691 688 692 /* dx is not initizized */ 689 693 if ( lpDD== NULL ) { 690 694 return TRUE; 691 695 } 692 696 693 697 /* Why was I called? */ 694 698 switch(code) { … … 698 702 Width = rect.right; 699 703 Height = rect.bottom; 700 GDBG_INFO((120, "W and H changed to %d %d\n", 701 Width, Height)); 704 GDBG_INFO((120, "W and H changed to %d %d\n", 705 Width, Height)); 702 706 703 707 if (!_dxReallocSurfaces(Width, Height, 0, BufDesc)) { … … 731 735 GDBG_INFO((80, "dxControl: code = %d, w = %d, h = %d\n", code, 732 736 Width, Height)); 733 737 734 738 return FXTRUE; 735 739 } /* dxControl */ … … 759 763 lpDD1 = NULL; 760 764 } 761 765 762 766 lpClipper = NULL; 763 767 lpFront = NULL; … … 766 770 lpAux = NULL; 767 771 lpDD = NULL; 768 772 769 773 #endif /* 0 */ 770 774 GDBG_INFO((80, "dxClose: Returning TRUE\n")); … … 778 782 static POINT point; 779 783 static HRESULT hr; 780 784 781 785 GDBG_INFO((80, "dxSwap:\n")); 782 786 if ( !IsFullScreen ) { … … 787 791 src.top = 0; 788 792 src.bottom = Height-1; 789 793 790 794 dest = src; 791 795 point.x = 0; … … 797 801 dest.bottom += point.y; 798 802 799 hr = IDirectDrawSurface_Blt( lpFront, 803 hr = IDirectDrawSurface_Blt( lpFront, 800 804 &dest, 801 805 lpBack, … … 803 807 DDBLT_WAIT, 804 808 NULL ); 805 809 806 810 while( IDirectDrawSurface_GetBltStatus( lpFront, DDGBS_ISBLTDONE ) != 807 811 DD_OK ); 808 812 809 813 if ( hr != DD_OK ) { 810 814 ErrorMessage(hWndApp, "Couldn't blit!\n"); … … 812 816 } 813 817 return; 814 818 815 819 } /* dxSwap */ 816 820 #else /* it's either DOS or the Hoopti Lab Setup */ … … 880 884 break; 881 885 } 882 886 883 887 884 888 #define WAITLOOP {\ … … 893 897 894 898 if ( curHALData->initSetVideo ) { 895 rv = curHALData->initSetVideo( sRes, vRefresh, 899 rv = curHALData->initSetVideo( sRes, vRefresh, 896 900 (FxU32*)width, (FxU32*)height ); 897 901 if ( !rv ) goto BAIL; 898 902 } 899 903 900 904 /* Initialize all descriptors. */ 901 905 dFront->bufMagic = VG96_BUF_MAGIC; … … 952 956 #ifdef GDBG_INFO_ON 953 957 { 954 int i; 958 int i; 955 959 956 960 for (i = 0; i < 5; i++) { … … 959 963 GDBG_INFO((80, "%s: pBufDesc.bufType = %s\n", 960 964 FN_NAME, bufTypeNames[pBufDesc[i].bufType])); 961 GDBG_INFO((80, "%s: pBufDesc.bufOffset = 0x%x\n", 965 GDBG_INFO((80, "%s: pBufDesc.bufOffset = 0x%x\n", 962 966 FN_NAME, pBufDesc[i].bufOffset )); 963 GDBG_INFO((80, "%s: pBufDesc.bufStride = 0x%x\n", 967 GDBG_INFO((80, "%s: pBufDesc.bufStride = 0x%x\n", 964 968 FN_NAME, pBufDesc[i].bufStride)); 965 969 GDBG_INFO((80, "%s: pBufDesc.bufBPP = 0x%x\n", -
trunk/src/opengl/glide/sst1/init/init96/init96.c
r2885 r6653 1 /* $Id: init96.c,v 1.2 2001-09-05 14:31:01 bird Exp $ */ 1 2 /* 2 3 ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY 3 4 ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT 4 5 ** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX 5 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 6 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 7 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 6 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 7 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 8 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 8 9 ** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A 9 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 10 ** 10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 11 ** 11 12 ** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO 12 13 ** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN … … 14 15 ** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR 15 16 ** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF 16 ** THE UNITED STATES. 17 ** 17 ** THE UNITED STATES. 18 ** 18 19 ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED 19 ** $Revision: 1. 1 $20 ** $Date: 200 0-02-25 00:31:28 $20 ** $Revision: 1.2 $ 21 ** $Date: 2001-09-05 14:31:01 $ 21 22 ** 22 23 */ 23 static char revString[] = "@#%$Workfile: INIT96.C $ $Revision: 1. 1$";24 static char revString[] = "@#%$Workfile: INIT96.C $ $Revision: 1.2 $"; 24 25 25 26 /* ANSI Headers */ … … 113 114 114 115 115 #define RFB 0 116 #define RFB 0 116 117 #define DFB 1 117 118 118 119 119 120 extern FxBool tripleBuffering; 120 121 … … 173 174 oldVidMode; 174 175 175 static FxU32 176 devNum, 176 static FxU32 177 devNum, 177 178 physAddr, 178 179 fifoMTRRNum = 0xffffffff; … … 181 182 #ifdef GDBG_INFO_ON 182 183 /* NOTE: 183 184 184 185 This array is HIGHLY important to debugging. Delete it at your 185 186 extreme peril. … … 449 450 #ifdef GDBG_INFO_ON 450 451 FxU32 451 get96(FxU32 *addr) 452 get96(FxU32 *addr) 452 453 { 453 454 FxU32 … … 495 496 496 497 static FxBool 497 init96LoadBufRegs(int nBuffers, 498 InitBufDesc_t *pBufDesc, 499 int xRes, int yRes, 498 init96LoadBufRegs(int nBuffers, 499 InitBufDesc_t *pBufDesc, 500 int xRes, int yRes, 500 501 InitRegisterDesc *rd); 501 502 … … 512 513 SET(sstPtr->vC.x, x); 513 514 SET(sstPtr->vC.y, y+XY_ONE*tSize/2); 514 515 515 516 SET(sstPtr->s, 0); 516 517 SET(sstPtr->t, 0); … … 561 562 562 563 *(texAddr + (8 << 15)) = init; 563 /* 564 /* 564 565 write to 2 consequtive locations in lod0 to alter the data 565 on the memory signals 566 on the memory signals 566 567 */ 567 568 WAITLOOP; 568 *(texAddr + (0)) = 0xffffffff; 569 *(texAddr + (0)) = 0xffffffff; 569 570 WAITLOOP; 570 571 *(texAddr + (1)) = 0xffffffff; 571 572 572 573 WAITLOOP; 573 574 … … 592 593 { 593 594 FxU32 data; 594 595 595 596 if(myGetenv(("SST96_TMUMEM_SIZE"))) { 596 597 *TmuMemorySize = atoi(myGetenv(("SST96_TMUMEM_SIZE"))); … … 605 606 /* set lod8 */ 606 607 SET(sstPtr->tLOD, ((8 << 2) | (8 << 7))); 607 608 /* 608 609 /* 609 610 first see if we have 4 Mbytes by writing a texel at 2MB followed by 610 611 a texel at 1MB and 0MB and then rendering using the texel at 2MB … … 617 618 data = sense(sstbase,info,tmu,0x200000, SENSE1); 618 619 if (data) { 619 *TmuMemorySize = 4; 620 *TmuMemorySize = 4; 620 621 return(FXTRUE); 621 622 } … … 630 631 } 631 632 } 632 633 633 634 data = sense(sstbase,info,tmu,0x000000, SENSE0); 634 635 if (data) { 635 636 data = sense(sstbase,info,tmu,0x000000, SENSE1); 636 637 if (data) { 637 *TmuMemorySize = 1; 638 *TmuMemorySize = 1; 638 639 return(FXTRUE); 639 640 } … … 641 642 642 643 #undef WAITLOOP 643 644 644 645 return(FXFALSE); 645 646 } … … 653 654 sst96InitGetTmuInfo(FxU32 *sstbase, VG96Info *info) 654 655 { 655 sstPtr = 656 sstPtr = 656 657 (volatile Sstregs *)(SST96_COMMAND_REGS(sstbase)); 657 658 … … 684 685 685 686 VG96Info *vg96Info = (VG96Info *) info; 686 687 687 688 FxU32 688 689 vendorID = vID, 689 690 deviceID = dID; 690 691 691 692 GDBG_INFO((80, "SST-96 Initialization code %s\n", revString)); 692 693 693 694 /* Watcom warning suppression */ 694 695 revString[0] = revString[0]; … … 696 697 /* !!! FIXME hack for vxd bug */ 697 698 putenv( "SST_DUALHEAD=1" ); 698 699 699 700 switch (vID) { 700 701 case AT3DVID: … … 710 711 711 712 GDBG_INFO((80, "init96MapBoard: Mapping card into linear memory\n")); 712 713 713 714 regDesc->hwDep.VG96RegDesc.baseAddress = 714 715 pciMapCardMulti( vendorID, deviceID, curHALData->memSize, &devNum, 0 , 0); … … 741 742 sstHW = regDesc->hwDep.VG96RegDesc.baseAddress; 742 743 743 GDBG_INFO((80, "%s: Mapped Voodoo Rush board at 0x%x\n", 744 GDBG_INFO((80, "%s: Mapped Voodoo Rush board at 0x%x\n", 744 745 FN_NAME, regDesc->hwDep.VG96RegDesc.baseAddress)); 745 746 … … 750 751 751 752 GDBG_INFO((88, "init96MapBoard sstHW = %x\n", sstHW)); 752 753 753 754 /* CHD NOTE: The routine init96SetupRendering MUST Be called from this 754 755 routine or all hell brakes loose. … … 761 762 GrScreenResolution_t res = GR_RESOLUTION_640x480; 762 763 static void init96SetupRendering(InitRegisterDesc *regDesc, 763 764 GrScreenResolution_t sRes); 764 765 765 766 if (curHALData->initAperture) … … 769 770 if ( !rv ) 770 771 return FXFALSE; 771 772 772 773 init96SetupRendering(regDesc, res); 773 774 774 775 sst96InitGetTmuInfo((FxU32 *)sstHW, vg96Info); 775 776 } … … 779 780 /* In dos mode, we do it the way it is supposed to be. 780 781 In windows mode, calling initEnableRegs() will change the clock 781 rate and it makes the refresh looks bad. So we still use the 782 rate and it makes the refresh looks bad. So we still use the 782 783 init96SetVideo() to set up the rendering mode etc. 783 784 */ … … 791 792 union REGS 792 793 inR, outR; 793 794 794 795 inR.w.ax = 0x4f03; 795 796 int386(0x10, &inR, &outR); 796 797 797 798 oldVidMode = outR.w.bx; 798 799 GDBG_INFO((80, "%s: Saving Current video mode (0x%x).\n", 799 FN_NAME, oldVidMode)); 800 FN_NAME, oldVidMode)); 800 801 } 801 802 802 803 if ( !rv ) 803 804 return FXFALSE; 804 805 805 806 if ( curHALData->initEnableRegs ) 806 807 rv = curHALData->initEnableRegs( regDesc ); 807 808 if ( !rv ) 808 809 return FXFALSE; 809 810 810 811 init96SetupRendering(regDesc, res); 811 812 812 813 sst96InitGetTmuInfo((FxU32 *)sstHW, vg96Info); 813 814 } … … 817 818 GrScreenResolution_t res = GR_RESOLUTION_NONE; 818 819 init96SetVideo(0, res, 819 0, 2, 1, 820 0, 2, 1, 820 821 2, 1, regDesc, 821 822 &xres, &yres, &fbStride ); … … 827 828 828 829 GDBG_INFO((80, "init96MapBoard: returning FXTRUE\n")); 829 830 830 831 return FXTRUE; 831 832 … … 852 853 }\ 853 854 } 854 #endif 855 #endif 855 856 856 857 #define SWAPPENDING(status) ((status & 0x70) >> 4) … … 862 863 Library: Init Code for 96 863 864 Description: 864 865 865 866 Arguments: 866 867 867 868 Return: 868 869 -------------------------------------------------------------------*/ … … 874 875 875 876 sstHW = regDesc->hwDep.VG96RegDesc.baseAddress; 876 sstPtr = 877 sstPtr = 877 878 (volatile Sstregs *)(SST96_COMMAND_REGS(regDesc->hwDep.VG96RegDesc.baseAddress)); 878 879 … … 882 883 GDBG_INFO((80, "%s: Software reset\n", FN_NAME)); 883 884 SET(sstHW[0x90 + 0x100000], 0xf601); /* (0xf601) init0, sw reset. */ 884 885 885 886 WAITLOOP; 886 887 … … 889 890 SET(sstHW[0x100000 + 0x94], 0); 890 891 SET(sstHW[0x100000 + 0x93], 0); 891 892 892 893 GDBG_INFO((80, "%s: Setting up Mem FIFO\n", FN_NAME)); 893 894 … … 895 896 896 897 SET(sstHW[0x92 + 0x100000], regVal); 897 898 /* Off for Host Blt, On for LFB command traffic 898 899 /* Off for Host Blt, On for LFB command traffic 899 900 Low Priority Request Aging - wait 64 cycles 900 901 before answering low priority requests from … … 903 904 [24] - PUMA Texture Address Space Mode - 0x1 - 2MB 904 905 [23] - PUMA Texture Base Address Mode - 0x1 - 6MB 905 [12:7] - PUMA Low Priority Grant Limit Cnt - 0x0 906 [6] - PUMA Low Prorirty Grant Limit Enable - 0x0 906 [12:7] - PUMA Low Priority Grant Limit Cnt - 0x0 907 [6] - PUMA Low Prorirty Grant Limit Enable - 0x0 907 908 [5:0] - PUMA Low Priority Request Delay Cnt - 0x1f - 32 ccls 908 909 Setting to 0x3f ( max ) seems to cripple windows/d3d … … 910 911 */ 911 912 GDBG_INFO((80, "%s: Setting low priority request aging.\n", FN_NAME)); 912 /* 913 * If we're running at a high resolution, don't starve AT3D's 913 /* 914 * If we're running at a high resolution, don't starve AT3D's 914 915 * video refresh. XXX FIXME for AT3d only 915 916 */ … … 926 927 SET(sstHW[0x91 + 0x100000],regVal); 927 928 } 928 929 /* Come out of Reset 929 930 /* Come out of Reset 930 931 [17] - Serial Status Xfer Mode - 0x0 - rising edge 931 932 [16:12] - TREX-To-FBI High Water Mark - 0xf 932 933 [11:8] - TREX-To-FBI Bus Clock Delay - 0x6 933 */ 934 934 */ 935 935 936 GDBG_INFO((80, "%s: Coming out of FBI reset\n", FN_NAME)); 936 937 GETREGVALFROMENV(regVal, "SST96_FBIJRINIT0", 0xf600); 937 938 SET(sstHW[0x90 + 0x100000], regVal); /* Bit 1 disables tmu */ 938 939 939 940 WAITLOOP; 940 941 … … 942 943 { 943 944 FxU32 trexinit0, trexinit1; 944 945 945 946 if(myGetenv(("SST_TREX0INIT0"))) { 946 947 sscanf(myGetenv(("SST_TREX0INIT0")), "%i", &trexinit0); … … 948 949 trexinit0 = 0x05441; /* TREXINIT0 */ 949 950 } 950 951 951 952 if(myGetenv(("SST_TREX0INIT1"))) { 952 953 sscanf(myGetenv(("SST_TREX0INIT1")), "%i", &trexinit1); … … 954 955 trexinit1 = 0x3643c; /* TREXINIT1 */ 955 956 } 956 957 957 958 SET(sstHW[0xc7 + 0x100000], trexinit0); /* TREXINIT0 */ 958 959 SET(sstHW[0xc8 + 0x100000], trexinit1); /* TREXINIT1 */ 959 960 } 960 961 961 962 WAITLOOP; 962 963 963 964 #undef FN_NAME 964 965 } /* init96SetupRendering */ … … 970 971 Library: init96 971 972 Description: 972 973 973 974 1 - Set video mode 974 975 2 - Enable Direct Writes to Jr 975 976 3 - Put Jr registers in Reset 976 977 3 - Set up Color Buffer Registers 977 978 978 979 Arguments 979 980 980 981 Return: 981 FXFALSE - fail 982 FXFALSE - fail 982 983 FXTRUE - pass 983 984 -------------------------------------------------------------------*/ 984 INITVG96ENTRY(init96SetVideo, FxBool , 985 INITVG96ENTRY(init96SetVideo, FxBool , 985 986 ( FxU32 hWnd, 986 987 GrScreenResolution_t sRes, … … 1011 1012 GDBG_INFO((80, "%s: %d Color Buffers\n", FN_NAME, nColBuffers)); 1012 1013 1013 GDBG_INFO((80, "(%s) hWnd=%x, sRes=%d, yOrg=%d, ncb=%d, nab=%d\n", 1014 GDBG_INFO((80, "(%s) hWnd=%x, sRes=%d, yOrg=%d, ncb=%d, nab=%d\n", 1014 1015 FN_NAME, hWnd, sRes, yOrigin, nColBuffers, nAuxBuffers)); 1015 1016 … … 1020 1021 if (curHALData->initAperture) 1021 1022 (*curHALData->initAperture)(regDesc); 1022 1023 1023 1024 #if defined( __DOS32__ ) 1024 1025 { … … 1031 1032 oldVidMode = outR.w.bx; 1032 1033 GDBG_INFO((80, "%s: Saving Current video mode (0x%x).\n", 1033 FN_NAME, oldVidMode)); 1034 } 1035 #endif 1036 1034 FN_NAME, oldVidMode)); 1035 } 1036 #endif 1037 1037 1038 /*------------------------------------- 1038 1039 Set Video Mode … … 1042 1043 this does not have anything to do with directX */ 1043 1044 #ifdef __linux__ 1044 if (!linOpen(hWnd, sRes, vRefresh, cFormat, yOrigin, 1045 nColBuffers, nAuxBuffers, bufDesc, 1045 if (!linOpen(hWnd, sRes, vRefresh, cFormat, yOrigin, 1046 nColBuffers, nAuxBuffers, bufDesc, 1046 1047 xres, yres, &swapType)) { 1047 1048 #else 1048 if (!dxOpen(hWnd, sRes, vRefresh, cFormat, yOrigin, 1049 nColBuffers, nAuxBuffers, bufDesc, 1049 if (!dxOpen(hWnd, sRes, vRefresh, cFormat, yOrigin, 1050 nColBuffers, nAuxBuffers, bufDesc, 1050 1051 xres, yres, &swapType)) { 1051 1052 #endif … … 1054 1055 goto BAIL; 1055 1056 } 1056 1057 #ifdef GDBG_INFO_ON 1057 1058 #ifdef GDBG_INFO_ON 1058 1059 for (i = 0; i < nColBuffers; i++) { 1059 1060 GDBG_INFO((80, "%s: bufDesc[%d]:\n", FN_NAME, i)); 1060 1061 GDBG_INFO((80, "%s: bufDesc.bufType = %s\n", 1061 1062 FN_NAME, bufTypeNames[bufDesc[i].bufType])); 1062 GDBG_INFO((80, "%s: bufDesc.bufOffset = 0x%x\n", 1063 GDBG_INFO((80, "%s: bufDesc.bufOffset = 0x%x\n", 1063 1064 FN_NAME, bufDesc[i].bufOffset )); 1064 GDBG_INFO((80, "%s: bufDesc.bufStride = 0x%x\n", 1065 GDBG_INFO((80, "%s: bufDesc.bufStride = 0x%x\n", 1065 1066 FN_NAME, bufDesc[i].bufStride)); 1066 1067 GDBG_INFO((80, "%s: bufDesc.bufBPP = 0x%x\n", … … 1097 1098 FxU32 1098 1099 pending = 7; /* # Swaps pending */ 1099 1100 GDBG_INFO((80, 1101 "%s: Sending %d swapbufferCMDs\n", 1102 FN_NAME, 1100 1101 GDBG_INFO((80, 1102 "%s: Sending %d swapbufferCMDs\n", 1103 FN_NAME, 1103 1104 pending)); 1104 1105 while (pending) { 1105 1106 FxU32 1106 1107 tries = 0; 1107 1108 1108 1109 GDBG_INFO((80, "%s: %d swaps pending\n", FN_NAME, pending)) ; 1109 1110 … … 1117 1118 WAITLOOP; 1118 1119 } 1119 1120 1120 1121 do { 1121 1122 ++tries; 1122 1123 status = sstHW[0x100000]; 1123 1124 1124 1125 GDBG_INFO((120, "%s: Serial status = 0x%x\n", FN_NAME, status)); 1125 1126 pending = SWAPPENDING(status); … … 1131 1132 } while (pending); 1132 1133 } 1133 1134 1134 1135 /* Clear counters with a NOP */ 1135 1136 SET(sstHW[0x42 + 0x100000], 1); /* NOP cmd */ … … 1138 1139 do { 1139 1140 if (nTries > MAXTRIES) { 1140 GDBG_INFO((80, 1141 GDBG_INFO((80, 1141 1142 "%s: Bailing out and returning false after %d checks for idle.\n", FN_NAME, nTries-1)); 1142 1143 return FXFALSE; … … 1144 1145 ++nTries; 1145 1146 status = sstHW[0x100000]; 1146 1147 GDBG_INFO((80, 1148 "%s: Serial status after soft reset: 0x%x\n", 1149 FN_NAME, 1147 1148 GDBG_INFO((80, 1149 "%s: Serial status after soft reset: 0x%x\n", 1150 FN_NAME, 1150 1151 status)); 1151 1152 } while (status & 0x1); 1152 1153 } /* end of swap buffer block */ 1153 1154 1154 1155 1155 1156 if (tripleBuffering) { 1156 1157 GETREGVALFROMENV(regVal, "SST96_FBIJRINIT0", 0xf600); … … 1167 1168 1168 1169 dfbFrontIdx = 0; 1169 dfbBackIdx = 1; 1170 dfbBackIdx = 1; 1170 1171 dfbRenderIdx = dfbBackIdx; 1171 1172 1172 1173 rfbFrontIdx = 0; 1173 rfbBackIdx = 1; 1174 rfbBackIdx = 1; 1174 1175 rfbRenderIdx = rfbBackIdx; 1175 1176 … … 1179 1180 goto BAIL; 1180 1181 } 1181 1182 1182 1183 /*------------------------------------- 1183 1184 Set up Page Flipping … … 1196 1197 if (curHALData->initUseTiles && (swapType == INIT_SWAP_FLIP)) { 1197 1198 #ifdef H3D 1198 (*curHALData->initUseTiles)(regDesc, 1199 (*curHALData->initUseTiles)(regDesc, 1199 1200 buf, 1200 1201 maxBuffer, 1201 1202 bI[0].dfbStride, 1202 *xres, 1203 *xres, 1203 1204 *yres, 1204 1205 GR_RESOLUTION_IS_AUTOFLIPPED(sRes) ); 1205 1206 #else 1206 (*curHALData->initUseTiles)(regDesc, 1207 (*curHALData->initUseTiles)(regDesc, 1207 1208 buf, 1208 1209 maxBuffer, 1209 1210 bI[0].dfbStride, 1210 *xres, 1211 *xres, 1211 1212 *yres ); 1212 1213 #endif … … 1214 1215 } 1215 1216 #endif 1216 1217 1217 1218 *fbStride = (bI[1].dfbStride>>1); 1218 1219 GDBG_INFO(( 200, "frame buffer stride: %d\n", *fbStride )); 1219 1220 1220 1221 BAIL: 1221 1222 return rv; … … 1230 1231 Library: init96 1231 1232 Description: 1232 1233 1233 1234 Disable Direct Hardware Access 1234 1235 Restore the video to it's initial state 1235 1236 1236 1237 Arguments: 1237 1238 none … … 1240 1241 -------------------------------------------------------------------*/ 1241 1242 INITVG96ENTRY(init96RestoreVideo, void, ( InitRegisterDesc *regDesc )) { 1242 #define FN_NAME "init96RestoreVideo" 1243 #define FN_NAME "init96RestoreVideo" 1243 1244 if ( curHALData->initDisableRegs ) 1244 1245 curHALData->initDisableRegs( regDesc ); 1245 1246 #if defined( __WIN32__ ) && !defined( INIT_HOOPTI ) 1246 1247 #if defined( __WIN32__ ) && !defined( INIT_HOOPTI ) 1247 1248 dxClose(); 1248 #elif defined( __DOS32__ ) 1249 #elif defined( __DOS32__ ) 1249 1250 { 1250 1251 static union REGS … … 1270 1271 Library: init96 1271 1272 Description: 1272 1273 Enable the JR command transport and return pertinant fifo 1273 1274 Enable the JR command transport and return pertinant fifo 1274 1275 information to the caller 1275 1276 1276 1277 Arguments: 1277 1278 info - structure to fill with info about the FIFO … … 1280 1281 FXFALSE - fail 1281 1282 -------------------------------------------------------------------*/ 1282 INITVG96ENTRY(init96EnableTransport, FxBool, ( InitFIFOData *info, InitRegisterDesc* regDesc)) 1283 INITVG96ENTRY(init96EnableTransport, FxBool, ( InitFIFOData *info, InitRegisterDesc* regDesc)) 1283 1284 { 1284 1285 #define FN_NAME "init96EnableTransport" … … 1292 1293 PciMemType 1293 1294 fifoMemType; 1294 1295 1295 1296 GDBG_INFO((80, "%s\n", FN_NAME)); 1296 1297 1297 1298 /*------------------------------------------------------------ 1298 1299 Enable the Off Chip Fifo 1299 1300 ------------------------------------------------------------*/ 1300 1301 1301 1302 /* These are defined in sst.c for now */ 1302 1303 lo = (fifoStart >> 12); /* physaddr of 1st 4k page */ … … 1304 1305 sz = (hi - lo + 1) << 12; /* bytes */ 1305 1306 th = (hi - lo) - 3; /* threshold, in 4k pages. */ 1306 1307 1307 1308 /* Generate virtual addresses for the pointers. */ 1308 1309 fifovirt = (FxU32 *)&sstHW[lo << 10]; … … 1310 1311 fifomax = sz; 1311 1312 fifocur = 0; 1312 1313 1313 1314 fifoptr = fifovirt; 1314 1315 fifosize = 4096; /* initially, set to 4k */ 1315 1316 1316 1317 fifolfb = 1; 1317 1318 1318 1319 /* First disable the off-chip fifo */ 1319 1320 GDBG_INFO((80, "%s: Disabling off-chip FIFO\n", FN_NAME)); 1320 1321 SET(sstHW[0x100000 + 0x93], 0); 1321 1322 1322 1323 /* FbijrInit4 - 0x94 - entry count */ 1323 1324 SET(sstHW[0x100000 + 0x94], 0); 1324 1325 1325 1326 /* FbijrInit5 - 0x95 - read pointer */ 1326 1327 SET(sstHW[0x100000 + 0x95], lo << 9); 1327 1328 1328 /* Default size to page checking mode. 1329 /* Default size to page checking mode. 1329 1330 * 1330 1331 * NB: This will get overwritten later if we're using … … 1340 1341 info->hwDep.vg96FIFOData.fifoLfb = fifolfb; 1341 1342 1342 /* Set up alternate wrapping values. 1343 /* Set up alternate wrapping values. 1343 1344 * 1344 1345 * NB: This *MUST* come before the processor dependent … … 1375 1376 1376 1377 /* 1377 ** NOTE TO ALL FOOLS WHO TREAD HERE 1378 ** 1378 ** NOTE TO ALL FOOLS WHO TREAD HERE 1379 ** 1379 1380 ** It is VITALLY important to enable the FIFO AFTER the 1380 1381 ** P6 Lag Of Love(tm), instead of before, otherwise the FIFO will … … 1387 1388 1388 1389 /* Set the fifo ptr now that we really know where its going to start 1389 * for the client code. 1390 * for the client code. 1390 1391 */ 1391 1392 info->hwDep.vg96FIFOData.fifoPtr = (FxU32*)fifoptr; … … 1426 1427 Return: 1427 1428 -------------------------------------------------------------------*/ 1428 INITVG96ENTRY(init96DisableTransport, void, ( void )) 1429 INITVG96ENTRY(init96DisableTransport, void, ( void )) 1429 1430 { 1430 1431 #define FN_NAME "init96DisableTransport" 1431 1432 while (*(volatile FxU32 *)sstPtr & 1); 1432 1433 1433 1434 SET(sstHW[0x100000 + 0x90], 0xf601); /* (0xf601) init0, sw reset. */ 1434 1435 SET(sstHW[0x100000 + 0x95], 0); … … 1503 1504 1504 1505 sstPtr->swappendCMD = 0x1; 1505 1506 1506 1507 1507 1508 if (gotEnv == FXFALSE) { … … 1552 1553 CRTC_GET(AR_CRTC_SERIAL_OVERFLOW_INDEX, serialOverflow); 1553 1554 serialOverflow &= 0xF0; 1554 1555 1555 1556 /* Make sure scanout within active display */ 1556 1557 do { 1557 1558 INP(VGA_INPUT_STATUS_1C, tmp); 1558 1559 } while (tmp & VIS1C_PIXEL_DISPLAY_INACTIVE); 1559 1560 1560 1561 /* Set serial address */ 1561 1562 /* For some reason unknown to me, this is set to the byte offset / 4, 1562 1563 or perhaps the offset in dwords */ 1563 1564 1564 1565 /* Top nibble */ 1565 1566 tmp = (FxU8) ((offset >> (2+16)) & 0x0F); 1566 1567 CRTC_SET(AR_CRTC_SERIAL_OVERFLOW_INDEX, serialOverflow | tmp); 1567 1568 1568 1569 /* Middle byte */ 1569 1570 tmp = (FxU8) ((offset >> (2+8)) & 0xFF); 1570 1571 CRTC_SET(VR_CRTC_SERIAL_START_ADDRESS_HI_INDEX, tmp); 1571 1572 1572 1573 /* Low byte */ 1573 1574 tmp = (FxU8) ((offset >> 2) & 0xFF); 1574 1575 CRTC_SET(VR_CRTC_SERIAL_START_ADDRESS_LO_INDEX, tmp); 1575 1576 1576 1577 /* Save away */ 1577 1578 do { … … 1584 1585 #endif 1585 1586 #endif 1586 1587 1587 1588 /* dpc - 26 jan 1998 1588 1589 * Some hw, macronix, requires that we diddle w/ even more bits 1589 * when we do the swap. 1590 * when we do the swap. 1590 1591 */ 1591 1592 if(curHALData->initSwapTiles != NULL) (*curHALData->initSwapTiles)(rd); 1592 1593 1593 1594 ADVANCE_BUFFERS(rfb); 1594 1595 … … 1597 1598 bI[rfbRenderIdx].rfb)); 1598 1599 wcb( (FxU32*)&(sstPtr->colBufferSetup), bI[rfbRenderIdx].rfb ); 1599 1600 1600 1601 1601 1602 } else { … … 1623 1624 Library: Init Code for VG96 1624 1625 Description: 1625 1626 1626 1627 Arguments: 1627 1628 1628 1629 Return: 1629 1630 -------------------------------------------------------------------*/ … … 1655 1656 #define LFB_OFFSET( X ) ( X & 0x3fffff ) 1656 1657 1657 INITVG96ENTRY(init96GetBufferPtr, void*, (InitBuffer_t buffer, int *strideBytes)) 1658 INITVG96ENTRY(init96GetBufferPtr, void*, (InitBuffer_t buffer, int *strideBytes)) 1658 1659 { 1659 1660 #define FN_NAME "init96GetBufferPtr" … … 1698 1699 Date: 2/25 1699 1700 Implementor(s): jdt 1700 Library: init96 1701 Library: init96 1701 1702 Description: 1702 1703 Set the current render buffer … … 1706 1707 none 1707 1708 -------------------------------------------------------------------*/ 1708 INITVG96ENTRY(init96RenderBuffer, void, (InitBuffer_t buffer,Init96WriteMethod *wcb)) 1709 INITVG96ENTRY(init96RenderBuffer, void, (InitBuffer_t buffer,Init96WriteMethod *wcb)) 1709 1710 { 1710 1711 #define FN_NAME "init96RenderBuffer" … … 1737 1738 none 1738 1739 -------------------------------------------------------------------*/ 1739 INITVG96ENTRY(init96Origin, void, (InitOriginLocation_t origin,Init96WriteMethod *wcb)) 1740 INITVG96ENTRY(init96Origin, void, (InitOriginLocation_t origin,Init96WriteMethod *wcb)) 1740 1741 { 1741 1742 #define FN_NAME "init96Origin" … … 1781 1782 1782 1783 GDBG_INFO((80, "(%s)\n", FN_NAME)); 1783 1784 1784 1785 if ( !sstHW ) return FXFALSE; 1785 1786 … … 1813 1814 (*((volatile FxU32*)(((FxU32)(__regP)) + (0x95 << 12))) << 3)) 1814 1815 1815 INITVG96ENTRY(init96WrapFIFO, 1816 FxBool, 1816 INITVG96ENTRY(init96WrapFIFO, 1817 FxBool, 1817 1818 (InitRegisterDesc* rd, InitFIFOData* fifoP)) 1818 1819 { … … 1826 1827 1827 1828 { 1828 const FxI32 writes = (MIN(fifoP->hwDep.vg96FIFOData.roomToReadPtr, 1829 const FxI32 writes = (MIN(fifoP->hwDep.vg96FIFOData.roomToReadPtr, 1829 1830 fifoP->hwDep.vg96FIFOData.roomToEnd) - 1830 1831 fifoP->hwDep.vg96FIFOData.fifoSize); 1831 1832 1832 1833 fifoP->hwDep.vg96FIFOData.roomToReadPtr -= writes; 1833 1834 fifoP->hwDep.vg96FIFOData.roomToEnd -= writes; … … 1843 1844 const FxU32 curReadPtr = SST96_HW_FIFO(sstHW, sstPtr); 1844 1845 const FxU32 curReadDist = curReadPtr - lastHwRead; 1845 1846 1846 1847 roomToReadPtr += curReadDist; 1847 1848 if (lastHwRead > curReadPtr) roomToReadPtr += fifoP->hwDep.vg96FIFOData.fifoMax; … … 1850 1851 } 1851 1852 1852 GDBG_INFO((80, FN_NAME"_Wait : (0x%X : 0x%X) : (0x%X : 0x%X)\n", 1853 GDBG_INFO((80, FN_NAME"_Wait : (0x%X : 0x%X) : (0x%X : 0x%X)\n", 1853 1854 (FxU32)fifoP->hwDep.vg96FIFOData.fifoPtr, blockSize, 1854 1855 fifoP->hwDep.vg96FIFOData.roomToReadPtr, … … 1870 1871 #else 1871 1872 #define JU_JU_STALL /* Do Nothing */ 1872 #endif 1873 #endif 1873 1874 { 1874 1875 volatile FxU32* fifoPtr = fifoP->hwDep.vg96FIFOData.fifoPtr; … … 1886 1887 volatile FxU32* serialStatus = 1887 1888 fifoP->hwDep.vg96FIFOData.regDesc->hwDep.VG96RegDesc.serialStatus; 1888 1889 1889 1890 if ((*serialStatus & 0x80) != 0x00) { 1890 1891 GDBG_INFO((85, FN_NAME": fifo close to full. Waiting(0x%X)...\n", numJuJuStalls)); … … 1900 1901 #undef kFifoPadDelay 1901 1902 1902 GDBG_INFO((80, FN_NAME"_Wrap : (0x%X : 0x%X) : (0x%X : 0x%X)\n", 1903 GDBG_INFO((80, FN_NAME"_Wrap : (0x%X : 0x%X) : (0x%X : 0x%X)\n", 1903 1904 (FxU32)fifoP->hwDep.vg96FIFOData.fifoPtr, blockSize, 1904 1905 fifoP->hwDep.vg96FIFOData.roomToReadPtr, 1905 1906 fifoP->hwDep.vg96FIFOData.roomToEnd)); 1906 1907 1907 1908 fifoP->hwDep.vg96FIFOData.roomToReadPtr -= fifoP->hwDep.vg96FIFOData.roomToEnd; 1908 1909 fifoP->hwDep.vg96FIFOData.roomToEnd = fifoP->hwDep.vg96FIFOData.fifoMax; 1909 1910 /* Reset fifo ptr to start */ 1910 1911 /* Reset fifo ptr to start */ 1911 1912 fifoP->hwDep.vg96FIFOData.fifoPtr = fifoP->hwDep.vg96FIFOData.fifoVirt; 1912 1913 goto again; 1913 1914 } 1914 1915 1915 1916 /* compute room left */ 1916 1917 fifoP->hwDep.vg96FIFOData.roomToEnd -= blockSize; … … 1918 1919 fifoP->hwDep.vg96FIFOData.fifoSize = MIN(fifoP->hwDep.vg96FIFOData.roomToReadPtr, 1919 1920 fifoP->hwDep.vg96FIFOData.roomToEnd) + blockSize; 1920 1921 1921 1922 GDBG_INFO((80, FN_NAME": (0x%X : 0x%X) : (0x%X : 0x%X) : 0x%X\n", 1922 1923 (FxU32)fifoP->hwDep.vg96FIFOData.fifoPtr, blockSize, … … 1931 1932 return FXTRUE; 1932 1933 #undef FN_NAME 1933 } 1934 } 1934 1935 #else /* !SST96_ALT_FIFO_WRAP */ 1935 1936 … … 1951 1952 #define FN_NAME "init96FIFOWait" 1952 1953 volatile FxU32 *pstatus; 1953 1954 1954 1955 1955 1956 /* Check for more room. */ 1956 1957 pstatus = (volatile FxU32 *) rd->hwDep.VG96RegDesc.serialStatus; 1957 1958 1958 1959 if (*pstatus & 0x80) { /* 0x80 is the FIFO threshold */ 1959 1960 int timeout; … … 1965 1966 if (*pstatus & 0x80) { 1966 1967 GDBG_INFO((80, "Lost patience in %s. Status is 0x%x\n", 1967 FN_NAME, *pstatus)); 1968 FN_NAME, *pstatus)); 1968 1969 goto again; 1969 1970 } 1970 1971 } 1971 #undef FN_NAME 1972 #undef FN_NAME 1972 1973 } /* init96FIFOWait */ 1973 1974 … … 1988 1989 #define FN_NAME "init96WrapFIFO" 1989 1990 FxBool rVal; 1990 1991 1991 1992 GDBG_INFO((80,"%s\n", FN_NAME)); 1992 1993 1993 1994 while (fifoData->hwDep.vg96FIFOData.fifoSize > 0) { 1994 1995 *fifoData->hwDep.vg96FIFOData.fifoPtr++ = 0L; 1995 1996 fifoData->hwDep.vg96FIFOData.fifoSize -= 4; 1996 1997 } 1997 1998 1998 1999 1999 2000 fifoData->hwDep.vg96FIFOData.fifoCur += 4096; 2000 2001 2001 2002 /* Wrap back to beginning? */ 2002 2003 if (fifoData->hwDep.vg96FIFOData.fifoCur >= fifoData->hwDep.vg96FIFOData.fifoMax ) { 2003 2004 static int fifowraps = 0; 2004 2005 2005 2006 fifoData->hwDep.vg96FIFOData.fifoCur = 0; 2006 2007 if ((fifowraps = (fifowraps + 1) & 0xf) == 0) { 2007 GDBG_INFO((80, "%s: Wrapping %s FIFO\n", 2008 FN_NAME, 2009 (fifoData->hwDep.vg96FIFOData.fifoLfb 2010 ? "LFB" 2008 GDBG_INFO((80, "%s: Wrapping %s FIFO\n", 2009 FN_NAME, 2010 (fifoData->hwDep.vg96FIFOData.fifoLfb 2011 ? "LFB" 2011 2012 : "Video Aperture"))); 2012 2013 } 2013 2014 2014 if (fifoData->hwDep.vg96FIFOData.fifoLfb) 2015 if (fifoData->hwDep.vg96FIFOData.fifoLfb) 2015 2016 fifoData->hwDep.vg96FIFOData.fifoPtr = fifoData->hwDep.vg96FIFOData.fifoVirt; 2016 2017 } 2017 2018 2018 2019 /* */ 2019 2020 { 2020 2021 FxU32 2021 2022 fbiJrInit5; 2022 2023 2023 2024 GDBG_INFO((125, "%s: Write = 0x%x\n", FN_NAME, 2024 2025 (FxU32) fifoData->hwDep.vg96FIFOData.fifoPtr - 2025 2026 (FxU32) fifoData->hwDep.vg96FIFOData.fifoVirt)); 2026 2027 2027 2028 fbiJrInit5 = *((volatile FxU32 *) (((FxU32) sstPtr) + (0x95 << 12))); 2028 2029 … … 2045 2046 2046 2047 GDBG_INFO((80, "%s: Got more room.\n", FN_NAME)); 2047 2048 2048 2049 /* At this point, we have atleast 1 more page of fifo. */ 2049 2050 fifoData->hwDep.vg96FIFOData.fifoSize = 4096; 2050 2051 2051 2052 rVal = FXTRUE; 2052 2053 2053 2054 GDBG_INFO((80, "%s: returning %s\n", FN_NAME, rVal ? "FXTRUE" : "FXFALSE")); 2054 2055 2055 2056 return rVal; 2056 2057 2057 2058 #undef FN_NAME 2058 2059 } /* init96WrapFIFO */ … … 2060 2061 #endif /* !SST96_ALT_FIFO_WRAP */ 2061 2062 2062 /* 2063 * This function is used only locally, so none of Chris's decorations 2063 /* 2064 * This function is used only locally, so none of Chris's decorations 2064 2065 * Load colbufSetup and auxBufSetup registers, given a InitBufDesc_t 2065 2066 */ 2066 static FxBool 2067 static FxBool 2067 2068 init96LoadBufRegs(int nBuffers, InitBufDesc_t *pBufDesc, int xRes, 2068 int yRes, InitRegisterDesc *rd) 2069 int yRes, InitRegisterDesc *rd) 2069 2070 { 2070 2071 #define FN_NAME "init96LoadBufRegs" … … 2075 2076 InitBufDesc_t *pFifo = NULL; 2076 2077 int i; 2077 2078 2078 2079 GDBG_INFO((80, "(%s) w = %d, h = %d, n = %d\n", 2079 2080 FN_NAME, xRes, yRes, nBuffers)); 2080 2081 2081 2082 if ( !sstHW ) return FXFALSE; 2082 2083 2083 2084 /* Take pBufDesc apart */ 2084 2085 while (nBuffers-- > 0) { 2085 2086 switch (pBufDesc->bufType) { 2086 2087 case INIT_BUFFER_FRONTBUFFER: 2087 GDBG_INFO((80, "%s: %s: 0x%x\n", 2088 GDBG_INFO((80, "%s: %s: 0x%x\n", 2088 2089 FN_NAME, bufTypeNames[pBufDesc->bufType], pBufDesc)); 2089 2090 pFront = pBufDesc; 2090 2091 break; 2091 2092 case INIT_BUFFER_BACKBUFFER: 2092 GDBG_INFO((80, "%s: %s: 0x%x\n", 2093 GDBG_INFO((80, "%s: %s: 0x%x\n", 2093 2094 FN_NAME, bufTypeNames[pBufDesc->bufType], pBufDesc)); 2094 2095 pBack = pBufDesc; 2095 2096 break; 2096 2097 case INIT_BUFFER_AUXBUFFER: 2097 GDBG_INFO((80, "%s: %s: 0x%x\n", 2098 GDBG_INFO((80, "%s: %s: 0x%x\n", 2098 2099 FN_NAME, bufTypeNames[pBufDesc->bufType], pBufDesc)); 2099 pAux = pBufDesc; 2100 pAux = pBufDesc; 2100 2101 break; 2101 case INIT_BUFFER_FIFOBUFFER: 2102 GDBG_INFO((80, "%s: %s: 0x%x\n", 2102 case INIT_BUFFER_FIFOBUFFER: 2103 GDBG_INFO((80, "%s: %s: 0x%x\n", 2103 2104 FN_NAME, bufTypeNames[pBufDesc->bufType], pBufDesc)); 2104 2105 pFifo = pBufDesc; 2105 2106 break; 2106 2107 case INIT_BUFFER_TRIPLEBUFFER: 2107 GDBG_INFO((80, "%s: %s: 0x%x\n", 2108 GDBG_INFO((80, "%s: %s: 0x%x\n", 2108 2109 FN_NAME, bufTypeNames[pBufDesc->bufType], pBufDesc)); 2109 2110 pTriple = pBufDesc; … … 2121 2122 GDBG_INFO((80,"pFront = %.08x, pBack = %.08x, pTriple = %.08x, pAux = %.08x, pFifo = %.08x\n", 2122 2123 pFront, pBack, pTriple, pAux, pFifo)); 2123 2124 2124 2125 if (myGetenv("SST96_FORCEALIGN")) { 2125 2126 FxU32 F, B, T, A; 2126 2127 2127 2128 sscanf(myGetenv("SST96_FORCEALIGN"), "%x,%x,%x,%x", &F, &B, &T, &A); 2128 2129 GDBG_INFO((80, "!!!!!GROSS HACK... forcing values!!!!!\n")); … … 2143 2144 if (pFifo) 2144 2145 GDBG_INFO((80,"C = %.08x, s= %6d\n", pFifo ->bufOffset, pFifo ->bufStride)); 2145 2146 2146 2147 /* Fill the arrays here */ 2147 bI[0].dfbBase = pFront->bufOffset; 2148 bI[0].dfbBase = pFront->bufOffset; 2148 2149 bI[0].dfbStride = pFront->bufStride; 2149 2150 bI[0].dfbTop = pFront->bufOffset + (yRes-1) * pFront->bufStride; 2150 2151 2151 2152 bI[1].dfbBase = pBack->bufOffset; 2152 2153 bI[1].dfbStride = pBack->bufStride; … … 2204 2205 fifoEnd = pFifo->bufOffset + pFifo->bufStride; 2205 2206 } 2206 2207 2207 2208 GDBG_INFO((80, "%s: Returning TRUE\n", FN_NAME)); 2208 2209 return FXTRUE; … … 2219 2220 success. Zero is returned of the board is not mapped. 2220 2221 XXX This should be refined in the future. XXX 2221 2222 2222 2223 Arguments: none 2223 2224 2224 2225 Return: n, where n == available VRAM in bytes on the board 2225 2226 -------------------------------------------------------------------*/ -
trunk/src/opengl/glide/sst1/init/init96/initmcrx.c
r2885 r6653 1 /* $Id: initmcrx.c,v 1.2 2001-09-05 14:31:02 bird Exp $ */ 1 2 /* 2 3 ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY 3 4 ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT 4 5 ** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX 5 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 6 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 7 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 6 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 7 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 8 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 8 9 ** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A 9 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 10 ** 10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 11 ** 11 12 ** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO 12 13 ** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN … … 14 15 ** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR 15 16 ** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF 16 ** THE UNITED STATES. 17 ** 17 ** THE UNITED STATES. 18 ** 18 19 ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED 19 20 ** 20 21 ** 21 ** $Revision: 1. 1 $22 ** $Date: 200 0-02-25 00:31:31 $22 ** $Revision: 1.2 $ 23 ** $Date: 2001-09-05 14:31:02 $ 23 24 ** 24 25 */ 25 static char revString[] = "@#%$Workfile: initmcrx.c $ $Revision: 1. 1$";26 static char revString[] = "@#%$Workfile: initmcrx.c $ $Revision: 1.2 $"; 26 27 27 28 #include <3dfx.h> … … 85 86 Library: Init Code for MCRX 86 87 Description: 87 88 88 89 Arguments: 89 90 90 91 Return: 91 92 address of mcrxHALData … … 106 107 Initialize rd pointers to access apertures 107 108 Arguments: 108 109 109 110 Return: 110 111 -------------------------------------------------------------------*/ … … 121 122 0x2000000 - 0x20000); 122 123 123 GDBG_INFO((80, "%s: Setting partnerRegPtr to 0x%x\n", 124 GDBG_INFO((80, "%s: Setting partnerRegPtr to 0x%x\n", 124 125 FN_NAME, rd->hwDep.VG96RegDesc.partnerRegPtr)); 125 126 126 127 #if 1 127 128 rd->hwDep.VG96RegDesc.serialStatus = (FxU32 *) … … 137 138 rd->hwDep.VG96RegDesc.fifoApertureBase = 138 139 (FxU32 *) (((FxU32)rd->hwDep.VG96RegDesc.baseAddress) + 0x400000); 139 140 140 141 GDBG_INFO((80, "%s: returning TRUE\n", FN_NAME)); 141 142 142 143 return rVal; 143 144 … … 146 147 147 148 /* FIXME !! jdt - need to add more resolutions to dos */ 148 INITMCRXENTRY(initMCRXSetVideo, FxBool, (GrScreenResolution_t res, GrScreenRefresh_t refresh, FxU32 *xr, FxU32 *yr )) 149 INITMCRXENTRY(initMCRXSetVideo, FxBool, (GrScreenResolution_t res, GrScreenRefresh_t refresh, FxU32 *xr, FxU32 *yr )) 149 150 { 150 151 #define FN_NAME "initMCRXSetVideo" 151 152 FxBool rv = FXTRUE; 152 #if defined(INIT_ACCESS_DIRECT) && defined( __DOS32__ ) 153 #if defined(INIT_ACCESS_DIRECT) && defined( __DOS32__ ) 153 154 union REGS r0, r1; 154 155 #endif 155 156 156 157 GDBG_INFO((80, "%s: \n", FN_NAME)); 157 158 158 #if defined(INIT_ACCESS_DIRECT) && defined( __DOS32__ ) 159 #if defined(INIT_ACCESS_DIRECT) && defined( __DOS32__ ) 159 160 switch( res ) { 160 161 case GR_RESOLUTION_320x200: … … 215 216 216 217 #endif 217 GDBG_INFO((80, "%s: returning %s\n", FN_NAME, rv?"TRUE":"FALSE")); 218 GDBG_INFO((80, "%s: returning %s\n", FN_NAME, rv?"TRUE":"FALSE")); 218 219 return rv; 219 #undef FN_NAME 220 #undef FN_NAME 220 221 } /* initMCRXSetVideo */ 221 222 … … 228 229 229 230 Do all setup necessary to enable direct writes to JR Space 230 231 231 232 Arguments: 232 233 rd - pointer to register description 233 234 234 235 Return: 235 236 True if success, False if Failure 236 237 -------------------------------------------------------------------*/ 237 INITMCRXENTRY(initMCRXEnableRegs, FxBool, (InitRegisterDesc *rd)) 238 INITMCRXENTRY(initMCRXEnableRegs, FxBool, (InitRegisterDesc *rd)) 238 239 { 239 240 #define FN_NAME "initMCRXEnableRegs" 240 FxU32 241 FxU32 241 242 tmp; 242 243 FxU8 … … 256 257 GDBG_INFO((80, "%s: Save Extended Registers Protection State\n", 257 258 FN_NAME)); 258 259 259 260 OUTP(0x3d4, 0x19); 260 261 INP(0x3d5, protState); … … 273 274 OUTP(0x3C4, 0x1B); 274 275 INP(0x3C5, rd->hwDep.VG96RegDesc.mclockLo); 275 GDBG_INFO((80, "%s: mclock registers: (0x%X : 0x%X)\n", FN_NAME, 276 GDBG_INFO((80, "%s: mclock registers: (0x%X : 0x%X)\n", FN_NAME, 276 277 (FxU32)rd->hwDep.VG96RegDesc.mclockHi, (FxU32)rd->hwDep.VG96RegDesc.mclockHi)); 277 278 278 279 GDBG_INFO((80, "%s: Enabling FBI Jr.\n", FN_NAME)); 279 280 OUTPW(0x3C4, 0x001F); … … 311 312 312 313 /* FIXME!!! jdt - puma/ram timing fixes need to go here */ 313 INITMCRXENTRY(initMCRXDisableRegs,FxBool,(InitRegisterDesc *rd)) 314 INITMCRXENTRY(initMCRXDisableRegs,FxBool,(InitRegisterDesc *rd)) 314 315 { 315 316 #define FN_NAME "initMCRXDisableRegs" 316 317 FxU8 317 318 seqSave, crtcSave; 318 319 319 320 FxU16 320 321 protState; … … 349 350 CRTC_GET(0x28, tmp); 350 351 GDBG_INFO((80, "%s: crtc 0x28: 0x%X\n", FN_NAME, tmp)); 351 tmp &= ~1; 352 tmp &= ~1; 352 353 CRTC_SET(0x28, tmp); 353 354 … … 358 359 { 359 360 FxU16 tempMclock; 360 361 361 362 GDBG_INFO((80, "%s: Restoring mclock\n", FN_NAME)); 362 363 tempMclock = (0x1A | (rd->hwDep.VG96RegDesc.mclockHi << 8)); 363 364 OUTPW(0x3C4, tempMclock); 364 365 365 366 tempMclock = (0x1B | (rd->hwDep.VG96RegDesc.mclockLo << 8)); 366 367 OUTPW(0x3C4, tempMclock); … … 370 371 OUTPW(0x3C4, 0x001C); 371 372 } 372 373 373 374 GDBG_INFO((80, "%s: Restoring Protection\n", FN_NAME)); 374 375 OUTPW(0x3df, protState); … … 381 382 382 383 return FXTRUE; 383 384 384 385 #undef FN_NAME 385 386 } /* initMCRXDisableRegs */ … … 391 392 Library: Init Code for MCRX 392 393 Description: 393 394 394 395 Arguments: 395 396 396 397 Return: 397 398 -------------------------------------------------------------------*/ … … 408 409 { 0x0d, 0x0c, 0x21 }, 409 410 { 0x71, 0x72, 0x73 }, 410 /* chd - Fixme! 411 /* chd - Fixme! 411 412 * Bogus numbers. Does triple buffering work on Macronix? 412 * 413 * dpc - 23 jan 1998 - 413 * 414 * dpc - 23 jan 1998 - 414 415 * Donny just told me this so hopefully this will work. 415 416 */ … … 438 439 const FxU8 maxBufferBits = (((crtcSwapControl & 0x08) == 0) ? 1 : 2); 439 440 440 crtcSwapStatus = ((crtcSwapStatus & ~0x03) | 441 crtcSwapStatus = ((crtcSwapStatus & ~0x03) | 441 442 ((bufferBits == maxBufferBits) ? 0x00 : bufferBits + 1)); 442 443 CRTC_SET(0x7A, crtcSwapStatus); 443 444 } 444 445 445 446 /* We have no way of knowing that this worked so of course we always 446 447 * return success. … … 456 457 Library: Init Code for MCRX 457 458 Description: 458 459 459 460 Arguments: 460 461 atmm: Pointer to base of MCRX … … 472 473 FxU32 nBuffers, 473 474 FxU32 strideInBytes, 474 FxU32 Width, FxU32 Height, FxU32 PageFlipping)) 475 FxU32 Width, FxU32 Height, FxU32 PageFlipping)) 475 476 #else 476 477 INITMCRXENTRY(initMCRXUseTiles, int, (InitRegisterDesc *rd, … … 478 479 FxU32 nBuffers, 479 480 FxU32 strideInBytes, 480 FxU32 Width, FxU32 Height)) 481 FxU32 Width, FxU32 Height)) 481 482 #endif 482 483 { … … 496 497 497 498 const char *envVal; 498 499 499 500 GDBG_INFO((80, "%s:\n", FN_NAME)); 500 501 … … 538 539 * If we are triple buffering we need to enable this on the actual 539 540 * macronix part as well. This is set by enabling bit 3 of the crtc 540 * register. 541 * register. 541 542 */ 542 543 if (nBuffers == 3) tmp |= 0x08; 543 544 mcrxHALData.initSwapTiles = initMCRXSwapTiles; 544 545 545 if (envVal = myGetenv("MRCX_71")) 546 if (envVal = myGetenv("MRCX_71")) 546 547 sscanf(envVal, "%x", &tmp); 547 548 CRTC_SET(0x70, tmp); … … 562 563 #undef FN_NAME 563 564 } /* initMCRXUseTiles */ 564 565 565 566 566 567 /*------------------------------------------------------------------- … … 572 573 573 574 get information about MCRX 574 575 575 576 Arguments: 576 577 info - pointer to info struct 577 578 578 579 Return: 579 580 True if success, False if Failure 580 581 -------------------------------------------------------------------*/ 581 INITMCRXENTRY(initMCRXGetInfo,FxBool,(VG96Info *info)) 582 INITMCRXENTRY(initMCRXGetInfo,FxBool,(VG96Info *info)) 582 583 { 583 584 #define FN_NAME "initMCRXGetInfo" … … 594 595 /* Watcom warning suppression */ 595 596 revString[0] = revString[0]; 596 597 597 598 info->vgaChip = 0; 598 599 info->vg96Rev = 0; … … 600 601 info->tfxRev = 1; 601 602 info->tfxRam = 2; 602 603 603 604 info->vg96Ram = (0x100000 << mBytesPow); 604 605 605 606 GDBG_INFO((80, "%s: frame buffer has 0x%x bytes\n", FN_NAME, info->vg96Ram)); 606 607 607 608 return FXTRUE; 608 609 609 610 #undef FN_NAME 610 611 } /* initMCRXGetInfo */ -
trunk/src/opengl/glide/sst1/init/init96/lindrvr.c
r2885 r6653 1 /* $Id: lindrvr.c,v 1.2 2001-09-05 14:31:03 bird Exp $ */ 1 2 /* 2 3 ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY 3 4 ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT 4 5 ** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX 5 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 6 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 7 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 6 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 7 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 8 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 8 9 ** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A 9 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 10 ** 10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 11 ** 11 12 ** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO 12 13 ** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN … … 14 15 ** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR 15 16 ** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF 16 ** THE UNITED STATES. 17 ** 17 ** THE UNITED STATES. 18 ** 18 19 ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED 19 20 ** … … 58 59 59 60 #ifndef DUMMY 60 static Display *dpy= 0;61 static int 62 static int 63 static void* 64 static int 65 static GC xgc= 0;61 static Display *dpy = 0; 62 static int screenNum = 0; 63 static int screenWidth = 0; 64 static void* screenPhys = 0; 65 static int screenMem = 0; 66 static GC xgc = 0; 66 67 static Window hWndApp = 0; 67 static FxU32 Width = 0; 68 static FxU32 Width = 0; 68 69 static FxU32 Height = 0; 69 70 static FxBool IsFullScreen = 0; … … 155 156 screenNum=XDefaultScreen(dpy); 156 157 XF86DGAGetVideoLL(dpy, screenNum, (int*)&screenPhys, &screenWidth, &banksize, 157 158 &screenMem); 158 159 screenMem*=1024; 159 160 return FXTRUE; … … 168 169 } 169 170 170 static int 171 static int 171 172 cvtXToGlideDesc(InitBufDesc_t *pDesc) { 172 173 InitBufDesc_t *dFront = &pDesc[0]; … … 200 201 return ErrorMessage(hWndApp, "Couldn't get Backbuffer Info"); 201 202 dBack->bufOffset -= dScreen->bufOffset; 202 203 203 204 /* Get info about aux buffer (pixmap) */ 204 205 dAux->bufType = INIT_BUFFER_AUXBUFFER; 205 if (!cvtAddrToBufDesc(addrAux, dAux)) 206 if (!cvtAddrToBufDesc(addrAux, dAux)) 206 207 return ErrorMessage(hWndApp, "Couldn't get AuxBuffer Info"); 207 208 dAux->bufOffset -= dScreen->bufOffset; 208 209 209 210 /* Get info about triple buffer (pixmap if used) */ 210 211 if (tripleBuffering) { … … 219 220 dFifo->bufOffset = (int)addrFifo-dScreen->bufOffset; 220 221 dFifo->bufStride = FIFOSIZE; 221 222 222 223 GDBG_INFO((80, "cvtXToGlideDesc: dFront->bufOffset = 0x%x\n", dFront->bufOffset)); 223 224 GDBG_INFO((80, "cvtXToGlideDesc: dBack->bufOffset = 0x%x\n", dBack->bufOffset)); … … 269 270 270 271 static int 271 doAllocPixmaps(int xRes, int yRes, int vRefresh, 272 273 GDBG_INFO((80, "doAllocPixmaps: hWnd = %x, fs=%d, xRes=%d, yRes=%d, vRefresh=%d\n", 272 doAllocPixmaps(int xRes, int yRes, int vRefresh, 273 InitBufDesc_t *pDesc) { 274 GDBG_INFO((80, "doAllocPixmaps: hWnd = %x, fs=%d, xRes=%d, yRes=%d, vRefresh=%d\n", 274 275 hWndApp, IsFullScreen, xRes, yRes, vRefresh)); 275 276 … … 277 278 278 279 pixFifo=XCreatePixmap(dpy, hWndApp, screenWidth, 279 280 (FIFOSIZE/2+4096+screenWidth-1)/screenWidth, 16); 280 281 if ((XF86RushLockPixmap(dpy, screenNum, pixFifo, &addrFifo)==FXFALSE) 281 282 || !addrFifo) { … … 289 290 pixBack=XCreatePixmap(dpy, hWndApp, xRes, yRes, 16); 290 291 if ((XF86RushLockPixmap(dpy, screenNum, pixBack, 291 292 &addrBack)==FXFALSE) || !addrBack) { 292 293 doReleasePixmaps(); 293 294 return ErrorMessage(hWndApp, "Failed to lock back pixmap\n"); … … 295 296 pixAux=XCreatePixmap(dpy, hWndApp, xRes, yRes, 16); 296 297 if ((XF86RushLockPixmap(dpy, screenNum, pixAux, 297 298 &addrAux)==FXFALSE) || !addrAux) { 298 299 doReleasePixmaps(); 299 300 return ErrorMessage(hWndApp, "Failed to lock aux pixmap\n"); … … 302 303 pixTriple=XCreatePixmap(dpy, hWndApp, xRes, yRes, 16); 303 304 if ((XF86RushLockPixmap(dpy, screenNum, pixTriple, 304 305 &addrTriple)==FXFALSE) || !addrTriple) { 305 306 doReleasePixmaps(); 306 307 return ErrorMessage(hWndApp, "Failed to lock triple pixmap\n"); … … 311 312 } 312 313 313 static FxBool 314 static FxBool 314 315 getWindowSize(int *width, int *height) { 315 316 XWindowAttributes attr; … … 351 352 352 353 /* 353 * Get ourselves a valid window handle 354 * Get ourselves a valid window handle 354 355 */ 355 356 hWndApp = (Window)hWindow; … … 374 375 375 376 if ((sRes < GR_RESOLUTION_320x200) || 376 (sRes > GR_RESOLUTION_512x256)) 377 (sRes > GR_RESOLUTION_512x256)) 377 378 return ErrorMessage(hWndApp, "Bad Fullscreen resolution"); 378 379 … … 389 390 return ErrorMessage(hWndApp, "Screen depth must be 16\n"); 390 391 if (XF86DGAQueryDirectVideo(dpy, DefaultScreen(dpy), &flags)==False || 391 392 !flags) { 392 393 GDBG_INFO((0, "Could query Direct Video")); 393 394 return ErrorMessage(hWndApp, "Direct video not supported\n"); 394 395 } 395 396 if (XF86VidModeGetAllModeLines(dpy, DefaultScreen(dpy), &numModes, 396 397 &vidModes)==False) { 397 398 return ErrorMessage(hWndApp, "Couldn't query vidmode list\n"); 398 399 return 1; … … 400 401 for (i=0; i<numModes; i++) 401 402 if ((vidModes[i]->hdisplay==Width) && (vidModes[i]->vdisplay==Height)) 402 403 break; 403 404 if (i==numModes) { 404 405 return ErrorMessage(hWndApp, "Server doesn't support requested resolution\n"); 405 406 if (vidModes) { 406 407 407 XFree(vidModes); 408 vidModes=0; 408 409 } 409 410 return 1; … … 429 430 GDBG_INFO((80, "\tbufType = 0x%x\n", pBufDesc[i].bufType)); 430 431 GDBG_INFO((80, "\tbufOffset = 0x%x\n", pBufDesc[i].bufOffset)); 431 GDBG_INFO((80, "\tbufStride = 0x%x\n", pBufDesc[i].bufStride)); 432 GDBG_INFO((80, "\tbufStride = 0x%x\n", pBufDesc[i].bufStride)); 432 433 GDBG_INFO((80, "\tbufBPP = 0x%x\n", pBufDesc[i].bufBPP)); 433 434 } … … 450 451 451 452 if ( curHALData->initSetVideo ) { 452 curHALData->initSetVideo( sRes, vRefresh, 453 curHALData->initSetVideo( sRes, vRefresh, 453 454 (FxU32*)width, (FxU32*)height ); 454 455 } … … 463 464 { 464 465 int i, w, h; 465 466 466 467 GDBG_INFO((80, "linControl: code = %d\n", code)); 467 468 … … 472 473 getWindowSize(&w, &h); 473 474 if ((Width != w) || (Height != h)) { 474 GDBG_INFO((120, "W and H changed to %d %d\n", 475 Width, Height)); 475 GDBG_INFO((120, "W and H changed to %d %d\n", 476 Width, Height)); 476 477 477 478 if (!doAllocPixmaps(w, h, 0, BufDesc)) { 478 479 480 481 482 483 479 w=Width; 480 h=Height; 481 if (!doAllocPixmaps(w, h, 0, BufDesc)) { 482 /* ErrorMessage(hWndApp, "linControl: Resize failed\n"); */ 483 return FXFALSE; 484 } 484 485 } 485 486 Width = w; … … 512 513 GDBG_INFO((80, "linControl: code = %d, w = %d, h = %d\n", code, 513 514 Width, Height)); 514 515 515 516 return FXTRUE; 516 517 } /* linControl */ -
trunk/src/opengl/glide/sst1/init/initvg/dac.c
r2885 r6653 1 /* $Id: dac.c,v 1.2 2001-09-05 14:31:03 bird Exp $ */ 1 2 /* 2 3 ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY 3 4 ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT 4 5 ** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX 5 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 6 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 7 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 6 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 7 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 8 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 8 9 ** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A 9 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 10 ** 10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 11 ** 11 12 ** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO 12 13 ** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN … … 14 15 ** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR 15 16 ** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF 16 ** THE UNITED STATES. 17 ** 17 ** THE UNITED STATES. 18 ** 18 19 ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED 19 20 ** 20 21 ** 21 ** $Revision: 1. 1 $22 ** $Date: 200 0-02-25 00:31:32 $22 ** $Revision: 1.2 $ 23 ** $Date: 2001-09-05 14:31:03 $ 23 24 ** 24 25 ** Initialization code for initializing supported SST-1 DACs … … 39 40 ** Read external DAC registers 40 41 ** NOTE: The video unit of FBI must be in reset before calling this routine. 41 ** The rendering engines of FBI and TREX must be idle before calling 42 ** The rendering engines of FBI and TREX must be idle before calling 42 43 ** this routine. 43 44 ** fbiInit23 register remapping (PCI config. initEnable[2]=1) must be … … 72 73 ** Write to external DAC registers 73 74 ** NOTE: The video unit of FBI must be in reset before calling this routine. 74 ** The rendering engines of FBI and TREX must be idle before calling 75 ** The rendering engines of FBI and TREX must be idle before calling 75 76 ** this routine. 76 77 ** … … 591 592 { 592 593 float calc; 593 594 594 595 calc = ((float) 14.318 * (float) (m + 2)) / 595 596 ((float) (n + 2) * vcoFreqDivide); -
trunk/src/opengl/glide/sst1/init/initvg/gamma.c
r2885 r6653 1 /* $Id: gamma.c,v 1.2 2001-09-05 14:31:04 bird Exp $ */ 1 2 /* 2 3 ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY 3 4 ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT 4 5 ** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX 5 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 6 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 7 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 6 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 7 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 8 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 8 9 ** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A 9 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 10 ** 10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 11 ** 11 12 ** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO 12 13 ** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN … … 14 15 ** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR 15 16 ** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF 16 ** THE UNITED STATES. 17 ** 17 ** THE UNITED STATES. 18 ** 18 19 ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED 19 20 ** 20 21 ** 21 ** $Revision: 1. 1 $22 ** $Date: 200 0-02-25 00:31:33 $22 ** $Revision: 1.2 $ 23 ** $Date: 2001-09-05 14:31:04 $ 23 24 ** 24 25 ** Initialization code for loading SST-1 gamma tables … … 132 133 else 133 134 sstVideoIsReset = FXFALSE; 134 135 135 136 ISET(sst->fbiInit1, IGET(sst->fbiInit1) & ~SST_VIDEO_RESET); 136 137 /* wait for video reset to be deasserted */ … … 147 148 FxU32 gcG = gammaTableG[(x<<3)]; 148 149 FxU32 gcB = gammaTableB[(x<<3)]; 149 ISET(sst->clutData, ((x<<SST_CLUTDATA_INDEX_SHIFT) | 150 ISET(sst->clutData, ((x<<SST_CLUTDATA_INDEX_SHIFT) | 150 151 (gcR<<SST_CLUTDATA_RED_SHIFT) | 151 152 (gcG<<SST_CLUTDATA_GREEN_SHIFT) | … … 173 174 } 174 175 175 FX_EXPORT FxBool FX_CSTYLE sst1InitGammaTable(FxU32 *sstbase, FxU32 nentries, 176 FX_EXPORT FxBool FX_CSTYLE sst1InitGammaTable(FxU32 *sstbase, FxU32 nentries, 176 177 FxU32 *r, FxU32 *g, FxU32 *b) 177 178 { … … 213 214 else 214 215 sstVideoIsReset = FXFALSE; 215 216 216 217 ISET(sst->fbiInit1, IGET(sst->fbiInit1) & ~SST_VIDEO_RESET); 217 218 /* wait for video reset to be deasserted */ … … 228 229 FxU32 gcG = gammaTableG[(x<<3)]; 229 230 FxU32 gcB = gammaTableB[(x<<3)]; 230 ISET(sst->clutData, ((x<<SST_CLUTDATA_INDEX_SHIFT) | 231 ISET(sst->clutData, ((x<<SST_CLUTDATA_INDEX_SHIFT) | 231 232 (gcR<<SST_CLUTDATA_RED_SHIFT) | 232 233 (gcG<<SST_CLUTDATA_GREEN_SHIFT) | -
trunk/src/opengl/glide/sst1/init/initvg/gdebug.c
r2885 r6653 1 /* $Id: gdebug.c,v 1.2 2001-09-05 14:31:04 bird Exp $ */ 1 2 /* 2 3 ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY 3 4 ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT 4 5 ** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX 5 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 6 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 7 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 6 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 7 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 8 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 8 9 ** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A 9 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 10 ** 10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 11 ** 11 12 ** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO 12 13 ** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN … … 14 15 ** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR 15 16 ** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF 16 ** THE UNITED STATES. 17 ** 17 ** THE UNITED STATES. 18 ** 18 19 ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED 19 20 ** 20 ** $Revision: 1. 1$21 ** $Date: 200 0-02-25 00:31:33$21 ** $Revision: 1.2 $ 22 ** $Date: 2001-09-05 14:31:04 $ 22 23 */ 23 24 … … 104 105 /* I can't init gdbg_msgfile to stdout since it isn't constant so 105 106 * I do it now */ 106 gdbg_msgfile = stdout; 107 gdbg_msgfile = stdout; 107 108 108 109 done = 1; … … 132 133 gdbg_vprintf (const char *format,va_list args) 133 134 { 134 135 135 136 if (gdbg_msgfile != NULL) { 136 137 if (!UseDebugString) { … … 138 139 vfprintf(gdbg_msgfile,format,args); 139 140 140 fflush(gdbg_msgfile); 141 } 141 fflush(gdbg_msgfile); 142 } 142 143 #ifdef __WIN32__ 143 144 else { … … 262 263 if (outf) gdbg_msgfile = outf; 263 264 return outf != NULL; 264 } 265 } 265 } 266 } -
trunk/src/opengl/glide/sst1/init/initvg/info.c
r2885 r6653 1 /* $Id: info.c,v 1.2 2001-09-05 14:31:04 bird Exp $ */ 1 2 /* 2 3 ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY 3 4 ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT 4 5 ** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX 5 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 6 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 7 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 6 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 7 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 8 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 8 9 ** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A 9 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 10 ** 10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 11 ** 11 12 ** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO 12 13 ** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN … … 14 15 ** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR 15 16 ** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF 16 ** THE UNITED STATES. 17 ** 17 ** THE UNITED STATES. 18 ** 18 19 ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED 19 20 ** 20 21 ** 21 ** $Revision: 1. 1 $22 ** $Date: 200 0-02-25 00:31:33 $22 ** $Revision: 1.2 $ 23 ** $Date: 2001-09-05 14:31:04 $ 23 24 ** 24 25 ** Routines to detect memory size, strapping pin, and other initialization … … 37 38 #define XY_ONE (1<<SST_XY_FRACBITS) 38 39 39 static FxBool 40 readAndSum4x4(FxU32 *sstbase, FxU32 x, FxU32 y, 41 40 static FxBool 41 readAndSum4x4(FxU32 *sstbase, FxU32 x, FxU32 y, 42 FxU32 *r_sum, FxU32 *g_sum, FxU32 *b_sum) 42 43 { 43 44 FxU32 rd_x, rd_y; … … 50 51 sst1InitIdle(sstbase); 51 52 if (x & 1) { 52 53 53 INIT_PRINTF(("ERROR: readAndSum4x4 must have an even X (%d)\n", x)); 54 return(FXFALSE); 54 55 } 55 56 … … 59 60 *b_sum = 0; 60 61 61 for (rd_y = 0; rd_y < 4; rd_y++) { 62 63 if ((rd_x & 1)==0) {/* read 2 pixels at a time */64 65 66 67 68 69 70 71 72 73 74 75 76 62 for (rd_y = 0; rd_y < 4; rd_y++) { /* read 4 scanlines */ 63 for (rd_x = 0; rd_x < 4; rd_x ++) { 64 if ((rd_x & 1)==0) { /* read 2 pixels at a time */ 65 rd_col = 66 IGET(sstbase[(SST_LFB_ADDR + (y+rd_y)*2048 + (x+rd_x)*2) >> 2]); 67 } 68 else rd_col >>= 16; 69 rd_r = ((rd_col >> 11) & 0x1f) << 3; 70 rd_g = ((rd_col >> 5) & 0x3f) << 2; 71 rd_b = ((rd_col >> 0) & 0x1f) << 3; 72 *r_sum += rd_r; 73 *g_sum += rd_g; 74 *b_sum += rd_b; 75 INIT_INFO((4,"%d,%d = rd_col: 0x%04x rgb: %02x %02x %02x\n", 76 rd_x, rd_y, (rd_col & 0xffff), rd_r, rd_g, rd_b)); 77 } 77 78 } 78 79 INIT_INFO((3,"sums: r_sum=0x%03x g_sum=0x%03x b_sum=0x%03x\n", 79 80 80 *r_sum, *g_sum, *b_sum)); 81 return(FXTRUE); 81 82 } 82 83 … … 117 118 /* init sum array */ 118 119 for (r_sum = 0; r_sum <= 0xfff; r_sum++) { 119 120 120 rb_tbl[r_sum] = -1; 121 g_tbl[r_sum] = -1; 121 122 } 122 123 … … 126 127 /* fill sum array */ 127 128 for (tst_color = 0; tst_color <= 255; tst_color++) { 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 } 151 129 INIT_INFO((2,"tst_color=0x%02x\n", tst_color)); 130 ISET(sst->c1, (tst_color << 16) | (tst_color << 8) | tst_color); 131 132 drawTriangle(sst, x,y,36); 133 if(readAndSum4x4(sstbase, x,y, &r_sum,&g_sum,&b_sum) == FXFALSE) 134 return(FXFALSE); 135 136 /* check sums for uniqueness and then store away */ 137 if (r_sum != b_sum) { 138 INIT_PRINTF(("ERROR: b_sum=0x%03x r_sum=0x%03x\n", r_sum, b_sum)); 139 return(FXFALSE); 140 } 141 if (rb_tbl[r_sum] != -1) { 142 INIT_PRINTF(("ERROR: non-unique r/b_sum=0x%03x\n", r_sum)); 143 return(FXFALSE); 144 } 145 rb_tbl[r_sum] = tst_color; 146 if (g_tbl[g_sum] != -1) { 147 INIT_PRINTF(("ERROR: non-unique g_sum=0x%03x\n", g_sum)); 148 return(FXFALSE); 149 } 150 g_tbl[g_sum] = tst_color; 151 } 152 return(FXTRUE); 152 153 } 153 154 … … 158 159 if (rb_tbl[r_sum] == -1 || g_tbl[g_sum] == -1 || rb_tbl[b_sum] == -1) 159 160 { 160 161 161 INIT_PRINTF(("ERROR: unDither: invalid color sum\n")); 162 return(FXFALSE); 162 163 } 163 164 *result = (rb_tbl[r_sum] << 16) | (g_tbl[g_sum] << 8) | rb_tbl[b_sum]; 164 165 return(FXTRUE); 165 166 } 166 167 … … 179 180 /* render into the frame buffer */ 180 181 ISET(sst->fbzColorPath, 181 182 SST_RGBSEL_TREXOUT | SST_CC_PASS | SST_ENTEXTUREMAP); 182 183 ISET(sst->texBaseAddr, 0); 183 184 ISET(sst->textureMode, SST_AI88 | SST_TC_PASS | SST_TCA_PASS); … … 187 188 readAndSum4x4(sstbase, x,y, &r_sum,&g_sum,&b_sum); 188 189 if(unDither(r_sum,g_sum,b_sum,&info->tmuConfig) == FXFALSE) 189 190 190 return(FXFALSE); 191 if(GETENV(("SST_TMUCFG"))) 191 192 SSCANF(GETENV(("SST_TMUCFG")), "%i", &info->tmuConfig); 192 193 … … 196 197 ISET(SST_TREX(sst,2)->trexInit1, info->tmuInit1[2]); 197 198 198 199 return(FXTRUE); 199 200 } 200 201 … … 204 205 205 206 static FxU32 sense(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu, 206 207 FxU32 mem, FxU32 init) 207 208 { 208 209 volatile Sstregs *sst = (Sstregs *) sstbase; … … 214 215 sst1InitIdle(sstbase); 215 216 216 ISET(sst->texBaseAddr, 0x200000>>3); 217 texAddr[0] = SENSE2; 218 ISET(sst->texBaseAddr, 0x100000>>3); 219 texAddr[0] = SENSE1; 220 ISET(sst->texBaseAddr, 0x000000>>3); 221 texAddr[0] = SENSE0; 222 223 ISET(sst->texBaseAddr, mem>>3); 224 drawTriangle(sst,0,0,4); 217 ISET(sst->texBaseAddr, 0x200000>>3); /* set to 2 MB */ 218 texAddr[0] = SENSE2; /* write a random value */ 219 ISET(sst->texBaseAddr, 0x100000>>3); /* set to 1 MB */ 220 texAddr[0] = SENSE1; /* write a random value */ 221 ISET(sst->texBaseAddr, 0x000000>>3); /* set to 0 MB */ 222 texAddr[0] = SENSE0; /* write a random value */ 223 224 ISET(sst->texBaseAddr, mem>>3); /* reset to 2 MB */ 225 drawTriangle(sst,0,0,4); /* draw a 4x4 right triangle */ 225 226 sst1InitIdle(sstbase); 226 227 … … 237 238 FX_EXPORT FxBool FX_CSTYLE 238 239 sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu, 239 240 FxU32 *TmuMemorySize) 240 241 { 241 242 FxU32 i,data; … … 244 245 INIT_INFO((1,"sst1InitGetTmuMemory(0x%x, , %d)\n", sstbase,tmu)); 245 246 246 247 248 249 247 if(GETENV(("SST_TMUMEM_SIZE"))) { 248 *TmuMemorySize = ATOI(GETENV(("SST_TMUMEM_SIZE"))); 249 return(FXTRUE); 250 } 250 251 251 252 ISET(sst->lfbMode, SST_LFB_RGBALANES_ARGB | SST_LFB_READFRONTBUFFER); 252 253 ISET(sst->fbzMode, SST_DRAWBUFFER_FRONT | SST_RGBWRMASK); 253 254 ISET(sst->fbzColorPath, 254 255 SST_RGBSEL_TREXOUT | SST_CC_PASS | SST_ENTEXTUREMAP); 255 256 ISET(sst->textureMode, SST_RGB565 | SST_TC_REPLACE | SST_TCA_REPLACE); 256 257 ISET(sst->tLOD, 0); … … 258 259 /* setup all downstream TMUs to be in pass-thru mode */ 259 260 for (i=0; i<tmu; i++) 260 261 ISET(SST_TREX(sst,i)->textureMode, SST_TC_PASS | SST_TCA_PASS); 261 262 262 263 /* first see if we have 4 Mbytes by writing a texel at 2MB followed by … … 278 279 279 280 INIT_PRINTF(("sst1InitGetTmuMemory() ERROR: Could not detect memory size.\n")); 280 281 return(FXFALSE); 281 282 } 282 283 283 284 /*--------------------------------------------------------------------------- 284 285 NOTES: 285 286 286 assumes that board and registers are initialized 287 destroys part of the framebuffer 287 288 ---------------------------------------------------------------------------*/ 288 289 FX_EXPORT FxBool FX_CSTYLE … … 292 293 293 294 if(initSumTables(sstbase) == FXFALSE) 294 295 return(FXFALSE); 295 296 if(getTmuConfigData(sstbase,info) == FXFALSE) 296 297 298 299 300 301 302 297 return(FXFALSE); 298 299 /* TMU memory speed */ 300 /* tmuClkFixed is no longer used... */ 301 info->tmuClkFixed = 0x0; 302 /* tmuMemSpeed is legacy, and is not used by either Obsidian GE or Pro Fab */ 303 info->tmuMemSpeed = 0; 303 304 304 305 /* count the TMUs and verify that all TMUs are the same revision */ … … 306 307 info->numberTmus = 1; 307 308 if(sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]) == FXFALSE) 308 309 return(FXFALSE); 309 310 INIT_INFO((1,"TMU0 memory = %d MB\n", info->tmuMemSize[0])); 310 if (info->tmuConfig & FXBIT(6)) { 311 info->numberTmus++;/* increment TMU count */312 trev = (info->tmuConfig>>7) & 0x7;/* get its revision */313 314 315 316 311 if (info->tmuConfig & FXBIT(6)) { /* if TMU 1 exists */ 312 info->numberTmus++; /* increment TMU count */ 313 trev = (info->tmuConfig>>7) & 0x7; /* get its revision */ 314 if (info->tmuRevision != trev) { 315 INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n")); 316 return(FXFALSE); 317 } 317 318 if(sst1InitGetTmuMemory(sstbase, info, 1, &info->tmuMemSize[1]) == FXFALSE) 318 319 } 320 if (info->tmuConfig & FXBIT(13)) { 321 info->numberTmus++;/* increment TMU count */322 trev = (info->tmuConfig>>14) & 0x7;/* get its revision */323 324 325 326 319 return(FXFALSE); 320 } 321 if (info->tmuConfig & FXBIT(13)) { /* if TMU 2 exists */ 322 info->numberTmus++; /* increment TMU count */ 323 trev = (info->tmuConfig>>14) & 0x7; /* get its revision */ 324 if (info->tmuRevision != trev) { 325 INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n")); 326 return(FXFALSE); 327 } 327 328 if(sst1InitGetTmuMemory(sstbase, info, 2, &info->tmuMemSize[2]) == FXFALSE) 328 329 return(FXFALSE); 329 330 } 330 331 INIT_INFO((1,"numberTMus = %d\n", info->numberTmus)); … … 339 340 ** 340 341 */ 341 #define LFB_PUTPIXEL(X, Y, DATA) 342 343 #define LFB_GETPIXEL(X, Y) 344 342 #define LFB_PUTPIXEL(X, Y, DATA) \ 343 ISET(lfbptr[((SST_LFB_ADDR+(X<<1)+(Y<<11))>>1)], DATA) 344 #define LFB_GETPIXEL(X, Y) \ 345 IGET(lfbptr[((SST_LFB_ADDR+(X<<1)+(Y<<11))>>1)]) 345 346 346 347 static int fbiMemSize(FxU32 *sstbase) 347 348 { 348 349 350 351 352 353 354 355 356 357 358 359 360 349 volatile Sstregs *sst = (Sstregs *) sstbase; 350 volatile unsigned short *lfbptr = (unsigned short *) sstbase; 351 FxU32 init0Save = IGET(sst->fbiInit0); 352 FxU32 init1Save = IGET(sst->fbiInit1); 353 FxU32 init2Save = IGET(sst->fbiInit2); 354 int retval = 0; 355 356 if(GETENV(("SST_FBIMEM_SIZE"))) 357 return(ATOI(GETENV(("SST_FBIMEM_SIZE")))); 358 359 /* Enable dram refresh, disable memory fifo, and setup memory */ 360 /* for rendering */ 361 ISET(sst->fbiInit0, IGET(sst->fbiInit0) & ~SST_MEM_FIFO_EN); 361 362 ISET(sst->fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH); 362 363 364 365 366 367 368 369 370 371 372 363 sst1InitIdleFBI(sstbase); 364 365 /* Setup Basic rendering datapath */ 366 ISET(sst->fbzColorPath, SST_CC_MONE); 367 ISET(sst->fogMode, 0x0); 368 ISET(sst->fbzMode, SST_RGBWRMASK | SST_ZAWRMASK | SST_DRAWBUFFER_FRONT); 369 sst1InitIdleFBI(sstbase); 370 371 if(sst1InitSliDetect(sstbase)) 372 /* SLI cannot support 4 MBytes... */ 373 goto check2MByte; 373 374 sst1InitSetResolution(sstbase, &SST_VREZ_800X600_60, 1); 374 375 376 377 378 379 380 381 382 LFB_PUTPIXEL(128, 100, 0xdead);/* maps to row:0x216, col:0x80, bank:0x1 */383 384 385 LFB_PUTPIXEL(200, 200, 0x55aa);/* maps to row:0x23d, col:0x104, bank:0x0 */386 387 388 389 390 391 392 393 394 395 375 sst1InitIdleFBI(sstbase); 376 377 ISET(sst->lfbMode, SST_LFB_ZZ | SST_LFB_WRITEFRONTBUFFER | 378 SST_LFB_READDEPTHABUFFER); 379 sst1InitIdleFBI(sstbase); 380 381 /* Check for 4 MBytes... */ 382 /* Write to Zbuffer in 800x600 resolution in upper 2 MBytes of memory */ 383 LFB_PUTPIXEL(128, 100, 0xdead); /* maps to row:0x216, col:0x80, bank:0x1 */ 384 LFB_PUTPIXEL(0, 0, 0x0); 385 LFB_PUTPIXEL(798, 599, 0xffff); 386 LFB_PUTPIXEL(200, 200, 0x55aa); /* maps to row:0x23d, col:0x104, bank:0x0 */ 387 LFB_PUTPIXEL(20, 20, 0xffff); 388 LFB_PUTPIXEL(400, 400, 0x0); 389 sst1InitIdleFBI(sstbase); 390 if((LFB_GETPIXEL(128, 100) == 0xdead) && 391 (LFB_GETPIXEL(200, 200) == 0x55aa)) { 392 retval = 4; 393 ISET(sst->lfbMode, (SST_LFB_565 | SST_LFB_READBACKBUFFER)); 394 sst1InitIdleFBI(sstbase); 395 goto fbiMemSizeDone; 396 } 396 397 397 398 check2MByte: 398 399 399 /* Check for 2 MBytes... */ 400 /* Write to color buffer in 640x480 resolution */ 400 401 sst1InitSetResolution(sstbase, &SST_VREZ_640X480_60, 0); 401 402 403 404 LFB_PUTPIXEL(50, 100, 0xdead);/* maps to row:0x1e, col:0x99, bank:0x0 */405 406 407 408 409 410 LFB_PUTPIXEL(178, 436, 0xaa55);/* maps to row:0x11e, col:0x99, bank:0x0 */411 412 413 414 415 416 417 418 419 420 421 402 ISET(sst->lfbMode, SST_LFB_565 | SST_LFB_WRITEFRONTBUFFER | 403 SST_LFB_READFRONTBUFFER); 404 sst1InitIdleFBI(sstbase); 405 LFB_PUTPIXEL(50, 100, 0xdead); /* maps to row:0x1e, col:0x99, bank:0x0 */ 406 LFB_PUTPIXEL(0, 0, 0x0); 407 LFB_PUTPIXEL(638, 479, 0xffff); 408 ISET(sst->lfbMode, SST_LFB_565 | SST_LFB_WRITEBACKBUFFER | 409 SST_LFB_READFRONTBUFFER); 410 sst1InitIdleFBI(sstbase); 411 LFB_PUTPIXEL(178, 436, 0xaa55); /* maps to row:0x11e, col:0x99, bank:0x0 */ 412 LFB_PUTPIXEL(20, 20, 0x0); 413 LFB_PUTPIXEL(400, 400, 0xffff); 414 sst1InitIdleFBI(sstbase); 415 if(LFB_GETPIXEL(50, 100) != 0xdead) 416 goto check1MByte; 417 ISET(sst->lfbMode, (SST_LFB_565 | SST_LFB_READBACKBUFFER)); 418 sst1InitIdleFBI(sstbase); 419 if(LFB_GETPIXEL(178, 436) == 0xaa55) { 420 retval = 2; 421 goto fbiMemSizeDone; 422 } 422 423 423 424 check1MByte: 424 425 426 427 LFB_PUTPIXEL(10, 10, 0xdead);/* maps to row:0x0, col:0x145, bank:0x0 */428 429 430 LFB_PUTPIXEL(100, 200, 0x5a5a);/* maps to row:0x3c, col:0x112, bank:0x1 */431 432 433 434 435 436 425 ISET(sst->lfbMode, SST_LFB_565 | SST_LFB_WRITEFRONTBUFFER | 426 SST_LFB_READFRONTBUFFER); 427 sst1InitIdleFBI(sstbase); 428 LFB_PUTPIXEL(10, 10, 0xdead); /* maps to row:0x0, col:0x145, bank:0x0 */ 429 LFB_PUTPIXEL(8, 8, 0x0); 430 LFB_PUTPIXEL(340, 340, 0xffff); 431 LFB_PUTPIXEL(100, 200, 0x5a5a); /* maps to row:0x3c, col:0x112, bank:0x1 */ 432 LFB_PUTPIXEL(66, 0, 0x0); 433 LFB_PUTPIXEL(360, 360, 0xffff); 434 sst1InitIdleFBI(sstbase); 435 if((LFB_GETPIXEL(10, 10) == 0xdead) && 436 (LFB_GETPIXEL(100, 200) == 0x5a5a)) 437 retval = 1; 437 438 438 439 fbiMemSizeDone: 439 440 441 442 443 444 445 440 /* Restore init registers to original state */ 441 ISET(sst->fbiInit0, init0Save); 442 ISET(sst->fbiInit1, init1Save); 443 ISET(sst->fbiInit2, init2Save); 444 sst1InitIdleFBI(sstbase); 445 446 return(retval); 446 447 } 447 448 … … 449 450 sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info) 450 451 { 451 452 volatile Sstregs *sst = (Sstregs *) sstbase; 452 453 453 454 info->fbiMemSize = fbiMemSize(sstbase); 454 455 455 456 456 /* Detect board identification and memory speed */ 457 if(GETENV(("SST_FBICFG"))) 457 458 SSCANF(GETENV(("SST_FBICFG")), "%i", &info->fbiConfig); 458 459 else 459 460 461 462 463 464 465 466 467 460 info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >> 461 SST_FBI_MEM_TYPE_SHIFT; 462 463 info->fbiBoardID = (info->fbiConfig >> 2) & 0x1; 464 /* fbiMemSpeed is legacy, and is not used by either Obsidian GE or Pro Fab */ 465 info->fbiMemSpeed = 0; 466 467 /* Detect scanline interleaving */ 468 info->sstSliDetect = sst1InitSliDetect(sstbase); 468 469 469 470 return FXTRUE; … … 504 505 if(GETENV(("SST_NODEVICEINFO"))) { 505 506 /* fill device info struct with sane values... */ 506 507 508 509 510 511 512 513 514 515 516 507 INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n")); 508 509 if(GETENV(("SST_FBICFG"))) 510 SSCANF(GETENV(("SST_FBICFG")), "%i", &info->fbiConfig); 511 else 512 info->fbiConfig = 0x0; 513 514 if(GETENV(("SST_TMUCFG"))) 515 SSCANF(GETENV(("SST_TMUCFG")), "%i", &info->tmuConfig); 516 else 517 info->tmuConfig = 0x0; 517 518 518 519 info->numberTmus = 1; 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 520 if (info->tmuConfig & FXBIT(6)) /* if TMU 1 exists */ 521 info->numberTmus++; 522 if (info->tmuConfig & FXBIT(13)) /* if TMU 2 exists */ 523 info->numberTmus++; 524 525 info->tmuRevision = info->tmuConfig & 0x7; 526 527 if(GETENV(("SST_FBIMEM_SIZE"))) 528 info->fbiMemSize = ATOI(GETENV(("SST_FBIMEM_SIZE"))); 529 else 530 info->fbiMemSize = 2; 531 532 if(GETENV(("SST_TMUMEM_SIZE"))) 533 info->tmuMemSize[0] = ATOI(GETENV(("SST_TMUMEM_SIZE"))); 534 else 535 info->tmuMemSize[0] = 2; 536 info->tmuMemSize[1] = info->tmuMemSize[0]; 537 info->tmuMemSize[2] = info->tmuMemSize[0]; 537 538 } else { 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 539 int i; 540 541 for(i=0; i<5; i++) { 542 if(i) 543 INIT_PRINTF(("sst1InitFillDeviceInfo(): Retry #%d for chip GetInfo()...\n", i)); 544 /* GetFbiInfo() must be called before GetTmuInfo() */ 545 if(sst1InitGetFbiInfo(sstbase, info) == FXFALSE) 546 continue; 547 /* get the revision ID of each TMU and verify that they are all the 548 same */ 549 if(sst1InitGetTmuInfo(sstbase, info) == FXFALSE) 550 continue; 551 break; 552 } 553 if(i == 5) 554 return(FXFALSE); 554 555 } 555 556 INIT_PRINTF(("sst1DeviceInfo: Board ID: Obsidian %s\n", … … 568 569 if(sst1InitUseVoodooFile == FXTRUE) { 569 570 if(iniDac == (sst1InitDacStruct *) NULL) 570 571 572 INIT_PRINTF(("sst1DeviceInfo: Dac Type: %s %s\n", 573 574 575 576 577 578 579 580 581 582 583 584 571 INIT_PRINTF(("sst1DeviceInfo: Dac Type: Unknown")); 572 else 573 INIT_PRINTF(("sst1DeviceInfo: Dac Type: %s %s\n", 574 iniDac->dacManufacturer, iniDac->dacDevice)); 575 } else { 576 INIT_PRINTF(("sst1DeviceInfo: Dac Type: ")); 577 if(info->fbiDacType == SST_FBI_DACTYPE_ATT) 578 INIT_PRINTF(("AT&T ATT20C409\n")); 579 else if(info->fbiDacType == SST_FBI_DACTYPE_ICS) 580 INIT_PRINTF(("ICS ICS5342\n")); 581 else if(info->fbiDacType == SST_FBI_DACTYPE_TI) 582 INIT_PRINTF(("TI TVP3409\n")); 583 else 584 INIT_PRINTF(("Unknown\n")); 585 } 585 586 INIT_PRINTF(("sst1DeviceInfo: SliDetect:%d\n", info->sstSliDetect)); 586 587 -
trunk/src/opengl/glide/sst1/init/initvg/parse.c
r2885 r6653 1 /* $Id: parse.c,v 1.2 2001-09-05 14:31:05 bird Exp $ */ 1 2 /* 2 3 ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY 3 4 ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT 4 5 ** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX 5 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 6 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 7 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 6 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 7 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 8 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 8 9 ** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A 9 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 10 ** 10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 11 ** 11 12 ** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO 12 13 ** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN … … 14 15 ** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR 15 16 ** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF 16 ** THE UNITED STATES. 17 ** 17 ** THE UNITED STATES. 18 ** 18 19 ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED 19 20 ** 20 21 ** 21 ** $Revision: 1. 1 $22 ** $Date: 200 0-02-25 00:31:34 $22 ** $Revision: 1.2 $ 23 ** $Date: 2001-09-05 14:31:05 $ 23 24 ** 24 25 ** Parsing code for grabbing information from "voodoo.ini" initialization file … … 170 171 /* Override voodoo.ini name */ 171 172 strcpy(filename, getenv("VOODOO_FILE")); 172 if (!(file = fopen(filename, "r"))) 173 if (!(file = fopen(filename, "r"))) 173 174 goto __errExit; 174 175 } else { … … 183 184 while(1) { 184 185 if (!i) { 185 186 186 if ((tmpPtr = strtok(path, ":")) == NULL) 187 break; 187 188 } else { 188 189 189 if ((tmpPtr = strtok(NULL, ":")) == NULL) 190 break; 190 191 } 191 192 strcpy(filename, tmpPtr); 192 193 if (filename[strlen(filename)-1] == '\\') 193 194 sprintf(filename, "%voodoo", filename); 194 195 else 195 196 sprintf(filename, "%s/voodoo", filename); 196 197 i++; 197 198 if ((file = fopen(filename, "r"))) 198 199 break; 199 200 } 200 201 } … … 513 514 break; 514 515 } 515 if(!(dacRdWrPtr->nextRdWr = malloc(sizeof(sst1InitDacRdWrStruct)))) 516 if(!(dacRdWrPtr->nextRdWr = malloc(sizeof(sst1InitDacRdWrStruct)))) 516 517 return(0); 517 518 … … 898 899 * string table has been freed by the c runtime but has not been set 899 900 * to NULL. Bad things happen if this memory has been unmapped by 900 * the system or if the string cannot be found. 901 * the system or if the string cannot be found. 901 902 */ 902 903 { -
trunk/src/opengl/glide/sst1/init/initvg/print.c
r2885 r6653 1 /* $Id: print.c,v 1.2 2001-09-05 14:31:05 bird Exp $ */ 1 2 /* 2 3 ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY 3 4 ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT 4 5 ** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX 5 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 6 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 7 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 6 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 7 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 8 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 8 9 ** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A 9 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 10 ** 10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 11 ** 11 12 ** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO 12 13 ** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN … … 14 15 ** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR 15 16 ** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF 16 ** THE UNITED STATES. 17 ** 17 ** THE UNITED STATES. 18 ** 18 19 ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED 19 20 ** 20 21 ** 21 ** $Revision: 1. 1 $22 ** $Date: 200 0-02-25 00:31:34 $22 ** $Revision: 1.2 $ 23 ** $Date: 2001-09-05 14:31:05 $ 23 24 ** 24 25 ** Print functions for SST-1 Initialization routines … … 46 47 if(firstPass == FXTRUE) { 47 48 firstPass = FXFALSE; 48 49 50 51 52 49 if (sst1InitMsgFile == NULL) 50 { 51 /* I couldn't initialize to stdout because stdout is not constant */ 52 sst1InitMsgFile = stdout; 53 } 53 54 if(GETENV(("SST_INITDEBUG"))) 54 55 printIt = FXTRUE; -
trunk/src/opengl/glide/sst1/init/initvg/sli.c
r2885 r6653 1 /* $Id: sli.c,v 1.2 2001-09-05 14:31:05 bird Exp $ */ 1 2 /* 2 3 ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY 3 4 ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT 4 5 ** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX 5 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 6 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 7 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 6 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 7 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 8 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 8 9 ** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A 9 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 10 ** 10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 11 ** 11 12 ** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO 12 13 ** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN … … 14 15 ** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR 15 16 ** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF 16 ** THE UNITED STATES. 17 ** 17 ** THE UNITED STATES. 18 ** 18 19 ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED 19 20 ** 20 21 ** 21 ** $Revision: 1. 1 $22 ** $Date: 200 0-02-25 00:31:34 $22 ** $Revision: 1.2 $ 23 ** $Date: 2001-09-05 14:31:05 $ 23 24 ** 24 25 ** Initialization code for initializing scanline interleaving … … 84 85 PCICFG_RD(SST1_PCI_INIT_ENABLE, j); 85 86 PCICFG_WR(SST1_PCI_INIT_ENABLE, 86 (j | SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV)); 87 (j | SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV)); 87 88 ISET(sstSlave->fbiInit1, IGET(sstSlave->fbiInit1) | 88 89 (SST_VIDEO_RESET | SST_EN_SCANLINE_INTERLEAVE)); … … 153 154 /* 16-bit Video Output */ 154 155 ISET(sstSlave->fbiInit1, (IGET(sstSlave->fbiInit1) & 155 ~(SST_VIDEO_VCLK_2X_OUTPUT_DEL | SST_VIDEO_VCLK_DEL)) | 156 ~(SST_VIDEO_VCLK_2X_OUTPUT_DEL | SST_VIDEO_VCLK_DEL)) | 156 157 SST_EN_SCANLINE_INTERLEAVE | 157 158 /* SST_VIDEO_VID_CLK_SLAVE | */ … … 166 167 ISET(sstSlave->fbiInit1, (IGET(sstSlave->fbiInit1) & 167 168 ~(SST_VIDEO_VCLK_2X_OUTPUT_DEL | SST_VIDEO_VCLK_DEL | 168 SST_VIDEO_VCLK_SEL | SST_VIDEO_VCLK_2X_INPUT_DEL)) | 169 SST_VIDEO_VCLK_SEL | SST_VIDEO_VCLK_2X_INPUT_DEL)) | 169 170 SST_EN_SCANLINE_INTERLEAVE | 170 171 /* SST_VIDEO_VID_CLK_SLAVE | */ … … 274 275 /* 16-bit Video Output */ 275 276 ISET(sstMaster->fbiInit1, (IGET(sstMaster->fbiInit1) & 276 ~(SST_VIDEO_VCLK_2X_OUTPUT_DEL | SST_VIDEO_VCLK_DEL)) | 277 ~(SST_VIDEO_VCLK_2X_OUTPUT_DEL | SST_VIDEO_VCLK_DEL)) | 277 278 SST_EN_SCANLINE_INTERLEAVE | 278 279 SST_VIDEO_VID_CLK_2X | … … 286 287 ISET(sstMaster->fbiInit1, (IGET(sstMaster->fbiInit1) & 287 288 ~(SST_VIDEO_VCLK_2X_OUTPUT_DEL | SST_VIDEO_VCLK_DEL | 288 SST_VIDEO_VCLK_SEL | SST_VIDEO_VCLK_2X_INPUT_DEL)) | 289 SST_VIDEO_VCLK_SEL | SST_VIDEO_VCLK_2X_INPUT_DEL)) | 289 290 SST_EN_SCANLINE_INTERLEAVE | 290 291 SST_VIDEO_VID_CLK_2X | … … 321 322 PCICFG_RD(SST1_PCI_INIT_ENABLE, j); 322 323 PCICFG_WR(SST1_PCI_INIT_ENABLE, 323 (j & ~(SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV))); 324 (j & ~(SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV))); 324 325 MasterPhysAddr = sst1CurrentBoard->physAddr; 325 326 sst1InitReturnStatus(sstbase0); /* flush pci packer with reads */ … … 332 333 PCICFG_RD(SST1_PCI_INIT_ENABLE, j); 333 334 PCICFG_WR(SST1_PCI_INIT_ENABLE, 334 ((j & ~(SST_SCANLINE_SLV_OWNPCI)) | SST_SCANLINE_SLI_SLV)); 335 ((j & ~(SST_SCANLINE_SLV_OWNPCI)) | SST_SCANLINE_SLI_SLV)); 335 336 /* Map both boards to same Master physical address */ 336 337 PCICFG_WR(PCI_BASE_ADDRESS_0, MasterPhysAddr); … … 432 433 PCICFG_WR(SST1_PCI_INIT_ENABLE, 433 434 (j | SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV | 434 SST_INITWR_EN | SST_PCI_FIFOWR_EN)); 435 SST_INITWR_EN | SST_PCI_FIFOWR_EN)); 435 436 PCICFG_RD(SST1_PCI_INIT_ENABLE, j); /* delay */ 436 437 ISET(sstSlave->fbiInit1, IGET(sstSlave->fbiInit1) & … … 438 439 PCICFG_RD(SST1_PCI_INIT_ENABLE, j); 439 440 PCICFG_WR(SST1_PCI_INIT_ENABLE, 440 (j & ~(SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV))); 441 (j & ~(SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV))); 441 442 PCICFG_RD(SST1_PCI_INIT_ENABLE, j); /* delay */ 442 443 sst1InitIdle((FxU32 *) sstSlave); -
trunk/src/opengl/glide/sst1/init/initvg/sst1init.c
r2885 r6653 1 /* 1 /* $Id: sst1init.c,v 1.2 2001-09-05 14:31:06 bird Exp $ */ 2 /* 2 3 ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY 3 4 ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT 4 5 ** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX 5 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 6 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 7 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 6 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 7 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 8 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 8 9 ** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A 9 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 10 ** 10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 11 ** 11 12 ** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO 12 13 ** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN … … 14 15 ** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR 15 16 ** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF 16 ** THE UNITED STATES. 17 ** 17 ** THE UNITED STATES. 18 ** 18 19 ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED 19 20 ** 20 ** $Revision: 1. 1 $21 ** $Date: 200 0-02-25 00:31:35 $21 ** $Revision: 1.2 $ 22 ** $Date: 2001-09-05 14:31:06 $ 22 23 ** 23 24 */ … … 28 29 ** NOTE: This code must compiled with optimizations DISABLED!! 29 30 ** 30 ** The following environment variables can optionally be used to alter 31 ** The following environment variables can optionally be used to alter 31 32 ** functionality (A value of X is a "don't care"): 32 33 ** … … 203 204 &sst1InitDeviceNumber, j, 0); 204 205 #else 205 sst = pciMapCardMulti(vendorID, deviceID, sizeOfCard, 206 sst = pciMapCardMulti(vendorID, deviceID, sizeOfCard, 206 207 &sst1InitDeviceNumber, j, 0); 207 208 #endif /* DIRECTX */ … … 331 332 sst1InitReturnStatus(sstbase); 332 333 sst1InitReturnStatus(sstbase); 333 334 334 335 /* Adjust Fbi-to-Trex clock delay value */ 335 336 /* Adjust Trex-to-Fbi FIFO */ … … 486 487 (tf2_clk_del<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT); 487 488 } 488 INIT_PRINTF(("sst1InitRegisters(): Storing TREX2INIT1=0x%x\n", 489 INIT_PRINTF(("sst1InitRegisters(): Storing TREX2INIT1=0x%x\n", 489 490 sst1CurrentBoard->tmuInit1[2])); 490 491 … … 709 710 } 710 711 #ifdef __DOS32__ 711 /* 712 /* 712 713 * HACK alert. -MS 713 714 * 714 715 * There's a pciClose(), but nobody calls it. This is needed by the 715 716 * DOS DPMI services to close fxmemmap.vxd. 716 * 717 * 717 718 * We need to move this to the "appropriate" place, wherever that may be. 718 719 */ … … 762 763 return(FXFALSE); 763 764 sst1CurrentBoard->initGrxClkDone = 0; 764 765 765 766 if((++n > 1) || !SliEnable) 766 767 break; … … 877 878 } 878 879 879 static FxU32 880 static FxU32 880 881 mtrr; 881 882 … … 886 887 ** 887 888 */ 888 FX_EXPORT void FX_CSTYLE 889 FX_EXPORT void FX_CSTYLE 889 890 sst1InitCachingOn(void) 890 891 { 891 FxU32 892 FxU32 892 893 physAddr; 893 894 FxBool … … 909 910 else 910 911 return; /* It's already there. We're done. */ 911 912 912 913 if (res) 913 914 pciSetMTRR(mtrr, physAddr, 0x1000000, PciMemTypeWriteCombining); -
trunk/src/opengl/glide/sst1/init/initvg/util.c
r2885 r6653 1 /* $Id: util.c,v 1.2 2001-09-05 14:31:06 bird Exp $ */ 1 2 /* 2 3 ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY 3 4 ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT 4 5 ** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX 5 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 6 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 7 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 6 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 7 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 8 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 8 9 ** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A 9 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 10 ** 10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 11 ** 11 12 ** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO 12 13 ** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN … … 14 15 ** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR 15 16 ** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF 16 ** THE UNITED STATES. 17 ** 17 ** THE UNITED STATES. 18 ** 18 19 ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED 19 20 ** 20 21 ** 21 ** $Revision: 1. 1 $22 ** $Date: 200 0-02-25 00:31:35 $22 ** $Revision: 1.2 $ 23 ** $Date: 2001-09-05 14:31:06 $ 23 24 ** 24 25 ** Utility routines for SST-1 Initialization code … … 225 226 if(enable) { 226 227 /* VGA controls monitor */ 227 ISET(sst->fbiInit0, (IGET(sst->fbiInit0) & ~SST_EN_VGA_PASSTHRU) | 228 ISET(sst->fbiInit0, (IGET(sst->fbiInit0) & ~SST_EN_VGA_PASSTHRU) | 228 229 sst1CurrentBoard->vgaPassthruEnable); 229 230 ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_BLANK_EN); 230 231 } else { 231 232 /* SST-1 controls monitor */ 232 ISET(sst->fbiInit0, (IGET(sst->fbiInit0) & ~SST_EN_VGA_PASSTHRU) | 233 ISET(sst->fbiInit0, (IGET(sst->fbiInit0) & ~SST_EN_VGA_PASSTHRU) | 233 234 sst1CurrentBoard->vgaPassthruDisable); 234 235 ISET(sst->fbiInit1, IGET(sst->fbiInit1) & ~SST_VIDEO_BLANK_EN); -
trunk/src/opengl/glide/sst1/init/initvg/video.c
r2885 r6653 1 /* $Id: video.c,v 1.2 2001-09-05 14:31:07 bird Exp $ */ 1 2 /* 2 3 ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY 3 4 ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT 4 5 ** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX 5 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 6 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 7 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 6 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 7 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 8 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 8 9 ** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A 9 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 10 ** 10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 11 ** 11 12 ** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO 12 13 ** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN … … 14 15 ** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR 15 16 ** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF 16 ** THE UNITED STATES. 17 ** 17 ** THE UNITED STATES. 18 ** 18 19 ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED 19 20 ** 20 21 ** 21 ** $Revision: 1. 1 $22 ** $Date: 200 0-02-25 00:31:35 $22 ** $Revision: 1.2 $ 23 ** $Date: 2001-09-05 14:31:07 $ 23 24 ** 24 25 ** Initialization code for initializing SST-1 video unit … … 348 349 /* Reset Video Refresh Unit */ 349 350 ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_RESET); 350 351 351 352 /* Enable video clock */ 352 353 if(SLI_DRIVEOK()) { … … 400 401 /* Setup SST memory mapper for desired resolution */ 401 402 if(sst1CurrentBoard->fbiMemSize == 4) 402 sst1InitSetResolution(sstbase, sstVideoRez, 1); 403 sst1InitSetResolution(sstbase, sstVideoRez, 1); 403 404 else 404 sst1InitSetResolution(sstbase, sstVideoRez, 0); 405 sst1InitSetResolution(sstbase, sstVideoRez, 0); 405 406 406 407 if((GETENV(("SST_TRIPLE_BUFFER"))) || … … 506 507 if(sst1CurrentBoard->fbiMemSize == 1 && sstVideoRez->xDimension > 512) 507 508 n = 0; 508 509 509 510 if(n) { 510 511 sst1CurrentBoard->fbiMemoryFifoEn = 1; … … 530 531 INIT_PRINTF(("sst1InitVideo(): Setting memory FIFO LWM to 0x%x (%d)\n", 531 532 sst1CurrentBoard->memFifoStatusLwm, 532 sst1CurrentBoard->memFifoStatusLwm)); 533 sst1CurrentBoard->memFifoStatusLwm)); 533 534 534 535 vInClkDel = 0; … … 781 782 ** Video Timing Structure 782 783 */ 783 FX_EXPORT sst1VideoTimingStruct * FX_CSTYLE sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution, 784 FX_EXPORT sst1VideoTimingStruct * FX_CSTYLE sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution, 784 785 GrScreenRefresh_t screenRefresh) 785 786 { … … 995 996 ** 996 997 */ 997 FX_EXPORT void FX_CSTYLE sst1InitSetResolution(FxU32 *sstbase, 998 FX_EXPORT void FX_CSTYLE sst1InitSetResolution(FxU32 *sstbase, 998 999 sst1VideoTimingStruct *sstVideoRez, FxU32 Banked) 999 1000 { … … 1089 1090 ** sst1InitSetTripleBuffering(): 1090 1091 ** Specify Video Triple Buffering 1091 ** NOTE: sst1InitSetTripleBuffering() must be called prior to calling 1092 ** NOTE: sst1InitSetTripleBuffering() must be called prior to calling 1092 1093 ** sst1InitVideo() to properly setup Video Triple Buffering 1093 1094 ** -
trunk/src/opengl/glide/sst1/init/vg96drvr.c
r2885 r6653 1 /* $Id: vg96drvr.c,v 1.2 2001-09-05 14:31:00 bird Exp $ */ 1 2 /* 2 3 ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY 3 4 ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT 4 5 ** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX 5 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 6 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 7 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 6 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 7 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 8 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 8 9 ** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A 9 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 10 ** 10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 11 ** 11 12 ** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO 12 13 ** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN … … 14 15 ** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR 15 16 ** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF 16 ** THE UNITED STATES. 17 ** 17 ** THE UNITED STATES. 18 ** 18 19 ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED 19 20 ** 20 21 ** 21 ** $Revision: 1. 1 $22 ** $Date: 200 0-02-25 00:31:27 $22 ** $Revision: 1.2 $ 23 ** $Date: 2001-09-05 14:31:00 $ 23 24 ** 24 25 */ … … 50 51 int *fbStride, 51 52 sst1VideoTimingStruct *vidTimings) { 52 return init96SetVideo( hWnd, sRes, vRefresh, cFormat, yOrigin, 53 return init96SetVideo( hWnd, sRes, vRefresh, cFormat, yOrigin, 53 54 nColBuffers, nAuxBuffers, 54 55 &context->info.regs, … … 72 73 init96Swap( code, &context->info.regs, context->writeMethod ); 73 74 return INIT_SWAP_FLIP; 74 } 75 } 75 76 76 77 static FxU32 status( void ) { 77 78 return *(context->info.regs.hwDep.VG96RegDesc.serialStatus); 78 } 79 } 79 80 80 81 static FxBool busy(void) { … … 84 85 85 86 return rv; 86 } 87 } 87 88 88 89 static void idle( void ) { … … 111 112 FxBool rv = FXFALSE; 112 113 GDBG_INFO((80, "vg96drvr: control: code = %d\n", code)); 113 if (context) 114 if (context) 114 115 rv = init96Control( code, &context->info.regs); 115 116 return rv; … … 160 161 context->initGammaTable = gammatable; 161 162 context->findVidTimingStruct = findvidtiming; 162 } 163 } 163 164 #else 164 165 /* I've got to stub this one to get the Voodoo Graphics glide to link */ … … 184 185 context->gammaRGB = NULL; 185 186 context->initGammaTable = NULL; 186 context->findVidTimingStruct = NULL; 187 context->findVidTimingStruct = NULL; 187 188 188 189 } -
trunk/src/opengl/glide/sst1/init/vgdrvr.c
r2885 r6653 1 /* $Id: vgdrvr.c,v 1.2 2001-09-05 14:31:01 bird Exp $ */ 1 2 /* 2 3 ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY 3 4 ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT 4 5 ** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX 5 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 6 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 7 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 6 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 7 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 8 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 8 9 ** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A 9 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 10 ** 10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 11 ** 11 12 ** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO 12 13 ** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN … … 14 15 ** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR 15 16 ** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF 16 ** THE UNITED STATES. 17 ** 17 ** THE UNITED STATES. 18 ** 18 19 ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED 19 20 ** 20 21 ** 21 ** $Revision: 1. 1 $22 ** $Date: 200 0-02-25 00:31:27 $22 ** $Revision: 1.2 $ 23 ** $Date: 2001-09-05 14:31:01 $ 23 24 ** 24 25 */ … … 45 46 static int _w[] = {320,320,400,512,640,640,640,640,800,960,856,512}; 46 47 static int _h[] = {200,240,256,384,200,350,400,480,600,720,480,256}; 47 48 48 49 rv = sst1InitVideo( (FxU32*)context->info.hwDep.vgInfo.vgBaseAddr, 49 50 sRes, 50 vRefresh, 51 vRefresh, 51 52 vidTimings ); 52 53 … … 58 59 rv = sst1InitVideo( (FxU32*)context->info.hwDep.vgInfo.slaveBaseAddr, 59 60 sRes, 60 vRefresh, 61 vRefresh, 61 62 vidTimings ); 62 63 if ( !rv ) goto BAIL; … … 88 89 89 90 if ( info ) { 90 rv = sst1InitGetDeviceInfo( (FxU32*)context->info.hwDep.vgInfo.vgBaseAddr, 91 rv = sst1InitGetDeviceInfo( (FxU32*)context->info.hwDep.vgInfo.vgBaseAddr, 91 92 &sstInfo ); 92 93 info->hwDep.vgFIFOData.memFifoStatusLwm = sstInfo.memFifoStatusLwm; … … 103 104 static InitSwapType_t FX_CALL swapBuffers( FxU32 code ) { 104 105 return INIT_SWAP_FLIP; 105 } 106 } 106 107 107 108 static FxU32 FX_CALL status( void ) { 108 109 return sst1InitReturnStatus((FxU32 *) context->info.hwDep.vgInfo.vgBaseAddr); 109 } 110 } 110 111 111 112 static FxBool FX_CALL busy(void) { 112 113 FxU32 stat = status(); 113 114 FxBool ret = (stat & SST_BUSY) ? FXTRUE : FXFALSE; 114 115 115 116 return ret; 116 } 117 } 117 118 118 119 static void FX_CALL idle( void ) {
Note:
See TracChangeset
for help on using the changeset viewer.