PSP Hacks - Forums

Go Back   PSP Hacks - Forums > PSP Community > PSP Programming & Development

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 01-03-2009, 12:44 PM
CrazedPimp CrazedPimp is offline
PSP Newbie
 

Join Date: Aug 2008
Location: USA, OH
Posts: 13
CrazedPimp Has a Beginner Reputation
Default

i Googled around and found a newer version of oslib(2.10) then the one I have, but it didn't seem to have any newer features for maps of sprites. any ideas?

Last edited by CrazedPimp; 01-03-2009 at 01:54 PM.
Reply With Quote
  #2  
Old 01-03-2009, 02:49 PM
Furypaw's Avatar
Furypaw Furypaw is offline
Programmer
PSP Veteran
 
Join Date: Jul 2007
Location: Furypaw.rar
Posts: 1,058
Furypaw is on a distinguished road
Default

That's cause that site I gave you has the tutorials for it -.-
__________________
Reply With Quote
  #3  
Old 01-05-2009, 03:35 PM
CrazedPimp CrazedPimp is offline
PSP Newbie
 

Join Date: Aug 2008
Location: USA, OH
Posts: 13
CrazedPimp Has a Beginner Reputation
Default

Dark_Sabre the site is back up but i didn't find anything about using maps to hold sprites.
Reply With Quote
  #4  
Old 01-05-2009, 04:05 PM
Furypaw's Avatar
Furypaw Furypaw is offline
Programmer
PSP Veteran
 
Join Date: Jul 2007
Location: Furypaw.rar
Posts: 1,058
Furypaw is on a distinguished road
Default

well there is if you look

http://oslib.playeradvance.org/doku.php?id=day8
__________________
Reply With Quote
  #5  
Old 01-05-2009, 09:52 PM
CrazedPimp CrazedPimp is offline
PSP Newbie
 

Join Date: Aug 2008
Location: USA, OH
Posts: 13
CrazedPimp Has a Beginner Reputation
Default

Maybe i'm asking the wrong thing. i know how to use maps for backgrounds, but i don't know how to use maps for sprites. what i would like to know is how to draw say (50x50) sprite of a (1024x512) map
Reply With Quote
  #6  
Old 01-06-2009, 12:13 AM
Furypaw's Avatar
Furypaw Furypaw is offline
Programmer
PSP Veteran
 
Join Date: Jul 2007
Location: Furypaw.rar
Posts: 1,058
Furypaw is on a distinguished road
Default

Oh... right.... look in PSDonkey's oslib tutorials on animations, it shows you how. or you could look in my platformer example, it uses PSDonkey's animation.
__________________
Reply With Quote
  #7  
Old 01-26-2009, 04:56 PM
Aaron*1 Aaron*1 is offline
PSP Guru
 

Join Date: Jan 2008
Posts: 1,510
Aaron*1 will become famous soon enoughAaron*1 will become famous soon enough
Default

In the makefile for lesson #1 could someone explain to me exactly what some of the things do and the same with the main.c

In the makefile

Code:
TARGET = Donkey_Lesson1
OBJS = main.o  

INCDIR = 
CFLAGS = -G4 -Wall -O2 
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS =
STDLIBS= -losl -lpng -lz \
  -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lm
LIBS=$(STDLIBS)$(YOURLIBS)


EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Donkey_Lesson1


PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Could someone explain what all of this does?
Code:
LIBDIR =
LDFLAGS =
STDLIBS= -losl -lpng -lz \
  -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lm
LIBS=$(STDLIBS)$(YOURLIBS)
Mainly the parts before "="


Could someone also explain
Code:
INCDIR = 
CFLAGS = -G4 -Wall -O2 
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
What this means?



In the main.c:
Code:
//OSlib header file
#include <oslib/oslib.h>

//callbacks
PSP_MODULE_INFO("OSLib Sample", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);

