cpplibs patch

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
CHERTS
Posts: 15
Joined: Mon Oct 29, 2007 2:23 pm

cpplibs patch

Post by CHERTS »

When building a repository cpplibs ps2dev.org (revision 2435), a few errors:
$ make
cd libpsp2d && make
make[1]: Entering directory `/cygdrive/c/svn/cpplibs/libpsp2d'
psp-g++ -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION
=150 -I.. -c -o framebuffer.o framebuffer.cpp
psp-g++ -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION
=150 -I.. -c -o Exception.o Exception.cpp
psp-g++ -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION
=150 -I.. -c -o Drawable.o Drawable.cpp
psp-g++ -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION
=150 -I.. -c -o Screen.o Screen.cpp
Screen.cpp: In static member function 'static u32* PSP2D::Screen::getList()':
Screen.cpp:229: error: invalid conversion from 'unsigned int*' to 'u32*'
Screen.cpp: In member function 'void PSP2D::Screen::_saveToPNG(const std::string
&)':
Screen.cpp:296: error: 'malloc' was not declared in this scope
Screen.cpp:298: error: invalid conversion from 'int*' to 'int'
Screen.cpp:298: error: initializing argument 4 of 'int sceDisplayGetFrameBuf(v
oid**, int*, int*, int)'
Screen.cpp:336: error: 'free' was not declared in this scope
make[1]: *** [Screen.o] Error 1
make[1]: Leaving directory `/cygdrive/c/svn/cpplibs/libpsp2d'
make: *** [libs] Error 2
Use this patch to address them

cpplibs.patch

Code: Select all

--- libpsp2d/Screen.cpp	2008-10-02 09:50:40.000000000 +0600
+++ libpsp2d/Screen.cpp.new	2008-10-22 13:10:56.515625000 +0600
@@ -37,6 +37,7 @@
 
 #include <pspgu.h>
 #include <pspdisplay.h>
+#include <malloc.h>
 
 #include <png.h>
 
@@ -226,7 +227,7 @@
 
 u32* Screen&#58;&#58;getList&#40;&#41;
 &#123;
-    return list;
+    return &#40;u32*&#41; list;
 &#125;
 
 void Screen&#58;&#58;accept&#40;DrawableVisitor *v&#41;
@@ -261,7 +262,7 @@
     u16* vram16;
     int bufferwidth;
     int pixelformat;
-    int unknown;
+    //int unknown;
     int i, x, y;
     png_structp png_ptr;
     png_infop info_ptr;
@@ -295,7 +296,7 @@
     png_write_info&#40;png_ptr, info_ptr&#41;;
     line = &#40;u8*&#41; malloc&#40;SCREEN_WIDTH * 3&#41;;
     sceDisplayWaitVblankStart&#40;&#41;;  // if framebuf was set with PSP_DISPLAY_SETBUF_NEXTFRAME, wait until it is changed
-    sceDisplayGetFrameBuf&#40;&#40;void**&#41;&vram32, &bufferwidth, &pixelformat, &unknown&#41;;
+    sceDisplayGetFrameBuf&#40;&#40;void**&#41;&vram32, &bufferwidth, &pixelformat, PSP_DISPLAY_SETBUF_IMMEDIATE&#41;;
     vram16 = &#40;u16*&#41; vram32;
     for &#40;y = 0; y < SCREEN_HEIGHT; y++&#41; &#123;
        for &#40;i = 0, x = 0; x < SCREEN_WIDTH; x++&#41; &#123;
--- libpsp2d/Blitter.h	2008-10-02 09&#58;50&#58;40.000000000 +0600
+++ libpsp2d/Blitter.h.new	2008-10-22 13&#58;12&#58;02.609375000 +0600
@@ -37,6 +37,8 @@
 #ifndef _BLITTER_H
 #define _BLITTER_H
 
+#include <string.h>
+
 #include <libpsp2d/Screen.h>
 #include <libpsp2d/Image.h>
 
--- libpsp2d/Mask.cpp	2008-10-02 09&#58;50&#58;40.000000000 +0600
+++ libpsp2d/Mask.cpp.new	2008-10-22 13&#58;13&#58;20.484375000 +0600
@@ -36,6 +36,7 @@
 // $Id&#58; Mask.cpp 1468 2005-11-20 12&#58;18&#58;29Z fraca7 $
 
 #include <malloc.h>
+#include <string.h>
 
 #include "Mask.h"
 
--- libpsp2d/Controller.h	2008-10-02 09&#58;50&#58;40.000000000 +0600
+++ libpsp2d/Controller.h.new	2008-10-22 13&#58;47&#58;53.781250000 +0600
@@ -38,6 +38,7 @@
 #define _CONTROLLER_H
 
 #include <pspctrl.h>
+#include <string.h>
 
 namespace PSP2D
 &#123;
--- samples/hello/Makefile	2008-10-02 09&#58;50&#58;50.000000000 +0600
+++ samples/hello/Makefile.new	2008-10-22 13&#58;47&#58;25.437500000 +0600
@@ -8,7 +8,7 @@
 
 LIBDIR =
 LDFLAGS =
-LIBS = -lpspsnd -lpsp2d -lmikmod -lmmio -lpspaudiolib -lpspaudio -lpspgu -lpng -lz -lm -lstdc++
+LIBS = -lpspsnd -lpsp2d -lmikmod -lmmio -lpspaudiolib -lpspaudio -lpspgu -lpng -lz -lm -lstdc++ -ljpeg
 
 EXTRA_TARGETS = EBOOT.PBP
 PSP_EBOOT_TITLE = Hello World
make-psp.sh
cat cpplibs.patch | patch -p0
make && make install
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Sending libpsp2d/Blitter.h
Sending libpsp2d/Controller.h
Sending libpsp2d/Mask.cpp
Sending libpsp2d/Screen.cpp
Sending samples/hello/Makefile
Transmitting file data .....
Committed revision 2436.
Added to the repository. Thanks for the patch.
Post Reply