*Fixed GameSettings not being saved right

*Moved the WC24 Shutdown to networkop.cpp
This commit is contained in:
dimok321 2009-06-17 20:44:00 +00:00
parent f31c19b989
commit 0d0d54ea66
5 changed files with 29 additions and 19 deletions

View File

@ -11,7 +11,6 @@
#include <string.h> #include <string.h>
#include <stdio.h> //CLOCK #include <stdio.h> //CLOCK
#include <time.h> #include <time.h>
#include <ogc/machine/processor.h>
#include "libwiigui/gui.h" #include "libwiigui/gui.h"
#include "libwiigui/gui_gamegrid.h" #include "libwiigui/gui_gamegrid.h"
@ -27,7 +26,7 @@
#include "prompts/gameinfo.h" #include "prompts/gameinfo.h"
#include "mload/mload.h" #include "mload/mload.h"
#include "patches/patchcode.h" #include "patches/patchcode.h"
#include "network/updater.h" #include "network/networkops.h"
#include "menu.h" #include "menu.h"
#include "audio.h" #include "audio.h"
#include "input.h" #include "input.h"
@ -1871,19 +1870,7 @@ int MainMenu(int menu)
break; break;
} }
bool onlinefix = IsNetworkInit(); bool onlinefix = ShutdownWC24();
if(onlinefix && IOS_GetVersion() == ios2) {
s32 kd_fd, ret;
STACK_ALIGN(u8, kd_buf, 0x20, 32);
kd_fd = IOS_Open("/dev/net/kd/request", 0);
if (kd_fd >= 0) {
ret = IOS_Ioctl(kd_fd, 7, NULL, 0, kd_buf, 0x20);
if(ret >= 0)
onlinefix = false; // fixed no IOS reload needed
IOS_Close(kd_fd);
}
}
if(IOS_GetVersion() != ios2 || onlinefix == true) { if(IOS_GetVersion() != ios2 || onlinefix == true) {
ret = Sys_IosReload(ios2); ret = Sys_IosReload(ios2);
if(ret < 0) { if(ret < 0) {

View File

@ -8,6 +8,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <ogcsys.h> #include <ogcsys.h>
#include <ogc/machine/processor.h>
#include "prompts/PromptWindows.h" #include "prompts/PromptWindows.h"
#include "settings/cfg.h" #include "settings/cfg.h"
@ -58,6 +59,27 @@ char * GetNetworkIP(void)
return IP; return IP;
} }
/****************************************************************************
* Get network IP
***************************************************************************/
bool ShutdownWC24()
{
bool onlinefix = IsNetworkInit();
if(onlinefix) {
s32 kd_fd, ret;
STACK_ALIGN(u8, kd_buf, 0x20, 32);
kd_fd = IOS_Open("/dev/net/kd/request", 0);
if (kd_fd >= 0) {
ret = IOS_Ioctl(kd_fd, 7, NULL, 0, kd_buf, 0x20);
if(ret >= 0)
onlinefix = false; // fixed no IOS reload needed
IOS_Close(kd_fd);
}
}
return onlinefix;
}
s32 network_request(const char * request) s32 network_request(const char * request)
{ {
char buf[1024]; char buf[1024];

View File

@ -1,9 +1,10 @@
#ifndef _UPDATER_H_ #ifndef _NETWORKOPS_H_
#define _UPDATER_H_ #define _NETWORKOPS_H_
void Initialize_Network(void); void Initialize_Network(void);
bool IsNetworkInit(void); bool IsNetworkInit(void);
char * GetNetworkIP(void); char * GetNetworkIP(void);
bool ShutdownWC24();
s32 network_request(const char * request); s32 network_request(const char * request);
s32 network_read(u8 *buf, u32 len); s32 network_read(u8 *buf, u32 len);
s32 download_request(const char * url); s32 download_request(const char * url);

View File

@ -13,7 +13,7 @@
#include "language/language.h" #include "language/language.h"
#include "libwiigui/gui.h" #include "libwiigui/gui.h"
#include "libwiigui/gui_diskcover.h" #include "libwiigui/gui_diskcover.h"
#include "network/updater.h" #include "network/networkops.h"
#include "network/http.h" #include "network/http.h"
#include "mload/mload.h" #include "mload/mload.h"
#include "fatmounter.h" #include "fatmounter.h"

View File

@ -1439,7 +1439,7 @@ bool cfg_save_games()
fprintf(f, "pctrl:%d; ", cfg_game[i].parentalcontrol); fprintf(f, "pctrl:%d; ", cfg_game[i].parentalcontrol);
fprintf(f, "errorfix002:%d; ", cfg_game[i].errorfix002); fprintf(f, "errorfix002:%d; ", cfg_game[i].errorfix002);
fprintf(f, "patchcountrystrings:%d; ", cfg_game[i].patchcountrystrings); fprintf(f, "patchcountrystrings:%d; ", cfg_game[i].patchcountrystrings);
fprintf(f, "loadalternatedol:%d; ", cfg_game[i].loadalternatedol); fprintf(f, "loadalternatedol:%d;\n", cfg_game[i].loadalternatedol);
} }
fprintf(f, "# END\n"); fprintf(f, "# END\n");
fclose(f); fclose(f);