Editing Lesson 05 - Onwards and Upwards
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 8: | Line 8: | ||
So here we go, let's start out our program. You'll need to download another zip file for this lesson. You can get it here. You'll need to make a main.c file in the same folder as the files you extract from the zip file. | So here we go, let's start out our program. You'll need to download another zip file for this lesson. You can get it here. You'll need to make a main.c file in the same folder as the files you extract from the zip file. | ||
#include <pspkernel.h> | #include <pspkernel.h> | ||
#include <pspdisplay.h> | #include <pspdisplay.h> | ||
Line 15: | Line 15: | ||
#include <psppower.h> | #include <psppower.h> | ||
#include "graphics.h" | #include "graphics.h" | ||
Assuming you have completed the previous lessons, this isn't anything you haven't seen. The only thing that should look new to you is the "psppower.h" include. This file contains the functions we will use to change the PSP's clock speed. | Assuming you have completed the previous lessons, this isn't anything you haven't seen. The only thing that should look new to you is the "psppower.h" include. This file contains the functions we will use to change the PSP's clock speed. | ||
On to some more familiar code: | On to some more familiar code: | ||
PSP_MODULE_INFO("Background Changer", 0, 1, 1); | |||
#define RGB(r, g, b) ((r)|((g)<<8)|((b)<<16)) | #define RGB(r, g, b) ((r)|((g)<<8)|((b)<<16)) | ||
Remember how in Lesson 02 we just glossed over this line without explaining what it really did? Well, I think it's time that you learn. The first parameter is your program identifier, so basically your program name. The second parameter allows you to pass attributes. For most of your programs you will just want to use a 0, but if you are making a kernel mode app, you will need to switch this to "0x1000". The third parameter is for the major version, the fourth is minor version. These are just meant to document the version number of your program. | Remember how in Lesson 02 we just glossed over this line without explaining what it really did? Well, I think it's time that you learn. The first parameter is your program identifier, so basically your program name. The second parameter allows you to pass attributes. For most of your programs you will just want to use a 0, but if you are making a kernel mode app, you will need to switch this to "0x1000". The third parameter is for the major version, the fourth is minor version. These are just meant to document the version number of your program. | ||
Now the standard callbacks: | Now the standard callbacks: | ||
/* Exit callback */ | |||
int exit_callback(int arg1, int arg2, void *common) { | int exit_callback(int arg1, int arg2, void *common) { | ||
sceKernelExitGame(); | sceKernelExitGame(); | ||
Line 54: | Line 54: | ||
return thid; | return thid; | ||
} | } | ||
==INCOMPLETE== | ==INCOMPLETE== |