Fix 2 sst1 bugs accidently introduced by warning fixes

This commit is contained in:
jwrdegoede
2005-06-16 18:58:33 +00:00
parent a072e43eb1
commit 759cde16ea
10 changed files with 46 additions and 31 deletions

View File

@@ -186,7 +186,7 @@ main (int argc, char **argv)
NEWLINE;
HEADER ("GlideRoot");
#if GL_X86
#if defined(__WATCOMC__) || defined(__MSC__) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))
OFFSET (gr,p6Fencer,"p6Fencer\t");
#endif
OFFSET (gr,current_sst,"current_sst\t");

View File

@@ -188,7 +188,7 @@ main (int argc, char **argv)
#endif
HEADER ("GlideRoot");
#if GL_X86
#if defined(__WATCOMC__) || defined(__MSC__) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))
OFFSET (gr,p6Fencer,"p6Fencer\t");
#endif
OFFSET (gr,current_sst,"current_sst\t");

View File

@@ -191,7 +191,7 @@ main (int argc, char **argv)
#endif
HEADER ("GlideRoot");
#if GL_X86
#if defined(__WATCOMC__) || defined(__MSC__) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))
OFFSET (gr,p6Fencer,"p6Fencer\t");
#endif
OFFSET (gr,current_sst,"current_sst\t");

View File

@@ -15,7 +15,7 @@
# FX_GLIDE_HW build for the given ASIC (sst1, sst96).
# default = sst1
# OPTFLAGS pass given optimization flags to compiler
# default = -O2 -ffastmath (+ -mcpu=pentium if USE_X86=1)
# default = -O1 -ffastmath (+ -mcpu=pentium if USE_X86=1)
# DEBUG=1 enable debugging checks and messages
# default = no
# USE_X86=1 use assembler triangle specializations!
@@ -120,10 +120,10 @@ CFLAGS += $(CDEFS)
ifeq ($(USE_X86),1)
CFLAGS += -DGL_X86
OPTFLAGS ?= -O2 -ffast-math -mcpu=pentium
OPTFLAGS ?= -O1 -ffast-math -mcpu=pentium
else
CFLAGS += -DGLIDE_USE_C_TRISETUP
OPTFLAGS ?= -O2 -ffast-math
OPTFLAGS ?= -O1 -ffast-math
endif
# optflags

View File

@@ -152,7 +152,7 @@ main (int argc, char **argv)
NEWLINE;
HEADER ("GlideRoot");
#if GL_X86
#if defined(__WATCOMC__) || defined(__MSC__) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))
OFFSET (gr,p6Fencer,"p6Fencer\t");
#endif
OFFSET (gr,current_sst,"current_sst\t");

View File

