mirror of
https://github.com/holub/mame
synced 2025-04-19 15:11:37 +03:00
Work around older versions of libc++, tidy up some recent changes.
This commit is contained in:
parent
7fe2e41f0f
commit
42391bbb6b
@ -14,6 +14,8 @@
|
||||
|
||||
#include "mn1610d.h"
|
||||
|
||||
namespace {
|
||||
|
||||
char const *const reg[] = { "r0", "r1", "r2", "r3", "r4", "sp", "str", "ic" };
|
||||
|
||||
enum operand_type : unsigned
|
||||
@ -54,7 +56,7 @@ struct instruction
|
||||
u32 flags;
|
||||
};
|
||||
|
||||
static const struct instruction mn1610_table[] =
|
||||
const struct instruction mn1610_table[] =
|
||||
{
|
||||
// memory
|
||||
{ 0xc700, 0xc700, "b", { EA } }, // 11mm m111 nnnn nnnn
|
||||
@ -109,7 +111,7 @@ static const struct instruction mn1610_table[] =
|
||||
};
|
||||
|
||||
// opcodes are sorted in descending order of number of bits in mask to ensure correct decoding
|
||||
static const struct instruction mn1613_table[] =
|
||||
const struct instruction mn1613_table[] =
|
||||
{
|
||||
{ 0x1707, 0xffff, "popm", { } }, // 0001 0111 0000 0111
|
||||
{ 0x170f, 0xffff, "pshm", { } }, // 0001 0111 0000 1111
|
||||
@ -195,6 +197,9 @@ static const struct instruction mn1613_table[] =
|
||||
{ 0x1f00, 0xff00, "neg", { Rs, C, SK } }, // 0001 1111 kkkk cddd
|
||||
};
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
std::optional<std::string> mn1610_disassembler::operand(unsigned t, u16 pc, u16 data)
|
||||
{
|
||||
char const *const ee[] = { nullptr, "re", "se", "ce" };
|
||||
|
@ -1196,16 +1196,16 @@ void pokey_device::poly_init_9_17(uint32_t *poly, int size)
|
||||
{
|
||||
LOG_RAND(("rand %d\n", size));
|
||||
|
||||
int mask = (1 << size) - 1;
|
||||
const uint32_t mask = util::make_bitmask<uint32_t>(size);
|
||||
uint32_t lfsr = mask;
|
||||
|
||||
if (size == 17)
|
||||
{
|
||||
for (int i = 0; i < mask; i++)
|
||||
for (uint32_t i = 0; i < mask; i++)
|
||||
{
|
||||
/* calculate next bit @ 7 */
|
||||
int in8 = ((lfsr >> 8) & 1) ^ ((lfsr >> 13) & 1);
|
||||
int in = (lfsr & 1);
|
||||
// calculate next bit @ 7
|
||||
const uint32_t in8 = BIT(lfsr, 8) ^ BIT(lfsr, 13);
|
||||
const uint32_t in = BIT(lfsr, 0);
|
||||
lfsr = lfsr >> 1;
|
||||
lfsr = (lfsr & 0xff7f) | (in8 << 7);
|
||||
lfsr = (in << 16) | lfsr;
|
||||
@ -1216,10 +1216,10 @@ void pokey_device::poly_init_9_17(uint32_t *poly, int size)
|
||||
}
|
||||
else // size == 9
|
||||
{
|
||||
for (int i = 0; i < mask; i++)
|
||||
for (uint32_t i = 0; i < mask; i++)
|
||||
{
|
||||
/* calculate next bit */
|
||||
int in = ((lfsr >> 0) & 1) ^ ((lfsr >> 5) & 1);
|
||||
// calculate next bit
|
||||
const uint32_t in = BIT(lfsr, 0) ^ BIT(lfsr, 5);
|
||||
lfsr = lfsr >> 1;
|
||||
lfsr = (in << 8) | lfsr;
|
||||
*poly = lfsr;
|
||||
|
@ -6,6 +6,16 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
// older versions of libc++ are missing deduction guides that the things using this require
|
||||
// FIXME: find a better place to put this
|
||||
#if defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION < 10000)
|
||||
namespace std { inline namespace __1 {
|
||||
template<class R, class... ArgTypes > function( R(*)(ArgTypes...) ) -> function<R(ArgTypes...)>;
|
||||
} }
|
||||
#endif
|
||||
|
||||
|
||||
extern offs_t mac68k_dasm_override(std::ostream &stream, offs_t pc, const util::disasm_interface::data_buffer &opcodes, const util::disasm_interface::data_buffer ¶ms);
|
||||
|
||||
#endif // MAME_APPLE_MACTOOLBOX_H
|
||||
|
@ -113,7 +113,7 @@ private:
|
||||
required_shared_ptr<u16> m_textram;
|
||||
required_shared_ptr<u16> m_spriteram;
|
||||
|
||||
required_memory_region m_spritegfx;
|
||||
required_region_ptr<u8> m_spritegfx;
|
||||
|
||||
// video-related
|
||||
tilemap_t *m_fg_tilemap = nullptr;
|
||||
@ -353,8 +353,6 @@ void deniamc_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, co
|
||||
{
|
||||
for (int offs = m_spriteram.bytes() / 2 - 8; offs >= 0; offs -= 8)
|
||||
{
|
||||
u8 *rom = m_spritegfx->base();
|
||||
|
||||
int sx = (m_spriteram[offs + 1] & 0x01ff) + 16 * 8 - 1;
|
||||
if (sx >= 512) sx -= 512;
|
||||
const int starty = m_spriteram[offs + 0] & 0xff;
|
||||
@ -376,7 +374,7 @@ void deniamc_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, co
|
||||
}
|
||||
|
||||
const int start = m_spriteram[offs + 3] + ((m_spriteram[offs + 4] & 0x1f00) << 8);
|
||||
rom += 2 * start;
|
||||
const u8 *rom = &m_spritegfx[2 * start];
|
||||
|
||||
for (int y = starty + 1; y <= endy; y++)
|
||||
{
|
||||
|
@ -390,7 +390,7 @@ void chaknpop_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec
|
||||
}
|
||||
|
||||
|
||||
m_gfxdecode->gfx(0)->transpen(bitmap, cliprect,
|
||||
m_gfxdecode->gfx(0)->transpen(bitmap, cliprect,
|
||||
tile,
|
||||
color,
|
||||
flipx, flipy,
|
||||
|
Loading…
Reference in New Issue
Block a user