Omnimaga

Omnimaga => News => Topic started by: Adriweb on August 05, 2011, 10:27:52 pm

Title: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Adriweb on August 05, 2011, 10:27:52 pm
The great Extended did it again !

Via his blog ndlessly (http://ndlessly.wordpress.com/2011/08/06/luna-here-she-is/), Extended just announced the release of his open-source tool "Luna", that allows you to convert a .lua file into a .tns file.

"Well, what's new? We already have that ?", you'd say.

Well, yes, we do. But the community's converter actually produce a file that is currently readable by OSes < 3.0.2.

In fact, since this version, TI added the need to have a fully correctly-encrypted .tns file in order to be able to open it. And this required a specific proprietary encryption algorithm that nobody but TI had (though a part of it had been patented). And the community couldn't do anything about that, since it had not been cracked. The only way was to use TI's official scripting tools.

Well, this time is over. Extended successfully reversed-engineered TI's secret encryption algorithm and made "Luna", a tool that can produce correctly encoded files, as OS 3.0.2+ expects !

(http://www.mirari.fr/4XcS)

Luna is available to download here (http://www.mirari.fr/i4xk).

Extended also said that support for C and assembly in OS 3.0 might not be very far... !

What an exciting pair of news...

Have fun !
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: pianoman on August 05, 2011, 10:59:57 pm
That is epic!
Extended, post here soon so I can +1 you :)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: fb39ca4 on August 05, 2011, 11:18:41 pm
Yay! This needs to go in News.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Deep Toaster on August 05, 2011, 11:23:08 pm
I NEEDZ THIS... Another crack and another awesome util by ExtendeD!
Yay! This needs to go in News.
That it does.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: calcdude84se on August 05, 2011, 11:27:59 pm
Excellent! Finally we have a convenient way to code Lua on a computer. :D
(I mean, I won't use it, but others will find it incredibly useful :))
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Adriweb on August 05, 2011, 11:54:30 pm
If I can find a way to properly compile it on my mac, I'll be using it from now on :P
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Juju on August 06, 2011, 12:01:13 am
Awesome! So it means Ndless 3 soon?
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Adriweb on August 06, 2011, 12:16:13 am
well, Extended's blog will be the place to keep an eye on about Ndless 3 :P
For now, we don't know anything ...
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Jim Bauwens on August 06, 2011, 01:46:10 am
Whooo, nice news!
Thanks for reporting Adriweb!

Edit: I have successfully compiled it on Linux (need to replace -leay32 with -lssl).
However, I noticed that Luna will check the code (using lua), and error on stuff with 'on', because its not defined (it is on the calculator). I'll now modify the code to skip this check. Big mistake of me x)

Edit2:
Converted my file without an error, didn't test it yet :)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: ExtendeD on August 06, 2011, 03:01:09 am
Just to be clearer on one point of adriweb's post: Luna fortunately doesn't infringe TI's patent in any way.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Lionel Debroux on August 06, 2011, 03:04:14 am
I had already told you privately but I'll now tell publicly: congratulations ;)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Munchor on August 06, 2011, 04:35:53 am
Oh great news! And it works on Linux (natively)! This is awesome!

I managed to build it, convert files and I also tested them ExtendeD, want me to release Linux Binaries, even though I think it's quite easy for anybody to build it :)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Juju on August 06, 2011, 04:46:08 am
Someone should package for Debian (.deb) and Arch Linux (PKGBUILD/AUR).
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Lionel Debroux on August 06, 2011, 04:49:29 am
If people provide them, ExtendeD could update the archive with native Linux and MacOS X binaries, but making packages may be too big of a hammer ;)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Munchor on August 06, 2011, 04:55:19 am
Someone should package for Debian (.deb) and Arch Linux (PKGBUILD/AUR).

There's no Luna in Ubuntu Repositories :P It could be done but I'm not sure if it's necessary.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Juju on August 06, 2011, 05:04:14 am
Well yeah, making Debian packages is kinda complicated, but making a PKGBUILD for Arch is more simple. Also I might work on a PKGBUILD. :)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: ExtendeD on August 06, 2011, 05:33:34 am
I could include them in the Luna archive put it really depends on their size as Lionel points out.
If they are too big, just upload or attach the one you've built for your own Linux distro, adriweb may then update his post to list them.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: critor on August 06, 2011, 05:37:07 am
Congratulations ExtendeD! :)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: shrear on August 06, 2011, 06:21:44 am
epic!
and ndless 3.0 coming soon? Seems as if I really need to get syntax highlighting working in nwriter.
May I ask how possible it is to port luna to the nspire? ( since there seems to be a lot of includes )
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: ExtendeD on August 06, 2011, 06:28:19 am
OpenSSL and zlib are embedded in the OS. Lionel exported some of the symbols of zlib in Ndless 2.0 so they can be directly used.
For OpenSSL the symbols and functions needs to be defined.
Then there is minizip, I'm not sure how portable it is, since it isn't really well written.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Lionel Debroux on August 06, 2011, 07:22:31 am
The portability of minizip (well, an older version thereof) is at least decent, since libtifiles uses it :)
At some point, we'll want to somehow get rid of the embedded minizip.

For compilation under 64-bit Debian Lenny/Squeeze/Testing, the LDFLAGS line in Makefile needs -lssl -lcrypto.
EDIT: and compilation of the 32-bit version from 64-bit Linux works just fine if one adds -m32 to the CFLAGS and LDFLAGS.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Cuervo on August 06, 2011, 07:55:00 am
Thx Lionel Debroux, with your information, I successfully compiled Luna for Mac OS X.  :)

Here are the binaries (Intel, x86 and x86_64 binaries):
http://www.fanofblitzbasic.de/download.php?dlid=LunaMacOSX (http://www.fanofblitzbasic.de/download.php?dlid=LunaMacOSX)

Please note:
I had to modify the code and the makefile, but it should still compile on Linux and Windows!

@ExtendeD:
I hope it's ok that I published the binaries? There is no license for Luna itself, only for OpenSSL and minizip^^


I don't know if they work, could somebody please try that out?


TIA
Cuervo
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Loulou 54 on August 06, 2011, 07:55:27 am
Too easy for ExtendeD ! xD
Congrats ! :)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: ExtendeD on August 06, 2011, 08:18:19 am
Cuervo: no problem for me.
I'll merge back the changes if they are OK for Mac OS X users.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Lionel Debroux on August 06, 2011, 08:45:56 am
Here are some binaries [EDIT: of Luna 0.1a] that I've just generated:
http://tict.ticalc.org/misc/luna32 -> static 32-bit Linux build created on current Debian Testing.
http://tict.ticalc.org/misc/luna32_deb -> dynamic 32-bit Linux build, suitable for current Debian Testing.
http://tict.ticalc.org/misc/luna64 -> static 64-bit Linux build created on current Debian Testing.
http://tict.ticalc.org/misc/luna64_deb -> dynamic 64-bit Linux build, suitable for current Debian Testing.
http://tict.ticalc.org/misc/luna64_fed -> dynamic 64-bit Linux build, suitable for Fedora 14.

The links are temporary, I'll remove them soon, whether they're integrated in the main distribution (I think that the static versions should be used) or they aren't :)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: apcalc on August 06, 2011, 11:28:10 am
This looks like it will be extremely useful for future projects, Thank You ExtendeD! :)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: ztrumpet on August 06, 2011, 12:13:00 pm
ExtendeD, this is awesome!  Congrats, and thanks!
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Adriweb on August 06, 2011, 12:48:22 pm
Thanks for the Mac build, I don't have the tools to compile it on my on right now :P
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Cuervo on August 06, 2011, 01:07:28 pm
@adriweb:
Does the Mac build work?
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Ti-Programmer on August 06, 2011, 11:55:52 pm
Good job! I hope that we can run c programs on nspire's 3.0 firmware.
Thanks for the program Extended!
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Adriweb on August 07, 2011, 02:43:25 pm
@adriweb:
Does the Mac build work?

Yes, it works great :) (x64 tested)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: sammyMaX on August 10, 2011, 01:40:53 pm
I installed the packages zlib1g-dbg and libssl-dev, and then ran "make dist" in the src directory. A lot of errors in minizip popped up, but a (Linux) executable file appeared. I tried to run it with "sudo luna file.lua output.tns" but the terminal replied back "command not found." What am I doing wrong? I'm using Ubuntu 11.04 32-bit.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: imo_inx on August 10, 2011, 01:43:15 pm
You could try uninstalling and reinstalling it.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Lionel Debroux on August 10, 2011, 01:43:43 pm
You don't need to use sudo, and you probably want to use "./luna" instead of "luna", if you're launching from the directory where you compiled Luna.

Venom: make dist does not install Luna, in the sense that it won't copy luna to a directory in PATH, so uninstalling and reinstalling Luna wouldn't change anything ;)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: sammyMaX on August 10, 2011, 01:48:28 pm
It worked! Sorry, I'm a complete noob at Linux (I only began using it a week or two ago to get TILP to work without installing GTK+ on Windows), so when does one use ./ and what does it do?
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Lionel Debroux on August 10, 2011, 01:56:24 pm
When launching a program in a terminal, if it's not in the PATH environment variable, you need to give the full path to the program, e.g. /home/user/luna/luna. But if you're launching "luna" from the /home/user/luna folder, you still need to use "./luna" to indicate the path of the program (since, again, /home/user/luna is not in the PATH).
On Windows, the current folder is automatically prepended to the PATH. Which is slightly more convenient, but is strongly frowned upon from a security POV, since executables in the local folder could shadow other executables from the path.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Jim Bauwens on August 10, 2011, 02:02:03 pm
Just to make it clear, ./ refers to the current directory :)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: sammyMaX on August 10, 2011, 02:08:00 pm
When I run TILP though, not including the "./" in front is okay. Why is this? And just to be clear, are all Linux programs supposed to be run with a "./" in the front?
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: fb39ca4 on August 10, 2011, 02:14:19 pm
If a program is in your bin directory, you don't need it.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Lionel Debroux on August 10, 2011, 02:14:51 pm
Quote
When I run TILP though, not including the "./" in front is okay. Why is this?
Because TILP is being installed to a folder that is listed in the PATH environment variable :)

Quote
And just to be clear, are all Linux programs supposed to be run with a "./" in the front?
No :)
Either they are installed in a folder that is listed in the PATH environment variable, in which case you don't need to use "./" or "/home/<...>" or "../<...>", which are ways to tell the command interpreter where to find the program, or they aren't, and then you have to tell the command interpreter where to find the program.
The general principle is the same on Windows, except that on Windows, PATH automatically contains ".".
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: sammyMaX on August 10, 2011, 02:22:49 pm
Okay I get it  :w00t: Thanks and good luck to the Ndless 3 developers!
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: SirCmpwn on August 16, 2011, 02:22:31 pm
What on Earth was TI thinking, making their own closed source encryption scheme?  As far as stupid decisions go, that's a pretty big one.  Anyone who knows anything about encryption knows that you use a publicly available algorithm, or make your algorithm public.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Goplat on August 16, 2011, 02:42:15 pm
What on Earth was TI thinking, making their own closed source encryption scheme?  As far as stupid decisions go, that's a pretty big one.  Anyone who knows anything about encryption knows that you use a publicly available algorithm, or make your algorithm public.
They didn't. They used triple-DES encryption, which is publicly available.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Lionel Debroux on August 16, 2011, 02:57:11 pm
SirCmpwn: the encryption itself is indeed standard; but the obfuscation (a more generic term that more accurately describes what TI is doing, it's not just encryption + compression) contains a proprietary, and patented part.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: SirCmpwn on August 17, 2011, 11:34:15 am
Oh, that makes sense.  Why would they obfuscate it, though?  Seems a bit strange.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Lionel Debroux on August 17, 2011, 12:45:06 pm
In general, using obfuscation and patents is a sign of a definite will to keep tight control and hamper interoperability. Here, it's between unauthorized third parties and the calculator/computer software. They could have done without inventing a proprietary XML compression scheme and patenting it: there are multiple other ways to compress XML data.

But obviously, they fail at preventing interoperability (nobody seriously doubted it would succeed)... and they can't even complain legally in the countries where reverse-engineering for the purpose of creating interoperability is allowed.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Alex on August 18, 2011, 11:26:48 am
Hello,
Having a mac with OS X 10.5.8, I downloaded LUNA mac. But he put:

"dyld: unknown required load command 0x80000022
Trace / BPT trap
logout "

So I asked for help on TI-BANK Adriweb and gave me a native application for Mac, providing an interface to Luna, but still the same problem:

"LUNA has unexpectedly quit" and looking at the error report, still the same control problem.

I wonder if someone could compile me for my version of Mac OS X.

Thank you in advance.
AlexRider38

PS: I use google translate ;D
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Alex on August 20, 2011, 04:39:22 am
 :w00t:  :'(
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Cuervo on August 20, 2011, 04:58:43 am
Sorry, I don't have Mac OS X 10.5.x

Can you please install Xcode from your Mac OS X Install DVD (or download the newest version from https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20414 (https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20414) (which should be better) if your internet connection is fast) and try to run 'make dist' in the src dirctrory of my download?

http://www.fanofblitzbasic.de/download.php?dlid=LunaMacOSX (http://www.fanofblitzbasic.de/download.php?dlid=LunaMacOSX)
(Should build the 32-bit executable)


Cuervo
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Alex on August 25, 2011, 11:13:46 am
Have you mac?
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: devpolytechnic on September 21, 2011, 06:23:17 pm
@Adriweb
I'm beginning to program right now in Lua, but for some reason, when I tried converting my .lua file, it says this error:
The program can't start because zlib1.dll is missing from your computer. Try reinstalling the program to fix this problem.

In case you think this is a hardware error, here are my PC specs (Note: I built my own computer):
OS: Windows 7 Ultimate 64-Bit Service Pack 1 Version 6.1.7601
CPU: AMD Phenom II X6 1100T Black Edition at 3.3 GHz
Memory: Corsair 8GB Vengeance Blue 1600 MHz
Video Card: XFX Radeon HD 6950 1 GB GDDR5
 ???

Thanks,
devpolytechnic
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Jim Bauwens on September 22, 2011, 04:07:03 am
Alex, I don't know if Mac OS X 10.5 contains the SSL libs Luna needs by default, that is why it might fail.
Sadly enough I'm not experienced enough with macs to help you. You should try to ask Adriweb again about this, because Mac is his main platform, and he is quite a good programmer.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Adriweb on September 22, 2011, 06:46:51 am
thanks @jimbauwens :P

@Devpolytechnic :  Try downloading manually the dll file : http://www.dll-files.com/pop.php?dll=zlib1 (http://www.dll-files.com/pop.php?dll=zlib1) and put in in the /System32/ folder (in the /windows/ folder).

Btw, did you download that version : Luna 0.2 (http://www.mirari.fr/i4xk) ? Getting the latest one is always a good idea.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Cuervo on September 22, 2011, 08:05:07 am
I uploaded the Mac OS X build of Luna 0.2. I also booted one of my old iMac G3s to compile a PowerPC compatible version.
So there are the following files included now:

luna-i386-x86: Intel x86 - 32 Bit
luna-i386-x86_64: Intel x86_64 - 64 Bit
luna-ppc-32: PowerPC - 32 Bit

I am unable to compile a PowerPC - 64 Bit version because I do not have any G5-based machine. Oh, and I did not compile a PowerPC G4 version, but the G3 version will run on any PowerPC based Mac that has at least a G3 processor.

Download (v0.2):
http://www.fanofblitzbasic.de/download.php?dlid=LunaMacOSX02 (http://www.fanofblitzbasic.de/download.php?dlid=LunaMacOSX02)
(Please note: The download link for 0.1a still works, if you need it^^)

Cuervo
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Adriweb on September 22, 2011, 10:49:41 am
Thanks, that's good.

I'll update my Luna-GUI Mac App ;)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: devpolytechnic on September 22, 2011, 10:41:10 pm
@adriweb
I checked the version I downloaded, and it was Luna version 1.0a.    ;)
I downloaded version 2.0 from the link you had, and it worked perfectly.  ;D
Thanks for the quick reply and help!

Now all I have to do is figure out how to program Pong in Lua...This is going to be fun  ::)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Goplat on September 24, 2011, 09:15:00 pm
Two bugs related to replacing & and < in lua source with character entities:

