From a11aebba8dec579265cb326bb75d16886a287f61 Mon Sep 17 00:00:00 2001 From: cracyc Date: Thu, 26 Feb 2015 14:40:51 -0600 Subject: [PATCH 1/2] (mess) pcd: cursor and floppy 2 (nw) --- src/emu/video/scn2674.c | 8 ++------ src/emu/video/scn2674.h | 1 - src/mess/drivers/pcd.c | 9 ++++++++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/emu/video/scn2674.c b/src/emu/video/scn2674.c index 025dd231f2c..33f9f1efa90 100644 --- a/src/emu/video/scn2674.c +++ b/src/emu/video/scn2674.c @@ -694,8 +694,7 @@ void scn2674_device::device_timer(emu_timer &timer, device_timer_id id, int para for(int i = 0; i < m_IR5_character_per_row; i++) { - if((address & 0x3fff) == ((m_cursor_h << 8) | m_cursor_l)) - m_cursor_on = true; + bool cursor_on = ((address & 0x3fff) == ((m_cursor_h << 8) | m_cursor_l)); if (!m_display_cb.isnull()) m_display_cb(m_bitmap, @@ -704,7 +703,7 @@ void scn2674_device::device_timer(emu_timer &timer, device_timer_id id, int para tilerow, space().read_byte(address), address, - (charrow >= m_IR6_cursor_first_scanline) && m_cursor_on, + (charrow >= m_IR6_cursor_first_scanline) && (charrow <= m_IR6_cursor_last_scanline) && cursor_on, dw != 0, m_gfx_enabled != 0, charrow == m_IR7_cursor_underline_position, @@ -715,9 +714,6 @@ void scn2674_device::device_timer(emu_timer &timer, device_timer_id id, int para address = (m_IR9_display_buffer_first_address_MSB << 8) | m_IR8_display_buffer_first_address_LSB; } - if(charrow == m_IR6_cursor_last_scanline) - m_cursor_on = false; - if(m_gfx_enabled || (charrow == (m_IR0_scanline_per_char_row - 1))) m_address = address; } diff --git a/src/emu/video/scn2674.h b/src/emu/video/scn2674.h index 02efaf80fe1..9a64eba0d83 100644 --- a/src/emu/video/scn2674.h +++ b/src/emu/video/scn2674.h @@ -105,7 +105,6 @@ private: UINT8 m_dbl1; int m_linecounter; UINT16 m_address; - bool m_cursor_on; UINT8 m_irq_state; diff --git a/src/mess/drivers/pcd.c b/src/mess/drivers/pcd.c index ea291b161f6..f0ace2cec0e 100644 --- a/src/mess/drivers/pcd.c +++ b/src/mess/drivers/pcd.c @@ -250,6 +250,8 @@ WRITE16_MEMBER( pcd_state::dskctl_w ) if((m_dskctl & 1) && floppy0) m_fdc->set_floppy(floppy0); + if((m_dskctl & 2) && floppy1) + m_fdc->set_floppy(floppy1); if(floppy0) { @@ -292,6 +294,8 @@ SCN2674_DRAW_CHARACTER_MEMBER(pcd_state::display_pixels) else { UINT8 data = m_charram[(m_vram[address] & 0xff) * 16 + linecount]; + if(cursor && blink) + data = 0xff; for(int i = 0; i < 8; i++) bitmap.pix32(y, x + i) = m_palette->pen((data & (1 << (7 - i))) ? 1 : 0); } @@ -397,7 +401,7 @@ WRITE_LINE_MEMBER(pcd_state::write_scsi_req) //************************************************************************** static ADDRESS_MAP_START( pcd_map, AS_PROGRAM, 16, pcd_state ) - AM_RANGE(0x00000, 0x3ffff) AM_RAM // fixed 256k for now + AM_RANGE(0x00000, 0x7ffff) AM_RAM // fixed 512k for now AM_RANGE(0xf0000, 0xf7fff) AM_READONLY AM_WRITE(vram_w) AM_SHARE("vram") AM_RANGE(0xfc000, 0xfffff) AM_ROM AM_REGION("bios", 0) AM_RANGE(0x00000, 0xfffff) AM_READWRITE8(nmi_io_r, nmi_io_w, 0xffff) @@ -449,6 +453,9 @@ static MACHINE_CONFIG_START( pcd, pcd_state ) MCFG_80186_TMROUT1_HANDLER(WRITELINE(pcd_state, i186_timer1_w)) MCFG_80186_IRQ_SLAVE_ACK(READ8(pcd_state, irq_callback)) + MCFG_CPU_ADD("graphics", I8741, XTAL_16MHz/2) + MCFG_DEVICE_DISABLE() + MCFG_TIMER_DRIVER_ADD_PERIODIC("timer0_tick", pcd_state, timer0_tick, attotime::from_hz(XTAL_16MHz / 24)) // adjusted to pass post MCFG_PIC8259_ADD("pic1", DEVWRITELINE("maincpu", i80186_cpu_device, int0_w), VCC, NULL) From 01b5458a60a96d36534250a4dafeb982adf0b1af Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 26 Feb 2015 21:53:01 +0100 Subject: [PATCH 2/2] moved simon.c, comp4.c, amaztron.c to hh_tms1k.c (to recompile, remove mb.a, coleco.a) --- src/mess/drivers/amaztron.c | 212 ------------------- src/mess/drivers/comp4.c | 225 -------------------- src/mess/drivers/hh_tms1k.c | 396 ++++++++++++++++++++++++++++++++++- src/mess/drivers/simon.c | 188 ----------------- src/mess/layout/amaztron.lay | 4 +- src/mess/mess.mak | 10 +- 6 files changed, 398 insertions(+), 637 deletions(-) delete mode 100644 src/mess/drivers/amaztron.c delete mode 100644 src/mess/drivers/comp4.c delete mode 100644 src/mess/drivers/simon.c diff --git a/src/mess/drivers/amaztron.c b/src/mess/drivers/amaztron.c deleted file mode 100644 index 732bf33fe72..00000000000 --- a/src/mess/drivers/amaztron.c +++ /dev/null @@ -1,212 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:hap -/*************************************************************************** - - Coleco Amaze-A-Tron, by Ralph Baer - * TMS1100 MCU, labeled MP3405(die label too) - - This is an electronic board game with a selection of 8 maze games, - most of them for 2 players. A 5x5 playing grid and four markers are - required to play. Refer to the official manual for more information. - -***************************************************************************/ - -#include "emu.h" -#include "cpu/tms0980/tms0980.h" -#include "sound/speaker.h" - -#include "amaztron.lh" - -// master clock is a single stage RC oscillator: R=33K?, C=100pf, -// according to the TMS 1000 series data manual this is around 350kHz -#define MASTER_CLOCK (350000) - - -class amaztron_state : public driver_device -{ -public: - amaztron_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<6> m_button_matrix; - required_device m_speaker; - - UINT16 m_r; - UINT16 m_o; - - DECLARE_READ8_MEMBER(read_k); - DECLARE_WRITE16_MEMBER(write_o); - DECLARE_WRITE16_MEMBER(write_r); - - void leds_update(); - - virtual void machine_start(); -}; - - - -/*************************************************************************** - - I/O - -***************************************************************************/ - -void amaztron_state::leds_update() -{ - for (int i = 0; i < 2; i++) - if (m_r >> (i + 8) & 1) - output_set_digit_value(i, m_o); -} - -READ8_MEMBER(amaztron_state::read_k) -{ - UINT8 k = 0; - - // read selected button rows - for (int i = 0; i < 6; i++) - { - if (m_r >> i & 1) - k |= m_button_matrix[i]->read(); - } - - // the 5th row is tied to K4+K8 - if (k & 0x10) k |= 0xc; - return k & 0xf; -} - -WRITE16_MEMBER(amaztron_state::write_r) -{ - // R0-R5: input mux - // R6,R7: lamps - output_set_lamp_value(0, data >> 6 & 1); - output_set_lamp_value(1, data >> 7 & 1); - - // R8,R9: select digit - m_r = data; - leds_update(); - - // R10: speaker out - m_speaker->level_w(data >> 10 & 1); -} - -WRITE16_MEMBER(amaztron_state::write_o) -{ - // O0-O6: digit segments - // O7: N/C - m_o = data & 0x7f; - leds_update(); -} - - - -/*************************************************************************** - - Inputs - -***************************************************************************/ - -static INPUT_PORTS_START( amaztron ) - PORT_START("IN.0") // R0 - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME("Button 1") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_NAME("Button 6") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("Button 11") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_NAME("Button 16") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Z) PORT_NAME("Button 21") - - PORT_START("IN.1") // R1 - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_NAME("Button 2") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_NAME("Button 7") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Button 12") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Button 17") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_X) PORT_NAME("Button 22") - - PORT_START("IN.2") // R2 - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_NAME("Button 3") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_NAME("Button 8") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Button 13") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_NAME("Button 18") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_C) PORT_NAME("Button 23") - - PORT_START("IN.3") // R3 - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_NAME("Button 4") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_9) PORT_NAME("Button 9") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("Button 14") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) PORT_NAME("Button 19") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_V) PORT_NAME("Button 24") - - PORT_START("IN.4") // R4 - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_NAME("Button 5") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_0) PORT_NAME("Button 10") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Button 15") - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_NAME("Button 20") - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_B) PORT_NAME("Button 25") - - PORT_START("IN.5") // R5 - PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("Game Select") - PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("Game Start") - PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) - PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) -INPUT_PORTS_END - - - -/*************************************************************************** - - Machine Config - -***************************************************************************/ - -void amaztron_state::machine_start() -{ - m_r = 0; - m_o = 0; - - save_item(NAME(m_r)); - save_item(NAME(m_o)); -} - - -static MACHINE_CONFIG_START( amaztron, amaztron_state ) - - /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", TMS1100, MASTER_CLOCK) - MCFG_TMS1XXX_READ_K_CB(READ8(amaztron_state, read_k)) - MCFG_TMS1XXX_WRITE_O_CB(WRITE16(amaztron_state, write_o)) - MCFG_TMS1XXX_WRITE_R_CB(WRITE16(amaztron_state, write_r)) - - MCFG_DEFAULT_LAYOUT(layout_amaztron) - - /* no video! */ - - /* sound hardware */ - MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END - - - -/*************************************************************************** - - Game driver(s) - -***************************************************************************/ - -ROM_START( amaztron ) - ROM_REGION( 0x0800, "maincpu", 0 ) - ROM_LOAD( "tms1100nll_mp3405", 0x0000, 0x0800, CRC(9cbc0009) SHA1(17772681271b59280687492f37fa0859998f041d) ) - - ROM_REGION( 867, "maincpu:mpla", 0 ) - ROM_LOAD( "tms1100_amaztron_mpla.pla", 0, 867, CRC(03574895) SHA1(04407cabfb3adee2ee5e4218612cb06c12c540f4) ) - ROM_REGION( 365, "maincpu:opla", 0 ) - ROM_LOAD( "tms1100_amaztron_opla.pla", 0, 365, CRC(f3875384) SHA1(3c256a3db4f0aa9d93cf78124db39f4cbdc57e4a) ) -ROM_END - - -CONS( 1979, amaztron, 0, 0, amaztron, amaztron, driver_device, 0, "Coleco", "Amaze-A-Tron", GAME_SUPPORTS_SAVE ) diff --git a/src/mess/drivers/comp4.c b/src/mess/drivers/comp4.c deleted file mode 100644 index de9bbc53a6d..00000000000 --- a/src/mess/drivers/comp4.c +++ /dev/null @@ -1,225 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:hap -/*************************************************************************** - - Milton Bradley Comp IV - * TMC0904NL CP0904A (die labeled 4A0970D-04A) - - This is small tabletop Mastermind game; a code-breaking game where the player - needs to find out the correct sequence of colours (numbers in our case). - It is known as Logic 5 in Europe, and as Pythaligoras in Japan. - - Press the R key to start, followed by a set of unique numbers and E. - Refer to the official manual for more information. - - - TODO: - - MCU clock is unknown - -***************************************************************************/ - -#include "emu.h" -#include "cpu/tms0980/tms0980.h" - -#include "comp4.lh" - -// master clock is unknown, the value below is an approximation -#define MASTER_CLOCK (250000) - - -class comp4_state : public driver_device -{ -public: - comp4_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") - { } - - required_device m_maincpu; - required_ioport_array<3> m_button_matrix; - - UINT16 m_o; - - UINT16 m_display_state; - UINT8 m_display_decay[0x10]; - - DECLARE_READ8_MEMBER(read_k); - DECLARE_WRITE16_MEMBER(write_o); - DECLARE_WRITE16_MEMBER(write_r); - - TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); - void display_update(); - - virtual void machine_start(); -}; - - -/*************************************************************************** - - LED Display - -***************************************************************************/ - -// The device strobes the outputs very fast, it is unnoticeable to the user. -// To prevent flickering here, we need to simulate a decay. - -// decay time, in steps of 1ms -#define DISPLAY_DECAY_TIME 25 - -void comp4_state::display_update() -{ - for (int i = 0; i < 0x10; i++) - { - // turn on powered segments - if (m_display_state >> i & 1) - m_display_decay[i] = DISPLAY_DECAY_TIME; - - // send to output - output_set_lamp_value(i, (m_display_decay[i] != 0) ? 1 : 0); - } -} - -TIMER_DEVICE_CALLBACK_MEMBER(comp4_state::display_decay_tick) -{ - // slowly turn off unpowered segments - for (int i = 0; i < 0x10; i++) - if (!(m_display_state >> i & 1) && m_display_decay[i]) - m_display_decay[i]--; - - display_update(); -} - - - -/*************************************************************************** - - I/O - -***************************************************************************/ - -READ8_MEMBER(comp4_state::read_k) -{ - UINT8 k = 0; - - // read selected button rows - for (int i = 0; i < 3; i++) - if (m_o >> (i+1) & 1) - k |= m_button_matrix[i]->read(); - - return k; -} - -WRITE16_MEMBER(comp4_state::write_r) -{ - // LEDs: - // R4 R9 - // R10! R8 - // R2 R7 - // R1 R6 - // R0 R5 - m_display_state = data; - display_update(); -} - -WRITE16_MEMBER(comp4_state::write_o) -{ - // O0: LEDs common (always writes 1) - // O1-O3: input mux - // other bits: N/C - m_o = data; -} - - - -/*************************************************************************** - - Inputs - -***************************************************************************/ - -static INPUT_PORTS_START( comp4 ) - PORT_START("IN.0") // O1 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME("R") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") - - PORT_START("IN.1") // O2 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") - 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_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") - - PORT_START("IN.2") // O3 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("E") - 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_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") -INPUT_PORTS_END - - - -/*************************************************************************** - - Machine Config - -***************************************************************************/ - -void comp4_state::machine_start() -{ - // zerofill - m_display_state = 0; - memset(m_display_decay, 0, sizeof(m_display_decay)); - - m_o = 0; - - // register for savestates - save_item(NAME(m_display_state)); - save_item(NAME(m_display_decay)); - - save_item(NAME(m_o)); -} - - -static MACHINE_CONFIG_START( comp4, comp4_state ) - - /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", TMS0970, MASTER_CLOCK) - MCFG_TMS1XXX_READ_K_CB(READ8(comp4_state, read_k)) - MCFG_TMS1XXX_WRITE_O_CB(WRITE16(comp4_state, write_o)) - MCFG_TMS1XXX_WRITE_R_CB(WRITE16(comp4_state, write_r)) - - MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", comp4_state, display_decay_tick, attotime::from_msec(1)) - - MCFG_DEFAULT_LAYOUT(layout_comp4) - - /* no video! */ - - /* no sound! */ -MACHINE_CONFIG_END - - - -/*************************************************************************** - - Game driver(s) - -***************************************************************************/ - -ROM_START( comp4 ) - ROM_REGION( 0x0400, "maincpu", 0 ) - ROM_LOAD( "tmc0904nl_cp0904a", 0x0000, 0x0400, CRC(6233ee1b) SHA1(738e109b38c97804b4ec52bed80b00a8634ad453) ) - - ROM_REGION( 782, "maincpu:ipla", 0 ) - ROM_LOAD( "tms0970_default_ipla.pla", 0, 782, CRC(e038fc44) SHA1(dfc280f6d0a5828d1bb14fcd59ac29caf2c2d981) ) - ROM_REGION( 860, "maincpu:mpla", 0 ) - ROM_LOAD( "tms0970_comp4_mpla.pla", 0, 860, CRC(ee9d7d9e) SHA1(25484e18f6a07f7cdb21a07220e2f2a82fadfe7b) ) - ROM_REGION( 352, "maincpu:opla", 0 ) - ROM_LOAD( "tms0970_comp4_opla.pla", 0, 352, CRC(a0f887d1) SHA1(3c666663d484d5bed81e1014f8715aab8a3d489f) ) - ROM_REGION( 157, "maincpu:spla", 0 ) - ROM_LOAD( "tms0970_comp4_spla.pla", 0, 157, CRC(e5bddd90) SHA1(4b1c6512c70e5bcd23c2dbf0c88cd8aa2c632a10) ) -ROM_END - - -CONS( 1977, comp4, 0, 0, comp4, comp4, driver_device, 0, "Milton Bradley", "Comp IV", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) diff --git a/src/mess/drivers/hh_tms1k.c b/src/mess/drivers/hh_tms1k.c index 122b1d5d899..fe41dd32c4c 100644 --- a/src/mess/drivers/hh_tms1k.c +++ b/src/mess/drivers/hh_tms1k.c @@ -13,7 +13,10 @@ #include "cpu/tms0980/tms0980.h" #include "sound/speaker.h" +#include "amaztron.lh" #include "ebball.lh" +#include "comp4.lh" +#include "simon.lh" #include "tc4.lh" @@ -25,7 +28,7 @@ public: m_maincpu(*this, "maincpu"), m_inp_matrix(*this, "IN"), m_speaker(*this, "speaker"), - m_display_maxy(0), + m_display_maxy(1), m_display_maxx(0), m_display_wait(50) { } @@ -46,19 +49,31 @@ public: UINT32 m_display_cache[0x20]; UINT8 m_display_decay[0x20][0x20]; UINT16 m_7seg_mask[0x20]; + + TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); + bool index_is_7segled(int index); + void display_update(); UINT8 read_inputs(int columns); // game-specific handlers + void amaztron_display(); + DECLARE_READ8_MEMBER(amaztron_read_k); + DECLARE_WRITE16_MEMBER(amaztron_write_o); + DECLARE_WRITE16_MEMBER(amaztron_write_r); + void tc4_display(); DECLARE_READ8_MEMBER(tc4_read_k); DECLARE_WRITE16_MEMBER(tc4_write_o); DECLARE_WRITE16_MEMBER(tc4_write_r); - TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); - bool index_is_7segled(int index); - void display_update(); + DECLARE_READ8_MEMBER(comp4_read_k); + DECLARE_WRITE16_MEMBER(comp4_write_o); + DECLARE_WRITE16_MEMBER(comp4_write_r); + DECLARE_READ8_MEMBER(simon_read_k); + DECLARE_WRITE16_MEMBER(simon_write_o); + DECLARE_WRITE16_MEMBER(simon_write_r); virtual void machine_start(); }; @@ -170,6 +185,135 @@ UINT8 hh_tms1k_state::read_inputs(int columns) ***************************************************************************/ +/*************************************************************************** + + Coleco Amaze-A-Tron, by Ralph Baer + * TMS1100 MCU, labeled MP3405(die label too) + + This is an electronic board game with a selection of 8 maze games, + most of them for 2 players. A 5x5 playing grid and four markers are + required to play. Refer to the official manual for more information. + +***************************************************************************/ + + +void hh_tms1k_state::amaztron_display() +{ + m_display_maxy = 3; + m_display_maxx = 8; + + // R8,R9: select digit + for (int y = 0; y < 2; y++) + { + m_7seg_mask[y] = 0x7f; + m_display_state[y] = (m_r >> (y + 8) & 1) ? m_o : 0; + } + + // R6,R7: lamps -> lamp20, lamp21 + m_display_state[2] = m_r >> 6 & 3; + + display_update(); +} + +READ8_MEMBER(hh_tms1k_state::amaztron_read_k) +{ + UINT8 k = read_inputs(6); + + // the 5th column is tied to K4+K8 + if (k & 0x10) k |= 0xc; + return k & 0xf; +} + +WRITE16_MEMBER(hh_tms1k_state::amaztron_write_r) +{ + // R0-R5: input mux + m_inp_mux = data & 0x3f; + + // R10: speaker out + m_speaker->level_w(data >> 10 & 1); + + // other bits: + m_r = data; + amaztron_display(); +} + +WRITE16_MEMBER(hh_tms1k_state::amaztron_write_o) +{ + // O0-O6: digit segments + // O7: N/C + m_o = data & 0x7f; + amaztron_display(); +} + + +static INPUT_PORTS_START( amaztron ) + PORT_START("IN.0") // R0 + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME("Button 1") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_NAME("Button 6") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("Button 11") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_NAME("Button 16") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Z) PORT_NAME("Button 21") + + PORT_START("IN.1") // R1 + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_NAME("Button 2") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_NAME("Button 7") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Button 12") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Button 17") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_X) PORT_NAME("Button 22") + + PORT_START("IN.2") // R2 + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_NAME("Button 3") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_NAME("Button 8") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Button 13") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_NAME("Button 18") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_C) PORT_NAME("Button 23") + + PORT_START("IN.3") // R3 + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_NAME("Button 4") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_9) PORT_NAME("Button 9") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("Button 14") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) PORT_NAME("Button 19") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_V) PORT_NAME("Button 24") + + PORT_START("IN.4") // R4 + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_NAME("Button 5") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_0) PORT_NAME("Button 10") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Button 15") + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_NAME("Button 20") + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_B) PORT_NAME("Button 25") + + PORT_START("IN.5") // R5 + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("Game Select") + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("Game Start") + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) +INPUT_PORTS_END + + +static MACHINE_CONFIG_START( amaztron, hh_tms1k_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", TMS1100, 350000) // RC osc. R=33K?, C=100pf -> ~350kHz + MCFG_TMS1XXX_READ_K_CB(READ8(hh_tms1k_state, amaztron_read_k)) + MCFG_TMS1XXX_WRITE_O_CB(WRITE16(hh_tms1k_state, amaztron_write_o)) + MCFG_TMS1XXX_WRITE_R_CB(WRITE16(hh_tms1k_state, amaztron_write_r)) + + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) + + MCFG_DEFAULT_LAYOUT(layout_amaztron) + + /* no video! */ + + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) +MACHINE_CONFIG_END + + + + /*************************************************************************** Coleco Total Control 4 @@ -326,6 +470,202 @@ MACHINE_CONFIG_END +/*************************************************************************** + + Milton Bradley Comp IV + * TMC0904NL CP0904A (die labeled 4A0970D-04A) + + This is small tabletop Mastermind game; a code-breaking game where the player + needs to find out the correct sequence of colours (numbers in our case). + It is known as Logic 5 in Europe, and as Pythaligoras in Japan. + + Press the R key to start, followed by a set of unique numbers and E. + Refer to the official manual for more information. + + + TODO: + - MCU clock is unknown + +***************************************************************************/ + +READ8_MEMBER(hh_tms1k_state::comp4_read_k) +{ + return read_inputs(3); +} + +WRITE16_MEMBER(hh_tms1k_state::comp4_write_r) +{ + // leds: + // R4 R9 + // R10! R8 + // R2 R7 + // R1 R6 + // R0 R5 + m_display_maxx = 11; + m_display_state[0] = data; + display_update(); +} + +WRITE16_MEMBER(hh_tms1k_state::comp4_write_o) +{ + // O0: leds common (always writes 1) + // O1-O3: input mux + // other bits: N/C + m_inp_mux = data >> 1 & 7; +} + + +static INPUT_PORTS_START( comp4 ) + PORT_START("IN.0") // O1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME("R") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") + + PORT_START("IN.1") // O2 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") + 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_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") + + PORT_START("IN.2") // O3 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("E") + 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_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") +INPUT_PORTS_END + + + +static MACHINE_CONFIG_START( comp4, hh_tms1k_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", TMS0970, 250000) // approximation - unknown freq + MCFG_TMS1XXX_READ_K_CB(READ8(hh_tms1k_state, comp4_read_k)) + MCFG_TMS1XXX_WRITE_O_CB(WRITE16(hh_tms1k_state, comp4_write_o)) + MCFG_TMS1XXX_WRITE_R_CB(WRITE16(hh_tms1k_state, comp4_write_r)) + + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) + + MCFG_DEFAULT_LAYOUT(layout_comp4) + + /* no video! */ + + /* no sound! */ +MACHINE_CONFIG_END + + +/*************************************************************************** + + Milton Bradley Simon, created by Ralph Baer + + Revision A hardware: + * TMS1000 (has internal ROM), DS75494 lamp driver + + Newer revisions have a smaller 16-pin MB4850 chip instead of the TMS1000. + This one has been decapped too, but we couldn't find an internal ROM. + It is possibly a cost-reduced custom ASIC specifically for Simon. + + Other games assumed to be on similar hardware: + - Pocket Simon, but there's a chance it only exists with MB4850 chip + - Super Simon (TMS1100) + +***************************************************************************/ + + + + + +/*************************************************************************** + + I/O + +***************************************************************************/ + +READ8_MEMBER(hh_tms1k_state::simon_read_k) +{ + return read_inputs(4); +} + +WRITE16_MEMBER(hh_tms1k_state::simon_write_r) +{ + // R4-R8 go through an 75494 IC first: + // R4 -> 75494 IN6 -> green lamp + // R5 -> 75494 IN3 -> red lamp + // R6 -> 75494 IN5 -> yellow lamp + // R7 -> 75494 IN2 -> blue lamp + m_display_maxx = 4; + m_display_state[0] = data >> 4 & 0xf; + display_update(); + + // R8 -> 75494 IN0 -> speaker + m_speaker->level_w(data >> 8 & 1); + + // R0,R1,R2,R9: input mux + // R3: GND + // other bits: N/C + m_inp_mux = (data & 7) | (data >> 6 & 8); +} + +WRITE16_MEMBER(hh_tms1k_state::simon_write_o) +{ + // N/C +} + + +static INPUT_PORTS_START( simon ) + PORT_START("IN.0") // R0 + PORT_CONFNAME( 0x07, 0x02, "Game Select") + PORT_CONFSETTING( 0x02, "1" ) + PORT_CONFSETTING( 0x01, "2" ) + PORT_CONFSETTING( 0x04, "3" ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.1") // R1 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Green Button") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Red Button") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Yellow Button") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Blue Button") + + PORT_START("IN.2") // R2 + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("Start") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Last") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Longest") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN.3") // R9 + PORT_CONFNAME( 0x0f, 0x01, "Skill Level") + PORT_CONFSETTING( 0x02, "1" ) + PORT_CONFSETTING( 0x04, "2" ) + PORT_CONFSETTING( 0x08, "3" ) + PORT_CONFSETTING( 0x01, "4" ) +INPUT_PORTS_END + + +static MACHINE_CONFIG_START( simon, hh_tms1k_state ) + + /* basic machine hardware */ + MCFG_CPU_ADD("maincpu", TMS1000, 350000) // RC osc. R=33K, C=100pf -> ~350kHz + MCFG_TMS1XXX_READ_K_CB(READ8(hh_tms1k_state, simon_read_k)) + MCFG_TMS1XXX_WRITE_O_CB(WRITE16(hh_tms1k_state, simon_write_o)) + MCFG_TMS1XXX_WRITE_R_CB(WRITE16(hh_tms1k_state, simon_write_r)) + + MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) + + MCFG_DEFAULT_LAYOUT(layout_simon) + + /* no video! */ + + /* sound hardware */ + MCFG_SPEAKER_STANDARD_MONO("mono") + MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) + MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) +MACHINE_CONFIG_END + + + + + /*************************************************************************** Entex Baseball @@ -361,6 +701,20 @@ MACHINE_CONFIG_END ***************************************************************************/ + +ROM_START( amaztron ) + ROM_REGION( 0x0800, "maincpu", 0 ) + ROM_LOAD( "tms1100nll_mp3405", 0x0000, 0x0800, CRC(9cbc0009) SHA1(17772681271b59280687492f37fa0859998f041d) ) + + ROM_REGION( 867, "maincpu:mpla", 0 ) + ROM_LOAD( "tms1100_amaztron_mpla.pla", 0, 867, CRC(03574895) SHA1(04407cabfb3adee2ee5e4218612cb06c12c540f4) ) + ROM_REGION( 365, "maincpu:opla", 0 ) + ROM_LOAD( "tms1100_amaztron_opla.pla", 0, 365, CRC(f3875384) SHA1(3c256a3db4f0aa9d93cf78124db39f4cbdc57e4a) ) +ROM_END + + + + ROM_START( tc4 ) ROM_REGION( 0x1000, "maincpu", 0 ) ROM_LOAD( "tms1400nll_mp7334", 0x0000, 0x1000, CRC(923f3821) SHA1(a9ae342d7ff8dae1dedcd1e4984bcfae68586581) ) @@ -383,6 +737,38 @@ ROM_START( ebball ) ROM_END +ROM_START( comp4 ) + ROM_REGION( 0x0400, "maincpu", 0 ) + ROM_LOAD( "tmc0904nl_cp0904a", 0x0000, 0x0400, CRC(6233ee1b) SHA1(738e109b38c97804b4ec52bed80b00a8634ad453) ) + + ROM_REGION( 782, "maincpu:ipla", 0 ) + ROM_LOAD( "tms0970_default_ipla.pla", 0, 782, CRC(e038fc44) SHA1(dfc280f6d0a5828d1bb14fcd59ac29caf2c2d981) ) + ROM_REGION( 860, "maincpu:mpla", 0 ) + ROM_LOAD( "tms0970_comp4_mpla.pla", 0, 860, CRC(ee9d7d9e) SHA1(25484e18f6a07f7cdb21a07220e2f2a82fadfe7b) ) + ROM_REGION( 352, "maincpu:opla", 0 ) + ROM_LOAD( "tms0970_comp4_opla.pla", 0, 352, CRC(a0f887d1) SHA1(3c666663d484d5bed81e1014f8715aab8a3d489f) ) + ROM_REGION( 157, "maincpu:spla", 0 ) + ROM_LOAD( "tms0970_comp4_spla.pla", 0, 157, CRC(e5bddd90) SHA1(4b1c6512c70e5bcd23c2dbf0c88cd8aa2c632a10) ) +ROM_END + + +ROM_START( simon ) + ROM_REGION( 0x0400, "maincpu", 0 ) + ROM_LOAD( "tms1000.u1", 0x0000, 0x0400, CRC(9961719d) SHA1(35dddb018a8a2b31f377ab49c1f0cb76951b81c0) ) + + ROM_REGION( 867, "maincpu:mpla", 0 ) + ROM_LOAD( "tms1000_simon_mpla.pla", 0, 867, CRC(52f7c1f1) SHA1(dbc2634dcb98eac173ad0209df487cad413d08a5) ) + ROM_REGION( 365, "maincpu:opla", 0 ) + ROM_LOAD( "tms1000_simon_opla.pla", 0, 365, CRC(2943c71b) SHA1(bd5bb55c57e7ba27e49c645937ec1d4e67506601) ) +ROM_END + + + + +CONS( 1979, amaztron, 0, 0, amaztron, amaztron, driver_device, 0, "Coleco", "Amaze-A-Tron", GAME_SUPPORTS_SAVE ) +CONS( 1981, tc4, 0, 0, tc4, tc4, driver_device, 0, "Coleco", "Total Control 4", GAME_SUPPORTS_SAVE ) + CONS( 1979, ebball, 0, 0, ebball, ebball, driver_device, 0, "Entex", "Baseball (Entex)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) -CONS( 1981, tc4, 0, 0, tc4, tc4, driver_device, 0, "Coleco", "Total Control 4", GAME_SUPPORTS_SAVE ) +CONS( 1977, comp4, 0, 0, comp4, comp4, driver_device, 0, "Milton Bradley", "Comp IV", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) +CONS( 1978, simon, 0, 0, simon, simon, driver_device, 0, "Milton Bradley", "Simon (Rev. A)", GAME_SUPPORTS_SAVE ) diff --git a/src/mess/drivers/simon.c b/src/mess/drivers/simon.c deleted file mode 100644 index 3a885b542c0..00000000000 --- a/src/mess/drivers/simon.c +++ /dev/null @@ -1,188 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:hap -/*************************************************************************** - - Milton Bradley Simon, created by Ralph Baer - - Revision A hardware: - * TMS1000 (has internal ROM), DS75494 lamp driver - - Newer revisions have a smaller 16-pin MB4850 chip instead of the TMS1000. - This one has been decapped too, but we couldn't find an internal ROM. - It is possibly a cost-reduced custom ASIC specifically for Simon. - - Other games assumed to be on similar hardware: - - Pocket Simon, but there's a chance it only exists with MB4850 chip - - Super Simon (TMS1100) - -***************************************************************************/ - -#include "emu.h" -#include "cpu/tms0980/tms0980.h" -#include "sound/speaker.h" - -#include "simon.lh" // clickable - -// master clock is a single stage RC oscillator: R=33K, C=100pf, -// according to the TMS 1000 series data manual this is around 350kHz -#define MASTER_CLOCK (350000) - - -class simon_state : public driver_device -{ -public: - simon_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<4> m_button_matrix; - required_device m_speaker; - - UINT16 m_r; - - DECLARE_READ8_MEMBER(read_k); - DECLARE_WRITE16_MEMBER(write_o); - DECLARE_WRITE16_MEMBER(write_r); - - virtual void machine_start(); -}; - - -/*************************************************************************** - - I/O - -***************************************************************************/ - -READ8_MEMBER(simon_state::read_k) -{ - UINT8 k = 0; - - // read selected button rows - for (int i = 0; i < 4; i++) - { - const int ki[4] = { 0, 1, 2, 9 }; - if (m_r >> ki[i] & 1) - k |= m_button_matrix[i]->read(); - } - - return k; -} - -WRITE16_MEMBER(simon_state::write_r) -{ - // R4-R8 go through an 75494 IC first: - // R4 -> 75494 IN6 -> green lamp - // R5 -> 75494 IN3 -> red lamp - // R6 -> 75494 IN5 -> yellow lamp - // R7 -> 75494 IN2 -> blue lamp - for (int i = 0; i < 4; i++) - output_set_lamp_value(i, data >> (4 + i) & 1); - - // R8 -> 75494 IN0 -> speaker - m_speaker->level_w(data >> 8 & 1); - - // R0,R1,R2,R9: input mux - // R3: GND - // other bits: N/C - m_r = data; -} - -WRITE16_MEMBER(simon_state::write_o) -{ - // N/C -} - - - -/*************************************************************************** - - Inputs - -***************************************************************************/ - -static INPUT_PORTS_START( simon ) - PORT_START("IN.0") // R0 - PORT_CONFNAME( 0x07, 0x02, "Game Select") - PORT_CONFSETTING( 0x02, "1" ) - PORT_CONFSETTING( 0x01, "2" ) - PORT_CONFSETTING( 0x04, "3" ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("IN.1") // R1 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Green Button") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Red Button") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Yellow Button") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Blue Button") - - PORT_START("IN.2") // R2 - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("Start") - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Last") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Longest") - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("IN.3") // R9 - PORT_CONFNAME( 0x0f, 0x01, "Skill Level") - PORT_CONFSETTING( 0x02, "1" ) - PORT_CONFSETTING( 0x04, "2" ) - PORT_CONFSETTING( 0x08, "3" ) - PORT_CONFSETTING( 0x01, "4" ) -INPUT_PORTS_END - - - -/*************************************************************************** - - Machine Config - -***************************************************************************/ - -void simon_state::machine_start() -{ - m_r = 0; - save_item(NAME(m_r)); -} - - -static MACHINE_CONFIG_START( simon, simon_state ) - - /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", TMS1000, MASTER_CLOCK) - MCFG_TMS1XXX_READ_K_CB(READ8(simon_state, read_k)) - MCFG_TMS1XXX_WRITE_O_CB(WRITE16(simon_state, write_o)) - MCFG_TMS1XXX_WRITE_R_CB(WRITE16(simon_state, write_r)) - - MCFG_DEFAULT_LAYOUT(layout_simon) - - /* no video! */ - - /* sound hardware */ - MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) -MACHINE_CONFIG_END - - - -/*************************************************************************** - - Game driver(s) - -***************************************************************************/ - -ROM_START( simon ) - ROM_REGION( 0x0400, "maincpu", 0 ) - ROM_LOAD( "tms1000.u1", 0x0000, 0x0400, CRC(9961719d) SHA1(35dddb018a8a2b31f377ab49c1f0cb76951b81c0) ) - - ROM_REGION( 867, "maincpu:mpla", 0 ) - ROM_LOAD( "tms1000_simon_mpla.pla", 0, 867, CRC(52f7c1f1) SHA1(dbc2634dcb98eac173ad0209df487cad413d08a5) ) - ROM_REGION( 365, "maincpu:opla", 0 ) - ROM_LOAD( "tms1000_simon_opla.pla", 0, 365, CRC(2943c71b) SHA1(bd5bb55c57e7ba27e49c645937ec1d4e67506601) ) -ROM_END - - -CONS( 1978, simon, 0, 0, simon, simon, driver_device, 0, "Milton Bradley", "Simon (Rev. A)", GAME_SUPPORTS_SAVE ) diff --git a/src/mess/layout/amaztron.lay b/src/mess/layout/amaztron.lay index a41d596f8ad..8b31f239489 100644 --- a/src/mess/layout/amaztron.lay +++ b/src/mess/layout/amaztron.lay @@ -23,8 +23,8 @@ - - + + diff --git a/src/mess/mess.mak b/src/mess/mess.mak index a18a2166152..d62c7546631 100644 --- a/src/mess/mess.mak +++ b/src/mess/mess.mak @@ -1131,7 +1131,6 @@ $(MESSOBJ)/coleco.a: \ $(MESS_DRIVERS)/adam.o \ $(MESS_DRIVERS)/coleco.o \ $(MESS_MACHINE)/coleco.o \ - $(MESS_DRIVERS)/amaztron.o \ $(MESSOBJ)/cromemco.a: \ $(MESS_DRIVERS)/c10.o \ @@ -1384,9 +1383,7 @@ $(MESSOBJ)/matsushi.a: \ $(MESS_DRIVERS)/myb3k.o \ $(MESSOBJ)/mb.a: \ - $(MESS_DRIVERS)/comp4.o \ $(MESS_DRIVERS)/microvsn.o \ - $(MESS_DRIVERS)/simon.o \ $(MESSOBJ)/mchester.a: \ $(MESS_DRIVERS)/ssem.o \ @@ -2145,8 +2142,11 @@ $(MESS_DRIVERS)/fidelz80.o: $(MESS_LAYOUT)/fidelz80.lh \ $(MESS_DRIVERS)/gamecom.o: $(MESS_LAYOUT)/gamecom.lh $(MESS_DRIVERS)/glasgow.o: $(MESS_LAYOUT)/glasgow.lh $(MESS_DRIVERS)/h8.o: $(MESS_LAYOUT)/h8.lh -$(MESS_DRIVERS)/hh_tms1k.o: $(MESS_LAYOUT)/tc4.lh \ - $(MESS_LAYOUT)/ebball.lh +$(MESS_DRIVERS)/hh_tms1k.o: $(MESS_LAYOUT)/amaztron.lh \ + $(MESS_LAYOUT)/comp4.lh \ + $(MESS_LAYOUT)/ebball.lh \ + $(MESS_LAYOUT)/simon.lh \ + $(MESS_LAYOUT)/tc4.lh $(MESS_DRIVERS)/ie15.o: $(MESS_LAYOUT)/ie15.lh $(MESS_DRIVERS)/instruct.o: $(MESS_LAYOUT)/instruct.lh $(MESS_DRIVERS)/k1003.o: $(MESS_LAYOUT)/k1003.lh