03 February 2020, 12:51 | #1 |
OctaMED Music Composer
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 667
|
Blitter shift eats 1px away
OK, at this point I know I'll have to live with the fact that experts among this section will hate me... but I'm stuck again with blitter
I have a problem using the shift function, basically it works but at every complete loop it eats 1px away, resulting in complete deletion of the scrolled part. I made a video to show what happens: [ Show youtube player ] I've been checking my code dozen of times without finding anything wrong but at some point I tried the example from the Photon/Scoopex youtube tutorial and the problem is also there! this is the video [ Show youtube player ] but I'll attach also a picture which shows better what's happening. CODE: https://github.com/KONEY/asm68k-test...OBMP2X_BLIT3.s any hint? Last edited by KONEY; 03 February 2020 at 13:16. |
03 February 2020, 13:02 | #2 |
OCS forever!
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
|
What is your last word mask set to? Bits shifted off the end wrap around and can look like this (from the video, not sure about the pic ). Set your LWM to $0 to test if the problem goes away and if it does then add something like this:
Code:
;To prevent data that is scrolled out of the left reappearing on the right we have to mask the LAST word ;By the same amount that we are shifting. Last mask is applied BEFORE the shift occurs so only zeros ;get shifted back into the right ;shift 1, mask $7fff ;shift 2, mask $3fff ;d3=shift amount moveq #-1,d0 ; $ffffffff for FWM/LWM lsr.w d3,d0 ; add x number of zeroed bits to LOW word (LWM) move.l d0,bltafwm(a6) ;FWM, LWM Last edited by Antiriad_UK; 03 February 2020 at 13:11. |
03 February 2020, 13:15 | #3 |
OctaMED Music Composer
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 667
|
ah sorry I forgot to put the source!
https://github.com/KONEY/asm68k-test...OBMP2X_BLIT3.s but yes I'll verify what you suggest, thanks! |
03 February 2020, 13:19 | #4 |
OCS forever!
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
|
Yeah, line 244 of that source change:
Code:
MOVE.W #$FFFF,BLTAFWM ; BLTAFWM lo spiegheremo dopo MOVE.W #$FFFF,BLTALWM ; BLTALWM lo spiegheremo dopo MOVE.W #%0001100111110000,BLTCON0 ; BLTCON0 (usa A+D); con shift di un pixel Code:
MOVE.W #$FFFF,BLTAFWM ; BLTAFWM lo spiegheremo dopo MOVE.W #$7FFF,BLTALWM ; BLTALWM lo spiegheremo dopo MOVE.W #%0001100111110000,BLTCON0 ; BLTCON0 (usa A+D); con shift di un pixel |
03 February 2020, 13:39 | #5 |
OctaMED Music Composer
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 667
|
I'm a bit confused, now the shift happens at the middle of the screen but the problem persists. See pic.
Have you got a link for me about this behaviour? |
03 February 2020, 13:51 | #6 |
OCS forever!
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
|
Check your A/D ptrs. They should be pointing to the last word of the buffer for desc mode. They look to be pointing one word past that:
Code:
MOVE.L #_DUMMYTXT,BLTDPTH ... DUMMYTXT: INCBIN "dummytxt_320_8_1.raw" DCB.W 8,$5E _DUMMYTXT: Not sure what the dcb.w 8,$5e is? Assuming this dummytxt file is just a 320x8 bitmap that you are trying to scroll off the screen? |
03 February 2020, 14:28 | #7 |
OctaMED Music Composer
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 667
|
no that was a test to add some data at the end and see if I can overcome the problem, that is what generated the extra pixels. Now I removed it but the scroll is still eating the 1 pixel.
|
03 February 2020, 14:42 | #8 |
OCS forever!
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
|
And you changed both the APTH an DPTH lines to _DUMMYTEXT-2?
|
03 February 2020, 14:45 | #9 |
OctaMED Music Composer
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 667
|
no I did change
MOVE.W #8*64+320/16,BLTSIZE to MOVE.W #8*64+336/16,BLTSIZE I was trying to move a larger area with 0s at the end, with no success |
03 February 2020, 15:19 | #10 |
OCS forever!
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
|
Well I just did everything I said and tested it and it works as I expected (assuming I understood what you are trying to do).
Changed BLTALWM to $7fff -2 from _DUMMYTXT in BLTAPTH/DPTH Removed dcb.b 8,$5e Changed all sizes to 320 Edit: Oh and get out of the habit of running your assembler in case-insensitive mode. It's an accident waiting to happen! Also, having constants defined at the top and then using magic numbers in the code also confused me Edit: If you were expecting the text to scroll back in on the right then that's something different. Last edited by Antiriad_UK; 03 February 2020 at 15:32. |
03 February 2020, 15:38 | #11 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,474
|
Just a quick look.
Blitter waits are wrong. |
03 February 2020, 15:40 | #12 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Blitter waits are wrong and why is there a dcb.w $8,$5e right behind your DUMMYTXT? Change this to ds.w 8 and the problem will, most likely, be fixed.
Edit: Looks like Antiriad was faster. However, I'm quite sure there is no need to change the masks or anything else, code should work with just the blitter waits fixed and the dcb.w 8,$5e line corrected. |
03 February 2020, 15:47 | #13 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,474
|
Yep, with blitter wait fixed (and Antiriad fix) the code now works.
Just tested |
03 February 2020, 15:51 | #14 |
OCS forever!
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
|
I can't see what's up with the blitwaits, oh my god what have I missed? My own blitwait macro may be broken. Is it the byte access in a register? Sure I read it was illegal but everyone does it and works ok?
|
03 February 2020, 15:53 | #15 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
|
03 February 2020, 15:54 | #16 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,474
|
|
03 February 2020, 15:55 | #17 |
OCS forever!
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
|
Ahhhhh.
Two mistakes then! |
03 February 2020, 15:57 | #18 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Yep, for the bit of extra fun.
|
03 February 2020, 16:52 | #19 | |
OctaMED Music Composer
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 667
|
eheh no you were fooled by the masking, just like me in the beginning
the problem is still there, if you BLTALWM back to $ffff you can see it. At the end my code will have that mask in but it will have 2 more bytes where I'm going to put the new text in place, 2 chars at the time every 16 frames. It's meant to be a text scroller, so needs to be "dynamic". But when I put some data in those 2 new bytes the very same problem starts again, so in my example I've shown an early version with dummy text which was a better example So what I'm trying to do is a working shift in place first, with the text coming back from the right. Quote:
|
|
03 February 2020, 18:16 | #20 |
OctaMED Music Composer
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 667
|
OH YES, blitter waits below a write... that is wrong!
Btw after fixing that it still scrolls oddly, both with my code and with Antiriad_UK's. As I mentioned, besides my code being crap and confusing you guys, I think the problem is not with masks and pointers but somewhere else. In fact also in this example from Photon/Stingray you can see the very same behaviour. We could be doing the same mistake but it's a bit unlikely... |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Blitter shift BACKWARDS | KONEY | Coders. Asm / Hardware | 3 | 29 January 2020 21:50 |
Blitter Mask shift during copy | LeCaravage | Coders. Asm / Hardware | 6 | 18 March 2018 22:50 |
Mounting real CF eats up a lot of RAM | Amiga1992 | support.WinUAE | 84 | 10 July 2016 20:26 |
mapROM eats too much RAM | alphonsus | support.Hardware | 9 | 10 July 2008 01:16 |
|
|