mirror of https://github.com/stella-emu/stella.git
Added ability to reset current game without reopening the same cartridge
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@360 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
2909cf001d
commit
4bd87ac26c
|
@ -4,7 +4,7 @@
|
||||||
Mark Grebe <atarimac@cox.net>
|
Mark Grebe <atarimac@cox.net>
|
||||||
|
|
||||||
*/
|
*/
|
||||||
/* $Id: Menus.h,v 1.3 2004-08-02 04:08:10 markgrebe Exp $ */
|
/* $Id: Menus.h,v 1.4 2005-02-18 05:31:47 markgrebe Exp $ */
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@
|
||||||
- (IBAction)smallerScreen:(id)sender;
|
- (IBAction)smallerScreen:(id)sender;
|
||||||
- (IBAction)fullScreen:(id)sender;
|
- (IBAction)fullScreen:(id)sender;
|
||||||
- (IBAction)openCart:(id)sender;
|
- (IBAction)openCart:(id)sender;
|
||||||
|
- (IBAction)restartGame:(id)sender;
|
||||||
- (IBAction)speedLimit:(id)sender;
|
- (IBAction)speedLimit:(id)sender;
|
||||||
- (IBAction)pauseGame:(id)sender;
|
- (IBAction)pauseGame:(id)sender;
|
||||||
- (IBAction)ntscPalMode:(id)sender;
|
- (IBAction)ntscPalMode:(id)sender;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
Mark Grebe <atarimac@cox.net>
|
Mark Grebe <atarimac@cox.net>
|
||||||
|
|
||||||
*/
|
*/
|
||||||
/* $Id: Menus.m,v 1.3 2004-08-02 04:08:10 markgrebe Exp $ */
|
/* $Id: Menus.m,v 1.4 2005-02-18 05:31:47 markgrebe Exp $ */
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
#import "Menus.h"
|
#import "Menus.h"
|
||||||
|
@ -270,6 +270,11 @@ static Menus *sharedInstance = nil;
|
||||||
[self pushKeyEvent:SDLK_o:NO];
|
[self pushKeyEvent:SDLK_o:NO];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (IBAction)restartGame:(id)sender
|
||||||
|
{
|
||||||
|
[self pushKeyEvent:SDLK_r:NO];
|
||||||
|
}
|
||||||
|
|
||||||
- (IBAction)speedLimit:(id)sender
|
- (IBAction)speedLimit:(id)sender
|
||||||
{
|
{
|
||||||
[self pushKeyEvent:SDLK_l:NO];
|
[self pushKeyEvent:SDLK_l:NO];
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
pauseGame = id;
|
pauseGame = id;
|
||||||
prefsMenu = id;
|
prefsMenu = id;
|
||||||
prefsOK = id;
|
prefsOK = id;
|
||||||
|
restartGame = id;
|
||||||
rightJoyChange = id;
|
rightJoyChange = id;
|
||||||
romdirSelect = id;
|
romdirSelect = id;
|
||||||
smallerScreen = id;
|
smallerScreen = id;
|
||||||
|
|
|
@ -13,10 +13,10 @@
|
||||||
<string>349.0</string>
|
<string>349.0</string>
|
||||||
<key>IBOpenObjects</key>
|
<key>IBOpenObjects</key>
|
||||||
<array>
|
<array>
|
||||||
<integer>578</integer>
|
|
||||||
<integer>29</integer>
|
<integer>29</integer>
|
||||||
|
<integer>578</integer>
|
||||||
</array>
|
</array>
|
||||||
<key>IBSystem Version</key>
|
<key>IBSystem Version</key>
|
||||||
<string>7H63</string>
|
<string>7U16</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
Binary file not shown.
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: mainSDL.cxx,v 1.7 2005-02-18 01:05:23 markgrebe Exp $
|
// $Id: mainSDL.cxx,v 1.8 2005-02-18 05:31:47 markgrebe Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
@ -157,7 +157,6 @@ static char *gameFile;
|
||||||
|
|
||||||
static bool fileToLoad = false;
|
static bool fileToLoad = false;
|
||||||
|
|
||||||
|
|
||||||
struct Switches
|
struct Switches
|
||||||
{
|
{
|
||||||
SDLKey scanCode;
|
SDLKey scanCode;
|
||||||
|
@ -549,6 +548,12 @@ void handleEvents()
|
||||||
theConsole->eventHandler().sendEvent(Event::Quit, 1);
|
theConsole->eventHandler().sendEvent(Event::Quit, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(key == SDLK_r) // Command-r restarts the game
|
||||||
|
{
|
||||||
|
newGame = true;
|
||||||
|
fileToLoad = true;
|
||||||
|
theConsole->eventHandler().sendEvent(Event::Quit, 1);
|
||||||
|
}
|
||||||
else if(key == SDLK_g)
|
else if(key == SDLK_g)
|
||||||
{
|
{
|
||||||
// don't change grabmouse in fullscreen mode
|
// don't change grabmouse in fullscreen mode
|
||||||
|
@ -1082,7 +1087,7 @@ int stellaMain(int argc, char* argv[])
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
// Get a pointer to the file which contains the cartridge ROM
|
// Get a pointer to the file which contains the cartridge ROM
|
||||||
char* file;
|
char* file = NULL;
|
||||||
|
|
||||||
if (fileToLoad)
|
if (fileToLoad)
|
||||||
{
|
{
|
||||||
|
@ -1092,6 +1097,8 @@ while(1) {
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
if (file != NULL)
|
||||||
|
free(file);
|
||||||
file = browseFile();
|
file = browseFile();
|
||||||
if (file == NULL)
|
if (file == NULL)
|
||||||
{
|
{
|
||||||
|
@ -1101,6 +1108,7 @@ while(1) {
|
||||||
} while (file == NULL);
|
} while (file == NULL);
|
||||||
}
|
}
|
||||||
fileToLoad = false;
|
fileToLoad = false;
|
||||||
|
gameFile = file;
|
||||||
|
|
||||||
// Open the cartridge image and read it in
|
// Open the cartridge image and read it in
|
||||||
ifstream in(file, ios_base::binary);
|
ifstream in(file, ios_base::binary);
|
||||||
|
@ -1134,7 +1142,7 @@ while(1) {
|
||||||
|
|
||||||
// Free the image since we don't need it any longer
|
// Free the image since we don't need it any longer
|
||||||
delete[] image;
|
delete[] image;
|
||||||
free(file);
|
// free(file);
|
||||||
|
|
||||||
// Setup the SDL joysticks
|
// Setup the SDL joysticks
|
||||||
// This must be done after the console is created
|
// This must be done after the console is created
|
||||||
|
|
Loading…
Reference in New Issue