wishlist for NXC

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: wishlist for NXC

Post by HaWe »

I suggest you never again ask for recursions in NXC
who do you think you are to think you may give me advices?
Better ignore posts which are not addressed to you in future and walk along! (as already suggested by J.H.)
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: wishlist for NXC

Post by afanofosc »

Also, it is best to ignore advice from people that you think should not be giving you advice rather than to ask them who they think they are and give them advice that they don't think you should be giving them.

If the firmware supported a function call mechanism that allowed for recursion then maybe I would add support for recursion in NXC.

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: wishlist for NXC

Post by HaWe »

what about making such fw changes for recursions?
(and, BTW, also for a peer-to-peer-network protocol?)
jld001
Posts: 19
Joined: 07 Sep 2012, 21:32

Re: wishlist for NXC

Post by jld001 »

http://pastebin.com/Apd8eSD8
I have a program that cycles through a bool array and draws it as rectangles. I would like to be able to clear the false rectangles and fill the true ones. The DRAW_OPT_CLEAR, and DRAW_OPT_INVERT don't work for clearing the false rectangles.
Any ideas? Thanks.
My Githubz of Source Codez, in order of awesomeness:
https://github.com/ArtskydJ/NXC_Source
https://github.com/ArtskydJ/NXC_Tests
My Lego Creations, in no particular order:
LEGO Bop-It - http://www.youtube.com/watch?v=6TsqrBVKbj0
LEGO Safe - http://www.youtube.com/watch?v=MyDRfVquHuY
jld001
Posts: 19
Joined: 07 Sep 2012, 21:32

Re: wishlist for NXC

Post by jld001 »

I am working on some games, and for the graphics to look best, I want to clear only part of the screen, not the entire screen. (Clearing the entire screen creates flicker.)
I would imagine the code would look something like this:

Code: Select all

RectOut(x,y,w,h,DRAW_OPT_NORMAL);
Wait(1000);
RectOut(x,y,w,h,DRAW_OPT_FILL_INVERT); //No such thing :)
Here are the actual drawing option constants.

Code: Select all

#define  DRAW_OPT_CLEAR_PIXELS (0x0004)
#define  DRAW_OPT_CLEAR             (0x0004)
#define  DRAW_OPT_INVERT            (0x0004)
Clear Pixels, Clear, and Invert don't clear the rectangle specified.
Does anyone know a workaround, or would anyone be interested in this being implemented?
My Githubz of Source Codez, in order of awesomeness:
https://github.com/ArtskydJ/NXC_Source
https://github.com/ArtskydJ/NXC_Tests
My Lego Creations, in no particular order:
LEGO Bop-It - http://www.youtube.com/watch?v=6TsqrBVKbj0
LEGO Safe - http://www.youtube.com/watch?v=MyDRfVquHuY
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: wishlist for NXC

Post by mattallen37 »

Use:

Code: Select all

DRAW_OPT_FILL_SHAPE | DRAW_OPT_CLEAR
for the draw options (equals 0x24).

So, it would be like this:

Code: Select all

RectOut(x, y, w, h, (DRAW_OPT_FILL_SHAPE | DRAW_OPT_CLEAR));
or you could #define DRAW_OPT_FILL_INVERT like this:

Code: Select all

#define DRAW_OPT_FILL_INVERT (DRAW_OPT_FILL_SHAPE | DRAW_OPT_CLEAR)
and then you could use:

Code: Select all

RectOut(x, y, w, h, DRAW_OPT_FILL_INVERT);
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
jld001
Posts: 19
Joined: 07 Sep 2012, 21:32

Re: wishlist for NXC

Post by jld001 »

:D Thank you so much, I implemented it and it works great! :D
My Githubz of Source Codez, in order of awesomeness:
https://github.com/ArtskydJ/NXC_Source
https://github.com/ArtskydJ/NXC_Tests
My Lego Creations, in no particular order:
LEGO Bop-It - http://www.youtube.com/watch?v=6TsqrBVKbj0
LEGO Safe - http://www.youtube.com/watch?v=MyDRfVquHuY
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: wishlist for NXC

Post by HaWe »

currently, TextOut cuts off the rest of a string when the end of a line has been reached.
What about making automatic line breaks (wordwrap, CR/LF) in these cases like on a real text console instead of cutting off the string?
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: wishlist for NXC

Post by afanofosc »

I think adding support for text wrapping either automatically at the edge of the screen (with the appropriate text option) and/or support for LF and CR would be great. I can work on that while I wait anxiously for some additional information about the new LEGO MINDSTORMS EV3 and start focusing more on implementing support in BricxCC for native ARM9 Linux executables.

Wired has some cool photos from the LEGO Education version:

Image

Image


From the LEGO Education website: http://www.legoeducation.us/eng/categor ... cation/ev3

The retail set models from Engadget.com: http://www.engadget.com/gallery/lego-mindstorms-ev3/

http://www.engadget.com/2013/01/07/lego ... bile-apps/

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: wishlist for NXC

Post by HaWe »

yes, that would be great.
Also different unfulfilled wishes for NXC (like e.g., for making real superscaled-parallelized-NXT-IO-control, pointers, recursions, stack, heap, dynamic memory allocation, stdio.h lib, and all based on a real ANSI C compiler for genuine ARM machine code like e.g., based on gnu for arm/Linux) instead of that awfully slow and straitened Lego firmware will now hopefully be history by then...
(conditional when again provided by a proven J.H. API)

8-)
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests