Re: [hatari-devel] VDI resolution limits

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


...

and the attached patch should fix it again.  The font selection was not 
affected.

--- src/tos.c	2018-05-06 14:30:00.133129643 +0200
+++ src/tos.c.new	2018-05-06 14:32:12.225126768 +0200
@@ -51,6 +51,8 @@
 unsigned int ConnectedDriveMask = 0x00; /* Bit mask of connected drives, eg 0x7 is A,B,C */
 int nNumDrives = 2;                     /* Number of drives, default is 2 for A: and B: - Strictly, this is the highest mapped drive letter, in-between drives may not be allocated */
 
+static Uint32 logopatch_addr;
+
 /* Possible TOS file extensions to scan for */
 static const char * const pszTosNameExts[] =
 {
@@ -318,7 +320,6 @@
 	int nGoodPatches, nBadPatches;
 	short TosCountry;
 	const TOS_PATCH *pPatch;
-	Uint32 logopatch_addr = 0;
 
 	/* We can't patch RAM TOS images (yet) */
 	if (bRamTosImage && TosVersion != 0x0492)
@@ -380,13 +381,6 @@
 		pPatch += 1;
 	}
 
-	/* patch some values into the "Draw logo" patch */
-	if (logopatch_addr != 0)
-	{
-		STMemory_WriteWord(logopatch_addr + 2, VDIPlanes);
-		STMemory_WriteLong(logopatch_addr + 6, VDIWidth * VDIPlanes / 8);
-	}
-
 	Log_Printf(LOG_DEBUG, "Applied %i TOS patches, %i patches failed.\n",
 	           nGoodPatches, nBadPatches);
 }
@@ -780,6 +774,7 @@
 		bUseVDIRes = ConfigureParams.Screen.bUseExtVdiResolutions = false;
 	}
 
+	logopatch_addr = 0;
 	/* Fix TOS image, modify code for emulation */
 	if (ConfigureParams.Rom.bPatchTos && !bIsEmuTOS && bUseTos)
 	{
@@ -797,6 +792,16 @@
 			  ConfigureParams.Screen.nVdiWidth,
 			  ConfigureParams.Screen.nVdiHeight);
 
+	/*
+         * patch some values into the "Draw logo" patch.
+	 * Needs to be called after final VDI resolution has been determined.
+	 */
+	if (logopatch_addr != 0)
+	{
+		STMemory_WriteWord(logopatch_addr + 2, VDIPlanes);
+		STMemory_WriteLong(logopatch_addr + 6, VDIWidth * VDIPlanes / 8);
+	}
+
 	/* Set connected devices, memory configuration, etc. */
 	STMemory_SetDefaultConfig();
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/