mirror of
https://github.com/libretro/Play-.git
synced 2025-03-04 09:17:50 +00:00
Added button to save state on iOS.
This is for testing purposes and will be made nicer later.
This commit is contained in:
parent
8323f50317
commit
d2a5611b16
@ -58,6 +58,13 @@ CPS2VM* g_virtualMachine = nullptr;
|
||||
[self.view addSubview: self.virtualPadView];
|
||||
|
||||
[self setupFpsCounter];
|
||||
|
||||
UIButton* but = [UIButton buttonWithType: UIButtonTypeRoundedRect];
|
||||
[but setTitle: @"Save" forState: UIControlStateNormal];
|
||||
[but setBackgroundColor: [UIColor whiteColor]];
|
||||
[but addTarget: self action: @selector(onSaveStateButtonClick) forControlEvents: UIControlEventTouchUpInside];
|
||||
but.frame = CGRectMake(screenBounds.size.width - 50, (screenBounds.size.height - 25) / 2, 50, 25);
|
||||
[self.view addSubview: but];
|
||||
|
||||
g_virtualMachine->Pause();
|
||||
g_virtualMachine->Reset();
|
||||
@ -226,6 +233,14 @@ CPS2VM* g_virtualMachine = nullptr;
|
||||
[self.fpsCounterLabel sizeToFit];
|
||||
}
|
||||
|
||||
-(void)onSaveStateButtonClick
|
||||
{
|
||||
auto dataPath = Framework::PathUtils::GetPersonalDataPath();
|
||||
auto statePath = dataPath / "state.sta";
|
||||
g_virtualMachine->SaveState(statePath.c_str());
|
||||
NSLog(@"Saved state to '%s'.", statePath.string().c_str());
|
||||
}
|
||||
|
||||
-(BOOL)prefersStatusBarHidden
|
||||
{
|
||||
return YES;
|
||||
|
Loading…
x
Reference in New Issue
Block a user