Previous 199869 Revisions Next

r17510 Monday 27th August, 2012 at 17:56:31 UTC by Sandro Ronco
(MESS) HD44780: added an optional pixel_update callback in order to support custom LCD. (nw)
[src/mess/drivers]alesis.c lcmate2.c mmodular.c pc2000.c psion.c
[src/mess/video]hd44780.c hd44780.h

trunk/src/mess/video/hd44780.c
r17509r17510
3737   else
3838   {
3939      height = width = 0;
40      pixel_update_func = NULL;
4041   }
4142}
4243
r17509r17510
141142   m_busy_flag = 1;
142143
143144   m_busy_timer->adjust( attotime::from_usec( usec ) );
145}
144146
147inline void hd44780_device::pixel_update(bitmap_ind16 &bitmap, UINT8 line, UINT8 pos, UINT8 y, UINT8 x, int state)
148{
149   if (pixel_update_func != NULL)
150      pixel_update_func(*this, bitmap, line, pos, y, x, state);
151   else
152      bitmap.pix16(line*9 + y, pos*6 + x) = state;
145153}
146154
147155//**************************************************************************
r17509r17510
177185                  if (m_ddram[char_pos] <= 0x10)
178186                  {
179187                     //draw CGRAM characters
180                     bitmap.pix16(l*9 + y, i*6 + x) = BIT(m_cgram[(m_ddram[char_pos]&0x07)*8+y], 4-x);
188                     pixel_update(bitmap, l, i, y, x, BIT(m_cgram[(m_ddram[char_pos]&0x07)*8+y], 4-x));
181189                  }
182190                  else
183191                  {
184192                     //draw CGROM characters
185193                     if (region()->bytes() <= 0x800)
186194                     {
187                        bitmap.pix16(l*9 + y, i*6 + x) = BIT(region()->u8(m_ddram[char_pos]*8+y), 4-x);
195                        pixel_update(bitmap, l, i, y, x, BIT(region()->u8(m_ddram[char_pos]*8+y), 4-x));
188196                     }
189197                     else
190198                     {
191199                        if(m_ddram[char_pos] < 0xe0)
192                           bitmap.pix16(l*9 + y, i*6 + x) = BIT(region()->u8(m_ddram[char_pos]*8+y), 4-x);
200                           pixel_update(bitmap, l, i, y, x, BIT(region()->u8(m_ddram[char_pos]*8+y), 4-x));
193201                        else
194                           bitmap.pix16(l*9 + y, i*6 + x) = BIT(region()->u8(0x700+((m_ddram[char_pos]-0xe0)*11)+y), 4-x);
202                           pixel_update(bitmap, l, i, y, x, BIT(region()->u8(0x700+((m_ddram[char_pos]-0xe0)*11)+y), 4-x));
195203                     }
196204                  }
197205
r17509r17510
201209               //draw the cursor
202210               if (m_cursor_on)
203211                  for (int x=0; x<5; x++)
204                     bitmap.pix16(l*9 + 7, i * 6 + x) = 1;
212                     pixel_update(bitmap, l, i, 7, x, 1);
205213
206214               if (!m_blink && m_blink_on)
207215                  for (int y=0; y<7; y++)
208216                     for (int x=0; x<5; x++)
209                        bitmap.pix16(l*9 + y, i * 6 + x) = 1;
217                        pixel_update(bitmap, l, i, y, x, 1);
210218            }
211219         }
212220
trunk/src/mess/video/hd44780.h
r17509r17510
2121#define HD44780_INTERFACE(name) \
2222   const hd44780_interface (name) =
2323
24typedef void (*hd44780_pixel_update_func)(device_t &device, bitmap_ind16 &bitmap, UINT8 line, UINT8 pos, UINT8 y, UINT8 x, int state);
25#define HD44780_PIXEL_UPDATE(name) void name(device_t &device, bitmap_ind16 &bitmap, UINT8 line, UINT8 pos, UINT8 y, UINT8 x, int state)
26
2427// ======================> hd44780_interface
2528
2629struct hd44780_interface
2730{
2831   UINT8 height;         // number of lines
2932   UINT8 width;         // chars for line
33   hd44780_pixel_update_func pixel_update_func;   // pixel update callback
3034};
3135
3236// ======================> hd44780_device
r17509r17510
5963   // internal helper
6064   void set_busy_flag(UINT16 usec);
6165   void update_ac(void);
66   void pixel_update(bitmap_ind16 &bitmap, UINT8 line, UINT8 pos, UINT8 y, UINT8 x, int state);
6267   // internal state
6368   static const device_timer_id BUSY_TIMER = 0;
6469   static const device_timer_id BLINKING_TIMER = 1;
trunk/src/mess/drivers/lcmate2.c
r17509r17510
205205static HD44780_INTERFACE( lcmate2_display )
206206{
207207   2,               // number of lines
208   20               // chars for line
208   20,               // chars for line
209   NULL            // pixel update callback
209210};
210211
211212static const gfx_layout lcmate2_charlayout =
trunk/src/mess/drivers/pc2000.c
r17509r17510
319319static HD44780_INTERFACE( pc2000_display )
320320{
321321   2,               // number of lines
322   20               // chars for line
322   20,               // chars for line
323   NULL            // pixel update callback
323324};
324325
325326static MACHINE_CONFIG_START( pc2000, pc2000_state )
trunk/src/mess/drivers/mmodular.c
r17509r17510
191191static HD44780_INTERFACE( chess_display )
192192{
193193    2,                  // number of lines
194    16                  // chars for line
194    16,               // chars for line
195   NULL            // pixel update callback
195196};
196197
197198static UINT8 convert_imputmask(UINT8 input)
trunk/src/mess/drivers/alesis.c
r17509r17510
235235static HD44780_INTERFACE( hr16_display )
236236{
237237   2,               // number of lines
238   16               // chars for line
238   16,               // chars for line
239   NULL            // pixel update callback
239240};
240241
241242static HD44780_INTERFACE( sr16_display )
242243{
243244   2,               // number of lines
244   8               // chars for line
245   8,               // chars for line
246   NULL            // pixel update callback
245247};
246248
247249static const cassette_interface hr16_cassette_interface =
trunk/src/mess/drivers/psion.c
r17509r17510
463463static HD44780_INTERFACE( psion_2line_display )
464464{
465465   2,               // number of lines
466   16               // chars for line
466   16,               // chars for line
467   NULL            // pixel update callback
467468};
468469
469470/* basic configuration for 2 lines display */
r17509r17510
506507static HD44780_INTERFACE( psion_4line_display )
507508{
508509   4,               // number of lines
509   20               // chars for line
510   20,               // chars for line
511   NULL            // pixel update callback
510512};
511513
512514/* basic configuration for 4 lines display */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team