A write isn't allowed to start if there is one in progress and a write isn't started if the data is already correct. This allows my dream horse to boot again. Further investigation is needed.

This commit is contained in:
smf- 2008-12-28 15:33:50 +00:00
parent d0a5273861
commit 091c3814d8

View File

@ -55,24 +55,33 @@ WRITE8_DEVICE_HANDLER( at28c16_w )
else if( c->oe_12v )
{
// logerror( "%s: at28c16_write( %d, %04x, %02x ) erase\n", cpuexec_describe_context(machine), chip, offset, data );
memset( c->data, 0xff, SIZE_DATA );
memset( c->id, 0xff, SIZE_ID );
c->last_write = 0xff;
timer_adjust_oneshot( c->write_timer, ATTOTIME_IN_USEC( 200 ), 0 );
if( c->last_write < 0 )
{
memset( c->data, 0xff, SIZE_DATA );
memset( c->id, 0xff, SIZE_ID );
c->last_write = 0xff;
timer_adjust_oneshot( c->write_timer, ATTOTIME_IN_USEC( 200 ), 0 );
}
}
else if( offset >= OFFSET_ID && c->a9_12v )
{
// logerror( "%s: at28c16_write( %d, %04x, %02x ) id\n", cpuexec_describe_context(machine), chip, offset, data );
c->id[ offset - OFFSET_ID ] = data;
c->last_write = data;
timer_adjust_oneshot( c->write_timer, ATTOTIME_IN_USEC( 200 ), 0 );
if( c->last_write < 0 && c->id[ offset - OFFSET_ID ] != data )
{
c->id[ offset - OFFSET_ID ] = data;
c->last_write = data;
timer_adjust_oneshot( c->write_timer, ATTOTIME_IN_USEC( 200 ), 0 );
}
}
else
{
// logerror( "%s: at28c16_write( %d, %04x, %02x ) data\n", cpuexec_describe_context(machine), chip, offset, data );
c->data[ offset ] = data;
c->last_write = data;
timer_adjust_oneshot( c->write_timer, ATTOTIME_IN_USEC( 200 ), 0 );
if( c->last_write < 0 && c->data[ offset ] != data )
{
c->data[ offset ] = data;
c->last_write = data;
timer_adjust_oneshot( c->write_timer, ATTOTIME_IN_USEC( 200 ), 0 );
}
}
}