Previous 199869 Revisions Next

r32325 Tuesday 23rd September, 2014 at 19:09:23 UTC by Fabio Priuli
(MESS) gb: call_load seems not to be a good moment for saving items,
at least if we want the system to play along with multisession runs. nw.
[src/emu/bus/gameboy]gb_slot.c gb_slot.h
[src/mess/machine]gb.c

trunk/src/emu/bus/gameboy/gb_slot.c
r32324r32325
6868void device_gb_cart_interface::ram_alloc(UINT32 size)
6969{
7070   m_ram.resize(size);
71   device().save_item(NAME(m_ram));
7271}
7372
7473
trunk/src/emu/bus/gameboy/gb_slot.h
r32324r32325
4141};
4242
4343
44// ======================> gb_cart_interface
45
46struct gb_cart_interface
47{
48};
49
50
5144// ======================> device_gb_cart_interface
5245
5346class device_gb_cart_interface : public device_slot_card_interface
r32324r32325
7871   void set_has_battery(bool val) { has_battery = val; }
7972   bool get_has_battery() { return has_battery; }
8073
74   void save_ram()   { device().save_item(NAME(m_ram)); }
75     
8176   // internal state
8277   dynamic_buffer m_rom;
8378   dynamic_buffer m_ram;
r32324r32325
10196// ======================> base_gb_cart_slot_device
10297
10398class base_gb_cart_slot_device : public device_t,
104                        public gb_cart_interface,
10599                        public device_image_interface,
106100                        public device_slot_interface
107101{
r32324r32325
127121
128122   void setup_ram(UINT8 banks);
129123   void internal_header_logging(UINT8 *ROM, UINT32 len);
130
124   void save_ram()   { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
125   
131126   virtual iodevice_t image_type() const { return IO_CARTSLOT; }
132127   virtual bool is_readable()  const { return 1; }
133128   virtual bool is_writeable() const { return 0; }
trunk/src/mess/machine/gb.c
r32324r32325
122122   save_item(NAME(m_reloading));
123123   save_item(NAME(m_sio_count));
124124   save_item(NAME(m_bios_disable));
125   if (m_cartslot)
126      m_cartslot->save_ram();
125127}
126128
127129void gb_state::save_gbc_only()

Previous 199869 Revisions Next


© 1997-2024 The MAME Team