From e3bc260cd1daafbe8bbbf66c954924bcc7d8ff29 Mon Sep 17 00:00:00 2001 From: Sandro Ronco Date: Fri, 23 Mar 2018 21:31:35 +0100 Subject: Convert glasgow.cpp to use the mmboard device. [Sandro Ronco] New machines promoted to working -------------------------------- Mephisto Amsterdam [Sandro Ronco] Mephisto Dallas [Sandro Ronco] Mephisto Roma [Sandro Ronco] --- src/mame/drivers/glasgow.cpp | 512 +++++++------------------------------------ src/mame/layout/glasgow.lay | 303 +++++++++++++++++++++++-- 2 files changed, 370 insertions(+), 445 deletions(-) diff --git a/src/mame/drivers/glasgow.cpp b/src/mame/drivers/glasgow.cpp index 26e524a729a..2671902cdf3 100644 --- a/src/mame/drivers/glasgow.cpp +++ b/src/mame/drivers/glasgow.cpp @@ -36,14 +36,12 @@ How to play (quick guide) 7. You'll need to read the official user manual for advanced features, or if you get messages such as "Err1". -ToDo: -- Only glasgow works, the others are incomplete. - ***************************************************************************/ #include "emu.h" #include "cpu/m68000/m68000.h" +#include "machine/mmboard.h" #include "machine/timer.h" #include "sound/beep.h" #include "speaker.h" @@ -58,9 +56,8 @@ public: : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_beep(*this, "beeper") - , m_keyboard(*this, "LINE.%u", 0) - , m_pieces(*this, "P%u", 0U) - , m_leds(*this, "led%u", 0U) + , m_board(*this, "board") + , m_keyboard(*this, "LINE%u", 0) , m_digits(*this, "digit%u", 0U) { } @@ -69,46 +66,26 @@ public: protected: DECLARE_WRITE8_MEMBER(glasgow_lcd_w); DECLARE_WRITE8_MEMBER(glasgow_lcd_flag_w); - DECLARE_READ16_MEMBER(glasgow_keys_r); - DECLARE_WRITE16_MEMBER(glasgow_keys_w); - DECLARE_READ16_MEMBER(glasgow_board_r); - DECLARE_WRITE16_MEMBER(glasgow_board_w); - DECLARE_WRITE16_MEMBER(glasgow_beeper_w); + DECLARE_READ8_MEMBER(glasgow_keys_r); + DECLARE_WRITE8_MEMBER(glasgow_keys_w); TIMER_DEVICE_CALLBACK_MEMBER(update_nmi); virtual void machine_start() override; virtual void machine_reset() override; - static uint8_t pos_to_num( uint8_t ); - void set_board(); - void glasgow_pieces_w(); - void glasgow_mem(address_map &map); required_device m_maincpu; required_device m_beep; - required_ioport_array<8> m_keyboard; - output_finder<64> m_pieces; - output_finder<64> m_leds; + required_device m_board; + required_ioport_array<2> m_keyboard; output_finder<4> m_digits; uint8_t m_lcd_shift_counter; uint8_t m_led7; uint8_t m_key_select; - bool m_lcd_invert; - bool m_key_selector; - uint8_t m_read_board_flag; - uint8_t m_mouse_hold; - uint8_t m_board_row; - uint8_t m_mouse_down; - uint16_t m_Line18_LED; - uint16_t m_Line18_REED; - uint8_t m_selected[2]; private: - struct BOARD_FIELD { uint8_t field, piece; }; - BOARD_FIELD m_board[8][8]; - static const BOARD_FIELD s_start_board[8][8]; }; @@ -122,14 +99,11 @@ public: protected: DECLARE_WRITE8_MEMBER(write_lcd); + DECLARE_WRITE8_MEMBER(write_lcd32); DECLARE_WRITE8_MEMBER(write_lcd_flag); DECLARE_WRITE8_MEMBER(write_beeper); - DECLARE_READ16_MEMBER(read_board); DECLARE_WRITE8_MEMBER(write_board); - DECLARE_WRITE16_MEMBER(write_lcd_invert); DECLARE_READ8_MEMBER(read_newkeys); - DECLARE_READ32_MEMBER(read_board32); - DECLARE_WRITE32_MEMBER(write_keys32); TIMER_DEVICE_CALLBACK_MEMBER(update_nmi32); void amsterd_mem(address_map &map); @@ -137,52 +111,6 @@ protected: }; -/* starts at bottom left corner */ -const glasgow_state::BOARD_FIELD glasgow_state::s_start_board[8][8] = -{ - { {7,10}, {6,8}, {5,9}, {4,11}, {3,12}, {2,9}, {1,8}, {0,10} }, - { {15,7}, {14,7}, {13,7}, {12,7}, { 11,7}, {10,7}, {9,7}, {8,7} }, - - { {23,0}, {22,0}, {21,0}, {20,0}, {19,0}, {18,0}, {17,0}, {16,0} }, - { {31,0}, {30,0}, {29,0}, {28,0}, {27,0}, {26,0}, {25,0}, {24,0} }, - { {39,0}, {38,0}, {37,0}, {36,0}, {35,0}, {34,0}, {33,0}, {32,0} }, - { {47,0}, {46,0}, {45,0}, {44,0}, {43,0}, {42,0}, {41,0}, {40,0} }, - - { {55,1}, {54,1}, {53,1}, {52,1}, {51,1}, {50,1}, {49,1}, {48,1} }, - { {63,4}, {62,2}, {61,3}, {60,5}, {59,6}, {58,3}, {57,2}, {56,4} } -}; - -uint8_t glasgow_state::pos_to_num(uint8_t val) -{ - switch (val) - { - case 0xfe: return 7; - case 0xfd: return 6; - case 0xfb: return 5; - case 0xf7: return 4; - case 0xef: return 3; - case 0xdf: return 2; - case 0xbf: return 1; - case 0x7f: return 0; - default: return 0xff; - } -} - -void glasgow_state::set_board() -{ - // copy start postition to m_board - for (uint8_t i_AH = 0; i_AH < 8; i_AH++) - for (uint8_t i_18 = 0; i_18 < 8; i_18++) - m_board[i_18][i_AH] = s_start_board[i_18][i_AH]; -} - -void glasgow_state::glasgow_pieces_w() -{ - // This causes the pieces to display on-screen - for (uint8_t i_18 = 0; i_18 < 8; i_18++) - for (uint8_t i_AH = 0; i_AH < 8; i_AH++) - m_pieces[63 - m_board[i_18][i_AH].field] = m_board[i_18][i_AH].piece; -} WRITE8_MEMBER( glasgow_state::glasgow_lcd_w ) { @@ -202,198 +130,64 @@ WRITE8_MEMBER( glasgow_state::glasgow_lcd_flag_w ) if (lcd_flag) m_led7 = 255; else - { m_led7 = 0; - m_key_selector = 1; - } } -READ16_MEMBER( glasgow_state::glasgow_keys_r ) +READ8_MEMBER( glasgow_state::glasgow_keys_r ) { - m_board_row++; - m_board_row &= 7; - - // See if we are moving a piece - uint8_t data = m_keyboard[m_board_row]->read(); - - if ((data < 0xff) && (m_mouse_down == 0)) - { - uint8_t pos2num_res = pos_to_num(data); - uint8_t piece = m_board[m_board_row][pos2num_res].piece; - - if (pos2num_res > 7) - logerror("Position out of bound!"); - else - if ((m_mouse_hold > 0) && ((piece == 0) || (piece > 12))) // putting a piece down onto blank spot or a shadow - { - if (m_selected[0] < 8) - { - m_board[m_selected[0]][m_selected[1]].piece = 0; // remove shadow - m_selected[0] = 0xff; - } - m_board[m_board_row][pos2num_res].piece = m_mouse_hold; - m_mouse_hold = 0; - } - else - if ((m_mouse_hold == 0) && (piece) && (piece < 13)) // picking up a piece - { - m_mouse_hold = piece; - m_board[m_board_row][pos2num_res].piece = m_mouse_hold + 12; // replace piece with shadow - m_selected[0] = m_board_row; - m_selected[1] = pos2num_res; // save position of shadow - } - - m_mouse_down = m_board_row + 1; - } - else - if ((data == 0xff) && (m_mouse_down == (m_board_row + 1))) // Wait for mouse to be released - m_mouse_down = 0; - - // See if we are taking a piece off the board - if (!ioport("LINE10")->read()) - { - m_mouse_hold = 0; - if (m_selected[0] < 8) - { - m_board[m_selected[0]][m_selected[1]].piece = 0; // remove shadow - m_selected[0] = 0xff; - } - } - // See if any keys pressed - data = 3; + uint8_t data = 3; - if (m_key_select == ioport("LINE0")->read()) + if (m_key_select == m_keyboard[0]->read()) data &= 1; - if (m_key_select == ioport("LINE1")->read()) + if (m_key_select == m_keyboard[1]->read()) data &= 2; - return data << 8; -} - -WRITE16_MEMBER( glasgow_state::glasgow_keys_w ) -{ - m_key_select = data >> 8; - glasgow_pieces_w(); + return data; } -READ16_MEMBER( glasgow_state::glasgow_board_r ) +WRITE8_MEMBER( glasgow_state::glasgow_keys_w ) { - uint8_t i_AH, data = 0; - - if (m_Line18_REED < 8) - { - // if there is a piece on the field -> set bit in data - for (i_AH = 0; i_AH < 8; i_AH++) - { - if (!m_board[m_Line18_REED][i_AH].piece) - data |= (1 << i_AH); - } - } - - m_read_board_flag = true; - - return data << 8; + m_key_select = data; } -WRITE16_MEMBER( glasgow_state::glasgow_board_w ) +WRITE8_MEMBER( amsterd_state::write_lcd ) { - m_Line18_REED = pos_to_num(data >> 8) ^ 7; - - // LED's or REED's ? - if (m_read_board_flag) - { - m_Line18_LED = 0; - m_read_board_flag = 0; - } - else - { - m_Line18_LED = data >> 8; - } + if (m_lcd_shift_counter & 4) + m_digits[m_lcd_shift_counter & 3] = data ^ 0xff; - m_lcd_invert = 1; -} - -WRITE16_MEMBER( glasgow_state::glasgow_beeper_w ) -{ - uint16_t const LineAH = data >> 8; - - if (LineAH && m_Line18_LED) - { - for (uint8_t i_AH = 0; i_AH < 8; i_AH++) - { - if (LineAH & (1 << i_AH)) - { - for (uint8_t i_18 = 0; i_18 < 8; i_18++) - { - if (!(m_Line18_LED & (1 << i_18))) - { - m_leds[m_board[i_18][i_AH].field] = 1; // LED on - } - else - { - // LED off - } - } - } - } - } - else - { - // No LED -> all LED's off - for (uint8_t i_AH = 0; i_AH < 8; i_AH++) - { - for (uint8_t i_18 = 0; i_18 < 8; i_18++) - m_leds[m_board[i_18][i_AH].field] = 0; // LED off - } - } + m_lcd_shift_counter--; + m_lcd_shift_counter &= 7; } -WRITE16_MEMBER( amsterd_state::write_lcd_invert ) +WRITE8_MEMBER( amsterd_state::write_lcd32 ) { - m_lcd_invert = 1; -} + if (m_lcd_shift_counter & 4) + m_digits[m_lcd_shift_counter & 3] = data; -WRITE8_MEMBER( amsterd_state::write_lcd ) -{ - m_digits[m_lcd_shift_counter] = m_lcd_invert ? (data ^ 0xff) : data; m_lcd_shift_counter--; - m_lcd_shift_counter &= 3; - logerror("LCD Offset = %d Data low = %x \n", offset, data); + m_lcd_shift_counter &= 7; } WRITE8_MEMBER( amsterd_state::write_lcd_flag ) { - m_lcd_invert = 0; - //beep_set_state(0, (data & 1) ? 1 : 0); - if (!data) - m_key_selector = 1; + m_key_select = 1; // The key function in the rom expects after writing to // the a value from the second key row; m_led7 = data ? 255 : 0; - logerror("LCD Flag = %x\n", data); -} - -READ16_MEMBER( amsterd_state::read_board ) -{ - return 0xff00; // Mephisto need it for working } WRITE8_MEMBER( amsterd_state::write_board ) { - if (data == 0xff) - m_key_selector = 0; - // The key function in the rom expects after writing to - // the chess board a value from the first key row; - logerror("Write Board = %x\n", data); - glasgow_pieces_w(); + m_key_select = 0; + m_board->led_w(space, offset, 0); + m_board->mux_w(space, offset, data); } - WRITE8_MEMBER( amsterd_state::write_beeper ) { m_beep->set_state(BIT(data, 0)); @@ -401,54 +195,9 @@ WRITE8_MEMBER( amsterd_state::write_beeper ) READ8_MEMBER( amsterd_state::read_newkeys ) //Amsterdam, Roma, Dallas 32, Roma 32 { - uint8_t data; - - if (m_key_selector) - data = ioport("LINE1")->read(); - else - data = ioport("LINE0")->read(); - - logerror("read Keyboard Offset = %x Data = %x Select = %x \n", offset, data, m_key_selector); - return data; -} - - -#ifdef UNUSED_FUNCTION -READ16_MEMBER(read_test) -{ - logerror("read test Offset = %x Data = %x\n ",offset,data); - return 0xffff; // Mephisto need it for working -} -#endif - -/* - - ***** 32 Bit Read and write Handler *********** - -*/ - -WRITE32_MEMBER( amsterd_state::write_keys32 ) -{ - m_lcd_invert = 1; - m_key_select = data; - logerror("Write Key = %x \n", m_key_select); + return m_keyboard[m_key_select & 1]->read(); } -READ32_MEMBER( amsterd_state::read_board32 ) -{ - logerror("read board 32 Offset = %x \n", offset); - return 0; -} - -#ifdef UNUSED_FUNCTION -READ16_MEMBER(read_board_amsterd) -{ - logerror("read board amsterdam Offset = %x \n ", offset); - return 0xffff; -} -#endif - - TIMER_DEVICE_CALLBACK_MEMBER( glasgow_state::update_nmi) { m_maincpu->set_input_line(7, HOLD_LINE); @@ -461,32 +210,19 @@ TIMER_DEVICE_CALLBACK_MEMBER( amsterd_state::update_nmi32 ) void glasgow_state::machine_start() { - m_pieces.resolve(); - m_leds.resolve(); m_digits.resolve(); save_item(NAME(m_lcd_shift_counter)); save_item(NAME(m_led7)); save_item(NAME(m_key_select)); - save_item(NAME(m_lcd_invert)); - save_item(NAME(m_key_selector)); - save_item(NAME(m_read_board_flag)); - save_item(NAME(m_mouse_hold)); - save_item(NAME(m_board_row)); - save_item(NAME(m_mouse_down)); - save_item(NAME(m_Line18_LED)); - save_item(NAME(m_Line18_REED)); - save_item(NAME(m_selected)); - - m_key_selector = 0; } void glasgow_state::machine_reset() { m_lcd_shift_counter = 3; - m_selected[0] = 0xff; - set_board(); + m_key_select = 0; + m_led7 = 0; } @@ -495,10 +231,10 @@ void glasgow_state::glasgow_mem(address_map &map) map.global_mask(0x1ffff); map(0x000000, 0x00ffff).rom(); map(0x010000, 0x010000).w(this, FUNC(glasgow_state::glasgow_lcd_w)); - map(0x010002, 0x010003).rw(this, FUNC(glasgow_state::glasgow_keys_r), FUNC(glasgow_state::glasgow_keys_w)); + map(0x010002, 0x010002).rw(this, FUNC(glasgow_state::glasgow_keys_r), FUNC(glasgow_state::glasgow_keys_w)); map(0x010004, 0x010004).w(this, FUNC(glasgow_state::glasgow_lcd_flag_w)); - map(0x010006, 0x010007).rw(this, FUNC(glasgow_state::glasgow_board_r), FUNC(glasgow_state::glasgow_beeper_w)); - map(0x010008, 0x010009).w(this, FUNC(glasgow_state::glasgow_board_w)); + map(0x010006, 0x010006).rw("board", FUNC(mephisto_board_device::input_r), FUNC(mephisto_board_device::led_w)); + map(0x010008, 0x010008).w("board", FUNC(mephisto_board_device::mux_w)); map(0x01c000, 0x01ffff).ram(); // 16KB } @@ -510,9 +246,9 @@ void amsterd_state::amsterd_mem(address_map &map) map(0x800008, 0x800008).w(this, FUNC(amsterd_state::write_lcd_flag)); map(0x800004, 0x800004).w(this, FUNC(amsterd_state::write_beeper)); map(0x800010, 0x800010).w(this, FUNC(amsterd_state::write_board)); - map(0x800020, 0x800021).r(this, FUNC(amsterd_state::read_board)); + map(0x800020, 0x800020).r("board", FUNC(mephisto_board_device::input_r)); map(0x800040, 0x800040).r(this, FUNC(amsterd_state::read_newkeys)); - map(0x800088, 0x800089).w(this, FUNC(amsterd_state::write_lcd_invert)); + map(0x800088, 0x800088).w("board", FUNC(mephisto_board_device::led_w)); map(0xffc000, 0xffffff).ram(); // 16KB } @@ -521,147 +257,67 @@ void amsterd_state::dallas32_mem(address_map &map) // ADDRESS_MAP_GLOBAL_MASK(0x1FFFF) map(0x000000, 0x00ffff).rom(); map(0x010000, 0x01ffff).ram(); // 64KB - map(0x800002, 0x800002).w(this, FUNC(amsterd_state::write_lcd)); + map(0x800002, 0x800002).w(this, FUNC(amsterd_state::write_lcd32)); map(0x800004, 0x800004).w(this, FUNC(amsterd_state::write_beeper)); map(0x800008, 0x800008).w(this, FUNC(amsterd_state::write_lcd_flag)); map(0x800010, 0x800010).w(this, FUNC(amsterd_state::write_board)); - map(0x800020, 0x800023).r(this, FUNC(amsterd_state::read_board32)); + map(0x800020, 0x800020).r("board", FUNC(mephisto_board_device::input_r)); map(0x800040, 0x800040).r(this, FUNC(amsterd_state::read_newkeys)); - map(0x800088, 0x80008b).w(this, FUNC(amsterd_state::write_keys32)); + map(0x800088, 0x800088).w("board", FUNC(mephisto_board_device::led_w)); } - -static INPUT_PORTS_START( chessboard ) - PORT_START("LINE.0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_START("LINE.1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_START("LINE.2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_START("LINE.3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_START("LINE.4") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_START("LINE.5") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_START("LINE.6") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_START("LINE.7") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) - PORT_START("LINE10") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) -INPUT_PORTS_END - static INPUT_PORTS_START( new_keyboard ) //Amsterdam, Dallas 32, Roma, Roma 32 PORT_START("LINE0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A 1") PORT_CODE(KEYCODE_A) PORT_CODE(KEYCODE_1) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("B 2") PORT_CODE(KEYCODE_B) PORT_CODE(KEYCODE_2) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C 3") PORT_CODE(KEYCODE_C) PORT_CODE(KEYCODE_3) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("D 4") PORT_CODE(KEYCODE_D) PORT_CODE(KEYCODE_4) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("E 5") PORT_CODE(KEYCODE_E) PORT_CODE(KEYCODE_5) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F 6") PORT_CODE(KEYCODE_F) PORT_CODE(KEYCODE_6) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_9) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_0) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("A 1") PORT_CODE(KEYCODE_A) PORT_CODE(KEYCODE_1) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("B 2") PORT_CODE(KEYCODE_B) PORT_CODE(KEYCODE_2) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("C 3") PORT_CODE(KEYCODE_C) PORT_CODE(KEYCODE_3) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("D 4") PORT_CODE(KEYCODE_D) PORT_CODE(KEYCODE_4) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("E 5") PORT_CODE(KEYCODE_E) PORT_CODE(KEYCODE_5) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("F 6") PORT_CODE(KEYCODE_F) PORT_CODE(KEYCODE_6) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("9") PORT_CODE(KEYCODE_9) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_START("LINE1") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("INF") PORT_CODE(KEYCODE_F1) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("POS") PORT_CODE(KEYCODE_F2) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("LEV") PORT_CODE(KEYCODE_F3) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("MEM") PORT_CODE(KEYCODE_F4) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CLR") PORT_CODE(KEYCODE_F5) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ENT") PORT_CODE(KEYCODE_ENTER) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("G 7") PORT_CODE(KEYCODE_G) PORT_CODE(KEYCODE_7) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("H 8") PORT_CODE(KEYCODE_H) PORT_CODE(KEYCODE_8) - - PORT_INCLUDE( chessboard ) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INF") PORT_CODE(KEYCODE_I) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_O) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEV") PORT_CODE(KEYCODE_L) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM") PORT_CODE(KEYCODE_M) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CLR") PORT_CODE(KEYCODE_BACKSPACE) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("ENT") PORT_CODE(KEYCODE_ENTER) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("G 7") PORT_CODE(KEYCODE_G) PORT_CODE(KEYCODE_7) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("H 8") PORT_CODE(KEYCODE_H) PORT_CODE(KEYCODE_8) INPUT_PORTS_END static INPUT_PORTS_START( old_keyboard ) //Glasgow,Dallas PORT_START("LINE0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CL") PORT_CODE(KEYCODE_F5) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C 3") PORT_CODE(KEYCODE_C) PORT_CODE(KEYCODE_3) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ENT") PORT_CODE(KEYCODE_ENTER) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D 4") PORT_CODE(KEYCODE_D) PORT_CODE(KEYCODE_4) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A 1") PORT_CODE(KEYCODE_A) PORT_CODE(KEYCODE_1) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F 6") PORT_CODE(KEYCODE_F) PORT_CODE(KEYCODE_6) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B 2") PORT_CODE(KEYCODE_B) PORT_CODE(KEYCODE_2) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("9") PORT_CODE(KEYCODE_9) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("CL") PORT_CODE(KEYCODE_BACKSPACE) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("C 3") PORT_CODE(KEYCODE_C) PORT_CODE(KEYCODE_3) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("ENT") PORT_CODE(KEYCODE_ENTER) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("D 4") PORT_CODE(KEYCODE_D) PORT_CODE(KEYCODE_4) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("A 1") PORT_CODE(KEYCODE_A) PORT_CODE(KEYCODE_1) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("F 6") PORT_CODE(KEYCODE_F) PORT_CODE(KEYCODE_6) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("B 2") PORT_CODE(KEYCODE_B) PORT_CODE(KEYCODE_2) PORT_START("LINE1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E 5") PORT_CODE(KEYCODE_E) PORT_CODE(KEYCODE_5) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("INF") PORT_CODE(KEYCODE_F1) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("POS") PORT_CODE(KEYCODE_F2) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H 8") PORT_CODE(KEYCODE_H) PORT_CODE(KEYCODE_8) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("LEV") PORT_CODE(KEYCODE_F3) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G 7") PORT_CODE(KEYCODE_G) PORT_CODE(KEYCODE_7) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("MEM") PORT_CODE(KEYCODE_F4) - - PORT_INCLUDE( chessboard ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("E 5") PORT_CODE(KEYCODE_E) PORT_CODE(KEYCODE_5) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("INF") PORT_CODE(KEYCODE_I) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("0") PORT_CODE(KEYCODE_0) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("POS") PORT_CODE(KEYCODE_O) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("H 8") PORT_CODE(KEYCODE_H) PORT_CODE(KEYCODE_8) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("LEV") PORT_CODE(KEYCODE_L) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("G 7") PORT_CODE(KEYCODE_G) PORT_CODE(KEYCODE_7) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("MEM") PORT_CODE(KEYCODE_M) INPUT_PORTS_END MACHINE_CONFIG_START(glasgow_state::glasgow) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, 12000000) + MCFG_CPU_ADD("maincpu", M68000, 12_MHz_XTAL) MCFG_CPU_PROGRAM_MAP(glasgow_mem) + MCFG_MEPHISTO_SENSORS_BOARD_ADD("board") + /* video hardware */ MCFG_DEFAULT_LAYOUT(layout_glasgow) @@ -684,7 +340,7 @@ MACHINE_CONFIG_START(amsterd_state::dallas32) glasgow(config); /* basic machine hardware */ - MCFG_CPU_REPLACE("maincpu", M68020, 14000000) + MCFG_CPU_REPLACE("maincpu", M68020, 14_MHz_XTAL) MCFG_CPU_PROGRAM_MAP(dallas32_mem) MCFG_DEVICE_REMOVE("nmi_timer") @@ -727,10 +383,10 @@ ROM_START( dallas16 ) ROM_LOAD16_BYTE("dallas-l.bin",0x00001, 0x06f00,CRC(f0d5bc03) SHA1(4b1b9a71663d5321820b4cf7da205e5fe5d3d001)) ROM_END -// This set needs checking. It cannot possibly work with this rom and hardware. ROM_START( roma ) ROM_REGION16_BE( 0x1000000, "maincpu", 0 ) - ROM_LOAD("roma32.bin", 0x000000, 0x10000, CRC(587d03bf) SHA1(504e9ff958084700076d633f9c306fc7baf64ffd)) + ROM_LOAD16_BYTE("roma16-u.bin", 0x00000, 0x08000, CRC(111d030f) SHA1(e027f7e7018d28ab794e7730392506056809db6b)) + ROM_LOAD16_BYTE("roma16-l.bin", 0x00001, 0x08000, CRC(8245ddd2) SHA1(ab048b60fdc4358913a5d07b6fee863b66dd6734)) ROM_END ROM_START( dallas32 ) @@ -749,10 +405,10 @@ ROM_END ***************************************************************************/ /* YEAR, NAME, PARENT, COMPAT, MACHINE, INPUT, CLASS, INIT, COMPANY, FULLNAME, FLAGS */ -CONS( 1984, glasgow, 0, 0, glasgow, old_keyboard, glasgow_state, 0, "Hegener & Glaser Muenchen", "Mephisto III S Glasgow", 0) -CONS( 1984, amsterd, 0, 0, amsterd, new_keyboard, amsterd_state, 0, "Hegener & Glaser Muenchen", "Mephisto Amsterdam", MACHINE_NOT_WORKING) -CONS( 1984, dallas, glasgow, 0, glasgow, old_keyboard, glasgow_state, 0, "Hegener & Glaser Muenchen", "Mephisto Dallas", MACHINE_NOT_WORKING) -CONS( 1984, roma, amsterd, 0, glasgow, new_keyboard, glasgow_state, 0, "Hegener & Glaser Muenchen", "Mephisto Roma", MACHINE_NOT_WORKING) -CONS( 1984, dallas32, amsterd, 0, dallas32, new_keyboard, amsterd_state, 0, "Hegener & Glaser Muenchen", "Mephisto Dallas 32 Bit", MACHINE_NOT_WORKING) -CONS( 1984, roma32, amsterd, 0, dallas32, new_keyboard, amsterd_state, 0, "Hegener & Glaser Muenchen", "Mephisto Roma 32 Bit", MACHINE_NOT_WORKING) -CONS( 1984, dallas16, amsterd, 0, amsterd, new_keyboard, amsterd_state, 0, "Hegener & Glaser Muenchen", "Mephisto Dallas 16 Bit", MACHINE_NOT_WORKING) +CONS( 1984, glasgow, 0, 0, glasgow, old_keyboard, glasgow_state, 0, "Hegener & Glaser Muenchen", "Mephisto III S Glasgow", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1985, amsterd, 0, 0, amsterd, new_keyboard, amsterd_state, 0, "Hegener & Glaser Muenchen", "Mephisto Amsterdam", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1986, dallas, glasgow, 0, glasgow, old_keyboard, glasgow_state, 0, "Hegener & Glaser Muenchen", "Mephisto Dallas", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1986, dallas16, amsterd, 0, amsterd, new_keyboard, amsterd_state, 0, "Hegener & Glaser Muenchen", "Mephisto Dallas 16 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1986, dallas32, amsterd, 0, dallas32, new_keyboard, amsterd_state, 0, "Hegener & Glaser Muenchen", "Mephisto Dallas 32 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1987, roma, amsterd, 0, amsterd, new_keyboard, amsterd_state, 0, "Hegener & Glaser Muenchen", "Mephisto Roma", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1987, roma32, amsterd, 0, dallas32, new_keyboard, amsterd_state, 0, "Hegener & Glaser Muenchen", "Mephisto Roma 32 Bit", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/layout/glasgow.lay b/src/mame/layout/glasgow.lay index 53dd35a623c..a53d96a942e 100644 --- a/src/mame/layout/glasgow.lay +++ b/src/mame/layout/glasgow.lay @@ -6,39 +6,308 @@ - - - - + + + + - - - + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + + - + + + + + + + + + + + + + + + + -- cgit v1.2.3