From ef5565ada85de5a3e32e06c205b894d343b63e41 Mon Sep 17 00:00:00 2001 From: rw-r-r-0644 Date: Sun, 30 May 2021 20:11:26 +0200 Subject: [PATCH] cleanup previous ancast header --- stage2/ancast.c | 4 ++++ stage2/ancast.h | 1 + stage2/main.c | 4 ++++ 3 files changed, 9 insertions(+) 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;