if i want to buy a text to study how to programming this graphics engine, can i just buy a opengl book?
thx.
whats the psp sdk graphics api like
Hi binch, since pspgl have been ported to the psp, and that pspgu functions seems similars (i'm not a guru coder but it seems), i think it could be a good idea yes. You can also take a look at the nice nehe opengl tutorials online that helped me on a few things :
http://nehe.gamedev.net/
And you can find some of them ported to the psp here :
http://edorul.free.fr/psp/NeheTutorials1-10_v0.1.rar
http://edorul.free.fr/psp/NeheTutorials11-20.rar
http://nehe.gamedev.net/
And you can find some of them ported to the psp here :
http://edorul.free.fr/psp/NeheTutorials1-10_v0.1.rar
http://edorul.free.fr/psp/NeheTutorials11-20.rar
Thanks.Cpasjuste wrote:Hi binch, since pspgl have been ported to the psp, and that pspgu functions seems similars (i'm not a guru coder but it seems), i think it could be a good idea yes. You can also take a look at the nice nehe opengl tutorials online that helped me on a few things :
http://nehe.gamedev.net/
And you can find some of them ported to the psp here :
http://edorul.free.fr/psp/NeheTutorials1-10_v0.1.rar
http://edorul.free.fr/psp/NeheTutorials11-20.rar
I am not a graphics programmer(actually an experienced wireless/kernel developer). I wrote a simple program but cause the PSP crash, whats wrong with my code? I just want to periodically flash a part of screen black and white, is the VRAM can't be directly accessed?
Thanks again!
Bin
Code: Select all
#include <pspkernel.h>
#include <pspctrl.h>
#include <pspdebug.h>
#include <pspdisplay.h>
#include <string.h>
PSP_MODULE_INFO("Test by Chen Bin", 0, 1, 1);
#define printf pspDebugScreenPrintf
/* 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, 0, 0);
if(thid >= 0)
{
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
int main(void)
{
SceCtrlData pad_data;
pspDebugScreenSetBackColor(0xFFFFFFFF);
pspDebugScreenSetTextColor(0);
pspDebugScreenInit();
SetupCallbacks();
sceCtrlSetSamplingCycle(0);
sceCtrlSetSamplingMode(1);
sceCtrlReadBufferPositive(&pad_data, 1);
int i;
int j;
char **fp = sceGuSwapBuffers();
while (1) {
for (i = 0;i < 100;i++) {
for (j = 0;j < 100;j++) {
fp[j][i] = 0xFF;
}
}
fp = sceGuSwapBuffers();
sleep(1);
for (i = 0;i < 100;i++) {
for (j = 0;j < 100;j++) {
fp[j][i] = 0x00;
}
}
}
sceKernelExitDeleteThread(0);
return 0;
}
First, you do no initialization of the GU system at all, so calling sceGuSwapBuffers() will have undefined behaviour. Look at the PSPSDK samples how to start the GU library. If you don't want to use that library, use the proper methods in pspdisplay to flip buffers instead.
Second, you do no yielding of the task in your while (1)-loop, which means the PSP watchdog will kill your thread in 10 seconds.
Third, This will turn into a pointer to an array of pointers, which is not what you want, since it will try to read a pointer from VRAM, and then use that one and write to whatever it might point to. Access it using the datatype depending on what graphics format you've setup (like u16* or u32*).
Second, you do no yielding of the task in your while (1)-loop, which means the PSP watchdog will kill your thread in 10 seconds.
Third,
Code: Select all
char **fp = sceGuSwapBuffers();
GE Dominator
-
- Posts: 376
- Joined: Wed May 10, 2006 11:31 pm