Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: Raylin on September 04, 2010, 10:20:49 pm
-
How would one display a fullscreen 3 level grey image on the screen in Axe?
-
Not sure what you mean ... do you just want black, white, and gray? In that case:
You have to keep displaying it, since grays in Axe (and ASM) is basically just really fast-flipping pixels, so put DispGraphrr in a loop. To get a black pixel, just make sure that pixel's turned on in the buffer (basically, all drawing commands do this). To get a gray, you have to leave the buffer off but turn on the pixel in the back-buffer (usually, it's the drawing command followed by a r. To get white, leave them both white (duh).
-
Nonono. I have fullscreen hex images. How do I display them on the screen?
-
What format are the 3-level gray images in? (other than hex, that's already been established)
-
Try this:
Copy(A,L6,768)
Copy(B,L3,768)
Repeat getkey(15)
DispGraphr
End
Replace "A" with a pointer to the picture in the front layer, and "B" with a pointer to the picture in the back layer. They can either be in the program code itself (pic absorption or hex code) or they can be pointing to an OS pic in ram or even archive if you use a file variable instead of the pointer.
-
Oh, to move a static picture to the back-buffer, it's Copy([pointer to your picture],L3. To move it to the buffer, it's L6 instead of L3.
EDIT: Ninja'd by Quigibo, read his :)
-
You. Are. A. Lifesaver.
-
Hello.
-
What format are the 3-level gray images in? (other than hex, that's already been established)
In two separate image (or sprite/tile). First layer is transparent (using the white) and black and second layer is white and gray, appearing behind. Everytime DispGraphr is used, the checkered pattern (Reuben Quest-like) for the gray alternates. If it alternates at the right speed, it creates grayscale that is nearly flickerless.
For 4-lv grayscale, you just use DispGraphrr instead, but the rest of the code is similar. In 4-lv, one of the pic is dark gray and white while the other is light gray and white. Combining light gray with dark gray gives black.