diff --git a/src/mame/drivers/saitek_corona.cpp b/src/mame/drivers/saitek_corona.cpp index 2c7c6118fb6..a0316d64edf 100644 --- a/src/mame/drivers/saitek_corona.cpp +++ b/src/mame/drivers/saitek_corona.cpp @@ -227,7 +227,7 @@ void corona_state::main_map(address_map &map) map(0x2400, 0x2400).rw(FUNC(corona_state::chessboard_r), FUNC(corona_state::leds1_w)); map(0x2600, 0x2600).rw(FUNC(corona_state::control1_r), FUNC(corona_state::control1_w)); map(0x6000, 0x6000).w(FUNC(corona_state::select2_w)); - map(0x6200, 0x6200).w(FUNC(corona_state::lcd_reset_w)); + map(0x6200, 0x6200).unmapw(); // ? map(0x6400, 0x6400).w(FUNC(corona_state::leds2_w)); map(0x6600, 0x6600).rw(FUNC(corona_state::control2_r), FUNC(corona_state::control2_w)); map(0x8000, 0xffff).m(m_rombank, FUNC(address_map_bank_device::amap8)); diff --git a/src/mame/drivers/saitek_stratos.cpp b/src/mame/drivers/saitek_stratos.cpp index a0b08af41bd..1aa4b3f82b9 100644 --- a/src/mame/drivers/saitek_stratos.cpp +++ b/src/mame/drivers/saitek_stratos.cpp @@ -42,6 +42,8 @@ very few bytes difference between revisions. The first Corona is engine version TODO: - emulate LCD at lower level, probably an MCU with embedded LCDC +- LCD status bit handling is guessed. stratos expects it to be high after lcd command 0xf, + but tking(D) won't work if it's done that way - fix LCD 7*7 DMD, it's in m_lcd_data[0x30 to 0x3b] but scrambled - tking different internal artwork - irq timing is derived from the main XTAL, but result should be similar with 5MHz and 5.67MHz, @@ -81,6 +83,8 @@ public: m_inputs(*this, "IN.%u", 0) { } + int lcd_ready_r() { return m_lcd_ready ? 1 : 0; } + // machine drivers void stratos(machine_config &config); void tking2(machine_config &config); @@ -96,7 +100,7 @@ private: required_memory_bank m_nvrambank; required_device m_board; required_device m_dac; - required_ioport_array<8+1> m_inputs; + required_ioport_array<8+2> m_inputs; void main_map(address_map &map); @@ -130,13 +134,13 @@ void saitek_stratos_state::machine_start() m_power = false; m_lcd_ready = false; m_lcd_count = 0; - m_lcd_address = 0; + m_lcd_command = 0; // register for savestates save_item(NAME(m_power)); save_item(NAME(m_lcd_ready)); save_item(NAME(m_lcd_count)); - save_item(NAME(m_lcd_address)); + save_item(NAME(m_lcd_command)); save_item(NAME(m_lcd_data)); } @@ -273,18 +277,22 @@ void saitek_stratos_state::lcd_data_w(u8 data) data &= 0xf; if (m_lcd_count == 0) - m_lcd_address = data; + m_lcd_command = data; else { // write to lcd row - if (m_lcd_address > 0 && m_lcd_address <= 4) - m_lcd_data[(((m_lcd_address - 1) << 4) + (m_lcd_count - 1)) & 0x3f] = data; + if (m_lcd_command > 0 && m_lcd_command <= 4) + m_lcd_data[(((m_lcd_command - 1) << 4) + (m_lcd_count - 1)) & 0x3f] = data; } // it expects a specific number of writes for each row - const u8 maxcount[5] = { 1, 9, 9, 1, 12 }; - if (m_lcd_address > 4 || m_lcd_count == maxcount[m_lcd_address]) + const u8 maxcount[5] = { 0, 9, 9, 1, 12 }; + if (m_lcd_command > 4 || m_lcd_count == maxcount[m_lcd_command]) { + // reset/start? + if (m_lcd_command & 8) + m_lcd_ready = true; + m_lcd_count = 0; update_lcd(); } @@ -292,12 +300,6 @@ void saitek_stratos_state::lcd_data_w(u8 data) m_lcd_count++; } -void saitek_stratos_state::lcd_reset_w(u8 data) -{ - m_lcd_count = 0; - m_lcd_ready = true; -} - // HELIOS @@ -342,12 +344,10 @@ READ8_MEMBER(stratos_state::control_r) if (sel == 8) { // d5: lcd status flag? - if (m_lcd_ready) - { - data |= 0x20; - if (!machine().side_effects_disabled()) - m_lcd_ready = false; - } + data |= m_inputs[9]->read(); + + if (!machine().side_effects_disabled()) + m_lcd_ready = false; // d7: battery low data |= m_inputs[8]->read(); @@ -380,15 +380,6 @@ WRITE8_MEMBER(stratos_state::control_w) power_off(); } -READ8_MEMBER(stratos_state::lcd_data_r) -{ - // reset lcd? - if (!machine().side_effects_disabled()) - lcd_reset_w(); - - return 0; -} - /****************************************************************************** @@ -403,7 +394,7 @@ void stratos_state::main_map(address_map &map) map(0x2400, 0x2400).w(FUNC(stratos_state::leds_w)); map(0x2600, 0x2600).rw(FUNC(stratos_state::control_r), FUNC(stratos_state::control_w)); map(0x2800, 0x37ff).bankrw("nvrambank"); - map(0x3800, 0x3800).rw(FUNC(stratos_state::lcd_data_r), FUNC(stratos_state::lcd_data_w)); + map(0x3800, 0x3800).w(FUNC(stratos_state::lcd_data_w)); map(0x4000, 0x7fff).r(FUNC(stratos_state::extrom_r)); map(0x8000, 0xffff).bankr("rombank"); } @@ -476,6 +467,9 @@ static INPUT_PORTS_START( stratos ) PORT_MODIFY("IN.6") PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_CUSTOM) + + PORT_START("IN.9") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_READ_LINE_DEVICE_MEMBER(DEVICE_SELF, stratos_state, lcd_ready_r) INPUT_PORTS_END static INPUT_PORTS_START( tking2 ) @@ -483,6 +477,9 @@ static INPUT_PORTS_START( tking2 ) PORT_MODIFY("IN.5") PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_CUSTOM) + + PORT_MODIFY("IN.9") + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_CUSTOM) INPUT_PORTS_END diff --git a/src/mame/includes/saitek_stratos.h b/src/mame/includes/saitek_stratos.h index 7cb55bc9d85..37748a506d7 100644 --- a/src/mame/includes/saitek_stratos.h +++ b/src/mame/includes/saitek_stratos.h @@ -56,12 +56,11 @@ protected: DECLARE_DEVICE_IMAGE_LOAD_MEMBER(extrom_load); void lcd_data_w(u8 data); - void lcd_reset_w(u8 data = 0); bool m_power; bool m_lcd_ready; u8 m_lcd_count; - u8 m_lcd_address; + u8 m_lcd_command; u8 m_lcd_data[0x40]; }; diff --git a/src/mame/layout/debutm.lay b/src/mame/layout/debutm.lay index bcabfdeaddb..f6e9c091012 100644 --- a/src/mame/layout/debutm.lay +++ b/src/mame/layout/debutm.lay @@ -469,10 +469,10 @@ - - - - + + + +