src/mess/devices/snapquik.h
| r2402 | r2403 | |
| 22 | 22 | MESS_DEVINFO_FLOAT_QUICKLOAD_DELAY = MESS_DEVINFO_FLOAT_DEV_SPECIFIC |
| 23 | 23 | }; |
| 24 | 24 | |
| 25 | | typedef int (*snapquick_loadproc)(running_machine *machine, const device_config *image, const char *file_type, int file_size); |
| 25 | typedef int (*snapquick_load_func)(const device_config *device, const char *file_type, int file_size); |
| 26 | 26 | |
| 27 | | #define SNAPSHOT_LOAD(name) int snapshot_load_##name(running_machine *machine, const device_config *image, const char *file_type, int snapshot_size) |
| 28 | | #define QUICKLOAD_LOAD(name) int quickload_load_##name(running_machine *machine, const device_config *image, const char *file_type, int quickload_size) |
| 27 | #define SNAPSHOT_LOAD(name) int snapshot_load_##name(const device_config *image, const char *file_type, int snapshot_size) |
| 28 | #define QUICKLOAD_LOAD(name) int quickload_load_##name(const device_config *image, const char *file_type, int quickload_size) |
| 29 | 29 | |
| 30 | 30 | void snapshot_device_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info); |
| 31 | 31 | void quickload_device_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info); |
src/mess/devices/z80bin.c
| r2402 | r2403 | |
| 17 | 17 | #include "snapquik.h" |
| 18 | 18 | |
| 19 | 19 | |
| 20 | | int z80bin_load_file( running_machine *machine, const device_config *image, const char *file_type, UINT16 *exec_addr, UINT16 *start_addr, UINT16 *end_addr ) |
| 20 | int z80bin_load_file(const device_config *image, const char *file_type, UINT16 *exec_addr, UINT16 *start_addr, UINT16 *end_addr ) |
| 21 | 21 | { |
| 22 | 22 | int ch; |
| 23 | 23 | UINT16 args[3]; |
| r2402 | r2403 | |
| 83 | 83 | { |
| 84 | 84 | UINT16 exec_addr, start_addr, end_addr; |
| 85 | 85 | |
| 86 | | if (z80bin_load_file( machine, image, file_type, &exec_addr, &start_addr, &end_addr ) == INIT_FAIL) |
| 86 | if (z80bin_load_file( image, file_type, &exec_addr, &start_addr, &end_addr ) == INIT_FAIL) |
| 87 | 87 | return INIT_FAIL; |
| 88 | 88 | |
| 89 | 89 | if (exec_addr == 0xffff) return INIT_PASS; /* non-executable data file */ |
src/mess/devices/z80bin.h
| r2402 | r2403 | |
| 16 | 16 | |
| 17 | 17 | void z80bin_quickload_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info); |
| 18 | 18 | |
| 19 | | int z80bin_load_file( running_machine *machine, const device_config *image, const char *file_type, UINT16 *exec_addr, UINT16 *start_addr, UINT16 *end_addr ); |
| 19 | int z80bin_load_file(const device_config *image, const char *file_type, UINT16 *exec_addr, UINT16 *start_addr, UINT16 *end_addr ); |
| 20 | 20 | |
| 21 | 21 | |
| 22 | 22 | #endif /* Z80BIN_H */ |
src/mess/devices/snapquik.c
| r2402 | r2403 | |
| 26 | 26 | static TIMER_CALLBACK(snapquick_processsnapshot) |
| 27 | 27 | { |
| 28 | 28 | struct snapquick_info *si = (struct snapquick_info *) ptr; |
| 29 | | snapquick_loadproc loadproc; |
| 29 | snapquick_load_func loadproc; |
| 30 | 30 | const char *file_type; |
| 31 | 31 | const struct IODevice *dev; |
| 32 | 32 | |
| 33 | 33 | dev = mess_device_from_core_device(si->img); |
| 34 | | loadproc = (snapquick_loadproc) mess_device_get_info_fct(&dev->devclass, MESS_DEVINFO_PTR_SNAPSHOT_LOAD); |
| 34 | loadproc = (snapquick_load_func) mess_device_get_info_fct(&dev->devclass, MESS_DEVINFO_PTR_SNAPSHOT_LOAD); |
| 35 | 35 | file_type = image_filetype(si->img); |
| 36 | | loadproc(machine, si->img, file_type, si->file_size); |
| 36 | loadproc(si->img, file_type, si->file_size); |
| 37 | 37 | image_unload(si->img); |
| 38 | 38 | } |
| 39 | 39 | |
src/mess/machine/spectrum.c
| r2402 | r2403 | |
| 109 | 109 | logerror("Invalid .SNA file size.\n"); |
| 110 | 110 | goto error; |
| 111 | 111 | } |
| 112 | | spectrum_setup_sna(machine, snapshot_data, snapshot_size); |
| 112 | spectrum_setup_sna(image->machine, snapshot_data, snapshot_size); |
| 113 | 113 | } |
| 114 | 114 | else if (!mame_stricmp(file_type, "sp")) |
| 115 | 115 | { |
| r2402 | r2403 | |
| 118 | 118 | logerror("Invalid .SP signature.\n"); |
| 119 | 119 | goto error; |
| 120 | 120 | } |
| 121 | | spectrum_setup_sp(machine, snapshot_data, snapshot_size); |
| 121 | spectrum_setup_sp(image->machine, snapshot_data, snapshot_size); |
| 122 | 122 | } |
| 123 | 123 | else |
| 124 | 124 | { |
| 125 | | spectrum_setup_z80(machine, snapshot_data, snapshot_size); |
| 125 | spectrum_setup_z80(image->machine, snapshot_data, snapshot_size); |
| 126 | 126 | } |
| 127 | 127 | free(snapshot_data); |
| 128 | 128 | logerror("Snapshot loaded - new PC = %04x\n", (unsigned) cpunum_get_reg(0, Z80_PC) & 0x0ffff); |
src/mess/machine/microtan.c
| r2402 | r2403 | |
| 800 | 800 | if (microtan_varify_snapshot(snapshot_buff, snapshot_size)==IMAGE_VERIFY_FAIL) |
| 801 | 801 | return INIT_FAIL; |
| 802 | 802 | |
| 803 | | microtan_snapshot_copy(machine, snapshot_buff, snapshot_size); |
| 803 | microtan_snapshot_copy(image->machine, snapshot_buff, snapshot_size); |
| 804 | 804 | return INIT_PASS; |
| 805 | 805 | } |
| 806 | 806 | |
| r2402 | r2403 | |
| 835 | 835 | else |
| 836 | 836 | rc = parse_zillion_hex(snapshot_buff, buff); |
| 837 | 837 | if (rc == INIT_PASS) |
| 838 | | microtan_snapshot_copy(machine, snapshot_buff, snapshot_size); |
| 838 | microtan_snapshot_copy(image->machine, snapshot_buff, snapshot_size); |
| 839 | 839 | free(snapshot_buff); |
| 840 | 840 | return rc; |
| 841 | 841 | } |
src/mess/drivers/mbee.c
| r2402 | r2403 | |
| 438 | 438 | |
| 439 | 439 | static QUICKLOAD_LOAD( mbee ) |
| 440 | 440 | { |
| 441 | | UINT8 sw = input_port_read(machine, "CONFIG") & 1; /* reading the dipswitch: 1 = autorun */ |
| 441 | UINT8 sw = input_port_read(image->machine, "CONFIG") & 1; /* reading the dipswitch: 1 = autorun */ |
| 442 | 442 | UINT16 exec_addr, start_addr, end_addr; |
| 443 | 443 | |
| 444 | | if (z80bin_load_file( machine, image, file_type, &exec_addr, &start_addr, &end_addr ) == INIT_FAIL) |
| 444 | if (z80bin_load_file(image, file_type, &exec_addr, &start_addr, &end_addr ) == INIT_FAIL) |
| 445 | 445 | return INIT_FAIL; |
| 446 | 446 | |
| 447 | 447 | if (exec_addr == 0xffff) return INIT_PASS; /* data file */ |
| r2402 | r2403 | |
| 478 | 478 | static SNAPSHOT_LOAD( mbee ) |
| 479 | 479 | { |
| 480 | 480 | UINT16 i, j; |
| 481 | | UINT8 data, sw = input_port_read(machine, "CONFIG") & 1; /* reading the dipswitch: 1 = autorun */ |
| 481 | UINT8 data, sw = input_port_read(image->machine, "CONFIG") & 1; /* reading the dipswitch: 1 = autorun */ |
| 482 | 482 | |
| 483 | 483 | for (i = 0; i < snapshot_size; i++) |
| 484 | 484 | { |
src/mess/drivers/super80.c
| r2402 | r2403 | |
| 952 | 952 | |
| 953 | 953 | static QUICKLOAD_LOAD( super80 ) |
| 954 | 954 | { |
| 955 | | UINT8 sw = input_port_read(machine, "CONFIG") & 1; /* reading the dipswitch: 1 = autorun */ |
| 955 | UINT8 sw = input_port_read(image->machine, "CONFIG") & 1; /* reading the dipswitch: 1 = autorun */ |
| 956 | 956 | UINT16 exec_addr, start_addr, end_addr; |
| 957 | 957 | |
| 958 | | if (z80bin_load_file( machine, image, file_type, &exec_addr, &start_addr, &end_addr ) == INIT_FAIL) |
| 958 | if (z80bin_load_file(image, file_type, &exec_addr, &start_addr, &end_addr ) == INIT_FAIL) |
| 959 | 959 | return INIT_FAIL; |
| 960 | 960 | |
| 961 | 961 | if ((exec_addr != 0xffff) && (sw)) |
src/mess/drivers/exidy.c
| r2402 | r2403 | |
| 801 | 801 | |
| 802 | 802 | static QUICKLOAD_LOAD( exidy ) |
| 803 | 803 | { |
| 804 | | UINT8 sw = input_port_read(machine, "CONFIG") & 1; /* reading the dipswitch: 1 = autorun */ |
| 804 | UINT8 sw = input_port_read(image->machine, "CONFIG") & 1; /* reading the dipswitch: 1 = autorun */ |
| 805 | 805 | UINT16 exec_addr, start_addr, end_addr; |
| 806 | 806 | |
| 807 | | if (z80bin_load_file( machine, image, file_type, &exec_addr, &start_addr, &end_addr ) == INIT_FAIL) |
| 807 | if (z80bin_load_file(image, file_type, &exec_addr, &start_addr, &end_addr ) == INIT_FAIL) |
| 808 | 808 | return INIT_FAIL; |
| 809 | 809 | |
| 810 | 810 | if (exec_addr == 0xffff) return INIT_PASS; /* data file */ |
src/mess/drivers/vtech1.c
| r2402 | r2403 | |
| 408 | 408 | |
| 409 | 409 | static QUICKLOAD_LOAD( vtech1 ) |
| 410 | 410 | { |
| 411 | | UINT8 sw = input_port_read(machine, "CONFIG") & 1; /* reading the dipswitch: 1 = autorun */ |
| 411 | UINT8 sw = input_port_read(image->machine, "CONFIG") & 1; /* reading the dipswitch: 1 = autorun */ |
| 412 | 412 | UINT16 exec_addr, start_addr, end_addr; |
| 413 | 413 | |
| 414 | | if (z80bin_load_file( machine, image, file_type, &exec_addr, &start_addr, &end_addr ) == INIT_FAIL) |
| 414 | if (z80bin_load_file(image, file_type, &exec_addr, &start_addr, &end_addr ) == INIT_FAIL) |
| 415 | 415 | return INIT_FAIL; |
| 416 | 416 | |
| 417 | 417 | /* A Microsoft Basic program needs some manipulation before it can be run. |