segac2: change segac2_tfrceacjpb set_ignore_read_direction to a bit more logical set_ddr_override mask, port D works ok now (nw)

This commit is contained in:
hap 2020-03-21 21:15:40 +01:00
parent f7b9064893
commit 21ede04ecd
4 changed files with 11 additions and 9 deletions

View File

@ -16,7 +16,8 @@ Supremo also had a "limited edition" rerelease in 1990, plastic is fake-wood
instead of black, otherwise it's the same game.
TODO:
- does not work, most likely due to incomplete cpu emulation (unemulated timer registers)
- does not work, most likely due to incomplete cpu emulation (unemulated timer registers),
could also be a bad rom dump on top of that
- is 1988 version the same ROM?
******************************************************************************/

View File

@ -1661,14 +1661,15 @@ void segac2_state::segac2(machine_config &config)
void segac2_state::segac2_tfrceacjpb(machine_config& config)
{
segac2(config);
m_io->set_ignore_read_direction();
m_io->set_ddr_override(0xf); // game erroneously writes 0x58 to DDR
}
// Ribbit does random measure of UPD7759 sample #A playback time and reset to round 1 if its not in expected range (see routine @1D8D2)
// current UPD code is too fast, add slight delay
void segac2_state::segac2_ribbit(machine_config& config)
{
segac2(config);
// Ribbit does random measure of UPD7759 sample #A playback time and reset to round 1 if it's not in expected range (see routine @1D8D2)
// current UPD code is too fast, add slight delay
m_upd7759->set_start_delay(250);
}

View File

@ -37,7 +37,7 @@ sega_315_5296_device::sega_315_5296_device(const machine_config &mconfig, const
m_in_port_cb(*this),
m_out_port_cb(*this),
m_out_cnt_cb(*this),
m_ignore_read_direction(false)
m_dir_override(0xff)
{
}
@ -56,6 +56,7 @@ void sega_315_5296_device::device_start()
save_item(NAME(m_output_latch));
save_item(NAME(m_cnt));
save_item(NAME(m_dir));
save_item(NAME(m_dir_override));
}
//-------------------------------------------------
@ -89,7 +90,7 @@ READ8_MEMBER( sega_315_5296_device::read )
// port A to H
case 0x0: case 0x1: case 0x2: case 0x3: case 0x4: case 0x5: case 0x6: case 0x7:
// if the port is configured as an output, return the last thing written
if ((m_dir & 1 << offset) && (m_ignore_read_direction == false))
if (m_dir & m_dir_override & 1 << offset)
return m_output_latch[offset];
// otherwise, return an input port

View File

@ -47,7 +47,7 @@ public:
auto out_cnt1_callback() { return m_out_cnt_cb[1].bind(); }
auto out_cnt2_callback() { return m_out_cnt_cb[2].bind(); }
void set_ignore_read_direction() { m_ignore_read_direction = true; }
void set_ddr_override(uint8_t mask) { m_dir_override = mask; }
DECLARE_READ8_MEMBER(read);
DECLARE_WRITE8_MEMBER(write);
@ -67,8 +67,7 @@ private:
uint8_t m_output_latch[8];
uint8_t m_cnt;
uint8_t m_dir;
bool m_ignore_read_direction;
uint8_t m_dir_override;
};
// device type definition