[hatari-devel] Reeking rumber analysis

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


Hi,

I've given a closer look at reeking rumber :

I can let it run under hatari by doing the following :

Under the GEM :

b pc=$0707d8


Then, start reeking rumbler by double clicking it


hen the breakpoint is reached, just do

r d5=0
c

and the game run

Here is the corresponding code:


The part of the code that calls the faulty function :

$06f942 : 207c 0009 3850                       movea.l   #$93850,a0
$06f948 : 4240                                 clr.w     d0
$06f94a : 323c 0100                            move.w    #$100,d1
$06f94e : 7401                                 moveq     #1,d2
$06f950 : 6100 0dd6                            bsr       $70728




The part of the code that loops forever :

$070728 : 48e7 ffe0                            movem.l d0-d7/a0-a2,-(sp)
$07072c : 4a41                                 tst.w     d1
$07072e : 6700 00ac                            beq       $707dc
$070732 : 48e7 e080                            movem.l d0-d2/a0,-(sp)
>
$070736 : 3f3c 0025                            move.w    #$25,-(sp)
$07073a : 4e4e                                 trap      #$e
$07073c : 544f                                 addq.w    #2,sp
$07073e : 4cdf 0107                            movem.l (sp)+,d0-d2/a0
$070742 : 43f8 9800                            lea $ffff9800.w,a1
$070746 : 3e00                                 move.w    d0,d7
$070748 : e54f                                 lsl.w     #2,d7
$07074a : d2c7                                 adda.w    d7,a1
>
$07074c : 45f9 0008 d8f0                       lea       $8d8f0,a2
$070752 : 3601                                 move.w    d1,d3
$070754 : 5343                                 subq.w    #1,d3
$070756 : 24d9                                 move.l    (a1)+,(a2)+
$070758 : 51cb fffc                            dbra      d3,$70756
$07075c : 7a00                                 moveq     #0,d5
$07075e : 48e7 e080                            movem.l d0-d2/a0,-(sp)
$070762 : 3802                                 move.w    d2,d4
>
$070764 : 3f3c 0025                            move.w    #$25,-(sp)
$070768 : 4e4e                                 trap      #$e
$07076a : 544f                                 addq.w    #2,sp
$07076c : 51cc fff6                            dbra      d4,$70764
$070770 : 4cdf 0107                            movem.l (sp)+,d0-d2/a0
$070774 : 43f9 0008 d8f0                       lea       $8d8f0,a1
$07077a : 45f8 9800                            lea $ffff9800.w,a2
$07077e : 3e00                                 move.w    d0,d7
>
$070780 : e54f                                 lsl.w     #2,d7
$070782 : d4c7                                 adda.w    d7,a2
$070784 : 3601                                 move.w    d1,d3
$070786 : 5343                                 subq.w    #1,d3
$070788 : 24d9                                 move.l    (a1)+,(a2)+
$07078a : 51cb fffc                            dbra      d3,$70788
$07078e : 45f9 0008 d8f0                       lea       $8d8f0,a2
$070794 : 2248                                 movea.l   a0,a1
>
$070796 : 3e00                                 move.w    d0,d7
$070798 : e54f                                 lsl.w     #2,d7
$07079a : d2c7                                 adda.w    d7,a1
$07079c : 3c01                                 move.w    d1,d6
$07079e : 5346                                 subq.w    #1,d6
$0707a0 : 2811                                 move.l    (a1),d4
$0707a2 : 2612                                 move.l    (a2),d3
$0707a4 : b803                                 cmp.b     d3,d4
>
$0707a6 : 6706                                 beq.s     $707ae
$0707a8 : 6202                                 bhi.s     $707ac
$0707aa : 5103                                 subq.b    #8,d3
$0707ac : 5803                                 addq.b    #4,d3
$0707ae : e19b                                 rol.l     #8,d3
$0707b0 : e19c                                 rol.l     #8,d4
$0707b2 : b803                                 cmp.b     d3,d4
$0707b4 : 6706                                 beq.s     $707bc
>
$0707b6 : 6202                                 bhi.s     $707ba
$0707b8 : 5103                                 subq.b    #8,d3
$0707ba : 5803                                 addq.b    #4,d3
$0707bc : e19b                                 rol.l     #8,d3
$0707be : e19c                                 rol.l     #8,d4
$0707c0 : b803                                 cmp.b     d3,d4
$0707c2 : 6706                                 beq.s     $707ca
$0707c4 : 6202                                 bhi.s     $707c8
>
$0707c6 : 5103                                 subq.b    #8,d3
$0707c8 : 5803                                 addq.b    #4,d3
$0707ca : 4843                                 swap      d3
$0707cc : b699                                 cmp.l     (a1)+,d3
$0707ce : 6702                                 beq.s     $707d2
$0707d0 : 7a01                                 moveq     #1,d5
$0707d2 : 24c3                                 move.l    d3,(a2)+
$0707d4 : 51ce ffca                            dbra      d6,$707a0
>
$0707d8 : 4a85 tst.l d5 <------- Here is the the test that never goes throw with hatari
$0707da : 6680                                 bne.s     $7075c
$0707dc : 4cdf 07ff                            movem.l (sp)+,d0-d7/a0-a2
$0707e0 : 4e75                                 rts


At least, the game runs under hatari except for this infinite loop that never finishs because of this d5 register.

May this gives some ideas to somebody.

Regards

Laurent




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