Ignore:
Timestamp:
Sep 5, 2001, 4:31:14 PM (24 years ago)
Author:
bird
Message:

Added $Id:$ keyword.

Location:
trunk/src/opengl/glide/cvg/init
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/opengl/glide/cvg/init/dac.c

    r2888 r6653  
     1/* $Id: dac.c,v 1.2 2001-09-05 14:30:35 bird Exp $ */
    12/*
    23** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
    34** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
    45** 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
    89** 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**
    1112** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
    1213** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
     
    1415** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
    1516** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
    16 ** THE UNITED STATES. 
    17 ** 
     17** THE UNITED STATES.
     18**
    1819** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
    1920**
    2021**
    21 ** $Revision: 1.1 $
    22 ** $Date: 2000-02-25 00:37:51 $
     22** $Revision: 1.2 $
     23** $Date: 2001-09-05 14:30:35 $
    2324**
    2425** Initialization code for initializing supported SST-1 DACs
     
    4546**  Read external DAC registers
    4647**  NOTE: The video unit of FBI must be in reset before calling this routine.
    47 **        The rendering engines of FBI and TREX must be idle before calling 
     48**        The rendering engines of FBI and TREX must be idle before calling
    4849**        this routine.
    4950**        fbiInit23 register remapping (PCI config. initEnable[2]=1) must be
     
    7879**  Write to external DAC registers
    7980**  NOTE: The video unit of FBI must be in reset before calling this routine.
    80 **        The rendering engines of FBI and TREX must be idle before calling 
     81**        The rendering engines of FBI and TREX must be idle before calling
    8182**        this routine.
    8283**
     
    613614    {
    614615        float calc;
    615        
     616
    616617        calc = ((float) 14.318 * (float) (m + 2)) /
    617618            ((float) (n + 2) * vcoFreqDivide);
     
    694695        vcoFreq = ((float) 14.31818 * (float) (clkTiming->clkTiming_M + 2)) /
    695696          ((float) (clkTiming->clkTiming_N + 2));
    696        
     697
    697698        printf("freq:%.3f  calc:%.3f\n", freq, clkFreq);
    698699        printf("m:%d p:%d n:%d vco:%.2f\n", clkTiming->clkTiming_M,
  • trunk/src/opengl/glide/cvg/init/gamma.c

    r2888 r6653  
    11/*-*-c++-*-*/
     2/* $Id: gamma.c,v 1.2 2001-09-05 14:30:36 bird Exp $ */
    23/*
    34** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
    45** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
    56** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
    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 
     7** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
     8** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
     9** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
    910** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
    10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 
    11 ** 
     11** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
     12**
    1213** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
    1314** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
     
    1516** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
    1617** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
    17 ** THE UNITED STATES. 
    18 ** 
     18** THE UNITED STATES.
     19**
    1920** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
    2021**
    2122**
    22 ** $Revision: 1.1 $
    23 ** $Date: 2000-02-25 00:37:51 $
     23** $Revision: 1.2 $
     24** $Date: 2001-09-05 14:30:36 $
    2425**
    2526** Initialization code for loading SST-1 gamma tables
     
    149150        FxU32 gcG = gammaTableG[(x<<3)];
    150151        FxU32 gcB = gammaTableB[(x<<3)];
    151         ISET(sst->clutData, ((x<<SST_CLUTDATA_INDEX_SHIFT) | 
     152        ISET(sst->clutData, ((x<<SST_CLUTDATA_INDEX_SHIFT) |
    152153                         (gcR<<SST_CLUTDATA_RED_SHIFT) |
    153154                         (gcG<<SST_CLUTDATA_GREEN_SHIFT) |
     
    217218        FxU32 gcG = gammaTableG[(x)];
    218219        FxU32 gcB = gammaTableB[(x)];
    219         ISET(sst->clutData, ((x<<SST_CLUTDATA_INDEX_SHIFT) | 
     220        ISET(sst->clutData, ((x<<SST_CLUTDATA_INDEX_SHIFT) |
    220221                         (gcR<<SST_CLUTDATA_RED_SHIFT) |
    221222                         (gcG<<SST_CLUTDATA_GREEN_SHIFT) |
  • trunk/src/opengl/glide/cvg/init/gdebug.c

    r2888 r6653  
    11/*-*-c++-*-*/
     2/* $Id: gdebug.c,v 1.2 2001-09-05 14:30:37 bird Exp $ */
    23#include "vxd.h"
    34
     
    67** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
    78** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
    8 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 
    9 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 
    10 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 
     9** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
     10** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
     11** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
    1112** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
    12 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 
    13 ** 
     13** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
     14**
    1415** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
    1516** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
     
    1718** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
    1819** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
    19 ** THE UNITED STATES. 
    20 ** 
     20** THE UNITED STATES.
     21**
    2122** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
    2223**
    23 ** $Revision: 1.1 $
    24 ** $Date: 2000-02-25 00:37:51 $
     24** $Revision: 1.2 $
     25** $Date: 2001-09-05 14:30:37 $
    2526*/
    2627
     
    6667#endif
    6768
    68 static char *gdbg_myname = "gd";                // default library name
    69 static char gdbg_debuglevel[GDBG_MAX_LEVELS];   // array of debuglevel controls
     69static char *gdbg_myname = "gd";        // default library name
     70static char gdbg_debuglevel[GDBG_MAX_LEVELS];   // array of debuglevel controls
    7071
    7172static long gdbg_errors = 0;
     
    8283{
    8384    if (level >= GDBG_MAX_LEVELS)
    84         level = GDBG_MAX_LEVELS - 1;
     85    level = GDBG_MAX_LEVELS - 1;
    8586
    8687    gdbg_debuglevel[level] = value;
     
    8990
    9091#ifndef KERNEL_NT
    91 // we need to call a kernal printf. 
     92// we need to call a kernal printf.
    9293extern int __cdecl klvfprintf(FILE        *stream,
    9394                              const char  *format,
     
    9596#endif
    9697
    97 static FILE *gdbg_msgfile;      // GDBG info/error file
     98static FILE *gdbg_msgfile;  // GDBG info/error file
    9899#else /* #ifdef KERNEL */
    99100
    100 static FILE *gdbg_msgfile = NULL; /*stdout;*/   // GDBG info/error file
     101static FILE *gdbg_msgfile = NULL; /*stdout;*/   // GDBG info/error file
    101102
    102103//----------------------------------------------------------------------
     
    107108    int r0,r1,pos;
    108109
    109     sscanf(buf,"%i%n",&r0,&pos);                // parse the first integer
    110     if (buf[pos]=='-' || buf[pos]==':') {       // if there's a second
    111         buf += pos+1;
    112         sscanf(buf,"%i%n",&r1,&pos);            // then parse it
     110    sscanf(buf,"%i%n",&r0,&pos);        // parse the first integer
     111    if (buf[pos]=='-' || buf[pos]==':') {   // if there's a second
     112    buf += pos+1;
     113    sscanf(buf,"%i%n",&r1,&pos);        // then parse it
    113114    }
    114115    else
    115         r1 = r0;
    116 
    117     if (r0 < 0) r0 = 0;                         // sanity checks
     116    r1 = r0;
     117
     118    if (r0 < 0) r0 = 0;             // sanity checks
    118119    if (r1 >= GDBG_MAX_LEVELS) r1 = GDBG_MAX_LEVELS-1;
    119120    if (r1 < r0) r1 = r0;
    120121
    121     while (r0 <= r1)                            // now set the debuglevel levels
    122         gdbg_debuglevel[r0++] = val;
    123 
    124     return buf + pos;                           // and return rest of string
     122    while (r0 <= r1)                // now set the debuglevel levels
     123    gdbg_debuglevel[r0++] = val;
     124
     125    return buf + pos;               // and return rest of string
    125126}
    126127
     
    131132
    132133    do {
    133         if (env[0] == ',')              // advance past commas
    134             env++;
    135         if (env[0] == '+')              // if + then enable a range
    136             env = setRange(env+1,1);
    137         else if (env[0] == '-')         // if - then disable a range
    138             env = setRange(env+1,0);
    139         else {                          // else just a number
    140             if (sscanf(env,"%i%n",&level,&pos) <= 0) return;
    141             if (pos==0) return;         // oops, guess not
    142             if (level >= GDBG_MAX_LEVELS) level = GDBG_MAX_LEVELS-1;
    143             while (level >= 0)          // enable the range [0,#]
    144                 gdbg_debuglevel[level--] = 1;
    145             env += pos;
    146         }
     134    if (env[0] == ',')      // advance past commas
     135        env++;
     136    if (env[0] == '+')      // if + then enable a range
     137        env = setRange(env+1,1);
     138    else if (env[0] == '-')     // if - then disable a range
     139        env = setRange(env+1,0);
     140    else {              // else just a number
     141        if (sscanf(env,"%i%n",&level,&pos) <= 0) return;
     142        if (pos==0) return;     // oops, guess not
     143        if (level >= GDBG_MAX_LEVELS) level = GDBG_MAX_LEVELS-1;
     144        while (level >= 0)      // enable the range [0,#]
     145        gdbg_debuglevel[level--] = 1;
     146        env += pos;
     147    }
    147148    } while (env[0] == ',');
    148149}
     
    153154gdbg_init(void)
    154155{
    155     static int done=0;                  // only execute once
     156    static int done=0;          // only execute once
    156157    char *env;
    157158
     
    163164
    164165#if __MWERKS__
    165         SIOUXSettings.standalone                                = false;
    166         SIOUXSettings.setupmenus                                = false;
    167         SIOUXSettings.autocloseonquit   = true;
    168         SIOUXSettings.asktosaveonclose  = false;
    169 #endif     
    170    
     166    SIOUXSettings.standalone                = false;
     167    SIOUXSettings.setupmenus                = false;
     168    SIOUXSettings.autocloseonquit   = true;
     169    SIOUXSettings.asktosaveonclose  = false;
     170#endif
     171
    171172#ifdef KERNEL
    172         // put code in here to set the default level
    173     gdbg_debuglevel[0] = 1;             // always enable level 0
    174     gdbg_debuglevel[120] = 1;           // always enable level 0
     173    // put code in here to set the default level
     174    gdbg_debuglevel[0] = 1;     // always enable level 0
     175    gdbg_debuglevel[120] = 1;       // always enable level 0
    175176    done = 1;
    176177    env = 0;
     
    178179#else /* #ifdef KERNEL */
    179180    done = 1;
    180     gdbg_debuglevel[0] = 1;             // always enable level 0
     181    gdbg_debuglevel[0] = 1;     // always enable level 0
    181182    env = GETENV("GDBG_FILE");
    182183    if (env != NULL) GDBG_SET_FILE(env);
     
    193194  gdbg_info(1,"gdbg_shutdown()\n");
    194195#ifndef KERNEL
    195   if (gdbg_msgfile != stdout) { // close any existing output file
     196  if (gdbg_msgfile != stdout) { // close any existing output file
    196197#if USE_DEBUG_STRING
    197     if (!UseDebugString) 
     198    if (!UseDebugString)
    198199#endif /* USE_DEBUG_STRING */
    199200      fclose(gdbg_msgfile);
     
    286287    __asm mov   ebx, format;
    287288    MyPrintf();
    288 #endif /* #ifndef KERNEL */   
     289#endif /* #ifndef KERNEL */
    289290
    290291}
     
    307308
    308309    if (!gdbg_debuglevel[level>=GDBG_MAX_LEVELS ? GDBG_MAX_LEVELS-1 : level])
    309         return(0);
     310    return(0);
    310311#ifndef KERNEL
    311312    va_start(args, format);
     
    341342
    342343    if (!gdbg_debuglevel[level>=GDBG_MAX_LEVELS ? GDBG_MAX_LEVELS-1 : level])
    343         return(0);
     344    return(0);
    344345#ifndef KERNEL
    345346    va_start(args, format);
     
    406407    va_start(args, format);
    407408    sprintf(newformat, "%s error (%s): ", gdbg_myname,kind);
    408     strcat(newformat,format);           // add a preamble to message
     409    strcat(newformat,format);       // add a preamble to message
    409410    gdbg_vprintf(newformat,args);
    410     gdbg_errors++;                      // increment the error counter
    411     va_end(args);
    412    
     411    gdbg_errors++;          // increment the error counter
     412    va_end(args);
     413
    413414    {
    414415       int i;
    415416       const int count = sizeof(errorProcList) / sizeof(errorProcList[0]);
    416        
     417
    417418       for(i = 0; i < count; i++) {
    418419          if (errorProcList[i] != NULL) {
     
    466467  FILE *outf;
    467468
    468   if (gdbg_msgfile != stdout) { // close any existing output file
     469  if (gdbg_msgfile != stdout) { // close any existing output file
    469470    fclose(gdbg_msgfile);
    470471    gdbg_msgfile = stdout;
     
    475476    gdbg_msgfile = (FILE *) 1;
    476477    UseDebugString = 1;
    477   } else 
     478  } else
    478479#endif /* USE_DEBUG_STRING */
    479480  {
    480     outf = fopen(name,"w");             // open up a new one
     481    outf = fopen(name,"w");     // open up a new one
    481482    if (outf) gdbg_msgfile = outf;
    482483  }
     
    485486#else /* #ifndef KERNEL */
    486487  return 0;
    487 #endif /* #ifndef KERNEL */   
    488 }
     488#endif /* #ifndef KERNEL */
     489}
  • trunk/src/opengl/glide/cvg/init/info.c

    r2888 r6653  
     1/* $Id: info.c,v 1.2 2001-09-05 14:30:37 bird Exp $ */
    12/*
    23** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
    34** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
    45** 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
    89** 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**
    1112** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
    1213** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
     
    1415** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
    1516** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
    16 ** THE UNITED STATES. 
    17 ** 
     17** THE UNITED STATES.
     18**
    1819** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
    1920**
    2021**
    21 ** $Revision: 1.1 $
    22 ** $Date: 2000-02-25 00:37:52 $
     22** $Revision: 1.2 $
     23** $Date: 2001-09-05 14:30:37 $
    2324**
    2425** Routines to detect memory size, strapping pin, and other initialization
     
    4344#define XY_ONE (1<<SST_XY_FRACBITS)
    4445
    45 static FxBool 
    46 readAndSum4x4(FxU32 *sstbase, FxU32 x, FxU32 y, 
    47                 FxU32 *r_sum, FxU32 *g_sum, FxU32 *b_sum)
     46static FxBool
     47readAndSum4x4(FxU32 *sstbase, FxU32 x, FxU32 y,
     48            FxU32 *r_sum, FxU32 *g_sum, FxU32 *b_sum)
    4849{
    4950    FxU32 rd_x, rd_y;
     
    5657    sst1InitIdle(sstbase);
    5758    if (x & 1) {
    58         INIT_PRINTF(("ERROR: readAndSum4x4 must have an even X (%d)\n", x));
    59         return(FXFALSE);
     59    INIT_PRINTF(("ERROR: readAndSum4x4 must have an even X (%d)\n", x));
     60    return(FXFALSE);
    6061    }
    6162
     
    6566    *b_sum = 0;
    6667
    67     for (rd_y = 0; rd_y < 4; rd_y++) {          /* read 4 scanlines */
    68         for (rd_x = 0; rd_x < 4; rd_x ++) {
    69             if ((rd_x & 1)==0) {                /* read 2 pixels at a time */
    70                 rd_col =
    71                   IGET(sstbase[(SST_LFB_ADDR + (y+rd_y)*2048 + (x+rd_x)*2) >> 2]);
    72             }
    73             else rd_col >>= 16;
    74             rd_r = ((rd_col >> 11) & 0x1f) << 3;
    75             rd_g = ((rd_col >>  5) & 0x3f) << 2;
    76             rd_b = ((rd_col >>  0) & 0x1f) << 3;
    77             *r_sum += rd_r;
    78             *g_sum += rd_g;
    79             *b_sum += rd_b;
    80             INIT_INFO((4,"%d,%d = rd_col: 0x%04x   rgb: %02x %02x %02x\n",
    81                     rd_x, rd_y, (rd_col & 0xffff), rd_r, rd_g, rd_b));
    82         }
     68    for (rd_y = 0; rd_y < 4; rd_y++) {      /* read 4 scanlines */
     69    for (rd_x = 0; rd_x < 4; rd_x ++) {
     70        if ((rd_x & 1)==0) {        /* read 2 pixels at a time */
     71        rd_col =
     72          IGET(sstbase[(SST_LFB_ADDR + (y+rd_y)*2048 + (x+rd_x)*2) >> 2]);
     73        }
     74        else rd_col >>= 16;
     75        rd_r = ((rd_col >> 11) & 0x1f) << 3;
     76        rd_g = ((rd_col >>  5) & 0x3f) << 2;
     77        rd_b = ((rd_col >>  0) & 0x1f) << 3;
     78        *r_sum += rd_r;
     79        *g_sum += rd_g;
     80        *b_sum += rd_b;
     81        INIT_INFO((4,"%d,%d = rd_col: 0x%04x   rgb: %02x %02x %02x\n",
     82            rd_x, rd_y, (rd_col & 0xffff), rd_r, rd_g, rd_b));
     83    }
    8384    }
    8485    INIT_INFO((3,"sums:  r_sum=0x%03x  g_sum=0x%03x  b_sum=0x%03x\n",
    85                     *r_sum, *g_sum, *b_sum));
    86         return(FXTRUE);
     86            *r_sum, *g_sum, *b_sum));
     87    return(FXTRUE);
    8788}
    8889
     
    123124    /* init sum array */
    124125    for (r_sum = 0; r_sum <= 0xfff; r_sum++) {
    125         rb_tbl[r_sum] = -1;
    126         g_tbl[r_sum] = -1;
     126    rb_tbl[r_sum] = -1;
     127    g_tbl[r_sum] = -1;
    127128    }
    128129
     
    132133    /* fill sum array */
    133134    for (tst_color = 0; tst_color <= 255; tst_color++) {
    134         INIT_INFO((2,"tst_color=0x%02x\n", tst_color));
    135         ISET(sst->c1, (tst_color << 16) | (tst_color << 8) | tst_color);
    136 
    137         drawTriangle(sst, x,y,36);
    138         if(readAndSum4x4(sstbase, x,y, &r_sum,&g_sum,&b_sum) == FXFALSE)
    139                 return(FXFALSE);
    140 
    141         /* check sums for uniqueness and then store away */
    142         if (r_sum != b_sum) {
    143             INIT_PRINTF(("ERROR:  b_sum=0x%03x  r_sum=0x%03x\n", r_sum, b_sum));
    144                 return(FXFALSE);
    145         }
    146         if (rb_tbl[r_sum] != -1) {
    147             INIT_PRINTF(("ERROR:  non-unique r/b_sum=0x%03x\n", r_sum));
    148                 return(FXFALSE);
    149         }
    150         rb_tbl[r_sum] = tst_color;
    151         if (g_tbl[g_sum] != -1) {
    152             INIT_PRINTF(("ERROR:  non-unique g_sum=0x%03x\n", g_sum));
    153                 return(FXFALSE);
    154         }
    155         g_tbl[g_sum] = tst_color;
    156     }
    157         return(FXTRUE);
     135    INIT_INFO((2,"tst_color=0x%02x\n", tst_color));
     136    ISET(sst->c1, (tst_color << 16) | (tst_color << 8) | tst_color);
     137
     138    drawTriangle(sst, x,y,36);
     139    if(readAndSum4x4(sstbase, x,y, &r_sum,&g_sum,&b_sum) == FXFALSE)
     140        return(FXFALSE);
     141
     142    /* check sums for uniqueness and then store away */
     143    if (r_sum != b_sum) {
     144        INIT_PRINTF(("ERROR:  b_sum=0x%03x  r_sum=0x%03x\n", r_sum, b_sum));
     145        return(FXFALSE);
     146    }
     147    if (rb_tbl[r_sum] != -1) {
     148        INIT_PRINTF(("ERROR:  non-unique r/b_sum=0x%03x\n", r_sum));
     149        return(FXFALSE);
     150    }
     151    rb_tbl[r_sum] = tst_color;
     152    if (g_tbl[g_sum] != -1) {
     153        INIT_PRINTF(("ERROR:  non-unique g_sum=0x%03x\n", g_sum));
     154        return(FXFALSE);
     155    }
     156    g_tbl[g_sum] = tst_color;
     157    }
     158    return(FXTRUE);
    158159}
    159160
     
    164165    if (rb_tbl[r_sum] == -1 || g_tbl[g_sum] == -1 || rb_tbl[b_sum] == -1)
    165166    {
    166         INIT_PRINTF(("ERROR: unDither: invalid color sum\n"));
    167         return(FXFALSE);
     167    INIT_PRINTF(("ERROR: unDither: invalid color sum\n"));
     168    return(FXFALSE);
    168169    }
    169170    *result = (rb_tbl[r_sum] << 16) | (g_tbl[g_sum] << 8) | rb_tbl[b_sum];
    170         return(FXTRUE);
     171    return(FXTRUE);
    171172}
    172173
     
    177178    FxU32 r_sum, g_sum, b_sum;
    178179    SstRegs *sst = (SstRegs *) sstbase;
    179         FxU32 tmuRevision;
     180    FxU32 tmuRevision;
    180181
    181182    /* set trex's (all 3) to output configuration bits */
     
    186187    /* render into the frame buffer */
    187188    ISET(sst->fbzColorPath,
    188           SST_RGBSEL_TREXOUT | SST_CC_PASS | SST_ENTEXTUREMAP);
     189      SST_RGBSEL_TREXOUT | SST_CC_PASS | SST_ENTEXTUREMAP);
    189190    ISET(sst->texBaseAddr, 0);
    190191    ISET(sst->textureMode, SST_AI88 | SST_TC_PASS | SST_TCA_PASS);
     
    193194
    194195    readAndSum4x4(sstbase, x,y, &r_sum,&g_sum,&b_sum);
    195         if(GETENV(("SSTV2_TEXMAP_DISABLE"))) {
    196                 info->tmuConfig = 0x0;
    197         } else {
    198             if(unDither(r_sum,g_sum,b_sum,&info->tmuConfig) == FXFALSE)
    199                         return(FXFALSE);
    200         }
    201 
    202         /////////////////////////
    203         // Get new revision...
    204         /////////////////////////
     196    if(GETENV(("SSTV2_TEXMAP_DISABLE"))) {
     197        info->tmuConfig = 0x0;
     198    } else {
     199        if(unDither(r_sum,g_sum,b_sum,&info->tmuConfig) == FXFALSE)
     200            return(FXFALSE);
     201    }
     202
     203    /////////////////////////
     204    // Get new revision...
     205    /////////////////////////
    205206    ISET(SST_TREX(sst,0)->trexInit1, info->tmuInit1[0] | (1 << 18) |
    206           (5 << SST_TEX_SEND_CONFIG_SEL_SHIFT));
     207      (5 << SST_TEX_SEND_CONFIG_SEL_SHIFT));
    207208    ISET(SST_TREX(sst,1)->trexInit1, info->tmuInit1[1] | (1 << 18));
    208209    ISET(SST_TREX(sst,2)->trexInit1, info->tmuInit1[2] | (1 << 18));
     
    210211    /* render into the frame buffer */
    211212    ISET(sst->fbzColorPath,
    212           SST_RGBSEL_TREXOUT | SST_CC_PASS | SST_ENTEXTUREMAP);
     213      SST_RGBSEL_TREXOUT | SST_CC_PASS | SST_ENTEXTUREMAP);
    213214    ISET(sst->texBaseAddr, 0);
    214215    ISET(sst->textureMode, SST_AI88 | SST_TC_PASS | SST_TCA_PASS);
     
    217218
    218219    readAndSum4x4(sstbase, x,y, &r_sum,&g_sum,&b_sum);
    219         if(unDither(r_sum,g_sum,b_sum,&tmuRevision) == FXFALSE)
    220                 return(FXFALSE);
    221 
    222         info->tmuFab[0] = (tmuRevision >> 4) & 0xf;
    223         info->tmuFab[1] = (tmuRevision >> 12) & 0xf;
    224         info->tmuFab[2] = (tmuRevision >> 20) & 0xf;
    225 
    226         /* Adjust configuration structure for "new" revision ID */
    227         info->tmuConfig &= ~(0x7 | (0x7<<7) | (0x7<<14));
    228         info->tmuConfig |= (((tmuRevision & 0x7) + 3) |
    229           ((((tmuRevision >> 8) & 0x7) + 3) << 7) |
    230           ((((tmuRevision >> 16) & 0x7) + 3) << 14));
     220    if(unDither(r_sum,g_sum,b_sum,&tmuRevision) == FXFALSE)
     221        return(FXFALSE);
     222
     223    info->tmuFab[0] = (tmuRevision >> 4) & 0xf;
     224    info->tmuFab[1] = (tmuRevision >> 12) & 0xf;
     225    info->tmuFab[2] = (tmuRevision >> 20) & 0xf;
     226
     227    /* Adjust configuration structure for "new" revision ID */
     228    info->tmuConfig &= ~(0x7 | (0x7<<7) | (0x7<<14));
     229    info->tmuConfig |= (((tmuRevision & 0x7) + 3) |
     230      ((((tmuRevision >> 8) & 0x7) + 3) << 7) |
     231      ((((tmuRevision >> 16) & 0x7) + 3) << 14));
    231232
    232233    /* reset trex's init registers */
     
    235236    ISET(SST_TREX(sst,2)->trexInit1, info->tmuInit1[2]);
    236237
    237         if(GETENV(("SSTV2_TMUCFG")))
     238    if(GETENV(("SSTV2_TMUCFG")))
    238239        SSCANF(GETENV(("SSTV2_TMUCFG")), "%i", &info->tmuConfig);
    239240
    240         return(FXTRUE);
     241    return(FXTRUE);
    241242}
    242243
     
    246247
    247248static FxU32 sense(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu,
    248                    FxU32 mem, FxU32 init)
     249           FxU32 mem, FxU32 init)
    249250{
    250251    SstRegs *sst = (SstRegs *) sstbase;
     
    256257    sst1InitIdle(sstbase);
    257258
    258     ISET(sst->texBaseAddr, 0x200000>>3);        /* set to 2 MB */
    259     ISET(texAddr[0], SENSE2);           /* write a random value */
    260    
    261     ISET(sst->texBaseAddr, 0x100000>>3);        /* set to 1 MB */
    262     ISET(texAddr[0], SENSE1);           /* write a random value */
    263    
    264     ISET(sst->texBaseAddr, 0x000000>>3);        /* set to 0 MB */
    265     ISET(texAddr[0], SENSE0);           /* write a random value */
    266 
    267     ISET(sst->texBaseAddr, mem>>3);             /* reset to 2 MB */
    268     drawTriangle(sst,0,0,4);            /* draw a 4x4 right triangle */
     259    ISET(sst->texBaseAddr, 0x200000>>3);    /* set to 2 MB */
     260    ISET(texAddr[0], SENSE2);       /* write a random value */
     261
     262    ISET(sst->texBaseAddr, 0x100000>>3);    /* set to 1 MB */
     263    ISET(texAddr[0], SENSE1);       /* write a random value */
     264
     265    ISET(sst->texBaseAddr, 0x000000>>3);    /* set to 0 MB */
     266    ISET(texAddr[0], SENSE0);       /* write a random value */
     267
     268    ISET(sst->texBaseAddr, mem>>3);     /* reset to 2 MB */
     269    drawTriangle(sst,0,0,4);        /* draw a 4x4 right triangle */
    269270    sst1InitIdle(sstbase);
    270271
     
    281282FX_EXPORT FxBool FX_CSTYLE
    282283sst1InitGetTmuMemory(FxU32 *sstbase, sst1DeviceInfoStruct *info, FxU32 tmu,
    283         FxU32 *TmuMemorySize)
     284    FxU32 *TmuMemorySize)
    284285{
    285286    FxU32 i,data;
     
    288289    INIT_INFO((1,"sst1InitGetTmuMemory(0x%x, , %d)\n", sstbase,tmu));
    289290
    290         if(GETENV(("SSTV2_TMU_MEMSIZE"))) {
    291                 *TmuMemorySize = ATOI(GETENV(("SSTV2_TMU_MEMSIZE")));
    292                 // If user specifies 2 MBytes on a 4 MBytes board, disable the
    293                 // second RAS so that apps which may incorrectly store data in the
    294                 // upper 2 Mbytes will not function properly...
    295                 if(*TmuMemorySize == 2) {
    296                         info->tmuInit0[tmu] &= ~SST_EN_TEX_MEM_SECOND_RAS;
    297                 sst1InitIdle(sstbase);
    298                     ISET(SST_TREX(sst,tmu)->trexInit0, info->tmuInit0[tmu]);
    299                     sst1InitIdle(sstbase);
    300                 }
    301                 return(FXTRUE);
    302         }
     291    if(GETENV(("SSTV2_TMU_MEMSIZE"))) {
     292        *TmuMemorySize = ATOI(GETENV(("SSTV2_TMU_MEMSIZE")));
     293        // If user specifies 2 MBytes on a 4 MBytes board, disable the
     294        // second RAS so that apps which may incorrectly store data in the
     295        // upper 2 Mbytes will not function properly...
     296        if(*TmuMemorySize == 2) {
     297            info->tmuInit0[tmu] &= ~SST_EN_TEX_MEM_SECOND_RAS;
     298            sst1InitIdle(sstbase);
     299            ISET(SST_TREX(sst,tmu)->trexInit0, info->tmuInit0[tmu]);
     300            sst1InitIdle(sstbase);
     301        }
     302        return(FXTRUE);
     303    }
    303304
    304305    ISET(sst->lfbMode, SST_LFB_RGBALANES_ARGB | SST_LFB_READFRONTBUFFER);
    305306    ISET(sst->fbzMode, SST_DRAWBUFFER_FRONT | SST_RGBWRMASK);
    306307    ISET(sst->fbzColorPath,
    307           SST_RGBSEL_TREXOUT | SST_CC_PASS | SST_ENTEXTUREMAP);
     308      SST_RGBSEL_TREXOUT | SST_CC_PASS | SST_ENTEXTUREMAP);
    308309    ISET(sst->textureMode, SST_RGB565 | SST_TC_REPLACE | SST_TCA_REPLACE);
    309310    ISET(sst->tLOD, 0);
     
    311312    /* setup all downstream TMUs to be in pass-thru mode */
    312313    for (i=0; i<tmu; i++)
    313         ISET(SST_TREX(sst,i)->textureMode, SST_TC_PASS | SST_TCA_PASS);
     314    ISET(SST_TREX(sst,i)->textureMode, SST_TC_PASS | SST_TCA_PASS);
    314315
    315316    /* first see if we have 4 Mbytes by writing a texel at 2MB followed by
     
    331332
    332333    INIT_PRINTF(("sst1InitGetTmuMemory() ERROR: Could not detect memory size.\n"));
    333         return(FXFALSE);
     334    return(FXFALSE);
    334335}
    335336
    336337/*---------------------------------------------------------------------------
    337338   NOTES:
    338         assumes that board and registers are initialized
    339         destroys part of the framebuffer
     339    assumes that board and registers are initialized
     340    destroys part of the framebuffer
    340341  ---------------------------------------------------------------------------*/
    341342FX_EXPORT FxBool FX_CSTYLE
     
    345346
    346347    if(initSumTables(sstbase) == FXFALSE)
    347                 return(FXFALSE);
     348        return(FXFALSE);
    348349    if(getTmuConfigData(sstbase,info) == FXFALSE)
    349                 return(FXFALSE);
     350        return(FXFALSE);
    350351
    351352    info->numberTmus = 1;
    352         if(GETENV(("SSTV2_TEXMAP_DISABLE"))) {
    353             info->tmuRevision = 4;
    354             sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]);
    355                 info->tmuMemSize[0] = 2;
    356         } else {
    357             /* Get TMU memory size */
    358             info->tmuRevision = info->tmuConfig & 0x7;
    359             if(sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]) ==
    360                   FXFALSE)
    361                         return(FXFALSE);
    362         }
     353    if(GETENV(("SSTV2_TEXMAP_DISABLE"))) {
     354        info->tmuRevision = 4;
     355        sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]);
     356        info->tmuMemSize[0] = 2;
     357    } else {
     358        /* Get TMU memory size */
     359        info->tmuRevision = info->tmuConfig & 0x7;
     360        if(sst1InitGetTmuMemory(sstbase, info, 0, &info->tmuMemSize[0]) ==
     361          FXFALSE)
     362            return(FXFALSE);
     363    }
    363364
    364365    INIT_INFO((1,"TMU0 memory = %d MB\n", info->tmuMemSize[0]));
    365     if (info->tmuConfig & FXBIT(6)) {           /* if TMU 1 exists */
    366         info->numberTmus++;                     /* increment TMU count */
    367         trev = (info->tmuConfig>>7) & 0x7;      /* get its revision */
     366    if (info->tmuConfig & FXBIT(6)) {       /* if TMU 1 exists */
     367    info->numberTmus++;         /* increment TMU count */
     368    trev = (info->tmuConfig>>7) & 0x7;  /* get its revision */
    368369#if 0 // Ignore for now...
    369         if (info->tmuRevision != trev) {
    370             INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n"));
    371             return(FXFALSE);
    372         }
     370    if (info->tmuRevision != trev) {
     371        INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n"));
     372        return(FXFALSE);
     373    }
    373374#endif
    374375    if(sst1InitGetTmuMemory(sstbase, info, 1, &info->tmuMemSize[1]) == FXFALSE)
    375                 return(FXFALSE);
    376     }
    377     if (info->tmuConfig & FXBIT(13)) {          /* if TMU 2 exists */
    378         info->numberTmus++;                     /* increment TMU count */
    379         trev = (info->tmuConfig>>14) & 0x7;     /* get its revision */
     376        return(FXFALSE);
     377    }
     378    if (info->tmuConfig & FXBIT(13)) {      /* if TMU 2 exists */
     379    info->numberTmus++;         /* increment TMU count */
     380    trev = (info->tmuConfig>>14) & 0x7; /* get its revision */
    380381#if 0 // Ignore for now...
    381         if (info->tmuRevision != trev) {
    382             INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n"));
    383             return(FXFALSE);
    384         }
     382    if (info->tmuRevision != trev) {
     383        INIT_PRINTF(("sst1InitGetDeviceInfo: ERROR, multiple different TMU revision IDs detected\n"));
     384        return(FXFALSE);
     385    }
    385386#endif
    386387    if(sst1InitGetTmuMemory(sstbase, info, 2, &info->tmuMemSize[2]) == FXFALSE)
    387                 return(FXFALSE);
    388     }
    389         if(GETENV(("SSTV2_NUM_TMUS")))
    390           info->numberTmus = ATOI(GETENV(("SSTV2_NUM_TMUS")));
     388        return(FXFALSE);
     389    }
     390    if(GETENV(("SSTV2_NUM_TMUS")))
     391      info->numberTmus = ATOI(GETENV(("SSTV2_NUM_TMUS")));
    391392
    392393    INIT_INFO((1,"numberTMus = %d\n", info->numberTmus));
     
    401402**
    402403*/
    403 #define LFB_PUTPIXEL(X, Y, DATA)        \
    404         ISET(lfbptr[((SST_LFB_ADDR+(X<<1)+(Y<<11))>>1)], DATA)
    405 #define LFB_GETPIXEL(X, Y)                      \
    406         IGET(lfbptr[((SST_LFB_ADDR+(X<<1)+(Y<<11))>>1)])
     404#define LFB_PUTPIXEL(X, Y, DATA)    \
     405    ISET(lfbptr[((SST_LFB_ADDR+(X<<1)+(Y<<11))>>1)], DATA)
     406#define LFB_GETPIXEL(X, Y)          \
     407    IGET(lfbptr[((SST_LFB_ADDR+(X<<1)+(Y<<11))>>1)])
    407408
    408409static int fbiMemSize(FxU32 *sstbase)
    409410{
    410         SstRegs *sst = (SstRegs *) sstbase;
    411         volatile unsigned short *lfbptr = (unsigned short *) sstbase;
    412         FxU32 init0Save = IGET(sst->fbiInit0);
    413         FxU32 init1Save = IGET(sst->fbiInit1);
    414         FxU32 init2Save = IGET(sst->fbiInit2);
    415         int retval = 0;
    416 
    417         if(GETENV(("SSTV2_FBI_MEMSIZE")))
    418                 return(ATOI(GETENV(("SSTV2_FBI_MEMSIZE"))));
    419 
    420         /* Enable dram refresh, disable memory fifo, and setup memory */
    421         /* for rendering */
    422         ISET(sst->fbiInit0, IGET(sst->fbiInit0) & ~SST_MEM_FIFO_EN);
     411    SstRegs *sst = (SstRegs *) sstbase;
     412    volatile unsigned short *lfbptr = (unsigned short *) sstbase;
     413    FxU32 init0Save = IGET(sst->fbiInit0);
     414    FxU32 init1Save = IGET(sst->fbiInit1);
     415    FxU32 init2Save = IGET(sst->fbiInit2);
     416    int retval = 0;
     417
     418    if(GETENV(("SSTV2_FBI_MEMSIZE")))
     419        return(ATOI(GETENV(("SSTV2_FBI_MEMSIZE"))));
     420
     421    /* Enable dram refresh, disable memory fifo, and setup memory */
     422    /* for rendering */
     423    ISET(sst->fbiInit0, IGET(sst->fbiInit0) & ~SST_MEM_FIFO_EN);
    423424    ISET(sst->fbiInit2, IGET(sst->fbiInit2) | SST_EN_DRAM_REFRESH);
    424         sst1InitIdleFBI(sstbase);
    425 
    426         /* Setup Basic rendering datapath */
    427         ISET(sst->fbzColorPath, SST_CC_MONE);
    428         ISET(sst->fogMode, 0x0);
    429         ISET(sst->fbzMode, SST_RGBWRMASK | SST_ZAWRMASK | SST_DRAWBUFFER_FRONT);
    430         sst1InitIdleFBI(sstbase);
     425    sst1InitIdleFBI(sstbase);
     426
     427    /* Setup Basic rendering datapath */
     428    ISET(sst->fbzColorPath, SST_CC_MONE);
     429    ISET(sst->fogMode, 0x0);
     430    ISET(sst->fbzMode, SST_RGBWRMASK | SST_ZAWRMASK | SST_DRAWBUFFER_FRONT);
     431    sst1InitIdleFBI(sstbase);
    431432
    432433    sst1InitSetResolution(sstbase, &SST_VREZ_800X600_60, 1);
    433         sst1InitIdleFBI(sstbase);
    434 
    435         ISET(sst->lfbMode, SST_LFB_ZZ | SST_LFB_WRITEFRONTBUFFER |
    436                 SST_LFB_READDEPTHABUFFER);
    437         sst1InitIdleFBI(sstbase);
    438 
    439         /* Check for 4 MBytes... */
    440         /* Write to Zbuffer in 800x600 resolution in upper 2 MBytes of memory */
    441         LFB_PUTPIXEL(128, 100, 0xdead); /* maps to row:0x216, col:0x80, bank:0x1 */
    442         LFB_PUTPIXEL(0, 0, 0x0);
    443         LFB_PUTPIXEL(798, 599, 0xffff);
    444         LFB_PUTPIXEL(200, 200, 0x55aa); /* maps to row:0x23d, col:0x104, bank:0x0 */
    445         LFB_PUTPIXEL(20, 20, 0xffff);
    446         LFB_PUTPIXEL(400, 400, 0x0);
    447         sst1InitIdleFBI(sstbase);
    448         if((LFB_GETPIXEL(128, 100) == 0xdead) &&
    449            (LFB_GETPIXEL(200, 200) == 0x55aa)) {
    450                 retval = 4;
    451                 ISET(sst->lfbMode, (SST_LFB_565 | SST_LFB_READBACKBUFFER));
    452                 sst1InitIdleFBI(sstbase);
    453                 goto fbiMemSizeDone;
    454         }
    455 
    456         /* Check for 2 MBytes... */
    457         /* Write to color buffer in 640x480 resolution */
     434    sst1InitIdleFBI(sstbase);
     435
     436    ISET(sst->lfbMode, SST_LFB_ZZ | SST_LFB_WRITEFRONTBUFFER |
     437        SST_LFB_READDEPTHABUFFER);
     438    sst1InitIdleFBI(sstbase);
     439
     440    /* Check for 4 MBytes... */
     441    /* Write to Zbuffer in 800x600 resolution in upper 2 MBytes of memory */
     442    LFB_PUTPIXEL(128, 100, 0xdead); /* maps to row:0x216, col:0x80, bank:0x1 */
     443    LFB_PUTPIXEL(0, 0, 0x0);
     444    LFB_PUTPIXEL(798, 599, 0xffff);
     445    LFB_PUTPIXEL(200, 200, 0x55aa); /* maps to row:0x23d, col:0x104, bank:0x0 */
     446    LFB_PUTPIXEL(20, 20, 0xffff);
     447    LFB_PUTPIXEL(400, 400, 0x0);
     448    sst1InitIdleFBI(sstbase);
     449    if((LFB_GETPIXEL(128, 100) == 0xdead) &&
     450       (LFB_GETPIXEL(200, 200) == 0x55aa)) {
     451        retval = 4;
     452        ISET(sst->lfbMode, (SST_LFB_565 | SST_LFB_READBACKBUFFER));
     453        sst1InitIdleFBI(sstbase);
     454        goto fbiMemSizeDone;
     455    }
     456
     457    /* Check for 2 MBytes... */
     458    /* Write to color buffer in 640x480 resolution */
    458459    sst1InitSetResolution(sstbase, &SST_VREZ_640X480_60, 0);
    459         ISET(sst->lfbMode, SST_LFB_565 | SST_LFB_WRITEFRONTBUFFER |
    460                 SST_LFB_READFRONTBUFFER);
    461         sst1InitIdleFBI(sstbase);
    462         LFB_PUTPIXEL(50, 100, 0xdead);  /* maps to row:0x1e, col:0x99, bank:0x0 */
    463         LFB_PUTPIXEL(0, 0, 0x0);
    464         LFB_PUTPIXEL(638, 479, 0xffff);
    465         ISET(sst->lfbMode, SST_LFB_565 | SST_LFB_WRITEBACKBUFFER |
    466                 SST_LFB_READFRONTBUFFER);
    467         sst1InitIdleFBI(sstbase);
    468         LFB_PUTPIXEL(178, 436, 0xaa55); /* maps to row:0x11e, col:0x99, bank:0x0 */
    469         LFB_PUTPIXEL(20, 20, 0x0);
    470         LFB_PUTPIXEL(400, 400, 0xffff);
    471         sst1InitIdleFBI(sstbase);
    472         if(LFB_GETPIXEL(50, 100) != 0xdead)
    473                 goto check1MByte;
    474         ISET(sst->lfbMode, (SST_LFB_565 | SST_LFB_READBACKBUFFER));
    475         sst1InitIdleFBI(sstbase);
    476         if(LFB_GETPIXEL(178, 436) == 0xaa55) {
    477                 retval = 2;
    478                 goto fbiMemSizeDone;
    479         }
     460    ISET(sst->lfbMode, SST_LFB_565 | SST_LFB_WRITEFRONTBUFFER |
     461        SST_LFB_READFRONTBUFFER);
     462    sst1InitIdleFBI(sstbase);
     463    LFB_PUTPIXEL(50, 100, 0xdead);  /* maps to row:0x1e, col:0x99, bank:0x0 */
     464    LFB_PUTPIXEL(0, 0, 0x0);
     465    LFB_PUTPIXEL(638, 479, 0xffff);
     466    ISET(sst->lfbMode, SST_LFB_565 | SST_LFB_WRITEBACKBUFFER |
     467        SST_LFB_READFRONTBUFFER);
     468    sst1InitIdleFBI(sstbase);
     469    LFB_PUTPIXEL(178, 436, 0xaa55); /* maps to row:0x11e, col:0x99, bank:0x0 */
     470    LFB_PUTPIXEL(20, 20, 0x0);
     471    LFB_PUTPIXEL(400, 400, 0xffff);
     472    sst1InitIdleFBI(sstbase);
     473    if(LFB_GETPIXEL(50, 100) != 0xdead)
     474        goto check1MByte;
     475    ISET(sst->lfbMode, (SST_LFB_565 | SST_LFB_READBACKBUFFER));
     476    sst1InitIdleFBI(sstbase);
     477    if(LFB_GETPIXEL(178, 436) == 0xaa55) {
     478        retval = 2;
     479        goto fbiMemSizeDone;
     480    }
    480481
    481482check1MByte:
    482         ISET(sst->lfbMode, SST_LFB_565 | SST_LFB_WRITEFRONTBUFFER |
    483                 SST_LFB_READFRONTBUFFER);
    484         sst1InitIdleFBI(sstbase);
    485         LFB_PUTPIXEL(10, 10, 0xdead);   /* maps to row:0x0, col:0x145, bank:0x0 */
    486         LFB_PUTPIXEL(8, 8, 0x0);
    487         LFB_PUTPIXEL(340, 340, 0xffff);
    488         LFB_PUTPIXEL(100, 200, 0x5a5a); /* maps to row:0x3c, col:0x112, bank:0x1 */
    489         LFB_PUTPIXEL(66, 0, 0x0);
    490         LFB_PUTPIXEL(360, 360, 0xffff);
    491         sst1InitIdleFBI(sstbase);
    492         if((LFB_GETPIXEL(10, 10) == 0xdead) &&
    493            (LFB_GETPIXEL(100, 200) == 0x5a5a))
    494                 retval = 1;
     483    ISET(sst->lfbMode, SST_LFB_565 | SST_LFB_WRITEFRONTBUFFER |
     484        SST_LFB_READFRONTBUFFER);
     485    sst1InitIdleFBI(sstbase);
     486    LFB_PUTPIXEL(10, 10, 0xdead);   /* maps to row:0x0, col:0x145, bank:0x0 */
     487    LFB_PUTPIXEL(8, 8, 0x0);
     488    LFB_PUTPIXEL(340, 340, 0xffff);
     489    LFB_PUTPIXEL(100, 200, 0x5a5a); /* maps to row:0x3c, col:0x112, bank:0x1 */
     490    LFB_PUTPIXEL(66, 0, 0x0);
     491    LFB_PUTPIXEL(360, 360, 0xffff);
     492    sst1InitIdleFBI(sstbase);
     493    if((LFB_GETPIXEL(10, 10) == 0xdead) &&
     494       (LFB_GETPIXEL(100, 200) == 0x5a5a))
     495        retval = 1;
    495496
    496497fbiMemSizeDone:
    497         /* Restore init registers to original state */
    498         ISET(sst->fbiInit0, init0Save);
    499         ISET(sst->fbiInit1, init1Save);
    500         ISET(sst->fbiInit2, init2Save);
    501         sst1InitIdleFBI(sstbase);
    502 
    503         return(retval);
     498    /* Restore init registers to original state */
     499    ISET(sst->fbiInit0, init0Save);
     500    ISET(sst->fbiInit1, init1Save);
     501    ISET(sst->fbiInit2, init2Save);
     502    sst1InitIdleFBI(sstbase);
     503
     504    return(retval);
    504505}
    505506
     
    507508sst1InitGetFbiInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
    508509{
    509         SstRegs *sst = (SstRegs *) sstbase;
     510    SstRegs *sst = (SstRegs *) sstbase;
    510511
    511512    info->fbiMemSize = fbiMemSize(sstbase);
    512513
    513         /* Detect board identification and memory speed */
    514         if(GETENV(("SSTV2_FBICFG")))
     514    /* Detect board identification and memory speed */
     515    if(GETENV(("SSTV2_FBICFG")))
    515516        SSCANF(GETENV(("SSTV2_FBICFG")), "%i", &info->fbiConfig);
    516517    else
    517                 info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >>
    518                         SST_FBI_MEM_TYPE_SHIFT;
    519 
    520         info->fbiBoardID = (IGET(sst->fbiInit5) >> 5) & 0xf;
    521         if(IGET(sst->fbiInit7) & BIT(0))
    522                 info->fbiBoardID |= 0x10;
    523 
    524         /* Detect scanline interleaving */
    525         info->sliPaired   = sst1InitSliPaired(sstbase);
    526         info->sliDetected = sst1InitSliDetect(sstbase);
     518        info->fbiConfig = (IGET(sst->fbiInit3) & SST_FBI_MEM_TYPE) >>
     519            SST_FBI_MEM_TYPE_SHIFT;
     520
     521    info->fbiBoardID = (IGET(sst->fbiInit5) >> 5) & 0xf;
     522    if(IGET(sst->fbiInit7) & BIT(0))
     523        info->fbiBoardID |= 0x10;
     524
     525    /* Detect scanline interleaving */
     526    info->sliPaired   = sst1InitSliPaired(sstbase);
     527    info->sliDetected = sst1InitSliDetect(sstbase);
    527528
    528529    return FXTRUE;
     
    563564    if(GETENV(("SSTV2_NODEVICEINFO"))) {
    564565        /* fill device info struct with sane values... */
    565         INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n"));
    566 
    567                 if(GETENV(("SSTV2_FBICFG")))
    568                 SSCANF(GETENV(("SSTV2_FBICFG")), "%i", &info->fbiConfig);
    569                 else
    570                 info->fbiConfig = 0x0;
    571 
    572                 if(GETENV(("SSTV2_TMUCFG")))
    573                 SSCANF(GETENV(("SSTV2_TMUCFG")), "%i", &info->tmuConfig);
    574                 else
    575                 info->tmuConfig = 0x0;
     566        INIT_PRINTF(("sst1DeviceInfo: Filling info Struct with default values...\n"));
     567
     568        if(GETENV(("SSTV2_FBICFG")))
     569            SSCANF(GETENV(("SSTV2_FBICFG")), "%i", &info->fbiConfig);
     570        else
     571            info->fbiConfig = 0x0;
     572
     573        if(GETENV(("SSTV2_TMUCFG")))
     574            SSCANF(GETENV(("SSTV2_TMUCFG")), "%i", &info->tmuConfig);
     575        else
     576            info->tmuConfig = 0x0;
    576577
    577578        info->numberTmus = 1;
    578         if (info->tmuConfig & FXBIT(6)) /* if TMU 1 exists */
    579                         info->numberTmus++;
    580             if (info->tmuConfig & FXBIT(13)) /* if TMU 2 exists */
    581                         info->numberTmus++;
    582 
    583         info->tmuRevision = info->tmuConfig & 0x7;
    584 
    585                 if(GETENV(("SSTV2_FBI_MEMSIZE")))
    586                         info->fbiMemSize = ATOI(GETENV(("SSTV2_FBI_MEMSIZE")));
    587                 else
    588                 info->fbiMemSize = 2;
    589 
    590                 if(GETENV(("SSTV2_TMU_MEMSIZE")))
    591                         info->tmuMemSize[0] = ATOI(GETENV(("SSTV2_TMU_MEMSIZE")));
    592                 else
    593                 info->tmuMemSize[0] = 2;
    594                 info->tmuMemSize[1] = info->tmuMemSize[0];
    595                 info->tmuMemSize[2] = info->tmuMemSize[0];
     579        if (info->tmuConfig & FXBIT(6)) /* if TMU 1 exists */
     580            info->numberTmus++;
     581        if (info->tmuConfig & FXBIT(13)) /* if TMU 2 exists */
     582            info->numberTmus++;
     583
     584        info->tmuRevision = info->tmuConfig & 0x7;
     585
     586        if(GETENV(("SSTV2_FBI_MEMSIZE")))
     587            info->fbiMemSize = ATOI(GETENV(("SSTV2_FBI_MEMSIZE")));
     588        else
     589            info->fbiMemSize = 2;
     590
     591        if(GETENV(("SSTV2_TMU_MEMSIZE")))
     592            info->tmuMemSize[0] = ATOI(GETENV(("SSTV2_TMU_MEMSIZE")));
     593        else
     594            info->tmuMemSize[0] = 2;
     595        info->tmuMemSize[1] = info->tmuMemSize[0];
     596        info->tmuMemSize[2] = info->tmuMemSize[0];
    596597    } else {
    597                 int i;
    598 
    599                 for(i=0; i<5; i++) {
    600                         if(i)
    601                                 INIT_PRINTF(("sst1InitFillDeviceInfo(): Retry #%d for chip GetInfo()...\n", i));
    602                 /* GetFbiInfo() must be called before GetTmuInfo() */
    603                 if(sst1InitGetFbiInfo(sstbase, info) == FXFALSE)
    604                                 continue;
    605                 /* get the revision ID of each TMU and verify that they are all the
    606                            same */
    607                 if(sst1InitGetTmuInfo(sstbase, info) == FXFALSE)
    608                                 continue;
    609                         break;
    610                 }
    611                 if(i == 5)
    612                         return(FXFALSE);
    613     }
    614         // Measure silicon performance
     598        int i;
     599
     600        for(i=0; i<5; i++) {
     601            if(i)
     602                INIT_PRINTF(("sst1InitFillDeviceInfo(): Retry #%d for chip GetInfo()...\n", i));
     603            /* GetFbiInfo() must be called before GetTmuInfo() */
     604            if(sst1InitGetFbiInfo(sstbase, info) == FXFALSE)
     605                continue;
     606            /* get the revision ID of each TMU and verify that they are all the
     607               same */
     608            if(sst1InitGetTmuInfo(sstbase, info) == FXFALSE)
     609                continue;
     610            break;
     611        }
     612        if(i == 5)
     613            return(FXFALSE);
     614    }
     615    // Measure silicon performance
    615616    sst1InitMeasureSiProcess(sstbase, 0); // measure NAND-tree
    616617    sst1InitMeasureSiProcess(sstbase, 1); // measure NOR-tree
    617618
    618         INIT_PRINTF(("sst1DeviceInfo: Board ID: %d\n", info->fbiBoardID));
     619    INIT_PRINTF(("sst1DeviceInfo: Board ID: %d\n", info->fbiBoardID));
    619620    INIT_PRINTF(("sst1DeviceInfo: FbiConfig:0x%x, TmuConfig:0x%x\n",
    620621        info->fbiConfig, info->tmuConfig));
     
    630631    if(sst1InitUseVoodooFile == FXTRUE) {
    631632        if(iniDac == (sst1InitDacStruct *) NULL)
    632                         INIT_PRINTF(("sst1DeviceInfo: Dac Type: Unknown"));
    633                 else
    634                 INIT_PRINTF(("sst1DeviceInfo: Dac Type: %s %s\n",
    635                           iniDac->dacManufacturer, iniDac->dacDevice));
    636         } else {
    637             INIT_PRINTF(("sst1DeviceInfo: Dac Type: "));
    638             if(info->fbiVideoDacType == SST_FBI_DACTYPE_ATT)
    639                 INIT_PRINTF(("AT&T ATT20C409\n"));
    640             else if(info->fbiVideoDacType == SST_FBI_DACTYPE_ICS)
    641                 INIT_PRINTF(("ICS ICS5342\n"));
    642             else if(info->fbiVideoDacType == SST_FBI_DACTYPE_TI)
    643                 INIT_PRINTF(("TI TVP3409\n"));
    644             else
    645                 INIT_PRINTF(("Unknown\n"));
    646         }
     633            INIT_PRINTF(("sst1DeviceInfo: Dac Type: Unknown"));
     634        else
     635            INIT_PRINTF(("sst1DeviceInfo: Dac Type: %s %s\n",
     636              iniDac->dacManufacturer, iniDac->dacDevice));
     637    } else {
     638        INIT_PRINTF(("sst1DeviceInfo: Dac Type: "));
     639        if(info->fbiVideoDacType == SST_FBI_DACTYPE_ATT)
     640            INIT_PRINTF(("AT&T ATT20C409\n"));
     641        else if(info->fbiVideoDacType == SST_FBI_DACTYPE_ICS)
     642            INIT_PRINTF(("ICS ICS5342\n"));
     643        else if(info->fbiVideoDacType == SST_FBI_DACTYPE_TI)
     644            INIT_PRINTF(("TI TVP3409\n"));
     645        else
     646            INIT_PRINTF(("Unknown\n"));
     647    }
    647648    INIT_PRINTF(("sst1DeviceInfo: SLI Detected:%d\n", info->sliDetected));
    648649
  • trunk/src/opengl/glide/cvg/init/parse.c

    r2888 r6653  
    11/*-*-c++-*-*/
     2/* $Id: parse.c,v 1.2 2001-09-05 14:30:38 bird Exp $ */
    23/*
    34** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
    45** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
    56** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
    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 
     7** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
     8** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
     9** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
    910** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
    10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 
    11 ** 
     11** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
     12**
    1213** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
    1314** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
     
    1516** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
    1617** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
    17 ** THE UNITED STATES. 
    18 ** 
     18** THE UNITED STATES.
     19**
    1920** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
    2021**
    2122**
    22 ** $Revision: 1.1 $
    23 ** $Date: 2000-02-25 00:37:52 $
     23** $Revision: 1.2 $
     24** $Date: 2001-09-05 14:30:38 $
    2425**
    2526** Parsing code for grabbing information from "voodoo2.ini" initialization file
     
    8485  int helper = (getenv(("SSTV2_DEBUGDAC"))) ? 1 : 0;
    8586
    86         filename[0] = '\0';
    87         if (checkedFileP) goto __errExit;
    88        
     87    filename[0] = '\0';
     88    if (checkedFileP) goto __errExit;
     89
    8990#if __DOS32__
    90         {
    91           char fixedFilename[512], *tmpPtr;
    92           char path[512];
    93           int i;
    94 
    95 
    96           if(getenv("VOODOO2_FILE")) {
    97             /* Override voodoo2.ini name */
    98             strcpy(filename, getenv("VOODOO2_FILE"));
    99             if(!(file = fopen(filename, "r"))) goto __errExit;
    100           } else {
    101             /* Override path setting */
    102             if(getenv("VOODOO2_PATH"))
    103               strcpy(path, getenv("VOODOO2_PATH"));
    104             else if(getenv("PATH")) {
    105               strcpy(path, ".;");
    106               strcat(path, getenv("PATH"));
    107             } else
    108               strcpy(path, ".;");
    109 
    110             i = 0;
    111             while(1) {
    112               if(!i) {
    113                 if((tmpPtr = strtok(path, ";")) == NULL)
    114                   break;
    115               } else {
    116                 if((tmpPtr = strtok(NULL, ";")) == NULL)
    117                   break;
    118               }
    119               strcpy(filename, tmpPtr);
    120               sst1InitFixFilename(fixedFilename, filename);
    121               if(fixedFilename[strlen(fixedFilename)-1] == '\\')
    122                 sprintf(filename, "%svoodoo2.var", filename);
    123               else
    124                 sprintf(filename, "%s\\voodoo2.var", filename);
    125               i++;
    126               if((file = fopen(filename, "r")))
    127                 break;
    128             }
    129           }
    130         }
     91    {
     92      char fixedFilename[512], *tmpPtr;
     93      char path[512];
     94      int i;
     95
     96
     97      if(getenv("VOODOO2_FILE")) {
     98        /* Override voodoo2.ini name */
     99        strcpy(filename, getenv("VOODOO2_FILE"));
     100        if(!(file = fopen(filename, "r"))) goto __errExit;
     101      } else {
     102        /* Override path setting */
     103        if(getenv("VOODOO2_PATH"))
     104          strcpy(path, getenv("VOODOO2_PATH"));
     105        else if(getenv("PATH")) {
     106          strcpy(path, ".;");
     107          strcat(path, getenv("PATH"));
     108        } else
     109          strcpy(path, ".;");
     110
     111        i = 0;
     112        while(1) {
     113          if(!i) {
     114            if((tmpPtr = strtok(path, ";")) == NULL)
     115              break;
     116          } else {
     117            if((tmpPtr = strtok(NULL, ";")) == NULL)
     118              break;
     119          }
     120          strcpy(filename, tmpPtr);
     121          sst1InitFixFilename(fixedFilename, filename);
     122          if(fixedFilename[strlen(fixedFilename)-1] == '\\')
     123            sprintf(filename, "%svoodoo2.var", filename);
     124          else
     125            sprintf(filename, "%s\\voodoo2.var", filename);
     126          i++;
     127          if((file = fopen(filename, "r")))
     128            break;
     129        }
     130      }
     131    }
    131132#elif __MWERKS__
    132         {
    133                 FSSpec iniSpec = {
    134                         0, 0,
    135                         "\pvoodoo2.var"
    136                 };
    137                 Boolean foundP = false;
    138                
    139                 /* Check the app's directory */
    140                 if (!foundP) {
    141                         ProcessSerialNumber curApp;
    142                         ProcessInfoRec appInfo;
    143                         FSSpec appSpec;
    144                        
    145                         if (GetCurrentProcess(&curApp) != noErr) goto __errAppDir;
    146 
    147                         /* We only care about the app's location */
    148                         appInfo.processInfoLength = sizeof(ProcessInfoRec);
    149                         appInfo.processName = NULL;
    150                         appInfo.processAppSpec = &appSpec;
    151                         if (GetProcessInformation(&curApp, &appInfo) != noErr) goto __errAppDir;
    152                        
    153                         {
    154                                 CInfoPBRec thePB;
    155 
    156                                 thePB.hFileInfo.ioCompletion = NULL;
    157                                 thePB.hFileInfo.ioNamePtr = iniSpec.name;
    158                                 thePB.hFileInfo.ioVRefNum = appSpec.vRefNum;
    159                                 thePB.hFileInfo.ioDirID = appSpec.parID;
    160 
    161                                 thePB.hFileInfo.ioFDirIndex = 0;
    162 
    163                                 foundP = ((PBGetCatInfoSync(&thePB) == noErr) &&
    164                                                                         ((thePB.hFileInfo.ioFlAttrib & (0x01 << 4)) == 0));
    165                                 if (foundP) {
    166                                         iniSpec.vRefNum = appSpec.vRefNum;
    167                                         iniSpec.parID = appSpec.parID;
    168                                 }
    169                         }                       
    170                        
    171                 __errAppDir:
    172                         ;
    173                 }
    174                
    175                 /* Check the mac's version of the 'search path' */
    176                 if (!foundP) {
    177                         OSType folderList[] = { kPreferencesFolderType, kExtensionFolderType };
    178                         int i;
    179 
    180                         for(i = 0; i < sizeof(folderList) / sizeof(folderList[0]); i++) {
    181                                 short vRefNum;
    182                                 long dirId;
    183                                
    184                                 if (FindFolder(kOnSystemDisk, folderList[i], false,
    185                                                                                         &vRefNum, &dirId) == noErr) {
    186                                
    187                                         CInfoPBRec thePB;
    188                                        
    189                                         thePB.hFileInfo.ioCompletion = NULL;
    190                                         thePB.hFileInfo.ioNamePtr = iniSpec.name;
    191                                         thePB.hFileInfo.ioVRefNum = vRefNum;
    192                                         thePB.hFileInfo.ioDirID = dirId;
    193                                        
    194                                         thePB.hFileInfo.ioFDirIndex = 0;
    195                                        
    196                                         foundP = ((PBGetCatInfoSync(&thePB) == noErr) &&
    197                                                                                 ((thePB.hFileInfo.ioFlAttrib & (0x01 << 4)) == 0));
    198                                         if (foundP) {
    199                                                 iniSpec.vRefNum = vRefNum;
    200                                                 iniSpec.parID = dirId;
    201                                                
    202                                                 break;
    203                                         }
    204                                 }
    205                         }
    206                 }
    207                
    208                 if (foundP) {
    209                         short wdRefNum;
    210                         long  wdDirId;
    211                        
    212                         /* Change working directories, just in case the app did something else */
    213                         if (HGetVol(NULL, &wdRefNum, &wdDirId) != noErr) goto __errFile;
    214                         if (HSetVol(NULL, iniSpec.vRefNum, iniSpec.parID) != noErr) goto __errFile;
    215                        
    216                         /* NB: We leave the name trashed after this */
    217                         p2cstr(iniSpec.name);
    218                         file = fopen((const char*)iniSpec.name, "r");
    219                        
    220                         HSetVol(NULL, wdRefNum, wdDirId);
    221                        
    222                 __errFile:
    223                         ;
    224                 }
    225         }
     133    {
     134        FSSpec iniSpec = {
     135            0, 0,
     136            "\pvoodoo2.var"
     137        };
     138        Boolean foundP = false;
     139
     140        /* Check the app's directory */
     141        if (!foundP) {
     142            ProcessSerialNumber curApp;
     143            ProcessInfoRec appInfo;
     144            FSSpec appSpec;
     145
     146            if (GetCurrentProcess(&curApp) != noErr) goto __errAppDir;
     147
     148            /* We only care about the app's location */
     149            appInfo.processInfoLength = sizeof(ProcessInfoRec);
     150            appInfo.processName = NULL;
     151            appInfo.processAppSpec = &appSpec;
     152            if (GetProcessInformation(&curApp, &appInfo) != noErr) goto __errAppDir;
     153
     154            {
     155                CInfoPBRec thePB;
     156
     157                thePB.hFileInfo.ioCompletion = NULL;
     158                thePB.hFileInfo.ioNamePtr = iniSpec.name;
     159                thePB.hFileInfo.ioVRefNum = appSpec.vRefNum;
     160                thePB.hFileInfo.ioDirID = appSpec.parID;
     161
     162                thePB.hFileInfo.ioFDirIndex = 0;
     163
     164                foundP = ((PBGetCatInfoSync(&thePB) == noErr) &&
     165                                    ((thePB.hFileInfo.ioFlAttrib & (0x01 << 4)) == 0));
     166                if (foundP) {
     167                    iniSpec.vRefNum = appSpec.vRefNum;
     168                    iniSpec.parID = appSpec.parID;
     169                }
     170            }
     171
     172        __errAppDir:
     173            ;
     174        }
     175
     176        /* Check the mac's version of the 'search path' */
     177        if (!foundP) {
     178            OSType folderList[] = { kPreferencesFolderType, kExtensionFolderType };
     179            int i;
     180
     181            for(i = 0; i < sizeof(folderList) / sizeof(folderList[0]); i++) {
     182                short vRefNum;
     183                long dirId;
     184
     185                if (FindFolder(kOnSystemDisk, folderList[i], false,
     186                                            &vRefNum, &dirId) == noErr) {
     187
     188                    CInfoPBRec thePB;
     189
     190                    thePB.hFileInfo.ioCompletion = NULL;
     191                    thePB.hFileInfo.ioNamePtr = iniSpec.name;
     192                    thePB.hFileInfo.ioVRefNum = vRefNum;
     193                    thePB.hFileInfo.ioDirID = dirId;
     194
     195                    thePB.hFileInfo.ioFDirIndex = 0;
     196
     197                    foundP = ((PBGetCatInfoSync(&thePB) == noErr) &&
     198                                        ((thePB.hFileInfo.ioFlAttrib & (0x01 << 4)) == 0));
     199                    if (foundP) {
     200                        iniSpec.vRefNum = vRefNum;
     201                        iniSpec.parID = dirId;
     202
     203                        break;
     204                    }
     205                }
     206            }
     207        }
     208
     209        if (foundP) {
     210            short wdRefNum;
     211            long  wdDirId;
     212
     213            /* Change working directories, just in case the app did something else */
     214            if (HGetVol(NULL, &wdRefNum, &wdDirId) != noErr) goto __errFile;
     215            if (HSetVol(NULL, iniSpec.vRefNum, iniSpec.parID) != noErr) goto __errFile;
     216
     217            /* NB: We leave the name trashed after this */
     218            p2cstr(iniSpec.name);
     219            file = fopen((const char*)iniSpec.name, "r");
     220
     221            HSetVol(NULL, wdRefNum, wdDirId);
     222
     223        __errFile:
     224            ;
     225        }
     226    }
    226227#endif
    227228
     
    261262
    262263__errExit:
    263         checkedFileP = FXTRUE;
     264    checkedFileP = FXTRUE;
    264265#endif /* !DIRECTX */
    265266
     
    294295    /* Override voodoo2.ini name */
    295296    strcpy(filename, getenv("VOODOO2_FILE"));
    296     if (!(file = fopen(filename, "r"))) 
     297    if (!(file = fopen(filename, "r")))
    297298      goto __errExit;
    298299  } else {
     
    307308    while(1) {
    308309      if (!i) {
    309         if ((tmpPtr = strtok(path, ":")) == NULL)
    310           break;
     310    if ((tmpPtr = strtok(path, ":")) == NULL)
     311      break;
    311312      } else {
    312         if ((tmpPtr = strtok(NULL, ":")) == NULL)
    313           break;
     313    if ((tmpPtr = strtok(NULL, ":")) == NULL)
     314      break;
    314315      }
    315316      strcpy(filename, tmpPtr);
    316317      if (filename[strlen(filename)-1] == '\\')
    317         sprintf(filename, "%voodoo2", filename);
     318    sprintf(filename, "%voodoo2", filename);
    318319      else
    319         sprintf(filename, "%s/voodoo2", filename);
     320    sprintf(filename, "%s/voodoo2", filename);
    320321      i++;
    321322      if ((file = fopen(filename, "r")))
    322         break;
     323    break;
    323324    }
    324325  }
     
    638639                break;
    639640            }
    640             if(!(dacRdWrPtr->nextRdWr = malloc(sizeof(sst1InitDacRdWrStruct)))) 
     641            if(!(dacRdWrPtr->nextRdWr = malloc(sizeof(sst1InitDacRdWrStruct))))
    641642                return(0);
    642643
     
    982983
    983984#if __WIN32__
    984 FxBool GetRegistryKey(HKEY hKey, const char* keyName, 
     985FxBool GetRegistryKey(HKEY hKey, const char* keyName,
    985986                      char* regValBuf, FxU32 bufSize)
    986987{
     
    10041005    }
    10051006  }
    1006  
     1007
    10071008  return retVal;
    1008 } 
     1009}
    10091010#endif /* __WIN32__ */
    10101011
     
    10201021   * string table has been freed by the c runtime but has not been set
    10211022   * to NULL. Bad things happen if this memory has been unmapped by
    1022    * the system or if the string cannot be found. 
     1023   * the system or if the string cannot be found.
    10231024   */
    10241025  {
     
    10511052{
    10521053  const char* retVal;
    1053  
     1054
    10541055  /* Does the real environment variable exist?
    10551056   * This overrides everything for glide.
     
    10841085    }
    10851086#endif /* __WIN32__ */
    1086  
     1087
    10871088    /* Does the requested environment variable exist in "voodoo2.ini"? */
    10881089    /* Dump CFG Data... */
    10891090    if (!checkedFileP) {
    1090         static FxBool inProc = FXFALSE;
    1091        
    1092         if (!inProc) {
    1093                 inProc = FXTRUE;
    1094                 sst1InitVoodooFile();
    1095                 inProc = FXFALSE;
    1096             }
    1097     }
    1098    
     1091        static FxBool inProc = FXFALSE;
     1092
     1093        if (!inProc) {
     1094            inProc = FXTRUE;
     1095            sst1InitVoodooFile();
     1096            inProc = FXFALSE;
     1097        }
     1098    }
     1099
    10991100    {
    11001101      sst1InitEnvVarStruct *envVarsPtr = envVarsBase;
  • trunk/src/opengl/glide/cvg/init/print.c

    r2888 r6653  
    11/*-*-c++-*-*/
     2/* $Id: print.c,v 1.2 2001-09-05 14:30:39 bird Exp $ */
    23/*
    34** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
    45** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
    56** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
    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 
     7** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
     8** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
     9** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
    910** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
    10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 
    11 ** 
     11** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
     12**
    1213** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
    1314** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
     
    1516** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
    1617** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
    17 ** THE UNITED STATES. 
    18 ** 
     18** THE UNITED STATES.
     19**
    1920** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
    2021**
    2122**
    22 ** $Revision: 1.1 $
    23 ** $Date: 2000-02-25 00:37:53 $
     23** $Revision: 1.2 $
     24** $Date: 2001-09-05 14:30:39 $
    2425**
    2526** Print functions for SST-1 Initialization routines
     
    5455    if(firstPass == FXTRUE) {
    5556        firstPass = FXFALSE;
    56         if (sst1InitMsgFile == NULL)
    57         {
    58           /* I couldn't initialize to stdout because stdout is not constant */
    59           sst1InitMsgFile = stdout;
    60         }
     57    if (sst1InitMsgFile == NULL)
     58    {
     59      /* I couldn't initialize to stdout because stdout is not constant */
     60      sst1InitMsgFile = stdout;
     61    }
    6162        if(GETENV(("SSTV2_INITDEBUG")) || GDBG_GET_DEBUGLEVEL(5))
    6263            printIt = FXTRUE;
     
    6465          printIt = ((sst1InitMsgFile = fopen(GETENV(("SSTV2_INITDEBUG_FILE")), "w")) != NULL);
    6566          if (!printIt) {
    66             fprintf(stderr, "sst1InitPrintf(): Could not open file '%s' for logging...\n", 
     67            fprintf(stderr, "sst1InitPrintf(): Could not open file '%s' for logging...\n",
    6768                    GETENV(("SSTV2_INITDEBUG_FILE")));
    6869          }
  • trunk/src/opengl/glide/cvg/init/sli.c

    r2888 r6653  
    11/*-*-c++-*-*/
     2/* $Id: sli.c,v 1.2 2001-09-05 14:30:42 bird Exp $ */
    23/*
    34** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
    45** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
    56** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
    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 
     7** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
     8** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
     9** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
    910** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
    10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 
    11 ** 
     11** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
     12**
    1213** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
    1314** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
     
    1516** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
    1617** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
    17 ** THE UNITED STATES. 
    18 ** 
     18** THE UNITED STATES.
     19**
    1920** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
    2021**
    21 ** $Revision: 1.1 $
    22 ** $Date: 2000-02-25 00:37:53 $
     22** $Revision: 1.2 $
     23** $Date: 2001-09-05 14:30:42 $
    2324**
    2425** Initialization code for initializing scanline interleaving
     
    182183        PCICFG_RD(SST1_PCI_INIT_ENABLE, j);
    183184        PCICFG_WR(SST1_PCI_INIT_ENABLE,
    184             ((j & ~SST_SCANLINE_SLV_OWNPCI) | SST_SCANLINE_SLI_SLV)); 
     185            ((j & ~SST_SCANLINE_SLV_OWNPCI) | SST_SCANLINE_SLI_SLV));
    185186        ISET(sstSlave->fbiInit1, IGET(sstSlave->fbiInit1) |
    186187          (SST_VIDEO_RESET | SST_EN_SCANLINE_INTERLEAVE));
     
    226227          SST_VID_CLK_DAC_DATA16_SEL);
    227228        ISET(sstSlave->fbiInit1, IGET(sstSlave->fbiInit1) &
    228           ~SST_VIDEO_VID_CLK_SLAVE); 
     229          ~SST_VIDEO_VID_CLK_SLAVE);
    229230        sst1CurrentBoard->fbiInit6 &= ~SST_SLI_SYNC_MASTER;
    230231        sst1CurrentBoard->fbiInit6 = ((sst1CurrentBoard->fbiInit6 &
     
    250251            ISET(sstSlave->fbiInit1, (IGET(sstSlave->fbiInit1) &
    251252                    ~(SST_VIDEO_VCLK_2X_OUTPUT_DEL | SST_VIDEO_VCLK_DEL |
    252                       SST_VIDEO_VCLK_SEL | SST_VIDEO_VCLK_2X_INPUT_DEL)) | 
     253                      SST_VIDEO_VCLK_SEL | SST_VIDEO_VCLK_2X_INPUT_DEL)) |
    253254                SST_EN_SCANLINE_INTERLEAVE |
    254255                // SST_VIDEO_VID_CLK_SLAVE |
    255256                // SST_VIDEO_VID_CLK_2X |
    256                 // SST_VIDEO_INVERT_VID_CLK_2X | 
     257                // SST_VIDEO_INVERT_VID_CLK_2X |
    257258                SST_VIDEO_VCLK_SEL |
    258259                SST_PCI_WRWS_1 |
     
    264265            ISET(sstSlave->fbiInit1, (IGET(sstSlave->fbiInit1) &
    265266                    ~(SST_VIDEO_VCLK_2X_OUTPUT_DEL | SST_VIDEO_VCLK_DEL |
    266                       SST_VIDEO_VCLK_SEL | SST_VIDEO_VCLK_2X_INPUT_DEL)) | 
     267                      SST_VIDEO_VCLK_SEL | SST_VIDEO_VCLK_2X_INPUT_DEL)) |
    267268                SST_EN_SCANLINE_INTERLEAVE |
    268269                // SST_VIDEO_VID_CLK_SLAVE |
     
    371372      SST_VID_CLK_DAC_DATA16_SEL);
    372373    ISET(sstMaster->fbiInit1, IGET(sstMaster->fbiInit1) &
    373       ~SST_VIDEO_VID_CLK_SLAVE); 
     374      ~SST_VIDEO_VID_CLK_SLAVE);
    374375    sst1CurrentBoard->fbiInit6 |= SST_SLI_SYNC_MASTER;
    375376    sst1CurrentBoard->fbiInit6 = ((sst1CurrentBoard->fbiInit6 &
     
    379380    ISET(sstMaster->fbiInit6, sst1CurrentBoard->fbiInit6);
    380381
    381     // Following work well up to around 100 MHz... 
     382    // Following work well up to around 100 MHz...
    382383    // masterVInClkDel = 2;
    383384    // masterVOutClkDel = 0;
     
    400401                ~(SST_VIDEO_VCLK_2X_OUTPUT_DEL | SST_VIDEO_VCLK_DEL |
    401402                  SST_VIDEO_VCLK_SEL | SST_VIDEO_VCLK_2X_INPUT_DEL |
    402                   SST_VIDEO_BLANK_EN)) | 
     403                  SST_VIDEO_BLANK_EN)) |
    403404            SST_EN_SCANLINE_INTERLEAVE |
    404405            // SST_VIDEO_VID_CLK_2X |
     
    417418                ~(SST_VIDEO_VCLK_2X_OUTPUT_DEL | SST_VIDEO_VCLK_DEL |
    418419                  SST_VIDEO_VCLK_SEL | SST_VIDEO_VCLK_2X_INPUT_DEL |
    419                   SST_VIDEO_BLANK_EN)) | 
     420                  SST_VIDEO_BLANK_EN)) |
    420421            SST_EN_SCANLINE_INTERLEAVE |
    421422            // SST_VIDEO_VID_CLK_2X |
     
    458459    PCICFG_RD(SST1_PCI_INIT_ENABLE, j);
    459460    PCICFG_WR(SST1_PCI_INIT_ENABLE,
    460         (j & ~(SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV))); 
     461        (j & ~(SST_SCANLINE_SLV_OWNPCI | SST_SCANLINE_SLI_SLV)));
    461462    MasterPhysAddr = sst1CurrentBoard->physAddr[0];
    462463    sst1InitReturnStatus(sstbase0); // flush pci packer with reads
     
    485486      if (!sst1InitCheckBoard(sstbase1)) return FXFALSE;
    486487      infoSlave = sst1CurrentBoard;
    487      
     488
    488489      /* fbi and tmu clock freqs should be equal since they are
    489490       * both set from sst1InitCalcGrxClk.
     
    491492      if (infoMaster->fbiGrxClkFreq != infoSlave->fbiGrxClkFreq) {
    492493        /* Recompute the actual clock rates before any clocking down
    493          * due to sli for some board revisions. 
     494         * due to sli for some board revisions.
    494495         */
    495496        if (!sst1InitCalcGrxClk(sstbase0)) return FXFALSE;
     
    513514         * They no longer need to match, but any future calls to
    514515         * sst1InitGetDeviceInfo should now reflect the current
    515          * minimized state of the world. 
     516         * minimized state of the world.
    516517         */
    517518        {
     
    520521          if (infoMaster->fbiMemSize != infoSlave->fbiMemSize) {
    521522            memSize = MIN(infoMaster->fbiMemSize, infoSlave->fbiMemSize);
    522             infoMaster->fbiMemSize = 
     523            infoMaster->fbiMemSize =
    523524            infoSlave->fbiMemSize  = memSize;
    524525          }
     
    581582    sst1InitReturnStatus(sstbase1);
    582583
    583     // De-assert reset to Graphics core... 
     584    // De-assert reset to Graphics core...
    584585    ISET(sstMaster->fbiInit0, IGET(sstMaster->fbiInit0) & ~SST_GRX_RESET);
    585586    sst1InitReturnStatus(sstbase0);
     
    587588    sst1InitReturnStatus(sstbase1);
    588589
    589     // De-assert reset to Video core... 
     590    // De-assert reset to Video core...
    590591    ISET(sstMaster->fbiInit1, IGET(sstMaster->fbiInit1) & ~SST_VIDEO_RESET);
    591592    sst1InitReturnStatus(sstbase0);
     
    707708    else
    708709      sliDetected = sst1InitSliPaired(sstbase);
    709        
     710
    710711    return sliDetected;
    711712        }
     
    717718**
    718719*/
    719 FX_ENTRY FxU32 FX_CALL 
     720FX_ENTRY FxU32 FX_CALL
    720721sst1InitSliPaired(FxU32 *sstbase)
    721722{
     
    725726    if(firstTime) {
    726727      SstRegs* sst = (SstRegs *) sstbase;
    727      
     728
    728729      sliPaired = (((IGET(sst->fbiInit5) & SST_SLI_DETECT) == SST_SLI_DETECT) &&
    729730                   (boardsInSystem > 1));
  • trunk/src/opengl/glide/cvg/init/sst1init.c

    r2888 r6653  
    11/*-*-c++-*-*/
     2/* $Id: sst1init.c,v 1.2 2001-09-05 14:30:42 bird Exp $ */
    23/*
    34** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
    45** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
    56** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
    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 
     7** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
     8** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
     9** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
    910** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
    10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 
    11 ** 
     11** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
     12**
    1213** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
    1314** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
     
    1516** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
    1617** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
    17 ** THE UNITED STATES. 
    18 ** 
     18** THE UNITED STATES.
     19**
    1920** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
    2021**
    21 ** $Revision: 1.1 $
    22 ** $Date: 2000-02-25 00:37:54 $
     22** $Revision: 1.2 $
     23** $Date: 2001-09-05 14:30:42 $
    2324**
    2425*/
     
    2930** NOTE: This code must compiled with optimizations DISABLED!!
    3031**
    31 ** The following environment variables can optionally be used to alter 
     32** The following environment variables can optionally be used to alter
    3233** functionality (A value of X is a "don't care"):
    3334**
     
    99100**                               960,    (960x720)
    100101**                               1024}   (1024x768)
    101 ** SSTV2_SLOWMEM_RTW             X       Insert wait state for read-to-write 
     102** SSTV2_SLOWMEM_RTW             X       Insert wait state for read-to-write
    102103**                                       transitions
    103 ** SSTV2_SLOWMEM_WTR             X       Insert wait state for write-to-read 
     104** SSTV2_SLOWMEM_WTR             X       Insert wait state for write-to-read
    104105**                                       transitions
    105106** SSTV2_SLOWPCIWR               X       Enable 1 wait-state PCI writes
     
    186187static FxU32 clearBoardInfo = FXTRUE;
    187188
    188 FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber, 
     189FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber,
    189190                                                   FxBool resetSLI)
    190191{
     
    204205    // Open PCI library (necessary for multiple calls to init routines, after
    205206    // PCI library is closed by pciClose() call in sst1InitShutdown().
    206     // 
     207    //
    207208    // NB: It is safe to do this even if we never called pciClose.
    208209    pciOpen();
     
    231232        // Clear board info structure
    232233        sst1InitClearBoardInfo();
    233        
     234
    234235        clearBoardInfo = FXFALSE;
    235236
     
    239240         * the vxd etc. This is not functionally longer fatal, but w/o
    240241         * it we will not be able to do things like set the caching on
    241          * the board's memory etc. This is bad. 
     242         * the board's memory etc. This is bad.
    242243         *
    243244         * The actual cost of doing the re-mapping again is pretty low
     
    323324       FxU32 k;
    324325       SstRegs *sst;
    325  
     326
    326327       for(k=0; k<boardsInSystemReally; k++) {
    327328          // Disable SLI if detected...
     
    331332          sst1CurrentBoard = &sst1BoardInfo[k];
    332333          sst = (SstRegs *) sstbase;
    333    
     334
    334335          if(IGET(sst->fbiInit1) & SST_EN_SCANLINE_INTERLEAVE) {
    335336             INIT_PRINTF(("sst1InitMapBoard(): Disabling Scanline Interleaving (board #%d)...\n", (k+1)));
     
    424425    PCICFG_WR(SST1_PCI_BUS_SNOOP0, SST_PCI_BUS_SNOOP_DEFAULT);
    425426    PCICFG_WR(SST1_PCI_BUS_SNOOP1, SST_PCI_BUS_SNOOP_DEFAULT);
    426     sst1InitReturnStatus(sstbase); // Stall - can't call IdleFbi because 
     427    sst1InitReturnStatus(sstbase); // Stall - can't call IdleFbi because
    427428    sst1InitReturnStatus(sstbase); // FBI could be hung at this stage
    428429    sst1InitReturnStatus(sstbase);
    429    
     430
    430431    // Adjust Trex-to-Fbi FIFO
    431432    if(GETENV(("SSTV2_TF_FIFO_THRESH")))
     
    573574            (tf2_clkdel<<SST_TEX_TF_CLK_DEL_ADJ_SHIFT);
    574575    }
    575     INIT_PRINTF(("sst1InitRegisters(): Storing TREX2INIT1=0x%x\n", 
     576    INIT_PRINTF(("sst1InitRegisters(): Storing TREX2INIT1=0x%x\n",
    576577        sst1CurrentBoard->tmuInit1[2]));
    577578
     
    662663    sst1InitIdleFBINoNOP(sstbase);
    663664
    664     sst1InitRenderingRegisters(sstbase);   
     665    sst1InitRenderingRegisters(sstbase);
    665666    sst1CurrentBoard->tmuRevision = 0xdead; // Force sst1InitFillDeviceInfo()
    666667    if(sst1InitFillDeviceInfo(sstbase, sst1CurrentBoard) == FXFALSE) {
     
    909910#ifndef __linux__
    910911        pciUnmapPhysical((FxU32)sst1CurrentBoard->virtAddr[0],
    911                         0x1000000UL);
     912            0x1000000UL);
    912913#endif
    913        
     914
    914915        if((++n > 1) || !sliEnabled)
    915916            break;
    916917    }
    917    
     918
    918919    /* sst1InitIdle(sstbase);  */
    919920
    920921#if !DIRECTX
    921     // 
     922    //
    922923    // HACK alert.
    923924    //
     
    940941    // cleared next time sst1InitMapBoard() is called.
    941942    clearBoardInfo = FXTRUE;
    942      
     943
    943944    return(FXTRUE);
    944945}
     
    980981      devInfo.sliDetected &&
    981982      !devInfo.monitorDetected) {
    982    
     983
    983984    SstRegs* tempAddr = NULL;
    984985
     
    997998    if (tempAddr != NULL) sstBaseAddr = tempAddr;
    998999  }
    999  
     1000
    10001001  return (FxU32*)sstBaseAddr;
    10011002}
     
    11001101**
    11011102*/
    1102 FX_ENTRY FxBool FX_CSTYLE 
     1103FX_ENTRY FxBool FX_CSTYLE
    11031104sst1InitCaching(FxU32* sstBase, FxBool enableP)
    11041105{
     
    11091110  if (enableP && (GETENV("SSTV2_IGNORE_CACHING") == NULL)) {
    11101111    FxU32 physAddr;
    1111    
     1112
    11121113    /* Get the board's base. Isn't this the same as what we
    11131114     * cary around in sst1CurrentBoard->physAddr[0]?
    11141115     */
    11151116    pciGetConfigData(PCI_BASE_ADDRESS_0, sst1CurrentBoard->deviceNumber, &physAddr);
    1116    
     1117
    11171118    // For some reason, there sometimes is a 008 at the end of the
    11181119    // physical address, so mask that puppy RTF out
     
    11341135#define kCacheSizeUncacheable  (0x1000UL)
    11351136      FxBool hasWC = pciFindMTRRMatch(physAddr, kCacheSizeWriteCombine,
    1136                                       PciMemTypeWriteCombining, 
     1137                                      PciMemTypeWriteCombining,
    11371138                                      &sst1CurrentBoard->mtrrWriteCombine);
    11381139      FxBool hasUC = pciFindMTRRMatch(physAddr, kCacheSizeUncacheable,
     
    11671168
    11681169      /* We only succeed if we have them both since having only uswc
    1169        * seems to cause problems. 
     1170       * seems to cause problems.
    11701171       */
    11711172      retVal = (hasWC && hasUC);
  • trunk/src/opengl/glide/cvg/init/util.c

    r2888 r6653  
    11/*-*-c++-*-*/
     2/* $Id: util.c,v 1.2 2001-09-05 14:30:42 bird Exp $ */
    23/*
    34** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
    45** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
    56** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
    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 
     7** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
     8** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
     9** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
    910** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
    10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 
    11 ** 
     11** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
     12**
    1213** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
    1314** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
     
    1516** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
    1617** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
    17 ** THE UNITED STATES. 
    18 ** 
     18** THE UNITED STATES.
     19**
    1920** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
    2021**
    21 ** $Revision: 1.1 $
    22 ** $Date: 2000-02-25 00:37:55 $
     22** $Revision: 1.2 $
     23** $Date: 2001-09-05 14:30:42 $
    2324**
    2425** Utility routines for SST-1 Initialization code
     
    345346    if(enable) {
    346347        // VGA controls monitor
    347         ISET(sst->fbiInit0, (IGET(sst->fbiInit0) & ~SST_EN_VGA_PASSTHRU) | 
     348        ISET(sst->fbiInit0, (IGET(sst->fbiInit0) & ~SST_EN_VGA_PASSTHRU) |
    348349            sst1CurrentBoard->vgaPassthruEnable);
    349350        ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_BLANK_EN);
    350351    } else {
    351352        // SST-1 controls monitor
    352         ISET(sst->fbiInit0, (IGET(sst->fbiInit0) & ~SST_EN_VGA_PASSTHRU) | 
     353        ISET(sst->fbiInit0, (IGET(sst->fbiInit0) & ~SST_EN_VGA_PASSTHRU) |
    353354            sst1CurrentBoard->vgaPassthruDisable);
    354355        ISET(sst->fbiInit1, IGET(sst->fbiInit1) & ~SST_VIDEO_BLANK_EN);
     
    493494   * they are managing. However, some registers cannot be accessed via
    494495   * the command fifo, and, inconveniently, these are not contiguously
    495    * allocated. 
     496   * allocated.
    496497   */
    497498  const FxU32 addrOffset = ((const FxU32)addr - (const FxU32)sst1CurrentBoard->virtAddr[0]);
     
    545546**
    546547*/
    547 FX_ENTRY FxBool FX_CALL sst1InitCmdFifo(FxU32 *sstbase, FxBool enable, 
     548FX_ENTRY FxBool FX_CALL sst1InitCmdFifo(FxU32 *sstbase, FxBool enable,
    548549  FxU32 *virtAddrStart, FxU32 *memAddrStart, FxU32 *size, FxSet32Proc set32Proc)
    549550{
     
    566567    if(enable == FXFALSE) {
    567568       // Remove any client set callbacks before continuing since
    568        // these must go straight to the hw. 
     569       // these must go straight to the hw.
    569570       sst1CurrentBoard->set32 = NULL;
    570571       sst1CurrentBoard->fbiCmdFifoEn = 0;
     
    621622    *size = fifoSize;
    622623
    623     if(!sst1InitCmdFifoDirect(sstbase, 0, 
    624                               fifoStart, fifoSize, 
     624    if(!sst1InitCmdFifoDirect(sstbase, 0,
     625                              fifoStart, fifoSize,
    625626                              directExec, disableHoles,
    626627                              set32Proc)) {
     
    628629      return(FXFALSE);
    629630    }
    630    
     631
    631632    if(sst1CurrentBoard->sliSlaveVirtAddr) {
    632633      if(!sst1InitCmdFifoDirect(sst1CurrentBoard->sliSlaveVirtAddr, 0,
    633                                fifoStart, fifoSize, 
     634                               fifoStart, fifoSize,
    634635                               directExec, disableHoles,
    635636                               set32Proc)) {
     
    646647**
    647648** sst1InitCmdFifoDirect():
    648 **   Explicitly initialize Command FIFO.  This routine is typically not 
     649**   Explicitly initialize Command FIFO.  This routine is typically not
    649650**   called directly from apps.
    650651**
     
    653654**
    654655*/
    655 FX_ENTRY FxBool FX_CALL sst1InitCmdFifoDirect(FxU32 *sstbase, FxU32 which, 
    656   FxU32 start, FxU32 size, FxBool directExec, FxBool disableHoles, 
     656FX_ENTRY FxBool FX_CALL sst1InitCmdFifoDirect(FxU32 *sstbase, FxU32 which,
     657  FxU32 start, FxU32 size, FxBool directExec, FxBool disableHoles,
    657658  FxSet32Proc set32Proc)
    658659{
     
    686687    // Disable memory-backed fifo, and disallow lfb and texture writes
    687688    // through command fifo...
    688     ISET(sst->fbiInit0, (IGET(sst->fbiInit0) & 
     689    ISET(sst->fbiInit0, (IGET(sst->fbiInit0) &
    689690      ~(SST_MEM_FIFO_EN | SST_EN_LFB_MEMFIFO | SST_EN_TEX_MEMFIFO)));
    690691    sst1InitReturnStatus(sstbase);
     
    751752**   and texture accesses do not pass through the command fifo.
    752753**   WARNING: No register writes of any kind may be performed between a
    753 **   sst1InitLfbLock() and sst1InitLfbUnlock() pair -- only lfb reads and 
     754**   sst1InitLfbLock() and sst1InitLfbUnlock() pair -- only lfb reads and
    754755**   writes are allowed.
    755756*/
     
    810811**   and texture accesses do not pass through the command fifo.
    811812**   WARNING: No register writes of any kind may be performed between a
    812 **   sst1InitLfbLock() and sst1InitLfbUnlock() pair -- only lfb reads and 
     813**   sst1InitLfbLock() and sst1InitLfbUnlock() pair -- only lfb reads and
    813814**   writes are allowed.
    814815*/
     
    925926        (pciCntrLoad<<SST_SIPROCESS_PCI_CNTR_SHIFT) |
    926927         SST_SIPROCESS_OSC_CNTR_RESET_N | SST_SIPROCESS_OSC_NAND_SEL);
    927    
     928
    928929       // Allow oscillator to run...
    929930       PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
     
    931932        (pciCntrLoad<<SST_SIPROCESS_PCI_CNTR_SHIFT) |
    932933         SST_SIPROCESS_OSC_CNTR_RUN | SST_SIPROCESS_OSC_NAND_SEL);
    933    
     934
    934935       // Loop until PCI counter decrements to 0
    935936       cntr = 0 ;
     
    938939          PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
    939940       } while(siProcess & SST_SIPROCESS_PCI_CNTR);
    940    
     941
    941942       PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
    942943       siProcess &= SST_SIPROCESS_OSC_CNTR;
     
    954955        (pciCntrLoad<<SST_SIPROCESS_PCI_CNTR_SHIFT) |
    955956         SST_SIPROCESS_OSC_CNTR_RESET_N | SST_SIPROCESS_OSC_NOR_SEL);
    956    
     957
    957958       // Allow oscillator to run...
    958959       PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
     
    960961       (pciCntrLoad<<SST_SIPROCESS_PCI_CNTR_SHIFT) |
    961962         SST_SIPROCESS_OSC_CNTR_RUN | SST_SIPROCESS_OSC_NOR_SEL);
    962    
     963
    963964       // Loop until PCI counter decrements to 0
    964965       cntr = 0 ;
     
    967968          PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
    968969       } while(siProcess & SST_SIPROCESS_PCI_CNTR);
    969    
     970
    970971       PCICFG_RD(SST1_PCI_SIPROCESS, siProcess);
    971972       siProcess &= SST_SIPROCESS_OSC_CNTR;
  • trunk/src/opengl/glide/cvg/init/video.c

    r2888 r6653  
    11/*-*-c++-*-*/
     2/* $Id: video.c,v 1.2 2001-09-05 14:30:43 bird Exp $ */
    23/*
    34** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
    45** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
    56** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
    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 
     7** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
     8** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
     9** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
    910** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
    10 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS. 
    11 ** 
     11** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
     12**
    1213** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
    1314** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
     
    1516** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
    1617** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
    17 ** THE UNITED STATES. 
    18 ** 
     18** THE UNITED STATES.
     19**
    1920** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
    2021**
    21 ** $Revision: 1.1 $
    22 ** $Date: 2000-02-25 00:37:55 $
     22** $Revision: 1.2 $
     23** $Date: 2001-09-05 14:30:43 $
    2324**
    2425** Initialization code for initializing SST-1 video unit
     
    161162      memSizeInPages <<= 1;
    162163
    163     // To be compatible with Voodoo1, if there is enough memory to 
     164    // To be compatible with Voodoo1, if there is enough memory to
    164165    // allocate an aux buffer, then do it...
    165166    if(nCol == 2 && nAux == 0) {
     
    211212    // Reset Video Refresh Unit
    212213    ISET(sst->fbiInit1, IGET(sst->fbiInit1) | SST_VIDEO_RESET);
    213    
     214
    214215    // Setup SST video timing registers
    215216    if(GETENV(("SSTV2_HSYNC"))) {
     
    267268    // Setup SST memory mapper for desired resolution
    268269    if(sst1CurrentBoard->fbiMemSize == 4)
    269         sst1InitSetResolution(sstbase, sstVideoRez, 1); 
     270        sst1InitSetResolution(sstbase, sstVideoRez, 1);
    270271    else
    271         sst1InitSetResolution(sstbase, sstVideoRez, 0); 
     272        sst1InitSetResolution(sstbase, sstVideoRez, 0);
    272273
    273274    // Calculate graphics clock frequency
     
    342343    if(sst1InitAllocBuffers(sstbase, nCol, nAux) == FXFALSE)
    343344       return(FXFALSE);
    344    
    345     INIT_PRINTF(("sst1InitVideo(): Allocating %d Color Buffers and %d Aux Buffer(s)...\n", 
     345
     346    INIT_PRINTF(("sst1InitVideo(): Allocating %d Color Buffers and %d Aux Buffer(s)...\n",
    346347                 sst1CurrentBoard->fbiVideoColBuffs, sst1CurrentBoard->fbiVideoAuxBuffs));
    347348    ISET(sst->fbiInit4, IGET(sst->fbiInit4) |
     
    389390        INIT_PRINTF(("sst1InitVideo(): Setting memory FIFO LWM to 0x%x (%d)\n",
    390391            sst1CurrentBoard->memFifoStatusLwm,
    391             sst1CurrentBoard->memFifoStatusLwm)); 
     392            sst1CurrentBoard->memFifoStatusLwm));
    392393    }
    393394
     
    665666**
    666667*/
    667 static FxBool 
     668static FxBool
    668669sst1InitAllocBuffersDirect(FxU32 *sstbase, FxU32 nColorBuffs, FxU32 nAuxBuffs)
    669670{
     
    689690       SST_BUFFER_ALLOC_3C1Z);
    690691   else {
    691      INIT_PRINTF(("sst1InitAllocBuffers(): Unsupported Color/Aux buffer combination (%d/%d)\n", 
     692     INIT_PRINTF(("sst1InitAllocBuffers(): Unsupported Color/Aux buffer combination (%d/%d)\n",
    692693                  nCol, nAux));
    693694     return(FXFALSE);
     
    698699}
    699700
    700 FX_EXPORT FxBool FX_CSTYLE 
     701FX_EXPORT FxBool FX_CSTYLE
    701702sst1InitAllocBuffers(FxU32 *sstbase, FxU32 nColorBuffs, FxU32 nAuxBuffs)
    702703{
     
    712713       return(FXFALSE);
    713714
    714    retVal = sst1InitAllocBuffersDirect(sstbase, 
     715   retVal = sst1InitAllocBuffersDirect(sstbase,
    715716                                       nColorBuffs, nAuxBuffs);
    716717
    717718   if (retVal && sst1CurrentBoard->sliDetected) {
    718719     /* NB: When writing to the slave we need to make sure that it does
    719       * not have a client callback installed. 
     720      * not have a client callback installed.
    720721      */
    721722     FxSet32Proc saveProc = sst1CurrentBoard->set32;
     
    797798**
    798799*/
    799 FX_EXPORT void FX_CSTYLE sst1InitSetResolution(FxU32 *sstbase, 
    800                                                sst1VideoTimingStruct *sstVideoRez, 
     800FX_EXPORT void FX_CSTYLE sst1InitSetResolution(FxU32 *sstbase,
     801                                               sst1VideoTimingStruct *sstVideoRez,
    801802                                               FxU32 Banked)
    802803{
     
    907908*/
    908909FX_EXPORT FxBool FX_CSTYLE sst1InitVideoBorder(FxU32 *sstbase,
    909                                                FxU32 mask, 
     910                                               FxU32 mask,
    910911                                               FxU32 color)
    911912{
     
    949950
    950951FX_EXPORT sst1VideoTimingStruct* FX_CSTYLE
    951 sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution, 
     952sst1InitFindVideoTimingStruct(GrScreenResolution_t screenResolution,
    952953                              GrScreenRefresh_t screenRefresh)
    953954{
     
    10141015
    10151016        case(GR_RESOLUTION_512x384):
    1016        
     1017
    10171018          if( GETENV( ("SSTV2_REFRESH_512x384") ) )
    10181019            refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_512x384") ) ) );
    1019            
     1020
    10201021          if(refreshRate == GR_REFRESH_120Hz)
    10211022             return(&SST_VREZ_512X384_120);
     
    10391040
    10401041        case(GR_RESOLUTION_640x400):
    1041        
     1042
    10421043          if( GETENV( ("SSTV2_REFRESH_640x400") ) )
    10431044            refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_640x400") ) ) );
    1044        
     1045
    10451046          if(refreshRate == GR_REFRESH_120Hz)
    10461047             return(&SST_VREZ_640X400_120);
     
    10541055
    10551056        case(GR_RESOLUTION_640x480):
    1056        
     1057
    10571058          if( GETENV( ("SSTV2_REFRESH_640x480") ) )
    10581059            refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_640x480") ) ) );
    1059            
     1060
    10601061          if(refreshRate == GR_REFRESH_120Hz)
    10611062             return(&SST_VREZ_640X480_120);
     
    10691070
    10701071        case(GR_RESOLUTION_800x600):
    1071        
     1072
    10721073          if( GETENV( ("SSTV2_REFRESH_800x600") ) )
    10731074            refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_800x600") ) ) );
    1074            
     1075
    10751076          if(refreshRate == GR_REFRESH_120Hz)
    10761077             return(&SST_VREZ_800X600_120);
     
    10901091          if( GETENV( ("SSTV2_REFRESH_960x720") ) )
    10911092            refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_960x720") ) ) );
    1092            
     1093
    10931094          if(refreshRate == GR_REFRESH_85Hz)
    10941095             return(&SST_VREZ_960X720_85);
     
    11001101
    11011102        case(GR_RESOLUTION_1024x768):
    1102        
     1103
    11031104          if( GETENV( ("SSTV2_REFRESH_1024x768") ) )
    11041105            refreshRate = sst1InitConvertRefreshRate( ATOI( GETENV( ("SSTV2_REFRESH_1024x768") ) ) );
    1105            
     1106
    11061107          if(refreshRate == GR_REFRESH_85Hz)
    11071108             return(&SST_VREZ_1024X768_85);
     
    11731174          j = IGET(sst->status);
    11741175      } while(!(j & SST_VRETRACE));
    1175  
     1176
    11761177      // Wait for active vsync
    11771178      do {
     
    12641265      else
    12651266         tf2_clkdel = 0x6;
    1266    } else 
     1267   } else
    12671268      tf2_clkdel = 0x6;
    12681269
     
    12741275      else
    12751276         tf1_clkdel = 0x6;
    1276    } else 
     1277   } else
    12771278      tf1_clkdel = 0x6;
    12781279
Note: See TracChangeset for help on using the changeset viewer.