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(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: Select all
#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;
}
}
Code: Select all
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