[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

Post by Brunni »

Sorry for the late reply :-'
I don't understand your question (and no need to translate with babelfish, thanks ;-)
Why would you like to create a new instance every time? Maybe oslCreateImageTile is what you need, but it will require extra memory, so it's not a very good idea...
Sorry for my bad english
Image Oldschool library for PSP - PC version released
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

Hi brunni !

First i never thanks you for oslib so, thanks :)
I'v used oslib for the first time there is a while ago, and i always add a problem, that is i think a problem with libpng. I'm using psplink to view the psp memory usage to manage/optimize it, but when initializing oslib the memory left on the psp is automaticly around 1mb. I think libpng or oslib automaticly allocate an amount of memory or dunno.. so is there a way to prevent this so i can have a better view of the memory used when adding a function or anything else ?

See you,
Cpasjuste.
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

Thanks ^^
OSLib doesn't even use 1 MB, so it's strange that you say it only leaves 1 MB free...
In fact I'm sorry but I can't help you, I've never been able to set-up psplink, it's sooooo complicated :/
Maybe if you want you could see with the source code to find where (which routine) the memory usage grows so much?
Sorry for my bad english
Image Oldschool library for PSP - PC version released
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

Hehe, you miss the best dev tool for the psp without using psplink !
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

I'd like to get it to work...
I don't like spending hours setting up a devtool. I know some people will say it's a bad point of view, but that's it. I didn't find any "ready to use" pack for PSPlink, and last time I tried, I've not got anything to work (my PSP was on a black screen with PSPLink v2.0 or something and I had to open a console on Windows which did nothing, whatever command I fed it with), and I don't understand the documentation (in english) :(
But maybe you can help me? :)
Thanks
Sorry for my bad english
Image Oldschool library for PSP - PC version released
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

Hi bruuni, so here it is, you should try it :

- Download http://mydedibox.fr/downloads/PSP/psplink_2.0.zip

- Copy the folder "/psp/game/psplink" to the psp game folder

- Launch psplink from the psp, you should see like you said "welcome do psplink 2.0 ...blah blah

- If you are not connected via USB to the PC, connect your psp via USB, windows should ask you a driver for the psp usb, select the one in "/PC/driver"

- launch "usbhostfs_pc.exe" from the folder "/PC", you should see "connected"

- launch "pcterm.exe" from the folder "/PC", you should have a prompt "host0:>"

From here, you could type "help" to see the available commands. Type "ls" for exemple to see where you are, you should see the content of the directory where you have launch usbhostfs_pc.exe on your pc. You should launch usbhostfs_pc.exe with one parameter : the path to your current psp project eg : "usbhostfs_pc.exe c:\mypspgame". Now type "ls" again then you will see the content of the folder mypspgame. Type "./myproject.elf" to launch your compiled program, with the terminal still running. Very cool to debug applications :) You could also type "reset" to reset psplink, compile again your aplication then launch it again directly from psplink without having to transfer it ....

I will send you a french copy of this tomorow from work if needed.

See you soon.
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

Thank you very much.
Cpasjuste wrote:Hi bruuni, so here it is, you should try it :

- Download http://mydedibox.fr/downloads/PSP/psplink_2.0.zip

- Copy the folder "/psp/game/psplink" to the psp game folder

- Launch psplink from the psp, you should see like you said "welcome do psplink 2.0 ...blah blah

- If you are not connected via USB to the PC, connect your psp via USB, windows should ask you a driver for the psp usb, select the one in "/PC/driver"

- launch "usbhostfs_pc.exe" from the folder "/PC", you should see "connected"

- launch "pcterm.exe" from the folder "/PC", you should have a prompt "host0:>"

From here, you could type "help" to see the available commands. Type "ls" for exemple to see where you are, you should see the content of the directory where you have launch usbhostfs_pc.exe on your pc. You should launch usbhostfs_pc.exe with one parameter : the path to your current psp project eg : "usbhostfs_pc.exe c:\mypspgame". Now type "ls" again then you will see the content of the folder mypspgame. Type "./myproject.elf" to launch your compiled program, with the terminal still running. Very cool to debug applications :) You could also type "reset" to reset psplink, compile again your aplication then launch it again directly from psplink without having to transfer it ....

I will send you a french copy of this tomorow from work if needed.

See you soon.
Thank you very much!
Strangely, MMSPlus won't even start with PSPLink (bus error), but it works perfectly without it :S
Anyway, what I have found is that once I call malloc for the first time, the free memory drops to 1.2 MB. Using OSLib or not. I don't know what PSPLink does to compute the available memory but I guess malloc reserves a huge block of memory for its internal use and then allocates memory within it, which is the problem.
What are you using for allocating your memory?
Sorry for my bad english
Image Oldschool library for PSP - PC version released
nDEV
Posts: 48
Joined: Fri Apr 13, 2007 1:26 am

