Cleanup
This commit is contained in:
parent
f155026d8f
commit
141c7817a0
@ -355,7 +355,7 @@ void configMenu(bool isSdMode, bool oldPinStatus, u32 oldPinMode)
|
|||||||
if(isMultiOption) drawString(multiOptionsText[selectedOption], true, 10, multiOptions[selectedOption].posY, COLOR_RED);
|
if(isMultiOption) drawString(multiOptionsText[selectedOption], true, 10, multiOptions[selectedOption].posY, COLOR_RED);
|
||||||
else drawString(singleOptionsText[singleSelected], true, 10, singleOptions[singleSelected].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);
|
drawString(optionsDescription[selectedOption], false, 10, 10, COLOR_WHITE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -46,7 +46,7 @@ bool loadSplash(void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
initScreens();
|
initScreens();
|
||||||
clearScreens(true, true, true);
|
clearScreens(true);
|
||||||
|
|
||||||
if(isTopSplashValid) isTopSplashValid = fileRead(fbs[1].top_left, topSplashFile, SCREEN_TOP_FBSIZE) == SCREEN_TOP_FBSIZE;
|
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;
|
if(isBottomSplashValid) isBottomSplashValid = fileRead(fbs[1].bottom, bottomSplashFile, SCREEN_BOTTOM_FBSIZE) == SCREEN_BOTTOM_FBSIZE;
|
||||||
|
@ -46,7 +46,7 @@ static char pinKeyToLetter(u32 pressed)
|
|||||||
|
|
||||||
void newPin(bool allowSkipping, u32 pinMode)
|
void newPin(bool allowSkipping, u32 pinMode)
|
||||||
{
|
{
|
||||||
clearScreens(true, true, false);
|
clearScreens(false);
|
||||||
|
|
||||||
u8 length = 4 + 2 * (pinMode - 1);
|
u8 length = 4 + 2 * (pinMode - 1);
|
||||||
|
|
||||||
|
@ -127,14 +127,10 @@ void swapFramebuffers(bool isAlternate)
|
|||||||
invokeArm11Function(ARM11);
|
invokeArm11Function(ARM11);
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearScreens(bool clearTop, bool clearBottom, bool clearAlternate)
|
void clearScreens(bool isAlternate)
|
||||||
{
|
{
|
||||||
static bool clearTopTmp,
|
|
||||||
clearBottomTmp;
|
|
||||||
static volatile struct fb *fbTmp;
|
static volatile struct fb *fbTmp;
|
||||||
clearTopTmp = clearTop;
|
fbTmp = isAlternate ? &fbs[1] : &fbs[0];
|
||||||
clearBottomTmp = clearBottom;
|
|
||||||
fbTmp = clearAlternate ? &fbs[1] : &fbs[0];
|
|
||||||
|
|
||||||
void __attribute__((naked)) ARM11(void)
|
void __attribute__((naked)) ARM11(void)
|
||||||
{
|
{
|
||||||
@ -146,29 +142,21 @@ void clearScreens(bool clearTop, bool clearBottom, bool clearAlternate)
|
|||||||
vu32 *REGs_PSC0 = (vu32 *)0x10400010,
|
vu32 *REGs_PSC0 = (vu32 *)0x10400010,
|
||||||
*REGs_PSC1 = (vu32 *)0x10400020;
|
*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[0] = (u32)fbTmp->top_left >> 3; //Start address
|
REGs_PSC0[2] = 0; //Fill value
|
||||||
REGs_PSC0[1] = (u32)(fbTmp->top_left + SCREEN_TOP_FBSIZE) >> 3; //End address
|
REGs_PSC0[3] = (2 << 8) | 1; //32-bit pattern; start
|
||||||
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[0] = (u32)fbTmp->bottom >> 3; //Start address
|
REGs_PSC1[2] = 0; //Fill value
|
||||||
REGs_PSC1[1] = (u32)(fbTmp->bottom + SCREEN_BOTTOM_FBSIZE) >> 3; //End address
|
REGs_PSC1[3] = (2 << 8) | 1; //32-bit pattern; start
|
||||||
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();
|
WAIT_FOR_ARM9();
|
||||||
}
|
}
|
||||||
|
|
||||||
flushDCacheRange(&clearTopTmp, 1);
|
|
||||||
flushDCacheRange(&clearBottomTmp, 1);
|
|
||||||
flushDCacheRange((void *)fbTmp, sizeof(struct fb));
|
flushDCacheRange((void *)fbTmp, sizeof(struct fb));
|
||||||
flushDCacheRange(&fbTmp, 4);
|
flushDCacheRange(&fbTmp, 4);
|
||||||
invokeArm11Function(ARM11);
|
invokeArm11Function(ARM11);
|
||||||
@ -305,6 +293,6 @@ void initScreens(void)
|
|||||||
needToSetup = false;
|
needToSetup = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
clearScreens(true, true, false);
|
clearScreens(false);
|
||||||
swapFramebuffers(false);
|
swapFramebuffers(false);
|
||||||
}
|
}
|
@ -53,5 +53,5 @@ extern CfgData configData;
|
|||||||
void deinitScreens(void);
|
void deinitScreens(void);
|
||||||
void swapFramebuffers(bool isAlternate);
|
void swapFramebuffers(bool isAlternate);
|
||||||
void updateBrightness(u32 brightnessIndex);
|
void updateBrightness(u32 brightnessIndex);
|
||||||
void clearScreens(bool clearTop, bool clearBottom, bool clearAlternate);
|
void clearScreens(bool isAlternate);
|
||||||
void initScreens(void);
|
void initScreens(void);
|
@ -90,7 +90,7 @@ u32 waitInput(bool isMenu)
|
|||||||
|
|
||||||
void mcuPowerOff(void)
|
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
|
//Ensure that all memory transfers have completed and that the data cache has been flushed
|
||||||
flushEntireDCache();
|
flushEntireDCache();
|
||||||
|
Reference in New Issue
Block a user