[Interested?] OldSchool Library

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

Moderators: cheriff, TyRaNiD

Post Reply
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

[Interested?] OldSchool Library

Post by Brunni »

Hello all,
I'm working on a PSP library that allows you to create 2D games more easily, without having to learn PSP GE or GU. It's written in C, so it's useable in both C and C++.
For now there is an english and french documentation, but my english is not very good. I would just know if it interests somebody, so that I know if I should continue to work on it or not.
Here's an ALPHA version (this means it's still in development and some things might change): http://oslib.palib.info/OSLib.zip
Source: http://oslib.palib.info/OSLib_src.zip
It's now useable a bit. For example, you can play music and wav files, choose wether you want to stream it or not, load PNG files with an alpha channel, draw 4-point gradient rects, lines, text, message boxes, draw maps, rotate and stretch your images, make them transparent, draw on them by setting them as the current drawbuffer, mix differents pixelformats and so on very easily. It also includes a key handler, so you can get when a key was pressed or is currently held, set autorepeat values for some pressed keys. There are more features, and a lot of others are planned.
The library will be open source, LGPL or something so you can easily extend it. 3D is possible within the library context, but there's no integrated routine, you just have to use GU or GE in this case.
So, do you think it's useful, are some people interested that I continue to work on it?
Thank you in advance for your opinions :)
Last edited by Brunni on Thu Sep 14, 2006 6:29 am, edited 3 times in total.
Sorry for my bad english
Image Oldschool library for PSP - PC version released
Orion_
Posts: 69
Joined: Thu Jan 27, 2005 8:47 am

Post by Orion_ »

I just tried it and it's awesome ! it's exactly what I was looking for making 2D on psp :)
it work pretty well, fast, easy to use and install, is not as big as SDL and use psp hardware gpu, keep the great work !

(only a little bug on the install script, it forget to copy usb.h)
MikeDX
Posts: 30
Joined: Wed Oct 19, 2005 9:24 am

Post by MikeDX »

hey that is very cool. tried it with devkitpro, worked as soon as i copied over usb.h

and as luck would have it, my 4gb hd just died :(
pensoffsky
Posts: 8
Joined: Sun Nov 13, 2005 7:23 am

Post by pensoffsky »

hi,
i really like your library
do you know a way how to convert a sdl surface to something i can use with your functions?
i hope you are still working on this

pensoffsky
Mollusk
Posts: 2
Joined: Fri Mar 03, 2006 12:44 am

Post by Mollusk »

Really great job !
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

Thank you for your replies, it's good not to feel to have done all this for nothing :) (sorry for the frenglish xD)
I don't know anything about SDL, sorry. But there is for sure a mean to do that, the only thing would be to convert your surface info to an OSL_IMAGE structure. I'll take a look at it.
For now I'm still working on it, yes. When finished, I'll try to do some simple games or applications with it and release their source code on this forum if it can interest somebody.
Sorry for my bad english
Image Oldschool library for PSP - PC version released
alain91
Posts: 13
Joined: Wed Mar 01, 2006 7:55 pm

lib

Post by alain91 »

Sympa ta lib :) vivement un site ?

je continue en franglais ;)

Will you add some 'sprite' functions into your lib ?
Will you add mod/x3m/.. playback ?

Regards,
Alain
Orion_
Posts: 69
Joined: Thu Jan 27, 2005 8:47 am

Post by Orion_ »

sprite function can easily be done, this is mine

Code: Select all

void	DrawSprite(OSL_IMAGE *ig, u16 x, u16 y, u16 px, u16 py, u16 sx, u16 sy)
{
  ig->offsetX0 = px;
  ig->offsetY0 = py;
  ig->offsetX1 = px + sx;
  ig->offsetY1 = py + sy;
  ig->stretchX = sx;
  ig->stretchY = sy;
  ig->x = x;
  ig->y = y;
  oslDrawImageSimple(ig);
}
x,y = position on screen
px,py = sprite position in picture (if you have multiple sprite in same picture)
sx,sy = size of the sprite
alain91
Posts: 13
Joined: Wed Mar 01, 2006 7:55 pm

