[Interested?] OldSchool Library

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

Moderators: cheriff, TyRaNiD

Post Reply
nakuribon
Posts: 5
Joined: Mon Jul 10, 2006 6:45 am
Contact:

Post by nakuribon »

its a windows console application, you have to use it from the command line.
hit start, click run, type "cmd" (no quotes of course), hit enter, get to the Tools directory using a bunch of "cd" commands, type font2osl -convert "FONT NAME HERE" SIZE "BITMAP FILE" "TEXT FILE" and then font2osl -create "BITMAP FILE" "TEXT FILE" "OFT FILE"
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

Sorry guys for not being active... I'm really busy these times. But now it's okay.
I've worked quite a bit on the library in between but never had time to release it.
You can download here the SOURCE CODE (only source files, nothing else like installation package are provided):
http://oslib.palib.info/OSLib_src.zip
This is the latest version source code, a lot in advance compared to the actual distributed version. I'll update it later, but I'm facing some problems regarding backward compatibility.

The advantage of using OSLib like this is that you can easily extend it (without even touching to OSLib's source code) with what you need for your project. For example, if you want to create your own map routine with special mirror handling, you can just take the OSLib oslDrawMap one and slightly modify it. PSP's GPU is sequencial and thus such things are really easy to do without screwing your project. You can for example do:

Code: Select all

oslStartDrawing();
oslClearScreen(0);
sceGuDisable(GU_DITHER);    //Enable dithering
oslDrawImage(myImage);      //Draw this without dithering
sceGuEnable(GU_DITHER);     //Dithering will be used then
oslDrawGradientRect(0, 0, 480, 272, 0, 0, 255, 255);
oslEndDrawing();
Hope this will help in your project. If you are wanting to help in any way, for example by enhancing the current library, you are welcomed. Please tell me ;-)
Sorry for my bad english
Image Oldschool library for PSP - PC version released
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

Nobody is interested? :'(
Is there still somebody using this library? Do you have some suggestion or anything?
Sorry for my bad english
Image Oldschool library for PSP - PC version released
bronxbomber92
Posts: 36
Joined: Fri Jul 21, 2006 11:00 am

Post by bronxbomber92 »

I'm interested :)
But how would I install this? Its different then installing another library, isn't it? I started a bunch of lua games a long time ago, and never released them. I would like to change them over to c using OSLib :) in spare time from my emu and 3D stuff :)

Thanks for you work! Just need to instal it :p

Btw, I'm on Mac OS X
snowymydog
Posts: 2
Joined: Fri Sep 15, 2006 11:26 am

Post by snowymydog »

Hey Brunni, I'm using OSL. It's great.
Sci-Fi yoyo is powered by OSL, and my new project is using OSL too. I can't live without OSL, cause I know nothing about GU.
When I finished my new project, I want to release an OSL extension. Of course, I'll send the source to you and wait for your authorization. If you think it sucks, I won't release it.

Thanks for your work, don't stop updating OSLIB. :P
bronxbomber92
Posts: 36
Joined: Fri Jul 21, 2006 11:00 am

Post by bronxbomber92 »

So, can anyone confirm wether this can be installed on Mac OS X?
goebish
Posts: 29
Joined: Sat Oct 14, 2006 11:59 pm

Post by goebish »

Brunni wrote:Nobody is interested? :'(
Is there still somebody using this library? Do you have some suggestion or anything?
I still use this WONDERFULL lib !
But I still use the older release, what's new in the latest sources ?
You said we have to compil it and that there's no install script but I can see install.bat and a bunch of cygwin compiled libs (*.a) into the archive. Would be great id you could provide a bit more infos.
Thanks :)
Soily
Posts: 2
Joined: Tue Oct 17, 2006 8:02 am

Post by Soily »

Salut/Hello Brunni!
I'm getting started on PSP development, and your library is exactly what I was looking for! I "accidentally" found it while trying to solve an SDL_ttf installation problem, and I'm very happy about that discovery.
So far, I've only played around with it a little bit, testing simple stuff (displaying images, basic controls...), but it really seems to be great, yet simple to use.

So, thank you for making this library and for releasing it. I definitely hope that you will continue working on it, improving and extending it!

