Re: [hatari-devel] hatari tt scc emulation

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


Hi,

On 07/17/2017 08:07 PM, Christian Zietz wrote:
Eero Tamminen schrieb:

On 07/17/2017 09:43 AM, Christian Zietz wrote:
I'm quite confident that -- if required -- I could provide a test case
that does not need MiNT and that will crash at the same instruction
inside TOS 3.06.

That would be useful!

Please find attached the test case, in source form as well as compiled
with Pure C. This little programs tests that Bconmap and the TT SCC are
available, then it reads the current baud rate and sets it again -- all
using XBIOS functions, not direct HW access.

Thanks!

It seems to need at least TOS v2.  It doesn't crash on ST/STE/Falcon,
and crashes on TT, unless Hatari is patched.  I.e. it demonstrates
the issue fine. :-)


Btw. What you've compiled it with?  It has FPU check bus error
at startup.


Under Hatari with TOS 3.06
and TT emulation, this crashes in TOS code while accessing the SCC
Channel B control register at $FFFF8C85:

Bus error exception at 0xe0312a!
$00e0312a : 14bc 000c                          move.b    #$c,(a2)

... where A2 is $FFFF8C85.

I don't think the application (be it MiNT or be it my testcase) can be
faulted for using XBIOS functions to access a serial port that TOS
claims is available.

Michael, attached is (untested) patch to disable SCC write bus errors.

I'm afraid there's something wrong with it. TOS 3.06 crashes during
startup. It seems like access to the SCC DMA control ($FFFF8C14) also
needs to be intercepted. When I add...

{ 0xff8c14, SIZE_WORD, IoMem_VoidRead, IoMem_WriteWithoutInterception },
        /* SCC DMA */

... to ioMemTabTT.c, the sample FreeMiNT installation provided to me by
Michael boots without crashing.

So it seems.  Attached is more complete version of the patch others
can try (has both changes + comments).


	- Eero
diff -r 5cfcf542f273 src/ioMemTabTT.c
--- a/src/ioMemTabTT.c	Mon Jul 17 11:41:33 2017 +0200
+++ b/src/ioMemTabTT.c	Thu Jul 20 00:38:59 2017 +0300
@@ -133,7 +133,15 @@
 
 	/* Note: The TT does not have a blitter (0xff8a00 - 0xff8a3e) */
 
-	//{ 0xff8c80, 8, IoMem_VoidRead, IoMem_WriteWithoutInterception },         /* SCC */
+	/* TODO: Current TT emulation is missing SCC emulation (+ required MFP updates).
+	 *
+	 * Although these registers aren't implemented, it's better to disable them,
+	 * otherwise TOS v3 crashes any program trying to use Rsconf(), such as MiNT
+	 * which startup code iterates through serial devices.
+	 */
+	// { 0xff8c00, 14, IoMem_VoidRead, IoMem_WriteWithoutInterception },                       /* SCC DMA */
+	{ 0xff8c14, SIZE_WORD, IoMem_VoidRead, IoMem_WriteWithoutInterception },                /* SCC DMA control */
+	{ 0xff8c80, 8, IoMem_VoidRead, IoMem_WriteWithoutInterception },                        /* SCC ports */
 
 	{ 0xff8e01, 1, IoMem_ReadWithoutInterception, IoMem_WriteWithoutInterception },         /* SCU system interrupt mask */
 	{ 0xff8e03, 1, IoMem_ReadWithoutInterception, IoMem_WriteWithoutInterception },         /* SCU system interrupt state */


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