summaryrefslogtreecommitdiffstats
path: root/src/devices/cpu/drcbex86.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2021-02-14 11:05:57 -0500
committer AJR <ajrhacker@users.noreply.github.com>2021-02-14 11:05:57 -0500
commitbc0146c2038c46f789a246d5616afd7c425157f3 (patch)
treeb4d39194034b4c6e56ccd4035d25636034be43ca /src/devices/cpu/drcbex86.cpp
parent91310bcdeb7ab0ff661738b212017bf836f4e8ad (diff)
Eliminate ARRAY_LENGTH template in favor of C++17's std::size
* osdcomm.h: Move definition of EQUIVALENT_ARRAY to coretmpl.h * sharc.cpp, gt64xxx.cpp, ym2413.cpp, gb_lcd.cpp, snes_ppu.cpp: Use STRUCT_MEMBER for save state registration * gio/newport.cpp, megadrive/svp.cpp, nes_ctrl/bcbattle.cpp, arm7.cpp, tms9995.cpp, pckeybrd.cpp, sa1110.cpp, sa1111.cpp, jangou_blitter.cpp, vic4567.cpp: Use std::fill(_n) instead of memset * emucore.h: Remove obsolete typedef
Diffstat (limited to 'src/devices/cpu/drcbex86.cpp')
-rw-r--r--src/devices/cpu/drcbex86.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/devices/cpu/drcbex86.cpp b/src/devices/cpu/drcbex86.cpp
index 1d894713b43..e13b15163e7 100644
--- a/src/devices/cpu/drcbex86.cpp
+++ b/src/devices/cpu/drcbex86.cpp
@@ -538,7 +538,7 @@ drcbe_x86::drcbe_x86(drcuml_state &drcuml, device_t &device, drc_cache &cache, u
m_reshi(0)
{
// compute hi pointers for each register
- for (int regnum = 0; regnum < ARRAY_LENGTH(int_register_map); regnum++)
+ for (int regnum = 0; regnum < std::size(int_register_map); regnum++)
if (int_register_map[regnum] != 0)
{
m_reglo[int_register_map[regnum]] = &m_state.r[regnum].w.l;
@@ -546,7 +546,7 @@ drcbe_x86::drcbe_x86(drcuml_state &drcuml, device_t &device, drc_cache &cache, u
}
// build the flags map (static but it doesn't hurt to regenerate it)
- for (int entry = 0; entry < ARRAY_LENGTH(flags_map); entry++)
+ for (int entry = 0; entry < std::size(flags_map); entry++)
{
uint8_t flags = 0;
if (entry & 0x001) flags |= FLAG_C;
@@ -556,7 +556,7 @@ drcbe_x86::drcbe_x86(drcuml_state &drcuml, device_t &device, drc_cache &cache, u
if (entry & 0x800) flags |= FLAG_V;
flags_map[entry] = flags;
}
- for (int entry = 0; entry < ARRAY_LENGTH(flags_unmap); entry++)
+ for (int entry = 0; entry < std::size(flags_unmap); entry++)
{
uint32_t flags = 0;
if (entry & FLAG_C) flags |= 0x001;
@@ -712,7 +712,7 @@ void drcbe_x86::reset()
a.mov(ptr(ecx, offsetof(drcuml_machine_state, fmod)), al); // mov state->fmod,al
a.mov(eax, MABS(&m_state.exp)); // mov eax,[exp]
a.mov(ptr(ecx, offsetof(drcuml_machine_state, exp)), eax); // mov state->exp,eax
- for (int regnum = 0; regnum < ARRAY_LENGTH(m_state.r); regnum++)
+ for (int regnum = 0; regnum < std::size(m_state.r); regnum++)
{
uintptr_t regoffsl = (uintptr_t)&((drcuml_machine_state *)nullptr)->r[regnum].w.l;
uintptr_t regoffsh = (uintptr_t)&((drcuml_machine_state *)nullptr)->r[regnum].w.h;
@@ -726,7 +726,7 @@ void drcbe_x86::reset()
a.mov(eax, MABS(&m_state.r[regnum].w.h));
a.mov(ptr(ecx, regoffsh), eax);
}
- for (int regnum = 0; regnum < ARRAY_LENGTH(m_state.f); regnum++)
+ for (int regnum = 0; regnum < std::size(m_state.f); regnum++)
{
uintptr_t regoffsl = (uintptr_t)&((drcuml_machine_state *)nullptr)->f[regnum].s.l;
uintptr_t regoffsh = (uintptr_t)&((drcuml_machine_state *)nullptr)->f[regnum].s.h;
@@ -740,7 +740,7 @@ void drcbe_x86::reset()
// generate a restore subroutine
m_restore = dst + a.offset();
a.bind(a.newNamedLabel("restore"));
- for (int regnum = 0; regnum < ARRAY_LENGTH(m_state.r); regnum++)
+ for (int regnum = 0; regnum < std::size(m_state.r); regnum++)
{
uintptr_t regoffsl = (uintptr_t)&((drcuml_machine_state *)nullptr)->r[regnum].w.l;
uintptr_t regoffsh = (uintptr_t)&((drcuml_machine_state *)nullptr)->r[regnum].w.h;
@@ -754,7 +754,7 @@ void drcbe_x86::reset()
a.mov(eax, ptr(ecx, regoffsh));
a.mov(MABS(&m_state.r[regnum].w.h), eax);
}
- for (int regnum = 0; regnum < ARRAY_LENGTH(m_state.f); regnum++)
+ for (int regnum = 0; regnum < std::size(m_state.f); regnum++)
{
uintptr_t regoffsl = (uintptr_t)&((drcuml_machine_state *)nullptr)->f[regnum].s.l;
uintptr_t regoffsh = (uintptr_t)&((drcuml_machine_state *)nullptr)->f[regnum].s.h;
@@ -843,7 +843,7 @@ void drcbe_x86::generate(drcuml_block &block, const instruction *instlist, uint3
for (int inum = 0; inum < numinst; inum++)
{
const instruction &inst = instlist[inum];
- assert(inst.opcode() < ARRAY_LENGTH(s_opcode_table));
+ assert(inst.opcode() < std::size(s_opcode_table));
// must remain in scope until output
std::string dasm;