Skip to content

Commit

Permalink
Clear brightness upon loading last ran game
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketRobz committed Feb 21, 2018
1 parent 29616b7 commit 1b96648
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions titleandsettings/arm9/source/graphics/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ void vramcpy_ui (void* dest, const void* src, int size)
}
}

void ClearBrightness(void) {
fadeType = true;
screenBrightness = 0;
swiWaitForVBlank();
swiWaitForVBlank();
}

// Ported from PAlib (obsolete)
void SetBrightness(u8 screen, s8 bright) {
u16 mode = 1 << 14;
Expand Down
5 changes: 5 additions & 0 deletions titleandsettings/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@

bool fadeType = false; // false = out, true = in

extern void ClearBrightness();

const char* settingsinipath = "/_nds/srloader/settings.ini";
const char* twldrsettingsinipath = "sd:/_nds/twloader/settings.ini";
const char* bootstrapinipath = "sd:/_nds/nds-bootstrap.ini";
Expand Down Expand Up @@ -277,6 +279,9 @@ void loadROMselect() {
}

int lastRanROM() {
fadeType = false;
for (int i = 0; i < 30; i++) swiWaitForVBlank();
ClearBrightness();
int err = 0;
if(!flashcardUsed) {
if (!arm7SCFGLocked) {
Expand Down

0 comments on commit 1b96648

Please sign in to comment.