7dbded99a2
- Gotten rid of the patched FIRMs, AuReiNand now finds and loads all the FIRMs from CTRNAND by default. If you are booting an emuNAND, the FIRMs will be loaded from its CTRNAND. This also applies to AGB and TWL FIRM, and allows for a very fast boot with no firmware files on the SD card. - If for some reason (like using NTR) you do not want to use the CTRNAND FIRM, you can place a firmware.bin in the aurei folder and it will be loaded just for the default NAND. - The way AuReiNand works has changed. Now you can specify to autoboot SysNAND or not, and a NAND is no more tied to a FIRM (since 9.0 FIRM is autodetected). If you press nothing the default NAND is booted with its own FIRM, L boots the non-default NAND with its own FIRM, R boots EmuNAND with the SysNAND FIRM if you picked "Updated SysNAND", and vice-versa. - In order for AuReiNand to handle FIRM reboots, the .bin path needs to be hardcoded in the program. The default is /arm9loaderhax.bin (the AuReiNand.dat is also supported for 9.0 people). A PC tool was written to make changing the path easier. - Bug fixes and stuff I forgot. - Gelex is a saint.
67 lines
1.4 KiB
C
67 lines
1.4 KiB
C
/*
|
|
* screeninit.c
|
|
* by Aurora Wright
|
|
* Screen init code by dark_samus, bil1s, Normmatt, delebile and others.
|
|
* Screen deinit code by tiniVi.
|
|
*
|
|
* Copyright (c) 2016 All Rights Reserved
|
|
*/
|
|
|
|
#include "screeninit.h"
|
|
#include "config.h"
|
|
#include "memory.h"
|
|
#include "draw.h"
|
|
#include "i2c.h"
|
|
#include "../build/screeninit.h"
|
|
|
|
#define SCREENINIT_ADDRESS 0x24F03000
|
|
|
|
vu32 *arm11Entry = (u32 *)0x1FFFFFF8;
|
|
|
|
void deinitScreens(void)
|
|
{
|
|
void __attribute__((naked)) ARM11(void)
|
|
{
|
|
//Disable interrupts
|
|
__asm(".word 0xF10C01C0");
|
|
|
|
//Clear ARM11 entry offset
|
|
*arm11Entry = 0;
|
|
|
|
//Shutdown LCDs
|
|
*(vu32 *)0x10202A44 = 0;
|
|
*(vu32 *)0x10202244 = 0;
|
|
*(vu32 *)0x10202014 = 0;
|
|
|
|
//Wait for the entry to be set
|
|
while(!*arm11Entry);
|
|
|
|
//Jump to it
|
|
((void (*)())*arm11Entry)();
|
|
}
|
|
|
|
if(PDN_GPU_CNT != 1)
|
|
{
|
|
*arm11Entry = (u32)ARM11;
|
|
while(*arm11Entry);
|
|
}
|
|
}
|
|
|
|
void initScreens(void)
|
|
{
|
|
if(PDN_GPU_CNT == 1)
|
|
{
|
|
memcpy((void *)SCREENINIT_ADDRESS, screeninit, screeninit_size);
|
|
|
|
//Write brightness level for the stub to pick up
|
|
*(vu32 *)(SCREENINIT_ADDRESS + 8) = CONFIG(14, 3);
|
|
|
|
*arm11Entry = SCREENINIT_ADDRESS;
|
|
while(*arm11Entry);
|
|
|
|
//Turn on backlight
|
|
i2cWriteRegister(I2C_DEV_MCU, 0x22, 0x2A);
|
|
}
|
|
|
|
clearScreens();
|
|
} |