module lua natif giac
Re: module lua natif giac
Well, is it a Lua interface bug or a Lua bug ?
An interface one would be surprising, though.
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
-
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)- Posts: 14820
- Images: 1131
- Joined: 01 Jun 2007, 00:00
- Location: France
- Gender:
- Calculator(s):→ MyCalcs profile
- Twitter: adriweb
- GitHub: adriweb
Re: module lua natif giac
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.
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.
-
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)- Posts: 217
- Joined: 29 Mar 2014, 15:55
- Gender:
- Calculator(s):→ MyCalcs profile
Re: module lua natif giac
I actually meant "interface" as in "GUI", not as a "bridge" between native and lua 
But yeah, if the latter is what was meant, it probably makes sense then, if some syscalls aren't 100% correct.

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
-
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)- Posts: 14820
- Images: 1131
- Joined: 01 Jun 2007, 00:00
- Location: France
- Gender:
- Calculator(s):→ MyCalcs profile
- Twitter: adriweb
- GitHub: adriweb
Re: module lua natif giac
My guess is that the reboot happens in one of the lua interface call
Indeed giac_caseval is a wrapper to giac::caseval
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?
- 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?
-
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 3721
- Joined: 13 Dec 2013, 16:35
- Gender:
- Calculator(s):→ MyCalcs profile
Re: module lua natif giac
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?
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?
-
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 3721
- Joined: 13 Dec 2013, 16:35
- Gender:
- Calculator(s):→ MyCalcs profile
Re: module lua natif giac
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.
-
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)- Posts: 217
- Joined: 29 Mar 2014, 15:55
- Gender:
- Calculator(s):→ MyCalcs profile
Re: module lua natif giac
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?
-
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 3721
- Joined: 13 Dec 2013, 16:35
- Gender:
- Calculator(s):→ MyCalcs profile
Re: module lua natif giac
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: )
-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: )
-
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)- Posts: 217
- Joined: 29 Mar 2014, 15:55
- Gender:
- Calculator(s):→ MyCalcs profile
Re: module lua natif giac
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.
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.
-
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 3721
- Joined: 13 Dec 2013, 16:35
- Gender:
- Calculator(s):→ MyCalcs profile
Re: module lua natif giac
I looked at the Qt docs and the Meta key is mapped to Control on Mac.
-
VogtinatorPremium
Niveau 9: IC (Compteur Infatigable)- Posts: 217
- Joined: 29 Mar 2014, 15:55
- Gender:
- Calculator(s):→ MyCalcs profile
Return to Native: Ndless, Linux, ...
Who is online
Users browsing this forum: ClaudeBot [spider] and 6 guests