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 

physfs + squirrel libraries

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



Joined: 04 Jun 2007
Posts: 42

PostPosted: Mon Oct 08, 2007 6:50 am    Post subject: physfs + squirrel libraries Reply with quote

I got these two libraries working on the PSP if anyone else is interested in using them for a project. Both include a (really lame) example application. The examples are building user mode prxs and work on my PSP (3.71 M33-2).

Squirrel (http://squirrel-lang.org)

Description: A scripting language. Not much more to say about it, you can embed this instead of LUA into a program if you like.
Procedure: Get from squirrel_2.1.2_stable.tar.gz http://downloads.sourceforge.net/squirrel/squirrel_2.1.2_stable.tar.gz?download and squirrel_2.1.2-p1_stable.zip from http://www.revworld.org/~cpuwhiz/psp/squirrel_2.1.2-p1_stable.zip. Extract squirrel_2.1.2_stable.tar.gz and then extract squirrel_2.1.2-p1_stable.zip into the resulting directory replacing any files. Use the normal make and make install to build the library. Same applies for the example application in the example folder.

Code:
23e60669cb207fdcd43d447f5af31778  squirrel_2.1.2_stable.tar.gz
1a0322d6f51f17842a6ed64310d58569  squirrel_2.1.2-p1_stable.zip


PhysFS (http://icculus.org/physfs)

Description: A file archive manager. Think Quake3 with pk3 files. You add a bunch of archive files (like zip) and folders to a search path and they all show up in a virtual file system. You use PhysFS calls that look like normal file I/O calls and it will read (or write) the desired file from the folder or archive file that is first in the search order.
Procedure: Same as the procedure for squirrel, but with the PhysFS files instead (physfs-1.1.1.tar.gz and physfs-1.1.1-p1.zip respectively). Get physfs-1.1.1-p1.zip from http://www.revworld.org/~cpuwhiz/psp/physfs-1.1.1-p1.zip
Notes: 7-zip archives are not working for some reason (have not figured out why yet, but zip files and normal folders are (at least with the small files in the example). If you don't want 7-zip support (since it's not working right now), replace the Makefile with the following:
Code:
PSPSDK = $(shell psp-config --pspsdk-path)
PSPDIR = $(shell psp-config --psp-prefix)
TARGET_LIB = libphysfs.a
OBJS = physfs.o physfs_byteorder.o physfs_unicode.o \
         platform/psp.o archivers/dir.o archivers/grp.o \
         archivers/hog.o archivers/lzma.o archivers/mvl.o \
         archivers/qpak.o archivers/wad.o archivers/zip.o

CFLAGS = -O2 -G0 -DPHYSFS_SUPPORTS_ZIP=1 -DPHYSFS_SUPPORTS_GRP=1 \
           -DPHYSFS_SUPPORTS_WAD=1 -DPHYSFS_SUPPORTS_HOG=1 \
           -DPHYSFS_SUPPORTS_MVL=1 -DPHYSFS_SUPPORTS_QPAK=1 \
           -DPHYSFS_PLATFORM_POSIX -DPHYSFS_PLATFORM_UNIX \
           -DPHYSFS_NO_PTHREADS_SUPPORT -DPHYSFS_NO_CDROM_SUPPORT

include $(PSPSDK)/lib/build.mak

install: $(TARGET_LIB)
   @echo "Installing libphysfs into $(PSPDIR)"
   @mkdir -p $(PSPDIR)/include $(PSPDIR)/lib
   @cp physfs.h $(PSPDIR)/include
   @cp libphysfs.a $(PSPDIR)/lib
   @echo "Done"


Code:
0359b67793c1c14f00de1d1bbeb8ed6a  physfs-1.1.1.tar.gz
6bd158ffc7f95ea4cca45a8b77416cd4  physfs-1.1.1-p1.zip
Back to top
View user's profile Send private message
danzel



Joined: 04 Nov 2005
Posts: 182

PostPosted: Mon Oct 08, 2007 8:22 am    Post subject: Reply with quote

Awesome, I was looking at using PhysFS for a project, looks like this decides it.

Big thanks!
Back to top
View user's profile Send private message
fungos



Joined: 31 Oct 2007
Posts: 41
Location: cwb br

PostPosted: Sat Nov 17, 2007 5:23 am    Post subject: Reply with quote

Why dont you put that in svn and prepare psplibraries scripts for them? It could be very useful for everyone. Good job.
Back to top
View user's profile Send private message Visit poster's website
CpuWhiz



Joined: 04 Jun 2007
Posts: 42

PostPosted: Sat Nov 17, 2007 5:42 am    Post subject: Reply with quote

I already made psplibraries scripts for myself (they are not that hard to make) with my own internal svn repo. All you would have to do is change the svn location. I don't have svn access so if someone wants to give me access or add the libraries for me, I am fine with that.

Code:
#!/bin/sh
# physfs.sh by CpuWhiz (cpuwhiz@gmail.com)
# Based on the script by Dan Peori (danpeori@oopo.net)

 ## Download the latest source code.
 if test ! -d "physfs"; then
  svn checkout https://svn.utopia.net/psp/trunk/physfs || { exit 1; }
 else
  svn update physfs || { exit 1; }
 fi

 ## Enter the source directory.
 cd physfs || { exit 1; }

 ## Compile and install.
 make clean && make -j2 && make install && make clean || { exit 1; }


Code:
#!/bin/sh
# squirrel.sh by CpuWhiz (cpuwhiz@gmail.com)
# Based on the script by Dan Peori (danpeori@oopo.net)

 ## Download the latest source code.
 if test ! -d "squirrel"; then
  svn checkout https://svn.utopia.net/psp/trunk/squirrel || { exit 1; }
 else
  svn update squirrel || { exit 1; }
 fi

 ## Enter the source directory.
 cd squirrel || { exit 1; }

 ## Compile and install.
 make clean && make -j2 && make install && make clean || { exit 1; }
Back to top
View user's profile Send private message
fungos



Joined: 31 Oct 2007
Posts: 41
Location: cwb br

PostPosted: Thu Nov 22, 2007 8:20 am    Post subject: Reply with quote

Good. This is a public accessible repository? I'm can't access it from here.
Back to top
View user's profile Send private message Visit poster's website
CpuWhiz



Joined: 04 Jun 2007
Posts: 42

PostPosted: Thu Nov 22, 2007 12:47 pm    Post subject: Reply with quote

CpuWhiz wrote:
I already made psplibraries scripts for myself (they are not that hard to make) with my own internal svn repo.


I just have the utopia.net domain pointing to a server on my LAN.
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 -> 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