mirror of
https://github.com/AuroraWright/SafeA9LHInstaller.git
synced 2025-06-26 21:52:47 +00:00
Remove unneeded stuff
This commit is contained in:
parent
aaed6387b5
commit
03edd13633
@ -1,9 +1,3 @@
|
||||
/*
|
||||
* types.h
|
||||
* by Reisyukaku
|
||||
* Copyright (c) 2015 All Rights Reserved
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
@ -35,7 +35,7 @@ static inline void ownArm11(void)
|
||||
*(vu32 *)0x1FFAED80 = 0xE51FF004;
|
||||
*(vu32 *)0x1FFAED84 = A11_PAYLOAD_LOC;
|
||||
*(vu8 *)0x1FFFFFF0 = 2;
|
||||
while(*(vu32 *)A11_ENTRYPOINT);
|
||||
while(*(vu32 *)A11_ENTRYPOINT != 0);
|
||||
}
|
||||
|
||||
void main(void)
|
||||
|
@ -61,7 +61,7 @@ bool fileWrite(const void *buffer, const char *path, u32 size)
|
||||
f_truncate(&file);
|
||||
f_close(&file);
|
||||
|
||||
return true;
|
||||
return (u32)written == size;
|
||||
}
|
||||
|
||||
if(result == FR_NO_PATH)
|
||||
|
@ -138,11 +138,11 @@ static inline void installer(bool isA9lh, bool isOtpless)
|
||||
if(isA9lh && !isOtpless)
|
||||
{
|
||||
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(i == 4) shutdown(1, "Error: the OTP hash or the NAND key sector\nare invalid");
|
||||
if(i == 0) updateA9lh = true;
|
||||
if(i == 3) shutdown(1, "Error: the OTP hash or the NAND key sector\nare invalid");
|
||||
if(i == 1) updateA9lh = true;
|
||||
}
|
||||
|
||||
if(!isA9lh || updateA9lh || isOtpless) generateSector(keySector, (!isA9lh && isN3DS) ? 1 : 0);
|
||||
|
@ -51,13 +51,15 @@ void clearScreens(void)
|
||||
void __attribute__((naked)) ARM11(void)
|
||||
{
|
||||
//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[1] = (u32)(fb->top_left + SCREEN_TOP_FBSIZE) >> 3; //End address
|
||||
REGs_PSC0[2] = 0; //Fill value
|
||||
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[1] = (u32)(fb->bottom + SCREEN_BOTTOM_FBSIZE) >> 3; //End address
|
||||
REGs_PSC1[2] = 0; //Fill value
|
||||
@ -65,16 +67,6 @@ void clearScreens(void)
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
@ -83,7 +75,7 @@ void clearScreens(void)
|
||||
|
||||
void initScreens(void)
|
||||
{
|
||||
void __attribute__((naked)) ARM11(void)
|
||||
void __attribute__((naked)) initSequence(void)
|
||||
{
|
||||
//Disable interrupts
|
||||
__asm(".word 0xF10C01C0");
|
||||
@ -189,7 +181,7 @@ void initScreens(void)
|
||||
|
||||
if(PDN_GPU_CNT == 1)
|
||||
{
|
||||
invokeArm11Function(ARM11);
|
||||
invokeArm11Function(initSequence);
|
||||
|
||||
//Turn on backlight
|
||||
i2cWriteRegister(I2C_DEV_MCU, 0x22, 0x2A);
|
||||
|
@ -37,7 +37,7 @@ u32 waitInput(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
|
||||
flushEntireDCache();
|
||||
@ -48,14 +48,14 @@ void mcuReboot(void)
|
||||
|
||||
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);
|
||||
drawString("Press any button to shutdown", 10, posY, COLOR_WHITE);
|
||||
waitInput();
|
||||
}
|
||||
|
||||
if(PDN_GPU_CNT != 1) clearScreens();
|
||||
clearScreens();
|
||||
|
||||
//Ensure that all memory transfers have completed and that the data cache has been flushed
|
||||
flushEntireDCache();
|
||||
|
Loading…
x
Reference in New Issue
Block a user