diff options
| author | TakaRikka <38417346+TakaRikka@users.noreply.github.com> | 2023-03-28 04:11:41 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-28 05:11:41 -0600 |
| commit | 92b88e83e86c60442ba1f9748c80b7db9242bf92 (patch) | |
| tree | 0911f27946cfd9f4f108116bbb59576b053aac6b /include/JSystem/J3DGraphBase | |
| parent | 721880831e114f08756ffd846ab69cd0d729863c (diff) | |
d_menu_calibration done / J3DDrawBuffer done / more d_drawlist wip (#312)
* d_drawlist work / finish J3DDrawBuffer
* d_menu_calibration done
* remove asm
Diffstat (limited to 'include/JSystem/J3DGraphBase')
| -rw-r--r-- | include/JSystem/J3DGraphBase/J3DDrawBuffer.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/JSystem/J3DGraphBase/J3DDrawBuffer.h b/include/JSystem/J3DGraphBase/J3DDrawBuffer.h index b937d16387..b4577c07cf 100644 --- a/include/JSystem/J3DGraphBase/J3DDrawBuffer.h +++ b/include/JSystem/J3DGraphBase/J3DDrawBuffer.h @@ -5,6 +5,30 @@ #include "dolphin/mtx/mtx.h" #include "dolphin/types.h" +// matches debug +inline f32 J3DCalcZValue(register MtxP m, register Vec v) { + register f32 temp_f4; + register f32 out; + register f32 temp_f0; + register f32 temp_f2; + register f32 temp_f1 = 1.0f; + + // clang-format off + asm { + psq_l temp_f0, 0(v), 0, 0 /* qr0 */ + lfs temp_f2, 8(v) + psq_l temp_f4, 32(m), 0, 0 /* qr0 */ + psq_l out, 40(m), 0, 0 /* qr0 */ + ps_merge00 temp_f2, temp_f2, temp_f1 + ps_mul temp_f4, temp_f0, temp_f4 + ps_madd out, temp_f2, out, temp_f4 + ps_sum0 out, out, out, out + } + // clang-format on + + return out; +} + class J3DDrawBuffer; class J3DPacket; class J3DDrawPacket; @@ -46,6 +70,8 @@ public: void drawHead() const; void drawTail() const; + u32 getEntryTableSize() { return mBufSize; } + inline void calcZRatio(); void setNonSort() { mSortType = 5; } void setZSort() { mSortType = 2; } |
