summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Huth <huth@tuxfamily.org>2023-11-19 16:56:52 (GMT)
committerThomas Huth <huth@tuxfamily.org>2023-11-19 16:56:52 (GMT)
commit96d7e168b8a79d9c0add5308e17ad89e952b1071 (patch)
tree19d337b9c94fa562700148e8b8a3890fcf259fdf
parent164455943353eeb48bf2ff2d26b8455dad27762c (diff)
downloadhatari-96d7e168b8a79d9c0add5308e17ad89e952b1071.zip
hatari-96d7e168b8a79d9c0add5308e17ad89e952b1071.tar.gz
The content of Videl register FF820A should not depend on the monitor type
Falcon TOS definitely writes bit 1 according to the selection of PAL or NTSC in the VSetMode() XBIOS call, and Roger Burrows confirmed that the lowest two bit can indeed be changed by writing to the register on a real Falcon (thanks a lot to him for testing!), so the assumption that bit 1 is a read-only flag for color or mono monitor is certainly wrong.
-rw-r--r--src/falcon/videl.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/falcon/videl.c b/src/falcon/videl.c
index 27d3461..300827c 100644
--- a/src/falcon/videl.c
+++ b/src/falcon/videl.c
@@ -141,9 +141,6 @@ void VIDEL_reset(void)
/* Reset IO register (some are not initialized by TOS) */
IoMem_WriteWord(0xff820e, 0); /* Line offset */
IoMem_WriteWord(0xff8264, 0); /* Horizontal scroll */
-
- /* Init sync mode register */
- VIDEL_SyncMode_WriteByte();
}
/**
@@ -185,22 +182,19 @@ void VIDEL_Monitor_WriteByte(void)
}
/**
- * VIDEL_SyncMode_WriteByte : Videl synchronization mode.
- * $FFFF820A [R/W] _______0 .................................. SYNC-MODE
- ||
- |+--Synchronisation [ 0:internal / 1:external ]
- +---Vertical frequency [ Read-only bit ]
- [ Monochrome monitor:0 / Colour monitor:1 ]
+ * VIDEL_SyncMode_WriteByte:
+ * Videl synchronization mode. Bit 1 is used by TOS 4.04 to set either 50 Hz
+ * (bit set) or 60 Hz (bit cleared).
+ * Note: There are documentation files out there that claim that bit 1 is
+ * used to distinguish between monochrome or color monitor, but these are
+ * definitely wrong.
*/
void VIDEL_SyncMode_WriteByte(void)
{
Uint8 syncMode = IoMem_ReadByte(0xff820a);
LOG_TRACE(TRACE_VIDEL, "Videl : $ff820a Sync Mode write: 0x%02x\n", syncMode);
- if (videl.monitor_type == FALCON_MONITOR_MONO)
- syncMode &= 0xfd;
- else
- syncMode |= 0x2;
+ syncMode &= 0x03; /* Upper bits are hard-wired to 0 */
IoMem_WriteByte(0xff820a, syncMode);
}