mirror of
https://github.com/holub/mame
synced 2025-10-06 17:08:28 +03:00
(MESS) abc80: Fixed cassette crash. (nw)
This commit is contained in:
parent
f0979b157d
commit
93e0b86024
@ -333,15 +333,15 @@ WRITE8_MEMBER( abc80_state::pio_pb_w )
|
||||
// cassette motor
|
||||
if (BIT(data, 5))
|
||||
{
|
||||
if (!m_cassette_timer->enabled()) if (LOG) logerror("%s %s started cassette motor\n", machine().time().as_string(), machine().describe_context());
|
||||
if (!m_motor) if (LOG) logerror("%s %s started cassette motor\n", machine().time().as_string(), machine().describe_context());
|
||||
m_cassette->change_state(CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
|
||||
m_cassette_timer->enable(true);
|
||||
m_motor = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_cassette_timer->enabled()) if (LOG) logerror("%s %s stopped cassette motor\n", machine().time().as_string(), machine().describe_context());
|
||||
if (m_motor) if (LOG) logerror("%s %s stopped cassette motor\n", machine().time().as_string(), machine().describe_context());
|
||||
m_cassette->change_state(CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
|
||||
m_cassette_timer->enable(false);
|
||||
m_motor = false;
|
||||
}
|
||||
|
||||
// cassette data
|
||||
@ -420,6 +420,8 @@ void abc80_state::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
|
||||
case TIMER_ID_CASSETTE:
|
||||
{
|
||||
if (!m_motor) return;
|
||||
|
||||
int tape_in = m_cassette->input() > 0;
|
||||
|
||||
if (m_tape_in != tape_in)
|
||||
@ -469,7 +471,6 @@ void abc80_state::machine_start()
|
||||
// start timers
|
||||
m_cassette_timer = timer_alloc(TIMER_ID_CASSETTE);
|
||||
m_cassette_timer->adjust(attotime::from_hz(44100), 0, attotime::from_hz(44100));
|
||||
m_cassette_timer->enable(false);
|
||||
|
||||
// register for state saving
|
||||
save_item(NAME(m_key_data));
|
||||
|
@ -84,6 +84,7 @@ public:
|
||||
m_line_prom(*this, "line"),
|
||||
m_attr_prom(*this, "attr"),
|
||||
m_video_ram(*this, "video_ram"),
|
||||
m_motor(false),
|
||||
m_tape_in(1),
|
||||
m_tape_in_latch(1)
|
||||
{ }
|
||||
@ -164,6 +165,7 @@ public:
|
||||
int m_blink;
|
||||
|
||||
// cassette state
|
||||
bool m_motor;
|
||||
int m_tape_in;
|
||||
int m_tape_in_latch;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user