nintendo/cham24.cpp: Added save state support and cleaned up code. (#10670)

Also cleaned up sprite RAM DMA trigger trampolines in all NES-like drivers.
This commit is contained in:
0kmg 2022-12-13 11:39:25 -08:00 committed by GitHub
parent 003e5b4879
commit cb5379c63e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 78 additions and 154 deletions

View File

@ -29,7 +29,7 @@ PCB Layout
| |NTA0002| |
| |(QFP80)| 24-1.U1 |
| -------- |
| 2003 ----------- |
| ULN2003A ----------- |
| |LATTICE | |
| DSW1 |PLSI 1016| |
|J |(PLCC44) | 24-2.U2 |
@ -38,8 +38,8 @@ PCB Layout
|M SW1 21.4771MHz |
|A |
| GW6582 LS02 |
| |-----------| 4040 |
| 74HC245 |Philips | 4040 |
| |-----------| MC14040BCP |
| 74HC245 |Philips | MC14040BCP |
| |SAA71111AH2| |
| |20505650 | |
| |bP0219 | 24-3.U3 |
@ -71,12 +71,13 @@ class cham24_state : public driver_device
{
public:
cham24_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_ppu(*this, "ppu"),
m_nt_page(*this, "nt_page%u", 0U),
m_prg_banks(*this, "prg%u", 0U),
m_chr_bank(*this, "chr")
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_ppu(*this, "ppu")
, m_nt_page(*this, "nt_page%u", 0U)
, m_prg_banks(*this, "prg%u", 0U)
, m_chr_bank(*this, "chr")
, m_in(*this, "P%u", 1U)
{ }
void cham24(machine_config &config);
@ -93,18 +94,16 @@ private:
required_memory_bank_array<2> m_prg_banks;
required_memory_bank m_chr_bank;
uint8_t m_prg_chunks;
required_ioport_array<2> m_in;
std::unique_ptr<uint8_t[]> m_nt_ram;
uint32_t m_in_0;
uint32_t m_in_1;
uint32_t m_in_0_shift;
uint32_t m_in_1_shift;
void sprite_dma_w(address_space &space, uint8_t data);
uint8_t cham24_IN0_r();
void cham24_IN0_w(uint8_t data);
uint8_t cham24_IN1_r();
void cham24_mapper_w(offs_t offset, uint8_t data);
std::unique_ptr<u8 []> m_nt_ram;
u8 m_prg_chunks;
u8 m_input_latch[2];
u8 m_input_strobe;
template <u8 Which> u8 cham24_in_r();
void cham24_in0_w(u8 data);
void cham24_mapper_w(offs_t offset, u8 data);
void cham24_set_mirroring(int mirroring);
void cham24_map(address_map &map);
void cham24_ppu_map(address_map &map);
@ -114,61 +113,46 @@ private:
void cham24_state::cham24_set_mirroring(int mirroring)
{
switch (mirroring)
{
case PPU_MIRROR_HORZ:
for (int i = 0; i < 4; i++)
m_nt_page[i]->set_entry(BIT(i, 1));
break;
case PPU_MIRROR_VERT:
default:
for (int i = 0; i < 4; i++)
m_nt_page[i]->set_entry(i & 1);
break;
}
int bit = mirroring == PPU_MIRROR_HORZ;
for (int i = 0; i < 4; i++)
m_nt_page[i]->set_entry(BIT(i, bit));
}
void cham24_state::sprite_dma_w(address_space &space, uint8_t data)
template <u8 Which>
u8 cham24_state::cham24_in_r()
{
int source = (data & 7);
m_ppu->spriteram_dma(space, source);
if (m_input_strobe)
m_input_latch[Which] = m_in[Which]->read();
u8 ret = 0x40;
ret |= m_input_latch[Which] & 1;
if (!machine().side_effects_disabled())
m_input_latch[Which] >>= 1;
return ret;
}
uint8_t cham24_state::cham24_IN0_r()
{
return ((m_in_0 >> m_in_0_shift++) & 0x01) | 0x40;
}
void cham24_state::cham24_IN0_w(uint8_t data)
void cham24_state::cham24_in0_w(u8 data)
{
if (data & 0xfe)
{
//logerror("Unhandled cham24_IN0_w write: data = %02X\n", data);
//logerror("Unhandled cham24_in0_w write: data = %02X\n", data);
}
if (data & 0x01)
{
return;
}
m_in_0_shift = 0;
m_in_1_shift = 0;
m_in_0 = ioport("P1")->read();
m_in_1 = ioport("P2")->read();
if (m_input_strobe & ~data & 1)
for (int i = 0; i < 2; i++)
m_input_latch[i] = m_in[i]->read();
m_input_strobe = data & 1;
}
uint8_t cham24_state::cham24_IN1_r()
{
return ((m_in_1 >> m_in_1_shift++) & 0x01) | 0x40;
}
void cham24_state::cham24_mapper_w(offs_t offset, uint8_t data)
void cham24_state::cham24_mapper_w(offs_t offset, u8 data)
{
// switch PRG bank
uint8_t prg_bank = BIT(offset, 6, 6);
uint8_t prg_mode = !BIT(offset, 12);
u8 prg_bank = BIT(offset, 6, 6);
u8 prg_mode = !BIT(offset, 12);
m_prg_banks[0]->set_entry(prg_bank & ~prg_mode);
m_prg_banks[1]->set_entry(prg_bank | prg_mode);
@ -181,11 +165,11 @@ void cham24_state::cham24_mapper_w(offs_t offset, uint8_t data)
void cham24_state::cham24_map(address_map &map)
{
map(0x0000, 0x07ff).ram(); /* NES RAM */
map(0x0000, 0x07ff).mirror(0x1800).ram(); // NES RAM
map(0x2000, 0x3fff).rw(m_ppu, FUNC(ppu2c0x_device::read), FUNC(ppu2c0x_device::write));
map(0x4014, 0x4014).w(FUNC(cham24_state::sprite_dma_w));
map(0x4016, 0x4016).rw(FUNC(cham24_state::cham24_IN0_r), FUNC(cham24_state::cham24_IN0_w)); /* IN0 - input port 1 */
map(0x4017, 0x4017).r(FUNC(cham24_state::cham24_IN1_r)); /* IN1 - input port 2 / PSG second control register */
map(0x4014, 0x4014).w(m_ppu, FUNC(ppu2c0x_device::spriteram_dma));
map(0x4016, 0x4016).rw(FUNC(cham24_state::cham24_in_r<0>), FUNC(cham24_state::cham24_in0_w)); // IN0 - input port 1
map(0x4017, 0x4017).r(FUNC(cham24_state::cham24_in_r<1>)); // IN1 - input port 2 / PSG second control register
map(0x8000, 0xbfff).bankr(m_prg_banks[0]).w(FUNC(cham24_state::cham24_mapper_w));
map(0xc000, 0xffff).bankr(m_prg_banks[1]).w(FUNC(cham24_state::cham24_mapper_w));
}
@ -201,20 +185,20 @@ void cham24_state::cham24_ppu_map(address_map &map)
}
static INPUT_PORTS_START( cham24 )
PORT_START("P1") /* IN0 */
PORT_START("P1") // IN0
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) /* Select */
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) // Select
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
PORT_START("P2") /* IN1 */
PORT_START("P2") // IN1
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) /* Select */
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) // Select
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
@ -226,8 +210,8 @@ INPUT_PORTS_END
void cham24_state::machine_start()
{
m_nt_ram = std::make_unique<u8[]>(0x800);
for (int i = 0; i < 4; i++)
m_nt_page[i]->configure_entries(0, 2, m_nt_ram.get(), 0x400);
for (auto &page : m_nt_page)
page->configure_entries(0, 2, m_nt_ram.get(), 0x400);
// set up code banking to be done in 16K chunks
m_prg_chunks = memregion("user1")->bytes() / 0x4000;
@ -236,6 +220,10 @@ void cham24_state::machine_start()
// gfx banking always done in 8K chunks
m_chr_bank->configure_entries(0, memregion("gfx1")->bytes() / 0x2000, memregion("gfx1")->base(), 0x2000);
save_item(NAME(m_input_latch));
save_item(NAME(m_input_strobe));
save_pointer(NAME(m_nt_ram), 0x800);
}
void cham24_state::machine_reset()
@ -251,23 +239,23 @@ void cham24_state::machine_reset()
void cham24_state::cham24(machine_config &config)
{
/* basic machine hardware */
// basic machine hardware
RP2A03G(config, m_maincpu, NTSC_APU_CLOCK);
m_maincpu->set_addrmap(AS_PROGRAM, &cham24_state::cham24_map);
/* video hardware */
// video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(60);
screen.set_size(32*8, 262);
screen.set_visarea(0*8, 32*8-1, 0*8, 30*8-1);
screen.set_screen_update("ppu", FUNC(ppu2c0x_device::screen_update));
screen.set_screen_update(m_ppu, FUNC(ppu2c0x_device::screen_update));
PPU_2C02(config, m_ppu);
m_ppu->set_addrmap(0, &cham24_state::cham24_ppu_map);
m_ppu->set_cpu_tag(m_maincpu);
m_ppu->int_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
/* sound hardware */
// sound hardware
SPEAKER(config, "mono").front_center();
m_maincpu->add_route(ALL_OUTPUTS, "mono", 0.50);
}
@ -291,4 +279,4 @@ ROM_END
} // Anonymous namespace
GAME( 2002, cham24, 0, cham24, cham24, cham24_state, empty_init, ROT0, "bootleg", "Chameleon 24", MACHINE_NOT_WORKING )
GAME( 2002, cham24, 0, cham24, cham24, cham24_state, empty_init, ROT0, "bootleg", "Chameleon 24", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )

