Search the web
Sign In
New User? Sign Up
gbadev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
BSS in EWRAM   Message List  
Reply | Forward Message #9127 of 15019 |
Re: [gbadev] BSS in EWRAM

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




Wed Jan 2, 2002 5:33 pm

jfrohwei
Offline Offline
Send Email Send Email

Forward
Message #9127 of 15019 |
Expand Messages Author Sort by Date

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...
Ben Smith
bsmith2@...
Send Email
Jan 2, 2002
4:09 am

Hi Ben, ... Yes, this is an inherent limitation with GCC: http://www.devrs.com/gba/files/gbadevfaqs.php#VarSections ... Yes, you could do that. Before...
Jeff Frohwein
jfrohwei
Offline Send Email
Jan 2, 2002
6:00 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help