Omnimaga

Calculator Community => TI Calculators => Calculator C => Topic started by: epic7 on February 25, 2012, 10:45:21 pm

Title: Some questions on Ndless/nRGBlib
Post by: epic7 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) (http://pastebin.com/qjXkNgdt),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?
Title: Re: Some questions on Ndless/nRGBlib
Post by: Lionel Debroux 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 :)
Title: Re: Some questions on Ndless/nRGBlib
Post by: epic7 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.
Title: Re: Some questions on Ndless/nRGBlib
Post by: Jim Bauwens 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).
Title: Re: Some questions on Ndless/nRGBlib
Post by: epic7 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
Title: Re: Some questions on Ndless/nRGBlib
Post by: Jim Bauwens 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.
Title: Re: Some questions on Ndless/nRGBlib
Post by: epic7 on February 27, 2012, 03:17:02 pm
I'll try checking that. What important functions does newlib have?