Skip to content

Commit 8dfe115

Browse files
committed
Change __toggleframebuffer().
1 parent e13e35c commit 8dfe115

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

libogc/exception.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,12 @@ void __exception_setreload(int t)
200200
}
201201

202202
static void __toggleframebuffer() {
203-
static bool currfb = false;
204-
if(currfb) {
205-
currfb = false;
206-
VIDEO_SetFramebuffer(exception_xfb);
207-
} else {
208-
currfb = true;
203+
if(VIDEO_GetCurrentFramebuffer() == exception_xfb) {
209204
VIDEO_SetFramebuffer(lookup_xfb);
205+
} else {
206+
VIDEO_SetFramebuffer(exception_xfb);
210207
}
208+
VIDEO_Flush();
211209
}
212210

213211
static void waitForReload(void)
@@ -250,6 +248,7 @@ static void waitForReload(void)
250248
reload_timer--;
251249
__toggleframebuffer();
252250
VIDEO_WaitVSync();
251+
udelay(20000);
253252
}
254253

255254
if ( buttonsDown & PAD_BUTTON_A || SYS_ResetButtonDown() )
@@ -281,6 +280,7 @@ void c_default_exceptionhandler(frame_context *pCtx)
281280
VIDEO_WaitVSync();
282281
GX_AbortFrame();
283282
VIDEO_SetFramebuffer(exception_xfb);
283+
VIDEO_Flush();
284284
__VIClearFramebuffer(exception_xfb, console_height * console_width * VI_DISPLAY_PIX_SZ, COLOR_BLACK);
285285
__console_init(exception_xfb, 16, 32, console_height-16, console_width-32, 1280);
286286
CON_EnableGecko(1, true);

0 commit comments

Comments
 (0)