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

[theoretical][debate][TI-84+CE]About porting Axe Parser to color calculators

Started by Agothro, January 04, 2015, 06:02:17 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Hayleia

Quote from: DJ Omnimaga on October 11, 2015, 06:22:57 PM
An Axe language for the 84+CE would definitively need a new name, since some stuff would be different (due to screen differences and perhaps different RAM areas forcing code syntax to change a bit).
MaCE :P

novenary

Quote from: DJ Omnimaga on October 11, 2015, 06:22:57 PM
@Streetwalrus While Axe is similar to C in some ways, what made Axe successful is how the graphical commands like Pxl-On() were nearly identical to TI-BASIC.
On the contrary one could argue that Axe looking like TI-BASIC at first sight is confusing for beginners. And in practice it really is, that's why there are endless help threads on Omni with people posting code that works in BASIC but is totally wrong in Axe. When I learned Axe, I was aware it was different and approached it as a totally new language. I had a little bit of ASM experience which helped me a lot understanding some concepts much more than my BASIC knowledge.

For the CSE, relatively few changes are needed to allow Axe to run on them. Mostly OS-related stuff (adapt to the new romcalls) and graphics (new LCD driver, so it needs something like Xlib functions to work).

Axe can be more confusing than C for beginners because C has much stricter syntax, Axe is extremely loose on what it allows as shown by the many hacks that were made. You can write an instruction that is impossible to understand yet it will still do something useful.

I don't think Lua would be interesting on the CE mostly for performance reasons. At best it would be a little faster than hybrid BASIC (not sure how fast the BASIC interpreter is on the CE, but I hope they made it better than the old one). Keep in mind the CE has very limited resources, it's definitely not an Nspire.

Also yes, new name. Completely different thing or not it still won't be Axe, so whatever happens it shouldn't be called Axe. (Ninja-edit: Lol Hayleia, nice name).

Dream of Omnimaga

Well my reasoning is that for many calculator programmers, TI-83+ BASIC is their first ever venture into programming. My guess is that when they stick with TI-BASIC for so long, they gain bad habits of thinking that every other language will work or look the same way, because the syntax is way smaller, probably due to the screen only showing 16x8 characters.

And while Axe works differently than BASIC, some of the syntax allows you to do the same thing on the surface. For example, if you want to erase the screen content then display a pixel at (27,43) coordinate, then all you need to change in Axe is swapping both coordinates then adding a DispGraph command at the end. It,s more the internal stuff overall that is different, like how in BASIC you store stuff into variables, while in Axe they are pointers.

And while I think that Lua would be much slower than ASM/C on the CE, I doubt it would be as bad as hybrid TI-BASIC. Nspire Lua now rivals HP Prime language in speed, after all, and I doubt that xLIBC-enhanced BASIC on the CE will even come close to that (although it will be much faster than on the CSE).



Quote from: Hayleia on October 11, 2015, 06:41:31 PM
Quote from: DJ Omnimaga on October 11, 2015, 06:22:57 PM
An Axe language for the 84+CE would definitively need a new name, since some stuff would be different (due to screen differences and perhaps different RAM areas forcing code syntax to change a bit).
MaCE :P
WalriiCode? :P
  • 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

c4ooo

#48
Quote from: DJ Omnimaga on October 11, 2015, 07:03:36 PM
Well my reasoning is that for many calculator programmers, TI-83+ BASIC is their first ever venture into programming. My guess is that when they stick with TI-BASIC for so long, they gain bad habits of thinking that every other language will work or look the same way, because the syntax is way smaller, probably due to the screen only showing 16x8 characters.

And while Axe works differently than BASIC, some of the syntax allows you to do the same thing on the surface. For example, if you want to erase the screen content then display a pixel at (27,43) coordinate, then all you need to change in Axe is swapping both coordinates then adding a DispGraph command at the end. It,s more the internal stuff overall that is different, like how in BASIC you store stuff into variables, while in Axe they are pointers.
Well, as long as you remember that cars are a number from -2^15-1 to 2^15, and that 2^16-1=-1, and that there is no floating point operations, then you could just program as you would in basic. Albeit you will never get far :P

Originally I considered axe as a faster version of basic, but then I changed my mentality to thinking of it as a slower and less optimized version of assembly, and got better results ;)

Quote from: DJ Omnimaga on October 11, 2015, 06:22:57 PM
An Axe language for the 84+CE would definitively need a new name, since some stuff would be different (due to screen differences and perhaps different RAM areas forcing code syntax to change a bit).
I don't think so. The CE is still pretty similar to 84 :P

Edit:
Quote from: Streetwalrus on October 11, 2015, 06:47:55 PM
Axe can be more confusing than C for beginners because C has much stricter syntax, Axe is extremely loose on what it allows as shown by the many hacks that were made. You can write an instruction that is impossible to understand yet it will still do something useful.

WHLine(Y/8*8-Y+31->E,X/8*8-X+47->D,+9)
WHLine(E+9,D,+9)
WVLine(D,E,+9)
WVLine(D+9,E,+9)

:trollface:

Dream of Omnimaga

#49
Wait, what does WVLine do?

Also by differences over the 84+, I meant the color screen and its resolution. The RAM areas also moved and stuff and the hardware is a bit different, so you can't just take Axe then port it straight to the CE without any modification. It just won't work.


