From b138ab152f6e22735b12ec72366988ba98812140 Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 15 Dec 2014 01:09:31 +0100 Subject: (MESS)Game promoted to working ------------------ Tandy-12 - Computerized Arcade [hap, Kevin Horton] --- src/emu/cpu/tms0980/tms0980.c | 49 ++++++++---------- src/emu/cpu/tms0980/tms0980.h | 24 +++++---- src/mess/drivers/mathmagi.c | 9 ++-- src/mess/drivers/tandy12.c | 114 +++++++++++++++++++++++++++++++++++------- src/mess/layout/tandy12.lay | 26 ++++++++++ 5 files changed, 165 insertions(+), 57 deletions(-) diff --git a/src/emu/cpu/tms0980/tms0980.c b/src/emu/cpu/tms0980/tms0980.c index 5c13d0741f5..049d31fa287 100644 --- a/src/emu/cpu/tms0980/tms0980.c +++ b/src/emu/cpu/tms0980/tms0980.c @@ -92,8 +92,8 @@ unknown cycle: CME, SSE, SSS #define M_SSE 0x00080000 /* Special Status Enable */ #define M_SSS 0x00100000 /* Special Status Sample */ -#define M_RSTR 0x00200000 /* -> line #36, F_RSTR (TMC02x0 custom) */ -#define M_UNK1 0x00400000 /* -> line #37, F_???? (TMC0270 custom) */ +#define M_RSTR 0x00200000 /* -> line #36, F_RSTR (TMS02x0 custom) */ +#define M_UNK1 0x00400000 /* -> line #37, F_???? (TMS0270 custom) */ /* Standard/fixed instructions - these are documented more in their specific handlers below */ #define F_BR 0x00000001 @@ -154,13 +154,14 @@ const device_type TMS0980 = &device_creator; // 28-pin DIP, // - 32-term microinstructions PLA between the RAM and ROM, supporting 15 microinstructions // - 16-term output PLA and segment PLA above the RAM (rotate opla 90 degrees) const device_type TMS0970 = &device_creator; // 28-pin DIP, 11 R pins +// TMS0950 is same? -// TMC0270 on the other hand, is a TMS0980 with earrings and a new hat. The new changes look like a quick afterthought, almost hacky +// TMS0270 on the other hand, is a TMS0980 with earrings and a new hat. The new changes look like a quick afterthought, almost hacky // - RAM, ROM, and main instructions PLA is exactly the same as TMS0980 // - 64-term microinstructions PLA between the RAM and ROM, supporting 20 microinstructions plus optional separate lines for custom opcode handling // - 48-term output PLA above the RAM (rotate opla 90 degrees) -const device_type TMC0270 = &device_creator; // 40-pin DIP, 16 O pins, 8+ R pins (some R pins are internally hooked up to support more I/O) -// TMC0260 is same? except opla is 32 instead of 48 terms +const device_type TMS0270 = &device_creator; // 40-pin DIP, 16 O pins, 8+ R pins (some R pins are internally hooked up to support more I/O) +// TMS0260 is same? except opla is 32 instead of 48 terms static ADDRESS_MAP_START(program_11bit_9, AS_PROGRAM, 16, tms1xxx_cpu_device) @@ -249,8 +250,8 @@ tms0980_cpu_device::tms0980_cpu_device(const machine_config &mconfig, device_typ } -tmc0270_cpu_device::tmc0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms0980_cpu_device(mconfig, TMC0270, "TMC0270", tag, owner, clock, 16, 16, 4, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 8, ADDRESS_MAP_NAME(data_64x9_as4), "tmc0270", __FILE__) +tms0270_cpu_device::tms0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms0980_cpu_device(mconfig, TMS0270, "TMS0270", tag, owner, clock, 16, 16, 4, 7, 9, 4, 12, ADDRESS_MAP_NAME(program_11bit_9), 8, ADDRESS_MAP_NAME(data_64x9_as4), "tms0270", __FILE__) { } @@ -309,7 +310,7 @@ machine_config_constructor tms0980_cpu_device::device_mconfig_additions() const } -static MACHINE_CONFIG_FRAGMENT(tmc0270) +static MACHINE_CONFIG_FRAGMENT(tms0270) // main opcodes PLA, microinstructions PLA, output PLA MCFG_PLA_ADD("ipla", 9, 22, 24) @@ -320,9 +321,9 @@ static MACHINE_CONFIG_FRAGMENT(tmc0270) MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) MACHINE_CONFIG_END -machine_config_constructor tmc0270_cpu_device::device_mconfig_additions() const +machine_config_constructor tms0270_cpu_device::device_mconfig_additions() const { - return MACHINE_CONFIG_NAME(tmc0270); + return MACHINE_CONFIG_NAME(tms0270); } @@ -396,7 +397,6 @@ void tms1xxx_cpu_device::device_start() m_cs = 0; m_r = 0; m_o = 0; - m_o_index = 0; m_cki_bus = 0; m_c4 = 0; m_p = 0; @@ -434,7 +434,6 @@ void tms1xxx_cpu_device::device_start() save_item(NAME(m_cs)); save_item(NAME(m_r)); save_item(NAME(m_o)); - save_item(NAME(m_o_index)); save_item(NAME(m_cki_bus)); save_item(NAME(m_c4)); save_item(NAME(m_p)); @@ -475,7 +474,7 @@ void tms1xxx_cpu_device::device_start() m_icountptr = &m_icount; } -void tmc0270_cpu_device::device_start() +void tms0270_cpu_device::device_start() { // common init tms1xxx_cpu_device::device_start(); @@ -635,8 +634,8 @@ UINT32 tms0980_cpu_device::decode_micro(UINT8 sel) UINT32 mask = m_mpla->read(sel); mask ^= 0x43fc3; // invert active-negative - // M_RSTR is specific to TMC02x0, it redirects to F_RSTR - // M_UNK1 is specific to TMC0270, unknown yet + // M_RSTR is specific to TMS02x0, it redirects to F_RSTR + // M_UNK1 is specific to TMS0270, unknown yet // _______ ______ _____ _____ _____ _____ ______ _____ ______ _____ _____ const UINT32 md[22] = { M_NDMTP, M_DMTP, M_AUTY, M_AUTA, M_CKM, M_SSE, M_CKP, M_YTP, M_MTP, M_ATN, M_NATN, M_MTN, M_15TN, M_CKN, M_NE, M_C8, M_SSS, M_CME, M_CIN, M_STO, M_RSTR, M_UNK1 }; @@ -683,7 +682,7 @@ void tms0980_cpu_device::device_reset() m_micro_direct[op] = decode_micro(op); } -void tmc0270_cpu_device::device_reset() +void tms0270_cpu_device::device_reset() { // common reset tms0980_cpu_device::device_reset(); @@ -747,7 +746,7 @@ void tms0980_cpu_device::read_opcode() next_pc(); } -void tmc0270_cpu_device::read_opcode() +void tms0270_cpu_device::read_opcode() { tms0980_cpu_device::read_opcode(); @@ -764,8 +763,6 @@ void tmc0270_cpu_device::read_opcode() void tms1xxx_cpu_device::write_o_output(UINT8 index) { - m_o_index = index; - // a hardcoded table is supported if the output pla is unknown m_o = (c_output_pla == NULL) ? m_opla->read(index) : c_output_pla[index]; m_write_o(0, m_o & m_o_mask, 0xffff); @@ -773,14 +770,12 @@ void tms1xxx_cpu_device::write_o_output(UINT8 index) void tms0970_cpu_device::write_o_output(UINT8 index) { - m_o_index = index; - m_o = m_spla->read(index); m_write_o(0, m_o & m_o_mask, 0xffff); } -void tmc0270_cpu_device::dynamic_output() +void tms0270_cpu_device::dynamic_output() { // TODO.. @@ -798,7 +793,7 @@ UINT8 tms1xxx_cpu_device::read_k_input() return (k & 0xf) | k3; } -UINT8 tmc0270_cpu_device::read_k_input() +UINT8 tms0270_cpu_device::read_k_input() { // TODO.. @@ -1019,8 +1014,8 @@ void tms1xxx_cpu_device::op_sbl() } -// TMC0270-specific -void tmc0270_cpu_device::op_tdo() +// TMS0270-specific +void tms0270_cpu_device::op_tdo() { // TDO: transfer data out if (m_status) @@ -1031,13 +1026,13 @@ void tmc0270_cpu_device::op_tdo() // write to output is done in dynamic_output } -void tmc0270_cpu_device::op_setr() +void tms0270_cpu_device::op_setr() { // same as default, but handle write to output in dynamic_output m_r = m_r | (1 << m_y); } -void tmc0270_cpu_device::op_rstr() +void tms0270_cpu_device::op_rstr() { // same as default, but handle write to output in dynamic_output m_r = m_r & ~(1 << m_y); diff --git a/src/emu/cpu/tms0980/tms0980.h b/src/emu/cpu/tms0980/tms0980.h index 3ccf7deffbf..79b9c8076bf 100644 --- a/src/emu/cpu/tms0980/tms0980.h +++ b/src/emu/cpu/tms0980/tms0980.h @@ -5,6 +5,7 @@ TMS0980/TMS1000-family MCU cores */ + #ifndef _TMS0980_H_ #define _TMS0980_H_ @@ -12,21 +13,28 @@ #include "machine/pla.h" -#define MCFG_TMS1XXX_OUTPUT_PLA(_pla) \ - tms1xxx_cpu_device::set_output_pla(*device, _pla); - +// K input pins #define MCFG_TMS1XXX_READ_K_CB(_devcb) \ tms1xxx_cpu_device::set_read_k_callback(*device, DEVCB_##_devcb); +// O/Segment output pins #define MCFG_TMS1XXX_WRITE_O_CB(_devcb) \ tms1xxx_cpu_device::set_write_o_callback(*device, DEVCB_##_devcb); +// R output pins (also called D on some chips) #define MCFG_TMS1XXX_WRITE_R_CB(_devcb) \ tms1xxx_cpu_device::set_write_r_callback(*device, DEVCB_##_devcb); +// OFF opcode on TMS0980 and up #define MCFG_TMS1XXX_POWER_OFF_CB(_devcb) \ tms1xxx_cpu_device::set_power_off_callback(*device, DEVCB_##_devcb); +// Use this if the output PLA is unknown: +// If the microinstructions (or other) PLA is unknown, try using one from another romset. +#define MCFG_TMS1XXX_OUTPUT_PLA(_pla) \ + tms1xxx_cpu_device::set_output_pla(*device, _pla); + + class tms1xxx_cpu_device : public cpu_device { @@ -62,9 +70,6 @@ public: template static devcb_base &set_power_off_callback(device_t &device, _Object object) { return downcast(device).m_power_off.set_callback(object); } static void set_output_pla(device_t &device, const UINT16 *output_pla) { downcast(device).c_output_pla = output_pla; } - // driver debugging - UINT8 debug_peek_o_index() { return m_o_index; } - protected: // device-level overrides virtual void device_start(); @@ -132,7 +137,6 @@ protected: UINT8 m_cs; // chapter subroutine bit UINT16 m_r; UINT16 m_o; - UINT8 m_o_index; UINT8 m_cki_bus; UINT8 m_c4; UINT8 m_p; // 4-bit adder p(lus)-input @@ -283,10 +287,10 @@ protected: }; -class tmc0270_cpu_device : public tms0980_cpu_device +class tms0270_cpu_device : public tms0980_cpu_device { public: - tmc0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); protected: // overrides @@ -322,7 +326,7 @@ extern const device_type TMS1100; extern const device_type TMS1300; extern const device_type TMS0970; extern const device_type TMS0980; -extern const device_type TMC0270; +extern const device_type TMS0270; #endif /* _TMS0980_H_ */ diff --git a/src/mess/drivers/mathmagi.c b/src/mess/drivers/mathmagi.c index b24aac36a5b..aac21203ff0 100644 --- a/src/mess/drivers/mathmagi.c +++ b/src/mess/drivers/mathmagi.c @@ -22,7 +22,8 @@ TODO: - - some of the led symbols are probably wrong, output pla is unknown + - some of the led symbols are probably wrong, output PLA is unknown + - microinstructions PLA is not verified ***************************************************************************/ @@ -83,6 +84,7 @@ READ8_MEMBER(mathmagi_state::read_k) WRITE16_MEMBER(mathmagi_state::write_o) { // O1-O7: led segments A-G + // O0: N/C m_o = data; } @@ -162,7 +164,9 @@ static INPUT_PORTS_START( mathmagi ) PORT_CONFNAME( 0x01, 0x00, "Players") PORT_CONFSETTING( 0x00, "1" ) PORT_CONFSETTING( 0x01, "2" ) - PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END @@ -196,7 +200,6 @@ enum static const UINT16 mathmagi_output_pla[0x20] = { - /* O output PLA configuration currently unknown */ lA+lB+lC+lD+lE+lF, // 0 lB+lC, // 1 lA+lB+lG+lE+lD, // 2 diff --git a/src/mess/drivers/tandy12.c b/src/mess/drivers/tandy12.c index 0b973327cfa..fc6ca010f01 100644 --- a/src/mess/drivers/tandy12.c +++ b/src/mess/drivers/tandy12.c @@ -2,13 +2,28 @@ // copyright-holders:hap /*************************************************************************** - Tandy Radio Shack Tandy-12 - Computerized Arcade + Tandy Radio Shack Computerized Arcade (1981, 1982, 1995) * TMS1100 CD7282SL - This tabletop game looks and plays like "Fabulous Fred" by the Japanese - company Mego Corp. in 1980, which in turn is a mix of Merlin and Simon. - Unlike Merlin and Simon, these spin-offs were not successful. + This handheld contains 12 minigames. It looks and plays like "Fabulous Fred" + by the Japanese company Mego Corp. in 1980, which in turn is a mix of Merlin + and Simon. Unlike Merlin and Simon, spin-offs like these were not successful. + There were releases with and without the prefix "Tandy-12", I don't know + which name was more common. Also not worth noting is that it needed five + batteries; 4 C-cells and a 9-volt. + Some of the games require accessories included with the toy (eg. the Baseball + game is played with a board representing the playing field). To start a game, + hold the [SELECT] button, then press [START] when the game button lights up. + As always, refer to the official manual for more information. + + See below at the input defs for a list of the games. + + + TODO: + - output PLA is not verified + - microinstructions PLA is not verified + ***************************************************************************/ #include "emu.h" @@ -28,13 +43,14 @@ public: tandy12_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), + m_button_matrix(*this, "IN"), m_speaker(*this, "speaker") { } required_device m_maincpu; + required_ioport_array<5> m_button_matrix; required_device m_speaker; - UINT16 m_o; UINT16 m_r; DECLARE_READ8_MEMBER(read_k); @@ -53,19 +69,33 @@ public: READ8_MEMBER(tandy12_state::read_k) { - return 0; + UINT8 k = 0; + + // read selected button rows + for (int i = 0; i < 5; i++) + if (m_r >> (i+5) & 1) + k |= m_button_matrix[i]->read(); + + return k; } WRITE16_MEMBER(tandy12_state::write_o) { - m_o = data; + // O0-O7: button lamps 1-8 + for (int i = 0; i < 8; i++) + output_set_lamp_value(i, data >> i & 1); } WRITE16_MEMBER(tandy12_state::write_r) { + // R0-R3: button lamps 9-12 + for (int i = 0; i < 4; i++) + output_set_lamp_value(i + 8, data >> i & 1); + // R10: speaker out m_speaker->level_w(data >> 10 & 1); - + + // R5-R9: input mux m_r = data; } @@ -77,7 +107,57 @@ WRITE16_MEMBER(tandy12_state::write_r) ***************************************************************************/ +/* physical button layout and labels is like this: + + REPEAT-2 SPACE-2 + [O] OFF--ON [O] + + [purple]1 [blue]5 [l-green]9 + ORGAN TAG-IT TREASURE HUNT + + [l-orange]2 [turquoise]6 [red]10 + SONG WRITER ROULETTE COMPETE + + [pink]3 [yellow]7 [violet]11 + REPEAT BASEBALL FIRE AWAY + + [green]4 [orange]8 [brown]12 + TORPEDO REPEAT PLUS HIDE 'N SEEK + + [O] [O] [O] + START SELECT PLAY-2/HIT-7 +*/ + static INPUT_PORTS_START( tandy12 ) + PORT_START("IN.0") // R5 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("12") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("11") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("10") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") + + PORT_START("IN.1") // R6 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_NAME("Space-2") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_NAME("Play-2/Hit-7") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_NAME("Select") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_NAME("Start") + + PORT_START("IN.2") // R7 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_NAME("Repeat-2") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.3") // R8 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") + + PORT_START("IN.4") // R9 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") INPUT_PORTS_END @@ -90,21 +170,21 @@ INPUT_PORTS_END void tandy12_state::machine_start() { - m_o = 0; m_r = 0; - - save_item(NAME(m_o)); save_item(NAME(m_r)); } static const UINT16 tandy12_output_pla[0x20] = { - /* O output PLA configuration currently unknown */ - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f + // these are certain + 0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, + 0x80, 0x00, 0x00, 0x00, 0x00, + + // rest is unused? + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; @@ -146,4 +226,4 @@ ROM_START( tandy12 ) ROM_END -CONS( 1981, tandy12, 0, 0, tandy12, tandy12, driver_device, 0, "Tandy Radio Shack", "Tandy-12 - Computerized Arcade", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) +CONS( 1981, tandy12, 0, 0, tandy12, tandy12, driver_device, 0, "Tandy Radio Shack", "Tandy-12 - Computerized Arcade", GAME_SUPPORTS_SAVE ) diff --git a/src/mess/layout/tandy12.lay b/src/mess/layout/tandy12.lay index 27498f9b86e..3a7ea88867e 100644 --- a/src/mess/layout/tandy12.lay +++ b/src/mess/layout/tandy12.lay @@ -2,8 +2,18 @@ + + + + + + + + + + @@ -11,6 +21,22 @@ + + + + + + + + + + + + + + + + -- cgit v1.2.3