To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.nxtOpen lugnet.robotics.nxt in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / NXT / 486
485  |  487
Subject: 
Re: NXC/NBC release news
Newsgroups: 
lugnet.robotics.nxt
Date: 
Thu, 15 Feb 2007 16:32:01 GMT
Viewed: 
13400 times
  
In lugnet.robotics.nxt, Alfonso Martone wrote:

I think there is not an urgent need for a clear-screen flag in a
bunch of NXT screen functions. That is, my sources are full of
"false," flags :-)

I am inclined to agree with you.  The NXT firmware system calls provide the
flexibility for choosing whether to clear the screen before any screen drawing
operation but generally this option is not needed every time.  Since I have a
ClearScreen API function in NXC I think it will be okay to make a breaking
change in the API (so long as it is well publicized) and drop the additional
argument from the API drawing functions.

Also, I don't find any function to clear pixels (no ClearPixel, no
ClearLine, no ClearArea).

Unfortunately, the NXT firmware does not provide a good mechanism for
implementing these sort of functions.  I can add an API function which clears a
line as in one of the 8 8-pixel tall bands of pixels that can be drawn to using
the NumOut and TextOut API functions but not one which clears a line if you mean
a single pixel line drawn using LineOut.  There's no way to clear a single pixel
in the standard NXT firmware (at least, not one which is exposed for use in a
user program) but you can clear or set a 1 pixel wide by 8 pixel tall strip.
Via a single IOMapWrite operation you can clear a 64 pixel wide by 8 pixel tall
horizontal strip.  The 64 byte limit is due to a hard-coded buffer size
limitation in the current version of the standard NXT firmware which I hope to
get changed in the next official release.

Another issue: I am using Mac OS X compiled version. The listing
below does *never* show "1" on the NXT screen (that is, does never
see that the "right/gray" key of the NXT is pressed). If I uncomment
the four lines, I can correctly read "left/gray" key and "enter/
orange" key-pressed status. The bug comes also when I do not use "-
Z2" compiler optimization flag.

This is a documentation flaw.  The constants you are using are for inserting
button press events into the UI module using IOMapWrite and the UIOffsetButton
offset into the UI module IOMap structure.  The constants to use with the
ButtonPressed API function are BTN1..BTN4 or BTNEXIT, BTNRIGHT, BTNLEFT, and
BTNCENTER.  BTN1/BTNEXIT cannot be accessed because of the way the NXT firmware
processes this button outside of user program control.

Thank you for NXC compiler, excellent work.

Thank you for your kind words.  You are quite welcome.  I apologize for not
getting the documentation finished sooner.

John Hansen



Message has 1 Reply:
  Re: NXC/NBC release news
 
(...) I completely agree. This flag bothers me with NXC as well as with NXT-G. (...) I have used a single white pixel .ric file to do just that. Awkward at best, but it works. (...) Not that bad... thanks to you and to Daniele for your (...) (18 years ago, 16-Feb-07, to lugnet.robotics.nxt)

Message is in Reply To:
  Re: NXC/NBC release news
 
Hi John! I think there is not an urgent need for a clear-screen flag in a bunch of NXT screen functions. That is, my sources are full of "false," flags :-) TextOut(...,true,...); TextOut(...,false,...); TextOut(...,false,...); LineOut(...,false); (...) (18 years ago, 14-Feb-07, to lugnet.robotics.nxt)

6 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR