Author Topic: Creating .8xp programs (Axe) in Java  (Read 9464 times)

0 Members and 1 Guest are viewing this topic.

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Creating .8xp programs (Axe) in Java
« on: March 26, 2013, 12:36:44 pm »
Does anybody know how to do this?

I am trying to make a program that will convert some stuffs to an Axe program, but I don't know how to create .8xp programs in Java.
I am Bach.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Creating .8xp programs (Axe) in Java
« Reply #1 on: March 26, 2013, 01:42:52 pm »
You should write a tokenizer, then look at DEVPAC8x to make a binary file into an 8xp.

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Creating .8xp programs (Axe) in Java
« Reply #2 on: March 26, 2013, 02:47:17 pm »
tokenizer? I don't know what that is...
I am Bach.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Creating .8xp programs (Axe) in Java
« Reply #3 on: March 26, 2013, 02:48:58 pm »
Basically a text parser that converts your program into tokens (every element in the BASIC editor is 1 or 2 bytes instead of a string, for example Disp is a token).

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Creating .8xp programs (Axe) in Java
« Reply #4 on: March 26, 2013, 02:55:57 pm »
Gotcha!

Java's string manipulation is horrible, but I'll try my best.

* pimathbrainiac wishes he knew perl
I am Bach.

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: Creating .8xp programs (Axe) in Java
« Reply #5 on: March 27, 2013, 11:10:32 am »
perl is really easy to get into, and the benefits of easy string manipulation and extensive regex support would be helpful in a tokenizer to the extent of making it probably more worth your time to learn how to use it and then write the program rather than trying to use java :P

Offline cooliojazz

  • Support Staff
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 619
  • Rating: +66/-9
  • I omnoms on your soul
    • View Profile
    • Unreal Phantasies
Re: Creating .8xp programs (Axe) in Java
« Reply #6 on: March 27, 2013, 11:35:02 am »
would you like the back end from tfe? i already kind of have it almost in a library form (since i was planning on making it a library eventually anyway)
Spoiler For Random signess:
You can not beat my skills.
Trust me.
So don't even try.
And remember never to trust someone who says, "Trust me."

TI File Editor Progress: Remade in java like a boss. 50% we'll call it? IDK =P
Java Libraries: JIRC - 90% JTIF - 5%
TI Projects: Unreal Notator - -5000%
Nomcraft, a Bukkit mod
Some of the music I write can be found here | The Rest Should Be Here (Bandcamp)

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Creating .8xp programs (Axe) in Java
« Reply #7 on: March 27, 2013, 12:43:20 pm »
would you like the back end from tfe? i already kind of have it almost in a library form (since i was planning on making it a library eventually anyway)

Yes please! Is that C/C++, or Java?
I am Bach.

Offline cooliojazz

  • Support Staff
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 619
  • Rating: +66/-9
  • I omnoms on your soul
    • View Profile
    • Unreal Phantasies
Re: Creating .8xp programs (Axe) in Java
« Reply #8 on: March 27, 2013, 02:14:46 pm »
Java. Here is the com.up.ti package. This is the source, so if you can't figure out how to directly use, you can maybe just extract the read/write routines. Or if you need more help using this just ask.  Note: There is the PictureFile class in there, and also a Real class, they arent actually needed for the program stuff, but theres some references that would break if i took them out, so i left them :P (actually, there are quite a few excess classes that are there for multiple file-type stuff. if they really bug you, i can give you a version without them)

To read a file:
Code: [Select]
ProgramFile pf = new ProgramFile();
pf.openFile("Cool File.8xp");
pf.Tokens //String-ization of all the tokens
pf.Name //Program name
//To get a short[] of all the bytes of the program:
pf.ts.stringToData(pf.Tokens);
//To load a custom token set (see the file syntax in the main tfe thread)
short[] temp = pf.ts.stringToData(pf.Tokens);
pf.ts.changeTokens("Custom Tokens.tokens");
pf.Tokens = pf.ts.dataToString(temp);
//Or easier
pf = new ProgramFile();
pf.ts.changeTokens("Custom Tokens.tokens");
pf.openFile("Cool File.8xp");

So have fun!

Also: Credit would be appreciated :P
« Last Edit: March 27, 2013, 02:16:51 pm by cooliojazz »
Spoiler For Random signess:
You can not beat my skills.
Trust me.
So don't even try.
And remember never to trust someone who says, "Trust me."

TI File Editor Progress: Remade in java like a boss. 50% we'll call it? IDK =P
Java Libraries: JIRC - 90% JTIF - 5%
TI Projects: Unreal Notator - -5000%
Nomcraft, a Bukkit mod
Some of the music I write can be found here | The Rest Should Be Here (Bandcamp)

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Creating .8xp programs (Axe) in Java
« Reply #9 on: March 27, 2013, 03:10:39 pm »
Thank you so much!
I am Bach.

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Creating .8xp programs (Axe) in Java
« Reply #10 on: March 28, 2013, 12:32:28 pm »
How do you write a file, exactly? (create a file to write to, I guess)
I am Bach.

Offline cooliojazz

  • Support Staff
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 619
  • Rating: +66/-9
  • I omnoms on your soul
    • View Profile
    • Unreal Phantasies
Re: Creating .8xp programs (Axe) in Java
« Reply #11 on: March 29, 2013, 01:53:17 am »
Like this:

Code: [Select]
ProgramFile pf = new ProgramFile();
pf.Tokens = "YAY! TOKENS!";
pf.Name = "TOKENPRG";
pf.saveFile("Cool File.8xp");
Spoiler For Random signess:
You can not beat my skills.
Trust me.
So don't even try.
And remember never to trust someone who says, "Trust me."

TI File Editor Progress: Remade in java like a boss. 50% we'll call it? IDK =P
Java Libraries: JIRC - 90% JTIF - 5%
TI Projects: Unreal Notator - -5000%
Nomcraft, a Bukkit mod
Some of the music I write can be found here | The Rest Should Be Here (Bandcamp)

Offline LocoPocoBirdy

  • LV0 Newcomer (Next: 5)
  • Posts: 1
  • Rating: +0/-0
    • View Profile
Re: Creating .8xp programs (Axe) in Java
« Reply #12 on: September 07, 2016, 10:03:17 pm »
Sorry to post but I have successfully used your code to create an 8xp decompiler for android. Is it ok if use it? I will definitely credit you.