summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video/tms34061.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/video/tms34061.h')
-rw-r--r--src/devices/video/tms34061.h70
1 files changed, 41 insertions, 29 deletions
diff --git a/src/devices/video/tms34061.h b/src/devices/video/tms34061.h
index 3b3e3d5f552..e4f92e75ac2 100644
--- a/src/devices/video/tms34061.h
+++ b/src/devices/video/tms34061.h
@@ -15,6 +15,17 @@
#pragma once
+#define MCFG_TMS34061_ROWSHIFT(_shift) \
+ downcast<tms34061_device &>(*device).set_rowshift(_shift);
+
+#define MCFG_TMS34061_VRAM_SIZE(_size) \
+ downcast<tms34061_device &>(*device).set_vram_size(_size);
+
+#define MCFG_TMS34061_INTERRUPT_CB(_devcb) \
+ downcast<tms34061_device &>(*device).set_interrupt_callback(DEVCB_##_devcb);
+
+
+
// ======================> tms34061_device
class tms34061_device : public device_t, public device_video_interface
@@ -23,35 +34,36 @@ public:
/* display state structure */
struct tms34061_display
{
- u8 blanked; /* true if blanked */
- u8 *vram; /* base of VRAM */
- u8 *latchram; /* base of latch RAM */
- u16 *regs; /* pointer to array of registers */
+ uint8_t blanked; /* true if blanked */
+ uint8_t *vram; /* base of VRAM */
+ uint8_t *latchram; /* base of latch RAM */
+ uint16_t *regs; /* pointer to array of registers */
offs_t dispstart; /* display start */
};
// construction/destruction
- tms34061_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+ tms34061_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- void set_rowshift(u8 rowshift) { m_rowshift = rowshift; }
- void set_vram_size(u32 vramsize) { m_vramsize = vramsize; }
+ void set_rowshift(uint8_t rowshift) { m_rowshift = rowshift; }
+ void set_vram_size(uint32_t vramsize) { m_vramsize = vramsize; }
+ template <class Object> devcb_base &set_interrupt_callback(Object &&cb) { return m_interrupt_cb.set_callback(std::forward<Object>(cb)); }
auto int_callback() { return m_interrupt_cb.bind(); }
/* reads/writes to the 34061 */
- u8 read(int col, int row, int func);
- void write(int col, int row, int func, u8 data);
+ uint8_t read(address_space &space, int col, int row, int func);
+ void write(address_space &space, int col, int row, int func, uint8_t data);
/* latch settings */
- u8 latch_r();
- void latch_w(u8 data);
+ DECLARE_READ8_MEMBER( latch_r );
+ DECLARE_WRITE8_MEMBER( latch_w );
/* video update handling */
void get_display_state();
bool blanked() const { return bool(m_display.blanked); }
- u8 const &vram(unsigned row) const { return m_display.vram[row << m_rowshift]; }
- u16 xyoffset() const { return m_display.regs[TMS34061_XYOFFSET]; }
- u16 xyaddress() const { return m_display.regs[TMS34061_XYADDRESS]; }
+ uint8_t const &vram(unsigned row) const { return m_display.vram[row << m_rowshift]; }
+ uint16_t xyoffset() const { return m_display.regs[TMS34061_XYOFFSET]; }
+ uint16_t xyaddress() const { return m_display.regs[TMS34061_XYADDRESS]; }
// TODO: encapsulate this properly
tms34061_display m_display;
@@ -86,27 +98,27 @@ private:
TMS34061_REGCOUNT
};
- u8 m_rowshift; /* VRAM address is (row << rowshift) | col */
- u32 m_vramsize; /* size of video RAM */
+ uint8_t m_rowshift; /* VRAM address is (row << rowshift) | col */
+ uint32_t m_vramsize; /* size of video RAM */
devcb_write_line m_interrupt_cb; /* interrupt gen callback */
- u16 m_regs[TMS34061_REGCOUNT];
- u16 m_xmask;
- u8 m_yshift;
- u32 m_vrammask;
- u8 * m_vram;
- u8 * m_latchram;
- u8 m_latchdata;
- u8 * m_shiftreg;
- emu_timer * m_timer;
+ uint16_t m_regs[TMS34061_REGCOUNT];
+ uint16_t m_xmask;
+ uint8_t m_yshift;
+ uint32_t m_vrammask;
+ uint8_t * m_vram;
+ uint8_t * m_latchram;
+ uint8_t m_latchdata;
+ uint8_t * m_shiftreg;
+ emu_timer * m_timer;
void update_interrupts();
TIMER_CALLBACK_MEMBER( interrupt );
- void register_w(offs_t offset, u8 data);
- u8 register_r(offs_t offset);
+ void register_w(address_space &space, offs_t offset, uint8_t data);
+ uint8_t register_r(address_space &space, offs_t offset);
void adjust_xyaddress(int offset);
- void xypixel_w(int offset, u8 data);
- u8 xypixel_r(int offset);
+ void xypixel_w(address_space &space, int offset, uint8_t data);
+ uint8_t xypixel_r(address_space &space, int offset);
};
// device type definition