Previous 199869 Revisions Next

r20587 Monday 28th January, 2013 at 18:37:28 UTC by Sandro Ronco
(MESS) Added KC0066 charset and replace hd44780/Psion charset. (nw)
[src/mess/drivers]alphasma.c psion.c
[src/mess/video]hd44780.c hd44780.h

trunk/src/mess/drivers/psion.c
r20586r20587
579579   ROM_REGION( 0x18000, "maincpu", ROMREGION_ERASEFF )
580580   ROM_SYSTEM_BIOS(0, "v44", "LZ64 v4.4")
581581   ROMX_LOAD( "44-lz64.dat",  0x8000, 0x10000, CRC(aa487913) SHA1(5a44390f63fc8c1bc94299ab2eb291bc3a5b989a), ROM_BIOS(1))
582
583   ROM_REGION( 0x1000, "hd44780", 0 )
584   ROM_LOAD( "psion_lz_charset.bin",    0x0000, 0x1000,  BAD_DUMP CRC(44bff6f6) SHA1(aef544548b783d608a7d55456f6c46f421a11ed7))
582585ROM_END
583586
584587ROM_START( psionlz64s )
585588   ROM_REGION( 0x18000, "maincpu", ROMREGION_ERASEFF )
586589   ROM_SYSTEM_BIOS(0, "v46", "LZ64 v4.6")
587590   ROMX_LOAD( "46-lz64s.dat", 0x8000, 0x10000, CRC(328d9772) SHA1(7f9e2d591d59ecfb0822d7067c2fe59542ea16dd), ROM_BIOS(1))
591
592   ROM_REGION( 0x1000, "hd44780", 0 )
593   ROM_LOAD( "psion_lz_charset.bin",    0x0000, 0x1000,  BAD_DUMP CRC(44bff6f6) SHA1(aef544548b783d608a7d55456f6c46f421a11ed7))
588594ROM_END
589595
590596ROM_START( psionlz )
591597   ROM_REGION( 0x18000, "maincpu", ROMREGION_ERASEFF )
592598   ROM_SYSTEM_BIOS(0, "v46", "LZ v4.6")
593599   ROMX_LOAD( "46-lz.dat",    0x8000, 0x10000, CRC(22715f48) SHA1(cf460c81cadb53eddb7afd8dadecbe8c38ea3fc2), ROM_BIOS(1))
600
601   ROM_REGION( 0x1000, "hd44780", 0 )
602   ROM_LOAD( "psion_lz_charset.bin",    0x0000, 0x1000,  BAD_DUMP CRC(44bff6f6) SHA1(aef544548b783d608a7d55456f6c46f421a11ed7))
594603ROM_END
595604
596605ROM_START( psionp464 )
597606   ROM_REGION( 0x18000, "maincpu", ROMREGION_ERASEFF )
598607   ROM_SYSTEM_BIOS(0, "v46", "POS464 v4.6")
599608   ROMX_LOAD( "46-p464.dat",  0x8000, 0x10000, CRC(672a0945) SHA1(d2a6e3fe1019d1bd7ae4725e33a0b9973f8cd7d8), ROM_BIOS(1))
609
610   ROM_REGION( 0x1000, "hd44780", 0 )
611   ROM_LOAD( "psion_lz_charset.bin",    0x0000, 0x1000,  BAD_DUMP CRC(44bff6f6) SHA1(aef544548b783d608a7d55456f6c46f421a11ed7))
600612ROM_END
601613
602614/* Driver */
trunk/src/mess/drivers/alphasma.c
r20586r20587
382382   MCFG_CPU_IO_MAP(alphasmart_io)
383383   MCFG_CPU_CONFIG(alphasmart_hc11_config)
384384
385   MCFG_HD44780_ADD("ks0066_0")
385   MCFG_KS0066_F05_ADD("ks0066_0")
386386   MCFG_HD44780_LCD_SIZE(2, 40)
387   MCFG_HD44780_ADD("ks0066_1")
387   MCFG_KS0066_F05_ADD("ks0066_1")
388388   MCFG_HD44780_LCD_SIZE(2, 40)
389389
390390   /* video hardware */
trunk/src/mess/video/hd44780.c
r20586r20587
1717//**************************************************************************
1818
1919const device_type HD44780 = &device_creator<hd44780_device>;
20const device_type KS0066_F05 = &device_creator<ks0066_f05_device>;
2021
2122
2223//-------------------------------------------------
2324//  ROM( hd44780 )
2425//-------------------------------------------------
2526
26ROM_START( hd44780 )
27   ROM_REGION( 0x0860, "cgrom", 0 )
28   ROM_LOAD( "44780a00.bin",    0x0000, 0x0860,  BAD_DUMP CRC(3a89024c) SHA1(5a87b68422a916d1b37b5be1f7ad0b3fb3af5a8d))
27ROM_START( hd44780_a00 )
28   ROM_REGION( 0x1000, "cgrom", 0 )
29   ROM_LOAD( "hd44780_a00.bin",    0x0000, 0x1000,  BAD_DUMP CRC(01d108e2) SHA1(bc0cdf0c9ba895f22e183c7bd35a3f655f2ca96f)) // from page 17 of the HD44780 datasheet
2930ROM_END
3031
32ROM_START( ks0066_f05 )
33   ROM_REGION( 0x1000, "cgrom", 0 )
34   ROM_LOAD( "ks0066_f05.bin",    0x0000, 0x1000,  BAD_DUMP CRC(af9e7bd6) SHA1(0196e871584ee5d370856e7307c0f9d1466e3e51)) // from page 51 of the KS0066 datasheet
35ROM_END
3136
3237//**************************************************************************
3338//  live device
r20586r20587
3843//-------------------------------------------------
3944
4045hd44780_device::hd44780_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
41   device_t(mconfig, HD44780, "HD44780", tag, owner, clock),
46   device_t(mconfig, HD44780, "HD44780 A00", tag, owner, clock),
4247   m_pixel_update_func(NULL)
4348{
44   m_shortname = "hd44780";
49   m_shortname = "hd44780_a00";
50   set_charset_type(CHARSET_HD44780_A00);
4551}
4652
4753hd44780_device::hd44780_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
4854   device_t(mconfig, type, name, tag, owner, clock),
4955   m_pixel_update_func(NULL)
5056{
51   m_shortname = "hd44780";
5257}
5358
59ks0066_f05_device::ks0066_f05_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
60   hd44780_device(mconfig, KS0066_F05, "KS0066 F05", tag, owner, clock)
61{
62   m_shortname = "ks0066_f05";
63   set_charset_type(CHARSET_KS0066_F05);
64}
65
66
5467//-------------------------------------------------
5568//  rom_region - device-specific ROM region
5669//-------------------------------------------------
5770
5871const rom_entry *hd44780_device::device_rom_region() const
5972{
60   return ROM_NAME( hd44780 );
73   switch (m_charset_type)
74   {
75      case CHARSET_HD44780_A00:   return ROM_NAME( hd44780_a00 );
76      case CHARSET_KS0066_F05:    return ROM_NAME( ks0066_f05 );
77   }
78
79   return NULL;
6180}
6281
6382//-------------------------------------------------
r20586r20587
149168//  HELPERS
150169//**************************************************************************
151170
171void hd44780_device::set_charset_type(int type)
172{
173   m_charset_type = type;
174}
175
152176void hd44780_device::set_busy_flag(UINT16 usec)
153177{
154178   m_busy_flag = true;
r20586r20587
194218   }
195219   else
196220   {
221      UINT8 line_heigh = (m_char_size == 8) ? m_char_size : m_char_size + 1;
222
197223      if (m_lines <= 2)
198224      {
199225         if (pos < m_chars)
200            bitmap.pix16(line * (m_char_size+1) + y, pos * 6 + x) = state;
226            bitmap.pix16(line * (line_heigh+1) + y, pos * 6 + x) = state;
201227      }
202228      else if (m_lines <= 4)
203229      {
r20586r20587
210236            }
211237
212238            if (line < m_lines)
213               bitmap.pix16(line * (m_char_size+1) + y, pos * 6 + x) = state;
239               bitmap.pix16(line * (line_heigh+1) + y, pos * 6 + x) = state;
214240         }
215241      }
216242      else
r20586r20587
256282               if (m_char_size == 8)
257283                  char_base = (m_ddram[char_pos] & 0x07) * 8;
258284               else
259                  char_base = (m_ddram[char_pos] & 0x03) * 16;
285                  char_base = ((m_ddram[char_pos]>>1) & 0x03) * 16;
260286            }
261287            else
262288            {
263289               // draw CGROM characters
264               if (m_ddram[char_pos] < 0xe0)
265                  char_base = m_ddram[char_pos] * 8;
266               else
267                  char_base = 0x700 + ((m_ddram[char_pos] - 0xe0) * 11);
290               char_base = m_ddram[char_pos] * 0x10;
268291            }
269292
270293            for (int y=0; y<m_char_size; y++)
r20586r20587
272295               UINT8 * charset = (m_ddram[char_pos] < 0x10) ? m_cgram : m_cgrom;
273296
274297               for (int x=0; x<5; x++)
275               {
276                  if (m_ddram[char_pos] >= 0xe0 || y < 8)
277                     pixel_update(bitmap, line, pos, y, x, BIT(charset[char_base + y], 4 - x));
278                  else
279                     pixel_update(bitmap, line, pos, y, x, 0);
280               }
298                  pixel_update(bitmap, line, pos, y, x, BIT(charset[char_base + y], 4 - x));
281299            }
282300
283301            // if is the correct position draw cursor and blink
284302            if (char_pos == m_ac)
285303            {
286304               // draw the cursor
305               UINT8 cursor_pos = (m_char_size == 8) ? m_char_size : m_char_size + 1;
287306               if (m_cursor_on)
288307                  for (int x=0; x<5; x++)
289                     pixel_update(bitmap, line, pos, m_char_size - 1, x, 1);
308                     pixel_update(bitmap, line, pos, cursor_pos - 1, x, 1);
290309
291310               if (!m_blink && m_blink_on)
292                  for (int y=0; y<(m_char_size - 1); y++)
311                  for (int y=0; y<(cursor_pos - 1); y++)
293312                     for (int x=0; x<5; x++)
294313                        pixel_update(bitmap, line, pos, y, x, 1);
295314            }
trunk/src/mess/video/hd44780.h
r20586r20587
1313#define MCFG_HD44780_ADD( _tag ) \
1414   MCFG_DEVICE_ADD( _tag, HD44780, 0 )
1515
16#define MCFG_KS0066_F05_ADD( _tag ) \
17   MCFG_DEVICE_ADD( _tag, KS0066_F05, 0 )
18
1619#define MCFG_HD44780_LCD_SIZE(_lines, _chars) \
1720   hd44780_device::static_set_lcd_size(*device, _lines, _chars);
1821
r20586r20587
5861   // optional information overrides
5962   const rom_entry *device_rom_region() const;
6063
64   // charset
65   enum
66   {
67      CHARSET_HD44780_A00,
68      CHARSET_KS0066_F05,
69      /*
70      CHARSET_HD44780_A01,
71      CHARSET_HD44780_A02,
72      CHARSET_KS0066_F00,
73      CHARSET_KS0066_F03,
74      CHARSET_KS0066_F04,
75      CHARSET_KS0066_F06,
76      CHARSET_KS0066_F59,
77      */
78   };
79
80   void set_charset_type(int type);
81
6182private:
6283   // internal helper
6384   void set_busy_flag(UINT16 usec);
r20586r20587
95116   bool        m_blink;
96117   bool        m_first_cmd;
97118   bool        m_nibble;
119   int         m_charset_type;
98120
99121   enum        { DDRAM, CGRAM };
100122};
101123
124// ======================> ks0066_f05_device
125
126class ks0066_f05_device :  public hd44780_device
127{
128public:
129   // construction/destruction
130   ks0066_f05_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
131};
132
102133// device type definition
103134extern const device_type HD44780;
135extern const device_type KS0066_F05;
104136
105137#endif

Previous 199869 Revisions Next


© 1997-2024 The MAME Team