Previous 199869 Revisions Next

r40661 Thursday 10th September, 2015 at 03:15:46 UTC by Carl
pcd: implement pcx video device [Carl, Axel Muhr]
[scripts/target/mame]mess.lua
[src/emu/video]scn2674.c scn2674.h
[src/mess/drivers]pcd.c
[src/mess/machine]pcd_kbd.c
[src/mess/video]pcd.c* pcd.h*

trunk/scripts/target/mame/mess.lua
r249172r249173
22122212files {
22132213   MAME_DIR .. "src/mess/drivers/pcd.c",
22142214   MAME_DIR .. "src/mess/machine/pcd_kbd.c",
2215   MAME_DIR .. "src/mess/video/pcd.c",
22152216}
22162217
22172218createMESSProjects(_target, _subtarget, "slicer")
trunk/src/emu/video/scn2674.c
r249172r249173
3838   save_item(NAME(m_linecounter));
3939   save_item(NAME(m_screen2_l));
4040   save_item(NAME(m_screen2_h));
41   save_item(NAME(m_cursor_l));
42   save_item(NAME(m_cursor_h));
4143}
4244
4345void scn2674_device::device_reset()
r249172r249173
9496   m_spl1= 0;
9597   m_spl2= 0;
9698   m_dbl1= 0;
99   m_buffer= 0;
97100   m_linecounter= 0;
98101   m_irq_state= 0;
99102   m_IR_pointer = 0;
100103   m_address = 0;
104   m_start1change = 0;
101105   m_hpixels_per_column = m_text_hpixels_per_column;
102106}
103107
r249172r249173
246250         break;
247251
248252   }
249   if(m_display_enabled)
250      recompute_parameters();
253   recompute_parameters();
251254
252255   m_IR_pointer++;
253256   if (m_IR_pointer>14)m_IR_pointer=14;
r249172r249173
291294      /* Disable GFX */
292295      LOG2674(("disable GFX %02x\n",data));
293296      m_gfx_enabled = 0;
294      if(m_display_enabled)
295         recompute_parameters();
297      recompute_parameters();
296298   }
297299
298300   if ((data&0xe3)==0x23)
r249172r249173
300302      /* Enable GFX */
301303      LOG2674(("enable GFX %02x\n",data));
302304      m_gfx_enabled = 1;
303      if(m_display_enabled)
304         recompute_parameters();
305      recompute_parameters();
305306   }
306307
307308   if ((data&0xe9)==0x28)
r249172r249173
410411
411412   /* Delayed Commands */
412413   /* These set 0x20 in status register when done */
413
414   if (data == 0xa4)
414   // These use the pointer address according to the datasheet but the pcx expects the screen start 2 address instead
415   switch(data)
415416   {
416      /* read at pointer address */
417      LOG2674(("DELAYED read at pointer address %02x\n",data));
418   }
417      case 0xa4:
418         /* read at pointer address */
419         m_buffer = space().read_byte(m_screen2_l | (m_screen2_h << 8));
420         LOG2674(("DELAYED read at pointer address %02x\n",data));
421         break;
419422
420   if (data == 0xa2)
421   {
422      /* write at pointer address */
423      LOG2674(("DELAYED write at pointer address %02x\n",data));
424   }
423      case 0xa2:
424         /* write at pointer address */
425         space().write_byte(m_screen2_l | (m_screen2_h << 8), m_buffer);
426         LOG2674(("DELAYED write at pointer address %02x\n",data));
427         break;
425428
426   if (data == 0xa9)
427   {
428      /* increase cursor address */
429      LOG2674(("DELAYED increase cursor address %02x\n",data));
430   }
429      case 0xa9:
430         /* increment cursor address */
431         if(!(++m_cursor_l))
432            m_cursor_h++;
433         LOG2674(("DELAYED increase cursor address %02x\n",data));
434         break;
431435
432   if (data == 0xac)
433   {
434      /* read at cursor address */
435      LOG2674(("DELAYED read at cursor address %02x\n",data));
436   }
436      case 0xac:
437         /* read at cursor address */
438         m_buffer = space().read_byte(m_cursor_l | (m_cursor_h << 8));
439         LOG2674(("DELAYED read at cursor address %02x\n",data));
440         break;
437441
438   if (data == 0xaa)
439   {
440      /* write at cursor address */
441      LOG2674(("DELAYED write at cursor address %02x\n",data));
442   }
442      case 0xaa:
443         /* write at cursor address */
444         space().write_byte(m_cursor_l | (m_cursor_h << 8), m_buffer);
445         LOG2674(("DELAYED write at cursor address %02x\n",data));
446         break;
443447
444   if (data == 0xad)
445   {
446      /* read at cursor address + increment */
447      LOG2674(("DELAYED read at cursor address+increment %02x\n",data));
448   }
448      case 0xad:
449         /* read at cursor address + increment */
450         m_buffer = space().read_byte(m_cursor_l | (m_cursor_h << 8));
451         if(!(++m_cursor_l))
452            m_cursor_h++;
453         LOG2674(("DELAYED read at cursor address+increment %02x\n",data));
454         break;
449455
450   if (data == 0xab)
451   {
452      /* write at cursor address + increment */
453      LOG2674(("DELAYED write at cursor address+increment %02x\n",data));
454   }
456      case 0xab:
457         /* write at cursor address + increment */
458         space().write_byte(m_cursor_l | (m_cursor_h << 8), m_buffer);
459         if(!(++m_cursor_l))
460            m_cursor_h++;
461         LOG2674(("DELAYED write at cursor address+increment %02x\n",data));
462         break;
455463
456   if (data == 0xbb)
457   {
458      /* write from cursor address to pointer address */
459      LOG2674(("DELAYED write from cursor address to pointer address %02x\n",data));
460   }
464      case 0xbb:
465         /* write from cursor address to pointer address TODO: transfer only during blank*/
466         for(i = m_cursor_l | (m_cursor_h << 8); i != (m_screen2_l | (m_screen2_h << 8)); i = ((i + 1) & 0xffff))
467            space().write_byte(i, m_buffer);
468         space().write_byte(i, m_buffer); // get the last
469         m_cursor_l = m_screen2_l;
470         m_cursor_h = m_screen2_h;
471         LOG2674(("DELAYED write from cursor address to pointer address %02x\n",data));
472         break;
461473
462   if (data == 0xbd)
463   {
464      /* read from cursor address to pointer address */
465      LOG2674(("DELAYED read from cursor address to pointer address %02x\n",data));
474      case 0xbd:
475         /* read from cursor address to pointer address */
476         LOG2674(("DELAYED read from cursor address to pointer address %02x\n",data));
477         break;
466478   }
467479}
468480
r249172r249173
540552         write_command(data);
541553         break;
542554
543      case 2: m_screen1_l = data; break;
555      case 2:
556         m_screen1_l = data;
557         if(!m_screen->vblank())
558            m_start1change = (m_linecounter / m_IR0_scanline_per_char_row) + 1;
559         break;
544560      case 3:
545561         m_screen1_h = data;
546562         m_dbl1=(data & 0xc0)>>6;
r249172r249173
550566            m_screen1_h &= 0x3f;
551567            LOG2674(("IR14 - Double 1 overridden %02x\n",m_IR14_double_1));
552568         }
569         if(!m_screen->vblank())
570            m_start1change = (m_linecounter / m_IR0_scanline_per_char_row) + 1;
553571         break;
554572
555573      case 4: m_cursor_l  = data; break;
r249172r249173
572590   int max_visible_x = (m_IR5_character_per_row * m_hpixels_per_column) - 1;
573591   int max_visible_y = (m_IR4_rows_per_screen * m_IR0_scanline_per_char_row) - 1;
574592
593   if(!horiz_pix_total || !vert_pix_total)
594   {
595      m_scanline_timer->adjust(attotime::never);
596      return;
597   }
598
575599   LOG2674(("width %u height %u max_x %u max_y %u refresh %f\n", horiz_pix_total, vert_pix_total, max_visible_x, max_visible_y, 1 / ATTOSECONDS_TO_DOUBLE(refresh)));
576600
577601   rectangle visarea;
r249172r249173
594618            m_display_enabled_scanline = 0;
595619            m_display_enabled_field = 0;
596620         }
597         else if(!m_display_enabled)
598            break;
599621         else
600622            m_linecounter++;
601623
602         // should be triggered at the start of each ROW (line zero for that row)
603624         if(m_linecounter >= m_screen->height())
604625         {
605            m_status_register |= 0x08;
606            if (m_irq_mask & 0x08)
607            {
608               LOG2674(("SCN2674 Line Zero\n"));
609               m_irq_state = 1;
610               m_irq_register |= 0x08;
611               m_irq_cb(1);
612            }
613626            m_linecounter = 0;
614627            m_address = (m_screen1_h << 8) | m_screen1_l;
615628         }
r249172r249173
629642         if(m_linecounter >= (m_IR4_rows_per_screen * m_IR0_scanline_per_char_row))
630643            break;
631644
645         int charrow = m_linecounter % m_IR0_scanline_per_char_row;
646         int tilerow = charrow;
647
648         // should be triggered at the start of each ROW (line zero for that row)
649         if(!charrow)
650         {
651            m_status_register |= 0x08;
652            if (m_irq_mask & 0x08)
653            {
654               LOG2674(("SCN2674 Line Zero\n"));
655               m_irq_state = 1;
656               m_irq_register |= 0x08;
657               m_irq_cb(1);
658            }
659         }
660
632661         if((m_linecounter == (m_IR12_split_register_1 * m_IR0_scanline_per_char_row)) && m_linecounter) /* Split Screen 1 */
633662         {
634663            m_status_register |= 0x04;
r249172r249173
661690               dw = m_IR14_double_2;
662691         }
663692
664         int charrow = m_linecounter % m_IR0_scanline_per_char_row;
665         int tilerow = charrow;
693         if(!m_display_enabled)
694            break;
666695
667696         if(m_IR2_row_table)
668697         {
r249172r249173
684713               m_screen2_h = (addr >> 8) & 0x3f;
685714               m_screen2_l = addr & 0xff;
686715            }
687
688716         }
717         else if(m_start1change && (m_start1change == (m_linecounter / m_IR0_scanline_per_char_row)))
718         {
719            m_address = (m_screen1_h << 8) | m_screen1_l;
720            m_start1change = 0;
721         }
689722
690723         if(dw == 2)
691724            tilerow >>= 1;
trunk/src/emu/video/scn2674.h
r249172r249173
3737
3838   DECLARE_READ8_MEMBER( read );
3939   DECLARE_WRITE8_MEMBER( write );
40   DECLARE_READ8_MEMBER( buffer_r ) { return m_buffer; }
41   DECLARE_WRITE8_MEMBER( buffer_w ) { m_buffer = data; }
4042
4143   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
4244   virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_0) ? &m_space_config : NULL; }
r249172r249173
105107   UINT8 m_spl1;
106108   UINT8 m_spl2;
107109   UINT8 m_dbl1;
110   UINT8 m_buffer;
108111   int m_linecounter;
109112   UINT16 m_address;
113   int m_start1change;
110114
111115   UINT8 m_irq_state;
112116
trunk/src/mess/drivers/pcd.c
r249172r249173
1717#include "machine/wd_fdc.h"
1818#include "machine/mc146818.h"
1919#include "machine/pcd_kbd.h"
20#include "machine/terminal.h"
20#include "video/pcd.h"
2121#include "sound/speaker.h"
22#include "video/scn2674.h"
2322#include "formats/pc_dsk.h"
2423#include "bus/scsi/omti5100.h"
2524#include "bus/rs232/rs232.h"
r249172r249173
3938   m_speaker(*this, "speaker"),
4039   m_fdc(*this, "fdc"),
4140   m_rtc(*this, "rtc"),
42   m_crtc(*this, "crtc"),
43   m_palette(*this, "palette"),
44   m_gfxdecode(*this, "gfxdecode"),
4541   m_scsi(*this, "scsi"),
4642   m_scsi_data_out(*this, "scsi_data_out"),
4743   m_scsi_data_in(*this, "scsi_data_in"),
48   m_terminal(*this, "terminal"),
49   m_ram(*this, "ram"),
50   m_vram(*this, "vram"),
51   m_charram(8*1024)
44   m_ram(*this, "ram")
5245   { }
5346
5447   DECLARE_READ8_MEMBER( irq_callback );
r249172r249173
6356   DECLARE_WRITE8_MEMBER( stat_w );
6457   DECLARE_READ8_MEMBER( led_r );
6558   DECLARE_WRITE8_MEMBER( led_w );
66   DECLARE_READ8_MEMBER( detect_r );
67   DECLARE_WRITE8_MEMBER( detect_w );
6859   DECLARE_READ16_MEMBER( dskctl_r );
6960   DECLARE_WRITE16_MEMBER( dskctl_w );
70   DECLARE_READ8_MEMBER( mcu_r );
71   DECLARE_WRITE8_MEMBER( mcu_w );
61
7262   DECLARE_READ8_MEMBER( scsi_r );
7363   DECLARE_WRITE8_MEMBER( scsi_w );
74   DECLARE_WRITE8_MEMBER( vram_sw_w );
75   DECLARE_WRITE16_MEMBER( vram_w );
7664   DECLARE_READ16_MEMBER( mmu_r );
7765   DECLARE_WRITE16_MEMBER( mmu_w );
7866   DECLARE_READ16_MEMBER( mem_r );
7967   DECLARE_WRITE16_MEMBER( mem_w );
80   DECLARE_READ8_MEMBER( exp_r );
81   DECLARE_WRITE8_MEMBER( exp_w );
82   DECLARE_WRITE8_MEMBER( term_key_w );
83   SCN2674_DRAW_CHARACTER_MEMBER(display_pixels);
68
8469   DECLARE_FLOPPY_FORMATS( floppy_formats );
8570   DECLARE_WRITE_LINE_MEMBER(write_scsi_bsy);
8671   DECLARE_WRITE_LINE_MEMBER(write_scsi_cd);
r249172r249173
10186   required_device<speaker_sound_device> m_speaker;
10287   required_device<wd2793_t> m_fdc;
10388   required_device<mc146818_device> m_rtc;
104   required_device<scn2674_device> m_crtc;
105   required_device<palette_device> m_palette;
106   required_device<gfxdecode_device> m_gfxdecode;
10789   required_device<SCSI_PORT_DEVICE> m_scsi;
10890   required_device<output_latch_device> m_scsi_data_out;
10991   required_device<input_buffer_device> m_scsi_data_in;
110   optional_device<generic_terminal_device> m_terminal;
11192   required_device<ram_device> m_ram;
112   required_shared_ptr<UINT16> m_vram;
113   dynamic_buffer m_charram;
114   UINT8 m_stat, m_led, m_vram_sw, m_term_key;
93   UINT8 m_stat, m_led;
11594   int m_msg, m_bsy, m_io, m_cd, m_req, m_rst;
11695   emu_timer *m_req_hack;
11796   UINT16 m_dskctl;
r249172r249173
128107//  MACHINE EMULATION
129108//**************************************************************************
130109
131static const gfx_layout pcd_charlayout =
132{
133   8, 14,                   /* 8 x 14 characters */
134   512,                    /* 512 characters */
135   1,                  /* 1 bits per pixel */
136   { 0 },                  /* no bitplanes */
137   /* x offsets */
138   { 0, 1, 2, 3, 4, 5, 6, 7 },
139   /* y offsets */
140   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8 },
141   8*16
142};
143
144110void pcd_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
145111{
146112   // TODO: remove this hack
r249172r249173
150116
151117void pcd_state::machine_start()
152118{
153   m_gfxdecode->set_gfx(0, global_alloc(gfx_element(machine().device<palette_device>("palette"), pcd_charlayout, &m_charram[0], 0, 1, 0)));
154119   m_req_hack = timer_alloc();
155120   save_item(NAME(m_mmu.ctl));
156121   save_item(NAME(m_mmu.regs));
r249172r249173
161126   m_stat = 0;
162127   m_led = 0;
163128   m_dskctl = 0;
164   m_vram_sw = 1;
165129   m_rst = 0;
166130   m_mmu.ctl = 0;
167131   m_mmu.sc = false;
168   m_mmu.type = ioport("mmu")->read();
169   m_term_key = 0;
132   if(ioport("mmu"))
133      m_mmu.type = ioport("mmu")->read();
134   else
135      m_mmu.type = 0;
170136}
171137
172138READ8_MEMBER( pcd_state::irq_callback )
r249172r249173
185151   m_speaker->level_w(state);
186152}
187153
188WRITE16_MEMBER( pcd_state::vram_w )
189{
190   if(m_vram_sw)
191      COMBINE_DATA(&m_vram[offset]);
192   else if(mem_mask & 0xff)
193   {
194      m_charram[offset & 0x1fff] = data;
195      m_gfxdecode->gfx(0)->mark_dirty(offset/16);
196   }
197}
198
199WRITE8_MEMBER( pcd_state::vram_sw_w )
200{
201   m_vram_sw = data & 1;
202}
203
204154READ8_MEMBER( pcd_state::nmi_io_r )
205155{
206156   if(space.debugger_access())
r249172r249173
242192   m_stat &= ~data;
243193}
244194
245READ8_MEMBER( pcd_state::detect_r )
246{
247   return 0;
248}
249
250WRITE8_MEMBER( pcd_state::detect_w )
251{
252}
253
254READ8_MEMBER( pcd_state::mcu_r )
255{
256   return 0x20;
257}
258
259WRITE8_MEMBER( pcd_state::mcu_w )
260{
261}
262
263195READ16_MEMBER( pcd_state::dskctl_r )
264196{
265197   return m_dskctl;
r249172r249173
337269   }
338270}
339271
340SCN2674_DRAW_CHARACTER_MEMBER(pcd_state::display_pixels)
341{
342   if(lg)
343   {
344      UINT16 data = m_vram[address];
345      data = (data >> 8) | (data << 8);
346      for(int i = 0; i < 16; i++)
347         bitmap.pix32(y, x + i) = m_palette->pen((data & (1 << (15 - i))) ? 1 : 0);
348   }
349   else
350   {
351      UINT8 data = m_charram[(m_vram[address] & 0xff) * 16 + linecount];
352      if(cursor && blink)
353         data = 0xff;
354      for(int i = 0; i < 8; i++)
355         bitmap.pix32(y, x + i) = m_palette->pen((data & (1 << (7 - i))) ? 1 : 0);
356   }
357}
358
359272READ8_MEMBER(pcd_state::scsi_r)
360273{
361274   UINT8 ret = 0;
r249172r249173
495408   return ram[offset];
496409}
497410
498// The PC-X treats the graphics board as a serial port.  Maybe the 8031 (instead of 8047) can
499// write directly to the video ram and there's a char ROM instead of RAM?
500READ8_MEMBER(pcd_state::exp_r)
501{
502   if(m_dskctl & 0x40)
503   {
504      if(!offset)
505      {
506         UINT8 data = m_term_key;
507         m_term_key = 0;
508         return data;
509      }
510      else
511      {
512         m_pic2->ir0_w(CLEAR_LINE);
513         return (m_term_key ? 1 : 0);
514      }
515   }
516   else if(offset & 1)
517      return m_crtc->read(space, offset/2);
518   return 0xff;
519}
520
521WRITE8_MEMBER(pcd_state::exp_w)
522{
523   if(m_dskctl & 0x40)
524   {
525      if(!offset)
526      {
527         m_pic2->ir0_w(ASSERT_LINE);
528         m_terminal->write(space, 0, data);
529      }
530   }
531   else if(!(offset & 1))
532      return m_crtc->write(space, offset/2, data);
533}
534
535WRITE8_MEMBER(pcd_state::term_key_w)
536{
537   m_pic2->ir0_w(ASSERT_LINE);
538   m_term_key = data;
539}
540
541411//**************************************************************************
542412//  ADDRESS MAPS
543413//**************************************************************************
544414
545415static ADDRESS_MAP_START( pcd_map, AS_PROGRAM, 16, pcd_state )
546416   AM_RANGE(0x00000, 0x7ffff) AM_READWRITE(mem_r, mem_w)
547   AM_RANGE(0xf0000, 0xf7fff) AM_READONLY AM_WRITE(vram_w) AM_SHARE("vram")
548417   AM_RANGE(0xfc000, 0xfffff) AM_ROM AM_REGION("bios", 0)
549418   AM_RANGE(0x00000, 0xfffff) AM_READWRITE8(nmi_io_r, nmi_io_w, 0xffff)
550419ADDRESS_MAP_END
551420
552421static ADDRESS_MAP_START( pcd_io, AS_IO, 16, pcd_state )
553422   ADDRESS_MAP_UNMAP_HIGH
554   AM_RANGE(0x8000, 0x8fff) AM_READWRITE(mmu_r, mmu_w)
555423   AM_RANGE(0x0000, 0xefff) AM_READWRITE8(nmi_io_r, nmi_io_w, 0xffff)
556424   AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_SHARE("nvram")
557425   AM_RANGE(0xf800, 0xf801) AM_DEVREADWRITE8("pic1", pic8259_device, read, write, 0xffff)
r249172r249173
562430   AM_RANGE(0xf900, 0xf903) AM_DEVREADWRITE8("fdc", wd2793_t, read, write, 0xffff)
563431   AM_RANGE(0xf904, 0xf905) AM_READWRITE(dskctl_r, dskctl_w)
564432   AM_RANGE(0xf940, 0xf943) AM_READWRITE8(scsi_r, scsi_w, 0xffff)
565   AM_RANGE(0xf980, 0xf98f) AM_DEVWRITE8("crtc", scn2674_device, write, 0x00ff)
566   AM_RANGE(0xf980, 0xf98f) AM_DEVREAD8("crtc", scn2674_device, read, 0xff00)
567   AM_RANGE(0xf9a0, 0xf9a1) AM_WRITE8(vram_sw_w, 0x00ff)
568   AM_RANGE(0xf9b0, 0xf9b3) AM_READWRITE8(mcu_r, mcu_w, 0x00ff) // 8741 comms
433   AM_RANGE(0xf980, 0xf98f) AM_DEVICE("video", pcdx_video_device, map)
569434   AM_RANGE(0xf9c0, 0xf9c3) AM_DEVREADWRITE8("usart1",mc2661_device,read,write,0xffff)  // UARTs
570435   AM_RANGE(0xf9d0, 0xf9d3) AM_DEVREADWRITE8("usart2",mc2661_device,read,write,0xffff)
571436   AM_RANGE(0xf9e0, 0xf9e3) AM_DEVREADWRITE8("usart3",mc2661_device,read,write,0xffff)
572437//  AM_RANGE(0xfa00, 0xfa7f) // pcs4-n (peripheral chip select)
573   AM_RANGE(0xfb00, 0xfb01) AM_READWRITE8(detect_r, detect_w, 0xff00) // expansion card detection?
574438   AM_RANGE(0xfb00, 0xffff) AM_READWRITE8(nmi_io_r, nmi_io_w, 0xffff)
575439ADDRESS_MAP_END
576440
577441static ADDRESS_MAP_START( pcx_io, AS_IO, 16, pcd_state )
578442   ADDRESS_MAP_UNMAP_HIGH
579   AM_RANGE(0xf980, 0xf98f) AM_READWRITE8(exp_r, exp_w, 0xffff)
443   AM_RANGE(0x8000, 0x8fff) AM_READWRITE(mmu_r, mmu_w)
444   AM_RANGE(0xfb00, 0xfb01) AM_READWRITE8(nmi_io_r, nmi_io_w, 0xff00)
580445   AM_IMPORT_FROM(pcd_io)
581446ADDRESS_MAP_END
582447
r249172r249173
593458   FLOPPY_PC_FORMAT
594459FLOPPY_FORMATS_END
595460
596static INPUT_PORTS_START(pcd)
461static INPUT_PORTS_START(pcx)
597462   PORT_START("mmu")
598463   PORT_CONFNAME(0x03, 0x00, "MMU Type")
599464   PORT_CONFSETTING(0x00, "None")
r249172r249173
608473   MCFG_80186_TMROUT1_HANDLER(WRITELINE(pcd_state, i186_timer1_w))
609474   MCFG_80186_IRQ_SLAVE_ACK(READ8(pcd_state, irq_callback))
610475
611   MCFG_CPU_ADD("graphics", I8741, XTAL_16MHz/2)
612   MCFG_DEVICE_DISABLE()
613
614476   MCFG_TIMER_DRIVER_ADD_PERIODIC("timer0_tick", pcd_state, timer0_tick, attotime::from_hz(XTAL_16MHz / 24)) // adjusted to pass post
615477
616478   MCFG_PIC8259_ADD("pic1", DEVWRITELINE("maincpu", i80186_cpu_device, int0_w), VCC, NULL)
617479   MCFG_PIC8259_ADD("pic2", DEVWRITELINE("maincpu", i80186_cpu_device, int1_w), VCC, NULL)
618480
481   MCFG_DEVICE_ADD("video", PCD_VIDEO, 0)
482
619483   MCFG_RAM_ADD(RAM_TAG)
620484   MCFG_RAM_DEFAULT_SIZE("1M")
621485
r249172r249173
656520   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
657521   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
658522
659   // video hardware
660   MCFG_SCREEN_ADD("screen", RASTER)
661   MCFG_SCREEN_SIZE(640, 350)
662   MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 349)
663   MCFG_SCREEN_REFRESH_RATE(50)
664   MCFG_SCREEN_UPDATE_DEVICE("crtc", scn2674_device, screen_update)
665
666   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
667   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
668
669   MCFG_SCN2674_VIDEO_ADD("crtc", 0, NULL);
670   MCFG_SCN2674_TEXT_CHARACTER_WIDTH(8)
671   MCFG_SCN2674_GFX_CHARACTER_WIDTH(16)
672   MCFG_SCN2674_DRAW_CHARACTER_CALLBACK_OWNER(pcd_state, display_pixels)
673   MCFG_VIDEO_SET_SCREEN("screen")
674
675523   // rtc
676524   MCFG_MC146818_ADD("rtc", XTAL_32_768kHz)
677525   MCFG_MC146818_IRQ_HANDLER(DEVWRITELINE("pic1", pic8259_device, ir7_w))
r249172r249173
696544   MCFG_CPU_MODIFY("maincpu")
697545   MCFG_CPU_IO_MAP(pcx_io)
698546
699   // FIXME: temporary workaround
700   MCFG_DEVICE_ADD("terminal", GENERIC_TERMINAL, 0)
701   MCFG_GENERIC_TERMINAL_KEYBOARD_CB(WRITE8(pcd_state, term_key_w))
547   MCFG_DEVICE_REPLACE("video", PCX_VIDEO, 0)
548   MCFG_PCX_VIDEO_TXD_HANDLER(DEVWRITELINE("keyboard", pcd_keyboard_device, t0_w))
702549
703   MCFG_DEVICE_REMOVE("graphics")
550   MCFG_DEVICE_MODIFY("keyboard")
551   MCFG_PCD_KEYBOARD_OUT_TX_HANDLER(DEVWRITELINE("video", pcx_video_device, rx_w))
552
553   MCFG_DEVICE_MODIFY("usart2")
554   MCFG_MC2661_TXD_HANDLER(NULL)
704555MACHINE_CONFIG_END
705556
706557//**************************************************************************
r249172r249173
715566   ROM_SYSTEM_BIOS(1, "v3", "V3 GS4") // from mainboard SYBAC S26361-D359 V3 GS4
716567   ROMX_LOAD("361d0359.d42", 0x0001, 0x2000, CRC(5b4461e4) SHA1(db6756aeabb2e6d3921dc7571a5bed3497b964bf), ROM_SKIP(1) | ROM_BIOS(2))
717568   ROMX_LOAD("361d0359.d43", 0x0000, 0x2000, CRC(71c3189d) SHA1(e8dd6c632bfc833074d3a833ea7f59bb5460f313), ROM_SKIP(1) | ROM_BIOS(2))
718
719   // gfx card (scn2674 with 8741), to be moved
720   ROM_REGION(0x400, "graphics", 0)
721   ROM_LOAD("s36361-d321-v1.bin", 0x000, 0x400, CRC(69baeb2a) SHA1(98b9cd0f38c51b4988a3aed0efcf004bedd115ff))
722569ROM_END
723570
724571ROM_START( pcx )
r249172r249173
735582//  GAME DRIVERS
736583//**************************************************************************
737584
738COMP( 1984, pcd, 0, 0, pcd, pcd, driver_device, 0, "Siemens", "PC-D", MACHINE_NOT_WORKING )
739COMP( 1984, pcx, pcd, 0, pcx, pcd, driver_device, 0, "Siemens", "PC-X", MACHINE_NOT_WORKING )
585COMP( 1984, pcd, 0, 0, pcd, 0, driver_device, 0, "Siemens", "PC-D", MACHINE_NOT_WORKING )
586COMP( 1984, pcx, pcd, 0, pcx, pcx, driver_device, 0, "Siemens", "PC-X", MACHINE_NOT_WORKING )
trunk/src/mess/machine/pcd_kbd.c
r249172r249173
77ROM_START( pcd_keyboard )
88   ROM_REGION(0x1000, "mcu", 0)
99   ROM_LOAD("pcd_keyboard.bin", 0x0000, 0x1000, CRC(d227d6cb) SHA1(3d6140764d3d043428c941826370ebf1597c63bd))
10   ROM_FILL(0x526,1,0x03) // make the PCX video happy, TODO: figure out what's really happening
11   ROM_FILL(0x1e1,1,0x50) // fix csum
1012ROM_END
1113
1214
trunk/src/mess/video/pcd.c
r0r249173
1// license:BSD-3-Clause
2// copyright-holders:Carl
3
4#include "pcd.h"
5#include "cpu/mcs51/mcs51.h"
6#include "cpu/mcs48/mcs48.h"
7
8const device_type PCD_VIDEO = &device_creator<pcd_video_device>;
9const device_type PCX_VIDEO = &device_creator<pcx_video_device>;
10
11pcdx_video_device::pcdx_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) :
12   device_t(mconfig, type, name, tag, owner, clock, shortname, source),
13   m_maincpu(*this, ":maincpu"),
14   m_mcu(*this, "graphics"),
15   m_crtc(*this, "crtc"),
16   m_palette(*this, "palette"),
17   m_gfxdecode(*this, "gfxdecode")
18{
19}
20
21pcd_video_device::pcd_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
22   pcdx_video_device(mconfig, PCD_VIDEO, "Siemens PC-D Video", tag, owner, clock, "pcd_video", __FILE__),
23   m_vram(32*1024),
24   m_charram(8*1024)
25{
26}
27
28pcx_video_device::pcx_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
29   pcdx_video_device(mconfig, PCX_VIDEO, "Siemens PC-X Video", tag, owner, clock, "pcx_video", __FILE__),
30   device_serial_interface(mconfig, *this),
31   m_vram(4*1024),
32   m_charrom(*this, "char"),
33   m_pic2(*this, ":pic2"),
34   m_txd_handler(*this)
35{
36}
37
38ROM_START( pcd_video )
39   ROM_REGION(0x400, "graphics", 0)
40   ROM_LOAD("s36361-d321-v1.bin", 0x000, 0x400, CRC(69baeb2a) SHA1(98b9cd0f38c51b4988a3aed0efcf004bedd115ff))
41ROM_END
42
43const rom_entry *pcd_video_device::device_rom_region() const
44{
45   return ROM_NAME( pcd_video );
46}
47
48ROM_START( pcx_video )
49   ROM_REGION(0x2000, "char", 0)
50   ROM_LOAD("d12-graka.bin", 0x0000, 0x2000, CRC(e4933c16) SHA1(932ae1f0cd2b029b7f5fc3d2d1679e70b25c0828))
51
52   ROM_REGION(0x6000, "graphics", 0)
53   ROM_LOAD("d40-graka.bin", 0x0000, 0x2000, CRC(dce48252) SHA1(0d9a575b2d001168a36864d7bd5db1c3aca5fb8d))
54   ROM_LOAD("d39-graka.bin", 0x4000, 0x2000, CRC(02920e25) SHA1(145a6648d75c1dc4788f9bc7790281ef7e8f8426))
55ROM_END
56
57const rom_entry *pcx_video_device::device_rom_region() const
58{
59   return ROM_NAME( pcx_video );
60}
61
62static const gfx_layout pcd_charlayout =
63{
64   8, 14,                   /* 8 x 14 characters */
65   512,                    /* 512 characters */
66   1,                  /* 1 bits per pixel */
67   { 0 },                  /* no bitplanes */
68   /* x offsets */
69   { 0, 1, 2, 3, 4, 5, 6, 7 },
70   /* y offsets */
71   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8 },
72   8*16
73};
74
75static GFXDECODE_START( pcx )
76   GFXDECODE_ENTRY( "char", 0x0000, pcd_charlayout, 0, 1 )
77GFXDECODE_END
78
79static MACHINE_CONFIG_FRAGMENT( pcd_video )
80   MCFG_CPU_ADD("graphics", I8741, XTAL_16MHz/2)
81   MCFG_DEVICE_DISABLE()
82
83   // video hardware
84   MCFG_SCREEN_ADD("screen", RASTER)
85   MCFG_SCREEN_SIZE(640, 350)
86   MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 349)
87   MCFG_SCREEN_REFRESH_RATE(50)
88   MCFG_SCREEN_UPDATE_DEVICE("crtc", scn2674_device, screen_update)
89
90   MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
91   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
92
93   MCFG_SCN2674_VIDEO_ADD("crtc", 0, NULL);
94   MCFG_SCN2674_TEXT_CHARACTER_WIDTH(8)
95   MCFG_SCN2674_GFX_CHARACTER_WIDTH(16)
96   MCFG_SCN2674_DRAW_CHARACTER_CALLBACK_OWNER(pcd_video_device, display_pixels)
97   MCFG_VIDEO_SET_SCREEN("screen")
98MACHINE_CONFIG_END
99
100machine_config_constructor pcd_video_device::device_mconfig_additions() const
101{
102   return MACHINE_CONFIG_NAME( pcd_video );
103}
104
105static ADDRESS_MAP_START( pcx_vid_map, AS_PROGRAM, 8, pcx_video_device )
106   AM_RANGE(0x0000, 0x5fff) AM_ROM AM_REGION("graphics", 0)
107ADDRESS_MAP_END
108
109static ADDRESS_MAP_START( pcx_vid_io, AS_IO, 8, pcx_video_device )
110   AM_RANGE(0x8000, 0x8007) AM_DEVREADWRITE("crtc", scn2674_device, read, write)
111   AM_RANGE(0x8008, 0x8008) AM_READ(unk_r)
112   AM_RANGE(0xa000, 0xa001) AM_READWRITE(vram_latch_r, vram_latch_w)
113   AM_RANGE(0xa002, 0xa003) AM_READWRITE(term_mcu_r, term_mcu_w)
114   AM_RANGE(0xc000, 0xc7ff) AM_RAM
115ADDRESS_MAP_END
116
117static ADDRESS_MAP_START( pcx_vram, AS_0, 8, pcx_video_device )
118   AM_RANGE(0x0000, 0x07ff) AM_READWRITE(vram_r, vram_w)
119ADDRESS_MAP_END
120
121static MACHINE_CONFIG_FRAGMENT( pcx_video )
122   MCFG_CPU_ADD("graphics", I8031, XTAL_24MHz/2)
123   MCFG_CPU_PROGRAM_MAP(pcx_vid_map)
124   MCFG_CPU_IO_MAP(pcx_vid_io)
125
126   // video hardware
127   MCFG_SCREEN_ADD("screen", RASTER)
128   MCFG_SCREEN_SIZE(640, 350)
129   MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 349)
130   MCFG_SCREEN_REFRESH_RATE(50)
131   MCFG_SCREEN_UPDATE_DEVICE("crtc", scn2674_device, screen_update)
132
133   MCFG_GFXDECODE_ADD("gfxdecode", "palette", pcx)
134   MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
135
136   MCFG_SCN2674_VIDEO_ADD("crtc", 0, INPUTLINE("graphics", MCS51_INT0_LINE));
137   MCFG_SCN2674_TEXT_CHARACTER_WIDTH(8)
138   MCFG_SCN2674_GFX_CHARACTER_WIDTH(16)
139   MCFG_SCN2674_DRAW_CHARACTER_CALLBACK_OWNER(pcx_video_device, display_pixels)
140   MCFG_VIDEO_SET_SCREEN("screen")
141   MCFG_DEVICE_ADDRESS_MAP(AS_0, pcx_vram)
142MACHINE_CONFIG_END
143
144machine_config_constructor pcx_video_device::device_mconfig_additions() const
145{
146   return MACHINE_CONFIG_NAME( pcx_video );
147}
148
149SCN2674_DRAW_CHARACTER_MEMBER(pcd_video_device::display_pixels)
150{
151   address <<= 1;
152   if(lg)
153   {
154      UINT16 data = m_vram[address + 1] | (m_vram[address] << 8);
155      for(int i = 0; i < 16; i++)
156         bitmap.pix32(y, x + i) = m_palette->pen((data & (1 << (15 - i))) ? 1 : 0);
157   }
158   else
159   {
160      UINT8 data;
161      data = m_charram[m_vram[address] * 16 + linecount];
162      if(cursor && blink)
163         data = 0xff;
164      for(int i = 0; i < 8; i++)
165         bitmap.pix32(y, x + i) = m_palette->pen((data & (1 << (7 - i))) ? 1 : 0);
166   }
167}
168
169SCN2674_DRAW_CHARACTER_MEMBER(pcx_video_device::display_pixels)
170{
171   UINT8 data;
172   address <<= 1;
173   data = m_charrom[m_vram[address] * 16 + linecount + (m_vram[address + 1] & 0x20 ? 4096 : 0)];
174   if(cursor && blink)
175      data = 0xff;
176   for(int i = 0; i < 8; i++)
177      bitmap.pix32(y, x + i) = m_palette->pen((data & (1 << (7 - i))) ? 1 : 0);
178}
179
180WRITE8_MEMBER(pcd_video_device::vram_w)
181{
182   if(m_vram_sw)
183      m_vram[offset] = data;
184   else if(!(offset & 1))
185   {
186      offset >>= 1;
187      m_charram[offset & 0x1fff] = data;
188      m_gfxdecode->gfx(0)->mark_dirty(offset/16);
189   }
190}
191
192READ8_MEMBER(pcd_video_device::vram_r)
193{
194   return m_vram[offset];
195}
196
197WRITE8_MEMBER(pcd_video_device::vram_sw_w)
198{
199   m_vram_sw = data & 1;
200}
201
202
203READ8_MEMBER(pcd_video_device::mcu_r)
204{
205   return 0x20;
206}
207
208WRITE8_MEMBER(pcd_video_device::mcu_w)
209{
210}
211
212READ8_MEMBER(pcx_video_device::term_r)
213{
214   switch(offset)
215   {
216      case 0:
217         m_pic2->ir0_w(CLEAR_LINE);
218         m_term_stat &= ~2;
219         return m_term_key;
220      case 1:
221         m_pic2->ir0_w(CLEAR_LINE);
222         return m_term_stat >> 1;
223   }
224   return 0xff;
225}
226
227WRITE8_MEMBER(pcx_video_device::term_w)
228{
229   if(!offset)
230   {
231      m_mcu->set_input_line(MCS51_INT1_LINE, ASSERT_LINE);
232      m_term_char = data;
233      m_term_stat |= 4;
234   }
235}
236
237READ8_MEMBER(pcx_video_device::term_mcu_r)
238{
239   switch(offset)
240   {
241      case 0:
242         m_mcu->set_input_line(MCS51_INT1_LINE, CLEAR_LINE);
243         m_pic2->ir0_w(ASSERT_LINE);
244         m_term_stat &= ~4;
245         return m_term_char;
246      case 1:
247         return m_term_stat;
248   }
249   return 0;
250}
251
252WRITE8_MEMBER(pcx_video_device::term_mcu_w)
253{
254   if(!offset)
255   {
256      m_term_key = data;
257      m_pic2->ir0_w(ASSERT_LINE);
258      m_term_stat |= 2;
259   }
260}
261
262WRITE8_MEMBER(pcx_video_device::vram_w)
263{
264   offset <<= 1;
265   m_vram[offset] = m_vram_latch_w[0];
266   m_vram[offset+1] = m_vram_latch_w[1];
267}
268
269READ8_MEMBER(pcx_video_device::vram_r)
270{
271   offset <<= 1;
272   m_vram_latch_r[0] = m_vram[offset];
273   m_vram_latch_r[1] = m_vram[offset+1];
274   return m_vram[offset];
275}
276
277WRITE8_MEMBER(pcx_video_device::vram_latch_w)
278{
279   m_vram_latch_w[offset] = data;
280}
281
282READ8_MEMBER(pcx_video_device::vram_latch_r)
283{
284   return m_vram_latch_r[offset];
285}
286
287READ8_MEMBER(pcdx_video_device::detect_r)
288{
289   return 0;
290}
291
292WRITE8_MEMBER(pcdx_video_device::detect_w)
293{
294}
295
296READ8_MEMBER(pcx_video_device::unk_r)
297{
298   return 0x80;
299}
300
301void pcd_video_device::device_start()
302{
303   m_maincpu->space(AS_IO).install_write_handler(0xf9a0, 0xf9a1, 0, 0, write8_delegate(FUNC(pcd_video_device::vram_sw_w), this), 0x00ff);
304   m_maincpu->space(AS_IO).install_readwrite_handler(0xf9b0, 0xf9b3, 0, 0, read8_delegate(FUNC(pcd_video_device::mcu_r), this), write8_delegate(FUNC(pcd_video_device::mcu_w), this), 0x00ff);
305   m_maincpu->space(AS_IO).install_readwrite_handler(0xfb00, 0xfb01, 0, 0, read8_delegate(FUNC(pcdx_video_device::detect_r), this), write8_delegate(FUNC(pcdx_video_device::detect_w), this), 0xff00);
306   m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xf0000, 0xf7fff, 0, 0, read8_delegate(FUNC(pcd_video_device::vram_r), this), write8_delegate(FUNC(pcd_video_device::vram_w), this), 0xffff);
307   m_gfxdecode->set_gfx(0, global_alloc(gfx_element(machine().device<palette_device>("palette"), pcd_charlayout, &m_charram[0], 0, 1, 0)));
308}
309
310void pcd_video_device::device_reset()
311{
312   m_vram_sw = 1;
313}
314
315
316DEVICE_ADDRESS_MAP_START(map, 16, pcd_video_device)
317   AM_RANGE(0x0, 0xf) AM_DEVWRITE8("crtc", scn2674_device, write, 0x00ff)
318   AM_RANGE(0x0, 0xf) AM_DEVREAD8("crtc", scn2674_device, read, 0xff00)
319ADDRESS_MAP_END
320
321void pcx_video_device::device_start()
322{
323   mcs51_cpu_device *mcu = downcast<mcs51_cpu_device *>(m_mcu.target());
324   m_maincpu->space(AS_IO).install_readwrite_handler(0xfb00, 0xfb01, 0, 0, read8_delegate(FUNC(pcdx_video_device::detect_r), this), write8_delegate(FUNC(pcdx_video_device::detect_w), this), 0x00ff);
325   m_txd_handler.resolve_safe();
326
327   // set serial callbacks
328   mcu->i8051_set_serial_tx_callback(WRITE8_DELEGATE(pcx_video_device, tx_callback));
329   mcu->i8051_set_serial_rx_callback(READ8_DELEGATE(pcx_video_device, rx_callback));
330   set_data_frame(1, 8, PARITY_NONE, STOP_BITS_1);
331   set_rate(600*2);  // FIXME: fix the keyboard when the mc2661 baud rate calc is fixed
332}
333
334void pcx_video_device::device_reset()
335{
336   m_term_key = 0;
337   m_term_stat = 0;
338   transmit_register_reset();
339   receive_register_reset();
340
341   m_txd_handler(1);
342}
343
344DEVICE_ADDRESS_MAP_START(map, 16, pcx_video_device)
345   AM_RANGE(0x0, 0xf) AM_READWRITE8(term_r, term_w, 0xffff)
346ADDRESS_MAP_END
347
348READ8_MEMBER(pcx_video_device::rx_callback)
349{
350   return get_received_char();
351}
352
353WRITE8_MEMBER(pcx_video_device::tx_callback)
354{
355   transmit_register_setup(data);
356}
357
358void pcx_video_device::tra_callback()
359{
360   m_txd_handler(transmit_register_get_data_bit());
361}
362
363void pcx_video_device::rcv_complete()
364{
365   receive_register_extract();
366   m_mcu->set_input_line(MCS51_RX_LINE, ASSERT_LINE);
367   m_mcu->set_input_line(MCS51_RX_LINE, CLEAR_LINE);
368}
369
370void pcx_video_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
371{
372   device_serial_interface::device_timer(timer, id, param, ptr);
373}
trunk/src/mess/video/pcd.h
r0r249173
1// license:BSD-3-Clause
2// copyright-holders:Carl
3
4#ifndef _PCD_H_
5#define _PCD_H_
6
7#include "emu.h"
8#include "machine/pic8259.h"
9#include "video/scn2674.h"
10
11#define MCFG_PCX_VIDEO_TXD_HANDLER(_devcb) \
12   devcb = &pcx_video_device::set_txd_handler(*device, DEVCB_##_devcb);
13
14class pcdx_video_device : public device_t
15{
16public:
17   pcdx_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);
18
19   virtual DECLARE_ADDRESS_MAP(map, 16) = 0;
20   DECLARE_READ8_MEMBER(detect_r);
21   DECLARE_WRITE8_MEMBER(detect_w);
22protected:
23   required_device<cpu_device> m_maincpu;
24   required_device<cpu_device> m_mcu;
25   required_device<scn2674_device> m_crtc;
26   required_device<palette_device> m_palette;
27   required_device<gfxdecode_device> m_gfxdecode;
28};
29
30class pcd_video_device : public pcdx_video_device
31{
32public:
33   pcd_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
34
35   DECLARE_ADDRESS_MAP(map, 16);
36   DECLARE_ADDRESS_MAP(vram_map, 8);
37   DECLARE_READ8_MEMBER(mcu_r);
38   DECLARE_WRITE8_MEMBER(mcu_w);
39   DECLARE_WRITE8_MEMBER(vram_sw_w);
40   DECLARE_READ8_MEMBER(vram_r);
41   DECLARE_WRITE8_MEMBER(vram_w);
42
43   virtual const rom_entry *device_rom_region() const;
44   virtual machine_config_constructor device_mconfig_additions() const;
45   SCN2674_DRAW_CHARACTER_MEMBER(display_pixels);
46protected:
47   void device_start();
48   void device_reset();
49private:
50   dynamic_buffer m_vram;
51   dynamic_buffer m_charram;
52   UINT8 m_vram_sw;
53};
54
55class pcx_video_device : public pcdx_video_device,
56                   public device_serial_interface
57{
58public:
59   pcx_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
60   template<class _Object> static devcb_base &set_txd_handler(device_t &device, _Object object) { return downcast<pcx_video_device &>(device).m_txd_handler.set_callback(object); }
61
62   DECLARE_ADDRESS_MAP(map, 16);
63   DECLARE_READ8_MEMBER(term_r);
64   DECLARE_WRITE8_MEMBER(term_w);
65   DECLARE_READ8_MEMBER(term_mcu_r);
66   DECLARE_WRITE8_MEMBER(term_mcu_w);
67   DECLARE_READ8_MEMBER(rx_callback);
68   DECLARE_WRITE8_MEMBER(tx_callback);
69   DECLARE_READ8_MEMBER(vram_r);
70   DECLARE_WRITE8_MEMBER(vram_w);
71   DECLARE_READ8_MEMBER(vram_latch_r);
72   DECLARE_WRITE8_MEMBER(vram_latch_w);
73   DECLARE_READ8_MEMBER(unk_r);
74
75   virtual const rom_entry *device_rom_region() const;
76   virtual machine_config_constructor device_mconfig_additions() const;
77   SCN2674_DRAW_CHARACTER_MEMBER(display_pixels);
78protected:
79   void device_start();
80   void device_reset();
81   void tra_callback();
82   void rcv_complete();
83   void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
84private:
85   dynamic_buffer m_vram;
86   required_region_ptr<UINT8> m_charrom;
87   required_device<pic8259_device> m_pic2;
88   devcb_write_line m_txd_handler;
89   UINT8 m_term_key, m_term_char, m_term_stat, m_vram_latch_r[2], m_vram_latch_w[2];
90};
91
92extern const device_type PCD_VIDEO;
93extern const device_type PCX_VIDEO;
94
95#endif


Previous 199869 Revisions Next


© 1997-2024 The MAME Team