mirror of
https://github.com/holub/mame
synced 2025-04-23 08:49:55 +03:00
(MESS) added a bunch of slot-related save registrations. nw.
This commit is contained in:
parent
83fb87b569
commit
151d278c45
@ -27,7 +27,7 @@ const device_type GB_CART_SLOT = &device_creator<gb_cart_slot_device>;
|
||||
const device_type MEGADUCK_CART_SLOT = &device_creator<megaduck_cart_slot_device>;
|
||||
|
||||
//**************************************************************************
|
||||
// MD cartridges Interface
|
||||
// GB cartridges Interface
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -76,6 +76,7 @@ void device_gb_cart_interface::ram_alloc(running_machine &machine, UINT32 size)
|
||||
{
|
||||
m_ram = auto_alloc_array_clear(machine, UINT8, size);
|
||||
m_ram_size = size;
|
||||
state_save_register_item_pointer(machine, "GB_CART", NULL, 0, m_ram, m_ram_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,6 +103,7 @@ void device_md_cart_interface::nvram_alloc(running_machine &machine, size_t size
|
||||
{
|
||||
m_nvram = auto_alloc_array_clear(machine, UINT16, size/sizeof(UINT16));
|
||||
m_nvram_size = size;
|
||||
state_save_register_item_pointer(machine, "MD_CART", NULL, 0, m_nvram, m_nvram_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,21 @@
|
||||
#include "machine/md_stm95.h"
|
||||
|
||||
|
||||
stm95_eeprom_device::stm95_eeprom_device(running_machine &machine, UINT8 *eeprom) :
|
||||
stm_state(IDLE),
|
||||
stream_pos(0),
|
||||
m_machine(machine)
|
||||
{
|
||||
eeprom_data = eeprom;
|
||||
state_save_register_item(machine, "STM95", NULL, 0, latch);
|
||||
state_save_register_item(machine, "STM95", NULL, 0, reset_line);
|
||||
state_save_register_item(machine, "STM95", NULL, 0, sck_line);
|
||||
state_save_register_item(machine, "STM95", NULL, 0, WEL);
|
||||
state_save_register_item(machine, "STM95", NULL, 0, stream_pos);
|
||||
state_save_register_item(machine, "STM95", NULL, 0, stream_data);
|
||||
state_save_register_item(machine, "STM95", NULL, 0, eeprom_addr);
|
||||
}
|
||||
|
||||
void stm95_eeprom_device::set_cs_line(int state)
|
||||
{
|
||||
reset_line = state;
|
||||
@ -177,11 +192,10 @@ md_eeprom_stm95_device::md_eeprom_stm95_device(const machine_config &mconfig, co
|
||||
void md_eeprom_stm95_device::device_start()
|
||||
{
|
||||
nvram_alloc(machine(), M95320_SIZE);
|
||||
m_stm95.eeprom_data = (UINT8*)get_nvram_base();
|
||||
m_stm95 = auto_alloc(machine(), stm95_eeprom_device(machine(), (UINT8*)get_nvram_base()));
|
||||
|
||||
save_item(NAME(m_rdcnt));
|
||||
save_item(NAME(m_bank));
|
||||
//TODO: save and restore the m_stm95...
|
||||
}
|
||||
|
||||
void md_eeprom_stm95_device::device_reset()
|
||||
@ -227,7 +241,7 @@ READ16_MEMBER(md_eeprom_stm95_device::read_a13)
|
||||
{
|
||||
if (offset == 0x0a/2)
|
||||
{
|
||||
return m_stm95.get_so_line() & 1;
|
||||
return m_stm95->get_so_line() & 1;
|
||||
}
|
||||
return 0xffff;
|
||||
}
|
||||
@ -244,9 +258,9 @@ WRITE16_MEMBER(md_eeprom_stm95_device::write_a13)
|
||||
}
|
||||
else if (offset < 0x0a/2)
|
||||
{
|
||||
m_stm95.set_si_line(BIT(data, 0));
|
||||
m_stm95.set_sck_line(BIT(data, 1));
|
||||
m_stm95.set_halt_line(BIT(data, 2));
|
||||
m_stm95.set_cs_line(BIT(data, 3));
|
||||
m_stm95->set_si_line(BIT(data, 0));
|
||||
m_stm95->set_sck_line(BIT(data, 1));
|
||||
m_stm95->set_halt_line(BIT(data, 2));
|
||||
m_stm95->set_cs_line(BIT(data, 3));
|
||||
}
|
||||
}
|
||||
|
@ -26,10 +26,8 @@ enum STMSTATE
|
||||
class stm95_eeprom_device
|
||||
{
|
||||
public:
|
||||
stm95_eeprom_device() :
|
||||
stm_state(IDLE),
|
||||
stream_pos(0)
|
||||
{};
|
||||
stm95_eeprom_device(running_machine &machine, UINT8 *eeprom);
|
||||
running_machine &machine() const { return m_machine; }
|
||||
|
||||
UINT8 *eeprom_data;
|
||||
void set_cs_line(int);
|
||||
@ -48,6 +46,8 @@ protected:
|
||||
int stream_pos;
|
||||
int stream_data;
|
||||
int eeprom_addr;
|
||||
|
||||
running_machine& m_machine;
|
||||
};
|
||||
|
||||
|
||||
@ -74,7 +74,7 @@ private:
|
||||
UINT8 m_bank[3];
|
||||
int m_rdcnt;
|
||||
|
||||
stm95_eeprom_device m_stm95;
|
||||
stm95_eeprom_device *m_stm95;
|
||||
};
|
||||
|
||||
|
||||
|
@ -384,13 +384,24 @@ void md_rom_svp_device::device_start()
|
||||
m_xst = 0;
|
||||
m_xst2 = 0;
|
||||
|
||||
/* SVP stuff */
|
||||
// SVP stuff
|
||||
// DRAM
|
||||
m_dram = auto_alloc_array(machine(), UINT8, 0x20000);
|
||||
// IRAM
|
||||
m_iram = auto_alloc_array(machine(), UINT8, 0x800);
|
||||
this->membank("iram_svp")->set_base(m_iram);
|
||||
// the other bank, "cart_svp", is setup at call_load
|
||||
|
||||
save_item(NAME(m_pmac_read));
|
||||
save_item(NAME(m_pmac_write));
|
||||
save_item(NAME(m_emu_status));
|
||||
save_item(NAME(m_xst));
|
||||
save_item(NAME(m_xst2));
|
||||
save_item(NAME(m_pmc.d));
|
||||
save_item(NAME(m_pmc.w.l));
|
||||
save_item(NAME(m_pmc.w.h));
|
||||
save_pointer(NAME(m_dram), 0x20000);
|
||||
save_pointer(NAME(m_iram), 0x800);
|
||||
}
|
||||
|
||||
READ16_MEMBER(md_rom_svp_device::read)
|
||||
|
@ -73,7 +73,6 @@ void sns_rom_bsx_device::device_start()
|
||||
save_item(NAME(access_60_6f));
|
||||
save_item(NAME(rom_access));
|
||||
save_item(NAME(m_pram));
|
||||
// TODO: save unit-related items and fix their restore...
|
||||
}
|
||||
|
||||
void sns_rom_bsx_device::device_reset()
|
||||
@ -117,6 +116,10 @@ void sns_rom_bsmempak_device::device_reset()
|
||||
BSX_base::BSX_base(running_machine &machine)
|
||||
: m_machine(machine)
|
||||
{
|
||||
state_save_register_item(machine, "SNES_BSX", NULL, 0, regs);
|
||||
state_save_register_item(machine, "SNES_BSX", NULL, 0, r2192_counter);
|
||||
state_save_register_item(machine, "SNES_BSX", NULL, 0, r2192_hour);
|
||||
state_save_register_item(machine, "SNES_BSX", NULL, 0, r2192_second);
|
||||
}
|
||||
|
||||
void BSX_base::init()
|
||||
|
@ -112,6 +112,7 @@ void device_sns_cart_interface::nvram_alloc(running_machine &machine, UINT32 siz
|
||||
{
|
||||
m_nvram = auto_alloc_array_clear(machine, UINT8, size);
|
||||
m_nvram_size = size;
|
||||
state_save_register_item_pointer(machine, "SNES_CART", NULL, 0, m_nvram, m_nvram_size);
|
||||
}
|
||||
}
|
||||
|
||||
@ -129,6 +130,7 @@ void device_sns_cart_interface::rtc_ram_alloc(running_machine &machine, UINT32 s
|
||||
{
|
||||
m_rtc_ram = auto_alloc_array_clear(machine, UINT8, size);
|
||||
m_rtc_ram_size = size;
|
||||
state_save_register_item_pointer(machine, "SNES_CART", NULL, 0, m_rtc_ram, m_rtc_ram_size);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user