To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 26889
26888  |  26890
Subject: 
RICScript
Newsgroups: 
lugnet.robotics, lugnet.robotics.nxt
Date: 
Sat, 24 Feb 2007 01:17:02 GMT
Viewed: 
9103 times
  
You may not find this terribly interesting, but I have implemented an RIC to
Text converter (a decompiler, if you will) which generates source code for an
RIC file in a text format.

Soon BricxCC will have support for writing and compiling/downloading RICScript
programs just like it does for the simple NXT Program scripting language (which
I call NPG).  The RICScript programming language (for lack of a better name)
will be built into NBC just like the NPG compiler is and the NXC compiler is.
Here's a sample of what RICScript looks like:

desc 0 11 4;
sprite 1 0xAAA0 0x5540 0xAAA0 0x5540;
sprite 2 10101010101 01010101010 10101010101 01010101010;
varmap 3 (1,1) (2,2) (3,3) (4,4) (5,5) (6,6);
copybits 1 0 0 0 11 4 0 0;
line 0 1 1 7 3;
rect 0 2 0 4 maparg(3,0);
pixel 0 1 1 1;

All arguments are separated by any whitespace.  Each RICScript command begins
with a valid command name (RIC opcode) and ends with a semicolon.  Sprites can
be defined as rows of ones and zeros where the total number of ones and zeros in
a row defines the width of the sprite and the number of rows defines the height
of the sprite.  They can also be entered using hexadecimal numbers (as shown
above).  C and C++ style comments can be used within an RICScript program to
document it.

BricxCC will not only have text-based editor support for writing RIC files but
it will soon also have a graphical editor like nxtRICEdit built into the IDE as
well (and the NXT Explorer window will have preview/decompiler support for .ric
files as well).

The plan is to have command-line compile/decompile support for RIC files built
into NBC so that it will be easy to create RIC files on Mac OSX and Linux
platforms using the RICScript language.  There will be a cross-platform
command-line utility as well which will allow importing from other graphic
formats (jpg, gif, bmp, png, etc...) to the RICScript language.  I should have
it all working real soon now. :-)

John Hansen



1 Message in This Thread:

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

Custom Search

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