improved screen transitions

This commit is contained in:
ekeeke31 2009-04-01 12:36:14 +00:00
parent 148391d681
commit db376c40ec
2 changed files with 22 additions and 23 deletions

View File

@ -792,8 +792,8 @@ static void menu_fade(gui_menu *menu, u8 speed, u8 out)
/* alpha step */ /* alpha step */
u16 alpha = out ? 128 : 255; u16 alpha = out ? 128 : 255;
int alpha_step = out ? (128/offset) : -(128/offset); s16 alpha_step = (127 * speed) /offset;
if (!out) alpha_step = -alpha_step;
/* loop until final position is reeached */ /* loop until final position is reeached */
while (offset > 0) while (offset > 0)
@ -2164,6 +2164,8 @@ void MainMenu (u32 fps)
if (genromsize || (config.bios_enabled == 3)) if (genromsize || (config.bios_enabled == 3))
{ {
system_reset (); system_reset ();
VIDEO_ClearFrameBuffer(vmode, xfb[whichfb], COLOR_BLACK);
VIDEO_Flush();
quit = 1; quit = 1;
} }
break; break;
@ -2203,7 +2205,8 @@ void MainMenu (u32 fps)
} }
} }
VIDEO_SetPostRetraceCallback(NULL); /* clear EFB */
ClearScreen ((GXColor)BLACK);
/*** Remove any still held buttons ***/ /*** Remove any still held buttons ***/
while (PAD_ButtonsHeld(0)) PAD_ScanPads(); while (PAD_ButtonsHeld(0)) PAD_ScanPads();

View File

@ -354,7 +354,7 @@ static void gxStart(void)
} }
/* Reset GX rendering */ /* Reset GX rendering */
static void gxResetRendering(bool isMenu) static void gxResetRendering(u8 isMenu)
{ {
GX_ClearVtxDesc(); GX_ClearVtxDesc();
@ -554,18 +554,14 @@ void gxResetCamera(f32 angle)
/* Restore Menu Video mode */ /* Restore Menu Video mode */
void ogc_video__stop(void) void ogc_video__stop(void)
{ {
VIDEO_WaitVSync();
VIDEO_Configure(vmode);
VIDEO_ClearFrameBuffer(vmode, xfb[0], COLOR_BLACK);
VIDEO_ClearFrameBuffer(vmode, xfb[1], COLOR_BLACK);
VIDEO_SetPreRetraceCallback(NULL);
VIDEO_Flush();
VIDEO_WaitVSync();
VIDEO_WaitVSync();
/* reset GX */ /* reset GX */
gxResetRendering(GX_TRUE); gxResetRendering(1);
gxResetView(vmode); gxResetView(vmode);
ogc_video_caption(0xff);
VIDEO_Configure(vmode);
VIDEO_SetPreRetraceCallback(NULL);
SetScreen ();
} }
/* Update Video settings */ /* Update Video settings */
@ -576,13 +572,13 @@ void ogc_video__start(void)
else gc_pal = 0; else gc_pal = 0;
/* Video Interrupt synchronization */ /* Video Interrupt synchronization */
if (!gc_pal && !vdp_pal) VIDEO_SetPreRetraceCallback(VSyncCallback); VIDEO_SetPostRetraceCallback(NULL);
if (!gc_pal && !vdp_pal)
/* clear screen */ {
VIDEO_ClearFrameBuffer(vmode, xfb[0], COLOR_BLACK); VIDEO_SetPreRetraceCallback(VSyncCallback);
VIDEO_ClearFrameBuffer(vmode, xfb[1], COLOR_BLACK); VIDEO_Flush();
VIDEO_Flush(); VIDEO_WaitVSync();
VIDEO_WaitVSync(); }
/* interlaced/progressive mode */ /* interlaced/progressive mode */
if (config.render == 2) if (config.render == 2)
@ -623,7 +619,7 @@ void ogc_video__start(void)
bitmap.viewport.changed = 1; bitmap.viewport.changed = 1;
/* reset GX rendering */ /* reset GX rendering */
gxResetRendering(GX_FALSE); gxResetRendering(0);
} }
@ -828,7 +824,7 @@ void ogc_video__init(void)
/* Initialize GX */ /* Initialize GX */
gxStart(); gxStart();
gxResetRendering(GX_TRUE); gxResetRendering(1);
gxResetView(vmode); gxResetView(vmode);
/* Initialize Font */ /* Initialize Font */