Skip to content

Commit

Permalink
Disable overclock before booting game
Browse files Browse the repository at this point in the history
  • Loading branch information
metroid-maniac committed Apr 3, 2024
1 parent 99f927e commit 730a197
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SCFW_Kernel_GBA/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ char *stpcpy(char*, char*);
int strcasecmp(char*, char*);

bool overclock_ewram();
void restore_ewram_clocks();

void tryAgain() {
iprintf("Critical failure.\nPress A to restart.");
Expand Down Expand Up @@ -361,6 +362,9 @@ void selectFile(char *path) {

sc_mode(SC_RAM_RO);
REG_IME = 0;

restore_ewram_clocks();

if (settings.biosboot)
__asm volatile("swi 0x26");
else
Expand Down
4 changes: 4 additions & 0 deletions SCFW_Kernel_GBA/source/overclock_ewram.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ IWRAM_CODE bool overclock_ewram() {

REG_IME = ime;
return success;
}

IWRAM_CODE void restore_ewram_clocks() {
MEMCNT = 0x0D000020;
}

0 comments on commit 730a197

Please sign in to comment.