The shoutbox is currently out of service. Join us on Discord instead.
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 1 Guest 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

June 28, 2016, 07:11:29 pm #121 Last Edit: June 28, 2016, 07:13:02 pm by Cumred_Snektron
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 :(
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?

DJ 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.

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
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)

DJ Omnimaga

Cool to hear. That will be handy :)

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.

DJ 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.

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 :)

DJ 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?

Ti64CLi++

I wait the 1.1 version :D
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_

June 30, 2016, 05:31:28 pm #132 Last Edit: June 30, 2016, 05:34:01 pm by PT_
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 :)

DJ 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)

Ti64CLi++

In future release, ICE would compile all TI-Basic function?
The program ICE will be very big no?
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