π
<-

module lua natif giac

C, C++, ASM...

Re: module lua natif giac

Messagede Adriweb » 29 Avr 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
Avatar de l’utilisateur
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Prochain niv.: 82.2%
 
Messages: 14896
Images: 1211
Inscription: 01 Juin 2007, 00:00
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
Twitter/X: adriweb
GitHub: adriweb

Re: module lua natif giac

Messagede Vogtinator » 29 Avr 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.
Avatar de l’utilisateur
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Prochain niv.: 1.6%
 
Messages: 217
Inscription: 29 Mar 2014, 15:55
Genre: Homme
Calculatrice(s):
MyCalcs profile

Re: module lua natif giac

Messagede Adriweb » 29 Avr 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
Avatar de l’utilisateur
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Prochain niv.: 82.2%
 
Messages: 14896
Images: 1211
Inscription: 01 Juin 2007, 00:00
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
Twitter/X: adriweb
GitHub: adriweb

En ligne

Re: module lua natif giac

Messagede parisse » 29 Avr 2015, 19:56

My guess is that the reboot happens in one of the lua interface call
Code: Tout sélectionner
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: Tout sélectionner
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?
Avatar de l’utilisateur
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 95.8%
 
Messages: 3838
Inscription: 13 Déc 2013, 16:35
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

En ligne

Re: module lua natif giac

Messagede parisse » 01 Mai 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?
Avatar de l’utilisateur
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 95.8%
 
Messages: 3838
Inscription: 13 Déc 2013, 16:35
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

Re: module lua natif giac

Messagede Vogtinator » 01 Mai 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.
Dernière édition par Vogtinator le 01 Mai 2015, 11:36, édité 1 fois.
Avatar de l’utilisateur
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Prochain niv.: 1.6%
 
Messages: 217
Inscription: 29 Mar 2014, 15:55
Genre: Homme
Calculatrice(s):
MyCalcs profile

En ligne

Re: module lua natif giac

Messagede parisse » 01 Mai 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?
Avatar de l’utilisateur
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 95.8%
 
Messages: 3838
Inscription: 13 Déc 2013, 16:35
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

Re: module lua natif giac

Messagede Vogtinator » 01 Mai 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: )
Avatar de l’utilisateur
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Prochain niv.: 1.6%
 
Messages: 217
Inscription: 29 Mar 2014, 15:55
Genre: Homme
Calculatrice(s):
MyCalcs profile

En ligne

Re: module lua natif giac

Messagede parisse » 01 Mai 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.
Avatar de l’utilisateur
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Prochain niv.: 95.8%
 
Messages: 3838
Inscription: 13 Déc 2013, 16:35
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

Re: module lua natif giac

Messagede Vogtinator » 01 Mai 2015, 14:45

I looked at the Qt docs and the Meta key is mapped to Control on Mac.
Avatar de l’utilisateur
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)
Niveau 9: IC (Compteur Infatigable)
Prochain niv.: 1.6%
 
Messages: 217
Inscription: 29 Mar 2014, 15:55
Genre: Homme
Calculatrice(s):
MyCalcs profile

PrécédenteSuivante

Retourner vers Native: Ndless, Linux, ...

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 8 invités

-
Rechercher
-
Social TI-Planet
-
Sujets à la une
Ndless for CX 4.5.5 / CX II 6.2.0
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 !
12345
-
Faire un don / Premium
Pour plus de concours, de lots, de tests, nous aider à payer le serveur et les domaines...
Faire un don
Découvrez les avantages d'un compte donateur !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partenaires et pub
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
2146 utilisateurs:
>2119 invités
>19 membres
>8 robots
Record simultané (sur 6 mois):
43991 utilisateurs (le 10/09/2025)
-
Autres sites intéressants
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)