Re: [hatari-devel] DSP and HREQ

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


Hi,

After many researches, I've finally found what I searched ;)

In interrupt mode :


The DSP-IRQ-vector is :

$03FC-$03FF : This vector is used for receiving or/and sending data from/to the DSP in interrupt mode.

It can be another value, according to what is loaded at address $ffffA203.w (here : $FF)

And the most important : the bit 1 or 0 must be cleared by the main program itself in interrupt mode.

I've checked Hatari's source code and it seems correct to me :

The interrupt is detected if the bits 0 or 1 (or both) of the mask is set at the ICR address and the corresponding bit 0 or 1 (or both) is set in the ISR.

It then generates an interrupt that is catched by the 68030.

All of this works well under hatari (from what I've tested).

To stop the interrupt, one just have to write a zero at bit 0 or 1 of the ICR ($ffffa200.w) In hatari, there's a call to dsp_core_hostport_update_hreq() when one write at the ICR address, which is correct.

The remaining question is : should the HREQ exception should be removed in this case.

I'm now ready to test the full send or receive process with the value of HREQ as asked ;)

To be noticed : my program doesn't crash anymore now that I have the correct vector address value ;)

Regards

Laurent




Le 28/01/2015 00:04, Nicolas Pomarède a écrit :
Le 27/01/2015 23:17, Laurent Sallafranque a écrit :
Hi,

OK, I need some help now ;)
Nicolas, I think you've pointed out a bugged part of the DSP emulation ;)

First, I've rewrote the code into hatari dsp emulation like this :
(The if statement seemed to be wrong to me).


static void dsp_core_hostport_update_hreq(void)
{
     int hreq;

     hreq = (dsp_core.hostport[CPU_HOST_ICR] &
dsp_core.hostport[CPU_HOST_ISR]) & 0x3;

     /* Trigger host interrupt? */
     if ((hreq != 0) && ((dsp_core.hostport[CPU_HOST_ISR] &
(1<<CPU_HOST_ISR_HREQ)) == 0)) {
         fprintf(stderr, "Interrupt\n");
         dsp_host_interrupt();
     }

     /* Set HREQ bit in hostport */
     dsp_core.hostport[CPU_HOST_ISR] &= 0x7f;
     dsp_core.hostport[CPU_HOST_ISR] |= (hreq?1:0) << CPU_HOST_ISR_HREQ;
}



Now, I get the fprintf message displayed into the console when I run my
test code.


Hi
when in doubt, it's always better to add paranthesis :)

But : it seems I never reach the $3c address (ie in my test program, I
never break into dsp_inter)

Could it be because of the     move.w    #$2500,sr ?
Or some bad inner code into hatari ?

I read the default vector number was $f in dsp56001, which would call $3c ; but maybe there's another value in the falcon's dsp ? What do you read at ffa203.B ?


Nicolas






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