Author Topic: Some questions on Ndless/nRGBlib  (Read 4061 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
Some questions on Ndless/nRGBlib
« on: February 25, 2012, 10:45:21 pm »
I just started making programs with nRGBlib and ndless today, so I'm a beginner with it.

I started making Pong as my first mini-project and I now have a few questions.

If anybody can answer some, I'd really appreciate it :thumbsup:
(Also i mention drawStr in this, and I'm not really sure if I'm remembering the correct name of that function :P)

First, how could the addition of this line cause my calc to crash? ???
yvel+=rmov;
Both of those are defined and have values, but I have no clue why that wouldn't work. Does it depend on the code around it or something?


How can rand() work while using nRGBlib? It gives me errors. After I showed Levak my error (here),he said that there's a conflict between rgblib's rand and yagorto's one. So I guess that means RGBlib has a rand too?

In nRGBlib,  what would you use to display an integer? I only know of drawStr and I don't think that works for it... Also is there perhaps a %d thing like in printf?

For the 4th and 5th arguments of drawStr, what do they do? Size?

And so I can be clear on how to use RGBlib, is there some sort of guide I can use that says all the functions?
« Last Edit: February 26, 2012, 12:40:28 pm by epic7 »

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Some questions on Ndless/nRGBlib
« Reply #1 on: February 26, 2012, 02:23:32 am »
If there's a conflict between nRGBlib and yagarto/newlib, indeed, nRGBlib must be defining its own rand() function.

Displaying integers is usually done through a combination of sprintf (or the less standard "itoa" family) and some string-drawing function :)
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: Some questions on Ndless/nRGBlib
« Reply #2 on: February 26, 2012, 09:33:00 am »
So does that mean I can't use rand() while using nRGBlib?

Would it be possible to just delete one of the rands? I found nRGBlib's function for it in the source.
« Last Edit: February 26, 2012, 12:27:46 pm by epic7 »

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Some questions on Ndless/nRGBlib
« Reply #3 on: February 27, 2012, 02:17:43 am »
Do you need to inlucde newlib? It might be better to do without, you will have less problems (but also less functions).

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Some questions on Ndless/nRGBlib
« Reply #4 on: February 27, 2012, 07:09:24 am »
Because I have no clue what newlib is, I don't think I'm including it :p

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Some questions on Ndless/nRGBlib
« Reply #5 on: February 27, 2012, 02:06:24 pm »
Do you have "-nostdlib" in your makefile? If not, you are compiling with newlib.
Of course, I don't have that much experience in this area, so I might be wrong.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Some questions on Ndless/nRGBlib
« Reply #6 on: February 27, 2012, 03:17:02 pm »
I'll try checking that. What important functions does newlib have?