|
|
Atari coding BBS
Re: Is there a way to contact TAT |
Posted by: Sallafranque
|
Jul,14.2011-09:39
|
Hi and thanks,
OK, here is what I trace in Hatari from Build in Obsolescence.
Note: DSP trace in hatari contains : the dsp PC | the 1 or 2 word opcode instruction | () the number of cycles for the instruction | the instruction itself
First, the bootstrap sequence, which seems OK.
Then the DSP starts :
p:0000 0c0040 (04 cyc) jmp p:$0040
p:0040 0500b9 (02 cyc) movec #$00,sr
p:0041 08f4be 000000 (06 cyc) movep #$000000,x:$fffe
p:0043 08f4bf 000c00 (06 cyc) movep #$000c00,x:$ffff
p:0045 08f4a0 000001 (06 cyc) movep #$000001,x:$ffe0
p:0047 08f4a8 000004 (06 cyc) movep #$000004,x:$ffe8
p:0049 0000ba (02 cyc) andi #$00,omr
p:004a 0c004a (04 cyc) jmp p:$004a
On 68030 Side (while dsp loops by jumping at address $4a) there's an interrupt sent to the DSP:
MOVE.B #$80,$ffffa200
MOVE.B #$8f,$ffffa201
On DSP side, the interrupt is immediatly seem and taken into account :
p:001e 0af080 00004b (06 cyc) jmp p:$004b
p:004b 0444bd (02 cyc) movec ssl,x0
p:004c 04c4b9 (02 cyc) movec x0,sr
p:004d 05f420 ffffff (04 cyc) movec #$ffffff,m0
p:004f 0450bb (02 cyc) movec sp,r0
p:0050 000000 (02 cyc) nop
p:0051 045010 (04 cyc) lua (r0)-,r0
p:0052 000000 (02 cyc) nop
Dsp: Stack Overflow
p:0053 04d0bb (02 cyc) movec r0,sp
p:0054 0bf080 00007d (06 cyc) jsr p:$007d
Here, 68030 verifies that the interrupt is aknoledge by the DSP
BTST.B #$0007,$ffffa201
At the same time, DSP continues to execute instructions
p:007d 0aa980 00007d (06 cyc) jclr #0,x:$ffe9,p:$007d
p:0002 000000 (02 cyc) nop
p:0003 000000 (02 cyc) nop
p:007d 0aa980 00007d (06 cyc) jclr #0,x:$ffe9,p:$007d
Looping on DSP instruction at PC = $007d
(Note here the jump to address 2 and 3 because of the stack overflow interrupt)
While DSP runs in a loop waiting datas from PORTB, 68030 does the following :
BNE.W #$fff8 == $000A0066 (F)
RTS.L
MV2SR.W (A7)+
RTS.L
LEA.L $000a01fa,A0
JSR.L $0009ff50
BT .W #$0018 == $0009FF6A (T)
MVSR2.W -(A7)
BSR.W #$0050 == $0009FFBE
MOVE.B #$8f,$ffffa201
This immediatly generates a second interrupt to the DSP
p:001e 0af080 00004b (06 cyc) jmp p:$004b
p:004b 0444bd (02 cyc) movec ssl,x0
p:004c 04c4b9 (02 cyc) movec x0,sr
p:004d 05f420 ffffff (04 cyc) movec #$ffffff,m0
p:004f 0450bb (02 cyc) movec sp,r0
p:0050 000000 (02 cyc) nop
p:0051 045010 (04 cyc) lua (r0)-,r0
Here, 68030 tests is DSP has acknoledged the interrupt:
BTST.B #$0007,$ffffa201
and dsp code continues (we're in the strange code here)
p:0052 000000 (02 cyc) nop
p:0053 04d0bb (02 cyc) movec r0,sp
Dsp: Stack Overflow
p:0054 0bf080 00007d (06 cyc) jsr p:$007d
p:007d 0aa980 00007d (06 cyc) jclr #0,x:$ffe9,p:$007d
Looping on DSP instruction at PC = $007d
p:0002 000000 (02 cyc) nop
p:0003 000000 (02 cyc) nop
p:007d 0aa980 00007d (06 cyc) jclr #0,x:$ffe9,p:$007d
Looping on DSP instruction at PC = $007d
Again, the normal jump to addr 2 and 3 (I don't know if there should be a second stack overflow, but it doesn't seems to be the problem anyway).
While DSP loops waiting a data on the PortB, 68030 does :
BNE.W #$fff8 == $0009FFC4 (F)
RTS.L
MV2SR.W #$2300
LEA.L $ffffa200,A1
MOVE.L #$00000000,D0
MOVE.B (A0)+,D0
BMI.B #$00000032 == $0009FFB0 (F)
BSR.B #$00000034 == $0009FFB4
BTST.B #$0001,$ffffa202
BEQ.B #$fffffffffffffff8 == $0009FFB4 (F)
RTS.L
MOVE.L D0,(A1, $0004) == $ffffa204
Here, a data is sent to the DSP PortB, so, DSP takes it :
Dsp: (Host->DSP): Direct Transfer 0x000050
Dsp: (Host->DSP): Dsp HRDF set
p:007f 00000c (04 cyc) rts
p:0000 0c0040 (04 cyc) jmp p:$0040
p:0040 0500b9 (02 cyc) movec #$00,sr
p:0041 08f4be 000000 (06 cyc) movep #$000000,x:$fffe
p:0043 08f4bf 000c00 (06 cyc) movep #$000c00,x:$ffff
p:0045 08f4a0 000001 (06 cyc) movep #$000001,x:$ffe0
cpu video_cyc= 94772 284@186 : 0009FF84 3218 MOVE.W (A0)+,D1
p:0047 08f4a8 000004 (06 cyc) movep #$000004,x:$ffe8
p:0049 0000ba (02 cyc) andi #$00,omr
p:004a 0c004a (04 cyc) jmp p:$004a
And finally, as we had a stack overflow, pc address was lost, and at the RTS, PC jumps to address0, and loops forever at address $4a.
I don't understand why this strange code after an interrupt call : movec $ffff into the stack pointer.
I've already tried to keep the address written at stack pointer 0
: the demo runs. But that's not the way a DSP works, and I want correct emulation.
Thanks for you comments on this code
Regards
Laurent
|
[All messages in this thread] [Start new thread]
Topic
|
Posted by
|
Date
|
Is there a way to contact TAT
|
Sallafranque
|
Jul,12.2011-23:38
|
Re: Is there a way to contact TAT
|
sqward
|
Jul,13.2011-01:51
|
Re: Is there a way to contact TAT
|
Sallafranque
|
Jul,14.2011-09:39
|
Re: Is there a way to contact TAT
|
Sallafranque
|
Jul,17.2011-19:07
|
Re: Is there a way to contact TAT
|
sqward
|
Jul,17.2011-21:52
|
Re: Is there a way to contact TAT
|
calimero
|
Jul,18.2011-04:14
|
Re: Is there a way to contact TAT
|
Shazz
|
Jul,18.2011-17:54
|
Re: Is there a way to contact TAT
|
Sallafranque
|
Jul,19.2011-23:26
|
Re: Is there a way to contact TAT
|
Sallafranque
|
Jul,19.2011-23:57
|
Re: Is there a way to contact TAT
|
Sallafranque
|
Jul,20.2011-00:02
|
Re: Is there a way to contact TAT
|
calimero
|
Jul,20.2011-10:29
|
Re: Is there a way to contact TAT
|
blind io
|
Jul,25.2011-13:20
|
What's the anti-troll code? That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
|
|
|