mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-20 20:49:12 +12:00
[PICA] We now know how to convert attributes to f32
This commit is contained in:
parent
dcad7846eb
commit
93e5c268e8
2 changed files with 35 additions and 24 deletions
|
@ -1,7 +1,10 @@
|
|||
#include "PICA/gpu.hpp"
|
||||
#include "PICA/float_types.hpp"
|
||||
#include "PICA/regs.hpp"
|
||||
#include <cstdio>
|
||||
|
||||
using namespace Floats;
|
||||
|
||||
void GPU::reset() {
|
||||
regs.fill(0);
|
||||
shaderUnit.reset();
|
||||
|
@ -16,5 +19,13 @@ void GPU::drawArrays() {
|
|||
const u32 vertexCount = regs[PICAInternalRegs::VertexCountReg];
|
||||
const u32 vertexOffset = regs[PICAInternalRegs::VertexOffsetReg];
|
||||
|
||||
|
||||
u32* attrBuffer = ®s[0x233];
|
||||
auto a = f24::fromRaw(attrBuffer[0] >> 8);
|
||||
auto b = f24::fromRaw(((attrBuffer[0] & 0xFF) << 16) | ((attrBuffer[1] >> 16) & 0xFFFF));
|
||||
auto g = f24::fromRaw(((attrBuffer[1] & 0xFFFF) << 8) | ((attrBuffer[2] >> 24) & 0xFF));
|
||||
auto r = f24::fromRaw(attrBuffer[2] & 0xFFFFFF);
|
||||
|
||||
printf("PICA::DrawArrays(vertex count = %d, vertexOffset = %d)\n", vertexCount, vertexOffset);
|
||||
printf("(r: %f, g: %f, b: %f, a: %f)\n", r.toFloat32(), g.toFloat32(), b.toFloat32(), a.toFloat32());
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue