forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

compiled sample...

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Rangu2057



Joined: 23 Jul 2007
Posts: 87
Location: wilmington, NC

PostPosted: Thu Apr 24, 2008 4:50 am    Post subject: compiled sample... Reply with quote

Im currently working on a 2d game engine atm, i am trying to have it made so that i don't have to use the psp GU. Heres a little custom hello world i written. I used some of the headers from pspdebug.h and others, that i plan to implement into the credits of my game.

but since im at school i cant compile it right now, but i would like to know if it works, so could someone please compile this for me if possible and let me know what the results are? :)


debug.h
Code:
#ifndef debug
#define debug

#ifdef __cplusplus
extern "C" {
#endif

#include <pspdebug.h>

/*
 * Initiates the use of LBE debugger
 */
void lbeDebugScreenInit(void);


/* Prints text to the screen
 * @param txt - text to print to the screen
 * @param x - The x-coord
 * @param y - The y-coord
 */
void lbeDebugScreenPrintf(char txt, int x, int y);


/* Sets the background color
 * @note - you must call pspDebugScreenClear to reset screens bg colors
 *
 * @param color - 32 bit RBG color
 *
 */
int lbeDebugSetBackColor(u32 color);


/* Sets the text color
 *
 * @param color - 32 bit RBG color
 *
 */
int lbeDebugSetTextColor(u32 color);


/* Reads a file buffer      (Based off of libpsardumper)
 *
 * @param data - The buffer with data
 * @param Bsze - The size of the file buffer
 * @param Dout - The buffer needed for temporal internal use
 * @param Dout2 - The buffer that receives file data
 * @param Fname - The buffer that receives the file name
 * @param Fsze - Points to an integer that returns the file size
 * @param Fpos - Points to an integer that returns the file position   (integer or offset???)
 * @param siggy - checks wether file is signchecked or not
*/
int lbeDebugReadBuffer(u8 *data, int Bsze, u8 *Dout, u8 *Dout2, char Fname, int *Fsze, int *Fpos);


/* Dumps all lbe filetypes and modules
 * @param *file - The file being dumped
 * @param *path - The file path
*/
int lbeDebugFileDump(char *file | char *path):

/* Creaates a callback thread
 * @param ID - The thread ID to create
 * @param systag - the threads identifier (systag)
 * @param args - The number of args allowed to pass through thread
*/
int lbeCreateCallbackThread(int ID, char systag, char *arg[]);

/* Retruns the thread info
 * @param - Returns the thread number (ID)
 * @param - returns the threads identifier (systag)
 * @param - Returns the current stack frame summary for that thread
*/
int lbeDebugReturnCallbackThread(int ID, char systag,char *stack[]);

/*
 * Exit the callback thread
 */
void lbeDebugExitCallbackThread();


#ifdef __cplusplus
}
#endif /* __cplusplus */


#endif /* debug */



main.c
Code:
#include <pspkernel.h>
#include "debug.h"

#define printf lbeDebugPrintf(char txt, int x, int y)

PSP_MODULE_INFO("TEST",0,1,1);

/* Exit callback */
int exit_callback(int arg1, int arg2, void *common)
{
   sceKernelExitGame();

   return 0;
}

/* Callback thread */
int CallbackThread(SceSize args, void *argp)
{
   int cbid;

   cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
   sceKernelRegisterExitCallback(cbid);

   sceKernelSleepThreadCB();

   return 0;
}

/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void)
{
   int thid = 0;

   thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, THREAD_ATTR_USER, 0);
   if(thid >= 0)
   {
      sceKernelStartThread(thid, 0, 0);
   }

   return thid;
}

int main(void){

SetupCallbacks();
lbeDebugScreenInit();
   while(1)      // 1 is equal to true
   {
   lbeDebugScreenSetBackColor(0x38B491);
   lbeDebugScreenPrintf("Hello World", 100, 100);   // Print text to screen
   lbeDebugScreenSetTextColor(0xFF);
   }
   else
   {
   sceKernelExitGame();      // exit app
   return 0;
   }
}


makefile
Code:
TARGET = hello world
OBJS = main.o

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

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = hello world
PSP_EBOOT_ICON = icon0.png
#PSP_EBOOT_PIC1 = pic1.png

LIBDIR =
LDFLAGS =
LIBS =

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak


im pretty sure i haven't made any mistakes in my code, but im not sure so if you find any that i missed let me know, oh and please don't flame me as im sure people on this forum are supposed to be mature :)
_________________
the questions of today are awnswered by the blood and bullets of tomorrow! ---EagleEye--- (Socom FTB2)
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Thu Apr 24, 2008 6:13 am    Post subject: Reply with quote

Please, stick to the subject matter of this board -- specific PSP development-related questions and discussion. "Compile my code for me" is not a good use of anyone's time here.
Back to top
View user's profile Send private message
pegasus2000



