Renders on Dolphin also.
This commit is contained in:
@@ -15,9 +15,15 @@ errorret_t displayInitDolphin(void) {
|
||||
DISPLAY.frameBuffer[0] = MEM_K0_TO_K1(
|
||||
SYS_AllocateFramebuffer(DISPLAY.screenMode)
|
||||
);
|
||||
if(DISPLAY.frameBuffer[0] == NULL) {
|
||||
errorThrow("Failed to allocate framebuffer");
|
||||
}
|
||||
DISPLAY.frameBuffer[1] = MEM_K0_TO_K1(
|
||||
SYS_AllocateFramebuffer(DISPLAY.screenMode)
|
||||
);
|
||||
if(DISPLAY.frameBuffer[1] == NULL) {
|
||||
errorThrow("Failed to allocate framebuffer");
|
||||
}
|
||||
VIDEO_Configure(DISPLAY.screenMode);
|
||||
|
||||
VIDEO_SetNextFramebuffer(DISPLAY.frameBuffer[DISPLAY.whichFrameBuffer]);
|
||||
@@ -28,6 +34,9 @@ errorret_t displayInitDolphin(void) {
|
||||
if(DISPLAY.screenMode->viTVMode & VI_NON_INTERLACE) VIDEO_WaitVSync();
|
||||
|
||||
DISPLAY.fifoBuffer = memalign(32, DISPLAY_DOLPHIN_FIFO_SIZE);
|
||||
if(DISPLAY.fifoBuffer == NULL) {
|
||||
errorThrow("Failed to allocate FIFO buffer");
|
||||
}
|
||||
memoryZero(DISPLAY.fifoBuffer, DISPLAY_DOLPHIN_FIFO_SIZE);
|
||||
|
||||
GX_Init(DISPLAY.fifoBuffer, DISPLAY_DOLPHIN_FIFO_SIZE);
|
||||
@@ -69,15 +78,16 @@ errorret_t displayInitDolphin(void) {
|
||||
// Setup cull modes
|
||||
GX_SetCullMode(GX_CULL_NONE);
|
||||
GX_SetZMode(GX_FALSE, GX_ALWAYS, GX_FALSE);
|
||||
GX_CopyDisp(DISPLAY.frameBuffer[DISPLAY.whichFrameBuffer], GX_TRUE);
|
||||
GX_SetDispCopyGamma(GX_GM_1_0);
|
||||
GX_SetColorUpdate(GX_TRUE);
|
||||
|
||||
// Describe mesh vertex format.
|
||||
GX_ClearVtxDesc();
|
||||
GX_SetVtxDesc(GX_VA_POS, GX_INDEX16);
|
||||
GX_SetVtxDesc(GX_VA_CLR0, GX_INDEX16);
|
||||
GX_SetVtxDesc(GX_VA_TEX0, GX_INDEX16);
|
||||
GX_SetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);
|
||||
GX_SetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_U8, 0);
|
||||
GX_SetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0);
|
||||
GX_SetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0);
|
||||
|
||||
errorOk();
|
||||
@@ -85,14 +95,15 @@ errorret_t displayInitDolphin(void) {
|
||||
|
||||
errorret_t displayUpdateDolphin(void) {
|
||||
ENGINE.running = SYS_MainLoop();
|
||||
errorOk();
|
||||
}
|
||||
|
||||
errorret_t displaySwapDolphin(void) {
|
||||
GX_DrawDone();
|
||||
|
||||
DISPLAY.whichFrameBuffer ^= 1;
|
||||
GX_SetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE);
|
||||
GX_SetColorUpdate(GX_TRUE);
|
||||
// GX_SetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE);
|
||||
// GX_SetColorUpdate(GX_TRUE);
|
||||
GX_CopyDisp(DISPLAY.frameBuffer[DISPLAY.whichFrameBuffer], GX_TRUE);
|
||||
VIDEO_SetNextFramebuffer(DISPLAY.frameBuffer[DISPLAY.whichFrameBuffer]);
|
||||
VIDEO_Flush();
|
||||
|
||||
Reference in New Issue
Block a user