cleanup mess

This commit is contained in:
ABelliqueux 2021-01-05 13:28:16 +01:00
parent db7e7db2e5
commit 01984bbb7d
6 changed files with 7859 additions and 225 deletions

View File

@ -1,10 +1,8 @@
TARGET = primdrawGT-db-abs
TARGET = primdrawGT
TYPE = ps-exe
SRCS = primdrawGT-db-abs.c \
SRCS = primdrawGT.c \
../common/crt0/crt0.s \
#~ TIM/cube.tim \
#~ TIM/bousai.tim \
TIM/home.tim \
CPPFLAGS += -I../psyq/include

BIN
TIM/home.tim Normal file

Binary file not shown.

528
coridor.c
View File

@ -1,101 +1,106 @@
typedef struct {
TMESH * tmesh;
int * index;
TIM_IMAGE * tim;
u_long * tim_data;
TMESH * tmesh;
int * index;
TIM_IMAGE * tim;
u_long * tim_data;
MATRIX * mat;
VECTOR * pos;
SVECTOR * rot;
short * isPrism;
long * p;
} MESH;
SVECTOR modelCube_mesh[] = {
{-56.728477478027344,70.00000476837158,-122.00001239776611},
{-236.72844886779785,190.00001907348633,-302.00002670288086},
{123.27152252197266,190.00000476837158,-122.00001239776611},
{63.271522521972656,129.99999046325684,177.99997329711914},
{-176.7284631729126,70.00000476837158,-122.00001239776611},
{-236.72844886779785,70.00001192092896,-182.0000123977661},
{-176.7284631729126,190.00001907348633,-242.00002670288086},
{-56.728477478027344,190.00001907348633,-242.00002670288086},
{-176.7284631729126,190.00001907348633,-302.00002670288086},
{-116.7284631729126,190.00001907348633,-302.00002670288086},
{3.2715225219726562,190.00001907348633,-242.00002670288086},
{63.271522521972656,190.00001907348633,-242.00002670288086},
{-56.728477478027344,190.00001907348633,-302.00002670288086},
{3.2715225219726562,190.00001907348633,-302.00002670288086},
{63.271522521972656,69.99999046325684,177.99997329711914},
{-116.7284631729126,190.00001907348633,-242.00002670288086},
{63.271522521972656,190.00001907348633,-302.00002670288086},
{123.27152252197266,190.00001907348633,-302.00002670288086},
{-56.728477478027344,190.00000476837158,-122.00001239776611},
{183.27152252197266,190.00001907348633,-302.00002670288086},
{-236.72844886779785,70.00000476837158,-122.00001239776611},
{-116.7284631729126,190.00001907348633,-182.0000123977661},
{3.2715225219726562,190.00000476837158,-122.00001239776611},
{3.2715225219726562,190.00001907348633,-182.0000123977661},
{-56.728477478027344,190.00001907348633,-182.0000123977661},
{3.2715225219726562,130.00000476837158,-122.00001239776611},
{-176.7284631729126,190.00001907348633,-182.0000123977661},
{183.27152252197266,190.00000476837158,-122.00001239776611},
{63.271522521972656,189.99999046325684,177.99997329711914},
{63.271522521972656,190.00001907348633,-182.0000123977661},
{183.27152252197266,190.00001907348633,-182.0000123977661},
{123.27152252197266,190.00001907348633,-182.0000123977661},
{123.27152252197266,190.00001907348633,-242.00002670288086},
{183.27152252197266,190.00001907348633,-242.00002670288086},
{63.271522521972656,130.00000476837158,-2.0000123977661133},
{243.27152252197266,190.00001907348633,-302.00002670288086},
{123.27152252197266,190.00000476837158,117.99998760223389},
{123.27152252197266,190.00000476837158,-62.00000524520874},
{183.27152252197266,190.00000476837158,-2.0000123977661133},
{123.27152252197266,190.00000476837158,-2.0000123977661133},
{123.27152252197266,189.99999046325684,177.99997329711914},
{243.27152252197266,129.99999046325684,177.99997329711914},
{243.27152252197266,190.00001907348633,-182.0000123977661},
{123.27152252197266,190.00000476837158,57.99998760223389},
{183.27152252197266,190.00000476837158,117.99998760223389},
{183.27152252197266,190.00000476837158,57.99998760223389},
{243.27152252197266,190.00001907348633,-242.00002670288086},
{183.27152252197266,190.00000476837158,-62.00000524520874},
{243.27152252197266,190.00000476837158,-122.00001239776611},
{243.27152252197266,190.00000476837158,-62.00000524520874},
{243.27152252197266,189.99999046325684,177.99997329711914},
{243.27152252197266,190.00000476837158,-2.0000123977661133},
{243.27152252197266,190.00000476837158,57.99998760223389},
{243.27152252197266,190.00000476837158,117.99998760223389},
{-236.72844886779785,190.00000476837158,-122.00001239776611},
{183.27152252197266,129.99999046325684,177.99997329711914},
{63.271522521972656,190.00000476837158,-122.00001239776611},
{-116.7284631729126,190.00000476837158,-122.00001239776611},
{-176.7284631729126,190.00000476837158,-122.00001239776611},
{-236.72844886779785,130.00000476837158,-122.00001239776611},
{63.271522521972656,190.00000476837158,-2.0000123977661133},
{-56.728477478027344,130.00000476837158,-122.00001239776611},
{63.271522521972656,190.00000476837158,117.99998760223389},
{63.271522521972656,130.00000476837158,-122.00001239776611},
{63.271522521972656,190.00000476837158,-62.00000524520874},
{63.271522521972656,130.00000476837158,-62.00001239776611},
{63.271522521972656,190.00000476837158,57.99998760223389},
{63.271522521972656,130.00000476837158,57.99998760223389},
{-176.7284631729126,130.00000476837158,-122.00001239776611},
{63.271522521972656,69.99999046325684,-2.0000123977661133},
{63.271522521972656,70.00000476837158,-62.00001239776611},
{63.271522521972656,130.00000476837158,117.99998760223389},
{63.271522521972656,69.99999046325684,57.99998760223389},
{63.271522521972656,69.99999046325684,117.99998760223389},
{63.271522521972656,70.00000476837158,-122.00001239776611},
{3.2715225219726562,70.00000476837158,-122.00001239776611},
{-116.7284631729126,130.00000476837158,-122.00001239776611},
{-116.7284631729126,70.00000476837158,-122.00001239776611},
{183.27152252197266,189.99999046325684,177.99997329711914},
{-236.72844886779785,130.00001907348633,-242.00002670288086},
{123.27152252197266,69.99999046325684,177.99997329711914},
{-236.72844886779785,190.00001907348633,-242.00002670288086},
{183.27152252197266,69.99999046325684,177.99997329711914},
{243.27152252197266,69.99999046325684,177.99997329711914},
{-236.72844886779785,190.00001907348633,-182.0000123977661},
{123.27152252197266,129.99999046325684,177.99997329711914},
{-236.72844886779785,130.00001907348633,-182.0000123977661},
{-236.72844886779785,130.00001907348633,-302.00002670288086},
{-236.72844886779785,70.00001192092896,-242.00002670288086},
{-236.72844886779785,70.00001907348633,-302.00002670288086}
{-294.5474624633789,-83.33332538604736,196.66664600372314},
{-594.5474147796631,116.66669845581055,-103.33337783813477},
{5.452537536621094,116.66667461395264,196.66664600372314},
{-94.5474624633789,16.666650772094727,696.6666221618652},
{-494.5474624633789,-83.33332538604736,196.66664600372314},
{-594.5474147796631,-83.33330154418945,96.66664600372314},
{-494.5474624633789,116.66669845581055,-3.3333778381347656},
{-294.5474624633789,116.66669845581055,-3.3333778381347656},
{-494.5474624633789,116.66669845581055,-103.33337783813477},
{-394.547438621521,116.66669845581055,-103.33337783813477},
{-194.5474624633789,116.66669845581055,-3.3333778381347656},
{-94.5474624633789,116.66669845581055,-3.3333778381347656},
{-294.5474624633789,116.66669845581055,-103.33337783813477},
{-194.5474624633789,116.66669845581055,-103.33337783813477},
{-94.5474624633789,-83.33334922790527,696.6666221618652},
{-394.547438621521,116.66669845581055,-3.3333778381347656},
{-94.5474624633789,116.66669845581055,-103.33337783813477},
{5.452537536621094,116.66669845581055,-103.33337783813477},
{-294.5474624633789,116.66667461395264,196.66664600372314},
{105.4525375366211,116.66669845581055,-103.33337783813477},
{-594.5474147796631,-83.33332538604736,196.66664600372314},
{-394.547438621521,116.66669845581055,96.66664600372314},
{-194.5474624633789,116.66667461395264,196.66664600372314},
{-194.5474624633789,116.66669845581055,96.66664600372314},
{-294.5474624633789,116.66669845581055,96.66664600372314},
{-194.5474624633789,16.666674613952637,196.66664600372314},
{-494.5474624633789,116.66669845581055,96.66664600372314},
{105.4525375366211,116.66667461395264,196.66664600372314},
{-94.5474624633789,116.66665077209473,696.6666221618652},
{-94.5474624633789,116.66669845581055,96.66664600372314},
{105.4525375366211,116.66669845581055,96.66664600372314},
{5.452537536621094,116.66669845581055,96.66664600372314},
{5.452537536621094,116.66669845581055,-3.3333778381347656},
{105.4525375366211,116.66669845581055,-3.3333778381347656},
{-94.5474624633789,16.666674613952637,396.66664600372314},
{205.4525375366211,116.66669845581055,-103.33337783813477},
{5.452537536621094,116.66667461395264,596.6666221618652},
{5.452537536621094,116.66667461395264,296.66666984558105},
{105.4525375366211,116.66667461395264,396.66664600372314},
{5.452537536621094,116.66667461395264,396.66664600372314},
{5.452537536621094,116.66665077209473,696.6666221618652},
{205.4525375366211,16.666650772094727,696.6666221618652},
{205.4525375366211,116.66669845581055,96.66664600372314},
{5.452537536621094,116.66667461395264,496.66662216186523},
{105.4525375366211,116.66667461395264,596.6666221618652},
{105.4525375366211,116.66667461395264,496.66662216186523},
{205.4525375366211,116.66669845581055,-3.3333778381347656},
{105.4525375366211,116.66667461395264,296.66666984558105},
{205.4525375366211,116.66667461395264,196.66664600372314},
{205.4525375366211,116.66667461395264,296.66666984558105},
{205.4525375366211,116.66665077209473,696.6666221618652},
{205.4525375366211,116.66667461395264,396.66664600372314},
{205.4525375366211,116.66667461395264,496.66662216186523},
{205.4525375366211,116.66667461395264,596.6666221618652},
{-594.5474147796631,116.66667461395264,196.66664600372314},
{105.4525375366211,16.666650772094727,696.6666221618652},
{-94.5474624633789,116.66667461395264,196.66664600372314},
{-394.547438621521,116.66667461395264,196.66664600372314},
{-494.5474624633789,116.66667461395264,196.66664600372314},
{-594.5474147796631,16.666674613952637,196.66664600372314},
{-94.5474624633789,116.66667461395264,396.66664600372314},
{-294.5474624633789,16.666674613952637,196.66664600372314},
{-94.5474624633789,116.66667461395264,596.6666221618652},
{-94.5474624633789,16.666674613952637,196.66664600372314},
{-94.5474624633789,116.66667461395264,296.66666984558105},
{-94.5474624633789,16.666674613952637,296.66664600372314},
{-94.5474624633789,116.66667461395264,496.66662216186523},
{-94.5474624633789,16.666674613952637,496.66662216186523},
{-494.5474624633789,16.666674613952637,196.66664600372314},
{-94.5474624633789,-83.33334922790527,396.66664600372314},
{-94.5474624633789,-83.33332538604736,296.66664600372314},
{-94.5474624633789,16.666674613952637,596.6666221618652},
{-94.5474624633789,-83.33334922790527,496.66662216186523},
{-94.5474624633789,-83.33334922790527,596.6666221618652},
{-94.5474624633789,-83.33332538604736,196.66664600372314},
{-194.5474624633789,-83.33332538604736,196.66664600372314},
{-394.547438621521,16.666674613952637,196.66664600372314},
{-394.547438621521,-83.33332538604736,196.66664600372314},
{105.4525375366211,116.66665077209473,696.6666221618652},
{-594.5474147796631,16.666698455810547,-3.3333778381347656},
{5.452537536621094,-83.33334922790527,696.6666221618652},
{-594.5474147796631,116.66669845581055,-3.3333778381347656},
{105.4525375366211,-83.33334922790527,696.6666221618652},
{205.4525375366211,-83.33334922790527,696.6666221618652},
{-594.5474147796631,116.66669845581055,96.66664600372314},
{5.452537536621094,16.666650772094727,696.6666221618652},
{-594.5474147796631,16.666698455810547,96.66664600372314},
{-594.5474147796631,16.666698455810547,-103.33337783813477},
{-594.5474147796631,-83.33330154418945,-3.3333778381347656},
{-594.5474147796631,-83.33330154418945,-103.33337783813477}
};
SVECTOR modelCube_normal[] = {
@ -124,8 +129,8 @@ SVECTOR modelCube_normal[] = {
-0.0,-1.0,-0.0,0,
-0.0,-1.0,-0.0,0,
-0.0,-1.0,-0.0,0,
0.0,-1.0,-2.3841863594498136e-07,0,
0.0,-1.0,-2.3841863594498136e-07,0,
0.0,-1.0,-2.384185791015625e-07,0,
0.0,-1.0,-2.384185791015625e-07,0,
-0.0,-1.0,-0.0,0,
-0.0,-1.0,-0.0,0,
-0.0,-1.0,-0.0,0,
@ -137,7 +142,7 @@ SVECTOR modelCube_normal[] = {
-0.0,-1.0,-0.0,0,
-0.0,-1.0,-0.0,0,
-0.0,-1.0,-0.0,0,
0.0,-1.0,-2.3841863594498136e-07,0,
0.0,-1.0,-2.384185791015625e-07,0,
0.0,0.0,1.0,0,
0.0,0.0,1.0,0,
0.0,0.0,1.0,0,
@ -195,8 +200,8 @@ SVECTOR modelCube_normal[] = {
0.0,-1.0,0.0,0,
0.0,-1.0,0.0,0,
0.0,-1.0,0.0,0,
-0.0,-1.0,-2.3841863594498136e-07,0,
-0.0,-1.0,-2.3841863594498136e-07,0,
-0.0,-1.0,-2.384185791015625e-07,0,
-0.0,-1.0,-2.384185791015625e-07,0,
0.0,-1.0,0.0,0,
0.0,-1.0,0.0,0,
0.0,-1.0,0.0,0,
@ -208,7 +213,7 @@ SVECTOR modelCube_normal[] = {
0.0,-1.0,0.0,0,
0.0,-1.0,0.0,0,
0.0,-1.0,0.0,0,
-0.0,-1.0,-2.3841863594498136e-07,0,
-0.0,-1.0,-2.384185791015625e-07,0,
0.0,-0.0,1.0,0,
0.0,-0.0,1.0,0,
0.0,-0.0,1.0,0,
@ -240,7 +245,7 @@ SVECTOR modelCube_normal[] = {
1.0,0.0,-0.0,0,
1.0,0.0,-0.0,0,
1.0,0.0,0.0,0,
1.0,0.0,-0.0,0
1.0,0.0,0.0,0
};
SVECTOR modelCube_uv[] = {
@ -1246,6 +1251,12 @@ int modelCube_index[] = {
79,88,89
};
MATRIX modelCube_matrix = {0};
VECTOR modelCube_pos = {0.0,0.0,0.0, 0};
SVECTOR modelCube_rot = {0.0,0.0,0.0};
short modelCube_isPrism = 0;
long modelCube_p = 0;
TMESH modelCube = {
modelCube_mesh,
modelCube_normal,
@ -1264,9 +1275,318 @@ MESH meshCube = {
&modelCube,
modelCube_index,
&tim_home,
_binary_TIM_home_tim_start
_binary_TIM_home_tim_start,
&modelCube_matrix,
&modelCube_pos,
&modelCube_rot,
&modelCube_isPrism,
&modelCube_p
};
MESH * meshes[1] = {
&meshCube
SVECTOR modelCube1_mesh[] = {
{-20.0000062584877,-120.00000476837158,-19.999980926513672},
{-20.0000062584877,-120.00000476837158,20.000028610229492},
{-20.0000062584877,120.00000476837158,-19.999980926513672},
{-20.0000062584877,120.00000476837158,20.000028610229492},
{20.000004768371582,-120.00000476837158,-19.999980926513672},
{20.000004768371582,-120.00000476837158,20.000028610229492},
{20.000004768371582,120.00000476837158,-19.999980926513672},
{20.000004768371582,120.00000476837158,20.000028610229492}
};
SVECTOR modelCube1_normal[] = {
-1.0,0.0,0.0,0,
0.0,1.0,-0.0,0,
1.0,0.0,-0.0,0,
0.0,-1.0,0.0,0,
0.0,0.0,-1.0,0,
0.0,0.0,1.0,0,
-1.0,0.0,0.0,0,
0.0,1.0,-0.0,0,
1.0,0.0,0.0,0,
0.0,-1.0,0.0,0,
0.0,0.0,-1.0,0,
0.0,-0.0,1.0,0
};
SVECTOR modelCube1_uv[] = {
43.968641459941864,164.96862664818764, 0, 0,
33.031376749277115,154.0313619375229, 0, 0,
33.031376749277115,164.96862664818764, 0, 0,
43.968641459941864,164.96862664818764, 0, 0,
33.031376749277115,154.0313619375229, 0, 0,
33.031376749277115,164.96862664818764, 0, 0,
43.968641459941864,164.96862664818764, 0, 0,
33.031376749277115,154.0313619375229, 0, 0,
33.031376749277115,164.96862664818764, 0, 0,
43.968641459941864,164.96862664818764, 0, 0,
33.031376749277115,154.0313619375229, 0, 0,
33.031376749277115,164.96862664818764, 0, 0,
43.968641459941864,164.96862664818764, 0, 0,
33.031376749277115,154.0313619375229, 0, 0,
33.031376749277115,164.96862664818764, 0, 0,
43.968641459941864,164.96862664818764, 0, 0,
33.031376749277115,154.0313619375229, 0, 0,
33.031376749277115,164.96862664818764, 0, 0,
43.968641459941864,164.96862664818764, 0, 0,
43.968641459941864,154.0313619375229, 0, 0,
33.031376749277115,154.0313619375229, 0, 0,
43.968641459941864,164.96862664818764, 0, 0,
43.968641459941864,154.0313619375229, 0, 0,
33.031376749277115,154.0313619375229, 0, 0,
43.968641459941864,164.96862664818764, 0, 0,
43.968641459941864,154.0313619375229, 0, 0,
33.031376749277115,154.0313619375229, 0, 0,
43.968641459941864,164.96862664818764, 0, 0,
43.968641459941864,154.0313619375229, 0, 0,
33.031376749277115,154.0313619375229, 0, 0,
43.968641459941864,164.96862664818764, 0, 0,
43.968641459941864,154.0313619375229, 0, 0,
33.031376749277115,154.0313619375229, 0, 0,
43.968641459941864,164.96862664818764, 0, 0,
43.968641459941864,154.0313619375229, 0, 0,
33.031376749277115,154.0313619375229, 0, 0
};
CVECTOR modelCube1_color[] = {
239,235,255, 0,
28,107,255, 0,
0,169,255, 0,
255,255,255, 0,
255,255,255, 0,
255,255,255, 0,
0,74,255, 0,
4,170,255, 0,
63,190,255, 0,
206,226,255, 0,
0,169,255, 0,
27,107,255, 0,
172,218,255, 0,
0,169,255, 0,
28,107,255, 0,
0,169,255, 0,
206,226,255, 0,
0,74,255, 0,
239,235,255, 0,
10,167,255, 0,
28,107,255, 0,
255,255,255, 0,
255,255,255, 0,
255,255,255, 0,
0,74,255, 0,
206,226,255, 0,
4,170,255, 0,
206,226,255, 0,
239,235,255, 0,
0,169,255, 0,
172,218,255, 0,
27,107,255, 0,
0,169,255, 0,
0,169,255, 0,
0,169,255, 0,
206,226,255, 0
};
int modelCube1_index[] = {
1,2,0,
3,6,2,
7,4,6,
5,0,4,
6,0,2,
3,5,7,
1,3,2,
3,7,6,
7,5,4,
5,1,0,
6,4,0,
3,1,5
};
MATRIX modelCube1_matrix = {0};
VECTOR modelCube1_pos = {0.0,0.0,100.0, 0};
SVECTOR modelCube1_rot = {0.0,-512.000014247698,0.0};
short modelCube1_isPrism = 0;
long modelCube1_p = 0;
TMESH modelCube1 = {
modelCube1_mesh,
modelCube1_normal,
modelCube1_uv,
modelCube1_color,
12
};
extern unsigned long _binary_TIM_home_tim_start[];
extern unsigned long _binary_TIM_home_tim_end[];
extern unsigned long _binary_TIM_home_tim_length;
TIM_IMAGE tim_home;
MESH meshCube1 = {
&modelCube1,
modelCube1_index,
&tim_home,
_binary_TIM_home_tim_start,
&modelCube1_matrix,
&modelCube1_pos,
&modelCube1_rot,
&modelCube1_isPrism,
&modelCube1_p
};
SVECTOR modelobject_mesh[] = {
{-20.000001788139343,-20.000004768371582,-20.000004768371582},
{-20.000001788139343,-20.000004768371582,20.000004768371582},
{-20.000001788139343,20.000004768371582,-20.000004768371582},
{-20.000001788139343,20.000004768371582,20.000004768371582},
{20.000004768371582,-20.000004768371582,-20.000004768371582},
{20.000004768371582,-20.000004768371582,20.000004768371582},
{20.000004768371582,20.000004768371582,-20.000004768371582},
{20.000004768371582,20.000004768371582,20.000004768371582}
};
SVECTOR modelobject_normal[] = {
-1.0,0.0,0.0,0,
0.0,1.0,-0.0,0,
1.0,0.0,-0.0,0,
0.0,-1.0,0.0,0,
0.0,0.0,-1.0,0,
0.0,0.0,1.0,0,
-1.0,0.0,0.0,0,
0.0,1.0,-0.0,0,
1.0,0.0,0.0,0,
0.0,-1.0,0.0,0,
0.0,0.0,-1.0,0,
0.0,-0.0,1.0,0
};
SVECTOR modelobject_uv[] = {
67.14938879013062,60.5986163020134, 0, 0,
107.21568524837494,60.5986163020134, 0, 0,
107.21568524837494,20.532319843769073, 0, 0,
67.14938879013062,60.5986163020134, 0, 0,
107.21568524837494,60.5986163020134, 0, 0,
107.21568524837494,20.532319843769073, 0, 0,
67.14938879013062,60.5986163020134, 0, 0,
107.21568524837494,60.5986163020134, 0, 0,
107.21568524837494,20.532319843769073, 0, 0,
67.14938879013062,60.5986163020134, 0, 0,
107.21568524837494,60.5986163020134, 0, 0,
107.21568524837494,20.532319843769073, 0, 0,
67.14938879013062,60.5986163020134, 0, 0,
107.21568524837494,60.5986163020134, 0, 0,
107.21568524837494,20.532319843769073, 0, 0,
67.14938879013062,60.5986163020134, 0, 0,
107.21568524837494,60.5986163020134, 0, 0,
107.21568524837494,20.532319843769073, 0, 0,
67.14938879013062,60.5986163020134, 0, 0,
107.21568524837494,60.5986163020134, 0, 0,
107.21568524837494,20.532319843769073, 0, 0,
67.14938879013062,60.5986163020134, 0, 0,
107.21568524837494,60.5986163020134, 0, 0,
107.21568524837494,20.532319843769073, 0, 0,
67.14938879013062,60.5986163020134, 0, 0,
107.21568524837494,60.5986163020134, 0, 0,
107.21568524837494,20.532319843769073, 0, 0,
67.14938879013062,60.5986163020134, 0, 0,
107.21568524837494,60.5986163020134, 0, 0,
107.21568524837494,20.532319843769073, 0, 0,
67.14938879013062,60.5986163020134, 0, 0,
107.21568524837494,60.5986163020134, 0, 0,
107.21568524837494,20.532319843769073, 0, 0,
67.14938879013062,60.5986163020134, 0, 0,
107.21568524837494,60.5986163020134, 0, 0,
107.21568524837494,20.532319843769073, 0, 0
};
CVECTOR modelobject_color[] = {
80,80,80,0,
128,128,128,0,
128,128,128,0,
80,80,80,0,
128,128,128,0,
128,128,128,0,
80,80,80,0,
128,128,128,0,
128,128,128,0,
80,80,80,0,
128,128,128,0,
128,128,128,0,
80,80,80,0,
128,128,128,0,
128,128,128,0,
80,80,80,0,
128,128,128,0,
128,128,128,0,
80,80,80,0,
128,128,128,0,
128,128,128,0,
80,80,80,0,
128,128,128,0,
128,128,128,0,
80,80,80,0,
128,128,128,0,
128,128,128,0,
80,80,80,0,
128,128,128,0,
128,128,128,0,
80,80,80,0,
128,128,128,0,
128,128,128,0,
80,80,80,0,
128,128,128,0,
128,128,128,0
};
int modelobject_index[] = {
1,2,0,
3,6,2,
7,4,6,
5,0,4,
6,0,2,
3,5,7,
1,3,2,
3,7,6,
7,5,4,
5,1,0,
6,4,0,
3,1,5
};
MATRIX modelobject_matrix = {0};
VECTOR modelobject_pos = {0.0,0.0,0.0, 0};
SVECTOR modelobject_rot = {0.0,0.0,0.0};
short modelobject_isPrism = 0;
long modelobject_p = 0;
TMESH modelobject = {
modelobject_mesh,
modelobject_normal,
modelobject_uv,
modelobject_color,
12
};
extern unsigned long _binary_TIM_home_tim_start[];
extern unsigned long _binary_TIM_home_tim_end[];
extern unsigned long _binary_TIM_home_tim_length;
TIM_IMAGE tim_home;
MESH meshobject = {
&modelobject,
modelobject_index,
&tim_home,
_binary_TIM_home_tim_start,
&modelobject_matrix,
&modelobject_pos,
&modelobject_rot,
&modelobject_isPrism,
&modelobject_p
};
MESH * meshes[3] = {
&meshCube,
&meshCube1,
&meshobject
};

3697
pcos.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -43,11 +43,10 @@
#include "psin.c"
#include "pcos.c"
// Sample vector model
// Sample model
#include "coridor.c"
#define VMODE 0
#define HAS_TEX 0
#define VMODE 0 // 0: NTSC, 1: PAL
#define SCREENXRES 320
#define SCREENYRES 240
@ -55,7 +54,7 @@
#define CENTERX SCREENXRES/2
#define CENTERY SCREENYRES/2
#define OTLEN 2048 // Maximum number of OT entries
#define OTLEN 2048 // Maximum number of OT entries
#define PRIMBUFFLEN 1024 * sizeof(POLY_GT3) // Maximum number of POLY_GT3 primitives
// Display and draw environments, double buffered
@ -63,37 +62,26 @@ DISPENV disp[2];
DRAWENV draw[2];
u_long ot[2][OTLEN] = {0}; // Ordering table (contains addresses to primitives)
char primbuff[2][PRIMBUFFLEN] = {0}; // Primitive list // That's our prim buffer
char primbuff[2][PRIMBUFFLEN] = {0}; // Primitive list // That's our prim buffer
//~ int primcnt=0; // Primitive counter
char * nextpri = primbuff[0]; // Primitive counter
char * nextpri = primbuff[0]; // Primitive counter
char db = 0; // Current buffer counter
short vs;
int PadStatus;
//~ int TPressed=0;
//~ int AutoRotate=0;
//~ SVECTOR Rotate={0}; // Rotation coordinates
//~ VECTOR Trans={ 0, 0, CENTERX, 0 }; // Translation coordinates
//~ MATRIX Matrix={0}; // Matrix data for the GTE
//~ // Scaling coordinates
//~ VECTOR Scale={ ONE, ONE, ONE, 0 }; // ONE == 4096
typedef struct{
int x, xv; // x: current value += vx : new value
int x, xv; // x: current value += vx : new value
int y, yv;
int z, zv;
int pan, panv;
int tilt, tiltv;
int rol;
int pan, panv; // horizontal rotation
int tilt, tiltv; // vertical rotation
int rol; // lateral rotation
VECTOR pos;
SVECTOR rot;
SVECTOR dvs;
VECTOR pos; // camera current pos vector
SVECTOR rot; // camera current rot vector
MATRIX mat;
} CAMERA;
@ -112,38 +100,26 @@ int main() {
int i;
long t, p, OTz, Flag; // t == vertex count, p == depth cueing interpolation value, OTz == value to create Z-ordered OT, Flag == see LibOver47.pdf, p.143
long t, p, OTz, Flag; // t == vertex count, p == depth cueing interpolation value, OTz == value to create Z-ordered OT, Flag == see LibOver47.pdf, p.143
POLY_GT3 * poly; // pointer to a POLY_G4
POLY_GT3 * poly; // pointer to a POLY_GT3
SVECTOR RotVector = {0, 0, 0}; // Initialize rotation vector {x, y, z}
VECTOR MovVector = {0, 50, 50, 0};
MATRIX PolyMatrix = {0};
MATRIX PolyMatrix = {0}; // global transformation matrix
CVECTOR outCol, outCol1, outCol2 = {0,0,0,0}; // Holds vertices colors with depth cueing applied
CVECTOR outCol ={0,0,0,0};
CVECTOR outCol1 ={0,0,0,0};
CVECTOR outCol2 ={0,0,0,0};
// Texture window
//~ DR_MODE * dr_mode; // Pointer to dr_mode prim
//~ RECT tws = {0, 0, 32, 32}; // Texture window coordinates : x, y, w, h
init();
VSyncCallback(callback);
VSyncCallback(callback); // pad is read on vsync callback
//~ SetBackColor(255 , 255, 255);
SetFarColor(20, 20, 40);
SetFogNearFar(1200, 3000,SCREENXRES);
SetFarColor(20, 20, 40); // vertices colors are mixed with farcolor depending on p value
SetFogNearFar(1200, 3000,SCREENXRES); // fog distance thresholds
for (int k = 0; k < sizeof(meshes)/sizeof(TMESH *); k++){
LoadTexture(meshes[k]->tim_data, meshes[k]->tim);
LoadTexture(meshes[k]->tim_data, meshes[k]->tim);
}
// Set Camera starting pos
// Set Camera starting pos and rot
camera.xv = -ONE * -89;
camera.yv = -ONE * 59;
@ -160,26 +136,14 @@ int main() {
// Local Transform
meshes[2]->rot->vy -= 28;
meshes[1]->rot->vy += 28;
//~ meshes[1]->rot->vz += 8;
//~ meshes[1]->rot->vx += 2;
meshes[2]->rot->vy -= 28; // rotate small cube
meshes[1]->rot->vy += 28; // rotate blue monolith thingy
//World Translations
meshes[1]->pos->vz = meshes[1]->pos->vz + (pcos[VSync(-1)%1024]/768 );
meshes[1]->pos->vx = meshes[1]->pos->vx + (psin[VSync(-1)%1024]/768 );
//~ meshes[1]->pos->vz = pcos[VSync(-1)%4096] / 4096;
//~ meshes[1]->pos->vx = psin[VSync(-1)%4096] / 4096;
//~ meshes[1]->pos->vx = 0;
//~ meshes[1]->pos->vz = 100;
//~ meshes[1]->rot->vy ++;
//~ if (!(VSync(-1)%2)){
//~ meshes[1]->pos->vy = pcos[VSync(-1)%ONE] * psin[VSync(-1)%ONE] / ONE / 128;
//~ }
meshes[1]->pos->vz = meshes[1]->pos->vz + (pcos[VSync(-1)%1024]/768 ); // move blue monolith thingy
meshes[1]->pos->vx = meshes[1]->pos->vx + (psin[VSync(-1)%1024]/768 );
// Camera setup
@ -204,18 +168,20 @@ int main() {
for (i = 0; i < (meshes[k]->tmesh->len * 3); i += 3) {
poly = (POLY_GT3 *)nextpri;
// Initialize the primitive and set its color values
RotMatrix(meshes[k]->rot, meshes[k]->mat); // Apply rotation matrix
TransMatrix(meshes[k]->mat, meshes[k]->pos); // Apply translation matrix
CompMatrixLV(&camera.mat, meshes[k]->mat, &PolyMatrix);
SetRotMatrix(&PolyMatrix); // Set default rotation matrix
SetTransMatrix(&PolyMatrix);
RotMatrix(meshes[k]->rot, meshes[k]->mat); // Apply mesh rotation to matrix
//~ applyOrbCam(meshes[1]);
TransMatrix(meshes[k]->mat, meshes[k]->pos); // Apply mesh translation to matrix
CompMatrixLV(&camera.mat, meshes[k]->mat, &PolyMatrix); // Make a composite matrix from cam matrix + meshes matrices
SetRotMatrix(&PolyMatrix); // Set rotation matrix
SetTransMatrix(&PolyMatrix); // Set Transmatrix matrix
// Draw meshes
SetPolyGT3(poly);
@ -227,14 +193,12 @@ int main() {
setRGB1(poly, outCol1.r, outCol1.g, outCol1.b);
setRGB2(poly, outCol2.r, outCol2.g, outCol2.b);
// The TIMs are loaded in vram vertically on the same TPAGE; eg. Tim1 640,0, Tim1 640, 128
// We then add tim_image.prect.y to the y coord of the uvs to use the correct texture.
// WIP : Trying to use the draw area as a texture to create pseudo refraction effect
if (*meshes[k]->isPrism){
((POLY_GT3 *)poly)->tpage = getTPage(meshes[k]->tim->mode&0x3, 0,
0,
256
0,
320
);
setUV3(poly, 32, 32,
32, 220,
@ -251,6 +215,7 @@ int main() {
meshes[k]->tmesh->u[i+1].vx, meshes[k]->tmesh->u[i+1].vy + meshes[k]->tim->prect->y,
meshes[k]->tmesh->u[i+2].vx, meshes[k]->tmesh->u[i+2].vy + meshes[k]->tim->prect->y);
//~ }
// Rotate, translate, and project the vectors and output the results into a primitive
OTz = RotTransPers(&meshes[k]->tmesh->v[meshes[k]->index[t]] , (long*)&poly->x0, meshes[k]->p, &Flag);
@ -263,7 +228,7 @@ int main() {
//~ &meshes[k]->tmesh->v[meshes[k]->index[t+1]],
//~ &meshes[k]->tmesh->v[meshes[k]->index[t+2]],
//~ (long*)&poly->x0, (long*)&poly->x1, (long*)&poly->x2,
//~ &p,
//~ meshes[k]->p,
//~ &Flag
//~ );
@ -277,23 +242,7 @@ int main() {
t+=3;
}
}
// Can we use texture window with UV mapping ?
//~ dr_mode = (DR_MODE *)nextpri;
//~ setDrawMode(dr_mode,1,0, getTPage(tim_cube.mode&0x3, 0,
//~ tim_cube.prect->x,
//~ tim_cube.prect->y), &tws); //set texture window
//~ AddPrim(&ot[db], dr_mode);
//~ nextpri += sizeof(DR_MODE);
// Render the banner (FntPrint is always on top because it is not part of the OT)
//~ FntPrint("BASED ON PRIMDRAW BY LAMEGUY64, 2014 \n");
FntPrint("#Tris :%d \n", sizeof(ot[db])/sizeof(POLY_GT3));
FntPrint("Vsync :%d \n", VSync(0));
@ -309,8 +258,6 @@ int main() {
display();
//~ frame = VSync(-1);
}
return 0;
}
@ -386,27 +333,6 @@ void applyCamera(CAMERA * cam){
SetTransMatrix(&cam->mat); // Set Transform matrix
}
void applyOrbCam(MESH * mesh){
MATRIX mat;
RotMatrix(mesh->rot, mesh->mat); // Apply rotation matrix
TransMatrix(mesh->mat, mesh->pos); // Apply translation matrix
CompMatrixLV(&camera.mat, mesh->mat, &mat);
SetRotMatrix(&mat); // Set default rotation matrix
SetTransMatrix(&mat); // Set Transform matrix
//~ RotMatrix(meshes[k]->rot, meshes[k]->mat); // Apply rotation matrix
//~ TransMatrix(meshes[k]->mat, meshes[k]->pos); // Apply translation matrix
//~ CompMatrixLV(&camera.mat, meshes[k]->mat, &PolyMatrix);
//~ SetRotMatrix(&PolyMatrix); // Set default rotation matrix
//~ SetTransMatrix(&PolyMatrix);
}
void LoadTexture(u_long * tim, TIM_IMAGE * tparam){ // This part is from Lameguy64's tutorial series : lameguy64.net/svn/pstutorials/chapter1/3-textures.html login/pw: annoyingmous
OpenTIM(tim); // Open the tim binary data, feed it the address of the data in memory
ReadTIM(tparam); // This read the header of the TIM data and sets the corresponding members of the TIM_IMAGE structure

3693
psin.c Normal file

File diff suppressed because it is too large Load Diff