mirror of
https://github.com/holub/mame
synced 2025-07-05 18:08:04 +03:00
(MESS) Added KC0066 charset and replace hd44780/Psion charset. (nw)
This commit is contained in:
parent
810931598b
commit
1b6a762bd3
@ -382,9 +382,9 @@ static MACHINE_CONFIG_START( alphasmart, alphasmart_state )
|
|||||||
MCFG_CPU_IO_MAP(alphasmart_io)
|
MCFG_CPU_IO_MAP(alphasmart_io)
|
||||||
MCFG_CPU_CONFIG(alphasmart_hc11_config)
|
MCFG_CPU_CONFIG(alphasmart_hc11_config)
|
||||||
|
|
||||||
MCFG_HD44780_ADD("ks0066_0")
|
MCFG_KS0066_F05_ADD("ks0066_0")
|
||||||
MCFG_HD44780_LCD_SIZE(2, 40)
|
MCFG_HD44780_LCD_SIZE(2, 40)
|
||||||
MCFG_HD44780_ADD("ks0066_1")
|
MCFG_KS0066_F05_ADD("ks0066_1")
|
||||||
MCFG_HD44780_LCD_SIZE(2, 40)
|
MCFG_HD44780_LCD_SIZE(2, 40)
|
||||||
|
|
||||||
/* video hardware */
|
/* video hardware */
|
||||||
|
@ -579,24 +579,36 @@ ROM_START( psionlz64 )
|
|||||||
ROM_REGION( 0x18000, "maincpu", ROMREGION_ERASEFF )
|
ROM_REGION( 0x18000, "maincpu", ROMREGION_ERASEFF )
|
||||||
ROM_SYSTEM_BIOS(0, "v44", "LZ64 v4.4")
|
ROM_SYSTEM_BIOS(0, "v44", "LZ64 v4.4")
|
||||||
ROMX_LOAD( "44-lz64.dat", 0x8000, 0x10000, CRC(aa487913) SHA1(5a44390f63fc8c1bc94299ab2eb291bc3a5b989a), ROM_BIOS(1))
|
ROMX_LOAD( "44-lz64.dat", 0x8000, 0x10000, CRC(aa487913) SHA1(5a44390f63fc8c1bc94299ab2eb291bc3a5b989a), ROM_BIOS(1))
|
||||||
|
|
||||||
|
ROM_REGION( 0x1000, "hd44780", 0 )
|
||||||
|
ROM_LOAD( "psion_lz_charset.bin", 0x0000, 0x1000, BAD_DUMP CRC(44bff6f6) SHA1(aef544548b783d608a7d55456f6c46f421a11ed7))
|
||||||
ROM_END
|
ROM_END
|
||||||
|
|
||||||
ROM_START( psionlz64s )
|
ROM_START( psionlz64s )
|
||||||
ROM_REGION( 0x18000, "maincpu", ROMREGION_ERASEFF )
|
ROM_REGION( 0x18000, "maincpu", ROMREGION_ERASEFF )
|
||||||
ROM_SYSTEM_BIOS(0, "v46", "LZ64 v4.6")
|
ROM_SYSTEM_BIOS(0, "v46", "LZ64 v4.6")
|
||||||
ROMX_LOAD( "46-lz64s.dat", 0x8000, 0x10000, CRC(328d9772) SHA1(7f9e2d591d59ecfb0822d7067c2fe59542ea16dd), ROM_BIOS(1))
|
ROMX_LOAD( "46-lz64s.dat", 0x8000, 0x10000, CRC(328d9772) SHA1(7f9e2d591d59ecfb0822d7067c2fe59542ea16dd), ROM_BIOS(1))
|
||||||
|
|
||||||
|
ROM_REGION( 0x1000, "hd44780", 0 )
|
||||||
|
ROM_LOAD( "psion_lz_charset.bin", 0x0000, 0x1000, BAD_DUMP CRC(44bff6f6) SHA1(aef544548b783d608a7d55456f6c46f421a11ed7))
|
||||||
ROM_END
|
ROM_END
|
||||||
|
|
||||||
ROM_START( psionlz )
|
ROM_START( psionlz )
|
||||||
ROM_REGION( 0x18000, "maincpu", ROMREGION_ERASEFF )
|
ROM_REGION( 0x18000, "maincpu", ROMREGION_ERASEFF )
|
||||||
ROM_SYSTEM_BIOS(0, "v46", "LZ v4.6")
|
ROM_SYSTEM_BIOS(0, "v46", "LZ v4.6")
|
||||||
ROMX_LOAD( "46-lz.dat", 0x8000, 0x10000, CRC(22715f48) SHA1(cf460c81cadb53eddb7afd8dadecbe8c38ea3fc2), ROM_BIOS(1))
|
ROMX_LOAD( "46-lz.dat", 0x8000, 0x10000, CRC(22715f48) SHA1(cf460c81cadb53eddb7afd8dadecbe8c38ea3fc2), ROM_BIOS(1))
|
||||||
|
|
||||||
|
ROM_REGION( 0x1000, "hd44780", 0 )
|
||||||
|
ROM_LOAD( "psion_lz_charset.bin", 0x0000, 0x1000, BAD_DUMP CRC(44bff6f6) SHA1(aef544548b783d608a7d55456f6c46f421a11ed7))
|
||||||
ROM_END
|
ROM_END
|
||||||
|
|
||||||
ROM_START( psionp464 )
|
ROM_START( psionp464 )
|
||||||
ROM_REGION( 0x18000, "maincpu", ROMREGION_ERASEFF )
|
ROM_REGION( 0x18000, "maincpu", ROMREGION_ERASEFF )
|
||||||
ROM_SYSTEM_BIOS(0, "v46", "POS464 v4.6")
|
ROM_SYSTEM_BIOS(0, "v46", "POS464 v4.6")
|
||||||
ROMX_LOAD( "46-p464.dat", 0x8000, 0x10000, CRC(672a0945) SHA1(d2a6e3fe1019d1bd7ae4725e33a0b9973f8cd7d8), ROM_BIOS(1))
|
ROMX_LOAD( "46-p464.dat", 0x8000, 0x10000, CRC(672a0945) SHA1(d2a6e3fe1019d1bd7ae4725e33a0b9973f8cd7d8), ROM_BIOS(1))
|
||||||
|
|
||||||
|
ROM_REGION( 0x1000, "hd44780", 0 )
|
||||||
|
ROM_LOAD( "psion_lz_charset.bin", 0x0000, 0x1000, BAD_DUMP CRC(44bff6f6) SHA1(aef544548b783d608a7d55456f6c46f421a11ed7))
|
||||||
ROM_END
|
ROM_END
|
||||||
|
|
||||||
/* Driver */
|
/* Driver */
|
||||||
|
@ -17,17 +17,22 @@
|
|||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
|
|
||||||
const device_type HD44780 = &device_creator<hd44780_device>;
|
const device_type HD44780 = &device_creator<hd44780_device>;
|
||||||
|
const device_type KS0066_F05 = &device_creator<ks0066_f05_device>;
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// ROM( hd44780 )
|
// ROM( hd44780 )
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
ROM_START( hd44780 )
|
ROM_START( hd44780_a00 )
|
||||||
ROM_REGION( 0x0860, "cgrom", 0 )
|
ROM_REGION( 0x1000, "cgrom", 0 )
|
||||||
ROM_LOAD( "44780a00.bin", 0x0000, 0x0860, BAD_DUMP CRC(3a89024c) SHA1(5a87b68422a916d1b37b5be1f7ad0b3fb3af5a8d))
|
ROM_LOAD( "hd44780_a00.bin", 0x0000, 0x1000, BAD_DUMP CRC(01d108e2) SHA1(bc0cdf0c9ba895f22e183c7bd35a3f655f2ca96f)) // from page 17 of the HD44780 datasheet
|
||||||
ROM_END
|
ROM_END
|
||||||
|
|
||||||
|
ROM_START( ks0066_f05 )
|
||||||
|
ROM_REGION( 0x1000, "cgrom", 0 )
|
||||||
|
ROM_LOAD( "ks0066_f05.bin", 0x0000, 0x1000, BAD_DUMP CRC(af9e7bd6) SHA1(0196e871584ee5d370856e7307c0f9d1466e3e51)) // from page 51 of the KS0066 datasheet
|
||||||
|
ROM_END
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
// live device
|
// live device
|
||||||
@ -38,26 +43,40 @@ ROM_END
|
|||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
hd44780_device::hd44780_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
hd44780_device::hd44780_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||||
device_t(mconfig, HD44780, "HD44780", tag, owner, clock),
|
device_t(mconfig, HD44780, "HD44780 A00", tag, owner, clock),
|
||||||
m_pixel_update_func(NULL)
|
m_pixel_update_func(NULL)
|
||||||
{
|
{
|
||||||
m_shortname = "hd44780";
|
m_shortname = "hd44780_a00";
|
||||||
|
set_charset_type(CHARSET_HD44780_A00);
|
||||||
}
|
}
|
||||||
|
|
||||||
hd44780_device::hd44780_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
|
hd44780_device::hd44780_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
|
||||||
device_t(mconfig, type, name, tag, owner, clock),
|
device_t(mconfig, type, name, tag, owner, clock),
|
||||||
m_pixel_update_func(NULL)
|
m_pixel_update_func(NULL)
|
||||||
{
|
{
|
||||||
m_shortname = "hd44780";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ks0066_f05_device::ks0066_f05_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||||
|
hd44780_device(mconfig, KS0066_F05, "KS0066 F05", tag, owner, clock)
|
||||||
|
{
|
||||||
|
m_shortname = "ks0066_f05";
|
||||||
|
set_charset_type(CHARSET_KS0066_F05);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// rom_region - device-specific ROM region
|
// rom_region - device-specific ROM region
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
const rom_entry *hd44780_device::device_rom_region() const
|
const rom_entry *hd44780_device::device_rom_region() const
|
||||||
{
|
{
|
||||||
return ROM_NAME( hd44780 );
|
switch (m_charset_type)
|
||||||
|
{
|
||||||
|
case CHARSET_HD44780_A00: return ROM_NAME( hd44780_a00 );
|
||||||
|
case CHARSET_KS0066_F05: return ROM_NAME( ks0066_f05 );
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -149,6 +168,11 @@ void hd44780_device::device_timer(emu_timer &timer, device_timer_id id, int para
|
|||||||
// HELPERS
|
// HELPERS
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
|
|
||||||
|
void hd44780_device::set_charset_type(int type)
|
||||||
|
{
|
||||||
|
m_charset_type = type;
|
||||||
|
}
|
||||||
|
|
||||||
void hd44780_device::set_busy_flag(UINT16 usec)
|
void hd44780_device::set_busy_flag(UINT16 usec)
|
||||||
{
|
{
|
||||||
m_busy_flag = true;
|
m_busy_flag = true;
|
||||||
@ -194,10 +218,12 @@ inline void hd44780_device::pixel_update(bitmap_ind16 &bitmap, UINT8 line, UINT8
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
UINT8 line_heigh = (m_char_size == 8) ? m_char_size : m_char_size + 1;
|
||||||
|
|
||||||
if (m_lines <= 2)
|
if (m_lines <= 2)
|
||||||
{
|
{
|
||||||
if (pos < m_chars)
|
if (pos < m_chars)
|
||||||
bitmap.pix16(line * (m_char_size+1) + y, pos * 6 + x) = state;
|
bitmap.pix16(line * (line_heigh+1) + y, pos * 6 + x) = state;
|
||||||
}
|
}
|
||||||
else if (m_lines <= 4)
|
else if (m_lines <= 4)
|
||||||
{
|
{
|
||||||
@ -210,7 +236,7 @@ inline void hd44780_device::pixel_update(bitmap_ind16 &bitmap, UINT8 line, UINT8
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (line < m_lines)
|
if (line < m_lines)
|
||||||
bitmap.pix16(line * (m_char_size+1) + y, pos * 6 + x) = state;
|
bitmap.pix16(line * (line_heigh+1) + y, pos * 6 + x) = state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -256,15 +282,12 @@ UINT32 hd44780_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap
|
|||||||
if (m_char_size == 8)
|
if (m_char_size == 8)
|
||||||
char_base = (m_ddram[char_pos] & 0x07) * 8;
|
char_base = (m_ddram[char_pos] & 0x07) * 8;
|
||||||
else
|
else
|
||||||
char_base = (m_ddram[char_pos] & 0x03) * 16;
|
char_base = ((m_ddram[char_pos]>>1) & 0x03) * 16;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// draw CGROM characters
|
// draw CGROM characters
|
||||||
if (m_ddram[char_pos] < 0xe0)
|
char_base = m_ddram[char_pos] * 0x10;
|
||||||
char_base = m_ddram[char_pos] * 8;
|
|
||||||
else
|
|
||||||
char_base = 0x700 + ((m_ddram[char_pos] - 0xe0) * 11);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int y=0; y<m_char_size; y++)
|
for (int y=0; y<m_char_size; y++)
|
||||||
@ -272,24 +295,20 @@ UINT32 hd44780_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap
|
|||||||
UINT8 * charset = (m_ddram[char_pos] < 0x10) ? m_cgram : m_cgrom;
|
UINT8 * charset = (m_ddram[char_pos] < 0x10) ? m_cgram : m_cgrom;
|
||||||
|
|
||||||
for (int x=0; x<5; x++)
|
for (int x=0; x<5; x++)
|
||||||
{
|
|
||||||
if (m_ddram[char_pos] >= 0xe0 || y < 8)
|
|
||||||
pixel_update(bitmap, line, pos, y, x, BIT(charset[char_base + y], 4 - x));
|
pixel_update(bitmap, line, pos, y, x, BIT(charset[char_base + y], 4 - x));
|
||||||
else
|
|
||||||
pixel_update(bitmap, line, pos, y, x, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if is the correct position draw cursor and blink
|
// if is the correct position draw cursor and blink
|
||||||
if (char_pos == m_ac)
|
if (char_pos == m_ac)
|
||||||
{
|
{
|
||||||
// draw the cursor
|
// draw the cursor
|
||||||
|
UINT8 cursor_pos = (m_char_size == 8) ? m_char_size : m_char_size + 1;
|
||||||
if (m_cursor_on)
|
if (m_cursor_on)
|
||||||
for (int x=0; x<5; x++)
|
for (int x=0; x<5; x++)
|
||||||
pixel_update(bitmap, line, pos, m_char_size - 1, x, 1);
|
pixel_update(bitmap, line, pos, cursor_pos - 1, x, 1);
|
||||||
|
|
||||||
if (!m_blink && m_blink_on)
|
if (!m_blink && m_blink_on)
|
||||||
for (int y=0; y<(m_char_size - 1); y++)
|
for (int y=0; y<(cursor_pos - 1); y++)
|
||||||
for (int x=0; x<5; x++)
|
for (int x=0; x<5; x++)
|
||||||
pixel_update(bitmap, line, pos, y, x, 1);
|
pixel_update(bitmap, line, pos, y, x, 1);
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,9 @@
|
|||||||
#define MCFG_HD44780_ADD( _tag ) \
|
#define MCFG_HD44780_ADD( _tag ) \
|
||||||
MCFG_DEVICE_ADD( _tag, HD44780, 0 )
|
MCFG_DEVICE_ADD( _tag, HD44780, 0 )
|
||||||
|
|
||||||
|
#define MCFG_KS0066_F05_ADD( _tag ) \
|
||||||
|
MCFG_DEVICE_ADD( _tag, KS0066_F05, 0 )
|
||||||
|
|
||||||
#define MCFG_HD44780_LCD_SIZE(_lines, _chars) \
|
#define MCFG_HD44780_LCD_SIZE(_lines, _chars) \
|
||||||
hd44780_device::static_set_lcd_size(*device, _lines, _chars);
|
hd44780_device::static_set_lcd_size(*device, _lines, _chars);
|
||||||
|
|
||||||
@ -58,6 +61,24 @@ protected:
|
|||||||
// optional information overrides
|
// optional information overrides
|
||||||
const rom_entry *device_rom_region() const;
|
const rom_entry *device_rom_region() const;
|
||||||
|
|
||||||
|
// charset
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
CHARSET_HD44780_A00,
|
||||||
|
CHARSET_KS0066_F05,
|
||||||
|
/*
|
||||||
|
CHARSET_HD44780_A01,
|
||||||
|
CHARSET_HD44780_A02,
|
||||||
|
CHARSET_KS0066_F00,
|
||||||
|
CHARSET_KS0066_F03,
|
||||||
|
CHARSET_KS0066_F04,
|
||||||
|
CHARSET_KS0066_F06,
|
||||||
|
CHARSET_KS0066_F59,
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
|
||||||
|
void set_charset_type(int type);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// internal helper
|
// internal helper
|
||||||
void set_busy_flag(UINT16 usec);
|
void set_busy_flag(UINT16 usec);
|
||||||
@ -95,11 +116,22 @@ private:
|
|||||||
bool m_blink;
|
bool m_blink;
|
||||||
bool m_first_cmd;
|
bool m_first_cmd;
|
||||||
bool m_nibble;
|
bool m_nibble;
|
||||||
|
int m_charset_type;
|
||||||
|
|
||||||
enum { DDRAM, CGRAM };
|
enum { DDRAM, CGRAM };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ======================> ks0066_f05_device
|
||||||
|
|
||||||
|
class ks0066_f05_device : public hd44780_device
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// construction/destruction
|
||||||
|
ks0066_f05_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||||
|
};
|
||||||
|
|
||||||
// device type definition
|
// device type definition
|
||||||
extern const device_type HD44780;
|
extern const device_type HD44780;
|
||||||
|
extern const device_type KS0066_F05;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user