more warning fixing and syncing glide2x init with glide3x

This commit is contained in:
sezero
2018-08-20 01:34:20 +03:00
parent ece8c244f3
commit 5ebace29f9
22 changed files with 501 additions and 538 deletions

View File

@@ -17,7 +17,6 @@
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
**
** Initialization code for initializing canpus cards w/ assymetric
** inter-chip buses.
**
@@ -92,12 +91,12 @@ sst1InitComputeClkParamsATT_Int(FFLOAT dwFreq, sst1ClkTimingStruct *clkTiming)
lBestErr = 99999999;
sNBest = 0;
sMBest = 0;
lRatio = (unsigned long)((dwFreq*10l)/(FI/100l)) * lPDiv; // lRatio in [1/1000]
lRatio = (FxU32)((dwFreq*10l)/(FI/100l)) * lPDiv; // lRatio in [1/1000]
for ( sN= (NMID-NDELTA); sN <= (NMID+NDELTA); sN++ ) {
sM = (unsigned short)((lRatio * sN + 500) / 1000l);
if (sM > MMAX) sM = MMAX;
lActual = (unsigned long)((FI * sM) / (sN * lPDiv));
lActual = (FxU32)((FI * sM) / (sN * lPDiv));
lError = (lActual > dwFreq) ? (lActual - dwFreq) : (dwFreq - lActual);
if ( lError < lBestErr ) {
sNBest = sN;
@@ -110,7 +109,7 @@ sst1InitComputeClkParamsATT_Int(FFLOAT dwFreq, sst1ClkTimingStruct *clkTiming)
sM++;
if (sM > MMAX) sM = MMAX;
lActual = (unsigned long)((FI * sM) / (sN * lPDiv));
lActual = (FxU32)((FI * sM) / (sN * lPDiv));
lError = (lActual > dwFreq) ? (lActual - dwFreq) : (dwFreq - lActual);
if ( lError < lBestErr) {
sNBest = sN;

View File

@@ -17,7 +17,6 @@
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
**
*/
#ifndef _CANOPUS_H_
@@ -25,8 +24,7 @@
// if we use FFLOAT as an integer, we need to handle clocks in Hz
#define CLOCK_MULTIPLIER 1000000L
typedef unsigned long FFLOAT;
typedef unsigned long DDOUBLE;
typedef FxU32 FFLOAT;
/* FixMe!! Is this right? */
#define CANOPUS_ID 0x10UL

View File

@@ -17,7 +17,6 @@
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
**
** Initialization code for initializing supported SST-1 DACs
**
*/
@@ -560,7 +559,7 @@ sst1InitComputeClkParams(float freq, sst1ClkTimingStruct* clkTiming)
return sst1InitComputeClkParamsTI(freq, clkTiming);
} else if (sst1CurrentBoard->fbiVideoDacType == SST_FBI_DACTYPE_PROXY) {
FxU32 i;
FxBool retval;
FxBool retval = FXTRUE;
sst1DeviceInfoStruct *saveBoard;
/* if we are a single board SLI (proxy dac) we need to do all changes
@@ -589,7 +588,7 @@ sst1InitComputeClkParams(float freq, sst1ClkTimingStruct* clkTiming)
FxBool sst1InitComputeClkParamsATT(float freq, sst1ClkTimingStruct
*clkTiming)
{
float vcoFreqDivide, freqMultRatio, clkError;
float vcoFreqDivide = 0.0f, freqMultRatio, clkError;
float clkErrorMin;
FxU32 p, n, m, nPlusTwo;
int mPlusTwo;
@@ -623,7 +622,7 @@ FxBool sst1InitComputeClkParamsATT(float freq, sst1ClkTimingStruct
freqMultRatio = (freq * vcoFreqDivide) * (float) 0.06984216;
/* Calculate proper N and M parameters which yield the lowest error */
clkErrorMin = (float) 9999.; n = 0;
clkErrorMin = (float) 9999.; n = 0; m = 0;
for(nPlusTwo = 3; nPlusTwo < 32; nPlusTwo++) {
#ifdef DIRECTX
mPlusTwo = FTOL( (((float) nPlusTwo * freqMultRatio) + (float) 0.5) );
@@ -694,7 +693,7 @@ FxBool sst1InitComputeClkParamsTI(float freq, sst1ClkTimingStruct
/* Loop through all the possible combinations and find the frequency
with the least error */
clkErrorMin = (float) 9999.; nBest = 9999;
clkErrorMin = (float) 9999.; pBest = 9999; nBest = 9999; mBest = 9999;
for(p=0; p<4; p++) {
for(m=0; m<64; m++) {
for(n=0; n<5; n++) {

View File

@@ -41,14 +41,14 @@ static FxBool FindHole(RangeStruct *conflict);
static FxU32 SnapToDecentAddress(FxU32 address,RangeStruct *conflict);
static FxBool fits_in_hole(RangeStruct *begin,FxU32 end,RangeStruct *hole,RangeStruct *conflict);
static FxBool fits_under(RangeStruct *first,FxU32 minimum,RangeStruct *hole,RangeStruct *conflict);
static FxU32 pciGetType(long i);
static FxU32 pciGetType(int i);
static void pciGetRange(PciRegister reg,FxU32 device_number,FxU32 *data);
static FxBool pciGetAddress(PciRegister reg,FxU32 device_number,FxU32 *data);
static void ForceCleanUp(void);
static FxBool FindNecessaryCards(void);
static FxBool IsCardVoodoo(long i);
static FxBool IsCardS3(long i);
static FxBool IsCardVoodoo(int i);
static FxBool IsCardS3(int i);
static void AddMapEntry(FxU32 address,FxU32 range,FxU32 id,FxBool VoodooCard,FxBool S3Card);
#if 0 /* not used */
static void HandleMemoryOverlap(void);
@@ -63,7 +63,7 @@ static RangeStruct hole[80];
#endif
static RangeStruct *first_entry;
static RangeStruct *last_entry;
static long entries=0;
static int entries=0;
static RangeStruct master_hole;
static FxU32 conflicts_found=0;
@@ -142,7 +142,7 @@ static void GetMemoryMap(void)
{
FxU32 temp,temp2;
FxU32 type;
long devNum;
int devNum;
int fn; /* function number iterator */
int maxFnNumber;
int multi_fn = 0;
@@ -277,12 +277,12 @@ static void AddMapEntry(FxU32 address,FxU32 range,FxU32 id,FxBool VoodooCard,FxB
RangeStruct *temp,*cur,*next;
//jcochrane@3dfx.com
long entry=0;
int entry=0;
FxU32 tmp_address=0;
//END
#if 0
static long test_entry=0;
static int test_entry=0;
address=test_data[test_entry].address;
range=~(test_data[test_entry++].range - 0x1);
@@ -563,7 +563,7 @@ static void ForceCleanUp(void)
static FxBool FindNecessaryCards(void)
{
FxBool voodoo_found=FXFALSE;
long i;
int i;
for (i=0;i<MAX_PCI_DEVICES;i++)
{
@@ -581,7 +581,7 @@ static FxBool FindNecessaryCards(void)
return FXTRUE;
}
static FxU32 pciGetType(long i)
static FxU32 pciGetType(int i)
{
FxU32 header_type;
@@ -590,7 +590,7 @@ static FxU32 pciGetType(long i)
return header_type;
}
static FxBool IsCardVoodoo(long i)
static FxBool IsCardVoodoo(int i)
{
FxU32 vendor,dev_id;
FxU32 fn_num = (i >> 13) & 0x7;
@@ -621,7 +621,7 @@ static FxBool IsCardVoodoo(long i)
return FXFALSE;
}
static FxBool IsCardS3(long i)
static FxBool IsCardS3(int i)
{
FxU32 vendor,dev_id;

View File

@@ -17,7 +17,6 @@
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
**
** Initialization code for loading SST-1 gamma tables
**
*/

View File

@@ -65,7 +65,7 @@ EngDebugPrint(
static char *gdbg_myname = "gd"; // default library name
static char gdbg_debuglevel[GDBG_MAX_LEVELS]; // array of debuglevel controls
static long gdbg_errors = 0;
static int gdbg_errors = 0;
#ifdef KERNEL
@@ -102,7 +102,7 @@ static FILE *gdbg_msgfile = NULL; /* stdout; */ // GDBG info/error file
//----------------------------------------------------------------------
static const char *setRange(const char *buf, int val)
{
int r0,r1,pos;
int r0,r1,pos=0;
sscanf(buf,"%i%n",&r0,&pos); // parse the first integer
if (buf[pos]=='-' || buf[pos]==':') { // if there's a second
@@ -159,7 +159,6 @@ gdbg_init(void)
* I do it now */
gdbg_msgfile = stdout;
#if __MWERKS__
SIOUXSettings.standalone = false;
SIOUXSettings.setupmenus = false;
@@ -358,7 +357,7 @@ gdbg_info_more (const int level, const char *format, ...)
#endif /* #ifndef KERNEL */
return (1);
}
static GDBGErrorProc errorProcList[3];
FX_EXPORT int FX_CSTYLE gdbg_error_set_callback(GDBGErrorProc p)
@@ -479,9 +478,10 @@ gdbg_set_file(const char *name)
{
outf = fopen(name,"w"); // open up a new one
if (outf) gdbg_msgfile = outf;
return (outf != NULL);
}
return (outf != NULL);
return 1;
#else /* #ifndef KERNEL */
return 0;
#endif /* #ifndef KERNEL */

View File

@@ -17,7 +17,6 @@
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
**
** Routines to detect memory size, strapping pin, and other initialization
** configuration information.
**
@@ -47,7 +46,7 @@ readAndSum4x4(FxU32 *sstbase, FxU32 x, FxU32 y,
FxU32 *r_sum, FxU32 *g_sum, FxU32 *b_sum)
{
FxU32 rd_x, rd_y;
FxU32 rd_col;
FxU32 rd_col = 0;
FxU32 rd_r, rd_g, rd_b;
SstRegs *sst = (SstRegs *) sstbase;
@@ -289,9 +288,9 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu,
if(GETENV(("SSTV2_TMU_MEMSIZE"))) {
*TmuMemorySize = ATOI(GETENV(("SSTV2_TMU_MEMSIZE")));
// If user specifies 2 MBytes on a 4 MBytes board, disable the
// second RAS so that apps which may incorrectly store data in the
// upper 2 Mbytes will not function properly...
/* If user specifies 2 MBytes on a 4 MBytes board, disable the
* second RAS so that apps which may incorrectly store data in the
* upper 2 Mbytes will not function properly... */
if (*TmuMemorySize == 2) {
info->tmuInit0[tmu] &= ~SST_EN_TEX_MEM_SECOND_RAS;
sst1InitIdle(sstbase);
@@ -356,8 +355,7 @@ sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
} else {
/* Get TMU memory size */
info->tmuRevision = info->tmuConfig & 0x7;
if(sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]) ==
FXFALSE)
if(sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]) == FXFALSE)
return(FXFALSE);
}
@@ -365,7 +363,7 @@ sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
if (info->tmuConfig & FXBIT(6)) { /* if TMU 1 exists */
info->numberTmus++; /* increment TMU count */
trev = (info->tmuConfig>>7) & 0x7; /* get its revision */
#if 0 // Ignore for now...
#if 0 /* Ignore for now... */
if (info->tmuRevision != trev) {
INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n"));
return(FXFALSE);
@@ -377,7 +375,7 @@ sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
if (info->tmuConfig & FXBIT(13)) { /* if TMU 2 exists */
info->numberTmus++; /* increment TMU count */
trev = (info->tmuConfig>>14) & 0x7; /* get its revision */
#if 0 // Ignore for now...
#if 0 /* Ignore for now... */
if (info->tmuRevision != trev) {
INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n"));
return(FXFALSE);
@@ -535,8 +533,7 @@ sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
** been allocated
**
*/
FX_EXPORT FxBool FX_CSTYLE sst1InitGetDeviceInfo(FxU32 *sstbase,
sst1DeviceInfoStruct *info)
FX_EXPORT FxBool FX_CSTYLE sst1InitGetDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
{
FxBool retval;
@@ -593,7 +590,8 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
info->tmuMemSize[0] = 2;
info->tmuMemSize[1] = info->tmuMemSize[0];
info->tmuMemSize[2] = info->tmuMemSize[0];
} else {
}
else {
int i;
for (i=0; i<5; i++) {
@@ -611,9 +609,9 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
if (i == 5)
return(FXFALSE);
}
// Measure silicon performance
sst1InitMeasureSiProcess(sstbase, 0); // measure NAND-tree
sst1InitMeasureSiProcess(sstbase, 1); // measure NOR-tree
/* Measure silicon performance */
sst1InitMeasureSiProcess(sstbase, 0); /* measure NAND-tree */
sst1InitMeasureSiProcess(sstbase, 1); /* measure NOR-tree */
INIT_PRINTF(("sst1DeviceInfo: Board ID: %d\n", info->fbiBoardID));
INIT_PRINTF(("sst1DeviceInfo: FbiConfig:0x%x, TmuConfig:0x%x\n",
@@ -628,12 +626,13 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
INIT_PRINTF((", TMU[2] Memory:%d", info->tmuMemSize[2]));
INIT_PRINTF(("\n"));
if (sst1InitUseVoodooFile == FXTRUE) {
if(iniDac == (sst1InitDacStruct *) NULL)
if(iniDac == NULL)
INIT_PRINTF(("sst1DeviceInfo: Dac Type: Unknown"));
else
INIT_PRINTF(("sst1DeviceInfo: Dac Type: %s %s\n",
iniDac->dacManufacturer, iniDac->dacDevice));
} else {
}
else {
INIT_PRINTF(("sst1DeviceInfo: Dac Type: "));
if(info->fbiVideoDacType == SST_FBI_DACTYPE_ATT)
INIT_PRINTF(("AT&T ATT20C409\n"));

View File

@@ -17,7 +17,6 @@
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
**
** Parsing code for grabbing information from "voodoo2.ini" initialization file
**
*/
@@ -78,7 +77,7 @@ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile()
#ifndef DIRECTX
int inCfg, inDac;
FILE *file = (FILE *) NULL;
FILE *file = NULL;
char buffer[1024], filename[256];
int helper = (getenv(("SSTV2_DEBUGDAC"))) ? 1 : 0;
@@ -228,7 +227,7 @@ FX_ENTRY FxBool FX_CALL sst1InitVoodooFile()
inCfg = inDac = 0;
while(sst1InitFgets(buffer, file)) {
buffer[strlen(buffer)-1] = (char) NULL;
buffer[strlen(buffer)-1] = 0;
if(!strcmp(buffer, "[VOODOO2]")) {
inCfg = 1; inDac = 0;
continue;
@@ -359,7 +358,7 @@ static void foo(int argc, char **argv)
inCfg = inDac = 0;
while(sst1InitFgets(buffer, file)) {
buffer[strlen(buffer)-1] = (char) NULL;
buffer[strlen(buffer)-1] = 0;
if(!strcmp(buffer, "[CFG]")) {
inCfg = 1; inDac = 0;
continue;
@@ -435,7 +434,7 @@ static void sst1InitFixFilename(char *dst, char *src)
*dst++ = *src;
src++;
}
*dst = (char) NULL;
*dst = 0;
}
@@ -449,7 +448,7 @@ static int sst1InitFgets(char *string, FILE *stream)
*ptr++ = (char) charRead;
validChars++;
if(charRead == '\n') {
*ptr++ = (char) NULL;
*ptr++ = 0;
break;
}
}
@@ -508,7 +507,7 @@ static int sst1InitParseFieldCfg(char *string)
if((envName = strtok(string, "=")) == NULL)
return(0);
if((envVal = strtok((char *) NULL, "=")) == NULL)
if((envVal = strtok(NULL, "=")) == NULL)
/* Valid environment variable, NULL value */
return(1);
@@ -516,25 +515,23 @@ static int sst1InitParseFieldCfg(char *string)
sst1InitToLower(envName);
sst1InitToLower(envVal);
if(envVarsBase == (sst1InitEnvVarStruct *) NULL) {
if((envVarsPtr = malloc(sizeof(sst1InitEnvVarStruct))) ==
(sst1InitEnvVarStruct *) NULL)
if(envVarsBase == NULL) {
if((envVarsPtr = malloc(sizeof(sst1InitEnvVarStruct))) == NULL)
return(0);
envVarsBase = envVarsPtr;
} else {
envVarsPtr = envVarsBase;
while(1) {
if(envVarsPtr->nextVar == (sst1InitEnvVarStruct *) NULL)
if(envVarsPtr->nextVar == NULL)
break;
else
envVarsPtr = envVarsPtr->nextVar;
}
if((envVarsPtr->nextVar = malloc(sizeof(sst1InitEnvVarStruct))) ==
(sst1InitEnvVarStruct *) NULL)
if((envVarsPtr->nextVar = malloc(sizeof(sst1InitEnvVarStruct))) == NULL)
return(0);
envVarsPtr = envVarsPtr->nextVar;
}
envVarsPtr->nextVar = (sst1InitEnvVarStruct *) NULL;
envVarsPtr->nextVar = NULL;
strcpy(envVarsPtr->envVariable, envName);
strcpy(envVarsPtr->envValue, envVal);
@@ -544,64 +541,62 @@ static int sst1InitParseFieldCfg(char *string)
static int sst1InitParseFieldDac(char *string)
{
char *dacFieldReference, *dacFieldValue;
static sst1InitDacStruct *dacPtr = (sst1InitDacStruct *) NULL;
static sst1InitDacStruct *dacPtr = NULL;
if((dacFieldReference = strtok(string, "=")) == NULL)
return(0);
if(!strcmp(dacFieldReference, "MANUFACTURER")) {
/* Add new dac device */
if(dacStructBase == (sst1InitDacStruct *) NULL) {
if((dacPtr = malloc(sizeof(sst1InitDacStruct))) ==
(sst1InitDacStruct *) NULL)
if(dacStructBase == NULL) {
if((dacPtr = malloc(sizeof(sst1InitDacStruct))) == NULL)
return(0);
dacStructBase = dacPtr;
} else {
dacPtr = dacStructBase;
while(1) {
if(dacPtr->nextDac == (sst1InitDacStruct *) NULL)
if(dacPtr->nextDac == NULL)
break;
else
dacPtr = dacPtr->nextDac;
}
if((dacPtr->nextDac = malloc(sizeof(sst1InitDacStruct))) ==
(sst1InitDacStruct *) NULL)
if((dacPtr->nextDac = malloc(sizeof(sst1InitDacStruct))) == NULL)
return(0);
dacPtr = dacPtr->nextDac;
}
dacPtr->nextDac = (sst1InitDacStruct *) NULL;
dacPtr->dacManufacturer[0] = (char) NULL;
dacPtr->dacDevice[0] = (char) NULL;
dacPtr->detect = (sst1InitDacRdWrStruct *) NULL;
dacPtr->setVideo = (sst1InitDacSetVideoStruct *) NULL;
dacPtr->setMemClk = (sst1InitDacSetMemClkStruct *) NULL;
dacPtr->setVideoMode = (sst1InitDacSetVideoModeStruct *) NULL;
dacPtr->nextDac = NULL;
dacPtr->dacManufacturer[0] = 0;
dacPtr->dacDevice[0] = 0;
dacPtr->detect = NULL;
dacPtr->setVideo = NULL;
dacPtr->setMemClk = NULL;
dacPtr->setVideoMode = NULL;
if((dacFieldValue = strtok((char *) NULL, "=")) == NULL)
return(0);
strcpy(dacPtr->dacManufacturer, dacFieldValue);
} else if(!strcmp(dacFieldReference, "DEVICE")) {
if((dacFieldValue = strtok((char *) NULL, "=")) == NULL)
if((dacFieldValue = strtok(NULL, "=")) == NULL)
return(0);
strcpy(dacPtr->dacDevice, dacFieldValue);
} else if(!strcmp(dacFieldReference, "DETECT")) {
if((dacFieldValue = strtok((char *) NULL, "=")) == NULL)
if((dacFieldValue = strtok(NULL, "=")) == NULL)
return(0);
sst1InitToLower(dacFieldValue);
if(!sst1InitParseDacRdWrString(dacFieldValue, dacPtr))
return(0);
} else if(!strcmp(dacFieldReference, "SETVIDEO")) {
if((dacFieldValue = strtok((char *) NULL, "=")) == NULL)
if((dacFieldValue = strtok(NULL, "=")) == NULL)
return(0);
sst1InitToLower(dacFieldValue);
if(!sst1InitParseSetVideoString(dacFieldValue, dacPtr))
return(0);
} else if(!strcmp(dacFieldReference, "SETMEMCLK")) {
if((dacFieldValue = strtok((char *) NULL, "=")) == NULL)
if((dacFieldValue = strtok(NULL, "=")) == NULL)
return(0);
sst1InitToLower(dacFieldValue);
if(!sst1InitParseSetMemClkString(dacFieldValue, dacPtr))
return(0);
} else if(!strcmp(dacFieldReference, "SETVIDEOMODE")) {
if((dacFieldValue = strtok((char *) NULL, "=")) == NULL)
if((dacFieldValue = strtok(NULL, "=")) == NULL)
return(0);
sst1InitToLower(dacFieldValue);
if(!sst1InitParseSetVideoModeString(dacFieldValue, dacPtr))
@@ -641,7 +636,7 @@ static int sst1InitParseDacRdWrString(char *string, sst1InitDacStruct *dacBase)
dacRdWrPtr = dacRdWrPtr->nextRdWr;
}
dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL;
dacRdWrPtr->nextRdWr = NULL;
if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr))
return(0);
cntr++;
@@ -657,16 +652,16 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr)
strcpy(stringCpy, string);
if(stringCpy[5] == '(') {
stringCpy[5] = (char) NULL;
stringCpy[5] = 0;
addrDataCmd = &stringCpy[6];
} else if(stringCpy[7] == '(') {
stringCpy[7] = (char) NULL;
stringCpy[7] = 0;
addrDataCmd = &stringCpy[8];
} else if(stringCpy[8] == '(') {
stringCpy[8] = (char) NULL;
stringCpy[8] = 0;
addrDataCmd = &stringCpy[9];
} else if(stringCpy[9] == '(') {
stringCpy[9] = (char) NULL;
stringCpy[9] = 0;
addrDataCmd = &stringCpy[10];
} else
return(0);
@@ -678,7 +673,7 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr)
return(0);
if(data[strlen(data)-1] != ')')
return(0);
data[strlen(data)-1] = (char) NULL;
data[strlen(data)-1] = '\0';
dacRdWrPtr->type = DACRDWR_TYPE_WR;
SSCANF(addr, "%i", &dacRdWrPtr->addr);
SSCANF(data, "%i", &dacRdWrPtr->data);
@@ -691,7 +686,7 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr)
return(0);
if(data[strlen(data)-1] != ')')
return(0);
data[strlen(data)-1] = (char) NULL;
data[strlen(data)-1] = 0;
dacRdWrPtr->type = DACRDWR_TYPE_WRMOD_POP;
SSCANF(addr, "%i", &dacRdWrPtr->addr);
SSCANF(mask, "%i", &dacRdWrPtr->mask);
@@ -705,7 +700,7 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr)
return(0);
if(data[strlen(data)-1] != ')')
return(0);
data[strlen(data)-1] = (char) NULL;
data[strlen(data)-1] = 0;
dacRdWrPtr->type = DACRDWR_TYPE_RDMODWR;
SSCANF(addr, "%i", &dacRdWrPtr->addr);
SSCANF(mask, "%i", &dacRdWrPtr->mask);
@@ -722,7 +717,7 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr)
return(0);
if(data[strlen(data)-1] != ')')
return(0);
data[strlen(data)-1] = (char) NULL;
data[strlen(data)-1] = 0;
SSCANF(addr, "%i", &dacRdWrPtr->addr);
SSCANF(data, "%i", &dacRdWrPtr->data);
}
@@ -799,7 +794,7 @@ static int sst1InitParseSetVideoString(char *string, sst1InitDacStruct *dacBase)
return(0);
dacSetVideoPtr = dacSetVideoPtr->nextSetVideo;
}
dacSetVideoPtr->nextSetVideo = (sst1InitDacSetVideoStruct *) NULL;
dacSetVideoPtr->nextSetVideo = NULL;
/* Width */
SSCANF(dacRdWrCmd, "%i", &dacSetVideoPtr->width);
/* Height */
@@ -833,7 +828,7 @@ static int sst1InitParseSetVideoString(char *string, sst1InitDacStruct *dacBase)
return(0);
dacRdWrPtr = dacRdWrPtr->nextRdWr;
}
dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL;
dacRdWrPtr->nextRdWr = NULL;
if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr))
return(0);
cntr++;
@@ -873,8 +868,7 @@ static int sst1InitParseSetMemClkString(char *string,
return(0);
dacSetMemClkPtr = dacSetMemClkPtr->nextSetMemClk;
}
dacSetMemClkPtr->nextSetMemClk = (sst1InitDacSetMemClkStruct *)
NULL;
dacSetMemClkPtr->nextSetMemClk = NULL;
/* Frequency */
SSCANF(dacRdWrCmd, "%i", &dacSetMemClkPtr->frequency);
@@ -897,7 +891,7 @@ static int sst1InitParseSetMemClkString(char *string,
return(0);
dacRdWrPtr = dacRdWrPtr->nextRdWr;
}
dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL;
dacRdWrPtr->nextRdWr = NULL;
if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr))
return(0);
cntr++;
@@ -937,8 +931,7 @@ static int sst1InitParseSetVideoModeString(char *string,
return(0);
dacSetVideoModePtr = dacSetVideoModePtr->nextSetVideoMode;
}
dacSetVideoModePtr->nextSetVideoMode =
(sst1InitDacSetVideoModeStruct *) NULL;
dacSetVideoModePtr->nextSetVideoMode = NULL;
/* video16BPP */
SSCANF(dacRdWrCmd, "%i", &dacSetVideoModePtr->video16BPP);
@@ -961,7 +954,7 @@ static int sst1InitParseSetVideoModeString(char *string,
return(0);
dacRdWrPtr = dacRdWrPtr->nextRdWr;
}
dacRdWrPtr->nextRdWr = (sst1InitDacRdWrStruct *) NULL;
dacRdWrPtr->nextRdWr = NULL;
if(!sst1InitParseDacRdWr(dacRdWrCmd, dacRdWrPtr))
return(0);
cntr++;

View File

@@ -17,7 +17,6 @@
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
**
** Print functions for SST-1 Initialization routines
*/
#ifdef _MSC_VER

View File

@@ -17,7 +17,6 @@
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
**
** Initialization code for initializing scanline interleaving
**
*/

View File

@@ -196,8 +196,7 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber,
FxU32 deviceID; // 0x0002 - Look for a Voodoo2 board (0xFFFF - Find any 3Dfx board)
FxU32 sizeOfCard = 0x1000000; // 16 MBytes of addr space for SST-1
FxU32 *sstbase;
FxU32 n;
FxU32 j;
FxU32 j, n;
FxU32 sstv2_noremap = 0;
if( GETENV( ("SSTV2_DEVICEID") ) )

View File

@@ -17,7 +17,6 @@
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
**
** Utility routines for SST-1 Initialization code
**
*/

View File

@@ -17,7 +17,6 @@
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
**
** Initialization code for initializing SST-1 video unit
**
*/

View File

@@ -104,7 +104,6 @@ static LPDIRECTDRAW2 lpDD = NULL;
static LPDIRECTDRAW lpDD1 = NULL;
FxBool
ErrorMessage(HWND hWnd, char *err)
{
@@ -114,7 +113,6 @@ ErrorMessage(HWND hWnd, char *err)
} /* ErrorMessage */
/*
* Takes a DirectDraw Surface object (LPDIRECTDRAWSURFACE), looks up its
* description (DDSURFACEDESC), and returns a pointer to the surface and its
@@ -141,7 +139,6 @@ _dxSurfaceToBufDesc(LPDIRECTDRAWSURFACE lpSurf, InitBufDesc_t *pDesc)
} /* _dxSurfaceToBufDesc */
/*
* Convert front, back and aux surfaces from DDraw to Glide bufDescriptors.
*/
@@ -222,7 +219,6 @@ _dxDDrawToGlideDesc(InitBufDesc_t *pDesc)
} /* _dxDDrawToGlideDesc */
/*
* Allocate (or re-allocate for WM_SIZE) buffers from DDraw.
*/
@@ -355,7 +351,6 @@ _dxAllocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc)
GDBG_INFO((80, "_dxAS: Aux Buffer allocated!\n"));
} else {
/* Full screen - Set Exclusive Mode, change resolution, */
GDBG_INFO((80, "_dxAS: Setting Full screen exclusive mode!\n"));
@@ -641,7 +636,6 @@ dxOpen(
return ErrorMessage(hWndApp, "failed dxOpen");
#endif
GDBG_INFO((80, "_dxAllocSurfaces OK!!!\n"));
for (i=0; i< NUM_BUFS; i++) {
@@ -873,7 +867,6 @@ dxOpen(
break;
}
#define WAITLOOP {\
volatile int waitfoo;\
int waitcount;\
@@ -998,5 +991,3 @@ dxSwap(FxU32 code)
{
} /* dxSwap */
#endif /* __DOS32__ || (defined(__WIN32__) && !defined(INIT_ACCESS_DDRAW) */

View File

@@ -513,7 +513,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGrxClk(FxU32 *sstbase)
FxBool sst1InitComputeClkParams(float freq, sst1ClkTimingStruct
*clkTiming)
{
float vcoFreqDivide, freqMultRatio, clkError;
float vcoFreqDivide = 0.0f, freqMultRatio, clkError;
float clkErrorMin;
FxU32 p, n, m, nPlusTwo;
int mPlusTwo;
@@ -547,7 +547,7 @@ FxBool sst1InitComputeClkParams(float freq, sst1ClkTimingStruct
freqMultRatio = (freq * vcoFreqDivide) * (float) 0.06984216;
/* Calculate proper N and M parameters which yield the lowest error */
clkErrorMin = (float) 9999.; n = 0;
clkErrorMin = (float) 9999.; n = 0; m = 0;
for(nPlusTwo = 3; nPlusTwo < 32; nPlusTwo++) {
#ifdef DIRECTX
mPlusTwo = FTOL( (((float) nPlusTwo * freqMultRatio) + (float) 0.5) );

View File

@@ -96,7 +96,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGammaRGB(FxU32 *sstbase, double gammaR,
FxU32 gammaTableR[256];
FxU32 gammaTableG[256];
FxU32 gammaTableB[256];
FxBool sstVideoIsReset;
FxBool sstVideoIsReset = FXFALSE;
static FxBool calledBefore = FXFALSE;
volatile Sstregs *sst = (Sstregs *) sstbase;
@@ -178,7 +178,7 @@ FxU32 *r, FxU32 *g, FxU32 *b)
FxU32 gammaTableR[256];
FxU32 gammaTableG[256];
FxU32 gammaTableB[256];
FxBool sstVideoIsReset;
FxBool sstVideoIsReset = FXFALSE;
static FxBool calledBefore = FXFALSE;
volatile Sstregs *sst = (Sstregs *) sstbase;

View File

@@ -40,7 +40,7 @@ readAndSum4x4(FxU32 *sstbase, FxU32 x, FxU32 y,
FxU32 *r_sum, FxU32 *g_sum, FxU32 *b_sum)
{
FxU32 rd_x, rd_y;
FxU32 rd_col;
FxU32 rd_col = 0;
FxU32 rd_r, rd_g, rd_b;
volatile Sstregs *sst = (Sstregs *) sstbase;

View File

@@ -292,9 +292,9 @@ sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu,
if(GETENV(("SSTV2_TMU_MEMSIZE"))) {
*TmuMemorySize = ATOI(GETENV(("SSTV2_TMU_MEMSIZE")));
// If user specifies 2 MBytes on a 4 MBytes board, disable the
// second RAS so that apps which may incorrectly store data in the
// upper 2 Mbytes will not function properly...
/* If user specifies 2 MBytes on a 4 MBytes board, disable the
* second RAS so that apps which may incorrectly store data in the
* upper 2 Mbytes will not function properly... */
if (*TmuMemorySize == 2) {
info->tmuInit0[tmu] &= ~SST_EN_TEX_MEM_SECOND_RAS;
sst1InitIdle(sstbase);
@@ -359,8 +359,7 @@ sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
} else {
/* Get TMU memory size */
info->tmuRevision = info->tmuConfig & 0x7;
if(sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]) ==
FXFALSE)
if(sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]) == FXFALSE)
return(FXFALSE);
}
@@ -368,7 +367,7 @@ sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
if (info->tmuConfig & FXBIT(6)) { /* if TMU 1 exists */
info->numberTmus++; /* increment TMU count */
trev = (info->tmuConfig>>7) & 0x7; /* get its revision */
#if 0 // Ignore for now...
#if 0 /* Ignore for now... */
if (info->tmuRevision != trev) {
INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n"));
return(FXFALSE);
@@ -380,7 +379,7 @@ sst1InitGetTmuInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
if (info->tmuConfig & FXBIT(13)) { /* if TMU 2 exists */
info->numberTmus++; /* increment TMU count */
trev = (info->tmuConfig>>14) & 0x7; /* get its revision */
#if 0 // Ignore for now...
#if 0 /* Ignore for now... */
if (info->tmuRevision != trev) {
INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n"));
return(FXFALSE);
@@ -540,8 +539,7 @@ sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
** been allocated
**
*/
FX_EXPORT FxBool FX_CSTYLE sst1InitGetDeviceInfo(FxU32 *sstbase,
sst1DeviceInfoStruct *info)
FX_EXPORT FxBool FX_CSTYLE sst1InitGetDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
{
FxBool retval;
@@ -602,7 +600,8 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
info->tmuMemSize[0] = 2;
info->tmuMemSize[1] = info->tmuMemSize[0];
info->tmuMemSize[2] = info->tmuMemSize[0];
} else {
}
else {
int i;
for (i=0; i<5; i++) {
@@ -620,9 +619,9 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
if (i == 5)
return(FXFALSE);
}
// Measure silicon performance
sst1InitMeasureSiProcess(sstbase, 0); // measure NAND-tree
sst1InitMeasureSiProcess(sstbase, 1); // measure NOR-tree
/* Measure silicon performance */
sst1InitMeasureSiProcess(sstbase, 0); /* measure NAND-tree */
sst1InitMeasureSiProcess(sstbase, 1); /* measure NOR-tree */
INIT_PRINTF(("sst1DeviceInfo: Board ID: %d\n", info->fbiBoardID));
INIT_PRINTF(("sst1DeviceInfo: FbiConfig:0x%x, TmuConfig:0x%x\n",
@@ -637,12 +636,13 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
INIT_PRINTF((", TMU[2] Memory:%d", info->tmuMemSize[2]));
INIT_PRINTF(("\n"));
if (sst1InitUseVoodooFile == FXTRUE) {
if(iniDac == (sst1InitDacStruct *) NULL)
if(iniDac == NULL)
INIT_PRINTF(("sst1DeviceInfo: Dac Type: Unknown"));
else
INIT_PRINTF(("sst1DeviceInfo: Dac Type: %s %s\n",
iniDac->dacManufacturer, iniDac->dacDevice));
} else {
}
else {
INIT_PRINTF(("sst1DeviceInfo: Dac Type: "));
if(info->fbiVideoDacType == SST_FBI_DACTYPE_ATT)
INIT_PRINTF(("AT&T ATT20C409\n"));

View File

@@ -123,7 +123,6 @@ static LPDIRECTDRAW2 lpDD = NULL;
static LPDIRECTDRAW lpDD1 = NULL;
FxBool
ErrorMessage(HWND hWnd, char *err)
{
@@ -133,7 +132,6 @@ ErrorMessage(HWND hWnd, char *err)
} /* ErrorMessage */
/*
* Takes a DirectDraw Surface object (LPDIRECTDRAWSURFACE), looks up its
* description (DDSURFACEDESC), and returns a pointer to the surface and its
@@ -160,7 +158,6 @@ _dxSurfaceToBufDesc(LPDIRECTDRAWSURFACE lpSurf, InitBufDesc_t *pDesc)
} /* _dxSurfaceToBufDesc */
/*
* Convert front, back and aux surfaces from DDraw to Glide bufDescriptors.
*/
@@ -241,7 +238,6 @@ _dxDDrawToGlideDesc(InitBufDesc_t *pDesc)
} /* _dxDDrawToGlideDesc */
/*
* Allocate (or re-allocate for WM_SIZE) buffers from DDraw.
*/
@@ -374,7 +370,6 @@ _dxAllocSurfaces(int xRes, int yRes, int vRefresh, InitBufDesc_t *pDesc)
GDBG_INFO((80, "_dxAS: Aux Buffer allocated!\n"));
} else {
/* Full screen - Set Exclusive Mode, change resolution, */
GDBG_INFO((80, "_dxAS: Setting Full screen exclusive mode!\n"));
@@ -660,7 +655,6 @@ dxOpen(
return ErrorMessage(hWndApp, "failed dxOpen");
#endif
GDBG_INFO((80, "_dxAllocSurfaces OK!!!\n"));
for (i=0; i< NUM_BUFS; i++) {
@@ -901,7 +895,6 @@ dxOpen(
break;
}
#define WAITLOOP {\
volatile int waitfoo;\
int waitcount;\
@@ -1026,5 +1019,3 @@ dxSwap(FxU32 code)
{
} /* dxSwap */
#endif /* __DOS32__ || (defined(__WIN32__) && !defined(INIT_ACCESS_DDRAW) */

View File

@@ -476,8 +476,7 @@ sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
** been allocated
**
*/
FX_EXPORT FxBool FX_CSTYLE sst1InitGetDeviceInfo(FxU32 *sstbase,
sst1DeviceInfoStruct *info)
FX_EXPORT FxBool FX_CSTYLE sst1InitGetDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
{
FxBool retval;