Joined: 12 Jul 2006
Posts: 160

PostPosted: Sun Apr 27, 2008 7:37 am    Post subject: Re: compiled sample... Reply with quote

Rangu2057 wrote:
Im currently working on a 2d game engine atm, i am trying to have it made so that i don't have to use the psp GU. Heres a little custom hello world i written. I used some of the headers from pspdebug.h and others, that i plan to implement into the credits of my game.

but since im at school i cant compile it right now, but i would like to know if it works, so could someone please compile this for me if possible and let me know what the results are? :)


debug.h
Code:
#ifndef debug
#define debug

#ifdef __cplusplus
extern "C" {
#endif

#include <pspdebug.h>

/*
 * Initiates the use of LBE debugger
 */
void lbeDebugScreenInit(void);


/* Prints text to the screen
 * @param txt - text to print to the screen
 * @param x - The x-coord
 * @param y - The y-coord
 */
void lbeDebugScreenPrintf(char txt, int x, int y);


/* Sets the background color
 * @note - you must call pspDebugScreenClear to reset screens bg colors
 *
 * @param color - 32 bit RBG color
 *
 */
int lbeDebugSetBackColor(u32 color);


/* Sets the text color
 *
 * @param color - 32 bit RBG color
 *
 */
int lbeDebugSetTextColor(u32 color);


/* Reads a file buffer      (Based off of libpsardumper)
 *
 * @param data - The buffer with data
 * @param Bsze - The size of the file buffer
 * @param Dout - The buffer needed for temporal internal use
 * @param Dout2 - The buffer that receives file data
 * @param Fname - The buffer that receives the file name
 * @param Fsze - Points to an integer that returns the file size
 * @param Fpos - Points to an integer that returns the file position   (integer or offset???)
 * @param siggy - checks wether file is signchecked or not
*/
int lbeDebugReadBuffer(u8 *data, int Bsze, u8 *Dout, u8 *Dout2, char Fname, int *Fsze, int *Fpos);


/* Dumps all lbe filetypes and modules
 * @param *file - The file being dumped
 * @param *path - The file path
*/
int lbeDebugFileDump(char *file | char *path):

/* Creaates a callback thread
 * @param ID - The thread ID to create
 * @param systag - the threads identifier (systag)
 * @param args - The number of args allowed to pass through thread
*/
int lbeCreateCallbackThread(int ID, char systag, char *arg[]);

/* Retruns the thread info
 * @param - Returns the thread number (ID)
 * @param - returns the threads identifier (systag)
 * @param - Returns the current stack frame summary for that thread
*/
int lbeDebugReturnCallbackThread(int ID, char systag,char *stack[]);

/*
 * Exit the callback thread
 */
void lbeDebugExitCallbackThread();


#ifdef __cplusplus
}
#endif /* __cplusplus */


#endif /* debug */



main.c
Code:
#include <pspkernel.h>
#include "debug.h"

#define printf lbeDebugPrintf(char txt, int x, int y)

PSP_MODULE_INFO("TEST",0,1,1);

/* Exit callback */
int exit_callback(int arg1, int arg2, void *common)
{
   sceKernelExitGame();

   return 0;
}

/* Callback thread */
int CallbackThread(SceSize args, void *argp)
{
   int cbid;

   cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
   sceKernelRegisterExitCallback(cbid);

   sceKernelSleepThreadCB();

   return 0;
}

/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void)
{
   int thid = 0;

   thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, THREAD_ATTR_USER, 0);
   if(thid >= 0)
   {
      sceKernelStartThread(thid, 0, 0);
   }

   return thid;
}

int main(void){

SetupCallbacks();
lbeDebugScreenInit();
   while(1)      // 1 is equal to true
   {
   lbeDebugScreenSetBackColor(0x38B491);
   lbeDebugScreenPrintf("Hello World", 100, 100);   // Print text to screen
   lbeDebugScreenSetTextColor(0xFF);
   }
   else
   {
   sceKernelExitGame();      // exit app
   return 0;
   }
}


makefile
Code:
TARGET = hello world
OBJS = main.o

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

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = hello world
PSP_EBOOT_ICON = icon0.png
#PSP_EBOOT_PIC1 = pic1.png

LIBDIR =
LDFLAGS =
LIBS =

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak


im pretty sure i haven't made any mistakes in my code, but im not sure so if you find any that i missed let me know, oh and please don't flame me as im sure people on this forum are supposed to be mature :)



Rangu, forgive my open words....

I don't understand what you are doing. If you'd use Nanodesktop,
you'd have routines for accessing to graphics with few rows of
code, an IDE as Dev-C++, a working emulator for PC etc.

