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

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

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
How to add binary data files to projects?   Message List  
Reply | Forward Message #9720 of 15019 |
Re: [gbadev] How to add binary data files to projects?


I'd like to chime in again about adding in binary data files, simply to be
helpful, though this depends on what compiler you're using.

The version of GAS that I've been using does not support .incbin, and I've found
confirmation of this fact online that it's been taken out (WHY??). Now, another
programmer here is using a custom version of GAS with .incbin added in, but
devkitadv, for instance, doesn't seem to have this. We've swapped .s files back
and forth to confirm this.

All of my original variables are stored in .h and .c files, so what I've done is
written a fast little conversion routine from a .h array to .s, then converted
that with AS into a .o file. Then all I have to do is link in the .o file at
build-time. Very fast! And more space-efficient.

I found that converting directly to a .o file with ObjCopy, which is recommended
at http://www.devrs.com/gba/files/gbadevfaqs.php#IncRaw doesn't work for me (I
get an error about not having -mthumb-interworking support). Pity, as devkitadv
comes with a batch file specifically trying to help with this very solution, but
the file it generated wouldn't link in, even after I added the ALIGN 4 statment.

So, this 'brute force' method I've cooked up converts very quickly, as most of
the time appears to be spent in the compiling of .h into a .s file, and might
even circumvent the virtual memory exhausted error I've encountered before
adding the GCC patch. My conversion proggie has its limitations, like how I
extract one array at a time, but that could be changed, or just lived with.
It's not a fatal problem by any means.

The jist of this is that .incbin doesn't appear to be supported by GAS often, as
far as I can tell, so other methods need to be used.

Hope this helps!

And again, if anyone wants my conversion program, just let me know. I've tested
it with huge sprite tables so far, though I'm sure there's other little bugs.

Jason Emery
World Tree Games


[Non-text portions of this message have been removed]





Fri Feb 1, 2002 3:25 am

felix_draconis
Offline Offline
Send Email Send Email

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

Hello, Here is my problem: I would like to convert a (large) binary data file into an object file so I can insert it into my project, thr problem is that I...
Alex GANEA
alex_toresh
Offline Send Email
Jan 31, 2002
4:35 pm

... (not using gcc at all for compiling) As you're using the ARM SDT why not just INCBIN the data from an assembler file? . . . label: INCBIN file.bin . . ....
James Boulton
jim@...
Send Email
Jan 31, 2002
5:38 pm

Hi, I used the ARM SDT evaluation version when I started GBA stuff, and the way I did things was to have a .s (assembly) file where I put ALL my data using the...
Francis Lillie
francis_lillie@...
Send Email
Jan 31, 2002
5:38 pm

Here is my problem: I would like to convert a (large) binary data file into an object file so I can insert it into my project, thr problem is that I can't find...
Jason Emery
felix_draconis
Offline Send Email
Jan 31, 2002
10:59 pm

Use INCBIN statement in an assembly file. That way you can pad it yourself. Aelius....
George Andre
pdafantast
Offline Send Email
Feb 1, 2002
8:42 am

I'd like to chime in again about adding in binary data files, simply to be helpful, though this depends on what compiler you're using. The version of GAS that...
Jason Emery
felix_draconis
Offline Send Email
Feb 1, 2002
8:44 am

Thank you guys for your answers, I completely forgot about .incbin! It would also be cool that everyone who answers in this group, reads what ppl answered...
Alex GANEA
alex_toresh
Offline Send Email
Feb 1, 2002
3:31 pm
Advanced

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