ulong get_offset(PFBDEV const pfbdev,int x,int y) { if (is_fbdev(pfbdev)) return 0; else return pfbdev->fb_mem + (get_display_depth(pfbdev) / 8) * (x + y * get_xres(pfbdev)); }
int GetSurfacePixelFormat(void) { int depth = get_display_depth(); int unit = (depth + 1) & 0xF8; return (unit == 8 ? RGBFB_CHUNKY : depth == 15 && unit == 16 ? RGBFB_R5G5B5 : depth == 16 && unit == 16 ? RGBFB_R5G6B5 : unit == 24 ? RGBFB_B8G8R8 : unit == 32 ? RGBFB_R8G8B8A8 : RGBFB_NONE); }