h5n1xp / Omega

Bare metal Amiga Emulator
Mozilla Public License 2.0
69 stars 7 forks source link

Blitter variables previousA, previousB #31

Closed dirkwhoffmann closed 5 years ago

dirkwhoffmann commented 5 years ago

Maybe a minor thing: I've noticed that variables previousA and previousB get initialised by 0 every time a new Blitter line is performed:

for(int y=0;y<sizev;++y){
            uint16_t previousA = 0;
            uint16_t previousB = 0;

I'm not sure if this is correct. In hardware, the values in previousA and previousB are kept in registers that are part of pipeline and I would be surprised if those registers get cleared when the Blitter begins a new line (at least I never read about it).

I've noticed this when running your Blitter agains mine for the blit operations that are used to decode MFM data. Good news is that both our implementations work, because the suspicious bit is set to 1 by the minterm logic. Bad news is that I can't tell which implementation is correct.

BTW, Omega has helped me to rule a huge bug in my Blitter code. I forgot to reverse the directions of the barrel shifter when performing a descending blit.

h5n1xp commented 5 years ago

Maybe a minor thing: I've noticed that variables previousA and previousB get initialised by 0 every time a new Blitter line is performed:

for(int y=0;y<sizev;++y){
            uint16_t previousA = 0;
            uint16_t previousB = 0;

I'm not sure if this is correct. In hardware, the values in previousA and previousB are kept in registers that are part of pipeline and I would be surprised if those registers get cleared when the Blitter begins a new line (at least I never read about it).

Yes, my code it just how I imagined the Blitter would work (over a year ago), not really based on the real operation. It was probably my thinking that the previous bales are only needed for the shifts, which are per line horizontal line, so I just added the variable before the horizontal line loop.

I've noticed this when running your Blitter agains mine for the blit operations that are used to decode MFM data. Good news is that both our implementations work, because the suspicious bit is set to 1 by the minterm logic. Bad news is that I can't tell which implementation is correct.

Moving the variable declaration and clear, out of the loop code is probably a good optimisation, so I’ve done that!

BTW, Omega has helped me to rule a huge bug in my Blitter code. I forgot to reverse the directions of the barrel shifter when performing a descending blit.

👍🏻 Good stuff! There are probably still load of little bugs like that still in Omega code too! Now we can test the code against vAmiga we should find them 😊