-reverted some of miigotus experiments to fix IOS reload

-more intelligent IOS reload code (thanks davebaol)
This commit is contained in:
fix94.1 2012-01-22 17:06:56 +00:00
parent a8d3b2b900
commit adecc42f5c
3 changed files with 43 additions and 37 deletions

View File

@ -88,9 +88,9 @@ s32 Apploader_Run(entry_point *entry, u8 vidMode, GXRModeObj *vmode, bool vipatc
*entry = appldr_final(); *entry = appldr_final();
IOSReloadBlock(IOS_GetVersion()); IOSReloadBlock(IOS_GetVersion());
*(vu32 *)0x80003140 = *(vu32 *)0x80003188; // IOS Version Check
*(vu32 *)0x80003180 = *(vu32 *)0x80000000; // Game ID Online Check /* ERROR 002 fix (WiiPower) */
*(vu32 *)0x80003184 = 0x80000000; *(u32 *)0x80003140 = *(u32 *)0x80003188;
DCFlushRange((void*)0x80000000, 0x3f00); DCFlushRange((void*)0x80000000, 0x3f00);

View File

@ -44,27 +44,33 @@ extern void __exception_closeall();
static u8 Tmd_Buffer[0x49e4 + 0x1C] ALIGNED(32); static u8 Tmd_Buffer[0x49e4 + 0x1C] ALIGNED(32);
void __Disc_SetLowMem() void __Disc_SetLowMem()
{ {
*(vu32 *)0x80000060 = 0x38A00040; // Dev Debugger Hook /* Setup low memory */
*(vu32 *)0x80000060 = 0x38A00040;
*(vu32 *)0x800000E4 = 0x80431A80; *(vu32 *)0x800000E4 = 0x80431A80;
*(vu32 *)0x800000EC = 0x81800000; // Dev Debugger Monitor Address *(vu32 *)0x800000EC = 0x81800000; // Dev Debugger Monitor Address
*(vu32 *)0x800000F0 = 0x01800000; // Simulated Memory Size *(vu32 *)0x800000F0 = 0x01800000; // Simulated Memory Size
*(vu32 *)0xCD00643C = 0x00000000; // 32Mhz on Bus *(vu32 *)0xCD00643C = 0x00000000; // 32Mhz on Bus
*Sys_Magic = 0x0d15ea5e; /* Copy disc ID (online check) */
*Version = 1; memcpy((void *)0x80003180, (void *)0x80000000, 4);
*Arena_L = 0x00000000;
*BI2 = 0x817E5480;
*Bus_Speed = 0x0E7BE2C0;
*CPU_Speed = 0x2B73A840;
*(vu32 *)0x800030F0 = 0x0000001C; // Dol Args // Patch in info missing from apploader reads
*(vu32 *)0x8000318C = 0x00000000; // Launch Code *Sys_Magic = 0x0d15ea5e;
*(vu32 *)0x80003190 = 0x00000000; // Return Code *Version = 1;
*Arena_L = 0x00000000;
*BI2 = 0x817E5480;
*Bus_Speed = 0x0E7BE2C0;
*CPU_Speed = 0x2B73A840;
*(vu32 *)0x80003140 = *(vu32 *)0x80003188; // IOS Version Check // From NeoGamme R4 (WiiPower)
*(vu32 *)0x80003180 = *(vu32 *)0x80000000; // Game ID Online Check *(vu32 *)0x800030F0 = 0x0000001C;
*(vu32 *)0x8000318C = 0x00000000;
*(vu32 *)0x80003190 = 0x00000000;
// Fix for Sam & Max (WiiPower)
*(vu32 *)0x80003184 = 0x80000000; *(vu32 *)0x80003184 = 0x80000000;
/* Flush cache */ /* Flush cache */

View File

@ -251,27 +251,27 @@ s32 IOSReloadBlock(u8 reqios)
s32 ESHandle = IOS_Open("/dev/es", 0); s32 ESHandle = IOS_Open("/dev/es", 0);
if (ESHandle < 0) if (ESHandle < 0)
{ {
gprintf("Reload IOS Block failed, cannot open /dev/es\n"); gprintf("Reload IOS Block failed, cannot open /dev/es\n");
return ESHandle; return ESHandle;
} }
static ioctlv vector[2] ATTRIBUTE_ALIGN(32); static ioctlv vector[2] ATTRIBUTE_ALIGN(32);
static u32 mode[8] ATTRIBUTE_ALIGN(32); static u32 mode ATTRIBUTE_ALIGN(32);
static u32 ios[8] ATTRIBUTE_ALIGN(32); static u32 ios ATTRIBUTE_ALIGN(32);
mode[0] = 2; mode = 2;
vector[0].data = mode; vector[0].data = &mode;
vector[0].len = 4; vector[0].len = sizeof(u32);
ios[0] = reqios; ios = reqios;
vector[1].data = ios; vector[1].data = &ios;
vector[1].len = 4; vector[1].len = sizeof(u32);
s32 r = IOS_Ioctlv(ESHandle, 0xA0, 2, 0, vector); s32 r = IOS_Ioctlv(ESHandle, 0xA0, 2, 0, vector);
gprintf("Enable/Disable Block IOS Reload for cIOS%uv%u %s\n", IOS_GetVersion(), IOS_GetRevision() % 100, r < 0 ? "FAILED!" : "SUCCEEDED!"); gprintf("Enable/Disable Block IOS Reload for cIOS%uv%u %s\n", IOS_GetVersion(), IOS_GetRevision() % 100, r < 0 ? "FAILED!" : "SUCCEEDED!");
IOS_Close(ESHandle); IOS_Close(ESHandle);
return r; return r;
} }