thanks

Post by alain91 »

Thanks Orion_

Perhaps that some guys could co-operate to add more and more features to this lib ?..
psx-frogger
Posts: 5
Joined: Mon Jan 16, 2006 7:27 pm

Post by psx-frogger »

Hi Brunni,

thanks for your work.

Is it the same project as PALIB wich is developped for the Nintendo DS ?

regards

psx frogger
Last edited by psx-frogger on Tue Nov 21, 2006 6:52 am, edited 1 time in total.
Mollusk
Posts: 2
Joined: Fri Mar 03, 2006 12:44 am

Post by Mollusk »

It's not the same project (though we now each other :p). I would say it's a similar kind of library, but for PSP... which seems way harder to do than on DS, by the way ^^
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

Thank you for your replies. I'll try to traduce my doc in english then, because it seems to interest some people, but there's no warranty it will be enough to be understandable xD
It's Mollusk that programmed PALib, and he offered me some hosting for OSLib ^^
Mollusk > It seems harder because it's another world for you, but when you're in it, I wouldn't say it's really harder :-p
Orion_ > This could rather be done like this ;-)

Code: Select all

void DrawSprite(OSL_IMAGE *ig, u16 x, u16 y, u16 px, u16 py, u16 sx, u16 sy) 
{
  oslSetImageTileSize(ig, px, py, sx, sy);
  oslDrawImageSimpleXY(ig, x, y); 
}
Alain> There's no module playback functions for now, but I note it, it might come later. For now I want to finish the library so I can release it ;-)
Sorry for my bad english
Image Oldschool library for PSP - PC version released
Yodajr
Posts: 13
Joined: Sat Sep 24, 2005 7:04 pm

Post by Yodajr »

Brunni wrote:Mollusk > It seems harder because it's another world for you, but when you're in it, I wouldn't say it's really harder :-p
I can confirm ! ;p
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

I released a new version with a first try of english documentation!
You can download the latest zip, and read Doc/english.htm inside :-)
Sorry for my bad english
Image Oldschool library for PSP - PC version released
albator
Posts: 4
Joined: Mon Mar 06, 2006 8:42 am

Post by albator »

Thanks for your great work.

in french:
Je débute avec la programmation sur psp et cette lib est vraiment l'idéal pour commencer à vrai dire j'ai hésiter entre SDL et OSLib, mais avec une doc bien faite et une simplicité d'utilisation certaine mon coeur à basculer vers ta superbe lib, continue sur ta lancée !
Giuliano
Posts: 78
Joined: Tue Sep 13, 2005 10:26 am

Post by Giuliano »

Anyone out there who is looking for an easy to use and fast 2d library, give Oslib a try. Just to give you an idea of how fast it is. I am able to draw about 400 16x16 tiles EVERY pass while still keeping 60FPS.

The library is easy to use and the documentation covers almost everything you need to know to get started.

There are a few bugs in it but hopefully Brunni will get them figured out soon enough. I have only found one and found a way to get around it.

If I ever get my game finished, I will release it to show the capabilities of this library.

Brunni, would it be possible to make a built in function to display a nice "Powered by OSLIB" logo?
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

Thanks :)
How would you like something like this for the logo?
For PSP: http://oslib.palib.info/samples/download/logo_15.zip
For (powerful) PC: http://oslib.palib.info/logo.zip
Sorry for my bad english
Image Oldschool library for PSP - PC version released
Giuliano
Posts: 78
Joined: Tue Sep 13, 2005 10:26 am

Post by Giuliano »

Brunni wrote:Thanks :)
How would you like something like this for the logo?
For PSP: http://oslib.palib.info/samples/download/logo_15.zip
For (powerful) PC: http://oslib.palib.info/logo.zip
That's fine but can it be like "Powered by Oldschool Library" (so people know it's the engine and don't think that it's the name of the game)
danzel
Posts: 182
Joined: Fri Nov 04, 2005 11:03 pm

