mirror of
https://github.com/holub/mame
synced 2025-04-22 00:11:58 +03:00
Merge branch 'master' of https://github.com/mamedev/mame
This commit is contained in:
commit
e774d82ed0
@ -57,6 +57,10 @@ hd44780_device::hd44780_device(const machine_config &mconfig, device_type type,
|
||||
: device_t(mconfig, type, tag, owner, clock)
|
||||
, m_cgrom(nullptr)
|
||||
, m_cgrom_region(*this, DEVICE_SELF)
|
||||
, m_rs_input(0)
|
||||
, m_rw_input(0)
|
||||
, m_db_input(0)
|
||||
, m_enabled(false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -115,6 +119,10 @@ void hd44780_device::device_start()
|
||||
save_item(NAME(m_ddram));
|
||||
save_item(NAME(m_cgram));
|
||||
save_item(NAME(m_nibble));
|
||||
save_item(NAME(m_rs_input));
|
||||
save_item(NAME(m_rw_input));
|
||||
save_item(NAME(m_db_input));
|
||||
save_item(NAME(m_enabled));
|
||||
save_item(NAME(m_rs_state));
|
||||
save_item(NAME(m_rw_state));
|
||||
}
|
||||
@ -234,7 +242,7 @@ void hd44780_device::update_nibble(int rs, int rw)
|
||||
m_nibble = !m_nibble;
|
||||
}
|
||||
|
||||
inline void hd44780_device::pixel_update(bitmap_ind16 &bitmap, uint8_t line, uint8_t pos, uint8_t y, uint8_t x, int state)
|
||||
inline void hd44780_device::pixel_update(bitmap_ind16 &bitmap, u8 line, u8 pos, u8 y, u8 x, int state)
|
||||
{
|
||||
if (!m_pixel_update_cb.isnull())
|
||||
{
|
||||
@ -242,7 +250,7 @@ inline void hd44780_device::pixel_update(bitmap_ind16 &bitmap, uint8_t line, uin
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t line_height = (m_char_size == 8) ? m_char_size : m_char_size + 1;
|
||||
u8 line_height = (m_char_size == 8) ? m_char_size : m_char_size + 1;
|
||||
|
||||
if (m_lines <= 2)
|
||||
{
|
||||
@ -275,13 +283,13 @@ inline void hd44780_device::pixel_update(bitmap_ind16 &bitmap, uint8_t line, uin
|
||||
// device interface
|
||||
//**************************************************************************
|
||||
|
||||
const uint8_t *hd44780_device::render()
|
||||
const u8 *hd44780_device::render()
|
||||
{
|
||||
memset(m_render_buf, 0, sizeof(m_render_buf));
|
||||
|
||||
if (m_display_on)
|
||||
{
|
||||
uint8_t line_size = 80 / m_num_line;
|
||||
u8 line_size = 80 / m_num_line;
|
||||
|
||||
for (int line = 0; line < m_num_line; line++)
|
||||
{
|
||||
@ -304,8 +312,8 @@ const uint8_t *hd44780_device::render()
|
||||
char_base = m_ddram[char_pos] * 0x10;
|
||||
}
|
||||
|
||||
const uint8_t * charset = (m_ddram[char_pos] < 0x10) ? m_cgram : m_cgrom;
|
||||
uint8_t *dest = m_render_buf + 16 * (line * line_size + pos);
|
||||
const u8 *charset = (m_ddram[char_pos] < 0x10) ? m_cgram : m_cgrom;
|
||||
u8 *dest = m_render_buf + 16 * (line * line_size + pos);
|
||||
memcpy (dest, charset + char_base, m_char_size);
|
||||
|
||||
if (char_pos == m_ac)
|
||||
@ -327,15 +335,15 @@ const uint8_t *hd44780_device::render()
|
||||
uint32_t hd44780_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
bitmap.fill(0, cliprect);
|
||||
const uint8_t *img = render();
|
||||
const u8 *img = render();
|
||||
|
||||
uint8_t line_size = 80 / m_num_line;
|
||||
u8 line_size = 80 / m_num_line;
|
||||
|
||||
for (int line = 0; line < m_num_line; line++)
|
||||
{
|
||||
for (int pos = 0; pos < line_size; pos++)
|
||||
{
|
||||
const uint8_t *src = img + 16 * (line * line_size + pos);
|
||||
const u8 *src = img + 16 * (line * line_size + pos);
|
||||
for (int y = 0; y < m_char_size; y++)
|
||||
for (int x = 0; x < 5; x++)
|
||||
pixel_update(bitmap, line, pos, y, x, BIT(src[y], 4 - x));
|
||||
@ -347,6 +355,9 @@ uint32_t hd44780_device::screen_update(screen_device &screen, bitmap_ind16 &bitm
|
||||
|
||||
u8 hd44780_device::read(offs_t offset)
|
||||
{
|
||||
if (m_data_len == 4 && !machine().side_effects_disabled())
|
||||
update_nibble(offset & 0x01, 1);
|
||||
|
||||
switch (offset & 0x01)
|
||||
{
|
||||
case 0: return control_read();
|
||||
@ -358,6 +369,9 @@ u8 hd44780_device::read(offs_t offset)
|
||||
|
||||
void hd44780_device::write(offs_t offset, u8 data)
|
||||
{
|
||||
if (m_data_len == 4 && !machine().side_effects_disabled())
|
||||
update_nibble(offset & 0x01, 0);
|
||||
|
||||
switch (offset & 0x01)
|
||||
{
|
||||
case 0: control_write(data); break;
|
||||
@ -365,12 +379,56 @@ void hd44780_device::write(offs_t offset, u8 data)
|
||||
}
|
||||
}
|
||||
|
||||
u8 hd44780_device::db_r()
|
||||
{
|
||||
if (m_enabled && m_rw_input == 1)
|
||||
{
|
||||
switch (m_rs_input)
|
||||
{
|
||||
case 0: return control_read();
|
||||
case 1: return data_read();
|
||||
}
|
||||
}
|
||||
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
void hd44780_device::db_w(u8 data)
|
||||
{
|
||||
m_db_input = data;
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(hd44780_device::rs_w)
|
||||
{
|
||||
m_rs_input = state;
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(hd44780_device::rw_w)
|
||||
{
|
||||
m_rw_input = state;
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(hd44780_device::e_w)
|
||||
{
|
||||
if (m_data_len == 4 && state && !m_enabled && !machine().side_effects_disabled())
|
||||
update_nibble(m_rs_input, m_rw_input);
|
||||
|
||||
if (!state && m_enabled && m_rw_input == 0)
|
||||
{
|
||||
switch (m_rs_input)
|
||||
{
|
||||
case 0: control_write(m_db_input); break;
|
||||
case 1: data_write(m_db_input); break;
|
||||
}
|
||||
}
|
||||
|
||||
m_enabled = state;
|
||||
}
|
||||
|
||||
void hd44780_device::control_write(u8 data)
|
||||
{
|
||||
if (m_data_len == 4)
|
||||
{
|
||||
update_nibble(0, 0);
|
||||
|
||||
if (m_nibble)
|
||||
{
|
||||
m_ir = data & 0xf0;
|
||||
@ -489,9 +547,6 @@ u8 hd44780_device::control_read()
|
||||
{
|
||||
if (m_data_len == 4)
|
||||
{
|
||||
if (!machine().side_effects_disabled())
|
||||
update_nibble(0, 1);
|
||||
|
||||
if (m_nibble)
|
||||
return (m_busy_flag ? 0x80 : 0) | (m_ac & 0x70);
|
||||
else
|
||||
@ -513,8 +568,6 @@ void hd44780_device::data_write(u8 data)
|
||||
|
||||
if (m_data_len == 4)
|
||||
{
|
||||
update_nibble(1, 0);
|
||||
|
||||
if (m_nibble)
|
||||
{
|
||||
m_dr = data & 0xf0;
|
||||
@ -545,15 +598,12 @@ void hd44780_device::data_write(u8 data)
|
||||
|
||||
u8 hd44780_device::data_read()
|
||||
{
|
||||
uint8_t data = (m_active_ram == DDRAM) ? m_ddram[m_ac] : m_cgram[m_ac];
|
||||
u8 data = (m_active_ram == DDRAM) ? m_ddram[m_ac] : m_cgram[m_ac];
|
||||
|
||||
LOG("HD44780: %sRAM read %x %c\n", m_active_ram == DDRAM ? "DD" : "CG", m_ac, data);
|
||||
|
||||
if (m_data_len == 4)
|
||||
{
|
||||
if (!machine().side_effects_disabled())
|
||||
update_nibble(1, 1);
|
||||
|
||||
if (m_nibble)
|
||||
return data & 0xf0;
|
||||
else
|
||||
|
@ -16,7 +16,7 @@
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
#define HD44780_PIXEL_UPDATE(name) void name(bitmap_ind16 &bitmap, uint8_t line, uint8_t pos, uint8_t y, uint8_t x, int state)
|
||||
#define HD44780_PIXEL_UPDATE(name) void name(bitmap_ind16 &bitmap, u8 line, u8 pos, u8 y, u8 x, int state)
|
||||
|
||||
|
||||
// ======================> hd44780_device
|
||||
@ -24,7 +24,7 @@
|
||||
class hd44780_device : public device_t
|
||||
{
|
||||
public:
|
||||
typedef device_delegate<void (bitmap_ind16 &bitmap, uint8_t line, uint8_t pos, uint8_t y, uint8_t x, int state)> pixel_update_delegate;
|
||||
typedef device_delegate<void (bitmap_ind16 &bitmap, u8 line, u8 pos, u8 y, u8 x, int state)> pixel_update_delegate;
|
||||
|
||||
// construction/destruction
|
||||
hd44780_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||
@ -34,25 +34,31 @@ public:
|
||||
template <typename... T> void set_pixel_update_cb(T &&... args) { m_pixel_update_cb = pixel_update_delegate(std::forward<T>(args)...); }
|
||||
void set_pixel_update_cb(pixel_update_delegate callback) { m_pixel_update_cb = callback; }
|
||||
template <class FunctionClass> void set_pixel_update_cb(const char *devname,
|
||||
void (FunctionClass::*callback)(bitmap_ind16 &, uint8_t, uint8_t, uint8_t, uint8_t, int), const char *name)
|
||||
void (FunctionClass::*callback)(bitmap_ind16 &, u8, u8, u8, u8, int), const char *name)
|
||||
{
|
||||
set_pixel_update_cb(pixel_update_delegate(callback, name, devname, static_cast<FunctionClass *>(nullptr)));
|
||||
}
|
||||
template <class FunctionClass> void set_pixel_update_cb(
|
||||
void (FunctionClass::*callback)(bitmap_ind16 &, uint8_t, uint8_t, uint8_t, uint8_t, int), const char *name)
|
||||
void (FunctionClass::*callback)(bitmap_ind16 &, u8, u8, u8, u8, int), const char *name)
|
||||
{
|
||||
set_pixel_update_cb(pixel_update_delegate(callback, name, nullptr, static_cast<FunctionClass *>(nullptr)));
|
||||
}
|
||||
|
||||
// device interface
|
||||
virtual void write(offs_t offset, u8 data);
|
||||
virtual u8 read(offs_t offset);
|
||||
virtual void control_write(u8 data);
|
||||
virtual u8 control_read();
|
||||
virtual void data_write(u8 data);
|
||||
virtual u8 data_read();
|
||||
void write(offs_t offset, u8 data);
|
||||
u8 read(offs_t offset);
|
||||
void control_w(u8 data) { write(0, data); }
|
||||
u8 control_r() { return read(0); }
|
||||
void data_w(u8 data) { write(1, data); }
|
||||
u8 data_r() { return read(1); }
|
||||
|
||||
const uint8_t *render();
|
||||
u8 db_r();
|
||||
void db_w(u8 data);
|
||||
DECLARE_WRITE_LINE_MEMBER(rs_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(rw_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(e_w);
|
||||
|
||||
const u8 *render();
|
||||
virtual uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
protected:
|
||||
@ -81,6 +87,11 @@ protected:
|
||||
*/
|
||||
};
|
||||
|
||||
virtual void control_write(u8 data);
|
||||
virtual u8 control_read();
|
||||
virtual void data_write(u8 data);
|
||||
virtual u8 data_read();
|
||||
|
||||
void set_charset_type(int type);
|
||||
|
||||
private:
|
||||
@ -90,7 +101,7 @@ private:
|
||||
void update_ac(int direction);
|
||||
void update_nibble(int rs, int rw);
|
||||
void shift_display(int direction);
|
||||
void pixel_update(bitmap_ind16 &bitmap, uint8_t line, uint8_t pos, uint8_t y, uint8_t x, int state);
|
||||
void pixel_update(bitmap_ind16 &bitmap, u8 line, u8 pos, u8 y, u8 x, int state);
|
||||
|
||||
// internal state
|
||||
static constexpr device_timer_id TIMER_BUSY = 0;
|
||||
@ -99,35 +110,39 @@ private:
|
||||
emu_timer * m_blink_timer;
|
||||
emu_timer * m_busy_timer;
|
||||
|
||||
uint8_t m_lines; // number of lines
|
||||
uint8_t m_chars; // chars for line
|
||||
u8 m_lines; // number of lines
|
||||
u8 m_chars; // chars for line
|
||||
pixel_update_delegate m_pixel_update_cb; // pixel update callback
|
||||
|
||||
bool m_busy_flag; // busy flag
|
||||
uint8_t m_ddram[0x80]; // internal display data RAM
|
||||
uint8_t m_cgram[0x40]; // internal chargen RAM
|
||||
uint8_t const *m_cgrom;
|
||||
optional_region_ptr<uint8_t> m_cgrom_region; // internal chargen ROM
|
||||
u8 m_ddram[0x80]; // internal display data RAM
|
||||
u8 m_cgram[0x40]; // internal chargen RAM
|
||||
u8 const *m_cgrom;
|
||||
optional_region_ptr<u8> m_cgrom_region; // internal chargen ROM
|
||||
int m_ac; // address counter
|
||||
uint8_t m_dr; // data register
|
||||
uint8_t m_ir; // instruction register
|
||||
uint8_t m_active_ram; // DDRAM or CGRAM
|
||||
u8 m_dr; // data register
|
||||
u8 m_ir; // instruction register
|
||||
u8 m_active_ram; // DDRAM or CGRAM
|
||||
bool m_display_on; // display on/off
|
||||
bool m_cursor_on; // cursor on/off
|
||||
bool m_blink_on; // blink on/off
|
||||
bool m_shift_on; // shift on/off
|
||||
int m_disp_shift; // display shift
|
||||
int m_direction; // auto increment/decrement (-1 or +1)
|
||||
uint8_t m_data_len; // interface data length 4 or 8 bit
|
||||
uint8_t m_num_line; // number of lines
|
||||
uint8_t m_char_size; // char size 5x8 or 5x10
|
||||
u8 m_data_len; // interface data length 4 or 8 bit
|
||||
u8 m_num_line; // number of lines
|
||||
u8 m_char_size; // char size 5x8 or 5x10
|
||||
bool m_blink;
|
||||
bool m_first_cmd;
|
||||
int m_rs_input;
|
||||
int m_rw_input;
|
||||
u8 m_db_input;
|
||||
bool m_enabled;
|
||||
int m_rs_state;
|
||||
int m_rw_state;
|
||||
bool m_nibble;
|
||||
int m_charset_type;
|
||||
uint8_t m_render_buf[80 * 16];
|
||||
u8 m_render_buf[80 * 16];
|
||||
|
||||
enum { DDRAM, CGRAM };
|
||||
};
|
||||
|
@ -89,8 +89,7 @@ void fb01_state::fb01_io(address_map &map)
|
||||
map(0x20, 0x20).portr("PANEL");
|
||||
|
||||
// 30-31 HD44780A
|
||||
map(0x30, 0x30).rw("hd44780", FUNC(hd44780_device::control_read), FUNC(hd44780_device::control_write));
|
||||
map(0x31, 0x31).rw("hd44780", FUNC(hd44780_device::data_read), FUNC(hd44780_device::data_write));
|
||||
map(0x30, 0x31).rw("hd44780", FUNC(hd44780_device::read), FUNC(hd44780_device::write));
|
||||
}
|
||||
|
||||
|
||||
|
@ -135,10 +135,10 @@ void hprot1_state::i80c31_io(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x7fff).ram();
|
||||
/*TODO: verify the mirror mask value for the HD44780 device */
|
||||
map(0xc000, 0xc000).mirror(0x13cf).w(m_lcdc, FUNC(hd44780_device::control_write));
|
||||
map(0xc010, 0xc010).mirror(0x13cf).w(m_lcdc, FUNC(hd44780_device::data_write));
|
||||
map(0xc020, 0xc020).mirror(0x13cf).r(m_lcdc, FUNC(hd44780_device::control_read));
|
||||
map(0xc030, 0xc030).mirror(0x13cf).r(m_lcdc, FUNC(hd44780_device::data_read));
|
||||
map(0xc000, 0xc000).mirror(0x13cf).w(m_lcdc, FUNC(hd44780_device::control_w));
|
||||
map(0xc010, 0xc010).mirror(0x13cf).w(m_lcdc, FUNC(hd44780_device::data_w));
|
||||
map(0xc020, 0xc020).mirror(0x13cf).r(m_lcdc, FUNC(hd44780_device::control_r));
|
||||
map(0xc030, 0xc030).mirror(0x13cf).r(m_lcdc, FUNC(hd44780_device::data_r));
|
||||
/*TODO: attach the watchdog/brownout reset device:
|
||||
map(0xe000,0xe0??).mirror(?).r("adm965an", FUNC(adm965an_device::data_read)); */
|
||||
}
|
||||
|
@ -89,8 +89,7 @@ void icatel_state::i80c31_io(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x3FFF).ram();
|
||||
map(0x8000, 0x8002).ram(); /* HACK! */
|
||||
map(0x8040, 0x8040).mirror(0x3F1E).w(m_lcdc, FUNC(hd44780_device::control_write)); // not sure yet. CI12 (73LS273)
|
||||
map(0x8041, 0x8041).mirror(0x3F1E).w(m_lcdc, FUNC(hd44780_device::data_write)); // not sure yet. CI12
|
||||
map(0x8040, 0x8041).mirror(0x3F1E).w(m_lcdc, FUNC(hd44780_device::write)); // not sure yet. CI12 (73LS273)
|
||||
map(0x8060, 0x8060).mirror(0x3F1F).rw(FUNC(icatel_state::ci8_r), FUNC(icatel_state::ci8_w));
|
||||
map(0x8080, 0x8080).mirror(0x3F1F).rw(FUNC(icatel_state::ci16_r), FUNC(icatel_state::ci16_w)); // card reader (?)
|
||||
map(0x80C0, 0x80C0).mirror(0x3F1F).rw(FUNC(icatel_state::ci15_r), FUNC(icatel_state::ci15_w)); // 74LS244 (tristate buffer)
|
||||
|
@ -111,10 +111,8 @@ void lcmate2_state::lcmate2_io(address_map &map)
|
||||
map(0x1000, 0x1000).w(FUNC(lcmate2_state::speaker_w));
|
||||
map(0x1fff, 0x1fff).w(FUNC(lcmate2_state::bankswitch_w));
|
||||
|
||||
map(0x3000, 0x3000).w(m_lcdc, FUNC(hd44780_device::control_write));
|
||||
map(0x3001, 0x3001).w(m_lcdc, FUNC(hd44780_device::data_write));
|
||||
map(0x3002, 0x3002).r(m_lcdc, FUNC(hd44780_device::control_read));
|
||||
map(0x3003, 0x3003).r(m_lcdc, FUNC(hd44780_device::data_read));
|
||||
map(0x3000, 0x3001).w(m_lcdc, FUNC(hd44780_device::write));
|
||||
map(0x3002, 0x3003).r(m_lcdc, FUNC(hd44780_device::read));
|
||||
|
||||
map(0x5000, 0x50ff).r(FUNC(lcmate2_state::key_r));
|
||||
}
|
||||
|
@ -112,8 +112,8 @@ void ml20_state::mem_map(address_map &map)
|
||||
void ml20_state::io_map(address_map &map)
|
||||
{
|
||||
map(0x00, 0x0f).rw("rtc", FUNC(msm6242_device::read), FUNC(msm6242_device::write));
|
||||
map(0x10, 0x10).rw(m_lcdc, FUNC(hd44780_device::data_read), FUNC(hd44780_device::data_write));
|
||||
map(0x14, 0x14).rw(m_lcdc, FUNC(hd44780_device::control_read), FUNC(hd44780_device::control_write));
|
||||
map(0x10, 0x10).rw(m_lcdc, FUNC(hd44780_device::data_r), FUNC(hd44780_device::data_w));
|
||||
map(0x14, 0x14).rw(m_lcdc, FUNC(hd44780_device::control_r), FUNC(hd44780_device::control_w));
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( ml20 )
|
||||
|
@ -364,7 +364,7 @@ READ8_MEMBER( pc1000_state::kb_r )
|
||||
READ8_MEMBER( pc1000_state::lcdc_data_r )
|
||||
{
|
||||
//logerror("lcdc data r\n");
|
||||
return m_lcdc->data_read() >> 4;
|
||||
return m_lcdc->data_r() >> 4;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( pc1000_state::lcdc_data_w )
|
||||
@ -372,19 +372,19 @@ WRITE8_MEMBER( pc1000_state::lcdc_data_w )
|
||||
//popmessage("%s", (char*)m_maincpu->space(AS_PROGRAM).get_read_ptr(0x4290));
|
||||
|
||||
//logerror("lcdc data w %x\n", data);
|
||||
m_lcdc->data_write(data << 4);
|
||||
m_lcdc->data_w(data << 4);
|
||||
}
|
||||
|
||||
READ8_MEMBER( pc1000_state::lcdc_control_r )
|
||||
{
|
||||
//logerror("lcdc control r\n");
|
||||
return m_lcdc->control_read() >> 4;
|
||||
return m_lcdc->control_r() >> 4;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( pc1000_state::lcdc_control_w )
|
||||
{
|
||||
//logerror("lcdc control w %x\n", data);
|
||||
m_lcdc->control_write(data<<4);
|
||||
m_lcdc->control_w(data<<4);
|
||||
}
|
||||
|
||||
HD44780_PIXEL_UPDATE(pc1000_state::pc1000_pixel_update)
|
||||
|
@ -95,13 +95,14 @@ WRITE8_MEMBER(piggypas_state::led_strobe_w)
|
||||
|
||||
READ8_MEMBER(piggypas_state::lcd_latch_r)
|
||||
{
|
||||
return m_lcd_latch;
|
||||
return m_hd44780->db_r();
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(piggypas_state::lcd_latch_w)
|
||||
{
|
||||
// P1.7 might also be used to reset DS1232 watchdog
|
||||
m_lcd_latch = data;
|
||||
m_hd44780->db_w(data);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(piggypas_state::lcd_control_w)
|
||||
@ -109,13 +110,9 @@ WRITE8_MEMBER(piggypas_state::lcd_control_w)
|
||||
// RXD (P3.0) = chip select
|
||||
// TXD (P3.1) = register select
|
||||
// INT0 (P3.2) = R/W
|
||||
if (BIT(data, 0))
|
||||
{
|
||||
if (BIT(data, 2))
|
||||
m_lcd_latch = m_hd44780->read(BIT(data, 1));
|
||||
else
|
||||
m_hd44780->write(BIT(data, 1), m_lcd_latch);
|
||||
}
|
||||
m_hd44780->e_w(BIT(data, 0));
|
||||
m_hd44780->rs_w(BIT(data, 1));
|
||||
m_hd44780->rw_w(BIT(data, 2));
|
||||
|
||||
// T0 (P3.4) = output shift clock (serial data present at P1.0)
|
||||
// T1 (P3.5) = output latch enable
|
||||
|
@ -252,8 +252,7 @@ void psion1_state::psion1_mem(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x001f).rw(FUNC(psion1_state::hd63701_int_reg_r), FUNC(psion1_state::hd63701_int_reg_w));
|
||||
map(0x0040, 0x00ff).ram().share("sys_register");
|
||||
map(0x2000, 0x2000).mirror(0x07fe).rw(m_lcdc, FUNC(hd44780_device::control_read), FUNC(hd44780_device::control_write));
|
||||
map(0x2001, 0x2001).mirror(0x07fe).rw(m_lcdc, FUNC(hd44780_device::data_read), FUNC(hd44780_device::data_write));
|
||||
map(0x2000, 0x2001).mirror(0x07fe).rw(m_lcdc, FUNC(hd44780_device::read), FUNC(hd44780_device::write));
|
||||
map(0x2800, 0x2800).r(FUNC(psion1_state::reset_kb_counter_r));
|
||||
map(0x2e00, 0x2e00).r(FUNC(psion1_state::switchoff_r));
|
||||
map(0x3000, 0x3000).r(FUNC(psion1_state::inc_kb_counter_r));
|
||||
|
@ -360,11 +360,7 @@ WRITE8_MEMBER(replicator_state::port_w)
|
||||
uint8_t lcd_data = shift_register_value & 0xF0;
|
||||
|
||||
if (enable && RW==0){
|
||||
if (RS==0){
|
||||
m_lcdc->control_write(lcd_data);
|
||||
} else {
|
||||
m_lcdc->data_write(lcd_data);
|
||||
}
|
||||
m_lcdc->write(RS, lcd_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -200,13 +200,17 @@ WRITE8_MEMBER(ssystem3_state::control_w)
|
||||
if (data & ~m_control & 4)
|
||||
{
|
||||
m_shift = m_shift << 1 | m_lcd->do_r();
|
||||
u64 out2 = m_shift | 0x100;
|
||||
u8 out2 = m_shift;
|
||||
|
||||
// weird TTL maze, I assume it's a hw kludge to fix a bug after the maskroms were already manufactured
|
||||
if (BIT(m_shift, 3) & ~(BIT(m_shift, 1) ^ BIT(m_shift, 4)) & ~(BIT(m_lcd_q, 7) & BIT(m_lcd_q, 23)))
|
||||
out2 ^= 0x12;
|
||||
|
||||
m_display->matrix(1, out2 << 32 | m_lcd_q);
|
||||
// update display
|
||||
for (int i = 0; i < 4; i++)
|
||||
m_display->write_row(i, m_lcd_q >> (8*i) & 0xff);
|
||||
m_display->write_row(4, out2 | 0x100);
|
||||
m_display->update();
|
||||
}
|
||||
|
||||
// PB3: device serial out
|
||||
@ -312,8 +316,10 @@ void ssystem3_state::ssystem3(machine_config &config)
|
||||
screen.set_size(1920/2, 729/2);
|
||||
screen.set_visarea_full();
|
||||
|
||||
PWM_DISPLAY(config, m_display).set_size(1, 32+8+1);
|
||||
PWM_DISPLAY(config, m_display).set_size(5, 9);
|
||||
m_display->set_segmask(0xf, 0x7f);
|
||||
m_display->set_bri_levels(0.25);
|
||||
|
||||
config.set_default_layout(layout_saitek_ssystem3);
|
||||
|
||||
/* sound hardware */
|
||||
@ -339,8 +345,8 @@ ROM_START( ssystem3 )
|
||||
ROM_REGION( 0x100, "nvram", 0 ) // default settings
|
||||
ROM_LOAD( "nvram", 0, 0x100, CRC(b5dddc7b) SHA1(3be9ec8359cc9ef16a04f28dfd24f9ffe1a2fca9) )
|
||||
|
||||
ROM_REGION( 53511, "screen", 0)
|
||||
ROM_LOAD( "ssystem3.svg", 0, 53511, CRC(a2820cc8) SHA1(2e922bb2d4a244931c1e7dafa84910dee5ab2623) )
|
||||
ROM_REGION( 53469, "screen", 0)
|
||||
ROM_LOAD( "ssystem3.svg", 0, 53469, CRC(0479eac3) SHA1(6f26c8dfab2c8456cf576ea4ca6ab7a8445bf5e5) )
|
||||
ROM_END
|
||||
|
||||
} // anonymous namespace
|
||||
|
@ -83,9 +83,9 @@ void ti630_state::init_ti630()
|
||||
|
||||
void ti630_state::i80c31_io(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x0000) /*.mirror(?)*/ .w("hd44780", FUNC(hd44780_device::control_write));
|
||||
map(0x1000, 0x1000) /*.mirror(?)*/ .w("hd44780", FUNC(hd44780_device::data_write));
|
||||
map(0x2000, 0x2000) /*.mirror(?)*/ .r("hd44780", FUNC(hd44780_device::control_read));
|
||||
map(0x0000, 0x0000) /*.mirror(?)*/ .w("hd44780", FUNC(hd44780_device::control_w));
|
||||
map(0x1000, 0x1000) /*.mirror(?)*/ .w("hd44780", FUNC(hd44780_device::data_w));
|
||||
map(0x2000, 0x2000) /*.mirror(?)*/ .r("hd44780", FUNC(hd44780_device::control_r));
|
||||
map(0x8000, 0xffff).ram(); /*TODO: verify the ammont of RAM and the correct address range to which it is mapped. This is just a first reasonable guess that apparently yields good results in the emulation */
|
||||
}
|
||||
|
||||
|
@ -100,30 +100,12 @@
|
||||
<text string="Black"><color red="0.01" green="0.01" blue="0.01" /></text>
|
||||
</element>
|
||||
|
||||
<element name="text_p1">
|
||||
<rect><color red="0.7" green="0.7" blue="0.7" /></rect>
|
||||
<text string="[K]"><color red="0.01" green="0.01" blue="0.01" /></text>
|
||||
</element>
|
||||
<element name="text_p2">
|
||||
<rect><color red="0.7" green="0.7" blue="0.7" /></rect>
|
||||
<text string="[Q]"><color red="0.01" green="0.01" blue="0.01" /></text>
|
||||
</element>
|
||||
<element name="text_p3">
|
||||
<rect><color red="0.7" green="0.7" blue="0.7" /></rect>
|
||||
<text string="[R]"><color red="0.01" green="0.01" blue="0.01" /></text>
|
||||
</element>
|
||||
<element name="text_p4">
|
||||
<rect><color red="0.7" green="0.7" blue="0.7" /></rect>
|
||||
<text string="[B]"><color red="0.01" green="0.01" blue="0.01" /></text>
|
||||
</element>
|
||||
<element name="text_p5">
|
||||
<rect><color red="0.7" green="0.7" blue="0.7" /></rect>
|
||||
<text string="[N]"><color red="0.01" green="0.01" blue="0.01" /></text>
|
||||
</element>
|
||||
<element name="text_p6">
|
||||
<rect><color red="0.7" green="0.7" blue="0.7" /></rect>
|
||||
<text string="[P]"><color red="0.01" green="0.01" blue="0.01" /></text>
|
||||
</element>
|
||||
<element name="text_p1"><image file="chess/bk.png"><color alpha="0.83" /></image></element>
|
||||
<element name="text_p2"><image file="chess/bq.png"><color alpha="0.83" /></image></element>
|
||||
<element name="text_p3"><image file="chess/br.png"><color alpha="0.83" /></image></element>
|
||||
<element name="text_p4"><image file="chess/bb.png"><color alpha="0.83" /></image></element>
|
||||
<element name="text_p5"><image file="chess/bn.png"><color alpha="0.83" /></image></element>
|
||||
<element name="text_p6"><image file="chess/bp.png"><color alpha="0.83" /></image></element>
|
||||
|
||||
<element name="text_b1"><text string="Set up"><color red="0.8" green="0.8" blue="0.8" /></text></element>
|
||||
<element name="text_b2"><text string="New Game"><color red="0.8" green="0.8" blue="0.8" /></text></element>
|
||||
@ -470,42 +452,42 @@
|
||||
<bezel element="blackb"><bounds x="20.5" y="89.5" width="7" height="8.4" /></bezel>
|
||||
<bezel name="8.1" element="led2"><bounds x="23.25" y="90" width="1.5" height="1.5" /></bezel>
|
||||
<bezel element="white"><bounds x="21" y="91.8" width="6" height="2" /></bezel>
|
||||
<bezel element="text_p1"><bounds x="21" y="91.9" width="6" height="1.5" /></bezel>
|
||||
<bezel element="text_p1"><bounds x="23" y="91.8" width="2" height="2" /></bezel>
|
||||
<bezel element="butr" inputtag="IN.0" inputmask="0x02"><bounds x="21" y="94.3" width="6" height="2" /></bezel>
|
||||
|
||||
<bezel element="white"><bounds x="28.2" y="89.2" width="7.6" height="9" /></bezel>
|
||||
<bezel element="blackb"><bounds x="28.5" y="89.5" width="7" height="8.4" /></bezel>
|
||||
<bezel name="8.2" element="led2"><bounds x="31.25" y="90" width="1.5" height="1.5" /></bezel>
|
||||
<bezel element="white"><bounds x="29" y="91.8" width="6" height="2" /></bezel>
|
||||
<bezel element="text_p2"><bounds x="29" y="91.9" width="6" height="1.5" /></bezel>
|
||||
<bezel element="text_p2"><bounds x="31" y="91.8" width="2" height="2" /></bezel>
|
||||
<bezel element="butr" inputtag="IN.0" inputmask="0x04"><bounds x="29" y="94.3" width="6" height="2" /></bezel>
|
||||
|
||||
<bezel element="white"><bounds x="36.2" y="89.2" width="7.6" height="9" /></bezel>
|
||||
<bezel element="blackb"><bounds x="36.5" y="89.5" width="7" height="8.4" /></bezel>
|
||||
<bezel name="8.3" element="led2"><bounds x="39.25" y="90" width="1.5" height="1.5" /></bezel>
|
||||
<bezel element="white"><bounds x="37" y="91.8" width="6" height="2" /></bezel>
|
||||
<bezel element="text_p3"><bounds x="37" y="91.9" width="6" height="1.5" /></bezel>
|
||||
<bezel element="text_p3"><bounds x="39" y="91.8" width="2" height="2" /></bezel>
|
||||
<bezel element="butr" inputtag="IN.0" inputmask="0x08"><bounds x="37" y="94.3" width="6" height="2" /></bezel>
|
||||
|
||||
<bezel element="white"><bounds x="20.2" y="98.7" width="7.6" height="9" /></bezel>
|
||||
<bezel element="blackb"><bounds x="20.5" y="99" width="7" height="8.4" /></bezel>
|
||||
<bezel name="8.4" element="led2"><bounds x="23.25" y="99.5" width="1.5" height="1.5" /></bezel>
|
||||
<bezel element="white"><bounds x="21" y="101.3" width="6" height="2" /></bezel>
|
||||
<bezel element="text_p4"><bounds x="21" y="101.4" width="6" height="1.5" /></bezel>
|
||||
<bezel element="text_p4"><bounds x="23" y="101.3" width="2" height="2" /></bezel>
|
||||
<bezel element="butr" inputtag="IN.0" inputmask="0x10"><bounds x="21" y="103.8" width="6" height="2" /></bezel>
|
||||
|
||||
<bezel element="white"><bounds x="28.2" y="98.7" width="7.6" height="9" /></bezel>
|
||||
<bezel element="blackb"><bounds x="28.5" y="99" width="7" height="8.4" /></bezel>
|
||||
<bezel name="8.5" element="led2"><bounds x="31.25" y="99.5" width="1.5" height="1.5" /></bezel>
|
||||
<bezel element="white"><bounds x="29" y="101.3" width="6" height="2" /></bezel>
|
||||
<bezel element="text_p5"><bounds x="29" y="101.4" width="6" height="1.5" /></bezel>
|
||||
<bezel element="text_p5"><bounds x="31" y="101.3" width="2" height="2" /></bezel>
|
||||
<bezel element="butr" inputtag="IN.0" inputmask="0x20"><bounds x="29" y="103.8" width="6" height="2" /></bezel>
|
||||
|
||||
<bezel element="white"><bounds x="36.2" y="98.7" width="7.6" height="9" /></bezel>
|
||||
<bezel element="blackb"><bounds x="36.5" y="99" width="7" height="8.4" /></bezel>
|
||||
<bezel name="8.6" element="led2"><bounds x="39.25" y="99.5" width="1.5" height="1.5" /></bezel>
|
||||
<bezel element="white"><bounds x="37" y="101.3" width="6" height="2" /></bezel>
|
||||
<bezel element="text_p6"><bounds x="37" y="101.4" width="6" height="1.5" /></bezel>
|
||||
<bezel element="text_p6"><bounds x="39" y="101.3" width="2" height="2" /></bezel>
|
||||
<bezel element="butr" inputtag="IN.0" inputmask="0x40"><bounds x="37" y="103.8" width="6" height="2" /></bezel>
|
||||
|
||||
<bezel element="white"><bounds x="46.5" y="89.2" width="7" height="9" /></bezel>
|
||||
|
@ -19,10 +19,10 @@ public:
|
||||
|
||||
void set_contrast(float contrast) { m_contrast = contrast; }
|
||||
void set_leds(u8 leds) { m_leds = leds; }
|
||||
u8 data_read() { return m_lcd->data_read(); }
|
||||
u8 control_read() { return m_lcd->control_read(); }
|
||||
void data_write(u8 data) { m_lcd->data_write(data); }
|
||||
void control_write(u8 data) { m_lcd->control_write(data); }
|
||||
u8 data_read() { return m_lcd->data_r(); }
|
||||
u8 control_read() { return m_lcd->control_r(); }
|
||||
void data_write(u8 data) { m_lcd->data_w(data); }
|
||||
void control_write(u8 data) { m_lcd->control_w(data); }
|
||||
|
||||
|
||||
protected:
|
||||
|
Loading…
Reference in New Issue
Block a user