From efdb9a072f84e1da7ff40f15fbdb13e20b808480 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 26 Sep 2021 15:26:25 +1000 Subject: [PATCH] Actually stage the fix to validity.cpp, clean up video/kikikai.cpp a little, srcclean latest PRs. --- src/devices/bus/nes/nes_slot.h | 2 +- src/emu/validity.cpp | 2 +- src/mame/video/kikikai.cpp | 55 ++++++++++++++-------------------- 3 files changed, 25 insertions(+), 34 deletions(-) diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h index 8ddb7d15ce9..23057b9c6c5 100644 --- a/src/devices/bus/nes/nes_slot.h +++ b/src/devices/bus/nes/nes_slot.h @@ -175,7 +175,7 @@ enum class device_nes_cart_interface : public device_interface { public: - enum class mmc1_type : u8 { MMC1, MMC1A, MMC1B, MMC1C }; + enum class mmc1_type : u8 { MMC1, MMC1A, MMC1B, MMC1C }; // construction/destruction virtual ~device_nes_cart_interface(); diff --git a/src/emu/validity.cpp b/src/emu/validity.cpp index 3ead00ec99f..ca3389cde41 100644 --- a/src/emu/validity.cpp +++ b/src/emu/validity.cpp @@ -1410,7 +1410,7 @@ void validate_delegates_mfp() osd_printf_error("Error testing delegate this pointer adjustment for incomplete class %p -> %p (expected %p)\n", static_cast(&d), addr, static_cast(static_cast(&d))); // test MSVC extension allowing casting member pointer types across virtual inheritance relationships -#if defined(_MSC_VER) +#if defined(_MSC_VER) && !defined(__clang__) cb1 = make_diamond_class_delegate(&diamond_inheritance::get_base, &d); addr = nullptr; diff --git a/src/mame/video/kikikai.cpp b/src/mame/video/kikikai.cpp index 580b50700c8..6e3f96011e7 100644 --- a/src/mame/video/kikikai.cpp +++ b/src/mame/video/kikikai.cpp @@ -18,72 +18,63 @@ void kikikai_state::main_bankswitch_w(uint8_t data) uint32_t kikikai_state::screen_update_kicknrun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - int offs; - int sx, sy, xc, yc; - int gfx_num, gfx_attr, gfx_offs; - - - // Similar as bublbobl.cpp, Video hardware generates sprite only. + // Similar to bublbobl.cpp, Video hardware generates sprites only. bitmap.fill(255, cliprect); - sx = 0; + int sx = 0; - /* the score display seems to be outside of the main objectram. */ - for (offs = 0x1500; offs < 0x2000; offs += 4) + // the score display seems to be outside of the main objectram + for (int offs = 0x1500; offs < 0x2000; offs += 4) { - int height; - if (offs >= 0x1800 && offs < 0x1980) continue; if (offs >= 0x19c0) continue; - /* skip empty sprites */ - /* this is dword aligned so the uint32_t * cast shouldn't give problems */ - /* on any architecture */ + // skip empty sprites + // this is dword aligned so the uint32_t * cast shouldn't give problems on any architecture if (*(uint32_t *)(&m_mainram[offs]) == 0) continue; - gfx_num = m_mainram[offs + 1]; - gfx_attr = m_mainram[offs + 3]; + const int gfx_num = m_mainram[offs + 1]; + const int gfx_attr = m_mainram[offs + 3]; - if (!BIT(gfx_num, 7)) /* 16x16 sprites */ + int gfx_offs, height; + if (!BIT(gfx_num, 7)) // 16x16 sprites { gfx_offs = ((gfx_num & 0x1f) * 0x80) + ((gfx_num & 0x60) >> 1) + 12; height = 2; } - else /* tilemaps (each sprite is a 16x256 column) */ + else // tilemaps (each sprite is a 16x256 column) { gfx_offs = ((gfx_num & 0x3f) * 0x80); height = 32; } - if ((gfx_num & 0xc0) == 0xc0) /* next column */ + if ((gfx_num & 0xc0) == 0xc0) // next column sx += 16; else { sx = m_mainram[offs + 2]; //if (gfx_attr & 0x40) sx -= 256; } - sy = 256 - height * 8 - (m_mainram[offs + 0]); + const int sy = 256 - height * 8 - (m_mainram[offs + 0]); - for (xc = 0; xc < 2; xc++) + for (int xc = 0; xc < 2; xc++) { - for (yc = 0; yc < height; yc++) + for (int yc = 0; yc < height; yc++) { - int goffs, code, color, flipx, flipy, x, y; - - goffs = gfx_offs + xc * 0x40 + yc * 0x02; - code = m_mainram[goffs] + ((m_mainram[goffs + 1] & 0x07) << 8) + const int goffs = gfx_offs + xc * 0x40 + yc * 0x02; + const int code = m_mainram[goffs] + ((m_mainram[goffs + 1] & 0x07) << 8) + ((m_mainram[goffs + 1] & 0x80) << 4) + (m_charbank << 12); - color = ((m_mainram[goffs + 1] & 0x38) >> 3) + ((gfx_attr & 0x02) << 2); - flipx = m_mainram[goffs + 1] & 0x40; - flipy = 0; + const int color = ((m_mainram[goffs + 1] & 0x38) >> 3) + ((gfx_attr & 0x02) << 2); + const int flipx = m_mainram[goffs + 1] & 0x40; + const int flipy = 0; - //x = sx + xc * 8; - x = (sx + xc * 8) & 0xff; - y = (sy + yc * 8) & 0xff; + //const int x = sx + xc * 8; + const int x = (sx + xc * 8) & 0xff; + const int y = (sy + yc * 8) & 0xff; m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, code,