glide2x, sst1/cvg: build fixes, warning fixes.
This commit is contained in:
@@ -16,8 +16,6 @@
|
||||
# Available options:
|
||||
#
|
||||
# Environment variables:
|
||||
# FX_GLIDE_HW build for the given ASIC (cvg).
|
||||
# default = cvg
|
||||
# CPU optimize for the given processor.
|
||||
# default = 6 (PentiumPro)
|
||||
# DEBUG=1 disable optimizations and build for debug.
|
||||
@@ -52,7 +50,6 @@ GLIDE_RES = glide.res
|
||||
GLIDE_DLL = glide2x.dll
|
||||
GLIDE_IMP = glide2x.lib
|
||||
|
||||
FX_GLIDE_HW ?= cvg
|
||||
FX_GLIDE_SW = ../../../swlibs
|
||||
GLIDE_LIBDIR = ../../lib
|
||||
|
||||
|
||||
@@ -69,9 +69,7 @@
|
||||
#include <fxdll.h>
|
||||
#include <glide.h>
|
||||
#include "fxglide.h"
|
||||
#ifdef __linux__
|
||||
#include <ctype.h>
|
||||
#endif
|
||||
|
||||
extern const int _grMipMapHostWH[GR_ASPECT_1x8 + 1][GR_LOD_1 + 1][2];
|
||||
extern FxU32 _gr_aspect_index_table[];
|
||||
|
||||
@@ -203,7 +203,7 @@ GLIDE_OBJECTS += \
|
||||
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.obj \
|
||||
$(FX_GLIDE_SW)/newpci/pcilib/fxw32.obj \
|
||||
$(FX_GLIDE_SW)/newpci/pcilib/fxvxd.obj \
|
||||
$(FX_GLIDE_SW)/newpci/pcilib/fxnt.obj \
|
||||
$(FX_GLIDE_SW)/newpci/pcilib/fxnt.obj
|
||||
|
||||
###############################################################################
|
||||
# rules
|
||||
|
||||
@@ -125,81 +125,81 @@ FxU32 _grMipMapHostSize[4][16] =
|
||||
const int _grMipMapHostWH[GR_ASPECT_1x8+1][GR_LOD_1+1][2] =
|
||||
{
|
||||
{
|
||||
256 , 32,
|
||||
128 , 16,
|
||||
64 , 8,
|
||||
32 , 4,
|
||||
16 , 2,
|
||||
8 , 1,
|
||||
4 , 1,
|
||||
2 , 1,
|
||||
1 , 1
|
||||
{ 256 , 32 },
|
||||
{ 128 , 16 },
|
||||
{ 64 , 8 },
|
||||
{ 32 , 4 },
|
||||
{ 16 , 2 },
|
||||
{ 8 , 1 },
|
||||
{ 4 , 1 },
|
||||
{ 2 , 1 },
|
||||
{ 1 , 1 }
|
||||
},
|
||||
{
|
||||
256 , 64,
|
||||
128 , 32,
|
||||
64 , 16,
|
||||
32 , 8,
|
||||
16 , 4,
|
||||
8 , 2,
|
||||
4 , 1,
|
||||
2 , 1,
|
||||
1 , 1
|
||||
{ 256 , 64 },
|
||||
{ 128 , 32 },
|
||||
{ 64 , 16 },
|
||||
{ 32 , 8 },
|
||||
{ 16 , 4 },
|
||||
{ 8 , 2 },
|
||||
{ 4 , 1 },
|
||||
{ 2 , 1 },
|
||||
{ 1 , 1 }
|
||||
},
|
||||
{
|
||||
256 , 128,
|
||||
128 , 64,
|
||||
64 , 32,
|
||||
32 , 16,
|
||||
16 , 8,
|
||||
8 , 4,
|
||||
4 , 2,
|
||||
2 , 1,
|
||||
1 , 1
|
||||
{ 256 , 128 },
|
||||
{ 128 , 64 },
|
||||
{ 64 , 32 },
|
||||
{ 32 , 16 },
|
||||
{ 16 , 8 },
|
||||
{ 8 , 4 },
|
||||
{ 4 , 2 },
|
||||
{ 2 , 1 },
|
||||
{ 1 , 1 }
|
||||
},
|
||||
{
|
||||
256 , 256,
|
||||
128 , 128,
|
||||
64 , 64,
|
||||
32 , 32,
|
||||
16 , 16,
|
||||
8 , 8,
|
||||
4 , 4,
|
||||
2 , 2,
|
||||
1 , 1
|
||||
{ 256 , 256 },
|
||||
{ 128 , 128 },
|
||||
{ 64 , 64 },
|
||||
{ 32 , 32 },
|
||||
{ 16 , 16 },
|
||||
{ 8 , 8 },
|
||||
{ 4 , 4 },
|
||||
{ 2 , 2 },
|
||||
{ 1 , 1 }
|
||||
},
|
||||
{
|
||||
128, 256,
|
||||
64, 128,
|
||||
32, 64 ,
|
||||
16, 32 ,
|
||||
8, 16 ,
|
||||
4, 8 ,
|
||||
2, 4 ,
|
||||
1, 2 ,
|
||||
1, 1
|
||||
{ 128, 256 },
|
||||
{ 64, 128 },
|
||||
{ 32, 64 },
|
||||
{ 16, 32 },
|
||||
{ 8, 16 },
|
||||
{ 4, 8 },
|
||||
{ 2, 4 },
|
||||
{ 1, 2 },
|
||||
{ 1, 1 }
|
||||
},
|
||||
{
|
||||
64, 256,
|
||||
32, 128,
|
||||
16, 64 ,
|
||||
8, 32 ,
|
||||
4, 16 ,
|
||||
2, 8 ,
|
||||
1, 4 ,
|
||||
1, 2 ,
|
||||
1, 1
|
||||
{ 64, 256 },
|
||||
{ 32, 128 },
|
||||
{ 16, 64 },
|
||||
{ 8, 32 },
|
||||
{ 4, 16 },
|
||||
{ 2, 8 },
|
||||
{ 1, 4 },
|
||||
{ 1, 2 },
|
||||
{ 1, 1 }
|
||||
},
|
||||
{
|
||||
32, 256,
|
||||
16, 128,
|
||||
8, 64 ,
|
||||
4, 32 ,
|
||||
2, 16 ,
|
||||
1, 8 ,
|
||||
1, 4 ,
|
||||
1, 2 ,
|
||||
1, 1
|
||||
{ 32, 256 },
|
||||
{ 16, 128 },
|
||||
{ 8, 64 },
|
||||
{ 4, 32 },
|
||||
{ 2, 16 },
|
||||
{ 1, 8 },
|
||||
{ 1, 4 },
|
||||
{ 1, 2 },
|
||||
{ 1, 1 }
|
||||
}
|
||||
};
|
||||
|
||||
@@ -625,15 +625,10 @@ GR_DIENTRY(grTexDownloadMipMapLevel, void,
|
||||
FxU16 rle_line[256];
|
||||
FxU16 *rle_line_end;
|
||||
|
||||
#ifdef __WIN32__
|
||||
#ifndef __WATCOMC__
|
||||
void rle_decode_line_asm(FxU16 *tlut,FxU8 *src,FxU16 *dest)
|
||||
{
|
||||
/* don't do anything just shut up the compiler */
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
void rle_decode_line_asm(FxU16 *tlut,FxU8 *src,FxU16 *dest) {
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <3dfx.h>
|
||||
#include <glidesys.h>
|
||||
|
||||
@@ -36,9 +36,7 @@
|
||||
#include <fxdll.h>
|
||||
#include <glide.h>
|
||||
#include "fxglide.h"
|
||||
#ifdef __linux__
|
||||
#include <ctype.h>
|
||||
#endif
|
||||
|
||||
extern const int _grMipMapHostWH[GR_ASPECT_1x8+1][GR_LOD_1+1][2];
|
||||
extern FxU32 _gr_aspect_index_table[];
|
||||
@@ -133,7 +131,7 @@ GR_DIENTRY(gu3dfGetInfo, FxBool,
|
||||
** grab statistics out of the header
|
||||
*/
|
||||
if( sscanf(buffer,"3df v%s %s lod range: %i %i aspect ratio: %i %i\n",
|
||||
&version,
|
||||
version,
|
||||
color_format,
|
||||
&small_lod, &large_lod,
|
||||
&aspect_width, &aspect_height ) == 0 )
|
||||
|
||||
@@ -608,7 +608,8 @@ GR_ENTRY(grSstWinOpen, FxBool, (
|
||||
oemi.linearAddress = gc->base_ptr;
|
||||
oemi.slaveAddress = NULL;
|
||||
if ((gc->oemInit = LoadLibrary("fxoem2x.dll")) != NULL) {
|
||||
if ((oemInitMapBoard = GetProcAddress(gc->oemInit, "_fxoemInitMapBoard@4")) != NULL) {
|
||||
oemInitMapBoard = GetProcAddress(gc->oemInit, "_fxoemInitMapBoard@4");
|
||||
if (oemInitMapBoard) {
|
||||
oemInitMapBoard(&oemi);
|
||||
}
|
||||
}
|
||||
@@ -702,8 +703,8 @@ GR_ENTRY(grSstWinOpen, FxBool, (
|
||||
oemi.vid.clkFreq24bpp = tvVidtiming.clkFreq24bpp;
|
||||
|
||||
if (gc->oemInit) {
|
||||
if ((oemInitVideoTiming = GetProcAddress(gc->oemInit, "_fxoemInitVideoTiming@4")) &&
|
||||
(oemInitMapBoard))
|
||||
oemInitVideoTiming = GetProcAddress(gc->oemInit, "_fxoemInitVideoTiming@4");
|
||||
if (oemInitVideoTiming && oemInitMapBoard)
|
||||
oemvidtiming = oemInitVideoTiming(&oemi);
|
||||
/*
|
||||
** video timing is updated by oem dll
|
||||
@@ -744,8 +745,8 @@ GR_ENTRY(grSstWinOpen, FxBool, (
|
||||
|
||||
#if (GLIDE_PLATFORM & GLIDE_OS_WIN32)
|
||||
if (gc->oemInit) {
|
||||
if ((oemInitSetVideo = GetProcAddress(gc->oemInit, "_fxoemInitSetVideo@4")) &&
|
||||
(oemInitMapBoard))
|
||||
oemInitSetVideo = GetProcAddress(gc->oemInit, "_fxoemInitSetVideo@4");
|
||||
if (oemInitSetVideo && oemInitMapBoard)
|
||||
oemInitSetVideo(&oemi);
|
||||
}
|
||||
#endif
|
||||
@@ -956,10 +957,8 @@ GR_ENTRY(grSstWinOpen, FxBool, (
|
||||
|
||||
if (!_GlideRoot.environment.noSplash) {
|
||||
HMODULE newSplash = LoadLibrary("3dfxsplash2.dll");
|
||||
|
||||
if (newSplash) {
|
||||
FARPROC fxSplash = GetProcAddress(newSplash, "_fxSplash@16");
|
||||
|
||||
if (fxSplash) {
|
||||
fxSplash(hWnd, gc->state.screen_width,
|
||||
gc->state.screen_height, nAuxBuffers);
|
||||
@@ -1056,7 +1055,8 @@ GR_ENTRY( grSstWinClose, void, ( void ) )
|
||||
initRestoreVideo();
|
||||
#if (GLIDE_PLATFORM & GLIDE_OS_WIN32)
|
||||
if (gc->oemInit) {
|
||||
if (oemRestoreVideo = GetProcAddress(gc->oemInit, "_fxoemRestoreVideo@0"))
|
||||
oemRestoreVideo = GetProcAddress(gc->oemInit, "_fxoemRestoreVideo@0");
|
||||
if (oemRestoreVideo)
|
||||
oemRestoreVideo();
|
||||
FreeLibrary(gc->oemInit);
|
||||
}
|
||||
@@ -1099,9 +1099,9 @@ GR_ENTRY(grSstControl, FxBool, ( GrControl_t code ))
|
||||
xRes = initControl(code);
|
||||
#if (GLIDE_PLATFORM & GLIDE_OS_WIN32)
|
||||
{
|
||||
FARPROC oemControl = NULL;
|
||||
if (gc->oemInit) {
|
||||
if ((oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4")))
|
||||
FARPROC oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4");
|
||||
if (oemControl)
|
||||
oemControl(code);
|
||||
}
|
||||
}
|
||||
@@ -1150,9 +1150,9 @@ GR_ENTRY(grSstControl, FxBool, ( GrControl_t code ))
|
||||
ctrlflag = initControl(code);
|
||||
#if (GLIDE_PLATFORM & GLIDE_OS_WIN32)
|
||||
{
|
||||
FARPROC oemControl = NULL;
|
||||
if (gc->oemInit) {
|
||||
if ((oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4")))
|
||||
FARPROC oemControl = GetProcAddress(gc->oemInit, "_fxoemControl@4");
|
||||
if (oemControl)
|
||||
oemControl(code);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#include "init.h"
|
||||
#include "fxinit.h"
|
||||
|
||||
@@ -45,7 +44,19 @@
|
||||
#ifdef _WIN32
|
||||
#define _WIN32_LEAN_AND_MEAN_
|
||||
#include <windows.h>
|
||||
#ifdef __MINGW32__
|
||||
static inline unsigned char _inp_asm (unsigned short _port) {
|
||||
unsigned char rc;
|
||||
__asm__ __volatile__ ("inb %w1,%b0" : "=a" (rc) : "Nd" (_port));
|
||||
return rc;
|
||||
}
|
||||
static inline void _outp_asm (unsigned short _port, unsigned char _data) {
|
||||
__asm__ __volatile__ ("outb %b0,%w1" : : "a" (_data), "Nd" (_port));
|
||||
}
|
||||
#define _inp _inp_asm
|
||||
#define _outp _outp_asm
|
||||
#endif
|
||||
#endif /* _WIN32 */
|
||||
|
||||
#include <fxpci.h>
|
||||
#include <gdebug.h>
|
||||
|
||||
@@ -38,6 +38,18 @@
|
||||
|
||||
#ifdef __WIN32__
|
||||
#include <windows.h>
|
||||
#ifdef __MINGW32__
|
||||
static inline unsigned char _inp_asm (unsigned short _port) {
|
||||
unsigned char rc;
|
||||
__asm__ __volatile__ ("inb %w1,%b0" : "=a" (rc) : "Nd" (_port));
|
||||
return rc;
|
||||
}
|
||||
static inline void _outp_asm (unsigned short _port, unsigned char _data) {
|
||||
__asm__ __volatile__ ("outb %b0,%w1" : : "a" (_data), "Nd" (_port));
|
||||
}
|
||||
#define _inp _inp_asm
|
||||
#define _outp _outp_asm
|
||||
#endif
|
||||
#endif /* __WIN32__ */
|
||||
|
||||
#if defined(__WATCOMC__)
|
||||
|
||||
@@ -38,6 +38,22 @@
|
||||
|
||||
#ifdef __WIN32__
|
||||
#include <windows.h>
|
||||
#ifdef __MINGW32__
|
||||
static inline unsigned char _inp_asm (unsigned short _port) {
|
||||
unsigned char rc;
|
||||
__asm__ __volatile__ ("inb %w1,%b0" : "=a" (rc) : "Nd" (_port));
|
||||
return rc;
|
||||
}
|
||||
static inline void _outp_asm (unsigned short _port, unsigned char _data) {
|
||||
__asm__ __volatile__ ("outb %b0,%w1" : : "a" (_data), "Nd" (_port));
|
||||
}
|
||||
static inline void _outpw_asm (unsigned short _port, unsigned short _data) {
|
||||
__asm__ __volatile__ ("outw %w0,%w1" : : "a" (_data), "Nd" (_port));
|
||||
}
|
||||
#define _outpw _outpw_asm
|
||||
#define _inp _inp_asm
|
||||
#define _outp _outp_asm
|
||||
#endif
|
||||
#endif /* __WIN32__ */
|
||||
|
||||
#define INIT_MCRX_LIB
|
||||
|
||||
Reference in New Issue
Block a user