Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <psp2/kernel/processmgr.h>
- #include <psp2/ctrl.h>
- #include <stdio.h>
- #include <glib.h>
- #include "debugScreen.h"
- #define printf psvDebugScreenPrintf
- void waitPressCircle()
- {
- SceCtrlData pad;
- printf(" >>>Press CIRCLE ...");
- while (1)
- {
- memset(&pad, 0, sizeof(pad));
- sceCtrlPeekBufferPositive(0, &pad, 1);
- if (pad.buttons & SCE_CTRL_CIRCLE)
- break;
- }
- printf("And release it to continue\n");
- while (1)
- {
- memset(&pad, 0, sizeof(pad));
- sceCtrlPeekBufferPositive(0, &pad, 1);
- if ((pad.buttons & SCE_CTRL_CIRCLE) == 0)
- break;
- }
- }
- void etListDir(const char* dirPath){
- GDir *hdir=g_dir_open(dirPath,0,NULL);
- if(hdir==NULL){
- printf("FAIL!");
- }else{
- printf("OPED! Ready to list!");
- waitPressCircle();
- const char* dname=NULL;
- int len=0;
- do{
- dname=g_dir_read_name(hdir);
- len=strlen(dname);
- if(len)
- printf(" - %s \n",dname);
- }while(len);
- printf("END of list!\n");
- printf("Closing dir handle\n");
- g_dir_close(hdir);
- printf("CLOSED dir handle");
- }
- waitPressCircle();
- }
- int main(int argc, char *argv[]) {
- int ret;
- psvDebugScreenInit();
- printf("Welcome to the psvDebug eglib test !\n");
- const char* dirPath="/";
- printf("0) dir open and list %s ",dirPath); waitPressCircle();
- etListDir(dirPath);
- dirPath="ux0:/";
- printf("1) dir open and list %s ",dirPath); waitPressCircle();
- etListDir(dirPath);
- dirPath="ux0:/_z_eglib/test2/dir/";
- printf("3) dir create %s ",dirPath); waitPressCircle();
- ret=g_mkdir_with_parents(dirPath,0777);
- if(ret==-1)
- printf("FAIL!");
- else
- printf("SUCC!");
- printf("\n\n End of test. ");
- waitPressCircle();
- sceKernelExitProcess(0);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement