2011-11-02 02:02:11 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <malloc.h>
|
|
|
|
#include <ogcsys.h>
|
2011-11-08 05:59:31 +01:00
|
|
|
#include <unistd.h>
|
2011-11-02 02:02:11 +01:00
|
|
|
|
|
|
|
#include "fat.h"
|
|
|
|
#include "restart.h"
|
|
|
|
#include "title.h"
|
|
|
|
#include "utils.h"
|
|
|
|
#include "video.h"
|
|
|
|
#include "wad.h"
|
|
|
|
#include "wpad.h"
|
2011-11-08 05:59:31 +01:00
|
|
|
#include "ahbprot.h"
|
2011-11-02 02:02:11 +01:00
|
|
|
|
|
|
|
/* Constants */
|
|
|
|
#define CIOS_VERSION 249
|
|
|
|
|
2011-11-08 05:59:31 +01:00
|
|
|
|
2011-11-02 02:02:11 +01:00
|
|
|
void LoadSelectedIOS()
|
|
|
|
{
|
|
|
|
u8 selectedIOS = Wad_SelectIOS();
|
|
|
|
s32 ret;
|
2011-11-08 05:59:31 +01:00
|
|
|
|
|
|
|
if (selectedIOS == 0) {
|
|
|
|
if (HAVE_AHBPROT) {
|
|
|
|
ret = patchSetAHBPROT();
|
|
|
|
if (ret > 0) {
|
|
|
|
ret = runtimePatchApply();
|
|
|
|
if (ret > 0) {
|
|
|
|
printf("\nUsing AHBPROT\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
printf("\nAHBPROT FAILED!\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-11-02 02:02:11 +01:00
|
|
|
ret = IOS_ReloadIOS(selectedIOS);
|
|
|
|
if (ret<0)
|
|
|
|
{
|
2011-11-08 05:59:31 +01:00
|
|
|
printf("\nUsing default IOS\n");
|
2011-11-02 02:02:11 +01:00
|
|
|
} else
|
|
|
|
{
|
|
|
|
printf("\nUsing selected IOS %d\n", selectedIOS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Menu_Loop(void)
|
|
|
|
{
|
|
|
|
Wad_InstallFromMemory();
|
|
|
|
}
|