diff --git a/src/mame/drivers/bmcbowl.c b/src/mame/drivers/bmcbowl.c index 417e6687d0f..ff195fc859d 100644 --- a/src/mame/drivers/bmcbowl.c +++ b/src/mame/drivers/bmcbowl.c @@ -34,7 +34,7 @@ TODO: - scroll (writes to $91800 and VIA port A - not used in game (only in test mode)) - music - writes ($20-$30 bytes) to $93000-$93003 range - - VIA 6522(interrupt gen , ports) + - VIA 6522(ports) - Crt - interrupts - missing gfx elements @@ -101,7 +101,6 @@ Main board: */ #include "emu.h" -#include "deprecat.h" #include "cpu/m68000/m68000.h" #include "machine/6522via.h" #include "sound/ay8910.h" @@ -246,9 +245,9 @@ static WRITE8_DEVICE_HANDLER(via_ca2_out) } -static void via_irq(device_t *device, int state) +static WRITE8_DEVICE_HANDLER(via_irq) { - //used + cputag_set_input_line(device->machine(), "maincpu", 4, data ? ASSERT_LINE : CLEAR_LINE); } @@ -481,26 +480,17 @@ static const via6522_interface via_interface = /*inputs : CA/B1,CA/B2 */ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, /*outputs: A/B */ DEVCB_HANDLER(via_a_out), DEVCB_HANDLER(via_b_out), /*outputs: CA/B1,CA/B2 */ DEVCB_NULL, DEVCB_NULL, DEVCB_HANDLER(via_ca2_out), DEVCB_NULL, - /*irq */ DEVCB_LINE(via_irq) + /*irq */ DEVCB_HANDLER(via_irq) }; static MACHINE_RESET( bmcbowl ) { } -static INTERRUPT_GEN( bmc_interrupt ) -{ - if (cpu_getiloops(device)) - device_set_input_line(device, 4, HOLD_LINE); - else - device_set_input_line(device, 2, HOLD_LINE); -} - static MACHINE_CONFIG_START( bmcbowl, bmcbowl_state ) MCFG_CPU_ADD("maincpu", M68000, 21477270/2 ) MCFG_CPU_PROGRAM_MAP(bmcbowl_mem) - MCFG_CPU_VBLANK_INT_HACK(bmc_interrupt,2) - + MCFG_CPU_VBLANK_INT("screen",irq2_line_hold) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -556,4 +546,4 @@ static DRIVER_INIT(bmcbowl) state->m_bmc_colorram = auto_alloc_array(machine, UINT8, 768); } -GAME( 1994, bmcbowl, 0, bmcbowl, bmcbowl, bmcbowl, ROT0, "BMC", "BMC Bowling", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) +GAME( 1994, bmcbowl, 0, bmcbowl, bmcbowl, bmcbowl, ROT0, "BMC", "Konkyuu no Hoshi", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/bsktball.c b/src/mame/drivers/bsktball.c index 060449a538d..b8b1d71a9fd 100644 --- a/src/mame/drivers/bsktball.c +++ b/src/mame/drivers/bsktball.c @@ -25,7 +25,6 @@ #include "emu.h" #include "cpu/m6502/m6502.h" -#include "deprecat.h" #include "includes/bsktball.h" #include "sound/discrete.h" @@ -215,7 +214,7 @@ static MACHINE_START( bsktball ) bsktball_state *state = machine.driver_data(); state->save_item(NAME(state->m_nmi_on)); - state->save_item(NAME(state->m_i256v)); +// state->save_item(NAME(state->m_i256v)); state->save_item(NAME(state->m_ld1)); state->save_item(NAME(state->m_ld2)); state->save_item(NAME(state->m_dir0)); @@ -233,7 +232,7 @@ static MACHINE_RESET( bsktball ) bsktball_state *state = machine.driver_data(); state->m_nmi_on = 0; - state->m_i256v = 0; +// state->m_i256v = 0; state->m_ld1 = 0; state->m_ld2 = 0; state->m_dir0 = 0; @@ -252,7 +251,7 @@ static MACHINE_CONFIG_START( bsktball, bsktball_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M6502,750000) MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_CPU_VBLANK_INT_HACK(bsktball_interrupt,8) + MCFG_TIMER_ADD_SCANLINE("scantimer", bsktball_scanline, "screen", 0, 1) MCFG_MACHINE_START(bsktball) MCFG_MACHINE_RESET(bsktball) diff --git a/src/mame/drivers/bublbobl.c b/src/mame/drivers/bublbobl.c index 45d5210ef13..1b4c915c760 100644 --- a/src/mame/drivers/bublbobl.c +++ b/src/mame/drivers/bublbobl.c @@ -269,7 +269,6 @@ TODO: #include "emu.h" #include "cpu/z80/z80.h" #include "cpu/m6800/m6800.h" -#include "deprecat.h" #include "sound/2203intf.h" #include "sound/3526intf.h" #include "cpu/m6805/m6805.h" @@ -958,7 +957,7 @@ static MACHINE_CONFIG_DERIVED( bub68705, bublbobl ) MCFG_CPU_ADD("mcu", M68705, 4000000) // xtal is 4MHz, divided by 4 internally MCFG_CPU_PROGRAM_MAP(bootlegmcu_map) - MCFG_CPU_VBLANK_INT_HACK(bublbobl_m68705_interrupt, 2) // ??? should come from the same clock which latches the INT pin on the second Z80 + MCFG_CPU_VBLANK_INT("screen",bublbobl_m68705_interrupt) // ??? should come from the same clock which latches the INT pin on the second Z80 MCFG_MACHINE_START(bub68705) MCFG_MACHINE_RESET(bub68705) diff --git a/src/mame/drivers/srmp2.c b/src/mame/drivers/srmp2.c index 9a98495c29d..972613cf108 100644 --- a/src/mame/drivers/srmp2.c +++ b/src/mame/drivers/srmp2.c @@ -42,7 +42,9 @@ Known issues : - AY-3-8910 sound may be wrong. - CPU clock of srmp3 does not match the real machine. - MSM5205 clock frequency in srmp3 is wrong. - + - irq acknowledge in either srmp2 and mjyuugi is a raw guess, there are multiple + writes at the end of irq services and it isn't easy to determine what's the + exact irq ack without HW tests ... Note: ====== @@ -54,7 +56,6 @@ Note: #include "emu.h" -#include "deprecat.h" #include "cpu/z80/z80.h" #include "cpu/m68000/m68000.h" #include "sound/ay8910.h" @@ -62,21 +63,6 @@ Note: #include "includes/srmp2.h" #include "machine/nvram.h" -/*************************************************************************** - - Interrupt(s) - -***************************************************************************/ - -static INTERRUPT_GEN( srmp2_interrupt ) -{ - switch (cpu_getiloops(device)) - { - case 0: device_set_input_line(device, 4, HOLD_LINE); break; /* vblank */ - default: device_set_input_line(device, 2, HOLD_LINE); break; /* sound */ - } -} - /*************************************************************************** Configure IOX @@ -393,6 +379,16 @@ static WRITE8_HANDLER( srmp3_rombank_w ) **************************************************************************/ +static WRITE8_HANDLER( srmp2_irq2_ack_w ) +{ + cputag_set_input_line(space->machine(), "maincpu", 2, CLEAR_LINE); +} + +static WRITE8_HANDLER( srmp2_irq4_ack_w ) +{ + cputag_set_input_line(space->machine(), "maincpu", 4, CLEAR_LINE); +} + static ADDRESS_MAP_START( srmp2_map, AS_PROGRAM, 16 ) AM_RANGE(0x000000, 0x03ffff) AM_ROM @@ -407,13 +403,24 @@ static ADDRESS_MAP_START( srmp2_map, AS_PROGRAM, 16 ) AM_RANGE(0xa00002, 0xa00003) AM_READWRITE8(iox_status_r,iox_data_w,0x00ff) AM_RANGE(0xb00000, 0xb00001) AM_DEVWRITE("msm", srmp2_adpcm_code_w) /* ADPCM number */ AM_RANGE(0xb00002, 0xb00003) AM_READ8(vox_status_r,0x00ff) /* ADPCM voice status */ - AM_RANGE(0xc00000, 0xc00001) AM_WRITENOP /* ??? */ - AM_RANGE(0xd00000, 0xd00001) AM_WRITENOP /* ??? */ - AM_RANGE(0xe00000, 0xe00001) AM_WRITENOP /* ??? */ + AM_RANGE(0xc00000, 0xc00001) AM_WRITE8(srmp2_irq2_ack_w,0x00ff) /* irq ack lv 2 */ + AM_RANGE(0xd00000, 0xd00001) AM_WRITE8(srmp2_irq4_ack_w,0x00ff) /* irq ack lv 4 */ + AM_RANGE(0xe00000, 0xe00001) AM_WRITENOP /* watchdog */ AM_RANGE(0xf00000, 0xf00001) AM_DEVREAD8("aysnd", ay8910_r, 0x00ff) AM_RANGE(0xf00000, 0xf00003) AM_DEVWRITE8("aysnd", ay8910_address_data_w, 0x00ff) ADDRESS_MAP_END +static READ8_HANDLER( mjyuugi_irq2_ack_r ) +{ + cputag_set_input_line(space->machine(), "maincpu", 2, CLEAR_LINE); + return 0xff; // value returned doesn't matter +} + +static READ8_HANDLER( mjyuugi_irq4_ack_r ) +{ + cputag_set_input_line(space->machine(), "maincpu", 4, CLEAR_LINE); + return 0xff; // value returned doesn't matter +} static ADDRESS_MAP_START( mjyuugi_map, AS_PROGRAM, 16 ) AM_RANGE(0x000000, 0x07ffff) AM_ROM @@ -421,8 +428,8 @@ static ADDRESS_MAP_START( mjyuugi_map, AS_PROGRAM, 16 ) AM_RANGE(0x100000, 0x100001) AM_WRITE(mjyuugi_flags_w) /* Coin Counter */ AM_RANGE(0x100010, 0x100011) AM_READNOP /* ??? */ AM_RANGE(0x100010, 0x100011) AM_WRITE(mjyuugi_adpcm_bank_w) /* ADPCM bank, GFX bank */ - AM_RANGE(0x200000, 0x200001) AM_READNOP /* ??? */ - AM_RANGE(0x300000, 0x300001) AM_READNOP /* ??? */ + AM_RANGE(0x200000, 0x200001) AM_READ8(mjyuugi_irq2_ack_r,0x00ff) /* irq ack lv 2? */ + AM_RANGE(0x300000, 0x300001) AM_READ8(mjyuugi_irq4_ack_r,0x00ff) /* irq ack lv 4? */ AM_RANGE(0x500000, 0x500001) AM_READ_PORT("DSW3-1") /* DSW 3-1 */ AM_RANGE(0x500010, 0x500011) AM_READ_PORT("DSW3-2") /* DSW 3-2 */ AM_RANGE(0x700000, 0x7003ff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE_GENERIC(paletteram) @@ -455,6 +462,10 @@ static WRITE8_HANDLER( srmp3_flags_w ) state->m_gfx_bank = (data >> 6) & 0x03; } +static WRITE8_HANDLER( srmp3_irq_ack_w ) +{ + cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE); +} static ADDRESS_MAP_START( srmp3_map, AS_PROGRAM, 8 ) AM_RANGE(0x0000, 0x7fff) AM_ROM @@ -469,12 +480,12 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( srmp3_io_map, AS_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x20, 0x20) AM_WRITENOP /* elapsed interrupt signal */ - AM_RANGE(0x40, 0x40) AM_READ_PORT("SYSTEM") AM_WRITE(srmp3_flags_w) /* coin, service | GFX bank, counter, lockout */ - AM_RANGE(0x60, 0x60) AM_WRITE(srmp3_rombank_w) /* ROM bank select */ - AM_RANGE(0xa0, 0xa0) AM_DEVWRITE("msm", srmp3_adpcm_code_w) /* ADPCM number */ - AM_RANGE(0xa1, 0xa1) AM_READ(vox_status_r) /* ADPCM voice status */ - AM_RANGE(0xc0, 0xc0) AM_READWRITE(iox_mux_r, iox_command_w) /* key matrix | I/O */ + AM_RANGE(0x20, 0x20) AM_WRITE(srmp3_irq_ack_w) /* interrupt acknowledge */ + AM_RANGE(0x40, 0x40) AM_READ_PORT("SYSTEM") AM_WRITE(srmp3_flags_w) /* coin, service | GFX bank, counter, lockout */ + AM_RANGE(0x60, 0x60) AM_WRITE(srmp3_rombank_w) /* ROM bank select */ + AM_RANGE(0xa0, 0xa0) AM_DEVWRITE("msm", srmp3_adpcm_code_w) /* ADPCM number */ + AM_RANGE(0xa1, 0xa1) AM_READ(vox_status_r) /* ADPCM voice status */ + AM_RANGE(0xc0, 0xc0) AM_READWRITE(iox_mux_r, iox_command_w) /* key matrix | I/O */ AM_RANGE(0xc1, 0xc1) AM_READWRITE(iox_status_r,iox_data_w) AM_RANGE(0xe0, 0xe1) AM_DEVWRITE("aysnd", ay8910_address_data_w) AM_RANGE(0xe2, 0xe2) AM_DEVREAD("aysnd", ay8910_r) @@ -1159,7 +1170,8 @@ static MACHINE_CONFIG_START( srmp2, srmp2_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000,16000000/2) /* 8.00 MHz */ MCFG_CPU_PROGRAM_MAP(srmp2_map) - MCFG_CPU_VBLANK_INT_HACK(srmp2_interrupt,16) /* Interrupt times is not understood */ + MCFG_CPU_VBLANK_INT("screen",irq4_line_assert) + MCFG_CPU_PERIODIC_INT(irq2_line_assert,15*60) /* Interrupt times is not understood */ MCFG_MACHINE_START(srmp2) MCFG_NVRAM_ADD_0FILL("nvram") @@ -1199,7 +1211,7 @@ static MACHINE_CONFIG_START( srmp3, srmp2_state ) // 4000000, /* 4.00 MHz ? */ MCFG_CPU_PROGRAM_MAP(srmp3_map) MCFG_CPU_IO_MAP(srmp3_io_map) - MCFG_CPU_VBLANK_INT("screen", irq0_line_hold) + MCFG_CPU_VBLANK_INT("screen", irq0_line_assert) MCFG_MACHINE_START(srmp3) MCFG_NVRAM_ADD_0FILL("nvram") @@ -1246,7 +1258,8 @@ static MACHINE_CONFIG_START( mjyuugi, srmp2_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000,16000000/2) /* 8.00 MHz */ MCFG_CPU_PROGRAM_MAP(mjyuugi_map) - MCFG_CPU_VBLANK_INT_HACK(srmp2_interrupt,16) /* Interrupt times is not understood */ + MCFG_CPU_VBLANK_INT("screen",irq4_line_assert) + MCFG_CPU_PERIODIC_INT(irq2_line_assert,15*60) /* Interrupt times is not understood */ MCFG_MACHINE_START(srmp2) diff --git a/src/mame/includes/bsktball.h b/src/mame/includes/bsktball.h index 4ebb182c84c..6eb2f769a48 100644 --- a/src/mame/includes/bsktball.h +++ b/src/mame/includes/bsktball.h @@ -28,7 +28,7 @@ public: /* misc */ UINT32 m_nmi_on; - int m_i256v; +// int m_i256v; /* input-related */ int m_ld1; @@ -48,7 +48,7 @@ public: /*----------- defined in machine/bsktball.c -----------*/ WRITE8_HANDLER( bsktball_nmion_w ); -INTERRUPT_GEN( bsktball_interrupt ); +TIMER_DEVICE_CALLBACK( bsktball_scanline ); WRITE8_HANDLER( bsktball_ld1_w ); WRITE8_HANDLER( bsktball_ld2_w ); READ8_HANDLER( bsktball_in0_r ); diff --git a/src/mame/machine/bsktball.c b/src/mame/machine/bsktball.c index 209a9778001..fe4cca3fa82 100644 --- a/src/mame/machine/bsktball.c +++ b/src/mame/machine/bsktball.c @@ -20,19 +20,18 @@ WRITE8_HANDLER( bsktball_nmion_w ) bsktball_interrupt ***************************************************************************/ /* NMI every 32V, IRQ every VBLANK */ -INTERRUPT_GEN( bsktball_interrupt ) +TIMER_DEVICE_CALLBACK( bsktball_scanline ) { - bsktball_state *state = device->machine().driver_data(); + bsktball_state *state = timer.machine().driver_data(); + int scanline = param; - /* We mod by 8 because we're interrupting 8x per frame, 1 per 32V */ - state->m_i256v = (state->m_i256v + 1) % 8; - - if (state->m_i256v == 0) - device_set_input_line(device, 0, HOLD_LINE); - else if (state->m_nmi_on) - device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); + if(scanline == 0) // vblank irq + cputag_set_input_line(timer.machine(), "maincpu", 0, HOLD_LINE); + else if(((scanline % 28) == 0) && (state->m_nmi_on)) // 32v timer irq + cputag_set_input_line(timer.machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE); } + /*************************************************************************** bsktball_ld_w ***************************************************************************/ diff --git a/src/mame/machine/bublbobl.c b/src/mame/machine/bublbobl.c index 5bb7b7be804..4a953fd0aa4 100644 --- a/src/mame/machine/bublbobl.c +++ b/src/mame/machine/bublbobl.c @@ -8,7 +8,6 @@ ***************************************************************************/ #include "emu.h" -#include "deprecat.h" #include "cpu/z80/z80.h" #include "includes/bublbobl.h" @@ -396,15 +395,16 @@ READ8_HANDLER( boblbobl_ic43_b_r ) The following is ENTIRELY GUESSWORK!!! ***************************************************************************/ - +static TIMER_CALLBACK( bublbobl_m68705_irq_ack ) +{ + cputag_set_input_line(machine, "mcu", 0, CLEAR_LINE); +} INTERRUPT_GEN( bublbobl_m68705_interrupt ) { - /* I don't know how to handle the interrupt line so I just toggle it every time. */ - if (cpu_getiloops(device) & 1) - device_set_input_line(device, 0, CLEAR_LINE); - else - device_set_input_line(device, 0, ASSERT_LINE); + device_set_input_line(device, 0, ASSERT_LINE); + + device->machine().scheduler().timer_set(attotime::from_msec(1000/60), FUNC(bublbobl_m68705_irq_ack)); /* TODO: understand how this is ack'ed */ }