trunk/src/mame/drivers/skullxbo.c
| r22861 | r22862 | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
| 42 | | void skullxbo_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 42 | TIMER_DEVICE_CALLBACK_MEMBER(skullxbo_state::scanline_timer) |
| 43 | 43 | { |
| 44 | | switch (id) |
| 45 | | { |
| 46 | | case TIMER_IRQ_GEN: |
| 47 | | scanline_int_gen(m_maincpu); |
| 48 | | break; |
| 49 | | default: |
| 50 | | assert_always(FALSE, "Unknown id in skullxbo_state::device_timer"); |
| 51 | | } |
| 44 | scanline_int_gen(m_maincpu); |
| 52 | 45 | } |
| 53 | 46 | |
| 54 | 47 | |
| r22861 | r22862 | |
| 62 | 55 | { |
| 63 | 56 | int width = screen.width(); |
| 64 | 57 | attotime period = screen.time_until_pos(screen.vpos() + 6, width * 0.9); |
| 65 | | timer_set(period, TIMER_IRQ_GEN); |
| 58 | m_scanline_timer->adjust(period); |
| 66 | 59 | } |
| 67 | 60 | |
| 68 | 61 | /* update the playfield and motion objects */ |
| r22861 | r22862 | |
| 256 | 249 | MCFG_CPU_PROGRAM_MAP(main_map) |
| 257 | 250 | MCFG_DEVICE_VBLANK_INT_DRIVER("screen", atarigen_state, video_int_gen) |
| 258 | 251 | |
| 252 | MCFG_TIMER_DRIVER_ADD("scan_timer", skullxbo_state, scanline_timer) |
| 259 | 253 | MCFG_MACHINE_RESET_OVERRIDE(skullxbo_state,skullxbo) |
| 260 | 254 | MCFG_NVRAM_ADD_1FILL("eeprom") |
| 261 | 255 | |
trunk/src/mame/includes/skullxbo.h
| r22861 | r22862 | |
| 9 | 9 | class skullxbo_state : public atarigen_state |
| 10 | 10 | { |
| 11 | 11 | public: |
| 12 | | enum |
| 13 | | { |
| 14 | | TIMER_IRQ_GEN |
| 15 | | }; |
| 16 | | |
| 17 | 12 | skullxbo_state(const machine_config &mconfig, device_type type, const char *tag) |
| 18 | | : atarigen_state(mconfig, type, tag) { } |
| 13 | : atarigen_state(mconfig, type, tag), |
| 14 | m_scanline_timer(*this, "scan_timer") { } |
| 15 | |
| 16 | required_device<timer_device> m_scanline_timer; |
| 17 | |
| 19 | 18 | virtual void update_interrupts(); |
| 20 | 19 | virtual void scanline_update(screen_device &screen, int scanline); |
| 21 | 20 | DECLARE_WRITE16_MEMBER(skullxbo_halt_until_hblank_0_w); |
| r22861 | r22862 | |
| 28 | 27 | DECLARE_MACHINE_RESET(skullxbo); |
| 29 | 28 | DECLARE_VIDEO_START(skullxbo); |
| 30 | 29 | UINT32 screen_update_skullxbo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 30 | TIMER_DEVICE_CALLBACK_MEMBER(scanline_timer); |
| 31 | 31 | void skullxbo_scanline_update(int scanline); |
| 32 | 32 | DECLARE_WRITE16_MEMBER( skullxbo_playfieldlatch_w ); |
| 33 | 33 | DECLARE_WRITE16_MEMBER( skullxbo_xscroll_w ); |
| 34 | 34 | DECLARE_WRITE16_MEMBER( skullxbo_yscroll_w ); |
| 35 | 35 | DECLARE_WRITE16_MEMBER( skullxbo_mobmsb_w ); |
| 36 | | |
| 37 | | protected: |
| 38 | | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 39 | 36 | }; |