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 

pspdebugkb.c patch

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



Joined: 27 Nov 2008
Posts: 108

PostPosted: Wed Jan 21, 2009 3:40 pm    Post subject: pspdebugkb.c patch Reply with quote

http://rapidshare.com/files/186940799/pspdebugkb.patch.gz.html

This patch it to maintain(well, in this case, gain) compatibility with kernel-mode, as pspDebugScreenPrintf is not usable in kernel-mode modules, and pspDebugScreenKprintf is not usable in user-mode(to the best of my knowledge), so I added a macro I came across somewhere to it to substitute that, so that way it would work on both usermode and kernel-mode.
_________________
Programming with:
Geany + Latest PSPSDK from svn
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Wed Jan 28, 2009 8:05 am    Post subject: Reply with quote

Code:
--- pspdebugkb.c        2009-01-21 00:27:21.000000000 -0500
+++ pspdebugkb_new.c    2009-01-21 00:27:17.000000000 -0500
@@ -15,6 +15,8 @@
 #include <string.h>
 #include "pspdebugkb.h"
 
+#define pspDebugScreenPrintf(...) { char buf[256]; sprintf(buf,__VA_ARGS__); pspDebugScreenPuts( buf ); }
+
 static char loCharTable[PSP_DEBUG_KB_NUM_ROWS][PSP_DEBUG_KB_NUM_CHARS] = {
   { '`', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=' },
   { 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\\' },

I don't see how this is any different from the existing pspDebugScreenPrintf implementation in the pspsdk...? Is it just that vsnprintf doesn't exist but sprintf does?
Back to top
View user's profile Send private message
NoEffex



Joined: 27 Nov 2008
Posts: 108

PostPosted: Wed Jan 28, 2009 9:09 am    Post subject: Reply with quote

The pspDebugScreenPrintf does not work in kernel mode(thus the entire debug keyboard), and from my experience, pspDebugScreenKprintf does not work in user mode. So, instead of manually going and doing sprintf this that puts this I just used Raphael's macro he gave me a while back to overcome this.
_________________
Programming with:
Geany + Latest PSPSDK from svn
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Thu Feb 05, 2009 6:23 am    Post subject: Reply with quote

But pspDebugScreenPrintf is implemented just like what you wrote here. If this works in kernel mode, the existing pspDebugScreenPrintf should work too.

Unless, as I said, the difference is that vsnprintf doesn't exist in kernel mode, in which case the pspsdk implementation could be changed.
Back to top
View user's profile Send private message
NoEffex



Joined: 27 Nov 2008
Posts: 108

PostPosted: Mon Feb 09, 2009 3:16 pm    Post subject: Reply with quote

Correct, vsnprintf does not exist in kernel.
_________________
Programming with:
Geany + Latest PSPSDK from svn
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Mon Feb 09, 2009 4:37 pm    Post subject: Reply with quote

Well the "changed" version if the pspDebugScreenKprintf which I modified to use the kernel's callback formatter. Alas due to obvious name conflicts there was no easy and compatible way of matching the two up :) Now if we had a clear separation between kernel and user libraries that wouldn't now be an issue :)
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