Post by danzel »

Wow, that was cool, it ran under cedega even.
Yeah, a 'powered by' or something would be good, but overall it is impressive :)
TheHorst
Posts: 12
Joined: Thu Apr 13, 2006 10:11 pm

Post by TheHorst »

how can I change the font, used by the text console?
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

It's not documented yet, but you have to create one with font2osl.exe (included in the tools folder) and then oslLoadFontFile("yourfont").
You can also convert an existing Windows font (run font2osl.exe without parameter for more info).
Sorry for my bad english
Image Oldschool library for PSP - PC version released
TheHorst
Posts: 12
Joined: Thu Apr 13, 2006 10:11 pm

Post by TheHorst »

great, thx

i love this lib really ...

can u give me a hint how i can do alpha blending on a image?
didn´t got it yet ...

i will increase the transparency from 0 to 100%

im a noob and i know it :)
TheHorst
Posts: 12
Joined: Thu Apr 13, 2006 10:11 pm

Post by TheHorst »

well ive tried loading my own font file, as well as the included verdana.oft, but i don´t know but its displaying them wrong ... seems, that it doesn´t adjust the char width ...
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

Transparency: oslSetAlpha with OSL_FX_ALPHA
Font: I used Verdana in my first demo, and it worked. Maybe I have broken something, I'll test it ^^
Sorry for my bad english
Image Oldschool library for PSP - PC version released
TheHorst
Posts: 12
Joined: Thu Apr 13, 2006 10:11 pm

Post by TheHorst »

can u advice me a little more?
thats my code:

oslDrawImage(tmpimage);
oslSetAlpha(OSL_FX_ALPHA, what has to be here to make it 50% transparent);
oslSyncFrame();

thx for evrything ...
Yodajr
Posts: 13
Joined: Sat Sep 24, 2005 7:04 pm

Post by Yodajr »

Code: Select all

//transparency
oslSetAlpha(OSL_FX_ALPHA,alpha);

oslDrawImage(image);

//desactive transparency
oslSetAlpha(OSL_FX_RGBA,alpha);
With "alpha" goes from 0 to 255
TheHorst
Posts: 12
Joined: Thu Apr 13, 2006 10:11 pm

Post by TheHorst »

Yodajr wrote:

Code: Select all

//transparency
oslSetAlpha(OSL_FX_ALPHA,alpha);

oslDrawImage(image);

//desactive transparency
oslSetAlpha(OSL_FX_RGBA,alpha);
With "alpha" goes from 0 to 255
well thats what i´ve tried ... doesn´t has any effect on the image ...
Yodajr
Posts: 13
Joined: Sat Sep 24, 2005 7:04 pm

Post by Yodajr »

TheHorst wrote: well thats what i´ve tried ... doesn´t has any effect on the image ...
Are you sure ? 'cause this code works, try to download again the last version of oslib and retry...
Tutorials about OSLib here
TheHorst
Posts: 12
Joined: Thu Apr 13, 2006 10:11 pm

Post by TheHorst »

thanks solved it ... needs to have 2 components to work ... BG image and image you wana bland ... tried it without background that was te prob ...
monkey242
Posts: 3
Joined: Tue Apr 25, 2006 4:19 am

Post by monkey242 »

I'm fairly new to programming for the PSP so forgive me if this is really simple stuff. I'm trying to use oslib to do some C++ programming and I've hit a few snags.

First, on line 60 of oslib.h you typedef a bool as a short. g++ complains that you can't redefine bool so I just put an #ifndef __cplusplus around that line. Is that correct or will it break something else?

Assuming that it was correct to not include that line, the second thing is that I'm getting multiple definitions of 'osl_powerCallback' in 'oslSetupFTrigo' while linking. This then breaks every oslib function that appears in my code.

My code (just a little test stub at the moment) compiles when I change the extension from .cpp to .c and remove -lstdc++ from the makefile.

Does anyone know where I'm going wrong?
Post Reply