summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2018-03-28 19:55:32 -0400
committer AJR <ajrhacker@users.noreply.github.com>2018-03-28 19:55:32 -0400
commitead9bc470a667e022eab3a216c63f329f4751682 (patch)
treeb6cff4188ee6e03dfbc9ae5fd6965b86564b5641
parent191918ee1ede59495ce9dededb9ebd58c52ed23f (diff)
nss.cpp, playch10.cpp: Replace MCFG_CPU_VBLANK_INT with line callbacks (nw)
-rw-r--r--src/mame/drivers/nss.cpp26
-rw-r--r--src/mame/drivers/playch10.cpp18
-rw-r--r--src/mame/includes/playch10.h2
3 files changed, 26 insertions, 20 deletions
diff --git a/src/mame/drivers/nss.cpp b/src/mame/drivers/nss.cpp
index c70f3c7fd4d..bd34cc6d7ee 100644
--- a/src/mame/drivers/nss.cpp
+++ b/src/mame/drivers/nss.cpp
@@ -309,13 +309,15 @@ class nss_state : public snes_state
{
public:
nss_state(const machine_config &mconfig, device_type type, const char *tag)
- : snes_state(mconfig, type, tag),
- m_m50458(*this,"m50458"),
- m_s3520cf(*this, "s3520cf"),
- m_rp5h01(*this,"rp5h01"),
- m_palette(*this, "palette")
+ : snes_state(mconfig, type, tag)
+ , m_bioscpu(*this, "bios")
+ , m_m50458(*this, "m50458")
+ , m_s3520cf(*this, "s3520cf")
+ , m_rp5h01(*this, "rp5h01")
+ , m_palette(*this, "palette")
{ }
+ required_device<cpu_device> m_bioscpu;
required_device<m50458_device> m_m50458;
required_device<s3520cf_device> m_s3520cf;
required_device<rp5h01_device> m_rp5h01;
@@ -323,7 +325,7 @@ public:
uint8_t m_wram_wp_flag;
std::unique_ptr<uint8_t[]> m_wram;
- uint8_t m_nmi_enable;
+ bool m_nmi_enable;
uint8_t m_cart_sel;
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
@@ -345,7 +347,7 @@ public:
DECLARE_CUSTOM_INPUT_MEMBER(game_over_flag_r);
virtual void machine_start() override;
virtual void machine_reset() override;
- INTERRUPT_GEN_MEMBER(nss_vblank_irq);
+ DECLARE_WRITE_LINE_MEMBER(nss_vblank_irq);
DECLARE_READ8_MEMBER(spc_ram_100_r);
DECLARE_WRITE8_MEMBER(spc_ram_100_w);
void nss(machine_config &config);
@@ -554,6 +556,8 @@ WRITE8_MEMBER(nss_state::port_00_w)
*/
m_wram_wp_flag = (data & 4) >> 2;
m_nmi_enable = data & 1;
+ if (!m_nmi_enable)
+ m_bioscpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
}
@@ -800,10 +804,10 @@ static INPUT_PORTS_START( snes )
INPUT_PORTS_END
-INTERRUPT_GEN_MEMBER(nss_state::nss_vblank_irq)
+WRITE_LINE_MEMBER(nss_state::nss_vblank_irq)
{
- if(m_nmi_enable)
- device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ if (state && m_nmi_enable)
+ m_bioscpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
void nss_state::machine_reset()
@@ -840,7 +844,6 @@ MACHINE_CONFIG_START(nss_state::nss)
MCFG_CPU_ADD("bios", Z80, 4000000)
MCFG_CPU_PROGRAM_MAP(bios_map)
MCFG_CPU_IO_MAP(bios_io_map)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", nss_state, nss_vblank_irq)
MCFG_M50458_ADD("m50458", 4000000, "osd") /* TODO: correct clock */
MCFG_S3520CF_ADD("s3520cf") /* RTC */
@@ -861,6 +864,7 @@ MACHINE_CONFIG_START(nss_state::nss)
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(DOTCLK_NTSC, SNES_HTOTAL, 0, SNES_SCR_WIDTH, SNES_VTOTAL_NTSC, 0, SNES_SCR_HEIGHT_NTSC)
MCFG_SCREEN_UPDATE_DRIVER( snes_state, screen_update )
+ MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(nss_state, nss_vblank_irq))
MCFG_DEVICE_ADD("ppu", SNES_PPU, 0)
MCFG_SNES_PPU_OPENBUS_CB(READ8(snes_state, snes_open_bus_r))
diff --git a/src/mame/drivers/playch10.cpp b/src/mame/drivers/playch10.cpp
index 1840b53f283..29c571c9772 100644
--- a/src/mame/drivers/playch10.cpp
+++ b/src/mame/drivers/playch10.cpp
@@ -632,14 +632,16 @@ static GFXDECODE_START( playch10 )
GFXDECODE_ENTRY( "gfx1", 0, bios_charlayout, 0, 32 )
GFXDECODE_END
-INTERRUPT_GEN_MEMBER(playch10_state::playch10_interrupt){
- /* LS161A, Sheet 1 - bottom left of Z80 */
- if ( !m_pc10_dog_di && !m_pc10_nmi_enable ) {
- device.execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE );
+WRITE_LINE_MEMBER(playch10_state::vblank_irq)
+{
+ if (state)
+ {
+ /* LS161A, Sheet 1 - bottom left of Z80 */
+ if (!m_pc10_dog_di && !m_pc10_nmi_enable)
+ m_maincpu->set_input_line(INPUT_LINE_RESET, PULSE_LINE);
+ else if (m_pc10_nmi_enable)
+ m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
-
- else if ( m_pc10_nmi_enable )
- device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
MACHINE_CONFIG_START(playch10_state::playch10)
@@ -647,7 +649,6 @@ MACHINE_CONFIG_START(playch10_state::playch10)
MCFG_CPU_ADD("maincpu", Z80, 8000000/2) // 4 MHz
MCFG_CPU_PROGRAM_MAP(bios_map)
MCFG_CPU_IO_MAP(bios_io_map)
- MCFG_CPU_VBLANK_INT_DRIVER("top", playch10_state, playch10_interrupt)
MCFG_CPU_ADD("cart", N2A03, NTSC_APU_CLOCK)
MCFG_CPU_PROGRAM_MAP(cart_map)
@@ -679,6 +680,7 @@ MACHINE_CONFIG_START(playch10_state::playch10)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 30*8-1)
MCFG_SCREEN_UPDATE_DRIVER(playch10_state, screen_update_playch10_top)
MCFG_SCREEN_PALETTE("palette")
+ MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(playch10_state, vblank_irq))
MCFG_SCREEN_ADD("bottom", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/includes/playch10.h b/src/mame/includes/playch10.h
index f59909448fa..c726a513cf2 100644
--- a/src/mame/includes/playch10.h
+++ b/src/mame/includes/playch10.h
@@ -103,7 +103,7 @@ private:
DECLARE_PALETTE_INIT(playch10);
DECLARE_MACHINE_START(playch10_hboard);
DECLARE_VIDEO_START(playch10_hboard);
- INTERRUPT_GEN_MEMBER(playch10_interrupt);
+ DECLARE_WRITE_LINE_MEMBER(vblank_irq);
void pc10_set_videorom_bank( int first, int count, int bank, int size );
void set_videoram_bank( int first, int count, int bank, int size );