X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=plat.h;h=03949d6deb9f7af73802e4e26c8e883cf4495112;hb=HEAD;hp=ad26595615daa389788ff0ed78f88dd37db7dd5b;hpb=1bc471ebf1c85cf78f1862f5596a76f051e7112d;p=libpicofe.git diff --git a/plat.h b/plat.h index ad26595..8385d06 100644 --- a/plat.h +++ b/plat.h @@ -7,6 +7,30 @@ extern "C" { #endif +// platform dependend color handling +#if defined(USE_BGR555) +#define PXMAKE(r,g,b) ((((b)<<7) & 0x7c00)|(((g)<<2) & 0x03e0)|((r)>>3)) +#define PXMASKL(t,c) ((t) & (((1<<(c))-1)*0x04210421)) +#define PXMASKH(t,c) ((t) & ~(((1<<(c))-1)*0x04210421) & 0x7fff) +#define PXGETR(t) (((t) & 0x001f)<<3) +#define PXGETG(t) (((t) & 0x03e0)>>2) +#define PXGETB(t) (((t) & 0x7c00)>>7) +#elif defined(USE_BGR565) +#define PXMAKE(r,g,b) ((((b)<<8) & 0xf800)|(((g)<<3) & 0x07e0)|((r)>>3)) +#define PXMASKL(t,c) ((t) & (((1<<(c))-1)*0x08210821)) +#define PXMASKH(t,c) ((t) & ~(((1<<(c))-1)*0x08210821)) +#define PXGETR(t) (((t) & 0x001f)<<3) +#define PXGETG(t) (((t) & 0x07e0)>>3) +#define PXGETB(t) (((t) & 0xf800)>>8) +#else // RGB565 +#define PXMAKE(r,g,b) ((((r)<<8) & 0xf800)|(((g)<<3) & 0x07e0)|((b)>>3)) +#define PXMASKL(t,c) ((t) & (((1<<(c))-1)*0x08210821)) +#define PXMASKH(t,c) ((t) & ~(((1<<(c))-1)*0x08210821)) +#define PXGETR(t) (((t) & 0xf800)>>8) +#define PXGETG(t) (((t) & 0x07e0)>>3) +#define PXGETB(t) (((t) & 0x001f)<<3) +#endif + /* target device, everything is optional */ struct plat_target { int (*cpu_clock_get)(void); @@ -22,6 +46,8 @@ struct plat_target { int vout_fullscreen; const char **hwfilters; int hwfilter; + const int *sound_rates; + int sound_rate; }; extern struct plat_target plat_target; @@ -93,6 +119,7 @@ static __inline int plat_target_switch_layer(int which, int enable) } /* menu: enter (switch bpp, etc), begin/end drawing */ +void plat_video_menu_update(void); void plat_video_menu_enter(int is_rom_loaded); void plat_video_menu_begin(void); void plat_video_menu_end(void); @@ -104,6 +131,12 @@ void plat_video_wait_vsync(void); /* return the dir/ where configs, saves, bios, etc. are found */ int plat_get_root_dir(char *dst, int len); +/* return the dir/ where skin files are found */ +int plat_get_skin_dir(char *dst, int len); + +/* return the top level dir for image files */ +int plat_get_data_dir(char *dst, int len); + int plat_is_dir(const char *path); int plat_wait_event(int *fds_hnds, int count, int timeout_ms); void plat_sleep_ms(int ms);