And the compatibility with ANSI C. So, I sustain this: if you want
to develop a game engine, it's better to develop it under nd and
not under PSPSDK. I say you this because our interest (my and
of my users), is to transform nd also in a game platform. For
us, it would be very interesting to have a new game engine.

In effect, there are already some libraries (for instance, SDL library)
that provide a game engine, and with very much compatible
software, so it seems better to port one of these under nd and
not to design a new engine from scratch.

Yesterday, I wanted to talk with you, about the possibility to develop
your work under nd, because in this way my platform will become
more flexible and your work will be easier.

Bye
Filippo
Back to top
View user's profile Send private message
jean



Joined: 05 Jan 2008
Posts: 489

PostPosted: Tue Apr 29, 2008 1:24 am    Post subject: Reply with quote

Pegasus, i think you shouldn't continue saying nd is the best piece of software in the world above all the others. Please stop it: i see you did a great work, but you can't take every excuse to tell everybody to pass to nd, forgetting all the people contributing to pspsdk (contributes that surely helped you in your development)
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Tue Apr 29, 2008 6:56 am    Post subject: Reply with quote

Damn skippy! Especially since nd uses your own Windows-only toolchain. Until you get it worked out in linux, it's not even in the top ten of PSP stuff.
Back to top
View user's profile Send private message AIM Address
pegasus2000



Joined: 12 Jul 2006
Posts: 160

PostPosted: Wed Apr 30, 2008 1:48 am    Post subject: Reply with quote

jean wrote:
Pegasus, i think you shouldn't continue saying nd is the best piece of software in the world above all the others. Please stop it: i see you did a great work, but you can't take every excuse to tell everybody to pass to nd, forgetting all the people contributing to pspsdk (contributes that surely helped you in your development)


You have missed my point. I have no intention to create problems to
the PSPSDK users . And, I ensure you, I don't want, ABSOLUTELY, to steal
users of PSPSDK for Nanodesktop. I have never said the "nd is the
best piece of software in the world". Nd is a software with good
things, and limitations. My idea, when I started this project, was to
create a community of programmers around it.

I'd like if some programmers add the functionalities that they
retain useful and that are missing. My target is to create a community,
not to fight again PSPSDK. And, in fact, nd uses PSPSDK at lower
level, so the thing would be lack of sense. Without the work of PSPSDK
programmers, nd would be never born.

In this particular case, Rangu said the he is working on a 2d
library. My team in Italy is approaching to start a similar
tecnology in July so I thought to propose him to work with
my team. Some of the functionalities that Rangu is implementing,
are already implement in a way that is substially identical.

And, if you note it, nobody helps him with his trouble. So, I thought
to propose him to write his library in nd, because it would be
easier. This is all.

I didn't want to create problems. Sorry.
Back to top
View user's profile Send private message
pegasus2000



Joined: 12 Jul 2006
Posts: 160

PostPosted: Wed Apr 30, 2008 1:52 am    Post subject: Reply with quote

J.F. wrote:
Damn skippy! Especially since nd uses your own Windows-only toolchain. Until you get it worked out in linux, it's not even in the top ten of PSP stuff.


As I said, I was very glad if some programmers add the
features that they retain more useful.

I cannot do all alone. The compatibility with Linux will arrive when
the thing will become necessary (why don't you help me?).
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Wed Apr 30, 2008 5:23 am    Post subject: Reply with quote

pegasus2000 wrote:
J.F. wrote:
Damn skippy! Especially since nd uses your own Windows-only toolchain. Until you get it worked out in linux, it's not even in the top ten of PSP stuff.


As I said, I was very glad if some programmers add the
features that they retain more useful.

I cannot do all alone. The compatibility with Linux will arrive when
the thing will become necessary (why don't you help me?).


I already mentioned two things you do that you need to quit doing: quit relying on case insensitivity, and quit using Windows-only paths. I think there are some other more subtle things going on, but don't really have the time to look into it.
Back to top
View user's profile Send private message AIM Address
Rangu2057



Joined: 23 Jul 2007
Posts: 87
Location: wilmington, NC

PostPosted: Fri May 02, 2008 4:21 pm    Post subject: Reply with quote

@pegasus -> Sure, i'd be glad to help out with nanodesktop, it seems interesting, and i think its about time i started deving with something new for a change (no offense to the PSPSDK users)

Also i finally got myself an MSN account setup, as iv'e had computer problems lately (hardware wise), so i had to wait for my next paycheck to buy one, and yeah they really know how to burn holes in your wallet :(

MSN = conman20572057@msn.com (i accidently did the 2057 part twice)

one more thing you should know to, i do have the skills to code, its just that i end up jumping the gun without thinking things through, but in the end i get the job done :P
_________________
the questions of today are awnswered by the blood and bullets of tomorrow! ---EagleEye--- (Socom FTB2)
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group