From edda6676ddd2522ea467a373d4e22269d0b91dfc Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Fri, 31 Aug 2012 23:57:58 +0200 Subject: [PATCH] fixed HBF on screens with PAL 50Hz --- installer/wad/0001000154484246.tmd | Bin 592 -> 592 bytes main/source/video.cpp | 49 ++++++++--------------------- updates | 1 + 3 files changed, 14 insertions(+), 36 deletions(-) diff --git a/installer/wad/0001000154484246.tmd b/installer/wad/0001000154484246.tmd index 533f080181391c1daf6dc234212929af79358c04..53980f6d2def07d10b524eb18311f2310ed286fc 100644 GIT binary patch delta 34 scmV+-0Nwx41kePq76KObpp%|@!E(b%9UPD{lzYCKu0|a)D)o7?ardgtpde`mLM#|4)Cx_BWfYe8Zmgew>qam{b55I}daK diff --git a/main/source/video.cpp b/main/source/video.cpp index 7bc1456..4e34a77 100644 --- a/main/source/video.cpp +++ b/main/source/video.cpp @@ -108,46 +108,22 @@ InitVideo () VIDEO_Init(); vmode = VIDEO_GetPreferredMode(NULL); // get default video mode - bool pal = false; + bool pal = (CONF_GetVideo() == CONF_VIDEO_PAL) && (CONF_GetEuRGB60() == 0); - if (vmode == &TVPal528IntDf) - pal = true; - - if (CONF_GetAspectRatio() == CONF_ASPECT_16_9) + if(CONF_GetAspectRatio() == CONF_ASPECT_16_9) { - vmode->fbWidth = 640; - vmode->efbHeight = 456; - vmode->viWidth = 686; - - if (pal) - { - vmode->xfbHeight = 542; - vmode->viHeight = 542; - } - else - { - vmode->xfbHeight = 456; - vmode->viHeight = 456; - } + vmode->viWidth = 708; + screenwidth = 768; } - else - { - if (pal) - vmode = &TVPal576IntDfScale; - vmode->viWidth = 672; - } - - if (pal) - { - vmode->viXOrigin = (VI_MAX_WIDTH_PAL - vmode->viWidth) / 2; - vmode->viYOrigin = (VI_MAX_HEIGHT_PAL - vmode->viHeight) / 2; - } - else - { - vmode->viXOrigin = (VI_MAX_WIDTH_NTSC - vmode->viWidth) / 2; - vmode->viYOrigin = (VI_MAX_HEIGHT_NTSC - vmode->viHeight) / 2; - } + if (pal) + { + vmode->viXOrigin = (VI_MAX_WIDTH_PAL - vmode->viWidth) / 2; + } + else + { + vmode->viXOrigin = (VI_MAX_WIDTH_NTSC - vmode->viWidth) / 2; + } // Allocate the video buffers xfb[0] = (u32 *) MEM_K0_TO_K1 (SYS_AllocateFramebuffer (vmode)); @@ -155,6 +131,7 @@ InitVideo () // A console is always useful while debugging console_init (xfb[0], 20, 64, vmode->fbWidth, vmode->xfbHeight, vmode->fbWidth * 2); + VIDEO_Configure (vmode); // Clear framebuffers etc. VIDEO_ClearFrameBuffer (vmode, xfb[0], COLOR_BLACK); diff --git a/updates b/updates index 29c8280..8a0ca38 100644 --- a/updates +++ b/updates @@ -1,5 +1,6 @@ //rev41: - fixed auto-connecting Internet via WiFi +- fixed video initialization problem at PAL 50Hz - basic support for WifiGecko * most messages are shown via WifiGecko those that are sent prior to network initialization