physfs + squirrel libraries

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

Moderators: cheriff, TyRaNiD

Post Reply
CpuWhiz
Posts: 42
Joined: Mon Jun 04, 2007 1:30 am

physfs + squirrel libraries

Post by CpuWhiz »

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/squirr ... z?download and squirrel_2.1.2-p1_stable.zip from http://www.revworld.org/~cpuwhiz/psp/sq ... 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: Select all

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/ph ... 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: Select all

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: Select all

0359b67793c1c14f00de1d1bbeb8ed6a  physfs-1.1.1.tar.gz
6bd158ffc7f95ea4cca45a8b77416cd4  physfs-1.1.1-p1.zip
danzel
Posts: 182
Joined: Fri Nov 04, 2005 11:03 pm

Post by danzel »

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

Big thanks!
fungos
Posts: 41
Joined: Wed Oct 31, 2007 10:43 am
Location: cwb br
Contact:

Post by fungos »

Why dont you put that in svn and prepare psplibraries scripts for them? It could be very useful for everyone. Good job.
CpuWhiz
Posts: 42
Joined: Mon Jun 04, 2007 1:30 am

Post by CpuWhiz »

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: Select all

#!/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: Select all

#!/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; }
fungos
Posts: 41
Joined: Wed Oct 31, 2007 10:43 am
Location: cwb br
Contact:

Post by fungos »

Good. This is a public accessible repository? I'm can't access it from here.
CpuWhiz
Posts: 42
Joined: Mon Jun 04, 2007 1:30 am

Post by CpuWhiz »

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.
Post Reply