Post by nDEV »

Brunni wrote:Sorry for the late reply :-'
I don't understand your question (and no need to translate with babelfish, thanks ;-)
Why would you like to create a new instance every time? Maybe oslCreateImageTile is what you need, but it will require extra memory, so it's not a very good idea...
I found another way(resizing arrays) , but thanks!.

By the way , is there any bug in "oslDeleteImage()" function?
Because when i use the function , after some time the application crashes!.


my function that releases unused objects is this one:

Code: Select all

void CLEAR_LIST(OSL_IMAGE *D[],int LIMIT)
{
int l;
for &#40;l=0;l<=LIMIT-1;l++&#41;
&#123;
if&#40;D&#91;l&#93;&#41; &#123; oslDeleteImage&#40;D&#91;l&#93;&#41;; &#125;
&#125;
return ;
&#125;
An example:

OSL_IMAGE * LOOP[5];//GLOBAL

Code: Select all

int t;
for &#40;t=0;t<=4;t++&#41;
&#123;
LOOP&#91;t&#93;=loadimage&#40;blahblah&#41;
&#125;
When its time to load the next level:

Code: Select all

CLEAR_LIST&#40;LOOP,5&#41;;
LOAD THE NEXT LEVEL..
[/code]
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

Are you loading your images to vram with "OSL_IN_VRAM" ? If yes, you must delet the last loaded image before the others one.
nDEV
Posts: 48
Joined: Fri Apr 13, 2007 1:26 am

Post by nDEV »

Cpasjuste wrote:Are you loading your images to vram with "OSL_IN_VRAM" ? If yes, you must delet the last loaded image before the others one.
No , im using RAM :
OSL_IN_RAM, OSL_PF_5551
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

Hum ok, strange problem, it work fine here.
nDEV
Posts: 48
Joined: Fri Apr 13, 2007 1:26 am

Post by nDEV »

Cpasjuste wrote:Hum ok, strange problem, it work fine here.
Well , it happens after i load the same level for about 3-4 times!
Thats really weird..
nDEV
Posts: 48
Joined: Fri Apr 13, 2007 1:26 am

Post by nDEV »

nDEV wrote:
Cpasjuste wrote:Hum ok, strange problem, it work fine here.
Well , it happens after i load the same level for about 3-4 times!
Thats really weird..
I think i found the bug ;) !

There was a part of my code that i think it was behind all this!
The sound manager was actually loading the same sound file on the pointer without deleting the previous!

edit:
woohoo! yea , that was the problem!!!!!!!!!!!!!!!#@!@#!@#!@!111
nDEV
Posts: 48
Joined: Fri Apr 13, 2007 1:26 am

Post by nDEV »

By the way , how many sound channels im able to use?
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

8 (0-7)
Sorry for my bad english
Image Oldschool library for PSP - PC version released
nDEV
Posts: 48
Joined: Fri Apr 13, 2007 1:26 am

Post by nDEV »

Oks thanks.
nDEV
Posts: 48
Joined: Fri Apr 13, 2007 1:26 am

Post by nDEV »

Another question!
Some times my 2nd app crashes...is there any option that shows the error on the screen instead of crashing!!?
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

PSPLink... ;)
Sorry for my bad english
Image Oldschool library for PSP - PC version released
nDEV
Posts: 48
Joined: Fri Apr 13, 2007 1:26 am

Post by nDEV »

oh ok lol

Btw , how do you release the keys?

oslFlushKeys isnt working!
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

Release the keys? I don't understand what you want to do...
Sorry for my bad english
Image Oldschool library for PSP - PC version released
BigNastyCurve
Posts: 9
Joined: Sun May 13, 2007 5:33 am

Post by BigNastyCurve »

This is a little off-topic, but when I install psplink and get to the windows driver installation part, after I choose the driver in /PC/driver I'm told that "The hardware was not installed because the wizard could not find the necessary software". Does anyone have any idea why it won't accept the driver? Windows XP SP2.

Nm I fixed it...

Use this guide if you can't get the file listed above to work:

http://forums.qj.net/f-psp-development- ... 49335.html
Last edited by BigNastyCurve on Sun May 13, 2007 1:12 pm, edited 1 time in total.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

