trunk/src/mame/drivers/mappy.c
| r22832 | r22833 | |
| 747 | 747 | |
| 748 | 748 | /* different games need different interrupt generators & timers because they use different Namco I/O devices */ |
| 749 | 749 | |
| 750 | void mappy_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 751 | { |
| 752 | switch (id) |
| 753 | { |
| 754 | case TIMER_SUPERPAC_IO_RUN: |
| 755 | superpac_io_run(ptr, param); |
| 756 | break; |
| 757 | case TIMER_PACNPAL_IO_RUN: |
| 758 | pacnpal_io_run(ptr, param); |
| 759 | break; |
| 760 | case TIMER_PHOZON_IO_RUN: |
| 761 | phozon_io_run(ptr, param); |
| 762 | break; |
| 763 | case TIMER_MAPPY_IO_RUN: |
| 764 | mappy_io_run(ptr, param); |
| 765 | break; |
| 766 | default: |
| 767 | assert_always(FALSE, "Unknown id in mappy_state::device_timer"); |
| 768 | } |
| 769 | } |
| 770 | |
| 750 | 771 | TIMER_CALLBACK_MEMBER(mappy_state::superpac_io_run) |
| 751 | 772 | { |
| 752 | 773 | device_t *io56xx_1 = machine().device("namcoio_1"); |
| r22832 | r22833 | |
| 772 | 793 | m_maincpu->set_input_line(0, ASSERT_LINE); |
| 773 | 794 | |
| 774 | 795 | if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 775 | | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(mappy_state::superpac_io_run),this)); |
| 796 | timer_set(attotime::from_usec(50), TIMER_SUPERPAC_IO_RUN); |
| 776 | 797 | |
| 777 | 798 | if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 778 | | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(mappy_state::superpac_io_run),this), 1); |
| 799 | timer_set(attotime::from_usec(50), TIMER_SUPERPAC_IO_RUN, 1); |
| 779 | 800 | } |
| 780 | 801 | |
| 781 | 802 | TIMER_CALLBACK_MEMBER(mappy_state::pacnpal_io_run) |
| r22832 | r22833 | |
| 803 | 824 | m_maincpu->set_input_line(0, ASSERT_LINE); |
| 804 | 825 | |
| 805 | 826 | if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 806 | | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(mappy_state::pacnpal_io_run),this)); |
| 827 | timer_set(attotime::from_usec(50), TIMER_PACNPAL_IO_RUN); |
| 807 | 828 | |
| 808 | 829 | if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 809 | | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(mappy_state::pacnpal_io_run),this), 1); |
| 830 | timer_set(attotime::from_usec(50), TIMER_PACNPAL_IO_RUN, 1); |
| 810 | 831 | } |
| 811 | 832 | |
| 812 | 833 | TIMER_CALLBACK_MEMBER(mappy_state::phozon_io_run) |
| r22832 | r22833 | |
| 834 | 855 | m_maincpu->set_input_line(0, ASSERT_LINE); |
| 835 | 856 | |
| 836 | 857 | if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 837 | | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(mappy_state::phozon_io_run),this)); |
| 858 | timer_set(attotime::from_usec(50), TIMER_PHOZON_IO_RUN); |
| 838 | 859 | |
| 839 | 860 | if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 840 | | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(mappy_state::phozon_io_run),this), 1); |
| 861 | timer_set(attotime::from_usec(50), TIMER_PHOZON_IO_RUN, 1); |
| 841 | 862 | } |
| 842 | 863 | |
| 843 | 864 | TIMER_CALLBACK_MEMBER(mappy_state::mappy_io_run) |
| r22832 | r22833 | |
| 865 | 886 | m_maincpu->set_input_line(0, ASSERT_LINE); |
| 866 | 887 | |
| 867 | 888 | if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 868 | | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(mappy_state::mappy_io_run),this)); |
| 889 | timer_set(attotime::from_usec(50), TIMER_MAPPY_IO_RUN); |
| 869 | 890 | |
| 870 | 891 | if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 871 | | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(mappy_state::mappy_io_run),this), 1); |
| 892 | timer_set(attotime::from_usec(50), TIMER_MAPPY_IO_RUN, 1); |
| 872 | 893 | } |
| 873 | 894 | |
| 874 | 895 | INTERRUPT_GEN_MEMBER(mappy_state::sub_vblank_irq) |
trunk/src/mame/drivers/esh.c
| r22832 | r22833 | |
| 31 | 31 | class esh_state : public driver_device |
| 32 | 32 | { |
| 33 | 33 | public: |
| 34 | enum |
| 35 | { |
| 36 | TIMER_IRQ_STOP |
| 37 | }; |
| 38 | |
| 34 | 39 | esh_state(const machine_config &mconfig, device_type type, const char *tag) |
| 35 | 40 | : driver_device(mconfig, type, tag), |
| 36 | 41 | m_laserdisc(*this, "laserdisc") , |
| r22832 | r22833 | |
| 52 | 57 | virtual void palette_init(); |
| 53 | 58 | UINT32 screen_update_esh(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 54 | 59 | INTERRUPT_GEN_MEMBER(vblank_callback_esh); |
| 55 | | TIMER_CALLBACK_MEMBER(irq_stop); |
| 56 | 60 | required_device<cpu_device> m_maincpu; |
| 61 | |
| 62 | protected: |
| 63 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 57 | 64 | }; |
| 58 | 65 | |
| 59 | 66 | |
| r22832 | r22833 | |
| 282 | 289 | GFXDECODE_ENTRY("gfx1", 0, esh_gfx_layout, 0x0, 0x20) |
| 283 | 290 | GFXDECODE_END |
| 284 | 291 | |
| 285 | | TIMER_CALLBACK_MEMBER(esh_state::irq_stop) |
| 292 | void esh_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 286 | 293 | { |
| 287 | | m_maincpu->set_input_line(0, CLEAR_LINE); |
| 294 | switch (id) |
| 295 | { |
| 296 | case TIMER_IRQ_STOP: |
| 297 | m_maincpu->set_input_line(0, CLEAR_LINE); |
| 298 | break; |
| 299 | default: |
| 300 | assert_always(FALSE, "Unknown id in esh_state::device_timer"); |
| 301 | } |
| 288 | 302 | } |
| 289 | 303 | |
| 290 | 304 | INTERRUPT_GEN_MEMBER(esh_state::vblank_callback_esh) |
| 291 | 305 | { |
| 292 | 306 | // IRQ |
| 293 | 307 | device.execute().set_input_line(0, ASSERT_LINE); |
| 294 | | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(esh_state::irq_stop),this)); |
| 308 | timer_set(attotime::from_usec(50), TIMER_IRQ_STOP); |
| 295 | 309 | } |
| 296 | 310 | |
| 297 | 311 | void esh_state::machine_start() |
trunk/src/mame/drivers/asterix.c
| r22832 | r22833 | |
| 66 | 66 | return m_k053260->k053260_r(space, 2 + offset); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | | TIMER_CALLBACK_MEMBER(asterix_state::nmi_callback) |
| 69 | void asterix_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 70 | 70 | { |
| 71 | | m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); |
| 71 | switch (id) |
| 72 | { |
| 73 | case TIMER_NMI: |
| 74 | m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); |
| 75 | break; |
| 76 | default: |
| 77 | assert_always(FALSE, "Unknown id in asterix_state::device_timer"); |
| 78 | } |
| 72 | 79 | } |
| 73 | 80 | |
| 74 | 81 | WRITE8_MEMBER(asterix_state::sound_arm_nmi_w) |
| 75 | 82 | { |
| 76 | 83 | m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); |
| 77 | | machine().scheduler().timer_set(attotime::from_usec(5), timer_expired_delegate(FUNC(asterix_state::nmi_callback),this)); |
| 84 | timer_set(attotime::from_usec(5), TIMER_NMI); |
| 78 | 85 | } |
| 79 | 86 | |
| 80 | 87 | WRITE16_MEMBER(asterix_state::sound_irq_w) |
trunk/src/mame/drivers/toaplan2.c
| r22832 | r22833 | |
| 473 | 473 | Toaplan games |
| 474 | 474 | ***************************************************************************/ |
| 475 | 475 | |
| 476 | | |
| 477 | | TIMER_CALLBACK_MEMBER(toaplan2_state::toaplan2_raise_irq) |
| 476 | void toaplan2_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 478 | 477 | { |
| 479 | | m_maincpu->set_input_line(param, HOLD_LINE); |
| 478 | switch (id) |
| 479 | { |
| 480 | case TIMER_RAISE_IRQ: |
| 481 | m_maincpu->set_input_line(param, HOLD_LINE); |
| 482 | break; |
| 483 | default: |
| 484 | assert_always(FALSE, "Unknown id in toaplan2_state::device_timer"); |
| 485 | } |
| 480 | 486 | } |
| 481 | 487 | |
| 482 | 488 | void toaplan2_state::toaplan2_vblank_irq(int irq_line) |
| 483 | 489 | { |
| 484 | 490 | // the IRQ appears to fire at line 0xe6 |
| 485 | | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0xe6), timer_expired_delegate(FUNC(toaplan2_state::toaplan2_raise_irq),this), irq_line); |
| 491 | timer_set(machine().primary_screen->time_until_pos(0xe6), TIMER_RAISE_IRQ, irq_line); |
| 486 | 492 | } |
| 487 | 493 | |
| 488 | 494 | INTERRUPT_GEN_MEMBER(toaplan2_state::toaplan2_vblank_irq1){ toaplan2_vblank_irq(1); } |
trunk/src/mame/drivers/cball.c
| r22832 | r22833 | |
| 11 | 11 | class cball_state : public driver_device |
| 12 | 12 | { |
| 13 | 13 | public: |
| 14 | enum |
| 15 | { |
| 16 | TIMER_INTERRUPT |
| 17 | }; |
| 18 | |
| 14 | 19 | cball_state(const machine_config &mconfig, device_type type, const char *tag) |
| 15 | 20 | : driver_device(mconfig, type, tag), |
| 16 | 21 | m_video_ram(*this, "video_ram"), |
| r22832 | r22833 | |
| 35 | 40 | virtual void palette_init(); |
| 36 | 41 | UINT32 screen_update_cball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 37 | 42 | TIMER_CALLBACK_MEMBER(interrupt_callback); |
| 43 | |
| 44 | protected: |
| 45 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 38 | 46 | }; |
| 39 | 47 | |
| 40 | 48 | |
| r22832 | r22833 | |
| 75 | 83 | } |
| 76 | 84 | |
| 77 | 85 | |
| 86 | void cball_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 87 | { |
| 88 | switch (id) |
| 89 | { |
| 90 | case TIMER_INTERRUPT: |
| 91 | interrupt_callback(ptr, param); |
| 92 | break; |
| 93 | default: |
| 94 | assert_always(FALSE, "Unknown id in cball_state::device_timer"); |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | |
| 78 | 99 | TIMER_CALLBACK_MEMBER(cball_state::interrupt_callback) |
| 79 | 100 | { |
| 80 | 101 | int scanline = param; |
| r22832 | r22833 | |
| 86 | 107 | if (scanline >= 262) |
| 87 | 108 | scanline = 16; |
| 88 | 109 | |
| 89 | | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(cball_state::interrupt_callback),this), scanline); |
| 110 | timer_set(machine().primary_screen->time_until_pos(scanline), TIMER_INTERRUPT, scanline); |
| 90 | 111 | } |
| 91 | 112 | |
| 92 | 113 | |
| r22832 | r22833 | |
| 96 | 117 | |
| 97 | 118 | void cball_state::machine_reset() |
| 98 | 119 | { |
| 99 | | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(16), timer_expired_delegate(FUNC(cball_state::interrupt_callback),this), 16); |
| 120 | timer_set(machine().primary_screen->time_until_pos(16), TIMER_INTERRUPT, 16); |
| 100 | 121 | } |
| 101 | 122 | |
| 102 | 123 | |
trunk/src/mame/drivers/fgoal.c
| r22832 | r22833 | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
| 72 | void fgoal_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 73 | { |
| 74 | switch (id) |
| 75 | { |
| 76 | case TIMER_INTERRUPT: |
| 77 | interrupt_callback(ptr, param); |
| 78 | break; |
| 79 | default: |
| 80 | assert_always(FALSE, "Unknown id in fgoal_state::device_timer"); |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | |
| 72 | 85 | TIMER_CALLBACK_MEMBER(fgoal_state::interrupt_callback) |
| 73 | 86 | { |
| 74 | 87 | int scanline; |
| r22832 | r22833 | |
| 86 | 99 | if (scanline > 256) |
| 87 | 100 | scanline = 0; |
| 88 | 101 | |
| 89 | | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(fgoal_state::interrupt_callback),this)); |
| 102 | timer_set(machine().primary_screen->time_until_pos(scanline), TIMER_INTERRUPT); |
| 90 | 103 | } |
| 91 | 104 | |
| 92 | 105 | |
| r22832 | r22833 | |
| 339 | 352 | |
| 340 | 353 | void fgoal_state::machine_reset() |
| 341 | 354 | { |
| 342 | | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(fgoal_state::interrupt_callback),this)); |
| 355 | timer_set(machine().primary_screen->time_until_pos(0), TIMER_INTERRUPT); |
| 343 | 356 | |
| 344 | 357 | m_xpos = 0; |
| 345 | 358 | m_ypos = 0; |
trunk/src/mame/drivers/megatech.c
| r22832 | r22833 | |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | |
| 216 | void mtech_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 217 | { |
| 218 | switch (id) |
| 219 | { |
| 220 | case TIMER_Z80_RUN_STATE: |
| 221 | megatech_z80_run_state(ptr, param); |
| 222 | break; |
| 223 | case TIMER_Z80_STOP_STATE: |
| 224 | megatech_z80_stop_state(ptr, param); |
| 225 | break; |
| 226 | default: |
| 227 | assert_always(FALSE, "Unknown id in mtech_state::device_timer"); |
| 228 | } |
| 229 | } |
| 216 | 230 | |
| 231 | |
| 217 | 232 | TIMER_CALLBACK_MEMBER(mtech_state::megatech_z80_run_state ) |
| 218 | 233 | { |
| 219 | 234 | char tempname[20]; |
| r22832 | r22833 | |
| 266 | 281 | if (game_region) |
| 267 | 282 | { |
| 268 | 283 | { |
| 269 | | machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(mtech_state::megatech_z80_run_state),this), param); |
| 284 | timer_set(attotime::zero, TIMER_Z80_RUN_STATE, param); |
| 270 | 285 | } |
| 271 | 286 | } |
| 272 | 287 | else |
| r22832 | r22833 | |
| 281 | 296 | |
| 282 | 297 | void mtech_state::megatech_select_game(int gameno) |
| 283 | 298 | { |
| 284 | | machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(mtech_state::megatech_z80_stop_state),this), gameno); |
| 299 | timer_set(attotime::zero, TIMER_Z80_STOP_STATE, gameno); |
| 285 | 300 | } |
| 286 | 301 | |
| 287 | 302 | WRITE8_MEMBER(mtech_state::megatech_cart_select_w ) |
trunk/src/mame/drivers/gticlub.c
| r22832 | r22833 | |
| 238 | 238 | class gticlub_state : public driver_device |
| 239 | 239 | { |
| 240 | 240 | public: |
| 241 | enum |
| 242 | { |
| 243 | TIMER_IRQ_OFF |
| 244 | }; |
| 245 | |
| 241 | 246 | gticlub_state(const machine_config &mconfig, device_type type, const char *tag) |
| 242 | 247 | : driver_device(mconfig, type, tag), |
| 243 | 248 | m_work_ram(*this, "work_ram"), |
| r22832 | r22833 | |
| 273 | 278 | DECLARE_MACHINE_RESET(gticlub); |
| 274 | 279 | DECLARE_MACHINE_RESET(hangplt); |
| 275 | 280 | INTERRUPT_GEN_MEMBER(gticlub_vblank); |
| 276 | | TIMER_CALLBACK_MEMBER(irq_off); |
| 277 | 281 | required_device<cpu_device> m_maincpu; |
| 278 | 282 | required_device<cpu_device> m_audiocpu; |
| 279 | 283 | required_device<cpu_device> m_dsp; |
| 280 | 284 | optional_device<cpu_device> m_dsp2; |
| 281 | 285 | required_device<eeprom_device> m_eeprom; |
| 286 | |
| 287 | protected: |
| 288 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 282 | 289 | }; |
| 283 | 290 | |
| 284 | 291 | |
| r22832 | r22833 | |
| 718 | 725 | }; |
| 719 | 726 | |
| 720 | 727 | |
| 721 | | TIMER_CALLBACK_MEMBER(gticlub_state::irq_off) |
| 728 | void gticlub_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 722 | 729 | { |
| 723 | | m_audiocpu->set_input_line(param, CLEAR_LINE); |
| 730 | switch (id) |
| 731 | { |
| 732 | case TIMER_IRQ_OFF: |
| 733 | m_audiocpu->set_input_line(param, CLEAR_LINE); |
| 734 | break; |
| 735 | default: |
| 736 | assert_always(FALSE, "Unknown id in gticlub_state::device_timer"); |
| 737 | } |
| 724 | 738 | } |
| 725 | 739 | |
| 726 | 740 | static void sound_irq_callback( running_machine &machine, int irq ) |
| r22832 | r22833 | |
| 729 | 743 | int line = (irq == 0) ? INPUT_LINE_IRQ1 : INPUT_LINE_IRQ2; |
| 730 | 744 | |
| 731 | 745 | state->m_audiocpu->set_input_line(line, ASSERT_LINE); |
| 732 | | machine.scheduler().timer_set(attotime::from_usec(5), timer_expired_delegate(FUNC(gticlub_state::irq_off),state), line); |
| 746 | state->timer_set(attotime::from_usec(5), gticlub_state::TIMER_IRQ_OFF, line); |
| 733 | 747 | } |
| 734 | 748 | |
| 735 | 749 | static const k056800_interface gticlub_k056800_interface = |
trunk/src/mame/drivers/thunderx.c
| r22832 | r22833 | |
| 31 | 31 | device.execute().set_input_line(KONAMI_IRQ_LINE, HOLD_LINE); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | | TIMER_CALLBACK_MEMBER(thunderx_state::thunderx_firq_callback) |
| 34 | void thunderx_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 35 | 35 | { |
| 36 | | m_maincpu->set_input_line(KONAMI_FIRQ_LINE, HOLD_LINE); |
| 36 | switch (id) |
| 37 | { |
| 38 | case TIMER_THUNDERX_FIRQ: |
| 39 | m_maincpu->set_input_line(KONAMI_FIRQ_LINE, HOLD_LINE); |
| 40 | break; |
| 41 | default: |
| 42 | assert_always(FALSE, "Unknown id in thunderx_state::device_timer"); |
| 43 | } |
| 37 | 44 | } |
| 38 | 45 | |
| 39 | 46 | READ8_MEMBER(thunderx_state::scontra_bankedram_r) |
| r22832 | r22833 | |
| 301 | 308 | calculate_collisions(); |
| 302 | 309 | |
| 303 | 310 | /* 100 cycle delay is arbitrary */ |
| 304 | | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(100), timer_expired_delegate(FUNC(thunderx_state::thunderx_firq_callback),this)); |
| 311 | timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(100), TIMER_THUNDERX_FIRQ); |
| 305 | 312 | } |
| 306 | 313 | |
| 307 | 314 | m_1f98_data = data; |
trunk/src/mame/drivers/astinvad.c
| r22832 | r22833 | |
| 44 | 44 | class astinvad_state : public driver_device |
| 45 | 45 | { |
| 46 | 46 | public: |
| 47 | enum |
| 48 | { |
| 49 | TIMER_INT_OFF, |
| 50 | TIMER_INT_GEN |
| 51 | }; |
| 52 | |
| 47 | 53 | astinvad_state(const machine_config &mconfig, device_type type, const char *tag) |
| 48 | 54 | : driver_device(mconfig, type, tag), |
| 49 | 55 | m_maincpu(*this, "maincpu"), |
| r22832 | r22833 | |
| 87 | 93 | TIMER_CALLBACK_MEMBER(kamikaze_int_off); |
| 88 | 94 | TIMER_CALLBACK_MEMBER(kamizake_int_gen); |
| 89 | 95 | void plot_byte( bitmap_rgb32 &bitmap, UINT8 y, UINT8 x, UINT8 data, UINT8 color ); |
| 96 | |
| 97 | protected: |
| 98 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 90 | 99 | }; |
| 91 | 100 | |
| 92 | 101 | |
| r22832 | r22833 | |
| 231 | 240 | * |
| 232 | 241 | *************************************/ |
| 233 | 242 | |
| 243 | void astinvad_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 244 | { |
| 245 | switch (id) |
| 246 | { |
| 247 | case TIMER_INT_OFF: |
| 248 | kamikaze_int_off(ptr, param); |
| 249 | break; |
| 250 | case TIMER_INT_GEN: |
| 251 | kamizake_int_gen(ptr, param); |
| 252 | break; |
| 253 | default: |
| 254 | assert_always(FALSE, "Unknown id in astinvad_state::device_timer"); |
| 255 | } |
| 256 | } |
| 257 | |
| 258 | |
| 234 | 259 | TIMER_CALLBACK_MEMBER(astinvad_state::kamikaze_int_off) |
| 235 | 260 | { |
| 236 | 261 | m_maincpu->set_input_line(0, CLEAR_LINE); |
| r22832 | r22833 | |
| 245 | 270 | m_int_timer->adjust(machine().primary_screen->time_until_pos(param), param); |
| 246 | 271 | |
| 247 | 272 | /* an RC circuit turns the interrupt off after a short amount of time */ |
| 248 | | machine().scheduler().timer_set(attotime::from_double(300 * 0.1e-6), timer_expired_delegate(FUNC(astinvad_state::kamikaze_int_off),this)); |
| 273 | timer_set(attotime::from_double(300 * 0.1e-6), TIMER_INT_OFF); |
| 249 | 274 | } |
| 250 | 275 | |
| 251 | 276 | |
| 252 | 277 | MACHINE_START_MEMBER(astinvad_state,kamikaze) |
| 253 | 278 | { |
| 254 | | m_int_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(astinvad_state::kamizake_int_gen),this)); |
| 279 | m_int_timer = timer_alloc(TIMER_INT_GEN); |
| 255 | 280 | m_int_timer->adjust(machine().primary_screen->time_until_pos(128), 128); |
| 256 | 281 | |
| 257 | 282 | save_item(NAME(m_screen_flip)); |
trunk/src/mame/drivers/taito_f2.c
| r22832 | r22833 | |
| 572 | 572 | |
| 573 | 573 | ******************************************************************/ |
| 574 | 574 | |
| 575 | | TIMER_CALLBACK_MEMBER(taitof2_state::taitof2_interrupt6) |
| 575 | void taitof2_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 576 | 576 | { |
| 577 | | m_maincpu->set_input_line(6, HOLD_LINE); |
| 577 | switch (id) |
| 578 | { |
| 579 | case TIMER_TAITOF2_INTERRUPT6: |
| 580 | m_maincpu->set_input_line(6, HOLD_LINE); |
| 581 | break; |
| 582 | default: |
| 583 | assert_always(FALSE, "Unknown id in taitof2_state::device_timer"); |
| 584 | } |
| 578 | 585 | } |
| 579 | 586 | |
| 580 | 587 | INTERRUPT_GEN_MEMBER(taitof2_state::taitof2_interrupt) |
| 581 | 588 | { |
| 582 | | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(500), timer_expired_delegate(FUNC(taitof2_state::taitof2_interrupt6),this)); |
| 589 | timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(500), TIMER_TAITOF2_INTERRUPT6); |
| 583 | 590 | device.execute().set_input_line(5, HOLD_LINE); |
| 584 | 591 | } |
| 585 | 592 | |
trunk/src/mame/drivers/destroyr.c
| r22832 | r22833 | |
| 18 | 18 | class destroyr_state : public driver_device |
| 19 | 19 | { |
| 20 | 20 | public: |
| 21 | enum |
| 22 | { |
| 23 | TIMER_DESTROYR_DIAL, |
| 24 | TIMER_DESTROYR_FRAME |
| 25 | }; |
| 26 | |
| 21 | 27 | destroyr_state(const machine_config &mconfig, device_type type, const char *tag) |
| 22 | 28 | : driver_device(mconfig, type, tag), |
| 23 | 29 | m_alpha_num_ram(*this, "alpha_nuram"), |
| r22832 | r22833 | |
| 55 | 61 | UINT32 screen_update_destroyr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 56 | 62 | TIMER_CALLBACK_MEMBER(destroyr_dial_callback); |
| 57 | 63 | TIMER_CALLBACK_MEMBER(destroyr_frame_callback); |
| 64 | |
| 65 | protected: |
| 66 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 58 | 67 | }; |
| 59 | 68 | |
| 60 | 69 | |
| r22832 | r22833 | |
| 124 | 133 | return 0; |
| 125 | 134 | } |
| 126 | 135 | |
| 136 | |
| 137 | void destroyr_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 138 | { |
| 139 | switch (id) |
| 140 | { |
| 141 | case TIMER_DESTROYR_DIAL: |
| 142 | destroyr_dial_callback(ptr, param); |
| 143 | break; |
| 144 | case TIMER_DESTROYR_FRAME: |
| 145 | destroyr_frame_callback(ptr, param); |
| 146 | break; |
| 147 | default: |
| 148 | assert_always(FALSE, "Unknown id in destroyr_state::device_timer"); |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | |
| 127 | 153 | TIMER_CALLBACK_MEMBER(destroyr_state::destroyr_dial_callback) |
| 128 | 154 | { |
| 129 | 155 | int dial = param; |
| r22832 | r22833 | |
| 150 | 176 | m_potsense[1] = 0; |
| 151 | 177 | |
| 152 | 178 | /* PCB supports two dials, but cab has only got one */ |
| 153 | | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(ioport("PADDLE")->read()), timer_expired_delegate(FUNC(destroyr_state::destroyr_dial_callback),this)); |
| 154 | | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(destroyr_state::destroyr_frame_callback),this)); |
| 179 | timer_set(machine().primary_screen->time_until_pos(ioport("PADDLE")->read()), TIMER_DESTROYR_DIAL); |
| 180 | timer_set(machine().primary_screen->time_until_pos(0), TIMER_DESTROYR_FRAME); |
| 155 | 181 | } |
| 156 | 182 | |
| 157 | 183 | |
| 158 | 184 | void destroyr_state::machine_reset() |
| 159 | 185 | { |
| 160 | | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(destroyr_state::destroyr_frame_callback),this)); |
| 186 | timer_set(machine().primary_screen->time_until_pos(0), TIMER_DESTROYR_FRAME); |
| 161 | 187 | |
| 162 | 188 | m_cursor = 0; |
| 163 | 189 | m_wavemod = 0; |
trunk/src/mame/drivers/flyball.c
| r22832 | r22833 | |
| 21 | 21 | class flyball_state : public driver_device |
| 22 | 22 | { |
| 23 | 23 | public: |
| 24 | enum |
| 25 | { |
| 26 | TIMER_FLYBALL_JOYSTICK, |
| 27 | TIMER_FLYBALL_QUARTER |
| 28 | }; |
| 29 | |
| 24 | 30 | flyball_state(const machine_config &mconfig, device_type type, const char *tag) |
| 25 | 31 | : driver_device(mconfig, type, tag), |
| 26 | 32 | m_playfield_ram(*this, "playfield_ram"), |
| r22832 | r22833 | |
| 64 | 70 | UINT32 screen_update_flyball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 65 | 71 | TIMER_CALLBACK_MEMBER(flyball_joystick_callback); |
| 66 | 72 | TIMER_CALLBACK_MEMBER(flyball_quarter_callback); |
| 73 | |
| 74 | protected: |
| 75 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 67 | 76 | }; |
| 68 | 77 | |
| 69 | 78 | |
| r22832 | r22833 | |
| 132 | 141 | } |
| 133 | 142 | |
| 134 | 143 | |
| 144 | void flyball_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 145 | { |
| 146 | switch (id) |
| 147 | { |
| 148 | case TIMER_FLYBALL_JOYSTICK: |
| 149 | flyball_joystick_callback(ptr, param); |
| 150 | break; |
| 151 | case TIMER_FLYBALL_QUARTER: |
| 152 | flyball_quarter_callback(ptr, param); |
| 153 | break; |
| 154 | default: |
| 155 | assert_always(FALSE, "Unknown id in flyball_state::device_timer"); |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | |
| 135 | 160 | TIMER_CALLBACK_MEMBER(flyball_state::flyball_joystick_callback) |
| 136 | 161 | { |
| 137 | 162 | int potsense = param; |
| r22832 | r22833 | |
| 157 | 182 | |
| 158 | 183 | for (i = 0; i < 64; i++) |
| 159 | 184 | if (potsense[i] != 0) |
| 160 | | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline + i), timer_expired_delegate(FUNC(flyball_state::flyball_joystick_callback),this), potsense[i]); |
| 185 | timer_set(machine().primary_screen->time_until_pos(scanline + i), TIMER_FLYBALL_JOYSTICK, potsense[i]); |
| 161 | 186 | |
| 162 | 187 | scanline += 0x40; |
| 163 | 188 | scanline &= 0xff; |
| 164 | 189 | |
| 165 | | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(flyball_state::flyball_quarter_callback),this), scanline); |
| 190 | timer_set(machine().primary_screen->time_until_pos(scanline), TIMER_FLYBALL_QUARTER, scanline); |
| 166 | 191 | |
| 167 | 192 | m_potsense = 0; |
| 168 | 193 | m_potmask = 0; |
| r22832 | r22833 | |
| 396 | 421 | |
| 397 | 422 | m_maincpu->reset(); |
| 398 | 423 | |
| 399 | | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(flyball_state::flyball_quarter_callback),this)); |
| 424 | timer_set(machine().primary_screen->time_until_pos(0), TIMER_FLYBALL_QUARTER); |
| 400 | 425 | |
| 401 | 426 | m_pitcher_vert = 0; |
| 402 | 427 | m_pitcher_horz = 0; |
trunk/src/mame/drivers/rabbit.c
| r22832 | r22833 | |
| 89 | 89 | class rabbit_state : public driver_device |
| 90 | 90 | { |
| 91 | 91 | public: |
| 92 | enum |
| 93 | { |
| 94 | TIMER_BLIT_DONE |
| 95 | }; |
| 96 | |
| 92 | 97 | rabbit_state(const machine_config &mconfig, device_type type, const char *tag) |
| 93 | 98 | : driver_device(mconfig, type, tag), |
| 94 | 99 | m_viewregs0(*this, "viewregs0"), |
| r22832 | r22833 | |
| 140 | 145 | virtual void video_start(); |
| 141 | 146 | UINT32 screen_update_rabbit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 142 | 147 | INTERRUPT_GEN_MEMBER(rabbit_vblank_interrupt); |
| 143 | | TIMER_CALLBACK_MEMBER(rabbit_blit_done); |
| 144 | 148 | inline void get_rabbit_tilemap_info(tile_data &tileinfo, int tile_index, int whichtilemap, int tilesize); |
| 145 | 149 | void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| 146 | 150 | void rabbit_clearspritebitmap( bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| r22832 | r22833 | |
| 149 | 153 | void rabbit_do_blit(); |
| 150 | 154 | required_device<cpu_device> m_maincpu; |
| 151 | 155 | required_device<eeprom_device> m_eeprom; |
| 156 | |
| 157 | protected: |
| 158 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 152 | 159 | }; |
| 153 | 160 | |
| 154 | 161 | |
| r22832 | r22833 | |
| 561 | 568 | #define BLITCMDLOG 0 |
| 562 | 569 | #define BLITLOG 0 |
| 563 | 570 | |
| 564 | | TIMER_CALLBACK_MEMBER(rabbit_state::rabbit_blit_done) |
| 571 | void rabbit_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 565 | 572 | { |
| 566 | | m_maincpu->set_input_line(m_bltirqlevel, HOLD_LINE); |
| 573 | switch (id) |
| 574 | { |
| 575 | case TIMER_BLIT_DONE: |
| 576 | m_maincpu->set_input_line(m_bltirqlevel, HOLD_LINE); |
| 577 | break; |
| 578 | default: |
| 579 | assert_always(FALSE, "Unknown id in rabbit_state::device_timer"); |
| 580 | } |
| 567 | 581 | } |
| 568 | 582 | |
| 569 | 583 | void rabbit_state::rabbit_do_blit() |
| r22832 | r22833 | |
| 610 | 624 | if (!blt_amount) |
| 611 | 625 | { |
| 612 | 626 | if(BLITLOG) mame_printf_debug("end of blit list\n"); |
| 613 | | machine().scheduler().timer_set(attotime::from_usec(500), timer_expired_delegate(FUNC(rabbit_state::rabbit_blit_done),this)); |
| 627 | timer_set(attotime::from_usec(500), TIMER_BLIT_DONE); |
| 614 | 628 | return; |
| 615 | 629 | } |
| 616 | 630 | |
trunk/src/mame/drivers/artmagic.c
| r22832 | r22833 | |
| 132 | 132 | * |
| 133 | 133 | *************************************/ |
| 134 | 134 | |
| 135 | | TIMER_CALLBACK_MEMBER(artmagic_state::irq_off) |
| 135 | void artmagic_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 136 | 136 | { |
| 137 | | m_hack_irq = 0; |
| 138 | | update_irq_state(machine()); |
| 137 | switch (id) |
| 138 | { |
| 139 | case TIMER_IRQ_OFF: |
| 140 | m_hack_irq = 0; |
| 141 | update_irq_state(machine()); |
| 142 | break; |
| 143 | default: |
| 144 | assert_always(FALSE, "Unknown id in artmagic_state::device_timer"); |
| 145 | } |
| 139 | 146 | } |
| 140 | 147 | |
| 148 | |
| 141 | 149 | READ16_MEMBER(artmagic_state::ultennis_hack_r) |
| 142 | 150 | { |
| 143 | 151 | /* IRQ5 points to: jsr (a5); rte */ |
| r22832 | r22833 | |
| 146 | 154 | { |
| 147 | 155 | m_hack_irq = 1; |
| 148 | 156 | update_irq_state(machine()); |
| 149 | | machine().scheduler().timer_set(attotime::from_usec(1), timer_expired_delegate(FUNC(artmagic_state::irq_off),this)); |
| 157 | timer_set(attotime::from_usec(1), TIMER_IRQ_OFF); |
| 150 | 158 | } |
| 151 | 159 | return ioport("300000")->read(); |
| 152 | 160 | } |
trunk/src/mame/drivers/thayers.c
| r22832 | r22833 | |
| 35 | 35 | class thayers_state : public driver_device |
| 36 | 36 | { |
| 37 | 37 | public: |
| 38 | enum |
| 39 | { |
| 40 | TIMER_INTRQ_TICK, |
| 41 | TIMER_SSI263_PHONEME_TICK |
| 42 | }; |
| 43 | |
| 38 | 44 | thayers_state(const machine_config &mconfig, device_type type, const char *tag) |
| 39 | 45 | : driver_device(mconfig, type, tag), |
| 40 | 46 | m_pr7820(*this, "laserdisc"), |
| r22832 | r22833 | |
| 83 | 89 | DECLARE_CUSTOM_INPUT_MEMBER(laserdisc_ready_r); |
| 84 | 90 | virtual void machine_start(); |
| 85 | 91 | virtual void machine_reset(); |
| 86 | | TIMER_CALLBACK_MEMBER(intrq_tick); |
| 87 | | TIMER_CALLBACK_MEMBER(ssi263_phoneme_tick); |
| 88 | 92 | void check_interrupt(); |
| 89 | 93 | required_device<cpu_device> m_maincpu; |
| 94 | |
| 95 | protected: |
| 96 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 90 | 97 | }; |
| 91 | 98 | |
| 92 | 99 | |
| r22832 | r22833 | |
| 98 | 105 | |
| 99 | 106 | /* Interrupts */ |
| 100 | 107 | |
| 108 | void thayers_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 109 | { |
| 110 | switch (id) |
| 111 | { |
| 112 | case TIMER_INTRQ_TICK: |
| 113 | m_maincpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE); |
| 114 | break; |
| 115 | case TIMER_SSI263_PHONEME_TICK: |
| 116 | m_ssi_data_request = 0; |
| 117 | check_interrupt(); |
| 118 | break; |
| 119 | default: |
| 120 | assert_always(FALSE, "Unknown id in thayers_state::device_timer"); |
| 121 | } |
| 122 | } |
| 123 | |
| 101 | 124 | void thayers_state::check_interrupt() |
| 102 | 125 | { |
| 103 | 126 | if (!m_timer_int || !m_data_rdy_int || !m_ssi_data_request) |
| r22832 | r22833 | |
| 110 | 133 | } |
| 111 | 134 | } |
| 112 | 135 | |
| 113 | | TIMER_CALLBACK_MEMBER(thayers_state::intrq_tick) |
| 114 | | { |
| 115 | | m_maincpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE); |
| 116 | | } |
| 117 | | |
| 118 | 136 | WRITE8_MEMBER(thayers_state::intrq_w) |
| 119 | 137 | { |
| 120 | 138 | // T = 1.1 * R30 * C53 = 1.1 * 750K * 0.01uF = 8.25 ms |
| 121 | 139 | |
| 122 | 140 | m_maincpu->set_input_line(INPUT_LINE_IRQ0, HOLD_LINE); |
| 123 | 141 | |
| 124 | | machine().scheduler().timer_set(attotime::from_usec(8250), timer_expired_delegate(FUNC(thayers_state::intrq_tick),this)); |
| 142 | timer_set(attotime::from_usec(8250), TIMER_INTRQ_TICK); |
| 125 | 143 | } |
| 126 | 144 | |
| 127 | 145 | READ8_MEMBER(thayers_state::irqstate_r) |
| r22832 | r22833 | |
| 474 | 492 | "L", "L1", "LF", "W", "B", "D", "KV", "P", "T", "K", "HV", "HVC", "HF", "HFC", "HN", "Z", "S", "J", "SCH", "V", "F", "THV", "TH", "M", "N", "NG", ":A", ":OH", ":U", ":UH", "E2", "LB" |
| 475 | 493 | }; |
| 476 | 494 | |
| 477 | | TIMER_CALLBACK_MEMBER(thayers_state::ssi263_phoneme_tick) |
| 478 | | { |
| 479 | | m_ssi_data_request = 0; |
| 480 | | check_interrupt(); |
| 481 | | } |
| 482 | | |
| 483 | 495 | WRITE8_MEMBER(thayers_state::ssi263_register_w) |
| 484 | 496 | { |
| 485 | 497 | struct ssi263_t &ssi263 = m_ssi263; |
| r22832 | r22833 | |
| 502 | 514 | case 0: |
| 503 | 515 | case 1: |
| 504 | 516 | // phoneme timing response |
| 505 | | machine().scheduler().timer_set(attotime::from_usec(phoneme_time), timer_expired_delegate(FUNC(thayers_state::ssi263_phoneme_tick),this)); |
| 517 | timer_set(attotime::from_usec(phoneme_time), TIMER_SSI263_PHONEME_TICK); |
| 506 | 518 | break; |
| 507 | 519 | case 2: |
| 508 | 520 | // frame timing response |
| 509 | | machine().scheduler().timer_set(attotime::from_usec(frame_time), timer_expired_delegate(FUNC(thayers_state::ssi263_phoneme_tick),this)); |
| 521 | timer_set(attotime::from_usec(frame_time), TIMER_SSI263_PHONEME_TICK); |
| 510 | 522 | break; |
| 511 | 523 | case 3: |
| 512 | 524 | // disable A/_R output |
trunk/src/mame/drivers/gpworld.c
| r22832 | r22833 | |
| 47 | 47 | class gpworld_state : public driver_device |
| 48 | 48 | { |
| 49 | 49 | public: |
| 50 | enum |
| 51 | { |
| 52 | TIMER_IRQ_STOP |
| 53 | }; |
| 54 | |
| 50 | 55 | gpworld_state(const machine_config &mconfig, device_type type, const char *tag) |
| 51 | 56 | : driver_device(mconfig, type, tag), |
| 52 | 57 | m_laserdisc(*this, "laserdisc") , |
| r22832 | r22833 | |
| 74 | 79 | virtual void machine_start(); |
| 75 | 80 | UINT32 screen_update_gpworld(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 76 | 81 | INTERRUPT_GEN_MEMBER(vblank_callback_gpworld); |
| 77 | | TIMER_CALLBACK_MEMBER(irq_stop); |
| 78 | 82 | void gpworld_draw_tiles(bitmap_rgb32 &bitmap,const rectangle &cliprect); |
| 79 | 83 | inline void draw_pixel(bitmap_rgb32 &bitmap,const rectangle &cliprect,int x,int y,int color,int flip); |
| 80 | 84 | void gpworld_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 81 | 85 | required_device<cpu_device> m_maincpu; |
| 86 | |
| 87 | protected: |
| 88 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 82 | 89 | }; |
| 83 | 90 | |
| 84 | 91 | |
| r22832 | r22833 | |
| 429 | 436 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 430 | 437 | INPUT_PORTS_END |
| 431 | 438 | |
| 432 | | TIMER_CALLBACK_MEMBER(gpworld_state::irq_stop) |
| 439 | void gpworld_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 433 | 440 | { |
| 434 | | m_maincpu->set_input_line(0, CLEAR_LINE); |
| 441 | switch (id) |
| 442 | { |
| 443 | case TIMER_IRQ_STOP: |
| 444 | m_maincpu->set_input_line(0, CLEAR_LINE); |
| 445 | break; |
| 446 | default: |
| 447 | assert_always(FALSE, "Unknown id in gpworld_state::device_timer"); |
| 448 | } |
| 435 | 449 | } |
| 436 | 450 | |
| 437 | 451 | INTERRUPT_GEN_MEMBER(gpworld_state::vblank_callback_gpworld) |
| r22832 | r22833 | |
| 446 | 460 | |
| 447 | 461 | /* The time the IRQ line stays high is set just long enough to happen after the NMI - hacky? */ |
| 448 | 462 | device.execute().set_input_line(0, ASSERT_LINE); |
| 449 | | machine().scheduler().timer_set(attotime::from_usec(100), timer_expired_delegate(FUNC(gpworld_state::irq_stop),this)); |
| 463 | timer_set(attotime::from_usec(100), TIMER_IRQ_STOP); |
| 450 | 464 | } |
| 451 | 465 | |
| 452 | 466 | static const gfx_layout gpworld_tile_layout = |
trunk/src/mame/drivers/mlanding.c
| r22832 | r22833 | |
| 33 | 33 | class mlanding_state : public driver_device |
| 34 | 34 | { |
| 35 | 35 | public: |
| 36 | enum |
| 37 | { |
| 38 | TIMER_DMA_COMPLETE |
| 39 | }; |
| 40 | |
| 36 | 41 | mlanding_state(const machine_config &mconfig, device_type type, const char *tag) |
| 37 | 42 | : driver_device(mconfig, type, tag), |
| 38 | 43 | m_maincpu(*this, "maincpu"), |
| r22832 | r22833 | |
| 95 | 100 | virtual void machine_start(); |
| 96 | 101 | virtual void video_start(); |
| 97 | 102 | UINT32 screen_update_mlanding(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 98 | | TIMER_CALLBACK_MEMBER(dma_complete); |
| 99 | 103 | int start_dma(); |
| 100 | 104 | DECLARE_WRITE_LINE_MEMBER(ml_msm5205_vck); |
| 105 | |
| 106 | protected: |
| 107 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 101 | 108 | }; |
| 102 | 109 | |
| 103 | 110 | |
| r22832 | r22833 | |
| 306 | 313 | m_adpcm_trigger ^= 1; |
| 307 | 314 | } |
| 308 | 315 | |
| 309 | | TIMER_CALLBACK_MEMBER(mlanding_state::dma_complete) |
| 316 | void mlanding_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 310 | 317 | { |
| 311 | | m_dma_active = 0; |
| 318 | switch (id) |
| 319 | { |
| 320 | case TIMER_DMA_COMPLETE: |
| 321 | m_dma_active = 0; |
| 322 | break; |
| 323 | default: |
| 324 | assert_always(FALSE, "Unknown id in mlanding_state::device_timer"); |
| 325 | } |
| 312 | 326 | } |
| 313 | 327 | |
| 314 | 328 | /* TODO: this uses many bits */ |
| r22832 | r22833 | |
| 322 | 336 | if (pixels) |
| 323 | 337 | { |
| 324 | 338 | m_dma_active = 1; |
| 325 | | machine().scheduler().timer_set(attotime::from_msec(20), timer_expired_delegate(FUNC(mlanding_state::dma_complete),this)); |
| 339 | timer_set(attotime::from_msec(20), TIMER_DMA_COMPLETE); |
| 326 | 340 | } |
| 327 | 341 | |
| 328 | 342 | // 0 (falling edge?) starts cpus in this order: |
trunk/src/mame/drivers/galastrm.c
| r22832 | r22833 | |
| 54 | 54 | device.execute().set_input_line(5, HOLD_LINE); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | | TIMER_CALLBACK_MEMBER(galastrm_state::galastrm_interrupt6) |
| 57 | void galastrm_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 58 | 58 | { |
| 59 | | m_maincpu->set_input_line(6, HOLD_LINE); |
| 59 | switch (id) |
| 60 | { |
| 61 | case TIMER_GALASTRM_INTERRUPT6: |
| 62 | m_maincpu->set_input_line(6, HOLD_LINE); |
| 63 | break; |
| 64 | default: |
| 65 | assert_always(FALSE, "Unknown id in galastrm_state::device_timer"); |
| 66 | } |
| 60 | 67 | } |
| 61 | 68 | |
| 62 | 69 | |
| 63 | | |
| 64 | 70 | WRITE32_MEMBER(galastrm_state::galastrm_palette_w) |
| 65 | 71 | { |
| 66 | 72 | if (ACCESSING_BITS_16_31) |
| r22832 | r22833 | |
| 156 | 162 | |
| 157 | 163 | WRITE32_MEMBER(galastrm_state::galastrm_adstick_ctrl_w) |
| 158 | 164 | { |
| 159 | | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(1000), timer_expired_delegate(FUNC(galastrm_state::galastrm_interrupt6),this)); |
| 165 | timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(1000), TIMER_GALASTRM_INTERRUPT6); |
| 160 | 166 | } |
| 161 | 167 | |
| 162 | 168 | /*********************************************************** |
trunk/src/mame/drivers/toypop.c
| r22832 | r22833 | |
| 78 | 78 | m_sound_irq_mask = 0; |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | void toypop_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 82 | { |
| 83 | switch (id) |
| 84 | { |
| 85 | case TIMER_NAMCOIO_RUN: |
| 86 | namcoio_run(ptr, param); |
| 87 | break; |
| 88 | default: |
| 89 | assert_always(FALSE, "Unknown id in toypop_state::device_timer"); |
| 90 | } |
| 91 | } |
| 92 | |
| 81 | 93 | TIMER_CALLBACK_MEMBER(toypop_state::namcoio_run) |
| 82 | 94 | { |
| 83 | 95 | device_t *io58xx = machine().device("58xx"); |
| r22832 | r22833 | |
| 108 | 120 | device.execute().set_input_line(0, HOLD_LINE); |
| 109 | 121 | |
| 110 | 122 | if (!namcoio_read_reset_line(namcoio_0)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 111 | | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(toypop_state::namcoio_run),this)); |
| 123 | timer_set(attotime::from_usec(50), TIMER_NAMCOIO_RUN); |
| 112 | 124 | |
| 113 | 125 | if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 114 | | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(toypop_state::namcoio_run),this), 1); |
| 126 | timer_set(attotime::from_usec(50), TIMER_NAMCOIO_RUN, 1); |
| 115 | 127 | |
| 116 | 128 | if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */ |
| 117 | | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(toypop_state::namcoio_run),this), 2); |
| 129 | timer_set(attotime::from_usec(50), TIMER_NAMCOIO_RUN, 2); |
| 118 | 130 | |
| 119 | 131 | } |
| 120 | 132 | |
trunk/src/mame/drivers/gunbustr.c
| r22832 | r22833 | |
| 52 | 52 | |
| 53 | 53 | /*********************************************************************/ |
| 54 | 54 | |
| 55 | | TIMER_CALLBACK_MEMBER(gunbustr_state::gunbustr_interrupt5) |
| 55 | void gunbustr_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 56 | 56 | { |
| 57 | | m_maincpu->set_input_line(5, HOLD_LINE); |
| 57 | switch (id) |
| 58 | { |
| 59 | case TIMER_GUNBUSTR_INTERRUPT5: |
| 60 | m_maincpu->set_input_line(5, HOLD_LINE); |
| 61 | break; |
| 62 | default: |
| 63 | assert_always(FALSE, "Unknown id in gunbustr_state::device_timer"); |
| 64 | } |
| 58 | 65 | } |
| 59 | 66 | |
| 60 | 67 | INTERRUPT_GEN_MEMBER(gunbustr_state::gunbustr_interrupt) |
| 61 | 68 | { |
| 62 | | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(200000-500), timer_expired_delegate(FUNC(gunbustr_state::gunbustr_interrupt5),this)); |
| 69 | timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(200000-500), TIMER_GUNBUSTR_INTERRUPT5); |
| 63 | 70 | device.execute().set_input_line(4, HOLD_LINE); |
| 64 | 71 | } |
| 65 | 72 | |
| r22832 | r22833 | |
| 142 | 149 | WRITE32_MEMBER(gunbustr_state::gunbustr_gun_w) |
| 143 | 150 | { |
| 144 | 151 | /* 10000 cycle delay is arbitrary */ |
| 145 | | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(10000), timer_expired_delegate(FUNC(gunbustr_state::gunbustr_interrupt5),this)); |
| 152 | timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(10000), TIMER_GUNBUSTR_INTERRUPT5); |
| 146 | 153 | } |
| 147 | 154 | |
| 148 | 155 | |
trunk/src/mame/drivers/capbowl.c
| r22832 | r22833 | |
| 119 | 119 | * |
| 120 | 120 | *************************************/ |
| 121 | 121 | |
| 122 | void capbowl_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 123 | { |
| 124 | switch (id) |
| 125 | { |
| 126 | case TIMER_CAPBOWL_UPDATE: |
| 127 | capbowl_update(ptr, param); |
| 128 | break; |
| 129 | default: |
| 130 | assert_always(FALSE, "Unknown id in capbowl_state::device_timer"); |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | |
| 122 | 135 | TIMER_CALLBACK_MEMBER(capbowl_state::capbowl_update) |
| 123 | 136 | { |
| 124 | 137 | int scanline = param; |
| r22832 | r22833 | |
| 126 | 139 | machine().primary_screen->update_partial(scanline - 1); |
| 127 | 140 | scanline += 32; |
| 128 | 141 | if (scanline > 240) scanline = 32; |
| 129 | | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(capbowl_state::capbowl_update),this), scanline); |
| 142 | timer_set(machine().primary_screen->time_until_pos(scanline), TIMER_CAPBOWL_UPDATE, scanline); |
| 130 | 143 | } |
| 131 | 144 | |
| 132 | 145 | |
| r22832 | r22833 | |
| 338 | 351 | |
| 339 | 352 | void capbowl_state::machine_reset() |
| 340 | 353 | { |
| 341 | | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(32), timer_expired_delegate(FUNC(capbowl_state::capbowl_update),this), 32); |
| 354 | timer_set(machine().primary_screen->time_until_pos(32), TIMER_CAPBOWL_UPDATE, 32); |
| 342 | 355 | |
| 343 | 356 | m_blitter_addr = 0; |
| 344 | 357 | m_last_trackball_val[0] = 0; |
trunk/src/mame/includes/galastrm.h
| r22832 | r22833 | |
| 14 | 14 | class galastrm_state : public driver_device |
| 15 | 15 | { |
| 16 | 16 | public: |
| 17 | enum |
| 18 | { |
| 19 | TIMER_GALASTRM_INTERRUPT6 |
| 20 | }; |
| 21 | |
| 17 | 22 | galastrm_state(const machine_config &mconfig, device_type type, const char *tag) |
| 18 | 23 | : driver_device(mconfig, type, tag), |
| 19 | 24 | m_ram(*this,"ram"), |
| r22832 | r22833 | |
| 52 | 57 | virtual void video_start(); |
| 53 | 58 | UINT32 screen_update_galastrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 54 | 59 | INTERRUPT_GEN_MEMBER(galastrm_interrupt); |
| 55 | | TIMER_CALLBACK_MEMBER(galastrm_interrupt6); |
| 56 | 60 | void galastrm_exit(); |
| 57 | 61 | void draw_sprites_pre(int x_offs, int y_offs); |
| 58 | 62 | void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int *primasks, int priority); |
| 59 | 63 | void tc0610_rotate_draw(bitmap_ind16 &bitmap, bitmap_ind16 &srcbitmap, const rectangle &clip); |
| 60 | 64 | required_device<cpu_device> m_maincpu; |
| 61 | 65 | required_device<eeprom_device> m_eeprom; |
| 66 | |
| 67 | protected: |
| 68 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 62 | 69 | }; |
trunk/src/mame/includes/thunderx.h
| r22832 | r22833 | |
| 8 | 8 | class thunderx_state : public driver_device |
| 9 | 9 | { |
| 10 | 10 | public: |
| 11 | enum |
| 12 | { |
| 13 | TIMER_THUNDERX_FIRQ |
| 14 | }; |
| 15 | |
| 11 | 16 | thunderx_state(const machine_config &mconfig, device_type type, const char *tag) |
| 12 | 17 | : driver_device(mconfig, type, tag), |
| 13 | 18 | m_ram(*this, "ram"), |
| r22832 | r22833 | |
| 58 | 63 | DECLARE_MACHINE_RESET(thunderx); |
| 59 | 64 | UINT32 screen_update_scontra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 60 | 65 | INTERRUPT_GEN_MEMBER(scontra_interrupt); |
| 61 | | TIMER_CALLBACK_MEMBER(thunderx_firq_callback); |
| 62 | 66 | void run_collisions( int s0, int e0, int s1, int e1, int cm, int hm ); |
| 63 | 67 | void calculate_collisions( ); |
| 64 | 68 | DECLARE_WRITE8_MEMBER(volume_callback); |
| 69 | |
| 70 | protected: |
| 71 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 65 | 72 | }; |
| 66 | 73 | |
| 67 | 74 | |
trunk/src/mame/includes/gunbustr.h
| r22832 | r22833 | |
| 13 | 13 | class gunbustr_state : public driver_device |
| 14 | 14 | { |
| 15 | 15 | public: |
| 16 | enum |
| 17 | { |
| 18 | TIMER_GUNBUSTR_INTERRUPT5 |
| 19 | }; |
| 20 | |
| 16 | 21 | gunbustr_state(const machine_config &mconfig, device_type type, const char *tag) |
| 17 | 22 | : driver_device(mconfig, type, tag), |
| 18 | 23 | m_maincpu(*this,"maincpu"), |
| r22832 | r22833 | |
| 45 | 50 | virtual void video_start(); |
| 46 | 51 | UINT32 screen_update_gunbustr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 47 | 52 | INTERRUPT_GEN_MEMBER(gunbustr_interrupt); |
| 48 | | TIMER_CALLBACK_MEMBER(gunbustr_interrupt5); |
| 49 | 53 | void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,const int *primasks,int x_offs,int y_offs); |
| 54 | |
| 55 | protected: |
| 56 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 50 | 57 | }; |
trunk/src/mame/includes/taito_f2.h
| r22832 | r22833 | |
| 12 | 12 | class taitof2_state : public driver_device |
| 13 | 13 | { |
| 14 | 14 | public: |
| 15 | enum |
| 16 | { |
| 17 | TIMER_TAITOF2_INTERRUPT6 |
| 18 | }; |
| 19 | |
| 15 | 20 | taitof2_state(const machine_config &mconfig, device_type type, const char *tag) |
| 16 | 21 | : driver_device(mconfig, type, tag), |
| 17 | 22 | m_sprite_extension(*this, "sprite_ext"), |
| r22832 | r22833 | |
| 151 | 156 | void screen_eof_taitof2_full_buffer_delayed(screen_device &screen, bool state); |
| 152 | 157 | void screen_eof_taitof2_partial_buffer_delayed_qzchikyu(screen_device &screen, bool state); |
| 153 | 158 | INTERRUPT_GEN_MEMBER(taitof2_interrupt); |
| 154 | | TIMER_CALLBACK_MEMBER(taitof2_interrupt6); |
| 155 | 159 | void reset_driveout_sound_region(); |
| 156 | 160 | void taitof2_core_vh_start (int sprite_type, int hide, int flip_hide ); |
| 157 | 161 | void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int *primasks, int uses_tc360_mixer ); |
| r22832 | r22833 | |
| 160 | 164 | void taitof2_update_sprites_active_area( ); |
| 161 | 165 | void draw_roz_layer( bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32 priority); |
| 162 | 166 | void taito_f2_tc360_spritemixdraw(bitmap_ind16 &dest_bmp, const rectangle &clip, gfx_element *gfx, |
| 163 | | UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy, int scalex, int scaley ); |
| 167 | UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy, int scalex, int scaley ); |
| 164 | 168 | DECLARE_WRITE_LINE_MEMBER(irqhandler); |
| 169 | |
| 170 | protected: |
| 171 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 165 | 172 | }; |
trunk/src/mame/includes/asterix.h
| r22832 | r22833 | |
| 8 | 8 | class asterix_state : public driver_device |
| 9 | 9 | { |
| 10 | 10 | public: |
| 11 | enum |
| 12 | { |
| 13 | TIMER_NMI |
| 14 | }; |
| 15 | |
| 11 | 16 | asterix_state(const machine_config &mconfig, device_type type, const char *tag) |
| 12 | 17 | : driver_device(mconfig, type, tag), |
| 13 | 18 | m_maincpu(*this, "maincpu"), |
| r22832 | r22833 | |
| 51 | 56 | virtual void machine_reset(); |
| 52 | 57 | UINT32 screen_update_asterix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 53 | 58 | INTERRUPT_GEN_MEMBER(asterix_interrupt); |
| 54 | | TIMER_CALLBACK_MEMBER(nmi_callback); |
| 59 | |
| 60 | protected: |
| 61 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 55 | 62 | }; |
| 56 | 63 | |
| 57 | 64 | /*----------- defined in video/asterix.c -----------*/ |
trunk/src/mame/includes/artmagic.h
| r22832 | r22833 | |
| 8 | 8 | class artmagic_state : public driver_device |
| 9 | 9 | { |
| 10 | 10 | public: |
| 11 | enum |
| 12 | { |
| 13 | TIMER_IRQ_OFF |
| 14 | }; |
| 15 | |
| 11 | 16 | artmagic_state(const machine_config &mconfig, device_type type, const char *tag) |
| 12 | 17 | : driver_device(mconfig, type, tag), |
| 13 | 18 | m_tlc34076(*this, "tlc34076"), |
| r22832 | r22833 | |
| 54 | 59 | virtual void machine_start(); |
| 55 | 60 | virtual void machine_reset(); |
| 56 | 61 | virtual void video_start(); |
| 57 | | TIMER_CALLBACK_MEMBER(irq_off); |
| 58 | 62 | required_device<cpu_device> m_maincpu; |
| 59 | 63 | required_device<okim6295_device> m_oki; |
| 64 | |
| 65 | protected: |
| 66 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 60 | 67 | }; |
| 61 | 68 | |
| 62 | 69 | |