• Grammer Feature Requests 5 1
Currently:  

Author Topic: Grammer Feature Requests  (Read 42420 times)

0 Members and 1 Guest are viewing this topic.

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer Feature Requests
« Reply #30 on: January 31, 2012, 09:40:49 pm »
1)How do I copy picture to memory address? (I'm pretty sure it can be done with Fill( command but just making sure.)
2)I think I read something about 32 bit number stuff. Are you still planning to implement it?
1) You have a few options. If you have the data in RAM, you can use the Fill( commands. However, since that copies 768 bytes and the OS stores 756 bytes, you might want to do something like this:
Code: [Select]
solve(0,"GPic1","Vt→A
solve(1,A,pi9340,756        ;copies the 756 bytes to the graph screen.
2) Well, I do have some 32-bit stuff in the App, but not fully available in Grammer. However, there is support for multiplication, addition, and subtraction. For example, you can take advantage of Ɵ' in a lot of cases. I know in IRC you wanted to do 32-bit addition and subtraction for things like money in a game:
To perform GG'+B where G is the upper 16-bits and G' is the lower 16-bits:
Code: [Select]
G'+B→G'
G+Ɵ'
If Ɵ'         ;this means 32-bits were exceeded D:
-1→G'         ;This is negative 1, not minus 1
→G
And similarly for subtraction:
Code: [Select]
G'-B→G'
G--Ɵ'       ;this is minus negative Ɵ'
If Ɵ'       ;this means 32-bits were exceeded D:
0→G'
→G

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Grammer Feature Requests
« Reply #31 on: February 02, 2012, 08:50:18 pm »
one more request: able to display 32 bit numbers in decimal.
Sig wipe!

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer Feature Requests
« Reply #32 on: February 02, 2012, 09:00:53 pm »
I can definitely do that, but what command should I use to signify a 32-bit number? (I might use it in other areas, too, such as 32-bit math)

EDIT:Rather, what token?

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Grammer Feature Requests
« Reply #33 on: February 02, 2012, 09:02:47 pm »
maybe u? (2nd+7)
and for reading 32-bit numbers from data, (( might be good. (Unless it's used, that is)
Sig wipe!

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer Feature Requests
« Reply #34 on: February 02, 2012, 09:05:07 pm »
I can do that, I think. Is there any other better tokens to use?

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer Feature Requests
« Reply #35 on: February 04, 2012, 12:25:59 am »
This does not handle 32-bit inputs via math or numbers, but it will display 32-bit numbers by using two variables in a row. For example, if B was FF0Fh and B' was 7BACh, you can display FF0F7BAC by doing this:
Code: [Select]
Text('0,0,BB'
(that will display 4279204780 if my math is correct)

Because of how I coded this, Grammer actually stores intermediate values as 32-bit numbers (but the upper 16-bits are all zeroes). This means that I might need to modify the Fix command to allow for one more mode-- 32 bit mode.

EDIT: Luckily nobody downloaded before I found a bug that I forgot to fix... I forgot to change a byte in the For( command because I changed the routine for locating a variable. It is now fixed :)

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer Feature Requests
« Reply #36 on: February 04, 2012, 10:42:33 am »
Another feature added and also some minor fixes:
you can now use the exponential E ([2nd][,]) to prefix a binary result. This does return 32-bit values for text output and maybe for future use with 32-bit math.

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Grammer Feature Requests
« Reply #37 on: February 04, 2012, 12:31:42 pm »
so now E101 = 5? Great. :D
Sig wipe!

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer Feature Requests
« Reply #38 on: February 04, 2012, 01:37:07 pm »
Yes, exactly :) I am trying to think of what else to add D:

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Grammer Feature Requests
« Reply #39 on: February 04, 2012, 01:38:22 pm »
what you could do is do base E number
so 3E99 means trinary 99.
Sig wipe!

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer Feature Requests
« Reply #40 on: February 04, 2012, 01:41:50 pm »
Right now, the conversion from binary is pretty fast. Converting from an arbitrary base could be pretty slow, though :/ I mean, it is doable, but I would prefer to use some other token so that binary can be read fast.

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer Feature Requests
« Reply #41 on: February 28, 2012, 12:25:55 pm »
After working on this topic (and still failing), I have added a few useful functions. First, e^(n now performs 2^n (and the token hook changes this accordingly). This is a function that will likely remain as I have wished it was included for a while. The next thing I added was probably even more important and useful for many projects-- pixel testing boxes. This is especially useful for collision detection and I plan to add more versions at some point. The method I have added pixel-tests the border of the given rectangular region and returns the number of set pixels. (I plan to add methods for pixel-testing filled regions, as well)

It uses a modifier of pxl-Test( and similar arguments to Line(, so here is an example to check the perimeter of a pixel at (Y,X):
Code: [Select]
pxl-Test('X-1,Y-1,3,3,0    ;0 is the type (test the perimeter)
A value from 0 to 8 will be returned :) I am putting this in Feature Requests because I was wondering what folks thought and if they had similar suggestions before I release it. Also, I still have to work on it a bit more. It works for my purposes, but it still needs to handle screen boundaries better.

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Grammer Feature Requests
« Reply #42 on: February 28, 2012, 06:36:59 pm »
is there a way to display token as according number? (Like comma to 42[iirc] )
Sig wipe!

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Grammer Feature Requests
« Reply #43 on: February 28, 2012, 08:42:24 pm »
To display an ascii char, you do something like:
:Text(0,0,'43

To display a token using the hex value, you can do something complicated like this:
:pi8478→A[(2B00
:Text(0,0,A

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Grammer Feature Requests
« Reply #44 on: February 28, 2012, 09:38:59 pm »
Hmm. I don't remember reading about Text(coord,coord,'Stuff ... D:
I'll try it though. XD
« Last Edit: February 28, 2012, 09:39:07 pm by TBO_Yeong »
Sig wipe!