From 4613223510fc29d4dadb3fd117f2e954811a920a Mon Sep 17 00:00:00 2001 From: ekeeke31 Date: Fri, 12 Dec 2008 14:21:23 +0000 Subject: [PATCH] Widescreen Menu fix, fixed frame counter --- history.txt | 3 ++- source/ngc/config.c | 4 ++-- source/ngc/gui/menu.c | 4 ++++ source/ngc/ngc.c | 7 +++---- source/ngc/ogc_video.c | 19 +++++++++++++++---- 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/history.txt b/history.txt index 4f9a2bc..03a57b0 100644 --- a/history.txt +++ b/history.txt @@ -26,7 +26,7 @@ Genesis Plus for Gamecube - removed embedded font, (re)enabled IPL font support: now should works for Qoob users too (thanks to emukiddid) - fixed "Reset" button behavior, now acts more like Genesis Reset button ;-) - patched libfat for faster SDCARD accesses (thanks to svpe) -- SRAM and SaveState files are now based on the ROM filename +- SRAM and SaveState filenames are now based on the ROM filename (for FAT devices only) - various bugfixes, menu tweaks and code cleanup [NGC only] @@ -36,6 +36,7 @@ Genesis Plus for Gamecube - implemented fast scrolling in menu using Wiimote D-PAD - added "Power" button support - added USB Storage support +- Widescreen menu fix - *new* libogc 1.7.0 features: SDHC support, Wiimote shutdown button support diff --git a/source/ngc/config.c b/source/ngc/config.c index c2e2368..020431d 100644 --- a/source/ngc/config.c +++ b/source/ngc/config.c @@ -25,9 +25,9 @@ #include #ifdef HW_RVL -#define CONFIG_VERSION "GENPLUS 1.2.3W" +#define CONFIG_VERSION "GENPLUS 1.3.0W" #else -#define CONFIG_VERSION "GENPLUS 1.2.3G" +#define CONFIG_VERSION "GENPLUS 1.3.0G" #endif void config_save() diff --git a/source/ngc/gui/menu.c b/source/ngc/gui/menu.c index 28036bd..f80727c 100644 --- a/source/ngc/gui/menu.c +++ b/source/ngc/gui/menu.c @@ -1216,6 +1216,10 @@ void MainMenu () #endif /*** Reinitialize GX ***/ + VIDEO_ClearFrameBuffer(vmode, xfb[whichfb], COLOR_BLACK); + VIDEO_Flush(); + VIDEO_WaitVSync(); + VIDEO_WaitVSync(); ogc_video__reset(); odd_frame = 1; diff --git a/source/ngc/ngc.c b/source/ngc/ngc.c index b737aea..23a47a1 100644 --- a/source/ngc/ngc.c +++ b/source/ngc/ngc.c @@ -212,7 +212,7 @@ int main (int argc, char *argv[]) { /* Delay */ while (diff_usec(prev, now) < usBetweenFrames) now = gettime(); - + /* Render Frame */ prev = now; system_frame(0); @@ -232,11 +232,11 @@ int main (int argc, char *argv[]) { /* Delay */ while (!frameticker) usleep(10); - + system_frame (0); RenderedFrameCount++; } - + frameticker--; } @@ -264,7 +264,6 @@ int main (int argc, char *argv[]) ConfigRequested = 0; /* reset frame timings */ - frameticker = 0; prev = gettime(); FrameCount = 0; RenderedFrameCount = 0; diff --git a/source/ngc/ogc_video.c b/source/ngc/ogc_video.c index c706491..7bdd07b 100644 --- a/source/ngc/ogc_video.c +++ b/source/ngc/ogc_video.c @@ -532,12 +532,14 @@ void ogc_video__reset() /* Configure VI */ VIDEO_Configure (rmode); - VIDEO_ClearFrameBuffer(rmode, xfb[whichfb], COLOR_BLACK); VIDEO_Flush(); VIDEO_WaitVSync(); if (rmode->viTVMode & VI_NON_INTERLACE) VIDEO_WaitVSync(); else while (VIDEO_GetNextField()) VIDEO_WaitVSync(); + /* reset frame counter */ + frameticker = 0; + /* Configure GX */ GX_SetViewport (0.0F, 0.0F, rmode->fbWidth, rmode->efbHeight, 0.0F, 1.0F); GX_SetScissor (0, 0, rmode->fbWidth, rmode->efbHeight); @@ -582,7 +584,7 @@ void ogc_video__update() if (bitmap.viewport.changed) { bitmap.viewport.changed = 0; - + /* update texture size */ vwidth = bitmap.viewport.w + 2 * bitmap.viewport.x; vheight = bitmap.viewport.h + 2 * bitmap.viewport.y; @@ -696,7 +698,16 @@ void ogc_video__init(void) config.tv_mode = 2; break; } - + +#ifdef HW_RVL + /* Widescreen fix */ + if( CONF_GetAspectRatio() ) + { + vmode->viWidth = 678; + vmode->viXOrigin = (VI_MAX_WIDTH_NTSC - 678)/2; + } +#endif + /* Configure video mode */ VIDEO_Configure (vmode); @@ -719,7 +730,7 @@ void ogc_video__init(void) /* Enable Video Interface */ VIDEO_SetBlack (FALSE); - + /* Update video settings for next VBlank */ VIDEO_Flush ();