Drawing lines in ASM

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

Post Reply
User avatar
thegamefreak0134
Extreme Poster
Posts: 455
Joined: Mon 23 Jan, 2006 10:09 pm
Location: In front of a Computer, coding
Contact:

Drawing lines in ASM

Post 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
I'm not mad, just a little crazy.

DarkNova - a little side project I run.
chickendude
Extreme Poster
Posts: 340
Joined: Fri 07 Jul, 2006 2:39 pm

Post by chickendude »

Needs edges? What do you mean? Like doesn't continue all the way across the screen?
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

like using a bitmask to avoid having to extend a line to fill a byte?
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post 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
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
chickendude
Extreme Poster
Posts: 340
Joined: Fri 07 Jul, 2006 2:39 pm

Post 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.
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post 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).
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
CoBB
MCF Legend
Posts: 1601
Joined: Mon 20 Dec, 2004 8:45 am
Location: Budapest, Absurdistan
Contact:

Post 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.
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post 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.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
thegamefreak0134
Extreme Poster
Posts: 455
Joined: Mon 23 Jan, 2006 10:09 pm
Location: In front of a Computer, coding
Contact:

Post 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
I'm not mad, just a little crazy.

DarkNova - a little side project I run.
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

The new grayscale package is completely flickerless.
Image
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post 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.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
Patori
Maxcoderz Staff
Posts: 1479
Joined: Sat 18 Dec, 2004 3:51 am
Location: Toledo, Ohio, USA

Post 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...
Currently coming up with a new signature idea... since my forum avatar changer was killed by an upgrade...
Post Reply