Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***************************************************************************
- * Copyright (C) 2008 by Geecko *
- * *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
- #include <pspkernel.h>
- #include <pspdebug.h>
- #include <oslib/oslib.h>
- PSP_MODULE_INFO("Hello World", 0, 1, 1);
- PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
- #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() {
- pspDebugScreenInit();
- SetupCallbacks();
- printf("Hello World !\n\nBy Geecko");
- sceKernelSleepThread();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement