This commit is contained in:
Aurora 2016-11-15 14:08:58 +01:00
parent f155026d8f
commit 141c7817a0
6 changed files with 17 additions and 29 deletions

View File

@ -355,7 +355,7 @@ void configMenu(bool isSdMode, bool oldPinStatus, u32 oldPinMode)
if(isMultiOption) drawString(multiOptionsText[selectedOption], true, 10, multiOptions[selectedOption].posY, COLOR_RED);
else drawString(singleOptionsText[singleSelected], true, 10, singleOptions[singleSelected].posY, COLOR_RED);
clearScreens(false, true, false);
drawString(optionsDescription[oldSelectedOption], false, 10, 10, COLOR_BLACK);
drawString(optionsDescription[selectedOption], false, 10, 10, COLOR_WHITE);
}
else

View File

@ -46,7 +46,7 @@ bool loadSplash(void)
else
{
initScreens();
clearScreens(true, true, true);
clearScreens(true);
if(isTopSplashValid) isTopSplashValid = fileRead(fbs[1].top_left, topSplashFile, SCREEN_TOP_FBSIZE) == SCREEN_TOP_FBSIZE;
if(isBottomSplashValid) isBottomSplashValid = fileRead(fbs[1].bottom, bottomSplashFile, SCREEN_BOTTOM_FBSIZE) == SCREEN_BOTTOM_FBSIZE;

View File

@ -46,7 +46,7 @@ static char pinKeyToLetter(u32 pressed)
void newPin(bool allowSkipping, u32 pinMode)
{
clearScreens(true, true, false);
clearScreens(false);
u8 length = 4 + 2 * (pinMode - 1);

View File

@ -127,14 +127,10 @@ void swapFramebuffers(bool isAlternate)
invokeArm11Function(ARM11);
}
void clearScreens(bool clearTop, bool clearBottom, bool clearAlternate)
void clearScreens(bool isAlternate)
{
static bool clearTopTmp,
clearBottomTmp;
static volatile struct fb *fbTmp;
clearTopTmp = clearTop;
clearBottomTmp = clearBottom;
fbTmp = clearAlternate ? &fbs[1] : &fbs[0];
fbTmp = isAlternate ? &fbs[1] : &fbs[0];
void __attribute__((naked)) ARM11(void)
{
@ -146,29 +142,21 @@ void clearScreens(bool clearTop, bool clearBottom, bool clearAlternate)
vu32 *REGs_PSC0 = (vu32 *)0x10400010,
*REGs_PSC1 = (vu32 *)0x10400020;
if(clearTopTmp)
{
REGs_PSC0[0] = (u32)fbTmp->top_left >> 3; //Start address
REGs_PSC0[1] = (u32)(fbTmp->top_left + SCREEN_TOP_FBSIZE) >> 3; //End address
REGs_PSC0[2] = 0; //Fill value
REGs_PSC0[3] = (2 << 8) | 1; //32-bit pattern; start
}
REGs_PSC0[0] = (u32)fbTmp->top_left >> 3; //Start address
REGs_PSC0[1] = (u32)(fbTmp->top_left + SCREEN_TOP_FBSIZE) >> 3; //End address
REGs_PSC0[2] = 0; //Fill value
REGs_PSC0[3] = (2 << 8) | 1; //32-bit pattern; start
if(clearBottomTmp)
{
REGs_PSC1[0] = (u32)fbTmp->bottom >> 3; //Start address
REGs_PSC1[1] = (u32)(fbTmp->bottom + SCREEN_BOTTOM_FBSIZE) >> 3; //End address
REGs_PSC1[2] = 0; //Fill value
REGs_PSC1[3] = (2 << 8) | 1; //32-bit pattern; start
}
REGs_PSC1[0] = (u32)fbTmp->bottom >> 3; //Start address
REGs_PSC1[1] = (u32)(fbTmp->bottom + SCREEN_BOTTOM_FBSIZE) >> 3; //End address
REGs_PSC1[2] = 0; //Fill value
REGs_PSC1[3] = (2 << 8) | 1; //32-bit pattern; start
while(!((!clearTopTmp || (REGs_PSC0[3] & 2)) && (!clearBottomTmp || (REGs_PSC1[3] & 2))));
while(!((REGs_PSC0[3] & 2) && (REGs_PSC1[3] & 2)));
WAIT_FOR_ARM9();
}
flushDCacheRange(&clearTopTmp, 1);
flushDCacheRange(&clearBottomTmp, 1);
flushDCacheRange((void *)fbTmp, sizeof(struct fb));
flushDCacheRange(&fbTmp, 4);
invokeArm11Function(ARM11);
@ -305,6 +293,6 @@ void initScreens(void)
needToSetup = false;
}
clearScreens(true, true, false);
clearScreens(false);
swapFramebuffers(false);
}

View File

@ -53,5 +53,5 @@ extern CfgData configData;
void deinitScreens(void);
void swapFramebuffers(bool isAlternate);
void updateBrightness(u32 brightnessIndex);
void clearScreens(bool clearTop, bool clearBottom, bool clearAlternate);
void clearScreens(bool isAlternate);
void initScreens(void);

View File

@ -90,7 +90,7 @@ u32 waitInput(bool isMenu)
void mcuPowerOff(void)
{
if(!ISFIRMLAUNCH && ARESCREENSINITED) clearScreens(true, true, false);
if(!ISFIRMLAUNCH && ARESCREENSINITED) clearScreens(false);
//Ensure that all memory transfers have completed and that the data cache has been flushed
flushEntireDCache();