18 April 2021, 17:30 | #1 | |
OctaMED Music Composer
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 666
|
Problem with blitter fills on fast machines (Maybe bchg?)
Stuck again with a very annoying problem.
I made a vector object drawn with blitter and then copied with fill mode in another bitmap. Everything is OK but the same code in a fast machine returns different values (always different in a different way) and I'm quite puzzled This is what happens: basically corners are not erased properly but this always change, they are never wrong in the "same way". Being a BCHG instruction responsible for erasing the pixel corner I think the problem is within this piece of code: Quote:
It seems like in fast machines the results are not consistent, and it's driving me crazy enough to beg for help full code: https://github.com/KONEY/mechmicrobe...R_FILL_DEBUG.s |
|
18 April 2021, 18:09 | #2 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,038
|
I see nothing wrong in that piece of code. subq.w #8,d1 is not needed (you can add/sub 8/16/24/... and it will work the same since only the bottom 3 bits matter when bchanging the memory).
It's probably a combination of that and something else, or something else. |
18 April 2021, 18:31 | #3 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Code works for me, only thing I see is a read from $dff000 in the blitter wait, which should be fixed but it should not cause the bugs you are experiencing.
|
18 April 2021, 18:41 | #4 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,038
|
Just theoretical, but maybe a cause.. Blitter and cpu are writing to the same byte.
You are modifying the bitmap with cpu while the blitter is running. Since you generally draw a poly-line (end pixel of one is start pixel of next) there's a good chance CPU and blitter will hit the same pixel/byte in wrong order and negate one of the writes. |
18 April 2021, 22:20 | #5 |
OctaMED Music Composer
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 666
|
Thanks, after spending the afternoon I tried another routine which is more optimized and it hasn't the problem. Seeing the same coordinates return a different thing at every refresh was quite crazy, still very curious to know what was going on!
@stingray that tst.w (a6) is in Photon's miniwrapper and I'm not sure what its role is. What I know is that usually in its place the instruction below ( btst #6,2(a6) ) is repeated, for some bug on older models I think. Maybe Photon's one was the same and there's an error? |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Lionheart - Shifted line problem on AGA machines | viddi | support.Games | 72 | 08 April 2021 11:06 |
Blitter fill problem | mekhall | Coders. Asm / Hardware | 7 | 20 June 2016 00:04 |
Blitter problem | zeGouky | Coders. Asm / Hardware | 7 | 26 March 2014 14:12 |
Fast Blitter Line Clipping | 71M | Coders. Asm / Hardware | 2 | 03 March 2014 22:33 |
Blitter Sweet oldskool intro problem! | amilo3438 | support.WinUAE | 9 | 02 July 2013 11:44 |
|
|