Re: [hatari-devel] Valid memory amount?

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


Hi,

On 11/17/20 9:58 AM, Thomas Huth wrote:
Am Wed, 11 Nov 2020 01:12:52 +0200
schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:
While testing with TOS boot checker, I noticed
that Hatari has earlier allowed 6MB and 12MB of
RAM to be specified, but doesn't anymore.

The check for the current sizes is basically in place since 2016, see
commit 8defb76044b9124481d18d.

Looking at the code, memory banks seem to be set only up to 4MB, and rest seems to have been due to
Falcon memory amount register settings.

(Until I found out that TT & MegaSTE supported up
to 10MB and added that back as Hatari supported
memory amount in commit f8a389115.)



Is it so that these memory configurations aren't
physically supported on any of the ST / MegaST /
STE / MegaSTE / TT / Falcon machines?

Seems so. At least nobody complained until now.

People are normally using either some smaller
amount for compatibility, or largest supported
(14MB).

Typically they also use releases few years older than Git head (which until recently supported any
amount).  And only very few people know what
actual amounts are supported by all Atari HW.

=> I don't see lack of complaints particularly
   credible evidence. :-)


I was actually hoping Christian could say
something on this topic as he's the one who
confirmed 10MB as MegaSTE and TT maximum.


Because those can't address more than 10MB (due
to rest being VME area in MegaSTE, and TT MCU
not supporting more), and Falcon mem reg not supporting it, I guess 12MB isn't supported by
anything else either.

So, the remaining question is whether something
would support 6MB?


Btw. 10MB is supported on MegaSTE & TT, but
not on Falcon.  Specific memory amounts are
enforced (with a warning) only for Falcon though.
I wonder should they be enforced also for others?

I assume you are talking about the STMemory_CorrectSTRamSize()
function? ... I guess yes, maybe it should be enforced for these
machines, too, but that's certainly a change that should rather wait
until the release has been done.

Would the attached patch be acceptable before release?


	- Eero
commit 0dfc10f8cb0a5ac549e3c21c223267f6d5ebc49a
Author: Eero Tamminen <oak@xxxxxxxxxxxxxx>
Date:   Wed Nov 11 01:24:50 2020 +0200

    Improve memory checks
    
    - Enforce also smaller memory amounts for Falcon
    - Document memory amount check better

diff --git a/src/stMemory.c b/src/stMemory.c
index 3e075250..03fa5822 100644
--- a/src/stMemory.c
+++ b/src/stMemory.c
@@ -463,18 +463,21 @@ int STMemory_CorrectSTRamSize(void)
 
 	if (Config_IsMachineFalcon())
 	{
-		/* These values need to match ones used in STMemory_SetDefaultConfig()
-		 * above.
-		 *
-		 * Check ranges which might have non-supported memory values:
-		 *   10MB, 6MB & 2.5MB
+		/* Falcon ST RAM values need to match to ones used
+		 * in STMemory_SetDefaultConfig() above.
 		 */
-		if (STRamSize_KB > 8*1024 && STRamSize_KB < 14*1024)
+		if (STRamSize_KB > 8*1024)
 			STRamSize_KB = 14*1024;
-		else if (STRamSize_KB > 4*1024 && STRamSize_KB < 8*1024)
+		else if (STRamSize_KB > 4*1024)
 			STRamSize_KB = 8*1024;
-		else if (STRamSize_KB > 2*1024 && STRamSize_KB < 4*1024)
+		else if (STRamSize_KB > 2*1024)
 			STRamSize_KB = 4*1024;
+		else if (STRamSize_KB > 1024)
+			STRamSize_KB = 2*1024;
+		else if (STRamSize_KB > 512)
+			STRamSize_KB = 1024;
+		else
+			STRamSize_KB = 512;
 
 		if (STRamSize_KB != ConfigureParams.Memory.STRamSize_KB)
 		{
@@ -928,12 +931,34 @@ int	STMemory_RAM_Validate_Size_KB ( int TotalMem )
 	if ( TotalMem <= 14 )
 		TotalMem *= 1024;
 
-	/* New format where ST RAM size is in KB */
-	if (  ( TotalMem ==  128 ) || ( TotalMem ==  256 ) || ( TotalMem ==  512 ) || ( TotalMem ==  640 )
-		|| ( TotalMem == 1024 ) || ( TotalMem == 2048 ) || ( TotalMem == 2176 ) || ( TotalMem == 2560 )
-		|| ( TotalMem == 4096 ) || ( TotalMem == 8*1024 ) || ( TotalMem == 10*1024 ) || ( TotalMem == 14*1024 ) )
+	/* New format where ST RAM size is in KB
+	 *
+	 * These memory amounts are accepted for all machine types, but in
+	 * case of Falcon, rounded up later in STMemory_SetDefaultConfig(),
+	 * to amounts Falcon mem config reg actually supports
+	 */
+	switch (TotalMem)
+	{
+		/* all ST/STE MMU chipsets */
+	case 128:
+	case 256:
+		/* other than IMP ST/STE MMU chipset (mixed banks) */
+	case 640:
+	case 2176:
+	case 2560:
+		/* (Mega)ST/STE/MegaSTE/TT/Falcon */
+	case 512:
+	case 1024:
+	case 2048:
+	case 4096:
+		/* MegaSTE/TT/Falcon */
+	case  8*1024:
+		/* MegaSTE/TT max */
+	case 10*1024:
+		/* Falcon max */
+	case 14*1024:
 		return TotalMem;
-
+	}
 	return -1;
 }
 


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