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 2 Guests are viewing this topic.

PT_

Quote from: Cumred_Snektron on June 28, 2016, 04:36:32 PM
Quote from: PT_ on June 28, 2016, 04:03:46 PM
I interpreted his post as "loads the time into register a, and then call a function (address) that pauses a ms". That way you only need to load values in a and call that function when you have more Pauses.
I've zero experience with interrups, so I doubt I will ever implement it  >B)
And yes, when going into 8bpp mode, whenever I will make that possible, the xLIBCE palette is automatically loaded. You should be possible to change an entry of the palette though.

I meant like the setInterval method in Javascript, it could be done without interupts as a loop that waits untill a certain time has passed.

Too bad its still not open source. I'd love to help to implement some commands.
1) That actually sounds like a good idea, but I've serious no idea about how to do that. Maybe you can explain me some about interrups/give links and/or a code example? :)
2) I've said multiple times ICE v1.1 would be open-source. Once it's ready I will upload it to GitHub, of course with a good license to prevent misuse.


Quote from: DJ Omnimaga on June 28, 2016, 04:45:35 PM
While the community is less active overall now than it was when the first versions of Axe came out, as soon as Axe got sprites and getkey support Axe language popularity really took off. I think the first ICE release that supports those should include some mini-game examples, including a space shooter (at least 1v1 battles with just 1 stage), to showcase what the language can do. Many people learn from code examples. But you would also obviously need a list of all commands like with Axe.

I don't know if ICE will be as popular but if well-documented like Axe and stuff, it should eventually have a decent fanbase.
I will include a small program with every version of ICE I upload. I believe I already did with the current version, but I'm not sure. And yes, I gonna write a small website with all the commands. About the well-documentation. XD I'm not the person who can describe it very well, and my English is bad, so yeah... haha



Other notes: I've tried to implement Input <variable> and this is my code:
call _ClrScrn
call _HomeUp
ld hl, 0003D<variable>h
ld (ioPrompt), hl ; "A=", 0
xor a, a
ld (curUnder), a
call _GetStringInput
ld hl, (editSym)
call _VarNameToOP1HL
call _ChkFindSym
ex de, hl
ld b, (hl)
inc hl
ld e, 0
Loopppp:
inc hl
ld a, (hl)
ld d, 10
mlt de
sub a, 030h
add a, e
ld e, a
djnz Loopppp
ld (ix+<variable>), e
jp _DeleteTempEditEqu

which is, if I'm right 62 bytes and insane cycles. Is it worth/can someone make it smaller? Thanks!

Another note: what do you guys thing about IS>(<variable>) and DS<(<variable>) for incrementing/decrementing variables?

Snektron

#121
Quote from: PT_ on June 28, 2016, 05:12:01 PM
Quote from: Cumred_Snektron on June 28, 2016, 04:36:32 PM
Quote from: PT_ on June 28, 2016, 04:03:46 PM
I interpreted his post as "loads the time into register a, and then call a function (address) that pauses a ms". That way you only need to load values in a and call that function when you have more Pauses.
I've zero experience with interrups, so I doubt I will ever implement it  >B)
And yes, when going into 8bpp mode, whenever I will make that possible, the xLIBCE palette is automatically loaded. You should be possible to change an entry of the palette though.

I meant like the setInterval method in Javascript, it could be done without interupts as a loop that waits untill a certain time has passed.

Too bad its still not open source. I'd love to help to implement some commands.
1) That actually sounds like a good idea, but I've serious no idea about how to do that. Maybe you can explain me some about interrups/give links and/or a code example? :)

i don't really know how to get the current time on the CE, so i will write it down in pseudocode:

while enabled do
    time = timemillis() + interval
    routine() // the routine that needs to be called on interval
    while timemillis() < time
    end
end


though i think some problems might occur when the time number overflows back to zero
You could probably do it with interrupts too, but i don't really know how :(
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


PT_

Quote from: Cumred_Snektron on June 28, 2016, 07:11:29 PM
i don't really know how to get the current time on the CE, so i will write it down in pseudocode:

while enabled do
    time = timemillis() + interval
    routine() // the routine that needs to be called on interval
    while timemillis() < time
    end
end

though i think some problems might occur when the time number overflows back to zero
You could probably do it with interrupts too, but i don't really know how :(
That's basically just this:
Repeat 0/While 1
  <routine>
  ld a, <interval>
  <pause routine>
End

Any thoughts on my other notes?

Dream of Omnimaga

Regarding a website with all the commands, IMHO you should have a backup alternative, such as an HTML or text file listing and explaining all commands that is included with ICE zip file. Otherwise, what happens if your website shut down in a few years? All documentation becomes gone. If you want, I could make a sub-forum for this project where you could post a copy of the commands list, but even then  you should still include an offline copy inside the zip file like with Axe Parser, for the sake of posterity in case one day something bad happened to CW (eg data loss).

It's fine if the commands are not explained in the best English quality. People will understand and help you clarify if needed anyway.
  • 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

Quote from: PT_ on June 28, 2016, 07:34:52 PM
Quote from: Cumred_Snektron on June 28, 2016, 07:11:29 PM
i don't really know how to get the current time on the CE, so i will write it down in pseudocode:

