mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-11-23 19:59:16 +01:00
-reverted some of miigotus experiments to fix IOS reload
-more intelligent IOS reload code (thanks davebaol)
This commit is contained in:
parent
a8d3b2b900
commit
adecc42f5c
@ -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);
|
||||||
|
|
||||||
|
@ -44,14 +44,20 @@ 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
|
||||||
|
|
||||||
|
/* Copy disc ID (online check) */
|
||||||
|
memcpy((void *)0x80003180, (void *)0x80000000, 4);
|
||||||
|
|
||||||
|
// Patch in info missing from apploader reads
|
||||||
*Sys_Magic = 0x0d15ea5e;
|
*Sys_Magic = 0x0d15ea5e;
|
||||||
*Version = 1;
|
*Version = 1;
|
||||||
*Arena_L = 0x00000000;
|
*Arena_L = 0x00000000;
|
||||||
@ -59,12 +65,12 @@ void __Disc_SetLowMem()
|
|||||||
*Bus_Speed = 0x0E7BE2C0;
|
*Bus_Speed = 0x0E7BE2C0;
|
||||||
*CPU_Speed = 0x2B73A840;
|
*CPU_Speed = 0x2B73A840;
|
||||||
|
|
||||||
*(vu32 *)0x800030F0 = 0x0000001C; // Dol Args
|
// From NeoGamme R4 (WiiPower)
|
||||||
*(vu32 *)0x8000318C = 0x00000000; // Launch Code
|
*(vu32 *)0x800030F0 = 0x0000001C;
|
||||||
*(vu32 *)0x80003190 = 0x00000000; // Return Code
|
*(vu32 *)0x8000318C = 0x00000000;
|
||||||
|
*(vu32 *)0x80003190 = 0x00000000;
|
||||||
|
|
||||||
*(vu32 *)0x80003140 = *(vu32 *)0x80003188; // IOS Version Check
|
// Fix for Sam & Max (WiiPower)
|
||||||
*(vu32 *)0x80003180 = *(vu32 *)0x80000000; // Game ID Online Check
|
|
||||||
*(vu32 *)0x80003184 = 0x80000000;
|
*(vu32 *)0x80003184 = 0x80000000;
|
||||||
|
|
||||||
/* Flush cache */
|
/* Flush cache */
|
||||||
|
@ -257,16 +257,16 @@ s32 IOSReloadBlock(u8 reqios)
|
|||||||
}
|
}
|
||||||
|
|
||||||
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!");
|
||||||
|
Loading…
Reference in New Issue
Block a user