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 

[PS2] Simple patch for gsKit

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> Patch Submissions
View previous topic :: View next topic  
Author Message
ffgriever



Joined: 27 Oct 2007
Posts: 13

PostPosted: Sun Jun 20, 2010 11:06 pm    Post subject: [PS2] Simple patch for gsKit Reply with quote

Hi. I prepared a simple patchset for gsKit.

Nothing special. Just added three new primitives
*goraud shaded and textured triangle
*goraud shaded and textured quad
*goraud shaded line

You can get some really nice effects with these.

Also corrected a minor mistake that ragnarok did in gsInit (he conditionally adds dithe packet, but forgot to conditionally increase packet number).

*removed*

Here is the correct one:

http://www.mediafire.com/file/ryeqnyytwee/gskit.patch
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Mon Jun 21, 2010 7:05 am    Post subject: Reply with quote

I applied everything except this hunk:
Code:
--- ee/gs/src/gsInit.c  (revision 1682)
+++ ee/gs/src/gsInit.c  (working copy)
@@ -161,6 +161,8 @@
        u64     *p_data;
        u64     *p_store;
        int     size = 18;
+       
+       if((gsGlobal->Dithering == GS_SETTING_ON) && ((gsGlobal->PSM == GS_PSM_CT16) || (gsGlobal->PSM == GS_PSM_CT16S))) size = 19;
 
     gsKit_set_buffer_attributes(gsGlobal);

In current svn, the initializer is "int size = 17", so this doesn't apply.
Back to top
View user's profile Send private message
ffgriever



Joined: 27 Oct 2007
Posts: 13

PostPosted: Mon Jun 21, 2010 5:00 pm    Post subject: Reply with quote

Yes, you're right of course. But now the funny part: I did the diff against the svn head, so by all means it should detect the 17 -> 18 as change and place it in the patch... Once I'll get the chance, I will do it again and make sure everything is fine ;).

It's 18 because ragnarok added dithering matrix packet, and if conditions are met, also sets "dithering enabled" register by another packet. So it should be 18 if dith is not enabled and 19 if it is. Nevermind, I'll post this simple change again when I'll get back home.
Back to top
View user's profile Send private message
cosmito



Joined: 04 Mar 2007
Posts: 314
Location: Portugal

PostPosted: Wed Jul 21, 2010 1:28 am    Post subject: Reply with quote

ffgriever wrote:
Yes, you're right of course. But now the funny part: I did the diff against the svn head, so by all means it should detect the 17 -> 18 as change and place it in the patch... Once I'll get the chance, I will do it again and make sure everything is fine ;).

It's 18 because ragnarok added dithering matrix packet, and if conditions are met, also sets "dithering enabled" register by another packet. So it should be 18 if dith is not enabled and 19 if it is. Nevermind, I'll post this simple change again when I'll get back home.

Please don't forget this :) New updates for PS2 dev are nowadays rare and it will be a pity if this gets missed from the official repository.
Back to top
View user's profile Send private message Visit poster's website
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Wed Jul 21, 2010 2:09 am    Post subject: Reply with quote

I just committed this:
Code:
Index: gsInit.c
===================================================================
--- gsInit.c    (revision 1664)
+++ gsInit.c    (working copy)
@@ -160,8 +160,12 @@
 {
        u64     *p_data;
        u64     *p_store;
-       int     size = 17;
+       int     size = 18;
 
+       if((gsGlobal->Dithering == GS_SETTING_ON) &&
+          ((gsGlobal->PSM == GS_PSM_CT16) || (gsGlobal->PSM == GS_PSM_CT16S)))
+               size = 19;
+
     gsKit_set_buffer_attributes(gsGlobal);
 
 #ifdef DEBUG
If that's not right, just submit a patch against current svn.
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 -> Patch Submissions 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