int ui_mdr_write( int which, int saveas ) { int err; char *filename = NULL, title[80]; fuse_emulation_pause(); snprintf( title, 80, "Fuse - Write Microdrive Cartridge %i", which + 1 ); if( saveas ) { filename = ui_get_save_filename( title ); if( !filename ) { fuse_emulation_unpause(); return 1; } } err = if1_mdr_write( which, filename ); if( saveas ) libspectrum_free( filename ); fuse_emulation_unpause(); return err; }
static void change_save_filename( HWND hwndDlg, LONG user_data ) { struct binary_info *info = ( struct binary_info * ) user_data; TCHAR *new_filename; new_filename = ui_get_save_filename( "Fuse - Save Binary Data" ); if( !new_filename ) return; free( info->filename ); info->filename = new_filename; SendDlgItemMessage( hwndDlg, IDC_BINARY_STATIC_PATH, WM_SETTEXT, 0, ( LPARAM ) new_filename ); }
int ui_tape_write( void ) { char *filename; fuse_emulation_pause(); filename = ui_get_save_filename( "Fuse - Write Tape" ); if( !filename ) { fuse_emulation_unpause(); return 1; } tape_write( filename ); libspectrum_free( filename ); fuse_emulation_unpause(); return 0; }
void menu_file_savebinarydata( int action ) { struct binary_info info; fuse_emulation_pause(); info.dialog_title = TEXT( "Fuse - Save Binary Data" ); info.filename = ui_get_save_filename( info.dialog_title ); if( !info.filename ) { fuse_emulation_unpause(); return; } info.file.length = -1; /* let the dialog know to leave length box blank */ info.on_change_filename = &change_save_filename; info.on_execute = &save_data; /* Information display */ DialogBoxParam( fuse_hInstance, MAKEINTRESOURCE( IDD_BINARY ), fuse_hWnd, binarydata_proc, ( LPARAM ) &info ); free( info.filename ); fuse_emulation_unpause(); }