comparison lc8951.c @ 2265:5c28534e6e09

Fix regression in Thunderhawk
author Michael Pavone <pavone@retrodev.com>
date Fri, 23 Dec 2022 15:07:06 -0800
parents 8e6fb2c06024
children 9ead0fe69d9b
comparison
equal deleted inserted replaced
2264:c7781cc950e9 2265:5c28534e6e09
313 lc8951_run(context, cycle); 313 lc8951_run(context, cycle);
314 uint16_t current_write_addr = context->regs[WAL] | (context->regs[WAH] << 8); 314 uint16_t current_write_addr = context->regs[WAL] | (context->regs[WAH] << 8);
315 315
316 uint8_t sync_detected = 0, sync_ignored = 0; 316 uint8_t sync_detected = 0, sync_ignored = 0;
317 if (byte == 0) { 317 if (byte == 0) {
318 if (context->sync_counter == 11 && ((sector_offset & 3) == 3)) { 318 // HACK!: The (sector_offset < 0x10) check is not correct, but without it Thunderhawk gets stuck
319 // It has a sector that contains the sync pattern in the main data area
320 // From the LC8951 datasheet, I would expect tohis to trigger a short block, but either
321 // it's sync detection is fancier than I thought or I have a bug that is confusing the BIOS
322 if (context->sync_counter == 11 && ((sector_offset & 3) == 3) && (sector_offset < 0x10)) {
319 if (context->ctrl1 & BIT_SYDEN) { 323 if (context->ctrl1 & BIT_SYDEN) {
320 sync_detected = 1; 324 sync_detected = 1;
321 } else { 325 } else {
322 sync_ignored = 1; 326 sync_ignored = 1;
323 } 327 }