@@ -19,6 +19,9 @@
**
** $Header$
** $Log$
** Revision 1.1.2.4 2005/06/09 18:32:35 jwrdegoede
** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc.
**
** Revision 1.1.2.3 2005/05/10 11:27:23 jwrdegoede
** sst1 gcc4 compile fixes
**
@@ -115,7 +118,7 @@ static void grVpSetVertexParameter(float oow, const void *v1)
struct dataList_s *dlp;
int i;
float *fp, dp;
int k;
int k = 0;
dlp = gc->dataList;
i = dlp->i;
@@ -251,7 +254,14 @@ static void grVpSetVertexParameter(float oow, const void *v1)
i = dlp->i;
}
else {
dp = FARRAY(v1,i) * oow * gc->state.tmu_config[1].st_scale[0 /* k ?? */];
/* hmm this caused a k may be used unitialised warning, which is
silenced for now by initialising k with 0 at decleration. Problably
k is always 2 in this scenario because most likely when
(gc->state.paramIndex & STATE_REQUIRES_ST_TMU1) is true then
(gc->state.paramIndex & STATE_REQUIRES_ST_TMU0) is also true and
the for (k = 0; k < 2; k++) loop in the
(gc->state.paramIndex & STATE_REQUIRES_ST_TMU0) case leaves k at 2 */
dp = FARRAY(v1,i) * oow * gc->state.tmu_config[1].st_scale[k];
GR_SETF( fp[0], dp );
dlp++;
i = dlp->i;

View File

@@ -19,6 +19,9 @@
**
** $Header$
** $Log$
** Revision 1.1.2.6 2005/06/09 18:32:35 jwrdegoede
** Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc.
**
** Revision 1.1.2.5 2005/05/25 08:51:52 jwrdegoede
** Add #ifdef GL_X86 around x86 specific code
**
@@ -949,9 +952,9 @@ _grVpDrawTriangle( const void *va, const void *vb, const void *vc )
snap_yb = tmp_snap_yb = (volatile float) (*((const float *)vb + yindex) * oowb * gc->state.Viewport.hheight + gc->state.Viewport.oy + SNAP_BIAS);
snap_yc = tmp_snap_yc = (volatile float) (*((const float *)vc + yindex) * oowc * gc->state.Viewport.hheight + gc->state.Viewport.oy + SNAP_BIAS);
ay.i = tmp_snap_ya;
by.i = tmp_snap_yb;
cy.i = tmp_snap_yc;
ay.f = tmp_snap_ya;
by.f = tmp_snap_yb;
cy.f = tmp_snap_yc;
if (ay.i < 0) ay.i ^= 0x7FFFFFFF;
if (by.i < 0) by.i ^= 0x7FFFFFFF;
if (cy.i < 0) cy.i ^= 0x7FFFFFFF;

View File

@@ -17,7 +17,7 @@
# XPATH specify X libraries path; needed for sst96.
# default = /usr/X11R6/lib (sst96 only)
# OPTFLAGS pass given optimization flags to compiler
# default = -O2 -ffastmath (+ -mcpu=pentium if USE_X86=1)
# default = -O1 -ffastmath (+ -mcpu=pentium if USE_X86=1)
# DEBUG=1 enable debugging checks and messages
# default = no
# USE_X86=1 use assembler triangle specializations!
@@ -122,10 +122,10 @@ CFLAGS += $(CDEFS)
ifeq ($(USE_X86),1)
CFLAGS += -DGL_X86
OPTFLAGS ?= -O2 -ffast-math -mcpu=pentium
OPTFLAGS ?= -O1 -ffast-math -mcpu=pentium
else
CFLAGS += -DGLIDE_USE_C_TRISETUP
OPTFLAGS ?= -O2 -ffast-math
OPTFLAGS ?= -O1 -ffast-math
endif
# optflags

View File

@@ -55,6 +55,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1)
FxU32 masterPVOutClkDel, slavePVOutClkDel;
FxU32 pciFifoLwm, memFifoLwm;
FxU32 clkFreqMaster;
int i;
/* Check to make sure master and slave are installed properly */
/* Master should have a clock frequency setting of 54 MHz */
@@ -144,14 +145,14 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1)
slaveVOutClkDel = 0;
slavePVOutClkDel = 3;
if(GETENV(("SST_SLIS_VOUT_CLKDEL")) &&
(SSCANF(GETENV(("SST_SLIS_VOUT_CLKDEL")), "%i", &n) == 1))
slaveVOutClkDel = n;
(SSCANF(GETENV(("SST_SLIS_VOUT_CLKDEL")), "%i", &i) == 1))
slaveVOutClkDel = i;
if(GETENV(("SST_SLIS_PVOUT_CLKDEL")) &&
(SSCANF(GETENV(("SST_SLIS_PVOUT_CLKDEL")), "%i", &n) == 1))
slavePVOutClkDel = n;
(SSCANF(GETENV(("SST_SLIS_PVOUT_CLKDEL")), "%i", &i) == 1))
slavePVOutClkDel = i;
if(GETENV(("SST_SLIS_VIN_CLKDEL")) &&
(SSCANF(GETENV(("SST_SLIS_VIN_CLKDEL")), "%i", &n) == 1))
slaveVInClkDel = n;
(SSCANF(GETENV(("SST_SLIS_VIN_CLKDEL")), "%i", &i) == 1))
slaveVInClkDel = i;
INIT_PRINTF(("sst1InitSli(): slaveVinClkdel=0x%x, slaveVOutClkDel=0x%x, slavePVOutClkDel=0x%x\n",
slaveVInClkDel, slaveVOutClkDel, slavePVOutClkDel));
if(sst1CurrentBoard->fbiVideo16BPP)
@@ -268,14 +269,14 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1)
masterVOutClkDel = 0;
masterPVOutClkDel = 3;
if(GETENV(("SST_SLIM_VOUT_CLKDEL")) &&
(SSCANF(GETENV(("SST_SLIM_VOUT_CLKDEL")), "%i", &n) == 1))
masterVOutClkDel = n;
(SSCANF(GETENV(("SST_SLIM_VOUT_CLKDEL")), "%i", &i) == 1))
masterVOutClkDel = i;
if(GETENV(("SST_SLIM_PVOUT_CLKDEL")) &&
(SSCANF(GETENV(("SST_SLIM_PVOUT_CLKDEL")), "%i", &n) == 1))
masterPVOutClkDel = n;
(SSCANF(GETENV(("SST_SLIM_PVOUT_CLKDEL")), "%i", &i) == 1))
masterPVOutClkDel = i;
if(GETENV(("SST_SLIM_VIN_CLKDEL")) &&
(SSCANF(GETENV(("SST_SLIM_VIN_CLKDEL")), "%i", &n) == 1))
masterVInClkDel = n;
(SSCANF(GETENV(("SST_SLIM_VIN_CLKDEL")), "%i", &i) == 1))
masterVInClkDel = i;
INIT_PRINTF(("sst1InitSli(): masterVinClkdel=0x%x, masterVOutClkDel=0x%x, masterPVOutClkDel=0x%x\n",
masterVInClkDel, masterVOutClkDel, masterPVOutClkDel));
if(sst1CurrentBoard->fbiVideo16BPP)
@@ -377,8 +378,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1)
FxU32 clearColor = 0x0;
if(GETENV(("SST_VIDEO_CLEARCOLOR")) &&
(SSCANF(GETENV(("SST_VIDEO_CLEARCOLOR")), "%i", &n) == 1))
clearColor = n;
(SSCANF(GETENV(("SST_VIDEO_CLEARCOLOR")), "%i", &i) == 1))
clearColor = i;
ISET(sstMaster->c1, clearColor);
ISET(sstMaster->c0, clearColor);
ISET(sstMaster->zaColor, 0x0);

View File

@@ -298,6 +298,7 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
FxU32 ft_clk_del, tf0_clk_del, tf1_clk_del, tf2_clk_del;
sst1ClkTimingStruct sstGrxClk;
volatile Sstregs *sst = (Sstregs *) sstbase;
int i;
if(!sst)
return(FXFALSE);
@@ -346,8 +347,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
/* .6 micron */
ft_clk_del = 0xa; /* Okay for 16 MHz startup... */
if(GETENV(("SST_PFT_CLK_DEL")) &&
(SSCANF(GETENV(("SST_PFT_CLK_DEL")), "%i", &n) == 1))
ft_clk_del = n;
(SSCANF(GETENV(("SST_PFT_CLK_DEL")), "%i", &i) == 1))
ft_clk_del = i;
INIT_PRINTF(("sst1InitRegisters(): Setting PRELIM FT-CLK delay to 0x%x...\n", ft_clk_del));
ISET(sst->fbiInit3,
(SST_FBIINIT3_DEFAULT & ~(SST_FT_CLK_DEL_ADJ | SST_TF_FIFO_THRESH)) |