Hi Ben,
Ben Smith wrote:
>
> For the game I'm currently writing, I want to have an
> uninitialized 80k array in EWRAM. The problem I'm having is
> that if I just declare an 80k array, it's placed in the default
> BSS section
Yes, this is an inherent limitation with GCC:
http://www.devrs.com/gba/files/gbadevfaqs.php#VarSections
> (IWRAM) which is too small for 80k. When I declare __attribute__
> ((section ".ewram")) for the array, it works, but my gba file is
> created with 80k of zeros at the end of it, because it's considered
> initialized data. Is there any way that I can have an EWRAM BSS
> section? How much modification of the lnkscrpt/crt0.s files would
> this require?
Yes, you could do that. Before attempting that you would need to
decide if the data section (initialized data) would also go into EWRAM
or stay in IWRAM. You can use the AT command in the lnkscript to put
the BSS anywhere you want. I'd help but I've got more than I can handle
at the moment.
The drawback would be that all of your uninitialized variables would
now be in EWRAM which will slow down possibly critical routines which
use ram variables, if you have any. One suggestion would be to use a
pointer, instead, for the arrays that require use of EWRAM. This
suggestion is also in the link above:
u8 *MyArray = (u8 *)0x2000000; // ewram start
MyArray[0] = 1;
Jeff