Hello everybody,

KermMartian told me he wanted to code a lua interpreter on prizm with 3 modes : one to be compatible with TI lua programs, one to be compatible with luafx and an other one that will allow to access to the specificities of the prizm.

Who want to help him?

I think the project needs a common IDE and launcher, that will recognize which mode needs to be used.

You should first begin by programming the lua interpreter specific to the prizm. To do so, start with the last version of lua and document yourself on how add functions, ... (look here http://www.lua.org/pil/)
I'm not sure what to make of this topic.
comicIDIOT wrote:
I'm not sure what to make of this topic.
He's right, I did indeed express interest in writing or co-writing a Prizm Lua interpreter, and I look forward to being able to ask him the necessary questions. I was actually hoping to simply port the existing fx-9860g one, with two additional I/O modules, one for the Prizm specifically and one for the Nspire. Of course, I'd have to modify the third existing I/O module to emulate the fx9860g's screen and keyboard on the Prizm.
KermMartian wrote:
co-writing


With whom, if anyone?
seana11 wrote:
KermMartian wrote:
co-writing


With whom, if anyone?
With whomever would be interested in working with me. I only say co-write out of concern for whether I have the time (hint: I don't) to undertake this project on my own.
However, I don't think we can emulate TI-Nspire Lua programs on the Prizm, or at least run it near the Nspire speed. The screen size is also different, so we need to adjust that. Good luck!
blue_bear_94 wrote:
However, I don't think we can emulate TI-Nspire Lua programs on the Prizm, or at least run it near the Nspire speed. The screen size is also different, so we need to adjust that. Good luck!
The screen size difference is obvious, hence the need for a different I/O module. Luckily, the Prizm LCD is wider and only a few pixels shorter, so it shouldn't be too bad to figure out something clever. I also disagree that Nspire Lua programs won't run at a decent speed, at least without seeing some proof, as I don't have particular faith in the efficiency of TI's Lua interpreter.
I would think that it would be as simple as setting the screen registers to be 320×224, and since the NSpire always has a bar at the top of the screen during the running of Lua programs anyways (at least, from everything I've seen -- unless Lua NSpire developers have a way of disabling this?) so I think it could actually turn out to be more than possible Smile
I can't imagine that TI wrote theirs from scratch, given the excellent availability of prebuilt ones.
Ashbad wrote:
since the NSpire always has a bar at the top of the screen during the running of Lua programs anyways (at least, from everything I've seen -- unless Lua NSpire developers have a way of disabling this?)
There is a glitch in some of the OSes that allows Lua programs to draw on top of the bar, but I don't think there are any programs that rely on it (since it wouldn't be forward compatible). 320×224 should be enough.
elfprince13 wrote:
I can't imagine that TI wrote theirs from scratch, given the excellent availability of prebuilt ones.
I would be inclined to think so as well, but don't forget (1) this is TI that we're talking about and (2) the license of such pre-built Lua interpreters might not be compatible with a closed-source, commercial product.

JosJuice, Ashbad: An excellent point, thanks for sharing that. I hope that it continues to be something that people don't use so that existing Nspire Lua programs will run well on the Prizm.
Quote:
the license of such pre-built Lua interpreters might not be compatible with a closed-source, commercial product.


I think there is no problem to use the lua source in a commercial product, since many games can have plugins written in lua (sim city 4, ...), however if TI added some code to the main loop (test of a key, management of the top bar,...) the interpretation is slown down.
vebveb wrote:
Quote:
the license of such pre-built Lua interpreters might not be compatible with a closed-source, commercial product.


I think there is no problem to use the lua source in a commercial product, since many games can have plugins written in lua (sim city 4, ...), however if TI added some code to the main loop (test of a key, management of the top bar,...) the interpretation is slown down.
Indeed, although hopefully even they are not so incompetent as to slow it down too much with that. Razz My first-first step is going to actually be to glance over Lua a bit and write a few sample programs, as I haven't tried the language before.
I'd love to see a Lua interpreter on the Prizm. I just think it'd be great if TI-Nspire CX and Casio Prizm programmers could use the same set of tools and possibly make games that run on both platforms Smile Good luck with this project!
Ashbad wrote:
I would think that it would be as simple as setting the screen registers to be 320×224, and since the NSpire always has a bar at the top of the screen during the running of Lua programs anyways (at least, from everything I've seen -- unless Lua NSpire developers have a way of disabling this?) so I think it could actually turn out to be more than possible Smile
There's a little trick you could use to draw over it, but it's not entirely consistent. Levak's Nyan Cat game is an example—notice how the background takes the whole screen, but there's still the little status icon left up there. (And as JosJuice pointed out the "feature" could easily be removed in a future OS update.)
Indeed, so I think it probably would be a reasonable compromise to ignore that undocumented and potentially temporary feature for now, which would bring the screen sizes closer together.
*bump* Vebveb, did you mean that I should start by looking at http://www.lua.org/pil/24.html for information about the C API for Lua? What steps did you take to create Lua FX in the first place? Did you start with the standard Lua source code, and build the necessary modules for it to work with the fx-9860g?
Yes exactly,
The "Programming in lua" book explains how to create a new module for lua. However you don't need everything that is described in the book.
Some of the functions of the standard distribution are difficult to port or unuseful (The input librairy is not adapted for calcs for example). You should begin by deleting the standard librairies of the package and by compiling a simple lua interpreter with two functions : print and wait.

For luafx, I first compiled a lua interpreter with the print function only. The program to execute was compiled in the interpreter and was in a buffer.
Great, I appreciate that. I asked because I was attending our weekly programming conference yesterday, Have Calc, Will Program, and I was toying with Lua a bit as part of my contribution to the discussion. Smile I will certainly try print and wait as my first functions, once I can get the rest of the interpreter to compile. That of course will also involve translating the file I/O calls for listing and reading .lua files, and sundry other things, so I'm sure it's a taller order than it at first sounds.
I don't know if the prizm has a printf function. If it doesn't, I will give you the printf function I wrote for fx9860.
It doesn't have a native printf, but I believe someone has developed it already (it may or not be in libfxcg already). Anyway, it'd be interesting to have your implementation and seeing how it compares to existing ones (if any exists).
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement