 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
NoEffex
Joined: 27 Nov 2008 Posts: 108
|
Posted: Wed Jan 21, 2009 3:40 pm Post subject: pspdebugkb.c patch |
|
|
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 |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Wed Jan 28, 2009 8:05 am Post subject: |
|
|
| 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 |
|
 |
NoEffex
Joined: 27 Nov 2008 Posts: 108
|
Posted: Wed Jan 28, 2009 9:09 am Post subject: |
|
|
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 |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Thu Feb 05, 2009 6:23 am Post subject: |
|
|
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 |
|
 |
NoEffex
Joined: 27 Nov 2008 Posts: 108
|
Posted: Mon Feb 09, 2009 3:16 pm Post subject: |
|
|
Correct, vsnprintf does not exist in kernel. _________________ Programming with:
Geany + Latest PSPSDK from svn |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Mon Feb 09, 2009 4:37 pm Post subject: |
|
|
| 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 |
|
 |
|
|
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
|