Remove unneeded stuff

This commit is contained in:
Aurora 2016-09-29 13:01:51 +02:00
parent aaed6387b5
commit 03edd13633
6 changed files with 14 additions and 28 deletions

View File

@ -1,9 +1,3 @@
/*
* types.h
* by Reisyukaku
* Copyright (c) 2015 All Rights Reserved
*/
#pragma once #pragma once
#include <stdint.h> #include <stdint.h>

View File

@ -35,7 +35,7 @@ static inline void ownArm11(void)
*(vu32 *)0x1FFAED80 = 0xE51FF004; *(vu32 *)0x1FFAED80 = 0xE51FF004;
*(vu32 *)0x1FFAED84 = A11_PAYLOAD_LOC; *(vu32 *)0x1FFAED84 = A11_PAYLOAD_LOC;
*(vu8 *)0x1FFFFFF0 = 2; *(vu8 *)0x1FFFFFF0 = 2;
while(*(vu32 *)A11_ENTRYPOINT); while(*(vu32 *)A11_ENTRYPOINT != 0);
} }
void main(void) void main(void)

View File

@ -61,7 +61,7 @@ bool fileWrite(const void *buffer, const char *path, u32 size)
f_truncate(&file); f_truncate(&file);
f_close(&file); f_close(&file);
return true; return (u32)written == size;
} }
if(result == FR_NO_PATH) if(result == FR_NO_PATH)

View File

@ -138,11 +138,11 @@ static inline void installer(bool isA9lh, bool isOtpless)
if(isA9lh && !isOtpless) if(isA9lh && !isOtpless)
{ {
u32 i; u32 i;
for(i = 0; i < 3; i++) for(i = 1; i < 3; i++)
if(memcmp(keySector + AES_BLOCK_SIZE, key2s[i], AES_BLOCK_SIZE) == 0) break; if(memcmp(keySector + AES_BLOCK_SIZE, key2s[i], AES_BLOCK_SIZE) == 0) break;
if(i == 4) shutdown(1, "Error: the OTP hash or the NAND key sector\nare invalid"); if(i == 3) shutdown(1, "Error: the OTP hash or the NAND key sector\nare invalid");
if(i == 0) updateA9lh = true; if(i == 1) updateA9lh = true;
} }
if(!isA9lh || updateA9lh || isOtpless) generateSector(keySector, (!isA9lh && isN3DS) ? 1 : 0); if(!isA9lh || updateA9lh || isOtpless) generateSector(keySector, (!isA9lh && isN3DS) ? 1 : 0);

View File

@ -51,13 +51,15 @@ void clearScreens(void)
void __attribute__((naked)) ARM11(void) void __attribute__((naked)) ARM11(void)
{ {
//Setting up two simultaneous memory fills using the GPU //Setting up two simultaneous memory fills using the GPU
vu32 *REGs_PSC0 = (vu32 *)0x10400010;
vu32 *REGs_PSC0 = (vu32 *)0x10400010,
*REGs_PSC1 = (vu32 *)0x10400020;
REGs_PSC0[0] = (u32)fb->top_left >> 3; //Start address REGs_PSC0[0] = (u32)fb->top_left >> 3; //Start address
REGs_PSC0[1] = (u32)(fb->top_left + SCREEN_TOP_FBSIZE) >> 3; //End address REGs_PSC0[1] = (u32)(fb->top_left + SCREEN_TOP_FBSIZE) >> 3; //End address
REGs_PSC0[2] = 0; //Fill value REGs_PSC0[2] = 0; //Fill value
REGs_PSC0[3] = (2 << 8) | 1; //32-bit pattern; start REGs_PSC0[3] = (2 << 8) | 1; //32-bit pattern; start
vu32 *REGs_PSC1 = (vu32 *)0x10400020;
REGs_PSC1[0] = (u32)fb->bottom >> 3; //Start address REGs_PSC1[0] = (u32)fb->bottom >> 3; //Start address
REGs_PSC1[1] = (u32)(fb->bottom + SCREEN_BOTTOM_FBSIZE) >> 3; //End address REGs_PSC1[1] = (u32)(fb->bottom + SCREEN_BOTTOM_FBSIZE) >> 3; //End address
REGs_PSC1[2] = 0; //Fill value REGs_PSC1[2] = 0; //Fill value
@ -65,16 +67,6 @@ void clearScreens(void)
while(!((REGs_PSC0[3] & 2) && (REGs_PSC1[3] & 2))); while(!((REGs_PSC0[3] & 2) && (REGs_PSC1[3] & 2)));
if(fb->top_right != fb->top_left)
{
REGs_PSC0[0] = (u32)fb->top_right >> 3; //Start address
REGs_PSC0[1] = (u32)(fb->top_right + SCREEN_TOP_FBSIZE) >> 3; //End address
REGs_PSC0[2] = 0; //Fill value
REGs_PSC0[3] = (2 << 8) | 1; //32-bit pattern; start
while(!(REGs_PSC0[3] & 2));
}
WAIT_FOR_ARM9(); WAIT_FOR_ARM9();
} }
@ -83,7 +75,7 @@ void clearScreens(void)
void initScreens(void) void initScreens(void)
{ {
void __attribute__((naked)) ARM11(void) void __attribute__((naked)) initSequence(void)
{ {
//Disable interrupts //Disable interrupts
__asm(".word 0xF10C01C0"); __asm(".word 0xF10C01C0");
@ -189,7 +181,7 @@ void initScreens(void)
if(PDN_GPU_CNT == 1) if(PDN_GPU_CNT == 1)
{ {
invokeArm11Function(ARM11); invokeArm11Function(initSequence);
//Turn on backlight //Turn on backlight
i2cWriteRegister(I2C_DEV_MCU, 0x22, 0x2A); i2cWriteRegister(I2C_DEV_MCU, 0x22, 0x2A);

View File

@ -37,7 +37,7 @@ u32 waitInput(void)
void mcuReboot(void) void mcuReboot(void)
{ {
if(PDN_GPU_CNT != 1) clearScreens(); clearScreens();
//Ensure that all memory transfers have completed and that the data cache has been flushed //Ensure that all memory transfers have completed and that the data cache has been flushed
flushEntireDCache(); flushEntireDCache();
@ -48,14 +48,14 @@ void mcuReboot(void)
void shutdown(u32 mode, const char *message) void shutdown(u32 mode, const char *message)
{ {
if(mode) if(mode != 0)
{ {
posY = drawString(message, 10, posY + SPACING_Y, mode == 1 ? COLOR_RED : COLOR_GREEN); posY = drawString(message, 10, posY + SPACING_Y, mode == 1 ? COLOR_RED : COLOR_GREEN);
drawString("Press any button to shutdown", 10, posY, COLOR_WHITE); drawString("Press any button to shutdown", 10, posY, COLOR_WHITE);
waitInput(); waitInput();
} }
if(PDN_GPU_CNT != 1) clearScreens(); clearScreens();
//Ensure that all memory transfers have completed and that the data cache has been flushed //Ensure that all memory transfers have completed and that the data cache has been flushed
flushEntireDCache(); flushEntireDCache();