Also with the argument about Axe being more slower than ASM but easier rather than a faster version of BASIC, I see it more as both. People who are serious about programming will go farther than just the BASIC-like syntax, but at least people who just don't want to deal with all the technical stuff can still enjoy the beginner's Axe stuff without any problem. That's what made Axe great IMHO: It reached a much larger audience than TI-BASIC, ASM and C's respective audiences. On top of that, games produced with it reached an audience similar to ASM and C, because most games either required no dependency or just required a shell in order to run, while hybrid BASIC and Grammer games requires an extra app (although the xLIB dependencies are solved with DCS7 and DCSE now, which also includes a shell, so the extra app requirement argument was rendered moot)
  • 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

Yuki

Someone should just make a brand new language similar to Axe but on the color calcs and with most of the benefits Axe has you mentioned.

Do one of such things and you'll be considered a hero in the community.
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

Dream of Omnimaga

IMHO, because such project would be too big for anyone without years of experience in programming, I think that the language should be simple at first, but complete enough to allow arcade games. Axe really started taking off around version 0.0.5. It added sprite support but was still simple. Later, more features can be added. It might be nice also to just keep it simple even late into development too, just so it won't become bloated and take several minutes to compile. It would also remain easy for beginners to learn.
  • 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

Snektron

The fact that there isn't a proper emulator yet doesn't help though <_<
Even an eZ80 emulator would be okay, just SOMETHING to run code on...
I found the simulator in ZDS, but that isn't really great either...
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


novenary

Quote from: DJ Omnimaga on October 12, 2015, 01:02:03 AM
Also by differences over the 84+, I meant the color screen and its resolution. The RAM areas also moved and stuff and the hardware is a bit different, so you can't just take Axe then port it straight to the CE without any modification. It just won't work.
I believe there are more differences than just that. On the CSE it's just a slightly different OS and a new screen, on the CE there is a new CPU so it's probably a very different architecture altogether.

Snektron

Well, it does support z80 mode, and there are rumors its faster in that mode. I don't know if that will be a viable option though. If there will be something for CE it should use the 24 bit capabillities too while its at it.
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


novenary

z80 mode might have more IPC but there are obvious advantages in being able to do 24 bit operations instead of 8/16 bit (a lot of 16 bit stuff requires multi precision on the z80 since it's designed as an 8 bit CPU).

c4ooo

@DJ Omnimaga VLine(x) draws a vertical line from y=0 to y=63 at x. Vline(x,Y1,Y2) draws a vertical from y1 to y2 at x. Repacing 'V' with 'H' will make it draw a horizontal line, and the 'W' or 'I' prefix tells it to draw a white or inverted line.

@ben_g since you wanted to look at obfuscated axe code, this is the most obfuscated thing i have ever written: (note, to prevent confusion hexadecimals are writen with leading "0x")
[spoiler]

Lbl loadlevel
{strSelected}->A
0->M->X->E
While 1
{X+++Y1}->B
!if M
  if B=0xFF
   !if A--
    {str1Levelptr}^r-1->A
    Select({X++++Y1},/16->W*8+52->N) and 0xF->H*8+36->O
   End
  End
ElseIf M=1
  B->{A++}
  !if {A}
   2->M
  End
ElseIf M=2
  if B=0xFF
   A+1-({A}=0xF)->{StrLazers}^r
   Return
  End
Select(B, and 0xF0/16 Parse()) and 0xF
Parse()
End
End
Lbl Parse
->D->{A++}
If E
For(D)
  0->{A}
  A++
End
A-2->A
0->E
Else
!If D
  1->E
End
End
Return

[/spoiler]
It basicly loads and uncompresses the levels in lazer. Its made comfusing becouse it first has to find a pointer to the reqested level, extract width and height data(and pre calculate some stuff), copy the name with excactly, then finaly uncompress the level, which uses 4-bits per tile, plus if there is a zero in the compressed level data, that means that the  next four bits dictate how many air tiles to insert. So yea :P

TheMachine02

Quote from: Streetwalrus on October 12, 2015, 03:18:25 PM
z80 mode might have more IPC but there are obvious advantages in being able to do 24 bit operations instead of 8/16 bit (a lot of 16 bit stuff requires multi precision on the z80 since it's designed as an 8 bit CPU).

z80 mode have more ipc, mainly due to the same 16bit vs 8bit z80 issue and added RAM wait state.
The z80 is initially a (internally) 4 bit processor, calculating natively in 8 bit by doing two math pass. 16 bit use 4 pass, wich is why it is tremdemlousy slow. The ez80 is a (internally) 8 bit processor, using 2 math pass for 16 bits, 3 for 24 bits. 24 is faster than the 16 bits z80, but it still inherit the added TStates. Furthermore, each RAM acess add 4 wait States ( 2 if the acess is in video ram), and 24 bit stuff need 3 acess vs 2 for 16 bit. So yeah. Kinda creppy. Altough the optimization porcess really need a redefinition.


I was kinda interested in programming in ez80 asm, and maybe I will take this project, but don't count on this too much. I want to finish gLib and I need to buy a 83PCE.

Dream of Omnimaga

I wonder if a new Axe language would suffer speed-wise if it was written in C instead of ASM? And thanks c4ooo
  • 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

Lionel Debroux

QuoteI wonder if a new Axe language would suffer speed-wise if it was written in C instead of ASM?
Probably, yes.
While the eZ80's instruction set is somewhat more suitable for C than the original Z80 instruction set, it's far less so than, say, the 68000 and ARM9 instruction sets (let alone newer members of those series), which were designed with C in mind. There's no decent C compiler for the Z80 and eZ80 series, all compilers (including Zilog's) support only old dialects of C and/or generate bad code.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TIEmu and TILP.
Co-admin of TI-Planet.

Powered by EzPortal