Decompile `nuGfxSetCfb`

This commit is contained in:
gijs 2023-10-20 12:45:21 +02:00
parent c23bc3a884
commit 6dde5925bc
1 changed files with 35 additions and 1 deletions

View File

@ -1,3 +1,37 @@
#include "common.h" #include "common.h"
INCLUDE_ASM(const s32, "nu/nugfxsetcfb", nuGfxSetCfb); #include "nu/nusys.h"
void nuGfxSetCfb(u16** framebuf, u32 framebufnum) {
u32 i;
nuGfxCfb = framebuf;
nuGfxCfbNum = framebufnum;
nuGfxCfbCounter = 0;
nuGfxCfb_ptr = nuGfxCfb[0];
nuGfxRetraceWait(1);
nuScSetFrameBufferNum(framebufnum);
if (framebufnum > 1) {
s32 i;
for (i = 0; i < framebufnum - 1; i++) {
if (nuGfxCfb[i] != nuGfxCfb[i+1]) {
break;
}
}
if (i == framebufnum - 1) {
nuScSetFrameBufferNum(1);
} else {
for (i = 0; i < framebufnum; i++) {
if (osViGetNextFramebuffer() != nuGfxCfb[i]) {
nuGfxCfbCounter = i;
nuGfxCfb_ptr = nuGfxCfb[i];
break;
}
}
}
}
}