Sprite drawing problem

SGDK only sub forum

Moderator: Stef

djcouchycouch
Very interested
Posts: 710
Joined: Sat Feb 18, 2012 2:44 am

Post by djcouchycouch » Sat Feb 18, 2012 4:07 pm

After giving up on IsaGenesis, I ran a few tests in Genitile to see what's going on.

This is my source image. It's 8x8 pixels, 256 colours, the format Genitile says to prefer. The original is in bmp format but imgur seems to have formatted it to png.

Image

Here's an enlarged version to see what it looks like.

Image

My command line to convert it was this, pretty straightforward:

genitile.exe square256colors.bmp -sprw 1 -sprh 1 -o h

And here's what it looks like in Gens Rewind and Kega Fusion.

Image

The top line winds up to be transparent, which is expected.

As you can see, the purple and yellow lines have been swapped around. Without seeing the source code, I can't really guess as to what's going on. I don't think the source has been released, has it?

IsaGenesis and Genitile seem both to be abandoned. Are there alternatives to these tools?

DJCC.

oofwill
Very interested
Posts: 173
Joined: Mon May 03, 2010 6:12 pm
Location: France - Niort

Post by oofwill » Sat Feb 18, 2012 5:05 pm

I use 16 color bmp file, but i'm not sure this is your problem.

How do you call your sprite? with SGDK command? (VDP_doVRamDMA, then VDP_setSprite)?

I don't think the problem is genitile or imaGenesis cause this work perfectly for me and all users. It's no use to try another soft i think, we had to find where your problem is (but I can't be helpful for you cause i'm a newbee :/)

djcouchycouch
Very interested
Posts: 710
Joined: Sat Feb 18, 2012 2:44 am

Post by djcouchycouch » Sat Feb 18, 2012 5:56 pm

I'm pretty certain it's not my source images.

I've just figured out how to use GenRes in SGDK and they come out fine.

So I'm not sure what's going on with ImaGenesis and Genitile. The exported data, as c structs, just looks wrong. Maybe they're just very fussy with format. But somehow I doubt that since ImaGenesis does load my images and shows them correctly. So I donno.

But now that I've been able successful with GenRes, I think I'll just use that.

Thanks for your help, oofwill.

oofwill
Very interested
Posts: 173
Joined: Mon May 03, 2010 6:12 pm
Location: France - Niort

Post by oofwill » Sat Feb 18, 2012 6:23 pm

Give me your bmp image, i'll do a test for you.

I just test with a 8*8 sprite and it's works perfectly, so if i can help you to found where the problem is, i'll do it with pleasure ;)

djcouchycouch
Very interested
Posts: 710
Joined: Sat Feb 18, 2012 2:44 am

Post by djcouchycouch » Sat Feb 18, 2012 6:27 pm

You can find it here.

http://dl.dropbox.com/u/17303735/square256colors.bmp


oofwill wrote:Give me your bmp image, i'll do a test for you.

I just test with a 8*8 sprite and it's works perfectly, so if i can help you to found where the problem is, i'll do it with pleasure ;)

oofwill
Very interested
Posts: 173
Joined: Mon May 03, 2010 6:12 pm
Location: France - Niort

Post by oofwill » Sat Feb 18, 2012 6:48 pm

Ok, i just did the test, it works for me.

First, i decreased colors to 16max.
Save the file, 8bits bmp.

Converted with genitile with this command line:

Code: Select all

genitile square.bmp -pal -sprw 1 -sprh 1 -o asgcc
then, rename two files squarep.s and squaret.s

In file, i add those lines :

Code: Select all

.global square_pal
.global square_tiles
finally, code as this in SGDK :

Code: Select all

    VDP_setPalette(0, square_pal);
    VDP_doVRamDMA((u32) square_tiles, 3104, 32);
    VDP_setSprite(0, 100, 150, SPRITE_SIZE(1,1), TILE_ATTR_FULL(PAL0,0,0,0,97),0);
    VDP_updateSprites();
This works for me with gens, so I dunno where the problem is.

Try to compare with your method and find out the problem :|

djcouchycouch
Very interested
Posts: 710
Joined: Sat Feb 18, 2012 2:44 am

Post by djcouchycouch » Sat Feb 18, 2012 7:01 pm

Ah, I see how you're doing it.

I wasn't using that method. I was exporting to a header file as a struct (-o h). Could be that type of export isn't working correctly.

oofwill
Very interested
Posts: 173
Joined: Mon May 03, 2010 6:12 pm
Location: France - Niort

Post by oofwill » Sat Feb 18, 2012 7:02 pm

I can't help you at this point, sometimes i find my way without really know what i'm doing, but if it's work, for the moment, it's good for me since i'm a very newbee ^^

Post Reply