Re: [hatari-devel] DSP addressing bug

[ Thread Index | Date Index | More Archives ]

Thanks, I will try and report back.


On 25 October 2015 at 18:28, Laurent Sallafranque <laurent.sallafranque@xxxxxxx> wrote:
Hi all,

I've pushed a new patch that should work also with (Rn)-Nn.

I've tested a few demos, prgs and games (Eko system, Raimbow 2, Running, Tere Ra'i, ...) and everything seems OK.

Doug, it's up to you to tell me if this works now.
If not, I'll be OK to have another look on wednesday.



Le 24/10/2015 17:14, Laurent Sallafranque a écrit :
I'll have some time tomorrow evening to send a patch.
I know how to do it, but I haven't got the time today (too much people at home, it's my daughter's birthday ;)



Le 24/10/2015 15:42, Andreas Grabher a écrit :
After some more investigation it seems my patch is faulty. So please ignore it for now.

Am 24.10.2015 um 00:50 schrieb Andreas Grabher <andreas.grabher@xxxxxxxxxxxx>:

If Nn is -8 and modulo is less than 8 (--> k <= 4, P >= 1) it will decrement r_reg by 8 (r_reg += -8 is same as r_reg -= 8):
e.g. Nn = -8, M = 3:
--> k = 2
--> blocksize = 2^k = 4

P = Nn / 2^k = -8 / 2^2 = -2
Rn += P * blocksize = -2 * 4 = -8 (jump 2 blocks down)

Of course i might be totally wrong. The description in the data sheet is very confusing. I absolutely agree that this needs to be tested.

In the meantime i slightly improved the patch to better suit the coding conventions of the DSP part. It seems it consequently avoids using the modulo operator. So my new patch works without it and is also slightly faster.


Am 24.10.2015 um 00:25 schrieb laurent.sallafranque@xxxxxxx:


I haven't got the time to test but at first look i think the patch is wrong.

What If i set -8 into Nn ?

I Know How to fix this but it Will be in 3 days


----- Mail d'origine -----
De: Douglas Little <doug694@xxxxxxxxxxxxxx>
À: hatari-devel@xxxxxxxxxxxxxxxxxxx
Envoyé: Fri, 23 Oct 2015 20:22:12 +0200 (CEST)
Objet: Re: [hatari-devel] DSP addressing bug


I'm not very familiar with that part of Hatari so I'm not sure just by
looking at the diff (at least not without more study). Laurent will know

I will say that the exceptional case occurs when Nn is exactly a multiple
of the 2^k ringbuffer bound. If it is less, it performs modulo addressing.
If greater, the results seem to be undefined i.e. not necessarily modulo.

This happens for (Rn)+Nn, (Rn)-Nn *and also (Rn+Nn) i.e. offset only, with
no update to addr register.*


On 23 October 2015 at 19:07, Andreas Grabher <andreas.grabher@xxxxxxxxxxxx>

Laurent and Doug,

what do you think about the appended patch? I'm not sure about it, but it
might work. Maybe worth to test it?



Am 23.10.2015 um 13:52 schrieb laurent.sallafranque@xxxxxxx:

Hi Doug,

Quick question Laurent - does the patch also work for (Rn)-Nn
It should ;)

But I think I understand precisely the problem now (in hatari, -Nn is
passed as a negative argument to the function when the addressing mode is
(Rn)-Nn, I'll have to rewrite it by adding a sign variable and keeping Nn
Don't expec this fix before tuesday or wednesday (we'll have family at
home in the next days).
At least, I see how to fix it definitively now.



----- Mail original -----
De: "Douglas Little" <doug694@xxxxxxxxxxxxxx>
À: hatari-devel@xxxxxxxxxxxxxxxxxxx
Envoyé: Vendredi 23 Octobre 2015 12:20:16
Objet: Re: [hatari-devel] DSP addressing bug

Quick question Laurent - does the patch also work for (Rn)-Nn addressing?

If I keep my workaround just for this case and remove it for the (Rn)+Nn
cases the remaining problem seems to go away...

On 23 October 2015 at 11:11, Douglas Little < doug694@xxxxxxxxxxxxxx >

Yep definitely something is slightly different on real HW. I'm getting
selectively black pixels in Hatari where they look correct on HW.
Previously I was getting a completely destroyed image.
It's going to take effort to figure out what's going on but I still see
some kind of problem. I'll try to narrow it down a bit.


On 23 October 2015 at 10:54, Douglas Little < doug694@xxxxxxxxxxxxxx >

Perhaps I spoke too soon. There is something funny still happening - but
I'll need to do more checks to make sure it's not my fault. I'll update
soon when i have more info....

On 23 October 2015 at 10:13, Douglas Little < doug694@xxxxxxxxxxxxxx >

It works for me - everything looks good!

Thanks :)

I'll report if I run into any problems with it but I don't think so..


On 22 October 2015 at 22:10, Laurent Sallafranque <
laurent.sallafranque@xxxxxxx > wrote:

I've already tested :

EKO_systems : still working to the end
TERE RA'I ;) : still working to the end
Sololuminezcent : still working to the end

underscore demo seems to crash now but it also crash with the n-1
version of hatari (ie without my patch).
There's a regression with this demo, it was at least working to the 4rth
screen before.
I continue some tests but the patch seems OK to me.



Le 22/10/2015 23:02, Nicolas Pomarède a écrit :

Le 22/10/2015 22:57, Douglas Little a écrit :

Woo, that was quick. Thanks!

If the patch has made it into the repo, I can just collect tomorrow's
nightly build and see if that works for me. Sounds like it probably
will. Otherwise I'll try a local build tomorrow.


unfortunately, it seems builds at are not
regularly updated anymore (and it even returns a HTTP 503 error at the
moment :( )

Mail converted by MHonArc 2.6.19+