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
@ -87,11 +87,11 @@ s32 Apploader_Run(entry_point *entry, u8 vidMode, GXRModeObj *vmode, bool vipatc
|
|||||||
/* Set entry point from apploader */
|
/* Set entry point from apploader */
|
||||||
*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);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -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 */
|
||||||
|
@ -249,29 +249,29 @@ void vidolpatcher(void *addr, u32 len)
|
|||||||
s32 IOSReloadBlock(u8 reqios)
|
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 u32 mode[8] ATTRIBUTE_ALIGN(32);
|
|
||||||
static u32 ios[8] ATTRIBUTE_ALIGN(32);
|
|
||||||
|
|
||||||
mode[0] = 2;
|
static ioctlv vector[2] ATTRIBUTE_ALIGN(32);
|
||||||
vector[0].data = mode;
|
static u32 mode ATTRIBUTE_ALIGN(32);
|
||||||
vector[0].len = 4;
|
static u32 ios ATTRIBUTE_ALIGN(32);
|
||||||
|
|
||||||
ios[0] = reqios;
|
mode = 2;
|
||||||
vector[1].data = ios;
|
vector[0].data = &mode;
|
||||||
vector[1].len = 4;
|
vector[0].len = sizeof(u32);
|
||||||
|
|
||||||
s32 r = IOS_Ioctlv(ESHandle, 0xA0, 2, 0, vector);
|
ios = reqios;
|
||||||
gprintf("Enable/Disable Block IOS Reload for cIOS%uv%u %s\n", IOS_GetVersion(), IOS_GetRevision() % 100, r < 0 ? "FAILED!" : "SUCCEEDED!");
|
vector[1].data = &ios;
|
||||||
|
vector[1].len = sizeof(u32);
|
||||||
IOS_Close(ESHandle);
|
|
||||||
|
s32 r = IOS_Ioctlv(ESHandle, 0xA0, 2, 0, vector);
|
||||||
return r;
|
gprintf("Enable/Disable Block IOS Reload for cIOS%uv%u %s\n", IOS_GetVersion(), IOS_GetRevision() % 100, r < 0 ? "FAILED!" : "SUCCEEDED!");
|
||||||
|
|
||||||
|
IOS_Close(ESHandle);
|
||||||
|
|
||||||
|
return r;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user