Begin turning Luma3DS into a proper firm

Unfinished work
This commit is contained in:
TuxSH
2017-05-23 02:44:04 +02:00
parent 8308e1a8b8
commit 53209b9be0
20 changed files with 717 additions and 377 deletions

View File

@@ -30,12 +30,12 @@ void launchFirm(Firm *firm, int argc, char **argv)
for(u32 sectionNum = 0; sectionNum < 4 && firm->section[sectionNum].size != 0; sectionNum++)
memcpy(firm->section[sectionNum].address, (u8 *)firm + firm->section[sectionNum].offset, firm->section[sectionNum].size);
//Set ARM11 entrypoint
*(vu32 *)0x1FFFFFFC = (u32)firm->arm11Entry;
//Ensure that all memory transfers have completed and that the caches have been flushed
flushCaches();
//Set ARM11 entrypoint
*(vu32 *)0x1FFFFFFC = (u32)firm->arm11Entry;
//Jump to ARM9 entrypoint. Also give it additional arguments it can dismiss
((void (*)(int, char**, u32))firm->arm9Entry)(argc, argv, 0x0000BEEF);