Bricxcc and firmware test versions

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

Re: Bricxcc and firmware test versions

Post by HaWe »

Am I the only one who hates registry entries? To me it's tortures down to the bones.
How I would love to have the former .ini files of the good old days of Win95/98 which you could edit with any text editor. :cry:
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Bricxcc and firmware test versions

Post by mattallen37 »

It worked! I changed the value to 1, and that seems to have done it. Thanks a lot for all your help!
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
spillerrec
Posts: 358
Joined: 01 Oct 2010, 06:37
Location: Denmark
Contact:

Re: Bricxcc and firmware test versions

Post by spillerrec »

afanofosc wrote:The thing (or one of the things) I found confusing was that calling ArrayInit(data, 10, 1000) on a byte array that was previously empty did not result in the PoolSize going up by ~1000 and when I copied it to another byte array that was previously empty it didn't go up further.
(Thanks for the zip.)

I tried raising a byte array slowly and got the following data:

Code: Select all

  	PoolSize	Dataspace
0 	204		108
1 	205		109
2 	206		110
3 	207		111
5 	209		113
10	214		118
15	219		123
20	224		128
25	229		133
50	254		158
51	255		159
52	0  		160
So it seems that the PoolSize and DataspaceSize variables becomes truncated somewhere so that they can only hold a 8 bit value (unsigned).

I was using the following piece of code for the testing:

Code: Select all

//test2.nxc
task main(){
	byte test_array[];
	
	ArrayInit(test_array, 0, 143);
	
	int ps, ds;
	GetMemoryInfo(true, ps, ds);
	TextOut(100, LCD_LINE1, test_array);
	NumOut(0, LCD_LINE1, ps);
	NumOut(0, LCD_LINE2, ds);
	Wait(6000);

}
My blog: http://spillerrec.dk/category/lego/
RICcreator, an alternative to nxtRICeditV2: http://riccreator.sourceforge.net/
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: Bricxcc and firmware test versions

Post by afanofosc »

There was a bug in the implementation of the MemoryManager system call. I have fixed that and uploaded a new test version of the firmware image here:

http://sourceforge.net/projects/bricxcc ... p/download

The numbers definitely look more reasonable now.

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
nxtboyiii
Posts: 366
Joined: 02 Oct 2010, 07:08
Location: Everywhere

Re: Bricxcc and firmware test versions

Post by nxtboyiii »

Can you post a version of the firmware without try me and nxt datalog menus?
Thanks, and have a nice day,
nxtboy III

programnxt.com
nxtboyiii
Posts: 366
Joined: 02 Oct 2010, 07:08
Location: Everywhere

Re: Bricxcc and firmware test versions

Post by nxtboyiii »

Using a void like this doesn't work anymore. :(

Code: Select all

int x;
int y;
void Jump(int & sx, int & sy)
{
 sx++;
 sy++;
}
task t1()
{
 while(1)
 {
    PointOut(x,y);
  Wait(50);
 }
}
task t2()
{
 while(1)
 {
    Jump(x,y);
 }
}
task main()
{
Precedes(t1,t2);
}
It doesn't make the point move diagonal. :(
Thanks, and have a nice day,
nxtboy III

programnxt.com
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: Bricxcc and firmware test versions

Post by afanofosc »

Can you point me to a firmware version where your code did produce a diagonally moving point? There have been no recent changes to the drawing operations in the enhanced NBC/NXC firmware. The second task should execute Jump many times more frequently than the PointOut call is executed in the first task. The word "void" is not a proper term for a function or procedure. Just refer to it as a function or a procedure.

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
nxtboyiii
Posts: 366
Joined: 02 Oct 2010, 07:08
Location: Everywhere

Re: Bricxcc and firmware test versions

Post by nxtboyiii »

The firmware is the most recent version. The PointOut works, but using the int & sx doesn't work. :( It compiles, but doesn't write the variable x to the value of sx. :(
Thanks, and have a nice day,
nxtboy III

programnxt.com
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: Bricxcc and firmware test versions

Post by afanofosc »

I'm not seeing the same results you are with the latest BricxCC and firmware test versions (which this thread is about).

In 50 milliseconds, i.e., before PointOut draws its second point, the x and y values have been incremented way beyond 63, 63 which would be the last visible dot as x and y are incremented upwards. Try this program:

Code: Select all

int x=0;
int y=0;

void Jump(int & sx, int & sy)
{
  sx++;
  sy++;
}

task t1()
{
  while(1)
  {
    PointOut(x,y);
    Wait(500);
  }
}

task t2()
{
  while(1)
  {
    Jump(x,y);
    NumOut(0, LCD_LINE8, x);
    NumOut(50, LCD_LINE8, y);
    Wait(500);
  }
}

task main()
{
  Precedes(t1,t2);
}
As you can see, x and y are incremented and the dots are drawn diagonally upward from (0, 0).

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
nxtboyiii
Posts: 366
Joined: 02 Oct 2010, 07:08
Location: Everywhere

Re: Bricxcc and firmware test versions

Post by nxtboyiii »

But this only returns x and y at the end of the function. :(

Code: Select all

    int x=0;
    int y=0;

    void Jump(int & sx, int & sy)
    {
      repeat(5)
      {
      sx++;
      sy++;
      }
    }

    task t1()
    {
      while(1)
      {
        PointOut(x,y);
        Wait(500);
      }
    }

    task t2()
    {
      while(1)
      {
        Jump(x,y);
        NumOut(0, LCD_LINE8, x);
        NumOut(50, LCD_LINE8, y);
        Wait(500);
      }
    }

    task main()
    {
      Precedes(t1,t2);
    }

Thanks, and have a nice day,
nxtboy III

programnxt.com
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 1 guest