Compare commits
507 Commits
master
...
glide-deve
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
944b60eac8 | ||
|
|
9ab3c4634c | ||
|
|
d37f7b7a70 | ||
|
|
348d63fc2b | ||
|
|
cfdb4dcafe | ||
|
|
51b434999b | ||
|
|
d0db8256e4 | ||
|
|
f4f0afe53d | ||
|
|
b10938edc0 | ||
|
|
0a7f20cf1f | ||
|
|
154718fe78 | ||
|
|
858e6f7e15 | ||
|
|
ec48aba80f | ||
|
|
2832abfc79 | ||
|
|
2952168561 | ||
|
|
09fae37520 | ||
|
|
408a154309 | ||
|
|
f0f02c3383 | ||
|
|
02f96edc18 | ||
|
|
39adf6422d | ||
|
|
e46c92242b | ||
|
|
9490b841d7 | ||
|
|
e8d880e66f | ||
|
|
d6004952bd | ||
|
|
6385e41d0e | ||
|
|
95831f0553 | ||
|
|
c1791171c5 | ||
|
|
234f54da93 | ||
|
|
cb5c93a417 | ||
|
|
4f5beb723c | ||
|
|
6a4a030bb3 | ||
|
|
2bc2ada7fa | ||
|
|
18c63bcf35 | ||
|
|
ee0637513a | ||
|
|
0e30810868 | ||
|
|
7f952e5fd9 | ||
|
|
59f561890c | ||
|
|
eac64a908e | ||
|
|
04ef64970f | ||
|
|
8749e39edc | ||
|
|
9a6eac9c31 | ||
|
|
075b942975 | ||
|
|
034de08665 | ||
|
|
8756ab93d2 | ||
|
|
0d1c03ec4f | ||
|
|
4d5cadd8c8 | ||
|
|
e2a6f44d01 | ||
|
|
4fece0a55b | ||
|
|
c00327dd0a | ||
|
|
682ffd4d33 | ||
|
|
06e25214f1 | ||
|
|
9072e6d7f9 | ||
|
|
47aabade08 | ||
|
|
7bbce2ccdb | ||
|
|
57a15b8aab | ||
|
|
1f3ee6bb30 | ||
|
|
6fccc2cbdb | ||
|
|
d919a05407 | ||
|
|
b06c63abed | ||
|
|
8f254569e5 | ||
|
|
42a995335e | ||
|
|
e0fdb356a3 | ||
|
|
e4d0ae4ff1 | ||
|
|
22a95077f9 | ||
|
|
8c2fdd661a | ||
|
|
3a78ad5818 | ||
|
|
b92f14b42c | ||
|
|
3afa27274d | ||
|
|
97b9d60875 | ||
|
|
054807b1dd | ||
|
|
526262f4a6 | ||
|
|
0ee0b2add4 | ||
|
|
871c2bcf65 | ||
|
|
37d9fc555e | ||
|
|
4372942b61 | ||
|
|
acbd24bb88 | ||
|
|
a1e9017af6 | ||
|
|
1ffbd85481 | ||
|
|
9c38a603a0 | ||
|
|
b11bb573b0 | ||
|
|
019a1ff4dc | ||
|
|
fd08c9c716 | ||
|
|
1d47a8de8e | ||
|
|
6cc1fe6e7e | ||
|
|
959334ad71 | ||
|
|
910bd84cf8 | ||
|
|
00a387e94f | ||
|
|
dfd3327037 | ||
|
|
0070c1729d | ||
|
|
84cd0d554f | ||
|
|
5a517c8e2f | ||
|
|
f82d3a3a0a | ||
|
|
87f391fec1 | ||
|
|
1738b62d40 | ||
|
|
ebbc49b41b | ||
|
|
91fdbf4feb | ||
|
|
1561d5a656 | ||
|
|
d2e6e8062f | ||
|
|
c67e1e2526 | ||
|
|
fd64b6ac96 | ||
|
|
fef69dbf9a | ||
|
|
93f42cc6f8 | ||
|
|
a30877fb0f | ||
|
|
4338d7a4e9 | ||
|
|
12dbdd977a | ||
|
|
0c312424e3 | ||
|
|
23a241e1c7 | ||
|
|
87a74e1a2b | ||
|
|
759cde16ea | ||
|
|
a072e43eb1 | ||
|
|
fb1109315a | ||
|
|
6f3645a1cf | ||
|
|
8106609282 | ||
|
|
4b63afa845 | ||
|
|
dca89ecb08 | ||
|
|
5eff1f0e44 | ||
|
|
a96ecc4d15 | ||
|
|
1d189c8b84 | ||
|
|
2f942cc686 | ||
|
|
a905834f07 | ||
|
|
e2d97af291 | ||
|
|
292e2fba9c | ||
|
|
4c00987aa2 | ||
|
|
47daaa8aad | ||
|
|
4a8fdd2725 | ||
|
|
c5dff3e9da | ||
|
|
bc2d475372 | ||
|
|
9fcb0ace2a | ||
|
|
1a365fe143 | ||
|
|
7768c6150f | ||
|
|
c9e2c802f9 | ||
|
|
7e265ee0e5 | ||
|
|
8bc22af8d8 | ||
|
|
fe7ea78d17 | ||
|
|
72f246a7c9 | ||
|
|
a5eca811b3 | ||
|
|
92f8d35750 | ||
|
|
74da7049a3 | ||
|
|
881c63f226 | ||
|
|
0c01d45d7a | ||
|
|
d795e8907d | ||
|
|
eff4c4ebc5 | ||
|
|
aa932364fe | ||
|
|
2007f26c53 | ||
|
|
7df16681b6 | ||
|
|
c0ff0141d6 | ||
|
|
6d736fd608 | ||
|
|
8040c684ef | ||
|
|
f0cb59432c | ||
|
|
e8812e71bf | ||
|
|
cfbaebc615 | ||
|
|
d9fa6f7198 | ||
|
|
5414eddde4 | ||
|
|
79b31d35a4 | ||
|
|
489324c55a | ||
|
|
a04cbf9994 | ||
|
|
5958659f70 | ||
|
|
0074568397 | ||
|
|
3309cb7dd1 | ||
|
|
bcdf3a20e4 | ||
|
|
56cd565a3e | ||
|
|
8cb69ddacd | ||
|
|
ec0fb6b1f0 | ||
|
|
1b65b3fe37 | ||
|
|
65c280be54 | ||
|
|
c59d79b104 | ||
|
|
5f51d98eb1 | ||
|
|
6d9fbdee4a | ||
|
|
f952be1383 | ||
|
|
5e0365a93a | ||
|
|
471935edbb | ||
|
|
3568e6bebb | ||
|
|
6406255463 | ||
|
|
b523ad8b58 | ||
|
|
9477334927 | ||
|
|
b3b3bf4853 | ||
|
|
3dff6714b3 | ||
|
|
d3b76d2e16 | ||
|
|
899068c963 | ||
|
|
9d14fa297e | ||
|
|
1af5c552fe | ||
|
|
e36b40e673 | ||
|
|
752b1f6e3d | ||
|
|
97fbce5c9c | ||
|
|
c5cc9ba363 | ||
|
|
1ed952f4b6 | ||
|
|
ef890f8425 | ||
|
|
c6986acec1 | ||
|
|
d431b91202 | ||
|
|
34936e9bc3 | ||
|
|
b2b8265a5d | ||
|
|
e64083bdfe | ||
|
|
c9e2822c70 | ||
|
|
e424d6ab07 | ||
|
|
f05af3ceec | ||
|
|
2244ac2d97 | ||
|
|
a575ff59d4 | ||
|
|
10093a8902 | ||
|
|
cb935e9a6f | ||
|
|
1b53dbd236 | ||
|
|
e870206226 | ||
|
|
c1b24a67e7 | ||
|
|
e6cf09e358 | ||
|
|
f3753d29fe | ||
|
|
c4ca1c5f84 | ||
|
|
d75a3e2029 | ||
|
|
5c5664acc5 | ||
|
|
25a4af8b52 | ||
|
|
4998a36679 | ||
|
|
7f45a997ab | ||
|
|
8b98c55564 | ||
|
|
32f0f47956 | ||
|
|
0e1f6972b0 | ||
|
|
727ec864fb | ||
|
|
9e1fbb7dd9 | ||
|
|
e41a4dddeb | ||
|
|
e805228038 | ||
|
|
7a84ec28e0 | ||
|
|
da70978cfd | ||
|
|
8932dd3ffe | ||
|
|
6045061d5b | ||
|
|
12ba1ce38b | ||
|
|
8bb1bb352d | ||
|
|
b3e4a22e6d | ||
|
|
0406bce42f | ||
|
|
d0657978d8 | ||
|
|
b410bb7e20 | ||
|
|
7f19a09dc5 | ||
|
|
0633a3231f | ||
|
|
f4ddf221d6 | ||
|
|
4dd1af0e85 | ||
|
|
a5115738b3 | ||
|
|
46295978d5 | ||
|
|
57e51764f8 | ||
|
|
73db6676a4 | ||
|
|
8341485146 | ||
|
|
5d59cd4e2f | ||
|
|
22d4f642cb | ||
|
|
3707221248 | ||
|
|
024bd0832f | ||
|
|
d5cdfe9374 | ||
|
|
b292afdb71 | ||
|
|
9c02fa48e5 | ||
|
|
329ac0931f | ||
|
|
833ae187e5 | ||
|
|
2d1b632d7b | ||
|
|
ec7faefa52 | ||
|
|
0b4dbea566 | ||
|
|
ada722548b | ||
|
|
4bb204b929 | ||
|
|
a803ae4ed1 | ||
|
|
f9001acfe6 | ||
|
|
54c4601dd0 | ||
|
|
fa967172f3 | ||
|
|
e79dd613ee | ||
|
|
2506470f93 | ||
|
|
5484926668 | ||
|
|
e1a07c1ff2 | ||
|
|
90cb835f39 | ||
|
|
05750ad397 | ||
|
|
1a752ef706 | ||
|
|
e049e53976 | ||
|
|
b7ca0e0fa7 | ||
|
|
c89df99c6e | ||
|
|
d34710e10d | ||
|
|
b58bfd998c | ||
|
|
d67cd249c0 | ||
|
|
914d1d9149 | ||
|
|
ce994a7077 | ||
|
|
9c378ee7c6 | ||
|
|
24b6f748c5 | ||
|
|
ac5cdd19bf | ||
|
|
bab2f1ce05 | ||
|
|
2ce94fd316 | ||
|
|
a24bf3695d | ||
|
|
d46a668566 | ||
|
|
4d853558e1 | ||
|
|
9ab5549e22 | ||
|
|
f305b6c853 | ||
|
|
915ba05f03 | ||
|
|
867d9be05d | ||
|
|
df77cf56d7 | ||
|
|
8753ab9f02 | ||
|
|
0423c58099 | ||
|
|
1bb2e0b0d2 | ||
|
|
68cf1e1da6 | ||
|
|
ad0696197c | ||
|
|
ff03d4b88f | ||
|
|
9ba0dc01b9 | ||
|
|
0b554c2612 | ||
|
|
91e7543a18 | ||
|
|
74574721b7 | ||
|
|
7338f90ad4 | ||
|
|
250ed3ef5b | ||
|
|
6f3748e9c4 | ||
|
|
8a883aaec9 | ||
|
|
099a207814 | ||
|
|
18720fa683 | ||
|
|
0cbd7ad567 | ||
|
|
2de9805027 | ||
|
|
b965f50702 | ||
|
|
6ee0f85391 | ||
|
|
230c88f374 | ||
|
|
88b0b8a650 | ||
|
|
13d6a0f4e5 | ||
|
|
6ce0e9ab42 | ||
|
|
397102116f | ||
|
|
36aa323d87 | ||
|
|
08220f02bd | ||
|
|
a9362d59c3 | ||
|
|
ca68a1e33e | ||
|
|
55aa3d89dd | ||
|
|
2dbc6d696e | ||
|
|
26c4247cdd | ||
|
|
0c15f5c91a | ||
|
|
ab1fe87f14 | ||
|
|
873a724200 | ||
|
|
3b11585bb0 | ||
|
|
87e90b9541 | ||
|
|
d0a9cb47d6 | ||
|
|
0b9e4e1c84 | ||
|
|
b57e2c294b | ||
|
|
6ffeebc162 | ||
|
|
21a713dc68 | ||
|
|
da0be8d904 | ||
|
|
1452e51cdd | ||
|
|
9110ab17f1 | ||
|
|
a5e24cc268 | ||
|
|
beb671ed0e | ||
|
|
e869300446 | ||
|
|
698db33051 | ||
|
|
a20451f387 | ||
|
|
bc8321de06 | ||
|
|
0c477a7afb | ||
|
|
6b5e8acf71 | ||
|
|
517dfb03be | ||
|
|
148fd0ada3 | ||
|
|
faf822daf3 | ||
|
|
69f957db74 | ||
|
|
e08300cb43 | ||
|
|
e229833d24 | ||
|
|
42132e3665 | ||
|
|
15848b504f | ||
|
|
4c956aa0a6 | ||
|
|
2ff376b852 | ||
|
|
b19d6d3bf5 | ||
|
|
ff0a4a4905 | ||
|
|
9d5ef92b50 | ||
|
|
ee8430cb2c | ||
|
|
2ffb39127f | ||
|
|
b0551a7c4b | ||
|
|
b80cf1c1de | ||
|
|
deae98043b | ||
|
|
3d453046cc | ||
|
|
c54d6a2ee4 | ||
|
|
7558076800 | ||
|
|
28535c886e | ||
|
|
e778c12ca2 | ||
|
|
0754713319 | ||
|
|
f44571f658 | ||
|
|
ff9b98e56f | ||
|
|
c9a74b1b17 | ||
|
|
29570c57c4 | ||
|
|
05fdf9461a | ||
|
|
d8d62a1e70 | ||
|
|
63c3c6a873 | ||
|
|
4bcd5665b0 | ||
|
|
ffd7598574 | ||
|
|
9a910ee5f8 | ||
|
|
6ad857c9e0 | ||
|
|
095bb6777a | ||
|
|
89ff5c6968 | ||
|
|
5f1285c441 | ||
|
|
cedb308d38 | ||
|
|
a65846e4d6 | ||
|
|
6b3b2afb74 | ||
|
|
7c059e2029 | ||
|
|
01013ad51e | ||
|
|
cfeb5c8a20 | ||
|
|
b5896cf6e6 | ||
|
|
9eb8ae93c6 | ||
|
|
b6b71a4d68 | ||
|
|
7aa4e220de | ||
|
|
03e59b7e59 | ||
|
|
eb9ca4dbed | ||
|
|
5d26edba88 | ||
|
|
6dab1639d5 | ||
|
|
4e71aa3eed | ||
|
|
00c107305c | ||
|
|
6932027116 | ||
|
|
c5bcf24387 | ||
|
|
e536bd8f3a | ||
|
|
359a05b2d5 | ||
|
|
0657059cff | ||
|
|
fdb64e3424 | ||
|
|
758d3324e5 | ||
|
|
cfbd5e7bde | ||
|
|
07ce126519 | ||
|
|
3e5ddeacce | ||
|
|
2687c043af | ||
|
|
c0979a598b | ||
|
|
8283931df7 | ||
|
|
796f119669 | ||
|
|
07ccf2d302 | ||
|
|
890926228a | ||
|
|
69259445a7 | ||
|
|
92dfa218b4 | ||
|
|
787776dc0e | ||
|
|
0c31bd094c | ||
|
|
53a8d8b1b0 | ||
|
|
533a477142 | ||
|
|
d83e85c6a4 | ||
|
|
babd8326bd | ||
|
|
285b967be2 | ||
|
|
535ade3552 | ||
|
|
4a53bfb160 | ||
|
|
6f367986f4 | ||
|
|
8f048f464d | ||
|
|
63c16626f8 | ||
|
|
59ee0209d0 | ||
|
|
d570839952 | ||
|
|
d183c81f39 | ||
|
|
2eacd87ff3 | ||
|
|
796540cd5b | ||
|
|
8f32bcb3b3 | ||
|
|
c11ed99fa3 | ||
|
|
e42f28137a | ||
|
|
8b76cc1944 | ||
|
|
8eec69e649 | ||
|
|
61494a9258 | ||
|
|
c3c5f2e0f0 | ||
|
|
bd04c38ade | ||
|
|
0c87f5dad8 | ||
|
|
5d727e3651 | ||
|
|
dc6c1c036c | ||
|
|
99355828b0 | ||
|
|
1df56889ab | ||
|
|
72a46fc1ad | ||
|
|
d0251d38ed | ||
|
|
30d2c54cba | ||
|
|
4b715ac8be | ||
|
|
ed1f80f916 | ||
|
|
83c37ba65b | ||
|
|
d158b58a28 | ||
|
|
4591450d8e | ||
|
|
9d17415f93 | ||
|
|
1c65fd4046 | ||
|
|
20e154479a | ||
|
|
c2d3c2695a | ||
|
|
1655f07627 | ||
|
|
3f9a537344 | ||
|
|
4d57a8ac56 | ||
|
|
d136e83778 | ||
|
|
a577528108 | ||
|
|
aaa1fe6d5d | ||
|
|
23c393d4b2 | ||
|
|
59d1ea8cc1 | ||
|
|
c9c41ef84b | ||
|
|
578c360bf4 | ||
|
|
004928ff15 | ||
|
|
4ac226f1b5 | ||
|
|
787ac42bf2 | ||
|
|
da40699dd9 | ||
|
|
ec0e9dc38b | ||
|
|
4768c1f721 | ||
|
|
061cb96484 | ||
|
|
979effcff2 | ||
|
|
c0820d2e93 | ||
|
|
03622b4b3e | ||
|
|
5dd058b7ae | ||
|
|
f726c002ec | ||
|
|
1dc8c723d6 | ||
|
|
a03b54c2e9 | ||
|
|
eaf0155978 | ||
|
|
c80b119803 | ||
|
|
79248afda5 | ||
|
|
913a569838 | ||
|
|
0ddbb273b6 | ||
|
|
e115acc717 | ||
|
|
2880476dbf | ||
|
|
12741a635b | ||
|
|
9221bcb46a | ||
|
|
0b5e52ab40 | ||
|
|
8a2c5318c0 | ||
|
|
75931c9a1d | ||
|
|
8dc98e970a | ||
|
|
83d9fcba9b | ||
|
|
5be1e23a0c | ||
|
|
e791da7f5d | ||
|
|
28b6186e43 | ||
|
|
fac64e3dc4 | ||
|
|
b1363fbf0f | ||
|
|
12753febc7 | ||
|
|
f99e23b323 | ||
|
|
608d808cfc | ||
|
|
16a5b539db | ||
|
|
463f37d20e | ||
|
|
64216c4eaf | ||
|
|
60452f0d6f | ||
|
|
970f823ed6 | ||
|
|
9a64ace60c | ||
|
|
ba980646b9 | ||
|
|
3e642e03c4 | ||
|
|
11cf13c445 | ||
|
|
3b8ff42693 | ||
|
|
0b8571b620 | ||
|
|
f65153dfe9 |
File diff suppressed because it is too large
Load Diff
300
Device3Dfx/ChangeLog
Normal file
300
Device3Dfx/ChangeLog
Normal 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().
|
||||||
|
|
||||||
@@ -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
|
Name: Device3Dfx
|
||||||
Version: 2.3
|
Version: 2.3
|
||||||
Release: 5
|
Release: 5
|
||||||
@@ -121,9 +121,9 @@ Group: Drivers
|
|||||||
|
|
||||||
%description
|
%description
|
||||||
This package installs the 3Dfx device driver to allow access to 3Dfx
|
This package installs the 3Dfx device driver to allow access to 3Dfx
|
||||||
boards without the user having root privledges. It should work on both
|
boards without the user having root privledges. It should work on >= 2.x
|
||||||
2.0 and 2.1/2.2 kernels and set the MTRR settings correctly. It should
|
kernels and set the MTRR settings correctly. It should also work with
|
||||||
also work with SMP kernels (2.1/2.2).
|
SMP kernels (>= 2.1).
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -c
|
%setup -c
|
||||||
|
|||||||
@@ -1,110 +1,155 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
# Makefile by Carlo Wood (and others)
|
# Makefile by Carlo Wood (and others)
|
||||||
|
|
||||||
ifeq ($(OPT_CFLAGS),)
|
|
||||||
|
|
||||||
# Determine the machine type
|
# 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/)
|
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
|
# Setup machine dependant compiler flags
|
||||||
ifeq ($(ARCH), i386)
|
ifeq ($(ARCH), i386)
|
||||||
OPT_CFLAGS = -O2 -m486 -fomit-frame-pointer \
|
CFLAGS ?= -O2 -march=pentium -fomit-frame-pointer -fno-strength-reduce \
|
||||||
-fno-strength-reduce \
|
-falign-loops=2 -falign-jumps=2 -falign-functions=2
|
||||||
-malign-loops=2 -malign-jumps=2 -malign-functions=2
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ARCH), alpha)
|
ifeq ($(ARCH), alpha)
|
||||||
OPT_CFLAGS = -O2 -mno-fp-regs -mcpu=ev4 \
|
CFLAGS ?= -O2 -mno-fp-regs -mcpu=ev4 -ffixed-8 -Wa,-mev6 \
|
||||||
-ffixed-8 \
|
-fomit-frame-pointer -fno-strict-aliasing
|
||||||
-Wa,-mev6 \
|
|
||||||
-fomit-frame-pointer -fno-strict-aliasing
|
|
||||||
endif
|
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.
|
# 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 checks
|
||||||
sanity:
|
sanity:
|
||||||
@( \
|
@( \
|
||||||
if [ ! -e /usr/src/linux ]; then \
|
if [ ! -r $(KHEADERS)/linux ]; then \
|
||||||
echo "Expect kernel source at location /usr/src/linux"; \
|
echo "Expect readable headers in $(KHEADERS)/linux"; \
|
||||||
echo "Sym.link /usr/src/linux -> where you have your sources"; \
|
exit 1; \
|
||||||
exit -1; \
|
|
||||||
fi; \
|
fi; \
|
||||||
if [ ! -r /usr/src/linux/include ]; then \
|
if [ ! -r $(KHEADERS)/linux/version.h ]; then \
|
||||||
echo "Expect readable headers in /usr/src/linux/include"; \
|
echo "Missing $(KHEADERS)/linux/version.h"; \
|
||||||
exit -1; \
|
|
||||||
fi; \
|
|
||||||
if [ ! -r /usr/src/linux/include/linux/version.h ]; then \
|
|
||||||
echo "Missing /usr/src/linux/include/linux/version.h"; \
|
|
||||||
echo "Configure and install the kernel first"; \
|
echo "Configure and install the kernel first"; \
|
||||||
exit -1; \
|
exit 1; \
|
||||||
fi; \
|
fi; \
|
||||||
if [ ! -e /proc/cpuinfo ]; then \
|
if [ ! -e /proc/cpuinfo ]; then \
|
||||||
echo "You need the /proc file system"; \
|
echo "You need the /proc file system"; \
|
||||||
echo "Reconfigure kernel and say Yes to CONFIG_PROC_FS"; \
|
echo "Reconfigure kernel and say Yes to CONFIG_PROC_FS"; \
|
||||||
exit -1; \
|
exit 1; \
|
||||||
fi; \
|
fi; \
|
||||||
)
|
)
|
||||||
|
|
||||||
kinfo: kinfo.c
|
KVER_MAJOR = $(shell echo "$(KVERS)" | cut -d. -f1 )
|
||||||
$(CC) -o kinfo kinfo.c
|
KVER_MINOR = $(shell echo "$(KVERS)" | cut -d. -f2 )
|
||||||
|
|
||||||
kinfo.h: kinfo
|
KBUILD = $(shell [ "$(KVER_MAJOR)" = 2 ] && [ "$(KVER_MINOR)" -ge 6 ] || \
|
||||||
./kinfo
|
[ "$(KVER_MAJOR)" -ge 3 ] && echo yes )
|
||||||
|
|
||||||
###############################################################################
|
help:
|
||||||
# kernel 2.1+
|
@echo KVER_MAJOR = $(KVER_MAJOR)
|
||||||
|
@echo KVER_MINOR = $(KVER_MINOR)
|
||||||
|
@echo KBUILD = $(KBUILD)
|
||||||
|
|
||||||
3dfx.o: kinfo.h 3dfx_driver.c Makefile
|
ifeq ($(KBUILD),yes)
|
||||||
$(CC) $(CFLAGS) -c -o $@ 3dfx_driver.c
|
BUILD_TYPE = kbuild
|
||||||
|
MODULE_TDFX = kbuild/$(NAME).ko
|
||||||
|
else
|
||||||
|
BUILD_TYPE = legacy
|
||||||
|
MODULE_TDFX = $(NAME).o
|
||||||
|
endif
|
||||||
|
|
||||||
|
clean_type = clean_$(BUILD_TYPE)
|
||||||
|
module_type = module_$(BUILD_TYPE)
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
install:
|
modules: sanity $(module_type)
|
||||||
mkdir -p /lib/modules/$(shell ./kinfo --UTS)/misc
|
|
||||||
cp 3dfx.o /lib/modules/$(shell ./kinfo --UTS)/misc/3dfx.o
|
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 \
|
if [ -e $(MODULES_DIR)/modules.dep ]; then \
|
||||||
indep=`grep 'misc/3dfx.o:' /lib/modules/$(shell ./kinfo --UTS)/modules.dep`; \
|
indep=`grep '$(NAME)/$(MODULE_TDFX):' $(MODULES_DIR)/modules.dep`; \
|
||||||
if [ -z "$$indep" ]; then \
|
if [ -z "$$indep" ]; then \
|
||||||
echo "/lib/modules/$(shell ./kinfo --UTS)/misc/3dfx.o:" >> /lib/modules/$(shell ./kinfo --UTS)/modules.dep; \
|
echo "$(MODULES_DIR)/$(NAME)/$(MODULE_TDFX):" >> $(MODULES_DIR)/modules.dep; \
|
||||||
echo "" >> /lib/modules/$(shell ./kinfo --UTS)/modules.dep; \
|
echo "" >> $(MODULES_DIR)/modules.dep; \
|
||||||
fi; \
|
fi; \
|
||||||
fi; \
|
fi; \
|
||||||
if [ ! -c /dev/3dfx ]; then \
|
if [ ! -e $(DESTDIR)/dev/.devfsd -a ! -c $(DESTDIR)/dev/$(NAME) ]; then \
|
||||||
mknod /dev/3dfx c 107 0; \
|
mknod $(DESTDIR)/dev/$(NAME) c 107 0; \
|
||||||
chmod go+w /dev/3dfx; \
|
chmod go+w $(DESTDIR)/dev/$(NAME); \
|
||||||
fi; \
|
fi; \
|
||||||
if [ "$(RPM_INSTALL)" = "1" ]; then \
|
if [ "$(RPM_INSTALL)" = "1" ]; then \
|
||||||
echo "/lib/modules/$(shell ./kinfo --UTS)/misc/3dfx.o"; \
|
echo "$(MODULES_DIR)/$(NAME)/$(MODULE_TDFX)"; \
|
||||||
else \
|
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 \
|
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; \
|
||||||
fi; \
|
fi; \
|
||||||
)
|
)
|
||||||
|
|
||||||
|
install_modules: modules
|
||||||
|
mkdir -p $(MODULES_DIR)/$(NAME)
|
||||||
|
cp $(MODULE_TDFX) $(MODULES_DIR)/$(NAME)/
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# This is for debugging purposes by the developers:
|
# This is for debugging purposes by the developers:
|
||||||
|
|
||||||
clean:
|
clean: $(clean_type)
|
||||||
rm -f *.o *.s kinfo kinfo.h
|
rm -f kver.mak kver
|
||||||
|
|
||||||
3dfx.s: 3dfx_driver.c Makefile
|
clean_legacy:
|
||||||
$(CC) $(CFLAGS) -S -c 3dfx_driver.c
|
rm -f *.ko *.o *.mod.* .*.mod.* .*.cmd
|
||||||
|
|
||||||
|
clean_kbuild:
|
||||||
|
$(MAKE) -C kbuild clean
|
||||||
|
|
||||||
tar:
|
tar:
|
||||||
tar czf ../../SOURCES/Dev3Dfx-2.5.tar.gz 3dfx_driver.c Makefile
|
tar czf ../../SOURCES/Dev3Dfx-2.5.tar.gz 3dfx_driver.c Makefile
|
||||||
|
|
||||||
|
|
||||||
debug:
|
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
20
Device3Dfx/README
Normal 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.
|
||||||
|
|
||||||
16
Device3Dfx/kbuild/Makefile
Normal file
16
Device3Dfx/kbuild/Makefile
Normal 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
|
||||||
|
|
||||||
@@ -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
8
Device3Dfx/kver.c
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
printf("KVERS = %s\n", UTS_RELEASE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
#
|
#
|
||||||
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||||
|
|
||||||
!if "$(FX_GLIDE_HW)" == "SST96"
|
!if "$(FX_GLIDE_HW)" == "sst96"
|
||||||
GLIDE_SRC_BASE = sst1
|
GLIDE_SRC_BASE = sst1
|
||||||
!else
|
!else
|
||||||
GLIDE_SRC_BASE = $(FX_GLIDE_HW)
|
GLIDE_SRC_BASE = $(FX_GLIDE_HW)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
#
|
#
|
||||||
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
# COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
|
||||||
|
|
||||||
ifeq ($(FX_GLIDE_HW),SST96)
|
ifeq ($(FX_GLIDE_HW),sst96)
|
||||||
GLIDE_SRC_BASE = sst1
|
GLIDE_SRC_BASE = sst1
|
||||||
else
|
else
|
||||||
GLIDE_SRC_BASE = $(FX_GLIDE_HW)
|
GLIDE_SRC_BASE = $(FX_GLIDE_HW)
|
||||||
|
|||||||
@@ -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 fxoemRestoreVideo(OemInitInfo *oem);
|
||||||
FX_EXPORT FxU32 FX_CSTYLE fxoemControl(FxU32 mode);
|
FX_EXPORT FxU32 FX_CSTYLE fxoemControl(FxU32 mode);
|
||||||
|
|
||||||
#endif __OEMINIT_H__
|
#endif /* __OEMINIT_H__ */
|
||||||
|
|
||||||
|
|||||||
352
glide2x/cvg/glide/src/Makefile.win32
Normal file
352
glide2x/cvg/glide/src/Makefile.win32
Normal 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)
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
int _cpu_detect_asm() {
|
int _cpu_detect_asm() {
|
||||||
struct utsname name;
|
struct utsname name;
|
||||||
|
|||||||
347
glide2x/cvg/glide/src/cpuid.c
Normal file
347
glide2x/cvg/glide/src/cpuid.c
Normal file
@@ -0,0 +1,347 @@
|
|||||||
|
/*
|
||||||
|
* CPU detection code
|
||||||
|
*
|
||||||
|
* $Header$
|
||||||
|
* $Log$
|
||||||
|
* 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"
|
||||||
|
|
||||||
|
typedef unsigned long word32;
|
||||||
|
|
||||||
|
/* 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
|
||||||
@@ -19,6 +19,12 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $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
|
** Revision 1.1.1.1 1999/12/07 21:49:08 joseph
|
||||||
** Initial checkin into SourceForge.
|
** Initial checkin into SourceForge.
|
||||||
**
|
**
|
||||||
|
|||||||
@@ -19,6 +19,19 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $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
|
** 40 6/23/98 5:38p Peter
|
||||||
** lfb hinting
|
** lfb hinting
|
||||||
@@ -212,26 +225,26 @@ _grSwizzleColor(GrColor_t *color)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case GR_COLORFORMAT_ABGR:
|
case GR_COLORFORMAT_ABGR:
|
||||||
red = *color & 0x00ff;
|
red = (*color & 0x000000ff) << 16; /* 00RR0000 */
|
||||||
blue = (*color >> 16) & 0xff;
|
blue = (*color & 0x00ff0000) >> 16; /* 000000BB */
|
||||||
*color &= 0xff00ff00;
|
*color &= 0xff00ff00; /* AA00GG00 */
|
||||||
*color |= ((red << 16) | blue);
|
*color |= (red | blue); /* AARRGGBB */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GR_COLORFORMAT_RGBA:
|
case GR_COLORFORMAT_RGBA:
|
||||||
blue = (*color & 0x0000ff00) >> 8;
|
blue = (*color & 0x0000ff00) >> 8; /* 000000BB */
|
||||||
green = (*color & 0x00ff0000) >> 16;
|
green = (*color & 0x00ff0000) >> 8; /* 0000GG00 */
|
||||||
red = (*color & 0xff000000) >> 24;
|
red = (*color & 0xff000000) >> 8; /* 00RR0000 */
|
||||||
alpha = (*color & 0x000000ff);
|
alpha = (*color & 0x000000ff) << 24; /* AA000000 */
|
||||||
*color = (alpha << 24) | (red << 16) | (green << 8) | blue;
|
*color = alpha | red | green | blue; /* AARRGGBB */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GR_COLORFORMAT_BGRA:
|
case GR_COLORFORMAT_BGRA:
|
||||||
blue = (*color & 0xff000000) >> 24;
|
blue = (*color & 0xff000000) >> 24; /* 000000BB */
|
||||||
green = (*color & 0x00ff0000) >> 16;
|
green = (*color & 0x00ff0000) >> 8; /* 0000GG00 */
|
||||||
red = (*color & 0x0000ff00) >> 8;
|
red = (*color & 0x0000ff00) << 8; /* 00RR0000 */
|
||||||
alpha = (*color & 0x000000ff);
|
alpha = (*color & 0x000000ff) << 24; /* AA000000 */
|
||||||
*color = (alpha << 24) | (red << 16) | (green << 8) | blue;
|
*color = alpha | red | green | blue; /* AARRGGBB */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $Log$
|
||||||
|
** Revision 1.1.1.1 1999/12/07 21:49:08 joseph
|
||||||
|
** Initial checkin into SourceForge.
|
||||||
|
**
|
||||||
**
|
**
|
||||||
** 22 4/21/98 10:05a Peter
|
** 22 4/21/98 10:05a Peter
|
||||||
** grSstSelect cleanup (Thanks John/Rufus)
|
** grSstSelect cleanup (Thanks John/Rufus)
|
||||||
@@ -109,7 +112,7 @@ GR_DIENTRY(grSstQueryBoards, FxBool, ( GrHwConfiguration *hwc ))
|
|||||||
GDBG_INIT();
|
GDBG_INIT();
|
||||||
GDBG_INFO(80,"grSstQueryBoards(0x%x)\n",hwc);
|
GDBG_INFO(80,"grSstQueryBoards(0x%x)\n",hwc);
|
||||||
|
|
||||||
#if GLIDE_INIT_HAL
|
#if 1 /*GLIDE_INIT_HAL*/
|
||||||
hwc->num_sst = (_grSstDetectResources()
|
hwc->num_sst = (_grSstDetectResources()
|
||||||
? _GlideRoot.hwConfig.num_sst
|
? _GlideRoot.hwConfig.num_sst
|
||||||
: 0);
|
: 0);
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $Log$
|
||||||
|
** Revision 1.1.1.1 1999/12/07 21:49:08 joseph
|
||||||
|
** Initial checkin into SourceForge.
|
||||||
|
**
|
||||||
**
|
**
|
||||||
** 22 3/14/98 1:07p Peter
|
** 22 3/14/98 1:07p Peter
|
||||||
** mac port happiness
|
** mac port happiness
|
||||||
@@ -512,7 +515,7 @@ const FxU32 kFifoCheckMask = 0xFFFF;
|
|||||||
FxU32 gFifoCheckCount = 0;
|
FxU32 gFifoCheckCount = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void GR_CDECL
|
void FX_CALL
|
||||||
_FifoMakeRoom(const FxI32 blockSize, const char* fName, const int fLine)
|
_FifoMakeRoom(const FxI32 blockSize, const char* fName, const int fLine)
|
||||||
{
|
{
|
||||||
#define FN_NAME "_FifoMakeRoom"
|
#define FN_NAME "_FifoMakeRoom"
|
||||||
|
|||||||
85
glide2x/cvg/glide/src/fpu.c
Normal file
85
glide2x/cvg/glide/src/fpu.c
Normal 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
|
||||||
|
|
||||||
@@ -37,7 +37,6 @@
|
|||||||
* macros for creating assembler offset files
|
* macros for creating assembler offset files
|
||||||
*----------------------------------------------------------------------*/
|
*----------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef __linux__
|
|
||||||
#define NEWLINE printf("\n")
|
#define NEWLINE printf("\n")
|
||||||
#define COMMENT printf(";----------------------------------------------------------------------\n")
|
#define COMMENT printf(";----------------------------------------------------------------------\n")
|
||||||
|
|
||||||
@@ -46,44 +45,16 @@
|
|||||||
COMMENT; NEWLINE
|
COMMENT; NEWLINE
|
||||||
|
|
||||||
#define OFFSET(p,o,pname) if (hex) \
|
#define OFFSET(p,o,pname) if (hex) \
|
||||||
printf("%s\t= %08xh\n",pname,((int)&p.o)-(int)&p); \
|
printf("%s\tequ %08xh\n",pname,((int)&p.o)-(int)&p); \
|
||||||
else printf("%s\t= %10d\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) \
|
#define OFFSET2(p,o,pname) if (hex) \
|
||||||
printf("%s\t= %08xh\n",pname,((int)&o)-(int)&p); \
|
printf("%s\tequ %08xh\n",pname,((int)&o)-(int)&p); \
|
||||||
else printf("%s\t= %10d\n",pname,((int)&o)-(int)&p)
|
else printf("%s\tequ %10d\n",pname,((int)&o)-(int)&p)
|
||||||
|
|
||||||
#define SIZEOF(p,pname) if (hex) \
|
#define SIZEOF(p,pname) if (hex) \
|
||||||
printf("SIZEOF_%s\t= %08xh\n",pname,sizeof(p)); \
|
printf("SIZEOF_%s\tequ %08lxh\n",pname,sizeof(p)); \
|
||||||
else printf("SIZEOF_%s\t= %10d\n",pname,sizeof(p))
|
else printf("SIZEOF_%s\tequ %10ld\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
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
@@ -106,17 +77,17 @@ main (int argc, char **argv)
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
#if GLIDE_DISPATCH_SETUP
|
#if GLIDE_DISPATCH_SETUP
|
||||||
printf("#define kCurGCOffset 0x%XUL\n",
|
printf("#define kCurGCOffset 0x%lXUL\n",
|
||||||
offsetof(struct _GlideRoot_s, curGC));
|
offsetof(struct _GlideRoot_s, curGC));
|
||||||
|
|
||||||
printf("#define kTriProcOffset 0x%XUL\n",
|
printf("#define kTriProcOffset 0x%lXUL\n",
|
||||||
offsetof(struct GrGC_s, cmdTransportInfo.triSetupProc));
|
offsetof(struct GrGC_s, curArchProcs.triSetupProc));
|
||||||
printf("#define kTriProcOffsetClean %d\n",
|
printf("#define kTriProcOffsetClean %d\n",
|
||||||
offsetof(struct GrGC_s, cmdTransportInfo.triSetupProc));
|
offsetof(struct GrGC_s, curArchProcs.triSetupProc));
|
||||||
#endif /* GLIDE_DISPATCH_SETUP */
|
#endif /* GLIDE_DISPATCH_SETUP */
|
||||||
|
|
||||||
printf("/* The # of 2-byte entries in the hw fog table */\n");
|
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);
|
sizeof(dummyRegs.fogTable) >> 1);
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
@@ -135,6 +106,7 @@ main (int argc, char **argv)
|
|||||||
OFFSET (gc,base_ptr,"base_ptr\t");
|
OFFSET (gc,base_ptr,"base_ptr\t");
|
||||||
OFFSET (gc,reg_ptr,"reg_ptr\t\t");
|
OFFSET (gc,reg_ptr,"reg_ptr\t\t");
|
||||||
OFFSET (gc,lfb_ptr,"lfb_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,state.cull_mode,"cull_mode\t");
|
||||||
OFFSET (gc, regDataList,"regDataList\t");
|
OFFSET (gc, regDataList,"regDataList\t");
|
||||||
OFFSET (gc, tsuDataList,"tsuDataList\t");
|
OFFSET (gc, tsuDataList,"tsuDataList\t");
|
||||||
|
|||||||
@@ -19,6 +19,23 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $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
|
** 206 6/06/98 12:06p Peter
|
||||||
** gmt's trilinear hell bug
|
** gmt's trilinear hell bug
|
||||||
@@ -272,6 +289,7 @@
|
|||||||
#include <3dfx.h>
|
#include <3dfx.h>
|
||||||
#include <glidesys.h>
|
#include <glidesys.h>
|
||||||
#include <gdebug.h>
|
#include <gdebug.h>
|
||||||
|
#include <cpuid.h>
|
||||||
|
|
||||||
#if (GLIDE_PLATFORM & GLIDE_HW_H3)
|
#if (GLIDE_PLATFORM & GLIDE_HW_H3)
|
||||||
#include <h3.h>
|
#include <h3.h>
|
||||||
@@ -418,7 +436,7 @@ do { \
|
|||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct _GrState_s
|
struct _GrState_s
|
||||||
{
|
{
|
||||||
GrCullMode_t /* these go in front for cache hits */
|
GrCullMode_t /* these go in front for cache hits */
|
||||||
cull_mode; /* cull neg, cull pos, don't cull */
|
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 */
|
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
|
typedef struct GrGC_s
|
||||||
{
|
{
|
||||||
FxU32
|
FxU32
|
||||||
@@ -524,6 +638,15 @@ typedef struct GrGC_s
|
|||||||
GrState
|
GrState
|
||||||
state; /* state of Glide/SST */
|
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 {
|
struct cmdTransportInfo {
|
||||||
FxU32 triPacketHdr; /* Pre-computed packet header for
|
FxU32 triPacketHdr; /* Pre-computed packet header for
|
||||||
* independent triangles.
|
* independent triangles.
|
||||||
@@ -565,10 +688,6 @@ typedef struct GrGC_s
|
|||||||
|
|
||||||
FxBool fifoLfbP; /* Do we expect lfb writes to go through the fifo? */
|
FxBool fifoLfbP; /* Do we expect lfb writes to go through the fifo? */
|
||||||
FxBool lfbLockCount; /* Have we done an lfb lock? Count of the locks. */
|
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
|
#if GLIDE_USE_SHADOW_FIFO
|
||||||
FxU32* fifoShadowBase; /* Buffer that shadows the hw fifo for debugging */
|
FxU32* fifoShadowBase; /* Buffer that shadows the hw fifo for debugging */
|
||||||
@@ -716,7 +835,7 @@ typedef struct GrGC_s
|
|||||||
struct _GlideRoot_s {
|
struct _GlideRoot_s {
|
||||||
int p6Fencer; /* xchg to here to keep this in cache!!! */
|
int p6Fencer; /* xchg to here to keep this in cache!!! */
|
||||||
int current_sst;
|
int current_sst;
|
||||||
FxU32 CPUType;
|
_p_info CPUType; /* CPUID */
|
||||||
GrGC *curGC; /* point to the current GC */
|
GrGC *curGC; /* point to the current GC */
|
||||||
FxU32 packerFixAddress; /* address to write packer fix to */
|
FxU32 packerFixAddress; /* address to write packer fix to */
|
||||||
FxBool windowsInit; /* Is the Windows part of glide initialized? */
|
FxBool windowsInit; /* Is the Windows part of glide initialized? */
|
||||||
@@ -812,6 +931,17 @@ struct _GlideRoot_s {
|
|||||||
* sst's and actual boards.
|
* sst's and actual boards.
|
||||||
*/
|
*/
|
||||||
GrGC GCs[MAX_NUM_SST]; /* one GC per board */
|
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;
|
extern struct _GlideRoot_s GR_CDECL _GlideRoot;
|
||||||
@@ -879,37 +1009,13 @@ extern GrGCFuncs _curGCFuncs;
|
|||||||
void _grMipMapInit(void);
|
void _grMipMapInit(void);
|
||||||
|
|
||||||
#if GLIDE_DISPATCH_SETUP
|
#if GLIDE_DISPATCH_SETUP
|
||||||
FxI32 FX_CSTYLE
|
#define TRISETUP_NORGB (*_GlideRoot.deviceArchProcs.curTriProcs + 0)
|
||||||
_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)
|
|
||||||
|
|
||||||
#if GLIDE_PACKED_RGB
|
#if GLIDE_PACKED_RGB
|
||||||
FxI32 FX_CSTYLE
|
#define TRISETUP_RGB (*_GlideRoot.deviceArchProcs.curTriProcs + 1)
|
||||||
_trisetup_cull_rgb(const GrVertex *va, const GrVertex *vb, const GrVertex *vc);
|
#define TRISETUP_ARGB (*_GlideRoot.deviceArchProcs.curTriProcs + 2)
|
||||||
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)
|
|
||||||
#endif /* !GLIDE_PACKED_RGB */
|
#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 */
|
#else /* !GLIDE_DISPATCH_SETUP */
|
||||||
FxI32 FX_CSTYLE
|
FxI32 FX_CSTYLE
|
||||||
_trisetup_asm(const GrVertex *va, const GrVertex *vb, const GrVertex *vc);
|
_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)
|
ASSERT_FAULT_IMMED((FxU32)gc->cmdTransportInfo.fifoPtr < (FxU32)gc->cmdTransportInfo.fifoEnd)
|
||||||
#endif /* !FIFO_ASSERT_FULL */
|
#endif /* !FIFO_ASSERT_FULL */
|
||||||
|
|
||||||
void GR_CDECL
|
extern void FX_CALL
|
||||||
_FifoMakeRoom(const FxI32 blockSize, const char* fName, const int fLine);
|
_FifoMakeRoom(const FxI32 blockSize, const char* fName, const int fLine);
|
||||||
|
|
||||||
#define GR_CHECK_FOR_ROOM(__n, __p) \
|
#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.
|
* probably do something silly like wrap around zero.
|
||||||
*/
|
*/
|
||||||
#if GLIDE_PACKED_RGB
|
#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))), \
|
((_GlideRoot.pool.ftemp1 = (float)((float)(__fpVal) + (float)(__fpBias))), \
|
||||||
GR_ASSERT((__fpVal) >= 0.0f), \
|
GR_ASSERT((__fpVal) >= 0.0f), \
|
||||||
GR_ASSERT((__fpVal) < 256.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) \
|
#define RGBA_COMP_CLAMP(__fpVal, __compToken) \
|
||||||
RGBA_COMP(__fpVal, kPackBias##__compToken, kPackShift##__compToken, kPackMask##__compToken)
|
RGBA_COMP(__fpVal, kPackBias##__compToken, kPackShift##__compToken, kPackMask##__compToken)
|
||||||
@@ -2078,7 +2194,7 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#if (GLIDE_PLATFORM & GLIDE_HW_CVG)
|
#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)
|
#elif (GLIDE_PLATFORM & GLIDE_HW_H3)
|
||||||
#define TEX_ROW_ADDR_INCR(__t, __lod) ((__t) << 7)
|
#define TEX_ROW_ADDR_INCR(__t, __lod) ((__t) << 7)
|
||||||
#else
|
#else
|
||||||
@@ -2222,7 +2338,7 @@ do { \
|
|||||||
#define REG_GROUP_SETF_CLAMP(__regBase, __regAddr, __val) \
|
#define REG_GROUP_SETF_CLAMP(__regBase, __regAddr, __val) \
|
||||||
do { \
|
do { \
|
||||||
const FxU32 fpClampVal = FP_FLOAT_CLAMP(__val); \
|
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); \
|
SET(((FxU32*)(__regBase))[offsetof(SstRegs, __regAddr) >> 2], fpClampVal); \
|
||||||
GR_INC_SIZE(sizeof(FxU32)); \
|
GR_INC_SIZE(sizeof(FxU32)); \
|
||||||
} while(0)
|
} while(0)
|
||||||
@@ -2372,8 +2488,8 @@ _grErrorCallback(const char* const procName,
|
|||||||
va_list args);
|
va_list args);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern FxU32 GR_CDECL
|
/*extern FxU32 GR_CDECL
|
||||||
_cpu_detect_asm(void);
|
_cpu_detect_asm(void);*/
|
||||||
|
|
||||||
extern void GR_CDECL
|
extern void GR_CDECL
|
||||||
single_precision_asm(void);
|
single_precision_asm(void);
|
||||||
|
|||||||
61
glide2x/cvg/glide/src/fxsplash.h
Normal file
61
glide2x/cvg/glide/src/fxsplash.h
Normal 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_ */
|
||||||
@@ -19,6 +19,15 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $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
|
** 17 2/20/98 11:00a Peter
|
||||||
** removed glide3 from glid2 tree
|
** removed glide3 from glid2 tree
|
||||||
@@ -55,7 +64,7 @@
|
|||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <ctype.h>
|
||||||
#include <3dfx.h>
|
#include <3dfx.h>
|
||||||
|
|
||||||
#define FX_DLL_DEFINITION
|
#define FX_DLL_DEFINITION
|
||||||
@@ -297,18 +306,13 @@ GR_DIENTRY(gu3dfGetInfo, FxBool,
|
|||||||
/*
|
/*
|
||||||
** determine the color format of the input image
|
** determine the color format of the input image
|
||||||
*/
|
*/
|
||||||
#ifdef __GNUC__
|
|
||||||
/* This function is not found in libgcc.a */
|
|
||||||
{
|
{
|
||||||
char* tempStr = (char*)color_format;
|
char *tempStr = (char*)color_format;
|
||||||
while(*tempStr != '\0') *tempStr++ = toupper(*tempStr);
|
while (*tempStr != '\0') {
|
||||||
|
*tempStr = toupper(*tempStr);
|
||||||
|
tempStr++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
{
|
|
||||||
extern char* strupr(char*);
|
|
||||||
strupr(color_format);
|
|
||||||
}
|
|
||||||
#endif /* __GNUC__ */
|
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
format_found = FXFALSE;
|
format_found = FXFALSE;
|
||||||
|
|||||||
@@ -19,6 +19,12 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $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
|
** 64 5/18/98 12:15p Peter
|
||||||
** crybaby check for alpha enable
|
** crybaby check for alpha enable
|
||||||
@@ -246,13 +252,12 @@ GR_ENTRY(grAADrawPoint, void, (const GrVertex *e))
|
|||||||
|
|
||||||
dataList++;
|
dataList++;
|
||||||
}
|
}
|
||||||
|
|
||||||
packedColor |= RGBA_COMP_CLAMP(FARRAY(fp, (GR_VERTEX_A_OFFSET << 2)), A);
|
packedColor |= RGBA_COMP_CLAMP(FARRAY(fp, (GR_VERTEX_A_OFFSET << 2)), A);
|
||||||
|
dataList++;
|
||||||
|
|
||||||
TRI_SET(packedColor);
|
TRI_SET(packedColor);
|
||||||
} else {
|
|
||||||
TRI_SETF(FARRAY(fp, (GR_VERTEX_A_OFFSET << 2)));
|
|
||||||
}
|
}
|
||||||
dataList++;
|
|
||||||
#endif /* GLIDE_PACKED_RGB */
|
#endif /* GLIDE_PACKED_RGB */
|
||||||
|
|
||||||
#if GLIDE_FP_CLAMP_TEX
|
#if GLIDE_FP_CLAMP_TEX
|
||||||
@@ -300,12 +305,12 @@ GR_ENTRY(grAADrawPoint, void, (const GrVertex *e))
|
|||||||
|
|
||||||
dataList++;
|
dataList++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Alpha set to 0.0 */
|
||||||
|
|
||||||
TRI_SET(packedColor);
|
TRI_SET(packedColor);
|
||||||
} else {
|
} else {
|
||||||
TRI_SETF(0.0f);
|
#endif /* !GLIDE_PACKED_RGB */
|
||||||
}
|
|
||||||
#else /* !GLIDE_PACKED_RGB */
|
|
||||||
/* Parameters up to alpha.
|
/* Parameters up to alpha.
|
||||||
*
|
*
|
||||||
* NB: It is up to the user to correctly set this up
|
* 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 */
|
/* Send constant Alpha == 0.0f */
|
||||||
TRI_SETF(0.0f);
|
TRI_SETF(0.0f);
|
||||||
|
#if GLIDE_PACKED_RGB
|
||||||
|
}
|
||||||
#endif /* !GLIDE_PACKED_RGB */
|
#endif /* !GLIDE_PACKED_RGB */
|
||||||
|
|
||||||
/* Skip the actual alpha value in the data list */
|
/* Skip the actual alpha value in the data list */
|
||||||
@@ -426,13 +433,12 @@ grAADrawStrip(const FxU32 cullMode, const float* const vectorList[], const FxU32
|
|||||||
|
|
||||||
dataList++;
|
dataList++;
|
||||||
}
|
}
|
||||||
|
|
||||||
packedColor |= RGBA_COMP_CLAMP(FARRAY(vector, (GR_VERTEX_A_OFFSET << 2)), A);
|
packedColor |= RGBA_COMP_CLAMP(FARRAY(vector, (GR_VERTEX_A_OFFSET << 2)), A);
|
||||||
|
dataList++;
|
||||||
|
|
||||||
TRI_SET(packedColor);
|
TRI_SET(packedColor);
|
||||||
} else {
|
|
||||||
TRI_SETF(FARRAY(vector, (GR_VERTEX_A_OFFSET << 2)));
|
|
||||||
}
|
}
|
||||||
dataList++;
|
|
||||||
#endif /* GLIDE_PACKED_RGB */
|
#endif /* GLIDE_PACKED_RGB */
|
||||||
|
|
||||||
#if GLIDE_FP_CLAMP_TEX
|
#if GLIDE_FP_CLAMP_TEX
|
||||||
@@ -663,6 +669,27 @@ GR_ENTRY(grAADrawLine, void, (const GrVertex *v1, const GrVertex *v2))
|
|||||||
v2->a = 0.0f;
|
v2->a = 0.0f;
|
||||||
datalist = gc->tsuDataList;
|
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 ) {
|
while( *datalist != 0 ) {
|
||||||
TRI_SETF(FARRAY(v2, *datalist));
|
TRI_SETF(FARRAY(v2, *datalist));
|
||||||
datalist++;
|
datalist++;
|
||||||
@@ -680,6 +707,27 @@ GR_ENTRY(grAADrawLine, void, (const GrVertex *v1, const GrVertex *v2))
|
|||||||
v1->a = 0.0f;
|
v1->a = 0.0f;
|
||||||
datalist = gc->tsuDataList;
|
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 ) {
|
while( *datalist != 0 ) {
|
||||||
TRI_SETF(FARRAY(v1, *datalist));
|
TRI_SETF(FARRAY(v1, *datalist));
|
||||||
datalist++;
|
datalist++;
|
||||||
@@ -692,6 +740,25 @@ GR_ENTRY(grAADrawLine, void, (const GrVertex *v1, const GrVertex *v2))
|
|||||||
|
|
||||||
TRI_SETF( v2->x );
|
TRI_SETF( v2->x );
|
||||||
TRI_SETF( v2->y );
|
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 ) {
|
while( *datalist != 0 ) {
|
||||||
TRI_SETF(FARRAY(v2, *datalist));
|
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->x );
|
||||||
TRI_SETF( v1->y );
|
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 ) {
|
while( *datalist != 0 ) {
|
||||||
TRI_SETF(FARRAY(v1, *datalist));
|
TRI_SETF(FARRAY(v1, *datalist));
|
||||||
@@ -719,6 +805,27 @@ GR_ENTRY(grAADrawLine, void, (const GrVertex *v1, const GrVertex *v2))
|
|||||||
v2->a = 0.0f;
|
v2->a = 0.0f;
|
||||||
datalist = gc->tsuDataList;
|
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 ) {
|
while( *datalist != 0 ) {
|
||||||
TRI_SETF(FARRAY(v2, *datalist));
|
TRI_SETF(FARRAY(v2, *datalist));
|
||||||
datalist++;
|
datalist++;
|
||||||
@@ -736,6 +843,26 @@ GR_ENTRY(grAADrawLine, void, (const GrVertex *v1, const GrVertex *v2))
|
|||||||
v1->a = 0.0f;
|
v1->a = 0.0f;
|
||||||
datalist = gc->tsuDataList;
|
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 ) {
|
while( *datalist != 0 ) {
|
||||||
TRI_SETF(FARRAY(v1, *datalist));
|
TRI_SETF(FARRAY(v1, *datalist));
|
||||||
|
|||||||
@@ -19,6 +19,19 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $Log$
|
||||||
|
** 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
|
** Revision 1.3 2000/01/17 22:18:41 joseph
|
||||||
** A nicer, cleaner fix than the evil hack.
|
** A nicer, cleaner fix than the evil hack.
|
||||||
**
|
**
|
||||||
@@ -635,7 +648,9 @@ all_done: /* come here on degenerate lines */
|
|||||||
/*---------------------------------------------------------------------------
|
/*---------------------------------------------------------------------------
|
||||||
** grDrawTriangle
|
** grDrawTriangle
|
||||||
*/
|
*/
|
||||||
|
#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) && !GLIDE_USE_C_TRISETUP && !defined(GLIDE_DEBUG)
|
||||||
|
__declspec(naked)
|
||||||
|
#endif
|
||||||
GR_ENTRY(grDrawTriangle, void, (const GrVertex *a, const GrVertex *b, const GrVertex *c))
|
GR_ENTRY(grDrawTriangle, void, (const GrVertex *a, const GrVertex *b, const GrVertex *c))
|
||||||
{
|
{
|
||||||
#define FN_NAME grDrawTriangle
|
#define FN_NAME grDrawTriangle
|
||||||
@@ -680,11 +695,9 @@ all_done:
|
|||||||
#else
|
#else
|
||||||
#if defined(__MSC__)
|
#if defined(__MSC__)
|
||||||
{
|
{
|
||||||
extern struct _GlideRoot_s _GlideRoot;
|
__asm {
|
||||||
|
mov edx, [_GlideRoot + kCurGCOffset];
|
||||||
_asm {
|
mov eax, [edx + kTriProcOffset];
|
||||||
mov eax, [_GlideRoot + kCurGCOffset];
|
|
||||||
mov eax, [eax + kTriProcOffset];
|
|
||||||
jmp eax;
|
jmp eax;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -723,7 +736,7 @@ all_done:
|
|||||||
#endif
|
#endif
|
||||||
"jmp *%0"
|
"jmp *%0"
|
||||||
: /* no outputs */
|
: /* no outputs */
|
||||||
: "m" (_GlideRoot.curGC->cmdTransportInfo.triSetupProc)
|
: "m" (_GlideRoot.curGC->curArchProcs.triSetupProc)
|
||||||
#if defined (PIC) || !defined (BIG_OPT)
|
#if defined (PIC) || !defined (BIG_OPT)
|
||||||
:
|
:
|
||||||
#endif
|
#endif
|
||||||
@@ -885,25 +898,23 @@ __doPolyVertexSend:
|
|||||||
const int* dataList = gc->tsuDataList;
|
const int* dataList = gc->tsuDataList;
|
||||||
|
|
||||||
#if GLIDE_PACKED_RGB
|
#if GLIDE_PACKED_RGB
|
||||||
|
if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0)
|
||||||
{
|
{
|
||||||
FxBool doColorP = FXFALSE;
|
|
||||||
FxU32 packedColor = 0x00;
|
FxU32 packedColor = 0x00;
|
||||||
|
|
||||||
if (*dataList == (GR_VERTEX_R_OFFSET << 2)) {
|
if (*dataList == (GR_VERTEX_R_OFFSET << 2)) {
|
||||||
packedColor = (RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_B_OFFSET << 2)), B) |
|
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_G_OFFSET << 2)), G) |
|
||||||
RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_R_OFFSET << 2)), R));
|
RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_R_OFFSET << 2)), R));
|
||||||
doColorP = FXTRUE;
|
|
||||||
dataList++;
|
dataList++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*dataList == (GR_VERTEX_A_OFFSET << 2)) {
|
if (*dataList == (GR_VERTEX_A_OFFSET << 2)) {
|
||||||
packedColor |= RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_A_OFFSET << 2)), A);
|
packedColor |= RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_A_OFFSET << 2)), A);
|
||||||
doColorP = FXTRUE;
|
|
||||||
dataList++;
|
dataList++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doColorP) TRI_SET(packedColor);
|
TRI_SET(packedColor);
|
||||||
}
|
}
|
||||||
#endif /* GLIDE_PACKED_RGB */
|
#endif /* GLIDE_PACKED_RGB */
|
||||||
|
|
||||||
@@ -1007,37 +1018,23 @@ __doPolyVertexSend:
|
|||||||
const int* dataList = gc->tsuDataList;
|
const int* dataList = gc->tsuDataList;
|
||||||
|
|
||||||
#if GLIDE_PACKED_RGB
|
#if GLIDE_PACKED_RGB
|
||||||
/* dpc - 10 feb 1998 -
|
if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0)
|
||||||
* 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))
|
|
||||||
|
|
||||||
{
|
{
|
||||||
FxBool doColorP = FXFALSE;
|
|
||||||
FxU32 packedColor = 0x00;
|
FxU32 packedColor = 0x00;
|
||||||
|
|
||||||
if (*dataList == (GR_VERTEX_R_OFFSET << 2)) {
|
if (*dataList == (GR_VERTEX_R_OFFSET << 2)) {
|
||||||
packedColor = (RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_B_OFFSET << 2)), B) |
|
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_G_OFFSET << 2)), G) |
|
||||||
RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_R_OFFSET << 2)), R));
|
RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_R_OFFSET << 2)), R));
|
||||||
doColorP = FXTRUE;
|
|
||||||
dataList++;
|
dataList++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*dataList == (GR_VERTEX_A_OFFSET << 2)) {
|
if (*dataList == (GR_VERTEX_A_OFFSET << 2)) {
|
||||||
packedColor |= RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_A_OFFSET << 2)), A);
|
packedColor |= RGBA_COMP_CLAMP(FARRAY(vertex, (GR_VERTEX_A_OFFSET << 2)), A);
|
||||||
doColorP = FXTRUE;
|
|
||||||
dataList++;
|
dataList++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doColorP) TRI_SET(packedColor);
|
TRI_SET(packedColor);
|
||||||
}
|
}
|
||||||
#endif /* GLIDE_PACKED_RGB */
|
#endif /* GLIDE_PACKED_RGB */
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,26 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $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
|
** Revision 1.1.1.1 1999/12/07 21:49:10 joseph
|
||||||
** Initial checkin into SourceForge.
|
** Initial checkin into SourceForge.
|
||||||
**
|
**
|
||||||
@@ -781,6 +801,12 @@ GR_ENTRY(grBufferSwap, void, (int swapInterval))
|
|||||||
|
|
||||||
/* if the interval is non-zero turn on VSYNC waiting */
|
/* if the interval is non-zero turn on VSYNC waiting */
|
||||||
vSync = (swapInterval > 0);
|
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--;
|
if (swapInterval > 0) swapInterval--;
|
||||||
|
|
||||||
@@ -1498,21 +1524,24 @@ GR_STATE_ENTRY(grDitherMode, void, (GrDitherMode_t mode))
|
|||||||
GDBG_INFO_MORE(gc->myLevel, "(%d)\n", mode);
|
GDBG_INFO_MORE(gc->myLevel, "(%d)\n", mode);
|
||||||
|
|
||||||
fbzMode = gc->state.fbi_config.fbzMode;
|
fbzMode = gc->state.fbi_config.fbzMode;
|
||||||
if (_GlideRoot.environment.disableDitherSub == FXTRUE)
|
fbzMode &= ~(SST_ENDITHER | SST_DITHER2x2 | SST_ENDITHERSUBTRACT);
|
||||||
fbzMode &= ~(SST_ENDITHER | SST_DITHER2x2);
|
|
||||||
else
|
|
||||||
fbzMode &= ~(SST_ENDITHER | SST_DITHER2x2 | SST_ENDITHERSUBTRACT);
|
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case GR_DITHER_DISABLE:
|
case GR_DITHER_DISABLE:
|
||||||
break;
|
/* alpha dither subtract should be disabled */
|
||||||
|
|
||||||
case GR_DITHER_2x2:
|
|
||||||
fbzMode |= (SST_ENDITHER | SST_DITHER2x2);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GR_DITHER_2x2:
|
||||||
case GR_DITHER_4x4:
|
case GR_DITHER_4x4:
|
||||||
|
/* force 4x4 dither with alpha dither subtraction */
|
||||||
fbzMode |= (SST_ENDITHER | SST_ENDITHERSUBTRACT);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1704,9 +1733,9 @@ GR_ENTRY(grGlideShutdown, void, (void))
|
|||||||
*/
|
*/
|
||||||
for(i = 0; i < _GlideRoot.hwConfig.num_sst; i++) {
|
for(i = 0; i < _GlideRoot.hwConfig.num_sst; i++) {
|
||||||
if (_GlideRoot.GCs[i].hwInitP) {
|
if (_GlideRoot.GCs[i].hwInitP) {
|
||||||
if (_GlideRoot.CPUType >= 6) {
|
/*if (_GlideRoot.CPUType.family >= 6) {*/
|
||||||
sst1InitCaching(_GlideRoot.GCs[i].base_ptr, FXFALSE);
|
sst1InitCaching(_GlideRoot.GCs[i].base_ptr, FXFALSE);
|
||||||
}
|
/*}*/
|
||||||
sst1InitShutdown(_GlideRoot.GCs[i].base_ptr);
|
sst1InitShutdown(_GlideRoot.GCs[i].base_ptr);
|
||||||
|
|
||||||
_GlideRoot.GCs[i].hwInitP = FXFALSE;
|
_GlideRoot.GCs[i].hwInitP = FXFALSE;
|
||||||
@@ -1718,6 +1747,8 @@ GR_ENTRY(grGlideShutdown, void, (void))
|
|||||||
gc->grSstRez = GR_RESOLUTION_NONE;
|
gc->grSstRez = GR_RESOLUTION_NONE;
|
||||||
gc->grSstRefresh = GR_REFRESH_NONE;
|
gc->grSstRefresh = GR_REFRESH_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_GlideRoot.initialized = FXFALSE;
|
||||||
} /* grGlideShutdown */
|
} /* grGlideShutdown */
|
||||||
|
|
||||||
|
|
||||||
@@ -2115,11 +2146,11 @@ _grUpdateTriPacketHdr(FxU32 paramMask,
|
|||||||
? kSetupCullPositive
|
? kSetupCullPositive
|
||||||
: kSetupCullNegative);
|
: kSetupCullNegative);
|
||||||
|
|
||||||
#if GLIDE_DISPATCH_SETUP
|
|
||||||
#define COLOR_COMP_ARGB ((SST_SETUP_RGB | SST_SETUP_A) << SSTCP_PKT3_PMASK_SHIFT)
|
#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_RGB (SST_SETUP_RGB << SSTCP_PKT3_PMASK_SHIFT)
|
||||||
#define COLOR_COMP_MASK COLOR_COMP_ARGB
|
#define COLOR_COMP_MASK COLOR_COMP_ARGB
|
||||||
|
|
||||||
|
#if GLIDE_DISPATCH_SETUP
|
||||||
/* Setup custom triangle/strip procs.
|
/* Setup custom triangle/strip procs.
|
||||||
*
|
*
|
||||||
* NB: Currently this selection is based entirely on if
|
* 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
|
* select on cpu type as well to determine if we should
|
||||||
* do sw culling or not.
|
* 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) {
|
#if GLIDE_PACKED_RGB
|
||||||
case COLOR_COMP_ARGB:
|
if ((paramMask & SSTCP_PKT3_PACKEDCOLOR) == SSTCP_PKT3_PACKEDCOLOR) {
|
||||||
gc->cmdTransportInfo.triSetupProc = TRISETUP_ARGB(cullMode);
|
const FxU32 colorComp = paramMask & COLOR_COMP_MASK;
|
||||||
break;
|
|
||||||
|
|
||||||
case COLOR_COMP_RGB:
|
switch(colorComp) {
|
||||||
gc->cmdTransportInfo.triSetupProc = TRISETUP_RGB(cullMode);
|
case COLOR_COMP_ARGB:
|
||||||
break;
|
curTriProcVector = TRISETUP_ARGB;
|
||||||
|
break;
|
||||||
|
|
||||||
/* If no rgb data then it is not worthwhile to pack
|
case COLOR_COMP_RGB:
|
||||||
* just alpha so just mask off the packed color bit
|
curTriProcVector = TRISETUP_RGB;
|
||||||
* and just use the looping proc.
|
break;
|
||||||
*/
|
|
||||||
default:
|
/* If no rgb data then it is not worthwhile to pack
|
||||||
gc->cmdTransportInfo.triSetupProc = TRISETUP_NORGB(cullMode);
|
* just alpha so just mask off the packed color bit
|
||||||
paramMask &= ~SSTCP_PKT3_PACKEDCOLOR;
|
* and just use the looping proc.
|
||||||
break;
|
*/
|
||||||
|
default:
|
||||||
|
curTriProcVector = TRISETUP_NORGB;
|
||||||
|
paramMask &= ~SSTCP_PKT3_PACKEDCOLOR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
#endif
|
||||||
gc->cmdTransportInfo.triSetupProc = TRISETUP_NORGB(cullMode);
|
|
||||||
|
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 */
|
#endif /* GLIDE_DISPATCH_SETUP */
|
||||||
|
|
||||||
gc->cmdTransportInfo.paramMask = paramMask;
|
gc->cmdTransportInfo.paramMask = paramMask;
|
||||||
|
|||||||
@@ -19,6 +19,12 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $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
|
#define OFFICIAL 1
|
||||||
@@ -26,7 +32,7 @@
|
|||||||
|
|
||||||
#include <fxver.h>
|
#include <fxver.h>
|
||||||
#include "rcver.h"
|
#include "rcver.h"
|
||||||
#include "fxbldno.h"
|
//#include "fxbldno.h"
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
@@ -56,11 +62,12 @@ BEGIN
|
|||||||
VALUE "FileDescription", "3Dfx Interactive, Inc. Glide DLL\0"
|
VALUE "FileDescription", "3Dfx Interactive, Inc. Glide DLL\0"
|
||||||
VALUE "FileVersion", VERSIONSTR
|
VALUE "FileVersion", VERSIONSTR
|
||||||
VALUE "InternalName", VERSIONNAME
|
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 "OriginalFilename", VERSIONNAME
|
||||||
VALUE "ProductName", PRODNAME
|
VALUE "ProductName", PRODNAME
|
||||||
VALUE "ProductVersion", VERSIONSTR
|
VALUE "ProductVersion", VERSIONSTR
|
||||||
VALUE "Graphics Subsystem", HWSTR
|
VALUE "Graphics Subsystem", HWSTR
|
||||||
|
VALUE "Contact", "The Glide Open Source Project http://glide.sourceforge.net/"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|||||||
@@ -19,6 +19,33 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $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
|
** 110 6/30/98 6:08p Jeske
|
||||||
** fixed bug where we tried to setup MTRRs on old (<p6) systems which
|
** fixed bug where we tried to setup MTRRs on old (<p6) systems which
|
||||||
@@ -226,6 +253,123 @@
|
|||||||
#include <glide.h>
|
#include <glide.h>
|
||||||
#include "fxglide.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
|
Function: _grSstDetectResources
|
||||||
Date: --
|
Date: --
|
||||||
@@ -324,7 +468,7 @@ _grSstDetectResources(void)
|
|||||||
* pair then we don't want to waste mtrr's that we're never
|
* pair then we don't want to waste mtrr's that we're never
|
||||||
* really going to write to.
|
* really going to write to.
|
||||||
*/
|
*/
|
||||||
if (!inSliPairP && (_GlideRoot.CPUType >= 6)) {
|
if (!inSliPairP/* && (_GlideRoot.CPUType.family >= 6)*/) {
|
||||||
sst1InitCaching((FxU32*)devRegs, FXTRUE);
|
sst1InitCaching((FxU32*)devRegs, FXTRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -442,9 +586,9 @@ _grSstDetectResources(void)
|
|||||||
#if GLIDE_INIT_HAL
|
#if GLIDE_INIT_HAL
|
||||||
fxHalShutdown(devRegs);
|
fxHalShutdown(devRegs);
|
||||||
#else /* !GLIDE_INIT_HAL */
|
#else /* !GLIDE_INIT_HAL */
|
||||||
if (_GlideRoot.CPUType >= 6) {
|
/*if (_GlideRoot.CPUType.family >= 6) {*/
|
||||||
sst1InitCaching((FxU32*)devRegs, FXFALSE);
|
sst1InitCaching((FxU32*)devRegs, FXFALSE);
|
||||||
}
|
/*}*/
|
||||||
pciUnmapPhysical((FxU32)devRegs, 0x1000000UL);
|
pciUnmapPhysical((FxU32)devRegs, 0x1000000UL);
|
||||||
#endif /* !GLIDE_INIT_HAL */
|
#endif /* !GLIDE_INIT_HAL */
|
||||||
}
|
}
|
||||||
@@ -543,8 +687,55 @@ _GlideInitEnvironment(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_GlideRoot.CPUType = _cpu_detect_asm();
|
/* Get CPU Info */
|
||||||
if (GETENV("FX_CPU")) _GlideRoot.CPUType = atoi(GETENV("FX_CPU"));
|
_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 */
|
/* Check for user environment tweaks */
|
||||||
{
|
{
|
||||||
@@ -557,7 +748,6 @@ _GlideInitEnvironment(void)
|
|||||||
_GlideRoot.environment.noSplash = (GETENV("FX_GLIDE_NO_SPLASH") != NULL);
|
_GlideRoot.environment.noSplash = (GETENV("FX_GLIDE_NO_SPLASH") != NULL);
|
||||||
_GlideRoot.environment.shamelessPlug = (GETENV("FX_GLIDE_SHAMELESS_PLUG") != NULL);
|
_GlideRoot.environment.shamelessPlug = (GETENV("FX_GLIDE_SHAMELESS_PLUG") != NULL);
|
||||||
_GlideRoot.environment.ignoreReopen = (GETENV("FX_GLIDE_IGNORE_REOPEN") != 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)
|
_GlideRoot.environment.texLodDither = ((GETENV("FX_GLIDE_LOD_DITHER") == NULL)
|
||||||
? 0x00UL
|
? 0x00UL
|
||||||
: SST_TLODDITHER);
|
: SST_TLODDITHER);
|
||||||
@@ -572,12 +762,25 @@ _GlideInitEnvironment(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
_GlideRoot.environment.snapshot = GLIDE_GETENV("FX_SNAPSHOT", 0);
|
_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," triBoundsCheck: %d\n",_GlideRoot.environment.triBoundsCheck);
|
||||||
GDBG_INFO(80," swapInterval: %d\n",_GlideRoot.environment.swapInterval);
|
GDBG_INFO(80," swapInterval: %d\n",_GlideRoot.environment.swapInterval);
|
||||||
GDBG_INFO(80," noSplash: %d\n",_GlideRoot.environment.noSplash);
|
GDBG_INFO(80," noSplash: %d\n",_GlideRoot.environment.noSplash);
|
||||||
GDBG_INFO(80," shamelessPlug: %d\n",_GlideRoot.environment.shamelessPlug);
|
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," snapshot: %d\n",_GlideRoot.environment.snapshot);
|
||||||
GDBG_INFO(80," disableDitherSub: %d\n",_GlideRoot.environment.disableDitherSub);
|
GDBG_INFO(80," disableDitherSub: %d\n",_GlideRoot.environment.disableDitherSub);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,19 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $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
|
** Revision 1.1.1.1 1999/12/07 21:49:11 joseph
|
||||||
** Initial checkin into SourceForge.
|
** Initial checkin into SourceForge.
|
||||||
**
|
**
|
||||||
@@ -330,6 +343,7 @@
|
|||||||
#include <fxdll.h>
|
#include <fxdll.h>
|
||||||
#include <glide.h>
|
#include <glide.h>
|
||||||
#include "fxglide.h"
|
#include "fxglide.h"
|
||||||
|
#include "fxsplash.h"
|
||||||
|
|
||||||
#if (GLIDE_PLATFORM & GLIDE_OS_WIN32)
|
#if (GLIDE_PLATFORM & GLIDE_OS_WIN32)
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
@@ -468,12 +482,14 @@ __tryReOpen:
|
|||||||
*/
|
*/
|
||||||
if (!gc->hwInitP) {
|
if (!gc->hwInitP) {
|
||||||
FxU32* sstRegs = NULL;
|
FxU32* sstRegs = NULL;
|
||||||
|
|
||||||
|
#if !DIRECTX
|
||||||
rv = pciOpen();
|
rv = pciOpen();
|
||||||
if (!rv) {
|
if (!rv) {
|
||||||
GDBG_INFO(gc->myLevel, "%s: pci bus could not be opened\n", FN_NAME);
|
GDBG_INFO(gc->myLevel, "%s: pci bus could not be opened\n", FN_NAME);
|
||||||
goto BAILOUT;
|
goto BAILOUT;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
sstRegs = sst1InitMapBoard(_GlideRoot.current_sst);
|
sstRegs = sst1InitMapBoard(_GlideRoot.current_sst);
|
||||||
rv = (sstRegs != NULL);
|
rv = (sstRegs != NULL);
|
||||||
@@ -484,9 +500,9 @@ __tryReOpen:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Re-enabled write combining */
|
/* Re-enabled write combining */
|
||||||
if (_GlideRoot.CPUType >= 6) {
|
/*if (_GlideRoot.CPUType.family >= 6) {*/
|
||||||
sst1InitCaching(sstRegs, FXTRUE);
|
sst1InitCaching(sstRegs, FXTRUE);
|
||||||
}
|
/*}*/
|
||||||
|
|
||||||
rv = sst1InitRegisters(sstRegs);
|
rv = sst1InitRegisters(sstRegs);
|
||||||
if (!rv) {
|
if (!rv) {
|
||||||
@@ -877,10 +893,10 @@ __tryReOpen:
|
|||||||
* NB: The order of the caching changes is relevant here since
|
* NB: The order of the caching changes is relevant here since
|
||||||
* we don't want to waste mtrr's, even briefly.
|
* 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->base_ptr, FXFALSE);
|
||||||
sst1InitCaching((gc + 1)->base_ptr, FXTRUE);
|
sst1InitCaching((gc + 1)->base_ptr, FXTRUE);
|
||||||
}
|
/*}*/
|
||||||
|
|
||||||
sst1InitShutdown(gc->base_ptr);
|
sst1InitShutdown(gc->base_ptr);
|
||||||
|
|
||||||
@@ -901,12 +917,14 @@ __tryReOpen:
|
|||||||
gc->hwInitP = FXFALSE;
|
gc->hwInitP = FXFALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !DIRECTX
|
||||||
/* dpc - 14 feb 1997 - HackAlert!!!!
|
/* dpc - 14 feb 1997 - HackAlert!!!!
|
||||||
* The sst1InitShutdown above will close the pci library which
|
* The sst1InitShutdown above will close the pci library which
|
||||||
* then prevents other pci library calls which we need to init
|
* then prevents other pci library calls which we need to init
|
||||||
* video next.
|
* video next.
|
||||||
*/
|
*/
|
||||||
pciOpen();
|
pciOpen();
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Re-init the new master */
|
/* Re-init the new master */
|
||||||
{
|
{
|
||||||
@@ -974,10 +992,10 @@ __tryReOpen:
|
|||||||
* NB: The order of the caching changes is relevant here since
|
* NB: The order of the caching changes is relevant here since
|
||||||
* we don't want to waste mtrr's, even briefly.
|
* 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->slave_ptr, FXFALSE);
|
||||||
sst1InitCaching(gc->base_ptr, FXTRUE);
|
sst1InitCaching(gc->base_ptr, FXTRUE);
|
||||||
}
|
/*}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Save that we swapped teh master sense so that we can
|
/* 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
|
* This is currently being done in _grDetectResources so that we
|
||||||
* can match the nt driver semantics in win95.
|
* can match the nt driver semantics in win95.
|
||||||
*/
|
*/
|
||||||
if (_GlideRoot.CPUType >= 6) {
|
/*if (_GlideRoot.CPUType.family >= 6) {*/
|
||||||
sst1InitCaching(gc->reg_ptr, FXTRUE);
|
sst1InitCaching(gc->reg_ptr, FXTRUE);
|
||||||
}
|
/*}*/
|
||||||
#endif /* !GLIDE_INIT_HAL */
|
#endif /* !GLIDE_INIT_HAL */
|
||||||
#else
|
#else
|
||||||
#error "Need to write command transport init for glide for this hw"
|
#error "Need to write command transport init for glide for this hw"
|
||||||
@@ -1555,13 +1573,53 @@ __errSliExit:
|
|||||||
if (!_GlideRoot.environment.noSplash) {
|
if (!_GlideRoot.environment.noSplash) {
|
||||||
HMODULE newSplash;
|
HMODULE newSplash;
|
||||||
|
|
||||||
if (newSplash = LoadLibrary("3dfxsplash2.dll")) {
|
if (newSplash = LoadLibrary("3dfxspl2.dll")) {
|
||||||
FARPROC fxSplash;
|
GrState glideState;
|
||||||
|
FxBool didLoad;
|
||||||
|
GrSplashProc fxSplash;
|
||||||
|
GrSplashInitProc fxSplashInit;
|
||||||
|
GrSplashPlugProc fxSplashPlug;
|
||||||
|
GrSplashShutdownProc fxSplashShutdown;
|
||||||
|
|
||||||
if (fxSplash = GetProcAddress(newSplash, "_fxSplash@16")) {
|
fxSplash = (GrSplashProc)GetProcAddress(newSplash, "_fxSplash@20");
|
||||||
fxSplash(hWnd, gc->state.screen_width, gc->state.screen_height, nAuxBuffers);
|
fxSplashInit = (GrSplashInitProc)GetProcAddress(newSplash, "_fxSplashInit@24");
|
||||||
_GlideRoot.environment.noSplash = 1;
|
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) */
|
#endif /* (GLIDE_PLATFORM & GLIDE_OS_WIN32) */
|
||||||
@@ -1679,9 +1737,9 @@ GR_ENTRY(grSstWinClose, void, (void))
|
|||||||
* track of the mtrr's.
|
* track of the mtrr's.
|
||||||
*/
|
*/
|
||||||
sst1InitIdle(gc->reg_ptr);
|
sst1InitIdle(gc->reg_ptr);
|
||||||
if (_GlideRoot.CPUType >= 6) {
|
/*if (_GlideRoot.CPUType.family >= 6) {*/
|
||||||
sst1InitCaching(gc->base_ptr, FXFALSE);
|
sst1InitCaching(gc->base_ptr, FXFALSE);
|
||||||
}
|
/*}*/
|
||||||
sst1InitShutdown(gc->reg_ptr);
|
sst1InitShutdown(gc->reg_ptr);
|
||||||
#endif /* !GLIDE_INIT_HAL */
|
#endif /* !GLIDE_INIT_HAL */
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,16 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $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
|
** Revision 1.1.1.1 1999/12/07 21:49:11 joseph
|
||||||
** Initial checkin into SourceForge.
|
** Initial checkin into SourceForge.
|
||||||
**
|
**
|
||||||
@@ -391,7 +401,9 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
|
|||||||
{
|
{
|
||||||
const FifoChipField chipId = (FifoChipField)(0x02UL << tmu);
|
const FifoChipField chipId = (FifoChipField)(0x02UL << tmu);
|
||||||
FxI32 sh;
|
FxI32 sh;
|
||||||
|
#if !GLIDE_DISPATCH_DOWNLOAD
|
||||||
FxU32 max_s, width, tmu_baseaddress;
|
FxU32 max_s, width, tmu_baseaddress;
|
||||||
|
#endif
|
||||||
#define FN_NAME "grTexDownloadMipMapLevelPartial"
|
#define FN_NAME "grTexDownloadMipMapLevelPartial"
|
||||||
|
|
||||||
GR_BEGIN_NOFIFOCHECK(FN_NAME, 89);
|
GR_BEGIN_NOFIFOCHECK(FN_NAME, 89);
|
||||||
@@ -477,6 +489,63 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
|
|||||||
REG_GROUP_END();
|
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
|
Determine max_s
|
||||||
------------------------------------------------------------*/
|
------------------------------------------------------------*/
|
||||||
@@ -499,7 +568,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
|
|||||||
------------------------------------------------------------*/
|
------------------------------------------------------------*/
|
||||||
if (format < GR_TEXFMT_16BIT) { /* 8 bit textures */
|
if (format < GR_TEXFMT_16BIT) { /* 8 bit textures */
|
||||||
/* Hoisted initialization */
|
/* 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;
|
const FxU8* src8 = (const FxU8*)data;
|
||||||
|
|
||||||
switch(width) {
|
switch(width) {
|
||||||
@@ -512,7 +581,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
|
|||||||
LINEAR_WRITE_END();
|
LINEAR_WRITE_END();
|
||||||
|
|
||||||
src8 += width;
|
src8 += width;
|
||||||
tex_address += TEX_ROW_ADDR_INCR(1, thisLod);
|
tex_address += TEX_ROW_ADDR_INCR(1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -525,7 +594,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
|
|||||||
LINEAR_WRITE_END();
|
LINEAR_WRITE_END();
|
||||||
|
|
||||||
src8 += width;
|
src8 += width;
|
||||||
tex_address += TEX_ROW_ADDR_INCR(1, thisLod);
|
tex_address += TEX_ROW_ADDR_INCR(1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -538,7 +607,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
|
|||||||
LINEAR_WRITE_END();
|
LINEAR_WRITE_END();
|
||||||
|
|
||||||
src8 += width;
|
src8 += width;
|
||||||
tex_address += TEX_ROW_ADDR_INCR(1, thisLod);
|
tex_address += TEX_ROW_ADDR_INCR(1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -550,7 +619,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
|
|||||||
for (; t <= max_t; t++) {
|
for (; t <= max_t; t++) {
|
||||||
FxU32 s;
|
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,
|
LINEAR_WRITE_BEGIN(max_s, kLinearWriteTex,
|
||||||
(FxU32)tex_address - (FxU32)gc->tex_ptr,
|
(FxU32)tex_address - (FxU32)gc->tex_ptr,
|
||||||
@@ -572,7 +641,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
|
|||||||
}
|
}
|
||||||
} else { /* 16-bit Textures */
|
} else { /* 16-bit Textures */
|
||||||
/* Hoisted initialization */
|
/* 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;
|
const FxU16* src16 = (const FxU16*)data;
|
||||||
|
|
||||||
/* Cases 1, 2 don't need inner loops for s */
|
/* Cases 1, 2 don't need inner loops for s */
|
||||||
@@ -586,7 +655,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
|
|||||||
LINEAR_WRITE_END();
|
LINEAR_WRITE_END();
|
||||||
|
|
||||||
src16 += width;
|
src16 += width;
|
||||||
tex_address += TEX_ROW_ADDR_INCR(1, thisLod);
|
tex_address += TEX_ROW_ADDR_INCR(1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -599,7 +668,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
|
|||||||
LINEAR_WRITE_END();
|
LINEAR_WRITE_END();
|
||||||
|
|
||||||
src16 += width;
|
src16 += width;
|
||||||
tex_address += TEX_ROW_ADDR_INCR(1, thisLod);
|
tex_address += TEX_ROW_ADDR_INCR(1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -607,7 +676,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
|
|||||||
for (; t <= max_t; t++) {
|
for (; t <= max_t; t++) {
|
||||||
FxU32 s;
|
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 */
|
/* Loop unrolled to process 2 dwords per iteration */
|
||||||
LINEAR_WRITE_BEGIN(max_s, kLinearWriteTex,
|
LINEAR_WRITE_BEGIN(max_s, kLinearWriteTex,
|
||||||
@@ -632,6 +701,7 @@ GR_ENTRY(grTexDownloadMipMapLevelPartial,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*------------------------------------------------------------
|
/*------------------------------------------------------------
|
||||||
Restore TLOD, texMode, baseAddress
|
Restore TLOD, texMode, baseAddress
|
||||||
@@ -771,7 +841,7 @@ GR_ENTRY(ConvertAndDownloadRle,
|
|||||||
|
|
||||||
rle_line_end=rle_line+width+u0;
|
rle_line_end=rle_line+width+u0;
|
||||||
for(t=0;t<max_t;t++) {
|
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;
|
src = rle_line + u0;
|
||||||
|
|
||||||
rle_decode_line_asm(tlut,&bm_data[offset],rle_line);
|
rle_decode_line_asm(tlut,&bm_data[offset],rle_line);
|
||||||
@@ -789,7 +859,7 @@ GR_ENTRY(ConvertAndDownloadRle,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (dest_height>height) {
|
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;
|
src=rle_line+u0;
|
||||||
|
|
||||||
LINEAR_WRITE_BEGIN(max_s, kLinearWriteTex,
|
LINEAR_WRITE_BEGIN(max_s, kLinearWriteTex,
|
||||||
|
|||||||
@@ -19,6 +19,12 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $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
|
* 12 12/15/97 5:52p Atai
|
||||||
* disable obsolete glide2 api for glide3
|
* disable obsolete glide2 api for glide3
|
||||||
|
|||||||
@@ -19,6 +19,12 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $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
|
** 61 3/17/98 3:00p Peter
|
||||||
** removed vertex sorting
|
** removed vertex sorting
|
||||||
@@ -250,6 +256,7 @@ GR_DDFUNC(_trisetup_nogradients,
|
|||||||
const int* dataList = gc->tsuDataList;
|
const int* dataList = gc->tsuDataList;
|
||||||
|
|
||||||
#if GLIDE_PACKED_RGB
|
#if GLIDE_PACKED_RGB
|
||||||
|
if ((gc->cmdTransportInfo.paramMask & SSTCP_PKT3_PACKEDCOLOR) != 0)
|
||||||
{
|
{
|
||||||
FxBool doColorP = FXFALSE;
|
FxBool doColorP = FXFALSE;
|
||||||
FxU32 packedColor = 0x00;
|
FxU32 packedColor = 0x00;
|
||||||
@@ -374,10 +381,10 @@ GR_DDFUNC(_trisetup_nogradients,
|
|||||||
if (hasColor || hasAlpha) {
|
if (hasColor || hasAlpha) {
|
||||||
FxU32 packedVal = 0x00;
|
FxU32 packedVal = 0x00;
|
||||||
|
|
||||||
if (hasColor) packedVal = ((RGBA_COMP_CLAMP(curVertex->b) << 0UL) |
|
if (hasColor) packedVal = ((RGBA_COMP_CLAMP(curVertex->b, B) << 0UL) |
|
||||||
(RGBA_COMP_CLAMP(curVertex->g) << 8UL) |
|
(RGBA_COMP_CLAMP(curVertex->g, G) << 8UL) |
|
||||||
(RGBA_COMP_CLAMP(curVertex->r) << 16UL));
|
(RGBA_COMP_CLAMP(curVertex->r, R) << 16UL));
|
||||||
if (hasAlpha) packedVal |= (RGBA_COMP_CLAMP(curVertex->a) << 24UL);
|
if (hasAlpha) packedVal |= (RGBA_COMP_CLAMP(curVertex->a, A) << 24UL);
|
||||||
|
|
||||||
REG_GROUP_SET(hw, sARGB, packedVal);
|
REG_GROUP_SET(hw, sARGB, packedVal);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
TAG_REGEXP = $(BUILD_ROOT)\$(FX_GLIDE_HW)\glide\src\glide.rx
|
TAG_REGEXP = $(BUILD_ROOT)\$(FX_GLIDE_HW)\glide\src\glide.rx
|
||||||
|
|
||||||
# Compile for specific hardware
|
# Compile for specific hardware
|
||||||
!if "$(FX_GLIDE_HW)" == "CVG"
|
!if "$(FX_GLIDE_HW)" == "cvg"
|
||||||
FX_GLIDE_REAL_HW= 1
|
FX_GLIDE_REAL_HW= 1
|
||||||
|
|
||||||
!if "$(FX_GLIDE_CTRISETUP)" == ""
|
!if "$(FX_GLIDE_CTRISETUP)" == ""
|
||||||
@@ -32,7 +32,7 @@ LCDEFS = $(LCDEFS) -DCVG \
|
|||||||
-DGLIDE_CHIP_BROADCAST=1 -DGLIDE_DEFAULT_GAMMA=1.3f
|
-DGLIDE_CHIP_BROADCAST=1 -DGLIDE_DEFAULT_GAMMA=1.3f
|
||||||
LCDEFS = $(LCDEFS) \
|
LCDEFS = $(LCDEFS) \
|
||||||
-DGLIDE_BLIT_CLEAR=1 \
|
-DGLIDE_BLIT_CLEAR=1 \
|
||||||
!else if "$(FX_GLIDE_HW)" == "H3"
|
!else if "$(FX_GLIDE_HW)" == "h3"
|
||||||
FX_GLIDE_REAL_HW= 1
|
FX_GLIDE_REAL_HW= 1
|
||||||
FX_GLIDE_NO_FIFO= 1
|
FX_GLIDE_NO_FIFO= 1
|
||||||
FX_GLIDE_CTRISETUP = 1
|
FX_GLIDE_CTRISETUP = 1
|
||||||
@@ -40,7 +40,7 @@ HWSPEC = fifo.c
|
|||||||
LCDEFS = $(LCDEFS) -DH3 \
|
LCDEFS = $(LCDEFS) -DH3 \
|
||||||
-DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKET3_TRI_SETUP=0
|
-DGLIDE_HW_TRI_SETUP=1 -DGLIDE_PACKET3_TRI_SETUP=0
|
||||||
!else
|
!else
|
||||||
!error "FX_GLIDE_HW == unknown value (H3|CVG)"
|
!error "FX_GLIDE_HW == unknown value (h3|cvg)"
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,263 +1,325 @@
|
|||||||
|
# Linux makefile for Glide2/CVG
|
||||||
|
# This makefile MUST be processed by GNU make!!!
|
||||||
#
|
#
|
||||||
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
# $Id$
|
||||||
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
#
|
||||||
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
# Copyright (c) 2004 - Daniel Borca
|
||||||
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
# Email : dborca@users.sourceforge.net
|
||||||
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
# Web : http://www.geocities.com/dborca
|
||||||
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
#
|
||||||
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
# Copyright (c) 2004 - Hiroshi Morii
|
||||||
# FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
# Email : koolsmoky@users.sourceforge.net
|
||||||
#
|
# Web : http://www.3dfxzone.it/koolsmoky
|
||||||
# USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
#
|
||||||
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
# Copyright (c) 2006 - Guillem Jover <guillem@hadrons.org>
|
||||||
# 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.
|
|
||||||
#
|
#
|
||||||
|
|
||||||
# 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
|
# Available options:
|
||||||
$(CC) -o $@ fxgasm.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) \
|
#
|
||||||
-I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include -I$(BUILD_ROOT)/swlibs/include $(LDFLAGS)
|
# 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=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
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# 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
|
||||||
|
OPTFLAGS ?= -O2 -ffast-math
|
||||||
|
else
|
||||||
|
CFLAGS += -DGLIDE_USE_C_TRISETUP
|
||||||
|
OPTFLAGS ?= -O2 -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 \
|
||||||
|
fpu.o \
|
||||||
|
xtexdl_def.o
|
||||||
|
|
||||||
|
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 $<
|
||||||
|
|
||||||
|
#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) $< $@
|
||||||
|
|
||||||
|
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
|
||||||
|
|
||||||
|
fxinline.h: fxgasm
|
||||||
|
./$< -inline > $@
|
||||||
|
|
||||||
fxgasm.h: fxgasm
|
fxgasm.h: fxgasm
|
||||||
./fxgasm > fxgasm.h
|
./$< -hex > $@
|
||||||
fxinline.h: fxgasm
|
|
||||||
./fxgasm -inline > fxinline.h
|
|
||||||
|
|
||||||
#--------------------------------------------------------------------------
|
fxgasm: fxgasm.c
|
||||||
# special rules for making FXBLDNO.H
|
$(CC) -o $@ $(CFLAGS) $<
|
||||||
#
|
|
||||||
|
|
||||||
fxbldno: fxbldno.c $(HEADERS) $(PRIVATE_HEADERS)
|
###############################################################################
|
||||||
$(CC) -o $@ fxbldno.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) $(LDFLAGS)
|
# clean, realclean
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
fxbldno.h: fxbldno.exe
|
clean:
|
||||||
fxbldno > fxbldno.h
|
-$(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
|
realclean: clean
|
||||||
gglide.obj: rcver.h
|
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB)
|
||||||
|
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SHARED)
|
||||||
ifeq ($(FX_GLIDE_CTRISETUP),1)
|
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO)
|
||||||
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
|
|
||||||
|
|||||||
@@ -1,19 +1,25 @@
|
|||||||
|
|
||||||
|
#include "fxbldno.h"
|
||||||
|
|
||||||
#define MANVERSION 2
|
#define MANVERSION 2
|
||||||
#define MANREVISION 53
|
#define MANREVISION 56
|
||||||
|
|
||||||
|
//#define BUILD_NUMBER 40405
|
||||||
|
|
||||||
#ifndef GLIDE3
|
#ifndef GLIDE3
|
||||||
#define VERSIONSTR "2.53\0"
|
#define VERSIONSTR "2.56\0"
|
||||||
#else
|
#else
|
||||||
#define VERSIONSTR "3.0\0"
|
#define VERSIONSTR "3.0\0"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CVG) || defined(VOODOO2)
|
#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
|
# 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
|
# 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 */
|
# endif /* NT_BUILD */
|
||||||
#elif defined(H3)
|
#elif defined(H3)
|
||||||
# define HWSTR " Banshee(tm)\0"
|
# define HWSTR " Banshee(tm)\0"
|
||||||
|
|||||||
@@ -19,6 +19,19 @@
|
|||||||
;; $Header$
|
;; $Header$
|
||||||
;; $Revision$
|
;; $Revision$
|
||||||
;; $Log$
|
;; $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
|
;; 7 5/18/98 12:16p Peter
|
||||||
;; culling enabling
|
;; culling enabling
|
||||||
@@ -47,174 +60,166 @@
|
|||||||
; B4 Chip field fix.
|
; B4 Chip field fix.
|
||||||
;;
|
;;
|
||||||
|
|
||||||
TITLE xdraw2.asm
|
%include "xos.inc"
|
||||||
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>
|
|
||||||
|
|
||||||
;;; Definitions of cvg regs and glide root structures.
|
;;; 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
|
;; enables/disables trisProcessed and trisDrawn counters
|
||||||
STATS = 1
|
%define STATS 1
|
||||||
|
|
||||||
;--------------------------------------------------------------------------
|
segment TEXT
|
||||||
; Arguments (STKOFF = 16 from 4 pushes)
|
|
||||||
STKOFF = 16
|
|
||||||
_va$ = 4 + STKOFF
|
|
||||||
_vb$ = 8 + STKOFF
|
|
||||||
_vc$ = 12 + STKOFF
|
|
||||||
|
|
||||||
X = 0
|
ALIGN 32
|
||||||
Y = 4
|
PROC_TYPE _trisetup_cull
|
||||||
; edx is used as index, loading from *src
|
|
||||||
gc TEXTEQU <esi> ; points to graphics context
|
|
||||||
|
|
||||||
_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
|
endp
|
||||||
PUBLIC _trisetup_cull@12
|
|
||||||
_trisetup_cull@12 PROC NEAR
|
|
||||||
.code
|
|
||||||
|
|
||||||
GLIDE_CULLING textequ <1>
|
%IF GLIDE_PACKED_RGB
|
||||||
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>
|
|
||||||
|
|
||||||
_trisetup_cull@12 ENDP
|
ALIGN 32
|
||||||
|
PROC_TYPE _trisetup_cull_rgb
|
||||||
|
|
||||||
IF GLIDE_PACKED_RGB
|
%define GLIDE_CULLING 1
|
||||||
align 4
|
%define GLIDE_PACK_RGB 1
|
||||||
PUBLIC _trisetup_cull_rgb@12
|
%define GLIDE_PACK_ALPHA 0
|
||||||
_trisetup_cull_rgb@12 PROC NEAR
|
%define GLIDE_GENERIC_SETUP 0
|
||||||
.code
|
%INCLUDE "xdraw2.inc"
|
||||||
|
%undef GLIDE_GENERIC_SETUP
|
||||||
|
%undef GLIDE_PACK_ALPHA
|
||||||
|
%undef GLIDE_PACK_RGB
|
||||||
|
%undef GLIDE_CULLING
|
||||||
|
|
||||||
GLIDE_CULLING textequ <1>
|
endp
|
||||||
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>
|
|
||||||
|
|
||||||
_trisetup_cull_rgb@12 ENDP
|
ALIGN 32
|
||||||
|
PROC_TYPE _trisetup_cull_argb
|
||||||
|
|
||||||
align 4
|
%define GLIDE_CULLING 1
|
||||||
PUBLIC _trisetup_cull_argb@12
|
%define GLIDE_PACK_RGB 1
|
||||||
_trisetup_cull_argb@12 PROC NEAR
|
%define GLIDE_PACK_ALPHA 1
|
||||||
.code
|
%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>
|
endp
|
||||||
GLIDE_PACK_RGB textequ <1>
|
%ENDIF ; GLIDE_PACKED_RGB
|
||||||
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>
|
|
||||||
|
|
||||||
_trisetup_cull_argb@12 ENDP
|
ALIGN 32
|
||||||
ENDIF ; GLIDE_PACKED_RGB
|
PROC_TYPE _trisetup
|
||||||
|
|
||||||
align 4
|
|
||||||
PUBLIC _trisetup@12
|
|
||||||
_trisetup@12 PROC NEAR
|
|
||||||
.code
|
|
||||||
|
|
||||||
GLIDE_CULLING textequ <0>
|
%define GLIDE_CULLING 0
|
||||||
GLIDE_PACK_RGB textequ <0>
|
%define GLIDE_PACK_RGB 0
|
||||||
GLIDE_PACK_ALPHA textequ <0>
|
%define GLIDE_PACK_ALPHA 0
|
||||||
GLIDE_GENERIC_SETUP textequ <0>
|
%define GLIDE_GENERIC_SETUP 0
|
||||||
INCLUDE xdraw2.inc
|
%INCLUDE "xdraw2.inc"
|
||||||
GLIDE_GENERIC_SETUP textequ <0>
|
%undef GLIDE_GENERIC_SETUP
|
||||||
GLIDE_PACK_ALPHA textequ <0>
|
%undef GLIDE_PACK_ALPHA
|
||||||
GLIDE_PACK_RGB textequ <0>
|
%undef GLIDE_PACK_RGB
|
||||||
GLIDE_CULLING textequ <0>
|
%undef GLIDE_CULLING
|
||||||
|
|
||||||
_trisetup@12 ENDP
|
endp
|
||||||
|
|
||||||
IF GLIDE_PACKED_RGB
|
%IF GLIDE_PACKED_RGB
|
||||||
align 4
|
|
||||||
PUBLIC _trisetup_rgb@12
|
|
||||||
_trisetup_rgb@12 PROC NEAR
|
|
||||||
.code
|
|
||||||
|
|
||||||
GLIDE_CULLING textequ <0>
|
ALIGN 32
|
||||||
GLIDE_PACK_RGB textequ <1>
|
PROC_TYPE _trisetup_rgb
|
||||||
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>
|
|
||||||
|
|
||||||
_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
|
endp
|
||||||
PUBLIC _trisetup_argb@12
|
|
||||||
_trisetup_argb@12 PROC NEAR
|
|
||||||
.code
|
|
||||||
|
|
||||||
GLIDE_CULLING textequ <0>
|
ALIGN 32
|
||||||
GLIDE_PACK_RGB textequ <1>
|
PROC_TYPE _trisetup_argb
|
||||||
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>
|
|
||||||
|
|
||||||
_trisetup_argb@12 ENDP
|
%define GLIDE_CULLING 0
|
||||||
ENDIF ; GLIDE_PACKED_RGB
|
%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
|
endp
|
||||||
END
|
|
||||||
|
%ENDIF ; GLIDE_PACKED_RGB
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
161
glide2x/cvg/glide/src/xos.inc
Normal file
161
glide2x/cvg/glide/src/xos.inc
Normal 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
|
||||||
333
glide2x/cvg/glide/src/xtexdl.asm
Normal file
333
glide2x/cvg/glide/src/xtexdl.asm
Normal 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
|
||||||
242
glide2x/cvg/glide/src/xtexdl.c
Normal file
242
glide2x/cvg/glide/src/xtexdl.c
Normal 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
|
||||||
|
}
|
||||||
@@ -65,6 +65,10 @@ static const char *sourceFormatString[] = {
|
|||||||
"GR_LFB_SRC_FMT_ZA16 "
|
"GR_LFB_SRC_FMT_ZA16 "
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void imageConvert( void *dst,
|
||||||
|
void *src,
|
||||||
|
GrLfbSrcFmt_t format,
|
||||||
|
FxU32 *bpp );
|
||||||
|
|
||||||
int main( int argc, char **argv)
|
int main( int argc, char **argv)
|
||||||
{
|
{
|
||||||
@@ -91,11 +95,6 @@ int main( int argc, char **argv)
|
|||||||
static FxU32 imageWidth;
|
static FxU32 imageWidth;
|
||||||
static FxU32 imageHeight;
|
static FxU32 imageHeight;
|
||||||
|
|
||||||
static void imageConvert( void *dst,
|
|
||||||
void *src,
|
|
||||||
GrLfbSrcFmt_t format,
|
|
||||||
FxU32 *bpp );
|
|
||||||
|
|
||||||
srcfname[0] = 0;
|
srcfname[0] = 0;
|
||||||
dstfname[0] = 0;
|
dstfname[0] = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,10 @@ static const char *sourceFormatString[] = {
|
|||||||
"GR_LFB_SRC_FMT_ZA16 "
|
"GR_LFB_SRC_FMT_ZA16 "
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void imageConvert( void *dst,
|
||||||
|
void *src,
|
||||||
|
GrLfbSrcFmt_t format,
|
||||||
|
FxU32 *bpp );
|
||||||
|
|
||||||
int main( int argc, char **argv) {
|
int main( int argc, char **argv) {
|
||||||
char match;
|
char match;
|
||||||
@@ -80,11 +84,6 @@ int main( int argc, char **argv) {
|
|||||||
static FxU32 imageWidth;
|
static FxU32 imageWidth;
|
||||||
static FxU32 imageHeight;
|
static FxU32 imageHeight;
|
||||||
|
|
||||||
static void imageConvert( void *dst,
|
|
||||||
void *src,
|
|
||||||
GrLfbSrcFmt_t format,
|
|
||||||
FxU32 *bpp );
|
|
||||||
|
|
||||||
/* Process Command Line Arguments */
|
/* Process Command Line Arguments */
|
||||||
while( (rv = tlGetOpt( argc, argv, "bdnr", &match, &remArgs )) ) {
|
while( (rv = tlGetOpt( argc, argv, "bdnr", &match, &remArgs )) ) {
|
||||||
if ( rv == -1 ) {
|
if ( rv == -1 ) {
|
||||||
|
|||||||
23
glide2x/cvg/incsrc/cpuid.h
Normal file
23
glide2x/cvg/incsrc/cpuid.h
Normal 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
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef __WIN32__
|
||||||
#pragma optimize ("",off)
|
#pragma optimize ("",off)
|
||||||
#endif
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -180,3 +180,6 @@ sst1SetGrxClk_Canopus(FxU32* sstbase, FFLOAT grxclk)
|
|||||||
return(RetVal);
|
return(RetVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __WIN32__
|
||||||
|
#pragma optimize ("",on)
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
** Initialization code for initializing supported SST-1 DACs
|
** Initialization code for initializing supported SST-1 DACs
|
||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
#ifdef _WIN32
|
#ifdef __WIN32__
|
||||||
#pragma optimize ("",off)
|
#pragma optimize ("",off)
|
||||||
#endif
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -1369,6 +1369,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitDacIndexedEnable(FxU32 *sstbase,
|
|||||||
return(FXTRUE);
|
return(FXTRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef __WIN32__
|
||||||
#pragma optimize ("",on)
|
#pragma optimize ("",on)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
888
glide2x/cvg/init/fxremap.c
Normal file
888
glide2x/cvg/init/fxremap.c
Normal 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;
|
||||||
|
}
|
||||||
14
glide2x/cvg/init/fxremap.h
Normal file
14
glide2x/cvg/init/fxremap.h
Normal 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
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
** Initialization code for loading SST-1 gamma tables
|
** Initialization code for loading SST-1 gamma tables
|
||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
#ifdef _WIN32
|
#ifdef __WIN32__
|
||||||
#pragma optimize ("",off)
|
#pragma optimize ("",off)
|
||||||
#endif
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -251,6 +251,6 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitGammaTable(FxU32 *sstbase, FxU32 nentries, Fx
|
|||||||
return(FXTRUE);
|
return(FXTRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef __WIN32__
|
||||||
#pragma optimize ("",on)
|
#pragma optimize ("",on)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -252,7 +252,7 @@ gdbg_vprintf (const char *format,va_list args)
|
|||||||
|
|
||||||
#if __DOS32__
|
#if __DOS32__
|
||||||
pciOutputDebugString(msgBuf);
|
pciOutputDebugString(msgBuf);
|
||||||
#elif __WIN32
|
#elif __WIN32__
|
||||||
OutputDebugString(msgBuf);
|
OutputDebugString(msgBuf);
|
||||||
#else
|
#else
|
||||||
fprintf(stderr, msgBuf);
|
fprintf(stderr, msgBuf);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
** configuration information.
|
** configuration information.
|
||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
#ifdef _WIN32
|
#ifdef __WIN32__
|
||||||
#pragma optimize ("",off)
|
#pragma optimize ("",off)
|
||||||
#endif
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -652,6 +652,7 @@ FxBool sst1InitFillDeviceInfo(FxU32 *sstbase, sst1DeviceInfoStruct *info)
|
|||||||
|
|
||||||
return(FXTRUE);
|
return(FXTRUE);
|
||||||
}
|
}
|
||||||
#ifdef _WIN32
|
|
||||||
|
#ifdef __WIN32__
|
||||||
#pragma optimize ("",on)
|
#pragma optimize ("",on)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -19,6 +19,12 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $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
|
#define OFFICIAL 1
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
** Parsing code for grabbing information from "voodoo2.ini" initialization file
|
** Parsing code for grabbing information from "voodoo2.ini" initialization file
|
||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
#ifdef _WIN32
|
#ifdef __WIN32__
|
||||||
#pragma optimize ("",off)
|
#pragma optimize ("",off)
|
||||||
#endif
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -51,21 +51,16 @@
|
|||||||
|
|
||||||
static int sst1InitFgets(char *, FILE *);
|
static int sst1InitFgets(char *, FILE *);
|
||||||
static int sst1InitFgetc(FILE *);
|
static int sst1InitFgetc(FILE *);
|
||||||
#ifndef INIT_LINUX
|
|
||||||
static int sst1InitParseFieldDac(char *);
|
static int sst1InitParseFieldDac(char *);
|
||||||
#endif
|
|
||||||
static int sst1InitParseFieldCfg(char *);
|
static int sst1InitParseFieldCfg(char *);
|
||||||
#ifndef INIT_LINUX
|
|
||||||
static int sst1InitParseDacRdWrString(char *, sst1InitDacStruct *);
|
static int sst1InitParseDacRdWrString(char *, sst1InitDacStruct *);
|
||||||
static int sst1InitParseDacRdWr(char *, sst1InitDacRdWrStruct *);
|
static int sst1InitParseDacRdWr(char *, sst1InitDacRdWrStruct *);
|
||||||
static int sst1InitParseSetVideoString(char *, sst1InitDacStruct *);
|
static int sst1InitParseSetVideoString(char *, sst1InitDacStruct *);
|
||||||
static int sst1InitParseSetMemClkString(char *, sst1InitDacStruct *);
|
static int sst1InitParseSetMemClkString(char *, sst1InitDacStruct *);
|
||||||
static int sst1InitParseSetVideoModeString(char *, sst1InitDacStruct *);
|
static int sst1InitParseSetVideoModeString(char *, sst1InitDacStruct *);
|
||||||
#endif
|
static void sst1InitPrintDacRdWr(sst1InitDacRdWrStruct *, char *);
|
||||||
static void sst1InitToLower(char *string);
|
static void sst1InitToLower(char *string);
|
||||||
#if __DOS32__
|
|
||||||
static void sst1InitFixFilename(char *dst, char *src);
|
static void sst1InitFixFilename(char *dst, char *src);
|
||||||
#endif
|
|
||||||
|
|
||||||
static FxBool checkedFileP = FXFALSE;
|
static FxBool checkedFileP = FXFALSE;
|
||||||
|
|
||||||
@@ -287,6 +282,7 @@ __errExit:
|
|||||||
*/
|
*/
|
||||||
FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() {
|
FX_ENTRY FxBool FX_CALL sst1InitVoodooFile() {
|
||||||
static FxBool retVal = FXFALSE;
|
static FxBool retVal = FXFALSE;
|
||||||
|
int inCfg, inDac;
|
||||||
FILE *file = 0;
|
FILE *file = 0;
|
||||||
char buffer[1024], filename[256];
|
char buffer[1024], filename[256];
|
||||||
char *tmpPtr;
|
char *tmpPtr;
|
||||||
@@ -350,9 +346,90 @@ __errExit:
|
|||||||
}
|
}
|
||||||
#endif
|
#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)
|
static void sst1InitFixFilename(char *dst, char *src)
|
||||||
{
|
{
|
||||||
while(*src) {
|
while(*src) {
|
||||||
@@ -363,7 +440,6 @@ static void sst1InitFixFilename(char *dst, char *src)
|
|||||||
}
|
}
|
||||||
*dst = (char) NULL;
|
*dst = (char) NULL;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static int sst1InitFgets(char *string, FILE *stream)
|
static int sst1InitFgets(char *string, FILE *stream)
|
||||||
@@ -468,7 +544,6 @@ static int sst1InitParseFieldCfg(char *string)
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef INIT_LINUX
|
|
||||||
static int sst1InitParseFieldDac(char *string)
|
static int sst1InitParseFieldDac(char *string)
|
||||||
{
|
{
|
||||||
char *dacFieldReference, *dacFieldValue;
|
char *dacFieldReference, *dacFieldValue;
|
||||||
@@ -669,6 +744,33 @@ static int sst1InitParseDacRdWr(char *string, sst1InitDacRdWrStruct *dacRdWrPtr)
|
|||||||
return(1);
|
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)
|
static int sst1InitParseSetVideoString(char *string, sst1InitDacStruct *dacBase)
|
||||||
{
|
{
|
||||||
int cntr = 0;
|
int cntr = 0;
|
||||||
@@ -869,7 +971,6 @@ static int sst1InitParseSetVideoModeString(char *string,
|
|||||||
}
|
}
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void sst1InitToLower(char *string)
|
static void sst1InitToLower(char *string)
|
||||||
{
|
{
|
||||||
@@ -1019,6 +1120,6 @@ FX_ENTRY char* FX_CALL sst1InitGetenv(char *string)
|
|||||||
}
|
}
|
||||||
#endif /* INIT_DOS */
|
#endif /* INIT_DOS */
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef __WIN32__
|
||||||
#pragma optimize ("",on)
|
#pragma optimize ("",on)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
**
|
**
|
||||||
** Print functions for SST-1 Initialization routines
|
** Print functions for SST-1 Initialization routines
|
||||||
*/
|
*/
|
||||||
#ifdef _WIN32
|
#ifdef __WIN32__
|
||||||
#pragma optimize ("",off)
|
#pragma optimize ("",off)
|
||||||
#endif
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -83,6 +83,6 @@ FX_ENTRY void FX_CALL sst1InitVPrintf(const char *format, va_list args)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef __WIN32__
|
||||||
#pragma optimize ("",on)
|
#pragma optimize ("",on)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#define MANVERSION 1
|
#define MANVERSION 1
|
||||||
#define MANREVISION 1
|
#define MANREVISION 1
|
||||||
#define BUILD_NUMBER 1
|
#define BUILD_NUMBER 1
|
||||||
|
|
||||||
#define VERSIONSTR "Voodoo2 InitCode " "$Revision$" "\0"
|
#define VERSIONSTR "Voodoo2 InitCode " "$Revision$" "\0"
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
** Initialization code for initializing scanline interleaving
|
** Initialization code for initializing scanline interleaving
|
||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
#ifdef _WIN32
|
#ifdef __WIN32__
|
||||||
#pragma optimize ("",off)
|
#pragma optimize ("",off)
|
||||||
#endif
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -89,7 +89,8 @@ FX_EXPORT FxBool FX_CSTYLE sst1InitSli(FxU32 *sstbase0, FxU32 *sstbase1)
|
|||||||
if(/* (sst1M->fbiMemSize != sst1S->fbiMemSize) || */
|
if(/* (sst1M->fbiMemSize != sst1S->fbiMemSize) || */
|
||||||
/*(sst1M->tmuMemSize[0] != sst1S->tmuMemSize[0]) || */
|
/*(sst1M->tmuMemSize[0] != sst1S->tmuMemSize[0]) || */
|
||||||
(sst1M->numberTmus != sst1S->numberTmus) ||
|
(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->fbiRevision != sst1S->fbiRevision) || */
|
||||||
/* (sst1M->tmuRevision != sst1S->tmuRevision) || */
|
/* (sst1M->tmuRevision != sst1S->tmuRevision) || */
|
||||||
(sst1M->fbiVideoStruct != sst1S->fbiVideoStruct)) {
|
(sst1M->fbiVideoStruct != sst1S->fbiVideoStruct)) {
|
||||||
@@ -736,6 +737,6 @@ sst1InitSliPaired(FxU32 *sstbase)
|
|||||||
return sliPaired;
|
return sliPaired;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef __WIN32__
|
||||||
#pragma optimize ("",on)
|
#pragma optimize ("",on)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -135,13 +135,13 @@
|
|||||||
** SSTV2_VFIFO_THRESH {0-31} Select video fifo threshold
|
** SSTV2_VFIFO_THRESH {0-31} Select video fifo threshold
|
||||||
** SSTV2_VSYNC hex Specify value of vSync video register
|
** SSTV2_VSYNC hex Specify value of vSync video register
|
||||||
** SSTV2_NOREMAP 0 Don't try to remap single board sli.
|
** 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_FILE name Filename used in place of "voodoo2.ini"
|
||||||
** VOODOO2_PATH path Path used to locate "voodoo2.ini" file
|
** VOODOO2_PATH path Path used to locate "voodoo2.ini" file
|
||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
|
#ifdef __WIN32__
|
||||||
#ifdef _WIN32
|
|
||||||
#pragma optimize ("",off)
|
#pragma optimize ("",off)
|
||||||
#endif
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -158,6 +158,7 @@
|
|||||||
#define SST1INIT_ALLOCATE // Allocate variables in sst1init.h
|
#define SST1INIT_ALLOCATE // Allocate variables in sst1init.h
|
||||||
#define FX_DLL_DEFINITION
|
#define FX_DLL_DEFINITION
|
||||||
#include <fxdll.h>
|
#include <fxdll.h>
|
||||||
|
|
||||||
#if !macintosh && !__linux__
|
#if !macintosh && !__linux__
|
||||||
#include <fxremap.h>
|
#include <fxremap.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -209,11 +210,13 @@ FX_EXPORT FxU32 * FX_CSTYLE sst1InitMapBoardDirect(FxU32 BoardNumber,
|
|||||||
else
|
else
|
||||||
deviceID = 0x0002;
|
deviceID = 0x0002;
|
||||||
|
|
||||||
|
#if !DIRECTX
|
||||||
// Open PCI library (necessary for multiple calls to init routines, after
|
// Open PCI library (necessary for multiple calls to init routines, after
|
||||||
// PCI library is closed by pciClose() call in sst1InitShutdown().
|
// PCI library is closed by pciClose() call in sst1InitShutdown().
|
||||||
//
|
//
|
||||||
// NB: It is safe to do this even if we never called pciClose.
|
// NB: It is safe to do this even if we never called pciClose.
|
||||||
pciOpen();
|
pciOpen();
|
||||||
|
#endif
|
||||||
|
|
||||||
/* NB: firstTime does not get cleared until we actually find a
|
/* NB: firstTime does not get cleared until we actually find a
|
||||||
* board and get one mapped (A little weird to begin w/, but
|
* 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")))
|
if(GETENV(("SSTV2_TEXMAP_DISABLE")))
|
||||||
INIT_PRINTF(("sst1InitRegisters() WARNING: Disabling texture mapping\n"));
|
INIT_PRINTF(("sst1InitRegisters() WARNING: Disabling texture mapping\n"));
|
||||||
|
|
||||||
|
#if !DIRECTX
|
||||||
// Open PCI library (necessary for multiple calls to init routines, after
|
// Open PCI library (necessary for multiple calls to init routines, after
|
||||||
// PCI library is closed by pciClose() call in sst1InitShutdown()
|
// PCI library is closed by pciClose() call in sst1InitShutdown()
|
||||||
pciOpen();
|
pciOpen();
|
||||||
|
#endif
|
||||||
|
|
||||||
// Enable writes to the FBIINIT registers
|
// Enable writes to the FBIINIT registers
|
||||||
// Do not allow writes into the pci fifo until everything is reset
|
// 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;
|
return retVal;
|
||||||
} // sst1InitSetCachingAMD
|
} // sst1InitSetCachingAMD
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef __WIN32__
|
||||||
#pragma optimize ("",on)
|
#pragma optimize ("",on)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -83,9 +83,7 @@
|
|||||||
|
|
||||||
#else /* DIRECTX */
|
#else /* DIRECTX */
|
||||||
#include "ddglobal.h"
|
#include "ddglobal.h"
|
||||||
#ifdef _WIN32
|
|
||||||
#pragma optimize ("",off) /* ddglobal.h tuns this on for retail builds */
|
#pragma optimize ("",off) /* ddglobal.h tuns this on for retail builds */
|
||||||
#endif
|
|
||||||
#undef INIT_PRINTF
|
#undef INIT_PRINTF
|
||||||
#undef INIT_INFO
|
#undef INIT_INFO
|
||||||
#undef GETENV
|
#undef GETENV
|
||||||
@@ -102,7 +100,8 @@
|
|||||||
#define INIT_PRINTF 1 ? (void) 0 : (void)
|
#define INIT_PRINTF 1 ? (void) 0 : (void)
|
||||||
#endif
|
#endif
|
||||||
#define INIT_INFO(A)
|
#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 ATOI(A) ddatoi(A)
|
||||||
#define ATOF(A) ddatof(A)
|
#define ATOF(A) ddatof(A)
|
||||||
#define FTOL(A) ddftol(A)
|
#define FTOL(A) ddftol(A)
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
** Utility routines for SST-1 Initialization code
|
** Utility routines for SST-1 Initialization code
|
||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
#ifdef _WIN32
|
#ifdef __WIN32__
|
||||||
#pragma optimize ("",off)
|
#pragma optimize ("",off)
|
||||||
#endif
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -1180,6 +1180,6 @@ void sst1InitDrawRectUsingTris(FxU32 *sstbase, FxU32 x, FxU32 y, FxU32 tSize)
|
|||||||
ISET(sst->triangleCMD, 0xFFFFFFFF);
|
ISET(sst->triangleCMD, 0xFFFFFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef __WIN32__
|
||||||
#pragma optimize ("",on)
|
#pragma optimize ("",on)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
** Initialization code for initializing SST-1 video unit
|
** Initialization code for initializing SST-1 video unit
|
||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
#ifdef _WIN32
|
#ifdef __WIN32__
|
||||||
#pragma optimize ("",off)
|
#pragma optimize ("",off)
|
||||||
#endif
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -1462,6 +1462,6 @@ setDelays:
|
|||||||
return(FXTRUE);
|
return(FXTRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef __WIN32__
|
||||||
#pragma optimize ("",on)
|
#pragma optimize ("",on)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -19,9 +19,15 @@
|
|||||||
;;
|
;;
|
||||||
;; $Header$
|
;; $Header$
|
||||||
;; $Log$
|
;; $Log$
|
||||||
|
;; 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
|
;; 4 4/06/99 3:54p Dow
|
||||||
;; Phantom Menace and other fixes.
|
;; Alt tab again.
|
||||||
;;
|
;;
|
||||||
;; 9 3/10/99 10:40a Peter
|
;; 9 3/10/99 10:40a Peter
|
||||||
;; detect katmai-ness
|
;; detect katmai-ness
|
||||||
@@ -45,10 +51,7 @@
|
|||||||
;;
|
;;
|
||||||
;;
|
;;
|
||||||
|
|
||||||
TITLE cpudtect.asm
|
%include "xos.inc"
|
||||||
|
|
||||||
.586P
|
|
||||||
.model FLAT,C ; Flat memory, mangle publics with leading '_'
|
|
||||||
|
|
||||||
;; Data for data segment goes here
|
;; Data for data segment goes here
|
||||||
;_DATA SEGMENT DWORD USE32 PUBLIC 'DATA';
|
;_DATA SEGMENT DWORD USE32 PUBLIC 'DATA';
|
||||||
@@ -56,14 +59,14 @@ TITLE cpudtect.asm
|
|||||||
|
|
||||||
;;; Some useful constants
|
;;; Some useful constants
|
||||||
; CPU Type
|
; CPU Type
|
||||||
CPUTypeUnknown = 0ffffffffh
|
CPUTypeUnknown equ 0ffffffffh
|
||||||
CPUTypePrePent = 4h
|
CPUTypePrePent equ 4h
|
||||||
CPUTypeP5 = 5h
|
CPUTypeP5 equ 5h
|
||||||
CPUTypeP6 = 6h
|
CPUTypeP6 equ 6h
|
||||||
|
|
||||||
;;; References to external data:
|
;;; References to external data:
|
||||||
|
|
||||||
_TEXT SEGMENT
|
segment TEXT
|
||||||
;;
|
;;
|
||||||
;; _cpu_detect_asm - detect the type of CPU
|
;; _cpu_detect_asm - detect the type of CPU
|
||||||
;;
|
;;
|
||||||
@@ -73,10 +76,8 @@ _TEXT SEGMENT
|
|||||||
;;
|
;;
|
||||||
;; returns 4 for non-pen
|
;; returns 4 for non-pen
|
||||||
|
|
||||||
PUBLIC _cpu_detect_asm
|
proc _cpu_detect_asm
|
||||||
_cpu_detect_asm PROC NEAR
|
|
||||||
P6Stuff:
|
P6Stuff:
|
||||||
.586
|
|
||||||
push esi ; save registers that are not volatile
|
push esi ; save registers that are not volatile
|
||||||
push edi
|
push edi
|
||||||
push ebx
|
push ebx
|
||||||
@@ -276,45 +277,38 @@ UnknownVendor:
|
|||||||
jmp DoneCpu
|
jmp DoneCpu
|
||||||
|
|
||||||
|
|
||||||
_cpu_detect_asm ENDP
|
endp
|
||||||
|
|
||||||
|
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
; this routine sets the precision to single
|
; this routine sets the precision to single
|
||||||
; which effects all adds, mults, and divs
|
; which effects all adds, mults, and divs
|
||||||
align 4 ;
|
align 4 ;
|
||||||
PUBLIC single_precision_asm
|
proc single_precision_asm
|
||||||
single_precision_asm PROC NEAR
|
|
||||||
.586
|
|
||||||
push eax ; make room
|
push eax ; make room
|
||||||
fnclex ; clear pending exceptions
|
fnclex ; clear pending exceptions
|
||||||
fstcw WORD PTR [esp]
|
fstcw WORD [esp]
|
||||||
mov eax, DWORD PTR [esp]
|
mov eax, DWORD [esp]
|
||||||
and eax, 0000fcffh ; clear bits 9:8
|
and eax, 0000fcffh ; clear bits 9:8
|
||||||
mov DWORD PTR [esp], eax
|
mov DWORD [esp], eax
|
||||||
fldcw WORD PTR [esp]
|
fldcw WORD [esp]
|
||||||
pop eax
|
pop eax
|
||||||
ret 0
|
ret
|
||||||
single_precision_asm ENDP
|
endp
|
||||||
|
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
; this routine sets the precision to double
|
; this routine sets the precision to double
|
||||||
; which effects all adds, mults, and divs
|
; which effects all adds, mults, and divs
|
||||||
align 4 ;
|
align 4 ;
|
||||||
PUBLIC double_precision_asm
|
proc double_precision_asm
|
||||||
double_precision_asm PROC NEAR
|
|
||||||
.586
|
|
||||||
push eax ; make room
|
push eax ; make room
|
||||||
fnclex ; clear pending exceptions
|
fnclex ; clear pending exceptions
|
||||||
fstcw WORD PTR [esp]
|
fstcw WORD [esp]
|
||||||
mov eax, DWORD PTR [esp]
|
mov eax, DWORD [esp]
|
||||||
and eax, 0000fcffh ; clear bits 9:8
|
and eax, 0000fcffh ; clear bits 9:8
|
||||||
or eax, 000002ffh ; set 9:8 to 10
|
or eax, 000002ffh ; set 9:8 to 10
|
||||||
mov DWORD PTR [esp], eax
|
mov DWORD [esp], eax
|
||||||
fldcw WORD PTR [esp]
|
fldcw WORD [esp]
|
||||||
pop eax
|
pop eax
|
||||||
ret 0
|
ret
|
||||||
double_precision_asm ENDP
|
endp
|
||||||
|
|
||||||
_TEXT ENDS
|
|
||||||
END
|
|
||||||
|
|||||||
@@ -19,6 +19,12 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $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
|
** 3 3/17/99 6:16p Dow
|
||||||
** Phantom Menace and other fixes.
|
** Phantom Menace and other fixes.
|
||||||
@@ -2001,7 +2007,7 @@ _grFifoFWriteDebug((FxU32) a, (float) b, (FxU32) c)
|
|||||||
__stwbrx( *((FxU32*)&temp), (void*)&(d), 0 ); \
|
__stwbrx( *((FxU32*)&temp), (void*)&(d), 0 ); \
|
||||||
}
|
}
|
||||||
# define SET_LINEAR(d, s) SET((d), (s))
|
# 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)))
|
(((FxU32)(s)) << 16UL)))
|
||||||
# define SET_LINEAR_8(d, s) ((d) = (s))
|
# define SET_LINEAR_8(d, s) ((d) = (s))
|
||||||
# else /* !defined(__MWERKS__) && POWERPC */
|
# else /* !defined(__MWERKS__) && POWERPC */
|
||||||
@@ -3005,7 +3011,7 @@ do { \
|
|||||||
#define REG_GROUP_SETF_CLAMP(__regBase, __regAddr, __val) \
|
#define REG_GROUP_SETF_CLAMP(__regBase, __regAddr, __val) \
|
||||||
do { \
|
do { \
|
||||||
const FxU32 fpClampVal = FP_FLOAT_CLAMP(__val); \
|
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); \
|
SET(((FxU32*)(__regBase))[offsetof(SstRegs, __regAddr) >> 2], fpClampVal); \
|
||||||
GR_INC_SIZE(sizeof(FxU32)); \
|
GR_INC_SIZE(sizeof(FxU32)); \
|
||||||
} while(0)
|
} while(0)
|
||||||
@@ -3353,16 +3359,16 @@ double_precision_asm(void);
|
|||||||
//#define GLIDE3_DEBUG 1
|
//#define GLIDE3_DEBUG 1
|
||||||
#endif
|
#endif
|
||||||
#ifdef GLIDE3_DEBUG
|
#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_LOD_TRANSLATE(lod) (lod)
|
||||||
#define G3_ASPECT_TRANSLATE(aspect) (aspect)
|
#define G3_ASPECT_TRANSLATE(aspect) (aspect)
|
||||||
#else
|
#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_LOD_TRANSLATE(lod) (0x8-lod)
|
||||||
#define G3_ASPECT_TRANSLATE(aspect) (0x3-(aspect))
|
#define G3_ASPECT_TRANSLATE(aspect) (0x3-(aspect))
|
||||||
#endif /* GLIDE3_DEBUG */
|
#endif /* GLIDE3_DEBUG */
|
||||||
#else
|
#else
|
||||||
#define TEX_INFO(ptr,field) ptr##field
|
#define TEX_INFO(ptr,field) ptr.field
|
||||||
#define G3_LOD_TRANSLATE(lod) (lod)
|
#define G3_LOD_TRANSLATE(lod) (lod)
|
||||||
#define G3_ASPECT_TRANSLATE(aspect) (aspect)
|
#define G3_ASPECT_TRANSLATE(aspect) (aspect)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $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
|
** Revision 1.1.1.1 1999/12/07 21:49:27 joseph
|
||||||
** Initial checkin into SourceForge.
|
** Initial checkin into SourceForge.
|
||||||
**
|
**
|
||||||
@@ -299,18 +302,13 @@ GR_DIENTRY(gu3dfGetInfo, FxBool,
|
|||||||
/*
|
/*
|
||||||
** determine the color format of the input image
|
** determine the color format of the input image
|
||||||
*/
|
*/
|
||||||
#ifdef __GNUC__
|
|
||||||
/* This function is not found in libgcc.a */
|
|
||||||
{
|
{
|
||||||
char* tempStr = (char*)color_format;
|
char *tempStr = (char*)color_format;
|
||||||
while(*tempStr != '\0') *tempStr++ = toupper(*tempStr);
|
while (*tempStr != '\0') {
|
||||||
|
*tempStr = toupper(*tempStr);
|
||||||
|
tempStr++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
{
|
|
||||||
extern char* strupr(char*);
|
|
||||||
strupr(color_format);
|
|
||||||
}
|
|
||||||
#endif /* __GNUC__ */
|
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
format_found = FXFALSE;
|
format_found = FXFALSE;
|
||||||
|
|||||||
@@ -20,6 +20,9 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $Log$
|
||||||
|
** Revision 1.1.1.1 1999/12/07 21:49:27 joseph
|
||||||
|
** Initial checkin into SourceForge.
|
||||||
|
**
|
||||||
**
|
**
|
||||||
** 3 3/17/99 6:16p Dow
|
** 3 3/17/99 6:16p Dow
|
||||||
** Phantom Menace and other fixes.
|
** Phantom Menace and other fixes.
|
||||||
@@ -159,35 +162,25 @@ GR_DIENTRY(grErrorSetCallback, void,
|
|||||||
GrErrorCallback = function;
|
GrErrorCallback = function;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WIN32__
|
|
||||||
void
|
void
|
||||||
_grErrorDefaultCallback( const char *s, FxBool fatal )
|
_grErrorDefaultCallback( const char *s, FxBool fatal )
|
||||||
{
|
{
|
||||||
if ( fatal ) {
|
if ( fatal ) {
|
||||||
GDBG_ERROR("glide", s);
|
GDBG_ERROR("glide", s);
|
||||||
grGlideShutdown();
|
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)
|
#ifdef __WIN32__
|
||||||
{
|
MessageBox(NULL, s, NULL, MB_OK);
|
||||||
Str255 errBuf;
|
#elif (GLIDE_PLATFORM & GLIDE_OS_MACOS)
|
||||||
|
{
|
||||||
errBuf[0] = sprintf((char*)(errBuf + 1), "%s", s);
|
Str255 errBuf;
|
||||||
DebugStr(errBuf);
|
|
||||||
}
|
errBuf[0] = sprintf((char*)(errBuf + 1), "%s", s);
|
||||||
|
DebugStr(errBuf);
|
||||||
|
}
|
||||||
#endif /* (GLIDE_PLATFORM * GLIDE_OS_MACOS) */
|
#endif /* (GLIDE_PLATFORM * GLIDE_OS_MACOS) */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __DOS__
|
#ifdef __DOS__
|
||||||
int _guHeapCheck( void )
|
int _guHeapCheck( void )
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $Log$
|
||||||
|
** Revision 1.1.1.1 1999/12/07 21:49:28 joseph
|
||||||
|
** Initial checkin into SourceForge.
|
||||||
|
**
|
||||||
**
|
**
|
||||||
** 3 3/17/99 6:16p Dow
|
** 3 3/17/99 6:16p Dow
|
||||||
** Phantom Menace and other fixes.
|
** Phantom Menace and other fixes.
|
||||||
@@ -239,9 +242,9 @@ static void
|
|||||||
downloadTexture(Texture *texture, Gu3dfInfo *info)
|
downloadTexture(Texture *texture, Gu3dfInfo *info)
|
||||||
{
|
{
|
||||||
texture->info.data = info->data;
|
texture->info.data = info->data;
|
||||||
TEX_INFO(texture->info.,smallLod) = info->header.small_lod;
|
TEX_INFO(texture->info,smallLod) = info->header.small_lod;
|
||||||
TEX_INFO(texture->info.,largeLod) = info->header.large_lod;
|
TEX_INFO(texture->info,largeLod) = info->header.large_lod;
|
||||||
TEX_INFO(texture->info.,aspectRatio) = info->header.aspect_ratio;
|
TEX_INFO(texture->info,aspectRatio) = info->header.aspect_ratio;
|
||||||
texture->info.format = info->header.format;
|
texture->info.format = info->header.format;
|
||||||
|
|
||||||
texture->addr = nextFreeBase;
|
texture->addr = nextFreeBase;
|
||||||
|
|||||||
@@ -1,279 +1,318 @@
|
|||||||
|
# Linux makefile for Glide2/H3
|
||||||
|
# This makefile MUST be processed by GNU make!!!
|
||||||
#
|
#
|
||||||
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
# $Id$
|
||||||
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
#
|
||||||
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
# Copyright (c) 2003 - Daniel Borca
|
||||||
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
# Email : dborca@users.sourceforge.net
|
||||||
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
# Web : http://www.geocities.com/dborca
|
||||||
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
#
|
||||||
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
# Copyright (c) 2006 - Guillem Jover <guillem@hadrons.org>
|
||||||
# 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.
|
|
||||||
#
|
#
|
||||||
|
|
||||||
# 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
|
# Available options:
|
||||||
$(CC) -o $@ fxgasm.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) \
|
#
|
||||||
-I$(BUILD_ROOT)/$(FX_GLIDE_HW)/include -I$(BUILD_ROOT)/swlibs/include \
|
# Environment variables:
|
||||||
$(LDFLAGS)
|
# 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
|
||||||
|
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 -W
|
||||||
|
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
|
||||||
|
OPTFLAGS ?= -O2 -ffast-math
|
||||||
|
else
|
||||||
|
CFLAGS += -DGLIDE_USE_C_TRISETUP
|
||||||
|
OPTFLAGS ?= -O2 -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_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,-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 $<
|
||||||
|
|
||||||
|
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) $< $@
|
||||||
|
|
||||||
|
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
|
||||||
|
|
||||||
|
fxinline.h: fxgasm
|
||||||
|
./$< -inline > $@
|
||||||
|
|
||||||
fxgasm.h: fxgasm
|
fxgasm.h: fxgasm
|
||||||
./fxgasm -hex > fxgasm.h
|
./$< -hex > $@
|
||||||
fxinline.h: fxgasm
|
|
||||||
./fxgasm -inline > fxinline.h
|
|
||||||
|
|
||||||
|
fxgasm: fxgasm.c
|
||||||
|
$(CC) -o $@ $(CFLAGS) $<
|
||||||
|
|
||||||
#--------------------------------------------------------------------------
|
###############################################################################
|
||||||
# special rules for making FXBLDNO.H
|
# clean, realclean
|
||||||
#
|
###############################################################################
|
||||||
|
|
||||||
fxbldno: fxbldno.c $(HEADERS) $(PRIVATE_HEADERS)
|
clean:
|
||||||
$(CC) -o $@ fxbldno.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) $(LDFLAGS)
|
-$(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/linutil.o $(FX_GLIDE_SW)/fxmisc/linutil.lo
|
||||||
|
-$(RM) fxinline.h
|
||||||
|
-$(RM) fxgasm.h
|
||||||
|
|
||||||
fxbldno.h: fxbldno
|
realclean: clean
|
||||||
./fxbldno > fxbldno.h
|
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB)
|
||||||
|
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SHARED)
|
||||||
ifneq ($(FX_GLIDE_CTRISETUP),1)
|
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO)
|
||||||
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
|
|
||||||
|
|||||||
@@ -20,7 +20,10 @@
|
|||||||
|
|
||||||
/* $Header$ */
|
/* $Header$ */
|
||||||
/* $Revision$ */
|
/* $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 */
|
/* 11 10/05/98 7:43p Peter */
|
||||||
/* 3DNow!(tm) happiness everywhere */
|
/* 3DNow!(tm) happiness everywhere */
|
||||||
@@ -122,10 +125,12 @@ PROC_TYPE(cull):
|
|||||||
#define GLIDE_GENERIC_SETUP 0
|
#define GLIDE_GENERIC_SETUP 0
|
||||||
#include "xdraw2.inc.S"
|
#include "xdraw2.inc.S"
|
||||||
#undef cull
|
#undef cull
|
||||||
#define GLIDE_GENERIC_SETUP 0
|
#undef GLIDE_GENERIC_SETUP
|
||||||
#define GLIDE_PACK_ALPHA 0
|
#undef GLIDE_PACK_ALPHA
|
||||||
#define GLIDE_PACK_RGB 0
|
#undef GLIDE_PACK_RGB
|
||||||
#define GLIDE_CULLING 0
|
#undef GLIDE_CULLING
|
||||||
|
|
||||||
|
#undef LOCAL
|
||||||
|
|
||||||
END_PROC_TYPE(cull):
|
END_PROC_TYPE(cull):
|
||||||
.size PROC_TYPE(cull),END_PROC_TYPE(cull)-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_PACK_ALPHA 0
|
||||||
#define GLIDE_GENERIC_SETUP 0
|
#define GLIDE_GENERIC_SETUP 0
|
||||||
#include "xdraw2.inc.S"
|
#include "xdraw2.inc.S"
|
||||||
#define GLIDE_GENERIC_SETUP 0
|
#undef GLIDE_GENERIC_SETUP
|
||||||
#define GLIDE_PACK_ALPHA 0
|
#undef GLIDE_PACK_ALPHA
|
||||||
#define GLIDE_PACK_RGB 0
|
#undef GLIDE_PACK_RGB
|
||||||
#define GLIDE_CULLING 0
|
#undef GLIDE_CULLING
|
||||||
|
|
||||||
|
#undef LOCAL
|
||||||
|
|
||||||
END_PROC_TYPE(cull_rgb):
|
END_PROC_TYPE(cull_rgb):
|
||||||
.size PROC_TYPE(cull_rgb),END_PROC_TYPE(cull_rgb)-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_PACK_ALPHA 1
|
||||||
#define GLIDE_GENERIC_SETUP 0
|
#define GLIDE_GENERIC_SETUP 0
|
||||||
#include "xdraw2.inc.S"
|
#include "xdraw2.inc.S"
|
||||||
#define GLIDE_GENERIC_SETUP 0
|
#undef GLIDE_GENERIC_SETUP
|
||||||
#define GLIDE_PACK_ALPHA 0
|
#undef GLIDE_PACK_ALPHA
|
||||||
#define GLIDE_PACK_RGB 0
|
#undef GLIDE_PACK_RGB
|
||||||
#define GLIDE_CULLING 0
|
#undef GLIDE_CULLING
|
||||||
|
|
||||||
END_PROC_TYPE(cull_argb):
|
END_PROC_TYPE(cull_argb):
|
||||||
.size PROC_TYPE(cull_argb),END_PROC_TYPE(cull_argb)-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_PACK_ALPHA 0
|
||||||
#define GLIDE_GENERIC_SETUP 0
|
#define GLIDE_GENERIC_SETUP 0
|
||||||
#include "xdraw2.inc.S"
|
#include "xdraw2.inc.S"
|
||||||
#define GLIDE_GENERIC_SETUP 0
|
#undef GLIDE_GENERIC_SETUP
|
||||||
#define GLIDE_PACK_ALPHA 0
|
#undef GLIDE_PACK_ALPHA
|
||||||
#define GLIDE_PACK_RGB 0
|
#undef GLIDE_PACK_RGB
|
||||||
#define GLIDE_CULLING 0
|
#undef GLIDE_CULLING
|
||||||
|
|
||||||
|
#undef LOCAL
|
||||||
|
|
||||||
END_PROC_TYPE(Default):
|
END_PROC_TYPE(Default):
|
||||||
.size PROC_TYPE(Default),END_PROC_TYPE(Default)-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_PACK_ALPHA 0
|
||||||
#define GLIDE_GENERIC_SETUP 0
|
#define GLIDE_GENERIC_SETUP 0
|
||||||
#include "xdraw2.inc.S"
|
#include "xdraw2.inc.S"
|
||||||
#define GLIDE_GENERIC_SETUP 0
|
#undef GLIDE_GENERIC_SETUP
|
||||||
#define GLIDE_PACK_ALPHA 0
|
#undef GLIDE_PACK_ALPHA
|
||||||
#define GLIDE_PACK_RGB 0
|
#undef GLIDE_PACK_RGB
|
||||||
#define GLIDE_CULLING 0
|
#undef GLIDE_CULLING
|
||||||
|
|
||||||
|
#undef LOCAL
|
||||||
|
|
||||||
END_PROC_TYPE(rgb):
|
END_PROC_TYPE(rgb):
|
||||||
.size PROC_TYPE(rgb),END_PROC_TYPE(rgb)-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_PACK_ALPHA 1
|
||||||
#define GLIDE_GENERIC_SETUP 0
|
#define GLIDE_GENERIC_SETUP 0
|
||||||
#include "xdraw2.inc.S"
|
#include "xdraw2.inc.S"
|
||||||
#define GLIDE_GENERIC_SETUP 0
|
#undef GLIDE_GENERIC_SETUP
|
||||||
#define GLIDE_PACK_ALPHA 0
|
#undef GLIDE_PACK_ALPHA
|
||||||
#define GLIDE_PACK_RGB 0
|
#undef GLIDE_PACK_RGB
|
||||||
#define GLIDE_CULLING 0
|
#undef GLIDE_CULLING
|
||||||
|
|
||||||
|
#undef LOCAL
|
||||||
|
|
||||||
END_PROC_TYPE(argb):
|
END_PROC_TYPE(argb):
|
||||||
.size PROC_TYPE(argb),END_PROC_TYPE(argb)-PROC_TYPE(argb)
|
.size PROC_TYPE(argb),END_PROC_TYPE(argb)-PROC_TYPE(argb)
|
||||||
|
|||||||
@@ -21,7 +21,10 @@
|
|||||||
|
|
||||||
/* $Header$ */
|
/* $Header$ */
|
||||||
/* $Revision$ */
|
/* $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 */
|
/* 2 10/30/97 6:53p Peter */
|
||||||
/* first real cut at tri asm */
|
/* first real cut at tri asm */
|
||||||
@@ -38,13 +41,18 @@
|
|||||||
|
|
||||||
.file "xdraw2.inc"
|
.file "xdraw2.inc"
|
||||||
|
|
||||||
#ifdef GL_AMD3D
|
#ifndef GR_FIFO_WRITE_MACRO
|
||||||
|
#define GR_FIFO_WRITE_MACRO
|
||||||
.MACRO GR_FIFO_WRITE __addr __offset __data
|
.MACRO GR_FIFO_WRITE __addr __offset __data
|
||||||
mov \__data , \__offset(\__addr)
|
mov \__data , \__offset(\__addr)
|
||||||
.ENDM /* GR_FIFO_WRITE */
|
.ENDM /* GR_FIFO_WRITE */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef GL_AMD3D
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef MM1_FIFO_MACROS
|
||||||
|
#define MM1_FIFO_MACROS
|
||||||
.MACRO WRITE_MM1_FIFO_ALIGNED
|
.MACRO WRITE_MM1_FIFO_ALIGNED
|
||||||
movq %mm1 , (%ebp) /* store current param | previous param */
|
movq %mm1 , (%ebp) /* store current param | previous param */
|
||||||
.ENDM /* WRITE_MM1_FIFO_ALIGNED */
|
.ENDM /* WRITE_MM1_FIFO_ALIGNED */
|
||||||
@@ -52,6 +60,7 @@
|
|||||||
.MACRO WRITE_MM1LOW_FIFO
|
.MACRO WRITE_MM1LOW_FIFO
|
||||||
movd %mm1 , (%ebp) /* store current param | previous param */
|
movd %mm1 , (%ebp) /* store current param | previous param */
|
||||||
.ENDM /* WRITE_MM1LOW_FIFO */
|
.ENDM /* WRITE_MM1LOW_FIFO */
|
||||||
|
#endif
|
||||||
|
|
||||||
#define gc %edi /* points to graphics context */
|
#define gc %edi /* points to graphics context */
|
||||||
#define fifo %ebp /* points to fifo entries */
|
#define fifo %ebp /* points to fifo entries */
|
||||||
@@ -1100,10 +1109,6 @@ LOCAL(Area_Computation):
|
|||||||
#define packCol %edi
|
#define packCol %edi
|
||||||
#define tempVal %edi
|
#define tempVal %edi
|
||||||
|
|
||||||
.MACRO GR_FIFO_WRITE __addr __offset __data
|
|
||||||
mov \__data , \__offset(\__addr)
|
|
||||||
.ENDM /* GR_FIFO_WRITE */
|
|
||||||
|
|
||||||
.align 4
|
.align 4
|
||||||
LOCAL(__triBegin):
|
LOCAL(__triBegin):
|
||||||
mov fifoPtr(gc) , fifo /* Fetch Fifo Ptr */
|
mov fifoPtr(gc) , fifo /* Fetch Fifo Ptr */
|
||||||
|
|||||||
145
glide2x/h3/glide/src/xos.inc
Normal file
145
glide2x/h3/glide/src/xos.inc
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
;
|
||||||
|
; 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
|
||||||
|
|
||||||
|
%endif
|
||||||
|
|
||||||
|
;---------------------------------------
|
||||||
|
; DJGPP
|
||||||
|
;---------------------------------------
|
||||||
|
%if XOS == XOS_DJGPP
|
||||||
|
|
||||||
|
%define TEXT .text
|
||||||
|
%define DATA .data
|
||||||
|
%define CONST .rodata
|
||||||
|
|
||||||
|
%endif
|
||||||
|
|
||||||
|
;---------------------------------------
|
||||||
|
; Linux
|
||||||
|
;---------------------------------------
|
||||||
|
%if XOS == XOS_LINUX
|
||||||
|
|
||||||
|
%define TEXT .text align=32
|
||||||
|
%define DATA .data align=32
|
||||||
|
%define CONST .rodata align=32
|
||||||
|
|
||||||
|
%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
|
||||||
|
|
||||||
|
%endif
|
||||||
@@ -65,6 +65,10 @@ static const char *sourceFormatString[] = {
|
|||||||
"GR_LFB_SRC_FMT_ZA16 "
|
"GR_LFB_SRC_FMT_ZA16 "
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void imageConvert( void *dst,
|
||||||
|
void *src,
|
||||||
|
GrLfbSrcFmt_t format,
|
||||||
|
FxU32 *bpp );
|
||||||
|
|
||||||
int main( int argc, char **argv)
|
int main( int argc, char **argv)
|
||||||
{
|
{
|
||||||
@@ -91,11 +95,6 @@ int main( int argc, char **argv)
|
|||||||
static FxU32 imageWidth;
|
static FxU32 imageWidth;
|
||||||
static FxU32 imageHeight;
|
static FxU32 imageHeight;
|
||||||
|
|
||||||
static void imageConvert( void *dst,
|
|
||||||
void *src,
|
|
||||||
GrLfbSrcFmt_t format,
|
|
||||||
FxU32 *bpp );
|
|
||||||
|
|
||||||
srcfname[0] = 0;
|
srcfname[0] = 0;
|
||||||
dstfname[0] = 0;
|
dstfname[0] = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,10 @@ static const char *sourceFormatString[] = {
|
|||||||
"GR_LFB_SRC_FMT_ZA16 "
|
"GR_LFB_SRC_FMT_ZA16 "
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void imageConvert( void *dst,
|
||||||
|
void *src,
|
||||||
|
GrLfbSrcFmt_t format,
|
||||||
|
FxU32 *bpp );
|
||||||
|
|
||||||
int main( int argc, char **argv) {
|
int main( int argc, char **argv) {
|
||||||
char match;
|
char match;
|
||||||
@@ -80,11 +84,6 @@ int main( int argc, char **argv) {
|
|||||||
static FxU32 imageWidth;
|
static FxU32 imageWidth;
|
||||||
static FxU32 imageHeight;
|
static FxU32 imageHeight;
|
||||||
|
|
||||||
static void imageConvert( void *dst,
|
|
||||||
void *src,
|
|
||||||
GrLfbSrcFmt_t format,
|
|
||||||
FxU32 *bpp );
|
|
||||||
|
|
||||||
/* Process Command Line Arguments */
|
/* Process Command Line Arguments */
|
||||||
while( (rv = tlGetOpt( argc, argv, "bdnr", &match, &remArgs )) ) {
|
while( (rv = tlGetOpt( argc, argv, "bdnr", &match, &remArgs )) ) {
|
||||||
if ( rv == -1 ) {
|
if ( rv == -1 ) {
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $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
|
** Revision 1.1.1.1 1999/12/07 21:49:43 joseph
|
||||||
** Initial checkin into SourceForge.
|
** Initial checkin into SourceForge.
|
||||||
**
|
**
|
||||||
@@ -38,8 +41,8 @@
|
|||||||
** I/O Macros
|
** I/O Macros
|
||||||
*/
|
*/
|
||||||
#warning Here!
|
#warning Here!
|
||||||
#define HWC_IO_LOAD(regInfo, reg, val)
|
#define HWC_IO_LOAD(regInfo, reg, val) \
|
||||||
GDBG_INFO(120, "%s: Storing 0x%x to IO Register %s\n",
|
GDBG_INFO(120, "%s: Storing 0x%x to IO Register %s\n", \
|
||||||
((SstIORegs *) regInfo.ioMemBase)->
|
((SstIORegs *) regInfo.ioMemBase)->
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,62 +1,74 @@
|
|||||||
|
# Linux makefile for Glide2 and Texus2
|
||||||
#
|
#
|
||||||
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
# $Id$
|
||||||
# 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
|
# Copyright (c) 2003 - Daniel Borca
|
||||||
# RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
|
# Email : dborca@users.sourceforge.net
|
||||||
# TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
# Web : http://www.geocities.com/dborca
|
||||||
# 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
|
# Copyright (c) 2006 - Guillem Jover <guillem@hadrons.org>
|
||||||
#
|
|
||||||
# $Revision$
|
|
||||||
# $Date$
|
|
||||||
#
|
#
|
||||||
|
|
||||||
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.
|
.PHONY: all clean realclean
|
||||||
ifeq ($(FX_GLIDE_HW),sst1)
|
|
||||||
SUBDIRS += sst1
|
.EXPORT_ALL_VARIABLES:
|
||||||
|
|
||||||
|
export BUILD_NUMBER = 40404
|
||||||
|
export FX_GLIDE_HW ?= h3
|
||||||
|
|
||||||
|
ifeq ($(FX_GLIDE_HW),sst96)
|
||||||
|
G3_DIR = sst1/glide/src
|
||||||
else
|
else
|
||||||
ifeq ($(FX_GLIDE_HW),sst96)
|
G3_DIR = $(FX_GLIDE_HW)/glide/src
|
||||||
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
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#
|
all:
|
||||||
# Other variables we need to set
|
make -f makefile.linux -C $(G3_DIR)
|
||||||
#
|
|
||||||
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
|
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
349
glide2x/sst1/glide/src/Makefile.win32
Normal file
349
glide2x/sst1/glide/src/Makefile.win32
Normal 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))
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
int _cpu_detect_asm() {
|
int _cpu_detect_asm() {
|
||||||
struct utsname name;
|
struct utsname name;
|
||||||
|
|||||||
@@ -19,16 +19,19 @@
|
|||||||
;;
|
;;
|
||||||
;; $Header$
|
;; $Header$
|
||||||
;; $Log$
|
;; $Log$
|
||||||
|
;; Revision 1.1.2.1 2004/03/02 07:55:29 dborca
|
||||||
|
;; Bastardised Glide3x for SST1
|
||||||
|
;;
|
||||||
|
;; Revision 1.1.1.1 1999/12/07 21:48:51 joseph
|
||||||
|
;; Initial checkin into SourceForge.
|
||||||
|
;;
|
||||||
;
|
;
|
||||||
; 2 3/04/97 9:10p Dow
|
; 2 3/04/97 9:10p Dow
|
||||||
; Neutered mutiplatform multiheaded monster.
|
; Neutered mutiplatform multiheaded monster.
|
||||||
;;
|
;;
|
||||||
;;
|
;;
|
||||||
|
|
||||||
TITLE cpudtect.asm
|
%include "xos.inc"
|
||||||
|
|
||||||
.586P
|
|
||||||
.model FLAT,C ; Flat memory, mangle publics with leading '_'
|
|
||||||
|
|
||||||
;; Data for data segment goes here
|
;; Data for data segment goes here
|
||||||
;_DATA SEGMENT DWORD USE32 PUBLIC 'DATA';
|
;_DATA SEGMENT DWORD USE32 PUBLIC 'DATA';
|
||||||
@@ -36,14 +39,14 @@ TITLE cpudtect.asm
|
|||||||
|
|
||||||
;;; Some useful constants
|
;;; Some useful constants
|
||||||
; CPU Type
|
; CPU Type
|
||||||
CPUTypeUnknown = 0ffffffffh
|
CPUTypeUnknown equ 0ffffffffh
|
||||||
CPUTypePrePent = 4h
|
CPUTypePrePent equ 4h
|
||||||
CPUTypeP5 = 5h
|
CPUTypeP5 equ 5h
|
||||||
CPUTypeP6 = 6h
|
CPUTypeP6 equ 6h
|
||||||
|
|
||||||
;;; References to external data:
|
;;; References to external data:
|
||||||
|
|
||||||
_TEXT SEGMENT
|
segment TEXT
|
||||||
;;
|
;;
|
||||||
;; _cpu_detect_asm - detect the type of CPU
|
;; _cpu_detect_asm - detect the type of CPU
|
||||||
;;
|
;;
|
||||||
@@ -53,10 +56,8 @@ _TEXT SEGMENT
|
|||||||
;;
|
;;
|
||||||
;; returns 4 for non-pen
|
;; returns 4 for non-pen
|
||||||
|
|
||||||
PUBLIC _cpu_detect_asm
|
proc _cpu_detect_asm
|
||||||
_cpu_detect_asm PROC NEAR
|
|
||||||
P6Stuff:
|
P6Stuff:
|
||||||
.586
|
|
||||||
pushad ; save all regs.
|
pushad ; save all regs.
|
||||||
|
|
||||||
; First, determine whether CPUID instruction is available.
|
; First, determine whether CPUID instruction is available.
|
||||||
@@ -84,6 +85,7 @@ P6Stuff:
|
|||||||
jnz NotIntel
|
jnz NotIntel
|
||||||
xor ecx, 06c65746eh ; "ntel"
|
xor ecx, 06c65746eh ; "ntel"
|
||||||
jnz NotIntel ;
|
jnz NotIntel ;
|
||||||
|
|
||||||
;; Verifying architecture family
|
;; Verifying architecture family
|
||||||
mov eax, 1
|
mov eax, 1
|
||||||
cpuid ; get family/model/stepping
|
cpuid ; get family/model/stepping
|
||||||
@@ -116,45 +118,38 @@ NotIntel:
|
|||||||
mov eax, 0ffffffffh
|
mov eax, 0ffffffffh
|
||||||
ret
|
ret
|
||||||
|
|
||||||
_cpu_detect_asm ENDP
|
endp
|
||||||
|
|
||||||
|
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
; this routine sets the precision to single
|
; this routine sets the precision to single
|
||||||
; which effects all adds, mults, and divs
|
; which effects all adds, mults, and divs
|
||||||
align 4 ;
|
align 4 ;
|
||||||
PUBLIC single_precision_asm
|
proc single_precision_asm
|
||||||
single_precision_asm PROC NEAR
|
|
||||||
.586
|
|
||||||
push eax ; make room
|
push eax ; make room
|
||||||
fnclex ; clear pending exceptions
|
fnclex ; clear pending exceptions
|
||||||
fstcw WORD PTR [esp]
|
fstcw WORD [esp]
|
||||||
mov eax, DWORD PTR [esp]
|
mov eax, DWORD [esp]
|
||||||
and eax, 0000fcffh ; clear bits 9:8
|
and eax, 0000fcffh ; clear bits 9:8
|
||||||
mov DWORD PTR [esp], eax
|
mov DWORD [esp], eax
|
||||||
fldcw WORD PTR [esp]
|
fldcw WORD [esp]
|
||||||
pop eax
|
pop eax
|
||||||
ret 0
|
ret
|
||||||
single_precision_asm ENDP
|
endp
|
||||||
|
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
; this routine sets the precision to double
|
; this routine sets the precision to double
|
||||||
; which effects all adds, mults, and divs
|
; which effects all adds, mults, and divs
|
||||||
align 4 ;
|
align 4 ;
|
||||||
PUBLIC double_precision_asm
|
proc double_precision_asm
|
||||||
double_precision_asm PROC NEAR
|
|
||||||
.586
|
|
||||||
push eax ; make room
|
push eax ; make room
|
||||||
fnclex ; clear pending exceptions
|
fnclex ; clear pending exceptions
|
||||||
fstcw WORD PTR [esp]
|
fstcw WORD [esp]
|
||||||
mov eax, DWORD PTR [esp]
|
mov eax, DWORD [esp]
|
||||||
and eax, 0000fcffh ; clear bits 9:8
|
and eax, 0000fcffh ; clear bits 9:8
|
||||||
or eax, 000002ffh ; set 9:8 to 10
|
or eax, 000002ffh ; set 9:8 to 10
|
||||||
mov DWORD PTR [esp], eax
|
mov DWORD [esp], eax
|
||||||
fldcw WORD PTR [esp]
|
fldcw WORD [esp]
|
||||||
pop eax
|
pop eax
|
||||||
ret 0
|
ret
|
||||||
double_precision_asm ENDP
|
endp
|
||||||
|
|
||||||
_TEXT ENDS
|
|
||||||
END
|
|
||||||
|
|||||||
@@ -44,22 +44,22 @@
|
|||||||
COMMENT; NEWLINE
|
COMMENT; NEWLINE
|
||||||
|
|
||||||
#define OFFSET(p,o,pname) if (hex) \
|
#define OFFSET(p,o,pname) if (hex) \
|
||||||
printf("%s\t= %08xh\n",pname,((int)&p.o)-(int)&p); \
|
printf("%s\tequ %08xh\n",pname,((int)&p.o)-(int)&p); \
|
||||||
else printf("%s\t= %10d\n",pname,((int)&p.o)-(int)&p)
|
else printf("%s\tequ %10d\n",pname,((int)&p.o)-(int)&p)
|
||||||
|
|
||||||
#if (GLIDE_PLATFORM & GLIDE_HW_SST96)
|
#if (GLIDE_PLATFORM & GLIDE_HW_SST96)
|
||||||
#define HWOFFSET(p, o, pname) if (hex) \
|
#define HWOFFSET(p, o, pname) if (hex) \
|
||||||
printf("%s\t= %08xh\n",pname,(((int) &p.o)-(int)&p)>>2);\
|
printf("%s\tequ %08xh\n",pname,(((int) &p.o)-(int)&p)>>2);\
|
||||||
else printf("%s\t= %10d\n",pname,(((int)&p.o)-(int)&p))
|
else printf("%s\tequ %10d\n",pname,(((int)&p.o)-(int)&p))
|
||||||
#endif /* (GLIDE_PLATFORM & GLIDE_HW_SST96) */
|
#endif /* (GLIDE_PLATFORM & GLIDE_HW_SST96) */
|
||||||
|
|
||||||
#define OFFSET2(p,o,pname) if (hex) \
|
#define OFFSET2(p,o,pname) if (hex) \
|
||||||
printf("%s\t= %08xh\n",pname,((int)&o)-(int)&p); \
|
printf("%s\tequ %08xh\n",pname,((int)&o)-(int)&p); \
|
||||||
else printf("%s\t= %10d\n",pname,((int)&o)-(int)&p)
|
else printf("%s\tequ %10d\n",pname,((int)&o)-(int)&p)
|
||||||
|
|
||||||
#define SIZEOF(p,pname) if (hex) \
|
#define SIZEOF(p,pname) if (hex) \
|
||||||
printf("SIZEOF_%s\t= %08xh\n",pname,sizeof(p)); \
|
printf("SIZEOF_%s\tequ %08lxh\n",pname,sizeof(p)); \
|
||||||
else printf("SIZEOF_%s\t= %10d\n",pname,sizeof(p))
|
else printf("SIZEOF_%s\tequ %10ld\n",pname,sizeof(p))
|
||||||
#else
|
#else
|
||||||
#define NEWLINE printf("\n");
|
#define NEWLINE printf("\n");
|
||||||
#define COMMENT printf("#----------------------------------------------------------------------\n")
|
#define COMMENT printf("#----------------------------------------------------------------------\n")
|
||||||
@@ -98,7 +98,7 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
if (strcmp("-inline", argv[1]) == 0) {
|
if (strcmp("-inline", argv[1]) == 0) {
|
||||||
Sstregs dummyRegs;
|
Sstregs dummyRegs = { 0x00UL };
|
||||||
|
|
||||||
printf("#ifndef __FX_INLINE_H__\n");
|
printf("#ifndef __FX_INLINE_H__\n");
|
||||||
printf("#define __FX_INLINE_H__\n");
|
printf("#define __FX_INLINE_H__\n");
|
||||||
@@ -118,7 +118,7 @@ main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef __linux__
|
#ifndef __linux__
|
||||||
printf("SST_CHIP_MASK = 0%xh\n",SST_CHIP_MASK);
|
printf("SST_CHIP_MASK equ 0%xh\n",SST_CHIP_MASK);
|
||||||
#else
|
#else
|
||||||
printf("SST_CHIP_MASK .EQU 0x%x\n", SST_CHIP_MASK);
|
printf("SST_CHIP_MASK .EQU 0x%x\n", SST_CHIP_MASK);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,23 +1,3 @@
|
|||||||
/*
|
|
||||||
* 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 __FX_INLINE_H__
|
#ifndef __FX_INLINE_H__
|
||||||
#define __FX_INLINE_H__
|
#define __FX_INLINE_H__
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $Log$
|
||||||
|
** Revision 1.1.1.1 1999/12/07 21:48:52 joseph
|
||||||
|
** Initial checkin into SourceForge.
|
||||||
|
**
|
||||||
*
|
*
|
||||||
* 6 3/09/97 10:31a Dow
|
* 6 3/09/97 10:31a Dow
|
||||||
* Added GR_DIENTRY for di glide functions
|
* Added GR_DIENTRY for di glide functions
|
||||||
@@ -58,15 +61,6 @@ typedef struct
|
|||||||
FxBool valid;
|
FxBool valid;
|
||||||
} CfTableEntry;
|
} CfTableEntry;
|
||||||
|
|
||||||
#ifdef __linux__
|
|
||||||
static void strupr(char *str) {
|
|
||||||
while (*str) {
|
|
||||||
if (islower(*str)) *str=toupper(*str);
|
|
||||||
str++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------
|
/*---------------------------------------------------------------------------
|
||||||
** gu3dfGetInfo
|
** gu3dfGetInfo
|
||||||
*/
|
*/
|
||||||
@@ -254,7 +248,13 @@ GR_DIENTRY(gu3dfGetInfo, FxBool,
|
|||||||
/*
|
/*
|
||||||
** determine the color format of the input image
|
** determine the color format of the input image
|
||||||
*/
|
*/
|
||||||
strupr( color_format );
|
{
|
||||||
|
char *tempStr = (char*)color_format;
|
||||||
|
while (*tempStr != '\0') {
|
||||||
|
*tempStr = toupper(*tempStr);
|
||||||
|
tempStr++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
format_found = FXFALSE;
|
format_found = FXFALSE;
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
**
|
**
|
||||||
** $Header$
|
** $Header$
|
||||||
** $Log$
|
** $Log$
|
||||||
|
** Revision 1.1.1.1 1999/12/07 21:48:52 joseph
|
||||||
|
** Initial checkin into SourceForge.
|
||||||
|
**
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define OFFICIAL 1
|
#define OFFICIAL 1
|
||||||
@@ -26,7 +29,8 @@
|
|||||||
|
|
||||||
#include <fxver.h>
|
#include <fxver.h>
|
||||||
#include "rcver.h"
|
#include "rcver.h"
|
||||||
#include "fxbldno.h"
|
/*#include "fxbldno.h"*/
|
||||||
|
#define BUILD_NUMBER 0001
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -1,199 +1,337 @@
|
|||||||
|
# Linux makefile for Glide2/SST1
|
||||||
#
|
#
|
||||||
# THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
|
# $Id$
|
||||||
# PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
|
#
|
||||||
# TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
|
# Copyright (c) 2003 - Daniel Borca
|
||||||
# INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
|
# Email : dborca@users.sourceforge.net
|
||||||
# DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
|
# Web : http://www.geocities.com/dborca
|
||||||
# THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
#
|
||||||
# EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
# Copyright (c) 2006 - Guillem Jover <guillem@hadrons.org>
|
||||||
# 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
|
|
||||||
#
|
#
|
||||||
|
|
||||||
# local defines, options, includes
|
|
||||||
|
|
||||||
# Stuff for debugging
|
|
||||||
ifneq ($(DEBUG),)
|
|
||||||
DBGOPTS = -DGLIDE_DEBUG -DGDBG_INFO_ON
|
|
||||||
GLIDE_SANITY_ALL = 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Display Options (Hardware)
|
#
|
||||||
DSPOPTS = -DGLIDE_HARDWARE
|
# Available options:
|
||||||
|
#
|
||||||
# Compile for specific hardware
|
# Environment variables:
|
||||||
ifeq ($(FX_GLIDE_HW),SST96)
|
# FX_GLIDE_HW build for the given ASIC (sst1, sst96).
|
||||||
HWSPEC = sst96.c
|
# default = sst1
|
||||||
LCDEFS += -DSST96 -DGLIDE_USE_ALT_REGMAP
|
# XPATH specify X libraries path; needed for sst96.
|
||||||
|
# default = /usr/X11R6/lib (sst96 only)
|
||||||
ASMTRISETUP = xdraw96.S
|
# OPTFLAGS pass given optimization flags to compiler
|
||||||
# LIBOBJS = xdraw96.o
|
# default = -O1 -ffast-math
|
||||||
|
# DEBUG=1 enable debugging checks and messages
|
||||||
FX_GLIDE_FIFO96 = 1
|
# default = no
|
||||||
FX_GLIDE_GROUP_WRITE=1
|
# USE_X86=1 use assembler triangle specializations!
|
||||||
|
# default = no
|
||||||
# Turn on the alternate fifo handling code
|
#
|
||||||
ifeq ($(FX_SST96_ALT_FIFO),1)
|
# Targets:
|
||||||
LCDEFS += -DSST96_ALT_FIFO_WRAP
|
# all: build everything
|
||||||
endif
|
# glide2x: build Glide2x lib
|
||||||
|
# clean: remove object files
|
||||||
else # Default to SST1
|
# realclean: remove all generated files
|
||||||
LCDEFS += -DSST1
|
|
||||||
LADEFS += /DSST1
|
|
||||||
ASMTRISETUP = xdraw.S
|
|
||||||
# LIBOBJS = xdraw.o
|
|
||||||
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.
|
|
||||||
#
|
#
|
||||||
|
|
||||||
# SST96 has no notion of alternate register mapping
|
|
||||||
ifneq ($(FX_GLIDE_HW),SST96)
|
|
||||||
# Turn on/off alt register set. (G lide R eg M ap OPTS)
|
.PHONY: all glide3x clean realclean
|
||||||
ifeq ($(FX_GLIDE_REG_MAP),ORIG)
|
.INTERMEDIATE: fxgasm
|
||||||
GRMOPTS = -DGLIDE_USE_ALT_REGMAP
|
.SUFFIXES: .lo
|
||||||
ASM_REGMAP_DEFS = -DGLIDE_USE_ALT_REGMAP
|
|
||||||
|
export PATH := $(PATH):.
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# general defines (user settable?)
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
GLIDE_VERSION_MAJOR = 2
|
||||||
|
GLIDE_VERSION_MINOR = 46
|
||||||
|
|
||||||
|
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 ?= sst1
|
||||||
|
FX_GLIDE_SW = ../../../swlibs
|
||||||
|
GLIDE_LIBDIR = ../../lib
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# tools
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
CC = gcc
|
||||||
|
AS = nasm
|
||||||
|
AR = ar
|
||||||
|
|
||||||
|
CP = cp
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# defines
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
# platform
|
||||||
|
CDEFS = -DINIT_LINUX
|
||||||
|
XPATH ?= /usr/X11R6/lib
|
||||||
|
ifeq ($(FX_GLIDE_HW),sst96)
|
||||||
|
LDFLAGS = -L$(XPATH)
|
||||||
|
LDLIBS = -lX11 -lXxf86dga -lXxf86rush -lXxf86vm
|
||||||
|
endif
|
||||||
|
|
||||||
|
LDLIBS += -lm
|
||||||
|
|
||||||
|
# general
|
||||||
|
CDEFS += -DGLIDE_HARDWARE -DGLIDE_DEFAULT_GAMMA=1.3f -DGLIDE_LIB=1
|
||||||
|
|
||||||
|
# subsystem
|
||||||
|
ifeq ($(FX_GLIDE_HW),sst1)
|
||||||
|
CDEFS += -DSST1
|
||||||
else
|
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
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Turn on/off assembly language trisetup code.
|
# debug
|
||||||
# (C on is Assembly off) (A ssembly T ri S etup OPTS)
|
ifdef DEBUG
|
||||||
ifeq ($(FX_GLIDE_CTRISETUP),1)
|
CDEFS += -DGDBG_INFO_ON -DGLIDE_DEBUG -DGLIDE_SANITY_ASSERT -DGLIDE_SANITY_SIZE
|
||||||
ASMTRISETUP =
|
|
||||||
ATSOPTS = -DGLIDE_USE_C_TRISETUP
|
|
||||||
LIBOBJS =
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
OPTOPTS = $(GRMOPTS) $(OTSOPTS) $(ATSOPTS)
|
# other
|
||||||
|
CDEFS += -DGLIDE_PLUG -DGLIDE_SPLASH
|
||||||
|
|
||||||
# local defines, begin with basics and then add on
|
###############################################################################
|
||||||
LCDEFS += -DGLIDE_LIB
|
# flags
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
# Turn Off/On compilation of shameless plug
|
# librarian
|
||||||
ifneq ($(FX_GLIDE_NO_PLUG),1)
|
ARFLAGS = rus
|
||||||
LCDEFS += -DGLIDE_PLUG
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Turn Off/On splash screen
|
# assembler
|
||||||
ifneq ($(FX_GLIDE_NO_SPLASH),1)
|
ASFLAGS = -O6 -felf -D__linux__
|
||||||
LCDEFS += -DGLIDE_SPLASH
|
ASFLAGS += $(CDEFS)
|
||||||
endif
|
|
||||||
|
|
||||||
# Turn On group writes
|
# compiler
|
||||||
ifneq ($(FX_GLIDE_GROUP_WRITE),)
|
CFLAGS = -Wall -W
|
||||||
LCDEFS += -DGROUP_WRITE
|
CFLAGS += -I. -I../../incsrc -I../../init -I../../init/initvg -I../../init/init96
|
||||||
endif
|
CFLAGS += -I$(FX_GLIDE_SW)/fxmisc -I$(FX_GLIDE_SW)/newpci/pcilib -I$(FX_GLIDE_SW)/fxmemmap
|
||||||
|
CFLAGS += $(CDEFS)
|
||||||
|
|
||||||
ifeq ($(FX_GLIDE_FIFO96),1)
|
ifeq ($(USE_X86),1)
|
||||||
LCDEFS += -DSST96_FIFO
|
CFLAGS += -DGL_X86
|
||||||
endif
|
OPTFLAGS ?= -O1 -ffast-math
|
||||||
|
|
||||||
ifdef GLIDE_SANITY_ALL
|
|
||||||
GLIDE_SANITY_SIZE = $(GLIDE_SANITY_ALL)
|
|
||||||
GLIDE_SANITY_ASSERT = $(GLIDE_SANITY_ALL)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef GLIDE_SANITY_SIZE
|
|
||||||
LCDEFS += -DGLIDE_SANITY_SIZE
|
|
||||||
endif
|
|
||||||
ifdef GLIDE_SANITY_ASSERT
|
|
||||||
LCDEFS += -DGLIDE_SANITY_ASSERT
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Local Defs, Includes, and Options (C)
|
|
||||||
LCINCS = -I$(SST1INC)
|
|
||||||
LCOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
|
|
||||||
|
|
||||||
# Local Defs, Includes, and Options (ASM)
|
|
||||||
LADEFS += $(ASM_REGMAP_DEFS)
|
|
||||||
LAINCS = -I$(SST1INC)
|
|
||||||
LAOPTS = $(DBGOPTS) $(DSPOPTS) $(OPTOPTS)
|
|
||||||
|
|
||||||
AFILES = $(ASMTRISETUP)
|
|
||||||
|
|
||||||
# sources
|
|
||||||
HEADERS = glide.h gump.h glidesys.h glideutl.h
|
|
||||||
PRIVATE_HEADERS = fxglide.h gsstdef.h
|
|
||||||
INSTALL_DESTINATION = $(BUILD_ROOT_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 gxdraw.c $(HWSPEC) \
|
|
||||||
cpudetect.c
|
|
||||||
|
|
||||||
OFILES = $(CFILES:.c=.o)
|
|
||||||
|
|
||||||
OTHER_CFILES = fxgasm.c
|
|
||||||
|
|
||||||
CODFILES = $(CFILES:.c=.cod)
|
|
||||||
|
|
||||||
SST1INC = $(BUILD_ROOT_HW)/include
|
|
||||||
SWLIBSINC = $(BUILD_ROOT_SWLIBS)/include
|
|
||||||
|
|
||||||
# sublibs for hardware
|
|
||||||
SUBLIBRARIES = \
|
|
||||||
$(BUILD_ROOT_SWLIBS)/lib/libfxmisc.a \
|
|
||||||
$(BUILD_ROOT_SWLIBS)/lib/libfxpci.a \
|
|
||||||
$(BUILD_ROOT_HW)/lib/libinit.a \
|
|
||||||
$(BUILD_ROOT_HW)/lib/libsst1.a \
|
|
||||||
$(BUILD_ROOT_HW)/lib/libinit96.a
|
|
||||||
|
|
||||||
|
|
||||||
LINKLIBRARIES+=-lm
|
|
||||||
ifeq ($(FX_GLIDE_HW),SST96)
|
|
||||||
LINKLIBRARIES += -L$(XLOCATION)/lib -lX11 -lXext \
|
|
||||||
-lXxf86rush -lXxf86dga -lXxf86vm
|
|
||||||
endif
|
|
||||||
|
|
||||||
# targets
|
|
||||||
LDIRT = fxgasm.o fxgasm fxgasm.h
|
|
||||||
|
|
||||||
LIBRARIES = libglide.a
|
|
||||||
SHARED_LIBRARY = libglide.so.2.46
|
|
||||||
|
|
||||||
include $(BUILD_ROOT_SWLIBS)/include/make/3dfx.mak
|
|
||||||
|
|
||||||
fxgasm : fxgasm.c $(HEADERS) $(PRIVATE_HEADERS)
|
|
||||||
$(CC) -o $@ fxgasm.c $(GCDEFS) $(LCDEFS) $(VCDEFS) $(LCOPTS) \
|
|
||||||
-I$(BUILD_ROOT_HW)/include -I$(BUILD_ROOT_SWLIBS)/include $(LDFLAGS)
|
|
||||||
|
|
||||||
fxgasm.h : fxgasm
|
|
||||||
./fxgasm > fxgasm.h
|
|
||||||
|
|
||||||
fxinline.h : fxgasm
|
|
||||||
./fxgasm -inline > fxinline.h
|
|
||||||
|
|
||||||
ASM_DEFINES = -DGLIDE_HARDWARE=1
|
|
||||||
ifneq ($(DEBUG),)
|
|
||||||
ASM_DEFINES += -DGLIDE_DEBUG=1
|
|
||||||
else
|
else
|
||||||
ASM_DEFINES += -DGLIDE_DEBUG=0
|
CFLAGS += -DGLIDE_USE_C_TRISETUP
|
||||||
|
OPTFLAGS ?= -O1 -ffast-math
|
||||||
endif
|
endif
|
||||||
|
|
||||||
xdraw.o : fxgasm.h xdraw.S
|
# optflags
|
||||||
# $(CC) -c -o $@ xdraw.S $(ASM_OPTS) $(LAOPTS)
|
CFLAGS += $(OPTFLAGS)
|
||||||
gasp xdraw.S $(ASM_DEFINES) | as -V -Qy -o xdraw.o
|
|
||||||
|
|
||||||
xdraw96.o : fxgasm.h xdraw96.
|
###############################################################################
|
||||||
# $(CC) -c -o $@ xdraw96.S $(ASM_OPTS) $(LAOPTS)
|
# objects
|
||||||
gasp xdraw96.S $(ASM_DEFINES) | as -V -Qy -o xdraw96.o
|
###############################################################################
|
||||||
|
|
||||||
gsplash.o : gsplash.c splshdat.c fxinline.h
|
GLIDE_HEADERS = \
|
||||||
|
glide.h gump.h glidesys.h glideutl.h
|
||||||
|
|
||||||
|
GLIDE_PRIVATE_HEADERS = \
|
||||||
|
fxglide.h gsstdef.h
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# objects
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
GLIDE_OBJECTS = \
|
||||||
|
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
|
||||||
|
|
||||||
|
ifeq ($(USE_X86),1)
|
||||||
|
ifeq ($(FX_GLIDE_HW),sst1)
|
||||||
|
GLIDE_OBJECTS += \
|
||||||
|
xdraw.o
|
||||||
|
else
|
||||||
|
GLIDE_OBJECTS += \
|
||||||
|
xdraw96.o
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
GLIDE_OBJECTS += \
|
||||||
|
gxdraw.o
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(FX_GLIDE_HW),sst96)
|
||||||
|
GLIDE_OBJECTS += \
|
||||||
|
sst96.o \
|
||||||
|
../../init/init96/init96.o \
|
||||||
|
../../init/init96/lindrvr.o \
|
||||||
|
../../init/init96/initat3d.o \
|
||||||
|
../../init/init96/initmcrx.o
|
||||||
|
endif
|
||||||
|
|
||||||
|
GLIDE_OBJECTS += \
|
||||||
|
../../init/init.o \
|
||||||
|
../../init/vgdrvr.o \
|
||||||
|
../../init/vg96drvr.o \
|
||||||
|
../../init/h3drvr.o \
|
||||||
|
../../init/initvg/gamma.o \
|
||||||
|
../../init/initvg/dac.o \
|
||||||
|
../../init/initvg/video.o \
|
||||||
|
../../init/initvg/parse.o \
|
||||||
|
../../init/initvg/sli.o \
|
||||||
|
../../init/initvg/util.o \
|
||||||
|
../../init/initvg/info.o \
|
||||||
|
../../init/initvg/print.o \
|
||||||
|
../../init/initvg/gdebug.o \
|
||||||
|
../../init/initvg/sst1init.o \
|
||||||
|
$(FX_GLIDE_SW)/newpci/pcilib/sst1_pci.o \
|
||||||
|
$(FX_GLIDE_SW)/newpci/pcilib/fxmsr.o \
|
||||||
|
$(FX_GLIDE_SW)/newpci/pcilib/fxpci.o \
|
||||||
|
$(FX_GLIDE_SW)/newpci/pcilib/fxlinux.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
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# rules(2)
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
cpuid.o: cpudtect.asm
|
||||||
|
$(AS) -o $@ $(ASFLAGS) $<
|
||||||
|
xdraw.o: xdraw.asm
|
||||||
|
$(AS) -o $@ $(ASFLAGS) $<
|
||||||
|
xdraw96.o: xdraw96.asm
|
||||||
|
$(AS) -o $@ $(ASFLAGS) $<
|
||||||
|
|
||||||
|
cpuid.lo: cpuid.o
|
||||||
|
$(CP) $< $@
|
||||||
|
xdraw.lo: xdraw.o
|
||||||
|
$(CP) $< $@
|
||||||
|
xdraw96.lo: xdraw96.o
|
||||||
|
$(CP) $< $@
|
||||||
|
|
||||||
|
ifeq ($(FX_GLIDE_HW),sst96)
|
||||||
|
../../init/initvg/gamma.o: ../../init/initvg/gamma.c
|
||||||
|
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
|
||||||
|
../../init/initvg/dac.o: ../../init/initvg/dac.c
|
||||||
|
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
|
||||||
|
../../init/initvg/video.o: ../../init/initvg/video.c
|
||||||
|
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
|
||||||
|
../../init/initvg/parse.o: ../../init/initvg/parse.c
|
||||||
|
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
|
||||||
|
../../init/initvg/sli.o: ../../init/initvg/sli.c
|
||||||
|
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
|
||||||
|
../../init/initvg/util.o: ../../init/initvg/util.c
|
||||||
|
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
|
||||||
|
../../init/initvg/info.o: ../../init/initvg/info.c
|
||||||
|
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
|
||||||
|
../../init/initvg/print.o: ../../init/initvg/print.c
|
||||||
|
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
|
||||||
|
../../init/initvg/gdebug.o: ../../init/initvg/gdebug.c
|
||||||
|
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
|
||||||
|
../../init/initvg/sst1init.o: ../../init/initvg/sst1init.c
|
||||||
|
$(CC) -o $@ $(CFLAGS) -USST96 -c $<
|
||||||
|
|
||||||
|
../../init/initvg/gamma.lo: ../../init/initvg/gamma.c
|
||||||
|
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
|
||||||
|
../../init/initvg/dac.lo: ../../init/initvg/dac.c
|
||||||
|
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
|
||||||
|
../../init/initvg/video.lo: ../../init/initvg/video.c
|
||||||
|
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
|
||||||
|
../../init/initvg/parse.lo: ../../init/initvg/parse.c
|
||||||
|
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
|
||||||
|
../../init/initvg/sli.lo: ../../init/initvg/sli.c
|
||||||
|
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
|
||||||
|
../../init/initvg/util.lo: ../../init/initvg/util.c
|
||||||
|
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
|
||||||
|
../../init/initvg/info.lo: ../../init/initvg/info.c
|
||||||
|
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
|
||||||
|
../../init/initvg/print.lo: ../../init/initvg/print.c
|
||||||
|
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
|
||||||
|
../../init/initvg/gdebug.lo: ../../init/initvg/gdebug.c
|
||||||
|
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
|
||||||
|
../../init/initvg/sst1init.lo: ../../init/initvg/sst1init.c
|
||||||
|
$(CC) -o $@ $(CFLAGS) -DPIC -fPIC -USST96 -c $<
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(GLIDE_OBJECTS): fxinline.h fxgasm.h
|
||||||
|
|
||||||
|
fxinline.h: fxgasm
|
||||||
|
$< -inline > $@
|
||||||
|
|
||||||
|
fxgasm.h: fxgasm
|
||||||
|
$< -hex > $@
|
||||||
|
|
||||||
|
fxgasm: fxgasm.c $(GLIDE_HEADERS) $(GLIDE_PRIVATE_HEADERS)
|
||||||
|
$(CC) -o $@ $(CFLAGS) $<
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# clean, realclean
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-$(RM) *.o *.lo
|
||||||
|
-$(RM) ../../init/*.o ../../init/*.lo
|
||||||
|
-$(RM) ../../init/initvg/*.o ../../init/initvg/*.lo
|
||||||
|
-$(RM) ../../init/init96/*.o ../../init/init96/*.lo
|
||||||
|
-$(RM) $(FX_GLIDE_SW)/newpci/pcilib/*.o $(FX_GLIDE_SW)/newpci/pcilib/*.lo
|
||||||
|
-$(RM) fxinline.h
|
||||||
|
-$(RM) fxgasm.h
|
||||||
|
|
||||||
|
realclean: clean
|
||||||
|
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_LIB)
|
||||||
|
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SHARED)
|
||||||
|
-$(RM) $(GLIDE_LIBDIR)/$(GLIDE_SO)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ endif
|
|||||||
DSPOPTS = -DGLIDE_HARDWARE
|
DSPOPTS = -DGLIDE_HARDWARE
|
||||||
|
|
||||||
# Compile for specific hardware
|
# Compile for specific hardware
|
||||||
ifeq ($(FX_GLIDE_HW),SST96)
|
ifeq ($(FX_GLIDE_HW),sst96)
|
||||||
HWSPEC = sst96.c
|
HWSPEC = sst96.c
|
||||||
LCDEFS += -DSST96 -DGLIDE_USE_ALT_REGMAP
|
LCDEFS += -DSST96 -DGLIDE_USE_ALT_REGMAP
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ endif
|
|||||||
#
|
#
|
||||||
|
|
||||||
# SST96 has no notion of alternate register mapping
|
# SST96 has no notion of alternate register mapping
|
||||||
ifneq ($(FX_GLIDE_HW),SST96)
|
ifneq ($(FX_GLIDE_HW),sst96)
|
||||||
# Turn on/off alt register set. (G lide R eg M ap OPTS)
|
# Turn on/off alt register set. (G lide R eg M ap OPTS)
|
||||||
ifeq ($(FX_GLIDE_REG_MAP),ORIG)
|
ifeq ($(FX_GLIDE_REG_MAP),ORIG)
|
||||||
GRMOPTS = -DGLIDE_USE_ALT_REGMAP
|
GRMOPTS = -DGLIDE_USE_ALT_REGMAP
|
||||||
@@ -158,7 +158,7 @@ SUBLIBRARIES = \
|
|||||||
|
|
||||||
|
|
||||||
LINKLIBRARIES+=-lm
|
LINKLIBRARIES+=-lm
|
||||||
ifeq ($(FX_GLIDE_HW),SST96)
|
ifeq ($(FX_GLIDE_HW),sst96)
|
||||||
LINKLIBRARIES += -L$(XLOCATION)/lib -lX11 -lXext \
|
LINKLIBRARIES += -L$(XLOCATION)/lib -lX11 -lXext \
|
||||||
-lXxf86rush -lXxf86dga -lXxf86vm
|
-lXxf86rush -lXxf86dga -lXxf86vm
|
||||||
endif
|
endif
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
161
glide2x/sst1/glide/src/xos.inc
Normal file
161
glide2x/sst1/glide/src/xos.inc
Normal file
@@ -0,0 +1,161 @@
|
|||||||
|
;
|
||||||
|
; compulsory header for glide3/xdraw* assembly specializations (NASM)
|
||||||
|
;
|
||||||
|
; $Header$
|
||||||
|
; $Log$
|
||||||
|
; Revision 1.1.2.2 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
|
||||||
@@ -70,8 +70,13 @@ static const char *sourceFormatString[] = {
|
|||||||
"GR_LFB_SRC_FMT_ZA16 "
|
"GR_LFB_SRC_FMT_ZA16 "
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void imageConvert( void *dst,
|
||||||
|
void *src,
|
||||||
|
GrLfbSrcFmt_t format,
|
||||||
|
FxU32 *bpp );
|
||||||
|
|
||||||
void main( int argc, char **argv) {
|
int main( int argc, char **argv)
|
||||||
|
{
|
||||||
char match;
|
char match;
|
||||||
char **remArgs;
|
char **remArgs;
|
||||||
int rv;
|
int rv;
|
||||||
@@ -95,16 +100,11 @@ void main( int argc, char **argv) {
|
|||||||
static FxU32 imageWidth;
|
static FxU32 imageWidth;
|
||||||
static FxU32 imageHeight;
|
static FxU32 imageHeight;
|
||||||
|
|
||||||
static void imageConvert( void *dst,
|
|
||||||
void *src,
|
|
||||||
GrLfbSrcFmt_t format,
|
|
||||||
FxU32 *bpp );
|
|
||||||
|
|
||||||
srcfname[0] = 0;
|
srcfname[0] = 0;
|
||||||
dstfname[0] = 0;
|
dstfname[0] = 0;
|
||||||
|
|
||||||
/* Process Command Line Arguments */
|
/* Process Command Line Arguments */
|
||||||
while( rv = tlGetOpt( argc, argv, "nrst", &match, &remArgs ) ) {
|
while ((rv = tlGetOpt(argc, argv, "nrst", &match, &remArgs))) {
|
||||||
if ( rv == -1 ) {
|
if ( rv == -1 ) {
|
||||||
printf( "Unrecognized command line argument\n" );
|
printf( "Unrecognized command line argument\n" );
|
||||||
printf( "%s %s\n", name, usage );
|
printf( "%s %s\n", name, usage );
|
||||||
@@ -174,7 +174,7 @@ void main( int argc, char **argv) {
|
|||||||
/* readng the LFB file header */
|
/* readng the LFB file header */
|
||||||
fread(&src.signature, 4, 1, fp);
|
fread(&src.signature, 4, 1, fp);
|
||||||
if (src.signature != IMAGE_SRLE) {
|
if (src.signature != IMAGE_SRLE) {
|
||||||
printf("%s file type incorrect\n");
|
printf("%s file type incorrect\n", srcfname);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fread(&src.width, 2, 1, fp);
|
fread(&src.width, 2, 1, fp);
|
||||||
@@ -208,7 +208,7 @@ void main( int argc, char **argv) {
|
|||||||
/* readng the LFB file header */
|
/* readng the LFB file header */
|
||||||
fread(&dst.signature, 4, 1, fp);
|
fread(&dst.signature, 4, 1, fp);
|
||||||
if (dst.signature != IMAGE_SRLE) {
|
if (dst.signature != IMAGE_SRLE) {
|
||||||
printf("%s file type incorrect\n");
|
printf("%s file type incorrect\n", dstfname);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fread(&dst.width, 2, 1, fp);
|
fread(&dst.width, 2, 1, fp);
|
||||||
|
|||||||
@@ -62,6 +62,10 @@ static const char *sourceFormatString[] = {
|
|||||||
"GR_LFB_SRC_FMT_ZA16 "
|
"GR_LFB_SRC_FMT_ZA16 "
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void imageConvert( void *dst,
|
||||||
|
void *src,
|
||||||
|
GrLfbSrcFmt_t format,
|
||||||
|
FxU32 *bpp );
|
||||||
|
|
||||||
void main( int argc, char **argv) {
|
void main( int argc, char **argv) {
|
||||||
char match;
|
char match;
|
||||||
@@ -85,11 +89,6 @@ void main( int argc, char **argv) {
|
|||||||
static FxU32 imageWidth;
|
static FxU32 imageWidth;
|
||||||
static FxU32 imageHeight;
|
static FxU32 imageHeight;
|
||||||
|
|
||||||
static void imageConvert( void *dst,
|
|
||||||
void *src,
|
|
||||||
GrLfbSrcFmt_t format,
|
|
||||||
FxU32 *bpp );
|
|
||||||
|
|
||||||
/* Process Command Line Arguments */
|
/* Process Command Line Arguments */
|
||||||
while( rv = tlGetOpt( argc, argv, "bdnr", &match, &remArgs ) ) {
|
while( rv = tlGetOpt( argc, argv, "bdnr", &match, &remArgs ) ) {
|
||||||
if ( rv == -1 ) {
|
if ( rv == -1 ) {
|
||||||
|
|||||||
@@ -1437,6 +1437,7 @@ char tlGetCH( void ) {
|
|||||||
FxBool
|
FxBool
|
||||||
tlErrorMessage( char *err) {
|
tlErrorMessage( char *err) {
|
||||||
fprintf(stderr, err);
|
fprintf(stderr, err);
|
||||||
|
return FXTRUE;
|
||||||
} /* tlErrorMessage */
|
} /* tlErrorMessage */
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -54,9 +54,6 @@
|
|||||||
#include <fxpci.h>
|
#include <fxpci.h>
|
||||||
#include <gdebug.h>
|
#include <gdebug.h>
|
||||||
|
|
||||||
static const PciRegister PCI_VENDOR_ID = { 0x0, 2, READ_ONLY };
|
|
||||||
static const PciRegister PCI_DEVICE_ID = { 0x2, 2, READ_ONLY };
|
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------
|
/*-------------------------------------------------------------------
|
||||||
Module Constants
|
Module Constants
|
||||||
|
|||||||
@@ -177,6 +177,9 @@ devNum,
|
|||||||
physAddr,
|
physAddr,
|
||||||
fifoMTRRNum = 0xffffffff;
|
fifoMTRRNum = 0xffffffff;
|
||||||
|
|
||||||
|
static void init96SetupRendering(InitRegisterDesc *regDesc,
|
||||||
|
GrScreenResolution_t sRes);
|
||||||
|
|
||||||
/*-----------Debuging Info Data------------------------------*/
|
/*-----------Debuging Info Data------------------------------*/
|
||||||
#ifdef GDBG_INFO_ON
|
#ifdef GDBG_INFO_ON
|
||||||
/* NOTE:
|
/* NOTE:
|
||||||
@@ -759,8 +762,6 @@ INITVG96ENTRY(init96MapBoard, FxBool , (void *rd, void *info, FxU16 vID, FxU16 d
|
|||||||
{
|
{
|
||||||
FxBool rv=FXTRUE;
|
FxBool rv=FXTRUE;
|
||||||
GrScreenResolution_t res = GR_RESOLUTION_640x480;
|
GrScreenResolution_t res = GR_RESOLUTION_640x480;
|
||||||
static void init96SetupRendering(InitRegisterDesc *regDesc,
|
|
||||||
GrScreenResolution_t sRes);
|
|
||||||
|
|
||||||
if (curHALData->initAperture)
|
if (curHALData->initAperture)
|
||||||
(*curHALData->initAperture)(regDesc);
|
(*curHALData->initAperture)(regDesc);
|
||||||
|
|||||||
@@ -294,7 +294,10 @@ INITMCRXENTRY(initMCRXEnableRegs, FxBool, (InitRegisterDesc *rd))
|
|||||||
GDBG_INFO((80, "%s: Enabling PUMA\n", FN_NAME));
|
GDBG_INFO((80, "%s: Enabling PUMA\n", FN_NAME));
|
||||||
CRTC_GET(0x28, tmp);
|
CRTC_GET(0x28, tmp);
|
||||||
tmp |= 1;
|
tmp |= 1;
|
||||||
if (envVal = myGetenv("MCRX_28")) sscanf(envVal, "%x", &tmp);
|
|
||||||
|
envVal = myGetenv("MCRX_28");
|
||||||
|
if (envVal)
|
||||||
|
sscanf(envVal, "%x", &tmp);
|
||||||
CRTC_SET(0x28, tmp);
|
CRTC_SET(0x28, tmp);
|
||||||
|
|
||||||
GDBG_INFO((80, "%s: Restoring Protection\n", FN_NAME));
|
GDBG_INFO((80, "%s: Restoring Protection\n", FN_NAME));
|
||||||
@@ -542,7 +545,8 @@ INITMCRXENTRY(initMCRXUseTiles, int, (InitRegisterDesc *rd,
|
|||||||
if (nBuffers == 3) tmp |= 0x08;
|
if (nBuffers == 3) tmp |= 0x08;
|
||||||
mcrxHALData.initSwapTiles = initMCRXSwapTiles;
|
mcrxHALData.initSwapTiles = initMCRXSwapTiles;
|
||||||
|
|
||||||
if (envVal = myGetenv("MRCX_71"))
|
envVal = myGetenv("MRCX_71");
|
||||||
|
if (envVal)
|
||||||
sscanf(envVal, "%x", &tmp);
|
sscanf(envVal, "%x", &tmp);
|
||||||
CRTC_SET(0x70, tmp);
|
CRTC_SET(0x70, tmp);
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ ifeq ($(DEBUG),1)
|
|||||||
DBGOPTS = -DGDBG_INFO_ON
|
DBGOPTS = -DGDBG_INFO_ON
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(FX_GLIDE_HW),SST96)
|
ifneq ($(FX_GLIDE_HW),sst96)
|
||||||
LCDEFS += -DDUMMY
|
LCDEFS += -DDUMMY
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ ifeq ($(DEBUG),1)
|
|||||||
DBGOPTS = -DGDBG_INFO_ON
|
DBGOPTS = -DGDBG_INFO_ON
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(FX_GLIDE_HW),SST96)
|
ifneq ($(FX_GLIDE_HW),sst96)
|
||||||
LCDEFS += -DDUMMY
|
LCDEFS += -DDUMMY
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
Different Build Environments For VG96:
|
Different Build Environments For VG96:
|
||||||
|
|
||||||
Lab:
|
Lab:
|
||||||
FX_GLIDE_HW=SST96
|
FX_GLIDE_HW=sst96
|
||||||
FX_GLIDE_CTRISETUP=1
|
FX_GLIDE_CTRISETUP=1
|
||||||
FX_GLIDE_NO_SPLASH=1
|
FX_GLIDE_NO_SPLASH=1
|
||||||
INIT_ACCESS_DDRAW=
|
INIT_ACCESS_DDRAW=
|
||||||
|
|
||||||
|
|
||||||
Direct Draw Window:
|
Direct Draw Window:
|
||||||
FX_GLIDE_HW=SST96
|
FX_GLIDE_HW=sst96
|
||||||
FX_GLIDE_CTRISETUP=1
|
FX_GLIDE_CTRISETUP=1
|
||||||
FX_GLIDE_NO_SPLASH=1
|
FX_GLIDE_NO_SPLASH=1
|
||||||
INIT_ACCESS_DDRAW=1
|
INIT_ACCESS_DDRAW=1
|
||||||
@@ -16,7 +16,7 @@ SST_VG_MODE=WIN
|
|||||||
*demos* ARCADE_RES_OVERRIDE=1
|
*demos* ARCADE_RES_OVERRIDE=1
|
||||||
|
|
||||||
Direct Draw Fullscreen:
|
Direct Draw Fullscreen:
|
||||||
FX_GLIDE_HW=SST96
|
FX_GLIDE_HW=sst96
|
||||||
FX_GLIDE_CTRISETUP=1
|
FX_GLIDE_CTRISETUP=1
|
||||||
FX_GLIDE_NO_SPLASH=1
|
FX_GLIDE_NO_SPLASH=1
|
||||||
INIT_ACCESS_DDRAW=1
|
INIT_ACCESS_DDRAW=1
|
||||||
@@ -28,7 +28,7 @@ and it is slow because you have to do sucky synchronized swapping.
|
|||||||
|
|
||||||
|
|
||||||
DOS Fullscreen:
|
DOS Fullscreen:
|
||||||
FX_GLIDE_HW=SST96
|
FX_GLIDE_HW=sst96
|
||||||
FX_GLIDE_CTRISETUP=1
|
FX_GLIDE_CTRISETUP=1
|
||||||
FX_GLIDE_NO_SPLASH=1
|
FX_GLIDE_NO_SPLASH=1
|
||||||
*demos* ARCADE_RES_OVERRIDE=
|
*demos* ARCADE_RES_OVERRIDE=
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ endif
|
|||||||
LCOPTS =
|
LCOPTS =
|
||||||
LCINCS = -I$(BUILD_ROOT_HW)/include
|
LCINCS = -I$(BUILD_ROOT_HW)/include
|
||||||
|
|
||||||
ifeq ($(FX_GLIDE_HW),SST96)
|
ifeq ($(FX_GLIDE_HW),sst96)
|
||||||
INITHW = SST96
|
INITHW = SST96
|
||||||
else
|
else
|
||||||
INITHW = SST1
|
INITHW = SST1
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ endif
|
|||||||
LCOPTS =
|
LCOPTS =
|
||||||
LCINCS = -I$(BUILD_ROOT_SST1)/include
|
LCINCS = -I$(BUILD_ROOT_SST1)/include
|
||||||
|
|
||||||
ifeq ($(FX_GLIDE_HW),SST96)
|
ifeq ($(FX_GLIDE_HW),sst96)
|
||||||
INITHW = SST96
|
INITHW = SST96
|
||||||
else
|
else
|
||||||
INITHW = SST1
|
INITHW = SST1
|
||||||
|
|||||||
510
glide3x/COPYING
510
glide3x/COPYING
@@ -1,255 +1,255 @@
|
|||||||
3DFX GLIDE Source Code General Public License
|
3DFX GLIDE Source Code General Public License
|
||||||
|
|
||||||
|
|
||||||
1. PREAMBLE
|
1. PREAMBLE
|
||||||
|
|
||||||
This license is for software that provides a 3D graphics application
|
This license is for software that provides a 3D graphics application
|
||||||
program interface (API).The license is intended to offer terms similar
|
program interface (API).The license is intended to offer terms similar
|
||||||
to some standard General Public Licenses designed to foster open
|
to some standard General Public Licenses designed to foster open
|
||||||
standards and unrestricted accessibility to source code. Some of these
|
standards and unrestricted accessibility to source code. Some of these
|
||||||
licenses require that, as a condition of the license of the software,
|
licenses require that, as a condition of the license of the software,
|
||||||
any derivative works (that is, new software which is a work containing
|
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
|
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
|
use, without restriction other than for a minor transfer fee, and that
|
||||||
the source code for such derivative works must likewise be made
|
the source code for such derivative works must likewise be made
|
||||||
available. The only restriction is that such derivative works must be
|
available. The only restriction is that such derivative works must be
|
||||||
subject to the same General Public License terms as the original work.
|
subject to the same General Public License terms as the original work.
|
||||||
|
|
||||||
This 3dfx GLIDE Source Code General Public License differs from the
|
This 3dfx GLIDE Source Code General Public License differs from the
|
||||||
standard licenses of this type in that it does not require the entire
|
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
|
derivative work to be made available under the terms of this license
|
||||||
nor is the recipient required to make available the source code for
|
nor is the recipient required to make available the source code for
|
||||||
the entire derivative work. Rather, the license is limited to only the
|
the entire derivative work. Rather, the license is limited to only the
|
||||||
identifiable portion of the derivative work that is derived from the
|
identifiable portion of the derivative work that is derived from the
|
||||||
licensed software. The precise terms and conditions for copying,
|
licensed software. The precise terms and conditions for copying,
|
||||||
distribution and modification follow.
|
distribution and modification follow.
|
||||||
|
|
||||||
|
|
||||||
2. DEFINITIONS
|
2. DEFINITIONS
|
||||||
|
|
||||||
2.1 This License applies to any program (or other "work") which
|
2.1 This License applies to any program (or other "work") which
|
||||||
contains a notice placed by the copyright holder saying it may be
|
contains a notice placed by the copyright holder saying it may be
|
||||||
distributed under the terms of this 3dfx GLIDE Source Code General
|
distributed under the terms of this 3dfx GLIDE Source Code General
|
||||||
Public License.
|
Public License.
|
||||||
|
|
||||||
2.2 The term "Program" as used in this Agreement refers to 3DFX's
|
2.2 The term "Program" as used in this Agreement refers to 3DFX's
|
||||||
GLIDE source code and object code and any Derivative Work.
|
GLIDE source code and object code and any Derivative Work.
|
||||||
|
|
||||||
2.3 "Derivative Work" means, for the purpose of the License, that
|
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 any work that contains the Program or the identifiable
|
||||||
portion of a work that is derived from the Program, either verbatim or
|
portion of a work that is derived from the Program, either verbatim or
|
||||||
with modifications and/or translated into another language, and that
|
with modifications and/or translated into another language, and that
|
||||||
performs 3D graphics API operations. It does not include any other
|
performs 3D graphics API operations. It does not include any other
|
||||||
portions of a work.
|
portions of a work.
|
||||||
|
|
||||||
2.4 "Modifications of the Program" means any work, which includes a
|
2.4 "Modifications of the Program" means any work, which includes a
|
||||||
Derivative Work, and includes the whole of such work.
|
Derivative Work, and includes the whole of such work.
|
||||||
|
|
||||||
2.5 "License" means this 3dfx GLIDE Source Code General Public License.
|
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
|
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
|
for making modifications to it. For an executable work, complete source
|
||||||
code means all the source code for all modules it contains, any
|
code means all the source code for all modules it contains, any
|
||||||
associated interface definition files, and the scripts used to control
|
associated interface definition files, and the scripts used to control
|
||||||
compilation and installation of the executable work.
|
compilation and installation of the executable work.
|
||||||
|
|
||||||
2.7 "3dfx" means 3dfx Interactive, Inc.
|
2.7 "3dfx" means 3dfx Interactive, Inc.
|
||||||
|
|
||||||
|
|
||||||
3. LICENSED ACTIVITIES
|
3. LICENSED ACTIVITIES
|
||||||
|
|
||||||
3.1 COPYING - You may copy and distribute verbatim copies of the
|
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
|
Program's Source Code as you receive it, in any medium, subject to the
|
||||||
provision of section 3.3 and provided also that:
|
provision of section 3.3 and provided also that:
|
||||||
|
|
||||||
(a) you conspicuously and appropriately publish on each copy
|
(a) you conspicuously and appropriately publish on each copy
|
||||||
an appropriate copyright notice (3dfx Interactive, Inc. 1999), a notice
|
an appropriate copyright notice (3dfx Interactive, Inc. 1999), a notice
|
||||||
that recipients who wish to copy, distribute or modify the Program can
|
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
|
only do so subject to this License, and a disclaimer of warranty as
|
||||||
set forth in section 5;
|
set forth in section 5;
|
||||||
|
|
||||||
(b) keep intact all the notices that refer to this License and
|
(b) keep intact all the notices that refer to this License and
|
||||||
to the absence of any warranty; and
|
to the absence of any warranty; and
|
||||||
|
|
||||||
(c) do not make any use of the GLIDE trademark without the prior
|
(c) do not make any use of the GLIDE trademark without the prior
|
||||||
written permission of 3dfx, and
|
written permission of 3dfx, and
|
||||||
|
|
||||||
(d) give all recipients of the Program a copy of this License
|
(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
|
along with the Program or instructions on how to easily receive a copy
|
||||||
of this License.
|
of this License.
|
||||||
|
|
||||||
|
|
||||||
3.2 MODIFICATION OF THE PROGRAM/DERIVATIVE WORKS - You may modify your
|
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
|
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
|
distribute such modifications subject to the provisions of section 3.3
|
||||||
and provided that you also meet all of the following conditions:
|
and provided that you also meet all of the following conditions:
|
||||||
|
|
||||||
(a) you conspicuously and appropriately publish on each copy
|
(a) you conspicuously and appropriately publish on each copy
|
||||||
of a Derivative Work an appropriate copyright notice, a notice that
|
of a Derivative Work an appropriate copyright notice, a notice that
|
||||||
recipients who wish to copy, distribute or modify the Derivative Work
|
recipients who wish to copy, distribute or modify the Derivative Work
|
||||||
can only do so subject to this License, and a disclaimer of warranty
|
can only do so subject to this License, and a disclaimer of warranty
|
||||||
as set forth in section 5;
|
as set forth in section 5;
|
||||||
|
|
||||||
(b) keep intact all the notices that refer to this License and
|
(b) keep intact all the notices that refer to this License and
|
||||||
to the absence of any warranty; and
|
to the absence of any warranty; and
|
||||||
|
|
||||||
(c) give all recipients of the Derivative Work a copy of this
|
(c) give all recipients of the Derivative Work a copy of this
|
||||||
License along with the Derivative Work or instructions on how to easily
|
License along with the Derivative Work or instructions on how to easily
|
||||||
receive a copy of this License.
|
receive a copy of this License.
|
||||||
|
|
||||||
(d) You must cause the modified files of the Derivative Work
|
(d) You must cause the modified files of the Derivative Work
|
||||||
to carry prominent notices stating that you changed the files and the
|
to carry prominent notices stating that you changed the files and the
|
||||||
date of any change.
|
date of any change.
|
||||||
|
|
||||||
(e) You must cause any Derivative Work that you distribute or
|
(e) You must cause any Derivative Work that you distribute or
|
||||||
publish to be licensed at no charge to all third parties under the
|
publish to be licensed at no charge to all third parties under the
|
||||||
terms of this License.
|
terms of this License.
|
||||||
|
|
||||||
(f) You do not make any use of the GLIDE trademark without the
|
(f) You do not make any use of the GLIDE trademark without the
|
||||||
prior written permission of 3dfx.
|
prior written permission of 3dfx.
|
||||||
|
|
||||||
(g) If the Derivative Work normally reads commands
|
(g) If the Derivative Work normally reads commands
|
||||||
interactively when run, you must cause it, when started running for
|
interactively when run, you must cause it, when started running for
|
||||||
such interactive use, to print or display an announcement as follows:
|
such interactive use, to print or display an announcement as follows:
|
||||||
|
|
||||||
"COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED THIS
|
"COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED THIS
|
||||||
SOFTWARE IS FREE AND PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND,
|
SOFTWARE IS FREE AND PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND,
|
||||||
EITHER EXPRESSED OR IMPLIED. THERE IS NO RIGHT TO USE THE GLIDE
|
EITHER EXPRESSED OR IMPLIED. THERE IS NO RIGHT TO USE THE GLIDE
|
||||||
TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX INTERACTIVE,
|
TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX INTERACTIVE,
|
||||||
INC. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A FULL TEXT OF THE
|
INC. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A FULL TEXT OF THE
|
||||||
DISTRIBUTION AND NON-WARRANTY PROVISIONS (REQUEST COPY FROM
|
DISTRIBUTION AND NON-WARRANTY PROVISIONS (REQUEST COPY FROM
|
||||||
INFO@3DFX.COM)."
|
INFO@3DFX.COM)."
|
||||||
|
|
||||||
(h) The requirements of this section 3.2 do not apply to the
|
(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
|
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
|
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
|
work written entirely by you; rather, the intent is to exercise the
|
||||||
right to control the distribution of Derivative Works.
|
right to control the distribution of Derivative Works.
|
||||||
|
|
||||||
|
|
||||||
3.3 DISTRIBUTION
|
3.3 DISTRIBUTION
|
||||||
|
|
||||||
(a) All copies of the Program or Derivative Works which are
|
(a) All copies of the Program or Derivative Works which are
|
||||||
distributed must include in the file headers the following language
|
distributed must include in the file headers the following language
|
||||||
verbatim:
|
verbatim:
|
||||||
|
|
||||||
"THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED
|
"THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED
|
||||||
ONLY PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO
|
ONLY PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO
|
||||||
RIGHT TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF
|
RIGHT TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF
|
||||||
3DFX INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM
|
3DFX INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM
|
||||||
THE DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC (info@3dfx.com).
|
THE DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC (info@3dfx.com).
|
||||||
THIS PROGRAM. IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
THIS PROGRAM. IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||||
EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
|
||||||
FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
FULL TEXT OF THE NON-WARRANTY PROVISIONS.
|
||||||
|
|
||||||
USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
|
||||||
RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS
|
RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS
|
||||||
IN TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
|
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
|
AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
|
||||||
SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
|
||||||
THE UNITED STATES.
|
THE UNITED STATES.
|
||||||
|
|
||||||
COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED"
|
COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED"
|
||||||
|
|
||||||
(b) You may distribute the Program or a Derivative Work in
|
(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
|
object code or executable form under the terms of Sections 3.1 and 3.2
|
||||||
provided that you also do one of the following:
|
provided that you also do one of the following:
|
||||||
|
|
||||||
(1) Accompany it with the complete corresponding
|
(1) Accompany it with the complete corresponding
|
||||||
machine-readable source code, which must be distributed under the
|
machine-readable source code, which must be distributed under the
|
||||||
terms of Sections 3.1 and 3.2; or,
|
terms of Sections 3.1 and 3.2; or,
|
||||||
|
|
||||||
(2) Accompany it with a written offer, valid for at
|
(2) Accompany it with a written offer, valid for at
|
||||||
least three years, to give any third party, for a charge no more than
|
least three years, to give any third party, for a charge no more than
|
||||||
your cost of physically performing source distribution, a complete
|
your cost of physically performing source distribution, a complete
|
||||||
machine-readable copy of the corresponding source code, to be
|
machine-readable copy of the corresponding source code, to be
|
||||||
distributed under the terms of Sections 3.1 and 3.2 on a medium
|
distributed under the terms of Sections 3.1 and 3.2 on a medium
|
||||||
customarily used for software interchange; or,
|
customarily used for software interchange; or,
|
||||||
|
|
||||||
(3) Accompany it with the information you received as
|
(3) Accompany it with the information you received as
|
||||||
to the offer to distribute corresponding source code. (This alternative
|
to the offer to distribute corresponding source code. (This alternative
|
||||||
is allowed only for noncommercial distribution and only if you received
|
is allowed only for noncommercial distribution and only if you received
|
||||||
the program in object code or executable form with such an offer, in
|
the program in object code or executable form with such an offer, in
|
||||||
accord with Subsection 3.3(b)(2) above.)
|
accord with Subsection 3.3(b)(2) above.)
|
||||||
|
|
||||||
(c) The source code distributed need not include anything
|
(c) The source code distributed need not include anything
|
||||||
that is normally distributed (in either source or binary form) with
|
that is normally distributed (in either source or binary form) with
|
||||||
the major components (compiler, kernel, and so on) of the operating
|
the major components (compiler, kernel, and so on) of the operating
|
||||||
system on which the executable runs, unless that component itself
|
system on which the executable runs, unless that component itself
|
||||||
accompanies the executable code.
|
accompanies the executable code.
|
||||||
|
|
||||||
(d) If distribution of executable code or object code is made
|
(d) If distribution of executable code or object code is made
|
||||||
by offering access to copy from a designated place, then offering
|
by offering access to copy from a designated place, then offering
|
||||||
equivalent access to copy the source code from the same place counts
|
equivalent access to copy the source code from the same place counts
|
||||||
as distribution of the source code, even though third parties are not
|
as distribution of the source code, even though third parties are not
|
||||||
compelled to copy the source along with the object code.
|
compelled to copy the source along with the object code.
|
||||||
|
|
||||||
(e) Each time you redistribute the Program or any Derivative
|
(e) Each time you redistribute the Program or any Derivative
|
||||||
Work, the recipient automatically receives a license from 3dfx and
|
Work, the recipient automatically receives a license from 3dfx and
|
||||||
successor licensors to copy, distribute or modify the Program and
|
successor licensors to copy, distribute or modify the Program and
|
||||||
Derivative Works subject to the terms and conditions of the License.
|
Derivative Works subject to the terms and conditions of the License.
|
||||||
You may not impose any further restrictions on the recipients'
|
You may not impose any further restrictions on the recipients'
|
||||||
exercise of the rights granted herein. You are not responsible for
|
exercise of the rights granted herein. You are not responsible for
|
||||||
enforcing compliance by third parties to this License.
|
enforcing compliance by third parties to this License.
|
||||||
|
|
||||||
(f) You may not make any use of the GLIDE trademark without
|
(f) You may not make any use of the GLIDE trademark without
|
||||||
the prior written permission of 3dfx.
|
the prior written permission of 3dfx.
|
||||||
|
|
||||||
(g) You may not copy, modify, sublicense, or distribute the
|
(g) You may not copy, modify, sublicense, or distribute the
|
||||||
Program or any Derivative Works except as expressly provided under
|
Program or any Derivative Works except as expressly provided under
|
||||||
this License. Any attempt otherwise to copy, modify, sublicense or
|
this License. Any attempt otherwise to copy, modify, sublicense or
|
||||||
distribute the Program or any Derivative Works is void, and will
|
distribute the Program or any Derivative Works is void, and will
|
||||||
automatically terminate your rights under this License. However,
|
automatically terminate your rights under this License. However,
|
||||||
parties who have received copies, or rights, from you under this
|
parties who have received copies, or rights, from you under this
|
||||||
License will not have their licenses terminated so long as such
|
License will not have their licenses terminated so long as such
|
||||||
parties remain in full compliance.
|
parties remain in full compliance.
|
||||||
|
|
||||||
|
|
||||||
4. MISCELLANEOUS
|
4. MISCELLANEOUS
|
||||||
|
|
||||||
4.1 Acceptance of this License is voluntary. By using, modifying or
|
4.1 Acceptance of this License is voluntary. By using, modifying or
|
||||||
distributing the Program or any Derivative Work, you indicate your
|
distributing the Program or any Derivative Work, you indicate your
|
||||||
acceptance of this License to do so, and all its terms and conditions
|
acceptance of this License to do so, and all its terms and conditions
|
||||||
for copying, distributing or modifying the Program or works based on
|
for copying, distributing or modifying the Program or works based on
|
||||||
it. Nothing else grants you permission to modify or distribute the
|
it. Nothing else grants you permission to modify or distribute the
|
||||||
Program or Derivative Works and doing so without acceptance of this
|
Program or Derivative Works and doing so without acceptance of this
|
||||||
License is in violation of the U.S. and international copyright laws.
|
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
|
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
|
is restricted in certain countries either by patents or by copyrighted
|
||||||
interfaces, the original copyright holder who places the Program under
|
interfaces, the original copyright holder who places the Program under
|
||||||
this License may add an explicit geographical distribution limitation
|
this License may add an explicit geographical distribution limitation
|
||||||
excluding those countries, so that distribution is permitted only in
|
excluding those countries, so that distribution is permitted only in
|
||||||
or among countries not thus excluded. In such case, this License
|
or among countries not thus excluded. In such case, this License
|
||||||
incorporates the limitation as if written in the body of 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
|
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 and you consent to personal jurisdiction in the
|
||||||
State of California in the event it is necessary to enforce the
|
State of California in the event it is necessary to enforce the
|
||||||
provisions of this License.
|
provisions of this License.
|
||||||
|
|
||||||
|
|
||||||
5. NO WARRANTIES
|
5. NO WARRANTIES
|
||||||
|
|
||||||
5.1 TO THE EXTENT PERMITTED BY APPLICABLE LAW, THERE IS NO WARRANTY
|
5.1 TO THE EXTENT PERMITTED BY APPLICABLE LAW, THERE IS NO WARRANTY
|
||||||
FOR THE PROGRAM. OR DERIVATIVE WORKS THE COPYRIGHT HOLDERS AND/OR
|
FOR THE PROGRAM. OR DERIVATIVE WORKS THE COPYRIGHT HOLDERS AND/OR
|
||||||
OTHER PARTIES PROVIDE THE PROGRAM AND ANY DERIVATIVE WORKS"AS IS"
|
OTHER PARTIES PROVIDE THE PROGRAM AND ANY DERIVATIVE WORKS"AS IS"
|
||||||
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
||||||
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY
|
FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY
|
||||||
AND PERFORMANCE OF THE PROGRAM AND ANY DERIVATIVE WORK IS WITH YOU.
|
AND PERFORMANCE OF THE PROGRAM AND ANY DERIVATIVE WORK IS WITH YOU.
|
||||||
SHOULD THE PROGRAM OR ANY DERIVATIVE WORK PROVE DEFECTIVE, YOU ASSUME
|
SHOULD THE PROGRAM OR ANY DERIVATIVE WORK PROVE DEFECTIVE, YOU ASSUME
|
||||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
5.2 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL 3DFX
|
5.2 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL 3DFX
|
||||||
INTERACTIVE, INC., OR ANY OTHER COPYRIGHT HOLDER, OR ANY OTHER PARTY
|
INTERACTIVE, INC., OR ANY OTHER COPYRIGHT HOLDER, OR ANY OTHER PARTY
|
||||||
WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM OR DERIVATIVE WORKS AS
|
WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM OR DERIVATIVE WORKS AS
|
||||||
PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
|
PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
|
||||||
SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
|
SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
|
||||||
INABILITY TO USE THE PROGRAM OR DERIVATIVE WORKS (INCLUDING BUT NOT
|
INABILITY TO USE THE PROGRAM OR DERIVATIVE WORKS (INCLUDING BUT NOT
|
||||||
LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES
|
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
|
SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM OR
|
||||||
DERIVATIVE WORKS TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH
|
DERIVATIVE WORKS TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH
|
||||||
HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||||
DAMAGES.
|
DAMAGES.
|
||||||
|
|
||||||
|
|||||||
133
glide3x/INSTALL
133
glide3x/INSTALL
@@ -1,133 +0,0 @@
|
|||||||
QuickStart Instructions
|
|
||||||
=======================
|
|
||||||
% ./chores.3dfx --clean --generate \
|
|
||||||
--configure[=whatever configuration options you want] \
|
|
||||||
--build
|
|
||||||
% cd build
|
|
||||||
% ./build.3dfx install
|
|
||||||
N.B.: The last command may have to be executed as root. It will
|
|
||||||
install libglide3x.so into /usr/lib, and the glide include
|
|
||||||
files into /usr/include/glide3.
|
|
||||||
|
|
||||||
SwiftButNotQuickButMoreConventionalStart Instructions
|
|
||||||
=====================================================
|
|
||||||
% aclocal && automake && autoconf
|
|
||||||
% mkdir build
|
|
||||||
% cd build
|
|
||||||
% ../configure [ whatever options you want ]
|
|
||||||
% make -f makefile.autoconf all 2>&1 | tee make.hst
|
|
||||||
|
|
||||||
SlowStart Instructions
|
|
||||||
======================
|
|
||||||
This is generally a standard GNU automake/autoconf project.
|
|
||||||
o There is a script named "configure" in the root of the
|
|
||||||
source directory which creates makefiles with parameters
|
|
||||||
set as appropriate for a particular system.
|
|
||||||
o We use automake to make makefile templates and autoconf
|
|
||||||
to make a configure script from configure.in.
|
|
||||||
|
|
||||||
However, there are some small wrinkles.
|
|
||||||
0.) Building from the CVS archive requires several tools,
|
|
||||||
notably automake autoconf and libtool. These, in
|
|
||||||
turn, have their own requirements. The versions of some of the
|
|
||||||
tools used to create the configuration are:
|
|
||||||
o automake: 1.4
|
|
||||||
o autoconf: 2.13
|
|
||||||
o libtool: 1.3.3
|
|
||||||
o GNU m4: 1.4 (used by autoconf.)
|
|
||||||
o perl 5.005_03
|
|
||||||
FWIW, this was debugged on a Debian distribution, using
|
|
||||||
a not-completely-current frozen release.
|
|
||||||
1.) The makefiles are all named makefile.autoconf. This is because
|
|
||||||
the Glide code is built for several platforms, one of which
|
|
||||||
is Win32. The Win32 build uses the name makefile, and so we need
|
|
||||||
to use another. Except for the top build, the makefile.autoconf
|
|
||||||
makefiles take care of choosing the right names. (But see
|
|
||||||
the note below about build.3dfx.)
|
|
||||||
2.) The (canonical) sequence of files is:
|
|
||||||
makefile.autoconf.am --> makefile.autoconf.in (b)
|
|
||||||
--> makefile.autoconf (c)
|
|
||||||
Note:
|
|
||||||
(a) You will have to run aclocal before automake.
|
|
||||||
(b) makefile.autoconf.in is created by automake as usual.
|
|
||||||
(c) makefile.autoconf is created by the configure script,
|
|
||||||
as usual. It is the concatenation of the
|
|
||||||
makefile.autoconf.in file created by automake, and
|
|
||||||
some constant boilerplate from the file
|
|
||||||
swlibs/include/make/makefile.autoconf.bottom
|
|
||||||
3.) The configuration options are:
|
|
||||||
--enable-fx-debug: Build for debugging. This is
|
|
||||||
actually the default. Turn it
|
|
||||||
off by --disable-fx-debug or
|
|
||||||
else --enable-fx-debug=no.
|
|
||||||
--enable-fx-glide-hw=<asic> Build for the given asic.
|
|
||||||
asic HW
|
|
||||||
h5 Voodoo4/VoodooV
|
|
||||||
h3 Voodoo3/Banshee
|
|
||||||
cvg Voodoo2. (It's not clear that this
|
|
||||||
works at all.)
|
|
||||||
--enable-fx-dri-build Make links called *.c to the files
|
|
||||||
named *.c.dri. This will build
|
|
||||||
h3 for DRI. To build h3 stand alone,
|
|
||||||
use --disable-fx-dri-build.
|
|
||||||
--enable-amd3d Build with 3DNow instructions.
|
|
||||||
--enable-fx-texus=library Choose which texture manipulation
|
|
||||||
library to use. The default value,
|
|
||||||
texus, is the only one which is
|
|
||||||
currently functional.
|
|
||||||
--enable-build-architecture Choose which architecture to build
|
|
||||||
for. The legal values are i[3456]86,
|
|
||||||
or the alpha.
|
|
||||||
4.) There is a script, build.3dfx, which is installed by the
|
|
||||||
configure script at the root of every build directory. It
|
|
||||||
is essentially the single line:
|
|
||||||
make -f makefile.autoconf "$@"2>&1
|
|
||||||
however, there is some cruft to determine how much time and
|
|
||||||
disk space is used by the compilation. There is also some
|
|
||||||
stuff there to put information in the title bar of xterms,
|
|
||||||
because I like it. If you don't like this, don't use it,
|
|
||||||
and build your own script.
|
|
||||||
5.) There is a second script, chores.3dfx, which takes care of some
|
|
||||||
chores, such as cleaning emacs backup files, deleting old makefiles,
|
|
||||||
generating new makefiles and configuring. I find this is useful,
|
|
||||||
but it is not required. The --help command gives usage.
|
|
||||||
6.) A special note about H3:
|
|
||||||
The Glide3 H3 source can be built as a DRI client or as a
|
|
||||||
stand alone library. Controlling which gets built is done by
|
|
||||||
setting up symlinks. The configuration script sets up the
|
|
||||||
symlinks in the build directory.
|
|
||||||
|
|
||||||
To setup glide3x/h3 to build as a DRI client, configure with
|
|
||||||
the --enable-fx-dri-build. To setup glide3x/h3 to build as a
|
|
||||||
stand alone client, configure with --disable-fx-dri-build.
|
|
||||||
|
|
||||||
The default is to build as a DRI client.
|
|
||||||
7.) A special note about H5:
|
|
||||||
The Glide3 H5 source can only be built as a DRI client, so the
|
|
||||||
symlinks necessary for the H3 tree are not necessary for the H3
|
|
||||||
tree.
|
|
||||||
|
|
||||||
So, to make things from absolute scratch, run one of these command
|
|
||||||
sequences:
|
|
||||||
1.) Using chores.3dfx
|
|
||||||
% ./chores.3dfx --clean --generate --configure --build
|
|
||||||
This will build in a directory named "build". If you want to
|
|
||||||
use another name, use "--build=build_dir". For example,
|
|
||||||
--build=/tmp/glide.build
|
|
||||||
2.) Not using chores.3dfx
|
|
||||||
#
|
|
||||||
# Create the makefile.autoconf files.
|
|
||||||
#
|
|
||||||
% aclocal && automake && autoconf
|
|
||||||
#
|
|
||||||
# Make a build directory and configure it.
|
|
||||||
#
|
|
||||||
% mkdir build
|
|
||||||
% cd build
|
|
||||||
% ../configure [whatever options you want here]
|
|
||||||
#
|
|
||||||
# Build everything, using one of these two commands:
|
|
||||||
1.) % ./build.3dfx all | tee make.hst
|
|
||||||
2.) % make -f makefile.autoconf all 2>&1 | tee make.hst
|
|
||||||
#
|
|
||||||
#
|
|
||||||
56
glide3x/Linux-portability.txt
Normal file
56
glide3x/Linux-portability.txt
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
Glide3 (for Linux) was originally written for x86 only but work has been done
|
||||||
|
and is ongoing to make it work on other platforms too:
|
||||||
|
|
||||||
|
Glide3 was not only written for Linux-x86 but also for dos,windows and mac.
|
||||||
|
The triangle setup code of the dos/windows/linux-x86 code is written in
|
||||||
|
x86-assembler. Luckily there are C-equivalents for those functions written
|
||||||
|
for the mac. These C-equivalents are enabled by defining GLIDE_USE_C_TRISETUP.
|
||||||
|
|
||||||
|
The x86-asm triangle setup code comes in multiple variants for different
|
||||||
|
x86-CPU's. Glide3 chooses runtime between these variants depending on the
|
||||||
|
CPU it is actually running on. The cpu detection (cpuid) code nescesarry for
|
||||||
|
this is also written in assembler. Recently this code has been wrapped with
|
||||||
|
#ifdef GL_X86.
|
||||||
|
|
||||||
|
The defining of GL_X86 or GLIDE_USE_C_TRISETUP is controleled by passing
|
||||||
|
USE_X86=1 to the makefile. Glide3 has been successfully tested on x86 without
|
||||||
|
USE_X86=1 passed to the makefile for the cvg h3 and h5 asics. IOW this has not
|
||||||
|
been tested for the sst1 and sst96 asics.
|
||||||
|
|
||||||
|
Even if compiled without GL_X86 defined and with GLIDE_USE_C_TRISETUP
|
||||||
|
defined the Glide3 code still contains a small piece of assembler: The
|
||||||
|
P6FENCE macro, this macro is used for io synchronisation and needs to be
|
||||||
|
defined for each platform you want to compile Glide3 on. You can find it in,
|
||||||
|
and to add a new platfrom need to add a define to:
|
||||||
|
cvg/init/sst1init.h
|
||||||
|
cvg/glide3/src/fxglide.h
|
||||||
|
h3/minihwc/minihwc.c
|
||||||
|
h3/minihwc/linhwc.c
|
||||||
|
h3/glide3/src/fxglide.h
|
||||||
|
h5/minihwc/minihwc.c
|
||||||
|
h5/minihwc/linhwc.c
|
||||||
|
h5/glide3/src/fxglide.h
|
||||||
|
sst1/init/initvg/sst1init.h
|
||||||
|
Currently for Linux there is a version of the P6FENCE macro for the following
|
||||||
|
platforms: x86, x86_64, ia64, alpha .
|
||||||
|
|
||||||
|
The original Glide3 code is not 64 bit clean, longs where used for 32 bits
|
||||||
|
registers, ptrs casted to and stored as ints, etc. RedHat has created and
|
||||||
|
tested a 64bit clean version of Glide3 for h5 and h3. This work has been
|
||||||
|
merged into current CVS, however this was based in an older Glide3 version,
|
||||||
|
so h5 and h3 might not be completely 64 bit clean. The other asics are far
|
||||||
|
from 64 bit clean. The Debian Glide3 package also contain some 64 bit
|
||||||
|
patches, these are probably equivalent to the RedHat ones, but might be
|
||||||
|
worth a look.
|
||||||
|
|
||||||
|
Last but not least some C-functions take the address of their first parameter
|
||||||
|
and assume this can be used as an array, iow they assume a certain stack
|
||||||
|
layout. Known functions doing this are:
|
||||||
|
cvg/glide3/src/gdraw.c:1142: _vptrisetup_cull
|
||||||
|
h5/glide3/src/gdraw.c:279: grDrawLine
|
||||||
|
|
||||||
|
64 bit todo:
|
||||||
|
-change use of long to int in texus2
|
||||||
|
-change use of long to FxX32 in register definitions of cvg, sst1, sst96
|
||||||
|
-actually compile it on a 64 bit platform and fix all warnings
|
||||||
|
-test, test, test
|
||||||
73
glide3x/Makefile.DJ
Normal file
73
glide3x/Makefile.DJ
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
# DOS/DJGPP makefile for Glide3 and Texus2
|
||||||
|
#
|
||||||
|
# Copyright (c) 2003 - Daniel Borca
|
||||||
|
# Email : dborca@users.sourceforge.net
|
||||||
|
# Web : http://www.geocities.com/dborca
|
||||||
|
#
|
||||||
|
# $Header$
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Available options:
|
||||||
|
#
|
||||||
|
# Environment variables:
|
||||||
|
# FX_GLIDE_HW build for the given ASIC (sst1, sst96, cvg, h3, h5).
|
||||||
|
# default = h5
|
||||||
|
# H4=1 High speed Avenger/Napalm.
|
||||||
|
# target = h3, h5
|
||||||
|
# default = no
|
||||||
|
# OPTFLAGS pass given optimization flags to compiler
|
||||||
|
# target = sst1, sst96, cvg, h3, h5
|
||||||
|
# default = -O2 -ffast-math
|
||||||
|
# DEBUG=1 enable debugging checks and messages
|
||||||
|
# target = sst1, sst96, cvg, h3, h5
|
||||||
|
# default = no
|
||||||
|
# USE_X86=1 use assembler triangle specializations; req by CVG
|
||||||
|
# target = sst1, sst96, cvg, h3, h5
|
||||||
|
# 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, h5
|
||||||
|
# default = no
|
||||||
|
# USE_MMX=1 (see USE_3DNOW)
|
||||||
|
# target = h5
|
||||||
|
# default = no
|
||||||
|
# USE_SSE=1 (see USE_3DNOW)
|
||||||
|
# target = h5
|
||||||
|
# default = no
|
||||||
|
# USE_SSE2=1 (see USE_3DNOW)
|
||||||
|
# target = h5
|
||||||
|
# default = no
|
||||||
|
# TEXUS2=1 embed Texus2 functions into Glide3.
|
||||||
|
# target = sst1, sst96, cvg, h3, h5
|
||||||
|
# default = no
|
||||||
|
#
|
||||||
|
# Targets:
|
||||||
|
# all: build everything
|
||||||
|
# clean: remove object files
|
||||||
|
# realclean: remove all generated files
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: all clean realclean
|
||||||
|
|
||||||
|
export BUILD_NUMBER = 40404
|
||||||
|
export FX_GLIDE_HW ?= h5
|
||||||
|
|
||||||
|
ifeq ($(FX_GLIDE_HW),sst96)
|
||||||
|
G3_DIR = sst1/glide3/src
|
||||||
|
else
|
||||||
|
G3_DIR = $(FX_GLIDE_HW)/glide3/src
|
||||||
|
endif
|
||||||
|
|
||||||
|
all:
|
||||||
|
make -f Makefile.DJ -C $(G3_DIR)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
make -f Makefile.DJ -C $(G3_DIR) clean
|
||||||
|
|
||||||
|
realclean:
|
||||||
|
make -f Makefile.DJ -C $(G3_DIR) realclean
|
||||||
74
glide3x/Makefile.wat
Normal file
74
glide3x/Makefile.wat
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
# OpenWatcom makefile for Glide3 and Texus2
|
||||||
|
# This makefile MUST be processed by GNU make!!!
|
||||||
|
#
|
||||||
|
# Copyright (c) 2003 - Daniel Borca
|
||||||
|
# Email : dborca@users.sourceforge.net
|
||||||
|
# Web : http://www.geocities.com/dborca
|
||||||
|
#
|
||||||
|
# $Header$
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Available options:
|
||||||
|
#
|
||||||
|
# Environment variables:
|
||||||
|
# FX_GLIDE_HW build for the given ASIC (sst1, sst96, cvg, h3, h5).
|
||||||
|
# default = h5
|
||||||
|
# H4=1 High speed Avenger/Napalm.
|
||||||
|
# target = h3, h5
|
||||||
|
# default = no
|
||||||
|
# OPTFLAGS pass given optimization flags to compiler
|
||||||
|
# target = sst1, sst96, cvg, h3, h5
|
||||||
|
# default = -ox -5s (Pentium, stack)
|
||||||
|
# DEBUG=1 enable debugging checks and messages
|
||||||
|
# target = sst1, sst96, cvg, h3, h5
|
||||||
|
# default = no
|
||||||
|
# USE_X86=1 use assembler triangle specializations; req by CVG
|
||||||
|
# target = sst1, sst96, cvg, h3, h5
|
||||||
|
# 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, h5
|
||||||
|
# default = no
|
||||||
|
# USE_MMX=1 (see USE_3DNOW)
|
||||||
|
# target = h5
|
||||||
|
# default = no
|
||||||
|
# USE_SSE=1 (see USE_3DNOW)
|
||||||
|
# target = h5
|
||||||
|
# default = no
|
||||||
|
# USE_SSE2=1 (see USE_3DNOW)
|
||||||
|
# target = h5
|
||||||
|
# default = no
|
||||||
|
# TEXUS2=1 embed Texus2 functions into Glide3.
|
||||||
|
# target = sst1, sst96, cvg, h3, h5
|
||||||
|
# default = no
|
||||||
|
#
|
||||||
|
# Targets:
|
||||||
|
# all: build everything
|
||||||
|
# clean: remove object files
|
||||||
|
# realclean: remove all generated files
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: all clean realclean
|
||||||
|
|
||||||
|
export BUILD_NUMBER = 40404
|
||||||
|
export FX_GLIDE_HW ?= h5
|
||||||
|
|
||||||
|
ifeq ($(FX_GLIDE_HW),sst96)
|
||||||
|
G3_DIR = sst1/glide3/src
|
||||||
|
else
|
||||||
|
G3_DIR = $(FX_GLIDE_HW)/glide3/src
|
||||||
|
endif
|
||||||
|
|
||||||
|
all:
|
||||||
|
make -f Makefile.wat -C $(G3_DIR)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
make -f Makefile.wat -C $(G3_DIR) clean
|
||||||
|
|
||||||
|
realclean:
|
||||||
|
make -f Makefile.wat -C $(G3_DIR) realclean
|
||||||
74
glide3x/Makefile.win32
Normal file
74
glide3x/Makefile.win32
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
# Win32 makefile for Glide3 and Texus2
|
||||||
|
# This makefile MUST be processed by GNU make!!!
|
||||||
|
#
|
||||||
|
# Copyright (c) 2003 - Daniel Borca
|
||||||
|
# Email : dborca@users.sourceforge.net
|
||||||
|
# Web : http://www.geocities.com/dborca
|
||||||
|
#
|
||||||
|
# $Header$
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Available options:
|
||||||
|
#
|
||||||
|
# Environment variables:
|
||||||
|
# FX_GLIDE_HW build for the given ASIC (sst1, sst96, cvg, h3, h5).
|
||||||
|
# default = h5
|
||||||
|
# H4=1 High speed Avenger/Napalm.
|
||||||
|
# target = h3, h5
|
||||||
|
# default = no
|
||||||
|
# OPTFLAGS pass given optimization flags to compiler
|
||||||
|
# target = sst1, sst96, cvg, h3, h5
|
||||||
|
# default = -G6 -O2 (or -Od if DEBUG=1)
|
||||||
|
# DEBUG=1 enable debugging checks and messages
|
||||||
|
# target = sst1, sst96, cvg, h3, h5
|
||||||
|
# default = no
|
||||||
|
# USE_X86=1 use assembler triangle specializations; req by CVG
|
||||||
|
# target = sst1, sst96, cvg, h3, h5
|
||||||
|
# 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, h5
|
||||||
|
# default = no
|
||||||
|
# USE_MMX=1 (see USE_3DNOW)
|
||||||
|
# target = h5
|
||||||
|
# default = no
|
||||||
|
# USE_SSE=1 (see USE_3DNOW)
|
||||||
|
# target = h5
|
||||||
|
# default = no
|
||||||
|
# USE_SSE2=1 (see USE_3DNOW)
|
||||||
|
# target = h5
|
||||||
|
# default = no
|
||||||
|
# TEXUS2=1 embed Texus2 functions into Glide3.
|
||||||
|
# target = sst1, sst96, cvg, h3, h5
|
||||||
|
# default = no
|
||||||
|
#
|
||||||
|
# Targets:
|
||||||
|
# all: build everything
|
||||||
|
# clean: remove object files
|
||||||
|
# realclean: remove all generated files
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: all clean realclean
|
||||||
|
|
||||||
|
export BUILD_NUMBER = 40404
|
||||||
|
export FX_GLIDE_HW ?= h5
|
||||||
|
|
||||||
|
ifeq ($(FX_GLIDE_HW),sst96)
|
||||||
|
G3_DIR = sst1/glide3/src
|
||||||
|
else
|
||||||
|
G3_DIR = $(FX_GLIDE_HW)/glide3/src
|
||||||
|
endif
|
||||||
|
|
||||||
|
all:
|
||||||
|
make -f Makefile.win32 -C $(G3_DIR)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
make -f Makefile.win32 -C $(G3_DIR) clean
|
||||||
|
|
||||||
|
realclean:
|
||||||
|
make -f Makefile.win32 -C $(G3_DIR) realclean
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user