ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Hello World on PSP
    Programming 2008. 11. 3. 20:00
    반응형

    Recentely, I am interesting in PSP CFW(Playstation Portable Custom FirmWare)
    So I tried to make homebrew for PSP.

    I was going to google to find PSP SDK (Software Developer Kit) and finally, I found it.
    If you who read this post need it, go to http://sourceforge.net/project/showfiles.php?group_id=114505


    To execute "Hello World" Program in PSP, you need a source code as follow.

    -------------------------------------------------------------------------------

    #include <pspkernel.h>
    #include <pspdebug.h>

    #define TRUE 1
    #define FALSE 0
    #define printf pspDebugScreenPrintf

    PSP_MODULE_INFO("Xeriars", 0, 1, 1);
    PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);

    int g_bExit = FALSE;

    int ExitcallBack(int arg1, int arg2, void *common);

    int main (int argc, char *argv[]) {
     int cbid; // Callback ID

     pspDebugScreenInit();

     cbid = sceKernelCreateCallback("Exit Callback", ExitCallBack, NULL);
     sceKernelRegisterExitCallback(cbid);

     printf("Hello World\n"); // LCD Display

     while(g_bExit == FALSE);
     sceKernelExitGame();
     return 0;
    }

    int ExitcallBack(int arg1, int arg2, void *common) {
     printf("%x %x", arg1, arg2);
     g_bExit = TRUE;
     return 0;
    }

    -------------------------------------------------------------------------------

    And you must compile it to get EBOOT.PBP
    EBOOT.PBP is equivalent *.EXE on Windows OS. It will be executed in PSP
    First, save(=overide) it at C:\devkitPro\devkitPSP\psp\sdk\samples\template\elf_template\main.c

    Second, we are readied for compile. Click the Button Start -> Run -> cmd.exe
    and type a command as follow

    -------------------------------------------------------------------------------
    cd\
    cd devkitPro\devkitPSP\psp\sdk\samples\template\elf_template
    make
    -------------------------------------------------------------------------------
    If you are setted nomally, you will get a EBOOT.PBP
    At Last, Copy your EBOOT.PBP at ms0:/psp/game/test and run in PSP


    Congratulation. lol

    반응형

    댓글 0

Copyright 2006-2021. Xeriars.com All rights reserved .