View File

@ -126,7 +126,6 @@ private:
uint8_t m_money_reg = 0;
void set_mirroring(int mirroring);
void sprite_dma_w(address_space &space, uint8_t data);
uint8_t famibox_IN0_r();
uint8_t famibox_IN1_r();
void famibox_IN0_w(uint8_t data);
@ -170,19 +169,6 @@ void famibox_state::set_mirroring(int mirroring)
}
}
/******************************************************
NES interface
*******************************************************/
void famibox_state::sprite_dma_w(address_space &space, uint8_t data)
{
int source = data & 7;
m_ppu->spriteram_dma(space, source);
}
/******************************************************
Inputs
@ -396,7 +382,7 @@ void famibox_state::famibox_map(address_map &map)
{
map(0x0000, 0x1fff).ram();
map(0x2000, 0x3fff).rw(m_ppu, FUNC(ppu2c0x_device::read), FUNC(ppu2c0x_device::write));
map(0x4014, 0x4014).w(FUNC(famibox_state::sprite_dma_w));
map(0x4014, 0x4014).w(m_ppu, FUNC(ppu2c0x_device::spriteram_dma));
map(0x4016, 0x4016).rw(FUNC(famibox_state::famibox_IN0_r), FUNC(famibox_state::famibox_IN0_w)); // IN0 - input port 1
map(0x4017, 0x4017).r(FUNC(famibox_state::famibox_IN1_r)); // IN1 - input port 2 / PSG second control register
map(0x5000, 0x5fff).rw(FUNC(famibox_state::famibox_system_r), FUNC(famibox_state::famibox_system_w));

View File

@ -191,7 +191,6 @@ private:
uint8_t m_supergm3_prg_bank;
uint8_t m_supergm3_chr_bank;
void sprite_dma_w(address_space &space, uint8_t data);
uint8_t multigam_IN0_r();
void multigam_IN0_w(uint8_t data);
uint8_t multigam_IN1_r();
@ -281,18 +280,6 @@ void multigam_state::set_videoram_bank( int start, int count, int bank, int bank
}
}
/******************************************************
NES interface
*******************************************************/
void multigam_state::sprite_dma_w(address_space &space, uint8_t data)
{
int source = (data & 7);
m_ppu->spriteram_dma(space, source);
}
/******************************************************
@ -395,7 +382,7 @@ void multigam_state::multigam_map(address_map &map)
map(0x0000, 0x07ff).ram(); /* NES RAM */
map(0x0800, 0x0fff).ram(); /* additional RAM */
map(0x2000, 0x3fff).rw(m_ppu, FUNC(ppu2c0x_device::read), FUNC(ppu2c0x_device::write));
map(0x4014, 0x4014).w(FUNC(multigam_state::sprite_dma_w));
map(0x4014, 0x4014).w(m_ppu, FUNC(ppu2c0x_device::spriteram_dma));
map(0x4016, 0x4016).rw(FUNC(multigam_state::multigam_IN0_r), FUNC(multigam_state::multigam_IN0_w)); /* IN0 - input port 1 */
map(0x4017, 0x4017).r(FUNC(multigam_state::multigam_IN1_r)); /* IN1 - input port 2 / PSG second control register */
map(0x5000, 0x5ffe).rom();
@ -414,7 +401,7 @@ void multigam_state::multigmt_map(address_map &map)
map(0x2000, 0x3fff).rw(m_ppu, FUNC(ppu2c0x_device::read), FUNC(ppu2c0x_device::write));
map(0x3000, 0x3000).w(FUNC(multigam_state::multigam_switch_prg_rom));
map(0x3fff, 0x3fff).w(FUNC(multigam_state::multigam_switch_gfx_rom));
map(0x4014, 0x4014).w(FUNC(multigam_state::sprite_dma_w));
map(0x4014, 0x4014).w(m_ppu, FUNC(ppu2c0x_device::spriteram_dma));
map(0x4016, 0x4016).rw(FUNC(multigam_state::multigam_IN0_r), FUNC(multigam_state::multigam_IN0_w)); /* IN0 - input port 1 */
map(0x4017, 0x4017).r(FUNC(multigam_state::multigam_IN1_r)); /* IN1 - input port 2 / PSG second control register */
map(0x5000, 0x5ffe).rom();
@ -686,7 +673,7 @@ void multigam_state::multigm3_map(address_map &map)
map(0x0000, 0x07ff).ram(); /* NES RAM */
map(0x0800, 0x0fff).ram(); /* additional RAM */
map(0x2000, 0x3fff).rw(m_ppu, FUNC(ppu2c0x_device::read), FUNC(ppu2c0x_device::write));
map(0x4014, 0x4014).w(FUNC(multigam_state::sprite_dma_w));
map(0x4014, 0x4014).w(m_ppu, FUNC(ppu2c0x_device::spriteram_dma));
map(0x4016, 0x4016).rw(FUNC(multigam_state::multigam_IN0_r), FUNC(multigam_state::multigam_IN0_w)); /* IN0 - input port 1 */
map(0x4017, 0x4017).r(FUNC(multigam_state::multigam_IN1_r)); /* IN1 - input port 2 / PSG second control register */
map(0x5001, 0x5001).w(FUNC(multigam_state::multigm3_switch_prg_rom));
@ -980,7 +967,7 @@ void multigam_state::supergm3_map(address_map &map)
map(0x0000, 0x07ff).ram(); /* NES RAM */
map(0x0800, 0x0fff).ram(); /* additional RAM */
map(0x2000, 0x3fff).rw(m_ppu, FUNC(ppu2c0x_device::read), FUNC(ppu2c0x_device::write));
map(0x4014, 0x4014).w(FUNC(multigam_state::sprite_dma_w));
map(0x4014, 0x4014).w(m_ppu, FUNC(ppu2c0x_device::spriteram_dma));
map(0x4016, 0x4016).rw(FUNC(multigam_state::multigam_IN0_r), FUNC(multigam_state::multigam_IN0_w)); /* IN0 - input port 1 */
map(0x4017, 0x4017).r(FUNC(multigam_state::multigam_IN1_r)); /* IN1 - input port 2 / PSG second control register */
map(0x4fff, 0x4fff).portr("IN0");

