From e441320b8d869b4e0b50edc4e92739910943d4bf Mon Sep 17 00:00:00 2001 From: "fix94.1" Date: Sun, 19 Aug 2012 14:06:09 +0000 Subject: [PATCH] -fixed installing gamecube games with a disc two -fixed booting wii games in neek mode (thanks skidau for finding the problem) --- source/loader/alt_ios.cpp | 11 ---------- source/loader/cios.c | 7 ------ source/loader/gc_disc_dump.cpp | 8 +++---- source/main.cpp | 39 ++++++++++++++++++++++++---------- 4 files changed, 31 insertions(+), 34 deletions(-) diff --git a/source/loader/alt_ios.cpp b/source/loader/alt_ios.cpp index 8e4a3d99..92ce2add 100644 --- a/source/loader/alt_ios.cpp +++ b/source/loader/alt_ios.cpp @@ -112,17 +112,6 @@ static void PatchAHB() bool loadIOS(int ios, bool launch_game, bool emu_channel) { #ifndef DOLPHIN - if(neek2o()) - { - memset(&CurrentIOS, 0, sizeof(IOS_Info)); - CurrentIOS.Version = 254; - CurrentIOS.Type = IOS_TYPE_D2X; - CurrentIOS.Base = 254; - CurrentIOS.Revision = 999; - DCFlushRange(&CurrentIOS, sizeof(IOS_Info)); - return true; - } - Close_Inputs(); DeviceHandler::Instance()->UnMountAll(); WDVD_Close(); diff --git a/source/loader/cios.c b/source/loader/cios.c index e3cc5bfe..4e185005 100644 --- a/source/loader/cios.c +++ b/source/loader/cios.c @@ -32,7 +32,6 @@ #include "alt_ios.h" #include "utils.h" #include "fs.h" -#include "nk.h" #include "mload.h" #include "gecko/gecko.h" #include "memory/mem2.hpp" @@ -96,12 +95,6 @@ u32 Title_GetSize_FromTMD(tmd *tmd_data) /* Check if the cIOS is a D2X. */ bool IOS_D2X(u8 ios, u8 *base) { - if(neek2o()) - { - *base = (u8)IOS_GetVersion(); - return true; - } - iosinfo_t *info = IOS_GetInfo(ios); if(!info) return false; diff --git a/source/loader/gc_disc_dump.cpp b/source/loader/gc_disc_dump.cpp index 6263e402..e6891fd1 100644 --- a/source/loader/gc_disc_dump.cpp +++ b/source/loader/gc_disc_dump.cpp @@ -415,12 +415,10 @@ s32 GCDump::DumpGame() gc_done += __DiscWrite(gamepath, 0x2440+NextOffset, ApploaderSize, ReadBuffer); } - if(!Disc) - snprintf(gamepath, sizeof(gamepath), "%s/%s [%.06s]/game.iso", fmt((strncmp(gamepartition, "sd", 2) != 0) ? usb_dml_game_dir : DML_DIR, gamepartition), gcheader.title, (char *)gcheader.id); - else + snprintf(gamepath, sizeof(gamepath), "%s/%s [%.06s]/game.iso", fmt((strncmp(gamepartition, "sd", 2) != 0) ? usb_dml_game_dir : DML_DIR, gamepartition), gcheader.title, (char *)gcheader.id); + if(Disc) { - char *ptz = (char *)NULL; - ptz = strstr(gamepath, "game.iso"); + char *ptz = strstr(gamepath, "game.iso"); if(ptz != NULL) strncpy(ptz, "gam1.iso", 8); } diff --git a/source/main.cpp b/source/main.cpp index ebb5d6a7..04c21b19 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -17,6 +17,7 @@ #include "loader/sys.h" #include "loader/wbfs.h" #include "loader/cios.h" +#include "loader/nk.h" #include "menu/menu.hpp" CMenu *mainMenu; @@ -44,32 +45,48 @@ int main(int argc, char **argv) char *gameid = NULL; bool Emulator_boot = false; + bool iosOK = false; - for (int i = 0; i < argc; i++) + for(u8 i = 0; i < argc; i++) { - if (argv[i] != NULL && strcasestr(argv[i], "ios=") != NULL && strlen(argv[i]) > 4) + if(argv[i] != NULL && strcasestr(argv[i], "ios=") != NULL && strlen(argv[i]) > 4) { - while(argv[i][0] && !isdigit(argv[i][0])) argv[i]++; + while(argv[i][0] && !isdigit(argv[i][0])) + argv[i]++; if (atoi(argv[i]) < 254 && atoi(argv[i]) > 0) mainIOS = atoi(argv[i]); } - else if (strlen(argv[i]) == 6) + else if(strlen(argv[i]) == 6) { gameid = argv[i]; - for (int i=0; i < 5; i++) - if (!isalnum(gameid[i])) + for(u8 i = 0; i < 5; i++) + { + if(!isalnum(gameid[i])) gameid = NULL; + } } - else if (argv[i] != NULL && strcasestr(argv[i], "EMULATOR_MAGIC") != NULL) + else if(argv[i] != NULL && strcasestr(argv[i], "EMULATOR_MAGIC") != NULL) Emulator_boot = true; } #ifndef DOLPHIN // Load Custom IOS - gprintf("Loading cIOS: %d\n", mainIOS); - bool iosOK = loadIOS(mainIOS, false, false); - iosOK = iosOK && CurrentIOS.Type != IOS_TYPE_NO_CIOS; + if(neek2o()) + { + iosOK = true; + memset(&CurrentIOS, 0, sizeof(IOS_Info)); + CurrentIOS.Version = 254; + CurrentIOS.Type = IOS_TYPE_D2X; + CurrentIOS.Base = 254; + CurrentIOS.Revision = 999; + DCFlushRange(&CurrentIOS, sizeof(IOS_Info)); + } + else + { + gprintf("Loading cIOS: %d\n", mainIOS); + iosOK = loadIOS(mainIOS, false, false) && CurrentIOS.Type != IOS_TYPE_NO_CIOS; + } #else - bool iosOK = true; + iosOK = true; #endif // Init