From 932bd60ef3b23d895b06f6dc49842ba225502ff3 Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 28 Sep 2015 15:10:53 +0200 Subject: [PATCH] TI DataMan WIP --- src/devices/cpu/tms0980/tms0980.c | 6 +- src/mame/mess.lst | 1 + src/mess/drivers/ticalc1x.c | 132 +++++++++++++++++++++++++++++- src/mess/layout/dataman.lay | 78 ++++++++++++++++++ 4 files changed, 213 insertions(+), 4 deletions(-) create mode 100644 src/mess/layout/dataman.lay diff --git a/src/devices/cpu/tms0980/tms0980.c b/src/devices/cpu/tms0980/tms0980.c index 5d262e1a02d..0bd70d45bab 100644 --- a/src/devices/cpu/tms0980/tms0980.c +++ b/src/devices/cpu/tms0980/tms0980.c @@ -172,8 +172,8 @@ const device_type TMS0980 = &device_creator; // 28-pin DIP, // TMS1980 is a TMS0980 with a TMS1x00 style opla // - RAM, ROM, and main instructions PLA is exactly the same as TMS0980 // - one of the microinstructions redirects to a RSTR instruction, like on TMS0270 -// - 32-term output PLA above the RAM, 7 bits! -const device_type TMS1980 = &device_creator; // 28-pin DIP, 7 O pins, 9 R pins, high voltage +// - 32-term output PLA above the RAM, 7 bits! (rotate opla 270 degrees) +const device_type TMS1980 = &device_creator; // 28-pin DIP, 7 O pins, ? R pins, high voltage // TMS0260 is same? // TMS0970 is a stripped-down version of the TMS0980, itself acting more like a TMS1000 @@ -316,7 +316,7 @@ tms0980_cpu_device::tms0980_cpu_device(const machine_config &mconfig, device_typ { } tms1980_cpu_device::tms1980_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms0980_cpu_device(mconfig, TMS1980, "TMS1980", tag, owner, clock, 7, 9, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 6, ADDRESS_MAP_NAME(data_64x9_as4), "tms1980", __FILE__) + : tms0980_cpu_device(mconfig, TMS1980, "TMS1980", tag, owner, clock, 7, 11, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 8, ADDRESS_MAP_NAME(data_64x9_as4), "tms1980", __FILE__) { } diff --git a/src/mame/mess.lst b/src/mame/mess.lst index 3aa776480c5..738300548ff 100644 --- a/src/mame/mess.lst +++ b/src/mame/mess.lst @@ -2281,6 +2281,7 @@ tibusan1 wizatron lilprof lilprof78 +dataman // hh_ucom4 ufombs // Bambino diff --git a/src/mess/drivers/ticalc1x.c b/src/mess/drivers/ticalc1x.c index 59c20ab391e..f043f634f17 100644 --- a/src/mess/drivers/ticalc1x.c +++ b/src/mess/drivers/ticalc1x.c @@ -4,7 +4,7 @@ ** subclass of hh_tms1k_state (includes/hh_tms1k.h, drivers/hh_tms1k.c) ** - Texas Instruments TMS1xxx/0970/0980 handheld calculators (mostly single-chip) + Texas Instruments TMS1xxx family handheld calculators (mostly single-chip) Refer to their official manuals on how to use them. @@ -17,6 +17,7 @@ #include "includes/hh_tms1k.h" // internal artwork +#include "dataman.lh" #include "ti1270.lh" #include "ti30.lh" #include "tisr16.lh" @@ -765,6 +766,120 @@ MACHINE_CONFIG_END +/*************************************************************************** + + TI DataMan + * TMS1980 MCU labeled TMC1982NL. die labeled 1980A 82B + * 10-digit cyan VFD display(3 digits are custom) + +***************************************************************************/ + +class dataman_state : public ticalc1x_state +{ +public: + dataman_state(const machine_config &mconfig, device_type type, const char *tag) + : ticalc1x_state(mconfig, type, tag) + { } + + void prepare_display(); + DECLARE_WRITE16_MEMBER(write_o); + DECLARE_WRITE16_MEMBER(write_r); + DECLARE_READ8_MEMBER(read_k); +}; + +// handlers + +void dataman_state::prepare_display() +{ + // note the extra segment on R9 + display_matrix_seg(8, 9, m_o | (m_r >> 2 & 0x80), m_r & 0x1ff, 0x7f); +} + +WRITE16_MEMBER(dataman_state::write_r) +{ + // R0-R4: input mux + // R0-R8: select digit + // R9: =(equals sign) segment + m_r = m_inp_mux = data; + prepare_display(); +} + +WRITE16_MEMBER(dataman_state::write_o) +{ + // O0-O6: digit segments A-G + m_o = BITSWAP8(data,7,1,6,5,4,3,2,0) & 0x7f; + prepare_display(); +} + +READ8_MEMBER(dataman_state::read_k) +{ + // K: multiplexed inputs (note: the Vss row is always on) + return m_inp_matrix[5]->read() | read_inputs(5); +} + + +// config + +static INPUT_PORTS_START( dataman ) + PORT_START("IN.0") // R0 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_M) PORT_NAME("Memory Bank") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_G) PORT_NAME("Go") + + PORT_START("IN.1") // R1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") + + PORT_START("IN.2") // R2 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("-") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") + + PORT_START("IN.3") // R3 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME(UTF8_MULTIPLY) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") + + PORT_START("IN.4") // R4 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(UTF8_DIVIDE) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_F) PORT_NAME("Force Out") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_N) PORT_NAME("Number Guesser") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_W) PORT_NAME("Wipe Out") + + // note: even though power buttons are on the matrix, they are not CPU-controlled + PORT_START("IN.5") // Vss! + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGUP) PORT_CODE(KEYCODE_U) PORT_NAME("On/User Entry") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, (void *)true) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, (void *)false) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH) PORT_NAME("?") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("Electro Flash") +INPUT_PORTS_END + +static MACHINE_CONFIG_START( dataman, dataman_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", TMS1980, 300000) // patent says 300kHz + MCFG_TMS1XXX_READ_K_CB(READ8(dataman_state, read_k)) + MCFG_TMS1XXX_WRITE_O_CB(WRITE16(dataman_state, write_o)) + MCFG_TMS1XXX_WRITE_R_CB(WRITE16(dataman_state, write_r)) + MCFG_TMS1XXX_POWER_OFF_CB(WRITELINE(hh_tms1k_state, auto_power_off)) + + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) + MCFG_DEFAULT_LAYOUT(layout_dataman) + + /* no video! */ + + /* no sound! */ +MACHINE_CONFIG_END + + + + + /*************************************************************************** Majestic-line calculators: @@ -1125,6 +1240,19 @@ ROM_START( lilprof78 ) ROM_END +ROM_START( dataman ) + ROM_REGION( 0x1000, "maincpu", 0 ) + ROM_LOAD16_WORD( "tmc1982nl", 0x0000, 0x1000, CRC(3521f53f) SHA1(c46fe7fe20715fdf5aed65833fb867cfd3938062) ) // it matches with source code in patent US4340374 + + ROM_REGION( 1246, "maincpu:ipla", 0 ) + ROM_LOAD( "tms0980_common1_instr.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) + ROM_REGION( 2056, "maincpu:mpla", 0 ) + ROM_LOAD( "tms1980_dataman_micro.pla", 0, 2056, CRC(b733b621) SHA1(7897d7db72c0c24555e58738a09ebe0f7f7689b0) ) + ROM_REGION( 525, "maincpu:opla", 0 ) + ROM_LOAD( "tms1980_dataman_output.pla", 0, 525, CRC(5fc6f451) SHA1(11475c785c34eab5b13c5dc67f413c709cd4bd4d) ) +ROM_END + + ROM_START( ti30 ) ROM_REGION( 0x1000, "maincpu", 0 ) ROM_LOAD16_WORD( "tmc0981nl", 0x0000, 0x1000, CRC(41298a14) SHA1(06f654c70add4044a612d3a38b0c2831c188fd0c) ) @@ -1181,6 +1309,8 @@ COMP( 1977, wizatron, 0, 0, wizatron, wizatron, driver_device, 0, "Tex COMP( 1976, lilprof, 0, 0, lilprof, lilprof, driver_device, 0, "Texas Instruments", "Little Professor (1976 version)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) COMP( 1978, lilprof78, lilprof, 0, lilprof78, lilprof78, driver_device, 0, "Texas Instruments", "Little Professor (1978 version)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) +COMP( 1977, dataman, 0, 0, dataman, dataman, driver_device, 0, "Texas Instruments", "DataMan", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) + COMP( 1976, ti30, 0, 0, majestic, ti30, driver_device, 0, "Texas Instruments", "TI-30", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) COMP( 1977, tiprog, 0, 0, majestic, tiprog, driver_device, 0, "Texas Instruments", "TI Programmer", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) COMP( 1979, tibusan1, 0, 0, majestic, tibusan1, driver_device, 0, "Texas Instruments", "TI Business Analyst-I", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) diff --git a/src/mess/layout/dataman.lay b/src/mess/layout/dataman.lay new file mode 100644 index 00000000000..fcfae353f4c --- /dev/null +++ b/src/mess/layout/dataman.lay @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +