Omnimaga
Calculator Community => TI Calculators => TI-BASIC => Topic started by: JosJuice on November 10, 2010, 12:51:38 pm
-
The window I prefer to use is the one with 0,0 in the bottom-left corner, since it saves the most space. I used to set it up like this:
:0→Xmin
:0→Ymin
:94→Xmax
:62→Ymax
However, TI-BASIC Dev suggests this instead::ZStandard
:84→Xmin
:72→Ymax
:ZInteger
I don't understand what ZInteger does to create the window I want and why 84 and 72 are used instead of 94 and 62. I used this method for my programs anyway.
However, I've run into a problem now. I'm making a Horiz mode program, and because of this I need the window to be a different size. I tried randomly replacing values in the code in order to get the desired 94/31, and this seems to work::ZStandard
:Horiz
:84→Xmin
:41→Ymax
:ZInteger
Placing the Horiz command later in the code (after ZInteger) does not create the window I want. However, changing the size of the window while Horiz is in effect makes the line between the graphscreen and homescreen flash a bit, which does not look good. Is there any way to solve this without increasing the size of the program? I have no idea of how to make this work, since I don't understand in which way ZDecimal makes every pixel be an integer.
-
Do you want each pixel to be 1 unit? If so, you can do this:
0→Xmin
0→Ymin
1→dY
1→dX
(The dX is delta x where delta is the triangle thing. Same goes for dY)
If you do this in full screen mode, but then you want to have the same effect in split mode, just do the
1→dY
1→dX
thing again and you will be fine.
-
That's what I want to do. However, your method doesn't seem to be smaller than the one I'm currently using, and wouldn't setting dY and dX in Horiz mode make the line flicker, just like the way it does with ZInteger..?
-
It always flickers when you change window sizes, doesn't it? There is a flag set to mark the screen as "dirty" whenever equations are edited or window size is modified, I believe.
And it is slightly smaller that way...
-
Changing window sizes in Full mode with AxesOff makes the flicker happen on a completely white background, which means that the screen will stay white unlike in Horiz mode, in which the line has to be redrawn.
-
And you want a way to change the size without redrawing the line?
-
Yes.
-
That I am not sure can be done in BASIC. I might be able to make a hex code to "undirty" the screen, but that seems like a little much. The code would not be very large, though, if it is what I am thinking.
FDCB0380C9
-
I would prefer to not use Asm in this program, but thanks anyway.
-
Yeah, something like that isn't extreme enough for assembly, but I included it just in case. If you were making use of a library that included ExecHex or something, the opcode would be more useful, but an actual program is a bit extreme, I agree.
-
How many times are you changing the Window settings in your program? Because if it's just once as the calculator goes into horizontal mode then I don't see any issue with it. Or are you saying for when you clear the screen each time you see the flicker and you want to get rid of that? I'm kinda confused about what you want and are doing.
-
Here's how to do it exactly as you want it:
:ZStandard
:84→Xmin
:20→Ymax
:ZInteger
:Horiz
Good luck. :)
-
Here's how to do it exactly as you want it:
:ZStandard
:84→Xmin
:20→Ymax
:ZInteger
:Horiz
Good luck. :)
That doesn't make the y-axis scrollable by one at a time though. That stored negative twenty-six to Ymin and thirty-six to Ymax.
-
Whoops, let's try that again. ;)
:ZStandard
:0→Xmin
:1->_delta_X
:0→Ymin
:30→Ymax
:Horiz
-
This is three bytes smaller ;)
ZStandard
84→Xmin
9→Ymax
ZInteger
0→Ymin
Horiz
-
How many times are you changing the Window settings in your program? Because if it's just once as the calculator goes into horizontal mode then I don't see any issue with it. Or are you saying for when you clear the screen each time you see the flicker and you want to get rid of that? I'm kinda confused about what you want and are doing.
Only when going into Horiz mode.
This is three bytes smaller ;)
ZStandard
84→Xmin
9→Ymax
ZInteger
0→Ymin
Horiz
Awesome! Now I just have to change the coordinates for stuff I'm drawing (shouldn't take more than a few minutes)... The window I used earlier was apparently 1 pixel off :P
-
Seems like it's solved, but
However, TI-BASIC Dev suggests this instead::ZStandard
:84→Xmin
:72→Ymax
:ZInteger
I don't understand what ZInteger does to create the window I want and why 84 and 72 are used instead of 94 and 62. I used this method for my programs anyway.
if you're still wondering, it goes like this:
First, ZStandard sets the coordinates to [-10,10] by [-10,10] (you probably know this).
Then it sets the Xmax and Ymax, which makes the screen [84,10] by [-10,72]. This seems impossible, and if you quit the program then and try to view the graph screen, it gives you an ERR:WINDOW RANGE, as expected. But since the program doesn't display the graph screen right then, you can still play around.
Finally, it runs ZInteger. All ZInteger really does is find the center of the graph and (while keeping it the center) zoom out so that each pixel represents one unit (in other words, ΔX and ΔY each equal 1). To do this, it finds the mean of 84 and 10 (which happens to be 47) and the mean of -10 and 72 (which happens to be 31). If you keep (47,31) the center, it zooms out nicely to [0,92]x[0,62] :)
-
oh, that's why you make it invalid. Otherwise, you would have to store 104 to ymax. Nice.