summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/tranz330.cpp
diff options
context:
space:
mode:
author therealmogminer@gmail.com <therealmogminer@gmail.com>2016-10-14 15:12:13 +0200
committer therealmogminer@gmail.com <therealmogminer@gmail.com>2016-10-14 15:12:27 +0200
commit732e1945b837af63d9e4fd913828aafae908cde7 (patch)
treeb126d8ab69d7c86436dac1e36d51682c71f85ca2 /src/mame/drivers/tranz330.cpp
parente701f79c73b9d9f9f8addf13504643d5e7c17733 (diff)
-tranz330: Hooked up inputs. [Ryan Holtz]
Diffstat (limited to 'src/mame/drivers/tranz330.cpp')
-rw-r--r--src/mame/drivers/tranz330.cpp52
1 files changed, 28 insertions, 24 deletions
diff --git a/src/mame/drivers/tranz330.cpp b/src/mame/drivers/tranz330.cpp
index 5021a7675ab..8f365d7b19a 100644
--- a/src/mame/drivers/tranz330.cpp
+++ b/src/mame/drivers/tranz330.cpp
@@ -21,6 +21,7 @@
****************************************************************************/
#include "includes/tranz330.h"
+#include "tranz330.lh"
static ADDRESS_MAP_START( tranz330_mem, AS_PROGRAM, 8, tranz330_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
@@ -38,28 +39,28 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( tranz330 )
PORT_START("COL.0")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_NAME("1 QZ.")
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_NAME("4 GHI")
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_NAME("7 PRS")
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME("* ,'\"")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_1) PORT_NAME("1 QZ.")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_4) PORT_NAME("4 GHI")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_7) PORT_NAME("7 PRS")
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME("* ,'\"")
PORT_START("COL.1")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_NAME("2 ABC")
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_NAME("5 JKL")
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_NAME("8 TUV")
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_NAME("0 -SP")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_2) PORT_NAME("2 ABC")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_CODE(KEYCODE_5) PORT_NAME("5 JKL")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_CODE(KEYCODE_8) PORT_NAME("8 TUV")
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_CODE(KEYCODE_0) PORT_NAME("0 -SP")
PORT_START("COL.2")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_NAME("3 DEF")
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_NAME("6 MNO")
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_NAME("9 WXY")
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_H) PORT_NAME("#") // KEYCODE_H for 'hash mark'
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_CODE(KEYCODE_3) PORT_NAME("3 DEF")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_CODE(KEYCODE_6) PORT_NAME("6 MNO")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_CODE(KEYCODE_9) PORT_NAME("9 WXY")
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_CODE(KEYCODE_H) PORT_NAME("#") // KEYCODE_H for 'hash mark'
PORT_START("COL.3")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_NAME("CLEAR") // KEYCODE_C so as to not collide with potentially-used UI keys
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_BACKSPACE)PORT_NAME("BACK SPACE")
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("ALPHA")
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_NAME("FUNC | ENTER")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON14 ) PORT_CODE(KEYCODE_C) PORT_NAME("CLEAR") // KEYCODE_C so as to not collide with potentially-used UI keys
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON15 ) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("BACK SPACE")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON16 ) PORT_CODE(KEYCODE_A) PORT_NAME("ALPHA")
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_CODE(KEYCODE_ENTER) PORT_NAME("FUNC | ENTER")
INPUT_PORTS_END
@@ -92,27 +93,29 @@ WRITE_LINE_MEMBER( tranz330_state::clock_w )
READ8_MEMBER( tranz330_state::card_r )
{
- // return 0x80 for a magstripe 0, return 0x00 for a magstripe 1.
+ // return 0xff for a magstripe 0, return 0x00 for a magstripe 1.
// an interrupt should be triggered on the Z80 when magstripe reading begins.
// external contributors are encouraged to hook this up.
- return 0x80;
+ return 0xff;
}
WRITE8_MEMBER( tranz330_state::pio_a_w )
{
m_keypad_col_mask = data & 0xf;
- printf("mic10937 reset: %d\n", (data >> 4) & 1);
- printf("mic10937 data: %d\n", (data >> 5) & 1);
- printf("mic10937 clock: %d\n", (data >> 6) & 1);
+ m_vfd->por ((data >> 4) & 1);
+ m_vfd->data((data >> 5) & 1);
+ m_vfd->sclk((data >> 6) & 1);
}
READ8_MEMBER( tranz330_state::pio_b_r )
{
- UINT8 input_mask = 0;
+ UINT8 input_mask = 0xf;
for (int i = 0; i < 4; i++)
{
- if (m_keypad_col_mask & (1 << i))
- input_mask |= m_keypad[i]->read();
+ if (!BIT(m_keypad_col_mask, i))
+ {
+ input_mask &= m_keypad[i]->read();
+ }
}
return input_mask;
}
@@ -162,6 +165,7 @@ static MACHINE_CONFIG_START( tranz330, tranz330_state )
// video
MCFG_MIC10937_ADD(VFD_TAG, 0)
+ MCFG_DEFAULT_LAYOUT( layout_tranz330 )
// sound
MCFG_SPEAKER_STANDARD_MONO("mono")