tonioni / WinUAE

WinUAE Amiga emulator
http://www.winuae.net/
528 stars 86 forks source link

Line Blitter and DMACON::BZERO flag #205

Closed dirkwhoffmann closed 2 years ago

dirkwhoffmann commented 2 years ago

Test case: https://github.com/dirkwhoffmann/vAmigaTS/tree/master/Blitter/line/zero1

From the README:

This test runs 12 line blits. Each blit draws a horizontal line with varying line patterns and 
multiple combinations of the SING and USEC bit. After each blit, the value of the Blitter zero 
bit is read and visualized in form of a blue or yellow line.

Amiga 500 8A:

138749113-6565ac22-1a3f-40cb-9f5f-c999b933fb61

UAE (cycle exact mode):

138751481-847596e4-e8d0-4f63-8a3a-cfe2ed5c47c4

UAE (immediate blits):

138751564-92b2a549-9c4c-4347-93cc-43ff382f551d

The test fails in UAE because the zero bit is written inside function blitter_line_write() and not outside: https://github.com/tonioni/WinUAE/blob/849ed3456b39dd49d4a923e63b05d1cbdaf9856a/blitter.cpp#L682

On the real machine, the bit gets cleared even if nothing is written into memory.

tonioni commented 2 years ago

Thanks, fixed. Unfortunately no one have done weird things with line mode or I would have noticed these kinds of bugs long time ago. Non-line mode on the other hand..