diff options
| author | Elijah Thomas <42302100+elijah-thomas774@users.noreply.github.com> | 2024-05-05 12:48:17 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-05 12:48:17 -0400 |
| commit | 745f34f8f0bb14d56c1ba11d2ffc835bf916ed75 (patch) | |
| tree | 51dcb4caa37bbd7b28548a3a9742531cee77c4fe /src | |
| parent | 44d4b2ba5bd4af3d7c535d410fcaf7a89768187a (diff) | |
| parent | 4c3aaf26abaaa8026b96309a0539c2804b01ca9d (diff) | |
Merge pull request #31 from robojumper/eggXfb
eggXfb matching
Diffstat (limited to 'src')
| -rw-r--r-- | src/egg/core/eggXfb.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/egg/core/eggXfb.cpp b/src/egg/core/eggXfb.cpp new file mode 100644 index 00000000..4347689f --- /dev/null +++ b/src/egg/core/eggXfb.cpp @@ -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 |
