From 1a600c1d1a9e2ca31150ea3439cba10113faafa6 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Tue, 17 Sep 2019 22:12:04 +1000 Subject: (nw) more misc cleanup: * mark drawgfx core templates inline to prevent linker trying to coalesce them across compilation units, and hopefully encourage the compiler to specialise them when drivers call them with fixed argument values * make wraparound parameter for ROZ drawing functions bool - it's a simple true/false value * clean up spacing in a few places --- src/devices/video/315_5313.cpp | 12 ++++----- src/emu/drawgfx.cpp | 24 ++++++++--------- src/emu/drawgfx.h | 24 ++++++++--------- src/emu/drawgfxt.ipp | 55 ++++++++++++++++++-------------------- src/mame/video/psikyosh.cpp | 16 +++++------ src/mame/video/realbrk.cpp | 6 ++--- src/mame/video/tatsumi.cpp | 8 +++--- src/mame/video/tc0080vco.cpp | 2 +- src/mame/video/tunhunt.cpp | 60 +++++++++++++++++++----------------------- 9 files changed, 99 insertions(+), 108 deletions(-) diff --git a/src/devices/video/315_5313.cpp b/src/devices/video/315_5313.cpp index 585cbeee732..967663e42f6 100644 --- a/src/devices/video/315_5313.cpp +++ b/src/devices/video/315_5313.cpp @@ -213,7 +213,7 @@ sega315_5313_device::sega315_5313_device(const machine_config &mconfig, const ch , m_gfx_palette_hilight(*this, "gfx_palette_hilight") { m_use_alt_timing = 0; - m_palwrite_base = - 1; + m_palwrite_base = -1; } //------------------------------------------------- @@ -375,7 +375,7 @@ void sega315_5313_device::device_reset() m_vdp_address = 0; m_vram_fill_pending = 0; m_vram_fill_length = 0; - m_irq4counter = - 1; + m_irq4counter = -1; m_imode_odd_frame = 0; m_sprite_collision = 0; m_imode = 0; @@ -450,7 +450,7 @@ void sega315_5313_device::write_cram_value(int offset, int data) m_palette_lookup[offset] = data; if (m_ext_palette != nullptr) { - if (m_palwrite_base != - 1) + if (m_palwrite_base != -1) { m_ext_palette->set_pen_color(offset + m_palwrite_base, m_palette_lut->pen(data)); m_ext_palette->set_pen_color(offset + m_palwrite_base + 0x40, m_palette_lut->pen(0x200 | data)); @@ -2284,8 +2284,8 @@ void sega315_5313_device::vdp_handle_eof() m_vblank_flag = 0; //m_irq6_pending = 0; /* NO! (breaks warlock) */ - /* Set it to - 1 here, so it becomes 0 when the first timer kicks in */ - if (!m_use_alt_timing) m_scanline_counter = - 1; + /* Set it to -1 here, so it becomes 0 when the first timer kicks in */ + if (!m_use_alt_timing) m_scanline_counter = -1; m_sprite_collision = 0;//? when to reset this .. m_imode = MEGADRIVE_REG0C_INTERLEAVE; // can't change mid-frame.. m_imode_odd_frame ^= 1; @@ -2317,7 +2317,7 @@ void sega315_5313_device::vdp_handle_eof() switch (MEGADRIVE_REG0C_RS0 | (MEGADRIVE_REG0C_RS1 << 1)) { - /* note, add 240 mode + init new timings! */ + /* note, add 240 mode + init new timings! */ case 0: scr_width = 256; break; case 1: scr_width = 256; break; case 2: scr_width = 320; break; diff --git a/src/emu/drawgfx.cpp b/src/emu/drawgfx.cpp index 883114fa73f..fe909496342 100644 --- a/src/emu/drawgfx.cpp +++ b/src/emu/drawgfx.cpp @@ -2455,17 +2455,17 @@ void primask_copyscrollbitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src, pixels -------------------------------------------------*/ -void copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound) +void copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound) { copyrozbitmap_core(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, [](u16 &destp, const u16 &srcp) { PIXEL_OP_COPY_OPAQUE(destp, srcp); }); } -void copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound) +void copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound) { copyrozbitmap_core(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, [](u32 &destp, const u32 &srcp) { PIXEL_OP_COPY_OPAQUE(destp, srcp); }); } -void prio_copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, bitmap_ind8 &priority, u32 pmask) +void prio_copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound, bitmap_ind8 &priority, u32 pmask) { // high bit of the mask is implicitly on pmask |= 1 << 31; @@ -2473,7 +2473,7 @@ void prio_copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const bit copyrozbitmap_core(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, priority, [pmask](u16 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIORITY(destp, pri, srcp); }); } -void prio_copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, bitmap_ind8 &priority, u32 pmask) +void prio_copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound, bitmap_ind8 &priority, u32 pmask) { // high bit of the mask is implicitly on pmask |= 1 << 31; @@ -2481,7 +2481,7 @@ void prio_copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const bit copyrozbitmap_core(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, priority, [pmask](u32 &destp, u8 &pri, const u32 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIORITY(destp, pri, srcp); }); } -void primask_copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, bitmap_ind8 &priority, u8 pcode, u8 pmask) +void primask_copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound, bitmap_ind8 &priority, u8 pcode, u8 pmask) { if (pcode == 0 && pmask == 0xff) copyrozbitmap(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound); @@ -2489,7 +2489,7 @@ void primask_copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const copyrozbitmap_core(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, priority, [pcode, pmask](u16 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_COPY_OPAQUE_PRIMASK(destp, pri, srcp); }); } -void primask_copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, bitmap_ind8 &priority, u8 pcode, u8 pmask) +void primask_copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound, bitmap_ind8 &priority, u8 pcode, u8 pmask) { if (pcode == 0 && pmask == 0xff) copyrozbitmap(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound); @@ -2505,17 +2505,17 @@ void primask_copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const transpen -------------------------------------------------*/ -void copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, u32 trans_pen) +void copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound, u32 trans_pen) { copyrozbitmap_core(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, [trans_pen](u16 &destp, const u16 &srcp) { PIXEL_OP_COPY_TRANSPEN(destp, srcp); }); } -void copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, u32 trans_pen) +void copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound, u32 trans_pen) { copyrozbitmap_core(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, [trans_pen](u32 &destp, const u32 &srcp) { PIXEL_OP_COPY_TRANSPEN(destp, srcp); }); } -void prio_copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, bitmap_ind8 &priority, u32 pmask, u32 trans_pen) +void prio_copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound, bitmap_ind8 &priority, u32 pmask, u32 trans_pen) { // high bit of the mask is implicitly on pmask |= 1 << 31; @@ -2523,7 +2523,7 @@ void prio_copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, con copyrozbitmap_core(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, priority, [pmask, trans_pen](u16 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_COPY_TRANSPEN_PRIORITY(destp, pri, srcp); }); } -void prio_copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, bitmap_ind8 &priority, u32 pmask, u32 trans_pen) +void prio_copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound, bitmap_ind8 &priority, u32 pmask, u32 trans_pen) { // high bit of the mask is implicitly on pmask |= 1 << 31; @@ -2531,7 +2531,7 @@ void prio_copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, con copyrozbitmap_core(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, priority, [pmask, trans_pen](u32 &destp, u8 &pri, const u32 &srcp) { PIXEL_OP_COPY_TRANSPEN_PRIORITY(destp, pri, srcp); }); } -void primask_copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, u32 trans_pen, bitmap_ind8 &priority, u8 pcode, u8 pmask) +void primask_copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound, u32 trans_pen, bitmap_ind8 &priority, u8 pcode, u8 pmask) { if (pcode == 0 && pmask == 0xff) copyrozbitmap_trans(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, trans_pen); @@ -2539,7 +2539,7 @@ void primask_copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, copyrozbitmap_core(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, priority, [trans_pen, pcode, pmask](u16 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_COPY_TRANSPEN_PRIMASK(destp, pri, srcp); }); } -void primask_copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, u32 trans_pen, bitmap_ind8 &priority, u8 pcode, u8 pmask) +void primask_copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound, u32 trans_pen, bitmap_ind8 &priority, u8 pcode, u8 pmask) { if (pcode == 0 && pmask == 0xff) copyrozbitmap_trans(dest, cliprect, src, startx, starty, incxx, incxy, incyx, incyy, wraparound, trans_pen); diff --git a/src/emu/drawgfx.h b/src/emu/drawgfx.h index 08732a42bfd..164e452b193 100644 --- a/src/emu/drawgfx.h +++ b/src/emu/drawgfx.h @@ -447,24 +447,24 @@ void primask_copyscrollbitmap_trans(bitmap_rgb32 &dest, const bitmap_rgb32 &src, */ // copy from one bitmap to another, with zoom and rotation, copying all unclipped pixels -void copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound); -void copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound); +void copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound); +void copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound); -void prio_copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, bitmap_ind8 &priority, u32 pmask); -void prio_copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, bitmap_ind8 &priority, u32 pmask); +void prio_copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound, bitmap_ind8 &priority, u32 pmask); +void prio_copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound, bitmap_ind8 &priority, u32 pmask); -void primask_copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, bitmap_ind8 &priority, u8 pcode = 0, u8 pmask = 0xff); -void primask_copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, bitmap_ind8 &priority, u8 pcode = 0, u8 pmask = 0xff); +void primask_copyrozbitmap(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound, bitmap_ind8 &priority, u8 pcode = 0, u8 pmask = 0xff); +void primask_copyrozbitmap(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound, bitmap_ind8 &priority, u8 pcode = 0, u8 pmask = 0xff); // copy from one bitmap to another, with zoom and rotation, copying all unclipped pixels whose values do not match transpen -void copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, u32 transparent_color); -void copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, u32 transparent_color); +void copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound, u32 transparent_color); +void copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound, u32 transparent_color); -void prio_copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, bitmap_ind8 &priority, u32 pmask, u32 transparent_color); -void prio_copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, bitmap_ind8 &priority, u32 pmask, u32 transparent_color); +void prio_copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound, bitmap_ind8 &priority, u32 pmask, u32 transparent_color); +void prio_copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound, bitmap_ind8 &priority, u32 pmask, u32 transparent_color); -void primask_copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, u32 transparent_color, bitmap_ind8 &priority, u8 pcode = 0, u8 pmask = 0xff); -void primask_copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, u32 transparent_color, bitmap_ind8 &priority, u8 pcode = 0, u8 pmask = 0xff); +void primask_copyrozbitmap_trans(bitmap_ind16 &dest, const rectangle &cliprect, const bitmap_ind16 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound, u32 transparent_color, bitmap_ind8 &priority, u8 pcode = 0, u8 pmask = 0xff); +void primask_copyrozbitmap_trans(bitmap_rgb32 &dest, const rectangle &cliprect, const bitmap_rgb32 &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound, u32 transparent_color, bitmap_ind8 &priority, u8 pcode = 0, u8 pmask = 0xff); diff --git a/src/emu/drawgfxt.ipp b/src/emu/drawgfxt.ipp index eb4910ebf78..97117ba6cd0 100644 --- a/src/emu/drawgfxt.ipp +++ b/src/emu/drawgfxt.ipp @@ -10,11 +10,11 @@ *********************************************************************/ -#pragma once - #ifndef MAME_EMU_DRAWGFXT_IPP #define MAME_EMU_DRAWGFXT_IPP +#pragma once + /*************************************************************************** PIXEL OPERATIONS @@ -25,7 +25,7 @@ regardless of pen, copying directly -------------------------------------------------*/ -#define PIXEL_OP_COPY_OPAQUE(DEST, SOURCE) \ +#define PIXEL_OP_COPY_OPAQUE(DEST, SOURCE) \ do \ { \ (DEST) = SOURCE; \ @@ -53,7 +53,7 @@ while (0) directly -------------------------------------------------*/ -#define PIXEL_OP_COPY_TRANSPEN(DEST, SOURCE) \ +#define PIXEL_OP_COPY_TRANSPEN(DEST, SOURCE) \ do \ { \ u32 srcdata = (SOURCE); \ @@ -91,7 +91,7 @@ while (0) directly -------------------------------------------------*/ -#define PIXEL_OP_COPY_TRANSALPHA(DEST, SOURCE) \ +#define PIXEL_OP_COPY_TRANSALPHA(DEST, SOURCE) \ do \ { \ u32 srcdata = (SOURCE); \ @@ -129,7 +129,7 @@ while (0) 'paldata' array -------------------------------------------------*/ -#define PIXEL_OP_REMAP_OPAQUE(DEST, SOURCE) \ +#define PIXEL_OP_REMAP_OPAQUE(DEST, SOURCE) \ do \ { \ (DEST) = paldata[SOURCE]; \ @@ -157,7 +157,7 @@ while (0) pen value -------------------------------------------------*/ -#define PIXEL_OP_REBASE_OPAQUE(DEST, SOURCE) \ +#define PIXEL_OP_REBASE_OPAQUE(DEST, SOURCE) \ do \ { \ (DEST) = color + (SOURCE); \ @@ -178,7 +178,7 @@ while (0) pen via the 'paldata' array -------------------------------------------------*/ -#define PIXEL_OP_REMAP_TRANSPEN(DEST, SOURCE) \ +#define PIXEL_OP_REMAP_TRANSPEN(DEST, SOURCE) \ do \ { \ u32 srcdata = (SOURCE); \ @@ -205,7 +205,7 @@ while (0) 'color' to the pen value -------------------------------------------------*/ -#define PIXEL_OP_REBASE_TRANSPEN(DEST, SOURCE) \ +#define PIXEL_OP_REBASE_TRANSPEN(DEST, SOURCE) \ do \ { \ u32 srcdata = (SOURCE); \ @@ -232,7 +232,7 @@ while (0) pen via the 'paldata' array -------------------------------------------------*/ -#define PIXEL_OP_REMAP_TRANSMASK(DEST, SOURCE) \ +#define PIXEL_OP_REMAP_TRANSMASK(DEST, SOURCE) \ do \ { \ u32 srcdata = (SOURCE); \ @@ -259,7 +259,7 @@ while (0) 'color' to the pen value -------------------------------------------------*/ -#define PIXEL_OP_REBASE_TRANSMASK(DEST, SOURCE) \ +#define PIXEL_OP_REBASE_TRANSMASK(DEST, SOURCE) \ do \ { \ u32 srcdata = (SOURCE); \ @@ -296,7 +296,7 @@ while (0) the destination pixel using 'shadowtable' -------------------------------------------------*/ -#define PIXEL_OP_REBASE_TRANSTABLE16(DEST, SOURCE) \ +#define PIXEL_OP_REBASE_TRANSTABLE16(DEST, SOURCE) \ do \ { \ u32 srcdata = (SOURCE); \ @@ -310,7 +310,7 @@ do } \ } \ while (0) -#define PIXEL_OP_REMAP_TRANSTABLE32(DEST, SOURCE) \ +#define PIXEL_OP_REMAP_TRANSTABLE32(DEST, SOURCE) \ do \ { \ u32 srcdata = (SOURCE); \ @@ -377,7 +377,7 @@ while (0) against the destination using 'alpha' -------------------------------------------------*/ -#define PIXEL_OP_REMAP_TRANSPEN_ALPHA32(DEST, SOURCE) \ +#define PIXEL_OP_REMAP_TRANSPEN_ALPHA32(DEST, SOURCE) \ do \ { \ u32 srcdata = (SOURCE); \ @@ -419,7 +419,7 @@ while (0) template -void gfx_element::drawgfx_core(BitmapType &dest, const rectangle &cliprect, u32 code, int flipx, int flipy, s32 destx, s32 desty, FunctionClass pixel_op) +inline void gfx_element::drawgfx_core(BitmapType &dest, const rectangle &cliprect, u32 code, int flipx, int flipy, s32 destx, s32 desty, FunctionClass pixel_op) { g_profiler.start(PROFILER_DRAWGFX); do { @@ -556,7 +556,7 @@ void gfx_element::drawgfx_core(BitmapType &dest, const rectangle &cliprect, u32 template -void gfx_element::drawgfx_core(BitmapType &dest, const rectangle &cliprect, u32 code, int flipx, int flipy, s32 destx, s32 desty, PriorityType &priority, FunctionClass pixel_op) +inline void gfx_element::drawgfx_core(BitmapType &dest, const rectangle &cliprect, u32 code, int flipx, int flipy, s32 destx, s32 desty, PriorityType &priority, FunctionClass pixel_op) { g_profiler.start(PROFILER_DRAWGFX); do { @@ -722,7 +722,7 @@ void gfx_element::drawgfx_core(BitmapType &dest, const rectangle &cliprect, u32 template -void gfx_element::drawgfxzoom_core(BitmapType &dest, const rectangle &cliprect, u32 code, int flipx, int flipy, s32 destx, s32 desty, u32 scalex, u32 scaley, FunctionClass pixel_op) +inline void gfx_element::drawgfxzoom_core(BitmapType &dest, const rectangle &cliprect, u32 code, int flipx, int flipy, s32 destx, s32 desty, u32 scalex, u32 scaley, FunctionClass pixel_op) { g_profiler.start(PROFILER_DRAWGFX); do { @@ -763,10 +763,7 @@ void gfx_element::drawgfxzoom_core(BitmapType &dest, const rectangle &cliprect, // compute final pixel in Y and exit if we are entirely clipped s32 destendy = desty + dstheight - 1; if (desty > cliprect.bottom() || destendy < cliprect.top()) - { - g_profiler.stop(); - return; - } + break; // apply top clip s32 srcy = 0; @@ -838,7 +835,7 @@ void gfx_element::drawgfxzoom_core(BitmapType &dest, const rectangle &cliprect, template -void gfx_element::drawgfxzoom_core(BitmapType &dest, const rectangle &cliprect, u32 code, int flipx, int flipy, s32 destx, s32 desty, u32 scalex, u32 scaley, PriorityType &priority, FunctionClass pixel_op) +inline void gfx_element::drawgfxzoom_core(BitmapType &dest, const rectangle &cliprect, u32 code, int flipx, int flipy, s32 destx, s32 desty, u32 scalex, u32 scaley, PriorityType &priority, FunctionClass pixel_op) { g_profiler.start(PROFILER_DRAWGFX); do { @@ -976,7 +973,7 @@ void gfx_element::drawgfxzoom_core(BitmapType &dest, const rectangle &cliprect, */ template -void copybitmap_core(BitmapType &dest, const BitmapType &src, int flipx, int flipy, s32 destx, s32 desty, const rectangle &cliprect, FunctionClass pixel_op) +inline void copybitmap_core(BitmapType &dest, const BitmapType &src, int flipx, int flipy, s32 destx, s32 desty, const rectangle &cliprect, FunctionClass pixel_op) { g_profiler.start(PROFILER_COPYBITMAP); do { @@ -1116,7 +1113,7 @@ void copybitmap_core(BitmapType &dest, const BitmapType &src, int flipx, int fli template -void copybitmap_core(BitmapType &dest, const BitmapType &src, int flipx, int flipy, s32 destx, s32 desty, const rectangle &cliprect, PriorityType &priority, FunctionClass pixel_op) +inline void copybitmap_core(BitmapType &dest, const BitmapType &src, int flipx, int flipy, s32 destx, s32 desty, const rectangle &cliprect, PriorityType &priority, FunctionClass pixel_op) { g_profiler.start(PROFILER_COPYBITMAP); do { @@ -1279,12 +1276,12 @@ void copybitmap_core(BitmapType &dest, const BitmapType &src, int flipx, int fli s32 incyx - the 16.16 amount to increment in source Y for each destination X pixel s32 incxy - the 16.16 amount to increment in source X for each destination Y pixel s32 incyy - the 16.16 amount to increment in source Y for each destination Y pixel - int wraparound - non-zero means wrap when hitting the edges of the source + bool wraparound - true means wrap when hitting the edges of the source bitmap_t &priority - the priority bitmap (if and only if priority is to be applied) */ template -void copyrozbitmap_core(BitmapType &dest, const rectangle &cliprect, const BitmapType &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, FunctionClass pixel_op) +inline void copyrozbitmap_core(BitmapType &dest, const rectangle &cliprect, const BitmapType &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound, FunctionClass pixel_op) { g_profiler.start(PROFILER_COPYBITMAP); @@ -1545,7 +1542,7 @@ void copyrozbitmap_core(BitmapType &dest, const rectangle &cliprect, const Bitma template -void copyrozbitmap_core(BitmapType &dest, const rectangle &cliprect, const BitmapType &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, int wraparound, PriorityType &priority, FunctionClass pixel_op) +inline void copyrozbitmap_core(BitmapType &dest, const rectangle &cliprect, const BitmapType &src, s32 startx, s32 starty, s32 incxx, s32 incxy, s32 incyx, s32 incyy, bool wraparound, PriorityType &priority, FunctionClass pixel_op) { g_profiler.start(PROFILER_COPYBITMAP); @@ -1835,7 +1832,7 @@ void copyrozbitmap_core(BitmapType &dest, const rectangle &cliprect, const Bitma */ template -void drawscanline_core(BitmapType &bitmap, s32 destx, s32 desty, s32 length, const SourceType *srcptr, FunctionClass pixel_op) +inline void drawscanline_core(BitmapType &bitmap, s32 destx, s32 desty, s32 length, const SourceType *srcptr, FunctionClass pixel_op) { assert(bitmap.valid()); assert(destx >= 0); @@ -1870,7 +1867,7 @@ void drawscanline_core(BitmapType &bitmap, s32 destx, s32 desty, s32 length, con template -void drawscanline_core(BitmapType &bitmap, s32 destx, s32 desty, s32 length, const SourceType *srcptr, PriorityType &priority, FunctionClass pixel_op) +inline void drawscanline_core(BitmapType &bitmap, s32 destx, s32 desty, s32 length, const SourceType *srcptr, PriorityType &priority, FunctionClass pixel_op) { assert(bitmap.valid()); assert(destx >= 0); diff --git a/src/mame/video/psikyosh.cpp b/src/mame/video/psikyosh.cpp index 7b97e5b98e2..beaf8088fdf 100644 --- a/src/mame/video/psikyosh.cpp +++ b/src/mame/video/psikyosh.cpp @@ -76,28 +76,28 @@ static constexpr u32 BG_TRANSPEN = 0x00ff00ff; // used for representing transpar //#define DEBUG_MESSAGE // take ARGB pixel with stored alpha and blend in to RGB32 bitmap -#define PIXEL_OP_COPY_TRANSPEN_ARGBRENDER32(DEST, SOURCE) \ +#define PIXEL_OP_COPY_TRANSPEN_ARGBRENDER32(DEST, SOURCE) \ do \ { \ - const rgb_t srcdata = (SOURCE); \ + const rgb_t srcdata = (SOURCE); \ if (srcdata != transpen) \ - (DEST) = alpha_blend_r32((DEST), srcdata, srcdata.a()); \ + (DEST) = alpha_blend_r32((DEST), srcdata, srcdata.a()); \ } \ while (0) // take RGB pixel with separate alpha and blend in to RGB32 bitmap -#define PIXEL_OP_COPY_TRANSPEN_ALPHARENDER32(DEST, SOURCE) \ +#define PIXEL_OP_COPY_TRANSPEN_ALPHARENDER32(DEST, SOURCE) \ do \ { \ - const u32 srcdata = (SOURCE); \ + const u32 srcdata = (SOURCE); \ if (srcdata != transpen) \ - (DEST) = alpha_blend_r32((DEST), srcdata, alpha); \ + (DEST) = alpha_blend_r32((DEST), srcdata, alpha); \ } \ while (0) // take ARGB pixel with stored alpha and copy in to RGB32 bitmap, scipping BG_TRANSPEN -#define PIXEL_OP_COPY_TRANSPEN_RENDER32(DEST, SOURCE) \ +#define PIXEL_OP_COPY_TRANSPEN_RENDER32(DEST, SOURCE) \ do \ { \ - const u32 srcdata = (SOURCE); \ + const u32 srcdata = (SOURCE); \ if (srcdata != transpen) \ (DEST) = srcdata; \ } \ diff --git a/src/mame/video/realbrk.cpp b/src/mame/video/realbrk.cpp index f05e7f4877e..5edd7558a2c 100644 --- a/src/mame/video/realbrk.cpp +++ b/src/mame/video/realbrk.cpp @@ -288,7 +288,7 @@ void realbrk_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect 0xffff << 16, 1 << 16, 0 << 16, - 0, 0); + false, 0); currx = (sx - (y + 1) * ydim) / 0x10000; curry = (sy + x * xdim) / 0x10000; @@ -302,7 +302,7 @@ void realbrk_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect 0 << 16, 0 << 16, 0xffff << 16, - 0, 0); + false, 0); currx = (sx - (x + 1) * xdim) / 0x10000; curry = (sy - (y + 1) * ydim) / 0x10000; @@ -316,7 +316,7 @@ void realbrk_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect 1 << 16, 0xffff << 16, 0 << 16, - 0, 0); + false, 0); currx = (sx + y * ydim) / 0x10000; curry = (sy - (x + 1) * xdim) / 0x10000; diff --git a/src/mame/video/tatsumi.cpp b/src/mame/video/tatsumi.cpp index 2472576049c..88491e65f59 100644 --- a/src/mame/video/tatsumi.cpp +++ b/src/mame/video/tatsumi.cpp @@ -290,13 +290,13 @@ inline void tatsumi_state::roundupt_drawgfxzoomrotate( _BitmapClass &dest_bmp, c } static void mycopyrozbitmap_core(bitmap_ind8 &bitmap,bitmap_rgb32 &srcbitmap, - int dstx,int dsty, int srcwidth, int srcheight,int incxx,int incxy,int incyx,int incyy, - const rectangle &clip,int transparent_color) + int dstx, int dsty, int srcwidth, int srcheight, int incxx, int incxy, int incyx, int incyy, + const rectangle &clip, int transparent_color) { } static void mycopyrozbitmap_core(bitmap_rgb32 &bitmap,bitmap_rgb32 &srcbitmap, - int dstx,int dsty, int srcwidth, int srcheight,int incxx,int incxy,int incyx,int incyy, - const rectangle &clip,int transparent_color) + int dstx, int dsty, int srcwidth, int srcheight, int incxx, int incxy, int incyx, int incyy, + const rectangle &clip, int transparent_color) { uint32_t cx; uint32_t cy; diff --git a/src/mame/video/tc0080vco.cpp b/src/mame/video/tc0080vco.cpp index e935ed2264c..fdba11c01cd 100644 --- a/src/mame/video/tc0080vco.cpp +++ b/src/mame/video/tc0080vco.cpp @@ -710,7 +710,7 @@ void tc0080vco_device::bg1_tilemap_draw(screen_device &screen, bitmap_ind16 &bit sy = (( 0x3fe - m_scroll_ram[layer + 3]) << 16) - (max_y + min_y) * (zy - 0x10000); } - copyrozbitmap_core(bitmap, cliprect, srcbitmap, sx, sy, zx, 0, 0, zy, 0, screen.priority(), [privalue = priority, primask = pmask](u16 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_COPY_TRANS0_SET_PRIORITY(destp, pri, srcp); }); + copyrozbitmap_core(bitmap, cliprect, srcbitmap, sx, sy, zx, 0, 0, zy, false, screen.priority(), [privalue = priority, primask = pmask](u16 &destp, u8 &pri, const u16 &srcp) { PIXEL_OP_COPY_TRANS0_SET_PRIORITY(destp, pri, srcp); }); } } diff --git a/src/mame/video/tunhunt.cpp b/src/mame/video/tunhunt.cpp index b88da89c78a..04cb025ede8 100644 --- a/src/mame/video/tunhunt.cpp +++ b/src/mame/video/tunhunt.cpp @@ -209,58 +209,52 @@ void tunhunt_state::draw_motion_object(bitmap_ind16 &bitmap, const rectangle &cl bitmap_ind16 &tmpbitmap = m_tmpbitmap; //int skip = m_workram[MOBST]; - int x0 = 255-m_workram[MOBJV]; - int y0 = 255-m_workram[MOBJH]; - int scalex,scaley; - int line,span; - int x,span_data; - int color; - int count; - const uint8_t *source; + const int x0 = 255 - m_workram[MOBJV]; + const int y0 = 255 - m_workram[MOBJH]; - for( line=0; line<64; line++ ) + for (int line = 0; line < 64; line++) { - x = 0; - source = &m_spriteram[line*0x10]; - for( span=0; span<0x10; span++ ) + int x = 0; + const uint8_t *const source = &m_spriteram[line * 0x10]; + for (int span = 0; span < 0x10; span++) { - span_data = source[span]; - if( span_data == 0xff ) break; - color = ((span_data>>6)&0x3)^0x3; - count = (span_data&0x1f)+1; - while( count-- && x < 256 ) + const int span_data = source[span]; + if (span_data == 0xff) break; + const int color = ((span_data >> 6) & 0x3) ^ 0x3; + int count = (span_data & 0x1f) + 1; + while (count-- && x < 256) tmpbitmap.pix16(line, x++) = color; } - while( x<256 ) + while (x < 256) tmpbitmap.pix16(line, x++) = 0; - } /* next line */ + } - switch( m_workram[VSTRLO] ) + int scaley; + switch (m_workram[VSTRLO]) { case 0x01: - scaley = (1<<16)*0.33; /* seems correct */ + scaley = (1 << 16) * 0.33; // seems correct break; case 0x02: - scaley = (1<<16)*0.50; /* seems correct */ + scaley = (1 << 16) * 0.50; // seems correct break; default: - scaley = (1<<16)*m_workram[VSTRLO]/4; /* ??? */ + scaley = (1 << 16) * m_workram[VSTRLO] / 4; // ??? break; } - scalex = (1<<16); + const int scalex = 1 << 16; copyrozbitmap_trans( - bitmap,cliprect,tmpbitmap, - -x0*scalex,/* startx */ - -y0*scaley,/* starty */ - scalex,/* incxx */ - 0,0,/* incxy,incyx */ - scaley,/* incyy */ - 0, /* no wraparound */ - 0 - ); + bitmap, cliprect, tmpbitmap, + -x0 * scalex, // startx + -y0 * scaley, // starty + scalex, // incxx + 0, 0, // incxy, incyx + scaley, // incyy + false, // no wraparound + 0); } void tunhunt_state::draw_box(bitmap_ind16 &bitmap, const rectangle &cliprect) -- cgit v1.2.3