[hatari-devel] New blitter code for xcount=1 nfsr=1

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


Hi

some times ago we had several examples of wrong blitter emulation when xcount=1 and nfsr=1 at the same time.

Various tests showed some different result depending on "source x increment" values and other parameters maybe.

Thanks to the work by Ijor who did a Verilog implementation of the blitter, based on some reverse engineering as well as on the blitter's schematics that Christian Zietz found some years ago, I was able to fix this behaviour under Hatari and get all the cases to work under Hatari using the small test program that Christian wrote at this time (see attached BLIT.ZIP for reference)

To get correct results, blitter's code had to be rewritten in a more "low level" way, where data are fetched at the start of the blit in a specific order (fxsr, src, dst) instead of doing it "on demand" depending on the OP/HOP modes (which could sometimes lead to read dst before src, which is an error if we want to emulate xcount=1/nfsr=1)

The resulting code should be also smaller and maybe easier to read, with two big functions Blitter_ProcessWord and Blitter_Step that should better "mimic" the tests' logic made in the real blitter.

Basically, if I didn't made error in my implementation, we need to add 2 extra shift/read in the case where xcount=1 and nfsr=1 ; but the main difference is that those 2 reads are dummy read (no cycle taken), returning the latest content of the bus instead of really reading from RAM ! This is what explain the difference we see depending on "source x increment" being >0 or <0.

With current hatari version, the attached program BLITEMU.TTP should now output a file BLITEMU.TXT that matches the result file ST1.TXT (it doesn't match the FALCON*.TXT files, but I wonder if the data cache was really disabled when those tests were made ?)

I tried some games / demos that make use of the blitter and didn't see any regression so far (Lethal Xcess, We Were by Oxygene, rgbbeast by agression, sea of colors by dhs, ...)

Given the number of changes, it's possible some cases were forgotten. Please test your favorite STE games/demos that use the blitter and report any problem.

Next Hatari release will be soon now, so better fix everything before ;-)

Nicolas

Attachment: BLIT.ZIP
Description: Zip archive



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