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 

cpplibs patch

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
CHERTS



Joined: 29 Oct 2007
Posts: 15

PostPosted: Wed Oct 22, 2008 5:36 pm    Post subject: cpplibs patch Reply with quote

When building a repository cpplibs ps2dev.org (revision 2435), a few errors:

Quote:
$ 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:
--- 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::getList()
 {
-    return list;
+    return (u32*) list;
 }
 
 void Screen::accept(DrawableVisitor *v)
@@ -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(png_ptr, info_ptr);
     line = (u8*) malloc(SCREEN_WIDTH * 3);
     sceDisplayWaitVblankStart();  // if framebuf was set with PSP_DISPLAY_SETBUF_NEXTFRAME, wait until it is changed
-    sceDisplayGetFrameBuf((void**)&vram32, &bufferwidth, &pixelformat, &unknown);
+    sceDisplayGetFrameBuf((void**)&vram32, &bufferwidth, &pixelformat, PSP_DISPLAY_SETBUF_IMMEDIATE);
     vram16 = (u16*) vram32;
     for (y = 0; y < SCREEN_HEIGHT; y++) {
        for (i = 0, x = 0; x < SCREEN_WIDTH; x++) {
--- libpsp2d/Blitter.h   2008-10-02 09:50:40.000000000 +0600
+++ libpsp2d/Blitter.h.new   2008-10-22 13:12: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:50:40.000000000 +0600
+++ libpsp2d/Mask.cpp.new   2008-10-22 13:13:20.484375000 +0600
@@ -36,6 +36,7 @@
 // $Id: Mask.cpp 1468 2005-11-20 12:18:29Z fraca7 $
 
 #include <malloc.h>
+#include <string.h>
 
 #include "Mask.h"
 
--- libpsp2d/Controller.h   2008-10-02 09:50:40.000000000 +0600
+++ libpsp2d/Controller.h.new   2008-10-22 13:47:53.781250000 +0600
@@ -38,6 +38,7 @@
 #define _CONTROLLER_H
 
 #include <pspctrl.h>
+#include <string.h>
 
 namespace PSP2D
 {
--- samples/hello/Makefile   2008-10-02 09:50:50.000000000 +0600
+++ samples/hello/Makefile.new   2008-10-22 13:47: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

Quote:
cat cpplibs.patch | patch -p0
make && make install
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Wed Oct 22, 2008 11:27 pm    Post subject: Reply with quote

Quote:
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.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development 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