diff --git a/stage2/ancast.c b/stage2/ancast.c index a6c6387..0923499 100644 --- a/stage2/ancast.c +++ b/stage2/ancast.c @@ -23,6 +23,10 @@ #include "ancast.h" +void ancast_iop_clear(u8* buffer) +{ + memset(&buffer[0], 0, 0x200); +} u32 ancast_iop_load(u8* buffer, size_t size) { diff --git a/stage2/ancast.h b/stage2/ancast.h index 7386e84..28c5408 100644 --- a/stage2/ancast.h +++ b/stage2/ancast.h @@ -37,6 +37,7 @@ typedef struct { u32 ddr_init; } ios_header; +void ancast_iop_clear(u8* buffer); u32 ancast_iop_load(u8* buffer, size_t size); #endif diff --git a/stage2/main.c b/stage2/main.c index 787de4e..9679753 100644 --- a/stage2/main.c +++ b/stage2/main.c @@ -40,6 +40,8 @@ u32 load_payload_sd(void) FIL file; u32 vector = 0; + ancast_iop_clear((u8*)ANCAST_ADDRESS_IOP); + sdcard_init(); res = f_mount(&fatfs, "0:", 1); @@ -76,6 +78,8 @@ u32 load_payload_nand(void) int res; u32 vector = 0; + ancast_iop_clear((u8*)ANCAST_ADDRESS_IOP); + res = isfs_init(); if (res) return vector;