-tranz330: Hooked up inputs. [Ryan Holtz]

This commit is contained in:
therealmogminer@gmail.com 2016-10-14 15:12:13 +02:00
parent e701f79c73
commit 732e1945b8
3 changed files with 90 additions and 24 deletions

View File

@ -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")

View File

@ -5,6 +5,9 @@
#ifndef VERIFONE_TRANZ330_H
#define VERIFONE_TRANZ330_H
// single-driver build must have emu.h here
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/z80/z80daisy.h"
#include "machine/z80ctc.h"

View File

@ -0,0 +1,59 @@
<?xml version="1.0"?>
<mamelayout version="2">
<element name="vfd0">
<led16segsc>
<color red="0" green="0.6" blue="1.0" />
</led16segsc>
</element>
<view name="VFD">
<backdrop name="vfd0" element="vfd0" state="0">
<bounds x="0" y="280" width="9" height="14"/>
</backdrop>
<backdrop name="vfd1" element="vfd0" state="0">
<bounds x="9" y="280" width="9" height="14"/>
</backdrop>
<backdrop name="vfd2" element="vfd0" state="0">
<bounds x="18" y="280" width="9" height="14"/>
</backdrop>
<backdrop name="vfd3" element="vfd0" state="0">
<bounds x="27" y="280" width="9" height="14"/>
</backdrop>
<backdrop name="vfd4" element="vfd0" state="0">
<bounds x="36" y="280" width="9" height="14"/>
</backdrop>
<backdrop name="vfd5" element="vfd0" state="0">
<bounds x="45" y="280" width="9" height="14"/>
</backdrop>
<backdrop name="vfd6" element="vfd0" state="0">
<bounds x="54" y="280" width="9" height="14"/>
</backdrop>
<backdrop name="vfd7" element="vfd0" state="0">
<bounds x="63" y="280" width="9" height="14"/>
</backdrop>
<backdrop name="vfd8" element="vfd0" state="0">
<bounds x="72" y="280" width="9" height="14"/>
</backdrop>
<backdrop name="vfd9" element="vfd0" state="0">
<bounds x="81" y="280" width="9" height="14"/>
</backdrop>
<backdrop name="vfd10" element="vfd0" state="0">
<bounds x="90" y="280" width="9" height="14"/>
</backdrop>
<backdrop name="vfd11" element="vfd0" state="0">
<bounds x="99" y="280" width="9" height="14"/>
</backdrop>
<backdrop name="vfd12" element="vfd0" state="0">
<bounds x="108" y="280" width="9" height="14"/>
</backdrop>
<backdrop name="vfd13" element="vfd0" state="0">
<bounds x="117" y="280" width="9" height="14"/>
</backdrop>
<backdrop name="vfd14" element="vfd0" state="0">
<bounds x="126" y="280" width="9" height="14"/>
</backdrop>
<backdrop name="vfd15" element="vfd0" state="0">
<bounds x="135" y="280" width="9" height="14"/>
</backdrop>
</view>
</mamelayout>