Previous 199869 Revisions Next

r29445 Tuesday 8th April, 2014 at 14:50:13 UTC by Fabio Priuli
(MESS) vtvideo: updated to use inline configs. nw.
[src/mess/drivers]rainbow.c vt100.c
[src/mess/video]vtvideo.c vtvideo.h

trunk/src/mess/video/vtvideo.c
r29444r29445
4949                  device_video_interface(mconfig, *this),
5050                  m_read_ram(*this),
5151                  m_write_clear_video_interrupt(*this),
52                  m_char_rom_tag(""),
5253                  m_palette(*this, "palette")
5354{
5455}
r29444r29445
5960                  device_video_interface(mconfig, *this),
6061                  m_read_ram(*this),
6162                  m_write_clear_video_interrupt(*this),
63                  m_char_rom_tag(""),
6264                  m_palette(*this, "palette")
6365{
6466}
r29444r29445
7173
7274
7375//-------------------------------------------------
74//  device_config_complete - perform any
75//  operations now that the configuration is
76//  complete
77//-------------------------------------------------
78
79void 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//-------------------------------------------------
9476//  device_start - device-specific startup
9577//-------------------------------------------------
9678
trunk/src/mess/video/vtvideo.h
r29444r29445
1515
1616#include "emu.h"
1717
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
24struct vt_video_interface
25{
26   const char *m_char_rom_tag; /* character rom region */
27};
28
29
3018class vt100_video_device : public device_t,
31                     public device_video_interface,
32                     public vt_video_interface
19                     public device_video_interface
3320{
3421public:
3522   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);
r29444r29445
3926   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); }
4027   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); }
4128
29   static void set_chargen_tag(device_t &device, const char *tag) { downcast<vt100_video_device &>(device).m_char_rom_tag = tag; }
30
4231   DECLARE_READ8_MEMBER(lba7_r);
4332   DECLARE_WRITE8_MEMBER(dc012_w);
4433   DECLARE_WRITE8_MEMBER(dc011_w);
r29444r29445
4736   virtual void video_update(bitmap_ind16 &bitmap, const rectangle &cliprect);
4837protected:
4938   // device-level overrides
50   virtual void device_config_complete();
5139   virtual void device_start();
5240   virtual void device_reset();
5341   virtual machine_config_constructor device_mconfig_additions() const;
r29444r29445
6755   bool MHFU_FLAG;
6856   int MHFU_counter;
6957
70
7158   // dc012 attributes
7259   UINT8 m_scroll_latch;
7360   UINT8 m_scroll_latch_valid;
r29444r29445
8269   UINT8 m_frequency;
8370   UINT8 m_interlaced;
8471
72   const char *m_char_rom_tag; /* character rom region */
8573   required_device<palette_device> m_palette;
8674};
8775
r29444r29445
10694extern const device_type RAINBOW_VIDEO;
10795
10896
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
11398
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);
118101
102#define MCFG_VT_VIDEO_RAM_CALLBACK(_read) \
103   devcb = &vt100_video_device::set_ram_rd_callback(*device, DEVCB2_##_read);
119104
105#define MCFG_VT_VIDEO_CLEAR_VIDEO_INTERRUPT_CALLBACK(_write) \
106   devcb = &vt100_video_device::set_clear_video_irq_wr_callback(*device, DEVCB2_##_write);
120107
121108#endif
trunk/src/mess/drivers/vt100.c
r29444r29445
374374   m_vertical_int = 0;
375375}
376376
377static const vt_video_interface vt100_video_interface =
378{
379   "chargen",
380};
381
382377INTERRUPT_GEN_MEMBER(vt100_state::vt100_vertical_interrupt)
383378{
384379   m_vertical_int = 1;
r29444r29445
425420
426421   MCFG_DEFAULT_LAYOUT( layout_vt100 )
427422
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")
429426   MCFG_VT_VIDEO_RAM_CALLBACK(READ8(vt100_state, vt100_read_video_ram_r))
430427   MCFG_VT_VIDEO_CLEAR_VIDEO_INTERRUPT_CALLBACK(WRITELINE(vt100_state, vt100_clear_video_interrupt))
431428
trunk/src/mess/drivers/rainbow.c
r29444r29445
11431143   m_irq_high = (state == ASSERT_LINE) ? 0x80 : 0;
11441144}
11451145
1146static const vt_video_interface video_interface =
1147{
1148   "chargen",
1149};
1150
11511146/* F4 Character Displayer */
11521147static const gfx_layout rainbow_charlayout =
11531148{
r29444r29445
12111206   MCFG_SCREEN_PALETTE("vt100_video:palette")
12121207   MCFG_GFXDECODE_ADD("gfxdecode", "vt100_video:palette", rainbow)
12131208
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")
12151212   MCFG_VT_VIDEO_RAM_CALLBACK(READ8(rainbow_state, read_video_ram_r))
12161213   MCFG_VT_VIDEO_CLEAR_VIDEO_INTERRUPT_CALLBACK(WRITELINE(rainbow_state, clear_video_interrupt))
12171214

Previous 199869 Revisions Next


© 1997-2024 The MAME Team