[hatari-devel] Wotanoid problem
Laurent Sallafranque
laurent.sallafranque at free.fr
Sat Jan 23 17:19:29 CET 2010
Hello,
I've add a look at Wotanoid (falcon).
The problem is absolutely not a DSP problem here.
I've disassembled the 68030 code with desert drain.
(I can send it to you if needed)
the program goes wrong in the following part of code.
(don't try to read it all, I'll explain what I think goes wrong).
I think the problem comes from the Load_file function (see code below)
Just after, it does a "depack", and goes to "prepare_un_sprite_cmc".
The problem is here because D2 (used for the loop) starts with value -1
($ffffffff)
D2 comes from D1 (move D1, D2)
D1 is saved by the movem.l (just after recale_adr:)
D1 comes from the depack routine (just after the load_file).
ok59:
lea (A1),A0
cmpi.l #$434D5030,(A0)+
move.l (A0)+,D1
If the load_file is wrong, the depack will depack wrong.
The load file contains 3 TRAP #1 (I don't know what to do with that).
But I think this part is related to hatari/host computer code.
That's why I think the problem is here.
As there are many programs that loop until they reach the ROM addresses,
I think
this problem would let more programs to run.
Any comment here ?
Best regards,
Laurent
Load_cmc:
movem.l D0-A6,-(SP)
move.l #-1,D0
bsr.w Load_file
lea (A1),A0
lea $7D00(A0),A1
move.l 4(A0),D3
bsr.w depack
bra.b ok59
use_cmp:
movem.l D0-A6,-(SP)
ok59:
lea (A1),A0
cmpi.l #$434D5030,(A0)+
move.l (A0)+,D1
move.w D1,D2
addq.l #1,D1
lea (A0),A3
lea 0(A3,D1.w*4),A0
move.l A0,D7
recale_adr:
add.l D7,0(A3,D2.w*4)
dbra D2,recale_adr
movem.l D0-D2/A0,-(SP)
move.l D3,D0
subq.l #1,D1
movea.l A2,A0
move.w #1,D2
bsr.w Malloc
movea.l A0,A1
move.l D0,D3
movem.l (SP)+,D0-D2/A0
movea.l A1,A4
move.w D1,D2
subq.w #2,D2
prepare_un_sprite_cmc: A1,(A2)+
movea.l (A3)+,A0
bsr.w prep_tmx_plus
movea.l 4(A1),A1
dbra D2,prepare_un_sprite_cmc
suba.l A4,A1
move.l A1,D1
move.l D3,D0
bsr.w Mshrink
movem.l (SP)+,D0-A6
rts
-----------> Here is the Load_file function <------------------------
Load_file: movem.l D1/D2/A0-A2,-(SP)
lea (A1),A2
move.l D0,D2
move.w #2,-(SP)
move.l A0,-(SP)
move.w #$3D,-(SP)
trap #1 ;Fopen
addq.l #8,SP
move.w D0,handle2
move.l A2,-(SP)
move.l D2,-(SP)
move.w D0,-(SP)
move.w #$3F,-(SP)
trap #1 ;Fread
adda.l #12,SP
move.l D0,-(SP)
move.w handle2,-(SP)
move.w #$3E,-(SP)
trap #1 ;Fclose
addq.l #4,SP
move.l (SP)+,D0
movem.l (SP)+,D1/D2/A0-A2
rts
More information about the hatari-devel
mailing list