π
<-

module lua natif giac

C, C++, ASM...

Re: module lua natif giac

Unread postby Adriweb » 29 Apr 2015, 18:31

Well, is it a Lua interface bug or a Lua bug ?
An interface one would be surprising, though.

MyCalcs: Help the community's calculator documentations by filling out your calculators info!
MyCalcs: Aidez la communauté à documenter les calculatrices en donnant des infos sur vos calculatrices !
Inspired-Lua.org: All about TI-Nspire Lua programming (tutorials, wiki/docs...)
My calculator programs
Mes programmes pour calculatrices
User avatar
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 79.7%
 
Posts: 14820
Images: 1131
Joined: 01 Jun 2007, 00:00
Location: France
Gender: Male
Calculator(s):
MyCalcs profile
Twitter: adriweb
GitHub: adriweb

Re: module lua natif giac

Unread postby Vogtinator » 29 Apr 2015, 18:36

After the big changes and updates to ndless and the SDK I never tested Lua thoroughly, so it may as well be one.
If would really surprise me if it was in ndless itself and not the SDK, as the syscall addresses are the same.
It should be easy to distinguish those cases by testing in various environments.
User avatar
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Level up: 1.6%
 
Posts: 217
Joined: 29 Mar 2014, 15:55
Gender: Male
Calculator(s):
MyCalcs profile

Re: module lua natif giac

Unread postby Adriweb » 29 Apr 2015, 19:11

I actually meant "interface" as in "GUI", not as a "bridge" between native and lua :P
But yeah, if the latter is what was meant, it probably makes sense then, if some syscalls aren't 100% correct.

MyCalcs: Help the community's calculator documentations by filling out your calculators info!
MyCalcs: Aidez la communauté à documenter les calculatrices en donnant des infos sur vos calculatrices !
Inspired-Lua.org: All about TI-Nspire Lua programming (tutorials, wiki/docs...)
My calculator programs
Mes programmes pour calculatrices
User avatar
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 79.7%
 
Posts: 14820
Images: 1131
Joined: 01 Jun 2007, 00:00
Location: France
Gender: Male
Calculator(s):
MyCalcs profile
Twitter: adriweb
GitHub: adriweb

Re: module lua natif giac

Unread postby parisse » 29 Apr 2015, 19:56

My guess is that the reboot happens in one of the lua interface call
Code: Select all
static int caseval(lua_State *L) {
   const char *param = luaL_checkstring(L, 1);
   const char * ans=giac_caseval(param);
   lua_pushlstring(L,ans,strlen(ans));   
   return 1;
}

Indeed giac_caseval is a wrapper to giac::caseval
Code: Select all
const char * giac_caseval(const char * s){
  vx_var=identificateur("x");
  //static nio::console console_cin;
  //console_cin_ptr=&console_cin;
  return giac::caseval(s);
}

and giac::caseval is called without bug in giac.tns by the commandline caseval(sqrt(2))

Perhaps in lua_pushlstring. Another hypothesis could be that the const char * passed to caseval should be copied?
User avatar
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Level up: 89.4%
 
Posts: 3721
Joined: 13 Dec 2013, 16:35
Gender: Not specified
Calculator(s):
MyCalcs profile

Re: module lua natif giac

Unread postby parisse » 01 May 2015, 10:34

Some other tests:
I could reduce the size of compilation by using -fno-exceptions and -fno-rtti (2.5M compressed, twice more uncompressed).
This does not prevent the module to reboot for sqrt(5).
I can not run giac.tns or khicas/luagiac.luax inside my copy of nspire_emu. It's the same as on a nspire (non-cx). Perhaps because there is not enough memory, or there is some other incompatibility.
I can not compile nspire_emu/qt downloaded from git clone https://github.com/Vogtinator/nspire_emu (use of undeclared identifier 'read_word_ldr' on OSX). Is there a way to use the old nspire_emu with a CX flash/keyboard?
User avatar
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Level up: 89.4%
 
Posts: 3721
Joined: 13 Dec 2013, 16:35
Gender: Not specified
Calculator(s):
MyCalcs profile

Re: module lua natif giac

Unread postby Vogtinator » 01 May 2015, 11:35

I can not run giac.tns or khicas/luagiac.luax inside my copy of nspire_emu. It's the same as on a nspire (non-cx). Perhaps because there is not enough memory, or there is some other incompatibility.

Yeah, unless the /R switch is enabled, the calc has a SDRAM size of 32MB.

I can not compile nspire_emu/qt downloaded from git clone https://github.com/Vogtinator/nspire_emu (use of undeclared identifier 'read_word_ldr' on OSX).

Fixed now, but http://github.com/nspire-emus/nspire_emu is more stable and shouldn't break that often.
If you create a flash in nspire_emu-qt it will automatically create a 132MB flash and 64MiB RAM if you choose a CX calc.
Last edited by Vogtinator on 01 May 2015, 11:36, edited 1 time in total.
User avatar
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Level up: 1.6%
 
Posts: 217
Joined: 29 Mar 2014, 15:55
Gender: Male
Calculator(s):
MyCalcs profile

Re: module lua natif giac

Unread postby parisse » 01 May 2015, 13:18

Ok now I've compiled nspire_emu. But if I run it, I get LCD turned off, and I don't know how to setup the emulator. Where is the doc to set it up?
User avatar
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Level up: 89.4%
 
Posts: 3721
Joined: 13 Dec 2013, 16:35
Gender: Not specified
Calculator(s):
MyCalcs profile

Re: module lua natif giac

Unread postby Vogtinator » 01 May 2015, 14:07

There is no real guide yet, unfortunately. A release of a beta is planned soon, but for now you can follow this:
-Flash->Create
You can leave out everything, but if you select OS and boot2, it will install everything automatically
-Settings->Nspire
Select boot1 and flash images
-Settings->Emulator
Select "Start emulation automatically"
-Emulation->Restart

Basic controls (you can use Alt as well if Meta doesn't work for you):
-Meta-M: Menu
-Meta-Esc: On/Home
-Meta-D: Doc
-F1: (
-F2: )
User avatar
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Level up: 1.6%
 
Posts: 217
Joined: 29 Mar 2014, 15:55
Gender: Male
Calculator(s):
MyCalcs profile

Re: module lua natif giac

Unread postby parisse » 01 May 2015, 14:27

I don't know what you mean by Meta, I tried alt-M and cmd-M, but it did not work to get menu when running ndless_installer, and it even froze the emulation.
Fortunately, I could configure the old nspire_emu for CX and there I can click on menu. I'll see later if I can debug in giac source (it did not work with the old toolchain). If it's possible, then I'll be able to check if the reboot happens in giac code.
User avatar
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Level up: 89.4%
 
Posts: 3721
Joined: 13 Dec 2013, 16:35
Gender: Not specified
Calculator(s):
MyCalcs profile

Re: module lua natif giac

Unread postby Vogtinator » 01 May 2015, 14:45

I looked at the Qt docs and the Meta key is mapped to Control on Mac.
User avatar
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Level up: 1.6%
 
Posts: 217
Joined: 29 Mar 2014, 15:55
Gender: Male
Calculator(s):
MyCalcs profile

PreviousNext

Return to Native: Ndless, Linux, ...

Who is online

Users browsing this forum: ClaudeBot [spider] and 6 guests

-
Search
-
Social TI-Planet
-
Featured topics
Comparaisons des meilleurs prix pour acheter sa calculatrice !
"1 calculatrice pour tous", le programme solidaire de Texas Instruments. Reçois gratuitement et sans aucune obligation d'achat, 5 calculatrices couleur programmables en Python à donner aux élèves les plus nécessiteux de ton lycée. Tu peux recevoir au choix 5 TI-82 Advanced Edition Python ou bien 5 TI-83 Premium CE Edition Python.
Enseignant(e), reçois gratuitement 1 exemplaire de test de la TI-82 Advanced Edition Python. À demander d'ici le 31 décembre 2024.
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
1234
-
Donations / Premium
For more contests, prizes, reviews, helping us pay the server and domains...
Donate
Discover the the advantages of a donor account !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partner and ad
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
1525 utilisateurs:
>1504 invités
>15 membres
>6 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Other interesting websites
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)