rz1: preliminary hd44780 hookup [R. Belmont]

This commit is contained in:
arbee 2018-03-16 21:34:00 -04:00
parent 7ead93ea9a
commit 23ece1d07f

View File

@ -6,25 +6,27 @@
Sampling drum machine Sampling drum machine
Skeleton driver Skeleton driver
Sound ROM info: Sound ROM info:
Each ROM chip holds 1.49s of sounds and can be opened as raw Each ROM chip holds 1.49s of sounds and can be opened as raw
PCM data: signed 8-bit, mono, 20,000 Hz. PCM data: signed 8-bit, mono, 20,000 Hz.
* Sound A: Toms 1~3, Kick, Snare, Rimshot, Closed Hi-Hat, Open Hi-Hat, * Sound A: Toms 1~3, Kick, Snare, Rimshot, Closed Hi-Hat, Open Hi-Hat,
and Metronome Click (in that order). and Metronome Click (in that order).
* Sound B: Clap, Ride, Cowbell, and Crash (in that order). * Sound B: Clap, Ride, Cowbell, and Crash (in that order).
Note: Holding EDIT/RECORD, DELETE, INSERT/AUTO-COMPENSATE and Note: Holding EDIT/RECORD, DELETE, INSERT/AUTO-COMPENSATE and
CHAIN/BEAT at startup causes the system to go into a RAM test. CHAIN/BEAT at startup causes the system to go into a RAM test.
***************************************************************************/ ***************************************************************************/
#include "emu.h" #include "emu.h"
#include "screen.h"
#include "cpu/upd7810/upd7811.h" #include "cpu/upd7810/upd7811.h"
#include "video/hd44780.h"
//************************************************************************** //**************************************************************************
@ -37,18 +39,22 @@ public:
rz1_state(const machine_config &mconfig, device_type type, const char *tag) rz1_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag), : driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"), m_maincpu(*this, "maincpu"),
m_hd44780(*this, "hd44780"),
m_keys(*this, "kc%u", 0), m_key_select(0), m_keys(*this, "kc%u", 0), m_key_select(0),
m_port_b(0xff) m_port_b(0xff)
{ } { }
void rz1(machine_config &config); void rz1(machine_config &config);
DECLARE_PALETTE_INIT(rz1);
protected: protected:
virtual void machine_start() override; virtual void machine_start() override;
virtual void machine_reset() override; virtual void machine_reset() override;
private: private:
required_device<upd7811_device> m_maincpu; required_device<upd7811_device> m_maincpu;
required_device<hd44780_device> m_hd44780;
required_ioport_array<8> m_keys; required_ioport_array<8> m_keys;
void map(address_map &map); void map(address_map &map);
@ -73,7 +79,7 @@ private:
//************************************************************************** //**************************************************************************
ADDRESS_MAP_START( rz1_state::map ) ADDRESS_MAP_START( rz1_state::map )
// AM_RANGE(0x0000, 0x0fff) AM_ROM AM_REGION("maincpu", 0) // AM_RANGE(0x0000, 0x0fff) AM_ROM AM_REGION("maincpu", 0)
AM_RANGE(0x2000, 0x3fff) AM_RAM AM_RANGE(0x2000, 0x3fff) AM_RAM
AM_RANGE(0x4000, 0x7fff) AM_ROM AM_REGION("program", 0) AM_RANGE(0x4000, 0x7fff) AM_ROM AM_REGION("program", 0)
AM_RANGE(0x8000, 0x8fff) AM_WRITE(upd934g_c_w) AM_RANGE(0x8000, 0x8fff) AM_WRITE(upd934g_c_w)
@ -185,14 +191,16 @@ WRITE8_MEMBER( rz1_state::port_a_w )
m_key_select = data; m_key_select = data;
// output lcd data to console until it's hooked up properly // output lcd data to console until it's hooked up properly
if (m_port_b == 0x37 || m_port_b == 0x33) // if (m_port_b == 0x37 || m_port_b == 0x33)
printf("%c", data); // printf("%c", data);
m_hd44780->data_write(space, 0, data);
} }
WRITE8_MEMBER( rz1_state::port_b_w ) WRITE8_MEMBER( rz1_state::port_b_w )
{ {
logerror("port_b_w: %02x\n", data); logerror("port_b_w: %02x\n", data);
m_port_b = data; m_port_b = data;
m_hd44780->control_write(space, 0, data & 0xe0); // top 3 lines go to the 44780
} }
READ8_MEMBER( rz1_state::port_c_r ) READ8_MEMBER( rz1_state::port_c_r )
@ -236,6 +244,11 @@ void rz1_state::machine_reset()
{ {
} }
PALETTE_INIT_MEMBER(rz1_state, rz1)
{
palette.set_pen_color(0, rgb_t(138, 146, 148));
palette.set_pen_color(1, rgb_t(92, 83, 88));
}
//************************************************************************** //**************************************************************************
// MACHINE DEFINTIONS // MACHINE DEFINTIONS
@ -248,6 +261,22 @@ MACHINE_CONFIG_START( rz1_state::rz1 )
MCFG_UPD7810_PORTB_WRITE_CB(WRITE8(rz1_state, port_b_w)) MCFG_UPD7810_PORTB_WRITE_CB(WRITE8(rz1_state, port_b_w))
MCFG_UPD7810_PORTC_READ_CB(READ8(rz1_state, port_c_r)) MCFG_UPD7810_PORTC_READ_CB(READ8(rz1_state, port_c_r))
MCFG_UPD7810_PORTC_WRITE_CB(WRITE8(rz1_state, port_c_w)) MCFG_UPD7810_PORTC_WRITE_CB(WRITE8(rz1_state, port_c_w))
/* video hardware */
MCFG_SCREEN_ADD("screen", LCD)
MCFG_SCREEN_REFRESH_RATE(50)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
MCFG_SCREEN_SIZE(6*16, 9*2)
MCFG_SCREEN_VISIBLE_AREA(0, 6*16-1, 0, 9*2-1)
//MCFG_DEFAULT_LAYOUT(layout_lcd)
MCFG_SCREEN_UPDATE_DEVICE("hd44780", hd44780_device, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_PALETTE_ADD_MONOCHROME("palette")
MCFG_PALETTE_INIT_OWNER(rz1_state, rz1)
MCFG_HD44780_ADD("hd44780")
MCFG_HD44780_LCD_SIZE(1, 16)
MACHINE_CONFIG_END MACHINE_CONFIG_END