[hatari-devel] Emulation of the TT second MFP |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Hi
at least, here it is, emulation of the TT's specific MFP :)
Previous MFP code has been cleaned up and modified to handle several MFP
objects.
Each MFP instance is stored using a MFP_STRUCT and there're now 2 MFP :
- pMFP_Main : this is the standard MFP that can be found on any
machine (ST, STE, TT, Falcon). It's located at address $FFFA01 - $FFFA2F
- pMFP_TT : this is the TT only MFP, it's located at address $FFFA81 -
$FFFAAF.
As the TT MFP can have 4 timers, cycInt.c has been modified to handle 4
additional internal timers (this makes quite a lot of timers to process
in the main cpu loop in the end, so in a 2nd phase I will look at
optimizing MFP code by using only 1 timer per MFP then dispatch it
between the 4 internal MFP timers)
For now, I tried to change as little code as possible, just to adapt all
the parts to the new MFP functions (basically adding a pMFP variable to
all function) and to ensure there's as litlle regression as possible at
start.
The only part that required the TT MFP is in ncr5380.c to handle SCSI
and I updated it to use the TT MFP's GPIP register.
My test so far was to successfully boot with TOS 3.06 until I reach the
desktop. During the boot, TOS will start timer C and D on the TT MFP and
expects these timers to trigger an interrupt ; if not, TOS would wait
forever as a result of this failure.
Note that in the end, TOS will keep timer D started but disabled through
the mask register. So we have the same "issue" as with the main MFP
timer D where we added the "patch timer D" option to slow down this
useless timer (and reduce emulation cost).
So when in TT mode, "patch timer D" option will now change main MFP but
also TT MFP.
Once this new code is confirmed to run SCSI/ncr5380 as before, I will
look into adding new missing parts :
- handle timer A/timer B in event count mode on the TT MFP (timer A is
not connected, timer B is connected to the DE signal, as on the main MFP)
- add support for the UART on the TT MFP ? Is there any program that
makes use of it to test it ? This would imply to adapt rs232 code to
handle several serial ports too.
- connect more signals to the GPIP registers
- rewrite more internal MFP code to improve cycle accuracy
Thomas, can you check the ncr5380 code still works with this TT MFP ?
Nicolas