summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2014-12-23 23:25:56 +0100
committer Olivier Galibert <galibert@pobox.com>2015-02-14 20:58:20 +0100
commiteeedd8a4ca84abaa1fe540afca38093a49127f3b (patch)
tree0461853ab85a1560649d4c10e0e43f1604392694
parenta51ee3e00f2751a2d37c0d264b68f24511a54056 (diff)
save: Give the device when available to the state save subsystem [O. Galibert]
-rw-r--r--src/emu/bus/rs232/keyboard.c2
-rw-r--r--src/emu/cpu/psx/dma.c10
-rw-r--r--src/emu/device.h4
-rw-r--r--src/emu/diserial.c44
-rw-r--r--src/emu/diserial.h2
-rw-r--r--src/emu/machine/i8251.c2
-rw-r--r--src/emu/machine/ins8250.c2
-rw-r--r--src/emu/machine/z80dart.c2
-rw-r--r--src/emu/memory.c4
-rw-r--r--src/emu/save.c12
-rw-r--r--src/emu/save.h102
-rw-r--r--src/emu/schedule.c10
-rw-r--r--src/emu/sound.c8
-rw-r--r--src/emu/tilemap.c22
-rw-r--r--src/emu/video/psx.c2
15 files changed, 119 insertions, 109 deletions
diff --git a/src/emu/bus/rs232/keyboard.c b/src/emu/bus/rs232/keyboard.c
index 1c41c7e5492..6ed39962b5b 100644
--- a/src/emu/bus/rs232/keyboard.c
+++ b/src/emu/bus/rs232/keyboard.c
@@ -44,7 +44,7 @@ ioport_constructor serial_keyboard_device::device_input_ports() const
void serial_keyboard_device::device_start()
{
generic_keyboard_device::device_start();
- device_serial_interface::register_save_state(machine().save(), name(), tag());
+ device_serial_interface::register_save_state(machine().save(), this);
save_item(NAME(m_curr_key));
save_item(NAME(m_key_valid));
}
diff --git a/src/emu/cpu/psx/dma.c b/src/emu/cpu/psx/dma.c
index 7fcd10387cc..edfa1dd5309 100644
--- a/src/emu/cpu/psx/dma.c
+++ b/src/emu/cpu/psx/dma.c
@@ -66,11 +66,11 @@ void psxdma_device::device_start()
dma->timer = timer_alloc(index);
- machine().save().save_item( "psxdma", tag(), index, NAME( dma->n_base ) );
- machine().save().save_item( "psxdma", tag(), index, NAME( dma->n_blockcontrol ) );
- machine().save().save_item( "psxdma", tag(), index, NAME( dma->n_channelcontrol ) );
- machine().save().save_item( "psxdma", tag(), index, NAME( dma->n_ticks ) );
- machine().save().save_item( "psxdma", tag(), index, NAME( dma->b_running ) );
+ save_item( NAME( dma->n_base ), index );
+ save_item( NAME( dma->n_blockcontrol ), index );
+ save_item( NAME( dma->n_channelcontrol ), index );
+ save_item( NAME( dma->n_ticks ), index );
+ save_item( NAME( dma->b_running ), index );
}
save_item( NAME(m_dpcp) );
diff --git a/src/emu/device.h b/src/emu/device.h
index 10ada7ded2f..6ef44bbcb1b 100644
--- a/src/emu/device.h
+++ b/src/emu/device.h
@@ -192,9 +192,9 @@ public:
// state saving interfaces
template<typename _ItemType>
- void ATTR_COLD save_item(_ItemType &value, const char *valname, int index = 0) { assert(m_save != NULL); m_save->save_item(name(), tag(), index, value, valname); }
+ void ATTR_COLD save_item(_ItemType &value, const char *valname, int index = 0) { assert(m_save != NULL); m_save->save_item(this, name(), tag(), index, value, valname); }
template<typename _ItemType>
- void ATTR_COLD save_pointer(_ItemType *value, const char *valname, UINT32 count, int index = 0) { assert(m_save != NULL); m_save->save_pointer(name(), tag(), index, value, valname, count); }
+ void ATTR_COLD save_pointer(_ItemType *value, const char *valname, UINT32 count, int index = 0) { assert(m_save != NULL); m_save->save_pointer(this, name(), tag(), index, value, valname, count); }
// debugging
device_debug *debug() const { return m_debug; }
diff --git a/src/emu/diserial.c b/src/emu/diserial.c
index 085241ab670..46748b5e692 100644
--- a/src/emu/diserial.c
+++ b/src/emu/diserial.c
@@ -50,28 +50,30 @@ device_serial_interface::~device_serial_interface()
{
}
-void device_serial_interface::register_save_state(save_manager &save, const char *module, const char *tag)
+void device_serial_interface::register_save_state(save_manager &save, device_t *device)
{
- save.save_item(module, tag, 0, NAME(m_df_start_bit_count));
- save.save_item(module, tag, 0, NAME(m_df_word_length));
- save.save_item(module, tag, 0, NAME(m_df_parity));
- save.save_item(module, tag, 0, NAME(m_df_stop_bit_count));
- save.save_item(module, tag, 0, NAME(m_rcv_register_data));
- save.save_item(module, tag, 0, NAME(m_rcv_flags));
- save.save_item(module, tag, 0, NAME(m_rcv_bit_count_received));
- save.save_item(module, tag, 0, NAME(m_rcv_bit_count));
- save.save_item(module, tag, 0, NAME(m_rcv_byte_received));
- save.save_item(module, tag, 0, NAME(m_rcv_framing_error));
- save.save_item(module, tag, 0, NAME(m_rcv_parity_error));
- save.save_item(module, tag, 0, NAME(m_tra_register_data));
- save.save_item(module, tag, 0, NAME(m_tra_flags));
- save.save_item(module, tag, 0, NAME(m_tra_bit_count_transmitted));
- save.save_item(module, tag, 0, NAME(m_tra_bit_count));
- save.save_item(module, tag, 0, NAME(m_rcv_rate));
- save.save_item(module, tag, 0, NAME(m_tra_rate));
- save.save_item(module, tag, 0, NAME(m_rcv_line));
- save.save_item(module, tag, 0, NAME(m_tra_clock_state));
- save.save_item(module, tag, 0, NAME(m_rcv_clock_state));
+ const char *module = device->name();
+ const char *tag = device->tag();
+ save.save_item(device, module, tag, 0, NAME(m_df_start_bit_count));
+ save.save_item(device, module, tag, 0, NAME(m_df_word_length));
+ save.save_item(device, module, tag, 0, NAME(m_df_parity));
+ save.save_item(device, module, tag, 0, NAME(m_df_stop_bit_count));
+ save.save_item(device, module, tag, 0, NAME(m_rcv_register_data));
+ save.save_item(device, module, tag, 0, NAME(m_rcv_flags));
+ save.save_item(device, module, tag, 0, NAME(m_rcv_bit_count_received));
+ save.save_item(device, module, tag, 0, NAME(m_rcv_bit_count));
+ save.save_item(device, module, tag, 0, NAME(m_rcv_byte_received));
+ save.save_item(device, module, tag, 0, NAME(m_rcv_framing_error));
+ save.save_item(device, module, tag, 0, NAME(m_rcv_parity_error));
+ save.save_item(device, module, tag, 0, NAME(m_tra_register_data));
+ save.save_item(device, module, tag, 0, NAME(m_tra_flags));
+ save.save_item(device, module, tag, 0, NAME(m_tra_bit_count_transmitted));
+ save.save_item(device, module, tag, 0, NAME(m_tra_bit_count));
+ save.save_item(device, module, tag, 0, NAME(m_rcv_rate));
+ save.save_item(device, module, tag, 0, NAME(m_tra_rate));
+ save.save_item(device, module, tag, 0, NAME(m_rcv_line));
+ save.save_item(device, module, tag, 0, NAME(m_tra_clock_state));
+ save.save_item(device, module, tag, 0, NAME(m_rcv_clock_state));
}
void device_serial_interface::interface_pre_start()
diff --git a/src/emu/diserial.h b/src/emu/diserial.h
index 45e9691fda2..3df610b0821 100644
--- a/src/emu/diserial.h
+++ b/src/emu/diserial.h
@@ -130,7 +130,7 @@ protected:
const char *parity_tostring(parity_t stop_bits);
const char *stop_bits_tostring(stop_bits_t stop_bits);
- void register_save_state(save_manager &save, const char *module, const char *tag);
+ void register_save_state(save_manager &save, device_t *device);
private:
enum { TRA_TIMER_ID = 10000, RCV_TIMER_ID };
diff --git a/src/emu/machine/i8251.c b/src/emu/machine/i8251.c
index 728588f106a..07e3edd8ad6 100644
--- a/src/emu/machine/i8251.c
+++ b/src/emu/machine/i8251.c
@@ -77,7 +77,7 @@ void i8251_device::device_start()
save_item(NAME(m_data));
save_item(NAME(m_tx_busy));
save_item(NAME(m_disable_tx_pending));
- device_serial_interface::register_save_state(machine().save(), name(), tag());
+ device_serial_interface::register_save_state(machine().save(), this);
}
diff --git a/src/emu/machine/ins8250.c b/src/emu/machine/ins8250.c
index 02a42d2fbbd..a104286845b 100644
--- a/src/emu/machine/ins8250.c
+++ b/src/emu/machine/ins8250.c
@@ -544,7 +544,7 @@ void ins8250_uart_device::device_start()
set_tra_rate(0);
set_rcv_rate(0);
- device_serial_interface::register_save_state(machine().save(), name(), tag());
+ device_serial_interface::register_save_state(machine().save(), this);
save_item(NAME(m_regs.thr));
save_item(NAME(m_regs.rbr));
save_item(NAME(m_regs.ier));
diff --git a/src/emu/machine/z80dart.c b/src/emu/machine/z80dart.c
index 124a34ff887..49a80046686 100644
--- a/src/emu/machine/z80dart.c
+++ b/src/emu/machine/z80dart.c
@@ -563,7 +563,7 @@ void z80dart_channel::device_start()
save_item(NAME(m_dtr));
save_item(NAME(m_rts));
save_item(NAME(m_sync));
- device_serial_interface::register_save_state(machine().save(), name(), tag());
+ device_serial_interface::register_save_state(machine().save(), this);
}
diff --git a/src/emu/memory.c b/src/emu/memory.c
index 3224e9d11d2..2d2023ad12b 100644
--- a/src/emu/memory.c
+++ b/src/emu/memory.c
@@ -3874,7 +3874,7 @@ memory_block::memory_block(address_space &space, offs_t bytestart, offs_t byteen
int bytes_per_element = space.data_width() / 8;
astring name;
name.printf("%08x-%08x", bytestart, byteend);
- space.machine().save().save_memory("memory", space.device().tag(), space.spacenum(), name, m_data, bytes_per_element, (UINT32)(byteend + 1 - bytestart) / bytes_per_element);
+ space.machine().save().save_memory(NULL, "memory", space.device().tag(), space.spacenum(), name, m_data, bytes_per_element, (UINT32)(byteend + 1 - bytestart) / bytes_per_element);
}
}
@@ -3921,7 +3921,7 @@ memory_bank::memory_bank(address_space &space, int index, offs_t bytestart, offs
}
if (!m_anonymous && space.machine().save().registration_allowed())
- space.machine().save().save_item("memory", m_tag, 0, NAME(m_curentry));
+ space.machine().save().save_item(NULL, "memory", m_tag, 0, NAME(m_curentry));
}
diff --git a/src/emu/save.c b/src/emu/save.c
index 98c23caf4a0..2c962bf04aa 100644
--- a/src/emu/save.c
+++ b/src/emu/save.c
@@ -147,7 +147,7 @@ void save_manager::register_postload(save_prepost_delegate func)
// memory
//-------------------------------------------------
-void save_manager::save_memory(const char *module, const char *tag, UINT32 index, const char *name, void *val, UINT32 valsize, UINT32 valcount)
+void save_manager::save_memory(device_t *device, const char *module, const char *tag, UINT32 index, const char *name, void *val, UINT32 valsize, UINT32 valcount)
{
assert(valsize == 1 || valsize == 2 || valsize == 4 || valsize == 8);
@@ -183,7 +183,7 @@ void save_manager::save_memory(const char *module, const char *tag, UINT32 index
}
// insert us into the list
- m_entry_list.insert_after(*global_alloc(state_entry(val, totalname, valsize, valcount)), insert_after);
+ m_entry_list.insert_after(*global_alloc(state_entry(val, totalname, device, module, tag ? tag : "", index, valsize, valcount)), insert_after);
}
@@ -419,10 +419,14 @@ save_manager::state_callback::state_callback(save_prepost_delegate callback)
// state_entry - constructor
//-------------------------------------------------
-save_manager::state_entry::state_entry(void *data, const char *name, UINT8 size, UINT32 count)
+state_entry::state_entry(void *data, const char *name, device_t *device, const char *module, const char *tag, int index, UINT8 size, UINT32 count)
: m_next(NULL),
m_data(data),
m_name(name),
+ m_device(device),
+ m_module(module),
+ m_tag(tag),
+ m_index(index),
m_typesize(size),
m_typecount(count),
m_offset(0)
@@ -435,7 +439,7 @@ save_manager::state_entry::state_entry(void *data, const char *name, UINT8 size,
// block of data
//-------------------------------------------------
-void save_manager::state_entry::flip_data()
+void state_entry::flip_data()
{
UINT16 *data16;
UINT32 *data32;
diff --git a/src/emu/save.h b/src/emu/save.h
index 7e00daf3fd1..ad352d6121d 100644
--- a/src/emu/save.h
+++ b/src/emu/save.h
@@ -51,24 +51,24 @@ typedef delegate<void ()> save_prepost_delegate;
// use this as above, but also to declare that dynamic_array<TYPE> is safe as well
#define ALLOW_SAVE_TYPE_AND_ARRAY(TYPE) \
ALLOW_SAVE_TYPE(TYPE); \
- template<> inline void save_manager::save_item(const char *module, const char *tag, int index, dynamic_array<TYPE> &value, const char *name) { save_memory(module, tag, index, name, &value[0], sizeof(TYPE), value.count()); }
+ template<> inline void save_manager::save_item(device_t *device, const char *module, const char *tag, int index, dynamic_array<TYPE> &value, const char *name) { save_memory(device, module, tag, index, name, &value[0], sizeof(TYPE), value.count()); }
// register items with explicit tags
#define state_save_register_item(_mach, _mod, _tag, _index, _val) \
- (_mach).save().save_item(_mod, _tag, _index, _val, #_val)
+ (_mach).save().save_item(NULL, _mod, _tag, _index, _val, #_val)
#define state_save_register_item_pointer(_mach, _mod, _tag, _index, _val, _count) \
- (_mach).save().save_pointer(_mod, _tag, _index, _val, #_val, _count)
+ (_mach).save().save_pointer(NULL, _mod, _tag, _index, _val, #_val, _count)
#define state_save_register_item_array(_mach, _mod, _tag, _index, _val) \
- (_mach).save().save_item(_mod, _tag, _index, _val, #_val)
+ (_mach).save().save_item(NULL, _mod, _tag, _index, _val, #_val)
#define state_save_register_item_2d_array(_mach, _mod, _tag, _index, _val) \
- (_mach).save().save_item(_mod, _tag, _index, _val, #_val)
+ (_mach).save().save_item(NULL, _mod, _tag, _index, _val, #_val)
#define state_save_register_item_bitmap(_mach, _mod, _tag, _index, _val) \
- (_mach).save().save_item(_mod, _tag, _index, *(_val), #_val)
+ (_mach).save().save_item(NULL, _mod, _tag, _index, *(_val), #_val)
@@ -76,6 +76,31 @@ typedef delegate<void ()> save_prepost_delegate;
// TYPE DEFINITIONS
//**************************************************************************
+class state_entry
+{
+public:
+ // construction/destruction
+ state_entry(void *data, const char *name, device_t *device, const char *module, const char *tag, int index, UINT8 size, UINT32 count);
+
+ // getters
+ state_entry *next() const { return m_next; }
+
+ // helpers
+ void flip_data();
+
+ // state
+ state_entry * m_next; // pointer to next entry
+ void * m_data; // pointer to the memory to save/restore
+ astring m_name; // full name
+ device_t * m_device; // associated device, NULL if none
+ astring m_module; // module name
+ astring m_tag; // tag name
+ int m_index; // index
+ UINT8 m_typesize; // size of the raw data type
+ UINT32 m_typecount; // number of items
+ UINT32 m_offset; // offset within the final structure
+};
+
class save_manager
{
// type_checker is a set of templates to identify valid save types
@@ -104,46 +129,46 @@ public:
void dispatch_postload();
// generic memory registration
- void save_memory(const char *module, const char *tag, UINT32 index, const char *name, void *val, UINT32 valsize, UINT32 valcount = 1);
+ void save_memory(device_t *device, const char *module, const char *tag, UINT32 index, const char *name, void *val, UINT32 valsize, UINT32 valcount = 1);
// templatized wrapper for general objects
template<typename _ItemType>
- void save_item(const char *module, const char *tag, int index, _ItemType &value, const char *valname)
+ void save_item(device_t *device, const char *module, const char *tag, int index, _ItemType &value, const char *valname)
{
if (type_checker<_ItemType>::is_pointer) throw emu_fatalerror("Called save_item on a pointer with no count!");
if (!type_checker<_ItemType>::is_atom) throw emu_fatalerror("Called save_item on a non-fundamental type!");
- save_memory(module, tag, index, valname, &value, sizeof(value));
+ save_memory(device, module, tag, index, valname, &value, sizeof(value));
}
// templatized wrapper for 1-dimensional arrays
template<typename _ItemType, std::size_t N>
- void save_item(const char *module, const char *tag, int index, _ItemType (&value)[N], const char *valname)
+ void save_item(device_t *device, const char *module, const char *tag, int index, _ItemType (&value)[N], const char *valname)
{
if (!type_checker<_ItemType>::is_atom) throw emu_fatalerror("Called save_item on a non-fundamental type!");
- save_memory(module, tag, index, valname, &value[0], sizeof(value[0]), N);
+ save_memory(device, module, tag, index, valname, &value[0], sizeof(value[0]), N);
}
// templatized wrapper for 2-dimensional arrays
template<typename _ItemType, std::size_t M, std::size_t N>
- void save_item(const char *module, const char *tag, int index, _ItemType (&value)[M][N], const char *valname)
+ void save_item(device_t *device, const char *module, const char *tag, int index, _ItemType (&value)[M][N], const char *valname)
{
if (!type_checker<_ItemType>::is_atom) throw emu_fatalerror("Called save_item on a non-fundamental type!");
- save_memory(module, tag, index, valname, &value[0][0], sizeof(value[0][0]), M * N);
+ save_memory(device, module, tag, index, valname, &value[0][0], sizeof(value[0][0]), M * N);
}
// templatized wrapper for pointers
template<typename _ItemType>
- void save_pointer(const char *module, const char *tag, int index, _ItemType *value, const char *valname, UINT32 count)
+ void save_pointer(device_t *device, const char *module, const char *tag, int index, _ItemType *value, const char *valname, UINT32 count)
{
if (!type_checker<_ItemType>::is_atom) throw emu_fatalerror("Called save_item on a non-fundamental type!");
- save_memory(module, tag, index, valname, value, sizeof(*value), count);
+ save_memory(device, module, tag, index, valname, value, sizeof(*value), count);
}
// global memory registration
template<typename _ItemType>
- void save_item(_ItemType &value, const char *valname, int index = 0) { save_item("global", NULL, index, value, valname); }
+ void save_item(_ItemType &value, const char *valname, int index = 0) { save_item(NULL, "global", NULL, index, value, valname); }
template<typename _ItemType>
- void save_pointer(_ItemType *value, const char *valname, UINT32 count, int index = 0) { save_pointer("global", NULL, index, value, valname, count); }
+ void save_pointer(_ItemType *value, const char *valname, UINT32 count, int index = 0) { save_pointer(NULL, "global", NULL, index, value, valname, count); }
// file processing
static save_error check_file(running_machine &machine, emu_file &file, const char *gamename, void (CLIB_DECL *errormsg)(const char *fmt, ...));
@@ -171,27 +196,6 @@ private:
save_prepost_delegate m_func; // delegate
};
- class state_entry
- {
- public:
- // construction/destruction
- state_entry(void *data, const char *name, UINT8 size, UINT32 count);
-
- // getters
- state_entry *next() const { return m_next; }
-
- // helpers
- void flip_data();
-
- // state
- state_entry * m_next; // pointer to next entry
- void * m_data; // pointer to the memory to save/restore
- astring m_name; // full name
- UINT8 m_typesize; // size of the raw data type
- UINT32 m_typecount; // number of items
- UINT32 m_offset; // offset within the final structure
- };
-
// internal state
running_machine & m_machine; // reference to our machine
bool m_reg_allowed; // are registrations allowed?
@@ -232,27 +236,27 @@ ALLOW_SAVE_TYPE_AND_ARRAY(rgb_t);
//-------------------------------------------------
template<>
-inline void save_manager::save_item(const char *module, const char *tag, int index, bitmap_ind8 &value, const char *name)
+inline void save_manager::save_item(device_t *device, const char *module, const char *tag, int index, bitmap_ind8 &value, const char *name)
{
- save_memory(module, tag, index, name, &value.pix(0), value.bpp() / 8, value.rowpixels() * value.height());
+ save_memory(device, module, tag, index, name, &value.pix(0), value.bpp() / 8, value.rowpixels() * value.height());
}
template<>
-inline void save_manager::save_item(const char *module, const char *tag, int index, bitmap_ind16 &value, const char *name)
+inline void save_manager::save_item(device_t *device, const char *module, const char *tag, int index, bitmap_ind16 &value, const char *name)
{
- save_memory(module, tag, index, name, &value.pix(0), value.bpp() / 8, value.rowpixels() * value.height());
+ save_memory(device, module, tag, index, name, &value.pix(0), value.bpp() / 8, value.rowpixels() * value.height());
}
template<>
-inline void save_manager::save_item(const char *module, const char *tag, int index, bitmap_ind32 &value, const char *name)
+inline void save_manager::save_item(device_t *device, const char *module, const char *tag, int index, bitmap_ind32 &value, const char *name)
{
- save_memory(module, tag, index, name, &value.pix(0), value.bpp() / 8, value.rowpixels() * value.height());
+ save_memory(device, module, tag, index, name, &value.pix(0), value.bpp() / 8, value.rowpixels() * value.height());
}
template<>
-inline void save_manager::save_item(const char *module, const char *tag, int index, bitmap_rgb32 &value, const char *name)
+inline void save_manager::save_item(device_t *device, const char *module, const char *tag, int index, bitmap_rgb32 &value, const char *name)
{
- save_memory(module, tag, index, name, &value.pix(0), value.bpp() / 8, value.rowpixels() * value.height());
+ save_memory(device, module, tag, index, name, &value.pix(0), value.bpp() / 8, value.rowpixels() * value.height());
}
@@ -261,12 +265,12 @@ inline void save_manager::save_item(const char *module, const char *tag, int ind
//-------------------------------------------------
template<>
-inline void save_manager::save_item(const char *module, const char *tag, int index, attotime &value, const char *name)
+inline void save_manager::save_item(device_t *device, const char *module, const char *tag, int index, attotime &value, const char *name)
{
astring tempstr(name, ".attoseconds");
- save_memory(module, tag, index, tempstr, &value.attoseconds, sizeof(value.attoseconds));
+ save_memory(device, module, tag, index, tempstr, &value.attoseconds, sizeof(value.attoseconds));
tempstr.cpy(name).cat(".seconds");
- save_memory(module, tag, index, tempstr, &value.seconds, sizeof(value.seconds));
+ save_memory(device, module, tag, index, tempstr, &value.seconds, sizeof(value.seconds));
}
diff --git a/src/emu/schedule.c b/src/emu/schedule.c
index 82029a65608..74dfa661469 100644
--- a/src/emu/schedule.c
+++ b/src/emu/schedule.c
@@ -260,11 +260,11 @@ void emu_timer::register_save()
}
// save the bits
- machine().save().save_item("timer", name, index, NAME(m_param));
- machine().save().save_item("timer", name, index, NAME(m_enabled));
- machine().save().save_item("timer", name, index, NAME(m_period));
- machine().save().save_item("timer", name, index, NAME(m_start));
- machine().save().save_item("timer", name, index, NAME(m_expire));
+ machine().save().save_item(m_device, "timer", name, index, NAME(m_param));
+ machine().save().save_item(m_device, "timer", name, index, NAME(m_enabled));
+ machine().save().save_item(m_device, "timer", name, index, NAME(m_period));
+ machine().save().save_item(m_device, "timer", name, index, NAME(m_start));
+ machine().save().save_item(m_device, "timer", name, index, NAME(m_expire));
}
diff --git a/src/emu/sound.c b/src/emu/sound.c
index 8ce493bde4f..3bd8236beee 100644
--- a/src/emu/sound.c
+++ b/src/emu/sound.c
@@ -77,19 +77,19 @@ sound_stream::sound_stream(device_t &device, int inputs, int outputs, int sample
// create a unique tag for saving
astring state_tag;
state_tag.printf("%d", m_device.machine().sound().m_stream_list.count());
- m_device.machine().save().save_item("stream", state_tag, 0, NAME(m_sample_rate));
+ m_device.machine().save().save_item(&m_device, "stream", state_tag, 0, NAME(m_sample_rate));
m_device.machine().save().register_postload(save_prepost_delegate(FUNC(sound_stream::postload), this));
// save the gain of each input and output
for (int inputnum = 0; inputnum < m_input.count(); inputnum++)
{
- m_device.machine().save().save_item("stream", state_tag, inputnum, NAME(m_input[inputnum].m_gain));
- m_device.machine().save().save_item("stream", state_tag, inputnum, NAME(m_input[inputnum].m_user_gain));
+ m_device.machine().save().save_item(&m_device, "stream", state_tag, inputnum, NAME(m_input[inputnum].m_gain));
+ m_device.machine().save().save_item(&m_device, "stream", state_tag, inputnum, NAME(m_input[inputnum].m_user_gain));
}
for (int outputnum = 0; outputnum < m_output.count(); outputnum++)
{
m_output[outputnum].m_stream = this;
- m_device.machine().save().save_item("stream", state_tag, outputnum, NAME(m_output[outputnum].m_gain));
+ m_device.machine().save().save_item(&m_device, "stream", state_tag, outputnum, NAME(m_output[outputnum].m_gain));
}
// Mark synchronous streams as such
diff --git a/src/emu/tilemap.c b/src/emu/tilemap.c
index c08ed1e8446..4ff03820310 100644
--- a/src/emu/tilemap.c
+++ b/src/emu/tilemap.c
@@ -407,17 +407,17 @@ tilemap_t &tilemap_t::init(tilemap_manager &manager, device_gfx_interface &decod
// save relevant state
int instance = manager.alloc_instance();
- machine().save().save_item("tilemap", NULL, instance, NAME(m_enable));
- machine().save().save_item("tilemap", NULL, instance, NAME(m_attributes));
- machine().save().save_item("tilemap", NULL, instance, NAME(m_palette_offset));
- machine().save().save_item("tilemap", NULL, instance, NAME(m_scrollrows));
- machine().save().save_item("tilemap", NULL, instance, NAME(m_scrollcols));
- machine().save().save_item("tilemap", NULL, instance, NAME(m_rowscroll));
- machine().save().save_item("tilemap", NULL, instance, NAME(m_colscroll));
- machine().save().save_item("tilemap", NULL, instance, NAME(m_dx));
- machine().save().save_item("tilemap", NULL, instance, NAME(m_dx_flipped));
- machine().save().save_item("tilemap", NULL, instance, NAME(m_dy));
- machine().save().save_item("tilemap", NULL, instance, NAME(m_dy_flipped));
+ machine().save().save_item(m_device, "tilemap", NULL, instance, NAME(m_enable));
+ machine().save().save_item(m_device, "tilemap", NULL, instance, NAME(m_attributes));
+ machine().save().save_item(m_device, "tilemap", NULL, instance, NAME(m_palette_offset));
+ machine().save().save_item(m_device, "tilemap", NULL, instance, NAME(m_scrollrows));
+ machine().save().save_item(m_device, "tilemap", NULL, instance, NAME(m_scrollcols));
+ machine().save().save_item(m_device, "tilemap", NULL, instance, NAME(m_rowscroll));
+ machine().save().save_item(m_device, "tilemap", NULL, instance, NAME(m_colscroll));
+ machine().save().save_item(m_device, "tilemap", NULL, instance, NAME(m_dx));
+ machine().save().save_item(m_device, "tilemap", NULL, instance, NAME(m_dx_flipped));
+ machine().save().save_item(m_device, "tilemap", NULL, instance, NAME(m_dy));
+ machine().save().save_item(m_device, "tilemap", NULL, instance, NAME(m_dy_flipped));
// reset everything after a load
machine().save().register_postload(save_prepost_delegate(FUNC(tilemap_t::postload), this));
diff --git a/src/emu/video/psx.c b/src/emu/video/psx.c
index 1c012c86b86..41cc1fbec29 100644
--- a/src/emu/video/psx.c
+++ b/src/emu/video/psx.c
@@ -568,7 +568,7 @@ void psxgpu_device::psx_gpu_init( int n_gputype )
}
// icky!!!
- machine().save().save_memory( "globals", NULL, 0, "m_packet", (UINT8 *)&m_packet, 1, sizeof( m_packet ) );
+ machine().save().save_memory( this, "globals", NULL, 0, "m_packet", (UINT8 *)&m_packet, 1, sizeof( m_packet ) );
save_pointer(NAME(p_vram), width * height );
save_item(NAME(n_gpu_buffer_offset));