#ifndef __PSP_H__
#define __PSP_H__

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#define    LINESIZE        512
#define    PIXELSIZE       1
#define FRAMESIZE                          0x44000
#define SCREEN_WIDTH  480
#define SCREEN_HEIGHT 272

unsigned long new_pad;
unsigned long old_pad;
unsigned long now_pad;
static SceCtrlData ctl;

enum { 
    TYPE_DIR=0x10, 
    TYPE_FILE=0x20 
};
 
typedef struct dirent { 
    unsigned long unk0; 
    unsigned long type; 
    unsigned long size; 
    unsigned long unk[19]; 
    char name[0x108]; 
	unsigned char dmy[128];
} dirent_t;

void pgWaitV();
unsigned short rgb2col(unsigned char r,unsigned char g,unsigned char b);
void Get_DirList(char *path);
char *pgGetVramAddr(unsigned long x,unsigned long y);
void Draw_All(void);
void pgFillvram(unsigned long color);
int Control(void);
void Read_Key2();
void pgScreenFlip();
void pgScreenFlipV();
unsigned short num2elisa(unsigned short c);
void Draw_Char_Hankaku(int x,int y,unsigned char ch,int col,int backcol,int fill);
void Draw_Char_Zenkaku(int x,int y,unsigned char u,unsigned char d,int col,int backcol,int fill);
void mh_print(int x,int y,unsigned char *str,int col,int backcol,int fill);
void pgInit();
void pgScreenFrame(long mode,long frame);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* __PSP_H__ */
