Author Topic: Setting Xmin, Xmax, Ymin et.c  (Read 3901 times)

0 Members and 1 Guest are viewing this topic.

Offline SamTebbs33

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 16
  • Rating: +0/-0
    • View Profile
Setting Xmin, Xmax, Ymin et.c
« on: January 18, 2014, 11:43:16 am »
Hi!

Is it at all possible to change Xmin, Xmax, Ymin, Ymax, Xscl and Yscl from within an Axe program? I have tried several methods such as GetCalc("varXmin") but none seem to be doing what I need, is it at all possible and if so, what am I doing wrong?

Thanks!

Offline ClrDraw

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 627
  • Rating: +61/-2
    • View Profile
    • GitHub
Re: Setting Xmin, Xmax, Ymin et.c
« Reply #1 on: January 18, 2014, 12:16:33 pm »
IDK, sorry :( I tried several methods too but couldn't get it. Why do you need to do that in an Axe program?
Visit my GitHub for all my TI programs as well as other projects.
Also check out my website.

Offline SamTebbs33

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 16
  • Rating: +0/-0
    • View Profile
Re: Setting Xmin, Xmax, Ymin et.c
« Reply #2 on: January 18, 2014, 12:27:18 pm »
I'm trying to draw a shape using lines but I can't change the variables, so I'm stuck with very little space to draw with (-10 to 10)

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Setting Xmin, Xmax, Ymin et.c
« Reply #3 on: January 18, 2014, 12:28:52 pm »
Oh, no, on axe you have coordinates from 0-95 in x and 0-63 in y direction, so you can draw all that stuff without having to change xmin etc

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Setting Xmin, Xmax, Ymin et.c
« Reply #4 on: January 18, 2014, 12:29:19 pm »
Someone will have to translate this to Axe, but those variables are stored at constant addresses. To see the addresses, CTRL + F "Xmin" on this page (it's the 5th instance).

I'm going to assume that GetCalc() returns the address of the variable, so using Xmin is probably as easy as replacing GetCalc() with 0x8F50.

Edit:
   I don't know if the goal of this thread is actually to change Xmin anymore, but, if anyone wants to do it.

####AXE####
:E8F50->A
:1337->float{A}

This will store 1337 to Xmin
« Last Edit: January 18, 2014, 12:41:05 pm by thepenguin77 »
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline ClrDraw

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 627
  • Rating: +61/-2
    • View Profile
    • GitHub
Re: Setting Xmin, Xmax, Ymin et.c
« Reply #5 on: January 18, 2014, 12:35:23 pm »
Quote
Oh, no, on axe you have coordinates from 0-95 in x and 0-63 in y direction, so you can draw all that stuff without having to change xmin etc
Sorunome's right, you don't need to change xmin in Axe. instead of a 10 by 10 grid, the screen is set up (like the basic text command) so that you program what pixel to draw the line on not what coordinate.
« Last Edit: January 18, 2014, 12:35:45 pm by ClrDraw »
Visit my GitHub for all my TI programs as well as other projects.
Also check out my website.

Offline SamTebbs33

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 16
  • Rating: +0/-0
    • View Profile
Re: Setting Xmin, Xmax, Ymin et.c
« Reply #6 on: January 18, 2014, 02:00:48 pm »
Thanks guys! I didn't know that the screen dimensions were preset to exactly what I wanted them to be! :)

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Setting Xmin, Xmax, Ymin et.c
« Reply #7 on: January 18, 2014, 02:53:11 pm »
Also, as a note, this is how the coordinate system works at the hardware and assembly level. TI-BASIC converts coordinates for all of its drawing commands to pixel coordinates which takes up a lot of time. This is nice for math purposes, but inefficient for graphics.

To give you an idea, you could probably draw a line in Axe a few dozen times in the time TI-BASIC can draw a single Pt-On( command since it has to convert the inputs, then transform the inputs into pixel coordinates, then it converts those float values to integers that can actually be used directly, then it uses those coordinates to a pixel location and plots it. Axe only needs to do the last step (which is the fastest one).

Offline ClrDraw

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 627
  • Rating: +61/-2
    • View Profile
    • GitHub
Re: Setting Xmin, Xmax, Ymin et.c
« Reply #8 on: January 18, 2014, 03:17:39 pm »
Oh ti, what were they thinking!  ::)
Visit my GitHub for all my TI programs as well as other projects.
Also check out my website.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Setting Xmin, Xmax, Ymin et.c
« Reply #9 on: January 18, 2014, 03:38:33 pm »
Also, as a note, this is how the coordinate system works at the hardware and assembly level. TI-BASIC converts coordinates for all of its drawing commands to pixel coordinates which takes up a lot of time. This is nice for math purposes, but inefficient for graphics.

To give you an idea, you could probably draw a line in Axe a few dozen times in the time TI-BASIC can draw a single Pt-On( command since it has to convert the inputs, then transform the inputs into pixel coordinates, then it converts those float values to integers that can actually be used directly, then it uses those coordinates to a pixel location and plots it. Axe only needs to do the last step (which is the fastest one).
Also, in BASIC the LCD is updated on every line/pixel command, while in Axe you choose if you want the LCD updated or not during drawing. Updating everytime causes flicker in some cases and it's much slower.

Offline ClrDraw

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 627
  • Rating: +61/-2
    • View Profile
    • GitHub
Re: Setting Xmin, Xmax, Ymin et.c
« Reply #10 on: January 18, 2014, 05:46:03 pm »
Quote
Also, in BASIC the LCD is updated on every line/pixel command, while in Axe you choose if you want the LCD updated or not during drawing. Updating everytime causes flicker in some cases and it's much slower.
Back when I did BASIC I hated that so much...
Visit my GitHub for all my TI programs as well as other projects.
Also check out my website.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Setting Xmin, Xmax, Ymin et.c
« Reply #11 on: January 18, 2014, 06:37:25 pm »
Quote
Also, in BASIC the LCD is updated on every line/pixel command, while in Axe you choose if you want the LCD updated or not during drawing. Updating everytime causes flicker in some cases and it's much slower.
Back when I did BASIC I hated that so much...
That is what i found so awesome when i found xLib, the whole update LCD stuff :)

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!