[hatari-devel] DSP host interface interrupted mode : help needed

Laurent Sallafranque laurent.sallafranque at free.fr
Sat Sep 12 00:21:55 CEST 2009


Hello,

This will be a new long mail, sorry :)
I'll explain you what I've found. I'll try to give you as much 
informations as possible.
I'll probably need help as the problem seems to be into the MFP (if I'm 
right).

I'm trying to let run graoumf tracker, 3d-kart, and many other programs 
that freeze.

I've detected that these 2 programs are based on graoumf tracker code.
I've spent time trying to understand what happens and I think I've found 
something.


1) First part : The DSP Host Interface interrupt mode:


The Host Interface (HI) can transfer data between the 68030 (Host) and 
the DSP in 3 different modes :

- handshake mode : this one seems to run well now.
- DMA mode : this one isn't implemented into the falcon
- interrupt mode : this one isn't fully implemented yet.
I started to code some things but there's something missing.

In interrupted mode, 68030 goes to an interrupt when 2 pins are set and 
DMA mode is off :
HREQ : Host Request
HACK : Host Acknowledge

A logical copy of the HREQ pin state is stocked into the ISR ($FFA202) 
register at bit 7.
I've already implemented it into the DSP code 
(dsp_core_hostport_update_hreq() )
ISR bit 6 may also be useful (it indicates if DMA mode is used (1) or 
not (0).

If HREQ is cleared, no interrupt is requested by the DSP.
If HREQ is set, DSP requests the 68030 to interrupt.


(Now, an extract from the DSP manual (Host interface manual) :

10.2.3.5 : Interrupt Vector Register (IVR) ($FFA203)
The IVR is an 8-bit read/write register which typically contains the 
exception vector num-
ber used with MC68000 Family processor vectored interrupts. Only the 
host processor
can read and write this register. The contents of IVR are placed on the 
host data bus
(H0–H7) when both the HREQ and HACK pins are asserted and the DMA mode 
is dis-
abled. The contents of this register are initialized to $0F by a 
hardware or software reset,
which corresponds to the uninitialized exception vector in the MC68000 
Family.

HACK is used in "MC68000 family processor" mode (not in DMA mode).
DMA bit is always 0 for a falcon.

So, if HREQ bit is set to 1, the 68030 should detect it and run into an 
interrupted vector.



2) Return to Graoupf tracker :

Here is a part of Graoumpf tracker code (I've translated comments for you):

DSP_EXCEPTION = $FF
DSPIVR = $ffffa203
DSPHCR = $ffffa200

;--- Initialize interrupt

move.b #DSP_EXCEPTION, DSPIVR.w ; Number of the exception when
move.l #soundtracking_kernel, DSP_EXCEPTION*4.w ;Host Port send a data 
to the 68030
move.b #1, DSPHCR.w ; allow the interrupt
move.l #DSP_EXCEPTION*4, adr_adr_inter


Here, the "DSP receive data interrupt" is located at address : $0003FC


So, if I understand correctly, if Hreq goes to 1, 68030 should interrupt 
and jump at the address located at vector address $3F8. In graoupf 
tracker, it would jump to "soundtracking_kernel" code.

That's why Graoumf Tracker , 3d-kart and some more programs are 
freezing, because 68030 never interrupts.


3) What should we do ? (help needed here)

I think that we should add to the MFP a new interrupt detection : Hreq = 
1 (bit 7 at address ($FFA202))
In this case, value at address $ffffa203 should be read and 68030 should 
interrupt at address (value * 4).


This will probably let some more DSP (falcon) programs run.

I'm waiting for your comments here.

Regards,

Laurent






More information about the hatari-devel mailing list