GP32 Problem with tile map graphics


StudioX64

Still Fresh
Joined
Mar 30, 2003
Messages
71
Location
UK
Website
www.studiox64.com
I am hoping someone might be able to help me out here. I am trying to write a simple program on the GP32 to display a single graphic tile. I have a single 8bit windows bitmap containing 16 tiles each of size 16x16 pixels. Now I want to convert this bitmap into a files I can include with my C source code.

I have dl'd the souce code from this site here:
http://anthologie.emu-france.com/tuto_tile_map.htm

The tutorial was helpful in that it made me understand how to use simple graphics etc on the GP32, what I can not find out is how they managed to convert the included bitmap into the C source file also included. They show outputing the map file with mappy on their website, but no matter what settings I try giving it (with their graphics map) I can not generate the same output C file containing their bitmap tiles.

I have also tried some of DarkFaders tools on his website here:
http://darkfader.net/toolbox/

I tried bmp2bin, then bin2c with every setting possible and still couldn't generate the same file.

I need to know if I am missing out on a mappy trick here or is this simply the wrong way of doing things. My aim is to code a simple game using only 16 graphic tiles of 16x16 pixels.

Many thanks,

PK-StudioX64.
 
:D Well it looks like I managed to solve my own problem here, lucky really as I had no replies :rolleyes: anyhow.

I found a small utility to convert graphics to header files, as C code and not just raw binary data. You too can find it here:

http://www.ifrance.com/edorul/gp32/

It's the one called "GP32Converter (v1.3)". It worked for me.

Thanks,

PK-StudioX64.
 
Studio, I think you should try and convert that game you did for the Blitz retro comp to the gp..That'd be quite kool that m8 ! :rolleyes:
 
He he, I was planning to after I did another 8 bit conv first. I am currently porting "Colouration", though it will probably end up being titled "ColourZ" on the GP32. I have a far bit of the graphical stuff done already, hopefully should have something playable soon :) fingers crossed.

PK-StudioX64.
 
I have exactly the same problem as the original post by Studio64X indicates. I also have different .c files than I can see Mr.Mirko has in his examples.

He has something like this:

unsigned char garfield[] = { 71,80,51,50,160,0,160,0.....


I have something like this:

unsigned char cruiser[972] = {0x47, 0x50, 0x33, 0x32, 0x00, 0x1E,...

I used the following lines to convert my Photoshop generated BMP:

bmp2bin -x cruiser.bmp cruiser.raw
convert cruiser.raw > cruiser.c

I'm working with mirkoSDK and use a Mac under MacOSX! Because of that I can't use GraphicConverter1.3 by Endorul as it would only run on a real PC (I also tried VirtualPC).

What does it cause that my array values are in hex while the other ones are integers?
Any help would be greatly appreciated.
 
I experimented a little much (I don't know that much about C) and come to the conclusion that it's not important wether the array holds hexa or integers. The thing which makes problems is the following fact I couldn't explain because I'm not an experienced enough C programmer.

I'm using Mr.Mirko's SDK under a MacOSX enviroment. When I use 'bmp2bin' (version 1.05, modified by Mr.Mirko) and use the option '-x' (generate sprite header) it seems to corrupt the output file. When I don't use the header option and in SDK code use 'gp_drawSpriteT' instead of 'gp_drawSpriteHT' everything work as expected and smooth.

Probably there's a problem with the header function in the bmp2bin tool for Mr.Mirko's SDK (on MacOSX) ...???

Just want to let you know that...
 
Back
Top