Besides (for forum moderators), I think it would be nice if this topic was sticky'd, or if there was a sticky thread with a list of libraries available for PSP developpers (with links and basic info). I think it would be quite useful.

++
Soily
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

Thanks for support :)

In fact I "left" the scene for a while for some reasons (I'm beginning new studies) and when I came again I thought it was completely dead :(
So I'm happy that some people are still using it ^^

It will motivate me to update it, when I get some time (sorry for that, but I've got lot of things to do). If some people are willing to realize "extensions", that would be great, and if you need some code from my side to support doing it in a more generic way, just ask me ;-)
The best thing possible would be that it's just "plug-in-able" without weighting up the whole library for users who don't use it :-)

I just need to find a bit of time to update it. Btw I've uploaded the latest version of the zip, which contains the updated version. There are a lot of fixes, I should update the documentation as well, but I've got so few time now :-( For now, just look at the source (updated as well) if you're wondering how something is working, or just ask here ;-)

And about installation, in fact you have to do the following:
- Locate the standard library folder of your PSPSDK, should be /usr/local/pspdev/psp/sdk/lib.
- Copy to this folder the files libosl.a, libz.a and libpng.a
- Locate the include folder, should be /usr/local/pspdev/psp/sdk/include
- Create an OSLib folder there
- Copy the following files: audio.h, oslib.h, text.h, usb.h, vfpu.h, vfpu_ops.h.

Hope it helps.
http://oslib.palib.info/OSLib.zip

Brunni
Sorry for my bad english
Image Oldschool library for PSP - PC version released
goebish
Posts: 29
Joined: Sat Oct 14, 2006 11:59 pm

Post by goebish »

Thank for the tip. Anyway I switched my psp dev environment to linux, so I've to recompile your lib :)
goebish
Posts: 29
Joined: Sat Oct 14, 2006 11:59 pm

Post by goebish »

I've a compile error:

Code: Select all

psxdev@debianv:~/OSLib_src$ make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -D_DEBUG -DPSP -O2 -G0 -g -Wall -DHAVE_AV_CONFIG_H   -c -o blit.o blit.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -D_DEBUG -DPSP -O2 -G0 -g -Wall -DHAVE_AV_CONFIG_H   -c -o oslib.o oslib.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -D_DEBUG -DPSP -O2 -G0 -g -Wall -DHAVE_AV_CONFIG_H   -c -o vfpu.o vfpu.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -D_DEBUG -DPSP -O2 -G0 -g -Wall -DHAVE_AV_CONFIG_H   -c -o text.o text.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -D_DEBUG -DPSP -O2 -G0 -g -Wall -DHAVE_AV_CONFIG_H -D_DEBUG -DPSP -O2 -G0 -g -Wall -DHAVE_AV_CONFIG_H   -c -o stub.o stub.S
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -D_DEBUG -DPSP -O2 -G0 -g -Wall -DHAVE_AV_CONFIG_H   -c -o audio.o audio.c
audio.c: In function 'oslAudioChannelThread':
audio.c&#58;88&#58; error&#58; 'struct <anonymous>' has no member named 'volumeleft'
audio.c&#58;88&#58; error&#58; 'struct <anonymous>' has no member named 'volumeright'
make&#58; *** &#91;audio.o&#93; Error 1
I have the latest toolchain and sdk compiled from svn.
Any idea ?
johnsto
Posts: 30
Joined: Wed Jan 18, 2006 8:52 am

Post by johnsto »

Brunni I'm still using it!

Something I added to the library myself was loading PNG images from an unsigned char array (so I can compile them all into the eboot). The basic code is at the bottom if anyone wants it.

It would be pretty cool if the same could be done for .wav's and .bgm's? (I had a go but got scared).

Also network support would be nice but I guess that's not the point of the library.

Code: Select all

typedef struct &#123;
	unsigned char *buffer;
	int pos;
&#125; memp_t;

void oslPngReadMemFn&#40;png_structp png_ptr, png_bytep data, png_size_t length&#41;			&#123;
	memp_t *array = &#40;memp_t*&#41;png_get_io_ptr&#40;png_ptr&#41;;
	memcpy&#40;data, array->buffer + array->pos, length&#41;;
	array->pos += length;
&#125;

OSL_IMAGE *oslLoadImagePNG&#40;unsigned char* data, int location, int pixelFormat&#41;
&#123;
	const size_t	nSigSize=8;
	OSL_IMAGE		*p_texture = NULL;

	memp_t mp;
	mp.pos = 0;
	mp.buffer = data;
	mp.pos += nSigSize;

	if &#40; png_check_sig&#40; data, nSigSize &#41; == 0 &#41;
	&#123;
		goto error;
	&#125;
	
	png_struct *	pPngStruct = png_create_read_struct&#40; PNG_LIBPNG_VER_STRING, NULL, NULL, NULL &#41;;

	if &#40; pPngStruct == NULL&#41;
	&#123;
		goto error;
	&#125;

	png_info *	pPngInfo = png_create_info_struct&#40; pPngStruct &#41;;

	if &#40; pPngInfo == NULL &#41;
	&#123;
		png_destroy_read_struct&#40; &pPngStruct, NULL, NULL &#41;;
		goto error;
	&#125;

	if &#40; setjmp&#40; pPngStruct->jmpbuf &#41; != 0 &#41;
	&#123;
		png_destroy_read_struct&#40; &pPngStruct, NULL, NULL &#41;;
		goto error;
	&#125;
	
	p_texture = 1;
	
	png_set_read_fn&#40;pPngStruct, &#40;png_voidp&#41;&mp, &#40;png_rw_ptr&#41;oslPngReadMemFn&#41;;
//	png_init_io&#40; pPngStruct, &f &#41;;
	png_set_sig_bytes&#40; pPngStruct, nSigSize &#41;;
	png_read_png&#40; pPngStruct, pPngInfo, PNG_TRANSFORM_STRIP_16 | PNG_TRANSFORM_PACKING | PNG_TRANSFORM_EXPAND | PNG_TRANSFORM_BGR, NULL &#41;;

	/* SNIP - the rest is the same as oslLoadImageFilePNG - SNIP */
&#125;
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

goebish> Sorry, that's my fault, I've copied the bad files in the source archive. It should be okay now (just download it again) :-)
About file loading, thank you, that's very useful. When I get some time I'll try to make more advanced routines for sound (and so on) that can load anything from a custom stream (RAM, file or user implemented) instead of stdio/FILE.
Sorry for my bad english
Image Oldschool library for PSP - PC version released
goebish
Posts: 29
Joined: Sat Oct 14, 2006 11:59 pm

Post by goebish »

Thanks, I managed to compile it under linux :)
I only had a small problem: the file zlibInterface.h should be named zlibinterface.h

