Author Topic: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files  (Read 28628 times)

0 Members and 1 Guest are viewing this topic.

Offline cyanophycean314

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 363
  • Rating: +43/-1
  • It's You!
    • View Profile
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.

Offline blfngl

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 121
  • Rating: +3/-4
  • No worry, I'll surpass Calc84 in greatness...never
    • View Profile
Thank you good sir :D
« Last Edit: August 29, 2012, 09:28:37 pm by blfngl »
GAMEGAMEGAMEGAMEGAMEGAMEGAMEGAMEGAMEGAME
My blog:

TiLibs
My Projects:
Minecraft Library

Offline Mr-Kitty

  • LV0 Newcomer (Next: 5)
  • Posts: 2
  • Rating: +1/-0
  • alex3yoyo
    • View Profile
    • Github
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

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
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

Thanks for sharing, I'm sure this will help several members :)

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
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)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline Mr-Kitty

  • LV0 Newcomer (Next: 5)
  • Posts: 2
  • Rating: +1/-0
  • alex3yoyo
    • View Profile
    • Github
Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
« Reply #125 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))

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
« Last Edit: February 18, 2013, 09:27:06 pm by Mr-Kitty »

Offline ajorians

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 105
  • Rating: +47/-0
    • View Profile
Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
« Reply #126 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! :)

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
« Reply #127 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 :)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline ajorians

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 105
  • Rating: +47/-0
    • View Profile
Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
« Reply #128 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)! :)

Offline DJ Omnimaga

  • Now active at https://codewalr.us
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55821
  • Rating: +3151/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
« Reply #129 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)
« Last Edit: February 26, 2013, 04:08:11 pm by DJ_O »
In case you are wondering where I went, I left Omni back in 2015 to form CodeWalrus due to various reasons explained back then, but I stopped calc dev in 2016 and am now mostly active on the CW Discord server at https://discord.gg/cuZcfcF


Bandcamp|Reverbnation|Facebook|Youtube|Twitter

Offline ajorians

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 105
  • Rating: +47/-0
    • View Profile
Re: "Luna" is here and converts your .lua files into 3.0.2-compatible .tns files
« Reply #130 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!

Offline DJ Omnimaga

  • Now active at https://codewalr.us
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55821
  • Rating: +3151/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
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 :)
In case you are wondering where I went, I left Omni back in 2015 to form CodeWalrus due to various reasons explained back then, but I stopped calc dev in 2016 and am now mostly active on the CW Discord server at https://discord.gg/cuZcfcF


Bandcamp|Reverbnation|Facebook|Youtube|Twitter

Offline ajorians

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 105
  • Rating: +47/-0
    • View Profile
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!