Skip to content

Commit

Permalink
R4/GBC themes: Fix guru error when using a color mode
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketRobz committed Oct 30, 2023
1 parent 83e2755 commit 2748bdd
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions romsel_r4theme/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -996,23 +996,6 @@ void bgOperations(bool waitFrame) {
//---------------------------------------------------------------------------------
int r4Theme(void) {
//---------------------------------------------------------------------------------
graphicsInit();

if (sdFound()) {
statvfs("sd:/", &st[0]);

gbaBiosFound[0] = (access("sd:/_gba/bios.bin", F_OK) == 0);
if (!gbaBiosFound[0]) gbaBiosFound[0] = (access("sd:/gba/bios.bin", F_OK) == 0);
if (!gbaBiosFound[0]) gbaBiosFound[0] = (access("sd:/bios.bin", F_OK) == 0);
}
if (flashcardFound()) {
statvfs("fat:/", &st[1]);

gbaBiosFound[1] = (access("fat:/_gba/bios.bin", F_OK) == 0);
if (!gbaBiosFound[1]) gbaBiosFound[0] = (access("fat:/gba/bios.bin", F_OK) == 0);
if (!gbaBiosFound[1]) gbaBiosFound[0] = (access("fat:/bios.bin", F_OK) == 0);
}

// Read user name
/*char *username = (char*)PersonalData->name;
Expand All @@ -1023,20 +1006,36 @@ int r4Theme(void) {
else
username[i*2/2] = username[i*2];
}*/

LoadColor();

std::string filename;

ms().loadSettings();
bs().loadSettings();

graphicsInit();
langInit();

if (sdFound() && ms().consoleModel >= 2 && !sys().arm7SCFGLocked()) {
CIniFile lumaConfig("sd:/luma/config.ini");
widescreenFound = ((access("sd:/_nds/TWiLightMenu/TwlBg/Widescreen.cxi", F_OK) == 0) && (lumaConfig.GetInt("boot", "enable_external_firm_and_modules", 0) == true));
}

langInit();
if (sdFound()) {
statvfs("sd:/", &st[0]);

gbaBiosFound[0] = (access("sd:/_gba/bios.bin", F_OK) == 0);
if (!gbaBiosFound[0]) gbaBiosFound[0] = (access("sd:/gba/bios.bin", F_OK) == 0);
if (!gbaBiosFound[0]) gbaBiosFound[0] = (access("sd:/bios.bin", F_OK) == 0);
}
if (flashcardFound()) {
statvfs("fat:/", &st[1]);

gbaBiosFound[1] = (access("fat:/_gba/bios.bin", F_OK) == 0);
if (!gbaBiosFound[1]) gbaBiosFound[0] = (access("fat:/gba/bios.bin", F_OK) == 0);
if (!gbaBiosFound[1]) gbaBiosFound[0] = (access("fat:/bios.bin", F_OK) == 0);
}

if (ms().theme == TWLSettings::EThemeGBC) {
extern int screenBrightness;
Expand Down

0 comments on commit 2748bdd

Please sign in to comment.