Fixed WOZ file save

This commit is contained in:
tudnai 2020-06-25 16:33:15 -07:00
parent 34bd53d9be
commit 5374c8f035
3 changed files with 10 additions and 2 deletions

View File

@ -114,6 +114,14 @@
<ContextState <ContextState
contextName = "addr_ind_Y:Apple2_mmio.h"> contextName = "addr_ind_Y:Apple2_mmio.h">
</ContextState> </ContextState>
<ContextState
contextName = "closure #1 in AppDelegate.saveFile(_:):AppDelegate.swift">
<PersistentStrings>
<PersistentString
value = "savePanel.url?.absoluteString">
</PersistentString>
</PersistentStrings>
</ContextState>
<ContextState <ContextState
contextName = "set_flags_NZCV:common.h"> contextName = "set_flags_NZCV:common.h">
<PersistentStrings> <PersistentStrings>

View File

@ -53,7 +53,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
let savePanel = NSSavePanel() let savePanel = NSSavePanel()
savePanel.begin { (result) in savePanel.begin { (result) in
if result.rawValue == NSApplication.ModalResponse.OK.rawValue { if result.rawValue == NSApplication.ModalResponse.OK.rawValue {
woz_saveFile( savePanel.url?.absoluteString ); woz_saveFile( savePanel.url?.path );
} }
} }

View File

@ -554,7 +554,7 @@ int woz_saveFile( const char * filename ) {
return WOZ_ERR_FILE_NOT_FOUND; return WOZ_ERR_FILE_NOT_FOUND;
} }
fwrite( &woz_file_buffer, woz_file_size, 1, f ); fwrite( woz_file_buffer, woz_file_size, 1, f );
fclose(f); fclose(f);
return WOZ_ERR_OK; return WOZ_ERR_OK;