Jump to content

  • Log In with Google      Sign In   
  • Create Account

GBA- Changing the data in my arrays...?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Arek the Absolute   Members   -  Reputation: 350

Like
Likes
Like

Posted 25 March 2002 - 01:02 PM

Hey, I''ve been playing around in mode 3, and in the process I''ve been trying to manually back buffer things. Now, I''ve encountered a bit of a problem. It seems that the data in my back buffer array is changed as soon as I put it in. If I do this:
  
for (x = 0; x < 240; x++){
    for (y = 0; y < 160; y++){
	int place = x+y*240;
	videoBuffer[place] = 0xFFFF;
    }
}
  
Then the screen, as expected, draws completely white. No problem. Then I add an array "int backBuffer[38400];", and do this:
  
for (x = 0; x < 240; x++){
    for (y = 0; y < 160; y++){
        int place = x+y*240;
        backBuffer[place] = 0xFFFF;
        videoBuffer[place] = backBuffer[place];
    }
}
  
Then the screen is filled with, what would seem to me anyway, pretty random garbage. Is it just me, or is the data in backBuffer getting corrupted somewhere in the process of those two lines of code? If the data is corrupted that instantaneously, there''s no way I can use it as I intend... What''s going on here? -Arek the Absolute

Sponsor:

#2 Royale00   Members   -  Reputation: 122

Like
Likes
Like

Posted 25 March 2002 - 04:07 PM

Hi Arek the Absolute I have worked on doing mode3 double buffering in the past and its not worth the struggle. The only way I have found that it works fast enough is to use some sort of DMA copy each frame or using memcpy. Anyway to solve your problem you should try clearing the memory of your buffer before using it using memset(&backBuffer,0x000,240*160) or using the new unsigned short backBuffer[240*160] pointer if your using c++.

#3 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 25 March 2002 - 08:25 PM

The GBA only has 32kb IWRAM (used for storing variables and stuff) and 256kb EWRAM (usually used to store data). Your backbuffer doesn''t fit in that 32kb IWRAM, that''s why it isn''t working.

#4 Royale00   Members   -  Reputation: 122

Like
Likes
Like

Posted 26 March 2002 - 01:07 AM

HI again as AP has stated that can be the problem but I think it is unlikely as with both compilers GCC and ARM SDT use the rw memory base as the external ram adderess 0x02000000 - 0x0203FFFF but as stated before it could be the problem.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS