[hatari-devel] emutos-ram and GEMDOS drive emulation |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: [hatari-devel] emutos-ram and GEMDOS drive emulation
- From: Vincent Rivière <vincent.riviere@xxxxxxxxxxx>
- Date: Mon, 7 Mar 2016 00:34:02 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:to:from:subject:message-id:date:user-agent:mime-version; bh=pe1kFqWW7WkXpk/p02/aPuGbm5idNmUXbEsbPvvih3Y=; b=nRvwcxiOb+4QCy221DPCR6ByGlD67SUk65se2fe5UF5Eo+8s0ZGs1stBJWrKIxUXuu RUzN55Cv+deLUpDS9q37zPozXr4O2wzBPldJhhLE8BfgSlSNx/PtwLGOcNsTQf8B6ScU fNaJ7IKk46oeZt/RYKBy7Xy0u8zd1A5fuY0c9q/C2sldJSeADbvZok4V7IBHSzXxJ7cy zluzL6Rz+n+Qj51RYpg1qRGrEsXGpG1vD7tbyg0OgOfLT++N2lXD/r03HhhMUQcFuGOl JOJ8uA2lI1rpSIQXA0aOUmHJItnyt8MWOQzNGpl5Kff6ER2gd+7RovEoyEPhVe6yX3ZE hgug==
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();