Previous 199869 Revisions Next

r23969 Thursday 27th June, 2013 at 06:42:24 UTC by Barry Rodewald
decodmd2: Updated to use MC6845_UPDATE_ROW, and corrected status return. (no whatsnew)
[src/mame/video]decodmd2.c decodmd2.h

trunk/src/mame/video/decodmd2.c
r23968r23969
5151{
5252   UINT8 ret = 0x00;
5353
54   ret = (m_status & 0x03) << 3;
54   ret = (m_status & 0x0f) << 3;
5555
5656   if(m_busy)
5757      return 0x80 | ret;
r23968r23969
7777   m_ctrl = data;
7878}
7979
80READ8_MEMBER( decodmd_type2_device::ctrl_r )
81{
82   return m_ctrl;
83}
84
8085READ8_MEMBER( decodmd_type2_device::status_r )
8186{
8287   return m_status;
r23968r23969
9297   m_cpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE);
9398}
9499
100MC6845_UPDATE_ROW( dmd_update_row )
101{
102   decodmd_type2_device *state = downcast<decodmd_type2_device *>(device->owner());
103   UINT8* RAM = state->m_ram->pointer();
104   UINT8 x,dot,intensity;
105   UINT16 addr = (ma & 0xfc00) + ((ma & 0x100)<<2) + (ra << 4);
106
107   for(x=0;x<128;x+=8)
108   {
109      for(dot=0;dot<8;dot++)
110      {
111         intensity = (RAM[addr] >> (7-dot) & 0x01) | ((RAM[addr+0x200] >> (7-dot) & 0x01) << 1);
112         bitmap.pix32(y,x+dot) = MAKE_RGB(0x3f*intensity,0x2a*intensity,0x00);
113      }
114      addr++;
115   }
116}
117
95118MC6845_INTERFACE( decodmd2_6845_intf )
96119{
97120   NULL,                                   /* screen name */
98121   false,                                  /* show border area */
99   16,                                     /* number of pixels per video memory address */
122   8,                                     /* number of pixels per video memory address */
100123   NULL,                                   /* begin_update */
101   NULL,                                   /* update_row */
124   dmd_update_row,                                   /* update_row */
102125   NULL,                                   /* end_update */
103126   DEVCB_NULL,      /* on_de_changed */
104127   DEVCB_NULL,      /* on_cur_changed */
r23968r23969
124147
125148   MCFG_QUANTUM_TIME(attotime::from_hz(60))
126149
127   MCFG_TIMER_DRIVER_ADD_PERIODIC("firq_timer",decodmd_type2_device,dmd_firq,attotime::from_hz(60))
150   MCFG_TIMER_DRIVER_ADD_PERIODIC("firq_timer",decodmd_type2_device,dmd_firq,attotime::from_hz(80))
128151
129152   MCFG_MC6845_ADD("dmd6845",MC6845,XTAL_8MHz / 8,decodmd2_6845_intf)  // TODO: confirm clock speed
130153
r23968r23969
133156   MCFG_SCREEN_ADD("dmd",RASTER)
134157   MCFG_SCREEN_SIZE(128, 32)
135158   MCFG_SCREEN_VISIBLE_AREA(0, 128-1, 0, 32-1)
136   MCFG_SCREEN_UPDATE_DRIVER(decodmd_type2_device, screen_update)
159   MCFG_SCREEN_UPDATE_DEVICE("dmd6845",mc6845_device, screen_update)
137160   MCFG_SCREEN_REFRESH_RATE(60)
138161
139162   MCFG_RAM_ADD(RAM_TAG)
r23968r23969
191214      m_romregion = NULL;
192215   }
193216}
194
195UINT32 decodmd_type2_device::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect )
196{
197   UINT16 addr = (START_ADDRESS & 0xfc00) | ((START_ADDRESS & 0x1ff) << 2);
198   UINT8* RAM = m_ram->pointer();
199   UINT8 x,y,dot,intensity;
200
201   for(y=0;y<bitmap.height();y++)
202   {
203      for(x=0;x<bitmap.width();x+=8)
204      {
205         for(dot=0;dot<8;dot++)
206         {
207            intensity = (RAM[addr] >> (7-dot) & 0x01) | ((RAM[addr+0x200] >> (7-dot) & 0x01) << 1);
208            bitmap.pix32(y,x+dot) = MAKE_RGB(0x3f*intensity,0x2a*intensity,0x00);
209         }
210         addr++;
211      }
212   }
213
214   return 0;
215}
trunk/src/mame/video/decodmd2.h
r23968r23969
4444   DECLARE_WRITE8_MEMBER(data_w);
4545   DECLARE_READ8_MEMBER(busy_r);
4646   DECLARE_WRITE8_MEMBER(ctrl_w);
47   DECLARE_READ8_MEMBER(ctrl_r);
4748   DECLARE_READ8_MEMBER(status_r);
4849   DECLARE_WRITE8_MEMBER(status_w);
4950   TIMER_DEVICE_CALLBACK_MEMBER(dmd_firq);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team