Page 1 of 1

Drawing lines in ASM

Posted: Mon 14 Aug, 2006 2:20 pm
by thegamefreak0134
I know that you can use bios calls to draw lines to the screen. However, I need to draw lines in an asm prigram running greyscale, so I really don't need to draw to the screen, but the graph buffers. (possibly twice to achieve black rather than grey. Is there an easy way to do this?

If I will end up needing to code something, the line gets to be either horizontal or vertical, but still needs to have edges. (Not like the basic versions of these commands. <shudder>)

Thanks!

-gamefreak

Posted: Mon 14 Aug, 2006 2:54 pm
by chickendude
Needs edges? What do you mean? Like doesn't continue all the way across the screen?

Posted: Mon 14 Aug, 2006 3:04 pm
by King Harold
like using a bitmask to avoid having to extend a line to fill a byte?

Posted: Mon 14 Aug, 2006 3:28 pm
by tr1p1ea
There are a few good line drawing routines on ticalc.org. There is a really nice one by CoBB which can be found here: http://www.ticalc.org/archives/files/fi ... 23429.html

Posted: Mon 14 Aug, 2006 3:43 pm
by chickendude
Although I'm sure a routine that just handles horizontal/vertical routines could be quicker and smaller. Also, I believe CoBB's is designed for speed, so if speed isn't a necessity you could opt for a routine that's smaller but slower.

Posted: Mon 14 Aug, 2006 3:52 pm
by tr1p1ea
Well you can set a system flag that will make TIOS line romcalls to draw to the buffer instead of the screen. I think the flag is bufferOnly, (IY + plotFlag3).

Posted: Mon 14 Aug, 2006 4:46 pm
by CoBB
Actually, Jim e has a faster version, which is however somewhat bigger. I think mine is nearly as compact as you can get besides having a decent speed, so it's rather optimised for size in my opinion.

Posted: Mon 14 Aug, 2006 4:50 pm
by tr1p1ea
I know Jim e's is faster, but you already mentioned that his method was the only way it could be faster ... but at the size expense, i dont think its worth it.

Posted: Mon 14 Aug, 2006 8:53 pm
by thegamefreak0134
Hmm... I'm liking this flag idea. I also had a minor thought that may or may not work. I noticed that the greyscale package sort of "ghosts" anything on-screen, but that it goes away if you clear the buffers. Do you suppose that just using the bios calls normally on a white background would produce the effect?

I want to try this buffer idea out though. I see the flag, but how do you tell it what buffer to draw to? I would need to do the draw twice, one for each buffer. Also, can this be applied to text as well?

-gamefreak

Posted: Mon 14 Aug, 2006 9:29 pm
by threefingeredguy
The new grayscale package is completely flickerless.

Posted: Tue 15 Aug, 2006 2:32 am
by tr1p1ea
You must remember that even the quality of RGP is still calc specific. It may be flickerless on your calc, but not on someone elses.

Posted: Tue 05 Sep, 2006 4:06 pm
by Patori
tr1p1ea wrote:There are a few good line drawing routines on ticalc.org. There is a really nice one by CoBB which can be found here: http://www.ticalc.org/archives/files/fi ... 23429.html
This is the one I use...