Page 1 of 1

New Demo/Sample code (GuileSmash)

Posted: Wed Apr 15, 2009 2:16 pm
by LionX
I decided to create a simple game demo to wake people up.

i created it using the new lib in ps2sdk called "libgs" and "libpad". because 'libgs' is a 2d GS lib i decide to create a 2d demo.

it demonstrates: transparency, semi transparency, double buffering. ...


DEMO & SOURCE & SCREENSHOT
http://ps2dev.org/kb.x?T=1373




.

Posted: Thu Apr 16, 2009 2:55 am
by LBGSHI
Cool; I've grabbed it, and will take a look at it later :)

Posted: Sun Apr 19, 2009 1:03 am
by cosmito
It works well, nice work. Although I noticed some flickering at the alpha channel of Guille. It seems to happen only you press and release the cross pad button. If you keep it pushed, the animation goes OK.

About the libgs, is it available? Are you the authour?
I took a glimpse at this demo sources and by the usage, it seems a low level lib. Any plans for a high level wrapper for it?

Posted: Sun Apr 19, 2009 5:37 am
by LionX
yes i know. the reason why that happen is because im using the same frame counter to play all the animation. so if you release x while the animation is at about frame 6, it then try to play anther animation that have less than 6 frames which cause the glitch.

it can be fixed by adding somthing like:

Code: Select all

if(pad != oldpad) frame_id=0;


libgs is available on svn/ps2sdk/,and yes i know its low level(that gives flexibility). even tho its low level its not too complex, the name of the functions are very straight foreword. im planing to release a vu(3d math lib) that goes with it. and after that i will be releasing a high level wrapper for 'libgs' & 'libvu'


.

Posted: Sat Jun 13, 2009 12:44 am
by Fakeuser
Great work.
Libgs suits me,Thanks for releasing it!

Posted: Thu Jun 18, 2009 12:58 am
by Fakeuser
It seems the arg("mode") of GsEnableAlphaBlending1(unsigned short enable, unsigned short mode) is not used in libgs?

Posted: Fri Jun 19, 2009 11:15 pm
by LionX
yes, its not used in this version, so set it to 0(NULL), its really for future stuff.

so for now you can only enable or disable alpha-blending with arg0.

Posted: Sun Aug 02, 2009 12:53 pm
by Fakeuser
How to implement FadeIn/FadeOut effect using Libgs?
I tried set gs_setR_RGBAQ function in drawing and vsync callback,but it has no effect.
Please give some hints,thanks!

Posted: Wed Aug 05, 2009 12:36 pm
by LionX
one way is to change the alpha value GsSetCRTCSettings(CRTC_SETTINGS_DEFAULT1, 255);


or render all your stuff first then draw a semitransparent sprite over all of that with a fade/alpha value you want. be sure to turn semitransparency on...

Posted: Sun Sep 06, 2009 11:31 am
by Fakeuser
I notice there is a struct in libgs eats too many .bss section memory,much more than gskit.
Can I set GS_PACKET_DATA_QWORD_MAX a smaller value?

Code: Select all

#define		GS_PACKET_DATA_QWORD_MAX		32000



typedef struct
{
	GS_GIF_DMACHAIN_TAG		tag;
	QWORD					data[GS_PACKET_DATA_QWORD_MAX];


}GS_GIF_PACKET	__attribute__ ((aligned(16)));/*aligne 128bits*/

Posted: Mon Sep 07, 2009 11:19 am
by LionX
max must be the max that the DMA can transfer. i dont remember what the exact number but i believe that its more than 32000. there can be advantaged making it lower but there can be disadvantages by not pushing the DMA to the limit.