Sega Genesis Dev Kit (SGDK)

SGDK only sub forum

Moderator: Stef

Mixail
Very interested
Posts: 133
Joined: Thu Nov 18, 2010 4:47 pm

Post by Mixail » Thu Feb 06, 2014 4:03 pm

Stef wrote:The "sprite" sample use it in a very transparent fashion. You basically just need to declare your image in resource file with compression parameter and that is done. Then you have all the tools.h file to handle manually decompression but if you use advanced method as VDP_drawImage(..) or VDP_drawImageEx(..) SGDK will handle it by itself (same for the new TileCache feature).
How use this function: Image *allocateImage(const Image *image); ?

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Thu Feb 06, 2014 4:13 pm

/**
* \brief
* Allocate Image structure which can receive unpacked image data of the specified Image.
* If source is not packed the function only allocate space for simple shallow copy of the source.
*
* \param image
* Source Image we want to allocate the unpacked Image object.
* \return
* The new allocated Image object which can receive the unpacked Image, note that returned image
* is allocated in a single bloc and can be released with Mem_Free(image).<br/>
* <i>NULL</i> is returned if there is not enough memory to store the unpacked image.
*/
Image *allocateImage(const Image *image);
And the Image structure is build from your IMAGE resources (see the rescomp.txt file for more details).

Mixail
Very interested
Posts: 133
Joined: Thu Nov 18, 2010 4:47 pm

Post by Mixail » Fri Feb 07, 2014 10:05 am

rescomp don't working on Window XP :(

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Fri Feb 07, 2014 1:12 pm

Mixail wrote:rescomp don't working on Window XP :(
Oh really ? I do not use any win api stuff so win XP, win 2000 or whatever should not be a problem. I tried to make it cross platform... You have the sources in the tools directory if you want to give a try :) But in the meantime, can your report me the error you got on win XP ?

Mixail
Very interested
Posts: 133
Joined: Thu Nov 18, 2010 4:47 pm

Post by Mixail » Fri Feb 07, 2014 2:32 pm

sample/sound
Image
sample/sprite
Image

Oh, i think it's just a problem from the '/' character used to separate folder... this indeed may not work on win xp (but does on win vista and after). I need to fix that !

nolddor
Very interested
Posts: 102
Joined: Sun Jun 02, 2013 1:35 pm
Location: Spain

Post by nolddor » Fri Feb 07, 2014 3:13 pm

Hi again Stef!

How to I generate the *.h file from a res/*.vgm now?

In SGDK 0.94 I only put the vgm into the res folder and I included the *.h in my code

Another question, Is Html sgdk Documentation outdated? I don't find the new functions

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Fri Feb 07, 2014 3:36 pm

hi nolddor,

You have to use .res file to declare your resources (as the VGM file).
you can look in the provided "sound" sample to have an example :)
I know it looks less user friendly to do this way but it is far more powerful as you can handle many more different type of resources ans set extra parameters !

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Fri Feb 07, 2014 7:19 pm

Mixail wrote: Oh, i think it's just a problem from the '/' character used to separate folder... this indeed may not work on win xp (but does on win vista and after). I need to fix that !
Should be fixed !
You can redownload the whole SGDK archive or just take the last rescomp.exe from here:
http://sgdk.googlecode.com/svn/trunk/bin/rescomp.exe

Mixail
Very interested
Posts: 133
Joined: Thu Nov 18, 2010 4:47 pm

Post by Mixail » Fri Feb 07, 2014 7:51 pm

Stef wrote:
Mixail wrote: Oh, i think it's just a problem from the '/' character used to separate folder... this indeed may not work on win xp (but does on win vista and after). I need to fix that !
Should be fixed !
You can redownload the whole SGDK archive or just take the last rescomp.exe from here:
http://sgdk.googlecode.com/svn/trunk/bin/rescomp.exe
Thank you very much.

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

Post by oofwill » Tue Feb 18, 2014 9:40 pm

Hi

What's the problem with VDP_setTileMap()?

After installing SGDK 0.95, I have this message while compiling: (without any changes in my code)

Code: Select all

gestion_map.c|49|error: too many arguments to function `VDP_setTileMap'|
My command is :

Code: Select all

VDP_setTileMap(BPLAN, TILE_ATTR(0,0,0,0)+(z), k, l);
(Same error without "+(z)"...)

EDIT : Ok, I have to use VDP_setTileMapXY(); instead...

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Wed Feb 19, 2014 4:23 pm

Seems to be a wrong deprecation... Sorry for the problem !

pckid
Newbie
Posts: 5
Joined: Sat Mar 01, 2014 8:14 pm

Post by pckid » Sat Mar 01, 2014 8:28 pm

Hello Stef

I get to compile on eclipse my main.c

But i would like to learn to compile in dos only.

In my project i copy all

src , res, inc in my drirectory project.

and i start %GDK_WIN%\bin\make -f %GDK_WIN%\makefile.gen

I don't get in my out directory , the bin file.

Do you know why ?

Image

thanks

Edit : i find, sorry, we must to start cmd dos in admin user.
========================
I like develop some games
========================

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Thu Mar 06, 2014 10:28 am

Hi pckid,

Sorry i didn't see the message sooner but the bug you got is actually a bug from GCC which happen randomly (sometime it crashs without any reason). You just have to restart it and it will pass :)

pckid
Newbie
Posts: 5
Joined: Sat Mar 01, 2014 8:14 pm

Post by pckid » Thu Mar 06, 2014 10:33 am

Thanks Stef,
i send so on the Gamopat Forum, cause we speak together with touko there.

But, if i start my cmd dos in admin user (right click), the compile work fine !

I saw the code to move sonic, it's you which write this ? great code
========================
I like develop some games
========================

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Thu Mar 06, 2014 11:48 am

Weird that admin rights fix that issue but if it does :)
Yeah it's me which wrote the sonic sprite example, thanks for the comment :) It could be improved in many ways but it was to show quickly how use the SGDK sprite features :)

Post Reply