compiled sample...

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

Moderators: cheriff, TyRaNiD

Post Reply
Rangu2057
Posts: 87
Joined: Mon Jul 23, 2007 8:37 am
Location: wilmington, NC

compiled sample...

Post by Rangu2057 »

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: Select all

#ifndef debug
#define debug

#ifdef __cplusplus
extern "C" {
#endif

#include <pspdebug.h>

/*
 * Initiates the use of LBE debugger
 */
void lbeDebugScreenInit&#40;void&#41;;


/* 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&#40;char txt, int x, int y&#41;;


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


/* Sets the text color
 * 
 * @param color - 32 bit RBG color
 *
 */
int lbeDebugSetTextColor&#40;u32 color&#41;;


/* Reads a file buffer		&#40;Based off of libpsardumper&#41;
 *
 * @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	&#40;integer or offset???&#41;
 * @param siggy - checks wether file is signchecked or not
*/
int lbeDebugReadBuffer&#40;u8 *data, int Bsze, u8 *Dout, u8 *Dout2, char Fname, int *Fsze, int *Fpos&#41;;


/* Dumps all lbe filetypes and modules
 * @param *file - The file being dumped
 * @param *path - The file path
*/
int lbeDebugFileDump&#40;char *file | char *path&#41;&#58;

/* Creaates a callback thread
 * @param ID - The thread ID to create
 * @param systag - the threads identifier &#40;systag&#41;
 * @param args - The number of args allowed to pass through thread
*/
int lbeCreateCallbackThread&#40;int ID, char systag, char *arg&#91;&#93;&#41;;

/* Retruns the thread info
 * @param - Returns the thread number &#40;ID&#41;
 * @param - returns the threads identifier &#40;systag&#41;
 * @param - Returns the current stack frame summary for that thread
*/
int lbeDebugReturnCallbackThread&#40;int ID, char systag,char *stack&#91;&#93;&#41;;

/*
 * Exit the callback thread
 */
void lbeDebugExitCallbackThread&#40;&#41;;


#ifdef __cplusplus
&#125;
#endif /* __cplusplus */


#endif /* debug */

main.c

Code: Select all

#include <pspkernel.h>
#include "debug.h"

#define printf lbeDebugPrintf&#40;char txt, int x, int y&#41;

PSP_MODULE_INFO&#40;"TEST",0,1,1&#41;;

/* Exit callback */
int exit_callback&#40;int arg1, int arg2, void *common&#41;
&#123;
	sceKernelExitGame&#40;&#41;;

	return 0;
&#125;

/* Callback thread */
int CallbackThread&#40;SceSize args, void *argp&#41;
&#123;
	int cbid;

	cbid = sceKernelCreateCallback&#40;"Exit Callback", exit_callback, NULL&#41;;
	sceKernelRegisterExitCallback&#40;cbid&#41;;

	sceKernelSleepThreadCB&#40;&#41;;

	return 0;
&#125;

/* Sets up the callback thread and returns its thread id */
int SetupCallbacks&#40;void&#41;
&#123;
	int thid = 0;

	thid = sceKernelCreateThread&#40;"update_thread", CallbackThread, 0x11, 0xFA0, THREAD_ATTR_USER, 0&#41;;
	if&#40;thid >= 0&#41;
	&#123;
		sceKernelStartThread&#40;thid, 0, 0&#41;;
	&#125;

	return thid;
&#125;

int main&#40;void&#41;&#123;

SetupCallbacks&#40;&#41;;
lbeDebugScreenInit&#40;&#41;;
	while&#40;1&#41;		// 1 is equal to true
	&#123;
	lbeDebugScreenSetBackColor&#40;0x38B491&#41;;
	lbeDebugScreenPrintf&#40;"Hello World", 100, 100&#41;;	// Print text to screen
	lbeDebugScreenSetTextColor&#40;0xFF&#41;;
	&#125;
	else
	&#123;
	sceKernelExitGame&#40;&#41;;		// exit app
	return 0;
	&#125;
&#125;
makefile

Code: Select all

TARGET = hello world
OBJS = main.o

INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;

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

LIBDIR =
LDFLAGS =
LIBS = 

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/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)
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

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.
pegasus2000
Posts: 160
Joined: Wed Jul 12, 2006 7:09 am

Re: compiled sample...

Post by pegasus2000 »

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: Select all

#ifndef debug
#define debug

