Post Reply 
(42S) challenge: repeat a character N times
01-17-2018, 01:54 PM
Post: #10
RE: (42S) challenge: repeat a character N times
(01-17-2018 12:56 PM)Werner Wrote:  The 'best' way to draw multiple pixels at a time is (I think - but I may be wrong, as I was in the use of XTOA above) using AGRAPH with as many characters as possible in the Alpha register, up to 44. So, if you want to draw a line of 40 pixels, you need to duplicate the character you want to draw 40 times.

Cheers, Werner

I agree for some applications. AGRAPH is best if you are drawing any shape bigger than a 1x1 pixel over and over again including line segments. I think the longest horizontal line you can draw is 44 pixels long with AGRAPH because each character in the alpha register is an encoded column.

PIXEL's secondary use is to draw straight lines. In this case, you don't want a horizontal line to the edges of the display , but PIXEL's line drawing is quite efficient.

Now, I found that fiddling with XTOA and the question of looping might be over-complicating things if the objects to be drawn are known ahead of time and there are only a couple of discreet options. It might be simpler to recall the pre-stored alpha string you need based on what needs to be drawn. But if you need a continuum of possible shapes/lengths, looping XTOA makes sense.

And, I'll echo Thomas' point. Drawing one pixel at a time becomes very intensive at 400x240.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (42S) challenge: repeat a character N times - revwillie - 01-17-2018 01:54 PM



User(s) browsing this thread: 5 Guest(s)