summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Sallafranque <laurent.sallafranque@free.fr>2012-02-28 21:30:53 (GMT)
committerLaurent Sallafranque <laurent.sallafranque@free.fr>2012-02-28 21:30:53 (GMT)
commit27f598b280618b6f1bcf5ca1d264799823d0f2de (patch)
tree5c826eb3dab80bdc9a22f9c0c543979ca56b269f
parentd9c59f67866bdc8552fc59087245d8534fbf1022 (diff)
downloadhatari-27f598b280618b6.zip
hatari-27f598b280618b6.tar.gz
added register $ff820a to Videl.
-rw-r--r--src/falcon/videl.c27
-rw-r--r--src/falcon/videl.h1
-rw-r--r--src/ioMemTabFalcon.c2
3 files changed, 28 insertions, 2 deletions
diff --git a/src/falcon/videl.c b/src/falcon/videl.c
index a45a0f2..016b372 100644
--- a/src/falcon/videl.c
+++ b/src/falcon/videl.c
@@ -130,7 +130,7 @@ void VIDEL_reset(void)
{
videl.bUseSTShifter = false; /* Use Falcon color palette by default */
videl.reg_ffff8006_save = IoMem_ReadByte(0xff8006);
- videl.monitor_type = videl.reg_ffff8006_save & 0xc0;
+ videl.monitor_type = videl.reg_ffff8006_save & 0xc0;
videl.hostColorsSync = false;
@@ -153,6 +153,9 @@ 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 synch mode register */
+ VIDEL_SyncMode_WriteByte();
}
/**
@@ -186,6 +189,28 @@ 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 ]
+ */
+void VIDEL_SyncMode_WriteByte(void)
+{
+ Uint8 syncMode = IoMem_ReadByte(0xff820a);
+
+ LOG_TRACE(TRACE_VIDEL, "Videl : $ffff820a Sync Mode write: 0x%02x\n", syncMode);
+
+ if (videl.monitor_type == FALCON_MONITOR_MONO)
+ syncMode &= 0xfd;
+ else
+ syncMode |= 0x2;
+
+ IoMem_WriteByte(0xff820a, syncMode);
+}
+
+/**
* Write to video address base high, med and low register (0xff8201/03/0d).
* On Falcon, when a program writes to high or med registers, base low register
* is reset to zero.
diff --git a/src/falcon/videl.h b/src/falcon/videl.h
index c0748b1..c066ca2 100644
--- a/src/falcon/videl.h
+++ b/src/falcon/videl.h
@@ -21,6 +21,7 @@ extern void VIDEL_ConvertScreenZoom(int vw, int vh, int bpp, int nextline);
/* Called from ioMemTabFalcon.c */
extern void VIDEL_Monitor_WriteByte(void);
+extern void VIDEL_SyncMode_WriteByte(void);
extern void VIDEL_ScreenBase_WriteByte(void);
extern void VIDEL_ColorRegsWrite(void);
extern void VIDEL_ST_ShiftModeWriteByte(void);
diff --git a/src/ioMemTabFalcon.c b/src/ioMemTabFalcon.c
index e50b03a..e4ed777 100644
--- a/src/ioMemTabFalcon.c
+++ b/src/ioMemTabFalcon.c
@@ -152,7 +152,7 @@ const INTERCEPT_ACCESS_FUNC IoMemTable_Falcon[] =
{ 0xff8207, SIZE_BYTE, Video_ScreenCounter_ReadByte, Video_ScreenCounter_WriteByte },
{ 0xff8208, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite }, /* No bus error here */
{ 0xff8209, SIZE_BYTE, Video_ScreenCounter_ReadByte, Video_ScreenCounter_WriteByte },
- { 0xff820a, SIZE_BYTE, Video_Sync_ReadByte, Video_Sync_WriteByte },
+ { 0xff820a, SIZE_BYTE, IoMem_ReadWithoutInterception, VIDEL_SyncMode_WriteByte }, /* VIDEL Synch mode */
{ 0xff820b, SIZE_BYTE, IoMem_VoidRead_00, IoMem_VoidWrite }, /* No bus error here : return 0 not ff */
{ 0xff820c, SIZE_BYTE, IoMem_VoidRead_00, IoMem_VoidWrite }, /* No bus error here : return 0 not ff */
{ 0xff820d, SIZE_BYTE, Video_BaseLow_ReadByte, VIDEL_ScreenBase_WriteByte }, /* Video base low byte */