Previous 15994 Revisions Next

r1983 Thursday 13th March, 2008 at 12:31:30 UTC by Dirk Best
Updated the device system to pass running_machine* [Anonymous]
[src/mess/devices]snapquik.c snapquik.h
[src/mess/includes]amstrad.h
[src/mess/machine]amstrad.c galaxy.c microtan.c spectrum.c ti85.c

src/mess/devices/snapquik.h
r1982r1983
2222   MESS_DEVINFO_FLOAT_QUICKLOAD_DELAY = MESS_DEVINFO_FLOAT_DEV_SPECIFIC
2323};
2424
25typedef int (*snapquick_loadproc)(mess_image *image, const char *file_type, int file_size);
25typedef int (*snapquick_loadproc)(running_machine *machine, mess_image *image, const char *file_type, int file_size);
2626
27#define SNAPSHOT_LOAD(name)      int snapshot_load_##name(mess_image *image, const char *file_type, int snapshot_size)
28#define QUICKLOAD_LOAD(name)   int quickload_load_##name(mess_image *image, const char *file_type, int quickload_size)
27#define SNAPSHOT_LOAD(name)      int snapshot_load_##name(running_machine *machine, mess_image *image, const char *file_type, int snapshot_size)
28#define QUICKLOAD_LOAD(name)   int quickload_load_##name(running_machine *machine, mess_image *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/snapquik.c
r1982r1983
3232
3333   loadproc = (snapquick_loadproc) mess_device_get_info_fct(&si->dev->devclass, MESS_DEVINFO_PTR_SNAPSHOT_LOAD);
3434   file_type = image_filetype(si->img);
35   loadproc(si->img, file_type, si->file_size);
35   loadproc(machine, si->img, file_type, si->file_size);
3636   image_unload(si->img);
3737}
3838
src/mess/includes/amstrad.h
r1982r1983
4040
4141SNAPSHOT_LOAD( amstrad );
4242
43void amstrad_handle_snapshot(unsigned char *);
43void amstrad_handle_snapshot(running_machine *, unsigned char *);
4444
4545DEVICE_LOAD(amstrad_plus_cartridge);
4646
src/mess/machine/spectrum.c
r1982r1983
2323
2424***************************************************************************/
2525
26#include <stdarg.h>
2726#include "driver.h"
28#include "deprecat.h"
2927#include "cpu/z80/z80.h"
3028#include "includes/spectrum.h"
3129#include "eventlst.h"
r1982r1983
110108         logerror("Invalid .SNA file size.\n");
111109         goto error;
112110      }
113      spectrum_setup_sna(Machine, snapshot_data, snapshot_size);
111      spectrum_setup_sna(machine, snapshot_data, snapshot_size);
114112   }
115113   else if (!mame_stricmp(file_type, "sp"))
116114   {
r1982r1983
119117         logerror("Invalid .SP signature.\n");
120118         goto error;
121119      }
122      spectrum_setup_sp(Machine, snapshot_data, snapshot_size);
120      spectrum_setup_sp(machine, snapshot_data, snapshot_size);
123121   }
124122   else
125123   {
126      spectrum_setup_z80(Machine, snapshot_data, snapshot_size);
124      spectrum_setup_z80(machine, snapshot_data, snapshot_size);
127125   }
128126   free(snapshot_data);
129127   logerror("Snapshot loaded - new PC = %04x\n", (unsigned) cpunum_get_reg(0, Z80_PC) & 0x0ffff);
src/mess/machine/microtan.c
r1982r1983
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(machine, snapshot_buff, snapshot_size);
804804   return INIT_PASS;
805805}
806806
r1982r1983
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(machine, snapshot_buff, snapshot_size);
839839   free(snapshot_buff);
840840   return rc;
841841}
src/mess/machine/amstrad.c
r1982r1983
2828#include "devices/snapquik.h"
2929#include "includes/amstrad.h"
3030#include "sound/ay8910.h"
31#include "deprecat.h"
3231
3332
3433void amstrad_setup_machine(running_machine *machine)
r1982r1983
3736}
3837
3938/* load CPCEMU style snapshots */
40void amstrad_handle_snapshot(unsigned char *pSnapshot)
39void amstrad_handle_snapshot(running_machine *machine, unsigned char *pSnapshot)
4140{
42   running_machine *machine = Machine;
4341   int RegData;
4442   int i;
4543
r1982r1983
195193      return INIT_FAIL;
196194   }
197195
198   amstrad_handle_snapshot(snapshot);
196   amstrad_handle_snapshot(machine, snapshot);
199197   free(snapshot);
200198   return INIT_PASS;
201199}
src/mess/machine/ti85.c
r1982r1983
638638
639639   switch (ti_calculator_model)
640640   {
641      case TI_85: ti85_setup_snapshot(Machine, ti8x_snapshot_data); break;
642      case TI_86: ti86_setup_snapshot(Machine, ti8x_snapshot_data); break;
641      case TI_85: ti85_setup_snapshot(machine, ti8x_snapshot_data); break;
642      case TI_86: ti86_setup_snapshot(machine, ti8x_snapshot_data); break;
643643   }
644644   free(ti8x_snapshot_data);
645645   return INIT_PASS;
src/mess/machine/galaxy.c
r1982r1983
77
88***************************************************************************/
99
10#include <stdarg.h>
1110#include "driver.h"
12#include "deprecat.h"
1311#include "cpu/z80/z80.h"
1412#include "includes/galaxy.h"
1513
r1982r1983
139137
140138   image_fread(image, snapshot_data, snapshot_size);
141139
142   galaxy_setup_snapshot(Machine, snapshot_data, snapshot_size);
140   galaxy_setup_snapshot(machine, snapshot_data, snapshot_size);
143141
144142   return INIT_PASS;
145143}

Previous 15994 Revisions Next


© 1998-2018 The MESS Team