#ifdef __cplusplus
extern "C" &#123;
#endif

#include <pspdebug.h>

/*
 * Initiates the use of LBE debugger
 */
void lbeDebugScreenInit&#40;void&#41;;


/* 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&#40;char txt, int x, int y&#41;;


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


/* Sets the text color
 * 
 * @param color - 32 bit RBG color
 *
 */
int lbeDebugSetTextColor&#40;u32 color&#41;;


/* Reads a file buffer		&#40;Based off of libpsardumper&#41;
 *
 * @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	&#40;integer or offset???&#41;
 * @param siggy - checks wether file is signchecked or not
*/
int lbeDebugReadBuffer&#40;u8 *data, int Bsze, u8 *Dout, u8 *Dout2, char Fname, int *Fsze, int *Fpos&#41;;


/* Dumps all lbe filetypes and modules
 * @param *file - The file being dumped
 * @param *path - The file path
*/
int lbeDebugFileDump&#40;char *file | char *path&#41;&#58;

/* Creaates a callback thread
 * @param ID - The thread ID to create
 * @param systag - the threads identifier &#40;systag&#41;
 * @param args - The number of args allowed to pass through thread
*/
int lbeCreateCallbackThread&#40;int ID, char systag, char *arg&#91;&#93;&#41;;

/* Retruns the thread info
 * @param - Returns the thread number &#40;ID&#41;
 * @param - returns the threads identifier &#40;systag&#41;
 * @param - Returns the current stack frame summary for that thread
*/
int lbeDebugReturnCallbackThread&#40;int ID, char systag,char *stack&#91;&#93;&#41;;

/*
 * Exit the callback thread
 */
void lbeDebugExitCallbackThread&#40;&#41;;


#ifdef __cplusplus
&#125;
#endif /* __cplusplus */


#endif /* debug */

main.c

Code: Select all

#include <pspkernel.h>
#include "debug.h"

#define printf lbeDebugPrintf&#40;char txt, int x, int y&#41;

PSP_MODULE_INFO&#40;"TEST",0,1,1&#41;;

/* Exit callback */
int exit_callback&#40;int arg1, int arg2, void *common&#41;
&#123;
	sceKernelExitGame&#40;&#41;;

	return 0;
&#125;

/* Callback thread */
int CallbackThread&#40;SceSize args, void *argp&#41;
&#123;
	int cbid;

	cbid = sceKernelCreateCallback&#40;"Exit Callback", exit_callback, NULL&#41;;
	sceKernelRegisterExitCallback&#40;cbid&#41;;

	sceKernelSleepThreadCB&#40;&#41;;

	return 0;
&#125;

/* Sets up the callback thread and returns its thread id */
int SetupCallbacks&#40;void&#41;
&#123;
	int thid = 0;

	thid = sceKernelCreateThread&#40;"update_thread", CallbackThread, 0x11, 0xFA0, THREAD_ATTR_USER, 0&#41;;
	if&#40;thid >= 0&#41;
	&#123;
		sceKernelStartThread&#40;thid, 0, 0&#41;;
	&#125;

	return thid;
&#125;

int main&#40;void&#41;&#123;

SetupCallbacks&#40;&#41;;
lbeDebugScreenInit&#40;&#41;;
	while&#40;1&#41;		// 1 is equal to true
	&#123;
	lbeDebugScreenSetBackColor&#40;0x38B491&#41;;
	lbeDebugScreenPrintf&#40;"Hello World", 100, 100&#41;;	// Print text to screen
	lbeDebugScreenSetTextColor&#40;0xFF&#41;;
	&#125;
	else
	&#123;
	sceKernelExitGame&#40;&#41;;		// exit app
	return 0;
	&#125;
&#125;
makefile

Code: Select all

TARGET = hello world
OBJS = main.o

INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;

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

LIBDIR =
LDFLAGS =
LIBS = 

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/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
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

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)
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

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.
pegasus2000
Posts: 160
Joined: Wed Jul 12, 2006 7:09 am

Post by pegasus2000 »

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.
pegasus2000
Posts: 160
Joined: Wed Jul 12, 2006 7:09 am

Post by pegasus2000 »

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?).
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

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.
Rangu2057
Posts: 87
Joined: Mon Jul 23, 2007 8:37 am
Location: wilmington, NC

Post by Rangu2057 »

@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 = [email protected] (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)
Post Reply