mirror of
https://github.com/holub/mame
synced 2025-04-19 23:12:11 +03:00
mmboard: put display module in its own file (nw)
This commit is contained in:
parent
7c32014214
commit
45da347b36
@ -2385,6 +2385,8 @@ files {
|
||||
MAME_DIR .. "src/mame/drivers/mephisto_polgar.cpp",
|
||||
MAME_DIR .. "src/mame/machine/mmboard.cpp",
|
||||
MAME_DIR .. "src/mame/machine/mmboard.h",
|
||||
MAME_DIR .. "src/mame/video/mmdisplay2.cpp",
|
||||
MAME_DIR .. "src/mame/video/mmdisplay2.h",
|
||||
}
|
||||
|
||||
createMESSProjects(_target, _subtarget, "hitachi")
|
||||
|
@ -20,6 +20,7 @@ Undocumented buttons:
|
||||
#include "machine/bankdev.h"
|
||||
#include "machine/nvram.h"
|
||||
#include "machine/mmboard.h"
|
||||
#include "video/mmdisplay2.h"
|
||||
|
||||
// internal artwork
|
||||
#include "mephisto_berlin.lh"
|
||||
@ -83,8 +84,8 @@ void berlin_state::berlin_mem(address_map &map)
|
||||
map(0x900000, 0x903fff).m("nvram_map", FUNC(address_map_bank_device::amap8)).umask16(0xff00);
|
||||
map(0xa00000, 0xa00000).r(FUNC(berlin_state::input_r));
|
||||
map(0xb00000, 0xb00000).w(m_board, FUNC(mephisto_board_device::mux_w));
|
||||
map(0xc00000, 0xc00000).w("display", FUNC(mephisto_display_modul_device::latch_w));
|
||||
map(0xd00008, 0xd00008).w("display", FUNC(mephisto_display_modul_device::io_w));
|
||||
map(0xc00000, 0xc00000).w("display", FUNC(mephisto_display_module2_device::latch_w));
|
||||
map(0xd00008, 0xd00008).w("display", FUNC(mephisto_display_module2_device::io_w));
|
||||
map(0xe00000, 0xe00000).w(m_board, FUNC(mephisto_board_device::led_w));
|
||||
}
|
||||
|
||||
@ -95,8 +96,8 @@ void berlin_state::berlinp_mem(address_map &map)
|
||||
map(0x800000, 0x800000).r(FUNC(berlin_state::input_r));
|
||||
map(0x900000, 0x900000).w(m_board, FUNC(mephisto_board_device::mux_w));
|
||||
map(0xa00000, 0xa00000).w(m_board, FUNC(mephisto_board_device::led_w));
|
||||
map(0xb00000, 0xb00000).w("display", FUNC(mephisto_display_modul_device::io_w));
|
||||
map(0xc00000, 0xc00000).w("display", FUNC(mephisto_display_modul_device::latch_w));
|
||||
map(0xb00000, 0xb00000).w("display", FUNC(mephisto_display_module2_device::io_w));
|
||||
map(0xc00000, 0xc00000).w("display", FUNC(mephisto_display_module2_device::latch_w));
|
||||
map(0xd00000, 0xd07fff).m("nvram_map", FUNC(address_map_bank_device::amap8)).umask32(0xff000000);
|
||||
}
|
||||
|
||||
@ -135,7 +136,7 @@ void berlin_state::berlin(machine_config &config)
|
||||
ADDRESS_MAP_BANK(config, "nvram_map").set_map(&berlin_state::nvram_map).set_options(ENDIANNESS_BIG, 8, 13);
|
||||
|
||||
MEPHISTO_BUTTONS_BOARD(config, m_board);
|
||||
MEPHISTO_DISPLAY_MODUL(config, "display");
|
||||
MEPHISTO_DISPLAY_MODULE2(config, "display");
|
||||
config.set_default_layout(layout_mephisto_berlin);
|
||||
}
|
||||
|
||||
|
@ -76,6 +76,7 @@ Reminder: unsupported on Almeria and Portorose 1.01, this is not a bug.
|
||||
#include "machine/nvram.h"
|
||||
#include "machine/timer.h"
|
||||
#include "machine/mmboard.h"
|
||||
#include "video/mmdisplay2.h"
|
||||
|
||||
// internal artwork
|
||||
#include "mephisto_alm16.lh" // clickable
|
||||
@ -239,8 +240,8 @@ void mmodular_state::alm16_mem(address_map &map)
|
||||
map(0xf00000, 0xf00003).portr("KEY1");
|
||||
map(0xf00004, 0xf00007).portr("KEY2");
|
||||
map(0xf00008, 0xf0000b).portr("KEY3");
|
||||
map(0xd80000, 0xd80000).w("display", FUNC(mephisto_display_modul_device::latch_w));
|
||||
map(0xd80008, 0xd80008).w("display", FUNC(mephisto_display_modul_device::io_w));
|
||||
map(0xd80000, 0xd80000).w("display", FUNC(mephisto_display_module2_device::latch_w));
|
||||
map(0xd80008, 0xd80008).w("display", FUNC(mephisto_display_module2_device::io_w));
|
||||
}
|
||||
|
||||
void mmodular_state::port16_mem(address_map &map)
|
||||
@ -270,8 +271,8 @@ void mmodular_state::alm32_mem(address_map &map)
|
||||
map(0x800000fc, 0x800000fc).r("board", FUNC(mephisto_board_device::input_r));
|
||||
map(0x88000000, 0x88000007).w("board", FUNC(mephisto_board_device::mux_w)).umask32(0xff000000);
|
||||
map(0x90000000, 0x90000007).w("board", FUNC(mephisto_board_device::led_w)).umask32(0xff000000);
|
||||
map(0xa0000000, 0xa0000000).w("display", FUNC(mephisto_display_modul_device::latch_w));
|
||||
map(0xa0000010, 0xa0000010).w("display", FUNC(mephisto_display_modul_device::io_w));
|
||||
map(0xa0000000, 0xa0000000).w("display", FUNC(mephisto_display_module2_device::latch_w));
|
||||
map(0xa0000010, 0xa0000010).w("display", FUNC(mephisto_display_module2_device::io_w));
|
||||
map(0xa8000000, 0xa8007fff).m("nvram_map", FUNC(address_map_bank_device::amap8)).umask32(0xff000000);
|
||||
}
|
||||
|
||||
@ -305,8 +306,8 @@ void mmodular_state::gen32_mem(address_map &map)
|
||||
map(0xd8000004, 0xd8000004).r(FUNC(mmodular_state::bavaria1_r));
|
||||
map(0xd8000008, 0xd8000008).w(FUNC(mmodular_state::bavaria_w));
|
||||
map(0xd800000c, 0xd800000c).r(FUNC(mmodular_state::bavaria2_r));
|
||||
map(0xe0000000, 0xe0000000).w("display", FUNC(mephisto_display_modul_device::latch_w));
|
||||
map(0xe0000010, 0xe0000010).w("display", FUNC(mephisto_display_modul_device::io_w));
|
||||
map(0xe0000000, 0xe0000000).w("display", FUNC(mephisto_display_module2_device::latch_w));
|
||||
map(0xe0000010, 0xe0000010).w("display", FUNC(mephisto_display_module2_device::io_w));
|
||||
map(0xe8000000, 0xe8007fff).m("nvram_map", FUNC(address_map_bank_device::amap8)).umask32(0xff000000);
|
||||
map(0xf0000004, 0xf0000007).portr("KEY1");
|
||||
map(0xf0000008, 0xf000000b).portr("KEY2");
|
||||
@ -403,7 +404,7 @@ void mmodular_state::alm16(machine_config &config)
|
||||
TIMER(config, "bav_busy").configure_generic(nullptr);
|
||||
|
||||
/* video hardware */
|
||||
MEPHISTO_DISPLAY_MODUL(config, "display");
|
||||
MEPHISTO_DISPLAY_MODULE2(config, "display");
|
||||
config.set_default_layout(layout_mephisto_alm16);
|
||||
}
|
||||
|
||||
|
@ -39,6 +39,7 @@ After boot, it copies ROM to RAM, probably to circumvent waitstates on slow ROM.
|
||||
#include "machine/nvram.h"
|
||||
#include "machine/timer.h"
|
||||
#include "machine/mmboard.h"
|
||||
#include "video/mmdisplay2.h"
|
||||
|
||||
// internal artwork
|
||||
#include "mephisto_modular_tm.lh" // clickable
|
||||
@ -138,8 +139,8 @@ void mmtm_state::mmtm_2m_map(address_map &map)
|
||||
map(0xfc020004, 0xfc020007).portr("KEY1");
|
||||
map(0xfc020008, 0xfc02000b).portr("KEY2");
|
||||
map(0xfc020010, 0xfc020013).portr("KEY3");
|
||||
map(0xfc040000, 0xfc040000).w("display", FUNC(mephisto_display_modul_device::latch_w));
|
||||
map(0xfc060000, 0xfc060000).w("display", FUNC(mephisto_display_modul_device::io_w));
|
||||
map(0xfc040000, 0xfc040000).w("display", FUNC(mephisto_display_module2_device::latch_w));
|
||||
map(0xfc060000, 0xfc060000).w("display", FUNC(mephisto_display_module2_device::io_w));
|
||||
map(0xfc080000, 0xfc080000).w("board", FUNC(mephisto_board_device::mux_w));
|
||||
map(0xfc0a0000, 0xfc0a0000).w("board", FUNC(mephisto_board_device::led_w));
|
||||
map(0xfc0c0000, 0xfc0c0000).r("board", FUNC(mephisto_board_device::input_r));
|
||||
@ -204,7 +205,7 @@ void mmtm_state::mmtm_v(machine_config &config)
|
||||
ADDRESS_MAP_BANK(config, "nvram_map").set_map(&mmtm_state::nvram_map).set_options(ENDIANNESS_BIG, 8, 13);
|
||||
|
||||
MEPHISTO_SENSORS_BOARD(config, "board");
|
||||
MEPHISTO_DISPLAY_MODUL(config, "display");
|
||||
MEPHISTO_DISPLAY_MODULE2(config, "display");
|
||||
config.set_default_layout(layout_mephisto_modular_tm);
|
||||
}
|
||||
|
||||
|
@ -14,13 +14,15 @@ TODO:
|
||||
|
||||
|
||||
#include "emu.h"
|
||||
|
||||
#include "cpu/m6502/m65c02.h"
|
||||
#include "cpu/m6502/m65sc02.h"
|
||||
#include "machine/74259.h"
|
||||
#include "machine/nvram.h"
|
||||
#include "machine/mmboard.h"
|
||||
#include "machine/chessmachine.h"
|
||||
#include "video/hd44780.h"
|
||||
#include "video/mmdisplay2.h"
|
||||
|
||||
#include "speaker.h"
|
||||
|
||||
// internal artwork
|
||||
@ -91,7 +93,7 @@ protected:
|
||||
|
||||
private:
|
||||
required_device<mephisto_board_device> m_board;
|
||||
required_device<mephisto_display_modul_device> m_display;
|
||||
required_device<mephisto_display_module2_device> m_display;
|
||||
output_finder<16> m_leds;
|
||||
uint8_t m_led_latch;
|
||||
};
|
||||
@ -130,8 +132,8 @@ READ8_MEMBER(mephisto_polgar_state::polgar_keys_r)
|
||||
void mephisto_polgar_state::polgar_mem(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x1fff).ram().share("nvram");
|
||||
map(0x2000, 0x2000).w("display", FUNC(mephisto_display_modul_device::latch_w));
|
||||
map(0x2004, 0x2004).w("display", FUNC(mephisto_display_modul_device::io_w));
|
||||
map(0x2000, 0x2000).w("display", FUNC(mephisto_display_module2_device::latch_w));
|
||||
map(0x2004, 0x2004).w("display", FUNC(mephisto_display_module2_device::io_w));
|
||||
map(0x2400, 0x2400).w("board", FUNC(mephisto_board_device::led_w));
|
||||
map(0x2800, 0x2800).w("board", FUNC(mephisto_board_device::mux_w));
|
||||
map(0x2c00, 0x2c07).r(FUNC(mephisto_polgar_state::polgar_keys_r));
|
||||
@ -157,8 +159,8 @@ void mephisto_risc_state::mrisc_mem(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0x0000, 0x1fff).ram().share("nvram");
|
||||
map(0x2000, 0x2000).w("display", FUNC(mephisto_display_modul_device::latch_w));
|
||||
map(0x2004, 0x2004).w("display", FUNC(mephisto_display_modul_device::io_w));
|
||||
map(0x2000, 0x2000).w("display", FUNC(mephisto_display_module2_device::latch_w));
|
||||
map(0x2004, 0x2004).w("display", FUNC(mephisto_display_module2_device::io_w));
|
||||
map(0x2c00, 0x2c07).r(FUNC(mephisto_risc_state::polgar_keys_r));
|
||||
map(0x2400, 0x2400).w("board", FUNC(mephisto_board_device::led_w));
|
||||
map(0x2800, 0x2800).w("board", FUNC(mephisto_board_device::mux_w));
|
||||
@ -203,7 +205,7 @@ void mephisto_milano_state::milano_mem(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x1fbf).ram().share("nvram");
|
||||
|
||||
map(0x1fc0, 0x1fc0).w(m_display, FUNC(mephisto_display_modul_device::latch_w));
|
||||
map(0x1fc0, 0x1fc0).w(m_display, FUNC(mephisto_display_module2_device::latch_w));
|
||||
map(0x1fd0, 0x1fd0).w(FUNC(mephisto_milano_state::milano_led_w));
|
||||
map(0x1fe0, 0x1fe0).r(FUNC(mephisto_milano_state::milano_input_r));
|
||||
map(0x1fe8, 0x1fef).w("outlatch", FUNC(hc259_device::write_d7));
|
||||
@ -314,7 +316,7 @@ void mephisto_polgar_state::polgar(machine_config &config)
|
||||
outlatch.q_out_cb<5>().set_output("led105");
|
||||
|
||||
MEPHISTO_SENSORS_BOARD(config, "board");
|
||||
MEPHISTO_DISPLAY_MODUL(config, "display");
|
||||
MEPHISTO_DISPLAY_MODULE2(config, "display");
|
||||
config.set_default_layout(layout_mephisto_polgar);
|
||||
}
|
||||
|
||||
@ -345,7 +347,7 @@ void mephisto_risc_state::mrisc(machine_config &config)
|
||||
outlatch.parallel_out_cb().set_membank("rombank").rshift(6).mask(0x03).exor(0x01);
|
||||
|
||||
MEPHISTO_SENSORS_BOARD(config, "board");
|
||||
MEPHISTO_DISPLAY_MODUL(config, "display");
|
||||
MEPHISTO_DISPLAY_MODULE2(config, "display");
|
||||
config.set_default_layout(layout_mephisto_polgar);
|
||||
}
|
||||
|
||||
|
@ -2,38 +2,50 @@
|
||||
// copyright-holders:Sandro Ronco
|
||||
/**********************************************************************
|
||||
|
||||
Mephisto Sensors Board emulation
|
||||
Hegener + Glaser Mephisto Sensors Board, for modular chesscomputers
|
||||
- Modular
|
||||
- Muenchen
|
||||
- Exclusive
|
||||
|
||||
Mephisto Display Modul emulation
|
||||
|
||||
This device can also apply to non-modular boards if I/O is same
|
||||
This device can also apply to non-modular boards if I/O is similar
|
||||
Bavaria board is not emulated here, additional handlers for it are in the driver.
|
||||
|
||||
*********************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "mmboard.h"
|
||||
#include "sound/volt_reg.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// DEVICE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
DEFINE_DEVICE_TYPE(MEPHISTO_SENSORS_BOARD, mephisto_sensors_board_device, "msboard", "Mephisto Sensors Board")
|
||||
DEFINE_DEVICE_TYPE(MEPHISTO_BUTTONS_BOARD, mephisto_buttons_board_device, "mbboard", "Mephisto Buttons Board")
|
||||
DEFINE_DEVICE_TYPE(MEPHISTO_DISPLAY_MODUL, mephisto_display_modul_device, "mdisplay_modul", "Mephisto Display Modul")
|
||||
|
||||
|
||||
//***************************************************************************
|
||||
// IMPLEMENTATION
|
||||
//***************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_add_mconfig - add device-specific
|
||||
// machine configuration
|
||||
// constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
mephisto_board_device::mephisto_board_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, type, tag, owner, clock)
|
||||
, m_board(*this, "board")
|
||||
, m_led_pwm(*this, "led_pwm")
|
||||
, m_sensordelay(attotime::from_msec(150))
|
||||
, m_led_out(*this, "led%u", 0U)
|
||||
, m_disable_leds(false)
|
||||
{
|
||||
}
|
||||
|
||||
mephisto_sensors_board_device::mephisto_sensors_board_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: mephisto_board_device(mconfig, MEPHISTO_SENSORS_BOARD, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
mephisto_buttons_board_device::mephisto_buttons_board_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: mephisto_board_device(mconfig, MEPHISTO_BUTTONS_BOARD, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_add_mconfig
|
||||
//-------------------------------------------------
|
||||
|
||||
void mephisto_sensors_board_device::device_add_mconfig(machine_config &config)
|
||||
@ -56,42 +68,6 @@ void mephisto_board_device::set_config(machine_config &config, sensorboard_devic
|
||||
}
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// mephisto_board_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
mephisto_board_device::mephisto_board_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, type, tag, owner, clock)
|
||||
, m_board(*this, "board")
|
||||
, m_led_pwm(*this, "led_pwm")
|
||||
, m_sensordelay(attotime::from_msec(150))
|
||||
, m_led_out(*this, "led%u", 0U)
|
||||
, m_disable_leds(false)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// mephisto_sensors_board_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
mephisto_sensors_board_device::mephisto_sensors_board_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: mephisto_board_device(mconfig, MEPHISTO_SENSORS_BOARD, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// mephisto_buttons_board_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
mephisto_buttons_board_device::mephisto_buttons_board_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: mephisto_board_device(mconfig, MEPHISTO_BUTTONS_BOARD, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
@ -106,17 +82,23 @@ void mephisto_board_device::device_start()
|
||||
m_board->set_delay(m_sensordelay);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void mephisto_board_device::device_reset()
|
||||
{
|
||||
m_mux = 0x00;
|
||||
m_mux = 0xff;
|
||||
m_led_data = 0x00;
|
||||
update_led_pwm();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// I/O handlers
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE8_MEMBER( mephisto_board_device::refresh_leds_w )
|
||||
{
|
||||
if (!m_disable_leds)
|
||||
@ -150,84 +132,3 @@ WRITE8_MEMBER( mephisto_board_device::led_w )
|
||||
m_led_data = data;
|
||||
update_led_pwm();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// mephisto_display_modul_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
mephisto_display_modul_device::mephisto_display_modul_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, MEPHISTO_DISPLAY_MODUL, tag, owner, clock)
|
||||
, m_lcdc(*this, "hd44780")
|
||||
, m_dac(*this, "dac")
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_add_mconfig
|
||||
//-------------------------------------------------
|
||||
|
||||
void mephisto_display_modul_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
/* video hardware */
|
||||
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD));
|
||||
screen.set_refresh_hz(50);
|
||||
screen.set_size(16*6, 9*2);
|
||||
screen.set_visarea(0, 16*6-1, 0, 9*2-3);
|
||||
screen.set_screen_update("hd44780", FUNC(hd44780_device::screen_update));
|
||||
screen.set_palette("palette");
|
||||
PALETTE(config, "palette", FUNC(mephisto_display_modul_device::lcd_palette), 2);
|
||||
|
||||
HD44780(config, m_lcdc, 0);
|
||||
m_lcdc->set_lcd_size(2, 16);
|
||||
|
||||
/* sound hardware */
|
||||
SPEAKER(config, "speaker").front_center();
|
||||
DAC_2BIT_BINARY_WEIGHTED_ONES_COMPLEMENT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25);
|
||||
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
|
||||
vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);
|
||||
vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);
|
||||
}
|
||||
|
||||
|
||||
void mephisto_display_modul_device::lcd_palette(palette_device &palette) const
|
||||
{
|
||||
palette.set_pen_color(0, rgb_t(138, 146, 148));
|
||||
palette.set_pen_color(1, rgb_t(92, 83, 88));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void mephisto_display_modul_device::device_start()
|
||||
{
|
||||
save_item(NAME(m_latch));
|
||||
save_item(NAME(m_ctrl));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void mephisto_display_modul_device::device_reset()
|
||||
{
|
||||
m_latch = 0;
|
||||
m_ctrl = 0;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(mephisto_display_modul_device::latch_w)
|
||||
{
|
||||
m_latch = data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(mephisto_display_modul_device::io_w)
|
||||
{
|
||||
if (BIT(data, 1) && !BIT(m_ctrl, 1))
|
||||
m_lcdc->write(BIT(data, 0), m_latch);
|
||||
|
||||
m_dac->write(data >> 2 & 3);
|
||||
|
||||
m_ctrl = data;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Sandro Ronco
|
||||
/**********************************************************************
|
||||
|
||||
Mephisto Modular
|
||||
Mephisto Sensors Board
|
||||
|
||||
*********************************************************************/
|
||||
|
||||
@ -11,20 +11,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "machine/sensorboard.h"
|
||||
#include "video/hd44780.h"
|
||||
#include "sound/dac.h"
|
||||
#include "video/pwm.h"
|
||||
|
||||
#include "emupal.h"
|
||||
#include "screen.h"
|
||||
#include "speaker.h"
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> mephisto_board_device
|
||||
|
||||
@ -91,39 +80,9 @@ protected:
|
||||
};
|
||||
|
||||
|
||||
// ======================> mephisto_display_modul_device
|
||||
|
||||
class mephisto_display_modul_device : public device_t
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
mephisto_display_modul_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||
|
||||
hd44780_device *get() { return m_lcdc; }
|
||||
|
||||
DECLARE_WRITE8_MEMBER(latch_w);
|
||||
DECLARE_WRITE8_MEMBER(io_w);
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
void lcd_palette(palette_device &palette) const;
|
||||
|
||||
private:
|
||||
optional_device<hd44780_device> m_lcdc;
|
||||
required_device<dac_byte_interface> m_dac;
|
||||
uint8_t m_latch;
|
||||
uint8_t m_ctrl;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(MEPHISTO_SENSORS_BOARD, mephisto_sensors_board_device)
|
||||
DECLARE_DEVICE_TYPE(MEPHISTO_BUTTONS_BOARD, mephisto_buttons_board_device)
|
||||
DECLARE_DEVICE_TYPE(MEPHISTO_DISPLAY_MODUL, mephisto_display_modul_device)
|
||||
|
||||
|
||||
#endif // MAME_MACHINE_MMBOARD_H
|
||||
|
106
src/mame/video/mmdisplay2.cpp
Normal file
106
src/mame/video/mmdisplay2.cpp
Normal file
@ -0,0 +1,106 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Sandro Ronco
|
||||
/**********************************************************************
|
||||
|
||||
Hegener + Glaser Mephisto Display Module for modular chesscomputers,
|
||||
the 2nd version with 2 LCD lines. The 16/32bit module also includes 8KB NVRAM,
|
||||
but that part is emulated in the driver.
|
||||
|
||||
TODO:
|
||||
- add mmdisplay1.cpp, the one with shift registers and 4-digit lcd
|
||||
|
||||
*********************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
|
||||
#include "mmdisplay2.h"
|
||||
#include "sound/volt_reg.h"
|
||||
|
||||
|
||||
DEFINE_DEVICE_TYPE(MEPHISTO_DISPLAY_MODULE2, mephisto_display_module2_device, "mdisplay2", "Mephisto Display Module 2")
|
||||
|
||||
//-------------------------------------------------
|
||||
// constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
mephisto_display_module2_device::mephisto_display_module2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, MEPHISTO_DISPLAY_MODULE2, tag, owner, clock)
|
||||
, m_lcdc(*this, "hd44780")
|
||||
, m_dac(*this, "dac")
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_add_mconfig
|
||||
//-------------------------------------------------
|
||||
|
||||
void mephisto_display_module2_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
/* video hardware */
|
||||
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD));
|
||||
screen.set_refresh_hz(50);
|
||||
screen.set_size(16*6, 9*2);
|
||||
screen.set_visarea(0, 16*6-1, 0, 9*2-3);
|
||||
screen.set_screen_update("hd44780", FUNC(hd44780_device::screen_update));
|
||||
screen.set_palette("palette");
|
||||
PALETTE(config, "palette", FUNC(mephisto_display_module2_device::lcd_palette), 2);
|
||||
|
||||
HD44780(config, m_lcdc, 0);
|
||||
m_lcdc->set_lcd_size(2, 16);
|
||||
|
||||
/* sound hardware */
|
||||
SPEAKER(config, "speaker").front_center();
|
||||
DAC_2BIT_BINARY_WEIGHTED_ONES_COMPLEMENT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25);
|
||||
voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
|
||||
vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);
|
||||
vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);
|
||||
}
|
||||
|
||||
void mephisto_display_module2_device::lcd_palette(palette_device &palette) const
|
||||
{
|
||||
palette.set_pen_color(0, rgb_t(138, 146, 148));
|
||||
palette.set_pen_color(1, rgb_t(92, 83, 88));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void mephisto_display_module2_device::device_start()
|
||||
{
|
||||
save_item(NAME(m_latch));
|
||||
save_item(NAME(m_ctrl));
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void mephisto_display_module2_device::device_reset()
|
||||
{
|
||||
m_latch = 0;
|
||||
m_ctrl = 0;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// I/O handlers
|
||||
//-------------------------------------------------
|
||||
|
||||
WRITE8_MEMBER(mephisto_display_module2_device::latch_w)
|
||||
{
|
||||
m_latch = data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(mephisto_display_module2_device::io_w)
|
||||
{
|
||||
if (BIT(data, 1) && !BIT(m_ctrl, 1))
|
||||
m_lcdc->write(BIT(data, 0), m_latch);
|
||||
|
||||
m_dac->write(data >> 2 & 3);
|
||||
|
||||
m_ctrl = data;
|
||||
}
|
54
src/mame/video/mmdisplay2.h
Normal file
54
src/mame/video/mmdisplay2.h
Normal file
@ -0,0 +1,54 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Sandro Ronco
|
||||
/**********************************************************************
|
||||
|
||||
Mephisto Display Module (2nd version)
|
||||
|
||||
*********************************************************************/
|
||||
|
||||
#ifndef MAME_VIDEO_MMDISPLAY2_H
|
||||
#define MAME_VIDEO_MMDISPLAY2_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "video/hd44780.h"
|
||||
#include "sound/dac.h"
|
||||
|
||||
#include "emupal.h"
|
||||
#include "screen.h"
|
||||
#include "speaker.h"
|
||||
|
||||
|
||||
// ======================> mephisto_display_module2_device
|
||||
|
||||
class mephisto_display_module2_device : public device_t
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
mephisto_display_module2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||
|
||||
hd44780_device *get() { return m_lcdc; }
|
||||
|
||||
DECLARE_WRITE8_MEMBER(latch_w);
|
||||
DECLARE_WRITE8_MEMBER(io_w);
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
void lcd_palette(palette_device &palette) const;
|
||||
|
||||
private:
|
||||
optional_device<hd44780_device> m_lcdc;
|
||||
required_device<dac_byte_interface> m_dac;
|
||||
uint8_t m_latch;
|
||||
uint8_t m_ctrl;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(MEPHISTO_DISPLAY_MODULE2, mephisto_display_module2_device)
|
||||
|
||||
#endif // MAME_VIDEO_MMDISPLAY2_H
|
Loading…
Reference in New Issue
Block a user