trunk/src/mame/includes/nb1413m3.h
| r242914 | r242915 | |
| 129 | 129 | |
| 130 | 130 | // (static) configuration helpers |
| 131 | 131 | static void set_type(device_t &device, int type) { downcast<nb1413m3_device &>(device).m_nb1413m3_type = type; } |
| 132 | |
| 133 | enum |
| 134 | { |
| 135 | TIMER_CB |
| 136 | }; |
| 132 | 137 | |
| 133 | 138 | DECLARE_WRITE8_MEMBER( nmi_clock_w ); |
| 134 | 139 | DECLARE_READ8_MEMBER( sndrom_r ); |
| r242914 | r242915 | |
| 161 | 166 | |
| 162 | 167 | protected: |
| 163 | 168 | // device-level overrides |
| 164 | | virtual void device_config_complete(); |
| 165 | 169 | virtual void device_start(); |
| 166 | 170 | virtual void device_reset(); |
| 167 | | |
| 171 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 172 | |
| 168 | 173 | private: |
| 169 | 174 | |
| 170 | 175 | int m_74ls193_counter; |
| r242914 | r242915 | |
| 176 | 181 | int m_gfxradr_h; |
| 177 | 182 | int m_gfxrombank; |
| 178 | 183 | int m_outcoin_enable; |
| 179 | | |
| 184 | emu_timer *m_timer_cb; |
| 180 | 185 | TIMER_CALLBACK_MEMBER( timer_callback ); |
| 181 | | |
| 182 | 186 | }; |
| 183 | 187 | |
| 184 | 188 | /* used in: hyhoo.c, niyanpai.c, pastelg.c, nbmj8688.c, nbmj8891.c, nbmj8991.c, nbmj9195.c*/ |
trunk/src/mame/machine/nb1413m3.c
| r242914 | r242915 | |
| 42 | 42 | { |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | | //------------------------------------------------- |
| 46 | | // device_config_complete - perform any |
| 47 | | // operations now that the configuration is |
| 48 | | // complete |
| 49 | | //------------------------------------------------- |
| 50 | 45 | |
| 51 | | void nb1413m3_device::device_config_complete() |
| 52 | | { |
| 53 | | } |
| 54 | | |
| 55 | 46 | //------------------------------------------------- |
| 56 | 47 | // device_start - device-specific startup |
| 57 | 48 | //------------------------------------------------- |
| 58 | 49 | |
| 59 | 50 | void nb1413m3_device::device_start() |
| 60 | 51 | { |
| 61 | | machine().scheduler().synchronize(timer_expired_delegate(FUNC(nb1413m3_device::timer_callback), this)); |
| 52 | m_timer_cb = timer_alloc(TIMER_CB); |
| 53 | synchronize(TIMER_CB); |
| 62 | 54 | |
| 63 | 55 | save_item(NAME(m_nb1413m3_type)); |
| 64 | 56 | save_item(NAME(m_sndrombank1)); |
| r242914 | r242915 | |
| 105 | 97 | DEVICE HANDLERS |
| 106 | 98 | *****************************************************************************/ |
| 107 | 99 | |
| 100 | void nb1413m3_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 101 | { |
| 102 | switch (id) |
| 103 | { |
| 104 | case TIMER_CB: |
| 105 | timer_callback(ptr, param); |
| 106 | break; |
| 107 | default: |
| 108 | assert_always(FALSE, "Unknown id in nb1413m3_device::device_timer"); |
| 109 | } |
| 110 | } |
| 111 | |
| 108 | 112 | /* TODO: is all of this actually programmable? */ |
| 109 | 113 | TIMER_CALLBACK_MEMBER( nb1413m3_device::timer_callback ) |
| 110 | 114 | { |
| 111 | | machine().scheduler().timer_set(attotime::from_hz(NB1413M3_TIMER_BASE) * 256, timer_expired_delegate(FUNC(nb1413m3_device::timer_callback), this)); |
| 115 | m_timer_cb->adjust(attotime::from_hz(NB1413M3_TIMER_BASE) * 256); |
| 112 | 116 | |
| 113 | 117 | m_74ls193_counter++; |
| 114 | 118 | m_74ls193_counter &= 0x0f; |