changeset 2265:5c28534e6e09

Fix regression in Thunderhawk
author Michael Pavone <pavone@retrodev.com>
date Fri, 23 Dec 2022 15:07:06 -0800
parents c7781cc950e9
children 5083bc84fd84
files lc8951.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lc8951.c	Fri Dec 23 09:37:25 2022 -0800
+++ b/lc8951.c	Fri Dec 23 15:07:06 2022 -0800
@@ -315,7 +315,11 @@
 
 	uint8_t sync_detected = 0, sync_ignored = 0;
 	if (byte == 0) {
-		if (context->sync_counter == 11 && ((sector_offset & 3) == 3)) {
+		// HACK!: The (sector_offset < 0x10) check is not correct, but without it Thunderhawk gets stuck
+		// It has a sector that contains the sync pattern in the main data area
+		// From the LC8951 datasheet, I would expect tohis to trigger a short block, but either
+		// it's sync detection is fancier than I thought or I have a bug that is confusing the BIOS
+		if (context->sync_counter == 11 && ((sector_offset & 3) == 3) && (sector_offset < 0x10)) {
 			if (context->ctrl1 & BIT_SYDEN) {
 				sync_detected = 1;
 			} else {