コード例 #1
0
ファイル: uifliplist.c プロジェクト: martinpiper/VICE
static UI_CALLBACK(load_save_fliplist)
{
    char *filename, *title;
    int what = (int)UI_MENU_CB_PARAM;
    ui_button_t button;

    vsync_suspend_speed_eval();
    title = util_concat(what ? _("Load ") : _("Save"), _("Fliplist File"),
                        NULL);
    filename = ui_select_file(title, NULL, 0, 0,
                              load_save_fliplist_last_dir, "*.vfl",
                              &button, 1, NULL);
    lib_free(title);
    switch (button) {
      case UI_BUTTON_OK:
        if (what) {
            if (fliplist_load_list((unsigned int)-1, filename, 0) == 0)
                ui_message(_("Successfully read `%s'."), filename);
            else
                ui_error(_("Error reading `%s'."), filename);
        } else {
            if (fliplist_save_list((unsigned int)-1, filename) == 0)
                ui_message(_("Successfully wrote `%s'."), filename);
            else
                ui_error(_("Error writing `%s'."), filename);
        }
        if (load_save_fliplist_last_dir)
            lib_free(load_save_fliplist_last_dir);
        util_fname_split(filename, &load_save_fliplist_last_dir, NULL);
        break;
      default:
        break;
    }

}
コード例 #2
0
ファイル: uifliplist.c プロジェクト: carriercomm/VICE-Core
static UI_CALLBACK(load_save_fliplist)
{
    char *filename, *title;
    int what = vice_ptr_to_int(UI_MENU_CB_PARAM);
    ui_button_t button;
    uilib_file_filter_enum_t filter[] = { UILIB_FILTER_FLIPLIST, UILIB_FILTER_ALL };

    vsync_suspend_speed_eval();
    title = util_concat(what ? _("Load ") : _("Save"), _("Flip list file"), NULL);
    filename = ui_select_file(title, NULL, 0, load_save_fliplist_last_dir, filter, sizeof(filter) / sizeof(*filter), &button, 1, NULL, what ? UI_FC_LOAD : UI_FC_SAVE);
    lib_free(title);
    switch (button) {
        case UI_BUTTON_OK:
            if (what) {
                if (fliplist_load_list(FLIPLIST_ALL_UNITS, filename, 0) == 0) {
                    ui_message(_("Successfully read `%s'."), filename);
                } else {
                    ui_error(_("Error reading `%s'."), filename);
                }
            } else {
                if (fliplist_save_list(FLIPLIST_ALL_UNITS, filename) == 0) {
                    ui_message(_("Successfully wrote `%s'"), filename);
                } else {
                    ui_error(_("Error writing `%s'."), filename);
                }
            }
            lib_free(load_save_fliplist_last_dir);
            util_fname_split(filename, &load_save_fliplist_last_dir, NULL);
            break;
        default:
            break;
    }
}
コード例 #3
0
ファイル: fliplist.c プロジェクト: bobsummerwill/VICE
static int set_fliplist_file_name(const char *val, void *param)
{
    if (util_string_set(&fliplist_file_name, val))
        return 0;

    fliplist_load_list((unsigned int)-1, fliplist_file_name, 0);

    return 0;
}
コード例 #4
0
static int set_fliplist_file_name(const char *val, void *param)
{
    if (util_string_set(&fliplist_file_name, val)) {
        return 0;
    }

    fliplist_load_list(FLIPLIST_ALL_UNITS, fliplist_file_name, 0);

    return 0;
}
コード例 #5
0
ファイル: uifliplist.c プロジェクト: OpenEmu/VICE-Core
static void fliplist_load_response(GtkWidget *widget, gint response_id, gpointer user_data)
{
    int unit = GPOINTER_TO_INT(user_data);
    gchar *filename;
    filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(widget));
    if (response_id == GTK_RESPONSE_ACCEPT) {
        /* TODO: read autoattach out of an extra widget. */
        /* TODO: Autoattach looks slightly buggy in fliplist.c */
        fliplist_load_list(unit, filename, 0);
    }
    gtk_widget_destroy(widget);
}
コード例 #6
0
ファイル: dlg-fileio.c プロジェクト: bobsummerwill/VICE
static BOOL FdmDoLoadAction(HWND hwnd, const char *szpath, int act, int sact)
{
    switch (act) {
        case 0:
            return file_system_attach_disk(sact + 8, szpath);
        case 1:
            return tape_image_attach(1, szpath);
        case 2:
            return fliplist_load_list(sact + 8, szpath, FALSE);
        case 3:
            return fliplist_load_list(sact + 8, szpath, TRUE);
        case 4:
            return trap(hwnd, load_snapshot, szpath);
        case 5:
            switch (sact) {
                case 0:
                    return resources_set_string(VIDEO_PALETTE, szpath);
#ifdef __X128__
                case 1:
                    return resources_set_string("VDC_PaletteFile", szpath);
#endif
#ifdef __XCBM__
                case 1:
                    return resources_set_string("ViciiPaletteFile", szpath);
#endif
            }
            return -1;
        case 6: // rom img
            return resources_set_string("KeymapFile", szpath);
        case 7:
            switch (sact) {
                case 0:
                    return resources_set_string("KernalName", szpath);
                case 1:
                    return resources_set_string("ChargenName", szpath);
                case 2:
                    return resources_set_string("DosName1541", szpath);
                case 3:
                    return resources_set_string("DosName154ii", szpath);
                case 4:
                    return resources_set_string("DosName1571", szpath);
                case 5:
                    return resources_set_string("DosName1581", szpath);
                case 6:
                    return resources_set_string("DosName2031", szpath);
                case 7:
                    return resources_set_string("DosName1001", szpath);
                case 8:
                    return resources_set_string("DosName2040", szpath);
                case 9:
                    return resources_set_string("DosName3040", szpath);
                case 10:
                    return resources_set_string("DosName4040", szpath);
                case 11:
                    return resources_set_string("BasicName", szpath);
                case 12:
                    return resources_set_string("Z80BiosName", szpath);
                case 13:
                    return resources_set_string("Kernal64Name", szpath);
                case 14:
                    return resources_set_string("Basic64Name", szpath);
                case 15:
                    return resources_set_string("Chargen64Name", szpath);
                case 16:
                    return resources_set_string("ChargenIntName", szpath);
                case 17:
                    return resources_set_string("ChargenDEName", szpath);
                case 18:
                    return resources_set_string("ChargenFRName", szpath);
                case 19:
                    return resources_set_string("ChargenSEName", szpath);
                case 20:
                    return resources_set_string("KernalIntName", szpath);
                case 21:
                    return resources_set_string("KernalDEName", szpath);
                case 22:
                    return resources_set_string("KernalFIName", szpath);
                case 23:
                    return resources_set_string("KernalFRName", szpath);
                case 24:
                    return resources_set_string("KernalITName", szpath);
                case 25:
                    return resources_set_string("KernalNOName", szpath);
                case 26:
                    return resources_set_string("KernalSEName", szpath);
                case 27:
                    return resources_set_string("BasicHiName", szpath);
                case 28:
                    return resources_set_string("BasicLoName", szpath);
            }
            return -1;
        case 8:
            return machine_romset_file_load(szpath);
        case 9:
            return resources_load(szpath);
#if defined __X64__ || defined __X128__
        case 10:
            switch (sact) {
                case 0:
                    return cartridge_attach_image(CARTRIDGE_CRT, szpath);
                case 1:
                    return cartridge_attach_image(CARTRIDGE_GENERIC_8KB, szpath);
                case 2:
                    return cartridge_attach_image(CARTRIDGE_GENERIC_16KB, szpath);
                case 3:
                    return cartridge_attach_image(CARTRIDGE_ACTION_REPLAY, szpath);
                case 4:
                    return cartridge_attach_image(CARTRIDGE_ATOMIC_POWER, szpath);
                case 5:
                    return cartridge_attach_image(CARTRIDGE_EPYX_FASTLOAD, szpath);
                case 6:
                    return cartridge_attach_image(CARTRIDGE_SUPER_SNAPSHOT, szpath);
                case 7:
                    return cartridge_attach_image(CARTRIDGE_SUPER_SNAPSHOT_V5, szpath);
                case 8:
                    return cartridge_attach_image(CARTRIDGE_WESTERMANN, szpath);
                case 9:
                    return cartridge_attach_image(CARTRIDGE_IEEE488, szpath);
                case 10:
                    return cartridge_attach_image(CARTRIDGE_IDE64, szpath);
            }
            return -1;
#endif
#ifdef __XPET__
        case 10:
            switch (sact) {
                case 0:
                    return resources_set_string("RomModule9Name", szpath);
                case 1:
                    return resources_set_string("RomModuleAName", szpath);
                case 2:
                    return resources_set_string("RomModuleBName", szpath);
            }
            return -1;
#endif
#ifdef __XCBM__
        case 10:
            switch (sact) {
                case 0:
                    return resources_set_string("Cart1Name", szpath);
                case 1:
                    return resources_set_string("Cart2Name", szpath);
                case 2:
                    return resources_set_string("Cart4Name", szpath);
                case 3:
                    return resources_set_string("Cart6Name", szpath);
            }
            return -1;
#endif
#ifdef __X128__
        case 11:
            switch (sact) {
                case 0:
                    return resources_set_string("InternalFunctionName", szpath);
                case 1:
                    return resources_set_string("ExternalFunctionName", szpath);
            }
            return -1;
#endif
    }
    return -1;
}