GTE Commands
Command encoding, execution cycles and calculations of the GTE.
This is an old revision of this page, as edited by RemmyLee at 02:46, 23 October 2026. Edit this revision | Latest revision
Summary
A GTE command is issued by the CPU instruction COP2 with a 25-bit immediate operand. The immediate selects the command and, for some commands, the shift, limiter, matrix and vector options. The GTE then performs the whole calculation and leaves its results in the GTE registers.1
The calculations below use Sony's notation from the GTE Commands Reference. A name in a calculation is a register or an intermediate value, (a.b.c) at the left gives the fixed-point format of the result, limX() applies limiter X, a <- b moves FIFO data, and marks a calculation whose overflow and underflow are recorded as test result n in FLAG.2
Command Encoding
Bits 25 to 31 of the instruction are 0100101b, which marks a COP2 imm25 instruction. Only bits 0 to 5 of the immediate select the command in hardware. Bits 20 to 24 carry a second command number that the hardware ignores:1
| Bits | Field | Content |
|---|---|---|
| 25 to 31 | 0100101b for COP2 imm25 | |
| 20 to 24 | Command number used by Sony's tools, ignored by hardware | |
| 19 | sf | Shift fraction: 0 = no fraction, 1 = 12-bit fraction |
| 17 to 18 | mx | MVMVA matrix: 0 = rotation, 1 = light, 2 = color, 3 = reserved |
| 15 to 16 | v | MVMVA vector: 0 = V0, 1 = V1, 2 = V2, 3 = IR |
| 13 to 14 | cv | MVMVA translation vector: 0 = TR, 1 = BK, 2 = FC, 3 = none |
| 11 to 12 | Always 0 | |
| 10 | lm | IR1 to IR3 lower limit: 0 = -8000h, 1 = 0 |
| 6 to 9 | Always 0 | |
| 0 to 5 | Command number used by hardware |
Only MVMVA uses the mx, v and cv fields; they are zero for every other command. The sf and lm bits are normally fixed for each command, and MVMVA, SQR, OP, GPF and GPL are the commands whose sf bit is a documented option.1 3
Command List
The commands, their execution cycles and their functions are as follows. The Opcode column is the 25-bit immediate from psx-spx; Sony's run-time library headers emit placeholder words that the DMPSX tool replaces.4 5 6
| Command | Opcode | Required cycles (Sony) | Cycles (psx-spx) | Function |
|---|---|---|---|---|
| RTPS | 0180001h | 14 | 15 | Coordinate transformation and perspective transformation |
| RTPT | 0280030h | 22 | 23 | Coordinate transformation and perspective transformation, 3 vertices |
| NCDS | 0E80413h | 19 | 19 | Light source calculation |
| NCDT | 0F80416h | 44 | 44 | Light source calculation, 3 vectors |
| NCCS | 108041Bh | 17 | 17 | Light source calculation |
| NCCT | 118043Fh | 39 | 39 | Light source calculation, 3 vectors |
| CDP | 1280414h | 13 | 13 | Light source calculation |
| CC | 138041Ch | 11 | 11 | Light source calculation |
| NCS | 0C8041Eh | 14 | 14 | Light source calculation |
| NCT | 0D80420h | 30 | 30 | Light source calculation, 3 vectors |
| MVMVA | 0400012h + options | 8 | 8 | Matrix calculation |
| INTPL | 0980011h | 8 | 8 | Interpolation |
| DPCL | 0680029h | 8 | 8 | Depth queuing |
| DPCS | 0780010h | 8 | 8 | Depth queuing |
| DPCT | 0F8002Ah | 17 | 17 | Depth queuing, 3 colors |
| SQR | 0A00428h + sf*80000h | 5 | 5 | Vector squaring |
| AVSZ3 | 158002Dh | 5 | 5 | Z-averaging |
| AVSZ4 | 168002Eh | 6 | 6 | Z-averaging |
| NCLIP | 1400006h | 8 | 8 | Normal clipping |
| OP | 170000Ch + sf*80000h | 6 | 6 | Outer product |
| GPF | 190003Dh | 5 | 5 | General purpose interpolation |
| GPL | 1A0003Eh | 5 | 5 | General purpose interpolation |
The Sony command list gives RTPS 14 cycles and RTPT 22. However, Sony's own interlock example on page 4-5 shows RTPS followed by 15 cycles, and psx-spx gives 15 and 23.4 7 5
Sony's GTE Commands Reference spells the depth cue color light command DPCL, while the assembler macro file INLINE_A.H of Run-Time Library 4.7 names it DCPL, as does psx-spx.8 9 5
psx-spx reports that DPCT carries command number 0Fh in bits 20 to 24, the same number as NCDT, and that Wipeout 2097 issues NCLIP as 0140006h. Both work because the hardware reads only bits 0 to 5.10
Coordinate Calculation
RTPS - Perspective Transformation
RTPS transforms vector V0 by the rotation matrix and the translation vector, then projects it onto the screen. The screen coordinates enter the XY and Z records and the depth cue value goes to IR0, so the result can be read directly as a GPU vertex.11
(1.31.12) SSX = TRX + R11*VX0 + R12*VY0 + R13*VZ0; <1>
(1.31.12) SSY = TRY + R21*VX0 + R22*VY0 + R23*VZ0; <2>
(1.31.12) SSZ = TRZ + R31*VX0 + R32*VY0 + R33*VZ0; <3>
(1.15. 0) IR1 = limA1S(SSX);
(1.15. 0) IR2 = limA2S(SSY);
(1.15. 0) IR3 = limA3S(SSZ);
(0.16. 0) SZx(0) <- SZ0(1) <- SZ1(2) <- SZ2(3) <- limC(SSZ);
(1.27.16) SX = OFX + IR1*(H/SZ); <4>
(1.27.16) SY = OFY + IR2*(H/SZ); <4>
(1.19.24) P = DQB + DQA*(H/SZ); <4>
(1. 3.12) IR0 = limE(P)
(1.15. 0) SX0 <- SX1 <- SX2 <- limD1(SX);
(1.15. 0) SY0 <- SY1 <- SY2 <- limD2(SY);
(1. 7.24) MAC0 = P;
(1.31. 0) MAC1 = SSX;
(1.31. 0) MAC2 = SSY;
(1.31. 0) MAC3 = SSZ;
A quotient H/SZ of 2.0 or more sets the divide overflow bit 17 of FLAG.12 psx-spx reports that the hardware computes it as ((H*20000h/SZ3)+1)/2 clipped to 1FFFFh. The overflow therefore occurs when the vertex is at or behind the camera or closer than H/2 to it, which lets a program detect a near clip.13
psx-spx also reports that the hardware does not divide exactly. It uses an unsigned Newton-Raphson method with a 257-entry reciprocal table, where entry i is max(0, (40000h/(i+100h)+1)/2 - 101h), and its results can differ from the exact quotient.14
psx-spx further reports that with sf = 0 the IR3 out-of-range bit (FLAG bit 22) is tested as if lm = 0, from MAC3 shifted right by 12, while the stored IR3 still follows lm.13
RTPT - Perspective Transformation (Triple)
RTPT performs the RTPS calculation on each of V0, V1 and V2. The three results fill the XY and Z records, so a triangle is transformed by one command. The depth cue value P and the values in IR and MAC are those of the third vector.15
n=0,1,2 {
(1.31.12) SSXn = TRX + R11*VXn + R12*VYn + R13*VZn; <1>
(1.31.12) SSYn = TRY + R21*VXn + R22*VYn + R23*VZn; <2>
(1.31.12) SSZn = TRZ + R31*VXn + R32*VYn + R33*VZn; <3>
(0.16. 0) SZx(0) = SZ2(3);
(0.16. 0) SZ0(1) = limC(SSZ0);
(0.16. 0) SZ0(2) = limC(SSZ1);
(0.16. 0) SZ0(3) = limC(SSZ2);
(1.27.16) SXn = OFX + IR1*(H/SZn); <4>
(1.27.16) SYn = OFY + IR2*(H/SZn); <4>
(1.19.24) P = DQB + DQA*(H/SZ2); <4>
(1. 3.12) IR0 = limE(P);
(1.15. 0) SXn = limD1(SXn);
(1.15. 0) SYn = limD2(SYn);
}
(1.15. 0) IR1 = limA1S(SSX2);
(1.15. 0) IR2 = limA2S(SSY2);
(1.15. 0) IR3 = limA3S(SSZ2);
(1. 7.24) MAC0 = P;
(1.31. 0) MAC1 = SSX2;
(1.31. 0) MAC2 = SSY2;
(1.31. 0) MAC3 = SSZ2;
NCLIP - Normal Clipping
NCLIP computes the following sum of products from the screen coordinates in SXY0 to SXY2. The sign of the result shows whether the vertices run clockwise or counterclockwise on the screen, so a program can discard back faces before drawing.16 17
(1.43. 0) OPZ = SX0*SY1 + SX1*SY2 + SX2*SY0
- SX0*SY2 - SX1*SY0 - SX2*SY1; <4>
(1.31. 0) MAC0 = OPZ;
A result of zero means that the three vertices lie on one line.17
AVSZ3 and AVSZ4 - Z-Averaging
AVSZ3 averages the three newest Z values and AVSZ4 the four values of the Z record. The result in OTZ is used as an index into the GPU ordering table.18 19
AVSZ3:
(1.31.21) OOTZ = ZSF3*SZ0(1) + ZSF3*SZ1(2) + ZSF3*SZ2(3); <4>
(0.16. 0) OTZ = limC(OOTZ);
(1.31. 0) MAC0 = OOTZ;
AVSZ4:
(1.31.12) OOTZ = ZSF4*SZx(0) + ZSF4*SZ0(1) + ZSF4*SZ1(2) + ZSF4*SZ2(3); <4>
(0.16. 0) OTZ = limC(OOTZ);
(1.31. 0) MAC0 = OOTZ;
The AVSZ3 page gives the sum as (1.31.21) and the AVSZ4 page as (1.31.12).18 psx-spx gives both as MAC0 = ZSFn times the sum of the Z values and OTZ = MAC0/1000h. For an ordering table of N entries it gives ZSF3 = N/30h and ZSF4 = N/40h.19
General Purpose Calculation
MVMVA - Matrix and Vector Multiplication
MVMVA multiplies a vector by a matrix and adds a vector. The arguments select each operand:20
| Argument | Specified content | Value 0 | Value 1 | Value 2 | Value 3 |
|---|---|---|---|---|---|
| sf | Scaling format | Scale large | Scale small | Not valid | Not valid |
| mx | Multiplication array (1.3.12) | R | L | LR | Not valid |
| v | Multiplication vector | V0 | V1 | V2 | IR |
| cv | Addition vector | TR | BK | Not valid | 0 |
| lm | Limiter A1 to A3 lower limit | -2^15 | 0 | Not valid | Not valid |
The multiplication matrix format is fixed. The other formats follow the format (1.m.n) of the multiplication vector:20
(1.16+m.n+12) MT1 = CV1 + MX11*V1 + MX12*V2 + MX13*V3; <1>
(1.16+m.n+12) MT2 = CV2 + MX21*V1 + MX22*V2 + MX23*V3; <2>
(1.16+m.n+12) MT3 = CV3 + MX31*V1 + MX32*V2 + MX33*V3; <3>
(1.16+m.n) MAC1 = MT1;
(1.16+m.n) MAC2 = MT2;
(1.16+m.n) MAC3 = MT3;
sf == 0 sf == 1
(1.m-12.n+12) (1.m.n) IR1 = limA1C(MT1);
(1.m-12.n+12) (1.m.n) IR2 = limA2C(MT2);
(1.m-12.n+12) (1.m.n) IR3 = limA3C(MT3);
psx-spx describes the values Sony marks not valid. With cv = 2 the hardware selects the far color but adds it incorrectly: each MAC receives only the last two products, (MX12V2 + MX13V3) shifted by sf12, while some FLAG bits behave as if the full sum had been computed. With mx = 3 the matrix is made of other register values: -R10h, +R*10h, IR0, RT13, RT13, RT13, RT22, RT22 and RT22, where R is the red component of RGB.21
SQR - Vector Squaring
SQR squares each element of the IR vector. With sf = 1 the GTE performs the calculation on the data shifted by 12 bits, so the result of a (1.3.12) input keeps its 12-bit fraction.22 23
sf == 0 sf == 1
(1.m+28.n) (1.m+16.n+12) L1 = IR1*IR1; <1>
(1.m+28.n) (1.m+16.n+12) L2 = IR2*IR2; <2>
(1.m+28.n) (1.m+16.n+12) L3 = IR3*IR3; <3>
(1.m.n) (1.m+16.n+12) IR1 = limA1U(L1);
(1.m.n) (1.m+16.n+12) IR2 = limA2U(L2);
(1.m.n) (1.m+16.n+12) IR3 = limA3U(L3);
(1.m+16.0) (1.m+16.n+12) MAC1 = L1;
(1.m+16.0) (1.m+16.n+12) MAC2 = L2;
(1.m+16.0) (1.m+16.n+12) MAC3 = L3;
Because a square is never negative, the lm option has no effect on SQR.23
OP - Outer Product
OP computes the outer product of the vector (R11, R22, R33) taken from the diagonal of the rotation matrix and the IR vector.24
sf == 0 sf == 1
(1.m+28.n) (1.m+16.n+12) OPX = DY1(R22)*DZ2(IR3) - DZ1(R33)*DY2(IR2); <1>
(1.m+28.n) (1.m+16.n+12) OPY = DZ1(R33)*DX2(IR1) - DX1(R11)*DZ2(IR3); <2>
(1.m+28.n) (1.m+16.n+12) OPZ = DX1(R11)*DY2(IR2) - DY1(R22)*DX2(IR1); <3>
(1.m.n) (1.m.n) IR1 = limA1S(OPX);
(1.m.n) (1.m.n) IR2 = limA2S(OPY);
(1.m.n) (1.m.n) IR3 = limA3S(OPZ);
(1.m+16.n) (1.m+16.n) MAC1 = OPX;
(1.m+16.n) (1.m+16.n) MAC2 = OPY;
(1.m+16.n) (1.m+16.n) MAC3 = OPZ;
psx-spx calls OP the cross product and notes that the Japanese term Sony translated can mean cross product, vector product or outer product.25
GPF and GPL - General Purpose Interpolation
GPF multiplies the IR vector by IR0. GPL does the same and adds the previous MAC values, so it can scale and translate a vector in one command.26 27 28 Both write the result into the color FIFO as well as IR and MAC.26
GPF:
sf == 0 sf == 1
(1.m+28.n) (1.m+16.n+12) IPX = IR0*IR1; <1>
(1.m+28.n) (1.m+16.n+12) IPY = IR0*IR2; <2>
(1.m+28.n) (1.m+16.n+12) IPZ = IR0*IR3; <3>
GPL:
sf == 0 sf == 1
(1.m+28.n) (1.m+16.n+12) IPX = MAC1 + IR0*IR1; <1>
(1.m+28.n) (1.m+16.n+12) IPY = MAC2 + IR0*IR2; <2>
(1.m+28.n) (1.m+16.n+12) IPZ = MAC3 + IR0*IR3; <3>
Both:
(1.m.n) IR1 = limA1S(IPX);
(1.m.n) IR2 = limA2S(IPY);
(1.m.n) IR3 = limA3S(IPZ);
(1.m+16.n) MAC1 = IPX;
(1.m+16.n) MAC2 = IPY;
(1.m+16.n) MAC3 = IPZ;
(-.8.-) CD0 <- CD1 <- CD2 <- CODE
(0. 0. 8) R0 <- R1 <- R2 <- limB1(IPX);
(0. 0. 8) G0 <- G1 <- G2 <- limB2(IPY);
(0. 0. 8) B0 <- B1 <- B2 <- limB3(IPZ);
psx-spx reports that GPL with sf = 1 shifts MAC left by 12 before the addition, and that the internal value can overflow 44 bits even though the final shift undoes the first.28
Color Calculation
The light source commands compute a vertex color from a normal vector. The normal is multiplied by the light matrix to give the light intensity from each light, the intensities are multiplied by the light color matrix and added to the background color, and the result is multiplied by the vertex color in RGB. The depth cue commands then move the color toward the far color by IR0.29 30
Every color command pushes its result into the color FIFO with the CODE byte from RGB.29 psx-spx reports that the FIFO value is MAC divided by 16 and clipped to 0 to FFh. For an untextured polygon FFh is full brightness, while for texture blending 80h is normal brightness and FFh double.31
NCS and NCT - Normal Color
NCS computes the light source color of V0 without the vertex color. NCT repeats the calculation for V0, V1 and V2.32 33
(1.19.24) LL1 = L11*VX0 + L12*VY0 + L13*VZ0; <1>
(1.19.24) LL2 = L21*VX0 + L22*VY0 + L23*VZ0; <2>
(1.19.24) LL3 = L31*VX0 + L32*VY0 + L33*VZ0; <3>
(1. 3.12) L1 = limA1U(LL1);
(1. 3.12) L2 = limA2U(LL2);
(1. 3.12) L3 = limA3U(LL3);
(1.19.24) RR0 = RBK + LR1*L1 + LR2*L2 + LR3*L3; <1>
(1.19.24) GG0 = GBK + LG1*L1 + LG2*L2 + LG3*L3; <2>
(1.19.24) BB0 = BBK + LB1*L1 + LB2*L2 + LB3*L3; <3>
(1. 3.12) IR1 = limA1U(RR0);
(1. 3.12) IR2 = limA2U(GG0);
(1. 3.12) IR3 = limA3U(BB0);
(-. 8. -) CD0 <- CD1 <- CD2 <- CODE
(0. 0. 8) R0 <- R1 <- R2 <- limB1(RR0);
(0. 0. 8) G0 <- G1 <- G2 <- limB2(GG0);
(0. 0. 8) B0 <- B1 <- B2 <- limB3(BB0);
(1.19.12) MAC1 = RR0;
(1.19.12) MAC2 = GG0;
(1.19.12) MAC3 = BB0;
NCCS and NCCT - Normal Color Color
NCCS adds the multiplication by the vertex color R, G, B to NCS. NCCT repeats it for three vectors, and its IR and MAC values are those of the third vector.34 35
(1.19.24) LL1 = L11*VX0 + L12*VY0 + L13*VZ0; <1>
(1.19.24) LL2 = L21*VX0 + L22*VY0 + L23*VZ0; <2>
(1.19.24) LL3 = L31*VX0 + L32*VY0 + L33*VZ0; <3>
(1. 3.12) L1 = limA(LL1);
(1. 3.12) L2 = limA(LL2);
(1. 3.12) L3 = limA(LL3);
(1.19.24) RRLT = RBK + LR1*L1 + LR2*L2 + LR3*L3; <1>
(1.19.24) GGLT = GBK + LG1*L1 + LG2*L2 + LG3*L3; <2>
(1.19.24) BBLT = BBK + LB1*L1 + LB2*L2 + LB3*L3; <3>
(1. 3.12) RLT = limA1U(RRLT);
(1. 3.12) GLT = limA2U(GGLT);
(1. 3.12) BLT = limA3U(BBLT);
(1.27.16) RR0 = R*RLT; <1>
(1.27.16) GG0 = G*GLT; <2>
(1.27.16) BB0 = B*BLT; <3>
(1.11. 4) IR1 = limA1U(RR0);
(1.11. 4) IR2 = limA2U(GG0);
(1.11. 4) IR3 = limA3U(BB0);
(-. 8. -) CD0 <- CD1 <- CD2 <- CODE
(0. 8. 0) R0 <- R1 <- R2 <- limB1(RR0);
(0. 8. 0) G0 <- G1 <- G2 <- limB2(GG0);
(0. 8. 0) B0 <- B1 <- B2 <- limB3(BB0);
(1.27. 4) MAC1 = RR0;
(1.27. 4) MAC2 = GG0;
(1.27. 4) MAC3 = BB0;
The NCCS page writes the first limiters as limA, where NCCT and NCDS write limA1U, limA2U and limA3U.34 35
NCDS and NCDT - Normal Color Depth Cue
NCDS adds depth cueing to NCCS: the lit color is moved toward the far color by IR0. NCDT repeats it for three vectors.29 36
(1.19.24) LL1 = L11*VX0 + L12*VY0 + L13*VZ0; <1>
(1.19.24) LL2 = L21*VX0 + L22*VY0 + L23*VZ0; <2>
(1.19.24) LL3 = L31*VX0 + L32*VY0 + L33*VZ0; <3>
(1. 3.12) L1 = limA1U(LL1);
(1. 3.12) L2 = limA2U(LL2);
(1. 3.12) L3 = limA3U(LL3);
(1.19.24) RRLT = RBK + LR1*L1 + LR2*L2 + LR3*L3; <1>
(1.19.24) GGLT = GBK + LG1*L1 + LG2*L2 + LG3*L3; <2>
(1.19.24) BBLT = BBK + LB1*L1 + LB2*L2 + LB3*L3; <3>
(1. 3.12) RLT = limA1U(RRLT);
(1. 3.12) GLT = limA2U(GGLT);
(1. 3.12) BLT = limA3U(BBLT);
(1.27.16) RR0 = R*RLT + IR0*limA1S(RFC - R*RLT); <1>
(1.27.16) GG0 = G*GLT + IR0*limA2S(GFC - G*GLT); <2>
(1.27.16) BB0 = B*BLT + IR0*limA3S(BFC - B*BLT); <3>
(1.11. 4) IR1 = limA1U(RR0);
(1.11. 4) IR2 = limA2U(GG0);
(1.11. 4) IR3 = limA3U(BB0);
(-. 8. -) CD0 <- CD1 <- CD2 <- CODE
(0. 8. 0) R0 <- R1 <- R2 <- limB1(RR0);
(0. 8. 0) G0 <- G1 <- G2 <- limB2(GG0);
(0. 8. 0) B0 <- B1 <- B2 <- limB3(BB0);
(1.27. 4) MAC1 = RR0;
(1.27. 4) MAC2 = GG0;
(1.27. 4) MAC3 = BB0;
psx-spx reports that the difference (FC - color) is clipped to -8000h to 7FFFh as if lm = 0, whatever the lm bit, while the later writes to IR follow lm.37
CC and CDP - Color Color and Color Depth Cue
CC and CDP start from a light intensity vector already in IR1 to IR3 instead of a normal. CC applies the light color matrix, background color and vertex color, and CDP adds depth cueing.38 39
CC:
(1.19.24) RRLT = RBK + LR1*IR1 + LR2*IR2 + LR3*IR3; <1>
(1.19.24) GGLT = GBK + LG1*IR1 + LG2*IR2 + LG3*IR3; <2>
(1.19.24) BBLT = BBK + LB1*IR1 + LB2*IR2 + LB3*IR3; <3>
(1. 3.12) RLT = limA1U(RRLT);
(1. 3.12) GLT = limA2U(GGLT);
(1. 3.12) BLT = limA3U(BBLT);
(1.27.16) RR0 = R*RLT; <1>
(1.27.16) GG0 = G*GLT; <2>
(1.27.16) BB0 = B*BLT; <3>
CDP replaces the last three lines with:
(1.27.16) RR0 = R*RLT + IR0*limA1S(RFC - R*RLT); <1>
(1.27.16) GG0 = G*GLT + IR0*limA2S(GFC - G*GLT); <2>
(1.27.16) BB0 = B*BLT + IR0*limA3S(BFC - B*BLT); <3>
Both then:
(1.11. 4) IR1 = limA1U(RR0);
(1.11. 4) IR2 = limA2U(GG0);
(1.11. 4) IR3 = limA3U(BB0);
(-. 8. -) CD0 <- CD1 <- CD2 <- CODE
(0. 8. 0) R0 <- R1 <- R2 <- limB1(RR0);
(0. 8. 0) G0 <- G1 <- G2 <- limB2(GG0);
(0. 8. 0) B0 <- B1 <- B2 <- limB3(BB0);
(1.27. 4) MAC1 = RR0;
(1.27. 4) MAC2 = GG0;
(1.27. 4) MAC3 = BB0;
Depth Cueing and Interpolation
DPCS DPCT and DPCL - Depth Queuing
DPCS moves the color in RGB toward the far color by IR0. DPCT does the same for the three colors of the color FIFO, and DPCL first multiplies the color by the IR vector.8 40 41
DPCS:
(1.27.16) RR0 = R*1.0 + IR0*limA1S(RFC-R*1.0); <1>
(1.27.16) GG0 = G*1.0 + IR0*limA2S(GFC-G*1.0); <2>
(1.27.16) BB0 = B*1.0 + IR0*limA3S(BFC-B*1.0); <3>
DPCL:
(1.27.16) RR0 = R*IR1 + IR0*limA1S(RFC - R*IR1); <1>
(1.27.16) GG0 = G*IR2 + IR0*limA2S(GFC - G*IR2); <2>
(1.27.16) BB0 = B*IR3 + IR0*limA3S(BFC - B*IR3); <3>
Both then:
(1.11. 4) IR1 = limA1S(RR0);
(1.11. 4) IR2 = limA2S(GG0);
(1.11. 4) IR3 = limA3S(BB0);
(-. 8. -) CD0 <- CD1 <- CD2 <- CODE
(0. 8. 0) R0 <- R1 <- R2 <- limB1(RR0);
(0. 8. 0) G0 <- G1 <- G2 <- limB2(GG0);
(0. 8. 0) B0 <- B1 <- B2 <- limB3(BB0);
(1.27. 4) MAC1 = RR0;
(1.27. 4) MAC2 = GG0;
(1.27. 4) MAC3 = BB0;
DPCT:
n=0,1,2 {
(1.27.16) RRn = Rn*1.0 + IR0*limA1S(RFC-R*1.0); <1>
(1.27.16) GGn = Gn*1.0 + IR0*limA2S(GFC-G*1.0); <2>
(1.27.16) BBn = Bn*1.0 + IR0*limA3S(BFC-B*1.0); <3>
(1.11. 4) IR1 = limA1S(RR2);
(1.11. 4) IR2 = limA2S(GG2);
(1.11. 4) IR3 = limA3S(BB2);
(-. 8. -) CDn = CODE
(0. 8. 0) Rn = limB1(RRn);
(0. 8. 0) Gn = limB2(GGn);
(0. 8. 0) Bn = limB3(BBn);
}
(1.27. 4) MAC1 = RR2;
(1.27. 4) MAC2 = GG2;
(1.27. 4) MAC3 = BB2;
psx-spx reports that DPCT reads each color from RGB0, the oldest FIFO entry, three times over, while CODE still comes from RGB. The three FIFO entries are therefore replaced by the depth-cued colors.42
INTPL - Interpolation
INTPL moves the IR vector toward the far color by IR0 and writes the result to IR, MAC and the color FIFO. The format (1.m.n) of IR sets the format of the result.43
(1.16+m.n+12) IPL1 = 1.0*IR1 + IR0*limA1S(RFC-1.0*IR1); <1>
(1.16+m.n+12) IPL2 = 1.0*IR2 + IR0*limA2S(GFC-1.0*IR2); <2>
(1.16+m.n+12) IPL3 = 1.0*IR3 + IR0*limA3S(BFC-1.0*IR3); <3>
(1.m.n) IR1 = limA1S(IPL1);
(1.m.n) IR2 = limA2S(IPL2);
(1.m.n) IR3 = limA3S(IPL3);
(-.8.-) CD0 <- CD1 <- CD2 <- CODE
(0.12-n.n-4) R0 <- R1 <- R2 <- limB1(IPL1);
(0.12-n.n-4) G0 <- G1 <- G2 <- limB2(IPL2);
(0.12-n.n-4) B0 <- B1 <- B2 <- limB3(IPL3);
(1.16+m.n) MAC1 = IPL1;
(1.16+m.n) MAC2 = IPL2;
(1.16+m.n) MAC3 = IPL3;
The INTPL page names the first three results IRL1 to IRL3 and reads them back as IPL1 to IPL3; this page uses IPL throughout.43
References
-
^ a b c psx-spx. Geometry Transformation Engine (GTE), GTE Command Encoding (COP2 imm25 opcodes). https://psx-spx.consoledev.net/geometrytransformationenginegte/
-
^ Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 6-4.
-
^ Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Pages 6-26, 6-36, 6-44, 6-46 and 6-48.
-
^ a b Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 6-5, Command List.
-
^ a b c psx-spx. Geometry Transformation Engine (GTE), GTE Command Summary (sorted by Real Opcode bits). https://psx-spx.consoledev.net/geometrytransformationenginegte/
-
^ Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 1-3.
-
^ Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 4-5.
-
^ a b Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 6-30, DPCL.
-
^ Sony Computer Entertainment Inc. Run-Time Library Release 4.7. INCLUDE/INLINE_A.H, macro DCPL.
-
^ psx-spx. Geometry Transformation Engine (GTE), GTE Command Summary (sorted by Fake Opcode bits). https://psx-spx.consoledev.net/geometrytransformationenginegte/
-
^ Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 6-6, RTPS.
-
^ Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 5-27.
-
^ a b psx-spx. Geometry Transformation Engine (GTE), RTPS and RTPT. https://psx-spx.consoledev.net/geometrytransformationenginegte/
-
^ psx-spx. Geometry Transformation Engine (GTE), GTE Division Inaccuracy. https://psx-spx.consoledev.net/geometrytransformationenginegte/
-
^ Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 6-8, RTPT.
-
^ Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 6-42, NCLIP.
-
^ a b psx-spx. Geometry Transformation Engine (GTE), NCLIP - Normal clipping. https://psx-spx.consoledev.net/geometrytransformationenginegte/
-
^ a b Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Pages 6-38 and 6-40, AVSZ3 and AVSZ4.
-
^ a b psx-spx. Geometry Transformation Engine (GTE), AVSZ3 and AVSZ4. https://psx-spx.consoledev.net/geometrytransformationenginegte/
-
^ a b Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 6-26, MVMVA.
-
^ psx-spx. Geometry Transformation Engine (GTE), MVMVA. https://psx-spx.consoledev.net/geometrytransformationenginegte/
-
^ Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 6-36, SQR.
-
^ a b psx-spx. Geometry Transformation Engine (GTE), SQR - Square vector. https://psx-spx.consoledev.net/geometrytransformationenginegte/
-
^ Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 6-44, OP.
-
^ psx-spx. Geometry Transformation Engine (GTE), OP - Cross product of 2 vectors. https://psx-spx.consoledev.net/geometrytransformationenginegte/
-
^ a b Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 6-46, GPF.
-
^ Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 6-48, GPL.
-
^ a b psx-spx. Geometry Transformation Engine (GTE), GPF and GPL. https://psx-spx.consoledev.net/geometrytransformationenginegte/
-
^ a b c Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 6-10, NCDS.
-
^ psx-spx. Geometry Transformation Engine (GTE), GTE Color Calculation Commands. https://psx-spx.consoledev.net/geometrytransformationenginegte/
-
^ psx-spx. Geometry Transformation Engine (GTE), GTE Color Calculation Commands, Notes. https://psx-spx.consoledev.net/geometrytransformationenginegte/
-
^ Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 6-22, NCS.
-
^ Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 6-24, NCT.
-
^ a b Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 6-14, NCCS.
-
^ a b Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 6-16, NCCT.
-
^ Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 6-12, NCDT.
-
^ psx-spx. Geometry Transformation Engine (GTE), Details on MAC+(FC-MAC)*IR0. https://psx-spx.consoledev.net/geometrytransformationenginegte/
-
^ Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 6-18, CDP.
-
^ Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 6-20, CC.
-
^ Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 6-32, DPCS.
-
^ Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 6-34, DPCT.
-
^ psx-spx. Geometry Transformation Engine (GTE), DPCS, DPCT, DCPL and INTPL. https://psx-spx.consoledev.net/geometrytransformationenginegte/
-
^ a b Sony Computer Entertainment Inc. Inline Programming Reference. November 1998. Page 6-28, INTPL.