mirror of
https://github.com/holub/mame
synced 2025-04-18 22:49:58 +03:00
Introduce u8/u16/u32/u64/s8/s16/s32/s64
* New abbreviated types are in osd and util namespaces, and also in global namespace for things that #include "emu.h" * Get rid of import of cstdint types to global namespace (C99 does this anyway) * Remove the cstdint types from everything in emu * Get rid of U64/S64 macros * Fix a bug in dps16 caused by incorrect use of macro * Fix debugcon not checking for "do " prefix case-insensitively * Fix a lot of messed up tabulation * More constexpr * Fix up many __names
This commit is contained in:
parent
1b489fe830
commit
8179a84458
24
3rdparty/softfloat/fpu_constant.h
vendored
24
3rdparty/softfloat/fpu_constant.h
vendored
@ -37,11 +37,11 @@ these four paragraphs for those parts of this code that are retained.
|
||||
|
||||
// 128-bit PI fraction
|
||||
#ifdef BETTER_THAN_PENTIUM
|
||||
#define FLOAT_PI_HI (U64(0xc90fdaa22168c234))
|
||||
#define FLOAT_PI_LO (U64(0xc4c6628b80dc1cd1))
|
||||
#define FLOAT_PI_HI (0xc90fdaa22168c234U)
|
||||
#define FLOAT_PI_LO (0xc4c6628b80dc1cd1U)
|
||||
#else
|
||||
#define FLOAT_PI_HI (U64(0xc90fdaa22168c234))
|
||||
#define FLOAT_PI_LO (U64(0xC000000000000000))
|
||||
#define FLOAT_PI_HI (0xc90fdaa22168c234U)
|
||||
#define FLOAT_PI_LO (0xC000000000000000U)
|
||||
#endif
|
||||
|
||||
#define FLOATX80_PI2_EXP (0x3FFF)
|
||||
@ -55,11 +55,11 @@ these four paragraphs for those parts of this code that are retained.
|
||||
|
||||
// 128-bit 3PI/4 fraction
|
||||
#ifdef BETTER_THAN_PENTIUM
|
||||
#define FLOAT_3PI4_HI (U64(0x96cbe3f9990e91a7))
|
||||
#define FLOAT_3PI4_LO (U64(0x9394c9e8a0a5159c))
|
||||
#define FLOAT_3PI4_HI (0x96cbe3f9990e91a7U)
|
||||
#define FLOAT_3PI4_LO (0x9394c9e8a0a5159cU)
|
||||
#else
|
||||
#define FLOAT_3PI4_HI (U64(0x96cbe3f9990e91a7))
|
||||
#define FLOAT_3PI4_LO (U64(0x9000000000000000))
|
||||
#define FLOAT_3PI4_HI (0x96cbe3f9990e91a7U)
|
||||
#define FLOAT_3PI4_LO (0x9000000000000000U)
|
||||
#endif
|
||||
|
||||
//////////////////////////////
|
||||
@ -70,11 +70,11 @@ these four paragraphs for those parts of this code that are retained.
|
||||
|
||||
// 128-bit 1/LN2 fraction
|
||||
#ifdef BETTER_THAN_PENTIUM
|
||||
#define FLOAT_LN2INV_HI (U64(0xb8aa3b295c17f0bb))
|
||||
#define FLOAT_LN2INV_LO (U64(0xbe87fed0691d3e89))
|
||||
#define FLOAT_LN2INV_HI (0xb8aa3b295c17f0bbU)
|
||||
#define FLOAT_LN2INV_LO (0xbe87fed0691d3e89U)
|
||||
#else
|
||||
#define FLOAT_LN2INV_HI (U64(0xb8aa3b295c17f0bb))
|
||||
#define FLOAT_LN2INV_LO (U64(0xC000000000000000))
|
||||
#define FLOAT_LN2INV_HI (0xb8aa3b295c17f0bbU)
|
||||
#define FLOAT_LN2INV_LO (0xC000000000000000U)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
12
3rdparty/softfloat/fsincos.c
vendored
12
3rdparty/softfloat/fsincos.c
vendored
@ -31,8 +31,8 @@ these four paragraphs for those parts of this code that are retained.
|
||||
//#include "softfloat-specialize"
|
||||
#include "fpu_constant.h"
|
||||
|
||||
static const floatx80 floatx80_one = packFloatx80(0, 0x3fff, U64(0x8000000000000000));
|
||||
static const floatx80 floatx80_default_nan = packFloatx80(0, 0xffff, U64(0xffffffffffffffff));
|
||||
static const floatx80 floatx80_one = packFloatx80(0, 0x3fff, 0x8000000000000000U);
|
||||
static const floatx80 floatx80_default_nan = packFloatx80(0, 0xffff, 0xffffffffffffffffU);
|
||||
|
||||
#define packFloat2x128m(zHi, zLo) {(zHi), (zLo)}
|
||||
#define PACK_FLOAT_128(hi,lo) packFloat2x128m(LIT64(hi),LIT64(lo))
|
||||
@ -83,7 +83,7 @@ INLINE floatx80 propagateFloatx80NaNOneArg(floatx80 a)
|
||||
if (floatx80_is_signaling_nan(a))
|
||||
float_raise(float_flag_invalid);
|
||||
|
||||
a.low |= U64(0xC000000000000000);
|
||||
a.low |= 0xC000000000000000U;
|
||||
|
||||
return a;
|
||||
}
|
||||
@ -322,7 +322,7 @@ int sf_fsincos(floatx80 a, floatx80 *sin_a, floatx80 *cos_a)
|
||||
// float_raise(float_flag_denormal);
|
||||
|
||||
/* handle pseudo denormals */
|
||||
if (! (aSig0 & U64(0x8000000000000000)))
|
||||
if (! (aSig0 & 0x8000000000000000U))
|
||||
{
|
||||
float_raise(float_flag_inexact);
|
||||
if (sin_a)
|
||||
@ -435,7 +435,7 @@ int floatx80_ftan(floatx80 &a)
|
||||
if (aSig0 == 0) return 0;
|
||||
// float_raise(float_flag_denormal);
|
||||
/* handle pseudo denormals */
|
||||
if (! (aSig0 & U64(0x8000000000000000)))
|
||||
if (! (aSig0 & 0x8000000000000000U))
|
||||
{
|
||||
float_raise(float_flag_inexact | float_flag_underflow);
|
||||
return 0;
|
||||
@ -616,7 +616,7 @@ floatx80 floatx80_scale(floatx80 a, floatx80 b)
|
||||
}
|
||||
if (aSig && (aExp == 0)) float_raise(float_flag_denormal);
|
||||
if (bSign) return packFloatx80(aSign, 0, 0);
|
||||
return packFloatx80(aSign, 0x7FFF, U64(0x8000000000000000));
|
||||
return packFloatx80(aSign, 0x7FFF, 0x8000000000000000U);
|
||||
}
|
||||
if (aExp == 0) {
|
||||
if (aSig == 0) return a;
|
||||
|
34
3rdparty/softfloat/fyl2x.c
vendored
34
3rdparty/softfloat/fyl2x.c
vendored
@ -32,10 +32,10 @@ these four paragraphs for those parts of this code that are retained.
|
||||
//#include "softfloat-specialize"
|
||||
#include "fpu_constant.h"
|
||||
|
||||
static const floatx80 floatx80_log10_2 = packFloatx80(0, 0x3ffd, U64(0x9a209a84fbcff798));
|
||||
static const floatx80 floatx80_ln_2 = packFloatx80(0, 0x3ffe, U64(0xb17217f7d1cf79ac));
|
||||
static const floatx80 floatx80_one = packFloatx80(0, 0x3fff, U64(0x8000000000000000));
|
||||
static const floatx80 floatx80_default_nan = packFloatx80(0, 0xffff, U64(0xffffffffffffffff));
|
||||
static const floatx80 floatx80_log10_2 = packFloatx80(0, 0x3ffd, 0x9a209a84fbcff798U);
|
||||
static const floatx80 floatx80_ln_2 = packFloatx80(0, 0x3ffe, 0xb17217f7d1cf79acU);
|
||||
static const floatx80 floatx80_one = packFloatx80(0, 0x3fff, 0x8000000000000000U);
|
||||
static const floatx80 floatx80_default_nan = packFloatx80(0, 0xffff, 0xffffffffffffffffU);
|
||||
|
||||
#define packFloat_128(zHi, zLo) {(zHi), (zLo)}
|
||||
#define PACK_FLOAT_128(hi,lo) packFloat_128(LIT64(hi),LIT64(lo))
|
||||
@ -87,7 +87,7 @@ INLINE floatx80 propagateFloatx80NaNOneArg(floatx80 a)
|
||||
if (floatx80_is_signaling_nan(a))
|
||||
float_raise(float_flag_invalid);
|
||||
|
||||
a.low |= U64(0xC000000000000000);
|
||||
a.low |= 0xC000000000000000U;
|
||||
|
||||
return a;
|
||||
}
|
||||
@ -130,8 +130,8 @@ static floatx80 propagateFloatx80NaN(floatx80 a, floatx80 b)
|
||||
int aIsSignalingNaN = floatx80_is_signaling_nan(a);
|
||||
int bIsNaN = floatx80_is_nan(b);
|
||||
int bIsSignalingNaN = floatx80_is_signaling_nan(b);
|
||||
a.low |= U64(0xC000000000000000);
|
||||
b.low |= U64(0xC000000000000000);
|
||||
a.low |= 0xC000000000000000U;
|
||||
b.low |= 0xC000000000000000U;
|
||||
if (aIsSignalingNaN | bIsSignalingNaN) float_raise(float_flag_invalid);
|
||||
if (aIsSignalingNaN) {
|
||||
if (bIsSignalingNaN) goto returnLargerSignificand;
|
||||
@ -150,14 +150,14 @@ static floatx80 propagateFloatx80NaN(floatx80 a, floatx80 b)
|
||||
}
|
||||
|
||||
static const float128 float128_one =
|
||||
packFloat_128(U64(0x3fff000000000000), U64(0x0000000000000000));
|
||||
packFloat_128(0x3fff000000000000U, 0x0000000000000000U);
|
||||
static const float128 float128_two =
|
||||
packFloat_128(U64(0x4000000000000000), U64(0x0000000000000000));
|
||||
packFloat_128(0x4000000000000000U, 0x0000000000000000U);
|
||||
|
||||
static const float128 float128_ln2inv2 =
|
||||
packFloat_128(U64(0x400071547652b82f), U64(0xe1777d0ffda0d23a));
|
||||
packFloat_128(0x400071547652b82fU, 0xe1777d0ffda0d23aU);
|
||||
|
||||
#define SQRT2_HALF_SIG U64(0xb504f333f9de6484)
|
||||
#define SQRT2_HALF_SIG 0xb504f333f9de6484U
|
||||
|
||||
extern float128 OddPoly(float128 x, float128 *arr, unsigned n);
|
||||
|
||||
@ -279,7 +279,7 @@ invalid:
|
||||
if (bSig == 0) goto invalid;
|
||||
float_raise(float_flag_denormal);
|
||||
}
|
||||
return packFloatx80(bSign, 0x7FFF, U64(0x8000000000000000));
|
||||
return packFloatx80(bSign, 0x7FFF, 0x8000000000000000U);
|
||||
}
|
||||
}
|
||||
if (bExp == 0x7FFF)
|
||||
@ -289,16 +289,16 @@ invalid:
|
||||
if (aSig && (aExp == 0))
|
||||
float_raise(float_flag_denormal);
|
||||
if (aExp < 0x3FFF) {
|
||||
return packFloatx80(zSign, 0x7FFF, U64(0x8000000000000000));
|
||||
return packFloatx80(zSign, 0x7FFF, 0x8000000000000000U);
|
||||
}
|
||||
if (aExp == 0x3FFF && ((uint64_t) (aSig<<1) == 0)) goto invalid;
|
||||
return packFloatx80(bSign, 0x7FFF, U64(0x8000000000000000));
|
||||
return packFloatx80(bSign, 0x7FFF, 0x8000000000000000U);
|
||||
}
|
||||
if (aExp == 0) {
|
||||
if (aSig == 0) {
|
||||
if ((bExp | bSig) == 0) goto invalid;
|
||||
float_raise(float_flag_divbyzero);
|
||||
return packFloatx80(zSign, 0x7FFF, U64(0x8000000000000000));
|
||||
return packFloatx80(zSign, 0x7FFF, 0x8000000000000000U);
|
||||
}
|
||||
if (aSign) goto invalid;
|
||||
float_raise(float_flag_denormal);
|
||||
@ -393,7 +393,7 @@ invalid:
|
||||
if (bSig == 0) goto invalid;
|
||||
float_raise(float_flag_denormal);
|
||||
}
|
||||
return packFloatx80(bSign, 0x7FFF, U64(0x8000000000000000));
|
||||
return packFloatx80(bSign, 0x7FFF, 0x8000000000000000U);
|
||||
}
|
||||
}
|
||||
if (bExp == 0x7FFF)
|
||||
@ -406,7 +406,7 @@ invalid:
|
||||
float_raise(float_flag_denormal);
|
||||
}
|
||||
|
||||
return packFloatx80(zSign, 0x7FFF, U64(0x8000000000000000));
|
||||
return packFloatx80(zSign, 0x7FFF, 0x8000000000000000U);
|
||||
}
|
||||
if (aExp == 0) {
|
||||
if (aSig == 0) {
|
||||
|
@ -216,7 +216,7 @@ public:
|
||||
}
|
||||
|
||||
void install_device(offs_t start, offs_t end, read8_delegate rhandler, write8_delegate whandler);
|
||||
template<typename T> void install_device(offs_t addrstart, offs_t addrend, T &device, void (T::*map)(class address_map &map), int bits = 8, uint64_t unitmask = U64(0xffffffffffffffff))
|
||||
template<typename T> void install_device(offs_t addrstart, offs_t addrend, T &device, void (T::*map)(class address_map &map), int bits = 8, uint64_t unitmask = 0xffffffffffffffffU)
|
||||
{
|
||||
m_iospace->install_device(addrstart, addrend, device, map, bits, unitmask);
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ READ8_MEMBER(msx_cart_sfg::read_cart)
|
||||
|
||||
if (offset < 0x8000)
|
||||
{
|
||||
return m_region_sfg->u8(offset & m_rom_mask);
|
||||
return m_region_sfg->as_u8(offset & m_rom_mask);
|
||||
}
|
||||
|
||||
return 0xff;
|
||||
|
@ -108,7 +108,7 @@ public:
|
||||
void rom_alloc(uint32_t size) { m_rom.resize(size/sizeof(uint16_t)); }
|
||||
uint16_t* get_rom_base() { return &m_rom[0]; }
|
||||
uint32_t get_rom_size() { return m_rom.size() * sizeof(uint16_t); }
|
||||
uint16_t* get_region_rom_base() { if (m_region_rom.found()) return &m_region_rom->u16(0); return nullptr; }
|
||||
uint16_t* get_region_rom_base() { if (m_region_rom.found()) return &m_region_rom->as_u16(0); return nullptr; }
|
||||
uint32_t get_region_rom_size() { if (m_region_rom.found()) return m_region_rom->bytes(); return 0; }
|
||||
|
||||
void fixed_alloc(uint32_t size) { m_fixed.resize(size); }
|
||||
|
@ -765,7 +765,7 @@ void sns_sa1_device::write_regs(address_space &space, uint32_t offset, uint8_t d
|
||||
case 2: //sigma (accumulative multiplication)
|
||||
case 3:
|
||||
uint64_t acum = (int16_t)m_math_a * (int16_t)m_math_b;
|
||||
uint64_t mask = U64(0xffffffffff);
|
||||
uint64_t mask = 0xffffffffffU;
|
||||
m_math_res += acum;
|
||||
m_math_overflow = (m_math_res > mask) ? 0x80 : 0;
|
||||
m_math_res &= mask;
|
||||
|
@ -117,7 +117,7 @@ READ8_MEMBER( sv603_device::mreq_r )
|
||||
if (offset >= 0x8000 && offset < 0xa000)
|
||||
{
|
||||
m_expander->ramdis_w(0);
|
||||
return m_bios->u8(offset & 0x1fff);
|
||||
return m_bios->as_u8(offset & 0x1fff);
|
||||
}
|
||||
|
||||
return 0xff;
|
||||
|
@ -98,7 +98,7 @@ MC6845_UPDATE_ROW( sv806_device::crtc_update_row )
|
||||
|
||||
for (int i = 0; i < x_count; i++)
|
||||
{
|
||||
uint8_t data = m_gfx->u8((m_ram[(ma + i) & 0x7ff] << 4) | ra);
|
||||
uint8_t data = m_gfx->as_u8((m_ram[(ma + i) & 0x7ff] << 4) | ra);
|
||||
|
||||
if (i == cursor_x)
|
||||
data = 0xff;
|
||||
|
@ -1362,7 +1362,7 @@ void arm7_cpu_device::saturate_qbit_overflow(drcuml_block *block)
|
||||
UML_DCMP(block, uml::I0, 0x000000007fffffffL);
|
||||
UML_MOVc(block, uml::COND_G, uml::I1, Q_MASK);
|
||||
UML_MOVc(block, uml::COND_G, uml::I0, 0x7fffffff);
|
||||
UML_DCMP(block, uml::I0, U64(0xffffffff80000000));
|
||||
UML_DCMP(block, uml::I0, 0xffffffff80000000ULL);
|
||||
UML_MOVc(block, uml::COND_L, uml::I1, Q_MASK);
|
||||
UML_MOVc(block, uml::COND_L, uml::I0, 0x80000000);
|
||||
UML_OR(block, DRC_CPSR, DRC_CPSR, uml::I1);
|
||||
|
@ -273,7 +273,7 @@ inline x86_memref drcbe_x64::MABS(const void *ptr)
|
||||
drcbe_x64::opcode_generate_func drcbe_x64::s_opcode_table[OP_MAX];
|
||||
|
||||
// size-to-mask table
|
||||
//static const uint64_t size_to_mask[] = { 0, 0xff, 0xffff, 0, 0xffffffff, 0, 0, 0, U64(0xffffffffffffffff) };
|
||||
//static const uint64_t size_to_mask[] = { 0, 0xff, 0xffff, 0, 0xffffffff, 0, 0, 0, 0xffffffffffffffffU };
|
||||
|
||||
// register mapping tables
|
||||
static const uint8_t int_register_map[REG_I_COUNT] =
|
||||
@ -642,7 +642,7 @@ drcbe_x64::drcbe_x64(drcuml_state &drcuml, device_t &device, drc_cache &cache, u
|
||||
m_absmask32 = (uint32_t *)(((uintptr_t)m_absmask32 + 15) & ~15);
|
||||
m_absmask32[0] = m_absmask32[1] = m_absmask32[2] = m_absmask32[3] = 0x7fffffff;
|
||||
m_absmask64 = (uint64_t *)&m_absmask32[4];
|
||||
m_absmask64[0] = m_absmask64[1] = U64(0x7fffffffffffffff);
|
||||
m_absmask64[0] = m_absmask64[1] = 0x7fffffffffffffffU;
|
||||
|
||||
// get pointers to C functions we need to call
|
||||
m_near.debug_cpu_instruction_hook = (x86code *)debugger_instruction_hook;
|
||||
@ -1975,7 +1975,7 @@ void drcbe_x64::emit_and_r64_p64(x86code *&dst, uint8_t reg, const be_parameter
|
||||
{
|
||||
if (param.is_immediate())
|
||||
{
|
||||
if (inst.flags() != 0 || param.immediate() != U64(0xffffffffffffffff))
|
||||
if (inst.flags() != 0 || param.immediate() != 0xffffffffffffffffU)
|
||||
{
|
||||
if (short_immediate(param.immediate()))
|
||||
emit_and_r64_imm(dst, reg, param.immediate()); // and reg,param
|
||||
@ -2002,7 +2002,7 @@ void drcbe_x64::emit_and_m64_p64(x86code *&dst, x86_memref memref, const be_para
|
||||
{
|
||||
if (param.is_immediate())
|
||||
{
|
||||
if (inst.flags() != 0 || param.immediate() != U64(0xffffffffffffffff))
|
||||
if (inst.flags() != 0 || param.immediate() != 0xffffffffffffffffU)
|
||||
{
|
||||
if (short_immediate(param.immediate()))
|
||||
emit_and_m64_imm(dst, memref, param.immediate()); // and [mem],param
|
||||
@ -2132,7 +2132,7 @@ void drcbe_x64::emit_xor_r64_p64(x86code *&dst, uint8_t reg, const be_parameter
|
||||
{
|
||||
if (inst.flags() != 0 || param.immediate() != 0)
|
||||
{
|
||||
if (param.immediate() == U64(0xffffffffffffffff))
|
||||
if (param.immediate() == 0xffffffffffffffffU)
|
||||
emit_not_r64(dst, reg); // not reg
|
||||
else if (short_immediate(param.immediate()))
|
||||
emit_xor_r64_imm(dst, reg, param.immediate()); // xor reg,param
|
||||
@ -2161,7 +2161,7 @@ void drcbe_x64::emit_xor_m64_p64(x86code *&dst, x86_memref memref, const be_para
|
||||
{
|
||||
if (inst.flags() != 0 || param.immediate() != 0)
|
||||
{
|
||||
if (param.immediate() == U64(0xffffffffffffffff))
|
||||
if (param.immediate() == 0xffffffffffffffffU)
|
||||
emit_not_m64(dst, memref); // not [mem]
|
||||
else if (short_immediate(param.immediate()))
|
||||
emit_xor_m64_imm(dst, memref, param.immediate()); // xor [mem],param
|
||||
|
@ -148,7 +148,7 @@ const uint32_t PTYPE_MF = PTYPE_M | PTYPE_F;
|
||||
drcbe_x86::opcode_generate_func drcbe_x86::s_opcode_table[OP_MAX];
|
||||
|
||||
// size-to-mask table
|
||||
//static const uint64_t size_to_mask[] = { 0, 0xff, 0xffff, 0, 0xffffffff, 0, 0, 0, U64(0xffffffffffffffff) };
|
||||
//static const uint64_t size_to_mask[] = { 0, 0xff, 0xffff, 0, 0xffffffff, 0, 0, 0, 0xffffffffffffffffU };
|
||||
|
||||
// register mapping tables
|
||||
static const uint8_t int_register_map[REG_I_COUNT] =
|
||||
@ -5243,7 +5243,7 @@ void drcbe_x86::op_and(x86code *&dst, const instruction &inst)
|
||||
}
|
||||
|
||||
// AND with immediate 0xffffffff00000000
|
||||
else if (src2p.is_immediate_value(U64(0xffffffff00000000)) && inst.flags() == 0)
|
||||
else if (src2p.is_immediate_value(0xffffffff00000000U) && inst.flags() == 0)
|
||||
{
|
||||
if (src1p != dstp)
|
||||
{
|
||||
|
@ -108,8 +108,8 @@ void dsp16_device::device_start()
|
||||
state_add(DSP16_X, "X", m_x);
|
||||
state_add(DSP16_Y, "Y", m_y);
|
||||
state_add(DSP16_P, "P", m_p);
|
||||
state_add(DSP16_A0, "A0", m_a0).mask(U64(0xfffffffff));
|
||||
state_add(DSP16_A1, "A1", m_a1).mask(U64(0xfffffffff));
|
||||
state_add(DSP16_A0, "A0", m_a0).mask(0xfffffffffU);
|
||||
state_add(DSP16_A1, "A1", m_a1).mask(0xfffffffffU);
|
||||
state_add(DSP16_AUC, "AUC", m_auc).formatstr("%8s");
|
||||
state_add(DSP16_PSW, "PSW", m_psw).formatstr("%16s");
|
||||
state_add(DSP16_C0, "C0", m_c0);
|
||||
|
@ -67,10 +67,10 @@ void dsp16_device::writeRegister(void* reg, const uint16_t &value)
|
||||
else if (reg == &m_psw)
|
||||
{
|
||||
// Writes to the a0 & a1 guard bits too
|
||||
m_a0 &= U64(0x0ffffffff);
|
||||
m_a0 |= U64(m_psw & 0x000f) << 32;
|
||||
m_a1 &= U64(0x0ffffffff);
|
||||
m_a1 |= U64(m_psw & 0x01e0) << 27;
|
||||
m_a0 &= 0x0ffffffffU;
|
||||
m_a0 |= u64(m_psw & 0x000fU) << 32;
|
||||
m_a1 &= 0x0ffffffffU;
|
||||
m_a1 |= u64(m_psw & 0x01e0U) << 27;
|
||||
m_psw = value;
|
||||
}
|
||||
else if (reg == &m_i)
|
||||
@ -293,12 +293,12 @@ void dsp16_device::executeF1Field(const uint8_t& F1, const uint8_t& D, const uin
|
||||
{
|
||||
// aS-y
|
||||
int64_t aS = *sourceReg;
|
||||
if (aS & U64(0x800000000))
|
||||
aS |= U64(0xfffffff000000000);
|
||||
if (aS & 0x800000000U)
|
||||
aS |= 0xfffffff000000000U;
|
||||
|
||||
int64_t y = (m_y & 0xffff0000) >> 16;
|
||||
if (y & 0x8000)
|
||||
y |= U64(0xffffffffffff0000);
|
||||
y |= 0xffffffffffff0000U;
|
||||
|
||||
result = aS-y;
|
||||
justATest = true;
|
||||
@ -314,12 +314,12 @@ void dsp16_device::executeF1Field(const uint8_t& F1, const uint8_t& D, const uin
|
||||
{
|
||||
// Ad = aS+y
|
||||
int64_t aS = *sourceReg;
|
||||
if (aS & U64(0x800000000))
|
||||
aS |= U64(0xfffffff000000000);
|
||||
if (aS & 0x800000000U)
|
||||
aS |= 0xfffffff000000000U;
|
||||
|
||||
int64_t y = (m_y & 0xffff0000) >> 16;
|
||||
if (y & 0x8000)
|
||||
y |= U64(0xffffffffffff0000);
|
||||
y |= 0xffffffffffff0000U;
|
||||
|
||||
result = aS+y;
|
||||
break;
|
||||
@ -334,12 +334,12 @@ void dsp16_device::executeF1Field(const uint8_t& F1, const uint8_t& D, const uin
|
||||
{
|
||||
// Ad = aS-y
|
||||
int64_t aS = *sourceReg;
|
||||
if (aS & U64(0x800000000))
|
||||
aS |= U64(0xfffffff000000000);
|
||||
if (aS & 0x800000000U)
|
||||
aS |= 0xfffffff000000000U;
|
||||
|
||||
int64_t y = (m_y & 0xffff0000) >> 16;
|
||||
if (y & 0x8000)
|
||||
y |= U64(0xffffffffffff0000);
|
||||
y |= 0xffffffffffff0000U;
|
||||
|
||||
result = aS-y;
|
||||
break;
|
||||
@ -348,13 +348,13 @@ void dsp16_device::executeF1Field(const uint8_t& F1, const uint8_t& D, const uin
|
||||
|
||||
// CPU Flags (page 3-4)
|
||||
// LMI (logical minus)
|
||||
if (result & U64(0x800000000))
|
||||
if (result & 0x800000000U)
|
||||
m_psw |= 0x8000;
|
||||
else
|
||||
m_psw &= (~0x8000);
|
||||
|
||||
// LEQ (logical equal)
|
||||
if (result == U64(0x000000000))
|
||||
if (result == 0x000000000U)
|
||||
m_psw |= 0x4000;
|
||||
else
|
||||
m_psw &= (~0x4000);
|
||||
@ -363,15 +363,15 @@ void dsp16_device::executeF1Field(const uint8_t& F1, const uint8_t& D, const uin
|
||||
// TODO
|
||||
|
||||
// LMV (mathematical overflow)
|
||||
if ((result & U64(0xf00000000)) != U64(0xf00000000) &&
|
||||
(result & U64(0xf00000000)) != U64(0x000000000))
|
||||
if ((result & 0xf00000000U) != 0xf00000000U &&
|
||||
(result & 0xf00000000U) != 0x000000000U)
|
||||
m_psw |= 0x1000;
|
||||
else
|
||||
m_psw &= (~0x1000);
|
||||
|
||||
// If it was a real operation, make sure the data goes where it should
|
||||
if (!justATest)
|
||||
*destinationReg = (uint64_t)result & U64(0x0000000fffffffff);
|
||||
*destinationReg = (uint64_t)result & 0x0000000fffffffffU;
|
||||
}
|
||||
|
||||
|
||||
@ -471,11 +471,11 @@ void dsp16_device::execute_one(const uint16_t& op, uint8_t& cycles, uint8_t& pcA
|
||||
uint16_t aRegValue = 0x0000;
|
||||
if (op & 0xc000)
|
||||
{
|
||||
aRegValue = (m_a0 & U64(0x0ffff0000)) >> 16;
|
||||
aRegValue = (m_a0 & 0x0ffff0000U) >> 16;
|
||||
}
|
||||
else
|
||||
{
|
||||
aRegValue = (m_a1 & U64(0x0ffff0000)) >> 16;
|
||||
aRegValue = (m_a1 & 0x0ffff0000U) >> 16;
|
||||
}
|
||||
data_write(*destinationReg, aRegValue);
|
||||
executeYFieldPost(Y);
|
||||
@ -614,7 +614,7 @@ void dsp16_device::execute_one(const uint16_t& op, uint8_t& cycles, uint8_t& pcA
|
||||
}
|
||||
uint16_t sourceAddress = *(registerFromYFieldUpper(Y));
|
||||
int64_t sourceValueSigned = (int16_t)data_read(sourceAddress);
|
||||
*destinationReg = sourceValueSigned & U64(0xffffffffff);
|
||||
*destinationReg = sourceValueSigned & 0xffffffffffU;
|
||||
executeYFieldPost(Y);
|
||||
cycles = 1;
|
||||
pcAdvance = 1;
|
||||
@ -771,7 +771,7 @@ void dsp16_device::execute_one(const uint16_t& op, uint8_t& cycles, uint8_t& pcA
|
||||
const uint8_t S = (op & 0x1000) >> 12;
|
||||
void* destinationReg = registerFromRTable(R);
|
||||
uint64_t* sourceReg = (S) ? &m_a1 : &m_a0;
|
||||
uint16_t sourceValue = (*sourceReg & U64(0x0ffff0000)) >> 16;
|
||||
uint16_t sourceValue = (*sourceReg & 0x0ffff0000U) >> 16;
|
||||
writeRegister(destinationReg, sourceValue);
|
||||
cycles = 2;
|
||||
pcAdvance = 1;
|
||||
@ -791,10 +791,10 @@ void dsp16_device::execute_one(const uint16_t& op, uint8_t& cycles, uint8_t& pcA
|
||||
default: break;
|
||||
}
|
||||
void* sourceReg = registerFromRTable(R);
|
||||
*destinationReg &= U64(0x00000ffff);
|
||||
*destinationReg &= 0x00000ffffU;
|
||||
*destinationReg |= (*(uint16_t*)sourceReg) << 16; // TODO: Fix for all registers
|
||||
if (*(uint16_t*)sourceReg & 0x8000)
|
||||
*destinationReg |= U64(0xf00000000);
|
||||
*destinationReg |= 0xf00000000U;
|
||||
// TODO: Special function encoding
|
||||
cycles = 2;
|
||||
pcAdvance = 1;
|
||||
|
@ -293,8 +293,8 @@ void dsp56k_device::device_start()
|
||||
state_add(DSP56K_X, "X", m_dsp56k_core.ALU.x.d).mask(0xffffffff).formatstr("%9s");
|
||||
state_add(DSP56K_Y, "Y", m_dsp56k_core.ALU.y.d).mask(0xffffffff).formatstr("%9s");
|
||||
|
||||
state_add(DSP56K_A, "A", m_dsp56k_core.ALU.a.q).mask((uint64_t)U64(0xffffffffffffffff)).formatstr("%12s"); /* could benefit from a better mask? */
|
||||
state_add(DSP56K_B, "B", m_dsp56k_core.ALU.b.q).mask((uint64_t)U64(0xffffffffffffffff)).formatstr("%12s"); /* could benefit from a better mask? */
|
||||
state_add(DSP56K_A, "A", m_dsp56k_core.ALU.a.q).mask(u64(0xffffffffffffffffU)).formatstr("%12s"); /* could benefit from a better mask? */
|
||||
state_add(DSP56K_B, "B", m_dsp56k_core.ALU.b.q).mask(u64(0xffffffffffffffffU)).formatstr("%12s"); /* could benefit from a better mask? */
|
||||
|
||||
state_add(DSP56K_R0, "R0", m_dsp56k_core.AGU.r0).formatstr("%04X");
|
||||
state_add(DSP56K_R1, "R1", m_dsp56k_core.AGU.r1).formatstr("%04X");
|
||||
|
@ -344,7 +344,7 @@ static void execute_one(dsp56k_core* cpustate)
|
||||
int parallelType = -1;
|
||||
uint16_t op_byte = 0x0000;
|
||||
typed_pointer d_register = {nullptr, DT_BYTE};
|
||||
uint64_t prev_accum_value = U64(0x0000000000000000);
|
||||
uint64_t prev_accum_value = 0x0000000000000000U;
|
||||
|
||||
/* Note: it's important that NPDM comes before RtRDM here */
|
||||
/* No Parallel Data Move : 0100 1010 .... .... : A-131 */
|
||||
@ -1142,8 +1142,8 @@ static size_t dsp56k_op_addsub_2(dsp56k_core* cpustate, const uint16_t op_byte,
|
||||
}
|
||||
|
||||
/* Sign-extend word for proper add/sub op */
|
||||
if ((S.data_type == DT_WORD) && useVal & U64(0x0000000080000000))
|
||||
useVal |= U64(0x000000ff00000000);
|
||||
if ((S.data_type == DT_WORD) && (useVal & 0x0000000080000000U))
|
||||
useVal |= 0x000000ff00000000U;
|
||||
|
||||
/* Operate*/
|
||||
if (op_type == OP_ADD)
|
||||
@ -1157,8 +1157,8 @@ static size_t dsp56k_op_addsub_2(dsp56k_core* cpustate, const uint16_t op_byte,
|
||||
/* S L E U N Z V C */
|
||||
/* * * * * * * * * */
|
||||
/* TODO S, L, E, U, V, C */
|
||||
if (*((uint64_t*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if (*((uint64_t*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if (*((uint64_t*)D.addr) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if (*((uint64_t*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
|
||||
cycles += 2; /* TODO: + mv oscillator cycles */
|
||||
return 1;
|
||||
@ -1188,16 +1188,16 @@ static size_t dsp56k_op_mac_1(dsp56k_core* cpustate, const uint16_t op_byte, typ
|
||||
|
||||
/* Sign extend D into a temp variable */
|
||||
opD = (*((uint64_t*)D));
|
||||
if (opD & U64(0x0000008000000000))
|
||||
opD |= U64(0xffffff0000000000);
|
||||
if (opD & 0x0000008000000000U)
|
||||
opD |= 0xffffff0000000000U;
|
||||
else
|
||||
opD &= U64(0x000000ffffffffff);
|
||||
opD &= 0x000000ffffffffffU;
|
||||
|
||||
/* Accumulate */
|
||||
opD += result;
|
||||
|
||||
/* And out the bits that don't live in the register */
|
||||
opD &= U64(0x000000ffffffffff);
|
||||
opD &= 0x000000ffffffffffU;
|
||||
|
||||
(*((uint64_t*)D)) = (uint64_t)opD;
|
||||
|
||||
@ -1208,8 +1208,8 @@ static size_t dsp56k_op_mac_1(dsp56k_core* cpustate, const uint16_t op_byte, typ
|
||||
/* S L E U N Z V C */
|
||||
/* * * * * * * * - */
|
||||
/* TODO: S, L, E, V */
|
||||
if ( *((uint64_t*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ( *((uint64_t*)D) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D) & 0x000000ffffffffffU) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
|
||||
cycles += 2; /* TODO: +mv oscillator cycles */
|
||||
return 1;
|
||||
@ -1253,7 +1253,7 @@ static size_t dsp56k_op_mpy_1(dsp56k_core* cpustate, const uint16_t op_byte, typ
|
||||
result = (s1 * s2) << 1;
|
||||
|
||||
/* And out the bits that don't live in the register */
|
||||
(*((uint64_t*)D)) = result & U64(0x000000ffffffffff);
|
||||
(*((uint64_t*)D)) = result & 0x000000ffffffffffU;
|
||||
|
||||
/* For the parallel move */
|
||||
d_register->addr = D;
|
||||
@ -1262,8 +1262,8 @@ static size_t dsp56k_op_mpy_1(dsp56k_core* cpustate, const uint16_t op_byte, typ
|
||||
/* S L E U N Z V C */
|
||||
/* * * * * * * * - */
|
||||
/* TODO: S, L, E, V */
|
||||
if ( *((uint64_t*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ( *((uint64_t*)D) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D) & 0x000000ffffffffffU) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
|
||||
cycles += 2; /* TODO: +mv oscillator cycles */
|
||||
return 1;
|
||||
@ -1306,7 +1306,7 @@ static size_t dsp56k_op_clr(dsp56k_core* cpustate, const uint16_t op_byte, typed
|
||||
{
|
||||
typed_pointer D = {nullptr, DT_LONG_WORD};
|
||||
typed_pointer clear = {nullptr, DT_LONG_WORD};
|
||||
uint64_t clear_val = U64(0x0000000000000000);
|
||||
uint64_t clear_val = 0x0000000000000000U;
|
||||
|
||||
decode_F_table(cpustate, BITS(op_byte,0x0008), &D);
|
||||
|
||||
@ -1351,8 +1351,8 @@ static size_t dsp56k_op_add(dsp56k_core* cpustate, const uint16_t op_byte, typed
|
||||
}
|
||||
|
||||
/* Sign-extend word for proper add/sub op */
|
||||
if ((S.data_type == DT_WORD) && addVal & U64(0x0000000080000000))
|
||||
addVal |= U64(0x000000ff00000000);
|
||||
if ((S.data_type == DT_WORD) && (addVal & 0x0000000080000000U))
|
||||
addVal |= 0x000000ff00000000U;
|
||||
|
||||
/* Operate*/
|
||||
*((uint64_t*)D.addr) += addVal;
|
||||
@ -1363,8 +1363,8 @@ static size_t dsp56k_op_add(dsp56k_core* cpustate, const uint16_t op_byte, typed
|
||||
/* S L E U N Z V C */
|
||||
/* * * * * * * * * */
|
||||
/* TODO S, L, E, U, V, C */
|
||||
if (*((uint64_t*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if (*((uint64_t*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if (*((uint64_t*)D.addr) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if (*((uint64_t*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
|
||||
cycles += 2; /* TODO: + mv oscillator cycles */
|
||||
return 1;
|
||||
@ -1418,10 +1418,10 @@ static size_t dsp56k_op_rnd(dsp56k_core* cpustate, const uint16_t op_byte, typed
|
||||
*p_accum = *((uint64_t*)D.addr);
|
||||
|
||||
/* WARNING : ROUNDING NOT FULLY IMPLEMENTED YET! */
|
||||
if ((*((uint64_t*)D.addr) & U64(0x000000000000ffff)) >= 0x8000)
|
||||
*((uint64_t*)D.addr) += U64(0x0000000000010000);
|
||||
if ((*((uint64_t*)D.addr) & 0x000000000000ffffU) >= 0x8000)
|
||||
*((uint64_t*)D.addr) += 0x0000000000010000U;
|
||||
|
||||
*((uint64_t*)D.addr) = *((uint64_t*)D.addr) & U64(0x000000ffffff0000);
|
||||
*((uint64_t*)D.addr) = *((uint64_t*)D.addr) & 0x000000ffffff0000U;
|
||||
|
||||
d_register->addr = D.addr;
|
||||
d_register->data_type = D.data_type;
|
||||
@ -1429,8 +1429,8 @@ static size_t dsp56k_op_rnd(dsp56k_core* cpustate, const uint16_t op_byte, typed
|
||||
/* S L E U N Z V C */
|
||||
/* * * * * * * * - */
|
||||
/* TODO: S, L, E, U, V */
|
||||
if ((*((uint64_t*)D.addr)) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D.addr)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ((*((uint64_t*)D.addr)) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D.addr)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
|
||||
cycles += 2; /* TODO: + mv oscillator clock cycles */
|
||||
return 1;
|
||||
@ -1451,8 +1451,8 @@ static size_t dsp56k_op_tst(dsp56k_core* cpustate, const uint16_t op_byte, typed
|
||||
/* S L E U N Z V C */
|
||||
/* 0 * * * * * 0 0 */
|
||||
/* TODO: S, L, E, U */
|
||||
if ((*((uint64_t*)D.addr)) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D.addr)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ((*((uint64_t*)D.addr)) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D.addr)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
DSP56K_V_CLEAR();
|
||||
DSP56K_C_CLEAR();
|
||||
|
||||
@ -1470,7 +1470,7 @@ static size_t dsp56k_op_inc(dsp56k_core* cpustate, const uint16_t op_byte, typed
|
||||
*p_accum = *((uint64_t*)D.addr);
|
||||
|
||||
/* Make sure the destination is a real 40-bit value */
|
||||
*((uint64_t*)D.addr) &= U64(0x000000ffffffffff);
|
||||
*((uint64_t*)D.addr) &= 0x000000ffffffffffU;
|
||||
|
||||
/* Increment */
|
||||
*((uint64_t*)D.addr) = *((uint64_t*)D.addr) + 1;
|
||||
@ -1481,10 +1481,10 @@ static size_t dsp56k_op_inc(dsp56k_core* cpustate, const uint16_t op_byte, typed
|
||||
/* S L E U N Z V C */
|
||||
/* * * * * * * * * */
|
||||
/* TODO: S, L, E, U */
|
||||
if ( *((uint64_t*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D.addr) & U64(0x000000ffffff0000)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ((*((uint64_t*)D.addr) & U64(0xffffff0000000000)) != 0) DSP56K_V_SET(); else DSP56K_V_CLEAR();
|
||||
if ((*((uint64_t*)D.addr) & U64(0xffffff0000000000)) != 0) DSP56K_C_SET(); else DSP56K_C_CLEAR();
|
||||
if ( *((uint64_t*)D.addr) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D.addr) & 0x000000ffffff0000U) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ((*((uint64_t*)D.addr) & 0xffffff0000000000U) != 0) DSP56K_V_SET(); else DSP56K_V_CLEAR();
|
||||
if ((*((uint64_t*)D.addr) & 0xffffff0000000000U) != 0) DSP56K_C_SET(); else DSP56K_C_CLEAR();
|
||||
|
||||
cycles += 2; /* TODO: +mv oscillator cycles */
|
||||
return 1;
|
||||
@ -1502,12 +1502,12 @@ static size_t dsp56k_op_inc24(dsp56k_core* cpustate, const uint16_t op_byte, typ
|
||||
*p_accum = *((uint64_t*)D.addr);
|
||||
|
||||
/* TODO: I wonder if workBits24 should be signed? */
|
||||
workBits24 = ((*((uint64_t*)D.addr)) & U64(0x000000ffffff0000)) >> 16;
|
||||
workBits24 = ((*((uint64_t*)D.addr)) & 0x000000ffffff0000U) >> 16;
|
||||
workBits24++;
|
||||
//workBits24 &= 0x00ffffff; /* Solves -x issues - TODO: huh? */
|
||||
|
||||
/* Set the D bits with the dec result */
|
||||
*((uint64_t*)D.addr) &= U64(0x000000000000ffff);
|
||||
*((uint64_t*)D.addr) &= 0x000000000000ffffU;
|
||||
*((uint64_t*)D.addr) |= (((uint64_t)(workBits24)) << 16);
|
||||
|
||||
d_register->addr = D.addr;
|
||||
@ -1516,8 +1516,8 @@ static size_t dsp56k_op_inc24(dsp56k_core* cpustate, const uint16_t op_byte, typ
|
||||
/* S L E U N Z V C */
|
||||
/* * * * * * ? * * */
|
||||
/* TODO: S, L, E, U */
|
||||
if ( *((uint64_t*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D.addr) & U64(0x000000ffffff0000)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ( *((uint64_t*)D.addr) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D.addr) & 0x000000ffffff0000U) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ((workBits24 & 0xff000000) != 0) DSP56K_V_SET(); else DSP56K_V_CLEAR();
|
||||
if ((workBits24 & 0xff000000) != 0) DSP56K_C_SET(); else DSP56K_C_CLEAR();
|
||||
|
||||
@ -1545,8 +1545,8 @@ static size_t dsp56k_op_or(dsp56k_core* cpustate, const uint16_t op_byte, typed_
|
||||
/* S L E U N Z V C */
|
||||
/* * * - - ? ? 0 - */
|
||||
/* TODO: S, L */
|
||||
if ( *((uint64_t*)D.addr) & U64(0x0000000080000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D.addr) & U64(0x00000000ffff0000)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ( *((uint64_t*)D.addr) & 0x0000000080000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D.addr) & 0x00000000ffff0000U) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
DSP56K_V_CLEAR();
|
||||
|
||||
cycles += 2; /* TODO: + mv oscillator cycles */
|
||||
@ -1564,10 +1564,10 @@ static size_t dsp56k_op_asr(dsp56k_core* cpustate, const uint16_t op_byte, typed
|
||||
*((uint64_t*)D.addr) = (*((uint64_t*)D.addr)) >> 1;
|
||||
|
||||
/* Make sure the MSB is maintained */
|
||||
if (*p_accum & U64(0x0000008000000000))
|
||||
*((uint64_t*)D.addr) |= U64(0x0000008000000000);
|
||||
if (*p_accum & 0x0000008000000000U)
|
||||
*((uint64_t*)D.addr) |= 0x0000008000000000U;
|
||||
else
|
||||
*((uint64_t*)D.addr) &= (~U64(0x0000008000000000));
|
||||
*((uint64_t*)D.addr) &= (~u64(0x0000008000000000U));
|
||||
|
||||
/* For the parallel move */
|
||||
d_register->addr = D.addr;
|
||||
@ -1576,10 +1576,10 @@ static size_t dsp56k_op_asr(dsp56k_core* cpustate, const uint16_t op_byte, typed
|
||||
/* S L E U N Z V C */
|
||||
/* * * * * * * 0 ? */
|
||||
/* TODO: S, L, E, U */
|
||||
if (*((uint64_t*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if (*((uint64_t*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if (*((uint64_t*)D.addr) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if (*((uint64_t*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
DSP56K_V_CLEAR();
|
||||
if (*p_accum & U64(0x0000000000000001)) DSP56K_C_SET(); else DSP56K_C_CLEAR();
|
||||
if (*p_accum & 0x0000000000000001U) DSP56K_C_SET(); else DSP56K_C_CLEAR();
|
||||
|
||||
cycles += 2; /* TODO: + mv oscillator cycles */
|
||||
return 1;
|
||||
@ -1617,9 +1617,9 @@ static size_t dsp56k_op_lsr(dsp56k_core* cpustate, const uint16_t op_byte, typed
|
||||
/* * * - - ? ? 0 ? */
|
||||
/* TODO: S, L */
|
||||
DSP56K_N_CLEAR();
|
||||
if (((PAIR64*)D.addr)->w.h == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if (((PAIR64*)D.addr)->w.h == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
DSP56K_V_CLEAR();
|
||||
if (*p_accum & U64(0x0000000000010000)) DSP56K_C_SET(); else DSP56K_C_CLEAR();
|
||||
if (*p_accum & 0x0000000000010000U) DSP56K_C_SET(); else DSP56K_C_CLEAR();
|
||||
|
||||
cycles += 2; /* TODO: + mv oscillator cycles */
|
||||
return 1;
|
||||
@ -1674,12 +1674,12 @@ static size_t dsp56k_op_sub(dsp56k_core* cpustate, const uint16_t op_byte, typed
|
||||
}
|
||||
|
||||
/* Sign-extend word for proper sub op */
|
||||
if ((S.data_type == DT_WORD) && useVal & U64(0x0000000080000000))
|
||||
useVal |= U64(0x000000ff00000000);
|
||||
if ((S.data_type == DT_WORD) && useVal & 0x0000000080000000U)
|
||||
useVal |= 0x000000ff00000000U;
|
||||
|
||||
/* Make sure they're both real 40-bit values */
|
||||
useVal &= U64(0x000000ffffffffff);
|
||||
*((uint64_t*)D.addr) &= U64(0x000000ffffffffff);
|
||||
useVal &= 0x000000ffffffffffU;
|
||||
*((uint64_t*)D.addr) &= 0x000000ffffffffffU;
|
||||
|
||||
/* Operate*/
|
||||
*((uint64_t*)D.addr) -= useVal;
|
||||
@ -1690,10 +1690,10 @@ static size_t dsp56k_op_sub(dsp56k_core* cpustate, const uint16_t op_byte, typed
|
||||
/* S L E U N Z V C */
|
||||
/* * * * * * * * * */
|
||||
/* TODO S, L, E, U */
|
||||
if ( *((uint64_t*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ( *((uint64_t*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ((*((uint64_t*)D.addr) & U64(0xffffff0000000000)) != 0) DSP56K_V_SET(); else DSP56K_V_CLEAR();
|
||||
if ((*((uint64_t*)D.addr) & U64(0xffffff0000000000)) != 0) DSP56K_C_SET(); else DSP56K_C_CLEAR();
|
||||
if ( *((uint64_t*)D.addr) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ( *((uint64_t*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ((*((uint64_t*)D.addr) & 0xffffff0000000000U) != 0) DSP56K_V_SET(); else DSP56K_V_CLEAR();
|
||||
if ((*((uint64_t*)D.addr) & 0xffffff0000000000U) != 0) DSP56K_C_SET(); else DSP56K_C_CLEAR();
|
||||
|
||||
cycles += 2; /* TODO: + mv oscillator cycles */
|
||||
return 1;
|
||||
@ -1737,12 +1737,12 @@ static size_t dsp56k_op_cmp(dsp56k_core* cpustate, const uint16_t op_byte, typed
|
||||
}
|
||||
|
||||
/* Sign-extend word for proper subtraction op */
|
||||
if ((S.data_type == DT_WORD) && cmpVal & U64(0x0000000080000000))
|
||||
cmpVal |= U64(0x000000ff00000000);
|
||||
if ((S.data_type == DT_WORD) && cmpVal & 0x0000000080000000U)
|
||||
cmpVal |= 0x000000ff00000000U;
|
||||
|
||||
/* Make sure they're both real 40-bit values */
|
||||
cmpVal &= U64(0x000000ffffffffff);
|
||||
*((uint64_t*)D.addr) &= U64(0x000000ffffffffff);
|
||||
cmpVal &= 0x000000ffffffffffU;
|
||||
*((uint64_t*)D.addr) &= 0x000000ffffffffffU;
|
||||
|
||||
/* Operate */
|
||||
result = *((uint64_t*)D.addr) - cmpVal;
|
||||
@ -1753,10 +1753,10 @@ static size_t dsp56k_op_cmp(dsp56k_core* cpustate, const uint16_t op_byte, typed
|
||||
/* S L E U N Z V C */
|
||||
/* * * * * * * * * */
|
||||
/* TODO: S, L, E, U */
|
||||
if ( result & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ( result & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ( result == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ((result & U64(0xffffff0000000000)) != 0) DSP56K_V_SET(); else DSP56K_V_CLEAR();
|
||||
if ((result & U64(0xffffff0000000000)) != 0) DSP56K_C_SET(); else DSP56K_C_CLEAR();
|
||||
if ((result & 0xffffff0000000000U) != 0) DSP56K_V_SET(); else DSP56K_V_CLEAR();
|
||||
if ((result & 0xffffff0000000000U) != 0) DSP56K_C_SET(); else DSP56K_C_CLEAR();
|
||||
|
||||
|
||||
cycles += 2; /* TODO: + mv oscillator clock cycles */
|
||||
@ -1788,8 +1788,8 @@ static size_t dsp56k_op_not(dsp56k_core* cpustate, const uint16_t op_byte, typed
|
||||
/* S L E U N Z V C */
|
||||
/* * * - - ? ? 0 - */
|
||||
/* TODO: S?, L */
|
||||
if ( *((uint64_t*)D.addr) & U64(0x0000000080000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D.addr) & U64(0x00000000ffff0000)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ( *((uint64_t*)D.addr) & 0x0000000080000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D.addr) & 0x00000000ffff0000U) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
DSP56K_V_CLEAR();
|
||||
|
||||
cycles += 2; /* TODO: + mv oscillator cycles */
|
||||
@ -1816,12 +1816,12 @@ static size_t dsp56k_op_dec24(dsp56k_core* cpustate, const uint16_t op_byte, typ
|
||||
*p_accum = *((uint64_t*)D.addr);
|
||||
|
||||
/* TODO: I wonder if workBits24 should be signed? */
|
||||
workBits24 = ((*((uint64_t*)D.addr)) & U64(0x000000ffffff0000)) >> 16;
|
||||
workBits24 = ((*((uint64_t*)D.addr)) & 0x000000ffffff0000U) >> 16;
|
||||
workBits24--;
|
||||
workBits24 &= 0x00ffffff; /* Solves -x issues */
|
||||
|
||||
/* Set the D bits with the dec result */
|
||||
*((uint64_t*)D.addr) &= U64(0x000000000000ffff);
|
||||
*((uint64_t*)D.addr) &= 0x000000000000ffffU;
|
||||
*((uint64_t*)D.addr) |= (((uint64_t)(workBits24)) << 16);
|
||||
|
||||
d_register->addr = D.addr;
|
||||
@ -1830,8 +1830,8 @@ static size_t dsp56k_op_dec24(dsp56k_core* cpustate, const uint16_t op_byte, typ
|
||||
/* S L E U N Z V C */
|
||||
/* * * * * * ? * * */
|
||||
/* TODO: S, L, E, U, V, C */
|
||||
if ( *((uint64_t*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D.addr) & U64(0x000000ffffff0000)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ( *((uint64_t*)D.addr) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D.addr) & 0x000000ffffff0000U) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
|
||||
cycles += 2; /* TODO: + mv oscillator clock cycles */
|
||||
return 1;
|
||||
@ -1857,8 +1857,8 @@ static size_t dsp56k_op_and(dsp56k_core* cpustate, const uint16_t op_byte, typed
|
||||
/* S L E U N Z V C */
|
||||
/* * * - - ? ? 0 - */
|
||||
/* TODO: S, L */
|
||||
if ( *((uint64_t*)D.addr) & U64(0x0000000080000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D.addr) & U64(0x00000000ffff0000)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ( *((uint64_t*)D.addr) & 0x0000000080000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D.addr) & 0x00000000ffff0000U) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
DSP56K_V_CLEAR();
|
||||
|
||||
cycles += 2; /* TODO: + mv oscillator cycles */
|
||||
@ -1877,28 +1877,28 @@ static size_t dsp56k_op_abs(dsp56k_core* cpustate, const uint16_t op_byte, typed
|
||||
|
||||
/* Sign extend D into a temp variable */
|
||||
opD = *p_accum;
|
||||
if (opD & U64(0x0000008000000000))
|
||||
opD |= U64(0xffffff0000000000);
|
||||
if (opD & 0x0000008000000000U)
|
||||
opD |= 0xffffff0000000000U;
|
||||
else
|
||||
opD &= U64(0x000000ffffffffff);
|
||||
opD &= 0x000000ffffffffffU;
|
||||
|
||||
/* Take the absolute value and clean up */
|
||||
opD = (opD < 0) ? -opD : opD;
|
||||
opD &= U64(0x000000ffffffffff);
|
||||
opD &= 0x000000ffffffffffU;
|
||||
|
||||
/* Reassign */
|
||||
*((uint64_t*)D.addr) = opD;
|
||||
|
||||
/* Special overflow case */
|
||||
if ((*p_accum) == U64(0x0000008000000000))
|
||||
*((uint64_t*)D.addr) = U64(0x0000007fffffffff);
|
||||
if ((*p_accum) == 0x0000008000000000U)
|
||||
*((uint64_t*)D.addr) = 0x0000007fffffffffU;
|
||||
|
||||
/* S L E U N Z V C */
|
||||
/* * * * * * * * - */
|
||||
/* TODO: S, L, E, U */
|
||||
if ( *((uint64_t*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D.addr) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ((*p_accum) == U64(0x0000008000000000)) DSP56K_V_SET(); else DSP56K_V_CLEAR();
|
||||
if ( *((uint64_t*)D.addr) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D.addr) & 0x000000ffffffffffU) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ((*p_accum) == 0x0000008000000000U) DSP56K_V_SET(); else DSP56K_V_CLEAR();
|
||||
|
||||
cycles += 2; /* TODO: + mv oscillator clock cycles */
|
||||
return 1;
|
||||
@ -1944,14 +1944,14 @@ static size_t dsp56k_op_cmpm(dsp56k_core* cpustate, const uint16_t op_byte, type
|
||||
if (S.addr == &A || S.addr == &B)
|
||||
{
|
||||
absS = *((uint64_t*)S.addr);
|
||||
if (absS & U64(0x0000008000000000))
|
||||
absS |= U64(0xffffff8000000000);
|
||||
if (absS & 0x0000008000000000U)
|
||||
absS |= 0xffffff8000000000U;
|
||||
}
|
||||
else
|
||||
{
|
||||
absS = (*((uint16_t*)S.addr)) << 16;
|
||||
if (absS & U64(0x0000000080000000))
|
||||
absS |= U64(0xffffffff80000000);
|
||||
if (absS & 0x0000000080000000U)
|
||||
absS |= 0xffffffff80000000U;
|
||||
}
|
||||
absS = (absS < 0) ? -absS : absS;
|
||||
|
||||
@ -1959,14 +1959,14 @@ static size_t dsp56k_op_cmpm(dsp56k_core* cpustate, const uint16_t op_byte, type
|
||||
if (D.addr == &A || D.addr == &B)
|
||||
{
|
||||
absD = *((uint64_t*)D.addr);
|
||||
if (absD & U64(0x0000008000000000))
|
||||
absD |= U64(0xffffff8000000000);
|
||||
if (absD & 0x0000008000000000U)
|
||||
absD |= 0xffffff8000000000U;
|
||||
}
|
||||
else
|
||||
{
|
||||
absD = (*((uint16_t*)D.addr)) << 16;
|
||||
if (absS & U64(0x0000000080000000))
|
||||
absS |= U64(0xffffffff80000000);
|
||||
if (absS & 0x0000000080000000U)
|
||||
absS |= 0xffffffff80000000U;
|
||||
}
|
||||
absD = (absD < 0) ? -absD : absD;
|
||||
|
||||
@ -1979,10 +1979,10 @@ static size_t dsp56k_op_cmpm(dsp56k_core* cpustate, const uint16_t op_byte, type
|
||||
/* S L E U N Z V C */
|
||||
/* * * * * * * * * */
|
||||
/* TODO: S, L, E, U */
|
||||
if ( (absResult) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if (((absResult) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ( (absResult & U64(0xffffff0000000000)) != 0) DSP56K_V_SET(); else DSP56K_V_CLEAR();
|
||||
if ( (absResult & U64(0xffffff0000000000)) != 0) DSP56K_C_SET(); else DSP56K_C_CLEAR();
|
||||
if ( (absResult) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if (((absResult) & 0x000000ffffffffffU) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ( (absResult & 0xffffff0000000000U) != 0) DSP56K_V_SET(); else DSP56K_V_CLEAR();
|
||||
if ( (absResult & 0xffffff0000000000U) != 0) DSP56K_C_SET(); else DSP56K_C_CLEAR();
|
||||
|
||||
cycles += 2; /* TODO: +mv oscillator cycles */
|
||||
return 1;
|
||||
@ -2016,13 +2016,13 @@ static size_t dsp56k_op_mpy(dsp56k_core* cpustate, const uint16_t op_byte, typed
|
||||
if (k)
|
||||
result *= -1;
|
||||
|
||||
(*((uint64_t*)D)) = result & U64(0x000000ffffffffff);
|
||||
(*((uint64_t*)D)) = result & 0x000000ffffffffffU;
|
||||
|
||||
/* S L E U N Z V C */
|
||||
/* * * * * * * * - */
|
||||
/* TODO: S, L, E, V */
|
||||
if ( *((uint64_t*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ( *((uint64_t*)D) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D) & 0x000000ffffffffffU) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
|
||||
cycles += 2; /* TODO: +mv oscillator cycles */
|
||||
return 1;
|
||||
@ -2063,10 +2063,10 @@ static size_t dsp56k_op_mac(dsp56k_core* cpustate, const uint16_t op_byte, typed
|
||||
|
||||
/* Sign extend D into a temp variable */
|
||||
opD = (*((uint64_t*)D));
|
||||
if (opD & U64(0x0000008000000000))
|
||||
opD |= U64(0xffffff0000000000);
|
||||
if (opD & 0x0000008000000000U)
|
||||
opD |= 0xffffff0000000000U;
|
||||
else
|
||||
opD &= U64(0x000000ffffffffff);
|
||||
opD &= 0x000000ffffffffffU;
|
||||
|
||||
/* Negate if necessary */
|
||||
if (k)
|
||||
@ -2076,7 +2076,7 @@ static size_t dsp56k_op_mac(dsp56k_core* cpustate, const uint16_t op_byte, typed
|
||||
opD += result;
|
||||
|
||||
/* And out the bits that don't live in the register */
|
||||
opD &= U64(0x000000ffffffffff);
|
||||
opD &= 0x000000ffffffffffU;
|
||||
|
||||
(*((uint64_t*)D)) = (uint64_t)opD;
|
||||
|
||||
@ -2087,8 +2087,8 @@ static size_t dsp56k_op_mac(dsp56k_core* cpustate, const uint16_t op_byte, typed
|
||||
/* S L E U N Z V C */
|
||||
/* * * * * * * * - */
|
||||
/* TODO: S, L, E, V */
|
||||
if ( *((uint64_t*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ( *((uint64_t*)D) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D) & 0x000000ffffffffffU) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
|
||||
cycles += 2; /* TODO: +mv oscillator cycles */
|
||||
return 1;
|
||||
@ -2121,10 +2121,10 @@ static size_t dsp56k_op_macr(dsp56k_core* cpustate, const uint16_t op_byte, type
|
||||
|
||||
/* Sign extend D into a temp variable */
|
||||
opD = (*((uint64_t*)D));
|
||||
if (opD & U64(0x0000008000000000))
|
||||
opD |= U64(0xffffff0000000000);
|
||||
if (opD & 0x0000008000000000U)
|
||||
opD |= 0xffffff0000000000U;
|
||||
else
|
||||
opD &= U64(0x000000ffffffffff);
|
||||
opD &= 0x000000ffffffffffU;
|
||||
|
||||
/* Negate if necessary */
|
||||
if (k)
|
||||
@ -2135,13 +2135,13 @@ static size_t dsp56k_op_macr(dsp56k_core* cpustate, const uint16_t op_byte, type
|
||||
|
||||
/* Round the result */
|
||||
/* WARNING : ROUNDING NOT FULLY IMPLEMENTED YET! */
|
||||
if ((opD & U64(0x000000000000ffff)) >= 0x8000)
|
||||
opD += U64(0x0000000000010000);
|
||||
if ((opD & 0x000000000000ffffU) >= 0x8000)
|
||||
opD += 0x0000000000010000U;
|
||||
|
||||
opD &= U64(0x000000ffffff0000);
|
||||
opD &= 0x000000ffffff0000U;
|
||||
|
||||
/* And out the bits that don't live in the register */
|
||||
opD &= U64(0x000000ffffffffff);
|
||||
opD &= 0x000000ffffffffffU;
|
||||
|
||||
/* Store the result */
|
||||
(*((uint64_t*)D)) = (uint64_t)opD;
|
||||
@ -2153,8 +2153,8 @@ static size_t dsp56k_op_macr(dsp56k_core* cpustate, const uint16_t op_byte, type
|
||||
/* S L E U N Z V C */
|
||||
/* * * * * * * * - */
|
||||
/* TODO: S, L, E, V */
|
||||
if ( *((uint64_t*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ( *((uint64_t*)D) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D) & 0x000000ffffffffffU) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
|
||||
cycles += 2; /* TODO: +mv oscillator cycles */
|
||||
return 1;
|
||||
@ -2215,7 +2215,7 @@ static size_t dsp56k_op_asl4(dsp56k_core* cpustate, const uint16_t op, uint8_t*
|
||||
p_accum = *((uint64_t*)D.addr);
|
||||
|
||||
*((uint64_t*)D.addr) = (*((uint64_t*)D.addr)) << 4;
|
||||
*((uint64_t*)D.addr) = (*((uint64_t*)D.addr)) & U64(0x000000ffffffffff);
|
||||
*((uint64_t*)D.addr) = (*((uint64_t*)D.addr)) & 0x000000ffffffffffU;
|
||||
|
||||
/* S L E U N Z V C */
|
||||
/* - ? * * * * ? ? */
|
||||
@ -2223,10 +2223,10 @@ static size_t dsp56k_op_asl4(dsp56k_core* cpustate, const uint16_t op, uint8_t*
|
||||
/* V - Set if an arithmetic overflow occurs in the 40 bit result. Also set if bit 35 through 39 are
|
||||
not the same. */
|
||||
/* C - Set if bit 36 of source operand is set. Cleared otherwise. */
|
||||
if (*((uint64_t*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if (*((uint64_t*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ( (*((uint64_t*)D.addr) & U64(0x000000ff00000000)) != (p_accum & U64(0x000000ff00000000)) ) DSP56K_V_SET(); else DSP56K_V_CLEAR();
|
||||
if (p_accum & U64(0x0000001000000000)) DSP56K_C_SET(); else DSP56K_C_CLEAR();
|
||||
if (*((uint64_t*)D.addr) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if (*((uint64_t*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ( (*((uint64_t*)D.addr) & 0x000000ff00000000U) != (p_accum & 0x000000ff00000000U) ) DSP56K_V_SET(); else DSP56K_V_CLEAR();
|
||||
if (p_accum & 0x0000001000000000U) DSP56K_C_SET(); else DSP56K_C_CLEAR();
|
||||
|
||||
cycles += 2;
|
||||
return 1;
|
||||
@ -2242,22 +2242,22 @@ static size_t dsp56k_op_asr4(dsp56k_core* cpustate, const uint16_t op, uint8_t*
|
||||
p_accum = *((uint64_t*)D.addr);
|
||||
|
||||
*((uint64_t*)D.addr) = (*((uint64_t*)D.addr)) >> 4;
|
||||
*((uint64_t*)D.addr) = (*((uint64_t*)D.addr)) & U64(0x000000ffffffffff);
|
||||
*((uint64_t*)D.addr) = (*((uint64_t*)D.addr)) & 0x000000ffffffffffU;
|
||||
|
||||
/* The top 4 bits become the old bit 39 */
|
||||
if (p_accum & U64(0x0000008000000000))
|
||||
*((uint64_t*)D.addr) |= U64(0x000000f000000000);
|
||||
if (p_accum & 0x0000008000000000U)
|
||||
*((uint64_t*)D.addr) |= 0x000000f000000000U;
|
||||
else
|
||||
*((uint64_t*)D.addr) &= (~U64(0x000000f000000000));
|
||||
*((uint64_t*)D.addr) &= (~u64(0x000000f000000000U));
|
||||
|
||||
/* S L E U N Z V C */
|
||||
/* - * * * * * 0 ? */
|
||||
/* TODO: E, U */
|
||||
/* C - Set if bit 3 of source operand is set. Cleared otherwise. */
|
||||
if (*((uint64_t*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if (*((uint64_t*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if (*((uint64_t*)D.addr) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if (*((uint64_t*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
DSP56K_V_CLEAR();
|
||||
if (p_accum & U64(0x0000000000000008)) DSP56K_C_SET(); else DSP56K_C_CLEAR();
|
||||
if (p_accum & 0x0000000000000008U) DSP56K_C_SET(); else DSP56K_C_CLEAR();
|
||||
|
||||
cycles += 2;
|
||||
return 1;
|
||||
@ -2275,18 +2275,18 @@ static size_t dsp56k_op_asr16(dsp56k_core* cpustate, const uint16_t op, uint8_t*
|
||||
|
||||
*((uint64_t*)D.addr) = *((uint64_t*)D.addr) >> 16;
|
||||
|
||||
if(backupVal & U64(0x0000008000000000))
|
||||
*((uint64_t*)D.addr) |= U64(0x000000ffff000000);
|
||||
if (backupVal & 0x0000008000000000U)
|
||||
*((uint64_t*)D.addr) |= 0x000000ffff000000U;
|
||||
else
|
||||
*((uint64_t*)D.addr) &= U64(0x0000000000ffffff);
|
||||
*((uint64_t*)D.addr) &= 0x0000000000ffffffU;
|
||||
|
||||
/* S L E U N Z V C */
|
||||
/* - * * * * * 0 ? */
|
||||
/* TODO: E, U */
|
||||
if (*((uint64_t*)D.addr) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if (*((uint64_t*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if (*((uint64_t*)D.addr) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if (*((uint64_t*)D.addr) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
DSP56K_V_CLEAR();
|
||||
if (backupVal & U64(0x0000000000008000)) DSP56K_C_SET(); else DSP56K_C_CLEAR();
|
||||
if (backupVal & 0x0000000000008000U) DSP56K_C_SET(); else DSP56K_C_CLEAR();
|
||||
|
||||
cycles += 2;
|
||||
return 1;
|
||||
@ -2774,8 +2774,8 @@ static size_t dsp56k_op_dmac(dsp56k_core* cpustate, const uint16_t op, uint8_t*
|
||||
/* S L E U N Z V C */
|
||||
/* - * * * * * * - */
|
||||
/* TODO: L, E, U, V */
|
||||
if ( *((uint64_t*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ( *((uint64_t*)D) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D) & 0x000000ffffffffffU) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
|
||||
cycles += 2;
|
||||
return 1;
|
||||
@ -2982,16 +2982,16 @@ static size_t dsp56k_op_imac(dsp56k_core* cpustate, const uint16_t op, uint8_t*
|
||||
|
||||
/* Sign extend D into a temp variable */
|
||||
opD = (*((uint64_t*)D));
|
||||
if (opD & U64(0x0000008000000000))
|
||||
opD |= U64(0xffffff0000000000);
|
||||
if (opD & 0x0000008000000000U)
|
||||
opD |= 0xffffff0000000000U;
|
||||
else
|
||||
opD &= U64(0x000000ffffffffff);
|
||||
opD &= 0x000000ffffffffffU;
|
||||
|
||||
/* Accumulate */
|
||||
opD += result;
|
||||
|
||||
/* And out the bits that don't live in the register */
|
||||
opD &= U64(0x000000ffffffffff);
|
||||
opD &= 0x000000ffffffffffU;
|
||||
|
||||
(*((uint64_t*)D)) = (uint64_t)opD;
|
||||
|
||||
@ -2999,8 +2999,8 @@ static size_t dsp56k_op_imac(dsp56k_core* cpustate, const uint16_t op, uint8_t*
|
||||
/* - * ? ? * ? ? - */
|
||||
/* TODO: L */
|
||||
/* U,E - Will not be set correctly by this instruction*/
|
||||
if ( *((uint64_t*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D) & U64(0x000000ffffff0000)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ( *((uint64_t*)D) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D) & 0x000000ffffff0000U) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
DSP56K_V_CLEAR();
|
||||
|
||||
cycles += 2;
|
||||
@ -3231,13 +3231,13 @@ static size_t dsp56k_op_macsuuu(dsp56k_core* cpustate, const uint16_t op, uint8_
|
||||
(*((uint64_t*)D)) += result;
|
||||
|
||||
/* And out the bits that don't live in the register */
|
||||
(*((uint64_t*)D)) &= U64(0x000000ffffffffff);
|
||||
(*((uint64_t*)D)) &= 0x000000ffffffffffU;
|
||||
|
||||
/* S L E U N Z V C */
|
||||
/* - * * * * * * - */
|
||||
/* TODO: L, E, U, V */
|
||||
if ( *((uint64_t*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ( *((uint64_t*)D) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D) & 0x000000ffffffffffU) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
|
||||
cycles += 2;
|
||||
return 1;
|
||||
@ -3702,13 +3702,13 @@ static size_t dsp56k_op_mpysuuu(dsp56k_core* cpustate, const uint16_t op, uint8_
|
||||
(*((uint64_t*)D)) = result;
|
||||
|
||||
/* And out the bits that don't live in the register */
|
||||
(*((uint64_t*)D)) &= U64(0x000000ffffffffff);
|
||||
(*((uint64_t*)D)) &= 0x000000ffffffffffU;
|
||||
|
||||
/* S L E U N Z V C */
|
||||
/* - * * * * * * - */
|
||||
/* TODO: L, E, U, V */
|
||||
if ( *((uint64_t*)D) & U64(0x0000008000000000)) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D) & U64(0x000000ffffffffff)) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
if ( *((uint64_t*)D) & 0x0000008000000000U) DSP56K_N_SET(); else DSP56K_N_CLEAR();
|
||||
if ((*((uint64_t*)D) & 0x000000ffffffffffU) == 0) DSP56K_Z_SET(); else DSP56K_Z_CLEAR();
|
||||
|
||||
cycles += 2;
|
||||
return 1;
|
||||
@ -4828,7 +4828,7 @@ static void SetDestinationValue(typed_pointer source, typed_pointer dest)
|
||||
case DT_BYTE: *((uint8_t*)dest.addr) = (*((uint8_t*) source.addr)) & 0xff; break;
|
||||
case DT_WORD: *((uint8_t*)dest.addr) = (*((uint16_t*)source.addr)) & 0x00ff; break;
|
||||
case DT_DOUBLE_WORD: *((uint8_t*)dest.addr) = (*((uint32_t*)source.addr)) & 0x000000ff; break;
|
||||
case DT_LONG_WORD: *((uint8_t*)dest.addr) = (*((uint64_t*)source.addr)) & U64(0x00000000000000ff); break;
|
||||
case DT_LONG_WORD: *((uint8_t*)dest.addr) = (*((uint64_t*)source.addr)) & 0x00000000000000ffU; break;
|
||||
}
|
||||
break ;
|
||||
|
||||
@ -4839,7 +4839,7 @@ static void SetDestinationValue(typed_pointer source, typed_pointer dest)
|
||||
case DT_BYTE: *((uint16_t*)dest.addr) = (*((uint8_t*) source.addr)) & 0xff; break;
|
||||
case DT_WORD: *((uint16_t*)dest.addr) = (*((uint16_t*)source.addr)) & 0xffff; break;
|
||||
case DT_DOUBLE_WORD: *((uint16_t*)dest.addr) = (*((uint32_t*)source.addr)) & 0x0000ffff; break;
|
||||
case DT_LONG_WORD: *((uint16_t*)dest.addr) = (*((uint64_t*)source.addr)) & U64(0x000000000000ffff); break; /* TODO: Shift limiter action! A-147 */
|
||||
case DT_LONG_WORD: *((uint16_t*)dest.addr) = (*((uint64_t*)source.addr)) & 0x000000000000ffffU; break; /* TODO: Shift limiter action! A-147 */
|
||||
}
|
||||
break ;
|
||||
|
||||
@ -4850,7 +4850,7 @@ static void SetDestinationValue(typed_pointer source, typed_pointer dest)
|
||||
case DT_BYTE: *((uint32_t*)dest.addr) = (*((uint8_t*) source.addr)) & 0xff; break;
|
||||
case DT_WORD: *((uint32_t*)dest.addr) = (*((uint16_t*)source.addr)) & 0xffff; break;
|
||||
case DT_DOUBLE_WORD: *((uint32_t*)dest.addr) = (*((uint32_t*)source.addr)) & 0xffffffff; break;
|
||||
case DT_LONG_WORD: *((uint32_t*)dest.addr) = (*((uint64_t*)source.addr)) & U64(0x00000000ffffffff); break;
|
||||
case DT_LONG_WORD: *((uint32_t*)dest.addr) = (*((uint64_t*)source.addr)) & 0x00000000ffffffffU; break;
|
||||
}
|
||||
break ;
|
||||
|
||||
@ -4861,12 +4861,12 @@ static void SetDestinationValue(typed_pointer source, typed_pointer dest)
|
||||
case DT_BYTE: *((uint64_t*)dest.addr) = (*((uint8_t*)source.addr)) & 0xff; break;
|
||||
|
||||
case DT_WORD: destinationValue = (*((uint16_t*)source.addr)) << 16;
|
||||
if (destinationValue & U64(0x0000000080000000))
|
||||
destinationValue |= U64(0x000000ff00000000);
|
||||
if (destinationValue & 0x0000000080000000U)
|
||||
destinationValue |= 0x000000ff00000000U;
|
||||
*((uint64_t*)dest.addr) = (uint64_t)destinationValue; break; /* Forget not, yon shift register */
|
||||
|
||||
case DT_DOUBLE_WORD: *((uint64_t*)dest.addr) = (*((uint32_t*)source.addr)) & 0xffffffff; break;
|
||||
case DT_LONG_WORD: *((uint64_t*)dest.addr) = (*((uint64_t*)source.addr)) & U64(0x000000ffffffffff); break;
|
||||
case DT_LONG_WORD: *((uint64_t*)dest.addr) = (*((uint64_t*)source.addr)) & 0x000000ffffffffffU; break;
|
||||
}
|
||||
break ;
|
||||
}
|
||||
@ -4883,7 +4883,7 @@ static void SetDataMemoryValue(dsp56k_core* cpustate, typed_pointer source, uint
|
||||
|
||||
/* !!! Is this universal ??? */
|
||||
/* !!! Forget not, yon shift-limiter !!! */
|
||||
case DT_LONG_WORD: cpustate->data->write_word(destinationAddr, (uint16_t)( ((*((uint64_t*)source.addr)) & U64(0x00000000ffff0000)) >> 16) ) ; break ;
|
||||
case DT_LONG_WORD: cpustate->data->write_word(destinationAddr, (uint16_t)( ((*((uint64_t*)source.addr)) & 0x00000000ffff0000U) >> 16) ) ; break ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -4898,6 +4898,6 @@ static void SetProgramMemoryValue(dsp56k_core* cpustate, typed_pointer source, u
|
||||
|
||||
/* !!! Is this universal ??? */
|
||||
/* !!! Forget not, yon shift-limiter !!! */
|
||||
case DT_LONG_WORD: cpustate->program->write_word(destinationAddr, (uint16_t)( ((*((uint64_t*)source.addr)) & U64(0x00000000ffff0000)) >> 16) ) ; break ;
|
||||
case DT_LONG_WORD: cpustate->program->write_word(destinationAddr, (uint16_t)( ((*((uint64_t*)source.addr)) & 0x00000000ffff0000U) >> 16) ) ; break ;
|
||||
}
|
||||
}
|
||||
|
@ -2858,7 +2858,7 @@ void hyperstone_device::hyperstone_sardi(struct hyperstone_device::regs_decode *
|
||||
int i;
|
||||
for( i = 0; i < N_VALUE; i++ )
|
||||
{
|
||||
val |= (U64(0x8000000000000000) >> i);
|
||||
val |= (0x8000000000000000U >> i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2908,7 +2908,7 @@ void hyperstone_device::hyperstone_sard(struct hyperstone_device::regs_decode *d
|
||||
int i;
|
||||
for( i = 0; i < n; i++ )
|
||||
{
|
||||
val |= (U64(0x8000000000000000) >> i);
|
||||
val |= (0x8000000000000000U >> i);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2965,7 +2965,7 @@ void hyperstone_device::hyperstone_shldi(struct hyperstone_device::regs_decode *
|
||||
low_order = DREGF;
|
||||
|
||||
val = concat_64(high_order, low_order);
|
||||
SET_C( (N_VALUE)?(((val<<(N_VALUE-1))&U64(0x8000000000000000))?1:0):0);
|
||||
SET_C( (N_VALUE)?(((val<<(N_VALUE-1))&0x8000000000000000U)?1:0):0);
|
||||
mask = ((((uint64_t)1) << (32 - N_VALUE)) - 1) ^ 0xffffffff;
|
||||
tmp = high_order << N_VALUE;
|
||||
|
||||
@ -3009,7 +3009,7 @@ void hyperstone_device::hyperstone_shld(struct hyperstone_device::regs_decode *d
|
||||
mask = ((((uint64_t)1) << (32 - n)) - 1) ^ 0xffffffff;
|
||||
|
||||
val = concat_64(high_order, low_order);
|
||||
SET_C( (n)?(((val<<(n-1))&U64(0x8000000000000000))?1:0):0);
|
||||
SET_C( (n)?(((val<<(n-1))&0x8000000000000000U)?1:0):0);
|
||||
tmp = high_order << n;
|
||||
|
||||
if( ((high_order & mask) && (!(tmp & 0x80000000))) ||
|
||||
|
@ -16,8 +16,8 @@
|
||||
static const int32_t MIN_24 = -(1 << 23);
|
||||
static const int32_t MAX_24 = (1 << 23) - 1;
|
||||
|
||||
static const int64_t MIN_48 = -(S64(1) << 47);
|
||||
static const int64_t MAX_48 = (S64(1) << 47) - 1;
|
||||
static const int64_t MIN_48 = -(s64(1) << 47);
|
||||
static const int64_t MAX_48 = (s64(1) << 47) - 1;
|
||||
|
||||
#define SIGN_BIT_24 (0x00800000)
|
||||
#define GET_SIGN_BIT_24(x) ((x) & SIGN_BIT_24)
|
||||
@ -27,8 +27,8 @@ static const int64_t MAX_48 = (S64(1) << 47) - 1;
|
||||
|
||||
static inline int32_t SX(int32_t x) { return IS_NEGATIVE(x) ? x | 0xff000000 : x & 0x00ffffff; }
|
||||
static inline int32_t SC(int32_t x) { return x & 0x00ffffff; }
|
||||
static inline int64_t SX64(int64_t x) { return (x & S64(0x0000800000000000)) ? x | S64(0xffff000000000000) : x & S64(0x0000ffffffffffff); }
|
||||
//static inline int64_t SC64(int64_t x) { return x & S64(0x0000ffffffffffff); }
|
||||
static inline int64_t SX64(int64_t x) { return (x & s64(0x0000800000000000U)) ? x | s64(0xffff000000000000U) : x & s64(0x0000ffffffffffffU); }
|
||||
//static inline int64_t SC64(int64_t x) { return x & s64(0x0000ffffffffffffU); }
|
||||
|
||||
#define VERBOSE 0
|
||||
#define VERBOSE_EXEC 0
|
||||
@ -422,12 +422,12 @@ WRITE8_MEMBER(es5510_device::host_w)
|
||||
break;
|
||||
|
||||
/* 0x03 to 0x08 INSTR Register */
|
||||
case 0x03: instr_latch = ((instr_latch&U64(0x00ffffffffff)) | ((int64_t)data&0xff)<<40); LOG(("%s",string_format("ES5510: Host Write INSTR latch[5] = %02x -> %012I64x\n", data, instr_latch).c_str())); break;
|
||||
case 0x04: instr_latch = ((instr_latch&U64(0xff00ffffffff)) | ((int64_t)data&0xff)<<32); LOG(("%s",string_format("ES5510: Host Write INSTR latch[4] = %02x -> %012I64x\n", data, instr_latch).c_str())); break;
|
||||
case 0x05: instr_latch = ((instr_latch&U64(0xffff00ffffff)) | ((int64_t)data&0xff)<<24); LOG(("%s",string_format("ES5510: Host Write INSTR latch[3] = %02x -> %012I64x\n", data, instr_latch).c_str())); break;
|
||||
case 0x06: instr_latch = ((instr_latch&U64(0xffffff00ffff)) | ((int64_t)data&0xff)<<16); LOG(("%s",string_format("ES5510: Host Write INSTR latch[2] = %02x -> %012I64x\n", data, instr_latch).c_str())); break;
|
||||
case 0x07: instr_latch = ((instr_latch&U64(0xffffffff00ff)) | ((int64_t)data&0xff)<< 8); LOG(("%s",string_format("ES5510: Host Write INSTR latch[1] = %02x -> %012I64x\n", data, instr_latch).c_str())); break;
|
||||
case 0x08: instr_latch = ((instr_latch&U64(0xffffffffff00)) | ((int64_t)data&0xff)<< 0); LOG(("%s",string_format("ES5510: Host Write INSTR latch[0] = %02x -> %012I64x\n", data, instr_latch).c_str())); break;
|
||||
case 0x03: instr_latch = ((instr_latch&0x00ffffffffffU) | ((int64_t)data&0xff)<<40); LOG(("%s",string_format("ES5510: Host Write INSTR latch[5] = %02x -> %012I64x\n", data, instr_latch).c_str())); break;
|
||||
case 0x04: instr_latch = ((instr_latch&0xff00ffffffffU) | ((int64_t)data&0xff)<<32); LOG(("%s",string_format("ES5510: Host Write INSTR latch[4] = %02x -> %012I64x\n", data, instr_latch).c_str())); break;
|
||||
case 0x05: instr_latch = ((instr_latch&0xffff00ffffffU) | ((int64_t)data&0xff)<<24); LOG(("%s",string_format("ES5510: Host Write INSTR latch[3] = %02x -> %012I64x\n", data, instr_latch).c_str())); break;
|
||||
case 0x06: instr_latch = ((instr_latch&0xffffff00ffffU) | ((int64_t)data&0xff)<<16); LOG(("%s",string_format("ES5510: Host Write INSTR latch[2] = %02x -> %012I64x\n", data, instr_latch).c_str())); break;
|
||||
case 0x07: instr_latch = ((instr_latch&0xffffffff00ffU) | ((int64_t)data&0xff)<< 8); LOG(("%s",string_format("ES5510: Host Write INSTR latch[1] = %02x -> %012I64x\n", data, instr_latch).c_str())); break;
|
||||
case 0x08: instr_latch = ((instr_latch&0xffffffffff00U) | ((int64_t)data&0xff)<< 0); LOG(("%s",string_format("ES5510: Host Write INSTR latch[0] = %02x -> %012I64x\n", data, instr_latch).c_str())); break;
|
||||
|
||||
/* 0x09 to 0x0b DIL Register (r/o) */
|
||||
|
||||
@ -477,7 +477,7 @@ WRITE8_MEMBER(es5510_device::host_w)
|
||||
break;
|
||||
|
||||
case 0x80: /* Read select - GPR + INSTR */
|
||||
LOG(("%s",string_format("ES5510: Host Read INSTR+GPR %02x (%s): %012I64x %06x (%d)\n", data, REGNAME(data & 0xff), instr[data] & U64(0xffffffffffff), gpr[data] & 0xffffff, gpr[data]).c_str()));
|
||||
LOG(("%s",string_format("ES5510: Host Read INSTR+GPR %02x (%s): %012I64x %06x (%d)\n", data, REGNAME(data & 0xff), instr[data] & 0xffffffffffffU, gpr[data] & 0xffffff, gpr[data]).c_str()));
|
||||
|
||||
/* Check if an INSTR address is selected */
|
||||
if (data < 0xa0) {
|
||||
@ -498,10 +498,10 @@ WRITE8_MEMBER(es5510_device::host_w)
|
||||
case 0xc0: /* Write select - INSTR */
|
||||
#if VERBOSE
|
||||
DESCRIBE_INSTR(buf, instr_latch, gpr[data], nullptr, nullptr, nullptr, nullptr);
|
||||
LOG(("%s",string_format("ES5510: Host Write INSTR %02x %012I64x: %s\n", data, instr_latch&U64(0xffffffffffff), buf).c_str()));
|
||||
LOG(("%s",string_format("ES5510: Host Write INSTR %02x %012I64x: %s\n", data, instr_latch&0xffffffffffffU, buf).c_str()));
|
||||
#endif
|
||||
if (data < 0xa0) {
|
||||
instr[data] = instr_latch&U64(0xffffffffffff);
|
||||
instr[data] = instr_latch&0xffffffffffffU;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -802,7 +802,7 @@ void es5510_device::execute_run() {
|
||||
}
|
||||
#endif
|
||||
machl = mulacc.result;
|
||||
int32_t tmp = mac_overflow ? (machl < 0 ? MIN_24 : MAX_24) : (mulacc.result & U64(0x0000ffffff000000)) >> 24;
|
||||
int32_t tmp = mac_overflow ? (machl < 0 ? MIN_24 : MAX_24) : (mulacc.result & 0x0000ffffff000000U) >> 24;
|
||||
if (mulacc.dst & SRC_DST_REG) {
|
||||
write_reg(mulacc.cReg, tmp);
|
||||
}
|
||||
@ -1052,7 +1052,7 @@ void es5510_device::write_reg(uint8_t reg, int32_t value)
|
||||
#if VERBOSE_EXEC
|
||||
old = machl;
|
||||
#endif
|
||||
int64_t masked = machl & (S64(0x00ffffff) << 24);
|
||||
int64_t masked = machl & (s64(0x00ffffffU) << 24);
|
||||
int64_t shifted = (int64_t)(value & 0x00ffffff) << 0;
|
||||
machl = SX64(masked | shifted);
|
||||
#if VERBOSE_EXEC
|
||||
@ -1064,7 +1064,7 @@ void es5510_device::write_reg(uint8_t reg, int32_t value)
|
||||
#if VERBOSE_EXEC
|
||||
old = machl;
|
||||
#endif
|
||||
int64_t masked = machl & (S64(0x00ffffff) << 0);
|
||||
int64_t masked = machl & (s64(0x00ffffffU) << 0);
|
||||
int64_t shifted = (int64_t)(value & 0x00ffffff) << 24;
|
||||
machl = SX64(masked | shifted);
|
||||
mac_overflow = false;
|
||||
|
@ -799,7 +799,7 @@ uint32_t h8_device::do_add32(uint32_t v1, uint32_t v2)
|
||||
CCR |= F_N;
|
||||
if(~(v1^v2) & (v1^res) & 0x80000000)
|
||||
CCR |= F_V;
|
||||
if(res & U64(0x100000000))
|
||||
if(res & 0x100000000U)
|
||||
CCR |= F_C;
|
||||
return res;
|
||||
}
|
||||
@ -891,7 +891,7 @@ uint32_t h8_device::do_sub32(uint32_t v1, uint32_t v2)
|
||||
CCR |= F_N;
|
||||
if((v1^v2) & (v1^res) & 0x80000000)
|
||||
CCR |= F_V;
|
||||
if(res & U64(0x100000000))
|
||||
if(res & 0x100000000U)
|
||||
CCR |= F_C;
|
||||
return res;
|
||||
}
|
||||
|
@ -4417,36 +4417,36 @@ void i386_device::sse_predicate_compare_double(uint8_t imm8, XMM_REG d, XMM_REG
|
||||
switch (imm8 & 7)
|
||||
{
|
||||
case 0:
|
||||
d.q[0]=d.f64[0] == s.f64[0] ? U64(0xffffffffffffffff) : 0;
|
||||
d.q[1]=d.f64[1] == s.f64[1] ? U64(0xffffffffffffffff) : 0;
|
||||
d.q[0]=d.f64[0] == s.f64[0] ? 0xffffffffffffffffU : 0;
|
||||
d.q[1]=d.f64[1] == s.f64[1] ? 0xffffffffffffffffU : 0;
|
||||
break;
|
||||
case 1:
|
||||
d.q[0]=d.f64[0] < s.f64[0] ? U64(0xffffffffffffffff) : 0;
|
||||
d.q[1]=d.f64[1] < s.f64[1] ? U64(0xffffffffffffffff) : 0;
|
||||
d.q[0]=d.f64[0] < s.f64[0] ? 0xffffffffffffffffU : 0;
|
||||
d.q[1]=d.f64[1] < s.f64[1] ? 0xffffffffffffffffU : 0;
|
||||
break;
|
||||
case 2:
|
||||
d.q[0]=d.f64[0] <= s.f64[0] ? U64(0xffffffffffffffff) : 0;
|
||||
d.q[1]=d.f64[1] <= s.f64[1] ? U64(0xffffffffffffffff) : 0;
|
||||
d.q[0]=d.f64[0] <= s.f64[0] ? 0xffffffffffffffffU : 0;
|
||||
d.q[1]=d.f64[1] <= s.f64[1] ? 0xffffffffffffffffU : 0;
|
||||
break;
|
||||
case 3:
|
||||
d.q[0]=sse_isdoubleunordered(d.f64[0], s.f64[0]) ? U64(0xffffffffffffffff) : 0;
|
||||
d.q[1]=sse_isdoubleunordered(d.f64[1], s.f64[1]) ? U64(0xffffffffffffffff) : 0;
|
||||
d.q[0]=sse_isdoubleunordered(d.f64[0], s.f64[0]) ? 0xffffffffffffffffU : 0;
|
||||
d.q[1]=sse_isdoubleunordered(d.f64[1], s.f64[1]) ? 0xffffffffffffffffU : 0;
|
||||
break;
|
||||
case 4:
|
||||
d.q[0]=d.f64[0] != s.f64[0] ? U64(0xffffffffffffffff) : 0;
|
||||
d.q[1]=d.f64[1] != s.f64[1] ? U64(0xffffffffffffffff) : 0;
|
||||
d.q[0]=d.f64[0] != s.f64[0] ? 0xffffffffffffffffU : 0;
|
||||
d.q[1]=d.f64[1] != s.f64[1] ? 0xffffffffffffffffU : 0;
|
||||
break;
|
||||
case 5:
|
||||
d.q[0]=d.f64[0] < s.f64[0] ? 0 : U64(0xffffffffffffffff);
|
||||
d.q[1]=d.f64[1] < s.f64[1] ? 0 : U64(0xffffffffffffffff);
|
||||
d.q[0]=d.f64[0] < s.f64[0] ? 0 : 0xffffffffffffffffU;
|
||||
d.q[1]=d.f64[1] < s.f64[1] ? 0 : 0xffffffffffffffffU;
|
||||
break;
|
||||
case 6:
|
||||
d.q[0]=d.f64[0] <= s.f64[0] ? 0 : U64(0xffffffffffffffff);
|
||||
d.q[1]=d.f64[1] <= s.f64[1] ? 0 : U64(0xffffffffffffffff);
|
||||
d.q[0]=d.f64[0] <= s.f64[0] ? 0 : 0xffffffffffffffffU;
|
||||
d.q[1]=d.f64[1] <= s.f64[1] ? 0 : 0xffffffffffffffffU;
|
||||
break;
|
||||
case 7:
|
||||
d.q[0]=sse_isdoubleordered(d.f64[0], s.f64[0]) ? U64(0xffffffffffffffff) : 0;
|
||||
d.q[1]=sse_isdoubleordered(d.f64[1], s.f64[1]) ? U64(0xffffffffffffffff) : 0;
|
||||
d.q[0]=sse_isdoubleordered(d.f64[0], s.f64[0]) ? 0xffffffffffffffffU : 0;
|
||||
d.q[1]=sse_isdoubleordered(d.f64[1], s.f64[1]) ? 0xffffffffffffffffU : 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -4487,28 +4487,28 @@ void i386_device::sse_predicate_compare_double_scalar(uint8_t imm8, XMM_REG d, X
|
||||
switch (imm8 & 7)
|
||||
{
|
||||
case 0:
|
||||
d.q[0]=d.f64[0] == s.f64[0] ? U64(0xffffffffffffffff) : 0;
|
||||
d.q[0]=d.f64[0] == s.f64[0] ? 0xffffffffffffffffU : 0;
|
||||
break;
|
||||
case 1:
|
||||
d.q[0]=d.f64[0] < s.f64[0] ? U64(0xffffffffffffffff) : 0;
|
||||
d.q[0]=d.f64[0] < s.f64[0] ? 0xffffffffffffffffU : 0;
|
||||
break;
|
||||
case 2:
|
||||
d.q[0]=d.f64[0] <= s.f64[0] ? U64(0xffffffffffffffff) : 0;
|
||||
d.q[0]=d.f64[0] <= s.f64[0] ? 0xffffffffffffffffU : 0;
|
||||
break;
|
||||
case 3:
|
||||
d.q[0]=sse_isdoubleunordered(d.f64[0], s.f64[0]) ? U64(0xffffffffffffffff) : 0;
|
||||
d.q[0]=sse_isdoubleunordered(d.f64[0], s.f64[0]) ? 0xffffffffffffffffU : 0;
|
||||
break;
|
||||
case 4:
|
||||
d.q[0]=d.f64[0] != s.f64[0] ? U64(0xffffffffffffffff) : 0;
|
||||
d.q[0]=d.f64[0] != s.f64[0] ? 0xffffffffffffffffU : 0;
|
||||
break;
|
||||
case 5:
|
||||
d.q[0]=d.f64[0] < s.f64[0] ? 0 : U64(0xffffffffffffffff);
|
||||
d.q[0]=d.f64[0] < s.f64[0] ? 0 : 0xffffffffffffffffU;
|
||||
break;
|
||||
case 6:
|
||||
d.q[0]=d.f64[0] <= s.f64[0] ? 0 : U64(0xffffffffffffffff);
|
||||
d.q[0]=d.f64[0] <= s.f64[0] ? 0 : 0xffffffffffffffffU;
|
||||
break;
|
||||
case 7:
|
||||
d.q[0]=sse_isdoubleordered(d.f64[0], s.f64[0]) ? U64(0xffffffffffffffff) : 0;
|
||||
d.q[0]=sse_isdoubleordered(d.f64[0], s.f64[0]) ? 0xffffffffffffffffU : 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -91,11 +91,11 @@
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static const floatx80 fx80_zero = { 0x0000, U64(0x0000000000000000) };
|
||||
static const floatx80 fx80_one = { 0x3fff, U64(0x8000000000000000) };
|
||||
static const floatx80 fx80_zero = { 0x0000, 0x0000000000000000U };
|
||||
static const floatx80 fx80_one = { 0x3fff, 0x8000000000000000U };
|
||||
|
||||
static const floatx80 fx80_ninf = { 0xffff, U64(0x8000000000000000) };
|
||||
static const floatx80 fx80_inan = { 0xffff, U64(0xc000000000000000) };
|
||||
static const floatx80 fx80_ninf = { 0xffff, 0x8000000000000000U };
|
||||
static const floatx80 fx80_inan = { 0xffff, 0xc000000000000000U };
|
||||
|
||||
/* Maps x87 round modes to SoftFloat round modes */
|
||||
static const int x87_to_sf_rc[4] =
|
||||
@ -141,7 +141,7 @@ static inline int floatx80_is_inf(floatx80 fx)
|
||||
static inline int floatx80_is_denormal(floatx80 fx)
|
||||
{
|
||||
return (((fx.high & 0x7fff) == 0) &&
|
||||
((fx.low & U64(0x8000000000000000)) == 0) &&
|
||||
((fx.low & 0x8000000000000000U) == 0) &&
|
||||
((fx.low << 1) != 0));
|
||||
}
|
||||
|
||||
@ -3104,21 +3104,21 @@ void i386_device::x87_fistp_m64int(uint8_t modrm)
|
||||
if (X87_IS_ST_EMPTY(0))
|
||||
{
|
||||
x87_set_stack_underflow();
|
||||
m64int = U64(0x8000000000000000);
|
||||
m64int = 0x8000000000000000U;
|
||||
}
|
||||
else
|
||||
{
|
||||
floatx80 fx80 = floatx80_round_to_int(ST(0));
|
||||
|
||||
floatx80 lowerLim = int64_to_floatx80(U64(0x8000000000000000));
|
||||
floatx80 upperLim = int64_to_floatx80(U64(0x7fffffffffffffff));
|
||||
floatx80 lowerLim = int64_to_floatx80(0x8000000000000000U);
|
||||
floatx80 upperLim = int64_to_floatx80(0x7fffffffffffffffU);
|
||||
|
||||
m_x87_sw &= ~X87_SW_C1;
|
||||
|
||||
if (!floatx80_lt(fx80, lowerLim) && floatx80_le(fx80, upperLim))
|
||||
m64int = floatx80_to_int64(fx80);
|
||||
else
|
||||
m64int = U64(0x8000000000000000);
|
||||
m64int = 0x8000000000000000U;
|
||||
}
|
||||
|
||||
uint32_t ea = GetEA(modrm, 1);
|
||||
@ -3210,9 +3210,9 @@ void i386_device::x87_fldl2t(uint8_t modrm)
|
||||
value.high = 0x4000;
|
||||
|
||||
if (X87_RC == X87_CW_RC_UP)
|
||||
value.low = U64(0xd49a784bcd1b8aff);
|
||||
value.low = 0xd49a784bcd1b8affU;
|
||||
else
|
||||
value.low = U64(0xd49a784bcd1b8afe);
|
||||
value.low = 0xd49a784bcd1b8afeU;
|
||||
|
||||
m_x87_sw &= ~X87_SW_C1;
|
||||
}
|
||||
@ -3243,9 +3243,9 @@ void i386_device::x87_fldl2e(uint8_t modrm)
|
||||
value.high = 0x3fff;
|
||||
|
||||
if (rc == X87_CW_RC_UP || rc == X87_CW_RC_NEAREST)
|
||||
value.low = U64(0xb8aa3b295c17f0bc);
|
||||
value.low = 0xb8aa3b295c17f0bcU;
|
||||
else
|
||||
value.low = U64(0xb8aa3b295c17f0bb);
|
||||
value.low = 0xb8aa3b295c17f0bbU;
|
||||
|
||||
m_x87_sw &= ~X87_SW_C1;
|
||||
}
|
||||
@ -3276,9 +3276,9 @@ void i386_device::x87_fldpi(uint8_t modrm)
|
||||
value.high = 0x4000;
|
||||
|
||||
if (rc == X87_CW_RC_UP || rc == X87_CW_RC_NEAREST)
|
||||
value.low = U64(0xc90fdaa22168c235);
|
||||
value.low = 0xc90fdaa22168c235U;
|
||||
else
|
||||
value.low = U64(0xc90fdaa22168c234);
|
||||
value.low = 0xc90fdaa22168c234U;
|
||||
|
||||
m_x87_sw &= ~X87_SW_C1;
|
||||
}
|
||||
@ -3309,9 +3309,9 @@ void i386_device::x87_fldlg2(uint8_t modrm)
|
||||
value.high = 0x3ffd;
|
||||
|
||||
if (rc == X87_CW_RC_UP || rc == X87_CW_RC_NEAREST)
|
||||
value.low = U64(0x9a209a84fbcff799);
|
||||
value.low = 0x9a209a84fbcff799U;
|
||||
else
|
||||
value.low = U64(0x9a209a84fbcff798);
|
||||
value.low = 0x9a209a84fbcff798U;
|
||||
|
||||
m_x87_sw &= ~X87_SW_C1;
|
||||
}
|
||||
@ -3342,9 +3342,9 @@ void i386_device::x87_fldln2(uint8_t modrm)
|
||||
value.high = 0x3ffe;
|
||||
|
||||
if (rc == X87_CW_RC_UP || rc == X87_CW_RC_NEAREST)
|
||||
value.low = U64(0xb17217f7d1cf79ac);
|
||||
value.low = 0xb17217f7d1cf79acU;
|
||||
else
|
||||
value.low = U64(0xb17217f7d1cf79ab);
|
||||
value.low = 0xb17217f7d1cf79abU;
|
||||
|
||||
m_x87_sw &= ~X87_SW_C1;
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ class m68000_base_device;
|
||||
#define GET_MSB_16(A) ((A) & 0x8000)
|
||||
#define GET_MSB_17(A) ((A) & 0x10000)
|
||||
#define GET_MSB_32(A) ((A) & 0x80000000)
|
||||
#define GET_MSB_33(A) ((A) & U64(0x100000000))
|
||||
#define GET_MSB_33(A) ((A) & 0x100000000U)
|
||||
|
||||
/* Isolate nibbles */
|
||||
#define LOW_NIBBLE(A) ((A) & 0x0f)
|
||||
@ -168,8 +168,8 @@ class m68000_base_device;
|
||||
#define MASK_OUT_BELOW_16(A) ((A) & ~0xffff)
|
||||
|
||||
/* No need to mask if we are 32 bit */
|
||||
#define MASK_OUT_ABOVE_32(A) ((A) & U64(0xffffffff))
|
||||
#define MASK_OUT_BELOW_32(A) ((A) & ~U64(0xffffffff))
|
||||
#define MASK_OUT_ABOVE_32(A) ((A) & u64(0xffffffffU))
|
||||
#define MASK_OUT_BELOW_32(A) ((A) & ~u64(0xffffffffU))
|
||||
|
||||
/* Shift & Rotate Macros. */
|
||||
#define LSL(A, C) ((A) << (C))
|
||||
|
@ -10,9 +10,9 @@
|
||||
#define FPES_OE 0x00002000
|
||||
#define FPAE_IOP 0x00000080
|
||||
|
||||
#define DOUBLE_INFINITY U64(0x7ff0000000000000)
|
||||
#define DOUBLE_EXPONENT U64(0x7ff0000000000000)
|
||||
#define DOUBLE_MANTISSA U64(0x000fffffffffffff)
|
||||
#define DOUBLE_INFINITY 0x7ff0000000000000U
|
||||
#define DOUBLE_EXPONENT 0x7ff0000000000000U
|
||||
#define DOUBLE_MANTISSA 0x000fffffffffffffU
|
||||
|
||||
extern flag floatx80_is_nan( floatx80 a );
|
||||
|
||||
@ -1239,27 +1239,27 @@ static void fpgen_rm_reg(m68000_base_device *m68k, uint16_t w2)
|
||||
{
|
||||
case 0x0: // Pi
|
||||
source.high = 0x4000;
|
||||
source.low = U64(0xc90fdaa22168c235);
|
||||
source.low = 0xc90fdaa22168c235U;
|
||||
break;
|
||||
|
||||
case 0xb: // log10(2)
|
||||
source.high = 0x3ffd;
|
||||
source.low = U64(0x9a209a84fbcff798);
|
||||
source.low = 0x9a209a84fbcff798U;
|
||||
break;
|
||||
|
||||
case 0xc: // e
|
||||
source.high = 0x4000;
|
||||
source.low = U64(0xadf85458a2bb4a9b);
|
||||
source.low = 0xadf85458a2bb4a9bU;
|
||||
break;
|
||||
|
||||
case 0xd: // log2(e)
|
||||
source.high = 0x3fff;
|
||||
source.low = U64(0xb8aa3b295c17f0bc);
|
||||
source.low = 0xb8aa3b295c17f0bcU;
|
||||
break;
|
||||
|
||||
case 0xe: // log10(e)
|
||||
source.high = 0x3ffd;
|
||||
source.low = U64(0xde5bd8a937287195);
|
||||
source.low = 0xde5bd8a937287195U;
|
||||
break;
|
||||
|
||||
case 0xf: // 0.0
|
||||
@ -1268,12 +1268,12 @@ static void fpgen_rm_reg(m68000_base_device *m68k, uint16_t w2)
|
||||
|
||||
case 0x30: // ln(2)
|
||||
source.high = 0x3ffe;
|
||||
source.low = U64(0xb17217f7d1cf79ac);
|
||||
source.low = 0xb17217f7d1cf79acU;
|
||||
break;
|
||||
|
||||
case 0x31: // ln(10)
|
||||
source.high = 0x4000;
|
||||
source.low = U64(0x935d8dddaaa8ac17);
|
||||
source.low = 0x935d8dddaaa8ac17U;
|
||||
break;
|
||||
|
||||
case 0x32: // 1 (or 100? manuals are unclear, but 1 would make more sense)
|
||||
@ -1298,47 +1298,47 @@ static void fpgen_rm_reg(m68000_base_device *m68k, uint16_t w2)
|
||||
|
||||
case 0x37: // 1.0e16 - can't get the right precision from int32_t so go "direct" with constants from h/w
|
||||
source.high = 0x4034;
|
||||
source.low = U64(0x8e1bc9bf04000000);
|
||||
source.low = 0x8e1bc9bf04000000U;
|
||||
break;
|
||||
|
||||
case 0x38: // 1.0e32
|
||||
source.high = 0x4069;
|
||||
source.low = U64(0x9dc5ada82b70b59e);
|
||||
source.low = 0x9dc5ada82b70b59eU;
|
||||
break;
|
||||
|
||||
case 0x39: // 1.0e64
|
||||
source.high = 0x40d3;
|
||||
source.low = U64(0xc2781f49ffcfa6d5);
|
||||
source.low = 0xc2781f49ffcfa6d5U;
|
||||
break;
|
||||
|
||||
case 0x3a: // 1.0e128
|
||||
source.high = 0x41a8;
|
||||
source.low = U64(0x93ba47c980e98ce0);
|
||||
source.low = 0x93ba47c980e98ce0U;
|
||||
break;
|
||||
|
||||
case 0x3b: // 1.0e256
|
||||
source.high = 0x4351;
|
||||
source.low = U64(0xaa7eebfb9df9de8e);
|
||||
source.low = 0xaa7eebfb9df9de8eU;
|
||||
break;
|
||||
|
||||
case 0x3c: // 1.0e512
|
||||
source.high = 0x46a3;
|
||||
source.low = U64(0xe319a0aea60e91c7);
|
||||
source.low = 0xe319a0aea60e91c7U;
|
||||
break;
|
||||
|
||||
case 0x3d: // 1.0e1024
|
||||
source.high = 0x4d48;
|
||||
source.low = U64(0xc976758681750c17);
|
||||
source.low = 0xc976758681750c17U;
|
||||
break;
|
||||
|
||||
case 0x3e: // 1.0e2048
|
||||
source.high = 0x5a92;
|
||||
source.low = U64(0x9e8b3b5dc53d5de5);
|
||||
source.low = 0x9e8b3b5dc53d5de5U;
|
||||
break;
|
||||
|
||||
case 0x3f: // 1.0e4096
|
||||
source.high = 0x7525;
|
||||
source.low = U64(0xc46052028a20979b);
|
||||
source.low = 0xc46052028a20979bU;
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -2002,7 +2002,7 @@ static void do_frestore_null(m68000_base_device *m68k)
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
REG_FP(m68k)[i].high = 0x7fff;
|
||||
REG_FP(m68k)[i].low = U64(0xffffffffffffffff);
|
||||
REG_FP(m68k)[i].low = 0xffffffffffffffffU;
|
||||
}
|
||||
|
||||
// Mac IIci at 408458e6 wants an FSAVE of a just-restored nullptr frame to also be nullptr
|
||||
|
@ -2983,7 +2983,7 @@ void mips3_device::ldl_be(uint32_t op)
|
||||
{
|
||||
offs_t offs = SIMMVAL + RSVAL32;
|
||||
int shift = 8 * (offs & 7);
|
||||
uint64_t mask = U64(0xffffffffffffffff) << shift;
|
||||
uint64_t mask = 0xffffffffffffffffU << shift;
|
||||
uint64_t temp;
|
||||
|
||||
if (RDOUBLE_MASKED(offs & ~7, &temp, mask >> shift) && RTREG)
|
||||
@ -2994,7 +2994,7 @@ void mips3_device::ldr_be(uint32_t op)
|
||||
{
|
||||
offs_t offs = SIMMVAL + RSVAL32;
|
||||
int shift = 8 * (~offs & 7);
|
||||
uint64_t mask = U64(0xffffffffffffffff) >> shift;
|
||||
uint64_t mask = 0xffffffffffffffffU >> shift;
|
||||
uint64_t temp;
|
||||
|
||||
if (RDOUBLE_MASKED(offs & ~7, &temp, mask << shift) && RTREG)
|
||||
@ -3021,7 +3021,7 @@ void mips3_device::sdl_be(uint32_t op)
|
||||
{
|
||||
offs_t offs = SIMMVAL + RSVAL32;
|
||||
int shift = 8 * (offs & 7);
|
||||
uint64_t mask = U64(0xffffffffffffffff) >> shift;
|
||||
uint64_t mask = 0xffffffffffffffffU >> shift;
|
||||
WDOUBLE_MASKED(offs & ~7, RTVAL64 >> shift, mask);
|
||||
}
|
||||
|
||||
@ -3029,7 +3029,7 @@ void mips3_device::sdr_be(uint32_t op)
|
||||
{
|
||||
offs_t offs = SIMMVAL + RSVAL32;
|
||||
int shift = 8 * (~offs & 7);
|
||||
uint64_t mask = U64(0xffffffffffffffff) << shift;
|
||||
uint64_t mask = 0xffffffffffffffffU << shift;
|
||||
WDOUBLE_MASKED(offs & ~7, RTVAL64 << shift, mask);
|
||||
}
|
||||
|
||||
@ -3061,7 +3061,7 @@ void mips3_device::ldl_le(uint32_t op)
|
||||
{
|
||||
offs_t offs = SIMMVAL + RSVAL32;
|
||||
int shift = 8 * (~offs & 7);
|
||||
uint64_t mask = U64(0xffffffffffffffff) << shift;
|
||||
uint64_t mask = 0xffffffffffffffffU << shift;
|
||||
uint64_t temp;
|
||||
|
||||
if (RDOUBLE_MASKED(offs & ~7, &temp, mask >> shift) && RTREG)
|
||||
@ -3072,7 +3072,7 @@ void mips3_device::ldr_le(uint32_t op)
|
||||
{
|
||||
offs_t offs = SIMMVAL + RSVAL32;
|
||||
int shift = 8 * (offs & 7);
|
||||
uint64_t mask = U64(0xffffffffffffffff) >> shift;
|
||||
uint64_t mask = 0xffffffffffffffffU >> shift;
|
||||
uint64_t temp;
|
||||
|
||||
if (RDOUBLE_MASKED(offs & ~7, &temp, mask << shift) && RTREG)
|
||||
@ -3099,7 +3099,7 @@ void mips3_device::sdl_le(uint32_t op)
|
||||
{
|
||||
offs_t offs = SIMMVAL + RSVAL32;
|
||||
int shift = 8 * (~offs & 7);
|
||||
uint64_t mask = U64(0xffffffffffffffff) >> shift;
|
||||
uint64_t mask = 0xffffffffffffffffU >> shift;
|
||||
WDOUBLE_MASKED(offs & ~7, RTVAL64 >> shift, mask);
|
||||
}
|
||||
|
||||
@ -3107,6 +3107,6 @@ void mips3_device::sdr_le(uint32_t op)
|
||||
{
|
||||
offs_t offs = SIMMVAL + RSVAL32;
|
||||
int shift = 8 * (offs & 7);
|
||||
uint64_t mask = U64(0xffffffffffffffff) << shift;
|
||||
uint64_t mask = 0xffffffffffffffffU << shift;
|
||||
WDOUBLE_MASKED(offs & ~7, RTVAL64 << shift, mask);
|
||||
}
|
||||
|
@ -389,7 +389,7 @@ void mips3_device::tlb_write_common(int tlbindex)
|
||||
|
||||
/* fill in the new TLB entry from the COP0 registers */
|
||||
entry->page_mask = m_core->cpr[0][COP0_PageMask];
|
||||
entry->entry_hi = m_core->cpr[0][COP0_EntryHi] & ~(entry->page_mask & U64(0x0000000001ffe000));
|
||||
entry->entry_hi = m_core->cpr[0][COP0_EntryHi] & ~(entry->page_mask & u64(0x0000000001ffe000U));
|
||||
entry->entry_lo[0] = m_core->cpr[0][COP0_EntryLo0];
|
||||
entry->entry_lo[1] = m_core->cpr[0][COP0_EntryLo1];
|
||||
|
||||
|
@ -2946,7 +2946,7 @@ bool mips3_device::generate_cop1_fr0(drcuml_block *block, compiler_state *compil
|
||||
generate_get_cop1_reg64(block, compiler, desc, FSREG, F0); // dmov F0,<fsreg>
|
||||
UML_FDNEG(block, F1, F0); // fdneg F1,F0
|
||||
UML_DCMP(block, F0, 0); // cmp F0,0.0
|
||||
UML_DMOVc(block, COND_E, F1, U64(0x8000000000000000)); // dmov F1,-0.0,e
|
||||
UML_DMOVc(block, COND_E, F1, 0x8000000000000000U); // dmov F1,-0.0,e
|
||||
generate_set_cop1_reg64(block, compiler, desc, FDREG, F1); // dmov <fdreg>,F1
|
||||
}
|
||||
return true;
|
||||
|
@ -26,9 +26,9 @@
|
||||
CONSTANTS
|
||||
***************************************************************************/
|
||||
|
||||
#define DOUBLE_SIGN (U64(0x8000000000000000))
|
||||
#define DOUBLE_EXP (U64(0x7ff0000000000000))
|
||||
#define DOUBLE_FRAC (U64(0x000fffffffffffff))
|
||||
#define DOUBLE_SIGN (0x8000000000000000U)
|
||||
#define DOUBLE_EXP (0x7ff0000000000000U)
|
||||
#define DOUBLE_FRAC (0x000fffffffffffffU)
|
||||
#define DOUBLE_ZERO (0)
|
||||
|
||||
|
||||
@ -473,8 +473,8 @@ static inline int is_qnan_double(double x)
|
||||
{
|
||||
uint64_t xi = *(uint64_t*)&x;
|
||||
return( ((xi & DOUBLE_EXP) == DOUBLE_EXP) &&
|
||||
((xi & U64(0x0007fffffffffff)) == U64(0x000000000000000)) &&
|
||||
((xi & U64(0x000800000000000)) == U64(0x000800000000000)) );
|
||||
((xi & 0x0007fffffffffffU) == 0x000000000000000U) &&
|
||||
((xi & 0x000800000000000U) == 0x000800000000000U) );
|
||||
}
|
||||
|
||||
|
||||
@ -489,7 +489,7 @@ static inline int is_snan_double(double x)
|
||||
uint64_t xi = *(uint64_t*)&x;
|
||||
return( ((xi & DOUBLE_EXP) == DOUBLE_EXP) &&
|
||||
((xi & DOUBLE_FRAC) != DOUBLE_ZERO) &&
|
||||
((xi & U64(0x0008000000000000)) == DOUBLE_ZERO) );
|
||||
((xi & 0x0008000000000000U) == DOUBLE_ZERO) );
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1010,11 +1010,11 @@ void ppc_device::state_import(const device_state_entry &entry)
|
||||
break;
|
||||
|
||||
case PPC_TBL:
|
||||
set_timebase((get_timebase() & ~U64(0x00ffffff00000000)) | m_debugger_temp);
|
||||
set_timebase((get_timebase() & ~u64(0x00ffffff00000000U)) | m_debugger_temp);
|
||||
break;
|
||||
|
||||
case PPC_TBH:
|
||||
set_timebase((get_timebase() & ~U64(0x00000000ffffffff)) | ((uint64_t)(m_debugger_temp & 0x00ffffff) << 32));
|
||||
set_timebase((get_timebase() & ~u64(0x00000000ffffffffU)) | ((uint64_t)(m_debugger_temp & 0x00ffffff) << 32));
|
||||
break;
|
||||
|
||||
case PPC_DEC:
|
||||
@ -1763,10 +1763,10 @@ void ppc_device::ppccom_execute_mtspr()
|
||||
|
||||
/* timebase */
|
||||
case SPR603_TBL_W:
|
||||
set_timebase((get_timebase() & ~U64(0xffffffff00000000)) | m_core->param1);
|
||||
set_timebase((get_timebase() & ~u64(0xffffffff00000000U)) | m_core->param1);
|
||||
return;
|
||||
case SPR603_TBU_W:
|
||||
set_timebase((get_timebase() & ~U64(0x00000000ffffffff)) | ((uint64_t)m_core->param1 << 32));
|
||||
set_timebase((get_timebase() & ~u64(0x00000000ffffffffU)) | ((uint64_t)m_core->param1 << 32));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -1822,10 +1822,10 @@ void ppc_device::ppccom_execute_mtspr()
|
||||
|
||||
/* timebase */
|
||||
case SPR4XX_TBLO:
|
||||
set_timebase((get_timebase() & ~U64(0x00ffffff00000000)) | m_core->param1);
|
||||
set_timebase((get_timebase() & ~u64(0x00ffffff00000000U)) | m_core->param1);
|
||||
return;
|
||||
case SPR4XX_TBHI:
|
||||
set_timebase((get_timebase() & ~U64(0x00000000ffffffff)) | ((uint64_t)(m_core->param1 & 0x00ffffff) << 32));
|
||||
set_timebase((get_timebase() & ~u64(0x00000000ffffffffU)) | ((uint64_t)(m_core->param1 & 0x00ffffff) << 32));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1127,7 +1127,7 @@ void ppc_device::static_generate_memory_accessor(int mode, int size, int iswrite
|
||||
{
|
||||
UML_DLOAD(block, I3, fastbase, I0, SIZE_QWORD, SCALE_x1); // dload i3,fastbase,i0,qword_x1
|
||||
UML_DAND(block, I1, I1, I2); // dand i1,i1,i2
|
||||
UML_DXOR(block, I2, I2, U64(0xffffffffffffffff)); // dxor i2,i2,0xfffffffffffffffff
|
||||
UML_DXOR(block, I2, I2, 0xffffffffffffffffU); // dxor i2,i2,0xfffffffffffffffff
|
||||
UML_DAND(block, I3, I3, I2); // dand i3,i3,i2
|
||||
UML_DOR(block, I1, I1, I3); // dor i1,i1,i3
|
||||
}
|
||||
@ -1209,29 +1209,29 @@ void ppc_device::static_generate_memory_accessor(int mode, int size, int iswrite
|
||||
{
|
||||
if (iswrite)
|
||||
{
|
||||
UML_MOV(block, mem(&m_core->tempaddr), I0); // mov [tempaddr],i0
|
||||
UML_MOV(block, mem(&m_core->tempdata.w.l), I1); // mov [tempdata],i1
|
||||
UML_MOV(block, mem(&m_core->tempaddr), I0); // mov [tempaddr],i0
|
||||
UML_MOV(block, mem(&m_core->tempdata.w.l), I1); // mov [tempdata],i1
|
||||
UML_SUB(block, I0, I0, 1); // sub i0,i0,1
|
||||
UML_SHR(block, I1, I1, 8); // shr i1,i1,8
|
||||
UML_MOV(block, I2, 0x00ff); // mov i2,0x00ff
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_ADD(block, I0, mem(&m_core->tempaddr), 1); // add i0,[tempaddr],1
|
||||
UML_SHL(block, I1, mem(&m_core->tempdata.w.l), 8); // shl i1,[tempdata],8
|
||||
UML_MOV(block, I2, 0xff00); // mov i2,0xff00
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_MOV(block, I2, 0x00ff); // mov i2,0x00ff
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_ADD(block, I0, mem(&m_core->tempaddr), 1); // add i0,[tempaddr],1
|
||||
UML_SHL(block, I1, mem(&m_core->tempdata.w.l), 8); // shl i1,[tempdata],8
|
||||
UML_MOV(block, I2, 0xff00); // mov i2,0xff00
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
}
|
||||
else
|
||||
{
|
||||
UML_MOV(block, mem(&m_core->tempaddr), I0); // mov [tempaddr],i0
|
||||
UML_MOV(block, mem(&m_core->tempaddr), I0); // mov [tempaddr],i0
|
||||
UML_SUB(block, I0, I0, 1); // sub i0,i0,1
|
||||
UML_MOV(block, I2, 0x00ff); // mov i2,0x00ff
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_SHL(block, mem(&m_core->tempdata.w.l), I0, 8); // shl [tempdata],i0,8
|
||||
UML_ADD(block, I0, mem(&m_core->tempaddr), 1); // add i0,[tempaddr],1
|
||||
UML_MOV(block, I2, 0xff00); // mov i2,0xff00
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_MOV(block, I2, 0x00ff); // mov i2,0x00ff
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_SHL(block, mem(&m_core->tempdata.w.l), I0, 8); // shl [tempdata],i0,8
|
||||
UML_ADD(block, I0, mem(&m_core->tempaddr), 1); // add i0,[tempaddr],1
|
||||
UML_MOV(block, I2, 0xff00); // mov i2,0xff00
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_SHR(block, I0, I0, 8); // shr i0,i0,8
|
||||
UML_OR(block, I0, I0, mem(&m_core->tempdata.w.l)); // or i0,i0,[tempdata]
|
||||
UML_OR(block, I0, I0, mem(&m_core->tempdata.w.l)); // or i0,i0,[tempdata]
|
||||
}
|
||||
}
|
||||
else if (size == 4)
|
||||
@ -1239,108 +1239,108 @@ void ppc_device::static_generate_memory_accessor(int mode, int size, int iswrite
|
||||
int offs2, offs3;
|
||||
if (iswrite)
|
||||
{
|
||||
UML_MOV(block, mem(&m_core->tempaddr), I0); // mov [tempaddr],i0
|
||||
UML_MOV(block, mem(&m_core->tempdata.w.l), I1); // mov [tempdata],i1
|
||||
UML_TEST(block, I0, 2); // test i0,i0,2
|
||||
UML_JMPc(block, COND_NZ, offs2 = label++); // jnz offs2
|
||||
UML_MOV(block, mem(&m_core->tempaddr), I0); // mov [tempaddr],i0
|
||||
UML_MOV(block, mem(&m_core->tempdata.w.l), I1); // mov [tempdata],i1
|
||||
UML_TEST(block, I0, 2); // test i0,i0,2
|
||||
UML_JMPc(block, COND_NZ, offs2 = label++); // jnz offs2
|
||||
UML_SUB(block, I0, I0, 1); // sub i0,i0,1
|
||||
UML_SHR(block, I1, I1, 8); // shr i1,i1,8
|
||||
UML_MOV(block, I2, 0x00ffffff); // mov i2,0x00ffffff
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_ADD(block, I0, mem(&m_core->tempaddr), 3); // add i0,[tempaddr],3
|
||||
UML_SHL(block, I1, mem(&m_core->tempdata.w.l), 24); // shl i1,[tempdata],24
|
||||
UML_MOV(block, I2, 0xff000000); // mov i2,0xff000000
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_RET(block); // ret
|
||||
UML_LABEL(block, offs2); // offs2:
|
||||
UML_TEST(block, I0, 1); // test i0,i0,1
|
||||
UML_JMPc(block, COND_NZ, offs3 = label++); // jnz offs3
|
||||
UML_MOV(block, I2, 0x00ffffff); // mov i2,0x00ffffff
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_ADD(block, I0, mem(&m_core->tempaddr), 3); // add i0,[tempaddr],3
|
||||
UML_SHL(block, I1, mem(&m_core->tempdata.w.l), 24); // shl i1,[tempdata],24
|
||||
UML_MOV(block, I2, 0xff000000); // mov i2,0xff000000
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_RET(block); // ret
|
||||
UML_LABEL(block, offs2); // offs2:
|
||||
UML_TEST(block, I0, 1); // test i0,i0,1
|
||||
UML_JMPc(block, COND_NZ, offs3 = label++); // jnz offs3
|
||||
UML_SUB(block, I0, I0, 2); // sub i0,i0,2
|
||||
UML_SHR(block, I1, I1, 16); // shr i1,i1,16
|
||||
UML_MOV(block, I2, 0x0000ffff); // mov i2,0x0000ffff
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_ADD(block, I0, mem(&m_core->tempaddr), 2); // add i0,[tempaddr],2
|
||||
UML_SHL(block, I1, mem(&m_core->tempdata.w.l), 16); // shl i1,[tempdata],16
|
||||
UML_MOV(block, I2, 0xffff0000); // mov i2,0xffff0000
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_RET(block); // ret
|
||||
UML_LABEL(block, offs3); // offs3:
|
||||
UML_MOV(block, I2, 0x0000ffff); // mov i2,0x0000ffff
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_ADD(block, I0, mem(&m_core->tempaddr), 2); // add i0,[tempaddr],2
|
||||
UML_SHL(block, I1, mem(&m_core->tempdata.w.l), 16); // shl i1,[tempdata],16
|
||||
UML_MOV(block, I2, 0xffff0000); // mov i2,0xffff0000
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_RET(block); // ret
|
||||
UML_LABEL(block, offs3); // offs3:
|
||||
UML_SUB(block, I0, I0, 3); // sub i0,i0,3
|
||||
UML_SHR(block, I1, I1, 24); // shr i1,i1,24
|
||||
UML_MOV(block, I2, 0x000000ff); // mov i2,0x000000ff
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_ADD(block, I0, mem(&m_core->tempaddr), 1); // add i0,[tempaddr],1
|
||||
UML_SHL(block, I1, mem(&m_core->tempdata.w.l), 8); // shl i1,[tempdata],8
|
||||
UML_MOV(block, I2, 0xffffff00); // mov i2,0xffffff00
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_MOV(block, I2, 0x000000ff); // mov i2,0x000000ff
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_ADD(block, I0, mem(&m_core->tempaddr), 1); // add i0,[tempaddr],1
|
||||
UML_SHL(block, I1, mem(&m_core->tempdata.w.l), 8); // shl i1,[tempdata],8
|
||||
UML_MOV(block, I2, 0xffffff00); // mov i2,0xffffff00
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
}
|
||||
else
|
||||
{
|
||||
UML_MOV(block, mem(&m_core->tempaddr), I0); // mov [tempaddr],i0
|
||||
UML_TEST(block, I0, 2); // test i0,i0,2
|
||||
UML_JMPc(block, COND_NZ, offs2 = label++); // jnz offs2
|
||||
UML_MOV(block, mem(&m_core->tempaddr), I0); // mov [tempaddr],i0
|
||||
UML_TEST(block, I0, 2); // test i0,i0,2
|
||||
UML_JMPc(block, COND_NZ, offs2 = label++); // jnz offs2
|
||||
UML_SUB(block, I0, I0, 1); // sub i0,i0,1
|
||||
UML_MOV(block, I2, 0x00ffffff); // mov i2,0x00ffffff
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_SHL(block, mem(&m_core->tempdata.w.l), I0, 8); // shl [tempdata],i0,8
|
||||
UML_ADD(block, I0, mem(&m_core->tempaddr), 3); // add i0,[tempaddr],3
|
||||
UML_MOV(block, I2, 0xff000000); // mov i2,0xff000000
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_MOV(block, I2, 0x00ffffff); // mov i2,0x00ffffff
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_SHL(block, mem(&m_core->tempdata.w.l), I0, 8); // shl [tempdata],i0,8
|
||||
UML_ADD(block, I0, mem(&m_core->tempaddr), 3); // add i0,[tempaddr],3
|
||||
UML_MOV(block, I2, 0xff000000); // mov i2,0xff000000
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_SHR(block, I0, I0, 24); // shr i0,i0,24
|
||||
UML_OR(block, I0, I0, mem(&m_core->tempdata.w.l)); // or i0,i0,[tempdata]
|
||||
UML_RET(block); // ret
|
||||
UML_LABEL(block, offs2); // offs2:
|
||||
UML_TEST(block, I0, 1); // test i0,i0,1
|
||||
UML_JMPc(block, COND_NZ, offs3 = label++); // jnz offs3
|
||||
UML_OR(block, I0, I0, mem(&m_core->tempdata.w.l)); // or i0,i0,[tempdata]
|
||||
UML_RET(block); // ret
|
||||
UML_LABEL(block, offs2); // offs2:
|
||||
UML_TEST(block, I0, 1); // test i0,i0,1
|
||||
UML_JMPc(block, COND_NZ, offs3 = label++); // jnz offs3
|
||||
UML_SUB(block, I0, I0, 2); // sub i0,i0,2
|
||||
UML_MOV(block, I2, 0x0000ffff); // mov i2,0x0000ffff
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_SHL(block, mem(&m_core->tempdata.w.l), I0, 16); // shl [tempdata],i0,16
|
||||
UML_ADD(block, I0, mem(&m_core->tempaddr), 2); // add i0,[tempaddr],2
|
||||
UML_MOV(block, I2, 0xffff0000); // mov i2,0xffff0000
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_MOV(block, I2, 0x0000ffff); // mov i2,0x0000ffff
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_SHL(block, mem(&m_core->tempdata.w.l), I0, 16); // shl [tempdata],i0,16
|
||||
UML_ADD(block, I0, mem(&m_core->tempaddr), 2); // add i0,[tempaddr],2
|
||||
UML_MOV(block, I2, 0xffff0000); // mov i2,0xffff0000
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_SHR(block, I0, I0, 16); // shr i0,i0,16
|
||||
UML_OR(block, I0, I0, mem(&m_core->tempdata.w.l)); // or i0,i0,[tempdata]
|
||||
UML_RET(block); // ret
|
||||
UML_LABEL(block, offs3); // offs3:
|
||||
UML_OR(block, I0, I0, mem(&m_core->tempdata.w.l)); // or i0,i0,[tempdata]
|
||||
UML_RET(block); // ret
|
||||
UML_LABEL(block, offs3); // offs3:
|
||||
UML_SUB(block, I0, I0, 3); // sub i0,i0,3
|
||||
UML_MOV(block, I2, 0x000000ff); // mov i2,0x000000ff
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_SHL(block, mem(&m_core->tempdata.w.l), I0, 24); // shl [tempdata],i0,24
|
||||
UML_ADD(block, I0, mem(&m_core->tempaddr), 1); // add i0,[tempaddr],1
|
||||
UML_MOV(block, I2, 0xffffff00); // mov i2,0xffffff00
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_MOV(block, I2, 0x000000ff); // mov i2,0x000000ff
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_SHL(block, mem(&m_core->tempdata.w.l), I0, 24); // shl [tempdata],i0,24
|
||||
UML_ADD(block, I0, mem(&m_core->tempaddr), 1); // add i0,[tempaddr],1
|
||||
UML_MOV(block, I2, 0xffffff00); // mov i2,0xffffff00
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_SHR(block, I0, I0, 8); // shr i0,i0,8
|
||||
UML_OR(block, I0, I0, mem(&m_core->tempdata.w.l)); // or i0,i0,[tempdata]
|
||||
UML_OR(block, I0, I0, mem(&m_core->tempdata.w.l)); // or i0,i0,[tempdata]
|
||||
}
|
||||
}
|
||||
else if (size == 8)
|
||||
{
|
||||
if (iswrite)
|
||||
{
|
||||
UML_MOV(block, mem(&m_core->tempaddr), I0); // mov [tempaddr],i0
|
||||
UML_DMOV(block, mem(&m_core->tempdata.d), I1); // dmov [tempdata],i1
|
||||
UML_DSHR(block, I1, I1, 32); // dshr i1,i1,32
|
||||
UML_AND(block, I0, I0, ~7); // and i0,i0,~7
|
||||
UML_DMOV(block, I2, U64(0x00000000ffffffff)); // dmov i2,0x00000000ffffffff
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_ADD(block, I0, mem(&m_core->tempaddr), 4); // add i0,[tempaddr],4
|
||||
UML_DSHL(block, I1, mem(&m_core->tempdata.d), 32); // dshl i1,[tempdata],32
|
||||
UML_DMOV(block, I2, U64(0xffffffff00000000)); // dmov i2,0xffffffff00000000
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_MOV(block, mem(&m_core->tempaddr), I0); // mov [tempaddr],i0
|
||||
UML_DMOV(block, mem(&m_core->tempdata.d), I1); // dmov [tempdata],i1
|
||||
UML_DSHR(block, I1, I1, 32); // dshr i1,i1,32
|
||||
UML_AND(block, I0, I0, ~7); // and i0,i0,~7
|
||||
UML_DMOV(block, I2, 0x00000000ffffffffU); // dmov i2,0x00000000ffffffff
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_ADD(block, I0, mem(&m_core->tempaddr), 4); // add i0,[tempaddr],4
|
||||
UML_DSHL(block, I1, mem(&m_core->tempdata.d), 32); // dshl i1,[tempdata],32
|
||||
UML_DMOV(block, I2, 0xffffffff00000000U); // dmov i2,0xffffffff00000000
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
}
|
||||
else
|
||||
{
|
||||
UML_MOV(block, mem(&m_core->tempaddr), I0); // mov [tempaddr],i0
|
||||
UML_DMOV(block, I2, U64(0x00000000ffffffff)); // mov i2,0x00000000ffffffff
|
||||
UML_AND(block, I0, I0, ~7); // and i0,i0,~7
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_DSHL(block, mem(&m_core->tempdata.d), I0, 32); // dshl [tempdata],i0,32
|
||||
UML_ADD(block, I0, mem(&m_core->tempaddr), 4); // add i0,[tempaddr],4
|
||||
UML_DMOV(block, I2, U64(0xffffffff00000000)); // dmov i2,0xffffffff00000000
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_DSHR(block, I0, I0, 32); // dshr i0,i0,32
|
||||
UML_DOR(block, I0, I0, mem(&m_core->tempdata.d)); // dor i0,i0,[tempdata]
|
||||
UML_MOV(block, mem(&m_core->tempaddr), I0); // mov [tempaddr],i0
|
||||
UML_DMOV(block, I2, 0x00000000ffffffffU); // mov i2,0x00000000ffffffff
|
||||
UML_AND(block, I0, I0, ~7); // and i0,i0,~7
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_DSHL(block, mem(&m_core->tempdata.d), I0, 32); // dshl [tempdata],i0,32
|
||||
UML_ADD(block, I0, mem(&m_core->tempaddr), 4); // add i0,[tempaddr],4
|
||||
UML_DMOV(block, I2, 0xffffffff00000000U); // dmov i2,0xffffffff00000000
|
||||
UML_CALLH(block, *masked); // callh masked
|
||||
UML_DSHR(block, I0, I0, 32); // dshr i0,i0,32
|
||||
UML_DOR(block, I0, I0, mem(&m_core->tempdata.d)); // dor i0,i0,[tempdata]
|
||||
}
|
||||
}
|
||||
UML_RET(block); // ret
|
||||
|
@ -43,8 +43,8 @@ protected:
|
||||
public:
|
||||
int44( int64_t value ) :
|
||||
m_value( value ),
|
||||
m_positive_overflow( value > S64( 0x7ffffffffff ) ),
|
||||
m_negative_overflow( value < S64( -0x80000000000 ) )
|
||||
m_positive_overflow( value > 0x7ffffffffff ),
|
||||
m_negative_overflow( value < -0x80000000000 )
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -1363,7 +1363,7 @@ void rsp_cop2_drc::vmulf()
|
||||
if (s1 == -32768 && s2 == -32768)
|
||||
{
|
||||
// overflow
|
||||
ACCUM(i) = S64(0x0000800080000000);
|
||||
ACCUM(i) = s64(0x0000800080000000U);
|
||||
m_vres[i] = 0x7fff;
|
||||
}
|
||||
else
|
||||
|
@ -139,9 +139,9 @@ uint32_t scudsp_cpu_device::scudsp_get_source_mem_reg_value( uint32_t mode )
|
||||
switch( mode )
|
||||
{
|
||||
case 0x9:
|
||||
return (uint32_t)((m_alu & U64(0x00000000ffffffff)) >> 0);
|
||||
return u32((m_alu & 0x00000000ffffffffU) >> 0);
|
||||
case 0xA:
|
||||
return (uint32_t)((m_alu & U64(0x0000ffffffff0000)) >> 16);
|
||||
return u32((m_alu & 0x0000ffffffff0000U) >> 16);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@ -436,17 +436,17 @@ void scudsp_cpu_device::scudsp_operation(uint32_t opcode)
|
||||
i3 = m_acl.si + m_pl.si;
|
||||
m_alu = (uint64_t)(uint32_t)i3;
|
||||
//SET_Z(i3 == 0);
|
||||
SET_Z( (i3 & S64(0xffffffffffff)) == 0 );
|
||||
SET_Z( (i3 & s64(0xffffffffffffU)) == 0 );
|
||||
//SET_S(i3 < 0);
|
||||
SET_S( i3 & S64(0x1000000000000));
|
||||
SET_C(i3 & S64(0x100000000));
|
||||
SET_S( i3 & s64(0x1000000000000U));
|
||||
SET_C(i3 & s64(0x100000000U));
|
||||
SET_V(((i3) ^ (m_acl.si)) & ((i3) ^ (m_pl.si)) & 0x80000000);
|
||||
break;
|
||||
case 0x5: /* SUB */
|
||||
i3 = m_acl.si - m_pl.si;
|
||||
m_alu = (uint64_t)(uint32_t)i3;
|
||||
SET_Z(i3 == 0);
|
||||
SET_C(i3 & S64(0x100000000));
|
||||
SET_C(i3 & s64(0x100000000U));
|
||||
SET_S(i3 < 0);
|
||||
SET_V(((m_pl.si) ^ (m_acl.si)) & ((m_pl.si) ^ (i3)) & 0x80000000);
|
||||
break;
|
||||
@ -454,10 +454,10 @@ void scudsp_cpu_device::scudsp_operation(uint32_t opcode)
|
||||
i1 = concat_64((int32_t)m_ph.si,m_pl.si);
|
||||
i2 = concat_64((int32_t)m_ach.si,m_acl.si);
|
||||
m_alu = i1 + i2;
|
||||
SET_Z((m_alu & S64(0xffffffffffff)) == 0);
|
||||
SET_S((m_alu & S64(0x800000000000)) > 0);
|
||||
SET_C((m_alu) & S64(0x1000000000000));
|
||||
SET_V(((m_alu) ^ (i1)) & ((m_alu) ^ (i2)) & S64(0x800000000000));
|
||||
SET_Z((m_alu & s64(0xffffffffffffU)) == 0);
|
||||
SET_S((m_alu & s64(0x800000000000U)) > 0);
|
||||
SET_C((m_alu) & s64(0x1000000000000U));
|
||||
SET_V(((m_alu) ^ (i1)) & ((m_alu) ^ (i2)) & s64(0x800000000000U));
|
||||
break;
|
||||
case 0x7: /* ??? */
|
||||
/* Unrecognized opcode */
|
||||
@ -523,8 +523,8 @@ void scudsp_cpu_device::scudsp_operation(uint32_t opcode)
|
||||
case 0x1: /* NOP ? */
|
||||
break;
|
||||
case 0x2: /* MOV MUL,P */
|
||||
m_ph.ui = (uint16_t)((m_mul & U64(0x0000ffff00000000)) >> 32);
|
||||
m_pl.ui = (uint32_t)((m_mul & U64(0x00000000ffffffff)) >> 0);
|
||||
m_ph.ui = u16((m_mul & 0x0000ffff00000000U) >> 32);
|
||||
m_pl.ui = u32((m_mul & 0x00000000ffffffffU) >> 0);
|
||||
break;
|
||||
case 0x3: /* MOV [s],P */
|
||||
dsp_mem = (opcode & 0x700000) >> 20;
|
||||
@ -560,8 +560,8 @@ void scudsp_cpu_device::scudsp_operation(uint32_t opcode)
|
||||
m_ach.ui = 0;
|
||||
break;
|
||||
case 0x2: /* MOV ALU,A */
|
||||
m_ach.ui = (uint16_t)((m_alu & U64(0x0000ffff00000000)) >> 32);
|
||||
m_acl.ui = (uint32_t)((m_alu & U64(0x00000000ffffffff)) >> 0);
|
||||
m_ach.ui = u16((m_alu & 0x0000ffff00000000U) >> 32);
|
||||
m_acl.ui = u32((m_alu & 0x00000000ffffffffU) >> 0);
|
||||
break;
|
||||
case 0x3: /* MOV [s], A */
|
||||
dsp_mem = (opcode & 0x1C000 ) >> 14;
|
||||
|
@ -76,12 +76,12 @@ static ADDRESS_MAP_START( sh4_internal_map, AS_PROGRAM, 64, sh4_base_device )
|
||||
AM_RANGE(0x1E000000, 0x1E000FFF) AM_RAM AM_MIRROR(0x01FFF000)
|
||||
AM_RANGE(0xE0000000, 0xE000003F) AM_RAM AM_MIRROR(0x03FFFFC0) // todo: store queues should be write only on DC's SH4, executing PREFM shouldn't cause an actual memory read access!
|
||||
AM_RANGE(0xF6000000, 0xF7FFFFFF) AM_READWRITE(sh4_tlb_r,sh4_tlb_w)
|
||||
AM_RANGE(0xFE000000, 0xFFFFFFFF) AM_READWRITE32(sh4_internal_r, sh4_internal_w, U64(0xffffffffffffffff))
|
||||
AM_RANGE(0xFE000000, 0xFFFFFFFF) AM_READWRITE32(sh4_internal_r, sh4_internal_w, 0xffffffffffffffffU)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( sh3_internal_map, AS_PROGRAM, 64, sh3_base_device )
|
||||
AM_RANGE(SH3_LOWER_REGBASE, SH3_LOWER_REGEND) AM_READWRITE32(sh3_internal_r, sh3_internal_w, U64(0xffffffffffffffff))
|
||||
AM_RANGE(SH3_UPPER_REGBASE, SH3_UPPER_REGEND) AM_READWRITE32(sh3_internal_high_r, sh3_internal_high_w, U64(0xffffffffffffffff))
|
||||
AM_RANGE(SH3_LOWER_REGBASE, SH3_LOWER_REGEND) AM_READWRITE32(sh3_internal_r, sh3_internal_w, 0xffffffffffffffffU)
|
||||
AM_RANGE(SH3_UPPER_REGBASE, SH3_UPPER_REGEND) AM_READWRITE32(sh3_internal_high_r, sh3_internal_high_w, 0xffffffffffffffffU)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
|
@ -2292,7 +2292,7 @@ bool adsp21062_device::generate_opcode(drcuml_block *block, compiler_state *comp
|
||||
switch (subop)
|
||||
{
|
||||
case 0x00: // NOP / idle |000|00000|
|
||||
if (opcode & U64(0x008000000000))
|
||||
if (opcode & 0x008000000000U)
|
||||
{
|
||||
// IDLE
|
||||
UML_MOV(block, mem(&m_core->idle), 1);
|
||||
@ -3060,7 +3060,7 @@ bool adsp21062_device::generate_opcode(drcuml_block *block, compiler_state *comp
|
||||
|
||||
case 0x16: // I register modify / bit-reverse |000|10110|
|
||||
{
|
||||
if (opcode & U64(0x008000000000)) // bit reverse
|
||||
if (opcode & 0x008000000000U) // bit reverse
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -3087,28 +3087,28 @@ bool adsp21062_device::generate_opcode(drcuml_block *block, compiler_state *comp
|
||||
|
||||
case 0x17: // push|pop stacks / flush cache |000|10111|
|
||||
{
|
||||
if (opcode & U64(0x008000000000))
|
||||
if (opcode & 0x008000000000U)
|
||||
{
|
||||
fatalerror("sharcdrc: push/pop stacks: push loop not implemented\n");
|
||||
}
|
||||
if (opcode & U64(0x004000000000))
|
||||
if (opcode & 0x004000000000U)
|
||||
{
|
||||
fatalerror("sharcdrc: push/pop stacks: pop loop not implemented\n");
|
||||
}
|
||||
if (opcode & U64(0x002000000000))
|
||||
if (opcode & 0x002000000000U)
|
||||
{
|
||||
UML_CALLH(block, *m_push_status);
|
||||
}
|
||||
if (opcode & U64(0x001000000000))
|
||||
if (opcode & 0x001000000000U)
|
||||
{
|
||||
UML_CALLH(block, *m_pop_status);
|
||||
}
|
||||
if (opcode & U64(0x000800000000))
|
||||
if (opcode & 0x000800000000U)
|
||||
{
|
||||
UML_MOV(block, I0, PCSTK);
|
||||
UML_CALLH(block, *m_push_pc);
|
||||
}
|
||||
if (opcode & U64(0x000400000000))
|
||||
if (opcode & 0x000400000000U)
|
||||
{
|
||||
UML_CALLH(block, *m_pop_pc);
|
||||
}
|
||||
@ -3295,7 +3295,7 @@ bool adsp21062_device::generate_opcode(drcuml_block *block, compiler_state *comp
|
||||
|
||||
case 3:
|
||||
{
|
||||
if (opcode & U64(0x100000000000)) // compute / ureg <-> ureg |011|1|
|
||||
if (opcode & 0x100000000000U) // compute / ureg <-> ureg |011|1|
|
||||
{
|
||||
int src_ureg = (opcode >> 36) & 0xff;
|
||||
int dst_ureg = (opcode >> 23) & 0xff;
|
||||
@ -3420,7 +3420,7 @@ bool adsp21062_device::generate_opcode(drcuml_block *block, compiler_state *comp
|
||||
|
||||
case 4:
|
||||
{
|
||||
if (opcode & U64(0x100000000000)) // immediate data -> DM|PM |100|1|
|
||||
if (opcode & 0x100000000000U) // immediate data -> DM|PM |100|1|
|
||||
{
|
||||
int i = (opcode >> 41) & 0x7;
|
||||
int m = (opcode >> 38) & 0x7;
|
||||
@ -3722,22 +3722,22 @@ void adsp21062_device::generate_compute(drcuml_block *block, compiler_state *com
|
||||
switch (ai)
|
||||
{
|
||||
case 0x00: // MR0F
|
||||
UML_DAND(block, MRF, MRF, U64(0xffffffff00000000));
|
||||
UML_DAND(block, MRF, MRF, 0xffffffff00000000U);
|
||||
UML_AND(block, I0, REG(rn), 0xffffffff);
|
||||
UML_DOR(block, MRF, MRF, I0);
|
||||
break;
|
||||
case 0x01: // MR1F
|
||||
UML_DAND(block, MRF, MRF, U64(0x00000000ffffffff));
|
||||
UML_DAND(block, MRF, MRF, 0x00000000ffffffffU);
|
||||
UML_DSHL(block, I0, REG(rn), 32);
|
||||
UML_DOR(block, MRF, MRF, I0);
|
||||
break;
|
||||
case 0x04: // MR0B
|
||||
UML_DAND(block, MRB, MRB, U64(0xffffffff00000000));
|
||||
UML_DAND(block, MRB, MRB, 0xffffffff00000000U);
|
||||
UML_AND(block, I0, REG(rn), 0xffffffff);
|
||||
UML_DOR(block, MRB, MRB, I0);
|
||||
break;
|
||||
case 0x05: // MR1B
|
||||
UML_DAND(block, MRB, MRB, U64(0x00000000ffffffff));
|
||||
UML_DAND(block, MRB, MRB, 0x00000000ffffffffU);
|
||||
UML_DSHL(block, I0, REG(rn), 32);
|
||||
UML_DOR(block, MRB, MRB, I0);
|
||||
break;
|
||||
|
@ -646,7 +646,7 @@ static uint32_t dasm_direct_jump(uint32_t pc, uint64_t opcode)
|
||||
uint32_t flags = 0;
|
||||
|
||||
get_if_condition(cond);
|
||||
if (opcode & U64(0x8000000000))
|
||||
if (opcode & 0x8000000000U)
|
||||
{
|
||||
print("CALL");
|
||||
flags = DASMFLAG_STEP_OVER;
|
||||
@ -656,7 +656,7 @@ static uint32_t dasm_direct_jump(uint32_t pc, uint64_t opcode)
|
||||
print("JUMP");
|
||||
}
|
||||
|
||||
if (opcode & U64(0x10000000000)) /* PC-relative branch */
|
||||
if (opcode & 0x10000000000U) /* PC-relative branch */
|
||||
{
|
||||
print(" (0x%08X)", pc + SIGN_EXTEND24(addr));
|
||||
}
|
||||
@ -699,7 +699,7 @@ static uint32_t dasm_indirect_jump_compute(uint32_t pc, uint64_t opcode)
|
||||
print("JUMP");
|
||||
}
|
||||
|
||||
if (opcode & U64(0x10000000000)) /* PC-relative branch */
|
||||
if (opcode & 0x10000000000U) /* PC-relative branch */
|
||||
{
|
||||
print(" (0x%08X)", pc + SIGN_EXTEND6(reladdr));
|
||||
}
|
||||
@ -744,7 +744,7 @@ static uint32_t dasm_indirect_jump_compute_dregdm(uint32_t pc, uint64_t opcode)
|
||||
get_if_condition(cond);
|
||||
print("JUMP");
|
||||
|
||||
if (opcode & U64(0x200000000000)) /* PC-relative branch */
|
||||
if (opcode & 0x200000000000U) /* PC-relative branch */
|
||||
{
|
||||
print(" (0x%08X)", pc + SIGN_EXTEND6(reladdr));
|
||||
}
|
||||
@ -780,7 +780,7 @@ static uint32_t dasm_rts_compute(uint32_t pc, uint64_t opcode)
|
||||
|
||||
get_if_condition(cond);
|
||||
|
||||
if (opcode & U64(0x10000000000))
|
||||
if (opcode & 0x10000000000U)
|
||||
{
|
||||
print("RTI");
|
||||
}
|
||||
@ -817,7 +817,7 @@ static uint32_t dasm_do_until_counter(uint32_t pc, uint64_t opcode)
|
||||
int ureg = (opcode >> 32) & 0xff;
|
||||
uint32_t addr = opcode & 0xffffff;
|
||||
|
||||
if (opcode & U64(0x10000000000)) /* Loop counter from universal register */
|
||||
if (opcode & 0x10000000000U) /* Loop counter from universal register */
|
||||
{
|
||||
print("LCNTR = %s, ", GET_UREG(ureg));
|
||||
print("DO (0x%08X)", pc + SIGN_EXTEND24(addr));
|
||||
@ -950,7 +950,7 @@ static uint32_t dasm_ireg_modify(uint32_t pc, uint64_t opcode)
|
||||
int i = (opcode >> 32) & 0x7;
|
||||
uint32_t data = opcode & 0xffffffff;
|
||||
|
||||
if (opcode & U64(0x8000000000)) /* with bit-reverse */
|
||||
if (opcode & 0x8000000000U) /* with bit-reverse */
|
||||
{
|
||||
if (g)
|
||||
{
|
||||
@ -1043,7 +1043,7 @@ static uint32_t dasm_misc(uint32_t pc, uint64_t opcode)
|
||||
|
||||
static uint32_t dasm_idlenop(uint32_t pc, uint64_t opcode)
|
||||
{
|
||||
if (opcode & U64(0x8000000000))
|
||||
if (opcode & 0x8000000000U)
|
||||
{
|
||||
print("IDLE");
|
||||
}
|
||||
@ -1058,7 +1058,7 @@ static uint32_t dasm_idlenop(uint32_t pc, uint64_t opcode)
|
||||
static uint32_t dasm_cjump_rframe(uint32_t pc, uint64_t opcode)
|
||||
{
|
||||
/* TODO */
|
||||
if (opcode & U64(0x10000000000)) /* RFRAME */
|
||||
if (opcode & 0x10000000000U) /* RFRAME */
|
||||
{
|
||||
print("TODO: RFRAME");
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ bool sharc_frontend::describe(opcode_desc &desc, const opcode_desc *prev)
|
||||
switch (subop)
|
||||
{
|
||||
case 0x00: // NOP / idle |000|00000|
|
||||
if (opcode & U64(0x008000000000))
|
||||
if (opcode & 0x008000000000U)
|
||||
{
|
||||
// IDLE
|
||||
desc.flags |= OPFLAG_END_SEQUENCE;
|
||||
@ -608,7 +608,7 @@ bool sharc_frontend::describe(opcode_desc &desc, const opcode_desc *prev)
|
||||
|
||||
case 0x16: // I register modify / bit-reverse |000|10110|
|
||||
{
|
||||
if (opcode & U64(0x008000000000)) // bit reverse
|
||||
if (opcode & 0x008000000000U) // bit reverse
|
||||
{
|
||||
fatalerror("sharc_frontend::describe: bit reverse unimplemented");
|
||||
}
|
||||
@ -737,7 +737,7 @@ bool sharc_frontend::describe(opcode_desc &desc, const opcode_desc *prev)
|
||||
if (!describe_compute(desc, opcode))
|
||||
return false;
|
||||
|
||||
if (opcode & U64(0x100000000000)) // compute / ureg <-> ureg |011|1|
|
||||
if (opcode & 0x100000000000U) // compute / ureg <-> ureg |011|1|
|
||||
{
|
||||
int src_ureg = (opcode >> 36) & 0xff;
|
||||
int dst_ureg = (opcode >> 23) & 0xff;
|
||||
@ -798,7 +798,7 @@ bool sharc_frontend::describe(opcode_desc &desc, const opcode_desc *prev)
|
||||
|
||||
case 4:
|
||||
{
|
||||
if (opcode & U64(0x100000000000)) // immediate data -> DM|PM |100|1|
|
||||
if (opcode & 0x100000000000U) // immediate data -> DM|PM |100|1|
|
||||
{
|
||||
int i = (opcode >> 41) & 0x7;
|
||||
int m = (opcode >> 38) & 0x7;
|
||||
|
@ -440,8 +440,8 @@ void adsp21062_device::SET_UREG(int ureg, uint32_t data)
|
||||
case 0xd:
|
||||
switch(reg)
|
||||
{
|
||||
case 0xc: m_core->px &= U64(0xffffffffffff0000); m_core->px |= (data & 0xffff); break; /* PX1 */
|
||||
case 0xd: m_core->px &= U64(0x000000000000ffff); m_core->px |= (uint64_t)data << 16; break; /* PX2 */
|
||||
case 0xc: m_core->px &= 0xffffffffffff0000U; m_core->px |= (data & 0xffff); break; /* PX1 */
|
||||
case 0xd: m_core->px &= 0x000000000000ffffU; m_core->px |= (uint64_t)data << 16; break; /* PX2 */
|
||||
default: fatalerror("SHARC: SET_UREG: unknown register %08X at %08X\n", ureg, m_core->pc);
|
||||
}
|
||||
break;
|
||||
@ -2668,29 +2668,29 @@ void adsp21062_device::sharcop_bit_reverse()
|
||||
/* push/pop stacks / flush cache */
|
||||
void adsp21062_device::sharcop_push_pop_stacks()
|
||||
{
|
||||
if (m_core->opcode & U64(0x008000000000))
|
||||
if (m_core->opcode & 0x008000000000U)
|
||||
{
|
||||
fatalerror("sharcop_push_pop_stacks: push loop not implemented\n");
|
||||
}
|
||||
if (m_core->opcode & U64(0x004000000000))
|
||||
if (m_core->opcode & 0x004000000000U)
|
||||
{
|
||||
fatalerror("sharcop_push_pop_stacks: pop loop not implemented\n");
|
||||
}
|
||||
if (m_core->opcode & U64(0x002000000000))
|
||||
if (m_core->opcode & 0x002000000000U)
|
||||
{
|
||||
//fatalerror("sharcop_push_pop_stacks: push sts not implemented\n");
|
||||
PUSH_STATUS_STACK();
|
||||
}
|
||||
if (m_core->opcode & U64(0x001000000000))
|
||||
if (m_core->opcode & 0x001000000000U)
|
||||
{
|
||||
//fatalerror("sharcop_push_pop_stacks: pop sts not implemented\n");
|
||||
POP_STATUS_STACK();
|
||||
}
|
||||
if (m_core->opcode & U64(0x000800000000))
|
||||
if (m_core->opcode & 0x000800000000U)
|
||||
{
|
||||
PUSH_PC(m_core->pcstk);
|
||||
}
|
||||
if (m_core->opcode & U64(0x000400000000))
|
||||
if (m_core->opcode & 0x000400000000U)
|
||||
{
|
||||
POP_PC();
|
||||
}
|
||||
|
@ -574,14 +574,14 @@ void tms3203x_device::addf(tmsreg &dst, tmsreg &src1, tmsreg &src2)
|
||||
}
|
||||
|
||||
// if the mantissa is >= 2.0 or < -2.0, normalize
|
||||
else if (man >= int64_t(U64(0x100000000)) || man < int64_t(U64(0xffffffff00000000)))
|
||||
else if (man >= int64_t(0x100000000U) || man < int64_t(0xffffffff00000000U))
|
||||
{
|
||||
man >>= 1;
|
||||
exp++;
|
||||
}
|
||||
|
||||
// if the mantissa is < 1.0 and > -1.0, normalize
|
||||
else if (man < int64_t(U64(0x80000000)) && man >= int64_t(U64(0xffffffff80000000)))
|
||||
else if (man < int64_t(0x80000000U) && man >= int64_t(0xffffffff80000000U))
|
||||
{
|
||||
if (man > 0)
|
||||
{
|
||||
@ -687,14 +687,14 @@ void tms3203x_device::subf(tmsreg &dst, tmsreg &src1, tmsreg &src2)
|
||||
}
|
||||
|
||||
// if the mantissa is >= 2.0 or < -2.0, normalize
|
||||
else if (man >= int64_t(U64(0x100000000)) || man < int64_t(U64(0xffffffff00000000)))
|
||||
else if (man >= int64_t(0x100000000U) || man < int64_t(0xffffffff00000000U))
|
||||
{
|
||||
man >>= 1;
|
||||
exp++;
|
||||
}
|
||||
|
||||
// if the mantissa is < 1.0 and > -1.0, normalize
|
||||
else if (man < int64_t(U64(0x80000000)) && man >= int64_t(U64(0xffffffff80000000)))
|
||||
else if (man < int64_t(0x80000000U) && man >= int64_t(0xffffffff80000000U))
|
||||
{
|
||||
if (man > 0)
|
||||
{
|
||||
@ -778,11 +778,11 @@ void tms3203x_device::mpyf(tmsreg &dst, tmsreg &src1, tmsreg &src2)
|
||||
}
|
||||
|
||||
// if the mantissa is >= 2.0 or <= -2.0, normalize
|
||||
else if (man >= int64_t(U64(0x100000000)))
|
||||
else if (man >= int64_t(0x100000000U))
|
||||
{
|
||||
man >>= 1;
|
||||
exp++;
|
||||
if (man >= int64_t(U64(0x100000000)))
|
||||
if (man >= int64_t(0x100000000U))
|
||||
{
|
||||
man >>= 1;
|
||||
exp++;
|
||||
@ -790,7 +790,7 @@ void tms3203x_device::mpyf(tmsreg &dst, tmsreg &src1, tmsreg &src2)
|
||||
}
|
||||
|
||||
// if the mantissa is >= 2.0 or <= -2.0, normalize
|
||||
else if (man < int64_t(U64(0xffffffff00000000)))
|
||||
else if (man < int64_t(0xffffffff00000000U))
|
||||
{
|
||||
man >>= 1;
|
||||
exp++;
|
||||
|
@ -435,10 +435,10 @@ static offs_t tms32082_disasm_pp(std::ostream &stream, offs_t pc, const uint8_t
|
||||
case 0xe:
|
||||
case 0xf:
|
||||
{
|
||||
if ((op & U64(0xfaa8100000000000)) == U64(0x8800000000000000))
|
||||
if ((op & 0xfaa8100000000000U) == 0x8800000000000000U)
|
||||
{
|
||||
int operation = (op >> 39) & 0x1f;
|
||||
uint64_t parallel_xfer = (op & U64(0x0000007fffffffff));
|
||||
uint64_t parallel_xfer = (op & 0x0000007fffffffffU);
|
||||
|
||||
switch (operation)
|
||||
{
|
||||
@ -462,7 +462,7 @@ static offs_t tms32082_disasm_pp(std::ostream &stream, offs_t pc, const uint8_t
|
||||
case 0:
|
||||
case 1: // Base set ALU (5-bit immediate)
|
||||
{
|
||||
uint64_t parallel_xfer = (op & U64(0x0000007fffffffff));
|
||||
uint64_t parallel_xfer = (op & 0x0000007fffffffffU);
|
||||
|
||||
int dst = (op >> 48) & 7;
|
||||
int src1 = (op >> 45) & 7;
|
||||
@ -541,7 +541,7 @@ static offs_t tms32082_disasm_pp(std::ostream &stream, offs_t pc, const uint8_t
|
||||
|
||||
case 2: // Base set ALU (reg src2)
|
||||
{
|
||||
uint64_t parallel_xfer = (op & U64(0x0000007fffffffff));
|
||||
uint64_t parallel_xfer = (op & 0x0000007fffffffffU);
|
||||
|
||||
int dst = (op >> 48) & 7;
|
||||
int src1 = (op >> 45) & 7;
|
||||
|
@ -821,7 +821,7 @@ void tms57002_device::device_start()
|
||||
state_add(TMS57002_ST1, "ST1", st1);
|
||||
state_add(TMS57002_RPTC, "RPTC", rptc);
|
||||
state_add(TMS57002_AACC, "AACC", aacc);
|
||||
state_add(TMS57002_MACC, "MACC", macc).mask(U64(0xfffffffffffff));
|
||||
state_add(TMS57002_MACC, "MACC", macc).mask(0xfffffffffffffU);
|
||||
state_add(TMS57002_BA0, "BA0", ba0);
|
||||
state_add(TMS57002_BA1, "BA1", ba1);
|
||||
state_add(TMS57002_CREG, "CREG", creg);
|
||||
|
@ -414,8 +414,8 @@ void uml::instruction::simplify()
|
||||
if (m_flags != 0)
|
||||
return;
|
||||
|
||||
static const uint64_t instsizemask[] = { 0, 0, 0, 0, 0xffffffff, 0, 0, 0, U64(0xffffffffffffffff) };
|
||||
static const uint64_t paramsizemask[] = { 0xff, 0xffff, 0xffffffff, U64(0xffffffffffffffff) };
|
||||
static const uint64_t instsizemask[] = { 0, 0, 0, 0, 0xffffffff, 0, 0, 0, 0xffffffffffffffffU };
|
||||
static const uint64_t paramsizemask[] = { 0xff, 0xffff, 0xffffffff, 0xffffffffffffffffU };
|
||||
|
||||
// loop until we've simplified all we can
|
||||
opcode_t origop;
|
||||
@ -491,7 +491,7 @@ void uml::instruction::simplify()
|
||||
m_opcode = OP_ROL;
|
||||
m_numparams = 3;
|
||||
}
|
||||
else if (m_param[2].is_immediate() && m_param[3].is_immediate_value((U64(0xffffffffffffffff) << m_param[2].immediate()) & instsizemask[m_size]))
|
||||
else if (m_param[2].is_immediate() && m_param[3].is_immediate_value((0xffffffffffffffffU << m_param[2].immediate()) & instsizemask[m_size]))
|
||||
{
|
||||
m_opcode = OP_SHL;
|
||||
m_numparams = 3;
|
||||
|
@ -480,12 +480,12 @@ void intelfsh_device::nvram_default()
|
||||
if (m_bits == 8)
|
||||
{
|
||||
for (offs_t offs = 0; offs < bytes; offs++)
|
||||
m_data[offs] = m_region->u8(offs);
|
||||
m_data[offs] = m_region->as_u8(offs);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (offs_t offs = 0; offs < bytes; offs += 2) {
|
||||
uint16_t v = m_region->u16(offs / 2);
|
||||
uint16_t v = m_region->as_u16(offs / 2);
|
||||
m_data[offs] = v >> 8;
|
||||
m_data[offs+1] = v;
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ WRITE32_MEMBER(pci_device::address_base_w)
|
||||
if(bank_reg_infos[offset].hi)
|
||||
bank_infos[bid].adr = (bank_infos[bid].adr & 0xffffffff) | (uint64_t(data) << 32);
|
||||
else {
|
||||
bank_infos[bid].adr = (bank_infos[bid].adr & U64(0xffffffff00000000)) | data;
|
||||
bank_infos[bid].adr = (bank_infos[bid].adr & 0xffffffff00000000U) | data;
|
||||
}
|
||||
remap_cb();
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ void rf5c400_device::sound_stream_update(sound_stream &stream, stream_sample_t *
|
||||
if ( (pos>>16) > m_rom.length() || (pos>>16) > end)
|
||||
{
|
||||
pos -= loop<<16;
|
||||
pos &= U64(0xFFFFFF0000);
|
||||
pos &= 0xFFFFFF0000U;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -944,7 +944,7 @@ void epic12_device::install_handlers(int addr1, int addr2)
|
||||
write = write32_delegate(FUNC(epic12_device::blitter_w), this);
|
||||
}
|
||||
|
||||
space.install_readwrite_handler(addr1, addr2, read , write, U64(0xffffffffffffffff));
|
||||
space.install_readwrite_handler(addr1, addr2, read , write, 0xffffffffffffffffU);
|
||||
}
|
||||
|
||||
READ64_MEMBER( epic12_device::fpga_r )
|
||||
|
@ -867,8 +867,8 @@ LOG(("scrollx_to_apply: %u\n", m_line.scrollx_to_apply));
|
||||
else
|
||||
{
|
||||
// Interleave bits from plane0 and plane1
|
||||
m_line.shift_register = (((((m_line.plane0 * U64(0x0101010101010101)) & U64(0x8040201008040201)) * U64(0x0102040810204081)) >> 49) & 0x5555)
|
||||
| (((((m_line.plane1 * U64(0x0101010101010101)) & U64(0x8040201008040201)) * U64(0x0102040810204081)) >> 48) & 0xAAAA);
|
||||
m_line.shift_register = (((((m_line.plane0 * 0x0101010101010101U) & 0x8040201008040201U) * 0x0102040810204081U) >> 49) & 0x5555)
|
||||
| (((((m_line.plane1 * 0x0101010101010101U) & 0x8040201008040201U) * 0x0102040810204081U) >> 48) & 0xAAAA);
|
||||
}
|
||||
if (m_line.pixels_drawn < 8)
|
||||
{
|
||||
|
@ -3752,8 +3752,8 @@ void saturn_state::stv_vdp2_draw_basic_tilemap(bitmap_rgb32 &bitmap, const recta
|
||||
}
|
||||
}
|
||||
|
||||
scalex = (int32_t)((int64_t)S64(0x100000000) / (int64_t)stv2_current_tilemap.incx);
|
||||
scaley = (int32_t)((int64_t)S64(0x100000000) / (int64_t)stv2_current_tilemap.incy);
|
||||
scalex = s32(s64(0x100000000U) / s64(stv2_current_tilemap.incx));
|
||||
scaley = s32(s64(0x100000000U) / s64(stv2_current_tilemap.incy));
|
||||
tilesizex = scalex * 8;
|
||||
tilesizey = scaley * 8;
|
||||
drawypos = drawxpos = 0;
|
||||
|
@ -149,7 +149,7 @@ static inline int32_t fast_reciplog(int64_t value, int32_t *log2)
|
||||
}
|
||||
|
||||
/* if we've spilled out of 32 bits, push it down under 32 */
|
||||
if (value & U64(0xffff00000000))
|
||||
if (value & 0xffff00000000U)
|
||||
{
|
||||
temp = (uint32_t)(value >> 16);
|
||||
exp -= 16;
|
||||
@ -250,7 +250,7 @@ static inline int64_t float_to_int64(uint32_t data, int fixedbits)
|
||||
if (exponent < 64)
|
||||
result <<= exponent;
|
||||
else
|
||||
result = U64(0x7fffffffffffffff);
|
||||
result = 0x7fffffffffffffffU;
|
||||
}
|
||||
if (data & 0x80000000)
|
||||
result = -result;
|
||||
@ -1846,9 +1846,9 @@ do
|
||||
if (FBZMODE_STIPPLE_PATTERN(FBZMODE) == 0) \
|
||||
{ \
|
||||
vd->reg[stipple].u = (vd->reg[stipple].u << 1) | (vd->reg[stipple].u >> 31);\
|
||||
if ((vd->reg[stipple].u & 0x80000000) == 0) \
|
||||
if ((vd->reg[stipple].u & 0x80000000) == 0) \
|
||||
{ \
|
||||
vd->stats.total_stippled++; \
|
||||
vd->stats.total_stippled++; \
|
||||
goto skipdrawdepth; \
|
||||
} \
|
||||
} \
|
||||
@ -1857,21 +1857,21 @@ do
|
||||
else \
|
||||
{ \
|
||||
int stipple_index = (((YY) & 3) << 3) | (~(XX) & 7); \
|
||||
if (((vd->reg[stipple].u >> stipple_index) & 1) == 0) \
|
||||
if (((vd->reg[stipple].u >> stipple_index) & 1) == 0) \
|
||||
{ \
|
||||
vd->stats.total_stippled++; \
|
||||
vd->stats.total_stippled++; \
|
||||
goto skipdrawdepth; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
/* compute "floating point" W value (used for depth and fog) */ \
|
||||
if ((ITERW) & U64(0xffff00000000)) \
|
||||
if ((ITERW) & 0xffff00000000U) \
|
||||
wfloat = 0x0000; \
|
||||
else \
|
||||
{ \
|
||||
uint32_t temp = (uint32_t)(ITERW); \
|
||||
if (!(temp & 0xffff0000)) \
|
||||
uint32_t temp = (uint32_t)(ITERW); \
|
||||
if (!(temp & 0xffff0000)) \
|
||||
wfloat = 0xffff; \
|
||||
else \
|
||||
{ \
|
||||
@ -1879,7 +1879,7 @@ do
|
||||
wfloat = ((exp << 12) | ((~temp >> (19 - exp)) & 0xfff)) + 1; \
|
||||
} \
|
||||
} \
|
||||
fogdepth = wfloat; \
|
||||
fogdepth = wfloat; \
|
||||
/* add the bias for fog selection*/ \
|
||||
if (FBZMODE_ENABLE_DEPTH_BIAS(FBZMODE)) \
|
||||
{ \
|
||||
@ -1900,8 +1900,8 @@ do
|
||||
depthval = 0x0000; \
|
||||
else \
|
||||
{ \
|
||||
uint32_t temp = (ITERZ << 4); \
|
||||
if (!(temp & 0xffff0000)) \
|
||||
uint32_t temp = (ITERZ << 4); \
|
||||
if (!(temp & 0xffff0000)) \
|
||||
depthval = 0xffff; \
|
||||
else \
|
||||
{ \
|
||||
@ -1909,7 +1909,7 @@ do
|
||||
depthval = ((exp << 12) | ((~temp >> (19 - exp)) & 0xfff)) + 1; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
/* add the bias */ \
|
||||
biasdepth = depthval; \
|
||||
if (FBZMODE_ENABLE_DEPTH_BIAS(FBZMODE)) \
|
||||
|
@ -79,7 +79,7 @@ address_map_entry &address_map_entry::mask(offs_t _mask)
|
||||
// retrieve a submap from a device
|
||||
//-------------------------------------------------
|
||||
|
||||
address_map_entry &address_map_entry::set_submap(const char *tag, address_map_delegate func, int bits, uint64_t mask)
|
||||
address_map_entry &address_map_entry::set_submap(const char *tag, address_map_delegate func, int bits, u64 mask)
|
||||
{
|
||||
if(!bits)
|
||||
bits = m_map.m_databits;
|
||||
@ -103,7 +103,7 @@ address_map_entry &address_map_entry::set_submap(const char *tag, address_map_de
|
||||
// 8-bit read/write handlers
|
||||
//-------------------------------------------------
|
||||
|
||||
address_map_entry &address_map_entry::set_handler(read8_delegate func, uint64_t unitmask)
|
||||
address_map_entry &address_map_entry::set_handler(read8_delegate func, u64 unitmask)
|
||||
{
|
||||
assert(!func.isnull());
|
||||
assert(unitmask_is_appropriate(8, unitmask, func.name()));
|
||||
@ -116,7 +116,7 @@ address_map_entry &address_map_entry::set_handler(read8_delegate func, uint64_t
|
||||
}
|
||||
|
||||
|
||||
address_map_entry &address_map_entry::set_handler(write8_delegate func, uint64_t unitmask)
|
||||
address_map_entry &address_map_entry::set_handler(write8_delegate func, u64 unitmask)
|
||||
{
|
||||
assert(!func.isnull());
|
||||
assert(unitmask_is_appropriate(8, unitmask, func.name()));
|
||||
@ -129,7 +129,7 @@ address_map_entry &address_map_entry::set_handler(write8_delegate func, uint64_t
|
||||
}
|
||||
|
||||
|
||||
address_map_entry &address_map_entry::set_handler(read8_delegate rfunc, write8_delegate wfunc, uint64_t unitmask)
|
||||
address_map_entry &address_map_entry::set_handler(read8_delegate rfunc, write8_delegate wfunc, u64 unitmask)
|
||||
{
|
||||
set_handler(rfunc, unitmask);
|
||||
set_handler(wfunc, unitmask);
|
||||
@ -142,7 +142,7 @@ address_map_entry &address_map_entry::set_handler(read8_delegate rfunc, write8_d
|
||||
// 16-bit read/write handlers
|
||||
//-------------------------------------------------
|
||||
|
||||
address_map_entry &address_map_entry::set_handler(read16_delegate func, uint64_t unitmask)
|
||||
address_map_entry &address_map_entry::set_handler(read16_delegate func, u64 unitmask)
|
||||
{
|
||||
assert(!func.isnull());
|
||||
assert(unitmask_is_appropriate(16, unitmask, func.name()));
|
||||
@ -155,7 +155,7 @@ address_map_entry &address_map_entry::set_handler(read16_delegate func, uint64_t
|
||||
}
|
||||
|
||||
|
||||
address_map_entry &address_map_entry::set_handler(write16_delegate func, uint64_t unitmask)
|
||||
address_map_entry &address_map_entry::set_handler(write16_delegate func, u64 unitmask)
|
||||
{
|
||||
assert(!func.isnull());
|
||||
assert(unitmask_is_appropriate(16, unitmask, func.name()));
|
||||
@ -168,7 +168,7 @@ address_map_entry &address_map_entry::set_handler(write16_delegate func, uint64_
|
||||
}
|
||||
|
||||
|
||||
address_map_entry &address_map_entry::set_handler(read16_delegate rfunc, write16_delegate wfunc, uint64_t unitmask)
|
||||
address_map_entry &address_map_entry::set_handler(read16_delegate rfunc, write16_delegate wfunc, u64 unitmask)
|
||||
{
|
||||
set_handler(rfunc, unitmask);
|
||||
set_handler(wfunc, unitmask);
|
||||
@ -181,7 +181,7 @@ address_map_entry &address_map_entry::set_handler(read16_delegate rfunc, write16
|
||||
// 32-bit read/write handlers
|
||||
//-------------------------------------------------
|
||||
|
||||
address_map_entry &address_map_entry::set_handler(read32_delegate func, uint64_t unitmask)
|
||||
address_map_entry &address_map_entry::set_handler(read32_delegate func, u64 unitmask)
|
||||
{
|
||||
assert(!func.isnull());
|
||||
assert(unitmask_is_appropriate(32, unitmask, func.name()));
|
||||
@ -194,7 +194,7 @@ address_map_entry &address_map_entry::set_handler(read32_delegate func, uint64_t
|
||||
}
|
||||
|
||||
|
||||
address_map_entry &address_map_entry::set_handler(write32_delegate func, uint64_t unitmask)
|
||||
address_map_entry &address_map_entry::set_handler(write32_delegate func, u64 unitmask)
|
||||
{
|
||||
assert(!func.isnull());
|
||||
assert(unitmask_is_appropriate(32, unitmask, func.name()));
|
||||
@ -207,7 +207,7 @@ address_map_entry &address_map_entry::set_handler(write32_delegate func, uint64_
|
||||
}
|
||||
|
||||
|
||||
address_map_entry &address_map_entry::set_handler(read32_delegate rfunc, write32_delegate wfunc, uint64_t unitmask)
|
||||
address_map_entry &address_map_entry::set_handler(read32_delegate rfunc, write32_delegate wfunc, u64 unitmask)
|
||||
{
|
||||
set_handler(rfunc, unitmask);
|
||||
set_handler(wfunc, unitmask);
|
||||
@ -220,7 +220,7 @@ address_map_entry &address_map_entry::set_handler(read32_delegate rfunc, write32
|
||||
// 64-bit read/write handlers
|
||||
//-------------------------------------------------
|
||||
|
||||
address_map_entry &address_map_entry::set_handler(read64_delegate func, uint64_t unitmask)
|
||||
address_map_entry &address_map_entry::set_handler(read64_delegate func, u64 unitmask)
|
||||
{
|
||||
assert(!func.isnull());
|
||||
assert(unitmask_is_appropriate(64, unitmask, func.name()));
|
||||
@ -233,7 +233,7 @@ address_map_entry &address_map_entry::set_handler(read64_delegate func, uint64_t
|
||||
}
|
||||
|
||||
|
||||
address_map_entry &address_map_entry::set_handler(write64_delegate func, uint64_t unitmask)
|
||||
address_map_entry &address_map_entry::set_handler(write64_delegate func, u64 unitmask)
|
||||
{
|
||||
assert(!func.isnull());
|
||||
assert(unitmask_is_appropriate(64, unitmask, func.name()));
|
||||
@ -246,7 +246,7 @@ address_map_entry &address_map_entry::set_handler(write64_delegate func, uint64_
|
||||
}
|
||||
|
||||
|
||||
address_map_entry &address_map_entry::set_handler(read64_delegate rfunc, write64_delegate wfunc, uint64_t unitmask)
|
||||
address_map_entry &address_map_entry::set_handler(read64_delegate rfunc, write64_delegate wfunc, u64 unitmask)
|
||||
{
|
||||
set_handler(rfunc, unitmask);
|
||||
set_handler(wfunc, unitmask);
|
||||
@ -274,7 +274,7 @@ address_map_entry &address_map_entry::set_handler(setoffset_delegate func)
|
||||
// provided unitmask is valid and expected
|
||||
//-------------------------------------------------
|
||||
|
||||
bool address_map_entry::unitmask_is_appropriate(uint8_t width, uint64_t unitmask, const char *string)
|
||||
bool address_map_entry::unitmask_is_appropriate(u8 width, u64 unitmask, const char *string)
|
||||
{
|
||||
// if no mask, this must match the default width of the map
|
||||
if (unitmask == 0)
|
||||
@ -289,12 +289,12 @@ bool address_map_entry::unitmask_is_appropriate(uint8_t width, uint64_t unitmask
|
||||
throw emu_fatalerror("Handler %s is a %d-bit handler and is too wide to be used in a %d-bit address map", string, width, m_map.m_databits);
|
||||
|
||||
// the mask must represent whole units of width
|
||||
uint32_t basemask = (width == 8) ? 0xff : (width == 16) ? 0xffff : 0xffffffff;
|
||||
uint64_t singlemask = basemask;
|
||||
u32 basemask = (width == 8) ? 0xff : (width == 16) ? 0xffff : 0xffffffff;
|
||||
u64 singlemask = basemask;
|
||||
while (singlemask != 0)
|
||||
{
|
||||
if ((unitmask & singlemask) != 0 && (unitmask & singlemask) != singlemask)
|
||||
throw emu_fatalerror("Handler %s specified a mask of %08X%08X; needs to be in even chunks of %X", string, (uint32_t)(unitmask >> 32), (uint32_t)unitmask, basemask);
|
||||
throw emu_fatalerror("Handler %s specified a mask of %08X%08X; needs to be in even chunks of %X", string, (u32)(unitmask >> 32), (u32)unitmask, basemask);
|
||||
singlemask <<= width;
|
||||
}
|
||||
return true;
|
||||
@ -373,7 +373,7 @@ address_map::address_map(device_t &device, address_map_entry *entry)
|
||||
// address_map - constructor dynamic device mapping case
|
||||
//----------------------------------------------------------
|
||||
|
||||
address_map::address_map(const address_space &space, offs_t start, offs_t end, int bits, uint64_t unitmask, device_t &device, address_map_delegate submap_delegate)
|
||||
address_map::address_map(const address_space &space, offs_t start, offs_t end, int bits, u64 unitmask, device_t &device, address_map_delegate submap_delegate)
|
||||
: m_spacenum(space.spacenum()),
|
||||
m_device(&device),
|
||||
m_databits(space.data_width()),
|
||||
@ -399,7 +399,7 @@ address_map::~address_map()
|
||||
// values
|
||||
//-------------------------------------------------
|
||||
|
||||
void address_map::configure(address_spacenum spacenum, uint8_t databits)
|
||||
void address_map::configure(address_spacenum spacenum, u8 databits)
|
||||
{
|
||||
assert(m_spacenum == spacenum);
|
||||
if (m_databits == 0xff)
|
||||
@ -471,14 +471,14 @@ void address_map::uplift_submaps(running_machine &machine, device_t &owner, endi
|
||||
|
||||
offs_t mirror_address_mask = (databytes - 1) & ~(entry_bytes - 1);
|
||||
|
||||
uint64_t entry_mask = (2ULL << (entry_bits-1)) - 1;
|
||||
u64 entry_mask = (2ULL << (entry_bits-1)) - 1;
|
||||
|
||||
int slot_offset[8];
|
||||
int slot_count = 0;
|
||||
int max_slot_count = m_databits / entry_bits;
|
||||
int slot_xor_mask = endian == ENDIANNESS_LITTLE ? 0 : max_slot_count - 1;
|
||||
|
||||
uint64_t global_mask = entry->m_read.m_mask;
|
||||
u64 global_mask = entry->m_read.m_mask;
|
||||
// zero means all
|
||||
if (!global_mask)
|
||||
global_mask = ~global_mask;
|
||||
@ -547,10 +547,10 @@ void address_map::uplift_submaps(running_machine &machine, device_t &owner, endi
|
||||
if (mdata.m_bits == 0 && entry_bits != m_databits)
|
||||
mdata.m_bits = entry_bits;
|
||||
|
||||
uint64_t mask = 0;
|
||||
u64 mask = 0;
|
||||
if (mdata.m_bits != m_databits)
|
||||
{
|
||||
uint64_t unitmask = mdata.m_mask ? mdata.m_mask : entry_mask;
|
||||
u64 unitmask = mdata.m_mask ? mdata.m_mask : entry_mask;
|
||||
for (int slot = start_slot; slot <= end_slot; slot++)
|
||||
mask |= unitmask << slot_offset[slot];
|
||||
}
|
||||
@ -602,8 +602,8 @@ void address_map::map_validity_check(validity_checker &valid, address_spacenum s
|
||||
// loop over entries and look for errors
|
||||
for (address_map_entry &entry : m_entrylist)
|
||||
{
|
||||
uint32_t bytestart = spaceconfig.addr2byte(entry.m_addrstart);
|
||||
uint32_t byteend = spaceconfig.addr2byte_end(entry.m_addrend);
|
||||
u32 bytestart = spaceconfig.addr2byte(entry.m_addrstart);
|
||||
u32 byteend = spaceconfig.addr2byte_end(entry.m_addrend);
|
||||
|
||||
// look for overlapping entries
|
||||
if (!detected_overlap)
|
||||
|
@ -58,11 +58,11 @@ public:
|
||||
m_name(nullptr),
|
||||
m_tag(nullptr) { }
|
||||
|
||||
map_handler_type m_type; // type of the handler
|
||||
uint8_t m_bits; // width of the handler in bits, or 0 for default
|
||||
uint64_t m_mask; // mask for which lanes apply
|
||||
const char * m_name; // name of the handler
|
||||
const char * m_tag; // tag for I/O ports and banks
|
||||
map_handler_type m_type; // type of the handler
|
||||
u8 m_bits; // width of the handler in bits, or 0 for default
|
||||
u64 m_mask; // mask for which lanes apply
|
||||
const char * m_name; // name of the handler
|
||||
const char * m_tag; // tag for I/O ports and banks
|
||||
};
|
||||
|
||||
|
||||
@ -120,7 +120,7 @@ public:
|
||||
address_map_entry &set_write_type(map_handler_type _type) { m_write.m_type = _type; return *this; }
|
||||
|
||||
// submap referencing
|
||||
address_map_entry &set_submap(const char *tag, address_map_delegate func, int bits, uint64_t mask);
|
||||
address_map_entry &set_submap(const char *tag, address_map_delegate func, int bits, u64 mask);
|
||||
|
||||
// public state
|
||||
address_map_entry * m_next; // pointer to the next entry
|
||||
@ -162,28 +162,28 @@ public:
|
||||
offs_t m_bytemask; // byte-adjusted mask bits
|
||||
|
||||
// handler setters for 8-bit functions
|
||||
address_map_entry &set_handler(read8_delegate func, uint64_t mask = 0);
|
||||
address_map_entry &set_handler(write8_delegate func, uint64_t mask = 0);
|
||||
address_map_entry &set_handler(read8_delegate rfunc, write8_delegate wfunc, uint64_t mask = 0);
|
||||
address_map_entry &set_handler(read8_delegate func, u64 mask = 0);
|
||||
address_map_entry &set_handler(write8_delegate func, u64 mask = 0);
|
||||
address_map_entry &set_handler(read8_delegate rfunc, write8_delegate wfunc, u64 mask = 0);
|
||||
|
||||
// handler setters for 16-bit functions
|
||||
address_map_entry &set_handler(read16_delegate func, uint64_t mask = 0);
|
||||
address_map_entry &set_handler(write16_delegate func, uint64_t mask = 0);
|
||||
address_map_entry &set_handler(read16_delegate rfunc, write16_delegate wfunc, uint64_t mask = 0);
|
||||
address_map_entry &set_handler(read16_delegate func, u64 mask = 0);
|
||||
address_map_entry &set_handler(write16_delegate func, u64 mask = 0);
|
||||
address_map_entry &set_handler(read16_delegate rfunc, write16_delegate wfunc, u64 mask = 0);
|
||||
|
||||
// handler setters for 32-bit functions
|
||||
address_map_entry &set_handler(read32_delegate func, uint64_t mask = 0);
|
||||
address_map_entry &set_handler(write32_delegate func, uint64_t mask = 0);
|
||||
address_map_entry &set_handler(read32_delegate rfunc, write32_delegate wfunc, uint64_t mask = 0);
|
||||
address_map_entry &set_handler(read32_delegate func, u64 mask = 0);
|
||||
address_map_entry &set_handler(write32_delegate func, u64 mask = 0);
|
||||
address_map_entry &set_handler(read32_delegate rfunc, write32_delegate wfunc, u64 mask = 0);
|
||||
|
||||
// handler setters for 64-bit functions
|
||||
address_map_entry &set_handler(read64_delegate func, uint64_t mask = 0);
|
||||
address_map_entry &set_handler(write64_delegate func, uint64_t mask = 0);
|
||||
address_map_entry &set_handler(read64_delegate rfunc, write64_delegate wfunc, uint64_t mask = 0);
|
||||
address_map_entry &set_handler(read64_delegate func, u64 mask = 0);
|
||||
address_map_entry &set_handler(write64_delegate func, u64 mask = 0);
|
||||
address_map_entry &set_handler(read64_delegate rfunc, write64_delegate wfunc, u64 mask = 0);
|
||||
|
||||
private:
|
||||
// helper functions
|
||||
bool unitmask_is_appropriate(uint8_t width, uint64_t unitmask, const char *string);
|
||||
bool unitmask_is_appropriate(u8 width, u64 unitmask, const char *string);
|
||||
};
|
||||
|
||||
// ======================> address_map
|
||||
@ -195,28 +195,28 @@ public:
|
||||
// construction/destruction
|
||||
address_map(device_t &device, address_spacenum spacenum);
|
||||
address_map(device_t &device, address_map_entry *entry);
|
||||
address_map(const address_space &space, offs_t start, offs_t end, int bits, uint64_t unitmask, device_t &device, address_map_delegate submap_delegate);
|
||||
address_map(const address_space &space, offs_t start, offs_t end, int bits, u64 unitmask, device_t &device, address_map_delegate submap_delegate);
|
||||
~address_map();
|
||||
|
||||
// configuration
|
||||
void configure(address_spacenum _spacenum, uint8_t _databits);
|
||||
void configure(address_spacenum _spacenum, u8 _databits);
|
||||
|
||||
// setters
|
||||
void global_mask(offs_t mask);
|
||||
void unmap_value_low() { m_unmapval = 0; }
|
||||
void unmap_value_high() { m_unmapval = ~0; }
|
||||
void unmap_value(uint8_t value) { m_unmapval = value; }
|
||||
void unmap_value(u8 value) { m_unmapval = value; }
|
||||
|
||||
// add a new entry of the given type
|
||||
address_map_entry &range(offs_t start, offs_t end);
|
||||
|
||||
// public data
|
||||
address_spacenum m_spacenum; // space number of the map
|
||||
device_t * m_device; // associated device
|
||||
uint8_t m_databits; // data bits represented by the map
|
||||
uint8_t m_unmapval; // unmapped memory value
|
||||
offs_t m_globalmask; // global mask
|
||||
simple_list<address_map_entry> m_entrylist; // list of entries
|
||||
address_spacenum m_spacenum; // space number of the map
|
||||
device_t * m_device; // associated device
|
||||
u8 m_databits; // data bits represented by the map
|
||||
u8 m_unmapval; // unmapped memory value
|
||||
offs_t m_globalmask; // global mask
|
||||
simple_list<address_map_entry> m_entrylist; // list of entries
|
||||
|
||||
void uplift_submaps(running_machine &machine, device_t &owner, endianness_t endian);
|
||||
void map_validity_check(validity_checker &valid, address_spacenum spacenum) const;
|
||||
|
@ -29,7 +29,7 @@ const attotime attotime::never(ATTOTIME_MAX_SECONDS, 0);
|
||||
// constant
|
||||
//-------------------------------------------------
|
||||
|
||||
attotime &attotime::operator*=(uint32_t factor)
|
||||
attotime &attotime::operator*=(u32 factor)
|
||||
{
|
||||
// if one of the items is attotime::never, return attotime::never
|
||||
if (m_seconds >= ATTOTIME_MAX_SECONDS)
|
||||
@ -40,17 +40,17 @@ attotime &attotime::operator*=(uint32_t factor)
|
||||
return *this = zero;
|
||||
|
||||
// split attoseconds into upper and lower halves which fit into 32 bits
|
||||
uint32_t attolo;
|
||||
uint32_t attohi = divu_64x32_rem(m_attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &attolo);
|
||||
u32 attolo;
|
||||
u32 attohi = divu_64x32_rem(m_attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &attolo);
|
||||
|
||||
// scale the lower half, then split into high/low parts
|
||||
uint64_t temp = mulu_32x32(attolo, factor);
|
||||
uint32_t reslo;
|
||||
u64 temp = mulu_32x32(attolo, factor);
|
||||
u32 reslo;
|
||||
temp = divu_64x32_rem(temp, ATTOSECONDS_PER_SECOND_SQRT, &reslo);
|
||||
|
||||
// scale the upper half, then split into high/low parts
|
||||
temp += mulu_32x32(attohi, factor);
|
||||
uint32_t reshi;
|
||||
u32 reshi;
|
||||
temp = divu_64x32_rem(temp, ATTOSECONDS_PER_SECOND_SQRT, &reshi);
|
||||
|
||||
// scale the seconds
|
||||
@ -69,7 +69,7 @@ attotime &attotime::operator*=(uint32_t factor)
|
||||
// operator/= - divide an attotime by a constant
|
||||
//-------------------------------------------------
|
||||
|
||||
attotime &attotime::operator/=(uint32_t factor)
|
||||
attotime &attotime::operator/=(u32 factor)
|
||||
{
|
||||
// if one of the items is attotime::never, return attotime::never
|
||||
if (m_seconds >= ATTOTIME_MAX_SECONDS)
|
||||
@ -80,20 +80,20 @@ attotime &attotime::operator/=(uint32_t factor)
|
||||
return *this;
|
||||
|
||||
// split attoseconds into upper and lower halves which fit into 32 bits
|
||||
uint32_t attolo;
|
||||
uint32_t attohi = divu_64x32_rem(m_attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &attolo);
|
||||
u32 attolo;
|
||||
u32 attohi = divu_64x32_rem(m_attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &attolo);
|
||||
|
||||
// divide the seconds and get the remainder
|
||||
uint32_t remainder;
|
||||
u32 remainder;
|
||||
m_seconds = divu_64x32_rem(m_seconds, factor, &remainder);
|
||||
|
||||
// combine the upper half of attoseconds with the remainder and divide that
|
||||
uint64_t temp = (int64_t)attohi + mulu_32x32(remainder, ATTOSECONDS_PER_SECOND_SQRT);
|
||||
uint32_t reshi = divu_64x32_rem(temp, factor, &remainder);
|
||||
u64 temp = s64(attohi) + mulu_32x32(remainder, ATTOSECONDS_PER_SECOND_SQRT);
|
||||
u32 reshi = divu_64x32_rem(temp, factor, &remainder);
|
||||
|
||||
// combine the lower half of attoseconds with the remainder and divide that
|
||||
temp = attolo + mulu_32x32(remainder, ATTOSECONDS_PER_SECOND_SQRT);
|
||||
uint32_t reslo = divu_64x32_rem(temp, factor, &remainder);
|
||||
u32 reslo = divu_64x32_rem(temp, factor, &remainder);
|
||||
|
||||
// round based on the remainder
|
||||
m_attoseconds = (attoseconds_t)reslo + mulu_32x32(reshi, ATTOSECONDS_PER_SECOND_SQRT);
|
||||
@ -129,7 +129,7 @@ const char *attotime::as_string(int precision) const
|
||||
// case 2: we want 9 or fewer digits of precision
|
||||
else if (precision <= 9)
|
||||
{
|
||||
uint32_t upper = m_attoseconds / ATTOSECONDS_PER_SECOND_SQRT;
|
||||
u32 upper = m_attoseconds / ATTOSECONDS_PER_SECOND_SQRT;
|
||||
int temp = precision;
|
||||
while (temp < 9)
|
||||
{
|
||||
@ -142,8 +142,8 @@ const char *attotime::as_string(int precision) const
|
||||
// case 3: more than 9 digits of precision
|
||||
else
|
||||
{
|
||||
uint32_t lower;
|
||||
uint32_t upper = divu_64x32_rem(m_attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &lower);
|
||||
u32 lower;
|
||||
u32 upper = divu_64x32_rem(m_attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &lower);
|
||||
int temp = precision;
|
||||
while (temp < 18)
|
||||
{
|
||||
|
@ -44,8 +44,8 @@
|
||||
//**************************************************************************
|
||||
|
||||
// core components of the attotime structure
|
||||
typedef int64_t attoseconds_t;
|
||||
typedef int32_t seconds_t;
|
||||
typedef s64 attoseconds_t;
|
||||
typedef s32 seconds_t;
|
||||
|
||||
// core definitions
|
||||
const attoseconds_t ATTOSECONDS_PER_SECOND_SQRT = 1'000'000'000;
|
||||
@ -110,7 +110,7 @@ public:
|
||||
// conversion to other forms
|
||||
constexpr double as_double() const { return double(m_seconds) + ATTOSECONDS_TO_DOUBLE(m_attoseconds); }
|
||||
constexpr attoseconds_t as_attoseconds() const;
|
||||
uint64_t as_ticks(uint32_t frequency) const;
|
||||
u64 as_ticks(u32 frequency) const;
|
||||
/** Convert to string using at @p precision */
|
||||
const char *as_string(int precision = 9) const;
|
||||
|
||||
@ -120,23 +120,23 @@ public:
|
||||
constexpr seconds_t seconds() const { return m_seconds; }
|
||||
|
||||
static attotime from_double(double _time);
|
||||
static attotime from_ticks(uint64_t ticks, uint32_t frequency);
|
||||
static attotime from_ticks(u64 ticks, u32 frequency);
|
||||
/** Create an attotime from a integer count of seconds @seconds */
|
||||
static constexpr attotime from_seconds(int32_t seconds) { return attotime(seconds, 0); }
|
||||
static constexpr attotime from_seconds(s32 seconds) { return attotime(seconds, 0); }
|
||||
/** Create an attotime from a integer count of milliseconds @msec */
|
||||
static constexpr attotime from_msec(int64_t msec) { return attotime(msec / 1000, (msec % 1000) * (ATTOSECONDS_PER_SECOND / 1000)); }
|
||||
static constexpr attotime from_msec(s64 msec) { return attotime(msec / 1000, (msec % 1000) * (ATTOSECONDS_PER_SECOND / 1000)); }
|
||||
/** Create an attotime from a integer count of microseconds @usec */
|
||||
static constexpr attotime from_usec(int64_t usec) { return attotime(usec / 1000000, (usec % 1000000) * (ATTOSECONDS_PER_SECOND / 1000000)); }
|
||||
static constexpr attotime from_usec(s64 usec) { return attotime(usec / 1000000, (usec % 1000000) * (ATTOSECONDS_PER_SECOND / 1000000)); }
|
||||
/** Create an attotime from a integer count of nanoseconds @nsec */
|
||||
static constexpr attotime from_nsec(int64_t nsec) { return attotime(nsec / 1000000000, (nsec % 1000000000) * (ATTOSECONDS_PER_SECOND / 1000000000)); }
|
||||
static constexpr attotime from_nsec(s64 nsec) { return attotime(nsec / 1000000000, (nsec % 1000000000) * (ATTOSECONDS_PER_SECOND / 1000000000)); }
|
||||
/** Create an attotime from at the given frequency @frequency */
|
||||
static attotime from_hz(double frequency) { assert(frequency > 0); double d = 1 / frequency; return attotime(floor(d), modf(d, &d) * ATTOSECONDS_PER_SECOND); }
|
||||
|
||||
// math
|
||||
attotime &operator+=(const attotime &right);
|
||||
attotime &operator-=(const attotime &right);
|
||||
attotime &operator*=(uint32_t factor);
|
||||
attotime &operator/=(uint32_t factor);
|
||||
attotime &operator*=(u32 factor);
|
||||
attotime &operator/=(u32 factor);
|
||||
|
||||
// members
|
||||
seconds_t m_seconds;
|
||||
@ -246,14 +246,14 @@ inline attotime &attotime::operator-=(const attotime &right)
|
||||
|
||||
|
||||
/** handle multiplication by an integral factor; defined in terms of the assignment operators */
|
||||
inline attotime operator*(const attotime &left, uint32_t factor)
|
||||
inline attotime operator*(const attotime &left, u32 factor)
|
||||
{
|
||||
attotime result = left;
|
||||
result *= factor;
|
||||
return result;
|
||||
}
|
||||
|
||||
inline attotime operator*(uint32_t factor, const attotime &right)
|
||||
inline attotime operator*(u32 factor, const attotime &right)
|
||||
{
|
||||
attotime result = right;
|
||||
result *= factor;
|
||||
@ -261,7 +261,7 @@ inline attotime operator*(uint32_t factor, const attotime &right)
|
||||
}
|
||||
|
||||
/** handle division by an integral factor; defined in terms of the assignment operators */
|
||||
inline attotime operator/(const attotime &left, uint32_t factor)
|
||||
inline attotime operator/(const attotime &left, u32 factor)
|
||||
{
|
||||
attotime result = left;
|
||||
result /= factor;
|
||||
@ -332,24 +332,24 @@ inline constexpr attoseconds_t attotime::as_attoseconds() const
|
||||
|
||||
|
||||
/** as_ticks - convert to ticks at @p frequency */
|
||||
inline uint64_t attotime::as_ticks(uint32_t frequency) const
|
||||
inline u64 attotime::as_ticks(u32 frequency) const
|
||||
{
|
||||
uint32_t fracticks = (attotime(0, m_attoseconds) * frequency).m_seconds;
|
||||
u32 fracticks = (attotime(0, m_attoseconds) * frequency).m_seconds;
|
||||
return mulu_32x32(m_seconds, frequency) + fracticks;
|
||||
}
|
||||
|
||||
|
||||
/** Create an attotime from a tick count @ticks at the given frequency @frequency */
|
||||
inline attotime attotime::from_ticks(uint64_t ticks, uint32_t frequency)
|
||||
inline attotime attotime::from_ticks(u64 ticks, u32 frequency)
|
||||
{
|
||||
attoseconds_t attos_per_tick = HZ_TO_ATTOSECONDS(frequency);
|
||||
|
||||
if (ticks < frequency)
|
||||
return attotime(0, ticks * attos_per_tick);
|
||||
|
||||
uint32_t remainder;
|
||||
int32_t secs = divu_64x32_rem(ticks, frequency, &remainder);
|
||||
return attotime(secs, (uint64_t)remainder * attos_per_tick);
|
||||
u32 remainder;
|
||||
s32 secs = divu_64x32_rem(ticks, frequency, &remainder);
|
||||
return attotime(secs, u64(remainder) * attos_per_tick);
|
||||
}
|
||||
|
||||
/** Create an attotime from floating point count of seconds @p _time */
|
||||
|
@ -8,20 +8,13 @@
|
||||
|
||||
*********************************************************************/
|
||||
|
||||
#ifndef MAME_EMU_BOOKKEEPING_H
|
||||
#define MAME_EMU_BOOKKEEPING_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __BOOKKEEPING_H__
|
||||
#define __BOOKKEEPING_H__
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
CONSTANTS
|
||||
***************************************************************************/
|
||||
|
||||
/* total # of coin counters */
|
||||
#define COIN_COUNTERS 8
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
@ -34,6 +27,9 @@ enum class config_type;
|
||||
class bookkeeping_manager
|
||||
{
|
||||
public:
|
||||
// total # of coin counters
|
||||
static constexpr size_t COIN_COUNTERS = 8;
|
||||
|
||||
// construction/destruction
|
||||
bookkeeping_manager(running_machine &machine);
|
||||
|
||||
@ -69,10 +65,10 @@ private:
|
||||
// internal state
|
||||
running_machine & m_machine; // reference to our machine
|
||||
|
||||
uint32_t m_dispensed_tickets;
|
||||
uint32_t m_coin_count[COIN_COUNTERS];
|
||||
uint32_t m_coinlockedout[COIN_COUNTERS];
|
||||
uint32_t m_lastcoin[COIN_COUNTERS];
|
||||
u32 m_dispensed_tickets;
|
||||
u32 m_coin_count[COIN_COUNTERS];
|
||||
u32 m_coinlockedout[COIN_COUNTERS];
|
||||
u32 m_lastcoin[COIN_COUNTERS];
|
||||
};
|
||||
|
||||
#endif /* __BOOKKEEPING_H__ */
|
||||
#endif /* MAME_EMU_BOOKKEEPING_H */
|
||||
|
@ -29,7 +29,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/* raw bitmap */
|
||||
static const uint8_t crosshair_raw_top[] =
|
||||
static const u8 crosshair_raw_top[] =
|
||||
{
|
||||
0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,
|
||||
0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x00,
|
||||
@ -206,8 +206,8 @@ void render_crosshair::create_bitmap()
|
||||
for (y = 0; y < CROSSHAIR_RAW_SIZE / 2; y++)
|
||||
{
|
||||
/* assume it is mirrored vertically */
|
||||
uint32_t *dest0 = &m_bitmap->pix32(y);
|
||||
uint32_t *dest1 = &m_bitmap->pix32(CROSSHAIR_RAW_SIZE - 1 - y);
|
||||
u32 *dest0 = &m_bitmap->pix32(y);
|
||||
u32 *dest1 = &m_bitmap->pix32(CROSSHAIR_RAW_SIZE - 1 - y);
|
||||
|
||||
/* extract to two rows simultaneously */
|
||||
for (x = 0; x < CROSSHAIR_RAW_SIZE; x++)
|
||||
@ -225,7 +225,7 @@ void render_crosshair::create_bitmap()
|
||||
// animate - update the crosshair state
|
||||
//-------------------------------------------------
|
||||
|
||||
void render_crosshair::animate(uint16_t auto_time)
|
||||
void render_crosshair::animate(u16 auto_time)
|
||||
{
|
||||
// read all the port values
|
||||
if (m_used)
|
||||
@ -263,7 +263,7 @@ void render_crosshair::animate(uint16_t auto_time)
|
||||
// draw - render the crosshair to the container
|
||||
//-------------------------------------------------
|
||||
|
||||
void render_crosshair::draw(render_container &container, uint8_t fade)
|
||||
void render_crosshair::draw(render_container &container, u8 fade)
|
||||
{
|
||||
// add a quad assuming a 4:3 screen (this is not perfect)
|
||||
container.add_quad(m_x - 0.03f, m_y - 0.04f, m_x + 0.03f, m_y + 0.04f,
|
||||
@ -414,7 +414,7 @@ void crosshair_manager::config_load(config_type cfg_type, xml_data_node *parentn
|
||||
mode = crosshairnode->get_attribute_int("mode", CROSSHAIR_VISIBILITY_DEFAULT);
|
||||
if (mode >= CROSSHAIR_VISIBILITY_OFF && mode <= CROSSHAIR_VISIBILITY_AUTO)
|
||||
{
|
||||
crosshair.set_mode((uint8_t)mode);
|
||||
crosshair.set_mode(u8(mode));
|
||||
/* set visibility as specified by mode */
|
||||
/* auto mode starts with visibility off */
|
||||
crosshair.set_visible(mode == CROSSHAIR_VISIBILITY_ON);
|
||||
@ -432,7 +432,7 @@ void crosshair_manager::config_load(config_type cfg_type, xml_data_node *parentn
|
||||
{
|
||||
auto_time = crosshairnode->get_attribute_int("val", CROSSHAIR_VISIBILITY_AUTOTIME_DEFAULT);
|
||||
if ((auto_time >= CROSSHAIR_VISIBILITY_AUTOTIME_MIN) && (auto_time <= CROSSHAIR_VISIBILITY_AUTOTIME_MAX))
|
||||
m_auto_time = (uint8_t)auto_time;
|
||||
m_auto_time = u8(auto_time);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,10 +7,10 @@
|
||||
Crosshair handling.
|
||||
***************************************************************************/
|
||||
|
||||
#pragma once
|
||||
#ifndef MAME_EMU_CRSSHAIR_H
|
||||
#define MAME_EMU_CRSSHAIR_H
|
||||
|
||||
#ifndef __CRSSHAIR_H__
|
||||
#define __CRSSHAIR_H__
|
||||
#pragma once
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
@ -50,7 +50,7 @@ public:
|
||||
running_machine &machine() const { return m_machine; }
|
||||
int player() const { return m_player; }
|
||||
bool is_used() const { return m_used; }
|
||||
uint8_t mode() const { return m_mode; }
|
||||
u8 mode() const { return m_mode; }
|
||||
bool is_visible() const { return m_visible; }
|
||||
screen_device *screen() const { return m_screen; }
|
||||
float x() const { return m_x; }
|
||||
@ -59,7 +59,7 @@ public:
|
||||
|
||||
// setters
|
||||
void set_used(bool used) { m_used = used; }
|
||||
void set_mode(uint8_t mode) { m_mode = mode; }
|
||||
void set_mode(u8 mode) { m_mode = mode; }
|
||||
void set_visible(bool visible) { m_visible = visible; }
|
||||
void set_screen(screen_device *screen) { m_screen = screen; }
|
||||
//void setxy(float x, float y);
|
||||
@ -67,8 +67,8 @@ public:
|
||||
void set_default_bitmap();
|
||||
|
||||
// updates
|
||||
void animate(uint16_t auto_time);
|
||||
void draw(render_container &container, uint8_t fade);
|
||||
void animate(u16 auto_time);
|
||||
void draw(render_container &container, u8 fade);
|
||||
|
||||
private:
|
||||
// private helpers
|
||||
@ -78,7 +78,7 @@ private:
|
||||
running_machine & m_machine; // reference to our machine
|
||||
int m_player; // player number
|
||||
bool m_used; // usage for this crosshair
|
||||
uint8_t m_mode; // visibility mode for this crosshair
|
||||
u8 m_mode; // visibility mode for this crosshair
|
||||
bool m_visible; // visibility for this crosshair
|
||||
std::unique_ptr<bitmap_argb32> m_bitmap; // bitmap for this crosshair
|
||||
render_texture * m_texture; // texture for this crosshair
|
||||
@ -87,7 +87,7 @@ private:
|
||||
float m_y; // current Y position
|
||||
float m_last_x; // last X position
|
||||
float m_last_y; // last Y position
|
||||
uint16_t m_time; // time since last movement
|
||||
u16 m_time; // time since last movement
|
||||
std::string m_name; // name of png file
|
||||
};
|
||||
|
||||
@ -109,8 +109,8 @@ public:
|
||||
// getters
|
||||
running_machine &machine() const { return m_machine; }
|
||||
render_crosshair &get_crosshair(int player) const { assert(player >= 0 && player < MAX_PLAYERS); assert(m_crosshair[player] != nullptr); return *m_crosshair[player]; }
|
||||
uint16_t auto_time() const { return m_auto_time; }
|
||||
void set_auto_time(uint16_t auto_time) { m_auto_time = auto_time; }
|
||||
u16 auto_time() const { return m_auto_time; }
|
||||
void set_auto_time(u16 auto_time) { m_auto_time = auto_time; }
|
||||
|
||||
private:
|
||||
void exit();
|
||||
@ -124,9 +124,9 @@ private:
|
||||
|
||||
bool m_usage; // true if any crosshairs are used
|
||||
std::unique_ptr<render_crosshair> m_crosshair[MAX_PLAYERS]; // per-player crosshair state
|
||||
uint8_t m_fade; // color fading factor
|
||||
uint8_t m_animation_counter; // animation frame index
|
||||
uint16_t m_auto_time; // time in seconds to turn invisible
|
||||
u8 m_fade; // color fading factor
|
||||
u8 m_animation_counter; // animation frame index
|
||||
u16 m_auto_time; // time in seconds to turn invisible
|
||||
};
|
||||
|
||||
#endif /* __CRSSHAIR_H__ */
|
||||
#endif /* MAME_EMU_CRSSHAIR_H */
|
||||
|
@ -49,15 +49,15 @@ bool debugger_commands::cheat_address_is_valid(address_space &space, offs_t addr
|
||||
the current cheat width, if signed
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint64_t debugger_commands::cheat_sign_extend(const cheat_system *cheatsys, uint64_t value)
|
||||
u64 debugger_commands::cheat_sign_extend(const cheat_system *cheatsys, u64 value)
|
||||
{
|
||||
if (cheatsys->signed_cheat)
|
||||
{
|
||||
switch (cheatsys->width)
|
||||
{
|
||||
case 1: value = (int8_t)value; break;
|
||||
case 2: value = (int16_t)value; break;
|
||||
case 4: value = (int32_t)value; break;
|
||||
case 1: value = s8(value); break;
|
||||
case 2: value = s16(value); break;
|
||||
case 4: value = s32(value); break;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
@ -67,7 +67,7 @@ uint64_t debugger_commands::cheat_sign_extend(const cheat_system *cheatsys, uint
|
||||
cheat_byte_swap - swap a value
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint64_t debugger_commands::cheat_byte_swap(const cheat_system *cheatsys, uint64_t value)
|
||||
u64 debugger_commands::cheat_byte_swap(const cheat_system *cheatsys, u64 value)
|
||||
{
|
||||
if (cheatsys->swapped_cheat)
|
||||
{
|
||||
@ -75,8 +75,8 @@ uint64_t debugger_commands::cheat_byte_swap(const cheat_system *cheatsys, uint64
|
||||
{
|
||||
case 2: value = ((value >> 8) & 0x00ff) | ((value << 8) & 0xff00); break;
|
||||
case 4: value = ((value >> 24) & 0x000000ff) | ((value >> 8) & 0x0000ff00) | ((value << 8) & 0x00ff0000) | ((value << 24) & 0xff000000); break;
|
||||
case 8: value = ((value >> 56) & U64(0x00000000000000ff)) | ((value >> 40) & U64(0x000000000000ff00)) | ((value >> 24) & U64(0x0000000000ff0000)) | ((value >> 8) & U64(0x00000000ff000000)) |
|
||||
((value << 8) & U64(0x000000ff00000000)) | ((value << 24) & U64(0x0000ff0000000000)) | ((value << 40) & U64(0x00ff000000000000)) | ((value << 56) & U64(0xff00000000000000)); break;
|
||||
case 8: value = ((value >> 56) & 0x00000000000000ffU) | ((value >> 40) & 0x000000000000ff00U) | ((value >> 24) & 0x0000000000ff0000U) | ((value >> 8) & 0x00000000ff000000U) |
|
||||
((value << 8) & 0x000000ff00000000U) | ((value << 24) & 0x0000ff0000000000U) | ((value << 40) & 0x00ff000000000000U) | ((value << 56) & 0xff00000000000000U); break;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
@ -88,7 +88,7 @@ uint64_t debugger_commands::cheat_byte_swap(const cheat_system *cheatsys, uint64
|
||||
and swapping if necessary
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint64_t debugger_commands::cheat_read_extended(const cheat_system *cheatsys, address_space &space, offs_t address)
|
||||
u64 debugger_commands::cheat_read_extended(const cheat_system *cheatsys, address_space &space, offs_t address)
|
||||
{
|
||||
return cheat_sign_extend(cheatsys, cheat_byte_swap(cheatsys, m_cpu.read_memory(space, address, cheatsys->width, true)));
|
||||
}
|
||||
@ -111,7 +111,7 @@ debugger_commands::debugger_commands(running_machine& machine, debugger_cpu& cpu
|
||||
/* add all single-entry save state globals */
|
||||
for (int itemnum = 0; itemnum < MAX_GLOBALS; itemnum++)
|
||||
{
|
||||
uint32_t valsize, valcount;
|
||||
u32 valsize, valcount;
|
||||
void *base;
|
||||
|
||||
/* stop when we run out of items */
|
||||
@ -281,7 +281,7 @@ debugger_commands::debugger_commands(running_machine& machine, debugger_cpu& cpu
|
||||
execute_min - return the minimum of two values
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint64_t debugger_commands::execute_min(symbol_table &table, void *ref, int params, const uint64_t *param)
|
||||
u64 debugger_commands::execute_min(symbol_table &table, void *ref, int params, const u64 *param)
|
||||
{
|
||||
return (param[0] < param[1]) ? param[0] : param[1];
|
||||
}
|
||||
@ -291,7 +291,7 @@ uint64_t debugger_commands::execute_min(symbol_table &table, void *ref, int para
|
||||
execute_max - return the maximum of two values
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint64_t debugger_commands::execute_max(symbol_table &table, void *ref, int params, const uint64_t *param)
|
||||
u64 debugger_commands::execute_max(symbol_table &table, void *ref, int params, const u64 *param)
|
||||
{
|
||||
return (param[0] > param[1]) ? param[0] : param[1];
|
||||
}
|
||||
@ -301,7 +301,7 @@ uint64_t debugger_commands::execute_max(symbol_table &table, void *ref, int para
|
||||
execute_if - if (a) return b; else return c;
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint64_t debugger_commands::execute_if(symbol_table &table, void *ref, int params, const uint64_t *param)
|
||||
u64 debugger_commands::execute_if(symbol_table &table, void *ref, int params, const u64 *param)
|
||||
{
|
||||
return param[0] ? param[1] : param[2];
|
||||
}
|
||||
@ -316,15 +316,15 @@ uint64_t debugger_commands::execute_if(symbol_table &table, void *ref, int param
|
||||
global_get - symbol table getter for globals
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint64_t debugger_commands::global_get(symbol_table &table, void *ref)
|
||||
u64 debugger_commands::global_get(symbol_table &table, void *ref)
|
||||
{
|
||||
global_entry *global = (global_entry *)ref;
|
||||
switch (global->size)
|
||||
{
|
||||
case 1: return *(uint8_t *)global->base;
|
||||
case 2: return *(uint16_t *)global->base;
|
||||
case 4: return *(uint32_t *)global->base;
|
||||
case 8: return *(uint64_t *)global->base;
|
||||
case 1: return *(u8 *)global->base;
|
||||
case 2: return *(u16 *)global->base;
|
||||
case 4: return *(u32 *)global->base;
|
||||
case 8: return *(u64 *)global->base;
|
||||
}
|
||||
return ~0;
|
||||
}
|
||||
@ -334,15 +334,15 @@ uint64_t debugger_commands::global_get(symbol_table &table, void *ref)
|
||||
global_set - symbol table setter for globals
|
||||
-------------------------------------------------*/
|
||||
|
||||
void debugger_commands::global_set(symbol_table &table, void *ref, uint64_t value)
|
||||
void debugger_commands::global_set(symbol_table &table, void *ref, u64 value)
|
||||
{
|
||||
global_entry *global = (global_entry *)ref;
|
||||
switch (global->size)
|
||||
{
|
||||
case 1: *(uint8_t *)global->base = value; break;
|
||||
case 2: *(uint16_t *)global->base = value; break;
|
||||
case 4: *(uint32_t *)global->base = value; break;
|
||||
case 8: *(uint64_t *)global->base = value; break;
|
||||
case 1: *(u8 *)global->base = value; break;
|
||||
case 2: *(u16 *)global->base = value; break;
|
||||
case 4: *(u32 *)global->base = value; break;
|
||||
case 8: *(u64 *)global->base = value; break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -357,7 +357,7 @@ void debugger_commands::global_set(symbol_table &table, void *ref, uint64_t valu
|
||||
number parameter
|
||||
-------------------------------------------------*/
|
||||
|
||||
bool debugger_commands::validate_number_parameter(const char *param, uint64_t *result)
|
||||
bool debugger_commands::validate_number_parameter(const char *param, u64 *result)
|
||||
{
|
||||
/* nullptr parameter does nothing and returns no error */
|
||||
if (param == nullptr)
|
||||
@ -432,7 +432,7 @@ bool debugger_commands::validate_cpu_parameter(const char *param, device_t **res
|
||||
return true;
|
||||
|
||||
/* then evaluate as an expression; on an error assume it was a tag */
|
||||
uint64_t cpunum;
|
||||
u64 cpunum;
|
||||
try
|
||||
{
|
||||
parsed_expression expression(m_cpu.get_visible_symtable(), param, &cpunum);
|
||||
@ -552,7 +552,7 @@ void debugger_commands::execute_help(int ref, int params, const char *param[])
|
||||
void debugger_commands::execute_print(int ref, int params, const char *param[])
|
||||
{
|
||||
/* validate the other parameters */
|
||||
uint64_t values[MAX_COMMAND_PARAMS];
|
||||
u64 values[MAX_COMMAND_PARAMS];
|
||||
for (int i = 0; i < params; i++)
|
||||
if (!validate_number_parameter(param[i], &values[i]))
|
||||
return;
|
||||
@ -568,7 +568,7 @@ void debugger_commands::execute_print(int ref, int params, const char *param[])
|
||||
mini_printf - safe printf to a buffer
|
||||
-------------------------------------------------*/
|
||||
|
||||
int debugger_commands::mini_printf(char *buffer, const char *format, int params, uint64_t *param)
|
||||
int debugger_commands::mini_printf(char *buffer, const char *format, int params, u64 *param)
|
||||
{
|
||||
const char *f = format;
|
||||
char *p = buffer;
|
||||
@ -624,11 +624,11 @@ int debugger_commands::mini_printf(char *buffer, const char *format, int params,
|
||||
m_console.printf("Not enough parameters for format!\n");
|
||||
return 0;
|
||||
}
|
||||
if ((uint32_t)(*param >> 32) != 0)
|
||||
p += sprintf(p, zerofill ? "%0*X" : "%*X", (width <= 8) ? 1 : width - 8, (uint32_t)(*param >> 32));
|
||||
if (u32(*param >> 32) != 0)
|
||||
p += sprintf(p, zerofill ? "%0*X" : "%*X", (width <= 8) ? 1 : width - 8, u32(*param >> 32));
|
||||
else if (width > 8)
|
||||
p += sprintf(p, zerofill ? "%0*X" : "%*X", width - 8, 0);
|
||||
p += sprintf(p, zerofill ? "%0*X" : "%*X", (width < 8) ? width : 8, (uint32_t)*param);
|
||||
p += sprintf(p, zerofill ? "%0*X" : "%*X", (width < 8) ? width : 8, u32(*param));
|
||||
param++;
|
||||
params--;
|
||||
break;
|
||||
@ -640,7 +640,7 @@ int debugger_commands::mini_printf(char *buffer, const char *format, int params,
|
||||
m_console.printf("Not enough parameters for format!\n");
|
||||
return 0;
|
||||
}
|
||||
p += sprintf(p, zerofill ? "%0*d" : "%*d", width, (uint32_t)*param);
|
||||
p += sprintf(p, zerofill ? "%0*d" : "%*d", width, u32(*param));
|
||||
param++;
|
||||
params--;
|
||||
break;
|
||||
@ -665,7 +665,7 @@ int debugger_commands::mini_printf(char *buffer, const char *format, int params,
|
||||
void debugger_commands::execute_printf(int ref, int params, const char *param[])
|
||||
{
|
||||
/* validate the other parameters */
|
||||
uint64_t values[MAX_COMMAND_PARAMS];
|
||||
u64 values[MAX_COMMAND_PARAMS];
|
||||
for (int i = 1; i < params; i++)
|
||||
if (!validate_number_parameter(param[i], &values[i]))
|
||||
return;
|
||||
@ -684,7 +684,7 @@ void debugger_commands::execute_printf(int ref, int params, const char *param[])
|
||||
void debugger_commands::execute_logerror(int ref, int params, const char *param[])
|
||||
{
|
||||
/* validate the other parameters */
|
||||
uint64_t values[MAX_COMMAND_PARAMS];
|
||||
u64 values[MAX_COMMAND_PARAMS];
|
||||
for (int i = 1; i < params; i++)
|
||||
if (!validate_number_parameter(param[i], &values[i]))
|
||||
return;
|
||||
@ -703,7 +703,7 @@ void debugger_commands::execute_logerror(int ref, int params, const char *param[
|
||||
void debugger_commands::execute_tracelog(int ref, int params, const char *param[])
|
||||
{
|
||||
/* validate the other parameters */
|
||||
uint64_t values[MAX_COMMAND_PARAMS];
|
||||
u64 values[MAX_COMMAND_PARAMS];
|
||||
for (int i = 1; i < params; i++)
|
||||
if (!validate_number_parameter(param[i], &values[i]))
|
||||
return;
|
||||
@ -732,7 +732,7 @@ void debugger_commands::execute_quit(int ref, int params, const char *param[])
|
||||
|
||||
void debugger_commands::execute_do(int ref, int params, const char *param[])
|
||||
{
|
||||
uint64_t dummy;
|
||||
u64 dummy;
|
||||
validate_number_parameter(param[0], &dummy);
|
||||
}
|
||||
|
||||
@ -744,7 +744,7 @@ void debugger_commands::execute_do(int ref, int params, const char *param[])
|
||||
void debugger_commands::execute_step(int ref, int params, const char *param[])
|
||||
{
|
||||
/* if we have a parameter, use it */
|
||||
uint64_t steps = 1;
|
||||
u64 steps = 1;
|
||||
if (!validate_number_parameter(param[0], &steps))
|
||||
return;
|
||||
|
||||
@ -759,7 +759,7 @@ void debugger_commands::execute_step(int ref, int params, const char *param[])
|
||||
void debugger_commands::execute_over(int ref, int params, const char *param[])
|
||||
{
|
||||
/* if we have a parameter, use it */
|
||||
uint64_t steps = 1;
|
||||
u64 steps = 1;
|
||||
if (!validate_number_parameter(param[0], &steps))
|
||||
return;
|
||||
|
||||
@ -783,7 +783,7 @@ void debugger_commands::execute_out(int ref, int params, const char *param[])
|
||||
|
||||
void debugger_commands::execute_go(int ref, int params, const char *param[])
|
||||
{
|
||||
uint64_t addr = ~0;
|
||||
u64 addr = ~0;
|
||||
|
||||
/* if we have a parameter, use it instead */
|
||||
if (!validate_number_parameter(param[0], &addr))
|
||||
@ -810,7 +810,7 @@ void debugger_commands::execute_go_vblank(int ref, int params, const char *param
|
||||
|
||||
void debugger_commands::execute_go_interrupt(int ref, int params, const char *param[])
|
||||
{
|
||||
uint64_t irqline = -1;
|
||||
u64 irqline = -1;
|
||||
|
||||
/* if we have a parameter, use it instead */
|
||||
if (!validate_number_parameter(param[0], &irqline))
|
||||
@ -826,7 +826,7 @@ void debugger_commands::execute_go_interrupt(int ref, int params, const char *pa
|
||||
|
||||
void debugger_commands::execute_go_time(int ref, int params, const char *param[])
|
||||
{
|
||||
uint64_t milliseconds = -1;
|
||||
u64 milliseconds = -1;
|
||||
|
||||
/* if we have a parameter, use it instead */
|
||||
if (!validate_number_parameter(param[0], &milliseconds))
|
||||
@ -987,7 +987,7 @@ void debugger_commands::execute_observe(int ref, int params, const char *param[]
|
||||
void debugger_commands::execute_comment_add(int ref, int params, const char *param[])
|
||||
{
|
||||
device_t *cpu;
|
||||
uint64_t address;
|
||||
u64 address;
|
||||
|
||||
/* param 1 is the address for the comment */
|
||||
if (!validate_number_parameter(param[0], &address))
|
||||
@ -1017,7 +1017,7 @@ void debugger_commands::execute_comment_add(int ref, int params, const char *par
|
||||
void debugger_commands::execute_comment_del(int ref, int params, const char *param[])
|
||||
{
|
||||
device_t *cpu;
|
||||
uint64_t address;
|
||||
u64 address;
|
||||
|
||||
/* param 1 can either be a command or the address for the comment */
|
||||
if (!validate_number_parameter(param[0], &address))
|
||||
@ -1093,7 +1093,7 @@ void debugger_commands::execute_bpset(int ref, int params, const char *param[])
|
||||
{
|
||||
device_t *cpu;
|
||||
const char *action = nullptr;
|
||||
uint64_t address;
|
||||
u64 address;
|
||||
int bpnum;
|
||||
|
||||
/* CPU is implicit */
|
||||
@ -1126,7 +1126,7 @@ void debugger_commands::execute_bpset(int ref, int params, const char *param[])
|
||||
|
||||
void debugger_commands::execute_bpclear(int ref, int params, const char *param[])
|
||||
{
|
||||
uint64_t bpindex;
|
||||
u64 bpindex;
|
||||
|
||||
/* if 0 parameters, clear all */
|
||||
if (params == 0)
|
||||
@ -1146,9 +1146,9 @@ void debugger_commands::execute_bpclear(int ref, int params, const char *param[]
|
||||
if (device.debug()->breakpoint_clear(bpindex))
|
||||
found = true;
|
||||
if (found)
|
||||
m_console.printf("Breakpoint %X cleared\n", (uint32_t)bpindex);
|
||||
m_console.printf("Breakpoint %X cleared\n", u32(bpindex));
|
||||
else
|
||||
m_console.printf("Invalid breakpoint number %X\n", (uint32_t)bpindex);
|
||||
m_console.printf("Invalid breakpoint number %X\n", u32(bpindex));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1160,7 +1160,7 @@ void debugger_commands::execute_bpclear(int ref, int params, const char *param[]
|
||||
|
||||
void debugger_commands::execute_bpdisenable(int ref, int params, const char *param[])
|
||||
{
|
||||
uint64_t bpindex;
|
||||
u64 bpindex;
|
||||
|
||||
/* if 0 parameters, clear all */
|
||||
if (params == 0)
|
||||
@ -1183,9 +1183,9 @@ void debugger_commands::execute_bpdisenable(int ref, int params, const char *par
|
||||
if (device.debug()->breakpoint_enable(bpindex, ref))
|
||||
found = true;
|
||||
if (found)
|
||||
m_console.printf("Breakpoint %X %s\n", (uint32_t)bpindex, ref ? "enabled" : "disabled");
|
||||
m_console.printf("Breakpoint %X %s\n", u32(bpindex), ref ? "enabled" : "disabled");
|
||||
else
|
||||
m_console.printf("Invalid breakpoint number %X\n", (uint32_t)bpindex);
|
||||
m_console.printf("Invalid breakpoint number %X\n", u32(bpindex));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1233,7 +1233,7 @@ void debugger_commands::execute_wpset(int ref, int params, const char *param[])
|
||||
{
|
||||
address_space *space;
|
||||
const char *action = nullptr;
|
||||
uint64_t address, length;
|
||||
u64 address, length;
|
||||
int type;
|
||||
int wpnum;
|
||||
|
||||
@ -1284,7 +1284,7 @@ void debugger_commands::execute_wpset(int ref, int params, const char *param[])
|
||||
|
||||
void debugger_commands::execute_wpclear(int ref, int params, const char *param[])
|
||||
{
|
||||
uint64_t wpindex;
|
||||
u64 wpindex;
|
||||
|
||||
/* if 0 parameters, clear all */
|
||||
if (params == 0)
|
||||
@ -1304,9 +1304,9 @@ void debugger_commands::execute_wpclear(int ref, int params, const char *param[]
|
||||
if (device.debug()->watchpoint_clear(wpindex))
|
||||
found = true;
|
||||
if (found)
|
||||
m_console.printf("Watchpoint %X cleared\n", (uint32_t)wpindex);
|
||||
m_console.printf("Watchpoint %X cleared\n", u32(wpindex));
|
||||
else
|
||||
m_console.printf("Invalid watchpoint number %X\n", (uint32_t)wpindex);
|
||||
m_console.printf("Invalid watchpoint number %X\n", u32(wpindex));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1318,7 +1318,7 @@ void debugger_commands::execute_wpclear(int ref, int params, const char *param[]
|
||||
|
||||
void debugger_commands::execute_wpdisenable(int ref, int params, const char *param[])
|
||||
{
|
||||
uint64_t wpindex;
|
||||
u64 wpindex;
|
||||
|
||||
/* if 0 parameters, clear all */
|
||||
if (params == 0)
|
||||
@ -1341,9 +1341,9 @@ void debugger_commands::execute_wpdisenable(int ref, int params, const char *par
|
||||
if (device.debug()->watchpoint_enable(wpindex, ref))
|
||||
found = true;
|
||||
if (found)
|
||||
m_console.printf("Watchpoint %X %s\n", (uint32_t)wpindex, ref ? "enabled" : "disabled");
|
||||
m_console.printf("Watchpoint %X %s\n", u32(wpindex), ref ? "enabled" : "disabled");
|
||||
else
|
||||
m_console.printf("Invalid watchpoint number %X\n", (uint32_t)wpindex);
|
||||
m_console.printf("Invalid watchpoint number %X\n", u32(wpindex));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1426,7 +1426,7 @@ void debugger_commands::execute_rpset(int ref, int params, const char *param[])
|
||||
|
||||
void debugger_commands::execute_rpclear(int ref, int params, const char *param[])
|
||||
{
|
||||
uint64_t rpindex;
|
||||
u64 rpindex;
|
||||
|
||||
/* if 0 parameters, clear all */
|
||||
if (params == 0)
|
||||
@ -1446,9 +1446,9 @@ void debugger_commands::execute_rpclear(int ref, int params, const char *param[]
|
||||
if (device.debug()->registerpoint_clear(rpindex))
|
||||
found = true;
|
||||
if (found)
|
||||
m_console.printf("Registerpoint %X cleared\n", (uint32_t)rpindex);
|
||||
m_console.printf("Registerpoint %X cleared\n", u32(rpindex));
|
||||
else
|
||||
m_console.printf("Invalid registerpoint number %X\n", (uint32_t)rpindex);
|
||||
m_console.printf("Invalid registerpoint number %X\n", u32(rpindex));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1460,7 +1460,7 @@ void debugger_commands::execute_rpclear(int ref, int params, const char *param[]
|
||||
|
||||
void debugger_commands::execute_rpdisenable(int ref, int params, const char *param[])
|
||||
{
|
||||
uint64_t rpindex;
|
||||
u64 rpindex;
|
||||
|
||||
/* if 0 parameters, clear all */
|
||||
if (params == 0)
|
||||
@ -1483,9 +1483,9 @@ void debugger_commands::execute_rpdisenable(int ref, int params, const char *par
|
||||
if (device.debug()->registerpoint_enable(rpindex, ref))
|
||||
found = true;
|
||||
if (found)
|
||||
m_console.printf("Registerpoint %X %s\n", (uint32_t)rpindex, ref ? "enabled" : "disabled");
|
||||
m_console.printf("Registerpoint %X %s\n", u32(rpindex), ref ? "enabled" : "disabled");
|
||||
else
|
||||
m_console.printf("Invalid registerpoint number %X\n", (uint32_t)rpindex);
|
||||
m_console.printf("Invalid registerpoint number %X\n", u32(rpindex));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1552,10 +1552,10 @@ void debugger_commands::execute_hotspot(int ref, int params, const char *param[]
|
||||
device_t *device = nullptr;
|
||||
if (!validate_cpu_parameter((params > 0) ? param[0] : nullptr, &device))
|
||||
return;
|
||||
uint64_t count = 64;
|
||||
u64 count = 64;
|
||||
if (!validate_number_parameter(param[1], &count))
|
||||
return;
|
||||
uint64_t threshhold = 250;
|
||||
u64 threshhold = 250;
|
||||
if (!validate_number_parameter(param[2], &threshhold))
|
||||
return;
|
||||
|
||||
@ -1602,10 +1602,10 @@ void debugger_commands::execute_stateload(int ref, int params, const char *param
|
||||
|
||||
void debugger_commands::execute_save(int ref, int params, const char *param[])
|
||||
{
|
||||
uint64_t offset, endoffset, length;
|
||||
u64 offset, endoffset, length;
|
||||
address_space *space;
|
||||
FILE *f;
|
||||
uint64_t i;
|
||||
u64 i;
|
||||
|
||||
/* validate parameters */
|
||||
if (!validate_number_parameter(param[1], &offset))
|
||||
@ -1630,7 +1630,7 @@ void debugger_commands::execute_save(int ref, int params, const char *param[])
|
||||
/* now write the data out */
|
||||
for (i = offset; i <= endoffset; i++)
|
||||
{
|
||||
uint8_t byte = m_cpu.read_byte(*space, i, true);
|
||||
u8 byte = m_cpu.read_byte(*space, i, true);
|
||||
fwrite(&byte, 1, 1, f);
|
||||
}
|
||||
|
||||
@ -1646,10 +1646,10 @@ void debugger_commands::execute_save(int ref, int params, const char *param[])
|
||||
|
||||
void debugger_commands::execute_load(int ref, int params, const char *param[])
|
||||
{
|
||||
uint64_t offset, endoffset, length;
|
||||
u64 offset, endoffset, length;
|
||||
address_space *space;
|
||||
FILE *f;
|
||||
uint64_t i;
|
||||
u64 i;
|
||||
|
||||
/* validate parameters */
|
||||
if (!validate_number_parameter(param[1], &offset))
|
||||
@ -1672,7 +1672,7 @@ void debugger_commands::execute_load(int ref, int params, const char *param[])
|
||||
}
|
||||
|
||||
/* now read the data in, ignore endoffset and load entire file if length has been set to zero (offset-1) */
|
||||
uint8_t byte;
|
||||
u8 byte;
|
||||
for (i = offset; i <= endoffset || endoffset == offset - 1 ; i++)
|
||||
{
|
||||
fread(&byte, 1, 1, f);
|
||||
@ -1697,23 +1697,23 @@ void debugger_commands::execute_load(int ref, int params, const char *param[])
|
||||
void debugger_commands::execute_dump(int ref, int params, const char *param[])
|
||||
{
|
||||
/* validate parameters */
|
||||
uint64_t offset;
|
||||
u64 offset;
|
||||
if (!validate_number_parameter(param[1], &offset))
|
||||
return;
|
||||
|
||||
uint64_t length;
|
||||
u64 length;
|
||||
if (!validate_number_parameter(param[2], &length))
|
||||
return;
|
||||
|
||||
uint64_t width = 0;
|
||||
u64 width = 0;
|
||||
if (!validate_number_parameter(param[3], &width))
|
||||
return;
|
||||
|
||||
uint64_t ascii = 1;
|
||||
u64 ascii = 1;
|
||||
if (!validate_number_parameter(param[4], &ascii))
|
||||
return;
|
||||
|
||||
uint64_t rowsize = 16;
|
||||
u64 rowsize = 16;
|
||||
if (!validate_number_parameter(param[5], &rowsize))
|
||||
return;
|
||||
|
||||
@ -1737,7 +1737,7 @@ void debugger_commands::execute_dump(int ref, int params, const char *param[])
|
||||
return;
|
||||
}
|
||||
|
||||
uint64_t endoffset = space->address_to_byte(offset + length - 1) & space->bytemask();
|
||||
u64 endoffset = space->address_to_byte(offset + length - 1) & space->bytemask();
|
||||
offset = space->address_to_byte(offset) & space->bytemask();
|
||||
|
||||
/* open the file */
|
||||
@ -1751,23 +1751,23 @@ void debugger_commands::execute_dump(int ref, int params, const char *param[])
|
||||
/* now write the data out */
|
||||
util::ovectorstream output;
|
||||
output.reserve(200);
|
||||
for (uint64_t i = offset; i <= endoffset; i += rowsize)
|
||||
for (u64 i = offset; i <= endoffset; i += rowsize)
|
||||
{
|
||||
output.clear();
|
||||
output.rdbuf()->clear();
|
||||
|
||||
/* print the address */
|
||||
util::stream_format(output, "%0*X: ", space->logaddrchars(), (uint32_t)space->byte_to_address(i));
|
||||
util::stream_format(output, "%0*X: ", space->logaddrchars(), u32(space->byte_to_address(i)));
|
||||
|
||||
/* print the bytes */
|
||||
for (uint64_t j = 0; j < rowsize; j += width)
|
||||
for (u64 j = 0; j < rowsize; j += width)
|
||||
{
|
||||
if (i + j <= endoffset)
|
||||
{
|
||||
offs_t curaddr = i + j;
|
||||
if (space->device().memory().translate(space->spacenum(), TRANSLATE_READ_DEBUG, curaddr))
|
||||
{
|
||||
uint64_t value = m_cpu.read_memory(*space, i + j, width, true);
|
||||
u64 value = m_cpu.read_memory(*space, i + j, width, true);
|
||||
util::stream_format(output, " %0*X", width * 2, value);
|
||||
}
|
||||
else
|
||||
@ -1783,12 +1783,12 @@ void debugger_commands::execute_dump(int ref, int params, const char *param[])
|
||||
if (ascii)
|
||||
{
|
||||
util::stream_format(output, " ");
|
||||
for (uint64_t j = 0; j < rowsize && (i + j) <= endoffset; j++)
|
||||
for (u64 j = 0; j < rowsize && (i + j) <= endoffset; j++)
|
||||
{
|
||||
offs_t curaddr = i + j;
|
||||
if (space->device().memory().translate(space->spacenum(), TRANSLATE_READ_DEBUG, curaddr))
|
||||
{
|
||||
uint8_t byte = m_cpu.read_byte(*space, i + j, true);
|
||||
u8 byte = m_cpu.read_byte(*space, i + j, true);
|
||||
util::stream_format(output, "%c", (byte >= 32 && byte < 127) ? byte : '.');
|
||||
}
|
||||
else
|
||||
@ -1815,11 +1815,11 @@ void debugger_commands::execute_dump(int ref, int params, const char *param[])
|
||||
|
||||
void debugger_commands::execute_cheatinit(int ref, int params, const char *param[])
|
||||
{
|
||||
uint64_t offset, length = 0, real_length = 0;
|
||||
u64 offset, length = 0, real_length = 0;
|
||||
address_space *space;
|
||||
uint32_t active_cheat = 0;
|
||||
uint64_t curaddr;
|
||||
uint8_t i, region_count = 0;
|
||||
u32 active_cheat = 0;
|
||||
u64 curaddr;
|
||||
u8 i, region_count = 0;
|
||||
|
||||
cheat_region_map cheat_region[100];
|
||||
|
||||
@ -1969,10 +1969,10 @@ void debugger_commands::execute_cheatinit(int ref, int params, const char *param
|
||||
void debugger_commands::execute_cheatnext(int ref, int params, const char *param[])
|
||||
{
|
||||
address_space *space;
|
||||
uint64_t cheatindex;
|
||||
uint32_t active_cheat = 0;
|
||||
uint8_t condition;
|
||||
uint64_t comp_value = 0;
|
||||
u64 cheatindex;
|
||||
u32 active_cheat = 0;
|
||||
u8 condition;
|
||||
u64 comp_value = 0;
|
||||
|
||||
enum
|
||||
{
|
||||
@ -2038,9 +2038,9 @@ void debugger_commands::execute_cheatnext(int ref, int params, const char *param
|
||||
for (cheatindex = 0; cheatindex < m_cheat.cheatmap.size(); cheatindex += 1)
|
||||
if (m_cheat.cheatmap[cheatindex].state == 1)
|
||||
{
|
||||
uint64_t cheat_value = cheat_read_extended(&m_cheat, *space, m_cheat.cheatmap[cheatindex].offset);
|
||||
uint64_t comp_byte = (ref == 0) ? m_cheat.cheatmap[cheatindex].previous_value : m_cheat.cheatmap[cheatindex].first_value;
|
||||
uint8_t disable_byte = false;
|
||||
u64 cheat_value = cheat_read_extended(&m_cheat, *space, m_cheat.cheatmap[cheatindex].offset);
|
||||
u64 comp_byte = (ref == 0) ? m_cheat.cheatmap[cheatindex].previous_value : m_cheat.cheatmap[cheatindex].first_value;
|
||||
u8 disable_byte = false;
|
||||
|
||||
switch (condition)
|
||||
{
|
||||
@ -2065,30 +2065,30 @@ void debugger_commands::execute_cheatnext(int ref, int params, const char *param
|
||||
|
||||
case CHEAT_DECREASE:
|
||||
if (m_cheat.signed_cheat)
|
||||
disable_byte = ((int64_t)cheat_value >= (int64_t)comp_byte);
|
||||
disable_byte = (s64(cheat_value) >= s64(comp_byte));
|
||||
else
|
||||
disable_byte = ((uint64_t)cheat_value >= (uint64_t)comp_byte);
|
||||
disable_byte = (u64(cheat_value) >= u64(comp_byte));
|
||||
break;
|
||||
|
||||
case CHEAT_INCREASE:
|
||||
if (m_cheat.signed_cheat)
|
||||
disable_byte = ((int64_t)cheat_value <= (int64_t)comp_byte);
|
||||
disable_byte = (s64(cheat_value) <= s64(comp_byte));
|
||||
else
|
||||
disable_byte = ((uint64_t)cheat_value <= (uint64_t)comp_byte);
|
||||
disable_byte = (u64(cheat_value) <= u64(comp_byte));
|
||||
break;
|
||||
|
||||
case CHEAT_DECREASE_OR_EQUAL:
|
||||
if (m_cheat.signed_cheat)
|
||||
disable_byte = ((int64_t)cheat_value > (int64_t)comp_byte);
|
||||
disable_byte = (s64(cheat_value) > s64(comp_byte));
|
||||
else
|
||||
disable_byte = ((uint64_t)cheat_value > (uint64_t)comp_byte);
|
||||
disable_byte = (u64(cheat_value) > u64(comp_byte));
|
||||
break;
|
||||
|
||||
case CHEAT_INCREASE_OR_EQUAL:
|
||||
if (m_cheat.signed_cheat)
|
||||
disable_byte = ((int64_t)cheat_value < (int64_t)comp_byte);
|
||||
disable_byte = (s64(cheat_value) < s64(comp_byte));
|
||||
else
|
||||
disable_byte = ((uint64_t)cheat_value < (uint64_t)comp_byte);
|
||||
disable_byte = (u64(cheat_value) < u64(comp_byte));
|
||||
break;
|
||||
|
||||
case CHEAT_DECREASEOF:
|
||||
@ -2101,16 +2101,16 @@ void debugger_commands::execute_cheatnext(int ref, int params, const char *param
|
||||
|
||||
case CHEAT_SMALLEROF:
|
||||
if (m_cheat.signed_cheat)
|
||||
disable_byte = ((int64_t)cheat_value >= (int64_t)comp_value);
|
||||
disable_byte = (s64(cheat_value) >= s64(comp_value));
|
||||
else
|
||||
disable_byte = ((uint64_t)cheat_value >= (uint64_t)comp_value);
|
||||
disable_byte = (u64(cheat_value) >= u64(comp_value));
|
||||
break;
|
||||
|
||||
case CHEAT_GREATEROF:
|
||||
if (m_cheat.signed_cheat)
|
||||
disable_byte = ((int64_t)cheat_value <= (int64_t)comp_value);
|
||||
disable_byte = (s64(cheat_value) <= s64(comp_value));
|
||||
else
|
||||
disable_byte = ((uint64_t)cheat_value <= (uint64_t)comp_value);
|
||||
disable_byte = (u64(cheat_value) <= u64(comp_value));
|
||||
break;
|
||||
case CHEAT_CHANGEDBY:
|
||||
if (cheat_value > comp_byte)
|
||||
@ -2148,9 +2148,9 @@ void debugger_commands::execute_cheatlist(int ref, int params, const char *param
|
||||
char spaceletter, sizeletter;
|
||||
address_space *space;
|
||||
device_t *cpu;
|
||||
uint32_t active_cheat = 0;
|
||||
uint64_t cheatindex;
|
||||
uint64_t sizemask;
|
||||
u32 active_cheat = 0;
|
||||
u64 cheatindex;
|
||||
u64 sizemask;
|
||||
FILE *f = nullptr;
|
||||
|
||||
if (!validate_cpu_space_parameter(m_cheat.cpu, AS_PROGRAM, space))
|
||||
@ -2173,10 +2173,10 @@ void debugger_commands::execute_cheatlist(int ref, int params, const char *param
|
||||
switch (m_cheat.width)
|
||||
{
|
||||
default:
|
||||
case 1: sizeletter = 'b'; sizemask = 0xff; break;
|
||||
case 2: sizeletter = 'w'; sizemask = 0xffff; break;
|
||||
case 4: sizeletter = 'd'; sizemask = 0xffffffff; break;
|
||||
case 8: sizeletter = 'q'; sizemask = U64(0xffffffffffffffff); break;
|
||||
case 1: sizeletter = 'b'; sizemask = 0xffU; break;
|
||||
case 2: sizeletter = 'w'; sizemask = 0xffffU; break;
|
||||
case 4: sizeletter = 'd'; sizemask = 0xffffffffU; break;
|
||||
case 8: sizeletter = 'q'; sizemask = 0xffffffffffffffffU; break;
|
||||
}
|
||||
|
||||
/* write the cheat list */
|
||||
@ -2185,7 +2185,7 @@ void debugger_commands::execute_cheatlist(int ref, int params, const char *param
|
||||
{
|
||||
if (m_cheat.cheatmap[cheatindex].state == 1)
|
||||
{
|
||||
uint64_t value = cheat_byte_swap(&m_cheat, cheat_read_extended(&m_cheat, *space, m_cheat.cheatmap[cheatindex].offset)) & sizemask;
|
||||
u64 value = cheat_byte_swap(&m_cheat, cheat_read_extended(&m_cheat, *space, m_cheat.cheatmap[cheatindex].offset)) & sizemask;
|
||||
offs_t address = space->byte_to_address(m_cheat.cheatmap[cheatindex].offset);
|
||||
|
||||
if (params > 0)
|
||||
@ -2226,8 +2226,8 @@ void debugger_commands::execute_cheatlist(int ref, int params, const char *param
|
||||
|
||||
void debugger_commands::execute_cheatundo(int ref, int params, const char *param[])
|
||||
{
|
||||
uint64_t cheatindex;
|
||||
uint32_t undo_count = 0;
|
||||
u64 cheatindex;
|
||||
u32 undo_count = 0;
|
||||
|
||||
if (m_cheat.undo > 0)
|
||||
{
|
||||
@ -2255,10 +2255,10 @@ void debugger_commands::execute_cheatundo(int ref, int params, const char *param
|
||||
|
||||
void debugger_commands::execute_find(int ref, int params, const char *param[])
|
||||
{
|
||||
uint64_t offset, endoffset, length;
|
||||
u64 offset, endoffset, length;
|
||||
address_space *space;
|
||||
uint64_t data_to_find[256];
|
||||
uint8_t data_size[256];
|
||||
u64 data_to_find[256];
|
||||
u8 data_size[256];
|
||||
int cur_data_size;
|
||||
int data_count = 0;
|
||||
int found = 0;
|
||||
@ -2300,10 +2300,10 @@ void debugger_commands::execute_find(int ref, int params, const char *param[])
|
||||
{
|
||||
/* check for a 'b','w','d',or 'q' prefix */
|
||||
data_size[data_count] = cur_data_size;
|
||||
if (tolower((uint8_t)pdata[0]) == 'b' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 1; pdata += 2; }
|
||||
if (tolower((uint8_t)pdata[0]) == 'w' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 2; pdata += 2; }
|
||||
if (tolower((uint8_t)pdata[0]) == 'd' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 4; pdata += 2; }
|
||||
if (tolower((uint8_t)pdata[0]) == 'q' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 8; pdata += 2; }
|
||||
if (tolower(u8(pdata[0])) == 'b' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 1; pdata += 2; }
|
||||
if (tolower(u8(pdata[0])) == 'w' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 2; pdata += 2; }
|
||||
if (tolower(u8(pdata[0])) == 'd' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 4; pdata += 2; }
|
||||
if (tolower(u8(pdata[0])) == 'q' && pdata[1] == '.') { data_size[data_count] = cur_data_size = 8; pdata += 2; }
|
||||
|
||||
/* look for a wildcard */
|
||||
if (!strcmp(pdata, "?"))
|
||||
@ -2316,7 +2316,7 @@ void debugger_commands::execute_find(int ref, int params, const char *param[])
|
||||
}
|
||||
|
||||
/* now search */
|
||||
for (uint64_t i = offset; i <= endoffset; i += data_size[0])
|
||||
for (u64 i = offset; i <= endoffset; i += data_size[0])
|
||||
{
|
||||
int suboffset = 0;
|
||||
int match = 1;
|
||||
@ -2326,10 +2326,10 @@ void debugger_commands::execute_find(int ref, int params, const char *param[])
|
||||
{
|
||||
switch (data_size[j])
|
||||
{
|
||||
case 1: match = ((uint8_t)m_cpu.read_byte(*space, i + suboffset, true) == (uint8_t)data_to_find[j]); break;
|
||||
case 2: match = ((uint16_t)m_cpu.read_word(*space, i + suboffset, true) == (uint16_t)data_to_find[j]); break;
|
||||
case 4: match = ((uint32_t)m_cpu.read_dword(*space, i + suboffset, true) == (uint32_t)data_to_find[j]); break;
|
||||
case 8: match = ((uint64_t)m_cpu.read_qword(*space, i + suboffset, true) == (uint64_t)data_to_find[j]); break;
|
||||
case 1: match = (u8(m_cpu.read_byte(*space, i + suboffset, true)) == u8(data_to_find[j])); break;
|
||||
case 2: match = (u16(m_cpu.read_word(*space, i + suboffset, true)) == u16(data_to_find[j])); break;
|
||||
case 4: match = (u32(m_cpu.read_dword(*space, i + suboffset, true)) == u32(data_to_find[j])); break;
|
||||
case 8: match = (u64(m_cpu.read_qword(*space, i + suboffset, true)) == u64(data_to_find[j])); break;
|
||||
default: /* all other cases are wildcards */ break;
|
||||
}
|
||||
suboffset += data_size[j] & 0x0f;
|
||||
@ -2339,7 +2339,7 @@ void debugger_commands::execute_find(int ref, int params, const char *param[])
|
||||
if (match)
|
||||
{
|
||||
found++;
|
||||
m_console.printf("Found at %0*X\n", space->addrchars(), (uint32_t)space->byte_to_address(i));
|
||||
m_console.printf("Found at %0*X\n", space->addrchars(), u32(space->byte_to_address(i)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2355,7 +2355,7 @@ void debugger_commands::execute_find(int ref, int params, const char *param[])
|
||||
|
||||
void debugger_commands::execute_dasm(int ref, int params, const char *param[])
|
||||
{
|
||||
uint64_t offset, length, bytes = 1;
|
||||
u64 offset, length, bytes = 1;
|
||||
int minbytes, maxbytes, byteswidth;
|
||||
address_space *space, *decrypted_space;
|
||||
FILE *f;
|
||||
@ -2402,7 +2402,7 @@ void debugger_commands::execute_dasm(int ref, int params, const char *param[])
|
||||
/* now write the data out */
|
||||
util::ovectorstream output;
|
||||
output.reserve(512);
|
||||
for (uint64_t i = 0; i < length; )
|
||||
for (u64 i = 0; i < length; )
|
||||
{
|
||||
int pcbyte = space->address_to_byte(offset + i) & space->bytemask();
|
||||
char disasm[200];
|
||||
@ -2413,13 +2413,13 @@ void debugger_commands::execute_dasm(int ref, int params, const char *param[])
|
||||
output.rdbuf()->clear();
|
||||
|
||||
/* print the address */
|
||||
stream_format(output, "%0*X: ", space->logaddrchars(), (uint32_t)space->byte_to_address(pcbyte));
|
||||
stream_format(output, "%0*X: ", space->logaddrchars(), u32(space->byte_to_address(pcbyte)));
|
||||
|
||||
/* make sure we can translate the address */
|
||||
tempaddr = pcbyte;
|
||||
if (space->device().memory().translate(space->spacenum(), TRANSLATE_FETCH_DEBUG, tempaddr))
|
||||
{
|
||||
uint8_t opbuf[64], argbuf[64];
|
||||
u8 opbuf[64], argbuf[64];
|
||||
|
||||
/* fetch the bytes up to the maximum */
|
||||
for (numbytes = 0; numbytes < maxbytes; numbytes++)
|
||||
@ -2573,7 +2573,7 @@ void debugger_commands::execute_history(int ref, int params, const char *param[]
|
||||
else
|
||||
decrypted_space = space;
|
||||
|
||||
uint64_t count = device_debug::HISTORY_SIZE;
|
||||
u64 count = device_debug::HISTORY_SIZE;
|
||||
if (!validate_number_parameter(param[1], &count))
|
||||
return;
|
||||
|
||||
@ -2597,7 +2597,7 @@ void debugger_commands::execute_history(int ref, int params, const char *param[]
|
||||
|
||||
/* fetch the bytes up to the maximum */
|
||||
offs_t pcbyte = space->address_to_byte(pc) & space->bytemask();
|
||||
uint8_t opbuf[64], argbuf[64];
|
||||
u8 opbuf[64], argbuf[64];
|
||||
for (int numbytes = 0; numbytes < maxbytes; numbytes++)
|
||||
{
|
||||
opbuf[numbytes] = m_cpu.read_opcode(*decrypted_space, pcbyte + numbytes, 1);
|
||||
@ -2619,7 +2619,7 @@ void debugger_commands::execute_history(int ref, int params, const char *param[]
|
||||
void debugger_commands::execute_trackpc(int ref, int params, const char *param[])
|
||||
{
|
||||
// Gather the on/off switch (if present)
|
||||
uint64_t turnOn = true;
|
||||
u64 turnOn = true;
|
||||
if (!validate_number_parameter(param[0], &turnOn))
|
||||
return;
|
||||
|
||||
@ -2629,7 +2629,7 @@ void debugger_commands::execute_trackpc(int ref, int params, const char *param[]
|
||||
return;
|
||||
|
||||
// Should we clear the existing data?
|
||||
uint64_t clear = false;
|
||||
u64 clear = false;
|
||||
if (!validate_number_parameter(param[2], &clear))
|
||||
return;
|
||||
|
||||
@ -2661,7 +2661,7 @@ void debugger_commands::execute_trackpc(int ref, int params, const char *param[]
|
||||
void debugger_commands::execute_trackmem(int ref, int params, const char *param[])
|
||||
{
|
||||
// Gather the on/off switch (if present)
|
||||
uint64_t turnOn = true;
|
||||
u64 turnOn = true;
|
||||
if (!validate_number_parameter(param[0], &turnOn))
|
||||
return;
|
||||
|
||||
@ -2671,7 +2671,7 @@ void debugger_commands::execute_trackmem(int ref, int params, const char *param[
|
||||
return;
|
||||
|
||||
// Should we clear the existing data?
|
||||
uint64_t clear = false;
|
||||
u64 clear = false;
|
||||
if (!validate_number_parameter(param[2], &clear))
|
||||
return;
|
||||
|
||||
@ -2699,7 +2699,7 @@ void debugger_commands::execute_trackmem(int ref, int params, const char *param[
|
||||
void debugger_commands::execute_pcatmem(int ref, int params, const char *param[])
|
||||
{
|
||||
// Gather the required address parameter
|
||||
uint64_t address;
|
||||
u64 address;
|
||||
if (!validate_number_parameter(param[0], &address))
|
||||
return;
|
||||
|
||||
@ -2715,7 +2715,7 @@ void debugger_commands::execute_pcatmem(int ref, int params, const char *param[]
|
||||
|
||||
// Get the value of memory at the address
|
||||
const int native_data_width = space->data_width() / 8;
|
||||
const uint64_t data = m_cpu.read_memory(*space, space->address_to_byte(address), native_data_width, true);
|
||||
const u64 data = m_cpu.read_memory(*space, space->address_to_byte(address), native_data_width, true);
|
||||
|
||||
// Recover the pc & print
|
||||
const address_spacenum space_num = (address_spacenum)ref;
|
||||
@ -2791,7 +2791,7 @@ void debugger_commands::execute_map(int ref, int params, const char *param[])
|
||||
{
|
||||
address_space *space;
|
||||
offs_t taddress;
|
||||
uint64_t address;
|
||||
u64 address;
|
||||
int intention;
|
||||
|
||||
/* validate parameters */
|
||||
@ -2899,7 +2899,7 @@ void debugger_commands::execute_symlist(int ref, int params, const char **param)
|
||||
{
|
||||
const symbol_entry *entry = symtable->find(namelist[symnum]);
|
||||
assert(entry != nullptr);
|
||||
uint64_t value = entry->value();
|
||||
u64 value = entry->value();
|
||||
|
||||
/* only display "register" type symbols */
|
||||
m_console.printf("%s = %X", namelist[symnum], value);
|
||||
|
@ -8,10 +8,10 @@
|
||||
|
||||
*********************************************************************/
|
||||
|
||||
#pragma once
|
||||
#ifndef MAME_EMU_DEBUG_DEBUGCMD_H
|
||||
#define MAME_EMU_DEBUG_DEBUGCMD_H
|
||||
|
||||
#ifndef __DEBUGCMD_H__
|
||||
#define __DEBUGCMD_H__
|
||||
#pragma once
|
||||
|
||||
#include "emu.h"
|
||||
#include "debugcpu.h"
|
||||
@ -29,7 +29,7 @@ public:
|
||||
bool validate_boolean_parameter(const char *param, bool *result);
|
||||
|
||||
/* validates a parameter as a numeric value */
|
||||
bool validate_number_parameter(const char *param, uint64_t *result);
|
||||
bool validate_number_parameter(const char *param, u64 *result);
|
||||
|
||||
/* validates a parameter as a cpu */
|
||||
bool validate_cpu_parameter(const char *param, device_t **result);
|
||||
@ -41,55 +41,55 @@ private:
|
||||
struct global_entry
|
||||
{
|
||||
void * base;
|
||||
uint32_t size;
|
||||
u32 size;
|
||||
};
|
||||
|
||||
|
||||
struct cheat_map
|
||||
{
|
||||
uint64_t offset;
|
||||
uint64_t first_value;
|
||||
uint64_t previous_value;
|
||||
uint8_t state:1;
|
||||
uint8_t undo:7;
|
||||
u64 offset;
|
||||
u64 first_value;
|
||||
u64 previous_value;
|
||||
u8 state:1;
|
||||
u8 undo:7;
|
||||
};
|
||||
|
||||
// TODO [RH 31 May 2016]: Move this cheat stuff into its own class
|
||||
struct cheat_system
|
||||
{
|
||||
char cpu[2];
|
||||
uint8_t width;
|
||||
u8 width;
|
||||
std::vector<cheat_map> cheatmap;
|
||||
uint8_t undo;
|
||||
uint8_t signed_cheat;
|
||||
uint8_t swapped_cheat;
|
||||
u8 undo;
|
||||
u8 signed_cheat;
|
||||
u8 swapped_cheat;
|
||||
};
|
||||
|
||||
|
||||
struct cheat_region_map
|
||||
{
|
||||
uint64_t offset;
|
||||
uint64_t endoffset;
|
||||
u64 offset;
|
||||
u64 endoffset;
|
||||
const char *share;
|
||||
uint8_t disabled;
|
||||
u8 disabled;
|
||||
};
|
||||
|
||||
bool debug_command_parameter_expression(const char *param, parsed_expression &result);
|
||||
bool debug_command_parameter_command(const char *param);
|
||||
|
||||
bool cheat_address_is_valid(address_space &space, offs_t address);
|
||||
uint64_t cheat_sign_extend(const cheat_system *cheatsys, uint64_t value);
|
||||
uint64_t cheat_byte_swap(const cheat_system *cheatsys, uint64_t value);
|
||||
uint64_t cheat_read_extended(const cheat_system *cheatsys, address_space &space, offs_t address);
|
||||
u64 cheat_sign_extend(const cheat_system *cheatsys, u64 value);
|
||||
u64 cheat_byte_swap(const cheat_system *cheatsys, u64 value);
|
||||
u64 cheat_read_extended(const cheat_system *cheatsys, address_space &space, offs_t address);
|
||||
|
||||
uint64_t execute_min(symbol_table &table, void *ref, int params, const uint64_t *param);
|
||||
uint64_t execute_max(symbol_table &table, void *ref, int params, const uint64_t *param);
|
||||
uint64_t execute_if(symbol_table &table, void *ref, int params, const uint64_t *param);
|
||||
u64 execute_min(symbol_table &table, void *ref, int params, const u64 *param);
|
||||
u64 execute_max(symbol_table &table, void *ref, int params, const u64 *param);
|
||||
u64 execute_if(symbol_table &table, void *ref, int params, const u64 *param);
|
||||
|
||||
uint64_t global_get(symbol_table &table, void *ref);
|
||||
void global_set(symbol_table &table, void *ref, uint64_t value);
|
||||
u64 global_get(symbol_table &table, void *ref);
|
||||
void global_set(symbol_table &table, void *ref, u64 value);
|
||||
|
||||
int mini_printf(char *buffer, const char *format, int params, uint64_t *param);
|
||||
int mini_printf(char *buffer, const char *format, int params, u64 *param);
|
||||
|
||||
void execute_trace_internal(int ref, int params, const char *param[], bool trace_over);
|
||||
|
||||
@ -161,8 +161,8 @@ private:
|
||||
void execute_dumpkbd(int ref, int params, const char **param);
|
||||
|
||||
running_machine& m_machine;
|
||||
debugger_cpu& m_cpu;
|
||||
debugger_console& m_console;
|
||||
debugger_cpu& m_cpu;
|
||||
debugger_console& m_console;
|
||||
|
||||
global_entry *m_global_array;
|
||||
cheat_system m_cheat;
|
||||
@ -170,4 +170,4 @@ private:
|
||||
static const size_t MAX_GLOBALS;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // MAME_EMU_DEBUG_DEBUGCMD_H
|
||||
|
@ -165,12 +165,12 @@ CMDERR debugger_console::internal_execute_command(bool execute, int params, char
|
||||
return CMDERR_NONE;
|
||||
|
||||
/* the first parameter has the command and the real first parameter; separate them */
|
||||
for (p = param[0]; *p && isspace((uint8_t)*p); p++) { }
|
||||
for (command = p; *p && !isspace((uint8_t)*p); p++) { }
|
||||
for (p = param[0]; *p && isspace(u8(*p)); p++) { }
|
||||
for (command = p; *p && !isspace(u8(*p)); p++) { }
|
||||
if (*p != 0)
|
||||
{
|
||||
*p++ = 0;
|
||||
for ( ; *p && isspace((uint8_t)*p); p++) { }
|
||||
for ( ; *p && isspace(u8(*p)); p++) { }
|
||||
if (*p != 0)
|
||||
param[0] = p;
|
||||
else
|
||||
@ -271,7 +271,7 @@ CMDERR debugger_console::internal_parse_command(const char *original_command, bo
|
||||
case '+': if (parendex == 0 && paramcount == 1 && p[1] == '+') isexpr = true; *p = c; break;
|
||||
case '=': if (parendex == 0 && paramcount == 1) isexpr = true; *p = c; break;
|
||||
case 0: foundend = true; break;
|
||||
default: *p = tolower((uint8_t)c); break;
|
||||
default: *p = tolower(u8(c)); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -290,7 +290,7 @@ CMDERR debugger_console::internal_parse_command(const char *original_command, bo
|
||||
command_start = params[0];
|
||||
|
||||
/* allow for "do" commands */
|
||||
if (tolower((uint8_t)command_start[0] == 'd') && tolower((uint8_t)command_start[1] == 'o') && isspace((uint8_t)command_start[2]))
|
||||
if (tolower(u8(command_start[0])) == 'd' && tolower(u8(command_start[1])) == 'o' && isspace(u8(command_start[2])))
|
||||
{
|
||||
isexpr = true;
|
||||
command_start += 3;
|
||||
@ -301,7 +301,7 @@ CMDERR debugger_console::internal_parse_command(const char *original_command, bo
|
||||
{
|
||||
try
|
||||
{
|
||||
uint64_t expresult;
|
||||
u64 expresult;
|
||||
parsed_expression expression(m_machine.debugger().cpu().get_visible_symtable(), command_start, &expresult);
|
||||
}
|
||||
catch (expression_error &err)
|
||||
@ -368,7 +368,7 @@ CMDERR debugger_console::validate_command(const char *command)
|
||||
register_command - register a command handler
|
||||
-------------------------------------------------*/
|
||||
|
||||
void debugger_console::register_command(const char *command, uint32_t flags, int ref, int minparams, int maxparams, std::function<void(int, int, const char **)> handler)
|
||||
void debugger_console::register_command(const char *command, u32 flags, int ref, int minparams, int maxparams, std::function<void(int, int, const char **)> handler)
|
||||
{
|
||||
assert_always(m_machine.phase() == MACHINE_PHASE_INIT, "Can only call register_command() at init time!");
|
||||
assert_always((m_machine.debug_flags & DEBUG_FLAG_ENABLED) != 0, "Cannot call register_command() when debugger is not running");
|
||||
|
@ -67,7 +67,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/* CMDERR is an error code for command evaluation */
|
||||
typedef uint32_t CMDERR;
|
||||
typedef u32 CMDERR;
|
||||
|
||||
class debugger_console
|
||||
{
|
||||
@ -77,7 +77,7 @@ public:
|
||||
/* command handling */
|
||||
CMDERR execute_command(const char *command, bool echo);
|
||||
CMDERR validate_command(const char *command);
|
||||
void register_command(const char *command, uint32_t flags, int ref, int minparams, int maxparams, std::function<void(int, int, const char **)> handler);
|
||||
void register_command(const char *command, u32 flags, int ref, int minparams, int maxparams, std::function<void(int, int, const char **)> handler);
|
||||
|
||||
/* console management */
|
||||
void vprintf(util::format_argument_pack<std::ostream> const &args);
|
||||
@ -118,7 +118,7 @@ private:
|
||||
const char * params;
|
||||
const char * help;
|
||||
std::function<void(int, int, const char **)> handler;
|
||||
uint32_t flags;
|
||||
u32 flags;
|
||||
int ref;
|
||||
int minparams;
|
||||
int maxparams;
|
||||
|
@ -52,7 +52,7 @@ debugger_cpu::debugger_cpu(running_machine &machine)
|
||||
{
|
||||
screen_device *first_screen = m_machine.first_screen();
|
||||
|
||||
m_tempvar = make_unique_clear<uint64_t[]>(NUM_TEMP_VARIABLES);
|
||||
m_tempvar = make_unique_clear<u64[]>(NUM_TEMP_VARIABLES);
|
||||
|
||||
/* create a global symbol table */
|
||||
m_symtable = std::make_unique<symbol_table>(&m_machine);
|
||||
@ -357,7 +357,7 @@ bool debugger_cpu::comment_load(bool is_inline)
|
||||
memory space
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint8_t debugger_cpu::read_byte(address_space &space, offs_t address, bool apply_translation)
|
||||
u8 debugger_cpu::read_byte(address_space &space, offs_t address, bool apply_translation)
|
||||
{
|
||||
device_memory_interface &memory = space.device().memory();
|
||||
|
||||
@ -369,8 +369,8 @@ uint8_t debugger_cpu::read_byte(address_space &space, offs_t address, bool apply
|
||||
space.set_debugger_access(true);
|
||||
|
||||
/* translate if necessary; if not mapped, return 0xff */
|
||||
uint64_t custom;
|
||||
uint8_t result;
|
||||
u64 custom;
|
||||
u8 result;
|
||||
if (apply_translation && !memory.translate(space.spacenum(), TRANSLATE_READ_DEBUG, address))
|
||||
{
|
||||
result = 0xff;
|
||||
@ -396,16 +396,16 @@ uint8_t debugger_cpu::read_byte(address_space &space, offs_t address, bool apply
|
||||
memory space
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint16_t debugger_cpu::read_word(address_space &space, offs_t address, bool apply_translation)
|
||||
u16 debugger_cpu::read_word(address_space &space, offs_t address, bool apply_translation)
|
||||
{
|
||||
/* mask against the logical byte mask */
|
||||
address &= space.logbytemask();
|
||||
|
||||
uint16_t result;
|
||||
u16 result;
|
||||
if (!WORD_ALIGNED(address))
|
||||
{ /* if this is misaligned read, or if there are no word readers, just read two bytes */
|
||||
uint8_t byte0 = read_byte(space, address + 0, apply_translation);
|
||||
uint8_t byte1 = read_byte(space, address + 1, apply_translation);
|
||||
u8 byte0 = read_byte(space, address + 0, apply_translation);
|
||||
u8 byte1 = read_byte(space, address + 1, apply_translation);
|
||||
|
||||
/* based on the endianness, the result is assembled differently */
|
||||
if (space.endianness() == ENDIANNESS_LITTLE)
|
||||
@ -422,7 +422,7 @@ uint16_t debugger_cpu::read_word(address_space &space, offs_t address, bool appl
|
||||
space.set_debugger_access(true);
|
||||
|
||||
/* translate if necessary; if not mapped, return 0xffff */
|
||||
uint64_t custom;
|
||||
u64 custom;
|
||||
if (apply_translation && !memory.translate(space.spacenum(), TRANSLATE_READ_DEBUG, address))
|
||||
{
|
||||
result = 0xffff;
|
||||
@ -450,16 +450,16 @@ uint16_t debugger_cpu::read_word(address_space &space, offs_t address, bool appl
|
||||
memory space
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint32_t debugger_cpu::read_dword(address_space &space, offs_t address, bool apply_translation)
|
||||
u32 debugger_cpu::read_dword(address_space &space, offs_t address, bool apply_translation)
|
||||
{
|
||||
/* mask against the logical byte mask */
|
||||
address &= space.logbytemask();
|
||||
|
||||
uint32_t result;
|
||||
u32 result;
|
||||
if (!DWORD_ALIGNED(address))
|
||||
{ /* if this is a misaligned read, or if there are no dword readers, just read two words */
|
||||
uint16_t word0 = read_word(space, address + 0, apply_translation);
|
||||
uint16_t word1 = read_word(space, address + 2, apply_translation);
|
||||
u16 word0 = read_word(space, address + 0, apply_translation);
|
||||
u16 word1 = read_word(space, address + 2, apply_translation);
|
||||
|
||||
/* based on the endianness, the result is assembled differently */
|
||||
if (space.endianness() == ENDIANNESS_LITTLE)
|
||||
@ -475,7 +475,7 @@ uint32_t debugger_cpu::read_dword(address_space &space, offs_t address, bool app
|
||||
m_debugger_access = true;
|
||||
space.set_debugger_access(true);
|
||||
|
||||
uint64_t custom;
|
||||
u64 custom;
|
||||
if (apply_translation && !memory.translate(space.spacenum(), TRANSLATE_READ_DEBUG, address))
|
||||
{ /* translate if necessary; if not mapped, return 0xffffffff */
|
||||
result = 0xffffffff;
|
||||
@ -503,22 +503,22 @@ uint32_t debugger_cpu::read_dword(address_space &space, offs_t address, bool app
|
||||
memory space
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint64_t debugger_cpu::read_qword(address_space &space, offs_t address, bool apply_translation)
|
||||
u64 debugger_cpu::read_qword(address_space &space, offs_t address, bool apply_translation)
|
||||
{
|
||||
/* mask against the logical byte mask */
|
||||
address &= space.logbytemask();
|
||||
|
||||
uint64_t result;
|
||||
u64 result;
|
||||
if (!QWORD_ALIGNED(address))
|
||||
{ /* if this is a misaligned read, or if there are no qword readers, just read two dwords */
|
||||
uint32_t dword0 = read_dword(space, address + 0, apply_translation);
|
||||
uint32_t dword1 = read_dword(space, address + 4, apply_translation);
|
||||
u32 dword0 = read_dword(space, address + 0, apply_translation);
|
||||
u32 dword1 = read_dword(space, address + 4, apply_translation);
|
||||
|
||||
/* based on the endianness, the result is assembled differently */
|
||||
if (space.endianness() == ENDIANNESS_LITTLE)
|
||||
result = dword0 | ((uint64_t)dword1 << 32);
|
||||
result = dword0 | (u64(dword1) << 32);
|
||||
else
|
||||
result = dword1 | ((uint64_t)dword0 << 32);
|
||||
result = dword1 | (u64(dword0) << 32);
|
||||
}
|
||||
else
|
||||
{ /* otherwise, this proceeds like the byte case */
|
||||
@ -529,10 +529,10 @@ uint64_t debugger_cpu::read_qword(address_space &space, offs_t address, bool app
|
||||
space.set_debugger_access(true);
|
||||
|
||||
/* translate if necessary; if not mapped, return 0xffffffffffffffff */
|
||||
uint64_t custom;
|
||||
u64 custom;
|
||||
if (apply_translation && !memory.translate(space.spacenum(), TRANSLATE_READ_DEBUG, address))
|
||||
{
|
||||
result = ~(uint64_t)0;
|
||||
result = ~u64(0);
|
||||
}
|
||||
else if (memory.read(space.spacenum(), address, 8, custom))
|
||||
{ /* if there is a custom read handler, and it returns true, use that value */
|
||||
@ -557,9 +557,9 @@ uint64_t debugger_cpu::read_qword(address_space &space, offs_t address, bool app
|
||||
from the specified memory space
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint64_t debugger_cpu::read_memory(address_space &space, offs_t address, int size, bool apply_translation)
|
||||
u64 debugger_cpu::read_memory(address_space &space, offs_t address, int size, bool apply_translation)
|
||||
{
|
||||
uint64_t result = ~(uint64_t)0 >> (64 - 8*size);
|
||||
u64 result = ~u64(0) >> (64 - 8*size);
|
||||
switch (size)
|
||||
{
|
||||
case 1: result = read_byte(space, address, apply_translation); break;
|
||||
@ -576,7 +576,7 @@ uint64_t debugger_cpu::read_memory(address_space &space, offs_t address, int siz
|
||||
memory space
|
||||
-------------------------------------------------*/
|
||||
|
||||
void debugger_cpu::write_byte(address_space &space, offs_t address, uint8_t data, bool apply_translation)
|
||||
void debugger_cpu::write_byte(address_space &space, offs_t address, u8 data, bool apply_translation)
|
||||
{
|
||||
device_memory_interface &memory = space.device().memory();
|
||||
|
||||
@ -612,7 +612,7 @@ void debugger_cpu::write_byte(address_space &space, offs_t address, uint8_t data
|
||||
memory space
|
||||
-------------------------------------------------*/
|
||||
|
||||
void debugger_cpu::write_word(address_space &space, offs_t address, uint16_t data, bool apply_translation)
|
||||
void debugger_cpu::write_word(address_space &space, offs_t address, u16 data, bool apply_translation)
|
||||
{
|
||||
/* mask against the logical byte mask */
|
||||
address &= space.logbytemask();
|
||||
@ -667,7 +667,7 @@ void debugger_cpu::write_word(address_space &space, offs_t address, uint16_t dat
|
||||
memory space
|
||||
-------------------------------------------------*/
|
||||
|
||||
void debugger_cpu::write_dword(address_space &space, offs_t address, uint32_t data, bool apply_translation)
|
||||
void debugger_cpu::write_dword(address_space &space, offs_t address, u32 data, bool apply_translation)
|
||||
{
|
||||
/* mask against the logical byte mask */
|
||||
address &= space.logbytemask();
|
||||
@ -721,7 +721,7 @@ void debugger_cpu::write_dword(address_space &space, offs_t address, uint32_t da
|
||||
memory space
|
||||
-------------------------------------------------*/
|
||||
|
||||
void debugger_cpu::write_qword(address_space &space, offs_t address, uint64_t data, bool apply_translation)
|
||||
void debugger_cpu::write_qword(address_space &space, offs_t address, u64 data, bool apply_translation)
|
||||
{
|
||||
/* mask against the logical byte mask */
|
||||
address &= space.logbytemask();
|
||||
@ -776,7 +776,7 @@ void debugger_cpu::write_qword(address_space &space, offs_t address, uint64_t da
|
||||
specified memory space
|
||||
-------------------------------------------------*/
|
||||
|
||||
void debugger_cpu::write_memory(address_space &space, offs_t address, uint64_t data, int size, bool apply_translation)
|
||||
void debugger_cpu::write_memory(address_space &space, offs_t address, u64 data, int size, bool apply_translation)
|
||||
{
|
||||
switch (size)
|
||||
{
|
||||
@ -793,11 +793,11 @@ void debugger_cpu::write_memory(address_space &space, offs_t address, uint64_t d
|
||||
given offset from opcode space
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint64_t debugger_cpu::read_opcode(address_space &space, offs_t address, int size)
|
||||
u64 debugger_cpu::read_opcode(address_space &space, offs_t address, int size)
|
||||
{
|
||||
device_memory_interface &memory = space.device().memory();
|
||||
|
||||
uint64_t result = ~(uint64_t)0 & (~(uint64_t)0 >> (64 - 8*size)), result2;
|
||||
u64 result = ~u64(0) & (~u64(0) >> (64 - 8*size)), result2;
|
||||
|
||||
/* keep in logical range */
|
||||
address &= space.logbytemask();
|
||||
@ -816,8 +816,8 @@ uint64_t debugger_cpu::read_opcode(address_space &space, offs_t address, int siz
|
||||
if (size > space.data_width() / 8)
|
||||
{
|
||||
int halfsize = size / 2;
|
||||
uint64_t r0 = read_opcode(space, address + 0, halfsize);
|
||||
uint64_t r1 = read_opcode(space, address + halfsize, halfsize);
|
||||
u64 r0 = read_opcode(space, address + 0, halfsize);
|
||||
u64 r1 = read_opcode(space, address + halfsize, halfsize);
|
||||
|
||||
if (space.endianness() == ENDIANNESS_LITTLE)
|
||||
return r0 | (r1 << (8 * halfsize));
|
||||
@ -1005,7 +1005,7 @@ void debugger_cpu::process_source_file()
|
||||
|
||||
/* strip whitespace */
|
||||
int i = (int)strlen(buf);
|
||||
while((i > 0) && (isspace((uint8_t)buf[i-1])))
|
||||
while((i > 0) && (isspace(u8(buf[i-1]))))
|
||||
buf[--i] = '\0';
|
||||
|
||||
/* execute the command */
|
||||
@ -1040,7 +1040,7 @@ device_t* debugger_cpu::expression_get_device(const char *tag)
|
||||
space
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint64_t debugger_cpu::expression_read_memory(void *param, const char *name, expression_space spacenum, uint32_t address, int size)
|
||||
u64 debugger_cpu::expression_read_memory(void *param, const char *name, expression_space spacenum, u32 address, int size)
|
||||
{
|
||||
switch (spacenum)
|
||||
{
|
||||
@ -1126,9 +1126,9 @@ uint64_t debugger_cpu::expression_read_memory(void *param, const char *name, exp
|
||||
directly from an opcode or RAM pointer
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint64_t debugger_cpu::expression_read_program_direct(address_space &space, int opcode, offs_t address, int size)
|
||||
u64 debugger_cpu::expression_read_program_direct(address_space &space, int opcode, offs_t address, int size)
|
||||
{
|
||||
uint8_t *base;
|
||||
u8 *base;
|
||||
|
||||
/* adjust the address into a byte address, but not if being called recursively */
|
||||
if ((opcode & 2) == 0)
|
||||
@ -1140,8 +1140,8 @@ uint64_t debugger_cpu::expression_read_program_direct(address_space &space, int
|
||||
int halfsize = size / 2;
|
||||
|
||||
/* read each half, from lower address to upper address */
|
||||
uint64_t r0 = expression_read_program_direct(space, opcode | 2, address + 0, halfsize);
|
||||
uint64_t r1 = expression_read_program_direct(space, opcode | 2, address + halfsize, halfsize);
|
||||
u64 r0 = expression_read_program_direct(space, opcode | 2, address + 0, halfsize);
|
||||
u64 r1 = expression_read_program_direct(space, opcode | 2, address + halfsize, halfsize);
|
||||
|
||||
/* assemble based on the target endianness */
|
||||
if (space.endianness() == ENDIANNESS_LITTLE)
|
||||
@ -1157,7 +1157,7 @@ uint64_t debugger_cpu::expression_read_program_direct(address_space &space, int
|
||||
offs_t lowmask = space.data_width() / 8 - 1;
|
||||
|
||||
/* get the base of memory, aligned to the address minus the lowbits */
|
||||
base = (uint8_t *)space.get_read_ptr(address & ~lowmask);
|
||||
base = (u8 *)space.get_read_ptr(address & ~lowmask);
|
||||
|
||||
/* if we have a valid base, return the appropriate byte */
|
||||
if (base != nullptr)
|
||||
@ -1178,10 +1178,10 @@ uint64_t debugger_cpu::expression_read_program_direct(address_space &space, int
|
||||
from a memory region
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint64_t debugger_cpu::expression_read_memory_region(const char *rgntag, offs_t address, int size)
|
||||
u64 debugger_cpu::expression_read_memory_region(const char *rgntag, offs_t address, int size)
|
||||
{
|
||||
memory_region *region = m_machine.root_device().memregion(rgntag);
|
||||
uint64_t result = ~(uint64_t)0 >> (64 - 8*size);
|
||||
u64 result = ~u64(0) >> (64 - 8*size);
|
||||
|
||||
/* make sure we get a valid base before proceeding */
|
||||
if (region != nullptr)
|
||||
@ -1190,7 +1190,7 @@ uint64_t debugger_cpu::expression_read_memory_region(const char *rgntag, offs_t
|
||||
if (size > 1)
|
||||
{
|
||||
int halfsize = size / 2;
|
||||
uint64_t r0, r1;
|
||||
u64 r0, r1;
|
||||
|
||||
/* read each half, from lower address to upper address */
|
||||
r0 = expression_read_memory_region(rgntag, address + 0, halfsize);
|
||||
@ -1207,8 +1207,8 @@ uint64_t debugger_cpu::expression_read_memory_region(const char *rgntag, offs_t
|
||||
else if (address < region->bytes())
|
||||
{
|
||||
/* lowmask specified which address bits are within the databus width */
|
||||
uint32_t lowmask = region->bytewidth() - 1;
|
||||
uint8_t *base = region->base() + (address & ~lowmask);
|
||||
u32 lowmask = region->bytewidth() - 1;
|
||||
u8 *base = region->base() + (address & ~lowmask);
|
||||
|
||||
/* if we have a valid base, return the appropriate byte */
|
||||
if (region->endianness() == ENDIANNESS_LITTLE)
|
||||
@ -1227,7 +1227,7 @@ uint64_t debugger_cpu::expression_read_memory_region(const char *rgntag, offs_t
|
||||
space
|
||||
-------------------------------------------------*/
|
||||
|
||||
void debugger_cpu::expression_write_memory(void *param, const char *name, expression_space spacenum, uint32_t address, int size, uint64_t data)
|
||||
void debugger_cpu::expression_write_memory(void *param, const char *name, expression_space spacenum, u32 address, int size, u64 data)
|
||||
{
|
||||
device_t *device = nullptr;
|
||||
device_memory_interface *memory;
|
||||
@ -1299,7 +1299,7 @@ void debugger_cpu::expression_write_memory(void *param, const char *name, expres
|
||||
directly to an opcode or RAM pointer
|
||||
-------------------------------------------------*/
|
||||
|
||||
void debugger_cpu::expression_write_program_direct(address_space &space, int opcode, offs_t address, int size, uint64_t data)
|
||||
void debugger_cpu::expression_write_program_direct(address_space &space, int opcode, offs_t address, int size, u64 data)
|
||||
{
|
||||
/* adjust the address into a byte address, but not if being called recursively */
|
||||
if ((opcode & 2) == 0)
|
||||
@ -1311,8 +1311,8 @@ void debugger_cpu::expression_write_program_direct(address_space &space, int opc
|
||||
int halfsize = size / 2;
|
||||
|
||||
/* break apart based on the target endianness */
|
||||
uint64_t halfmask = ~(uint64_t)0 >> (64 - 8 * halfsize);
|
||||
uint64_t r0, r1;
|
||||
u64 halfmask = ~u64(0) >> (64 - 8 * halfsize);
|
||||
u64 r0, r1;
|
||||
if (space.endianness() == ENDIANNESS_LITTLE)
|
||||
{
|
||||
r0 = data & halfmask;
|
||||
@ -1336,7 +1336,7 @@ void debugger_cpu::expression_write_program_direct(address_space &space, int opc
|
||||
offs_t lowmask = space.data_width() / 8 - 1;
|
||||
|
||||
/* get the base of memory, aligned to the address minus the lowbits */
|
||||
uint8_t *base = (uint8_t *)space.get_read_ptr(address & ~lowmask);
|
||||
u8 *base = (u8 *)space.get_read_ptr(address & ~lowmask);
|
||||
|
||||
/* if we have a valid base, write the appropriate byte */
|
||||
if (base != nullptr)
|
||||
@ -1356,7 +1356,7 @@ void debugger_cpu::expression_write_program_direct(address_space &space, int opc
|
||||
from a memory region
|
||||
-------------------------------------------------*/
|
||||
|
||||
void debugger_cpu::expression_write_memory_region(const char *rgntag, offs_t address, int size, uint64_t data)
|
||||
void debugger_cpu::expression_write_memory_region(const char *rgntag, offs_t address, int size, u64 data)
|
||||
{
|
||||
memory_region *region = m_machine.root_device().memregion(rgntag);
|
||||
|
||||
@ -1369,8 +1369,8 @@ void debugger_cpu::expression_write_memory_region(const char *rgntag, offs_t add
|
||||
int halfsize = size / 2;
|
||||
|
||||
/* break apart based on the target endianness */
|
||||
uint64_t halfmask = ~(uint64_t)0 >> (64 - 8 * halfsize);
|
||||
uint64_t r0, r1;
|
||||
u64 halfmask = ~u64(0) >> (64 - 8 * halfsize);
|
||||
u64 r0, r1;
|
||||
if (region->endianness() == ENDIANNESS_LITTLE)
|
||||
{
|
||||
r0 = data & halfmask;
|
||||
@ -1391,8 +1391,8 @@ void debugger_cpu::expression_write_memory_region(const char *rgntag, offs_t add
|
||||
else if (address < region->bytes())
|
||||
{
|
||||
/* lowmask specified which address bits are within the databus width */
|
||||
uint32_t lowmask = region->bytewidth() - 1;
|
||||
uint8_t *base = region->base() + (address & ~lowmask);
|
||||
u32 lowmask = region->bytewidth() - 1;
|
||||
u8 *base = region->base() + (address & ~lowmask);
|
||||
|
||||
/* if we have a valid base, set the appropriate byte */
|
||||
if (region->endianness() == ENDIANNESS_LITTLE)
|
||||
@ -1491,7 +1491,7 @@ expression_error::error_code debugger_cpu::expression_validate(void *param, cons
|
||||
get_beamx - get beam horizontal position
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint64_t debugger_cpu::get_beamx(symbol_table &table, void *ref)
|
||||
u64 debugger_cpu::get_beamx(symbol_table &table, void *ref)
|
||||
{
|
||||
screen_device *screen = reinterpret_cast<screen_device *>(ref);
|
||||
return (screen != nullptr) ? screen->hpos() : 0;
|
||||
@ -1502,7 +1502,7 @@ uint64_t debugger_cpu::get_beamx(symbol_table &table, void *ref)
|
||||
get_beamy - get beam vertical position
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint64_t debugger_cpu::get_beamy(symbol_table &table, void *ref)
|
||||
u64 debugger_cpu::get_beamy(symbol_table &table, void *ref)
|
||||
{
|
||||
screen_device *screen = reinterpret_cast<screen_device *>(ref);
|
||||
return (screen != nullptr) ? screen->vpos() : 0;
|
||||
@ -1513,7 +1513,7 @@ uint64_t debugger_cpu::get_beamy(symbol_table &table, void *ref)
|
||||
get_frame - get current frame number
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint64_t debugger_cpu::get_frame(symbol_table &table, void *ref)
|
||||
u64 debugger_cpu::get_frame(symbol_table &table, void *ref)
|
||||
{
|
||||
screen_device *screen = reinterpret_cast<screen_device *>(ref);
|
||||
return (screen != nullptr) ? screen->frame_number() : 0;
|
||||
@ -1525,7 +1525,7 @@ uint64_t debugger_cpu::get_frame(symbol_table &table, void *ref)
|
||||
'cpunum' symbol
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint64_t debugger_cpu::get_cpunum(symbol_table &table, void *ref)
|
||||
u64 debugger_cpu::get_cpunum(symbol_table &table, void *ref)
|
||||
{
|
||||
execute_interface_iterator iter(m_machine.root_device());
|
||||
return iter.indexof(m_visiblecpu->execute());
|
||||
@ -1825,7 +1825,7 @@ void device_debug::instruction_hook(offs_t curpc)
|
||||
// are we tracking our recent pc visits?
|
||||
if (m_track_pc)
|
||||
{
|
||||
const uint32_t crc = compute_opcode_crc32(curpc);
|
||||
const u32 crc = compute_opcode_crc32(curpc);
|
||||
m_track_pc_set.insert(dasm_pc_tag(curpc, crc));
|
||||
}
|
||||
|
||||
@ -1952,7 +1952,7 @@ void device_debug::instruction_hook(offs_t curpc)
|
||||
// memory read happens
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_debug::memory_read_hook(address_space &space, offs_t address, uint64_t mem_mask)
|
||||
void device_debug::memory_read_hook(address_space &space, offs_t address, u64 mem_mask)
|
||||
{
|
||||
// check watchpoints
|
||||
watchpoint_check(space, WATCHPOINT_READ, address, 0, mem_mask);
|
||||
@ -1969,7 +1969,7 @@ void device_debug::memory_read_hook(address_space &space, offs_t address, uint64
|
||||
// memory write happens
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_debug::memory_write_hook(address_space &space, offs_t address, uint64_t data, uint64_t mem_mask)
|
||||
void device_debug::memory_write_hook(address_space &space, offs_t address, u64 data, u64 mem_mask)
|
||||
{
|
||||
if (m_track_mem)
|
||||
{
|
||||
@ -2134,7 +2134,7 @@ void device_debug::go_exception(int exception)
|
||||
// delay elapses
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_debug::go_milliseconds(uint64_t milliseconds)
|
||||
void device_debug::go_milliseconds(u64 milliseconds)
|
||||
{
|
||||
assert(m_exec != nullptr);
|
||||
|
||||
@ -2165,7 +2165,7 @@ void device_debug::halt_on_next_instruction_impl(util::format_argument_pack<std:
|
||||
int device_debug::breakpoint_set(offs_t address, const char *condition, const char *action)
|
||||
{
|
||||
// allocate a new one
|
||||
uint32_t id = m_device.machine().debugger().cpu().get_breakpoint_index();
|
||||
u32 id = m_device.machine().debugger().cpu().get_breakpoint_index();
|
||||
breakpoint *bp = auto_alloc(m_device.machine(), breakpoint(this, m_symtable, id, address, condition, action));
|
||||
|
||||
// hook it into our list
|
||||
@ -2257,7 +2257,7 @@ int device_debug::watchpoint_set(address_space &space, int type, offs_t address,
|
||||
assert(space.spacenum() < ARRAY_LENGTH(m_wplist));
|
||||
|
||||
// allocate a new one
|
||||
uint32_t id = m_device.machine().debugger().cpu().get_watchpoint_index();
|
||||
u32 id = m_device.machine().debugger().cpu().get_watchpoint_index();
|
||||
watchpoint *wp = auto_alloc(m_device.machine(), watchpoint(this, m_symtable, id, space, type, address, length, condition, action));
|
||||
|
||||
// hook it into our list
|
||||
@ -2352,7 +2352,7 @@ void device_debug::watchpoint_enable_all(bool enable)
|
||||
int device_debug::registerpoint_set(const char *condition, const char *action)
|
||||
{
|
||||
// allocate a new one
|
||||
uint32_t id = m_device.machine().debugger().cpu().get_registerpoint_index();
|
||||
u32 id = m_device.machine().debugger().cpu().get_registerpoint_index();
|
||||
registerpoint *rp = auto_alloc(m_device.machine(), registerpoint(m_symtable, id, condition, action));
|
||||
|
||||
// hook it into our list
|
||||
@ -2487,7 +2487,7 @@ bool device_debug::track_pc_visited(const offs_t& pc) const
|
||||
{
|
||||
if (m_track_pc_set.empty())
|
||||
return false;
|
||||
const uint32_t crc = compute_opcode_crc32(pc);
|
||||
const u32 crc = compute_opcode_crc32(pc);
|
||||
return m_track_pc_set.find(dasm_pc_tag(pc, crc)) != m_track_pc_set.end();
|
||||
}
|
||||
|
||||
@ -2499,7 +2499,7 @@ bool device_debug::track_pc_visited(const offs_t& pc) const
|
||||
|
||||
void device_debug::set_track_pc_visited(const offs_t& pc)
|
||||
{
|
||||
const uint32_t crc = compute_opcode_crc32(pc);
|
||||
const u32 crc = compute_opcode_crc32(pc);
|
||||
m_track_pc_set.insert(dasm_pc_tag(pc, crc));
|
||||
}
|
||||
|
||||
@ -2512,7 +2512,7 @@ void device_debug::set_track_pc_visited(const offs_t& pc)
|
||||
|
||||
offs_t device_debug::track_mem_pc_from_space_address_data(const address_spacenum& space,
|
||||
const offs_t& address,
|
||||
const uint64_t& data) const
|
||||
const u64& data) const
|
||||
{
|
||||
const offs_t missing = (offs_t)(-1);
|
||||
if (m_track_mem_set.empty())
|
||||
@ -2531,7 +2531,7 @@ offs_t device_debug::track_mem_pc_from_space_address_data(const address_spacenum
|
||||
void device_debug::comment_add(offs_t addr, const char *comment, rgb_t color)
|
||||
{
|
||||
// create a new item for the list
|
||||
uint32_t const crc = compute_opcode_crc32(addr);
|
||||
u32 const crc = compute_opcode_crc32(addr);
|
||||
dasm_comment const newComment = dasm_comment(addr, crc, comment, color);
|
||||
std::pair<std::set<dasm_comment>::iterator, bool> const inserted = m_comment_set.insert(newComment);
|
||||
if (!inserted.second)
|
||||
@ -2553,7 +2553,7 @@ void device_debug::comment_add(offs_t addr, const char *comment, rgb_t color)
|
||||
|
||||
bool device_debug::comment_remove(offs_t addr)
|
||||
{
|
||||
const uint32_t crc = compute_opcode_crc32(addr);
|
||||
const u32 crc = compute_opcode_crc32(addr);
|
||||
size_t const removed = m_comment_set.erase(dasm_comment(addr, crc, "", 0xffffffff));
|
||||
if (removed != 0U) m_comment_change++;
|
||||
return removed != 0U;
|
||||
@ -2566,7 +2566,7 @@ bool device_debug::comment_remove(offs_t addr)
|
||||
|
||||
const char *device_debug::comment_text(offs_t addr) const
|
||||
{
|
||||
const uint32_t crc = compute_opcode_crc32(addr);
|
||||
const u32 crc = compute_opcode_crc32(addr);
|
||||
auto comment = m_comment_set.find(dasm_comment(addr, crc, "", 0));
|
||||
if (comment == m_comment_set.end()) return nullptr;
|
||||
return comment->m_text.c_str();
|
||||
@ -2608,7 +2608,7 @@ bool device_debug::comment_import(xml_data_node const &cpunode, bool is_inline)
|
||||
offs_t address = datanode->get_attribute_int("address", 0);
|
||||
rgb_t color = datanode->get_attribute_int("color", 0);
|
||||
|
||||
uint32_t crc;
|
||||
u32 crc;
|
||||
sscanf(datanode->get_attribute_string("crc", nullptr), "%08X", &crc);
|
||||
|
||||
// add the new comment
|
||||
@ -2626,7 +2626,7 @@ bool device_debug::comment_import(xml_data_node const &cpunode, bool is_inline)
|
||||
// the opcode bytes at the given address
|
||||
//-------------------------------------------------
|
||||
|
||||
uint32_t device_debug::compute_opcode_crc32(offs_t pc) const
|
||||
u32 device_debug::compute_opcode_crc32(offs_t pc) const
|
||||
{
|
||||
// Basically the same thing as dasm_wrapped, but with some tiny savings
|
||||
assert(m_memory != nullptr);
|
||||
@ -2637,7 +2637,7 @@ uint32_t device_debug::compute_opcode_crc32(offs_t pc) const
|
||||
offs_t pcbyte = space.address_to_byte(pc) & space.bytemask();
|
||||
|
||||
// fetch the bytes up to the maximum
|
||||
uint8_t opbuf[64], argbuf[64];
|
||||
u8 opbuf[64], argbuf[64];
|
||||
int maxbytes = (m_disasm != nullptr) ? m_disasm->max_opcode_bytes() : 1;
|
||||
for (int numbytes = 0; numbytes < maxbytes; numbytes++)
|
||||
{
|
||||
@ -2645,7 +2645,7 @@ uint32_t device_debug::compute_opcode_crc32(offs_t pc) const
|
||||
argbuf[numbytes] = m_device.machine().debugger().cpu().read_opcode(space, pcbyte + numbytes, 1);
|
||||
}
|
||||
|
||||
uint32_t numbytes = maxbytes;
|
||||
u32 numbytes = maxbytes;
|
||||
if (m_disasm != nullptr)
|
||||
{
|
||||
// disassemble to our buffer
|
||||
@ -2881,12 +2881,12 @@ void device_debug::watchpoint_update_flags(address_space &space)
|
||||
// for a given CPU and address space
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_debug::watchpoint_check(address_space& space, int type, offs_t address, uint64_t value_to_write, uint64_t mem_mask)
|
||||
void device_debug::watchpoint_check(address_space& space, int type, offs_t address, u64 value_to_write, u64 mem_mask)
|
||||
{
|
||||
space.machine().debugger().cpu().watchpoint_check(space, type, address, value_to_write, mem_mask, m_wplist);
|
||||
}
|
||||
|
||||
void debugger_cpu::watchpoint_check(address_space& space, int type, offs_t address, uint64_t value_to_write, uint64_t mem_mask, device_debug::watchpoint** wplist)
|
||||
void debugger_cpu::watchpoint_check(address_space& space, int type, offs_t address, u64 value_to_write, u64 mem_mask, device_debug::watchpoint** wplist)
|
||||
{
|
||||
// if we're within debugger code, don't stop
|
||||
if (m_within_instruction_hook || m_debugger_access)
|
||||
@ -2915,15 +2915,16 @@ void debugger_cpu::watchpoint_check(address_space& space, int type, offs_t addre
|
||||
}
|
||||
|
||||
// (1<<(size*8))-1 won't work when size is 8; let's just use a lut
|
||||
static const uint64_t masks[] = {0,
|
||||
0xff,
|
||||
0xffff,
|
||||
0xffffff,
|
||||
0xffffffff,
|
||||
U64(0xffffffffff),
|
||||
U64(0xffffffffffff),
|
||||
U64(0xffffffffffffff),
|
||||
U64(0xffffffffffffffff)};
|
||||
static const u64 masks[] = {
|
||||
0x0U,
|
||||
0xffU,
|
||||
0xffffU,
|
||||
0xffffffU,
|
||||
0xffffffffU,
|
||||
0xffffffffffU,
|
||||
0xffffffffffffU,
|
||||
0xffffffffffffffU,
|
||||
0xffffffffffffffffU};
|
||||
value_to_write &= masks[size];
|
||||
|
||||
if (space.endianness() == ENDIANNESS_LITTLE)
|
||||
@ -2962,9 +2963,9 @@ void debugger_cpu::watchpoint_check(address_space& space, int type, offs_t addre
|
||||
{
|
||||
buffer = string_format("Stopped at watchpoint %X writing %s to %08X (PC=%X)", wp->index(), sizes[size], space.byte_to_address(address), pc);
|
||||
if (value_to_write >> 32)
|
||||
buffer.append(string_format(" (data=%X%08X)", (uint32_t)(value_to_write >> 32), (uint32_t)value_to_write));
|
||||
buffer.append(string_format(" (data=%X%08X)", u32(value_to_write >> 32), u32(value_to_write)));
|
||||
else
|
||||
buffer.append(string_format(" (data=%X)", (uint32_t)value_to_write));
|
||||
buffer.append(string_format(" (data=%X)", u32(value_to_write)));
|
||||
}
|
||||
else
|
||||
buffer = string_format("Stopped at watchpoint %X reading %s from %08X (PC=%X)", wp->index(), sizes[size], space.byte_to_address(address), pc);
|
||||
@ -3029,7 +3030,7 @@ void device_debug::hotspot_check(address_space &space, offs_t address)
|
||||
// buffer and then disassembling them
|
||||
//-------------------------------------------------
|
||||
|
||||
uint32_t device_debug::dasm_wrapped(std::string &buffer, offs_t pc)
|
||||
u32 device_debug::dasm_wrapped(std::string &buffer, offs_t pc)
|
||||
{
|
||||
assert(m_memory != nullptr && m_disasm != nullptr);
|
||||
|
||||
@ -3039,7 +3040,7 @@ uint32_t device_debug::dasm_wrapped(std::string &buffer, offs_t pc)
|
||||
offs_t pcbyte = space.address_to_byte(pc) & space.bytemask();
|
||||
|
||||
// fetch the bytes up to the maximum
|
||||
uint8_t opbuf[64], argbuf[64];
|
||||
u8 opbuf[64], argbuf[64];
|
||||
int maxbytes = m_disasm->max_opcode_bytes();
|
||||
for (int numbytes = 0; numbytes < maxbytes; numbytes++)
|
||||
{
|
||||
@ -3050,7 +3051,7 @@ uint32_t device_debug::dasm_wrapped(std::string &buffer, offs_t pc)
|
||||
// disassemble to our buffer
|
||||
char diasmbuf[200];
|
||||
memset(diasmbuf, 0x00, 200);
|
||||
uint32_t result = m_disasm->disassemble(diasmbuf, pc, opbuf, argbuf);
|
||||
u32 result = m_disasm->disassemble(diasmbuf, pc, opbuf, argbuf);
|
||||
buffer.assign(diasmbuf);
|
||||
return result;
|
||||
}
|
||||
@ -3061,7 +3062,7 @@ uint32_t device_debug::dasm_wrapped(std::string &buffer, offs_t pc)
|
||||
// current instruction pointer
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t device_debug::get_current_pc(symbol_table &table, void *ref)
|
||||
u64 device_debug::get_current_pc(symbol_table &table, void *ref)
|
||||
{
|
||||
device_t *device = reinterpret_cast<device_t *>(table.globalref());
|
||||
return device->safe_pcbase();
|
||||
@ -3073,7 +3074,7 @@ uint64_t device_debug::get_current_pc(symbol_table &table, void *ref)
|
||||
// 'cycles' symbol
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t device_debug::get_cycles(symbol_table &table, void *ref)
|
||||
u64 device_debug::get_cycles(symbol_table &table, void *ref)
|
||||
{
|
||||
device_t *device = reinterpret_cast<device_t *>(table.globalref());
|
||||
return device->debug()->m_exec->cycles_remaining();
|
||||
@ -3085,7 +3086,7 @@ uint64_t device_debug::get_cycles(symbol_table &table, void *ref)
|
||||
// 'totalcycles' symbol
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t device_debug::get_totalcycles(symbol_table &table, void *ref)
|
||||
u64 device_debug::get_totalcycles(symbol_table &table, void *ref)
|
||||
{
|
||||
device_t *device = reinterpret_cast<device_t *>(table.globalref());
|
||||
return device->debug()->m_total_cycles;
|
||||
@ -3097,7 +3098,7 @@ uint64_t device_debug::get_totalcycles(symbol_table &table, void *ref)
|
||||
// 'lastinstructioncycles' symbol
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t device_debug::get_lastinstructioncycles(symbol_table &table, void *ref)
|
||||
u64 device_debug::get_lastinstructioncycles(symbol_table &table, void *ref)
|
||||
{
|
||||
device_t *device = reinterpret_cast<device_t *>(table.globalref());
|
||||
device_debug *debug = device->debug();
|
||||
@ -3110,7 +3111,7 @@ uint64_t device_debug::get_lastinstructioncycles(symbol_table &table, void *ref)
|
||||
// symbols
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t device_debug::get_logunmap(symbol_table &table, void *ref)
|
||||
u64 device_debug::get_logunmap(symbol_table &table, void *ref)
|
||||
{
|
||||
address_space &space = *reinterpret_cast<address_space *>(table.globalref());
|
||||
return space.log_unmap();
|
||||
@ -3122,7 +3123,7 @@ uint64_t device_debug::get_logunmap(symbol_table &table, void *ref)
|
||||
// symbols
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_debug::set_logunmap(symbol_table &table, void *ref, uint64_t value)
|
||||
void device_debug::set_logunmap(symbol_table &table, void *ref, u64 value)
|
||||
{
|
||||
address_space &space = *reinterpret_cast<address_space *>(table.globalref());
|
||||
space.set_log_unmap(value ? true : false);
|
||||
@ -3134,7 +3135,7 @@ void device_debug::set_logunmap(symbol_table &table, void *ref, uint64_t value)
|
||||
// state symbols
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t device_debug::get_state(symbol_table &table, void *ref)
|
||||
u64 device_debug::get_state(symbol_table &table, void *ref)
|
||||
{
|
||||
device_t *device = reinterpret_cast<device_t *>(table.globalref());
|
||||
return device->debug()->m_state->state_int(reinterpret_cast<uintptr_t>(ref));
|
||||
@ -3146,7 +3147,7 @@ uint64_t device_debug::get_state(symbol_table &table, void *ref)
|
||||
// state symbols
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_debug::set_state(symbol_table &table, void *ref, uint64_t value)
|
||||
void device_debug::set_state(symbol_table &table, void *ref, u64 value)
|
||||
{
|
||||
device_t *device = reinterpret_cast<device_t *>(table.globalref());
|
||||
device->debug()->m_state->set_state_int(reinterpret_cast<uintptr_t>(ref), value);
|
||||
@ -3454,7 +3455,7 @@ void device_debug::tracer::flush()
|
||||
// dasm_pc_tag - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
device_debug::dasm_pc_tag::dasm_pc_tag(const offs_t& address, const uint32_t& crc)
|
||||
device_debug::dasm_pc_tag::dasm_pc_tag(const offs_t& address, const u32& crc)
|
||||
: m_address(address),
|
||||
m_crc(crc)
|
||||
{
|
||||
@ -3466,7 +3467,7 @@ device_debug::dasm_pc_tag::dasm_pc_tag(const offs_t& address, const uint32_t& cr
|
||||
|
||||
device_debug::dasm_memory_access::dasm_memory_access(const address_spacenum& address_space,
|
||||
const offs_t& address,
|
||||
const uint64_t& data,
|
||||
const u64& data,
|
||||
const offs_t& pc)
|
||||
: m_address_space(address_space),
|
||||
m_address(address),
|
||||
@ -3479,7 +3480,7 @@ device_debug::dasm_memory_access::dasm_memory_access(const address_spacenum& add
|
||||
// dasm_comment - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
device_debug::dasm_comment::dasm_comment(offs_t address, uint32_t crc, const char *text, rgb_t color)
|
||||
device_debug::dasm_comment::dasm_comment(offs_t address, u32 crc, const char *text, rgb_t color)
|
||||
: dasm_pc_tag(address, crc),
|
||||
m_text(text),
|
||||
m_color(std::move(color))
|
||||
|
@ -10,8 +10,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __DEBUGCPU_H__
|
||||
#define __DEBUGCPU_H__
|
||||
#ifndef MAME_EMU_DEBUG_DEBUGCPU_H
|
||||
#define MAME_EMU_DEBUG_DEBUGCPU_H
|
||||
|
||||
#include "express.h"
|
||||
|
||||
@ -22,11 +22,11 @@
|
||||
// CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
const uint8_t WATCHPOINT_READ = 1;
|
||||
const uint8_t WATCHPOINT_WRITE = 2;
|
||||
const uint8_t WATCHPOINT_READWRITE = WATCHPOINT_READ | WATCHPOINT_WRITE;
|
||||
constexpr u8 WATCHPOINT_READ = 1;
|
||||
constexpr u8 WATCHPOINT_WRITE = 2;
|
||||
constexpr u8 WATCHPOINT_READWRITE = WATCHPOINT_READ | WATCHPOINT_WRITE;
|
||||
|
||||
const int COMMENT_VERSION = 1;
|
||||
constexpr int COMMENT_VERSION = 1;
|
||||
|
||||
|
||||
|
||||
@ -127,7 +127,7 @@ public:
|
||||
address_space & m_space; // address space
|
||||
int m_index; // user reported index
|
||||
bool m_enabled; // enabled?
|
||||
uint8_t m_type; // type (read/write)
|
||||
u8 m_type; // type (read/write)
|
||||
offs_t m_address; // start address
|
||||
offs_t m_length; // length of watch area
|
||||
parsed_expression m_condition; // condition
|
||||
@ -179,8 +179,8 @@ public:
|
||||
void interrupt_hook(int irqline);
|
||||
void exception_hook(int exception);
|
||||
void instruction_hook(offs_t curpc);
|
||||
void memory_read_hook(address_space &space, offs_t address, uint64_t mem_mask);
|
||||
void memory_write_hook(address_space &space, offs_t address, uint64_t data, uint64_t mem_mask);
|
||||
void memory_read_hook(address_space &space, offs_t address, u64 mem_mask);
|
||||
void memory_write_hook(address_space &space, offs_t address, u64 data, u64 mem_mask);
|
||||
|
||||
// hooks into our operations
|
||||
void set_instruction_hook(debug_instruction_hook_func hook);
|
||||
@ -199,7 +199,7 @@ public:
|
||||
void go_vblank();
|
||||
void go_interrupt(int irqline = -1);
|
||||
void go_exception(int exception);
|
||||
void go_milliseconds(uint64_t milliseconds);
|
||||
void go_milliseconds(u64 milliseconds);
|
||||
void go_next_device();
|
||||
|
||||
template <typename Format, typename... Params>
|
||||
@ -240,11 +240,11 @@ public:
|
||||
void comment_add(offs_t address, const char *comment, rgb_t color);
|
||||
bool comment_remove(offs_t addr);
|
||||
const char *comment_text(offs_t addr) const;
|
||||
uint32_t comment_count() const { return m_comment_set.size(); }
|
||||
uint32_t comment_change_count() const { return m_comment_change; }
|
||||
u32 comment_count() const { return m_comment_set.size(); }
|
||||
u32 comment_change_count() const { return m_comment_change; }
|
||||
bool comment_export(xml_data_node &node);
|
||||
bool comment_import(xml_data_node const &node, bool is_inline);
|
||||
uint32_t compute_opcode_crc32(offs_t pc) const;
|
||||
u32 compute_opcode_crc32(offs_t pc) const;
|
||||
|
||||
// history
|
||||
offs_t history_pc(int index) const;
|
||||
@ -259,7 +259,7 @@ public:
|
||||
void set_track_mem(bool value) { m_track_mem = value; }
|
||||
offs_t track_mem_pc_from_space_address_data(const address_spacenum& space,
|
||||
const offs_t& address,
|
||||
const uint64_t& data) const;
|
||||
const u64& data) const;
|
||||
void track_mem_data_clear() { m_track_mem_set.clear(); }
|
||||
|
||||
// tracing
|
||||
@ -279,24 +279,24 @@ private:
|
||||
|
||||
// internal helpers
|
||||
void prepare_for_step_overout(offs_t pc);
|
||||
uint32_t dasm_wrapped(std::string &buffer, offs_t pc);
|
||||
u32 dasm_wrapped(std::string &buffer, offs_t pc);
|
||||
|
||||
// breakpoint and watchpoint helpers
|
||||
void breakpoint_update_flags();
|
||||
void breakpoint_check(offs_t pc);
|
||||
void watchpoint_update_flags(address_space &space);
|
||||
void watchpoint_check(address_space &space, int type, offs_t address, uint64_t value_to_write, uint64_t mem_mask);
|
||||
void watchpoint_check(address_space &space, int type, offs_t address, u64 value_to_write, u64 mem_mask);
|
||||
void hotspot_check(address_space &space, offs_t address);
|
||||
|
||||
// symbol get/set callbacks
|
||||
static uint64_t get_current_pc(symbol_table &table, void *ref);
|
||||
static uint64_t get_cycles(symbol_table &table, void *ref);
|
||||
static uint64_t get_totalcycles(symbol_table &table, void *ref);
|
||||
static uint64_t get_lastinstructioncycles(symbol_table &table, void *ref);
|
||||
static uint64_t get_logunmap(symbol_table &table, void *ref);
|
||||
static void set_logunmap(symbol_table &table, void *ref, uint64_t value);
|
||||
static uint64_t get_state(symbol_table &table, void *ref);
|
||||
static void set_state(symbol_table &table, void *ref, uint64_t value);
|
||||
static u64 get_current_pc(symbol_table &table, void *ref);
|
||||
static u64 get_cycles(symbol_table &table, void *ref);
|
||||
static u64 get_totalcycles(symbol_table &table, void *ref);
|
||||
static u64 get_lastinstructioncycles(symbol_table &table, void *ref);
|
||||
static u64 get_logunmap(symbol_table &table, void *ref);
|
||||
static void set_logunmap(symbol_table &table, void *ref, u64 value);
|
||||
static u64 get_state(symbol_table &table, void *ref);
|
||||
static void set_state(symbol_table &table, void *ref, u64 value);
|
||||
|
||||
// basic device information
|
||||
device_t & m_device; // device we are attached to
|
||||
@ -306,7 +306,7 @@ private:
|
||||
device_disasm_interface * m_disasm; // disasm interface, if present
|
||||
|
||||
// global state
|
||||
uint32_t m_flags; // debugging flags for this CPU
|
||||
u32 m_flags; // debugging flags for this CPU
|
||||
symbol_table m_symtable; // symbol table for expression evaluation
|
||||
debug_instruction_hook_func m_instrhook; // per-instruction callback hook
|
||||
|
||||
@ -320,12 +320,12 @@ private:
|
||||
int m_stopirq; // stop IRQ number for DEBUG_FLAG_STOP_INTERRUPT
|
||||
int m_stopexception; // stop exception number for DEBUG_FLAG_STOP_EXCEPTION
|
||||
attotime m_endexectime; // ending time of the current execution
|
||||
uint64_t m_total_cycles; // current total cycles
|
||||
uint64_t m_last_total_cycles; // last total cycles
|
||||
u64 m_total_cycles; // current total cycles
|
||||
u64 m_last_total_cycles; // last total cycles
|
||||
|
||||
// history
|
||||
offs_t m_pc_history[HISTORY_SIZE]; // history of recent PCs
|
||||
uint32_t m_pc_history_index; // current history index
|
||||
u32 m_pc_history_index; // current history index
|
||||
|
||||
// breakpoints and watchpoints
|
||||
breakpoint * m_bplist; // list of breakpoints
|
||||
@ -366,7 +366,7 @@ private:
|
||||
offs_t m_access; // access address
|
||||
offs_t m_pc; // PC of the access
|
||||
address_space * m_space; // space where the access occurred
|
||||
uint32_t m_count; // number of hits
|
||||
u32 m_count; // number of hits
|
||||
};
|
||||
std::vector<hotspot_entry> m_hotspots; // hotspot list
|
||||
int m_hotspot_threshhold; // threshhold for the number of hits to print
|
||||
@ -375,7 +375,7 @@ private:
|
||||
class dasm_pc_tag
|
||||
{
|
||||
public:
|
||||
dasm_pc_tag(const offs_t& address, const uint32_t& crc);
|
||||
dasm_pc_tag(const offs_t& address, const u32& crc);
|
||||
|
||||
// required to be included in a set
|
||||
bool operator < (const dasm_pc_tag& rhs) const
|
||||
@ -386,7 +386,7 @@ private:
|
||||
}
|
||||
|
||||
offs_t m_address; // Stores [nothing] for a given address & crc32
|
||||
uint32_t m_crc;
|
||||
u32 m_crc;
|
||||
};
|
||||
std::set<dasm_pc_tag> m_track_pc_set;
|
||||
bool m_track_pc;
|
||||
@ -395,13 +395,13 @@ private:
|
||||
class dasm_comment : public dasm_pc_tag
|
||||
{
|
||||
public:
|
||||
dasm_comment(offs_t address, uint32_t crc, const char *text, rgb_t color);
|
||||
dasm_comment(offs_t address, u32 crc, const char *text, rgb_t color);
|
||||
|
||||
std::string m_text; // Stores comment text & color for a given address & crc32
|
||||
rgb_t m_color;
|
||||
rgb_t m_color;
|
||||
};
|
||||
std::set<dasm_comment> m_comment_set; // collection of comments
|
||||
uint32_t m_comment_change; // change counter for comments
|
||||
u32 m_comment_change; // change counter for comments
|
||||
|
||||
// memory tracking
|
||||
class dasm_memory_access
|
||||
@ -409,7 +409,7 @@ private:
|
||||
public:
|
||||
dasm_memory_access(const address_spacenum& address_space,
|
||||
const offs_t& address,
|
||||
const uint64_t& data,
|
||||
const u64& data,
|
||||
const offs_t& pc);
|
||||
|
||||
// required to be included in a set
|
||||
@ -426,31 +426,31 @@ private:
|
||||
// Stores the PC for a given address, memory region, and data value
|
||||
address_spacenum m_address_space;
|
||||
offs_t m_address;
|
||||
uint64_t m_data;
|
||||
u64 m_data;
|
||||
mutable offs_t m_pc;
|
||||
};
|
||||
std::set<dasm_memory_access> m_track_mem_set;
|
||||
bool m_track_mem;
|
||||
|
||||
// internal flag values
|
||||
static const uint32_t DEBUG_FLAG_OBSERVING = 0x00000001; // observing this CPU
|
||||
static const uint32_t DEBUG_FLAG_HISTORY = 0x00000002; // tracking this CPU's history
|
||||
static const uint32_t DEBUG_FLAG_TRACING = 0x00000004; // tracing this CPU
|
||||
static const uint32_t DEBUG_FLAG_TRACING_OVER = 0x00000008; // tracing this CPU with step over behavior
|
||||
static const uint32_t DEBUG_FLAG_HOOKED = 0x00000010; // per-instruction callback hook
|
||||
static const uint32_t DEBUG_FLAG_STEPPING = 0x00000020; // CPU is single stepping
|
||||
static const uint32_t DEBUG_FLAG_STEPPING_OVER = 0x00000040; // CPU is stepping over a function
|
||||
static const uint32_t DEBUG_FLAG_STEPPING_OUT = 0x00000080; // CPU is stepping out of a function
|
||||
static const uint32_t DEBUG_FLAG_STOP_PC = 0x00000100; // there is a pending stop at cpu->breakpc
|
||||
static const uint32_t DEBUG_FLAG_STOP_INTERRUPT = 0x00000400; // there is a pending stop on the next interrupt
|
||||
static const uint32_t DEBUG_FLAG_STOP_EXCEPTION = 0x00000800; // there is a pending stop on the next exception
|
||||
static const uint32_t DEBUG_FLAG_STOP_VBLANK = 0x00001000; // there is a pending stop on the next VBLANK
|
||||
static const uint32_t DEBUG_FLAG_STOP_TIME = 0x00002000; // there is a pending stop at cpu->stoptime
|
||||
static const uint32_t DEBUG_FLAG_LIVE_BP = 0x00010000; // there are live breakpoints for this CPU
|
||||
static constexpr u32 DEBUG_FLAG_OBSERVING = 0x00000001; // observing this CPU
|
||||
static constexpr u32 DEBUG_FLAG_HISTORY = 0x00000002; // tracking this CPU's history
|
||||
static constexpr u32 DEBUG_FLAG_TRACING = 0x00000004; // tracing this CPU
|
||||
static constexpr u32 DEBUG_FLAG_TRACING_OVER = 0x00000008; // tracing this CPU with step over behavior
|
||||
static constexpr u32 DEBUG_FLAG_HOOKED = 0x00000010; // per-instruction callback hook
|
||||
static constexpr u32 DEBUG_FLAG_STEPPING = 0x00000020; // CPU is single stepping
|
||||
static constexpr u32 DEBUG_FLAG_STEPPING_OVER = 0x00000040; // CPU is stepping over a function
|
||||
static constexpr u32 DEBUG_FLAG_STEPPING_OUT = 0x00000080; // CPU is stepping out of a function
|
||||
static constexpr u32 DEBUG_FLAG_STOP_PC = 0x00000100; // there is a pending stop at cpu->breakpc
|
||||
static constexpr u32 DEBUG_FLAG_STOP_INTERRUPT = 0x00000400; // there is a pending stop on the next interrupt
|
||||
static constexpr u32 DEBUG_FLAG_STOP_EXCEPTION = 0x00000800; // there is a pending stop on the next exception
|
||||
static constexpr u32 DEBUG_FLAG_STOP_VBLANK = 0x00001000; // there is a pending stop on the next VBLANK
|
||||
static constexpr u32 DEBUG_FLAG_STOP_TIME = 0x00002000; // there is a pending stop at cpu->stoptime
|
||||
static constexpr u32 DEBUG_FLAG_LIVE_BP = 0x00010000; // there are live breakpoints for this CPU
|
||||
|
||||
static const uint32_t DEBUG_FLAG_STEPPING_ANY = DEBUG_FLAG_STEPPING | DEBUG_FLAG_STEPPING_OVER | DEBUG_FLAG_STEPPING_OUT;
|
||||
static const uint32_t DEBUG_FLAG_TRACING_ANY = DEBUG_FLAG_TRACING | DEBUG_FLAG_TRACING_OVER;
|
||||
static const uint32_t DEBUG_FLAG_TRANSIENT = DEBUG_FLAG_STEPPING_ANY | DEBUG_FLAG_STOP_PC |
|
||||
static constexpr u32 DEBUG_FLAG_STEPPING_ANY = DEBUG_FLAG_STEPPING | DEBUG_FLAG_STEPPING_OVER | DEBUG_FLAG_STEPPING_OUT;
|
||||
static constexpr u32 DEBUG_FLAG_TRACING_ANY = DEBUG_FLAG_TRACING | DEBUG_FLAG_TRACING_OVER;
|
||||
static constexpr u32 DEBUG_FLAG_TRANSIENT = DEBUG_FLAG_STEPPING_ANY | DEBUG_FLAG_STOP_PC |
|
||||
DEBUG_FLAG_STOP_INTERRUPT | DEBUG_FLAG_STOP_EXCEPTION | DEBUG_FLAG_STOP_VBLANK | DEBUG_FLAG_STOP_TIME;
|
||||
};
|
||||
|
||||
@ -510,46 +510,46 @@ public:
|
||||
/* ----- debugger memory accessors ----- */
|
||||
|
||||
/* return a byte from the specified memory space */
|
||||
uint8_t read_byte(address_space &space, offs_t address, bool apply_translation);
|
||||
u8 read_byte(address_space &space, offs_t address, bool apply_translation);
|
||||
|
||||
/* return a word from the specified memory space */
|
||||
uint16_t read_word(address_space &space, offs_t address, bool apply_translation);
|
||||
u16 read_word(address_space &space, offs_t address, bool apply_translation);
|
||||
|
||||
/* return a dword from the specified memory space */
|
||||
uint32_t read_dword(address_space &space, offs_t address, bool apply_translation);
|
||||
u32 read_dword(address_space &space, offs_t address, bool apply_translation);
|
||||
|
||||
/* return a qword from the specified memory space */
|
||||
uint64_t read_qword(address_space &space, offs_t address, bool apply_translation);
|
||||
u64 read_qword(address_space &space, offs_t address, bool apply_translation);
|
||||
|
||||
/* return 1,2,4 or 8 bytes from the specified memory space */
|
||||
uint64_t read_memory(address_space &space, offs_t address, int size, bool apply_translation);
|
||||
u64 read_memory(address_space &space, offs_t address, int size, bool apply_translation);
|
||||
|
||||
/* write a byte to the specified memory space */
|
||||
void write_byte(address_space &space, offs_t address, uint8_t data, bool apply_translation);
|
||||
void write_byte(address_space &space, offs_t address, u8 data, bool apply_translation);
|
||||
|
||||
/* write a word to the specified memory space */
|
||||
void write_word(address_space &space, offs_t address, uint16_t data, bool apply_translation);
|
||||
void write_word(address_space &space, offs_t address, u16 data, bool apply_translation);
|
||||
|
||||
/* write a dword to the specified memory space */
|
||||
void write_dword(address_space &space, offs_t address, uint32_t data, bool apply_translation);
|
||||
void write_dword(address_space &space, offs_t address, u32 data, bool apply_translation);
|
||||
|
||||
/* write a qword to the specified memory space */
|
||||
void write_qword(address_space &space, offs_t address, uint64_t data, bool apply_translation);
|
||||
void write_qword(address_space &space, offs_t address, u64 data, bool apply_translation);
|
||||
|
||||
/* write 1,2,4 or 8 bytes to the specified memory space */
|
||||
void write_memory(address_space &space, offs_t address, uint64_t data, int size, bool apply_translation);
|
||||
void write_memory(address_space &space, offs_t address, u64 data, int size, bool apply_translation);
|
||||
|
||||
/* read 1,2,4 or 8 bytes at the given offset from opcode space */
|
||||
uint64_t read_opcode(address_space &space, offs_t offset, int size);
|
||||
u64 read_opcode(address_space &space, offs_t offset, int size);
|
||||
|
||||
// getters
|
||||
bool within_instruction_hook() const { return m_within_instruction_hook; }
|
||||
bool memory_modified() const { return m_memory_modified; }
|
||||
int execution_state() const { return m_execution_state; }
|
||||
device_t *live_cpu() { return m_livecpu; }
|
||||
uint32_t get_breakpoint_index() { return m_bpindex++; }
|
||||
uint32_t get_watchpoint_index() { return m_wpindex++; }
|
||||
uint32_t get_registerpoint_index() { return m_rpindex++; }
|
||||
u32 get_breakpoint_index() { return m_bpindex++; }
|
||||
u32 get_watchpoint_index() { return m_wpindex++; }
|
||||
u32 get_registerpoint_index() { return m_rpindex++; }
|
||||
|
||||
// setters
|
||||
void set_visible_cpu(device_t * visiblecpu) { m_visiblecpu = visiblecpu; }
|
||||
@ -568,26 +568,26 @@ public:
|
||||
void ensure_comments_loaded();
|
||||
void reset_transient_flags();
|
||||
void process_source_file();
|
||||
void watchpoint_check(address_space& space, int type, offs_t address, uint64_t value_to_write, uint64_t mem_mask, device_debug::watchpoint** wplist);
|
||||
void watchpoint_check(address_space& space, int type, offs_t address, u64 value_to_write, u64 mem_mask, device_debug::watchpoint** wplist);
|
||||
|
||||
private:
|
||||
static const size_t NUM_TEMP_VARIABLES;
|
||||
|
||||
/* expression handlers */
|
||||
uint64_t expression_read_memory(void *param, const char *name, expression_space space, uint32_t address, int size);
|
||||
uint64_t expression_read_program_direct(address_space &space, int opcode, offs_t address, int size);
|
||||
uint64_t expression_read_memory_region(const char *rgntag, offs_t address, int size);
|
||||
void expression_write_memory(void *param, const char *name, expression_space space, uint32_t address, int size, uint64_t data);
|
||||
void expression_write_program_direct(address_space &space, int opcode, offs_t address, int size, uint64_t data);
|
||||
void expression_write_memory_region(const char *rgntag, offs_t address, int size, uint64_t data);
|
||||
u64 expression_read_memory(void *param, const char *name, expression_space space, u32 address, int size);
|
||||
u64 expression_read_program_direct(address_space &space, int opcode, offs_t address, int size);
|
||||
u64 expression_read_memory_region(const char *rgntag, offs_t address, int size);
|
||||
void expression_write_memory(void *param, const char *name, expression_space space, u32 address, int size, u64 data);
|
||||
void expression_write_program_direct(address_space &space, int opcode, offs_t address, int size, u64 data);
|
||||
void expression_write_memory_region(const char *rgntag, offs_t address, int size, u64 data);
|
||||
expression_error::error_code expression_validate(void *param, const char *name, expression_space space);
|
||||
device_t* expression_get_device(const char *tag);
|
||||
|
||||
/* variable getters/setters */
|
||||
uint64_t get_cpunum(symbol_table &table, void *ref);
|
||||
uint64_t get_beamx(symbol_table &table, void *ref);
|
||||
uint64_t get_beamy(symbol_table &table, void *ref);
|
||||
uint64_t get_frame(symbol_table &table, void *ref);
|
||||
u64 get_cpunum(symbol_table &table, void *ref);
|
||||
u64 get_beamx(symbol_table &table, void *ref);
|
||||
u64 get_beamy(symbol_table &table, void *ref);
|
||||
u64 get_frame(symbol_table &table, void *ref);
|
||||
|
||||
/* internal helpers */
|
||||
void on_vblank(screen_device &device, bool vblank_state);
|
||||
@ -602,25 +602,25 @@ private:
|
||||
|
||||
std::unique_ptr<symbol_table> m_symtable; // global symbol table
|
||||
|
||||
bool m_within_instruction_hook;
|
||||
bool m_vblank_occurred;
|
||||
bool m_memory_modified;
|
||||
bool m_debugger_access;
|
||||
bool m_within_instruction_hook;
|
||||
bool m_vblank_occurred;
|
||||
bool m_memory_modified;
|
||||
bool m_debugger_access;
|
||||
|
||||
int m_execution_state;
|
||||
device_t * m_stop_when_not_device; // stop execution when the device ceases to be this
|
||||
|
||||
uint32_t m_bpindex;
|
||||
uint32_t m_wpindex;
|
||||
uint32_t m_rpindex;
|
||||
u32 m_bpindex;
|
||||
u32 m_wpindex;
|
||||
u32 m_rpindex;
|
||||
|
||||
uint64_t m_wpdata;
|
||||
uint64_t m_wpaddr;
|
||||
std::unique_ptr<uint64_t[]> m_tempvar;
|
||||
u64 m_wpdata;
|
||||
u64 m_wpaddr;
|
||||
std::unique_ptr<u64[]> m_tempvar;
|
||||
|
||||
osd_ticks_t m_last_periodic_update_time;
|
||||
|
||||
bool m_comments_loaded;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // MAME_EMU_DEBUG_DEBUGCPU_H
|
||||
|
@ -1518,7 +1518,7 @@ const char *debug_get_help(const char *tag)
|
||||
|
||||
/* make a lowercase copy of the tag */
|
||||
for (i = 0; i <= taglen; i++)
|
||||
tagcopy[i] = tolower((uint8_t)tag[i]);
|
||||
tagcopy[i] = tolower(u8(tag[i]));
|
||||
|
||||
/* find a match */
|
||||
for (i = 0; i < ARRAY_LENGTH(static_help_list); i++)
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
*********************************************************************/
|
||||
|
||||
#ifndef __DEBUGHLP_H__
|
||||
#define __DEBUGHLP_H__
|
||||
#ifndef MAME_EMU_DEBUG_DEBUGHLP_H
|
||||
#define MAME_EMU_DEBUG_DEBUGHLP_H
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
@ -19,4 +19,4 @@
|
||||
/* help management */
|
||||
const char * debug_get_help(const char *tag);
|
||||
|
||||
#endif
|
||||
#endif // MAME_EMU_DEBUG_DEBUGHLP_H
|
||||
|
@ -506,7 +506,7 @@ bool debug_view_expression::recompute()
|
||||
// recompute the value of the expression
|
||||
try
|
||||
{
|
||||
uint64_t newresult = m_parsed.execute();
|
||||
u64 newresult = m_parsed.execute();
|
||||
if (newresult != m_result)
|
||||
{
|
||||
m_result = newresult;
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __DEBUGVIEW_H__
|
||||
#define __DEBUGVIEW_H__
|
||||
#ifndef MAME_EMU_DEBUG_DEBUGVIEW_H
|
||||
#define MAME_EMU_DEBUG_DEBUGVIEW_H
|
||||
|
||||
#include "express.h"
|
||||
|
||||
@ -43,36 +43,36 @@ enum debug_view_notification
|
||||
|
||||
|
||||
// attribute bits for debug_view_char.attrib
|
||||
const uint8_t DCA_NORMAL = 0x00; // black on white
|
||||
const uint8_t DCA_CHANGED = 0x01; // red foreground
|
||||
const uint8_t DCA_SELECTED = 0x02; // light red background
|
||||
const uint8_t DCA_INVALID = 0x04; // dark blue foreground
|
||||
const uint8_t DCA_DISABLED = 0x08; // darker foreground
|
||||
const uint8_t DCA_ANCILLARY = 0x10; // grey background
|
||||
const uint8_t DCA_CURRENT = 0x20; // yellow background
|
||||
const uint8_t DCA_COMMENT = 0x40; // green foreground
|
||||
const uint8_t DCA_VISITED = 0x80; // light blue background
|
||||
constexpr u8 DCA_NORMAL = 0x00; // black on white
|
||||
constexpr u8 DCA_CHANGED = 0x01; // red foreground
|
||||
constexpr u8 DCA_SELECTED = 0x02; // light red background
|
||||
constexpr u8 DCA_INVALID = 0x04; // dark blue foreground
|
||||
constexpr u8 DCA_DISABLED = 0x08; // darker foreground
|
||||
constexpr u8 DCA_ANCILLARY = 0x10; // grey background
|
||||
constexpr u8 DCA_CURRENT = 0x20; // yellow background
|
||||
constexpr u8 DCA_COMMENT = 0x40; // green foreground
|
||||
constexpr u8 DCA_VISITED = 0x80; // light blue background
|
||||
|
||||
|
||||
// special characters that can be passed to process_char()
|
||||
const int DCH_UP = 1; // up arrow
|
||||
const int DCH_DOWN = 2; // down arrow
|
||||
const int DCH_LEFT = 3; // left arrow
|
||||
const int DCH_RIGHT = 4; // right arrow
|
||||
const int DCH_PUP = 5; // page up
|
||||
const int DCH_PDOWN = 6; // page down
|
||||
const int DCH_HOME = 7; // home
|
||||
const int DCH_CTRLHOME = 8; // ctrl+home
|
||||
const int DCH_END = 9; // end
|
||||
const int DCH_CTRLEND = 10; // ctrl+end
|
||||
const int DCH_CTRLRIGHT = 11; // ctrl+right
|
||||
const int DCH_CTRLLEFT = 12; // ctrl+left
|
||||
constexpr int DCH_UP = 1; // up arrow
|
||||
constexpr int DCH_DOWN = 2; // down arrow
|
||||
constexpr int DCH_LEFT = 3; // left arrow
|
||||
constexpr int DCH_RIGHT = 4; // right arrow
|
||||
constexpr int DCH_PUP = 5; // page up
|
||||
constexpr int DCH_PDOWN = 6; // page down
|
||||
constexpr int DCH_HOME = 7; // home
|
||||
constexpr int DCH_CTRLHOME = 8; // ctrl+home
|
||||
constexpr int DCH_END = 9; // end
|
||||
constexpr int DCH_CTRLEND = 10; // ctrl+end
|
||||
constexpr int DCH_CTRLRIGHT = 11; // ctrl+right
|
||||
constexpr int DCH_CTRLLEFT = 12; // ctrl+left
|
||||
|
||||
|
||||
// special characters that can be passed to process_click()
|
||||
const int DCK_LEFT_CLICK = 1; // left instantaneous click
|
||||
const int DCK_RIGHT_CLICK = 2; // right instantaneous click
|
||||
const int DCK_MIDDLE_CLICK = 3; // middle instantaneous click
|
||||
constexpr int DCK_LEFT_CLICK = 1; // left instantaneous click
|
||||
constexpr int DCK_RIGHT_CLICK = 2; // right instantaneous click
|
||||
constexpr int DCK_MIDDLE_CLICK = 3; // middle instantaneous click
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
@ -90,8 +90,8 @@ typedef void (*debug_view_osd_update_func)(debug_view &view, void *osdprivate);
|
||||
// a single "character" in the debug view has an ASCII value and an attribute byte
|
||||
struct debug_view_char
|
||||
{
|
||||
uint8_t byte;
|
||||
uint8_t attrib;
|
||||
u8 byte;
|
||||
u8 attrib;
|
||||
};
|
||||
|
||||
|
||||
@ -101,8 +101,8 @@ class debug_view_xy
|
||||
public:
|
||||
debug_view_xy(int _x = 0, int _y = 0) : x(_x), y(_y) { }
|
||||
|
||||
int32_t x;
|
||||
int32_t y;
|
||||
s32 x;
|
||||
s32 y;
|
||||
};
|
||||
|
||||
|
||||
@ -208,7 +208,7 @@ protected:
|
||||
|
||||
// update info
|
||||
bool m_recompute; // does this view require a recomputation?
|
||||
uint8_t m_update_level; // update level; updates when this hits 0
|
||||
u8 m_update_level; // update level; updates when this hits 0
|
||||
bool m_update_pending; // true if there is a pending update
|
||||
bool m_osd_update_pending; // true if there is a pending update
|
||||
std::vector<debug_view_char> m_viewdata; // current array of view data
|
||||
@ -259,8 +259,8 @@ public:
|
||||
// getters
|
||||
running_machine &machine() const { return m_machine; }
|
||||
bool dirty() const { return m_dirty; }
|
||||
uint64_t last_value() const { return m_result; }
|
||||
uint64_t value() { recompute(); return m_result; }
|
||||
u64 last_value() const { return m_result; }
|
||||
u64 value() { recompute(); return m_result; }
|
||||
const char *string() const { return m_string.c_str(); }
|
||||
symbol_table *context() const { return m_parsed.symbols(); }
|
||||
|
||||
@ -276,10 +276,10 @@ private:
|
||||
// internal state
|
||||
running_machine & m_machine; // reference to the machine
|
||||
bool m_dirty; // true if the expression needs to be re-evaluated
|
||||
uint64_t m_result; // last result from the expression
|
||||
u64 m_result; // last result from the expression
|
||||
parsed_expression m_parsed; // parsed expression data
|
||||
std::string m_string; // copy of the expression string
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
#endif // MAME_EMU_DEBUG_DEBUGVIEW_H
|
||||
|
@ -266,7 +266,7 @@ void debug_view_breakpoints::view_update()
|
||||
pad_ostream_to_length(linebuf, tableBreaks[5]);
|
||||
|
||||
auto const &text(linebuf.vec());
|
||||
for (uint32_t i = m_topleft.x; i < (m_topleft.x + m_visible.x); i++, dest++)
|
||||
for (u32 i = m_topleft.x; i < (m_topleft.x + m_visible.x); i++, dest++)
|
||||
{
|
||||
dest->byte = (i < text.size()) ? text[i] : ' ';
|
||||
dest->attrib = DCA_ANCILLARY;
|
||||
@ -298,7 +298,7 @@ void debug_view_breakpoints::view_update()
|
||||
pad_ostream_to_length(linebuf, tableBreaks[5]);
|
||||
|
||||
auto const &text(linebuf.vec());
|
||||
for (uint32_t i = m_topleft.x; i < (m_topleft.x + m_visible.x); i++, dest++)
|
||||
for (u32 i = m_topleft.x; i < (m_topleft.x + m_visible.x); i++, dest++)
|
||||
{
|
||||
dest->byte = (i < text.size()) ? text[i] : ' ';
|
||||
dest->attrib = DCA_NORMAL;
|
||||
@ -311,7 +311,7 @@ void debug_view_breakpoints::view_update()
|
||||
else
|
||||
{
|
||||
// Fill the remaining vertical space
|
||||
for (uint32_t i = m_topleft.x; i < (m_topleft.x + m_visible.x); i++, dest++)
|
||||
for (u32 i = m_topleft.x; i < (m_topleft.x + m_visible.x); i++, dest++)
|
||||
{
|
||||
dest->byte = ' ';
|
||||
dest->attrib = DCA_NORMAL;
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __DVBPOINTS_H__
|
||||
#define __DVBPOINTS_H__
|
||||
#ifndef MAME_EMU_DEBUG_DVBPOINTS_H
|
||||
#define MAME_EMU_DEBUG_DVBPOINTS_H
|
||||
|
||||
#include "debugvw.h"
|
||||
#include "debugcpu.h"
|
||||
@ -52,4 +52,4 @@ private:
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
#endif // MAME_EMU_DEBUG_DVBPOINTS_H
|
||||
|
@ -133,8 +133,8 @@ void debug_view_disasm::view_notify(debug_view_notification type)
|
||||
void debug_view_disasm::view_char(int chval)
|
||||
{
|
||||
debug_view_xy origcursor = m_cursor;
|
||||
uint8_t end_buffer = 3;
|
||||
int32_t temp;
|
||||
u8 end_buffer = 3;
|
||||
s32 temp;
|
||||
|
||||
switch (chval)
|
||||
{
|
||||
@ -250,7 +250,7 @@ offs_t debug_view_disasm::find_pc_backwards(offs_t targetpc, int numinstrs)
|
||||
{
|
||||
// fill the buffer up to the target
|
||||
offs_t curpcbyte = source.m_space.address_to_byte(curpc) & source.m_space.logbytemask();
|
||||
uint8_t opbuf[1024], argbuf[1024];
|
||||
u8 opbuf[1024], argbuf[1024];
|
||||
while (curpcbyte < fillpcbyte)
|
||||
{
|
||||
fillpcbyte--;
|
||||
@ -397,7 +397,7 @@ bool debug_view_disasm::recompute(offs_t pc, int startline, int lines)
|
||||
offs_t physpcbyte = pcbyte;
|
||||
if (source.m_space.device().memory().translate(source.m_space.spacenum(), TRANSLATE_FETCH_DEBUG, physpcbyte))
|
||||
{
|
||||
uint8_t opbuf[64], argbuf[64];
|
||||
u8 opbuf[64], argbuf[64];
|
||||
|
||||
// fetch the bytes up to the maximum
|
||||
for (numbytes = 0; numbytes < maxbytes; numbytes++)
|
||||
@ -466,14 +466,14 @@ void debug_view_disasm::view_update()
|
||||
m_recompute = true;
|
||||
|
||||
// if we're tracking a value, make sure it is visible
|
||||
uint64_t previous = m_expression.last_value();
|
||||
uint64_t result = m_expression.value();
|
||||
u64 previous = m_expression.last_value();
|
||||
u64 result = m_expression.value();
|
||||
if (result != previous)
|
||||
{
|
||||
offs_t resultbyte = source.m_space.address_to_byte(result) & source.m_space.logbytemask();
|
||||
|
||||
// see if the new result is an address we already have
|
||||
uint32_t row;
|
||||
u32 row;
|
||||
for (row = 0; row < m_byteaddress.size(); row++)
|
||||
if (m_byteaddress[row] == resultbyte)
|
||||
break;
|
||||
@ -512,7 +512,7 @@ recompute:
|
||||
else
|
||||
{
|
||||
// determine the addresses of what we will display
|
||||
offs_t backpc = find_pc_backwards((uint32_t)m_expression.value(), m_backwards_steps);
|
||||
offs_t backpc = find_pc_backwards(u32(m_expression.value()), m_backwards_steps);
|
||||
|
||||
// put ourselves back in the top left
|
||||
m_topleft.y = 0;
|
||||
@ -527,9 +527,9 @@ recompute:
|
||||
if (pcbyte != m_last_pcbyte)
|
||||
{
|
||||
// find the row with the PC on it
|
||||
for (uint32_t row = 0; row < m_visible.y; row++)
|
||||
for (u32 row = 0; row < m_visible.y; row++)
|
||||
{
|
||||
uint32_t effrow = m_topleft.y + row;
|
||||
u32 effrow = m_topleft.y + row;
|
||||
if (effrow >= m_byteaddress.size())
|
||||
break;
|
||||
if (pcbyte == m_byteaddress[effrow])
|
||||
@ -552,13 +552,13 @@ recompute:
|
||||
|
||||
// loop over visible rows
|
||||
debug_view_char *dest = &m_viewdata[0];
|
||||
for (uint32_t row = 0; row < m_visible.y; row++)
|
||||
for (u32 row = 0; row < m_visible.y; row++)
|
||||
{
|
||||
uint32_t effrow = m_topleft.y + row;
|
||||
uint32_t col = 0;
|
||||
u32 effrow = m_topleft.y + row;
|
||||
u32 col = 0;
|
||||
|
||||
// if this visible row is valid, add it to the buffer
|
||||
uint8_t attrib = DCA_NORMAL;
|
||||
u8 attrib = DCA_NORMAL;
|
||||
if (effrow < m_byteaddress.size())
|
||||
{
|
||||
// if we're on the line with the PC, recompute and hilight it
|
||||
@ -583,10 +583,10 @@ recompute:
|
||||
|
||||
// get the effective string
|
||||
const char *data = &m_dasm.vec()[effrow * m_total.x];
|
||||
uint32_t len = (uint32_t)strlen(data);
|
||||
u32 len = u32(strlen(data));
|
||||
|
||||
// copy data
|
||||
uint32_t effcol = m_topleft.x;
|
||||
u32 effcol = m_topleft.x;
|
||||
while (col < m_visible.x && effcol < len)
|
||||
{
|
||||
dest->byte = data[effcol++];
|
||||
@ -658,7 +658,7 @@ void debug_view_disasm::set_right_column(disasm_right_column contents)
|
||||
// instructions displayed before the home address
|
||||
//-------------------------------------------------
|
||||
|
||||
void debug_view_disasm::set_backward_steps(uint32_t steps)
|
||||
void debug_view_disasm::set_backward_steps(u32 steps)
|
||||
{
|
||||
begin_update();
|
||||
m_backwards_steps = steps;
|
||||
@ -672,7 +672,7 @@ void debug_view_disasm::set_backward_steps(uint32_t steps)
|
||||
// of the main disassembly section
|
||||
//-------------------------------------------------
|
||||
|
||||
void debug_view_disasm::set_disasm_width(uint32_t width)
|
||||
void debug_view_disasm::set_disasm_width(u32 width)
|
||||
{
|
||||
begin_update();
|
||||
m_dasm_width = width;
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __DVDISASM_H__
|
||||
#define __DVDISASM_H__
|
||||
#ifndef MAME_EMU_DEBUG_DVDISASM_H
|
||||
#define MAME_EMU_DEBUG_DVDISASM_H
|
||||
|
||||
#include "debugvw.h"
|
||||
|
||||
@ -69,15 +69,15 @@ public:
|
||||
// getters
|
||||
const char *expression() const { return m_expression.string(); }
|
||||
disasm_right_column right_column() const { return m_right_column; }
|
||||
uint32_t backward_steps() const { return m_backwards_steps; }
|
||||
uint32_t disasm_width() const { return m_dasm_width; }
|
||||
u32 backward_steps() const { return m_backwards_steps; }
|
||||
u32 disasm_width() const { return m_dasm_width; }
|
||||
offs_t selected_address();
|
||||
|
||||
// setters
|
||||
void set_expression(const char *expression);
|
||||
void set_right_column(disasm_right_column contents);
|
||||
void set_backward_steps(uint32_t steps);
|
||||
void set_disasm_width(uint32_t width);
|
||||
void set_backward_steps(u32 steps);
|
||||
void set_disasm_width(u32 width);
|
||||
void set_selected_address(offs_t address);
|
||||
|
||||
protected:
|
||||
@ -96,11 +96,11 @@ private:
|
||||
|
||||
// internal state
|
||||
disasm_right_column m_right_column; // right column contents
|
||||
uint32_t m_backwards_steps; // number of backwards steps
|
||||
uint32_t m_dasm_width; // width of the disassembly area
|
||||
uint8_t * m_last_direct_raw; // last direct raw value
|
||||
uint8_t * m_last_direct_decrypted;// last direct decrypted value
|
||||
uint32_t m_last_change_count; // last comment change count
|
||||
u32 m_backwards_steps; // number of backwards steps
|
||||
u32 m_dasm_width; // width of the disassembly area
|
||||
u8 * m_last_direct_raw; // last direct raw value
|
||||
u8 * m_last_direct_decrypted;// last direct decrypted value
|
||||
u32 m_last_change_count; // last comment change count
|
||||
offs_t m_last_pcbyte; // last PC byte value
|
||||
int m_divider1, m_divider2; // left and right divider columns
|
||||
int m_divider3; // comment divider column
|
||||
@ -115,4 +115,4 @@ private:
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
#endif // MAME_EMU_DEBUG_DVDISASM_H
|
||||
|
@ -67,7 +67,7 @@ debug_view_memory_source::debug_view_memory_source(const char *name, memory_regi
|
||||
m_length(region.bytes()),
|
||||
m_offsetxor(ENDIAN_VALUE_NE_NNE(region.endianness(), 0, region.bytewidth() - 1)),
|
||||
m_endianness(region.endianness()),
|
||||
m_prefsize(std::min<uint8_t>(region.bytewidth(), 8))
|
||||
m_prefsize(std::min<u8>(region.bytewidth(), 8))
|
||||
{
|
||||
}
|
||||
|
||||
@ -156,7 +156,7 @@ void debug_view_memory::enumerate_sources()
|
||||
for (int itemnum = 0; itemnum < 10000; itemnum++)
|
||||
{
|
||||
// stop when we run out of items
|
||||
uint32_t valsize, valcount;
|
||||
u32 valsize, valcount;
|
||||
void *base;
|
||||
const char *itemname = machine().save().indexed_item(itemnum, base, valsize, valcount);
|
||||
if (itemname == nullptr)
|
||||
@ -206,15 +206,15 @@ void debug_view_memory::view_notify(debug_view_notification type)
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// uint32_to_float - return a floating point number
|
||||
// u32_to_float - return a floating point number
|
||||
// whose 32 bit representation is value
|
||||
//-------------------------------------------------
|
||||
|
||||
static inline float uint32_to_float(uint32_t value)
|
||||
static inline float u32_to_float(u32 value)
|
||||
{
|
||||
union {
|
||||
float f;
|
||||
uint32_t i;
|
||||
u32 i;
|
||||
} v;
|
||||
|
||||
v.i = value;
|
||||
@ -222,15 +222,15 @@ static inline float uint32_to_float(uint32_t value)
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// uint64_to_double - return a floating point number
|
||||
// u64_to_double - return a floating point number
|
||||
// whose 64 bit representation is value
|
||||
//-------------------------------------------------
|
||||
|
||||
static inline float uint64_to_double(uint64_t value)
|
||||
static inline float u64_to_double(u64 value)
|
||||
{
|
||||
union {
|
||||
double f;
|
||||
uint64_t i;
|
||||
u64 i;
|
||||
} v;
|
||||
|
||||
v.i = value;
|
||||
@ -254,18 +254,18 @@ void debug_view_memory::view_update()
|
||||
const memory_view_pos &posdata = s_memory_pos_table[m_data_format];
|
||||
|
||||
// loop over visible rows
|
||||
for (uint32_t row = 0; row < m_visible.y; row++)
|
||||
for (u32 row = 0; row < m_visible.y; row++)
|
||||
{
|
||||
debug_view_char *destmin = &m_viewdata[row * m_visible.x];
|
||||
debug_view_char *destmax = destmin + m_visible.x;
|
||||
debug_view_char *destrow = destmin - m_topleft.x;
|
||||
uint32_t effrow = m_topleft.y + row;
|
||||
u32 effrow = m_topleft.y + row;
|
||||
|
||||
// reset the line of data; section 1 is normal, others are ancillary, cursor is selected
|
||||
debug_view_char *dest = destmin;
|
||||
for (int ch = 0; ch < m_visible.x; ch++, dest++)
|
||||
{
|
||||
uint32_t effcol = m_topleft.x + ch;
|
||||
u32 effcol = m_topleft.x + ch;
|
||||
dest->byte = ' ';
|
||||
dest->attrib = DCA_ANCILLARY;
|
||||
if (m_section[1].contains(effcol))
|
||||
@ -297,13 +297,13 @@ void debug_view_memory::view_update()
|
||||
int spacing = posdata.m_spacing;
|
||||
|
||||
if (m_data_format <= 8) {
|
||||
uint64_t chunkdata;
|
||||
u64 chunkdata;
|
||||
bool ismapped = read(m_bytes_per_chunk, addrbyte + chunknum * m_bytes_per_chunk, chunkdata);
|
||||
dest = destrow + m_section[1].m_pos + 1 + chunkindex * spacing;
|
||||
for (int ch = 0; ch < posdata.m_spacing; ch++, dest++)
|
||||
if (dest >= destmin && dest < destmax)
|
||||
{
|
||||
uint8_t shift = posdata.m_shift[ch];
|
||||
u8 shift = posdata.m_shift[ch];
|
||||
if (shift < 64)
|
||||
dest->byte = ismapped ? "0123456789ABCDEF"[(chunkdata >> shift) & 0x0f] : '*';
|
||||
}
|
||||
@ -311,7 +311,7 @@ void debug_view_memory::view_update()
|
||||
else {
|
||||
int ch;
|
||||
char valuetext[64];
|
||||
uint64_t chunkdata = 0;
|
||||
u64 chunkdata = 0;
|
||||
floatx80 chunkdata80 = { 0, 0 };
|
||||
bool ismapped;
|
||||
|
||||
@ -324,14 +324,14 @@ void debug_view_memory::view_update()
|
||||
switch (m_data_format)
|
||||
{
|
||||
case 9:
|
||||
sprintf(valuetext, "%.8g", uint32_to_float((uint32_t)chunkdata));
|
||||
sprintf(valuetext, "%.8g", u32_to_float(u32(chunkdata)));
|
||||
break;
|
||||
case 10:
|
||||
sprintf(valuetext, "%.24g", uint64_to_double(chunkdata));
|
||||
sprintf(valuetext, "%.24g", u64_to_double(chunkdata));
|
||||
break;
|
||||
case 11:
|
||||
float64 f64 = floatx80_to_float64(chunkdata80);
|
||||
sprintf(valuetext, "%.24g", uint64_to_double(f64));
|
||||
sprintf(valuetext, "%.24g", u64_to_double(f64));
|
||||
break;
|
||||
}
|
||||
else {
|
||||
@ -357,7 +357,7 @@ void debug_view_memory::view_update()
|
||||
for (int ch = 0; ch < m_bytes_per_row; ch++, dest++)
|
||||
if (dest >= destmin && dest < destmax)
|
||||
{
|
||||
uint64_t chval;
|
||||
u64 chval;
|
||||
bool ismapped = read(1, addrbyte + ch, chval);
|
||||
dest->byte = (ismapped && isprint(chval)) ? chval : '.';
|
||||
}
|
||||
@ -395,7 +395,7 @@ void debug_view_memory::view_char(int chval)
|
||||
break;
|
||||
|
||||
case DCH_PUP:
|
||||
for (uint32_t delta = (m_visible.y - 2) * m_bytes_per_row; delta > 0; delta -= m_bytes_per_row)
|
||||
for (u32 delta = (m_visible.y - 2) * m_bytes_per_row; delta > 0; delta -= m_bytes_per_row)
|
||||
if (pos.m_address >= m_byte_offset + delta)
|
||||
{
|
||||
pos.m_address -= delta;
|
||||
@ -404,7 +404,7 @@ void debug_view_memory::view_char(int chval)
|
||||
break;
|
||||
|
||||
case DCH_PDOWN:
|
||||
for (uint32_t delta = (m_visible.y - 2) * m_bytes_per_row; delta > 0; delta -= m_bytes_per_row)
|
||||
for (u32 delta = (m_visible.y - 2) * m_bytes_per_row; delta > 0; delta -= m_bytes_per_row)
|
||||
if (pos.m_address <= m_maxaddr - delta)
|
||||
{
|
||||
pos.m_address += delta;
|
||||
@ -449,13 +449,13 @@ void debug_view_memory::view_char(int chval)
|
||||
if (hexchar == nullptr)
|
||||
break;
|
||||
|
||||
uint64_t data;
|
||||
u64 data;
|
||||
bool ismapped = read(m_bytes_per_chunk, pos.m_address, data);
|
||||
if (!ismapped)
|
||||
break;
|
||||
|
||||
data &= ~((uint64_t)0x0f << pos.m_shift);
|
||||
data |= (uint64_t)(hexchar - hexvals) << pos.m_shift;
|
||||
data &= ~(u64(0x0f) << pos.m_shift);
|
||||
data |= u64(hexchar - hexvals) << pos.m_shift;
|
||||
write(m_bytes_per_chunk, pos.m_address, data);
|
||||
// fall through to the right-arrow press
|
||||
}
|
||||
@ -549,7 +549,7 @@ void debug_view_memory::recompute()
|
||||
// if we are viewing a space with a minimum chunk size, clamp the bytes per chunk
|
||||
if (source.m_space != nullptr && source.m_space->byte_to_address(1) > 1)
|
||||
{
|
||||
uint32_t min_bytes_per_chunk = source.m_space->byte_to_address(1);
|
||||
u32 min_bytes_per_chunk = source.m_space->byte_to_address(1);
|
||||
while (m_bytes_per_chunk < min_bytes_per_chunk)
|
||||
{
|
||||
m_bytes_per_chunk *= 2;
|
||||
@ -590,7 +590,7 @@ void debug_view_memory::recompute()
|
||||
}
|
||||
|
||||
// derive total sizes from that
|
||||
m_total.y = ((uint64_t)m_maxaddr - (uint64_t)m_byte_offset + (uint64_t)m_bytes_per_row /*- 1*/) / m_bytes_per_row;
|
||||
m_total.y = (u64(m_maxaddr) - u64(m_byte_offset) + u64(m_bytes_per_row) /*- 1*/) / m_bytes_per_row;
|
||||
|
||||
// reset the current cursor position
|
||||
set_cursor_pos(pos);
|
||||
@ -732,7 +732,7 @@ void debug_view_memory::set_cursor_pos(cursor_pos pos)
|
||||
// read - generic memory view data reader
|
||||
//-------------------------------------------------
|
||||
|
||||
bool debug_view_memory::read(uint8_t size, offs_t offs, uint64_t &data)
|
||||
bool debug_view_memory::read(u8 size, offs_t offs, u64 &data)
|
||||
{
|
||||
const debug_view_memory_source &source = downcast<const debug_view_memory_source &>(*m_source);
|
||||
|
||||
@ -742,7 +742,7 @@ bool debug_view_memory::read(uint8_t size, offs_t offs, uint64_t &data)
|
||||
offs_t dummyaddr = offs;
|
||||
|
||||
bool ismapped = m_no_translation ? true : source.m_memintf->translate(source.m_space->spacenum(), TRANSLATE_READ_DEBUG, dummyaddr);
|
||||
data = ~(uint64_t)0;
|
||||
data = ~u64(0);
|
||||
if (ismapped)
|
||||
{
|
||||
switch (size)
|
||||
@ -761,7 +761,7 @@ bool debug_view_memory::read(uint8_t size, offs_t offs, uint64_t &data)
|
||||
{
|
||||
size /= 2;
|
||||
|
||||
uint64_t data0, data1;
|
||||
u64 data0, data1;
|
||||
bool ismapped = read(size, offs + 0 * size, data0);
|
||||
ismapped |= read(size, offs + 1 * size, data1);
|
||||
|
||||
@ -776,7 +776,7 @@ bool debug_view_memory::read(uint8_t size, offs_t offs, uint64_t &data)
|
||||
offs ^= source.m_offsetxor;
|
||||
if (offs >= source.m_length)
|
||||
return false;
|
||||
data = *((uint8_t *)source.m_base + offs);
|
||||
data = *((u8 *)source.m_base + offs);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -785,9 +785,9 @@ bool debug_view_memory::read(uint8_t size, offs_t offs, uint64_t &data)
|
||||
// read - read a 80 bit value
|
||||
//-------------------------------------------------
|
||||
|
||||
bool debug_view_memory::read(uint8_t size, offs_t offs, floatx80 &data)
|
||||
bool debug_view_memory::read(u8 size, offs_t offs, floatx80 &data)
|
||||
{
|
||||
uint64_t t;
|
||||
u64 t;
|
||||
bool mappedhi, mappedlo;
|
||||
const debug_view_memory_source &source = downcast<const debug_view_memory_source &>(*m_source);
|
||||
|
||||
@ -810,7 +810,7 @@ bool debug_view_memory::read(uint8_t size, offs_t offs, floatx80 &data)
|
||||
// write - generic memory view data writer
|
||||
//-------------------------------------------------
|
||||
|
||||
void debug_view_memory::write(uint8_t size, offs_t offs, uint64_t data)
|
||||
void debug_view_memory::write(u8 size, offs_t offs, u64 data)
|
||||
{
|
||||
const debug_view_memory_source &source = downcast<const debug_view_memory_source &>(*m_source);
|
||||
|
||||
@ -848,7 +848,7 @@ void debug_view_memory::write(uint8_t size, offs_t offs, uint64_t data)
|
||||
offs ^= source.m_offsetxor;
|
||||
if (offs >= source.m_length)
|
||||
return;
|
||||
*((uint8_t *)source.m_base + offs) = data;
|
||||
*((u8 *)source.m_base + offs) = data;
|
||||
|
||||
// hack for FD1094 editing
|
||||
#ifdef FD1094_HACK
|
||||
@ -880,7 +880,7 @@ void debug_view_memory::set_expression(const char *expression)
|
||||
// chunks displayed across a row
|
||||
//-------------------------------------------------
|
||||
|
||||
void debug_view_memory::set_chunks_per_row(uint32_t rowchunks)
|
||||
void debug_view_memory::set_chunks_per_row(u32 rowchunks)
|
||||
{
|
||||
if (rowchunks < 1)
|
||||
return;
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __DVMEMORY_H__
|
||||
#define __DVMEMORY_H__
|
||||
#ifndef MAME_EMU_DEBUG_DVMEMORY_H
|
||||
#define MAME_EMU_DEBUG_DVMEMORY_H
|
||||
|
||||
#include "softfloat/mamesf.h"
|
||||
#include "softfloat/softfloat.h"
|
||||
@ -37,7 +37,7 @@ private:
|
||||
offs_t m_length; // length of memory
|
||||
offs_t m_offsetxor; // XOR to apply to offsets
|
||||
endianness_t m_endianness; // endianness of memory
|
||||
uint8_t m_prefsize; // preferred bytes per chunk
|
||||
u8 m_prefsize; // preferred bytes per chunk
|
||||
};
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ public:
|
||||
// getters
|
||||
const char *expression() const { return m_expression.string(); }
|
||||
int get_data_format() { flush_updates(); return m_data_format; }
|
||||
uint32_t chunks_per_row() { flush_updates(); return m_chunks_per_row; }
|
||||
u32 chunks_per_row() { flush_updates(); return m_chunks_per_row; }
|
||||
bool reverse() const { return m_reverse_view; }
|
||||
bool ascii() const { return m_ascii_view; }
|
||||
bool physical() const { return m_no_translation; }
|
||||
@ -62,7 +62,7 @@ public:
|
||||
|
||||
// setters
|
||||
void set_expression(const char *expression);
|
||||
void set_chunks_per_row(uint32_t rowchunks);
|
||||
void set_chunks_per_row(u32 rowchunks);
|
||||
void set_data_format(int format); // 1-8 current values 9 32bit floating point
|
||||
void set_reverse(bool reverse);
|
||||
void set_ascii(bool reverse);
|
||||
@ -78,9 +78,9 @@ protected:
|
||||
private:
|
||||
struct cursor_pos
|
||||
{
|
||||
cursor_pos(offs_t address = 0, uint8_t shift = 0) : m_address(address), m_shift(shift) { }
|
||||
cursor_pos(offs_t address = 0, u8 shift = 0) : m_address(address), m_shift(shift) { }
|
||||
offs_t m_address;
|
||||
uint8_t m_shift;
|
||||
u8 m_shift;
|
||||
};
|
||||
|
||||
// internal helpers
|
||||
@ -95,36 +95,36 @@ private:
|
||||
void end_update_and_set_cursor_pos(cursor_pos pos) { set_cursor_pos(pos); end_update(); }
|
||||
|
||||
// memory access
|
||||
bool read(uint8_t size, offs_t offs, uint64_t &data);
|
||||
void write(uint8_t size, offs_t offs, uint64_t data);
|
||||
bool read(uint8_t size, offs_t offs, floatx80 &data);
|
||||
bool read(u8 size, offs_t offs, u64 &data);
|
||||
void write(u8 size, offs_t offs, u64 data);
|
||||
bool read(u8 size, offs_t offs, floatx80 &data);
|
||||
|
||||
// internal state
|
||||
debug_view_expression m_expression; // expression describing the start address
|
||||
uint32_t m_chunks_per_row; // number of chunks displayed per line
|
||||
uint8_t m_bytes_per_chunk; // bytes per chunk
|
||||
u32 m_chunks_per_row; // number of chunks displayed per line
|
||||
u8 m_bytes_per_chunk; // bytes per chunk
|
||||
int m_data_format; // 1-8 current values 9 32bit floating point
|
||||
bool m_reverse_view; // reverse-endian view?
|
||||
bool m_ascii_view; // display ASCII characters?
|
||||
bool m_no_translation; // don't run addresses through the cpu translation hook
|
||||
bool m_edit_enabled; // can modify contents ?
|
||||
offs_t m_maxaddr; // (derived) maximum address to display
|
||||
uint32_t m_bytes_per_row; // (derived) number of bytes displayed per line
|
||||
uint32_t m_byte_offset; // (derived) offset of starting visible byte
|
||||
u32 m_bytes_per_row; // (derived) number of bytes displayed per line
|
||||
u32 m_byte_offset; // (derived) offset of starting visible byte
|
||||
std::string m_addrformat; // (derived) format string to use to print addresses
|
||||
|
||||
struct section
|
||||
{
|
||||
bool contains(int x) const { return x >= m_pos && x < m_pos + m_width; }
|
||||
int32_t m_pos; /* starting position */
|
||||
int32_t m_width; /* width of this section */
|
||||
s32 m_pos; /* starting position */
|
||||
s32 m_width; /* width of this section */
|
||||
};
|
||||
section m_section[3]; // (derived) 3 sections to manage
|
||||
|
||||
struct memory_view_pos
|
||||
{
|
||||
uint8_t m_spacing; /* spacing between each entry */
|
||||
uint8_t m_shift[24]; /* shift for each character */
|
||||
u8 m_spacing; /* spacing between each entry */
|
||||
u8 m_shift[24]; /* shift for each character */
|
||||
};
|
||||
static const memory_view_pos s_memory_pos_table[12]; // table for rendering at different data formats
|
||||
|
||||
@ -133,4 +133,4 @@ private:
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
#endif // MAME_EMU_DEBUG_DVMEMORY_H
|
||||
|
@ -142,7 +142,7 @@ void debug_view_state::recompute()
|
||||
// count the entries and determine the maximum tag and value sizes
|
||||
std::size_t count = 0;
|
||||
std::size_t maxtaglen = 0;
|
||||
uint8_t maxvallen = 0;
|
||||
u8 maxvallen = 0;
|
||||
for (auto const &item : m_state_list)
|
||||
{
|
||||
count++;
|
||||
@ -152,8 +152,8 @@ void debug_view_state::recompute()
|
||||
|
||||
// set the current divider and total cols
|
||||
m_divider = unsigned(1U + maxtaglen + 1U);
|
||||
m_total.x = uint32_t(1U + maxtaglen + 2U + maxvallen + 1U);
|
||||
m_total.y = uint32_t(count);
|
||||
m_total.x = u32(1U + maxtaglen + 2U + maxvallen + 1U);
|
||||
m_total.y = u32(count);
|
||||
m_topleft.x = 0;
|
||||
m_topleft.y = 0;
|
||||
|
||||
@ -187,17 +187,17 @@ void debug_view_state::view_update()
|
||||
|
||||
// get cycle count if we have an execute interface
|
||||
debug_view_state_source const &source(downcast<debug_view_state_source const &>(*m_source));
|
||||
uint64_t const total_cycles(source.m_execintf ? source.m_execintf->total_cycles() : 0);
|
||||
u64 const total_cycles(source.m_execintf ? source.m_execintf->total_cycles() : 0);
|
||||
bool const cycles_changed(m_last_update != total_cycles);
|
||||
|
||||
// loop over rows
|
||||
auto it(m_state_list.begin());
|
||||
screen_device const *const screen(machine().first_screen());
|
||||
debug_view_char *dest(&m_viewdata[0]);
|
||||
for (int32_t index = 0, limit = m_topleft.y + m_visible.y; (index < limit) || (it != m_state_list.end()); ++index)
|
||||
for (s32 index = 0, limit = m_topleft.y + m_visible.y; (index < limit) || (it != m_state_list.end()); ++index)
|
||||
{
|
||||
bool const visible((index >= m_topleft.y) && (index < limit));
|
||||
uint32_t col(0);
|
||||
u32 col(0);
|
||||
|
||||
if (it != m_state_list.end())
|
||||
{
|
||||
@ -254,11 +254,11 @@ void debug_view_state::view_update()
|
||||
if (visible)
|
||||
{
|
||||
// see if we changed
|
||||
const uint8_t attrib(curitem.changed() ? DCA_CHANGED: DCA_NORMAL);
|
||||
const u8 attrib(curitem.changed() ? DCA_CHANGED: DCA_NORMAL);
|
||||
|
||||
// build up a string
|
||||
char temp[256];
|
||||
uint32_t len(0);
|
||||
u32 len(0);
|
||||
if (curitem.m_symbol.length() < (m_divider - 1))
|
||||
{
|
||||
memset(&temp[len], ' ', m_divider - 1 - curitem.m_symbol.length());
|
||||
@ -278,7 +278,7 @@ void debug_view_state::view_update()
|
||||
temp[len] = 0;
|
||||
|
||||
// copy data
|
||||
for (uint32_t effcol = m_topleft.x; (col < m_visible.x) && (effcol < len); ++dest, ++col)
|
||||
for (u32 effcol = m_topleft.x; (col < m_visible.x) && (effcol < len); ++dest, ++col)
|
||||
{
|
||||
dest->byte = temp[effcol++];
|
||||
dest->attrib = attrib | ((effcol <= m_divider) ? DCA_ANCILLARY : DCA_NORMAL);
|
||||
@ -305,7 +305,7 @@ void debug_view_state::view_update()
|
||||
// state_item - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
debug_view_state::state_item::state_item(int index, const char *name, uint8_t valuechars)
|
||||
debug_view_state::state_item::state_item(int index, const char *name, u8 valuechars)
|
||||
: m_lastval(0)
|
||||
, m_currval(0)
|
||||
, m_index(index)
|
||||
@ -319,7 +319,7 @@ debug_view_state::state_item::state_item(int index, const char *name, uint8_t va
|
||||
// update - update value and save previous
|
||||
//-------------------------------------------------
|
||||
|
||||
void debug_view_state::state_item::update(uint64_t newval, bool save)
|
||||
void debug_view_state::state_item::update(u64 newval, bool save)
|
||||
{
|
||||
if (save)
|
||||
m_lastval = m_currval;
|
||||
|
@ -53,24 +53,24 @@ private:
|
||||
class state_item
|
||||
{
|
||||
public:
|
||||
state_item(int index, const char *name, uint8_t valuechars);
|
||||
state_item(int index, const char *name, u8 valuechars);
|
||||
state_item(const state_item &) = default;
|
||||
state_item(state_item &&) = default;
|
||||
state_item &operator=(const state_item &) = default;
|
||||
state_item &operator=(state_item &&) = default;
|
||||
|
||||
uint64_t value() const { return m_currval; }
|
||||
u64 value() const { return m_currval; }
|
||||
bool changed() const { return m_lastval != m_currval; }
|
||||
int index() const { return m_index; }
|
||||
uint8_t value_length() const { return m_vallen; }
|
||||
u8 value_length() const { return m_vallen; }
|
||||
|
||||
void update(uint64_t newval, bool save);
|
||||
void update(u64 newval, bool save);
|
||||
|
||||
private:
|
||||
uint64_t m_lastval; // last value
|
||||
uint64_t m_currval; // current value
|
||||
u64 m_lastval; // last value
|
||||
u64 m_currval; // current value
|
||||
int m_index; // index
|
||||
uint8_t m_vallen; // number of value chars
|
||||
u8 m_vallen; // number of value chars
|
||||
|
||||
public:
|
||||
std::string m_symbol; // symbol
|
||||
@ -83,15 +83,15 @@ private:
|
||||
|
||||
// internal state
|
||||
int m_divider; // dividing column
|
||||
uint64_t m_last_update; // execution counter at last update
|
||||
u64 m_last_update; // execution counter at last update
|
||||
std::vector<state_item> m_state_list; // state data
|
||||
|
||||
// constants
|
||||
static const int REG_DIVIDER = -10;
|
||||
static const int REG_CYCLES = -11;
|
||||
static const int REG_BEAMX = -12;
|
||||
static const int REG_BEAMY = -13;
|
||||
static const int REG_FRAME = -14;
|
||||
static constexpr int REG_DIVIDER = -10;
|
||||
static constexpr int REG_CYCLES = -11;
|
||||
static constexpr int REG_BEAMX = -12;
|
||||
static constexpr int REG_BEAMY = -13;
|
||||
static constexpr int REG_FRAME = -14;
|
||||
};
|
||||
|
||||
|
||||
|
@ -53,7 +53,7 @@ void debug_view_textbuf::view_update()
|
||||
m_total.x = 80;
|
||||
|
||||
// determine the starting sequence number
|
||||
uint32_t curseq = 0;
|
||||
u32 curseq = 0;
|
||||
if (!m_at_bottom)
|
||||
{
|
||||
curseq = m_topseq;
|
||||
@ -72,16 +72,16 @@ void debug_view_textbuf::view_update()
|
||||
|
||||
// loop over visible rows
|
||||
debug_view_char *dest = &m_viewdata[0];
|
||||
for (uint32_t row = 0; row < m_visible.y; row++)
|
||||
for (u32 row = 0; row < m_visible.y; row++)
|
||||
{
|
||||
const char *line = text_buffer_get_seqnum_line(&m_textbuf, curseq++);
|
||||
uint32_t col = 0;
|
||||
u32 col = 0;
|
||||
|
||||
// if this visible row is valid, add it to the buffer
|
||||
if (line != nullptr)
|
||||
{
|
||||
size_t len = strlen(line);
|
||||
uint32_t effcol = m_topleft.x;
|
||||
u32 effcol = m_topleft.x;
|
||||
|
||||
// copy data
|
||||
while (col < m_visible.x && effcol < len)
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __DVTEXT_H__
|
||||
#define __DVTEXT_H__
|
||||
#ifndef MAME_EMU_DEBUG_DVTEXT_H
|
||||
#define MAME_EMU_DEBUG_DVTEXT_H
|
||||
|
||||
#include "debugvw.h"
|
||||
#include "textbuf.h"
|
||||
@ -37,8 +37,8 @@ protected:
|
||||
private:
|
||||
// internal state
|
||||
text_buffer & m_textbuf; /* pointer to the text buffer */
|
||||
bool m_at_bottom; /* are we tracking new stuff being added? */
|
||||
uint32_t m_topseq; /* sequence number of the top line */
|
||||
bool m_at_bottom; /* are we tracking new stuff being added? */
|
||||
u32 m_topseq; /* sequence number of the top line */
|
||||
};
|
||||
|
||||
|
||||
@ -58,4 +58,4 @@ class debug_view_log : public debug_view_textbuf
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
#endif // MAME_EMU_DEBUG_DVTEXT_H
|
||||
|
@ -300,7 +300,7 @@ void debug_view_watchpoints::view_update()
|
||||
pad_ostream_to_length(linebuf, tableBreaks[7]);
|
||||
|
||||
auto const &text(linebuf.vec());
|
||||
for (uint32_t i = m_topleft.x; i < (m_topleft.x + m_visible.x); i++, dest++)
|
||||
for (u32 i = m_topleft.x; i < (m_topleft.x + m_visible.x); i++, dest++)
|
||||
{
|
||||
dest->byte = (i < text.size()) ? text[i] : ' ';
|
||||
dest->attrib = DCA_ANCILLARY;
|
||||
@ -339,7 +339,7 @@ void debug_view_watchpoints::view_update()
|
||||
pad_ostream_to_length(linebuf, tableBreaks[7]);
|
||||
|
||||
auto const &text(linebuf.vec());
|
||||
for (uint32_t i = m_topleft.x; i < (m_topleft.x + m_visible.x); i++, dest++)
|
||||
for (u32 i = m_topleft.x; i < (m_topleft.x + m_visible.x); i++, dest++)
|
||||
{
|
||||
dest->byte = (i < text.size()) ? text[i] : ' ';
|
||||
dest->attrib = DCA_NORMAL;
|
||||
|
@ -112,24 +112,24 @@ class integer_symbol_entry : public symbol_entry
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
integer_symbol_entry(symbol_table &table, const char *name, symbol_table::read_write rw, uint64_t *ptr = nullptr);
|
||||
integer_symbol_entry(symbol_table &table, const char *name, uint64_t constval);
|
||||
integer_symbol_entry(symbol_table &table, const char *name, symbol_table::read_write rw, u64 *ptr = nullptr);
|
||||
integer_symbol_entry(symbol_table &table, const char *name, u64 constval);
|
||||
integer_symbol_entry(symbol_table &table, const char *name, void *ref, symbol_table::getter_func getter, symbol_table::setter_func setter);
|
||||
|
||||
// symbol access
|
||||
virtual bool is_lval() const override;
|
||||
virtual uint64_t value() const override;
|
||||
virtual void set_value(uint64_t newvalue) override;
|
||||
virtual u64 value() const override;
|
||||
virtual void set_value(u64 newvalue) override;
|
||||
|
||||
private:
|
||||
// internal helpers
|
||||
static uint64_t internal_getter(symbol_table &table, void *symref);
|
||||
static void internal_setter(symbol_table &table, void *symref, uint64_t value);
|
||||
static u64 internal_getter(symbol_table &table, void *symref);
|
||||
static void internal_setter(symbol_table &table, void *symref, u64 value);
|
||||
|
||||
// internal state
|
||||
symbol_table::getter_func m_getter;
|
||||
symbol_table::setter_func m_setter;
|
||||
uint64_t m_value;
|
||||
u64 m_value;
|
||||
};
|
||||
|
||||
|
||||
@ -142,16 +142,16 @@ public:
|
||||
|
||||
// symbol access
|
||||
virtual bool is_lval() const override;
|
||||
virtual uint64_t value() const override;
|
||||
virtual void set_value(uint64_t newvalue) override;
|
||||
virtual u64 value() const override;
|
||||
virtual void set_value(u64 newvalue) override;
|
||||
|
||||
// execution helper
|
||||
virtual uint64_t execute(int numparams, const uint64_t *paramlist);
|
||||
virtual u64 execute(int numparams, const u64 *paramlist);
|
||||
|
||||
private:
|
||||
// internal state
|
||||
uint16_t m_minparams;
|
||||
uint16_t m_maxparams;
|
||||
u16 m_minparams;
|
||||
u16 m_maxparams;
|
||||
symbol_table::execute_func m_execute;
|
||||
};
|
||||
|
||||
@ -231,7 +231,7 @@ symbol_entry::~symbol_entry()
|
||||
// integer_symbol_entry - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
integer_symbol_entry::integer_symbol_entry(symbol_table &table, const char *name, symbol_table::read_write rw, uint64_t *ptr)
|
||||
integer_symbol_entry::integer_symbol_entry(symbol_table &table, const char *name, symbol_table::read_write rw, u64 *ptr)
|
||||
: symbol_entry(table, SMT_INTEGER, name, (ptr == nullptr) ? &m_value : ptr),
|
||||
m_getter(internal_getter),
|
||||
m_setter((rw == symbol_table::READ_ONLY) ? nullptr : internal_setter),
|
||||
@ -240,7 +240,7 @@ integer_symbol_entry::integer_symbol_entry(symbol_table &table, const char *name
|
||||
}
|
||||
|
||||
|
||||
integer_symbol_entry::integer_symbol_entry(symbol_table &table, const char *name, uint64_t constval)
|
||||
integer_symbol_entry::integer_symbol_entry(symbol_table &table, const char *name, u64 constval)
|
||||
: symbol_entry(table, SMT_INTEGER, name, &m_value),
|
||||
m_getter(internal_getter),
|
||||
m_setter(nullptr),
|
||||
@ -272,7 +272,7 @@ bool integer_symbol_entry::is_lval() const
|
||||
// value - return the value of this symbol
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t integer_symbol_entry::value() const
|
||||
u64 integer_symbol_entry::value() const
|
||||
{
|
||||
return m_getter(m_table, m_ref);
|
||||
}
|
||||
@ -282,7 +282,7 @@ uint64_t integer_symbol_entry::value() const
|
||||
// set_value - set the value of this symbol
|
||||
//-------------------------------------------------
|
||||
|
||||
void integer_symbol_entry::set_value(uint64_t newvalue)
|
||||
void integer_symbol_entry::set_value(u64 newvalue)
|
||||
{
|
||||
if (m_setter != nullptr)
|
||||
m_setter(m_table, m_ref, newvalue);
|
||||
@ -296,9 +296,9 @@ void integer_symbol_entry::set_value(uint64_t newvalue)
|
||||
// returning the value of a variable
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t integer_symbol_entry::internal_getter(symbol_table &table, void *symref)
|
||||
u64 integer_symbol_entry::internal_getter(symbol_table &table, void *symref)
|
||||
{
|
||||
return *(uint64_t *)symref;
|
||||
return *(u64 *)symref;
|
||||
}
|
||||
|
||||
|
||||
@ -307,9 +307,9 @@ uint64_t integer_symbol_entry::internal_getter(symbol_table &table, void *symref
|
||||
// the value of a variable
|
||||
//-------------------------------------------------
|
||||
|
||||
void integer_symbol_entry::internal_setter(symbol_table &table, void *symref, uint64_t value)
|
||||
void integer_symbol_entry::internal_setter(symbol_table &table, void *symref, u64 value)
|
||||
{
|
||||
*(uint64_t *)symref = value;
|
||||
*(u64 *)symref = value;
|
||||
}
|
||||
|
||||
|
||||
@ -345,7 +345,7 @@ bool function_symbol_entry::is_lval() const
|
||||
// value - return the value of this symbol
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t function_symbol_entry::value() const
|
||||
u64 function_symbol_entry::value() const
|
||||
{
|
||||
throw emu_fatalerror("Symbol '%s' is a function and cannot be used in this context", m_name.c_str());
|
||||
}
|
||||
@ -355,7 +355,7 @@ uint64_t function_symbol_entry::value() const
|
||||
// set_value - set the value of this symbol
|
||||
//-------------------------------------------------
|
||||
|
||||
void function_symbol_entry::set_value(uint64_t newvalue)
|
||||
void function_symbol_entry::set_value(u64 newvalue)
|
||||
{
|
||||
throw emu_fatalerror("Symbol '%s' is a function and cannot be written", m_name.c_str());
|
||||
}
|
||||
@ -365,7 +365,7 @@ void function_symbol_entry::set_value(uint64_t newvalue)
|
||||
// execute - execute the function
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t function_symbol_entry::execute(int numparams, const uint64_t *paramlist)
|
||||
u64 function_symbol_entry::execute(int numparams, const u64 *paramlist)
|
||||
{
|
||||
if (numparams < m_minparams)
|
||||
throw emu_fatalerror("Function '%s' requires at least %d parameters", m_name.c_str(), m_minparams);
|
||||
@ -396,7 +396,7 @@ symbol_table::symbol_table(void *globalref, symbol_table *parent)
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// add - add a new uint64_t pointer symbol
|
||||
// add - add a new u64 pointer symbol
|
||||
//-------------------------------------------------
|
||||
|
||||
void symbol_table::configure_memory(void *param, valid_func valid, read_func read, write_func write)
|
||||
@ -409,10 +409,10 @@ void symbol_table::configure_memory(void *param, valid_func valid, read_func rea
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// add - add a new uint64_t pointer symbol
|
||||
// add - add a new u64 pointer symbol
|
||||
//-------------------------------------------------
|
||||
|
||||
void symbol_table::add(const char *name, read_write rw, uint64_t *ptr)
|
||||
void symbol_table::add(const char *name, read_write rw, u64 *ptr)
|
||||
{
|
||||
m_symlist.erase(name);
|
||||
m_symlist.emplace(name, std::make_unique<integer_symbol_entry>(*this, name, rw, ptr));
|
||||
@ -423,7 +423,7 @@ void symbol_table::add(const char *name, read_write rw, uint64_t *ptr)
|
||||
// add - add a new value symbol
|
||||
//-------------------------------------------------
|
||||
|
||||
void symbol_table::add(const char *name, uint64_t value)
|
||||
void symbol_table::add(const char *name, u64 value)
|
||||
{
|
||||
m_symlist.erase(name);
|
||||
m_symlist.emplace(name, std::make_unique<integer_symbol_entry>(*this, name, value));
|
||||
@ -474,7 +474,7 @@ symbol_entry *symbol_table::find_deep(const char *symbol)
|
||||
// value - return the value of a symbol
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t symbol_table::value(const char *symbol)
|
||||
u64 symbol_table::value(const char *symbol)
|
||||
{
|
||||
symbol_entry *entry = find_deep(symbol);
|
||||
return (entry != nullptr) ? entry->value() : 0;
|
||||
@ -485,7 +485,7 @@ uint64_t symbol_table::value(const char *symbol)
|
||||
// set_value - set the value of a symbol
|
||||
//-------------------------------------------------
|
||||
|
||||
void symbol_table::set_value(const char *symbol, uint64_t value)
|
||||
void symbol_table::set_value(const char *symbol, u64 value)
|
||||
{
|
||||
symbol_entry *entry = find_deep(symbol);
|
||||
if (entry != nullptr)
|
||||
@ -516,7 +516,7 @@ expression_error::error_code symbol_table::memory_valid(const char *name, expres
|
||||
// memory_value - return a value read from memory
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t symbol_table::memory_value(const char *name, expression_space space, uint32_t offset, int size)
|
||||
u64 symbol_table::memory_value(const char *name, expression_space space, u32 offset, int size)
|
||||
{
|
||||
// walk up the table hierarchy to find the owner
|
||||
for (symbol_table *symtable = this; symtable != nullptr; symtable = symtable->m_parent)
|
||||
@ -535,7 +535,7 @@ uint64_t symbol_table::memory_value(const char *name, expression_space space, ui
|
||||
// set_memory_value - write a value to memory
|
||||
//-------------------------------------------------
|
||||
|
||||
void symbol_table::set_memory_value(const char *name, expression_space space, uint32_t offset, int size, uint64_t value)
|
||||
void symbol_table::set_memory_value(const char *name, expression_space space, u32 offset, int size, u64 value)
|
||||
{
|
||||
// walk up the table hierarchy to find the owner
|
||||
for (symbol_table *symtable = this; symtable != nullptr; symtable = symtable->m_parent)
|
||||
@ -558,7 +558,7 @@ void symbol_table::set_memory_value(const char *name, expression_space space, ui
|
||||
// parsed_expression - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
parsed_expression::parsed_expression(symbol_table *symtable, const char *expression, uint64_t *result)
|
||||
parsed_expression::parsed_expression(symbol_table *symtable, const char *expression, u64 *result)
|
||||
: m_symtable(symtable),
|
||||
m_token_stack_ptr(0)
|
||||
{
|
||||
@ -627,7 +627,7 @@ void parsed_expression::print_tokens(FILE *out)
|
||||
break;
|
||||
|
||||
case parse_token::NUMBER:
|
||||
fprintf(out, "NUMBER: %08X%08X\n", (uint32_t)(token->value.i >> 32), (uint32_t)token->value.i);
|
||||
fprintf(out, "NUMBER: %08X%08X\n", (u32)(token->value.i >> 32), u32(token->value.i));
|
||||
break;
|
||||
|
||||
case parse_token::STRING:
|
||||
@ -635,7 +635,7 @@ void parsed_expression::print_tokens(FILE *out)
|
||||
break;
|
||||
|
||||
case parse_token::SYMBOL:
|
||||
fprintf(out, "SYMBOL: %08X%08X\n", (uint32_t)(token->value.i >> 32), (uint32_t)token->value.i);
|
||||
fprintf(out, "SYMBOL: %08X%08X\n", u32(token->value.i >> 32), u32(token->value.i));
|
||||
break;
|
||||
|
||||
case parse_token::OPERATOR:
|
||||
@ -708,7 +708,7 @@ void parsed_expression::parse_string_into_tokens()
|
||||
while (string[0] != 0)
|
||||
{
|
||||
// ignore any whitespace
|
||||
while (string[0] != 0 && isspace((uint8_t)string[0]))
|
||||
while (string[0] != 0 && isspace(u8(string[0])))
|
||||
string++;
|
||||
if (string[0] == 0)
|
||||
break;
|
||||
@ -717,7 +717,7 @@ void parsed_expression::parse_string_into_tokens()
|
||||
parse_token &token = m_tokenlist.append(*global_alloc(parse_token(string - stringstart)));
|
||||
|
||||
// switch off the first character
|
||||
switch (tolower((uint8_t)string[0]))
|
||||
switch (tolower(u8(string[0])))
|
||||
{
|
||||
case '(':
|
||||
string += 1, token.configure_operator(TVL_LPAREN, 0);
|
||||
@ -865,7 +865,7 @@ void parsed_expression::parse_symbol_or_number(parse_token &token, const char *&
|
||||
while (1)
|
||||
{
|
||||
static const char valid[] = "abcdefghijklmnopqrstuvwxyz0123456789_$#.:";
|
||||
char val = tolower((uint8_t)string[0]);
|
||||
char val = tolower(u8(string[0]));
|
||||
if (val == 0 || strchr(valid, val) == nullptr)
|
||||
break;
|
||||
buffer.append(&val, 1);
|
||||
@ -965,12 +965,12 @@ void parsed_expression::parse_symbol_or_number(parse_token &token, const char *&
|
||||
void parsed_expression::parse_number(parse_token &token, const char *string, int base, expression_error::error_code errcode)
|
||||
{
|
||||
// parse the actual value
|
||||
uint64_t value = 0;
|
||||
u64 value = 0;
|
||||
while (*string != 0)
|
||||
{
|
||||
// look up the number's value, stopping if not valid
|
||||
static const char numbers[] = "0123456789abcdef";
|
||||
const char *ptr = strchr(numbers, tolower((uint8_t)*string));
|
||||
const char *ptr = strchr(numbers, tolower(u8(*string)));
|
||||
if (ptr == nullptr)
|
||||
break;
|
||||
|
||||
@ -980,7 +980,7 @@ void parsed_expression::parse_number(parse_token &token, const char *string, int
|
||||
break;
|
||||
|
||||
// shift previous digits up and add in new digit
|
||||
value = (value * (uint64_t)base) + digit;
|
||||
value = (value * u64(base)) + digit;
|
||||
string++;
|
||||
}
|
||||
|
||||
@ -1001,7 +1001,7 @@ void parsed_expression::parse_quoted_char(parse_token &token, const char *&strin
|
||||
{
|
||||
// accumulate the value of the character token
|
||||
string++;
|
||||
uint64_t value = 0;
|
||||
u64 value = 0;
|
||||
while (string[0] != 0)
|
||||
{
|
||||
// allow '' to mean a nested single quote
|
||||
@ -1011,7 +1011,7 @@ void parsed_expression::parse_quoted_char(parse_token &token, const char *&strin
|
||||
break;
|
||||
string++;
|
||||
}
|
||||
value = (value << 8) | (uint8_t)*string++;
|
||||
value = (value << 8) | u8(*string++);
|
||||
}
|
||||
|
||||
// if we didn't find the ending quote, report an error
|
||||
@ -1388,7 +1388,7 @@ inline void parsed_expression::pop_token_rval(parse_token &token)
|
||||
// of tokens
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t parsed_expression::execute_tokens()
|
||||
u64 parsed_expression::execute_tokens()
|
||||
{
|
||||
// reset the token stack
|
||||
m_token_stack_ptr = 0;
|
||||
@ -1674,7 +1674,7 @@ parsed_expression::parse_token::parse_token(int offset)
|
||||
// for a SYMBOL token
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t parsed_expression::parse_token::get_lval_value(symbol_table *table)
|
||||
u64 parsed_expression::parse_token::get_lval_value(symbol_table *table)
|
||||
{
|
||||
// get the value of a symbol
|
||||
if (is_symbol())
|
||||
@ -1693,7 +1693,7 @@ uint64_t parsed_expression::parse_token::get_lval_value(symbol_table *table)
|
||||
// for a SYMBOL token
|
||||
//-------------------------------------------------
|
||||
|
||||
inline void parsed_expression::parse_token::set_lval_value(symbol_table *table, uint64_t value)
|
||||
inline void parsed_expression::parse_token::set_lval_value(symbol_table *table, u64 value)
|
||||
{
|
||||
// set the value of a symbol
|
||||
if (is_symbol())
|
||||
@ -1713,7 +1713,7 @@ inline void parsed_expression::parse_token::set_lval_value(symbol_table *table,
|
||||
void parsed_expression::execute_function(parse_token &token)
|
||||
{
|
||||
// pop off all pushed parameters
|
||||
uint64_t funcparams[MAX_FUNCTION_PARAMS];
|
||||
u64 funcparams[MAX_FUNCTION_PARAMS];
|
||||
symbol_entry *symbol = nullptr;
|
||||
int paramcount = 0;
|
||||
while (paramcount < MAX_FUNCTION_PARAMS)
|
||||
|
@ -129,8 +129,8 @@ public:
|
||||
|
||||
// symbol access
|
||||
virtual bool is_lval() const = 0;
|
||||
virtual uint64_t value() const = 0;
|
||||
virtual void set_value(uint64_t newvalue) = 0;
|
||||
virtual u64 value() const = 0;
|
||||
virtual void set_value(u64 newvalue) = 0;
|
||||
|
||||
protected:
|
||||
// internal state
|
||||
@ -150,16 +150,16 @@ class symbol_table
|
||||
{
|
||||
public:
|
||||
// callback functions for getting/setting a symbol value
|
||||
typedef std::function<uint64_t(symbol_table &table, void *symref)> getter_func;
|
||||
typedef std::function<void(symbol_table &table, void *symref, uint64_t value)> setter_func;
|
||||
typedef std::function<u64(symbol_table &table, void *symref)> getter_func;
|
||||
typedef std::function<void(symbol_table &table, void *symref, u64 value)> setter_func;
|
||||
|
||||
// callback functions for function execution
|
||||
typedef std::function<uint64_t(symbol_table &table, void *symref, int numparams, const uint64_t *paramlist)> execute_func;
|
||||
typedef std::function<u64(symbol_table &table, void *symref, int numparams, const u64 *paramlist)> execute_func;
|
||||
|
||||
// callback functions for memory reads/writes
|
||||
typedef std::function<expression_error::error_code(void *cbparam, const char *name, expression_space space)> valid_func;
|
||||
typedef std::function<uint64_t(void *cbparam, const char *name, expression_space space, uint32_t offset, int size)> read_func;
|
||||
typedef std::function<void(void *cbparam, const char *name, expression_space space, uint32_t offset, int size, uint64_t value)> write_func;
|
||||
typedef std::function<u64(void *cbparam, const char *name, expression_space space, u32 offset, int size)> read_func;
|
||||
typedef std::function<void(void *cbparam, const char *name, expression_space space, u32 offset, int size, u64 value)> write_func;
|
||||
|
||||
enum read_write
|
||||
{
|
||||
@ -179,21 +179,21 @@ public:
|
||||
void configure_memory(void *param, valid_func valid, read_func read, write_func write);
|
||||
|
||||
// symbol access
|
||||
void add(const char *name, read_write rw, uint64_t *ptr = nullptr);
|
||||
void add(const char *name, uint64_t constvalue);
|
||||
void add(const char *name, read_write rw, u64 *ptr = nullptr);
|
||||
void add(const char *name, u64 constvalue);
|
||||
void add(const char *name, void *ref, getter_func getter, setter_func setter = nullptr);
|
||||
void add(const char *name, void *ref, int minparams, int maxparams, execute_func execute);
|
||||
symbol_entry *find(const char *name) const { if (name) { auto search = m_symlist.find(name); if (search != m_symlist.end()) return search->second.get(); else return nullptr; } else return nullptr; }
|
||||
symbol_entry *find_deep(const char *name);
|
||||
|
||||
// value getter/setter
|
||||
uint64_t value(const char *symbol);
|
||||
void set_value(const char *symbol, uint64_t value);
|
||||
u64 value(const char *symbol);
|
||||
void set_value(const char *symbol, u64 value);
|
||||
|
||||
// memory accessors
|
||||
expression_error::error_code memory_valid(const char *name, expression_space space);
|
||||
uint64_t memory_value(const char *name, expression_space space, uint32_t offset, int size);
|
||||
void set_memory_value(const char *name, expression_space space, uint32_t offset, int size, uint64_t value);
|
||||
u64 memory_value(const char *name, expression_space space, u32 offset, int size);
|
||||
void set_memory_value(const char *name, expression_space space, u32 offset, int size, u64 value);
|
||||
|
||||
private:
|
||||
// internal state
|
||||
@ -216,7 +216,7 @@ class parsed_expression
|
||||
public:
|
||||
// construction/destruction
|
||||
parsed_expression(const parsed_expression &src) { copy(src); }
|
||||
parsed_expression(symbol_table *symtable = nullptr, const char *expression = nullptr, uint64_t *result = nullptr);
|
||||
parsed_expression(symbol_table *symtable = nullptr, const char *expression = nullptr, u64 *result = nullptr);
|
||||
|
||||
// operators
|
||||
parsed_expression &operator=(const parsed_expression &src) { copy(src); return *this; }
|
||||
@ -231,7 +231,7 @@ public:
|
||||
|
||||
// execution
|
||||
void parse(const char *string);
|
||||
uint64_t execute() { return execute_tokens(); }
|
||||
u64 execute() { return execute_tokens(); }
|
||||
|
||||
private:
|
||||
// a single token
|
||||
@ -279,15 +279,15 @@ private:
|
||||
bool is_memory() const { return (m_type == MEMORY); }
|
||||
bool is_symbol() const { return (m_type == SYMBOL); }
|
||||
bool is_operator() const { return (m_type == OPERATOR); }
|
||||
bool is_operator(uint8_t type) const { return (m_type == OPERATOR && optype() == type); }
|
||||
bool is_operator(u8 type) const { return (m_type == OPERATOR && optype() == type); }
|
||||
bool is_lval() const { return ((m_type == SYMBOL && m_symbol->is_lval()) || m_type == MEMORY); }
|
||||
|
||||
uint64_t value() const { assert(m_type == NUMBER); return m_value; }
|
||||
uint32_t address() const { assert(m_type == MEMORY); return m_value; }
|
||||
u64 value() const { assert(m_type == NUMBER); return m_value; }
|
||||
u32 address() const { assert(m_type == MEMORY); return m_value; }
|
||||
symbol_entry *symbol() const { assert(m_type == SYMBOL); return m_symbol; }
|
||||
|
||||
uint8_t optype() const { assert(m_type == OPERATOR); return (m_flags & TIN_OPTYPE_MASK) >> TIN_OPTYPE_SHIFT; }
|
||||
uint8_t precedence() const { assert(m_type == OPERATOR); return (m_flags & TIN_PRECEDENCE_MASK) >> TIN_PRECEDENCE_SHIFT; }
|
||||
u8 optype() const { assert(m_type == OPERATOR); return (m_flags & TIN_OPTYPE_MASK) >> TIN_OPTYPE_SHIFT; }
|
||||
u8 precedence() const { assert(m_type == OPERATOR); return (m_flags & TIN_PRECEDENCE_MASK) >> TIN_PRECEDENCE_SHIFT; }
|
||||
bool is_function_separator() const { assert(m_type == OPERATOR); return ((m_flags & TIN_FUNCTION_MASK) != 0); }
|
||||
bool right_to_left() const { assert(m_type == OPERATOR); return ((m_flags & TIN_RIGHT_TO_LEFT_MASK) != 0); }
|
||||
expression_space memory_space() const { assert(m_type == OPERATOR || m_type == MEMORY); return expression_space((m_flags & TIN_MEMORY_SPACE_MASK) >> TIN_MEMORY_SPACE_SHIFT); }
|
||||
@ -297,11 +297,11 @@ private:
|
||||
parse_token &set_offset(int offset) { m_offset = offset; return *this; }
|
||||
parse_token &set_offset(const parse_token &src) { m_offset = src.m_offset; return *this; }
|
||||
parse_token &set_offset(const parse_token &src1, const parse_token &src2) { m_offset = std::min(src1.m_offset, src2.m_offset); return *this; }
|
||||
parse_token &configure_number(uint64_t value) { m_type = NUMBER; m_value = value; return *this; }
|
||||
parse_token &configure_number(u64 value) { m_type = NUMBER; m_value = value; return *this; }
|
||||
parse_token &configure_string(const char *string) { m_type = STRING; m_string = string; return *this; }
|
||||
parse_token &configure_memory(uint32_t address, parse_token &memoryat) { m_type = MEMORY; m_value = address; m_flags = memoryat.m_flags; m_string = memoryat.m_string; return *this; }
|
||||
parse_token &configure_memory(u32 address, parse_token &memoryat) { m_type = MEMORY; m_value = address; m_flags = memoryat.m_flags; m_string = memoryat.m_string; return *this; }
|
||||
parse_token &configure_symbol(symbol_entry &symbol) { m_type = SYMBOL; m_symbol = &symbol; return *this; }
|
||||
parse_token &configure_operator(uint8_t optype, uint8_t precedence)
|
||||
parse_token &configure_operator(u8 optype, u8 precedence)
|
||||
{ m_type = OPERATOR; m_flags = ((optype << TIN_OPTYPE_SHIFT) & TIN_OPTYPE_MASK) | ((precedence << TIN_PRECEDENCE_SHIFT) & TIN_PRECEDENCE_MASK); return *this; }
|
||||
|
||||
parse_token &set_function_separator() { assert(m_type == OPERATOR); m_flags |= TIN_FUNCTION_MASK; return *this; }
|
||||
@ -311,16 +311,16 @@ private:
|
||||
parse_token &set_memory_source(const char *string) { assert(m_type == OPERATOR || m_type == MEMORY); m_string = string; return *this; }
|
||||
|
||||
// access
|
||||
uint64_t get_lval_value(symbol_table *symtable);
|
||||
void set_lval_value(symbol_table *symtable, uint64_t value);
|
||||
u64 get_lval_value(symbol_table *symtable);
|
||||
void set_lval_value(symbol_table *symtable, u64 value);
|
||||
|
||||
private:
|
||||
// internal state
|
||||
parse_token * m_next; // next token in list
|
||||
token_type m_type; // type of token
|
||||
int m_offset; // offset within the string
|
||||
uint64_t m_value; // integral value
|
||||
uint32_t m_flags; // additional flags/info
|
||||
u64 m_value; // integral value
|
||||
u32 m_flags; // additional flags/info
|
||||
const char * m_string; // associated string
|
||||
symbol_entry * m_symbol; // symbol pointer
|
||||
};
|
||||
@ -366,7 +366,7 @@ private:
|
||||
parse_token *peek_token(int count);
|
||||
void pop_token_lval(parse_token &token);
|
||||
void pop_token_rval(parse_token &token);
|
||||
uint64_t execute_tokens();
|
||||
u64 execute_tokens();
|
||||
void execute_function(parse_token &token);
|
||||
|
||||
// constants
|
||||
|
@ -27,16 +27,16 @@
|
||||
|
||||
struct text_buffer
|
||||
{
|
||||
char * buffer;
|
||||
int32_t * lineoffs;
|
||||
int32_t bufsize;
|
||||
int32_t bufstart;
|
||||
int32_t bufend;
|
||||
int32_t linesize;
|
||||
int32_t linestart;
|
||||
int32_t lineend;
|
||||
uint32_t linestartseq;
|
||||
int32_t maxwidth;
|
||||
char * buffer;
|
||||
s32 * lineoffs;
|
||||
s32 bufsize;
|
||||
s32 bufstart;
|
||||
s32 bufend;
|
||||
s32 linesize;
|
||||
s32 linestart;
|
||||
s32 lineend;
|
||||
u32 linestartseq;
|
||||
s32 maxwidth;
|
||||
};
|
||||
|
||||
|
||||
@ -50,9 +50,9 @@ struct text_buffer
|
||||
currently held in the buffer
|
||||
-------------------------------------------------*/
|
||||
|
||||
static inline int32_t buffer_used(text_buffer *text)
|
||||
static inline s32 buffer_used(text_buffer *text)
|
||||
{
|
||||
int32_t used = text->bufend - text->bufstart;
|
||||
s32 used = text->bufend - text->bufstart;
|
||||
if (used < 0)
|
||||
used += text->bufsize;
|
||||
return used;
|
||||
@ -64,7 +64,7 @@ static inline int32_t buffer_used(text_buffer *text)
|
||||
available in the buffer
|
||||
-------------------------------------------------*/
|
||||
|
||||
static inline int32_t buffer_space(text_buffer *text)
|
||||
static inline s32 buffer_space(text_buffer *text)
|
||||
{
|
||||
return text->bufsize - buffer_used(text);
|
||||
}
|
||||
@ -81,7 +81,7 @@ static inline int32_t buffer_space(text_buffer *text)
|
||||
text_buffer_alloc - allocate a new text buffer
|
||||
-------------------------------------------------*/
|
||||
|
||||
text_buffer *text_buffer_alloc(uint32_t bytes, uint32_t lines)
|
||||
text_buffer *text_buffer_alloc(u32 bytes, u32 lines)
|
||||
{
|
||||
text_buffer *text;
|
||||
|
||||
@ -99,7 +99,7 @@ text_buffer *text_buffer_alloc(uint32_t bytes, uint32_t lines)
|
||||
}
|
||||
|
||||
/* allocate memory for the lines array */
|
||||
text->lineoffs = global_alloc_array_nothrow(int32_t, lines);
|
||||
text->lineoffs = global_alloc_array_nothrow(s32, lines);
|
||||
if (!text->lineoffs)
|
||||
{
|
||||
global_free_array(text->buffer);
|
||||
@ -179,11 +179,11 @@ void text_buffer_print(text_buffer *text, const char *data)
|
||||
|
||||
void text_buffer_print_wrap(text_buffer *text, const char *data, int wrapcol)
|
||||
{
|
||||
int32_t stopcol = (wrapcol < MAX_LINE_LENGTH) ? wrapcol : MAX_LINE_LENGTH;
|
||||
int32_t needed_space;
|
||||
s32 stopcol = (wrapcol < MAX_LINE_LENGTH) ? wrapcol : MAX_LINE_LENGTH;
|
||||
s32 needed_space;
|
||||
|
||||
/* we need to ensure there is enough space for this string plus enough for the max line length */
|
||||
needed_space = (int32_t)strlen(data) + MAX_LINE_LENGTH;
|
||||
needed_space = s32(strlen(data)) + MAX_LINE_LENGTH;
|
||||
|
||||
/* make space in the buffer if we need to */
|
||||
while (buffer_space(text) < needed_space && text->linestart != text->lineend)
|
||||
@ -278,7 +278,7 @@ void text_buffer_print_wrap(text_buffer *text, const char *data, int wrapcol)
|
||||
width of all lines seen so far
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint32_t text_buffer_max_width(text_buffer *text)
|
||||
u32 text_buffer_max_width(text_buffer *text)
|
||||
{
|
||||
return text->maxwidth;
|
||||
}
|
||||
@ -289,9 +289,9 @@ uint32_t text_buffer_max_width(text_buffer *text)
|
||||
lines in the text buffer
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint32_t text_buffer_num_lines(text_buffer *text)
|
||||
u32 text_buffer_num_lines(text_buffer *text)
|
||||
{
|
||||
int32_t lines = text->lineend + 1 - text->linestart;
|
||||
s32 lines = text->lineend + 1 - text->linestart;
|
||||
if (lines <= 0)
|
||||
lines += text->linesize;
|
||||
return lines;
|
||||
@ -303,7 +303,7 @@ uint32_t text_buffer_num_lines(text_buffer *text)
|
||||
line index into a sequence number
|
||||
-------------------------------------------------*/
|
||||
|
||||
uint32_t text_buffer_line_index_to_seqnum(text_buffer *text, uint32_t index)
|
||||
u32 text_buffer_line_index_to_seqnum(text_buffer *text, u32 index)
|
||||
{
|
||||
return text->linestartseq + index;
|
||||
}
|
||||
@ -314,10 +314,10 @@ uint32_t text_buffer_line_index_to_seqnum(text_buffer *text, uint32_t index)
|
||||
an indexed line in the buffer
|
||||
-------------------------------------------------*/
|
||||
|
||||
const char *text_buffer_get_seqnum_line(text_buffer *text, uint32_t seqnum)
|
||||
const char *text_buffer_get_seqnum_line(text_buffer *text, u32 seqnum)
|
||||
{
|
||||
uint32_t numlines = text_buffer_num_lines(text);
|
||||
uint32_t index = seqnum - text->linestartseq;
|
||||
u32 numlines = text_buffer_num_lines(text);
|
||||
u32 index = seqnum - text->linestartseq;
|
||||
if (index >= numlines)
|
||||
return nullptr;
|
||||
return &text->buffer[text->lineoffs[(text->linestart + index) % text->linesize]];
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef __TEXTBUF_H__
|
||||
#define __TEXTBUF_H__
|
||||
#ifndef MAME_EMU_DEBUG_TEXTBUF_H
|
||||
#define MAME_EMU_DEBUG_TEXTBUF_H
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
@ -25,7 +25,7 @@ struct text_buffer;
|
||||
***************************************************************************/
|
||||
|
||||
/* allocate a new text buffer */
|
||||
text_buffer *text_buffer_alloc(uint32_t bytes, uint32_t lines);
|
||||
text_buffer *text_buffer_alloc(u32 bytes, u32 lines);
|
||||
|
||||
/* free a text buffer */
|
||||
void text_buffer_free(text_buffer *text);
|
||||
@ -40,16 +40,16 @@ void text_buffer_print(text_buffer *text, const char *data);
|
||||
void text_buffer_print_wrap(text_buffer *text, const char *data, int wrapcol);
|
||||
|
||||
/* get the maximum width of lines seen so far */
|
||||
uint32_t text_buffer_max_width(text_buffer *text);
|
||||
u32 text_buffer_max_width(text_buffer *text);
|
||||
|
||||
/* get the current number of lines in the buffer */
|
||||
uint32_t text_buffer_num_lines(text_buffer *text);
|
||||
u32 text_buffer_num_lines(text_buffer *text);
|
||||
|
||||
/* get an absolute sequence number for a given line */
|
||||
uint32_t text_buffer_line_index_to_seqnum(text_buffer *text, uint32_t index);
|
||||
u32 text_buffer_line_index_to_seqnum(text_buffer *text, u32 index);
|
||||
|
||||
/* get a sequenced line from the text buffer */
|
||||
const char *text_buffer_get_seqnum_line(text_buffer *text, uint32_t seqnum);
|
||||
const char *text_buffer_get_seqnum_line(text_buffer *text, u32 seqnum);
|
||||
|
||||
|
||||
#endif /* __TEXTBUF_H__ */
|
||||
#endif /* MAME_EMU_DEBUG_TEXTBUF_H */
|
||||
|
@ -20,7 +20,7 @@
|
||||
// devcb_base - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
devcb_base::devcb_base(device_t &device, uint64_t defmask)
|
||||
devcb_base::devcb_base(device_t &device, u64 defmask)
|
||||
: m_device(device),
|
||||
m_rshift(0),
|
||||
m_mask(defmask),
|
||||
@ -44,7 +44,7 @@ void devcb_base::reset(callback_type type)
|
||||
m_space = nullptr;
|
||||
m_target.ptr = nullptr;
|
||||
m_rshift = 0;
|
||||
m_mask = ~U64(0);
|
||||
m_mask = ~u64(0);
|
||||
}
|
||||
|
||||
|
||||
@ -107,7 +107,7 @@ void devcb_base::resolve_space()
|
||||
// devcb_read_base - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
devcb_read_base::devcb_read_base(device_t &device, uint64_t defmask)
|
||||
devcb_read_base::devcb_read_base(device_t &device, u64 defmask)
|
||||
: devcb_base(device, defmask),
|
||||
m_adapter(nullptr)
|
||||
{
|
||||
@ -221,7 +221,7 @@ void devcb_read_base::resolve()
|
||||
// the given value
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb_read_base::resolve_safe(uint64_t none_constant_value)
|
||||
void devcb_read_base::resolve_safe(u64 none_constant_value)
|
||||
{
|
||||
// convert to a constant if none specified
|
||||
if (m_type == CALLBACK_NONE)
|
||||
@ -238,7 +238,7 @@ void devcb_read_base::resolve_safe(uint64_t none_constant_value)
|
||||
// unresolved adapter
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t devcb_read_base::read_unresolved_adapter(address_space &space, offs_t offset, uint64_t mask)
|
||||
u64 devcb_read_base::read_unresolved_adapter(address_space &space, offs_t offset, u64 mask)
|
||||
{
|
||||
throw emu_fatalerror("Attempted to read through an unresolved devcb item");
|
||||
}
|
||||
@ -248,7 +248,7 @@ uint64_t devcb_read_base::read_unresolved_adapter(address_space &space, offs_t o
|
||||
// read_line_adapter - read from a line delegate
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t devcb_read_base::read_line_adapter(address_space &space, offs_t offset, uint64_t mask)
|
||||
u64 devcb_read_base::read_line_adapter(address_space &space, offs_t offset, u64 mask)
|
||||
{
|
||||
return shift_mask_xor(m_readline() & 1);
|
||||
}
|
||||
@ -258,7 +258,7 @@ uint64_t devcb_read_base::read_line_adapter(address_space &space, offs_t offset,
|
||||
// read8_adapter - read from an 8-bit delegate
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t devcb_read_base::read8_adapter(address_space &space, offs_t offset, uint64_t mask)
|
||||
u64 devcb_read_base::read8_adapter(address_space &space, offs_t offset, u64 mask)
|
||||
{
|
||||
return shift_mask_xor(m_read8(space, offset, unshift_mask(mask)));
|
||||
}
|
||||
@ -268,7 +268,7 @@ uint64_t devcb_read_base::read8_adapter(address_space &space, offs_t offset, uin
|
||||
// read16_adapter - read from a 16-bit delegate
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t devcb_read_base::read16_adapter(address_space &space, offs_t offset, uint64_t mask)
|
||||
u64 devcb_read_base::read16_adapter(address_space &space, offs_t offset, u64 mask)
|
||||
{
|
||||
return shift_mask_xor(m_read16(space, offset, unshift_mask(mask)));
|
||||
}
|
||||
@ -278,7 +278,7 @@ uint64_t devcb_read_base::read16_adapter(address_space &space, offs_t offset, ui
|
||||
// read32_adapter - read from a 32-bit delegate
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t devcb_read_base::read32_adapter(address_space &space, offs_t offset, uint64_t mask)
|
||||
u64 devcb_read_base::read32_adapter(address_space &space, offs_t offset, u64 mask)
|
||||
{
|
||||
return shift_mask_xor(m_read32(space, offset, unshift_mask(mask)));
|
||||
}
|
||||
@ -288,7 +288,7 @@ uint64_t devcb_read_base::read32_adapter(address_space &space, offs_t offset, ui
|
||||
// read64_adapter - read from a 64-bit delegate
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t devcb_read_base::read64_adapter(address_space &space, offs_t offset, uint64_t mask)
|
||||
u64 devcb_read_base::read64_adapter(address_space &space, offs_t offset, u64 mask)
|
||||
{
|
||||
return shift_mask_xor(m_read64(space, offset, unshift_mask(mask)));
|
||||
}
|
||||
@ -298,7 +298,7 @@ uint64_t devcb_read_base::read64_adapter(address_space &space, offs_t offset, ui
|
||||
// read_ioport - read from an I/O port
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t devcb_read_base::read_ioport_adapter(address_space &space, offs_t offset, uint64_t mask)
|
||||
u64 devcb_read_base::read_ioport_adapter(address_space &space, offs_t offset, u64 mask)
|
||||
{
|
||||
return shift_mask_xor(m_target.ioport->read());
|
||||
}
|
||||
@ -309,7 +309,7 @@ uint64_t devcb_read_base::read_ioport_adapter(address_space &space, offs_t offse
|
||||
// constant
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t devcb_read_base::read_logged_adapter(address_space &space, offs_t offset, uint64_t mask)
|
||||
u64 devcb_read_base::read_logged_adapter(address_space &space, offs_t offset, u64 mask)
|
||||
{
|
||||
m_device.logerror("%s: read %s\n", m_device.machine().describe_context(), m_target_tag);
|
||||
return shift_mask_xor(m_target_int);
|
||||
@ -320,7 +320,7 @@ uint64_t devcb_read_base::read_logged_adapter(address_space &space, offs_t offse
|
||||
// read_constant - read from a constant
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t devcb_read_base::read_constant_adapter(address_space &space, offs_t offset, uint64_t mask)
|
||||
u64 devcb_read_base::read_constant_adapter(address_space &space, offs_t offset, u64 mask)
|
||||
{
|
||||
return shift_mask_xor(m_target_int);
|
||||
}
|
||||
@ -335,7 +335,7 @@ uint64_t devcb_read_base::read_constant_adapter(address_space &space, offs_t off
|
||||
// devcb_write_base - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
devcb_write_base::devcb_write_base(device_t &device, uint64_t defmask)
|
||||
devcb_write_base::devcb_write_base(device_t &device, u64 defmask)
|
||||
: devcb_base(device, defmask),
|
||||
m_adapter(nullptr)
|
||||
{
|
||||
@ -458,7 +458,7 @@ void devcb_write_base::resolve_safe()
|
||||
// unresolved adapter
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb_write_base::write_unresolved_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask)
|
||||
void devcb_write_base::write_unresolved_adapter(address_space &space, offs_t offset, u64 data, u64 mask)
|
||||
{
|
||||
throw emu_fatalerror("Attempted to write through an unresolved devcb item");
|
||||
}
|
||||
@ -468,7 +468,7 @@ void devcb_write_base::write_unresolved_adapter(address_space &space, offs_t off
|
||||
// write_line_adapter - write from a line delegate
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb_write_base::write_line_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask)
|
||||
void devcb_write_base::write_line_adapter(address_space &space, offs_t offset, u64 data, u64 mask)
|
||||
{
|
||||
m_writeline(unshift_mask_xor(data) & 1);
|
||||
}
|
||||
@ -478,7 +478,7 @@ void devcb_write_base::write_line_adapter(address_space &space, offs_t offset, u
|
||||
// write8_adapter - write from an 8-bit delegate
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb_write_base::write8_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask)
|
||||
void devcb_write_base::write8_adapter(address_space &space, offs_t offset, u64 data, u64 mask)
|
||||
{
|
||||
m_write8(space, offset, unshift_mask_xor(data), unshift_mask(mask));
|
||||
}
|
||||
@ -488,7 +488,7 @@ void devcb_write_base::write8_adapter(address_space &space, offs_t offset, uint6
|
||||
// write16_adapter - write from a 16-bit delegate
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb_write_base::write16_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask)
|
||||
void devcb_write_base::write16_adapter(address_space &space, offs_t offset, u64 data, u64 mask)
|
||||
{
|
||||
m_write16(space, offset, unshift_mask_xor(data), unshift_mask(mask));
|
||||
}
|
||||
@ -498,7 +498,7 @@ void devcb_write_base::write16_adapter(address_space &space, offs_t offset, uint
|
||||
// write32_adapter - write from a 32-bit delegate
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb_write_base::write32_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask)
|
||||
void devcb_write_base::write32_adapter(address_space &space, offs_t offset, u64 data, u64 mask)
|
||||
{
|
||||
m_write32(space, offset, unshift_mask_xor(data), unshift_mask(mask));
|
||||
}
|
||||
@ -508,7 +508,7 @@ void devcb_write_base::write32_adapter(address_space &space, offs_t offset, uint
|
||||
// write64_adapter - write from a 64-bit delegate
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb_write_base::write64_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask)
|
||||
void devcb_write_base::write64_adapter(address_space &space, offs_t offset, u64 data, u64 mask)
|
||||
{
|
||||
m_write64(space, offset, unshift_mask_xor(data), unshift_mask(mask));
|
||||
}
|
||||
@ -518,7 +518,7 @@ void devcb_write_base::write64_adapter(address_space &space, offs_t offset, uint
|
||||
// write_ioport - write from an I/O port
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb_write_base::write_ioport_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask)
|
||||
void devcb_write_base::write_ioport_adapter(address_space &space, offs_t offset, u64 data, u64 mask)
|
||||
{
|
||||
if (m_target.ioport)
|
||||
m_target.ioport->write(unshift_mask_xor(data));
|
||||
@ -530,7 +530,7 @@ void devcb_write_base::write_ioport_adapter(address_space &space, offs_t offset,
|
||||
// adapter
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb_write_base::write_logged_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask)
|
||||
void devcb_write_base::write_logged_adapter(address_space &space, offs_t offset, u64 data, u64 mask)
|
||||
{
|
||||
m_device.logerror("%s: unresolved devcb write\n", m_device.machine().describe_context());
|
||||
}
|
||||
@ -540,7 +540,7 @@ void devcb_write_base::write_logged_adapter(address_space &space, offs_t offset,
|
||||
// write_constant - write from a constant
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb_write_base::write_noop_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask)
|
||||
void devcb_write_base::write_noop_adapter(address_space &space, offs_t offset, u64 data, u64 mask)
|
||||
{
|
||||
// constant for writes is a no-op
|
||||
}
|
||||
@ -551,7 +551,7 @@ void devcb_write_base::write_noop_adapter(address_space &space, offs_t offset, u
|
||||
// input line
|
||||
//-------------------------------------------------
|
||||
|
||||
void devcb_write_base::write_inputline_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask)
|
||||
void devcb_write_base::write_inputline_adapter(address_space &space, offs_t offset, u64 data, u64 mask)
|
||||
{
|
||||
m_target.device->execute().set_input_line(m_target_int, unshift_mask_xor(data) & 1);
|
||||
}
|
||||
|
134
src/emu/devcb.h
134
src/emu/devcb.h
@ -14,8 +14,8 @@
|
||||
#error Dont include this file directly; include emu.h instead.
|
||||
#endif
|
||||
|
||||
#ifndef __DEVCB_H__
|
||||
#define __DEVCB_H__
|
||||
#ifndef MAME_EMU_DEVCB_H
|
||||
#define MAME_EMU_DEVCB_H
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
@ -63,7 +63,7 @@
|
||||
#define MCFG_DEVCB_RSHIFT(_shift) devcb->set_rshift(_shift);
|
||||
#define MCFG_DEVCB_MASK(_mask) devcb->set_mask(_mask);
|
||||
#define MCFG_DEVCB_XOR(_xor) devcb->set_xor(_xor);
|
||||
#define MCFG_DEVCB_INVERT devcb->set_xor(~U64(0));
|
||||
#define MCFG_DEVCB_INVERT devcb->set_xor(~u64(0));
|
||||
#define MCFG_DEVCB_ADDRESS_SPACE(_device, _spacenum) devcb->set_space(_device, _spacenum);
|
||||
|
||||
|
||||
@ -98,7 +98,7 @@ protected:
|
||||
};
|
||||
|
||||
// construction/destruction
|
||||
devcb_base(device_t &device, uint64_t defmask);
|
||||
devcb_base(device_t &device, u64 defmask);
|
||||
|
||||
public:
|
||||
// getters
|
||||
@ -107,8 +107,8 @@ public:
|
||||
// additional configuration
|
||||
devcb_base &set_space(const char *device, address_spacenum space = AS_0) { m_space_tag = device; m_space_num = space; return *this; }
|
||||
devcb_base &set_rshift(int rshift) { m_rshift = rshift; return *this; }
|
||||
devcb_base &set_mask(uint64_t mask) { m_mask = mask; return *this; }
|
||||
devcb_base &set_xor(uint64_t xorval) { m_xor = xorval; return *this; }
|
||||
devcb_base &set_mask(u64 mask) { m_mask = mask; return *this; }
|
||||
devcb_base &set_xor(u64 xorval) { m_xor = xorval; return *this; }
|
||||
|
||||
// construction helper classes
|
||||
class null_desc
|
||||
@ -127,16 +127,16 @@ public:
|
||||
class constant_desc
|
||||
{
|
||||
public:
|
||||
constant_desc(uint64_t value) { m_value = value; }
|
||||
uint64_t m_value;
|
||||
constant_desc(u64 value) { m_value = value; }
|
||||
u64 m_value;
|
||||
};
|
||||
|
||||
class logger_desc
|
||||
{
|
||||
public:
|
||||
logger_desc(const char *string, uint64_t value = 0) { m_string = string; m_value = value; }
|
||||
logger_desc(const char *string, u64 value = 0) { m_string = string; m_value = value; }
|
||||
const char *m_string;
|
||||
uint64_t m_value;
|
||||
u64 m_value;
|
||||
};
|
||||
|
||||
class inputline_desc
|
||||
@ -156,9 +156,9 @@ public:
|
||||
|
||||
protected:
|
||||
// internal helpers
|
||||
inline uint64_t shift_mask_xor(uint64_t value) const { return (((m_rshift < 0) ? (value << -m_rshift) : (value >> m_rshift)) ^ m_xor) & m_mask; }
|
||||
inline uint64_t unshift_mask(uint64_t value) const { return (m_rshift < 0) ? ((value & m_mask) >> -m_rshift) : ((value & m_mask) << m_rshift); }
|
||||
inline uint64_t unshift_mask_xor(uint64_t value) const { return (m_rshift < 0) ? (((value ^ m_xor) & m_mask) >> -m_rshift) : (((value ^ m_xor) & m_mask) << m_rshift); }
|
||||
inline u64 shift_mask_xor(u64 value) const { return (((m_rshift < 0) ? (value << -m_rshift) : (value >> m_rshift)) ^ m_xor) & m_mask; }
|
||||
inline u64 unshift_mask(u64 value) const { return (m_rshift < 0) ? ((value & m_mask) >> -m_rshift) : ((value & m_mask) << m_rshift); }
|
||||
inline u64 unshift_mask_xor(u64 value) const { return (m_rshift < 0) ? (((value ^ m_xor) & m_mask) >> -m_rshift) : (((value ^ m_xor) & m_mask) << m_rshift); }
|
||||
void reset(callback_type type = CALLBACK_NONE);
|
||||
void resolve_ioport();
|
||||
void resolve_inputline();
|
||||
@ -176,7 +176,7 @@ protected:
|
||||
device_t & m_device; // reference to our owning device
|
||||
callback_type m_type; // type of callback registered
|
||||
const char * m_target_tag; // tag of target object
|
||||
uint64_t m_target_int; // integer value of target object
|
||||
u64 m_target_int; // integer value of target object
|
||||
const char * m_space_tag; // tag of address space device
|
||||
address_spacenum m_space_num; // address space number of space device
|
||||
|
||||
@ -184,8 +184,8 @@ protected:
|
||||
address_space * m_space; // target address space
|
||||
callback_target m_target; // resolved pointer to target object
|
||||
int m_rshift; // right shift to apply to data read
|
||||
uint64_t m_mask; // mask to apply to data read
|
||||
uint64_t m_xor; // XOR to apply to data read
|
||||
u64 m_mask; // mask to apply to data read
|
||||
u64 m_xor; // XOR to apply to data read
|
||||
};
|
||||
|
||||
|
||||
@ -195,7 +195,7 @@ class devcb_read_base : public devcb_base
|
||||
{
|
||||
protected:
|
||||
// construction/destruction
|
||||
devcb_read_base(device_t &device, uint64_t defmask);
|
||||
devcb_read_base(device_t &device, u64 defmask);
|
||||
|
||||
public:
|
||||
// callback configuration
|
||||
@ -208,22 +208,22 @@ public:
|
||||
|
||||
// resolution
|
||||
void resolve();
|
||||
void resolve_safe(uint64_t none_constant_value);
|
||||
void resolve_safe(u64 none_constant_value);
|
||||
|
||||
protected:
|
||||
// internal helpers
|
||||
void reset(callback_type type = CALLBACK_NONE);
|
||||
|
||||
// adapters
|
||||
uint64_t read_unresolved_adapter(address_space &space, offs_t offset, uint64_t mask);
|
||||
uint64_t read_line_adapter(address_space &space, offs_t offset, uint64_t mask);
|
||||
uint64_t read8_adapter(address_space &space, offs_t offset, uint64_t mask);
|
||||
uint64_t read16_adapter(address_space &space, offs_t offset, uint64_t mask);
|
||||
uint64_t read32_adapter(address_space &space, offs_t offset, uint64_t mask);
|
||||
uint64_t read64_adapter(address_space &space, offs_t offset, uint64_t mask);
|
||||
uint64_t read_ioport_adapter(address_space &space, offs_t offset, uint64_t mask);
|
||||
uint64_t read_logged_adapter(address_space &space, offs_t offset, uint64_t mask);
|
||||
uint64_t read_constant_adapter(address_space &space, offs_t offset, uint64_t mask);
|
||||
u64 read_unresolved_adapter(address_space &space, offs_t offset, u64 mask);
|
||||
u64 read_line_adapter(address_space &space, offs_t offset, u64 mask);
|
||||
u64 read8_adapter(address_space &space, offs_t offset, u64 mask);
|
||||
u64 read16_adapter(address_space &space, offs_t offset, u64 mask);
|
||||
u64 read32_adapter(address_space &space, offs_t offset, u64 mask);
|
||||
u64 read64_adapter(address_space &space, offs_t offset, u64 mask);
|
||||
u64 read_ioport_adapter(address_space &space, offs_t offset, u64 mask);
|
||||
u64 read_logged_adapter(address_space &space, offs_t offset, u64 mask);
|
||||
u64 read_constant_adapter(address_space &space, offs_t offset, u64 mask);
|
||||
|
||||
// configuration
|
||||
read_line_delegate m_readline; // copy of registered line reader
|
||||
@ -233,7 +233,7 @@ protected:
|
||||
read64_delegate m_read64; // copy of registered 64-bit reader
|
||||
|
||||
// derived state
|
||||
typedef uint64_t (devcb_read_base::*adapter_func)(address_space &, offs_t, uint64_t);
|
||||
typedef u64 (devcb_read_base::*adapter_func)(address_space &, offs_t, u64);
|
||||
adapter_func m_adapter; // actual callback to invoke
|
||||
};
|
||||
|
||||
@ -244,7 +244,7 @@ class devcb_write_base : public devcb_base
|
||||
{
|
||||
protected:
|
||||
// construction/destruction
|
||||
devcb_write_base(device_t &device, uint64_t defmask);
|
||||
devcb_write_base(device_t &device, u64 defmask);
|
||||
|
||||
public:
|
||||
// callback configuration
|
||||
@ -264,16 +264,16 @@ protected:
|
||||
void reset(callback_type type = CALLBACK_NONE);
|
||||
|
||||
// adapters
|
||||
void write_unresolved_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask);
|
||||
void write_line_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask);
|
||||
void write8_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask);
|
||||
void write16_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask);
|
||||
void write32_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask);
|
||||
void write64_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask);
|
||||
void write_ioport_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask);
|
||||
void write_logged_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask);
|
||||
void write_noop_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask);
|
||||
void write_inputline_adapter(address_space &space, offs_t offset, uint64_t data, uint64_t mask);
|
||||
void write_unresolved_adapter(address_space &space, offs_t offset, u64 data, u64 mask);
|
||||
void write_line_adapter(address_space &space, offs_t offset, u64 data, u64 mask);
|
||||
void write8_adapter(address_space &space, offs_t offset, u64 data, u64 mask);
|
||||
void write16_adapter(address_space &space, offs_t offset, u64 data, u64 mask);
|
||||
void write32_adapter(address_space &space, offs_t offset, u64 data, u64 mask);
|
||||
void write64_adapter(address_space &space, offs_t offset, u64 data, u64 mask);
|
||||
void write_ioport_adapter(address_space &space, offs_t offset, u64 data, u64 mask);
|
||||
void write_logged_adapter(address_space &space, offs_t offset, u64 data, u64 mask);
|
||||
void write_noop_adapter(address_space &space, offs_t offset, u64 data, u64 mask);
|
||||
void write_inputline_adapter(address_space &space, offs_t offset, u64 data, u64 mask);
|
||||
|
||||
// configuration
|
||||
write_line_delegate m_writeline; // copy of registered line writer
|
||||
@ -283,7 +283,7 @@ protected:
|
||||
write64_delegate m_write64; // copy of registered 64-bit writer
|
||||
|
||||
// derived state
|
||||
typedef void (devcb_write_base::*adapter_func)(address_space &, offs_t, uint64_t, uint64_t);
|
||||
typedef void (devcb_write_base::*adapter_func)(address_space &, offs_t, u64, u64);
|
||||
adapter_func m_adapter; // actual callback to invoke
|
||||
};
|
||||
|
||||
@ -294,8 +294,8 @@ class devcb_read_line : public devcb_read_base
|
||||
{
|
||||
public:
|
||||
devcb_read_line(device_t &device) : devcb_read_base(device, 0xff) { }
|
||||
int operator()() { return (this->*m_adapter)(*m_space, 0, U64(0xff)) & 1; }
|
||||
int operator()(address_space &space) { return (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, 0, U64(0xff)) & 1; }
|
||||
int operator()() { return (this->*m_adapter)(*m_space, 0, 0xffU) & 1; }
|
||||
int operator()(address_space &space) { return (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, 0, 0xffU) & 1; }
|
||||
};
|
||||
|
||||
|
||||
@ -305,8 +305,8 @@ class devcb_read8 : public devcb_read_base
|
||||
{
|
||||
public:
|
||||
devcb_read8(device_t &device) : devcb_read_base(device, 0xff) { }
|
||||
uint8_t operator()(offs_t offset = 0, uint8_t mask = 0xff) { return (this->*m_adapter)(*m_space, offset, mask) & mask; }
|
||||
uint8_t operator()(address_space &space, offs_t offset = 0, uint8_t mask = 0xff) { return (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, mask) & mask; }
|
||||
u8 operator()(offs_t offset = 0, u8 mask = 0xff) { return (this->*m_adapter)(*m_space, offset, mask) & mask; }
|
||||
u8 operator()(address_space &space, offs_t offset = 0, u8 mask = 0xff) { return (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, mask) & mask; }
|
||||
};
|
||||
|
||||
|
||||
@ -316,8 +316,8 @@ class devcb_read16 : public devcb_read_base
|
||||
{
|
||||
public:
|
||||
devcb_read16(device_t &device) : devcb_read_base(device, 0xffff) { }
|
||||
uint16_t operator()(offs_t offset = 0, uint16_t mask = 0xffff) { return (this->*m_adapter)(*m_space, offset, mask) & mask; }
|
||||
uint16_t operator()(address_space &space, offs_t offset = 0, uint16_t mask = 0xffff) { return (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, mask) & mask; }
|
||||
u16 operator()(offs_t offset = 0, u16 mask = 0xffff) { return (this->*m_adapter)(*m_space, offset, mask) & mask; }
|
||||
u16 operator()(address_space &space, offs_t offset = 0, u16 mask = 0xffff) { return (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, mask) & mask; }
|
||||
};
|
||||
|
||||
|
||||
@ -327,8 +327,8 @@ class devcb_read32 : public devcb_read_base
|
||||
{
|
||||
public:
|
||||
devcb_read32(device_t &device) : devcb_read_base(device, 0xffffffff) { }
|
||||
uint32_t operator()(offs_t offset = 0, uint32_t mask = 0xffffffff) { return (this->*m_adapter)(*m_space, offset, mask) & mask; }
|
||||
uint32_t operator()(address_space &space, offs_t offset = 0, uint32_t mask = 0xffffffff) { return (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, mask) & mask; }
|
||||
u32 operator()(offs_t offset = 0, u32 mask = 0xffffffff) { return (this->*m_adapter)(*m_space, offset, mask) & mask; }
|
||||
u32 operator()(address_space &space, offs_t offset = 0, u32 mask = 0xffffffff) { return (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, mask) & mask; }
|
||||
};
|
||||
|
||||
|
||||
@ -337,9 +337,9 @@ public:
|
||||
class devcb_read64 : public devcb_read_base
|
||||
{
|
||||
public:
|
||||
devcb_read64(device_t &device) : devcb_read_base(device, U64(0xffffffffffffffff)) { }
|
||||
uint64_t operator()(offs_t offset = 0, uint64_t mask = U64(0xffffffffffffffff)) { return (this->*m_adapter)(*m_space, offset, mask) & mask; }
|
||||
uint64_t operator()(address_space &space, offs_t offset = 0, uint64_t mask = U64(0xffffffffffffffff)) { return (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, mask) & mask; }
|
||||
devcb_read64(device_t &device) : devcb_read_base(device, 0xffffffffffffffffU) { }
|
||||
u64 operator()(offs_t offset = 0, u64 mask = 0xffffffffffffffffU) { return (this->*m_adapter)(*m_space, offset, mask) & mask; }
|
||||
u64 operator()(address_space &space, offs_t offset = 0, u64 mask = 0xffffffffffffffffU) { return (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, mask) & mask; }
|
||||
};
|
||||
|
||||
|
||||
@ -349,8 +349,8 @@ class devcb_write_line : public devcb_write_base
|
||||
{
|
||||
public:
|
||||
devcb_write_line(device_t &device) : devcb_write_base(device, 0xff) { }
|
||||
void operator()(int state) { (this->*m_adapter)(*m_space, 0, state & 1, U64(0xff)); }
|
||||
void operator()(address_space &space, int state) { (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, 0, state & 1, U64(0xff)); }
|
||||
void operator()(int state) { (this->*m_adapter)(*m_space, 0, state & 1, 0xffU); }
|
||||
void operator()(address_space &space, int state) { (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, 0, state & 1, 0xffU); }
|
||||
};
|
||||
|
||||
|
||||
@ -360,9 +360,9 @@ class devcb_write8 : public devcb_write_base
|
||||
{
|
||||
public:
|
||||
devcb_write8(device_t &device) : devcb_write_base(device, 0xff) { }
|
||||
void operator()(uint8_t data, uint8_t mask = 0xff) { (this->*m_adapter)(*m_space, 0, data, mask); }
|
||||
void operator()(offs_t offset, uint8_t data, uint8_t mask = 0xff) { (this->*m_adapter)(*m_space, offset, data, mask); }
|
||||
void operator()(address_space &space, offs_t offset, uint8_t data, uint8_t mask = 0xff) { (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, data, mask); }
|
||||
void operator()(u8 data, u8 mask = 0xff) { (this->*m_adapter)(*m_space, 0, data, mask); }
|
||||
void operator()(offs_t offset, u8 data, u8 mask = 0xff) { (this->*m_adapter)(*m_space, offset, data, mask); }
|
||||
void operator()(address_space &space, offs_t offset, u8 data, u8 mask = 0xff) { (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, data, mask); }
|
||||
};
|
||||
|
||||
|
||||
@ -372,9 +372,9 @@ class devcb_write16 : public devcb_write_base
|
||||
{
|
||||
public:
|
||||
devcb_write16(device_t &device) : devcb_write_base(device, 0xffff) { }
|
||||
void operator()(uint16_t data, uint16_t mask = 0xffff) { (this->*m_adapter)(*m_space, 0, data, mask); }
|
||||
void operator()(offs_t offset, uint16_t data, uint16_t mask = 0xffff) { (this->*m_adapter)(*m_space, offset, data, mask); }
|
||||
void operator()(address_space &space, offs_t offset, uint16_t data, uint16_t mask = 0xffff) { (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, data, mask); }
|
||||
void operator()(u16 data, u16 mask = 0xffff) { (this->*m_adapter)(*m_space, 0, data, mask); }
|
||||
void operator()(offs_t offset, u16 data, u16 mask = 0xffff) { (this->*m_adapter)(*m_space, offset, data, mask); }
|
||||
void operator()(address_space &space, offs_t offset, u16 data, u16 mask = 0xffff) { (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, data, mask); }
|
||||
};
|
||||
|
||||
|
||||
@ -384,9 +384,9 @@ class devcb_write32 : public devcb_write_base
|
||||
{
|
||||
public:
|
||||
devcb_write32(device_t &device) : devcb_write_base(device, 0xffffffff) { }
|
||||
void operator()(uint32_t data, uint32_t mask = 0xffffffff) { (this->*m_adapter)(*m_space, 0, data, mask); }
|
||||
void operator()(offs_t offset, uint32_t data, uint32_t mask = 0xffffffff) { (this->*m_adapter)(*m_space, offset, data, mask); }
|
||||
void operator()(address_space &space, offs_t offset, uint32_t data, uint32_t mask = 0xffffffff) { (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, data, mask); }
|
||||
void operator()(u32 data, u32 mask = 0xffffffff) { (this->*m_adapter)(*m_space, 0, data, mask); }
|
||||
void operator()(offs_t offset, u32 data, u32 mask = 0xffffffff) { (this->*m_adapter)(*m_space, offset, data, mask); }
|
||||
void operator()(address_space &space, offs_t offset, u32 data, u32 mask = 0xffffffff) { (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, data, mask); }
|
||||
};
|
||||
|
||||
|
||||
@ -395,11 +395,11 @@ public:
|
||||
class devcb_write64 : public devcb_write_base
|
||||
{
|
||||
public:
|
||||
devcb_write64(device_t &device) : devcb_write_base(device, U64(0xffffffffffffffff)) { }
|
||||
void operator()(uint64_t data, uint64_t mask = U64(0xffffffffffffffff)) { (this->*m_adapter)(*m_space, 0, data, mask); }
|
||||
void operator()(offs_t offset, uint64_t data, uint64_t mask = U64(0xffffffffffffffff)) { (this->*m_adapter)(*m_space, offset, data, mask); }
|
||||
void operator()(address_space &space, offs_t offset, uint64_t data, uint64_t mask = U64(0xffffffffffffffff)) { (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, data, mask); }
|
||||
devcb_write64(device_t &device) : devcb_write_base(device, 0xffffffffffffffffU) { }
|
||||
void operator()(u64 data, u64 mask = 0xffffffffffffffffU) { (this->*m_adapter)(*m_space, 0, data, mask); }
|
||||
void operator()(offs_t offset, u64 data, u64 mask = 0xffffffffffffffffU) { (this->*m_adapter)(*m_space, offset, data, mask); }
|
||||
void operator()(address_space &space, offs_t offset, u64 data, u64 mask = 0xffffffffffffffffU) { (this->*m_adapter)((m_space_tag != nullptr) ? *m_space : space, offset, data, mask); }
|
||||
};
|
||||
|
||||
|
||||
#endif /* __DEVCB_H__ */
|
||||
#endif /* MAME_EMU_DEVCB_H */
|
||||
|
@ -21,7 +21,7 @@
|
||||
// cpu_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
cpu_device::cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
|
||||
cpu_device::cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, const char *shortname, const char *source)
|
||||
: device_t(mconfig, type, name, tag, owner, clock, shortname, source),
|
||||
device_execute_interface(mconfig, *this),
|
||||
device_memory_interface(mconfig, *this),
|
||||
|
@ -14,8 +14,8 @@
|
||||
#error Dont include this file directly; include emu.h instead.
|
||||
#endif
|
||||
|
||||
#ifndef __DEVCPU_H__
|
||||
#define __DEVCPU_H__
|
||||
#ifndef MAME_EMU_DEVCPU_H
|
||||
#define MAME_EMU_DEVCPU_H
|
||||
|
||||
//**************************************************************************
|
||||
// CPU DEVICE CONFIGURATION MACROS
|
||||
@ -54,7 +54,7 @@
|
||||
//**************************************************************************
|
||||
|
||||
#define CPU_DISASSEMBLE_NAME(name) cpu_disassemble_##name
|
||||
#define CPU_DISASSEMBLE(name) offs_t CPU_DISASSEMBLE_NAME(name)(cpu_device *device, char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, int options)
|
||||
#define CPU_DISASSEMBLE(name) offs_t CPU_DISASSEMBLE_NAME(name)(cpu_device *device, char *buffer, offs_t pc, const u8 *oprom, const u8 *opram, int options)
|
||||
#define CPU_DISASSEMBLE_CALL(name) CPU_DISASSEMBLE_NAME(name)(device, buffer, pc, oprom, opram, options)
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ public:
|
||||
|
||||
protected:
|
||||
// construction/destruction
|
||||
cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
|
||||
cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, const char *shortname, const char *source);
|
||||
virtual ~cpu_device();
|
||||
|
||||
private:
|
||||
@ -88,7 +88,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
typedef offs_t (*cpu_disassemble_func)(cpu_device *device, char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, int options);
|
||||
typedef offs_t (*cpu_disassemble_func)(cpu_device *device, char *buffer, offs_t pc, const u8 *oprom, const u8 *opram, int options);
|
||||
|
||||
|
||||
#endif /* __CPUINTRF_H__ */
|
||||
#endif /* MAME_EMU_DEVCPU_H */
|
||||
|
@ -8,10 +8,10 @@
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#pragma once
|
||||
#ifndef MAME_EMU_DEVDELEGATE_H
|
||||
#define MAME_EMU_DEVDELEGATE_H
|
||||
|
||||
#ifndef __DEVDELEGATE_H__
|
||||
#define __DEVDELEGATE_H__
|
||||
#pragma once
|
||||
|
||||
#include "delegate.h"
|
||||
|
||||
@ -104,4 +104,4 @@ public:
|
||||
};
|
||||
|
||||
|
||||
#endif /* __DEVDELEGATE_H__ */
|
||||
#endif /* MAME_EMU_DEVDELEGATE_H */
|
||||
|
@ -22,23 +22,23 @@ template class object_finder_base<memory_bank, true>;
|
||||
template class object_finder_base<ioport_port, false>;
|
||||
template class object_finder_base<ioport_port, true>;
|
||||
|
||||
template class object_finder_base<uint8_t, false>;
|
||||
template class object_finder_base<uint8_t, true>;
|
||||
template class object_finder_base<uint16_t, false>;
|
||||
template class object_finder_base<uint16_t, true>;
|
||||
template class object_finder_base<uint32_t, false>;
|
||||
template class object_finder_base<uint32_t, true>;
|
||||
template class object_finder_base<uint64_t, false>;
|
||||
template class object_finder_base<uint64_t, true>;
|
||||
template class object_finder_base<u8, false>;
|
||||
template class object_finder_base<u8, true>;
|
||||
template class object_finder_base<u16, false>;
|
||||
template class object_finder_base<u16, true>;
|
||||
template class object_finder_base<u32, false>;
|
||||
template class object_finder_base<u32, true>;
|
||||
template class object_finder_base<u64, false>;
|
||||
template class object_finder_base<u64, true>;
|
||||
|
||||
template class object_finder_base<int8_t, false>;
|
||||
template class object_finder_base<int8_t, true>;
|
||||
template class object_finder_base<int16_t, false>;
|
||||
template class object_finder_base<int16_t, true>;
|
||||
template class object_finder_base<int32_t, false>;
|
||||
template class object_finder_base<int32_t, true>;
|
||||
template class object_finder_base<int64_t, false>;
|
||||
template class object_finder_base<int64_t, true>;
|
||||
template class object_finder_base<s8, false>;
|
||||
template class object_finder_base<s8, true>;
|
||||
template class object_finder_base<s16, false>;
|
||||
template class object_finder_base<s16, true>;
|
||||
template class object_finder_base<s32, false>;
|
||||
template class object_finder_base<s32, true>;
|
||||
template class object_finder_base<s64, false>;
|
||||
template class object_finder_base<s64, true>;
|
||||
|
||||
template class memory_region_finder<false>;
|
||||
template class memory_region_finder<true>;
|
||||
@ -49,41 +49,41 @@ template class memory_bank_finder<true>;
|
||||
template class ioport_finder<false>;
|
||||
template class ioport_finder<true>;
|
||||
|
||||
template class region_ptr_finder<uint8_t, false>;
|
||||
template class region_ptr_finder<uint8_t, true>;
|
||||
template class region_ptr_finder<uint16_t, false>;
|
||||
template class region_ptr_finder<uint16_t, true>;
|
||||
template class region_ptr_finder<uint32_t, false>;
|
||||
template class region_ptr_finder<uint32_t, true>;
|
||||
template class region_ptr_finder<uint64_t, false>;
|
||||
template class region_ptr_finder<uint64_t, true>;
|
||||
template class region_ptr_finder<u8, false>;
|
||||
template class region_ptr_finder<u8, true>;
|
||||
template class region_ptr_finder<u16, false>;
|
||||
template class region_ptr_finder<u16, true>;
|
||||
template class region_ptr_finder<u32, false>;
|
||||
template class region_ptr_finder<u32, true>;
|
||||
template class region_ptr_finder<u64, false>;
|
||||
template class region_ptr_finder<u64, true>;
|
||||
|
||||
template class region_ptr_finder<int8_t, false>;
|
||||
template class region_ptr_finder<int8_t, true>;
|
||||
template class region_ptr_finder<int16_t, false>;
|
||||
template class region_ptr_finder<int16_t, true>;
|
||||
template class region_ptr_finder<int32_t, false>;
|
||||
template class region_ptr_finder<int32_t, true>;
|
||||
template class region_ptr_finder<int64_t, false>;
|
||||
template class region_ptr_finder<int64_t, true>;
|
||||
template class region_ptr_finder<s8, false>;
|
||||
template class region_ptr_finder<s8, true>;
|
||||
template class region_ptr_finder<s16, false>;
|
||||
template class region_ptr_finder<s16, true>;
|
||||
template class region_ptr_finder<s32, false>;
|
||||
template class region_ptr_finder<s32, true>;
|
||||
template class region_ptr_finder<s64, false>;
|
||||
template class region_ptr_finder<s64, true>;
|
||||
|
||||
template class shared_ptr_finder<uint8_t, false>;
|
||||
template class shared_ptr_finder<uint8_t, true>;
|
||||
template class shared_ptr_finder<uint16_t, false>;
|
||||
template class shared_ptr_finder<uint16_t, true>;
|
||||
template class shared_ptr_finder<uint32_t, false>;
|
||||
template class shared_ptr_finder<uint32_t, true>;
|
||||
template class shared_ptr_finder<uint64_t, false>;
|
||||
template class shared_ptr_finder<uint64_t, true>;
|
||||
template class shared_ptr_finder<u8, false>;
|
||||
template class shared_ptr_finder<u8, true>;
|
||||
template class shared_ptr_finder<u16, false>;
|
||||
template class shared_ptr_finder<u16, true>;
|
||||
template class shared_ptr_finder<u32, false>;
|
||||
template class shared_ptr_finder<u32, true>;
|
||||
template class shared_ptr_finder<u64, false>;
|
||||
template class shared_ptr_finder<u64, true>;
|
||||
|
||||
template class shared_ptr_finder<int8_t, false>;
|
||||
template class shared_ptr_finder<int8_t, true>;
|
||||
template class shared_ptr_finder<int16_t, false>;
|
||||
template class shared_ptr_finder<int16_t, true>;
|
||||
template class shared_ptr_finder<int32_t, false>;
|
||||
template class shared_ptr_finder<int32_t, true>;
|
||||
template class shared_ptr_finder<int64_t, false>;
|
||||
template class shared_ptr_finder<int64_t, true>;
|
||||
template class shared_ptr_finder<s8, false>;
|
||||
template class shared_ptr_finder<s8, true>;
|
||||
template class shared_ptr_finder<s16, false>;
|
||||
template class shared_ptr_finder<s16, true>;
|
||||
template class shared_ptr_finder<s32, false>;
|
||||
template class shared_ptr_finder<s32, true>;
|
||||
template class shared_ptr_finder<s64, false>;
|
||||
template class shared_ptr_finder<s64, true>;
|
||||
|
||||
|
||||
|
||||
@ -119,7 +119,7 @@ finder_base::~finder_base()
|
||||
// find_memregion - find memory region
|
||||
//-------------------------------------------------
|
||||
|
||||
void *finder_base::find_memregion(uint8_t width, size_t &length, bool required) const
|
||||
void *finder_base::find_memregion(u8 width, size_t &length, bool required) const
|
||||
{
|
||||
// look up the region and return nullptr if not found
|
||||
memory_region *const region = m_base.memregion(m_tag);
|
||||
@ -194,7 +194,7 @@ bool finder_base::validate_memregion(size_t bytes, bool required) const
|
||||
// find_memshare - find memory share
|
||||
//-------------------------------------------------
|
||||
|
||||
void *finder_base::find_memshare(uint8_t width, size_t &bytes, bool required) const
|
||||
void *finder_base::find_memshare(u8 width, size_t &bytes, bool required) const
|
||||
{
|
||||
// look up the share and return nullptr if not found
|
||||
memory_share *share = m_base.memshare(m_tag);
|
||||
|
@ -205,7 +205,7 @@ protected:
|
||||
/// found.
|
||||
/// \return Base pointer of the memeroy region if a matching region
|
||||
/// is found, or nullptr otherwise.
|
||||
void *find_memregion(uint8_t width, size_t &length, bool required) const;
|
||||
void *find_memregion(u8 width, size_t &length, bool required) const;
|
||||
|
||||
/// \brief Check that memory region exists
|
||||
///
|
||||
@ -240,7 +240,7 @@ protected:
|
||||
/// found.
|
||||
/// \return Pointer to base of memory share if a matching memory
|
||||
/// share is found, or nullptr otherwise.
|
||||
void *find_memshare(uint8_t width, size_t &bytes, bool required) const;
|
||||
void *find_memshare(u8 width, size_t &bytes, bool required) const;
|
||||
|
||||
/// \brief Log if object was not found
|
||||
///
|
||||
@ -646,12 +646,12 @@ public:
|
||||
/// \brief Get length in units of elements
|
||||
/// \return Length in units of elements or zero if no matching
|
||||
/// memory region has been found.
|
||||
uint32_t length() const { return m_length; }
|
||||
u32 length() const { return m_length; }
|
||||
|
||||
/// \brief Get length in units of bytes
|
||||
/// \return Length in units of bytes or zero if no matching memory
|
||||
/// region has been found.
|
||||
uint32_t bytes() const { return m_length * sizeof(PointerType); }
|
||||
u32 bytes() const { return m_length * sizeof(PointerType); }
|
||||
|
||||
/// \brief Get index mask
|
||||
///
|
||||
@ -659,7 +659,7 @@ public:
|
||||
/// used as a mask for index values if the length is a power of two.
|
||||
/// Result is undefined if no matching memory region has been found.
|
||||
/// \return Length in units of elements minus one.
|
||||
uint32_t mask() const { return m_length - 1; }
|
||||
u32 mask() const { return m_length - 1; }
|
||||
|
||||
private:
|
||||
/// \brief Find memory region base pointer
|
||||
@ -726,7 +726,7 @@ class shared_ptr_finder : public object_finder_base<PointerType, Required>
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
shared_ptr_finder(device_t &base, char const *tag, uint8_t width = sizeof(PointerType) * 8)
|
||||
shared_ptr_finder(device_t &base, char const *tag, u8 width = sizeof(PointerType) * 8)
|
||||
: object_finder_base<PointerType, Required>(base, tag)
|
||||
, m_width(width)
|
||||
, m_bytes(0)
|
||||
@ -738,14 +738,14 @@ public:
|
||||
PointerType &operator[](int index) const { return this->m_target[index]; }
|
||||
|
||||
// getter for explicit fetching
|
||||
uint32_t bytes() const { return m_bytes; }
|
||||
uint32_t mask() const { return m_bytes - 1; } // FIXME: wrong when sizeof(PointerType) != 1
|
||||
u32 bytes() const { return m_bytes; }
|
||||
u32 mask() const { return m_bytes - 1; } // FIXME: wrong when sizeof(PointerType) != 1
|
||||
|
||||
// setter for setting the object
|
||||
void set_target(PointerType *target, size_t bytes) { this->m_target = target; m_bytes = bytes; }
|
||||
|
||||
// dynamic allocation of a shared pointer
|
||||
void allocate(uint32_t entries)
|
||||
void allocate(u32 entries)
|
||||
{
|
||||
assert(m_allocated.empty());
|
||||
m_allocated.resize(entries);
|
||||
@ -764,7 +764,7 @@ private:
|
||||
}
|
||||
|
||||
// internal state
|
||||
uint8_t const m_width;
|
||||
u8 const m_width;
|
||||
size_t m_bytes;
|
||||
std::vector<PointerType> m_allocated;
|
||||
};
|
||||
@ -788,23 +788,23 @@ extern template class object_finder_base<memory_bank, true>;
|
||||
extern template class object_finder_base<ioport_port, false>;
|
||||
extern template class object_finder_base<ioport_port, true>;
|
||||
|
||||
extern template class object_finder_base<uint8_t, false>;
|
||||
extern template class object_finder_base<uint8_t, true>;
|
||||
extern template class object_finder_base<uint16_t, false>;
|
||||
extern template class object_finder_base<uint16_t, true>;
|
||||
extern template class object_finder_base<uint32_t, false>;
|
||||
extern template class object_finder_base<uint32_t, true>;
|
||||
extern template class object_finder_base<uint64_t, false>;
|
||||
extern template class object_finder_base<uint64_t, true>;
|
||||
extern template class object_finder_base<u8, false>;
|
||||
extern template class object_finder_base<u8, true>;
|
||||
extern template class object_finder_base<u16, false>;
|
||||
extern template class object_finder_base<u16, true>;
|
||||
extern template class object_finder_base<u32, false>;
|
||||
extern template class object_finder_base<u32, true>;
|
||||
extern template class object_finder_base<u64, false>;
|
||||
extern template class object_finder_base<u64, true>;
|
||||
|
||||
extern template class object_finder_base<int8_t, false>;
|
||||
extern template class object_finder_base<int8_t, true>;
|
||||
extern template class object_finder_base<int16_t, false>;
|
||||
extern template class object_finder_base<int16_t, true>;
|
||||
extern template class object_finder_base<int32_t, false>;
|
||||
extern template class object_finder_base<int32_t, true>;
|
||||
extern template class object_finder_base<int64_t, false>;
|
||||
extern template class object_finder_base<int64_t, true>;
|
||||
extern template class object_finder_base<s8, false>;
|
||||
extern template class object_finder_base<s8, true>;
|
||||
extern template class object_finder_base<s16, false>;
|
||||
extern template class object_finder_base<s16, true>;
|
||||
extern template class object_finder_base<s32, false>;
|
||||
extern template class object_finder_base<s32, true>;
|
||||
extern template class object_finder_base<s64, false>;
|
||||
extern template class object_finder_base<s64, true>;
|
||||
|
||||
extern template class memory_region_finder<false>;
|
||||
extern template class memory_region_finder<true>;
|
||||
@ -815,41 +815,41 @@ extern template class memory_bank_finder<true>;
|
||||
extern template class ioport_finder<false>;
|
||||
extern template class ioport_finder<true>;
|
||||
|
||||
extern template class region_ptr_finder<uint8_t, false>;
|
||||
extern template class region_ptr_finder<uint8_t, true>;
|
||||
extern template class region_ptr_finder<uint16_t, false>;
|
||||
extern template class region_ptr_finder<uint16_t, true>;
|
||||
extern template class region_ptr_finder<uint32_t, false>;
|
||||
extern template class region_ptr_finder<uint32_t, true>;
|
||||
extern template class region_ptr_finder<uint64_t, false>;
|
||||
extern template class region_ptr_finder<uint64_t, true>;
|
||||
extern template class region_ptr_finder<u8, false>;
|
||||
extern template class region_ptr_finder<u8, true>;
|
||||
extern template class region_ptr_finder<u16, false>;
|
||||
extern template class region_ptr_finder<u16, true>;
|
||||
extern template class region_ptr_finder<u32, false>;
|
||||
extern template class region_ptr_finder<u32, true>;
|
||||
extern template class region_ptr_finder<u64, false>;
|
||||
extern template class region_ptr_finder<u64, true>;
|
||||
|
||||
extern template class region_ptr_finder<int8_t, false>;
|
||||
extern template class region_ptr_finder<int8_t, true>;
|
||||
extern template class region_ptr_finder<int16_t, false>;
|
||||
extern template class region_ptr_finder<int16_t, true>;
|
||||
extern template class region_ptr_finder<int32_t, false>;
|
||||
extern template class region_ptr_finder<int32_t, true>;
|
||||
extern template class region_ptr_finder<int64_t, false>;
|
||||
extern template class region_ptr_finder<int64_t, true>;
|
||||
extern template class region_ptr_finder<s8, false>;
|
||||
extern template class region_ptr_finder<s8, true>;
|
||||
extern template class region_ptr_finder<s16, false>;
|
||||
extern template class region_ptr_finder<s16, true>;
|
||||
extern template class region_ptr_finder<s32, false>;
|
||||
extern template class region_ptr_finder<s32, true>;
|
||||
extern template class region_ptr_finder<s64, false>;
|
||||
extern template class region_ptr_finder<s64, true>;
|
||||
|
||||
extern template class shared_ptr_finder<uint8_t, false>;
|
||||
extern template class shared_ptr_finder<uint8_t, true>;
|
||||
extern template class shared_ptr_finder<uint16_t, false>;
|
||||
extern template class shared_ptr_finder<uint16_t, true>;
|
||||
extern template class shared_ptr_finder<uint32_t, false>;
|
||||
extern template class shared_ptr_finder<uint32_t, true>;
|
||||
extern template class shared_ptr_finder<uint64_t, false>;
|
||||
extern template class shared_ptr_finder<uint64_t, true>;
|
||||
extern template class shared_ptr_finder<u8, false>;
|
||||
extern template class shared_ptr_finder<u8, true>;
|
||||
extern template class shared_ptr_finder<u16, false>;
|
||||
extern template class shared_ptr_finder<u16, true>;
|
||||
extern template class shared_ptr_finder<u32, false>;
|
||||
extern template class shared_ptr_finder<u32, true>;
|
||||
extern template class shared_ptr_finder<u64, false>;
|
||||
extern template class shared_ptr_finder<u64, true>;
|
||||
|
||||
extern template class shared_ptr_finder<int8_t, false>;
|
||||
extern template class shared_ptr_finder<int8_t, true>;
|
||||
extern template class shared_ptr_finder<int16_t, false>;
|
||||
extern template class shared_ptr_finder<int16_t, true>;
|
||||
extern template class shared_ptr_finder<int32_t, false>;
|
||||
extern template class shared_ptr_finder<int32_t, true>;
|
||||
extern template class shared_ptr_finder<int64_t, false>;
|
||||
extern template class shared_ptr_finder<int64_t, true>;
|
||||
extern template class shared_ptr_finder<s8, false>;
|
||||
extern template class shared_ptr_finder<s8, true>;
|
||||
extern template class shared_ptr_finder<s16, false>;
|
||||
extern template class shared_ptr_finder<s16, true>;
|
||||
extern template class shared_ptr_finder<s32, false>;
|
||||
extern template class shared_ptr_finder<s32, true>;
|
||||
extern template class shared_ptr_finder<s64, false>;
|
||||
extern template class shared_ptr_finder<s64, true>;
|
||||
|
||||
#endif // MAME_EMU_DEVFIND_H
|
||||
/** \} */
|
||||
|
@ -23,7 +23,7 @@
|
||||
// from the provided config
|
||||
//-------------------------------------------------
|
||||
|
||||
device_t::device_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
|
||||
device_t::device_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, const char *shortname, const char *source)
|
||||
: m_type(type),
|
||||
m_name(name),
|
||||
m_shortname(shortname),
|
||||
@ -157,7 +157,7 @@ std::string device_t::parameter(const char *tag) const
|
||||
// a device
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_t::static_set_clock(device_t &device, uint32_t clock)
|
||||
void device_t::static_set_clock(device_t &device, u32 clock)
|
||||
{
|
||||
// derive the clock from our owner if requested
|
||||
if ((clock & 0xff000000) == 0xff000000)
|
||||
@ -237,7 +237,7 @@ void device_t::reset()
|
||||
// unscaled clock
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_t::set_unscaled_clock(uint32_t clock)
|
||||
void device_t::set_unscaled_clock(u32 clock)
|
||||
{
|
||||
m_unscaled_clock = clock;
|
||||
m_clock = m_unscaled_clock * m_clock_scale;
|
||||
@ -265,15 +265,15 @@ void device_t::set_clock_scale(double clockscale)
|
||||
// clock ticks to an attotime
|
||||
//-------------------------------------------------
|
||||
|
||||
attotime device_t::clocks_to_attotime(uint64_t numclocks) const
|
||||
attotime device_t::clocks_to_attotime(u64 numclocks) const
|
||||
{
|
||||
if (numclocks < m_clock)
|
||||
return attotime(0, numclocks * m_attoseconds_per_clock);
|
||||
else
|
||||
{
|
||||
uint32_t remainder;
|
||||
uint32_t quotient = divu_64x32_rem(numclocks, m_clock, &remainder);
|
||||
return attotime(quotient, (uint64_t)remainder * (uint64_t)m_attoseconds_per_clock);
|
||||
u32 remainder;
|
||||
u32 quotient = divu_64x32_rem(numclocks, m_clock, &remainder);
|
||||
return attotime(quotient, u64(remainder) * u64(m_attoseconds_per_clock));
|
||||
}
|
||||
}
|
||||
|
||||
@ -283,9 +283,9 @@ attotime device_t::clocks_to_attotime(uint64_t numclocks) const
|
||||
// attotime to CPU clock ticks
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t device_t::attotime_to_clocks(const attotime &duration) const
|
||||
u64 device_t::attotime_to_clocks(const attotime &duration) const
|
||||
{
|
||||
return mulu_32x32(duration.seconds(), m_clock) + (uint64_t)duration.attoseconds() / (uint64_t)m_attoseconds_per_clock;
|
||||
return mulu_32x32(duration.seconds(), m_clock) + u64(duration.attoseconds()) / u64(m_attoseconds_per_clock);
|
||||
}
|
||||
|
||||
|
||||
|
@ -14,8 +14,8 @@
|
||||
#error Dont include this file directly; include emu.h instead.
|
||||
#endif
|
||||
|
||||
#ifndef __DEVICE_H__
|
||||
#define __DEVICE_H__
|
||||
#ifndef MAME_EMU_DEVICE_H
|
||||
#define MAME_EMU_DEVICE_H
|
||||
|
||||
|
||||
|
||||
@ -81,19 +81,19 @@ class device_missing_dependencies : public emu_exception { };
|
||||
|
||||
|
||||
// a device_type is simply a pointer to its alloc function
|
||||
typedef device_t *(*device_type)(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
typedef device_t *(*device_type)(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
|
||||
// this template function creates a stub which constructs a device
|
||||
template<class _DeviceClass>
|
||||
device_t *device_creator(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
device_t *device_creator(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
|
||||
{
|
||||
return global_alloc_clear<_DeviceClass>(mconfig, tag, owner, clock);
|
||||
}
|
||||
|
||||
|
||||
// timer IDs for devices
|
||||
typedef uint32_t device_timer_id;
|
||||
typedef u32 device_timer_id;
|
||||
|
||||
// ======================> device_t
|
||||
|
||||
@ -194,7 +194,7 @@ class device_t : public delegate_late_bind
|
||||
|
||||
protected:
|
||||
// construction/destruction
|
||||
device_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
|
||||
device_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, u32 clock, const char *shortname, const char *source);
|
||||
public:
|
||||
virtual ~device_t();
|
||||
|
||||
@ -209,15 +209,15 @@ public:
|
||||
const char *source() const { return m_source.c_str(); }
|
||||
device_t *owner() const { return m_owner; }
|
||||
device_t *next() const { return m_next; }
|
||||
uint32_t configured_clock() const { return m_configured_clock; }
|
||||
u32 configured_clock() const { return m_configured_clock; }
|
||||
const machine_config &mconfig() const { return m_machine_config; }
|
||||
const input_device_default *input_ports_defaults() const { return m_input_defaults; }
|
||||
const std::vector<rom_entry> &rom_region_vector() const;
|
||||
const rom_entry *rom_region() const { return rom_region_vector().data(); }
|
||||
machine_config_constructor machine_config_additions() const { return device_mconfig_additions(); }
|
||||
ioport_constructor input_ports() const { return device_input_ports(); }
|
||||
uint8_t default_bios() const { return m_default_bios; }
|
||||
uint8_t system_bios() const { return m_system_bios; }
|
||||
u8 default_bios() const { return m_default_bios; }
|
||||
u8 system_bios() const { return m_system_bios; }
|
||||
std::string default_bios_tag() const { return m_default_bios_tag; }
|
||||
|
||||
// interface helpers
|
||||
@ -255,7 +255,7 @@ public:
|
||||
std::string parameter(const char *tag) const;
|
||||
|
||||
// configuration helpers
|
||||
static void static_set_clock(device_t &device, uint32_t clock);
|
||||
static void static_set_clock(device_t &device, u32 clock);
|
||||
static void static_set_input_default(device_t &device, const input_device_default *config) { device.m_input_defaults = config; }
|
||||
static void static_set_default_bios_tag(device_t &device, const char *tag) { std::string default_bios_tag(tag); device.m_default_bios_tag = default_bios_tag; }
|
||||
|
||||
@ -267,13 +267,13 @@ public:
|
||||
void reset();
|
||||
|
||||
// clock/timing accessors
|
||||
uint32_t clock() const { return m_clock; }
|
||||
uint32_t unscaled_clock() const { return m_unscaled_clock; }
|
||||
void set_unscaled_clock(uint32_t clock);
|
||||
u32 clock() const { return m_clock; }
|
||||
u32 unscaled_clock() const { return m_unscaled_clock; }
|
||||
void set_unscaled_clock(u32 clock);
|
||||
double clock_scale() const { return m_clock_scale; }
|
||||
void set_clock_scale(double clockscale);
|
||||
attotime clocks_to_attotime(uint64_t clocks) const;
|
||||
uint64_t attotime_to_clocks(const attotime &duration) const;
|
||||
attotime clocks_to_attotime(u64 clocks) const;
|
||||
u64 attotime_to_clocks(const attotime &duration) const;
|
||||
|
||||
// timer interfaces
|
||||
emu_timer *timer_alloc(device_timer_id id = 0, void *ptr = nullptr);
|
||||
@ -285,15 +285,15 @@ public:
|
||||
template<typename _ItemType>
|
||||
void ATTR_COLD save_item(_ItemType &value, const char *valname, int index = 0) { assert(m_save != nullptr); m_save->save_item(this, name(), tag(), index, value, valname); }
|
||||
template<typename _ItemType>
|
||||
void ATTR_COLD save_pointer(_ItemType *value, const char *valname, uint32_t count, int index = 0) { assert(m_save != nullptr); m_save->save_pointer(this, name(), tag(), index, value, valname, count); }
|
||||
void ATTR_COLD save_pointer(_ItemType *value, const char *valname, u32 count, int index = 0) { assert(m_save != nullptr); m_save->save_pointer(this, name(), tag(), index, value, valname, count); }
|
||||
|
||||
// debugging
|
||||
device_debug *debug() const { return m_debug.get(); }
|
||||
offs_t safe_pc() const;
|
||||
offs_t safe_pcbase() const;
|
||||
|
||||
void set_default_bios(uint8_t bios) { m_default_bios = bios; }
|
||||
void set_system_bios(uint8_t bios) { m_system_bios = bios; }
|
||||
void set_default_bios(u8 bios) { m_default_bios = bios; }
|
||||
void set_system_bios(u8 bios) { m_system_bios = bios; }
|
||||
bool findit(bool isvalidation = false) const;
|
||||
|
||||
// misc
|
||||
@ -345,9 +345,9 @@ protected:
|
||||
interface_list m_interfaces; // container for list of interfaces
|
||||
|
||||
// device clocks
|
||||
uint32_t m_configured_clock; // originally configured device clock
|
||||
uint32_t m_unscaled_clock; // current unscaled device clock
|
||||
uint32_t m_clock; // current device clock, after scaling
|
||||
u32 m_configured_clock; // originally configured device clock
|
||||
u32 m_unscaled_clock; // current unscaled device clock
|
||||
u32 m_clock; // current device clock, after scaling
|
||||
double m_clock_scale; // clock scale factor
|
||||
attoseconds_t m_attoseconds_per_clock;// period in attoseconds
|
||||
|
||||
@ -355,8 +355,8 @@ protected:
|
||||
const machine_config & m_machine_config; // reference to the machine's configuration
|
||||
const input_device_default *m_input_defaults; // devices input ports default overrides
|
||||
|
||||
uint8_t m_system_bios; // the system BIOS we wish to load
|
||||
uint8_t m_default_bios; // the default system BIOS
|
||||
u8 m_system_bios; // the system BIOS we wish to load
|
||||
u8 m_default_bios; // the default system BIOS
|
||||
std::string m_default_bios_tag; // tag of the default system BIOS
|
||||
|
||||
private:
|
||||
@ -792,4 +792,4 @@ inline device_t::interface_list::auto_iterator device_t::interface_list::auto_it
|
||||
}
|
||||
|
||||
|
||||
#endif /* __DEVICE_H__ */
|
||||
#endif /* MAME_EMU_DEVICE_H */
|
||||
|
@ -64,7 +64,7 @@ void device_disasm_interface::static_set_dasm_override(device_t &device, dasm_ov
|
||||
// disassemble - interface for disassembly
|
||||
//-------------------------------------------------
|
||||
|
||||
offs_t device_disasm_interface::disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options)
|
||||
offs_t device_disasm_interface::disassemble(char *buffer, offs_t pc, const u8 *oprom, const u8 *opram, u32 options)
|
||||
{
|
||||
offs_t result = 0;
|
||||
|
||||
|
@ -14,8 +14,8 @@
|
||||
#error Dont include this file directly; include emu.h instead.
|
||||
#endif
|
||||
|
||||
#ifndef __DIDISASM_H__
|
||||
#define __DIDISASM_H__
|
||||
#ifndef MAME_EMU_DIDISASM_H
|
||||
#define MAME_EMU_DIDISASM_H
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
@ -23,12 +23,12 @@
|
||||
//**************************************************************************
|
||||
|
||||
// Disassembler constants
|
||||
const uint32_t DASMFLAG_SUPPORTED = 0x80000000; // are disassembly flags supported?
|
||||
const uint32_t DASMFLAG_STEP_OUT = 0x40000000; // this instruction should be the end of a step out sequence
|
||||
const uint32_t DASMFLAG_STEP_OVER = 0x20000000; // this instruction should be stepped over by setting a breakpoint afterwards
|
||||
const uint32_t DASMFLAG_OVERINSTMASK = 0x18000000; // number of extra instructions to skip when stepping over
|
||||
const uint32_t DASMFLAG_OVERINSTSHIFT = 27; // bits to shift after masking to get the value
|
||||
const uint32_t DASMFLAG_LENGTHMASK = 0x0000ffff; // the low 16-bits contain the actual length
|
||||
const u32 DASMFLAG_SUPPORTED = 0x80000000; // are disassembly flags supported?
|
||||
const u32 DASMFLAG_STEP_OUT = 0x40000000; // this instruction should be the end of a step out sequence
|
||||
const u32 DASMFLAG_STEP_OVER = 0x20000000; // this instruction should be stepped over by setting a breakpoint afterwards
|
||||
const u32 DASMFLAG_OVERINSTMASK = 0x18000000; // number of extra instructions to skip when stepping over
|
||||
const u32 DASMFLAG_OVERINSTSHIFT = 27; // bits to shift after masking to get the value
|
||||
const u32 DASMFLAG_LENGTHMASK = 0x0000ffff; // the low 16-bits contain the actual length
|
||||
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ const uint32_t DASMFLAG_LENGTHMASK = 0x0000ffff; // the low 16-bits contain
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
typedef device_delegate<offs_t (device_t &device, std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, int options)> dasm_override_delegate;
|
||||
typedef device_delegate<offs_t (device_t &device, std::ostream &stream, offs_t pc, const u8 *oprom, const u8 *opram, int options)> dasm_override_delegate;
|
||||
|
||||
// ======================> device_disasm_interface
|
||||
|
||||
@ -66,20 +66,20 @@ public:
|
||||
virtual ~device_disasm_interface();
|
||||
|
||||
// configuration access
|
||||
uint32_t min_opcode_bytes() const { return disasm_min_opcode_bytes(); }
|
||||
uint32_t max_opcode_bytes() const { return disasm_max_opcode_bytes(); }
|
||||
u32 min_opcode_bytes() const { return disasm_min_opcode_bytes(); }
|
||||
u32 max_opcode_bytes() const { return disasm_max_opcode_bytes(); }
|
||||
|
||||
// static inline configuration helpers
|
||||
static void static_set_dasm_override(device_t &device, dasm_override_delegate dasm_override);
|
||||
|
||||
// interface for disassembly
|
||||
offs_t disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options = 0);
|
||||
offs_t disassemble(char *buffer, offs_t pc, const u8 *oprom, const u8 *opram, u32 options = 0);
|
||||
|
||||
protected:
|
||||
// required operation overrides
|
||||
virtual uint32_t disasm_min_opcode_bytes() const = 0;
|
||||
virtual uint32_t disasm_max_opcode_bytes() const = 0;
|
||||
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) = 0;
|
||||
virtual u32 disasm_min_opcode_bytes() const = 0;
|
||||
virtual u32 disasm_max_opcode_bytes() const = 0;
|
||||
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const u8 *oprom, const u8 *opram, u32 options) = 0;
|
||||
|
||||
// interface-level overrides
|
||||
virtual void interface_pre_start() override;
|
||||
@ -92,4 +92,4 @@ private:
|
||||
typedef device_interface_iterator<device_disasm_interface> disasm_interface_iterator;
|
||||
|
||||
|
||||
#endif /* __DIDISASM_H__ */
|
||||
#endif /* MAME_EMU_DIDISASM_H */
|
||||
|
@ -154,7 +154,7 @@ bool device_execute_interface::executing() const
|
||||
// remaining in this timeslice
|
||||
//-------------------------------------------------
|
||||
|
||||
int32_t device_execute_interface::cycles_remaining() const
|
||||
s32 device_execute_interface::cycles_remaining() const
|
||||
{
|
||||
return executing() ? *m_icountptr : 0;
|
||||
}
|
||||
@ -235,7 +235,7 @@ void device_execute_interface::suspend_resume_changed()
|
||||
// suspend - set a suspend reason for this device
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_execute_interface::suspend(uint32_t reason, bool eatcycles)
|
||||
void device_execute_interface::suspend(u32 reason, bool eatcycles)
|
||||
{
|
||||
if (TEMPLOG) printf("suspend %s (%X)\n", device().tag(), reason);
|
||||
// set the suspend reason and eat cycles flag
|
||||
@ -250,7 +250,7 @@ if (TEMPLOG) printf("suspend %s (%X)\n", device().tag(), reason);
|
||||
// device
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_execute_interface::resume(uint32_t reason)
|
||||
void device_execute_interface::resume(u32 reason)
|
||||
{
|
||||
if (TEMPLOG) printf("resume %s (%X)\n", device().tag(), reason);
|
||||
// clear the suspend reason and eat cycles flag
|
||||
@ -333,7 +333,7 @@ attotime device_execute_interface::local_time() const
|
||||
// cycles executed on this device
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t device_execute_interface::total_cycles() const
|
||||
u64 device_execute_interface::total_cycles() const
|
||||
{
|
||||
if (executing())
|
||||
{
|
||||
@ -350,7 +350,7 @@ uint64_t device_execute_interface::total_cycles() const
|
||||
// of clocks to cycles, rounding down if necessary
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t device_execute_interface::execute_clocks_to_cycles(uint64_t clocks) const
|
||||
u64 device_execute_interface::execute_clocks_to_cycles(u64 clocks) const
|
||||
{
|
||||
return clocks;
|
||||
}
|
||||
@ -361,7 +361,7 @@ uint64_t device_execute_interface::execute_clocks_to_cycles(uint64_t clocks) con
|
||||
// of cycles to clocks, rounding down if necessary
|
||||
//-------------------------------------------------
|
||||
|
||||
uint64_t device_execute_interface::execute_cycles_to_clocks(uint64_t cycles) const
|
||||
u64 device_execute_interface::execute_cycles_to_clocks(u64 cycles) const
|
||||
{
|
||||
return cycles;
|
||||
}
|
||||
@ -373,7 +373,7 @@ uint64_t device_execute_interface::execute_cycles_to_clocks(uint64_t cycles) con
|
||||
// operation can take
|
||||
//-------------------------------------------------
|
||||
|
||||
uint32_t device_execute_interface::execute_min_cycles() const
|
||||
u32 device_execute_interface::execute_min_cycles() const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
@ -385,7 +385,7 @@ uint32_t device_execute_interface::execute_min_cycles() const
|
||||
// operation can take
|
||||
//-------------------------------------------------
|
||||
|
||||
uint32_t device_execute_interface::execute_max_cycles() const
|
||||
u32 device_execute_interface::execute_max_cycles() const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
@ -396,7 +396,7 @@ uint32_t device_execute_interface::execute_max_cycles() const
|
||||
// of input lines for the device
|
||||
//-------------------------------------------------
|
||||
|
||||
uint32_t device_execute_interface::execute_input_lines() const
|
||||
u32 device_execute_interface::execute_input_lines() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -407,7 +407,7 @@ uint32_t device_execute_interface::execute_input_lines() const
|
||||
// IRQ vector when an acknowledge is processed
|
||||
//-------------------------------------------------
|
||||
|
||||
uint32_t device_execute_interface::execute_default_irq_vector() const
|
||||
u32 device_execute_interface::execute_default_irq_vector() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -419,7 +419,7 @@ uint32_t device_execute_interface::execute_default_irq_vector() const
|
||||
// spinning devices for performance optimization)
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_execute_interface::execute_burn(int32_t cycles)
|
||||
void device_execute_interface::execute_burn(s32 cycles)
|
||||
{
|
||||
// by default, do nothing
|
||||
}
|
||||
@ -584,7 +584,7 @@ void device_execute_interface::interface_clock_changed()
|
||||
m_attoseconds_per_cycle = HZ_TO_ATTOSECONDS(m_cycles_per_second);
|
||||
|
||||
// update the device's divisor
|
||||
int64_t attos = m_attoseconds_per_cycle;
|
||||
s64 attos = m_attoseconds_per_cycle;
|
||||
m_divshift = 0;
|
||||
while (attos >= (1UL << 31))
|
||||
{
|
||||
@ -803,7 +803,7 @@ if (TEMPLOG) printf("empty_queue(%s,%d,%d)\n", m_execute->device().tag(), m_line
|
||||
// loop over all events
|
||||
for (int curevent = 0; curevent < m_qindex; curevent++)
|
||||
{
|
||||
int32_t input_event = m_queue[curevent];
|
||||
s32 input_event = m_queue[curevent];
|
||||
|
||||
// set the input line state and vector
|
||||
m_curstate = input_event & 0xff;
|
||||
|
@ -14,8 +14,8 @@
|
||||
#error Dont include this file directly; include emu.h instead.
|
||||
#endif
|
||||
|
||||
#ifndef __DIEXEC_H__
|
||||
#define __DIEXEC_H__
|
||||
#ifndef MAME_EMU_DIEXEC_H
|
||||
#define MAME_EMU_DIEXEC_H
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
@ -23,14 +23,14 @@
|
||||
//**************************************************************************
|
||||
|
||||
// suspension reasons for executing devices
|
||||
const uint32_t SUSPEND_REASON_HALT = 0x0001; // HALT line set (or equivalent)
|
||||
const uint32_t SUSPEND_REASON_RESET = 0x0002; // RESET line set (or equivalent)
|
||||
const uint32_t SUSPEND_REASON_SPIN = 0x0004; // currently spinning
|
||||
const uint32_t SUSPEND_REASON_TRIGGER = 0x0008; // waiting for a trigger
|
||||
const uint32_t SUSPEND_REASON_DISABLE = 0x0010; // disabled (due to disable flag)
|
||||
const uint32_t SUSPEND_REASON_TIMESLICE = 0x0020; // waiting for the next timeslice
|
||||
const uint32_t SUSPEND_REASON_CLOCK = 0x0040; // currently not clocked
|
||||
const uint32_t SUSPEND_ANY_REASON = ~0; // all of the above
|
||||
constexpr u32 SUSPEND_REASON_HALT = 0x0001; // HALT line set (or equivalent)
|
||||
constexpr u32 SUSPEND_REASON_RESET = 0x0002; // RESET line set (or equivalent)
|
||||
constexpr u32 SUSPEND_REASON_SPIN = 0x0004; // currently spinning
|
||||
constexpr u32 SUSPEND_REASON_TRIGGER = 0x0008; // waiting for a trigger
|
||||
constexpr u32 SUSPEND_REASON_DISABLE = 0x0010; // disabled (due to disable flag)
|
||||
constexpr u32 SUSPEND_REASON_TIMESLICE = 0x0020; // waiting for the next timeslice
|
||||
constexpr u32 SUSPEND_REASON_CLOCK = 0x0040; // currently not clocked
|
||||
constexpr u32 SUSPEND_ANY_REASON = ~0; // all of the above
|
||||
|
||||
|
||||
// I/O line states
|
||||
@ -71,7 +71,7 @@ enum
|
||||
// MACROS
|
||||
//**************************************************************************
|
||||
|
||||
#define TIMER_CALLBACK_MEMBER(name) void name(void *ptr, int32_t param)
|
||||
#define TIMER_CALLBACK_MEMBER(name) void name(void *ptr, s32 param)
|
||||
|
||||
// IRQ callback to be called by device implementations when an IRQ is actually taken
|
||||
#define IRQ_CALLBACK_MEMBER(func) int func(device_t &device, int irqline)
|
||||
@ -138,14 +138,14 @@ public:
|
||||
|
||||
// configuration access
|
||||
bool disabled() const { return m_disabled; }
|
||||
uint64_t clocks_to_cycles(uint64_t clocks) const { return execute_clocks_to_cycles(clocks); }
|
||||
uint64_t cycles_to_clocks(uint64_t cycles) const { return execute_cycles_to_clocks(cycles); }
|
||||
uint32_t min_cycles() const { return execute_min_cycles(); }
|
||||
uint32_t max_cycles() const { return execute_max_cycles(); }
|
||||
attotime cycles_to_attotime(uint64_t cycles) const { return device().clocks_to_attotime(cycles_to_clocks(cycles)); }
|
||||
uint64_t attotime_to_cycles(const attotime &duration) const { return clocks_to_cycles(device().attotime_to_clocks(duration)); }
|
||||
uint32_t input_lines() const { return execute_input_lines(); }
|
||||
uint32_t default_irq_vector() const { return execute_default_irq_vector(); }
|
||||
u64 clocks_to_cycles(u64 clocks) const { return execute_clocks_to_cycles(clocks); }
|
||||
u64 cycles_to_clocks(u64 cycles) const { return execute_cycles_to_clocks(cycles); }
|
||||
u32 min_cycles() const { return execute_min_cycles(); }
|
||||
u32 max_cycles() const { return execute_max_cycles(); }
|
||||
attotime cycles_to_attotime(u64 cycles) const { return device().clocks_to_attotime(cycles_to_clocks(cycles)); }
|
||||
u64 attotime_to_cycles(const attotime &duration) const { return clocks_to_cycles(device().attotime_to_clocks(duration)); }
|
||||
u32 input_lines() const { return execute_input_lines(); }
|
||||
u32 default_irq_vector() const { return execute_default_irq_vector(); }
|
||||
|
||||
// static inline configuration helpers
|
||||
static void static_set_disable(device_t &device);
|
||||
@ -156,7 +156,7 @@ public:
|
||||
// execution management
|
||||
device_scheduler &scheduler() const { assert(m_scheduler != nullptr); return *m_scheduler; }
|
||||
bool executing() const;
|
||||
int32_t cycles_remaining() const;
|
||||
s32 cycles_remaining() const;
|
||||
void eat_cycles(int cycles);
|
||||
void adjust_icount(int delta);
|
||||
void abort_timeslice();
|
||||
@ -168,9 +168,9 @@ public:
|
||||
int input_state(int linenum) const { return m_input[linenum].m_curstate; }
|
||||
|
||||
// suspend/resume
|
||||
void suspend(uint32_t reason, bool eatcycles);
|
||||
void resume(uint32_t reason);
|
||||
bool suspended(uint32_t reason = SUSPEND_ANY_REASON) const { return (m_nextsuspend & reason) != 0; }
|
||||
void suspend(u32 reason, bool eatcycles);
|
||||
void resume(u32 reason);
|
||||
bool suspended(u32 reason = SUSPEND_ANY_REASON) const { return (m_nextsuspend & reason) != 0; }
|
||||
void yield() { suspend(SUSPEND_REASON_TIMESLICE, false); }
|
||||
void spin() { suspend(SUSPEND_REASON_TIMESLICE, true); }
|
||||
void spin_until_trigger(int trigid) { suspend_until_trigger(trigid, true); }
|
||||
@ -184,7 +184,7 @@ public:
|
||||
|
||||
// time and cycle accounting
|
||||
attotime local_time() const;
|
||||
uint64_t total_cycles() const;
|
||||
u64 total_cycles() const;
|
||||
|
||||
// required operation overrides
|
||||
void run() { execute_run(); }
|
||||
@ -195,18 +195,18 @@ public:
|
||||
|
||||
protected:
|
||||
// clock and cycle information getters
|
||||
virtual uint64_t execute_clocks_to_cycles(uint64_t clocks) const;
|
||||
virtual uint64_t execute_cycles_to_clocks(uint64_t cycles) const;
|
||||
virtual uint32_t execute_min_cycles() const;
|
||||
virtual uint32_t execute_max_cycles() const;
|
||||
virtual u64 execute_clocks_to_cycles(u64 clocks) const;
|
||||
virtual u64 execute_cycles_to_clocks(u64 cycles) const;
|
||||
virtual u32 execute_min_cycles() const;
|
||||
virtual u32 execute_max_cycles() const;
|
||||
|
||||
// input line information getters
|
||||
virtual uint32_t execute_input_lines() const;
|
||||
virtual uint32_t execute_default_irq_vector() const;
|
||||
virtual u32 execute_input_lines() const;
|
||||
virtual u32 execute_default_irq_vector() const;
|
||||
|
||||
// optional operation overrides
|
||||
virtual void execute_run() = 0;
|
||||
virtual void execute_burn(int32_t cycles);
|
||||
virtual void execute_burn(s32 cycles);
|
||||
virtual void execute_set_input(int linenum, int state);
|
||||
|
||||
// interface-level overrides
|
||||
@ -239,10 +239,10 @@ protected:
|
||||
device_execute_interface *m_execute;// pointer to the execute interface
|
||||
int m_linenum; // which input line we are
|
||||
|
||||
int32_t m_stored_vector; // most recently written vector
|
||||
int32_t m_curvector; // most recently processed vector
|
||||
uint8_t m_curstate; // most recently processed state
|
||||
int32_t m_queue[32]; // queue of pending events
|
||||
s32 m_stored_vector; // most recently written vector
|
||||
s32 m_curvector; // most recently processed vector
|
||||
u8 m_curstate; // most recently processed state
|
||||
s32 m_queue[32]; // queue of pending events
|
||||
int m_qindex; // index within the queue
|
||||
|
||||
private:
|
||||
@ -274,19 +274,19 @@ protected:
|
||||
int m_cycles_stolen; // number of cycles we artificially stole
|
||||
|
||||
// suspend states
|
||||
uint32_t m_suspend; // suspend reason mask (0 = not suspended)
|
||||
uint32_t m_nextsuspend; // pending suspend reason mask
|
||||
uint8_t m_eatcycles; // true if we eat cycles while suspended
|
||||
uint8_t m_nexteatcycles; // pending value
|
||||
int32_t m_trigger; // pending trigger to release a trigger suspension
|
||||
int32_t m_inttrigger; // interrupt trigger index
|
||||
u32 m_suspend; // suspend reason mask (0 = not suspended)
|
||||
u32 m_nextsuspend; // pending suspend reason mask
|
||||
u8 m_eatcycles; // true if we eat cycles while suspended
|
||||
u8 m_nexteatcycles; // pending value
|
||||
s32 m_trigger; // pending trigger to release a trigger suspension
|
||||
s32 m_inttrigger; // interrupt trigger index
|
||||
|
||||
// clock and timing information
|
||||
uint64_t m_totalcycles; // total device cycles executed
|
||||
u64 m_totalcycles; // total device cycles executed
|
||||
attotime m_localtime; // local time, relative to the timer system's global time
|
||||
int32_t m_divisor; // 32-bit attoseconds_per_cycle divisor
|
||||
uint8_t m_divshift; // right shift amount to fit the divisor into 32 bits
|
||||
uint32_t m_cycles_per_second; // cycles per second, adjusted for multipliers
|
||||
s32 m_divisor; // 32-bit attoseconds_per_cycle divisor
|
||||
u8 m_divshift; // right shift amount to fit the divisor into 32 bits
|
||||
u32 m_cycles_per_second; // cycles per second, adjusted for multipliers
|
||||
attoseconds_t m_attoseconds_per_cycle; // attoseconds per adjusted clock cycle
|
||||
|
||||
private:
|
||||
@ -305,4 +305,4 @@ private:
|
||||
typedef device_interface_iterator<device_execute_interface> execute_interface_iterator;
|
||||
|
||||
|
||||
#endif /* __DIEXEC_H__ */
|
||||
#endif /* MAME_EMU_DIEXEC_H */
|
||||
|
@ -124,23 +124,23 @@ void device_gfx_interface::decode_gfx(const gfx_decode_entry *gfxdecodeinfo)
|
||||
|
||||
// local variables to hold mutable copies of gfx layout data
|
||||
gfx_layout glcopy;
|
||||
std::vector<uint32_t> extxoffs(0);
|
||||
std::vector<uint32_t> extyoffs(0);
|
||||
std::vector<u32> extxoffs(0);
|
||||
std::vector<u32> extyoffs(0);
|
||||
|
||||
// loop over all elements
|
||||
for (uint8_t curgfx = 0; curgfx < MAX_GFX_ELEMENTS && gfxdecodeinfo[curgfx].gfxlayout != nullptr; curgfx++)
|
||||
for (u8 curgfx = 0; curgfx < MAX_GFX_ELEMENTS && gfxdecodeinfo[curgfx].gfxlayout != nullptr; curgfx++)
|
||||
{
|
||||
const gfx_decode_entry &gfx = gfxdecodeinfo[curgfx];
|
||||
|
||||
// extract the scale factors and xormask
|
||||
uint32_t xscale = GFXENTRY_GETXSCALE(gfx.flags);
|
||||
uint32_t yscale = GFXENTRY_GETYSCALE(gfx.flags);
|
||||
uint32_t xormask = GFXENTRY_ISREVERSE(gfx.flags) ? 7 : 0;
|
||||
u32 xscale = GFXENTRY_GETXSCALE(gfx.flags);
|
||||
u32 yscale = GFXENTRY_GETYSCALE(gfx.flags);
|
||||
u32 xormask = GFXENTRY_ISREVERSE(gfx.flags) ? 7 : 0;
|
||||
|
||||
// resolve the region
|
||||
uint32_t region_length;
|
||||
const uint8_t *region_base;
|
||||
uint8_t region_width;
|
||||
u32 region_length;
|
||||
const u8 *region_base;
|
||||
u8 region_width;
|
||||
endianness_t region_endianness;
|
||||
|
||||
if (gfx.memory_region != nullptr)
|
||||
@ -151,7 +151,7 @@ void device_gfx_interface::decode_gfx(const gfx_decode_entry *gfxdecodeinfo)
|
||||
memory_share *share = basedevice.memshare(gfx.memory_region);
|
||||
assert(share != nullptr);
|
||||
region_length = 8 * share->bytes();
|
||||
region_base = reinterpret_cast<uint8_t *>(share->ptr());
|
||||
region_base = reinterpret_cast<u8 *>(share->ptr());
|
||||
region_width = share->bytewidth();
|
||||
region_endianness = share->endianness();
|
||||
}
|
||||
@ -205,8 +205,8 @@ void device_gfx_interface::decode_gfx(const gfx_decode_entry *gfxdecodeinfo)
|
||||
// copy the X and Y offsets into our temporary arrays
|
||||
extxoffs.resize(glcopy.width * xscale);
|
||||
extyoffs.resize(glcopy.height * yscale);
|
||||
memcpy(&extxoffs[0], (glcopy.extxoffs != nullptr) ? glcopy.extxoffs : glcopy.xoffset, glcopy.width * sizeof(uint32_t));
|
||||
memcpy(&extyoffs[0], (glcopy.extyoffs != nullptr) ? glcopy.extyoffs : glcopy.yoffset, glcopy.height * sizeof(uint32_t));
|
||||
memcpy(&extxoffs[0], (glcopy.extxoffs != nullptr) ? glcopy.extxoffs : glcopy.xoffset, glcopy.width * sizeof(u32));
|
||||
memcpy(&extyoffs[0], (glcopy.extyoffs != nullptr) ? glcopy.extyoffs : glcopy.yoffset, glcopy.height * sizeof(u32));
|
||||
|
||||
// always use the extended offsets here
|
||||
glcopy.extxoffs = &extxoffs[0];
|
||||
@ -229,7 +229,7 @@ void device_gfx_interface::decode_gfx(const gfx_decode_entry *gfxdecodeinfo)
|
||||
// loop over all the planes, converting fractions
|
||||
for (int j = 0; j < glcopy.planes; j++)
|
||||
{
|
||||
uint32_t value1 = glcopy.planeoffset[j];
|
||||
u32 value1 = glcopy.planeoffset[j];
|
||||
if (IS_FRAC(value1))
|
||||
{
|
||||
assert(region_length != 0);
|
||||
@ -240,7 +240,7 @@ void device_gfx_interface::decode_gfx(const gfx_decode_entry *gfxdecodeinfo)
|
||||
// loop over all the X/Y offsets, converting fractions
|
||||
for (int j = 0; j < glcopy.width; j++)
|
||||
{
|
||||
uint32_t value2 = extxoffs[j];
|
||||
u32 value2 = extxoffs[j];
|
||||
if (IS_FRAC(value2))
|
||||
{
|
||||
assert(region_length != 0);
|
||||
@ -250,7 +250,7 @@ void device_gfx_interface::decode_gfx(const gfx_decode_entry *gfxdecodeinfo)
|
||||
|
||||
for (int j = 0; j < glcopy.height; j++)
|
||||
{
|
||||
uint32_t value3 = extyoffs[j];
|
||||
u32 value3 = extyoffs[j];
|
||||
if (IS_FRAC(value3))
|
||||
{
|
||||
assert(region_length != 0);
|
||||
@ -328,7 +328,7 @@ void device_gfx_interface::interface_validity_check(validity_checker &valid) con
|
||||
else
|
||||
gfxregion = device().owner()->subtag(region);
|
||||
|
||||
uint32_t region_length = valid.region_length(gfxregion.c_str());
|
||||
u32 region_length = valid.region_length(gfxregion.c_str());
|
||||
if (region_length == 0)
|
||||
osd_printf_error("gfx[%d] references nonexistent region '%s'\n", gfxnum, gfxregion.c_str());
|
||||
|
||||
|
@ -14,8 +14,8 @@
|
||||
#error Dont include this file directly; include emu.h instead.
|
||||
#endif
|
||||
|
||||
#ifndef __DIGFX_H__
|
||||
#define __DIGFX_H__
|
||||
#ifndef MAME_EMU_DIGFX_H
|
||||
#define MAME_EMU_DIGFX_H
|
||||
|
||||
|
||||
|
||||
@ -23,9 +23,9 @@
|
||||
// CONSTANTS
|
||||
//**************************************************************************
|
||||
|
||||
const uint8_t MAX_GFX_ELEMENTS = 32;
|
||||
const uint16_t MAX_GFX_PLANES = 8;
|
||||
const uint16_t MAX_GFX_SIZE = 32;
|
||||
constexpr u8 MAX_GFX_ELEMENTS = 32;
|
||||
constexpr u16 MAX_GFX_PLANES = 8;
|
||||
constexpr u16 MAX_GFX_SIZE = 32;
|
||||
|
||||
|
||||
|
||||
@ -160,29 +160,29 @@ class palette_device;
|
||||
|
||||
struct gfx_layout
|
||||
{
|
||||
uint32_t xoffs(int x) const { return (extxoffs != nullptr) ? extxoffs[x] : xoffset[x]; }
|
||||
uint32_t yoffs(int y) const { return (extyoffs != nullptr) ? extyoffs[y] : yoffset[y]; }
|
||||
u32 xoffs(int x) const { return (extxoffs != nullptr) ? extxoffs[x] : xoffset[x]; }
|
||||
u32 yoffs(int y) const { return (extyoffs != nullptr) ? extyoffs[y] : yoffset[y]; }
|
||||
|
||||
uint16_t width; // pixel width of each element
|
||||
uint16_t height; // pixel height of each element
|
||||
uint32_t total; // total number of elements, or RGN_FRAC()
|
||||
uint16_t planes; // number of bitplanes
|
||||
uint32_t planeoffset[MAX_GFX_PLANES]; // bit offset of each bitplane
|
||||
uint32_t xoffset[MAX_GFX_SIZE]; // bit offset of each horizontal pixel
|
||||
uint32_t yoffset[MAX_GFX_SIZE]; // bit offset of each vertical pixel
|
||||
uint32_t charincrement; // distance between two consecutive elements (in bits)
|
||||
const uint32_t * extxoffs; // extended X offset array for really big layouts
|
||||
const uint32_t * extyoffs; // extended Y offset array for really big layouts
|
||||
u16 width; // pixel width of each element
|
||||
u16 height; // pixel height of each element
|
||||
u32 total; // total number of elements, or RGN_FRAC()
|
||||
u16 planes; // number of bitplanes
|
||||
u32 planeoffset[MAX_GFX_PLANES]; // bit offset of each bitplane
|
||||
u32 xoffset[MAX_GFX_SIZE]; // bit offset of each horizontal pixel
|
||||
u32 yoffset[MAX_GFX_SIZE]; // bit offset of each vertical pixel
|
||||
u32 charincrement; // distance between two consecutive elements (in bits)
|
||||
const u32 * extxoffs; // extended X offset array for really big layouts
|
||||
const u32 * extyoffs; // extended Y offset array for really big layouts
|
||||
};
|
||||
|
||||
struct gfx_decode_entry
|
||||
{
|
||||
const char * memory_region; // memory region where the data resides
|
||||
uint32_t start; // offset of beginning of data to decode
|
||||
u32 start; // offset of beginning of data to decode
|
||||
const gfx_layout *gfxlayout; // pointer to gfx_layout describing the layout; nullptr marks the end of the array
|
||||
uint16_t color_codes_start; // offset in the color lookup table where color codes start
|
||||
uint16_t total_color_codes; // total number of color codes
|
||||
uint32_t flags; // flags and optional scaling factors
|
||||
u16 color_codes_start; // offset in the color lookup table where color codes start
|
||||
u16 total_color_codes; // total number of color codes
|
||||
u32 flags; // flags and optional scaling factors
|
||||
};
|
||||
|
||||
// ======================> device_gfx_interface
|
||||
@ -201,13 +201,13 @@ public:
|
||||
|
||||
// getters
|
||||
palette_device &palette() const { assert(m_palette != nullptr); return *m_palette; }
|
||||
gfx_element *gfx(uint8_t index) const { assert(index < MAX_GFX_ELEMENTS); return m_gfx[index].get(); }
|
||||
gfx_element *gfx(u8 index) const { assert(index < MAX_GFX_ELEMENTS); return m_gfx[index].get(); }
|
||||
|
||||
// decoding
|
||||
void decode_gfx(const gfx_decode_entry *gfxdecodeinfo);
|
||||
void decode_gfx() { decode_gfx(m_gfxdecodeinfo); }
|
||||
|
||||
void set_gfx(uint8_t index, std::unique_ptr<gfx_element> &&element) { assert(index < MAX_GFX_ELEMENTS); m_gfx[index] = std::move(element); }
|
||||
void set_gfx(u8 index, std::unique_ptr<gfx_element> &&element) { assert(index < MAX_GFX_ELEMENTS); m_gfx[index] = std::move(element); }
|
||||
|
||||
protected:
|
||||
// interface-level overrides
|
||||
@ -232,4 +232,4 @@ private:
|
||||
typedef device_interface_iterator<device_gfx_interface> gfx_interface_iterator;
|
||||
|
||||
|
||||
#endif /* __DIGFX_H__ */
|
||||
#endif /* MAME_EMU_DIGFX_H */
|
||||
|
@ -177,7 +177,7 @@ void device_image_interface::device_compute_hash(util::hash_collection &hashes,
|
||||
if (partialhash)
|
||||
partialhash(hashes, (const unsigned char*)data, length, types);
|
||||
else
|
||||
hashes.compute(reinterpret_cast<const uint8_t *>(data), length, types);
|
||||
hashes.compute(reinterpret_cast<const u8 *>(data), length, types);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -431,7 +431,7 @@ const std::string &device_image_interface::working_directory()
|
||||
// get_software_region
|
||||
//-------------------------------------------------
|
||||
|
||||
uint8_t *device_image_interface::get_software_region(const char *tag)
|
||||
u8 *device_image_interface::get_software_region(const char *tag)
|
||||
{
|
||||
char full_tag[256];
|
||||
|
||||
@ -448,7 +448,7 @@ uint8_t *device_image_interface::get_software_region(const char *tag)
|
||||
// image_get_software_region_length
|
||||
//-------------------------------------------------
|
||||
|
||||
uint32_t device_image_interface::get_software_region_length(const char *tag)
|
||||
u32 device_image_interface::get_software_region_length(const char *tag)
|
||||
{
|
||||
char full_tag[256];
|
||||
|
||||
@ -473,7 +473,7 @@ const char *device_image_interface::get_feature(const char *feature_name)
|
||||
// load_software_region -
|
||||
//-------------------------------------------------
|
||||
|
||||
bool device_image_interface::load_software_region(const char *tag, optional_shared_ptr<uint8_t> &ptr)
|
||||
bool device_image_interface::load_software_region(const char *tag, optional_shared_ptr<u8> &ptr)
|
||||
{
|
||||
size_t size = get_software_region_length(tag);
|
||||
|
||||
@ -498,11 +498,11 @@ bool device_image_interface::load_software_region(const char *tag, optional_shar
|
||||
void device_image_interface::run_hash(void (*partialhash)(util::hash_collection &, const unsigned char *, unsigned long, const char *),
|
||||
util::hash_collection &hashes, const char *types)
|
||||
{
|
||||
uint32_t size;
|
||||
std::vector<uint8_t> buf;
|
||||
u32 size;
|
||||
std::vector<u8> buf;
|
||||
|
||||
hashes.reset();
|
||||
size = (uint32_t) length();
|
||||
size = (u32) length();
|
||||
|
||||
buf.resize(size);
|
||||
memset(&buf[0], 0, size);
|
||||
@ -527,7 +527,7 @@ void device_image_interface::image_checkhash()
|
||||
device_image_partialhash_func partialhash;
|
||||
|
||||
// only calculate CRC if it hasn't been calculated, and the open_mode is read only
|
||||
uint32_t crcval;
|
||||
u32 crcval;
|
||||
if (!m_hash.crc(crcval) && is_readonly() && !m_created)
|
||||
{
|
||||
// do not cause a linear read of 600 megs please
|
||||
@ -547,9 +547,9 @@ void device_image_interface::image_checkhash()
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t device_image_interface::crc()
|
||||
u32 device_image_interface::crc()
|
||||
{
|
||||
uint32_t crc = 0;
|
||||
u32 crc = 0;
|
||||
|
||||
image_checkhash();
|
||||
m_hash.crc(crc);
|
||||
@ -741,7 +741,7 @@ image_error_t device_image_interface::image_error_from_file_error(osd_file::erro
|
||||
// specific path
|
||||
//-------------------------------------------------
|
||||
|
||||
image_error_t device_image_interface::load_image_by_path(uint32_t open_flags, const std::string &path)
|
||||
image_error_t device_image_interface::load_image_by_path(u32 open_flags, const std::string &path)
|
||||
{
|
||||
std::string revised_path;
|
||||
|
||||
@ -786,9 +786,9 @@ int device_image_interface::reopen_for_write(const std::string &path)
|
||||
// flags to use, and in what order
|
||||
//-------------------------------------------------
|
||||
|
||||
std::vector<uint32_t> device_image_interface::determine_open_plan(bool is_create)
|
||||
std::vector<u32> device_image_interface::determine_open_plan(bool is_create)
|
||||
{
|
||||
std::vector<uint32_t> open_plan;
|
||||
std::vector<u32> open_plan;
|
||||
|
||||
// emit flags into a vector
|
||||
if (!is_create && is_readable() && is_writeable())
|
||||
@ -822,13 +822,13 @@ static void dump_wrong_and_correct_checksums(const util::hash_collection &hashes
|
||||
// and hash signatures of a file
|
||||
//-------------------------------------------------
|
||||
|
||||
static int verify_length_and_hash(emu_file *file, const char *name, uint32_t explength, const util::hash_collection &hashes)
|
||||
static int verify_length_and_hash(emu_file *file, const char *name, u32 explength, const util::hash_collection &hashes)
|
||||
{
|
||||
int retVal = 0;
|
||||
if (file==nullptr) return 0;
|
||||
|
||||
// verify length
|
||||
uint32_t actlength = file->size();
|
||||
u32 actlength = file->size();
|
||||
if (explength != actlength)
|
||||
{
|
||||
osd_printf_error("%s WRONG LENGTH (expected: %d found: %d)\n", name, explength, actlength);
|
||||
@ -879,14 +879,14 @@ bool device_image_interface::load_software(software_list_device &swlist, const c
|
||||
{
|
||||
osd_file::error filerr = osd_file::error::NOT_FOUND;
|
||||
|
||||
uint32_t crc = 0;
|
||||
u32 crc = 0;
|
||||
bool has_crc = util::hash_collection(ROM_GETHASHDATA(romp)).crc(crc);
|
||||
|
||||
const software_info *swinfo = swlist.find(swname);
|
||||
if (swinfo == nullptr)
|
||||
return false;
|
||||
|
||||
uint32_t supported = swinfo->supported();
|
||||
u32 supported = swinfo->supported();
|
||||
if (supported == SOFTWARE_SUPPORTED_PARTIAL)
|
||||
osd_printf_error("WARNING: support for software %s (in list %s) is only partial\n", swname, swlist.list_name().c_str());
|
||||
if (supported == SOFTWARE_SUPPORTED_NO)
|
||||
@ -984,7 +984,7 @@ image_init_result device_image_interface::load_internal(const std::string &path,
|
||||
if (core_opens_image_file())
|
||||
{
|
||||
// determine open plan
|
||||
std::vector<uint32_t> open_plan = determine_open_plan(is_create);
|
||||
std::vector<u32> open_plan = determine_open_plan(is_create);
|
||||
|
||||
// attempt to open the file in various ways
|
||||
for (auto iter = open_plan.cbegin(); !m_file && iter != open_plan.cend(); iter++)
|
||||
@ -1491,7 +1491,7 @@ std::string device_image_interface::software_get_default_slot(const char *defaul
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
static int image_fseek_thunk(void *file, int64_t offset, int whence)
|
||||
static int image_fseek_thunk(void *file, s64 offset, int whence)
|
||||
{
|
||||
device_image_interface *image = (device_image_interface *) file;
|
||||
return image->fseek(offset, whence);
|
||||
@ -1509,7 +1509,7 @@ static size_t image_fwrite_thunk(void *file, const void *buffer, size_t length)
|
||||
return image->fwrite(buffer, length);
|
||||
}
|
||||
|
||||
static uint64_t image_fsize_thunk(void *file)
|
||||
static u64 image_fsize_thunk(void *file)
|
||||
{
|
||||
device_image_interface *image = (device_image_interface *) file;
|
||||
return image->length();
|
||||
|
@ -14,8 +14,8 @@
|
||||
#error Dont include this file directly; include emu.h instead.
|
||||
#endif
|
||||
|
||||
#ifndef __DIIMAGE_H__
|
||||
#define __DIIMAGE_H__
|
||||
#ifndef MAME_EMU_DIIMAGE_H
|
||||
#define MAME_EMU_DIIMAGE_H
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
@ -179,16 +179,16 @@ public:
|
||||
bool is_filetype(const std::string &candidate_filetype) { return !core_stricmp(filetype().c_str(), candidate_filetype.c_str()); }
|
||||
bool is_open() const { return bool(m_file); }
|
||||
util::core_file &image_core_file() const { return *m_file; }
|
||||
uint64_t length() { check_for_file(); return m_file->size(); }
|
||||
u64 length() { check_for_file(); return m_file->size(); }
|
||||
bool is_readonly() const { return m_readonly; }
|
||||
uint32_t fread(void *buffer, uint32_t length) { check_for_file(); return m_file->read(buffer, length); }
|
||||
uint32_t fread(optional_shared_ptr<uint8_t> &ptr, uint32_t length) { ptr.allocate(length); return fread(ptr.target(), length); }
|
||||
uint32_t fread(optional_shared_ptr<uint8_t> &ptr, uint32_t length, offs_t offset) { ptr.allocate(length); return fread(ptr + offset, length - offset); }
|
||||
uint32_t fwrite(const void *buffer, uint32_t length) { check_for_file(); return m_file->write(buffer, length); }
|
||||
int fseek(int64_t offset, int whence) { check_for_file(); return m_file->seek(offset, whence); }
|
||||
uint64_t ftell() { check_for_file(); return m_file->tell(); }
|
||||
u32 fread(void *buffer, u32 length) { check_for_file(); return m_file->read(buffer, length); }
|
||||
u32 fread(optional_shared_ptr<u8> &ptr, u32 length) { ptr.allocate(length); return fread(ptr.target(), length); }
|
||||
u32 fread(optional_shared_ptr<u8> &ptr, u32 length, offs_t offset) { ptr.allocate(length); return fread(ptr + offset, length - offset); }
|
||||
u32 fwrite(const void *buffer, u32 length) { check_for_file(); return m_file->write(buffer, length); }
|
||||
int fseek(s64 offset, int whence) { check_for_file(); return m_file->seek(offset, whence); }
|
||||
u64 ftell() { check_for_file(); return m_file->tell(); }
|
||||
int fgetc() { char ch; if (fread(&ch, 1) != 1) ch = '\0'; return ch; }
|
||||
char *fgets(char *buffer, uint32_t length) { check_for_file(); return m_file->gets(buffer, length); }
|
||||
char *fgets(char *buffer, u32 length) { check_for_file(); return m_file->gets(buffer, length); }
|
||||
int image_feof() { check_for_file(); return m_file->eof(); }
|
||||
void *ptr() {check_for_file(); return const_cast<void *>(m_file->buffer()); }
|
||||
// configuration access
|
||||
@ -197,7 +197,7 @@ public:
|
||||
const std::string &longname() const { return m_longname; }
|
||||
const std::string &manufacturer() const { return m_manufacturer; }
|
||||
const std::string &year() const { return m_year; }
|
||||
uint32_t supported() const { return m_supported; }
|
||||
u32 supported() const { return m_supported; }
|
||||
|
||||
const software_info *software_entry() const { return m_software_info_ptr; }
|
||||
const software_part *part_entry() const { return m_software_part_ptr; }
|
||||
@ -207,12 +207,12 @@ public:
|
||||
void set_working_directory(const char *working_directory) { m_working_directory = working_directory; }
|
||||
const std::string &working_directory();
|
||||
|
||||
uint8_t *get_software_region(const char *tag);
|
||||
uint32_t get_software_region_length(const char *tag);
|
||||
u8 *get_software_region(const char *tag);
|
||||
u32 get_software_region_length(const char *tag);
|
||||
const char *get_feature(const char *feature_name);
|
||||
bool load_software_region(const char *tag, optional_shared_ptr<uint8_t> &ptr);
|
||||
bool load_software_region(const char *tag, optional_shared_ptr<u8> &ptr);
|
||||
|
||||
uint32_t crc();
|
||||
u32 crc();
|
||||
util::hash_collection& hash() { return m_hash; }
|
||||
|
||||
void battery_load(void *buffer, int length, int fill);
|
||||
@ -255,7 +255,7 @@ protected:
|
||||
virtual const bool use_software_list_file_extension_for_filetype() const { return false; }
|
||||
|
||||
image_init_result load_internal(const std::string &path, bool is_create, int create_format, util::option_resolution *create_args, bool just_load);
|
||||
image_error_t load_image_by_path(uint32_t open_flags, const std::string &path);
|
||||
image_error_t load_image_by_path(u32 open_flags, const std::string &path);
|
||||
void clear();
|
||||
bool is_loaded();
|
||||
|
||||
@ -308,7 +308,7 @@ protected:
|
||||
private:
|
||||
static image_error_t image_error_from_file_error(osd_file::error filerr);
|
||||
bool schedule_postload_hard_reset_if_needed();
|
||||
std::vector<uint32_t> determine_open_plan(bool is_create);
|
||||
std::vector<u32> determine_open_plan(bool is_create);
|
||||
|
||||
// creation info
|
||||
formatlist_type m_formatlist;
|
||||
@ -320,7 +320,7 @@ private:
|
||||
std::string m_longname;
|
||||
std::string m_manufacturer;
|
||||
std::string m_year;
|
||||
uint32_t m_supported;
|
||||
u32 m_supported;
|
||||
|
||||
// flags
|
||||
bool m_readonly;
|
||||
@ -346,4 +346,4 @@ private:
|
||||
// iterator
|
||||
typedef device_interface_iterator<device_image_interface> image_interface_iterator;
|
||||
|
||||
#endif /* __DIIMAGE_H__ */
|
||||
#endif /* MAME_EMU_DIIMAGE_H */
|
||||
|
@ -50,7 +50,7 @@ address_space_config::address_space_config()
|
||||
@param internal
|
||||
@param defmap
|
||||
*/
|
||||
address_space_config::address_space_config(const char *name, endianness_t endian, uint8_t datawidth, uint8_t addrwidth, int8_t addrshift, address_map_constructor internal, address_map_constructor defmap)
|
||||
address_space_config::address_space_config(const char *name, endianness_t endian, u8 datawidth, u8 addrwidth, s8 addrshift, address_map_constructor internal, address_map_constructor defmap)
|
||||
: m_name(name),
|
||||
m_endianness(endian),
|
||||
m_databus_width(datawidth),
|
||||
@ -64,7 +64,7 @@ address_space_config::address_space_config(const char *name, endianness_t endian
|
||||
{
|
||||
}
|
||||
|
||||
address_space_config::address_space_config(const char *name, endianness_t endian, uint8_t datawidth, uint8_t addrwidth, int8_t addrshift, uint8_t logwidth, uint8_t pageshift, address_map_constructor internal, address_map_constructor defmap)
|
||||
address_space_config::address_space_config(const char *name, endianness_t endian, u8 datawidth, u8 addrwidth, s8 addrshift, u8 logwidth, u8 pageshift, address_map_constructor internal, address_map_constructor defmap)
|
||||
: m_name(name),
|
||||
m_endianness(endian),
|
||||
m_databus_width(datawidth),
|
||||
@ -78,7 +78,7 @@ address_space_config::address_space_config(const char *name, endianness_t endian
|
||||
{
|
||||
}
|
||||
|
||||
address_space_config::address_space_config(const char *name, endianness_t endian, uint8_t datawidth, uint8_t addrwidth, int8_t addrshift, address_map_delegate internal, address_map_delegate defmap)
|
||||
address_space_config::address_space_config(const char *name, endianness_t endian, u8 datawidth, u8 addrwidth, s8 addrshift, address_map_delegate internal, address_map_delegate defmap)
|
||||
: m_name(name),
|
||||
m_endianness(endian),
|
||||
m_databus_width(datawidth),
|
||||
@ -94,7 +94,7 @@ address_space_config::address_space_config(const char *name, endianness_t endian
|
||||
{
|
||||
}
|
||||
|
||||
address_space_config::address_space_config(const char *name, endianness_t endian, uint8_t datawidth, uint8_t addrwidth, int8_t addrshift, uint8_t logwidth, uint8_t pageshift, address_map_delegate internal, address_map_delegate defmap)
|
||||
address_space_config::address_space_config(const char *name, endianness_t endian, u8 datawidth, u8 addrwidth, s8 addrshift, u8 logwidth, u8 pageshift, address_map_delegate internal, address_map_delegate defmap)
|
||||
: m_name(name),
|
||||
m_endianness(endian),
|
||||
m_databus_width(datawidth),
|
||||
@ -189,7 +189,7 @@ bool device_memory_interface::memory_translate(address_spacenum spacenum, int in
|
||||
// handled by bypassing the memory system
|
||||
//-------------------------------------------------
|
||||
|
||||
bool device_memory_interface::memory_read(address_spacenum spacenum, offs_t offset, int size, uint64_t &value)
|
||||
bool device_memory_interface::memory_read(address_spacenum spacenum, offs_t offset, int size, u64 &value)
|
||||
{
|
||||
// by default, we don't do anything
|
||||
return false;
|
||||
@ -204,7 +204,7 @@ bool device_memory_interface::memory_read(address_spacenum spacenum, offs_t offs
|
||||
// handled by bypassing the memory system
|
||||
//-------------------------------------------------
|
||||
|
||||
bool device_memory_interface::memory_write(address_spacenum spacenum, offs_t offset, int size, uint64_t value)
|
||||
bool device_memory_interface::memory_write(address_spacenum spacenum, offs_t offset, int size, u64 value)
|
||||
{
|
||||
// by default, we don't do anything
|
||||
return false;
|
||||
@ -220,7 +220,7 @@ bool device_memory_interface::memory_write(address_spacenum spacenum, offs_t off
|
||||
// system
|
||||
//-------------------------------------------------
|
||||
|
||||
bool device_memory_interface::memory_readop(offs_t offset, int size, uint64_t &value)
|
||||
bool device_memory_interface::memory_readop(offs_t offset, int size, u64 &value)
|
||||
{
|
||||
// by default, we don't do anything
|
||||
return false;
|
||||
|
@ -14,8 +14,8 @@
|
||||
#error Dont include this file directly; include emu.h instead.
|
||||
#endif
|
||||
|
||||
#ifndef __DIMEMORY_H__
|
||||
#define __DIMEMORY_H__
|
||||
#ifndef MAME_EMU_DIMEMORY_H
|
||||
#define MAME_EMU_DIMEMORY_H
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
@ -23,19 +23,19 @@
|
||||
//**************************************************************************
|
||||
|
||||
// Translation intentions
|
||||
const int TRANSLATE_TYPE_MASK = 0x03; // read write or fetch
|
||||
const int TRANSLATE_USER_MASK = 0x04; // user mode or fully privileged
|
||||
const int TRANSLATE_DEBUG_MASK = 0x08; // debug mode (no side effects)
|
||||
constexpr int TRANSLATE_TYPE_MASK = 0x03; // read write or fetch
|
||||
constexpr int TRANSLATE_USER_MASK = 0x04; // user mode or fully privileged
|
||||
constexpr int TRANSLATE_DEBUG_MASK = 0x08; // debug mode (no side effects)
|
||||
|
||||
const int TRANSLATE_READ = 0; // translate for read
|
||||
const int TRANSLATE_WRITE = 1; // translate for write
|
||||
const int TRANSLATE_FETCH = 2; // translate for instruction fetch
|
||||
const int TRANSLATE_READ_USER = (TRANSLATE_READ | TRANSLATE_USER_MASK);
|
||||
const int TRANSLATE_WRITE_USER = (TRANSLATE_WRITE | TRANSLATE_USER_MASK);
|
||||
const int TRANSLATE_FETCH_USER = (TRANSLATE_FETCH | TRANSLATE_USER_MASK);
|
||||
const int TRANSLATE_READ_DEBUG = (TRANSLATE_READ | TRANSLATE_DEBUG_MASK);
|
||||
const int TRANSLATE_WRITE_DEBUG = (TRANSLATE_WRITE | TRANSLATE_DEBUG_MASK);
|
||||
const int TRANSLATE_FETCH_DEBUG = (TRANSLATE_FETCH | TRANSLATE_DEBUG_MASK);
|
||||
constexpr int TRANSLATE_READ = 0; // translate for read
|
||||
constexpr int TRANSLATE_WRITE = 1; // translate for write
|
||||
constexpr int TRANSLATE_FETCH = 2; // translate for instruction fetch
|
||||
constexpr int TRANSLATE_READ_USER = (TRANSLATE_READ | TRANSLATE_USER_MASK);
|
||||
constexpr int TRANSLATE_WRITE_USER = (TRANSLATE_WRITE | TRANSLATE_USER_MASK);
|
||||
constexpr int TRANSLATE_FETCH_USER = (TRANSLATE_FETCH | TRANSLATE_USER_MASK);
|
||||
constexpr int TRANSLATE_READ_DEBUG = (TRANSLATE_READ | TRANSLATE_DEBUG_MASK);
|
||||
constexpr int TRANSLATE_WRITE_DEBUG = (TRANSLATE_WRITE | TRANSLATE_DEBUG_MASK);
|
||||
constexpr int TRANSLATE_FETCH_DEBUG = (TRANSLATE_FETCH | TRANSLATE_DEBUG_MASK);
|
||||
|
||||
|
||||
|
||||
@ -100,9 +100,9 @@ public:
|
||||
bool translate(address_spacenum spacenum, int intention, offs_t &address) { return memory_translate(spacenum, intention, address); }
|
||||
|
||||
// read/write access
|
||||
bool read(address_spacenum spacenum, offs_t offset, int size, uint64_t &value) { return memory_read(spacenum, offset, size, value); }
|
||||
bool write(address_spacenum spacenum, offs_t offset, int size, uint64_t value) { return memory_write(spacenum, offset, size, value); }
|
||||
bool readop(offs_t offset, int size, uint64_t &value) { return memory_readop(offset, size, value); }
|
||||
bool read(address_spacenum spacenum, offs_t offset, int size, u64 &value) { return memory_read(spacenum, offset, size, value); }
|
||||
bool write(address_spacenum spacenum, offs_t offset, int size, u64 value) { return memory_write(spacenum, offset, size, value); }
|
||||
bool readop(offs_t offset, int size, u64 &value) { return memory_readop(offset, size, value); }
|
||||
|
||||
// deliberately ambiguous functions; if you have the memory interface
|
||||
// just use it
|
||||
@ -114,9 +114,9 @@ protected:
|
||||
|
||||
// optional operation overrides
|
||||
virtual bool memory_translate(address_spacenum spacenum, int intention, offs_t &address);
|
||||
virtual bool memory_read(address_spacenum spacenum, offs_t offset, int size, uint64_t &value);
|
||||
virtual bool memory_write(address_spacenum spacenum, offs_t offset, int size, uint64_t value);
|
||||
virtual bool memory_readop(offs_t offset, int size, uint64_t &value);
|
||||
virtual bool memory_read(address_spacenum spacenum, offs_t offset, int size, u64 &value);
|
||||
virtual bool memory_write(address_spacenum spacenum, offs_t offset, int size, u64 value);
|
||||
virtual bool memory_readop(offs_t offset, int size, u64 &value);
|
||||
|
||||
// interface-level overrides
|
||||
virtual void interface_validity_check(validity_checker &valid) const override;
|
||||
@ -134,4 +134,4 @@ typedef device_interface_iterator<device_memory_interface> memory_interface_iter
|
||||
|
||||
|
||||
|
||||
#endif /* __DIMEMORY_H__ */
|
||||
#endif /* MAME_EMU_DIMEMORY_H */
|
||||
|
@ -16,13 +16,13 @@ device_network_interface::~device_network_interface()
|
||||
{
|
||||
}
|
||||
|
||||
int device_network_interface::send(uint8_t *buf, int len) const
|
||||
int device_network_interface::send(u8 *buf, int len) const
|
||||
{
|
||||
if(!m_dev) return 0;
|
||||
return m_dev->send(buf, len);
|
||||
}
|
||||
|
||||
void device_network_interface::recv_cb(uint8_t *buf, int len)
|
||||
void device_network_interface::recv_cb(u8 *buf, int len)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Carl, Miodrag Milanovic
|
||||
#ifndef __DINETWORK_H__
|
||||
#define __DINETWORK_H__
|
||||
#ifndef MAME_EMU_DINETWORK_H
|
||||
#define MAME_EMU_DINETWORK_H
|
||||
|
||||
class osd_netdev;
|
||||
|
||||
@ -19,8 +19,8 @@ public:
|
||||
bool get_promisc() const { return m_promisc; }
|
||||
int get_interface() const { return m_intf; }
|
||||
|
||||
int send(uint8_t *buf, int len) const;
|
||||
virtual void recv_cb(uint8_t *buf, int len);
|
||||
int send(u8 *buf, int len) const;
|
||||
virtual void recv_cb(u8 *buf, int len);
|
||||
|
||||
protected:
|
||||
bool m_promisc;
|
||||
@ -34,4 +34,4 @@ protected:
|
||||
// iterator
|
||||
typedef device_interface_iterator<device_network_interface> network_interface_iterator;
|
||||
|
||||
#endif
|
||||
#endif // MAME_EMU_DINETWORK_H
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user