Skip to content

Commit

Permalink
save when entering sleep mode
Browse files Browse the repository at this point in the history
  • Loading branch information
skyfloogle committed Apr 7, 2024
1 parent 3758118 commit 3417300
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions source/3ds/gui_hard.c
Original file line number Diff line number Diff line change
Expand Up @@ -1370,6 +1370,14 @@ void toggleVsync(bool enable) {
}

void aptBacklight(APT_HookType hook, void* param) {
if (hook == APTHOOK_ONSLEEP) {
// don't save if we saved in the last 10 secs (unsure if this works)
static u64 last_sleep_time = 0;
if (osGetTime() - last_sleep_time >= 10000) {
save_sram();
last_sleep_time = osGetTime();
}
}
if (tVBOpt.VSYNC) {
switch (hook) {
case APTHOOK_ONRESTORE:
Expand Down
1 change: 1 addition & 0 deletions source/common/v810_cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ int v810_load_step() {
}

void v810_load_cancel() {
is_sram = false;
int rom_size = V810_ROM1.highaddr + 1 - V810_ROM1.lowaddr;
int all_size = rom_size + load_sram_size;
if (load_pos < rom_size) {
Expand Down

0 comments on commit 3417300

Please sign in to comment.