Author Topic: Ndless v3.1 beta for OS v3.1 with TI-Nspire CX support released  (Read 87070 times)

0 Members and 1 Guest are viewing this topic.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Ndless v3.1 beta for OS v3.1 with TI-Nspire CX support released
« Reply #135 on: February 25, 2012, 04:43:49 pm »
Ok, I cant get rand() or randMinMax() to work.

I tried
Code: [Select]
yvel=randMinMax(-256, 256);and also using
Code: [Select]
yvel=rand()%513-256;which both give me errors.

I'm using nRGBlib, and according to Levak,
Quote from: Levak
it seems there is a conflict between libRGB rand and yagorto one

Anyone have any ideas?

Also, how could this line cause my calc to crash?
Code: [Select]
yvel+=rmov;
« Last Edit: February 25, 2012, 09:19:23 pm by epic7 »

Offline sammyMaX

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 204
  • Rating: +9/-0
    • View Profile
Re: Ndless v3.1 beta for OS v3.1 with TI-Nspire CX support released
« Reply #136 on: February 26, 2012, 05:28:23 pm »
Here's another potential bug (or maybe it's just me?)
When building my program in Ndless r557, the console gives me these errors:
Code: [Select]
In file included from main.c:4:0:
/home/philip/lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/include/string.h: At top level:
/home/philip/lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/include/string.h:35:9: error: conflicting types for ‘strlen’
/home/philip/Downloads/ndless-r557/sdk/bin/../include/os.h:243:1: note: previous definition of ‘strlen’ was here

I find that "strlen" was defined in line 47 of syscalls.h. Is there a conflict between this and something already defined in gcc?

Are you wondering who Sammy is? My avatar is Sammy.
   

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Ndless v3.1 beta for OS v3.1 with TI-Nspire CX support released
« Reply #137 on: February 26, 2012, 06:13:13 pm »
Ok, either I'm just too inexperienced with C, or theres something thats screwing up here...

When I add simple lines like:
yvel+=rmov;
and
yvel=-yvel;
my calc crashes when running the program... I have no clue why.

I was able to get yvel+=ymov; to work by making an unnecesary function to do what that line should have done D:
« Last Edit: February 26, 2012, 06:18:07 pm by epic7 »

Offline sammyMaX

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 204
  • Rating: +9/-0
    • View Profile
Re: Ndless v3.1 beta for OS v3.1 with TI-Nspire CX support released
« Reply #138 on: February 26, 2012, 06:32:18 pm »
I don't know about that... full code please?

Are you wondering who Sammy is? My avatar is Sammy.
   

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Ndless v3.1 beta for OS v3.1 with TI-Nspire CX support released
« Reply #139 on: February 26, 2012, 06:44:33 pm »
http://pastebin.com/dkP6qnfB
I put comments in the areas that screw up

Offline sammyMaX

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 204
  • Rating: +9/-0
    • View Profile
Re: Ndless v3.1 beta for OS v3.1 with TI-Nspire CX support released
« Reply #140 on: February 26, 2012, 06:53:51 pm »
Try saying yvel = yvel + rmov instead, and see if that works.

Are you wondering who Sammy is? My avatar is Sammy.
   

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Ndless v3.1 beta for OS v3.1 with TI-Nspire CX support released
« Reply #141 on: February 26, 2012, 07:09:53 pm »
I tried that before; it still crashed.

I had rmov go to 128 at first, and used that function.
Then changed rmov to 64 to tweak the effect, and it didn't seem to change yvel again.
Then, I changed it back to 128, which was how it was before when it worked, and IT CRASHES. Then, I changed it back to 64 and not only does it not work like before, it now crashes the calc!
How hard can it possibly be to add two variables together?
And also doing yvel=-yvel still crashes the calc for some reason!
Now, simply having the line lmov=-64 crashes it!
Does the - sign not mean negative in C like in axe?

I give up. I'll try it again tommorow.
« Last Edit: February 26, 2012, 07:46:25 pm by epic7 »

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Ndless v3.1 beta for OS v3.1 with TI-Nspire CX support released
« Reply #142 on: February 26, 2012, 08:03:29 pm »
Could Ndless possibly still be having problems with global variables?
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Levak

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +208/-39
    • View Profile
    • My website
Re: Ndless v3.1 beta for OS v3.1 with TI-Nspire CX support released
« Reply #143 on: February 27, 2012, 01:39:46 am »
Here's another potential bug (or maybe it's just me?)
When building my program in Ndless r557, the console gives me these errors:
Code: [Select]
In file included from main.c:4:0:
/home/philip/lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/include/string.h: At top level:
/home/philip/lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/include/string.h:35:9: error: conflicting types for ‘strlen’
/home/philip/Downloads/ndless-r557/sdk/bin/../include/os.h:243:1: note: previous definition of ‘strlen’ was here

I find that "strlen" was defined in line 47 of syscalls.h. Is there a conflict between this and something already defined in gcc?
Yes. You shouldn't use gcc libs only if you know what you're doing, because most of syscalls are already found (not all of them sadly).
Functions like strlen, strcat, strcmp etc ... are in os.h, you don't need string.h, just try to remove the #include =)  (same for other libs)
I do not get mad at people, I just want them to learn the way I learnt.
My website - TI-Planet - iNspired-Lua

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Ndless v3.1 beta for OS v3.1 with TI-Nspire CX support released
« Reply #144 on: February 27, 2012, 06:58:30 pm »
Could Ndless possibly still be having problems with global variables?
I made the variables local, now the program actually runs. However, I'm still left with issues where I can't find what I'm doing wrong , like having yvel set to 128, and then y+=yvel; doing absolutely nothing :banghead:  :banghead: :banghead:
« Last Edit: February 27, 2012, 07:07:52 pm by epic7 »

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Ndless v3.1 beta for OS v3.1 with TI-Nspire CX support released
« Reply #145 on: February 29, 2012, 06:12:12 pm »
Ah nvm, fixed it. Now everything works fine (aside from the rand() conflict), so yeah, I think Ndless might have problems with global variables then.

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Ndless v3.1 beta for OS v3.1 with TI-Nspire CX support released
« Reply #146 on: March 01, 2012, 01:36:25 am »
Ndless does have a known, documented problem with global variables ;)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Ndless v3.1 beta for OS v3.1 with TI-Nspire CX support released
« Reply #147 on: March 06, 2012, 06:56:00 pm »
What if I need to use global variables?

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Ndless v3.1 beta for OS v3.1 with TI-Nspire CX support released
« Reply #148 on: March 07, 2012, 01:12:25 am »
For now, you need to relocate them manually, with nl_relocate*.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: Ndless v3.1 beta for OS v3.1 with TI-Nspire CX support released
« Reply #149 on: March 07, 2012, 02:52:54 pm »
Not all global variables need a special treatment, only those containing string constants and reference to other global elements. nl_relocdata() is documented on Hackspire.
Consider this as a limitation of GCC and not Ndless. GCC doesn't emit relocation information for these variables as it should, and I see no good reason for this.
« Last Edit: March 07, 2012, 02:56:19 pm by ExtendeD »
Ndless.me with the finest TI-Nspire programs