From 11bc615618810dd71751e46a15a0cd490289e6e5 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 15 Feb 2023 05:36:20 +1100 Subject: snk/hng64.cpp: Generate X offsets at compile time. --- src/devices/bus/msx/slot/cartridge.h | 1 - src/mame/snk/hng64.cpp | 16 +++++++--------- src/mame/snk/hng64.h | 3 --- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/devices/bus/msx/slot/cartridge.h b/src/devices/bus/msx/slot/cartridge.h index 50c97aca3d2..aef5fbdfe1f 100644 --- a/src/devices/bus/msx/slot/cartridge.h +++ b/src/devices/bus/msx/slot/cartridge.h @@ -6,7 +6,6 @@ #pragma once #include "slot.h" -#include "bus/generic/slot.h" #include "bus/msx/cart/cartridge.h" #include "imagedev/cartrom.h" diff --git a/src/mame/snk/hng64.cpp b/src/mame/snk/hng64.cpp index e7ff600b22d..c8aed843e2a 100644 --- a/src/mame/snk/hng64.cpp +++ b/src/mame/snk/hng64.cpp @@ -1722,17 +1722,15 @@ static const gfx_layout hng64_16x16x8_spritelayout = static const uint32_t texlayout_xoffset[1024] = { STEP1024(0,8) }; static const uint32_t texlayout_yoffset[1024] = { STEP1024(0,8192) }; -static uint32_t texlayout_xoffset_4[1024]; -static const uint32_t texlayout_yoffset_4[1024] = { STEP1024(0,4096) }; - -void hng64_state::texlayout_xoffset_4_create() +template +static auto const &texlayout_xoffset_4(std::integer_sequence) { - for (int i = 0; i < 1024; i++) - { - texlayout_xoffset_4[i] = (i * 4) ^ 4; - } + static constexpr uint32_t const s_values[sizeof...(Values)] = { ((Values * 4) ^ 4)... }; + return s_values; } +static const uint32_t texlayout_yoffset_4[1024] = { STEP1024(0,4096) }; + static const gfx_layout hng64_1024x1024x8_texlayout = { @@ -1756,7 +1754,7 @@ static const gfx_layout hng64_1024x1024x4_texlayout = EXTENDED_XOFFS, EXTENDED_YOFFS, 1024*1024*4, - texlayout_xoffset_4, + texlayout_xoffset_4(std::make_integer_sequence()), texlayout_yoffset_4 }; diff --git a/src/mame/snk/hng64.h b/src/mame/snk/hng64.h index 94fbc65dc50..931dfafdf3d 100644 --- a/src/mame/snk/hng64.h +++ b/src/mame/snk/hng64.h @@ -166,7 +166,6 @@ public: m_samsho64_3d_hack(0), m_roadedge_3d_hack(0) { - texlayout_xoffset_4_create(); } void hng64(machine_config &config); @@ -182,8 +181,6 @@ public: void init_ss64(); void init_hng64_fght(); - static void texlayout_xoffset_4_create(); - uint8_t *m_texturerom = nullptr; required_device m_screen; required_device m_palette; -- cgit v1.2.3