I'm not 100% sure this post belongs in this part of the forums, so point me in the right direction if I'm mistaken.
I'm experiencing a problem using bin2o. I have a data folder with one bitmap inside it that is being picked up by my make file and compiled into an object file. The header file is being generated fine, and I parse the bmp and display it as a background tile. All of this works fine. Until I change the contents of the bitmap. For some reason, when I change the contents of my bitmap and rebuild the executable, the file size that's in the generated header is around 4GB instead of around 2KB. I allocate a buffer to hold a copy of the bitmap file, since I need to mirror the pixel data before I copy it into tile memory. So when the file size is 4GB, I get a bad alloc exception and my program ends.
bin2o is just supposed to treat the file as binary data, so the contents themselves couldn't be what's causing this, right? The .o is 2KB, the size of the bitmap. Could it be a problem with how the .o is being linked into the executable? Has anyone else encountered this?
Thanks in advance
bin2o problem - reported file size
Re: bin2o problem - reported file size
I have decided to just use grit to pre-convert my graphics, but I'd still like to know what exactly was going on here. Any insight would be appreciated.
-
- Site Admin
- Posts: 1986
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: bin2o problem - reported file size
Really you should be using grit to create tile data for the DS/GBA - see http://forums.devkitpro.org/viewtopic.php?f=22&t=17 for some basics.
Could you send me a testcase project where you get the problem though? I'd like to see if it's a problem with bin2o or something else in your code. davem@<obvious domain>
Could you send me a testcase project where you get the problem though? I'd like to see if it's a problem with bin2o or something else in your code. davem@<obvious domain>
Re: bin2o problem - reported file size
I've emailed you a zip containing two example projects - one works and one doesn't. Let me know what you find.
Thanks.
Thanks.
-
- Site Admin
- Posts: 1986
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: bin2o problem - reported file size
Looks like there's some issue with alignment in the latest binutils snapshot. What's happening is that the variable generated by bin2s for the file size is being misaligned in the binary when the data is an odd number of bytes.
I've corrected for this in the bin2s CVS source, should be available with devkitARM release 24 hopefully real soon now (tm)
I've corrected for this in the bin2s CVS source, should be available with devkitARM release 24 hopefully real soon now (tm)
Re: bin2o problem - reported file size
Sorry I didn't respond sooner. I've been elbow deep in my game engine for a few weeks. Thank you very much for investigating this. I appreciate it. I'll probably be needing bin2o sooner or later so I'll be happy to have the fix
Who is online
Users browsing this forum: No registered users and 4 guests