Start StateEfb

This commit is contained in:
robojumper
2025-03-24 23:40:14 +01:00
parent 922f048314
commit 3e7dd3283a
6 changed files with 77 additions and 8 deletions
+43 -1
View File
@@ -1,3 +1,45 @@
#include "egg/gfx/eggStateEfb.h"
namespace EGG {} // namespace EGG
#include "common.h"
#include "egg/gfx/eggTextureBuffer.h"
namespace EGG {
StateEfb::Buffer StateEfb::spBufferSet[BUFFER_MAX];
f32 StateEfb::sWorkSpaceV[6];
f32 StateEfb::sWorkSpaceHideV[6];
f32 StateEfb::sUnkBuffer[6];
u32 StateEfb::sFlag = 4;
s32 StateEfb::sWorkBuffer = -1;
s32 StateEfb::sPushCount;
void StateEfb::Clean() {
sFlag &= ~(1 | 2);
sWorkBuffer = -1;
sPushCount = 0;
for (u32 i = 0; i < ARRAY_LENGTH(spBufferSet); i++) {
spBufferSet[i].field_0x08 = 0;
}
for (u32 i = 0; i < ARRAY_LENGTH(sWorkSpaceV); i++) {
sWorkSpaceV[i] = 0.0f;
sWorkSpaceHideV[i] = 0.0f;
}
}
bool StateEfb::releaseEfb(BufferType type, u32 userData) {
if (spBufferSet[type].buf != nullptr && spBufferSet[type].userData == userData) {
spBufferSet[type].buf->free();
spBufferSet[type].buf = nullptr;
spBufferSet[type].userData = 0;
spBufferSet[type].field_0x08 = 0;
return true;
} else {
return false;
}
}
} // namespace EGG
+1 -1
View File
@@ -34,7 +34,7 @@ static const f32 identity[3][4] = {
namespace EGG {
GXTexObj StateGX::sDefaultTexObj;
GXTexObj ALIGN_DECL(32) StateGX::sDefaultTexObj;
StateGX::MemLayout StateGX::s_tmem_layout;
StateGX::CacheGX StateGX::s_cacheGX;