forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

New Demo/Sample code (GuileSmash)

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
LionX



Joined: 27 Dec 2004
Posts: 61

PostPosted: Wed Apr 15, 2009 2:16 pm    Post subject: New Demo/Sample code (GuileSmash) Reply with quote

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




.
Back to top
View user's profile Send private message
LBGSHI



Joined: 07 Aug 2006
Posts: 136

PostPosted: Thu Apr 16, 2009 2:55 am    Post subject: Reply with quote

Cool; I've grabbed it, and will take a look at it later :)
_________________
I may be lazy, but I can...zzzZZZzzzZZZzzz...
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
cosmito



Joined: 04 Mar 2007
Posts: 314
Location: Portugal

PostPosted: Sun Apr 19, 2009 1:03 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message Visit poster's website
LionX



Joined: 27 Dec 2004
Posts: 61

PostPosted: Sun Apr 19, 2009 5:37 am    Post subject: Reply with quote

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


.
Back to top
View user's profile Send private message
Fakeuser



Joined: 01 Sep 2007
Posts: 15

PostPosted: Sat Jun 13, 2009 12:44 am    Post subject: Reply with quote

Great work.
Libgs suits me,Thanks for releasing it!
Back to top
View user's profile Send private message
Fakeuser



Joined: 01 Sep 2007
Posts: 15

PostPosted: Thu Jun 18, 2009 12:58 am    Post subject: Reply with quote

It seems the arg("mode") of GsEnableAlphaBlending1(unsigned short enable, unsigned short mode) is not used in libgs?
Back to top
View user's profile Send private message
LionX



Joined: 27 Dec 2004
Posts: 61

PostPosted: Fri Jun 19, 2009 11:15 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Fakeuser



Joined: 01 Sep 2007
Posts: 15

PostPosted: Sun Aug 02, 2009 12:53 pm    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
LionX



Joined: 27 Dec 2004
Posts: 61

PostPosted: Wed Aug 05, 2009 12:36 pm    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message
Fakeuser



Joined: 01 Sep 2007
Posts: 15

PostPosted: Sun Sep 06, 2009 11:31 am    Post subject: Reply with quote

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:

#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*/
Back to top
View user's profile Send private message
LionX



Joined: 27 Dec 2004
Posts: 61

PostPosted: Mon Sep 07, 2009 11:19 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group