From 091c3814d83383d4ecfaeaaa67c45217b5bac49c Mon Sep 17 00:00:00 2001 From: smf- Date: Sun, 28 Dec 2008 15:33:50 +0000 Subject: [PATCH] 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. --- src/emu/machine/at28c16.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/emu/machine/at28c16.c b/src/emu/machine/at28c16.c index c8dada83fd1..809f96cef79 100644 --- a/src/emu/machine/at28c16.c +++ b/src/emu/machine/at28c16.c @@ -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 ); + } } }