trunk/src/mame/drivers/sangho.c
| r18138 | r18139 | |
| 67 | 67 | DECLARE_DRIVER_INIT(sangho); |
| 68 | 68 | DECLARE_MACHINE_RESET(pzlestar); |
| 69 | 69 | DECLARE_MACHINE_RESET(sexyboom); |
| 70 | TIMER_DEVICE_CALLBACK_MEMBER(sangho_interrupt); |
| 70 | 71 | }; |
| 71 | 72 | |
| 72 | 73 | |
| r18138 | r18139 | |
| 405 | 406 | device.machine().device("maincpu")->execute().set_input_line(0, (i ? HOLD_LINE : CLEAR_LINE)); |
| 406 | 407 | } |
| 407 | 408 | |
| 408 | | static TIMER_DEVICE_CALLBACK( sangho_interrupt ) |
| 409 | TIMER_DEVICE_CALLBACK_MEMBER(sangho_state::sangho_interrupt) |
| 409 | 410 | { |
| 410 | | sangho_state *state = timer.machine().driver_data<sangho_state>(); |
| 411 | 411 | int scanline = param; |
| 412 | 412 | |
| 413 | 413 | if((scanline % 2) == 0) |
| 414 | 414 | { |
| 415 | | state->m_v9958->set_sprite_limit(0); |
| 416 | | state->m_v9958->set_resolution(RENDER_HIGH); |
| 417 | | state->m_v9958->interrupt(); |
| 415 | m_v9958->set_sprite_limit(0); |
| 416 | m_v9958->set_resolution(RENDER_HIGH); |
| 417 | m_v9958->interrupt(); |
| 418 | 418 | } |
| 419 | 419 | } |
| 420 | 420 | |
| r18138 | r18139 | |
| 424 | 424 | MCFG_CPU_ADD("maincpu", Z80,8000000) // ? |
| 425 | 425 | MCFG_CPU_PROGRAM_MAP(sangho_map) |
| 426 | 426 | MCFG_CPU_IO_MAP(pzlestar_io_map) |
| 427 | | MCFG_TIMER_ADD_SCANLINE("scantimer", sangho_interrupt, "screen", 0, 1) |
| 427 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sangho_state, sangho_interrupt, "screen", 0, 1) |
| 428 | 428 | |
| 429 | 429 | MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) |
| 430 | 430 | |
| r18138 | r18139 | |
| 456 | 456 | MCFG_CPU_ADD("maincpu", Z80,8000000) // ? |
| 457 | 457 | MCFG_CPU_PROGRAM_MAP(sangho_map) |
| 458 | 458 | MCFG_CPU_IO_MAP(sexyboom_io_map) |
| 459 | | MCFG_TIMER_ADD_SCANLINE("scantimer", sangho_interrupt, "screen", 0, 1) |
| 459 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sangho_state, sangho_interrupt, "screen", 0, 1) |
| 460 | 460 | |
| 461 | 461 | MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) |
| 462 | 462 | |
trunk/src/mame/drivers/cshooter.c
| r18138 | r18139 | |
| 120 | 120 | DECLARE_MACHINE_RESET(cshooter); |
| 121 | 121 | DECLARE_MACHINE_RESET(airraid); |
| 122 | 122 | UINT32 screen_update_cshooter(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 123 | TIMER_DEVICE_CALLBACK_MEMBER(cshooter_scanline); |
| 123 | 124 | }; |
| 124 | 125 | |
| 125 | 126 | |
| r18138 | r18139 | |
| 202 | 203 | /* main cpu */ |
| 203 | 204 | |
| 204 | 205 | |
| 205 | | static TIMER_DEVICE_CALLBACK( cshooter_scanline ) |
| 206 | TIMER_DEVICE_CALLBACK_MEMBER(cshooter_state::cshooter_scanline) |
| 206 | 207 | { |
| 207 | 208 | int scanline = param; |
| 208 | 209 | |
| 209 | 210 | if(scanline == 240) // vblank-out irq |
| 210 | | timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0x10); /* RST 10h */ |
| 211 | machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0x10); /* RST 10h */ |
| 211 | 212 | |
| 212 | 213 | if(scanline == 0) // vblank-in irq |
| 213 | | timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0x08); /* RST 08h */ |
| 214 | machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0x08); /* RST 08h */ |
| 214 | 215 | } |
| 215 | 216 | |
| 216 | 217 | |
| r18138 | r18139 | |
| 439 | 440 | static MACHINE_CONFIG_START( cshooter, cshooter_state ) |
| 440 | 441 | MCFG_CPU_ADD("maincpu", Z80,XTAL_12MHz/2) /* verified on pcb */ |
| 441 | 442 | MCFG_CPU_PROGRAM_MAP(cshooter_map) |
| 442 | | MCFG_TIMER_ADD_SCANLINE("scantimer", cshooter_scanline, "screen", 0, 1) |
| 443 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", cshooter_state, cshooter_scanline, "screen", 0, 1) |
| 443 | 444 | |
| 444 | 445 | MCFG_CPU_ADD("audiocpu", Z80,XTAL_14_31818MHz/4) /* verified on pcb */ |
| 445 | 446 | MCFG_CPU_PROGRAM_MAP(sound_map) |
| r18138 | r18139 | |
| 466 | 467 | static MACHINE_CONFIG_START( airraid, cshooter_state ) |
| 467 | 468 | MCFG_CPU_ADD("maincpu", Z80,XTAL_12MHz/2) /* verified on pcb */ |
| 468 | 469 | MCFG_CPU_PROGRAM_MAP(airraid_map) |
| 469 | | MCFG_TIMER_ADD_SCANLINE("scantimer", cshooter_scanline, "screen", 0, 1) |
| 470 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", cshooter_state, cshooter_scanline, "screen", 0, 1) |
| 470 | 471 | |
| 471 | 472 | SEIBU2_AIRRAID_SOUND_SYSTEM_CPU(XTAL_14_31818MHz/4) /* verified on pcb */ |
| 472 | 473 | |
trunk/src/mame/drivers/sigmab98.c
| r18138 | r18139 | |
| 178 | 178 | UINT32 screen_update_sigmab98(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 179 | 179 | void screen_eof_sammymdl(screen_device &screen, bool state); |
| 180 | 180 | INTERRUPT_GEN_MEMBER(gegege_vblank_interrupt); |
| 181 | TIMER_DEVICE_CALLBACK_MEMBER(sammymd1_irq); |
| 181 | 182 | }; |
| 182 | 183 | |
| 183 | 184 | |
| r18138 | r18139 | |
| 1785 | 1786 | Animal Catch |
| 1786 | 1787 | ***************************************************************************/ |
| 1787 | 1788 | |
| 1788 | | static TIMER_DEVICE_CALLBACK( sammymd1_irq ) |
| 1789 | TIMER_DEVICE_CALLBACK_MEMBER(sigmab98_state::sammymd1_irq) |
| 1789 | 1790 | { |
| 1790 | | sigmab98_state *state = timer.machine().driver_data<sigmab98_state>(); |
| 1791 | 1791 | int scanline = param; |
| 1792 | 1792 | |
| 1793 | 1793 | if(scanline == 240) |
| 1794 | | state->m_maincpu->set_input_line_and_vector(0,HOLD_LINE, state->m_vblank_vector); |
| 1794 | m_maincpu->set_input_line_and_vector(0,HOLD_LINE, m_vblank_vector); |
| 1795 | 1795 | |
| 1796 | 1796 | if(scanline == 128) |
| 1797 | | state->m_maincpu->set_input_line_and_vector(0,HOLD_LINE, state->m_timer0_vector); |
| 1797 | m_maincpu->set_input_line_and_vector(0,HOLD_LINE, m_timer0_vector); |
| 1798 | 1798 | |
| 1799 | 1799 | if(scanline == 32) |
| 1800 | | state->m_maincpu->set_input_line_and_vector(0,HOLD_LINE, state->m_timer1_vector); |
| 1800 | m_maincpu->set_input_line_and_vector(0,HOLD_LINE, m_timer1_vector); |
| 1801 | 1801 | } |
| 1802 | 1802 | |
| 1803 | 1803 | static MACHINE_CONFIG_DERIVED( animalc, sammymdl ) |
| 1804 | 1804 | MCFG_CPU_MODIFY("maincpu") |
| 1805 | 1805 | MCFG_CPU_PROGRAM_MAP( animalc_map ) |
| 1806 | 1806 | MCFG_CPU_IO_MAP( animalc_io ) |
| 1807 | | MCFG_TIMER_ADD_SCANLINE("scantimer", sammymd1_irq, "screen", 0, 1) |
| 1807 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sigmab98_state, sammymd1_irq, "screen", 0, 1) |
| 1808 | 1808 | MACHINE_CONFIG_END |
| 1809 | 1809 | |
| 1810 | 1810 | /*************************************************************************** |
| r18138 | r18139 | |
| 1815 | 1815 | MCFG_CPU_MODIFY("maincpu") |
| 1816 | 1816 | MCFG_CPU_PROGRAM_MAP( haekaka_map ) |
| 1817 | 1817 | MCFG_CPU_IO_MAP( haekaka_io ) |
| 1818 | | MCFG_TIMER_ADD_SCANLINE("scantimer", sammymd1_irq, "screen", 0, 1) |
| 1818 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sigmab98_state, sammymd1_irq, "screen", 0, 1) |
| 1819 | 1819 | MACHINE_CONFIG_END |
| 1820 | 1820 | |
| 1821 | 1821 | /*************************************************************************** |
| r18138 | r18139 | |
| 1826 | 1826 | MCFG_CPU_MODIFY("maincpu") |
| 1827 | 1827 | MCFG_CPU_PROGRAM_MAP( itazuram_map ) |
| 1828 | 1828 | MCFG_CPU_IO_MAP( itazuram_io ) |
| 1829 | | MCFG_TIMER_ADD_SCANLINE("scantimer", sammymd1_irq, "screen", 0, 1) |
| 1829 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sigmab98_state, sammymd1_irq, "screen", 0, 1) |
| 1830 | 1830 | MACHINE_CONFIG_END |
| 1831 | 1831 | |
| 1832 | 1832 | /*************************************************************************** |
| r18138 | r18139 | |
| 1837 | 1837 | MCFG_CPU_MODIFY("maincpu") |
| 1838 | 1838 | MCFG_CPU_PROGRAM_MAP( haekaka_map ) |
| 1839 | 1839 | MCFG_CPU_IO_MAP( pyenaget_io ) |
| 1840 | | MCFG_TIMER_ADD_SCANLINE("scantimer", sammymd1_irq, "screen", 0, 1) |
| 1840 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sigmab98_state, sammymd1_irq, "screen", 0, 1) |
| 1841 | 1841 | MACHINE_CONFIG_END |
| 1842 | 1842 | |
| 1843 | 1843 | /*************************************************************************** |
| r18138 | r18139 | |
| 1848 | 1848 | MCFG_CPU_MODIFY("maincpu") |
| 1849 | 1849 | MCFG_CPU_PROGRAM_MAP( tdoboon_map ) |
| 1850 | 1850 | MCFG_CPU_IO_MAP( tdoboon_io ) |
| 1851 | | MCFG_TIMER_ADD_SCANLINE("scantimer", sammymd1_irq, "screen", 0, 1) |
| 1851 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sigmab98_state, sammymd1_irq, "screen", 0, 1) |
| 1852 | 1852 | |
| 1853 | 1853 | MCFG_SCREEN_MODIFY("screen") |
| 1854 | 1854 | MCFG_SCREEN_VISIBLE_AREA(0,0x140-1, 0+4,0xf0+4-1) |
trunk/src/mame/drivers/popobear.c
| r18138 | r18139 | |
| 96 | 96 | DECLARE_WRITE8_MEMBER(popobear_irq_ack_w); |
| 97 | 97 | virtual void video_start(); |
| 98 | 98 | UINT32 screen_update_popobear(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 99 | TIMER_DEVICE_CALLBACK_MEMBER(popobear_irq); |
| 99 | 100 | }; |
| 100 | 101 | |
| 101 | 102 | void popobear_state::video_start() |
| r18138 | r18139 | |
| 437 | 438 | INPUT_PORTS_END |
| 438 | 439 | |
| 439 | 440 | |
| 440 | | static TIMER_DEVICE_CALLBACK( popobear_irq ) |
| 441 | TIMER_DEVICE_CALLBACK_MEMBER(popobear_state::popobear_irq) |
| 441 | 442 | { |
| 442 | | popobear_state *state = timer.machine().driver_data<popobear_state>(); |
| 443 | 443 | int scanline = param; |
| 444 | 444 | |
| 445 | 445 | /* Order is trusted (5 as vblank-out makes the title screen logo spinning to behave wrongly) */ |
| 446 | 446 | if(scanline == 240) |
| 447 | | state->m_maincpu->set_input_line(3, ASSERT_LINE); |
| 447 | m_maincpu->set_input_line(3, ASSERT_LINE); |
| 448 | 448 | |
| 449 | 449 | if(scanline == 0) |
| 450 | | state->m_maincpu->set_input_line(5, ASSERT_LINE); |
| 450 | m_maincpu->set_input_line(5, ASSERT_LINE); |
| 451 | 451 | |
| 452 | 452 | /* TODO: actually a timer irq, tied with YM2413 sound chip (controls BGM tempo) */ |
| 453 | 453 | if(scanline == 64 || scanline == 192) |
| 454 | | state->m_maincpu->set_input_line(2, ASSERT_LINE); |
| 454 | m_maincpu->set_input_line(2, ASSERT_LINE); |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | 457 | static MACHINE_CONFIG_START( popobear, popobear_state ) |
| r18138 | r18139 | |
| 460 | 460 | // levels 2,3,5 look interesting |
| 461 | 461 | //MCFG_CPU_VBLANK_INT_DRIVER("screen", popobear_state, irq5_line_assert) |
| 462 | 462 | //MCFG_CPU_PERIODIC_INT_DRIVER(popobear_state, irq2_line_assert, 120) |
| 463 | | MCFG_TIMER_ADD_SCANLINE("scantimer", popobear_irq, "screen", 0, 1) |
| 463 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", popobear_state, popobear_irq, "screen", 0, 1) |
| 464 | 464 | |
| 465 | 465 | MCFG_SCREEN_ADD("screen", RASTER) |
| 466 | 466 | MCFG_SCREEN_REFRESH_RATE(60) |
trunk/src/mame/drivers/rowamet.c
| r18138 | r18139 | |
| 49 | 49 | virtual void machine_reset(); |
| 50 | 50 | public: |
| 51 | 51 | DECLARE_DRIVER_INIT(rowamet); |
| 52 | TIMER_DEVICE_CALLBACK_MEMBER(rowamet_timer); |
| 52 | 53 | }; |
| 53 | 54 | |
| 54 | 55 | |
| r18138 | r18139 | |
| 119 | 120 | { |
| 120 | 121 | } |
| 121 | 122 | |
| 122 | | static TIMER_DEVICE_CALLBACK( rowamet_timer ) |
| 123 | TIMER_DEVICE_CALLBACK_MEMBER(rowamet_state::rowamet_timer) |
| 123 | 124 | { |
| 124 | 125 | static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0, 0, 0, 0, 0, 0 }; |
| 125 | | rowamet_state *state = timer.machine().driver_data<rowamet_state>(); |
| 126 | | state->m_out_offs &= 15; |
| 126 | m_out_offs &= 15; |
| 127 | 127 | |
| 128 | | UINT8 digit = state->m_out_offs << 1; |
| 129 | | output_set_digit_value(digit, patterns[state->m_p_ram[state->m_out_offs]>>4]); |
| 130 | | output_set_digit_value(++digit, patterns[state->m_p_ram[state->m_out_offs++]&15]); |
| 128 | UINT8 digit = m_out_offs << 1; |
| 129 | output_set_digit_value(digit, patterns[m_p_ram[m_out_offs]>>4]); |
| 130 | output_set_digit_value(++digit, patterns[m_p_ram[m_out_offs++]&15]); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | static MACHINE_CONFIG_START( rowamet, rowamet_state ) |
| r18138 | r18139 | |
| 137 | 137 | MCFG_CPU_ADD("cpu2", Z80, 1888888) |
| 138 | 138 | MCFG_CPU_PROGRAM_MAP(rowamet_sub_map) |
| 139 | 139 | MCFG_CPU_IO_MAP(rowamet_sub_io) |
| 140 | | MCFG_TIMER_ADD_PERIODIC("rowamet_timer", rowamet_timer, attotime::from_hz(200)) |
| 140 | MCFG_TIMER_DRIVER_ADD_PERIODIC("rowamet_timer", rowamet_state, rowamet_timer, attotime::from_hz(200)) |
| 141 | 141 | |
| 142 | 142 | /* Video */ |
| 143 | 143 | MCFG_DEFAULT_LAYOUT(layout_rowamet) |
trunk/src/mame/drivers/namcos11.c
| r18138 | r18139 | |
| 342 | 342 | DECLARE_DRIVER_INIT(xevi3dg); |
| 343 | 343 | DECLARE_DRIVER_INIT(tekken2); |
| 344 | 344 | DECLARE_MACHINE_RESET(namcos11); |
| 345 | TIMER_DEVICE_CALLBACK_MEMBER(mcu_irq0_cb); |
| 346 | TIMER_DEVICE_CALLBACK_MEMBER(mcu_irq2_cb); |
| 347 | TIMER_DEVICE_CALLBACK_MEMBER(mcu_adc_cb); |
| 345 | 348 | }; |
| 346 | 349 | |
| 347 | 350 | INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ... ) |
| r18138 | r18139 | |
| 1000 | 1003 | } |
| 1001 | 1004 | |
| 1002 | 1005 | |
| 1003 | | static TIMER_DEVICE_CALLBACK( mcu_irq0_cb ) |
| 1006 | TIMER_DEVICE_CALLBACK_MEMBER(namcos11_state::mcu_irq0_cb) |
| 1004 | 1007 | { |
| 1005 | | namcos11_state *state = timer.machine().driver_data<namcos11_state>(); |
| 1006 | 1008 | |
| 1007 | | state->m_mcu->set_input_line(M37710_LINE_IRQ0, HOLD_LINE); |
| 1009 | m_mcu->set_input_line(M37710_LINE_IRQ0, HOLD_LINE); |
| 1008 | 1010 | } |
| 1009 | 1011 | |
| 1010 | | static TIMER_DEVICE_CALLBACK( mcu_irq2_cb ) |
| 1012 | TIMER_DEVICE_CALLBACK_MEMBER(namcos11_state::mcu_irq2_cb) |
| 1011 | 1013 | { |
| 1012 | | namcos11_state *state = timer.machine().driver_data<namcos11_state>(); |
| 1013 | 1014 | |
| 1014 | | state->m_mcu->set_input_line(M37710_LINE_IRQ2, HOLD_LINE); |
| 1015 | m_mcu->set_input_line(M37710_LINE_IRQ2, HOLD_LINE); |
| 1015 | 1016 | } |
| 1016 | 1017 | |
| 1017 | | static TIMER_DEVICE_CALLBACK( mcu_adc_cb ) |
| 1018 | TIMER_DEVICE_CALLBACK_MEMBER(namcos11_state::mcu_adc_cb) |
| 1018 | 1019 | { |
| 1019 | | namcos11_state *state = timer.machine().driver_data<namcos11_state>(); |
| 1020 | 1020 | |
| 1021 | | state->m_mcu->set_input_line(M37710_LINE_ADC, HOLD_LINE); |
| 1021 | m_mcu->set_input_line(M37710_LINE_ADC, HOLD_LINE); |
| 1022 | 1022 | } |
| 1023 | 1023 | |
| 1024 | 1024 | static MACHINE_CONFIG_START( coh100, namcos11_state ) |
| r18138 | r18139 | |
| 1030 | 1030 | MCFG_CPU_PROGRAM_MAP(c76_map) |
| 1031 | 1031 | MCFG_CPU_IO_MAP(c76_io_map) |
| 1032 | 1032 | /* TODO: irq generation for these */ |
| 1033 | | MCFG_TIMER_ADD_PERIODIC("mcu_irq0", mcu_irq0_cb, attotime::from_hz(60)) |
| 1034 | | MCFG_TIMER_ADD_PERIODIC("mcu_irq2", mcu_irq2_cb, attotime::from_hz(60)) |
| 1035 | | MCFG_TIMER_ADD_PERIODIC("mcu_adc", mcu_adc_cb, attotime::from_hz(60)) |
| 1033 | MCFG_TIMER_DRIVER_ADD_PERIODIC("mcu_irq0", namcos11_state, mcu_irq0_cb, attotime::from_hz(60)) |
| 1034 | MCFG_TIMER_DRIVER_ADD_PERIODIC("mcu_irq2", namcos11_state, mcu_irq2_cb, attotime::from_hz(60)) |
| 1035 | MCFG_TIMER_DRIVER_ADD_PERIODIC("mcu_adc", namcos11_state, mcu_adc_cb, attotime::from_hz(60)) |
| 1036 | 1036 | |
| 1037 | 1037 | MCFG_MACHINE_RESET_OVERRIDE(namcos11_state, namcos11 ) |
| 1038 | 1038 | |
trunk/src/mame/drivers/hvyunit.c
| r18138 | r18139 | |
| 128 | 128 | virtual void video_start(); |
| 129 | 129 | UINT32 screen_update_hvyunit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 130 | 130 | void screen_eof_hvyunit(screen_device &screen, bool state); |
| 131 | TIMER_DEVICE_CALLBACK_MEMBER(hvyunit_scanline); |
| 131 | 132 | }; |
| 132 | 133 | |
| 133 | 134 | |
| r18138 | r18139 | |
| 624 | 625 | *************************************/ |
| 625 | 626 | |
| 626 | 627 | /* Main Z80 uses IM2 */ |
| 627 | | static TIMER_DEVICE_CALLBACK( hvyunit_scanline ) |
| 628 | TIMER_DEVICE_CALLBACK_MEMBER(hvyunit_state::hvyunit_scanline) |
| 628 | 629 | { |
| 629 | | hvyunit_state *state = timer.machine().driver_data<hvyunit_state>(); |
| 630 | 630 | int scanline = param; |
| 631 | 631 | |
| 632 | 632 | if(scanline == 240) // vblank-out irq |
| 633 | | state->m_master_cpu->execute().set_input_line_and_vector(0, HOLD_LINE, 0xfd); |
| 633 | m_master_cpu->execute().set_input_line_and_vector(0, HOLD_LINE, 0xfd); |
| 634 | 634 | |
| 635 | 635 | /* Pandora "sprite end dma" irq? TODO: timing is likely off */ |
| 636 | 636 | if(scanline == 64) |
| 637 | | state->m_master_cpu->execute().set_input_line_and_vector(0, HOLD_LINE, 0xff); |
| 637 | m_master_cpu->execute().set_input_line_and_vector(0, HOLD_LINE, 0xff); |
| 638 | 638 | } |
| 639 | 639 | |
| 640 | 640 | static const kaneko_pandora_interface hvyunit_pandora_config = |
| r18138 | r18139 | |
| 656 | 656 | MCFG_CPU_ADD("master", Z80, 6000000) |
| 657 | 657 | MCFG_CPU_PROGRAM_MAP(master_memory) |
| 658 | 658 | MCFG_CPU_IO_MAP(master_io) |
| 659 | | MCFG_TIMER_ADD_SCANLINE("scantimer", hvyunit_scanline, "screen", 0, 1) |
| 659 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", hvyunit_state, hvyunit_scanline, "screen", 0, 1) |
| 660 | 660 | |
| 661 | 661 | MCFG_CPU_ADD("slave", Z80, 6000000) |
| 662 | 662 | MCFG_CPU_PROGRAM_MAP(slave_memory) |
trunk/src/mame/drivers/blitz68k.c
| r18138 | r18139 | |
| 175 | 175 | DECLARE_VIDEO_START(blitz68k_addr_factor1); |
| 176 | 176 | UINT32 screen_update_blitz68k(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 177 | 177 | UINT32 screen_update_blitz68k_noblit(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 178 | TIMER_DEVICE_CALLBACK_MEMBER(steaser_mcu_sim); |
| 178 | 179 | }; |
| 179 | 180 | |
| 180 | 181 | /************************************************************************************************************* |
| r18138 | r18139 | |
| 1755 | 1756 | 2008ad = 1 -> hold 5 |
| 1756 | 1757 | */ |
| 1757 | 1758 | |
| 1758 | | static TIMER_DEVICE_CALLBACK( steaser_mcu_sim ) |
| 1759 | TIMER_DEVICE_CALLBACK_MEMBER(blitz68k_state::steaser_mcu_sim) |
| 1759 | 1760 | { |
| 1760 | | blitz68k_state *state = timer.machine().driver_data<blitz68k_state>(); |
| 1761 | 1761 | // static int i; |
| 1762 | 1762 | /*first off, signal the "MCU is running" flag*/ |
| 1763 | | state->m_nvram[0x932/2] = 0xffff; |
| 1763 | m_nvram[0x932/2] = 0xffff; |
| 1764 | 1764 | /*clear the inputs (they are impulsed)*/ |
| 1765 | 1765 | // for(i=0;i<8;i+=2) |
| 1766 | | // state->m_nvram[((0x8a0)+i)/2] = 0; |
| 1766 | // m_nvram[((0x8a0)+i)/2] = 0; |
| 1767 | 1767 | /*finally, read the inputs*/ |
| 1768 | | state->m_nvram[0x89e/2] = timer.machine().root_device().ioport("MENU")->read() & 0xffff; |
| 1769 | | state->m_nvram[0x8a0/2] = timer.machine().root_device().ioport("STAT")->read() & 0xffff; |
| 1770 | | state->m_nvram[0x8a2/2] = timer.machine().root_device().ioport("BET_DEAL")->read() & 0xffff; |
| 1771 | | state->m_nvram[0x8a4/2] = timer.machine().root_device().ioport("TAKE_DOUBLE")->read() & 0xffff; |
| 1772 | | state->m_nvram[0x8a6/2] = timer.machine().root_device().ioport("SMALL_BIG")->read() & 0xffff; |
| 1773 | | state->m_nvram[0x8a8/2] = timer.machine().root_device().ioport("CANCEL_HOLD1")->read() & 0xffff; |
| 1774 | | state->m_nvram[0x8aa/2] = timer.machine().root_device().ioport("HOLD2_HOLD3")->read() & 0xffff; |
| 1775 | | state->m_nvram[0x8ac/2] = timer.machine().root_device().ioport("HOLD4_HOLD5")->read() & 0xffff; |
| 1768 | m_nvram[0x89e/2] = machine().root_device().ioport("MENU")->read() & 0xffff; |
| 1769 | m_nvram[0x8a0/2] = machine().root_device().ioport("STAT")->read() & 0xffff; |
| 1770 | m_nvram[0x8a2/2] = machine().root_device().ioport("BET_DEAL")->read() & 0xffff; |
| 1771 | m_nvram[0x8a4/2] = machine().root_device().ioport("TAKE_DOUBLE")->read() & 0xffff; |
| 1772 | m_nvram[0x8a6/2] = machine().root_device().ioport("SMALL_BIG")->read() & 0xffff; |
| 1773 | m_nvram[0x8a8/2] = machine().root_device().ioport("CANCEL_HOLD1")->read() & 0xffff; |
| 1774 | m_nvram[0x8aa/2] = machine().root_device().ioport("HOLD2_HOLD3")->read() & 0xffff; |
| 1775 | m_nvram[0x8ac/2] = machine().root_device().ioport("HOLD4_HOLD5")->read() & 0xffff; |
| 1776 | 1776 | } |
| 1777 | 1777 | |
| 1778 | 1778 | |
| r18138 | r18139 | |
| 1781 | 1781 | MCFG_CPU_PROGRAM_MAP(steaser_map) |
| 1782 | 1782 | MCFG_CPU_VBLANK_INT_DRIVER("screen", blitz68k_state, irq5_line_hold) //3, 4 & 6 used, mcu comms? |
| 1783 | 1783 | |
| 1784 | | MCFG_TIMER_ADD_PERIODIC("coinsim", steaser_mcu_sim, attotime::from_hz(10000)) // not real, but for simulating the MCU |
| 1784 | MCFG_TIMER_DRIVER_ADD_PERIODIC("coinsim", blitz68k_state, steaser_mcu_sim, attotime::from_hz(10000)) |
| 1785 | 1785 | MACHINE_CONFIG_END |
| 1786 | 1786 | |
| 1787 | 1787 | static MACHINE_CONFIG_START( cjffruit, blitz68k_state ) |
trunk/src/mame/drivers/expro02.c
| r18138 | r18139 | |
| 183 | 183 | virtual void video_start(); |
| 184 | 184 | virtual void palette_init(); |
| 185 | 185 | UINT32 screen_update_galsnew(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 186 | TIMER_DEVICE_CALLBACK_MEMBER(expro02_scanline); |
| 186 | 187 | }; |
| 187 | 188 | |
| 188 | 189 | |
| r18138 | r18139 | |
| 497 | 498 | * |
| 498 | 499 | *************************************/ |
| 499 | 500 | |
| 500 | | static TIMER_DEVICE_CALLBACK( expro02_scanline ) |
| 501 | TIMER_DEVICE_CALLBACK_MEMBER(expro02_state::expro02_scanline) |
| 501 | 502 | { |
| 502 | 503 | int scanline = param; |
| 503 | 504 | |
| 504 | 505 | if(scanline == 224) // vblank-out irq |
| 505 | | timer.machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE); |
| 506 | machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE); |
| 506 | 507 | else if(scanline == 0) // vblank-in irq? |
| 507 | | timer.machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE); |
| 508 | machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE); |
| 508 | 509 | else if(scanline == 112) // VDP end task? (controls sprite colors in gameplay) |
| 509 | | timer.machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE); |
| 510 | machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE); |
| 510 | 511 | } |
| 511 | 512 | |
| 512 | 513 | void expro02_state::machine_reset() |
| r18138 | r18139 | |
| 547 | 548 | /* basic machine hardware */ |
| 548 | 549 | MCFG_CPU_ADD("maincpu", M68000, 12000000) |
| 549 | 550 | MCFG_CPU_PROGRAM_MAP(galsnew_map) |
| 550 | | MCFG_TIMER_ADD_SCANLINE("scantimer", expro02_scanline, "screen", 0, 1) |
| 551 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", expro02_state, expro02_scanline, "screen", 0, 1) |
| 551 | 552 | |
| 552 | 553 | /* CALC01 MCU @ 16Mhz (unknown type, simulated) */ |
| 553 | 554 | |
trunk/src/mame/drivers/mediagx.c
| r18138 | r18139 | |
| 198 | 198 | DECLARE_READ32_MEMBER(speedup9_r); |
| 199 | 199 | DECLARE_READ32_MEMBER(speedup10_r); |
| 200 | 200 | DECLARE_READ32_MEMBER(speedup11_r); |
| 201 | TIMER_DEVICE_CALLBACK_MEMBER(sound_timer_callback); |
| 201 | 202 | }; |
| 202 | 203 | |
| 203 | 204 | // Display controller registers |
| r18138 | r18139 | |
| 742 | 743 | |
| 743 | 744 | /* Analog Devices AD1847 Stereo DAC */ |
| 744 | 745 | |
| 745 | | static TIMER_DEVICE_CALLBACK( sound_timer_callback ) |
| 746 | TIMER_DEVICE_CALLBACK_MEMBER(mediagx_state::sound_timer_callback) |
| 746 | 747 | { |
| 747 | | mediagx_state *state = timer.machine().driver_data<mediagx_state>(); |
| 748 | 748 | |
| 749 | | state->m_ad1847_sample_counter = 0; |
| 749 | m_ad1847_sample_counter = 0; |
| 750 | 750 | timer.adjust(attotime::from_msec(10)); |
| 751 | 751 | |
| 752 | | dmadac_transfer(&state->m_dmadac[0], 1, 0, 1, state->m_dacl_ptr, state->m_dacl); |
| 753 | | dmadac_transfer(&state->m_dmadac[1], 1, 0, 1, state->m_dacr_ptr, state->m_dacr); |
| 752 | dmadac_transfer(&m_dmadac[0], 1, 0, 1, m_dacl_ptr, m_dacl); |
| 753 | dmadac_transfer(&m_dmadac[1], 1, 0, 1, m_dacr_ptr, m_dacr); |
| 754 | 754 | |
| 755 | | state->m_dacl_ptr = 0; |
| 756 | | state->m_dacr_ptr = 0; |
| 755 | m_dacl_ptr = 0; |
| 756 | m_dacr_ptr = 0; |
| 757 | 757 | } |
| 758 | 758 | |
| 759 | 759 | static void ad1847_reg_write(running_machine &machine, int reg, UINT8 data) |
| r18138 | r18139 | |
| 1193 | 1193 | |
| 1194 | 1194 | MCFG_IDE_CONTROLLER_ADD("ide", ide_intf, ide_devices, "hdd", NULL, true) |
| 1195 | 1195 | |
| 1196 | | MCFG_TIMER_ADD("sound_timer", sound_timer_callback) |
| 1196 | MCFG_TIMER_DRIVER_ADD("sound_timer", mediagx_state, sound_timer_callback) |
| 1197 | 1197 | |
| 1198 | 1198 | MCFG_MC146818_ADD( "rtc", MC146818_STANDARD ) |
| 1199 | 1199 | |
trunk/src/mame/drivers/zac_1.c
| r18138 | r18139 | |
| 53 | 53 | required_device<cpu_device> m_maincpu; |
| 54 | 54 | required_shared_ptr<UINT8> m_p_ram; |
| 55 | 55 | required_device<samples_device> m_samples; |
| 56 | TIMER_DEVICE_CALLBACK_MEMBER(zac_1_inttimer); |
| 57 | TIMER_DEVICE_CALLBACK_MEMBER(zac_1_outtimer); |
| 56 | 58 | protected: |
| 57 | 59 | |
| 58 | 60 | // devices |
| r18138 | r18139 | |
| 201 | 203 | } |
| 202 | 204 | } |
| 203 | 205 | |
| 204 | | static TIMER_DEVICE_CALLBACK( zac_1_inttimer ) |
| 206 | TIMER_DEVICE_CALLBACK_MEMBER(zac_1_state::zac_1_inttimer) |
| 205 | 207 | { |
| 206 | | zac_1_state *state = timer.machine().driver_data<zac_1_state>(); |
| 207 | | if (state->m_t_c > 0x40) |
| 208 | if (m_t_c > 0x40) |
| 208 | 209 | { |
| 209 | | UINT8 vector = (state->ioport("TEST")->read() ) ? 0x10 : 0x18; |
| 210 | | state->m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, ASSERT_LINE, vector); |
| 210 | UINT8 vector = (ioport("TEST")->read() ) ? 0x10 : 0x18; |
| 211 | m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, ASSERT_LINE, vector); |
| 211 | 212 | } |
| 212 | 213 | else |
| 213 | | state->m_t_c++; |
| 214 | m_t_c++; |
| 214 | 215 | } |
| 215 | 216 | |
| 216 | 217 | /* scores = 1800-182D; solenoids = 1840-1853; |
| 217 | 218 | lamps = 1880-18BF; bookkeeping=18C0-18FF. 4-tone osc=1854-1857. |
| 218 | 219 | 182E-183F is a storage area for inputs. */ |
| 219 | | static TIMER_DEVICE_CALLBACK( zac_1_outtimer ) |
| 220 | TIMER_DEVICE_CALLBACK_MEMBER(zac_1_state::zac_1_outtimer) |
| 220 | 221 | { |
| 221 | 222 | static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0, 0, 0, 0, 0, 0 }; |
| 222 | | zac_1_state *state = timer.machine().driver_data<zac_1_state>(); |
| 223 | | state->m_out_offs++; |
| 223 | m_out_offs++; |
| 224 | 224 | |
| 225 | | if (state->m_out_offs < 0x40) |
| 225 | if (m_out_offs < 0x40) |
| 226 | 226 | { |
| 227 | | UINT8 display = (state->m_out_offs >> 3) & 7; |
| 228 | | UINT8 digit = state->m_out_offs & 7; |
| 229 | | output_set_digit_value(display * 10 + digit, patterns[state->m_p_ram[state->m_out_offs]&15]); |
| 227 | UINT8 display = (m_out_offs >> 3) & 7; |
| 228 | UINT8 digit = m_out_offs & 7; |
| 229 | output_set_digit_value(display * 10 + digit, patterns[m_p_ram[m_out_offs]&15]); |
| 230 | 230 | } |
| 231 | 231 | else |
| 232 | | if (state->m_out_offs == 0x4a) // outhole |
| 232 | if (m_out_offs == 0x4a) // outhole |
| 233 | 233 | { |
| 234 | | if (BIT(state->m_p_ram[state->m_out_offs], 0)) |
| 235 | | state->m_samples->start(0, 5); |
| 234 | if (BIT(m_p_ram[m_out_offs], 0)) |
| 235 | m_samples->start(0, 5); |
| 236 | 236 | } |
| 237 | 237 | else |
| 238 | | if (state->m_out_offs == 0x4b) // knocker (not strapids) |
| 238 | if (m_out_offs == 0x4b) // knocker (not strapids) |
| 239 | 239 | { |
| 240 | | if (BIT(state->m_p_ram[state->m_out_offs], 0)) |
| 241 | | state->m_samples->start(0, 6); |
| 240 | if (BIT(m_p_ram[m_out_offs], 0)) |
| 241 | m_samples->start(0, 6); |
| 242 | 242 | } |
| 243 | 243 | } |
| 244 | 244 | |
| r18138 | r18139 | |
| 249 | 249 | MCFG_CPU_IO_MAP(zac_1_io) |
| 250 | 250 | MCFG_NVRAM_ADD_0FILL("ram") |
| 251 | 251 | |
| 252 | | MCFG_TIMER_ADD_PERIODIC("zac_1_inttimer", zac_1_inttimer, attotime::from_hz(200)) |
| 253 | | MCFG_TIMER_ADD_PERIODIC("zac_1_outtimer", zac_1_outtimer, attotime::from_hz(187500)) |
| 252 | MCFG_TIMER_DRIVER_ADD_PERIODIC("zac_1_inttimer", zac_1_state, zac_1_inttimer, attotime::from_hz(200)) |
| 253 | MCFG_TIMER_DRIVER_ADD_PERIODIC("zac_1_outtimer", zac_1_state, zac_1_outtimer, attotime::from_hz(187500)) |
| 254 | 254 | |
| 255 | 255 | /* Video */ |
| 256 | 256 | MCFG_DEFAULT_LAYOUT(layout_zac_1) |
trunk/src/mame/drivers/dfruit.c
| r18138 | r18139 | |
| 64 | 64 | |
| 65 | 65 | UINT8 ram_bank_r(UINT16 offset, UINT8 bank_num); |
| 66 | 66 | void ram_bank_w(UINT16 offset, UINT8 data, UINT8 bank_num); |
| 67 | TIMER_DEVICE_CALLBACK_MEMBER(dfruit_irq_scanline); |
| 67 | 68 | }; |
| 68 | 69 | |
| 69 | 70 | void dfruit_state::video_start() |
| r18138 | r18139 | |
| 347 | 348 | DEVCB_NULL /* Port C write */ |
| 348 | 349 | }; |
| 349 | 350 | |
| 350 | | static TIMER_DEVICE_CALLBACK( dfruit_irq_scanline ) |
| 351 | TIMER_DEVICE_CALLBACK_MEMBER(dfruit_state::dfruit_irq_scanline) |
| 351 | 352 | { |
| 352 | | dfruit_state *state = timer.machine().driver_data<dfruit_state>(); |
| 353 | 353 | int scanline = param; |
| 354 | 354 | |
| 355 | | if (scanline == 240 && (state->m_irq_enable & 4)) |
| 355 | if (scanline == 240 && (m_irq_enable & 4)) |
| 356 | 356 | { |
| 357 | | state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, state->m_irq_vector[2]); |
| 357 | m_maincpu->set_input_line_and_vector(0, HOLD_LINE, m_irq_vector[2]); |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | | if (scanline == 0 && (state->m_irq_enable & 2)) |
| 360 | if (scanline == 0 && (m_irq_enable & 2)) |
| 361 | 361 | { |
| 362 | | state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, state->m_irq_vector[1]); |
| 362 | m_maincpu->set_input_line_and_vector(0, HOLD_LINE, m_irq_vector[1]); |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | | if (scanline == 196 && (state->m_irq_enable & 1)) |
| 365 | if (scanline == 196 && (m_irq_enable & 1)) |
| 366 | 366 | { |
| 367 | | //state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, state->m_irq_vector[0]); |
| 367 | //m_maincpu->set_input_line_and_vector(0, HOLD_LINE, m_irq_vector[0]); |
| 368 | 368 | } |
| 369 | 369 | } |
| 370 | 370 | |
| r18138 | r18139 | |
| 387 | 387 | /* basic machine hardware */ |
| 388 | 388 | MCFG_CPU_ADD("maincpu",Z80,MASTER_CLOCK/2) //!!! TC0091LVC !!! |
| 389 | 389 | MCFG_CPU_PROGRAM_MAP(dfruit_map) |
| 390 | | MCFG_TIMER_ADD_SCANLINE("scantimer", dfruit_irq_scanline, "screen", 0, 1) |
| 390 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dfruit_state, dfruit_irq_scanline, "screen", 0, 1) |
| 391 | 391 | |
| 392 | 392 | //MCFG_MACHINE_START_OVERRIDE(dfruit_state,4enraya) |
| 393 | 393 | //MCFG_MACHINE_RESET_OVERRIDE(dfruit_state,4enraya) |
trunk/src/mame/drivers/kas89.c
| r18138 | r18139 | |
| 228 | 228 | DECLARE_DRIVER_INIT(kas89); |
| 229 | 229 | virtual void machine_start(); |
| 230 | 230 | virtual void machine_reset(); |
| 231 | TIMER_DEVICE_CALLBACK_MEMBER(kas89_interrupt); |
| 232 | TIMER_DEVICE_CALLBACK_MEMBER(kas89_nmi_cb); |
| 233 | TIMER_DEVICE_CALLBACK_MEMBER(kas89_sound_nmi_cb); |
| 231 | 234 | }; |
| 232 | 235 | |
| 233 | 236 | #define VDP_MEM 0x40000 |
| r18138 | r18139 | |
| 242 | 245 | device.machine().device("maincpu")->execute().set_input_line(0, (i ? ASSERT_LINE : CLEAR_LINE)); |
| 243 | 246 | } |
| 244 | 247 | |
| 245 | | static TIMER_DEVICE_CALLBACK( kas89_interrupt ) |
| 248 | TIMER_DEVICE_CALLBACK_MEMBER(kas89_state::kas89_interrupt) |
| 246 | 249 | { |
| 247 | | kas89_state *state = timer.machine().driver_data<kas89_state>(); |
| 248 | 250 | int scanline = param; |
| 249 | 251 | |
| 250 | 252 | if((scanline % 2) == 0) |
| 251 | | state->m_v9938->interrupt(); |
| 253 | m_v9938->interrupt(); |
| 252 | 254 | } |
| 253 | 255 | |
| 254 | 256 | |
| r18138 | r18139 | |
| 310 | 312 | return m_mux_data; |
| 311 | 313 | } |
| 312 | 314 | |
| 313 | | static TIMER_DEVICE_CALLBACK ( kas89_nmi_cb ) |
| 315 | TIMER_DEVICE_CALLBACK_MEMBER(kas89_state::kas89_nmi_cb) |
| 314 | 316 | { |
| 315 | | kas89_state *state = timer.machine().driver_data<kas89_state>(); |
| 316 | | |
| 317 | | if (state->m_main_nmi_enable) |
| 318 | | state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
| 317 | if (m_main_nmi_enable) |
| 318 | m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | | static TIMER_DEVICE_CALLBACK ( kas89_sound_nmi_cb ) |
| 321 | TIMER_DEVICE_CALLBACK_MEMBER(kas89_state::kas89_sound_nmi_cb) |
| 322 | 322 | { |
| 323 | | kas89_state *state = timer.machine().driver_data<kas89_state>(); |
| 324 | | |
| 325 | | state->m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
| 323 | m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
| 326 | 324 | } |
| 327 | 325 | |
| 328 | 326 | |
| r18138 | r18139 | |
| 779 | 777 | MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/6) /* Confirmed */ |
| 780 | 778 | MCFG_CPU_PROGRAM_MAP(kas89_map) |
| 781 | 779 | MCFG_CPU_IO_MAP(kas89_io) |
| 782 | | MCFG_TIMER_ADD_SCANLINE("scantimer", kas89_interrupt, "screen", 0, 1) |
| 783 | | MCFG_TIMER_ADD_PERIODIC("kas89_nmi", kas89_nmi_cb, attotime::from_hz(138)) /* Connected to a 138Hz osc. *AND* bit6 of port $82 */ |
| 780 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kas89_state, kas89_interrupt, "screen", 0, 1) |
| 781 | MCFG_TIMER_DRIVER_ADD_PERIODIC("kas89_nmi", kas89_state, kas89_nmi_cb, attotime::from_hz(138)) |
| 784 | 782 | |
| 785 | 783 | MCFG_CPU_ADD("audiocpu", Z80, MASTER_CLOCK/6) /* Confirmed */ |
| 786 | 784 | MCFG_CPU_PROGRAM_MAP(audio_map) |
| 787 | 785 | MCFG_CPU_IO_MAP(audio_io) |
| 788 | | MCFG_TIMER_ADD_PERIODIC("kas89_snmi", kas89_sound_nmi_cb, attotime::from_hz(138)) /* Connected to a 138Hz osc.*/ |
| 786 | MCFG_TIMER_DRIVER_ADD_PERIODIC("kas89_snmi", kas89_state, kas89_sound_nmi_cb, attotime::from_hz(138)) |
| 789 | 787 | |
| 790 | 788 | |
| 791 | 789 | MCFG_NVRAM_ADD_0FILL("nvram") |
trunk/src/mame/drivers/bnstars.c
| r18138 | r18139 | |
| 157 | 157 | virtual void video_start(); |
| 158 | 158 | UINT32 screen_update_bnstars_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 159 | 159 | UINT32 screen_update_bnstars_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 160 | TIMER_DEVICE_CALLBACK_MEMBER(ms32_interrupt); |
| 160 | 161 | }; |
| 161 | 162 | |
| 162 | 163 | |
| r18138 | r18139 | |
| 1351 | 1352 | } |
| 1352 | 1353 | |
| 1353 | 1354 | /* TODO: fix this arrangement (derived from old deprecat lib) */ |
| 1354 | | static TIMER_DEVICE_CALLBACK(ms32_interrupt) |
| 1355 | TIMER_DEVICE_CALLBACK_MEMBER(bnstars_state::ms32_interrupt) |
| 1355 | 1356 | { |
| 1356 | 1357 | int scanline = param; |
| 1357 | | if( scanline == 0 ) irq_raise(timer.machine(), 10); |
| 1358 | | if( scanline == 8) irq_raise(timer.machine(), 9); |
| 1358 | if( scanline == 0 ) irq_raise(machine(), 10); |
| 1359 | if( scanline == 8) irq_raise(machine(), 9); |
| 1359 | 1360 | /* hayaosi1 needs at least 12 IRQ 0 per frame to work (see code at FFE02289) |
| 1360 | 1361 | kirarast needs it too, at least 8 per frame, but waits for a variable amount |
| 1361 | 1362 | 47pi2 needs ?? per frame (otherwise it hangs when you lose) |
| r18138 | r18139 | |
| 1364 | 1365 | desertwr |
| 1365 | 1366 | p47aces |
| 1366 | 1367 | */ |
| 1367 | | if( (scanline % 8) == 0 && scanline <= 224 ) irq_raise(timer.machine(), 0); |
| 1368 | if( (scanline % 8) == 0 && scanline <= 224 ) irq_raise(machine(), 0); |
| 1368 | 1369 | } |
| 1369 | 1370 | |
| 1370 | 1371 | void bnstars_state::machine_reset() |
| r18138 | r18139 | |
| 1378 | 1379 | /* basic machine hardware */ |
| 1379 | 1380 | MCFG_CPU_ADD("maincpu", V70, 20000000) // 20MHz |
| 1380 | 1381 | MCFG_CPU_PROGRAM_MAP(bnstars_map) |
| 1381 | | MCFG_TIMER_ADD_SCANLINE("scantimer", ms32_interrupt, "lscreen", 0, 1) |
| 1382 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", bnstars_state, ms32_interrupt, "lscreen", 0, 1) |
| 1382 | 1383 | |
| 1383 | 1384 | // MCFG_CPU_ADD("audiocpu", Z80, 4000000) |
| 1384 | 1385 | // MCFG_CPU_PROGRAM_MAP(bnstars_z80_map) |
trunk/src/mame/drivers/royalmah.c
| r18138 | r18139 | |
| 199 | 199 | UINT32 screen_update_royalmah(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 200 | 200 | INTERRUPT_GEN_MEMBER(suzume_irq); |
| 201 | 201 | INTERRUPT_GEN_MEMBER(mjtensin_interrupt); |
| 202 | TIMER_DEVICE_CALLBACK_MEMBER(janptr96_interrupt); |
| 202 | 203 | }; |
| 203 | 204 | |
| 204 | 205 | |
| r18138 | r18139 | |
| 3291 | 3292 | MACHINE_CONFIG_END |
| 3292 | 3293 | |
| 3293 | 3294 | /* It runs in IM 2, thus needs a vector on the data bus */ |
| 3294 | | static TIMER_DEVICE_CALLBACK( janptr96_interrupt ) |
| 3295 | TIMER_DEVICE_CALLBACK_MEMBER(royalmah_state::janptr96_interrupt) |
| 3295 | 3296 | { |
| 3296 | | royalmah_state *state = timer.machine().driver_data<royalmah_state>(); |
| 3297 | 3297 | int scanline = param; |
| 3298 | 3298 | |
| 3299 | 3299 | if(scanline == 248) |
| 3300 | | state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x80); // vblank |
| 3300 | m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x80); // vblank |
| 3301 | 3301 | |
| 3302 | 3302 | if(scanline == 0) |
| 3303 | | state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x84); // demo |
| 3303 | m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x84); // demo |
| 3304 | 3304 | } |
| 3305 | 3305 | |
| 3306 | 3306 | WRITE_LINE_MEMBER(royalmah_state::janptr96_rtc_irq) |
| r18138 | r18139 | |
| 3319 | 3319 | MCFG_CPU_ADD("maincpu",Z80,XTAL_16MHz/2) /* 8 MHz? */ |
| 3320 | 3320 | MCFG_CPU_PROGRAM_MAP(janptr96_map) |
| 3321 | 3321 | MCFG_CPU_IO_MAP(janptr96_iomap) |
| 3322 | | MCFG_TIMER_ADD_SCANLINE("scantimer", janptr96_interrupt, "screen", 0, 1) /* IM 2 needs a vector on the data bus */ |
| 3322 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", royalmah_state, janptr96_interrupt, "screen", 0, 1) |
| 3323 | 3323 | |
| 3324 | 3324 | MCFG_SCREEN_MODIFY("screen") |
| 3325 | 3325 | MCFG_SCREEN_VISIBLE_AREA(0, 255, 8, 255-8) |
trunk/src/mame/drivers/igs017.c
| r18138 | r18139 | |
| 156 | 156 | DECLARE_MACHINE_RESET(mgcs); |
| 157 | 157 | DECLARE_MACHINE_RESET(lhzb2a); |
| 158 | 158 | UINT32 screen_update_igs017(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 159 | TIMER_DEVICE_CALLBACK_MEMBER(irqblocka_interrupt); |
| 160 | TIMER_DEVICE_CALLBACK_MEMBER(mgcs_interrupt); |
| 161 | TIMER_DEVICE_CALLBACK_MEMBER(mgdh_interrupt); |
| 159 | 162 | }; |
| 160 | 163 | |
| 161 | 164 | |
| r18138 | r18139 | |
| 3221 | 3224 | Machine Drivers |
| 3222 | 3225 | ***************************************************************************/ |
| 3223 | 3226 | |
| 3224 | | static TIMER_DEVICE_CALLBACK( irqblocka_interrupt ) |
| 3227 | TIMER_DEVICE_CALLBACK_MEMBER(igs017_state::irqblocka_interrupt) |
| 3225 | 3228 | { |
| 3226 | | igs017_state *state = timer.machine().driver_data<igs017_state>(); |
| 3227 | 3229 | int scanline = param; |
| 3228 | 3230 | |
| 3229 | | if(scanline == 240 && state->m_irq_enable) |
| 3230 | | state->m_maincpu->set_input_line(0, HOLD_LINE); |
| 3231 | if(scanline == 240 && m_irq_enable) |
| 3232 | m_maincpu->set_input_line(0, HOLD_LINE); |
| 3231 | 3233 | |
| 3232 | | if(scanline == 0 && state->m_nmi_enable) |
| 3233 | | state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
| 3234 | if(scanline == 0 && m_nmi_enable) |
| 3235 | m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
| 3234 | 3236 | } |
| 3235 | 3237 | |
| 3236 | 3238 | |
| r18138 | r18139 | |
| 3257 | 3259 | MCFG_CPU_ADD("maincpu", Z180, XTAL_16MHz / 2) |
| 3258 | 3260 | MCFG_CPU_PROGRAM_MAP(iqblocka_map) |
| 3259 | 3261 | MCFG_CPU_IO_MAP(iqblocka_io) |
| 3260 | | MCFG_TIMER_ADD_SCANLINE("scantimer", irqblocka_interrupt, "screen", 0, 1) |
| 3262 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", igs017_state, irqblocka_interrupt, "screen", 0, 1) |
| 3261 | 3263 | |
| 3262 | 3264 | MCFG_I8255A_ADD( "ppi8255", iqblocka_ppi8255_intf ) |
| 3263 | 3265 | |
| r18138 | r18139 | |
| 3288 | 3290 | |
| 3289 | 3291 | // mgcs |
| 3290 | 3292 | |
| 3291 | | static TIMER_DEVICE_CALLBACK( mgcs_interrupt ) |
| 3293 | TIMER_DEVICE_CALLBACK_MEMBER(igs017_state::mgcs_interrupt) |
| 3292 | 3294 | { |
| 3293 | | igs017_state *state = timer.machine().driver_data<igs017_state>(); |
| 3294 | 3295 | int scanline = param; |
| 3295 | 3296 | |
| 3296 | | if(scanline == 240 && state->m_irq1_enable) |
| 3297 | | state->m_maincpu->set_input_line(1, HOLD_LINE); |
| 3297 | if(scanline == 240 && m_irq1_enable) |
| 3298 | m_maincpu->set_input_line(1, HOLD_LINE); |
| 3298 | 3299 | |
| 3299 | | if(scanline == 0 && state->m_irq2_enable) |
| 3300 | | state->m_maincpu->set_input_line(2, HOLD_LINE); |
| 3300 | if(scanline == 0 && m_irq2_enable) |
| 3301 | m_maincpu->set_input_line(2, HOLD_LINE); |
| 3301 | 3302 | } |
| 3302 | 3303 | |
| 3303 | 3304 | MACHINE_RESET_MEMBER(igs017_state,mgcs) |
| r18138 | r18139 | |
| 3322 | 3323 | static MACHINE_CONFIG_START( mgcs, igs017_state ) |
| 3323 | 3324 | MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz / 2) |
| 3324 | 3325 | MCFG_CPU_PROGRAM_MAP(mgcs) |
| 3325 | | MCFG_TIMER_ADD_SCANLINE("scantimer", mgcs_interrupt, "screen", 0, 1) |
| 3326 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", igs017_state, mgcs_interrupt, "screen", 0, 1) |
| 3326 | 3327 | |
| 3327 | 3328 | MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs) |
| 3328 | 3329 | |
| r18138 | r18139 | |
| 3362 | 3363 | static MACHINE_CONFIG_START( lhzb2, igs017_state ) |
| 3363 | 3364 | MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz / 2) |
| 3364 | 3365 | MCFG_CPU_PROGRAM_MAP(lhzb2) |
| 3365 | | MCFG_TIMER_ADD_SCANLINE("scantimer", mgcs_interrupt, "screen", 0, 1) |
| 3366 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", igs017_state, mgcs_interrupt, "screen", 0, 1) |
| 3366 | 3367 | |
| 3367 | 3368 | MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs) |
| 3368 | 3369 | |
| r18138 | r18139 | |
| 3399 | 3400 | static MACHINE_CONFIG_START( lhzb2a, igs017_state ) |
| 3400 | 3401 | MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz/2) |
| 3401 | 3402 | MCFG_CPU_PROGRAM_MAP(lhzb2a) |
| 3402 | | MCFG_TIMER_ADD_SCANLINE("scantimer", mgcs_interrupt, "screen", 0, 1) |
| 3403 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", igs017_state, mgcs_interrupt, "screen", 0, 1) |
| 3403 | 3404 | |
| 3404 | 3405 | MCFG_MACHINE_RESET_OVERRIDE(igs017_state,lhzb2a) |
| 3405 | 3406 | |
| r18138 | r18139 | |
| 3430 | 3431 | static MACHINE_CONFIG_START( slqz2, igs017_state ) |
| 3431 | 3432 | MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz / 2) |
| 3432 | 3433 | MCFG_CPU_PROGRAM_MAP(slqz2) |
| 3433 | | MCFG_TIMER_ADD_SCANLINE("scantimer", mgcs_interrupt, "screen", 0, 1) |
| 3434 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", igs017_state, mgcs_interrupt, "screen", 0, 1) |
| 3434 | 3435 | |
| 3435 | 3436 | MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs) |
| 3436 | 3437 | |
| r18138 | r18139 | |
| 3470 | 3471 | static MACHINE_CONFIG_START( sdmg2, igs017_state ) |
| 3471 | 3472 | MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz/2) |
| 3472 | 3473 | MCFG_CPU_PROGRAM_MAP(sdmg2) |
| 3473 | | MCFG_TIMER_ADD_SCANLINE("scantimer", mgcs_interrupt, "screen", 0, 1) |
| 3474 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", igs017_state, mgcs_interrupt, "screen", 0, 1) |
| 3474 | 3475 | |
| 3475 | 3476 | MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs) |
| 3476 | 3477 | |
| r18138 | r18139 | |
| 3497 | 3498 | |
| 3498 | 3499 | // mgdh |
| 3499 | 3500 | |
| 3500 | | static TIMER_DEVICE_CALLBACK( mgdh_interrupt ) |
| 3501 | TIMER_DEVICE_CALLBACK_MEMBER(igs017_state::mgdh_interrupt) |
| 3501 | 3502 | { |
| 3502 | | igs017_state *state = timer.machine().driver_data<igs017_state>(); |
| 3503 | 3503 | int scanline = param; |
| 3504 | 3504 | |
| 3505 | | if(scanline == 240 && state->m_irq1_enable) |
| 3506 | | state->m_maincpu->set_input_line(1, HOLD_LINE); |
| 3505 | if(scanline == 240 && m_irq1_enable) |
| 3506 | m_maincpu->set_input_line(1, HOLD_LINE); |
| 3507 | 3507 | |
| 3508 | | if(scanline == 0 && state->m_irq2_enable) |
| 3509 | | state->m_maincpu->set_input_line(3, HOLD_LINE); // lev 3 instead of 2 |
| 3508 | if(scanline == 0 && m_irq2_enable) |
| 3509 | m_maincpu->set_input_line(3, HOLD_LINE); // lev 3 instead of 2 |
| 3510 | 3510 | } |
| 3511 | 3511 | |
| 3512 | 3512 | static I8255A_INTERFACE( mgdh_ppi8255_intf ) |
| r18138 | r18139 | |
| 3522 | 3522 | static MACHINE_CONFIG_START( mgdha, igs017_state ) |
| 3523 | 3523 | MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz / 2) |
| 3524 | 3524 | MCFG_CPU_PROGRAM_MAP(mgdha_map) |
| 3525 | | MCFG_TIMER_ADD_SCANLINE("scantimer", mgdh_interrupt, "screen", 0, 1) |
| 3525 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", igs017_state, mgdh_interrupt, "screen", 0, 1) |
| 3526 | 3526 | |
| 3527 | 3527 | MCFG_MACHINE_RESET_OVERRIDE(igs017_state,mgcs) |
| 3528 | 3528 | |
| r18138 | r18139 | |
| 3553 | 3553 | MCFG_CPU_ADD("maincpu", Z180, XTAL_16MHz / 2) |
| 3554 | 3554 | MCFG_CPU_PROGRAM_MAP(tjsb_map) |
| 3555 | 3555 | MCFG_CPU_IO_MAP(tjsb_io) |
| 3556 | | MCFG_TIMER_ADD_SCANLINE("scantimer", irqblocka_interrupt, "screen", 0, 1) |
| 3556 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", igs017_state, irqblocka_interrupt, "screen", 0, 1) |
| 3557 | 3557 | |
| 3558 | 3558 | MCFG_I8255A_ADD( "ppi8255", iqblocka_ppi8255_intf ) |
| 3559 | 3559 | |
trunk/src/mame/drivers/scregg.c
| r18138 | r18139 | |
| 66 | 66 | DECLARE_DRIVER_INIT(rockduck); |
| 67 | 67 | DECLARE_MACHINE_START(scregg); |
| 68 | 68 | DECLARE_MACHINE_RESET(scregg); |
| 69 | TIMER_DEVICE_CALLBACK_MEMBER(scregg_interrupt); |
| 69 | 70 | }; |
| 70 | 71 | |
| 71 | 72 | |
| 72 | 73 | |
| 73 | | static TIMER_DEVICE_CALLBACK( scregg_interrupt ) |
| 74 | TIMER_DEVICE_CALLBACK_MEMBER(scregg_state::scregg_interrupt) |
| 74 | 75 | { |
| 75 | 76 | // assume that the irq generator is similar to burgertime hw |
| 76 | | scregg_state *state = timer.machine().driver_data<scregg_state>(); |
| 77 | | state->m_maincpu->set_input_line(0, (param & 8) ? ASSERT_LINE : CLEAR_LINE); |
| 77 | m_maincpu->set_input_line(0, (param & 8) ? ASSERT_LINE : CLEAR_LINE); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | WRITE8_MEMBER(scregg_state::scregg_irqack_w) |
| r18138 | r18139 | |
| 262 | 262 | /* basic machine hardware */ |
| 263 | 263 | MCFG_CPU_ADD("maincpu", M6502, XTAL_12MHz/8) |
| 264 | 264 | MCFG_CPU_PROGRAM_MAP(dommy_map) |
| 265 | | MCFG_TIMER_ADD_SCANLINE("irq", scregg_interrupt, "screen", 0, 8) |
| 265 | MCFG_TIMER_DRIVER_ADD_SCANLINE("irq", scregg_state, scregg_interrupt, "screen", 0, 8) |
| 266 | 266 | |
| 267 | 267 | MCFG_MACHINE_START_OVERRIDE(scregg_state,scregg) |
| 268 | 268 | MCFG_MACHINE_RESET_OVERRIDE(scregg_state,scregg) |
| r18138 | r18139 | |
| 294 | 294 | /* basic machine hardware */ |
| 295 | 295 | MCFG_CPU_ADD("maincpu", M6502, XTAL_12MHz/8) |
| 296 | 296 | MCFG_CPU_PROGRAM_MAP(eggs_map) |
| 297 | | MCFG_TIMER_ADD_SCANLINE("irq", scregg_interrupt, "screen", 0, 8) |
| 297 | MCFG_TIMER_DRIVER_ADD_SCANLINE("irq", scregg_state, scregg_interrupt, "screen", 0, 8) |
| 298 | 298 | |
| 299 | 299 | MCFG_MACHINE_START_OVERRIDE(scregg_state,scregg) |
| 300 | 300 | MCFG_MACHINE_RESET_OVERRIDE(scregg_state,scregg) |
trunk/src/mame/drivers/halleys.c
| r18138 | r18139 | |
| 267 | 267 | UINT32 screen_update_halleys(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 268 | 268 | UINT32 screen_update_benberob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 269 | 269 | TIMER_CALLBACK_MEMBER(blitter_reset); |
| 270 | TIMER_DEVICE_CALLBACK_MEMBER(halleys_scanline); |
| 271 | TIMER_DEVICE_CALLBACK_MEMBER(benberob_scanline); |
| 270 | 272 | }; |
| 271 | 273 | |
| 272 | 274 | |
| r18138 | r18139 | |
| 1541 | 1543 | // Interrupt and Hardware Handlers |
| 1542 | 1544 | |
| 1543 | 1545 | |
| 1544 | | static TIMER_DEVICE_CALLBACK( halleys_scanline ) |
| 1546 | TIMER_DEVICE_CALLBACK_MEMBER(halleys_state::halleys_scanline) |
| 1545 | 1547 | { |
| 1546 | | halleys_state *state = timer.machine().driver_data<halleys_state>(); |
| 1547 | 1548 | int scanline = param; |
| 1548 | 1549 | |
| 1549 | 1550 | /* TODO: fix this */ |
| r18138 | r18139 | |
| 1551 | 1552 | { |
| 1552 | 1553 | case 248: |
| 1553 | 1554 | // clear collision list of this frame unconditionally |
| 1554 | | state->m_collision_count = 0; |
| 1555 | m_collision_count = 0; |
| 1555 | 1556 | break; |
| 1556 | 1557 | |
| 1557 | 1558 | // In Halley's Comet, NMI is used exclusively to handle coin input |
| 1558 | 1559 | case 56*3: |
| 1559 | | timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
| 1560 | machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
| 1560 | 1561 | break; |
| 1561 | 1562 | |
| 1562 | 1563 | // FIRQ drives gameplay; we need both types of NMI each frame. |
| 1563 | 1564 | case 56*2: |
| 1564 | | state->m_mVectorType = 1; timer.machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE); |
| 1565 | m_mVectorType = 1; machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE); |
| 1565 | 1566 | break; |
| 1566 | 1567 | |
| 1567 | 1568 | case 56: |
| 1568 | | state->m_mVectorType = 0; timer.machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE); |
| 1569 | m_mVectorType = 0; machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE); |
| 1569 | 1570 | break; |
| 1570 | 1571 | } |
| 1571 | 1572 | } |
| 1572 | 1573 | |
| 1573 | 1574 | |
| 1574 | | static TIMER_DEVICE_CALLBACK( benberob_scanline ) |
| 1575 | TIMER_DEVICE_CALLBACK_MEMBER(halleys_state::benberob_scanline) |
| 1575 | 1576 | { |
| 1576 | | halleys_state *state = timer.machine().driver_data<halleys_state>(); |
| 1577 | 1577 | int scanline = param; |
| 1578 | 1578 | |
| 1579 | 1579 | /* TODO: fix this */ |
| r18138 | r18139 | |
| 1583 | 1583 | break; |
| 1584 | 1584 | |
| 1585 | 1585 | case 56*3: |
| 1586 | | timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
| 1586 | machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
| 1587 | 1587 | break; |
| 1588 | 1588 | |
| 1589 | 1589 | case 56*2: |
| 1590 | 1590 | case 56*1: |
| 1591 | 1591 | // FIRQ must not happen when the blitter is being updated or it'll cause serious screen artifacts |
| 1592 | | if (!state->m_blitter_busy) timer.machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE); else state->m_firq_level++; |
| 1592 | if (!m_blitter_busy) machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE); else m_firq_level++; |
| 1593 | 1593 | break; |
| 1594 | 1594 | } |
| 1595 | 1595 | } |
| r18138 | r18139 | |
| 1959 | 1959 | static MACHINE_CONFIG_START( halleys, halleys_state ) |
| 1960 | 1960 | MCFG_CPU_ADD("maincpu", M6809, XTAL_19_968MHz/12) /* verified on pcb */ |
| 1961 | 1961 | MCFG_CPU_PROGRAM_MAP(halleys_map) |
| 1962 | | MCFG_TIMER_ADD_SCANLINE("scantimer", halleys_scanline, "screen", 0, 1) |
| 1962 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", halleys_state, halleys_scanline, "screen", 0, 1) |
| 1963 | 1963 | |
| 1964 | 1964 | MCFG_CPU_ADD("audiocpu", Z80, XTAL_6MHz/2) /* verified on pcb */ |
| 1965 | 1965 | MCFG_CPU_PROGRAM_MAP(sound_map) |
| r18138 | r18139 | |
| 2000 | 2000 | MCFG_CPU_MODIFY("maincpu") |
| 2001 | 2001 | MCFG_CPU_CLOCK(XTAL_19_968MHz/12) /* not verified but pcb identical to halley's comet */ |
| 2002 | 2002 | MCFG_TIMER_MODIFY("scantimer") |
| 2003 | | MCFG_TIMER_CALLBACK(benberob_scanline) |
| 2003 | MCFG_TIMER_DRIVER_CALLBACK(halleys_state, benberob_scanline) |
| 2004 | 2004 | |
| 2005 | 2005 | MCFG_SCREEN_MODIFY("screen") |
| 2006 | 2006 | MCFG_SCREEN_UPDATE_DRIVER(halleys_state, screen_update_benberob) |
trunk/src/mame/drivers/icecold.c
| r18138 | r18139 | |
| 56 | 56 | // motors positions |
| 57 | 57 | int m_rmotor; // right motor position (0-100) |
| 58 | 58 | int m_lmotor; // left motor position (0-100) |
| 59 | TIMER_DEVICE_CALLBACK_MEMBER(icecold_sint_timer); |
| 60 | TIMER_DEVICE_CALLBACK_MEMBER(icecold_motors_timer); |
| 59 | 61 | }; |
| 60 | 62 | |
| 61 | 63 | static ADDRESS_MAP_START( icecold_map, AS_PROGRAM, 8, icecold_state ) |
| r18138 | r18139 | |
| 286 | 288 | return m_sint; |
| 287 | 289 | } |
| 288 | 290 | |
| 289 | | static TIMER_DEVICE_CALLBACK( icecold_sint_timer ) |
| 291 | TIMER_DEVICE_CALLBACK_MEMBER(icecold_state::icecold_sint_timer) |
| 290 | 292 | { |
| 291 | | icecold_state *state = timer.machine().driver_data<icecold_state>(); |
| 292 | | state->m_sint = !state->m_sint; |
| 293 | | state->m_pia1->ca1_w(state->m_sint); |
| 293 | m_sint = !m_sint; |
| 294 | m_pia1->ca1_w(m_sint); |
| 294 | 295 | } |
| 295 | 296 | |
| 296 | | static TIMER_DEVICE_CALLBACK( icecold_motors_timer ) |
| 297 | TIMER_DEVICE_CALLBACK_MEMBER(icecold_state::icecold_motors_timer) |
| 297 | 298 | { |
| 298 | | icecold_state *state = timer.machine().driver_data<icecold_state>(); |
| 299 | 299 | |
| 300 | 300 | // /MOTENBL is set high during reset for disable the motors control |
| 301 | | if (state->m_motenbl == 0) |
| 301 | if (m_motenbl == 0) |
| 302 | 302 | { |
| 303 | | int lmotor_dir = ((state->m_motors_ctrl & 0x0f) == 0x06) ? -1 : ((state->m_motors_ctrl & 0x0f) == 0x09) ? +1 : 0; |
| 304 | | int rmotor_dir = ((state->m_motors_ctrl & 0xf0) == 0x60) ? -1 : ((state->m_motors_ctrl & 0xf0) == 0x90) ? +1 : 0; |
| 303 | int lmotor_dir = ((m_motors_ctrl & 0x0f) == 0x06) ? -1 : ((m_motors_ctrl & 0x0f) == 0x09) ? +1 : 0; |
| 304 | int rmotor_dir = ((m_motors_ctrl & 0xf0) == 0x60) ? -1 : ((m_motors_ctrl & 0xf0) == 0x90) ? +1 : 0; |
| 305 | 305 | |
| 306 | 306 | // update motors position |
| 307 | | state->m_lmotor += lmotor_dir; |
| 308 | | state->m_rmotor += rmotor_dir; |
| 307 | m_lmotor += lmotor_dir; |
| 308 | m_rmotor += rmotor_dir; |
| 309 | 309 | |
| 310 | 310 | // if one motor is at the top of the playfield, closes the ball gate switch, to simulate ball movement |
| 311 | | if (state->m_lmotor >= 99 || state->m_rmotor >= 99 ) |
| 312 | | state->m_ball_gate_sw = 1; |
| 311 | if (m_lmotor >= 99 || m_rmotor >= 99 ) |
| 312 | m_ball_gate_sw = 1; |
| 313 | 313 | // if the motors are at the bottom of the playfield, opens the ball gate switch for start the game |
| 314 | | else if (state->m_lmotor <= 1 && state->m_rmotor <= 1 ) |
| 315 | | state->m_ball_gate_sw = 0; |
| 314 | else if (m_lmotor <= 1 && m_rmotor <= 1 ) |
| 315 | m_ball_gate_sw = 0; |
| 316 | 316 | |
| 317 | 317 | // motors are keep in range 0-100 |
| 318 | | state->m_lmotor = MIN(state->m_lmotor, 100); |
| 319 | | state->m_lmotor = MAX(state->m_lmotor, 0); |
| 320 | | state->m_rmotor = MIN(state->m_rmotor, 100); |
| 321 | | state->m_rmotor = MAX(state->m_rmotor, 0); |
| 318 | m_lmotor = MIN(m_lmotor, 100); |
| 319 | m_lmotor = MAX(m_lmotor, 0); |
| 320 | m_rmotor = MIN(m_rmotor, 100); |
| 321 | m_rmotor = MAX(m_rmotor, 0); |
| 322 | 322 | |
| 323 | 323 | if (lmotor_dir != 0 || rmotor_dir != 0) |
| 324 | 324 | { |
| 325 | | output_set_value("lmotor", state->m_lmotor); |
| 326 | | output_set_value("rmotor", state->m_rmotor); |
| 325 | output_set_value("lmotor", m_lmotor); |
| 326 | output_set_value("rmotor", m_rmotor); |
| 327 | 327 | |
| 328 | 328 | popmessage("Left Motor Right Motor\n%-4s %-4s\n%02d\\100 %02d\\100", |
| 329 | 329 | (lmotor_dir > 0) ? " up" : ((lmotor_dir < 0) ? "down" : "off"), |
| 330 | | (rmotor_dir > 0) ? " up" : ((rmotor_dir < 0) ? "down" : "off"), state->m_lmotor, state->m_rmotor); |
| 330 | (rmotor_dir > 0) ? " up" : ((rmotor_dir < 0) ? "down" : "off"), m_lmotor, m_rmotor); |
| 331 | 331 | } |
| 332 | 332 | } |
| 333 | 333 | } |
| r18138 | r18139 | |
| 424 | 424 | MCFG_I8279_ADD("i8279", XTAL_6MHz/4, icecold_i8279_intf) |
| 425 | 425 | |
| 426 | 426 | // 30Hz signal from CH-C of ay0 |
| 427 | | MCFG_TIMER_ADD_PERIODIC("sint_timer", icecold_sint_timer, attotime::from_hz(30)) |
| 427 | MCFG_TIMER_DRIVER_ADD_PERIODIC("sint_timer", icecold_state, icecold_sint_timer, attotime::from_hz(30)) |
| 428 | 428 | |
| 429 | 429 | // for update motors position |
| 430 | | MCFG_TIMER_ADD_PERIODIC("motors_timer", icecold_motors_timer, attotime::from_msec(50)) |
| 430 | MCFG_TIMER_DRIVER_ADD_PERIODIC("motors_timer", icecold_state, icecold_motors_timer, attotime::from_msec(50)) |
| 431 | 431 | |
| 432 | 432 | // video hardware |
| 433 | 433 | MCFG_DEFAULT_LAYOUT(layout_icecold) |
trunk/src/mame/drivers/pkscram.c
| r18138 | r18139 | |
| 45 | 45 | virtual void machine_reset(); |
| 46 | 46 | virtual void video_start(); |
| 47 | 47 | UINT32 screen_update_pkscramble(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 48 | TIMER_DEVICE_CALLBACK_MEMBER(scanline_callback); |
| 48 | 49 | }; |
| 49 | 50 | |
| 50 | 51 | |
| r18138 | r18139 | |
| 215 | 216 | SET_TILE_INFO_MEMBER(0,tile,color,0); |
| 216 | 217 | } |
| 217 | 218 | |
| 218 | | static TIMER_DEVICE_CALLBACK( scanline_callback ) |
| 219 | TIMER_DEVICE_CALLBACK_MEMBER(pkscram_state::scanline_callback) |
| 219 | 220 | { |
| 220 | | pkscram_state *state = timer.machine().driver_data<pkscram_state>(); |
| 221 | 221 | if (param == interrupt_scanline) |
| 222 | 222 | { |
| 223 | | if (state->m_out & 0x2000) |
| 224 | | timer.machine().device("maincpu")->execute().set_input_line(1, ASSERT_LINE); |
| 225 | | timer.adjust(timer.machine().primary_screen->time_until_pos(param + 1), param+1); |
| 226 | | state->m_interrupt_line_active = 1; |
| 223 | if (m_out & 0x2000) |
| 224 | machine().device("maincpu")->execute().set_input_line(1, ASSERT_LINE); |
| 225 | timer.adjust(machine().primary_screen->time_until_pos(param + 1), param+1); |
| 226 | m_interrupt_line_active = 1; |
| 227 | 227 | } |
| 228 | 228 | else |
| 229 | 229 | { |
| 230 | | if (state->m_interrupt_line_active) |
| 231 | | timer.machine().device("maincpu")->execute().set_input_line(1, CLEAR_LINE); |
| 232 | | timer.adjust(timer.machine().primary_screen->time_until_pos(interrupt_scanline), interrupt_scanline); |
| 233 | | state->m_interrupt_line_active = 0; |
| 230 | if (m_interrupt_line_active) |
| 231 | machine().device("maincpu")->execute().set_input_line(1, CLEAR_LINE); |
| 232 | timer.adjust(machine().primary_screen->time_until_pos(interrupt_scanline), interrupt_scanline); |
| 233 | m_interrupt_line_active = 0; |
| 234 | 234 | } |
| 235 | 235 | } |
| 236 | 236 | |
| r18138 | r18139 | |
| 308 | 308 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 309 | 309 | |
| 310 | 310 | |
| 311 | | MCFG_TIMER_ADD("scan_timer", scanline_callback) |
| 311 | MCFG_TIMER_DRIVER_ADD("scan_timer", pkscram_state, scanline_callback) |
| 312 | 312 | |
| 313 | 313 | /* video hardware */ |
| 314 | 314 | MCFG_SCREEN_ADD("screen", RASTER) |
trunk/src/mame/drivers/meritm.c
| r18138 | r18139 | |
| 240 | 240 | DECLARE_MACHINE_START(meritm_crt260); |
| 241 | 241 | DECLARE_MACHINE_START(merit_common); |
| 242 | 242 | UINT32 screen_update_meritm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 243 | TIMER_DEVICE_CALLBACK_MEMBER(meritm_interrupt); |
| 244 | TIMER_DEVICE_CALLBACK_MEMBER(vblank_start_tick); |
| 245 | TIMER_DEVICE_CALLBACK_MEMBER(vblank_end_tick); |
| 243 | 246 | }; |
| 244 | 247 | |
| 245 | 248 | |
| r18138 | r18139 | |
| 422 | 425 | *************************************/ |
| 423 | 426 | |
| 424 | 427 | |
| 425 | | static TIMER_DEVICE_CALLBACK( meritm_interrupt ) |
| 428 | TIMER_DEVICE_CALLBACK_MEMBER(meritm_state::meritm_interrupt) |
| 426 | 429 | { |
| 427 | | meritm_state *state = timer.machine().driver_data<meritm_state>(); |
| 428 | 430 | int scanline = param; |
| 429 | 431 | |
| 430 | 432 | if((scanline % 2) == 0) |
| 431 | 433 | { |
| 432 | | state->m_v9938_0->set_sprite_limit(0); |
| 433 | | state->m_v9938_0->set_resolution(RENDER_HIGH); |
| 434 | | state->m_v9938_0->interrupt(); |
| 434 | m_v9938_0->set_sprite_limit(0); |
| 435 | m_v9938_0->set_resolution(RENDER_HIGH); |
| 436 | m_v9938_0->interrupt(); |
| 435 | 437 | |
| 436 | | state->m_v9938_1->set_sprite_limit(0); |
| 437 | | state->m_v9938_1->set_resolution(RENDER_HIGH); |
| 438 | | state->m_v9938_1->interrupt(); |
| 438 | m_v9938_1->set_sprite_limit(0); |
| 439 | m_v9938_1->set_resolution(RENDER_HIGH); |
| 440 | m_v9938_1->interrupt(); |
| 439 | 441 | } |
| 440 | 442 | } |
| 441 | 443 | |
| r18138 | r18139 | |
| 1150 | 1152 | #define MSX2_VISIBLE_XBORDER_PIXELS 8 * 2 |
| 1151 | 1153 | #define MSX2_VISIBLE_YBORDER_PIXELS 14 * 2 |
| 1152 | 1154 | |
| 1153 | | static TIMER_DEVICE_CALLBACK( vblank_start_tick ) |
| 1155 | TIMER_DEVICE_CALLBACK_MEMBER(meritm_state::vblank_start_tick) |
| 1154 | 1156 | { |
| 1155 | | meritm_state *state = timer.machine().driver_data<meritm_state>(); |
| 1156 | 1157 | /* this is a workaround to signal the v9938 vblank interrupt correctly */ |
| 1157 | | state->m_vint = 0x08; |
| 1158 | | state->m_z80pio_0->port_a_write(state->m_vint); |
| 1158 | m_vint = 0x08; |
| 1159 | m_z80pio_0->port_a_write(m_vint); |
| 1159 | 1160 | } |
| 1160 | 1161 | |
| 1161 | | static TIMER_DEVICE_CALLBACK( vblank_end_tick ) |
| 1162 | TIMER_DEVICE_CALLBACK_MEMBER(meritm_state::vblank_end_tick) |
| 1162 | 1163 | { |
| 1163 | | meritm_state *state = timer.machine().driver_data<meritm_state>(); |
| 1164 | 1164 | /* this is a workaround to signal the v9938 vblank interrupt correctly */ |
| 1165 | | state->m_vint = 0x18; |
| 1166 | | state->m_z80pio_0->port_a_write(state->m_vint); |
| 1165 | m_vint = 0x18; |
| 1166 | m_z80pio_0->port_a_write(m_vint); |
| 1167 | 1167 | } |
| 1168 | 1168 | |
| 1169 | 1169 | static MACHINE_CONFIG_START( meritm_crt250, meritm_state ) |
| r18138 | r18139 | |
| 1171 | 1171 | MCFG_CPU_PROGRAM_MAP(meritm_crt250_map) |
| 1172 | 1172 | MCFG_CPU_IO_MAP(meritm_crt250_io_map) |
| 1173 | 1173 | MCFG_CPU_CONFIG(meritm_daisy_chain) |
| 1174 | | MCFG_TIMER_ADD_SCANLINE("scantimer", meritm_interrupt, "screen", 0, 1) |
| 1174 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", meritm_state, meritm_interrupt, "screen", 0, 1) |
| 1175 | 1175 | |
| 1176 | 1176 | |
| 1177 | 1177 | MCFG_I8255A_ADD( "ppi8255", crt250_ppi8255_intf ) |
| r18138 | r18139 | |
| 1179 | 1179 | MCFG_Z80PIO_ADD( "z80pio_0", SYSTEM_CLK/6, meritm_audio_pio_intf ) |
| 1180 | 1180 | MCFG_Z80PIO_ADD( "z80pio_1", SYSTEM_CLK/6, meritm_io_pio_intf ) |
| 1181 | 1181 | |
| 1182 | | MCFG_TIMER_ADD_SCANLINE("vblank_start", vblank_start_tick, "screen", 259, 262) |
| 1183 | | MCFG_TIMER_ADD_SCANLINE("vblank_end", vblank_end_tick, "screen", 262, 262) |
| 1182 | MCFG_TIMER_DRIVER_ADD_SCANLINE("vblank_start", meritm_state, vblank_start_tick, "screen", 259, 262) |
| 1183 | MCFG_TIMER_DRIVER_ADD_SCANLINE("vblank_end", meritm_state, vblank_end_tick, "screen", 262, 262) |
| 1184 | 1184 | |
| 1185 | 1185 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 1186 | 1186 | |
trunk/src/mame/drivers/lastbank.c
| r18138 | r18139 | |
| 65 | 65 | |
| 66 | 66 | UINT8 ram_bank_r(UINT16 offset, UINT8 bank_num); |
| 67 | 67 | void ram_bank_w(UINT16 offset, UINT8 data, UINT8 bank_num); |
| 68 | TIMER_DEVICE_CALLBACK_MEMBER(lastbank_irq_scanline); |
| 68 | 69 | }; |
| 69 | 70 | |
| 70 | 71 | void lastbank_state::video_start() |
| r18138 | r18139 | |
| 433 | 434 | GFXDECODE_ENTRY( "gfx1", 0, sp2_layout, 0, 16 ) |
| 434 | 435 | GFXDECODE_END |
| 435 | 436 | |
| 436 | | static TIMER_DEVICE_CALLBACK( lastbank_irq_scanline ) |
| 437 | TIMER_DEVICE_CALLBACK_MEMBER(lastbank_state::lastbank_irq_scanline) |
| 437 | 438 | { |
| 438 | | lastbank_state *state = timer.machine().driver_data<lastbank_state>(); |
| 439 | 439 | int scanline = param; |
| 440 | 440 | |
| 441 | | if (scanline == 240 && (state->m_irq_enable & 4)) |
| 441 | if (scanline == 240 && (m_irq_enable & 4)) |
| 442 | 442 | { |
| 443 | | state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, state->m_irq_vector[2]); |
| 443 | m_maincpu->set_input_line_and_vector(0, HOLD_LINE, m_irq_vector[2]); |
| 444 | 444 | } |
| 445 | 445 | |
| 446 | | if (scanline == 0 && (state->m_irq_enable & 2)) |
| 446 | if (scanline == 0 && (m_irq_enable & 2)) |
| 447 | 447 | { |
| 448 | | state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, state->m_irq_vector[1]); |
| 448 | m_maincpu->set_input_line_and_vector(0, HOLD_LINE, m_irq_vector[1]); |
| 449 | 449 | } |
| 450 | 450 | } |
| 451 | 451 | |
| r18138 | r18139 | |
| 454 | 454 | /* basic machine hardware */ |
| 455 | 455 | MCFG_CPU_ADD("maincpu",Z80,MASTER_CLOCK/4) //!!! TC0091LVC !!! |
| 456 | 456 | MCFG_CPU_PROGRAM_MAP(lastbank_map) |
| 457 | | MCFG_TIMER_ADD_SCANLINE("scantimer", lastbank_irq_scanline, "screen", 0, 1) |
| 457 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", lastbank_state, lastbank_irq_scanline, "screen", 0, 1) |
| 458 | 458 | |
| 459 | 459 | MCFG_CPU_ADD("audiocpu",Z80,MASTER_CLOCK/4) |
| 460 | 460 | MCFG_CPU_PROGRAM_MAP(lastbank_audio_map) |
trunk/src/mame/drivers/jclub2.c
| r18138 | r18139 | |
| 146 | 146 | UINT32 screen_update_darkhors(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 147 | 147 | UINT32 screen_update_jclub2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 148 | 148 | UINT32 screen_update_jclub2o(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 149 | TIMER_DEVICE_CALLBACK_MEMBER(darkhors_irq); |
| 149 | 150 | }; |
| 150 | 151 | |
| 151 | 152 | |
| r18138 | r18139 | |
| 672 | 673 | |
| 673 | 674 | ***************************************************************************/ |
| 674 | 675 | |
| 675 | | static TIMER_DEVICE_CALLBACK( darkhors_irq ) |
| 676 | TIMER_DEVICE_CALLBACK_MEMBER(darkhors_state::darkhors_irq) |
| 676 | 677 | { |
| 677 | | darkhors_state *state = timer.machine().driver_data<darkhors_state>(); |
| 678 | 678 | int scanline = param; |
| 679 | 679 | |
| 680 | 680 | if(scanline == 248) |
| 681 | | state->m_maincpu->set_input_line(5, HOLD_LINE); |
| 681 | m_maincpu->set_input_line(5, HOLD_LINE); |
| 682 | 682 | |
| 683 | 683 | if(scanline == 0) |
| 684 | | state->m_maincpu->set_input_line(3, HOLD_LINE); |
| 684 | m_maincpu->set_input_line(3, HOLD_LINE); |
| 685 | 685 | |
| 686 | 686 | if(scanline == 128) |
| 687 | | state->m_maincpu->set_input_line(4, HOLD_LINE); |
| 687 | m_maincpu->set_input_line(4, HOLD_LINE); |
| 688 | 688 | } |
| 689 | 689 | |
| 690 | 690 | static MACHINE_CONFIG_START( darkhors, darkhors_state ) |
| 691 | 691 | MCFG_CPU_ADD("maincpu", M68EC020, 12000000) // 36MHz/3 ?? |
| 692 | 692 | MCFG_CPU_PROGRAM_MAP(darkhors_map) |
| 693 | | MCFG_TIMER_ADD_SCANLINE("scantimer", darkhors_irq, "screen", 0, 1) |
| 693 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", darkhors_state, darkhors_irq, "screen", 0, 1) |
| 694 | 694 | |
| 695 | 695 | MCFG_EEPROM_ADD("eeprom", eeprom_interface_93C46_8bit) |
| 696 | 696 | |
| r18138 | r18139 | |
| 733 | 733 | static MACHINE_CONFIG_START( jclub2, darkhors_state ) |
| 734 | 734 | MCFG_CPU_ADD("maincpu", M68EC020, 12000000) |
| 735 | 735 | MCFG_CPU_PROGRAM_MAP(jclub2_map) |
| 736 | | MCFG_TIMER_ADD_SCANLINE("scantimer", darkhors_irq, "screen", 0, 1) |
| 736 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", darkhors_state, darkhors_irq, "screen", 0, 1) |
| 737 | 737 | |
| 738 | 738 | MCFG_EEPROM_ADD("eeprom", eeprom_interface_93C46_8bit) |
| 739 | 739 | |
| r18138 | r18139 | |
| 795 | 795 | static MACHINE_CONFIG_START( jclub2o, darkhors_state ) |
| 796 | 796 | MCFG_CPU_ADD("maincpu", M68EC020, 12000000) |
| 797 | 797 | MCFG_CPU_PROGRAM_MAP(jclub2o_map) |
| 798 | | MCFG_TIMER_ADD_SCANLINE("scantimer", darkhors_irq, "screen", 0, 1) |
| 798 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", darkhors_state, darkhors_irq, "screen", 0, 1) |
| 799 | 799 | |
| 800 | 800 | MCFG_CPU_ADD("st0016",Z80,8000000) |
| 801 | 801 | MCFG_CPU_PROGRAM_MAP(st0016_mem) |
trunk/src/mame/drivers/jchan.c
| r18138 | r18139 | |
| 225 | 225 | DECLARE_DRIVER_INIT(jchan); |
| 226 | 226 | virtual void video_start(); |
| 227 | 227 | UINT32 screen_update_jchan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 228 | TIMER_DEVICE_CALLBACK_MEMBER(jchan_vblank); |
| 228 | 229 | }; |
| 229 | 230 | |
| 230 | 231 | |
| r18138 | r18139 | |
| 243 | 244 | // if it is incorrect jchan2 will crash when |
| 244 | 245 | // certain characters win/lose but no finish |
| 245 | 246 | // move was performed |
| 246 | | static TIMER_DEVICE_CALLBACK( jchan_vblank ) |
| 247 | TIMER_DEVICE_CALLBACK_MEMBER(jchan_state::jchan_vblank) |
| 247 | 248 | { |
| 248 | | jchan_state *state = timer.machine().driver_data<jchan_state>(); |
| 249 | 249 | int scanline = param; |
| 250 | 250 | |
| 251 | 251 | if(scanline == 240) |
| 252 | | state->m_maincpu->set_input_line(1, HOLD_LINE); |
| 252 | m_maincpu->set_input_line(1, HOLD_LINE); |
| 253 | 253 | |
| 254 | 254 | if(scanline == 11) |
| 255 | | state->m_maincpu->set_input_line(2, HOLD_LINE); |
| 255 | m_maincpu->set_input_line(2, HOLD_LINE); |
| 256 | 256 | |
| 257 | | if (state->m_irq_sub_enable) |
| 257 | if (m_irq_sub_enable) |
| 258 | 258 | { |
| 259 | 259 | if(scanline == 240) |
| 260 | | state->m_subcpu->set_input_line(1, HOLD_LINE); |
| 260 | m_subcpu->set_input_line(1, HOLD_LINE); |
| 261 | 261 | |
| 262 | 262 | if(scanline == 249) |
| 263 | | state->m_subcpu->set_input_line(2, HOLD_LINE); |
| 263 | m_subcpu->set_input_line(2, HOLD_LINE); |
| 264 | 264 | |
| 265 | 265 | if(scanline == 11) |
| 266 | | state->m_subcpu->set_input_line(3, HOLD_LINE); |
| 266 | m_subcpu->set_input_line(3, HOLD_LINE); |
| 267 | 267 | } |
| 268 | 268 | } |
| 269 | 269 | |
| r18138 | r18139 | |
| 599 | 599 | |
| 600 | 600 | MCFG_CPU_ADD("maincpu", M68000, 16000000) |
| 601 | 601 | MCFG_CPU_PROGRAM_MAP(jchan_main) |
| 602 | | MCFG_TIMER_ADD_SCANLINE("scantimer", jchan_vblank, "screen", 0, 1) |
| 602 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", jchan_state, jchan_vblank, "screen", 0, 1) |
| 603 | 603 | |
| 604 | 604 | MCFG_CPU_ADD("sub", M68000, 16000000) |
| 605 | 605 | MCFG_CPU_PROGRAM_MAP(jchan_sub) |
trunk/src/mame/drivers/littlerb.c
| r18138 | r18139 | |
| 203 | 203 | } |
| 204 | 204 | virtual void video_start(); |
| 205 | 205 | UINT32 screen_update_littlerb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 206 | TIMER_DEVICE_CALLBACK_MEMBER(littlerb_scanline); |
| 206 | 207 | }; |
| 207 | 208 | |
| 208 | 209 | |
| r18138 | r18139 | |
| 565 | 566 | return 0; |
| 566 | 567 | } |
| 567 | 568 | |
| 568 | | static TIMER_DEVICE_CALLBACK( littlerb_scanline ) |
| 569 | TIMER_DEVICE_CALLBACK_MEMBER(littlerb_state::littlerb_scanline) |
| 569 | 570 | { |
| 570 | | littlerb_state *state = timer.machine().driver_data<littlerb_state>(); |
| 571 | 571 | int scanline = param; |
| 572 | 572 | |
| 573 | 573 | if((scanline % 2) == 0) |
| 574 | 574 | { |
| 575 | 575 | UINT8 res; |
| 576 | | UINT8 *sample_rom = state->memregion("samples")->base(); |
| 576 | UINT8 *sample_rom = memregion("samples")->base(); |
| 577 | 577 | |
| 578 | | res = sample_rom[state->m_sound_pointer_l|(state->m_sound_index_l<<10)|0x40000]; |
| 579 | | state->m_dacl->write_signed8(res); |
| 580 | | res = sample_rom[state->m_sound_pointer_r|(state->m_sound_index_r<<10)|0x00000]; |
| 581 | | state->m_dacr->write_signed8(res); |
| 582 | | state->m_sound_pointer_l++; |
| 583 | | state->m_sound_pointer_l&=0x3ff; |
| 584 | | state->m_sound_pointer_r++; |
| 585 | | state->m_sound_pointer_r&=0x3ff; |
| 578 | res = sample_rom[m_sound_pointer_l|(m_sound_index_l<<10)|0x40000]; |
| 579 | m_dacl->write_signed8(res); |
| 580 | res = sample_rom[m_sound_pointer_r|(m_sound_index_r<<10)|0x00000]; |
| 581 | m_dacr->write_signed8(res); |
| 582 | m_sound_pointer_l++; |
| 583 | m_sound_pointer_l&=0x3ff; |
| 584 | m_sound_pointer_r++; |
| 585 | m_sound_pointer_r&=0x3ff; |
| 586 | 586 | } |
| 587 | 587 | |
| 588 | 588 | // logerror("IRQ\n"); |
| 589 | 589 | if(scanline == 288) |
| 590 | 590 | { |
| 591 | | state->m_maincpu->set_input_line(4, HOLD_LINE); |
| 591 | m_maincpu->set_input_line(4, HOLD_LINE); |
| 592 | 592 | } |
| 593 | 593 | } |
| 594 | 594 | |
| r18138 | r18139 | |
| 827 | 827 | static MACHINE_CONFIG_START( littlerb, littlerb_state ) |
| 828 | 828 | MCFG_CPU_ADD("maincpu", M68000, 12000000) |
| 829 | 829 | MCFG_CPU_PROGRAM_MAP(littlerb_main) |
| 830 | | MCFG_TIMER_ADD_SCANLINE("scantimer", littlerb_scanline, "screen", 0, 1) |
| 830 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", littlerb_state, littlerb_scanline, "screen", 0, 1) |
| 831 | 831 | |
| 832 | 832 | MCFG_SCREEN_ADD("screen", RASTER) |
| 833 | 833 | MCFG_SCREEN_REFRESH_RATE(50) // guess based on high vertical resolution |
trunk/src/mame/drivers/zac_2.c
| r18138 | r18139 | |
| 27 | 27 | UINT8 m_out_offs; |
| 28 | 28 | required_device<cpu_device> m_maincpu; |
| 29 | 29 | required_shared_ptr<UINT8> m_p_ram; |
| 30 | TIMER_DEVICE_CALLBACK_MEMBER(zac_2_inttimer); |
| 31 | TIMER_DEVICE_CALLBACK_MEMBER(zac_2_outtimer); |
| 30 | 32 | protected: |
| 31 | 33 | |
| 32 | 34 | // devices |
| r18138 | r18139 | |
| 173 | 175 | m_t_c = 0; |
| 174 | 176 | } |
| 175 | 177 | |
| 176 | | static TIMER_DEVICE_CALLBACK( zac_2_inttimer ) |
| 178 | TIMER_DEVICE_CALLBACK_MEMBER(zac_2_state::zac_2_inttimer) |
| 177 | 179 | { |
| 178 | 180 | // a pulse is sent via a capacitor (similar to what one finds at a reset pin) |
| 179 | | zac_2_state *state = timer.machine().driver_data<zac_2_state>(); |
| 180 | | if (state->m_t_c > 0x80) |
| 181 | | generic_pulse_irq_line_and_vector(state->m_maincpu, INPUT_LINE_IRQ0, 0xbf, 2); |
| 181 | if (m_t_c > 0x80) |
| 182 | generic_pulse_irq_line_and_vector(m_maincpu, INPUT_LINE_IRQ0, 0xbf, 2); |
| 182 | 183 | else |
| 183 | | state->m_t_c++; |
| 184 | m_t_c++; |
| 184 | 185 | } |
| 185 | 186 | |
| 186 | | static TIMER_DEVICE_CALLBACK( zac_2_outtimer ) |
| 187 | TIMER_DEVICE_CALLBACK_MEMBER(zac_2_state::zac_2_outtimer) |
| 187 | 188 | { |
| 188 | 189 | static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0, 0, 0, 0, 0, 0 }; |
| 189 | | zac_2_state *state = timer.machine().driver_data<zac_2_state>(); |
| 190 | | state->m_out_offs++; |
| 190 | m_out_offs++; |
| 191 | 191 | // displays, solenoids, lamps |
| 192 | 192 | |
| 193 | | if (state->m_out_offs < 0x40) |
| 193 | if (m_out_offs < 0x40) |
| 194 | 194 | { |
| 195 | | UINT8 display = (state->m_out_offs >> 3) & 7; |
| 196 | | UINT8 digit = state->m_out_offs & 7; |
| 197 | | output_set_digit_value(display * 10 + digit, patterns[state->m_p_ram[state->m_out_offs]&15]); |
| 195 | UINT8 display = (m_out_offs >> 3) & 7; |
| 196 | UINT8 digit = m_out_offs & 7; |
| 197 | output_set_digit_value(display * 10 + digit, patterns[m_p_ram[m_out_offs]&15]); |
| 198 | 198 | } |
| 199 | 199 | } |
| 200 | 200 | |
| r18138 | r18139 | |
| 205 | 205 | MCFG_CPU_IO_MAP(zac_2_io) |
| 206 | 206 | MCFG_NVRAM_ADD_0FILL("ram") |
| 207 | 207 | |
| 208 | | MCFG_TIMER_ADD_PERIODIC("zac_2_inttimer", zac_2_inttimer, attotime::from_hz(200)) |
| 209 | | MCFG_TIMER_ADD_PERIODIC("zac_2_outtimer", zac_2_outtimer, attotime::from_hz(187500)) |
| 208 | MCFG_TIMER_DRIVER_ADD_PERIODIC("zac_2_inttimer", zac_2_state, zac_2_inttimer, attotime::from_hz(200)) |
| 209 | MCFG_TIMER_DRIVER_ADD_PERIODIC("zac_2_outtimer", zac_2_state, zac_2_outtimer, attotime::from_hz(187500)) |
| 210 | 210 | |
| 211 | 211 | /* Video */ |
| 212 | 212 | MCFG_DEFAULT_LAYOUT(layout_zac_2) |
trunk/src/mame/drivers/wheelfir.c
| r18138 | r18139 | |
| 286 | 286 | virtual void video_start(); |
| 287 | 287 | UINT32 screen_update_wheelfir(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 288 | 288 | void screen_eof_wheelfir(screen_device &screen, bool state); |
| 289 | TIMER_DEVICE_CALLBACK_MEMBER(scanline_timer_callback); |
| 289 | 290 | }; |
| 290 | 291 | |
| 291 | 292 | |
| r18138 | r18139 | |
| 727 | 728 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 728 | 729 | INPUT_PORTS_END |
| 729 | 730 | |
| 730 | | static TIMER_DEVICE_CALLBACK( scanline_timer_callback ) |
| 731 | TIMER_DEVICE_CALLBACK_MEMBER(wheelfir_state::scanline_timer_callback) |
| 731 | 732 | { |
| 732 | | wheelfir_state *state = timer.machine().driver_data<wheelfir_state>(); |
| 733 | | timer.machine().scheduler().synchronize(); |
| 734 | | state->m_current_scanline=param; |
| 733 | machine().scheduler().synchronize(); |
| 734 | m_current_scanline=param; |
| 735 | 735 | |
| 736 | | if(state->m_current_scanline<NUM_SCANLINES) |
| 736 | if(m_current_scanline<NUM_SCANLINES) |
| 737 | 737 | { |
| 738 | 738 | //visible scanline |
| 739 | 739 | |
| 740 | | state->m_toggle_bit = 0x0000; |
| 740 | m_toggle_bit = 0x0000; |
| 741 | 741 | |
| 742 | | --state->m_scanline_cnt; |
| 742 | --m_scanline_cnt; |
| 743 | 743 | |
| 744 | | if(state->m_current_scanline>0) |
| 744 | if(m_current_scanline>0) |
| 745 | 745 | { |
| 746 | 746 | //copy scanline offset |
| 747 | | state->m_scanlines[state->m_current_scanline].x=(state->m_scanlines[state->m_current_scanline-1].x); |
| 748 | | state->m_scanlines[state->m_current_scanline].y=(state->m_scanlines[state->m_current_scanline-1].y+1); |
| 749 | | state->m_scanlines[state->m_current_scanline].unkbits=state->m_scanlines[state->m_current_scanline-1].unkbits; |
| 747 | m_scanlines[m_current_scanline].x=(m_scanlines[m_current_scanline-1].x); |
| 748 | m_scanlines[m_current_scanline].y=(m_scanlines[m_current_scanline-1].y+1); |
| 749 | m_scanlines[m_current_scanline].unkbits=m_scanlines[m_current_scanline-1].unkbits; |
| 750 | 750 | } |
| 751 | 751 | |
| 752 | | if(state->m_scanline_cnt==0) //<=0 ? |
| 752 | if(m_scanline_cnt==0) //<=0 ? |
| 753 | 753 | { |
| 754 | | timer.machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE); // raster IRQ, changes scroll values for road |
| 754 | machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE); // raster IRQ, changes scroll values for road |
| 755 | 755 | } |
| 756 | 756 | |
| 757 | 757 | } |
| 758 | 758 | else |
| 759 | 759 | { |
| 760 | | if(state->m_current_scanline==NUM_SCANLINES) /* vblank */ |
| 760 | if(m_current_scanline==NUM_SCANLINES) /* vblank */ |
| 761 | 761 | { |
| 762 | | state->m_toggle_bit = 0x8000; |
| 763 | | timer.machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE); |
| 762 | m_toggle_bit = 0x8000; |
| 763 | machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE); |
| 764 | 764 | } |
| 765 | 765 | } |
| 766 | 766 | } |
| r18138 | r18139 | |
| 822 | 822 | MCFG_QUANTUM_TIME(attotime::from_hz(12000)) |
| 823 | 823 | |
| 824 | 824 | |
| 825 | | MCFG_TIMER_ADD_SCANLINE("scan_timer", scanline_timer_callback, "screen", 0, 1) |
| 825 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scan_timer", wheelfir_state, scanline_timer_callback, "screen", 0, 1) |
| 826 | 826 | |
| 827 | 827 | MCFG_SCREEN_ADD("screen", RASTER) |
| 828 | 828 | MCFG_SCREEN_REFRESH_RATE(60) |
trunk/src/mame/drivers/mpu3.c
| r18138 | r18139 | |
| 186 | 186 | virtual void machine_start(); |
| 187 | 187 | virtual void machine_reset(); |
| 188 | 188 | TIMER_CALLBACK_MEMBER(ic21_timeout); |
| 189 | TIMER_DEVICE_CALLBACK_MEMBER(gen_50hz); |
| 190 | TIMER_DEVICE_CALLBACK_MEMBER(ic10_callback); |
| 189 | 191 | }; |
| 190 | 192 | |
| 191 | 193 | #define DISPLAY_PORT 0 |
| r18138 | r18139 | |
| 852 | 854 | } |
| 853 | 855 | |
| 854 | 856 | /* generate a 50 Hz signal (some components rely on this for external sync) */ |
| 855 | | static TIMER_DEVICE_CALLBACK( gen_50hz ) |
| 857 | TIMER_DEVICE_CALLBACK_MEMBER(mpu3_state::gen_50hz) |
| 856 | 858 | { |
| 857 | | mpu3_state *state = timer.machine().driver_data<mpu3_state>(); |
| 858 | 859 | /* Although reported as a '50Hz' signal, the fact that both rising and |
| 859 | 860 | falling edges of the pulse are used means the timer actually gives a 100Hz |
| 860 | 861 | oscillating signal.*/ |
| 861 | | state->m_signal_50hz = state->m_signal_50hz?0:1; |
| 862 | | timer.machine().device<ptm6840_device>("ptm_ic2")->set_c1(state->m_signal_50hz); |
| 863 | | timer.machine().device<pia6821_device>("pia_ic3")->cb1_w(~state->m_signal_50hz); |
| 864 | | update_triacs(timer.machine()); |
| 862 | m_signal_50hz = m_signal_50hz?0:1; |
| 863 | machine().device<ptm6840_device>("ptm_ic2")->set_c1(m_signal_50hz); |
| 864 | machine().device<pia6821_device>("pia_ic3")->cb1_w(~m_signal_50hz); |
| 865 | update_triacs(machine()); |
| 865 | 866 | } |
| 866 | 867 | |
| 867 | | static TIMER_DEVICE_CALLBACK( ic10_callback ) |
| 868 | TIMER_DEVICE_CALLBACK_MEMBER(mpu3_state::ic10_callback) |
| 868 | 869 | { |
| 869 | | mpu3_state *state = timer.machine().driver_data<mpu3_state>(); |
| 870 | 870 | // TODO: Use discrete handler for 555, this is far too simplistic |
| 871 | 871 | |
| 872 | | state->m_ic10_output = state->m_ic10_output?0:1; |
| 873 | | timer.machine().device<ptm6840_device>("ptm_ic2")->set_c2(state->m_ic10_output); |
| 874 | | timer.machine().device<pia6821_device>("pia_ic4")->ca1_w(state->m_ic10_output); |
| 872 | m_ic10_output = m_ic10_output?0:1; |
| 873 | machine().device<ptm6840_device>("ptm_ic2")->set_c2(m_ic10_output); |
| 874 | machine().device<pia6821_device>("pia_ic4")->ca1_w(m_ic10_output); |
| 875 | 875 | |
| 876 | 876 | } |
| 877 | 877 | WRITE8_MEMBER(mpu3_state::mpu3ptm_w) |
| r18138 | r18139 | |
| 905 | 905 | |
| 906 | 906 | MCFG_MSC1937_ADD("vfd",0,LEFT_TO_RIGHT) |
| 907 | 907 | |
| 908 | | MCFG_TIMER_ADD_PERIODIC("50hz",gen_50hz, attotime::from_hz(100)) |
| 909 | | MCFG_TIMER_ADD_PERIODIC("555_ic10",ic10_callback, PERIOD_OF_555_ASTABLE(10000,1000,0.0000001)) |
| 908 | MCFG_TIMER_DRIVER_ADD_PERIODIC("50hz", mpu3_state, gen_50hz, attotime::from_hz(100)) |
| 909 | MCFG_TIMER_DRIVER_ADD_PERIODIC("555_ic10", mpu3_state, ic10_callback, PERIOD_OF_555_ASTABLE(10000,1000,0.0000001)) |
| 910 | 910 | |
| 911 | 911 | /* 6840 PTM */ |
| 912 | 912 | MCFG_PTM6840_ADD("ptm_ic2", ptm_ic2_intf) |
trunk/src/mame/drivers/subsino2.c
| r18138 | r18139 | |
| 167 | 167 | DECLARE_VIDEO_START(xtrain); |
| 168 | 168 | UINT32 screen_update_subsino2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 169 | 169 | INTERRUPT_GEN_MEMBER(am188em_int0_irq); |
| 170 | TIMER_DEVICE_CALLBACK_MEMBER(am188em_timer2_irq); |
| 171 | TIMER_DEVICE_CALLBACK_MEMBER(h8_timer_irq); |
| 170 | 172 | }; |
| 171 | 173 | |
| 172 | 174 | |
| r18138 | r18139 | |
| 870 | 872 | device.execute().set_input_line_and_vector(0, HOLD_LINE, 0x0c); // INT0 (background scrolling in xplan) |
| 871 | 873 | } |
| 872 | 874 | |
| 873 | | static TIMER_DEVICE_CALLBACK( am188em_timer2_irq ) |
| 875 | TIMER_DEVICE_CALLBACK_MEMBER(subsino2_state::am188em_timer2_irq) |
| 874 | 876 | { |
| 875 | | subsino2_state *state = timer.machine().driver_data<subsino2_state>(); |
| 876 | | if ((state->m_am188em_regs[AM188EM_IMASK+0] & 0x01) == 0) // TMR mask |
| 877 | | timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0x4c/4); |
| 877 | if ((m_am188em_regs[AM188EM_IMASK+0] & 0x01) == 0) // TMR mask |
| 878 | machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0x4c/4); |
| 878 | 879 | } |
| 879 | 880 | |
| 880 | 881 | /*************************************************************************** |
| r18138 | r18139 | |
| 882 | 883 | ***************************************************************************/ |
| 883 | 884 | |
| 884 | 885 | // To be removed when cpu core is updated |
| 885 | | static TIMER_DEVICE_CALLBACK( h8_timer_irq ) |
| 886 | TIMER_DEVICE_CALLBACK_MEMBER(subsino2_state::h8_timer_irq) |
| 886 | 887 | { |
| 887 | | timer.machine().device("maincpu")->execute().set_input_line(H8_METRO_TIMER_HACK, HOLD_LINE); |
| 888 | machine().device("maincpu")->execute().set_input_line(H8_METRO_TIMER_HACK, HOLD_LINE); |
| 888 | 889 | } |
| 889 | 890 | |
| 890 | 891 | |
| r18138 | r18139 | |
| 2178 | 2179 | MCFG_CPU_ADD("maincpu", H83044, XTAL_44_1MHz / 3) |
| 2179 | 2180 | MCFG_CPU_PROGRAM_MAP( bishjan_map ) |
| 2180 | 2181 | MCFG_CPU_VBLANK_INT_DRIVER("screen", subsino2_state, irq0_line_hold) |
| 2181 | | MCFG_TIMER_ADD_PERIODIC("timer", h8_timer_irq, attotime::from_hz(60)) // timer, ?? Hz |
| 2182 | MCFG_TIMER_DRIVER_ADD_PERIODIC("timer", subsino2_state, h8_timer_irq, attotime::from_hz(60)) |
| 2182 | 2183 | |
| 2183 | 2184 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 2184 | 2185 | MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(200), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) |
| r18138 | r18139 | |
| 2238 | 2239 | MCFG_CPU_ADD("maincpu", I80188, XTAL_20MHz ) // !! AMD AM188-EM !! |
| 2239 | 2240 | MCFG_CPU_PROGRAM_MAP( saklove_map ) |
| 2240 | 2241 | MCFG_CPU_IO_MAP( saklove_io ) |
| 2241 | | MCFG_TIMER_ADD_PERIODIC("timer2", am188em_timer2_irq, attotime::from_hz(60)) // timer 2, ?? Hz |
| 2242 | MCFG_TIMER_DRIVER_ADD_PERIODIC("timer2", subsino2_state, am188em_timer2_irq, attotime::from_hz(60)) |
| 2242 | 2243 | |
| 2243 | 2244 | MCFG_MACHINE_RESET_OVERRIDE(subsino2_state,am188em) |
| 2244 | 2245 | MCFG_NVRAM_ADD_0FILL("nvram") |
| r18138 | r18139 | |
| 2275 | 2276 | MCFG_CPU_PROGRAM_MAP( xplan_map ) |
| 2276 | 2277 | MCFG_CPU_IO_MAP( xplan_io ) |
| 2277 | 2278 | MCFG_CPU_VBLANK_INT_DRIVER("screen", subsino2_state, am188em_int0_irq) |
| 2278 | | MCFG_TIMER_ADD_PERIODIC("timer2", am188em_timer2_irq, attotime::from_hz(60)) // timer 2, ?? Hz |
| 2279 | MCFG_TIMER_DRIVER_ADD_PERIODIC("timer2", subsino2_state, am188em_timer2_irq, attotime::from_hz(60)) |
| 2279 | 2280 | |
| 2280 | 2281 | MCFG_MACHINE_RESET_OVERRIDE(subsino2_state,am188em) |
| 2281 | 2282 | MCFG_NVRAM_ADD_0FILL("nvram") |
trunk/src/mame/drivers/ddealer.c
| r18138 | r18139 | |
| 158 | 158 | virtual void video_start(); |
| 159 | 159 | UINT32 screen_update_ddealer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 160 | 160 | INTERRUPT_GEN_MEMBER(ddealer_interrupt); |
| 161 | TIMER_DEVICE_CALLBACK_MEMBER(ddealer_mcu_sim); |
| 161 | 162 | }; |
| 162 | 163 | |
| 163 | 164 | |
| r18138 | r18139 | |
| 307 | 308 | return 0; |
| 308 | 309 | } |
| 309 | 310 | |
| 310 | | static TIMER_DEVICE_CALLBACK( ddealer_mcu_sim ) |
| 311 | TIMER_DEVICE_CALLBACK_MEMBER(ddealer_state::ddealer_mcu_sim) |
| 311 | 312 | { |
| 312 | | ddealer_state *state = timer.machine().driver_data<ddealer_state>(); |
| 313 | 313 | |
| 314 | 314 | /*coin/credit simulation*/ |
| 315 | 315 | /*$fe002 is used,might be for multiple coins for one credit settings.*/ |
| 316 | | state->m_coin_input = (~(timer.machine().root_device().ioport("IN0")->read())); |
| 316 | m_coin_input = (~(machine().root_device().ioport("IN0")->read())); |
| 317 | 317 | |
| 318 | | if (state->m_coin_input & 0x01)//coin 1 |
| 318 | if (m_coin_input & 0x01)//coin 1 |
| 319 | 319 | { |
| 320 | | if((state->m_input_pressed & 0x01) == 0) |
| 321 | | state->m_mcu_shared_ram[0x000 / 2]++; |
| 322 | | state->m_input_pressed = (state->m_input_pressed & 0xfe) | 1; |
| 320 | if((m_input_pressed & 0x01) == 0) |
| 321 | m_mcu_shared_ram[0x000 / 2]++; |
| 322 | m_input_pressed = (m_input_pressed & 0xfe) | 1; |
| 323 | 323 | } |
| 324 | 324 | else |
| 325 | | state->m_input_pressed = (state->m_input_pressed & 0xfe); |
| 325 | m_input_pressed = (m_input_pressed & 0xfe); |
| 326 | 326 | |
| 327 | | if (state->m_coin_input & 0x02)//coin 2 |
| 327 | if (m_coin_input & 0x02)//coin 2 |
| 328 | 328 | { |
| 329 | | if ((state->m_input_pressed & 0x02) == 0) |
| 330 | | state->m_mcu_shared_ram[0x000 / 2]++; |
| 331 | | state->m_input_pressed = (state->m_input_pressed & 0xfd) | 2; |
| 329 | if ((m_input_pressed & 0x02) == 0) |
| 330 | m_mcu_shared_ram[0x000 / 2]++; |
| 331 | m_input_pressed = (m_input_pressed & 0xfd) | 2; |
| 332 | 332 | } |
| 333 | 333 | else |
| 334 | | state->m_input_pressed = (state->m_input_pressed & 0xfd); |
| 334 | m_input_pressed = (m_input_pressed & 0xfd); |
| 335 | 335 | |
| 336 | | if (state->m_coin_input & 0x04)//service 1 |
| 336 | if (m_coin_input & 0x04)//service 1 |
| 337 | 337 | { |
| 338 | | if ((state->m_input_pressed & 0x04) == 0) |
| 339 | | state->m_mcu_shared_ram[0x000 / 2]++; |
| 340 | | state->m_input_pressed = (state->m_input_pressed & 0xfb) | 4; |
| 338 | if ((m_input_pressed & 0x04) == 0) |
| 339 | m_mcu_shared_ram[0x000 / 2]++; |
| 340 | m_input_pressed = (m_input_pressed & 0xfb) | 4; |
| 341 | 341 | } |
| 342 | 342 | else |
| 343 | | state->m_input_pressed = (state->m_input_pressed & 0xfb); |
| 343 | m_input_pressed = (m_input_pressed & 0xfb); |
| 344 | 344 | |
| 345 | 345 | /*0x104/2 is some sort of "start-lock",i.e. used on the girl selection. |
| 346 | 346 | Without it,the game "steals" one credit if you press the start button on that.*/ |
| 347 | | if (state->m_mcu_shared_ram[0x000 / 2] > 0 && state->m_work_ram[0x104 / 2] & 1) |
| 347 | if (m_mcu_shared_ram[0x000 / 2] > 0 && m_work_ram[0x104 / 2] & 1) |
| 348 | 348 | { |
| 349 | | if (state->m_coin_input & 0x08)//start 1 |
| 349 | if (m_coin_input & 0x08)//start 1 |
| 350 | 350 | { |
| 351 | | if ((state->m_input_pressed & 0x08) == 0 && (~(state->m_work_ram[0x100 / 2] & 1))) |
| 352 | | state->m_mcu_shared_ram[0x000 / 2]--; |
| 353 | | state->m_input_pressed = (state->m_input_pressed & 0xf7) | 8; |
| 351 | if ((m_input_pressed & 0x08) == 0 && (~(m_work_ram[0x100 / 2] & 1))) |
| 352 | m_mcu_shared_ram[0x000 / 2]--; |
| 353 | m_input_pressed = (m_input_pressed & 0xf7) | 8; |
| 354 | 354 | } |
| 355 | 355 | else |
| 356 | | state->m_input_pressed = (state->m_input_pressed & 0xf7); |
| 356 | m_input_pressed = (m_input_pressed & 0xf7); |
| 357 | 357 | |
| 358 | | if (state->m_coin_input & 0x10)//start 2 |
| 358 | if (m_coin_input & 0x10)//start 2 |
| 359 | 359 | { |
| 360 | | if((state->m_input_pressed & 0x10) == 0 && (~(state->m_work_ram[0x100 / 2] & 2))) |
| 361 | | state->m_mcu_shared_ram[0x000 / 2]--; |
| 362 | | state->m_input_pressed = (state->m_input_pressed & 0xef) | 0x10; |
| 360 | if((m_input_pressed & 0x10) == 0 && (~(m_work_ram[0x100 / 2] & 2))) |
| 361 | m_mcu_shared_ram[0x000 / 2]--; |
| 362 | m_input_pressed = (m_input_pressed & 0xef) | 0x10; |
| 363 | 363 | } |
| 364 | 364 | else |
| 365 | | state->m_input_pressed = (state->m_input_pressed & 0xef); |
| 365 | m_input_pressed = (m_input_pressed & 0xef); |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | /*random number generators,controls order of cards*/ |
| 369 | | state->m_mcu_shared_ram[0x10 / 2] = timer.machine().rand() & 0xffff; |
| 370 | | state->m_mcu_shared_ram[0x12 / 2] = timer.machine().rand() & 0xffff; |
| 371 | | state->m_mcu_shared_ram[0x14 / 2] = timer.machine().rand() & 0xffff; |
| 372 | | state->m_mcu_shared_ram[0x16 / 2] = timer.machine().rand() & 0xffff; |
| 369 | m_mcu_shared_ram[0x10 / 2] = machine().rand() & 0xffff; |
| 370 | m_mcu_shared_ram[0x12 / 2] = machine().rand() & 0xffff; |
| 371 | m_mcu_shared_ram[0x14 / 2] = machine().rand() & 0xffff; |
| 372 | m_mcu_shared_ram[0x16 / 2] = machine().rand() & 0xffff; |
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | |
| r18138 | r18139 | |
| 646 | 646 | MCFG_PALETTE_LENGTH(0x400) |
| 647 | 647 | |
| 648 | 648 | |
| 649 | | MCFG_TIMER_ADD_PERIODIC("coinsim", ddealer_mcu_sim, attotime::from_hz(10000)) // not real, but for simulating the MCU |
| 649 | MCFG_TIMER_DRIVER_ADD_PERIODIC("coinsim", ddealer_state, ddealer_mcu_sim, attotime::from_hz(10000)) |
| 650 | 650 | |
| 651 | 651 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 652 | 652 | MCFG_SOUND_ADD("ymsnd", YM2203, 6000000 / 4)//guess |
trunk/src/mame/drivers/olibochu.c
| r18138 | r18139 | |
| 87 | 87 | virtual void video_start(); |
| 88 | 88 | virtual void palette_init(); |
| 89 | 89 | UINT32 screen_update_olibochu(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 90 | TIMER_DEVICE_CALLBACK_MEMBER(olibochu_scanline); |
| 90 | 91 | }; |
| 91 | 92 | |
| 92 | 93 | |
| r18138 | r18139 | |
| 432 | 433 | m_cmd = 0; |
| 433 | 434 | } |
| 434 | 435 | |
| 435 | | static TIMER_DEVICE_CALLBACK( olibochu_scanline ) |
| 436 | TIMER_DEVICE_CALLBACK_MEMBER(olibochu_state::olibochu_scanline) |
| 436 | 437 | { |
| 437 | 438 | int scanline = param; |
| 438 | 439 | |
| 439 | 440 | if(scanline == 248) // vblank-out irq |
| 440 | | timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xd7); /* RST 10h - vblank */ |
| 441 | machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xd7); /* RST 10h - vblank */ |
| 441 | 442 | |
| 442 | 443 | if(scanline == 0) // sprite buffer irq |
| 443 | | timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf); /* RST 08h */ |
| 444 | machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf); /* RST 08h */ |
| 444 | 445 | } |
| 445 | 446 | |
| 446 | 447 | static MACHINE_CONFIG_START( olibochu, olibochu_state ) |
| r18138 | r18139 | |
| 448 | 449 | /* basic machine hardware */ |
| 449 | 450 | MCFG_CPU_ADD("maincpu", Z80, 4000000) /* 4 MHz ?? */ |
| 450 | 451 | MCFG_CPU_PROGRAM_MAP(olibochu_map) |
| 451 | | MCFG_TIMER_ADD_SCANLINE("scantimer", olibochu_scanline, "screen", 0, 1) |
| 452 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", olibochu_state, olibochu_scanline, "screen", 0, 1) |
| 452 | 453 | |
| 453 | 454 | MCFG_CPU_ADD("audiocpu", Z80, 4000000) /* 4 MHz ?? */ |
| 454 | 455 | MCFG_CPU_PROGRAM_MAP(olibochu_sound_map) |
trunk/src/mame/drivers/tmaster.c
| r18138 | r18139 | |
| 184 | 184 | DECLARE_MACHINE_RESET(galgames); |
| 185 | 185 | DECLARE_VIDEO_START(galgames); |
| 186 | 186 | UINT32 screen_update_tmaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 187 | TIMER_DEVICE_CALLBACK_MEMBER(tm3k_interrupt); |
| 187 | 188 | }; |
| 188 | 189 | |
| 189 | 190 | |
| r18138 | r18139 | |
| 902 | 903 | m_duart68681 = machine().device( "duart68681" ); |
| 903 | 904 | } |
| 904 | 905 | |
| 905 | | static TIMER_DEVICE_CALLBACK( tm3k_interrupt ) |
| 906 | TIMER_DEVICE_CALLBACK_MEMBER(tmaster_state::tm3k_interrupt) |
| 906 | 907 | { |
| 907 | | tmaster_state *state = timer.machine().driver_data<tmaster_state>(); |
| 908 | 908 | int scanline = param; |
| 909 | 909 | |
| 910 | 910 | if(scanline == 0) // vblank, FIXME |
| 911 | | state->m_maincpu->set_input_line(3, HOLD_LINE); |
| 911 | m_maincpu->set_input_line(3, HOLD_LINE); |
| 912 | 912 | else if((scanline % 16) == 0) |
| 913 | | state->m_maincpu->set_input_line(1, HOLD_LINE); |
| 913 | m_maincpu->set_input_line(1, HOLD_LINE); |
| 914 | 914 | |
| 915 | 915 | // lev 2 triggered at the end of the blit |
| 916 | 916 | } |
| r18138 | r18139 | |
| 927 | 927 | static MACHINE_CONFIG_START( tm3k, tmaster_state ) |
| 928 | 928 | MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz / 2) /* 12MHz */ |
| 929 | 929 | MCFG_CPU_PROGRAM_MAP(tmaster_map) |
| 930 | | MCFG_TIMER_ADD_SCANLINE("scantimer", tm3k_interrupt, "screen", 0, 1) |
| 930 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", tmaster_state, tm3k_interrupt, "screen", 0, 1) |
| 931 | 931 | |
| 932 | 932 | MCFG_MACHINE_RESET_OVERRIDE(tmaster_state,tmaster) |
| 933 | 933 | |
| r18138 | r18139 | |
| 981 | 981 | static MACHINE_CONFIG_START( galgames, tmaster_state ) |
| 982 | 982 | MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz / 2) |
| 983 | 983 | MCFG_CPU_PROGRAM_MAP(galgames_map) |
| 984 | | MCFG_TIMER_ADD_SCANLINE("scantimer", tm3k_interrupt, "screen", 0, 1) |
| 984 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", tmaster_state, tm3k_interrupt, "screen", 0, 1) |
| 985 | 985 | |
| 986 | 986 | // 5 EEPROMs on the motherboard (for BIOS + 4 Carts) |
| 987 | 987 | MCFG_EEPROM_ADD(GALGAMES_EEPROM_BIOS, galgames_eeprom_interface) |
trunk/src/mess/drivers/vg5k.c
| r18138 | r18139 | |
| 89 | 89 | DECLARE_WRITE8_MEMBER ( cassette_w ); |
| 90 | 90 | DECLARE_DRIVER_INIT(vg5k); |
| 91 | 91 | TIMER_CALLBACK_MEMBER(z80_irq_clear); |
| 92 | TIMER_DEVICE_CALLBACK_MEMBER(z80_irq); |
| 93 | TIMER_DEVICE_CALLBACK_MEMBER(vg5k_scanline); |
| 92 | 94 | }; |
| 93 | 95 | |
| 94 | 96 | |
| r18138 | r18139 | |
| 281 | 283 | } |
| 282 | 284 | |
| 283 | 285 | |
| 284 | | static TIMER_DEVICE_CALLBACK( z80_irq ) |
| 286 | TIMER_DEVICE_CALLBACK_MEMBER(vg5k_state::z80_irq) |
| 285 | 287 | { |
| 286 | | vg5k_state *state = timer.machine().driver_data<vg5k_state>(); |
| 287 | | timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); |
| 288 | machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); |
| 288 | 289 | |
| 289 | | timer.machine().scheduler().timer_set(attotime::from_usec(100), timer_expired_delegate(FUNC(vg5k_state::z80_irq_clear),state)); |
| 290 | machine().scheduler().timer_set(attotime::from_usec(100), timer_expired_delegate(FUNC(vg5k_state::z80_irq_clear),this)); |
| 290 | 291 | } |
| 291 | 292 | |
| 292 | | static TIMER_DEVICE_CALLBACK( vg5k_scanline ) |
| 293 | TIMER_DEVICE_CALLBACK_MEMBER(vg5k_state::vg5k_scanline) |
| 293 | 294 | { |
| 294 | | vg5k_state *vg5k = timer.machine().driver_data<vg5k_state>(); |
| 295 | | |
| 296 | | vg5k->m_ef9345->update_scanline((UINT16)param); |
| 295 | m_ef9345->update_scanline((UINT16)param); |
| 297 | 296 | } |
| 298 | 297 | |
| 299 | 298 | |
| r18138 | r18139 | |
| 377 | 376 | MCFG_CPU_PROGRAM_MAP(vg5k_mem) |
| 378 | 377 | MCFG_CPU_IO_MAP(vg5k_io) |
| 379 | 378 | |
| 380 | | MCFG_TIMER_ADD_SCANLINE("vg5k_scanline", vg5k_scanline, "screen", 0, 10) |
| 379 | MCFG_TIMER_DRIVER_ADD_SCANLINE("vg5k_scanline", vg5k_state, vg5k_scanline, "screen", 0, 10) |
| 381 | 380 | |
| 382 | | MCFG_TIMER_ADD_PERIODIC("irq_timer", z80_irq, attotime::from_msec(20)) |
| 381 | MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer", vg5k_state, z80_irq, attotime::from_msec(20)) |
| 383 | 382 | |
| 384 | 383 | MCFG_EF9345_ADD("ef9345", vg5k_ef9345_config) |
| 385 | 384 | |
trunk/src/mess/drivers/pc8801.c
| r18138 | r18139 | |
| 453 | 453 | DECLARE_MACHINE_RESET(pc8801_cdrom); |
| 454 | 454 | INTERRUPT_GEN_MEMBER(pc8801_vrtc_irq); |
| 455 | 455 | TIMER_CALLBACK_MEMBER(pc8801fd_upd765_tc_to_zero); |
| 456 | TIMER_DEVICE_CALLBACK_MEMBER(pc8801_rtc_irq); |
| 456 | 457 | }; |
| 457 | 458 | |
| 458 | 459 | |
| r18138 | r18139 | |
| 2338 | 2339 | pc8801_raise_irq(device->machine(),1<<(4),1); |
| 2339 | 2340 | } |
| 2340 | 2341 | |
| 2341 | | static TIMER_DEVICE_CALLBACK( pc8801_rtc_irq ) |
| 2342 | /* |
| 2343 | TIMER_DEVICE_CALLBACK_MEMBER(pc8801_state::pc8801_rtc_irq) |
| 2342 | 2344 | { |
| 2343 | | pc8801_state *state = timer.machine().driver_data<pc8801_state>(); |
| 2344 | | if(state->m_timer_irq_mask) |
| 2345 | | pc8801_raise_irq(timer.machine(),1<<(2),1); |
| 2345 | if(m_timer_irq_mask) |
| 2346 | pc8801_raise_irq(machine(),1<<(2),1); |
| 2346 | 2347 | } |
| 2348 | */ |
| 2347 | 2349 | |
| 2348 | 2350 | INTERRUPT_GEN_MEMBER(pc8801_state::pc8801_vrtc_irq) |
| 2349 | 2351 | { |
| r18138 | r18139 | |
| 2400 | 2402 | } |
| 2401 | 2403 | } |
| 2402 | 2404 | |
| 2403 | | static TIMER_DEVICE_CALLBACK( pc8801_rtc_irq ) |
| 2405 | TIMER_DEVICE_CALLBACK_MEMBER(pc8801_state::pc8801_rtc_irq) |
| 2404 | 2406 | { |
| 2405 | | pc8801_state *state = timer.machine().driver_data<pc8801_state>(); |
| 2406 | | if(state->m_timer_irq_mask && state->m_i8214_irq_level >= 3) |
| 2407 | if(m_timer_irq_mask && m_i8214_irq_level >= 3) |
| 2407 | 2408 | { |
| 2408 | | state->m_timer_irq_latch = 1; |
| 2409 | m_timer_irq_latch = 1; |
| 2409 | 2410 | //IRQ_LOG(("timer\n")); |
| 2410 | | timer.machine().device("maincpu")->execute().set_input_line(0,HOLD_LINE); |
| 2411 | machine().device("maincpu")->execute().set_input_line(0,HOLD_LINE); |
| 2411 | 2412 | } |
| 2412 | 2413 | } |
| 2413 | 2414 | |
| r18138 | r18139 | |
| 2713 | 2714 | MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0) |
| 2714 | 2715 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) |
| 2715 | 2716 | |
| 2716 | | MCFG_TIMER_ADD_PERIODIC("rtc_timer", pc8801_rtc_irq, attotime::from_hz(600)) |
| 2717 | MCFG_TIMER_DRIVER_ADD_PERIODIC("rtc_timer", pc8801_state, pc8801_rtc_irq, attotime::from_hz(600)) |
| 2717 | 2718 | MACHINE_CONFIG_END |
| 2718 | 2719 | |
| 2719 | 2720 | static MACHINE_CONFIG_DERIVED( pc8801fh, pc8801 ) |
trunk/src/mess/drivers/rex6000.c
| r18138 | r18139 | |
| 116 | 116 | UINT8 identify_bank_type(UINT32 bank); |
| 117 | 117 | virtual void palette_init(); |
| 118 | 118 | DECLARE_INPUT_CHANGED_MEMBER(trigger_irq); |
| 119 | TIMER_DEVICE_CALLBACK_MEMBER(irq_timer1); |
| 120 | TIMER_DEVICE_CALLBACK_MEMBER(irq_timer2); |
| 121 | TIMER_DEVICE_CALLBACK_MEMBER(sec_timer); |
| 119 | 122 | }; |
| 120 | 123 | |
| 121 | 124 | |
| r18138 | r18139 | |
| 512 | 515 | return 0; |
| 513 | 516 | } |
| 514 | 517 | |
| 515 | | static TIMER_DEVICE_CALLBACK( irq_timer1 ) |
| 518 | TIMER_DEVICE_CALLBACK_MEMBER(rex6000_state::irq_timer1) |
| 516 | 519 | { |
| 517 | | rex6000_state *state = timer.machine().driver_data<rex6000_state>(); |
| 518 | 520 | |
| 519 | | if (!(state->m_irq_mask & IRQ_FLAG_IRQ2)) |
| 521 | if (!(m_irq_mask & IRQ_FLAG_IRQ2)) |
| 520 | 522 | { |
| 521 | | state->m_irq_flag |= IRQ_FLAG_IRQ2; |
| 523 | m_irq_flag |= IRQ_FLAG_IRQ2; |
| 522 | 524 | |
| 523 | | state->m_maincpu->set_input_line(0, HOLD_LINE); |
| 525 | m_maincpu->set_input_line(0, HOLD_LINE); |
| 524 | 526 | } |
| 525 | 527 | |
| 526 | 528 | } |
| 527 | 529 | |
| 528 | | static TIMER_DEVICE_CALLBACK( irq_timer2 ) |
| 530 | TIMER_DEVICE_CALLBACK_MEMBER(rex6000_state::irq_timer2) |
| 529 | 531 | { |
| 530 | | rex6000_state *state = timer.machine().driver_data<rex6000_state>(); |
| 531 | 532 | |
| 532 | | if (!(state->m_irq_mask & IRQ_FLAG_IRQ1)) |
| 533 | if (!(m_irq_mask & IRQ_FLAG_IRQ1)) |
| 533 | 534 | { |
| 534 | | state->m_irq_flag |= IRQ_FLAG_IRQ1; |
| 535 | m_irq_flag |= IRQ_FLAG_IRQ1; |
| 535 | 536 | |
| 536 | | state->m_maincpu->set_input_line(0, HOLD_LINE); |
| 537 | m_maincpu->set_input_line(0, HOLD_LINE); |
| 537 | 538 | } |
| 538 | 539 | } |
| 539 | 540 | |
| 540 | | static TIMER_DEVICE_CALLBACK( sec_timer ) |
| 541 | TIMER_DEVICE_CALLBACK_MEMBER(rex6000_state::sec_timer) |
| 541 | 542 | { |
| 542 | | rex6000_state *state = timer.machine().driver_data<rex6000_state>(); |
| 543 | 543 | |
| 544 | | if (!(state->m_irq_mask & IRQ_FLAG_1HZ)) |
| 544 | if (!(m_irq_mask & IRQ_FLAG_1HZ)) |
| 545 | 545 | { |
| 546 | | state->m_irq_flag |= IRQ_FLAG_1HZ; |
| 546 | m_irq_flag |= IRQ_FLAG_1HZ; |
| 547 | 547 | |
| 548 | | state->m_maincpu->set_input_line(0, HOLD_LINE); |
| 548 | m_maincpu->set_input_line(0, HOLD_LINE); |
| 549 | 549 | } |
| 550 | 550 | } |
| 551 | 551 | |
| r18138 | r18139 | |
| 650 | 650 | MCFG_CPU_PROGRAM_MAP(rex6000_mem) |
| 651 | 651 | MCFG_CPU_IO_MAP(rex6000_io) |
| 652 | 652 | |
| 653 | | MCFG_TIMER_ADD_PERIODIC("sec_timer", sec_timer, attotime::from_hz(1)) |
| 654 | | MCFG_TIMER_ADD_PERIODIC("irq_timer1", irq_timer1, attotime::from_hz(32)) |
| 655 | | MCFG_TIMER_ADD_PERIODIC("irq_timer2", irq_timer2, attotime::from_hz(4096)) |
| 653 | MCFG_TIMER_DRIVER_ADD_PERIODIC("sec_timer", rex6000_state, sec_timer, attotime::from_hz(1)) |
| 654 | MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer1", rex6000_state, irq_timer1, attotime::from_hz(32)) |
| 655 | MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer2", rex6000_state, irq_timer2, attotime::from_hz(4096)) |
| 656 | 656 | |
| 657 | 657 | /* video hardware */ |
| 658 | 658 | MCFG_SCREEN_ADD("screen", LCD) |
trunk/src/mess/drivers/mmodular.c
| r18138 | r18139 | |
| 195 | 195 | DECLARE_MACHINE_START(risc); |
| 196 | 196 | DECLARE_MACHINE_RESET(academy); |
| 197 | 197 | DECLARE_PALETTE_INIT(chess_lcd); |
| 198 | TIMER_DEVICE_CALLBACK_MEMBER(cause_nmi); |
| 199 | TIMER_DEVICE_CALLBACK_MEMBER(cause_M6502_irq); |
| 200 | TIMER_DEVICE_CALLBACK_MEMBER(timer_update_irq6); |
| 201 | TIMER_DEVICE_CALLBACK_MEMBER(timer_update_irq2); |
| 202 | TIMER_DEVICE_CALLBACK_MEMBER(timer_update_irq_academy); |
| 198 | 203 | }; |
| 199 | 204 | |
| 200 | 205 | static HD44780_INTERFACE( chess_display ) |
| r18138 | r18139 | |
| 811 | 816 | return data; |
| 812 | 817 | } |
| 813 | 818 | |
| 814 | | static TIMER_DEVICE_CALLBACK( cause_nmi ) |
| 819 | TIMER_DEVICE_CALLBACK_MEMBER(polgar_state::cause_nmi) |
| 815 | 820 | { |
| 816 | | timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI,PULSE_LINE); |
| 821 | machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI,PULSE_LINE); |
| 817 | 822 | } |
| 818 | 823 | |
| 819 | | static TIMER_DEVICE_CALLBACK( cause_M6502_irq ) |
| 824 | TIMER_DEVICE_CALLBACK_MEMBER(polgar_state::cause_M6502_irq) |
| 820 | 825 | { |
| 821 | | timer.machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE); |
| 822 | | timer.machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, CLEAR_LINE); |
| 826 | machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE); |
| 827 | machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, CLEAR_LINE); |
| 823 | 828 | |
| 824 | 829 | } |
| 825 | 830 | |
| r18138 | r18139 | |
| 981 | 986 | logerror("Write to RISC2500 1000000\n"); |
| 982 | 987 | } |
| 983 | 988 | |
| 984 | | static TIMER_DEVICE_CALLBACK( timer_update_irq6 ) |
| 989 | TIMER_DEVICE_CALLBACK_MEMBER(polgar_state::timer_update_irq6) |
| 985 | 990 | { |
| 986 | | timer.machine().device("maincpu")->execute().set_input_line(6, HOLD_LINE); |
| 991 | machine().device("maincpu")->execute().set_input_line(6, HOLD_LINE); |
| 987 | 992 | } |
| 988 | 993 | |
| 989 | | static TIMER_DEVICE_CALLBACK( timer_update_irq2 ) |
| 994 | TIMER_DEVICE_CALLBACK_MEMBER(polgar_state::timer_update_irq2) |
| 990 | 995 | { |
| 991 | | timer.machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE); |
| 996 | machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE); |
| 992 | 997 | } |
| 993 | 998 | |
| 994 | 999 | |
| 995 | | static TIMER_DEVICE_CALLBACK( timer_update_irq_academy ) |
| 1000 | TIMER_DEVICE_CALLBACK_MEMBER(polgar_state::timer_update_irq_academy) |
| 996 | 1001 | { |
| 997 | 1002 | if (academyallowNMI) { |
| 998 | | timer.machine().device("maincpu")->execute().set_input_line(6, HOLD_LINE); |
| 1003 | machine().device("maincpu")->execute().set_input_line(6, HOLD_LINE); |
| 999 | 1004 | } |
| 1000 | 1005 | } |
| 1001 | 1006 | |
| r18138 | r18139 | |
| 1560 | 1565 | MCFG_MACHINE_RESET_OVERRIDE(polgar_state, polgar ) |
| 1561 | 1566 | MCFG_FRAGMENT_ADD( chess_common ) |
| 1562 | 1567 | |
| 1563 | | MCFG_TIMER_ADD_PERIODIC("irq_timer", cause_nmi, attotime::from_hz(600)) |
| 1568 | MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer", polgar_state, cause_nmi, attotime::from_hz(600)) |
| 1564 | 1569 | MCFG_TIMER_START_DELAY(attotime::from_hz(60)) |
| 1565 | 1570 | MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100)) |
| 1566 | 1571 | |
| r18138 | r18139 | |
| 1577 | 1582 | /* acia */ |
| 1578 | 1583 | // MCFG_ACIA6551_ADD("acia65c51") |
| 1579 | 1584 | |
| 1580 | | MCFG_TIMER_ADD_PERIODIC("irq_timer", cause_M6502_irq, attotime::from_hz(600)) |
| 1585 | MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer", polgar_state, cause_M6502_irq, attotime::from_hz(600)) |
| 1581 | 1586 | MCFG_TIMER_START_DELAY(attotime::from_hz(60)) |
| 1582 | 1587 | MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100)) |
| 1583 | 1588 | MACHINE_CONFIG_END |
| r18138 | r18139 | |
| 1587 | 1592 | MCFG_CPU_PROGRAM_MAP(alm32_mem) |
| 1588 | 1593 | MCFG_MACHINE_START_OVERRIDE(polgar_state,van32) |
| 1589 | 1594 | MCFG_MACHINE_RESET_OVERRIDE(polgar_state,van16) |
| 1590 | | MCFG_TIMER_ADD_PERIODIC("int_timer", timer_update_irq6, attotime::from_hz(750)) |
| 1595 | MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(750)) |
| 1591 | 1596 | MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(120)) |
| 1592 | 1597 | |
| 1593 | 1598 | MCFG_FRAGMENT_ADD( chess_common ) |
| r18138 | r18139 | |
| 1600 | 1605 | MCFG_CPU_PROGRAM_MAP(academy_mem) |
| 1601 | 1606 | MCFG_MACHINE_RESET_OVERRIDE(polgar_state, academy ) |
| 1602 | 1607 | //MCFG_DEVICE_REMOVE("int_timer") |
| 1603 | | MCFG_TIMER_ADD_PERIODIC("int_timer", timer_update_irq_academy, attotime::from_hz(600)) |
| 1608 | MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq_academy, attotime::from_hz(600)) |
| 1604 | 1609 | |
| 1605 | 1610 | MACHINE_CONFIG_END |
| 1606 | 1611 | |
| r18138 | r18139 | |
| 1620 | 1625 | MCFG_SOUND_ADD("beep", BEEP, 0) |
| 1621 | 1626 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1622 | 1627 | |
| 1623 | | MCFG_TIMER_ADD_PERIODIC("irq_timer", cause_nmi, attotime::from_hz(600)) |
| 1628 | MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer", polgar_state, cause_nmi, attotime::from_hz(600)) |
| 1624 | 1629 | MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100)) |
| 1625 | 1630 | |
| 1626 | 1631 | MACHINE_CONFIG_END |
| r18138 | r18139 | |
| 1640 | 1645 | /* acia */ |
| 1641 | 1646 | // MCFG_ACIA6551_ADD("acia65c51") |
| 1642 | 1647 | |
| 1643 | | MCFG_TIMER_ADD_PERIODIC("int_timer", timer_update_irq2, attotime::from_hz(60)) |
| 1648 | MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq2, attotime::from_hz(60)) |
| 1644 | 1649 | MCFG_TIMER_START_DELAY(attotime::from_hz(30)) |
| 1645 | 1650 | MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(120)) |
| 1646 | 1651 | |
| r18138 | r18139 | |
| 1652 | 1657 | MCFG_CPU_PROGRAM_MAP(van16_mem) |
| 1653 | 1658 | MCFG_MACHINE_START_OVERRIDE(polgar_state,van16) |
| 1654 | 1659 | MCFG_MACHINE_RESET_OVERRIDE(polgar_state,van16) |
| 1655 | | MCFG_TIMER_ADD_PERIODIC("int_timer", timer_update_irq6, attotime::from_hz(600)) // chess clock right, diags wrong |
| 1656 | | // MCFG_TIMER_ADD_PERIODIC("int_timer", timer_update_irq6, attotime::from_hz(587)) // vv |
| 1660 | MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(600)) |
| 1661 | MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(587)) |
| 1657 | 1662 | MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(120)) |
| 1658 | 1663 | MCFG_FRAGMENT_ADD( chess_common ) |
| 1659 | 1664 | MCFG_NVRAM_ADD_0FILL("nvram") |
| r18138 | r18139 | |
| 1670 | 1675 | MCFG_CPU_PROGRAM_MAP(van32_mem) |
| 1671 | 1676 | MCFG_MACHINE_START_OVERRIDE(polgar_state,van32) |
| 1672 | 1677 | MCFG_MACHINE_RESET_OVERRIDE(polgar_state,van16) |
| 1673 | | MCFG_TIMER_ADD_PERIODIC("int_timer", timer_update_irq6, attotime::from_hz(750)) |
| 1678 | MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(750)) |
| 1674 | 1679 | MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(120)) |
| 1675 | 1680 | |
| 1676 | 1681 | MCFG_FRAGMENT_ADD( chess_common ) |
| r18138 | r18139 | |
| 1695 | 1700 | MCFG_CPU_PROGRAM_MAP(gen32_mem) |
| 1696 | 1701 | MCFG_MACHINE_START_OVERRIDE(polgar_state,van32) |
| 1697 | 1702 | MCFG_MACHINE_RESET_OVERRIDE(polgar_state,van16) |
| 1698 | | MCFG_TIMER_ADD_PERIODIC("int_timer", timer_update_irq6, attotime::from_hz(375)) |
| 1699 | | // MCFG_TIMER_ADD_PERIODIC("int_timer", timer_update_irq6, attotime::from_hz(368.64)) |
| 1703 | MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(375)) |
| 1704 | MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(368.64)) |
| 1700 | 1705 | MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(120)) |
| 1701 | 1706 | |
| 1702 | 1707 | MCFG_FRAGMENT_ADD( chess_common ) |
| r18138 | r18139 | |
| 1709 | 1714 | MCFG_CPU_MODIFY("maincpu") |
| 1710 | 1715 | MCFG_CPU_CLOCK( XTAL_33_333MHz * 2 ) |
| 1711 | 1716 | MCFG_DEVICE_REMOVE("int_timer") |
| 1712 | | MCFG_TIMER_ADD_PERIODIC("int_timer", timer_update_irq6, attotime::from_hz(500)) |
| 1717 | MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(500)) |
| 1713 | 1718 | |
| 1714 | 1719 | |
| 1715 | 1720 | MACHINE_CONFIG_END |
| r18138 | r18139 | |
| 1719 | 1724 | MCFG_CPU_PROGRAM_MAP(bpl32_mem) |
| 1720 | 1725 | MCFG_MACHINE_START_OVERRIDE(polgar_state,van32) |
| 1721 | 1726 | MCFG_MACHINE_RESET_OVERRIDE(polgar_state,van16) |
| 1722 | | MCFG_TIMER_ADD_PERIODIC("int_timer", timer_update_irq6, attotime::from_hz(750)) |
| 1727 | MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(750)) |
| 1723 | 1728 | MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100)) |
| 1724 | 1729 | |
| 1725 | 1730 | MCFG_FRAGMENT_ADD( chess_common ) |
trunk/src/mess/drivers/mephisto.c
| r18138 | r18139 | |
| 93 | 93 | virtual void machine_start(); |
| 94 | 94 | virtual void machine_reset(); |
| 95 | 95 | DECLARE_MACHINE_START(mm2); |
| 96 | TIMER_DEVICE_CALLBACK_MEMBER(update_nmi); |
| 97 | TIMER_DEVICE_CALLBACK_MEMBER(update_nmi_r5); |
| 98 | TIMER_DEVICE_CALLBACK_MEMBER(update_irq); |
| 96 | 99 | }; |
| 97 | 100 | |
| 98 | 101 | |
| r18138 | r18139 | |
| 330 | 333 | INPUT_PORTS_END |
| 331 | 334 | |
| 332 | 335 | |
| 333 | | static TIMER_DEVICE_CALLBACK( update_nmi ) |
| 336 | TIMER_DEVICE_CALLBACK_MEMBER(mephisto_state::update_nmi) |
| 334 | 337 | { |
| 335 | | mephisto_state *state = timer.machine().driver_data<mephisto_state>(); |
| 336 | | if (state->m_allowNMI) |
| 338 | if (m_allowNMI) |
| 337 | 339 | { |
| 338 | | state->m_allowNMI = 0; |
| 339 | | timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI,PULSE_LINE); |
| 340 | m_allowNMI = 0; |
| 341 | machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI,PULSE_LINE); |
| 340 | 342 | } |
| 341 | | beep_set_state(state->m_beep, state->m_led_status&64?1:0); |
| 343 | beep_set_state(m_beep, m_led_status&64?1:0); |
| 342 | 344 | } |
| 343 | 345 | |
| 344 | | static TIMER_DEVICE_CALLBACK( update_nmi_r5 ) |
| 346 | TIMER_DEVICE_CALLBACK_MEMBER(mephisto_state::update_nmi_r5) |
| 345 | 347 | { |
| 346 | | mephisto_state *state = timer.machine().driver_data<mephisto_state>(); |
| 347 | | timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI,PULSE_LINE); |
| 348 | | beep_set_state(state->m_beep, state->m_led_status&64?1:0); |
| 348 | machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI,PULSE_LINE); |
| 349 | beep_set_state(m_beep, m_led_status&64?1:0); |
| 349 | 350 | } |
| 350 | 351 | |
| 351 | | static TIMER_DEVICE_CALLBACK( update_irq ) //only mm2 |
| 352 | TIMER_DEVICE_CALLBACK_MEMBER(mephisto_state::update_irq)//only mm2 |
| 352 | 353 | { |
| 353 | | mephisto_state *state = timer.machine().driver_data<mephisto_state>(); |
| 354 | | timer.machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE); |
| 355 | | timer.machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, CLEAR_LINE); |
| 354 | machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE); |
| 355 | machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, CLEAR_LINE); |
| 356 | 356 | |
| 357 | | beep_set_state(state->m_beep, state->m_led_status&64?1:0); |
| 357 | beep_set_state(m_beep, m_led_status&64?1:0); |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | void mephisto_state::machine_start() |
| r18138 | r18139 | |
| 410 | 410 | MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0) |
| 411 | 411 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 412 | 412 | |
| 413 | | MCFG_TIMER_ADD_PERIODIC("nmi_timer", update_nmi, attotime::from_hz(600)) |
| 413 | MCFG_TIMER_DRIVER_ADD_PERIODIC("nmi_timer", mephisto_state, update_nmi, attotime::from_hz(600)) |
| 414 | 414 | MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100)) |
| 415 | 415 | MACHINE_CONFIG_END |
| 416 | 416 | |
| r18138 | r18139 | |
| 419 | 419 | MCFG_CPU_MODIFY("maincpu") |
| 420 | 420 | MCFG_CPU_PROGRAM_MAP(rebel5_mem) |
| 421 | 421 | MCFG_DEVICE_REMOVE("nmi_timer") |
| 422 | | MCFG_TIMER_ADD_PERIODIC("nmi_timer_r5", update_nmi_r5, attotime::from_hz(600)) |
| 422 | MCFG_TIMER_DRIVER_ADD_PERIODIC("nmi_timer_r5", mephisto_state, update_nmi_r5, attotime::from_hz(600)) |
| 423 | 423 | |
| 424 | 424 | MACHINE_CONFIG_END |
| 425 | 425 | |
| r18138 | r18139 | |
| 429 | 429 | MCFG_MACHINE_START_OVERRIDE(mephisto_state, mm2 ) |
| 430 | 430 | |
| 431 | 431 | MCFG_DEVICE_REMOVE("nmi_timer") |
| 432 | | MCFG_TIMER_ADD_PERIODIC("irq_timer", update_irq, attotime::from_hz(450)) |
| 432 | MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer", mephisto_state, update_irq, attotime::from_hz(450)) |
| 433 | 433 | MACHINE_CONFIG_END |
| 434 | 434 | |
| 435 | 435 | static MACHINE_CONFIG_DERIVED( mm4tk, mephisto ) |
trunk/src/mess/drivers/kim1.c
| r18138 | r18139 | |
| 124 | 124 | virtual void machine_start(); |
| 125 | 125 | virtual void machine_reset(); |
| 126 | 126 | DECLARE_INPUT_CHANGED_MEMBER(kim1_reset); |
| 127 | TIMER_DEVICE_CALLBACK_MEMBER(kim1_cassette_input); |
| 128 | TIMER_DEVICE_CALLBACK_MEMBER(kim1_update_leds); |
| 127 | 129 | }; |
| 128 | 130 | |
| 129 | 131 | |
| r18138 | r18139 | |
| 265 | 267 | }; |
| 266 | 268 | |
| 267 | 269 | |
| 268 | | static TIMER_DEVICE_CALLBACK( kim1_cassette_input ) |
| 270 | TIMER_DEVICE_CALLBACK_MEMBER(kim1_state::kim1_cassette_input) |
| 269 | 271 | { |
| 270 | | kim1_state *state = timer.machine().driver_data<kim1_state>(); |
| 271 | | double tap_val = state->m_cass->input(); |
| 272 | double tap_val = m_cass->input(); |
| 272 | 273 | |
| 273 | 274 | if ( tap_val <= 0 ) |
| 274 | 275 | { |
| 275 | | if ( state->m_cassette_high_count ) |
| 276 | if ( m_cassette_high_count ) |
| 276 | 277 | { |
| 277 | | state->m_311_output = ( state->m_cassette_high_count < 8 ) ? 0x80 : 0; |
| 278 | | state->m_cassette_high_count = 0; |
| 278 | m_311_output = ( m_cassette_high_count < 8 ) ? 0x80 : 0; |
| 279 | m_cassette_high_count = 0; |
| 279 | 280 | } |
| 280 | 281 | } |
| 281 | 282 | |
| 282 | 283 | if ( tap_val > 0 ) |
| 283 | | state->m_cassette_high_count++; |
| 284 | m_cassette_high_count++; |
| 284 | 285 | } |
| 285 | 286 | |
| 286 | 287 | |
| 287 | | static TIMER_DEVICE_CALLBACK( kim1_update_leds ) |
| 288 | TIMER_DEVICE_CALLBACK_MEMBER(kim1_state::kim1_update_leds) |
| 288 | 289 | { |
| 289 | | kim1_state *state = timer.machine().driver_data<kim1_state>(); |
| 290 | 290 | UINT8 i; |
| 291 | 291 | |
| 292 | 292 | for ( i = 0; i < 6; i++ ) |
| 293 | 293 | { |
| 294 | | if ( state->m_led_time[i] ) |
| 295 | | state->m_led_time[i]--; |
| 294 | if ( m_led_time[i] ) |
| 295 | m_led_time[i]--; |
| 296 | 296 | else |
| 297 | 297 | output_set_digit_value( i, 0 ); |
| 298 | 298 | } |
| r18138 | r18139 | |
| 348 | 348 | MCFG_MOS6530_ADD( "miot_u2", 1000000, kim1_u2_mos6530_interface ) |
| 349 | 349 | MCFG_MOS6530_ADD( "miot_u3", 1000000, kim1_u3_mos6530_interface ) |
| 350 | 350 | MCFG_CASSETTE_ADD( CASSETTE_TAG, kim1_cassette_interface ) |
| 351 | | MCFG_TIMER_ADD_PERIODIC("led_timer", kim1_update_leds, attotime::from_hz(60)) |
| 352 | | MCFG_TIMER_ADD_PERIODIC("cassette_timer", kim1_cassette_input, attotime::from_hz(44100)) |
| 351 | MCFG_TIMER_DRIVER_ADD_PERIODIC("led_timer", kim1_state, kim1_update_leds, attotime::from_hz(60)) |
| 352 | MCFG_TIMER_DRIVER_ADD_PERIODIC("cassette_timer", kim1_state, kim1_cassette_input, attotime::from_hz(44100)) |
| 353 | 353 | MACHINE_CONFIG_END |
| 354 | 354 | |
| 355 | 355 | |
trunk/src/mess/drivers/px4.c
| r18138 | r18139 | |
| 170 | 170 | TIMER_CALLBACK_MEMBER(ext_cassette_read); |
| 171 | 171 | TIMER_CALLBACK_MEMBER(transmit_data); |
| 172 | 172 | TIMER_CALLBACK_MEMBER(receive_data); |
| 173 | TIMER_DEVICE_CALLBACK_MEMBER(frc_tick); |
| 174 | TIMER_DEVICE_CALLBACK_MEMBER(upd7508_1sec_callback); |
| 173 | 175 | }; |
| 174 | 176 | |
| 175 | 177 | |
| r18138 | r18139 | |
| 344 | 346 | } |
| 345 | 347 | |
| 346 | 348 | /* free running counter */ |
| 347 | | static TIMER_DEVICE_CALLBACK( frc_tick ) |
| 349 | TIMER_DEVICE_CALLBACK_MEMBER(px4_state::frc_tick) |
| 348 | 350 | { |
| 349 | | px4_state *px4 = timer.machine().driver_data<px4_state>(); |
| 350 | 351 | |
| 351 | | px4->m_frc_value++; |
| 352 | m_frc_value++; |
| 352 | 353 | |
| 353 | | if (px4->m_frc_value == 0) |
| 354 | if (m_frc_value == 0) |
| 354 | 355 | { |
| 355 | | px4->m_isr |= INT3_OVF; |
| 356 | | gapnit_interrupt(timer.machine()); |
| 356 | m_isr |= INT3_OVF; |
| 357 | gapnit_interrupt(machine()); |
| 357 | 358 | } |
| 358 | 359 | } |
| 359 | 360 | |
| r18138 | r18139 | |
| 919 | 920 | 7508 RELATED |
| 920 | 921 | ***************************************************************************/ |
| 921 | 922 | |
| 922 | | static TIMER_DEVICE_CALLBACK( upd7508_1sec_callback ) |
| 923 | TIMER_DEVICE_CALLBACK_MEMBER(px4_state::upd7508_1sec_callback) |
| 923 | 924 | { |
| 924 | | px4_state *px4 = timer.machine().driver_data<px4_state>(); |
| 925 | 925 | |
| 926 | 926 | /* adjust interrupt status */ |
| 927 | | px4->m_interrupt_status |= UPD7508_INT_ONE_SECOND; |
| 927 | m_interrupt_status |= UPD7508_INT_ONE_SECOND; |
| 928 | 928 | |
| 929 | 929 | /* are interrupts enabled? */ |
| 930 | | if (px4->m_one_sec_int_enabled) |
| 930 | if (m_one_sec_int_enabled) |
| 931 | 931 | { |
| 932 | | px4->m_isr |= INT0_7508; |
| 933 | | gapnit_interrupt(timer.machine()); |
| 932 | m_isr |= INT0_7508; |
| 933 | gapnit_interrupt(machine()); |
| 934 | 934 | } |
| 935 | 935 | } |
| 936 | 936 | |
| r18138 | r18139 | |
| 1376 | 1376 | |
| 1377 | 1377 | MCFG_PALETTE_LENGTH(2) |
| 1378 | 1378 | |
| 1379 | | MCFG_TIMER_ADD_PERIODIC("one_sec", upd7508_1sec_callback, attotime::from_seconds(1)) |
| 1380 | | MCFG_TIMER_ADD_PERIODIC("frc", frc_tick, attotime::from_hz(XTAL_7_3728MHz / 2 / 6)) |
| 1379 | MCFG_TIMER_DRIVER_ADD_PERIODIC("one_sec", px4_state, upd7508_1sec_callback, attotime::from_seconds(1)) |
| 1380 | MCFG_TIMER_DRIVER_ADD_PERIODIC("frc", px4_state, frc_tick, attotime::from_hz(XTAL_7_3728MHz / 2 / 6)) |
| 1381 | 1381 | |
| 1382 | 1382 | /* internal ram */ |
| 1383 | 1383 | MCFG_RAM_ADD(RAM_TAG) |
trunk/src/mess/drivers/pc6001.c
| r18138 | r18139 | |
| 236 | 236 | INTERRUPT_GEN_MEMBER(pc6001_interrupt); |
| 237 | 237 | INTERRUPT_GEN_MEMBER(pc6001sr_interrupt); |
| 238 | 238 | TIMER_CALLBACK_MEMBER(audio_callback); |
| 239 | TIMER_DEVICE_CALLBACK_MEMBER(cassette_callback); |
| 240 | TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback); |
| 239 | 241 | }; |
| 240 | 242 | |
| 241 | 243 | |
| r18138 | r18139 | |
| 2021 | 2023 | return joy_press; |
| 2022 | 2024 | } |
| 2023 | 2025 | |
| 2024 | | static TIMER_DEVICE_CALLBACK(cassette_callback) |
| 2026 | TIMER_DEVICE_CALLBACK_MEMBER(pc6001_state::cassette_callback) |
| 2025 | 2027 | { |
| 2026 | | pc6001_state *state = timer.machine().driver_data<pc6001_state>(); |
| 2027 | | if(state->m_cas_switch == 1) |
| 2028 | if(m_cas_switch == 1) |
| 2028 | 2029 | { |
| 2029 | 2030 | #if 0 |
| 2030 | 2031 | static UINT8 cas_data_i = 0x80,cas_data_poll; |
| 2031 | | //state->m_cur_keycode = gfx_data[state->m_cas_offset++]; |
| 2032 | | if((timer.machine().device<cassette_image_device>(CASSETTE_TAG))->input() > 0.03) |
| 2032 | //m_cur_keycode = gfx_data[m_cas_offset++]; |
| 2033 | if((machine().device<cassette_image_device>(CASSETTE_TAG))->input() > 0.03) |
| 2033 | 2034 | cas_data_poll|= cas_data_i; |
| 2034 | 2035 | else |
| 2035 | 2036 | cas_data_poll&=~cas_data_i; |
| 2036 | 2037 | if(cas_data_i == 1) |
| 2037 | 2038 | { |
| 2038 | | state->m_cur_keycode = cas_data_poll; |
| 2039 | m_cur_keycode = cas_data_poll; |
| 2039 | 2040 | cas_data_i = 0x80; |
| 2040 | 2041 | /* data ready, poll irq */ |
| 2041 | | state->m_irq_vector = 0x08; |
| 2042 | | timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); |
| 2042 | m_irq_vector = 0x08; |
| 2043 | machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); |
| 2043 | 2044 | } |
| 2044 | 2045 | else |
| 2045 | 2046 | cas_data_i>>=1; |
| 2046 | 2047 | #else |
| 2047 | | UINT8 *cas_data = timer.machine().root_device().memregion("cas")->base(); |
| 2048 | UINT8 *cas_data = machine().root_device().memregion("cas")->base(); |
| 2048 | 2049 | |
| 2049 | | state->m_cur_keycode = cas_data[state->m_cas_offset++]; |
| 2050 | | popmessage("%04x %04x",state->m_cas_offset,state->m_cas_maxsize); |
| 2051 | | if(state->m_cas_offset > state->m_cas_maxsize) |
| 2050 | m_cur_keycode = cas_data[m_cas_offset++]; |
| 2051 | popmessage("%04x %04x",m_cas_offset,m_cas_maxsize); |
| 2052 | if(m_cas_offset > m_cas_maxsize) |
| 2052 | 2053 | { |
| 2053 | | state->m_cas_offset = 0; |
| 2054 | | state->m_cas_switch = 0; |
| 2054 | m_cas_offset = 0; |
| 2055 | m_cas_switch = 0; |
| 2055 | 2056 | if(IRQ_LOG) printf("Tape-E IRQ 0x12\n"); |
| 2056 | | state->m_irq_vector = 0x12; |
| 2057 | | timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); |
| 2057 | m_irq_vector = 0x12; |
| 2058 | machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); |
| 2058 | 2059 | } |
| 2059 | 2060 | else |
| 2060 | 2061 | { |
| 2061 | 2062 | if(IRQ_LOG) printf("Tape-D IRQ 0x08\n"); |
| 2062 | | state->m_irq_vector = 0x08; |
| 2063 | | timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); |
| 2063 | m_irq_vector = 0x08; |
| 2064 | machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); |
| 2064 | 2065 | } |
| 2065 | 2066 | #endif |
| 2066 | 2067 | } |
| 2067 | 2068 | } |
| 2068 | 2069 | |
| 2069 | | static TIMER_DEVICE_CALLBACK(keyboard_callback) |
| 2070 | TIMER_DEVICE_CALLBACK_MEMBER(pc6001_state::keyboard_callback) |
| 2070 | 2071 | { |
| 2071 | | pc6001_state *state = timer.machine().driver_data<pc6001_state>(); |
| 2072 | | address_space &space = timer.machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 2073 | | UINT32 key1 = timer.machine().root_device().ioport("key1")->read(); |
| 2074 | | UINT32 key2 = timer.machine().root_device().ioport("key2")->read(); |
| 2075 | | UINT32 key3 = timer.machine().root_device().ioport("key3")->read(); |
| 2076 | | // UINT8 p1_key = timer.machine().root_device().ioport("P1")->read(); |
| 2072 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 2073 | UINT32 key1 = machine().root_device().ioport("key1")->read(); |
| 2074 | UINT32 key2 = machine().root_device().ioport("key2")->read(); |
| 2075 | UINT32 key3 = machine().root_device().ioport("key3")->read(); |
| 2076 | // UINT8 p1_key = machine().root_device().ioport("P1")->read(); |
| 2077 | 2077 | |
| 2078 | | if(state->m_cas_switch == 0) |
| 2078 | if(m_cas_switch == 0) |
| 2079 | 2079 | { |
| 2080 | | if((key1 != state->m_old_key1) || (key2 != state->m_old_key2) || (key3 != state->m_old_key3)) |
| 2080 | if((key1 != m_old_key1) || (key2 != m_old_key2) || (key3 != m_old_key3)) |
| 2081 | 2081 | { |
| 2082 | | state->m_cur_keycode = check_keyboard_press(space.machine()); |
| 2082 | m_cur_keycode = check_keyboard_press(space.machine()); |
| 2083 | 2083 | if(IRQ_LOG) printf("KEY IRQ 0x02\n"); |
| 2084 | | state->m_irq_vector = 0x02; |
| 2085 | | timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); |
| 2086 | | state->m_old_key1 = key1; |
| 2087 | | state->m_old_key2 = key2; |
| 2088 | | state->m_old_key3 = key3; |
| 2084 | m_irq_vector = 0x02; |
| 2085 | machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); |
| 2086 | m_old_key1 = key1; |
| 2087 | m_old_key2 = key2; |
| 2088 | m_old_key3 = key3; |
| 2089 | 2089 | } |
| 2090 | 2090 | #if 0 |
| 2091 | 2091 | else /* joypad polling */ |
| 2092 | 2092 | { |
| 2093 | | state->m_cur_keycode = check_joy_press(space.machine()); |
| 2094 | | if(state->m_cur_keycode) |
| 2093 | m_cur_keycode = check_joy_press(space.machine()); |
| 2094 | if(m_cur_keycode) |
| 2095 | 2095 | { |
| 2096 | | state->m_irq_vector = 0x16; |
| 2097 | | timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); |
| 2096 | m_irq_vector = 0x16; |
| 2097 | machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); |
| 2098 | 2098 | } |
| 2099 | 2099 | } |
| 2100 | 2100 | #endif |
| r18138 | r18139 | |
| 2368 | 2368 | // MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 2369 | 2369 | |
| 2370 | 2370 | /* TODO: accurate timing on this */ |
| 2371 | | MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(250)) |
| 2372 | | MCFG_TIMER_ADD_PERIODIC("cassette_timer", cassette_callback, attotime::from_hz(1200/12)) //1200 bauds / (1 start bit -> 8 data bits -> 3 stop bits) |
| 2371 | MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", pc6001_state, keyboard_callback, attotime::from_hz(250)) |
| 2372 | MCFG_TIMER_DRIVER_ADD_PERIODIC("cassette_timer", pc6001_state, cassette_callback, attotime::from_hz(1200/12)) |
| 2373 | 2373 | MACHINE_CONFIG_END |
| 2374 | 2374 | |
| 2375 | 2375 | |
trunk/src/mess/drivers/smc777.c
| r18138 | r18139 | |
| 88 | 88 | virtual void palette_init(); |
| 89 | 89 | UINT32 screen_update_smc777(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 90 | 90 | INTERRUPT_GEN_MEMBER(smc777_vblank_irq); |
| 91 | TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback); |
| 91 | 92 | }; |
| 92 | 93 | |
| 93 | 94 | |
| r18138 | r18139 | |
| 930 | 931 | } |
| 931 | 932 | }; |
| 932 | 933 | |
| 933 | | static TIMER_DEVICE_CALLBACK( keyboard_callback ) |
| 934 | TIMER_DEVICE_CALLBACK_MEMBER(smc777_state::keyboard_callback) |
| 934 | 935 | { |
| 935 | | smc777_state *state = timer.machine().driver_data<smc777_state>(); |
| 936 | 936 | static const char *const portnames[11] = { "key0","key1","key2","key3","key4","key5","key6","key7", "key8", "key9", "keya" }; |
| 937 | 937 | int i,port_i,scancode; |
| 938 | | UINT8 shift_mod = timer.machine().root_device().ioport("key_mod")->read() & 1; |
| 939 | | UINT8 kana_mod = timer.machine().root_device().ioport("key_mod")->read() & 0x10; |
| 938 | UINT8 shift_mod = machine().root_device().ioport("key_mod")->read() & 1; |
| 939 | UINT8 kana_mod = machine().root_device().ioport("key_mod")->read() & 0x10; |
| 940 | 940 | scancode = 0; |
| 941 | 941 | |
| 942 | 942 | for(port_i=0;port_i<11;port_i++) |
| 943 | 943 | { |
| 944 | 944 | for(i=0;i<8;i++) |
| 945 | 945 | { |
| 946 | | if((timer.machine().root_device().ioport(portnames[port_i])->read()>>i) & 1) |
| 946 | if((machine().root_device().ioport(portnames[port_i])->read()>>i) & 1) |
| 947 | 947 | { |
| 948 | | state->m_keyb_press = smc777_keytable[shift_mod & 1][scancode]; |
| 949 | | if(kana_mod) { state->m_keyb_press|=0x80; } |
| 950 | | state->m_keyb_press_flag = 1; |
| 951 | | state->m_shift_press_flag = shift_mod & 1; |
| 948 | m_keyb_press = smc777_keytable[shift_mod & 1][scancode]; |
| 949 | if(kana_mod) { m_keyb_press|=0x80; } |
| 950 | m_keyb_press_flag = 1; |
| 951 | m_shift_press_flag = shift_mod & 1; |
| 952 | 952 | return; |
| 953 | 953 | } |
| 954 | 954 | scancode++; |
| r18138 | r18139 | |
| 1109 | 1109 | MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0) |
| 1110 | 1110 | MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50) |
| 1111 | 1111 | |
| 1112 | | MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(240/32)) |
| 1112 | MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", smc777_state, keyboard_callback, attotime::from_hz(240/32)) |
| 1113 | 1113 | MACHINE_CONFIG_END |
| 1114 | 1114 | |
| 1115 | 1115 | /* ROM definition */ |
trunk/src/mess/drivers/vboy.c
| r18138 | r18139 | |
| 150 | 150 | virtual void palette_init(); |
| 151 | 151 | UINT32 screen_update_vboy_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 152 | 152 | UINT32 screen_update_vboy_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 153 | TIMER_DEVICE_CALLBACK_MEMBER(timer_main_tick); |
| 154 | TIMER_DEVICE_CALLBACK_MEMBER(timer_pad_tick); |
| 155 | TIMER_DEVICE_CALLBACK_MEMBER(vboy_scanlineL); |
| 156 | TIMER_DEVICE_CALLBACK_MEMBER(vboy_scanlineR); |
| 153 | 157 | }; |
| 154 | 158 | |
| 155 | 159 | |
| r18138 | r18139 | |
| 1213 | 1217 | } |
| 1214 | 1218 | } |
| 1215 | 1219 | |
| 1216 | | static TIMER_DEVICE_CALLBACK( timer_main_tick ) |
| 1220 | TIMER_DEVICE_CALLBACK_MEMBER(vboy_state::timer_main_tick) |
| 1217 | 1221 | { |
| 1218 | | vboy_state *state = timer.machine().driver_data<vboy_state>(); |
| 1219 | 1222 | |
| 1220 | | state->m_timer_tick(); |
| 1223 | m_timer_tick(); |
| 1221 | 1224 | } |
| 1222 | 1225 | |
| 1223 | | static TIMER_DEVICE_CALLBACK( timer_pad_tick ) |
| 1226 | TIMER_DEVICE_CALLBACK_MEMBER(vboy_state::timer_pad_tick) |
| 1224 | 1227 | { |
| 1225 | | vboy_state *state = timer.machine().driver_data<vboy_state>(); |
| 1226 | 1228 | |
| 1227 | | if((state->m_vboy_regs.kcr & 0x80) == 0) |
| 1228 | | state->m_maincpu->set_input_line(0, HOLD_LINE); |
| 1229 | if((m_vboy_regs.kcr & 0x80) == 0) |
| 1230 | m_maincpu->set_input_line(0, HOLD_LINE); |
| 1229 | 1231 | } |
| 1230 | 1232 | |
| 1231 | 1233 | void vboy_state::palette_init() |
| r18138 | r18139 | |
| 1299 | 1301 | |
| 1300 | 1302 | } |
| 1301 | 1303 | |
| 1302 | | static TIMER_DEVICE_CALLBACK( vboy_scanlineL ) |
| 1304 | TIMER_DEVICE_CALLBACK_MEMBER(vboy_state::vboy_scanlineL) |
| 1303 | 1305 | { |
| 1304 | | vboy_state *state = timer.machine().driver_data<vboy_state>(); |
| 1305 | 1306 | int scanline = param; |
| 1306 | 1307 | |
| 1307 | | state->m_scanline_tick(scanline,0); |
| 1308 | m_scanline_tick(scanline,0); |
| 1308 | 1309 | } |
| 1309 | 1310 | |
| 1310 | 1311 | #if 0 |
| 1311 | | static TIMER_DEVICE_CALLBACK( vboy_scanlineR ) |
| 1312 | TIMER_DEVICE_CALLBACK_MEMBER(vboy_state::vboy_scanlineR) |
| 1312 | 1313 | { |
| 1313 | | vboy_state *state = timer.machine().driver_data<vboy_state>(); |
| 1314 | 1314 | int scanline = param; |
| 1315 | 1315 | |
| 1316 | | //state->m_scanline_tick(scanline,1); |
| 1316 | //m_scanline_tick(scanline,1); |
| 1317 | 1317 | } |
| 1318 | 1318 | #endif |
| 1319 | 1319 | |
| r18138 | r18139 | |
| 1425 | 1425 | MCFG_CPU_ADD( "maincpu", V810, XTAL_20MHz ) |
| 1426 | 1426 | MCFG_CPU_PROGRAM_MAP(vboy_mem) |
| 1427 | 1427 | MCFG_CPU_IO_MAP(vboy_io) |
| 1428 | | MCFG_TIMER_ADD_SCANLINE("scantimer_l", vboy_scanlineL, "3dleft", 0, 1) |
| 1429 | | //MCFG_TIMER_ADD_SCANLINE("scantimer_r", vboy_scanlineR, "3dright", 0, 1) |
| 1428 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer_l", vboy_state, vboy_scanlineL, "3dleft", 0, 1) |
| 1429 | //MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer_r", vboy_state, vboy_scanlineR, "3dright", 0, 1) |
| 1430 | 1430 | |
| 1431 | 1431 | |
| 1432 | 1432 | // programmable timer |
| 1433 | | MCFG_TIMER_ADD("timer_main", timer_main_tick) |
| 1433 | MCFG_TIMER_DRIVER_ADD("timer_main", vboy_state, timer_main_tick) |
| 1434 | 1434 | |
| 1435 | 1435 | // pad ready, which should be once per VBL |
| 1436 | | MCFG_TIMER_ADD_PERIODIC("timer_pad", timer_pad_tick, attotime::from_hz(50.038029f)) |
| 1436 | MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_pad", vboy_state, timer_pad_tick, attotime::from_hz(50.038029f)) |
| 1437 | 1437 | |
| 1438 | 1438 | /* video hardware */ |
| 1439 | 1439 | MCFG_DEFAULT_LAYOUT(layout_vboy) |
trunk/src/mess/drivers/exelv.c
| r18138 | r18139 | |
| 105 | 105 | UINT8 m_wx318; /* data of 74ls374 labeled wx318 */ |
| 106 | 106 | UINT8 m_wx319; /* data of 74sl374 labeled wx319 */ |
| 107 | 107 | virtual void palette_init(); |
| 108 | TIMER_DEVICE_CALLBACK_MEMBER(exelv_hblank_interrupt); |
| 108 | 109 | }; |
| 109 | 110 | |
| 110 | 111 | |
| 111 | | static TIMER_DEVICE_CALLBACK( exelv_hblank_interrupt ) |
| 112 | TIMER_DEVICE_CALLBACK_MEMBER(exelv_state::exelv_hblank_interrupt) |
| 112 | 113 | { |
| 113 | | exelv_state *exelv = timer.machine().driver_data<exelv_state>(); |
| 114 | | exelv->m_tms3556->interrupt(timer.machine()); |
| 114 | m_tms3556->interrupt(machine()); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | #ifdef UNUSED_FUNCTION |
| r18138 | r18139 | |
| 530 | 530 | MCFG_CPU_ADD("maincpu", TMS7000_EXL, XTAL_4_9152MHz) /* TMS7020 */ |
| 531 | 531 | MCFG_CPU_PROGRAM_MAP(tms7020_mem) |
| 532 | 532 | MCFG_CPU_IO_MAP(tms7020_port) |
| 533 | | MCFG_TIMER_ADD_SCANLINE("scantimer", exelv_hblank_interrupt, "screen", 0, 1) |
| 533 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", exelv_state, exelv_hblank_interrupt, "screen", 0, 1) |
| 534 | 534 | |
| 535 | 535 | MCFG_CPU_ADD("tms7041", TMS7000, XTAL_4_9152MHz) |
| 536 | 536 | MCFG_CPU_PROGRAM_MAP(tms7041_map) |
| r18138 | r18139 | |
| 570 | 570 | MCFG_CPU_ADD("maincpu", TMS7000_EXL, XTAL_4_9152MHz) /* TMS7040 */ |
| 571 | 571 | MCFG_CPU_PROGRAM_MAP(tms7040_mem) |
| 572 | 572 | MCFG_CPU_IO_MAP(tms7020_port) |
| 573 | | MCFG_TIMER_ADD_SCANLINE("scantimer", exelv_hblank_interrupt, "screen", 0, 1) |
| 573 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", exelv_state, exelv_hblank_interrupt, "screen", 0, 1) |
| 574 | 574 | |
| 575 | 575 | MCFG_CPU_ADD("tms7042", TMS7000, XTAL_4_9152MHz) |
| 576 | 576 | MCFG_CPU_PROGRAM_MAP(tms7042_map) |
trunk/src/mess/drivers/multi8.c
| r18138 | r18139 | |
| 69 | 69 | virtual void video_start(); |
| 70 | 70 | virtual void palette_init(); |
| 71 | 71 | UINT32 screen_update_multi8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 72 | TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback); |
| 72 | 73 | }; |
| 73 | 74 | |
| 74 | 75 | #define mc6845_h_char_total (m_crtc_vreg[0]) |
| r18138 | r18139 | |
| 482 | 483 | PORT_BIT(0x00000010,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("GRPH") PORT_CODE(KEYCODE_LALT) |
| 483 | 484 | INPUT_PORTS_END |
| 484 | 485 | |
| 485 | | static TIMER_DEVICE_CALLBACK( keyboard_callback ) |
| 486 | TIMER_DEVICE_CALLBACK_MEMBER(multi8_state::keyboard_callback) |
| 486 | 487 | { |
| 487 | | multi8_state *state = timer.machine().driver_data<multi8_state>(); |
| 488 | 488 | static const char *const portnames[3] = { "key1","key2","key3" }; |
| 489 | 489 | int i,port_i,scancode; |
| 490 | | UINT8 keymod = timer.machine().root_device().ioport("key_modifiers")->read() & 0x1f; |
| 490 | UINT8 keymod = machine().root_device().ioport("key_modifiers")->read() & 0x1f; |
| 491 | 491 | scancode = 0; |
| 492 | 492 | |
| 493 | | state->m_shift_press_flag = ((keymod & 0x02) >> 1); |
| 493 | m_shift_press_flag = ((keymod & 0x02) >> 1); |
| 494 | 494 | |
| 495 | 495 | for(port_i=0;port_i<3;port_i++) |
| 496 | 496 | { |
| 497 | 497 | for(i=0;i<32;i++) |
| 498 | 498 | { |
| 499 | | if((timer.machine().root_device().ioport(portnames[port_i])->read()>>i) & 1) |
| 499 | if((machine().root_device().ioport(portnames[port_i])->read()>>i) & 1) |
| 500 | 500 | { |
| 501 | 501 | //key_flag = 1; |
| 502 | | if(!state->m_shift_press_flag) // shift not pressed |
| 502 | if(!m_shift_press_flag) // shift not pressed |
| 503 | 503 | { |
| 504 | 504 | if(scancode >= 0x41 && scancode < 0x5b) |
| 505 | 505 | scancode += 0x20; // lowercase |
| r18138 | r18139 | |
| 521 | 521 | if(scancode == 0x3c) |
| 522 | 522 | scancode = 0x3e; |
| 523 | 523 | } |
| 524 | | state->m_keyb_press = scancode; |
| 525 | | state->m_keyb_press_flag = 1; |
| 524 | m_keyb_press = scancode; |
| 525 | m_keyb_press_flag = 1; |
| 526 | 526 | return; |
| 527 | 527 | } |
| 528 | 528 | scancode++; |
| r18138 | r18139 | |
| 684 | 684 | MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50) |
| 685 | 685 | |
| 686 | 686 | /* Devices */ |
| 687 | | MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(240/32)) |
| 687 | MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", multi8_state, keyboard_callback, attotime::from_hz(240/32)) |
| 688 | 688 | MCFG_MC6845_ADD("crtc", H46505, XTAL_3_579545MHz/2, mc6845_intf) /* unknown clock, hand tuned to get ~60 fps */ |
| 689 | 689 | MCFG_I8255_ADD( "ppi8255_0", ppi8255_intf_0 ) |
| 690 | 690 | MACHINE_CONFIG_END |
trunk/src/mess/drivers/pc100.c
| r18138 | r18139 | |
| 65 | 65 | virtual void video_start(); |
| 66 | 66 | UINT32 screen_update_pc100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 67 | 67 | INTERRUPT_GEN_MEMBER(pc100_vblank_irq); |
| 68 | TIMER_DEVICE_CALLBACK_MEMBER(pc100_600hz_irq); |
| 69 | TIMER_DEVICE_CALLBACK_MEMBER(pc100_100hz_irq); |
| 70 | TIMER_DEVICE_CALLBACK_MEMBER(pc100_50hz_irq); |
| 71 | TIMER_DEVICE_CALLBACK_MEMBER(pc100_10hz_irq); |
| 68 | 72 | }; |
| 69 | 73 | |
| 70 | 74 | void pc100_state::video_start() |
| r18138 | r18139 | |
| 348 | 352 | pic8259_ir4_w(machine().device("pic8259"), 1); |
| 349 | 353 | } |
| 350 | 354 | |
| 351 | | static TIMER_DEVICE_CALLBACK( pc100_600hz_irq ) |
| 355 | TIMER_DEVICE_CALLBACK_MEMBER(pc100_state::pc100_600hz_irq) |
| 352 | 356 | { |
| 353 | | pc100_state *state = timer.machine().driver_data<pc100_state>(); |
| 354 | 357 | |
| 355 | | if(state->m_timer_mode == 0) |
| 356 | | pic8259_ir2_w(timer.machine().device("pic8259"), 1); |
| 358 | if(m_timer_mode == 0) |
| 359 | pic8259_ir2_w(machine().device("pic8259"), 1); |
| 357 | 360 | } |
| 358 | 361 | |
| 359 | | static TIMER_DEVICE_CALLBACK( pc100_100hz_irq ) |
| 362 | TIMER_DEVICE_CALLBACK_MEMBER(pc100_state::pc100_100hz_irq) |
| 360 | 363 | { |
| 361 | | pc100_state *state = timer.machine().driver_data<pc100_state>(); |
| 362 | 364 | |
| 363 | | if(state->m_timer_mode == 1) |
| 364 | | pic8259_ir2_w(timer.machine().device("pic8259"), 1); |
| 365 | if(m_timer_mode == 1) |
| 366 | pic8259_ir2_w(machine().device("pic8259"), 1); |
| 365 | 367 | } |
| 366 | 368 | |
| 367 | | static TIMER_DEVICE_CALLBACK( pc100_50hz_irq ) |
| 369 | TIMER_DEVICE_CALLBACK_MEMBER(pc100_state::pc100_50hz_irq) |
| 368 | 370 | { |
| 369 | | pc100_state *state = timer.machine().driver_data<pc100_state>(); |
| 370 | 371 | |
| 371 | | if(state->m_timer_mode == 2) |
| 372 | | pic8259_ir2_w(timer.machine().device("pic8259"), 1); |
| 372 | if(m_timer_mode == 2) |
| 373 | pic8259_ir2_w(machine().device("pic8259"), 1); |
| 373 | 374 | } |
| 374 | 375 | |
| 375 | | static TIMER_DEVICE_CALLBACK( pc100_10hz_irq ) |
| 376 | TIMER_DEVICE_CALLBACK_MEMBER(pc100_state::pc100_10hz_irq) |
| 376 | 377 | { |
| 377 | | pc100_state *state = timer.machine().driver_data<pc100_state>(); |
| 378 | 378 | |
| 379 | | if(state->m_timer_mode == 3) |
| 380 | | pic8259_ir2_w(timer.machine().device("pic8259"), 1); |
| 379 | if(m_timer_mode == 3) |
| 380 | pic8259_ir2_w(machine().device("pic8259"), 1); |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | #define MASTER_CLOCK 6988800 |
| r18138 | r18139 | |
| 401 | 401 | MCFG_PALETTE_LENGTH(16) |
| 402 | 402 | // MCFG_PALETTE_INIT(black_and_white) |
| 403 | 403 | |
| 404 | | MCFG_TIMER_ADD_PERIODIC("600hz", pc100_600hz_irq, attotime::from_hz(MASTER_CLOCK/600)) |
| 405 | | MCFG_TIMER_ADD_PERIODIC("100hz", pc100_100hz_irq, attotime::from_hz(MASTER_CLOCK/100)) |
| 406 | | MCFG_TIMER_ADD_PERIODIC("50hz", pc100_50hz_irq, attotime::from_hz(MASTER_CLOCK/50)) |
| 407 | | MCFG_TIMER_ADD_PERIODIC("10hz", pc100_10hz_irq, attotime::from_hz(MASTER_CLOCK/10)) |
| 404 | MCFG_TIMER_DRIVER_ADD_PERIODIC("600hz", pc100_state, pc100_600hz_irq, attotime::from_hz(MASTER_CLOCK/600)) |
| 405 | MCFG_TIMER_DRIVER_ADD_PERIODIC("100hz", pc100_state, pc100_100hz_irq, attotime::from_hz(MASTER_CLOCK/100)) |
| 406 | MCFG_TIMER_DRIVER_ADD_PERIODIC("50hz", pc100_state, pc100_50hz_irq, attotime::from_hz(MASTER_CLOCK/50)) |
| 407 | MCFG_TIMER_DRIVER_ADD_PERIODIC("10hz", pc100_state, pc100_10hz_irq, attotime::from_hz(MASTER_CLOCK/10)) |
| 408 | 408 | MCFG_I8255_ADD( "ppi8255_2", pc100_ppi8255_interface_2 ) |
| 409 | 409 | MCFG_PIC8259_ADD( "pic8259", pc100_pic8259_config ) |
| 410 | 410 | MACHINE_CONFIG_END |
trunk/src/mess/drivers/mycom.c
| r18138 | r18139 | |
| 110 | 110 | virtual void machine_start(); |
| 111 | 111 | virtual void video_start(); |
| 112 | 112 | DECLARE_DRIVER_INIT(mycom); |
| 113 | TIMER_DEVICE_CALLBACK_MEMBER(mycom_kbd); |
| 113 | 114 | }; |
| 114 | 115 | |
| 115 | 116 | |
| r18138 | r18139 | |
| 472 | 473 | 0x0d,0x0d,0x38,0x28,0x49,0x69,0x4b,0x6b,0x2c,0x3c,0x39,0x39,0x36,0x36,0x33,0x33,0x12,0x12, |
| 473 | 474 | 0x07,0x07,0x39,0x29,0x4f,0x6f,0x4c,0x6c,0x2e,0x3e,0x63,0x63,0x66,0x66,0x61,0x61,0x2f,0x3f }; |
| 474 | 475 | |
| 475 | | static TIMER_DEVICE_CALLBACK( mycom_kbd ) |
| 476 | TIMER_DEVICE_CALLBACK_MEMBER(mycom_state::mycom_kbd) |
| 476 | 477 | { |
| 477 | | mycom_state *state = timer.machine().driver_data<mycom_state>(); |
| 478 | 478 | UINT8 x, y, scancode = 0; |
| 479 | 479 | UINT16 pressed[9]; |
| 480 | 480 | char kbdrow[3]; |
| 481 | | UINT8 modifiers = timer.machine().root_device().ioport("XX")->read(); |
| 481 | UINT8 modifiers = machine().root_device().ioport("XX")->read(); |
| 482 | 482 | UINT8 shift_pressed = (modifiers & 2) >> 1; |
| 483 | | state->m_keyb_press_flag = 0; |
| 483 | m_keyb_press_flag = 0; |
| 484 | 484 | |
| 485 | 485 | /* see what is pressed */ |
| 486 | 486 | for (x = 0; x < 9; x++) |
| 487 | 487 | { |
| 488 | 488 | sprintf(kbdrow,"X%d",x); |
| 489 | | pressed[x] = (timer.machine().root_device().ioport(kbdrow)->read()); |
| 489 | pressed[x] = (machine().root_device().ioport(kbdrow)->read()); |
| 490 | 490 | } |
| 491 | 491 | |
| 492 | 492 | /* find what has changed */ |
| r18138 | r18139 | |
| 500 | 500 | if (BIT(pressed[x], y)) |
| 501 | 501 | { |
| 502 | 502 | scancode = ((x + y * 9) << 1) + shift_pressed + 1; |
| 503 | | state->m_keyb_press_flag = 1; |
| 504 | | state->m_keyb_press = mycom_keyval[scancode]; |
| 503 | m_keyb_press_flag = 1; |
| 504 | m_keyb_press = mycom_keyval[scancode]; |
| 505 | 505 | } |
| 506 | 506 | } |
| 507 | 507 | } |
| 508 | 508 | } |
| 509 | 509 | |
| 510 | | if (state->m_keyb_press_flag) |
| 510 | if (m_keyb_press_flag) |
| 511 | 511 | { |
| 512 | | if (modifiers & 1) state->m_keyb_press &= 0xbf; |
| 513 | | if (modifiers & 4) state->m_keyb_press |= 0x80; |
| 512 | if (modifiers & 1) m_keyb_press &= 0xbf; |
| 513 | if (modifiers & 4) m_keyb_press |= 0x80; |
| 514 | 514 | } |
| 515 | 515 | } |
| 516 | 516 | |
| r18138 | r18139 | |
| 619 | 619 | MCFG_FD1771_ADD("fdc", wd1771_intf) |
| 620 | 620 | MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(mycom_floppy_interface) |
| 621 | 621 | |
| 622 | | MCFG_TIMER_ADD_PERIODIC("keyboard_timer", mycom_kbd, attotime::from_hz(20)) |
| 622 | MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", mycom_state, mycom_kbd, attotime::from_hz(20)) |
| 623 | 623 | MACHINE_CONFIG_END |
| 624 | 624 | |
| 625 | 625 | /* ROM definition */ |
trunk/src/mess/drivers/mk2.c
| r18138 | r18139 | |
| 73 | 73 | DECLARE_WRITE8_MEMBER(mk2_write_b); |
| 74 | 74 | UINT8 m_led[5]; |
| 75 | 75 | virtual void machine_start(); |
| 76 | TIMER_DEVICE_CALLBACK_MEMBER(update_leds); |
| 76 | 77 | }; |
| 77 | 78 | |
| 78 | 79 | |
| r18138 | r18139 | |
| 112 | 113 | INPUT_PORTS_END |
| 113 | 114 | |
| 114 | 115 | |
| 115 | | static TIMER_DEVICE_CALLBACK( update_leds ) |
| 116 | TIMER_DEVICE_CALLBACK_MEMBER(mk2_state::update_leds) |
| 116 | 117 | { |
| 117 | | mk2_state *state = timer.machine().driver_data<mk2_state>(); |
| 118 | 118 | int i; |
| 119 | 119 | |
| 120 | 120 | for (i=0; i<4; i++) |
| 121 | | output_set_digit_value(i, state->m_led[i]); |
| 121 | output_set_digit_value(i, m_led[i]); |
| 122 | 122 | |
| 123 | | output_set_led_value(0, BIT(state->m_led[4], 3)); |
| 124 | | output_set_led_value(1, BIT(state->m_led[4], 5)); |
| 125 | | output_set_led_value(2, BIT(state->m_led[4], 4)); |
| 126 | | output_set_led_value(3, BIT(state->m_led[4], 4) ? 0 : 1); |
| 123 | output_set_led_value(0, BIT(m_led[4], 3)); |
| 124 | output_set_led_value(1, BIT(m_led[4], 5)); |
| 125 | output_set_led_value(2, BIT(m_led[4], 4)); |
| 126 | output_set_led_value(3, BIT(m_led[4], 4) ? 0 : 1); |
| 127 | 127 | |
| 128 | | state->m_led[0]= state->m_led[1]= state->m_led[2]= state->m_led[3]= state->m_led[4]= 0; |
| 128 | m_led[0]= m_led[1]= m_led[2]= m_led[3]= m_led[4]= 0; |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | void mk2_state::machine_start() |
| r18138 | r18139 | |
| 207 | 207 | MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0) |
| 208 | 208 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 209 | 209 | |
| 210 | | MCFG_TIMER_ADD_PERIODIC("led_timer", update_leds, attotime::from_hz(60)) |
| 210 | MCFG_TIMER_DRIVER_ADD_PERIODIC("led_timer", mk2_state, update_leds, attotime::from_hz(60)) |
| 211 | 211 | MACHINE_CONFIG_END |
| 212 | 212 | |
| 213 | 213 | |
trunk/src/mess/drivers/pce220.c
| r18138 | r18139 | |
| 94 | 94 | DECLARE_PALETTE_INIT(pce220); |
| 95 | 95 | DECLARE_INPUT_CHANGED_MEMBER(kb_irq); |
| 96 | 96 | DECLARE_INPUT_CHANGED_MEMBER(on_irq); |
| 97 | TIMER_DEVICE_CALLBACK_MEMBER(pce220_timer_callback); |
| 97 | 98 | }; |
| 98 | 99 | |
| 99 | 100 | class pcg850v_state : public pce220_state |
| r18138 | r18139 | |
| 900 | 901 | m_lcd_read_mode = 0; |
| 901 | 902 | } |
| 902 | 903 | |
| 903 | | static TIMER_DEVICE_CALLBACK(pce220_timer_callback) |
| 904 | TIMER_DEVICE_CALLBACK_MEMBER(pce220_state::pce220_timer_callback) |
| 904 | 905 | { |
| 905 | | pce220_state *state = timer.machine().driver_data<pce220_state>(); |
| 906 | 906 | |
| 907 | | state->m_timer_status = !state->m_timer_status; |
| 907 | m_timer_status = !m_timer_status; |
| 908 | 908 | |
| 909 | | if (state->m_irq_mask & IRQ_FLAG_TIMER) |
| 909 | if (m_irq_mask & IRQ_FLAG_TIMER) |
| 910 | 910 | { |
| 911 | | state->m_maincpu->set_input_line(0, HOLD_LINE ); |
| 911 | m_maincpu->set_input_line(0, HOLD_LINE ); |
| 912 | 912 | |
| 913 | | state->m_irq_flag = (state->m_irq_flag & 0xfb) | (state->m_timer_status<<2); |
| 913 | m_irq_flag = (m_irq_flag & 0xfb) | (m_timer_status<<2); |
| 914 | 914 | } |
| 915 | 915 | } |
| 916 | 916 | |
| r18138 | r18139 | |
| 945 | 945 | MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0) |
| 946 | 946 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 947 | 947 | |
| 948 | | MCFG_TIMER_ADD_PERIODIC("pce220_timer", pce220_timer_callback, attotime::from_msec(468)) |
| 948 | MCFG_TIMER_DRIVER_ADD_PERIODIC("pce220_timer", pce220_state, pce220_timer_callback, attotime::from_msec(468)) |
| 949 | 949 | |
| 950 | 950 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 951 | 951 | |
| r18138 | r18139 | |
| 980 | 980 | MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0) |
| 981 | 981 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 982 | 982 | |
| 983 | | MCFG_TIMER_ADD_PERIODIC("pce220_timer", pce220_timer_callback, attotime::from_msec(468)) |
| 983 | MCFG_TIMER_DRIVER_ADD_PERIODIC("pce220_timer", pce220_state, pce220_timer_callback, attotime::from_msec(468)) |
| 984 | 984 | |
| 985 | 985 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 986 | 986 | |
trunk/src/mess/drivers/fk1.c
| r18138 | r18139 | |
| 52 | 52 | UINT8 m_int_vector; |
| 53 | 53 | virtual void machine_reset(); |
| 54 | 54 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 55 | TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback); |
| 56 | TIMER_DEVICE_CALLBACK_MEMBER(vsync_callback); |
| 55 | 57 | }; |
| 56 | 58 | |
| 57 | 59 | |
| r18138 | r18139 | |
| 382 | 384 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') |
| 383 | 385 | INPUT_PORTS_END |
| 384 | 386 | |
| 385 | | static TIMER_DEVICE_CALLBACK(keyboard_callback) |
| 387 | TIMER_DEVICE_CALLBACK_MEMBER(fk1_state::keyboard_callback) |
| 386 | 388 | { |
| 387 | | fk1_state *state = timer.machine().driver_data<fk1_state>(); |
| 388 | 389 | |
| 389 | | if (timer.machine().root_device().ioport("LINE0")->read()) |
| 390 | if (machine().root_device().ioport("LINE0")->read()) |
| 390 | 391 | { |
| 391 | | state->m_int_vector = 6; |
| 392 | | timer.machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE); |
| 392 | m_int_vector = 6; |
| 393 | machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE); |
| 393 | 394 | } |
| 394 | 395 | } |
| 395 | 396 | |
| r18138 | r18139 | |
| 412 | 413 | return state->m_int_vector * 2; |
| 413 | 414 | } |
| 414 | 415 | |
| 415 | | static TIMER_DEVICE_CALLBACK( vsync_callback ) |
| 416 | TIMER_DEVICE_CALLBACK_MEMBER(fk1_state::vsync_callback) |
| 416 | 417 | { |
| 417 | | fk1_state *state = timer.machine().driver_data<fk1_state>(); |
| 418 | 418 | |
| 419 | | state->m_int_vector = 3; |
| 420 | | timer.machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE); |
| 419 | m_int_vector = 3; |
| 420 | machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE); |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | |
| r18138 | r18139 | |
| 482 | 482 | MCFG_RAM_ADD(RAM_TAG) |
| 483 | 483 | MCFG_RAM_DEFAULT_SIZE("80K") // 64 + 16 |
| 484 | 484 | |
| 485 | | MCFG_TIMER_ADD_PERIODIC("keyboard_timer", keyboard_callback, attotime::from_hz(24000)) |
| 486 | | MCFG_TIMER_ADD_PERIODIC("vsync_timer", vsync_callback, attotime::from_hz(50)) |
| 485 | MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", fk1_state, keyboard_callback, attotime::from_hz(24000)) |
| 486 | MCFG_TIMER_DRIVER_ADD_PERIODIC("vsync_timer", fk1_state, vsync_callback, attotime::from_hz(50)) |
| 487 | 487 | MACHINE_CONFIG_END |
| 488 | 488 | |
| 489 | 489 | /* ROM definition */ |
trunk/src/mess/drivers/glasgow.c
| r18138 | r18139 | |
| 85 | 85 | virtual void machine_start(); |
| 86 | 86 | virtual void machine_reset(); |
| 87 | 87 | DECLARE_MACHINE_START(dallas32); |
| 88 | TIMER_DEVICE_CALLBACK_MEMBER(update_nmi); |
| 89 | TIMER_DEVICE_CALLBACK_MEMBER(update_nmi32); |
| 88 | 90 | }; |
| 89 | 91 | |
| 90 | 92 | |
| r18138 | r18139 | |
| 273 | 275 | m_beeper = data; |
| 274 | 276 | } |
| 275 | 277 | |
| 276 | | static TIMER_DEVICE_CALLBACK( update_nmi ) |
| 278 | TIMER_DEVICE_CALLBACK_MEMBER(glasgow_state::update_nmi) |
| 277 | 279 | { |
| 278 | | timer.machine().device("maincpu")->execute().set_input_line(7, HOLD_LINE); |
| 280 | machine().device("maincpu")->execute().set_input_line(7, HOLD_LINE); |
| 279 | 281 | } |
| 280 | 282 | |
| 281 | | static TIMER_DEVICE_CALLBACK( update_nmi32 ) |
| 283 | TIMER_DEVICE_CALLBACK_MEMBER(glasgow_state::update_nmi32) |
| 282 | 284 | { |
| 283 | | timer.machine().device("maincpu")->execute().set_input_line(6, HOLD_LINE); |
| 285 | machine().device("maincpu")->execute().set_input_line(6, HOLD_LINE); |
| 284 | 286 | } |
| 285 | 287 | |
| 286 | 288 | void glasgow_state::machine_start() |
| r18138 | r18139 | |
| 514 | 516 | MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0) |
| 515 | 517 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 516 | 518 | |
| 517 | | MCFG_TIMER_ADD_PERIODIC("nmi_timer", update_nmi, attotime::from_hz(50)) |
| 519 | MCFG_TIMER_DRIVER_ADD_PERIODIC("nmi_timer", glasgow_state, update_nmi, attotime::from_hz(50)) |
| 518 | 520 | MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100)) |
| 519 | 521 | MACHINE_CONFIG_END |
| 520 | 522 | |
| r18138 | r18139 | |
| 531 | 533 | MCFG_MACHINE_START_OVERRIDE(glasgow_state, dallas32 ) |
| 532 | 534 | |
| 533 | 535 | MCFG_DEVICE_REMOVE("nmi_timer") |
| 534 | | MCFG_TIMER_ADD_PERIODIC("nmi_timer", update_nmi32, attotime::from_hz(50)) |
| 536 | MCFG_TIMER_DRIVER_ADD_PERIODIC("nmi_timer", glasgow_state, update_nmi32, attotime::from_hz(50)) |
| 535 | 537 | |
| 536 | 538 | MACHINE_CONFIG_END |
| 537 | 539 | |