Au fait, tu as un site officiel pour OSLib ? Je pense que ça pourrait interresser beaucoup de monde. Aussi simple à coder que du LUA mais avec un vrai langage ;)
goebish
Posts: 29
Joined: Sat Oct 14, 2006 11:59 pm

Post by goebish »

Thanks, I managed to compile it under linux :)
I only had a small problem: the file zlibInterface.h should be renamed to zlibinterface.h
Johnsto > great code, thanks.

Au fait, tu as un site officiel pour OSLib ? Je pense que ça pourrait interresser beaucoup de monde. Aussi simple à coder que du LUA mais avec un vrai langage ;)
snowymydog
Posts: 2
Joined: Fri Sep 15, 2006 11:26 am

Post by snowymydog »

Brunni, the lastest version OSLib's loop sound doesn't work. I replaced with the old version and compile again, it works fine. So i guess there might be some bugs in the new version. Just to let you know. :)
darkplastic
Posts: 6
Joined: Fri Dec 15, 2006 8:50 pm

Any1 got the fix to sound loop?

Post by darkplastic »

Have any of u guys got the fix to loop sound since i cant seem to find an older version. Cheers
goebish
Posts: 29
Joined: Sat Oct 14, 2006 11:59 pm

Post by goebish »

Brunni, please, please open a dedicated forum about OSLib, I'm sure a lot of people want to see it evolve.

Stp Brunni, un petit forum dédié :)
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

