Make loader more readable, use an array instead of a fixed location for the emuNAND test sector

This commit is contained in:
Aurora 2016-08-16 18:47:27 +02:00
parent e5dcca1c2b
commit ee3720f0b7
4 changed files with 7 additions and 3 deletions

View File

@ -23,11 +23,13 @@
#include "memory.h" #include "memory.h"
#include "cache.h" #include "cache.h"
extern u32 payloadSize; //defined in start.s
void main(void) void main(void)
{ {
void *payloadAddress = (void *)0x23F00000; void *payloadAddress = (void *)0x23F00000;
memcpy(payloadAddress, (void*)0x24F00000, *(u32 *)0x24FFFF04); memcpy(payloadAddress, (void*)0x24F00000, payloadSize);
flushCaches(); flushCaches();

View File

@ -24,4 +24,6 @@
_start: _start:
b main b main
.global payloadSize
payloadSize:
.word 0 .word 0

View File

@ -27,7 +27,7 @@
void locateEmuNAND(u32 *off, u32 *head, FirmwareSource *emuNAND) void locateEmuNAND(u32 *off, u32 *head, FirmwareSource *emuNAND)
{ {
static u8 *const temp = (u8 *)0x24300000; static u8 temp[0x200];
const u32 nandSize = getMMCDevice(0)->total_size; const u32 nandSize = getMMCDevice(0)->total_size;
u32 nandOffset = *emuNAND == FIRMWARE_EMUNAND ? 0 : u32 nandOffset = *emuNAND == FIRMWARE_EMUNAND ? 0 :