BigNastyCurve wrote:This is a little off-topic, but when I install psplink and get to the windows driver installation part, after I choose the driver in /PC/driver I'm told that "The hardware was not installed because the wizard could not find the necessary software". Does anyone have any idea why it won't accept the driver? Windows XP SP2.
I ran into the same thing... WXP/SP2 won't install the drivers unless the hardware is present. You have to activate PSPLink (or something equivalent) on the PSP first, THEN it'll let you install the drivers.
BigNastyCurve
Posts: 9
Joined: Sun May 13, 2007 5:33 am

Post by BigNastyCurve »

Hmmm, yah I did that (which is why it prompted me for drivers to begin with) but it still wouldn't take. In any case, the guide listed in my link helped me solve it (albet it took longer). Thanks, though!
BigNastyCurve
Posts: 9
Joined: Sun May 13, 2007 5:33 am

Post by BigNastyCurve »

Is the zip file in the first post still his latest version? Just checking, as I'd really like to use this lib.
nDEV
Posts: 48
Joined: Fri Apr 13, 2007 1:26 am

Post by nDEV »

Which is the latest release?
im gonna use oslib again in few days for a simple app..
goebish
Posts: 29
Joined: Sat Oct 14, 2006 11:59 pm

Post by goebish »

I think you can find it here:
http://oslib.palib.info/OSLib.zip

Hi Brunni, I think you should change your sig so that it directly point to oslib website ;)
nDEV
Posts: 48
Joined: Fri Apr 13, 2007 1:26 am

Post by nDEV »

goebish wrote:I think you can find it here:
http://oslib.palib.info/OSLib.zip

Hi Brunni, I think you should change your sig so that it directly point to oslib website ;)
hmm..ok :P
Brunni
Posts: 186
Joined: Sat Oct 08, 2005 10:27 pm

Post by Brunni »

FINALLY!!!!!!!!
Here it is :) The version 2.00 alpha1. Get it here: http://brunni.dev-fr.org/index.php?page=pspsoft_oslib

It's alpha, not definite (some things may change until the final release!), but it's still good for testing ;)
Please tell me any problem or suggestion with this version. Thank you in advance ^^

Here is an all new documentation, very complete: http://brunni.dev-fr.org/oslib/doc/doxygen/index.html (go to the module tab)
Here is a partial list of new functionality (read the CHANGES.TXT file for more information, especially about changes that could eventually break your code):

Code: Select all

 - All new documentation&#58; every OSLib function is documented, and there are some code samples.
 - osl_keys->pressed.thing replaced with osl_pad.pressed.thing &#40;old method is still available&#41;
 - New audio formats&#58; MOD, S3M, IT and XM! WARNING&#58; ONLY ONE OF THESE FILES CAN BE PLAYED AT ONCE! Only BGM and WAV support multiple instances.
 - VRAM manager added&#58; you can now load and unload images from VRAM in any order &#58;&#41; Can be disabled.
 - You can move images from RAM <=> VRAM at any time!
 - You can now unswizzle images, and swizzle them more easily &#40;even directly when creating&#41;!
 - You can now directly load paletted images, create paletted image from a true color one, convert between image formats!
 - You can draw and read single pixels on images
 - You can set an automatic fatal error message to display if any file could not be loaded.
 - New map format supporting tile mirroring!
 - Highly optimized map drawing routine. Runs as fast as oslDrawMapSimple before but without any limitation!
 - New 4-bit font format&#58; you can display colorful characters, which can be tinted!
 - New text engine, running faster, except if you set a non fully transparent background color.
 - Faster image drawing. Rotated images, even big ones are drawn as fast as other. oslDrawImage is faster and you don't need to use oslDrawImageSimple anymore. Computed coordinates for rotated images are more precise now, the rotation will appear perfectly smooth.
 - Better sound mixer. If you play another sound on a busy channel, the old sound will stop. You cannot play the same sound on several channels though, you must create multiple instances.
 - New effect OSL_FX_TINT, allowing to tint objects.
 - New variables OSL_SCREEN_WIDTH / HEIGHT &#40;depends on the current drawbuffer&#41;
 - You can now define the framerate you want!
 - Dithering can be enabled / disabled &#40;disabled by default&#41;.
 - The resolution can be changed on the fly &#40;just call oslInitGfx again&#41;!
 - The default display list size can be redefined &#40;more or less instructions before needing a oslSyncDrawing&#41;.
 - oslInit has got new arguments to make OSLib it more or less intrusive.
 - New text functions &#40;GetStringWidth, ...&#41;.
 - New virtual file system! Everything can now be loaded from a file, memory or a custom device you created by yourself.
 - You can now define an alpha value to set to the drawbuffer for written pixels!
 - Better and cleaner synchronization code.
   - You should no more see tearing on top of the screen when sound puts a heavy load on the CPU.
 - Clipping is now defined automatically with oslSetDrawBuffer!
 - On PC, any texture type is now supported; if the hardware does not support a format, it's automatically converted.
