837 Commits

Author SHA1 Message Date
48e1209c00 trial 2026-03-27 01:52:16 +01:00
d360e9684e test 2026-03-27 01:43:19 +01:00
4253416778 trial 2026-03-27 01:25:22 +01:00
a0f1117bc7 restore nop for mmx 2026-03-27 01:08:06 +01:00
2fb623617d woups 2026-03-27 00:55:30 +01:00
8c63c25d3d fix mmx on linux 2026-03-27 00:54:20 +01:00
1458b8f773 remove no-strict-aliasing 2026-03-27 00:38:57 +01:00
57d57e8161 Revert "trial"
This reverts commit 58692a7fd8.
2026-03-27 00:38:26 +01:00
58692a7fd8 trial 2026-03-27 00:22:05 +01:00
79f59f3c97 work 2026-03-27 00:03:45 +01:00
c111f47e42 add execution bit (again) 2026-03-25 20:12:31 +01:00
a7ffcad6a3 test 2026-03-25 01:35:47 +01:00
ea6b9fa72a test 2026-03-25 01:22:58 +01:00
272994024c test 2026-03-25 01:11:31 +01:00
ec0b7e35b9 grrr 2026-03-25 00:45:07 +01:00
583de68697 cleanning 2026-03-25 00:29:34 +01:00
1acaf93b2d clean 2026-03-25 00:00:23 +01:00
92b702246d work 2026-03-24 23:26:47 +01:00
c83f76c089 work 2026-03-24 23:17:05 +01:00
69aede93a6 work 2026-03-24 23:10:28 +01:00
7ba493dec6 fix asm 2026-03-24 22:59:06 +01:00
53aff71bbd update makefiles 2026-03-24 22:49:12 +01:00
85266ef91e fix compilation 2026-03-24 22:03:03 +01:00
4c9d7d88f0 remove binary files 2026-03-24 21:51:57 +01:00
6a464b6985 fix cqse again 2026-03-24 21:37:26 +01:00
76dd80b647 remove temp files 2026-03-24 21:27:28 +01:00
d3b0a2617e fix case 2026-03-24 21:26:32 +01:00
8f164d5664 fix 2026-03-24 21:21:21 +01:00
c416c1b7a2 trial 2026-03-24 21:11:02 +01:00
8d7d0b0ab9 fix 2.6.24 device creation (and hopefully later kernels) 2026-03-24 20:36:39 +01:00
2ec5dc2709 revert to old driver (ugly tree, will fix that later) 2026-03-24 01:19:53 +01:00
4816fb5893 arch opts 2026-03-23 23:23:27 +01:00
4267922ec2 CRLF fix 2026-03-23 23:16:31 +01:00
a9cc616aeb bump version 2026-03-21 02:22:34 +01:00
6234780d24 fix + opt 2026-03-21 02:07:00 +01:00
ed1812e9ce bump glide2 versions 2026-03-21 01:52:44 +01:00
159f4518d5 trying to sync headers... 2026-03-21 01:23:04 +01:00
578e623aad fix build 2026-03-20 23:37:27 +01:00
759ac19aff implement device_class to auto create /dev/3dfx 2026-03-20 20:42:31 +01:00
df592b464f add execution bit to rules file for debian packaging 2026-03-20 20:12:55 +01:00
6717a618ac integration 2026-03-20 19:48:08 +01:00
8a704cd926 fix target 2026-03-20 19:10:32 +01:00
d0735d0b99 implement simple debian module package creation 2026-03-20 18:35:39 +01:00
Khralkatorrix
ee38094805 glide2x, glide3x: On MSVC, don't treat warning as error for glide tests.
Signed-off-by: Khralkatorrix <garuda2550@gmail.com>
2024-01-27 18:23:24 +03:00
Ozkan Sezer
6e79c3d9b7 add note to glide3x README about swlibs. 2022-12-25 14:02:40 +03:00
Jonathan Schleifer
d86e089d35 Fix compilation with MinGW
Change the 'extern inline' procedures in fxglide.h to 'static inline' .
2022-12-25 12:02:40 +01:00
Ozkan Sezer
7d4a1ddda1 h3/h5, minihwc: inline configmg code, remove win9x.asm. 2022-07-23 03:28:28 +03:00
Ozkan Sezer
5ba939612e sst1: sync glide2/3 versions of makefiles, minor reorganization in init. 2021-11-11 17:50:04 +03:00
Ozkan Sezer
85186e0206 remove irrelevant ssttype checks from individual hw code 2021-11-11 17:37:50 +03:00
Ozkan Sezer
587e01e573 do not include SST1 and SST96 init codes together. 2021-11-11 17:37:04 +03:00
Ozkan Sezer
a20bb982cc cvg, sst1: tweak another getenv() usage. 2021-11-11 17:33:40 +03:00
Ozkan Sezer
5ffccc63b8 cvg, sst1, sst96: cache the getenv() results in init code. 2021-11-11 17:33:32 +03:00
Ozkan Sezer
c9727c8829 shortened a few error messages 2021-11-11 17:33:02 +03:00
Ozkan Sezer
d254f7f28e reverted commit a6ceeebd00 from glide2x/h3 - not needed. 2021-08-08 23:55:50 +03:00
Ozkan Sezer
170185784e fxpci.c (pciOpen): commented out assert(0) for !busDetected case :
let the procedure return false with pciErrorCode == PCI_ERR_NO_BUS
2021-08-08 23:55:50 +03:00
Ozkan Sezer
a6ceeebd00 h3, h5, grGlideInit: return if _GlideRoot.hwConfig.num_sst == 0:
In case of error, _GlideInitEnvironment() calls GrErrorCallback() which is
supposed to be a noreturn function, but it really is not for non-windows..
Eww...
2021-08-08 23:55:10 +03:00
Ozkan Sezer
67ad843c88 removed dxe description from djgpp dxe builds 2021-08-08 23:55:04 +03:00
Ozkan Sezer
f7bcf2ba77 h3, minihwc.c: added missing string.h include 2021-08-08 23:55:02 +03:00
Ozkan Sezer
5e6b39fb2b h3/h5, hwcInit, GLIDE_INIT_HWC: set errorString in case of failure. 2021-08-08 20:23:02 +03:00
Ozkan Sezer
43fbe0bf3c minor warning fixes. 2021-02-02 11:11:10 +03:00
Ozkan Sezer
438ac12be4 fix typo from unintended search/replace 2020-11-27 11:44:50 +03:00
Ozkan Sezer
1f827a4602 glide2x/README: added note about cross-compiling on 64-bit hosts. 2020-10-07 23:00:50 +03:00
Ozkan Sezer
acddb52685 glide3x/sst1: replaced several [unsigned] long type usage with FxI32/FxU32
should fix issue noted at
e8f60ad8bb (commitcomment-40186242)

the glide2x tree in whole needs a similar massage..
2020-10-07 23:00:40 +03:00
Ozkan Sezer
fe35279d12 updated djgpp cross-build scripts 2020-07-08 15:10:00 +03:00
Ozkan Sezer
6d671089f6 added quick shell scripts for djgpp cross-compile. 2020-07-08 14:32:30 +03:00
sezero
1ceb326d78 added top-level 3DFX GLIDE Source Code General Public License file. 2019-09-11 11:11:50 +03:00
sezero
9fbf8482a8 swlibs: remove rest of the old makefiles
the old glide-devel-branch has them for reference.
2019-09-08 01:20:00 +03:00
sezero
f0adaa0423 glide2x: remove rest of the old makefiles
the old glide-devel-branch has them for reference.
2019-09-08 01:10:00 +03:00
sezero
0cfcfe0e88 glide2x: added new Makefiles for tests. 2019-09-08 00:28:00 +03:00
sezero
8522edee5c glide2x: allow disabling the splash screen and the shameless plug code. 2019-07-07 00:47:28 +03:00
sezero
8be8bb66b5 glide2x, sst1: use different lib directories for sst1 and sst96 targets,
just like we do in the glide3x/sst1 tree.
2019-07-06 23:44:02 +03:00
sezero
91669cea49 glide2x, sst1: use different lib directories for sst1 and sst96 targets,
just like we do in the glide3x/sst1 tree.
2019-07-06 23:33:10 +03:00
sezero
305fab3650 glide2x: initial makefiles to target DOS/DJGPP.
build-tested yet, will see if they actually run later.
2019-07-06 18:37:00 +03:00
sezero
a5e52f47f5 glide2x djgpp build fixes #7/7:
h3, dos_mode.c: backported a fix by Daniel Borca from commit 3e642e03.
2019-07-06 14:06:40 +03:00
sezero
671cee61eb glide2x djgpp build fixes #6/7:
h3, dos_mode.c: add missing includes.
2019-07-06 14:06:07 +03:00
sezero
7f50068a47 glide2x djgpp build fixes #5/7:
h3, minihwc.c, gdebug.c: minor warning fixes.
2019-07-06 14:05:50 +03:00
sezero
ccadf5f395 glide2x djgpp build fixes #4/7:
sst1: change Int10 handler code to build if GLIDE_DEBUG10 is defined
instead of just GLIDE_DEBUG. (same thing is done in glide3x/sst1 tree.)
the code is for watcom, but can actually be ported to djgpp if it is
really needed some day.
2019-07-06 14:05:35 +03:00
sezero
1096fc0efb glide2x djgpp build fixes #3/7:
enable rle_decode_line_asm() stub for djgpp builds too.
2019-07-06 14:05:18 +03:00
sezero
0e352d42c1 glide2x djgpp build fixes #2/7:
gerror.c: _guHeapCheck() is for watcom builds only due to _heapchk()
2019-07-06 14:05:04 +03:00
sezero
ee5fecf71f glide2x djgpp build fixes #1/7:
sst1, gerror.c: add proper dos includes for djgpp
2019-07-06 14:04:45 +03:00
sezero
26c95e24f6 glide2x, h3: added cinit from glide3x after removing napalm-only bits. 2019-07-06 14:03:26 +03:00
sezero
a0f4e5a4e6 sst1: a bit more style cleanup 2018-11-05 21:50:20 +03:00
sezero
347ccd8391 glide2x, sst1/sst96, init: added includes for djgpp 2018-11-05 19:41:28 +03:00
sezero
c468e627e7 sst1/sst96: some whitespace/style cleanup.
also removed commented out code from glide3x _grChromaRangeExt(),
guGammaCorrectionRGB() and grLoadGammaTable().

the djgpp dxe output is still exactly the same.
2018-11-05 19:35:55 +03:00
sezero
426c3988a3 glide2x, cvg: fix fxoem2x.dll build (in case it ever gets enabled.) 2018-09-12 14:00:02 +03:00
sezero
da8d31c9d5 Makefile.mingw: revise so that it works for both cross- and native-builds 2018-09-11 23:00:02 +03:00
sezero
50de6810a0 Makefile.wat: fix linkage of texus.exe if run with TEXUS2=1 2018-09-11 19:15:02 +03:00
sezero
cd39eb5320 fx64.h: Watcom 11.0 added "long long" support, adjust accordingly.
The legacy Watcom <= 10.5 code of 3dfx didn't compile using OpenWatcom.
2018-09-11 19:10:51 +03:00
sezero
99ee5eec74 Makefile.wat: revise so that watcom builds work on both linux and win32
- not tested on pure dos, and it shouldn't be a problem really..
- this needs to be done for Makefile.DJ and Makefile.mingw, too.
2018-09-11 17:21:04 +03:00
sezero
186bb19d28 tests, tlib.c: include conio.h for watcom builds 2018-09-11 17:20:01 +03:00
sezero
274d0d31c2 3dfx.h, glidesys.h: check __MSDOS__ along with __DOS__
Necessary when they are used for building 3rd-party programs.
__DOS__ is defined by Watcom, __MSDOS__ is defined by DJGPP.
2018-09-10 06:55:10 +03:00
sezero
01f2e823f7 Makefile.wat: use -bt=dos option for cross-builds to target dos correctly 2018-09-10 06:27:50 +03:00
sezero
fa2272350a Makefile.linux updates for XPATH usage: add and use X11LIBS variable. 2018-08-30 17:51:56 +03:00
sezero
4a33160a11 glide2x, sst1, Makefile.linux: updated XPATH usage to match glide3x tree
minor tidy-up in its glide3x counterpart.
2018-08-30 17:05:56 +03:00
sezero
c93f294492 sst1, init96.c: fixed minor warning in DEBUG builds 2018-08-30 17:04:05 +03:00
sezero
34fa903aea glide2x, cvg: fixed DEBUG builds. 2018-08-30 17:03:20 +03:00
sezero
2a770d57d5 cvg, gglide.c (grBufferClear): avoid parentheses warning.
binary output is identical.
2018-08-30 17:02:47 +03:00
sezero
a7b3d9290c glide3x, h5: remove gendate.h dependency.
BUILD_DATE is not used anywhare, at all.
2018-08-30 16:01:55 +03:00
sezero
e2dd1b0ba0 fxbldno.c: minor warning fixes. 2018-08-30 15:40:32 +03:00
sezero
11f9ba7f56 glide3x, Makefile.DJ: tweaked DXE descriptions. 2018-08-25 21:21:10 +03:00
sezero
5db23883e9 glide3x, Makefile.win32: reverted most parts of commit 8c917cb2 2018-08-25 21:20:30 +03:00
sezero
72028096b9 g3df.c: fix msvc build because of a sign-compare warning after 66386d5 2018-08-25 21:05:15 +03:00
sezero
ed0fb7ba52 h3/h5, lin_mode.c, linhwc.c (loadEnvFile): don't leak FILE* pointer 2018-08-24 23:10:40 +03:00
sezero
dbcbbb1313 sst1, sst1InitVoodooFile(): don't leak FILE* pointer in case of failure 2018-08-24 21:55:50 +03:00
sezero
db8ef4d0ef cvg,sst1, init: shortened a few messages. 2018-08-24 21:03:55 +03:00
sezero
575bafe6c9 glide3x: remove obsoleted README, and rename README.2 to README
also edit the Voodoo Rush entry to mention Macronix along with AT3D
2018-08-23 17:20:50 +03:00
sezero
e11ac4e5db h5, tests: rename Makefile.mgw to Makefile.mingw 2018-08-23 15:39:24 +03:00
sezero
0402d46e43 fxos.c, fxGethostname: fix a strict aliasing issue 2018-08-23 15:37:20 +03:00
sezero
cec38774f4 glide3x, tests: sbench depends on fxos.o for non-linux. 2018-08-23 15:20:02 +03:00
sezero
661f489f88 tests: conio.h or linutil.h includes are not needed
kbhit() and getch() are called from tlib
2018-08-23 14:33:50 +03:00
sezero
c430cef2b2 glide3x,tests,sbench.c: rename PI to FX_PI (avoid redefinition warnings) 2018-08-23 14:11:30 +03:00
sezero
4a72d2061d glide3x, tests, tlib.c: add missing DJGPP includes for cvg, h3 and sst1 2018-08-23 14:05:55 +03:00
sezero
eb40729806 glide3x: remove old makefiles, which are obsoleted for quite some time.
the master branch still has the old makefiles I guess, so, look at the
master branch if need reference.

update sst1 makefiles to store the libs under individual sst1 and sst96
directories.

update linux makefiles for XPATH variable usage.

rename makefile.linux to Makefile.linux under the tests directories.
2018-08-23 14:00:02 +03:00
sezero
bd3e0372c1 glide3x, tests, sbench.c: fix build errors:
sbench.c:300: error: lvalue required as left operand of assignment
sbench.c:301: error: lvalue required as left operand of assignment
sbench.c:375: error: lvalue required as left operand of assignment
sbench.c:376: error: lvalue required as left operand of assignment

I _think_ this is the correct fix: MSVC6 generates the same output
before and after this patch.
2018-08-23 03:47:50 +03:00
sezero
d565bf19ef glide3x, tests: more build fixes -- mostly for windows this time. 2018-08-23 01:20:20 +03:00
sezero
2ab9b505eb glide3x, tests: applied warning and build fixes from glide2x tree. 2018-08-23 00:28:02 +03:00
sezero
f2e22ecf56 glide2x, tests: minor tidy-up. 2018-08-22 22:55:40 +03:00
sezero
8574e105f2 glide2x,tests,display.c: silence 'diff.data' may be used uninitialized warning. 2018-08-22 22:44:50 +03:00
sezero
a4a70bba5b glide2x, tests: initialize firstTime to 1 instead of 0. 2018-08-22 22:20:10 +03:00
sezero
e649ca4613 glide2x, tests: comment out unused helper proc in plib.c 2018-08-22 22:02:28 +03:00
sezero
64b744733d glide2x, tests: fix out-of-bounds access to localVerts in test25.c 2018-08-22 21:55:02 +03:00
sezero
e7cc47e93e glide2x, tests: fix format warning test25.c 2018-08-22 21:36:33 +03:00
sezero
c6de03a346 glide2x, tests: fix warning from qatest00.c:
qatest00.c:517: warning: operation on 'nCurrAlpha' may be undefined
qatest00.c:528: warning: operation on 'nCurrAlpha' may be undefined
2018-08-22 21:32:40 +03:00
sezero
40230a559e glide2x, tests: replace exit()s with return 2018-08-22 20:33:33 +03:00
sezero
ffac0696a3 glide3x: applied commit fd64b6ac of guillemj to the sst1 testsuite. 2018-08-22 16:27:02 +03:00
sezero
1567a193fe glide2x, testsuite updates:
- style tidy-up in cvg and h3
- applied commit df4085a to sst1 tree
- there are suspicious -Wuninitialized warning fixes,
  will revisit them soon.
2018-08-22 16:15:37 +03:00
sezero
14c8945a32 tests, tlib.c, tlib.h: silence / fix warnings:
fix wrong error check in SimpleRleDecode() (thanks gcc -Wsign-compare).
fix some old wrong warning fixes in glide2x tree.
also remove ctype.h dependency and use a generic strupr().
2018-08-22 14:03:15 +03:00
sezero
e3612b4f58 add missing symlinks to Makefile.linux 2018-08-22 11:32:24 +03:00
sezero
b8c4edab9d glide2x: merge scanf() and fread() updates to g3df.c and gpci.c from glide3x 2018-08-22 03:15:56 +03:00
sezero
66386d5ac4 h5, g3df.c: fix wrong error fread() checks.
commit 4b63afa8 by jwrdegoede added fread() checks like:

 if(fread(buf,size,nelem,fp) != size*nelem) error();

however the check must be against nelem alone, and _not_
the total bytes.
2018-08-22 02:24:24 +03:00
sezero
c30be75227 g3df.c (ReadDataShort): slightly shortened by adapting from original glide2x/sst1 version. 2018-08-22 02:11:36 +03:00
sezero
7ced8d7f32 g3df.c: don't leak the FILE* in failure cases.
only h5 handled that but with inlined fclose() and FXFALSE returns.
used goto statements to simplify things.
2018-08-22 02:06:40 +03:00
sezero
5d1a34c31c h3, h5: fix a few uninitialized warnings 2018-08-21 14:05:50 +03:00
sezero
2d63cec195 h5, minihwc (hwcMapBoard): avoid shadowing a local var. 2018-08-21 12:55:02 +03:00
sezero
4a6f09253a fix my stupid typo from commit 85ec47f 2018-08-21 04:20:04 +03:00
sezero
85ec47f22b glide3x, h3/h5: changed threadValue stuff from FxU32 to unsigned long. 2018-08-21 04:11:28 +03:00
sezero
d04deb23d6 h5, minihwc (hwcMapBoard): make length const FxI32 type. 2018-08-21 04:10:50 +03:00
sezero
c4b365abdf h5, minihwc (hwcAAScreenShot): change fileNameNum to unsigned int type. 2018-08-21 04:10:24 +03:00
sezero
e4fc9db7db h3, minihwc (hwcInitRegisters): fix stupid printf/sprintf/FN_NAME typos
was there since the beginning.
2018-08-21 04:10:00 +03:00
sezero
537a15a2fc glide2x/cvg (grBufferClear): revert a parentheses warning fix from 2000
Building glide3x/cvg, gcc emits the following warning:
gglide.c: In function `grBufferClear':
gglide.c:733: warning: suggest parentheses around arithmetic in operand of |

... but glide2x/cvg is silent for it, because commit df4085a80 from
about 18 years ago added parentheses to silence it, like:

 GR_SET(BROADCAST_ID, hw, bltSize,
 - ( ((((tileHi - tileLow) * gc->hwDep.cvgDep.xTilePages) - 1) << 16) | (0x1000 >> 3)  - 1));
 + ((((((tileHi - tileLow) * gc->hwDep.cvgDep.xTilePages) - 1) << 16) | (0x1000 >> 3)) - 1));

... which seems wrong.  Substraction has precedence, therefore the
original code OR'ed the size by 511,  but the fixed code OR'ed the
size by 512 and then substracted 1 from the result.

Looking at sst1InitVideoBuffers() init/video.c: it sets sst->bltSize
like:

 ISET(sst->bltSize, ((pagesToFill-1)<<16) | 511);

Therefore, reverting this part of df4085a80 now.  We can live with the
warning.
2018-08-21 00:15:55 +03:00
sezero
46ca75c1dd glide2x, sst1: unused variable warning fixes. 2018-08-20 22:30:55 +03:00
sezero
36dc997a1d glide2x, sst1, gglide.c: warning fix:
gglide.c: In function `grAlphaCombine':
gglide.c:337: warning: suggest explicit braces to avoid ambiguous `else'
gglide.c: In function `grColorCombine':
gglide.c:917: warning: suggest explicit braces to avoid ambiguous `else'
2018-08-20 22:30:15 +03:00
sezero
d2c076b8ab fix some unused variable warnings 2018-08-20 20:55:32 +03:00
sezero
19c5f4e705 glide2x, cvg, oeminit.c: ifdef magic 2018-08-20 20:24:05 +03:00
sezero
ee6f124929 sst1: fix argc arg of main() 2018-08-20 20:16:20 +03:00
sezero
4d29b7f47f glide2x, sst1, ddgump.c: silence unitialized warnings. 2018-08-20 20:01:56 +03:00
sezero
8ee1de4bcf glide2x, h3, linhwc.c: fix a strict aliasing issue (same as in sst96.)
also make some stuff static.
2018-08-20 19:56:02 +03:00
sezero
c8f2b9f621 glide2x, sst1/cvg init: merge scanf updates from glide3x 2018-08-20 19:35:50 +03:00
sezero
c94050cb87 glide2x: added top-level makefiles. 2018-08-20 17:37:02 +03:00
sezero
3e2cc50867 glide3x,sst1 (sst1InitVoodooFile, INIT_LINUX): changed path separator to '/' 2018-08-20 17:01:36 +03:00
sezero
fa071d0a93 glide2x, sst1: fixed incompatible assignment warning for swapBuffers().
kept the original case in commented out form.
2018-08-20 16:40:57 +03:00
sezero
d39173dfd2 missed replacing an instance of '(char) NULL' with 0 2018-08-20 15:50:02 +03:00
sezero
ccf3cc1dc9 forgot renaming glide3x/sst1 version of makefile.linux 2018-08-20 15:10:00 +03:00
sezero
3be55b6512 fix "unknown conversion type character `v' in format" 2018-08-20 15:07:00 +03:00
sezero
0f6ca06167 rename makefile.linux -> Makefile.linux 2018-08-20 14:47:02 +03:00
sezero
61ebabbc40 glide2x: remove dependency on ctype.h functionality 2018-08-20 14:32:24 +03:00
sezero
103dec9ab9 glide2x,sst96: merged dborca commit 2506470 (Rush: fixed grLfbLock(AUXBUFFER)) 2018-08-20 14:00:02 +03:00
sezero
a5352b0145 glide2x, cvg, cpuid.c: fix strict aliasing issues with newer gcc 2018-08-20 13:45:01 +03:00
sezero
34b5d19350 remove a duplicated windows.h include 2018-08-20 11:40:15 +03:00
sezero
9ba0795fc7 glide2x: added experimental MinGW makefiles. 2018-08-20 10:23:10 +03:00
sezero
e9133561f1 glide2x, init96MapBoard: uncomment initAT3DGetHALData() (we do have initat3d.c) 2018-08-20 01:58:04 +03:00
sezero
5ebace29f9 more warning fixing and syncing glide2x init with glide3x 2018-08-20 01:34:20 +03:00
sezero
ece8c244f3 glide2x, cvg, sst1init: update P6FENCE macros from glide3 2018-08-20 01:33:24 +03:00
sezero
1488d68cff a bunch of warning fixes 2018-08-19 23:55:10 +03:00
sezero
ed2350c8f0 glide2x, sst1, vgdrvr.c: rename gamma() to sst1gamma() 2018-08-19 19:01:56 +03:00
sezero
54e3669349 glide2x, h3: added a Windows (MSVC6) makefile 2018-08-19 17:55:02 +03:00
sezero
ed11fcc3cc glide2x, h3: add windows build dependency 2018-08-19 17:51:00 +03:00
sezero
90d647cfa6 glide2x, h3, minihwc.c: minor warning fixes 2018-08-19 16:45:11 +03:00
sezero
ffb144a87e glide2x, h3, minihwc.c: more build fixes 2018-08-19 16:42:35 +03:00
sezero
415127f697 glide2x, h3, linhwc.c: update P6FENCE macros from glide3 2018-08-19 16:36:33 +03:00
sezero
2b2d13f32e glide2x, h3, gsst.c (grSstWinClose): restrict hwcUnmapBoard() call to linux
-- hwcUnmapBoard() is only in linhwc.c, not in minihwc.c.
2018-08-19 16:17:15 +03:00
sezero
e2a15684a1 glide2x, h3, minihwc.c: build fixes fixes from glide3 2018-08-19 16:15:01 +03:00
sezero
e0d29a1656 glide2x, h3, win_mode.c: build fixes / mysterious bug fixes from glide3 2018-08-19 16:13:40 +03:00
sezero
6d7be29632 glide2x, h3, gdebug.c: fix gdbg_msgfile initializer issue with mingw. 2018-08-19 16:11:01 +03:00
sezero
16f66e6d28 glide2x, cvg/h3: minor mikefile.linux updates 2018-08-19 16:09:13 +03:00
sezero
377f8d78a8 glide2x,cvg/sst1 init: #undef FX_DLL_ENABLE so we don't dllexport the syms 2018-08-19 13:40:20 +03:00
sezero
9f5fb2a342 glide2x, sst1: warning fixes. 2018-08-19 13:25:15 +03:00
sezero
4f59670015 glide2x, sst1/cvg: build fixes, warning fixes. 2018-08-19 12:41:50 +03:00
sezero
eb96ad7944 glide2x, grDrawTriangle() dispatch code for cvg and h3:
It fails to build for linux with the current compiler flags:

- static builds:
gdraw.c: In function `grDrawTriangle':
gdraw.c:757: error: bp cannot be used in asm here

- shared lib (-fPIC) builds:
gdraw.c: In function `grDrawTriangle':
gdraw.c:731: error: PIC register `ebx' clobbered in `asm'

Only if I use '-DBIG_OPT -fomit-frame-pointer', _then_ it builds into:

00000a20 <grDrawTriangle>:
     a20:	a1 2c 00 00 00       	mov    0x2c,%eax
     a25:	ff a0 50 03 00 00    	jmp    *0x350(%eax)
     a2b:	c3                   	ret
     a2c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

... which is good but only for static builds.  The PIC build still
fails with the above message with my gcc3.4 or gcc4.x.

So, I moved the x86 dispatch code to a new xdrawtri.asm, for linux,
and even for MSVC without any prologue/epilogue like the following:
  movl (_GlideRoot + curGC),%eax
  jmp  *kTriProcOffset(%eax)

Let's see how this goes.
2018-08-19 10:41:20 +03:00
sezero
d13007941b glide2x, sst1, grDrawTriangle(): directly use the proc from xdraw.asm.
this makes it more like the glide3x version, and fixes windows build
and linkage.  only Watcom build is special-cased: don't know the reason
why it was adjusted that way in gdraw.c but I kept it that way for now.
2018-08-18 22:32:02 +03:00
sezero
bc1d8f3932 glide2x, sst96: we have an initat3d.c now, so replaced that #if 0. 2018-08-18 22:26:11 +03:00
sezero
d917bb66ab glide2x, sst1: windows MSVC 6 build fixes in init 2018-08-18 22:16:37 +03:00
sezero
5672bdf2be glide2x, sst1: Makefile.win32 fix 2018-08-18 22:16:00 +03:00
sezero
5c3ead43e6 glide2x, cvg/h3, fxgasm.c: write kTriProcOffset into fxgasm.h, too. 2018-08-18 20:01:56 +03:00
sezero
6e6171b857 glide2x, cvg: build fixes for MSVC 6 2018-08-18 17:56:51 +03:00
sezero
14b3357ab8 glide2x, h3: converted asm to nasm syntax, adjusted fxgasm.c for it.
it builds for linux now. (not tested though..)
2018-08-18 17:15:02 +03:00
sezero
4e3b368794 glide2x, cvg, fxgasm.c: remove the old 'kTriProcOffsetClean' hack. 2018-08-18 13:23:40 +03:00
sezero
8a425599ef glide2x, sst1: converted asm to nasm syntax, adjusted fxgasm.c for it.
it builds for linux now. (not tested though..)
2018-08-18 13:00:24 +03:00
sezero
8080e4a845 glide2x, cvg, sst1: further makefile updates 2018-08-18 12:58:36 +03:00
sezero
3a00e0af75 glide2x, sst1, makefile.linux: gxdraw.c is needed even with USE_X86=1. 2018-08-18 12:30:50 +03:00
sezero
e42511abcc minor whitespace adjustment 2018-08-18 12:03:50 +03:00
sezero
bfad389fff glide2x, sst1: makefile.linux updates. 2018-08-18 10:10:04 +03:00
sezero
a23359fc29 more glide2x / makefile.linux updates:
remove duplicated -DGLIDE_USE_C_TRISETUP flags.
2018-08-18 10:03:50 +03:00
sezero
e9384d45a3 glide2x, h3: makefile.linux updates:
- there is no such thing as DRI with glide2x
- there are no xdraw3.asm is glide2x tree
- nasm support isn't there yet: gas sources
2018-08-18 01:55:10 +03:00
sezero
cdd969974a glide2x, sst1: remove generated file fxinline.h 2018-08-17 23:38:20 +03:00
sezero
eeb8c98bb9 glide2x,cvg,fpu.c: change movw to movl in double_precision_asm()
Otherwise we get the following warnings: (some compilers error.)

Assembler messages:
Warning: using `%ax' instead of `%eax' due to `w' suffix
2018-08-17 23:35:02 +03:00
sezero
23b0364245 glide2x, cvg: makefile.linux updates. 2018-08-17 23:28:11 +03:00
sezero
62cc477a02 cvg, rcver.h: comment out fxbldno.h and hard-code BUILD_NUMBER [glide2x] 2018-08-17 23:26:15 +03:00
sezero
60d8447b98 glide2x, h3,minihwc: add p6fence stuff for linux, gcc & co. 2018-08-17 23:21:50 +03:00
sezero
fe99a42068 missed doing this in commit 2ee4b4f5 2018-08-17 23:20:20 +03:00
sezero
8844a3f2e7 h3,h5: move CM_Get_DevNode_Key() call to asm so we don't need win9x ddk 2018-08-17 13:28:21 +03:00
sezero
e6797e4fd8 asm: rename TEXT, DATA, CONST macros to SEG_TEXT, SEG_DATA and SEG_CONST
Defining certain keywords in nasm makes it go haywire.
See, https://bugzilla.nasm.us/show_bug.cgi?id=3392505

$ cat 1.asm
%define TEXT  _TEXT     align=1 public use32 class=CODE FLAT
%define DATA  _DATA     align=4 public use32 class=DATA FLAT
%define CONST CONST2    align=4 public use32 class=DATA FLAT

segment TEXT
segment DATA
segment CONST

$ nasm -E 1.asm
%line 4+1 1.asm

[segment _TEXT align=1 public use32 class=CODE FLAT]
[segment _DATA align=4 public use32 class=_DATA align=4 public use32 class=DATA FLAT FLAT]
[segment CONST2 align=4 public use32 class=_DATA align=4 public use32 class=_DATA align=4 public use32 class=DATA FLAT FLAT FLAT]

Either this (with nasm-2.0..nasm-2.09.xx), or it errors out with:
1.asm:6: error: interminable macro recursion
1.asm:7: error: interminable macro recursion
... which happens with nasm-2.10.xx-nasm-2.13.01

The glide3 tree uses this for Watcom builds / obj output format,
and the result is not what is intended.  After the renaming, it
works as expected:

$ cat 1.asm
%define SEG_TEXT   _TEXT    align=1 public use32 class=CODE FLAT
%define SEG_DATA   _DATA    align=4 public use32 class=DATA FLAT
%define SEG_CONST CONST2    align=4 public use32 class=DATA FLAT

segment SEG_TEXT
segment SEG_DATA
segment SEG_CONST

$ nasm -E 1.asm
%line 4+1 1.asm

[segment _TEXT align=1 public use32 class=CODE FLAT]
[segment _DATA align=4 public use32 class=DATA FLAT]
[segment CONST2 align=4 public use32 class=DATA FLAT]
2018-08-16 21:11:10 +03:00
sezero
9d646ac504 cvg, sst1, Makefile.mingw: undefine WINNT for consistency. 2018-08-14 11:35:55 +03:00
sezero
8e9e9acbb1 h5, dos_mode.c: fixed watcom build
FX_CSTYLE wasn't being defined because of missing FX_DLL_DEFINITION.
DJGPP builds aren't affected.
2018-08-14 03:01:02 +03:00
sezero
1ee5e06295 h5, gpio.c: removed watcom workaround for building under dos 2018-08-14 02:40:55 +03:00
sezero
a1f750e924 h3,h5 gdraw.c (grDrawPoint): removed weird ifdef, kept standart version
don't know why it was needed. Visual Studio 6 generates identical output
for both cases, so it was for earlier versions??? huh...
2018-08-14 00:15:40 +03:00
sezero
902edc7a66 gdraw.c, Makefile.mingw: integrate new xdrawtri.asm to build.
h3 and h5 trees now build using MinGW.  will run-test later..
2018-08-13 23:24:02 +03:00
sezero
49be990209 h3, h5: added grDrawTriangle() implementation for MinGW using nasm
grDrawTriangle() for MSVC/x86 is a naked function, so doing it in C
code won't work.  new file: xdrawtri.asm
2018-08-13 23:20:24 +03:00
sezero
04bc43e39c MinGW makefiles 2018-08-13 23:10:00 +03:00
sezero
c195d7acdc remove all makefile.unix files (obsoleted for quite some time..) 2018-08-13 10:28:02 +03:00
sezero
84728cbfb0 sst96, init96.c: make the BufInfo bI[] array static 2018-08-12 21:00:20 +03:00
sezero
542a45b6e9 sst96: mingw inline asm for _inp, _outp, and _outpw. 2018-08-12 20:55:02 +03:00
sezero
b35c0478be sst1, init96.c: coding style tidy-up.
dxdrvr.c: add missing braces around BufDesc[] initializer
2018-08-12 20:10:51 +03:00
sezero
02a608c61c h3,h5, fxglide.h: restrict Unix version of TRISETUP macro to x86 family.
because the inline asm uses the 'd' constraint, and to my knowledge, it
is x86-specific.
2018-08-12 17:23:10 +03:00
sezero
21fa4b55f0 h5, fxglide.h: don't limit forward declaration of struct GrGC_s to gcc 2018-08-12 17:00:02 +03:00
sezero
3e461e9f67 h3,h5, fxglide.h: tidy-up preprocessor checks for TRISETUP macro 2018-08-12 16:47:50 +03:00
sezero
99f02c80e6 linux makefile updates 2018-08-12 15:51:28 +03:00
sezero
76d8804c33 updates to top-level makefiles 2018-08-12 13:37:50 +03:00
sezero
0ff42bceb5 makefile updates 2018-08-12 13:24:24 +03:00
sezero
0652ba3057 h3,h5, gdraw.c: adjust/tidy preprocessor conditions for grDrawTriangle()
and made h3 and h5 versions look more alike
2018-08-12 12:11:28 +03:00
sezero
41324bf11c h3, gdraw.c: apply grDrawPoint() change from h5 commit 9a64ace 2018-08-12 12:10:32 +03:00
sezero
789be06f0f h3, h5, fxgasm.c: write kTriProcOffset into fxgasm.h, too. 2018-08-11 22:30:21 +03:00
sezero
208cbf570f h5: revert fxglide.h part of shamelessness commit 4b715ac
(my commit 8b047bb missed it)
2018-08-11 22:30:21 +03:00
sezero
673403f9cf h5,fxglide.h: adjust USE_STANDARD_TLS_FUNC case of getThreadValueFast() for gcc 2018-08-11 22:30:21 +03:00
sezero
6c40713033 minihwc.c (EnumDisplayMonitors_func): fix warning: 'dllimport' attribute ignored
also make EnumDisplayMonitors_func a proper function pointer type.
2018-08-11 11:03:24 +03:00
sezero
32b399b380 gsfc.c: warning: operation on 'gc->state.shadow.auxBufferAddr' may be undefined 2018-08-11 10:29:20 +03:00
sezero
7bfd3b95f9 minor makefiles update 2018-08-11 02:29:50 +03:00
sezero
2a711e29fe h3, minihwc.c: fix p6Fence for MinGW. 2018-08-11 01:21:10 +03:00
sezero
3b522046d6 h3/minihwc (hwcShareContextData): copy over gcc inline asm support from h5. 2018-08-11 00:32:02 +03:00
sezero
898013970a h3, h5, minihwc: minor warning fixes. 2018-08-11 00:29:35 +03:00
sezero
ca1e7fd506 h3, h5, gdebug.c: fix gdbg_msgfile initializer issue with mingw. 2018-08-11 00:28:15 +03:00
sezero
ccbd5a7b41 h5, minihwc: use local _aligned_malloc implementation with mingw. 2018-08-11 00:26:31 +03:00
sezero
c62583a3ee h3, gthread.c: fix breakage after commiet 797d81af 2018-08-10 21:01:32 +03:00
sezero
93dcdb9390 h3,h5, gdraw.c: minor typo/whitespace fixes and some syncing. 2018-08-10 20:45:20 +03:00
sezero
797d81af4a h3, fxglide.h, gthread.c: copy over gcc compatibility changes from h5. 2018-08-10 20:38:57 +03:00
sezero
8a406cba3d h3, h5: gsfc.c: replace backslash path separators in include directive. 2018-08-10 20:38:32 +03:00
sezero
da4d6857ba sst1, xdraw.asm: don't add _ prefix to exported symbol name with mingw.
Otherwise GNU toolchain fails with the error message:
   "Cannot export _grDrawTriangle@12: symbol not found"

Learning something everyday.
2018-08-10 20:38:15 +03:00
sezero
b6d45d842c sst1, Makefile.win32: remove duplicated gxdraw.obj in objects list. 2018-08-10 20:37:55 +03:00
sezero
355dca22a1 fxvxd.c: gcc inline asm for _inp, _inpw, _inpd, _outp, _outpw, _outpd. 2018-08-10 20:37:33 +03:00
sezero
57230a2161 cvg, parse.c: fixed a format warning from mingw. 2018-08-10 20:37:17 +03:00
sezero
b594bf89aa sst1init.h: remove a weirdness from INIT_PRINTF definition for windows
gcc (mingw) emitted lots of 'left-hand operand of comma expression has
no effect' warnings for it..
2018-08-10 20:36:28 +03:00
sezero
043f38b035 restrict #pragma optimize to Visual Studio builds 2018-08-10 20:36:10 +03:00
sezero
f3ed63fc58 fix parens around truth value warnings. 2018-08-10 20:35:54 +03:00
sezero
d92d50efc8 oeminit.h: fix 'extra tokens at end of #endif directive' warning 2018-08-10 20:35:41 +03:00
sezero
2a7cfdfec7 warning fixes. 2018-08-09 21:50:10 +03:00
sezero
faf890d878 cvg, h5, cpuid.c: fixed strict aliasing issue with newer gcc versions. 2018-08-09 20:51:50 +03:00
sezero
5f69e69154 3dfx.h: minor update for Fx?32 types 2018-08-09 17:55:02 +03:00
sezero
6759df5ead cvg, makefile.linux: remove fxremap.o from objects.
fxremap() is called only in dos and windows builds.
2018-08-09 16:10:50 +03:00
sezero
7dbc64777a apply the commit 721b6fcf changes to h3info.h, too. [glide2x side] 2018-08-09 16:10:01 +03:00
sezero
5c6e58e4e2 apply the commit 721b6fcf changes to ddglobal.h and h3info.h, too. 2018-08-09 15:55:28 +03:00
sezero
b5a555a538 cvg,fxremap.c: only include sst1init.h (for INIT_PRINTF) for dos builds
for others, make INIT_PRINTF() in fxremap.c a nop.
2018-08-09 15:55:01 +03:00
sezero
b4c30b1693 h3cinit.c: made mode_table[] and vgaattr[] static const 2018-08-09 12:51:50 +03:00
sezero
721b6fcf1b cvg, fxremap: removed all unnecessary stuff, made it to use INIT_OUTPUT 2018-08-09 11:56:56 +03:00
sezero
43f6bbc977 cvginfo.h: remove top-level defines and forward declare struct sstregs.
It 'defined' FxU32 and FxBool for if __unix__ is defined and cvgregs.h
not included.  DJGPP does define __unix__, and this caused a mess with
one of my experiments.

I do not see the real need for this.  So, adding a forward declaration
of struct sstregs, replacing all SstRegs* with volatile struct sstregs*
serves the purpose. 3dfx.h (which typedefs FxU32 and FxBool) is always
included before cvginfo.h everywhere in the code, so, there is no need
for 'defining' FxU32 and FxBool here, either.

DJGPP build gives an identical DXE output before and after this change.
2018-08-09 11:50:02 +03:00
sezero
64bae86d19 cvg, fxremap: leave out lots of actually unused code from build.
glide code only calls fxremap() and not fxremap_main(), so silent
is always true, there is no cmdline processing, and nothing can
actually print to console. added a new FXREMAP_EXE ifdef in there
to filter things out.
2018-08-09 02:20:40 +03:00
sezero
43291704cb h5,dos_mode.c,lin_mode.c: made buildVideoModeData and setVideoModeSlave static.
whitespace tidy-up.
2018-08-08 23:55:32 +03:00
sezero
12d926449a cvg, gu.c: added guEncodeRLE16()
this function used to be exported by earlier versions of glide3x.dll in
voodoo2 reference drivers, but later it disappeared. it _is_ present in
glide3x.dll versions for all other voodoo boards, so added it here.
2018-08-08 23:04:10 +03:00
sezero
b62e3fd33c h5, fxglide.h: restored FX_EXPORT in GR_ENTRY definition.
koolsmoky commit 0b8571b (initial checkin of dos win32 glide) commented
it out for who knows why, and that resulted in two of the exports in the
dll to go missing, namely grCheckForRoom and guEncodeRLE16. they are now
back.
2018-08-08 22:39:10 +03:00
sezero
3c54cfde1e cvg,sst1 init: #undef FX_DLL_ENABLE so that we don't dllexport the symbols. 2018-08-08 22:38:50 +03:00
sezero
40ee824879 swlibs, fxpci: #undef FX_DLL_ENABLE, so that we don't dllexport the symbols. 2018-08-08 22:38:27 +03:00
sezero
bc18c519d7 gdebug.c: #undef FX_DLL_ENABLE, so that we don't dllexport the symbols. 2018-08-08 22:38:12 +03:00
sezero
1fe48886a8 gdebug.c: whitespace tidy-up. 2018-08-08 22:37:50 +03:00
sezero
de0e7ca28f fxdll.h: revert koolsmoky commit bab2f1c 'use dllimport for __MSC__ imports'
it was wrong, and was causing LNK4049 warnings.
2018-08-08 22:35:48 +03:00
sezero
1e89ef2670 cvg, Makefile.win32: missed replacing one path separator 2018-08-08 18:55:04 +03:00
sezero
8c917cb2a2 convert win32 Makefiles to crlf, convert path separators to backslash. 2018-08-08 14:56:02 +03:00
sezero
8adf484af7 h3, h5: last of the VC6 and ddraw.h compatibility stuff. 2018-08-08 14:25:50 +03:00
sezero
e710954c4e h5, minihwc.c: VC6 rejects pMinSW in the inline asm.
changed pMinSW mm0,mm3  to
    _asm _emit 0x0f _asm _emit 0xea  _asm _emit 0xc3
2018-08-08 11:10:02 +03:00
sezero
59d59bad72 h5, minihwc.c: VC6 doesn't have _aligned_malloc(). locally implemented. 2018-08-08 11:06:51 +03:00
sezero
380a78de05 h3, h5, minihwc: remove some unused stuff from win_mode.c. minor cleanup. 2018-08-08 10:50:10 +03:00
sezero
42c8b28993 Windows (VC6) build fixes, 03/##: HMONITOR type hack for h3 and h5. 2018-08-08 08:55:02 +03:00
sezero
d6fce294b4 h3, h5, minihwc: don't unconditionally define GDBG_INFO_ON in win_mode.c 2018-08-08 08:50:37 +03:00
sezero
0aa1e159bf Windows (VC6) build fixes, 02/##: grDrawLine() const issue.
this is a hack and need to be fixed properly by constifying other
procedures.
2018-08-08 08:47:00 +03:00
sezero
d6448ee662 Windows (VC6) build fixes, 01/## 2018-08-08 08:45:02 +03:00
sezero
29212e8a14 fxremap.c: warning fixes. 2018-08-07 12:04:40 +03:00
sezero
af4ebfce0c warning fixes and minor cleanup. 2018-08-07 11:58:55 +03:00
sezero
19efdba7e0 swlibs/fxmisc/fximg.c: -Wformat warning fixes 2018-08-07 11:57:45 +03:00
sezero
032b25b708 minor type corrections 2018-08-07 10:37:24 +03:00
sezero
d46910aa23 sst96.c (_grSst96Load32): fix a minor warning after commit 30ec8787 2018-08-06 17:00:02 +03:00
sezero
2ee4b4f583 h3, h5, minihwc: don't unconditionally define GDBG_INFO_ON in minihwc.c
several constifications.  exclude the debug stuff from release builds.
fixed that 'waxRegnames' typo in HWC_WAX_STORE and HWC_WAX_LOAD macros.
2018-08-06 14:10:02 +03:00
sezero
b33d69b0a3 cvg, fxremap.c: make almost everything static.
except for the two exported functions.
also replaced 'null' by 'NULL' (why that 'null' define I wonder..)
2018-08-06 14:00:50 +03:00
sezero
1f08466bc6 sst96: more of making several global vars static:
- initat3d.c: make ClockTableAT3D[] const and static.
- initad3d.c: make const vars  bPowerOff, bHighSpeed,
  and bBypass static.
2018-08-06 14:00:01 +03:00
sezero
30ec87871d sst96: exclude debug stuff from release-builds (regNames & co.) 2018-08-06 13:56:50 +03:00
sezero
f053d6b0cf sst96: constified iRegNames[] 2018-08-06 13:55:02 +03:00
sezero
ef5108ae49 sst96: vgdrvr.c, vg96drvr.c: minor whitespace cleanups. 2018-08-05 17:24:28 +03:00
sezero
9fee9e454d sst96: fix warnings introduced by commit 383731e84 2018-08-05 17:23:37 +03:00
sezero
46226e7d14 revert commit 16a4feb6, define INIT_ACCESS_DIRECT for SST96 DOS builds. 2018-08-05 12:04:04 +03:00
sezero
383731e840 make a few more global vars static. remove glideIdent[] from gglide.c (unused.) 2018-08-05 12:02:59 +03:00
sezero
08e1e599fd xos.inc: fixed 'unterminated string' warning from nasm. 2018-08-05 12:02:59 +03:00
sezero
4f81f1ed1b added a top-level README file. 2018-08-05 12:02:59 +03:00
sezero
ae760389ae glide2x/h3 (linhwc.c/minihwc.c): fix fenceVar with newer gcc versions.
from glide3x tree.
2018-08-05 12:02:59 +03:00
sezero
486276471e add missing Rush files to glide2x side. 2018-08-05 12:02:59 +03:00
sezero
1a273ba12a sst1 cleanup: remove non-existent h3drvr (FX_SST2) stuff [glide2x side] 2018-08-05 12:02:59 +03:00
sezero
8b047bb95c splash and shameless plug updates:
removed experimental splash stuff from h3/h5 for non-windows.
if either of GLIDE_SPLASH or GLIDE_PLUG aren't defined their
respective data are completey excluded from the binary image,
and their respective functions aren't called at all.
2018-08-05 12:02:59 +03:00
sezero
bbbb581698 add a sst96 subdirectory to sst1/lib/ 2018-08-05 12:02:59 +03:00
sezero
cb46d5b49c disable shameless plug overlay and splash screen in DOS builds.
reduces binary size and not really needed.
2018-08-05 12:02:59 +03:00
sezero
8bdf368c58 Makefile.DJ: define a DXE3GEN variable, defaulting to dxe3gen 2018-08-05 12:02:59 +03:00
sezero
720d0b125e DJGPP Makefile updates with some (ugly) cross-build workarounds. 2018-08-05 12:02:59 +03:00
sezero
35be4ad445 sst1 cleanup: remove non-existent h3drvr (FX_SST2) stuff 2018-08-05 12:02:59 +03:00
sezero
dc5f7d0065 commented out some unused static vars 2018-08-05 12:02:59 +03:00
sezero
9b83acbefd linux build fixes 2018-08-05 12:02:59 +03:00
sezero
bc892aff15 cvg: added -DGLIDE_CHIP_BROADCAST=1 and -DGLIDE_BLIT_CLEAR=1 among the CFLAGS.
Windows makefile has them, already.  The linux makefile used to have them but
magically lost them somehow in the glide-devel-branch. Let's see how it goes..
2018-08-05 12:02:59 +03:00
sezero
16a4feb6e6 sst1,initmcrx (initMCRXSetVideo): make Macronix Rush cards function under DOS
achieved by commenting out the INIT_ACCESS_DIRECT ifdef.  maybe just defining
INIT_ACCESS_DIRECT works too? that adds a initAT3DWait(100) call for the AT3D
cards. to be revisited / tested in future...
2018-08-05 12:02:59 +03:00
sezero
78a5774bc8 h5, minihwc.c (hwcInitRegisters): call h4InitPlls() if H4 is defined for v4/5
patch from Frank Sapone <emoaddict15@gmail.com> --- overclocking support with
SSTH3_GRXCLOCK for Voodoo 4/5 cards.
2018-08-05 12:02:59 +03:00
sezero
eea61facf8 h3/h5, linhwc.c, minihwc.c: fix fenceVar with newer gcc versions. build fixes. 2018-08-05 12:02:59 +03:00
sezero
dd7cb10225 cvg, rcver.h: comment out fxbldno.h and hard-code BUILD_NUMBER for now. 2018-08-05 12:02:59 +03:00
sezero
e8c99cbad5 swlibs/newpci/pcilib/fxpci.c (pciGetErrorString): unsigned casts to fix warning 2018-08-05 12:02:59 +03:00
sezero
4092b17053 3dfx.h: change FxI32 and FxU32 to be of long types for Windows and DOS. 2018-08-05 12:02:59 +03:00
sezero
e6d386eb3c sst1, initat3d.c: build / warning fixes. 2018-08-05 12:02:59 +03:00
sezero
8448392757 sst1, init96.c: remove static redeclaration of init96SetupRendering(). 2018-08-05 12:02:59 +03:00
sezero
c2eaa35f54 sst1, gxdraw.c: fix typo introduced by the gcc4.1 strict aliasing fixes 2018-08-05 12:02:59 +03:00
sezero
7415325040 h5, minihwc.h: fix misplaced HWC_EXT_INIT ifdef in struct hwcBoardInfo_s 2018-08-05 12:02:59 +03:00
sezero
5ca0c8b42f h5, gtexdl.c: commented out unused local var 'didcompress' 2018-08-05 12:02:59 +03:00
sezero
fdeb88fac5 h5, gdraw.c: fix build with newer gcc versions. 2018-08-05 12:02:59 +03:00
sezero
14e33eb51d h3, gthread.c: build fix 2018-08-05 12:02:59 +03:00
sezero
d257dd2bc2 h3cinit.c: removed an ugly hack for building under dos. 2018-08-05 12:02:59 +03:00
sezero
371f2af8ec gdebug.c: gdbg_set_file() fixes. 2018-08-05 12:02:59 +03:00
sezero
6a898856bb cvg, splshdat.c: fix missing braces in initializer warning 2018-08-05 12:02:59 +03:00
sezero
de08f2ebbf gsplash.c: changed type of fogTableSize to FxI32 2018-08-05 12:02:59 +03:00
sezero
dde408cf00 added missing newline at end of two files 2018-08-05 12:02:59 +03:00
sezero
76a8dc0416 removed dependency on ctype.h functionality. also simplified NULL usage. 2018-08-05 12:02:59 +03:00
sezero
4819e38cc4 cvg: replaced a build fix hack with a better one 2018-08-05 12:02:59 +03:00
sezero
4fd268232a replaced broken binary files as best as I can 2018-08-05 12:02:43 +03:00
sezero
ec57d92c97 remove two test binaries 2018-08-05 12:02:39 +03:00
sezero
968e385010 removed most of the cvs keywords.
in some files, added back last-revision logs which cvs2git removed:
feel more comfortable that way for now..

also removed all of the .cvsignore files.
2018-08-05 12:02:27 +03:00
sezero
367a3b66c4 fix stupid eol 2018-08-05 12:01:50 +03:00
sezero
2c11e03776 removed some static vars relying on cvs revision number (glide2x side) 2018-08-05 11:58:06 +03:00
sezero
d7086902f1 removed some static vars relying on cvs revision number. 2018-08-05 11:58:00 +03:00
guillemj
944b60eac8 Clarify that the driver works on kernels >= 2.x 2011-07-03 02:11:38 +00:00
guillemj
9ab3c4634c Handle Linux 3.x versions 2011-07-03 02:06:12 +00:00
guillemj
d37f7b7a70 Add changelog entry 2011-07-03 02:04:51 +00:00
guillemj
348d63fc2b Do not print “make help” commands, only their output 2011-07-03 02:01:25 +00:00
guillemj
cfdb4dcafe Bump version to '2011.05.27' 2011-05-27 06:27:40 +00:00
guillemj
51b434999b Use .unlocked_ioctl file operations member when .ioctl is not present 2011-05-27 05:11:10 +00:00
guillemj
d0db8256e4 Use new paths for generated header files with Linux >= 2.6.33
On Linux >= 2.6.33, use <generated/autoconf.h> instead of
<linux/autoconf.h>. Include it after <linux/version.h>.
Use generated/utsrelease.h as VERSION_HEADER if present instead of
linux/utsrelease.h or linux/version.h.
2011-05-27 05:06:11 +00:00
guillemj
f4f0afe53d Do not use negative exit numbers 2011-05-27 05:00:47 +00:00
guillemj
b10938edc0 Do not use negative exit numbers
This is a bashism which might not work on POSIX shells.
2011-05-27 04:55:50 +00:00
guillemj
0a7f20cf1f Bump version to '2008.06.24' 2008-06-24 04:42:25 +00:00
guillemj
154718fe78 Remove KERNEL_MIN_VER macro and replace all users with its contents 2008-06-24 04:35:29 +00:00
guillemj
858e6f7e15 Use pci_dev_put to release the refcount for the Intel 82441FX device 2008-06-24 04:24:22 +00:00
guillemj
ec48aba80f Terminate id_table_3dfx list with an empty element 2008-06-22 07:52:30 +00:00
guillemj
2832abfc79 Use pci_get_device instead of deprecated pci_find_device
Add compatibility code for Linux < 2.5.73.
2008-06-22 07:43:39 +00:00
guillemj
2952168561 Ignore unregister_chrdev's return value as it actually returns void now 2008-06-22 06:53:40 +00:00
koolsmoky
09fae37520 fixed problem with performance trilinear and lodbias sign 2007-09-29 14:19:23 +00:00
koolsmoky
408a154309 fixed compile errors with MSVC 2007-09-29 14:17:14 +00:00
koolsmoky
f0f02c3383 no message 2007-09-29 14:11:54 +00:00
koolsmoky
02f96edc18 enabled rigorous address range checks 2007-09-29 14:07:49 +00:00
koolsmoky
39adf6422d added glide sf advertisement 2007-09-29 14:02:31 +00:00
koolsmoky
e46c92242b removed false swapInterval envar checks 2007-09-29 14:01:24 +00:00
koolsmoky
9490b841d7 completed grStippleMode and grStipplePattern 2007-09-29 13:59:34 +00:00
koolsmoky
e8d880e66f changes to support added extensions. 2007-06-23 09:23:57 +00:00
koolsmoky
d6004952bd added extensions; QUERY, POINTCAST, MULTIRENDERING 2007-06-23 09:22:41 +00:00
koolsmoky
6385e41d0e currently only single chip mode is supported for windowed mode 2007-06-23 09:10:53 +00:00
koolsmoky
95831f0553 removed unneeded emms calls 2007-06-23 09:09:10 +00:00
koolsmoky
c1791171c5 removed unneeded emms calls 2007-06-23 08:50:57 +00:00
koolsmoky
234f54da93 use fxbldno for build numbers 2007-06-23 08:49:47 +00:00
koolsmoky
cb5c93a417 use fxbldno for build numbers 2007-06-23 08:44:09 +00:00
koolsmoky
4f5beb723c Removed duplicate disableDitherSub envars 2007-06-23 08:42:10 +00:00
koolsmoky
6a4a030bb3 cleaned v56k dac workaround 2007-05-20 00:46:05 +00:00
koolsmoky
2bc2ada7fa win32 build fix 2007-05-19 19:27:45 +00:00
koolsmoky
18c63bcf35 compensated 64bit changes 2007-05-19 19:24:42 +00:00
koolsmoky
ee0637513a added extra trilinear checks and 1chip x2fsaa for subsample lod dithering 2007-05-19 11:44:24 +00:00
koolsmoky
0e30810868 conserve packets in TWO_TRI_FILL code 2007-05-19 11:32:43 +00:00
koolsmoky
7f952e5fd9 win32 build workaround 2007-05-19 11:06:47 +00:00
koolsmoky
59f561890c force 4x4 dither with alpha dither subtraction 2007-05-19 10:58:19 +00:00
koolsmoky
eac64a908e included ctype.h for toupper 2007-05-19 10:54:10 +00:00
koolsmoky
04ef64970f packed rgb fixes 2007-05-19 08:38:01 +00:00
koolsmoky
8749e39edc packed rgb fixes
force 4x4 dither with alpha dither subtraction
2007-05-19 08:37:25 +00:00
koolsmoky
9a6eac9c31 packed rgb fixes 2007-05-19 08:29:25 +00:00
koolsmoky
075b942975 win32 multi-monitor fixes 2007-05-13 09:27:23 +00:00
koolsmoky
034de08665 simple ms os detection
win32 multi-monitor fixes
cleaned up v56k gamma fix
2007-05-13 09:26:51 +00:00
koolsmoky
8756ab93d2 removed problematic context checks 2007-05-13 09:21:06 +00:00
koolsmoky
0d1c03ec4f cleanup 2007-05-13 09:16:26 +00:00
koolsmoky
4d5cadd8c8 simple ms os detection 2007-05-13 09:16:10 +00:00
koolsmoky
e2a6f44d01 simple ms os detection
splash screen dll load unload cleanup
removed autobump testcode
2007-05-13 09:14:36 +00:00
koolsmoky
4fece0a55b remove old ms os detection stuff 2007-05-13 09:08:32 +00:00
koolsmoky
c00327dd0a assure dither subtraction stays off when in 32bpp mode 2007-05-13 09:06:38 +00:00
koolsmoky
682ffd4d33 fix for win32 builds 2007-05-13 09:04:01 +00:00
koolsmoky
06e25214f1 removed old ms os detection stuff 2007-05-13 09:02:57 +00:00
koolsmoky
9072e6d7f9 fix for non-debug builds 2007-05-13 08:56:06 +00:00
guillemj
47aabade08 Fix regression in GLIDE_VERSION_MINOR, set it to '10.0'. 2007-02-14 20:24:10 +00:00
guillemj
7bbce2ccdb Fix typo. 2007-02-06 05:04:20 +00:00
guillemj
57a15b8aab * 3dfx_driver.c (MODULE_VERSION): Bump to '2007.02.06'. 2007-02-06 04:55:09 +00:00
guillemj
1f3ee6bb30 Fix warnings when not checking pci_register_driver return codes.
* 3dfx_driver.c (findCards): Return int instead of void , and normalize
	error code to be always negative, otherwise return numCards.
	(init_module): Check for findCards return code, print a warning and
	exit the module on error.
	(init_3dfx): Likewise.
2007-02-06 04:50:34 +00:00
guillemj
6fccc2cbdb * 3dfx_driver.c (HAVE_DEVFS): Define to 1 if
LINUX_VERSION_CODE >= 2.3.46 and LINUX_VERSION_CODE <= 2.6.17 or
	if DEVFS_SUPPORT is defined, define to 0 otherwise.
	(devfs_handle): Only use if HAVE_DEVFS.
	(init_module): Only use devfs_mk_cdev or devfs_register if HAVE_DEVFS.
	(cleanup_module): Only use devfs_remove or devfs_unregister if
	HAVE_DEVFS.
2007-02-06 04:32:58 +00:00
guillemj
d919a05407 * Makefile (CFLAGS): Use '-march' instead of the deprecated '-mcpu'. 2007-02-06 04:15:01 +00:00
guillemj
b06c63abed * kinfo.c: Removed.
* kver.c: New file.
	* Makefile: Include kver.mak.
	(KVERS): Move this variable to 'kver.mak', which is a generated file.
	(VERSION_HEADER): New variable to cope with UTS_RELEASE being moved
	from 'linux/version.h' to 'linux/utsrelease.h' in 2.6.18.
	(kver, kver.mak): New targets.
	(KBUILD): New variable.
	(KVER_MAJOR, KVER_MINOR, BUILD_TYPE, MODULE_TDFX): Likewise, moved
	from the generated file 'config'.
	(config, kinfo, kinfo.h): Remove targets.
	(modules, intstall, clean): Do not depend on config target.
	(modules, intstall): Depend on sanity target .
2007-02-06 04:10:21 +00:00
guillemj
8f254569e5 * Makefile (.PHONY): Add clean_kbuild. Rename modules-legacy,
modules-kbuild, install-legacy, install-kbuild and clean-legacy to
	modules_legacy, modules_kbuild, install_legacy, install_kbuild
	and clean_legacy.
2007-02-06 03:37:28 +00:00
guillemj
42a995335e Fix typo. 2007-01-31 01:05:41 +00:00
guillemj
e0fdb356a3 * 3dfx_device.c (cardInfo_t): Make dev be 'struct pci_dev *' even for
kernels < 2.6.0.
	(findCardType): Assign to cards[n].dev the dev variable instead of
	devfn. Fix macro to use devfn instead.
2007-01-31 01:02:21 +00:00
guillemj
e4d0ae4ff1 * 3dfx_device.c (my_remap_page_range): Define as remap_pfn_range for
linux 2.6.10 or higher.
2006-12-03 08:16:01 +00:00
guillemj
22a95077f9 Use the "new" kernel level exception handling for memory accesses
introduced in linux 2.1.8, which obsoletes verify_aread.

	* 3dfx_device.c (doQueryFetch): Remove verify_area and check for
	copy_to_user return values.
	(doPIORead): Likewise.
	(doQueryUpdate): Remove verify_area and check for copy_from_user
	return values.
	(doQuery): Likewise.
	(doPIOWrite): Likewise.
	(doPIO): Likewise.
	(verify_area) [DEBUG]: Remove function.
	(a_last_dummy_function) [DEBUG]: Likewise.
2006-12-03 07:51:02 +00:00
guillemj
8c2fdd661a * 3dfx_device.c (doQueryFetch): Assign desc->device to i, and use it
when referencing cards.
2006-12-03 07:34:28 +00:00
guillemj
3a78ad5818 Remove first forgotten argument from pci_write_config_*. 2006-12-03 07:30:26 +00:00
guillemj
b92f14b42c * 3dfx_device.c (setmtrr_3dfx): Make it static.
(resetmtrr_3dfx): Likewise.
2006-12-03 07:13:34 +00:00
guillemj
3afa27274d Bah, fix typo VMA_OFFSET_ALIGNED -> VM_OFFSET_ALIGNED. 2006-12-03 07:10:47 +00:00
guillemj
97b9d60875 * 3dfx_device.c (id_table_3dfx): Move newar the corresponding ifdef
for older kernels.
	(findCards): Likewise.
	(driver_3dfx): Forward declare.
2006-12-03 07:09:57 +00:00
guillemj
054807b1dd Rename functions obsoleted in linux 2.1.93.
* 3dfx_device.c (pcibios_read_config_byte): Rename to ...
	(pci_read_config_byte): ... this and remove first argument.
	(pcibios_read_config_word): Rename to ...
	(pci_read_config_word): ... this and remove first argument.
	(pcibios_read_config_dword): Rename to ...
	(pci_read_config_dword): ... this and remove first argument.
	(pcibios_write_config_dword): Rename to ...
	(pci_write_config_dword): ... this and remove first argument.
2006-12-03 06:50:14 +00:00
guillemj
526262f4a6 * 3dfx_device.c (VMA_OFFSET_ALIGNED): New macro.
(mmap_3dfx): Use VMA_OFFSET_ALIGNED, instead of checking for specific
	kernel versions and changing behaviour.
2006-12-03 05:48:58 +00:00
guillemj
0ee0b2add4 Indentation fixes. 2006-12-03 05:42:50 +00:00
guillemj
871c2bcf65 Backport "sequence point" fix for string upper code from glide3x. 2006-12-03 04:49:19 +00:00
guillemj
37d9fc555e Ooops, forgot to add this file.
Backported from glide3x.
2006-12-03 04:47:28 +00:00
guillemj
4372942b61 Remove the shared library on realclean as well. 2006-11-30 09:45:33 +00:00
guillemj
acbd24bb88 Unify library name to be libglide3.
Create the shared library with the full major.minor (taking the number from
old sources).
Create a symlink for the shared library for the .so file.
2006-11-30 09:42:50 +00:00
guillemj
a1e9017af6 No autoconf anymore. 2006-11-30 09:21:28 +00:00
guillemj
1ffbd85481 No TEXUS2 option in glide2x. 2006-11-30 09:18:59 +00:00
guillemj
9c38a603a0 Switch to the new "build system", to be in sync with the rest of glide.
Backport cpudtect.asm from glide3 for h3.
Add fpu.c to cvg.
2006-11-30 09:16:50 +00:00
guillemj
b11bb573b0 Link against fxmisc/fxos.o and fxmisc/fximg.o to match the old library
signature, should be checked if it's really needed.
2006-11-30 09:10:25 +00:00
guillemj
019a1ff4dc Sync Makefile to the general style used in the other libs. 2006-11-30 09:05:08 +00:00
guillemj
fd08c9c716 Link libraries against libm, needed by pow. 2006-11-12 02:38:43 +00:00
guillemj
1d47a8de8e Remove the autoconf build system. It was broken and out of sync with the
working makefiles.linux.
2006-09-04 23:02:01 +00:00
guillemj
6cc1fe6e7e Move library soname to GLIDE_SONAME. 2006-09-04 20:55:56 +00:00
guillemj
959334ad71 Remove redundant definition of single_precision_asm and double_precision_asm,
to fix the code not building from source.
2006-09-02 03:13:53 +00:00
guillemj
910bd84cf8 Backport glide3 fix for PIC compilation with gcc 4.1 from Hans de Goede. 2006-09-02 03:12:29 +00:00
guillemj
00a387e94f Fix typo (glide3x -> glide2x). 2006-09-01 19:45:54 +00:00
guillemj
dfd3327037 Fix warnings by moving the assignments from inside the if conditionals
to outside.
2006-09-01 19:44:38 +00:00
guillemj
0070c1729d Make main return an int instead of void.
Protect assignment inside the while conditional.
Actually pass strings to the printf code with %s.
2006-09-01 19:43:08 +00:00
guillemj
84cd0d554f Make tlErrorMessage function return something (true). 2006-09-01 19:40:34 +00:00
guillemj
5a517c8e2f Remove init96SetupRendering function prototype from inside init96MapBoard
function to the beginning of the file.
2006-09-01 19:39:25 +00:00
guillemj
f82d3a3a0a Remove redundant (and thus making it fail to build) PCI_VENDOR_ID and
PCI_DEVICE_ID declarations.
2006-09-01 19:36:46 +00:00
guillemj
87f391fec1 Add missing include <string.h>. 2006-09-01 19:35:12 +00:00
guillemj
1738b62d40 Fix spaces in ChangeLog entry. 2006-09-01 19:22:40 +00:00
dborca
ebbc49b41b Missing Rush files. 2006-07-24 06:52:23 +00:00
guillemj
91fdbf4feb Rename HAVE_MTRR to CONFIG_MTRR. 2006-03-03 02:15:27 +00:00
jwrdegoede
1561d5a656 Fix gcc 4.1 new type-punned ptr breaks antialias. warnings 2006-01-16 21:22:46 +00:00
dborca
d2e6e8062f removed -mcpu=pentium 2005-11-29 22:05:55 +00:00
guillemj
c67e1e2526 Protect against multiple macro definitions. 2005-09-21 22:21:57 +00:00
guillemj
fd64b6ac96 Move imageConvert declaration from inside main to before it.
Fixes build failure with gcc 4.0.1.
2005-09-21 22:12:27 +00:00
jwrdegoede
fef69dbf9a Add -soname to linux linkerflags 2005-08-15 15:21:20 +00:00
jwrdegoede
93f42cc6f8 Last needed 64 bit fixes for h5/h3, complete 64 bit support for cvg 2005-08-13 21:07:04 +00:00
jwrdegoede
a30877fb0f Add 64 bit todo list 2005-06-26 07:06:10 +00:00
jwrdegoede
4338d7a4e9 Add warning about stack layout assumptions 2005-06-25 20:56:53 +00:00
jwrdegoede
12dbdd977a Add Linux-portability.txt 2005-06-25 20:53:42 +00:00
jwrdegoede
0c312424e3 Add missing P6FENCE for x86_64 2005-06-23 20:03:38 +00:00
jwrdegoede
23a241e1c7 change some scanf %u back to %i to allow using both hex and dec numbers 2005-06-17 14:53:33 +00:00
jwrdegoede
87a74e1a2b Fix few warnings when USE_X86=1 is not set 2005-06-17 14:18:50 +00:00
jwrdegoede
759cde16ea Fix 2 sst1 bugs accidently introduced by warning fixes 2005-06-16 18:58:33 +00:00
jwrdegoede
a072e43eb1 Really fix cvg linking when GL_X86 is not defined 2005-06-10 19:10:54 +00:00
jwrdegoede
fb1109315a Fix linking when GL_X86 is not defined 2005-06-10 18:59:00 +00:00
jwrdegoede
6f3645a1cf Fix compilation when GL_X86 is not defined 2005-06-10 14:17:56 +00:00
jwrdegoede
8106609282 h3/h5 Remove swlibs/fxmisc/linutil.o on a make clean 2005-06-09 18:34:50 +00:00
jwrdegoede
4b63afa845 Fixed all warnings with gcc4 -Wall -W -Wno-unused-parameter, except for a couple I believe to be a gcc bug. This has been reported to gcc. 2005-06-09 18:32:40 +00:00
jwrdegoede
dca89ecb08 Make h5 and h3 tree 64 bit clean. This is ported over from the non-devel branch so this might be incomplete 2005-05-25 08:56:37 +00:00
jwrdegoede
5eff1f0e44 Add P6FENCE (ish) macro for non-x86 archs 2005-05-25 08:53:23 +00:00
jwrdegoede
a96ecc4d15 Add #ifdef GL_X86 around x86 specific code 2005-05-25 08:51:53 +00:00
jwrdegoede
1d189c8b84 Makefile changes: add -DGL_X86 on x86, replace CPU option by OPTFLAGS 2005-05-25 08:49:29 +00:00
jwrdegoede
2f942cc686 Fix unwanted shadowing of global var:first with local val first 2005-05-11 14:52:02 +00:00
jwrdegoede
a905834f07 Also fix gcc4 PIC compilation of cpuid.c for cvg 2005-05-11 14:42:15 +00:00
jwrdegoede
e2d97af291 sst1 gcc4 compile fixes 2005-05-10 11:27:23 +00:00
jwrdegoede
292e2fba9c make c-code match comment 2005-05-10 08:17:40 +00:00
jwrdegoede
4c00987aa2 Make header output more verbose (output complete header) 2005-05-09 13:50:31 +00:00
jwrdegoede
47daaa8aad lvalue cast fixes for gcc4 2005-05-07 08:40:30 +00:00
jwrdegoede
4a8fdd2725 fix for newer libtools 2005-05-07 08:27:23 +00:00
jwrdegoede
c5dff3e9da gcc4 cpuid fix 2005-05-07 08:26:35 +00:00
koolsmoky
bc2d475372 Use grDrawTriangle where TRISETUP is not necessary. 2005-04-26 00:02:45 +00:00
koolsmoky
9fcb0ace2a Fix _texDownloadProcs comma separator.
Thanks to Ozkan Sezer <sezeroz@gmail.com>.
2005-04-25 23:58:41 +00:00
koolsmoky
1a365fe143 Fix grDrawTriangle calling convention for Linux.
Thanks to Ozkan Sezer <sezeroz@gmail.com>.
2005-04-25 23:53:59 +00:00
koolsmoky
7768c6150f Fix for Linux 2005-04-25 23:50:00 +00:00
koolsmoky
c9e2c802f9 pragma directives for win32
removed detritus
2005-04-25 22:08:48 +00:00
guillemj
7e265ee0e5 Add GPL notice. 2005-04-23 22:18:15 +00:00
guillemj
8bc22af8d8 3dfx_device.c: Add Macronix MX86251 Voodoo Rush support.
Thanks to Ozkan Sezer <sezeroz@gmail.com>.
2005-04-23 22:16:30 +00:00
guillemj
fe7ea78d17 3dfx_device.c (setmtrr_3dfx): Add missing break on default case.
Thanks to Ozkan Sezer <sezeroz@gmail.com>.
2005-04-23 22:13:06 +00:00
guillemj
72f246a7c9 Fix configure help output for fx-dri-build option.
Thanks to Ozkan Sezer <sezeroz@gmail.com>.
2005-04-23 21:53:52 +00:00
guillemj
a5eca811b3 * 3dfx_device.c: Fix comment format. Remove obsolete compiler flags
info.
2005-04-23 21:45:05 +00:00
guillemj
92f8d35750 Move ChangeLog entries to a separate file. 2005-04-23 21:29:11 +00:00
koolsmoky
74da7049a3 fixed 3dnow! and mmx optimizations 2005-04-23 18:36:36 +00:00
koolsmoky
881c63f226 added workaround for 8bit wide texture downloads for old revision TMUs 2005-04-23 18:33:33 +00:00
koolsmoky
0c01d45d7a fixed grDrawTriangle triangle dispatch code 2005-04-23 18:27:26 +00:00
koolsmoky
d795e8907d changes to support calling conventions in asm files 2005-04-23 18:23:46 +00:00
guillemj
eff4c4ebc5 Lowercase FX_GLIDE_HW values.
Thanks to Ozkan Sezer <sezeroz@ttnet.net.tr> for the notice.
2005-04-02 19:26:43 +00:00
koolsmoky
aa932364fe enabled packed argb for cmd packet type 3 2005-01-22 14:52:02 +00:00
dborca
2007f26c53 remove unecessary defines 2005-01-17 09:39:49 +00:00
dborca
7df16681b6 let Linux/DOS INIT sequence be verbose 2005-01-17 09:25:18 +00:00
koolsmoky
c0ff0141d6 Restict calls to pciOpen() pciClose() when compiled with DIRECTX option. this fixes problems with the win32 miniport opened in exclusive mode.
allow mismatched sli. added SSTV2_MISMATCHED_SLI envvar.
2005-01-13 16:22:53 +00:00
koolsmoky
6d736fd608 Restict calls to pciOpen() pciClose() when compiled with DIRECTX option. this fixes problems with the win32 miniport opened in exclusive mode. 2005-01-13 16:22:01 +00:00
koolsmoky
8040c684ef fixed builds without the USE_X86 option. 2005-01-13 16:20:18 +00:00
koolsmoky
f0cb59432c prepare for packed rgb 2005-01-13 16:11:39 +00:00
koolsmoky
e8812e71bf fixed Metabyte WickedGL detection 2005-01-13 16:11:20 +00:00
koolsmoky
cfbaebc615 Restict calls to pciOpen() pciClose() when compiled with DIRECTX option. this fixes problems with the win32 miniport opened in exclusive mode. 2005-01-13 16:09:06 +00:00
koolsmoky
d9fa6f7198 Restict calls to pciOpen() pciClose() when compiled with DIRECTX option. this fixes problems with the win32 miniport opened in exclusive mode.
allow mismatched sli. added SSTV2_MISMATCHED_SLI envvar.
2005-01-13 16:07:06 +00:00
koolsmoky
5414eddde4 Restict calls to pciOpen() pciClose() when compiled with DIRECTX option. this fixes problems with the win32 miniport opened in exclusive mode. 2005-01-13 16:03:25 +00:00
koolsmoky
79b31d35a4 fixed Metabyte WickedGL detection 2005-01-13 15:48:32 +00:00
koolsmoky
489324c55a prepare for packed rgb 2005-01-13 15:46:50 +00:00
koolsmoky
a04cbf9994 fixed warning typo 2005-01-13 15:42:51 +00:00
koolsmoky
5958659f70 disabled mtrr's on sli slave devices 2005-01-02 04:15:53 +00:00
koolsmoky
0074568397 added dll entry point to call grGlideShutdown when a process is detached 2004-12-27 20:47:11 +00:00
koolsmoky
3309cb7dd1 copied from cvg glide3 2004-12-27 08:29:43 +00:00
koolsmoky
bcdf3a20e4 merged with cvg glide3 2004-12-27 08:28:57 +00:00
koolsmoky
56cd565a3e copied from cvg glide3 2004-12-27 07:36:30 +00:00
koolsmoky
8cb69ddacd enabled envar reads from windows registry 2004-12-27 07:32:16 +00:00
koolsmoky
ec0fb6b1f0 fix os detection 2004-12-25 17:53:24 +00:00
koolsmoky
1b65b3fe37 remove bump test (forceautobump) 2004-12-25 17:52:46 +00:00
koolsmoky
65c280be54 detect os and cpu before detecting glide devices 2004-12-25 17:52:04 +00:00
koolsmoky
c59d79b104 clean.
disable 24->16bpp dithering when in 32bpp mode.
2004-12-25 17:51:09 +00:00
koolsmoky
5f51d98eb1 swapinterval 2004-12-23 21:03:14 +00:00
koolsmoky
6d9fbdee4a builds without asm optimizations (USE_X86=1) 2004-12-23 20:56:25 +00:00
koolsmoky
f952be1383 works with cygwin gnu make 2004-12-23 20:47:40 +00:00
koolsmoky
5e0365a93a converted to nasm syntax
added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations
2004-12-23 20:45:56 +00:00
koolsmoky
471935edbb remove dll export/import fix 2004-12-23 20:36:10 +00:00
koolsmoky
3568e6bebb remove old cpuid 2004-12-23 20:24:08 +00:00
koolsmoky
6406255463 works with cygwin gnu make 2004-12-23 20:22:38 +00:00
koolsmoky
b523ad8b58 works with cygwin gnu make 2004-12-23 20:14:37 +00:00
dborca
9477334927 sst1/cvg generates libglide3x 2004-12-16 07:48:31 +00:00
dborca
b3b3bf4853 hasDev3DfxLinux is really a function (Max Behensky) 2004-12-16 07:46:45 +00:00
dborca
3dff6714b3 added more win32 flags 2004-12-14 08:31:36 +00:00
dborca
d3b76d2e16 unite the clans... once again (unified build process) 2004-12-14 08:30:07 +00:00
dborca
899068c963 updated status, build info 2004-12-14 08:28:54 +00:00
dborca
9d14fa297e added GNU makefile for Win32 2004-12-13 08:41:32 +00:00
dborca
1af5c552fe fixed splash DLL code (but partially left disabled) 2004-12-13 08:40:18 +00:00
dborca
e36b40e673 added prototypes for splash DLL 2004-12-13 08:38:37 +00:00
dborca
752b1f6e3d updated status, build info 2004-12-13 08:37:31 +00:00
koolsmoky
97fbce5c9c cosmetics 2004-12-12 15:29:44 +00:00
koolsmoky
c5cc9ba363 changes to support new cpuid
set default to disable alpha dither subtraction
2004-12-12 15:27:47 +00:00
koolsmoky
1ed952f4b6 changes to support new cpuid 2004-12-12 15:26:04 +00:00
koolsmoky
ef890f8425 grDitherMode(): force 2x2 dithering for 4x1 dither
grBufferSwap(): enable vsync and set swapbufferinterval to 0 for tripple buffering.
2004-12-12 15:24:40 +00:00
koolsmoky
c6986acec1 use toupper for __MSC__ 2004-12-12 15:20:35 +00:00
koolsmoky
d431b91202 changes to support new cpuid; moved single_precision_asm(), double_precision_asm() from cpudetect.asm 2004-12-12 15:18:58 +00:00
koolsmoky
34936e9bc3 support new cpuid 2004-12-12 15:17:18 +00:00
koolsmoky
b2b8265a5d new cpuid 2004-12-12 15:16:43 +00:00
koolsmoky
e64083bdfe win32 make file. need to convert asm files to nasm syntax for USE_X86 build option to work. 2004-12-12 15:14:44 +00:00
koolsmoky
c9e2822c70 added options; GLIDE_BLIT_CLEAR - sli buffer clears, GLIDE_CHIP_BROADCAST - workaround for faulty tsus. 2004-12-12 15:07:49 +00:00
koolsmoky
e424d6ab07 revert swapInterval environmental override in grBufferSwap(). SLI lines get misaligned when swapInterval 0 and vsync disabled. 2004-12-12 15:05:25 +00:00
koolsmoky
f05af3ceec revert swapPendingCount default value to 4. 2004-12-12 15:00:09 +00:00
koolsmoky
2244ac2d97 cleanup win32 os detection 2004-11-25 19:39:55 +00:00
koolsmoky
a575ff59d4 more hacks for windowed rendering 2004-11-25 19:31:46 +00:00
koolsmoky
10093a8902 fix for mixed dll export/import declarations 2004-11-25 19:16:44 +00:00
koolsmoky
cb935e9a6f support for new cpuid and mmx texture downloads 2004-11-25 19:13:22 +00:00
koolsmoky
1b53dbd236 fixed 3dnow! and mmx texture download routines 2004-11-25 19:12:22 +00:00
koolsmoky
e870206226 set up 3dnow! triangle/vertex list routines 2004-11-25 19:11:02 +00:00
koolsmoky
c1b24a67e7 Prepare for newer splash screens 2004-11-25 19:07:31 +00:00
koolsmoky
e6cf09e358 Always allow user to override swapInterval (vsync) but force vsync on with swapbuffer interval set to 0x0 when triple buffering is enabled. 2004-11-25 19:04:25 +00:00
koolsmoky
f3753d29fe support new cpuid 2004-11-25 18:56:59 +00:00
koolsmoky
c4ca1c5f84 new cpuid copied from H5 2004-11-25 18:54:10 +00:00
dborca
d75a3e2029 added forward declaration for hwcBufferLfbAddr (Martin Weissenborn) 2004-11-18 10:11:59 +00:00
dborca
5c5664acc5 avoid warning 2004-10-11 10:02:48 +00:00
dborca
25a4af8b52 update status 2004-10-08 06:32:11 +00:00
dborca
4998a36679 save a round-trip with grDrawTriangle in SST1 2004-10-08 06:30:19 +00:00
dborca
7f45a997ab small matters concerning "ActiveWindow" on non-Windows 2004-10-08 06:28:37 +00:00
dborca
8b98c55564 use whatever swap interval user decides 2004-10-08 06:22:10 +00:00
dborca
32f0f47956 makefile cleanup 2004-10-08 06:20:23 +00:00
dborca
0e1f6972b0 MSC doesn't like aliasing the stack 2004-10-08 06:18:51 +00:00
dborca
727ec864fb comment the GR_CDECL hack to prevent accidents 2004-10-07 07:49:08 +00:00
dborca
9e1fbb7dd9 update status 2004-10-07 07:31:30 +00:00
dborca
e41a4dddeb make grValidateState consistent with its prototype 2004-10-07 07:26:04 +00:00
dborca
e805228038 fixed some misterious bugs. some... 2004-10-07 07:19:50 +00:00
dborca
7a84ec28e0 use the right Escape sequence on win32 2004-10-07 07:17:56 +00:00
dborca
da70978cfd corrected grDrawTriangle on MSVC 2004-10-07 07:16:38 +00:00
dborca
8932dd3ffe added a bunch of files to allow sst1/cvg build out-of-the-box 2004-10-05 15:01:12 +00:00
dborca
6045061d5b removed detritus 2004-10-05 14:56:50 +00:00
dborca
12ba1ce38b DOS/OpenWatcom woes 2004-10-05 14:54:44 +00:00
dborca
8bb1bb352d killed some warnings 2004-10-05 14:52:36 +00:00
dborca
b3e4a22e6d removed misplaced else 2004-10-05 14:50:54 +00:00
dborca
0406bce42f conditional compilation a bit more sane 2004-10-05 14:47:18 +00:00
dborca
d0657978d8 removed detritus 2004-10-05 14:43:19 +00:00
dborca
b410bb7e20 added DOS/OpenWatcom makefiles 2004-10-05 14:34:58 +00:00
dborca
7f19a09dc5 remove unnecessary files from build 2004-10-05 14:33:53 +00:00
dborca
0633a3231f added DOS/OpenWatcom support 2004-10-04 09:43:39 +00:00
dborca
f4ddf221d6 killed some warnings 2004-10-04 09:41:26 +00:00
dborca
4dd1af0e85 second cut at Glide3x for Voodoo1/Rush (massive update):
delayed validation, vertex snapping, clip coordinates, strip/fan_continue, bugfixes.
and probably a bunch of other crap that I forgot
2004-10-04 09:36:00 +00:00
dborca
a5115738b3 DOS/OpenWatcom support 2004-10-04 09:26:31 +00:00
dborca
46295978d5 taming FX_CSTYLE havoc 2004-10-04 09:24:02 +00:00
dborca
57e51764f8 made Win32 compile... not too useful ATM 2004-10-04 09:23:18 +00:00
dborca
73db6676a4 OpenWatcom support 2004-10-04 09:22:44 +00:00
dborca
8341485146 handle STDCALL correctly 2004-10-04 09:19:25 +00:00
dborca
5d59cd4e2f killed some warnings / compilation errors 2004-10-04 09:17:16 +00:00
dborca
22d4f642cb make sure SLI boards are correctly counted 2004-10-04 09:13:33 +00:00
dborca
3707221248 watcom fixes 2004-10-04 09:06:15 +00:00
dborca
024bd0832f avoid silly warnings 2004-10-04 09:04:24 +00:00
dborca
d5cdfe9374 small fixes to the testsuite(s) 2004-10-04 09:00:33 +00:00
dborca
b292afdb71 supporting DOS/OpenWatcom in Assembly files 2004-10-04 08:57:52 +00:00
dborca
9c02fa48e5 added makefiles for DOS/OpenWatcom and Win32 2004-10-04 08:55:20 +00:00
dborca
329ac0931f detailed info about each branch 2004-10-04 08:50:50 +00:00
dborca
833ae187e5 removed extra info 2004-10-04 08:48:16 +00:00
dborca
2d1b632d7b add this back to prevent pruning on checkouts 2004-10-04 08:25:56 +00:00
dborca
ec7faefa52 avoid unsigned wrap-arounds 2004-09-27 09:14:46 +00:00
dborca
0b4dbea566 avoid unsigned wrap-arounds 2004-09-27 09:09:41 +00:00
dborca
ada722548b aligned aux buffer correctly (maybe) 2004-09-27 09:05:22 +00:00
dborca
4bb204b929 fixed trilinearness bug. reorg brackets 2004-09-27 09:02:11 +00:00
dborca
a803ae4ed1 clamp lod bias 2004-09-27 08:59:45 +00:00
dborca
f9001acfe6 type-punning warning 2004-09-27 08:58:15 +00:00
dborca
54c4601dd0 reorg brackets 2004-09-27 08:51:05 +00:00
dborca
fa967172f3 fixed debug paths 2004-09-27 08:49:42 +00:00
dborca
e79dd613ee fixed testsuite for all libs 2004-09-27 07:27:52 +00:00
dborca
2506470f93 Rush: fixed grLfbLock(AUXBUFFER) 2004-09-24 06:58:10 +00:00
dborca
5484926668 small fixes 2004-09-24 06:56:30 +00:00
dborca
e1a07c1ff2 grDrawLine for Rush and other fixes 2004-09-24 06:55:12 +00:00
guillemj
90cb835f39 Add missing function grBufferSwap() when using the DRI build.
Thanks to Hans de Goede <j.w.r.degoede@hhs.nl>.
2004-09-07 17:33:21 +00:00
guillemj
05750ad397 Move KVERS and MODULES_DIR to the outern Makefile so they get a value when
no config file exist.
2004-08-21 07:16:26 +00:00
guillemj
1a752ef706 Document new build system. 2004-08-21 05:57:46 +00:00
guillemj
e049e53976 New build system for Linux kernels using kbuild (2.6+) and the legacy ones. 2004-08-21 05:44:39 +00:00
dborca
b7ca0e0fa7 restrict ports that can be accessed 2004-08-20 08:26:47 +00:00
dborca
c89df99c6e Linux should use INIT_LINUX, really 2004-08-20 08:25:10 +00:00
guillemj
d34710e10d Do not show the modules target as a default example. 2004-08-18 18:32:15 +00:00
guillemj
b58bfd998c Add module version macro. 2004-08-18 18:31:10 +00:00
dborca
d67cd249c0 make sure we stay on path if someone decides to import some more src here 2004-07-27 08:06:12 +00:00
dborca
914d1d9149 separate alpha from rgb. it was causing problems with Rush's ZBuffer 2004-07-26 07:59:30 +00:00
dborca
ce994a7077 avoid unsigned wrap-arounds 2004-07-26 07:58:00 +00:00
dborca
9c378ee7c6 make sure we stay on path if someone decides to import some more src here 2004-07-26 07:56:55 +00:00
guillemj
24b6f748c5 Fix build failure due to missing appended slashes ('/') on include dirs
passed to nasm.
Thanks to jlm <jsado_sc3@earthlink.net> for the patch.
2004-07-25 07:04:56 +00:00
koolsmoky
ac5cdd19bf clean up grSstWinOpen 2004-07-19 07:39:04 +00:00
koolsmoky
bab2f1ce05 use dllimport for __MSC__ imports 2004-07-12 17:41:24 +00:00
koolsmoky
2ce94fd316 more dll build options 2004-07-12 17:34:33 +00:00
koolsmoky
a24bf3695d correct FX_CALL and FX_ENTRY 2004-07-12 17:33:41 +00:00
koolsmoky
d46a668566 removed duplicate grStipplePattern() 2004-07-12 17:31:47 +00:00
dborca
4d853558e1 fixed nasm flags for the auto* combo 2004-07-09 11:59:43 +00:00
guillemj
9ab5549e22 Switch to bare sh. Some cleaning. 2004-07-01 20:23:08 +00:00
guillemj
f305b6c853 Added libtoolize. 2004-07-01 07:27:09 +00:00
koolsmoky
915ba05f03 update dll build options 2004-06-29 09:26:01 +00:00
koolsmoky
867d9be05d TLS updates 2004-06-29 09:24:28 +00:00
koolsmoky
df77cf56d7 Use Microsoft's recomended build settings for win32 dll 2004-06-20 14:31:18 +00:00
koolsmoky
8753ab9f02 revert: allow EdgeAA on top of FSAA 2004-06-19 16:25:57 +00:00
koolsmoky
0423c58099 disable AA'ed primitives in FSAA mode 2004-06-13 08:30:39 +00:00
koolsmoky
1bb2e0b0d2 fill in TAA jitter values for 4-chip 8xFSAA and 1-chip 2xFSAA 2004-06-13 08:26:28 +00:00
koolsmoky
68cf1e1da6 no message 2004-06-13 08:19:29 +00:00
koolsmoky
ad0696197c fixed V56k 4xFSAA (1 subsample per chip, analog sli) 2004-06-08 16:19:13 +00:00
dborca
ff03d4b88f temporal AA. new jitter offsets courtesy of Koolsmoky 2004-06-07 06:08:00 +00:00
koolsmoky
9ba0dc01b9 texture base address alignment fix for dxt1 downloads. 2004-05-11 19:35:44 +00:00
koolsmoky
0b554c2612 account for the changes of how %include is handled in NASM 0.98.38 2004-05-08 13:43:38 +00:00
dborca
91e7543a18 updated makefiles for NASM (no more phase error) 2004-05-07 06:06:12 +00:00
guillemj
74574721b7 Use designators in fops_3dfx instead of the obsolete colon syntax. 2004-05-04 22:36:29 +00:00
guillemj
7338f90ad4 Indentation fixes. Normalized ChangeLog date format. 2004-05-04 21:47:41 +00:00
guillemj
250ed3ef5b Finish porting to linux kernel 2.6, using the new api, and new kernel build
system, by Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>. Thanks!

Reworked the new kernel build system support from Aristeu's patch.
2004-05-04 20:55:05 +00:00
koolsmoky
6f3748e9c4 grDrawVertexArrayContiguous fix for Mesa 2004-05-04 17:08:18 +00:00
koolsmoky
8a883aaec9 clean up 2004-05-04 17:04:31 +00:00
dborca
099a207814 evil memo cleanup 2004-04-29 08:19:20 +00:00
koolsmoky
18720fa683 Enabled use of real Napalm bus 2004-04-28 17:54:35 +00:00
koolsmoky
0cbd7ad567 Daniel Borca's fixes
Compensate for the new GETENV changes
Changed behavior of '22bit' post filter
2004-04-28 17:54:05 +00:00
koolsmoky
2de9805027 Removed registry path from GETENV.
Removed FX_GLIDE_AA_PIXELCENTER, FX_GLIDE_AA_JITTERDISP, FX_GLIDE_AA_GRIDROTATION, and FX_GLIDE_FORCE_SST0.
Removed FX_GL_LFBLOCK_HACK and FX_GLIDE_USE_HWC_AA_FOR_LFB_READ.
Moved _grSstDetectResources into _GlideInitEnvironment so that it will not be called everytime _grGlideInit is called.
2004-04-28 17:40:52 +00:00
koolsmoky
b965f50702 fixed texture buffer being cut in half for single tmu cards (H3). 2004-04-02 14:38:41 +00:00
dborca
6ee0f85391 Linux makefile fixes (ajax 'at' nwnk 'dot' net) 2004-03-17 08:17:12 +00:00
dborca
230c88f374 added DRI switches description in top makefile.linux 2004-03-15 10:02:08 +00:00
dborca
88b0b8a650 Voodoo Rush fixes 2004-03-08 07:42:24 +00:00
dborca
13d6a0f4e5 Bastardised Glide3x for SST1 2004-03-02 07:56:29 +00:00
dborca
6ce0e9ab42 changed the build process to make the branches independent
made glide.h consistent across all branches
grQueryResolution now works in DOS
more tests in CVG branch
some other fixes
2004-03-02 07:30:59 +00:00
dborca
397102116f Koolsmoky latest changes wrt TLS 2004-02-20 10:12:58 +00:00
dborca
36aa323d87 exposed grSetNumPendingBuffers through grGetProcAddress 2004-02-20 10:07:38 +00:00
dborca
08220f02bd grSetNumPendingBuffers visible with grGetProcAddress 2004-02-16 07:42:16 +00:00
koolsmoky
a9362d59c3 dxt1 texture fix 2004-02-11 06:46:18 +00:00
dborca
ca68a1e33e grSstSelect refactor 2004-02-09 08:03:14 +00:00
koolsmoky
55aa3d89dd fixed comments 2004-02-08 21:58:57 +00:00
koolsmoky
2dbc6d696e fixed bug scanning min and max alpha values 2004-02-08 18:28:26 +00:00
koolsmoky
26c4247cdd set alpha threshold for 1bit alpha dxt1 as specified in OpenGL spec. 2004-02-08 01:49:39 +00:00
koolsmoky
0c15f5c91a analyze the entire texture for 1bit alpha dxt1
use error diffusion for dxtn rgb565 conversions
fixed dxt4,5 quantizer
2004-02-08 00:55:01 +00:00
dborca
ab1fe87f14 main ALWAYS returns int 2004-02-02 07:47:13 +00:00
guillemj
873a724200 Fix autotool build system. 2004-01-25 11:03:04 +00:00
guillemj
3b11585bb0 Remove obsolete libtool generation script. 2004-01-25 11:01:37 +00:00
guillemj
87e90b9541 Fixed autotools build system. 2004-01-25 10:53:01 +00:00
guillemj
d0a9cb47d6 Support linux kernels 2.6. 2004-01-25 09:40:47 +00:00
guillemj
0b9e4e1c84 Added changelog entry. 2004-01-25 08:39:01 +00:00
guillemj
b57e2c294b Ported to linux kernel 2.6. 2004-01-21 12:58:52 +00:00
dborca
6ffeebc162 compilation and some other minor fixes to aid in debugging 2004-01-20 14:04:10 +00:00
dborca
21a713dc68 compilation errors (mainly for DEBUG mode) 2004-01-13 09:22:51 +00:00
dborca
da0be8d904 fixed _stdcall RET opcodes in Assembly 2004-01-13 09:19:12 +00:00
koolsmoky
1452e51cdd no message 2004-01-11 18:32:29 +00:00
koolsmoky
9110ab17f1 [win32] Converted winsurf.cpp to C. Fixes and additions for windowed rendering. 2004-01-11 18:29:29 +00:00
koolsmoky
a5e24cc268 [win32] Cleaned hwcInit() and removed window association. 2004-01-11 18:16:37 +00:00
dborca
beb671ed0e GPIO 2003-12-08 13:15:31 +00:00
dborca
e869300446 better Texus2 integration 2003-12-08 13:13:11 +00:00
dborca
698db33051 Voodoo5 6000 happiness 2003-12-08 13:12:39 +00:00
koolsmoky
a20451f387 disabled two tri fill 2003-11-25 16:21:05 +00:00
koolsmoky
bc8321de06 removed comments 2003-11-25 16:19:28 +00:00
koolsmoky
0c477a7afb attempt to fix DXT1 4x4 mipmap downloads to the TMUs 2003-11-25 16:18:20 +00:00
dborca
6b5e8acf71 fixed pointcast... again! 2003-11-18 12:55:20 +00:00
koolsmoky
517dfb03be attempt to fix DXT1 4x4 mipmap downloads to the TMUs 2003-11-09 02:01:06 +00:00
koolsmoky
148fd0ada3 attempt to fix DXT1 4x4 mipmap downloads to the TMUs 2003-11-09 01:54:13 +00:00
dborca
faf822daf3 removed stray backslash 2003-11-08 10:07:53 +00:00
guillemj
69f957db74 Finish uniting the clans for Automake files. 2003-11-08 08:43:21 +00:00
guillemj
e08300cb43 Unify multi-arch implementation of _grErrorDefaultCallback() function. 2003-11-08 08:39:15 +00:00
dborca
e229833d24 keeping things simple 2003-11-07 13:52:32 +00:00
dborca
42132e3665 unite the clans 2003-11-07 13:38:39 +00:00
dborca
15848b504f Removed balanced #endif. 2003-11-04 12:53:38 +00:00
dborca
4c956aa0a6 embedded Texus2 2003-11-03 13:36:54 +00:00
dborca
2ff376b852 Voodoo2 happiness (DJGPP & Linux) 2003-11-03 13:34:30 +00:00
dborca
b19d6d3bf5 limited pointcast 2003-11-03 13:28:31 +00:00
guillemj
ff0a4a4905 Splitted install target.
Do not trash user variables (CFLAGS).
Honour DESTDIR.
Added support for KVERS, KHEADERS, and MODULES_DIR.
2003-11-03 08:33:08 +00:00
guillemj
9d5ef92b50 Remove invalid use of sizeof from ioctl calls. 2003-11-03 07:30:05 +00:00
guillemj
ee8430cb2c Remove unbalanced #endif. 2003-11-03 07:27:50 +00:00
guillemj
2ffb39127f Removed function keyword to make it a POSIX Shell. 2003-11-02 23:29:47 +00:00
guillemj
b0551a7c4b Fixed an unbalanced quotation mark on --make-hst sed expression.
Protected all other sed expressions.
2003-11-02 23:28:16 +00:00
dborca
b80cf1c1de added unconditional Texus2 compilation 2003-10-30 11:41:38 +00:00
dborca
deae98043b conditioned Texus2 compilation 2003-10-30 11:40:40 +00:00
dborca
3d453046cc properly exported some Texus2 functions 2003-10-30 11:39:18 +00:00
guillemj
c54d6a2ee4 * configure.in: Use double square braquets in the architecture line, so
it's correctly parsed to generate configure.
2003-10-26 16:20:06 +00:00
dborca
7558076800 changes to allow compressed texture tests 2003-10-21 08:08:06 +00:00
dborca
28535c886e fixed minihwc; conditioned context checking; added Texus2 to Glide3 2003-10-14 15:04:07 +00:00
dborca
e778c12ca2 Fixed paths in Linux tests makefile 2003-10-13 13:36:05 +00:00
koolsmoky
0754713319 favor 4x1 over 2x2 video filter for analog sli
use normal video filters if FX_GLIDE_V56K_DAC_FIX is disabled
2003-10-13 01:39:33 +00:00
dborca
f44571f658 More non-DRI Linux fixes 2003-10-11 09:24:18 +00:00
dborca
ff9b98e56f Linux makefile 2003-10-10 10:05:11 +00:00
dborca
c9a74b1b17 Linux redivivus 2003-10-10 09:53:30 +00:00
dborca
29570c57c4 SST IO support. Napalm recognition. Makefile fixes. 2003-10-09 15:33:23 +00:00
koolsmoky
05fdf9461a use 4x4 filter if > 1024x768 2003-09-24 20:18:52 +00:00
koolsmoky
d8d62a1e70 indentation 2003-09-24 19:35:11 +00:00
koolsmoky
63c3c6a873 Added FX_GLIDE_V56K_DAC_FIX to enable/disable DAC workaround for Voodoo5 6000 2003-09-24 19:30:20 +00:00
koolsmoky
4bcd5665b0 indentation 2003-09-24 19:23:00 +00:00
koolsmoky
ffd7598574 win32 alt-tab fix changes 2003-09-24 19:22:22 +00:00
koolsmoky
9a910ee5f8 cleaned win32 alt-tab fix
added FX_GLIDE_ALT_TAB_FIX to force win32 alt-tab fix
cleaned v56k gamma interpolation
2003-09-12 05:20:13 +00:00
koolsmoky
6ad857c9e0 cleaned win32 alt-tab fix 2003-09-12 05:12:28 +00:00
koolsmoky
095bb6777a preparing for graphic context checks
fixed jmp errors
2003-09-12 05:11:45 +00:00
koolsmoky
89ff5c6968 preparing for graphic context checks 2003-09-12 05:08:35 +00:00
koolsmoky
5f1285c441 cleaned win32 alt-tab fix 2003-09-12 05:06:23 +00:00
dborca
cedb308d38 renamed library to cope with short filenames 2003-08-28 15:34:26 +00:00
koolsmoky
a65846e4d6 clean up 2003-08-26 18:03:41 +00:00
koolsmoky
6b3b2afb74 indentation cleanup 2003-08-26 15:41:34 +00:00
koolsmoky
7c059e2029 global context num_tmu max is 2 2003-08-26 15:40:11 +00:00
koolsmoky
01013ad51e DRI fixes for grTBufferWriteMaskExt 2003-08-26 15:34:47 +00:00
dborca
cfeb5c8a20 dangerous macro construction 2003-08-26 06:55:18 +00:00
dborca
b5896cf6e6 makefile consistency 2003-08-25 12:08:01 +00:00
dborca
9eb8ae93c6 makefile consistency 2003-08-25 12:06:36 +00:00
dborca
b6b71a4d68 Linux cleanup... eheh! 2003-08-22 05:29:59 +00:00
dborca
7aa4e220de Assembler flags 2003-08-21 09:03:22 +00:00
dborca
03e59b7e59 Texture fixes by Koolsmoky 2003-08-21 08:49:55 +00:00
dborca
eb9ca4dbed cleansed code 2003-08-21 08:49:11 +00:00
dborca
5d26edba88 some things to remember 2003-08-21 08:44:33 +00:00
dborca
6dab1639d5 removed unused files 2003-08-21 08:41:52 +00:00
dborca
4e71aa3eed cleaned up DJGPP/MinGW makefiles 2003-08-21 08:39:38 +00:00
dborca
00c107305c moved CINIT to h5 (h3 is phased out) 2003-08-21 08:32:12 +00:00
koolsmoky
6932027116 use msvcrt c runtime 2003-08-17 16:00:35 +00:00
koolsmoky
c5bcf24387 removed unused file 2003-08-15 12:41:42 +00:00
koolsmoky
e536bd8f3a remove unused files 2003-08-15 12:14:28 +00:00
koolsmoky
359a05b2d5 added glide3 specific build flags 2003-08-15 11:51:52 +00:00
koolsmoky
0657059cff use automatic versioning 2003-08-15 11:50:38 +00:00
koolsmoky
fdb64e3424 always default to 2 pixel per clock mode 2003-08-11 00:20:09 +00:00
koolsmoky
758d3324e5 fixed ifdef error for *bsd in grBufferSwap 2003-08-08 20:49:07 +00:00
koolsmoky
cfbd5e7bde fixed buffer size for registry paths
minimum runtime between GetDC and ReleaseDC
delete device context when exiting
2003-08-07 20:01:22 +00:00
koolsmoky
07ce126519 removed uneeded window handle check and fixed ddEnumCbEx usage in checkResolutions 2003-08-07 19:50:37 +00:00
dborca
3e5ddeacce MinGW issues again. 2003-08-07 10:32:51 +00:00
dborca
2687c043af Preparing for MinGW 2.0 2003-08-04 12:45:47 +00:00
dborca
c0979a598b Enabled 32bit Z writes 2003-08-04 12:44:40 +00:00
dborca
8283931df7 Four chip by Koolsmoky 2003-08-01 10:06:41 +00:00
koolsmoky
796f119669 fixed EOL 2003-07-30 20:07:06 +00:00
dborca
07ccf2d302 Fixed Linux... again!!!
Changed contact address!
2003-07-29 10:05:04 +00:00
dborca
890926228a Shamelessness.
Safeguard in CPUID.
Changed contact address!
Koolsmoky's texture download fixes.
2003-07-29 10:04:32 +00:00
dborca
69259445a7 Removed unused files! 2003-07-28 14:12:05 +00:00
koolsmoky
92dfa218b4 symbols for debug builds 2003-07-27 12:20:01 +00:00
koolsmoky
787776dc0e removed const from _grBufferClear2D buffOffset because it's not 2003-07-26 22:36:13 +00:00
koolsmoky
0c31bd094c enabled debug symbols for debug builds 2003-07-26 22:32:46 +00:00
dborca
53a8d8b1b0 Attempt to fix texturebuffer/SLI. 2003-07-25 07:15:51 +00:00
dborca
533a477142 ... in the name of the Linux, DRI and the sacred Glide... 2003-07-25 07:14:59 +00:00
dborca
d83e85c6a4 removed debris 2003-07-25 07:13:41 +00:00
koolsmoky
babd8326bd use __try/__except mechanism for win32 to catch SSE sigillegal in win95 2003-07-24 13:13:03 +00:00
koolsmoky
285b967be2 added win me,2k,xp to supported list 2003-07-24 13:08:08 +00:00
anholt
535ade3552 FreeBSD also can't do static initialization to stdout/stderr, and most unixes
are going to need the prototype for hwcGetenv.
2003-07-24 03:53:02 +00:00
anholt
4a53bfb160 Convert h5/glide3/src/ for FreeBSD, mostly by changing #ifdef __linux__ to
#ifdef DRI_BUILD, and removing a bit of dead code.
2003-07-24 03:51:08 +00:00
anholt
6f367986f4 Make hwcGetenv's argument a const to match the prototype. 2003-07-23 18:52:36 +00:00
anholt
8f048f464d automake/autoconf changes for FreeBSD:
- Add the X11 header location to CFLAGS in minihwc.
- Add a DRI_BUILD conditional and define it in the CFLAGS in glide3.
- Use gmake instead of make when it's found.
- Add AC_CANONICAL_TARGET, which appeases libtool.
2003-07-23 18:51:01 +00:00
anholt
63c16626f8 Disable the fxTime and timer functions on FreeBSD, which are only used by
the tests.
2003-07-23 18:45:17 +00:00
anholt
59ee0209d0 Move code from fxfreebsd.c to fxlinux.c. Note that this code is almost all
dead in the DRI case, anyway.
2003-07-23 18:43:47 +00:00
anholt
d570839952 malloc.h is deprecated, use stdlib.h instead. 2003-07-23 06:29:33 +00:00
koolsmoky
d183c81f39 fixed debug 2003-07-21 22:03:40 +00:00
koolsmoky
2eacd87ff3 fixed clean 2003-07-21 21:15:55 +00:00
koolsmoky
796540cd5b added rules for sbench 2003-07-21 14:43:10 +00:00
koolsmoky
8f32bcb3b3 removed cast to volatile float 2003-07-21 14:41:57 +00:00
koolsmoky
c11ed99fa3 modified debug and switched to single thread standard c library 2003-07-21 14:41:03 +00:00
dborca
e42f28137a DJGPP SSE happiness 2003-07-21 10:24:24 +00:00
koolsmoky
8b76cc1944 Fixed getregpath 2003-07-19 17:25:39 +00:00
dborca
8eec69e649 even smaller matters 2003-07-18 08:59:25 +00:00
koolsmoky
61494a9258 Explicitly specified link libraries. 2003-07-17 10:50:32 +00:00
koolsmoky
c3c5f2e0f0 Added win32 makefile for glide3 tests 2003-07-17 10:15:27 +00:00
koolsmoky
bd04c38ade no message 2003-07-16 19:27:23 +00:00
koolsmoky
0c87f5dad8 Disabled release of exclusive mode in grSstWinClose for win32. 2003-07-16 17:53:42 +00:00
koolsmoky
5d727e3651 Removed IS_ALT_TAB and unused functions.
Modifications to revive win95 support.
2003-07-16 17:49:53 +00:00
koolsmoky
dc6c1c036c no message 2003-07-16 17:36:29 +00:00
koolsmoky
99355828b0 new makefile for win32 2003-07-16 17:31:58 +00:00
dborca
1df56889ab small matters 2003-07-15 10:28:23 +00:00
dborca
72a46fc1ad fixed small bug: readPtr -> depth 2003-07-15 10:27:05 +00:00
dborca
d0251d38ed shamelessness again 2003-07-11 10:06:39 +00:00
dborca
30d2c54cba no message 2003-07-10 12:30:35 +00:00
dborca
4b715ac8be shamelessness 2003-07-10 12:16:56 +00:00
koolsmoky
ed1f80f916 removed unused local variables 2003-07-08 18:43:37 +00:00
koolsmoky
83c37ba65b fixed vga_vsync_offset field in cfgSliAAMisc 2003-07-08 17:32:59 +00:00
dborca
d158b58a28 cosmetics... 2003-07-08 08:08:20 +00:00
dborca
4591450d8e updates to MMX/FPU specializations 2003-07-08 08:06:45 +00:00
dborca
9d17415f93 fixed variadic macros 2003-07-08 07:30:17 +00:00
koolsmoky
1c65fd4046 cleaned logs 2003-07-07 23:29:07 +00:00
koolsmoky
20e154479a hwcGetenv/Ex to match header 2003-07-07 22:28:15 +00:00
dborca
c2d3c2695a small fixes 2003-07-07 16:45:03 +00:00
guillemj
1655f07627 Reintroduced gthread.c compilation. 2003-07-07 01:45:55 +00:00
guillemj
3f9a537344 Added parameters to automake to copy and update missing files. 2003-07-07 01:45:00 +00:00
koolsmoky
4d57a8ac56 cleaned hwcGammaTable 2003-07-05 11:07:19 +00:00
koolsmoky
d136e83778 no message 2003-07-03 13:16:46 +00:00
koolsmoky
a577528108 obscure activities from other app's window 2003-07-03 13:15:53 +00:00
koolsmoky
aaa1fe6d5d changed overlay filter rules. prepared for dos_mode.c sli/aa setup additions. 2003-07-03 10:45:29 +00:00
koolsmoky
23c393d4b2 compensate for grGlideInit changes 2003-07-03 10:41:47 +00:00
koolsmoky
59d1ea8cc1 disabled 2ppc mode for high res 2003-07-03 10:37:14 +00:00
koolsmoky
c9c41ef84b cleaned _grlfblock 2003-07-03 10:35:34 +00:00
dborca
578c360bf4 removed CPUID detritus 2003-07-01 11:18:03 +00:00
dborca
004928ff15 fixed a bug in GNUC code when running Intel; also removed detritus 2003-07-01 11:16:42 +00:00
dborca
4ac226f1b5 enabled NAPALM for tests 2003-07-01 11:13:34 +00:00
guillemj
787ac42bf2 Fixed nested comments warnings.
Removed some trailing spaces.
2003-06-29 19:00:36 +00:00
guillemj
da40699dd9 Fixed preprocessor invalid token errors. 2003-06-29 18:45:56 +00:00
guillemj
ec0e9dc38b Fix compilation warnings. 2003-06-29 18:43:28 +00:00
guillemj
4768c1f721 Fixed so much warnings generated by debug macros that caused the
compilation to fail on newer gcc 3.x.
2003-06-29 18:39:05 +00:00
guillemj
061cb96484 Fixed giving build.3dfx multiple arguments, thus allowing to pass variable
assignments.
2003-06-29 18:35:39 +00:00
guillemj
979effcff2 Script converted to bash. 2003-06-29 18:32:13 +00:00
guillemj
c0820d2e93 When building with no optimizations libm is required. 2003-06-29 18:31:10 +00:00
guillemj
03622b4b3e Fixed gcc warnings on -m486 flag, and use pentium instead. 2003-06-29 18:28:55 +00:00
guillemj
5dd058b7ae Include newer 3dfx.mak file. 2003-06-29 18:25:27 +00:00
guillemj
f726c002ec Fixed compilation warnings. 2003-06-29 18:23:28 +00:00
koolsmoky
1dc8c723d6 added LFB read/write FPU specializations 2003-06-29 15:10:32 +00:00
koolsmoky
a03b54c2e9 added more CPU families 2003-06-29 14:47:58 +00:00
FIXME
eaf0155978 This commit was manufactured by cvs2svn to create branch 'glide-devel-
branch'.
2003-06-28 19:31:07 +00:00
koolsmoky
c80b119803 changes to support h5/glide3/tests/makefile 2003-06-27 15:13:13 +00:00
koolsmoky
79248afda5 fixed win32 compile error for LFB read/write MMX specializations 2003-06-27 15:11:07 +00:00
koolsmoky
913a569838 fixed for win32 2003-06-27 15:08:12 +00:00
dborca
0ddbb273b6 added LFB read/write MMX specializations 2003-06-27 10:40:52 +00:00
koolsmoky
e115acc717 moved OS and CPU flags from bInfo to _GlideRoot 2003-06-26 19:23:59 +00:00
koolsmoky
2880476dbf call _GlideInitEnvironment() only once 2003-06-24 22:45:01 +00:00
koolsmoky
12741a635b no message 2003-06-24 22:41:03 +00:00
dborca
9221bcb46a minor changes to aid in debugging 2003-06-24 11:25:17 +00:00
koolsmoky
0b5e52ab40 no message 2003-06-23 20:42:14 +00:00
koolsmoky
8a2c5318c0 winxp context work around 2003-06-23 20:40:35 +00:00
koolsmoky
75931c9a1d no message 2003-06-23 20:15:18 +00:00
koolsmoky
8dc98e970a refreshrate validation fix 2003-06-23 20:13:01 +00:00
dborca
83d9fcba9b h3cinit cleanup 2003-06-21 12:43:05 +00:00
dborca
5be1e23a0c fixes: DOS gamma, modetabl.h timings (avoid shimmering),
Napalm memory probing, more DJGPP MMX specializations,
new 32bit texture files, Linux build valid again, etc.
2003-06-19 08:38:28 +00:00
dborca
e791da7f5d no message 2003-06-19 08:25:42 +00:00
dborca
28b6186e43 no message 2003-06-19 08:16:03 +00:00
dborca
fac64e3dc4 fixed big textures 2003-06-19 08:11:08 +00:00
dborca
b1363fbf0f more fixes to NASM sources 2003-06-13 07:22:59 +00:00
koolsmoky
12753febc7 no message 2003-06-08 13:29:31 +00:00
koolsmoky
f99e23b323 fixed 2-tri fill of _grTriFill 2003-06-08 13:26:35 +00:00
koolsmoky
608d808cfc fixed debug to compile 2003-06-08 13:23:21 +00:00
koolsmoky
16a5b539db changes to support nasm sources for win32 2003-06-08 08:12:18 +00:00
dborca
463f37d20e initial checkin for NASM sources 2003-06-07 09:53:25 +00:00
koolsmoky
64216c4eaf no message 2003-06-06 19:26:43 +00:00
koolsmoky
60452f0d6f making sure djgpp works with mmx 2003-06-06 19:25:34 +00:00
koolsmoky
970f823ed6 Cleaned up win32 makefiles. 2003-06-05 08:24:35 +00:00
koolsmoky
9a64ace60c Cleaned up win32 makefiles. Added work around for v5 6000 dac problem. Completed merging screen shot routines. 2003-06-05 08:24:00 +00:00
dborca
ba980646b9 fixed DJGPP test-suite 2003-05-06 12:55:17 +00:00
dborca
3e642e03c4 no message 2003-05-05 07:12:48 +00:00
dborca
11cf13c445 no message 2003-05-05 06:50:42 +00:00
koolsmoky
3b8ff42693 initial checkin of dos win32 glide 2003-04-06 18:30:26 +00:00
koolsmoky
0b8571b620 initial checkin of dos win32 glide 2003-04-06 18:23:11 +00:00
FIXME
f65153dfe9 This commit was manufactured by cvs2svn to create branch 'glide-devel-
branch'.
2002-04-09 22:21:44 +00:00
alanh
e11ce4f2d6 AMD 3DNow fixes 2002-04-09 22:21:43 +00:00
mercury
aa7ed8a4ee Compile for MTRR if the kernel is, without checking the cpuinfo.
(And if setting the MTRR fails the module still works fine.)

Updated to remove the support for kernels before 2.2.x.
(Made the first a bit easier.)

We now only use kinfo for the makefile.
2001-07-28 08:00:12 +00:00
alanh
191ef6482f Set FX_GLIDE_SWAPINTERVAL to 0 by default 2001-03-05 15:02:18 +00:00
686 changed files with 135715 additions and 59342 deletions

9
.gitignore vendored Normal file
View File

@@ -0,0 +1,9 @@
*.o
*.a
*.lo
*.so
*.exe
fxgasm.h
*.exe
fxgasm
fxinline.h

File diff suppressed because it is too large Load Diff

300
Device3Dfx/ChangeLog Normal file
View File

@@ -0,0 +1,300 @@
2011-07-03 Guillem Jover <guillem@hadrons.org>
* Makefile (KBUILD): Handle Linux 3.x versions.
2011-07-03 Guillem Jover <guillem@hadrons.org>
* Makefile (help): Do not print command only their output.
2011-05-27 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c (MODULE_VERSION): Bump to '2011.05.27'.
2011-05-27 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c [HAVE_UNLOCKED_IOCTL] (ioctl_3dfx): Use new
prototype for unlocked_ioctl.
(fops_3dfx) [HAVE_UNLOCKED_IOCTL]: Assign ioctl_3dfx to
.unlocked_ioctl instead of .ioctl.
2011-05-27 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c: On Linux >= 2.6.33, use <generated/autoconf.h>
instead of <linux/autoconf.h>. Include it after <linux/version.h>.
* Makefile (VERSION_HEADER): Use generated/utsrelease.h if present
instead of linux/utsrelease.h or linux/version.h.
2011-05-27 Guillem Jover <guillem@hadrons.org>
* Makefile: Do not use negative exit codes.
2008-06-24 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c (MODULE_VERSION): Bump to '2008.06.24'.
2008-06-24 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c (KERNEL_MIN_VER): Remove defenition, and replace all
users with its contents.
2008-06-24 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c (pci_dev_put): Define to nothing on kernels < 2.5.73.
(setmtrr_3dfx): Call pci_dev_put to release the refcount on the
Intel 82441FX PCI device when done with it.
2008-06-22 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c (id_table_3dfx): Terminate the list with an empty
element.
2008-06-22 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c (pci_get_device): On Linux < 2.5.73 define it as
pci_find_device.
(findCardType, setmtrr_3dfx): Use pci_get_device instead of deprecated
pci_find_device.
2008-06-22 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c (cleanup_module): Ignore return value from
unregister_chrdev as it actually returns void now.
2007-02-06 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c (MODULE_VERSION): Bump to '2007.02.06'.
2007-02-06 Guillem Jover <guillem@hadrons.org>
Fix warnings when not checking pci_register_driver return codes.
* 3dfx_driver.c (findCards): Return int instead of void, and normalize
error code to be always negative, otherwise return numCards.
(init_module): Check for findCards return code, print a warning and
exit the module on error.
(init_3dfx): Likewise.
2007-02-06 Guillem Jover <guillem@hadrons.org>
* 3dfx_driver.c (HAVE_DEVFS): Define to 1 if
LINUX_VERSION_CODE >= 2.3.46 and LINUX_VERSION_CODE <= 2.6.17 or
if DEVFS_SUPPORT is defined, define to 0 otherwise.
(devfs_handle): Only use if HAVE_DEVFS.
(init_module): Only use devfs_mk_cdev or devfs_register if HAVE_DEVFS.
(cleanup_module): Only use devfs_remove or devfs_unregister if
HAVE_DEVFS.
2007-02-06 Guillem Jover <guillem@hadrons.org>
* Makefile (CFLAGS): Use '-march' instead of the deprecated '-mcpu'.
2007-02-06 Guillem Jover <guillem@hadrons.org>
* kinfo.c: Removed.
* kver.c: New file.
* Makefile: Include kver.mak.
(KVERS): Move this variable to 'kver.mak', which is a generated file.
(VERSION_HEADER): New variable to cope with UTS_RELEASE being moved
from 'linux/version.h' to 'linux/utsrelease.h' in 2.6.18.
(kver, kver.mak): New targets.
(KBUILD): New variable.
(KVER_MAJOR, KVER_MINOR, BUILD_TYPE, MODULE_TDFX): Likewise, moved
from the generated file 'config'.
(config, kinfo, kinfo.h): Remove targets.
(modules, intstall, clean): Do not depend on config target.
(modules, intstall): Depend on sanity target .
2007-02-06 Guillem Jover <guillem@hadrons.org>
* Makefile (.PHONY): Add clean_kbuild. Rename modules-legacy,
modules-kbuild, install-legacy, install-kbuild and clean-legacy to
modules_legacy, modules_kbuild, install_legacy, install_kbuild
and clean_legacy.
2007-01-31 Guillem Jover <guillem@hadrons.org>
* 3dfx_device.c (cardInfo_t): Make dev be 'struct pci_dev *' even for
kernels < 2.6.0.
(findCardType): Assign to cards[n].dev the dev variable instead of
devfn. Fix macro to use devfn instead.
2006-12-03 Guillem Jover <guillem@hadrons.org>
* 3dfx_device.c (my_remap_page_range): Define as remap_pfn_range for
linux 2.6.10 or higher.
2006-12-03 Guillem Jover <guillem@hadrons.org>
Use the "new" kernel level exception handling for memory accesses
introduced in linux 2.1.8, which obsoletes verify_aread.
* 3dfx_device.c (doQueryFetch): Remove verify_area and check for
copy_to_user return values.
(doPIORead): Likewise.
(doQueryUpdate): Remove verify_area and check for copy_from_user
return values.
(doQuery): Likewise.
(doPIOWrite): Likewise.
(doPIO): Likewise.
(verify_area) [DEBUG]: Remove function.
(a_last_dummy_function) [DEBUG]: Likewise.
2006-12-03 Guillem Jover <guillem@hadrons.org>
* 3dfx_device.c (doQueryFetch): Assign desc->device to i, and use it
when referencing cards.
2006-12-03 Guillem Jover <guillem@hadrons.org>
* 3dfx_device.c (setmtrr_3dfx): Make it static.
(resetmtrr_3dfx): Likewise.
2006-12-03 Guillem Jover <guillem@hadrons.org>
* 3dfx_device.c (id_table_3dfx): Move near the corresponding ifdef
for older kernels.
(findCards): Likewise.
(driver_3dfx): Forward declare.
2006-12-03 Guillem Jover <guillem@hadrons.org>
Rename functions obsoleted in linux 2.1.93.
* 3dfx_device.c (pcibios_read_config_byte): Rename to ...
(pci_read_config_byte): ... this and remove first argument.
(pcibios_read_config_word): Rename to ...
(pci_read_config_word): ... this and remove first argument.
(pcibios_read_config_dword): Rename to ...
(pci_read_config_dword): ... this and remove first argument.
(pcibios_write_config_dword): Rename to ...
(pci_write_config_dword): ... this and remove first argument.
2006-12-03 Guillem Jover <guillem@hadrons.org>
* 3dfx_device.c (VM_OFFSET_ALIGNED): New macro.
(mmap_3dfx): Use VM_OFFSET_ALIGNED, instead of checking for specific
kernel versions and changing behaviour.
2006-12-03 Guillem Jover <guillem@hadrons.org>
* 3dfx_device.c: Indentation fixes.
2006-03-03 Guillem Jover <guillem@hadrons.org>
* 3dfx_device.c: Rename HAVE_MTRR to CONFIG_MTRR.
2005-04-23 Guillem Jover <guillem@hadrons.org>
* 3dfx_device.c: Add GPL notice.
2005-04-24 Ozkan Sezer <sezeroz@gmail.com>
* 3dfx_device.c: Add Macronix MX86251 Voodoo Rush support.
2005-04-24 Ozkan Sezer <sezeroz@gmail.com>
* 3dfx_device.c (setmtrr_3dfx): Add missing break on default case.
2005-04-23 Guillem Jover <guillem@hadrons.org>
* 3dfx_device.c: Fix comment format. Remove obsolete compiler flags
info.
2005-04-23 Guillem Jover <guillem@hadrons.org>
* 3dfx_device.c: Move ChangeLog entries to ...
* ChangeLog: ... here.
2004-05-05 Guillem Jover <guillem@debian.org>
* Use designators in fops_3dfx instead of the obsolete colon syntax.
2004-05-04 Guillem Jover <guillem@debian.org>
* Cleaned new kernel build system.
* Indentation fixes. Normalized ChangeLog date format.
2004-02-13 Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>
* Use kernel build system.
* Use new pci probe present in 2.6.x kernels.
* Use module auto-loading.
2004-01-22 Guillem Jover <guillem@debian.org>
* Ported to 2.6 kernels.
2002-05-05 Guillem Jover <guillem@hadrons.org>
* Re-included VOODOO pci id, accidentally removed in last patch,
thanks to Jan Kuipers to point this out.
2002-01-29 Guillem Jover <guillem@hadrons.org>
* Fixed bug when compiling for 2.4 kernels with modversions.
* Added devfs support.
* Added MODULE_* declarations.
* Cleaned detection code.
2000-02-04 Joseph Kain <joseph@3dfx.com>
* Updated Carlo Woord's email address.
1999-12-22 Joseph Kain <joseph@3dfx.com>
* Support for new VMA structure in Kernels 2.3.14 and higher.
This patch is based on Dieter Nuetzel's work.
1999-11-09 Joseph Kain <joseph@3dfx.com>
* Made cards static to remove conflict with hisax ISDN driver.
1998-10-30 Carlo Wood <carlo@alinoe.com>
* Re-included module versions (this source was based on the
source by Jon Taylor which was based on an older version
by Daryll Straus. I now included the later changes made
by Daryll in this source too).
* Use pci_find_device for 2.1/2.2 kernels instead of the old
pcibios_find_device. Idem pci_present().
1998-10-21 Carlo Wood <carlo@alinoe.com>
* Fixed compile bugs related to 2.0 kernels.
1998-10-21 Carlo Wood <carlo@alinoe.com>
* `struct file_operations' was changed as of kernel 2.1.118,
fixed this module to also work with versions > 2.1.117.
* Machines that don't have mtrr still need <asm/uaccess.h>.
1998-10-20 Carlo Wood <carlo@alinoe.com>
* Finally fixed in init_module() the right way. This time I tested
it too (it now really works).
* Added resetmtrr_3dfx() to clean up the MTRR settings when the
module is unloaded. This is not really necessary but its clean.
It allows to compare using this device WITH MTRR with another
method WITHOUT MTRR, without being confused by sticky MTRR settings
for instance.
1998-10-18 Carlo Wood <carlo@alinoe.com>
* Forgot the '== -EBUSY' in init_module(), causing the registration
of character device to always fail. You need to reboot if you
tried the previous version (if there is junk in `cat /proc/devices'
major 107).
1998-10-18 Carlo Wood <carlo@alinoe.com>
* struct file_operations fops_3dfx was initialized wrong:
`release_3dfx' was put on the place of `fsync', causing weird
behaviour :).
* Several warning fixes.
* setmtrr_3dfx did not always return a value, and the value was
ignored, effectively ignoring errors returned by mtrr_add().

View File

@@ -1,4 +1,4 @@
Summary: Device driver for 3Dfx boards for 2.x kernels
Summary: Device driver for 3Dfx boards for Linux kernels
Name: Device3Dfx
Version: 2.3
Release: 5
@@ -121,9 +121,9 @@ Group: Drivers
%description
This package installs the 3Dfx device driver to allow access to 3Dfx
boards without the user having root privledges. It should work on both
2.0 and 2.1/2.2 kernels and set the MTRR settings correctly. It should
also work with SMP kernels (2.1/2.2).
boards without the user having root privledges. It should work on >= 2.x
kernels and set the MTRR settings correctly. It should also work with
SMP kernels (>= 2.1).
%prep
%setup -c

View File

@@ -1,127 +1,155 @@
###############################################################################
# Makefile by Carlo Wood (and others)
ifeq ($(OPT_CFLAGS),)
# Determine the machine type
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
# Setup machine dependant compiler flags
ifeq ($(ARCH), i386)
OPT_CFLAGS = -O2 -m486 -fomit-frame-pointer \
-fno-strength-reduce \
-malign-loops=2 -malign-jumps=2 -malign-functions=2
CFLAGS ?= -O2 -march=pentium -fomit-frame-pointer -fno-strength-reduce \
-falign-loops=2 -falign-jumps=2 -falign-functions=2
endif
ifeq ($(ARCH), alpha)
OPT_CFLAGS = -O2 -mno-fp-regs -mcpu=ev4 \
-ffixed-8 \
-Wa,-mev6 \
-fomit-frame-pointer -fno-strict-aliasing
CFLAGS ?= -O2 -mno-fp-regs -mcpu=ev4 -ffixed-8 -Wa,-mev6 \
-fomit-frame-pointer -fno-strict-aliasing
endif
endif # ifeq ($OPT_CFLAGS),)
KSRC ?= /usr/src/linux
KHEADERS ?= $(KSRC)/include
CFLAGS := -DMODULE -D__KERNEL__ -I/usr/src/linux/include $(OPT_CFLAGS)
-include kver.mak
MODULES_DIR = $(DESTDIR)/lib/modules/$(KVERS)
ALL_CFLAGS := -DMODULE -D__KERNEL__ \
-I$(KHEADERS) -I$(KHEADERS)/asm/mach-default \
$(CFLAGS)
ifneq ($(wildcard $(KHEADERS)/generated/utsrelease.h),)
VERSION_HEADER := $(KHEADERS)/generated/utsrelease.h
else
ifneq ($(wildcard $(KHEADERS)/linux/utsrelease.h),)
VERSION_HEADER := $(KHEADERS)/linux/utsrelease.h
else
VERSION_HEADER := $(KHEADERS)/linux/version.h
endif
endif
###############################################################################
# You should never need to change anything below.
all: sanity 3dfx.o
NAME := 3dfx
all: modules
kver: kver.c
$(CC) -include $(VERSION_HEADER) -x c -o $@ $<
kver.mak: kver
./$^ > $@
# Sanity checks
sanity:
@( \
if [ ! -e /usr/src/linux ]; then \
echo "Expect kernel source at location /usr/src/linux"; \
echo "Sym.link /usr/src/linux -> where you have your sources"; \
exit -1; \
if [ ! -r $(KHEADERS)/linux ]; then \
echo "Expect readable headers in $(KHEADERS)/linux"; \
exit 1; \
fi; \
if [ ! -r /usr/src/linux/include ]; then \
echo "Expect readable headers in /usr/src/linux/include"; \
exit -1; \
fi; \
if [ ! -r /usr/src/linux/include/linux/version.h ]; then \
echo "Missing /usr/src/linux/include/linux/version.h"; \
if [ ! -r $(KHEADERS)/linux/version.h ]; then \
echo "Missing $(KHEADERS)/linux/version.h"; \
echo "Configure and install the kernel first"; \
exit -1; \
exit 1; \
fi; \
if [ ! -e /proc/cpuinfo ]; then \
echo "You need the /proc file system"; \
echo "Reconfigure kernel and say Yes to CONFIG_PROC_FS"; \
exit -1; \
exit 1; \
fi; \
)
kinfo: kinfo.c
$(CC) -o kinfo kinfo.c
KVER_MAJOR = $(shell echo "$(KVERS)" | cut -d. -f1 )
KVER_MINOR = $(shell echo "$(KVERS)" | cut -d. -f2 )
kinfo.h: kinfo
./kinfo
KBUILD = $(shell [ "$(KVER_MAJOR)" = 2 ] && [ "$(KVER_MINOR)" -ge 6 ] || \
[ "$(KVER_MAJOR)" -ge 3 ] && echo yes )
ifneq ($(KERNEL_VERSION_MAJOR),2.0)
###############################################################################
# kernel 2.1+
3dfx.o: kinfo.h 3dfx_driver.c Makefile
$(CC) $(CFLAGS) -c -o $@ 3dfx_driver.c
help:
@echo KVER_MAJOR = $(KVER_MAJOR)
@echo KVER_MINOR = $(KVER_MINOR)
@echo KBUILD = $(KBUILD)
ifeq ($(KBUILD),yes)
BUILD_TYPE = kbuild
MODULE_TDFX = kbuild/$(NAME).ko
else
###############################################################################
# Kernel 2.0
OBJS = 3dfx_driver.o
ifneq ($(HAVE_MTRR),)
OBJS += mtrrs.o
BUILD_TYPE = legacy
MODULE_TDFX = $(NAME).o
endif
3dfx.o: kinfo.h $(OBJS) Makefile
$(LD) -r -o $@ $(OBJS)
endif
clean_type = clean_$(BUILD_TYPE)
module_type = module_$(BUILD_TYPE)
###############################################################################
install:
mkdir -p /lib/modules/$(shell ./kinfo --UTS)/misc
cp 3dfx.o /lib/modules/$(shell ./kinfo --UTS)/misc/3dfx.o
modules: sanity $(module_type)
module_legacy: $(NAME).o
$(NAME).o: 3dfx_driver.c Makefile
$(CC) $(ALL_CFLAGS) -c -o $@ 3dfx_driver.c
module_kbuild:
$(MAKE) -C kbuild
###############################################################################
install: sanity install_modules
@( \
if [ -e /lib/modules/$(shell ./kinfo --UTS)/modules.dep ]; then \
indep=`grep 'misc/3dfx.o:' /lib/modules/$(shell ./kinfo --UTS)/modules.dep`; \
if [ -e $(MODULES_DIR)/modules.dep ]; then \
indep=`grep '$(NAME)/$(MODULE_TDFX):' $(MODULES_DIR)/modules.dep`; \
if [ -z "$$indep" ]; then \
echo "/lib/modules/$(shell ./kinfo --UTS)/misc/3dfx.o:" >> /lib/modules/$(shell ./kinfo --UTS)/modules.dep; \
echo "" >> /lib/modules/$(shell ./kinfo --UTS)/modules.dep; \
echo "$(MODULES_DIR)/$(NAME)/$(MODULE_TDFX):" >> $(MODULES_DIR)/modules.dep; \
echo "" >> $(MODULES_DIR)/modules.dep; \
fi; \
fi; \
if [ ! -c /dev/3dfx ]; then \
mknod /dev/3dfx c 107 0; \
chmod go+w /dev/3dfx; \
if [ ! -e $(DESTDIR)/dev/.devfsd -a ! -c $(DESTDIR)/dev/$(NAME) ]; then \
mknod $(DESTDIR)/dev/$(NAME) c 107 0; \
chmod go+w $(DESTDIR)/dev/$(NAME); \
fi; \
if [ "$(RPM_INSTALL)" = "1" ]; then \
echo "/lib/modules/$(shell ./kinfo --UTS)/misc/3dfx.o"; \
echo "$(MODULES_DIR)/$(NAME)/$(MODULE_TDFX)"; \
else \
inconf=`grep 'alias char-major-107 3dfx' /etc/conf.modules`; \
inconf=`grep 'alias char-major-107 $(NAME)' $(DESTDIR)/etc/modules.conf`; \
if [ -z "$$inconf" ]; then \
echo "alias char-major-107 3dfx" >> /etc/conf.modules; \
echo "alias char-major-107 $(NAME)" >> $(DESTDIR)/etc/modules.conf; \
fi; \
fi; \
)
install_modules: modules
mkdir -p $(MODULES_DIR)/$(NAME)
cp $(MODULE_TDFX) $(MODULES_DIR)/$(NAME)/
###############################################################################
# This is for debugging purposes by the developers:
clean:
rm -f *.o *.s kinfo kinfo.h
clean: $(clean_type)
rm -f kver.mak kver
3dfx.s: 3dfx_driver.c Makefile
$(CC) $(CFLAGS) -S -c 3dfx_driver.c
clean_legacy:
rm -f *.ko *.o *.mod.* .*.mod.* .*.cmd
clean_kbuild:
$(MAKE) -C kbuild clean
tar:
tar czf ../../SOURCES/Dev3Dfx-2.5.tar.gz 3dfx_driver.c mtrrs.c Makefile
tar czf ../../SOURCES/Dev3Dfx-2.5.tar.gz 3dfx_driver.c Makefile
debug:
make OPT_CFLAGS="-g -Wall -Wstrict-prototypes -DDEBUG"
$(MAKE) CFLAGS="-g -Wall -Wstrict-prototypes -DDEBUG"
.PHONY: all sanity modules modules_legacy modules_kbuild
.PHONY: install install_legacy install_kbuild
.PHONY: clean clean_legacy clean_kbuild tar debug

20
Device3Dfx/README Normal file
View File

@@ -0,0 +1,20 @@
Build instructions
------------------
The new build system supports Linux kernel legacy build systems
as used on 2.4.x or earlier and the new kbuild system used on 2.6
and up.
Current make targets are:
modules
clean
install
If your kernel source is in some place different than /usr/src/linux
specify the KSRC variable, like:
$ make KSRC=~/src/linux
If you want to install in a different base dir specify DESTDIR.

View File

@@ -0,0 +1,5 @@
device3dfx (2.3-1) unstable; urgency=low
* Initial package.
-- RetroDebian <root@retrodebian.local> Thu, 20 Mar 2026 10:00:00 +0000

1
Device3Dfx/debian/compat Normal file
View File

@@ -0,0 +1 @@
5

View File

@@ -0,0 +1,14 @@
Source: device3dfx
Section: misc
Priority: optional
Maintainer: RetroDebian <root@retrodebian.local>
Standards-Version: 3.7.3
Package: device3dfx-modules-_KVERS_
Architecture: any
Provides: device3dfx-modules
Depends: linux-modules-_KVERS_ | linux-image-_KVERS_
Description: Device3Dfx kernel module for Debian Linux kernels
External kernel module providing /dev/3dfx support for 3dfx hardware.
.
This package contains the compiled kernel module for _KVERS_.

37
Device3Dfx/debian/rules Executable file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
PACKAGE=device3dfx-modules
MA_DIR ?= /usr/share/modass
-include $(MA_DIR)/include/generic.make
-include $(MA_DIR)/include/common-rules.make
kdist_config: prep-deb-files
ln -sf ../3dfx_driver.c kbuild/3dfx.c
kdist_clean:
rm -f kbuild/3dfx.c
$(MAKE) -C $(KSRC) M=$(PWD)/kbuild clean
binary-modules:
dh_testroot
dh_clean -k
dh_installdirs
ln -sf ../3dfx_driver.c kbuild/3dfx.c
$(MAKE) -C $(KSRC) M=$(PWD)/kbuild modules
mkdir -p debian/$(PACKAGE)-$(KVERS)/lib/modules/$(KVERS)/extra
cp kbuild/3dfx.ko debian/$(PACKAGE)-$(KVERS)/lib/modules/$(KVERS)/extra/
dh_installdocs
dh_installchangelogs
dh_installmodules
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol -- -v$(VERSION)
dh_md5sums
dh_builddeb --destdir=$(DEB_DESTDIR)
dh_clean -k

View File

@@ -0,0 +1,16 @@
KSRC ?= /usr/src/linux
obj-m += 3dfx.o
modules:
ln -sf ../3dfx_driver.c 3dfx.c
$(MAKE) -C $(KSRC) M=$(shell pwd) modules
clean:
rm -f 3dfx.c
$(MAKE) -C $(KSRC) M=$(shell pwd) clean
install: modules
$(MAKE) -C $(KSRC) M=$(shell pwd) INSTALL_MOD_PATH="$(DESTDIR)" \
modules_install

View File

@@ -1,67 +0,0 @@
/*
kinfo.c: A small program that includes several kernel heades
and builds a header defining options for 3dfx_driver.c.
1999/12/22 Joseph Kain <joseph@3dfx.com>
* Initial version
*/
#include <stdio.h>
/* These include files will bring in the information we need */
#include <linux/autoconf.h>
#include <linux/version.h>
int
main (int argc, char **argv)
{
/* Here is the strategy. The old Makefile would have grepped the kernel
* headers and put these defines on the command line. Now we include
* the kernel headers and extract the information. Then we create a
* new header with all of the options we need. */
if (argc == 1)
{
FILE *f = fopen ("kinfo.h", "w");
FILE *p = NULL;
int result;
char temp[1000];
#ifdef CONFIG_MTRR
/* It is not enough to just check if the kernel supports MTRRs, if the
* processor doesn't have MTRRs then its possible (and likely) that
* the kernel was still compiled with MTRR support. So we also have to
* check the processor has MTRRs. */
result = system ("grep mtrr /proc/cpuinfo > /dev/null");
/* See if grep found anything */
if (result == 0) /* Grep reported a match */
{
fprintf (f, "#define HAVE_MTRR\n");
}
#endif
#ifdef CONFIG_SMP
fprintf (f, "#define __SMP__\n");
#endif
#ifdef CONFIG_MODVERSIONS
fprintf (f, "#define MODVERSIONS\n");
#endif
fclose (f);
}
else
{
if (strcmp (argv[1], "--UTS") == 0)
{
printf ("%s", UTS_RELEASE);
}
}
}

8
Device3Dfx/kver.c Normal file
View File

@@ -0,0 +1,8 @@
#include <stdio.h>
int main()
{
printf("KVERS = %s\n", UTS_RELEASE);
return 0;
}

View File

@@ -1,935 +0,0 @@
/* Generic MTRR (Memory Type Range Register) driver.
Copyright (C) 1997-1998 Richard Gooch
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Richard Gooch may be reached by email at rgooch@atnf.csiro.au
The postal address is:
Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia.
Source: "Pentium Pro Family Developer's Manual, Volume 3:
Operating System Writer's Guide" (Intel document number 242692),
section 11.11.7
ChangeLog
Prehistory Martin Tischhäuser <martin@ikcbarka.fzk.de>
Initial register-setting code (from proform-1.0).
19971216 Richard Gooch <rgooch@atnf.csiro.au>
Original version for /proc/mtrr interface, SMP-safe.
v1.0
19971217 Richard Gooch <rgooch@atnf.csiro.au>
Bug fix for ioctls()'s.
Added sample code in Documentation/mtrr.txt
v1.1
19971218 Richard Gooch <rgooch@atnf.csiro.au>
Disallow overlapping regions.
19971219 Jens Maurer <jmaurer@menuett.rhein-main.de>
Register-setting fixups.
v1.2
19971222 Richard Gooch <rgooch@atnf.csiro.au>
Fixups for kernel 2.1.75.
v1.3
19971229 David Wragg <dpw@doc.ic.ac.uk>
Register-setting fixups and conformity with Intel conventions.
19971229 Richard Gooch <rgooch@atnf.csiro.au>
Cosmetic changes and wrote this ChangeLog ;-)
19980106 Richard Gooch <rgooch@atnf.csiro.au>
Fixups for kernel 2.1.78.
v1.4
19980119 David Wragg <dpw@doc.ic.ac.uk>
Included passive-release enable code (elsewhere in PCI setup).
v1.5
19980131 Richard Gooch <rgooch@atnf.csiro.au>
Replaced global kernel lock with private spinlock.
v1.6
19980201 Richard Gooch <rgooch@atnf.csiro.au>
Added wait for other CPUs to complete changes.
v1.7
19980202 Richard Gooch <rgooch@atnf.csiro.au>
Bug fix in definition of <set_mtrr> for UP.
v1.8
19980319 Richard Gooch <rgooch@atnf.csiro.au>
Fixups for kernel 2.1.90.
19980323 Richard Gooch <rgooch@atnf.csiro.au>
Move SMP BIOS fixup before secondary CPUs call <calibrate_delay>
v1.9
19980325 Richard Gooch <rgooch@atnf.csiro.au>
Fixed test for overlapping regions: confused by adjacent regions
19980326 Richard Gooch <rgooch@atnf.csiro.au>
Added wbinvd in <set_mtrr_prepare>.
19980401 Richard Gooch <rgooch@atnf.csiro.au>
Bug fix for non-SMP compilation.
19980418 David Wragg <dpw@doc.ic.ac.uk>
Fixed-MTRR synchronisation for SMP and use atomic operations
instead of spinlocks.
19980418 Richard Gooch <rgooch@atnf.csiro.au>
Differentiate different MTRR register classes for BIOS fixup.
v1.10
19980419 David Wragg <dpw@doc.ic.ac.uk>
Bug fix in variable MTRR synchronisation.
v1.11
19980419 Richard Gooch <rgooch@atnf.csiro.au>
Fixups for kernel 2.1.97.
v1.12
19980421 Richard Gooch <rgooch@atnf.csiro.au>
Safer synchronisation across CPUs when changing MTRRs.
v1.13
19980423 Richard Gooch <rgooch@atnf.csiro.au>
Bugfix for SMP systems without MTRR support.
v1.14
19980427 Richard Gooch <rgooch@atnf.csiro.au>
Trap calls to <mtrr_add> and <mtrr_del> on non-MTRR machines.
v1.15
19980427 Richard Gooch <rgooch@atnf.csiro.au>
Use atomic bitops for setting SMP change mask.
v1.16
19980428 Richard Gooch <rgooch@atnf.csiro.au>
Removed spurious diagnostic message.
v1.17
19980429 Richard Gooch <rgooch@atnf.csiro.au>
Moved register-setting macros into this file.
Moved setup code from init/main.c to i386-specific areas.
v1.18
19980502 Richard Gooch <rgooch@atnf.csiro.au>
Moved MTRR detection outside conditionals in <mtrr_init>.
v1.19
19980502 Richard Gooch <rgooch@atnf.csiro.au>
Documentation improvement: mention Pentium II and AGP.
v1.20
19980521 Richard Gooch <rgooch@atnf.csiro.au>
Only manipulate interrupt enable flag on local CPU.
Allow enclosed uncachable regions.
v1.21
v1.21-- Emil Briggs <briggs@tick.physics.ncsu.edu>
Backported to 2.0.x kernels, /proc and ioctl
interfaces removed and the result incorporated
into the 3dfx device driver. Not SMP safe. If
you have an SMP use the 2.2 series kernels.
v1.22
19991222 Joseph Kain <joseph@3dfx.com>
Do kernel version checks here instead of in
Makefile. The Makefile now only needs the
kernel version for install.
*/
/* Include this first as it defines things that affect the kernel headers */
#include "kinfo.h"
/* MTRR support is only available in kerenls versioned 2.1.0 or higher.
* For earlier kernels this code compiles to nothing. */
#include <linux/version.h>
#ifndef KERNEL_VERSION
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 1, 0)
#ifndef _LINUX_MTRR_H
#define _LINUX_MTRR_H
struct mtrr_sentry
{
unsigned long base; /* Base address */
unsigned long size; /* Size of region */
unsigned int type; /* Type of region */
};
struct mtrr_gentry
{
unsigned int regnum; /* Register number */
unsigned long base; /* Base address */
unsigned long size; /* Size of region */
unsigned int type; /* Type of region */
};
/* These are the region types */
#define MTRR_TYPE_UNCACHABLE 0
#define MTRR_TYPE_WRCOMB 1
/*#define MTRR_TYPE_ 2*/
/*#define MTRR_TYPE_ 3*/
#define MTRR_TYPE_WRTHROUGH 4
#define MTRR_TYPE_WRPROT 5
#define MTRR_TYPE_WRBACK 6
#define MTRR_NUM_TYPES 7
static char *mtrr_strings[MTRR_NUM_TYPES] =
{
"uncachable", /* 0 */
"write-combining", /* 1 */
"?", /* 2 */
"?", /* 3 */
"write-through", /* 4 */
"write-protect", /* 5 */
"write-back", /* 6 */
};
#ifdef __KERNEL__
/* The following functions are for use by other drivers */
extern int mtrr_add (unsigned long base, unsigned long size,
unsigned int type, char increment);
extern int mtrr_del (int reg, unsigned long base, unsigned long size);
#endif
#endif /* _LINUX_MTRR_H */
#ifdef MODULE
#include <linux/autoconf.h>
#if defined(CONFIG_MODVERSIONS) && !defined(MODVERSIONS)
#define MODVERSIONS
#endif
#ifdef MODVERSIONS
#include <linux/modversions.h>
#endif
#endif
#include <linux/sched.h>
#include <linux/tty.h>
#include <linux/timer.h>
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/wait.h>
#include <linux/string.h>
#include <linux/malloc.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/fs.h>
#include <linux/ctype.h>
#include <linux/proc_fs.h>
#define MTRR_NEED_STRINGS
#include <asm/io.h>
#include <asm/processor.h>
#include <asm/system.h>
#include <asm/pgtable.h>
#include <asm/segment.h>
#include <asm/bitops.h>
#include <asm/smp_lock.h>
#include <asm/atomic.h>
#include <linux/smp.h>
#undef __SMP__
#define MTRR_VERSION "1.21 (19980521)"
#define TRUE 1
#define FALSE 0
#define X86_FEATURE_MTRR 0x1000 /* memory type registers */
#define MTRRcap_MSR 0x0fe
#define MTRRdefType_MSR 0x2ff
#define MTRRphysBase_MSR(reg) (0x200 + 2 * (reg))
#define MTRRphysMask_MSR(reg) (0x200 + 2 * (reg) + 1)
#define NUM_FIXED_RANGES 88
#define MTRRfix64K_00000_MSR 0x250
#define MTRRfix16K_80000_MSR 0x258
#define MTRRfix16K_A0000_MSR 0x259
#define MTRRfix4K_C0000_MSR 0x268
#define MTRRfix4K_C8000_MSR 0x269
#define MTRRfix4K_D0000_MSR 0x26a
#define MTRRfix4K_D8000_MSR 0x26b
#define MTRRfix4K_E0000_MSR 0x26c
#define MTRRfix4K_E8000_MSR 0x26d
#define MTRRfix4K_F0000_MSR 0x26e
#define MTRRfix4K_F8000_MSR 0x26f
#ifdef __SMP__
# define MTRR_CHANGE_MASK_FIXED 0x01
# define MTRR_CHANGE_MASK_VARIABLE 0x02
# define MTRR_CHANGE_MASK_DEFTYPE 0x04
#endif
/* In the processor's MTRR interface, the MTRR type is always held in
an 8 bit field: */
typedef u8 mtrr_type;
#define LINE_SIZE 80
#define JIFFIE_TIMEOUT 100
#define set_mtrr(reg,base,size,type) set_mtrr_up (reg, base, size, type,TRUE)
static unsigned int *usage_table = NULL;
struct set_mtrr_context
{
unsigned long flags;
unsigned long deftype_lo;
unsigned long deftype_hi;
unsigned long cr4val;
};
/*
* Access to machine-specific registers (available on 586 and better only)
* Note: the rd* operations modify the parameters directly (without using
* pointer indirection), this allows gcc to optimize better
*/
#define rdmsr(msr,val1,val2) \
__asm__ __volatile__("rdmsr" \
: "=a" (val1), "=d" (val2) \
: "c" (msr))
#define wrmsr(msr,val1,val2) \
__asm__ __volatile__("wrmsr" \
: /* no outputs */ \
: "c" (msr), "a" (val1), "d" (val2))
#define rdtsc(low,high) \
__asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high))
#define rdpmc(counter,low,high) \
__asm__ __volatile__("rdpmc" \
: "=a" (low), "=d" (high) \
: "c" (counter))
/* Put the processor into a state where MTRRs can be safely set. */
static void set_mtrr_prepare(struct set_mtrr_context *ctxt)
{
unsigned long tmp;
/* disable interrupts locally */
save_flags (ctxt->flags); cli ();
/* save value of CR4 and clear Page Global Enable (bit 7) */
asm volatile ("movl %%cr4, %0\n\t"
"movl %0, %1\n\t"
"andb $0x7f, %b1\n\t"
"movl %1, %%cr4\n\t"
: "=r" (ctxt->cr4val), "=q" (tmp) : : "memory");
/* disable and flush caches. Note that wbinvd flushes the TLBs as
a side-effect. */
asm volatile ("movl %%cr0, %0\n\t"
"orl $0x40000000, %0\n\t"
"wbinvd\n\t"
"movl %0, %%cr0\n\t"
"wbinvd\n\t"
: "=r" (tmp) : : "memory");
/* disable MTRRs, and set the default type to uncached. */
rdmsr(MTRRdefType_MSR, ctxt->deftype_lo, ctxt->deftype_hi);
wrmsr(MTRRdefType_MSR, ctxt->deftype_lo & 0xf300UL, ctxt->deftype_hi);
} /* End Function set_mtrr_prepare */
/* Restore the processor after a set_mtrr_prepare */
static void set_mtrr_done(struct set_mtrr_context *ctxt)
{
unsigned long tmp;
/* flush caches and TLBs */
asm volatile ("wbinvd" : : : "memory" );
/* restore MTRRdefType */
wrmsr(MTRRdefType_MSR, ctxt->deftype_lo, ctxt->deftype_hi);
/* enable caches */
asm volatile ("movl %%cr0, %0\n\t"
"andl $0xbfffffff, %0\n\t"
"movl %0, %%cr0\n\t"
: "=r" (tmp) : : "memory");
/* restore value of CR4 */
asm volatile ("movl %0, %%cr4"
: : "r" (ctxt->cr4val) : "memory");
/* re-enable interrupts locally (if enabled previously) */
restore_flags (ctxt->flags);
} /* End Function set_mtrr_done */
/* this function returns the number of variable MTRRs */
static unsigned int get_num_var_ranges (void)
{
unsigned long config, dummy;
rdmsr(MTRRcap_MSR, config, dummy);
return (config & 0xff);
} /* End Function get_num_var_ranges */
/* non-zero if we have the write-combining memory type. */
static int have_wrcomb (void)
{
unsigned long config, dummy;
rdmsr(MTRRcap_MSR, config, dummy);
return (config & (1<<10));
}
static void get_mtrr (unsigned int reg, unsigned long *base,
unsigned long *size, mtrr_type *type)
{
unsigned long dummy, mask_lo, base_lo;
rdmsr(MTRRphysMask_MSR(reg), mask_lo, dummy);
if ((mask_lo & 0x800) == 0) {
/* Invalid (i.e. free) range. */
*base = 0;
*size = 0;
*type = 0;
return;
}
rdmsr(MTRRphysBase_MSR(reg), base_lo, dummy);
/* We ignore the extra address bits (32-35). If someone wants to
run x86 Linux on a machine with >4GB memory, this will be the
least of their problems. */
/* Clean up mask_lo so it gives the real address mask. */
mask_lo = (mask_lo & 0xfffff000UL);
/* This works correctly if size is a power of two, i.e. a
contiguous range. */
*size = ~(mask_lo - 1);
*base = (base_lo & 0xfffff000UL);
*type = (base_lo & 0xff);
} /* End Function get_mtrr */
static void set_mtrr_up (unsigned int reg, unsigned long base,
unsigned long size, mtrr_type type, int do_safe)
/* [SUMMARY] Set variable MTRR register on the local CPU.
<reg> The register to set.
<base> The base address of the region.
<size> The size of the region. If this is 0 the region is disabled.
<type> The type of the region.
<do_safe> If TRUE, do the change safely. If FALSE, safety measures should
be done externally.
*/
{
struct set_mtrr_context ctxt;
if (do_safe) set_mtrr_prepare (&ctxt);
if (size == 0)
{
/* The invalid bit is kept in the mask, so we simply clear the
relevant mask register to disable a range. */
wrmsr (MTRRphysMask_MSR (reg), 0, 0);
}
else
{
wrmsr (MTRRphysBase_MSR (reg), base | type, 0);
wrmsr (MTRRphysMask_MSR (reg), ~(size - 1) | 0x800, 0);
}
if (do_safe) set_mtrr_done (&ctxt);
} /* End Function set_mtrr_up */
#ifdef __SMP__
struct mtrr_var_range
{
unsigned long base_lo;
unsigned long base_hi;
unsigned long mask_lo;
unsigned long mask_hi;
};
/* Get the MSR pair relating to a var range. */
static void get_mtrr_var_range (unsigned int index,
struct mtrr_var_range *vr)
{
rdmsr (MTRRphysBase_MSR (index), vr->base_lo, vr->base_hi);
rdmsr (MTRRphysMask_MSR (index), vr->mask_lo, vr->mask_hi);
} /* End Function get_mtrr_var_range */
/* Set the MSR pair relating to a var range. Returns TRUE if
changes are made. */
static int set_mtrr_var_range_testing (unsigned int index,
struct mtrr_var_range *vr)
{
unsigned int lo, hi;
int changed = FALSE;
rdmsr(MTRRphysBase_MSR(index), lo, hi);
if ((vr->base_lo & 0xfffff0ffUL) != (lo & 0xfffff0ffUL)
|| (vr->base_hi & 0xfUL) != (hi & 0xfUL)) {
wrmsr(MTRRphysBase_MSR(index), vr->base_lo, vr->base_hi);
changed = TRUE;
}
rdmsr(MTRRphysMask_MSR(index), lo, hi);
if ((vr->mask_lo & 0xfffff800UL) != (lo & 0xfffff800UL)
|| (vr->mask_hi & 0xfUL) != (hi & 0xfUL)) {
wrmsr(MTRRphysMask_MSR(index), vr->mask_lo, vr->mask_hi);
changed = TRUE;
}
return changed;
}
static void get_fixed_ranges(mtrr_type *frs)
{
unsigned long *p = (unsigned long *)frs;
int i;
rdmsr(MTRRfix64K_00000_MSR, p[0], p[1]);
for (i = 0; i < 2; i++)
rdmsr(MTRRfix16K_80000_MSR + i, p[2 + i*2], p[3 + i*2]);
for (i = 0; i < 8; i++)
rdmsr(MTRRfix4K_C0000_MSR + i, p[6 + i*2], p[7 + i*2]);
}
static int set_fixed_ranges_testing(mtrr_type *frs)
{
unsigned long *p = (unsigned long *)frs;
int changed = FALSE;
int i;
unsigned long lo, hi;
rdmsr(MTRRfix64K_00000_MSR, lo, hi);
if (p[0] != lo || p[1] != hi) {
wrmsr(MTRRfix64K_00000_MSR, p[0], p[1]);
changed = TRUE;
}
for (i = 0; i < 2; i++) {
rdmsr(MTRRfix16K_80000_MSR + i, lo, hi);
if (p[2 + i*2] != lo || p[3 + i*2] != hi) {
wrmsr(MTRRfix16K_80000_MSR + i, p[2 + i*2], p[3 + i*2]);
changed = TRUE;
}
}
for (i = 0; i < 8; i++) {
rdmsr(MTRRfix4K_C0000_MSR + i, lo, hi);
if (p[6 + i*2] != lo || p[7 + i*2] != hi) {
wrmsr(MTRRfix4K_C0000_MSR + i, p[6 + i*2], p[7 + i*2]);
changed = TRUE;
}
}
return changed;
}
struct mtrr_state
{
unsigned int num_var_ranges;
struct mtrr_var_range *var_ranges;
mtrr_type fixed_ranges[NUM_FIXED_RANGES];
unsigned char enabled;
mtrr_type def_type;
};
/* Grab all of the MTRR state for this CPU into *state. */
static void get_mtrr_state(struct mtrr_state *state)
{
unsigned int nvrs, i;
struct mtrr_var_range *vrs;
unsigned long lo, dummy;
nvrs = state->num_var_ranges = get_num_var_ranges();
vrs = state->var_ranges
= kmalloc(nvrs * sizeof(struct mtrr_var_range), GFP_KERNEL);
if (vrs == NULL)
nvrs = state->num_var_ranges = 0;
for (i = 0; i < nvrs; i++)
get_mtrr_var_range(i, &vrs[i]);
get_fixed_ranges(state->fixed_ranges);
rdmsr(MTRRdefType_MSR, lo, dummy);
state->def_type = (lo & 0xff);
state->enabled = (lo & 0xc00) >> 10;
} /* End Function get_mtrr_state */
/* Free resources associated with a struct mtrr_state */
static void finalize_mtrr_state(struct mtrr_state *state)
{
if (state->var_ranges) kfree (state->var_ranges);
} /* End Function finalize_mtrr_state */
static unsigned long set_mtrr_state (struct mtrr_state *state,
struct set_mtrr_context *ctxt)
/* [SUMMARY] Set the MTRR state for this CPU.
<state> The MTRR state information to read.
<ctxt> Some relevant CPU context.
[NOTE] The CPU must already be in a safe state for MTRR changes.
[RETURNS] 0 if no changes made, else a mask indication what was changed.
*/
{
unsigned int i;
unsigned long change_mask = 0;
for (i = 0; i < state->num_var_ranges; i++)
if (set_mtrr_var_range_testing(i, &state->var_ranges[i]))
change_mask |= MTRR_CHANGE_MASK_VARIABLE;
if (set_fixed_ranges_testing(state->fixed_ranges))
change_mask |= MTRR_CHANGE_MASK_FIXED;
/* set_mtrr_restore restores the old value of MTRRdefType,
so to set it we fiddle with the saved value. */
if ((ctxt->deftype_lo & 0xff) != state->def_type
|| ((ctxt->deftype_lo & 0xc00) >> 10) != state->enabled)
{
ctxt->deftype_lo |= (state->def_type | state->enabled << 10);
change_mask |= MTRR_CHANGE_MASK_DEFTYPE;
}
return change_mask;
} /* End Function set_mtrr_state */
static atomic_t undone_count;
static void (*handler_func) (struct set_mtrr_context *ctxt, void *info);
static void *handler_info;
static volatile int wait_barrier_execute = FALSE;
static volatile int wait_barrier_cache_enable = FALSE;
static void sync_handler (void)
/* [SUMMARY] Synchronisation handler. Executed by "other" CPUs.
[RETURNS] Nothing.
*/
{
struct set_mtrr_context ctxt;
set_mtrr_prepare (&ctxt);
/* Notify master CPU that I'm at the barrier and then wait */
atomic_dec (&undone_count);
while (wait_barrier_execute) barrier ();
/* The master has cleared me to execute */
(*handler_func) (&ctxt, handler_info);
/* Notify master CPU that I've executed the function */
atomic_dec (&undone_count);
/* Wait for master to clear me to enable cache and return */
while (wait_barrier_cache_enable) barrier ();
set_mtrr_done (&ctxt);
} /* End Function sync_handler */
static void do_all_cpus (void (*handler) (struct set_mtrr_context *ctxt,
void *info),
void *info, int local)
/* [SUMMARY] Execute a function on all CPUs, with caches flushed and disabled.
[PURPOSE] This function will synchronise all CPUs, flush and disable caches
on all CPUs, then call a specified function. When the specified function
finishes on all CPUs, caches are enabled on all CPUs.
<handler> The function to execute.
<info> An arbitrary information pointer which is passed to <<handler>>.
<local> If TRUE <<handler>> is executed locally.
[RETURNS] Nothing.
*/
{
unsigned long timeout;
struct set_mtrr_context ctxt;
mtrr_hook = sync_handler;
handler_func = handler;
handler_info = info;
wait_barrier_execute = TRUE;
wait_barrier_cache_enable = TRUE;
/* Send a message to all other CPUs and wait for them to enter the
barrier */
atomic_set (&undone_count, smp_num_cpus - 1);
smp_message_pass (MSG_ALL_BUT_SELF, MSG_MTRR_CHANGE, 0, 0);
/* Wait for it to be done */
timeout = jiffies + JIFFIE_TIMEOUT;
while ( (atomic_read (&undone_count) > 0) && (jiffies < timeout) )
barrier ();
if (atomic_read (&undone_count) > 0)
{
panic ("mtrr: timed out waiting for other CPUs\n");
}
mtrr_hook = NULL;
/* All other CPUs should be waiting for the barrier, with their caches
already flushed and disabled. Prepare for function completion
notification */
atomic_set (&undone_count, smp_num_cpus - 1);
/* Flush and disable the local CPU's cache and release the barier, which
should cause the other CPUs to execute the function. Also execute it
locally if required */
set_mtrr_prepare (&ctxt);
wait_barrier_execute = FALSE;
if (local) (*handler) (&ctxt, info);
/* Now wait for other CPUs to complete the function */
while (atomic_read (&undone_count) > 0) barrier ();
/* Now all CPUs should have finished the function. Release the barrier to
allow them to re-enable their caches and return from their interrupt,
then enable the local cache and return */
wait_barrier_cache_enable = FALSE;
set_mtrr_done (&ctxt);
handler_func = NULL;
handler_info = NULL;
} /* End Function do_all_cpus */
struct set_mtrr_data
{
unsigned long smp_base;
unsigned long smp_size;
unsigned int smp_reg;
mtrr_type smp_type;
};
static void set_mtrr_handler (struct set_mtrr_context *ctxt, void *info)
{
struct set_mtrr_data *data = info;
set_mtrr_up (data->smp_reg, data->smp_base, data->smp_size, data->smp_type,
FALSE);
} /* End Function set_mtrr_handler */
/* A warning that is common to the module and non-module cases. */
/* Some BIOS's are fucked and don't set all MTRRs the same! */
#ifdef MODULE
static void mtrr_state_warn (unsigned long mask)
#else
static void mtrr_state_warn (unsigned long mask)
#endif
{
if (!mask) return;
if (mask & MTRR_CHANGE_MASK_FIXED)
printk ("mtrr: your CPUs had inconsistent fixed MTRR settings\n");
if (mask & MTRR_CHANGE_MASK_VARIABLE)
printk ("mtrr: your CPUs had inconsistent variable MTRR settings\n");
if (mask & MTRR_CHANGE_MASK_DEFTYPE)
printk ("mtrr: your CPUs had inconsistent MTRRdefType settings\n");
printk ("mtrr: probably your BIOS does not setup all CPUs\n");
} /* End Function mtrr_state_warn */
#ifdef MODULE
/* As a module, copy the MTRR state using an IPI handler. */
static volatile unsigned long smp_changes_mask = 0;
static void copy_mtrr_state_handler (struct set_mtrr_context *ctxt, void *info)
{
unsigned long mask, count;
struct mtrr_state *smp_mtrr_state = info;
mask = set_mtrr_state (smp_mtrr_state, ctxt);
/* Use the atomic bitops to update the global mask */
for (count = 0; count < sizeof mask * 8; ++count)
{
if (mask & 0x01) set_bit (count, &smp_changes_mask);
mask >>= 1;
}
} /* End Function copy_mtrr_state_handler */
/* Copies the entire MTRR state of this CPU to all the others. */
static void copy_mtrr_state (void)
{
struct mtrr_state ms;
get_mtrr_state (&ms);
do_all_cpus (copy_mtrr_state_handler, &ms, FALSE);
finalize_mtrr_state (&ms);
mtrr_state_warn (smp_changes_mask);
} /* End Function copy_mtrr_state */
#endif /* MODULE */
#endif /* __SMP__ */
static char *attrib_to_str (int x)
{
return (x <= 6) ? mtrr_strings[x] : "?";
} /* End Function attrib_to_str */
static void init_table (void)
{
int i, max;
max = get_num_var_ranges ();
if ( ( usage_table = kmalloc (max * sizeof *usage_table, GFP_KERNEL) )
== NULL )
{
printk ("mtrr: could not allocate\n");
return;
}
for (i = 0; i < max; i++) usage_table[i] = 1;
} /* End Function init_table */
int mtrr_add (unsigned long base, unsigned long size, unsigned int type,
char increment)
/* [SUMMARY] Add an MTRR entry.
<base> The starting (base) address of the region.
<size> The size (in bytes) of the region.
<type> The type of the new region.
<increment> If true and the region already exists, the usage count will be
incremented.
[RETURNS] The MTRR register on success, else a negative number indicating
the error code.
[NOTE] This routine uses a spinlock.
*/
{
int i, max;
mtrr_type ltype;
unsigned long lbase, lsize, last;
if (!usage_table) init_table();
if ( (base & 0xfff) || (size & 0xfff) )
{
printk ("mtrr: size and base must be multiples of 4kB\n");
printk ("mtrr: size: %lx base: %lx\n", size, base);
return -EINVAL;
}
if (base + size < 0x100000)
{
printk ("mtrr: cannot set region below 1 MByte (0x%lx,0x%lx)\n",
base, size);
return -EINVAL;
}
/* Check upper bits of base and last are equal and lower bits are 0 for
base and 1 for last */
last = base + size - 1;
for (lbase = base; !(lbase & 1) && (last & 1);
lbase = lbase >> 1, last = last >> 1);
if (lbase != last)
{
printk ("mtrr: base(0x%lx) is not aligned on a size(0x%lx) boundary\n",
base, size);
return -EINVAL;
}
if (type >= MTRR_NUM_TYPES)
{
printk ("mtrr: type: %u illegal\n", type);
return -EINVAL;
}
/* If the type is WC, check that this processor supports it */
if ( (type == MTRR_TYPE_WRCOMB) && !have_wrcomb () )
{
printk ("mtrr: your processor doesn't support write-combining\n");
return -ENOSYS;
}
increment = increment ? 1 : 0;
max = get_num_var_ranges ();
/* Search for existing MTRR */
for (i = 0; i < max; ++i)
{
get_mtrr (i, &lbase, &lsize, &ltype);
if (base >= lbase + lsize) continue;
if ( (base < lbase) && (base + size <= lbase) ) continue;
/* At this point we know there is some kind of overlap/enclosure */
if ( (base < lbase) || (base + size > lbase + lsize) )
{
printk ("mtrr: 0x%lx,0x%lx overlaps existing 0x%lx,0x%lx\n",
base, size, lbase, lsize);
return -EINVAL;
}
/* New region is enclosed by an existing region */
if (ltype != type)
{
if (type == MTRR_TYPE_UNCACHABLE) continue;
printk ( "mtrr: type mismatch for %lx,%lx old: %s new: %s\n",
base, size, attrib_to_str (ltype), attrib_to_str (type) );
return -EINVAL;
}
if (increment) ++usage_table[i];
return i;
}
/* Search for an empty MTRR */
for (i = 0; i < max; ++i)
{
get_mtrr (i, &lbase, &lsize, &ltype);
if (lsize > 0) continue;
set_mtrr (i, base, size, type);
usage_table[i] = 1;
return i;
}
printk ("mtrr: no more MTRRs available\n");
return -ENOSPC;
} /* End Function mtrr_add */
int mtrr_del (int reg, unsigned long base, unsigned long size)
/* [SUMMARY] Delete MTRR/decrement usage count.
<reg> The register. If this is less than 0 then <<base>> and <<size>> must
be supplied.
<base> The base address of the region. This is ignored if <<reg>> is >= 0.
<size> The size of the region. This is ignored if <<reg>> is >= 0.
[RETURNS] The register on success, else a negative number indicating
the error code.
[NOTE] This routine uses a spinlock.
*/
{
int i, max;
mtrr_type ltype;
unsigned long lbase, lsize;
if (!usage_table) init_table();
max = get_num_var_ranges ();
if (reg < 0)
{
/* Search for existing MTRR */
for (i = 0; i < max; ++i)
{
get_mtrr (i, &lbase, &lsize, &ltype);
if ( (lbase == base) && (lsize == size) )
{
reg = i;
break;
}
}
if (reg < 0)
{
printk ("mtrr: no MTRR for %lx,%lx found\n", base, size);
return -EINVAL;
}
}
if (reg >= max)
{
printk ("mtrr: register: %d too big\n", reg);
return -EINVAL;
}
get_mtrr (reg, &lbase, &lsize, &ltype);
if (lsize < 1)
{
printk ("mtrr: MTRR %d not used\n", reg);
return -EINVAL;
}
if (usage_table[reg] < 1)
{
printk ("mtrr: reg: %d has count=0\n", reg);
return -EINVAL;
}
if (--usage_table[reg] < 1) set_mtrr (reg, 0, 0, 0);
return reg;
} /* End Function mtrr_del */
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 1, 0) */

255
LICENSE Normal file
View File

@@ -0,0 +1,255 @@
3DFX GLIDE Source Code General Public License
1. PREAMBLE
This license is for software that provides a 3D graphics application
program interface (API).The license is intended to offer terms similar
to some standard General Public Licenses designed to foster open
standards and unrestricted accessibility to source code. Some of these
licenses require that, as a condition of the license of the software,
any derivative works (that is, new software which is a work containing
the original program or a portion of it) must be available for general
use, without restriction other than for a minor transfer fee, and that
the source code for such derivative works must likewise be made
available. The only restriction is that such derivative works must be
subject to the same General Public License terms as the original work.
This 3dfx GLIDE Source Code General Public License differs from the
standard licenses of this type in that it does not require the entire
derivative work to be made available under the terms of this license
nor is the recipient required to make available the source code for
the entire derivative work. Rather, the license is limited to only the
identifiable portion of the derivative work that is derived from the
licensed software. The precise terms and conditions for copying,
distribution and modification follow.
2. DEFINITIONS
2.1 This License applies to any program (or other "work") which
contains a notice placed by the copyright holder saying it may be
distributed under the terms of this 3dfx GLIDE Source Code General
Public License.
2.2 The term "Program" as used in this Agreement refers to 3DFX's
GLIDE source code and object code and any Derivative Work.
2.3 "Derivative Work" means, for the purpose of the License, that
portion of any work that contains the Program or the identifiable
portion of a work that is derived from the Program, either verbatim or
with modifications and/or translated into another language, and that
performs 3D graphics API operations. It does not include any other
portions of a work.
2.4 "Modifications of the Program" means any work, which includes a
Derivative Work, and includes the whole of such work.
2.5 "License" means this 3dfx GLIDE Source Code General Public License.
2.6 The "Source Code" for a work means the preferred form of the work
for making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, any
associated interface definition files, and the scripts used to control
compilation and installation of the executable work.
2.7 "3dfx" means 3dfx Interactive, Inc.
3. LICENSED ACTIVITIES
3.1 COPYING - You may copy and distribute verbatim copies of the
Program's Source Code as you receive it, in any medium, subject to the
provision of section 3.3 and provided also that:
(a) you conspicuously and appropriately publish on each copy
an appropriate copyright notice (3dfx Interactive, Inc. 1999), a notice
that recipients who wish to copy, distribute or modify the Program can
only do so subject to this License, and a disclaimer of warranty as
set forth in section 5;
(b) keep intact all the notices that refer to this License and
to the absence of any warranty; and
(c) do not make any use of the GLIDE trademark without the prior
written permission of 3dfx, and
(d) give all recipients of the Program a copy of this License
along with the Program or instructions on how to easily receive a copy
of this License.
3.2 MODIFICATION OF THE PROGRAM/DERIVATIVE WORKS - You may modify your
copy or copies of the Program or any portion of it, and copy and
distribute such modifications subject to the provisions of section 3.3
and provided that you also meet all of the following conditions:
(a) you conspicuously and appropriately publish on each copy
of a Derivative Work an appropriate copyright notice, a notice that
recipients who wish to copy, distribute or modify the Derivative Work
can only do so subject to this License, and a disclaimer of warranty
as set forth in section 5;
(b) keep intact all the notices that refer to this License and
to the absence of any warranty; and
(c) give all recipients of the Derivative Work a copy of this
License along with the Derivative Work or instructions on how to easily
receive a copy of this License.
(d) You must cause the modified files of the Derivative Work
to carry prominent notices stating that you changed the files and the
date of any change.
(e) You must cause any Derivative Work that you distribute or
publish to be licensed at no charge to all third parties under the
terms of this License.
(f) You do not make any use of the GLIDE trademark without the
prior written permission of 3dfx.
(g) If the Derivative Work normally reads commands
interactively when run, you must cause it, when started running for
such interactive use, to print or display an announcement as follows:
"COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED THIS
SOFTWARE IS FREE AND PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESSED OR IMPLIED. THERE IS NO RIGHT TO USE THE GLIDE
TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX INTERACTIVE,
INC. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A FULL TEXT OF THE
DISTRIBUTION AND NON-WARRANTY PROVISIONS (REQUEST COPY FROM
INFO@3DFX.COM)."
(h) The requirements of this section 3.2 do not apply to the
modified work as a whole but only to the Derivative Work. It is not
the intent of this License to claim rights or contest your rights to
work written entirely by you; rather, the intent is to exercise the
right to control the distribution of Derivative Works.
3.3 DISTRIBUTION
(a) All copies of the Program or Derivative Works which are
distributed must include in the file headers the following language
verbatim:
"THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED
ONLY PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO
RIGHT TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF
3DFX INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM
THE DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC (info@3dfx.com).
THIS PROGRAM. IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
FULL TEXT OF THE NON-WARRANTY PROVISIONS.
USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS
IN TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
THE UNITED STATES.
COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED"
(b) You may distribute the Program or a Derivative Work in
object code or executable form under the terms of Sections 3.1 and 3.2
provided that you also do one of the following:
(1) Accompany it with the complete corresponding
machine-readable source code, which must be distributed under the
terms of Sections 3.1 and 3.2; or,
(2) Accompany it with a written offer, valid for at
least three years, to give any third party, for a charge no more than
your cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 3.1 and 3.2 on a medium
customarily used for software interchange; or,
(3) Accompany it with the information you received as
to the offer to distribute corresponding source code. (This alternative
is allowed only for noncommercial distribution and only if you received
the program in object code or executable form with such an offer, in
accord with Subsection 3.3(b)(2) above.)
(c) The source code distributed need not include anything
that is normally distributed (in either source or binary form) with
the major components (compiler, kernel, and so on) of the operating
system on which the executable runs, unless that component itself
accompanies the executable code.
(d) If distribution of executable code or object code is made
by offering access to copy from a designated place, then offering
equivalent access to copy the source code from the same place counts
as distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
(e) Each time you redistribute the Program or any Derivative
Work, the recipient automatically receives a license from 3dfx and
successor licensors to copy, distribute or modify the Program and
Derivative Works subject to the terms and conditions of the License.
You may not impose any further restrictions on the recipients'
exercise of the rights granted herein. You are not responsible for
enforcing compliance by third parties to this License.
(f) You may not make any use of the GLIDE trademark without
the prior written permission of 3dfx.
(g) You may not copy, modify, sublicense, or distribute the
Program or any Derivative Works except as expressly provided under
this License. Any attempt otherwise to copy, modify, sublicense or
distribute the Program or any Derivative Works is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
4. MISCELLANEOUS
4.1 Acceptance of this License is voluntary. By using, modifying or
distributing the Program or any Derivative Work, you indicate your
acceptance of this License to do so, and all its terms and conditions
for copying, distributing or modifying the Program or works based on
it. Nothing else grants you permission to modify or distribute the
Program or Derivative Works and doing so without acceptance of this
License is in violation of the U.S. and international copyright laws.
4.2 If the distribution and/or use of the Program or Derivative Works
is restricted in certain countries either by patents or by copyrighted
interfaces, the original copyright holder who places the Program under
this License may add an explicit geographical distribution limitation
excluding those countries, so that distribution is permitted only in
or among countries not thus excluded. In such case, this License
incorporates the limitation as if written in the body of this License.
4.3 This License is to be construed according to the laws of the
State of California and you consent to personal jurisdiction in the
State of California in the event it is necessary to enforce the
provisions of this License.
5. NO WARRANTIES
5.1 TO THE EXTENT PERMITTED BY APPLICABLE LAW, THERE IS NO WARRANTY
FOR THE PROGRAM. OR DERIVATIVE WORKS THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE PROGRAM AND ANY DERIVATIVE WORKS"AS IS"
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY
AND PERFORMANCE OF THE PROGRAM AND ANY DERIVATIVE WORK IS WITH YOU.
SHOULD THE PROGRAM OR ANY DERIVATIVE WORK PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
5.2 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL 3DFX
INTERACTIVE, INC., OR ANY OTHER COPYRIGHT HOLDER, OR ANY OTHER PARTY
WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM OR DERIVATIVE WORKS AS
PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
INABILITY TO USE THE PROGRAM OR DERIVATIVE WORKS (INCLUDING BUT NOT
LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES
SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM OR
DERIVATIVE WORKS TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH
HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.

5
README Normal file
View File

@@ -0,0 +1,5 @@
This is the source code to 3Dfx Glide for Voodoo graphics accelerators.
It's forked from the original CVS repo of Glide open source project at
sourceforge: https://sourceforge.net/projects/glide/
Source is licensed under 3DFX GLIDE Source Code General Public License.

View File

@@ -17,7 +17,7 @@
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
!if "$(FX_GLIDE_HW)" == "SST96"
!if "$(FX_GLIDE_HW)" == "sst96"
GLIDE_SRC_BASE = sst1
!else
GLIDE_SRC_BASE = $(FX_GLIDE_HW)

View File

@@ -17,7 +17,7 @@
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
ifeq ($(FX_GLIDE_HW),SST96)
ifeq ($(FX_GLIDE_HW),sst96)
GLIDE_SRC_BASE = sst1
else
GLIDE_SRC_BASE = $(FX_GLIDE_HW)

View File

@@ -89,5 +89,5 @@ FX_EXPORT FxU32 FX_CSTYLE fxoemInitSetVideo(OemInitInfo *oem);
FX_EXPORT FxU32 FX_CSTYLE fxoemRestoreVideo(OemInitInfo *oem);
FX_EXPORT FxU32 FX_CSTYLE fxoemControl(FxU32 mode);
#endif __OEMINIT_H__
#endif /* __OEMINIT_H__ */

View File

@@ -0,0 +1,352 @@
# Win32 makefile for Glide2/CVG and Texus2
# This makefile MUST be processed by GNU make!!!
#
# Copyright (c) 2004
#
# Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# Hiroshi Morii
# Email : koolsmoky@users.sourceforge.net
# Web : http://www.3dfxzone.it/koolsmoky
#
#
# 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.
# default = no
# USE_X86=1 use assembler triangle specializations; req by CVG
# default = yes
# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU
# capabilities are still checked at run-time to avoid
# crashes.
# default = no
# USE_MMX=1 allow MMX specializations.
# default = no
# TEXUS2=1 embed Texus2 functions into Glide2.
# default = no
# FXOEM2X=1 build fxoem2x.dll
# default = no
#
# Targets:
# all: build everything
# glide2x: build Glide2x lib
# clean: remove object files
# realclean: remove all generated files
#
.PHONY: all glide2x clean realclean
.INTERMEDIATE: fxgasm.exe
.SUFFIXES: .c .obj .rc .res
###############################################################################
# general defines (user settable?)
###############################################################################
GLIDE_RES = glide.res
GLIDE_DLL = glide2x.dll
GLIDE_IMP = glide2x.lib
TEXUS_EXE = texus2.exe
FX_GLIDE_HW ?= cvg
FX_GLIDE_SW = ../../../swlibs
GLIDE_LIBDIR = ../../lib
TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin
###############################################################################
# tools
###############################################################################
CC = cl
AS = nasm
LD = link
RC = rc
ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
UNLINK = del $(subst /,\,$(1))
else
UNLINK = $(RM) $(1)
endif
###############################################################################
# defines
###############################################################################
# platform
CDEFS = -D__WIN32__ -DDIRECTX -DFX_DLL_ENABLE -D__3Dfx_PCI_CFG__
# general
CDEFS += -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKED_RGB=1 -DGLIDE_TRI_CULLING=1 -DGLIDE_DEFAULT_GAMMA=1.3f -DGLIDE_LIB=1
#CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE3_SCALER
# special sli buffer clears
CDEFS += -DGLIDE_BLIT_CLEAR=1
# workaround for CVGs with broken tsus which cannot send commands to multiple
# tmus using chipfield. chipfield will always be set to 0xf
CDEFS += -DGLIDE_CHIP_BROADCAST=1
# subsystem
CDEFS += -DCVG
# debug
ifdef DEBUG
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
endif
override USE_FIFO = 1
#override USE_X86 = 1
ifeq ($(USE_X86),1)
CDEFS += -DGLIDE_DISPATCH_SETUP=1 -DGLIDE_DISPATCH_DOWNLOAD=1
override USE_FIFO = 1
else
CDEFS += -DGLIDE_USE_C_TRISETUP=1
endif
# fifo
ifeq ($(USE_FIFO),1)
CDEFS += -DUSE_PACKET_FIFO=1 -DGLIDE_PACKET3_TRI_SETUP=1
endif
# other
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
ifeq ($(TEXUS2),1)
CDEFS += -DHAVE_TEXUS2
endif
###############################################################################
# flags
###############################################################################
# linker
LDFLAGS = -nologo -dll -opt:WIN98 -machine:IX86 -nodefaultlib
# assembler
ASFLAGS = -O6 -fwin32 -D__WIN32__ --prefix _
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -nologo -W3 -WX -D__MSC__=1
LDLIBS = user32.lib kernel32.lib advapi32.lib
ifdef DEBUG
CFLAGS += -Od -MTd -Zi
LDFLAGS += -debugtype:both -debug
LDLIBS += LIBCMTD.lib
else
CPU ?= 6
CFLAGS += -DNDEBUG -G$(CPU) -O2 -MT
LDLIBS += LIBCMT.lib
endif
CFLAGS += -I. -I../../incsrc -I../../init
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib
CFLAGS += $(CDEFS)
# cpu optimized triangle
ifeq ($(USE_MMX),1)
CFLAGS += -DGL_MMX
override USE_X86 = 1
endif
ifeq ($(USE_3DNOW),1)
CFLAGS += -DGL_AMD3D
override USE_X86 = 1
endif
###############################################################################
# objects
###############################################################################
GLIDE_OBJECTS = \
fifo.obj \
gsplash.obj \
g3df.obj \
gu.obj \
guclip.obj \
gpci.obj \
gump.obj \
diglide.obj \
disst.obj \
ditex.obj \
gbanner.obj \
gerror.obj \
gmovie.obj \
digutex.obj \
ddgump.obj \
gaa.obj \
gdraw.obj \
gglide.obj \
glfb.obj \
gsst.obj \
gtex.obj \
gtexdl.obj \
gutex.obj \
cpuid.obj \
fpu.obj \
xtexdl_def.obj
ifeq ($(USE_X86),1)
GLIDE_OBJECTS += \
xdraw2_def.obj
ifeq ($(USE_MMX),1)
GLIDE_OBJECTS += \
xtexdl_mmx.obj
endif
ifeq ($(USE_3DNOW),1)
GLIDE_OBJECTS += \
xdraw2_3dnow.obj \
xtexdl_3dnow.obj
endif
else
GLIDE_OBJECTS += \
gxdraw.obj
endif
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/fxmsr.obj \
../../init/canopus.obj \
../../init/dac.obj \
../../init/gamma.obj \
../../init/gdebug.obj \
../../init/info.obj \
../../init/parse.obj \
../../init/print.obj \
../../init/sli.obj \
../../init/sst1init.obj \
../../init/util.obj \
../../init/video.obj \
../../init/fxremap.obj
TEXUS_SOURCES = \
$(FX_GLIDE_SW)/texus2/lib/texuslib.c \
$(FX_GLIDE_SW)/texus2/lib/clamp.c \
$(FX_GLIDE_SW)/texus2/lib/read.c \
$(FX_GLIDE_SW)/texus2/lib/resample.c \
$(FX_GLIDE_SW)/texus2/lib/mipmap.c \
$(FX_GLIDE_SW)/texus2/lib/quantize.c \
$(FX_GLIDE_SW)/texus2/lib/ncc.c \
$(FX_GLIDE_SW)/texus2/lib/nccnnet.c \
$(FX_GLIDE_SW)/texus2/lib/pal256.c \
$(FX_GLIDE_SW)/texus2/lib/pal6666.c \
$(FX_GLIDE_SW)/texus2/lib/dequant.c \
$(FX_GLIDE_SW)/texus2/lib/view.c \
$(FX_GLIDE_SW)/texus2/lib/util.c \
$(FX_GLIDE_SW)/texus2/lib/diffuse.c \
$(FX_GLIDE_SW)/texus2/lib/write.c \
$(FX_GLIDE_SW)/texus2/lib/tga.c \
$(FX_GLIDE_SW)/texus2/lib/3df.c \
$(FX_GLIDE_SW)/texus2/lib/ppm.c \
$(FX_GLIDE_SW)/texus2/lib/rgt.c \
$(FX_GLIDE_SW)/texus2/lib/txs.c \
$(FX_GLIDE_SW)/texus2/lib/codec.c \
$(FX_GLIDE_SW)/texus2/lib/eigen.c \
$(FX_GLIDE_SW)/texus2/lib/bitcoder.c
ifeq ($(TEXUS2),1)
GLIDE_OBJECTS += $(TEXUS_SOURCES:.c=.obj)
endif
###############################################################################
# rules
###############################################################################
.c.obj:
$(CC) -Fo$@ $(CFLAGS) -c $<
.rc.res:
$(RC) -Fo$@ $(CDEFS) -I$(FX_GLIDE_SW)/fxmisc $<
###############################################################################
# main
###############################################################################
all: glide2x $(TEXUS_EXEDIR)/$(TEXUS_EXE) fxoem2x
glide2x: $(GLIDE_LIBDIR)/$(GLIDE_DLL)
$(GLIDE_LIBDIR)/$(GLIDE_DLL): $(GLIDE_OBJECTS) $(GLIDE_RES)
$(LD) -out:$@ $(LDFLAGS) $(GLIDE_OBJECTS) $(LDLIBS) $(GLIDE_RES)
$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_IMP)
#ifeq ($(TEXUS2),1)
# $(CC) -o $@ $(CFLAGS) $^
#else
# $(warning Texus2 not enabled... Skipping $(TEXUS_EXE))
#endif
fxoem2x: $(GLIDE_LIBDIR)/fxoem2x.dll
ifeq ($(FXOEM2X),1)
$(GLIDE_LIBDIR)/fxoem2x.dll: ../oem/oeminit.obj ../oem/oeminit.res
# $(LD) -out:$@ $(LDFLAGS) ../oem/oeminit.obj $(LDLIBS) ../oem/oeminit.res
else
$(GLIDE_LIBDIR)/fxoem2x.dll:
# $(warning FxOem2x not enabled... Skipping fxoem2x.dll)
endif
###############################################################################
# rules(2)
###############################################################################
#cpuid.obj: cpudtect.asm
# $(AS) -o $@ $(ASFLAGS) $<
xdraw2_def.obj: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) $<
xtexdl_def.obj: xtexdl.c
$(CC) -Fo$@ $(CFLAGS) -c $<
xtexdl_mmx.obj: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_MMX=1 $<
xdraw2_3dnow.obj: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xtexdl_3dnow.obj: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
fxinline.h: fxgasm.exe
./$< -inline > $@
fxgasm.h: fxgasm.exe
./$< -hex > $@
fxgasm.exe: fxgasm.c
$(CC) -o $@ $(CFLAGS) $<
###############################################################################
# clean, realclean
###############################################################################
clean:
-$(call UNLINK,*.obj)
-$(call UNLINK,../../init/*.obj)
-$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.obj)
-$(call UNLINK,fxinline.h)
-$(call UNLINK,fxgasm.h)
-$(call UNLINK,$(FX_GLIDE_SW)/texus2/lib/*.obj)
-$(call UNLINK,../oem/oeminit.obj)
-$(call UNLINK,../oem/oeminit.res)
realclean: clean
-$(call UNLINK,$(GLIDE_LIBDIR)/glide2x.exp)
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DLL))
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP))
-$(call UNLINK,$(TEXUS_EXEDIR)/$(TEXUS_EXE))
-$(call UNLINK,$(GLIDE_LIBDIR)/fxoem2x.exp)
-$(call UNLINK,$(GLIDE_LIBDIR)/fxoem2x.dll)
-$(call UNLINK,$(GLIDE_LIBDIR)/fxoem2x.lib)

View File

@@ -20,6 +20,7 @@
#include <sys/utsname.h>
#include <stdio.h>
#include <string.h>
int _cpu_detect_asm() {
struct utsname name;

View File

@@ -0,0 +1,352 @@
/*
* CPU detection code
*
*
* Revision 1.1.2.2 2006/09/02 03:12:29 guillemj
* Backport glide3 fix for PIC compilation with gcc 4.1 from Hans de Goede.
*
* Revision 1.1.2.1 2004/12/12 15:16:02 koolsmoky
* new cpuid
*
* Revision 1.1.2.10 2004/10/05 14:54:29 dborca
* DOS/OpenWatcom woes
*
* Revision 1.1.2.9 2003/08/04 12:45:47 dborca
* Preparing for MinGW 2.0
*
* Revision 1.1.2.8 2003/07/29 10:04:32 dborca
* Shamelessness.
* Safeguard in CPUID.
* Changed contact address!
* Koolsmoky's texture download fixes.
*
* Revision 1.1.2.7 2003/07/25 07:14:58 dborca
* ... in the name of the Linux, DRI and the sacred Glide...
*
* Revision 1.1.2.6 2003/07/24 13:13:03 koolsmoky
* use __try/__except mechanism for win32 to catch SSE sigillegal in win95
*
* Revision 1.1.2.5 2003/07/01 11:16:42 dborca
* fixed a bug in GNUC code when running Intel; also removed detritus
*
* Revision 1.1.2.3 2003/06/13 07:22:58 dborca
* more fixes to NASM sources
*
*/
#include <signal.h>
#include <setjmp.h>
#include <string.h>
#include "cpuid.h"
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ > 3)))
typedef unsigned int __attribute__((__may_alias__)) word32;
#else
typedef unsigned int word32;
#endif
/* These are the bit flags that get set on calling cpuid
* with register eax set to 1
*/
#define _MMX_FEATURE_BIT 0x00800000
#define _SSE_FEATURE_BIT 0x02000000
#define _SSE2_FEATURE_BIT 0x04000000
/* This bit is set when cpuid is called with
* register set to 80000001h (only applicable to AMD)
*/
#define _3DNOW_FEATURE_BIT 0x80000000
#define _3DNOWPLUS_FEATURE_BIT 0x40000000
#define _MMXPLUS_FEATURE_BIT 0x00400000
/* Testing code:
* TEST_SSE = xorps xmm0, xmm0
* TEST_SSE2 = xorpd xmm0, xmm0
* TEST_3DNOW = femms
* TEST_MMX = emms
* TEST_3DNOWPLUS = femms | pswapd mm0, mm0 | femms
* TEST_MMXPLUS = emms | pminsw mm0, mm0 | emms
*/
#ifdef __GNUC__
#define TEST_CPUID(f) __asm __volatile ("pushl %%ebx; cpuid; popl %%ebx"::"a"(f):"%ecx", "%edx")
#define TEST_SSE() __asm __volatile (".byte 0x0f, 0x57, 0xc0")
#define TEST_SSE2() __asm __volatile (".byte 0x66, 0x0f, 0x57, 0xc0")
#define TEST_3DNOW() __asm __volatile (".byte 0x0f, 0x0e")
#define TEST_MMX() __asm __volatile (".byte 0x0f, 0x77")
#define TEST_3DNOWPLUS() __asm __volatile (".byte 0x0f, 0x0e, 0x0f, 0x0f, 0xc0, 0xbb, 0x0f, 0x0e")
#define TEST_MMXPLUS() __asm __volatile (".byte 0x0f, 0x77, 0x0f, 0xea, 0xc0, 0x0f, 0x77")
#else
#define TEST_CPUID(f) __asm { _asm mov eax, f _asm cpuid }
#define TEST_SSE() __asm { _asm _emit 0x0f _asm _emit 0x57 _asm _emit 0xc0 }
#define TEST_SSE2() __asm { _asm _emit 0x66 _asm _emit 0x0f _asm _emit 0x57 _asm _emit 0xc0 }
#define TEST_3DNOW() __asm { _asm _emit 0x0f _asm _emit 0x0e }
#define TEST_MMX() __asm { _asm _emit 0x0f _asm _emit 0x77 }
#define TEST_3DNOWPLUS() __asm { _asm _emit 0x0f _asm _emit 0x0e _asm _emit 0x0f _asm _emit 0x0f _asm _emit 0xc0 _asm _emit 0xbb _asm _emit 0x0f _asm _emit 0x0e }
#define TEST_MMXPLUS() __asm { _asm _emit 0x0f _asm _emit 0x77 _asm _emit 0x0f _asm _emit 0xea _asm _emit 0xc0 _asm _emit 0x0f _asm _emit 0x77 }
#endif
#ifndef __MSC__
static jmp_buf j;
/* Desc: signal handler
*
* In : signal number
* Out : -
*
* Note: returns by `longjmp'ing
*/
static void handler (int signal)
{
longjmp(j, signal + 1); /* so we can tell... also ensure we don't pass 0 */
}
/* Desc: check if CPU has specific feature
*
* In : feature request
* Out : 0 == fail, input == pass
*
* Note: this should be in the `has_feature' body. The reason it isn't:
* under some systems (notably Linux), the `setjmp' may thrash EBX,
* which is used for PositionIndependentCode/GlobalOffsetTable system.
* Since EBX is non-volatile register, it should be restored upon return.
*/
static int check_feature (int feature)
{
if (setjmp(j)) {
/* we got here only when `longjmp'ed by signal handlers */
return 0;
} else {
/* we have signals and jump buffer set */
switch (feature) {
case _CPU_HAS_CPUID: TEST_CPUID(0); break;
case _CPU_FEATURE_SSE: TEST_SSE(); break;
case _CPU_FEATURE_SSE2: TEST_SSE2(); break;
case _CPU_FEATURE_3DNOW: TEST_3DNOW(); break;
case _CPU_FEATURE_MMX: TEST_MMX(); break;
case _CPU_FEATURE_3DNOWPLUS: TEST_3DNOWPLUS(); break;
case _CPU_FEATURE_MMXPLUS: TEST_MMXPLUS(); break;
default: return 0;
}
return feature;
}
}
#endif
/* Desc: perform (possibly faulting) instructions in a safe manner
*
* In : feature request
* Out : 0 == fail, input == pass
*
* Note: pure ANSI code; stupid Watcom cannot handle this.
*/
static int has_feature (int feature)
{
#ifndef __MSC__
int rv;
/* register signal handlers */
void (*old_sigill)(int) = signal(SIGILL, handler);
if (old_sigill == SIG_ERR) {
return 0;
}
rv = check_feature(feature);
/* restore the signal handlers */
signal(SIGILL, old_sigill);
return rv;
#else
/* Use the non-standard __try/__except mechanism because win95 fails to catch
* sigillegal for SSE using standard signal mechanism.
* HACK ALERT! HACK ALERT! HACK ALERT!
* This means the MinGW version cannot be safely run under Win95!
*/
#define _TRY() __try {
#define _EXCEPTION() } __except(1) { return 0; } /* EXCEPTION_EXECUTE_HANDLER=1 */
switch (feature) {
case _CPU_HAS_CPUID: _TRY() TEST_CPUID(0) _EXCEPTION() break;
case _CPU_FEATURE_SSE: _TRY() TEST_SSE() _EXCEPTION() break;
case _CPU_FEATURE_SSE2: _TRY() TEST_SSE2() _EXCEPTION() break;
case _CPU_FEATURE_3DNOW: _TRY() TEST_3DNOW() _EXCEPTION() break;
case _CPU_FEATURE_MMX: _TRY() TEST_MMX() _EXCEPTION() break;
case _CPU_FEATURE_3DNOWPLUS: _TRY() TEST_3DNOWPLUS() _EXCEPTION() break;
case _CPU_FEATURE_MMXPLUS: _TRY() TEST_MMXPLUS() _EXCEPTION() break;
default: return 0;
}
return feature;
#endif
}
/* Desc: get CPU info
*
* In : pointer to _p_info
* Out : features
*
* Note: -
*/
int _cpuid (_p_info *pinfo)
{
word32 dwId = 0;
word32 dwFeature = 0;
word32 dwExt = 0;
int feature = 0, os_support = 0;
char Ident[13];
if (!has_feature(_CPU_HAS_CPUID)) {
return 0;
}
#ifdef __GNUC__
__asm("\n\
/* get the vendor string */ \n\
pushl %%ebx \n\
xorl %%eax, %%eax \n\
cpuid \n\
movl %%ebx, %%eax \n\
popl %%ebx \n\
movl %%eax, %3 \n\
movl %%edx, %4 \n\
movl %%ecx, %5 \n\
/* get the Standard bits */ \n\
pushl %%ebx \n\
movl $1, %%eax \n\
cpuid \n\
popl %%ebx \n\
movl %%eax, %1 \n\
movl %%edx, %2 \n\
/* get AMD-specials */ \n\
pushl %%ebx \n\
movl $0x80000000, %%eax \n\
cpuid \n\
popl %%ebx \n\
cmpl $0x80000000, %%eax \n\
jc 0f \n\
pushl %%ebx \n\
movl $0x80000001, %%eax \n\
cpuid \n\
popl %%ebx \n\
movl %%edx, %0 \n\
0: \n\
":"=g"(dwExt), "=g"(dwId), "=g"(dwFeature),
"=g"(((long *)Ident)[0]), "=g"(((long *)Ident)[1]), "=g"(((long *)Ident)[2])
::"%eax", "%ecx", "%edx");
#else
_asm
{
push ebx
push ecx
push edx
/* get the vendor string */
xor eax,eax
cpuid
mov dword ptr [Ident],ebx
mov dword ptr [Ident+4],edx
mov dword ptr [Ident+8],ecx
/* get the Standard bits */
mov eax,1
cpuid
mov dwId,eax
mov dwFeature,edx
/* get AMD-specials */
mov eax,80000000h
cpuid
cmp eax,80000000h
jc notamd
mov eax,80000001h
cpuid
mov dwExt,edx
notamd:
pop ecx
pop ebx
pop edx
}
#endif
#ifndef __WATCOMC__
/* stupid watcom does not sigill... */
if (dwFeature & _MMX_FEATURE_BIT) {
feature |= _CPU_FEATURE_MMX;
os_support |= has_feature(_CPU_FEATURE_MMX);
}
if (dwExt & _3DNOW_FEATURE_BIT) {
feature |= _CPU_FEATURE_3DNOW;
os_support |= has_feature(_CPU_FEATURE_3DNOW);
}
if (dwExt & _3DNOWPLUS_FEATURE_BIT) {
feature |= _CPU_FEATURE_3DNOWPLUS;
os_support |= has_feature(_CPU_FEATURE_3DNOWPLUS);
}
if (dwExt & _MMXPLUS_FEATURE_BIT) {
feature |= _CPU_FEATURE_MMXPLUS;
os_support |= has_feature(_CPU_FEATURE_MMXPLUS);
}
if (dwFeature & _SSE_FEATURE_BIT) {
feature |= _CPU_FEATURE_SSE;
os_support |= has_feature(_CPU_FEATURE_SSE);
}
if (dwFeature & _SSE2_FEATURE_BIT) {
feature |= _CPU_FEATURE_SSE2;
os_support |= has_feature(_CPU_FEATURE_SSE2);
}
#endif
if (pinfo) {
memset(pinfo, 0, sizeof(_p_info));
pinfo->os_support = os_support;
pinfo->feature = feature;
pinfo->family = (dwId >> 8) & 0xF; /* retrieving family */
pinfo->model = (dwId >> 4) & 0xF; /* retrieving model */
pinfo->stepping = dwId & 0xF; /* retrieving stepping */
Ident[12] = 0;
strcpy(pinfo->v_name, Ident);
}
return feature;
}
#if CPUTEST
#include <stdio.h>
/* Desc:
*
* In :
* Out :
*
* Note:
*/
int main (void)
{
_p_info p;
_cpuid(&p);
printf("vendor : %s\n", p.v_name);
printf("family : %d\n", p.family);
printf("model : %d\n", p.model);
printf("stepping: %X\n", p.stepping);
printf("feature : %08x\n", p.feature);
printf("support : %08x\n", p.os_support);
printf("--------\n");
printf("cpuid : %d\n", has_feature(_CPU_HAS_CPUID));
printf("MMX : %d\n", has_feature(_CPU_FEATURE_MMX));
printf("SSE : %d\n", has_feature(_CPU_FEATURE_SSE));
printf("SSE2 : %d\n", has_feature(_CPU_FEATURE_SSE2));
printf("3DNow! : %d\n", has_feature(_CPU_FEATURE_3DNOW));
printf("3DNow!+ : %d\n", has_feature(_CPU_FEATURE_3DNOWPLUS));
printf("MMX+ : %d\n", has_feature(_CPU_FEATURE_MMXPLUS));
return 0;
}
#endif

View File

@@ -19,6 +19,12 @@
**
** $Header$
** $Log$
** Revision 1.2.2.1 2005/01/22 14:52:01 koolsmoky
** enabled packed argb for cmd packet type 3
**
** Revision 1.2 2000/10/03 18:28:33 mercury
** 003-clean_up_cvg-000, cvg tree cleanup.
**
** Revision 1.1.1.1 1999/12/07 21:49:08 joseph
** Initial checkin into SourceForge.
**

View File

@@ -19,6 +19,19 @@
**
** $Header$
** $Log$
** Revision 1.1.1.1.2.3 2005/01/22 14:52:01 koolsmoky
** enabled packed argb for cmd packet type 3
**
** Revision 1.1.1.1.2.2 2004/12/23 20:45:56 koolsmoky
** converted to nasm syntax
** added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations
**
** Revision 1.1.1.1.2.1 2004/12/12 15:18:58 koolsmoky
** changes to support new cpuid; moved single_precision_asm(), double_precision_asm() from cpudetect.asm
**
** Revision 1.1.1.1 1999/12/07 21:49:08 joseph
** Initial checkin into SourceForge.
**
**
** 40 6/23/98 5:38p Peter
** lfb hinting
@@ -212,26 +225,26 @@ _grSwizzleColor(GrColor_t *color)
break;
case GR_COLORFORMAT_ABGR:
red = *color & 0x00ff;
blue = (*color >> 16) & 0xff;
*color &= 0xff00ff00;
*color |= ((red << 16) | blue);
red = (*color & 0x000000ff) << 16; /* 00RR0000 */
blue = (*color & 0x00ff0000) >> 16; /* 000000BB */
*color &= 0xff00ff00; /* AA00GG00 */
*color |= (red | blue); /* AARRGGBB */
break;
case GR_COLORFORMAT_RGBA:
blue = (*color & 0x0000ff00) >> 8;
green = (*color & 0x00ff0000) >> 16;
red = (*color & 0xff000000) >> 24;
alpha = (*color & 0x000000ff);
*color = (alpha << 24) | (red << 16) | (green << 8) | blue;
blue = (*color & 0x0000ff00) >> 8; /* 000000BB */
green = (*color & 0x00ff0000) >> 8; /* 0000GG00 */
red = (*color & 0xff000000) >> 8; /* 00RR0000 */
alpha = (*color & 0x000000ff) << 24; /* AA000000 */
*color = alpha | red | green | blue; /* AARRGGBB */
break;
case GR_COLORFORMAT_BGRA:
blue = (*color & 0xff000000) >> 24;
green = (*color & 0x00ff0000) >> 16;
red = (*color & 0x0000ff00) >> 8;
alpha = (*color & 0x000000ff);
*color = (alpha << 24) | (red << 16) | (green << 8) | blue;
blue = (*color & 0xff000000) >> 24; /* 000000BB */
green = (*color & 0x00ff0000) >> 8; /* 0000GG00 */
red = (*color & 0x0000ff00) << 8; /* 00RR0000 */
alpha = (*color & 0x000000ff) << 24; /* AA000000 */
*color = alpha | red | green | blue; /* AARRGGBB */
break;
default:

View File

@@ -19,6 +19,9 @@
**
** $Header$
** $Log$
** Revision 1.1.1.1 1999/12/07 21:49:08 joseph
** Initial checkin into SourceForge.
**
**
** 22 4/21/98 10:05a Peter
** grSstSelect cleanup (Thanks John/Rufus)
@@ -109,7 +112,7 @@ GR_DIENTRY(grSstQueryBoards, FxBool, ( GrHwConfiguration *hwc ))
GDBG_INIT();
GDBG_INFO(80,"grSstQueryBoards(0x%x)\n",hwc);
#if GLIDE_INIT_HAL
#if 1 /*GLIDE_INIT_HAL*/
hwc->num_sst = (_grSstDetectResources()
? _GlideRoot.hwConfig.num_sst
: 0);

View File

@@ -19,6 +19,9 @@
**
** $Header$
** $Log$
** Revision 1.1.1.1 1999/12/07 21:49:08 joseph
** Initial checkin into SourceForge.
**
**
** 22 3/14/98 1:07p Peter
** mac port happiness
@@ -512,7 +515,7 @@ const FxU32 kFifoCheckMask = 0xFFFF;
FxU32 gFifoCheckCount = 0;
#endif
void GR_CDECL
void FX_CALL
_FifoMakeRoom(const FxI32 blockSize, const char* fName, const int fLine)
{
#define FN_NAME "_FifoMakeRoom"

View File

@@ -0,0 +1,85 @@
/*
* FPU handling code
*
* $Id$
*
*/
/*
* This routine sets the precision to single which effects all
* adds, mults, and divs.
*/
#if defined(__i386__) || defined(__x86_64__)
void single_precision_asm()
{
#if defined(__MSC__)
__asm {
push eax ; make room
fnclex ; clear pending exceptions
fstcw WORD PTR [esp]
mov eax, DWORD PTR [esp]
and eax, 0000fcffh ; clear bits 9:8
mov DWORD PTR [esp], eax
fldcw WORD PTR [esp]
pop eax
}
#elif defined(__GNUC__)
asm("push %eax\n"
"fnclex\n"
"fstcw (%esp)\n"
"movl (%esp), %eax\n"
"and $0x0000fcff, %eax\n"
"movl %eax, (%esp)\n"
"fldcw (%esp)\n"
"pop %eax");
#else
#error "Need to implement single_precision_asm() for this compiler"
#endif
}
#else
#warning "Using a stub for single_precision_asm() for this architecture"
void single_precision_asm()
{
}
#endif
/*
* This routine sets the precision to double which effects all
* adds, mults, and divs.
*/
#if defined(__i386__) || defined(__x86_64__)
void double_precision_asm()
{
#if defined(__MSC__)
__asm {
push eax ; make room
fnclex ; clear pending exceptions
fstcw WORD PTR [esp]
mov eax, DWORD PTR [esp]
and eax, 0000fcffh ; clear bits 9:8
or eax, 000002ffh ; set 9:8 to 10
mov DWORD PTR [esp], eax
fldcw WORD PTR [esp]
pop eax
}
#elif defined(__GNUC__)
asm("push %eax\n"
"fnclex\n"
"fstcw (%esp)\n"
"movw (%esp), %eax\n"
"and $0x0000fcff, %eax\n"
"or $0x000002ff, %eax\n"
"mov %eax, (%esp)\n"
"fldcw (%esp)\n"
"pop %eax");
#else
#error "Need to implement double_precision_asm() for this compiler"
#endif
}
#else
#warning "Using a stub for double_precision_asm() for this architecture"
void double_precision_asm()
{
}
#endif

View File

@@ -37,7 +37,6 @@
* macros for creating assembler offset files
*----------------------------------------------------------------------*/
#ifndef __linux__
#define NEWLINE printf("\n")
#define COMMENT printf(";----------------------------------------------------------------------\n")
@@ -46,44 +45,16 @@
COMMENT; NEWLINE
#define OFFSET(p,o,pname) if (hex) \
printf("%s\t= %08xh\n",pname,((int)&p.o)-(int)&p); \
else printf("%s\t= %10d\n",pname,((int)&p.o)-(int)&p)
printf("%s\tequ %08xh\n",pname,((int)&p.o)-(int)&p); \
else printf("%s\tequ %10d\n",pname,((int)&p.o)-(int)&p)
#define OFFSET2(p,o,pname) if (hex) \
printf("%s\t= %08xh\n",pname,((int)&o)-(int)&p); \
else printf("%s\t= %10d\n",pname,((int)&o)-(int)&p)
printf("%s\tequ %08xh\n",pname,((int)&o)-(int)&p); \
else printf("%s\tequ %10d\n",pname,((int)&o)-(int)&p)
#define SIZEOF(p,pname) if (hex) \
printf("SIZEOF_%s\t= %08xh\n",pname,sizeof(p)); \
else printf("SIZEOF_%s\t= %10d\n",pname,sizeof(p))
#else
#define NEWLINE printf("\n");
#define COMMENT printf("#----------------------------------------------------------------------\n")
#define HEADER(str) NEWLINE; COMMENT; \
printf("# Assembler offsets for %s struct\n",str);\
COMMENT; NEWLINE
#define OFFSET(p,o,pname) if (hex) \
printf("%s\t .EQU %08x\n",pname,((int)&p.o)-(int)&p); \
else printf("%s\t .EQU %10d\n",pname,((int)&p.o)-(int)&p)
#if (GLIDE_PLATFORM & GLIDE_HW_SST96)
#define HWOFFSET(p, o, pname) if (hex) \
printf("%s\t .EQU %08x\n",pname,(((int) &p.o)-(int)&p)>>2);\
else printf("%s\t .EQU %10d\n",pname,(((int)&p.o)-(int)&p))
#endif /* (GLIDE_PLATFORM & GLIDE_HW_SST96) */
#define OFFSET2(p,o,pname) if (hex) \
printf("%s\t .EQU %08x\n",pname,((int)&o)-(int)&p); \
else printf("%s\t .EQU %10d\n",pname,((int)&o)-(int)&p)
#define SIZEOF(p,pname) if (hex) \
printf("SIZEOF_%s\t .EQU %08x\n",pname,sizeof(p)); \
else printf("SIZEOF_%s\t .EQU %10d\n",pname,sizeof(p))
#endif
printf("SIZEOF_%s\tequ %08lxh\n",pname,sizeof(p)); \
else printf("SIZEOF_%s\tequ %10ld\n",pname,sizeof(p))
int
main (int argc, char **argv)
@@ -106,17 +77,17 @@ main (int argc, char **argv)
printf("\n");
#if GLIDE_DISPATCH_SETUP
printf("#define kCurGCOffset 0x%XUL\n",
printf("#define kCurGCOffset 0x%lXUL\n",
offsetof(struct _GlideRoot_s, curGC));
printf("#define kTriProcOffset 0x%XUL\n",
offsetof(struct GrGC_s, cmdTransportInfo.triSetupProc));
printf("#define kTriProcOffset 0x%lXUL\n",
offsetof(struct GrGC_s, curArchProcs.triSetupProc));
printf("#define kTriProcOffsetClean %d\n",
offsetof(struct GrGC_s, cmdTransportInfo.triSetupProc));
offsetof(struct GrGC_s, curArchProcs.triSetupProc));
#endif /* GLIDE_DISPATCH_SETUP */
printf("/* The # of 2-byte entries in the hw fog table */\n");
printf("#define kInternalFogTableEntryCount 0x%XUL\n",
printf("#define kInternalFogTableEntryCount 0x%lXUL\n",
sizeof(dummyRegs.fogTable) >> 1);
printf("\n");
@@ -135,6 +106,7 @@ main (int argc, char **argv)
OFFSET (gc,base_ptr,"base_ptr\t");
OFFSET (gc,reg_ptr,"reg_ptr\t\t");
OFFSET (gc,lfb_ptr,"lfb_ptr\t\t");
OFFSET (gc,tex_ptr,"tex_ptr\t\t");
OFFSET (gc,state.cull_mode,"cull_mode\t");
OFFSET (gc, regDataList,"regDataList\t");
OFFSET (gc, tsuDataList,"tsuDataList\t");
@@ -157,6 +129,10 @@ main (int argc, char **argv)
OFFSET (gc, cmdTransportInfo.fifoLfbP, "fifoLfbP");
OFFSET (gc, cmdTransportInfo.lfbLockCount, "lfbLockCount");
#if GLIDE_DISPATCH_SETUP
OFFSET (gc,curArchProcs.triSetupProc,"kTriProcOffset\t\t");
#endif
SIZEOF (gr.GCs[0].state,"GrState\t");
SIZEOF (gr.hwConfig,"GrHwConfiguration");
SIZEOF (gr.GCs[0],"GC\t");

View File

@@ -19,6 +19,23 @@
**
** $Header$
** $Log$
** Revision 1.2.2.3 2005/01/22 14:52:01 koolsmoky
** enabled packed argb for cmd packet type 3
**
** Revision 1.2.2.2 2004/12/23 20:45:56 koolsmoky
** converted to nasm syntax
** added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations
**
** Revision 1.2.2.1 2004/12/12 15:17:18 koolsmoky
** support new cpuid
**
** Revision 1.2 2003/06/28 19:31:06 guillemj
** Fix compilation warnings.
** Removed some trailing spaces.
**
** Revision 1.1.1.1 1999/12/07 21:49:09 joseph
** Initial checkin into SourceForge.
**
**
** 206 6/06/98 12:06p Peter
** gmt's trilinear hell bug
@@ -272,6 +289,7 @@
#include <3dfx.h>
#include <glidesys.h>
#include <gdebug.h>
#include <cpuid.h>
#if (GLIDE_PLATFORM & GLIDE_HW_H3)
#include <h3.h>
@@ -418,7 +436,7 @@ do { \
**
*/
struct _GrState_s
struct _GrState_s
{
GrCullMode_t /* these go in front for cache hits */
cull_mode; /* cull neg, cull pos, don't cull */
@@ -500,6 +518,102 @@ struct _GrState_s
a, r, g, b; /* Constant color values for Delta0 mode */
};
#if GLIDE_DISPATCH_SETUP
/* gpci.c
*
* Set of procs for the current cpu type. These are selected out of
* the _archXXXX proc list that is selected at grGlideInit time.
*/
typedef FxI32 (FX_CALL* GrTriSetupProc)(const void*, const void*, const void*);
typedef GrTriSetupProc GrTriSetupProcVector[2];
#if GLIDE_PACKED_RGB
typedef GrTriSetupProcVector GrTriSetupProcArchVector[3];
#else
typedef GrTriSetupProcVector GrTriSetupProcArchVector[1];
#endif
/* Decalrations of the dispatchable procs found in xdraw2.asm and
* xtexdl.c for teh triangle and texture download procs respectively.
*/
extern FxI32 FX_CALL _trisetup(const void*, const void*, const void*);
extern FxI32 FX_CALL _trisetup_cull(const void*, const void*, const void*);
#if GLIDE_PACKED_RGB
extern FxI32 FX_CALL _trisetup_rgb(const void*, const void*, const void*);
extern FxI32 FX_CALL _trisetup_cull_rgb(const void*, const void*, const void*);
extern FxI32 FX_CALL _trisetup_argb(const void*, const void*, const void*);
extern FxI32 FX_CALL _trisetup_cull_argb(const void*, const void*, const void*);
#endif /* GLIDE_PACKED_RBG */
#if GL_AMD3D
extern FxI32 FX_CALL _trisetup_3DNow(const void*, const void*, const void*);
extern FxI32 FX_CALL _trisetup_cull_3DNow(const void*, const void*, const void*);
#if GLIDE_PACKED_RGB
extern FxI32 FX_CALL _trisetup_rgb_3DNow(const void*, const void*, const void*);
extern FxI32 FX_CALL _trisetup_cull_rgb_3DNow(const void*, const void*, const void*);
extern FxI32 FX_CALL _trisetup_argb_3DNow(const void*, const void*, const void*);
extern FxI32 FX_CALL _trisetup_cull_argb_3DNow(const void*, const void*, const void*);
#endif /* GLIDE_PACKED_RBG */
#endif /* GL_AMD3D */
#endif /* GLIDE_DISPATCH_SETUP */
#if GLIDE_DISPATCH_DOWNLOAD
/* _GlideRoot.curTexProcs is an array of (possibly specialized
* function pointers indexed by texture format size (8/16 bits) and
* texture line width (1/2/4/>4).
*
* xtexdl.c
*/
struct GrGC_s;
typedef void (FX_CALL* GrTexDownloadProc)(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData);
typedef GrTexDownloadProc GrTexDownloadProcVector[2][4];
extern void FX_CALL _grTexDownload_Default_8_1(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData);
extern void FX_CALL _grTexDownload_Default_8_2(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData);
extern void FX_CALL _grTexDownload_Default_8_4(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData);
extern void FX_CALL _grTexDownload_Default_8_WideS(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData);
extern void FX_CALL _grTexDownload_Default_16_1(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData);
extern void FX_CALL _grTexDownload_Default_16_2(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData);
extern void FX_CALL _grTexDownload_Default_16_4(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData);
extern void FX_CALL _grTexDownload_Default_16_WideS(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData);
#if GL_AMD3D
/* xtexdl.asm */
extern void FX_CALL _grTexDownload_3DNow_MMX(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData);
#endif /* GL_AMD3D */
#if GL_MMX
/* xtexdl.asm */
extern void FX_CALL _grTexDownload_MMX(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData);
#endif /* GL_MMX */
#endif /* GLIDE_DISPATCH_DOWNLOAD */
typedef struct GrGC_s
{
FxU32
@@ -524,6 +638,15 @@ typedef struct GrGC_s
GrState
state; /* state of Glide/SST */
#if GLIDE_DISPATCH_SETUP
struct {
/* Current triangle rendering proc specialized for culling/no
* culling and viewport/window coordinates.
*/
GrTriSetupProc triSetupProc;
} curArchProcs;
#endif /* GLIDE_DISPATCH_SETUP */
struct cmdTransportInfo {
FxU32 triPacketHdr; /* Pre-computed packet header for
* independent triangles.
@@ -565,10 +688,6 @@ typedef struct GrGC_s
FxBool fifoLfbP; /* Do we expect lfb writes to go through the fifo? */
FxBool lfbLockCount; /* Have we done an lfb lock? Count of the locks. */
#if GLIDE_DISPATCH_SETUP
FxI32 (FX_CALL *triSetupProc)(const GrVertex* a, const GrVertex* b, const GrVertex* c);
#endif /* GLIDE_DISPATCH_SETUP */
#if GLIDE_USE_SHADOW_FIFO
FxU32* fifoShadowBase; /* Buffer that shadows the hw fifo for debugging */
@@ -716,7 +835,7 @@ typedef struct GrGC_s
struct _GlideRoot_s {
int p6Fencer; /* xchg to here to keep this in cache!!! */
int current_sst;
FxU32 CPUType;
_p_info CPUType; /* CPUID */
GrGC *curGC; /* point to the current GC */
FxU32 packerFixAddress; /* address to write packer fix to */
FxBool windowsInit; /* Is the Windows part of glide initialized? */
@@ -812,6 +931,17 @@ struct _GlideRoot_s {
* sst's and actual boards.
*/
GrGC GCs[MAX_NUM_SST]; /* one GC per board */
#if GLIDE_DISPATCH_SETUP || GLIDE_DISPATCH_DOWNLOAD
struct {
#if GLIDE_DISPATCH_SETUP
GrTriSetupProcArchVector* curTriProcs;
#endif /* GLIDE_DISPATCH_SETUP */
#if GLIDE_DISPATCH_DOWNLOAD
GrTexDownloadProcVector* curTexProcs;
#endif /* GLIDE_DISPATCH_DOWNLOAD */
} deviceArchProcs;
#endif /* GLIDE_DISPATCH_SETUP || GLIDE_DISPATCH_DOWNLOAD */
};
extern struct _GlideRoot_s GR_CDECL _GlideRoot;
@@ -879,37 +1009,13 @@ extern GrGCFuncs _curGCFuncs;
void _grMipMapInit(void);
#if GLIDE_DISPATCH_SETUP
FxI32 FX_CSTYLE
_trisetup_cull(const GrVertex *va, const GrVertex *vb, const GrVertex *vc);
FxI32 FX_CSTYLE
_trisetup(const GrVertex *va, const GrVertex *vb, const GrVertex *vc);
#define TRISETUP_NORGB(__cullMode) (((__cullMode) == GR_CULL_DISABLE) \
? _trisetup \
: _trisetup_cull)
#define TRISETUP_NORGB (*_GlideRoot.deviceArchProcs.curTriProcs + 0)
#if GLIDE_PACKED_RGB
FxI32 FX_CSTYLE
_trisetup_cull_rgb(const GrVertex *va, const GrVertex *vb, const GrVertex *vc);
FxI32 FX_CSTYLE
_trisetup_cull_argb(const GrVertex *va, const GrVertex *vb, const GrVertex *vc);
FxI32 FX_CSTYLE
_trisetup_rgb(const GrVertex *va, const GrVertex *vb, const GrVertex *vc);
FxI32 FX_CSTYLE
_trisetup_argb(const GrVertex *va, const GrVertex *vb, const GrVertex *vc);
#define TRISETUP_RGB(__cullMode) (((__cullMode) == GR_CULL_DISABLE) \
? _trisetup_rgb \
: _trisetup_cull_rgb)
#define TRISETUP_ARGB(__cullMode) (((__cullMode) == GR_CULL_DISABLE) \
? _trisetup_argb \
: _trisetup_cull_argb)
#else /* !GLIDE_PACKED_RGB */
#define TRISETUP_RGB(__cullMode) TRISETUP_NORGB(__cullMode)
#define TRISETUP_ARGB(__cullMode) TRISETUP_NORGB(__cullMode)
#define TRISETUP_RGB (*_GlideRoot.deviceArchProcs.curTriProcs + 1)
#define TRISETUP_ARGB (*_GlideRoot.deviceArchProcs.curTriProcs + 2)
#endif /* !GLIDE_PACKED_RGB */
#define TRISETUP (*gc->cmdTransportInfo.triSetupProc)
#define PROC_SELECT_TRISETUP(__procVector, __cullMode) (__procVector)[(__cullMode) != GR_CULL_DISABLE]
#define TRISETUP (*gc->curArchProcs.triSetupProc)
#else /* !GLIDE_DISPATCH_SETUP */
FxI32 FX_CSTYLE
_trisetup_asm(const GrVertex *va, const GrVertex *vb, const GrVertex *vc);
@@ -1154,7 +1260,7 @@ ASSERT_FAULT_IMMED((FxU32)gc->cmdTransportInfo.fifoRoom < gc->cmdTransportInfo.f
ASSERT_FAULT_IMMED((FxU32)gc->cmdTransportInfo.fifoPtr < (FxU32)gc->cmdTransportInfo.fifoEnd)
#endif /* !FIFO_ASSERT_FULL */
void GR_CDECL
extern void FX_CALL
_FifoMakeRoom(const FxI32 blockSize, const char* fName, const int fLine);
#define GR_CHECK_FOR_ROOM(__n, __p) \
@@ -1904,11 +2010,21 @@ _grCVGFifoDump_Linear(const FxU32* const linearPacketAddr);
* probably do something silly like wrap around zero.
*/
#if GLIDE_PACKED_RGB
#define RGBA_COMP(__fpVal, __fpBias, __fpShift, __fpMask) \
/*#define RGBA_COMP(__fpVal, __fpBias, __fpShift, __fpMask) \
((_GlideRoot.pool.ftemp1 = (float)((float)(__fpVal) + (float)(__fpBias))), \
GR_ASSERT((__fpVal) >= 0.0f), \
GR_ASSERT((__fpVal) < 256.0f), \
(((*(const FxU32*)&_GlideRoot.pool.ftemp1) & (__fpMask)) << (__fpShift)))
(((*(const FxU32*)&_GlideRoot.pool.ftemp1) & (__fpMask)) << (__fpShift)))*/
/* dpc - 10 feb 1998 -
* Some apps send color values outside of the range [0..255]
*/
#define RGBA_COMP(__fpVal, __fpBias, __fpShift, __fpMask) \
((_GlideRoot.pool.ftemp1 = (float)((float)(__fpVal) + (float)(__fpBias))), \
((((float)(__fpVal)) > 255.0f) \
? (__fpMask) \
: ((((float)(__fpVal)) < 0.0f) \
? 0x00UL \
: ((*(const FxU32*)&_GlideRoot.pool.ftemp1) & (__fpMask)))) << (__fpShift))
#define RGBA_COMP_CLAMP(__fpVal, __compToken) \
RGBA_COMP(__fpVal, kPackBias##__compToken, kPackShift##__compToken, kPackMask##__compToken)
@@ -2078,7 +2194,7 @@ enum {
};
#if (GLIDE_PLATFORM & GLIDE_HW_CVG)
#define TEX_ROW_ADDR_INCR(__t, __lod) ((__t) << 9)
#define TEX_ROW_ADDR_INCR(__t) ((__t) << 9)
#elif (GLIDE_PLATFORM & GLIDE_HW_H3)
#define TEX_ROW_ADDR_INCR(__t, __lod) ((__t) << 7)
#else
@@ -2222,7 +2338,7 @@ do { \
#define REG_GROUP_SETF_CLAMP(__regBase, __regAddr, __val) \
do { \
const FxU32 fpClampVal = FP_FLOAT_CLAMP(__val); \
REG_GROUP_ASSERT(__regAddr, fpClampVal, FXTRUE); \
REG_GROUP_ASSERT(__regAddr, fpClampVal, FXTRUE); \
SET(((FxU32*)(__regBase))[offsetof(SstRegs, __regAddr) >> 2], fpClampVal); \
GR_INC_SIZE(sizeof(FxU32)); \
} while(0)
@@ -2372,8 +2488,8 @@ _grErrorCallback(const char* const procName,
va_list args);
#endif
extern FxU32 GR_CDECL
_cpu_detect_asm(void);
/*extern FxU32 GR_CDECL
_cpu_detect_asm(void);*/
extern void GR_CDECL
single_precision_asm(void);

View File

@@ -0,0 +1,61 @@
/*
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
**
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
** THE UNITED STATES.
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Header$
** $Log:
** 3 3dfx 1.0.1.0.1.0 10/11/00 Brent Forced check in to enforce
** branching.
** 2 3dfx 1.0.1.0 06/20/00 Joseph Kain Changes to support the
** Napalm Glide open source release. Changes include cleaned up offensive
** comments and new legal headers.
** 1 3dfx 1.0 09/11/99 StarTeam VTS Administrator
** $
**
** 1 2/19/99 5:50p Peter
** type definitions for new splash screen
*/
#ifndef _FX_SPLASH_H_
#define _FX_SPLASH_H_
#include "3dfx.h"
#define FX_DLL_DEFINITION
#include "fxdll.h"
#include "glide.h"
typedef FxBool
(FX_CALL* GrSplashInitProc)(FxU32 hWnd,
FxU32 screenWidth, FxU32 screenHeight,
FxU32 numColBuf, FxU32 numAuxBuf,
GrColorFormat_t colorFormat);
typedef void
(FX_CALL* GrSplashShutdownProc)(void);
typedef void
(FX_CALL* GrSplashProc)(float x, float y,
float w, float h,
FxU32 frameNumber);
typedef const void*
(FX_CALL* GrSplashPlugProc)(FxU32* w, FxU32* h,
FxI32* strideInBytes,
GrLfbWriteMode_t* format);
#endif /* _FX_SPLASH_H_ */

View File

@@ -19,6 +19,15 @@
**
** $Header$
** $Log$
** Revision 1.1.1.1.2.2 2006/12/03 04:49:19 guillemj
** Backport "sequence point" fix for string upper code from glide3x.
**
** Revision 1.1.1.1.2.1 2004/12/12 15:20:35 koolsmoky
** use toupper for __MSC__
**
** Revision 1.1.1.1 1999/12/07 21:49:09 joseph
** Initial checkin into SourceForge.
**
**
** 17 2/20/98 11:00a Peter
** removed glide3 from glid2 tree
@@ -55,7 +64,7 @@
*/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <3dfx.h>
#define FX_DLL_DEFINITION
@@ -297,18 +306,13 @@ GR_DIENTRY(gu3dfGetInfo, FxBool,
/*
** determine the color format of the input image
*/
#ifdef __GNUC__
/* This function is not found in libgcc.a */
{
char* tempStr = (char*)color_format;
while(*tempStr != '\0') *tempStr++ = toupper(*tempStr);
char *tempStr = (char*)color_format;
while (*tempStr != '\0') {
*tempStr = toupper(*tempStr);
tempStr++;
}
}
#else
{
extern char* strupr(char*);
strupr(color_format);
}
#endif /* __GNUC__ */
i = 0;
format_found = FXFALSE;

View File

@@ -19,6 +19,12 @@
**
** $Header$
** $Log$
** Revision 1.1.1.1.2.1 2005/01/22 14:52:01 koolsmoky
** enabled packed argb for cmd packet type 3
**
** Revision 1.1.1.1 1999/12/07 21:49:09 joseph
** Initial checkin into SourceForge.
**
**
** 64 5/18/98 12:15p Peter
** crybaby check for alpha enable
@@ -246,13 +252,12 @@ GR_ENTRY(grAADrawPoint, void, (const GrVertex *e))
dataList++;
}
packedColor |= RGBA_COMP_CLAMP(FARRAY(fp, (GR_VERTEX_A_OFFSET << 2)), A);
dataList++;
TRI_SET(packedColor);
} else {
TRI_SETF(FARRAY(fp, (GR_VERTEX_A_OFFSET << 2)));
}
dataList++;
#endif /* GLIDE_PACKED_RGB */
#if GLIDE_FP_CLAMP_TEX
@@ -300,12 +305,12 @@ GR_ENTRY(grAADrawPoint, void, (const GrVertex *e))
dataList++;
}
/* Alpha set to 0.0 */
TRI_SET(packedColor);
} else {
TRI_SETF(0.0f);
}
#else /* !GLIDE_PACKED_RGB */
#endif /* !GLIDE_PACKED_RGB */
/* Parameters up to alpha.
*
* NB: It is up to the user to correctly set this up
@@ -318,6 +323,8 @@ GR_ENTRY(grAADrawPoint, void, (const GrVertex *e))
/* Send constant Alpha == 0.0f */
TRI_SETF(0.0f);
#if GLIDE_PACKED_RGB
}
#endif /* !GLIDE_PACKED_RGB */
/* Skip the actual alpha value in the data list */
@@ -426,13 +433,12 @@ grAADrawStrip(const FxU32 cullMode, const float* const vectorList[], const FxU32
dataList++;
}
packedColor |= RGBA_COMP_CLAMP(FARRAY(vector, (GR_VERTEX_A_OFFSET << 2)), A);
dataList++;
TRI_SET(packedColor);
} else {
TRI_SETF(FARRAY(vector, (GR_VERTEX_A_OFFSET << 2)));
}
dataList++;
#endif /* GLIDE_PACKED_RGB */
#if GLIDE_FP_CLAMP_TEX
@@ -663,6 +669,27 @@ GR_ENTRY(grAADrawLine, void, (const GrVertex *v1, const GrVertex *v2))
v2->a = 0.0f;
datalist = gc->tsuDataList;
#if GLIDE_PACKED_RGB
if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0) {
FxU32 packedColor = 0x00;
if (*datalist == (GR_VERTEX_R_OFFSET << 2)) {
packedColor = (RGBA_COMP_CLAMP(FARRAY(v2, (GR_VERTEX_B_OFFSET << 2)), B) |
RGBA_COMP_CLAMP(FARRAY(v2, (GR_VERTEX_G_OFFSET << 2)), G) |
RGBA_COMP_CLAMP(FARRAY(v2, (GR_VERTEX_R_OFFSET << 2)), R));
datalist++;
}
/* Alpha set to 0.0 */
TRI_SET(packedColor);
/* Skip the actual alpha value in the data list */
datalist++;
}
#endif /* GLIDE_PACKED_RGB */
while( *datalist != 0 ) {
TRI_SETF(FARRAY(v2, *datalist));
datalist++;
@@ -680,6 +707,27 @@ GR_ENTRY(grAADrawLine, void, (const GrVertex *v1, const GrVertex *v2))
v1->a = 0.0f;
datalist = gc->tsuDataList;
#if GLIDE_PACKED_RGB
if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0) {
FxU32 packedColor = 0x00;
if (*datalist == (GR_VERTEX_R_OFFSET << 2)) {
packedColor = (RGBA_COMP_CLAMP(FARRAY(v1, (GR_VERTEX_B_OFFSET << 2)), B) |
RGBA_COMP_CLAMP(FARRAY(v1, (GR_VERTEX_G_OFFSET << 2)), G) |
RGBA_COMP_CLAMP(FARRAY(v1, (GR_VERTEX_R_OFFSET << 2)), R));
datalist++;
}
/* Alpha set to 0.0 */
TRI_SET(packedColor);
/* Skip the actual alpha value in the data list */
datalist++;
}
#endif /* GLIDE_PACKED_RGB */
while( *datalist != 0 ) {
TRI_SETF(FARRAY(v1, *datalist));
datalist++;
@@ -692,6 +740,25 @@ GR_ENTRY(grAADrawLine, void, (const GrVertex *v1, const GrVertex *v2))
TRI_SETF( v2->x );
TRI_SETF( v2->y );
#if GLIDE_PACKED_RGB
if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0) {
FxU32 packedColor = 0x00;
if (*datalist == (GR_VERTEX_R_OFFSET << 2)) {
packedColor = (RGBA_COMP_CLAMP(FARRAY(v2, (GR_VERTEX_B_OFFSET << 2)), B) |
RGBA_COMP_CLAMP(FARRAY(v2, (GR_VERTEX_G_OFFSET << 2)), G) |
RGBA_COMP_CLAMP(FARRAY(v2, (GR_VERTEX_R_OFFSET << 2)), R));
datalist++;
}
packedColor |= RGBA_COMP_CLAMP(FARRAY(v2, (GR_VERTEX_A_OFFSET << 2)), A);
datalist++;
TRI_SET(packedColor);
}
#endif /* GLIDE_PACKED_RGB */
while( *datalist != 0 ) {
TRI_SETF(FARRAY(v2, *datalist));
@@ -703,6 +770,25 @@ GR_ENTRY(grAADrawLine, void, (const GrVertex *v1, const GrVertex *v2))
TRI_SETF( v1->x );
TRI_SETF( v1->y );
#if GLIDE_PACKED_RGB
if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0) {
FxU32 packedColor = 0x00;
if (*datalist == (GR_VERTEX_R_OFFSET << 2)) {
packedColor = (RGBA_COMP_CLAMP(FARRAY(v1, (GR_VERTEX_B_OFFSET << 2)), B) |
RGBA_COMP_CLAMP(FARRAY(v1, (GR_VERTEX_G_OFFSET << 2)), G) |
RGBA_COMP_CLAMP(FARRAY(v1, (GR_VERTEX_R_OFFSET << 2)), R));
datalist++;
}
packedColor |= RGBA_COMP_CLAMP(FARRAY(v1, (GR_VERTEX_A_OFFSET << 2)), A);
datalist++;
TRI_SET(packedColor);
}
#endif /* GLIDE_PACKED_RGB */
while( *datalist != 0 ) {
TRI_SETF(FARRAY(v1, *datalist));
@@ -719,6 +805,27 @@ GR_ENTRY(grAADrawLine, void, (const GrVertex *v1, const GrVertex *v2))
v2->a = 0.0f;
datalist = gc->tsuDataList;
#if GLIDE_PACKED_RGB
if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0) {
FxU32 packedColor = 0x00;
if (*datalist == (GR_VERTEX_R_OFFSET << 2)) {
packedColor = (RGBA_COMP_CLAMP(FARRAY(v2, (GR_VERTEX_B_OFFSET << 2)), B) |
RGBA_COMP_CLAMP(FARRAY(v2, (GR_VERTEX_G_OFFSET << 2)), G) |
RGBA_COMP_CLAMP(FARRAY(v2, (GR_VERTEX_R_OFFSET << 2)), R));
datalist++;
}
/* Alpha set to 0.0 */
TRI_SET(packedColor);
/* Skip the actual alpha value in the data list */
datalist++;
}
#endif /* GLIDE_PACKED_RGB */
while( *datalist != 0 ) {
TRI_SETF(FARRAY(v2, *datalist));
datalist++;
@@ -736,6 +843,26 @@ GR_ENTRY(grAADrawLine, void, (const GrVertex *v1, const GrVertex *v2))
v1->a = 0.0f;
datalist = gc->tsuDataList;
#if GLIDE_PACKED_RGB
if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0) {
FxU32 packedColor = 0x00;
if (*datalist == (GR_VERTEX_R_OFFSET << 2)) {
packedColor = (RGBA_COMP_CLAMP(FARRAY(v1, (GR_VERTEX_B_OFFSET << 2)), B) |
RGBA_COMP_CLAMP(FARRAY(v1, (GR_VERTEX_G_OFFSET << 2)), G) |
RGBA_COMP_CLAMP(FARRAY(v1, (GR_VERTEX_R_OFFSET << 2)), R));
datalist++;
}
/* Alpha set to 0.0 */
TRI_SET(packedColor);
/* Skip the actual alpha value in the data list */
datalist++;
}
#endif /* GLIDE_PACKED_RGB */
while( *datalist != 0 ) {
TRI_SETF(FARRAY(v1, *datalist));

View File

@@ -17,8 +17,23 @@
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Header$
** $Log$
** Revision 1.4.2.4 2005/04/25 23:53:59 koolsmoky
** Fix grDrawTriangle calling convention for Linux.
** Thanks to Ozkan Sezer <sezeroz@gmail.com>.
**
** Revision 1.4.2.3 2005/04/23 18:27:26 koolsmoky
** fixed grDrawTriangle triangle dispatch code
**
** Revision 1.4.2.2 2005/01/22 14:52:01 koolsmoky
** enabled packed argb for cmd packet type 3
**
** Revision 1.4.2.1 2004/12/23 20:45:56 koolsmoky
** converted to nasm syntax
** added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations
**
** Revision 1.4 2000/01/28 20:52:17 joseph
** Changes to support building shared libraries with PIC support.
**
** Revision 1.3 2000/01/17 22:18:41 joseph
** A nicer, cleaner fix than the evil hack.
**
@@ -635,7 +650,10 @@ all_done: /* come here on degenerate lines */
/*---------------------------------------------------------------------------
** grDrawTriangle
*/
#ifndef HAVE_XDRAWTRI_ASM /* grDrawTriangle() not in asm */
#if defined(_MSC_VER) && !GLIDE_USE_C_TRISETUP && !defined(GLIDE_DEBUG)
__declspec(naked)
#endif
GR_ENTRY(grDrawTriangle, void, (const GrVertex *a, const GrVertex *b, const GrVertex *c))
{
#define FN_NAME grDrawTriangle
@@ -677,70 +695,22 @@ GR_ENTRY(grDrawTriangle, void, (const GrVertex *a, const GrVertex *b, const GrVe
all_done:
GR_END();
#else
#if defined(__MSC__)
{
extern struct _GlideRoot_s _GlideRoot;
_asm {
mov eax, [_GlideRoot + kCurGCOffset];
mov eax, [eax + kTriProcOffset];
#elif defined(_MSC_VER)
{
__asm {
mov edx, [_GlideRoot + kCurGCOffset];
mov eax, [edx + kTriProcOffset];
jmp eax;
}
}
#endif
#if defined( __linux__ )
/* Here's the basic strategy for this dispatch code:
* We jump to _GlideRoot.curGC->archDispatchProcs.triSetupProc
* which contains code that looks like a function, we leave the
* paramters passed to grDrawTriangle on the stack and the dispatched
* function picks them up. However we have to compensate for
* the compiler pushing anything on the stack. The following describes
* why and when we have to pop.
*
* BIG_OPT: gcc pushes a frame pointer to maintain things, BIG_OPT
* turns on -fomit-frame-pointer so we don't have to pop it.
*
* PIC: When using position independant code gcc stores eip in ebx
* so it saves ebx from the previous call automatically.
* Therefore, once we have the jump address we have to pop ebx
* to restore the stack.
*
* The syntax is further complicated by the fact that gcc can (and will)
* emit code between the asm statements, so they all need to be in a single
* asm statement, wrapped with #ifdef's. This means we have fun with
* deciding if we need to list trashed registers and when we need commas
* between them.
*/
asm (
#if defined(PIC)
"popl %%ebx\n\t"
#endif
#if !defined(BIG_OPT)
"popl %%ebp\n\t"
#endif
"jmp *%0"
: /* no outputs */
: "m" (_GlideRoot.curGC->cmdTransportInfo.triSetupProc)
#if defined (PIC) || !defined (BIG_OPT)
:
#endif
#if defined (PIC)
"ebx"
#endif
#if defined (PIC) && !defined (BIG_OPT)
,
#endif
#if !defined(BIG_OPT)
"ebp"
#endif
);
#endif
#else
#error "Write triangle proc dispatch for this compiler"
#endif
#undef FN_NAME
} /* grDrawTriangle */
#endif /* HAVE_XDRAWTRI_ASM */
/*---------------------------------------------------------------------------
** grDrawPlanarPolygon
@@ -885,25 +855,23 @@ __doPolyVertexSend:
const int* dataList = gc->tsuDataList;
#if GLIDE_PACKED_RGB
if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0)
{
FxBool doColorP = FXFALSE;
FxU32 packedColor = 0x00;
if (*dataList == (GR_VERTEX_R_OFFSET << 2)) {
packedColor = (RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_B_OFFSET << 2)), B) |
RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_G_OFFSET << 2)), G) |
RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_R_OFFSET << 2)), R));
doColorP = FXTRUE;
dataList++;
}
if (*dataList == (GR_VERTEX_A_OFFSET << 2)) {
packedColor |= RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_A_OFFSET << 2)), A);
doColorP = FXTRUE;
dataList++;
}
if (doColorP) TRI_SET(packedColor);
TRI_SET(packedColor);
}
#endif /* GLIDE_PACKED_RGB */
@@ -1007,37 +975,23 @@ __doPolyVertexSend:
const int* dataList = gc->tsuDataList;
#if GLIDE_PACKED_RGB
/* dpc - 10 feb 1998 -
* Some apps send color values outside of the range [0..255]
*/
#undef RGBA_COMP
#define RGBA_COMP(__fpVal, __fpBias, __fpShift, __fpMask) \
((_GlideRoot.pool.ftemp1 = (float)((float)(__fpVal) + (float)(__fpBias))), \
((((float)(__fpVal)) > 255.0f) \
? (__fpMask) \
: ((((float)(__fpVal)) < 0.0f) \
? 0x00UL \
: ((*(const FxU32*)&_GlideRoot.pool.ftemp1) & (__fpMask)))) << (__fpShift))
if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0)
{
FxBool doColorP = FXFALSE;
FxU32 packedColor = 0x00;
if (*dataList == (GR_VERTEX_R_OFFSET << 2)) {
packedColor = (RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_B_OFFSET << 2)), B) |
RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_G_OFFSET << 2)), G) |
RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_R_OFFSET << 2)), R));
doColorP = FXTRUE;
dataList++;
}
if (*dataList == (GR_VERTEX_A_OFFSET << 2)) {
packedColor |= RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_A_OFFSET << 2)), A);
doColorP = FXTRUE;
dataList++;
}
if (doColorP) TRI_SET(packedColor);
TRI_SET(packedColor);
}
#endif /* GLIDE_PACKED_RGB */

View File

@@ -19,6 +19,26 @@
**
** $Header$
** $Log$
** Revision 1.2.2.5 2005/01/22 14:52:02 koolsmoky
** enabled packed argb for cmd packet type 3
**
** Revision 1.2.2.4 2004/12/27 20:46:37 koolsmoky
** added dll entry point to call grGlideShutdown when a process is detached
**
** Revision 1.2.2.3 2004/12/23 21:03:14 koolsmoky
** swapinterval
**
** Revision 1.2.2.2 2004/12/23 20:45:56 koolsmoky
** converted to nasm syntax
** added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations
**
** Revision 1.2.2.1 2004/12/12 15:24:40 koolsmoky
** grDitherMode(): force 2x2 dithering for 4x1 dither
** grBufferSwap(): enable vsync and set swapbufferinterval to 0 for tripple buffering.
**
** Revision 1.2 2000/10/03 18:28:33 mercury
** 003-clean_up_cvg-000, cvg tree cleanup.
**
** Revision 1.1.1.1 1999/12/07 21:49:10 joseph
** Initial checkin into SourceForge.
**
@@ -781,6 +801,12 @@ GR_ENTRY(grBufferSwap, void, (int swapInterval))
/* if the interval is non-zero turn on VSYNC waiting */
vSync = (swapInterval > 0);
/* when triple buffering, vsync must be enabled and swapbuffer interval must be 0 */
/*if (gc->grColBuf >= 3) {
vSync = FXTRUE;
swapInterval = 0;
}*/
if (swapInterval > 0) swapInterval--;
@@ -1498,21 +1524,24 @@ GR_STATE_ENTRY(grDitherMode, void, (GrDitherMode_t mode))
GDBG_INFO_MORE(gc->myLevel, "(%d)\n", mode);
fbzMode = gc->state.fbi_config.fbzMode;
if (_GlideRoot.environment.disableDitherSub == FXTRUE)
fbzMode &= ~(SST_ENDITHER | SST_DITHER2x2);
else
fbzMode &= ~(SST_ENDITHER | SST_DITHER2x2 | SST_ENDITHERSUBTRACT);
fbzMode &= ~(SST_ENDITHER | SST_DITHER2x2 | SST_ENDITHERSUBTRACT);
switch (mode) {
case GR_DITHER_DISABLE:
break;
case GR_DITHER_2x2:
fbzMode |= (SST_ENDITHER | SST_DITHER2x2);
/* alpha dither subtract should be disabled */
break;
case GR_DITHER_2x2:
case GR_DITHER_4x4:
/* force 4x4 dither with alpha dither subtraction */
fbzMode |= (SST_ENDITHER | SST_ENDITHERSUBTRACT);
/* disable alpha blending dither subtraction according to user request */
if (_GlideRoot.environment.disableDitherSub == FXTRUE) {
/* without alpha dither subtraction, 2x2 dither looks better */
fbzMode |= SST_DITHER2x2;
fbzMode &= ~(SST_ENDITHERSUBTRACT);
}
break;
}
@@ -1704,9 +1733,9 @@ GR_ENTRY(grGlideShutdown, void, (void))
*/
for(i = 0; i < _GlideRoot.hwConfig.num_sst; i++) {
if (_GlideRoot.GCs[i].hwInitP) {
if (_GlideRoot.CPUType >= 6) {
/*if (_GlideRoot.CPUType.family >= 6) {*/
sst1InitCaching(_GlideRoot.GCs[i].base_ptr, FXFALSE);
}
/*}*/
sst1InitShutdown(_GlideRoot.GCs[i].base_ptr);
_GlideRoot.GCs[i].hwInitP = FXFALSE;
@@ -1718,6 +1747,8 @@ GR_ENTRY(grGlideShutdown, void, (void))
gc->grSstRez = GR_RESOLUTION_NONE;
gc->grSstRefresh = GR_REFRESH_NONE;
}
_GlideRoot.initialized = FXFALSE;
} /* grGlideShutdown */
@@ -2115,11 +2146,11 @@ _grUpdateTriPacketHdr(FxU32 paramMask,
? kSetupCullPositive
: kSetupCullNegative);
#if GLIDE_DISPATCH_SETUP
#define COLOR_COMP_ARGB ((SST_SETUP_RGB | SST_SETUP_A) << SSTCP_PKT3_PMASK_SHIFT)
#define COLOR_COMP_RGB (SST_SETUP_RGB << SSTCP_PKT3_PMASK_SHIFT)
#define COLOR_COMP_MASK COLOR_COMP_ARGB
#if GLIDE_DISPATCH_SETUP
/* Setup custom triangle/strip procs.
*
* NB: Currently this selection is based entirely on if
@@ -2127,30 +2158,51 @@ _grUpdateTriPacketHdr(FxU32 paramMask,
* select on cpu type as well to determine if we should
* do sw culling or not.
*/
if ((paramMask & SSTCP_PKT3_PACKEDCOLOR) == SSTCP_PKT3_PACKEDCOLOR) {
const FxU32 colorComp = paramMask & COLOR_COMP_MASK;
{
GrTriSetupProcVector* curTriProcVector = TRISETUP_NORGB;
switch(colorComp) {
case COLOR_COMP_ARGB:
gc->cmdTransportInfo.triSetupProc = TRISETUP_ARGB(cullMode);
break;
#if GLIDE_PACKED_RGB
if ((paramMask & SSTCP_PKT3_PACKEDCOLOR) == SSTCP_PKT3_PACKEDCOLOR) {
const FxU32 colorComp = paramMask & COLOR_COMP_MASK;
case COLOR_COMP_RGB:
gc->cmdTransportInfo.triSetupProc = TRISETUP_RGB(cullMode);
break;
switch(colorComp) {
case COLOR_COMP_ARGB:
curTriProcVector = TRISETUP_ARGB;
break;
/* If no rgb data then it is not worthwhile to pack
* just alpha so just mask off the packed color bit
* and just use the looping proc.
*/
default:
gc->cmdTransportInfo.triSetupProc = TRISETUP_NORGB(cullMode);
paramMask &= ~SSTCP_PKT3_PACKEDCOLOR;
break;
case COLOR_COMP_RGB:
curTriProcVector = TRISETUP_RGB;
break;
/* If no rgb data then it is not worthwhile to pack
* just alpha so just mask off the packed color bit
* and just use the looping proc.
*/
default:
curTriProcVector = TRISETUP_NORGB;
paramMask &= ~SSTCP_PKT3_PACKEDCOLOR;
break;
}
}
} else {
gc->cmdTransportInfo.triSetupProc = TRISETUP_NORGB(cullMode);
#endif
gc->curArchProcs.triSetupProc = PROC_SELECT_TRISETUP(*curTriProcVector, cullMode);
}
#else
#if GLIDE_PACKED_RGB
if ((paramMask & SSTCP_PKT3_PACKEDCOLOR) == SSTCP_PKT3_PACKEDCOLOR) {
const FxU32 colorComp = paramMask & COLOR_COMP_MASK;
switch(colorComp) {
case COLOR_COMP_ARGB:
case COLOR_COMP_RGB:
break;
default:
paramMask &= ~SSTCP_PKT3_PACKEDCOLOR;
break;
}
}
#endif
#endif /* GLIDE_DISPATCH_SETUP */
gc->cmdTransportInfo.paramMask = paramMask;

View File

@@ -19,6 +19,12 @@
**
** $Header$
** $Log$
** Revision 1.1.1.1.2.1 2004/12/12 15:29:44 koolsmoky
** cosmetics
**
** Revision 1.1.1.1 1999/12/07 21:49:10 joseph
** Initial checkin into SourceForge.
**
*/
#define OFFICIAL 1
@@ -26,7 +32,7 @@
#include <fxver.h>
#include "rcver.h"
#include "fxbldno.h"
//#include "fxbldno.h"
/////////////////////////////////////////////////////////////////////////////
//
@@ -56,11 +62,12 @@ BEGIN
VALUE "FileDescription", "3Dfx Interactive, Inc. Glide DLL\0"
VALUE "FileVersion", VERSIONSTR
VALUE "InternalName", VERSIONNAME
VALUE "LegalCopyright", "Copyright \251 3Dfx Interactive, Inc. 1997\0"
VALUE "LegalCopyright", "Copyright \251 3Dfx Interactive, Inc. 2004\0"
VALUE "OriginalFilename", VERSIONNAME
VALUE "ProductName", PRODNAME
VALUE "ProductVersion", VERSIONSTR
VALUE "Graphics Subsystem", HWSTR
VALUE "Contact", "The Glide Open Source Project http://glide.sourceforge.net/"
END
END
BLOCK "VarFileInfo"

View File

@@ -19,6 +19,33 @@
**
** $Header$
** $Log$
** Revision 1.1.1.1.2.7 2005/04/25 23:58:41 koolsmoky
** Fix _texDownloadProcs comma separator.
** Thanks to Ozkan Sezer <sezeroz@gmail.com>.
**
** Revision 1.1.1.1.2.6 2005/01/22 14:52:02 koolsmoky
** enabled packed argb for cmd packet type 3
**
** Revision 1.1.1.1.2.5 2005/01/13 16:09:05 koolsmoky
** Restict calls to pciOpen() pciClose() when compiled with DIRECTX option. this fixes problems with the win32 miniport opened in exclusive mode.
**
** Revision 1.1.1.1.2.4 2005/01/02 04:15:53 koolsmoky
** disabled mtrr's on sli slave devices
**
** Revision 1.1.1.1.2.3 2004/12/27 20:46:37 koolsmoky
** added dll entry point to call grGlideShutdown when a process is detached
**
** Revision 1.1.1.1.2.2 2004/12/23 20:45:56 koolsmoky
** converted to nasm syntax
** added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations
**
** Revision 1.1.1.1.2.1 2004/12/12 15:27:47 koolsmoky
** changes to support new cpuid
** set default to disable alpha dither subtraction
**
** Revision 1.1.1.1 1999/12/07 21:49:10 joseph
** Initial checkin into SourceForge.
**
**
** 110 6/30/98 6:08p Jeske
** fixed bug where we tried to setup MTRRs on old (<p6) systems which
@@ -226,6 +253,123 @@
#include <glide.h>
#include "fxglide.h"
#if GLIDE_DISPATCH_SETUP
/* Collection of all of the known procs for a given system */
#if GLIDE_PACKED_RGB
static GrTriSetupProc _triSetupProcs[][3][2] =
#else /* !GLIDE_PACKED_RGB */
static GrTriSetupProc _triSetupProcs[][1][2] =
#endif /* !GLIDE_PACKED_RGB */
{
/* Default Procs */
{
{_trisetup, _trisetup_cull}
#if GLIDE_PACKED_RGB
,{_trisetup_rgb, _trisetup_cull_rgb},
{_trisetup_argb, _trisetup_cull_argb}
#endif /* GLIDE_PACKED_RGB */
},
#if GL_AMD3D
/* 3DNow!(tm) Procs */
{
{_trisetup_3DNow, _trisetup_cull_3DNow}
#if GLIDE_PACKED_RGB
,{_trisetup_rgb_3DNow, _trisetup_cull_rgb_3DNow},
{_trisetup_argb_3DNow, _trisetup_cull_argb_3DNow}
#endif /* GLIDE_PACKED_RGB */
},
#endif /* GL_AMD3D */
};
#endif /* GLIDE_DISPATCH_SETUP */
#if GLIDE_DISPATCH_DOWNLOAD
static GrTexDownloadProc _texDownloadProcs[][2][4] =
{
/* Default Procs */
{
{
_grTexDownload_Default_8_1,
_grTexDownload_Default_8_2,
_grTexDownload_Default_8_4,
_grTexDownload_Default_8_WideS
},
{
_grTexDownload_Default_16_1,
_grTexDownload_Default_16_2,
_grTexDownload_Default_16_WideS,
_grTexDownload_Default_16_WideS
}
},
#if GL_AMD3D
{
{
_grTexDownload_Default_8_1,
_grTexDownload_Default_8_2,
_grTexDownload_Default_8_4,
_grTexDownload_3DNow_MMX,
},
{
_grTexDownload_Default_16_1,
_grTexDownload_Default_16_2,
_grTexDownload_3DNow_MMX,
_grTexDownload_3DNow_MMX,
}
},
#endif /* GL_AMD3D */
#if GL_MMX
{
{
_grTexDownload_Default_8_1,
_grTexDownload_Default_8_2,
_grTexDownload_Default_8_4,
_grTexDownload_MMX,
},
{
_grTexDownload_Default_16_1,
_grTexDownload_Default_16_2,
_grTexDownload_MMX,
_grTexDownload_MMX,
}
},
#endif /* GL_MMX */
};
#endif /* GLIDE_DISPATCH_DOWNLOAD */
#if (GLIDE_PLATFORM & GLIDE_OS_WIN32)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
BOOL WINAPI
DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
{
switch( ul_reason_for_call ) {
case DLL_PROCESS_DETACH:
GDBG_INFO(80, "DllMain: DLL_PROCESS_DETACH\n");
grGlideShutdown();
pciClose();
break;
case DLL_PROCESS_ATTACH:
if (!pciOpen()) {
GDBG_INFO(80, "pci bus could not be opened\n");
return FALSE;
}
GDBG_INFO(80, "DllMain: DLL_PROCESS_ATTACH\n");
break;
case DLL_THREAD_ATTACH:
GDBG_INFO(80, "DllMain: DLL_THREAD_ATTACH\n");
break;
case DLL_THREAD_DETACH:
GDBG_INFO(80, "DllMain: DLL_THREAD_DETACH\n");
break;
default:
GDBG_INFO(80, "DllMain: Unhandled message.\n");
break;
}
return TRUE;
} /* DllMain */
#endif
/*-------------------------------------------------------------------
Function: _grSstDetectResources
Date: --
@@ -324,7 +468,7 @@ _grSstDetectResources(void)
* pair then we don't want to waste mtrr's that we're never
* really going to write to.
*/
if (!inSliPairP && (_GlideRoot.CPUType >= 6)) {
if (!inSliPairP/* && (_GlideRoot.CPUType.family >= 6)*/) {
sst1InitCaching((FxU32*)devRegs, FXTRUE);
}
@@ -442,9 +586,9 @@ _grSstDetectResources(void)
#if GLIDE_INIT_HAL
fxHalShutdown(devRegs);
#else /* !GLIDE_INIT_HAL */
if (_GlideRoot.CPUType >= 6) {
/*if (_GlideRoot.CPUType.family >= 6) {*/
sst1InitCaching((FxU32*)devRegs, FXFALSE);
}
/*}*/
pciUnmapPhysical((FxU32)devRegs, 0x1000000UL);
#endif /* !GLIDE_INIT_HAL */
}
@@ -543,8 +687,55 @@ _GlideInitEnvironment(void)
}
#endif
_GlideRoot.CPUType = _cpu_detect_asm();
if (GETENV("FX_CPU")) _GlideRoot.CPUType = atoi(GETENV("FX_CPU"));
/* Get CPU Info */
_cpuid(&_GlideRoot.CPUType);
/* Check for vendor specific optimization cases */
GDBG_INFO( 0," CPU Vendor: %s\n", _GlideRoot.CPUType.v_name);
GDBG_INFO(80," MMX Support: %c\n", _GlideRoot.CPUType.os_support&_CPU_FEATURE_MMX ? 'Y' : 'N');
GDBG_INFO(80," SSE Support: %c\n", _GlideRoot.CPUType.os_support&_CPU_FEATURE_SSE ? 'Y' : 'N');
GDBG_INFO(80," SSE2 Support: %c\n", _GlideRoot.CPUType.os_support&_CPU_FEATURE_SSE2 ? 'Y' : 'N');
GDBG_INFO(80," 3DNow Support: %c\n", _GlideRoot.CPUType.os_support&_CPU_FEATURE_3DNOW ? 'Y' : 'N');
GDBG_INFO(80," MMX+ Support: %c\n", _GlideRoot.CPUType.os_support&_CPU_FEATURE_MMXPLUS ? 'Y' : 'N');
GDBG_INFO(80,"3DNow+ Support: %c\n", _GlideRoot.CPUType.os_support&_CPU_FEATURE_3DNOWPLUS ? 'Y' : 'N');
/* No CPU Extensions Allowed */
if (GETENV("FX_GLIDE_NO_CPU_EXTENSIONS"))
{
_GlideRoot.CPUType.feature = _GlideRoot.CPUType.os_support = 0;
GDBG_INFO(0,"CPU Extensions disabled\n");
}
#if GLIDE_DISPATCH_SETUP || GLIDE_DISPATCH_DOWNLOAD
/* Default case */
#if GLIDE_DISPATCH_SETUP
_GlideRoot.deviceArchProcs.curTriProcs = _triSetupProcs + 0;
#endif /* GLIDE_DISPATCH_SETUP */
#if GLIDE_DISPATCH_DOWNLOAD
_GlideRoot.deviceArchProcs.curTexProcs = _texDownloadProcs + 0;
#endif /* GLIDE_DISPATCH_DOWNLOAD */
/* Check for vendor specific optimization cases */
#ifdef GL_MMX
if (_GlideRoot.CPUType.os_support & _CPU_FEATURE_MMX) {
#if GLIDE_DISPATCH_DOWNLOAD
_GlideRoot.deviceArchProcs.curTexProcs = _texDownloadProcs + 2;
#endif /* GLIDE_DISPATCH_DOWNLOAD */
}
#endif /* GL_MMX */
#ifdef GL_AMD3D
if (_GlideRoot.CPUType.os_support & _CPU_FEATURE_3DNOW) {
#if GLIDE_DISPATCH_SETUP
_GlideRoot.deviceArchProcs.curTriProcs = _triSetupProcs + 1;
#endif /* GLIDE_DISPATCH_SETUP */
#if GLIDE_DISPATCH_DOWNLOAD
_GlideRoot.deviceArchProcs.curTexProcs = _texDownloadProcs + 1;
#endif /* GLIDE_DISPATCH_DOWNLOAD */
}
#endif /* GL_AMD3D */
#endif /* GLIDE_DISPATCH_SETUP || GLIDE_DISPATCH_DOWNLOAD */
/* Check for user environment tweaks */
{
@@ -557,7 +748,6 @@ _GlideInitEnvironment(void)
_GlideRoot.environment.noSplash = (GETENV("FX_GLIDE_NO_SPLASH") != NULL);
_GlideRoot.environment.shamelessPlug = (GETENV("FX_GLIDE_SHAMELESS_PLUG") != NULL);
_GlideRoot.environment.ignoreReopen = (GETENV("FX_GLIDE_IGNORE_REOPEN") != NULL);
_GlideRoot.environment.disableDitherSub = (GETENV("FX_GLIDE_NO_DITHER_SUB") != NULL);
_GlideRoot.environment.texLodDither = ((GETENV("FX_GLIDE_LOD_DITHER") == NULL)
? 0x00UL
: SST_TLODDITHER);
@@ -572,12 +762,25 @@ _GlideInitEnvironment(void)
}
_GlideRoot.environment.snapshot = GLIDE_GETENV("FX_SNAPSHOT", 0);
/* set default to disable alpha dither subtraction */
switch(GLIDE_GETENV("SSTH3_ALPHADITHERMODE", 1L)) {
default:
case 1: /* Or Automatic? */
case 2:
_GlideRoot.environment.disableDitherSub = FXTRUE;
break;
case 3:
_GlideRoot.environment.disableDitherSub = FXFALSE;
break;
}
GDBG_INFO(80," disableDitherSub: %d\n",_GlideRoot.environment.disableDitherSub);
GDBG_INFO(80," triBoundsCheck: %d\n",_GlideRoot.environment.triBoundsCheck);
GDBG_INFO(80," swapInterval: %d\n",_GlideRoot.environment.swapInterval);
GDBG_INFO(80," noSplash: %d\n",_GlideRoot.environment.noSplash);
GDBG_INFO(80," shamelessPlug: %d\n",_GlideRoot.environment.shamelessPlug);
GDBG_INFO(80," cpu: %d\n",_GlideRoot.CPUType);
/*GDBG_INFO(80," cpu: %d\n",_GlideRoot.CPUType);*/
GDBG_INFO(80," snapshot: %d\n",_GlideRoot.environment.snapshot);
GDBG_INFO(80," disableDitherSub: %d\n",_GlideRoot.environment.disableDitherSub);
}

View File

@@ -19,6 +19,19 @@
**
** $Header$
** $Log$
** Revision 1.2.2.3 2005/01/13 16:09:06 koolsmoky
** Restict calls to pciOpen() pciClose() when compiled with DIRECTX option. this fixes problems with the win32 miniport opened in exclusive mode.
**
** Revision 1.2.2.2 2004/12/23 20:45:56 koolsmoky
** converted to nasm syntax
** added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations
**
** Revision 1.2.2.1 2004/12/12 15:26:04 koolsmoky
** changes to support new cpuid
**
** Revision 1.2 2000/10/03 18:28:33 mercury
** 003-clean_up_cvg-000, cvg tree cleanup.
**
** Revision 1.1.1.1 1999/12/07 21:49:11 joseph
** Initial checkin into SourceForge.
**
@@ -330,6 +343,7 @@
#include <fxdll.h>
#include <glide.h>
#include "fxglide.h"
#include "fxsplash.h"
#if (GLIDE_PLATFORM & GLIDE_OS_WIN32)
#define WIN32_LEAN_AND_MEAN
@@ -468,12 +482,14 @@ __tryReOpen:
*/
if (!gc->hwInitP) {
FxU32* sstRegs = NULL;
#if !DIRECTX
rv = pciOpen();
if (!rv) {
GDBG_INFO(gc->myLevel, "%s: pci bus could not be opened\n", FN_NAME);
goto BAILOUT;
}
#endif
sstRegs = sst1InitMapBoard(_GlideRoot.current_sst);
rv = (sstRegs != NULL);
@@ -484,9 +500,9 @@ __tryReOpen:
}
/* Re-enabled write combining */
if (_GlideRoot.CPUType >= 6) {
/*if (_GlideRoot.CPUType.family >= 6) {*/
sst1InitCaching(sstRegs, FXTRUE);
}
/*}*/
rv = sst1InitRegisters(sstRegs);
if (!rv) {
@@ -877,10 +893,10 @@ __tryReOpen:
* NB: The order of the caching changes is relevant here since
* we don't want to waste mtrr's, even briefly.
*/
if (_GlideRoot.CPUType >= 6) {
/*if (_GlideRoot.CPUType.family >= 6) {*/
sst1InitCaching(gc->base_ptr, FXFALSE);
sst1InitCaching((gc + 1)->base_ptr, FXTRUE);
}
/*}*/
sst1InitShutdown(gc->base_ptr);
@@ -901,12 +917,14 @@ __tryReOpen:
gc->hwInitP = FXFALSE;
}
#if !DIRECTX
/* dpc - 14 feb 1997 - HackAlert!!!!
* The sst1InitShutdown above will close the pci library which
* then prevents other pci library calls which we need to init
* video next.
*/
pciOpen();
#endif
/* Re-init the new master */
{
@@ -974,10 +992,10 @@ __tryReOpen:
* NB: The order of the caching changes is relevant here since
* we don't want to waste mtrr's, even briefly.
*/
if (_GlideRoot.CPUType >= 6) {
/*if (_GlideRoot.CPUType.family >= 6) {*/
sst1InitCaching(gc->slave_ptr, FXFALSE);
sst1InitCaching(gc->base_ptr, FXTRUE);
}
/*}*/
}
/* Save that we swapped teh master sense so that we can
@@ -1335,9 +1353,9 @@ __errSliExit:
* This is currently being done in _grDetectResources so that we
* can match the nt driver semantics in win95.
*/
if (_GlideRoot.CPUType >= 6) {
/*if (_GlideRoot.CPUType.family >= 6) {*/
sst1InitCaching(gc->reg_ptr, FXTRUE);
}
/*}*/
#endif /* !GLIDE_INIT_HAL */
#else
#error "Need to write command transport init for glide for this hw"
@@ -1555,13 +1573,53 @@ __errSliExit:
if (!_GlideRoot.environment.noSplash) {
HMODULE newSplash;
if (newSplash = LoadLibrary("3dfxsplash2.dll")) {
FARPROC fxSplash;
if (newSplash = LoadLibrary("3dfxspl2.dll")) {
GrState glideState;
FxBool didLoad;
GrSplashProc fxSplash;
GrSplashInitProc fxSplashInit;
GrSplashPlugProc fxSplashPlug;
GrSplashShutdownProc fxSplashShutdown;
if (fxSplash = GetProcAddress(newSplash, "_fxSplash@16")) {
fxSplash(hWnd, gc->state.screen_width, gc->state.screen_height, nAuxBuffers);
_GlideRoot.environment.noSplash = 1;
}
fxSplash = (GrSplashProc)GetProcAddress(newSplash, "_fxSplash@20");
fxSplashInit = (GrSplashInitProc)GetProcAddress(newSplash, "_fxSplashInit@24");
fxSplashPlug = (GrSplashPlugProc)GetProcAddress(newSplash, "_fxSplashPlug@16");
fxSplashShutdown = (GrSplashShutdownProc)GetProcAddress(newSplash, "_fxSplashShutdown@0");
didLoad = ((fxSplash != NULL) &&
(fxSplashInit != NULL) &&
(fxSplashPlug != NULL) &&
(fxSplashShutdown != NULL));
if (didLoad & 0/* [dBorca] i am evil! harr-harr */) {
/* new style DLL */
grGlideGetState(&glideState);
didLoad = fxSplashInit(hWnd,
gc->state.screen_width, gc->state.screen_height,
nColBuffers, nAuxBuffers,
format);
if (didLoad) {
fxSplash(0.0f, 0.0f,
(float)gc->state.screen_width,
(float)gc->state.screen_height,
0);
fxSplashShutdown();
_GlideRoot.environment.noSplash = 1;
}
grGlideSetState((const void*)&glideState);
} else {
/* old style DLL */
typedef int (FX_CALL *GrSplashOld) (FxU32 hWind, FxU32 scrWidth, FxU32 scrHeight, FxU32 nAuxBuffers);
GrSplashOld fxSplashOld = (GrSplashOld)GetProcAddress(newSplash, "_fxSplash@16");
if (fxSplashOld) {
grGlideGetState(&glideState);
fxSplashOld(hWnd, gc->state.screen_width, gc->state.screen_height, nAuxBuffers);
_GlideRoot.environment.noSplash = 1;
grGlideSetState((const void*)&glideState);
}
}
FreeLibrary(newSplash);
}
}
#endif /* (GLIDE_PLATFORM & GLIDE_OS_WIN32) */
@@ -1679,9 +1737,9 @@ GR_ENTRY(grSstWinClose, void, (void))
* track of the mtrr's.
*/
sst1InitIdle(gc->reg_ptr);
if (_GlideRoot.CPUType >= 6) {
/*if (_GlideRoot.CPUType.family >= 6) {*/
sst1InitCaching(gc->base_ptr, FXFALSE);
}
/*}*/
sst1InitShutdown(gc->reg_ptr);
#endif /* !GLIDE_INIT_HAL */

View File

@@ -19,6 +19,16 @@
**
** $Header$
** $Log$
** Revision 1.2.2.2 2005/01/22 14:52:02 koolsmoky
** enabled packed argb for cmd packet type 3
**
** Revision 1.2.2.1 2004/12/23 20:45:56 koolsmoky
** converted to nasm syntax
** added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations
**
** Revision 1.2 2000/10/03 18:28:33 mercury
** 003-clean_up_cvg-000, cvg tree cleanup.
**
** Revision 1.1.1.1 1999/12/07 21:49:11 joseph
** Initial checkin into SourceForge.
**
@@ -391,7 +401,9 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
{
const FifoChipField chipId = (FifoChipField)(0x02UL << tmu);
FxI32 sh;
#if !GLIDE_DISPATCH_DOWNLOAD
FxU32 max_s, width, tmu_baseaddress;
#endif
#define FN_NAME "grTexDownloadMipMapLevelPartial"
GR_BEGIN_NOFIFOCHECK(FN_NAME, 89);
@@ -477,6 +489,63 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
REG_GROUP_END();
}
#if GLIDE_DISPATCH_DOWNLOAD
/* Do the download */
{
const FxU32
width = _grMipMapHostWH[aspectRatio][thisLod][0],
formatSel = (format >= GR_TEXFMT_16BIT),
tmuBaseAddr = ((FxU32)gc->tex_ptr +
(((FxU32)tmu) << 21UL) +
(((FxU32)thisLod) << 17UL));
FxU32
widthSel = (width >> 0x01UL),
max_s = width >> (formatSel
? 1 /* 16-bit texture */
: 2); /* 8-bit texture */
if (max_s <= 0) max_s = 1;
if (widthSel > 2) widthSel = 3;
_GlideRoot.stats.texBytes += max_s * (max_t - t + 1) * 4;
if ((sh == 3) && !formatSel && (width > 4)) {
/* 8-bit >4xN texture with Old revision TMUs (GR_SSTTYPE_VOODOO) */
const FxU8* src8 = (const FxU8*)data;
/* Compute Physical Write Pointer */
const FxU32
tmu_baseaddress = (FxU32)gc->tex_ptr +
(((FxU32)tmu) << 21) + (((FxU32)thisLod) << 17);
for (; t <= max_t; t++) {
FxU32
s,
tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t);
LINEAR_WRITE_BEGIN(max_s, kLinearWriteTex,
(FxU32)tex_address - (FxU32)gc->tex_ptr,
0x00UL, 0x00UL);
for (s = 0; s < max_s; s+=2) {
const FxU32 t0 = *(const FxU32*)(src8 );
const FxU32 t1 = *(const FxU32*)(src8 + sizeof(FxU32));
LINEAR_WRITE_SET_8(tex_address , t0);
LINEAR_WRITE_SET_8(tex_address + sizeof(FxU32), t1);
tex_address += 16;
src8 += (sizeof(FxU32) << 1);
}
LINEAR_WRITE_END();
}
} else {
/* GR_SSTTYPE_Voodoo2 all go through here */
(*((*_GlideRoot.deviceArchProcs.curTexProcs)[formatSel][widthSel]))(gc,
tmuBaseAddr,
max_s, t, max_t,
data);
}
}
#else
/*------------------------------------------------------------
Determine max_s
------------------------------------------------------------*/
@@ -499,7 +568,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
------------------------------------------------------------*/
if (format < GR_TEXFMT_16BIT) { /* 8 bit textures */
/* Hoisted initialization */
FxU32 tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t, thisLod);
FxU32 tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t);
const FxU8* src8 = (const FxU8*)data;
switch(width) {
@@ -512,7 +581,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
LINEAR_WRITE_END();
src8 += width;
tex_address += TEX_ROW_ADDR_INCR(1, thisLod);
tex_address += TEX_ROW_ADDR_INCR(1);
}
break;
@@ -525,7 +594,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
LINEAR_WRITE_END();
src8 += width;
tex_address += TEX_ROW_ADDR_INCR(1, thisLod);
tex_address += TEX_ROW_ADDR_INCR(1);
}
break;
@@ -538,7 +607,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
LINEAR_WRITE_END();
src8 += width;
tex_address += TEX_ROW_ADDR_INCR(1, thisLod);
tex_address += TEX_ROW_ADDR_INCR(1);
}
break;
@@ -550,7 +619,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
for (; t <= max_t; t++) {
FxU32 s;
tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t, thisLod);
tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t);
LINEAR_WRITE_BEGIN(max_s, kLinearWriteTex,
(FxU32)tex_address - (FxU32)gc->tex_ptr,
@@ -572,7 +641,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
}
} else { /* 16-bit Textures */
/* Hoisted initialization */
FxU32 tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t, thisLod);
FxU32 tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t);
const FxU16* src16 = (const FxU16*)data;
/* Cases 1, 2 don't need inner loops for s */
@@ -586,7 +655,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
LINEAR_WRITE_END();
src16 += width;
tex_address += TEX_ROW_ADDR_INCR(1, thisLod);
tex_address += TEX_ROW_ADDR_INCR(1);
}
break;
@@ -599,7 +668,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
LINEAR_WRITE_END();
src16 += width;
tex_address += TEX_ROW_ADDR_INCR(1, thisLod);
tex_address += TEX_ROW_ADDR_INCR(1);
}
break;
@@ -607,7 +676,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
for (; t <= max_t; t++) {
FxU32 s;
tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t, thisLod);
tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t);
/* Loop unrolled to process 2 dwords per iteration */
LINEAR_WRITE_BEGIN(max_s, kLinearWriteTex,
@@ -632,6 +701,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
break;
}
}
#endif
/*------------------------------------------------------------
Restore TLOD, texMode, baseAddress
@@ -771,7 +841,7 @@ GR_ENTRY(ConvertAndDownloadRle,
rle_line_end=rle_line+width+u0;
for(t=0;t<max_t;t++) {
tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t, thisLod);
tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t);
src = rle_line + u0;
rle_decode_line_asm(tlut,&bm_data[offset],rle_line);
@@ -789,7 +859,7 @@ GR_ENTRY(ConvertAndDownloadRle,
}
if (dest_height>height) {
tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t, thisLod);
tex_address = tmu_baseaddress + TEX_ROW_ADDR_INCR(t);
src=rle_line+u0;
LINEAR_WRITE_BEGIN(max_s, kLinearWriteTex,

View File

@@ -19,6 +19,12 @@
**
** $Header$
** $Log$
** Revision 1.1.1.1.2.1 2005/01/22 14:52:02 koolsmoky
** enabled packed argb for cmd packet type 3
**
** Revision 1.1.1.1 1999/12/07 21:49:11 joseph
** Initial checkin into SourceForge.
**
*
* 12 12/15/97 5:52p Atai
* disable obsolete glide2 api for glide3

View File

@@ -19,6 +19,12 @@
**
** $Header$
** $Log$
** Revision 1.1.1.1.2.1 2005/01/22 14:52:02 koolsmoky
** enabled packed argb for cmd packet type 3
**
** Revision 1.1.1.1 1999/12/07 21:49:11 joseph
** Initial checkin into SourceForge.
**
**
** 61 3/17/98 3:00p Peter
** removed vertex sorting
@@ -250,6 +256,7 @@ GR_DDFUNC(_trisetup_nogradients,
const int* dataList = gc->tsuDataList;
#if GLIDE_PACKED_RGB
if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0)
{
FxBool doColorP = FXFALSE;
FxU32 packedColor = 0x00;
@@ -374,10 +381,10 @@ GR_DDFUNC(_trisetup_nogradients,
if (hasColor || hasAlpha) {
FxU32 packedVal = 0x00;
if (hasColor) packedVal = ((RGBA_COMP_CLAMP(curVertex->b) << 0UL) |
(RGBA_COMP_CLAMP(curVertex->g) << 8UL) |
(RGBA_COMP_CLAMP(curVertex->r) << 16UL));
if (hasAlpha) packedVal |= (RGBA_COMP_CLAMP(curVertex->a) << 24UL);
if (hasColor) packedVal = ((RGBA_COMP_CLAMP(curVertex->b, B) << 0UL) |
(RGBA_COMP_CLAMP(curVertex->g, G) << 8UL) |
(RGBA_COMP_CLAMP(curVertex->r, R) << 16UL));
if (hasAlpha) packedVal |= (RGBA_COMP_CLAMP(curVertex->a, A) << 24UL);
REG_GROUP_SET(hw, sARGB, packedVal);
}

View File

@@ -20,7 +20,7 @@
TAG_REGEXP = $(BUILD_ROOT)\$(FX_GLIDE_HW)\glide\src\glide.rx
# Compile for specific hardware
!if "$(FX_GLIDE_HW)" == "CVG"
!if "$(FX_GLIDE_HW)" == "cvg"
FX_GLIDE_REAL_HW= 1
!if "$(FX_GLIDE_CTRISETUP)" == ""
@@ -32,7 +32,7 @@ LCDEFS = $(LCDEFS) -DCVG \
-DGLIDE_CHIP_BROADCAST=1 -DGLIDE_DEFAULT_GAMMA=1.3f
LCDEFS = $(LCDEFS) \
-DGLIDE_BLIT_CLEAR=1 \
!else if "$(FX_GLIDE_HW)" == "H3"
!else if "$(FX_GLIDE_HW)" == "h3"
FX_GLIDE_REAL_HW= 1
FX_GLIDE_NO_FIFO= 1
FX_GLIDE_CTRISETUP = 1
@@ -40,7 +40,7 @@ HWSPEC = fifo.c
LCDEFS = $(LCDEFS) -DH3 \
-DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKET3_TRI_SETUP=0
!else
!error "FX_GLIDE_HW == unknown value (H3|CVG)"
!error "FX_GLIDE_HW == unknown value (h3|cvg)"
!endif

View File

@@ -1,263 +1,335 @@
# Linux makefile for Glide2/CVG
# This makefile MUST be processed by GNU make!!!
#
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
#
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
# THE UNITED STATES.
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
TAG_REGEXP = $(BUILD_ROOT)/$(FX_GLIDE_HW)/glide/src/glide.rx
# Compile for specific hardware
ifeq ($(FX_GLIDE_HW),cvg)
FX_GLIDE_REAL_HW= 1
FX_GLIDE_CTRISETUP = 0
HWSPEC = fifo.c
LCDEFS += -DCVG \
-DGLIDE_CHIP_BROADCAST=1 -DGLIDE_DEFAULT_GAMMA=1.3 \
-DGLIDE_BLIT_CLEAR=1
else
ifeq ($(FX_GLIDE_HW),H3)
FX_GLIDE_REAL_HW= 1
FX_GLIDE_NO_FIFO= 1
FX_GLIDE_CTRISETUP = 1
HWSPEC = fifo.c
LCDEFS += -DH3 \
-DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKET3_TRI_SETUP=0
else
error "FX_GLIDE_HW == unknown value (H3|CVG)"
endif
endif
ifeq ($(DEBUG),1)
DBGOPTS = -DGLIDE_DEBUG -DGDBG_INFO_ON
GLIDE_SANITY_ALL = 1
endif
ifeq ($(FX_GLIDE_HW),)
error "FX_GLIDE_HW not defined"
endif
# Display Options
DSPOPTS =
SUBLIBRARIES =
ifeq ($(HAL_HW),1)
DSPOPTS += -DHAL_HW=1
SUBLIBRARIES += $(BUILD_ROOT)/$(FX_GLIDE_HW)/lib/libsst1init.a \
$(BUILD_ROOT_SWLIBS)/lib/libfxmisc.a \
$(BUILD_ROOT_SWLIBS)/lib/libfxpci.a
endif
ifeq ($(DSPOPTS),)
error "Unknown HAL_* configuration"
endif
# GLIDE_HW_TRI_SETUP: Use the hw TSU for triangle rendering.
# GLIDE_TRI_CULLING: Cull backfaced/zero area triangles in sw before the fifo.
# NB: This must be set if GLIDE_HW_TRI_SETUP=0
ifeq ($(FX_GLIDE_SW_SETUP),1)
LCDEFS += -DGLIDE_HW_TRI_SETUP=0 -DGLIDE_TRI_CULLING=1
FX_GLIDE_CTRISETUP = 1
else
# Do culling test in sw for independent triangles
CULL_MODE = -DGLIDE_TRI_CULLING=0
ifeq ($(FX_GLIDE_HW_CULL),1)
CULL_MODE = -DGLIDE_TRI_CULLING=1
endif
DSPOPTS += $(CULL_MODE)
# Send a single DWORD ARGB rather than 4 fp values, at
# the cost of doing the conversion.
ifeq ($(FX_GLIDE_PACK_RGB),1)
LCDEFS += -DGLIDE_PACKED_RGB=1
endif
endif
ifneq ($(FX_GLIDE_NO_FIFO),1)
FIFODEFS = -DUSE_PACKET_FIFO=1 \
-DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKET3_TRI_SETUP=1
ifeq ($(FX_GLIDE_DEBUG_FIFO),1)
# GLIDE_USE_DEBUG_FIFO: Run w/ the small fifo to cause me/glide more stress
# FIFO_ASSERT_FULL: Check hw depth/fifo a lot (slow)
LCDEFS += -DGLIDE_USE_DEBUG_FIFO=1 -DFIFO_ASSERT_FULL=1 \
-DASSERT_FAULT=0 #-DGLIDE_SANITY_SIZE=1
endif
else
FX_GLIDE_CTRISETUP = 1
FIFODEFS = -DGLIDE_HW_TRI_SETUP=1
endif
# Optimization Options
# This is for turning on and off algorithmic optimizations,
# not flags to the C compiler. Usually this involves
# enabling/disabling assembly language code, but it can also
# change the way C code works, or how C code generates data to be
# used by various pieces of code.
# Usually these are set with environment variables or arguments to
# nmake.
# $Id$
#
# Copyright (c) 2004 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# Copyright (c) 2004 - Hiroshi Morii
# Email : koolsmoky@users.sourceforge.net
# Web : http://www.3dfxzone.it/koolsmoky
#
# Copyright (c) 2006 - Guillem Jover <guillem@hadrons.org>
#
# Turn on/off assembly language trisetup code.
# (C on is Assembly off) (A ssembly T ri S etup OPTS)
ifeq ($(FX_GLIDE_CTRISETUP),1)
ASMTRISETUP =
ATSOPTS = -DGLIDE_USE_C_TRISETUP
CFILES = gxdraw.c
else
ASMTRISETUP = xdraw2.S
DSPOPTS += -DGLIDE_DISPATCH_SETUP=1 -DGLIDE_PACKED_RGB=0
endif
OPTOPTS = $(GRMOPTS) $(OTSOPTS) $(ATSOPTS)
# local defines, begin with basics and then add on
LCDEFS += -DGLIDE_LIB
ifeq ($(FX_GLIDE_CRYBABY),1)
LCDEFS += -DGLIDE_CHECK_COMPATABILITY=1
endif
# Turn Off/On compilation of shameless plug
ifeq ($(FX_GLIDE_NO_PLUG),1)
else
LCDEFS += -DGLIDE_PLUG
endif
# Turn Off/On splash screen
ifeq ($(FX_GLIDE_NO_SPLASH),1)
else
LCDEFS += -DGLIDE_SPLASH
endif
#Glide 3 Stuff, for migration all
ifneq ($(FX_GLIDE3),)
LCDEFS += -DGLIDE3
GLIDE3FILES = gstrip.c distrip.c distate.c diget.c
endif
#Glide 3. remove migration stuff
ifneq ($(FX_GLIDE3_ALPHA),)
LCDEFS += -DGLIDE3_ALPHA
GLIDE3FILES = gstrip.c distrip.c distate.c diget.c
endif
ifneq ($(GLIDE_SANITY_ALL)$(GLIDE_SANITY_SIZE),)
LCDEFS += -DGLIDE_SANITY_SIZE
endif
ifneq ($(GLIDE_SANITY_ALL)$(GLIDE_SANITY_ASSERT),)
LCDEFS += -DGLIDE_SANITY_ASSERT
endif
# Local Defs, Includes, and Options (C)
LCINCS += -I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include
LCOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
# Local Defs, Includes, and Options (ASM)
LADEFS += $(ASM_REGMAP_DEFS)
LAINCS = -I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include
LAOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
AFILES = $(ASMTRISETUP)
# sources
HEADERS = glide.h gump.h glidesys.h glideutl.h
PRIVATE_HEADERS = fxglide.h gsstdef.h fxinline.h
INSTALL_DESTINATION = $(BUILD_ROOT)/$(FX_GLIDE_HW)
CFILES += gsplash.c g3df.c gu.c guclip.c gpci.c gump.c\
diglide.c disst.c ditex.c gbanner.c gerror.c\
gmovie.c digutex.c ddgump.c gaa.c gdraw.c\
gglide.c glfb.c gsst.c gtex.c gtexdl.c\
gutex.c $(HWSPEC) $(GLIDE3FILES) \
cpudetect.c
OFILES = $(CFILES:.c=.o)
OTHER_CFILES = fxgasm.c fxbldno.c fxinline.h
CODFILES = $(CFILES:.c=.cod)
# targets
LDIRT = fxgasm.o fxgasm fxgasm.h fxinline.h fxbldno.o fxbldno fxbldno.h
ifeq ($(FX_GLIDE3),1)
LIBRARIES = libglide3.a
SHARED_LIBRARY = libglide3.so.3.01
else
LIBRARIES = libglide.a
SHARED_LIBRARY = libglide.so.2.53
endif
RCFILE = glide.rc
# Make a static link library for things like the diags.
ifeq ($(FX_DLL_BUILD),1)
FX_DLL_LIBRARY = 1
else
LCDEFS += -DFX_STATIC_BUILD
endif
LCDEFS += $(FIFODEFS)
include $(BUILD_ROOT)/swlibs/include/make/3dfx.mak
codfiles: $(CODFILES)
ctags: $(CFILES)
ctags $(CFILES)
gbanner.o : banner.inc
gsplash.o : splshdat.c
#--------------------------------------------------------------------------
# special rules for making FXGASM.H
#
fxgasm: fxgasm.c $(HEADERS) gsstdef.h fxglide.h
$(CC) -o $@ fxgasm.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) \
-I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include -I$(BUILD_ROOT)/swlibs/include $(LDFLAGS)
# 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.
# default = no
# USE_X86=1 use assembler triangle specializations; req by CVG
# default = yes
# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU
# capabilities are still checked at run-time to avoid
# crashes.
# default = no
# USE_MMX=1 allow MMX specializations.
# default = no
# FXOEM2X=1 build fxoem2x.so
# default = no
#
# Targets:
# all: build everything
# glide2x: build Glide2x lib
# clean: remove object files
# realclean: remove all generated files
#
.PHONY: all glide2x clean realclean
.INTERMEDIATE: fxgasm
.SUFFIXES: .lo
export PATH := $(PATH):.
###############################################################################
# general defines (user settable?)
###############################################################################
GLIDE_VERSION_MAJOR = 2
GLIDE_VERSION_MINOR = 53
GLIDE_LIB = libglide.a
GLIDE_SO = libglide.so
GLIDE_SONAME = $(GLIDE_SO).$(GLIDE_VERSION_MAJOR)
GLIDE_SHARED = $(GLIDE_SONAME).$(GLIDE_VERSION_MINOR)
FX_GLIDE_HW ?= cvg
FX_GLIDE_SW = ../../../swlibs
GLIDE_LIBDIR = ../../lib
###############################################################################
# tools
###############################################################################
CC = gcc
AS = nasm
AR = ar
CP = cp
###############################################################################
# defines
###############################################################################
# platform
CDEFS = -DINIT_LINUX -D__3Dfx_PCI_CFG__
LDLIBS = -lm
# general
CDEFS += -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKED_RGB=0 -DGLIDE_TRI_CULLING=1 -DGLIDE_DEFAULT_GAMMA=1.3f -DGLIDE_LIB=1
#CDEFS += -DGLIDE3 -DGLIDE3_ALPHA -DGLIDE3_SCALER
# special sli buffer clears
CDEFS += -DGLIDE_BLIT_CLEAR=1
# workaround for CVGs with broken tsus which cannot send commands to multiple
# tmus using chipfield. chipfield will always be set to 0xf
CDEFS += -DGLIDE_CHIP_BROADCAST=1
# subsystem
CDEFS += -DCVG
# debug
ifdef DEBUG
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
endif
override USE_FIFO = 1
#override USE_X86 = 1
ifeq ($(USE_X86),1)
CDEFS += -DGLIDE_DISPATCH_SETUP=1 -DGLIDE_DISPATCH_DOWNLOAD=1
override USE_FIFO = 1
CDEFS += -DHAVE_XDRAWTRI_ASM=1
override USE_DRAWTRI_ASM = 1
else
CDEFS += -DGLIDE_USE_C_TRISETUP=1
endif
# fifo
ifeq ($(USE_FIFO),1)
CDEFS += -DUSE_PACKET_FIFO=1 -DGLIDE_PACKET3_TRI_SETUP=1
endif
# other
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
###############################################################################
# flags
###############################################################################
# librarian
ARFLAGS = rus
# assembler
ASFLAGS = -O6 -felf -D__linux__
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -Wall -W
CFLAGS += -I. -I../../incsrc -I../../init
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += $(CDEFS)
# cpu optimized triangle
ifeq ($(USE_MMX),1)
CFLAGS += -DGL_MMX
override USE_X86 = 1
endif
ifeq ($(USE_3DNOW),1)
CFLAGS += -DGL_AMD3D
override USE_X86 = 1
endif
ifeq ($(USE_X86),1)
CFLAGS += -DGL_X86 -DBIG_OPT
OPTFLAGS ?= -O6 -march=pentium2 -mtune=pentium3 -fomit-frame-pointer -funroll-loops \
-fexpensive-optimizations -ffast-math -Wno-unused
else
CFLAGS += -DGLIDE_USE_C_TRISETUP
OPTFLAGS ?= -O6 -march=pentium2 -mtune=pentium3 -ffast-math -Wno-unused
endif
# optflags
CFLAGS += $(OPTFLAGS)
###############################################################################
# objects
###############################################################################
GLIDE_OBJECTS = \
fifo.o \
gsplash.o \
g3df.o \
gu.o \
guclip.o \
gpci.o \
gump.o \
diglide.o \
disst.o \
ditex.o \
gbanner.o \
gerror.o \
gmovie.o \
digutex.o \
ddgump.o \
gaa.o \
gdraw.o \
gglide.o \
glfb.o \
gsst.o \
gtex.o \
gtexdl.o \
gutex.o \
cpuid.o \
fpu.o \
xtexdl_def.o
ifeq ($(USE_DRAWTRI_ASM),1)
GLIDE_OBJECTS += xdrawtri.o
endif
ifeq ($(USE_X86),1)
GLIDE_OBJECTS += \
xdraw2_def.o
ifeq ($(USE_MMX),1)
GLIDE_OBJECTS += \
xtexdl_mmx.o
endif
ifeq ($(USE_3DNOW),1)
GLIDE_OBJECTS += \
xdraw2_3dnow.o \
xtexdl_3dnow.o
endif
else
GLIDE_OBJECTS += \
gxdraw.o
endif
GLIDE_OBJECTS += \
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxlinux.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxmsr.o \
../../init/canopus.o \
../../init/dac.o \
../../init/gamma.o \
../../init/gdebug.o \
../../init/info.o \
../../init/parse.o \
../../init/print.o \
../../init/sli.o \
../../init/sst1init.o \
../../init/util.o \
../../init/video.o
# FIXME: needed for now to match the old library signature, should be checked
# if it's really needed.
GLIDE_OBJECTS += \
$(FX_GLIDE_SW)/fxmisc/fxos.o \
$(FX_GLIDE_SW)/fxmisc/fximg.o
###############################################################################
# rules
###############################################################################
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
.c.lo:
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -c $<
###############################################################################
# main
###############################################################################
all: glide2x fxoem2x
glide2x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO)
$(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS)
$(AR) $(ARFLAGS) $@ $^
$(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_LIBDIR)/$(GLIDE_SHARED)
ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO)
$(GLIDE_LIBDIR)/$(GLIDE_SHARED): $(GLIDE_OBJECTS:.o=.lo)
$(CC) -o $@ -shared -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS)
ifeq ($(FXOEM2X),1)
$(GLIDE_LIBDIR)/libfxoem2x.so: ../oem/oeminit.o
# $(LD) -o $@ $(LDFLAGS) ../oem/oeminit.o $(LDLIBS)
else
$(GLIDE_LIBDIR)/libfxoem2x.so:
# $(warning FxOem2x not enabled... Skipping libfxoem2x.so)
endif
fxoem2x: $(GLIDE_LIBDIR)/libfxoem2x.so
###############################################################################
# rules(2)
###############################################################################
#cpuid.o: cpudtect.asm
# $(AS) -o $@ $(ASFLAGS) $<
xdraw2_def.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) $<
xtexdl_def.o: xtexdl.c
$(CC) -o $@ $(CFLAGS) -c $<
xtexdl_mmx.o: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_MMX=1 $<
xdraw2_3dnow.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xtexdl_3dnow.o: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xdrawtri.o: xdrawtri.asm
$(AS) -o $@ $(ASFLAGS) $<
#cpuid.lo: cpuid.o
# $(CP) $< $@
xdraw2_def.lo: xdraw2_def.o
$(CP) $< $@
xtexdl_def.lo: xtexdl_def.o
$(CP) $< $@
xtexdl_mmx.lo: xtexdl_mmx.o
$(CP) $< $@
xdraw2_3dnow.lo: xdraw2_3dnow.o
$(CP) $< $@
xtexdl_3dnow.lo: xtexdl_3dnow.o
$(CP) $< $@
xdrawtri.lo: xdrawtri.o
$(CP) $< $@
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
fxinline.h: fxgasm
./$< -inline > $@
fxgasm.h: fxgasm
./fxgasm > fxgasm.h
fxinline.h: fxgasm
./fxgasm -inline > fxinline.h
./$< -hex > $@
#--------------------------------------------------------------------------
# special rules for making FXBLDNO.H
#
fxgasm: fxgasm.c
$(CC) -o $@ $(CFLAGS) $<
fxbldno: fxbldno.c $(HEADERS) $(PRIVATE_HEADERS)
$(CC) -o $@ fxbldno.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) $(LDFLAGS)
###############################################################################
# clean, realclean
###############################################################################
fxbldno.h: fxbldno.exe
fxbldno > fxbldno.h
clean:
-$(RM) *.o *.lo
-$(RM) ../../init/*.o ../../init/*.lo
-$(RM) $(FX_GLIDE_SW)/newpci/pcilib/*.o $(FX_GLIDE_SW)/newpci/pcilib/*.lo
-$(RM) fxinline.h
-$(RM) fxgasm.h
glide.res: rcver.h fxbldno.h
gglide.obj: rcver.h
ifeq ($(FX_GLIDE_CTRISETUP),1)
gdraw.o: fxinline.h
endif
xdraw2.o : xdraw2.S xdraw2.inc.S fxgasm.h fxinline.h
gasp xdraw2.S $(ASM_OPTS) $(LAOPTS) | as -V -Qy -o xdraw2.o
cpudtect.o :
gasp cpudtect.S $(LAOPTS) | as -V -Qy -o cpudtect.o
realclean: clean
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB)
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SHARED)
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO)

View File

@@ -1,19 +1,25 @@
/*#include "fxbldno.h"*/
#define MANVERSION 2
#define MANREVISION 53
#define MANREVISION 56
#define BUILD_NUMBER 40405
#ifndef GLIDE3
#define VERSIONSTR "2.53\0"
#define VERSIONSTR "2.56\0"
#else
#define VERSIONSTR "3.0\0"
#endif
#if defined(CVG) || defined(VOODOO2)
# define HWSTR " Voodoo(tm)\0"
# define HWSTR " Voodoo(tm)\0" /* [koolsmoky] NB do not change. Required
* by Metabyte WickedGL to detect V2.
*/
# ifdef NT_BUILD
# define PRODNAME "Glide(tm) for Voodoo\251 and Windows\256 NT\0"
# define PRODNAME "Glide(tm) for Voodoo^2\251 and Windows\256 NT\0"
# else
# define PRODNAME "Glide(tm) for Voodoo\251 and Windows\256 95/98\0"
# define PRODNAME "Glide(tm) for Voodoo^2\251 and Windows\256 95/98\0"
# endif /* NT_BUILD */
#elif defined(H3)
# define HWSTR " Banshee(tm)\0"

View File

@@ -19,6 +19,19 @@
;; $Header$
;; $Revision$
;; $Log$
;; Revision 1.1.1.1.2.3 2005/01/22 14:52:02 koolsmoky
;; enabled packed argb for cmd packet type 3
;;
;; Revision 1.1.1.1.2.2 2005/01/13 16:11:39 koolsmoky
;; prepare for packed rgb
;;
;; Revision 1.1.1.1.2.1 2004/12/23 20:45:56 koolsmoky
;; converted to nasm syntax
;; added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations
;;
;; Revision 1.1.1.1 1999/12/07 21:49:13 joseph
;; Initial checkin into SourceForge.
;;
;;
;; 7 5/18/98 12:16p Peter
;; culling enabling
@@ -47,174 +60,166 @@
; B4 Chip field fix.
;;
TITLE xdraw2.asm
OPTION OLDSTRUCTS
.586P
.model FLAT,C ; Flat memory, mangle publics with leading '_'
; some useful floating load and store macros <ala gmt>
flds TEXTEQU <fld DWORD PTR>
fsubs TEXTEQU <fsub DWORD PTR>
fmuls TEXTEQU <fmul DWORD PTR>
_DATA SEGMENT
One DD 03f800000r
Area DD 0
dxAB DD 0
dxBC DD 0
dyAB DD 0
dyBC DD 0
culltest DD 0
;; Extra junk to pad out to the next cache line.
bias0 DD 0
pad1 DD 0
pad2 DD 0
pad3 DD 0
pad4 DD 0
pad5 DD 0
pad6 DD 0
pad7 DD 0
bias1 DD 0
_DATA ENDS
; Ugly, but seems to workaround the problem with locally defined
; data segment globals not getting relocated properly when using
; djgpp.
zArea TEXTEQU <One+04h>
zdxAB TEXTEQU <One+08h>
zdxBC TEXTEQU <One+0ch>
zdyAB TEXTEQU <One+10h>
zdyBC TEXTEQU <One+14h>
zculltest TEXTEQU <One+18h>
%include "xos.inc"
;;; Definitions of cvg regs and glide root structures.
INCLUDE fxgasm.h
%include "fxgasm.h"
extrn _GlideRoot
extrn _FifoMakeRoom, 12
%MACRO GR_FIFO_WRITE 3
mov [%1 + %2], %3
%ENDMACRO ; GR_FIFO_WRITE
%MACRO WRITE_MM1_FIFO_ALIGNED 0
%ifdef GL_AMD3D
movq [fifo], mm1 ; store current param | previous param
%else
;;
%endif
%ENDMACRO ; WRITE_MM1_FIFO_ALIGNED
%MACRO WRITE_MM1LOW_FIFO 0
%ifdef GL_AMD3D
movd [fifo], mm1 ; store current param | previous param
%else
;;
%endif
%ENDMACRO ; WRITE_MM1LOW_FIFO
segment DATA
One DD 1.0
Area DD 0
%IF GLIDE_PACKED_RGB
bias0 DD 0
bias1 DD 0
%ENDIF
segment CONST
$T2003 DD 12288.0
$T2005 DD 1.0
$T2006 DD 256.0
;;; Arguments (STKOFF = 16 from 4 pushes)
STKOFF equ 16
_va$ equ 4 + STKOFF
_vb$ equ 8 + STKOFF
_vc$ equ 12 + STKOFF
;; coordinate offsets into vertex.
;; NB: These are constants and are not
;; user settable like the rest of the
;; parameter offset. Weird.
X equ 0
Y equ 4
%MACRO PROC_TYPE 1
%ifdef GL_AMD3D
proc %1_3DNow, 12
%else
proc %1, 12
%endif
%ENDMACRO ; PROC_TYPE
;; enables/disables trisProcessed and trisDrawn counters
STATS = 1
%define STATS 1
;--------------------------------------------------------------------------
; Arguments (STKOFF = 16 from 4 pushes)
STKOFF = 16
_va$ = 4 + STKOFF
_vb$ = 8 + STKOFF
_vc$ = 12 + STKOFF
segment TEXT
X = 0
Y = 4
; edx is used as index, loading from *src
gc TEXTEQU <esi> ; points to graphics context
ALIGN 32
PROC_TYPE _trisetup_cull
_TEXT SEGMENT
%define GLIDE_CULLING 1
%define GLIDE_PACK_RGB 0
%define GLIDE_PACK_ALPHA 0
%define GLIDE_GENERIC_SETUP 0
%INCLUDE "xdraw2.inc"
%undef GLIDE_GENERIC_SETUP
%undef GLIDE_PACK_ALPHA
%undef GLIDE_PACK_RGB
%undef GLIDE_CULLING
align 4
PUBLIC _trisetup_cull@12
_trisetup_cull@12 PROC NEAR
.code
endp
GLIDE_CULLING textequ <1>
GLIDE_PACK_RGB textequ <0>
GLIDE_PACK_ALPHA textequ <0>
GLIDE_GENERIC_SETUP textequ <0>
INCLUDE xdraw2.inc
GLIDE_GENERIC_SETUP textequ <0>
GLIDE_PACK_ALPHA textequ <0>
GLIDE_PACK_RGB textequ <0>
GLIDE_CULLING textequ <0>
%IF GLIDE_PACKED_RGB
_trisetup_cull@12 ENDP
ALIGN 32
PROC_TYPE _trisetup_cull_rgb
IF GLIDE_PACKED_RGB
align 4
PUBLIC _trisetup_cull_rgb@12
_trisetup_cull_rgb@12 PROC NEAR
.code
%define GLIDE_CULLING 1
%define GLIDE_PACK_RGB 1
%define GLIDE_PACK_ALPHA 0
%define GLIDE_GENERIC_SETUP 0
%INCLUDE "xdraw2.inc"
%undef GLIDE_GENERIC_SETUP
%undef GLIDE_PACK_ALPHA
%undef GLIDE_PACK_RGB
%undef GLIDE_CULLING
GLIDE_CULLING textequ <1>
GLIDE_PACK_RGB textequ <1>
GLIDE_PACK_ALPHA textequ <0>
GLIDE_GENERIC_SETUP textequ <0>
INCLUDE xdraw2.inc
GLIDE_GENERIC_SETUP textequ <0>
GLIDE_PACK_ALPHA textequ <0>
GLIDE_PACK_RGB textequ <0>
GLIDE_CULLING textequ <0>
endp
_trisetup_cull_rgb@12 ENDP
ALIGN 32
PROC_TYPE _trisetup_cull_argb
align 4
PUBLIC _trisetup_cull_argb@12
_trisetup_cull_argb@12 PROC NEAR
.code
%define GLIDE_CULLING 1
%define GLIDE_PACK_RGB 1
%define GLIDE_PACK_ALPHA 1
%define GLIDE_GENERIC_SETUP 0
%INCLUDE "xdraw2.inc"
%undef GLIDE_GENERIC_SETUP
%undef GLIDE_PACK_ALPHA
%undef GLIDE_PACK_RGB
%undef GLIDE_CULLING
GLIDE_CULLING textequ <1>
GLIDE_PACK_RGB textequ <1>
GLIDE_PACK_ALPHA textequ <1>
GLIDE_GENERIC_SETUP textequ <0>
INCLUDE xdraw2.inc
GLIDE_GENERIC_SETUP textequ <0>
GLIDE_PACK_ALPHA textequ <0>
GLIDE_PACK_RGB textequ <0>
GLIDE_CULLING textequ <0>
endp
%ENDIF ; GLIDE_PACKED_RGB
_trisetup_cull_argb@12 ENDP
ENDIF ; GLIDE_PACKED_RGB
align 4
PUBLIC _trisetup@12
_trisetup@12 PROC NEAR
.code
ALIGN 32
PROC_TYPE _trisetup
GLIDE_CULLING textequ <0>
GLIDE_PACK_RGB textequ <0>
GLIDE_PACK_ALPHA textequ <0>
GLIDE_GENERIC_SETUP textequ <0>
INCLUDE xdraw2.inc
GLIDE_GENERIC_SETUP textequ <0>
GLIDE_PACK_ALPHA textequ <0>
GLIDE_PACK_RGB textequ <0>
GLIDE_CULLING textequ <0>
%define GLIDE_CULLING 0
%define GLIDE_PACK_RGB 0
%define GLIDE_PACK_ALPHA 0
%define GLIDE_GENERIC_SETUP 0
%INCLUDE "xdraw2.inc"
%undef GLIDE_GENERIC_SETUP
%undef GLIDE_PACK_ALPHA
%undef GLIDE_PACK_RGB
%undef GLIDE_CULLING
_trisetup@12 ENDP
endp
IF GLIDE_PACKED_RGB
align 4
PUBLIC _trisetup_rgb@12
_trisetup_rgb@12 PROC NEAR
.code
%IF GLIDE_PACKED_RGB
GLIDE_CULLING textequ <0>
GLIDE_PACK_RGB textequ <1>
GLIDE_PACK_ALPHA textequ <0>
GLIDE_GENERIC_SETUP textequ <0>
INCLUDE xdraw2.inc
GLIDE_GENERIC_SETUP textequ <0>
GLIDE_PACK_ALPHA textequ <0>
GLIDE_PACK_RGB textequ <0>
GLIDE_CULLING textequ <0>
ALIGN 32
PROC_TYPE _trisetup_rgb
_trisetup_rgb@12 ENDP
%define GLIDE_CULLING 0
%define GLIDE_PACK_RGB 1
%define GLIDE_PACK_ALPHA 0
%define GLIDE_GENERIC_SETUP 0
%INCLUDE "xdraw2.inc"
%undef GLIDE_GENERIC_SETUP
%undef GLIDE_PACK_ALPHA
%undef GLIDE_PACK_RGB
%undef GLIDE_CULLING
align 4
PUBLIC _trisetup_argb@12
_trisetup_argb@12 PROC NEAR
.code
endp
GLIDE_CULLING textequ <0>
GLIDE_PACK_RGB textequ <1>
GLIDE_PACK_ALPHA textequ <1>
GLIDE_GENERIC_SETUP textequ <0>
INCLUDE xdraw2.inc
GLIDE_GENERIC_SETUP textequ <0>
GLIDE_PACK_ALPHA textequ <0>
GLIDE_PACK_RGB textequ <0>
GLIDE_CULLING textequ <0>
ALIGN 32
PROC_TYPE _trisetup_argb
_trisetup_argb@12 ENDP
ENDIF ; GLIDE_PACKED_RGB
%define GLIDE_CULLING 0
%define GLIDE_PACK_RGB 1
%define GLIDE_PACK_ALPHA 1
%define GLIDE_GENERIC_SETUP 0
%INCLUDE "xdraw2.inc"
%undef GLIDE_GENERIC_SETUP
%undef GLIDE_PACK_ALPHA
%undef GLIDE_PACK_RGB
%undef GLIDE_CULLING
_TEXT ENDS
END
endp
%ENDIF ; GLIDE_PACKED_RGB

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,46 @@
;; THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
;; PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
;; TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
;; INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
;; DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
;; THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
;; EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
;; FULL TEXT OF THE NON-WARRANTY PROVISIONS.
;;
;; USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
;; RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
;; TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
;; AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
;; SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
;; THE UNITED STATES.
;;
;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
;; Adapted from gdraw.c:grDrawTriangle() for nasm
%include "xos.inc"
%include "fxgasm.h"
extrn _GlideRoot
segment SEG_TEXT
align 16
proc grDrawTriangle, 12
;;mov edx, dword [_GlideRoot+curGC]
;;mov eax, dword [edx+kTriProcOffset]
mov eax, dword [_GlideRoot+curGC]
jmp [eax + kTriProcOffset]
endp
align 16
%if XOS == XOS_WIN32
%ifdef __MINGW32__
; GNU LD fails with '_' prefix
export grDrawTriangle@12
%else
export _grDrawTriangle@12
%endif
%endif ; _WIN32

View File

@@ -0,0 +1,161 @@
;
; compulsory header for glide3/xdraw* assembly specializations (NASM)
;
; $Header$
; $Log$
; Revision 1.1.2.3 2004/10/04 08:57:52 dborca
; supporting DOS/OpenWatcom in Assembly files
;
;
; Revision 1.1.2.1 2003/06/07 09:53:25 dborca
; initial checkin for NASM sources
;
;---------------------------------------
; platform defines
;---------------------------------------
%define XOS_DJGPP 1
%define XOS_LINUX 2
%define XOS_WIN32 4
%define XOS_WATCD 8
%define STDCALL 0
%define ELFTYPE 0
;---------------------------------------
; pick up the right OS
;---------------------------------------
%ifdef __DJGPP__
%define XOS XOS_DJGPP
%elifdef __linux__
%define XOS XOS_LINUX
%define ELFTYPE 1
%elifdef __WIN32__
%define XOS XOS_WIN32
%define STDCALL 1
%elifdef __WATCOMD__
%define XOS XOS_WATCD
%define STDCALL 1
%else
%error Unknown OS
%endif
;---------------------------------------
; general purpose macros
;---------------------------------------
%macro extrn 1-2 0
%if STDCALL && (%2 > 0)
%define %1 %1@%2
%endif
extern %1
%endmacro
%macro globl 1-2 0
%if STDCALL && (%2 > 0)
%define %1 %1@%2
%endif
global %1
%endmacro
%macro proc 1-2 0
%push proc
%if STDCALL && (%2 > 0)
%define %$ret RET %2
%else
%define %$ret RET
%endif
%if ELFTYPE
globl %1:function, %2
%else
globl %1, %2
%endif
%1:
%endmacro
%macro endp 0
%ifnctx proc
%error Mismatched `endp'/`proc'
%else
%pop
%endif
%endmacro
%macro ret 0
%ifnctx proc
RET
%else
%$ret
%endif
%endmacro
%macro invoke 1-*
%rep %0 - 1
%rotate -1
push %1
%endrep
%rotate -1
call %1
%if (STDCALL == 0) && (%0 > 1)
add esp, 4 * (%0 - 1)
%endif
%endmacro
;---------------------------------------
; Windows
;---------------------------------------
%if XOS == XOS_WIN32
%define TEXT .text align=32
%define DATA .data align=32
%define CONST .rdata align=32
%macro GET_GC 0
mov gc, [_GlideRoot + curGC]
%endmacro
%endif
;---------------------------------------
; DJGPP
;---------------------------------------
%if XOS == XOS_DJGPP
%define TEXT .text
%define DATA .data
%define CONST .rodata
%macro GET_GC 0
mov gc, [_GlideRoot + curGC]
%endmacro
%endif
;---------------------------------------
; Linux
;---------------------------------------
%if XOS == XOS_LINUX
%define TEXT .text align=32
%define DATA .data align=32
%define CONST .rodata align=32
%macro GET_GC 0
mov gc, [_GlideRoot + curGC]
%endmacro
%endif
;---------------------------------------
; WATCOM/DOS
;---------------------------------------
%if XOS == XOS_WATCD
%define TEXT _TEXT align=1 public use32 class=CODE FLAT
%define DATA _DATA align=4 public use32 class=DATA FLAT
%define CONST CONST2 align=4 public use32 class=DATA FLAT
%macro GET_GC 0
mov gc, [_GlideRoot + curGC]
%endmacro
%endif

View File

@@ -0,0 +1,333 @@
;; THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
;; PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
;; TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
;; INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
;; DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
;; THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
;; EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
;; FULL TEXT OF THE NON-WARRANTY PROVISIONS.
;;
;; USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
;; RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
;; TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
;; AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
;; SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
;; THE UNITED STATES.
;;
;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
;;
;; $Header$
;; $Revision$
;; $Log$
;; Revision 1.1.2.2 2005/04/23 18:36:36 koolsmoky
;; fixed 3dnow! and mmx optimizations
;;
;; Revision 1.1.2.1 2004/12/23 20:45:56 koolsmoky
;; converted to nasm syntax
;; added x86 asm, 3dnow! triangle and mmx, 3dnow! texture download optimizations
;;
;; Revision 1.1.1.1.8.1 2003/11/03 13:34:30 dborca
;; Voodoo2 happiness (DJGPP & Linux)
;;
;; Revision 1.1.8.7 2003/09/12 05:08:35 koolsmoky
;; preparing for graphic context checks
;;
;; Revision 1.1.8.6 2003/07/07 23:29:06 koolsmoky
;; cleaned logs
;;
;;
;; Revision 1.1 2000/06/15 00:27:43 joseph
;; Initial checkin into SourceForge.
;;
;; 10 8/17/99 6:35p Atai
;; fixed amd debug mode
;;
;; 9 4/08/99 1:22p Atai
;; added contect check for _grTexDownload_3DNow_MMX
;;
;; 8 3/19/99 11:26a Peter
;; expose direct fifo for gl
;;
;; 7 2/02/99 4:36p Peter
;; download through lfb rather than texture port
;;
;; 6 12/17/98 2:36p Atai
;; check in Norbert's fix for texture download width correction
;;
;; 5 12/07/98 11:33a Peter
;; norbert's re-fixes of my merge
;;
;; 4 11/02/98 5:34p Atai
;; merge direct i/o code
;;
;; 3 10/20/98 5:34p Atai
;; added #ifdefs for hwc
;;
;; 2 10/14/98 12:05p Peter
;; fixed my effed up assumption about non-volatile regs
;;
;; 1 10/09/98 6:48p Peter
;; 3DNow!(tm) version of wide texture downloads
;;
;; 3 10/07/98 9:43p Peter
;; triangle procs for 3DNow!(tm)
;;
;; 2 10/05/98 7:43p Peter
;; 3DNow!(tm) happiness everywhere
;;
;; 1 10/05/98 6:01p Peter
;; mmx stuff for 3DNow!(tm) capable processors
;;
%include "xos.inc"
extrn _FifoMakeRoom, 12
%MACRO _grCommandTransportMakeRoom 3
push %3
push %2
push %1
call _FifoMakeRoom
add esp, 12
%ENDMACRO ; _grCommandTransportMakeRoom
;;; Definitions of cvg regs and glide root structures.
%INCLUDE "fxgasm.h"
; Arguments (STKOFF = 16 from 4 dword pushes)
STACKOFFSET equ 16
_gc$ equ 4 + STACKOFFSET
_baseAddr$ equ 8 + STACKOFFSET
_maxS$ equ 12 + STACKOFFSET
_minT$ equ 16 + STACKOFFSET
_maxT$ equ 20 + STACKOFFSET
_texData$ equ 24 + STACKOFFSET
;; NB: The first set of registers (eax, ecx, and edx) are volatile across
;; function calls. The remaining registers are supposedly non-volatile
;; so they only store things that are non-volatile across the call.
%define fifo ebp ; fifo ptr in inner loop
%define gc esi ; graphics context
%define dataPtr edi ; pointer to exture data to be downloaded
%define curT ebx ; counter for texture scan lines (t-coordinate)
%define curS ecx ; texture s-coordinate
%define fRoom edx ; room available in fifo (in bytes)
;--------------------------------------------------------------------------
;
; GL_AMD3D, GL_MMX
;
;--------------------------------------------------------------------------
segment TEXT
ALIGN 32
%IFDEF GL_AMD3D
proc _grTexDownload_3DNow_MMX, 24
%ENDIF
%IFDEF GL_MMX
proc _grTexDownload_MMX, 24
%ENDIF
push ebx ; save caller's register variable
mov curT, [esp + _maxT$ - 12] ; curT = maxT
push esi ; save caller's register variable
mov eax, [esp + _minT$ - 8] ; minT
push edi ; save caller's register variable
mov gc, [esp + _gc$ - 4] ; gc
push ebp ; save caller's register variable
mov dataPtr, [esp + _texData$]; dataPtr
%IFDEF GLIDE_ALT_TAB
test gc, gc
je .dlDone
; mov edx, [gc + windowed]
; test edx, 1
; jnz .pastContextTest
mov edx, DWORD [gc+lostContext]
mov ecx, [edx]
test ecx, 1
jnz .dlDone
;.pastContextTest:
%ENDIF
sub curT, eax ; curT = maxT - minT
mov fifo, [gc + fifoPtr] ; fifoPtr
mov curS, [esp + _maxS$] ; curS = maxS = scanline width in DWORDs
add curT, 1 ; curT = maxT - minT + 1
%IFDEF GL_AMD3D
femms ; we'll use MMX/3DNow!, make sure FPU register cleared
%ENDIF
%IFDEF GL_MMX
emms ; we'll use MMX
%ENDIF
movd mm3, [esp + _baseAddr$] ; 0 | address of texture to download
add curS, curS ;
add curS, curS ; scan line width (in bytes)
mov eax, [esp + _minT$] ; 0 | minT
mov [esp + _maxS$], curS ; save scan line width (in bytes)
mov edx, curS ;
add edx, edx ; packetHdr<21:3> = maxS = scanline width in DWORDs
or edx, 0xc0000005 ; packetHdr<31:30> = texture port
; packetHdr<21:3> = maxS
; packetHdr<2:0> = packetType 5
movd mm1, edx ; 0 | packetHdr
movd mm2, eax ; 0 | minT
psllq mm2, 9 ; 0 | TEX_ROW_ADDR_INCR(minT) = minT << 9
paddd mm3, mm2 ; 0 | texAddr = texBaseAddr + TEX_ROW_ADDR_INCR(minT)
movd mm2, [gc + tex_ptr] ; 0 | gc->tex_ptr
psubd mm3, mm2 ; 0 | texAddr - gc->tex_ptr
mov eax, 0x200 ; TEX_ROW_ADDR_INCR(1) = 1 << 9
movd mm2, eax ; 0 | TEX_ROW_ADDR_INCR(1)
psllq mm2, 32 ; TEX_ROW_ADDR_INCR(1) | 0
mov fRoom, [gc + fifoRoom] ; get available fifoRoom (in bytes)
punpckldq mm1, mm3 ; hdr2 = texAddr - gc->tex_ptr | hdr1 = packetHdr
;; ebx = curT, edi = dataPtr, esi = gc, ebp = fifo, ecx = curS = maxS
;; edx = fifoRoom, mm1 = texAddr-gc->tex_ptr|packetHdr, mm2 = TEX_ROW_ADDR_INCR(1)|0
test fifo, 4 ; is fifo QWORD aligned ?
jz .startDownload ; yup, start texture download
cmp fRoom, 4 ; enough room for NULL packet in fifo?
jge .mmxAlignFifo ; yes, write NULL packet to align fifo
%ifdef USE_PACKET_FIFO
_grCommandTransportMakeRoom 4, 0, __LINE__; make fifo room
%endif
mov fifo, [gc + fifoPtr] ; fifoPtr modified by _grCommandTransportMakeRoom, reload
mov fRoom, [gc + fifoRoom] ; fifoRoom modified by _grCommandTransportMakeRoom, reload
mov curS, [esp + _maxS$] ; reload maxS (destroyed by call to _grCommandTransportMakeRoom)
test fifo, 4 ; new fifoPtr QWORD aligned ?
jz .startDownload ; yup, start texture download
.mmxAlignFifo:
mov DWORD [fifo], 0 ; write NULL packet
sub fRoom, 4 ; fifoRoom -= 4
mov [gc + fifoRoom], fRoom ; store new fifoRoom
add fifo, 4 ; fifoPtr += 4
%IFDEF GLIDE_DEBUG
mov [gc + checkPtr], fifo ; checkPtr
%ENDIF
mov [gc + fifoPtr], fifo ; store new fifoPtr
jmp .startDownload ; fifo aligned, download texture now
ALIGN 32
;; ebx = curT, edi = dataPtr, esi = gc, ebp = fifo, ecx = maxS = curS
;; edx=fifoRoom, mm1 = texAddr-gc->tex_ptr|packetHdr, mm2 = TEX_ROW_ADDR_INCR(1)|0
.loopT:
%IFDEF GLIDE_DEBUG
;; Make sure that we have a QWORD aligned fifoPtr; force GP if not aligned
test fifo, 4 ; is fifoPtr QWORD aligned ?
jz .alignmentOK ; yup, continue
xor eax, eax ; create 0
mov [eax], eax ; move to DS:[0] forces GP
.alignmentOK:
%ENDIF ; GLIDE_DEBUG
;; Compute packet header words
;; hdr1: downloadSpace[31:30] numWords[21:3] packetType[2:0]
;; hdr2: download address[29:0]
movq [fifo], mm1 ; store hdr2 | hdr1
add fifo, 8 ; increment fifo ptr (hdr1 + hdr2)
;; S coordinate inner loop unrolled for 8 texels a write
.loopS:
movq mm0, [dataPtr] ; load 64 bit data (8 texels)
add fifo, 8 ; pre-increment fifoPtr += 2 * sizeof(FxU32)
add dataPtr, 8 ; dataPtr += 2 * sizeof(FxU32)
sub curS, 8 ; curS -= 2 * sizeof(FxU32)
movq [fifo - 8], mm0 ; *fifoPtr = texelData[64 bits]
jnz .loopS ; loop while curS > 0
mov ecx, [gc + fifoPtr] ; old fifo ptr
nop ; filler
mov eax, fifo ; new fifo ptr
mov [gc + fifoPtr], fifo ; save new fifo ptr
%IFDEF GLIDE_DEBUG
mov [gc + checkPtr], fifo ; checkPtr
%ENDIF
sub eax, ecx ; new fifo ptr - old fifo ptr = fifo space used up
mov curS, [esp + _maxS$] ; curS = maxS = width of scanline (bytes)
sub fRoom, eax ; new fifo space available = old fifo space available - fifo space used up = new fifo space available
sub curT, 1 ; curT--
mov [gc + fifoRoom], fRoom ; save new fifo space available
jz .dlDone ; loop while curT > 0
;; Check for room to write the next texture scanline
;; ebx = curT, edi = dataPtr, esi = gc, ebp = fifo
;; edx = fifoRoom, mm1 = texAddr|packetHdr, mm2 = TEX_ROW_ADDR_INCR(1)|0
paddd mm1, mm2 ; texAddr+=TEX_ROW_ADDR_INCR(1) | packetHdr
mov esp, esp ; filler
.startDownload:
lea eax, [curS+8] ; fifo space needed = scan line width + header size
cmp fRoom, eax ; fifo space available >= fifo space required ?
jge .loopT ; yup, write next scan line
%ifdef USE_PACKET_FIFO
_grCommandTransportMakeRoom eax, 0, __LINE__; make fifo room (if fifoPtr QWORD aligned before
%endif
mov fifo, [gc + fifoPtr] ; fifoPtr was modified by _grCommandTransportMakeRoom, reload
mov fRoom, [gc + fifoRoom] ; fifoRoom was modified by _grCommandTransportMakeRoom, reload
mov curS, [esp + _maxS$] ; curS = maxS = width of scanline (bytes)
jmp .loopT ; we now have enough fifo room, write next scanline
.dlDone:
%IFDEF GL_AMD3D
femms ; exit 3DNow!(tm) state
%ENDIF
%IFDEF GL_MMX
emms ; exit MMX state
%ENDIF
pop ebp ; restore caller's register variable
pop edi ; restore caller's register variable
pop esi ; restore caller's register variable
pop ebx ; restore caller's register variable
ret ; pop 6 DWORD parameters and return
endp

View File

@@ -0,0 +1,242 @@
/*
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
**
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
** THE UNITED STATES.
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Header$
** $Log$
** Revision 1.1.1.1 1999/12/07 21:42:38 joseph
** Initial checkin into SourceForge.
**
**
** 1 10/08/98 11:30a Brent
**
** 2 10/05/98 7:43p Peter
** 3DNow!(tm) happiness everywhere
**
** 1 10/03/98 3:37p Peter
** Texture download vectors
**
*/
#include <3dfx.h>
#define FX_DLL_DEFINITION
#include <fxdll.h>
#include <glide.h>
#include "fxglide.h"
void FX_CSTYLE
_grTexDownload_Default_8_1(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData)
{
#define FN_NAME "_grTexDownload_Default_8_1"
FxU32
t = minT,
tex_address = tmuBaseAddr + TEX_ROW_ADDR_INCR(t);
const FxU8
*src8 = (const FxU8*)texData;
for (; t <= maxT; t++) {
LINEAR_WRITE_BEGIN(1, kLinearWriteTex,
(FxU32)tex_address - (FxU32)gc->tex_ptr,
0x00UL, 0x00UL);
LINEAR_WRITE_SET_8(tex_address, (const FxU32)*(const FxU8*)src8);
LINEAR_WRITE_END();
src8 += 1;
tex_address += TEX_ROW_ADDR_INCR(1);
}
#undef FN_NAME
}
void FX_CSTYLE
_grTexDownload_Default_8_2(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData)
{
#define FN_NAME "_grTexDownload_Default_8_2"
FxU32
t = minT,
tex_address = tmuBaseAddr + TEX_ROW_ADDR_INCR(t);
const FxU8
*src8 = (const FxU8*)texData;
for (; t <= maxT; t++) {
LINEAR_WRITE_BEGIN(1, kLinearWriteTex,
(FxU32)tex_address - (FxU32)gc->tex_ptr,
0x00UL, 0x00UL);
LINEAR_WRITE_SET_8(tex_address, (const FxU32)*(const FxU16*)src8);
LINEAR_WRITE_END();
src8 += 2;
tex_address += TEX_ROW_ADDR_INCR(1);
}
#undef FN_NAME
}
void FX_CSTYLE
_grTexDownload_Default_8_4(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData)
{
#define FN_NAME "_grTexDownload_Default_8_4"
FxU32
t = minT,
tex_address = tmuBaseAddr + TEX_ROW_ADDR_INCR(t);
const FxU8
*src8 = (const FxU8*)texData;
for (; t <= maxT; t++) {
LINEAR_WRITE_BEGIN(1, kLinearWriteTex,
(FxU32)tex_address - (FxU32)gc->tex_ptr,
0x00UL, 0x00UL);
LINEAR_WRITE_SET_8(tex_address, *(const FxU32*)src8);
LINEAR_WRITE_END();
src8 += 4;
tex_address += TEX_ROW_ADDR_INCR(1);
}
#undef FN_NAME
}
void FX_CSTYLE
_grTexDownload_Default_8_WideS(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData)
{
#define FN_NAME "_grTexDownload_Default_8_WideS"
FxU32
t = minT,
tex_address;
const FxU8
*src8 = (const FxU8*)texData;
for (; t <= maxT; t++) {
tex_address = tmuBaseAddr + TEX_ROW_ADDR_INCR(t);
LINEAR_WRITE_BEGIN(maxS, kLinearWriteTex,
(FxU32)tex_address - (FxU32)gc->tex_ptr,
0x00UL, 0x00UL);
{
FxU32 s;
for (s = 0; s < maxS; s += 2) {
const FxU32 t0 = *(const FxU32*)(src8 );
const FxU32 t1 = *(const FxU32*)(src8 + sizeof(FxU32));
LINEAR_WRITE_SET_8(tex_address , t0);
LINEAR_WRITE_SET_8(tex_address + sizeof(FxU32), t1);
src8 += 8;
tex_address += (sizeof(FxU32) << 1);
}
}
LINEAR_WRITE_END();
}
#undef FN_NAME
}
extern void FX_CSTYLE
_grTexDownload_Default_16_1(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData)
{
#define FN_NAME "_grTexDownload_Default_16_1"
FxU32
t = minT,
tex_address = tmuBaseAddr + TEX_ROW_ADDR_INCR(t);
const FxU16
*src16 = (const FxU16*)texData;
for (; t <= maxT; t++) {
LINEAR_WRITE_BEGIN(1, kLinearWriteTex,
(FxU32)tex_address - (FxU32)gc->tex_ptr,
0x00UL, 0x00UL);
LINEAR_WRITE_SET_16(tex_address, (const FxU32)*(const FxU16*)src16);
LINEAR_WRITE_END();
src16 += 1;
tex_address += TEX_ROW_ADDR_INCR(1);
}
#undef FN_NAME
}
extern void FX_CSTYLE
_grTexDownload_Default_16_2(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData)
{
#define FN_NAME "_grTexDownload_Default_16_2"
FxU32
t = minT,
tex_address = tmuBaseAddr + TEX_ROW_ADDR_INCR(t);
const FxU16
*src16 = (const FxU16*)texData;
for (; t <= maxT; t++) {
LINEAR_WRITE_BEGIN(1, kLinearWriteTex,
(FxU32)tex_address - (FxU32)gc->tex_ptr,
0x00UL, 0x00UL);
LINEAR_WRITE_SET_16(tex_address, *(const FxU32*)src16);
LINEAR_WRITE_END();
src16 += 2;
tex_address += TEX_ROW_ADDR_INCR(1);
}
#undef FN_NAME
}
extern void FX_CSTYLE
_grTexDownload_Default_16_WideS(struct GrGC_s* gc, const FxU32 tmuBaseAddr,
const FxU32 maxS, const FxU32 minT, const FxU32 maxT,
void* texData)
{
#define FN_NAME "_grTexDownload_Default_16_WideS"
FxU32
t = minT,
tex_address;
const FxU16
*src16 = (const FxU16*)texData;
for (; t <= maxT; t++) {
tex_address = tmuBaseAddr + TEX_ROW_ADDR_INCR(t);
/* Loop unrolled to process 2 dwords per iteration */
LINEAR_WRITE_BEGIN(maxS, kLinearWriteTex,
(FxU32)tex_address - (FxU32)gc->tex_ptr,
0x00UL, 0x00UL);
{
FxU32 s;
for (s = 0; s < maxS; s += 2) {
const FxU32 t0 = *(const FxU32*)(src16 );
const FxU32 t1 = *(const FxU32*)(src16 + 2);
GDBG_INFO(195, "s = %d, t= %d, address = 0x%x\n",
s, t, (FxU32) tex_address - (FxU32) gc->tex_ptr + 0x200000);
LINEAR_WRITE_SET_16(tex_address , t0);
LINEAR_WRITE_SET_16(tex_address + 4, t1);
tex_address += 8;
src16 += 4;
}
}
LINEAR_WRITE_END();
}
#undef FN_NAME
}

View File

@@ -65,6 +65,10 @@ static const char *sourceFormatString[] = {
"GR_LFB_SRC_FMT_ZA16 "
};
static void imageConvert( void *dst,
void *src,
GrLfbSrcFmt_t format,
FxU32 *bpp );
int main( int argc, char **argv)
{
@@ -91,11 +95,6 @@ int main( int argc, char **argv)
static FxU32 imageWidth;
static FxU32 imageHeight;
static void imageConvert( void *dst,
void *src,
GrLfbSrcFmt_t format,
FxU32 *bpp );
srcfname[0] = 0;
dstfname[0] = 0;

View File

@@ -57,6 +57,10 @@ static const char *sourceFormatString[] = {
"GR_LFB_SRC_FMT_ZA16 "
};
static void imageConvert( void *dst,
void *src,
GrLfbSrcFmt_t format,
FxU32 *bpp );
int main( int argc, char **argv) {
char match;
@@ -80,11 +84,6 @@ int main( int argc, char **argv) {
static FxU32 imageWidth;
static FxU32 imageHeight;
static void imageConvert( void *dst,
void *src,
GrLfbSrcFmt_t format,
FxU32 *bpp );
/* Process Command Line Arguments */
while( (rv = tlGetOpt( argc, argv, "bdnr", &match, &remArgs )) ) {
if ( rv == -1 ) {

View File

@@ -0,0 +1,23 @@
#ifndef CPUID_H_included
#define CPUID_H_included
#define _CPU_HAS_CPUID 0xffff
#define _CPU_FEATURE_MMX 0x0001
#define _CPU_FEATURE_SSE 0x0002
#define _CPU_FEATURE_SSE2 0x0004
#define _CPU_FEATURE_3DNOW 0x0008
#define _CPU_FEATURE_3DNOWPLUS 0x0010
#define _CPU_FEATURE_MMXPLUS 0x0020
typedef struct _processor_info {
char v_name[13]; /* vendor name */
int family; /* family of the processor, eg. Intel_Pentium_Pro is family 6 processor */
int model; /* madel of processor, eg. Intel_Pentium_Pro is model 1 of family 6 processor */
int stepping; /* Processor revision number */
int feature; /* processor Feature (same as return value). */
int os_support; /* does OS Support the feature */
} _p_info;
int _cpuid (_p_info *);
#endif

View File

@@ -26,7 +26,7 @@
**
*/
#ifdef _WIN32
#ifdef __WIN32__
#pragma optimize ("",off)
#endif
#include <stdio.h>
@@ -180,3 +180,6 @@ sst1SetGrxClk_Canopus(FxU32* sstbase, FFLOAT grxclk)
return(RetVal);
}
#ifdef __WIN32__
#pragma optimize ("",on)
#endif

View File

@@ -24,7 +24,7 @@
** Initialization code for initializing supported SST-1 DACs
**
*/
#ifdef _WIN32
#ifdef __WIN32__
#pragma optimize ("",off)
#endif
#include <stdio.h>
@@ -1369,6 +1369,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitDacIndexedEnable(FxU32 *sstbase,
return(FXTRUE);
}
#ifdef _WIN32
#ifdef __WIN32__
#pragma optimize ("",on)
#endif

888
glide2x/cvg/init/fxremap.c Normal file
View File

@@ -0,0 +1,888 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef __linux__
#include <conio.h>
#endif
#include <3dfx.h>
#include <fxpci.h>
#define FX_DLL_DEFINITION
#include <fxdll.h>
#define null 0
#define SIZE_SST1_NEEDED 0x100000
#define END_ADDRESS 0x10000000
#define S3_SHIFT 0x400000
struct RangeSTRUCT
{
FxU32 address;
FxU32 range;
FxU32 id;
FxU32 is_voodoo; /* 1 = is voodoo, 2 = hidden SLI */
FxU32 is_S3;
struct RangeSTRUCT *next;
struct RangeSTRUCT *prev;
};
int silent = 1;
typedef struct RangeSTRUCT RangeStruct;
void InitRemap(void);
void CloseRemap(void);
void GetMemoryMap(void);
void RemapVoodoo(RangeStruct *conflict);
void AdjustMapForS3(void);
RangeStruct *TestForConflicts(void);
void RemoveEntry(RangeStruct *del);
void InsertEntry(RangeStruct *ins);
FxBool FindHole(RangeStruct *conflict);
FxU32 SnapToDecentAddress(FxU32 address,RangeStruct *conflict);
FxBool fits_in_hole(RangeStruct *begin,FxU32 end,RangeStruct *hole,RangeStruct *conflict);
FxBool fits_under(RangeStruct *first,FxU32 minimum,RangeStruct *hole,RangeStruct *conflict);
FxU32 pciGetType(long i);
void pciGetRange(PciRegister reg,FxU32 device_number,FxU32 *data);
FxBool pciGetAddress(PciRegister reg,FxU32 device_number,FxU32 *data);
void ForceCleanUp(void);
FxBool FindNecessaryCards(void);
void ProcessCommandLine(char **argv,int argc);
FxBool IsCardVoodoo(long i);
FxBool IsCardS3(long i);
FxBool ReadHex(char *string,FxU32 *num);
void AddMapEntry(FxU32 address,FxU32 range,FxU32 id,FxBool VoodooCard,FxBool S3Card);
void HandleMemoryOverlap(void);
FxBool overlap_map(RangeStruct *begin,FxU32 end);
FxBool switch_S3_flag_ignore=FXFALSE;
//FxBool switch_force=FXFALSE;
FxBool switch_C0_bias=FXTRUE;
int switch_voodoo_loc = 0;
FxU32 num_voodoos=0;
//#define TESTING 1
#ifdef TESTING
RangeStruct test_data[6]= {{0xF0000000,0x100000,1,0,0,0,0},
{0xF3000000,0x200000,4,1,0,0,0},
{0xF3000000,0x200000,8,0,0,0,0},
{0xF5000000,0x200000,2,0,0,0,0},
{0xE6000000,0x200000,5,0,0,0,0},
{0xD3001000,0x200000,3,0,0,0,0}};
#endif
RangeStruct map[80];
RangeStruct hole[80];
long num_holes=0;
RangeStruct *first_entry;
RangeStruct *last_entry;
long entries=0;
RangeStruct master_hole;
long voodoo_loc;
FxU32 conflicts_found=0;
void fxremap_dowork(int argc,char **argv,int doit_silently)
{
RangeStruct *conflict;
silent = doit_silently;
ProcessCommandLine(argv,argc);
#if !DIRECTX
InitRemap();
#endif
if (!FindNecessaryCards())
{
if (!silent) {
printf("This program was only meant to be used with the 3dfx Voodoo chipset\n");
printf("to correct possible pci address conflicts.\n");
printf("No Voodoo chipset was detected\n");
}
ForceCleanUp();
}
GetMemoryMap();
/* expand region of mapping for S3 card */
AdjustMapForS3();
/* see if we find any conflicts with any voodoo card */
while (conflict=TestForConflicts())
{
conflicts_found++;
/* since it is going to move */
/* remove entry, so we can possibly use it as a hole */
RemoveEntry(conflict);
if (FindHole(conflict))
{
conflict->address=master_hole.address;
RemapVoodoo(conflict);
}
else
{
if (!silent) {
printf("Unable to find region to map conflicting board\n");
}
ForceCleanUp();
return;
}
}
if (!conflicts_found) {
if (!silent) {
printf("No conflict with the Voodoo cards was found\n");
}
}
CloseRemap();
}
void fxremap() {
fxremap_dowork(0,NULL,1);
}
void fxremap_main(int argc,char **argv) {
fxremap_dowork(argc,argv,0);
}
void InitRemap(void)
{
#if !DIRECTX
pciOpen();
#endif
}
void CloseRemap(void)
{
// pciClose();
}
FxU32 pciGetConfigData_R(PciRegister reg, FxU32 devNum) {
FxU32 data;
if (pciGetConfigData(reg,devNum,&data) == FXTRUE) {
return (data);
} else {
return (0xFFFFFFFF);
}
}
#define PCI_NORMAL_TYPE 0
#define PCI_BRIDGE_TYPE 1
void GetMemoryMap(void)
{
FxU32 temp,temp2;
FxU32 type;
long devNum;
int fn; /* function number iterator */
int maxFnNumber;
int multi_fn = 0;
#ifdef TESTING
for (i=0;i<6;i++)
{
temp=test_data[i].address;
temp2=~(test_data[i].range - 0x1);
AddMapEntry(temp,temp2,test_data[i].id,test_data[i].is_voodoo,test_data[i].is_S3);
}
#else
for (devNum=0;devNum<MAX_PCI_DEVICES;devNum++)
{
if (pciDeviceExists(devNum))
{
if (pciGetConfigData_R(PCI_HEADER_TYPE,devNum) & (1<<7)) {
maxFnNumber = 8; /* multifunction! */
multi_fn = 1;
} else {
multi_fn = 0;
if ((pciGetConfigData_R(PCI_VENDOR_ID,devNum) == 0x121a) &&
(pciGetConfigData_R(PCI_DEVICE_ID,devNum) == 0x02)) {
maxFnNumber = 8; /* single board SLI! */
} else {
maxFnNumber = 1;
}
}
for(fn=0;fn<maxFnNumber;fn++) {
int i = devNum | (fn << 13); /* add function number */
if (pciGetConfigData_R(PCI_VENDOR_ID,i) != 0xFFFF) {
/* two header types */
/* one for bridges and one for everything else */
type=pciGetType(i);
if (type==PCI_NORMAL_TYPE) {
if (pciGetAddress(PCI_BASE_ADDRESS_0,i,&temp)) {
pciGetRange(PCI_BASE_ADDRESS_0,i,&temp2);
AddMapEntry(temp,temp2,i,IsCardVoodoo(i),IsCardS3(i));
}
if (pciGetAddress(PCI_BASE_ADDRESS_1,i,&temp)) {
pciGetRange(PCI_BASE_ADDRESS_1,i,&temp2);
AddMapEntry(temp,temp2,i,IsCardVoodoo(i),IsCardS3(i));
}
#if 0
/* Legacy address which is not needed for sst1 type
* things w/o 2d.
*/
if (pciGetAddress(PCI_IO_BASE_ADDRESS,i,&temp)) {
pciGetRange(PCI_IO_BASE_ADDRESS,i,&temp2);
AddMapEntry(temp,temp2,i,IsCardVoodoo(i),IsCardS3(i));
}
#endif
if (pciGetAddress(PCI_ROM_BASE_ADDRESS,i,&temp)) {
pciGetRange(PCI_ROM_BASE_ADDRESS,i,&temp2);
AddMapEntry(temp,temp2,i,IsCardVoodoo(i),IsCardS3(i));
}
} else if (type==PCI_BRIDGE_TYPE) {
if (pciGetAddress(PCI_BASE_ADDRESS_0,i,&temp)) {
pciGetRange(PCI_BASE_ADDRESS_0,i,&temp2);
AddMapEntry(temp,temp2,i,IsCardVoodoo(i),IsCardS3(i));
}
if (pciGetAddress(PCI_BASE_ADDRESS_1,i,&temp)) {
pciGetRange(PCI_BASE_ADDRESS_1,i,&temp2);
AddMapEntry(temp,temp2,i,IsCardVoodoo(i),IsCardS3(i));
}
}
} /* if function number exists */
} /* for all function numbers */
}
}
#endif
}
void AdjustMapForS3(void)
{
RangeStruct *cur;
cur=first_entry;
while(cur)
{
if (cur->is_S3)
{
cur->address-=S3_SHIFT;
cur->range=S3_SHIFT<<1;
}
cur=cur->next;
}
}
RangeStruct *TestForConflicts(void)
{
RangeStruct *cur,*next;
cur=first_entry;
while(cur)
{
/* if this is a poorly mapped voodoo2 single board SLI, then remap */
if ((cur->is_voodoo == 2) && (cur->address == 0xFF00000)) {
return (cur);
}
if (cur->next)
{
if ((cur->address + cur->range) > cur->next->address)
{
next=cur->next;
if ((cur->is_voodoo)||(next->is_voodoo))
{
if (cur->is_voodoo)
{
return cur;
}
return next;
}
else {
if (!silent) {
printf("FxRemap: Possible PCI conflict not with Voodoo device\n");
printf("%X (%X) <-> %X:%X (%X)\n",cur->id, cur->address,
cur->next->id, cur->next->address);
}
}
}
}
else
{
if ((cur->address + cur->range) > END_ADDRESS)
return cur;
}
cur=cur->next;
}
return null;
}
void AddMapEntry(FxU32 address,FxU32 range,FxU32 id,FxBool VoodooCard,FxBool S3Card)
{
RangeStruct *temp,*cur,*next;
//jcochrane@3dfx.com
long entry=0;
FxU32 tmp_address=0;
//END
#if 0
static long test_entry=0;
address=test_data[test_entry].address;
range=~(test_data[test_entry++].range - 0x1);
#endif
/* only if address != 0 */
//jcochrane@3dfx.com
//check for duplicate entries in the map table,ignore if there is
tmp_address=address>>4;
for(entry=0;entry<entries;entry++)
{
if( tmp_address == map[entry].address)
address=0;
}
//END
if(address)
{
map[entries].address=address>>4;
map[entries].range=((~range)>>4)+0x1;
map[entries].id=id;
map[entries].is_voodoo=VoodooCard;
map[entries].is_S3=S3Card;
temp=&map[entries++];
if (entries<=1)
{
first_entry=temp;
last_entry=temp;
temp->next=null;
temp->prev=null;
return;
}
cur=first_entry;
next=null;
while(cur)
{
if (temp->address < cur->address)
{
next=cur;
break;
}
cur=cur->next;
}
if (next)
{
temp->next=next;
temp->prev=next->prev;
next->prev=temp;
if (next==first_entry)
first_entry=temp;
else
(temp->prev)->next=temp;
}
else
{
last_entry->next=temp;
temp->prev=last_entry;
last_entry=temp;
temp->next=null;
}
}
}
void RemoveEntry(RangeStruct *del)
{
RangeStruct *prev;
if (!(del->next))
{
if (!(del->prev))
{
if (!silent) {
printf("FxRemap: No entries mapped\n");
}
ForceCleanUp();
return;
}
prev=del->prev;
last_entry=prev;
prev->next=null;
del->prev=null;
del->next=null;
}
else
{
if (!(del->prev))
{
del->next->prev=null;
first_entry=del->next;
}
else
{
del->next->prev=del->prev;
del->prev->next=del->next;
}
del->next=null;
del->prev=null;
}
}
void InsertEntry(RangeStruct *ins)
{
RangeStruct *cur;
cur=first_entry;
ins->next=null;
ins->prev=null;
if (!first_entry)
{
first_entry=ins;
last_entry=ins;
return;
}
while(cur)
{
if (ins->address < cur->address)
{
ins->next=cur;
ins->prev=cur->prev;
cur->prev=ins;
if (!ins->prev)
{
first_entry=ins;
}
else
{
(ins->prev)->next=ins;
}
return;
}
cur=cur->next;
}
/* if it got this far it needs to go at the end */
ins->prev=last_entry;
last_entry->next=ins;
last_entry=ins;
}
FxU32 SnapToDecentAddress(FxU32 address,RangeStruct *conflict)
{
FxU32 range;
FxU32 mask;
FxU32 not_mask;
range=conflict->range;
if (range<0x10000)
range=0x10000;
mask=range;
mask-=1;
not_mask=~mask;
if (address & mask)
{
address=(address & not_mask) + range;
}
return address;
}
FxBool fits_in_hole(RangeStruct *begin,FxU32 end,RangeStruct *hole,RangeStruct *conflict)
{
FxU32 address;
address=begin->address+begin->range;
address=SnapToDecentAddress(address,conflict);
/* note could be <= */
/* this is safer but more inefficient memory wise */
if ((address+conflict->range)<end)
{
hole->address=address;
hole->range=end-address;
return FXTRUE;
}
return FXFALSE;
}
FxBool fits_under(RangeStruct *first,FxU32 minimum,RangeStruct *hole,RangeStruct *conflict)
{
FxU32 address;
address=minimum;
address=SnapToDecentAddress(address,conflict);
if ((address+conflict->range) < first->address)
{
hole->address=address;
hole->range=first->address - address;
return FXTRUE;
}
return FXFALSE;
}
FxBool FindHole(RangeStruct *conflict)
{
RangeStruct *cur;
cur=first_entry;
while(cur)
{
if (!(cur->next))
{
if (fits_in_hole(cur,END_ADDRESS,&master_hole,conflict))
{
return FXTRUE;
}
}
else
{
if (fits_in_hole(cur,cur->next->address,&master_hole,conflict))
{
return FXTRUE;
}
}
cur=cur->next;
}
/* see if we can find a whole located below addressed boards */
/* don't want to go below 0xA000000 for addressing our boards */
if (first_entry->address > 0xA000000)
{
if (fits_under(first_entry,0xA000000,&master_hole,conflict))
return FXTRUE;
}
return FXFALSE;
}
void RemapVoodoo(RangeStruct *conflict)
{
FxU32 address;
/* put conflict back into memory map */
InsertEntry(conflict);
#ifndef TESTING
address=(conflict->address)<<4;
pciSetConfigData(PCI_BASE_ADDRESS_0,conflict->id,&address);
#endif
if (!silent) {
printf("Remapped Voodoo Board to avoid a conflict\n");
}
}
void pciGetRange(PciRegister reg,FxU32 device_number,FxU32 *data)
{
FxU32 temp=0xFFFFFFFF;
FxU32 size,save;
pciGetConfigData(reg,device_number,&save);
pciSetConfigData(reg,device_number,&temp);
pciGetConfigData(reg,device_number,&size);
pciSetConfigData(reg,device_number,&save);
#ifdef TESTING
printf("PciGetRange: save %08x \n",save);
printf("PciGetRange: temp %08x \n",temp);
printf("PciGetRange: size %08x \n",size);
printf("PciGetRange: save %08x \n",save);
#endif
*data=size;
}
FxBool pciGetAddress(PciRegister reg,FxU32 device_number,FxU32 *data)
{
pciGetConfigData(reg,device_number,data);
if ((*data)==0)
return FXFALSE;
if (*data & 0x01)
return FXFALSE;
return FXTRUE;
}
void ForceCleanUp(void)
{
// pciClose();
// exit(1);
}
FxBool FindNecessaryCards(void)
{
FxBool voodoo_found=FXFALSE;
long i;
for (i=0;i<MAX_PCI_DEVICES;i++)
{
if (pciDeviceExists(i))
{
if(IsCardVoodoo(i))
{
voodoo_found=FXTRUE;
num_voodoos++;
}
}
}
if (!voodoo_found)
{
if (!silent) {
printf("Warning no known voodoo card was found\n");
}
return FXFALSE;
}
return FXTRUE;
}
void ProcessCommandLine(char **argv,int argc)
{
long i;
FxU32 temp,temp2;
FxU32 address,range;
char *hex_ptr;
for (i=1;i<argc;i++)
{
if (strcmp(argv[i],"/dS3")==0)
{
switch_S3_flag_ignore=FXTRUE;
}
else if(strcmp(argv[i],"/f")==0)
{
if ((i+1)<argc)
{
if (ReadHex(argv[i+1],&temp))
{
i++;
}
else
{
if (!silent) {
printf("Command line: improper format\n");
printf("ex: fxremap.exe /f 0xC0000000\n");
}
ForceCleanUp();
}
}
else
{
if (!silent) {
printf("Command line: improper format\n");
printf("ex: fxremap.exe /f 0xC0000000\n");
}
ForceCleanUp();
}
if (!silent) {
printf("Command line option /f ignored in this version\n");
}
/* this stuff was from the interactive test version */
#if 0
while(!kbhit())
{
;
}
getch();
#endif
}
else if(strcmp(argv[i],"/x")==0)
{
if ((i+1)<argc)
{
hex_ptr=strchr(argv[i+1],'-');
if (!hex_ptr)
{
if (!silent) {
printf("Command line: improper format\n");
printf("ex: fxremap.exe /x 0xE0000000-0xF0000000\n");
}
ForceCleanUp();
}
if ((ReadHex(argv[i+1],&temp))&&(ReadHex(hex_ptr+1,&temp2)))
{
address=temp;
range=temp2-temp;
range=~(range - 0x1);
i++;
AddMapEntry(address,range,0x500,FXFALSE,FXFALSE);
}
else
{
if (!silent) {
printf("Command line: improper format\n");
printf("ex: fxremap.exe /x 0xE0000000-0xF0000000\n");
}
ForceCleanUp();
}
}
else
{
if (!silent) {
printf("Command line: improper format\n");
printf("ex: fxremap.exe /x 0xE0000000-0xF0000000\n");
}
ForceCleanUp();
}
}
else if (strcmp(argv[i],"/nb")==0)
{
switch_C0_bias=FXFALSE;
}
else if (strcmp(argv[i],"/i")==0)
{
switch_voodoo_loc = atoi(argv[++i]);
}
else
{
if (!silent) {
printf("Command line: improper options specified\n");
printf("Valid options are /dS3 /f /x /i\n");
}
}
}
}
FxU32 pciGetType(long i)
{
FxU32 header_type;
pciGetConfigData(PCI_HEADER_TYPE,i,&header_type);
return header_type;
}
FxBool IsCardVoodoo(long i)
{
FxU32 vendor,dev_id;
FxU32 fn_num = (i >> 13) & 0x7;
int true_val;
if (fn_num) {
true_val = 2;
} else {
true_val = 1;
}
pciGetConfigData(PCI_VENDOR_ID,i,&vendor);
pciGetConfigData(PCI_DEVICE_ID,i,&dev_id);
/* if sst1 */
if ((vendor==0x121a)&&(dev_id==0x0001))
return FXTRUE;
/* if voodoo2 */
if ((vendor==0x121a)&&(dev_id==0x0002)) {
if (true_val == 2) if (!silent) { printf("found voodoo2 hidden sli\n"); }
return true_val;
}
/* if banshee */
if ((vendor==0x121a)&&(dev_id==0x0003))
return FXTRUE;
/* if h4? or whatever is next */
if ((vendor==0x121a)&&(dev_id==0x0004))
return FXTRUE;
return FXFALSE;
}
FxBool IsCardS3(long i)
{
FxU32 vendor,dev_id;
pciGetConfigData(PCI_VENDOR_ID,i,&vendor);
pciGetConfigData(PCI_DEVICE_ID,i,&dev_id);
if ((vendor==0x5333)&&((dev_id==0x88f0)||(dev_id==0x8880)))
return FXTRUE;
return FXFALSE;
}
FxBool ReadHex(char *string,FxU32 *num)
{
long i=0;
FxU32 temp=0,temp2;
long num_count=0;
/* bypass leading spaces */
while((string[i])&&(string[i]==' '))
i++;
/* verify leading 0x */
if (string[i]=='0')
i++;
else
return FXFALSE;
if (string[i]=='x')
i++;
else
return FXFALSE;
/* read in number */
while(((string[i]>=0x30)&&(string[i]<0x3A))||((string[i]>=0x41)&&(string[i]<0x47))||((string[i]>=0x61)&&(string[i]<0x67)))
{
if ((string[i]>=0x30)&&(string[i]<0x3A))
temp2=string[i] - 0x30;
else if ((string[i]>=0x41)&&(string[i]<0x47))
temp2=string[i] - 0x37;
else if ((string[i]>=0x61)&&(string[i]<0x67))
temp2=string[i] - 0x57;
if (num_count!=0)
temp=(temp<<4)+temp2;
else if (num_count<8)
temp=temp2;
else
return FXFALSE;
num_count++;i++;
}
*num=temp;
return FXTRUE;
}
void HandleMemoryOverlap(void)
{
RangeStruct *cur;
cur=first_entry;
while(cur)
{
if (cur!=last_entry)
{
if (overlap_map(cur,cur->next->address))
{
if (cur->range<(cur->next->address+cur->next->range-cur->address))
cur->range=cur->next->address+cur->next->range-cur->address;
if (cur->next==last_entry)
{
last_entry=cur;
cur->next=null;
}
else
{
cur->next=cur->next->next;
cur->next->prev=cur;
}
}
else
cur=cur->next;
}
else
cur=cur->next;
}
}
FxBool overlap_map(RangeStruct *begin,FxU32 end)
{
if ((begin->address+begin->range)>end)
return FXTRUE;
return FXFALSE;
}

View File

@@ -0,0 +1,14 @@
/*
* fxremap.h
*
* pci remapper, used to remap the single board SLI slave to a valid
* PCI address
*/
#ifndef _FXREMAP_H_
#define _FXREMAP_H_
void fxremap(void);
int fxremap_main(int argc, char **argv);
#endif

View File

@@ -25,7 +25,7 @@
** Initialization code for loading SST-1 gamma tables
**
*/
#ifdef _WIN32
#ifdef __WIN32__
#pragma optimize ("",off)
#endif
#include <stdio.h>
@@ -251,6 +251,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGammaTable(FxU32 *sstbase, FxU32 nentries, Fx
return(FXTRUE);
}
#ifdef _WIN32
#ifdef __WIN32__
#pragma optimize ("",on)
#endif

View File

@@ -252,7 +252,7 @@ gdbg_vprintf (const char *format,va_list args)
#if __DOS32__
pciOutputDebugString(msgBuf);
#elif __WIN32
#elif __WIN32__
OutputDebugString(msgBuf);
#else
fprintf(stderr, msgBuf);

View File

@@ -25,7 +25,7 @@
** configuration information.
**
*/
#ifdef _WIN32
#ifdef __WIN32__
#pragma optimize ("",off)
#endif
#include <stdio.h>
@@ -652,6 +652,7 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
return(FXTRUE);
}
#ifdef _WIN32
#ifdef __WIN32__
#pragma optimize ("",on)
#endif

View File

@@ -19,6 +19,12 @@
**
** $Header$
** $Log$
** Revision 1.2 2000/04/20 21:20:22 joseph
** Copied windows init code to fix incompatibility with Athlon
**
** Revision 1.1.1.1 1999/12/07 21:49:24 joseph
** Initial checkin into SourceForge.
**
*/
#define OFFICIAL 1

View File

@@ -25,7 +25,7 @@
** Parsing code for grabbing information from "voodoo2.ini" initialization file
**
*/
#ifdef _WIN32
#ifdef __WIN32__
#pragma optimize ("",off)
#endif
#include <stdio.h>
@@ -51,21 +51,16 @@
static int sst1InitFgets(char *, FILE *);
static int sst1InitFgetc(FILE *);
#ifndef INIT_LINUX
static int sst1InitParseFieldDac(char *);
#endif
static int sst1InitParseFieldCfg(char *);
#ifndef INIT_LINUX
static int sst1InitParseDacRdWrString(char *, sst1InitDacStruct *);
static int sst1InitParseDacRdWr(char *, sst1InitDacRdWrStruct *);
static int sst1InitParseSetVideoString(char *, sst1InitDacStruct *);
static int sst1InitParseSetMemClkString(char *, sst1InitDacStruct *);
static int sst1InitParseSetVideoModeString(char *, sst1InitDacStruct *);
#endif
static void sst1InitPrintDacRdWr(sst1InitDacRdWrStruct *, char *);
static void sst1InitToLower(char *string);
#if __DOS32__
static void sst1InitFixFilename(char *dst, char *src);
#endif
static FxBool checkedFileP = FXFALSE;
@@ -287,6 +282,7 @@ __errExit:
*/
FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() {
static FxBool retVal = FXFALSE;
int inCfg, inDac;
FILE *file = 0;
char buffer[1024], filename[256];
char *tmpPtr;
@@ -350,9 +346,90 @@ __errExit:
}
#endif
#if defined(INIT_DOS) || defined(INIT_LINUX)
#if defined(INIT_DOS) || defined(INIT_LINUX) || defined(__WIN32__)
#if TEST
/* void main(int argc, char **argv) */
static void foo(int argc, char **argv)
{
char buffer[2048]; /* buffer for command line inputs */
int inCfg, inDac;
sst1InitEnvVarStruct *envVarsPtr;
sst1InitDacStruct *dacPtr;
sst1InitDacSetVideoStruct *setVideo;
sst1InitDacSetMemClkStruct *setMemClk;
FILE *file = fopen(argv[1], "r");
inCfg = inDac = 0;
while(sst1InitFgets(buffer, file)) {
buffer[strlen(buffer)-1] = (char) NULL;
if(!strcmp(buffer, "[CFG]")) {
inCfg = 1; inDac = 0;
continue;
} else if (!strcmp(buffer, "[DAC]")) {
inCfg = 0; inDac = 1;
continue;
} else if(buffer[0] == '[') {
inCfg = 0; inDac = 0;
continue;
}
if(inCfg) {
if(!sst1InitParseFieldCfg(buffer))
/* Error processing .ini file */
exit(1);
} else if(inDac) {
if(!sst1InitParseFieldDac(buffer))
/* Error processing .ini file */
exit(1);
}
}
/* Dump CFG Data... */
envVarsPtr = envVarsBase;
while(envVarsPtr) {
printf("ENV VAR:%s VALUE:%s\n", envVarsPtr->envVariable,
envVarsPtr->envValue);
envVarsPtr = (sst1InitEnvVarStruct *) envVarsPtr->nextVar;
}
/* Dump Dac Data... */
dacPtr = dacStructBase;
while(dacPtr) {
printf("DAC MANU:%s DEVICE:%s\n", dacPtr->dacManufacturer,
dacPtr->dacDevice);
if(dacPtr->detect) {
printf("\tDetect:\n");
sst1InitPrintDacRdWr(dacPtr->detect, "\t\t");
}
if(dacPtr->setVideo) {
setVideo = dacPtr->setVideo;
while(1) {
printf("\tsetVideo (%dx%d @ %d Hz)\n",
setVideo->width, setVideo->height, setVideo->refresh);
sst1InitPrintDacRdWr(setVideo->setVideoRdWr, "\t\t");
if(!setVideo->nextSetVideo)
break;
else
setVideo = setVideo->nextSetVideo;
}
}
if(dacPtr->setMemClk) {
setMemClk = dacPtr->setMemClk;
while(1) {
printf("\tsetMemClk (%d MHz)\n", setMemClk->frequency);
sst1InitPrintDacRdWr(setMemClk->setMemClkRdWr, "\t\t");
if(!setMemClk->nextSetMemClk)
break;
else
setMemClk = setMemClk->nextSetMemClk;
}
}
dacPtr = dacPtr->nextDac;
}
fclose(file);
}
#endif
#if __DOS32__
static void sst1InitFixFilename(char *dst, char *src)
{
while(*src) {
@@ -363,7 +440,6 @@ static void sst1InitFixFilename(char *dst, char *src)
}
*dst = (char) NULL;
}
#endif
static int sst1InitFgets(char *string, FILE *stream)
@@ -468,7 +544,6 @@ static int sst1InitParseFieldCfg(char *string)
return(1);
}
#ifndef INIT_LINUX
static int sst1InitParseFieldDac(char *string)
{
char *dacFieldReference, *dacFieldValue;
@@ -669,6 +744,33 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr)
return(1);
}
#if TEST
static void sst1InitPrintDacRdWr(sst1InitDacRdWrStruct *dacRdWrBase,
char *prefix)
{
sst1InitDacRdWrStruct *dacRdWrPtr = dacRdWrBase;
while(dacRdWrPtr) {
if(dacRdWrPtr->type == DACRDWR_TYPE_WR) {
printf("%sDacWR", prefix);
printf("(0x%x,0x%x)\n", dacRdWrPtr->addr, dacRdWrPtr->data);
} else if(dacRdWrPtr->type == DACRDWR_TYPE_RDMODWR) {
printf("%sDacRD-MOD-WR", prefix);
printf("(0x%x,0x%x,0x%x)\n", dacRdWrPtr->addr, dacRdWrPtr->mask,
dacRdWrPtr->data);
} else if(dacRdWrPtr->type == DACRDWR_TYPE_RDNOCHECK) {
printf("%sDacRD-NOCHECK", prefix);
printf("(0x%x)\n", dacRdWrPtr->addr);
} else if(dacRdWrPtr->type == DACRDWR_TYPE_RDCHECK) {
printf("%sDacRD-CHECK", prefix);
printf("(0x%x,0x%x)\n", dacRdWrPtr->addr, dacRdWrPtr->data);
} else
printf("%sDAC???", prefix);
dacRdWrPtr = dacRdWrPtr->nextRdWr;
}
}
#endif /* TEST */
static int sst1InitParseSetVideoString(char *string, sst1InitDacStruct *dacBase)
{
int cntr = 0;
@@ -869,7 +971,6 @@ static int sst1InitParseSetVideoModeString(char *string,
}
return(1);
}
#endif
static void sst1InitToLower(char *string)
{
@@ -1019,6 +1120,6 @@ FX_ENTRY char* FX_CALL sst1InitGetenv(char *string)
}
#endif /* INIT_DOS */
#ifdef _WIN32
#ifdef __WIN32__
#pragma optimize ("",on)
#endif

View File

@@ -24,7 +24,7 @@
**
** Print functions for SST-1 Initialization routines
*/
#ifdef _WIN32
#ifdef __WIN32__
#pragma optimize ("",off)
#endif
#include <stdio.h>
@@ -83,6 +83,6 @@ FX_ENTRY void FX_CALL sst1InitVPrintf(const char *format, va_list args)
#endif
#ifdef _WIN32
#ifdef __WIN32__
#pragma optimize ("",on)
#endif

View File

@@ -1,5 +1,5 @@
#define MANVERSION 1
#define MANREVISION 1
#define BUILD_NUMBER 1
#define VERSIONSTR "Voodoo2 InitCode " "$Revision$" "\0"
#define MANVERSION 1
#define MANREVISION 1
#define BUILD_NUMBER 1
#define VERSIONSTR "Voodoo2 InitCode " "$Revision$" "\0"

View File

@@ -25,7 +25,7 @@
** Initialization code for initializing scanline interleaving
**
*/
#ifdef _WIN32
#ifdef __WIN32__
#pragma optimize ("",off)
#endif
#include <stdio.h>
@@ -89,7 +89,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1)
if(/* (sst1M->fbiMemSize != sst1S->fbiMemSize) || */
/*(sst1M->tmuMemSize[0] != sst1S->tmuMemSize[0]) || */
(sst1M->numberTmus != sst1S->numberTmus) ||
(sst1M->fbiBoardID != sst1S->fbiBoardID) ||
/* [koolsmoky] mismatched SLI support */
(!GETENV(("SSTV2_MISMATCHED_SLI")) && (sst1M->fbiBoardID != sst1S->fbiBoardID)) ||
/* (sst1M->fbiRevision != sst1S->fbiRevision) || */
/* (sst1M->tmuRevision != sst1S->tmuRevision) || */
(sst1M->fbiVideoStruct != sst1S->fbiVideoStruct)) {
@@ -736,6 +737,6 @@ sst1InitSliPaired(FxU32 *sstbase)
return sliPaired;
}
#ifdef _WIN32
#ifdef __WIN32__
#pragma optimize ("",on)
#endif

View File

@@ -135,13 +135,13 @@
** SSTV2_VFIFO_THRESH {0-31} Select video fifo threshold
** SSTV2_VSYNC hex Specify value of vSync video register
** SSTV2_NOREMAP 0 Don't try to remap single board sli.
** SSTV2_MISMATCHED_SLI X Allow mismatched SLI
**
** VOODOO2_FILE name Filename used in place of "voodoo2.ini"
** VOODOO2_PATH path Path used to locate "voodoo2.ini" file
**
*/
#ifdef _WIN32
#ifdef __WIN32__
#pragma optimize ("",off)
#endif
#include <stdio.h>
@@ -158,6 +158,7 @@
#define SST1INIT_ALLOCATE // Allocate variables in sst1init.h
#define FX_DLL_DEFINITION
#include <fxdll.h>
#if !macintosh && !__linux__
#include <fxremap.h>
#endif
@@ -209,11 +210,13 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber,
else
deviceID = 0x0002;
#if !DIRECTX
// Open PCI library (necessary for multiple calls to init routines, after
// PCI library is closed by pciClose() call in sst1InitShutdown().
//
// NB: It is safe to do this even if we never called pciClose.
pciOpen();
#endif
/* NB: firstTime does not get cleared until we actually find a
* board and get one mapped (A little weird to begin w/, but
@@ -448,9 +451,12 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitRegisters(FxU32 *sstbase)
if(GETENV(("SSTV2_TEXMAP_DISABLE")))
INIT_PRINTF(("sst1InitRegisters() WARNING: Disabling texture mapping\n"));
#if !DIRECTX
// Open PCI library (necessary for multiple calls to init routines, after
// PCI library is closed by pciClose() call in sst1InitShutdown()
pciOpen();
#endif
// Enable writes to the FBIINIT registers
// Do not allow writes into the pci fifo until everything is reset
@@ -1327,6 +1333,6 @@ sst1InitCachingAMD(FxU32* sstBase, FxBool enableP, FxBool hasP2MTRR)
return retVal;
} // sst1InitSetCachingAMD
#ifdef _WIN32
#ifdef __WIN32__
#pragma optimize ("",on)
#endif

View File

@@ -83,9 +83,7 @@
#else /* DIRECTX */
#include "ddglobal.h"
#ifdef _WIN32
#pragma optimize ("",off) /* ddglobal.h tuns this on for retail builds */
#endif
#undef INIT_PRINTF
#undef INIT_INFO
#undef GETENV
@@ -102,7 +100,8 @@
#define INIT_PRINTF 1 ? (void) 0 : (void)
#endif
#define INIT_INFO(A)
#define GETENV(A) ddgetenv(A)
/* #define GETENV(A) ddgetenv(A) */
#define GETENV(A) sst1InitGetenv(A)
#define ATOI(A) ddatoi(A)
#define ATOF(A) ddatof(A)
#define FTOL(A) ddftol(A)

View File

@@ -25,7 +25,7 @@
** Utility routines for SST-1 Initialization code
**
*/
#ifdef _WIN32
#ifdef __WIN32__
#pragma optimize ("",off)
#endif
#include <stdio.h>
@@ -1180,6 +1180,6 @@ void sst1InitDrawRectUsingTris(FxU32 *sstbase, FxU32 x, FxU32 y, FxU32 tSize)
ISET(sst->triangleCMD, 0xFFFFFFFF);
}
#ifdef _WIN32
#ifdef __WIN32__
#pragma optimize ("",on)
#endif

View File

@@ -25,7 +25,7 @@
** Initialization code for initializing SST-1 video unit
**
*/
#ifdef _WIN32
#ifdef __WIN32__
#pragma optimize ("",off)
#endif
#include <stdio.h>
@@ -1462,6 +1462,6 @@ setDelays:
return(FXTRUE);
}
#ifdef _WIN32
#ifdef __WIN32__
#pragma optimize ("",on)
#endif

View File

@@ -1,255 +1,255 @@
3DFX GLIDE Source Code General Public License
1. PREAMBLE
This license is for software that provides a 3D graphics application
program interface (API).The license is intended to offer terms similar
to some standard General Public Licenses designed to foster open
standards and unrestricted accessibility to source code. Some of these
licenses require that, as a condition of the license of the software,
any derivative works (that is, new software which is a work containing
the original program or a portion of it) must be available for general
use, without restriction other than for a minor transfer fee, and that
the source code for such derivative works must likewise be made
available. The only restriction is that such derivative works must be
subject to the same General Public License terms as the original work.
This 3dfx GLIDE Source Code General Public License differs from the
standard licenses of this type in that it does not require the entire
derivative work to be made available under the terms of this license
nor is the recipient required to make available the source code for
the entire derivative work. Rather, the license is limited to only the
identifiable portion of the derivative work that is derived from the
licensed software. The precise terms and conditions for copying,
distribution and modification follow.
2. DEFINITIONS
2.1 This License applies to any program (or other "work") which
contains a notice placed by the copyright holder saying it may be
distributed under the terms of this 3dfx GLIDE Source Code General
Public License.
2.2 The term "Program" as used in this Agreement refers to 3DFX's
GLIDE source code and object code and any Derivative Work.
2.3 "Derivative Work" means, for the purpose of the License, that
portion of any work that contains the Program or the identifiable
portion of a work that is derived from the Program, either verbatim or
with modifications and/or translated into another language, and that
performs 3D graphics API operations. It does not include any other
portions of a work.
2.4 "Modifications of the Program" means any work, which includes a
Derivative Work, and includes the whole of such work.
2.5 "License" means this 3dfx GLIDE Source Code General Public License.
2.6 The "Source Code" for a work means the preferred form of the work
for making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, any
associated interface definition files, and the scripts used to control
compilation and installation of the executable work.
2.7 "3dfx" means 3dfx Interactive, Inc.
3. LICENSED ACTIVITIES
3.1 COPYING - You may copy and distribute verbatim copies of the
Program's Source Code as you receive it, in any medium, subject to the
provision of section 3.3 and provided also that:
(a) you conspicuously and appropriately publish on each copy
an appropriate copyright notice (3dfx Interactive, Inc. 1999), a notice
that recipients who wish to copy, distribute or modify the Program can
only do so subject to this License, and a disclaimer of warranty as
set forth in section 5;
(b) keep intact all the notices that refer to this License and
to the absence of any warranty; and
(c) do not make any use of the GLIDE trademark without the prior
written permission of 3dfx, and
(d) give all recipients of the Program a copy of this License
along with the Program or instructions on how to easily receive a copy
of this License.
3.2 MODIFICATION OF THE PROGRAM/DERIVATIVE WORKS - You may modify your
copy or copies of the Program or any portion of it, and copy and
distribute such modifications subject to the provisions of section 3.3
and provided that you also meet all of the following conditions:
(a) you conspicuously and appropriately publish on each copy
of a Derivative Work an appropriate copyright notice, a notice that
recipients who wish to copy, distribute or modify the Derivative Work
can only do so subject to this License, and a disclaimer of warranty
as set forth in section 5;
(b) keep intact all the notices that refer to this License and
to the absence of any warranty; and
(c) give all recipients of the Derivative Work a copy of this
License along with the Derivative Work or instructions on how to easily
receive a copy of this License.
(d) You must cause the modified files of the Derivative Work
to carry prominent notices stating that you changed the files and the
date of any change.
(e) You must cause any Derivative Work that you distribute or
publish to be licensed at no charge to all third parties under the
terms of this License.
(f) You do not make any use of the GLIDE trademark without the
prior written permission of 3dfx.
(g) If the Derivative Work normally reads commands
interactively when run, you must cause it, when started running for
such interactive use, to print or display an announcement as follows:
"COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED THIS
SOFTWARE IS FREE AND PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESSED OR IMPLIED. THERE IS NO RIGHT TO USE THE GLIDE
TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX INTERACTIVE,
INC. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A FULL TEXT OF THE
DISTRIBUTION AND NON-WARRANTY PROVISIONS (REQUEST COPY FROM
INFO@3DFX.COM)."
(h) The requirements of this section 3.2 do not apply to the
modified work as a whole but only to the Derivative Work. It is not
the intent of this License to claim rights or contest your rights to
work written entirely by you; rather, the intent is to exercise the
right to control the distribution of Derivative Works.
3.3 DISTRIBUTION
(a) All copies of the Program or Derivative Works which are
distributed must include in the file headers the following language
verbatim:
"THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED
ONLY PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO
RIGHT TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF
3DFX INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM
THE DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC (info@3dfx.com).
THIS PROGRAM. IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
FULL TEXT OF THE NON-WARRANTY PROVISIONS.
USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS
IN TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
THE UNITED STATES.
COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED"
(b) You may distribute the Program or a Derivative Work in
object code or executable form under the terms of Sections 3.1 and 3.2
provided that you also do one of the following:
(1) Accompany it with the complete corresponding
machine-readable source code, which must be distributed under the
terms of Sections 3.1 and 3.2; or,
(2) Accompany it with a written offer, valid for at
least three years, to give any third party, for a charge no more than
your cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 3.1 and 3.2 on a medium
customarily used for software interchange; or,
(3) Accompany it with the information you received as
to the offer to distribute corresponding source code. (This alternative
is allowed only for noncommercial distribution and only if you received
the program in object code or executable form with such an offer, in
accord with Subsection 3.3(b)(2) above.)
(c) The source code distributed need not include anything
that is normally distributed (in either source or binary form) with
the major components (compiler, kernel, and so on) of the operating
system on which the executable runs, unless that component itself
accompanies the executable code.
(d) If distribution of executable code or object code is made
by offering access to copy from a designated place, then offering
equivalent access to copy the source code from the same place counts
as distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
(e) Each time you redistribute the Program or any Derivative
Work, the recipient automatically receives a license from 3dfx and
successor licensors to copy, distribute or modify the Program and
Derivative Works subject to the terms and conditions of the License.
You may not impose any further restrictions on the recipients'
exercise of the rights granted herein. You are not responsible for
enforcing compliance by third parties to this License.
(f) You may not make any use of the GLIDE trademark without
the prior written permission of 3dfx.
(g) You may not copy, modify, sublicense, or distribute the
Program or any Derivative Works except as expressly provided under
this License. Any attempt otherwise to copy, modify, sublicense or
distribute the Program or any Derivative Works is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
4. MISCELLANEOUS
4.1 Acceptance of this License is voluntary. By using, modifying or
distributing the Program or any Derivative Work, you indicate your
acceptance of this License to do so, and all its terms and conditions
for copying, distributing or modifying the Program or works based on
it. Nothing else grants you permission to modify or distribute the
Program or Derivative Works and doing so without acceptance of this
License is in violation of the U.S. and international copyright laws.
4.2 If the distribution and/or use of the Program or Derivative Works
is restricted in certain countries either by patents or by copyrighted
interfaces, the original copyright holder who places the Program under
this License may add an explicit geographical distribution limitation
excluding those countries, so that distribution is permitted only in
or among countries not thus excluded. In such case, this License
incorporates the limitation as if written in the body of this License.
4.3 This License is to be construed according to the laws of the
State of California and you consent to personal jurisdiction in the
State of California in the event it is necessary to enforce the
provisions of this License.
5. NO WARRANTIES
5.1 TO THE EXTENT PERMITTED BY APPLICABLE LAW, THERE IS NO WARRANTY
FOR THE PROGRAM. OR DERIVATIVE WORKS THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE PROGRAM AND ANY DERIVATIVE WORKS"AS IS"
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY
AND PERFORMANCE OF THE PROGRAM AND ANY DERIVATIVE WORK IS WITH YOU.
SHOULD THE PROGRAM OR ANY DERIVATIVE WORK PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
5.2 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL 3DFX
INTERACTIVE, INC., OR ANY OTHER COPYRIGHT HOLDER, OR ANY OTHER PARTY
WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM OR DERIVATIVE WORKS AS
PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
INABILITY TO USE THE PROGRAM OR DERIVATIVE WORKS (INCLUDING BUT NOT
LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES
SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM OR
DERIVATIVE WORKS TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH
HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
3DFX GLIDE Source Code General Public License
1. PREAMBLE
This license is for software that provides a 3D graphics application
program interface (API).The license is intended to offer terms similar
to some standard General Public Licenses designed to foster open
standards and unrestricted accessibility to source code. Some of these
licenses require that, as a condition of the license of the software,
any derivative works (that is, new software which is a work containing
the original program or a portion of it) must be available for general
use, without restriction other than for a minor transfer fee, and that
the source code for such derivative works must likewise be made
available. The only restriction is that such derivative works must be
subject to the same General Public License terms as the original work.
This 3dfx GLIDE Source Code General Public License differs from the
standard licenses of this type in that it does not require the entire
derivative work to be made available under the terms of this license
nor is the recipient required to make available the source code for
the entire derivative work. Rather, the license is limited to only the
identifiable portion of the derivative work that is derived from the
licensed software. The precise terms and conditions for copying,
distribution and modification follow.
2. DEFINITIONS
2.1 This License applies to any program (or other "work") which
contains a notice placed by the copyright holder saying it may be
distributed under the terms of this 3dfx GLIDE Source Code General
Public License.
2.2 The term "Program" as used in this Agreement refers to 3DFX's
GLIDE source code and object code and any Derivative Work.
2.3 "Derivative Work" means, for the purpose of the License, that
portion of any work that contains the Program or the identifiable
portion of a work that is derived from the Program, either verbatim or
with modifications and/or translated into another language, and that
performs 3D graphics API operations. It does not include any other
portions of a work.
2.4 "Modifications of the Program" means any work, which includes a
Derivative Work, and includes the whole of such work.
2.5 "License" means this 3dfx GLIDE Source Code General Public License.
2.6 The "Source Code" for a work means the preferred form of the work
for making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, any
associated interface definition files, and the scripts used to control
compilation and installation of the executable work.
2.7 "3dfx" means 3dfx Interactive, Inc.
3. LICENSED ACTIVITIES
3.1 COPYING - You may copy and distribute verbatim copies of the
Program's Source Code as you receive it, in any medium, subject to the
provision of section 3.3 and provided also that:
(a) you conspicuously and appropriately publish on each copy
an appropriate copyright notice (3dfx Interactive, Inc. 1999), a notice
that recipients who wish to copy, distribute or modify the Program can
only do so subject to this License, and a disclaimer of warranty as
set forth in section 5;
(b) keep intact all the notices that refer to this License and
to the absence of any warranty; and
(c) do not make any use of the GLIDE trademark without the prior
written permission of 3dfx, and
(d) give all recipients of the Program a copy of this License
along with the Program or instructions on how to easily receive a copy
of this License.
3.2 MODIFICATION OF THE PROGRAM/DERIVATIVE WORKS - You may modify your
copy or copies of the Program or any portion of it, and copy and
distribute such modifications subject to the provisions of section 3.3
and provided that you also meet all of the following conditions:
(a) you conspicuously and appropriately publish on each copy
of a Derivative Work an appropriate copyright notice, a notice that
recipients who wish to copy, distribute or modify the Derivative Work
can only do so subject to this License, and a disclaimer of warranty
as set forth in section 5;
(b) keep intact all the notices that refer to this License and
to the absence of any warranty; and
(c) give all recipients of the Derivative Work a copy of this
License along with the Derivative Work or instructions on how to easily
receive a copy of this License.
(d) You must cause the modified files of the Derivative Work
to carry prominent notices stating that you changed the files and the
date of any change.
(e) You must cause any Derivative Work that you distribute or
publish to be licensed at no charge to all third parties under the
terms of this License.
(f) You do not make any use of the GLIDE trademark without the
prior written permission of 3dfx.
(g) If the Derivative Work normally reads commands
interactively when run, you must cause it, when started running for
such interactive use, to print or display an announcement as follows:
"COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED THIS
SOFTWARE IS FREE AND PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESSED OR IMPLIED. THERE IS NO RIGHT TO USE THE GLIDE
TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX INTERACTIVE,
INC. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A FULL TEXT OF THE
DISTRIBUTION AND NON-WARRANTY PROVISIONS (REQUEST COPY FROM
INFO@3DFX.COM)."
(h) The requirements of this section 3.2 do not apply to the
modified work as a whole but only to the Derivative Work. It is not
the intent of this License to claim rights or contest your rights to
work written entirely by you; rather, the intent is to exercise the
right to control the distribution of Derivative Works.
3.3 DISTRIBUTION
(a) All copies of the Program or Derivative Works which are
distributed must include in the file headers the following language
verbatim:
"THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED
ONLY PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO
RIGHT TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF
3DFX INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM
THE DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC (info@3dfx.com).
THIS PROGRAM. IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
FULL TEXT OF THE NON-WARRANTY PROVISIONS.
USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS
IN TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
THE UNITED STATES.
COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED"
(b) You may distribute the Program or a Derivative Work in
object code or executable form under the terms of Sections 3.1 and 3.2
provided that you also do one of the following:
(1) Accompany it with the complete corresponding
machine-readable source code, which must be distributed under the
terms of Sections 3.1 and 3.2; or,
(2) Accompany it with a written offer, valid for at
least three years, to give any third party, for a charge no more than
your cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 3.1 and 3.2 on a medium
customarily used for software interchange; or,
(3) Accompany it with the information you received as
to the offer to distribute corresponding source code. (This alternative
is allowed only for noncommercial distribution and only if you received
the program in object code or executable form with such an offer, in
accord with Subsection 3.3(b)(2) above.)
(c) The source code distributed need not include anything
that is normally distributed (in either source or binary form) with
the major components (compiler, kernel, and so on) of the operating
system on which the executable runs, unless that component itself
accompanies the executable code.
(d) If distribution of executable code or object code is made
by offering access to copy from a designated place, then offering
equivalent access to copy the source code from the same place counts
as distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
(e) Each time you redistribute the Program or any Derivative
Work, the recipient automatically receives a license from 3dfx and
successor licensors to copy, distribute or modify the Program and
Derivative Works subject to the terms and conditions of the License.
You may not impose any further restrictions on the recipients'
exercise of the rights granted herein. You are not responsible for
enforcing compliance by third parties to this License.
(f) You may not make any use of the GLIDE trademark without
the prior written permission of 3dfx.
(g) You may not copy, modify, sublicense, or distribute the
Program or any Derivative Works except as expressly provided under
this License. Any attempt otherwise to copy, modify, sublicense or
distribute the Program or any Derivative Works is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
4. MISCELLANEOUS
4.1 Acceptance of this License is voluntary. By using, modifying or
distributing the Program or any Derivative Work, you indicate your
acceptance of this License to do so, and all its terms and conditions
for copying, distributing or modifying the Program or works based on
it. Nothing else grants you permission to modify or distribute the
Program or Derivative Works and doing so without acceptance of this
License is in violation of the U.S. and international copyright laws.
4.2 If the distribution and/or use of the Program or Derivative Works
is restricted in certain countries either by patents or by copyrighted
interfaces, the original copyright holder who places the Program under
this License may add an explicit geographical distribution limitation
excluding those countries, so that distribution is permitted only in
or among countries not thus excluded. In such case, this License
incorporates the limitation as if written in the body of this License.
4.3 This License is to be construed according to the laws of the
State of California and you consent to personal jurisdiction in the
State of California in the event it is necessary to enforce the
provisions of this License.
5. NO WARRANTIES
5.1 TO THE EXTENT PERMITTED BY APPLICABLE LAW, THERE IS NO WARRANTY
FOR THE PROGRAM. OR DERIVATIVE WORKS THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE PROGRAM AND ANY DERIVATIVE WORKS"AS IS"
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY
AND PERFORMANCE OF THE PROGRAM AND ANY DERIVATIVE WORK IS WITH YOU.
SHOULD THE PROGRAM OR ANY DERIVATIVE WORK PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
5.2 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL 3DFX
INTERACTIVE, INC., OR ANY OTHER COPYRIGHT HOLDER, OR ANY OTHER PARTY
WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM OR DERIVATIVE WORKS AS
PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
INABILITY TO USE THE PROGRAM OR DERIVATIVE WORKS (INCLUDING BUT NOT
LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES
SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM OR
DERIVATIVE WORKS TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH
HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.

1327
glide2x/h3/cinit/h3cinit.c Normal file

File diff suppressed because it is too large Load Diff

132
glide2x/h3/cinit/h3cinit.h Normal file
View File

@@ -0,0 +1,132 @@
/*
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
**
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
** THE UNITED STATES.
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
*/
#ifndef __H3CINIT_H__
#define __H3CINIT_H__
#include <3dfx.h>
#define H3_GRXCLK_SPEED 100
#define H4_GRXCLK_SPEED 143
#define H4_OEM_GRXCLK_SPEED 141
#define H4_BRINGUP_GRXCLK_SPEED 100
#ifdef H4
#define DEFAULT_GRXCLK_SPEED H4_BRINGUP_GRXCLK_SPEED
#else
#define DEFAULT_GRXCLK_SPEED H3_GRXCLK_SPEED
#endif
FxU32 // return # of MB of memory
h3InitGetMemSize(FxU32 regBase); // init register base
FxU32 // return # of MB of memory
h3InitSgram(FxU32 regBase, // init iegister base
FxU32 sgramMode,
FxU32 sgramMask,
FxU32 sgramColor,
char *vendorName); // NULL or name of SGRAM vendor
void
h3InitPlls(FxU32 regBase, // init iegister base
FxU32 grxSpeedInMHz, // desired GRX clock frequency (MHz)
FxU32 memSpeedInMHz); // desired MEM clock frequency (MHz)
void
h4InitPlls(FxU32 regBase, // init register base
FxU32 deviceID, // H4 or H4_OEM
FxU32 grxSpeedInMHz); // desired clock frequency (MHz)
void
h3InitVga(
FxU32 regBase, // memory base address
FxU32 legacyDecode); // 1=enable VGA decode, 0=disable
void
h3InitVideoProc(
FxU32 regBase, // memory base address
FxU32 vidProcCfg); // vidProcCfg register control bits
FxBool
h3InitSetVideoMode(
FxU32 regBase, // memory base address
FxU32 xRes, // x resolution
FxU32 yRes, // y resolution
FxU32 refresh, // refresh freq
#if defined(H3VDD) && defined(H3_B0)
FxU32 loadClut, // really a bool, should we load the lookup table
FxU32 scanlinedouble); // set scanline double bit and double y?
#else
FxU32 loadClut) ; // initialize clut entries?
#endif
void
h3InitVideoDesktopSurface(
FxU32 regBase,
FxU32 enable, // 1=enable desktop surface (DS), 1=disable
FxU32 tiled, // 0=DS linear, 1=tiled
FxU32 pixFmt, // pixel format of DS
FxU32 clutBypass, // bypass clut for DS?
FxU32 clutSelect, // 0=lower 256 CLUT entries, 1=upper 256
FxU32 startAddress, // board address of beginning of DS
FxU32 stride); // distance between scanlines of the DS, in
// units of bytes for linear DS's and tiles for
// tiled DS's
void
h3InitVideoOverlaySurface(
FxU32 regBase,
FxU32 enable, // 1=enable Overlay surface (OS), 1=disable
FxU32 stereo, // 1=enable OS stereo, 0=disable
FxU32 horizScaling, // 1=enable horizontal scaling, 0=disable
FxU32 dudx, // horizontal scale factor (ignored if not
// scaling)
FxU32 verticalScaling, // 1=enable vertical scaling, 0=disable
FxU32 dvdy, // vertical scale factor (ignored if not
// scaling)
FxU32 filterMode, // duh
FxU32 tiled, // 0=OS linear, 1=tiled
FxU32 pixFmt, // pixel format of OS
FxU32 clutBypass, // bypass clut for OS?
FxU32 clutSelect, // 0=lower 256 CLUT entries, 1=upper 256
FxU32 startAddress, // board address of beginning of OS
FxU32 stride); // distance between scanlines of the OS, in
// units of bytes for linear OS's and tiles for
// tiled OS's
#ifndef H3VDD
void
h3InitMeasureSiProcess(
FxU32 regBase); // init register base
#endif // #ifndef H3VDD
void
h3InitBlockWrite(
FxU32 regBase,
FxU32 enable, // 1=enable block writes, 0=disable
FxU32 threshhold); // block write threshhold
void
h3InitResetAll(
FxU32 regBase); // init register base
#endif /* __H3CINIT_H__ */

View File

@@ -0,0 +1,85 @@
/*
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
**
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
** THE UNITED STATES.
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
*/
#include <stddef.h>
#ifdef __DJGPP__
#include <fxdpmi.h>
#endif
#if defined(__WATCOMC__)
#include <conio.h>
#define _inp inp
#define _outp outp
#define _inpw inpw
#define _outpw outpw
#define _inpd inpd
#define _outpd outpd
#endif
#ifdef __linux__
#define _inp pioInByte
#define _outp pioOutByte
#define _inpw pioInWord
#define _outpw pioOutWord
#define _inpd pioInLong
#define _outpd pioOutLong
#endif
#define SSTIOADDR(regName) ((FxU16)offsetof(SstIORegs, regName))
#define ISET32(addr, value) _outpd((FxU16) ((FxU16) regBase + (FxU16) (SSTIOADDR(addr))), value)
#define IGET32(addr) _inpd((FxU16) ((FxU16) regBase + (FxU16) (SSTIOADDR(addr))))
#define ISET8PHYS(a,b) {\
FxU16 port = (FxU16) (regBase) + (FxU16) (a);\
GDBG_INFO(120, "OUT8: Port 0x%x Value 0x%x\n", port, b);\
_outp(port, (FxU8) (b));}
#define ISET16PHYS(a,b) {\
FxU16 port = (FxU16)(regBase) + (FxU16)(a);\
GDBG_INFO(120, "OUT16: Port 0x%x Value 0x%x\n", port, b);\
_outpw(port, (FxU16) (b));}
#define IGET8PHYS(a) _inp((FxU16) ((FxU16) (regBase) + (FxU16) (a)))
#define IGET16PHYS(a) _inpw((FxU16) ((FxU16) (regBase) + (FxU16)(a)))
#define CHECKFORROOM while (! (_inp((FxU16) regBase) & (FxU16)(0x3f)))
#define MESSAGE GDBG_PRINTF
#ifdef OLD
#define ISET32(a,b)\
GDBG_INFO(120, "SET32: Register 0x%x Value 0x%x\n", (FxU32) (&((SstIORegs *)regBase)->a) - (FxU32) regBase, b); \
((FxU32) (((SstIORegs *) regBase)->a)) = (FxU32) b
#define IGET32(a) ((FxU32) (((SstIORegs *) regBase)->a))
#endif /* #ifdef OLD */

257
glide2x/h3/cinit/h4oempll.h Normal file
View File

@@ -0,0 +1,257 @@
/*
** Copyright (c) 1995-1999, 3Dfx Interactive, Inc.
** All Rights Reserved.
**
** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.;
** the contents of this file may not be disclosed to third parties, copied or
** duplicated in any form, in whole or in part, without the prior written
** permission of 3Dfx Interactive, Inc.
**
** RESTRICTED RIGHTS LEGEND:
** Use, duplication or disclosure by the Government is subject to restrictions
** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
** rights reserved under the Copyright Laws of the United States.
**
** File name: h4oempll.h
**
** Description: Avenger OEM PLL table and values.
**
** $History: h4oempll.h $
**
** ***************** Version 2 *****************
** User: Michael Date: 1/08/99 Time: 1:50p
** Updated in $/devel/h3/Win95/dx/minivdd
** Implement the 3Dfx/STB unified header.
**
** ***************** Version 1 *****************
** User: Andrew Date: 12/20/98 Time: 11:10a
** Created in $/devel/h3/Win95/dx/minivdd
** H4 OEM Pll Table
**
** ***************** Version 5 *****************
** User: Pault Date: 11/05/98 Time: 2:07p
** Updated in $/devel/h4/cinit
** The table now goes up to 220 MHz for Avenger. Also, all of the entries
** up through 141 MHz have the M factor set at 24 so the entries can be
** used with Avenger OEM.
**
** ***************** Version 3 *****************
** User: Artg Date: 8/27/98 Time: 11:08a
** Updated in $/devel/h3/Win95/dx/minivdd
** added guard ifdef for redundant plltable define.
**
** ***************** Version 2 *****************
** User: Ken Date: 4/15/98 Time: 6:42p
** Updated in $/devel/h3/win95/dx/minivdd
** added unified header to all files, with revision, etc. info in it
**
*/
//
// generated by gen_plltable.pl at Thu Nov 5 12:38:23 1998
//
#define MIN_PLL_FREQ 30
#define MAX_PLL_FREQ 120
#define MAX_H4_OEM_PLL_FREQ 141
#define MAX_H4_PLL_FREQ 220
FxU32 _h4oempllTable[] = {
// pllCtrl n m k actual(MHz)
// ------- --- --- --- -----------
0x00003460, // 52 24 0 29.737758
0x00003660, // 54 24 0 30.839157
0x00003860, // 56 24 0 31.940555
0x00003A60, // 58 24 0 33.041954
0x00003C60, // 60 24 0 34.143352
0x00003E60, // 62 24 0 35.244751
0x00003F60, // 63 24 0 35.795450
0x00004160, // 65 24 0 36.896848
0x00004360, // 67 24 0 37.998247
0x00004560, // 69 24 0 39.099645
0x00004760, // 71 24 0 40.201044
0x00004860, // 72 24 0 40.751743
0x00004A60, // 74 24 0 41.853142
0x00004C60, // 76 24 0 42.954540
0x00004E60, // 78 24 0 44.055938
0x00005060, // 80 24 0 45.157337
0x00005260, // 82 24 0 46.258735
0x00005360, // 83 24 0 46.809435
0x00005560, // 85 24 0 47.910833
0x00005760, // 87 24 0 49.012232
0x00005960, // 89 24 0 50.113630
0x00005B60, // 91 24 0 51.215028
0x00005C60, // 92 24 0 51.765728
0x00005E60, // 94 24 0 52.867126
0x00006060, // 96 24 0 53.968525
0x00006260, // 98 24 0 55.069923
0x00006460, // 100 24 0 56.171322
0x00006660, // 102 24 0 57.272720
0x00006760, // 103 24 0 57.823419
0x00006960, // 105 24 0 58.924818
0x00006B60, // 107 24 0 60.026216
0x00006D60, // 109 24 0 61.127615
0x00006F60, // 111 24 0 62.229013
0x00007060, // 112 24 0 62.779712
0x00007260, // 114 24 0 63.881111
0x00007460, // 116 24 0 64.982509
0x00007660, // 118 24 0 66.083908
0x00007860, // 120 24 0 67.185306
0x00007960, // 121 24 0 67.736005
0x00007B60, // 123 24 0 68.837404
0x00007D60, // 125 24 0 69.938802
0x00007F60, // 127 24 0 71.040201
0x00008160, // 129 24 0 72.141599
0x00008360, // 131 24 0 73.242998
0x00008460, // 132 24 0 73.793697
0x00008660, // 134 24 0 74.895095
0x00008860, // 136 24 0 75.996494
0x00008A60, // 138 24 0 77.097892
0x00008C60, // 140 24 0 78.199291
0x00008D60, // 141 24 0 78.749990
0x00008F60, // 143 24 0 79.851388
0x00009160, // 145 24 0 80.952787
0x00009360, // 147 24 0 82.054185
0x00009560, // 149 24 0 83.155584
0x00009760, // 151 24 0 84.256982
0x00009860, // 152 24 0 84.807682
0x00009A60, // 154 24 0 85.909080
0x00009C60, // 156 24 0 87.010478
0x00009E60, // 158 24 0 88.111877
0x0000A060, // 160 24 0 89.213275
0x0000A160, // 161 24 0 89.763975
0x0000A360, // 163 24 0 90.865373
0x0000A560, // 165 24 0 91.966772
0x0000A760, // 167 24 0 93.068170
0x0000A960, // 169 24 0 94.169568
0x0000AB60, // 171 24 0 95.270967
0x0000AC60, // 172 24 0 95.821666
0x0000AE60, // 174 24 0 96.923065
0x0000B060, // 176 24 0 98.024463
0x0000B260, // 178 24 0 99.125862
0x0000B460, // 180 24 0 100.227260
0x0000B560, // 181 24 0 100.777959
0x0000B760, // 183 24 0 101.879358
0x0000B960, // 185 24 0 102.980756
0x0000BB60, // 187 24 0 104.082155
0x0000BD60, // 189 24 0 105.183553
0x0000BE60, // 190 24 0 105.734252
0x0000C060, // 192 24 0 106.835651
0x0000C260, // 194 24 0 107.937049
0x0000C460, // 196 24 0 109.038448
0x0000C660, // 198 24 0 110.139846
0x0000C860, // 200 24 0 111.241245
0x0000C960, // 201 24 0 111.791944
0x0000CB60, // 203 24 0 112.893342
0x0000CD60, // 205 24 0 113.994741
0x0000CF60, // 207 24 0 115.096139
0x0000D160, // 209 24 0 116.197538
0x0000D260, // 210 24 0 116.748237
0x0000D460, // 212 24 0 117.849635
0x0000D660, // 214 24 0 118.951034
0x0000D860, // 216 24 0 120.052432
0x0000DA60, // 218 24 0 121.153831
0x0000DC60, // 220 24 0 122.255229
0x0000DD60, // 221 24 0 122.805928
0x0000DF60, // 223 24 0 123.907327
0x0000E160, // 225 24 0 125.008725
0x0000E360, // 227 24 0 126.110124
0x0000E560, // 229 24 0 127.211522
0x0000E660, // 230 24 0 127.762222
0x0000E860, // 232 24 0 128.863620
0x0000EA60, // 234 24 0 129.965018
0x0000EC60, // 236 24 0 131.066417
0x0000EE60, // 238 24 0 132.167815
0x0000F060, // 240 24 0 133.269214
0x0000F160, // 241 24 0 133.819913
0x0000F360, // 243 24 0 134.921312
0x0000F560, // 245 24 0 136.022710
0x0000F760, // 247 24 0 137.124108
0x0000F960, // 249 24 0 138.225507
0x0000FA60, // 250 24 0 138.776206
0x0000FC60, // 252 24 0 139.877605
0x0000FE60, // 254 24 0 140.979003
0x00007528, // 117 10 0 141.988618
0x00001200, // 18 0 0 143.181800
0x0000B340, // 179 16 0 143.977254
0x00004F18, // 79 6 0 144.971573
0x0000310C, // 49 3 0 146.045436
0x00009834, // 152 13 0 146.999981
0x00001D04, // 29 1 0 147.954527
0x0000E350, // 227 20 0 149.039237
0x0000DA4C, // 218 19 0 149.999981
0x00007224, // 114 9 0 150.991716
0x0000882C, // 136 11 0 151.992988
0x0000C944, // 201 17 0 152.978449
0x00002908, // 41 2 0 153.920435
0x0000F754, // 247 21 0 155.009862
0x0000CD44, // 205 17 0 155.992803
0x0000FA54, // 250 21 0 156.877450
0x0000FC54, // 252 21 0 158.122510
0x0000D144, // 209 17 0 159.007157
0x0000BC3C, // 188 15 0 160.026718
0x00002B08, // 43 2 0 161.079525
0x0000D544, // 213 17 0 162.021511
0x0000922C, // 146 11 0 163.006972
0x00007C24, // 124 9 0 164.008244
0x0000F04C, // 240 19 0 164.999979
0x0000FD50, // 253 20 0 165.960723
0x00002104, // 33 1 0 167.045433
0x0000AE34, // 174 13 0 167.999979
0x0000390C, // 57 3 0 168.954524
0x00005D18, // 93 6 0 170.028388
0x0000D540, // 213 16 0 171.022706
0x00001600, // 22 0 0 171.818160
0x00008F28, // 143 10 0 173.011342
0x00009C2C, // 156 11 0 174.020957
0x00006C1C, // 108 7 0 174.999978
0x0000CF3C, // 207 15 0 176.029389
0x00008624, // 134 9 0 177.024771
0x00005514, // 85 5 0 177.954523
0x00001700, // 23 0 0 178.977250
0x00005614, // 86 5 0 179.999977
0x0000AF30, // 175 12 0 181.022704
0x00005714, // 87 5 0 182.045431
0x0000711C, // 113 7 0 182.954522
0x0000A52C, // 165 11 0 183.933543
0x0000A62C, // 166 11 0 185.034942
0x00001800, // 24 0 0 186.136340
0x0000DC3C, // 220 15 0 186.978586
0x0000C334, // 195 13 0 188.045431
0x0000400C, // 64 3 0 188.999976
0x00009024, // 144 9 0 190.041298
0x00002604, // 38 1 0 190.909067
0x0000E23C, // 226 15 0 192.032061
0x0000FE44, // 254 17 0 192.918636
0x00009324, // 147 9 0 193.946256
0x0000AF2C, // 175 11 0 194.947528
0x0000D938, // 217 14 0 195.980089
0x0000E83C, // 232 15 0 197.085536
0x00005110, // 81 4 0 198.068157
0x00008920, // 137 8 0 199.022702
0x0000F940, // 249 16 0 199.659066
0x0000FB40, // 251 16 0 201.249974
0x00007D1C, // 125 7 0 202.045429
0x0000EF3C, // 239 15 0 202.981258
0x00003708, // 55 2 0 204.034065
0x0000E338, // 227 14 0 204.928951
0x0000B92C, // 185 11 0 205.961512
0x00009D24, // 157 9 0 206.962784
0x0000F53C, // 245 15 0 208.034733
0x0000470C, // 71 3 0 209.045428
0x00002A04, // 42 1 0 209.999973
0x0000DB34, // 219 13 0 210.954519
0x0000EB38, // 235 14 0 212.088041
0x00007518, // 117 6 0 212.982927
0x0000FC3C, // 252 15 0 213.930454
0x00001C00, // 28 0 0 214.772700
0x0000B328, // 179 10 0 215.965882
0x0000C32C, // 195 11 0 216.975497
0x0000871C, // 135 7 0 217.954518
0x00009720, // 151 8 0 219.068154
0x0000A724, // 167 9 0 219.979311
};
FxU32 *h4oempllTable = (FxU32*) (_h4oempllTable - MIN_PLL_FREQ);

277
glide2x/h3/cinit/h4pll.h Normal file
View File

@@ -0,0 +1,277 @@
/*
** Copyright (c) 1995-1999, 3Dfx Interactive, Inc.
** All Rights Reserved.
**
** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.;
** the contents of this file may not be disclosed to third parties, copied or
** duplicated in any form, in whole or in part, without the prior written
** permission of 3Dfx Interactive, Inc.
**
** RESTRICTED RIGHTS LEGEND:
** Use, duplication or disclosure by the Government is subject to restrictions
** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
** rights reserved under the Copyright Laws of the United States.
**
** File name: h4pll.h
**
** Description: Avenger PLL table and values.
**
** $History: h4pll.h $
**
** ***************** Version 2 *****************
** User: Michael Date: 1/08/99 Time: 1:51p
** Updated in $/devel/h3/Win95/dx/minivdd
** Implement the 3Dfx/STB unified header.
**
** ***************** Version 1 *****************
** User: Andrew Date: 11/18/98 Time: 12:27p
** Created in $/devel/h3/Win95/dx/minivdd
** Pll Table for Avenger
**
** ***************** Version 8 *****************
** User: Pault Date: 11/16/98 Time: 3:30p
** Updated in $/devel/h4/cinit
** This version of the table has m=k=1 and is based on the same
** calculations we have been using in the lab. This will not work for
** AvengerOEM.
**
** ***************** Version 7 *****************
** User: Pault Date: 11/15/98 Time: 4:17p
** Updated in $/devel/h4/cinit
** Added missing pllTable definition at the bottom of the file.
**
** ***************** Version 6 *****************
** User: Pault Date: 11/15/98 Time: 2:00p
** Updated in $/devel/h4/cinit
** Temporary table to work with Avenger. This table has k=1. But m values
** are not wedged to 24 below 141 MHz, so this table with not work with
** AvengerOEM.
**
** ***************** Version 5 *****************
** User: Pault Date: 11/05/98 Time: 2:07p
** Updated in $/devel/h4/cinit
** The table now goes up to 220 MHz for Avenger. Also, all of the entries
** up through 141 MHz have the M factor set at 24 so the entries can be
** used with Avenger OEM.
**
** ***************** Version 3 *****************
** User: Artg Date: 8/27/98 Time: 11:08a
** Updated in $/devel/h3/Win95/dx/minivdd
** added guard ifdef for redundant plltable define.
**
** ***************** Version 2 *****************
** User: Ken Date: 4/15/98 Time: 6:42p
** Updated in $/devel/h3/win95/dx/minivdd
** added unified header to all files, with revision, etc. info in it
**
*/
//
// generated by gen_plltable_at.pl at Sun Nov 15 14:16:18 1998
//
#define MIN_PLL_FREQ 30
#define MAX_PLL_FREQ 120
#define MAX_H4_OEM_PLL_FREQ 141
#define MAX_H4_PLL_FREQ 220
FxU32 _h4pllTable[] = {
// pllCtrl n m k actual(MHz)
// ------- --- --- --- -----------
0x00000B05, // 11 1 1 31.022723
0x00000B05, // 11 1 1 31.022723
0x00000B05, // 11 1 1 31.022723
0x00000C05, // 12 1 1 33.409087
0x00000C05, // 12 1 1 33.409087
0x00000D05, // 13 1 1 35.795450
0x00000D05, // 13 1 1 35.795450
0x00000E05, // 14 1 1 38.181813
0x00000E05, // 14 1 1 38.181813
0x00000E05, // 14 1 1 38.181813
0x00000F05, // 15 1 1 40.568177
0x00000F05, // 15 1 1 40.568177
0x00001005, // 16 1 1 42.954540
0x00001005, // 16 1 1 42.954540
0x00001005, // 16 1 1 42.954540
0x00001105, // 17 1 1 45.340903
0x00001105, // 17 1 1 45.340903
0x00001205, // 18 1 1 47.727267
0x00001205, // 18 1 1 47.727267
0x00001305, // 19 1 1 50.113630
0x00001305, // 19 1 1 50.113630
0x00001305, // 19 1 1 50.113630
0x00001405, // 20 1 1 52.499993
0x00001405, // 20 1 1 52.499993
0x00001505, // 21 1 1 54.886357
0x00001505, // 21 1 1 54.886357
0x00001505, // 21 1 1 54.886357
0x00001605, // 22 1 1 57.272720
0x00001605, // 22 1 1 57.272720
0x00001705, // 23 1 1 59.659083
0x00001705, // 23 1 1 59.659083
0x00001805, // 24 1 1 62.045447
0x00001805, // 24 1 1 62.045447
0x00001805, // 24 1 1 62.045447
0x00001905, // 25 1 1 64.431810
0x00001905, // 25 1 1 64.431810
0x00001A05, // 26 1 1 66.818173
0x00001A05, // 26 1 1 66.818173
0x00001A05, // 26 1 1 66.818173
0x00001B05, // 27 1 1 69.204537
0x00001B05, // 27 1 1 69.204537
0x00001C05, // 28 1 1 71.590900
0x00001C05, // 28 1 1 71.590900
0x00001D05, // 29 1 1 73.977263
0x00001D05, // 29 1 1 73.977263
0x00001D05, // 29 1 1 73.977263
0x00001E05, // 30 1 1 76.363627
0x00001E05, // 30 1 1 76.363627
0x00001F05, // 31 1 1 78.749990
0x00001F05, // 31 1 1 78.749990
0x00002005, // 32 1 1 81.136353
0x00002005, // 32 1 1 81.136353
0x00002005, // 32 1 1 81.136353
0x00002105, // 33 1 1 83.522717
0x00002105, // 33 1 1 83.522717
0x00002205, // 34 1 1 85.909080
0x00002205, // 34 1 1 85.909080
0x00002205, // 34 1 1 85.909080
0x00002305, // 35 1 1 88.295443
0x00002305, // 35 1 1 88.295443
0x00002405, // 36 1 1 90.681807
0x00002405, // 36 1 1 90.681807
0x00002505, // 37 1 1 93.068170
0x00002505, // 37 1 1 93.068170
0x00002505, // 37 1 1 93.068170
0x00002605, // 38 1 1 95.454533
0x00002605, // 38 1 1 95.454533
0x00002705, // 39 1 1 97.840897
0x00002705, // 39 1 1 97.840897
0x00002705, // 39 1 1 97.840897
0x00002805, // 40 1 1 100.227260
0x00002805, // 40 1 1 100.227260
0x00002905, // 41 1 1 102.613623
0x00002905, // 41 1 1 102.613623
0x00002A05, // 42 1 1 104.999987
0x00002A05, // 42 1 1 104.999987
0x00002A05, // 42 1 1 104.999987
0x00002B05, // 43 1 1 107.386350
0x00002B05, // 43 1 1 107.386350
0x00002C05, // 44 1 1 109.772713
0x00002C05, // 44 1 1 109.772713
0x00002D05, // 45 1 1 112.159077
0x00002D05, // 45 1 1 112.159077
0x00002D05, // 45 1 1 112.159077
0x00002E05, // 46 1 1 114.545440
0x00002E05, // 46 1 1 114.545440
0x00002F05, // 47 1 1 116.931803
0x00002F05, // 47 1 1 116.931803
0x00002F05, // 47 1 1 116.931803
0x00003005, // 48 1 1 119.318167
0x00003005, // 48 1 1 119.318167
0x00003105, // 49 1 1 121.704530
0x00003105, // 49 1 1 121.704530
0x00003205, // 50 1 1 124.090893
0x00003205, // 50 1 1 124.090893
0x00003205, // 50 1 1 124.090893
0x00003305, // 51 1 1 126.477257
0x00003305, // 51 1 1 126.477257
0x00003405, // 52 1 1 128.863620
0x00003405, // 52 1 1 128.863620
0x00003405, // 52 1 1 128.863620
0x00003505, // 53 1 1 131.249983
0x00003505, // 53 1 1 131.249983
0x00003605, // 54 1 1 133.636347
0x00003605, // 54 1 1 133.636347
0x00003705, // 55 1 1 136.022710
0x00003705, // 55 1 1 136.022710
0x00003705, // 55 1 1 136.022710
0x00003805, // 56 1 1 138.409073
0x00003805, // 56 1 1 138.409073
0x00003905, // 57 1 1 140.795437
0x00003905, // 57 1 1 140.795437
0x00003A05, // 58 1 1 143.181800
0x00003A05, // 58 1 1 143.181800
0x00003A05, // 58 1 1 143.181800
0x00003B05, // 59 1 1 145.568163
0x00003B05, // 59 1 1 145.568163
0x00003C05, // 60 1 1 147.954527
0x00003C05, // 60 1 1 147.954527
0x00003C05, // 60 1 1 147.954527
0x00003D05, // 61 1 1 150.340890
0x00003D05, // 61 1 1 150.340890
0x00003E05, // 62 1 1 152.727253
0x00003E05, // 62 1 1 152.727253
0x00003F05, // 63 1 1 155.113617
0x00003F05, // 63 1 1 155.113617
0x00003F05, // 63 1 1 155.113617
0x00004005, // 64 1 1 157.499980
0x00004005, // 64 1 1 157.499980
0x00004105, // 65 1 1 159.886343
0x00004105, // 65 1 1 159.886343
0x00004105, // 65 1 1 159.886343
0x00004205, // 66 1 1 162.272707
0x00004205, // 66 1 1 162.272707
0x00004305, // 67 1 1 164.659070
0x00004305, // 67 1 1 164.659070
0x0000e721, // 68 1 1 166.81
0x0000e721, // 68 1 1 166.81
0x0000e721, // 68 1 1 166.81
0x00004505, // 69 1 1 169.431797
0x00004505, // 69 1 1 169.431797
0x00004605, // 70 1 1 171.818160
0x00004605, // 70 1 1 171.818160
0x00004605, // 70 1 1 171.818160
0x00004705, // 71 1 1 174.204523
0x00004705, // 71 1 1 174.204523
0x00004805, // 72 1 1 176.590887
0x00004805, // 72 1 1 176.590887
0x00004905, // 73 1 1 178.977250
0x00004905, // 73 1 1 178.977250
0x00004905, // 73 1 1 178.977250
0x00004A05, // 74 1 1 181.363613
0x00004A05, // 74 1 1 181.363613
0x00004B05, // 75 1 1 183.749977
0x00004B05, // 75 1 1 183.749977
0x00004C05, // 76 1 1 186.136340
0x00004C05, // 76 1 1 186.136340
0x00004C05, // 76 1 1 186.136340
0x00004D05, // 77 1 1 188.522703
0x00004D05, // 77 1 1 188.522703
0x00004E05, // 78 1 1 190.909067
0x00004E05, // 78 1 1 190.909067
0x00004E05, // 78 1 1 190.909067
0x00004F05, // 79 1 1 193.295430
0x00004F05, // 79 1 1 193.295430
0x00005005, // 80 1 1 195.681793
0x00005005, // 80 1 1 195.681793
0x00005105, // 81 1 1 198.068157
0x00005105, // 81 1 1 198.068157
0x00005105, // 81 1 1 198.068157
0x00005205, // 82 1 1 200.454520
0x00005205, // 82 1 1 200.454520
0x00005305, // 83 1 1 202.840883
0x00005305, // 83 1 1 202.840883
0x00005305, // 83 1 1 202.840883
0x00005405, // 84 1 1 205.227247
0x00005405, // 84 1 1 205.227247
0x00005505, // 85 1 1 207.613610
0x00005505, // 85 1 1 207.613610
0x00005605, // 86 1 1 209.999973
0x00005605, // 86 1 1 209.999973
0x00005605, // 86 1 1 209.999973
0x00005705, // 87 1 1 212.386337
0x00005705, // 87 1 1 212.386337
0x00005805, // 88 1 1 214.772700
0x00005805, // 88 1 1 214.772700
0x00005905, // 89 1 1 217.159063
0x00005905, // 89 1 1 217.159063
0x00005905, // 89 1 1 217.159063
0x00005A05, // 90 1 1 219.545427
0x00005A05, // 90 1 1 219.545427
};
FxU32 *h4pllTable = (FxU32*) (_h4pllTable - MIN_PLL_FREQ);

110
glide2x/h3/cinit/memtable.h Normal file
View File

@@ -0,0 +1,110 @@
/*
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
**
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
** THE UNITED STATES.
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** File name: memtable.h
**
** Description: Table to initialize dramInit0 and sgramMode.
**
** $History: memtable.h $
**
** ***************** Version 1 *****************
** User: Sapphire Date: 3/16/99 Time: 7:28p
** Created in $/Releases/Voodoo3/V3_OEM_100/3dfx/devel/H3/cinit
**
** ***************** Version 6 *****************
** User: Michael Date: 1/11/99 Time: 3:53p
** Updated in $/devel/h3/Win95/dx/minivdd
** Implement the 3Dfx/STB unified header.
**
** ***************** Version 5 *****************
** User: Psmith Date: 8/09/98 Time: 7:53a
** Updated in $/devel/h3/cinit
** added Generic SGRAM/SDRAM memory timings that have lower performance
** but will work for all currently-supported chips.
** default memory vendor type changed to Generic from Samsung.
**
** ***************** Version 4 *****************
** User: Psmith Date: 7/31/98 Time: 1:35a
** Updated in $/devel/h3/cinit
** changed block write to 2 cycles for Etron 16Mbit partsd
**
** ***************** Version 3 *****************
** User: Psmith Date: 7/22/98 Time: 9:11a
** Updated in $/devel/h3/cinit
** added sdram support
**
** ***************** Version 2 *****************
** User: Ken Date: 4/15/98 Time: 6:41p
** Updated in $/devel/h3/win95/dx/minivdd
** added unified header to all files, with revision, etc. info in it
**
*/
//
// generated by gen_memtable.pl at Sun Aug 9 07:21:36 1998
//
#define MEM_TYPE_SGRAM 0
#define MEM_TYPE_SDRAM 1
struct memTable_st {
char vendor[8];
FxU32 type;
FxU32 size;
FxU32 dramInit0;
FxU32 sgramMode;
} memTable[] = {
// vendor type size dramInit0 sgramMode
// ---------- ---- ---- --------- ---------
{ "ETRON", MEM_TYPE_SGRAM, 16, 0x001698e9, 0x00000037} ,
{ "ETRON", MEM_TYPE_SGRAM, 8, 0x0016a169, 0x00000037} ,
{ "GENERIC", MEM_TYPE_SDRAM, 16, 0x00169d25, 0x00000037} ,
{ "GENERIC", MEM_TYPE_SGRAM, 16, 0x00179d29, 0x00000037} ,
{ "GENERIC", MEM_TYPE_SGRAM, 8, 0x001fa569, 0x00000037} ,
{ "GLINK", MEM_TYPE_SGRAM, 8, 0x001ea169, 0x00000037} ,
{ "MOSYS", MEM_TYPE_SGRAM, 16, 0x00015495, 0x00000027} ,
{ "MOSYS", MEM_TYPE_SGRAM, 8, 0x00155495, 0x00000027} ,
{ "SAMSUNG", MEM_TYPE_SDRAM, 16, 0x00169d25, 0x00000037} ,
{ "SAMSUNG", MEM_TYPE_SGRAM, 16, 0x00169d25, 0x00000037} ,
{ "SAMSUNG", MEM_TYPE_SGRAM, 8, 0x00169d25, 0x00000037} ,
{ "SIEMENS", MEM_TYPE_SGRAM, 8, 0x0016a169, 0x00000037} ,
{ "TOSHIBA", MEM_TYPE_SGRAM, 8, 0x0016a565, 0x00000037} ,
};
#define MEM_TABLE_SIZE (sizeof(memTable)/sizeof(struct memTable_st))
#define MEM_ETRON_SGRAM_16 0
#define MEM_ETRON_SGRAM_8 1
#define MEM_GENERIC_SDRAM_16 2
#define MEM_GENERIC_SGRAM_16 3
#define MEM_GENERIC_SGRAM_8 4
#define MEM_GLINK_SGRAM_8 5
#define MEM_MOSYS_SGRAM_16 6
#define MEM_MOSYS_SGRAM_8 7
#define MEM_SAMSUNG_SDRAM_16 8
#define MEM_SAMSUNG_SGRAM_16 9
#define MEM_SAMSUNG_SGRAM_8 10
#define MEM_SIEMENS_SGRAM_8 11
#define MEM_TOSHIBA_SGRAM_8 12
#define MEM_DEFAULT_SGRAM_8 MEM_GENERIC_SGRAM_8
#define MEM_DEFAULT_SGRAM_16 MEM_GENERIC_SGRAM_16
#define MEM_DEFAULT_SDRAM_16 MEM_GENERIC_SDRAM_16

446
glide2x/h3/cinit/modetabl.h Normal file
View File

@@ -0,0 +1,446 @@
/*
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
**
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
** THE UNITED STATES.
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** File name: modetabl.h
**
** Description: Mode table that contains modes and related register values.
**
** $History: modetabl.h $
**
** ***************** Version 1 *****************
** User: Sapphire Date: 3/16/99 Time: 7:28p
** Created in $/Releases/Voodoo3/V3_OEM_100/3dfx/devel/H3/cinit
**
** ***************** Version 25 *****************
** User: Stb_srogers Date: 3/02/99 Time: 4:04p
** Updated in $/devel/h3/Win95/dx/minivdd
** Adding the 960x720 & 1280x960 modes
**
** ***************** Version 24 *****************
** User: Stb_srogers Date: 2/16/99 Time: 5:04p
** Updated in $/devel/h3/win95/dx/minivdd
**
** ***************** Version 22 *****************
** User: Stb_srogers Date: 2/11/99 Time: 6:59p
** Updated in $/devel/h3/win95/dx/minivdd
**
** ***************** Version 21 *****************
** User: Stb_srogers Date: 2/09/99 Time: 11:30a
** Updated in $/devel/h3/win95/dx/minivdd
**
** ***************** Version 20 *****************
** User: Andrew Date: 2/07/99 Time: 4:45p
** Updated in $/devel/h3/Win95/dx/minivdd
** Change the clocks as per Malcolm Gray suggestion and added new modes
** 1600x1024, 1920x1200, and 2048x1536.
**
** ***************** Version 19 *****************
** User: Stb_srogers Date: 1/29/99 Time: 8:08a
** Updated in $/devel/h3/win95/dx/minivdd
**
** ***************** Version 18 *****************
** User: Andrew Date: 1/12/99 Time: 12:40p
** Updated in $/devel/h3/Win95/dx/minivdd
** Removed my changes since complaint mode is 75 Hz
**
** ***************** Version 16 *****************
** User: Michael Date: 1/11/99 Time: 3:54p
** Updated in $/devel/h3/Win95/dx/minivdd
** Implement the 3Dfx/STB unified header.
**
** ***************** Version 15 *****************
** User: Michael Date: 12/31/98 Time: 9:55a
** Updated in $/devel/h3/Win95/dx/minivdd
** STB's customized refresh rates. Customizations are surrounded by
** "#ifdef INCSTBCUST".
**
** ***************** Version 14 *****************
** User: Andrew Date: 8/31/98 Time: 11:26p
** Updated in $/devel/h3/Win95/dx/minivdd
** John's fixes for 800x600
**
** ***************** Version 13 *****************
** User: Andrew Date: 8/20/98 Time: 10:11p
** Updated in $/devel/h3/Win95/dx/minivdd
** Updated 320x240@60,72 400x300 @ 72 & 85, 1792x1392 changed from 72 to
** 75.
**
** ***************** Version 12 *****************
** User: Andrew Date: 7/27/98 Time: 11:12a
** Updated in $/devel/h3/Win95/dx/minivdd
** Added updates for 400x300 modes since SCANLINEDBL was not set in xls
** file
**
** ***************** Version 11 *****************
** User: Andrew Date: 7/21/98 Time: 2:42p
** Updated in $/devel/h3/Win95/dx/minivdd
** Modified to support the new final mode list -- add new refreshs
** 320x200, 320x240, 400x300, 512x384, and 1152x864.
**
** ***************** Version 10 *****************
** User: Andrew Date: 7/04/98 Time: 10:37a
** Updated in $/devel/h3/Win95/dx/minivdd
** Got modetabl.h the right way.....Differences hsync skew on 1920x1440
** and clocks on low-rez modes
**
** ***************** Version 9 *****************
** User: Andrew Date: 6/29/98 Time: 10:58a
** Updated in $/devel/h3/Win95/dx/minivdd
** Changed Dot Clock on 1792x1344 and Refresh Rate from 70 to 72. Changed
** CR04 on 1792x1344 @ 60 Hz
**
** ***************** Version 8 *****************
** User: Andrew Date: 6/24/98 Time: 9:32a
** Updated in $/devel/h3/Win95/dx/minivdd
** New mode additions for 1792x1344 and 1856x1392 plus 1152x864 @ 100
**
** ***************** Version 7 *****************
** User: Andrew Date: 5/19/98 Time: 6:12p
** Updated in $/devel/h3/Win95/dx/minivdd
** changed 1800 to 1808 and changed timing to 1808
**
** ***************** Version 6 *****************
** User: Andrew Date: 5/07/98 Time: 11:24a
** Updated in $/devel/h3/Win95/dx/minivdd
** Added modes 1792x1440 and 1920x1440. 1800x1440 was updated but still
** does not work
**
** ***************** Version 5 *****************
** User: Andrew Date: 4/22/98 Time: 2:58p
** Updated in $/devel/h3/Win95/dx/minivdd
** Changed clock at 1280x960 @ 75 hz and 1600x1200 @ 85 Hz and added
** broken 1800x1440
**
** ***************** Version 4 *****************
** User: Ken Date: 4/15/98 Time: 6:42p
** Updated in $/devel/h3/win95/dx/minivdd
** added unified header to all files, with revision, etc. info in it
**
*/
// Begin STB Changes
// STB-SR 12/23/98 changing modetable
// STB-SR 12/30/98 All but 720x350 and 720x400 work
// STB-SR 01/07/99 720x350 and 720x400 work. I had assumed that SR1 (Sequencer
// Register 1), was always 0x21. Bit 0 defines wether or not the character
// width is 8 or 9. 1->8 pixel wide char, 0->9 pixel char. The actual change
// was made in minivdd\modetabl.h
// STB-SR 02/11/99 Adding STB & 3Dfx unified modes for Voodoo3
#ifdef H4
// If you need to make changes to the modetable, you must also edit
// dd16\h3.c and dd16\setmode.c
// r[0] r[1] r[2] r[3] r[4] r[5] r[6] r[7] r[8] r[9] r[10] r[11] r[12] r[13] r[14] r[15] r[16] r[17] r[18] r[19] r[20]
// x y rr, 0h 1h 2h 3h 4h 5h 6h 7h 9h 10h 11h 12h 15h 16h 1ah 1bh 3c2 SR1 pllctrl0 dacmode
// x y rr, Htotl HDEnE HBlSt HBlEn HSySt HSyEn Vtotl Ovflw MxSLn VSySt VSyEn VDEnE VBlSt VBlEn HExtn VExtn MiscO SR1 pllctrl0 dacmode
// New Standardized modetable for both 3Dfx and STB
{ 640, 480, 60, 0x5f, 0x4f, 0x4f, 0x83, 0x51, 0x9d, 0x0b, 0x3e, 0x40, 0xe9,
0x2b, 0xdf, 0xdf, 0x0c, 0x00, 0x00, 0xcf, 0x21, 0x37, 0xd1, 0x00},
{ 640, 480, 72, 0x63, 0x4f, 0x4f, 0x87, 0x52, 0x97, 0x06, 0x3e, 0x40, 0xe8,
0x2b, 0xdf, 0xdf, 0x07, 0x00, 0x00, 0xcf, 0x21, 0x0f, 0x56, 0x00},
{ 640, 480, 75, 0x64, 0x4f, 0x4f, 0x88, 0x51, 0x99, 0xf2, 0x1f, 0x40, 0xe0,
0x23, 0xdf, 0xdf, 0xf3, 0x00, 0x00, 0xcf, 0x21, 0x0f, 0x56, 0x00},
{ 640, 480, 85, 0x63, 0x4f, 0x4f, 0x87, 0x56, 0x9d, 0xfb, 0x1f, 0x40, 0xe0,
0x23, 0xdf, 0xdf, 0xfc, 0x00, 0x00, 0xcf, 0x21, 0x1f, 0xb3, 0x00},
{ 800, 600, 56, 0x7b, 0x63, 0x63, 0x9f, 0x66, 0x8f, 0x6f, 0xf0, 0x60, 0x58,
0x2a, 0x57, 0x57, 0x70, 0x80, 0x00, 0x0f, 0x21, 0x1f, 0xb3, 0x00},
{ 800, 600, 60, 0x7f, 0x63, 0x63, 0x83, 0x68, 0x18, 0x72, 0xf0, 0x60, 0x58,
0x2c, 0x57, 0x57, 0x73, 0xa0, 0x00, 0x0f, 0x21, 0x27, 0xf4, 0x00},
{ 800, 600, 72, 0x7d, 0x63, 0x63, 0x81, 0x6a, 0x19, 0x98, 0xf0, 0x60, 0x7c,
0x22, 0x57, 0x57, 0x99, 0xa0, 0x00, 0x0f, 0x21, 0x1f, 0xf9, 0x00},
{ 800, 600, 75, 0x7f, 0x63, 0x63, 0x83, 0x65, 0x0f, 0x6f, 0xf0, 0x60, 0x58,
0x2b, 0x57, 0x57, 0x70, 0xa0, 0x00, 0x0f, 0x21, 0x07, 0x51, 0x00},
{ 800, 600, 85, 0x7e, 0x63, 0x63, 0x82, 0x67, 0x0f, 0x75, 0xf0, 0x60, 0x58,
0x2b, 0x57, 0x57, 0x76, 0xa0, 0x00, 0x0f, 0x21, 0x17, 0xda, 0x00},
{ 1024, 768, 60, 0xa3, 0x7f, 0x7f, 0x87, 0x82, 0x93, 0x24, 0xf5, 0x60, 0x02,
0x28, 0xff, 0xff, 0x25, 0x20, 0x00, 0xcf, 0x21, 0x07, 0x6b, 0x00},
{ 1024, 768, 70, 0xa1, 0x7f, 0x7f, 0x85, 0x82, 0x93, 0x24, 0xf5, 0x60, 0x02,
0x28, 0xff, 0xff, 0x25, 0x20, 0x00, 0xcf, 0x21, 0x2a, 0xf9, 0x00},
{ 1024, 768, 75, 0x9f, 0x7f, 0x7f, 0x83, 0x81, 0x8d, 0x1e, 0xf5, 0x60, 0x00,
0x23, 0xff, 0xff, 0x1f, 0x20, 0x00, 0x0f, 0x21, 0x06, 0x40, 0x00},
{ 1024, 768, 85, 0xa7, 0x7f, 0x7f, 0x8b, 0x85, 0x91, 0x26, 0xf5, 0x60, 0x00,
0x23, 0xff, 0xff, 0x27, 0x20, 0x00, 0x0f, 0x21, 0x0e, 0x82, 0x00},
{ 1152, 864, 60, 0xb3, 0x8f, 0x8f, 0x97, 0x93, 0x9f, 0x87, 0xff, 0x60, 0x60,
0x23, 0x5f, 0x5f, 0x88, 0x00, 0x00, 0x0f, 0x21, 0x26, 0xf4, 0x00},
{ 1152, 864, 70, 0xb4, 0x8f, 0x8f, 0x98, 0x93, 0x9f, 0x8e, 0xff, 0x60, 0x60,
0x23, 0x5f, 0x5f, 0x8f, 0x00, 0x00, 0x0f, 0x21, 0x0e, 0x82, 0x00},
{ 1152, 864, 75, 0xc3, 0x8f, 0x8f, 0x87, 0x97, 0x07, 0x82, 0xff, 0x60, 0x60,
0x23, 0x5f, 0x5f, 0x83, 0xa0, 0x00, 0x0f, 0x21, 0x12, 0xb3, 0x00},
{ 1152, 864, 85, 0xbf, 0x8f, 0x8f, 0x83, 0x97, 0x07, 0x8d, 0xff, 0x60, 0x60,
0x23, 0x5f, 0x5f, 0x8e, 0xa0, 0x00, 0x0f, 0x21, 0x06, 0x64, 0x00},
{ 1280, 960, 60, 0xdc, 0x9f, 0x9f, 0x80, 0xab, 0x99, 0xe6, 0xff, 0x60, 0xc0,
0x23, 0xbf, 0xbf, 0xe7, 0xa0, 0x00, 0x0f, 0x21, 0x12, 0xb3, 0x00},
{ 1280, 960, 85, 0xd3, 0x9f, 0x9f, 0x97, 0xa7, 0x1b, 0xf1, 0xff, 0x60, 0xc0,
0x23, 0xbf, 0xbf, 0xf2, 0xa0, 0x00, 0x0f, 0x21, 0x0a, 0xa4, 0x00},
{ 1280, 1024, 60, 0xce, 0x9f, 0x9f, 0x92, 0xa5, 0x13, 0x28, 0x5a, 0x60, 0x00,
0x23, 0xff, 0xff, 0x29, 0xa0, 0x41, 0x0f, 0x21, 0x12, 0xb3, 0x00},
{ 1280, 1024, 75, 0xce, 0x9f, 0x9f, 0x92, 0xa1, 0x13, 0x28, 0x5a, 0x60, 0x00,
0x23, 0xff, 0xff, 0x29, 0xa0, 0x41, 0x0f, 0x21, 0x0a, 0x95, 0x00},
{ 1280, 1024, 85, 0xd3, 0x9f, 0x9f, 0x97, 0xa7, 0x1b, 0x2e, 0x5a, 0x60, 0x00,
0x23, 0xff, 0xff, 0x2f, 0xa0, 0x41, 0x0f, 0x21, 0x05, 0x40, 0x00},
{ 1600, 1024, 60, 0x00, 0xc7, 0xc7, 0x84, 0xcb, 0x1f, 0x2c, 0x5a, 0x60, 0x02,
0x25, 0xff, 0xff, 0x2d, 0x21, 0x41, 0xcf, 0x21, 0x0e, 0xb9, 0x00},
{ 1600, 1024, 76, 0x00, 0xc7, 0xc7, 0x84, 0xcb, 0x1f, 0x2c, 0x5a, 0x60, 0x02,
0x25, 0xff, 0xff, 0x2d, 0x21, 0x41, 0xcf, 0x21, 0x15, 0xa4, 0x00},
{ 1600, 1024, 85, 0x00, 0xc7, 0xc7, 0x84, 0xcb, 0x1f, 0x2c, 0x5a, 0x60, 0x02,
0x25, 0xff, 0xff, 0x2d, 0x21, 0x41, 0xcf, 0x21, 0x09, 0x68, 0x00},
{ 1600, 1200, 60, 0x00, 0xc7, 0xc7, 0x84, 0xcf, 0x07, 0xe0, 0x10, 0x40, 0xb0,
0x23, 0xaf, 0xaf, 0xe1, 0xa1, 0x55, 0x0f, 0x21, 0x19, 0xad, 0x00},
{ 1600, 1200, 65, 0x00, 0xc7, 0xc7, 0x84, 0xcf, 0x07, 0xe0, 0x10, 0x40, 0xb0,
0x23, 0xaf, 0xaf, 0xe1, 0xa1, 0x55, 0x0f, 0x21, 0x21, 0xeb, 0x00},
{ 1600, 1200, 70, 0x00, 0xc7, 0xc7, 0x84, 0xcf, 0x07, 0xe0, 0x10, 0x40, 0xb0,
0x23, 0xaf, 0xaf, 0xe1, 0xa1, 0x55, 0x0f, 0x21, 0x09, 0x64, 0x00},
{ 1600, 1200, 75, 0x00, 0xc7, 0xc7, 0x84, 0xcf, 0x07, 0xe0, 0x10, 0x40, 0xb0,
0x23, 0xaf, 0xaf, 0xe1, 0xa1, 0x55, 0x0f, 0x21, 0x05, 0x50, 0x00},
{ 1600, 1200, 80, 0x00, 0xc7, 0xc7, 0x84, 0xcf, 0x07, 0xe0, 0x10, 0x40, 0xb0,
0x23, 0xaf, 0xaf, 0xe1, 0xa1, 0x55, 0x0f, 0x21, 0x11, 0xad, 0x00},
{ 1600, 1200, 85, 0x00, 0xc7, 0xc7, 0x84, 0xcf, 0x07, 0xe0, 0x10, 0x40, 0xb0,
0x23, 0xaf, 0xaf, 0xe1, 0xa1, 0x55, 0x0f, 0x21, 0x05, 0x5b, 0x00},
{ 1600, 1200, 100, 0x00, 0xc7, 0xc7, 0x84, 0xcf, 0x07, 0xe0, 0x10, 0x40, 0xb0,
0x23, 0xaf, 0xaf, 0xe1, 0xa1, 0x55, 0x0f, 0x21, 0x15, 0xfd, 0x00},
{ 1792, 1344, 60, 0x94, 0x6f, 0x6f, 0x98, 0x77, 0x04, 0x70, 0x1f, 0x40, 0x40,
0x23, 0x3f, 0x3f, 0x71, 0x20, 0x55, 0x4f, 0x21, 0x0d, 0x8d, 0x01},
{ 1792, 1344, 75, 0x95, 0x6f, 0x6f, 0x99, 0x75, 0x03, 0x87, 0x1f, 0x40, 0x40,
0x23, 0x3f, 0x3f, 0x88, 0x20, 0x55, 0x4f, 0x21, 0x15, 0xfd, 0x01},
{ 1856, 1392, 60, 0x99, 0x73, 0x73, 0x9d, 0x79, 0x07, 0x9d, 0x1f, 0x40, 0x70,
0x23, 0x6f, 0x6f, 0x9e, 0x20, 0x55, 0x4f, 0x21, 0x09, 0x78, 0x01},
{ 1856, 1392, 75, 0x9b, 0x73, 0x73, 0x9f, 0x7b, 0x09, 0xda, 0x1f, 0x40, 0x70,
0x23, 0x6f, 0x6f, 0xdb, 0x20, 0x55, 0x4f, 0x21, 0x09, 0x9f, 0x01},
{ 1920, 1080, 60, 0x8f, 0x77, 0x77, 0x93, 0x79, 0x02, 0x63, 0x10, 0x40, 0x3a,
0x2d, 0x37, 0x37, 0x64, 0x20, 0x55, 0xcf, 0x21, 0x05, 0x41, 0x01},
{ 1920, 1080, 72, 0x9b, 0x77, 0x77, 0x9f, 0x7a, 0x08, 0x92, 0x10, 0x40, 0x3a,
0x2d, 0x37, 0x37, 0x93, 0x20, 0x55, 0xcf, 0x21, 0x11, 0xb3, 0x01},
{ 1920, 1200, 60, 0x9d, 0x77, 0x77, 0x81, 0x7b, 0x8b, 0xe0, 0x10, 0x40, 0xb2,
0x25, 0xaf, 0xaf, 0xe1, 0x20, 0x55, 0xcf, 0x21, 0x1d, 0xf2, 0x01},
{ 1920, 1200, 76, 0x9d, 0x77, 0x77, 0x81, 0x7b, 0x8b, 0xe0, 0x10, 0x40, 0xb2,
0x25, 0xaf, 0xaf, 0xe1, 0x20, 0x55, 0xcf, 0x21, 0x15, 0xee, 0x01},
{ 1920, 1440, 60, 0x9e, 0x77, 0x77, 0x82, 0x7f, 0x8c, 0xda, 0x1f, 0x40, 0xa0,
0x23, 0x9f, 0x9f, 0xdb, 0x20, 0x55, 0x4f, 0x21, 0x05, 0x60, 0x01},
{ 1920, 1440, 75, 0xa0, 0x77, 0x77, 0x84, 0x80, 0x8e, 0xda, 0x1f, 0x40, 0xa0,
0x23, 0x9f, 0x9f, 0xdb, 0x20, 0x55, 0x4f, 0x21, 0x09, 0xa4, 0x01},
{ 2048, 1536, 60, 0x98, 0x7f, 0x7f, 0x9c, 0x82, 0x10, 0x3b, 0xba, 0x40, 0x00,
0x23, 0xff, 0xff, 0x3c, 0x20, 0x55, 0x0f, 0x21, 0x09, 0x84, 0x01},
{ 2048, 1536, 75, 0xa1, 0x7f, 0x7f, 0x85, 0x83, 0x91, 0x44, 0xba, 0x40, 0x00,
0x23, 0xff, 0xff, 0x45, 0x20, 0x55, 0x0f, 0x21, 0x05, 0x84, 0x01},
{ 320, 200, 70, 0x2d, 0x27, 0x27, 0x91, 0x28, 0x8e, 0xbf, 0x1f, 0xc0, 0x9c,
0x2e, 0x8f, 0x8f, 0xc0, 0x80, 0x00, 0x4f, 0x21, 0x73, 0xd1, 0x00},
{ 320, 200, 85, 0x2f, 0x27, 0x27, 0x93, 0x29, 0x8d, 0xbb, 0x1f, 0xc0, 0x90,
0x23, 0x8f, 0x8f, 0xbc, 0x80, 0x00, 0x4f, 0x21, 0x0f, 0x2a, 0x00},
{ 320, 240, 60, 0x2d, 0x27, 0x27, 0x91, 0x28, 0x8e, 0x0b, 0x3e, 0xc0, 0xe9,
0x2b, 0xdf, 0xdf, 0x0c, 0x80, 0x00, 0xcf, 0x21, 0x73, 0xd1, 0x00},
{ 320, 240, 72, 0x2f, 0x27, 0x27, 0x93, 0x29, 0x8b, 0x06, 0x3e, 0xc0, 0xe8,
0x2b, 0xdf, 0xdf, 0x07, 0x80, 0x00, 0xcf, 0x21, 0x0f, 0x2a, 0x00},
{ 320, 240, 75, 0x30, 0x27, 0x27, 0x94, 0x28, 0x8c, 0xf2, 0x1f, 0xc0, 0xe0,
0x23, 0xdf, 0xdf, 0xf3, 0x80, 0x00, 0xcf, 0x21, 0x63, 0xe5, 0x00},
{ 320, 240, 85, 0x2f, 0x27, 0x27, 0x93, 0x2a, 0x8e, 0xfb, 0x1f, 0xc0, 0xe0,
0x23, 0xdf, 0xdf, 0xfc, 0x80, 0x00, 0xcf, 0x21, 0x43, 0xb3, 0x00},
{ 400, 300, 60, 0x3d, 0x31, 0x31, 0x81, 0x34, 0x1c, 0x72, 0xf0, 0xe0, 0x58,
0x2c, 0x57, 0x57, 0x73, 0xa0, 0x00, 0x0f, 0x21, 0x3f, 0xbc, 0x00},
{ 400, 300, 72, 0x3c, 0x31, 0x31, 0x80, 0x35, 0x1c, 0x98, 0xf0, 0xe0, 0x7c,
0x22, 0x57, 0x57, 0x99, 0xa0, 0x00, 0x0f, 0x21, 0x43, 0xf9, 0x00},
{ 400, 300, 75, 0x3d, 0x31, 0x31, 0x81, 0x32, 0x17, 0x6f, 0xf0, 0xe0, 0x58,
0x2b, 0x57, 0x57, 0x70, 0xa0, 0x00, 0x0f, 0x21, 0x13, 0x51, 0x00},
{ 400, 300, 85, 0x3d, 0x31, 0x31, 0x81, 0x33, 0x17, 0x75, 0xf0, 0xe0, 0x58,
0x2b, 0x57, 0x57, 0x76, 0xa0, 0x00, 0x0f, 0x21, 0x13, 0x5d, 0x00},
{ 512, 384, 60, 0x4f, 0x3f, 0x3f, 0x93, 0x41, 0x09, 0x24, 0xf5, 0xe0, 0x02,
0x28, 0xff, 0xff, 0x25, 0x20, 0x00, 0xcf, 0x21, 0x2f, 0xea, 0x00},
{ 512, 384, 70, 0x4e, 0x3f, 0x3f, 0x92, 0x41, 0x09, 0x24, 0xf5, 0xe0, 0x02,
0x28, 0xff, 0xff, 0x25, 0x20, 0x00, 0xcf, 0x21, 0x2b, 0xf9, 0x00},
{ 512, 384, 75, 0x4d, 0x3f, 0x3f, 0x91, 0x40, 0x06, 0x1e, 0xf5, 0xe0, 0x00,
0x23, 0xff, 0xff, 0x1f, 0x20, 0x00, 0xcf, 0x21, 0x07, 0x40, 0x00},
{ 512, 384, 85, 0x51, 0x3f, 0x3f, 0x95, 0x42, 0x08, 0x26, 0xf5, 0xe0, 0x00,
0x23, 0xff, 0xff, 0x27, 0x20, 0x00, 0xcf, 0x21, 0x0f, 0x82, 0x00},
{ 640, 400, 70, 0x5f, 0x4f, 0x4f, 0x83, 0x51, 0x9d, 0xbf, 0x1f, 0x40, 0x9c,
0x2e, 0x8f, 0x8f, 0xc0, 0x00, 0x00, 0x4f, 0x21, 0x37, 0xd1, 0x00},
{ 640, 400, 85, 0x63, 0x4f, 0x4f, 0x87, 0x53, 0x9b, 0xbb, 0x1f, 0x40, 0x90,
0x23, 0x8f, 0x8f, 0xbc, 0x00, 0x00, 0x4f, 0x21, 0x0f, 0x56, 0x00},
{ 720, 480, 60, 0x6b, 0x59, 0x59, 0x8f, 0x5b, 0x8a, 0x0b, 0x3e, 0x40, 0xe9,
0x2b, 0xdf, 0xdf, 0x0c, 0x80, 0x00, 0xcf, 0x21, 0x0b, 0x3d, 0x00},
{ 720, 480, 72, 0x6e, 0x59, 0x59, 0x92, 0x5b, 0x8c, 0x06, 0x3e, 0x40, 0xe8,
0x2b, 0xdf, 0xdf, 0x07, 0x80, 0x00, 0xcf, 0x21, 0x2f, 0xfb, 0x00},
{ 720, 480, 85, 0x70, 0x59, 0x59, 0x94, 0x61, 0x89, 0xfb, 0x1f, 0x40, 0xe0,
0x23, 0xdf, 0xdf, 0xfc, 0x80, 0x00, 0xcf, 0x21, 0x1b, 0xb3, 0x00},
{ 720, 576, 72, 0x70, 0x59, 0x59, 0x94, 0x5d, 0x89, 0x80, 0xf0, 0x60, 0x41,
0x25, 0x3f, 0x3f, 0x81, 0x80, 0x00, 0x0f, 0x21, 0x13, 0x8f, 0x00},
{ 720, 576, 100, 0x70, 0x59, 0x59, 0x94, 0x5d, 0x89, 0x80, 0xf0, 0x60, 0x41,
0x25, 0x3f, 0x3f, 0x81, 0x80, 0x00, 0x0f, 0x21, 0x17, 0xe9, 0x00},
#else // #ifdef H4
// STB End Changes
{320, 200, 70, 0x2f, 0x27, 0x27, 0x93, 0x2a, 0x8e, 0xbb, 0x1f, 0x40, 0x91,
0x24, 0x8f, 0x8f, 0xbc, 0x80, 0x00, 0x4f, 0x21, 0xee, 0xdb, 0x00},
{320, 200, 85, 0x2f, 0x27, 0x27, 0x93, 0x2a, 0x8e, 0xbb, 0x1f, 0x40, 0x91,
0x24, 0x8f, 0x8f, 0xbc, 0x80, 0x00, 0x4f, 0x21, 0x37, 0x82, 0x00},
{320, 240, 60, 0x2d, 0x27, 0x27, 0x8f, 0x29, 0x8e, 0x0b, 0x3e, 0x40, 0xe1,
0x24, 0xdf, 0xdf, 0xfc, 0x80, 0x00, 0xcf, 0x21, 0xea, 0xd1, 0x00},
{320, 240, 72, 0x2f, 0x27, 0x27, 0x93, 0x2a, 0x8e, 0x06, 0x3e, 0x40, 0xe1,
0x24, 0xdf, 0xdf, 0xfc, 0x80, 0x00, 0xcf, 0x21, 0x37, 0x82, 0x00},
{320, 240, 85, 0x2f, 0x27, 0x27, 0x93, 0x2a, 0x8e, 0xfb, 0x1f, 0x40, 0xe1,
0x24, 0xdf, 0xdf, 0xfc, 0x80, 0x00, 0xcf, 0x21, 0x3f, 0xa9, 0x00},
{400, 300, 60, 0x3d, 0x31, 0x31, 0x81, 0x34, 0x1c, 0x72, 0xf0, 0x60, 0x59,
0x2d, 0x57, 0x57, 0x73, 0xa0, 0x00, 0x0f, 0x21, 0xf4, 0x56, 0x00},
{400, 300, 72, 0x3c, 0x31, 0x31, 0x80, 0x34, 0x1b, 0x98, 0xf0, 0x60, 0x7d,
0x23, 0x57, 0x57, 0x99, 0xa0, 0x00, 0x0f, 0x21, 0xf4, 0x6c, 0x00},
{400, 300, 85, 0x3d, 0x31, 0x31, 0x80, 0x33, 0x1b, 0x75, 0xf0, 0x60, 0x59,
0x2c, 0x57, 0x57, 0x76, 0xa0, 0x00, 0x0f, 0x21, 0xb8, 0x5d, 0x00},
{512, 384, 60, 0x4f, 0x3f, 0x3f, 0x93, 0x41, 0x0a, 0x24, 0xf5, 0x60, 0x04,
0x2a, 0xff, 0xff, 0x25, 0x20, 0x00, 0xcf, 0x21, 0x5e, 0xe1, 0x00},
{512, 384, 72, 0x4e, 0x3f, 0x3f, 0x92, 0x41, 0x0a, 0x24, 0xf5, 0x60, 0x03,
0x29, 0xff, 0xff, 0x25, 0x20, 0x00, 0xcf, 0x21, 0xbc, 0x82, 0x00},
{512, 384, 75, 0x4d, 0x3f, 0x3f, 0x91, 0x41, 0x07, 0x1e, 0xf5, 0x60, 0x01,
0x24, 0xff, 0xff, 0x1f, 0x20, 0x00, 0x0f, 0x21, 0x2a, 0x82, 0x00},
{512, 384, 85, 0x51, 0x3f, 0x3f, 0x95, 0x43, 0x09, 0x26, 0xf5, 0x60, 0x01,
0x24, 0xff, 0xff, 0x27, 0x20, 0x00, 0x0f, 0x21, 0x36, 0xc4, 0x00},
{640, 350, 85, 0x63, 0x4f, 0x4f, 0x87, 0x54, 0x9c, 0xbb, 0x1f, 0x40, 0x7e,
0x21, 0x5d, 0x5d, 0xbc, 0x20, 0x00, 0x8f, 0x21, 0x36, 0x82, 0x00},
{640, 400, 70, 0x63, 0x4f, 0x4f, 0x87, 0x54, 0x9c, 0xbb, 0x1f, 0x40, 0x91,
0x24, 0x8f, 0x8f, 0xbc, 0x20, 0x00, 0x4f, 0x21, 0xed, 0xdb, 0x00},
{640, 400, 85, 0x63, 0x4f, 0x4f, 0x87, 0x54, 0x9c, 0xbb, 0x1f, 0x40, 0x91,
0x24, 0x8f, 0x8f, 0xbc, 0x20, 0x00, 0x4f, 0x21, 0x36, 0x82, 0x00},
{640, 480, 60, 0x5f, 0x4f, 0x4f, 0x83, 0x52, 0x9e, 0x0b, 0x3e, 0x40, 0xea,
0x2c, 0xdf, 0xdf, 0x0c, 0x20, 0x00, 0xcf, 0x21, 0x7d, 0x72, 0x00},
{640, 480, 72, 0x63, 0x4f, 0x4f, 0x87, 0x56, 0x9b, 0x06, 0x3e, 0x40, 0xe9,
0x2c, 0xdf, 0xdf, 0x07, 0x20, 0x00, 0xcf, 0x21, 0x36, 0x82, 0x00},
{640, 480, 75, 0x64, 0x4f, 0x4f, 0x88, 0x51, 0x99, 0xf2, 0x1f, 0x40, 0xe1,
0x24, 0xdf, 0xdf, 0xf3, 0x20, 0x00, 0xcf, 0x21, 0x36, 0x82, 0x00},
{640, 480, 85, 0x63, 0x4f, 0x4f, 0x87, 0x56, 0x9e, 0xfb, 0x1f, 0x40, 0xe1,
0x24, 0xdf, 0xdf, 0xfc, 0x20, 0x00, 0xcf, 0x21, 0x3e, 0xa9, 0x00},
{640, 480, 100, 0x63, 0x4f, 0x4f, 0x87, 0x56, 0x9e, 0xfb, 0x1f, 0x40, 0xe1,
0x24, 0xdf, 0xdf, 0xfc, 0x20, 0x00, 0xcf, 0x21, 0x58, 0x45, 0x00},
{640, 480, 120, 0x63, 0x4f, 0x4f, 0x87, 0x56, 0x9e, 0xfb, 0x1f, 0x40, 0xe1,
0x24, 0xdf, 0xdf, 0xfc, 0x20, 0x00, 0xcf, 0x21, 0x48, 0x45, 0x00},
{720, 400, 72, 0x70, 0x59, 0x59, 0x94, 0x5e, 0x87, 0xbc, 0x1f, 0x40, 0x91,
0x24, 0x8f, 0x8f, 0xbd, 0xa0, 0x00, 0x4f, 0x21, 0x20, 0x13, 0x00},
{720, 400, 85, 0x70, 0x59, 0x59, 0x94, 0x5e, 0x87, 0xbc, 0x1f, 0x40, 0x91,
0x24, 0x8f, 0x8f, 0xbd, 0xa0, 0x00, 0x4f, 0x21, 0xb8, 0x75, 0x00},
{720, 480, 60, 0x70, 0x59, 0x59, 0x94, 0x5e, 0x87, 0x15, 0x3e, 0x40, 0xe1,
0x24, 0xdf, 0xdf, 0x16, 0xa0, 0x00, 0x4f, 0x21, 0xc4, 0x69, 0x00},
{720, 480, 72, 0x70, 0x59, 0x59, 0x94, 0x5e, 0x87, 0x15, 0x3e, 0x40, 0xe1,
0x24, 0xdf, 0xdf, 0x16, 0xa0, 0x00, 0x4f, 0x21, 0xd8, 0x8b, 0x00},
{720, 576, 72, 0x70, 0x59, 0x59, 0x94, 0x5e, 0x87, 0x80, 0xf0, 0x60, 0x41,
0x24, 0x3f, 0x3f, 0x81, 0xa0, 0x00, 0x4f, 0x21, 0xb0, 0x89, 0x00},
{720, 576, 100, 0x70, 0x59, 0x59, 0x94, 0x5e, 0x87, 0x80, 0xf0, 0x60, 0x41,
0x24, 0x3f, 0x3f, 0x81, 0xa0, 0x00, 0x4f, 0x21, 0xec, 0xfe, 0x00},
{800, 600, 56, 0x7b, 0x63, 0x63, 0x9f, 0x69, 0x99, 0x6f, 0xf0, 0x60, 0x59,
0x2b, 0x57, 0x57, 0x70, 0xa0, 0x00, 0x0f, 0x21, 0x3e, 0xa9, 0x00},
{800, 600, 60, 0x7b, 0x63, 0x63, 0x9f, 0x6a, 0x94, 0x6c, 0xf0, 0x60, 0x59,
0x2c, 0x57, 0x57, 0x6d, 0xa0, 0x00, 0x0f, 0x21, 0x06, 0x1e, 0x00},
{800, 600, 72, 0x7d, 0x63, 0x63, 0x81, 0x68, 0x17, 0x98, 0xf0, 0x60, 0x7d,
0x23, 0x57, 0x57, 0x99, 0x80, 0x00, 0x0f, 0x21, 0x06, 0x28, 0x00},
{800, 600, 75, 0x7f, 0x63, 0x63, 0x83, 0x65, 0x0f, 0x6f, 0xf0, 0x60, 0x59,
0x2c, 0x57, 0x57, 0x70, 0x80, 0x00, 0x0f, 0x21, 0x55, 0x9d, 0x00},
{800, 600, 85, 0x7e, 0x63, 0x63, 0x82, 0x67, 0x0f, 0x75, 0xf0, 0x60, 0x59,
0x2c, 0x57, 0x57, 0x76, 0x80, 0x00, 0x0f, 0x21, 0x31, 0x6c, 0x00},
{800, 600, 100, 0x7e, 0x63, 0x63, 0x82, 0x66, 0x0e, 0x75, 0xf0, 0x60, 0x59,
// 0x2c, 0x57, 0x57, 0x76, 0x80, 0x00, 0x0f, 0x21, 0x8c, 0xa9, 0x00},
0x2c, 0x57, 0x57, 0x76, 0x80, 0x00, 0x0f, 0x21, 0x0b, 0x92, 0x00},
{800, 600, 120, 0x7e, 0x63, 0x63, 0x82, 0x66, 0x0e, 0x75, 0xf0, 0x60, 0x59,
0x2c, 0x57, 0x57, 0x76, 0x80, 0x00, 0x0f, 0x21, 0x24, 0x3b, 0x00},
{1152, 864, 60, 0xb4, 0x8f, 0x8f, 0x98, 0x94, 0x80, 0x8e, 0xff, 0x60, 0x61,
// 0x24, 0x5f, 0x5f, 0x8f, 0x80, 0x00, 0x0f, 0x21, 0x84, 0xc4, 0x00},
0x24, 0x5f, 0x5f, 0x8f, 0x80, 0x00, 0x0f, 0x21, 0x0b, 0xb3, 0x00},
{1152, 864, 75, 0xc3, 0x8f, 0x8f, 0x87, 0x98, 0x08, 0x82, 0xff, 0x60, 0x61,
// 0x24, 0x5f, 0x5f, 0x83, 0xa0, 0x00, 0x0f, 0x21, 0x50, 0xa4, 0x00},
0x24, 0x5f, 0x5f, 0x83, 0xa0, 0x00, 0x0f, 0x21, 0x12, 0xb3, 0x00},
{1152, 864, 85, 0xc0, 0x8f, 0x8f, 0x84, 0x98, 0x08, 0x89, 0xff, 0x60, 0x61,
// 0x24, 0x5f, 0x5f, 0x8a, 0xa0, 0x00, 0x0f, 0x21, 0x6c, 0xf4, 0x00},
0x24, 0x5f, 0x5f, 0x8a, 0xa0, 0x00, 0x0f, 0x21, 0x16, 0xeb, 0x00},
{1152, 864, 100, 0x5f, 0x47, 0x47, 0x83, 0x4c, 0x93, 0x82, 0xff, 0x60, 0x61,
// 0x24, 0x5f, 0x5f, 0x83, 0x20, 0x00, 0x0f, 0x21, 0x40, 0xb3, 0x01},
0x24, 0x5f, 0x5f, 0x83, 0x20, 0x00, 0x0f, 0x21, 0x0a, 0x9f, 0x01},
{1024, 768, 60, 0xa3, 0x7f, 0x7f, 0x87, 0x83, 0x94, 0x24, 0xf5, 0x60, 0x04,
// 0x2a, 0xff, 0xff, 0x25, 0x00, 0x00, 0xcf, 0x21, 0x5d, 0xe1, 0x00},
0x2a, 0xff, 0xff, 0x25, 0x00, 0x00, 0xcf, 0x21, 0x07, 0x6b, 0x00},
{1024, 768, 70, 0xa1, 0x7f, 0x7f, 0x85, 0x83, 0x94, 0x24, 0xf5, 0x60, 0x03,
// 0x29, 0xff, 0xff, 0x25, 0x00, 0x00, 0xcf, 0x21, 0x4d, 0xda, 0x00},
0x29, 0xff, 0xff, 0x25, 0x00, 0x00, 0xcf, 0x21, 0x13, 0xf9, 0x00},
{1024, 768, 72, 0xa1, 0x7f, 0x7f, 0x85, 0x83, 0x94, 0x24, 0xf5, 0x60, 0x03,
0x29, 0xff, 0xff, 0x25, 0x00, 0x00, 0xcf, 0x21, 0x74, 0xa5, 0x00},
{1024, 768, 75, 0x9f, 0x7f, 0x7f, 0x83, 0x82, 0x8e, 0x1e, 0xf5, 0x60, 0x01,
// 0x24, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x0f, 0x21, 0x29, 0x82, 0x00},
0x24, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x0f, 0x21, 0x12, 0x82, 0x00},
{1024, 768, 85, 0xa7, 0x7f, 0x7f, 0x8b, 0x86, 0x92, 0x26, 0xf5, 0x60, 0x01,
// 0x24, 0xff, 0xff, 0x27, 0x00, 0x00, 0x0f, 0x21, 0x35, 0xc4, 0x00},
0x24, 0xff, 0xff, 0x27, 0x00, 0x00, 0x0f, 0x21, 0x0e, 0x82, 0x00},
{1024, 768, 100, 0xa7, 0x7f, 0x7f, 0x8b, 0x86, 0x92, 0x26, 0xf5, 0x60, 0x01,
// 0x24, 0xff, 0xff, 0x27, 0x00, 0x00, 0x0f, 0x21, 0x3c, 0x82, 0x00},
0x24, 0xff, 0xff, 0x27, 0x00, 0x00, 0x0f, 0x21, 0x06, 0x5b, 0x00},
{1024, 768, 120, 0xa7, 0x7f, 0x7f, 0x8b, 0x86, 0x92, 0x26, 0xf5, 0x60, 0x01,
// 0x24, 0xff, 0xff, 0x27, 0x00, 0x00, 0x0f, 0x21, 0x50, 0xcb, 0x00},
0x24, 0xff, 0xff, 0x27, 0x00, 0x00, 0x0f, 0x21, 0x0a, 0x93, 0x00},
{1280, 960, 60, 0xdc, 0x9f, 0x9f, 0x80, 0xac, 0x9a, 0xe6, 0xff, 0x60, 0xc1,
0x24, 0xbf, 0xbf, 0xe7, 0xa0, 0x00, 0x0f, 0x21, 0x50, 0xa4, 0x00},
{1280, 960, 75, 0xcd, 0x9f, 0x9f, 0x91, 0xa4, 0x16, 0xe6, 0xff, 0x60, 0xc1,
0x24, 0xbf, 0xbf, 0xe7, 0xa0, 0x00, 0x0f, 0x21, 0x0c, 0x2a, 0x00},
{1280, 960, 85, 0x67, 0x4f, 0x4f, 0x8b, 0x54, 0x9e, 0xf1, 0xff, 0x60, 0xc1,
0x24, 0xbf, 0xbf, 0xf2, 0x20, 0x00, 0x0f, 0x21, 0x38, 0xa4, 0x01},
{1280, 1024, 60, 0xce, 0x9f, 0x9f, 0x92, 0xa6, 0x14, 0x28, 0x5a, 0x60, 0x01,
// 0x24, 0xff, 0xff, 0x29, 0xa0, 0x41, 0x0f, 0x21, 0x50, 0xa4, 0x00},
0x24, 0xff, 0xff, 0x29, 0xa0, 0x41, 0x0f, 0x21, 0x12, 0xb3, 0x00},
{1280, 1024, 75, 0xce, 0x9f, 0x9f, 0x92, 0xa2, 0x14, 0x28, 0x5a, 0x60, 0x01,
// 0x24, 0xff, 0xff, 0x29, 0xa0, 0x41, 0x0f, 0x21, 0x30, 0x82, 0x00},
0x24, 0xff, 0xff, 0x29, 0xa0, 0x41, 0x0f, 0x21, 0x15, 0x82, 0x00},
{1280, 1024, 85, 0x67, 0x4f, 0x4f, 0x8b, 0x54, 0x9e, 0x2e, 0x5a, 0x60, 0x01,
// 0x24, 0xff, 0xff, 0x2f, 0x20, 0x41, 0x0f, 0x21, 0x28, 0x82, 0x01},
0x24, 0xff, 0xff, 0x2f, 0x20, 0x41, 0x0f, 0x21, 0x11, 0x82, 0x01},
{1280, 1024, 100, 0x67, 0x4f, 0x4f, 0x8b, 0x54, 0x9e, 0x2e, 0x5a, 0x60, 0x01,
// 0x24, 0xff, 0xff, 0x2f, 0x20, 0x41, 0x0f, 0x21, 0x3c, 0xda, 0x01},
0x24, 0xff, 0xff, 0x2f, 0x20, 0x41, 0x0f, 0x21, 0x0a, 0xcd, 0x01},
{1600, 1024, 76, 0x7e, 0x63, 0x63, 0x82, 0x66, 0x0f, 0x2c, 0x5a, 0x60, 0x03,
0x06, 0xff, 0xff, 0x2d, 0x80, 0x41, 0xcf, 0x21, 0x4c, 0xf8, 0x01,},
{1600, 1200, 60, 0x82, 0x63, 0x63, 0x86, 0x68, 0x14, 0xe0, 0x10, 0x40, 0xb1,
// 0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x44, 0xd5, 0x01},
0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x0a, 0xb3, 0x01},
{1600, 1200, 65, 0x82, 0x63, 0x63, 0x86, 0x68, 0x14, 0xe0, 0x10, 0x40, 0xb1,
// 0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x44, 0xe7, 0x01},
0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x11, 0x91, 0x01},
{1600, 1200, 70, 0x82, 0x63, 0x63, 0x86, 0x68, 0x14, 0xe0, 0x10, 0x40, 0xb1,
// 0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x34, 0xc4, 0x01},
0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x0d, 0x82, 0x01},
{1600, 1200, 75, 0x82, 0x63, 0x63, 0x86, 0x68, 0x14, 0xe0, 0x10, 0x40, 0xb1,
// 0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x30, 0xc4, 0x01},
0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x09, 0x6f, 0x01},
{1600, 1200, 80, 0x82, 0x63, 0x63, 0x86, 0x68, 0x14, 0xe0, 0x10, 0x40, 0xb1,
// 0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x24, 0xa4, 0x01},
0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x11, 0xb3, 0x01},
{1600, 1200, 85, 0x82, 0x63, 0x63, 0x86, 0x68, 0x14, 0xe0, 0x10, 0x40, 0xb1,
// 0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x0c, 0x4e, 0x01},
0x24, 0xaf, 0xaf, 0xe1, 0x80, 0x55, 0x0f, 0x21, 0x09, 0x7e, 0x01},
{1792, 1344, 60, 0x8e, 0x6f, 0x6f, 0x92, 0x71, 0x1f, 0x74, 0x1f, 0x40, 0x43,
// 0x29, 0x3f, 0x3f, 0x75, 0x80, 0x55, 0x0f, 0x21, 0x30, 0xbf, 0x01},
0x29, 0x3f, 0x3f, 0x75, 0x80, 0x55, 0x0f, 0x21, 0x15, 0xbf, 0x01},
{1792, 1344, 75, 0x94, 0x6f, 0x6f, 0x98, 0x74, 0x01, 0x87, 0x1f, 0x40, 0x4a,
// 0x4d, 0x3f, 0x3f, 0x88, 0x00, 0x55, 0x0f, 0x21, 0x0c, 0x59, 0x01},
0x4d, 0x3f, 0x3f, 0x88, 0x00, 0x55, 0x0f, 0x21, 0x05, 0x6b, 0x01},
{1856, 1392, 60, 0x92, 0x73, 0x73, 0x96, 0x7c, 0x03, 0xa4, 0x1f, 0x40, 0x73,
// 0x29, 0x6f, 0x6f, 0xa5, 0x00, 0x55, 0x0f, 0x21, 0x3c, 0xf7, 0x01},
0x29, 0x6f, 0x6f, 0xa5, 0x00, 0x55, 0x0f, 0x21, 0x15, 0xcb, 0x01},
{1920, 1200, 76, 0x9d, 0x77, 0x77, 0x81, 0x7c, 0x8b, 0xe0, 0x10, 0x40, 0xb3,
0xb6, 0xaf, 0xaf, 0xe1, 0x00, 0x55, 0xcf, 0x21, 0x14, 0x76, 0x01,},
{1920, 1440, 60, 0x9d, 0x77, 0x77, 0x81, 0x7a, 0x87, 0xda, 0x1f, 0x40, 0xa1,
// 0x24, 0x9f, 0x9f, 0xdb, 0x00, 0x55, 0x0f, 0x21, 0x30, 0xe3, 0x01},
0x24, 0x9f, 0x9f, 0xdb, 0x00, 0x55, 0x0f, 0x21, 0x0d, 0xa1, 0x01},
{2048, 1536, 60, 0x98, 0x7f, 0x7f, 0x9c, 0x80, 0x0f, 0x3b, 0xba, 0x40, 0x01,
0x04, 0xff, 0xff, 0x3c, 0x00, 0x55, 0x0f, 0x21, 0x28, 0xc7, 0x01,},
{2048, 1536, 75, 0xa1, 0x7f, 0x7f, 0x85, 0x84, 0x90, 0x44, 0xba, 0x40, 0x01,
0x04, 0xff, 0xff, 0x45, 0x00, 0x55, 0x0f, 0x21, 0x1c, 0xc7, 0x01,},
// STB Begin Changes
#endif // #ifdef H4
// STB End Changes

151
glide2x/h3/cinit/plltable.h Normal file
View File

@@ -0,0 +1,151 @@
/*
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
**
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
** THE UNITED STATES.
**
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** File name: plltable.h
**
** Description: The V3 PLL table.
**
** $History: plltable.h $
**
** ***************** Version 1 *****************
** User: Sapphire Date: 3/16/99 Time: 7:28p
** Created in $/Releases/Voodoo3/V3_OEM_100/3dfx/devel/H3/cinit
**
** ***************** Version 4 *****************
** User: Michael Date: 1/12/99 Time: 9:23a
** Updated in $/devel/h3/Win95/dx/minivdd
** Implement the 3Dfx/STB unified header.
**
** ***************** Version 3 *****************
** User: Artg Date: 8/27/98 Time: 11:08a
** Updated in $/devel/h3/Win95/dx/minivdd
** added guard ifdef for redundant plltable define.
**
** ***************** Version 2 *****************
** User: Ken Date: 4/15/98 Time: 6:42p
** Updated in $/devel/h3/win95/dx/minivdd
** added unified header to all files, with revision, etc. info in it
*/
//
// generated by gen_plltable.pl at Thu Apr 9 18:44:30 1998
//
#define MIN_PLL_FREQ 30
#define MAX_PLL_FREQ 120
#if !defined(Host_H3)
FxU32 _pllTable[] = {
// pllCtrl n m k actual(MHz)
// ------- --- --- --- -----------
0x00006B2E, // 107 11 2 30.013108
0x00001806, // 24 1 2 31.022723
0x00007B32, // 123 12 2 31.960223
0x0000511E, // 81 7 2 33.011359
0x0000240A, // 36 2 2 34.005677
0x0000561E, // 86 7 2 34.999996
0x0000772A, // 119 10 2 36.093745
0x00001D06, // 29 1 2 36.988632
0x0000531A, // 83 6 2 38.032666
0x00006B22, // 107 8 2 39.017041
0x00007926, // 121 9 2 40.025821
0x00007C26, // 124 9 2 41.002061
0x00002D0A, // 45 2 2 42.059654
0x00002206, // 34 1 2 42.954540
0x00005416, // 84 5 2 43.977267
0x00005616, // 86 5 2 44.999994
0x00005816, // 88 5 2 46.022721
0x0000671A, // 103 6 2 46.981528
0x0000410E, // 65 3 2 47.965903
0x00002706, // 39 1 2 48.920448
0x00002806, // 40 1 2 50.113630
0x0000370A, // 55 2 2 51.008516
0x0000380A, // 56 2 2 51.903402
0x0000480E, // 72 3 2 52.977266
0x0000771A, // 119 6 2 54.140618
0x0000791A, // 121 6 2 55.035504
0x00007B1A, // 123 6 2 55.930391
0x00007D1A, // 125 6 2 56.825277
0x00004F0E, // 79 3 2 57.988629
0x0000400A, // 64 2 2 59.062492
0x00006B2D, // 107 11 1 60.026216
0x00007E35, // 126 13 1 61.090901
0x00001805, // 24 1 1 62.045447
0x00002A0D, // 42 3 1 62.999992
0x00007B31, // 123 12 1 63.920446
0x0000742D, // 116 11 1 64.982509
0x0000511D, // 81 7 1 66.022719
0x00006525, // 101 9 1 67.035115
0x00002409, // 36 2 1 68.011355
0x00006825, // 104 9 1 68.987595
0x0000561D, // 86 7 1 69.999991
0x00007529, // 117 10 1 70.994309
0x00007729, // 119 10 1 72.187491
0x0000310D, // 49 3 1 73.022718
0x00001D05, // 29 1 1 73.977263
0x00007125, // 113 9 1 74.845032
0x00005319, // 83 6 1 76.065331
0x00002909, // 41 2 1 76.960217
0x00006B21, // 107 8 1 78.034081
0x00001F05, // 31 1 1 78.749990
0x00007925, // 121 9 1 80.051643
0x00006F21, // 111 8 1 80.897717
0x00007C25, // 124 9 1 82.004122
0x0000380D, // 56 3 1 83.045444
0x00002D09, // 45 2 1 84.119308
0x00005D19, // 93 6 1 85.014194
0x00002205, // 34 1 1 85.909080
0x00005315, // 83 5 1 86.931807
0x00005415, // 84 5 1 87.954534
0x00005515, // 85 5 1 88.977261
0x00005615, // 86 5 1 89.999989
0x00005715, // 87 5 1 91.022716
0x00005815, // 88 5 1 92.045443
0x00002505, // 37 1 1 93.068170
0x00006719, // 103 6 1 93.963056
0x00005B15, // 91 5 1 95.113624
0x0000410D, // 65 3 1 95.931806
0x0000781D, // 120 7 1 97.045442
0x00002705, // 39 1 1 97.840897
0x00005111, // 81 4 1 99.034078
0x00002805, // 40 1 1 100.227260
0x00007D1D, // 125 7 1 101.022714
0x00003709, // 55 2 1 102.017033
0x00007119, // 113 6 1 102.911919
0x00003809, // 56 2 1 103.806805
0x00002A05, // 42 1 1 104.999987
0x0000480D, // 72 3 1 105.954532
0x00002B05, // 43 1 1 107.386350
0x00007719, // 119 6 1 108.281236
0x00003B09, // 59 2 1 109.176123
0x00007919, // 121 6 1 110.071009
0x00003C09, // 60 2 1 110.965895
0x00007B19, // 123 6 1 111.860781
0x00004D0D, // 77 3 1 113.113622
0x00007D19, // 125 6 1 113.650554
0x00002E05, // 46 1 1 114.545440
0x00004F0D, // 79 3 1 115.977258
0x00002F05, // 47 1 1 116.931803
0x00004009, // 64 2 1 118.124985
0x0000510D, // 81 3 1 118.840894
0x00006B2C, // 107 11 0 120.052432
};
FxU32 *pllTable = (FxU32*) (_pllTable - MIN_PLL_FREQ);
#endif

View File

@@ -17,11 +17,20 @@
;;
;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
;;
;; $Header$
;; $Log$
;; Revision 1.1.1.1.2.1 2006/11/30 09:16:50 guillemj
;; Switch to the new "build system", to be in sync with the rest of glide.
;; Backport cpudtect.asm from glide3 for h3.
;; Add fpu.c to cvg.
;;
;; Revision 1.1.1.1.8.1 2003/11/07 13:38:38 dborca
;; unite the clans
;;
;; Revision 1.1.1.1 1999/11/24 21:44:53 joseph
;; Initial checkin for SourceForge
;;
;;
;; 3 3/17/99 6:14p Dow
;; Phantom Menace and other fixes.
;; 4 4/06/99 3:54p Dow
;; Alt tab again.
;;
;; 9 3/10/99 10:40a Peter
;; detect katmai-ness
@@ -45,10 +54,7 @@
;;
;;
TITLE cpudtect.asm
.586P
.model FLAT,C ; Flat memory, mangle publics with leading '_'
%include "xos.inc"
;; Data for data segment goes here
;_DATA SEGMENT DWORD USE32 PUBLIC 'DATA';
@@ -56,14 +62,14 @@ TITLE cpudtect.asm
;;; Some useful constants
; CPU Type
CPUTypeUnknown = 0ffffffffh
CPUTypePrePent = 4h
CPUTypeP5 = 5h
CPUTypeP6 = 6h
CPUTypeUnknown equ 0ffffffffh
CPUTypePrePent equ 4h
CPUTypeP5 equ 5h
CPUTypeP6 equ 6h
;;; References to external data:
_TEXT SEGMENT
segment SEG_TEXT
;;
;; _cpu_detect_asm - detect the type of CPU
;;
@@ -73,10 +79,8 @@ _TEXT SEGMENT
;;
;; returns 4 for non-pen
PUBLIC _cpu_detect_asm
_cpu_detect_asm PROC NEAR
proc _cpu_detect_asm
P6Stuff:
.586
push esi ; save registers that are not volatile
push edi
push ebx
@@ -276,45 +280,38 @@ UnknownVendor:
jmp DoneCpu
_cpu_detect_asm ENDP
endp
;------------------------------------------------------------------------------
; this routine sets the precision to single
; which effects all adds, mults, and divs
align 4 ;
PUBLIC single_precision_asm
single_precision_asm PROC NEAR
.586
proc single_precision_asm
push eax ; make room
fnclex ; clear pending exceptions
fstcw WORD PTR [esp]
mov eax, DWORD PTR [esp]
fstcw WORD [esp]
mov eax, DWORD [esp]
and eax, 0000fcffh ; clear bits 9:8
mov DWORD PTR [esp], eax
fldcw WORD PTR [esp]
mov DWORD [esp], eax
fldcw WORD [esp]
pop eax
ret 0
single_precision_asm ENDP
ret
endp
;------------------------------------------------------------------------------
; this routine sets the precision to double
; which effects all adds, mults, and divs
align 4 ;
PUBLIC double_precision_asm
double_precision_asm PROC NEAR
.586
proc double_precision_asm
push eax ; make room
fnclex ; clear pending exceptions
fstcw WORD PTR [esp]
mov eax, DWORD PTR [esp]
fstcw WORD [esp]
mov eax, DWORD [esp]
and eax, 0000fcffh ; clear bits 9:8
or eax, 000002ffh ; set 9:8 to 10
mov DWORD PTR [esp], eax
fldcw WORD PTR [esp]
mov DWORD [esp], eax
fldcw WORD [esp]
pop eax
ret 0
double_precision_asm ENDP
_TEXT ENDS
END
ret
endp

View File

@@ -19,6 +19,12 @@
**
** $Header$
** $Log$
** Revision 1.2 2003/06/28 19:10:36 guillemj
** Fixed preprocessor invalid tokens in newer gcc 3.x versions.
**
** Revision 1.1.1.1 1999/12/07 21:49:26 joseph
** Initial checkin into SourceForge.
**
**
** 3 3/17/99 6:16p Dow
** Phantom Menace and other fixes.
@@ -2001,7 +2007,7 @@ _grFifoFWriteDebug((FxU32) a, (float) b, (FxU32) c)
__stwbrx( *((FxU32*)&temp), (void*)&(d), 0 ); \
}
# define SET_LINEAR(d, s) SET((d), (s))
# define SET_LINEAR_16(d, s) SET((d), ((((FxU32)(s)) >> 16UL) | \
# define SET_LINEAR_16(d, s) SET((d), ((((FxU32)(s)) >> 16UL) | \
(((FxU32)(s)) << 16UL)))
# define SET_LINEAR_8(d, s) ((d) = (s))
# else /* !defined(__MWERKS__) && POWERPC */
@@ -3005,7 +3011,7 @@ do { \
#define REG_GROUP_SETF_CLAMP(__regBase, __regAddr, __val) \
do { \
const FxU32 fpClampVal = FP_FLOAT_CLAMP(__val); \
REG_GROUP_ASSERT(__regAddr, fpClampVal, FXTRUE); \
REG_GROUP_ASSERT(__regAddr, fpClampVal, FXTRUE); \
SET(((FxU32*)(__regBase))[offsetof(SstRegs, __regAddr) >> 2], fpClampVal); \
GR_INC_SIZE(sizeof(FxU32)); \
} while(0)
@@ -3353,16 +3359,16 @@ double_precision_asm(void);
//#define GLIDE3_DEBUG 1
#endif
#ifdef GLIDE3_DEBUG
#define TEX_INFO(ptr,field) ptr##field
#define TEX_INFO(ptr,field) ptr.field
#define G3_LOD_TRANSLATE(lod) (lod)
#define G3_ASPECT_TRANSLATE(aspect) (aspect)
#else
#define TEX_INFO(ptr,field) ptr##field##Log2
#define TEX_INFO(ptr,field) ptr.field ## Log2
#define G3_LOD_TRANSLATE(lod) (0x8-lod)
#define G3_ASPECT_TRANSLATE(aspect) (0x3-(aspect))
#endif /* GLIDE3_DEBUG */
#else
#define TEX_INFO(ptr,field) ptr##field
#define TEX_INFO(ptr,field) ptr.field
#define G3_LOD_TRANSLATE(lod) (lod)
#define G3_ASPECT_TRANSLATE(aspect) (aspect)
#endif

View File

@@ -19,6 +19,9 @@
**
** $Header$
** $Log$
** Revision 1.2 2000/10/03 18:29:55 mercury
** 003-clean_up_h3-000, h3 tree cleanup.
**
** Revision 1.1.1.1 1999/12/07 21:49:27 joseph
** Initial checkin into SourceForge.
**
@@ -299,18 +302,13 @@ GR_DIENTRY(gu3dfGetInfo, FxBool,
/*
** determine the color format of the input image
*/
#ifdef __GNUC__
/* This function is not found in libgcc.a */
{
char* tempStr = (char*)color_format;
while(*tempStr != '\0') *tempStr++ = toupper(*tempStr);
char *tempStr = (char*)color_format;
while (*tempStr != '\0') {
*tempStr = toupper(*tempStr);
tempStr++;
}
}
#else
{
extern char* strupr(char*);
strupr(color_format);
}
#endif /* __GNUC__ */
i = 0;
format_found = FXFALSE;

View File

@@ -752,29 +752,17 @@ all_done:
* between them.
*/
asm (
asm (
#if defined(PIC)
"popl %%ebx\n\t"
#endif
#if !defined(BIG_OPT)
"popl %%ebp\n\t"
"popl %%ebx\n\t"
#endif
"jmp *%0"
: /* no outputs */
:"m" (_GlideRoot.curGC->archDispatchProcs.triSetupProc)
#if defined (PIC) || !defined (BIG_OPT)
:
"jmp *%0"
:
: "m" (_GlideRoot.curGC->archDispatchProcs.triSetupProc)
#if defined(PIC)
: "ebx"
#endif
#if defined (PIC)
"ebx"
#endif
#if defined (PIC) && !defined (BIG_OPT)
,
#endif
#if !defined(BIG_OPT)
"ebp"
#endif
);
);
#endif
#endif
#undef FN_NAME

View File

@@ -20,6 +20,9 @@
**
** $Header$
** $Log$
** Revision 1.1.1.1 1999/12/07 21:49:27 joseph
** Initial checkin into SourceForge.
**
**
** 3 3/17/99 6:16p Dow
** Phantom Menace and other fixes.
@@ -159,35 +162,25 @@ GR_DIENTRY(grErrorSetCallback, void,
GrErrorCallback = function;
}
#ifdef __WIN32__
void
_grErrorDefaultCallback( const char *s, FxBool fatal )
{
if ( fatal ) {
GDBG_ERROR("glide", s);
grGlideShutdown();
MessageBox(NULL, s, NULL, MB_OK);
}
}
#else
void
_grErrorDefaultCallback( const char *s, FxBool fatal )
{
if ( fatal ) {
GDBG_ERROR("glide",s);
grGlideShutdown();
#if (GLIDE_PLATFORM & GLIDE_OS_MACOS)
{
Str255 errBuf;
errBuf[0] = sprintf((char*)(errBuf + 1), "%s", s);
DebugStr(errBuf);
}
#ifdef __WIN32__
MessageBox(NULL, s, NULL, MB_OK);
#elif (GLIDE_PLATFORM & GLIDE_OS_MACOS)
{
Str255 errBuf;
errBuf[0] = sprintf((char*)(errBuf + 1), "%s", s);
DebugStr(errBuf);
}
#endif /* (GLIDE_PLATFORM * GLIDE_OS_MACOS) */
}
}
#endif
#ifdef __DOS__
int _guHeapCheck( void )

View File

@@ -19,6 +19,9 @@
**
** $Header$
** $Log$
** Revision 1.1.1.1 1999/12/07 21:49:28 joseph
** Initial checkin into SourceForge.
**
**
** 3 3/17/99 6:16p Dow
** Phantom Menace and other fixes.
@@ -239,9 +242,9 @@ static void
downloadTexture(Texture *texture, Gu3dfInfo *info)
{
texture->info.data = info->data;
TEX_INFO(texture->info.,smallLod) = info->header.small_lod;
TEX_INFO(texture->info.,largeLod) = info->header.large_lod;
TEX_INFO(texture->info.,aspectRatio) = info->header.aspect_ratio;
TEX_INFO(texture->info,smallLod) = info->header.small_lod;
TEX_INFO(texture->info,largeLod) = info->header.large_lod;
TEX_INFO(texture->info,aspectRatio) = info->header.aspect_ratio;
texture->info.format = info->header.format;
texture->addr = nextFreeBase;

View File

@@ -1,279 +1,328 @@
# Linux makefile for Glide2/H3
# This makefile MUST be processed by GNU make!!!
#
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
#
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
# THE UNITED STATES.
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
ifeq ($(FX_CHRIS_DENIS_ANTHONY_HACK),1)
LCDEFS += -DCHRIS_DENIS_ANTHONY_HACK=1
endif
FX_TACO_MEMORY_FIFO_HACK =
ifneq ($(FX_TACO_MEMORY_FIFO_HACK),)
LCDEFS += -DTACO_MEMORY_FIFO_HACK
endif
ifneq ($(DIAG_BUILD),)
LCDEFS += -DDIAG_BUILD
endif
# This is a bit of a red herring
ifeq ($(FX_GLIDE_DIRECT_WRITE),1)
FX_GLIDE_DIRECT_WRITE = 1
LCDEFS += -DDIRECT_IO=1
else
FX_GLIDE_PACKET_FIFO = 1
endif
ifeq ($(FX_GLIDE_PACKET_FIFO),1)
CMDXPORTDEFS = -DGLIDE_PACKET3_TRI_SETUP=1 -DUSE_PACKET_FIFO=1 -DGLIDE_HW_TRI_SETUP=1
else
CMDXPORTDEFS = -DUSE_PACKET_FIFO=0 -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKET3_TRI_SETUP=0
FX_GLIDE_DEBUG_FIFO=1
endif
FX_GLIDE_REAL_HW= 1
FX_GLIDE_NO_FIFO= 1
ifneq ($(FX_GLIDE_CTRISETUP),1)
FX_GLIDE_CTRISETUP = 0
endif
HWSPEC = fifo.c
LCDEFS += -DH3 $(CMDXPORTDEFS)
INITLIB = $(BUILD_ROOT)/$(FX_GLIDE_HW)/lib$(FX_GLIDE_HW)init.a
ifeq ($(DEBUG),1)
DBGOPTS = -DGLIDE_DEBUG -DGDBG_INFO_ON
GLIDE_SANITY_ALL = 1
endif
ifeq ($(FX_GLIDE_HW),)
error "FX_GLIDE_HW not defined"
endif
# Display Options
DSPOPTS =
SUBLIBRARIES =
DSPOPTS += -DGLIDE_INIT_HWC
ifeq ($(HAL_HW),1)
DSPOPTS += -DHAL_HW=1
SUBLIBRARIES += $(BUILD_ROOT_SWLIBS)/lib/libfxmisc.a \
$(BUILD_ROOT_SWLIBS)/lib/libfxpci.a \
$(BUILD_ROOT)/$(FX_GLIDE_HW)/lib/libminihwc.a
LINKLIBRARIES += -L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm
endif
ifeq ($(HAL_HW),)
SUBLIBRARIES += $(BUILD_ROOT)/h3/lib/libminihwc.a
endif
# 3DNow stuff
GL_AMD3D = 1
ifneq ($(GL_AMD3D),)
LCDEFS += -DGL_AMD3D
LIBOBJS += xtexdl_3dnow.o
CFILES += xtexdl_def.c
endif
# Do culling test in sw for independent triangles
CULL_MODE =
ifneq ($(FX_GLIDE_HW_CULL),1)
CULL_MODE = -DGLIDE_TRI_CULLING=1
endif
DSPOPTS += $(CULL_MODE)
# Send a single DWORD ARGB rather than 4 fp values, at
# the cost of doing the conversion.
ifeq ($(FX_GLIDE_PACK_RGB),1)
LCDEFS += -DGLIDE_PACKED_RGB=1
endif
ifneq ($(FX_GLIDE_NO_FIFO),1)
FIFODEFS = -DUSE_PACKET_FIFO=1
ifeq ($(FX_GLIDE_DEBUG_FIFO),1)
# GLIDE_USE_DEBUG_FIFO: Run w/ the small fifo to cause me/glide more stress
# FIFO_ASSERT_FULL: Check hw depth/fifo a lot (slow)
LCDEFS += -DGLIDE_USE_DEBUG_FIFO=1 -DFIFO_ASSERT_FULL=1 -DASSERT_FAULT=0 -DGLIDE_SANITY_SIZE=1
endif
endif
# Optimization Options
# This is for turning on and off algorithmic optimizations,
# not flags to the C compiler. Usually this involves
# enabling/disabling assembly language code, but it can also
# change the way C code works, or how C code generates data to be
# used by various pieces of code.
# Usually these are set with environment variables or arguments to
# nmake.
# $Id$
#
# Copyright (c) 2003 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# Copyright (c) 2006 - Guillem Jover <guillem@hadrons.org>
#
# Turn on/off assembly language trisetup code.
# (C on is Assembly off) (A ssembly T ri S etup OPTS)
ifeq ($(FX_GLIDE_CTRISETUP),1)
ASMTRISETUP =
ATSOPTS = -DGLIDE_USE_C_TRISETUP
CFILES = gxdraw.c
else
DSPOPTS += -DGLIDE_DISPATCH_SETUP=1 -DGLIDE_PACKED_RGB=0
ifeq ($(GL_AMD3D),)
ASMTRISETUP = xdraw2.S
else
LIBOBJS += xdraw2_def.o xdraw2_3dnow.o
endif #GL_AMD3D
endif
OPTOPTS = $(GRMOPTS) $(OTSOPTS) $(ATSOPTS)
# local defines, begin with basics and then add on
LCDEFS += -DGLIDE_LIB
# Turn Off/On compilation of shameless plug
ifeq ($(FX_GLIDE_NO_PLUG),1)
else
LCDEFS += -DGLIDE_PLUG
endif
# Turn Off/On splash screen
ifeq ($(FX_GLIDE_NO_SPLASH),1)
else
LCDEFS += -DGLIDE_SPLASH
endif
#Glide 3 Stuff, for migration all
ifneq ($(FX_GLIDE3),)
LCDEFS += -DGLIDE3
GLIDE3FILES = gstrip.c distrip.c distate.c diget.c
endif
#Glide 3. remove migration stuff
ifneq ($(FX_GLIDE3_ALPHA),)
LCDEFS += -DGLIDE3_ALPHA
GLIDE3FILES = gstrip.c distrip.c distate.c diget.c
endif
ifneq ($(GLIDE_SANITY_ALL)$(GLIDE_SANITY_SIZE),)
LCDEFS += -DGLIDE_SANITY_SIZE
endif
ifneq ($(GLIDE_SANITY_ALL)$(GLIDE_SANITY_ASSERT),)
LCDEFS += -DGLIDE_SANITY_ASSERT
endif
# Local Defs, Includes, and Options (C)
LCINCS += -I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include
LCOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
# Local Defs, Includes, and Options (ASM)
LADEFS += $(ASM_REGMAP_DEFS)
LAINCS = -I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include
LAOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
AFILES = $(ASMTRISETUP) cpudtect.S
# sources
HEADERS = glide.h gump.h glidesys.h glideutl.h
PRIVATE_HEADERS = fxglide.h gsstdef.h fxinline.h fxsplash.h
INSTALL_DESTINATION = $(BUILD_ROOT)/$(FX_GLIDE_HW)
CFILES += gsplash.c g3df.c gu.c guclip.c\
gpci.c gump.c diglide.c disst.c ditex.c\
gbanner.c gerror.c gmovie.c digutex.c ddgump.c\
gaa.c gdraw.c gglide.c glfb.c gsst.c gtex.c\
gtexdl.c gutex.c $(HWSPEC) $(GLIDE3FILES)
OFILES = $(CFILES:.c=.o)
OTHER_CFILES = fxgasm.c fxbldno.c fxinline.h
# targets
LDIRT = fxgasm.o fxgasm fxgasm.h fxinline.h fxbldno.o fxbldno fxbldno.h
ifeq ($(FX_GLIDE3),1)
LIBRARIES = libglide3.a
SHARED_LIBRARY = libglide3.so.3.10
else
LIBRARIES = libglide.a
SHARED_LIBRARY = libglide.so.2.60
endif
RCFILE = glide.rc
# Make a static link library for things like the diags.
ifeq ($(FX_DLL_BUILD),1)
FX_DLL_LIBRARY = 1
else
LCDEFS += -DFX_STATIC_BUILD
endif
LCDEFS += $(FIFODEFS)
include $(BUILD_ROOT)/swlibs/include/make/3dfx.mak
ctags: $(CFILES)
ctags $(CFILES)
gbanner.obj : banner.inc
gsplash.obj : splshdat.c
#--------------------------------------------------------------------------
# special rules for making FXGASM.H
#
fxgasm: fxgasm.c $(HEADERS) gsstdef.h fxglide.h makefile.linux
$(CC) -o $@ fxgasm.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) \
-I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include -I$(BUILD_ROOT)/swlibs/include \
$(LDFLAGS)
# Available options:
#
# Environment variables:
# FX_GLIDE_HW build for the given ASIC (h3).
# default = h3
# DRI=1 Build DRI version.
# default = no
# XPATH specify X libraries path; needed by DRI.
# default = /usr/X11R6/lib
# H4=1 High speed Avenger.
# default = no
# OPTFLAGS pass given optimization flags to compiler
# default = -O2 -ffast-math
# DEBUG=1 enable debugging checks and messages
# default = no
# USE_X86=1 use assembler triangle specializations!
# default = no
# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU
# capabilities are still checked at run-time to avoid
# crashes.
# default = no
#
# Targets:
# all: build everything
# glide2x: build Glide2x lib
# clean: remove object files
# realclean: remove all generated files
#
.PHONY: all glide2x clean realclean
.INTERMEDIATE: fxgasm
.SUFFIXES: .lo
export PATH := $(PATH):.
###############################################################################
# general defines (user settable?)
###############################################################################
GLIDE_VERSION_MAJOR = 2
GLIDE_VERSION_MINOR = 60
GLIDE_LIB = libglide.a
GLIDE_SO = libglide.so
GLIDE_SONAME = $(GLIDE_SO).$(GLIDE_VERSION_MAJOR)
GLIDE_SHARED = $(GLIDE_SONAME).$(GLIDE_VERSION_MINOR)
FX_GLIDE_HW ?= h3
FX_GLIDE_SW = ../../../swlibs
GLIDE_LIBDIR = ../../lib
###############################################################################
# tools
###############################################################################
CC = gcc
AS = nasm
AR = ar
CP = cp
###############################################################################
# defines
###############################################################################
# platform
CDEFS = -D__linux__
XPATH ?= /usr/X11R6/lib
ifeq ($(DRI),1)
CDEFS += -DDRI_BUILD -DX11
LDFLAGS = -L$(XPATH)
LDLIBS = -lX11 -lXext -lXxf86dga -lXxf86vm
endif
LDLIBS += -lm
# general
CDEFS += -DGLIDE_HW_TRI_SETUP=1 -DGLIDE_INIT_HWC -DGLIDE_PACKED_RGB=0 -DGLIDE_TRI_CULLING=1
CDEFS += -DENDB -DGLIDE_LIB -DFX_STATIC_BUILD -DHAL_HW=1
#CDEFS += -DGLIDE_CHECK_CONTEXT
# subsystem
CDEFS += -DH3
ifdef H4
CDEFS += -DH4
endif
# debug
ifdef DEBUG
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
endif
override USE_FIFO = 1
#override USE_X86 = 1
ifeq ($(USE_X86),1)
CDEFS += -DGLIDE_DISPATCH_SETUP=1 -DGLIDE_DISPATCH_DOWNLOAD=1
override USE_FIFO = 1
CDEFS += -DHAVE_XDRAWTRI_ASM=1
override USE_DRAWTRI_ASM = 1
else
CDEFS += -DGLIDE_USE_C_TRISETUP=1
endif
# fifo
ifeq ($(USE_FIFO),1)
CDEFS += -DUSE_PACKET_FIFO=1 -DGLIDE_PACKET3_TRI_SETUP=1
endif
# other
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
# obsolete options
# -DDIAG_BUILD
###############################################################################
# flags
###############################################################################
# librarian
ARFLAGS = rus
# assembler
ASFLAGS = -O6 -felf -D__linux__
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -Wall
CFLAGS += -I. -I../../incsrc -I../../minihwc -I../../cinit
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += $(CDEFS)
ifeq ($(USE_3DNOW),1)
CFLAGS += -DGL_AMD3D
override USE_X86 = 1
endif
ifeq ($(USE_X86),1)
CFLAGS += -DGL_X86 -DBIG_OPT
OPTFLAGS ?= -O6 -march=pentium2 -mtune=pentium3 -fomit-frame-pointer -funroll-loops \
-fexpensive-optimizations -ffast-math
else
CFLAGS += -DGLIDE_USE_C_TRISETUP
OPTFLAGS ?= -O6 -march=pentium2 -mtune=pentium3 -ffast-math
endif
# optflags
CFLAGS += $(OPTFLAGS)
###############################################################################
# objects
###############################################################################
GLIDE_OBJECTS = \
fifo.o \
gsplash.o \
g3df.o \
gu.o \
guclip.o \
gpci.o \
gump.o \
diglide.o \
disst.o \
ditex.o \
gbanner.o \
gerror.o \
gmovie.o \
digutex.o \
ddgump.o \
gaa.o \
gdraw.o \
gglide.o \
glfb.o \
gsst.o \
gtex.o \
gtexdl.o \
gutex.o \
cpuid.o \
xtexdl_def.o
ifeq ($(USE_DRAWTRI_ASM),1)
GLIDE_OBJECTS += xdrawtri.o
endif
ifeq ($(USE_X86),1)
GLIDE_OBJECTS += \
xdraw2_def.o \
xdraw3_def.o
ifeq ($(USE_3DNOW),1)
GLIDE_OBJECTS += \
xdraw2_3dnow.o \
xdraw3_3dnow.o \
xtexdl_3dnow.o
endif
else
GLIDE_OBJECTS += \
gxdraw.o
endif
GLIDE_OBJECTS += \
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \
$(FX_GLIDE_SW)/newpci/pcilib/fxlinux.o \
../../minihwc/hwcio.o \
../../minihwc/gdebug.o
# FIXME: needed for now to match the old library signature, should be checked
# if it's really needed.
GLIDE_OBJECTS += \
$(FX_GLIDE_SW)/fxmisc/fxos.o \
$(FX_GLIDE_SW)/fxmisc/fximg.o
ifeq ($(DRI),1)
GLIDE_OBJECTS += \
../../minihwc/linhwc.o \
$(FX_GLIDE_SW)/fxmisc/linutil.o
else
GLIDE_OBJECTS += \
../../minihwc/minihwc.o \
../../minihwc/lin_mode.o \
../../cinit/h3cinit.o
endif
###############################################################################
# rules
###############################################################################
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
.c.lo:
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -c $<
.S.o:
$(CC) -o $@ $(CFLAGS) -c $<
.s.o:
$(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $<
###############################################################################
# main
###############################################################################
all: glide2x
glide2x: $(GLIDE_LIBDIR)/$(GLIDE_LIB) $(GLIDE_LIBDIR)/$(GLIDE_SO)
$(GLIDE_LIBDIR)/$(GLIDE_LIB): $(GLIDE_OBJECTS)
$(AR) $(ARFLAGS) $@ $^
$(GLIDE_LIBDIR)/$(GLIDE_SO): $(GLIDE_LIBDIR)/$(GLIDE_SHARED)
ln -fs $(GLIDE_SHARED) $(GLIDE_LIBDIR)/$(GLIDE_SO)
$(GLIDE_LIBDIR)/$(GLIDE_SHARED): $(GLIDE_OBJECTS:.o=.lo)
$(CC) -o $@ -shared -Wl,--no-undefined -Wl,-soname,$(GLIDE_SONAME) $^ $(LDFLAGS) $(LDLIBS)
###############################################################################
# rules(2)
###############################################################################
cpuid.o: cpudtect.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw2_def.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw3_def.o: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw2_3dnow.o: xdraw2.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xdraw3_3dnow.o: xdraw3.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xtexdl_3dnow.o: xtexdl.asm
$(AS) -o $@ $(ASFLAGS) -DGL_AMD3D=1 $<
xdrawtri.o: xdrawtri.asm
$(AS) -o $@ $(ASFLAGS) $<
cpuid.lo: cpuid.o
$(CP) $< $@
xdraw2_def.lo: xdraw2_def.o
$(CP) $< $@
xdraw3_def.lo: xdraw3_def.o
$(CP) $< $@
xdraw2_3dnow.lo: xdraw2_3dnow.o
$(CP) $< $@
xdraw3_3dnow.lo: xdraw3_3dnow.o
$(CP) $< $@
xtexdl_3dnow.lo: xtexdl_3dnow.o
$(CP) $< $@
xdrawtri.lo: xdrawtri.o
$(CP) $< $@
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
fxinline.h: fxgasm
./$< -inline > $@
fxgasm.h: fxgasm
./fxgasm -hex > fxgasm.h
fxinline.h: fxgasm
./fxgasm -inline > fxinline.h
./$< -hex > $@
fxgasm: fxgasm.c
$(CC) -o $@ $(CFLAGS) $<
#--------------------------------------------------------------------------
# special rules for making FXBLDNO.H
#
###############################################################################
# clean, realclean
###############################################################################
fxbldno: fxbldno.c $(HEADERS) $(PRIVATE_HEADERS)
$(CC) -o $@ fxbldno.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) $(LDFLAGS)
clean:
-$(RM) *.o *.lo
-$(RM) ../../cinit/*.o ../../cinit/*.lo
-$(RM) ../../minihwc/*.o ../../minihwc/*.lo
-$(RM) $(FX_GLIDE_SW)/newpci/pcilib/*.o $(FX_GLIDE_SW)/newpci/pcilib/*.lo
-$(RM) $(FX_GLIDE_SW)/fxmisc/*.o $(FX_GLIDE_SW)/fxmisc/*.lo
-$(RM) fxinline.h
-$(RM) fxgasm.h
fxbldno.h: fxbldno
./fxbldno > fxbldno.h
ifneq ($(FX_GLIDE_CTRISETUP),1)
gdraw.o: fxinline.h
endif
xdraw2.o : xdraw2.S xdraw2.inc.S fxgasm.h fxinline.h
$(CC) -c -o xdraw2.o $(AFLAGS) xdraw2.S
cpudtect.o : cpudtect.S
$(CC) -c -o cpudtect.o $(AFLAGS) cpudtect.S
ifneq ($(GL_AMD3D),)
xdraw2_def.o: xdraw2.S xdraw2.inc.S fxgasm.h
$(CC) -c -o $@ $(AFLAGS) xdraw2.S
xdraw2_3dnow.o: xdraw2.S xdraw2.inc.S fxgasm.h
$(CC) -c -o $@ $(AFLAGS) -DGL_AMD3D -DUSE_PACKET_FIFO xdraw2.S
xtexdl_3dnow.o: xtexdl.S fxgasm.h
$(CC) -c -o $@ $(AFLAGS) -DGL_AMD3D -DUSE_PACKET_FIFO xtexdl.S
endif
realclean: clean
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB)
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SHARED)
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO)

View File

@@ -20,7 +20,10 @@
/* $Header$ */
/* $Revision$ */
/* $Log$ */
/* $Log$
/* Revision 1.1.1.1 1999/12/07 21:49:30 joseph
/* Initial checkin into SourceForge.
/* */
/* */
/* 11 10/05/98 7:43p Peter */
/* 3DNow!(tm) happiness everywhere */
@@ -122,10 +125,12 @@ PROC_TYPE(cull):
#define GLIDE_GENERIC_SETUP 0
#include "xdraw2.inc.S"
#undef cull
#define GLIDE_GENERIC_SETUP 0
#define GLIDE_PACK_ALPHA 0
#define GLIDE_PACK_RGB 0
#define GLIDE_CULLING 0
#undef GLIDE_GENERIC_SETUP
#undef GLIDE_PACK_ALPHA
#undef GLIDE_PACK_RGB
#undef GLIDE_CULLING
#undef LOCAL
END_PROC_TYPE(cull):
.size PROC_TYPE(cull),END_PROC_TYPE(cull)-PROC_TYPE(cull)
@@ -144,10 +149,12 @@ PROC_TYPE(cull_rgb):
#define GLIDE_PACK_ALPHA 0
#define GLIDE_GENERIC_SETUP 0
#include "xdraw2.inc.S"
#define GLIDE_GENERIC_SETUP 0
#define GLIDE_PACK_ALPHA 0
#define GLIDE_PACK_RGB 0
#define GLIDE_CULLING 0
#undef GLIDE_GENERIC_SETUP
#undef GLIDE_PACK_ALPHA
#undef GLIDE_PACK_RGB
#undef GLIDE_CULLING
#undef LOCAL
END_PROC_TYPE(cull_rgb):
.size PROC_TYPE(cull_rgb),END_PROC_TYPE(cull_rgb)-PROC_TYPE(cull_rgb)
@@ -165,10 +172,10 @@ PROC_TYPE(cull_argb):
#define GLIDE_PACK_ALPHA 1
#define GLIDE_GENERIC_SETUP 0
#include "xdraw2.inc.S"
#define GLIDE_GENERIC_SETUP 0
#define GLIDE_PACK_ALPHA 0
#define GLIDE_PACK_RGB 0
#define GLIDE_CULLING 0
#undef GLIDE_GENERIC_SETUP
#undef GLIDE_PACK_ALPHA
#undef GLIDE_PACK_RGB
#undef GLIDE_CULLING
END_PROC_TYPE(cull_argb):
.size PROC_TYPE(cull_argb),END_PROC_TYPE(cull_argb)-PROC_TYPE(cull_argb)
@@ -187,10 +194,12 @@ PROC_TYPE(Default):
#define GLIDE_PACK_ALPHA 0
#define GLIDE_GENERIC_SETUP 0
#include "xdraw2.inc.S"
#define GLIDE_GENERIC_SETUP 0
#define GLIDE_PACK_ALPHA 0
#define GLIDE_PACK_RGB 0
#define GLIDE_CULLING 0
#undef GLIDE_GENERIC_SETUP
#undef GLIDE_PACK_ALPHA
#undef GLIDE_PACK_RGB
#undef GLIDE_CULLING
#undef LOCAL
END_PROC_TYPE(Default):
.size PROC_TYPE(Default),END_PROC_TYPE(Default)-PROC_TYPE(Default)
@@ -209,10 +218,12 @@ PROC_TYPE(rgb):
#define GLIDE_PACK_ALPHA 0
#define GLIDE_GENERIC_SETUP 0
#include "xdraw2.inc.S"
#define GLIDE_GENERIC_SETUP 0
#define GLIDE_PACK_ALPHA 0
#define GLIDE_PACK_RGB 0
#define GLIDE_CULLING 0
#undef GLIDE_GENERIC_SETUP
#undef GLIDE_PACK_ALPHA
#undef GLIDE_PACK_RGB
#undef GLIDE_CULLING
#undef LOCAL
END_PROC_TYPE(rgb):
.size PROC_TYPE(rgb),END_PROC_TYPE(rgb)-PROC_TYPE(rgb)
@@ -230,10 +241,12 @@ PROC_TYPE(argb):
#define GLIDE_PACK_ALPHA 1
#define GLIDE_GENERIC_SETUP 0
#include "xdraw2.inc.S"
#define GLIDE_GENERIC_SETUP 0
#define GLIDE_PACK_ALPHA 0
#define GLIDE_PACK_RGB 0
#define GLIDE_CULLING 0
#undef GLIDE_GENERIC_SETUP
#undef GLIDE_PACK_ALPHA
#undef GLIDE_PACK_RGB
#undef GLIDE_CULLING
#undef LOCAL
END_PROC_TYPE(argb):
.size PROC_TYPE(argb),END_PROC_TYPE(argb)-PROC_TYPE(argb)

View File

@@ -56,161 +56,143 @@
; B4 Chip field fix.
;;
TITLE xdraw2.asm
OPTION OLDSTRUCTS
%include "xos.inc"
.586P
.MMX
.K3D
EXTRN __GlideRoot: DWORD
EXTRN __FifoMakeRoom: NEAR
extrn _GlideRoot
extrn _FifoMakeRoom
_DATA SEGMENT
One DD 03f800000r
segment SEG_DATA
One DD 1.0
Area DD 0
IF GLIDE_PACKED_RGB
%if GLIDE_PACKED_RGB
bias0 DD 0
bias1 DD 0
ENDIF
_DATA ENDS
%endif
; Ugly, but seems to workaround the problem with locally defined
; data segment globals not getting relocated properly when using
; djgpp.
zArea TEXTEQU <One+04h>
%define zArea One+04h
;;; Definitions of cvg regs and glide root structures.
INCLUDE fxgasm.h
%include "fxgasm.h"
; Arguments (STKOFF = 16 from 4 pushes)
STKOFF = 16
_va$ = 4 + STKOFF
_vb$ = 8 + STKOFF
_vc$ = 12 + STKOFF
STKOFF equ 16
_va$ equ 4 + STKOFF
_vb$ equ 8 + STKOFF
_vc$ equ 12 + STKOFF
X equ 0
Y equ 4
%MACRO PROC_TYPE 1
%IFDEF GL_AMD3D
proc _trisetup_3DNow_%1, 12
%ELSE
proc _trisetup_Default_%1, 12
%ENDIF
%ENDM
PROC_TYPE MACRO procType:=<Default>
IFDEF GL_AMD3D
EXITM <__trisetup_3DNow_&procType&@12>
ELSE
EXITM <__trisetup_Default_&procType&@12>
ENDIF
ENDM
;--------------------------------------------------------------------------
_TEXT SEGMENT PAGE PUBLIC USE32 'CODE'
ASSUME DS: FLAT, SS: FLAT
segment SEG_TEXT
ALIGN 32
PROC_TYPE cull
%define GLIDE_CULLING 1
%define GLIDE_PACK_RGB 0
%define GLIDE_PACK_ALPHA 0
%define GLIDE_GENERIC_SETUP 0
%INCLUDE "xdraw2.inc"
%undef GLIDE_GENERIC_SETUP
%undef GLIDE_PACK_ALPHA
%undef GLIDE_PACK_RGB
%undef GLIDE_CULLING
endp
ALIGN 32
PUBLIC PROC_TYPE(cull)
PROC_TYPE(cull) PROC NEAR
%IF GLIDE_PACKED_RGB
GLIDE_CULLING textequ <1>
GLIDE_PACK_RGB textequ <0>
GLIDE_PACK_ALPHA textequ <0>
GLIDE_GENERIC_SETUP textequ <0>
INCLUDE xdraw2.inc
GLIDE_GENERIC_SETUP textequ <0>
GLIDE_PACK_ALPHA textequ <0>
GLIDE_PACK_RGB textequ <0>
GLIDE_CULLING textequ <0>
PROC_TYPE cull_rgb
PROC_TYPE(cull) ENDP
%define GLIDE_CULLING 1
%define GLIDE_PACK_RGB 1
%define GLIDE_PACK_ALPHA 0
%define GLIDE_GENERIC_SETUP 0
%INCLUDE "xdraw2.inc"
%undef GLIDE_GENERIC_SETUP
%undef GLIDE_PACK_ALPHA
%undef GLIDE_PACK_RGB
%undef GLIDE_CULLING
endp
ALIGN 32
PROC_TYPE cull_argb
IF GLIDE_PACKED_RGB
PUBLIC PROC_TYPE(cull_rgb)
PROC_TYPE(cull_rgb) PROC NEAR
%define GLIDE_CULLING 1
%define GLIDE_PACK_RGB 1
%define GLIDE_PACK_ALPHA 1
%define GLIDE_GENERIC_SETUP 0
%INCLUDE "xdraw2.inc"
%undef GLIDE_GENERIC_SETUP
%undef GLIDE_PACK_ALPHA
%undef GLIDE_PACK_RGB
%undef GLIDE_CULLING
GLIDE_CULLING textequ <1>
GLIDE_PACK_RGB textequ <1>
GLIDE_PACK_ALPHA textequ <0>
GLIDE_GENERIC_SETUP textequ <0>
INCLUDE xdraw2.inc
GLIDE_GENERIC_SETUP textequ <0>
GLIDE_PACK_ALPHA textequ <0>
GLIDE_PACK_RGB textequ <0>
GLIDE_CULLING textequ <0>
PROC_TPYE(cull_rgb) ENDP
ALIGN 32
PUBLIC PROC_TPYE(cull_argb)
PROC_TPYE(cull_argb) PROC NEAR
GLIDE_CULLING textequ <1>
GLIDE_PACK_RGB textequ <1>
GLIDE_PACK_ALPHA textequ <1>
GLIDE_GENERIC_SETUP textequ <0>
INCLUDE xdraw2.inc
GLIDE_GENERIC_SETUP textequ <0>
GLIDE_PACK_ALPHA textequ <0>
GLIDE_PACK_RGB textequ <0>
GLIDE_CULLING textequ <0>
PROC_TPYE(cull_argb) ENDP
ENDIF ; GLIDE_PACKED_RGB
endp
%ENDIF ; GLIDE_PACKED_RGB
ALIGN 32
PROC_TYPE Default
PUBLIC PROC_TYPE()
PROC_TYPE() PROC NEAR
%define GLIDE_CULLING 0
%define GLIDE_PACK_RGB 0
%define GLIDE_PACK_ALPHA 0
%define GLIDE_GENERIC_SETUP 0
%INCLUDE "xdraw2.inc"
%undef GLIDE_GENERIC_SETUP
%undef GLIDE_PACK_ALPHA
%undef GLIDE_PACK_RGB
%undef GLIDE_CULLING
GLIDE_CULLING textequ <0>
GLIDE_PACK_RGB textequ <0>
GLIDE_PACK_ALPHA textequ <0>
GLIDE_GENERIC_SETUP textequ <0>
INCLUDE xdraw2.inc
GLIDE_GENERIC_SETUP textequ <0>
GLIDE_PACK_ALPHA textequ <0>
GLIDE_PACK_RGB textequ <0>
GLIDE_CULLING textequ <0>
PROC_TYPE() ENDP
endp
ALIGN 32
IF GLIDE_PACKED_RGB
PUBLIC PROC_TYPE(rgb)
PROC_TPYE(rgb) PROC NEAR
%IF GLIDE_PACKED_RGB
GLIDE_CULLING textequ <0>
GLIDE_PACK_RGB textequ <1>
GLIDE_PACK_ALPHA textequ <0>
GLIDE_GENERIC_SETUP textequ <0>
INCLUDE xdraw2.inc
GLIDE_GENERIC_SETUP textequ <0>
GLIDE_PACK_ALPHA textequ <0>
GLIDE_PACK_RGB textequ <0>
GLIDE_CULLING textequ <0>
PROC_TYPE rgb
PROC_TPYE(rgb) ENDP
%define GLIDE_CULLING 0
%define GLIDE_PACK_RGB 1
%define GLIDE_PACK_ALPHA 0
%define GLIDE_GENERIC_SETUP 0
%INCLUDE "xdraw2.inc"
%undef GLIDE_GENERIC_SETUP
%undef GLIDE_PACK_ALPHA
%undef GLIDE_PACK_RGB
%undef GLIDE_CULLING
endp
ALIGN 32
PROC_TYPE argb
PUBLIC PROC_TPYE(argb)
PROC_TPYE(argb) PROC NEAR
GLIDE_CULLING textequ <0>
GLIDE_PACK_RGB textequ <1>
GLIDE_PACK_ALPHA textequ <1>
GLIDE_GENERIC_SETUP textequ <0>
INCLUDE xdraw2.inc
GLIDE_GENERIC_SETUP textequ <0>
GLIDE_PACK_ALPHA textequ <0>
GLIDE_PACK_RGB textequ <0>
GLIDE_CULLING textequ <0>
PROC_TPYE(argb) ENDP
ENDIF ; GLIDE_PACKED_RGB
_TEXT ENDS
END
%define GLIDE_CULLING 0
%define GLIDE_PACK_RGB 1
%define GLIDE_PACK_ALPHA 1
%define GLIDE_GENERIC_SETUP 0
%INCLUDE "xdraw2.inc"
%undef GLIDE_GENERIC_SETUP
%undef GLIDE_PACK_ALPHA
%undef GLIDE_PACK_RGB
%undef GLIDE_CULLING
endp
%ENDIF ; GLIDE_PACKED_RGB

File diff suppressed because it is too large Load Diff

View File

@@ -21,7 +21,10 @@
/* $Header$ */
/* $Revision$ */
/* $Log$ */
/* $Log$
/* Revision 1.1.1.1 1999/12/07 21:49:31 joseph
/* Initial checkin into SourceForge.
/* */
/* */
/* 2 10/30/97 6:53p Peter */
/* first real cut at tri asm */
@@ -38,13 +41,18 @@
.file "xdraw2.inc"
#ifdef GL_AMD3D
#ifndef GR_FIFO_WRITE_MACRO
#define GR_FIFO_WRITE_MACRO
.MACRO GR_FIFO_WRITE __addr __offset __data
mov \__data , \__offset(\__addr)
.ENDM /* GR_FIFO_WRITE */
#endif
#ifdef GL_AMD3D
#ifndef MM1_FIFO_MACROS
#define MM1_FIFO_MACROS
.MACRO WRITE_MM1_FIFO_ALIGNED
movq %mm1 , (%ebp) /* store current param | previous param */
.ENDM /* WRITE_MM1_FIFO_ALIGNED */
@@ -52,6 +60,7 @@
.MACRO WRITE_MM1LOW_FIFO
movd %mm1 , (%ebp) /* store current param | previous param */
.ENDM /* WRITE_MM1LOW_FIFO */
#endif
#define gc %edi /* points to graphics context */
#define fifo %ebp /* points to fifo entries */
@@ -1100,10 +1109,6 @@ LOCAL(Area_Computation):
#define packCol %edi
#define tempVal %edi
.MACRO GR_FIFO_WRITE __addr __offset __data
mov \__data , \__offset(\__addr)
.ENDM /* GR_FIFO_WRITE */
.align 4
LOCAL(__triBegin):
mov fifoPtr(gc) , fifo /* Fetch Fifo Ptr */

View File

@@ -0,0 +1,38 @@
/*
* THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
* PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
* TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
* INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
* DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
* THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
* FULL TEXT OF THE NON-WARRANTY PROVISIONS.
*
* USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
* RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
* TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
* AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
* SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
* THE UNITED STATES.
*
* COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
*/
/* Adapted from gdraw.c:grDrawTriangle() for gas */
#include "fxgasm.h"
.extern _GlideRoot
.text
.p2align 4,,15
.globl grDrawTriangle
.type grDrawTriangle,@function
grDrawTriangle:
/*movl (_GlideRoot+curGC),%edx
movl kTriProcOffset(%edx),%eax*/
movl (_GlideRoot + curGC),%eax
jmp *kTriProcOffset(%eax)
.p2align 4,,15

View File

@@ -0,0 +1,46 @@
;; THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
;; PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
;; TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
;; INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
;; DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
;; THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
;; EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
;; FULL TEXT OF THE NON-WARRANTY PROVISIONS.
;;
;; USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
;; RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
;; TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
;; AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
;; SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
;; THE UNITED STATES.
;;
;; COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
;; Adapted from gdraw.c:grDrawTriangle() for nasm
%include "xos.inc"
%include "fxgasm.h"
extrn _GlideRoot
segment SEG_TEXT
align 16
proc grDrawTriangle, 12
;;mov edx, dword [_GlideRoot+curGC]
;;mov eax, dword [edx+kTriProcOffset]
mov eax, dword [_GlideRoot+curGC]
jmp [eax + kTriProcOffset]
endp
align 16
%if XOS == XOS_WIN32
%ifdef __MINGW32__
; GNU LD fails with '_' prefix
export grDrawTriangle@12
%else
export _grDrawTriangle@12
%endif
%endif ; _WIN32

View File

@@ -0,0 +1,146 @@
;
; compulsory header for glide3/xdraw* assembly specializations (NASM)
;
; Revision 1.1.2.1 2006/12/03 04:47:28 guillemj
; Backported from glide3x.
;
; Revision 1.1.2.3 2004/10/04 08:57:52 dborca
; supporting DOS/OpenWatcom in Assembly files
;
;
; Revision 1.1.2.1 2003/06/07 09:53:25 dborca
; initial checkin for NASM sources
;
;---------------------------------------
; platform defines
;---------------------------------------
%define XOS_DJGPP 1
%define XOS_LINUX 2
%define XOS_WIN32 4
%define XOS_WATCD 8
%define STDCALL 0
%define ELFTYPE 0
;---------------------------------------
; pick up the right OS
;---------------------------------------
%ifdef __DJGPP__
%define XOS XOS_DJGPP
%elifdef __linux__
%define XOS XOS_LINUX
%define ELFTYPE 1
%elifdef __WIN32__
%define XOS XOS_WIN32
%define STDCALL 1
%elifdef __WATCOMD__
%define XOS XOS_WATCD
%define STDCALL 1
%else
%error Unknown OS
%endif
;---------------------------------------
; general purpose macros
;---------------------------------------
%macro extrn 1-2 0
%if STDCALL && (%2 > 0)
%define %1 %1@%2
%endif
extern %1
%endmacro
%macro globl 1-2 0
%if STDCALL && (%2 > 0)
%define %1 %1@%2
%endif
global %1
%endmacro
%macro proc 1-2 0
%push proc
%if STDCALL && (%2 > 0)
%define %$ret RET %2
%else
%define %$ret RET
%endif
%if ELFTYPE
globl %1:function, %2
%else
globl %1, %2
%endif
%1:
%endmacro
%macro endp 0
%ifnctx proc
%error Mismatched ENDP/PROC
%else
%pop
%endif
%endmacro
%macro ret 0
%ifnctx proc
RET
%else
%$ret
%endif
%endmacro
%macro invoke 1-*
%rep %0 - 1
%rotate -1
push %1
%endrep
%rotate -1
call %1
%if (STDCALL == 0) && (%0 > 1)
add esp, 4 * (%0 - 1)
%endif
%endmacro
;---------------------------------------
; Windows
;---------------------------------------
%if XOS == XOS_WIN32
%define SEG_TEXT .text align=32
%define SEG_DATA .data align=32
%define SEG_CONST .rdata align=32
%endif
;---------------------------------------
; DJGPP
;---------------------------------------
%if XOS == XOS_DJGPP
%define SEG_TEXT .text
%define SEG_DATA .data
%define SEG_CONST .rodata
%endif
;---------------------------------------
; Linux
;---------------------------------------
%if XOS == XOS_LINUX
%define SEG_TEXT .text align=32
%define SEG_DATA .data align=32
%define SEG_CONST .rodata align=32
%endif
;---------------------------------------
; WATCOM/DOS
;---------------------------------------
%if XOS == XOS_WATCD
%define SEG_TEXT _TEXT align=1 public use32 class=CODE FLAT
%define SEG_DATA _DATA align=4 public use32 class=DATA FLAT
%define SEG_CONST CONST2 align=4 public use32 class=DATA FLAT
%endif

View File

@@ -54,55 +54,46 @@
;; mmx stuff for 3DNow!(tm) capable processors
;;
TITLE xtexdl.asm
OPTION OLDSTRUCTS
.586P
.MMX
.K3D
%include "xos.inc"
ifdef USE_PACKET_FIFO
EXTRN __FifoMakeRoom: NEAR
endif
%ifdef USE_PACKET_FIFO
extrn _FifoMakeRoom
%endif
;;; Definitions of cvg regs and glide root structures.
INCLUDE fxgasm.h
%INCLUDE "fxgasm.h"
; Arguments (STKOFF = 16 from 4 dword pushes)
STACKOFFSET = 16
_gc$ = 4 + STACKOFFSET
_baseAddr$ = 8 + STACKOFFSET
_maxS$ = 12 + STACKOFFSET
_minT$ = 16 + STACKOFFSET
_maxT$ = 20 + STACKOFFSET
_texData$ = 24 + STACKOFFSET
STACKOFFSET equ 16
_gc$ equ 4 + STACKOFFSET
_baseAddr$ equ 8 + STACKOFFSET
_maxS$ equ 12 + STACKOFFSET
_minT$ equ 16 + STACKOFFSET
_maxT$ equ 20 + STACKOFFSET
_texData$ equ 24 + STACKOFFSET
;; NB: The first set of registers (eax, ecx, and edx) are volatile across
;; function calls. The remaining registers are supposedly non-volatile
;; so they only store things that are non-volatile across the call.
fifo TEXTEQU <ebp> ; fifo ptr in inner loop
gc TEXTEQU <esi> ; graphics context
dataPtr TEXTEQU <edi> ; pointer to exture data to be downloaded
curT TEXTEQU <ebx> ; counter for texture scan lines (t-coordinate)
curS TEXTEQU <ecx> ; texture s-coordinate
fRoom TEXTEQU <edx> ; room available in fifo (in bytes)
%define fifo ebp ; fifo ptr in inner loop
%define gc esi ; graphics context
%define dataPtr edi ; pointer to exture data to be downloaded
%define curT ebx ; counter for texture scan lines (t-coordinate)
%define curS ecx ; texture s-coordinate
%define fRoom edx ; room available in fifo (in bytes)
GR_FIFO_WRITE MACRO __addr, __offset, __data
mov [__addr + __offset], __data
ENDM ; GR_FIFO_WRITE
%MACRO GR_FIFO_WRITE 3
mov [%1 + _%2], %3
%ENDM ; GR_FIFO_WRITE
;--------------------------------------------------------------------------
_TEXT SEGMENT PAGE PUBLIC USE32 'CODE'
ASSUME DS: FLAT, SS: FLAT
segment SEG_TEXT
ALIGN 32
PUBLIC __grTexDownload_3DNow_MMX@24
__grTexDownload_3DNow_MMX@24 PROC NEAR
proc _grTexDownload_3DNow_MMX, 24
push ebx ; save caller's register variable
mov curT, [esp + _maxT$ - 12] ; curT = maxT
@@ -158,15 +149,15 @@ __grTexDownload_3DNow_MMX@24 PROC NEAR
cmp fRoom, 4 ; enough room for NULL packet in fifo?
jge __mmxAlignFifo ; yes, write NULL packet to align fifo
ifdef USE_PACKET_FIFO
push @Line ; Line # inside this function
%ifdef USE_PACKET_FIFO
push __LINE__ ; Line # inside this function
push 0 ; NULL file name
push 4 ; fifo space required (bytes)
call __FifoMakeRoom ; make fifo room
call _FifoMakeRoom ; make fifo room
add esp, 12 ; pop 3 DWORD parameters to FifoMakeRoom
endif
%endif
mov fifo, [gc + fifoPtr] ; fifoPtr modified by FifoMakeRoom, reload
mov fRoom, [gc + fifoRoom] ; fifoRoom modified by FifoMakeRoom, reload
@@ -177,7 +168,7 @@ endif
__mmxAlignFifo:
mov DWORD PTR [fifo], 0 ; write NULL packet
mov DWORD [fifo], 0 ; write NULL packet
sub fRoom, 4 ; fifoRoom -= 4
mov [gc + fifoRoom], fRoom ; store new fifoRoom
@@ -193,7 +184,7 @@ __mmxAlignFifo:
__loopT:
IFDEF GLIDE_DEBUG
%IFDEF GLIDE_DEBUG
;; Make sure that we have a QWORD aligned fifoPtr; force GP if not aligned
@@ -203,7 +194,7 @@ IFDEF GLIDE_DEBUG
xor eax, eax ; create 0
mov [eax], eax ; move to DS:[0] forces GP
__alignmentOK:
ENDIF ; GLIDE_DEBUG
%ENDIF ; GLIDE_DEBUG
;; Compute packet header words
;; hdr1: downloadSpace[31:30] numWords[21:3] packetType[2:0]
@@ -249,19 +240,19 @@ __loopS:
mov esp, esp ; filler
__startDownload:
lea eax, [curS+8] ; fifo space needed = scan line width + header size
cmp fRoom, eax ; fifo space available >= fifo space required ?
jge __loopT ; yup, write next scan line
ifdef USE_PACKET_FIFO
push @Line ; Line # inside this function
%ifdef USE_PACKET_FIFO
push __LINE__ ; Line # inside this function
push 0h ; NULL file name
push eax ; fifo space required
call __FifoMakeRoom ; make fifo room (if fifoPtr QWORD aligned before
call _FifoMakeRoom ; make fifo room (if fifoPtr QWORD aligned before
add esp, 12 ; pop 3 DWORD parameters to FifoMakeRoom
endif
%endif
mov fifo, [gc + fifoPtr] ; fifoPtr was modified by FifoMakeRoom, reload
mov fRoom, [gc + fifoRoom] ; fifoRoom was modified by FifoMakeRoom, reload
@@ -278,10 +269,7 @@ __dlDone:
pop esi ; restore caller's register variable
pop ebx ; restore caller's register variable
ret 24 ; pop 6 DWORD parameters and return
ret ; pop 6 DWORD parameters and return
__grTexDownload_3DNow_MMX@24 ENDP
endp
_TEXT ENDS
END

View File

@@ -65,6 +65,10 @@ static const char *sourceFormatString[] = {
"GR_LFB_SRC_FMT_ZA16 "
};
static void imageConvert( void *dst,
void *src,
GrLfbSrcFmt_t format,
FxU32 *bpp );
int main( int argc, char **argv)
{
@@ -91,11 +95,6 @@ int main( int argc, char **argv)
static FxU32 imageWidth;
static FxU32 imageHeight;
static void imageConvert( void *dst,
void *src,
GrLfbSrcFmt_t format,
FxU32 *bpp );
srcfname[0] = 0;
dstfname[0] = 0;

View File

@@ -57,6 +57,10 @@ static const char *sourceFormatString[] = {
"GR_LFB_SRC_FMT_ZA16 "
};
static void imageConvert( void *dst,
void *src,
GrLfbSrcFmt_t format,
FxU32 *bpp );
int main( int argc, char **argv) {
char match;
@@ -80,11 +84,6 @@ int main( int argc, char **argv) {
static FxU32 imageWidth;
static FxU32 imageHeight;
static void imageConvert( void *dst,
void *src,
GrLfbSrcFmt_t format,
FxU32 *bpp );
/* Process Command Line Arguments */
while( (rv = tlGetOpt( argc, argv, "bdnr", &match, &remArgs )) ) {
if ( rv == -1 ) {

View File

@@ -19,6 +19,9 @@
**
** $Header$
** $Log$
** Revision 1.2 2000/10/03 18:29:57 mercury
** 003-clean_up_h3-000, h3 tree cleanup.
**
** Revision 1.1.1.1 1999/12/07 21:49:43 joseph
** Initial checkin into SourceForge.
**
@@ -38,8 +41,8 @@
** I/O Macros
*/
#warning Here!
#define HWC_IO_LOAD(regInfo, reg, val)
GDBG_INFO(120, "%s: Storing 0x%x to IO Register %s\n",
#define HWC_IO_LOAD(regInfo, reg, val) \
GDBG_INFO(120, "%s: Storing 0x%x to IO Register %s\n", \
((SstIORegs *) regInfo.ioMemBase)->

View File

@@ -1,62 +1,74 @@
# Linux makefile for Glide2 and Texus2
#
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
# $Id$
#
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
# AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
# SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
# THE UNITED STATES.
# Copyright (c) 2003 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
#
# $Revision$
# $Date$
# Copyright (c) 2006 - Guillem Jover <guillem@hadrons.org>
#
export TOPDIR := $(shell pwd)
THISDIR = devel
SUBDIRS = swlibs
#
# Available options:
#
# Environment variables:
# FX_GLIDE_HW build for the given ASIC (sst1, sst96, cvg, h3).
# default = h3
# DRI=1 Build DRI version.
# target = h3
# default = no
# XPATH specify X libraries path; needed by DRI.
# target = h3
# default = /usr/X11R6/lib
# H4=1 High speed Avenger/Napalm.
# target = h3
# default = no
# OPTFLAGS pass given optimization flags to compiler
# target = sst1, sst96, cvg, h3
# default = -O2 -ffast-math
# DEBUG=1 enable debugging checks and messages
# target = sst1, sst96, cvg, h3
# default = no
# USE_X86=1 use assembler triangle specializations
# target = sst1, sst96, cvg, h3
# default = no
# USE_3DNOW=1 allow 3DNow! specializations. However, the true CPU
# capabilities are still checked at run-time to avoid
# crashes.
# target = cvg, h3
# default = no
# USE_MMX=1 (see USE_3DNOW)
# target = h3
# default = no
#
# Targets:
# all: build everything
# clean: remove object files
# realclean: remove all generated files
#
# We branched glide starting w/ Voodoo2(aka CVG) so
# make sure that the right thing happens. If this sort
# of branching happens again then add it to the list below.
ifeq ($(FX_GLIDE_HW),sst1)
SUBDIRS += sst1
.PHONY: all clean realclean
.EXPORT_ALL_VARIABLES:
export BUILD_NUMBER = 40404
export FX_GLIDE_HW ?= h3
ifeq ($(FX_GLIDE_HW),sst96)
G3_DIR = sst1/glide/src
else
ifeq ($(FX_GLIDE_HW),sst96)
SUBDIRS += sst1
else
ifeq ($(FX_GLIDE_HW),cvg)
SUBDIRS += cvg
else
ifeq ($(FX_GLIDE_HW),h3)
SUBDIRS += h3
else
FX_GLIDE_HW = h3
SUBDIRS += h3
endif
endif
endif
G3_DIR = $(FX_GLIDE_HW)/glide/src
endif
#
# Other variables we need to set
#
export FX_HW_PROJECTS=glide
ifeq ($(HAL_HW),)
export HAL_HW=1
endif
export FX_NO_GET_BOF=1
export FX_GLIDE_HW
export SCRIPTDIR=$(TOPDIR)/swlibs/include/make
all:
make -f makefile.linux -C $(G3_DIR)
include swlibs/include/make/3dfx.linux.mak
clean:
make -f makefile.linux -C $(G3_DIR) clean
realclean:
make -f makefile.linux -C $(G3_DIR) realclean

1
glide2x/mk.sh Normal file
View File

@@ -0,0 +1 @@
make -f makefile.linux FX_GLIDE_HW=cvg USE_X86=1

View File

@@ -1,48 +1,48 @@
/*
* THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
* PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
* TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
* INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
* DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
* THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
* FULL TEXT OF THE NON-WARRANTY PROVISIONS.
*
* USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
* RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
* TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
* AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
* SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
* THE UNITED STATES.
*
* COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
*/
#include <stdio.h>
#include <stdlib.h>
#include <3dfx.h>
#include <glide.h>
#include <sst1init.h>
/* This should be exported, but isn't yet */
#define SST1INIT_MAX_BOARDS 16
int main (int argc[], char* argv[])
{
FxU32* sst[SST1INIT_MAX_BOARDS];
int num_sst;
int i;
/* Map all the boards in the system */
num_sst = 0;
do {
sst[num_sst] = sst1InitMapBoard (num_sst);
} while (sst[num_sst++] != NULL);
/* Shut them all down */
for (i = 0; i < num_sst; i += 1)
sst1InitVgaPassCtrl(sst[i], 1);
return 0;
}
/*
* THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
* PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
* TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
* INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
* DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
* THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
* FULL TEXT OF THE NON-WARRANTY PROVISIONS.
*
* USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
* RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
* TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
* AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
* SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
* THE UNITED STATES.
*
* COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
*/
#include <stdio.h>
#include <stdlib.h>
#include <3dfx.h>
#include <glide.h>
#include <sst1init.h>
/* This should be exported, but isn't yet */
#define SST1INIT_MAX_BOARDS 16
int main (int argc[], char* argv[])
{
FxU32* sst[SST1INIT_MAX_BOARDS];
int num_sst;
int i;
/* Map all the boards in the system */
num_sst = 0;
do {
sst[num_sst] = sst1InitMapBoard (num_sst);
} while (sst[num_sst++] != NULL);
/* Shut them all down */
for (i = 0; i < num_sst; i += 1)
sst1InitVgaPassCtrl(sst[i], 1);
return 0;
}

View File

@@ -0,0 +1,349 @@
# Win32 makefile for Glide2/SST1 and Texus2
# This makefile MUST be processed by GNU make!!!
#
# Copyright (c) 2004
#
# Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
#
# Hiroshi Morii
# Email : koolsmoky@users.sourceforge.net
# Web : http://www.3dfxzone.it/koolsmoky
#
#
# Available options:
#
# Environment variables:
# FX_GLIDE_HW build for the given ASIC (sst1, sst96).
# default = sst1
# CPU optimize for the given processor.
# default = 6 (PentiumPro)
# DEBUG=1 disable optimizations and build for debug.
# default = no
# USE_X86=1 use assembler triangle specializations!
# default = no
# TEXUS2=1 embed Texus2 functions into Glide3.
# default = no
# FXOEM2X=1 build fxoem2x.dll
# default = no
#
# Targets:
# all: build everything
# glide2x: build Glide2x lib
# clean: remove object files
# realclean: remove all generated files
#
.PHONY: all glide2x clean realclean
.INTERMEDIATE: fxgasm.exe
.SUFFIXES: .c .obj .rc .res
###############################################################################
# general defines (user settable?)
###############################################################################
GLIDE_RES = glide.res
GLIDE_DLL = glide2x.dll
GLIDE_IMP = glide2x.lib
TEXUS_EXE = texus2.exe
FX_GLIDE_HW ?= sst1
FX_GLIDE_SW = ../../../swlibs
GLIDE_LIBDIR = ../../lib
TEXUS_EXEDIR = $(FX_GLIDE_SW)/bin
###############################################################################
# tools
###############################################################################
CC = cl
AS = nasm
LD = link
RC = rc
ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
UNLINK = del $(subst /,\,$(1))
else
UNLINK = $(RM) $(1)
endif
###############################################################################
# defines
###############################################################################
# platform
CDEFS = -D__WIN32__ -DDIRECTX -DFX_DLL_ENABLE -DINIT_ACCESS_DDRAW
# general
CDEFS += -DGLIDE_HARDWARE -DGLIDE_DEFAULT_GAMMA=1.3f -DGLIDE_LIB=1
# subsystem
ifeq ($(FX_GLIDE_HW),sst1)
CDEFS += -DSST1
else
ifeq ($(FX_GLIDE_HW),sst96)
CDEFS += -DSST96
CDEFS += -DSST96_FIFO
#CDEFS += -DSST96_ALT_FIFO_WRAP
#CDEFS += -DINIT96VGASWAP -DINIT_ACCESS_DIRECT
CDEFS += -DGLIDE_USE_ALT_REGMAP
endif
endif
# debug
ifdef DEBUG
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
endif
# other
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
ifeq ($(TEXUS2),1)
CDEFS += -DHAVE_TEXUS2
endif
###############################################################################
# flags
###############################################################################
# linker
LDFLAGS = -nologo -dll -opt:WIN98 -machine:IX86 -nodefaultlib
# assembler
ASFLAGS = -O6 -fwin32 -D__WIN32__ --prefix _
ASFLAGS += $(CDEFS)
# compiler
CFLAGS = -nologo -W3 -WX -D__MSC__=1
LDLIBS = user32.lib kernel32.lib
ifdef DEBUG
CFLAGS += -Od -MTd -Zi
LDFLAGS += -debugtype:both -debug
LDLIBS += LIBCMTD.lib
else
CPU ?= 6
CFLAGS += -DNDEBUG -G$(CPU) -O2 -MT
LDLIBS += LIBCMT.lib
endif
ifeq ($(FX_GLIDE_HW),sst96)
LDLIBS += gdi32.lib ddraw.lib dxguid.lib oldnames.lib
endif
CFLAGS += -I. -I../../incsrc -I../../init -I../../init/initvg -I../../init/init96
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
CFLAGS += -I$(FX_GLIDE_SW)/texus2/lib
CFLAGS += $(CDEFS)
ifneq ($(USE_X86),1)
CFLAGS += -DGLIDE_USE_C_TRISETUP
endif
###############################################################################
# objects
###############################################################################
GLIDE_OBJECTS = \
gsplash.obj \
g3df.obj \
gu.obj \
guclip.obj \
gpci.obj \
gump.obj \
diglide.obj \
disst.obj \
ditex.obj \
gbanner.obj \
gerror.obj \
gmovie.obj \
digutex.obj \
ddgump.obj \
gaa.obj \
gdraw.obj \
gglide.obj \
glfb.obj \
gsst.obj \
gtex.obj \
gtexdl.obj \
gutex.obj \
cpuid.obj
ifeq ($(USE_X86),1)
ifeq ($(FX_GLIDE_HW),sst1)
GLIDE_OBJECTS += \
xdraw.obj
else
GLIDE_OBJECTS += \
xdraw96.obj
endif
else
GLIDE_OBJECTS += \
gxdraw.obj
endif
ifeq ($(FX_GLIDE_HW),sst96)
GLIDE_OBJECTS += \
sst96.obj \
../../init/init96/init96.obj \
../../init/init96/dxdrvr.obj \
../../init/init96/initat3d.obj \
../../init/init96/initmcrx.obj
endif
GLIDE_OBJECTS += \
../../init/init.obj \
../../init/vgdrvr.obj \
../../init/vg96drvr.obj \
../../init/h3drvr.obj \
../../init/initvg/gamma.obj \
../../init/initvg/dac.obj \
../../init/initvg/video.obj \
../../init/initvg/parse.obj \
../../init/initvg/sli.obj \
../../init/initvg/util.obj \
../../init/initvg/info.obj \
../../init/initvg/print.obj \
../../init/initvg/gdebug.obj \
../../init/initvg/sst1init.obj \
$(FX_GLIDE_SW)/newpci/pcilib/sst1_pci.obj \
$(FX_GLIDE_SW)/newpci/pcilib/fxmsr.obj \
$(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 \
TEXUS_SOURCES = \
$(FX_GLIDE_SW)/texus2/lib/texuslib.c \
$(FX_GLIDE_SW)/texus2/lib/clamp.c \
$(FX_GLIDE_SW)/texus2/lib/read.c \
$(FX_GLIDE_SW)/texus2/lib/resample.c \
$(FX_GLIDE_SW)/texus2/lib/mipmap.c \
$(FX_GLIDE_SW)/texus2/lib/quantize.c \
$(FX_GLIDE_SW)/texus2/lib/ncc.c \
$(FX_GLIDE_SW)/texus2/lib/nccnnet.c \
$(FX_GLIDE_SW)/texus2/lib/pal256.c \
$(FX_GLIDE_SW)/texus2/lib/pal6666.c \
$(FX_GLIDE_SW)/texus2/lib/dequant.c \
$(FX_GLIDE_SW)/texus2/lib/view.c \
$(FX_GLIDE_SW)/texus2/lib/util.c \
$(FX_GLIDE_SW)/texus2/lib/diffuse.c \
$(FX_GLIDE_SW)/texus2/lib/write.c \
$(FX_GLIDE_SW)/texus2/lib/tga.c \
$(FX_GLIDE_SW)/texus2/lib/3df.c \
$(FX_GLIDE_SW)/texus2/lib/ppm.c \
$(FX_GLIDE_SW)/texus2/lib/rgt.c \
$(FX_GLIDE_SW)/texus2/lib/txs.c \
$(FX_GLIDE_SW)/texus2/lib/codec.c \
$(FX_GLIDE_SW)/texus2/lib/eigen.c \
$(FX_GLIDE_SW)/texus2/lib/bitcoder.c
ifeq ($(TEXUS2),1)
GLIDE_OBJECTS += $(TEXUS_SOURCES:.c=.obj)
endif
###############################################################################
# rules
###############################################################################
.c.obj:
$(CC) -Fo$@ $(CFLAGS) -c $<
.rc.res:
$(RC) -Fo$@ $(CDEFS) -I$(FX_GLIDE_SW)/fxmisc $<
###############################################################################
# main
###############################################################################
all: glide2x $(TEXUS_EXEDIR)/$(TEXUS_EXE)
glide2x: $(GLIDE_LIBDIR)/$(GLIDE_DLL)
$(GLIDE_LIBDIR)/$(GLIDE_DLL): $(GLIDE_OBJECTS) $(GLIDE_RES)
$(LD) -out:$@ $(LDFLAGS) $(GLIDE_OBJECTS) $(LDLIBS) $(GLIDE_RES)
$(TEXUS_EXEDIR)/$(TEXUS_EXE): $(FX_GLIDE_SW)/texus2/cmd/cmd.c $(GLIDE_LIBDIR)/$(GLIDE_IMP)
#ifeq ($(TEXUS2),1)
# $(CC) -o $@ $(CFLAGS) $^
#else
# $(warning Texus2 not enabled... Skipping $(TEXUS_EXE))
#endif
fxoem2x: $(GLIDE_LIBDIR)/fxoem2x.dll
ifeq ($(FXOEM2X),1)
$(GLIDE_LIBDIR)/fxoem2x.dll: ../oem/oeminit.obj ../oem/oeminit.res
# $(LD) -out:$@ $(LDFLAGS) ../oem/oeminit.obj $(LDLIBS) ../oem/oeminit.res
else
$(GLIDE_LIBDIR)/fxoem2x.dll:
# $(warning FxOem2x not enabled... Skipping fxoem2x.dll)
endif
###############################################################################
# rules(2)
###############################################################################
cpuid.obj: cpudtect.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw.obj: xdraw.asm
$(AS) -o $@ $(ASFLAGS) $<
xdraw96.obj: xdraw96.asm
$(AS) -o $@ $(ASFLAGS) $<
ifeq ($(FX_GLIDE_HW),sst96)
../../init/initvg/gamma.obj: ../../init/initvg/gamma.c
$(CC) -Fo$@ $(CFLAGS) -USST96 -c $<
../../init/initvg/dac.obj: ../../init/initvg/dac.c
$(CC) -Fo$@ $(CFLAGS) -USST96 -c $<
../../init/initvg/video.obj: ../../init/initvg/video.c
$(CC) -Fo$@ $(CFLAGS) -USST96 -c $<
../../init/initvg/parse.obj: ../../init/initvg/parse.c
$(CC) -Fo$@ $(CFLAGS) -USST96 -c $<
../../init/initvg/sli.obj: ../../init/initvg/sli.c
$(CC) -Fo$@ $(CFLAGS) -USST96 -c $<
../../init/initvg/util.obj: ../../init/initvg/util.c
$(CC) -Fo$@ $(CFLAGS) -USST96 -c $<
../../init/initvg/info.obj: ../../init/initvg/info.c
$(CC) -Fo$@ $(CFLAGS) -USST96 -c $<
../../init/initvg/print.obj: ../../init/initvg/print.c
$(CC) -Fo$@ $(CFLAGS) -USST96 -c $<
../../init/initvg/gdebug.obj: ../../init/initvg/gdebug.c
$(CC) -Fo$@ $(CFLAGS) -USST96 -c $<
../../init/initvg/sst1init.obj: ../../init/initvg/sst1init.c
$(CC) -Fo$@ $(CFLAGS) -USST96 -c $<
endif
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
fxinline.h: fxgasm.exe
./$< -inline > $@
fxgasm.h: fxgasm.exe
./$< -hex > $@
fxgasm.exe: fxgasm.c
$(CC) -o $@ $(CFLAGS) $<
###############################################################################
# clean, realclean
###############################################################################
clean:
-$(call UNLINK,*.obj)
-$(call UNLINK,../../init/*.obj)
-$(call UNLINK,../../init/initvg/*.obj)
-$(call UNLINK,../../init/init96/*.obj)
-$(call UNLINK,$(FX_GLIDE_SW)/newpci/pcilib/*.obj)
-$(call UNLINK,fxinline.h)
-$(call UNLINK,fxgasm.h)
-$(call UNLINK,$(FX_GLIDE_SW)/texus2/lib/*.obj)
-$(call UNLINK,$(GLIDE_RES))
realclean: clean
-$(call UNLINK,$(GLIDE_LIBDIR)/glide2x.exp)
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_DLL))
-$(call UNLINK,$(GLIDE_LIBDIR)/$(GLIDE_IMP))
-$(call UNLINK,$(TEXUS_EXEDIR)/$(TEXUS_EXE))

View File

@@ -20,6 +20,7 @@
#include <sys/utsname.h>
#include <stdio.h>
#include <string.h>
int _cpu_detect_asm() {
struct utsname name;

Some files were not shown because too many files have changed in this diff Show More