long time no see
This commit is contained in:
parent
eec42d5418
commit
7af5e535c8
4
.gdbinit
Normal file
4
.gdbinit
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
target remote localhost:3333
|
||||||
|
symbol-file /home/arthus/build/pcsx-redux/src/mips/3dcam-bak/3dcam-tri-quads.elf
|
||||||
|
monitor reset shellhalt
|
||||||
|
load /home/arthus/build/pcsx-redux/src/mips/3dcam-bak/3dcam-tri-quads.elf
|
@ -207,10 +207,10 @@ int main() {
|
|||||||
long t, p, OTz, OTc, Flag, nclip; // 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, OTc, Flag, nclip; // t == vertex count, p == depth cueing interpolation value, OTz == value to create Z-ordered OT, Flag == see LibOver47.pdf, p.143
|
||||||
POLY_GT3 * poly;
|
POLY_GT3 * poly;
|
||||||
|
|
||||||
//~ // Poly subdiv
|
// Poly subdiv
|
||||||
//~ DIVPOLYGON3 div = { 0 };
|
DIVPOLYGON3 div = { 0 };
|
||||||
//~ div.pih = SCREENXRES;
|
div.pih = SCREENXRES;
|
||||||
//~ div.piv = SCREENYRES;
|
div.piv = SCREENYRES;
|
||||||
|
|
||||||
//~ CVECTOR outCol ={0,0,0,0};
|
//~ CVECTOR outCol ={0,0,0,0};
|
||||||
//~ CVECTOR outCol1 ={0,0,0,0};
|
//~ CVECTOR outCol1 ={0,0,0,0};
|
||||||
@ -545,50 +545,13 @@ int main() {
|
|||||||
|
|
||||||
|
|
||||||
// modelCube is a TMESH, len member == # vertices, but here it's # of triangle... So, for each tri * 3 vertices ...
|
// modelCube is a TMESH, len member == # vertices, but here it's # of triangle... So, for each tri * 3 vertices ...
|
||||||
for (i = 0; i < (meshes[k]->tmesh->len * 3); i += 3) {
|
if (meshes[k]->index[t].code == 4) {
|
||||||
|
|
||||||
|
for (i = 0; i < (meshes[k]->tmesh->len * 3); i += 3) {
|
||||||
|
|
||||||
poly = (POLY_GT3 *)nextpri;
|
poly = (POLY_GT3 *)nextpri;
|
||||||
|
|
||||||
SetPolyGT3(poly);
|
// If Vertex Anim flag
|
||||||
|
|
||||||
// Can use ?
|
|
||||||
//~ RotMeshPrimS_GCT3();
|
|
||||||
|
|
||||||
if (*meshes[k]->isPrism){
|
|
||||||
|
|
||||||
// Use current DRAWENV clip as TPAGE
|
|
||||||
((POLY_GT3 *)poly)->tpage = getTPage(meshes[k]->tim->mode&0x3, 0,
|
|
||||||
draw[db].clip.x,
|
|
||||||
draw[db].clip.y
|
|
||||||
);
|
|
||||||
|
|
||||||
// Use projected coordinates (results from RotAverage...) as UV coords and clamp them to 0-255,0-224
|
|
||||||
setUV3(poly, (poly->x0 < 0? 0 : poly->x0 > 255? 255 : poly->x0),
|
|
||||||
(poly->y0 < 0? 0 : poly->y0 > 224? 224 : poly->y0),
|
|
||||||
(poly->x1 < 0? 0 : poly->x1 > 255? 255 : poly->x1),
|
|
||||||
(poly->y1 < 0? 0 : poly->y1 > 224? 224 : poly->y1),
|
|
||||||
(poly->x2 < 0? 0 : poly->x2 > 255? 255 : poly->x2),
|
|
||||||
(poly->y2 < 0? 0 : poly->y2 > 224? 224 : poly->y2)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// Use regular TPAGE
|
|
||||||
((POLY_GT3 *)poly)->tpage = getTPage(meshes[k]->tim->mode&0x3, 0,
|
|
||||||
meshes[k]->tim->prect->x,
|
|
||||||
meshes[k]->tim->prect->y
|
|
||||||
);
|
|
||||||
|
|
||||||
// Use model UV coordinates
|
|
||||||
setUV3(poly, meshes[k]->tmesh->u[i].vx , meshes[k]->tmesh->u[i].vy + meshes[k]->tim->prect->y,
|
|
||||||
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);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// If Vertex Anim flag
|
|
||||||
if (*meshes[k]->isAnim){
|
if (*meshes[k]->isAnim){
|
||||||
|
|
||||||
// FIXME : SLERP VERTEX ANIM
|
// FIXME : SLERP VERTEX ANIM
|
||||||
@ -644,12 +607,25 @@ int main() {
|
|||||||
|
|
||||||
// Use anim vertex's positions
|
// Use anim vertex's positions
|
||||||
|
|
||||||
OTz = RotAverage3(
|
//~ nclip = RotAverageNclip3(
|
||||||
&meshes[k]->anim->data[ atime%19 * modelCylindre_anim.nvert + meshes[k]->index[t]],
|
//~ &meshes[k]->anim->data[ atime%19 * modelCylindre_anim.nvert + meshes[k]->index[t]],
|
||||||
&meshes[k]->anim->data[ atime%19 * modelCylindre_anim.nvert + meshes[k]->index[t+1]],
|
//~ &meshes[k]->anim->data[ atime%19 * modelCylindre_anim.nvert + meshes[k]->index[t+2]],
|
||||||
&meshes[k]->anim->data[ atime%19 * modelCylindre_anim.nvert + meshes[k]->index[t+2]],
|
//~ &meshes[k]->anim->data[ atime%19 * modelCylindre_anim.nvert + meshes[k]->index[t+1]],
|
||||||
|
//~ (long*)&poly->x0, (long*)&poly->x1, (long*)&poly->x2,
|
||||||
|
//~ meshes[k]->p,
|
||||||
|
//~ &OTz,
|
||||||
|
//~ &Flag
|
||||||
|
//~ );
|
||||||
|
|
||||||
|
// Use anim vertex's positions
|
||||||
|
|
||||||
|
nclip = RotAverageNclip3(
|
||||||
|
&meshes[k]->anim->data[ atime%19 * modelCylindre_anim.nvert + meshes[k]->index[t].order.vx],
|
||||||
|
&meshes[k]->anim->data[ atime%19 * modelCylindre_anim.nvert + meshes[k]->index[t].order.vz],
|
||||||
|
&meshes[k]->anim->data[ atime%19 * modelCylindre_anim.nvert + meshes[k]->index[t].order.vy],
|
||||||
(long*)&poly->x0, (long*)&poly->x1, (long*)&poly->x2,
|
(long*)&poly->x0, (long*)&poly->x1, (long*)&poly->x2,
|
||||||
meshes[k]->p,
|
meshes[k]->p,
|
||||||
|
&OTz,
|
||||||
&Flag
|
&Flag
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -657,16 +633,63 @@ int main() {
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Use model's regular vertex pos
|
// Use model's regular vertex pos
|
||||||
OTz = RotAverage3(
|
nclip = RotAverageNclip3(
|
||||||
&meshes[k]->tmesh->v[meshes[k]->index[t]],
|
&meshes[k]->tmesh->v[ meshes[k]->index[t].order.vx ],
|
||||||
&meshes[k]->tmesh->v[meshes[k]->index[t+1]],
|
&meshes[k]->tmesh->v[ meshes[k]->index[t].order.vz ],
|
||||||
&meshes[k]->tmesh->v[meshes[k]->index[t+2]],
|
&meshes[k]->tmesh->v[ meshes[k]->index[t].order.vy ],
|
||||||
(long*)&poly->x0, (long*)&poly->x1, (long*)&poly->x2,
|
(long*)&poly->x0, (long*)&poly->x1, (long*)&poly->x2,
|
||||||
meshes[k]->p,
|
meshes[k]->p,
|
||||||
|
&OTz,
|
||||||
&Flag
|
&Flag
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//~ FntPrint("%d %d %d %d\n", meshes[k]->index[t].order.vx, meshes[k]->index[t].order.vy, meshes[k]->index[t].order.vz, meshes[k]->index[t].code);
|
||||||
|
|
||||||
|
if (nclip > 0 && OTz > 0) {
|
||||||
|
|
||||||
|
|
||||||
|
SetPolyGT3(poly);
|
||||||
|
|
||||||
|
// Can use ?
|
||||||
|
//~ RotMeshPrimS_GCT3();
|
||||||
|
|
||||||
|
if (*meshes[k]->isPrism){
|
||||||
|
|
||||||
|
// Use current DRAWENV clip as TPAGE
|
||||||
|
((POLY_GT3 *)poly)->tpage = getTPage(meshes[k]->tim->mode&0x3, 0,
|
||||||
|
draw[db].clip.x,
|
||||||
|
draw[db].clip.y
|
||||||
|
);
|
||||||
|
|
||||||
|
// Use projected coordinates (results from RotAverage...) as UV coords and clamp them to 0-255,0-224
|
||||||
|
setUV3(poly, (poly->x0 < 0? 0 : poly->x0 > 255? 255 : poly->x0),
|
||||||
|
(poly->y0 < 0? 0 : poly->y0 > 224? 224 : poly->y0),
|
||||||
|
(poly->x1 < 0? 0 : poly->x1 > 255? 255 : poly->x1),
|
||||||
|
(poly->y1 < 0? 0 : poly->y1 > 224? 224 : poly->y1),
|
||||||
|
(poly->x2 < 0? 0 : poly->x2 > 255? 255 : poly->x2),
|
||||||
|
(poly->y2 < 0? 0 : poly->y2 > 224? 224 : poly->y2)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// Use regular TPAGE
|
||||||
|
((POLY_GT3 *)poly)->tpage = getTPage(meshes[k]->tim->mode&0x3, 0,
|
||||||
|
meshes[k]->tim->prect->x,
|
||||||
|
meshes[k]->tim->prect->y
|
||||||
|
);
|
||||||
|
|
||||||
|
// Use model UV coordinates
|
||||||
|
setUV3(poly, meshes[k]->tmesh->u[i].vx , meshes[k]->tmesh->u[i].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,
|
||||||
|
meshes[k]->tmesh->u[i+1].vx, meshes[k]->tmesh->u[i+1].vy + meshes[k]->tim->prect->y);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// FIXME : Polygon subdiv
|
// FIXME : Polygon subdiv
|
||||||
|
|
||||||
//~ OTc = OTz>>4;
|
//~ OTc = OTz>>4;
|
||||||
@ -678,17 +701,17 @@ int main() {
|
|||||||
//~ DivideGT3(
|
//~ DivideGT3(
|
||||||
//~ // Vertex coord
|
//~ // Vertex coord
|
||||||
//~ &meshes[k]->tmesh->v[meshes[k]->index[t]],
|
//~ &meshes[k]->tmesh->v[meshes[k]->index[t]],
|
||||||
//~ &meshes[k]->tmesh->v[meshes[k]->index[t+1]],
|
|
||||||
//~ &meshes[k]->tmesh->v[meshes[k]->index[t+2]],
|
//~ &meshes[k]->tmesh->v[meshes[k]->index[t+2]],
|
||||||
|
//~ &meshes[k]->tmesh->v[meshes[k]->index[t+1]],
|
||||||
//~ // UV coord
|
//~ // UV coord
|
||||||
//~ meshes[k]->tmesh->u[i],
|
//~ meshes[k]->tmesh->u[i],
|
||||||
//~ meshes[k]->tmesh->u[i+1],
|
|
||||||
//~ meshes[k]->tmesh->u[i+2],
|
//~ meshes[k]->tmesh->u[i+2],
|
||||||
|
//~ meshes[k]->tmesh->u[i+1],
|
||||||
|
|
||||||
//~ // Color
|
//~ // Color
|
||||||
//~ meshes[k]->tmesh->c[i],
|
//~ meshes[k]->tmesh->c[i],
|
||||||
//~ meshes[k]->tmesh->c[i+1],
|
|
||||||
//~ meshes[k]->tmesh->c[i+2],
|
//~ meshes[k]->tmesh->c[i+2],
|
||||||
|
//~ meshes[k]->tmesh->c[i+1],
|
||||||
|
|
||||||
//~ // Gpu packet
|
//~ // Gpu packet
|
||||||
//~ poly,
|
//~ poly,
|
||||||
@ -696,8 +719,8 @@ int main() {
|
|||||||
//~ &div);
|
//~ &div);
|
||||||
|
|
||||||
//~ // Increment primitive list pointer
|
//~ // Increment primitive list pointer
|
||||||
//~ nextpri += ( (sizeof(POLY_GT4) + 2) / 3 ) * (( 1 << ( div.ndiv )) << ( div.ndiv ));
|
//~ nextpri += ( (sizeof(POLY_GT3) + 3) / 4 ) * (( 1 << ( div.ndiv )) << ( div.ndiv ));
|
||||||
//NumPrims += ((1<<(div.ndiv))<<(div.ndiv));
|
//~ triCount = ((1<<(div.ndiv))<<(div.ndiv));
|
||||||
|
|
||||||
//~ }
|
//~ }
|
||||||
|
|
||||||
@ -715,9 +738,13 @@ int main() {
|
|||||||
CVECTOR outCol1 ={0,0,0,0};
|
CVECTOR outCol1 ={0,0,0,0};
|
||||||
CVECTOR outCol2 ={0,0,0,0};
|
CVECTOR outCol2 ={0,0,0,0};
|
||||||
|
|
||||||
NormalColorDpq(&meshes[k]->tmesh->n[meshes[k]->index[t]] , &meshes[k]->tmesh->c[meshes[k]->index[t]], *meshes[k]->p, &outCol);
|
//~ NormalColorDpq(&meshes[k]->tmesh->n[meshes[k]->index[t]] , &meshes[k]->tmesh->c[meshes[k]->index[t]], *meshes[k]->p, &outCol);
|
||||||
NormalColorDpq(&meshes[k]->tmesh->n[meshes[k]->index[t+1]], &meshes[k]->tmesh->c[meshes[k]->index[t+1]], *meshes[k]->p, &outCol1);
|
//~ NormalColorDpq(&meshes[k]->tmesh->n[meshes[k]->index[t+2]], &meshes[k]->tmesh->c[meshes[k]->index[t+2]], *meshes[k]->p, &outCol1);
|
||||||
NormalColorDpq(&meshes[k]->tmesh->n[meshes[k]->index[t+2]], &meshes[k]->tmesh->c[meshes[k]->index[t+2]], *meshes[k]->p, &outCol2);
|
//~ NormalColorDpq(&meshes[k]->tmesh->n[meshes[k]->index[t+1]], &meshes[k]->tmesh->c[meshes[k]->index[t+1]], *meshes[k]->p, &outCol2);
|
||||||
|
|
||||||
|
NormalColorDpq(&meshes[k]->tmesh->n[ meshes[k]->index[t].order.vx ], &meshes[k]->tmesh->c[ meshes[k]->index[t].order.vx ], *meshes[k]->p, &outCol);
|
||||||
|
NormalColorDpq(&meshes[k]->tmesh->n[ meshes[k]->index[t].order.vz ], &meshes[k]->tmesh->c[ meshes[k]->index[t].order.vz ], *meshes[k]->p, &outCol1);
|
||||||
|
NormalColorDpq(&meshes[k]->tmesh->n[ meshes[k]->index[t].order.vy ], &meshes[k]->tmesh->c[ meshes[k]->index[t].order.vy ], *meshes[k]->p, &outCol2);
|
||||||
//~ }
|
//~ }
|
||||||
|
|
||||||
// Other methods
|
// Other methods
|
||||||
@ -762,14 +789,15 @@ int main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
nextpri += sizeof(POLY_GT3);
|
nextpri += sizeof(POLY_GT3);
|
||||||
|
}
|
||||||
|
|
||||||
t+=3;
|
t+=1;
|
||||||
|
}
|
||||||
//~ if (*meshes[k]->isRigidBody){
|
//~ if (*meshes[k]->isRigidBody){
|
||||||
//~ PopMatrix(); // Pull previous matrix from stack (slow)
|
//~ PopMatrix(); // Pull previous matrix from stack (slow)
|
||||||
//~ }
|
//~ }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find and apply light rotation matrix
|
// Find and apply light rotation matrix
|
||||||
RotMatrix(&lgtang, &rotlgt);
|
RotMatrix(&lgtang, &rotlgt);
|
||||||
@ -784,13 +812,13 @@ int main() {
|
|||||||
//~ FntPrint("ColSphere: %d\n", (modelSphere_body.position.vy + modelSphere_body.max.vy) - (modelobject_body.position.vy + modelobject_body.min.vy) );
|
//~ FntPrint("ColSphere: %d\n", (modelSphere_body.position.vy + modelSphere_body.max.vy) - (modelobject_body.position.vy + modelobject_body.min.vy) );
|
||||||
//~ FntPrint("Col %d\n", col_sphere.vy );
|
//~ FntPrint("Col %d\n", col_sphere.vy );
|
||||||
|
|
||||||
FntPrint("Obj: %d,%d,%d\n",modelobject_body.velocity.vx,modelobject_body.velocity.vy,modelobject_body.velocity.vz);
|
//~ FntPrint("Obj: %d,%d,%d\n",modelobject_body.velocity.vx,modelobject_body.velocity.vy,modelobject_body.velocity.vz);
|
||||||
FntPrint("Sph: %d,%d,%d\n",modelSphere_body.velocity.vx,modelSphere_body.velocity.vy,modelSphere_body.velocity.vz);
|
//~ FntPrint("Sph: %d,%d,%d\n",modelSphere_body.velocity.vx,modelSphere_body.velocity.vy,modelSphere_body.velocity.vz);
|
||||||
|
|
||||||
//~ FntPrint("%d, %d\n",modelobject_body.position.vx, modelobject_pos.vx);
|
//~ FntPrint("%d, %d\n",modelobject_body.position.vx, modelobject_pos.vx);
|
||||||
|
|
||||||
//~ FntPrint("Time : %d %d dt :%d\n",time, atime, dt);
|
//~ FntPrint("Time : %d %d dt :%d\n",time, atime, dt);
|
||||||
//~ FntPrint("Tricount: %d OTz: %d\nOTc: %d, p: %d\n",triCount, OTz, OTc, *meshes[2]->p);
|
FntPrint("Tricount: %d OTz: %d\nOTc: %d, p: %d\n",triCount, OTz, OTc, *meshes[2]->p);
|
||||||
|
|
||||||
//~ FntPrint("Sphr : %4d %4d %4d\n", modelSphere_body.gForce.vx, modelSphere_body.gForce.vy, modelSphere_body.gForce.vz);
|
//~ FntPrint("Sphr : %4d %4d %4d\n", modelSphere_body.gForce.vx, modelSphere_body.gForce.vy, modelSphere_body.gForce.vz);
|
||||||
|
|
||||||
|
@ -227,6 +227,8 @@ long timeB = 0;
|
|||||||
|
|
||||||
int lerping = 0;
|
int lerping = 0;
|
||||||
|
|
||||||
|
short curCamAngle = 0;
|
||||||
|
|
||||||
// Inverted Cam coordinates for Forward Vector calc
|
// Inverted Cam coordinates for Forward Vector calc
|
||||||
|
|
||||||
VECTOR InvCamPos = {0,0,0,0};
|
VECTOR InvCamPos = {0,0,0,0};
|
||||||
@ -376,6 +378,10 @@ int main() {
|
|||||||
|
|
||||||
VECTOR objAngleToCam = {0, 0, 0, 0};
|
VECTOR objAngleToCam = {0, 0, 0, 0};
|
||||||
|
|
||||||
|
//~ long objAngleToCam = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int angle = 0; //PSX units = 4096 == 360° = 2Pi
|
int angle = 0; //PSX units = 4096 == 360° = 2Pi
|
||||||
|
|
||||||
int dist = 0; //PSX units
|
int dist = 0; //PSX units
|
||||||
@ -438,34 +444,23 @@ int main() {
|
|||||||
|
|
||||||
//~ posToCam = getVectorTo(camera.pos, *meshPlan.pos);
|
//~ posToCam = getVectorTo(camera.pos, *meshPlan.pos);
|
||||||
|
|
||||||
//~ objAngleToCam.vy = (
|
posToCam.vx = -camera.pos.vx - modelPlan_pos.vx ;
|
||||||
|
posToCam.vz = -camera.pos.vz - modelPlan_pos.vz ;
|
||||||
|
posToCam.vy = -camera.pos.vy - modelPlan_pos.vy ;
|
||||||
|
|
||||||
//~ (
|
//~ psqrt(posToCam.vx * posToCam.vx + posToCam.vy * posToCam.vy);
|
||||||
//~ patan( meshPlan.pos->vx, meshPlan.pos->vz ) -
|
|
||||||
//~ meshPlan.rot->vy -
|
|
||||||
|
|
||||||
//~ - patan( camera.pos.vx, camera.pos.vz)
|
objAngleToCam.vy = patan( posToCam.vx,posToCam.vz );
|
||||||
|
objAngleToCam.vx = patan( posToCam.vx,posToCam.vy );
|
||||||
|
|
||||||
//~ ) >> 4 );
|
//~ objAngleToCam.vz = patan( posToCam.vz,posToCam.vy );
|
||||||
|
//~ objAngleToCam.vx = patan( psqrt(posToCam.vx * posToCam.vx + posToCam.vy * posToCam.vy), posToCam.vy );
|
||||||
//~ FntPrint("%d %d", objAngleToCam.vy, meshPlan.rot->vy);
|
|
||||||
|
|
||||||
//~ objAngleToCam.vy = (
|
|
||||||
|
|
||||||
//~ (
|
|
||||||
//~ patan( meshPlan.pos->vx > 0 ? meshPlan.pos->vx : 4096 + meshPlan.pos->vx, meshPlan.pos->vz ) -
|
|
||||||
|
|
||||||
//~ patan( camera.pos.vx > 0 ? camera.pos.vx : 4096 + camera.pos.vx, camera.pos.vz)
|
|
||||||
|
|
||||||
//~ ) >> 4 ) - 1024;
|
|
||||||
|
|
||||||
//~ objAngleToCam.vx = ratan2(posToCam.pad, posToCam.vy);
|
|
||||||
|
|
||||||
//~ meshPlan.rot->vy = objAngleToCam.vy;
|
|
||||||
|
|
||||||
//~ meshPlan.rot->vx = objAngleToCam.vx;
|
|
||||||
|
|
||||||
|
//~ meshPlan.rot->vx = -( (objAngleToCam.vx >> 4) - 3076 ) ;
|
||||||
|
//~ meshPlan.rot->vx = (( (objAngleToCam.vx >> 4) - 3076 ) * ( (objAngleToCam.vz >> 4) - 3076 ) >> 12) * (nsin(posToCam.vz) >> 10 < 0 ? -1 : 1);
|
||||||
|
//~ meshPlan.rot->vx = ( (objAngleToCam.vx >> 4) - 3076 ) * ( (objAngleToCam.vz >> 4) - 3076 ) >> 12 ;
|
||||||
|
|
||||||
|
meshPlan.rot->vy = -( (objAngleToCam.vy >> 4) + 1024 ) ;
|
||||||
|
|
||||||
// Actor Forward vector
|
// Actor Forward vector
|
||||||
|
|
||||||
@ -563,11 +558,11 @@ int main() {
|
|||||||
// Fixed Camera angle
|
// Fixed Camera angle
|
||||||
if (camMode == 2) {
|
if (camMode == 2) {
|
||||||
|
|
||||||
if (camPtr->tim_data){
|
//~ if (camPtr->tim_data){
|
||||||
|
|
||||||
drawBG();
|
//~ drawBG();
|
||||||
|
|
||||||
}
|
//~ }
|
||||||
|
|
||||||
setCameraPos(camPtr->campos->pos, camPtr->campos->rot);
|
setCameraPos(camPtr->campos->pos, camPtr->campos->rot);
|
||||||
|
|
||||||
@ -696,6 +691,8 @@ int main() {
|
|||||||
//~ FntPrint("Cam %d, %d, %d\n", camera.pos.vx, camera.pos.vy, camera.pos.vz);
|
//~ FntPrint("Cam %d, %d, %d\n", camera.pos.vx, camera.pos.vy, camera.pos.vz);
|
||||||
//~ FntPrint("Pos: %d Cur: %d\nTheta y: %d x: %d\n", camPath.pos, camPath.cursor, theta.vy, theta.vx);
|
//~ FntPrint("Pos: %d Cur: %d\nTheta y: %d x: %d\n", camPath.pos, camPath.cursor, theta.vy, theta.vx);
|
||||||
|
|
||||||
|
FntPrint("%d", camAngleToAct.vy);
|
||||||
|
|
||||||
if ( camAngleToAct.vy < -50 ) {
|
if ( camAngleToAct.vy < -50 ) {
|
||||||
|
|
||||||
camPath.pos += 40;
|
camPath.pos += 40;
|
||||||
@ -758,19 +755,28 @@ int main() {
|
|||||||
!getIntCollision( *actorPtr->body , *curNode->siblings->list[msh]->plane->body).vz )
|
!getIntCollision( *actorPtr->body , *curNode->siblings->list[msh]->plane->body).vz )
|
||||||
{
|
{
|
||||||
|
|
||||||
curNode = curNode->siblings->list[msh];
|
if ( curNode != curNode->siblings->list[msh] ) {
|
||||||
|
|
||||||
levelPtr = curNode->plane;
|
curNode = curNode->siblings->list[msh];
|
||||||
|
|
||||||
|
levelPtr = curNode->plane;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Moveable prop
|
// Moveable prop
|
||||||
|
|
||||||
if ( !getIntCollision( *propPtr->body , *curNode->siblings->list[msh]->plane->body).vx &&
|
if ( !getIntCollision( *propPtr->body , *curNode->siblings->list[msh]->plane->body).vx &&
|
||||||
!getIntCollision( *propPtr->body , *curNode->siblings->list[msh]->plane->body).vz )
|
!getIntCollision( *propPtr->body , *curNode->siblings->list[msh]->plane->body).vz ) {
|
||||||
{
|
|
||||||
|
|
||||||
propPtr->node = curNode->siblings->list[ msh ];
|
if ( propPtr->node != curNode->siblings->list[ msh ]){
|
||||||
|
|
||||||
|
propPtr->node = curNode->siblings->list[ msh ];
|
||||||
|
}
|
||||||
|
} else if ( !getIntCollision( *propPtr->body , *curNode->plane->body).vx &&
|
||||||
|
!getIntCollision( *propPtr->body , *curNode->plane->body).vz ) {
|
||||||
|
|
||||||
|
propPtr->node = curNode;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -889,6 +895,30 @@ int main() {
|
|||||||
|
|
||||||
static long Flag;
|
static long Flag;
|
||||||
|
|
||||||
|
if ( (camMode == 2) && (camPtr->tim_data ) ) {
|
||||||
|
|
||||||
|
//~ if (camPtr->tim_data){
|
||||||
|
|
||||||
|
drawBG();
|
||||||
|
|
||||||
|
//~ // Loop on camAngles
|
||||||
|
|
||||||
|
//~ for ( int angle = 0 ; angle < sizeof(camAngles)/sizeof(camAngles[0]) - 1 ; angle++ ) {
|
||||||
|
|
||||||
|
for ( int mesh = 0 ; mesh < camAngles[curCamAngle]->index; mesh ++ ) {
|
||||||
|
|
||||||
|
transformMesh(camAngles[curCamAngle]->objects[mesh]);
|
||||||
|
|
||||||
|
drawPoly(camAngles[curCamAngle]->objects[mesh], &Flag, atime);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//~ }
|
||||||
|
|
||||||
|
//~ }
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
//~ long t = 0;
|
//~ long t = 0;
|
||||||
|
|
||||||
// Draw current node's plane
|
// Draw current node's plane
|
||||||
@ -938,6 +968,8 @@ int main() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Find and apply light rotation matrix
|
// Find and apply light rotation matrix
|
||||||
|
|
||||||
RotMatrix(&lgtang, &rotlgt);
|
RotMatrix(&lgtang, &rotlgt);
|
||||||
@ -1346,7 +1378,11 @@ void drawPoly(MESH * mesh, long * Flag, int atime){
|
|||||||
mesh->tim->crect->y);
|
mesh->tim->crect->y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (*mesh->isSprite){
|
||||||
|
|
||||||
|
SetShadeTex( poly, 1 );
|
||||||
|
|
||||||
|
}
|
||||||
// Defaults depth color to neutral grey
|
// Defaults depth color to neutral grey
|
||||||
|
|
||||||
CVECTOR outCol = { 128,128,128,0 };
|
CVECTOR outCol = { 128,128,128,0 };
|
||||||
@ -1649,6 +1685,11 @@ void drawPoly(MESH * mesh, long * Flag, int atime){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (*mesh->isSprite){
|
||||||
|
|
||||||
|
SetShadeTex( poly4, 1 );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// If tim mode == 0 | 1, set CLUT coordinates
|
// If tim mode == 0 | 1, set CLUT coordinates
|
||||||
if ( (mesh->tim->mode & 0x3) < 2 ) {
|
if ( (mesh->tim->mode & 0x3) < 2 ) {
|
||||||
@ -2323,7 +2364,7 @@ void callback() {
|
|||||||
|
|
||||||
static short cursor = 0;
|
static short cursor = 0;
|
||||||
|
|
||||||
static short curCamAngle = 0;
|
//~ static short curCamAngle = 0;
|
||||||
|
|
||||||
if( !lerpValues[0] ) {
|
if( !lerpValues[0] ) {
|
||||||
|
|
||||||
@ -2369,6 +2410,12 @@ void callback() {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
if (curCamAngle > 4) {
|
||||||
|
|
||||||
|
curCamAngle = 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (curCamAngle < 5) {
|
if (curCamAngle < 5) {
|
||||||
|
|
||||||
curCamAngle++;
|
curCamAngle++;
|
||||||
@ -2377,10 +2424,6 @@ void callback() {
|
|||||||
|
|
||||||
LoadTexture(camPtr->tim_data, camPtr->BGtim);
|
LoadTexture(camPtr->tim_data, camPtr->BGtim);
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
curCamAngle = 0;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
15
Makefile
15
Makefile
@ -1,10 +1,21 @@
|
|||||||
TARGET = 3dcam-cosTable-lerp-atantable-psqrt-nodpq-quads
|
TARGET = 3dcam-tri-quads
|
||||||
TYPE = ps-exe
|
TYPE = ps-exe
|
||||||
|
|
||||||
SRCS = 3dcam-cosTable-lerp-atantable-psqrt-nodpq-quads.c \
|
SRCS = 3dcam-tri-quads.c \
|
||||||
../common/crt0/crt0.s \
|
../common/crt0/crt0.s \
|
||||||
TIM/home.tim \
|
TIM/home.tim \
|
||||||
TIM/grnd.tim \
|
TIM/grnd.tim \
|
||||||
|
TIM/cat.tim \
|
||||||
|
TIM/lara.tim \
|
||||||
|
TIM/bg.tim \
|
||||||
|
TIM/bg_camPath.tim \
|
||||||
|
TIM/bg_camPath_001.tim \
|
||||||
|
TIM/bg_camPath_002.tim \
|
||||||
|
TIM/bg_camPath_003.tim \
|
||||||
|
TIM/bg_camPath_004.tim \
|
||||||
|
TIM/bg_camPath_005.tim \
|
||||||
|
#~ TIM/Sans_nom_56.tim \
|
||||||
|
# img2tim -t -bpp 8 -org 320 0 -plt 0 481 -o bg.tim bg.png
|
||||||
|
|
||||||
CPPFLAGS += -I../psyq/include
|
CPPFLAGS += -I../psyq/include
|
||||||
LDFLAGS += -L../psyq/lib
|
LDFLAGS += -L../psyq/lib
|
||||||
|
BIN
TIM/home.tim
BIN
TIM/home.tim
Binary file not shown.
18405
coridor2.c
Normal file
18405
coridor2.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
crunched.ps-exe
Executable file
BIN
crunched.ps-exe
Executable file
Binary file not shown.
57
pcsx.json
Normal file
57
pcsx.json
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
{
|
||||||
|
"SPU": {
|
||||||
|
"DBufIRQ": false,
|
||||||
|
"IRQWait": true,
|
||||||
|
"Interp": 2,
|
||||||
|
"Mono": false,
|
||||||
|
"Mute": false,
|
||||||
|
"Pitch": false,
|
||||||
|
"Reverb": 2,
|
||||||
|
"Streaming": true,
|
||||||
|
"Volume": 3
|
||||||
|
},
|
||||||
|
"emulator": {
|
||||||
|
"8Megs": false,
|
||||||
|
"AutoVideo": true,
|
||||||
|
"Bios": "/home/arthus/.epsxe/bios/openbios.bin",
|
||||||
|
"BnWMdec": false,
|
||||||
|
"CDDA": 1,
|
||||||
|
"Debug": true,
|
||||||
|
"Dynarec": false,
|
||||||
|
"FastBoot": false,
|
||||||
|
"GdbServer": true,
|
||||||
|
"GdbServerPort": 3333,
|
||||||
|
"GdbServerTrace": false,
|
||||||
|
"IsoPath": "/home/arthus/build/psx-stuff/roms/UNIROM_RELEASE_8.0.D",
|
||||||
|
"Locale": "",
|
||||||
|
"Logfile": "",
|
||||||
|
"Mcd1": "memcard1.mcd",
|
||||||
|
"Mcd1Inserted": true,
|
||||||
|
"Mcd2": "memcard2.mcd",
|
||||||
|
"Mcd2Inserted": true,
|
||||||
|
"Overlay": [],
|
||||||
|
"PpfDir": "",
|
||||||
|
"PsxExe": "UNIROM_B.EXE;1",
|
||||||
|
"RCntFix": false,
|
||||||
|
"SioIrq": false,
|
||||||
|
"SpuIrq": false,
|
||||||
|
"Stdout": false,
|
||||||
|
"Verbose": false,
|
||||||
|
"Video": 0,
|
||||||
|
"WebServer": false,
|
||||||
|
"WebServerPort": 8080,
|
||||||
|
"Xa": true
|
||||||
|
},
|
||||||
|
"gui": {
|
||||||
|
"Fullscreen": false,
|
||||||
|
"FullscreenRender": true,
|
||||||
|
"IdleSwapInterval": 1,
|
||||||
|
"ShowLog": true,
|
||||||
|
"ShowMenu": true,
|
||||||
|
"WindowPosX": 1,
|
||||||
|
"WindowPosY": 26,
|
||||||
|
"WindowSizeX": 719,
|
||||||
|
"WindowSizeY": 542
|
||||||
|
},
|
||||||
|
"imgui": "[Window][Debug##Default]\nPos=60,60\nSize=400,400\nCollapsed=0\n\n[Window][Emulation Configuration]\nViewportPos=39,142\nViewportId=0xA515CB4B\nSize=316,619\nCollapsed=0\n\n[Window][Logs]\nViewportPos=-86,644\nViewportId=0x50BD6962\nSize=720,450\nCollapsed=0\n\n[Window][Soft GPU configuration]\nPos=288,182\nSize=300,200\nCollapsed=0\n\n[Window][Main VRAM Viewer]\nViewportPos=1157,-262\nViewportId=0xD2F1ACB4\nSize=1321,900\nCollapsed=0\n\n[Window][Registers]\nViewportPos=1244,-4\nViewportId=0xA4D966FE\nSize=493,512\nCollapsed=0\nDockId=0x00000002,0\n\n[Window][Breakpoints]\nViewportPos=1283,-4\nViewportId=0xA4D966FE\nPos=250,0\nSize=243,512\nCollapsed=0\nDockId=0x00000003,0\n\n[Window][Assembly]\nViewportPos=1077,89\nViewportId=0xE37F8D5D\nSize=623,751\nCollapsed=0\n\n[Window][Output]\nPos=160,48\nSize=810,532\nCollapsed=0\n\n[Window][About]\nPos=199,66\nSize=880,600\nCollapsed=0\n\n[Window][Dear ImGui Demo]\nPos=669,25\nSize=550,680\nCollapsed=0\n\n[Window][SPU configuration]\nPos=69,56\nSize=550,220\nCollapsed=0\n\n[Window][SPU Debug]\nViewportPos=962,725\nViewportId=0xE5F7C643\nSize=1200,430\nCollapsed=0\n\n[Window][Memory Editor #1]\nViewportPos=1139,76\nViewportId=0xE9869392\nSize=584,539\nCollapsed=0\n\n[Window][Source]\nViewportPos=61,86\nViewportId=0x58267A45\nSize=416,536\nCollapsed=0\n\n[Window][Callstack]\nViewportPos=48,90\nViewportId=0xA9FDEE8E\nSize=426,525\nCollapsed=0\n\n[Window][Dwarf]\nPos=60,60\nSize=404,388\nCollapsed=0\n\n[Window][Symbols]\nPos=60,60\nSize=147,62\nCollapsed=0\n\n[Window][Scratch Pad]\nViewportPos=719,-7\nViewportId=0xB7AD35A5\nSize=484,480\nCollapsed=0\n\n[Window][Hardware Registers]\nViewportPos=847,221\nViewportId=0x311B7332\nSize=584,612\nCollapsed=0\n\n[Window][CLUT VRAM selector]\nViewportPos=737,320\nViewportId=0xF0235A86\nPos=0,5\nSize=330,252\nCollapsed=0\n\n[Docking][Data]\nDockNode ID=0x00000001 Pos=1244,-4 Size=493,512 Split=X\n DockNode ID=0x00000002 Parent=0x00000001 SizeRef=105,512 Selected=0x837A6095\n DockNode ID=0x00000003 Parent=0x00000001 SizeRef=103,512 Selected=0x0263173C\n\n"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user