English Amiga Board


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

 
 
Thread Tools
Old 23 April 2013, 11:34   #1
leonard
Registered User
 
Join Date: Apr 2013
Location: paris
Posts: 24
Clipping line for blitter fill

Hi all,

I'm still working on my blitter filling amiga routine I'm adding clipping. I know blitter is filling from right to left, so you should be carefull when clipping object to the right of the screen. My routine is working on the right edge: sometimes I have to add some vertical lines. Everything is working well.

But, when I try to put my object on the left side of the screen, the fill is broken. I did't add vertical lines for left border, I guess I don't need to. I don't enderstand why it does not work, because my clip routine is not buggy (If I draw wireframe lines, the lines are perfectly cliped on the left border)

Is there something special to do when cliping lines on left border? Where did I miss something?
leonard is offline  
Old 23 April 2013, 12:43   #2
Paradroid
Rock Lobster
 
Join Date: Nov 2012
Location: Macclesfield
Age: 44
Posts: 39
Is it just a single row of pixels that isn't filling correctly? If so it could be a case of it drawing an extra pixel over the left border (and onto the right of your bitplane, which messes up the fill)

if you could post a screen shot maybe one of us will recognise an old bug or past mistake of our own
Paradroid is offline  
Old 23 April 2013, 13:11   #3
leonard
Registered User
 
Join Date: Apr 2013
Location: paris
Posts: 24
I though about it but I did not see any "one" nasty pixel warping to the right border.
I'll post a screen shot tonight, but the effect is VERY similar as if you don't do RIGHT cliping properly (without drawing additional vertical lines).

Last edited by leonard; 23 April 2013 at 15:02.
leonard is offline  
Old 23 April 2013, 17:42   #4
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 818
does the blitter not continue filling on the next horizontal line up if you don't have a left edge pixel?
hooverphonique is online now  
Old 23 April 2013, 18:00   #5
leonard
Registered User
 
Join Date: Apr 2013
Location: paris
Posts: 24
Quote:
Originally Posted by hooverphonique View Post
does the blitter not continue filling on the next horizontal line up if you don't have a left edge pixel?
I don't think so. I though blitter reset its internal "fill bit" state each line. But maybe it's a "mode" I haven't set.
leonard is offline  
Old 23 April 2013, 20:15   #6
Paradroid
Rock Lobster
 
Join Date: Nov 2012
Location: Macclesfield
Age: 44
Posts: 39
Quote:
Originally Posted by hooverphonique View Post
does the blitter not continue filling on the next horizontal line up if you don't have a left edge pixel?
No
Paradroid is offline  
Old 23 April 2013, 21:37   #7
leonard
Registered User
 
Join Date: Apr 2013
Location: paris
Posts: 24
I made some test drawing just one pixel vertical line on the screen and fill it. It appears the fill "wrap" if the line is in the first 16 pixels screen columns. (ex 0,0,0,255)

15,0,15,255 is fucked up too. As soon as the line is (16,0,16,255), everything is ok (the screen is filled at the left of the line). The first column stay black.

I wonder if the problem came from the fact I fill the whole screen width, so maybe the blitter "don't know" my line is over?

Did anyone of you noticed that???

Attached: a vertical line at column 0 (bad fill), and another one at line 17 (working)
Attached Thumbnails
Click image for larger version

Name:	line_x0.png
Views:	221
Size:	3.1 KB
ID:	35171   Click image for larger version

Name:	line_x17.png
Views:	187
Size:	2.7 KB
ID:	35172  
leonard is offline  
Old 23 April 2013, 21:54   #8
Paradroid
Rock Lobster
 
Join Date: Nov 2012
Location: Macclesfield
Age: 44
Posts: 39
there are 101 things that could be going wrong here, but at least it's not a screen full of garbage

My best guess right now is that you've given the blitter the wrong source/dest address for the buffer. The fill works in reverse mode, but you have to make it point at the first word of the buffer that needs filling, so you have to subtract 2 after adding the (width/8)*height offset to the buffer's base address.

Did you do that already?
Paradroid is offline  
Old 23 April 2013, 22:01   #9
leonard
Registered User
 
Join Date: Apr 2013
Location: paris
Posts: 24
Quote:
Originally Posted by Paradroid View Post
Did you do that already?
Oh you got it! I never noticed that Just remove 2 to my adress and it works perfectly

Thanks
leonard is offline  
Old 24 April 2013, 06:42   #10
hannibal
 
Posts: n/a
Oh, and one more tip - I know the filler rubs backwards, but one trick I used to save memory was to sometimes only have 1 front buffer instead of 2, if it was interleaved, and then doing the filling from top right corner instead of bottom right corner (by messing with the modulo). This works without tearing if filling blit starts above the first raster of the object. Sometimes every byte matters
 
Old 24 April 2013, 11:26   #11
leonard
Registered User
 
Join Date: Apr 2013
Location: paris
Posts: 24
Quote:
Originally Posted by hannibal View Post
Oh, and one more tip - I know the filler rubs backwards, but one trick I used to save memory was to sometimes only have 1 front buffer instead of 2, if it was interleaved, and then doing the filling from top right corner instead of bottom right corner (by messing with the modulo). This works without tearing if filling blit starts above the first raster of the object. Sometimes every byte matters
Hannibal I love that kind of trick Really cool. Used a lot of that kind of stuff on ATARI-ST, especially in "fullscreen". ( fullscreen on ATARI is really weird and cool to code. there is nothing like that on AMIGA I guess)
leonard is offline  
Old 25 April 2013, 23:16   #12
Lonewolf10
AMOS Extensions Developer
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 39
Posts: 1,919
Excellent tip Hannibal, I'll make a note of that as I'm sure I'll use in future ASM projects
Lonewolf10 is offline  
Old 27 April 2013, 13:03   #13
Cyprian
Registered User

 
Join Date: Jul 2014
Location: Warsaw/Poland
Posts: 32
Quote:
Originally Posted by leonard View Post
I'm still working on my blitter filling amiga routine
Hey Leonard
are you going to release your great vector demo also for Amiga?

http://www.pouet.net/prod.php?which=1251
http://www.pouet.net/prod.php?which=1575
Cyprian 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 fill timing leonard Coders. Asm / Hardware 42 01 September 2014 12:00
One "hole" in each scan line to turn off blitter nasty? mc6809e Coders. Asm / Hardware 1 03 July 2012 13:12
80 GB HD to fill! fatboy Amiga scene 16 20 July 2011 15:13
Winuae RTG pointer clipping + artifacts smoorke support.WinUAE 6 13 February 2010 15:54
Line mode blitter absence Coders. General 4 25 September 2009 21:50

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 11:30.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.07787 seconds with 14 queries