mirror of
https://github.com/rvtr/GodMode9i.git
synced 2025-11-02 00:11:07 -04:00
Re-init both console outputs after renaming or creating folder
This commit is contained in:
parent
35987ae0e1
commit
14cd945b16
@ -45,12 +45,13 @@
|
||||
#define OPTIONS_ENTRIES_START_ROW 2
|
||||
#define ENTRY_PAGE_LENGTH 10
|
||||
bool bigJump = false;
|
||||
extern PrintConsole topConsole, bottomConsoleBG, bottomConsole;
|
||||
extern PrintConsole topConsole, bottomConsole;
|
||||
|
||||
extern void printBorderTop(void);
|
||||
extern void printBorderBottom(void);
|
||||
extern void clearBorderTop(void);
|
||||
extern void clearBorderBottom(void);
|
||||
extern void reinitConsoles(void);
|
||||
|
||||
static char path[PATH_MAX];
|
||||
|
||||
@ -614,8 +615,7 @@ string browseForFile (void) {
|
||||
keyboardHide();
|
||||
consoleClear();
|
||||
|
||||
consoleInit(&bottomConsoleBG, 1, BgType_Text4bpp, BgSize_T_256x256, 7, 0, false, true);
|
||||
consoleInit(&bottomConsole, 0, BgType_Text4bpp, BgSize_T_256x256, 15, 0, false, true);
|
||||
reinitConsoles();
|
||||
|
||||
if (newName[0] != '\0') {
|
||||
// Check for unsupported characters
|
||||
@ -725,8 +725,7 @@ string browseForFile (void) {
|
||||
keyboardHide();
|
||||
consoleClear();
|
||||
|
||||
consoleInit(&bottomConsoleBG, 1, BgType_Text4bpp, BgSize_T_256x256, 7, 0, false, true);
|
||||
consoleInit(&bottomConsole, 0, BgType_Text4bpp, BgSize_T_256x256, 15, 0, false, true);
|
||||
reinitConsoles();
|
||||
|
||||
if (newName[0] != '\0') {
|
||||
// Check for unsupported characters
|
||||
|
||||
@ -98,6 +98,32 @@ void clearBorderBottom(void) {
|
||||
consoleClear();
|
||||
}
|
||||
|
||||
void reinitConsoles(void) {
|
||||
// Subscreen as a console
|
||||
videoSetModeSub(MODE_0_2D);
|
||||
vramSetBankH(VRAM_H_SUB_BG);
|
||||
consoleInit(&bottomConsoleBG, 1, BgType_Text4bpp, BgSize_T_256x256, 7, 0, false, true);
|
||||
consoleInit(&bottomConsole, 0, BgType_Text4bpp, BgSize_T_256x256, 15, 0, false, true);
|
||||
|
||||
// Top screen as a console
|
||||
videoSetMode(MODE_0_2D);
|
||||
vramSetBankG(VRAM_G_MAIN_BG);
|
||||
consoleInit(&topConsoleBG, 1, BgType_Text4bpp, BgSize_T_256x256, 7, 0, true, true);
|
||||
consoleInit(&topConsole, 0, BgType_Text4bpp, BgSize_T_256x256, 15, 0, true, true);
|
||||
|
||||
// Overwrite background white color
|
||||
BG_PALETTE[15+(7*16)] = 0x656A;
|
||||
BG_PALETTE_SUB[15+(7*16)] = 0x656A;
|
||||
|
||||
// Overwrite 2nd smiley face with filled tile
|
||||
for (int i = 0; i < 8*8; i++) {
|
||||
*(u8*)(0x6000040+i) = 0xFF; // Top screen
|
||||
*(u8*)(0x6200040+i) = 0xFF; // Bottom screen
|
||||
}
|
||||
|
||||
printBorderTop();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
int main(int argc, char **argv) {
|
||||
//---------------------------------------------------------------------------------
|
||||
|
||||
Loading…
Reference in New Issue
Block a user