View previous topic :: View next topic |
Author |
Message |
LionX
Joined: 27 Dec 2004 Posts: 61
|
Posted: Wed Apr 15, 2009 2:16 pm Post subject: New Demo/Sample code (GuileSmash) |
|
|
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 |
|
|
LBGSHI
Joined: 07 Aug 2006 Posts: 136
|
Posted: Thu Apr 16, 2009 2:55 am Post subject: |
|
|
Cool; I've grabbed it, and will take a look at it later :) _________________ I may be lazy, but I can...zzzZZZzzzZZZzzz... |
|
Back to top |
|
|
cosmito
Joined: 04 Mar 2007 Posts: 314 Location: Portugal
|
Posted: Sun Apr 19, 2009 1:03 am Post subject: |
|
|
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 |
|
|
LionX
Joined: 27 Dec 2004 Posts: 61
|
Posted: Sun Apr 19, 2009 5:37 am Post subject: |
|
|
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 |
|
|
Fakeuser
Joined: 01 Sep 2007 Posts: 15
|
Posted: Sat Jun 13, 2009 12:44 am Post subject: |
|
|
Great work.
Libgs suits me,Thanks for releasing it! |
|
Back to top |
|
|
Fakeuser
Joined: 01 Sep 2007 Posts: 15
|
Posted: Thu Jun 18, 2009 12:58 am Post subject: |
|
|
It seems the arg("mode") of GsEnableAlphaBlending1(unsigned short enable, unsigned short mode) is not used in libgs? |
|
Back to top |
|
|
LionX
Joined: 27 Dec 2004 Posts: 61
|
Posted: Fri Jun 19, 2009 11:15 pm Post subject: |
|
|
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 |
|
|
Fakeuser
Joined: 01 Sep 2007 Posts: 15
|
Posted: Sun Aug 02, 2009 12:53 pm Post subject: |
|
|
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 |
|
|
LionX
Joined: 27 Dec 2004 Posts: 61
|
Posted: Wed Aug 05, 2009 12:36 pm Post subject: |
|
|
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 |
|
|
Fakeuser
Joined: 01 Sep 2007 Posts: 15
|
Posted: Sun Sep 06, 2009 11:31 am Post subject: |
|
|
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 |
|
|
LionX
Joined: 27 Dec 2004 Posts: 61
|
Posted: Mon Sep 07, 2009 11:19 am Post subject: |
|
|
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 |
|
|
|