mirror of
https://github.com/holub/mame
synced 2025-07-13 13:35:41 +03:00
-emu/rendersw.hxx: Fixed incorrect clipping of untextured rectangles.
-layouts: Started cleaning up fruit machine layouts to reduce bloat. -Fixed a few miscellaneous Coverity errors.
This commit is contained in:
parent
1267975eb6
commit
949d5ea5df
@ -311,7 +311,7 @@ void f2mc16_device::execute_run()
|
||||
m_usp-=2;
|
||||
write_16((m_usb << 16) | m_usp, read_rwX(3));
|
||||
write_rwX(3, m_usp);
|
||||
m_ssp -= m_tmp8;
|
||||
m_usp -= m_tmp8;
|
||||
}
|
||||
m_pc += 2;
|
||||
m_icount -= 6;
|
||||
|
@ -308,8 +308,6 @@ offs_t unsp_disassembler::disassemble_fxxx_101_group(std::ostream& stream, offs_
|
||||
util::stream_format(stream, "<UNDEFINED>");
|
||||
return UNSP_DASM_OK;
|
||||
}
|
||||
|
||||
return UNSP_DASM_OK;
|
||||
}
|
||||
|
||||
offs_t unsp_disassembler::disassemble_fxxx_110_group(std::ostream& stream, offs_t pc, uint16_t op, uint16_t ximm, const data_buffer &opcodes)
|
||||
|
@ -483,7 +483,7 @@ void duscc_device::trigger_interrupt(int index, int state)
|
||||
|
||||
LOGINT("%s %s:%c %02x \n",FUNCNAME, tag(), 'A' + index, state);
|
||||
|
||||
/* The Interrupt Control Register (ICR) bits, must be set for the correspondning channel */
|
||||
// The Interrupt Control Register (ICR) bits, must be set for the corresponding channel
|
||||
// ICR Check is probably by the caller but we check again to be sure
|
||||
if ((m_icr & (index == CHANNEL_A ? REG_ICR_CHA : REG_ICR_CHB)) == 0)
|
||||
{
|
||||
|
@ -130,7 +130,7 @@ private:
|
||||
|
||||
static inline u32 get_texel_palette16(const render_texinfo &texture, s32 curu, s32 curv)
|
||||
{
|
||||
const rgb_t *palbase = texture.palette;
|
||||
rgb_t const *const palbase = texture.palette;
|
||||
if constexpr (BilinearFilter)
|
||||
{
|
||||
s32 u0 = curu >> 16;
|
||||
@ -142,7 +142,7 @@ private:
|
||||
if (v0 < 0) v0 = v1 = 0;
|
||||
else if (v0 + 1 >= texture.height) v0 = texture.height - 1, v1 = 0;
|
||||
|
||||
const u16 *texbase = reinterpret_cast<const u16 *>(texture.base);
|
||||
u16 const *texbase = reinterpret_cast<u16 const *>(texture.base);
|
||||
texbase += v0 * texture.rowpixels + u0;
|
||||
|
||||
u32 pix00 = palbase[texbase[0]];
|
||||
@ -153,7 +153,7 @@ private:
|
||||
}
|
||||
else
|
||||
{
|
||||
const u16 *texbase = reinterpret_cast<const u16 *>(texture.base) + (curv >> 16) * texture.rowpixels + (curu >> 16);
|
||||
u16 const *const texbase = reinterpret_cast<u16 const *>(texture.base) + (curv >> 16) * texture.rowpixels + (curu >> 16);
|
||||
return palbase[texbase[0]];
|
||||
}
|
||||
}
|
||||
@ -166,7 +166,7 @@ private:
|
||||
|
||||
static inline u32 get_texel_palette16a(const render_texinfo &texture, s32 curu, s32 curv)
|
||||
{
|
||||
const rgb_t *palbase = texture.palette;
|
||||
rgb_t const *const palbase = texture.palette;
|
||||
if constexpr (BilinearFilter)
|
||||
{
|
||||
s32 u0 = curu >> 16;
|
||||
@ -178,14 +178,14 @@ private:
|
||||
if (v0 < 0) v0 = v1 = 0;
|
||||
else if (v0 + 1 >= texture.height) v0 = texture.height - 1, v1 = 0;
|
||||
|
||||
const u16 *texbase = reinterpret_cast<const u16 *>(texture.base);
|
||||
u16 const *texbase = reinterpret_cast<u16 const *>(texture.base);
|
||||
texbase += v0 * texture.rowpixels + u0;
|
||||
|
||||
return rgbaint_t::bilinear_filter(palbase[texbase[0]], palbase[texbase[u1]], palbase[texbase[v1]], palbase[texbase[u1 + v1]], curu >> 8, curv >> 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
const u16 *texbase = reinterpret_cast<const u16 *>(texture.base) + (curv >> 16) * texture.rowpixels + (curu >> 16);
|
||||
u16 const *const texbase = reinterpret_cast<u16 const *>(texture.base) + (curv >> 16) * texture.rowpixels + (curu >> 16);
|
||||
return palbase[texbase[0]];
|
||||
}
|
||||
}
|
||||
@ -415,7 +415,7 @@ private:
|
||||
// draw_line - draw a line or point
|
||||
//-------------------------------------------------
|
||||
|
||||
static void draw_line(const render_primitive &prim, PixelType *dstdata, s32 width, s32 height, u32 pitch)
|
||||
static void draw_line(render_primitive const &prim, PixelType *dstdata, s32 width, s32 height, u32 pitch)
|
||||
{
|
||||
// internal tables
|
||||
static u32 s_cosine_table[2049];
|
||||
@ -576,7 +576,7 @@ private:
|
||||
// draw_rect - draw a solid rectangle
|
||||
//-------------------------------------------------
|
||||
|
||||
static void draw_rect(const render_primitive &prim, PixelType *dstdata, s32 width, s32 height, u32 pitch)
|
||||
static void draw_rect(render_primitive const &prim, PixelType *dstdata, s32 width, s32 height, u32 pitch)
|
||||
{
|
||||
render_bounds const fpos = prim.bounds;
|
||||
assert(fpos.x0 <= fpos.x1);
|
||||
@ -584,8 +584,8 @@ private:
|
||||
|
||||
// clamp to integers and ensure we fit
|
||||
s32 const startx = std::clamp<s32>(round_nearest(fpos.x0), 0, width);
|
||||
s32 const starty = std::clamp<s32>(round_nearest(fpos.y0), 0, width);
|
||||
s32 const endx = std::clamp<s32>(round_nearest(fpos.x1), 0, height);
|
||||
s32 const starty = std::clamp<s32>(round_nearest(fpos.y0), 0, height);
|
||||
s32 const endx = std::clamp<s32>(round_nearest(fpos.x1), 0, width);
|
||||
s32 const endy = std::clamp<s32>(round_nearest(fpos.y1), 0, height);
|
||||
|
||||
// bail if nothing left
|
||||
@ -601,9 +601,9 @@ private:
|
||||
// fast case: no alpha
|
||||
|
||||
// clamp R,G,B to 0-256 range
|
||||
u32 r = u32(std::clamp(256.0f * prim.color.r, 0.0f, 255.0f));
|
||||
u32 g = u32(std::clamp(256.0f * prim.color.g, 0.0f, 255.0f));
|
||||
u32 b = u32(std::clamp(256.0f * prim.color.b, 0.0f, 255.0f));
|
||||
u32 const r = u32(std::clamp(256.0f * prim.color.r, 0.0f, 255.0f));
|
||||
u32 const g = u32(std::clamp(256.0f * prim.color.g, 0.0f, 255.0f));
|
||||
u32 const b = u32(std::clamp(256.0f * prim.color.b, 0.0f, 255.0f));
|
||||
u32 const pix = dest_rgb_to_pixel(r, g, b);
|
||||
|
||||
// loop over rows
|
||||
@ -662,14 +662,15 @@ private:
|
||||
// rasterization of a 16bpp palettized texture
|
||||
//-------------------------------------------------
|
||||
|
||||
static void draw_quad_palette16_none(const render_primitive &prim, PixelType *dstdata, u32 pitch, const quad_setup_data &setup)
|
||||
static void draw_quad_palette16_none(render_primitive const &prim, PixelType *dstdata, u32 pitch, quad_setup_data const &setup)
|
||||
{
|
||||
// ensure all parameters are valid
|
||||
assert(prim.texture.palette != nullptr);
|
||||
|
||||
// fast case: no coloring, no alpha
|
||||
if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a))
|
||||
{
|
||||
// fast case: no coloring, no alpha
|
||||
|
||||
// loop over rows
|
||||
for (s32 y = setup.starty; y < setup.endy; y++)
|
||||
{
|
||||
@ -680,25 +681,21 @@ private:
|
||||
// loop over cols
|
||||
for (s32 x = setup.startx; x < setup.endx; x++)
|
||||
{
|
||||
const u32 pix = get_texel_palette16(prim.texture, curu, curv);
|
||||
u32 const pix = get_texel_palette16(prim.texture, curu, curv);
|
||||
*dest++ = source32_to_dest(pix);
|
||||
curu += setup.dudx;
|
||||
curv += setup.dvdx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// coloring-only case
|
||||
else if (is_opaque(prim.color.a))
|
||||
{
|
||||
u32 sr = u32(256.0f * prim.color.r);
|
||||
u32 sg = u32(256.0f * prim.color.g);
|
||||
u32 sb = u32(256.0f * prim.color.b);
|
||||
// coloring-only case
|
||||
|
||||
// clamp R,G,B to 0-256 range
|
||||
if (sr > 0x100) { if (s32(sr) < 0) sr = 0; else sr = 0x100; }
|
||||
if (sg > 0x100) { if (s32(sg) < 0) sg = 0; else sg = 0x100; }
|
||||
if (sb > 0x100) { if (s32(sb) < 0) sb = 0; else sb = 0x100; }
|
||||
u32 const sr = u32(std::clamp(256.0f * prim.color.r, 0.0f, 256.0f));
|
||||
u32 const sg = u32(std::clamp(256.0f * prim.color.g, 0.0f, 256.0f));
|
||||
u32 const sb = u32(std::clamp(256.0f * prim.color.b, 0.0f, 256.0f));
|
||||
|
||||
// loop over rows
|
||||
for (s32 y = setup.starty; y < setup.endy; y++)
|
||||
@ -710,10 +707,10 @@ private:
|
||||
// loop over cols
|
||||
for (s32 x = setup.startx; x < setup.endx; x++)
|
||||
{
|
||||
const u32 pix = get_texel_palette16(prim.texture, curu, curv);
|
||||
const u32 r = (source32_r(pix) * sr) >> 8;
|
||||
const u32 g = (source32_g(pix) * sg) >> 8;
|
||||
const u32 b = (source32_b(pix) * sb) >> 8;
|
||||
u32 const pix = get_texel_palette16(prim.texture, curu, curv);
|
||||
u32 const r = (source32_r(pix) * sr) >> 8;
|
||||
u32 const g = (source32_g(pix) * sg) >> 8;
|
||||
u32 const b = (source32_b(pix) * sb) >> 8;
|
||||
|
||||
*dest++ = dest_assemble_rgb(r, g, b);
|
||||
curu += setup.dudx;
|
||||
@ -721,20 +718,15 @@ private:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// alpha and/or coloring case
|
||||
else if (!is_transparent(prim.color.a))
|
||||
{
|
||||
u32 sr = u32(256.0f * prim.color.r * prim.color.a);
|
||||
u32 sg = u32(256.0f * prim.color.g * prim.color.a);
|
||||
u32 sb = u32(256.0f * prim.color.b * prim.color.a);
|
||||
u32 invsa = u32(256.0f * (1.0f - prim.color.a));
|
||||
// alpha and/or coloring case
|
||||
|
||||
// clamp R,G,B and inverse A to 0-256 range
|
||||
if (sr > 0x100) { if (s32(sr) < 0) sr = 0; else sr = 0x100; }
|
||||
if (sg > 0x100) { if (s32(sg) < 0) sg = 0; else sg = 0x100; }
|
||||
if (sb > 0x100) { if (s32(sb) < 0) sb = 0; else sb = 0x100; }
|
||||
if (invsa > 0x100) { if (s32(invsa) < 0) invsa = 0; else invsa = 0x100; }
|
||||
u32 const sr = u32(std::clamp(256.0f * prim.color.r * prim.color.a, 0.0f, 256.0f));
|
||||
u32 const sg = u32(std::clamp(256.0f * prim.color.g * prim.color.a, 0.0f, 256.0f));
|
||||
u32 const sb = u32(std::clamp(256.0f * prim.color.b * prim.color.a, 0.0f, 256.0f));
|
||||
u32 const invsa = u32(std::clamp(256.0f * (1.0f - prim.color.a), 0.0f, 256.0f));
|
||||
|
||||
// loop over rows
|
||||
for (s32 y = setup.starty; y < setup.endy; y++)
|
||||
@ -746,11 +738,11 @@ private:
|
||||
// loop over cols
|
||||
for (s32 x = setup.startx; x < setup.endx; x++)
|
||||
{
|
||||
const u32 pix = get_texel_palette16(prim.texture, curu, curv);
|
||||
const u32 dpix = NoDestRead ? 0 : *dest;
|
||||
const u32 r = (source32_r(pix) * sr + dest_r(dpix) * invsa) >> 8;
|
||||
const u32 g = (source32_g(pix) * sg + dest_g(dpix) * invsa) >> 8;
|
||||
const u32 b = (source32_b(pix) * sb + dest_b(dpix) * invsa) >> 8;
|
||||
u32 const pix = get_texel_palette16(prim.texture, curu, curv);
|
||||
u32 const dpix = NoDestRead ? 0 : *dest;
|
||||
u32 const r = (source32_r(pix) * sr + dest_r(dpix) * invsa) >> 8;
|
||||
u32 const g = (source32_g(pix) * sg + dest_g(dpix) * invsa) >> 8;
|
||||
u32 const b = (source32_b(pix) * sb + dest_b(dpix) * invsa) >> 8;
|
||||
|
||||
*dest++ = dest_assemble_rgb(r, g, b);
|
||||
curu += setup.dudx;
|
||||
@ -766,14 +758,15 @@ private:
|
||||
// rasterization of a 16bpp palettized texture
|
||||
//-------------------------------------------------
|
||||
|
||||
static void draw_quad_palette16_add(const render_primitive &prim, PixelType *dstdata, u32 pitch, const quad_setup_data&setup)
|
||||
static void draw_quad_palette16_add(render_primitive const &prim, PixelType *dstdata, u32 pitch, quad_setup_data const &setup)
|
||||
{
|
||||
// ensure all parameters are valid
|
||||
assert(prim.texture.palette != nullptr);
|
||||
|
||||
// fast case: no coloring, no alpha
|
||||
if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a))
|
||||
{
|
||||
// fast case: no coloring, no alpha
|
||||
|
||||
// loop over rows
|
||||
for (s32 y = setup.starty; y < setup.endy; y++)
|
||||
{
|
||||
@ -787,7 +780,7 @@ private:
|
||||
const u32 pix = get_texel_palette16(prim.texture, curu, curv);
|
||||
if ((pix & 0xffffff) != 0)
|
||||
{
|
||||
const u32 dpix = NoDestRead ? 0 : *dest;
|
||||
u32 const dpix = NoDestRead ? 0 : *dest;
|
||||
u32 r = source32_r(pix) + dest_r(dpix);
|
||||
u32 g = source32_g(pix) + dest_g(dpix);
|
||||
u32 b = source32_b(pix) + dest_b(dpix);
|
||||
@ -802,18 +795,14 @@ private:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// alpha and/or coloring case
|
||||
else
|
||||
{
|
||||
u32 sr = u32(256.0f * prim.color.r * prim.color.a);
|
||||
u32 sg = u32(256.0f * prim.color.g * prim.color.a);
|
||||
u32 sb = u32(256.0f * prim.color.b * prim.color.a);
|
||||
// alpha and/or coloring case
|
||||
|
||||
// clamp R,G,B and inverse A to 0-256 range
|
||||
if (sr > 0x100) { if (s32(sr) < 0) sr = 0; else sr = 0x100; }
|
||||
if (sg > 0x100) { if (s32(sg) < 0) sg = 0; else sg = 0x100; }
|
||||
if (sb > 0x100) { if (s32(sb) < 0) sb = 0; else sb = 0x100; }
|
||||
u32 const sr = u32(std::clamp(256.0f * prim.color.r * prim.color.a, 0.0f, 256.0f));
|
||||
u32 const sg = u32(std::clamp(256.0f * prim.color.g * prim.color.a, 0.0f, 256.0f));
|
||||
u32 const sb = u32(std::clamp(256.0f * prim.color.b * prim.color.a, 0.0f, 256.0f));
|
||||
|
||||
// loop over rows
|
||||
for (s32 y = setup.starty; y < setup.endy; y++)
|
||||
@ -825,10 +814,10 @@ private:
|
||||
// loop over cols
|
||||
for (s32 x = setup.startx; x < setup.endx; x++)
|
||||
{
|
||||
const u32 pix = get_texel_palette16(prim.texture, curu, curv);
|
||||
u32 const pix = get_texel_palette16(prim.texture, curu, curv);
|
||||
if ((pix & 0xffffff) != 0)
|
||||
{
|
||||
const u32 dpix = NoDestRead ? 0 : *dest;
|
||||
u32 const dpix = NoDestRead ? 0 : *dest;
|
||||
u32 r = ((source32_r(pix) * sr) >> 8) + dest_r(dpix);
|
||||
u32 g = ((source32_g(pix) * sg) >> 8) + dest_g(dpix);
|
||||
u32 b = ((source32_b(pix) * sb) >> 8) + dest_b(dpix);
|
||||
@ -855,11 +844,12 @@ private:
|
||||
// rasterization of a 16bpp YUY image
|
||||
//-------------------------------------------------
|
||||
|
||||
static void draw_quad_yuy16_none(const render_primitive &prim, PixelType *dstdata, u32 pitch, const quad_setup_data&setup)
|
||||
static void draw_quad_yuy16_none(render_primitive const &prim, PixelType *dstdata, u32 pitch, quad_setup_data const &setup)
|
||||
{
|
||||
// fast case: no coloring, no alpha
|
||||
if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a))
|
||||
{
|
||||
// fast case: no coloring, no alpha
|
||||
|
||||
// loop over rows
|
||||
for (s32 y = setup.starty; y < setup.endy; y++)
|
||||
{
|
||||
@ -870,25 +860,21 @@ private:
|
||||
// loop over cols
|
||||
for (s32 x = setup.startx; x < setup.endx; x++)
|
||||
{
|
||||
const u32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv));
|
||||
u32 const pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv));
|
||||
*dest++ = source32_to_dest(pix);
|
||||
curu += setup.dudx;
|
||||
curv += setup.dvdx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// coloring-only case
|
||||
else if (is_opaque(prim.color.a))
|
||||
{
|
||||
u32 sr = u32(256.0f * prim.color.r);
|
||||
u32 sg = u32(256.0f * prim.color.g);
|
||||
u32 sb = u32(256.0f * prim.color.b);
|
||||
// coloring-only case
|
||||
|
||||
// clamp R,G,B to 0-256 range
|
||||
if (sr > 0x100) { if (s32(sr) < 0) sr = 0; else sr = 0x100; }
|
||||
if (sg > 0x100) { if (s32(sg) < 0) sg = 0; else sg = 0x100; }
|
||||
if (sb > 0x100) { if (s32(sb) < 0) sb = 0; else sb = 0x100; }
|
||||
u32 const sr = u32(std::clamp(256.0f * prim.color.r, 0.0f, 256.0f));
|
||||
u32 const sg = u32(std::clamp(256.0f * prim.color.g, 0.0f, 256.0f));
|
||||
u32 const sb = u32(std::clamp(256.0f * prim.color.b, 0.0f, 256.0f));
|
||||
|
||||
// loop over rows
|
||||
for (s32 y = setup.starty; y < setup.endy; y++)
|
||||
@ -900,10 +886,10 @@ private:
|
||||
// loop over cols
|
||||
for (s32 x = setup.startx; x < setup.endx; x++)
|
||||
{
|
||||
const u32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv));
|
||||
const u32 r = (source32_r(pix) * sr) >> 8;
|
||||
const u32 g = (source32_g(pix) * sg) >> 8;
|
||||
const u32 b = (source32_b(pix) * sb) >> 8;
|
||||
u32 const pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv));
|
||||
u32 const r = (source32_r(pix) * sr) >> 8;
|
||||
u32 const g = (source32_g(pix) * sg) >> 8;
|
||||
u32 const b = (source32_b(pix) * sb) >> 8;
|
||||
|
||||
*dest++ = dest_assemble_rgb(r, g, b);
|
||||
curu += setup.dudx;
|
||||
@ -911,20 +897,15 @@ private:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// alpha and/or coloring case
|
||||
else if (!is_transparent(prim.color.a))
|
||||
{
|
||||
u32 sr = u32(256.0f * prim.color.r * prim.color.a);
|
||||
u32 sg = u32(256.0f * prim.color.g * prim.color.a);
|
||||
u32 sb = u32(256.0f * prim.color.b * prim.color.a);
|
||||
u32 invsa = u32(256.0f * (1.0f - prim.color.a));
|
||||
// alpha and/or coloring case
|
||||
|
||||
// clamp R,G,B and inverse A to 0-256 range
|
||||
if (sr > 0x100) { if (s32(sr) < 0) sr = 0; else sr = 0x100; }
|
||||
if (sg > 0x100) { if (s32(sg) < 0) sg = 0; else sg = 0x100; }
|
||||
if (sb > 0x100) { if (s32(sb) < 0) sb = 0; else sb = 0x100; }
|
||||
if (invsa > 0x100) { if (s32(invsa) < 0) invsa = 0; else invsa = 0x100; }
|
||||
u32 const sr = u32(std::clamp(256.0f * prim.color.r * prim.color.a, 0.0f, 256.0f));
|
||||
u32 const sg = u32(std::clamp(256.0f * prim.color.g * prim.color.a, 0.0f, 256.0f));
|
||||
u32 const sb = u32(std::clamp(256.0f * prim.color.b * prim.color.a, 0.0f, 256.0f));
|
||||
u32 const invsa = u32(std::clamp(256.0f * (1.0f - prim.color.a), 0.0f, 256.0f));
|
||||
|
||||
// loop over rows
|
||||
for (s32 y = setup.starty; y < setup.endy; y++)
|
||||
@ -936,11 +917,11 @@ private:
|
||||
// loop over cols
|
||||
for (s32 x = setup.startx; x < setup.endx; x++)
|
||||
{
|
||||
const u32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv));
|
||||
const u32 dpix = NoDestRead ? 0 : *dest;
|
||||
const u32 r = (source32_r(pix) * sr + dest_r(dpix) * invsa) >> 8;
|
||||
const u32 g = (source32_g(pix) * sg + dest_g(dpix) * invsa) >> 8;
|
||||
const u32 b = (source32_b(pix) * sb + dest_b(dpix) * invsa) >> 8;
|
||||
u32 const pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv));
|
||||
u32 const dpix = NoDestRead ? 0 : *dest;
|
||||
u32 const r = (source32_r(pix) * sr + dest_r(dpix) * invsa) >> 8;
|
||||
u32 const g = (source32_g(pix) * sg + dest_g(dpix) * invsa) >> 8;
|
||||
u32 const b = (source32_b(pix) * sb + dest_b(dpix) * invsa) >> 8;
|
||||
|
||||
*dest++ = dest_assemble_rgb(r, g, b);
|
||||
curu += setup.dudx;
|
||||
@ -957,15 +938,16 @@ private:
|
||||
// conversion
|
||||
//-------------------------------------------------
|
||||
|
||||
static void draw_quad_yuy16_add(const render_primitive &prim, PixelType *dstdata, u32 pitch, const quad_setup_data&setup)
|
||||
static void draw_quad_yuy16_add(render_primitive const &prim, PixelType *dstdata, u32 pitch, quad_setup_data const &setup)
|
||||
{
|
||||
// simply can't do this without reading from the dest
|
||||
if constexpr (NoDestRead)
|
||||
return;
|
||||
|
||||
// fast case: no coloring, no alpha
|
||||
if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a))
|
||||
{
|
||||
// fast case: no coloring, no alpha
|
||||
|
||||
// loop over rows
|
||||
for (s32 y = setup.starty; y < setup.endy; y++)
|
||||
{
|
||||
@ -976,8 +958,8 @@ private:
|
||||
// loop over cols
|
||||
for (s32 x = setup.startx; x < setup.endx; x++)
|
||||
{
|
||||
const u32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv));
|
||||
const u32 dpix = NoDestRead ? 0 : *dest;
|
||||
u32 const pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv));
|
||||
u32 const dpix = NoDestRead ? 0 : *dest;
|
||||
u32 r = source32_r(pix) + dest_r(dpix);
|
||||
u32 g = source32_g(pix) + dest_g(dpix);
|
||||
u32 b = source32_b(pix) + dest_b(dpix);
|
||||
@ -990,20 +972,15 @@ private:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// alpha and/or coloring case
|
||||
else
|
||||
{
|
||||
u32 sr = u32(256.0f * prim.color.r);
|
||||
u32 sg = u32(256.0f * prim.color.g);
|
||||
u32 sb = u32(256.0f * prim.color.b);
|
||||
u32 sa = u32(256.0f * prim.color.a);
|
||||
// alpha and/or coloring case
|
||||
|
||||
// clamp R,G,B and inverse A to 0-256 range
|
||||
if (sr > 0x100) { if (s32(sr) < 0) sr = 0; else sr = 0x100; }
|
||||
if (sg > 0x100) { if (s32(sg) < 0) sg = 0; else sg = 0x100; }
|
||||
if (sb > 0x100) { if (s32(sb) < 0) sb = 0; else sb = 0x100; }
|
||||
if (sa > 0x100) { if (s32(sa) < 0) sa = 0; else sa = 0x100; }
|
||||
u32 const sr = u32(std::clamp(256.0f * prim.color.r, 0.0f, 256.0f));
|
||||
u32 const sg = u32(std::clamp(256.0f * prim.color.g, 0.0f, 256.0f));
|
||||
u32 const sb = u32(std::clamp(256.0f * prim.color.b, 0.0f, 256.0f));
|
||||
u32 const sa = u32(std::clamp(256.0f * prim.color.a, 0.0f, 256.0f));
|
||||
|
||||
// loop over rows
|
||||
for (s32 y = setup.starty; y < setup.endy; y++)
|
||||
@ -1145,10 +1122,10 @@ private:
|
||||
// alpha and/or coloring case
|
||||
|
||||
// clamp R,G,B and inverse A to 0-256 range
|
||||
u32 sr = u32(std::clamp(256.0f * prim.color.r * prim.color.a, 0.0f, 256.0f));
|
||||
u32 sg = u32(std::clamp(256.0f * prim.color.g * prim.color.a, 0.0f, 256.0f));
|
||||
u32 sb = u32(std::clamp(256.0f * prim.color.b * prim.color.a, 0.0f, 256.0f));
|
||||
u32 invsa = u32(std::clamp(256.0f * (1.0f - prim.color.a), 0.0f, 256.0f));
|
||||
u32 const sr = u32(std::clamp(256.0f * prim.color.r * prim.color.a, 0.0f, 256.0f));
|
||||
u32 const sg = u32(std::clamp(256.0f * prim.color.g * prim.color.a, 0.0f, 256.0f));
|
||||
u32 const sb = u32(std::clamp(256.0f * prim.color.b * prim.color.a, 0.0f, 256.0f));
|
||||
u32 const invsa = u32(std::clamp(256.0f * (1.0f - prim.color.a), 0.0f, 256.0f));
|
||||
|
||||
// loop over rows
|
||||
for (s32 y = setup.starty; y < setup.endy; y++)
|
||||
@ -1750,16 +1727,16 @@ private:
|
||||
// drawing routine
|
||||
//-------------------------------------------------
|
||||
|
||||
static void setup_and_draw_textured_quad(const render_primitive &prim, PixelType *dstdata, s32 width, s32 height, u32 pitch)
|
||||
static void setup_and_draw_textured_quad(render_primitive const &prim, PixelType *dstdata, s32 width, s32 height, u32 pitch)
|
||||
{
|
||||
assert(prim.bounds.x0 <= prim.bounds.x1);
|
||||
assert(prim.bounds.y0 <= prim.bounds.y1);
|
||||
|
||||
// determine U/V deltas
|
||||
float fdudx = (prim.texcoords.tr.u - prim.texcoords.tl.u) / (prim.bounds.x1 - prim.bounds.x0);
|
||||
float fdvdx = (prim.texcoords.tr.v - prim.texcoords.tl.v) / (prim.bounds.x1 - prim.bounds.x0);
|
||||
float fdudy = (prim.texcoords.bl.u - prim.texcoords.tl.u) / (prim.bounds.y1 - prim.bounds.y0);
|
||||
float fdvdy = (prim.texcoords.bl.v - prim.texcoords.tl.v) / (prim.bounds.y1 - prim.bounds.y0);
|
||||
float const fdudx = (prim.texcoords.tr.u - prim.texcoords.tl.u) / (prim.bounds.x1 - prim.bounds.x0);
|
||||
float const fdvdx = (prim.texcoords.tr.v - prim.texcoords.tl.v) / (prim.bounds.x1 - prim.bounds.x0);
|
||||
float const fdudy = (prim.texcoords.bl.u - prim.texcoords.tl.u) / (prim.bounds.y1 - prim.bounds.y0);
|
||||
float const fdvdy = (prim.texcoords.bl.v - prim.texcoords.tl.v) / (prim.bounds.y1 - prim.bounds.y0);
|
||||
|
||||
// clamp to integers
|
||||
quad_setup_data setup;
|
||||
@ -1873,10 +1850,10 @@ private:
|
||||
//-------------------------------------------------
|
||||
|
||||
public:
|
||||
static void draw_primitives(const render_primitive_list &primlist, void *dstdata, u32 width, u32 height, u32 pitch)
|
||||
static void draw_primitives(render_primitive_list const &primlist, void *dstdata, u32 width, u32 height, u32 pitch)
|
||||
{
|
||||
// loop over the list and render each element
|
||||
for (const render_primitive *prim = primlist.first(); prim != nullptr; prim = prim->next())
|
||||
for (render_primitive const *prim = primlist.first(); prim != nullptr; prim = prim->next())
|
||||
switch (prim->type)
|
||||
{
|
||||
case render_primitive::LINE:
|
||||
|
@ -194,7 +194,7 @@ void gaelco_state::thoop_map(address_map &map)
|
||||
map(0x100000, 0x101fff).ram().w(FUNC(gaelco_state::thoop_vram_encrypted_w)).share("videoram"); // Video RAM
|
||||
map(0x102000, 0x103fff).ram().w(FUNC(gaelco_state::thoop_encrypted_w)).share("screenram"); // Screen RAM
|
||||
map(0x108000, 0x108007).writeonly().share("vregs"); // Video Registers
|
||||
map(0x10800c, 0x10800d).w(FUNC(gaelco_state::irqack_w)); // INT 6 ACK/Watchdog timer
|
||||
map(0x10800c, 0x10800d).w(FUNC(gaelco_state::irqack_w)); // INT 6 ACK/Watchdog timer
|
||||
map(0x200000, 0x2007ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
|
||||
map(0x440000, 0x440fff).ram().share("spriteram"); // Sprite RAM
|
||||
map(0x700000, 0x700001).portr("DSW2");
|
||||
@ -337,10 +337,10 @@ static INPUT_PORTS_START( biomtoy )
|
||||
|
||||
PORT_START("DSW2")
|
||||
PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW2:8" )
|
||||
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7") /* Not Listed/shown in test mode */
|
||||
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7") // Not Listed/shown in test mode
|
||||
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6") /* Not Listed/shown in test mode */
|
||||
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6") // Not Listed/shown in test mode
|
||||
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:5")
|
||||
|
@ -12177,7 +12177,7 @@ GAME( 2005, ngbc, awbios, aw2c, aw2c, atomiswave_state, init_atomiswave,
|
||||
GAME( 2005, ngbcj, ngbc, aw2c, aw2c, atomiswave_state, init_atomiswave, ROT0, "Sammy / SNK Playmore", "NeoGeo Battle Coliseum (Japan)", GAME_FLAGS ) // Jun 25 2005 17:00:38
|
||||
GAME( 2005, samsptk, awbios, aw2c, aw2c, atomiswave_state, init_atomiswave, ROT0, "Sammy / SNK Playmore", "Samurai Spirits Tenkaichi Kenkakuden", GAME_FLAGS ) // Aug 05 2005 16:43:48
|
||||
GAME( 2005, kofxi, awbios, aw2c, aw2c, atomiswave_state, init_atomiswave, ROT0, "Sammy / SNK Playmore", "The King of Fighters XI", GAME_FLAGS ) // Aug 07 2005 18:11:25
|
||||
GAME( 2005, fotns, awbios, aw2c, aw2c, atomiswave_state, init_atomiswave, ROT0, "Arc System Works / Sega", "Fist Of The North Star / Hokuto no Ken", GAME_FLAGS ) // Nov 28 2005 21:04:40
|
||||
GAME( 2005, fotns, awbios, aw2c, aw2c, atomiswave_state, init_atomiswave, ROT0, "Arc System Works / Sega", "Fist Of The North Star / Hokuto no Ken", GAME_FLAGS ) // Nov 28 2005 21:04:40
|
||||
GAME( 2006, mslug6, awbios, aw2c, aw2c, atomiswave_state, init_atomiswave, ROT0, "Sega / SNK Playmore", "Metal Slug 6", GAME_FLAGS) // Jan 13 2006 00:49:12
|
||||
GAME( 2006, xtrmhnt2, awbios, aw2c, aw2c, atomiswave_state, init_xtrmhnt2, ROT0, "Sega", "Extreme Hunting 2", GAME_FLAGS ) // May 26 2006 14:03:22
|
||||
GAME( 2006, dirtypig, awbios, aw2c, aw2c, atomiswave_state, init_atomiswave, ROT0, "Sammy", "Dirty Pigskin Football", GAME_FLAGS) // Sep 10 2006 20:24:14
|
||||
|
@ -251,5 +251,5 @@ ROM_START(kuzmich)
|
||||
ROM_LOAD("ke.bin", 0x0000, 0x8000, CRC(102d246b) SHA1(492dcdf0cc31190a97057a69010e2c9c23b6e59d))
|
||||
ROM_END
|
||||
|
||||
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME
|
||||
COMP( 199?, kuzmich, 0, 0, kuzmich, kuzmich, superga2_state, empty_init, "Nippel", "Kuzmich-Egorych", MACHINE_SUPPORTS_SAVE )
|
||||
// YEAR NAME PARENT MACHINE INPUT CLASS INIT COMPANY FULLNAME
|
||||
GAME( 199?, kuzmich, 0, kuzmich, kuzmich, superga2_state, empty_init, ROT0, "Nippel", "Kuzmich-Egorych", MACHINE_SUPPORTS_SAVE )
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user