mirror of
https://github.com/holub/mame
synced 2025-06-06 04:43:45 +03:00
sg1000.cpp, sms.cpp & associated buses: Simplify handler signatures (nw)
This commit is contained in:
parent
b2991c51fe
commit
b68afeeac4
@ -33,15 +33,15 @@ sega8_cardcatch_device::sega8_cardcatch_device(const machine_config &mconfig, co
|
||||
mapper specific handlers
|
||||
-------------------------------------------------*/
|
||||
|
||||
READ8_MEMBER(sega8_cardcatch_device::read_cart)
|
||||
uint8_t sega8_cardcatch_device::read_cart(offs_t offset)
|
||||
{
|
||||
if (offset < 0x8000)
|
||||
return m_card->read_cart(space, offset);
|
||||
return m_card->read_cart(offset);
|
||||
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_cardcatch_device::write_cart)
|
||||
void sega8_cardcatch_device::write_cart(offs_t offset, uint8_t data)
|
||||
{
|
||||
// this should never happen, because there is no RAM on cards
|
||||
if (offset < 0x8000)
|
||||
|
@ -17,9 +17,9 @@ public:
|
||||
sega8_cardcatch_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_mapper) override {}
|
||||
virtual uint8_t read_cart(offs_t offset) override;
|
||||
virtual void write_cart(offs_t offset, uint8_t data) override;
|
||||
virtual void write_mapper(offs_t offset, uint8_t data) override {}
|
||||
|
||||
protected:
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
@ -18,9 +18,9 @@ public:
|
||||
sega8_mgear_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_cart) override { return m_subslot->read_cart(space, offset); }
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart) override { m_subslot->write_cart(space, offset, data); }
|
||||
virtual DECLARE_WRITE8_MEMBER(write_mapper) override { m_subslot->write_mapper(space, offset, data); }
|
||||
virtual uint8_t read_cart(offs_t offset) override { return m_subslot->read_cart(offset); }
|
||||
virtual void write_cart(offs_t offset, uint8_t data) override { m_subslot->write_cart(offset, data); }
|
||||
virtual void write_mapper(offs_t offset, uint8_t data) override { m_subslot->write_mapper(offset, data); }
|
||||
virtual int get_lphaser_xoffs() override { return m_subslot->get_lphaser_xoffs(); }
|
||||
|
||||
protected:
|
||||
|
@ -383,7 +383,7 @@ void sega8_korean_device::late_bank_setup()
|
||||
|
||||
-------------------------------------------------*/
|
||||
|
||||
READ8_MEMBER(sega8_rom_device::read_cart)
|
||||
uint8_t sega8_rom_device::read_cart(offs_t offset)
|
||||
{
|
||||
int bank = offset / 0x4000;
|
||||
|
||||
@ -396,7 +396,7 @@ READ8_MEMBER(sega8_rom_device::read_cart)
|
||||
return m_rom[m_rom_bank_base[bank] * 0x4000 + (offset & 0x3fff)];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_rom_device::write_cart)
|
||||
void sega8_rom_device::write_cart(offs_t offset, uint8_t data)
|
||||
{
|
||||
int bank = offset / 0x4000;
|
||||
|
||||
@ -404,7 +404,7 @@ WRITE8_MEMBER(sega8_rom_device::write_cart)
|
||||
m_ram[(m_ram_base * 0x4000 + (offset & 0x3fff)) % m_ram.size()] = data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_rom_device::write_mapper)
|
||||
void sega8_rom_device::write_mapper(offs_t offset, uint8_t data)
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
@ -439,7 +439,7 @@ WRITE8_MEMBER(sega8_rom_device::write_mapper)
|
||||
|
||||
-------------------------------------------------*/
|
||||
|
||||
READ8_MEMBER(sega8_othello_device::read_cart)
|
||||
uint8_t sega8_othello_device::read_cart(offs_t offset)
|
||||
{
|
||||
// 8K of RAM sits in 0x8000-0x9fff
|
||||
if (offset >= 0x8000 && offset < 0xa000)
|
||||
@ -448,7 +448,7 @@ READ8_MEMBER(sega8_othello_device::read_cart)
|
||||
return m_rom[offset % m_rom_size];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_othello_device::write_cart)
|
||||
void sega8_othello_device::write_cart(offs_t offset, uint8_t data)
|
||||
{
|
||||
// 2K of RAM sits in 0x8000-0x9fff
|
||||
if (offset >= 0x8000 && offset < 0xa000)
|
||||
@ -463,7 +463,7 @@ WRITE8_MEMBER(sega8_othello_device::write_cart)
|
||||
|
||||
-------------------------------------------------*/
|
||||
|
||||
READ8_MEMBER(sega8_castle_device::read_cart)
|
||||
uint8_t sega8_castle_device::read_cart(offs_t offset)
|
||||
{
|
||||
// 8K of RAM sits in 0x8000-0x9fff
|
||||
if (offset >= 0x8000 && offset < 0xa000)
|
||||
@ -472,7 +472,7 @@ READ8_MEMBER(sega8_castle_device::read_cart)
|
||||
return m_rom[offset % m_rom_size];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_castle_device::write_cart)
|
||||
void sega8_castle_device::write_cart(offs_t offset, uint8_t data)
|
||||
{
|
||||
// 8K of RAM sits in 0x8000-0x9fff
|
||||
if (offset >= 0x8000 && offset < 0xa000)
|
||||
@ -487,7 +487,7 @@ WRITE8_MEMBER(sega8_castle_device::write_cart)
|
||||
|
||||
-------------------------------------------------*/
|
||||
|
||||
READ8_MEMBER(sega8_basic_l3_device::read_cart)
|
||||
uint8_t sega8_basic_l3_device::read_cart(offs_t offset)
|
||||
{
|
||||
// 8K of RAM sits in 0x8000-0x9fff
|
||||
if (offset >= 0x8000)
|
||||
@ -496,19 +496,19 @@ READ8_MEMBER(sega8_basic_l3_device::read_cart)
|
||||
return m_rom[offset % m_rom_size];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_basic_l3_device::write_cart)
|
||||
void sega8_basic_l3_device::write_cart(offs_t offset, uint8_t data)
|
||||
{
|
||||
// 8K of RAM sits in 0x8000-0x9fff
|
||||
if (offset >= 0x8000)
|
||||
m_ram[offset & 0x3fff] = data;
|
||||
}
|
||||
|
||||
READ8_MEMBER(sega8_basic_l3_device::read_ram)
|
||||
uint8_t sega8_basic_l3_device::read_ram(offs_t offset)
|
||||
{
|
||||
return m_ram[0x4000 + (offset & 0x3fff)];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_basic_l3_device::write_ram)
|
||||
void sega8_basic_l3_device::write_ram(offs_t offset, uint8_t data)
|
||||
{
|
||||
m_ram[0x4000 + (offset & 0x3fff)] = data;
|
||||
}
|
||||
@ -521,7 +521,7 @@ WRITE8_MEMBER(sega8_basic_l3_device::write_ram)
|
||||
|
||||
-------------------------------------------------*/
|
||||
|
||||
READ8_MEMBER(sega8_music_editor_device::read_cart)
|
||||
uint8_t sega8_music_editor_device::read_cart(offs_t offset)
|
||||
{
|
||||
// 8K of RAM sits in 0x8000-0x9fff
|
||||
if (offset >= 0x8000 && offset < 0xa000)
|
||||
@ -530,21 +530,21 @@ READ8_MEMBER(sega8_music_editor_device::read_cart)
|
||||
return m_rom[offset % m_rom_size];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_music_editor_device::write_cart)
|
||||
void sega8_music_editor_device::write_cart(offs_t offset, uint8_t data)
|
||||
{
|
||||
// 8K of RAM sits in 0x8000-0x9fff
|
||||
if (offset >= 0x8000 && offset < 0xa000)
|
||||
m_ram[offset & 0x1fff] = data;
|
||||
}
|
||||
|
||||
READ8_MEMBER(sega8_music_editor_device::read_ram)
|
||||
uint8_t sega8_music_editor_device::read_ram(offs_t offset)
|
||||
{
|
||||
// 2K more of RAM sits in 0xc000-0xc3ff (and mirrored up to 0xffff)
|
||||
// or should it simply go to the 2K of SC3000 RAM???
|
||||
return m_ram[0x2000 + (offset & 0x7ff)];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_music_editor_device::write_ram)
|
||||
void sega8_music_editor_device::write_ram(offs_t offset, uint8_t data)
|
||||
{
|
||||
// 2K more of RAM sits in 0xc000-0xc3ff (and mirrored up to 0xffff)
|
||||
// or should it simply go to the 2K of SC3000 RAM???
|
||||
@ -576,7 +576,7 @@ WRITE8_MEMBER(sega8_music_editor_device::write_ram)
|
||||
*/
|
||||
|
||||
|
||||
READ8_MEMBER(sega8_terebi_device::read_cart)
|
||||
uint8_t sega8_terebi_device::read_cart(offs_t offset)
|
||||
{
|
||||
int bank = offset / 0x4000;
|
||||
|
||||
@ -588,7 +588,7 @@ READ8_MEMBER(sega8_terebi_device::read_cart)
|
||||
return m_rom[m_rom_bank_base[bank] * 0x4000 + (offset & 0x3fff)];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_terebi_device::write_cart)
|
||||
void sega8_terebi_device::write_cart(offs_t offset, uint8_t data)
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
@ -640,7 +640,7 @@ ioport_constructor sega8_terebi_device::device_input_ports() const
|
||||
-------------------------------------------------*/
|
||||
|
||||
// TYPE A
|
||||
READ8_MEMBER(sega8_dahjee_typea_device::read_cart)
|
||||
uint8_t sega8_dahjee_typea_device::read_cart(offs_t offset)
|
||||
{
|
||||
// 8K of RAM sits in 0x2000-0x3fff
|
||||
if (offset >= 0x2000 && offset < 0x4000)
|
||||
@ -649,21 +649,21 @@ READ8_MEMBER(sega8_dahjee_typea_device::read_cart)
|
||||
return m_rom[offset % m_rom_size];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_dahjee_typea_device::write_cart)
|
||||
void sega8_dahjee_typea_device::write_cart(offs_t offset, uint8_t data)
|
||||
{
|
||||
// 8K of RAM sits in 0x2000-0x3fff
|
||||
if (offset >= 0x2000 && offset < 0x4000)
|
||||
m_ram[offset & 0x1fff] = data;
|
||||
}
|
||||
|
||||
READ8_MEMBER(sega8_dahjee_typea_device::read_ram)
|
||||
uint8_t sega8_dahjee_typea_device::read_ram(offs_t offset)
|
||||
{
|
||||
// 1K more of RAM sits in 0xc000-0xc3ff (and mirrored up to 0xffff
|
||||
// or should it simply go to the 1K of SG1000 RAM???
|
||||
return m_ram[0x2000 + (offset & 0x3ff)];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_dahjee_typea_device::write_ram)
|
||||
void sega8_dahjee_typea_device::write_ram(offs_t offset, uint8_t data)
|
||||
{
|
||||
// 1K more of RAM sits in 0xc000-0xc3ff (and mirrored up to 0xffff
|
||||
// or should it simply go to the 1K of SG1000 RAM???
|
||||
@ -672,18 +672,18 @@ WRITE8_MEMBER(sega8_dahjee_typea_device::write_ram)
|
||||
|
||||
|
||||
// TYPE B
|
||||
READ8_MEMBER(sega8_dahjee_typeb_device::read_cart)
|
||||
uint8_t sega8_dahjee_typeb_device::read_cart(offs_t offset)
|
||||
{
|
||||
return m_rom[offset % m_rom_size];
|
||||
}
|
||||
|
||||
READ8_MEMBER(sega8_dahjee_typeb_device::read_ram)
|
||||
uint8_t sega8_dahjee_typeb_device::read_ram(offs_t offset)
|
||||
{
|
||||
// 8K more of RAM sits in 0xc000-0xffff
|
||||
return m_ram[offset & 0x1fff];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_dahjee_typeb_device::write_ram)
|
||||
void sega8_dahjee_typeb_device::write_ram(offs_t offset, uint8_t data)
|
||||
{
|
||||
// 8K more of RAM sits in 0xc000-0xffff
|
||||
m_ram[offset & 0x1fff] = data;
|
||||
@ -700,7 +700,7 @@ WRITE8_MEMBER(sega8_dahjee_typeb_device::write_ram)
|
||||
-------------------------------------------------*/
|
||||
|
||||
|
||||
READ8_MEMBER(sega8_eeprom_device::read_cart)
|
||||
uint8_t sega8_eeprom_device::read_cart(offs_t offset)
|
||||
{
|
||||
int bank = offset / 0x4000;
|
||||
|
||||
@ -717,7 +717,7 @@ READ8_MEMBER(sega8_eeprom_device::read_cart)
|
||||
return m_rom[m_rom_bank_base[bank] * 0x4000 + (offset & 0x3fff)];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_eeprom_device::write_cart)
|
||||
void sega8_eeprom_device::write_cart(offs_t offset, uint8_t data)
|
||||
{
|
||||
if (offset == 0x8000 && m_93c46_enabled)
|
||||
{
|
||||
@ -728,7 +728,7 @@ WRITE8_MEMBER(sega8_eeprom_device::write_cart)
|
||||
}
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_eeprom_device::write_mapper)
|
||||
void sega8_eeprom_device::write_mapper(offs_t offset, uint8_t data)
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
@ -764,7 +764,7 @@ void sega8_eeprom_device::device_add_mconfig(machine_config &config)
|
||||
|
||||
-------------------------------------------------*/
|
||||
|
||||
READ8_MEMBER(sega8_codemasters_device::read_cart)
|
||||
uint8_t sega8_codemasters_device::read_cart(offs_t offset)
|
||||
{
|
||||
int bank = offset / 0x2000;
|
||||
|
||||
@ -774,7 +774,7 @@ READ8_MEMBER(sega8_codemasters_device::read_cart)
|
||||
return m_rom[m_rom_bank_base[bank/2] * 0x4000 + (offset & 0x3fff)];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_codemasters_device::write_cart)
|
||||
void sega8_codemasters_device::write_cart(offs_t offset, uint8_t data)
|
||||
{
|
||||
int bank = offset / 0x2000;
|
||||
|
||||
@ -811,7 +811,7 @@ WRITE8_MEMBER(sega8_codemasters_device::write_cart)
|
||||
-------------------------------------------------*/
|
||||
|
||||
|
||||
READ8_MEMBER(sega8_4pak_device::read_cart)
|
||||
uint8_t sega8_4pak_device::read_cart(offs_t offset)
|
||||
{
|
||||
int bank = offset / 0x4000;
|
||||
|
||||
@ -819,7 +819,7 @@ READ8_MEMBER(sega8_4pak_device::read_cart)
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(sega8_4pak_device::write_cart)
|
||||
void sega8_4pak_device::write_cart(offs_t offset, uint8_t data)
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
@ -846,7 +846,7 @@ WRITE8_MEMBER(sega8_4pak_device::write_cart)
|
||||
|
||||
-------------------------------------------------*/
|
||||
|
||||
READ8_MEMBER(sega8_zemina_device::read_cart)
|
||||
uint8_t sega8_zemina_device::read_cart(offs_t offset)
|
||||
{
|
||||
int bank = offset / 0x2000;
|
||||
|
||||
@ -856,7 +856,7 @@ READ8_MEMBER(sega8_zemina_device::read_cart)
|
||||
return m_rom[m_rom_bank_base[bank] * 0x2000 + (offset & 0x1fff)];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_zemina_device::write_cart)
|
||||
void sega8_zemina_device::write_cart(offs_t offset, uint8_t data)
|
||||
{
|
||||
int bank = offset / 0x2000;
|
||||
|
||||
@ -902,7 +902,7 @@ WRITE8_MEMBER(sega8_zemina_device::write_cart)
|
||||
|
||||
-------------------------------------------------*/
|
||||
|
||||
READ8_MEMBER(sega8_janggun_device::read_cart)
|
||||
uint8_t sega8_janggun_device::read_cart(offs_t offset)
|
||||
{
|
||||
int bank = offset / 0x2000;
|
||||
|
||||
@ -913,7 +913,7 @@ READ8_MEMBER(sega8_janggun_device::read_cart)
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(sega8_janggun_device::write_cart)
|
||||
void sega8_janggun_device::write_cart(offs_t offset, uint8_t data)
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
@ -932,7 +932,7 @@ WRITE8_MEMBER(sega8_janggun_device::write_cart)
|
||||
}
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_janggun_device::write_mapper)
|
||||
void sega8_janggun_device::write_mapper(offs_t offset, uint8_t data)
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
@ -956,7 +956,7 @@ WRITE8_MEMBER(sega8_janggun_device::write_mapper)
|
||||
|
||||
-------------------------------------------------*/
|
||||
|
||||
READ8_MEMBER(sega8_hicom_device::read_cart)
|
||||
uint8_t sega8_hicom_device::read_cart(offs_t offset)
|
||||
{
|
||||
if (offset >= 0x8000)
|
||||
return m_rom[offset & 0x3fff];
|
||||
@ -964,7 +964,7 @@ READ8_MEMBER(sega8_hicom_device::read_cart)
|
||||
return m_rom[(m_rom_bank_base * 0x8000) + offset];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_hicom_device::write_mapper)
|
||||
void sega8_hicom_device::write_mapper(offs_t offset, uint8_t data)
|
||||
{
|
||||
if (offset == 0x03)
|
||||
m_rom_bank_base = data % (m_rom_page_count << 1);
|
||||
@ -977,7 +977,7 @@ WRITE8_MEMBER(sega8_hicom_device::write_mapper)
|
||||
|
||||
-------------------------------------------------*/
|
||||
|
||||
WRITE8_MEMBER(sega8_korean_device::write_cart)
|
||||
void sega8_korean_device::write_cart(offs_t offset, uint8_t data)
|
||||
{
|
||||
int bank = offset / 0x4000;
|
||||
|
||||
@ -1012,7 +1012,7 @@ void sega8_seojin_device::device_reset()
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(sega8_seojin_device::read_cart)
|
||||
uint8_t sega8_seojin_device::read_cart(offs_t offset)
|
||||
{
|
||||
int bank = offset / 0x4000;
|
||||
|
||||
@ -1024,11 +1024,11 @@ READ8_MEMBER(sega8_seojin_device::read_cart)
|
||||
return m_rom[bank_to_use * 0x4000 + (offset & 0x3fff)]^m_readxor;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_seojin_device::write_cart)
|
||||
void sega8_seojin_device::write_cart(offs_t offset, uint8_t data)
|
||||
{
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_seojin_device::write_mapper)
|
||||
void sega8_seojin_device::write_mapper(offs_t offset, uint8_t data)
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
@ -1045,7 +1045,7 @@ WRITE8_MEMBER(sega8_seojin_device::write_mapper)
|
||||
|
||||
// it might not have RAM inside, but the only way to get 0xfff0 to fall through to the cart with the current hook-up
|
||||
// is by saying there is.
|
||||
WRITE8_MEMBER(sega8_seojin_device::write_ram)
|
||||
void sega8_seojin_device::write_ram(offs_t offset, uint8_t data)
|
||||
{
|
||||
m_ram[offset & 0x3fff] = data;
|
||||
|
||||
@ -1055,7 +1055,7 @@ WRITE8_MEMBER(sega8_seojin_device::write_ram)
|
||||
}
|
||||
}
|
||||
|
||||
READ8_MEMBER(sega8_seojin_device::read_ram)
|
||||
uint8_t sega8_seojin_device::read_ram(offs_t offset)
|
||||
{
|
||||
return m_ram[offset & 0x3fff];
|
||||
}
|
||||
@ -1066,7 +1066,7 @@ READ8_MEMBER(sega8_seojin_device::read_ram)
|
||||
|
||||
-------------------------------------------------*/
|
||||
|
||||
READ8_MEMBER(sega8_multicart_device::read_cart)
|
||||
uint8_t sega8_multicart_device::read_cart(offs_t offset)
|
||||
{
|
||||
// 16K of RAM sits in 0x8000-0xbfff
|
||||
if (offset >= 0x8000)
|
||||
@ -1075,24 +1075,24 @@ READ8_MEMBER(sega8_multicart_device::read_cart)
|
||||
return m_rom[(offset & 0x7fff) | (m_block << 15) % m_rom_size];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_multicart_device::write_cart)
|
||||
void sega8_multicart_device::write_cart(offs_t offset, uint8_t data)
|
||||
{
|
||||
// 16K of RAM sits in 0x8000-0xbfff
|
||||
if (offset >= 0x8000)
|
||||
m_ram[offset & 0x3fff] = data;
|
||||
}
|
||||
|
||||
READ8_MEMBER(sega8_multicart_device::read_ram)
|
||||
uint8_t sega8_multicart_device::read_ram(offs_t offset)
|
||||
{
|
||||
return m_ram[0x4000 + (offset & 0x3fff)];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_multicart_device::write_ram)
|
||||
void sega8_multicart_device::write_ram(offs_t offset, uint8_t data)
|
||||
{
|
||||
m_ram[0x4000 + (offset & 0x3fff)] = data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_multicart_device::write_io)
|
||||
void sega8_multicart_device::write_io(offs_t offset, uint8_t data)
|
||||
{
|
||||
if ((offset & 0xe0) == 0xe0)
|
||||
m_block = (data & 0x80) ? ((data & 0x1f) | ((data & 0x40) ? 0x20 : 0x00)) : 0x3f;
|
||||
@ -1104,7 +1104,7 @@ WRITE8_MEMBER(sega8_multicart_device::write_io)
|
||||
|
||||
-------------------------------------------------*/
|
||||
|
||||
READ8_MEMBER(sega8_megacart_device::read_cart)
|
||||
uint8_t sega8_megacart_device::read_cart(offs_t offset)
|
||||
{
|
||||
// 16K of RAM sits in 0x8000-0xbfff
|
||||
if (offset >= 0x8000)
|
||||
@ -1113,24 +1113,24 @@ READ8_MEMBER(sega8_megacart_device::read_cart)
|
||||
return m_rom[(offset & 0x7fff) | (m_block << 15) % m_rom_size];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_megacart_device::write_cart)
|
||||
void sega8_megacart_device::write_cart(offs_t offset, uint8_t data)
|
||||
{
|
||||
// 16K of RAM sits in 0x8000-0xbfff
|
||||
if (offset >= 0x8000)
|
||||
m_ram[offset & 0x3fff] = data;
|
||||
}
|
||||
|
||||
READ8_MEMBER(sega8_megacart_device::read_ram)
|
||||
uint8_t sega8_megacart_device::read_ram(offs_t offset)
|
||||
{
|
||||
return m_ram[0x4000 + (offset & 0x3fff)];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_megacart_device::write_ram)
|
||||
void sega8_megacart_device::write_ram(offs_t offset, uint8_t data)
|
||||
{
|
||||
m_ram[0x4000 + (offset & 0x3fff)] = data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_megacart_device::write_io)
|
||||
void sega8_megacart_device::write_io(offs_t offset, uint8_t data)
|
||||
{
|
||||
if ((offset & 0xe0) == 0xe0)
|
||||
m_block = (data & 0x1f) | (data & 0xc0) >> 1;
|
||||
|
@ -20,9 +20,9 @@ public:
|
||||
virtual void late_bank_setup() override;
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_mapper) override;
|
||||
virtual uint8_t read_cart(offs_t offset) override;
|
||||
virtual void write_cart(offs_t offset, uint8_t data) override;
|
||||
virtual void write_mapper(offs_t offset, uint8_t data) override;
|
||||
|
||||
protected:
|
||||
sega8_rom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
@ -48,9 +48,9 @@ public:
|
||||
sega8_othello_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_mapper) override { }
|
||||
virtual uint8_t read_cart(offs_t offset) override;
|
||||
virtual void write_cart(offs_t offset, uint8_t data) override;
|
||||
virtual void write_mapper(offs_t offset, uint8_t data) override { }
|
||||
};
|
||||
|
||||
|
||||
@ -63,9 +63,9 @@ public:
|
||||
sega8_castle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_mapper) override { }
|
||||
virtual uint8_t read_cart(offs_t offset) override;
|
||||
virtual void write_cart(offs_t offset, uint8_t data) override;
|
||||
virtual void write_mapper(offs_t offset, uint8_t data) override { }
|
||||
};
|
||||
|
||||
|
||||
@ -78,13 +78,13 @@ public:
|
||||
sega8_basic_l3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_mapper) override { }
|
||||
virtual uint8_t read_cart(offs_t offset) override;
|
||||
virtual void write_cart(offs_t offset, uint8_t data) override;
|
||||
virtual void write_mapper(offs_t offset, uint8_t data) override { }
|
||||
|
||||
// has internal RAM which overwrites the system one!
|
||||
virtual DECLARE_READ8_MEMBER(read_ram) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_ram) override;
|
||||
virtual uint8_t read_ram(offs_t offset) override;
|
||||
virtual void write_ram(offs_t offset, uint8_t data) override;
|
||||
};
|
||||
|
||||
|
||||
@ -97,13 +97,13 @@ public:
|
||||
sega8_music_editor_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_mapper) override { }
|
||||
virtual uint8_t read_cart(offs_t offset) override;
|
||||
virtual void write_cart(offs_t offset, uint8_t data) override;
|
||||
virtual void write_mapper(offs_t offset, uint8_t data) override { }
|
||||
|
||||
// has internal RAM which overwrites the system one!
|
||||
virtual DECLARE_READ8_MEMBER(read_ram) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_ram) override;
|
||||
virtual uint8_t read_ram(offs_t offset) override;
|
||||
virtual void write_ram(offs_t offset, uint8_t data) override;
|
||||
};
|
||||
|
||||
|
||||
@ -123,9 +123,9 @@ public:
|
||||
required_ioport m_tvdraw_pen;
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_mapper) override { }
|
||||
virtual uint8_t read_cart(offs_t offset) override;
|
||||
virtual void write_cart(offs_t offset, uint8_t data) override;
|
||||
virtual void write_mapper(offs_t offset, uint8_t data) override { }
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
@ -144,13 +144,13 @@ public:
|
||||
sega8_dahjee_typea_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_mapper) override { }
|
||||
virtual uint8_t read_cart(offs_t offset) override;
|
||||
virtual void write_cart(offs_t offset, uint8_t data) override;
|
||||
virtual void write_mapper(offs_t offset, uint8_t data) override { }
|
||||
|
||||
// has internal RAM which overwrites the system one!
|
||||
virtual DECLARE_READ8_MEMBER(read_ram) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_ram) override;
|
||||
virtual uint8_t read_ram(offs_t offset) override;
|
||||
virtual void write_ram(offs_t offset, uint8_t data) override;
|
||||
};
|
||||
|
||||
|
||||
@ -163,13 +163,13 @@ public:
|
||||
sega8_dahjee_typeb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart) override { }
|
||||
virtual DECLARE_WRITE8_MEMBER(write_mapper) override { }
|
||||
virtual uint8_t read_cart(offs_t offset) override;
|
||||
virtual void write_cart(offs_t offset, uint8_t data) override { }
|
||||
virtual void write_mapper(offs_t offset, uint8_t data) override { }
|
||||
|
||||
// has internal RAM which overwrites the system one!
|
||||
virtual DECLARE_READ8_MEMBER(read_ram) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_ram) override;
|
||||
virtual uint8_t read_ram(offs_t offset) override;
|
||||
virtual void write_ram(offs_t offset, uint8_t data) override;
|
||||
};
|
||||
|
||||
|
||||
@ -187,9 +187,9 @@ public:
|
||||
virtual void late_bank_setup() override;
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_mapper) override;
|
||||
virtual uint8_t read_cart(offs_t offset) override;
|
||||
virtual void write_cart(offs_t offset, uint8_t data) override;
|
||||
virtual void write_mapper(offs_t offset, uint8_t data) override;
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
@ -218,8 +218,8 @@ public:
|
||||
virtual void late_bank_setup() override;
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart) override;
|
||||
virtual uint8_t read_cart(offs_t offset) override;
|
||||
virtual void write_cart(offs_t offset, uint8_t data) override;
|
||||
// no mapper write for this!
|
||||
|
||||
protected:
|
||||
@ -242,8 +242,8 @@ public:
|
||||
sega8_4pak_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart) override;
|
||||
virtual uint8_t read_cart(offs_t offset) override;
|
||||
virtual void write_cart(offs_t offset, uint8_t data) override;
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
@ -267,8 +267,8 @@ public:
|
||||
virtual void late_bank_setup() override;
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart) override;
|
||||
virtual uint8_t read_cart(offs_t offset) override;
|
||||
virtual void write_cart(offs_t offset, uint8_t data) override;
|
||||
// no mapper write for this!
|
||||
|
||||
protected:
|
||||
@ -308,9 +308,9 @@ public:
|
||||
virtual void late_bank_setup() override;
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_mapper) override;
|
||||
virtual uint8_t read_cart(offs_t offset) override;
|
||||
virtual void write_cart(offs_t offset, uint8_t data) override;
|
||||
virtual void write_mapper(offs_t offset, uint8_t data) override;
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
@ -331,9 +331,9 @@ public:
|
||||
virtual void late_bank_setup() override;
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart) override {}
|
||||
virtual DECLARE_WRITE8_MEMBER(write_mapper) override;
|
||||
virtual uint8_t read_cart(offs_t offset) override;
|
||||
virtual void write_cart(offs_t offset, uint8_t data) override {}
|
||||
virtual void write_mapper(offs_t offset, uint8_t data) override;
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
@ -354,8 +354,8 @@ public:
|
||||
virtual void late_bank_setup() override;
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_mapper) override {}
|
||||
virtual void write_cart(offs_t offset, uint8_t data) override;
|
||||
virtual void write_mapper(offs_t offset, uint8_t data) override {}
|
||||
};
|
||||
|
||||
|
||||
@ -368,7 +368,7 @@ public:
|
||||
sega8_korean_nb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_WRITE8_MEMBER(write_mapper) override {}
|
||||
virtual void write_mapper(offs_t offset, uint8_t data) override {}
|
||||
};
|
||||
|
||||
|
||||
@ -381,11 +381,11 @@ public:
|
||||
sega8_seojin_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_mapper) override;
|
||||
virtual DECLARE_READ8_MEMBER(read_ram) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_ram) override;
|
||||
virtual uint8_t read_cart(offs_t offset) override;
|
||||
virtual void write_cart(offs_t offset, uint8_t data) override;
|
||||
virtual void write_mapper(offs_t offset, uint8_t data) override;
|
||||
virtual uint8_t read_ram(offs_t offset) override;
|
||||
virtual void write_ram(offs_t offset, uint8_t data) override;
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
@ -406,13 +406,13 @@ public:
|
||||
sega8_multicart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_io) override;
|
||||
virtual uint8_t read_cart(offs_t offset) override;
|
||||
virtual void write_cart(offs_t offset, uint8_t data) override;
|
||||
virtual void write_io(offs_t offset, uint8_t data) override;
|
||||
|
||||
// has internal RAM which overwrites the system one!
|
||||
virtual DECLARE_READ8_MEMBER(read_ram) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_ram) override;
|
||||
virtual uint8_t read_ram(offs_t offset) override;
|
||||
virtual void write_ram(offs_t offset, uint8_t data) override;
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
@ -433,13 +433,13 @@ public:
|
||||
sega8_megacart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_io) override;
|
||||
virtual uint8_t read_cart(offs_t offset) override;
|
||||
virtual void write_cart(offs_t offset, uint8_t data) override;
|
||||
virtual void write_io(offs_t offset, uint8_t data) override;
|
||||
|
||||
// has internal RAM which overwrites the system one!
|
||||
virtual DECLARE_READ8_MEMBER(read_ram) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_ram) override;
|
||||
virtual uint8_t read_ram(offs_t offset) override;
|
||||
virtual void write_ram(offs_t offset, uint8_t data) override;
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
|
@ -685,26 +685,26 @@ std::string sega8_cart_slot_device::get_default_card_software(get_default_card_s
|
||||
read
|
||||
-------------------------------------------------*/
|
||||
|
||||
READ8_MEMBER(sega8_cart_slot_device::read_cart)
|
||||
uint8_t sega8_cart_slot_device::read_cart(offs_t offset)
|
||||
{
|
||||
if (m_cart)
|
||||
return m_cart->read_cart(space, offset);
|
||||
return m_cart->read_cart(offset);
|
||||
else
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
READ8_MEMBER(sega8_cart_slot_device::read_ram)
|
||||
uint8_t sega8_cart_slot_device::read_ram(offs_t offset)
|
||||
{
|
||||
if (m_cart)
|
||||
return m_cart->read_ram(space, offset);
|
||||
return m_cart->read_ram(offset);
|
||||
else
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
READ8_MEMBER(sega8_cart_slot_device::read_io)
|
||||
uint8_t sega8_cart_slot_device::read_io(offs_t offset)
|
||||
{
|
||||
if (m_cart)
|
||||
return m_cart->read_io(space, offset);
|
||||
return m_cart->read_io(offset);
|
||||
else
|
||||
return 0xff;
|
||||
}
|
||||
@ -714,28 +714,28 @@ READ8_MEMBER(sega8_cart_slot_device::read_io)
|
||||
write
|
||||
-------------------------------------------------*/
|
||||
|
||||
WRITE8_MEMBER(sega8_cart_slot_device::write_mapper)
|
||||
void sega8_cart_slot_device::write_mapper(offs_t offset, uint8_t data)
|
||||
{
|
||||
if (m_cart)
|
||||
m_cart->write_mapper(space, offset, data);
|
||||
m_cart->write_mapper(offset, data);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_cart_slot_device::write_cart)
|
||||
void sega8_cart_slot_device::write_cart(offs_t offset, uint8_t data)
|
||||
{
|
||||
if (m_cart)
|
||||
m_cart->write_cart(space, offset, data);
|
||||
m_cart->write_cart(offset, data);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_cart_slot_device::write_ram)
|
||||
void sega8_cart_slot_device::write_ram(offs_t offset, uint8_t data)
|
||||
{
|
||||
if (m_cart)
|
||||
m_cart->write_ram(space, offset, data);
|
||||
m_cart->write_ram(offset, data);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sega8_cart_slot_device::write_io)
|
||||
void sega8_cart_slot_device::write_io(offs_t offset, uint8_t data)
|
||||
{
|
||||
if (m_cart)
|
||||
m_cart->write_io(space, offset, data);
|
||||
m_cart->write_io(offset, data);
|
||||
}
|
||||
|
||||
|
||||
|
@ -51,16 +51,16 @@ public:
|
||||
virtual ~device_sega8_cart_interface();
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_cart) { return 0xff; }
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart) { }
|
||||
virtual DECLARE_WRITE8_MEMBER(write_mapper) { }
|
||||
virtual uint8_t read_cart(offs_t offset) { return 0xff; }
|
||||
virtual void write_cart(offs_t offset, uint8_t data) { }
|
||||
virtual void write_mapper(offs_t offset, uint8_t data) { }
|
||||
virtual int get_lphaser_xoffs() { return m_lphaser_xoffs; }
|
||||
// a few carts (for SG1000) acts as a RAM expansion, taking control of the system RAM in 0xc000-0xffff
|
||||
virtual DECLARE_READ8_MEMBER(read_ram) { return 0xff; }
|
||||
virtual DECLARE_WRITE8_MEMBER(write_ram) { }
|
||||
virtual uint8_t read_ram(offs_t offset) { return 0xff; }
|
||||
virtual void write_ram(offs_t offset, uint8_t data) { }
|
||||
// the SC3000 has I/OR, I/OW lines connected
|
||||
virtual DECLARE_READ8_MEMBER(read_io) { return 0xff; }
|
||||
virtual DECLARE_WRITE8_MEMBER(write_io) { }
|
||||
virtual uint8_t read_io(offs_t offset) { return 0xff; }
|
||||
virtual void write_io(offs_t offset, uint8_t data) { }
|
||||
|
||||
void rom_alloc(uint32_t size, const char *tag);
|
||||
void ram_alloc(uint32_t size);
|
||||
@ -143,13 +143,13 @@ public:
|
||||
void save_ram() { if (m_cart && m_cart->get_ram_size()) m_cart->save_ram(); }
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read_cart);
|
||||
virtual DECLARE_WRITE8_MEMBER(write_cart);
|
||||
virtual DECLARE_WRITE8_MEMBER(write_mapper);
|
||||
virtual DECLARE_READ8_MEMBER(read_ram);
|
||||
virtual DECLARE_WRITE8_MEMBER(write_ram);
|
||||
virtual DECLARE_READ8_MEMBER(read_io);
|
||||
virtual DECLARE_WRITE8_MEMBER(write_io);
|
||||
uint8_t read_cart(offs_t offset);
|
||||
void write_cart(offs_t offset, uint8_t data);
|
||||
void write_mapper(offs_t offset, uint8_t data);
|
||||
uint8_t read_ram(offs_t offset);
|
||||
void write_ram(offs_t offset, uint8_t data);
|
||||
uint8_t read_io(offs_t offset);
|
||||
void write_io(offs_t offset, uint8_t data);
|
||||
|
||||
int get_lphaser_xoffs() { return m_cart ? m_cart->get_lphaser_xoffs() : -1; }
|
||||
int get_sms_mode() { return m_cart->get_sms_mode(); }
|
||||
|
@ -102,7 +102,7 @@ void sega_fm_unit_device::device_reset()
|
||||
// peripheral_r - fm unit read
|
||||
//-------------------------------------------------
|
||||
|
||||
READ8_MEMBER(sega_fm_unit_device::peripheral_r)
|
||||
uint8_t sega_fm_unit_device::peripheral_r(offs_t offset)
|
||||
{
|
||||
// the value previously written to the control port is returned on all
|
||||
// active read offsets.
|
||||
@ -118,7 +118,7 @@ READ8_MEMBER(sega_fm_unit_device::peripheral_r)
|
||||
// peripheral_w - fm unit write
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE8_MEMBER(sega_fm_unit_device::peripheral_w)
|
||||
void sega_fm_unit_device::peripheral_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
|
@ -38,8 +38,8 @@ protected:
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
// device_sg1000_expansion_slot_interface overrides
|
||||
virtual DECLARE_READ8_MEMBER(peripheral_r) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(peripheral_w) override;
|
||||
virtual uint8_t peripheral_r(offs_t offset) override;
|
||||
virtual void peripheral_w(offs_t offset, uint8_t data) override;
|
||||
virtual bool is_readable(uint8_t offset) override;
|
||||
virtual bool is_writeable(uint8_t offset) override;
|
||||
void set_audio_control(uint8_t data);
|
||||
|
@ -86,18 +86,18 @@ void sg1000_expansion_slot_device::device_start()
|
||||
// has only 3 address lines (A0, A1, A2).
|
||||
|
||||
|
||||
READ8_MEMBER(sg1000_expansion_slot_device::read)
|
||||
uint8_t sg1000_expansion_slot_device::read(offs_t offset)
|
||||
{
|
||||
uint8_t data = 0xff;
|
||||
if (m_device)
|
||||
data = m_device->peripheral_r(space, offset & 0x07);
|
||||
data = m_device->peripheral_r(offset & 0x07);
|
||||
return data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sg1000_expansion_slot_device::write)
|
||||
void sg1000_expansion_slot_device::write(offs_t offset, uint8_t data)
|
||||
{
|
||||
if (m_device)
|
||||
m_device->peripheral_w(space, offset & 0x07, data);
|
||||
m_device->peripheral_w(offset & 0x07, data);
|
||||
}
|
||||
|
||||
|
||||
|
@ -40,8 +40,8 @@ public:
|
||||
sg1000_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||
virtual ~sg1000_expansion_slot_device();
|
||||
|
||||
DECLARE_READ8_MEMBER(read);
|
||||
DECLARE_WRITE8_MEMBER(write);
|
||||
uint8_t read(offs_t offset);
|
||||
void write(offs_t offset, uint8_t data);
|
||||
bool is_readable(uint8_t offset);
|
||||
bool is_writeable(uint8_t offset);
|
||||
|
||||
@ -63,8 +63,8 @@ public:
|
||||
// construction/destruction
|
||||
virtual ~device_sg1000_expansion_slot_interface();
|
||||
|
||||
virtual DECLARE_READ8_MEMBER(peripheral_r) { return 0xff; }
|
||||
virtual DECLARE_WRITE8_MEMBER(peripheral_w) { }
|
||||
virtual uint8_t peripheral_r(offs_t offset) { return 0xff; }
|
||||
virtual void peripheral_w(offs_t offset, uint8_t data) { }
|
||||
|
||||
virtual bool is_readable(uint8_t offset) { return true; }
|
||||
virtual bool is_writeable(uint8_t offset) { return true; }
|
||||
|
@ -187,8 +187,8 @@ sega_sk1100_device::sega_sk1100_device(const machine_config &mconfig, const char
|
||||
m_cassette(*this, "cassette"),
|
||||
m_ppi(*this, UPD9255_0_TAG),
|
||||
m_printer_port(*this, "printer"),
|
||||
m_pa(*this, {"PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7"}),
|
||||
m_pb(*this, {"PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7"}),
|
||||
m_pa(*this, "PA%u", 0U),
|
||||
m_pb(*this, "PB%u", 0U),
|
||||
m_keylatch(0)
|
||||
{
|
||||
}
|
||||
@ -209,7 +209,7 @@ void sega_sk1100_device::device_start()
|
||||
// peripheral_r - keyboard read
|
||||
//-------------------------------------------------
|
||||
|
||||
READ8_MEMBER(sega_sk1100_device::peripheral_r)
|
||||
uint8_t sega_sk1100_device::peripheral_r(offs_t offset)
|
||||
{
|
||||
return m_ppi->read(offset & 0x03);
|
||||
}
|
||||
@ -219,7 +219,7 @@ READ8_MEMBER(sega_sk1100_device::peripheral_r)
|
||||
// peripheral_w - keyboard write
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE8_MEMBER(sega_sk1100_device::peripheral_w)
|
||||
void sega_sk1100_device::peripheral_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
m_ppi->write(offset & 0x03, data);
|
||||
}
|
||||
|
@ -44,8 +44,8 @@ protected:
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
// device_sg1000_expansion_slot_interface overrides
|
||||
virtual DECLARE_READ8_MEMBER(peripheral_r) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(peripheral_w) override;
|
||||
virtual uint8_t peripheral_r(offs_t offset) override;
|
||||
virtual void peripheral_w(offs_t offset, uint8_t data) override;
|
||||
virtual bool is_readable(uint8_t offset) override;
|
||||
|
||||
private:
|
||||
|
@ -56,14 +56,14 @@ void sms_gender_adapter_device::device_start()
|
||||
// read
|
||||
//-------------------------------------------------
|
||||
|
||||
READ8_MEMBER(sms_gender_adapter_device::read)
|
||||
uint8_t sms_gender_adapter_device::read(offs_t offset)
|
||||
{
|
||||
return m_subslot->read_cart(space, offset);
|
||||
return m_subslot->read_cart(offset);
|
||||
}
|
||||
|
||||
READ8_MEMBER(sms_gender_adapter_device::read_ram)
|
||||
uint8_t sms_gender_adapter_device::read_ram(offs_t offset)
|
||||
{
|
||||
return m_subslot->read_ram(space, offset);
|
||||
return m_subslot->read_ram(offset);
|
||||
}
|
||||
|
||||
int sms_gender_adapter_device::get_lphaser_xoffs()
|
||||
@ -76,19 +76,19 @@ int sms_gender_adapter_device::get_lphaser_xoffs()
|
||||
// write
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE8_MEMBER(sms_gender_adapter_device::write_mapper)
|
||||
void sms_gender_adapter_device::write_mapper(offs_t offset, uint8_t data)
|
||||
{
|
||||
m_subslot->write_mapper(space, offset, data);
|
||||
m_subslot->write_mapper(offset, data);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sms_gender_adapter_device::write)
|
||||
void sms_gender_adapter_device::write(offs_t offset, uint8_t data)
|
||||
{
|
||||
m_subslot->write_cart(space, offset, data);
|
||||
m_subslot->write_cart(offset, data);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sms_gender_adapter_device::write_ram)
|
||||
void sms_gender_adapter_device::write_ram(offs_t offset, uint8_t data)
|
||||
{
|
||||
m_subslot->write_ram(space, offset, data);
|
||||
m_subslot->write_ram(offset, data);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
|
@ -31,11 +31,11 @@ public:
|
||||
sms_gender_adapter_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// device_sms_expansion_slot_interface overrides
|
||||
virtual DECLARE_READ8_MEMBER(read) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_mapper) override;
|
||||
virtual DECLARE_READ8_MEMBER(read_ram) override;
|
||||
virtual DECLARE_WRITE8_MEMBER(write_ram) override;
|
||||
virtual uint8_t read(offs_t offset) override;
|
||||
virtual void write(offs_t offset, uint8_t data) override;
|
||||
virtual void write_mapper(offs_t offset, uint8_t data) override;
|
||||
virtual uint8_t read_ram(offs_t offset) override;
|
||||
virtual void write_ram(offs_t offset, uint8_t data) override;
|
||||
|
||||
virtual int get_lphaser_xoffs() override;
|
||||
|
||||
|
@ -29,11 +29,11 @@ public:
|
||||
virtual ~device_sms_expansion_slot_interface();
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ8_MEMBER(read) { return 0xff; }
|
||||
virtual DECLARE_WRITE8_MEMBER(write) { }
|
||||
virtual DECLARE_WRITE8_MEMBER(write_mapper) { }
|
||||
virtual DECLARE_READ8_MEMBER(read_ram) { return 0xff; }
|
||||
virtual DECLARE_WRITE8_MEMBER(write_ram) { }
|
||||
virtual uint8_t read(offs_t offset) { return 0xff; }
|
||||
virtual void write(offs_t offset, uint8_t data) { }
|
||||
virtual void write_mapper(offs_t offset, uint8_t data) { }
|
||||
virtual uint8_t read_ram(offs_t offset) { return 0xff; }
|
||||
virtual void write_ram(offs_t offset, uint8_t data) { }
|
||||
|
||||
virtual int get_lphaser_xoffs() { return 0; }
|
||||
|
||||
@ -61,11 +61,11 @@ public:
|
||||
virtual ~sms_expansion_slot_device();
|
||||
|
||||
// reading and writing
|
||||
DECLARE_READ8_MEMBER(read) { return m_device ? m_device->read(space, offset, mem_mask) : 0xff; }
|
||||
DECLARE_WRITE8_MEMBER(write) { if (m_device) m_device->write(space, offset, data, mem_mask); }
|
||||
DECLARE_WRITE8_MEMBER(write_mapper) { if (m_device) m_device->write_mapper(space, offset, data, mem_mask); }
|
||||
DECLARE_READ8_MEMBER(read_ram) { return m_device ? m_device->read_ram(space, offset, mem_mask) : 0xff; }
|
||||
DECLARE_WRITE8_MEMBER(write_ram) { if (m_device) m_device->write_ram(space, offset, data, mem_mask); }
|
||||
uint8_t read(offs_t offset) { return m_device ? m_device->read(offset) : 0xff; }
|
||||
void write(offs_t offset, uint8_t data) { if (m_device) m_device->write(offset, data); }
|
||||
void write_mapper(offs_t offset, uint8_t data) { if (m_device) m_device->write_mapper(offset, data); }
|
||||
uint8_t read_ram(offs_t offset) { return m_device ? m_device->read_ram(offset) : 0xff; }
|
||||
void write_ram(offs_t offset, uint8_t data) { if (m_device) m_device->write_ram(offset, data); }
|
||||
|
||||
int get_lphaser_xoffs() { return m_device ? m_device->get_lphaser_xoffs() : 0; }
|
||||
|
||||
|
@ -78,27 +78,27 @@ Notes:
|
||||
// TODO: not sure if the OMV bios actually detects the presence of a cart,
|
||||
// or if the cart data simply overwrites the internal bios...
|
||||
// for the moment let assume the latter!
|
||||
READ8_MEMBER( sg1000_state::omv_r )
|
||||
uint8_t sg1000_state::omv_r(offs_t offset)
|
||||
{
|
||||
if (m_cart && m_cart->exists())
|
||||
return m_cart->read_cart(space, offset);
|
||||
return m_cart->read_cart(offset);
|
||||
else
|
||||
return m_rom->base()[offset];
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( sg1000_state::omv_w )
|
||||
void sg1000_state::omv_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
if (m_cart && m_cart->exists())
|
||||
m_cart->write_cart(space, offset, data);
|
||||
m_cart->write_cart(offset, data);
|
||||
}
|
||||
|
||||
READ8_MEMBER( sg1000_state::peripheral_r )
|
||||
uint8_t sg1000_state::peripheral_r(offs_t offset)
|
||||
{
|
||||
bool joy_ports_disabled = m_sgexpslot->is_readable(offset);
|
||||
|
||||
if (joy_ports_disabled)
|
||||
{
|
||||
return m_sgexpslot->read(space, offset);
|
||||
return m_sgexpslot->read(offset);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -109,13 +109,13 @@ READ8_MEMBER( sg1000_state::peripheral_r )
|
||||
}
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( sg1000_state::peripheral_w )
|
||||
void sg1000_state::peripheral_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
bool joy_ports_disabled = m_sgexpslot->is_writeable(offset);
|
||||
|
||||
if (joy_ports_disabled)
|
||||
{
|
||||
m_sgexpslot->write(space, offset, data);
|
||||
m_sgexpslot->write(offset, data);
|
||||
}
|
||||
}
|
||||
|
||||
@ -463,8 +463,8 @@ void sg1000_state::machine_start()
|
||||
{
|
||||
if (m_cart->get_type() == SEGA8_DAHJEE_TYPEA || m_cart->get_type() == SEGA8_DAHJEE_TYPEB)
|
||||
{
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xc000, 0xffff, read8_delegate(*m_cart, FUNC(sega8_cart_slot_device::read_ram)));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xc000, 0xffff, write8_delegate(*m_cart, FUNC(sega8_cart_slot_device::write_ram)));
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xc000, 0xffff, read8sm_delegate(*m_cart, FUNC(sega8_cart_slot_device::read_ram)));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xc000, 0xffff, write8sm_delegate(*m_cart, FUNC(sega8_cart_slot_device::write_ram)));
|
||||
}
|
||||
|
||||
if (m_cart)
|
||||
@ -484,8 +484,8 @@ void sc3000_state::machine_start()
|
||||
|| m_cart->get_type() == SEGA8_DAHJEE_TYPEA || m_cart->get_type() == SEGA8_DAHJEE_TYPEB
|
||||
|| m_cart->get_type() == SEGA8_MULTICART || m_cart->get_type() == SEGA8_MEGACART))
|
||||
{
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xc000, 0xffff, read8_delegate(*m_cart, FUNC(sega8_cart_slot_device::read_ram)));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xc000, 0xffff, write8_delegate(*m_cart, FUNC(sega8_cart_slot_device::write_ram)));
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xc000, 0xffff, read8sm_delegate(*m_cart, FUNC(sega8_cart_slot_device::read_ram)));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xc000, 0xffff, write8sm_delegate(*m_cart, FUNC(sega8_cart_slot_device::write_ram)));
|
||||
}
|
||||
|
||||
if (m_cart)
|
||||
|
@ -69,11 +69,11 @@ protected:
|
||||
|
||||
virtual void machine_start() override;
|
||||
|
||||
DECLARE_READ8_MEMBER( peripheral_r );
|
||||
DECLARE_WRITE8_MEMBER( peripheral_w );
|
||||
uint8_t peripheral_r(offs_t offset);
|
||||
void peripheral_w(offs_t offset, uint8_t data);
|
||||
|
||||
DECLARE_READ8_MEMBER( omv_r );
|
||||
DECLARE_WRITE8_MEMBER( omv_w );
|
||||
uint8_t omv_r(offs_t offset);
|
||||
void omv_w(offs_t offset, uint8_t data);
|
||||
|
||||
void omv_io_map(address_map &map);
|
||||
void omv_map(address_map &map);
|
||||
|
@ -86,26 +86,26 @@ protected:
|
||||
template <typename X> static void screen_sms_pal_raw_params(screen_device &screen, X &&pixelclock);
|
||||
template <typename X> static void screen_sms_ntsc_raw_params(screen_device &screen, X &&pixelclock);
|
||||
|
||||
DECLARE_READ8_MEMBER(read_0000);
|
||||
DECLARE_READ8_MEMBER(read_4000);
|
||||
DECLARE_READ8_MEMBER(read_8000);
|
||||
DECLARE_READ8_MEMBER(read_ram);
|
||||
DECLARE_WRITE8_MEMBER(write_ram);
|
||||
DECLARE_WRITE8_MEMBER(write_cart);
|
||||
uint8_t read_0000(offs_t offset);
|
||||
uint8_t read_4000(offs_t offset);
|
||||
uint8_t read_8000(offs_t offset);
|
||||
uint8_t read_ram(offs_t offset);
|
||||
void write_ram(offs_t offset, uint8_t data);
|
||||
void write_cart(offs_t offset, uint8_t data);
|
||||
|
||||
DECLARE_READ8_MEMBER(sms_mapper_r);
|
||||
DECLARE_WRITE8_MEMBER(sms_mapper_w);
|
||||
DECLARE_WRITE8_MEMBER(sms_mem_control_w);
|
||||
DECLARE_WRITE8_MEMBER(sms_io_control_w);
|
||||
DECLARE_READ8_MEMBER(sms_count_r);
|
||||
DECLARE_READ8_MEMBER(sms_input_port_dc_r);
|
||||
DECLARE_READ8_MEMBER(sms_input_port_dd_r);
|
||||
DECLARE_READ8_MEMBER(sg1000m3_peripheral_r);
|
||||
DECLARE_WRITE8_MEMBER(sg1000m3_peripheral_w);
|
||||
DECLARE_READ8_MEMBER(smsj_audio_control_r);
|
||||
DECLARE_WRITE8_MEMBER(smsj_audio_control_w);
|
||||
DECLARE_WRITE8_MEMBER(smsj_ym2413_register_port_w);
|
||||
DECLARE_WRITE8_MEMBER(smsj_ym2413_data_port_w);
|
||||
uint8_t sms_mapper_r(offs_t offset);
|
||||
void sms_mapper_w(offs_t offset, uint8_t data);
|
||||
void sms_mem_control_w(uint8_t data);
|
||||
void sms_io_control_w(uint8_t data);
|
||||
uint8_t sms_count_r(offs_t offset);
|
||||
uint8_t sms_input_port_dc_r();
|
||||
uint8_t sms_input_port_dd_r();
|
||||
uint8_t sg1000m3_peripheral_r(offs_t offset);
|
||||
void sg1000m3_peripheral_w(offs_t offset, uint8_t data);
|
||||
uint8_t smsj_audio_control_r();
|
||||
void smsj_audio_control_w(uint8_t data);
|
||||
void smsj_ym2413_register_port_w(uint8_t data);
|
||||
void smsj_ym2413_data_port_w(uint8_t data);
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER(rapid_n_csync_callback);
|
||||
DECLARE_WRITE_LINE_MEMBER(sms_ctrl1_th_input);
|
||||
@ -119,7 +119,7 @@ protected:
|
||||
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
uint8_t read_bus(address_space &space, unsigned int bank, uint16_t base_addr, uint16_t offset);
|
||||
uint8_t read_bus(unsigned int bank, uint16_t base_addr, uint16_t offset);
|
||||
void setup_bios();
|
||||
void setup_media_slots();
|
||||
void setup_enabled_slots();
|
||||
@ -146,7 +146,6 @@ protected:
|
||||
output_finder<> m_led_pwr;
|
||||
|
||||
required_memory_region m_region_maincpu;
|
||||
address_space *m_space;
|
||||
std::unique_ptr<uint8_t[]> m_mainram;
|
||||
uint8_t *m_BIOS;
|
||||
|
||||
@ -226,8 +225,8 @@ protected:
|
||||
virtual void video_reset() override;
|
||||
|
||||
private:
|
||||
DECLARE_READ8_MEMBER(sscope_r);
|
||||
DECLARE_WRITE8_MEMBER(sscope_w);
|
||||
uint8_t sscope_r(offs_t offset);
|
||||
void sscope_w(offs_t offset, uint8_t data);
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER(sscope_vblank);
|
||||
uint32_t screen_update_left(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
@ -267,12 +266,12 @@ protected:
|
||||
virtual void device_post_load() override;
|
||||
|
||||
private:
|
||||
DECLARE_READ8_MEMBER(sms_store_cart_select_r);
|
||||
DECLARE_WRITE8_MEMBER(sms_store_cart_select_w);
|
||||
uint8_t sms_store_cart_select_r();
|
||||
void sms_store_cart_select_w(uint8_t data);
|
||||
void store_select_cart(uint8_t data);
|
||||
DECLARE_WRITE8_MEMBER(sms_store_control_w);
|
||||
void sms_store_control_w(uint8_t data);
|
||||
|
||||
DECLARE_READ8_MEMBER(store_cart_peek);
|
||||
uint8_t store_cart_peek(offs_t offset);
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER(sms_store_int_callback);
|
||||
void sms_store_mem(address_map &map);
|
||||
@ -304,10 +303,10 @@ protected:
|
||||
private:
|
||||
template <typename X> static void screen_gg_raw_params(screen_device &screen, X &&pixelclock);
|
||||
|
||||
DECLARE_READ8_MEMBER(gg_input_port_00_r);
|
||||
DECLARE_READ8_MEMBER(gg_sio_r);
|
||||
DECLARE_WRITE8_MEMBER(gg_sio_w);
|
||||
DECLARE_WRITE8_MEMBER(gg_psg_stereo_w);
|
||||
uint8_t gg_input_port_00_r();
|
||||
uint8_t gg_sio_r(offs_t offset);
|
||||
void gg_sio_w(offs_t offset, uint8_t data);
|
||||
void gg_psg_stereo_w(uint8_t data);
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER(gg_pause_callback);
|
||||
DECLARE_WRITE_LINE_MEMBER(gg_ext_th_input);
|
||||
|
@ -128,7 +128,7 @@ void sms_state::sms_get_inputs()
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(sms_state::sms_io_control_w)
|
||||
void sms_state::sms_io_control_w(uint8_t data)
|
||||
{
|
||||
bool latch_hcount = false;
|
||||
uint8_t ctrl1_port_data = 0xff;
|
||||
@ -206,7 +206,7 @@ WRITE8_MEMBER(sms_state::sms_io_control_w)
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(sms_state::sms_count_r)
|
||||
uint8_t sms_state::sms_count_r(offs_t offset)
|
||||
{
|
||||
if (offset & 0x01)
|
||||
return m_vdp->hcount_read();
|
||||
@ -312,7 +312,7 @@ WRITE_LINE_MEMBER(sms_state::rapid_n_csync_callback)
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(sms_state::sms_input_port_dc_r)
|
||||
uint8_t sms_state::sms_input_port_dc_r()
|
||||
{
|
||||
if (m_is_mark_iii)
|
||||
{
|
||||
@ -359,7 +359,7 @@ READ8_MEMBER(sms_state::sms_input_port_dc_r)
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(sms_state::sms_input_port_dd_r)
|
||||
uint8_t sms_state::sms_input_port_dd_r()
|
||||
{
|
||||
if (m_is_mark_iii)
|
||||
{
|
||||
@ -480,13 +480,13 @@ void sms_state::smsj_set_audio_control(uint8_t data)
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(sms_state::smsj_audio_control_w)
|
||||
void sms_state::smsj_audio_control_w(uint8_t data)
|
||||
{
|
||||
smsj_set_audio_control(data);
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(sms_state::smsj_audio_control_r)
|
||||
uint8_t sms_state::smsj_audio_control_r()
|
||||
{
|
||||
uint8_t data;
|
||||
|
||||
@ -515,20 +515,20 @@ READ8_MEMBER(sms_state::smsj_audio_control_r)
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(sms_state::smsj_ym2413_register_port_w)
|
||||
void sms_state::smsj_ym2413_register_port_w(uint8_t data)
|
||||
{
|
||||
m_ym->write(0, data & 0x3f);
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(sms_state::smsj_ym2413_data_port_w)
|
||||
void sms_state::smsj_ym2413_data_port_w(uint8_t data)
|
||||
{
|
||||
//logerror("data_port_w %x %x\n", offset, data);
|
||||
m_ym->write(1, data);
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(gamegear_state::gg_psg_stereo_w)
|
||||
void gamegear_state::gg_psg_stereo_w(uint8_t data)
|
||||
{
|
||||
if (m_cartslot->exists() && m_cartslot->get_sms_mode())
|
||||
return;
|
||||
@ -537,7 +537,7 @@ WRITE8_MEMBER(gamegear_state::gg_psg_stereo_w)
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(gamegear_state::gg_input_port_00_r)
|
||||
uint8_t gamegear_state::gg_input_port_00_r()
|
||||
{
|
||||
if (m_cartslot->exists() && m_cartslot->get_sms_mode())
|
||||
return 0xff;
|
||||
@ -557,7 +557,7 @@ READ8_MEMBER(gamegear_state::gg_input_port_00_r)
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(sms1_state::sscope_r)
|
||||
uint8_t sms1_state::sscope_r(offs_t offset)
|
||||
{
|
||||
int sscope = m_port_scope->read();
|
||||
|
||||
@ -570,13 +570,13 @@ READ8_MEMBER(sms1_state::sscope_r)
|
||||
return m_sscope_state;
|
||||
}
|
||||
|
||||
return read_ram(space, 0x3ff8 + offset);
|
||||
return read_ram(0x3ff8 + offset);
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(sms1_state::sscope_w)
|
||||
void sms1_state::sscope_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
write_ram(space, 0x3ff8 + offset, data);
|
||||
write_ram(0x3ff8 + offset, data);
|
||||
|
||||
int sscope = m_port_scope->read();
|
||||
|
||||
@ -599,18 +599,18 @@ WRITE8_MEMBER(sms1_state::sscope_w)
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(sms_state::read_ram)
|
||||
uint8_t sms_state::read_ram(offs_t offset)
|
||||
{
|
||||
if (m_mem_device_enabled & ENABLE_EXT_RAM)
|
||||
{
|
||||
uint8_t data = 0xff;
|
||||
|
||||
if (m_mem_device_enabled & ENABLE_CART)
|
||||
data &= m_cartslot->read_ram(space, offset);
|
||||
data &= m_cartslot->read_ram(offset);
|
||||
if (m_mem_device_enabled & ENABLE_CARD)
|
||||
data &= m_cardslot->read_ram(space, offset);
|
||||
data &= m_cardslot->read_ram(offset);
|
||||
if (m_mem_device_enabled & ENABLE_EXPANSION)
|
||||
data &= m_smsexpslot->read_ram(space, offset);
|
||||
data &= m_smsexpslot->read_ram(offset);
|
||||
|
||||
return data;
|
||||
}
|
||||
@ -621,16 +621,16 @@ READ8_MEMBER(sms_state::read_ram)
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(sms_state::write_ram)
|
||||
void sms_state::write_ram(offs_t offset, uint8_t data)
|
||||
{
|
||||
if (m_mem_device_enabled & ENABLE_EXT_RAM)
|
||||
{
|
||||
if (m_mem_device_enabled & ENABLE_CART)
|
||||
m_cartslot->write_ram(space, offset, data);
|
||||
m_cartslot->write_ram(offset, data);
|
||||
if (m_mem_device_enabled & ENABLE_CARD)
|
||||
m_cardslot->write_ram(space, offset, data);
|
||||
m_cardslot->write_ram(offset, data);
|
||||
if (m_mem_device_enabled & ENABLE_EXPANSION)
|
||||
m_smsexpslot->write_ram(space, offset, data);
|
||||
m_smsexpslot->write_ram(offset, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -639,16 +639,16 @@ WRITE8_MEMBER(sms_state::write_ram)
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(sms_state::sms_mapper_r)
|
||||
uint8_t sms_state::sms_mapper_r(offs_t offset)
|
||||
{
|
||||
return read_ram(space, 0x3ffc + offset);
|
||||
return read_ram(0x3ffc + offset);
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(sms_state::sms_mapper_w)
|
||||
void sms_state::sms_mapper_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
m_mapper[offset] = data;
|
||||
write_ram(space, 0x3ffc + offset, data);
|
||||
write_ram(0x3ffc + offset, data);
|
||||
|
||||
switch (offset)
|
||||
{
|
||||
@ -662,15 +662,15 @@ WRITE8_MEMBER(sms_state::sms_mapper_w)
|
||||
}
|
||||
if (m_mem_device_enabled & ENABLE_CART) // CART ROM/RAM
|
||||
{
|
||||
m_cartslot->write_mapper(space, offset, data);
|
||||
m_cartslot->write_mapper(offset, data);
|
||||
}
|
||||
if (m_mem_device_enabled & ENABLE_CARD) // CARD ROM/RAM
|
||||
{
|
||||
m_cardslot->write_mapper(space, offset, data);
|
||||
m_cardslot->write_mapper(offset, data);
|
||||
}
|
||||
if (m_mem_device_enabled & ENABLE_EXPANSION) // expansion slot
|
||||
{
|
||||
m_smsexpslot->write_mapper(space, offset, data);
|
||||
m_smsexpslot->write_mapper(offset, data);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -686,22 +686,22 @@ WRITE8_MEMBER(sms_state::sms_mapper_w)
|
||||
}
|
||||
if (m_mem_device_enabled & ENABLE_CART)
|
||||
{
|
||||
m_cartslot->write_mapper(space, offset, data);
|
||||
m_cartslot->write_mapper(offset, data);
|
||||
}
|
||||
if (m_mem_device_enabled & ENABLE_CARD)
|
||||
{
|
||||
m_cardslot->write_mapper(space, offset, data);
|
||||
m_cardslot->write_mapper(offset, data);
|
||||
}
|
||||
if (m_mem_device_enabled & ENABLE_EXPANSION)
|
||||
{
|
||||
m_smsexpslot->write_mapper(space, offset, data);
|
||||
m_smsexpslot->write_mapper(offset, data);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
uint8_t sms_state::read_bus(address_space &space, unsigned int page, uint16_t base_addr, uint16_t offset)
|
||||
uint8_t sms_state::read_bus(unsigned int page, uint16_t base_addr, uint16_t offset)
|
||||
{
|
||||
if (m_is_gamegear)
|
||||
{
|
||||
@ -715,7 +715,7 @@ uint8_t sms_state::read_bus(address_space &space, unsigned int page, uint16_t ba
|
||||
if ((m_mem_device_enabled & ENABLE_BIOS) && page == 3)
|
||||
return m_BIOS[(m_bios_page[page] * 0x4000) + (offset & 0x3fff)];
|
||||
if (m_mem_device_enabled & ENABLE_CART)
|
||||
return m_cartslot->read_cart(space, base_addr + offset);
|
||||
return m_cartslot->read_cart(base_addr + offset);
|
||||
}
|
||||
else if (m_mem_device_enabled != ENABLE_NONE)
|
||||
{
|
||||
@ -728,11 +728,11 @@ uint8_t sms_state::read_bus(address_space &space, unsigned int page, uint16_t ba
|
||||
if (m_mem_device_enabled & ENABLE_BIOS)
|
||||
data &= m_BIOS[(m_bios_page[page] * 0x4000) + (offset & 0x3fff)];
|
||||
if (m_mem_device_enabled & ENABLE_CART)
|
||||
data &= m_cartslot->read_cart(space, base_addr + offset);
|
||||
data &= m_cartslot->read_cart(base_addr + offset);
|
||||
if (m_mem_device_enabled & ENABLE_CARD)
|
||||
data &= m_cardslot->read_cart(space, base_addr + offset);
|
||||
data &= m_cardslot->read_cart(base_addr + offset);
|
||||
if (m_mem_device_enabled & ENABLE_EXPANSION)
|
||||
data &= m_smsexpslot->read(space, base_addr + offset);
|
||||
data &= m_smsexpslot->read(base_addr + offset);
|
||||
|
||||
return data;
|
||||
}
|
||||
@ -740,47 +740,47 @@ uint8_t sms_state::read_bus(address_space &space, unsigned int page, uint16_t ba
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(sms_state::read_0000)
|
||||
uint8_t sms_state::read_0000(offs_t offset)
|
||||
{
|
||||
if (offset < 0x400)
|
||||
{
|
||||
return read_bus(space, 3, 0x0000, offset);
|
||||
return read_bus(3, 0x0000, offset);
|
||||
}
|
||||
else
|
||||
{
|
||||
return read_bus(space, 0, 0x0000, offset);
|
||||
return read_bus(0, 0x0000, offset);
|
||||
}
|
||||
}
|
||||
|
||||
READ8_MEMBER(sms_state::read_4000)
|
||||
uint8_t sms_state::read_4000(offs_t offset)
|
||||
{
|
||||
return read_bus(space, 1, 0x4000, offset);
|
||||
return read_bus(1, 0x4000, offset);
|
||||
}
|
||||
|
||||
READ8_MEMBER(sms_state::read_8000)
|
||||
uint8_t sms_state::read_8000(offs_t offset)
|
||||
{
|
||||
return read_bus(space, 2, 0x8000, offset);
|
||||
return read_bus(2, 0x8000, offset);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sms_state::write_cart)
|
||||
void sms_state::write_cart(offs_t offset, uint8_t data)
|
||||
{
|
||||
if (m_mem_device_enabled & ENABLE_CART)
|
||||
m_cartslot->write_cart(space, offset, data);
|
||||
m_cartslot->write_cart(offset, data);
|
||||
if (m_mem_device_enabled & ENABLE_CARD)
|
||||
m_cardslot->write_cart(space, offset, data);
|
||||
m_cardslot->write_cart(offset, data);
|
||||
if (m_mem_device_enabled & ENABLE_EXPANSION)
|
||||
m_smsexpslot->write(space, offset, data);
|
||||
m_smsexpslot->write(offset, data);
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(smssdisp_state::store_cart_peek)
|
||||
uint8_t smssdisp_state::store_cart_peek(offs_t offset)
|
||||
{
|
||||
if (m_mem_device_enabled != ENABLE_NONE)
|
||||
{
|
||||
uint8_t data = 0xff;
|
||||
|
||||
if (m_mem_device_enabled & ENABLE_CART)
|
||||
data &= m_cartslot->read_cart(space, 0x6000 + (offset & 0x1fff));
|
||||
data &= m_cartslot->read_cart(0x6000 + (offset & 0x1fff));
|
||||
|
||||
return data;
|
||||
}
|
||||
@ -790,7 +790,7 @@ READ8_MEMBER(smssdisp_state::store_cart_peek)
|
||||
}
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sms_state::sms_mem_control_w)
|
||||
void sms_state::sms_mem_control_w(uint8_t data)
|
||||
{
|
||||
m_mem_ctrl_reg = data;
|
||||
|
||||
@ -800,36 +800,36 @@ WRITE8_MEMBER(sms_state::sms_mem_control_w)
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(sms_state::sg1000m3_peripheral_r)
|
||||
uint8_t sms_state::sg1000m3_peripheral_r(offs_t offset)
|
||||
{
|
||||
bool joy_ports_disabled = m_sgexpslot->is_readable(offset);
|
||||
|
||||
if (joy_ports_disabled)
|
||||
{
|
||||
return m_sgexpslot->read(space, offset);
|
||||
return m_sgexpslot->read(offset);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (offset & 0x01)
|
||||
return sms_input_port_dd_r(space, offset);
|
||||
return sms_input_port_dd_r();
|
||||
else
|
||||
return sms_input_port_dc_r(space, offset);
|
||||
return sms_input_port_dc_r();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(sms_state::sg1000m3_peripheral_w)
|
||||
void sms_state::sg1000m3_peripheral_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
bool joy_ports_disabled = m_sgexpslot->is_writeable(offset);
|
||||
|
||||
if (joy_ports_disabled)
|
||||
{
|
||||
m_sgexpslot->write(space, offset, data);
|
||||
m_sgexpslot->write(offset, data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(gamegear_state::gg_sio_w)
|
||||
void gamegear_state::gg_sio_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
if (m_cartslot->exists() && m_cartslot->get_sms_mode())
|
||||
return;
|
||||
@ -857,7 +857,7 @@ WRITE8_MEMBER(gamegear_state::gg_sio_w)
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(gamegear_state::gg_sio_r)
|
||||
uint8_t gamegear_state::gg_sio_r(offs_t offset)
|
||||
{
|
||||
if (m_cartslot->exists() && m_cartslot->get_sms_mode())
|
||||
return 0xff;
|
||||
@ -1024,7 +1024,6 @@ void sms_state::machine_start()
|
||||
}
|
||||
|
||||
m_cartslot = m_slot.target();
|
||||
m_space = &m_maincpu->space(AS_PROGRAM);
|
||||
|
||||
if (m_mainram == nullptr)
|
||||
{
|
||||
@ -1164,13 +1163,13 @@ void gamegear_state::machine_reset()
|
||||
sms_state::machine_reset();
|
||||
}
|
||||
|
||||
READ8_MEMBER(smssdisp_state::sms_store_cart_select_r)
|
||||
uint8_t smssdisp_state::sms_store_cart_select_r()
|
||||
{
|
||||
return m_store_cart_selection_data;
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(smssdisp_state::sms_store_cart_select_w)
|
||||
void smssdisp_state::sms_store_cart_select_w(uint8_t data)
|
||||
{
|
||||
store_select_cart(data);
|
||||
m_store_cart_selection_data = data;
|
||||
@ -1208,7 +1207,7 @@ void smssdisp_state::store_select_cart(uint8_t data)
|
||||
logerror("switching in part of %s slot #%d\n", slottype ? "card" : "cartridge", slot);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(smssdisp_state::sms_store_control_w)
|
||||
void smssdisp_state::sms_store_control_w(uint8_t data)
|
||||
{
|
||||
int led_number = data >> 4;
|
||||
int led_column = led_number / 4;
|
||||
|
Loading…
Reference in New Issue
Block a user