int main()
{
    //Initialization of the Oslib library
    oslInit(0);

    //Initialization of the graphics mode
    oslInitGfx(OSL_PF_8888, 0);

    //Initialization of the text console
    oslInitConsole();

    //Print on the screen this text
    oslPrintf("Hello World");

    //Wait for a button to be pressed
    oslWaitKey();
    
    //terminate the program
    oslEndGfx();
    oslQuit();
    return 0;
}
Could someone explain what the callbacks are and actually do (also what the numbers mean).
Code:
//callbacks
PSP_MODULE_INFO("OSLib Sample", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
What does the number in this mean?
Code:
//Initialization of the Oslib library
    oslInit(0);
What does it mean/do when there are two brackets beside each other " () "

Finally what does the bit in brackets mean/do:

Code:
//Initialization of the graphics mode
    oslInitGfx(OSL_PF_8888, 0);
I just want to get all of this cleared up before I move on because I tried moving on bu tI wanted to know how to do at least this all by myself and I can't if I don't know what everything means.
__________________
lol@sigs

Last edited by Aaron*1; 01-26-2009 at 05:04 PM.
Reply With Quote
  #8  
Old 01-26-2009, 05:37 PM
pirata nervo pirata nervo is offline
Moderator
PSP Titan
 

Join Date: Mar 2007
Location: www.consoleworld.net
Posts: 5,556
pirata nervo is on a distinguished road
Default

Quote:
Originally Posted by Aaron*1 View Post
In the makefile for lesson #1 could someone explain to me exactly what some of the things do and the same with the main.c

In the makefile

Code:
TARGET = Donkey_Lesson1
OBJS = main.o  

INCDIR = 
CFLAGS = -G4 -Wall -O2 
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS =
STDLIBS= -losl -lpng -lz \
  -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lm
LIBS=$(STDLIBS)$(YOURLIBS)


EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Donkey_Lesson1


PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Could someone explain what all of this does?
Code:
LIBDIR =
LDFLAGS =
STDLIBS= -losl -lpng -lz \
  -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lm
LIBS=$(STDLIBS)$(YOURLIBS)
Mainly the parts before "="
LIBDIR is the .a files directory, .a files are library files. (there are other file types but you just need to know the .a, at least for now)
INCDIR is the .h files directory
These are just needed if you want to have another folder with a custom sdk (besides the one you have in pspdev/psp/sdk/)

STDLIBS is the same as LIBS I guess.
e.g. -losl is the oslib.a file. (the libraries that are used while compiling your source code)
Instead of what you have above, I would just use:
Code:
LIBS= -losl -lpng -lz \
  -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lm
Instead of:
Code:
STDLIBS= -losl -lpng -lz \
  -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lm
LIBS=$(STDLIBS)$(YOURLIBS)
I don't remember what LDFLAGS is but google is your friend.

Quote:
Originally Posted by Aaron*1 View Post

Could someone also explain
Code:
INCDIR = 
CFLAGS = -G4 -Wall -O2 
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
What this means?

I've explained what INCDIR is already.
I don't remember what CFLAGS, CXXFLAGS and ASFLAGS, I used to know when I was more into PSP programming but now, I don't

In that code ASFLAGS = CFLAGS

Quote:
Originally Posted by Aaron*1 View Post

In the main.c:
Code:
//OSlib header file
#include <oslib/oslib.h>

//callbacks
PSP_MODULE_INFO("OSLib Sample", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);

int main()
{
    //Initialization of the Oslib library
    oslInit(0);

    //Initialization of the graphics mode
    oslInitGfx(OSL_PF_8888, 0);

    //Initialization of the text console
    oslInitConsole();

    //Print on the screen this text
    oslPrintf("Hello World");

    //Wait for a button to be pressed
    oslWaitKey();
    
    //terminate the program
    oslEndGfx();
    oslQuit();
    return 0;
}

Could someone explain what the callbacks are and actually do (also what the numbers mean).
Code:
//callbacks
PSP_MODULE_INFO("OSLib Sample", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
The code above does not contain any callbacks.
PSP_MODULE_INFO just tells the compiler the module info, the module name is "OSLib Sample", flag for mode is 0 (user mode) there are other flags like 0x1000, 0x0800, 0x1006, etc.
The 3rd argument is the major version (I think it's the major)
The 4th is the minor version.

(the callbacks are used to "enable" the home button)

Quote:
Originally Posted by Aaron*1 View Post

What does the number in this mean?
Code:
//Initialization of the Oslib library
    oslInit(0);
The 0 means no flags will be used?
Instead of 0 you could have:
OSL_IF_USEOWNCALLBACKS
OSL_IF_NOVBLANKIRQ
both can be or'd together.

Take a look here for more information:
http://www.sakya.it/OSLib_MOD/doc/ht...80288ae432b488

Quote:
Originally Posted by Aaron*1 View Post

What does it mean/do when there are two brackets beside each other " () "
Means no arguments are being passed (the function doesn't need any arguments to be passed)

Quote:
Originally Posted by Aaron*1 View Post

Finally what does the bit in brackets mean/do:[/color]
Code:
//Initialization of the graphics mode
    oslInitGfx(OSL_PF_8888, 0);
I just want to get all of this cleared up before I move on because I tried moving on bu tI wanted to know how to do at least this all by myself and I can't if I don't know what everything means.
oslInitGfx() initializes the graphical part of oslib.
Its parameters are as following:
int pixelFormat, int bDoubleBuffer
in the code you posted, it initializes the pixel format with 32bits by pixels (8888) and the 0 means that it will use simple buffering.

I hope that helps.
__________________


Last edited by pirata nervo; 01-26-2009 at 05:40 PM.
Reply With Quote
  #9  
Old 01-27-2009, 04:23 PM
Aaron*1 Aaron*1 is offline
PSP Guru
 

Join Date: Jan 2008
Posts: 1,510
Aaron*1 will become famous soon enoughAaron*1 will become famous soon enough
Default

That actually helped me loads. Thanks a lot!
+rep
__________________
lol@sigs
Reply With Quote
  #10  
Old 02-10-2009, 09:07 AM
PartQual PartQual is offline
PSP Newbie
 

Join Date: Jan 2008
Posts: 32
PartQual Has a Beginner Reputation
Default Makefile CFLAGS values

I've seen comments about changing following entry in Makefile:
CFLAGS = -G4 ...

to:
CFLAGS = -G0 ...

to get stuff to compile.

Most of the other settings I can understand, or at least google, but this one I don't get and can't find.
Can anyone enlighten me on the difference between G4 and G0?

Thanks,
PQ.
Reply With Quote
Reply

 



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:19 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©