[PSP] pspsdk pspdebug patch

Create a single thread for each patch to be added to the repository. Please try to stay on topic.
Post Reply
lego
Posts: 43
Joined: Fri Oct 17, 2008 1:09 am

[PSP] pspsdk pspdebug patch

Post by lego »

Hi, all.

After this problem - pspgl & pspDebugScreenPrintf() - I made this simple patch:

Code: Select all

~$ cd trunk/pspsdk/src
~$ svn diff
Index: debug/scr_printf.c
===================================================================
--- debug/scr_printf.c  (revision 2474)
+++ debug/scr_printf.c  (working copy)
@@ -188,6 +188,16 @@
        g_vram_mode = mode;
 }
 
+void pspDebugScreenSetMaxX(unsigned int maxx)
+{
+       MX = maxx;
+}
+
+void pspDebugScreenSetMaxY(unsigned int maxy)
+{
+       MY = maxy;
+}
+
 int pspDebugScreenGetX()
 {
        return X;
Index: debug/pspdebug.h
===================================================================
--- debug/pspdebug.h    (revision 2474)
+++ debug/pspdebug.h    (working copy)
@@ -117,6 +117,21 @@
  */
 void pspDebugScreenSetBase(u32* base);
 
+/**
+ * Set the X maximum coordinate (in character units)
+ * @note Thus line length will be X + 1 characters.
+ *
+ * @param maxx - The X maximum coordinate 
+ */
+void pspDebugScreenSetMaxX(unsigned int maxx);
+
+/**
+ * Set the Y maximum coordinate (in character units)
+ *
+ * @param maxx - The X maximum coordinate 
+ */
+void pspDebugScreenSetMaxY(unsigned int maxy);
+
 /** 
   * Get the current X co-ordinate (in character units)
   *
~$
Now, in my code I do:

Code: Select all

pspDebugScreenSetMaxX(32);
pspDebugScreenSetMaxY(17);
and my printf output with pspgl looks nice.

May be my problem resolves another way, but in any case this two functions will be good addition to the pspsdk, I think :-).
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

Added in rev 2487
lego
Posts: 43
Joined: Fri Oct 17, 2008 1:09 am

Post by lego »

Thanks :-)!
Post Reply