diff --git a/arm9/source/file_browse.cpp b/arm9/source/file_browse.cpp index b99c06f..dc17bff 100644 --- a/arm9/source/file_browse.cpp +++ b/arm9/source/file_browse.cpp @@ -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 diff --git a/arm9/source/main.cpp b/arm9/source/main.cpp index a7e4cc2..3205c27 100644 --- a/arm9/source/main.cpp +++ b/arm9/source/main.cpp @@ -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) { //---------------------------------------------------------------------------------