while enabled do
    time = timemillis() + interval
    routine() // the routine that needs to be called on interval
    while timemillis() < time
    end
end

though i think some problems might occur when the time number overflows back to zero
You could probably do it with interrupts too, but i don't really know how :(
That's basically just this:
Repeat 0/While 1
  <routine>
  ld a, <interval>
  <pause routine>
End

Any thoughts on my other notes?

Not really, since the time of route + timeout needs to be qual to the interval. I guess if pause can take a variable as argument it wouldnt be soo hard, but i think in axe it could only use literals
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


PT_

Quote from: Cumred_Snektron on June 29, 2016, 10:00:55 AM
I guess if pause can take a variable as argument it wouldnt be soo hard, but i think in axe it could only use literals
Yes, you can pause anything you want, even Pause getKey, Pause A+B*C, Pause 5-3 and in the future like Pause max(A+B,3)

Dream of Omnimaga

Cool to hear. That will be handy :)
  • 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_

Basically, all that commands, like Disp, Pause and all the future functions like sin( for example, just parses the expression what comes after. If that is just "getKey", it will be getKey. It's not like you are restricted to only numbers or so.

Dream of Omnimaga

YEah and that's good. I think I recall some languages or commands that only allowed constant values, such as RecallPic in TI-BASIC. This is kinda restrictive.
  • 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_

I gonna change the compiling a bit. It now builds the compiled program at D407DF or so :P, but it's much easier if that actually starts at UserMem, for jumps. But because ICE will be runned from UserMem, I need to jump to ICE in RAM, and clear the space after UserMem. No problem though, but I hope it's possible :)

Dream of Omnimaga

By UserMem, do you mean the 150 KB of user RAM available on the calculator? I am curious if ICE will be able to use SafeRAM areas for data storage like Axe did, such as temporary tilemap data?
  • 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

Ti64CLi++

I wait the 1.1 version :D
  • Calculators owned: TI-Nspire CX CAS, TI-Nspire CX, TI-Nspire, TI-Nspire CAS TouchPad, TI-Nspire CAS, TI-Nspire, TI-Voyage 200, TI-92 Plus, TI-89 Titanium, TI-89, TI-83 Premium CE, TI-84 Plus CE, TI-82 Advanced, TI-84 Pocket.fr, TI-84 Plus Silver Edition, TI-84 Plus, TI-83 Plus Silver Edition, TI-83 Plus.fr USB, TI-83 Plus.fr, TI-83 Plus, TI-83 Plus, TI-83, TI-82 Stats.fr, TI-76.fr, TI-36X Pro, TI-Collège Plus Solaire, TI-Collège Plus, TI-30X Pro MultiView, TI-30XS MultiView, TI-30XB MultiView, TI-30 XB MultiView
Administrateur de Tout 82
Sur TI Planet depuis Août 2014, rédacteur depuis Août 2015Donnez moi un Internet : c'est gratuit et ne prends pas beaucoup de tempsAdministrateur de Life Game World

PT_

#132
Quote from: DJ Omnimaga on June 30, 2016, 03:39:29 PM
By UserMem, do you mean the 150 KB of user RAM available on the calculator? I am curious if ICE will be able to use SafeRAM areas for data storage like Axe did, such as temporary tilemap data?
Lol, UserMem is the memory ($D1A881) where the ASM program is copied to, and executed from. Thus, if I use UserMem myself, the executed program will be overwritten, and that is why I need to change pc if I don't want it to be messed up.

Other note: if I relocate the variables (with ix offset) to $E40000 or so, the waitstates are less, and thus faster :)

Dream of Omnimaga

That's a very misleading memory address name. <_< Shouldn't TI have called it ProgramMem or something?

Also speed increases are always good :) (even though BASIC coders will probably not care as much since ICE would already run way faster than BASIC no matter what :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

Ti64CLi++

In future release, ICE would compile all TI-Basic function?
The program ICE will be very big no?
  • Calculators owned: TI-Nspire CX CAS, TI-Nspire CX, TI-Nspire, TI-Nspire CAS TouchPad, TI-Nspire CAS, TI-Nspire, TI-Voyage 200, TI-92 Plus, TI-89 Titanium, TI-89, TI-83 Premium CE, TI-84 Plus CE, TI-82 Advanced, TI-84 Pocket.fr, TI-84 Plus Silver Edition, TI-84 Plus, TI-83 Plus Silver Edition, TI-83 Plus.fr USB, TI-83 Plus.fr, TI-83 Plus, TI-83 Plus, TI-83, TI-82 Stats.fr, TI-76.fr, TI-36X Pro, TI-Collège Plus Solaire, TI-Collège Plus, TI-30X Pro MultiView, TI-30XS MultiView, TI-30XB MultiView, TI-30 XB MultiView
Administrateur de Tout 82
Sur TI Planet depuis Août 2014, rédacteur depuis Août 2015Donnez moi un Internet : c'est gratuit et ne prends pas beaucoup de tempsAdministrateur de Life Game World

Powered by EzPortal