Prep work for A9LH screen init

This commit is contained in:
Aurora 2016-02-24 20:35:15 +01:00
parent b6b309140b
commit e53c186144
6 changed files with 14 additions and 38 deletions

View File

@ -1,4 +1,4 @@
.nds .arm.little
firm_size equ 0x000EA000 firm_size equ 0x000EA000
firm_addr equ 0x24000000 firm_addr equ 0x24000000
@ -6,17 +6,6 @@ fopen equ 0x08059D10
fread equ 0x0804CC54 fread equ 0x0804CC54
pxi_wait_recv equ 0x08054134 pxi_wait_recv equ 0x08054134
.macro svc, num
.if isArm()
.word 0xEF000000 | num
.else
.if num > 0xFF
.error "bitch you crazu"
.endif
.halfword 0xDF00 | num
.endif
.endmacro
.create "reboot1.bin", 0x080849DC .create "reboot1.bin", 0x080849DC
.org 0x080849DC .org 0x080849DC
.arm .arm
@ -48,9 +37,9 @@ patch005:
mov r3, r2 mov r3, r2
mov r1, r2 mov r1, r2
mov r0, r2 mov r0, r2
svc 0x7C swi 0x7C
ldr r0, =0x80FF4FC ldr r0, =0x80FF4FC
svc 0x7B swi 0x7B
@@inf_loop: @@inf_loop:
b @@inf_loop b @@inf_loop

View File

@ -1,4 +1,4 @@
.nds .arm.little
firm_size equ 0x000EB000 firm_size equ 0x000EB000
firm_addr equ 0x24000000 firm_addr equ 0x24000000
@ -6,17 +6,6 @@ fopen equ 0x0805B180
fread equ 0x0804D9B0 fread equ 0x0804D9B0
pxi_wait_recv equ 0x08055178 pxi_wait_recv equ 0x08055178
.macro svc, num
.if isArm()
.word 0xEF000000 | num
.else
.if num > 0xFF
.error "bitch you crazu"
.endif
.halfword 0xDF00 | num
.endif
.endmacro
.create "reboot1.bin", 0x080859C8 .create "reboot1.bin", 0x080859C8
.org 0x080859C8 .org 0x080859C8
.arm .arm
@ -48,9 +37,9 @@ patch005:
mov r3, r2 mov r3, r2
mov r1, r2 mov r1, r2
mov r0, r2 mov r0, r2
svc 0x7C swi 0x7C
ldr r0, =0x80FF4FC ldr r0, =0x80FF4FC
svc 0x7B swi 0x7B
@@inf_loop: @@inf_loop:
b @@inf_loop b @@inf_loop

View File

@ -17,6 +17,8 @@ void clearScreen(void){
} }
void loadSplash(void){ void loadSplash(void){
//Check that it's a no-LCD-init boot via PDN_GPU_CNT
if (*((u8*)0x10141200) == 0x1) return;
clearScreen(); clearScreen();
if(fileRead(fb->top_left, "/rei/splash.bin", 0x46500) != 0) return; if(fileRead(fb->top_left, "/rei/splash.bin", 0x46500) != 0) return;
unsigned i,t; for(t=220;t>0;t--){for(i=0xFFFF;i>0;i--);}; //Ghetto sleep func unsigned i,t; for(t=220;t>0;t--){for(i=0xFFFF;i>0;i--);}; //Ghetto sleep func

View File

@ -21,14 +21,14 @@ u8 mode = 1,
u16 pressed; u16 pressed;
//Load firm into FCRAM //Load firm into FCRAM
u8 loadFirm(u8 a9lhBoot){ u8 loadFirm(void){
//Detect the console being used //Detect the console being used
if(PDN_MPCORE_CFG == 1) console = 0; if(PDN_MPCORE_CFG == 1) console = 0;
//Get pressed buttons //Get pressed buttons
pressed = HID_PAD; pressed = HID_PAD;
//Determine if A9LH is installed //Determine if A9LH is installed via PDN_SPI_CNT and an user flag
if(a9lhBoot || fileExists("/rei/installeda9lh")){ if((*((u8*)0x101401C0) == 0x0) || fileExists("/rei/installeda9lh")){
a9lhSetup = 1; a9lhSetup = 1;
//Check flag for > 9.2 SysNAND //Check flag for > 9.2 SysNAND
if(fileExists("/rei/updatedsysnand")) updatedSys = 1; if(fileExists("/rei/updatedsysnand")) updatedSys = 1;

View File

@ -16,7 +16,7 @@
#define SAFEMODE (BUTTON_L1 | BUTTON_R1 | BUTTON_A | (1 << 6)) #define SAFEMODE (BUTTON_L1 | BUTTON_R1 | BUTTON_A | (1 << 6))
#define PATCHED_FIRM_PATH "/rei/patched_firmware.bin" #define PATCHED_FIRM_PATH "/rei/patched_firmware.bin"
u8 loadFirm(u8 a9lhBoot); u8 loadFirm(void);
u8 loadEmu(void); u8 loadEmu(void);
u8 patchFirm(void); u8 patchFirm(void);
void launchFirm(void); void launchFirm(void);

View File

@ -10,14 +10,10 @@
#include "firm.h" #include "firm.h"
#include "draw.h" #include "draw.h"
u8 a9lhBoot = 0;
u8 main(){ u8 main(){
mountSD(); mountSD();
//Detect an A9LH boot checking PDN_GPU_CNT register loadSplash();
if (*((u8*)0x10141200) == 0x1) a9lhBoot = 1; if (loadFirm()) return 1;
else loadSplash();
if (loadFirm(a9lhBoot)) return 1;
if (patchFirm()) return 1; if (patchFirm()) return 1;
launchFirm(); launchFirm();
return 0; return 0;