summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/mario.c
diff options
context:
space:
mode:
author Angelo Salese <angelosa@users.noreply.github.com>2011-11-29 17:08:30 +0000
committer Angelo Salese <angelosa@users.noreply.github.com>2011-11-29 17:08:30 +0000
commit02203fedfa63a97b93be754d3e0d820e01f6bd9f (patch)
treedaef2bed3715662797549eb082334247cc168c03 /src/mame/drivers/mario.c
parent24ee0f0d2f651465a37b54f1127148de90bc339b (diff)
Removed ugly function interrupt_enable_w from the core, and updated all the drivers that used it accordingly [Angelo Salese]
Fixed scratchy sound in Birdiy, unlike all other Pac-Man HW games irq mask is at $5001 instead of $5000, so fixing that fixed the sound as well [Angelo Salese] Fixed bogus irq/nmi mask bit in Yie Ar Kung-Fu (IRQ mask bit was masking BOTH lines before) [Angelo Salese] Fixed bogus irq mask to sound CPU in Syusse Oozumou [Angelo Salese] Fixed bogus irq mask bit in SNK6502 HW games (IRQ mask bit was masking BOTH lines before) [Angelo Salese] Marked Truco Clemente as GNW since it never really worked (coin chutes stops working after one play), nw Out of whatsnew: And then I've realized that there's also cpu_interrupt_enable() function, another 19 instances to kill ... -.-"
Diffstat (limited to 'src/mame/drivers/mario.c')
-rw-r--r--src/mame/drivers/mario.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/mame/drivers/mario.c b/src/mame/drivers/mario.c
index 8a238d61fe1..6822c161b52 100644
--- a/src/mame/drivers/mario.c
+++ b/src/mame/drivers/mario.c
@@ -120,6 +120,12 @@ static WRITE8_DEVICE_HANDLER( mario_z80dma_rdy_w )
z80dma_rdy_w(device, data & 0x01);
}
+static WRITE8_HANDLER( nmi_mask_w )
+{
+ mario_state *state = space->machine().driver_data<mario_state>();
+
+ state->m_nmi_mask = data & 1;
+}
/*************************************
*
@@ -138,7 +144,7 @@ static ADDRESS_MAP_START( mario_map, AS_PROGRAM, 8 )
AM_RANGE(0x7e80, 0x7e80) AM_WRITE(mario_gfxbank_w)
AM_RANGE(0x7e82, 0x7e82) AM_WRITE(mario_flip_w)
AM_RANGE(0x7e83, 0x7e83) AM_WRITE(mario_palettebank_w)
- AM_RANGE(0x7e84, 0x7e84) AM_WRITE(interrupt_enable_w)
+ AM_RANGE(0x7e84, 0x7e84) AM_WRITE(nmi_mask_w)
AM_RANGE(0x7e85, 0x7e85) AM_DEVWRITE("z80dma", mario_z80dma_rdy_w) /* ==> DMA Chip */
AM_RANGE(0x7f00, 0x7f07) AM_WRITE(mario_sh3_w) /* Sound port */
AM_RANGE(0x7f80, 0x7f80) AM_READ_PORT("DSW") /* DSW */
@@ -158,7 +164,7 @@ static ADDRESS_MAP_START( masao_map, AS_PROGRAM, 8 )
AM_RANGE(0x7e80, 0x7e80) AM_WRITE(mario_gfxbank_w)
AM_RANGE(0x7e82, 0x7e82) AM_WRITE(mario_flip_w)
AM_RANGE(0x7e83, 0x7e83) AM_WRITE(mario_palettebank_w)
- AM_RANGE(0x7e84, 0x7e84) AM_WRITE(interrupt_enable_w)
+ AM_RANGE(0x7e84, 0x7e84) AM_WRITE(nmi_mask_w)
AM_RANGE(0x7e85, 0x7e85) AM_DEVWRITE("z80dma", mario_z80dma_rdy_w) /* ==> DMA Chip */
AM_RANGE(0x7f00, 0x7f00) AM_WRITE(masao_sh_irqtrigger_w)
AM_RANGE(0x7f80, 0x7f80) AM_READ_PORT("DSW") /* DSW */
@@ -317,13 +323,21 @@ GFXDECODE_END
*
*************************************/
+static INTERRUPT_GEN( vblank_irq )
+{
+ mario_state *state = device->machine().driver_data<mario_state>();
+
+ if(state->m_nmi_mask)
+ device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
+}
+
static MACHINE_CONFIG_START( mario_base, mario_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, Z80_CLOCK) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(mario_map)
MCFG_CPU_IO_MAP(mario_io_map)
- MCFG_CPU_VBLANK_INT("screen", nmi_line_pulse)
+ MCFG_CPU_VBLANK_INT("screen", vblank_irq)
/* devices */
MCFG_Z80DMA_ADD("z80dma", Z80_CLOCK, mario_dma)