diff options
Diffstat (limited to 'src/osd/modules/render/blit13.h')
-rw-r--r-- | src/osd/modules/render/blit13.h | 122 |
1 files changed, 61 insertions, 61 deletions
diff --git a/src/osd/modules/render/blit13.h b/src/osd/modules/render/blit13.h index 33daf3c5ead..f3dcea9bf0d 100644 --- a/src/osd/modules/render/blit13.h +++ b/src/osd/modules/render/blit13.h @@ -5,12 +5,12 @@ // INLINE //============================================================ -inline UINT32 premult32(const UINT32 pixel) +inline uint32_t premult32(const uint32_t pixel) { - const UINT16 a = (pixel >> 24) & 0xff; - const UINT16 r = (pixel >> 16) & 0xff; - const UINT16 g = (pixel >> 8) & 0xff; - const UINT16 b = (pixel >> 0) & 0xff; + const uint16_t a = (pixel >> 24) & 0xff; + const uint16_t r = (pixel >> 16) & 0xff; + const uint16_t g = (pixel >> 8) & 0xff; + const uint16_t b = (pixel >> 0) & 0xff; return 0xFF000000 | ((r * a) / 255) << 16 | @@ -18,30 +18,30 @@ inline UINT32 premult32(const UINT32 pixel) ((b * a) / 255); } -inline UINT32 CLUL(const UINT32 x) +inline uint32_t CLUL(const uint32_t x) { - return ((INT32) x < 0) ? 0 : ((x > 65535) ? 255 : x >> 8); + return ((int32_t) x < 0) ? 0 : ((x > 65535) ? 255 : x >> 8); } -inline UINT32 ycc_to_rgb(const UINT8 y, const UINT8 cb, const UINT8 cr) +inline uint32_t ycc_to_rgb(const uint8_t y, const uint8_t cb, const uint8_t cr) { - const UINT32 common = 298 * y - 56992; - const UINT32 r = (common + 409 * cr); - const UINT32 g = (common - 100 * cb - 208 * cr + 91776); - const UINT32 b = (common + 516 * cb - 13696); + const uint32_t common = 298 * y - 56992; + const uint32_t r = (common + 409 * cr); + const uint32_t g = (common - 100 * cb - 208 * cr + 91776); + const uint32_t b = (common + 516 * cb - 13696); return 0xff000000 | (CLUL(r)<<16) | (CLUL(g)<<8) | (CLUL(b)); } -inline UINT32 pixel_ycc_to_rgb(const UINT16 *pixel) +inline uint32_t pixel_ycc_to_rgb(const uint16_t *pixel) { - const UINT32 p = *(UINT32 *)((uintptr_t) pixel & ~3); + const uint32_t p = *(uint32_t *)((uintptr_t) pixel & ~3); return ycc_to_rgb((*pixel >> 8) & 0xff, (p) & 0xff, (p>>16) & 0xff); } -inline UINT32 pixel_ycc_to_rgb_pal(const UINT16 *pixel, const rgb_t *palette) +inline uint32_t pixel_ycc_to_rgb_pal(const uint16_t *pixel, const rgb_t *palette) { - const UINT32 p = *(UINT32 *)((uintptr_t) pixel & ~3); + const uint32_t p = *(uint32_t *)((uintptr_t) pixel & ~3); return ycc_to_rgb(palette[(*pixel >> 8) & 0xff], (p) & 0xff, (p>>16) & 0xff); } @@ -104,12 +104,12 @@ FUNCTOR(op_yuv16pal_yuy2, ((src<<8)&0xff00ff00);) FUNCTOR(op_yuv16_argb32, - return (UINT64) ycc_to_rgb((src >> 8) & 0xff, src & 0xff , (src>>16) & 0xff) - | ((UINT64)ycc_to_rgb((src >> 24) & 0xff, src & 0xff , (src>>16) & 0xff) << 32); ) + return (uint64_t) ycc_to_rgb((src >> 8) & 0xff, src & 0xff , (src>>16) & 0xff) + | ((uint64_t)ycc_to_rgb((src >> 24) & 0xff, src & 0xff , (src>>16) & 0xff) << 32); ) FUNCTOR(op_yuv16pal_argb32, - return (UINT64)ycc_to_rgb(palbase[(src >> 8) & 0xff], src & 0xff , (src>>16) & 0xff) - | ((UINT64)ycc_to_rgb(palbase[(src >> 24) & 0xff], src & 0xff , (src>>16) & 0xff) << 32);) + return (uint64_t)ycc_to_rgb(palbase[(src >> 8) & 0xff], src & 0xff , (src>>16) & 0xff) + | ((uint64_t)ycc_to_rgb(palbase[(src >> 24) & 0xff], src & 0xff , (src>>16) & 0xff) << 32);) FUNCTOR(op_yuv16_argb32rot, return pixel_ycc_to_rgb(&src) ; ) @@ -142,7 +142,7 @@ struct blit_texcopy : public blit_base /* loop over Y */ for (y = 0; y < texsource->height; y++) { _src_type *src = (_src_type *)texsource->base + y * texsource->rowpixels / (_len_div); - _dest_type *dst = (_dest_type *)((UINT8 *)texture->m_pixels + y * texture->m_pitch); + _dest_type *dst = (_dest_type *)((uint8_t *)texture->m_pixels + y * texture->m_pitch); x = texsource->width / (_len_div); while (x > 0) { *dst++ = m_op.op(*src, palbase); @@ -171,9 +171,9 @@ struct blit_texrot : public blit_base int dvdx = setup->dvdx; /* loop over Y */ for (y = 0; y < setup->rotheight; y++) { - INT32 curu = setup->startu + y * setup->dudy; - INT32 curv = setup->startv + y * setup->dvdy; - _dest_type *dst = (_dest_type *)((UINT8 *)texture->m_pixels + y * texture->m_pitch); + int32_t curu = setup->startu + y * setup->dudy; + int32_t curv = setup->startv + y * setup->dvdy; + _dest_type *dst = (_dest_type *)((uint8_t *)texture->m_pixels + y * texture->m_pitch); x = setup->rotwidth; while (x>0) { _src_type *src = (_src_type *) texsource->base + (curv >> 16) * texsource->rowpixels + (curu >> 16); @@ -204,55 +204,55 @@ struct blit_texpass : public blit_base const struct blit_texpass<b, c> texcopy_ ## a; -TEXCOPYA(rgb32_argb32, UINT32, UINT32, 1) -TEXCOPYP(rgb32_rgb32, UINT32, UINT32) +TEXCOPYA(rgb32_argb32, uint32_t, uint32_t, 1) +TEXCOPYP(rgb32_rgb32, uint32_t, uint32_t) -TEXCOPYA(rgb32pal_argb32, UINT32, UINT32, 1) -TEXCOPYA(pal16_argb32, UINT16, UINT32, 1) -TEXCOPYA(pal16a_argb32, UINT16, UINT32, 1) -TEXCOPYA(rgb15_argb32, UINT16, UINT32, 1) -TEXCOPYA(rgb15pal_argb32, UINT16, UINT32, 1) +TEXCOPYA(rgb32pal_argb32, uint32_t, uint32_t, 1) +TEXCOPYA(pal16_argb32, uint16_t, uint32_t, 1) +TEXCOPYA(pal16a_argb32, uint16_t, uint32_t, 1) +TEXCOPYA(rgb15_argb32, uint16_t, uint32_t, 1) +TEXCOPYA(rgb15pal_argb32, uint16_t, uint32_t, 1) -TEXCOPYA(pal16_argb1555, UINT16, UINT16, 1) -TEXCOPYA(rgb15_argb1555, UINT16, UINT16, 1) -TEXCOPYA(rgb15pal_argb1555, UINT16, UINT16, 1) +TEXCOPYA(pal16_argb1555, uint16_t, uint16_t, 1) +TEXCOPYA(rgb15_argb1555, uint16_t, uint16_t, 1) +TEXCOPYA(rgb15pal_argb1555, uint16_t, uint16_t, 1) -TEXCOPYP(argb32_argb32, UINT32, UINT32) -TEXCOPYA(argb32_rgb32, UINT32, UINT32, 1) -TEXCOPYA(pal16a_rgb32, UINT16, UINT32, 1) +TEXCOPYP(argb32_argb32, uint32_t, uint32_t) +TEXCOPYA(argb32_rgb32, uint32_t, uint32_t, 1) +TEXCOPYA(pal16a_rgb32, uint16_t, uint32_t, 1) -TEXCOPYA(yuv16_argb32, UINT32, UINT64, 2) -TEXCOPYA(yuv16pal_argb32, UINT32, UINT64, 2) +TEXCOPYA(yuv16_argb32, uint32_t, uint64_t, 2) +TEXCOPYA(yuv16pal_argb32, uint32_t, uint64_t, 2) -TEXCOPYP(yuv16_uyvy, UINT16, UINT16) -TEXCOPYP(rgb15_rgb555, UINT16, UINT16) +TEXCOPYP(yuv16_uyvy, uint16_t, uint16_t) +TEXCOPYP(rgb15_rgb555, uint16_t, uint16_t) -TEXCOPYA(yuv16pal_uyvy, UINT16, UINT16, 1) +TEXCOPYA(yuv16pal_uyvy, uint16_t, uint16_t, 1) -TEXCOPYA(yuv16_yvyu, UINT32, UINT32, 2) -TEXCOPYA(yuv16pal_yvyu, UINT16, UINT16, 1) +TEXCOPYA(yuv16_yvyu, uint32_t, uint32_t, 2) +TEXCOPYA(yuv16pal_yvyu, uint16_t, uint16_t, 1) -TEXCOPYA(yuv16_yuy2, UINT32, UINT32, 2) -TEXCOPYA(yuv16pal_yuy2, UINT32, UINT32, 2) +TEXCOPYA(yuv16_yuy2, uint32_t, uint32_t, 2) +TEXCOPYA(yuv16pal_yuy2, uint32_t, uint32_t, 2) -TEXROTA(argb32_argb32, UINT32, UINT32) -TEXROTA(rgb32_argb32, UINT32, UINT32) -TEXROTA(pal16_argb32, UINT16, UINT32) -TEXROTA(pal16_rgb32, UINT16, UINT32) +TEXROTA(argb32_argb32, uint32_t, uint32_t) +TEXROTA(rgb32_argb32, uint32_t, uint32_t) +TEXROTA(pal16_argb32, uint16_t, uint32_t) +TEXROTA(pal16_rgb32, uint16_t, uint32_t) -TEXROTA(rgb32pal_argb32, UINT32, UINT32) -TEXROTA(pal16a_argb32, UINT16, UINT32) -TEXROTA(rgb15_argb32, UINT16, UINT32) -TEXROTA(rgb15pal_argb32, UINT16, UINT32) +TEXROTA(rgb32pal_argb32, uint32_t, uint32_t) +TEXROTA(pal16a_argb32, uint16_t, uint32_t) +TEXROTA(rgb15_argb32, uint16_t, uint32_t) +TEXROTA(rgb15pal_argb32, uint16_t, uint32_t) -TEXROTA(pal16_argb1555, UINT16, UINT16) -TEXROTA(rgb15_argb1555, UINT16, UINT16) -TEXROTA(rgb15pal_argb1555, UINT16, UINT16) +TEXROTA(pal16_argb1555, uint16_t, uint16_t) +TEXROTA(rgb15_argb1555, uint16_t, uint16_t) +TEXROTA(rgb15pal_argb1555, uint16_t, uint16_t) -TEXROTA(argb32_rgb32, UINT32, UINT32) -TEXROTA(pal16a_rgb32, UINT16, UINT32) +TEXROTA(argb32_rgb32, uint32_t, uint32_t) +TEXROTA(pal16a_rgb32, uint16_t, uint32_t) -TEXROTA(yuv16_argb32rot, UINT16, UINT32) -TEXROTA(yuv16pal_argb32rot, UINT16, UINT32) +TEXROTA(yuv16_argb32rot, uint16_t, uint32_t) +TEXROTA(yuv16pal_argb32rot, uint16_t, uint32_t) |