snk/hng64.cpp: Generate X offsets at compile time.

This commit is contained in:
Vas Crabb 2023-02-15 05:36:20 +11:00
parent 5221ebfbe6
commit 11bc615618
3 changed files with 7 additions and 13 deletions

View File

@ -6,7 +6,6 @@
#pragma once
#include "slot.h"
#include "bus/generic/slot.h"
#include "bus/msx/cart/cartridge.h"
#include "imagedev/cartrom.h"

View File

@ -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 <uint32_t... Values>
static auto const &texlayout_xoffset_4(std::integer_sequence<uint32_t, Values...>)
{
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<uint32_t, 1024>()),
texlayout_yoffset_4
};

View File

@ -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<screen_device> m_screen;
required_device<palette_device> m_palette;