trunk/src/emu/driver.c
r18011 | r18012 | |
51 | 51 | |
52 | 52 | driver_device::driver_device(const machine_config &mconfig, device_type type, const char *tag) |
53 | 53 | : device_t(mconfig, type, "Driver Device", tag, NULL, 0), |
54 | | device_memory_interface(mconfig, *this), |
55 | 54 | m_generic_paletteram_8(*this, "paletteram"), |
56 | 55 | m_generic_paletteram2_8(*this, "paletteram2"), |
57 | 56 | m_generic_paletteram_16(*this, "paletteram"), |
r18011 | r18012 | |
59 | 58 | m_generic_paletteram_32(*this, "paletteram"), |
60 | 59 | m_generic_paletteram2_32(*this, "paletteram2"), |
61 | 60 | m_system(NULL), |
62 | | m_generic_space_config("generic", ENDIANNESS_LITTLE, 8, 8), |
63 | 61 | m_latch_clear_value(0), |
64 | 62 | m_flip_screen_x(0), |
65 | 63 | m_flip_screen_y(0) |
r18011 | r18012 | |
315 | 313 | } |
316 | 314 | |
317 | 315 | |
318 | | //------------------------------------------------- |
319 | | // memory_space_config - return a description of |
320 | | // any address spaces owned by this device |
321 | | //------------------------------------------------- |
322 | | |
323 | | const address_space_config *driver_device::memory_space_config(address_spacenum spacenum) const |
324 | | { |
325 | | return (spacenum == 0) ? &m_generic_space_config : NULL; |
326 | | } |
327 | | |
328 | | |
329 | | |
330 | 316 | //************************************************************************** |
331 | 317 | // INTERRUPT ENABLE AND VECTOR HELPERS |
332 | 318 | //************************************************************************** |
trunk/src/emu/driver.h
r18011 | r18012 | |
166 | 166 | // ======================> driver_device |
167 | 167 | |
168 | 168 | // base class for machine driver-specific devices |
169 | | class driver_device : public device_t, |
170 | | public device_memory_interface |
| 169 | class driver_device : public device_t |
171 | 170 | { |
172 | 171 | public: |
173 | 172 | // construction/destruction |
r18011 | r18012 | |
206 | 205 | void init_0() { } |
207 | 206 | |
208 | 207 | // memory helpers |
209 | | address_space &generic_space() const { return *space(AS_PROGRAM); } |
| 208 | address_space &generic_space() const { return *machine().memory().first_space(); } |
210 | 209 | |
211 | 210 | // generic interrupt generators |
212 | 211 | void generic_pulse_irq_line(device_execute_interface &exec, int irqline, int cycles); |
r18011 | r18012 | |
404 | 403 | virtual void device_start(); |
405 | 404 | virtual void device_reset_after_children(); |
406 | 405 | |
407 | | // device_memory_interface overrides |
408 | | virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const; |
409 | | |
410 | 406 | // internal helpers |
411 | 407 | inline UINT16 paletteram16_le(offs_t offset) const { return m_generic_paletteram_8[offset & ~1] | (m_generic_paletteram_8[offset | 1] << 8); } |
412 | 408 | inline UINT16 paletteram16_be(offs_t offset) const { return m_generic_paletteram_8[offset | 1] | (m_generic_paletteram_8[offset & ~1] << 8); } |
r18011 | r18012 | |
433 | 429 | driver_callback_delegate m_callbacks[CB_COUNT]; // start/reset callbacks |
434 | 430 | legacy_callback_func m_legacy_callbacks[CB_COUNT]; // legacy start/reset callbacks |
435 | 431 | |
436 | | // memory state |
437 | | address_space_config m_generic_space_config; |
438 | | |
439 | 432 | // generic audio |
440 | 433 | UINT16 m_latch_clear_value; |
441 | 434 | UINT16 m_latched_value[4]; |