cocoa port: uses utf8 to pass strings to the emulator core instead of ascii. the load state from file menu item was actually saving the state instead of loading. the save state to file option now pauses emulation, so you can save the state the emulator is in when you choose to save, not when you choose the file. also, cocoa port changes in the chanlog will be listed under under macos x instead of cocoa since thats probably more well understood

This commit is contained in:
gecko_reverse 2008-04-24 06:00:20 +00:00
parent a0eab94e58
commit c4526aff5c
4 changed files with 24 additions and 9 deletions

View File

@ -1,3 +1,9 @@
0.8 -> ?
Mac OS X:
- Fixed: Filenames and paths with unicode characters now work. [Jeff]
- Fixed: Load state from file button works again. [Jeff]
- Save State panel now pauses emulation while the file selection box is open. [Jeff]
0.7.3 -> 0.8
Cocoa:
- Save State As function now works. [Jeff B]

View File

@ -19,9 +19,6 @@
#import <Cocoa/Cocoa.h>
//cocoa utils
#define NSSTRc(x) ([[NSString alloc] initWithCString:(x) encoding:NSASCIIStringEncoding])
void messageDialogBlank();
void messageDialog(NSString *title, NSString *text);
BOOL messageDialogYN(NSString *title, NSString *text);

View File

@ -380,13 +380,25 @@ NSMenuItem *screenshot_to_file_item;
- (BOOL)saveStateAs
{
//pause emulation so it doesnt save the state after
BOOL was_executing = [self executing];
[self pause];
//file select
NSSavePanel *panel = [NSSavePanel savePanel];
[panel setTitle:NSLocalizedString(@"Save State...", nil)];
[panel setRequiredFileType:@"DST"];
//save it
if([panel runModal] == NSFileHandlingPanelOKButton)
{
if(was_executing == YES)[self execute];
return [self saveState:[panel filename]];
}
//unpause emulation if needed
if(was_executing == YES)[self execute];
return NO;
}
@ -399,7 +411,7 @@ NSMenuItem *screenshot_to_file_item;
[panel setAllowsMultipleSelection:NO];
if([panel runModalForTypes:[NSArray arrayWithObject:@"DST"]] == NSFileHandlingPanelOKButton)
return [self saveState:[panel filename]];
return [self loadState:[panel filename]];
return NO;
}

View File

@ -233,7 +233,7 @@ struct NDS_fw_config_data firmware;
flash = NULL;
//load the rom
if(!NDS_LoadROM([filename cStringUsingEncoding:NSASCIIStringEncoding], backupmemorytype, backupmemorysize, flash) > 0)
if(!NDS_LoadROM([filename cStringUsingEncoding:NSUTF8StringEncoding], backupmemorytype, backupmemorysize, flash) > 0)
{
//if it didn't work give an error and dont unpause
messageDialog(NSLocalizedString(@"Error", nil), @"Could not open file");
@ -369,7 +369,7 @@ struct NDS_fw_config_data firmware;
- (NSString*)ROMTitle
{
return NSSTRc(NDS_getROMHeader()->gameTile);
return [[NSString alloc] initWithCString:(NDS_getROMHeader()->gameTile) encoding:NSUTF8StringEncoding];
}
- (NSInteger)ROMMaker
@ -863,7 +863,7 @@ struct NDS_fw_config_data firmware;
[execution_lock lock];
BOOL result = NO;
if(savestate_save([file cStringUsingEncoding:NSASCIIStringEncoding]))
if(savestate_save([file cStringUsingEncoding:NSUTF8StringEncoding]))
result = YES;
[execution_lock unlock];
@ -876,7 +876,7 @@ struct NDS_fw_config_data firmware;
[execution_lock lock];
BOOL result = NO;
if(savestate_load([file cStringUsingEncoding:NSASCIIStringEncoding]))
if(savestate_load([file cStringUsingEncoding:NSUTF8StringEncoding]))
result = YES;
[execution_lock unlock];