Download link: http://brunni.dev-fr.org/dl/psp/OSLib_200a1.rar
Sorry for my bad english
Image Oldschool library for PSP - PC version released
seventoes
Posts: 79
Joined: Sun Oct 02, 2005 4:50 am

Post by seventoes »

Brunni wrote:FINALLY!!!!!!!!
Here it is :) The version 2.00 alpha1. Get it here: http://brunni.dev-fr.org/index.php?page=pspsoft_oslib

It's alpha, not definite (some things may change until the final release!), but it's still good for testing ;)
Please tell me any problem or suggestion with this version. Thank you in advance ^^

Here is an all new documentation, very complete: http://brunni.dev-fr.org/oslib/doc/doxygen/index.html (go to the module tab)
Here is a partial list of new functionality (read the CHANGES.TXT file for more information, especially about changes that could eventually break your code):

Code: Select all

 - All new documentation&#58; every OSLib function is documented, and there are some code samples.
 - osl_keys->pressed.thing replaced with osl_pad.pressed.thing &#40;old method is still available&#41;
 - New audio formats&#58; MOD, S3M, IT and XM! WARNING&#58; ONLY ONE OF THESE FILES CAN BE PLAYED AT ONCE! Only BGM and WAV support multiple instances.
 - VRAM manager added&#58; you can now load and unload images from VRAM in any order &#58;&#41; Can be disabled.
 - You can move images from RAM <=> VRAM at any time!
 - You can now unswizzle images, and swizzle them more easily &#40;even directly when creating&#41;!
 - You can now directly load paletted images, create paletted image from a true color one, convert between image formats!
 - You can draw and read single pixels on images
 - You can set an automatic fatal error message to display if any file could not be loaded.
 - New map format supporting tile mirroring!
 - Highly optimized map drawing routine. Runs as fast as oslDrawMapSimple before but without any limitation!
 - New 4-bit font format&#58; you can display colorful characters, which can be tinted!
 - New text engine, running faster, except if you set a non fully transparent background color.
 - Faster image drawing. Rotated images, even big ones are drawn as fast as other. oslDrawImage is faster and you don't need to use oslDrawImageSimple anymore. Computed coordinates for rotated images are more precise now, the rotation will appear perfectly smooth.
 - Better sound mixer. If you play another sound on a busy channel, the old sound will stop. You cannot play the same sound on several channels though, you must create multiple instances.
 - New effect OSL_FX_TINT, allowing to tint objects.
 - New variables OSL_SCREEN_WIDTH / HEIGHT &#40;depends on the current drawbuffer&#41;
 - You can now define the framerate you want!
 - Dithering can be enabled / disabled &#40;disabled by default&#41;.
 - The resolution can be changed on the fly &#40;just call oslInitGfx again&#41;!
 - The default display list size can be redefined &#40;more or less instructions before needing a oslSyncDrawing&#41;.
 - oslInit has got new arguments to make OSLib it more or less intrusive.
 - New text functions &#40;GetStringWidth, ...&#41;.
 - New virtual file system! Everything can now be loaded from a file, memory or a custom device you created by yourself.
 - You can now define an alpha value to set to the drawbuffer for written pixels!
 - Better and cleaner synchronization code.
   - You should no more see tearing on top of the screen when sound puts a heavy load on the CPU.
 - Clipping is now defined automatically with oslSetDrawBuffer!
 - On PC, any texture type is now supported; if the hardware does not support a format, it's automatically converted.
Download link: http://brunni.dev-fr.org/dl/psp/OSLib_200a1.rar
All i can say is wow! Great job brunni, OSLib is probably the simplest and most powerful library available! Cant wait for v2 final so i can upgrade my WIP to make use of all those tasty optimizations :) (Im especially liking the vpu_sinf and vpu_cosf, plans to make a vpu_atan/atan2? Those two are used quite a bit in my game.)

Thanks for all your hard work!
BigNastyCurve
Posts: 9
Joined: Sun May 13, 2007 5:33 am

Post by BigNastyCurve »

question about 1.0:

This works:

intro = oslLoadImageFile("splash_32.png", OSL_IN_RAM, OSL_PF_8888);



This doesn't work:

intro = oslLoadImageFile(".\\images\\splash_32.png", OSL_IN_RAM, OSL_PF_8888);


The file is in both locations. I was extremely puzzled at first because I couldn't get an image loaded to save my life. Then I moved it out into the eboot directory, changed my code and it worked. Is there a particular reason that I can't use subdirectories? I'd rather not have my assets all over the main directory if I can help it.

Thanks...
Post Reply