Allow empty sections at any place in FIRMs

This commit is contained in:
TuxSH 2017-05-23 22:41:12 +02:00
parent 90b54581b0
commit d6c6c421e9

View File

@ -29,7 +29,7 @@ void disableMpuAndJumpToEntrypoints(int argc, char **argv, void *arm11Entry, voi
void launchFirm(Firm *firm, int argc, char **argv) void launchFirm(Firm *firm, int argc, char **argv)
{ {
//Copy FIRM sections to respective memory locations //Copy FIRM sections to respective memory locations
for(u32 sectionNum = 0; sectionNum < 4 && firm->section[sectionNum].size != 0; sectionNum++) for(u32 sectionNum = 0; sectionNum < 4; sectionNum++)
memcpy(firm->section[sectionNum].address, (u8 *)firm + firm->section[sectionNum].offset, firm->section[sectionNum].size); memcpy(firm->section[sectionNum].address, (u8 *)firm + firm->section[sectionNum].offset, firm->section[sectionNum].size);
disableMpuAndJumpToEntrypoints(argc, argv, firm->arm9Entry, firm->arm11Entry); disableMpuAndJumpToEntrypoints(argc, argv, firm->arm9Entry, firm->arm11Entry);