summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess
diff options
context:
space:
mode:
author Curt Coder <curtcoder@mail.com>2013-01-31 15:11:56 +0000
committer Curt Coder <curtcoder@mail.com>2013-01-31 15:11:56 +0000
commitfa364e9f4e2b3156a8df9c62c57c2e3cb7e6bc05 (patch)
tree59782c1efe8c8d2a17205f3d21d09aadd79c4fbd /src/mess
parent4da722067118e4d7a65dc375aaffa5506d222c89 (diff)
(MESS) Input fixes. (nw)
Diffstat (limited to 'src/mess')
-rw-r--r--src/mess/drivers/cosmicos.c9
-rw-r--r--src/mess/drivers/huebler.c29
-rw-r--r--src/mess/drivers/newbrain.c26
-rw-r--r--src/mess/drivers/sg1000.c34
-rw-r--r--src/mess/drivers/tiki100.c17
-rw-r--r--src/mess/drivers/tmc1800.c33
-rw-r--r--src/mess/drivers/tmc2000e.c114
-rw-r--r--src/mess/drivers/tmc600.c14
-rw-r--r--src/mess/includes/cosmicos.h1
-rw-r--r--src/mess/includes/huebler.h3
-rw-r--r--src/mess/includes/newbrain.h6
-rw-r--r--src/mess/includes/sg1000.h2
-rw-r--r--src/mess/includes/tiki100.h1
-rw-r--r--src/mess/includes/tmc1800.h37
-rw-r--r--src/mess/includes/tmc2000e.h56
-rw-r--r--src/mess/includes/tmc600.h2
16 files changed, 269 insertions, 115 deletions
diff --git a/src/mess/drivers/cosmicos.c b/src/mess/drivers/cosmicos.c
index 7c3e422c248..f4b16a59ea6 100644
--- a/src/mess/drivers/cosmicos.c
+++ b/src/mess/drivers/cosmicos.c
@@ -79,7 +79,6 @@ WRITE8_MEMBER( cosmicos_state::audio_latch_w )
READ8_MEMBER( cosmicos_state::hex_keyboard_r )
{
- ioport_port *ports[4] = { m_y1, m_y2, m_y3, m_y4 };
UINT8 data = 0;
int i;
@@ -87,7 +86,7 @@ READ8_MEMBER( cosmicos_state::hex_keyboard_r )
{
if (BIT(m_keylatch, i))
{
- UINT8 keydata = ports[i]->read();
+ UINT8 keydata = m_key_row[i]->read();
if (BIT(keydata, 0)) data |= 0x01;
if (BIT(keydata, 1)) data |= 0x02;
@@ -501,6 +500,12 @@ void cosmicos_state::machine_start()
set_ram_mode();
+ // find keyboard rows
+ m_key_row[0] = m_y1;
+ m_key_row[1] = m_y2;
+ m_key_row[2] = m_y3;
+ m_key_row[3] = m_y4;
+
/* register for state saving */
save_item(NAME(m_wait));
save_item(NAME(m_clear));
diff --git a/src/mess/drivers/huebler.c b/src/mess/drivers/huebler.c
index 1f4071b2eea..12bd76a6e90 100644
--- a/src/mess/drivers/huebler.c
+++ b/src/mess/drivers/huebler.c
@@ -24,10 +24,7 @@
void amu880_state::scan_keyboard()
{
- ioport_port* ports[16] = { m_y0, m_y1, m_y2, m_y3, m_y4, m_y5, m_y6, m_y7,
- m_y8, m_y9, m_y10, m_y11, m_y12, m_y13, m_y14, m_y15 };
-
- UINT8 data = ports[m_key_a8 ? m_key_d6 : m_key_d7]->read();
+ UINT8 data = m_key_row[m_key_a8 ? m_key_d6 : m_key_d7]->read();
int a8 = (data & 0x0f) == 0x0f;
@@ -210,7 +207,7 @@ INPUT_PORTS_END
/* Video */
-UINT32 amu880_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 amu880_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
int y, sx, x, line;
@@ -230,7 +227,7 @@ UINT32 amu880_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
{
int color = ((line > 7) ? 0 : BIT(data, 7)) ^ BIT(videoram_data, 7);
- bitmap.pix16(y, (sx * 6) + x) = color;
+ bitmap.pix32(y, (sx * 6) + x) = RGB_MONOCHROME_WHITE[color];
data <<= 1;
}
@@ -335,6 +332,24 @@ static const z80_daisy_config amu880_daisy_chain[] =
void amu880_state::machine_start()
{
+ // find keyboard rows
+ m_key_row[0] = m_y0;
+ m_key_row[1] = m_y1;
+ m_key_row[2] = m_y2;
+ m_key_row[3] = m_y3;
+ m_key_row[4] = m_y4;
+ m_key_row[5] = m_y5;
+ m_key_row[6] = m_y6;
+ m_key_row[7] = m_y7;
+ m_key_row[8] = m_y8;
+ m_key_row[9] = m_y9;
+ m_key_row[10] = m_y10;
+ m_key_row[11] = m_y11;
+ m_key_row[12] = m_y12;
+ m_key_row[13] = m_y13;
+ m_key_row[14] = m_y14;
+ m_key_row[15] = m_y15;
+
/* register for state saving */
save_item(NAME(m_key_d6));
save_item(NAME(m_key_d7));
@@ -388,8 +403,6 @@ static MACHINE_CONFIG_START( amu880, amu880_state )
MCFG_SCREEN_RAW_PARAMS(9000000, 576, 0*6, 64*6, 320, 0*10, 24*10)
MCFG_GFXDECODE(amu880)
- MCFG_PALETTE_LENGTH(2)
- MCFG_PALETTE_INIT(black_and_white)
/* devices */
MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_10MHz/4, ctc_intf)
diff --git a/src/mess/drivers/newbrain.c b/src/mess/drivers/newbrain.c
index dbe63b081a2..e8473225b04 100644
--- a/src/mess/drivers/newbrain.c
+++ b/src/mess/drivers/newbrain.c
@@ -443,9 +443,6 @@ WRITE8_MEMBER( newbrain_state::cop_d_w )
*/
- ioport_port* ports[16] = { m_y0, m_y1, m_y2, m_y3, m_y4, m_y5, m_y6, m_y7,
- m_y8, m_y9, m_y10, m_y11, m_y12, m_y13, m_y14, m_y15 };
-
/* keyboard row reset */
if (!BIT(data, 0))
@@ -471,7 +468,7 @@ WRITE8_MEMBER( newbrain_state::cop_d_w )
m_keylatch = 0;
}
- m_keydata = ports[m_keylatch]->read();
+ m_keydata = m_key_row[m_keylatch]->read();
output_set_digit_value(m_keylatch, m_segment_data[m_keylatch]);
}
@@ -1269,6 +1266,24 @@ void newbrain_state::machine_start()
/* set up memory banking */
bankswitch();
+ // find keyboard rows
+ m_key_row[0] = m_y0;
+ m_key_row[1] = m_y1;
+ m_key_row[2] = m_y2;
+ m_key_row[3] = m_y3;
+ m_key_row[4] = m_y4;
+ m_key_row[5] = m_y5;
+ m_key_row[6] = m_y6;
+ m_key_row[7] = m_y7;
+ m_key_row[8] = m_y8;
+ m_key_row[9] = m_y9;
+ m_key_row[10] = m_y10;
+ m_key_row[11] = m_y11;
+ m_key_row[12] = m_y12;
+ m_key_row[13] = m_y13;
+ m_key_row[14] = m_y14;
+ m_key_row[15] = m_y15;
+
/* register for state saving */
save_item(NAME(m_pwrup));
save_item(NAME(m_userint));
@@ -1297,10 +1312,9 @@ void newbrain_eim_state::machine_start()
newbrain_state::machine_start();
/* allocate expansion RAM */
- m_eim_ram = auto_alloc_array(machine(), UINT8, NEWBRAIN_EIM_RAM_SIZE);
+ m_eim_ram.allocate(NEWBRAIN_EIM_RAM_SIZE);
/* register for state saving */
- save_pointer(NAME(m_eim_ram), NEWBRAIN_EIM_RAM_SIZE);
save_item(NAME(m_mpm));
save_item(NAME(m_a16));
save_item(NAME(m_pr));
diff --git a/src/mess/drivers/sg1000.c b/src/mess/drivers/sg1000.c
index eabb6d72943..b080e573aa7 100644
--- a/src/mess/drivers/sg1000.c
+++ b/src/mess/drivers/sg1000.c
@@ -522,7 +522,7 @@ WRITE_LINE_MEMBER(sg1000_state::sg1000_vdp_interrupt)
static TMS9928A_INTERFACE(sg1000_tms9918a_interface)
{
- "screen",
+ SCREEN_TAG,
0x4000,
DEVCB_DRIVER_LINE_MEMBER(sg1000_state,sg1000_vdp_interrupt)
};
@@ -546,9 +546,7 @@ READ8_MEMBER( sc3000_state::ppi_pa_r )
PA7 Keyboard input
*/
- ioport_port *ports[8] = { m_pa0, m_pa1, m_pa2, m_pa3, m_pa4, m_pa5, m_pa6, m_pa7 };
-
- return ports[m_keylatch]->read();
+ return m_key_row[m_keylatch]->read();
}
READ8_MEMBER( sc3000_state::ppi_pb_r )
@@ -566,10 +564,8 @@ READ8_MEMBER( sc3000_state::ppi_pb_r )
PB7 Cassette tape input
*/
- ioport_port *ports[8] = { m_pb0, m_pb1, m_pb2, m_pb3, m_pb4, m_pb5, m_pb6, m_pb7 };
-
/* keyboard */
- UINT8 data = ports[m_keylatch]->read();
+ UINT8 data = m_key_row[m_keylatch + 8]->read();
/* cartridge contact */
data |= 0x10;
@@ -1022,6 +1018,24 @@ void sc3000_state::machine_start()
/* toggle light gun crosshair */
machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(sg1000_state::lightgun_tick),this));
+ // find keyboard rows
+ m_key_row[0] = m_pa0;
+ m_key_row[1] = m_pa1;
+ m_key_row[2] = m_pa2;
+ m_key_row[3] = m_pa3;
+ m_key_row[4] = m_pa4;
+ m_key_row[5] = m_pa5;
+ m_key_row[6] = m_pa6;
+ m_key_row[7] = m_pa7;
+ m_key_row[8] = m_pb0;
+ m_key_row[9] = m_pb1;
+ m_key_row[10] = m_pb2;
+ m_key_row[11] = m_pb3;
+ m_key_row[12] = m_pb4;
+ m_key_row[13] = m_pb5;
+ m_key_row[14] = m_pb6;
+ m_key_row[15] = m_pb7;
+
/* register for state saving */
save_item(NAME(m_tvdraw_data));
save_item(NAME(m_keylatch));
@@ -1069,7 +1083,7 @@ static MACHINE_CONFIG_START( sg1000, sg1000_state )
/* video hardware */
MCFG_TMS9928A_ADD( TMS9918A_TAG, TMS9918A, sg1000_tms9918a_interface )
- MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" )
+ MCFG_TMS9928A_SCREEN_ADD_NTSC( SCREEN_TAG )
MCFG_SCREEN_UPDATE_DEVICE( TMS9918A_TAG, tms9918a_device, screen_update )
/* sound hardware */
@@ -1123,7 +1137,7 @@ static MACHINE_CONFIG_START( sc3000, sc3000_state )
/* video hardware */
MCFG_TMS9928A_ADD( TMS9918A_TAG, TMS9918A, sg1000_tms9918a_interface )
- MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" )
+ MCFG_TMS9928A_SCREEN_ADD_NTSC( SCREEN_TAG )
MCFG_SCREEN_UPDATE_DEVICE( TMS9918A_TAG, tms9918a_device, screen_update )
/* sound hardware */
@@ -1164,7 +1178,7 @@ static MACHINE_CONFIG_START( sf7000, sf7000_state )
/* video hardware */
MCFG_TMS9928A_ADD( TMS9918A_TAG, TMS9918A, sg1000_tms9918a_interface )
- MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" )
+ MCFG_TMS9928A_SCREEN_ADD_NTSC( SCREEN_TAG )
MCFG_SCREEN_UPDATE_DEVICE( TMS9918A_TAG, tms9918a_device, screen_update )
/* sound hardware */
diff --git a/src/mess/drivers/tiki100.c b/src/mess/drivers/tiki100.c
index 02af0990361..af7ce8209ca 100644
--- a/src/mess/drivers/tiki100.c
+++ b/src/mess/drivers/tiki100.c
@@ -94,8 +94,7 @@ void tiki100_state::bankswitch()
READ8_MEMBER( tiki100_state::keyboard_r )
{
- ioport_port *ports[12] = { m_y1, m_y2, m_y3, m_y4, m_y5, m_y6, m_y7, m_y8, m_y9, m_y10, m_y11, m_y12 };
- UINT8 data = ports[m_keylatch]->read();
+ UINT8 data = m_key_row[m_keylatch]->read();
m_keylatch++;
@@ -563,6 +562,20 @@ void tiki100_state::machine_start()
bankswitch();
+ // find keyboard rows
+ m_key_row[0] = m_y1;
+ m_key_row[1] = m_y2;
+ m_key_row[2] = m_y3;
+ m_key_row[3] = m_y4;
+ m_key_row[4] = m_y5;
+ m_key_row[5] = m_y6;
+ m_key_row[6] = m_y7;
+ m_key_row[7] = m_y8;
+ m_key_row[8] = m_y9;
+ m_key_row[9] = m_y10;
+ m_key_row[10] = m_y11;
+ m_key_row[11] = m_y12;
+
/* register for state saving */
save_item(NAME(m_rome));
save_item(NAME(m_vire));
diff --git a/src/mess/drivers/tmc1800.c b/src/mess/drivers/tmc1800.c
index 0aa7df8e81a..c8dc469d177 100644
--- a/src/mess/drivers/tmc1800.c
+++ b/src/mess/drivers/tmc1800.c
@@ -298,7 +298,7 @@ ADDRESS_MAP_END
/* Input Ports */
static INPUT_PORTS_START( tmc1800 )
- PORT_START("IN0")
+ PORT_START("Y0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR('0')
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR('1')
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR('2')
@@ -308,7 +308,7 @@ static INPUT_PORTS_START( tmc1800 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR('6')
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR('7')
- PORT_START("IN1")
+ PORT_START("Y1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR('8')
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR('9')
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A')
@@ -331,7 +331,7 @@ INPUT_CHANGED_MEMBER( tmc2000_state::run_pressed )
}
static INPUT_PORTS_START( tmc2000 )
- PORT_START("IN0")
+ PORT_START("Y0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR('0')
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR('1')
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR('2')
@@ -341,7 +341,7 @@ static INPUT_PORTS_START( tmc2000 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR('6')
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR('7')
- PORT_START("IN1")
+ PORT_START("Y1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR('8')
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR('9')
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A')
@@ -354,7 +354,7 @@ static INPUT_PORTS_START( tmc2000 )
PORT_START("RUN")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Run/Reset") PORT_CODE(KEYCODE_R) PORT_TOGGLE PORT_CHANGED_MEMBER(DEVICE_SELF, tmc2000_state, run_pressed, 0)
- PORT_START("IN2")
+ PORT_START("Y2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G')
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H')
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I')
@@ -364,7 +364,7 @@ static INPUT_PORTS_START( tmc2000 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M')
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N')
- PORT_START("IN3")
+ PORT_START("Y3")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O')
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P')
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
@@ -374,7 +374,7 @@ static INPUT_PORTS_START( tmc2000 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U')
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V')
- PORT_START("IN4")
+ PORT_START("Y4")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W')
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X')
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y')
@@ -384,7 +384,7 @@ static INPUT_PORTS_START( tmc2000 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
- PORT_START("IN5")
+ PORT_START("Y5")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
@@ -394,7 +394,7 @@ static INPUT_PORTS_START( tmc2000 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
- PORT_START("IN6")
+ PORT_START("Y6")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
@@ -404,7 +404,7 @@ static INPUT_PORTS_START( tmc2000 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
- PORT_START("IN7")
+ PORT_START("Y7")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
@@ -559,8 +559,7 @@ READ_LINE_MEMBER( tmc2000_state::ef2_r )
READ_LINE_MEMBER( tmc2000_state::ef3_r )
{
- ioport_port *ports[] = { m_in0, m_in1, m_in2, m_in3, m_in4, m_in5, m_in6, m_in7 };
- UINT8 data = ~ports[m_keylatch / 8]->read();
+ UINT8 data = ~m_key_row[m_keylatch / 8]->read();
return BIT(data, m_keylatch % 8);
}
@@ -695,6 +694,16 @@ void tmc2000_state::machine_start()
{
m_colorram[addr] = machine().rand() & 0xff;
}
+
+ // find keyboard rows
+ m_key_row[0] = m_y0;
+ m_key_row[1] = m_y1;
+ m_key_row[2] = m_y2;
+ m_key_row[3] = m_y3;
+ m_key_row[4] = m_y4;
+ m_key_row[5] = m_y5;
+ m_key_row[6] = m_y6;
+ m_key_row[7] = m_y7;
// state saving
save_item(NAME(m_keylatch));
diff --git a/src/mess/drivers/tmc2000e.c b/src/mess/drivers/tmc2000e.c
index 9dbcd3035d5..d83d1a7afe7 100644
--- a/src/mess/drivers/tmc2000e.c
+++ b/src/mess/drivers/tmc2000e.c
@@ -95,6 +95,86 @@ ADDRESS_MAP_END
/* Input Ports */
static INPUT_PORTS_START( tmc2000e )
+ PORT_START("Y0")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
+
+ PORT_START("Y1")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
+
+ PORT_START("Y2")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
+
+ PORT_START("Y3")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
+
+ PORT_START("Y4")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
+
+ PORT_START("Y5")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
+
+ PORT_START("Y6")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
+
+ PORT_START("Y7")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
+
PORT_START("DSW0") // System Configuration DIPs
PORT_DIPNAME( 0x80, 0x00, "Keyboard Type" )
PORT_DIPSETTING( 0x00, "ASCII" )
@@ -152,18 +232,17 @@ static CDP1864_INTERFACE( tmc2000e_cdp1864_intf )
READ_LINE_MEMBER( tmc2000e_state::clear_r )
{
- return BIT(m_io_run->read(), 0);
+ return BIT(m_run->read(), 0);
}
READ_LINE_MEMBER( tmc2000e_state::ef2_r )
{
- return (m_cassette)->input() < 0;
+ return m_cassette->input() < 0;
}
READ_LINE_MEMBER( tmc2000e_state::ef3_r )
{
- ioport_port *keynames[] = { m_io_in0, m_io_in1, m_io_in2, m_io_in3, m_io_in4, m_io_in5, m_io_in6, m_io_in7 };
- UINT8 data = ~(keynames[m_keylatch / 8])->read();
+ UINT8 data = ~(m_key_row[m_keylatch / 8])->read();
return BIT(data, m_keylatch % 8);
}
@@ -210,8 +289,17 @@ static COSMAC_INTERFACE( tmc2000e_config )
void tmc2000e_state::machine_start()
{
+ // find keyboard rows
+ m_key_row[0] = m_y0;
+ m_key_row[1] = m_y1;
+ m_key_row[2] = m_y2;
+ m_key_row[3] = m_y3;
+ m_key_row[4] = m_y4;
+ m_key_row[5] = m_y5;
+ m_key_row[6] = m_y6;
+ m_key_row[7] = m_y7;
+
/* register for state saving */
- save_pointer(NAME(m_colorram.target()), TMC2000E_COLORRAM_SIZE);
save_item(NAME(m_cdp1864_efx));
save_item(NAME(m_keylatch));
}
@@ -234,19 +322,6 @@ static const cassette_interface tmc2000_cassette_interface =
NULL
};
-static const floppy_interface tmc2000e_floppy_interface =
-{
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- FLOPPY_STANDARD_5_25_DSDD,
- LEGACY_FLOPPY_OPTIONS_NAME(default),
- NULL,
- NULL
-};
-
static MACHINE_CONFIG_START( tmc2000e, tmc2000e_state )
// basic system hardware
MCFG_CPU_ADD(CDP1802_TAG, COSMAC, XTAL_1_75MHz)
@@ -264,11 +339,8 @@ static MACHINE_CONFIG_START( tmc2000e, tmc2000e_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
/* devices */
- MCFG_PRINTER_ADD("printer")
MCFG_CASSETTE_ADD(CASSETTE_TAG, tmc2000_cassette_interface)
- MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(tmc2000e_floppy_interface)
-
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("8K")
diff --git a/src/mess/drivers/tmc600.c b/src/mess/drivers/tmc600.c
index 1d9df6785fa..d9ca0cd1917 100644
--- a/src/mess/drivers/tmc600.c
+++ b/src/mess/drivers/tmc600.c
@@ -206,9 +206,7 @@ READ_LINE_MEMBER( tmc600_state::ef2_r )
READ_LINE_MEMBER( tmc600_state::ef3_r )
{
- ioport_port* portnames[8] = { m_y0, m_y1, m_y2, m_y3, m_y4, m_y5, m_y6, m_y7 };
-
- UINT8 data = ~portnames[m_keylatch / 8]->read();
+ UINT8 data = ~m_key_row[m_keylatch / 8]->read();
return BIT(data, m_keylatch % 8);
}
@@ -251,6 +249,16 @@ void tmc600_state::machine_start()
program.unmap_readwrite(0xa000, 0xbfff);
break;
}
+
+ // find keyboard rows
+ m_key_row[0] = m_y0;
+ m_key_row[1] = m_y1;
+ m_key_row[2] = m_y2;
+ m_key_row[3] = m_y3;
+ m_key_row[4] = m_y4;
+ m_key_row[5] = m_y5;
+ m_key_row[6] = m_y6;
+ m_key_row[7] = m_y7;
/* register for state saving */
save_item(NAME(m_keylatch));
diff --git a/src/mess/includes/cosmicos.h b/src/mess/includes/cosmicos.h
index 7cb4245c622..166c92e111a 100644
--- a/src/mess/includes/cosmicos.h
+++ b/src/mess/includes/cosmicos.h
@@ -125,6 +125,7 @@ public:
int m_ram_disable;
/* keyboard state */
+ ioport_port* m_key_row[4];
UINT8 m_keylatch;
/* display state */
diff --git a/src/mess/includes/huebler.h b/src/mess/includes/huebler.h
index 6b2c10aad9a..5c61754270b 100644
--- a/src/mess/includes/huebler.h
+++ b/src/mess/includes/huebler.h
@@ -72,13 +72,14 @@ public:
virtual void machine_start();
- UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_READ8_MEMBER( keyboard_r );
void scan_keyboard();
// keyboard state
+ ioport_port* m_key_row[16];
int m_key_d6;
int m_key_d7;
int m_key_a4;
diff --git a/src/mess/includes/newbrain.h b/src/mess/includes/newbrain.h
index 8a6971fcefe..b53842cbaae 100644
--- a/src/mess/includes/newbrain.h
+++ b/src/mess/includes/newbrain.h
@@ -175,6 +175,7 @@ public:
int m_cop_access; // COP access
// keyboard state
+ ioport_port* m_key_row[16];
int m_keylatch; // keyboard row
int m_keydata; // keyboard column
@@ -206,7 +207,8 @@ public:
m_ctc(*this, Z80CTC_TAG),
m_acia(*this, MC6850_TAG),
m_fdc(*this, UPD765_TAG),
- m_floppy(*this, UPD765_TAG ":0:525dd")
+ m_floppy(*this, UPD765_TAG ":0:525dd"),
+ m_eim_ram(*this, "eim_ram")
{ }
required_device<cpu_device> m_fdccpu;
@@ -214,6 +216,7 @@ public:
required_device<acia6850_device> m_acia;
required_device<upd765a_device> m_fdc;
required_device<floppy_image_device> m_floppy;
+ optional_shared_ptr<UINT8> m_eim_ram;
virtual void machine_start();
@@ -252,7 +255,6 @@ public:
int m_mpm; // multi paging mode ?
int m_a16; // address line 16
UINT8 m_pr[16]; // expansion interface paging register
- UINT8 *m_eim_ram; // expansion interface RAM
// floppy state
int m_fdc_int; // interrupt
diff --git a/src/mess/includes/sg1000.h b/src/mess/includes/sg1000.h
index 58f7f1b571a..26e01e5fadb 100644
--- a/src/mess/includes/sg1000.h
+++ b/src/mess/includes/sg1000.h
@@ -126,6 +126,8 @@ public:
DECLARE_READ8_MEMBER( ppi_pa_r );
DECLARE_READ8_MEMBER( ppi_pb_r );
DECLARE_WRITE8_MEMBER( ppi_pc_w );
+
+ ioport_port* m_key_row[16];
};
class sf7000_state : public sc3000_state
diff --git a/src/mess/includes/tiki100.h b/src/mess/includes/tiki100.h
index be5935dd172..1d0973a7edd 100644
--- a/src/mess/includes/tiki100.h
+++ b/src/mess/includes/tiki100.h
@@ -105,6 +105,7 @@ public:
UINT8 m_palette;
/* keyboard state */
+ ioport_port* m_key_row[12];
int m_keylatch;
TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
};
diff --git a/src/mess/includes/tmc1800.h b/src/mess/includes/tmc1800.h
index 5251c975a07..f473c61d6a5 100644
--- a/src/mess/includes/tmc1800.h
+++ b/src/mess/includes/tmc1800.h
@@ -86,7 +86,7 @@ public:
DECLARE_WRITE_LINE_MEMBER( q_w );
/* keyboard state */
- int m_keylatch; /* key latch */
+ int m_keylatch;
};
class tmc2000_state : public driver_device
@@ -100,14 +100,14 @@ public:
m_ram(*this, RAM_TAG),
m_rom(*this, CDP1802_TAG),
m_colorram(*this, "color_ram"),
- m_in0(*this, "IN0"),
- m_in1(*this, "IN1"),
- m_in2(*this, "IN2"),
- m_in3(*this, "IN3"),
- m_in4(*this, "IN4"),
- m_in5(*this, "IN5"),
- m_in6(*this, "IN6"),
- m_in7(*this, "IN7"),
+ m_y0(*this, "Y0"),
+ m_y1(*this, "Y1"),
+ m_y2(*this, "Y2"),
+ m_y3(*this, "Y3"),
+ m_y4(*this, "Y4"),
+ m_y5(*this, "Y5"),
+ m_y6(*this, "Y6"),
+ m_y7(*this, "Y7"),
m_run(*this, "RUN")
{ }
@@ -117,14 +117,14 @@ public:
required_device<ram_device> m_ram;
required_memory_region m_rom;
optional_shared_ptr<UINT8> m_colorram;
- required_ioport m_in0;
- required_ioport m_in1;
- required_ioport m_in2;
- required_ioport m_in3;
- required_ioport m_in4;
- required_ioport m_in5;
- required_ioport m_in6;
- required_ioport m_in7;
+ required_ioport m_y0;
+ required_ioport m_y1;
+ required_ioport m_y2;
+ required_ioport m_y3;
+ required_ioport m_y4;
+ required_ioport m_y5;
+ required_ioport m_y6;
+ required_ioport m_y7;
required_ioport m_run;
virtual void machine_start();
@@ -152,7 +152,8 @@ public:
UINT8 m_color;
/* keyboard state */
- int m_keylatch; /* key latch */
+ ioport_port* m_key_row[8];
+ int m_keylatch;
};
class nano_state : public driver_device
diff --git a/src/mess/includes/tmc2000e.h b/src/mess/includes/tmc2000e.h
index 9bba288fa20..832d4ac914e 100644
--- a/src/mess/includes/tmc2000e.h
+++ b/src/mess/includes/tmc2000e.h
@@ -6,12 +6,9 @@
#include "emu.h"
#include "cpu/cosmac/cosmac.h"
-#include "formats/basicdsk.h"
#include "imagedev/cassette.h"
-#include "imagedev/flopdrv.h"
-#include "imagedev/printer.h"
-#include "machine/rescap.h"
#include "machine/ram.h"
+#include "machine/rescap.h"
#include "sound/cdp1864.h"
#define SCREEN_TAG "screen"
@@ -24,25 +21,35 @@ class tmc2000e_state : public driver_device
{
public:
tmc2000e_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag)
- , m_maincpu(*this, CDP1802_TAG)
- , m_cti(*this, CDP1864_TAG)
- , m_cassette(*this, CASSETTE_TAG)
- , m_colorram(*this, "colorram")
- , m_io_in0(*this, "IN0")
- , m_io_in1(*this, "IN1")
- , m_io_in2(*this, "IN2")
- , m_io_in3(*this, "IN3")
- , m_io_in4(*this, "IN4")
- , m_io_in5(*this, "IN5")
- , m_io_in6(*this, "IN6")
- , m_io_in7(*this, "IN7")
- , m_io_run(*this, "RUN")
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, CDP1802_TAG),
+ m_cti(*this, CDP1864_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_colorram(*this, "colorram"),
+ m_y0(*this, "Y0"),
+ m_y1(*this, "Y1"),
+ m_y2(*this, "Y2"),
+ m_y3(*this, "Y3"),
+ m_y4(*this, "Y4"),
+ m_y5(*this, "Y5"),
+ m_y6(*this, "Y6"),
+ m_y7(*this, "Y7"),
+ m_run(*this, "RUN")
{ }
required_device<cpu_device> m_maincpu;
required_device<cdp1864_device> m_cti;
required_device<cassette_image_device> m_cassette;
+ required_shared_ptr<UINT8> m_colorram;
+ required_ioport m_y0;
+ required_ioport m_y1;
+ required_ioport m_y2;
+ required_ioport m_y3;
+ required_ioport m_y4;
+ required_ioport m_y5;
+ required_ioport m_y6;
+ required_ioport m_y7;
+ required_ioport m_run;
virtual void machine_start();
virtual void machine_reset();
@@ -69,23 +76,12 @@ public:
/* video state */
int m_cdp1864_efx; /* EFx */
- required_shared_ptr<UINT8> m_colorram; /* color memory */
UINT8 m_color;
/* keyboard state */
+ ioport_port* m_key_row[8];
int m_keylatch; /* key latch */
int m_reset; /* reset activated */
-
-protected:
- required_ioport m_io_in0;
- required_ioport m_io_in1;
- required_ioport m_io_in2;
- required_ioport m_io_in3;
- required_ioport m_io_in4;
- required_ioport m_io_in5;
- required_ioport m_io_in6;
- required_ioport m_io_in7;
- required_ioport m_io_run;
};
#endif
diff --git a/src/mess/includes/tmc600.h b/src/mess/includes/tmc600.h
index 5b94514c920..701f0cc13d6 100644
--- a/src/mess/includes/tmc600.h
+++ b/src/mess/includes/tmc600.h
@@ -84,7 +84,9 @@ public:
int m_blink; // cursor blink
// keyboard state
+ ioport_port* m_key_row[8];
int m_keylatch; // key latch
+
TIMER_DEVICE_CALLBACK_MEMBER(blink_tick);
};