* escape_special_xml_chars stops processing when it reaches the offset equal to the size of the original input ("p < in_buf + header_size + in_size"), not taking into account that the size is changing during the loop, so characters near the end of the program may not get escaped
* xml_compress copies the footer without taking into account the change in size ("memcpy(in_buf + header_size + in_size, lua_footer, sizeof(lua_footer));"), resulting in a truncated program and garbage at the end of the xml
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Levak on September 25, 2011, 07:45:32 am
I guess that blending Luna 0.1 and 0.2 will solve the problem since Luna 0.1 used to work and sources are quite identical for this part.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Chockosta on September 25, 2011, 12:13:23 pm
Would it be possible to use it in order to get text from a TNS file without TI-Nspire Computer software ?
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Levak on September 25, 2011, 12:34:00 pm
Would it be possible to use it in order to get text from a TNS file without TI-Nspire Computer software ?

With an emulator and a memory dump ... but it is really messy
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Chockosta on September 25, 2011, 02:11:52 pm
Too bad...
I still have only 9 days of free trial, and I mainly code on my clickpad :(
I'll have to ask someone to copy my code.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Levak on September 25, 2011, 02:31:36 pm
!summon Goplat :
Can you debugger be interfaced with a scripting language ?
I mean bashing actions like this one :

-> k 10032aa0 +x
-> c
-> Ctrl+S
-> w C:\dump.xml r1 400
-> c
-> w C:\dump.xml r1 400
-> c
-> w C:\dump.xml r1 400
...
n time ...
-----> Dump of a document.

EDIT : well, I guess that integrated plugins would be really great, isn't it ? :D
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Goplat on September 25, 2011, 03:54:20 pm
Levak: You could create a file containing all the debugger commands to enter:
Code: [Select]
k 10032AA0 +x
c
w dump1.xml r1 r2
c
w dump2.xml r1 r2
c
w dump3.xml r1 r2
c
w dump4.xml r1 r2
c
w dump5.xml r1 r2
c
w dump6.xml r1 r2
(...for as long as you expect the xml to be...)
then run: nspire_emu ... /D < commands.txt
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: ExtendeD on September 25, 2011, 04:17:46 pm
Two bugs related to replacing & and < in lua source with character entities:

* escape_special_xml_chars stops processing when it reaches the offset equal to the size of the original input ("p < in_buf + header_size + in_size"), not taking into account that the size is changing during the loop, so characters near the end of the program may not get escaped
* xml_compress copies the footer without taking into account the change in size ("memcpy(in_buf + header_size + in_size, lua_footer, sizeof(lua_footer));"), resulting in a truncated program and garbage at the end of the xml

Thanks Goplat! This would explain the problems Levak had with Make3D.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Levak on September 26, 2011, 10:58:32 am
Levak: You could create a file containing all the debugger commands to enter:
then run: nspire_emu ... /D < commands.txt

Thanks !

Here is my working dumper thanks to your help :
Code: [Select]
function dump {
local winePath="$HOME/.wine/dosdevices/c:"
local rom=$(zenity --file-selection --title="Sélectionnez un fichier *.rom" --filename="$RELPAT/");
if [ "$rom" ]; then
if [ "${rom##*.}" = "rom" ]; then
local size=$(zenity --entry --title="Taille du classeur à dumper (octets)" --entry-text="0");
let num=$size/170
echo "k 10032AA0 +x" > "$RELPAT/commands.txt"
echo "c" >> "$RELPAT/commands.txt"
local i=0
while [ $i -le $num ]; do
# Complete tempory file names with zeros so that it's listed correclty
let local dif=${#num}-${#i}
local spaces=$(printf "%"$dif"s")
local zeros=${spaces// /0}
# Fill command list
echo "w C:\dump$zeros$i.xml r1 r2" >> "$RELPAT/commands.txt"
echo "c" >> "$RELPAT/commands.txt"
let i=$i+1
done

# Launch emulator with debug command list
"$RELPAT"/nspire_emu.exe /F="$rom" /B=boot2.img.raw /D < "$RELPAT/commands.txt"

# Concatenate final XML file using tempory files
echo -n "" > "$RELPAT/dump.xml"
for f in "$winePath/dump*"; do
cat $f >> "$RELPAT/dump.xml"
done
rm "$winePath/dump*"
rm "$RELPAT/commands.txt"
else
zenity --error --title="Erreur" --text="Veuillez sélectionner un fichier *.rom et pas autre chose ! \n Opération annulée"
fi
fi
}
> bash 4 linux
> requires zenity
> requires wine
> only works with OS 3.0.1 AND NONCAS roms.

EDIT : it can easily be added to my bash launcher (http://tiplanet.org/forum/archives_voir.php?id=2099&play=)
47 +                "dump" "Dumper un classeur (Ctrl+S -- dump.xml)" \
177 + (the code above)
271 +          elif [ "$select_noncas" = "dump" ]; then
            dump
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: ExtendeD on September 26, 2011, 11:56:52 am
Nice Levak :)
For those who wonder: Levak's script can be used to dump TNS documents of arbitrary size as XML documents, before adapting them and converting them back with Luna v0.2.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Levak on September 26, 2011, 12:59:29 pm
Code: [Select]
echo $(perl -0777 -pe 's/(.*&lt;r2dtotree&gt;|&lt;\/r2dtotree&gt;.*)//gsm' dump.xml | sed "s/&lt;node name=&quot;1para&quot;&gt;/\x0D/g;s/&lt;\/*node[^g]*&gt;//g;s/&lt;\/*leaf[^g]*&gt;//g;s/&lt;cursor[^g]*&gt;//g;s/&amp;quot;/\"/g;s/&amp;apos;/'/g;s/&amp;lt;/</g;s/&amp;gt;/>/g" | sed 's/&amp;/\&/g' ) > dump.lua



is the code to get the source code form the xml file of a lua program coded using oclua (TI-Notepad) :D
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Adriweb on September 26, 2011, 01:23:17 pm
nice !

Making a third-party SDK for reading/writing .tns is getting closer I think :P

Might not be done at all, but it could have a great potential, I'm sure....
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Chockosta on September 26, 2011, 01:56:15 pm
Amazing ! I'm going to use this a lot !
Thank you very much.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: ExtendeD on September 27, 2011, 05:42:54 am
Luna v0.2a is now available with several bug fixes. Sorry for this unable v0.2.
http://ndlessly.wordpress.com/2011/09/27/luna-bug-fixes/
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Munchor on September 27, 2011, 09:57:15 am
Luna v0.2a is now available with several bug fixes. Sorry for this unable v0.2.
http://ndlessly.wordpress.com/2011/09/27/luna-bug-fixes/

Do you plan to include a Linux and a Mac build the next time (or does this one already feature it)? For people who can't build one themselves, it'd be neat.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Levak on September 27, 2011, 12:28:39 pm
Luna v0.2a is now available with several bug fixes. Sorry for this unable v0.2.
http://ndlessly.wordpress.com/2011/09/27/luna-bug-fixes/

Do you plan to include a Linux and a Mac build the next time (or does this one already feature it)? For people who can't build one themselves, it'd be neat.

You should specify which Linux distro and which Mac version... cuze Windows is AFAIK the only one where it is "hard" to compile and where a compiled *.exe is the same for everyone.
Don't you think ?
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Cuervo on September 27, 2011, 01:12:50 pm
Here's the Mac OS X Version (x86 and x86_64) of Luna 0.2a (EDIT: b). I don't want to compile a PowerPC-version.

EDIT: All download links here:
0.1 (x86, x86_64): http://www.fanofblitzbasic.de/download.php?dlid=LunaMacOSX (http://www.fanofblitzbasic.de/download.php?dlid=LunaMacOSX)
0.2 (x86, x86_64, ppc): http://www.fanofblitzbasic.de/download.php?dlid=LunaMacOSX02 (http://www.fanofblitzbasic.de/download.php?dlid=LunaMacOSX02)
0.2a (x86, x86_64): http://www.fanofblitzbasic.de/download.php?dlid=LunaMacOSX02a (http://www.fanofblitzbasic.de/download.php?dlid=LunaMacOSX02a)
0.2b (x86, x86_64): http://www.fanofblitzbasic.de/download.php?dlid=LunaMacOSX02b (http://www.fanofblitzbasic.de/download.php?dlid=LunaMacOSX02b)

@ExtendeD:
Please try if my Makefile also works on Windows, if it does, please use it instead of your Makefile. It's the only thing that needs to be changed to compile Luna on Mac OS X.

@Levak:
Nope, the x86-Version should work on any Mac with an Intel processor (built since 2005/2006, should run on Mac OS X >= 10.4), I only provide a x86_64 version for those who really want to use 64-Bit (which should have no effect on Luna^^)


Cuervo
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Levak on September 27, 2011, 01:19:10 pm
@Levak:
Nope, the x86-Version should work on any Mac with an Intel processor (built since 2005/2006, should run on Mac OS X >= 10.4), I only provide a x86_64 version for those who really want to use 64-Bit (which should have no effect on Luna^^)

Mac has changed ? :o
Ok, troll off :D
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Lionel Debroux on September 27, 2011, 01:33:13 pm
On Linux, only static builds might solve the heterogeneity, but it's not very good to use static builds.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: ExtendeD on September 27, 2011, 01:39:51 pm
@ExtendeD:
Please try if my Makefile also works on Windows, if it does, please use it instead of your Makefile. It's the only thing that needs to be changed to compile Luna on Mac OS X.

It does produce errors on Windows. Could you please try this one (https://gist.github.com/1245708) on MacOS which should now be cross-platform?

Do you plan to include a Linux and a Mac build the next time (or does this one already feature it)? For people who can't build one themselves, it'd be neat.

No, sorry, and I have neither Linux nor Mac boxes do to this.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Cuervo on September 27, 2011, 01:50:31 pm
@ExtendeD:

Yes, works almost, I do not have any idea why your's doesn't work.

This is yours:
Code: [Select]
OS ?= `uname -s`
ifeq ($(OS),Windows_NT)
EXEEXT = .exe
else
CFLAGS=$(CFLAGS) -Dfopen64=fopen -Dfseeko64=fseeko -Dftello64=ftello
LDFLAGS=$(LDFLAGS) -lcrypto
endif

This works:
Code: [Select]
OS ?= `uname -s`
ifeq ($(OS),Windows_NT)
EXEEXT = .exe
else
CFLAGS = -W -Wall -m32 -Dfopen64=fopen -Dfseeko64=fseeko -Dftello64=ftello
LDFLAGS = -lssl -lz -m32 -lcrypto
endif


Yours gives me something like this:

Code: [Select]
Mac:src username$ make dist
rm -rf *.o luna dist
Makefile:10: *** Recursive variable `CFLAGS' references itself (eventually).  Stop.
Don't know why..   ???
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Lionel Debroux on September 27, 2011, 01:56:04 pm
Maybe
Code: [Select]
CFLAGS += -Dfopen64=fopen -Dfseeko64=fseeko -Dftello64=ftello
LDFLAGS += -lcrypto
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Cuervo on September 27, 2011, 02:00:33 pm
Ok, that works^^

Thanks

Code: [Select]
OS ?= `uname -s`
ifeq ($(OS),Windows_NT)
EXEEXT = .exe
else
CFLAGS += -Dfopen64=fopen -Dfseeko64=fseeko -Dftello64=ftello
LDFLAGS += -lcrypto
endif
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Lionel Debroux on September 27, 2011, 02:02:51 pm
And what about
Code: [Select]
-D_FILE_OFFSET_BITS=64 -D_LARGEFILEinstead of
Code: [Select]
-Dfopen64=fopen -Dfseeko64=fseeko -Dftello64=ftello?

(works for me under 64-bit Debian Testing, both in native and in 32-bit mode with CFLAGS and LDFLAGS both containing -m32)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Cuervo on September 27, 2011, 02:15:45 pm
No.

Code: [Select]
rm -rf *.o luna dist
gcc -W -Wall -m32 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE   -c -o luna.o luna.c
gcc -W -Wall -m32 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE   -c -o zip.o minizip-1.1/zip.c
In file included from minizip-1.1/zip.c:196:
minizip-1.1/crypt.h:35: warning: unused parameter ‘pcrc_32_tab’
gcc -W -Wall -m32 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE   -c -o ioapi.o minizip-1.1/ioapi.c
minizip-1.1/ioapi.c:83: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c: In function ‘fopen64_file_func’:
minizip-1.1/ioapi.c:115: warning: implicit declaration of function ‘fopen64’
minizip-1.1/ioapi.c:115: warning: assignment makes pointer from integer without a cast
minizip-1.1/ioapi.c: At top level:
minizip-1.1/ioapi.c:101: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:120: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:127: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:134: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c: In function ‘ftell64_file_func’:
minizip-1.1/ioapi.c:145: warning: implicit declaration of function ‘ftello64’
minizip-1.1/ioapi.c: At top level:
minizip-1.1/ioapi.c:142: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:149: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c: In function ‘fseek64_file_func’:
minizip-1.1/ioapi.c:191: warning: implicit declaration of function ‘fseeko64’
minizip-1.1/ioapi.c: At top level:
minizip-1.1/ioapi.c:172: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:198: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:205: warning: unused parameter ‘opaque’
gcc -o luna luna.o zip.o ioapi.o -lssl -lz -m32 -lcrypto
Undefined symbols:
  "_fopen64", referenced from:
      _fopen64_file_func in ioapi.o
     (maybe you meant: _fill_fopen64_filefunc)
  "_fseeko64", referenced from:
      _fseek64_file_func in ioapi.o
  "_ftello64", referenced from:
      _ftell64_file_func in ioapi.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [luna] Error 1

I think
Code: [Select]
-Dfopen64=fopen -Dfseeko64=fseeko -Dftello64=ftellois necessary.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Lionel Debroux on September 27, 2011, 02:35:29 pm
OK. Well, that series of defines works, but it's not really correct...

Maybe
Code: [Select]
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64?
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Cuervo on September 27, 2011, 02:49:12 pm
Code: [Select]
gcc -W -Wall -m32 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64   -c -o luna.o luna.c
gcc -W -Wall -m32 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64   -c -o zip.o minizip-1.1/zip.c
In file included from minizip-1.1/zip.c:196:
minizip-1.1/crypt.h:35: warning: unused parameter ‘pcrc_32_tab’
gcc -W -Wall -m32 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64   -c -o ioapi.o minizip-1.1/ioapi.c
minizip-1.1/ioapi.c:83: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c: In function ‘fopen64_file_func’:
minizip-1.1/ioapi.c:115: warning: implicit declaration of function ‘fopen64’
minizip-1.1/ioapi.c:115: warning: assignment makes pointer from integer without a cast
minizip-1.1/ioapi.c: At top level:
minizip-1.1/ioapi.c:101: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:120: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:127: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:134: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c: In function ‘ftell64_file_func’:
minizip-1.1/ioapi.c:145: warning: implicit declaration of function ‘ftello64’
minizip-1.1/ioapi.c: At top level:
minizip-1.1/ioapi.c:142: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:149: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c: In function ‘fseek64_file_func’:
minizip-1.1/ioapi.c:191: warning: implicit declaration of function ‘fseeko64’
minizip-1.1/ioapi.c: At top level:
minizip-1.1/ioapi.c:172: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:198: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:205: warning: unused parameter ‘opaque’
gcc -o luna luna.o zip.o ioapi.o -lssl -lz -m32 -lcrypto
Undefined symbols:
  "_fopen64", referenced from:
      _fopen64_file_func in ioapi.o
     (maybe you meant: _fill_fopen64_filefunc)
  "_fseeko64", referenced from:
      _fseek64_file_func in ioapi.o
  "_ftello64", referenced from:
      _ftell64_file_func in ioapi.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [luna] Error 1


http://hintsforums.macworld.com/archive/index.php/t-60356.html (http://hintsforums.macworld.com/archive/index.php/t-60356.html)

Quote from: dmacks
Welcome to the world of software porting, where every operating system is different and often in ways that the author of the software you want didn't know were important. There's no fopen64 function on OS X because the standard fopen function includes the added 64-bit functionality that is only present in the *64 symbols on other machines. Try passing -Dfopen64=fopen in CPPFLAGS.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Lionel Debroux on September 27, 2011, 03:02:55 pm
ACK :)
On pages dealing with MacOS X, I had also seen references to the defines I posted.

I think we should special-case MacOS X in the Makefile, and leave -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 on Linux/glibc or *BSD/libc.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Goplat on September 27, 2011, 03:12:29 pm
Anything larger than 4GB won't fit on the TI-Nspire anyway. I say just stick to the ANSI standard, universally available 32-bit functions on all platforms.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: sammyMaX on December 06, 2011, 05:43:54 pm
Can anyone help me compile luna on Linux? I have OpenSSL and zlib packages installed, but it still gives me
luna.o: In function `doccrypt':
luna.c:(.text+0x6aa): undefined reference to `DES_set_key_checked'
luna.c:(.text+0x6c9): undefined reference to `DES_set_key_checked'
luna.c:(.text+0x6e8): undefined reference to `DES_set_key_checked'
luna.c:(.text+0x795): undefined reference to `DES_ecb3_encrypt'

Any suggestions?
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Jim Bauwens on December 06, 2011, 06:00:52 pm
Can you give OS version, and Luna version?
Luna compiles just fine for me, but I don't remember what Live I installed.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: sammyMaX on December 06, 2011, 06:02:43 pm
Ubuntu 11.10 32-bit and Luna 0.2b
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Jim Bauwens on December 06, 2011, 06:18:21 pm
Do you have the dev packages of them installed?
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: sammyMaX on December 06, 2011, 07:27:01 pm
Yes, I do.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Jim Bauwens on December 07, 2011, 04:01:15 am
Strange.
I have these packages installed:
libssl-dev
zlib1g-dev
together with its not dev variants.

I got many more packages for other stuff, so maybe it needs more than just this.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: sammyMaX on December 07, 2011, 06:04:57 pm
I have libssl-dev, zlib1g-dev, zlib1g, libssl1.0.0, and libssl0.9.8 installed. I don't know what else might be needed, but it seems to be some SSL library based on the errors.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Jim Bauwens on December 08, 2011, 04:01:48 am
I haven't the slightest idea why it doesn't work for you :/
You use "make" to compile it, right?
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: ExtendeD on December 08, 2011, 05:17:35 am
There's most probably a problem with your build toolchain.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Jim Bauwens on December 30, 2011, 04:31:49 pm
I know its a bit late, but I just had the same problem on the PC of my brother (Ubuntu 11.10).
Adding -lcrypto to the build parameters solved the problem.

I also mailed this ExtendeD.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Alex on January 02, 2012, 09:36:10 am
Bonjour tout le monde,
Est-ce que quelqu'un pourrait me compiler luna 0.2b pour mac en version ppc.
Merci d'avance
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: ExtendeD on January 02, 2012, 09:37:42 am
Here is the translation: Alex asks for a version of Luna v0.2b compiled for Mac OS PPC.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Jim Bauwens on January 02, 2012, 09:40:31 am
This isn't so easy, as the SSL libraries aren't yet in the PPC version IIRC.
I'll ask Adriweb later if he might have one compiled.

Also, maybe it would be easier to use an online version. I'll ask albertrocks about that.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Alex on January 02, 2012, 09:41:00 am
thanks extendeD
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: ExtendeD on January 02, 2012, 09:42:45 am
jimbauwens: I actually have an online version for a previous version of Luna, I could easily update it.
But I'm not sure it's really convenient as part of frequent code/build/test cycle.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Jim Bauwens on January 02, 2012, 09:44:47 am
Well, if he can't get luna to run, I could create a simple (batch/python) script that POST's his code to the server and retrieve the tns.
It would just work like the real luna, but a bit slower.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Adriweb on January 02, 2012, 09:50:42 am
I couldn't personally compile Luna on Mac because of the dependencies I was too lazy to install...

I know however that Extended has put on one of his websites an online version of Lua that gets code from Gist and outputs a downloadable .tns file....

Extended ?



Edit : meh, cross post
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Alex on January 02, 2012, 09:53:09 am
it's very important because I'd like create a lua game

Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: ExtendeD on January 02, 2012, 09:56:09 am
Here it is: http://bytecode.fr/luna/page.php5?id=1163613
The id is the one of your code snippet on Gist (https://gist.github.com/1163613). An old version of Luna is being used, I'm not sure which one, I have to update it.

This was not really built for for development use, but rather for sharing Lua binary files. An HTML form would be more suited. And don't expect this service to be always available, I have limited resources on the server.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Adriweb on January 02, 2012, 09:59:25 am
it's very important because I'd like create a lua game


If you're < 3.0.2, you can still use any other community-based converter, like the python one or the shell-based one, all available here or on TI-Planet or TI-Calc.org

edit: found it here   :   http://www.ticalc.org/archives/files/fileinfo/437/43705.html (http://www.ticalc.org/archives/files/fileinfo/437/43705.html)

syntax is :  python maketns.py source.lua output.tns
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Alex on January 02, 2012, 11:02:25 am
i'v 3.02 on computer softwar but 3.1 on calc
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: renatose on January 02, 2012, 04:52:22 pm
i'v 3.02 on computer softwar but 3.1 on calc
so luna is your only way to go
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: ExtendeD on January 03, 2012, 09:10:09 am
Here it is: http://bytecode.fr/luna/page.php5?id=1163613
The id is the one of your code snippet on Gist (https://gist.github.com/1163613). An old version of Luna is being used, I'm not sure which one, I have to update it.

This was not really built for for development use, but rather for sharing Lua binary files. An HTML form would be more suited. And don't expect this service to be always available, I have limited resources on the server.

I've updated it to Luna v0.2b. The new URL is now http://bytecode.fr/luna/?id=1163613
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Deep Toaster on January 03, 2012, 09:40:36 am
Are there Linux binaries of Luna 0.2b? (Or instructions on how to compile?) I've never compile anything on Linux before.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Jim Bauwens on January 03, 2012, 10:22:10 am
Compiling is just running "make".
Of course you will need to install the openSSL libraries (also -dev) and zip dev libraries.
But these aren't to hard to find in the repo's :)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Deep Toaster on January 03, 2012, 10:32:31 am
Thanks, I'll try that.

By the way, ExtendeD, your bookmarklet on that page still points to the old URL.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: ExtendeD on January 03, 2012, 11:05:53 am
Thanks Deep Thought, it's fixed.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Alex on January 03, 2012, 12:06:26 pm
Ti-nspire student software put "Format non-supporté"
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: ExtendeD on January 05, 2012, 04:09:36 am
Do you have the problem even with these files? http://www.ticalc.org/pub/nspire/lua/games/
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Alex on January 05, 2012, 12:53:48 pm
no it's ok i'v resolved the problem
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: ExtendeD on June 24, 2012, 01:27:02 pm
I have released Luna v0.3 (http://www.unsads.com/projects/nsptools/downloader/download/release/3) with OS v3.2 compatibility and full support of special characters: http://ndlessly.wordpress.com/2012/06/24/luna-updated-compatibility-with-os-v3-2-and-special-characters/
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Jim Bauwens on June 24, 2012, 03:40:08 pm
Thanks ! Also yay for special character support, it was something that was bugging me :D
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: renatose on June 24, 2012, 04:08:25 pm
I have released Luna v0.3 (http://www.unsads.com/projects/nsptools/downloader/download/release/3) with OS v3.2 compatibility and full support of special characters: http://ndlessly.wordpress.com/2012/06/24/luna-updated-compatibility-with-os-v3-2-and-special-characters/
yay! thank you ExtendeD!
I was expecting the special characters for so long, but now its here thanks to you.

EDIT: I couldn't build it on ubuntu, what did I do badly?

Spoiler For Console Output:
[email protected]:~/luna-v0.3/src$ make dist
rm -rf *.o luna dist
gcc -W -Wall   -c -o luna.o luna.c
gcc -W -Wall   -c -o zip.o minizip-1.1/zip.c
In file included from minizip-1.1/zip.c:196:0:
minizip-1.1/crypt.h: In function ‘decrypt_byte’:
minizip-1.1/crypt.h:35:68: warning: unused parameter ‘pcrc_32_tab’ [-Wunused-parameter]
gcc -W -Wall   -c -o ioapi.o minizip-1.1/ioapi.c
minizip-1.1/ioapi.c: In function ‘fopen_file_func’:
minizip-1.1/ioapi.c:83:49: warning: unused parameter ‘opaque’ [-Wunused-parameter]
minizip-1.1/ioapi.c: In function ‘fopen64_file_func’:
minizip-1.1/ioapi.c:101:51: warning: unused parameter ‘opaque’ [-Wunused-parameter]
minizip-1.1/ioapi.c: In function ‘fread_file_func’:
minizip-1.1/ioapi.c:120:48: warning: unused parameter ‘opaque’ [-Wunused-parameter]
minizip-1.1/ioapi.c: In function ‘fwrite_file_func’:
minizip-1.1/ioapi.c:127:49: warning: unused parameter ‘opaque’ [-Wunused-parameter]
minizip-1.1/ioapi.c: In function ‘ftell_file_func’:
minizip-1.1/ioapi.c:134:47: warning: unused parameter ‘opaque’ [-Wunused-parameter]
minizip-1.1/ioapi.c: In function ‘ftell64_file_func’:
minizip-1.1/ioapi.c:142:53: warning: unused parameter ‘opaque’ [-Wunused-parameter]
minizip-1.1/ioapi.c: In function ‘fseek_file_func’:
minizip-1.1/ioapi.c:149:48: warning: unused parameter ‘opaque’ [-Wunused-parameter]
minizip-1.1/ioapi.c: In function ‘fseek64_file_func’:
minizip-1.1/ioapi.c:172:50: warning: unused parameter ‘opaque’ [-Wunused-parameter]
minizip-1.1/ioapi.c: In function ‘fclose_file_func’:
minizip-1.1/ioapi.c:198:47: warning: unused parameter ‘opaque’ [-Wunused-parameter]
minizip-1.1/ioapi.c: In function ‘ferror_file_func’:
minizip-1.1/ioapi.c:205:47: warning: unused parameter ‘opaque’ [-Wunused-parameter]
gcc -o luna luna.o zip.o ioapi.o -lssl -lz
luna.o: In function `doccrypt':
luna.c:(.text+0xa8c): undefined reference to `DES_set_key_checked'
luna.c:(.text+0xaab): undefined reference to `DES_set_key_checked'
luna.c:(.text+0xaca): undefined reference to `DES_set_key_checked'
luna.c:(.text+0xb77): undefined reference to `DES_ecb3_encrypt'
collect2: ld returned 1 exit status
make: *** [luna] Error 1
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Adriweb on June 26, 2012, 04:45:59 am
Here's the makefile that worked for me :)

Spoiler For Spoiler:
Code: [Select]
CC:=gcc
CFLAGS:=-W -Wall -m32
LDFLAGS:= -lssl -lz -m32
VPATH := minizip-1.1

OS ?= `uname -s`
ifeq ($(OS),Windows_NT)
  EXEEXT = .exe
else
CFLAGS := $(CFLAGS) -DUSE_FILE32API
LDFLAGS:= $(LDFLAGS) -lcrypto
endif

all: luna$(EXEEXT)

luna$(EXEEXT): luna.o zip.o ioapi.o
gcc -o [email protected] $^ $(LDFLAGS)

dist: clean all
mkdir -p dist/src
rm -f *.o
find . -maxdepth 1 ! -name 'luna$(EXEEXT)' -a ! -name dist -a ! -name . -exec cp -r {} dist/src \;
cp luna$(EXEEXT) *.dll *.txt dist

clean:
rm -rf *.o luna$(EXEEXT) dist

(this is forcing the 32bit compiling I believe)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: blfngl on August 29, 2012, 09:18:46 pm
Hiya, I'm having trouble converting it :P, do I just run the .bat with a .lua file in it? Or do I need to do something else...
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: cyanophycean314 on August 29, 2012, 09:22:51 pm
The easiest way to use luna is go to command line (I'm assuming you use Windows) and go to the directory of luna. You probably should also put your lua source there too. Then type
"luna.exe <filename>.lua <filename>.tns"

I use a .bat for speed. My code looks like
Code: [Select]
cd C:\Graphing Calculator\Nspire\Lua Programming\luna-v0.2b
luna.exe jumper.lua jumper.tns
I usually work on one project at a time, so it's faster just clicking on an icon.
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: blfngl on August 29, 2012, 09:28:08 pm
Thank you good sir :D
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Mr-Kitty on January 27, 2013, 02:01:33 pm
For those of you who are on OS X and are having trouble building Luna, I found out why it won't build. In the Luna's readme, it states you need gcc >=4.5, but apple's gcc is gcc 4.2. Using MacPorts (or Homebrew, Fink), install gcc 4.7 (run "sudo port install gcc47"). Then open up Luna's Makefile with a text editor and change any instances of "gcc" to "/opt/local/bin/gcc-mp-4.7". Cd to the Luna directory in Terminal, and do make "dist luna", and it builds!

Code: [Select]
CC:=/opt/local/bin/gcc-mp-4.7
CFLAGS:=-W -Wall -m32
LDFLAGS:= -lssl -lz -m32
VPATH := minizip-1.1

OS ?= `uname -s`
ifeq ($(OS),Windows_NT)
  EXEEXT = .exe
else
CFLAGS := $(CFLAGS) -DUSE_FILE32API
LDFLAGS:= $(LDFLAGS) -lcrypto
endif

all: luna$(EXEEXT)

luna$(EXEEXT): luna.o zip.o ioapi.o
/opt/local/bin/gcc-mp-4.7 -o [email protected] $^ $(LDFLAGS)

dist: clean all
mkdir -p dist/src
rm -f *.o
find . -maxdepth 1 ! -name 'luna$(EXEEXT)' -a ! -name dist -a ! -name . -exec cp -r {} dist/src \;
cp luna$(EXEEXT) *.dll *.txt dist

clean:
rm -rf *.o luna$(EXEEXT) dist

Also, link for those who don't want to build themselves:
https://dl.dropbox.com/u/4657389/luna-v3.0a-osx-intel.zip (https://dl.dropbox.com/u/4657389/luna-v3.0a-osx-intel.zip)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Jim Bauwens on January 27, 2013, 07:19:45 pm
For those of you who are on OS X and are having trouble building Luna, I found out why it won't build. In the Luna's readme, it states you need gcc >=4.5, but apple's gcc is gcc 4.2. Using MacPorts (or Homebrew, Fink), install gcc 4.7 (run "sudo port install gcc47"). Then open up Luna's Makefile with a text editor and change any instances of "gcc" to "/opt/local/bin/gcc-mp-4.7". Cd to the Luna directory in Terminal, and do make "dist luna", and it builds!

Code: [Select]
CC:=/opt/local/bin/gcc-mp-4.7
CFLAGS:=-W -Wall -m32
LDFLAGS:= -lssl -lz -m32
VPATH := minizip-1.1

OS ?= `uname -s`
ifeq ($(OS),Windows_NT)
  EXEEXT = .exe
else
CFLAGS := $(CFLAGS) -DUSE_FILE32API
LDFLAGS:= $(LDFLAGS) -lcrypto
endif

all: luna$(EXEEXT)

luna$(EXEEXT): luna.o zip.o ioapi.o
/opt/local/bin/gcc-mp-4.7 -o [email protected] $^ $(LDFLAGS)

dist: clean all
mkdir -p dist/src
rm -f *.o
find . -maxdepth 1 ! -name 'luna$(EXEEXT)' -a ! -name dist -a ! -name . -exec cp -r {} dist/src \;
cp luna$(EXEEXT) *.dll *.txt dist

clean:
rm -rf *.o luna$(EXEEXT) dist

Also, link for those who don't want to build themselves:
https://dl.dropbox.com/u/4657389/luna-v3.0a-osx-intel.zip (https://dl.dropbox.com/u/4657389/luna-v3.0a-osx-intel.zip)

Thanks for sharing, I'm sure this will help several members :)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Lionel Debroux on January 28, 2013, 01:32:47 am
Alternatively, using clang, if you have that installed, should work. Works for me under Linux.

(I tried to post this yesterday evening, but my session timed out and I didn't notice)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Mr-Kitty on February 18, 2013, 09:17:27 pm
Alternatively, using clang, if you have that installed, should work. Works for me under Linux.

(I tried to post this yesterday evening, but my session timed out and I didn't notice)

Just tried it, can confirm it works. Replace all instances of "gcc" with "clang" (Obviously clang has to be installed, not sure if it is by default(Edit: It comes with the Xcode command line tools (https://developer.apple.com/xcode/)))

Spoiler For build with clang Makefile:
Code: [Select]
CC:=clang
CFLAGS:=-W -Wall -m32
LDFLAGS:= -lssl -lz -m32
VPATH := minizip-1.1

OS ?= `uname -s`
ifeq ($(OS),Windows_NT)
  EXEEXT = .exe
else
CFLAGS := $(CFLAGS) -DUSE_FILE32API
LDFLAGS:= $(LDFLAGS) -lcrypto
endif

all: luna$(EXEEXT)

luna$(EXEEXT): luna.o zip.o ioapi.o
clang -o [email protected] $^ $(LDFLAGS)

dist: clean all
mkdir -p dist/src
rm -f *.o
find . -maxdepth 1 ! -name 'luna$(EXEEXT)' -a ! -name dist -a ! -name . -exec cp -r {} dist/src \;
cp luna$(EXEEXT) *.dll *.txt dist

clean:
rm -rf *.o luna$(EXEEXT) dist
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: ajorians on February 26, 2013, 09:32:06 am
Hi guys!

First I think this program is really cool!  I find it amazing how much you all figured out about this file format!

If I may; I modified the source code a little to add the ability to extract the Problem1.xml out of the .tns file (though it ONLY works with the luna created .tns files).

So for what it is worth here are the source files: https://dl.dropbox.com/s/jh6nww60fha4tb2/luna_src.zip

After you build it you can do this (example in Linux):
./luna pong.lua pong.tns #Can already do this in current luna
./luna pong.tns #Lists files in the tns file
./luna pong.tns Problem1.xml #Extracts Problem1.xml out and saves it as Problem1.xml

Since extracting only works with the luna created .tns file; that unfortunately means if you take the "hello world" XML from http://ndlessly.wordpress.com/2011/09/19/luna-updated-for-third-party-tns-document-generation/ and construct a .tns file out of it and then on the calculator immediately save it; this program is no longer able to extract the Problem1.xml out of it!

I figure this is a good step!  My change was done with full admiration and respect to everyone's work before mine.

My motivation is it would be cool if nTxt could read/write Note files.  As well as for me I'd think I'd like to make a calculator game, for instance, that would use note file(s) for the levels sets, high score table, config, etc.  So instead of the level sets being some sort of file with the extension being .tns that are sent to the calculator; have them be note files that a user could edit.  I know this is unnecessary because a user can already use nTxt to edit files.

At any rate I learned more about tns files! :)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: Lionel Debroux on February 26, 2013, 01:24:09 pm
Welcome. We saw your programs on ticalc.org, but it seems to be the first time you're joining a community actively :)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: ajorians on February 26, 2013, 04:01:03 pm
Thanks Lionel!

That was my first Omnimaga post!  I very much would like to make some amazing things for these devices!  As well as take a more active part in this community!  I'm glad you like my programs!  I intend on making more (and more comprehensive ones too)! :)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: DJ Omnimaga on February 26, 2013, 04:06:56 pm
Heya and welcome here, I hope you enjoy your stay. Also thanks for this update. :)

I only saw your aquarium program so far but didn't have time to check the others, because Ticalc.org server is so slow lately (it takes around 30 seconds to load every page). What are your future plans in terms of programs? :)

EDIT: Wow you joined ticalc.org in 1997? O.O (Your ID has 3 digits)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: ajorians on February 27, 2013, 07:56:29 am
Hey DJ_O,

My future plans of programs on the calculator will be for the TI-nSpire (because of color screen, memory, processor speed)!  In the short run I'll create single player games (some puzzle games, etc)!  In the long run I hope to make multiplayer games that you can play against A.I.s or another player via the link cable!  Such as Battleship, Hearts, Ticket to Ride, etc.  I've made a long that if anybody else wanted to make the same game I'd happily move onto another program.

Oh I always had a fascination with calculators (grew up without video game systems or computer)!  I should probably explain in detail on another topic about myself than this one.  But as a tech enthusiast the calculator (TI-83 at the time) was the coolest piece of technology I had!  I loved seeing the updates on ticalc.org (and others) and will always be a calculator hobbyist!
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: DJ Omnimaga on March 05, 2013, 04:01:43 pm
This is cool to hear :). I myself haven't programmed calcs from July 2010 until January 2013, when I somehow got a slightly renewed interest in pure-BASIC with the impending release of the 84+C Silver Edition, but I started in July 2001 then started posting on forums around 2 years later. It's fun to see what people can do with these 6-15 MHz things, BASIC or ASM, especially since 2006 when many new tricks got discovered and compiled in wikis.

Can't wait to see new releases and updates from you :)
Title: Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
Post by: ajorians on March 07, 2013, 06:18:24 pm
Hey DJ_O,

Nice!  I love how information has been easy to browse in wikis too!

I'll post, really soon, what I've been working on the last few days (as well as upcoming releases/updates)!

Have a great day!