eggXfb matching

This commit is contained in:
robojumper
2024-05-05 18:08:43 +02:00
parent 85a8d9ebaf
commit 7b04ad06bf
2 changed files with 33 additions and 1 deletions
+1 -1
View File
@@ -366,7 +366,7 @@ config.libs = [
Object(Matching, "egg/core/eggColorFader.cpp"),
Object(Matching, "egg/core/eggAsyncDisplay.cpp"),
Object(NonMatching, "egg/core/eggVideo.cpp"),
Object(NonMatching, "egg/core/eggXfb.cpp"),
Object(Matching, "egg/core/eggXfb.cpp"),
Object(NonMatching, "egg/core/eggXfbManager.cpp"),
Object(NonMatching, "egg/core/eggGraphicsFifo.cpp"),
Object(NonMatching, "egg/core/eggController.cpp"),
+32
View File
@@ -0,0 +1,32 @@
#include <egg/core/eggSystem.h>
#include <egg/core/eggVideo.h>
#include <egg/core/eggXfb.h>
namespace EGG {
/* 804989e0 */ void Xfb::init(u16 width, u16 height, Heap *heap) {
mWidth = width;
mHeight = height;
u32 size = calcBufferSize(width, height);
if (heap == nullptr) {
heap = Heap::sCurrentHeap;
}
u8 *buf = new (heap, 32) u8[size];
mBuffer = buf;
mPrev = nullptr;
mNext = nullptr;
mState = XFB_UNPROCESSED;
}
/* 80498a60 */ Xfb::Xfb(Heap *heap) {
Video *video = BaseSystem::mConfigData->getVideo();
init(video->pRenderMode->fbWidth, video->pRenderMode->xfbHeight, heap);
}
/* 80498ad0 */ u32 Xfb::calcBufferSize(u16 width, u16 height) {
return ((width + 0xf) & 0xfff0) * height * 2;
}
} // namespace EGG