trunk/src/mess/video/vtvideo.c
| r29444 | r29445 | |
| 49 | 49 | device_video_interface(mconfig, *this), |
| 50 | 50 | m_read_ram(*this), |
| 51 | 51 | m_write_clear_video_interrupt(*this), |
| 52 | m_char_rom_tag(""), |
| 52 | 53 | m_palette(*this, "palette") |
| 53 | 54 | { |
| 54 | 55 | } |
| r29444 | r29445 | |
| 59 | 60 | device_video_interface(mconfig, *this), |
| 60 | 61 | m_read_ram(*this), |
| 61 | 62 | m_write_clear_video_interrupt(*this), |
| 63 | m_char_rom_tag(""), |
| 62 | 64 | m_palette(*this, "palette") |
| 63 | 65 | { |
| 64 | 66 | } |
| r29444 | r29445 | |
| 71 | 73 | |
| 72 | 74 | |
| 73 | 75 | //------------------------------------------------- |
| 74 | | // device_config_complete - perform any |
| 75 | | // operations now that the configuration is |
| 76 | | // complete |
| 77 | | //------------------------------------------------- |
| 78 | | |
| 79 | | void vt100_video_device::device_config_complete() |
| 80 | | { |
| 81 | | // inherit a copy of the static data |
| 82 | | const vt_video_interface *intf = reinterpret_cast<const vt_video_interface *>(static_config()); |
| 83 | | if (intf != NULL) |
| 84 | | *static_cast<vt_video_interface *>(this) = *intf; |
| 85 | | |
| 86 | | // or initialize to defaults if none provided |
| 87 | | else |
| 88 | | { |
| 89 | | m_char_rom_tag = ""; |
| 90 | | } |
| 91 | | } |
| 92 | | |
| 93 | | //------------------------------------------------- |
| 94 | 76 | // device_start - device-specific startup |
| 95 | 77 | //------------------------------------------------- |
| 96 | 78 | |
trunk/src/mess/video/vtvideo.h
| r29444 | r29445 | |
| 15 | 15 | |
| 16 | 16 | #include "emu.h" |
| 17 | 17 | |
| 18 | | #define MCFG_VT_VIDEO_RAM_CALLBACK(_read) \ |
| 19 | | devcb = &vt100_video_device::set_ram_rd_callback(*device, DEVCB2_##_read); |
| 20 | | |
| 21 | | #define MCFG_VT_VIDEO_CLEAR_VIDEO_INTERRUPT_CALLBACK(_write) \ |
| 22 | | devcb = &vt100_video_device::set_clear_video_irq_wr_callback(*device, DEVCB2_##_write); |
| 23 | | |
| 24 | | struct vt_video_interface |
| 25 | | { |
| 26 | | const char *m_char_rom_tag; /* character rom region */ |
| 27 | | }; |
| 28 | | |
| 29 | | |
| 30 | 18 | class vt100_video_device : public device_t, |
| 31 | | public device_video_interface, |
| 32 | | public vt_video_interface |
| 19 | public device_video_interface |
| 33 | 20 | { |
| 34 | 21 | public: |
| 35 | 22 | vt100_video_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); |
| r29444 | r29445 | |
| 39 | 26 | template<class _Object> static devcb2_base &set_ram_rd_callback(device_t &device, _Object object) { return downcast<vt100_video_device &>(device).m_read_ram.set_callback(object); } |
| 40 | 27 | template<class _Object> static devcb2_base &set_clear_video_irq_wr_callback(device_t &device, _Object object) { return downcast<vt100_video_device &>(device).m_write_clear_video_interrupt.set_callback(object); } |
| 41 | 28 | |
| 29 | static void set_chargen_tag(device_t &device, const char *tag) { downcast<vt100_video_device &>(device).m_char_rom_tag = tag; } |
| 30 | |
| 42 | 31 | DECLARE_READ8_MEMBER(lba7_r); |
| 43 | 32 | DECLARE_WRITE8_MEMBER(dc012_w); |
| 44 | 33 | DECLARE_WRITE8_MEMBER(dc011_w); |
| r29444 | r29445 | |
| 47 | 36 | virtual void video_update(bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 48 | 37 | protected: |
| 49 | 38 | // device-level overrides |
| 50 | | virtual void device_config_complete(); |
| 51 | 39 | virtual void device_start(); |
| 52 | 40 | virtual void device_reset(); |
| 53 | 41 | virtual machine_config_constructor device_mconfig_additions() const; |
| r29444 | r29445 | |
| 67 | 55 | bool MHFU_FLAG; |
| 68 | 56 | int MHFU_counter; |
| 69 | 57 | |
| 70 | | |
| 71 | 58 | // dc012 attributes |
| 72 | 59 | UINT8 m_scroll_latch; |
| 73 | 60 | UINT8 m_scroll_latch_valid; |
| r29444 | r29445 | |
| 82 | 69 | UINT8 m_frequency; |
| 83 | 70 | UINT8 m_interlaced; |
| 84 | 71 | |
| 72 | const char *m_char_rom_tag; /* character rom region */ |
| 85 | 73 | required_device<palette_device> m_palette; |
| 86 | 74 | }; |
| 87 | 75 | |
| r29444 | r29445 | |
| 106 | 94 | extern const device_type RAINBOW_VIDEO; |
| 107 | 95 | |
| 108 | 96 | |
| 109 | | #define MCFG_VT100_VIDEO_ADD(_tag, _screen_tag, _intrf) \ |
| 110 | | MCFG_DEVICE_ADD(_tag, VT100_VIDEO, 0) \ |
| 111 | | MCFG_DEVICE_CONFIG(_intrf) \ |
| 112 | | MCFG_VIDEO_SET_SCREEN(_screen_tag) |
| 97 | #define MCFG_VT_SET_SCREEN MCFG_VIDEO_SET_SCREEN |
| 113 | 98 | |
| 114 | | #define MCFG_RAINBOW_VIDEO_ADD(_tag, _screen_tag, _intrf) \ |
| 115 | | MCFG_DEVICE_ADD(_tag, RAINBOW_VIDEO, 0) \ |
| 116 | | MCFG_DEVICE_CONFIG(_intrf) \ |
| 117 | | MCFG_VIDEO_SET_SCREEN(_screen_tag) |
| 99 | #define MCFG_VT_CHARGEN(_tag) \ |
| 100 | vt100_video_device::set_chargen_tag(*device, _tag); |
| 118 | 101 | |
| 102 | #define MCFG_VT_VIDEO_RAM_CALLBACK(_read) \ |
| 103 | devcb = &vt100_video_device::set_ram_rd_callback(*device, DEVCB2_##_read); |
| 119 | 104 | |
| 105 | #define MCFG_VT_VIDEO_CLEAR_VIDEO_INTERRUPT_CALLBACK(_write) \ |
| 106 | devcb = &vt100_video_device::set_clear_video_irq_wr_callback(*device, DEVCB2_##_write); |
| 120 | 107 | |
| 121 | 108 | #endif |
trunk/src/mess/drivers/vt100.c
| r29444 | r29445 | |
| 374 | 374 | m_vertical_int = 0; |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | | static const vt_video_interface vt100_video_interface = |
| 378 | | { |
| 379 | | "chargen", |
| 380 | | }; |
| 381 | | |
| 382 | 377 | INTERRUPT_GEN_MEMBER(vt100_state::vt100_vertical_interrupt) |
| 383 | 378 | { |
| 384 | 379 | m_vertical_int = 1; |
| r29444 | r29445 | |
| 425 | 420 | |
| 426 | 421 | MCFG_DEFAULT_LAYOUT( layout_vt100 ) |
| 427 | 422 | |
| 428 | | MCFG_VT100_VIDEO_ADD("vt100_video", "screen", vt100_video_interface) |
| 423 | MCFG_DEVICE_ADD("vt100_video", VT100_VIDEO, 0) |
| 424 | MCFG_VT_SET_SCREEN("screen") |
| 425 | MCFG_VT_CHARGEN("chargen") |
| 429 | 426 | MCFG_VT_VIDEO_RAM_CALLBACK(READ8(vt100_state, vt100_read_video_ram_r)) |
| 430 | 427 | MCFG_VT_VIDEO_CLEAR_VIDEO_INTERRUPT_CALLBACK(WRITELINE(vt100_state, vt100_clear_video_interrupt)) |
| 431 | 428 | |
trunk/src/mess/drivers/rainbow.c
| r29444 | r29445 | |
| 1143 | 1143 | m_irq_high = (state == ASSERT_LINE) ? 0x80 : 0; |
| 1144 | 1144 | } |
| 1145 | 1145 | |
| 1146 | | static const vt_video_interface video_interface = |
| 1147 | | { |
| 1148 | | "chargen", |
| 1149 | | }; |
| 1150 | | |
| 1151 | 1146 | /* F4 Character Displayer */ |
| 1152 | 1147 | static const gfx_layout rainbow_charlayout = |
| 1153 | 1148 | { |
| r29444 | r29445 | |
| 1211 | 1206 | MCFG_SCREEN_PALETTE("vt100_video:palette") |
| 1212 | 1207 | MCFG_GFXDECODE_ADD("gfxdecode", "vt100_video:palette", rainbow) |
| 1213 | 1208 | |
| 1214 | | MCFG_RAINBOW_VIDEO_ADD("vt100_video", "screen", video_interface) |
| 1209 | MCFG_DEVICE_ADD("vt100_video", RAINBOW_VIDEO, 0) |
| 1210 | MCFG_VT_SET_SCREEN("screen") |
| 1211 | MCFG_VT_CHARGEN("chargen") |
| 1215 | 1212 | MCFG_VT_VIDEO_RAM_CALLBACK(READ8(rainbow_state, read_video_ram_r)) |
| 1216 | 1213 | MCFG_VT_VIDEO_CLEAR_VIDEO_INTERRUPT_CALLBACK(WRITELINE(rainbow_state, clear_video_interrupt)) |
| 1217 | 1214 | |