Join us on Discord!
You can help CodeWalrus stay online by donating here.

[TI-84+CE] ICE Compiler

Started by PT_, March 25, 2016, 08:14:17 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Dream of Omnimaga

Glad this has resumed. I was getting a bit worried it bit the dust like most other custom language projects. Make sure the GUI is simple so that it doesn't take too much space. Are the auto-opt like Axe's? And sorry you still have issues implementing custom tokens. By the way, will custom tokens work on calculators that don't have ICE installed?

Sprite() is definitively one I am looking forward to :3=
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

PT_

Quote from: DJ Omnimaga on August 11, 2016, 04:54:18 PM
Glad this has resumed. I was getting a bit worried it bit the dust like most other custom language projects. Make sure the GUI is simple so that it doesn't take too much space. Are the auto-opt like Axe's? And sorry you still have issues implementing custom tokens. By the way, will custom tokens work on calculators that don't have ICE installed?

Sprite() is definitively one I am looking forward to :3=
I don't know how Axe has implemented auto-opt, but the first post I read was that he says auto-opt for multiplication was very hard. He only has the standard case, while I have already the easy cases for *2 etc, so I don't need to optimize it even. I will focus me more on the combination of code snippets, as you can see in the example :)
Yes, custom tokens will just replace standard, unused in ICE programs, tokens, so no problem  :thumbsup:

Dream of Omnimaga

There is a text file in the zip file that shows some auto-ops. :)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

PT_

It's time for maybe the biggest update ever of ICE. As you all know, it can only handle 8-bit integers, and is pretty limited to only variables and numbers, not strings, not lists, a very few functions, no arguments for a function. So it's time for a giant update. Since I at least need to change the whole algorithm to handle 3-byte integers, I thought it would be useful to change the whole stuff, so that
1) lists(functions) are supported
2) strings(functions) are supported
3) easy way to add functions
4) correct handling of arguments, even lists or strings
The giant update means too a giant increasing size... I still need to have all the code for adding, subbing, dividing etc, but now even more. For the interesting part: here are all the possibilities that should be supported, for adding:
- <integer> <integer>
- <integer> <variable>
- <integer> <list>
- <integer> <function>
- <variable> <integer>
- <variable> <variable>
- <variable> <list>
- <variable> <function>
- <list> <integer>
- <list> <variable>
- <list> <list> (even not the same dimension)
- <list> <function>
- <string> <string> ("ABC"+"DEF" -> "ABCDEF"

Interesting, not? :P
This would mean a giant update, and that takes much time, but if this is finished, adding new stuff is peanuts. I hope you don't blame me, as this is very useful. Also, university starts next week, so I doubt if I have enough time.... I will continue this! :)

@DJ Omnimaga : mines are better :trollface:

Dream of Omnimaga

List support is definitively a nice addition IMHO. It makes it easier for data management and tilemap storage. Glad to see new progress :)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

PT_

Thanks! :D

GUI almost done:


Dream of Omnimaga

Looks simple and good. :)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

PT_

Another big problem is fixed: custom tokens. Now it finally works fine!



The code is so complicated you don't want to see it :P
I had 2 possibilities: either locating the hooks at a fixed point in RAM, or create my own appvar, and insert them. I chose the last option, because compiled ICE programs can use all the RAM, and I suffer what will happen when one accidentally overwrites the hooks. So, each time I start ICE, it checks if it exists, remove it if necessary and create an appvar with the hooks in it. Then it archives it, so it's a bit harder to delete it, and if you delete it from the memory management, it still exists. The main problem is, that you now don't know what the starting memory of the hooks is, for relative jumps/whatever. So yeah, it seems I fixed it, and I'm pretty happy with it ^^ :D

Now that I have fixed the main structure, is it pretty easy to add new tokens.

E37

It looks really awesome!
What arguments does Sprite( take?
It's really neat to see the project come this far!
Good luck  :D
  • Consoles, mobile devices and vintage computers owned: Ti83,Ti84!
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert $37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

PT_

Yet nothing :trollface:
In the future, it would look like Sprite(x,y,width,height,data) for example. I'm not sure though, because these 'tokens' doesn't work currently.

Dream of Omnimaga

#190
Question @PT_ : If you try to send an ICE program source code to the computer and it uses the Sprite() command, can you send it back to the calculator afterwards without any problem and code corruption? And can SourceCoder open the code? I am curious because on early versions of Omnicalc (version 1.00 through 1.10), programs that contained the Sprite() command or other Omnicalc ones could not be transfered between calculators unless grouped, and if you tried opening the source code on a calculator that doesn't have Omnicalc hooks installed, then the calculator crashed with a RAM Clear or displayed junk instead of code. Something to note also is that those versions of Omnicalc only ran on OS 1.13 and 1.14, not 1.15 and higher.

Anyway I like how this is coming along. I can't wait until that sprite command actually displays sprites :)

IMHO I think the sprite command should be as simple as possible (as in, as few arguments as possible). For example, Sprite(X,Y,zoom,pointer). That way it's easier to remember.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

PT_

Quote from: DJ Omnimaga on August 24, 2016, 01:44:47 AM
Question @PT_ : If you try to send an ICE program source code to the computer and it uses the Sprite() command, can you send it back to the calculator afterwards without any problem and code corruption? And can SourceCoder open the code? I am curious because on early versions of Omnicalc (version 1.00 through 1.10), programs that contained the Sprite() command or other Omnicalc ones could not be transfered between calculators unless grouped, and if you tried opening the source code on a calculator that doesn't have Omnicalc hooks installed, then the calculator crashed with a RAM Clear or displayed junk instead of code. Something to note also is that those versions of Omnicalc only ran on OS 1.13 and 1.14, not 1.15 and higher.

Anyway I like how this is coming along. I can't wait until that sprite command actually displays sprites :)

IMHO I think the sprite command should be as simple as possible (as in, as few arguments as possible). For example, Sprite(X,Y,zoom,pointer). That way it's easier to remember.
Yes, the custom tokens are a replacement of existing tokens. Well, 'tokens'. They replace VERY unnecessary tokens such as 'Á' etc, or Î. So if you send the ICE program to your computer, it won't crash, no weird tokens (Á is not weird :P). Maybe ICE support could be implemented in SourceCoder, need to speak with Kerm about that though. Sending an ICE program to another calculator also doesn't mind. If it has ICE installed, the tokens are displayed right, and if not, just Á or so.
You need to run ICE at least once to install the tokens.

Dream of Omnimaga

Oh I see. I thought the custom tokens were brand new tokens, which were known on older calcs as illegal tokens. Good move to use the less used tokens by the way, although I wonder if that makes them harder to find in Catalog. Does ICE sort the Catalog menu?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

PT_

Quote from: DJ Omnimaga on August 24, 2016, 07:45:03 AM
Oh I see. I thought the custom tokens were brand new tokens, which were known on older calcs as illegal tokens. Good move to use the less used tokens by the way, although I wonder if that makes them harder to find in Catalog. Does ICE sort the Catalog menu?
No. The accented letters are not accessable through the Catalog, but if you press [TRACE] in the program editor, you will get the menu with my custom tokens. You can also install at least the Dutch OS, because there are the accented letters accessable. I dunno how that will look like though :trollface:

PT_


Powered by EzPortal