gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > pcx_view example in DevKipPro, need advice

#93876 - metalseb - Fri Jul 21, 2006 7:44 pm

Hi again,

Started from the base ground this afternoon in coding homebrew.

Well, things are not as easy as I thinked. Lots and lots of tutorials available here and then, but a lot of them are ow outdated. Damn !

I peeked at the PCXView example provided in the DevKitPro. If I understand well, using bin20 transforms a PCX file into an linkable object. However, it seems, reading the sourcecode, that there is a header file to be generated with some extern const adresses linking to the .o bytes chunks.

I am unable to generate this header file with bin2iso and reading the makefile does not help much. Perhaps I'm not looking the right way.

Any help would be greatly appreciated.

And by the way, is there somewhere an *up to date* tutorials set ? Pern project is fine but outdated, a lot of things have changed in libgba since they were written and it is now hard to follow.

See ya dudez.

#93913 - dshacker - Fri Jul 21, 2006 11:47 pm

well when I generate pcx pics into a .h format all I use is the pcx2gba for background and pcx2sprite for sprites

#93969 - wintermute - Sat Jul 22, 2006 3:54 am

dshacker wrote:
well when I generate pcx pics into a .h format all I use is the pcx2gba for background and pcx2sprite for sprites


Putting arrays in headers is extremely bad practice, please don't suggest it any more.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#93971 - wintermute - Sat Jul 22, 2006 4:05 am

metalseb wrote:


I peeked at the PCXView example provided in the DevKitPro. If I understand well, using bin20 transforms a PCX file into an linkable object. However, it seems, reading the sourcecode, that there is a header file to be generated with some extern const adresses linking to the .o bytes chunks.

I am unable to generate this header file with bin2iso and reading the makefile does not help much. Perhaps I'm not looking the right way.



Is bin2iso a different tool or just a typo?

bin2o is a makefile macro defined in base_rules. It uses bin2s to generate an object file and some sed fu to output a header in the build directory.

Is the example not working for you or are you trying to do the same thing with another tool?
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#93989 - metalseb - Sat Jul 22, 2006 9:47 am

Hi Wintermute,

Quote:
Is bin2iso a different tool or just a typo?


Well, that was a typo. I was extremely tired when I wrote this yesterday late in the evening.

Quote:
bin2o is a makefile macro defined in base_rules. It uses bin2s to generate an object file and some sed fu to output a header in the build directory.


Yes. I saw that this morning reading your post. I thought it was the utility bin2o, I found the link in gbadev tools page. I read the makefile carefully this morning and found the macro source in base_rules. I have to revise my makefile knowledge obvisouly. I was an *NIX dev once, but it was more than 10 years ago now and things seem to have vanished into some kind of mental void :-)

I succeded in displaying a picture by making some headers with gfx2gba util and making some memcpy from the headers generated to Palette and Graphics memory. But I wanted, as you suggested it by telling about "bad practice" do to it in a cleaner way.

Again, many thanks to all for advices and tips.

#94412 - Presto - Mon Jul 24, 2006 7:51 pm

I'm really new to this too, but I've gotten a background to show up in my test1 example. I agree that keeping the images in header files seems like a not-so-terrific way to handle them. What's recommended now, and are there any tutorials/clean examples?

In the Pocket PC world, I just keep all my images as .PNG or .GIF files, with occassional .JPG backgrounds, but that simply doesn't seem to be possible for GBA coding.

Thanks,
-John

#94453 - tepples - Mon Jul 24, 2006 9:45 pm

Presto wrote:
In the Pocket PC world, I just keep all my images as .PNG or .GIF files, with occassional .JPG backgrounds, but that simply doesn't seem to be possible for GBA coding.

It's not too hard to implement a ROM file system on the GBA. Here, use mine.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#94580 - wintermute - Tue Jul 25, 2006 12:53 pm

It's still possible to use standard graphics formats on the GBA but it's not really as useful as it is on a PC. While there are bitmap modes they're intended mainly for cut scenes rather than an entire game. You will get more efficiency from the tiled modes so you should really be preprocessing your graphics.

As it happens I'm currently in the process of getting Cearn's Gameboy Image Transmogrifier working on big endian machines. I hope to be including this in the next release of devkitARM.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog