Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Keoni29 on April 16, 2014, 08:44:44 am

Title: Running axe software on CSE (no gfx)
Post by: Keoni29 on April 16, 2014, 08:44:44 am
Is it possible to run software created with axe on the cse by just changing some stuff in the header of a program?

As a test I created the same program on my CSE and my regular 84+ using asmComp. Then I compared them using a hex editor.
0000 0000: 2A 2A 54 49 38 33 46 2A  1A 0A 00 50 72 6F 74 50  **TI83F* ...ProtP
0000 0010: 72 6F 67 72 61 6D 20 66  69 6C 65 20 30 34 2F 31  rogram f ile 04/1
0000 0020: 36 2F 31 34 2C 20 31 34  3A 33 31 00 00 00 00 00  6/14, 14 :31.....
0000 0030: 00 00 00 00 00 1A 00 0D  00 09 00 06 41 53 4D 54  ........ ....ASMT
0000 0040: 00 00 00 00 0A 00 09 00  07 00 EF 69 3E 03 D3 00  ........ ..´i>.Ë.
0000 0050: C9 A0 04                                          ╔á.
0000 0060:
0000 0070:
0000 0080:


Regular 84+
0000 0000: 2A 2A 54 49 38 33 46 2A  1A 0A 00 50 72 6F 74 50  **TI83F* ...ProtP
0000 0010: 72 6F 67 72 61 6D 20 66  69 6C 65 20 30 34 2F 31  rogram f ile 04/1
0000 0020: 36 2F 31 34 2C 20 31 34  3A 33 33 00 00 00 00 00  6/14, 14 :33.....
0000 0030: 00 00 00 00 00 1A 00 0D  00 09 00 06 41 53 4D 54  ........ ....ASMT
0000 0040: 00 00 00 00 01 00 09 00  07 00 BB 6D 3E 03 D3 00  ........ ..╗m>.Ë.
0000 0050: C9 67 04                                          ╔g.
0000 0060:
0000 0070:
0000 0080:


Mismatches are marked red. The machine code is marked green.


The first mismatch is because of the difference in time ofc. The second, third and fourth ones are more interesting. Those might be a version number/device identifier. The last mismatch is ofc the checksum of the file.

Let me hear what your thoughts are on this.
Title: Re: Running axe software on CSE (no gfx)
Post by: TheMachine02 on April 16, 2014, 10:16:53 am
I guess that even if the program can actually be run on the CSE with those headers modification, screen updating and other drawing command will be totally messed up, cause screen are drasticlly different.
Math only program* may * run fine by the way.
 
Also, I don't know if bcall are the same on the two calc. If not, prepare to enter into crash mode  :P
Title: Re: Running axe software on CSE (no gfx)
Post by: JosJuice on April 16, 2014, 10:29:16 am
Indeed, the first mismatch is just the time inside the comment added by TI-Connect, and the last one is the checksum. The second one is the "version" byte. If it's higher than the OS expects, I think you get an ERR:VERSION. The third one (two bytes) is actually part of the program data itself - the header of an assembly program is different on the CSE. So yes, if you changed the version byte and program header and recalculated the checksum, you can run the code on both calculators. But since there are a lot of differences between the two OSes, such as addresses of bcalls and free RAM areas, it would be hard to write code that works.

EDIT: Oh, it's in Axe. That probably makes it even harder to write OS-independent code, since the low-level routines are provided by Axe instead of written by you.
Title: Re: Running axe software on CSE (no gfx)
Post by: Keoni29 on April 16, 2014, 10:34:49 am
Ah ok. I just wanted to see if my sid dump player works on a CSE without modifying it. I might take out the Disp stuff since those use Bcalls. Handling appvars probably uses bcalls as well, but I will have to test if that still works.

I will disassemble the program I created using axe and change the remaining bcalls. Is there a bcall map available for the CSE yet?
Title: Re: Running axe software on CSE (no gfx)
Post by: JosJuice on April 16, 2014, 10:41:05 am
Ah ok. I just wanted to see if my sid dump player works on a CSE without modifying it.
Probably not, but I guess it's worth a try if you don't mind horrible crashes :)
I will disassemble the program I created using axe and change the remaining bcalls. Is there a bcall map available for the CSE yet?
I know that there are a few bcalls at WikiTI (http://wikiti.brandonw.net/index.php?title=Category:84PCSE:BCALLs:By_Name), but that's definitely not all of them.
Title: Re: Running axe software on CSE (no gfx)
Post by: TIfanx1999 on April 16, 2014, 12:45:51 pm
If it's a program that doesn't require graphics yea. It *might* run, or require very few modifications in order to be able to.
Title: Re: Running axe software on CSE (no gfx)
Post by: Streetwalrus on April 16, 2014, 01:07:23 pm
By the way, what you are trying to do (porting an Axe prog to another z80 calc) has already been done by Matref I think. He ported one of his Axe games to the TI-83.
Title: Re: Running axe software on CSE (no gfx)
Post by: Keoni29 on April 16, 2014, 02:28:16 pm
I just fiddled with some of the headers and got my program to upload and run, but it crashed my calc almost immediately.
Edit: I might write a PC program that takes .8xp and changes the headers so it can be executed on a CSE. In the future it could also look for bcalls and it would replace them with the right ones for the CSE.
Title: Re: Running axe software on CSE (no gfx)
Post by: DJ Omnimaga on April 16, 2014, 02:30:45 pm
It probably depends if there are memory areas that moved around between the 84+ and CSE OSes. That can cause issues if that's the case. Otherwise, only screen related material will be messed up.
Title: Re: Running axe software on CSE (no gfx)
Post by: Keoni29 on April 16, 2014, 02:31:49 pm
Hmm if that is the case I might just start from scratch and write the entire program in z80 asm.
Title: Re: Running axe software on CSE (no gfx)
Post by: Keoni29 on April 16, 2014, 03:22:39 pm
-snip-