int iec_drive_snapshot_write(struct drive_context_s *ctxptr, struct snapshot_s *s) { if (ctxptr->drive->type == DRIVE_TYPE_1541 || ctxptr->drive->type == DRIVE_TYPE_1541II || ctxptr->drive->type == DRIVE_TYPE_1570 || ctxptr->drive->type == DRIVE_TYPE_1571 || ctxptr->drive->type == DRIVE_TYPE_1571CR) { if (viacore_snapshot_write_module(ctxptr->via1d1541, s) < 0) return -1; } if (ctxptr->drive->type == DRIVE_TYPE_1570 || ctxptr->drive->type == DRIVE_TYPE_1571 || ctxptr->drive->type == DRIVE_TYPE_1571CR) { if (ciacore_snapshot_write_module(ctxptr->cia1571, s) < 0) return -1; } if (ctxptr->drive->type == DRIVE_TYPE_1581) { if (ciacore_snapshot_write_module(ctxptr->cia1581, s) < 0) return -1; } if (ctxptr->drive->type == DRIVE_TYPE_2000 || ctxptr->drive->type == DRIVE_TYPE_4000) { if (viacore_snapshot_write_module(ctxptr->via4000, s) < 0) return -1; } return 0; }
int vic20_snapshot_write(const char *name, int save_roms, int save_disks, int event_mode) { snapshot_t *s; int ieee488; s = snapshot_create(name, ((BYTE)(SNAP_MAJOR)), ((BYTE)(SNAP_MINOR)), machine_name); if (s == NULL) { return -1; } sound_snapshot_prepare(); /* FIXME: Missing sound. */ if (maincpu_snapshot_write_module(s) < 0 || vic20_snapshot_write_module(s, save_roms) < 0 || vic_snapshot_write_module(s) < 0 || viacore_snapshot_write_module(machine_context.via1, s) < 0 || viacore_snapshot_write_module(machine_context.via2, s) < 0 || drive_snapshot_write_module(s, save_disks, save_roms) < 0 || event_snapshot_write_module(s, event_mode) < 0 || tapeport_snapshot_write_module(s, save_disks) < 0 || keyboard_snapshot_write_module(s) < 0 || joyport_snapshot_write_module(s, JOYPORT_1) < 0 || userport_snapshot_write_module(s) < 0) { snapshot_close(s); ioutil_remove(name); return -1; } resources_get_int("IEEE488", &ieee488); if (ieee488) { if (viacore_snapshot_write_module(machine_context.ieeevia1, s) < 0 || viacore_snapshot_write_module(machine_context.ieeevia2, s) < 0) { snapshot_close(s); ioutil_remove(name); return 1; } } snapshot_close(s); return 0; }
int iec_drive_snapshot_write(struct drive_context_s *ctxptr, struct snapshot_s *s) { switch (ctxptr->drive->type) { case DRIVE_TYPE_1540: case DRIVE_TYPE_1541: case DRIVE_TYPE_1541II: if (viacore_snapshot_write_module(ctxptr->via1d1541, s) < 0) { return -1; } break; case DRIVE_TYPE_1570: case DRIVE_TYPE_1571: case DRIVE_TYPE_1571CR: if (viacore_snapshot_write_module(ctxptr->via1d1541, s) < 0) { return -1; } if (ciacore_snapshot_write_module(ctxptr->cia1571, s) < 0) { return -1; } break; case DRIVE_TYPE_1581: if (ciacore_snapshot_write_module(ctxptr->cia1581, s) < 0) { return -1; } if (wd1770_snapshot_write_module(ctxptr->wd1770, s) < 0) { return -1; } break; case DRIVE_TYPE_2000: case DRIVE_TYPE_4000: if (viacore_snapshot_write_module(ctxptr->via4000, s) < 0) { return -1; } break; default: break; } return 0; }
int iecieee_drive_snapshot_write(struct drive_context_s *ctxptr, struct snapshot_s *s) { if (ctxptr->drive->type == DRIVE_TYPE_1541 || ctxptr->drive->type == DRIVE_TYPE_1541II || ctxptr->drive->type == DRIVE_TYPE_1570 || ctxptr->drive->type == DRIVE_TYPE_1571 || ctxptr->drive->type == DRIVE_TYPE_1571CR || ctxptr->drive->type == DRIVE_TYPE_2031) { if (viacore_snapshot_write_module(ctxptr->via2, s) < 0) return -1; } return 0; }
int ieee_drive_snapshot_write(struct drive_context_s *ctxptr, struct snapshot_s *s) { if (ctxptr->drive->type == DRIVE_TYPE_2031) { if (viacore_snapshot_write_module(ctxptr->via1d2031, s) < 0) return -1; } if (drive_check_old(ctxptr->drive->type)) { if (riotcore_snapshot_write_module(ctxptr->riot1, s) < 0 || riotcore_snapshot_write_module(ctxptr->riot2, s) < 0 || fdc_snapshot_write_module(s, ctxptr->mynumber) < 0) return -1; } return 0; }
int pet_snapshot_write(const char *name, int save_roms, int save_disks, int event_mode) { snapshot_t *s; int ef = 0; s = snapshot_create(name, SNAP_MAJOR, SNAP_MINOR, machine_name); if (s == NULL) { return -1; } sound_snapshot_prepare(); if (maincpu_snapshot_write_module(s) < 0 || cpu6809_snapshot_write_module(s) < 0 || pet_snapshot_write_module(s, save_roms) < 0 || crtc_snapshot_write_module(s) < 0 || pia1_snapshot_write_module(s) < 0 || pia2_snapshot_write_module(s) < 0 || petdww_snapshot_write_module(s) < 0 || viacore_snapshot_write_module(machine_context.via, s) < 0 || drive_snapshot_write_module(s, save_disks, save_roms) < 0 || event_snapshot_write_module(s, event_mode) < 0 || tapeport_snapshot_write_module(s, save_disks) < 0 || keyboard_snapshot_write_module(s) < 0 || userport_snapshot_write_module(s) < 0) { ef = -1; } if ((!ef) && petres.superpet) { ef = acia1_snapshot_write_module(s); } snapshot_close(s); if (ef) { ioutil_remove(name); } return ef; }
int iecieee_drive_snapshot_write(struct drive_context_s *ctxptr, struct snapshot_s *s) { switch (ctxptr->drive->type) { case DRIVE_TYPE_1540: case DRIVE_TYPE_1541: case DRIVE_TYPE_1541II: case DRIVE_TYPE_1570: case DRIVE_TYPE_1571: case DRIVE_TYPE_1571CR: case DRIVE_TYPE_2031: if (viacore_snapshot_write_module(ctxptr->via2, s) < 0) { return -1; } break; default: break; } return 0; }