public static void Blit(RETRO_PIXEL_FORMAT pixelFormat, IntPtr src, IntPtr dst, int width, int height, int srcPitch, int dstPitch)
        {
            switch (pixelFormat)
            {
            case RETRO_PIXEL_FORMAT.XRGB8888:
                Blit888((int *)src, (int *)dst, width, height, srcPitch / 4, dstPitch / 4);
                break;

            case RETRO_PIXEL_FORMAT.RGB565:
                Blit565((short *)src, (int *)dst, width, height, srcPitch / 2, dstPitch / 4);
                break;

            case RETRO_PIXEL_FORMAT.XRGB1555:
                Blit555((short *)src, (int *)dst, width, height, srcPitch / 2, dstPitch / 4);
                break;
            }
        }
        protected bool SetPixelFormat(IntPtr data)
        {
            RETRO_PIXEL_FORMAT format = (RETRO_PIXEL_FORMAT)Marshal.ReadInt32(data);

            switch (format)
            {
            case RETRO_PIXEL_FORMAT.RGB565:
            case RETRO_PIXEL_FORMAT.XRGB1555:
            case RETRO_PIXEL_FORMAT.XRGB8888:
                _pixelFormat = format;
                _videoOutput?.SetPixelFormat(format);
                Log(RETRO_LOG_LEVEL.DEBUG, "New pixel format set: {0}", _pixelFormat);
                return(true);

            default:
                Log(RETRO_LOG_LEVEL.DEBUG, "Unrecognized pixel format: {0}", (int)format);
                return(false);
            }
        }
 public static void Blit(RETRO_PIXEL_FORMAT pixelFormat, IntPtr src, int[] dst, int width, int height, int srcPitch, int dstPitch)
 {
     fixed(int *i = &dst[0])
     Blit(pixelFormat, src, (IntPtr)i, width, height, srcPitch, dstPitch);
 }
 public void SetPixelFormat(RETRO_PIXEL_FORMAT pixelFormat)
 {
     _pixelFormat = pixelFormat;
 }