English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 03 February 2020, 13:51   #1
KONEY
OctaMED Music Composer

KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 45
Posts: 419
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?
Attached Thumbnails
Click image for larger version

Name:	052.png
Views:	37
Size:	9.6 KB
ID:	66081  

Last edited by KONEY; 03 February 2020 at 14:16.
KONEY is offline  
Old 03 February 2020, 14:02   #2
Antiriad_UK
OCS forever!

Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 170
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
If not, then show some code

Last edited by Antiriad_UK; 03 February 2020 at 14:11.
Antiriad_UK is offline  
Old 03 February 2020, 14:15   #3
KONEY
OctaMED Music Composer

KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 45
Posts: 419
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!
KONEY is offline  
Old 03 February 2020, 14:19   #4
Antiriad_UK
OCS forever!

Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 170
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
to

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
Antiriad_UK is offline  
Old 03 February 2020, 14:39   #5
KONEY
OctaMED Music Composer

KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 45
Posts: 419
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?
Attached Thumbnails
Click image for larger version

Name:	053.png
Views:	141
Size:	3.3 KB
ID:	66082  
KONEY is offline  
Old 03 February 2020, 14:51   #6
Antiriad_UK
OCS forever!

Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 170
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:
So ptr should be _DUMMYTEXT-2.

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?
Antiriad_UK is offline  
Old 03 February 2020, 15:28   #7
KONEY
OctaMED Music Composer

KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 45
Posts: 419
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.
KONEY is offline  
Old 03 February 2020, 15:42   #8
Antiriad_UK
OCS forever!

Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 170
And you changed both the APTH an DPTH lines to _DUMMYTEXT-2?
Antiriad_UK is offline  
Old 03 February 2020, 15:45   #9
KONEY
OctaMED Music Composer

KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 45
Posts: 419
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
KONEY is offline  
Old 03 February 2020, 16:19   #10
Antiriad_UK
OCS forever!

Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 170
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.
Attached Files
File Type: s KNY_LOGOBMP2X_BLIT3.s (10.2 KB, 10 views)

Last edited by Antiriad_UK; 03 February 2020 at 16:32.
Antiriad_UK is offline  
Old 03 February 2020, 16:38   #11
ross
Per aspera ad astra

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 49
Posts: 2,422
Just a quick look.

Blitter waits are wrong.
ross is offline  
Old 03 February 2020, 16:40   #12
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,309
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.
StingRay is offline  
Old 03 February 2020, 16:47   #13
ross
Per aspera ad astra

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 49
Posts: 2,422
Yep, with blitter wait fixed (and Antiriad fix) the code now works.
Just tested
ross is offline  
Old 03 February 2020, 16:51   #14
Antiriad_UK
OCS forever!

Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 170
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?
Antiriad_UK is offline  
Old 03 February 2020, 16:53   #15
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,309
Quote:
Originally Posted by antiriad_uk View Post
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?
dmaconr = $02.
StingRay is offline  
Old 03 February 2020, 16:54   #16
ross
Per aspera ad astra

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 49
Posts: 2,422
Quote:
Originally Posted by Antiriad_UK View Post
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?
A write to BLTDPT before the wait .
ross is offline  
Old 03 February 2020, 16:55   #17
Antiriad_UK
OCS forever!

Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 170
Ahhhhh.

Two mistakes then!
Antiriad_UK is offline  
Old 03 February 2020, 16:57   #18
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,309
Yep, for the bit of extra fun.
StingRay is offline  
Old 03 February 2020, 17:52   #19
KONEY
OctaMED Music Composer

KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 45
Posts: 419
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:
Originally Posted by Antiriad_UK View Post
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.
KONEY is offline  
Old 03 February 2020, 19:16   #20
KONEY
OctaMED Music Composer

KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 45
Posts: 419
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...
Attached Files
File Type: s Tut15.S (6.2 KB, 9 views)
KONEY is offline  
 


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 22:50
My 360 controller eats USB cords? BullyDog OT - Gaming 10 27 July 2018 01:54
Blitter Mask shift during copy LeCaravage Coders. Asm / Hardware 6 18 March 2018 23:50
Mounting real CF eats up a lot of RAM Akira support.WinUAE 84 10 July 2016 21:26
mapROM eats too much RAM alphonsus support.Hardware 9 10 July 2008 02:16

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:00.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.09265 seconds with 16 queries