50 uint32_t wasSemiTrans = command & 0x02000000;
51 command = 0x20000000 | (
c.packed & 0x00ffffff) | wasSemiTrans;
56 command &= ~0x02000000;
60 command |= 0x02000000;
85static_assert(
sizeof(
Triangle) == (
sizeof(
uint32_t) * 4),
"Triangle is not 4 words");
104 uint32_t wasSemiTrans = command & 0x02000000;
105 command = 0x24000000 | (
c.packed & 0x00ffffff) | wasSemiTrans;
110 command &= ~0x02000000;
114 command |= 0x02000000;
147 uint32_t wasSemiTrans = command & 0x02000000;
148 command = 0x30000000 | (
c.packed & 0x00ffffff) | wasSemiTrans;
163 command &= ~0x02000000;
186 command |= 0x02000000;
202 template <Transparency transparency = Transparency::Auto>
204 GTE::write<GTE::Register::RGB0, GTE::Unsafe>(&a->
packed);
205 GTE::write<GTE::Register::RGB1, GTE::Unsafe>(&
b->packed);
206 GTE::write<GTE::Register::RGB2, GTE::Unsafe>(&
c->packed);
208 GTE::write<GTE::Register::RGB, GTE::Safe>(&command);
210 GTE::write<GTE::Register::RGB, GTE::Safe>(0x30000000);
212 GTE::write<GTE::Register::RGB, GTE::Safe>(0x32000000);
214 GTE::Kernels::dpct();
215 GTE::read<GTE::Register::RGB0>(&command);
219 template <Transparency transparency = Transparency::Auto>
221 GTE::write<GTE::Register::RGB0, GTE::Unsafe>(a.
packed);
222 GTE::write<GTE::Register::RGB1, GTE::Unsafe>(
b.packed);
223 GTE::write<GTE::Register::RGB2, GTE::Unsafe>(
c.packed);
225 GTE::write<GTE::Register::RGB, GTE::Safe>(&command);
227 GTE::write<GTE::Register::RGB, GTE::Safe>(0x30000000);
229 GTE::write<GTE::Register::RGB, GTE::Safe>(0x32000000);
231 GTE::Kernels::dpct();
232 GTE::read<GTE::Register::RGB0>(&command);
267 : command(other.command | (
c.packed & 0x00ffffff)) {}
269 uint32_t wasSemiTrans = command & 0x02000000;
270 command = 0x34000000 | (
c.packed & 0x00ffffff) | wasSemiTrans;
285 command &= ~0x02000000;
308 command |= 0x02000000;
312 template <Transparency transparency = Transparency::Auto>
314 GTE::write<GTE::Register::RGB0, GTE::Unsafe>(&a->
packed);
315 GTE::write<GTE::Register::RGB1, GTE::Unsafe>(&
b->packed);
316 GTE::write<GTE::Register::RGB2, GTE::Unsafe>(&
c->packed);
318 GTE::write<GTE::Register::RGB, GTE::Safe>(&command);
320 GTE::write<GTE::Register::RGB, GTE::Safe>(0x34000000);
322 GTE::write<GTE::Register::RGB, GTE::Safe>(0x36000000);
324 GTE::Kernels::dpct();
325 GTE::read<GTE::Register::RGB0>(&command);
329 template <Transparency transparency = Transparency::Auto>
331 GTE::write<GTE::Register::RGB0, GTE::Unsafe>(a.
packed);
332 GTE::write<GTE::Register::RGB1, GTE::Unsafe>(
b.packed);
333 GTE::write<GTE::Register::RGB2, GTE::Unsafe>(
c.packed);
335 GTE::write<GTE::Register::RGB, GTE::Safe>(&command);
337 GTE::write<GTE::Register::RGB, GTE::Safe>(0x34000000);
339 GTE::write<GTE::Register::RGB, GTE::Safe>(0x36000000);
341 GTE::Kernels::dpct();
342 GTE::read<GTE::Register::RGB0>(&command);
uint8_t b
Definition gte-depthcue.c:39
A primitive's CLUT command.
Definition common.hh:121
A primitive's tpage attribute.
Definition common.hh:188
A primitive's UV coordinates attribute.
Definition common.hh:295
A primitive's UV coordinates attribute.
Definition common.hh:284
A textured, blended triangle.
Definition triangles.hh:263
Vertex pointB
Definition triangles.hh:355
GouraudTexturedTriangle(const GouraudTexturedTriangle &other, Color c)
Definition triangles.hh:266
GouraudTexturedTriangle & setOpaque()
Definition triangles.hh:284
Vertex pointA
Definition triangles.hh:351
GouraudTexturedTriangle()
Definition triangles.hh:264
GouraudTexturedTriangle & setSemiTrans()
Definition triangles.hh:307
GouraudTexturedTriangle(Color c)
Definition triangles.hh:265
Color getColorB() const
Definition triangles.hh:282
PrimPieces::UVCoordsPadded uvC
Definition triangles.hh:360
Color colorB
Definition triangles.hh:354
GouraudTexturedTriangle & setColorB(Color c)
Definition triangles.hh:273
PrimPieces::TPageAttr tpage
Definition triangles.hh:357
PrimPieces::UVCoords uvA
Definition triangles.hh:352
PrimPieces::ClutIndex clutIndex
Definition triangles.hh:353
GouraudTexturedTriangle & setColorA(Color c)
Definition triangles.hh:268
Vertex pointC
Definition triangles.hh:359
GouraudTexturedTriangle & setColorAPacked(uint32_t packed)
Sets the command word and vertex A's colour in one go.
Definition triangles.hh:303
Color getColorC() const
Definition triangles.hh:283
bool isSemiTrans() const
Definition triangles.hh:311
void interpolateColors(Color a, Color b, Color c)
Definition triangles.hh:330
Color getColorA() const
Definition triangles.hh:281
Color colorC
Definition triangles.hh:358
uint32_t getCommandWord() const
The GP0 command word, minus any colour.
Definition triangles.hh:295
GouraudTexturedTriangle & setColorC(Color c)
Definition triangles.hh:277
PrimPieces::UVCoords uvB
Definition triangles.hh:356
void interpolateColors(const Color *a, const Color *b, const Color *c)
Definition triangles.hh:313
A gouraud-shaded triangle.
Definition triangles.hh:142
GouraudTriangle(const GouraudTriangle &other, Color c)
Definition triangles.hh:145
Vertex pointC
Definition triangles.hh:245
GouraudTriangle & setPointC(Vertex v)
Definition triangles.hh:198
uint32_t getCommandWord() const
The GP0 command word, minus any colour.
Definition triangles.hh:173
Color getColorC() const
Definition triangles.hh:161
GouraudTriangle & setColorA(Color c)
Definition triangles.hh:146
Color getColorA() const
Definition triangles.hh:159
Vertex pointA
Definition triangles.hh:241
Color colorC
Definition triangles.hh:244
GouraudTriangle & setColorB(Color c)
Definition triangles.hh:151
GouraudTriangle()
Definition triangles.hh:143
GouraudTriangle & setPointB(Vertex v)
Definition triangles.hh:194
bool isSemiTrans() const
Definition triangles.hh:189
GouraudTriangle(Color c)
Definition triangles.hh:144
GouraudTriangle & setOpaque()
Definition triangles.hh:162
GouraudTriangle & setSemiTrans()
Definition triangles.hh:185
void interpolateColors(Color a, Color b, Color c)
Definition triangles.hh:220
GouraudTriangle & setPointA(Vertex v)
Definition triangles.hh:190
GouraudTriangle & setColorAPacked(uint32_t packed)
Sets the command word and vertex A's colour in one go.
Definition triangles.hh:181
void interpolateColors(const Color *a, const Color *b, const Color *c)
Definition triangles.hh:203
Color getColorB() const
Definition triangles.hh:160
Vertex pointB
Definition triangles.hh:243
GouraudTriangle & setColorC(Color c)
Definition triangles.hh:155
Color colorB
Definition triangles.hh:242
A textured triangle.
Definition triangles.hh:99
Vertex pointB
Definition triangles.hh:126
Color getColor() const
Definition triangles.hh:108
TexturedTriangle(const TexturedTriangle &other, Color c)
Definition triangles.hh:102
PrimPieces::ClutIndex clutIndex
Definition triangles.hh:125
PrimPieces::TPageAttr tpage
Definition triangles.hh:128
TexturedTriangle & setSemiTrans()
Definition triangles.hh:113
PrimPieces::UVCoords uvA
Definition triangles.hh:124
PrimPieces::UVCoords uvB
Definition triangles.hh:127
bool isSemiTrans() const
Definition triangles.hh:117
Vertex pointA
Definition triangles.hh:123
TexturedTriangle & setColor(Color c)
Definition triangles.hh:103
TexturedTriangle(Color c)
Definition triangles.hh:101
Vertex pointC
Definition triangles.hh:129
PrimPieces::UVCoordsPadded uvC
Definition triangles.hh:130
TexturedTriangle()
Definition triangles.hh:100
TexturedTriangle & setOpaque()
Definition triangles.hh:109
A flat-colored triangle.
Definition triangles.hh:45
Triangle & setSemiTrans()
Definition triangles.hh:59
Triangle & setPointA(Vertex v)
Definition triangles.hh:64
Triangle()
Definition triangles.hh:46
Color getColor() const
Definition triangles.hh:54
Vertex pointC
Definition triangles.hh:83
Triangle(const Triangle &other, Color c)
Definition triangles.hh:48
Triangle & setPointB(Vertex v)
Definition triangles.hh:68
Triangle(Color c)
Definition triangles.hh:47
Vertex pointB
Definition triangles.hh:82
bool isSemiTrans() const
Definition triangles.hh:63
Triangle & setOpaque()
Definition triangles.hh:55
Vertex pointA
Definition triangles.hh:81
Triangle & setPointC(Vertex v)
Definition triangles.hh:72
Triangle & setColor(Color c)
Definition triangles.hh:49
static int c
Definition syscalls.h:122
void uint32_t(classId, spec)
The Color struct.
Definition common.hh:91
uint32_t packed
Definition common.hh:95
The Vertex struct.
Definition common.hh:47