From 6c5f6ac475931579f4f5432af963388b5603a8ee Mon Sep 17 00:00:00 2001 From: TuxSH Date: Tue, 24 Jan 2017 21:59:02 +0100 Subject: [PATCH] Attempt to fix the boot issue --- source/screen.c | 10 +++++----- source/screen.h | 6 +++--- source/utils.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/source/screen.c b/source/screen.c index fabf59be..391e4493 100644 --- a/source/screen.c +++ b/source/screen.c @@ -49,17 +49,17 @@ void __attribute__((naked)) arm11Stub(void) { //Disable interrupts __asm(".word 0xF10C01C0"); - + WAIT_FOR_ARM9(); } - + static void invokeArm11Function(void (*func)()) { static bool hasCopiedStub = false; if(!hasCopiedStub) { - memcpy((void *)ARM11_STUB_ADDRESS, arm11Stub, 0x30); + memcpy((void *)ARM11_STUB_ADDRESS, arm11Stub, 0x2C); hasCopiedStub = true; } @@ -83,7 +83,7 @@ void deinitScreens(void) WAIT_FOR_ARM9(); } - if(ARESCREENSINITED) invokeArm11Function(ARM11); + if(ARESCREENSINITIALIZED) invokeArm11Function(ARM11); } void updateBrightness(u32 brightnessIndex) @@ -277,7 +277,7 @@ void initScreens(void) if(needToSetup) { - if(!ARESCREENSINITED) + if(!ARESCREENSINITIALIZED) { flushDCacheRange(&configData, sizeof(CfgData)); invokeArm11Function(initSequence); diff --git a/source/screen.h b/source/screen.h index 22ccce28..d7f6a5fa 100644 --- a/source/screen.h +++ b/source/screen.h @@ -31,9 +31,9 @@ #define PDN_GPU_CNT (*(vu8 *)0x10141200) -#define ARESCREENSINITED (PDN_GPU_CNT != 1) +#define ARESCREENSINITIALIZED (PDN_GPU_CNT != 1) -#define ARM11_STUB_ADDRESS 0x1FFFFFC8 +#define ARM11_STUB_ADDRESS 0x1FFFFC00 #define WAIT_FOR_ARM9() *arm11Entry = 0; while(!*arm11Entry); ((void (*)())*arm11Entry)(); #define SCREEN_TOP_WIDTH 400 @@ -54,4 +54,4 @@ void deinitScreens(void); void swapFramebuffers(bool isAlternate); void updateBrightness(u32 brightnessIndex); void clearScreens(bool isAlternate); -void initScreens(void); \ No newline at end of file +void initScreens(void); diff --git a/source/utils.c b/source/utils.c index 466295c5..24afc2ae 100644 --- a/source/utils.c +++ b/source/utils.c @@ -89,7 +89,7 @@ u32 waitInput(bool isMenu) void mcuPowerOff(void) { - if(!ISFIRMLAUNCH && ARESCREENSINITED) clearScreens(false); + if(!ISFIRMLAUNCH && ARESCREENSINITIALIZED) clearScreens(false); //Ensure that all memory transfers have completed and that the data cache has been flushed flushEntireDCache(); @@ -118,4 +118,4 @@ void error(const char *message) } mcuPowerOff(); -} \ No newline at end of file +}