amsterdam: remove tag lookup, remove local variable,

roma2: reorder address map, correct rom labels
This commit is contained in:
hap 2023-09-19 09:35:26 +02:00
parent 6130b026c1
commit 1d08263d67
4 changed files with 29 additions and 36 deletions

View File

@ -32,13 +32,14 @@ namespace {
class amsterdam_state : public driver_device class amsterdam_state : public driver_device
{ {
public: public:
amsterdam_state(const machine_config &mconfig, device_type type, const char *tag) amsterdam_state(const machine_config &mconfig, device_type type, const char *tag) :
: driver_device(mconfig, type, tag) driver_device(mconfig, type, tag),
, m_maincpu(*this, "maincpu") m_maincpu(*this, "maincpu"),
, m_board(*this, "board") m_board(*this, "board"),
, m_display(*this, "display") m_display(*this, "display"),
, m_dac(*this, "dac") m_dac(*this, "dac"),
, m_keys(*this, "KEY.%u", 0) m_keys(*this, "KEY.%u", 0),
m_reset(*this, "RESET")
{ } { }
DECLARE_INPUT_CHANGED_MEMBER(reset_button); DECLARE_INPUT_CHANGED_MEMBER(reset_button);
@ -46,15 +47,13 @@ public:
void amsterdam(machine_config &config); void amsterdam(machine_config &config);
void dallas32(machine_config &config); void dallas32(machine_config &config);
protected:
virtual void machine_start() override;
private: private:
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
required_device<mephisto_board_device> m_board; required_device<mephisto_board_device> m_board;
required_device<mephisto_display1_device> m_display; required_device<mephisto_display1_device> m_display;
required_device<dac_bit_interface> m_dac; required_device<dac_bit_interface> m_dac;
required_ioport_array<2> m_keys; required_ioport_array<2> m_keys;
required_ioport m_reset;
void amsterd_mem(address_map &map); void amsterd_mem(address_map &map);
void dallas32_mem(address_map &map); void dallas32_mem(address_map &map);
@ -62,19 +61,12 @@ private:
void led_w(offs_t offset, u8 data); void led_w(offs_t offset, u8 data);
void dac_w(u8 data); void dac_w(u8 data);
u8 keys_r(); u8 keys_r();
u8 m_kp_select = 0;
}; };
void amsterdam_state::machine_start()
{
save_item(NAME(m_kp_select));
}
INPUT_CHANGED_MEMBER(amsterdam_state::reset_button) INPUT_CHANGED_MEMBER(amsterdam_state::reset_button)
{ {
// RES buttons in serial tied to CPU RESET // RES buttons in serial tied to CPU RESET
if (ioport("RESET")->read() == 3) if (m_reset->read() == 3)
{ {
m_maincpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero); m_maincpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero);
m_display->reset(); m_display->reset();
@ -89,11 +81,11 @@ INPUT_CHANGED_MEMBER(amsterdam_state::reset_button)
void amsterdam_state::led_w(offs_t offset, u8 data) void amsterdam_state::led_w(offs_t offset, u8 data)
{ {
// d0-d7: board leds
m_board->led_w(data); m_board->led_w(data);
// lcd strobe is shared with keypad select // a8: lcd strobe
m_kp_select = offset >> 7; m_display->strobe_w(BIT(offset, 7));
m_display->strobe_w(m_kp_select);
} }
void amsterdam_state::dac_w(u8 data) void amsterdam_state::dac_w(u8 data)
@ -104,7 +96,8 @@ void amsterdam_state::dac_w(u8 data)
u8 amsterdam_state::keys_r() u8 amsterdam_state::keys_r()
{ {
return m_keys[m_kp_select & 1]->read(); // lcd strobe is shared with keypad select
return m_keys[m_display->strobe_r()]->read();
} }

View File

@ -52,13 +52,13 @@ namespace {
class glasgow_state : public driver_device class glasgow_state : public driver_device
{ {
public: public:
glasgow_state(const machine_config &mconfig, device_type type, const char *tag) glasgow_state(const machine_config &mconfig, device_type type, const char *tag) :
: driver_device(mconfig, type, tag) driver_device(mconfig, type, tag),
, m_maincpu(*this, "maincpu") m_maincpu(*this, "maincpu"),
, m_board(*this, "board") m_board(*this, "board"),
, m_display(*this, "display") m_display(*this, "display"),
, m_dac(*this, "dac") m_dac(*this, "dac"),
, m_keys(*this, "KEY.%u", 0) m_keys(*this, "KEY.%u", 0)
{ } { }
void glasgow(machine_config &config); void glasgow(machine_config &config);

View File

@ -21,6 +21,7 @@ public:
auto output_digit() { return m_output_digit.bind(); } auto output_digit() { return m_output_digit.bind(); }
void strobe_w(int state); void strobe_w(int state);
int strobe_r() { return m_strobe; }
void data_w(u8 data); void data_w(u8 data);
protected: protected:

View File

@ -13,7 +13,7 @@ Mephisto Montreal 68000 from 1993 is on similar hardware, but it is a standalone
chess computer (Roma II is a module). The chess engine is still the old 1987 Roma. chess computer (Roma II is a module). The chess engine is still the old 1987 Roma.
TODO: TODO:
- verify XTAL (currently guessed from beeper pitch on videos) - verify montreal XTAL (currently guessed from beeper pitch on video)
- verify irq source and level - verify irq source and level
- does it have DTACK waitstates? - does it have DTACK waitstates?
@ -89,11 +89,10 @@ INPUT_CHANGED_MEMBER(roma2_state::reset_button)
u8 roma2_state::input_r() u8 roma2_state::input_r()
{ {
u8 data = 0; u8 data = 0;
u8 inp_mux = m_outlatch->output_state() & 0xf;
// read keypad // read keypad
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
if (!BIT(inp_mux, i)) if (!BIT(m_outlatch->output_state(), i))
data |= m_inputs[i]->read(); data |= m_inputs[i]->read();
return data; return data;
@ -108,13 +107,13 @@ u8 roma2_state::input_r()
void roma2_state::main_map(address_map &map) void roma2_state::main_map(address_map &map)
{ {
map(0x000000, 0x00ffff).rom(); map(0x000000, 0x00ffff).rom();
map(0x800000, 0x803fff).ram();
map(0x900000, 0x90000f).w(m_outlatch, FUNC(hc259_device::write_d0)).umask16(0xff00); map(0x900000, 0x90000f).w(m_outlatch, FUNC(hc259_device::write_d0)).umask16(0xff00);
map(0xc00000, 0xc00000).w(m_board, FUNC(mephisto_board_device::mux_w));
map(0xb00000, 0xb00000).w(m_board, FUNC(mephisto_board_device::led_w)); map(0xb00000, 0xb00000).w(m_board, FUNC(mephisto_board_device::led_w));
map(0xc00000, 0xc00000).w(m_board, FUNC(mephisto_board_device::mux_w));
map(0xd00000, 0xd00000).r(m_board, FUNC(mephisto_board_device::input_r)); map(0xd00000, 0xd00000).r(m_board, FUNC(mephisto_board_device::input_r));
map(0xd00001, 0xd00001).r(FUNC(roma2_state::input_r)); map(0xd00001, 0xd00001).r(FUNC(roma2_state::input_r));
map(0xe00000, 0xe00000).w(m_display, FUNC(mephisto_display1_device::data_w)); map(0xe00000, 0xe00000).w(m_display, FUNC(mephisto_display1_device::data_w));
map(0x800000, 0x803fff).ram();
map(0x900000, 0x900009).nopr(); // st map(0x900000, 0x900009).nopr(); // st
map(0xc00000, 0xc00001).nopr(); // st map(0xc00000, 0xc00001).nopr(); // st
@ -220,8 +219,8 @@ void roma2_state::montreal(machine_config &config)
ROM_START( roma2 ) ROM_START( roma2 )
ROM_REGION16_BE( 0x10000, "maincpu", 0 ) ROM_REGION16_BE( 0x10000, "maincpu", 0 )
ROM_LOAD16_BYTE("roma2_u_v4.02", 0x00000, 0x08000, CRC(89e95f5f) SHA1(6c3992f35fba2c1cc08a93f50aa991d5ffda5bc3) ) ROM_LOAD16_BYTE("roma_ii_u_ver.4.02", 0x00000, 0x08000, CRC(89e95f5f) SHA1(6c3992f35fba2c1cc08a93f50aa991d5ffda5bc3) )
ROM_LOAD16_BYTE("roma2_l_v4.02", 0x00001, 0x08000, CRC(74b03889) SHA1(9d2a09b93f3b2dc483b4f30db134f83deb3aa951) ) ROM_LOAD16_BYTE("roma_ii_l_ver.4.02", 0x00001, 0x08000, CRC(74b03889) SHA1(9d2a09b93f3b2dc483b4f30db134f83deb3aa951) )
ROM_END ROM_END
ROM_START( montreal ) ROM_START( montreal )