mirror of
https://github.com/holub/mame
synced 2025-04-22 16:31:49 +03:00
ti99_2: Removed instability in Load/save to Hexbus floppy.
This commit is contained in:
parent
7ad87969bd
commit
2edee35ac3
@ -415,6 +415,15 @@ uint8_t hexbus_chained_device::to_line_state(uint8_t data, bool bav, bool hsk)
|
||||
return lines;
|
||||
}
|
||||
|
||||
/*
|
||||
Convenience function to get a data bit.
|
||||
*/
|
||||
int hexbus_chained_device::data_bit(int n)
|
||||
{
|
||||
const uint8_t testbit[4] = { 0x01, 0x02, 0x40, 0x80 };
|
||||
return (m_current_bus_value & testbit[n&3])? 1:0;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
} } // end namespace bus::hexbus
|
||||
|
@ -127,6 +127,9 @@ protected:
|
||||
|
||||
// Data lines
|
||||
static int data_lines(uint8_t lines) { return (((lines & 0xc0) >> 4) | (lines & 0x03)); }
|
||||
|
||||
// Return the selected data bit (0-3)
|
||||
int data_bit(int n);
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
@ -355,7 +355,8 @@ io992_device::io992_device(const machine_config &mconfig, device_type type, cons
|
||||
m_videoctrl(*this, "^" TI992_VDC_TAG),
|
||||
m_keyboard(*this, "LINE%u", 0U),
|
||||
m_set_rom_bank(*this),
|
||||
m_key_row(0)
|
||||
m_key_row(0),
|
||||
m_hsk_released(true)
|
||||
{
|
||||
}
|
||||
|
||||
@ -473,14 +474,16 @@ uint8_t io992_device::cruread(offs_t offset)
|
||||
case 0xe802:
|
||||
case 0xe804:
|
||||
case 0xe806:
|
||||
return data_bit(offset&3);
|
||||
case 0xe808:
|
||||
return (bus_hsk_level()==ASSERT_LINE)? 0:1;
|
||||
case 0xe80a:
|
||||
return ((m_current_bus_value & m_hexbval[offset&7])==0)? 0:1;
|
||||
return (bus_bav_level()==ASSERT_LINE)? 0:1;
|
||||
|
||||
case 0xe80c:
|
||||
// e80c (bit 6) seems to indicate that the HSK* line has been released
|
||||
// own HSK*=1 and HSK*=0 on the bus
|
||||
return ((own_hsk_level()==CLEAR_LINE) && (bus_hsk_level()==ASSERT_LINE))? 0:1;
|
||||
// and is now asserted again
|
||||
return (m_hsk_released && (bus_hsk_level()==ASSERT_LINE))? 1:0;
|
||||
|
||||
case 0xe80e:
|
||||
inp = m_cassette->input();
|
||||
@ -499,8 +502,6 @@ void io992_device::cruwrite(offs_t offset, uint8_t data)
|
||||
|
||||
LOGMASKED(LOG_CRU, "CRU %04x <- %1x\n", address, data);
|
||||
|
||||
// uint8_t olddata = m_latch_out;
|
||||
|
||||
switch (address)
|
||||
{
|
||||
// Select the current keyboard row. Also, bit 0 is used to switch the
|
||||
@ -544,6 +545,7 @@ void io992_device::cruwrite(offs_t offset, uint8_t data)
|
||||
|
||||
case 0xe808: // HSK
|
||||
set_hsk_line(data!=0? CLEAR_LINE : ASSERT_LINE);
|
||||
m_hsk_released = (bus_hsk_level()==CLEAR_LINE);
|
||||
break;
|
||||
|
||||
case 0xe80c:
|
||||
@ -581,6 +583,11 @@ void io992_device::hexbus_value_changed(uint8_t data)
|
||||
LOGMASKED(LOG_HEXBUS, "Latching HSK*; got data %01x\n", (data>>4)|(data&3));
|
||||
latch_hsk();
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGMASKED(LOG_HEXBUS, "HSK* released\n");
|
||||
m_hsk_released = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
LOGMASKED(LOG_HEXBUS, "Ignoring Hexbus change (to %02x), BAV*=%d\n", data, (own_bav_level()==ASSERT_LINE)? 0:1);
|
||||
|
@ -116,8 +116,6 @@ protected:
|
||||
void hexbus_value_changed(uint8_t data) override;
|
||||
|
||||
private:
|
||||
const uint8_t m_hexbval[6] = { 0x01, 0x02, 0x40, 0x80, 0x10, 0x04 };
|
||||
|
||||
required_device<hexbus::hexbus_device> m_hexbus;
|
||||
required_device<cassette_image_device> m_cassette;
|
||||
required_device<video992_device> m_videoctrl;
|
||||
@ -128,6 +126,9 @@ private:
|
||||
|
||||
// Keyboard row
|
||||
int m_key_row;
|
||||
|
||||
// HSK* released flag. This is queried as CRU bit 6 (with the current HSK* level).
|
||||
bool m_hsk_released;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user