New Demo/Sample code (GuileSmash)

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
LionX
Posts: 61
Joined: Mon Dec 27, 2004 11:40 am

New Demo/Sample code (GuileSmash)

Post 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




.
LBGSHI
Posts: 136
Joined: Mon Aug 07, 2006 5:56 am
Contact:

Post by LBGSHI »

Cool; I've grabbed it, and will take a look at it later :)
I may be lazy, but I can...zzzZZZzzzZZZzzz...
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Post 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?
LionX
Posts: 61
Joined: Mon Dec 27, 2004 11:40 am

Post 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'


.
Fakeuser
Posts: 13
Joined: Sat Sep 01, 2007 4:18 am

Post by Fakeuser »

Great work.
Libgs suits me,Thanks for releasing it!
Fakeuser
Posts: 13
Joined: Sat Sep 01, 2007 4:18 am

Post by Fakeuser »

It seems the arg("mode") of GsEnableAlphaBlending1(unsigned short enable, unsigned short mode) is not used in libgs?
LionX
Posts: 61
Joined: Mon Dec 27, 2004 11:40 am

Post 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.
Fakeuser
Posts: 13
Joined: Sat Sep 01, 2007 4:18 am

Post 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!
LionX
Posts: 61
Joined: Mon Dec 27, 2004 11:40 am

Post 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...
Fakeuser
Posts: 13
Joined: Sat Sep 01, 2007 4:18 am

Post 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*/
LionX
Posts: 61
Joined: Mon Dec 27, 2004 11:40 am

Post 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.
Post Reply