Minor stuff

This commit is contained in:
Aurora 2016-10-17 18:27:48 +02:00
parent f0e111c20e
commit b63b17c54f
2 changed files with 8 additions and 5 deletions

View File

@ -37,7 +37,7 @@ void main(void)
payload; payload;
bool foundPayload = false; bool foundPayload = false;
if(f_open(&pathFile, "/luma/path.txt", FA_READ) == FR_OK) if(f_open(&pathFile, "luma/path.txt", FA_READ) == FR_OK)
{ {
u32 pathSize = f_size(&pathFile); u32 pathSize = f_size(&pathFile);
@ -74,10 +74,13 @@ void main(void)
f_read(&payload, payloadAddress, payloadSize, &read); f_read(&payload, payloadAddress, payloadSize, &read);
f_close(&payload); f_close(&payload);
flushDCacheRange(loaderAddress, loader_bin_size); if((u32)read == payloadSize)
flushICacheRange(loaderAddress, loader_bin_size); {
flushDCacheRange(loaderAddress, loader_bin_size);
flushICacheRange(loaderAddress, loader_bin_size);
((void (*)())loaderAddress)(); ((void (*)())loaderAddress)();
}
} }
} }

View File

@ -377,7 +377,7 @@ u32 patchSvcBreak9(u8 *pos, u32 size, u32 kernel9Address)
if(arm9SvcTable == NULL) ret = 1; if(arm9SvcTable == NULL) ret = 1;
else else
{ {
while(*arm9SvcTable) arm9SvcTable++; //Look for SVC0 (NULL) while(*arm9SvcTable != 0) arm9SvcTable++; //Look for SVC0 (NULL)
u32 *addr = (u32 *)(pos + arm9SvcTable[0x3C] - kernel9Address); u32 *addr = (u32 *)(pos + arm9SvcTable[0x3C] - kernel9Address);
*addr = 0xE12FFF7F; *addr = 0xE12FFF7F;