Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //ModuleChecker test3 SourceCode
- //Zooner氏、Dadrfy氏、Akubi氏からソースを頂きました、ありがとうございます。
- //SnyFbSx氏、J416氏に感謝します。
- #include <pspkernel.h>
- #include <pspdebug.h>
- #include <pspctrl.h>
- PSP_MODULE_INFO("ModuleChecker test3", 0, 1, 1);
- PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER);
- #define printf pspDebugScreenPrintf
- char FILE_PATH[300] = "flash0:/vsh/etc/version.txt";
- int FileCheack(const char *filename)
- {
- SceIoStat stat;
- return sceIoGetstat(filename, &stat);
- }
- typedef struct {
- char* mod_name;
- char* model;
- }hoge_t;
- hoge_t hoge[] = {
- { "flash0:/vsh/etc/index_01g.dat", "01g" },
- { "flash0:/vsh/etc/index_02g.dat", "02g" },
- { "flash0:/vsh/etc/index_03g.dat", "03g" },
- { "flash0:/vsh/etc/index_04g.dat", "04g" },
- { "flash0:/vsh/etc/index_05g.dat", "05g" },
- { "flash0:/vsh/etc/index_07g.dat", "07g" },
- { "flash0:/vsh/etc/index_09g.dat", "09g" },
- { "flash0:/vsh/etc/index_11g.dat", "11g" },
- };
- int main(void)
- {
- pspDebugScreenInit();
- pspDebugScreenPrintf("ModuleChecker test3 by volotax.¥n¥n");
- char buffer[200] = "";
- SceUID fd = sceIoOpen( FILE_PATH, PSP_O_RDONLY, 0777);
- int nRead = sceIoRead( fd, buffer, 200 );
- buffer[nRead] = '¥0';
- printf( buffer );
- printf("¥n¥n");
- int i;
- for(i=0; i < 7; i++) {
- if( FileCheack( hoge[i].mod_name ) >= 0) {
- printf("Your PSP is %s.", hoge[i].model);
- goto end;
- }
- }
- printf("Unknown Module.");
- end:
- printf("¥n");
- printf("Press X to exit.¥n");
- SceCtrlData pad;
- while(1){
- sceCtrlReadBufferPositive(&pad,1);
- if( pad.Buttons & PSP_CTRL_CROSS ){
- break;
- }
- }
- sceKernelExitGame();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement