summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Robbbert <Robbbert@users.noreply.github.com>2020-07-19 01:05:26 +1000
committer Robbbert <Robbbert@users.noreply.github.com>2020-07-19 01:05:26 +1000
commitbcd68bc7a1c6a795739784739d2b8e23206e12cd (patch)
tree5d7c453693ff8503bc064d42e11d432a7850cd9a
parentb4175b543d38ec6dcb4347fca8382da797ed7567 (diff)
homez80: added natural keyboard/paste
irisha,sm1800,ht68k,tvc: cleanup
-rw-r--r--src/mame/drivers/homez80.cpp128
-rw-r--r--src/mame/drivers/ht68k.cpp45
-rw-r--r--src/mame/drivers/irisha.cpp112
-rw-r--r--src/mame/drivers/sm1800.cpp73
-rw-r--r--src/mame/drivers/tvc.cpp25
5 files changed, 201 insertions, 182 deletions
diff --git a/src/mame/drivers/homez80.cpp b/src/mame/drivers/homez80.cpp
index 0d3f4ddb807..e84d42b71d6 100644
--- a/src/mame/drivers/homez80.cpp
+++ b/src/mame/drivers/homez80.cpp
@@ -76,24 +76,24 @@ void homez80_state::mem_map(address_map &map)
INPUT_PORTS_START( homez80 )
PORT_START("X0")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE)
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q)
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB)
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ESC)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q')
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB) PORT_CHAR(9)
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ESC) PORT_CHAR(27)
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED)
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z)
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_A)
- PORT_START("X1")
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A')
+ PORT_START("X1") // anything on this row is treated as Shift
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE // crude, just another shift key
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LSHIFT)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_RSHIFT)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_START("X2")
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL)
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) // not working
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED)
@@ -102,50 +102,50 @@ INPUT_PORTS_START( homez80 )
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_START("X3")
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F1)
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_W)
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2)
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1))
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W')
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@')
PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED)
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_X)
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_S)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S')
PORT_START("X4")
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F2)
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_E)
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_3)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F3)
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F4)
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2))
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E')
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#')
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3))
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4))
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED)
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C)
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_D)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D')
PORT_START("X5")
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_5)
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R)
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_4)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_T)
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_G)
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_B)
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_V)
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F)
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%')
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R')
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$')
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T')
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G')
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B')
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F')
PORT_START("X6")
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6)
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U)
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_7)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y)
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H)
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N)
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M)
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J)
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^')
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U')
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&')
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y')
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H')
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N')
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J')
PORT_START("X7")
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F8)
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O)
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_9)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F7)
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F8))
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O')
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(')
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7))
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED)
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP)
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L')
PORT_START("X8")
PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SCRLOCK) // nothing
@@ -192,31 +192,31 @@ INPUT_PORTS_START( homez80 )
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1_PAD)
PORT_START("X13")
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS)
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P)
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE)
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE)
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH)
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH)
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON)
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') // '_' not supported
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P')
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')')
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{')
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(39) PORT_CHAR(34)
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') // '|' not supported
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':')
PORT_START("X14")
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS)
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I)
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_8)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE)
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F6)
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+')
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I')
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*')
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}')
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6))
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED)
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA)
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K')
PORT_START("X15")
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F9)
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F9) PORT_CHAR(UCHAR_MAMEKEY(F9))
PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED)
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F10)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSPACE)
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F5)
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE)
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F10) PORT_CHAR(UCHAR_MAMEKEY(F10))
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8)
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5))
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(32)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED)
INPUT_PORTS_END
diff --git a/src/mame/drivers/ht68k.cpp b/src/mame/drivers/ht68k.cpp
index e13dae1aa5d..f65e5d56fed 100644
--- a/src/mame/drivers/ht68k.cpp
+++ b/src/mame/drivers/ht68k.cpp
@@ -40,14 +40,13 @@ class ht68k_state : public driver_device
{
public:
ht68k_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu"),
- m_duart(*this, "duart68681"),
- m_fdc(*this, "wd1770"),
- m_floppy(*this, "wd1770:%u", 0U),
- m_p_ram(*this, "p_ram")
- {
- }
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
+ , m_duart(*this, "duart")
+ , m_fdc(*this, "fdc")
+ , m_floppy(*this, "fdc:%u", 0U)
+ , m_ram(*this, "mainram")
+ { }
void ht68k(machine_config &config);
@@ -59,21 +58,21 @@ private:
DECLARE_WRITE_LINE_MEMBER(duart_txb);
void duart_output(uint8_t data);
- required_shared_ptr<uint16_t> m_p_ram;
- virtual void machine_reset() override;
- void ht68k_mem(address_map &map);
+ required_shared_ptr<uint16_t> m_ram;
+ void machine_reset() override;
+ void mem_map(address_map &map);
};
-void ht68k_state::ht68k_mem(address_map &map)
+void ht68k_state::mem_map(address_map &map)
{
map.unmap_value_high();
- map(0x00000000, 0x0007ffff).ram().share("p_ram"); // 512 KB RAM / ROM at boot
+ map(0x00000000, 0x0007ffff).ram().share("mainram"); // 512 KB RAM / ROM at boot
//map(0x00080000, 0x000fffff) // Expansion
//map(0x00d80000, 0x00d8ffff) // Printer
map(0x00e00000, 0x00e00007).mirror(0xfff8).rw(m_fdc, FUNC(wd1770_device::read), FUNC(wd1770_device::write)).umask16(0x00ff); // FDC WD1770
map(0x00e80000, 0x00e800ff).mirror(0xff00).rw(m_duart, FUNC(mc68681_device::read), FUNC(mc68681_device::write)).umask16(0x00ff);
- map(0x00f00000, 0x00f07fff).rom().mirror(0xf8000).region("bios", 0);
+ map(0x00f00000, 0x00f07fff).rom().mirror(0xf8000).region("maincpu", 0);
}
/* Input ports */
@@ -82,9 +81,9 @@ INPUT_PORTS_END
void ht68k_state::machine_reset()
{
- uint8_t *bios = memregion("bios")->base();
+ uint8_t *bios = memregion("maincpu")->base();
- memcpy((uint8_t*)m_p_ram.target(),bios,0x8000);
+ memcpy((uint8_t*)m_ram.target(),bios,0x8000);
m_fdc->reset();
m_fdc->set_floppy(nullptr);
@@ -126,7 +125,7 @@ void ht68k_state::ht68k(machine_config &config)
{
/* basic machine hardware */
M68000(config, m_maincpu, 8_MHz_XTAL);
- m_maincpu->set_addrmap(AS_PROGRAM, &ht68k_state::ht68k_mem);
+ m_maincpu->set_addrmap(AS_PROGRAM, &ht68k_state::mem_map);
/* video hardware */
MC68681(config, m_duart, 8_MHz_XTAL / 2);
@@ -142,17 +141,17 @@ void ht68k_state::ht68k(machine_config &config)
WD1770(config, m_fdc, 8_MHz_XTAL);
m_fdc->intrq_wr_callback().set_inputline(m_maincpu, M68K_IRQ_4);
- FLOPPY_CONNECTOR(config, "wd1770:0", ht68k_floppies, "525dd", floppy_image_device::default_floppy_formats);
- FLOPPY_CONNECTOR(config, "wd1770:1", ht68k_floppies, nullptr, floppy_image_device::default_floppy_formats);
- FLOPPY_CONNECTOR(config, "wd1770:2", ht68k_floppies, nullptr, floppy_image_device::default_floppy_formats);
- FLOPPY_CONNECTOR(config, "wd1770:3", ht68k_floppies, nullptr, floppy_image_device::default_floppy_formats);
+ FLOPPY_CONNECTOR(config, "fdc:0", ht68k_floppies, "525dd", floppy_image_device::default_floppy_formats);
+ FLOPPY_CONNECTOR(config, "fdc:1", ht68k_floppies, nullptr, floppy_image_device::default_floppy_formats);
+ FLOPPY_CONNECTOR(config, "fdc:2", ht68k_floppies, nullptr, floppy_image_device::default_floppy_formats);
+ FLOPPY_CONNECTOR(config, "fdc:3", ht68k_floppies, nullptr, floppy_image_device::default_floppy_formats);
SOFTWARE_LIST(config, "flop525_list").set_original("ht68k");
}
/* ROM definition */
ROM_START( ht68k )
- ROM_REGION16_BE( 0x8000, "bios", ROMREGION_ERASEFF )
+ ROM_REGION16_BE( 0x8000, "maincpu", 0 )
ROM_LOAD16_BYTE( "ht68k-u4.bin", 0x0001, 0x4000, CRC(3fbcdd0a) SHA1(45fcbbf920dc1e9eada3b7b0a55f5720d08ffdd5))
ROM_LOAD16_BYTE( "ht68k-u3.bin", 0x0000, 0x4000, CRC(1d85d101) SHA1(8ba01e1595b0b3c4fb128a4a50242f3588b89c43))
ROM_END
@@ -160,4 +159,4 @@ ROM_END
/* Driver */
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
-COMP( 1987, ht68k, 0, 0, ht68k, ht68k, ht68k_state, empty_init, "Hawthorne Technology", "TinyGiant HT68k", MACHINE_NO_SOUND_HW )
+COMP( 1987, ht68k, 0, 0, ht68k, ht68k, ht68k_state, empty_init, "Hawthorne Technology", "TinyGiant HT68k", MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/irisha.cpp b/src/mame/drivers/irisha.cpp
index 1fec65039ef..e986c5562c2 100644
--- a/src/mame/drivers/irisha.cpp
+++ b/src/mame/drivers/irisha.cpp
@@ -2,16 +2,23 @@
// copyright-holders:Miodrag Milanovic
/***************************************************************************
- Irisha driver by Miodrag Milanovic
+Irisha driver by Miodrag Milanovic
- 2008-03-27 Preliminary driver.
+2008-03-27 Preliminary driver.
- Jump addresses:
- Option 1: 0800 (Monitor - the only choice that works)
- Option 2: 046E
- Option 3: 0423 (then jumps to 4000)
- Option 4: 0501
- Option 5: 042E
+Jump addresses:
+ Option 1: 0800 (Monitor - the only choice that works)
+ Option 2: 046E
+ Option 3: 0423 (then jumps to 4000)
+ Option 4: 0501
+ Option 5: 042E
+
+TODO:
+- Fix options 2,3,4,5
+- Other emulator has yellow text on blue background
+- Need info on fdc (used in option 3) ports 20-2F,38
+- Currently no way to load or save software, and does any exist?
+- Other emulator has clones/variants with different menus
****************************************************************************/
@@ -34,27 +41,27 @@ public:
: driver_device(mconfig, type, tag)
, m_p_videoram(*this, "videoram")
, m_maincpu(*this, "maincpu")
- , m_pit(*this, "pit8253")
+ , m_pit(*this, "pit")
, m_speaker(*this, "speaker")
- , m_keyboard(*this, "LINE%u", 0)
+ , m_keyboard(*this, "LINE%u", 0U)
{ }
void irisha(machine_config &config);
private:
- uint8_t irisha_keyboard_r();
- uint8_t irisha_8255_portb_r();
- uint8_t irisha_8255_portc_r();
- void irisha_8255_porta_w(uint8_t data);
- void irisha_8255_portb_w(uint8_t data);
- void irisha_8255_portc_w(uint8_t data);
+ uint8_t keyboard_r();
+ uint8_t portb_r();
+ uint8_t portc_r();
+ void porta_w(uint8_t data);
+ void portb_w(uint8_t data);
+ void portc_w(uint8_t data);
DECLARE_WRITE_LINE_MEMBER(speaker_w);
TIMER_CALLBACK_MEMBER(irisha_key);
- uint32_t screen_update_irisha(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
required_shared_ptr<uint8_t> m_p_videoram;
- void irisha_io(address_map &map);
- void irisha_mem(address_map &map);
+ void io_map(address_map &map);
+ void mem_map(address_map &map);
bool m_sg1_line;
bool m_keypressed;
@@ -63,8 +70,8 @@ private:
uint8_t m_ppi_portc;
emu_timer *m_key_timer;
void update_speaker();
- virtual void machine_start() override;
- virtual void machine_reset() override;
+ void machine_start() override;
+ void machine_reset() override;
required_device<cpu_device> m_maincpu;
required_device<pit8253_device> m_pit;
required_device<speaker_sound_device> m_speaker;
@@ -73,20 +80,20 @@ private:
/* Address maps */
-void irisha_state::irisha_mem(address_map &map)
+void irisha_state::mem_map(address_map &map)
{
- map(0x0000, 0x3fff).rom(); // ROM
- map(0x4000, 0xdfff).ram(); // RAM
+ map(0x0000, 0x3fff).rom();
+ map(0x4000, 0xdfff).ram();
map(0xe000, 0xffff).ram().share("videoram");
}
-void irisha_state::irisha_io(address_map &map)
+void irisha_state::io_map(address_map &map)
{
- map(0x04, 0x05).r(FUNC(irisha_state::irisha_keyboard_r));
+ map(0x04, 0x05).r(FUNC(irisha_state::keyboard_r));
map(0x06, 0x07).rw("uart", FUNC(i8251_device::read), FUNC(i8251_device::write));
map(0x08, 0x0B).rw(m_pit, FUNC(pit8253_device::read), FUNC(pit8253_device::write));
- map(0x0C, 0x0F).rw("pic8259", FUNC(pic8259_device::read), FUNC(pic8259_device::write)).mask(0x01);
- map(0x10, 0x13).rw("ppi8255", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x0C, 0x0F).rw("pic", FUNC(pic8259_device::read), FUNC(pic8259_device::write)).mask(0x01);
+ map(0x10, 0x13).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write));
}
/* Input ports */
@@ -198,7 +205,7 @@ INPUT_PORTS_END
*************************************************/
-uint32_t irisha_state::screen_update_irisha(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+uint32_t irisha_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
uint8_t gfx;
uint16_t y,ma=0,x;
@@ -228,7 +235,7 @@ uint32_t irisha_state::screen_update_irisha(screen_device &screen, bitmap_ind16
}
/* F4 Character Displayer */
-static const gfx_layout irisha_charlayout =
+static const gfx_layout charlayout =
{
8, 8, /* 8 x 8 characters */
256, /* 256 characters */
@@ -242,7 +249,7 @@ static const gfx_layout irisha_charlayout =
};
static GFXDECODE_START( gfx_irisha )
- GFXDECODE_ENTRY( "maincpu", 0x3800, irisha_charlayout, 0, 1 )
+ GFXDECODE_ENTRY( "maincpu", 0x3800, charlayout, 0, 1 )
GFXDECODE_END
@@ -252,7 +259,7 @@ GFXDECODE_END
*************************************************/
-uint8_t irisha_state::irisha_8255_portb_r()
+uint8_t irisha_state::portb_r()
{
if (m_keypressed==1)
{
@@ -263,13 +270,13 @@ uint8_t irisha_state::irisha_8255_portb_r()
return 0x00;
}
-uint8_t irisha_state::irisha_8255_portc_r()
+uint8_t irisha_state::portc_r()
{
logerror("irisha_8255_portc_r\n");
return 0;
}
-void irisha_state::irisha_8255_porta_w(uint8_t data)
+void irisha_state::porta_w(uint8_t data)
{
logerror("irisha_8255_porta_w %02x\n",data);
@@ -278,12 +285,12 @@ void irisha_state::irisha_8255_porta_w(uint8_t data)
update_speaker();
}
-void irisha_state::irisha_8255_portb_w(uint8_t data)
+void irisha_state::portb_w(uint8_t data)
{
logerror("irisha_8255_portb_w %02x\n",data);
}
-void irisha_state::irisha_8255_portc_w(uint8_t data)
+void irisha_state::portc_w(uint8_t data)
{
//logerror("irisha_8255_portc_w %02x\n",data);
@@ -329,7 +336,7 @@ TIMER_CALLBACK_MEMBER(irisha_state::irisha_key)
m_keyboard_cnt = 0;
}
-uint8_t irisha_state::irisha_keyboard_r()
+uint8_t irisha_state::keyboard_r()
{
uint8_t keycode = 0xff;
@@ -352,6 +359,11 @@ void irisha_state::machine_start()
{
m_key_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(irisha_state::irisha_key),this));
m_key_timer->adjust(attotime::from_msec(30), 0, attotime::from_msec(30));
+ save_item(NAME(m_sg1_line));
+ save_item(NAME(m_keypressed));
+ save_item(NAME(m_keyboard_cnt));
+ save_item(NAME(m_ppi_porta));
+ save_item(NAME(m_ppi_portc));
}
void irisha_state::machine_reset()
@@ -368,8 +380,8 @@ void irisha_state::irisha(machine_config &config)
{
/* basic machine hardware */
I8080(config, m_maincpu, XTAL(16'000'000) / 9);
- m_maincpu->set_addrmap(AS_PROGRAM, &irisha_state::irisha_mem);
- m_maincpu->set_addrmap(AS_IO, &irisha_state::irisha_io);
+ m_maincpu->set_addrmap(AS_PROGRAM, &irisha_state::mem_map);
+ m_maincpu->set_addrmap(AS_IO, &irisha_state::io_map);
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
@@ -377,7 +389,7 @@ void irisha_state::irisha(machine_config &config)
screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
screen.set_size(320, 200);
screen.set_visarea(0, 320-1, 0, 200-1);
- screen.set_screen_update(FUNC(irisha_state::screen_update_irisha));
+ screen.set_screen_update(FUNC(irisha_state::screen_update));
screen.set_palette("palette");
GFXDECODE(config, "gfxdecode", "palette", gfx_irisha);
@@ -392,32 +404,32 @@ void irisha_state::irisha(machine_config &config)
PIT8253(config, m_pit, 0);
m_pit->set_clk<0>(16_MHz_XTAL / 9);
- m_pit->out_handler<0>().set("pic8259", FUNC(pic8259_device::ir0_w));
+ m_pit->out_handler<0>().set("pic", FUNC(pic8259_device::ir0_w));
m_pit->set_clk<1>(16_MHz_XTAL / 9 / 8 / 8);
m_pit->out_handler<1>().set("uart", FUNC(i8251_device::write_txc));
m_pit->out_handler<1>().append("uart", FUNC(i8251_device::write_rxc));
m_pit->set_clk<2>(16_MHz_XTAL / 9);
m_pit->out_handler<2>().set(FUNC(irisha_state::speaker_w));
- i8255_device &ppi(I8255(config, "ppi8255"));
- ppi.out_pa_callback().set(FUNC(irisha_state::irisha_8255_porta_w));
- ppi.in_pb_callback().set(FUNC(irisha_state::irisha_8255_portb_r));
- ppi.out_pb_callback().set(FUNC(irisha_state::irisha_8255_portb_w));
- ppi.in_pc_callback().set(FUNC(irisha_state::irisha_8255_portc_r));
- ppi.out_pc_callback().set(FUNC(irisha_state::irisha_8255_portc_w));
+ i8255_device &ppi(I8255(config, "ppi"));
+ ppi.out_pa_callback().set(FUNC(irisha_state::porta_w));
+ ppi.in_pb_callback().set(FUNC(irisha_state::portb_r));
+ ppi.out_pb_callback().set(FUNC(irisha_state::portb_w));
+ ppi.in_pc_callback().set(FUNC(irisha_state::portc_r));
+ ppi.out_pc_callback().set(FUNC(irisha_state::portc_w));
- pic8259_device &pic8259(PIC8259(config, "pic8259", 0));
+ pic8259_device &pic8259(PIC8259(config, "pic", 0));
pic8259.out_int_callback().set_inputline(m_maincpu, 0);
}
/* ROM definition */
ROM_START( irisha )
- ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
+ ROM_REGION( 0x4000, "maincpu", 0 )
ROM_LOAD( "ir_bootm.bin", 0x0000, 0x2000, CRC(7f9f4f0e) SHA1(05f97e1a1d7a15f4451129dba6c0bddc87ea748e))
ROM_LOAD( "ir_conou.bin", 0x2000, 0x2000, CRC(bf92beed) SHA1(696c482ba53bc6261db11061ecc7141c67f1d820))
ROM_END
/* Driver */
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
-COMP( 1983, irisha, 0, 0, irisha, irisha, irisha_state, empty_init, "MGU", "Irisha", MACHINE_NOT_WORKING)
+COMP( 1983, irisha, 0, 0, irisha, irisha, irisha_state, empty_init, "MGU", "Irisha", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/sm1800.cpp b/src/mame/drivers/sm1800.cpp
index 6754a5af21b..342991fa81c 100644
--- a/src/mame/drivers/sm1800.cpp
+++ b/src/mame/drivers/sm1800.cpp
@@ -30,9 +30,9 @@ public:
sm1800_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
- , m_uart(*this, "i8251")
- , m_ppi(*this, "i8255")
- , m_crtc(*this, "i8275")
+ , m_uart(*this, "uart")
+ , m_ppi(*this, "ppi")
+ , m_crtc(*this, "crtc")
, m_palette(*this, "palette")
{ }
@@ -44,29 +44,29 @@ private:
required_device<i8255_device> m_ppi;
required_device<i8275_device> m_crtc;
required_device<palette_device> m_palette;
- void sm1800_8255_portb_w(uint8_t data);
- void sm1800_8255_portc_w(uint8_t data);
- uint8_t sm1800_8255_porta_r();
- uint8_t sm1800_8255_portc_r();
+ void portb_w(uint8_t data);
+ void portc_w(uint8_t data);
+ uint8_t porta_r();
+ uint8_t portc_r();
uint8_t m_irq_state;
- virtual void machine_reset() override;
+ void machine_start() override;
void sm1800_palette(palette_device &palette) const;
- INTERRUPT_GEN_MEMBER(sm1800_vblank_interrupt);
- IRQ_CALLBACK_MEMBER(sm1800_irq_callback);
+ INTERRUPT_GEN_MEMBER(vblank_interrupt);
+ IRQ_CALLBACK_MEMBER(irq_callback);
I8275_DRAW_CHARACTER_MEMBER( crtc_display_pixels );
- void sm1800_io(address_map &map);
- void sm1800_mem(address_map &map);
+ void io_map(address_map &map);
+ void mem_map(address_map &map);
};
-void sm1800_state::sm1800_mem(address_map &map)
+void sm1800_state::mem_map(address_map &map)
{
map.unmap_value_high();
map(0x0000, 0x07ff).rom();
- //map(0x0fb0, 0x0fff).w("i8275", FUNC(i8275_device::dack_w));
+ //map(0x0fb0, 0x0fff).w("crtc", FUNC(i8275_device::dack_w));
map(0x1000, 0x17ff).ram(); // videoram looks like 1080-17FF, normal ascii
}
-void sm1800_state::sm1800_io(address_map &map)
+void sm1800_state::io_map(address_map &map)
{
map.global_mask(0xff);
map.unmap_value_high();
@@ -81,16 +81,17 @@ void sm1800_state::sm1800_io(address_map &map)
static INPUT_PORTS_START( sm1800 )
INPUT_PORTS_END
-IRQ_CALLBACK_MEMBER(sm1800_state::sm1800_irq_callback)
+IRQ_CALLBACK_MEMBER(sm1800_state::irq_callback)
{
return 0xff;
}
-void sm1800_state::machine_reset()
+void sm1800_state::machine_start()
{
+ save_item(NAME(m_irq_state));
}
-INTERRUPT_GEN_MEMBER(sm1800_state::sm1800_vblank_interrupt)
+INTERRUPT_GEN_MEMBER(sm1800_state::vblank_interrupt)
{
m_maincpu->set_input_line(0, m_irq_state ? HOLD_LINE : CLEAR_LINE);
m_irq_state ^= 1;
@@ -115,20 +116,20 @@ I8275_DRAW_CHARACTER_MEMBER( sm1800_state::crtc_display_pixels )
bitmap.pix32(y, x + i) = palette[(pixels >> (7-i)) & 1 ? (hlgt ? 2 : 1) : 0];
}
-void sm1800_state::sm1800_8255_portb_w(uint8_t data)
+void sm1800_state::portb_w(uint8_t data)
{
}
-void sm1800_state::sm1800_8255_portc_w(uint8_t data)
+void sm1800_state::portc_w(uint8_t data)
{
}
-uint8_t sm1800_state::sm1800_8255_porta_r()
+uint8_t sm1800_state::porta_r()
{
return 0xff;
}
-uint8_t sm1800_state::sm1800_8255_portc_r()
+uint8_t sm1800_state::portc_r()
{
return 0;
}
@@ -142,7 +143,7 @@ void sm1800_state::sm1800_palette(palette_device &palette) const
/* F4 Character Displayer */
-static const gfx_layout sm1800_charlayout =
+static const gfx_layout charlayout =
{
8, 8, /* 8 x 8 characters */
256, /* 256 characters */
@@ -156,7 +157,7 @@ static const gfx_layout sm1800_charlayout =
};
static GFXDECODE_START( gfx_sm1800 )
- GFXDECODE_ENTRY( "chargen", 0x0000, sm1800_charlayout, 0, 1 )
+ GFXDECODE_ENTRY( "chargen", 0x0000, charlayout, 0, 1 )
GFXDECODE_END
@@ -164,14 +165,14 @@ void sm1800_state::sm1800(machine_config &config)
{
/* basic machine hardware */
I8080(config, m_maincpu, XTAL(2'000'000));
- m_maincpu->set_addrmap(AS_PROGRAM, &sm1800_state::sm1800_mem);
- m_maincpu->set_addrmap(AS_IO, &sm1800_state::sm1800_io);
- m_maincpu->set_vblank_int("screen", FUNC(sm1800_state::sm1800_vblank_interrupt));
- m_maincpu->set_irq_acknowledge_callback(FUNC(sm1800_state::sm1800_irq_callback));
+ m_maincpu->set_addrmap(AS_PROGRAM, &sm1800_state::mem_map);
+ m_maincpu->set_addrmap(AS_IO, &sm1800_state::io_map);
+ m_maincpu->set_vblank_int("screen", FUNC(sm1800_state::vblank_interrupt));
+ m_maincpu->set_irq_acknowledge_callback(FUNC(sm1800_state::irq_callback));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
- screen.set_screen_update("i8275", FUNC(i8275_device::screen_update));
+ screen.set_screen_update("crtc", FUNC(i8275_device::screen_update));
screen.set_refresh_hz(50);
screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
screen.set_size(640, 480);
@@ -182,10 +183,10 @@ void sm1800_state::sm1800(machine_config &config)
/* Devices */
I8255(config, m_ppi);
- m_ppi->in_pa_callback().set(FUNC(sm1800_state::sm1800_8255_porta_r));
- m_ppi->out_pb_callback().set(FUNC(sm1800_state::sm1800_8255_portb_w));
- m_ppi->in_pc_callback().set(FUNC(sm1800_state::sm1800_8255_portc_r));
- m_ppi->out_pc_callback().set(FUNC(sm1800_state::sm1800_8255_portc_w));
+ m_ppi->in_pa_callback().set(FUNC(sm1800_state::porta_r));
+ m_ppi->out_pb_callback().set(FUNC(sm1800_state::portb_w));
+ m_ppi->in_pc_callback().set(FUNC(sm1800_state::portc_r));
+ m_ppi->out_pc_callback().set(FUNC(sm1800_state::portc_w));
I8275(config, m_crtc, 2000000);
m_crtc->set_character_width(8);
@@ -196,14 +197,14 @@ void sm1800_state::sm1800(machine_config &config)
/* ROM definition */
ROM_START( sm1800 )
- ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
+ ROM_REGION( 0x0800, "maincpu", 0 )
ROM_LOAD( "prog.bin", 0x0000, 0x0800, CRC(55736ad5) SHA1(b77f720f1b64b208dd6a5d4f9c9521d1284028e9))
- ROM_REGION(0x0800, "chargen", 0)
+ ROM_REGION( 0x0800, "chargen", 0 )
ROM_LOAD( "font.bin", 0x0000, 0x0800, CRC(28ed9ebc) SHA1(f561136962a06a5dcb5a0436931d29e940155d24))
ROM_END
/* Driver */
/* YEAR NAME PARENT COMPAT MACHINE INPUT STATE INIT COMPANY FULLNAME FLAGS */
-COMP( ????, sm1800, 0, 0, sm1800, sm1800, sm1800_state, empty_init, "<unknown>", "SM1800", MACHINE_NOT_WORKING | MACHINE_NO_SOUND)
+COMP( ????, sm1800, 0, 0, sm1800, sm1800, sm1800_state, empty_init, "<unknown>", "SM1800", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/tvc.cpp b/src/mame/drivers/tvc.cpp
index 6d58c8d57e4..3fff0ca5fca 100644
--- a/src/mame/drivers/tvc.cpp
+++ b/src/mame/drivers/tvc.cpp
@@ -575,19 +575,17 @@ void tvc_state::machine_start()
m_int_flipflop = 0;
- uint8_t *ptr = static_cast<uint8_t *>(m_ram->pointer());
- memset(&ptr[0], 0, m_ram->size());
-
- m_bank1->space(0).install_ram(0x8000, 0xbfff, &ptr[0x0000]);
- m_maincpu->space(AS_PROGRAM).install_ram(0x4000, 0x7fff, &ptr[0x4000]);
+ u8 *r = m_ram->pointer();
+ m_bank1->space(0).install_ram(0x8000, 0xbfff, r);
+ m_maincpu->space(AS_PROGRAM).install_ram(0x4000, 0x7fff, r+0x4000);
if (m_ram->size() > 0x8000)
{
- m_bank3->space(0).install_ram(0x4000, 0x7fff, &ptr[0x8000]);
- m_bank4->space(0).install_ram(0x8000, 0xbfff, &ptr[0xc000]);
+ m_bank3->space(0).install_ram(0x4000, 0x7fff, r+0x8000);
+ m_bank4->space(0).install_ram(0x8000, 0xbfff, r+0xc000);
}
memory_share *vram = memshare("vram");
- if (vram != nullptr)
+ if (vram)
m_vram_base = static_cast<uint8_t *>(vram->ptr());
m_vram_bank = 0;
@@ -598,6 +596,15 @@ void tvc_state::machine_start()
m_bank1->space(0).install_rom(0x4000, 0x7fff, cart_rom->base());
m_bank4->space(0).install_rom(0x0000, 0x3fff, cart_rom->base());
}
+
+ save_item(NAME(m_video_mode));
+ save_item(NAME(m_keyline));
+ save_item(NAME(m_active_slot));
+ save_item(NAME(m_int_flipflop));
+ save_item(NAME(m_col));
+ save_item(NAME(m_vram_bank));
+ save_item(NAME(m_cassette_ff));
+ save_item(NAME(m_centronics_ff));
}
void tvc64p_state::machine_start()
@@ -798,7 +805,7 @@ void tvc_state::tvc(machine_config &config)
crtc.out_cur_callback().set(FUNC(tvc_state::int_ff_set));
/* internal ram */
- RAM(config, RAM_TAG).set_default_size("64K").set_extra_options("32K");
+ RAM(config, RAM_TAG).set_default_value(0x00).set_default_size("64K").set_extra_options("32K");
/* sound hardware */
SPEAKER(config, "mono").front_center();