Page 2 of 7

Re: Bricxcc and firmware test versions

Posted: 08 Oct 2010, 17:00
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:

Re: Bricxcc and firmware test versions

Posted: 08 Oct 2010, 17:17
by mattallen37
It worked! I changed the value to 1, and that seems to have done it. Thanks a lot for all your help!

Re: Bricxcc and firmware test versions

Posted: 08 Oct 2010, 20:07
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);

}

Re: Bricxcc and firmware test versions

Posted: 09 Oct 2010, 03:38
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

Re: Bricxcc and firmware test versions

Posted: 09 Oct 2010, 18:34
by nxtboyiii
Can you post a version of the firmware without try me and nxt datalog menus?

Re: Bricxcc and firmware test versions

Posted: 14 Oct 2010, 02:28
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. :(

Re: Bricxcc and firmware test versions

Posted: 14 Oct 2010, 03:03
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

Re: Bricxcc and firmware test versions

Posted: 15 Oct 2010, 00:46
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. :(

Re: Bricxcc and firmware test versions

Posted: 15 Oct 2010, 03:50
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

Re: Bricxcc and firmware test versions

Posted: 16 Oct 2010, 03:00
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);
    }