Previous 199869 Revisions Next

r29255 Friday 4th April, 2014 at 12:35:14 UTC by Curt Coder
(MESS) tandy2k: WIP. (nw)
[src/emu/video]crt9007.c crt9007.h crt9021.c crt9021.h
[src/mess/drivers]tandy2k.c
[src/mess/includes]tandy2k.h

trunk/src/mess/includes/tandy2k.h
r29254r29255
5454      m_drb0(*this, CRT9212_0_TAG),
5555      m_drb1(*this, CRT9212_1_TAG),
5656      m_vac(*this, CRT9021B_TAG),
57      m_palette(*this, "palette"),
5758      m_centronics(*this, CENTRONICS_TAG),
5859      m_speaker(*this, "speaker"),
5960      m_ram(*this, RAM_TAG),
6061      m_floppy0(*this, I8272A_TAG ":0:525qd"),
6162      m_floppy1(*this, I8272A_TAG ":1:525qd"),
6263      m_kb(*this, TANDY2K_KEYBOARD_TAG),
63      m_kbdclk(0),
6464      m_hires_ram(*this, "hires_ram"),
65      m_char_ram(*this, "char_ram")
65      m_char_ram(*this, "char_ram"),
66      m_kbdclk(0)
6667   {
6768   }
6869
r29254r29255
7778   required_device<crt9212_t> m_drb0;
7879   required_device<crt9212_t> m_drb1;
7980   required_device<crt9021_t> m_vac;
81   required_device<palette_device> m_palette;
8082   required_device<centronics_device> m_centronics;
8183   required_device<speaker_sound_device> m_speaker;
8284   required_device<ram_device> m_ram;
8385   required_device<floppy_image_device> m_floppy0;
8486   required_device<floppy_image_device> m_floppy1;
8587   required_device<tandy2k_keyboard_device> m_kb;
88   required_shared_ptr<UINT16> m_hires_ram;
89   required_shared_ptr<UINT16> m_char_ram;
8690
8791   virtual void machine_start();
8892
89   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
90
9193   void speaker_update();
9294   void dma_request(int line, int state);
9395
r29254r29255
110112   DECLARE_WRITE8_MEMBER( ppi_pc_w );
111113   DECLARE_WRITE_LINE_MEMBER( vpac_vlt_w );
112114   DECLARE_WRITE_LINE_MEMBER( vpac_drb_w );
113   DECLARE_WRITE_LINE_MEMBER( vac_ld_ht_w );
115   DECLARE_WRITE_LINE_MEMBER( vpac_wben_w );
116   DECLARE_WRITE8_MEMBER( drb_attr_w );
114117   DECLARE_WRITE_LINE_MEMBER( kbdclk_w );
115118   DECLARE_WRITE_LINE_MEMBER( kbddat_w );
116119   DECLARE_READ8_MEMBER( irq_callback );
117120   DECLARE_WRITE_LINE_MEMBER( fdc_drq );
118   DECLARE_WRITE8_MEMBER( drb_attr_w );
121   CRT9021_DRAW_CHARACTER_MEMBER( vac_draw_character );
119122
120123   /* DMA state */
121124   UINT8 m_dma_mux;
r29254r29255
134137   int m_pb_sel;
135138
136139   /* video state */
137   required_shared_ptr<UINT16> m_hires_ram;
138   required_shared_ptr<UINT16> m_char_ram;
139   UINT16 m_palette[16];
140140   UINT8 m_vram_base;
141141   int m_vidouts;
142142   int m_clkspd;
trunk/src/mess/drivers/tandy2k.c
r29254r29255
306306
307307// Video
308308
309UINT32 tandy2k_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
310{
311   if (m_vidouts)
312   {
313      m_vac->screen_update(screen, bitmap, cliprect);
314   }
315
316   return 0;
317}
318/*
319static CRT9007_DRAW_SCANLINE( tandy2k_crt9007_display_pixels )
320{
321    tandy2k_state *state = device->machine().driver_data<tandy2k_state>();
322    address_space &program = state->m_maincpu->space(AS_PROGRAM);
323
324    for (int sx = 0; sx < x_count; sx++)
325    {
326        UINT32 videoram_addr = ((state->m_vram_base << 15) | (va << 1)) + sx;
327        UINT8 videoram_data = program.read_word(videoram_addr);
328        UINT16 charram_addr = (videoram_data << 4) | sl;
329        UINT8 charram_data = state->m_char_ram[charram_addr] & 0xff;
330
331        for (int bit = 0; bit < 10; bit++)
332        {
333            if (BIT(charram_data, 7))
334            {
335                bitmap.pix16(y, x + (sx * 10) + bit) = 1;
336            }
337
338            charram_data <<= 1;
339        }
340    }
341}
342*/
343
344309WRITE_LINE_MEMBER( tandy2k_state::vpac_vlt_w )
345310{
311   m_drb0->ren_w(state);
346312   m_drb0->clrcnt_w(state);
313
314   m_drb1->ren_w(state);
347315   m_drb1->clrcnt_w(state);
348316}
349317
r29254r29255
353321   m_drb1->tog_w(state);
354322}
355323
324WRITE_LINE_MEMBER( tandy2k_state::vpac_wben_w )
325{
326   m_drb0->wen1_w(state);
327   m_drb1->wen1_w(state);
328}
329
356330WRITE8_MEMBER( tandy2k_state::drb_attr_w )
357331{
358332   /*
r29254r29255
378352   m_vac->revid_w(BIT(data, 7));
379353}
380354
355CRT9021_DRAW_CHARACTER_MEMBER( tandy2k_state::vac_draw_character )
356{
357   const pen_t *pen = m_palette->pens();
358
359   for (int i = 0; i < 8; i++)
360   {
361      int color = BIT(video, 7 - i);
362
363      bitmap.pix32(y, x++) = pen[color];
364   }
365}
366
381367// Intel 8251A Interface
382368
383369WRITE_LINE_MEMBER( tandy2k_state::rxrdy_w )
r29254r29255
638624   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
639625   MCFG_SCREEN_REFRESH_RATE(50)
640626   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // not accurate
641   MCFG_SCREEN_UPDATE_DRIVER(tandy2k_state, screen_update)
642627   MCFG_SCREEN_SIZE(640, 480)
643628   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
629   MCFG_SCREEN_UPDATE_DEVICE(CRT9021B_TAG, crt9021_t, screen_update)
630   
631   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
644632
645633   MCFG_DEVICE_ADD(CRT9007_TAG, CRT9007, XTAL_16MHz*28/16)
646634   MCFG_DEVICE_ADDRESS_MAP(AS_0, vpac_mem)
r29254r29255
651639   MCFG_CRT9007_VLT_CALLBACK(WRITELINE(tandy2k_state, vpac_vlt_w))
652640   MCFG_CRT9007_CURS_CALLBACK(DEVWRITELINE(CRT9021B_TAG, crt9021_t, cursor_w))
653641   MCFG_CRT9007_DRB_CALLBACK(WRITELINE(tandy2k_state, vpac_drb_w))
642   MCFG_CRT9007_WBEN_CALLBACK(WRITELINE(tandy2k_state, vpac_wben_w))
654643   MCFG_CRT9007_CBLANK_CALLBACK(DEVWRITELINE(CRT9021B_TAG, crt9021_t, retbl_w))
655644   MCFG_CRT9007_SLG_CALLBACK(DEVWRITELINE(CRT9021B_TAG, crt9021_t, slg_w))
656645   MCFG_CRT9007_SLD_CALLBACK(DEVWRITELINE(CRT9021B_TAG, crt9021_t, sld_w))
r29254r29255
664653
665654   MCFG_DEVICE_ADD(CRT9021B_TAG, CRT9021, XTAL_16MHz*28/16/8)
666655   MCFG_VIDEO_SET_SCREEN(SCREEN_TAG)
667   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
668656
669657   // sound hardware
670658   MCFG_SPEAKER_STANDARD_MONO("mono")
trunk/src/emu/video/crt9007.c
r29254r29255
464464   m_write_vlt(*this),
465465   m_write_curs(*this),
466466   m_write_drb(*this),
467   m_write_wben(*this),
467468   m_write_cblank(*this),
468469   m_write_slg(*this),
469470   m_write_sld(*this)
r29254r29255
495496   m_write_vlt.resolve_safe();
496497   m_write_curs.resolve_safe();
497498   m_write_drb.resolve_safe();
499   m_write_wben.resolve_safe();
498500   m_write_cblank.resolve_safe();
499501   m_write_slg.resolve_safe();
500502   m_write_sld.resolve_safe();
r29254r29255
536538   m_write_dmar(CLEAR_LINE);
537539
538540   // 29 (WBEN) = 0
541   m_write_wben(1); // HACK
539542
540543   // 30 (SLG) = 0
541544   m_write_slg(0);
trunk/src/emu/video/crt9007.h
r29254r29255
7676#define MCFG_CRT9007_DRB_CALLBACK(_write) \
7777   devcb = &crt9007_t::set_drb_wr_callback(*device, DEVCB2_##_write);
7878
79#define MCFG_CRT9007_WBEN_CALLBACK(_write) \
80   devcb = &crt9007_t::set_wben_wr_callback(*device, DEVCB2_##_write);
81
7982#define MCFG_CRT9007_CBLANK_CALLBACK(_write) \
8083   devcb = &crt9007_t::set_cblank_wr_callback(*device, DEVCB2_##_write);
8184
r29254r29255
110113   template<class _Object> static devcb2_base &set_vlt_wr_callback(device_t &device, _Object object) { return downcast<crt9007_t &>(device).m_write_vlt.set_callback(object); }
111114   template<class _Object> static devcb2_base &set_curs_wr_callback(device_t &device, _Object object) { return downcast<crt9007_t &>(device).m_write_curs.set_callback(object); }
112115   template<class _Object> static devcb2_base &set_drb_wr_callback(device_t &device, _Object object) { return downcast<crt9007_t &>(device).m_write_drb.set_callback(object); }
116   template<class _Object> static devcb2_base &set_wben_wr_callback(device_t &device, _Object object) { return downcast<crt9007_t &>(device).m_write_wben.set_callback(object); }
113117   template<class _Object> static devcb2_base &set_cblank_wr_callback(device_t &device, _Object object) { return downcast<crt9007_t &>(device).m_write_cblank.set_callback(object); }
114118   template<class _Object> static devcb2_base &set_slg_wr_callback(device_t &device, _Object object) { return downcast<crt9007_t &>(device).m_write_slg.set_callback(object); }
115119   template<class _Object> static devcb2_base &set_sld_wr_callback(device_t &device, _Object object) { return downcast<crt9007_t &>(device).m_write_sld.set_callback(object); }
r29254r29255
165169   devcb2_write_line   m_write_vlt;
166170   devcb2_write_line   m_write_curs;
167171   devcb2_write_line   m_write_drb;
172   devcb2_write_line   m_write_wben;
168173   devcb2_write_line   m_write_cblank;
169174   devcb2_write_line   m_write_slg;
170175   devcb2_write_line   m_write_sld;
trunk/src/emu/video/crt9021.c
r29254r29255
132132   save_item(NAME(m_vsync));
133133   save_item(NAME(m_sr));
134134   save_item(NAME(m_intout));
135   save_item(NAME(m_sld));
135   save_item(NAME(m_sl));
136136}
137137
138138
trunk/src/emu/video/crt9021.h
r29254r29255
3939//  INTERFACE CONFIGURATION MACROS
4040//**************************************************************************
4141
42#define CRT9021_DRAW_CHARACTER_MEMBER(_name) void _name(bitmap_rgb32 &bitmap, int y, int x, UINT8 data, int intout)
42#define CRT9021_DRAW_CHARACTER_MEMBER(_name) void _name(bitmap_rgb32 &bitmap, int y, int x, UINT8 video, int intout)
4343
4444
4545#define MCFG_CRT9021_DRAW_CHARACTER_CALLBACK_OWNER(_class, _method) \
r29254r29255
5050//  TYPE DEFINITIONS
5151//**************************************************************************
5252
53typedef device_delegate<void (bitmap_rgb32 &bitmap, int y, int x, UINT8 data, int intout)> crt9021_draw_character_delegate;
53typedef device_delegate<void (bitmap_rgb32 &bitmap, int y, int x, UINT8 video, int intout)> crt9021_draw_character_delegate;
5454
5555
5656// ======================> crt9021_t

Previous 199869 Revisions Next


© 1997-2024 The MAME Team