git.y1.nz

SameBoy

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

commit eb38034b76e2e22596118fdf3c5829c5a6a56fe3
parent c6a968ed747950d7ed435c634bab265091b4a3fa
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Tue, 22 Jul 2025 00:10:19 +0300

Ask for confirmation before reset

Diffstat:
MiOS/GBViewController.m21+++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/iOS/GBViewController.m b/iOS/GBViewController.m @@ -978,10 +978,23 @@ static void rumbleCallback(GB_gameboy_t *gb, double amp) - (void)reset { - [self stop]; - _skipAutoLoad = true; - GB_reset(&_gb); - [self start]; + UIAlertControllerStyle style = [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad? + UIAlertControllerStyleAlert : UIAlertControllerStyleActionSheet; + UIAlertController *menu = [UIAlertController alertControllerWithTitle:@"Reset Emulation?" + message:@"Unsaved progress will be lost." + preferredStyle:style]; + [menu addAction:[UIAlertAction actionWithTitle:@"Reset" + style:UIAlertActionStyleDestructive + handler:^(UIAlertAction *action) { + [self stop]; + _skipAutoLoad = true; + GB_reset(&_gb); + [self start]; + }]]; + [menu addAction:[UIAlertAction actionWithTitle:@"Cancel" + style:UIAlertActionStyleCancel + handler:nil]]; + [self presentViewController:menu animated:true completion:nil]; } - (void)openLibrary

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