From 8bd9b8aedc4f99c5c72f0a3b833609e8d0659fd3 Mon Sep 17 00:00:00 2001 From: dborth Date: Sat, 7 Jul 2012 17:46:28 +0000 Subject: [PATCH] finalize 4.3.1 --- hbc/meta.xml | 4 +-- readme.txt | 4 +++ source/input.cpp | 2 -- source/snes9xgx.cpp | 75 +++++++++++++++++++++++++-------------------- source/snes9xgx.h | 2 +- source/video.cpp | 8 ++--- update.xml | 4 +-- 7 files changed, 54 insertions(+), 45 deletions(-) diff --git a/hbc/meta.xml b/hbc/meta.xml index 9020465..72e17c5 100644 --- a/hbc/meta.xml +++ b/hbc/meta.xml @@ -2,8 +2,8 @@ Snes9x GX Tantric - 4.3.0 - 20120706 + 4.3.1 + 20120707 Super Nintendo Emulator A port of Snes9x to the Wii. diff --git a/readme.txt b/readme.txt index 08514a6..228305c 100644 --- a/readme.txt +++ b/readme.txt @@ -43,6 +43,10 @@ Wii homebrew is WiiBrew (www.wiibrew.org). | UPDATE HISTORY | •˜———–—––-- - —————————––––– ———–—––-- - —————————––––– ———–—––-- - ————————• +[4.3.1 - July 7, 2012] + +* Fixed PAL support + [4.3.0 - July 6, 2012] * Support for newer Wiimotes diff --git a/source/input.cpp b/source/input.cpp index 17ae0e6..23fe4ca 100644 --- a/source/input.cpp +++ b/source/input.cpp @@ -244,8 +244,6 @@ SetupPads() PAD_Init(); #ifdef HW_RVL - WPAD_Init(); - // read wiimote accelerometer and IR data WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR); WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight); diff --git a/source/snes9xgx.cpp b/source/snes9xgx.cpp index 83e08a8..77da56d 100644 --- a/source/snes9xgx.cpp +++ b/source/snes9xgx.cpp @@ -262,11 +262,13 @@ static mutex_t gecko_mutex = 0; static ssize_t __out_write(struct _reent *r, int fd, const char *ptr, size_t len) { - u32 level; - - if (!ptr || len <= 0 || !gecko) + if (!gecko || len == 0) + return len; + + if(!ptr || len < 0) return -1; + u32 level; LWP_MutexLock(gecko_mutex); level = IRQ_Disable(); usb_sendbuffer(1, ptr, len); @@ -298,19 +300,23 @@ const devoptab_t gecko_out = { NULL // device statvfs_r }; -void USBGeckoOutput() +static void USBGeckoOutput() { - LWP_MutexInit(&gecko_mutex, false); gecko = usb_isgeckoalive(1); - + LWP_MutexInit(&gecko_mutex, false); + devoptab_list[STD_OUT] = &gecko_out; devoptab_list[STD_ERR] = &gecko_out; } -int -main(int argc, char *argv[]) +extern "C" { + s32 __STM_Close(); + s32 __STM_Init(); +} + +int main(int argc, char *argv[]) { -#ifdef HW_RVL + #ifdef HW_RVL L2Enhance(); u32 ios = IOS_GetVersion(); @@ -322,43 +328,44 @@ main(int argc, char *argv[]) if(SupportedIOS(preferred)) IOS_ReloadIOS(preferred); } -#endif - - //USBGeckoOutput(); // uncomment to enable USB gecko output - __exception_setreload(8); - - #ifdef HW_DOL + #else ipl_set_config(6); // disable Qoob modchip #endif + + USBGeckoOutput(); + __exception_setreload(8); - #ifdef HW_RVL - StartNetworkThread(); - DI_Init(); - #endif - - InitDeviceThread(); InitGCVideo(); // Initialise video ResetVideo_Menu (); // change to menu video mode - SetupPads(); - MountAllFAT(); // Initialize libFAT for SD and USB -#ifdef HW_RVL - InitMem2Manager(); -#endif - - // Initialize DVD subsystem (GameCube only) - #ifdef HW_DOL - DVD_Init (); - #endif - + #ifdef HW_RVL // Wii Power/Reset buttons - WPAD_SetPowerButtonCallback((WPADShutdownCallback)ShutdownCB); + __STM_Close(); + __STM_Init(); + __STM_Close(); + __STM_Init(); SYS_SetPowerCallback(ShutdownCB); SYS_SetResetCallback(ResetCB); - + + WPAD_Init(); + WPAD_SetPowerButtonCallback((WPADShutdownCallback)ShutdownCB); + DI_Init(); + USBStorage_Initialize(); + StartNetworkThread(); + #else + DVD_Init (); // Initialize DVD subsystem (GameCube only) + #endif + + SetupPads(); + InitDeviceThread(); + MountAllFAT(); // Initialize libFAT for SD and USB + + #ifdef HW_RVL // store path app was loaded from if(argc > 0 && argv[0] != NULL) CreateAppPath(argv[0]); + + InitMem2Manager(); #endif DefaultSettings (); // Set defaults diff --git a/source/snes9xgx.h b/source/snes9xgx.h index 73e6412..ce7991e 100644 --- a/source/snes9xgx.h +++ b/source/snes9xgx.h @@ -20,7 +20,7 @@ #include "filelist.h" #define APPNAME "Snes9x GX" -#define APPVERSION "4.3.0" +#define APPVERSION "4.3.1" #define APPFOLDER "snes9xgx" #define PREF_FILE_NAME "settings.xml" diff --git a/source/video.cpp b/source/video.cpp index 662416b..ee4d326 100644 --- a/source/video.cpp +++ b/source/video.cpp @@ -543,10 +543,10 @@ InitGCVideo () VIDEO_Init(); // Allocate the video buffers - xfb[0] = (u32 *) memalign(32, 640*574*2); - xfb[1] = (u32 *) memalign(32, 640*574*2); - DCInvalidateRange(xfb[0], 640*574*2); - DCInvalidateRange(xfb[1], 640*574*2); + xfb[0] = (u32 *) memalign(32, 640*576*2); + xfb[1] = (u32 *) memalign(32, 640*576*2); + DCInvalidateRange(xfb[0], 640*576*2); + DCInvalidateRange(xfb[1], 640*576*2); xfb[0] = (u32 *) MEM_K0_TO_K1 (xfb[0]); xfb[1] = (u32 *) MEM_K0_TO_K1 (xfb[1]); diff --git a/update.xml b/update.xml index 3a46337..88c8b61 100644 --- a/update.xml +++ b/update.xml @@ -1,4 +1,4 @@ - - + +