git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit 76c93254edb242ad772c8ad3835f4107a1bd531c
parent e5788437459b1518eb855cf452fca6a215d1ee87
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Sun,  9 Jun 2024 18:10:01 +0300

Disable screen dimming while emulation is running

Diffstat:
MiOS/GBViewController.m7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/iOS/GBViewController.m b/iOS/GBViewController.m @@ -730,6 +730,9 @@ static void rumbleCallback(GB_gameboy_t *gb, double amp) - (void)preRun { + dispatch_async(dispatch_get_main_queue(), ^{ + UIApplication.sharedApplication.idleTimerDisabled = true; + }); GB_set_pixels_output(&_gb, _gbView.pixels); GB_set_sample_rate(&_gb, 96000); if (![[[NSUserDefaults standardUserDefaults] stringForKey:@"GBAudioMode"] isEqual:@"off"]) { @@ -934,6 +937,10 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response [center addNotificationRequest:request withCompletionHandler:nil]; [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"GBNotificationsUsed"]; } + + dispatch_async(dispatch_get_main_queue(), ^{ + UIApplication.sharedApplication.idleTimerDisabled = false; + }); } - (void)start

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.