Previous 15994 Revisions Next

r2403 Tuesday 15th April, 2008 at 11:24:58 UTC by Nathan Woods
Snapshot/quickload cleanups
[src/mess/devices]bitbngr.h snapquik.c snapquik.h z80bin.c z80bin.h
[src/mess/drivers]exidy.c mbee.c super80.c vtech1.c
[src/mess/machine]amstrad.c galaxy.c microtan.c spectrum.c ti85.c

src/mess/devices/snapquik.h
r2402r2403
2222   MESS_DEVINFO_FLOAT_QUICKLOAD_DELAY = MESS_DEVINFO_FLOAT_DEV_SPECIFIC
2323};
2424
25typedef int (*snapquick_loadproc)(running_machine *machine, const device_config *image, const char *file_type, int file_size);
25typedef int (*snapquick_load_func)(const device_config *device, const char *file_type, int file_size);
2626
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)
2929
3030void snapshot_device_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info);
3131void quickload_device_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info);
src/mess/devices/z80bin.c
r2402r2403
1717#include "snapquik.h"
1818
1919
20int z80bin_load_file( running_machine *machine, const device_config *image, const char *file_type, UINT16 *exec_addr, UINT16 *start_addr, UINT16 *end_addr )
20int z80bin_load_file(const device_config *image, const char *file_type, UINT16 *exec_addr, UINT16 *start_addr, UINT16 *end_addr )
2121{
2222   int ch;
2323   UINT16 args[3];
r2402r2403
8383{
8484   UINT16 exec_addr, start_addr, end_addr;
8585
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)
8787      return INIT_FAIL;
8888
8989   if (exec_addr == 0xffff) return INIT_PASS;         /* non-executable data file */
src/mess/devices/z80bin.h
r2402r2403
1616
1717void z80bin_quickload_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info);
1818
19int z80bin_load_file( running_machine *machine, const device_config *image, const char *file_type, UINT16 *exec_addr, UINT16 *start_addr, UINT16 *end_addr );
19int z80bin_load_file(const device_config *image, const char *file_type, UINT16 *exec_addr, UINT16 *start_addr, UINT16 *end_addr );
2020
2121
2222#endif /* Z80BIN_H */
src/mess/devices/snapquik.c
r2402r2403
2626static TIMER_CALLBACK(snapquick_processsnapshot)
2727{
2828   struct snapquick_info *si = (struct snapquick_info *) ptr;
29   snapquick_loadproc loadproc;
29   snapquick_load_func loadproc;
3030   const char *file_type;
3131   const struct IODevice *dev;
3232
3333   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);
3535   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);
3737   image_unload(si->img);
3838}
3939
src/mess/devices/bitbngr.h
r2402r2403
1414
1515
1616/***************************************************************************
17    TYPE DEFINITIONS
17    CONSTANTS
1818***************************************************************************/
1919
2020#define BITBANGER   DEVICE_GET_INFO_NAME(bitbanger)
2121
22
23
24/***************************************************************************
25    TYPE DEFINITIONS
26***************************************************************************/
27
2228typedef struct _bitbanger_config bitbanger_config;
2329struct _bitbanger_config
2430{
src/mess/machine/spectrum.c
r2402r2403
109109         logerror("Invalid .SNA file size.\n");
110110         goto error;
111111      }
112      spectrum_setup_sna(machine, snapshot_data, snapshot_size);
112      spectrum_setup_sna(image->machine, snapshot_data, snapshot_size);
113113   }
114114   else if (!mame_stricmp(file_type, "sp"))
115115   {
r2402r2403
118118         logerror("Invalid .SP signature.\n");
119119         goto error;
120120      }
121      spectrum_setup_sp(machine, snapshot_data, snapshot_size);
121      spectrum_setup_sp(image->machine, snapshot_data, snapshot_size);
122122   }
123123   else
124124   {
125      spectrum_setup_z80(machine, snapshot_data, snapshot_size);
125      spectrum_setup_z80(image->machine, snapshot_data, snapshot_size);
126126   }
127127   free(snapshot_data);
128128   logerror("Snapshot loaded - new PC = %04x\n", (unsigned) cpunum_get_reg(0, Z80_PC) & 0x0ffff);
src/mess/machine/microtan.c
r2402r2403
800800   if (microtan_varify_snapshot(snapshot_buff, snapshot_size)==IMAGE_VERIFY_FAIL)
801801      return INIT_FAIL;
802802
803   microtan_snapshot_copy(machine, snapshot_buff, snapshot_size);
803   microtan_snapshot_copy(image->machine, snapshot_buff, snapshot_size);
804804   return INIT_PASS;
805805}
806806
r2402r2403
835835   else
836836      rc = parse_zillion_hex(snapshot_buff, buff);
837837   if (rc == INIT_PASS)
838      microtan_snapshot_copy(machine, snapshot_buff, snapshot_size);
838      microtan_snapshot_copy(image->machine, snapshot_buff, snapshot_size);
839839   free(snapshot_buff);
840840   return rc;
841841}
src/mess/machine/amstrad.c
r2402r2403
193193      return INIT_FAIL;
194194   }
195195
196   amstrad_handle_snapshot(machine, snapshot);
196   amstrad_handle_snapshot(image->machine, snapshot);
197197   free(snapshot);
198198   return INIT_PASS;
199199}
src/mess/machine/ti85.c
r2402r2403
637637
638638   switch (ti_calculator_model)
639639   {
640      case TI_85: ti85_setup_snapshot(machine, ti8x_snapshot_data); break;
641      case TI_86: ti86_setup_snapshot(machine, ti8x_snapshot_data); break;
640      case TI_85: ti85_setup_snapshot(image->machine, ti8x_snapshot_data); break;
641      case TI_86: ti86_setup_snapshot(image->machine, ti8x_snapshot_data); break;
642642   }
643643   free(ti8x_snapshot_data);
644644   return INIT_PASS;
src/mess/machine/galaxy.c
r2402r2403
137137
138138   image_fread(image, snapshot_data, snapshot_size);
139139
140   galaxy_setup_snapshot(machine, snapshot_data, snapshot_size);
140   galaxy_setup_snapshot(image->machine, snapshot_data, snapshot_size);
141141
142142   return INIT_PASS;
143143}
src/mess/drivers/mbee.c
r2402r2403
438438
439439static QUICKLOAD_LOAD( mbee )
440440{
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 */
442442   UINT16 exec_addr, start_addr, end_addr;
443443
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)
445445      return INIT_FAIL;
446446
447447   if (exec_addr == 0xffff) return INIT_PASS;         /* data file */
r2402r2403
478478static SNAPSHOT_LOAD( mbee )
479479{
480480   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 */
482482
483483   for (i = 0; i < snapshot_size; i++)
484484   {
src/mess/drivers/super80.c
r2402r2403
952952
953953static QUICKLOAD_LOAD( super80 )
954954{
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 */
956956   UINT16 exec_addr, start_addr, end_addr;
957957
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)
959959      return INIT_FAIL;
960960
961961   if ((exec_addr != 0xffff) && (sw))
src/mess/drivers/exidy.c
r2402r2403
801801
802802static QUICKLOAD_LOAD( exidy )
803803{
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 */
805805   UINT16 exec_addr, start_addr, end_addr;
806806
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)
808808      return INIT_FAIL;
809809
810810   if (exec_addr == 0xffff) return INIT_PASS;         /* data file */
src/mess/drivers/vtech1.c
r2402r2403
408408
409409static QUICKLOAD_LOAD( vtech1 )
410410{
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 */
412412   UINT16 exec_addr, start_addr, end_addr;
413413
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)
415415      return INIT_FAIL;
416416
417417   /* A Microsoft Basic program needs some manipulation before it can be run.

Previous 15994 Revisions Next


© 1998-2018 The MESS Team