[hatari-devel] emutos-ram and GEMDOS drive emulation

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


Hello.

I noticed that emutos-ram did not work with Hatari GEMDOS drive emulation.

emutos-ram can be downloaded at the standard EmuTOS download place:
https://sourceforge.net/projects/emutos/files/emutos/0.9.5/

For memories, a first TOS is loaded from ROM. Then emutos-ram is loaded from disk and starts as a second OS. So Hatari needs to initialize the GEMDOS drive emulation a second time. But it doesn't.

The attached patch, as a quick proof of concept, shows that the situation can be easily fixed.

1) Hatari must allow to initialize the GEMDOS emulation a second time

2) The value of act_pd must be read from the current OS pointed by 0x4f2, not necessarily from the ROM header.

I don't plan to work on a better patch, but this could be a starting point if someone wants to cleanly fix this.

--
Vincent Rivière
diff -r 4bf10b37fe8a src/cpu/hatari-glue.c
--- a/src/cpu/hatari-glue.c	Thu Mar 03 00:55:35 2016 +0200
+++ b/src/cpu/hatari-glue.c	Mon Mar 07 00:18:14 2016 +0100
@@ -158,7 +158,7 @@
 	/* Initialize the connected drive mask */
 	STMemory_WriteLong(0x4c2, ConnectedDriveMask);
 
-	if (!bInitGemDOS)
+	//if (!bInitGemDOS)
 	{
 		/* Init on boot - see cart.c */
 		GemDOS_Boot();
diff -r 4bf10b37fe8a src/gemdos.c
--- a/src/gemdos.c	Thu Mar 03 00:55:35 2016 +0200
+++ b/src/gemdos.c	Mon Mar 07 00:18:14 2016 +0100
@@ -3454,7 +3454,8 @@
 	}
 	else
 	{
-		act_pd = STMemory_ReadLong(TosAddress + 0x28);
+		Uint32 osAddress = STMemory_ReadLong(0x4f2);
+		act_pd = STMemory_ReadLong(osAddress + 0x28);
 	}
 
 	/* Save old GEMDOS handler address */
diff -r 4bf10b37fe8a src/uae-cpu/hatari-glue.c
--- a/src/uae-cpu/hatari-glue.c	Thu Mar 03 00:55:35 2016 +0200
+++ b/src/uae-cpu/hatari-glue.c	Mon Mar 07 00:18:14 2016 +0100
@@ -169,7 +169,7 @@
 	/* Initialize the connected drive mask */
 	STMemory_WriteLong(0x4c2, ConnectedDriveMask);
 
-	if (!bInitGemDOS)
+	//if (!bInitGemDOS)
 	{
 		/* Init on boot - see cart.c */
 		GemDOS_Boot();


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