View File

@ -20,16 +20,11 @@
#include "speaker.h"
void nes_state::nes_vh_sprite_dma_w(address_space &space, uint8_t data)
{
m_ppu->spriteram_dma(space, data);
}
void nes_state::nes_map(address_map &map)
{
map(0x0000, 0x07ff).ram().mirror(0x1800).share("mainram"); // RAM
map(0x2000, 0x3fff).rw(m_ppu, FUNC(ppu2c0x_device::read), FUNC(ppu2c0x_device::write)); // PPU registers
map(0x4014, 0x4014).w(FUNC(nes_state::nes_vh_sprite_dma_w)); // stupid address space hole
map(0x4014, 0x4014).w(m_ppu, FUNC(ppu2c0x_device::spriteram_dma)); // stupid address space hole
map(0x4016, 0x4016).rw(FUNC(nes_state::nes_in0_r), FUNC(nes_state::nes_in0_w)); // IN0 - input port 1
map(0x4017, 0x4017).r(FUNC(nes_state::nes_in1_r)); // IN1 - input port 2
// 0x4100-0x5fff -> LOW HANDLER defined on a pcb base

View File

@ -64,7 +64,6 @@ public:
uint8_t fc_in0_r();
uint8_t fc_in1_r();
void fc_in0_w(uint8_t data);
void nes_vh_sprite_dma_w(address_space &space, uint8_t data);
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void video_start() override;

View File

@ -182,7 +182,7 @@ void nes_arcade_bl_state::nes_cpu_map(address_map &map)
{
map(0x0000, 0x07ff).mirror(0x1800).ram();
map(0x2000, 0x3fff).rw(m_ppu, FUNC(ppu2c0x_device::read), FUNC(ppu2c0x_device::write));
map(0x4014, 0x4014).lw8(NAME([this] (address_space &space, u8 data) { m_ppu->spriteram_dma(space, data); }));
map(0x4014, 0x4014).w(m_ppu, FUNC(ppu2c0x_device::spriteram_dma));
map(0x4016, 0x4016).rw(FUNC(nes_arcade_bl_state::in_r<0>), FUNC(nes_arcade_bl_state::in0_w)); // IN0 - input port 1
map(0x4017, 0x4017).r(FUNC(nes_arcade_bl_state::in_r<1>)); // IN1 - input port 2 / PSG second control register

View File

@ -35,8 +35,6 @@ protected:
virtual void machine_reset() override;
virtual void video_start() override;
void sprite_dma_w(address_space &space, uint8_t data);
virtual uint8_t in0_r();
virtual uint8_t in1_r();
virtual void in0_w(uint8_t data);
@ -246,12 +244,6 @@ private:
};
void nes_clone_state::sprite_dma_w(address_space &space, uint8_t data)
{
int source = (data & 7);
m_ppu->spriteram_dma(space, source);
}
// Standard NES style inputs (not using bus device as there are no real NES controller ports etc. these are all-in-one units and can be custom
uint8_t nes_clone_state::in0_r()
{
@ -292,10 +284,10 @@ void nes_clone_state::nes_clone_basemap(address_map& map)
map(0x0000, 0x07ff).ram();
map(0x2000, 0x3fff).rw(m_ppu, FUNC(ppu2c0x_device::read), FUNC(ppu2c0x_device::write));
map(0x4014, 0x4014).w(m_ppu, FUNC(ppu2c0x_device::spriteram_dma));
map(0x4016, 0x4016).rw(FUNC(nes_clone_state::in0_r), FUNC(nes_clone_state::in0_w));
map(0x4017, 0x4017).r(FUNC(nes_clone_state::in1_r));
map(0x4014, 0x4014).w(FUNC(nes_clone_state::sprite_dma_w));
}
void nes_clone_state::nes_clone_map(address_map& map)

View File

@ -187,7 +187,7 @@ void m8_state::m8_map(address_map &map)
{
map(0x0000, 0x07ff).mirror(0x1800).ram();
map(0x2000, 0x3fff).rw(m_ppu, FUNC(ppu2c0x_device::read), FUNC(ppu2c0x_device::write));
map(0x4014, 0x4014).lw8(NAME([this] (address_space &space, u8 data) { m_ppu->spriteram_dma(space, data); }));
map(0x4014, 0x4014).w(m_ppu, FUNC(ppu2c0x_device::spriteram_dma));
map(0x4016, 0x4016).rw(FUNC(m8_state::m8_in0_r), FUNC(m8_state::m8_in0_w)); // IN0 - input port 1
map(0x4017, 0x4017).r(FUNC(m8_state::m8_in1_r)); // IN1 - input port 2 / PSG second control register

View File

@ -131,7 +131,7 @@ void m82_state::m82_map(address_map &map)
{
map(0x0000, 0x07ff).mirror(0x1800).ram();
map(0x2000, 0x3fff).rw(m_ppu, FUNC(ppu2c0x_device::read), FUNC(ppu2c0x_device::write));
map(0x4014, 0x4014).lw8(NAME([this] (address_space &space, u8 data) { m_ppu->spriteram_dma(space, data); }));
map(0x4014, 0x4014).w(m_ppu, FUNC(ppu2c0x_device::spriteram_dma));
map(0x4016, 0x4016).rw(FUNC(m82_state::m82_in0_r), FUNC(m82_state::m82_in0_w)); // IN0 - input port 1
map(0x4017, 0x4017).r(FUNC(m82_state::m82_in1_r)); // IN1 - input port 2 / PSG second control register

View File

@ -55,8 +55,6 @@ protected:
virtual void machine_reset() override;
virtual void video_start() override;
void sprite_dma_w(address_space &space, uint8_t data);
virtual void io_w(uint8_t data);
virtual void extio_w(uint8_t data);
bool m_isbanked;
@ -179,11 +177,6 @@ void nes_sh6578_state::bank_w(int bank, uint16_t offset, uint8_t data)
m_fullrom->write8(address, data);
}
void nes_sh6578_state::sprite_dma_w(address_space &space, uint8_t data)
{
m_ppu->spriteram_dma(space, data);
}
uint8_t nes_sh6578_state::bankswitch_r(offs_t offset)
{
return m_bankswitch[offset];
@ -469,7 +462,7 @@ void nes_sh6578_state::nes_sh6578_map(address_map& map)
map(0x2040, 0x207f).rw(m_ppu, FUNC(ppu_sh6578_device::palette_read), FUNC(ppu_sh6578_device::palette_write));
map(0x4000, 0x4017).w(m_apu, FUNC(nesapu_device::write));
map(0x4014, 0x4014).w(FUNC(nes_sh6578_state::sprite_dma_w));
map(0x4014, 0x4014).w(m_ppu, FUNC(ppu_sh6578_device::spriteram_dma));
map(0x4015, 0x4015).r(m_apu, FUNC(nesapu_device::status_r));
map(0x4016, 0x4016).rw(FUNC(nes_sh6578_state::io0_r), FUNC(nes_sh6578_state::io_w));
map(0x4017, 0x4017).r(FUNC(nes_sh6578_state::io1_r));

View File

@ -367,7 +367,6 @@ private:
DECLARE_WRITE_LINE_MEMBER(up8w_w);
u8 ram_8w_r(offs_t offset);
void ram_8w_w(offs_t offset, u8 data);
void sprite_dma_w(address_space &space, u8 data);
void time_w(offs_t offset, u8 data);
DECLARE_WRITE_LINE_MEMBER(sdcs_w);
DECLARE_WRITE_LINE_MEMBER(cntrl_mask_w);
@ -646,11 +645,6 @@ void playch10_state::ram_8w_w(offs_t offset, u8 data)
m_ram_8w[offset] = data;
}
void playch10_state::sprite_dma_w(address_space &space, u8 data)
{
m_ppu->spriteram_dma(space, data);
}
// Only used in single monitor bios
void playch10_state::time_w(offs_t offset, u8 data)
@ -1519,7 +1513,7 @@ void playch10_state::cart_map(address_map &map)
{
map(0x0000, 0x07ff).mirror(0x1800).ram();
map(0x2000, 0x3fff).rw(m_ppu, FUNC(ppu2c0x_device::read), FUNC(ppu2c0x_device::write));
map(0x4014, 0x4014).w(FUNC(playch10_state::sprite_dma_w));
map(0x4014, 0x4014).w(m_ppu, FUNC(ppu2c0x_device::spriteram_dma));
map(0x4016, 0x4016).rw(FUNC(playch10_state::pc10_in0_r), FUNC(playch10_state::pc10_in0_w));
map(0x4017, 0x4017).r(FUNC(playch10_state::pc10_in1_r)); // IN1 - input port 2 / PSG second control register
// Games that don't bank PRG

View File

@ -186,7 +186,6 @@ protected:
virtual void machine_reset() override;
template <u8 Side> void sprite_dma_w(address_space &space, u8 data);
template <u8 Side> void vsnes_coin_counter_w(offs_t offset, u8 data);
template <u8 Side> u8 vsnes_coin_counter_r(offs_t offset);
template <u8 Side> void vsnes_in0_w(u8 data);
@ -355,15 +354,6 @@ private:
//******************************************************************************
template <u8 Side>
void vs_base_state::sprite_dma_w(address_space &space, u8 data)
{
if (Side == MAIN)
m_ppu1->spriteram_dma(space, data & 0x07);
else
m_ppu2->spriteram_dma(space, data & 0x07);
}
template <u8 Side>
void vs_base_state::vsnes_coin_counter_w(offs_t offset, u8 data)
{
@ -996,7 +986,7 @@ void vs_base_state::vsnes_cpu1_map(address_map &map)
{
map(0x0000, 0x07ff).mirror(0x1800).ram();
map(0x2000, 0x3fff).rw(m_ppu1, FUNC(ppu2c0x_device::read), FUNC(ppu2c0x_device::write));
map(0x4014, 0x4014).w(FUNC(vs_base_state::sprite_dma_w<MAIN>));
map(0x4014, 0x4014).w(m_ppu1, FUNC(ppu2c0x_device::spriteram_dma));
map(0x4016, 0x4016).rw(FUNC(vs_base_state::vsnes_in0_r<MAIN>), FUNC(vs_base_state::vsnes_in0_w<MAIN>));
map(0x4017, 0x4017).r(FUNC(vs_base_state::vsnes_in1_r<MAIN>)); // IN1 - input port 2 / PSG second control register
map(0x4020, 0x5fff).rw(FUNC(vs_base_state::vsnes_coin_counter_r<MAIN>), FUNC(vs_base_state::vsnes_coin_counter_w<MAIN>));
@ -1015,7 +1005,7 @@ void vs_base_state::vsnes_cpu2_map(address_map &map)
{
map(0x0000, 0x07ff).mirror(0x1800).ram();
map(0x2000, 0x3fff).rw(m_ppu2, FUNC(ppu2c0x_device::read), FUNC(ppu2c0x_device::write));
map(0x4014, 0x4014).w(FUNC(vs_base_state::sprite_dma_w<SUB>));
map(0x4014, 0x4014).w(m_ppu2, FUNC(ppu2c0x_device::spriteram_dma));
map(0x4016, 0x4016).rw(FUNC(vs_base_state::vsnes_in0_r<SUB>), FUNC(vs_base_state::vsnes_in0_w<SUB>));
map(0x4017, 0x4017).r(FUNC(vs_base_state::vsnes_in1_r<SUB>)); // IN1 - input port 2 / PSG second control register
map(0x4020, 0x5fff).rw(FUNC(vs_base_state::vsnes_coin_counter_r<SUB>), FUNC(vs_base_state::vsnes_coin_counter_w<SUB>));