summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2019-06-14 10:19:04 -0400
committer AJR <ajrhacker@users.noreply.github.com>2019-06-14 10:19:04 -0400
commit0ea26b370b5896632af6baa2c3d7c66f3de2c3bd (patch)
tree8abb87373c4a32db1e3702cb64ec5e506218cb07
parentab6d6e06ea82f22fa4a17dce4d6c2a2bb0fc6b29 (diff)
itt1700: Show something, even if it's mostly meaningless now (nw)
-rw-r--r--src/mame/drivers/itt1700.cpp28
-rw-r--r--src/mame/machine/itt1700_kbd.cpp80
2 files changed, 67 insertions, 41 deletions
diff --git a/src/mame/drivers/itt1700.cpp b/src/mame/drivers/itt1700.cpp
index 7bdb2fe4b79..13e83c14c6c 100644
--- a/src/mame/drivers/itt1700.cpp
+++ b/src/mame/drivers/itt1700.cpp
@@ -19,8 +19,11 @@ This device may be related to the Intel 8251, but it is definitely not a SCN2651
#include "cpu/z80/z80.h"
#include "cpu/mcs48/mcs48.h"
#include "machine/itt1700_kbd.h"
+#include "sound/dac.h"
+#include "sound/volt_reg.h"
#include "video/mc6845.h"
#include "screen.h"
+#include "speaker.h"
class itt1700_state : public driver_device
@@ -29,6 +32,7 @@ public:
itt1700_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
+ , m_videoram(*this, "videoram")
, m_chargen(*this, "chargen")
{
}
@@ -42,18 +46,33 @@ private:
void io_map(address_map &map);
required_device<cpu_device> m_maincpu;
+ required_shared_ptr<u8> m_videoram;
required_region_ptr<u8> m_chargen;
};
MC6845_UPDATE_ROW(itt1700_state::update_row)
{
+ u32 *px = &bitmap.pix32(y);
+ u16 page = 0x800;
+
+ for (int i = 0; i < x_count; i++)
+ {
+ u8 chr = m_videoram[((ma + i) & 0x7ff) | page];
+ u16 dots = m_chargen[u16(chr) << 4 | ra] << 1;
+ rgb_t fg = rgb_t::white();
+ rgb_t bg = rgb_t::black();
+
+ for (int n = 9; n > 0; n--, dots <<= 1)
+ *px++ = BIT(dots, 8) ? fg : bg;
+ }
}
void itt1700_state::mem_map(address_map &map)
{
map(0x0000, 0x0fff).rom().region("maincpu", 0);
- map(0x2000, 0x7fff).ram();
+ map(0x2000, 0x3fff).ram().share("videoram");
+ map(0x4000, 0x7fff).ram();
map(0x8000, 0x8000).nopr();
}
@@ -78,6 +97,7 @@ void itt1700_state::itt1700(machine_config &config)
upi.p1_out_cb().set("keyboard", FUNC(itt1700_keyboard_device::clock_w)).bit(0);
upi.p1_out_cb().append("keyboard", FUNC(itt1700_keyboard_device::line1_w)).bit(1);
upi.p1_out_cb().append("keyboard", FUNC(itt1700_keyboard_device::line2_w)).bit(2);
+ upi.p2_out_cb().set("dac", FUNC(dac_byte_interface::write)).mask(0x07);
upi.t0_in_cb().set("keyboard", FUNC(itt1700_keyboard_device::sense_r));
ITT1700_KEYBOARD(config, "keyboard");
@@ -91,6 +111,12 @@ void itt1700_state::itt1700(machine_config &config)
crtc.set_screen("screen");
crtc.set_show_border_area(false);
crtc.set_update_row_callback(FUNC(itt1700_state::update_row), this);
+
+ SPEAKER(config, "speaker").front_center();
+
+ DAC_3BIT_BINARY_WEIGHTED(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.5);
+ 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);
}
ROM_START(itt1700)
diff --git a/src/mame/machine/itt1700_kbd.cpp b/src/mame/machine/itt1700_kbd.cpp
index 23cbe0dd94b..e8cfdb7c6e7 100644
--- a/src/mame/machine/itt1700_kbd.cpp
+++ b/src/mame/machine/itt1700_kbd.cpp
@@ -96,54 +96,54 @@ READ_LINE_MEMBER(itt1700_keyboard_device::sense_r)
static INPUT_PORTS_START(itt1700_kbd)
PORT_START("KEY0")
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("01") PORT_CODE(KEYCODE_1)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("02") PORT_CODE(KEYCODE_2)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("03") PORT_CODE(KEYCODE_3)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("04") PORT_CODE(KEYCODE_4)
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("05") PORT_CODE(KEYCODE_5)
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("06") PORT_CODE(KEYCODE_6)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("07") PORT_CODE(KEYCODE_7)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("08") PORT_CODE(KEYCODE_8)
PORT_START("KEY1")
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("09") PORT_CODE(KEYCODE_Q)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0A") PORT_CODE(KEYCODE_W)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0B") PORT_CODE(KEYCODE_E)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0C") PORT_CODE(KEYCODE_R)
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0D") PORT_CODE(KEYCODE_T)
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0E") PORT_CODE(KEYCODE_Y)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0F") PORT_CODE(KEYCODE_U)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("10") PORT_CODE(KEYCODE_I)
PORT_START("KEY2")
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("11") PORT_CODE(KEYCODE_A)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("12") PORT_CODE(KEYCODE_S)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("13") PORT_CODE(KEYCODE_D)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("14") PORT_CODE(KEYCODE_F)
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("15") PORT_CODE(KEYCODE_G)
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("16") PORT_CODE(KEYCODE_H)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("17") PORT_CODE(KEYCODE_J)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("18") PORT_CODE(KEYCODE_K)
PORT_START("KEY3")
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("19") PORT_CODE(KEYCODE_Z)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1A") PORT_CODE(KEYCODE_X)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1B") PORT_CODE(KEYCODE_C)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1C") PORT_CODE(KEYCODE_V)
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1D") PORT_CODE(KEYCODE_B)
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1E") PORT_CODE(KEYCODE_N)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1F") PORT_CODE(KEYCODE_M)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("20") PORT_CODE(KEYCODE_COMMA)
PORT_START("KEY4")
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("21") PORT_CODE(KEYCODE_9)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("22") PORT_CODE(KEYCODE_0)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("23") PORT_CODE(KEYCODE_O)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("24") PORT_CODE(KEYCODE_P)
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("25") PORT_CODE(KEYCODE_L)
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("26") PORT_CODE(KEYCODE_COLON)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("27") PORT_CODE(KEYCODE_STOP)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("28") PORT_CODE(KEYCODE_SLASH)
PORT_START("KEY5")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNKNOWN)