Merge pull request #31 from robojumper/eggXfb

eggXfb matching
This commit is contained in:
Elijah Thomas
2024-05-05 12:48:17 -04:00
committed by GitHub
2 changed files with 34 additions and 1 deletions
+2 -1
View File
@@ -365,8 +365,9 @@ config.libs = [
Object(Matching, "egg/core/eggDisplay.cpp"),
Object(Matching, "egg/core/eggColorFader.cpp"),
Object(Matching, "egg/core/eggAsyncDisplay.cpp"),
Object(Matching, "egg/core/eggXfb.cpp"),
Object(Matching, "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