Hello all,
I'm sorry, I've nearly disappeared from the surface of the earth. The problem is, I began a new school which needs a lot of work, and I've got 4h30 of train per day, letting me very few time to work on personal projects.
The current semester is now finished, I'll try to make something more for OSLib, and yes a forum would be a great idea. There's already something there, it seems rather dead because nobody "advertised" for it, only a few courageous people found it by googling. But be assured that when a question is asked there, we always do our best to answer it quickly: http://www.playeradvance.org/forum/foru ... y.php?f=58
The forum which hosts this is french, but you can write in english - like most people coming there do ;)
Something else interesting to do would be to release the MMSPlus source code, as it's a good application for OSLib.
Sorry for my bad english
Image Oldschool library for PSP - PC version released
NeoTechni
Posts: 15
Joined: Mon Oct 30, 2006 5:35 pm

Post by NeoTechni »

Is there a standard map format? Or an editor?
If there is no editor I could make one for Windows
fraca7
Posts: 21
Joined: Mon Oct 03, 2005 12:55 am
Location: Paris
Contact:

Post by fraca7 »

This is *exactly* what I was looking for. I'm not the only one it seems :)

I've hacked up an extension module for Python:

http://fraca7.homeunix.net/trac/wiki/OSLIB/

The two samples (sprite and maps) already work.
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

why not work on this library on your long train rides :)
i know that for me the train is a nice quiet place to get
great work done as you see the country side pass by

so use natures own inspiration
10011011 00101010 11010111 10001001 10111010
fergie4000
Posts: 25
Joined: Fri Jan 19, 2007 3:03 pm

Post by fergie4000 »

this isn't necessarily for this thread, but i am using oslib. is there anyway to read back the co-ordinates onto the screen of the sprite sample at http://oslib.palib.info/samples/ i have tried but no success yet.

tia
goebish
Posts: 29
Joined: Sat Oct 14, 2006 11:59 pm

Post by goebish »

to fergie4000:

What's your problem exactly ?

int x_coord, y_coord;
OSL_IMAGE* mySprite;
... do what you want with your image
x_coord = mySprite->x;
y_coord = mySprite->y;

Is that what you want ?

to Brunni:

You told some time ago that you would release MMS source code, do you still plan to do it ?
fergie4000
Posts: 25
Joined: Fri Jan 19, 2007 3:03 pm

Post by fergie4000 »

i am using the sample. and i want to be able to move the sprite around and read the co-ordinates of the center pixel and printf it to the screen. i'm kinda new at this but i think it is possible. i also want to refresh the co-ords every time the sprite is moved. if that makes any sense?

tia

*edit*
also is it possible to blit text? if so how?
goebish
Posts: 29
Joined: Sat Oct 14, 2006 11:59 pm

Post by goebish »

I think this is what you want:

oslPrintf_xy(mySprite->x,mySprite->y,"%i,%i",mySprite->x,mySprite->y);
fergie4000
Posts: 25
Joined: Fri Jan 19, 2007 3:03 pm

Post by fergie4000 »

ok thanks. looks good.

*edit*
oslPrintf_xy(mySprite->x,mySprite->y,"%i,%i",mySprite->x,mySprite->y);

wouldn't the first mySprite->x,mySprite->y make the text in the same place as the sprite?
goebish
Posts: 29
Joined: Sat Oct 14, 2006 11:59 pm

Post by goebish »

Yes it does.
fergie4000
Posts: 25
Joined: Fri Jan 19, 2007 3:03 pm

Post by fergie4000 »

thats bloody perfect! just tried it. its exactly what i needed. now i just gotta make a better image.

:P

thanks again.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

fraca7 wrote:This is *exactly* what I was looking for. I'm not the only one it seems :)

I've hacked up an extension module for Python:

http://fraca7.homeunix.net/trac/wiki/OSLIB/

The two samples (sprite and maps) already work.
I tried the sample... I'm a little surprised at how fast the parallax scrolling demo runs. It seems perfect for doing those old 16bit computer style platformers and shooters. I might try my hand at making one this spring... I've been doing more python programming recently, and psp-python really has my interest piqued.
Post Reply