diff options
Diffstat (limited to 'src')
162 files changed, 765 insertions, 786 deletions
diff --git a/src/devices/bus/sat_ctrl/keybd.cpp b/src/devices/bus/sat_ctrl/keybd.cpp index 91c3f438f6d..d84922929ff 100644 --- a/src/devices/bus/sat_ctrl/keybd.cpp +++ b/src/devices/bus/sat_ctrl/keybd.cpp @@ -250,7 +250,7 @@ INPUT_CHANGED_MEMBER(saturn_keybd_device::key_stroke) { if (newval && !oldval) { - m_data = ((UINT8)(FPTR)(param) & 0xff); + m_data = ((UINT8)(uintptr_t)(param) & 0xff); m_status |= 8; } diff --git a/src/devices/cpu/drcbec.cpp b/src/devices/cpu/drcbec.cpp index f3f9cf7be9f..a5437e8dfb1 100644 --- a/src/devices/cpu/drcbec.cpp +++ b/src/devices/cpu/drcbec.cpp @@ -331,7 +331,7 @@ void drcbe_c::generate(drcuml_block &block, const instruction *instlist, UINT32 block.abort(); // compute the base by aligning the cache top to an even multiple of drcbec_instruction - drcbec_instruction *base = (drcbec_instruction *)(((FPTR)*cachetop + sizeof(drcbec_instruction) - 1) & ~(sizeof(drcbec_instruction) - 1)); + drcbec_instruction *base = (drcbec_instruction *)(((uintptr_t)*cachetop + sizeof(drcbec_instruction) - 1) & ~(sizeof(drcbec_instruction) - 1)); drcbec_instruction *dst = base; // generate code by copying the instructions and extracting immediates diff --git a/src/devices/cpu/drcbeut.cpp b/src/devices/cpu/drcbeut.cpp index e4354dda517..8d4821e7421 100644 --- a/src/devices/cpu/drcbeut.cpp +++ b/src/devices/cpu/drcbeut.cpp @@ -247,7 +247,7 @@ void drc_map_variables::block_end(drcuml_block &block) drccodeptr *top = m_cache.begin_codegen(sizeof(UINT64) + sizeof(UINT32) + 2 * sizeof(UINT32) * m_entry_list.count()); if (top == nullptr) block.abort(); - UINT32 *dest = (UINT32 *)(((FPTR)*top + 7) & ~7); + UINT32 *dest = (UINT32 *)(((uintptr_t)*top + 7) & ~7); // store the cookie first *(UINT64 *)dest = m_uniquevalue; @@ -355,7 +355,7 @@ UINT32 drc_map_variables::get_value(drccodeptr codebase, UINT32 mapvar) const mapvar -= MAPVAR_M0; // get an aligned pointer to start scanning - UINT64 *curscan = (UINT64 *)(((FPTR)codebase | 7) + 1); + UINT64 *curscan = (UINT64 *)(((uintptr_t)codebase | 7) + 1); UINT64 *endscan = (UINT64 *)m_cache.top(); // look for the signature diff --git a/src/devices/cpu/drcbex64.cpp b/src/devices/cpu/drcbex64.cpp index 7b3693a37ef..4ecb8cef939 100644 --- a/src/devices/cpu/drcbex64.cpp +++ b/src/devices/cpu/drcbex64.cpp @@ -561,7 +561,7 @@ inline int drcbe_x64::get_base_register_and_offset(x86code *&dst, void *target, else { offset = 0; - emit_mov_r64_imm(dst, reg, (FPTR)target); // mov reg,target + emit_mov_r64_imm(dst, reg, (uintptr_t)target); // mov reg,target return reg; } } @@ -579,7 +579,7 @@ inline void drcbe_x64::emit_smart_call_r64(x86code *&dst, x86code *target, UINT8 emit_call(dst, target); // call target else { - emit_mov_r64_imm(dst, reg, (FPTR)target); // mov reg,target + emit_mov_r64_imm(dst, reg, (uintptr_t)target); // mov reg,target emit_call_r64(dst, reg); // call reg } } @@ -639,7 +639,7 @@ drcbe_x64::drcbe_x64(drcuml_state &drcuml, device_t &device, drc_cache &cache, U m_near.double1 = 1.0; // create absolute value masks that are aligned to SSE boundaries - m_absmask32 = (UINT32 *)(((FPTR)m_absmask32 + 15) & ~15); + m_absmask32 = (UINT32 *)(((uintptr_t)m_absmask32 + 15) & ~15); m_absmask32[0] = m_absmask32[1] = m_absmask32[2] = m_absmask32[3] = 0x7fffffff; m_absmask64 = (UINT64 *)&m_absmask32[4]; m_absmask64[0] = m_absmask64[1] = U64(0x7fffffffffffffff); @@ -811,7 +811,7 @@ void drcbe_x64::generate(drcuml_block &block, const instruction *instlist, UINT3 block.abort(); // compute the base by aligning the cache top to a cache line (assumed to be 64 bytes) - x86code *base = (x86code *)(((FPTR)*cachetop + 63) & ~63); + x86code *base = (x86code *)(((uintptr_t)*cachetop + 63) & ~63); x86code *dst = base; // generate code @@ -2791,13 +2791,13 @@ void drcbe_x64::op_debug(x86code *&dst, const instruction &inst) be_parameter pcp(*this, inst.param(0), PTYPE_MRI); // test and branch - emit_mov_r64_imm(dst, REG_RAX, (FPTR)&m_device.machine().debug_flags); // mov rax,&debug_flags + emit_mov_r64_imm(dst, REG_RAX, (uintptr_t)&m_device.machine().debug_flags); // mov rax,&debug_flags emit_test_m32_imm(dst, MBD(REG_RAX, 0), DEBUG_FLAG_CALL_HOOK); // test [debug_flags],DEBUG_FLAG_CALL_HOOK emit_link skip = { nullptr }; emit_jcc_short_link(dst, x64emit::COND_Z, skip); // jz skip // push the parameter - emit_mov_r64_imm(dst, REG_PARAM1, (FPTR)&m_device); // mov param1,device + emit_mov_r64_imm(dst, REG_PARAM1, (uintptr_t)&m_device); // mov param1,device emit_mov_r32_p32(dst, REG_PARAM2, pcp); // mov param2,pcp emit_smart_call_m64(dst, &m_near.debug_cpu_instruction_hook); // call debug_cpu_instruction_hook @@ -3068,8 +3068,8 @@ void drcbe_x64::op_callc(x86code *&dst, const instruction &inst) emit_jcc_short_link(dst, X86_NOT_CONDITION(inst.condition()), skip); // jcc skip // perform the call - emit_mov_r64_imm(dst, REG_PARAM1, (FPTR)paramp.memory()); // mov param1,paramp - emit_smart_call_r64(dst, (x86code *)(FPTR)funcp.cfunc(), REG_RAX); // call funcp + emit_mov_r64_imm(dst, REG_PARAM1, (uintptr_t)paramp.memory()); // mov param1,paramp + emit_smart_call_r64(dst, (x86code *)(uintptr_t)funcp.cfunc(), REG_RAX); // call funcp // resolve the conditional link if (inst.condition() != uml::COND_ALWAYS) @@ -3094,7 +3094,7 @@ void drcbe_x64::op_recover(x86code *&dst, const instruction &inst) // call the recovery code emit_mov_r64_m64(dst, REG_RAX, MABS(&m_near.stacksave)); // mov rax,stacksave emit_mov_r64_m64(dst, REG_RAX, MBD(REG_RAX, -8)); // mov rax,[rax-4] - emit_mov_r64_imm(dst, REG_PARAM1, (FPTR)&m_map); // mov param1,m_map + emit_mov_r64_imm(dst, REG_PARAM1, (uintptr_t)&m_map); // mov param1,m_map emit_lea_r64_m64(dst, REG_PARAM2, MBD(REG_RAX, -1)); // lea param2,[rax-1] emit_mov_r64_imm(dst, REG_PARAM3, inst.param(1).mapvar()); // mov param3,param[1].value emit_smart_call_m64(dst, &m_near.drcmap_get_value); // call drcmap_get_value @@ -3339,7 +3339,7 @@ void drcbe_x64::op_save(x86code *&dst, const instruction &inst) be_parameter dstp(*this, inst.param(0), PTYPE_M); // copy live state to the destination - emit_mov_r64_imm(dst, REG_RCX, (FPTR)dstp.memory()); // mov rcx,dstp + emit_mov_r64_imm(dst, REG_RCX, (uintptr_t)dstp.memory()); // mov rcx,dstp // copy flags emit_pushf(dst); // pushf @@ -3397,7 +3397,7 @@ void drcbe_x64::op_restore(x86code *&dst, const instruction &inst) be_parameter srcp(*this, inst.param(0), PTYPE_M); // copy live state from the destination - emit_mov_r64_imm(dst, REG_ECX, (FPTR)srcp.memory()); // mov rcx,dstp + emit_mov_r64_imm(dst, REG_ECX, (uintptr_t)srcp.memory()); // mov rcx,dstp // copy integer registers int regoffs = offsetof(drcuml_machine_state, r); @@ -3736,7 +3736,7 @@ void drcbe_x64::op_read(x86code *&dst, const instruction &inst) int dstreg = dstp.select_register(REG_EAX); // set up a call to the read byte handler - emit_mov_r64_imm(dst, REG_PARAM1, (FPTR)(m_space[spacesizep.space()])); // mov param1,space + emit_mov_r64_imm(dst, REG_PARAM1, (uintptr_t)(m_space[spacesizep.space()])); // mov param1,space emit_mov_r32_p32(dst, REG_PARAM2, addrp); // mov param2,addrp if (spacesizep.size() == SIZE_BYTE) { @@ -3795,7 +3795,7 @@ void drcbe_x64::op_readm(x86code *&dst, const instruction &inst) int dstreg = dstp.select_register(REG_EAX); // set up a call to the read byte handler - emit_mov_r64_imm(dst, REG_PARAM1, (FPTR)(m_space[spacesizep.space()])); // mov param1,space + emit_mov_r64_imm(dst, REG_PARAM1, (uintptr_t)(m_space[spacesizep.space()])); // mov param1,space emit_mov_r32_p32(dst, REG_PARAM2, addrp); // mov param2,addrp if (spacesizep.size() != SIZE_QWORD) emit_mov_r32_p32(dst, REG_PARAM3, maskp); // mov param3,maskp @@ -3848,7 +3848,7 @@ void drcbe_x64::op_write(x86code *&dst, const instruction &inst) assert(spacesizep.is_size_space()); // set up a call to the write byte handler - emit_mov_r64_imm(dst, REG_PARAM1, (FPTR)(m_space[spacesizep.space()])); // mov param1,space + emit_mov_r64_imm(dst, REG_PARAM1, (uintptr_t)(m_space[spacesizep.space()])); // mov param1,space emit_mov_r32_p32(dst, REG_PARAM2, addrp); // mov param2,addrp if (spacesizep.size() != SIZE_QWORD) emit_mov_r32_p32(dst, REG_PARAM3, srcp); // mov param3,srcp @@ -3888,7 +3888,7 @@ void drcbe_x64::op_writem(x86code *&dst, const instruction &inst) assert(spacesizep.is_size_space()); // set up a call to the write byte handler - emit_mov_r64_imm(dst, REG_PARAM1, (FPTR)(m_space[spacesizep.space()])); // mov param1,space + emit_mov_r64_imm(dst, REG_PARAM1, (uintptr_t)(m_space[spacesizep.space()])); // mov param1,space emit_mov_r32_p32(dst, REG_PARAM2, addrp); // mov param2,addrp if (spacesizep.size() != SIZE_QWORD) { @@ -5965,7 +5965,7 @@ void drcbe_x64::op_fread(x86code *&dst, const instruction &inst) assert((1 << spacep.size()) == inst.size()); // set up a call to the read dword/qword handler - emit_mov_r64_imm(dst, REG_PARAM1, (FPTR)(m_space[spacep.space()])); // mov param1,space + emit_mov_r64_imm(dst, REG_PARAM1, (uintptr_t)(m_space[spacep.space()])); // mov param1,space emit_mov_r32_p32(dst, REG_PARAM2, addrp); // mov param2,addrp if (inst.size() == 4) emit_smart_call_m64(dst, (x86code **)&m_accessors[spacep.space()].read_dword); // call read_dword @@ -6009,7 +6009,7 @@ void drcbe_x64::op_fwrite(x86code *&dst, const instruction &inst) assert((1 << spacep.size()) == inst.size()); // general case - emit_mov_r64_imm(dst, REG_PARAM1, (FPTR)(m_space[spacep.space()])); // mov param1,space + emit_mov_r64_imm(dst, REG_PARAM1, (uintptr_t)(m_space[spacep.space()])); // mov param1,space emit_mov_r32_p32(dst, REG_PARAM2, addrp); // mov param21,addrp // 32-bit form diff --git a/src/devices/cpu/drcbex86.cpp b/src/devices/cpu/drcbex86.cpp index 3fab0fea741..4bd869b410d 100644 --- a/src/devices/cpu/drcbex86.cpp +++ b/src/devices/cpu/drcbex86.cpp @@ -452,7 +452,7 @@ inline void drcbe_x86::set_last_lower_reg(x86code *&dst, const be_parameter &par if (param.is_memory()) { m_last_lower_reg = reglo; - m_last_lower_addr = (UINT32 *)((FPTR)param.memory()); + m_last_lower_addr = (UINT32 *)((uintptr_t)param.memory()); m_last_lower_pc = dst; } } @@ -466,7 +466,7 @@ inline void drcbe_x86::set_last_lower_reg(x86code *&dst, const be_parameter &par inline void drcbe_x86::set_last_upper_reg(x86code *&dst, const be_parameter ¶m, UINT8 reghi) { m_last_upper_reg = reghi; - m_last_upper_addr = (param.is_int_register()) ? m_reghi[param.ireg()] : (UINT32 *)((FPTR)param.memory(4)); + m_last_upper_addr = (param.is_int_register()) ? m_reghi[param.ireg()] : (UINT32 *)((uintptr_t)param.memory(4)); m_last_upper_pc = dst; } @@ -677,8 +677,8 @@ void drcbe_x86::reset() emit_mov_m32_r32(dst, MBD(REG_ECX, offsetof(drcuml_machine_state, exp)), REG_EAX); // mov state->exp,eax for (int regnum = 0; regnum < ARRAY_LENGTH(m_state.r); regnum++) { - FPTR regoffsl = (FPTR)&((drcuml_machine_state *)nullptr)->r[regnum].w.l; - FPTR regoffsh = (FPTR)&((drcuml_machine_state *)nullptr)->r[regnum].w.h; + 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; if (int_register_map[regnum] != 0) emit_mov_m32_r32(dst, MBD(REG_ECX, regoffsl), int_register_map[regnum]); else @@ -691,8 +691,8 @@ void drcbe_x86::reset() } for (int regnum = 0; regnum < ARRAY_LENGTH(m_state.f); regnum++) { - FPTR regoffsl = (FPTR)&((drcuml_machine_state *)nullptr)->f[regnum].s.l; - FPTR regoffsh = (FPTR)&((drcuml_machine_state *)nullptr)->f[regnum].s.h; + 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; emit_mov_r32_m32(dst, REG_EAX, MABS(&m_state.f[regnum].s.l)); emit_mov_m32_r32(dst, MBD(REG_ECX, regoffsl), REG_EAX); emit_mov_r32_m32(dst, REG_EAX, MABS(&m_state.f[regnum].s.h)); @@ -706,8 +706,8 @@ void drcbe_x86::reset() m_restore = dst; for (int regnum = 0; regnum < ARRAY_LENGTH(m_state.r); regnum++) { - FPTR regoffsl = (FPTR)&((drcuml_machine_state *)nullptr)->r[regnum].w.l; - FPTR regoffsh = (FPTR)&((drcuml_machine_state *)nullptr)->r[regnum].w.h; + 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; if (int_register_map[regnum] != 0) emit_mov_r32_m32(dst, int_register_map[regnum], MBD(REG_ECX, regoffsl)); else @@ -720,8 +720,8 @@ void drcbe_x86::reset() } for (int regnum = 0; regnum < ARRAY_LENGTH(m_state.f); regnum++) { - FPTR regoffsl = (FPTR)&((drcuml_machine_state *)nullptr)->f[regnum].s.l; - FPTR regoffsh = (FPTR)&((drcuml_machine_state *)nullptr)->f[regnum].s.h; + 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; emit_mov_r32_m32(dst, REG_EAX, MBD(REG_ECX, regoffsl)); emit_mov_m32_r32(dst, MABS(&m_state.f[regnum].s.l), REG_EAX); emit_mov_r32_m32(dst, REG_EAX, MBD(REG_ECX, regoffsh)); @@ -780,7 +780,7 @@ void drcbe_x86::generate(drcuml_block &block, const instruction *instlist, UINT3 block.abort(); // compute the base by aligning the cache top to a cache line (assumed to be 64 bytes) - x86code *base = (x86code *)(((FPTR)*cachetop + 63) & ~63); + x86code *base = (x86code *)(((uintptr_t)*cachetop + 63) & ~63); x86code *dst = base; // generate code @@ -891,7 +891,7 @@ void drcbe_x86::emit_mov_r32_p32_keepflags(x86code *&dst, UINT8 reg, const be_pa emit_mov_r32_imm(dst, reg, param.immediate()); // mov reg,param else if (param.is_memory()) { - if (!can_skip_lower_load(dst, (UINT32 *)((FPTR)param.memory()), reg)) + if (!can_skip_lower_load(dst, (UINT32 *)((uintptr_t)param.memory()), reg)) emit_mov_r32_m32(dst, reg, MABS(param.memory())); // mov reg,[param] } else if (param.is_int_register()) @@ -913,7 +913,7 @@ void drcbe_x86::emit_mov_m32_p32(x86code *&dst, x86_memref memref, const be_para emit_mov_m32_imm(dst, memref, param.immediate()); // mov [mem],param else if (param.is_memory()) { - if (!can_skip_lower_load(dst, (UINT32 *)((FPTR)param.memory()), REG_EAX)) + if (!can_skip_lower_load(dst, (UINT32 *)((uintptr_t)param.memory()), REG_EAX)) emit_mov_r32_m32(dst, REG_EAX, MABS(param.memory())); // mov eax,[param] emit_mov_m32_r32(dst, memref, REG_EAX); // mov [mem],eax } @@ -1641,8 +1641,8 @@ void drcbe_x86::emit_mov_r64_p64(x86code *&dst, UINT8 reglo, UINT8 reghi, const } else if (param.is_memory()) { - int skip_lower = can_skip_lower_load(dst, (UINT32 *)((FPTR)param.memory()), reglo); - int skip_upper = can_skip_upper_load(dst, (UINT32 *)((FPTR)param.memory(4)), reghi); + int skip_lower = can_skip_lower_load(dst, (UINT32 *)((uintptr_t)param.memory()), reglo); + int skip_upper = can_skip_upper_load(dst, (UINT32 *)((uintptr_t)param.memory(4)), reghi); if (reglo != REG_NONE && !skip_lower) emit_mov_r32_m32(dst, reglo, MABS(param.memory())); // mov reglo,[param] if (reghi != REG_NONE && !skip_upper) @@ -1676,8 +1676,8 @@ void drcbe_x86::emit_mov_r64_p64_keepflags(x86code *&dst, UINT8 reglo, UINT8 reg } else if (param.is_memory()) { - int skip_lower = can_skip_lower_load(dst, (UINT32 *)((FPTR)param.memory()), reglo); - int skip_upper = can_skip_upper_load(dst, (UINT32 *)((FPTR)param.memory(4)), reghi); + int skip_lower = can_skip_lower_load(dst, (UINT32 *)((uintptr_t)param.memory()), reglo); + int skip_upper = can_skip_upper_load(dst, (UINT32 *)((uintptr_t)param.memory(4)), reghi); if (reglo != REG_NONE && !skip_lower) emit_mov_r32_m32(dst, reglo, MABS(param.memory())); // mov reglo,[param] if (reghi != REG_NONE && !skip_upper) @@ -1708,7 +1708,7 @@ void drcbe_x86::emit_mov_m64_p64(x86code *&dst, x86_memref memref, const be_para } else if (param.is_memory()) { - int skip_lower = can_skip_lower_load(dst, (UINT32 *)((FPTR)param.memory()), REG_EAX); + int skip_lower = can_skip_lower_load(dst, (UINT32 *)((uintptr_t)param.memory()), REG_EAX); if (!skip_lower) emit_mov_r32_m32(dst, REG_EAX, MABS(param.memory())); // mov eax,[param] emit_mov_m32_r32(dst, memref + 0, REG_EAX); // mov [mem],eax @@ -2850,7 +2850,7 @@ void drcbe_x86::fixup_exception(drccodeptr *codeptr, void *param1, void *param2) emit_mov_m32_p32(dst, MABS(&m_state.exp), exp); // mov [exp],exp // push the original return address on the stack - emit_push_imm(dst, (FPTR)src); // push <return> + emit_push_imm(dst, (uintptr_t)src); // push <return> if (*targetptr != nullptr) emit_jmp(dst, *targetptr); // jmp *targetptr else @@ -3012,7 +3012,7 @@ void drcbe_x86::op_debug(x86code *&dst, const instruction &inst) // push the parameter emit_mov_m32_p32(dst, MBD(REG_ESP, 4), pcp); // mov [esp+4],pcp - emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (FPTR)&m_device); // mov [esp],device + emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (uintptr_t)&m_device); // mov [esp],device emit_call(dst, (x86code *)debugger_instruction_hook); // call debug_cpu_instruction_hook track_resolve_link(dst, skip); // skip: @@ -3274,8 +3274,8 @@ void drcbe_x86::op_callc(x86code *&dst, const instruction &inst) emit_jcc_short_link(dst, X86_NOT_CONDITION(inst.condition()), skip); // jcc skip // perform the call - emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (FPTR)paramp.memory()); // mov [esp],paramp - emit_call(dst, (x86code *)(FPTR)funcp.cfunc()); // call funcp + emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (uintptr_t)paramp.memory()); // mov [esp],paramp + emit_call(dst, (x86code *)(uintptr_t)funcp.cfunc()); // call funcp // resolve the conditional link if (inst.condition() != uml::COND_ALWAYS) @@ -3303,7 +3303,7 @@ void drcbe_x86::op_recover(x86code *&dst, const instruction &inst) emit_sub_r32_imm(dst, REG_EAX, 1); // sub eax,1 emit_mov_m32_imm(dst, MBD(REG_ESP, 8), inst.param(1).mapvar()); // mov [esp+8],param1 emit_mov_m32_r32(dst, MBD(REG_ESP, 4), REG_EAX); // mov [esp+4],eax - emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (FPTR)&m_map); // mov [esp],m_map + emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (uintptr_t)&m_map); // mov [esp],m_map emit_call(dst, (x86code *)&drc_map_variables::static_get_value); // call drcmap_get_value emit_mov_p32_r32(dst, dstp, REG_EAX); // mov dstp,eax } @@ -3548,7 +3548,7 @@ void drcbe_x86::op_save(x86code *&dst, const instruction &inst) be_parameter dstp(*this, inst.param(0), PTYPE_M); // copy live state to the destination - emit_mov_r32_imm(dst, REG_ECX, (FPTR)dstp.memory()); // mov ecx,dstp + emit_mov_r32_imm(dst, REG_ECX, (uintptr_t)dstp.memory()); // mov ecx,dstp emit_call(dst, m_save); // call save } @@ -3567,7 +3567,7 @@ void drcbe_x86::op_restore(x86code *&dst, const instruction &inst) be_parameter srcp(*this, inst.param(0), PTYPE_M); // copy live state from the destination - emit_mov_r32_imm(dst, REG_ECX, (FPTR)srcp.memory()); // mov ecx,dstp + emit_mov_r32_imm(dst, REG_ECX, (uintptr_t)srcp.memory()); // mov ecx,dstp emit_call(dst, m_restore); // call restore } @@ -3870,7 +3870,7 @@ void drcbe_x86::op_read(x86code *&dst, const instruction &inst) // set up a call to the read byte handler emit_mov_m32_p32(dst, MBD(REG_ESP, 4), addrp); // mov [esp+4],addrp - emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (FPTR)m_space[spacesizep.space()]); // mov [esp],space + emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (uintptr_t)m_space[spacesizep.space()]); // mov [esp],space if (spacesizep.size() == SIZE_BYTE) { emit_call(dst, (x86code *)m_accessors[spacesizep.space()].read_byte); @@ -3950,7 +3950,7 @@ void drcbe_x86::op_readm(x86code *&dst, const instruction &inst) else emit_mov_m64_p64(dst, MBD(REG_ESP, 8), maskp); // mov [esp+8],maskp emit_mov_m32_p32(dst, MBD(REG_ESP, 4), addrp); // mov [esp+4],addrp - emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (FPTR)m_space[spacesizep.space()]); // mov [esp],space + emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (uintptr_t)m_space[spacesizep.space()]); // mov [esp],space if (spacesizep.size() == SIZE_WORD) { emit_call(dst, (x86code *)m_accessors[spacesizep.space()].read_word_masked); @@ -4020,7 +4020,7 @@ void drcbe_x86::op_write(x86code *&dst, const instruction &inst) else emit_mov_m64_p64(dst, MBD(REG_ESP, 8), srcp); // mov [esp+8],srcp emit_mov_m32_p32(dst, MBD(REG_ESP, 4), addrp); // mov [esp+4],addrp - emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (FPTR)m_space[spacesizep.space()]); // mov [esp],space + emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (uintptr_t)m_space[spacesizep.space()]); // mov [esp],space if (spacesizep.size() == SIZE_BYTE) emit_call(dst, (x86code *)m_accessors[spacesizep.space()].write_byte); // call write_byte @@ -4066,7 +4066,7 @@ void drcbe_x86::op_writem(x86code *&dst, const instruction &inst) emit_mov_m64_p64(dst, MBD(REG_ESP, 8), srcp); // mov [esp+8],srcp } emit_mov_m32_p32(dst, MBD(REG_ESP, 4), addrp); // mov [esp+4],addrp - emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (FPTR)m_space[spacesizep.space()]); // mov [esp],space + emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (uintptr_t)m_space[spacesizep.space()]); // mov [esp],space if (spacesizep.size() == SIZE_WORD) emit_call(dst, (x86code *)m_accessors[spacesizep.space()].write_word_masked); // call write_word_masked @@ -4848,10 +4848,10 @@ void drcbe_x86::op_mulu(x86code *&dst, const instruction &inst) emit_mov_m64_p64(dst, MBD(REG_ESP, 16), src2p); // mov [esp+16],src2p emit_mov_m64_p64(dst, MBD(REG_ESP, 8), src1p); // mov [esp+8],src1p if (!compute_hi) - emit_mov_m32_imm(dst, MBD(REG_ESP, 4), (FPTR)&m_reslo); // mov [esp+4],&reslo + emit_mov_m32_imm(dst, MBD(REG_ESP, 4), (uintptr_t)&m_reslo); // mov [esp+4],&reslo else - emit_mov_m32_imm(dst, MBD(REG_ESP, 4), (FPTR)&m_reshi); // mov [esp+4],&reshi - emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (FPTR)&m_reslo); // mov [esp],&reslo + emit_mov_m32_imm(dst, MBD(REG_ESP, 4), (uintptr_t)&m_reshi); // mov [esp+4],&reshi + emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (uintptr_t)&m_reslo); // mov [esp],&reslo emit_call(dst, (x86code *)dmulu); // call dmulu if (inst.flags() != 0) emit_push_m32(dst, MABSI(flags_unmap, REG_EAX, 4)); // push flags_unmap[eax*4] @@ -4978,10 +4978,10 @@ void drcbe_x86::op_muls(x86code *&dst, const instruction &inst) emit_mov_m64_p64(dst, MBD(REG_ESP, 16), src2p); // mov [esp+16],src2p emit_mov_m64_p64(dst, MBD(REG_ESP, 8), src1p); // mov [esp+8],src1p if (!compute_hi) - emit_mov_m32_imm(dst, MBD(REG_ESP, 4), (FPTR)&m_reslo); // mov [esp+4],&reslo + emit_mov_m32_imm(dst, MBD(REG_ESP, 4), (uintptr_t)&m_reslo); // mov [esp+4],&reslo else - emit_mov_m32_imm(dst, MBD(REG_ESP, 4), (FPTR)&m_reshi); // push [esp+4],&reshi - emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (FPTR)&m_reslo); // mov [esp],&reslo + emit_mov_m32_imm(dst, MBD(REG_ESP, 4), (uintptr_t)&m_reshi); // push [esp+4],&reshi + emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (uintptr_t)&m_reslo); // mov [esp],&reslo emit_call(dst, (x86code *)dmuls); // call dmuls if (inst.flags() != 0) emit_push_m32(dst, MABSI(flags_unmap, REG_EAX, 4)); // push flags_unmap[eax*4] @@ -5048,10 +5048,10 @@ void drcbe_x86::op_divu(x86code *&dst, const instruction &inst) emit_mov_m64_p64(dst, MBD(REG_ESP, 16), src2p); // mov [esp+16],src2p emit_mov_m64_p64(dst, MBD(REG_ESP, 8), src1p); // mov [esp+8],src1p if (!compute_rem) - emit_mov_m32_imm(dst, MBD(REG_ESP, 4), (FPTR)&m_reslo); // mov [esp+4],&reslo + emit_mov_m32_imm(dst, MBD(REG_ESP, 4), (uintptr_t)&m_reslo); // mov [esp+4],&reslo else - emit_mov_m32_imm(dst, MBD(REG_ESP, 4), (FPTR)&m_reshi); // push [esp+4],&reshi - emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (FPTR)&m_reslo); // mov [esp],&reslo + emit_mov_m32_imm(dst, MBD(REG_ESP, 4), (uintptr_t)&m_reshi); // push [esp+4],&reshi + emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (uintptr_t)&m_reslo); // mov [esp],&reslo emit_call(dst, (x86code *)ddivu); // call ddivu if (inst.flags() != 0) emit_push_m32(dst, MABSI(flags_unmap, REG_EAX, 4)); // push flags_unmap[eax*4] @@ -5118,10 +5118,10 @@ void drcbe_x86::op_divs(x86code *&dst, const instruction &inst) emit_mov_m64_p64(dst, MBD(REG_ESP, 16), src2p); // mov [esp+16],src2p emit_mov_m64_p64(dst, MBD(REG_ESP, 8), src1p); // mov [esp+8],src1p if (!compute_rem) - emit_mov_m32_imm(dst, MBD(REG_ESP, 4), (FPTR)&m_reslo); // mov [esp+4],&reslo + emit_mov_m32_imm(dst, MBD(REG_ESP, 4), (uintptr_t)&m_reslo); // mov [esp+4],&reslo else - emit_mov_m32_imm(dst, MBD(REG_ESP, 4), (FPTR)&m_reshi); // push [esp+4],&reshi - emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (FPTR)&m_reslo); // mov [esp],&reslo + emit_mov_m32_imm(dst, MBD(REG_ESP, 4), (uintptr_t)&m_reshi); // push [esp+4],&reshi + emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (uintptr_t)&m_reslo); // mov [esp],&reslo emit_call(dst, (x86code *)ddivs); // call ddivs if (inst.flags() != 0) emit_push_m32(dst, MABSI(flags_unmap, REG_EAX, 4)); // push flags_unmap[eax*4] @@ -6011,7 +6011,7 @@ void drcbe_x86::op_fread(x86code *&dst, const instruction &inst) // set up a call to the read dword/qword handler emit_mov_m32_p32(dst, MBD(REG_ESP, 4), addrp); // mov [esp+4],addrp - emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (FPTR)m_space[spacep.space()]); // mov [esp],space + emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (uintptr_t)m_space[spacep.space()]); // mov [esp],space if (inst.size() == 4) emit_call(dst, (x86code *)m_accessors[spacep.space()].read_dword); // call read_dword else if (inst.size() == 8) @@ -6049,7 +6049,7 @@ void drcbe_x86::op_fwrite(x86code *&dst, const instruction &inst) else if (inst.size() == 8) emit_mov_m64_p64(dst, MBD(REG_ESP, 8), srcp); // mov [esp+8],srcp emit_mov_m32_p32(dst, MBD(REG_ESP, 4), addrp); // mov [esp+4],addrp - emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (FPTR)m_space[spacep.space()]); // mov [esp],space + emit_mov_m32_imm(dst, MBD(REG_ESP, 0), (uintptr_t)m_space[spacep.space()]); // mov [esp],space if (inst.size() == 4) emit_call(dst, (x86code *)m_accessors[spacep.space()].write_dword); // call write_dword else if (inst.size() == 8) diff --git a/src/devices/cpu/drccache.cpp b/src/devices/cpu/drccache.cpp index ea4cbbbd558..113ce0e5392 100644 --- a/src/devices/cpu/drccache.cpp +++ b/src/devices/cpu/drccache.cpp @@ -18,8 +18,8 @@ //************************************************************************** // ensure that all memory allocated is aligned to an 8-byte boundary -#define ALIGN_PTR_UP(p) ((void *)(((FPTR)(p) + (CACHE_ALIGNMENT - 1)) & ~(CACHE_ALIGNMENT - 1))) -#define ALIGN_PTR_DOWN(p) ((void *)((FPTR)(p) & ~(CACHE_ALIGNMENT - 1))) +#define ALIGN_PTR_UP(p) ((void *)(((uintptr_t)(p) + (CACHE_ALIGNMENT - 1)) & ~(CACHE_ALIGNMENT - 1))) +#define ALIGN_PTR_DOWN(p) ((void *)((uintptr_t)(p) & ~(CACHE_ALIGNMENT - 1))) diff --git a/src/devices/cpu/drcuml.cpp b/src/devices/cpu/drcuml.cpp index 1296aed7f9c..4b1b4d55a9b 100644 --- a/src/devices/cpu/drcuml.cpp +++ b/src/devices/cpu/drcuml.cpp @@ -976,11 +976,11 @@ static int bevalidate_populate_state(drcuml_block *block, drcuml_machine_state * // memory parameters: set the memory value in the parameter space and set the parameter value to point to it case parameter::PTYPE_MEMORY: - curparam->value = (FPTR)¶mmem[pnum]; + curparam->value = (uintptr_t)¶mmem[pnum]; if (psize == 4) - *(UINT32 *)(FPTR)curparam->value = test->param[pnum]; + *(UINT32 *)(uintptr_t)curparam->value = test->param[pnum]; else - *(UINT64 *)(FPTR)curparam->value = test->param[pnum]; + *(UINT64 *)(uintptr_t)curparam->value = test->param[pnum]; break; // map variables: issue a MAPVAR instruction to set the value and set the parameter value to the mapvar index @@ -1060,9 +1060,9 @@ static int bevalidate_verify_state(drcuml_state *drcuml, const drcuml_machine_st // memory registers fetch from the memory address case parameter::PTYPE_MEMORY: if (psize == 4) - result = *(UINT32 *)(FPTR)params[pnum].value; + result = *(UINT32 *)(uintptr_t)params[pnum].value; else - result = *(UINT64 *)(FPTR)params[pnum].value; + result = *(UINT64 *)(uintptr_t)params[pnum].value; break; default: diff --git a/src/devices/cpu/mips/mips3drc.cpp b/src/devices/cpu/mips/mips3drc.cpp index 3a45d56e1c6..e3156b53f10 100644 --- a/src/devices/cpu/mips/mips3drc.cpp +++ b/src/devices/cpu/mips/mips3drc.cpp @@ -691,7 +691,7 @@ void mips3_device::static_generate_tlb_mismatch() if (PRINTF_MMU) { static const char text[] = "TLB mismatch @ %08X (ent=%08X)\n"; - UML_MOV(block, mem(&m_core->format), (FPTR)text); // mov [format],text + UML_MOV(block, mem(&m_core->format), (uintptr_t)text); // mov [format],text UML_MOV(block, mem(&m_core->arg0), I0); // mov [arg0],i0 UML_MOV(block, mem(&m_core->arg1), I1); // mov [arg1],i1 UML_CALLC(block, cfunc_printf_debug, this); // callc printf_debug @@ -1236,7 +1236,7 @@ void mips3_device::generate_sequence_instruction(drcuml_block *block, compiler_s if (PRINTF_MMU) { static const char text[] = "Compiler page fault @ %08X"; - UML_MOV(block, mem(&m_core->format), (FPTR)text); // mov [format],text + UML_MOV(block, mem(&m_core->format), (uintptr_t)text); // mov [format],text UML_MOV(block, mem(&m_core->arg0), desc->pc); // mov [arg0],desc->pc UML_CALLC(block, cfunc_printf_debug, this); // callc printf_debug } @@ -1254,7 +1254,7 @@ void mips3_device::generate_sequence_instruction(drcuml_block *block, compiler_s if (PRINTF_MMU) { static const char text[] = "Checking TLB at @ %08X\n"; - UML_MOV(block, mem(&m_core->format), (FPTR)text); // mov [format],text + UML_MOV(block, mem(&m_core->format), (uintptr_t)text); // mov [format],text UML_MOV(block, mem(&m_core->arg0), desc->pc); // mov [arg0],desc->pc UML_CALLC(block, cfunc_printf_debug, this); // callc printf_debug } @@ -1269,7 +1269,7 @@ void mips3_device::generate_sequence_instruction(drcuml_block *block, compiler_s if (PRINTF_MMU) { static const char text[] = "No valid TLB @ %08X\n"; - UML_MOV(block, mem(&m_core->format), (FPTR)text); // mov [format],text + UML_MOV(block, mem(&m_core->format), (uintptr_t)text); // mov [format],text UML_MOV(block, mem(&m_core->arg0), desc->pc); // mov [arg0],desc->pc UML_CALLC(block, cfunc_printf_debug, this); // callc printf_debug } diff --git a/src/devices/cpu/powerpc/ppcdrc.cpp b/src/devices/cpu/powerpc/ppcdrc.cpp index bda8edfa60f..47a8742a0af 100644 --- a/src/devices/cpu/powerpc/ppcdrc.cpp +++ b/src/devices/cpu/powerpc/ppcdrc.cpp @@ -1694,7 +1694,7 @@ void ppc_device::generate_sequence_instruction(drcuml_block *block, compiler_sta if (desc->pc == PROBE_ADDRESS) { UML_MOV(block, mem(&m_core->pc), desc->pc); // mov [pc],desc->pc - UML_CALLC(block, cfunc_printf_probe, (void *)(FPTR)desc->pc); // callc cfunc_printf_probe,desc->pc + UML_CALLC(block, cfunc_printf_probe, (void *)(uintptr_t)desc->pc); // callc cfunc_printf_probe,desc->pc } /* if we are debugging, call the debugger */ @@ -1721,7 +1721,7 @@ void ppc_device::generate_sequence_instruction(drcuml_block *block, compiler_sta if (PRINTF_MMU) { const char *text = "Compiler page fault @ %08X\n"; - UML_MOV(block, mem(&m_core->format), (FPTR)text); // mov [format],text + UML_MOV(block, mem(&m_core->format), (uintptr_t)text); // mov [format],text UML_MOV(block, mem(&m_core->arg0), desc->pc); // mov [arg0],desc->pc UML_CALLC(block, cfunc_printf_debug, this); // callc printf_debug } @@ -1739,7 +1739,7 @@ void ppc_device::generate_sequence_instruction(drcuml_block *block, compiler_sta if (PRINTF_MMU) { const char *text = "Checking TLB at @ %08X\n"; - UML_MOV(block, mem(&m_core->format), (FPTR)text); // mov [format],text + UML_MOV(block, mem(&m_core->format), (uintptr_t)text); // mov [format],text UML_MOV(block, mem(&m_core->arg0), desc->pc); // mov [arg0],desc->pc UML_CALLC(block, cfunc_printf_debug, this); // callc printf_debug } @@ -1754,7 +1754,7 @@ void ppc_device::generate_sequence_instruction(drcuml_block *block, compiler_sta if (PRINTF_MMU) { const char *text = "No valid TLB @ %08X\n"; - UML_MOV(block, mem(&m_core->format), (FPTR)text); // mov [format],text + UML_MOV(block, mem(&m_core->format), (uintptr_t)text); // mov [format],text UML_MOV(block, mem(&m_core->arg0), desc->pc); // mov [arg0],desc->pc UML_CALLC(block, cfunc_printf_debug, this); // callc printf_debug } diff --git a/src/devices/cpu/uml.cpp b/src/devices/cpu/uml.cpp index 2ca54703497..0aff923fafd 100644 --- a/src/devices/cpu/uml.cpp +++ b/src/devices/cpu/uml.cpp @@ -985,7 +985,7 @@ std::string uml::instruction::disasm(drcuml_state *drcuml) const // cache memory else if (drcuml != nullptr && drcuml->cache().contains_pointer(param.memory())) - util::stream_format(buffer, "[+$%X]", (UINT32)(FPTR)((drccodeptr)param.memory() - drcuml->cache().near())); + util::stream_format(buffer, "[+$%X]", (UINT32)(uintptr_t)((drccodeptr)param.memory() - drcuml->cache().near())); // general memory else @@ -995,7 +995,7 @@ std::string uml::instruction::disasm(drcuml_state *drcuml) const // string pointer case parameter::PTYPE_STRING: - util::stream_format(buffer, "%s", (const char *)(FPTR)param.string()); + util::stream_format(buffer, "%s", (const char *)(uintptr_t)param.string()); break; // handle pointer diff --git a/src/devices/cpu/x86emit.h b/src/devices/cpu/x86emit.h index 4767036c728..f2a53332400 100644 --- a/src/devices/cpu/x86emit.h +++ b/src/devices/cpu/x86emit.h @@ -1174,9 +1174,9 @@ inline x86_memref MBD(UINT8 base, INT32 disp) { return x86_memref(base, REG_NONE inline x86_memref MBISD(UINT8 base, UINT8 ind, UINT8 scale, INT32 disp) { return x86_memref(base, ind, scale, disp); } #if (X86EMIT_SIZE == 32) -inline x86_memref MABS(const void *mem) { return x86_memref(REG_NONE, REG_NONE, 1, reinterpret_cast<FPTR>(const_cast<void *>(mem))); } -inline x86_memref MABSI(const void *mem, UINT8 index) { return x86_memref(index, REG_NONE, 1, reinterpret_cast<FPTR>(const_cast<void *>(mem))); } -inline x86_memref MABSI(const void *mem, UINT8 index, UINT8 scale) { return x86_memref(REG_NONE, index, scale, reinterpret_cast<FPTR>(const_cast<void *>(mem))); } +inline x86_memref MABS(const void *mem) { return x86_memref(REG_NONE, REG_NONE, 1, reinterpret_cast<uintptr_t>(const_cast<void *>(mem))); } +inline x86_memref MABSI(const void *mem, UINT8 index) { return x86_memref(index, REG_NONE, 1, reinterpret_cast<uintptr_t>(const_cast<void *>(mem))); } +inline x86_memref MABSI(const void *mem, UINT8 index, UINT8 scale) { return x86_memref(REG_NONE, index, scale, reinterpret_cast<uintptr_t>(const_cast<void *>(mem))); } #endif diff --git a/src/devices/cpu/x86log.cpp b/src/devices/cpu/x86log.cpp index 4ed80f06131..09d53c80bba 100644 --- a/src/devices/cpu/x86log.cpp +++ b/src/devices/cpu/x86log.cpp @@ -146,7 +146,7 @@ void x86log_disasm_code_range(x86log_context *log, const char *label, x86code *s /* otherwise, do a disassembly of the current instruction */ else { - bytes = i386_dasm_one_ex(buffer, (FPTR)cur, cur, sizeof(void *) * 8) & DASMFLAG_LENGTHMASK; + bytes = i386_dasm_one_ex(buffer, (uintptr_t)cur, cur, sizeof(void *) * 8) & DASMFLAG_LENGTHMASK; } /* if we have a matching comment, output it */ diff --git a/src/devices/machine/pckeybrd.cpp b/src/devices/machine/pckeybrd.cpp index 2a1d4719013..92e3bd973fd 100644 --- a/src/devices/machine/pckeybrd.cpp +++ b/src/devices/machine/pckeybrd.cpp @@ -893,7 +893,7 @@ WRITE8_MEMBER(at_keyboard_device::write) unicode_char_to_at_keycode ***************************************************************************/ -UINT8 pc_keyboard_device::unicode_char_to_at_keycode(unicode_char ch) +UINT8 pc_keyboard_device::unicode_char_to_at_keycode(char32_t ch) { UINT8 b; switch(ch) @@ -1034,7 +1034,7 @@ UINT8 pc_keyboard_device::unicode_char_to_at_keycode(unicode_char ch) queue_chars ***************************************************************************/ -int pc_keyboard_device::queue_chars(const unicode_char *text, size_t text_len) +int pc_keyboard_device::queue_chars(const char32_t *text, size_t text_len) { int i; UINT8 b; @@ -1293,7 +1293,7 @@ INPUT_PORTS_END Inputx stuff ***************************************************************************/ -bool pc_keyboard_device::accept_char(unicode_char ch) +bool pc_keyboard_device::accept_char(char32_t ch) { return unicode_char_to_at_keycode(ch) != 0; } diff --git a/src/devices/machine/pckeybrd.h b/src/devices/machine/pckeybrd.h index 69a133df2c6..58861fc288c 100644 --- a/src/devices/machine/pckeybrd.h +++ b/src/devices/machine/pckeybrd.h @@ -49,13 +49,13 @@ protected: private: void polling(void); UINT32 readport(int port); - UINT8 unicode_char_to_at_keycode(unicode_char ch); + UINT8 unicode_char_to_at_keycode(char32_t ch); virtual void standard_scancode_insert(int our_code, int pressed); virtual void extended_scancode_insert(int code, int pressed) { } int queue_size(void); - int queue_chars(const unicode_char *text, size_t text_len); - bool accept_char(unicode_char ch); + int queue_chars(const char32_t *text, size_t text_len); + bool accept_char(char32_t ch); bool charqueue_empty(); bool m_on; diff --git a/src/devices/machine/stvcd.cpp b/src/devices/machine/stvcd.cpp index f7e382ef176..84b9cd8fb51 100644 --- a/src/devices/machine/stvcd.cpp +++ b/src/devices/machine/stvcd.cpp @@ -1540,7 +1540,7 @@ void saturn_state::cd_free_block(blockT *blktofree) { INT32 i; - CDROM_LOG(("cd_free_block: %x\n", (UINT32)(FPTR)blktofree)) + CDROM_LOG(("cd_free_block: %x\n", (UINT32)(uintptr_t)blktofree)) if(blktofree == nullptr) { diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp index 5e6535a9fb4..e0c4d3b514d 100644 --- a/src/emu/debug/debugcpu.cpp +++ b/src/emu/debug/debugcpu.cpp @@ -1710,7 +1710,7 @@ device_debug::device_debug(device_t &device) for (auto &entry : m_state->state_entries()) { strmakelower(tempstr.assign(entry->symbol())); - m_symtable.add(tempstr.c_str(), (void *)(FPTR)entry->index(), get_state, set_state); + m_symtable.add(tempstr.c_str(), (void *)(uintptr_t)entry->index(), get_state, set_state); } } @@ -3137,7 +3137,7 @@ void device_debug::set_logunmap(symbol_table &table, void *ref, UINT64 value) UINT64 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<FPTR>(ref)); + return device->debug()->m_state->state_int(reinterpret_cast<uintptr_t>(ref)); } @@ -3149,7 +3149,7 @@ UINT64 device_debug::get_state(symbol_table &table, void *ref) void device_debug::set_state(symbol_table &table, void *ref, UINT64 value) { device_t *device = reinterpret_cast<device_t *>(table.globalref()); - device->debug()->m_state->set_state_int(reinterpret_cast<FPTR>(ref), value); + device->debug()->m_state->set_state_int(reinterpret_cast<uintptr_t>(ref), value); } diff --git a/src/emu/emualloc.cpp b/src/emu/emualloc.cpp index f424bca39cb..39f42378499 100644 --- a/src/emu/emualloc.cpp +++ b/src/emu/emualloc.cpp @@ -67,7 +67,7 @@ void resource_pool::add(resource_pool_item &item, size_t size, const char *type) std::lock_guard<std::mutex> lock(m_listlock); // insert into hash table - int hashval = reinterpret_cast<FPTR>(item.m_ptr) % m_hash_size; + int hashval = reinterpret_cast<uintptr_t>(item.m_ptr) % m_hash_size; item.m_next = m_hash[hashval]; m_hash[hashval] = &item; @@ -121,7 +121,7 @@ void resource_pool::remove(void *ptr) // search for the item std::lock_guard<std::mutex> lock(m_listlock); - int hashval = reinterpret_cast<FPTR>(ptr) % m_hash_size; + int hashval = reinterpret_cast<uintptr_t>(ptr) % m_hash_size; for (resource_pool_item **scanptr = &m_hash[hashval]; *scanptr != nullptr; scanptr = &(*scanptr)->m_next) // must match the pointer @@ -160,7 +160,7 @@ resource_pool_item *resource_pool::find(void *ptr) // search for the item std::lock_guard<std::mutex> lock(m_listlock); - int hashval = reinterpret_cast<FPTR>(ptr) % m_hash_size; + int hashval = reinterpret_cast<uintptr_t>(ptr) % m_hash_size; resource_pool_item *item; for (item = m_hash[hashval]; item != nullptr; item = item->m_next) if (item->m_ptr == ptr) diff --git a/src/emu/emumem.cpp b/src/emu/emumem.cpp index b761409ce42..fbbc20eb2a4 100644 --- a/src/emu/emumem.cpp +++ b/src/emu/emumem.cpp @@ -4054,7 +4054,7 @@ memory_block::memory_block(address_space &space, offs_t bytestart, offs_t byteen { m_allocated.resize(length + 0xfff); memset(&m_allocated[0], 0, length + 0xfff); - m_data = reinterpret_cast<UINT8 *>((reinterpret_cast<FPTR>(&m_allocated[0]) + 0xfff) & ~0xfff); + m_data = reinterpret_cast<UINT8 *>((reinterpret_cast<uintptr_t>(&m_allocated[0]) + 0xfff) & ~0xfff); } } diff --git a/src/emu/ioport.cpp b/src/emu/ioport.cpp index c110bc9719f..2943457ebb9 100644 --- a/src/emu/ioport.cpp +++ b/src/emu/ioport.cpp @@ -620,7 +620,7 @@ ioport_field::ioport_field(ioport_port &port, ioport_type type, ioport_value def // reset sequences and chars for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype) m_seq[seqtype].set_default(); - m_chars[0] = m_chars[1] = m_chars[2] = m_chars[3] = unicode_char(0); + m_chars[0] = m_chars[1] = m_chars[2] = m_chars[3] = char32_t(0); // for DIP switches and configs, look for a default value from the owner if (type == IPT_DIPSWITCH || type == IPT_CONFIG) @@ -743,9 +743,9 @@ ioport_type_class ioport_field::type_class() const // code //------------------------------------------------- -unicode_char ioport_field::keyboard_code(int which) const +char32_t ioport_field::keyboard_code(int which) const { - unicode_char ch; + char32_t ch; if (which >= ARRAY_LENGTH(m_chars)) throw emu_fatalerror("Tried to access keyboard_code with out-of-range index %d\n", which); @@ -765,7 +765,7 @@ unicode_char ioport_field::keyboard_code(int which) const std::string ioport_field::key_name(int which) const { - unicode_char ch = keyboard_code(which); + char32_t ch = keyboard_code(which); // attempt to get the string from the character info table switch (ch) @@ -1369,7 +1369,7 @@ ioport_field_live::ioport_field_live(ioport_field &field, analog_field *analog) // loop through each character on the field for (int which = 0; ; which++) { - unicode_char ch = field.keyboard_code(which); + char32_t ch = field.keyboard_code(which); if (ch == 0) break; name.append(string_format("%-*s ", std::max(SPACE_COUNT - 1, 0), field.key_name(which))); @@ -2971,7 +2971,7 @@ const char *ioport_configurer::string_from_token(const char *string) return nullptr; // if the index is greater than the count, assume it to be a pointer - if (FPTR(string) >= INPUT_STRING_COUNT) + if (uintptr_t(string) >= INPUT_STRING_COUNT) return string; #if FALSE // Set TRUE, If you want to take care missing-token or wrong-sorting @@ -2980,14 +2980,14 @@ const char *ioport_configurer::string_from_token(const char *string) { int index; for (index = 0; index < ARRAY_LENGTH(input_port_default_strings); index++) - if (input_port_default_strings[index].id == FPTR(string)) + if (input_port_default_strings[index].id == uintptr_t(string)) return input_port_default_strings[index].string; } return "(Unknown Default)"; #else - return input_port_default_strings[FPTR(string)-1].string; + return input_port_default_strings[uintptr_t(string)-1].string; #endif } @@ -3056,7 +3056,7 @@ void ioport_configurer::field_alloc(ioport_type type, ioport_value defval, iopor // field_add_char - add a character to a field //------------------------------------------------- -void ioport_configurer::field_add_char(unicode_char ch) +void ioport_configurer::field_add_char(char32_t ch) { for (int index = 0; index < ARRAY_LENGTH(m_curfield->m_chars); index++) if (m_curfield->m_chars[index] == 0) diff --git a/src/emu/ioport.h b/src/emu/ioport.h index e1a523b80c4..122f242f6b3 100644 --- a/src/emu/ioport.h +++ b/src/emu/ioport.h @@ -37,12 +37,12 @@ const ioport_value IP_ACTIVE_LOW = 0xffffffff; const int MAX_PLAYERS = 10; // unicode constants -const unicode_char UCHAR_PRIVATE = 0x100000; -const unicode_char UCHAR_SHIFT_1 = UCHAR_PRIVATE + 0; -const unicode_char UCHAR_SHIFT_2 = UCHAR_PRIVATE + 1; -const unicode_char UCHAR_SHIFT_BEGIN = UCHAR_SHIFT_1; -const unicode_char UCHAR_SHIFT_END = UCHAR_SHIFT_2; -const unicode_char UCHAR_MAMEKEY_BEGIN = UCHAR_PRIVATE + 2; +const char32_t UCHAR_PRIVATE = 0x100000; +const char32_t UCHAR_SHIFT_1 = UCHAR_PRIVATE + 0; +const char32_t UCHAR_SHIFT_2 = UCHAR_PRIVATE + 1; +const char32_t UCHAR_SHIFT_BEGIN = UCHAR_SHIFT_1; +const char32_t UCHAR_SHIFT_END = UCHAR_SHIFT_2; +const char32_t UCHAR_MAMEKEY_BEGIN = UCHAR_PRIVATE + 2; // sequence types for input_port_seq() call @@ -1073,7 +1073,7 @@ public: const ioport_value *remap_table() const { return m_remap_table; } UINT8 way() const { return m_way; } - unicode_char keyboard_code(int which) const; + char32_t keyboard_code(int which) const; std::string key_name(int which) const; ioport_field_live &live() const { assert(m_live != nullptr); return *m_live; } @@ -1159,7 +1159,7 @@ private: // data relevant to other specific types UINT8 m_way; // digital joystick 2/4/8-way descriptions - unicode_char m_chars[4]; // unicode key data + char32_t m_chars[4]; // unicode key data }; @@ -1513,7 +1513,7 @@ public: // field helpers void field_alloc(ioport_type type, ioport_value defval, ioport_value mask, const char *name = nullptr); - void field_add_char(unicode_char ch); + void field_add_char(char32_t ch); void field_add_code(input_seq_type which, input_code code); void field_set_way(int way) const { m_curfield->m_way = way; } void field_set_rotated() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_ROTATED; } diff --git a/src/emu/natkeyboard.cpp b/src/emu/natkeyboard.cpp index 9e88b589440..0ecf260353a 100644 --- a/src/emu/natkeyboard.cpp +++ b/src/emu/natkeyboard.cpp @@ -26,7 +26,7 @@ //************************************************************************** const int KEY_BUFFER_SIZE = 4096; -const unicode_char INVALID_CHAR = '?'; +const char32_t INVALID_CHAR = '?'; @@ -37,10 +37,10 @@ const unicode_char INVALID_CHAR = '?'; // character information struct char_info { - unicode_char ch; + char32_t ch; const char *alternate; // alternative string, in UTF-8 - static const char_info *find(unicode_char target); + static const char_info *find(char32_t target); }; @@ -381,7 +381,7 @@ void natural_keyboard::set_in_use(bool usage) // post - post a single character //------------------------------------------------- -void natural_keyboard::post(unicode_char ch) +void natural_keyboard::post(char32_t ch) { // ignore any \n that are preceded by \r if (m_last_cr && ch == '\n') @@ -426,14 +426,14 @@ void natural_keyboard::post(unicode_char ch) // post - post a unicode encoded string //------------------------------------------------- -void natural_keyboard::post(const unicode_char *text, size_t length, const attotime &rate) +void natural_keyboard::post(const char32_t *text, size_t length, const attotime &rate) { // set the fixed rate m_current_rate = rate; // 0 length means strlen if (length == 0) - for (const unicode_char *scan = text; *scan != 0; scan++) + for (const char32_t *scan = text; *scan != 0; scan++) length++; // iterate over characters or until the buffer is full up @@ -463,7 +463,7 @@ void natural_keyboard::post_utf8(const char *text, size_t length, const attotime while (length > 0) { // decode the next character - unicode_char uc; + char32_t uc; int count = uchar_from_utf8(&uc, text, length); if (count < 0) { @@ -488,7 +488,7 @@ void natural_keyboard::post_coded(const char *text, size_t length, const attotim static const struct { const char *key; - unicode_char code; + char32_t code; } codes[] = { { "BACKSPACE", 8 }, @@ -533,7 +533,7 @@ void natural_keyboard::post_coded(const char *text, size_t length, const attotim while (curpos < length) { // extract next character - unicode_char ch = text[curpos]; + char32_t ch = text[curpos]; size_t increment = 1; // look for escape characters @@ -576,7 +576,7 @@ void natural_keyboard::build_codes(ioport_manager &manager) if (field.type() == IPT_KEYBOARD) { // fetch the code, ignoring 0 - unicode_char code = field.keyboard_code(curshift); + char32_t code = field.keyboard_code(curshift); if (code == 0) continue; @@ -615,7 +615,7 @@ void natural_keyboard::build_codes(ioport_manager &manager) // unicode character can be directly posted //------------------------------------------------- -bool natural_keyboard::can_post_directly(unicode_char ch) +bool natural_keyboard::can_post_directly(char32_t ch) { // if we have a queueing callback, then it depends on whether we can accept the character if (!m_queue_chars.isnull()) @@ -632,7 +632,7 @@ bool natural_keyboard::can_post_directly(unicode_char ch) // unicode character can be posted via translation //------------------------------------------------- -bool natural_keyboard::can_post_alternate(unicode_char ch) +bool natural_keyboard::can_post_alternate(char32_t ch) { const char_info *info = char_info::find(ch); if (info == nullptr) @@ -644,7 +644,7 @@ bool natural_keyboard::can_post_alternate(unicode_char ch) while (*altstring != 0) { - unicode_char uchar; + char32_t uchar; int count = uchar_from_utf8(&uchar, altstring, strlen(altstring)); if (count <= 0) return false; @@ -661,7 +661,7 @@ bool natural_keyboard::can_post_alternate(unicode_char ch) // posting keyboard events //------------------------------------------------- -attotime natural_keyboard::choose_delay(unicode_char ch) +attotime natural_keyboard::choose_delay(char32_t ch) { // if we have a live rate, just use that if (m_current_rate != attotime::zero) @@ -680,7 +680,7 @@ attotime natural_keyboard::choose_delay(unicode_char ch) // internal_post - post a keyboard event //------------------------------------------------- -void natural_keyboard::internal_post(unicode_char ch) +void natural_keyboard::internal_post(char32_t ch) { // need to start up the timer? if (empty()) @@ -743,7 +743,7 @@ void natural_keyboard::timer(void *ptr, int param) // logging and debugging //------------------------------------------------- -std::string natural_keyboard::unicode_to_string(unicode_char ch) +std::string natural_keyboard::unicode_to_string(char32_t ch) { std::string buffer; switch (ch) @@ -781,7 +781,7 @@ std::string natural_keyboard::unicode_to_string(unicode_char ch) // find_code - find a code in our lookup table //------------------------------------------------- -const natural_keyboard::keycode_map_entry *natural_keyboard::find_code(unicode_char ch) const +const natural_keyboard::keycode_map_entry *natural_keyboard::find_code(char32_t ch) const { for (auto & elem : m_keycode_map) { @@ -831,7 +831,7 @@ std::string natural_keyboard::dump() // character //------------------------------------------------- -const char_info *char_info::find(unicode_char target) +const char_info *char_info::find(char32_t target) { // perform a simple binary search to find the proper alternate int low = 0; @@ -839,7 +839,7 @@ const char_info *char_info::find(unicode_char target) while (high > low) { int middle = (high + low) / 2; - unicode_char ch = charinfo[middle].ch; + char32_t ch = charinfo[middle].ch; if (ch < target) low = middle + 1; else if (ch > target) @@ -861,7 +861,7 @@ int validate_natural_keyboard_statics(void) { int i; int error = FALSE; - unicode_char last_char = 0; + char32_t last_char = 0; const char_info *ci; // check to make sure that charinfo is in order diff --git a/src/emu/natkeyboard.h b/src/emu/natkeyboard.h index 5a25d6ddbbd..00fc18daf09 100644 --- a/src/emu/natkeyboard.h +++ b/src/emu/natkeyboard.h @@ -19,8 +19,8 @@ //************************************************************************** // keyboard helper function delegates -typedef delegate<int (const unicode_char *, size_t)> ioport_queue_chars_delegate; -typedef delegate<bool (unicode_char)> ioport_accept_char_delegate; +typedef delegate<int (const char32_t *, size_t)> ioport_queue_chars_delegate; +typedef delegate<bool (char32_t)> ioport_accept_char_delegate; typedef delegate<bool ()> ioport_charqueue_empty_delegate; @@ -48,8 +48,8 @@ public: void set_in_use(bool usage); // posting - void post(unicode_char ch); - void post(const unicode_char *text, size_t length = 0, const attotime &rate = attotime::zero); + void post(char32_t ch); + void post(const char32_t *text, size_t length = 0, const attotime &rate = attotime::zero); void post_utf8(const char *text, size_t length = 0, const attotime &rate = attotime::zero); void post_coded(const char *text, size_t length = 0, const attotime &rate = attotime::zero); @@ -60,26 +60,26 @@ private: // internal keyboard code information struct keycode_map_entry { - unicode_char ch; + char32_t ch; ioport_field * field[UCHAR_SHIFT_END + 1 - UCHAR_SHIFT_BEGIN]; }; // internal helpers void build_codes(ioport_manager &manager); - bool can_post_directly(unicode_char ch); - bool can_post_alternate(unicode_char ch); - attotime choose_delay(unicode_char ch); - void internal_post(unicode_char ch); + bool can_post_directly(char32_t ch); + bool can_post_alternate(char32_t ch); + attotime choose_delay(char32_t ch); + void internal_post(char32_t ch); void timer(void *ptr, int param); - std::string unicode_to_string(unicode_char ch); - const keycode_map_entry *find_code(unicode_char ch) const; + std::string unicode_to_string(char32_t ch); + const keycode_map_entry *find_code(char32_t ch) const; // internal state running_machine & m_machine; // reference to our machine bool m_in_use; // is natural keyboard in use? UINT32 m_bufbegin; // index of starting character UINT32 m_bufend; // index of ending character - std::vector<unicode_char> m_buffer; // actual buffer + std::vector<char32_t> m_buffer; // actual buffer bool m_status_keydown; // current keydown status bool m_last_cr; // was the last char a CR? emu_timer * m_timer; // timer for posting characters diff --git a/src/emu/render.cpp b/src/emu/render.cpp index 891ed88470e..0fbe12ba665 100644 --- a/src/emu/render.cpp +++ b/src/emu/render.cpp @@ -205,7 +205,7 @@ inline item_layer get_layer_and_blendmode(const layout_view &view, int index, in void render_primitive::reset() { // do not clear m_next! - memset(&type, 0, FPTR(&texcoords + 1) - FPTR(&type)); + memset(&type, 0, uintptr_t(&texcoords + 1) - uintptr_t(&type)); } diff --git a/src/emu/rendfont.cpp b/src/emu/rendfont.cpp index fc2bef079ff..af4580cc9c1 100644 --- a/src/emu/rendfont.cpp +++ b/src/emu/rendfont.cpp @@ -54,7 +54,7 @@ inline const char *next_line(const char *ptr) // in a font, expanding if necessary //------------------------------------------------- -inline render_font::glyph &render_font::get_char(unicode_char chnum) +inline render_font::glyph &render_font::get_char(char32_t chnum) { static glyph dummy_glyph; @@ -214,7 +214,7 @@ render_font::~render_font() // character into a bitmap //------------------------------------------------- -void render_font::char_expand(unicode_char chnum, glyph &gl) +void render_font::char_expand(char32_t chnum, glyph &gl) { rgb_t color = rgb_t(0xff,0xff,0xff,0xff); bool is_cmd = (chnum >= COMMAND_UNICODE && chnum < COMMAND_UNICODE + MAX_GLYPH_FONT); @@ -350,7 +350,7 @@ void render_font::char_expand(unicode_char chnum, glyph &gl) // bounds of the final bitmap //------------------------------------------------- -render_texture *render_font::get_char_texture_and_bounds(float height, float aspect, unicode_char chnum, render_bounds &bounds) +render_texture *render_font::get_char_texture_and_bounds(float height, float aspect, char32_t chnum, render_bounds &bounds) { glyph &gl = get_char(chnum); @@ -373,7 +373,7 @@ render_texture *render_font::get_char_texture_and_bounds(float height, float asp // scaled bitmap and bounding rect for a char //------------------------------------------------- -void render_font::get_scaled_bitmap_and_bounds(bitmap_argb32 &dest, float height, float aspect, unicode_char chnum, rectangle &bounds) +void render_font::get_scaled_bitmap_and_bounds(bitmap_argb32 &dest, float height, float aspect, char32_t chnum, rectangle &bounds) { glyph &gl = get_char(chnum); @@ -409,7 +409,7 @@ void render_font::get_scaled_bitmap_and_bounds(bitmap_argb32 &dest, float height // at the given height //------------------------------------------------- -float render_font::char_width(float height, float aspect, unicode_char ch) +float render_font::char_width(float height, float aspect, char32_t ch) { return float(get_char(ch).width) * m_scale * height * aspect; } @@ -427,7 +427,7 @@ float render_font::string_width(float height, float aspect, const char *string) const char *ends = string + strlen(string); const char *s = string; - unicode_char schar; + char32_t schar; // loop over characters while (*s != 0) @@ -457,7 +457,7 @@ float render_font::utf8string_width(float height, float aspect, const char *utf8 INT32 totwidth = 0; for (std::size_t offset = 0U; offset < length; offset += unsigned(count)) { - unicode_char uchar; + char32_t uchar; count = uchar_from_utf8(&uchar, utf8string + offset, length - offset); if (count < 0) break; diff --git a/src/emu/rendfont.h b/src/emu/rendfont.h index 52a65527282..6e2f410dfec 100644 --- a/src/emu/rendfont.h +++ b/src/emu/rendfont.h @@ -39,13 +39,13 @@ public: // size queries INT32 pixel_height() const { return m_height; } - float char_width(float height, float aspect, unicode_char ch); + float char_width(float height, float aspect, char32_t ch); float string_width(float height, float aspect, const char *string); float utf8string_width(float height, float aspect, const char *utf8string); // texture/bitmap queries - render_texture *get_char_texture_and_bounds(float height, float aspect, unicode_char ch, render_bounds &bounds); - void get_scaled_bitmap_and_bounds(bitmap_argb32 &dest, float height, float aspect, unicode_char chnum, rectangle &bounds); + render_texture *get_char_texture_and_bounds(float height, float aspect, char32_t ch, render_bounds &bounds); + void get_scaled_bitmap_and_bounds(bitmap_argb32 &dest, float height, float aspect, char32_t chnum, rectangle &bounds); private: // a glyph describes a single glyph @@ -80,8 +80,8 @@ private: }; // helpers - glyph &get_char(unicode_char chnum); - void char_expand(unicode_char chnum, glyph &ch); + glyph &get_char(char32_t chnum); + void char_expand(char32_t chnum, glyph &ch); bool load_cached_bdf(const char *filename); bool load_bdf(); bool load_cached(emu_file &file, UINT32 hash); diff --git a/src/emu/rendlay.cpp b/src/emu/rendlay.cpp index 5a8b5dd3531..74246d4a6a4 100644 --- a/src/emu/rendlay.cpp +++ b/src/emu/rendlay.cpp @@ -962,7 +962,7 @@ void layout_element::reel_component::draw(running_machine &machine, bitmap_argb3 const char *origs = m_stopnames[fruit].c_str(); const char *ends = origs + strlen(origs); const char *s = origs; - unicode_char schar; + char32_t schar; // loop over characters while (*s != 0) @@ -1122,7 +1122,7 @@ void layout_element::reel_component::draw_beltreel(running_machine &machine, bit const char *origs =m_stopnames[fruit].c_str(); const char *ends = origs + strlen(origs); const char *s = origs; - unicode_char schar; + char32_t schar; // loop over characters while (*s != 0) @@ -1969,7 +1969,7 @@ void layout_element::component::draw_text(render_font &font, bitmap_argb32 &dest const char *origs = str; const char *ends = origs + strlen(origs); const char *s = origs; - unicode_char schar; + char32_t schar; // loop over characters while (*s != 0) diff --git a/src/emu/romentry.cpp b/src/emu/romentry.cpp index 57e005adb37..1a8545d348b 100644 --- a/src/emu/romentry.cpp +++ b/src/emu/romentry.cpp @@ -30,7 +30,7 @@ static std::string hashdata_from_tiny_rom_entry(const tiny_rom_entry &ent) case ROMENTRYTYPE_FILL: case ROMENTRYTYPE_COPY: // for these types, tiny_rom_entry::hashdata is an integer typecasted to a pointer - result = string_format("0x%x", (unsigned)(FPTR)ent.hashdata); + result = string_format("0x%x", (unsigned)(uintptr_t)ent.hashdata); break; default: diff --git a/src/emu/ui/cmdrender.h b/src/emu/ui/cmdrender.h index 130fed0a272..e065e9dcc6d 100644 --- a/src/emu/ui/cmdrender.h +++ b/src/emu/ui/cmdrender.h @@ -21,7 +21,7 @@ void convert_command_glyph(std::string &str) for (int i = j = 0; i < len;) { fix_command_t *fixcmd = nullptr; - unicode_char uchar; + char32_t uchar; int ucharcount = uchar_from_utf8(&uchar, str.substr(i).c_str(), len - i); if (ucharcount == -1) break; diff --git a/src/emu/uiinput.cpp b/src/emu/uiinput.cpp index 0523decc27d..380dc5c16c9 100644 --- a/src/emu/uiinput.cpp +++ b/src/emu/uiinput.cpp @@ -386,7 +386,7 @@ void ui_input_manager::push_mouse_double_click_event(render_target* target, INT3 push_char_event - pushes a char event to the specified render_target -------------------------------------------------*/ -void ui_input_manager::push_char_event(render_target* target, unicode_char ch) +void ui_input_manager::push_char_event(render_target* target, char32_t ch) { ui_event event = { UI_EVENT_NONE }; event.event_type = UI_EVENT_CHAR; diff --git a/src/emu/uiinput.h b/src/emu/uiinput.h index e1752f64b19..25d18966e08 100644 --- a/src/emu/uiinput.h +++ b/src/emu/uiinput.h @@ -46,7 +46,7 @@ struct ui_event INT32 mouse_x; INT32 mouse_y; input_item_id key; - unicode_char ch; + char32_t ch; short zdelta; int num_lines; }; @@ -92,7 +92,7 @@ public: void push_mouse_rdown_event(render_target* target, INT32 x, INT32 y); void push_mouse_rup_event(render_target* target, INT32 x, INT32 y); void push_mouse_double_click_event(render_target* target, INT32 x, INT32 y); - void push_char_event(render_target* target, unicode_char ch); + void push_char_event(render_target* target, char32_t ch); void push_mouse_wheel_event(render_target *target, INT32 x, INT32 y, short delta, int ucNumLines); void mark_all_as_pressed(); diff --git a/src/emu/validity.cpp b/src/emu/validity.cpp index 9ddab3cdf84..f98e5b8ed5f 100644 --- a/src/emu/validity.cpp +++ b/src/emu/validity.cpp @@ -32,7 +32,7 @@ inline const char *validity_checker::ioport_string_from_index(UINT32 index) { - return ioport_configurer::string_from_token((const char *)(FPTR)index); + return ioport_configurer::string_from_token((const char *)(uintptr_t)index); } diff --git a/src/emu/validity.h b/src/emu/validity.h index 36b40df80c9..495e9d934a6 100644 --- a/src/emu/validity.h +++ b/src/emu/validity.h @@ -61,7 +61,7 @@ protected: private: // internal map types typedef std::unordered_map<std::string,const game_driver *> game_driver_map; - typedef std::unordered_map<std::string,FPTR> int_map; + typedef std::unordered_map<std::string,uintptr_t> int_map; // internal helpers const char *ioport_string_from_index(UINT32 index); diff --git a/src/frontend/mame/ui/auditmenu.cpp b/src/frontend/mame/ui/auditmenu.cpp index 2c243215f49..c76d43da8db 100644 --- a/src/frontend/mame/ui/auditmenu.cpp +++ b/src/frontend/mame/ui/auditmenu.cpp @@ -168,7 +168,7 @@ void menu_audit::handle() void menu_audit::populate() { - item_append("Dummy", "", 0, (void *)(FPTR)1); + item_append("Dummy", "", 0, (void *)(uintptr_t)1); } //------------------------------------------------- diff --git a/src/frontend/mame/ui/custmenu.cpp b/src/frontend/mame/ui/custmenu.cpp index 761dc2b1291..71f65a4093f 100644 --- a/src/frontend/mame/ui/custmenu.cpp +++ b/src/frontend/mame/ui/custmenu.cpp @@ -50,7 +50,7 @@ void menu_custom_filter::handle() const event *menu_event = process(PROCESS_LR_REPEAT); if (menu_event != nullptr && menu_event->itemref != nullptr) { - switch ((FPTR)menu_event->itemref) + switch ((uintptr_t)menu_event->itemref) { case MAIN_FILTER: if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) @@ -79,9 +79,9 @@ void menu_custom_filter::handle() break; } - if ((FPTR)menu_event->itemref >= OTHER_FILTER && (FPTR)menu_event->itemref < OTHER_FILTER + MAX_CUST_FILTER) + if ((uintptr_t)menu_event->itemref >= OTHER_FILTER && (uintptr_t)menu_event->itemref < OTHER_FILTER + MAX_CUST_FILTER) { - int pos = (int)((FPTR)menu_event->itemref - OTHER_FILTER); + int pos = (int)((uintptr_t)menu_event->itemref - OTHER_FILTER); if (menu_event->iptkey == IPT_UI_LEFT && custfltr::other[pos] > FILTER_UNAVAILABLE + 1) { custfltr::other[pos]--; @@ -109,9 +109,9 @@ void menu_custom_filter::handle() menu::stack_push<menu_selector>(ui(), container(), s_sel, custfltr::other[pos]); } } - else if ((FPTR)menu_event->itemref >= YEAR_FILTER && (FPTR)menu_event->itemref < YEAR_FILTER + MAX_CUST_FILTER) + else if ((uintptr_t)menu_event->itemref >= YEAR_FILTER && (uintptr_t)menu_event->itemref < YEAR_FILTER + MAX_CUST_FILTER) { - int pos = (int)((FPTR)menu_event->itemref - YEAR_FILTER); + int pos = (int)((uintptr_t)menu_event->itemref - YEAR_FILTER); if (menu_event->iptkey == IPT_UI_LEFT && custfltr::year[pos] > 0) { custfltr::year[pos]--; @@ -125,9 +125,9 @@ void menu_custom_filter::handle() else if (menu_event->iptkey == IPT_UI_SELECT) menu::stack_push<menu_selector>(ui(), container(), c_year::ui, custfltr::year[pos]); } - else if ((FPTR)menu_event->itemref >= MNFCT_FILTER && (FPTR)menu_event->itemref < MNFCT_FILTER + MAX_CUST_FILTER) + else if ((uintptr_t)menu_event->itemref >= MNFCT_FILTER && (uintptr_t)menu_event->itemref < MNFCT_FILTER + MAX_CUST_FILTER) { - int pos = (int)((FPTR)menu_event->itemref - MNFCT_FILTER); + int pos = (int)((uintptr_t)menu_event->itemref - MNFCT_FILTER); if (menu_event->iptkey == IPT_UI_LEFT && custfltr::mnfct[pos] > 0) { custfltr::mnfct[pos]--; @@ -156,7 +156,7 @@ void menu_custom_filter::populate() { // add main filter UINT32 arrow_flags = get_arrow_flags<UINT16>(FILTER_ALL, FILTER_UNAVAILABLE, custfltr::main); - item_append(_("Main filter"), main_filters::text[custfltr::main], arrow_flags, (void *)(FPTR)MAIN_FILTER); + item_append(_("Main filter"), main_filters::text[custfltr::main], arrow_flags, (void *)(uintptr_t)MAIN_FILTER); // add other filters for (int x = 1; x <= custfltr::numother; x++) @@ -165,7 +165,7 @@ void menu_custom_filter::populate() // add filter items arrow_flags = get_arrow_flags<UINT16>(FILTER_UNAVAILABLE + 1, FILTER_LAST - 1, custfltr::other[x]); - item_append(_("Other filter"), main_filters::text[custfltr::other[x]], arrow_flags, (void *)(FPTR)(OTHER_FILTER + x)); + item_append(_("Other filter"), main_filters::text[custfltr::other[x]], arrow_flags, (void *)(uintptr_t)(OTHER_FILTER + x)); if (m_added) selected = item.size() - 2; @@ -176,7 +176,7 @@ void menu_custom_filter::populate() arrow_flags = get_arrow_flags<UINT16>(0, c_mnfct::ui.size() - 1, custfltr::mnfct[x]); std::string fbuff(_("^!Manufacturer")); convert_command_glyph(fbuff); - item_append(fbuff, c_mnfct::ui[custfltr::mnfct[x]], arrow_flags, (void *)(FPTR)(MNFCT_FILTER + x)); + item_append(fbuff, c_mnfct::ui[custfltr::mnfct[x]], arrow_flags, (void *)(uintptr_t)(MNFCT_FILTER + x)); } // add year subitem @@ -185,17 +185,17 @@ void menu_custom_filter::populate() arrow_flags = get_arrow_flags<UINT16>(0, c_year::ui.size() - 1, custfltr::year[x]); std::string fbuff(_("^!Year")); convert_command_glyph(fbuff); - item_append(fbuff, c_year::ui[custfltr::year[x]], arrow_flags, (void *)(FPTR)(YEAR_FILTER + x)); + item_append(fbuff, c_year::ui[custfltr::year[x]], arrow_flags, (void *)(uintptr_t)(YEAR_FILTER + x)); } } item_append(menu_item_type::SEPARATOR); if (custfltr::numother > 0) - item_append(_("Remove last filter"), "", 0, (void *)(FPTR)REMOVE_FILTER); + item_append(_("Remove last filter"), "", 0, (void *)(uintptr_t)REMOVE_FILTER); if (custfltr::numother < MAX_CUST_FILTER - 2) - item_append(_("Add filter"), "", 0, (void *)(FPTR)ADD_FILTER); + item_append(_("Add filter"), "", 0, (void *)(uintptr_t)ADD_FILTER); item_append(menu_item_type::SEPARATOR); customtop = ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER; @@ -293,7 +293,7 @@ void menu_swcustom_filter::handle() const event *menu_event = process(PROCESS_LR_REPEAT); if (menu_event != nullptr && menu_event->itemref != nullptr) { - switch ((FPTR)menu_event->itemref) + switch ((uintptr_t)menu_event->itemref) { case MAIN_FILTER: if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) @@ -322,9 +322,9 @@ void menu_swcustom_filter::handle() break; } - if ((FPTR)menu_event->itemref >= OTHER_FILTER && (FPTR)menu_event->itemref < OTHER_FILTER + MAX_CUST_FILTER) + if ((uintptr_t)menu_event->itemref >= OTHER_FILTER && (uintptr_t)menu_event->itemref < OTHER_FILTER + MAX_CUST_FILTER) { - int pos = (int)((FPTR)menu_event->itemref - OTHER_FILTER); + int pos = (int)((uintptr_t)menu_event->itemref - OTHER_FILTER); if (menu_event->iptkey == IPT_UI_LEFT && sw_custfltr::other[pos] > UI_SW_UNAVAILABLE + 1) { sw_custfltr::other[pos]--; @@ -348,9 +348,9 @@ void menu_swcustom_filter::handle() menu::stack_push<menu_selector>(ui(), container(), s_sel, sw_custfltr::other[pos]); } } - else if ((FPTR)menu_event->itemref >= YEAR_FILTER && (FPTR)menu_event->itemref < YEAR_FILTER + MAX_CUST_FILTER) + else if ((uintptr_t)menu_event->itemref >= YEAR_FILTER && (uintptr_t)menu_event->itemref < YEAR_FILTER + MAX_CUST_FILTER) { - int pos = (int)((FPTR)menu_event->itemref - YEAR_FILTER); + int pos = (int)((uintptr_t)menu_event->itemref - YEAR_FILTER); if (menu_event->iptkey == IPT_UI_LEFT && sw_custfltr::year[pos] > 0) { sw_custfltr::year[pos]--; @@ -364,9 +364,9 @@ void menu_swcustom_filter::handle() else if (menu_event->iptkey == IPT_UI_SELECT) menu::stack_push<menu_selector>(ui(), container(), m_filter.year.ui, sw_custfltr::year[pos]); } - else if ((FPTR)menu_event->itemref >= TYPE_FILTER && (FPTR)menu_event->itemref < TYPE_FILTER + MAX_CUST_FILTER) + else if ((uintptr_t)menu_event->itemref >= TYPE_FILTER && (uintptr_t)menu_event->itemref < TYPE_FILTER + MAX_CUST_FILTER) { - int pos = (int)((FPTR)menu_event->itemref - TYPE_FILTER); + int pos = (int)((uintptr_t)menu_event->itemref - TYPE_FILTER); if (menu_event->iptkey == IPT_UI_LEFT && sw_custfltr::type[pos] > 0) { sw_custfltr::type[pos]--; @@ -380,9 +380,9 @@ void menu_swcustom_filter::handle() else if (menu_event->iptkey == IPT_UI_SELECT) menu::stack_push<menu_selector>(ui(), container(), m_filter.type.ui, sw_custfltr::type[pos]); } - else if ((FPTR)menu_event->itemref >= MNFCT_FILTER && (FPTR)menu_event->itemref < MNFCT_FILTER + MAX_CUST_FILTER) + else if ((uintptr_t)menu_event->itemref >= MNFCT_FILTER && (uintptr_t)menu_event->itemref < MNFCT_FILTER + MAX_CUST_FILTER) { - int pos = (int)((FPTR)menu_event->itemref - MNFCT_FILTER); + int pos = (int)((uintptr_t)menu_event->itemref - MNFCT_FILTER); if (menu_event->iptkey == IPT_UI_LEFT && sw_custfltr::mnfct[pos] > 0) { sw_custfltr::mnfct[pos]--; @@ -396,9 +396,9 @@ void menu_swcustom_filter::handle() else if (menu_event->iptkey == IPT_UI_SELECT) menu::stack_push<menu_selector>(ui(), container(), m_filter.publisher.ui, sw_custfltr::mnfct[pos]); } - else if ((FPTR)menu_event->itemref >= REGION_FILTER && (FPTR)menu_event->itemref < REGION_FILTER + MAX_CUST_FILTER) + else if ((uintptr_t)menu_event->itemref >= REGION_FILTER && (uintptr_t)menu_event->itemref < REGION_FILTER + MAX_CUST_FILTER) { - int pos = (int)((FPTR)menu_event->itemref - REGION_FILTER); + int pos = (int)((uintptr_t)menu_event->itemref - REGION_FILTER); if (menu_event->iptkey == IPT_UI_LEFT && sw_custfltr::region[pos] > 0) { sw_custfltr::region[pos]--; @@ -412,9 +412,9 @@ void menu_swcustom_filter::handle() else if (menu_event->iptkey == IPT_UI_SELECT) menu::stack_push<menu_selector>(ui(), container(), m_filter.region.ui, sw_custfltr::region[pos]); } - else if ((FPTR)menu_event->itemref >= LIST_FILTER && (FPTR)menu_event->itemref < LIST_FILTER + MAX_CUST_FILTER) + else if ((uintptr_t)menu_event->itemref >= LIST_FILTER && (uintptr_t)menu_event->itemref < LIST_FILTER + MAX_CUST_FILTER) { - int pos = (int)((FPTR)menu_event->itemref - LIST_FILTER); + int pos = (int)((uintptr_t)menu_event->itemref - LIST_FILTER); if (menu_event->iptkey == IPT_UI_LEFT && sw_custfltr::list[pos] > 0) { sw_custfltr::list[pos]--; @@ -443,7 +443,7 @@ void menu_swcustom_filter::populate() { // add main filter UINT32 arrow_flags = get_arrow_flags<UINT16>(UI_SW_ALL, UI_SW_UNAVAILABLE, sw_custfltr::main); - item_append(_("Main filter"), sw_filters::text[sw_custfltr::main], arrow_flags, (void *)(FPTR)MAIN_FILTER); + item_append(_("Main filter"), sw_filters::text[sw_custfltr::main], arrow_flags, (void *)(uintptr_t)MAIN_FILTER); // add other filters for (int x = 1; x <= sw_custfltr::numother; x++) @@ -452,7 +452,7 @@ void menu_swcustom_filter::populate() // add filter items arrow_flags = get_arrow_flags<UINT16>(UI_SW_UNAVAILABLE + 1, UI_SW_LAST - 1, sw_custfltr::other[x]); - item_append(_("Other filter"), sw_filters::text[sw_custfltr::other[x]], arrow_flags, (void *)(FPTR)(OTHER_FILTER + x)); + item_append(_("Other filter"), sw_filters::text[sw_custfltr::other[x]], arrow_flags, (void *)(uintptr_t)(OTHER_FILTER + x)); if (m_added) selected = item.size() - 2; @@ -463,7 +463,7 @@ void menu_swcustom_filter::populate() arrow_flags = get_arrow_flags<UINT16>(0, m_filter.publisher.ui.size() - 1, sw_custfltr::mnfct[x]); std::string fbuff(_("^!Publisher")); convert_command_glyph(fbuff); - item_append(fbuff, m_filter.publisher.ui[sw_custfltr::mnfct[x]], arrow_flags, (void *)(FPTR)(MNFCT_FILTER + x)); + item_append(fbuff, m_filter.publisher.ui[sw_custfltr::mnfct[x]], arrow_flags, (void *)(uintptr_t)(MNFCT_FILTER + x)); } // add year subitem @@ -472,7 +472,7 @@ void menu_swcustom_filter::populate() arrow_flags = get_arrow_flags<UINT16>(0, m_filter.year.ui.size() - 1, sw_custfltr::year[x]); std::string fbuff(_("^!Year")); convert_command_glyph(fbuff); - item_append(fbuff, m_filter.year.ui[sw_custfltr::year[x]], arrow_flags, (void *)(FPTR)(YEAR_FILTER + x)); + item_append(fbuff, m_filter.year.ui[sw_custfltr::year[x]], arrow_flags, (void *)(uintptr_t)(YEAR_FILTER + x)); } // add year subitem @@ -481,7 +481,7 @@ void menu_swcustom_filter::populate() arrow_flags = get_arrow_flags<UINT16>(0, m_filter.swlist.name.size() - 1, sw_custfltr::list[x]); std::string fbuff(_("^!Software List")); convert_command_glyph(fbuff); - item_append(fbuff, m_filter.swlist.description[sw_custfltr::list[x]], arrow_flags, (void *)(FPTR)(LIST_FILTER + x)); + item_append(fbuff, m_filter.swlist.description[sw_custfltr::list[x]], arrow_flags, (void *)(uintptr_t)(LIST_FILTER + x)); } // add device type subitem @@ -490,7 +490,7 @@ void menu_swcustom_filter::populate() arrow_flags = get_arrow_flags<UINT16>(0, m_filter.type.ui.size() - 1, sw_custfltr::type[x]); std::string fbuff(_("^!Device type")); convert_command_glyph(fbuff); - item_append(fbuff, m_filter.type.ui[sw_custfltr::type[x]], arrow_flags, (void *)(FPTR)(TYPE_FILTER + x)); + item_append(fbuff, m_filter.type.ui[sw_custfltr::type[x]], arrow_flags, (void *)(uintptr_t)(TYPE_FILTER + x)); } // add region subitem @@ -499,17 +499,17 @@ void menu_swcustom_filter::populate() arrow_flags = get_arrow_flags<UINT16>(0, m_filter.region.ui.size() - 1, sw_custfltr::region[x]); std::string fbuff(_("^!Region")); convert_command_glyph(fbuff); - item_append(fbuff, m_filter.region.ui[sw_custfltr::region[x]], arrow_flags, (void *)(FPTR)(REGION_FILTER + x)); + item_append(fbuff, m_filter.region.ui[sw_custfltr::region[x]], arrow_flags, (void *)(uintptr_t)(REGION_FILTER + x)); } } item_append(menu_item_type::SEPARATOR); if (sw_custfltr::numother > 0) - item_append(_("Remove last filter"), "", 0, (void *)(FPTR)REMOVE_FILTER); + item_append(_("Remove last filter"), "", 0, (void *)(uintptr_t)REMOVE_FILTER); if (sw_custfltr::numother < MAX_CUST_FILTER - 2) - item_append(_("Add filter"), "", 0, (void *)(FPTR)ADD_FILTER); + item_append(_("Add filter"), "", 0, (void *)(uintptr_t)ADD_FILTER); item_append(menu_item_type::SEPARATOR); diff --git a/src/frontend/mame/ui/custui.cpp b/src/frontend/mame/ui/custui.cpp index 767fd4224be..f71c9525019 100644 --- a/src/frontend/mame/ui/custui.cpp +++ b/src/frontend/mame/ui/custui.cpp @@ -88,7 +88,7 @@ void menu_custom_ui::handle() if (menu_event != nullptr && menu_event->itemref != nullptr) { - switch ((FPTR)menu_event->itemref) + switch ((uintptr_t)menu_event->itemref) { case FONT_MENU: if (menu_event->iptkey == IPT_UI_SELECT) @@ -140,17 +140,17 @@ void menu_custom_ui::handle() void menu_custom_ui::populate() { UINT32 arrow_flags; - item_append(_("Fonts"), "", 0, (void *)(FPTR)FONT_MENU); - item_append(_("Colors"), "", 0, (void *)(FPTR)COLORS_MENU); + item_append(_("Fonts"), "", 0, (void *)(uintptr_t)FONT_MENU); + item_append(_("Colors"), "", 0, (void *)(uintptr_t)COLORS_MENU); if (!m_lang.empty()) { arrow_flags = get_arrow_flags<std::uint16_t>(0, m_lang.size() - 1, m_currlang); - item_append(_("Language"), m_lang[m_currlang].c_str(), arrow_flags, (void *)(FPTR)LANGUAGE_MENU); + item_append(_("Language"), m_lang[m_currlang].c_str(), arrow_flags, (void *)(uintptr_t)LANGUAGE_MENU); } arrow_flags = get_arrow_flags<UINT16>(0, HIDE_BOTH, ui_globals::panels_status); - item_append(_("Show side panels"), _(HIDE_STATUS[ui_globals::panels_status]), arrow_flags, (void *)(FPTR)HIDE_MENU); + item_append(_("Show side panels"), _(HIDE_STATUS[ui_globals::panels_status]), arrow_flags, (void *)(uintptr_t)HIDE_MENU); item_append(menu_item_type::SEPARATOR); customtop = ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER; @@ -283,7 +283,7 @@ void menu_font_ui::handle() const event *menu_event = process(PROCESS_LR_REPEAT); if (menu_event != nullptr && menu_event->itemref != nullptr) - switch ((FPTR)menu_event->itemref) + switch ((uintptr_t)menu_event->itemref) { case INFOS_SIZE: if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) @@ -323,7 +323,7 @@ void menu_font_ui::handle() case MUI_ITALIC: if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT || menu_event->iptkey == IPT_UI_SELECT) { - ((FPTR)menu_event->itemref == MUI_BOLD) ? m_bold = !m_bold : m_italic = !m_italic; + ((uintptr_t)menu_event->itemref == MUI_BOLD) ? m_bold = !m_bold : m_italic = !m_italic; changed = true; } break; @@ -345,24 +345,24 @@ void menu_font_ui::populate() // add fonts option arrow_flags = get_arrow_flags<std::uint16_t>(0, m_fonts.size() - 1, m_actual); - item_append(_("UI Font"), m_fonts[m_actual].second, arrow_flags, (void *)(FPTR)MUI_FNT); + item_append(_("UI Font"), m_fonts[m_actual].second, arrow_flags, (void *)(uintptr_t)MUI_FNT); #ifdef UI_WINDOWS if (m_fonts[m_actual].first != "default") { - item_append(_("Bold"), m_bold ? "On" : "Off", m_bold ? FLAG_RIGHT_ARROW : FLAG_LEFT_ARROW, (void *)(FPTR)MUI_BOLD); - item_append(_("Italic"), m_italic ? "On" : "Off", m_italic ? FLAG_RIGHT_ARROW : FLAG_LEFT_ARROW, (void *)(FPTR)MUI_ITALIC); + item_append(_("Bold"), m_bold ? "On" : "Off", m_bold ? FLAG_RIGHT_ARROW : FLAG_LEFT_ARROW, (void *)(uintptr_t)MUI_BOLD); + item_append(_("Italic"), m_italic ? "On" : "Off", m_italic ? FLAG_RIGHT_ARROW : FLAG_LEFT_ARROW, (void *)(uintptr_t)MUI_ITALIC); } #endif arrow_flags = get_arrow_flags(m_font_min, m_font_max, m_font_size); - item_append(_("Lines"), string_format("%2d", m_font_size), arrow_flags, (void *)(FPTR)FONT_SIZE); + item_append(_("Lines"), string_format("%2d", m_font_size), arrow_flags, (void *)(uintptr_t)FONT_SIZE); item_append(menu_item_type::SEPARATOR); // add item arrow_flags = get_arrow_flags(m_info_min, m_info_max, m_info_size); - item_append(_("Infos text size"), string_format("%3.2f", m_info_size), arrow_flags, (void *)(FPTR)INFOS_SIZE); + item_append(_("Infos text size"), string_format("%3.2f", m_info_size), arrow_flags, (void *)(uintptr_t)INFOS_SIZE); item_append(menu_item_type::SEPARATOR); @@ -403,7 +403,7 @@ void menu_font_ui::custom_render(void *selectedref, float top, float bottom, flo ui().draw_text_full(container(), topbuf.c_str(), x1, y1, x2 - x1, ui::text_layout::CENTER, ui::text_layout::TRUNCATE, mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); - if ((FPTR)selectedref == INFOS_SIZE) + if ((uintptr_t)selectedref == INFOS_SIZE) { topbuf = _("Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."); @@ -484,8 +484,8 @@ void menu_colors_ui::handle() if (menu_event != nullptr && menu_event->itemref != nullptr && menu_event->iptkey == IPT_UI_SELECT) { - if ((FPTR)menu_event->itemref != MUI_RESTORE) - menu::stack_push<menu_rgb_ui>(ui(), container(), &m_color_table[(FPTR)menu_event->itemref].color, item[selected].text); + if ((uintptr_t)menu_event->itemref != MUI_RESTORE) + menu::stack_push<menu_rgb_ui>(ui(), container(), &m_color_table[(uintptr_t)menu_event->itemref].color, item[selected].text); else { changed = true; @@ -503,25 +503,25 @@ void menu_colors_ui::handle() void menu_colors_ui::populate() { - item_append(_("Normal text"), "", 0, (void *)(FPTR)MUI_TEXT_COLOR); - item_append(_("Selected color"), "", 0, (void *)(FPTR)MUI_SELECTED_COLOR); - item_append(_("Normal text background"), "", 0, (void *)(FPTR)MUI_TEXT_BG_COLOR); - item_append(_("Selected background color"), "", 0, (void *)(FPTR)MUI_SELECTED_BG_COLOR); - item_append(_("Subitem color"), "", 0, (void *)(FPTR)MUI_SUBITEM_COLOR); - item_append(_("Clone"), "", 0, (void *)(FPTR)MUI_CLONE_COLOR); - item_append(_("Border"), "", 0, (void *)(FPTR)MUI_BORDER_COLOR); - item_append(_("Background"), "", 0, (void *)(FPTR)MUI_BACKGROUND_COLOR); - item_append(_("Dipswitch"), "", 0, (void *)(FPTR)MUI_DIPSW_COLOR); - item_append(_("Unavailable color"), "", 0, (void *)(FPTR)MUI_UNAVAILABLE_COLOR); - item_append(_("Slider color"), "", 0, (void *)(FPTR)MUI_SLIDER_COLOR); - item_append(_("Gfx viewer background"), "", 0, (void *)(FPTR)MUI_GFXVIEWER_BG_COLOR); - item_append(_("Mouse over color"), "", 0, (void *)(FPTR)MUI_MOUSEOVER_COLOR); - item_append(_("Mouse over background color"), "", 0, (void *)(FPTR)MUI_MOUSEOVER_BG_COLOR); - item_append(_("Mouse down color"), "", 0, (void *)(FPTR)MUI_MOUSEDOWN_COLOR); - item_append(_("Mouse down background color"), "", 0, (void *)(FPTR)MUI_MOUSEDOWN_BG_COLOR); + item_append(_("Normal text"), "", 0, (void *)(uintptr_t)MUI_TEXT_COLOR); + item_append(_("Selected color"), "", 0, (void *)(uintptr_t)MUI_SELECTED_COLOR); + item_append(_("Normal text background"), "", 0, (void *)(uintptr_t)MUI_TEXT_BG_COLOR); + item_append(_("Selected background color"), "", 0, (void *)(uintptr_t)MUI_SELECTED_BG_COLOR); + item_append(_("Subitem color"), "", 0, (void *)(uintptr_t)MUI_SUBITEM_COLOR); + item_append(_("Clone"), "", 0, (void *)(uintptr_t)MUI_CLONE_COLOR); + item_append(_("Border"), "", 0, (void *)(uintptr_t)MUI_BORDER_COLOR); + item_append(_("Background"), "", 0, (void *)(uintptr_t)MUI_BACKGROUND_COLOR); + item_append(_("Dipswitch"), "", 0, (void *)(uintptr_t)MUI_DIPSW_COLOR); + item_append(_("Unavailable color"), "", 0, (void *)(uintptr_t)MUI_UNAVAILABLE_COLOR); + item_append(_("Slider color"), "", 0, (void *)(uintptr_t)MUI_SLIDER_COLOR); + item_append(_("Gfx viewer background"), "", 0, (void *)(uintptr_t)MUI_GFXVIEWER_BG_COLOR); + item_append(_("Mouse over color"), "", 0, (void *)(uintptr_t)MUI_MOUSEOVER_COLOR); + item_append(_("Mouse over background color"), "", 0, (void *)(uintptr_t)MUI_MOUSEOVER_BG_COLOR); + item_append(_("Mouse down color"), "", 0, (void *)(uintptr_t)MUI_MOUSEDOWN_COLOR); + item_append(_("Mouse down background color"), "", 0, (void *)(uintptr_t)MUI_MOUSEDOWN_BG_COLOR); item_append(menu_item_type::SEPARATOR); - item_append(_("Restore originals colors"), "", 0, (void *)(FPTR)MUI_RESTORE); + item_append(_("Restore originals colors"), "", 0, (void *)(uintptr_t)MUI_RESTORE); custombottom = customtop = ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER; } @@ -723,7 +723,7 @@ void menu_rgb_ui::handle() if (menu_event != nullptr && menu_event->itemref != nullptr) { - switch ((FPTR)menu_event->itemref) + switch ((uintptr_t)menu_event->itemref) { case RGB_ALPHA: if (menu_event->iptkey == IPT_UI_LEFT && m_color->a() > 1) @@ -834,37 +834,37 @@ void menu_rgb_ui::populate() if (m_lock_ref != RGB_ALPHA) { arrow_flags = get_arrow_flags<UINT8>(0, 255, m_color->a()); - item_append(_("Alpha"), string_format("%3u", m_color->a()), arrow_flags, (void *)(FPTR)RGB_ALPHA); + item_append(_("Alpha"), string_format("%3u", m_color->a()), arrow_flags, (void *)(uintptr_t)RGB_ALPHA); } else - item_append(_("Alpha"), s_text, 0, (void *)(FPTR)RGB_ALPHA); + item_append(_("Alpha"), s_text, 0, (void *)(uintptr_t)RGB_ALPHA); if (m_lock_ref != RGB_RED) { arrow_flags = get_arrow_flags<UINT8>(0, 255, m_color->r()); - item_append(_("Red"), string_format("%3u", m_color->r()), arrow_flags, (void *)(FPTR)RGB_RED); + item_append(_("Red"), string_format("%3u", m_color->r()), arrow_flags, (void *)(uintptr_t)RGB_RED); } else - item_append(_("Red"), s_text, 0, (void *)(FPTR)RGB_RED); + item_append(_("Red"), s_text, 0, (void *)(uintptr_t)RGB_RED); if (m_lock_ref != RGB_GREEN) { arrow_flags = get_arrow_flags<UINT8>(0, 255, m_color->g()); - item_append(_("Green"), string_format("%3u", m_color->g()), arrow_flags, (void *)(FPTR)RGB_GREEN); + item_append(_("Green"), string_format("%3u", m_color->g()), arrow_flags, (void *)(uintptr_t)RGB_GREEN); } else - item_append(_("Green"), s_text, 0, (void *)(FPTR)RGB_GREEN); + item_append(_("Green"), s_text, 0, (void *)(uintptr_t)RGB_GREEN); if (m_lock_ref != RGB_BLUE) { arrow_flags = get_arrow_flags<UINT8>(0, 255, m_color->b()); - item_append(_("Blue"), string_format("%3u", m_color->b()), arrow_flags, (void *)(FPTR)RGB_BLUE); + item_append(_("Blue"), string_format("%3u", m_color->b()), arrow_flags, (void *)(uintptr_t)RGB_BLUE); } else - item_append(_("Blue"), s_text, 0, (void *)(FPTR)RGB_BLUE); + item_append(_("Blue"), s_text, 0, (void *)(uintptr_t)RGB_BLUE); item_append(menu_item_type::SEPARATOR); - item_append(_("Choose from palette"), "", 0, (void *)(FPTR)PALETTE_CHOOSE); + item_append(_("Choose from palette"), "", 0, (void *)(uintptr_t)PALETTE_CHOOSE); item_append(menu_item_type::SEPARATOR); custombottom = customtop = ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER; @@ -941,14 +941,14 @@ void menu_rgb_ui::inkey_special(const event *menu_event) if (menu_event->iptkey == IPT_UI_SELECT) { m_key_active = !m_key_active; - m_lock_ref = (FPTR)menu_event->itemref; + m_lock_ref = (uintptr_t)menu_event->itemref; if (!m_key_active) { int val = atoi(m_search.data()); val = m_color->clamp(val); - switch ((FPTR)menu_event->itemref) + switch ((uintptr_t)menu_event->itemref) { case RGB_ALPHA: m_color->set_a(val); @@ -1038,7 +1038,7 @@ void menu_palette_sel::handle() void menu_palette_sel::populate() { for (unsigned x = 0; x < ARRAY_LENGTH(s_palette); ++x) - item_append(_(s_palette[x].first), s_palette[x].second, 0, (void *)(FPTR)(x + 1)); + item_append(_(s_palette[x].first), s_palette[x].second, 0, (void *)(uintptr_t)(x + 1)); item_append(menu_item_type::SEPARATOR); } diff --git a/src/frontend/mame/ui/datmenu.cpp b/src/frontend/mame/ui/datmenu.cpp index e28f16afd69..c2126d50d15 100644 --- a/src/frontend/mame/ui/datmenu.cpp +++ b/src/frontend/mame/ui/datmenu.cpp @@ -397,7 +397,7 @@ void menu_dats_view::get_data() for (int x = 0; x < lines; ++x) { std::string tempbuf(buffer.substr(xstart[x], xend[x] - xstart[x])); - item_append(tempbuf, "", (FLAG_UI_DATS | FLAG_DISABLE), (void *)(FPTR)(x + 1)); + item_append(tempbuf, "", (FLAG_UI_DATS | FLAG_DISABLE), (void *)(uintptr_t)(x + 1)); } } @@ -415,7 +415,7 @@ void menu_dats_view::get_data_sw() for (int x = 0; x < lines; ++x) { std::string tempbuf(buffer.substr(xstart[x], xend[x] - xstart[x])); - item_append(tempbuf, "", (FLAG_UI_DATS | FLAG_DISABLE), (void *)(FPTR)(x + 1)); + item_append(tempbuf, "", (FLAG_UI_DATS | FLAG_DISABLE), (void *)(uintptr_t)(x + 1)); } } diff --git a/src/frontend/mame/ui/dirmenu.cpp b/src/frontend/mame/ui/dirmenu.cpp index 77d035c83c4..2621a0dbb39 100644 --- a/src/frontend/mame/ui/dirmenu.cpp +++ b/src/frontend/mame/ui/dirmenu.cpp @@ -101,7 +101,7 @@ void menu_directory::handle() void menu_directory::populate() { for (auto & elem : s_folders) - item_append(_(elem.name), "", 0, (void *)(FPTR)elem.action); + item_append(_(elem.name), "", 0, (void *)(uintptr_t)elem.action); item_append(menu_item_type::SEPARATOR); customtop = ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER; @@ -165,7 +165,7 @@ void menu_display_actual::handle() // process the menu const event *menu_event = process(0); if (menu_event != nullptr && menu_event->itemref != nullptr && menu_event->iptkey == IPT_UI_SELECT) - switch ((FPTR)menu_event->itemref) + switch ((uintptr_t)menu_event->itemref) { case REMOVE: menu::stack_push<menu_remove_folder>(ui(), container(), m_ref); @@ -312,7 +312,7 @@ void menu_add_change_folder::handle() { if (menu_event->iptkey == IPT_UI_SELECT) { - int index = (FPTR)menu_event->itemref - 1; + int index = (uintptr_t)menu_event->itemref - 1; const menu_item &pitem = item[index]; // go up to the parent path @@ -456,13 +456,13 @@ void menu_add_change_folder::populate() // add the drives for (int i = 0; (volume_name = osd_get_volume_name(i)) != nullptr; ++i) - item_append(volume_name, "[DRIVE]", 0, (void *)(FPTR)++folders_count); + item_append(volume_name, "[DRIVE]", 0, (void *)(uintptr_t)++folders_count); // add the directories while ((dirent = path.next()) != nullptr) { if (dirent->type == osd::directory::entry::entry_type::DIR && strcmp(dirent->name, ".") != 0) - item_append(dirent->name, "[DIR]", 0, (void *)(FPTR)++folders_count); + item_append(dirent->name, "[DIR]", 0, (void *)(uintptr_t)++folders_count); } item_append(menu_item_type::SEPARATOR); @@ -612,7 +612,7 @@ void menu_remove_folder::populate() { int folders_count = 0; for (auto & elem : m_folders) - item_append(elem, "", 0, (void *)(FPTR)++folders_count); + item_append(elem, "", 0, (void *)(uintptr_t)++folders_count); item_append(menu_item_type::SEPARATOR); customtop = ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER; diff --git a/src/frontend/mame/ui/filecreate.cpp b/src/frontend/mame/ui/filecreate.cpp index aa2de97ad1c..a1540e403a5 100644 --- a/src/frontend/mame/ui/filecreate.cpp +++ b/src/frontend/mame/ui/filecreate.cpp @@ -270,7 +270,7 @@ void menu_select_format::populate() if (i && i == m_ext_match) item_append(menu_item_type::SEPARATOR); - item_append(fmt->description(), fmt->name(), 0, (void *)(FPTR)i); + item_append(fmt->description(), fmt->name(), 0, (void *)(uintptr_t)i); } } @@ -285,7 +285,7 @@ void menu_select_format::handle() const event *event = process(0); if (event != nullptr && event->iptkey == IPT_UI_SELECT) { - *m_result = int(FPTR(event->itemref)); + *m_result = int(uintptr_t(event->itemref)); stack_pop(); } } diff --git a/src/frontend/mame/ui/filemngr.cpp b/src/frontend/mame/ui/filemngr.cpp index 485e2f41130..a5ae3c84968 100644 --- a/src/frontend/mame/ui/filemngr.cpp +++ b/src/frontend/mame/ui/filemngr.cpp @@ -170,7 +170,7 @@ void menu_file_manager::handle() const event *event = process(0); if (event != nullptr && event->itemref != nullptr && event->iptkey == IPT_UI_SELECT) { - if ((FPTR)event->itemref == 1) + if ((uintptr_t)event->itemref == 1) { if (m_curr_selected) machine().schedule_hard_reset(); diff --git a/src/frontend/mame/ui/filesel.cpp b/src/frontend/mame/ui/filesel.cpp index 187b7175cb0..fe63b20d3a8 100644 --- a/src/frontend/mame/ui/filesel.cpp +++ b/src/frontend/mame/ui/filesel.cpp @@ -540,7 +540,7 @@ void menu_select_rw::handle() void *menu_select_rw::itemref_from_result(menu_select_rw::result result) { - return (void *)(FPTR)(unsigned int)result; + return (void *)(uintptr_t)(unsigned int)result; } @@ -550,7 +550,7 @@ void *menu_select_rw::itemref_from_result(menu_select_rw::result result) menu_select_rw::result menu_select_rw::result_from_itemref(void *itemref) { - return (menu_select_rw::result) (unsigned int) (FPTR)itemref; + return (menu_select_rw::result) (unsigned int) (uintptr_t)itemref; } diff --git a/src/frontend/mame/ui/inputmap.cpp b/src/frontend/mame/ui/inputmap.cpp index 58f50fbe8d5..a45438f38ba 100644 --- a/src/frontend/mame/ui/inputmap.cpp +++ b/src/frontend/mame/ui/inputmap.cpp @@ -54,9 +54,9 @@ void menu_input_groups::populate() for (player = 0; player < MAX_PLAYERS; player++) { auto s = string_format("Player %d Controls", player + 1); - item_append(s, "", 0, (void *)(FPTR)(IPG_PLAYER1 + player + 1)); + item_append(s, "", 0, (void *)(uintptr_t)(IPG_PLAYER1 + player + 1)); } - item_append(_("Other Controls"), "", 0, (void *)(FPTR)(IPG_OTHER + 1)); + item_append(_("Other Controls"), "", 0, (void *)(uintptr_t)(IPG_OTHER + 1)); } menu_input_groups::~menu_input_groups() @@ -485,7 +485,7 @@ void menu_settings::handle() if (menu_event != nullptr && menu_event->itemref != nullptr) { // reset - if ((FPTR)menu_event->itemref == 1) + if ((uintptr_t)menu_event->itemref == 1) { if (menu_event->iptkey == IPT_UI_SELECT) machine().schedule_hard_reset(); @@ -654,7 +654,7 @@ void menu_settings_dip_switches::custom_render(void *selectedref, float top, flo UINT32 selectedmask = 0; // determine the mask of selected bits - if ((FPTR)selectedref != 1) + if ((uintptr_t)selectedref != 1) { ioport_field *field = (ioport_field *)selectedref; diff --git a/src/frontend/mame/ui/menu.h b/src/frontend/mame/ui/menu.h index de2b0c8adc7..cee07c6da88 100644 --- a/src/frontend/mame/ui/menu.h +++ b/src/frontend/mame/ui/menu.h @@ -136,7 +136,7 @@ protected: void *itemref; // reference for the selected item menu_item_type type; // item type (eventually will go away when itemref is proper ui_menu_item class rather than void*) int iptkey; // one of the IPT_* values from inptport.h - unicode_char unichar; // unicode character if iptkey == IPT_SPECIAL + char32_t unichar; // unicode character if iptkey == IPT_SPECIAL render_bounds mouse; // mouse position if iptkey == IPT_CUSTOM }; diff --git a/src/frontend/mame/ui/miscmenu.cpp b/src/frontend/mame/ui/miscmenu.cpp index e4c1e651fe2..e33502ea606 100644 --- a/src/frontend/mame/ui/miscmenu.cpp +++ b/src/frontend/mame/ui/miscmenu.cpp @@ -112,7 +112,7 @@ void menu_bios_selection::handle() if (menu_event != nullptr && menu_event->itemref != nullptr) { - if ((FPTR)menu_event->itemref == 1 && menu_event->iptkey == IPT_UI_SELECT) + if ((uintptr_t)menu_event->itemref == 1 && menu_event->iptkey == IPT_UI_SELECT) machine().schedule_hard_reset(); else if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) { @@ -569,7 +569,7 @@ void menu_export::handle() const event *menu_event = process(PROCESS_NOIMAGE); if (menu_event != nullptr && menu_event->itemref != nullptr) { - switch ((FPTR)menu_event->itemref) + switch ((uintptr_t)menu_event->itemref) { case 1: case 3: @@ -605,7 +605,7 @@ void menu_export::handle() drvlist.include(driver_list::find(*elem)); info_xml_creator creator(drvlist); - creator.output(pfile, ((FPTR)menu_event->itemref == 1) ? false : true); + creator.output(pfile, ((uintptr_t)menu_event->itemref == 1) ? false : true); fclose(pfile); machine().popmessage(_("%s.xml saved under ui folder."), filename.c_str()); } @@ -665,9 +665,9 @@ void menu_export::handle() void menu_export::populate() { // add options items - item_append(_("Export list in XML format (like -listxml)"), "", 0, (void *)(FPTR)1); - item_append(_("Export list in XML format (like -listxml, but exclude devices)"), "", 0, (void *)(FPTR)3); - item_append(_("Export list in TXT format (like -listfull)"), "", 0, (void *)(FPTR)2); + item_append(_("Export list in XML format (like -listxml)"), "", 0, (void *)(uintptr_t)1); + item_append(_("Export list in XML format (like -listxml, but exclude devices)"), "", 0, (void *)(uintptr_t)3); + item_append(_("Export list in TXT format (like -listfull)"), "", 0, (void *)(uintptr_t)2); item_append(menu_item_type::SEPARATOR); } @@ -709,7 +709,7 @@ void menu_machine_configure::handle() { if (menu_event->iptkey == IPT_UI_SELECT) { - switch ((FPTR)menu_event->itemref) + switch ((uintptr_t)menu_event->itemref) { case SAVE: { @@ -776,15 +776,15 @@ void menu_machine_configure::populate() if (!m_bios.empty()) { UINT32 arrows = get_arrow_flags(std::size_t(0), m_bios.size() - 1, m_curbios); - item_append(_("Driver"), m_bios[m_curbios].first, arrows, (void *)(FPTR)BIOS); + item_append(_("Driver"), m_bios[m_curbios].first, arrows, (void *)(uintptr_t)BIOS); } else item_append(_("This machine has no bios."), "", FLAG_DISABLE, nullptr); item_append(menu_item_type::SEPARATOR); - item_append(_(submenu::advanced_options[0].description), "", 0, (void *)(FPTR)ADVANCED); - item_append(_(submenu::video_options[0].description), "", 0, (void *)(FPTR)VIDEO); - item_append(_(submenu::control_options[0].description), "", 0, (void *)(FPTR)CONTROLLER); + item_append(_(submenu::advanced_options[0].description), "", 0, (void *)(uintptr_t)ADVANCED); + item_append(_(submenu::video_options[0].description), "", 0, (void *)(uintptr_t)VIDEO); + item_append(_(submenu::control_options[0].description), "", 0, (void *)(uintptr_t)CONTROLLER); item_append(menu_item_type::SEPARATOR); if (!mame_machine_manager::instance()->favorite().isgame_favorite(m_drv)) @@ -793,7 +793,7 @@ void menu_machine_configure::populate() item_append(_("Remove From Favorites"), "", 0, (void *)DELFAV); item_append(menu_item_type::SEPARATOR); - item_append(_("Save machine configuration"), "", 0, (void *)(FPTR)SAVE); + item_append(_("Save machine configuration"), "", 0, (void *)(uintptr_t)SAVE); item_append(menu_item_type::SEPARATOR); customtop = 2.0f * ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER; } @@ -944,7 +944,7 @@ void menu_plugins_configure::populate() { auto enabled = std::string(curentry.value()) == "1"; item_append(curentry.description(), enabled ? _("On") : _("Off"), - enabled ? FLAG_RIGHT_ARROW : FLAG_LEFT_ARROW, (void *)(FPTR)curentry.name()); + enabled ? FLAG_RIGHT_ARROW : FLAG_LEFT_ARROW, (void *)(uintptr_t)curentry.name()); } } item_append(menu_item_type::SEPARATOR); diff --git a/src/frontend/mame/ui/optsmenu.cpp b/src/frontend/mame/ui/optsmenu.cpp index 9912935a755..eab7a415ac5 100644 --- a/src/frontend/mame/ui/optsmenu.cpp +++ b/src/frontend/mame/ui/optsmenu.cpp @@ -69,7 +69,7 @@ void menu_game_options::handle() } if (menu_event != nullptr && menu_event->itemref != nullptr) - switch ((FPTR)menu_event->itemref) + switch ((uintptr_t)menu_event->itemref) { case FILTER_MENU: { @@ -229,7 +229,7 @@ void menu_game_options::populate() // add filter item UINT32 arrow_flags = get_arrow_flags<UINT16>(FILTER_FIRST, FILTER_LAST, m_main); - item_append(_("Filter"), main_filters::text[m_main], arrow_flags, (void *)(FPTR)FILTER_MENU); + item_append(_("Filter"), main_filters::text[m_main], arrow_flags, (void *)(uintptr_t)FILTER_MENU); // add category subitem if (m_main == FILTER_CATEGORY && mame_machine_manager::instance()->inifile().total() > 0) @@ -239,12 +239,12 @@ void menu_game_options::populate() arrow_flags = get_arrow_flags(UINT16(0), UINT16(inif.total() - 1), inif.cur_file()); fbuff = _(" ^!File"); convert_command_glyph(fbuff); - item_append(fbuff, inif.get_file(), arrow_flags, (void *)(FPTR)FILE_CATEGORY_FILTER); + item_append(fbuff, inif.get_file(), arrow_flags, (void *)(uintptr_t)FILE_CATEGORY_FILTER); arrow_flags = get_arrow_flags(UINT16(0), UINT16(inif.cat_total() - 1), inif.cur_cat()); fbuff = _(" ^!Category"); convert_command_glyph(fbuff); - item_append(fbuff, inif.get_category(), arrow_flags, (void *)(FPTR)CATEGORY_FILTER); + item_append(fbuff, inif.get_category(), arrow_flags, (void *)(uintptr_t)CATEGORY_FILTER); } // add manufacturer subitem else if (m_main == FILTER_MANUFACTURER && c_mnfct::ui.size() > 0) @@ -252,7 +252,7 @@ void menu_game_options::populate() arrow_flags = get_arrow_flags(UINT16(0), UINT16(c_mnfct::ui.size() - 1), c_mnfct::actual); fbuff = _("^!Manufacturer"); convert_command_glyph(fbuff); - item_append(fbuff, c_mnfct::ui[c_mnfct::actual], arrow_flags, (void *)(FPTR)MANUFACT_CAT_FILTER); + item_append(fbuff, c_mnfct::ui[c_mnfct::actual], arrow_flags, (void *)(uintptr_t)MANUFACT_CAT_FILTER); } // add year subitem else if (m_main == FILTER_YEAR && c_year::ui.size() > 0) @@ -260,30 +260,30 @@ void menu_game_options::populate() arrow_flags = get_arrow_flags(UINT16(0), UINT16(c_year::ui.size() - 1), c_year::actual); fbuff.assign(_("^!Year")); convert_command_glyph(fbuff); - item_append(fbuff, c_year::ui[c_year::actual], arrow_flags, (void *)(FPTR)YEAR_CAT_FILTER); + item_append(fbuff, c_year::ui[c_year::actual], arrow_flags, (void *)(uintptr_t)YEAR_CAT_FILTER); } // add custom subitem else if (m_main == FILTER_CUSTOM) { fbuff = _("^!Setup custom filter"); convert_command_glyph(fbuff); - item_append(fbuff, "", 0, (void *)(FPTR)CUSTOM_FILTER); + item_append(fbuff, "", 0, (void *)(uintptr_t)CUSTOM_FILTER); } item_append(menu_item_type::SEPARATOR); // add options items - item_append(_("Customize UI"), "", 0, (void *)(FPTR)CUSTOM_MENU); - item_append(_("Configure Directories"), "", 0, (void *)(FPTR)CONF_DIR); + item_append(_("Customize UI"), "", 0, (void *)(uintptr_t)CUSTOM_MENU); + item_append(_("Configure Directories"), "", 0, (void *)(uintptr_t)CONF_DIR); } - item_append(_(submenu::video_options[0].description), "", 0, (void *)(FPTR)DISPLAY_MENU); - item_append(_("Sound Options"), "", 0, (void *)(FPTR)SOUND_MENU); - item_append(_(submenu::misc_options[0].description), "", 0, (void *)(FPTR)MISC_MENU); - item_append(_(submenu::control_options[0].description), "", 0, (void *)(FPTR)CONTROLLER_MENU); - item_append(_("General Inputs"), "", 0, (void *)(FPTR)CGI_MENU); - item_append(_(submenu::advanced_options[0].description), "", 0, (void *)(FPTR)ADVANCED_MENU); + item_append(_(submenu::video_options[0].description), "", 0, (void *)(uintptr_t)DISPLAY_MENU); + item_append(_("Sound Options"), "", 0, (void *)(uintptr_t)SOUND_MENU); + item_append(_(submenu::misc_options[0].description), "", 0, (void *)(uintptr_t)MISC_MENU); + item_append(_(submenu::control_options[0].description), "", 0, (void *)(uintptr_t)CONTROLLER_MENU); + item_append(_("General Inputs"), "", 0, (void *)(uintptr_t)CGI_MENU); + item_append(_(submenu::advanced_options[0].description), "", 0, (void *)(uintptr_t)ADVANCED_MENU); item_append(menu_item_type::SEPARATOR); - item_append(_("Save Configuration"), "", 0, (void *)(FPTR)SAVE_CONFIG); + item_append(_("Save Configuration"), "", 0, (void *)(uintptr_t)SAVE_CONFIG); custombottom = 2.0f * ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER; customtop = ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER; diff --git a/src/frontend/mame/ui/pluginopt.cpp b/src/frontend/mame/ui/pluginopt.cpp index d6037af438b..e456562c4fc 100644 --- a/src/frontend/mame/ui/pluginopt.cpp +++ b/src/frontend/mame/ui/pluginopt.cpp @@ -55,7 +55,7 @@ void menu_plugin_opt::handle() { const event *menu_event = process(0); - if (menu_event != nullptr && (FPTR)menu_event->itemref) + if (menu_event != nullptr && (uintptr_t)menu_event->itemref) { std::string key; switch(menu_event->iptkey) @@ -84,7 +84,7 @@ void menu_plugin_opt::handle() default: return; } - if(mame_machine_manager::instance()->lua()->menu_callback(m_menu, (FPTR)menu_event->itemref, key)) + if(mame_machine_manager::instance()->lua()->menu_callback(m_menu, (uintptr_t)menu_event->itemref, key)) reset(reset_options::REMEMBER_REF); } } @@ -93,7 +93,7 @@ void menu_plugin_opt::populate() { std::vector<lua_engine::menu_item> menu_list; mame_machine_manager::instance()->lua()->menu_populate(m_menu, menu_list); - FPTR i = 1; + uintptr_t i = 1; for(auto &item : menu_list) { UINT32 flags = 0; diff --git a/src/frontend/mame/ui/selgame.cpp b/src/frontend/mame/ui/selgame.cpp index 2e4c3c7de17..9a7251d5290 100644 --- a/src/frontend/mame/ui/selgame.cpp +++ b/src/frontend/mame/ui/selgame.cpp @@ -138,12 +138,12 @@ menu_select_game::~menu_select_game() game_driver const *const driver(isfavorite() ? nullptr : reinterpret_cast<game_driver const *>(get_selection_ref())); ui_software_info *const swinfo(isfavorite() ? reinterpret_cast<ui_software_info *>(get_selection_ref()) : nullptr); - if (reinterpret_cast<FPTR>(driver) > skip_main_items) + if (reinterpret_cast<uintptr_t>(driver) > skip_main_items) last_driver = driver->name; else if (driver && m_prev_selected) last_driver = reinterpret_cast<game_driver const *>(m_prev_selected)->name; - if (reinterpret_cast<FPTR>(swinfo) > skip_main_items) + if (reinterpret_cast<uintptr_t>(swinfo) > skip_main_items) last_driver = swinfo->shortname; else if (swinfo && m_prev_selected) last_driver = reinterpret_cast<ui_software_info *>(m_prev_selected)->shortname; @@ -255,7 +255,7 @@ void menu_select_game::handle() if (!isfavorite()) { const game_driver *drv = (const game_driver *)menu_event->itemref; - if ((FPTR)drv > skip_main_items && ui_globals::curdats_view > 0) + if ((uintptr_t)drv > skip_main_items && ui_globals::curdats_view > 0) { ui_globals::curdats_view--; m_topline_datsview = 0; @@ -269,7 +269,7 @@ void menu_select_game::handle() ui_globals::curdats_view--; m_topline_datsview = 0; } - else if ((FPTR)drv > skip_main_items && ui_globals::cur_sw_dats_view > 0) + else if ((uintptr_t)drv > skip_main_items && ui_globals::cur_sw_dats_view > 0) { ui_globals::cur_sw_dats_view--; m_topline_datsview = 0; @@ -293,7 +293,7 @@ void menu_select_game::handle() if (!isfavorite()) { const game_driver *drv = (const game_driver *)menu_event->itemref; - if ((FPTR)drv > skip_main_items && ui_globals::curdats_view < (ui_globals::curdats_total - 1)) + if ((uintptr_t)drv > skip_main_items && ui_globals::curdats_view < (ui_globals::curdats_total - 1)) { ui_globals::curdats_view++; m_topline_datsview = 0; @@ -307,7 +307,7 @@ void menu_select_game::handle() ui_globals::curdats_view++; m_topline_datsview = 0; } - else if ((FPTR)drv > skip_main_items && ui_globals::cur_sw_dats_view < (ui_globals::cur_sw_dats_total - 1)) + else if ((uintptr_t)drv > skip_main_items && ui_globals::cur_sw_dats_view < (ui_globals::cur_sw_dats_total - 1)) { ui_globals::cur_sw_dats_view++; m_topline_datsview = 0; @@ -347,14 +347,14 @@ void menu_select_game::handle() if (!isfavorite()) { const game_driver *driver = (const game_driver *)menu_event->itemref; - if ((FPTR)driver > skip_main_items && mame_machine_manager::instance()->lua()->call_plugin(driver->name, "data_list")) + if ((uintptr_t)driver > skip_main_items && mame_machine_manager::instance()->lua()->call_plugin(driver->name, "data_list")) menu::stack_push<menu_dats_view>(ui(), container(), driver); } else { ui_software_info *ui_swinfo = (ui_software_info *)menu_event->itemref; - if ((FPTR)ui_swinfo > skip_main_items) + if ((uintptr_t)ui_swinfo > skip_main_items) { if (ui_swinfo->startempty == 1 && mame_machine_manager::instance()->lua()->call_plugin(ui_swinfo->driver->name, "data_list")) menu::stack_push<menu_dats_view>(ui(), container(), ui_swinfo->driver); @@ -369,7 +369,7 @@ void menu_select_game::handle() if (!isfavorite()) { const game_driver *driver = (const game_driver *)menu_event->itemref; - if ((FPTR)driver > skip_main_items) + if ((uintptr_t)driver > skip_main_items) { favorite_manager &mfav = mame_machine_manager::instance()->favorite(); if (!mfav.isgame_favorite(driver)) @@ -388,7 +388,7 @@ void menu_select_game::handle() else { ui_software_info *swinfo = (ui_software_info *)menu_event->itemref; - if ((FPTR)swinfo > skip_main_items) + if ((uintptr_t)swinfo > skip_main_items) { machine().popmessage(_("%s\n removed from favorites list."), swinfo->longname.c_str()); mame_machine_manager::instance()->favorite().remove_favorite_game(*swinfo); @@ -592,12 +592,12 @@ void menu_select_game::populate() // add special items if (stack_has_special_main_menu()) { - item_append(_("Configure Options"), "", flags_ui, (void *)(FPTR)CONF_OPTS); - item_append(_("Configure Machine"), "", flags_ui, (void *)(FPTR)CONF_MACHINE); + item_append(_("Configure Options"), "", flags_ui, (void *)(uintptr_t)CONF_OPTS); + item_append(_("Configure Machine"), "", flags_ui, (void *)(uintptr_t)CONF_MACHINE); skip_main_items = 2; if (machine().options().plugins()) { - item_append(_("Plugins"), "", flags_ui, (void *)(FPTR)CONF_PLUGINS); + item_append(_("Plugins"), "", flags_ui, (void *)(uintptr_t)CONF_PLUGINS); skip_main_items++; } } @@ -773,11 +773,11 @@ void menu_select_game::inkey_select(const event *menu_event) const game_driver *driver = (const game_driver *)menu_event->itemref; // special case for configure options - if ((FPTR)driver == CONF_OPTS) + if ((uintptr_t)driver == CONF_OPTS) menu::stack_push<menu_game_options>(ui(), container()); // special case for configure machine - else if (FPTR(driver) == CONF_MACHINE) + else if (uintptr_t(driver) == CONF_MACHINE) { if (m_prev_selected) menu::stack_push<menu_machine_configure>(ui(), container(), reinterpret_cast<const game_driver *>(m_prev_selected)); @@ -785,7 +785,7 @@ void menu_select_game::inkey_select(const event *menu_event) } // special case for configure plugins - else if ((FPTR)driver == CONF_PLUGINS) + else if ((uintptr_t)driver == CONF_PLUGINS) { menu::stack_push<menu_plugins_configure>(ui(), container()); } @@ -842,12 +842,12 @@ void menu_select_game::inkey_select_favorite(const event *menu_event) ui_software_info *ui_swinfo = (ui_software_info *)menu_event->itemref; ui_options &mopt = ui().options(); - if ((FPTR)ui_swinfo == CONF_OPTS) + if ((uintptr_t)ui_swinfo == CONF_OPTS) { // special case for configure options menu::stack_push<menu_game_options>(ui(), container()); } - else if ((FPTR)ui_swinfo == CONF_MACHINE) + else if ((uintptr_t)ui_swinfo == CONF_MACHINE) { // special case for configure machine if (m_prev_selected) @@ -857,7 +857,7 @@ void menu_select_game::inkey_select_favorite(const event *menu_event) } return; } - else if ((FPTR)ui_swinfo == CONF_PLUGINS) + else if ((uintptr_t)ui_swinfo == CONF_PLUGINS) { // special case for configure plugins menu::stack_push<menu_plugins_configure>(ui(), container()); diff --git a/src/frontend/mame/ui/selgame.h b/src/frontend/mame/ui/selgame.h index 49d3725803d..9455acb90cf 100644 --- a/src/frontend/mame/ui/selgame.h +++ b/src/frontend/mame/ui/selgame.h @@ -79,7 +79,7 @@ private: void *get_selection_ptr() const { void *const selected_ref(get_selection_ref()); - return (FPTR(selected_ref) > skip_main_items) ? selected_ref : m_prev_selected; + return (uintptr_t(selected_ref) > skip_main_items) ? selected_ref : m_prev_selected; } // General info diff --git a/src/frontend/mame/ui/selsoft.cpp b/src/frontend/mame/ui/selsoft.cpp index 39579af4eb7..bafcbfda82f 100644 --- a/src/frontend/mame/ui/selsoft.cpp +++ b/src/frontend/mame/ui/selsoft.cpp @@ -273,7 +273,7 @@ void menu_select_software::handle() // handle UI_FAVORITES ui_software_info *swinfo = (ui_software_info *)menu_event->itemref; - if ((FPTR)swinfo > 2) + if ((uintptr_t)swinfo > 2) { favorite_manager &mfav = mame_machine_manager::instance()->favorite(); if (!mfav.isgame_favorite(*swinfo)) diff --git a/src/frontend/mame/ui/simpleselgame.cpp b/src/frontend/mame/ui/simpleselgame.cpp index 15a25a73547..f4c583eb55f 100644 --- a/src/frontend/mame/ui/simpleselgame.cpp +++ b/src/frontend/mame/ui/simpleselgame.cpp @@ -149,7 +149,7 @@ void simple_menu_select_game::inkey_select(const event *menu_event) const game_driver *driver = (const game_driver *)menu_event->itemref; // special case for configure inputs - if ((FPTR)driver == 1) + if ((uintptr_t)driver == 1) menu::stack_push<menu_game_options>(ui(), container()); // anything else is a driver else @@ -311,7 +311,7 @@ void simple_menu_select_game::custom_render(void *selectedref, float top, float mame_ui_manager::NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); // determine the text to render below - driver = ((FPTR)selectedref > skip_main_items) ? (const game_driver *)selectedref : nullptr; + driver = ((uintptr_t)selectedref > skip_main_items) ? (const game_driver *)selectedref : nullptr; if (driver != nullptr) { const char *gfxstat, *soundstat; diff --git a/src/frontend/mame/ui/slotopt.cpp b/src/frontend/mame/ui/slotopt.cpp index ae7e2b8633e..9c68410f2ef 100644 --- a/src/frontend/mame/ui/slotopt.cpp +++ b/src/frontend/mame/ui/slotopt.cpp @@ -189,7 +189,7 @@ void menu_slot_devices::handle() if (menu_event != nullptr && menu_event->itemref != nullptr) { - if ((FPTR)menu_event->itemref == 1 && menu_event->iptkey == IPT_UI_SELECT) + if ((uintptr_t)menu_event->itemref == 1 && menu_event->iptkey == IPT_UI_SELECT) { mame_options::add_slot_options(machine().options()); machine().schedule_hard_reset(); diff --git a/src/frontend/mame/ui/sndmenu.cpp b/src/frontend/mame/ui/sndmenu.cpp index 6277e751773..a5c8425f337 100644 --- a/src/frontend/mame/ui/sndmenu.cpp +++ b/src/frontend/mame/ui/sndmenu.cpp @@ -78,7 +78,7 @@ void menu_sound_options::handle() if (menu_event != nullptr && menu_event->itemref != nullptr) { - switch ((FPTR)menu_event->itemref) + switch ((uintptr_t)menu_event->itemref) { case ENABLE_SOUND: if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT || menu_event->iptkey == IPT_UI_SELECT) @@ -130,9 +130,9 @@ void menu_sound_options::populate() m_sample_rate = m_sound_rate[m_cur_rates]; // add options items - item_append(_("Sound"), m_sound ? _("On") : _("Off"), m_sound ? FLAG_RIGHT_ARROW : FLAG_LEFT_ARROW, (void *)(FPTR)ENABLE_SOUND); - item_append(_("Sample Rate"), string_format("%d", m_sample_rate), arrow_flags, (void *)(FPTR)SAMPLE_RATE); - item_append(_("Use External Samples"), m_samples ? _("On") : _("Off"), m_samples ? FLAG_RIGHT_ARROW : FLAG_LEFT_ARROW, (void *)(FPTR)ENABLE_SAMPLES); + item_append(_("Sound"), m_sound ? _("On") : _("Off"), m_sound ? FLAG_RIGHT_ARROW : FLAG_LEFT_ARROW, (void *)(uintptr_t)ENABLE_SOUND); + item_append(_("Sample Rate"), string_format("%d", m_sample_rate), arrow_flags, (void *)(uintptr_t)SAMPLE_RATE); + item_append(_("Use External Samples"), m_samples ? _("On") : _("Off"), m_samples ? FLAG_RIGHT_ARROW : FLAG_LEFT_ARROW, (void *)(uintptr_t)ENABLE_SAMPLES); item_append(menu_item_type::SEPARATOR); customtop = ui().get_line_height() + (3.0f * UI_BOX_TB_BORDER); diff --git a/src/frontend/mame/ui/swlist.cpp b/src/frontend/mame/ui/swlist.cpp index df7bc42e2c1..2488c1d1cc4 100644 --- a/src/frontend/mame/ui/swlist.cpp +++ b/src/frontend/mame/ui/swlist.cpp @@ -36,7 +36,7 @@ namespace ui { // part //------------------------------------------------- -static bool is_valid_softlist_part_char(unicode_char ch) +static bool is_valid_softlist_part_char(char32_t ch) { return (ch == (char)ch) && isalnum(ch); } @@ -241,7 +241,7 @@ void menu_software_list::handle() if (event && event->itemref) { - if ((FPTR)event->itemref == 1 && event->iptkey == IPT_UI_SELECT) + if ((uintptr_t)event->itemref == 1 && event->iptkey == IPT_UI_SELECT) { m_ordered_by_shortname = !m_ordered_by_shortname; @@ -267,7 +267,7 @@ void menu_software_list::handle() ui().popup_time(ERROR_MESSAGE_TIME, "%s", m_filename_buffer); // identify the selected entry - entry_info const *const cur_selected = (FPTR(event->itemref) != 1) + entry_info const *const cur_selected = (uintptr_t(event->itemref) != 1) ? reinterpret_cast<entry_info const *>(get_selection_ref()) : nullptr; diff --git a/src/frontend/mame/ui/text.cpp b/src/frontend/mame/ui/text.cpp index 50e7cf6bbfe..457e9362f6e 100644 --- a/src/frontend/mame/ui/text.cpp +++ b/src/frontend/mame/ui/text.cpp @@ -25,7 +25,7 @@ INLINE FUNCTIONS // is_space_character //------------------------------------------------- -inline bool is_space_character(unicode_char ch) +inline bool is_space_character(char32_t ch) { return ch == ' '; } @@ -36,7 +36,7 @@ inline bool is_space_character(unicode_char ch) // character a possible line break? //------------------------------------------------- -inline bool is_breakable_char(unicode_char ch) +inline bool is_breakable_char(char32_t ch) { // regular spaces and hyphens are breakable if (is_space_character(ch) || ch == '-') @@ -127,7 +127,7 @@ void text_layout::add_text(const char *text, const char_style &style) if (m_current_line == nullptr) { // get the current character - unicode_char schar; + char32_t schar; int const scharcount = uchar_from_utf8(&schar, &text[position], text_length - position); if (scharcount < 0) break; @@ -145,7 +145,7 @@ void text_layout::add_text(const char *text, const char_style &style) } // get the current character - unicode_char ch; + char32_t ch; int const scharcount = uchar_from_utf8(&ch, &text[position], text_length - position); if (scharcount < 0) break; @@ -303,7 +303,7 @@ void text_layout::start_new_line(text_layout::text_justify justify, float height // get_char_width //------------------------------------------------- -float text_layout::get_char_width(unicode_char ch, float size) +float text_layout::get_char_width(char32_t ch, float size) { return font().char_width(size * yscale(), xscale() / yscale(), ch); } @@ -315,7 +315,7 @@ float text_layout::get_char_width(unicode_char ch, float size) void text_layout::truncate_wrap() { - const unicode_char elipsis = 0x2026; + const char32_t elipsis = 0x2026; // for now, lets assume that we're only truncating the last character size_t truncate_position = m_current_line->character_count() - 1; @@ -516,7 +516,7 @@ text_layout::line::line(text_layout &layout, text_justify justify, float yoffset // line::add_character //------------------------------------------------- -void text_layout::line::add_character(unicode_char ch, const char_style &style, const source_info &source) +void text_layout::line::add_character(char32_t ch, const char_style &style, const source_info &source) { // get the width of this character float chwidth = m_layout.get_char_width(ch, style.size); diff --git a/src/frontend/mame/ui/text.h b/src/frontend/mame/ui/text.h index 9ab717b5c5a..417fe27595d 100644 --- a/src/frontend/mame/ui/text.h +++ b/src/frontend/mame/ui/text.h @@ -98,7 +98,7 @@ private: // we'll get there eventually struct positioned_char { - unicode_char character; + char32_t character; char_style style; source_info source; float xoffset; @@ -112,7 +112,7 @@ private: line(text_layout &layout, text_justify justify, float yoffset, float height); // methods - void add_character(unicode_char ch, const char_style &style, const source_info &source); + void add_character(char32_t ch, const char_style &style, const source_info &source); void truncate(size_t position); // accessors @@ -151,7 +151,7 @@ private: // methods void add_text(const char *text, const char_style &style); void start_new_line(text_justify justify, float height); - float get_char_width(unicode_char ch, float size); + float get_char_width(char32_t ch, float size); void truncate_wrap(); void word_wrap(); void invalidate_calculated_actual_width(); diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp index ec3b5ea81a1..4499109f5c7 100644 --- a/src/frontend/mame/ui/ui.cpp +++ b/src/frontend/mame/ui/ui.cpp @@ -511,7 +511,7 @@ float mame_ui_manager::get_line_height() // single character //------------------------------------------------- -float mame_ui_manager::get_char_width(unicode_char ch) +float mame_ui_manager::get_char_width(char32_t ch) { return get_font()->char_width(get_line_height(), machine().render().ui_aspect(), ch); } @@ -1482,7 +1482,7 @@ std::vector<ui::menu_item> mame_ui_manager::slider_init(running_machine &machine INT32 defval = 1000; std::string str = string_format(_("%1$s Volume"), info.stream->input_name(info.inputnum)); - sliders.push_back(slider_alloc(machine, SLIDER_ID_MIXERVOL + item, str.c_str(), 0, defval, maxval, 20, (void *)(FPTR)item)); + sliders.push_back(slider_alloc(machine, SLIDER_ID_MIXERVOL + item, str.c_str(), 0, defval, maxval, 20, (void *)(uintptr_t)item)); } // add analog adjusters @@ -1702,7 +1702,7 @@ INT32 mame_ui_manager::slider_volume(running_machine &machine, void *arg, int id INT32 mame_ui_manager::slider_mixervol(running_machine &machine, void *arg, int id, std::string *str, INT32 newval) { mixer_input info; - if (!machine.sound().indexed_mixer_input((FPTR)arg, info)) + if (!machine.sound().indexed_mixer_input((uintptr_t)arg, info)) return 0; if (newval != SLIDER_NOCHANGE) { diff --git a/src/frontend/mame/ui/ui.h b/src/frontend/mame/ui/ui.h index c758eb4f0f7..aa9852005ef 100644 --- a/src/frontend/mame/ui/ui.h +++ b/src/frontend/mame/ui/ui.h @@ -177,7 +177,7 @@ public: void update_and_render(render_container &container); render_font *get_font(); float get_line_height(); - float get_char_width(unicode_char ch); + float get_char_width(char32_t ch); float get_string_width(const char *s, float text_size = 1.0f); void draw_outlined_box(render_container &container, float x0, float y0, float x1, float y1, rgb_t backcolor); void draw_outlined_box(render_container &container, float x0, float y0, float x1, float y1, rgb_t fgcolor, rgb_t bgcolor); diff --git a/src/frontend/mame/ui/utils.h b/src/frontend/mame/ui/utils.h index 04f1eb58da5..5e6c2f6acfd 100644 --- a/src/frontend/mame/ui/utils.h +++ b/src/frontend/mame/ui/utils.h @@ -244,7 +244,7 @@ std::vector<std::string> tokenize(const std::string &text, char sep); //------------------------------------------------- template <typename F> -bool input_character(std::string &buffer, std::string::size_type size, unicode_char unichar, F &&filter) +bool input_character(std::string &buffer, std::string::size_type size, char32_t unichar, F &&filter) { bool result = false; auto buflen = buffer.size(); @@ -280,7 +280,7 @@ bool input_character(std::string &buffer, std::string::size_type size, unicode_c //------------------------------------------------- template <typename F> -bool input_character(std::string &buffer, unicode_char unichar, F &&filter) +bool input_character(std::string &buffer, char32_t unichar, F &&filter) { auto size = std::numeric_limits<std::string::size_type>::max(); return input_character(buffer, size, unichar, filter); diff --git a/src/frontend/mame/ui/videoopt.cpp b/src/frontend/mame/ui/videoopt.cpp index 23ce49fa280..3d3aaf69e26 100644 --- a/src/frontend/mame/ui/videoopt.cpp +++ b/src/frontend/mame/ui/videoopt.cpp @@ -75,7 +75,7 @@ void menu_video_options::handle() const event *menu_event = process(0); if (menu_event != nullptr && menu_event->itemref != nullptr) { - switch ((FPTR)menu_event->itemref) + switch ((uintptr_t)menu_event->itemref) { /* rotate adds rotation depending on the direction */ case VIDEO_ITEM_ROTATE: @@ -145,9 +145,9 @@ void menu_video_options::handle() /* anything else is a view item */ default: - if (menu_event->iptkey == IPT_UI_SELECT && (int)(FPTR)menu_event->itemref >= VIDEO_ITEM_VIEW) + if (menu_event->iptkey == IPT_UI_SELECT && (int)(uintptr_t)menu_event->itemref >= VIDEO_ITEM_VIEW) { - target->set_view((FPTR)menu_event->itemref - VIDEO_ITEM_VIEW); + target->set_view((uintptr_t)menu_event->itemref - VIDEO_ITEM_VIEW); changed = true; } break; @@ -187,7 +187,7 @@ void menu_video_options::populate() /* create a string for the item, replacing underscores with spaces */ tempstring.assign(name); strreplace(tempstring, "_", " "); - item_append(tempstring, "", 0, (void *)(FPTR)(VIDEO_ITEM_VIEW + viewnum)); + item_append(tempstring, "", 0, (void *)(uintptr_t)(VIDEO_ITEM_VIEW + viewnum)); } /* add a separator */ diff --git a/src/lib/util/corefile.cpp b/src/lib/util/corefile.cpp index 54dbca51813..699ef91027b 100644 --- a/src/lib/util/corefile.cpp +++ b/src/lib/util/corefile.cpp @@ -410,8 +410,8 @@ int core_text_file::getc() } // fetch the next character - utf16_char utf16_buffer[UTF16_CHAR_MAX]; - unicode_char uchar = unicode_char(~0); + char16_t utf16_buffer[UTF16_CHAR_MAX]; + char32_t uchar = char32_t(~0); switch (m_text_type) { default: diff --git a/src/lib/util/un7z.cpp b/src/lib/util/un7z.cpp index 33a9c3f51db..7af3e7f78ce 100644 --- a/src/lib/util/un7z.cpp +++ b/src/lib/util/un7z.cpp @@ -184,7 +184,7 @@ private: std::uint32_t m_curr_crc; // current file crc std::vector<UInt16> m_utf16_buf; - std::vector<unicode_char> m_uchar_buf; + std::vector<char32_t> m_uchar_buf; std::vector<char> m_utf8_buf; CFileInStream m_archive_stream; @@ -479,7 +479,7 @@ void m7z_file_impl::make_utf8_name(int index) out_pos = 0; for (std::size_t in_pos = 0; in_pos < (len - 1); ) { - const int used = uchar_from_utf16(&m_uchar_buf[out_pos], &m_utf16_buf[in_pos], len - in_pos); + const int used = uchar_from_utf16(&m_uchar_buf[out_pos], (char16_t *)&m_utf16_buf[in_pos], len - in_pos); if (used < 0) { in_pos++; diff --git a/src/lib/util/unicode.cpp b/src/lib/util/unicode.cpp index 65936e10b48..a6c5515fbf6 100644 --- a/src/lib/util/unicode.cpp +++ b/src/lib/util/unicode.cpp @@ -16,7 +16,7 @@ // character is a legitimate unicode character //------------------------------------------------- -bool uchar_isvalid(unicode_char uchar) +bool uchar_isvalid(char32_t uchar) { return (uchar < 0x110000) && !((uchar >= 0xd800) && (uchar <= 0xdfff)); } @@ -27,7 +27,7 @@ bool uchar_isvalid(unicode_char uchar) // char is printable //------------------------------------------------- -bool uchar_is_printable(unicode_char uchar) +bool uchar_is_printable(char32_t uchar) { return !(0x0001f >= uchar) && // C0 control @@ -43,7 +43,7 @@ bool uchar_is_printable(unicode_char uchar) // char is a digit //------------------------------------------------- -bool uchar_is_digit(unicode_char uchar) +bool uchar_is_digit(char32_t uchar) { return uchar >= '0' && uchar <= '9'; } @@ -54,9 +54,9 @@ bool uchar_is_digit(unicode_char uchar) // into a unicode character //----------------------------------------------- -int uchar_from_utf8(unicode_char *uchar, const char *utf8char, size_t count) +int uchar_from_utf8(char32_t *uchar, const char *utf8char, size_t count) { - unicode_char c, minchar; + char32_t c, minchar; int auxlen, i; char auxchar; @@ -149,7 +149,7 @@ int uchar_from_utf8(unicode_char *uchar, const char *utf8char, size_t count) // into a unicode character //------------------------------------------------- -int uchar_from_utf16(unicode_char *uchar, const utf16_char *utf16char, size_t count) +int uchar_from_utf16(char32_t *uchar, const char16_t *utf16char, size_t count) { int rc = -1; @@ -184,9 +184,9 @@ int uchar_from_utf16(unicode_char *uchar, const utf16_char *utf16char, size_t co // byte order //------------------------------------------------- -int uchar_from_utf16f(unicode_char *uchar, const utf16_char *utf16char, size_t count) +int uchar_from_utf16f(char32_t *uchar, const char16_t *utf16char, size_t count) { - utf16_char buf[2] = {0}; + char16_t buf[2] = {0}; if (count > 0) buf[0] = flipendian_int16(utf16char[0]); if (count > 1) @@ -200,7 +200,7 @@ int uchar_from_utf16f(unicode_char *uchar, const utf16_char *utf16char, size_t c // into a UTF-8 sequence //------------------------------------------------- -int utf8_from_uchar(char *utf8string, size_t count, unicode_char uchar) +int utf8_from_uchar(char *utf8string, size_t count, char32_t uchar) { int rc = 0; @@ -278,7 +278,7 @@ int utf8_from_uchar(char *utf8string, size_t count, unicode_char uchar) // into a UTF-8 sequence //------------------------------------------------- -std::string utf8_from_uchar(unicode_char uchar) +std::string utf8_from_uchar(char32_t uchar) { char buffer[UTF8_CHAR_MAX]; auto len = utf8_from_uchar(buffer, ARRAY_LENGTH(buffer), uchar); @@ -291,7 +291,7 @@ std::string utf8_from_uchar(unicode_char uchar) // into a UTF-16 sequence //------------------------------------------------- -int utf16_from_uchar(utf16_char *utf16string, size_t count, unicode_char uchar) +int utf16_from_uchar(char16_t *utf16string, size_t count, char32_t uchar) { int rc; @@ -304,7 +304,7 @@ int utf16_from_uchar(utf16_char *utf16string, size_t count, unicode_char uchar) // single word case if (count < 1) return -1; - utf16string[0] = (utf16_char) uchar; + utf16string[0] = (char16_t) uchar; rc = 1; } else if (uchar < 0x100000) @@ -330,10 +330,10 @@ int utf16_from_uchar(utf16_char *utf16string, size_t count, unicode_char uchar) // into a UTF-16 sequence with flipped endianness //------------------------------------------------- -int utf16f_from_uchar(utf16_char *utf16string, size_t count, unicode_char uchar) +int utf16f_from_uchar(char16_t *utf16string, size_t count, char32_t uchar) { int rc; - utf16_char buf[2] = { 0, 0 }; + char16_t buf[2] = { 0, 0 }; rc = utf16_from_uchar(buf, count, uchar); @@ -390,7 +390,7 @@ bool utf8_is_valid_string(const char *utf8string) while (*utf8string != 0) { - unicode_char uchar = 0; + char32_t uchar = 0; int charlen; // extract the current character and verify it diff --git a/src/lib/util/unicode.h b/src/lib/util/unicode.h index 152e76826c2..5cc6db383ee 100644 --- a/src/lib/util/unicode.h +++ b/src/lib/util/unicode.h @@ -73,39 +73,29 @@ #define UTF8_DOWN "\xe2\x86\x93" /* cursor down */ - -/*************************************************************************** - TYPE DEFINITIONS -***************************************************************************/ - -typedef UINT16 utf16_char; -typedef UINT32 unicode_char; - - - /*************************************************************************** FUNCTION PROTOTYPES ***************************************************************************/ // tests to see if a unicode char is a valid code point -bool uchar_isvalid(unicode_char uchar); +bool uchar_isvalid(char32_t uchar); // tests to see if a unicode char is printable -bool uchar_is_printable(unicode_char uchar); +bool uchar_is_printable(char32_t uchar); // tests to see if a unicode char is a digit -bool uchar_is_digit(unicode_char uchar); +bool uchar_is_digit(char32_t uchar); // converting strings to 32-bit Unicode chars -int uchar_from_utf8(unicode_char *uchar, const char *utf8char, size_t count); -int uchar_from_utf16(unicode_char *uchar, const utf16_char *utf16char, size_t count); -int uchar_from_utf16f(unicode_char *uchar, const utf16_char *utf16char, size_t count); +int uchar_from_utf8(char32_t *uchar, const char *utf8char, size_t count); +int uchar_from_utf16(char32_t *uchar, const char16_t *utf16char, size_t count); +int uchar_from_utf16f(char32_t *uchar, const char16_t *utf16char, size_t count); // converting 32-bit Unicode chars to strings -int utf8_from_uchar(char *utf8string, size_t count, unicode_char uchar); -std::string utf8_from_uchar(unicode_char uchar); -int utf16_from_uchar(utf16_char *utf16string, size_t count, unicode_char uchar); -int utf16f_from_uchar(utf16_char *utf16string, size_t count, unicode_char uchar); +int utf8_from_uchar(char *utf8string, size_t count, char32_t uchar); +std::string utf8_from_uchar(char32_t uchar); +int utf16_from_uchar(char16_t *utf16string, size_t count, char32_t uchar); +int utf16f_from_uchar(char16_t *utf16string, size_t count, char32_t uchar); // misc UTF-8 helpers const char *utf8_previous_char(const char *utf8string); diff --git a/src/mame/drivers/a310.cpp b/src/mame/drivers/a310.cpp index f86afe2db95..dcc55ab7b9c 100644 --- a/src/mame/drivers/a310.cpp +++ b/src/mame/drivers/a310.cpp @@ -169,8 +169,8 @@ ADDRESS_MAP_END INPUT_CHANGED_MEMBER(a310_state::key_stroke) { - UINT8 row_val = (UINT8)(FPTR)(param) >> 4; - UINT8 col_val = (UINT8)(FPTR)(param) & 0xf; + UINT8 row_val = (UINT8)(uintptr_t)(param) >> 4; + UINT8 col_val = (UINT8)(uintptr_t)(param) & 0xf; if(newval && !oldval) m_kart->send_keycode_down(row_val,col_val); diff --git a/src/mame/drivers/acefruit.cpp b/src/mame/drivers/acefruit.cpp index 82d32c65e85..a9b01d35d77 100644 --- a/src/mame/drivers/acefruit.cpp +++ b/src/mame/drivers/acefruit.cpp @@ -202,7 +202,7 @@ UINT32 acefruit_state::screen_update_acefruit(screen_device &screen, bitmap_ind1 CUSTOM_INPUT_MEMBER(acefruit_state::sidewndr_payout_r) { - int bit_mask = (FPTR)param; + int bit_mask = (uintptr_t)param; switch (bit_mask) { @@ -218,7 +218,7 @@ CUSTOM_INPUT_MEMBER(acefruit_state::sidewndr_payout_r) CUSTOM_INPUT_MEMBER(acefruit_state::starspnr_coinage_r) { - int bit_mask = (FPTR)param; + int bit_mask = (uintptr_t)param; switch (bit_mask) { @@ -238,7 +238,7 @@ CUSTOM_INPUT_MEMBER(acefruit_state::starspnr_coinage_r) CUSTOM_INPUT_MEMBER(acefruit_state::starspnr_payout_r) { - int bit_mask = (FPTR)param; + int bit_mask = (uintptr_t)param; switch (bit_mask) { diff --git a/src/mame/drivers/amiga.cpp b/src/mame/drivers/amiga.cpp index 4b561e6eab2..308071d5dc4 100644 --- a/src/mame/drivers/amiga.cpp +++ b/src/mame/drivers/amiga.cpp @@ -907,7 +907,7 @@ CUSTOM_INPUT_MEMBER( cd32_state::cd32_input ) CUSTOM_INPUT_MEMBER( cd32_state::cd32_sel_mirror_input ) { - UINT8 bits = m_player_ports[(int)(FPTR)param]->read(); + UINT8 bits = m_player_ports[(int)(uintptr_t)param]->read(); return (bits & 0x20)>>5; } diff --git a/src/mame/drivers/apc.cpp b/src/mame/drivers/apc.cpp index 7076123f631..b19e032034c 100644 --- a/src/mame/drivers/apc.cpp +++ b/src/mame/drivers/apc.cpp @@ -500,7 +500,7 @@ INPUT_CHANGED_MEMBER(apc_state::key_stroke) { if(newval && !oldval) { - m_keyb.data = (UINT8)(FPTR)(param) & 0xff; + m_keyb.data = (UINT8)(uintptr_t)(param) & 0xff; //m_keyb.status &= ~1; machine().device<pic8259_device>("pic8259_master")->ir4_w(1); } diff --git a/src/mame/drivers/arsystems.cpp b/src/mame/drivers/arsystems.cpp index 5195cc5d8ab..d54a3f723f6 100644 --- a/src/mame/drivers/arsystems.cpp +++ b/src/mame/drivers/arsystems.cpp @@ -154,7 +154,7 @@ WRITE8_MEMBER(arcadia_amiga_state::arcadia_cia_0_portb_w) CUSTOM_INPUT_MEMBER(arcadia_amiga_state::coin_counter_r) { - int coin = (FPTR)param; + int coin = (uintptr_t)param; /* return coin counter values */ return m_coin_counter[coin] & 3; @@ -163,7 +163,7 @@ CUSTOM_INPUT_MEMBER(arcadia_amiga_state::coin_counter_r) INPUT_CHANGED_MEMBER(arcadia_amiga_state::coin_changed_callback) { - int coin = (FPTR)param; + int coin = (uintptr_t)param; /* check for a 0 -> 1 transition */ if (!oldval && newval && m_coin_counter[coin] < 3) diff --git a/src/mame/drivers/bnstars.cpp b/src/mame/drivers/bnstars.cpp index db3beac36f2..ed01ca3fd5a 100644 --- a/src/mame/drivers/bnstars.cpp +++ b/src/mame/drivers/bnstars.cpp @@ -708,7 +708,7 @@ GFXDECODE_END CUSTOM_INPUT_MEMBER(bnstars_state::mahjong_ctrl_r) { - required_ioport_array<4> &keys = (((int)(FPTR)param) == 0) ? m_p1_keys : m_p2_keys; + required_ioport_array<4> &keys = (((int)(uintptr_t)param) == 0) ? m_p1_keys : m_p2_keys; switch (m_bnstars1_mahjong_select & 0x2080) { diff --git a/src/mame/drivers/by17.cpp b/src/mame/drivers/by17.cpp index f6ea6742774..128ea6eb3fb 100644 --- a/src/mame/drivers/by17.cpp +++ b/src/mame/drivers/by17.cpp @@ -431,8 +431,8 @@ INPUT_PORTS_END CUSTOM_INPUT_MEMBER( by17_state::outhole_x0 ) { - int bit_shift = ((FPTR)param & 0x07); - int port = (((FPTR)param >> 4) & 0x07); + int bit_shift = ((uintptr_t)param & 0x07); + int port = (((uintptr_t)param >> 4) & 0x07); /* Here we simulate the ball sitting in the Outhole so the Outhole Solenoid can release it */ @@ -444,8 +444,8 @@ CUSTOM_INPUT_MEMBER( by17_state::outhole_x0 ) CUSTOM_INPUT_MEMBER( by17_state::saucer_x3 ) { - int bit_shift = ((FPTR)param & 0x07); - int port = (((FPTR)param >> 4) & 0x07); + int bit_shift = ((uintptr_t)param & 0x07); + int port = (((uintptr_t)param >> 4) & 0x07); /* Here we simulate the ball sitting in a Saucer so the Saucer Solenoid can release it */ @@ -460,8 +460,8 @@ CUSTOM_INPUT_MEMBER( by17_state::drop_target_x2 ) { /* Here we simulate fallen Drop Targets so the Drop Target Reset Solenoids can release the switches */ - int bit_shift = ((FPTR)param & 0x07); - int port = (((FPTR)param >> 4) & 0x07); + int bit_shift = ((uintptr_t)param & 0x07); + int port = (((uintptr_t)param >> 4) & 0x07); switch (bit_shift) { diff --git a/src/mame/drivers/by35.cpp b/src/mame/drivers/by35.cpp index 85eda358902..6728f12eae1 100644 --- a/src/mame/drivers/by35.cpp +++ b/src/mame/drivers/by35.cpp @@ -430,8 +430,8 @@ INPUT_PORTS_END CUSTOM_INPUT_MEMBER( by35_state::outhole_x0 ) { - int bit_shift = ((FPTR)param & 0x07); - int port = (((FPTR)param >> 4) & 0x07); + int bit_shift = ((uintptr_t)param & 0x07); + int port = (((uintptr_t)param >> 4) & 0x07); /* Here we simulate the ball sitting in the Outhole so the Outhole Solenoid can release it */ @@ -443,8 +443,8 @@ CUSTOM_INPUT_MEMBER( by35_state::outhole_x0 ) CUSTOM_INPUT_MEMBER( by35_state::kickback_x3 ) { - int bit_shift = ((FPTR)param & 0x07); - int port = (((FPTR)param >> 4) & 0x07); + int bit_shift = ((uintptr_t)param & 0x07); + int port = (((uintptr_t)param >> 4) & 0x07); /* Here we simulate the ball sitting in a Saucer so the Saucer Solenoid can release it */ @@ -458,8 +458,8 @@ CUSTOM_INPUT_MEMBER( by35_state::drop_target_x0 ) { /* Here we simulate the Drop Target switch states so the Drop Target Reset Solenoid can also release the switches */ - int bit_shift = ((FPTR)param & 0x07); - int port = (((FPTR)param >> 4) & 0x07); + int bit_shift = ((uintptr_t)param & 0x07); + int port = (((uintptr_t)param >> 4) & 0x07); switch (bit_shift) { diff --git a/src/mame/drivers/cc40.cpp b/src/mame/drivers/cc40.cpp index e8e04132d12..3385d032ef9 100644 --- a/src/mame/drivers/cc40.cpp +++ b/src/mame/drivers/cc40.cpp @@ -389,7 +389,7 @@ ADDRESS_MAP_END INPUT_CHANGED_MEMBER(cc40_state::sysram_size_changed) { - init_sysram((int)(FPTR)param, newval << 11); + init_sysram((int)(uintptr_t)param, newval << 11); } static INPUT_PORTS_START( cc40 ) diff --git a/src/mame/drivers/cdi.cpp b/src/mame/drivers/cdi.cpp index fb0bdbf47e4..0ed78ba75e0 100644 --- a/src/mame/drivers/cdi.cpp +++ b/src/mame/drivers/cdi.cpp @@ -140,7 +140,7 @@ INPUT_CHANGED_MEMBER(cdi_state::mcu_input) { bool send = false; - switch((FPTR)param) + switch((uintptr_t)param) { case 0x39: if (m_input1.read_safe(0) & 0x01) send = true; @@ -177,7 +177,7 @@ INPUT_CHANGED_MEMBER(cdi_state::mcu_input) if(send) { - UINT8 data = (UINT8)((FPTR)param & 0x000000ff); + UINT8 data = (UINT8)((uintptr_t)param & 0x000000ff); m_scc->quizard_rx(data); } } diff --git a/src/mame/drivers/chessmst.cpp b/src/mame/drivers/chessmst.cpp index 771b281ebd2..0da9d76a24f 100644 --- a/src/mame/drivers/chessmst.cpp +++ b/src/mame/drivers/chessmst.cpp @@ -117,7 +117,7 @@ INPUT_CHANGED_MEMBER(chessmst_state::view_monitor_button) INPUT_CHANGED_MEMBER(chessmst_state::chessmst_sensor) { - UINT8 pos = (UINT8)(FPTR)param; + UINT8 pos = (UINT8)(uintptr_t)param; if (newval) { diff --git a/src/mame/drivers/cischeat.cpp b/src/mame/drivers/cischeat.cpp index 50c2a04b9bb..8e6ed65744e 100644 --- a/src/mame/drivers/cischeat.cpp +++ b/src/mame/drivers/cischeat.cpp @@ -786,7 +786,7 @@ void cischeat_state::captflag_motor_move(int side, UINT16 data) CUSTOM_INPUT_MEMBER(cischeat_state::captflag_motor_pos_r) { const UINT8 pos[4] = {1,0,2,3}; // -> 2,3,1,0 offsets -> 0123 - return ~pos[m_captflag_motor_pos[(FPTR)param]]; + return ~pos[m_captflag_motor_pos[(uintptr_t)param]]; } CUSTOM_INPUT_MEMBER(cischeat_state::captflag_motor_busy_r) diff --git a/src/mame/drivers/cop01.cpp b/src/mame/drivers/cop01.cpp index 650895fd373..9485816f51a 100644 --- a/src/mame/drivers/cop01.cpp +++ b/src/mame/drivers/cop01.cpp @@ -99,7 +99,7 @@ READ8_MEMBER(cop01_state::cop01_sound_command_r) CUSTOM_INPUT_MEMBER(cop01_state::mightguy_area_r) { - int bit_mask = (FPTR)param; + int bit_mask = (uintptr_t)param; return (ioport("FAKE")->read() & bit_mask) ? 0x01 : 0x00; } diff --git a/src/mame/drivers/crystal.cpp b/src/mame/drivers/crystal.cpp index e25b715c507..7664c0422ea 100644 --- a/src/mame/drivers/crystal.cpp +++ b/src/mame/drivers/crystal.cpp @@ -389,7 +389,7 @@ WRITE32_MEMBER(crystal_state::Banksw_w) TIMER_CALLBACK_MEMBER(crystal_state::Timercb) { - int which = (int)(FPTR)ptr; + int which = (int)(uintptr_t)ptr; static const int num[] = { 0, 1, 9, 10 }; if (!(m_Timerctrl[which] & 2)) @@ -772,7 +772,7 @@ void crystal_state::machine_start() int i; for (i = 0; i < 4; i++) - m_Timer[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(crystal_state::Timercb),this), (void*)(FPTR)i); + m_Timer[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(crystal_state::Timercb),this), (void*)(uintptr_t)i); PatchReset(); diff --git a/src/mame/drivers/cubo.cpp b/src/mame/drivers/cubo.cpp index 010c59a762e..5532adb9171 100644 --- a/src/mame/drivers/cubo.cpp +++ b/src/mame/drivers/cubo.cpp @@ -522,7 +522,7 @@ CUSTOM_INPUT_MEMBER( cubo_state::cubo_input ) CUSTOM_INPUT_MEMBER( cubo_state::cd32_sel_mirror_input ) { - UINT8 bits = m_player_ports[(int)(FPTR)param]->read(); + UINT8 bits = m_player_ports[(int)(uintptr_t)param]->read(); return (bits & 0x20)>>5; } diff --git a/src/mame/drivers/deshoros.cpp b/src/mame/drivers/deshoros.cpp index 17a67a9a56c..a3fce6cb892 100644 --- a/src/mame/drivers/deshoros.cpp +++ b/src/mame/drivers/deshoros.cpp @@ -156,7 +156,7 @@ INPUT_CHANGED_MEMBER(destiny_state::coin_inserted) m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); // coincounter on coin insert - if (((int)(FPTR)param) == 0) + if (((int)(uintptr_t)param) == 0) machine().bookkeeping().coin_counter_w(0, newval); } diff --git a/src/mame/drivers/digel804.cpp b/src/mame/drivers/digel804.cpp index 8e56c443a0f..05ab0883ca3 100644 --- a/src/mame/drivers/digel804.cpp +++ b/src/mame/drivers/digel804.cpp @@ -350,7 +350,7 @@ INPUT_CHANGED_MEMBER( digel804_state::mode_change ) { if (!newval && !m_keyen_state) { - switch ((int)(FPTR)param) + switch ((int)(uintptr_t)param) { case MODE_OFF: m_key_mode = m_remote_mode = m_sim_mode = 1; diff --git a/src/mame/drivers/esq1.cpp b/src/mame/drivers/esq1.cpp index daa63b3904d..51310b25c8d 100644 --- a/src/mame/drivers/esq1.cpp +++ b/src/mame/drivers/esq1.cpp @@ -571,13 +571,13 @@ INPUT_CHANGED_MEMBER(esq1_state::key_stroke) { if (oldval == 0 && newval == 1) { - send_through_panel((UINT8)(FPTR)param); - send_through_panel((UINT8)(FPTR)0x00); + send_through_panel((UINT8)(uintptr_t)param); + send_through_panel((UINT8)(uintptr_t)0x00); } else if (oldval == 1 && newval == 0) { - send_through_panel((UINT8)(FPTR)param&0x7f); - send_through_panel((UINT8)(FPTR)0x00); + send_through_panel((UINT8)(uintptr_t)param&0x7f); + send_through_panel((UINT8)(uintptr_t)0x00); } } diff --git a/src/mame/drivers/esq5505.cpp b/src/mame/drivers/esq5505.cpp index 05a7f163791..b9e72bec995 100644 --- a/src/mame/drivers/esq5505.cpp +++ b/src/mame/drivers/esq5505.cpp @@ -548,7 +548,7 @@ WRITE8_MEMBER(esq5505_state::fdc_write_byte) #if KEYBOARD_HACK INPUT_CHANGED_MEMBER(esq5505_state::key_stroke) { - int val = (UINT8)(FPTR)param; + int val = (UINT8)(uintptr_t)param; int cmp = 0x60; if (m_system_type == SQ1) @@ -591,7 +591,7 @@ INPUT_CHANGED_MEMBER(esq5505_state::key_stroke) } else if (oldval == 1 && newval == 0) { - // printf("key off %x\n", (UINT8)(FPTR)param); + // printf("key off %x\n", (UINT8)(uintptr_t)param); m_panel->xmit_char(val&0x7f); m_panel->xmit_char(0x00); } diff --git a/src/mame/drivers/fantland.cpp b/src/mame/drivers/fantland.cpp index b175a144897..552fe5a4869 100644 --- a/src/mame/drivers/fantland.cpp +++ b/src/mame/drivers/fantland.cpp @@ -719,7 +719,7 @@ INPUT_PORTS_END CUSTOM_INPUT_MEMBER(fantland_state::wheelrun_wheel_r) { - int player = (FPTR)param; + int player = (uintptr_t)param; int delta = ioport(player ? "WHEEL1" : "WHEEL0")->read(); delta = (delta & 0x7f) - (delta & 0x80) + 4; diff --git a/src/mame/drivers/firetrap.cpp b/src/mame/drivers/firetrap.cpp index 05f577354a0..6a2dc7d14a5 100644 --- a/src/mame/drivers/firetrap.cpp +++ b/src/mame/drivers/firetrap.cpp @@ -409,7 +409,7 @@ INPUT_CHANGED_MEMBER(firetrap_state::coin_inserted) /* coin insertion causes an IRQ */ if(newval) { - m_coin_command_pending = (UINT8)(FPTR)(param); + m_coin_command_pending = (UINT8)(uintptr_t)(param); /* Make sure coin IRQ's aren't generated when another command is pending, the main cpu definitely doesn't expect them as it locks out the coin routine */ diff --git a/src/mame/drivers/firetrk.cpp b/src/mame/drivers/firetrk.cpp index edefbdff506..c0f4bf3539c 100644 --- a/src/mame/drivers/firetrk.cpp +++ b/src/mame/drivers/firetrk.cpp @@ -45,7 +45,7 @@ INPUT_CHANGED_MEMBER(firetrk_state::gear_changed) { if (newval) { - m_gear = (FPTR)param; + m_gear = (uintptr_t)param; output().set_value("P1gear", m_gear+1); } } @@ -179,20 +179,20 @@ READ8_MEMBER(firetrk_state::montecar_dip_r) CUSTOM_INPUT_MEMBER(firetrk_state::steer_dir_r) { - return m_steer_dir[(FPTR)param]; + return m_steer_dir[(uintptr_t)param]; } CUSTOM_INPUT_MEMBER(firetrk_state::steer_flag_r) { - return m_steer_flag[(FPTR)param]; + return m_steer_flag[(uintptr_t)param]; } CUSTOM_INPUT_MEMBER(firetrk_state::skid_r) { UINT32 ret; - int which = (FPTR)param; + int which = (uintptr_t)param; if (which != 2) ret = m_skid[which]; @@ -206,7 +206,7 @@ CUSTOM_INPUT_MEMBER(firetrk_state::skid_r) CUSTOM_INPUT_MEMBER(firetrk_state::crash_r) { UINT32 ret; - int which = (FPTR)param; + int which = (uintptr_t)param; if (which != 2) ret = m_crash[which]; @@ -219,7 +219,7 @@ CUSTOM_INPUT_MEMBER(firetrk_state::crash_r) CUSTOM_INPUT_MEMBER(firetrk_state::gear_r) { - return (m_gear == (FPTR)param) ? 1 : 0; + return (m_gear == (uintptr_t)param) ? 1 : 0; } diff --git a/src/mame/drivers/gaelco3d.cpp b/src/mame/drivers/gaelco3d.cpp index a5c101635aa..27491d2e0ee 100644 --- a/src/mame/drivers/gaelco3d.cpp +++ b/src/mame/drivers/gaelco3d.cpp @@ -397,7 +397,7 @@ WRITE16_MEMBER(gaelco3d_state::sound_status_w) CUSTOM_INPUT_MEMBER(gaelco3d_state::analog_bit_r) { - int which = (FPTR)param; + int which = (uintptr_t)param; return (m_analog_ports[which] >> 7) & 0x01; } diff --git a/src/mame/drivers/galaxian.cpp b/src/mame/drivers/galaxian.cpp index 0fa21ee33e7..ce8bb01b2eb 100644 --- a/src/mame/drivers/galaxian.cpp +++ b/src/mame/drivers/galaxian.cpp @@ -1300,7 +1300,7 @@ WRITE8_MEMBER(galaxian_state::zigzag_ay8910_w) CUSTOM_INPUT_MEMBER(galaxian_state::azurian_port_r) { - return (ioport("FAKE")->read() >> (FPTR)param) & 1; + return (ioport("FAKE")->read() >> (uintptr_t)param) & 1; } diff --git a/src/mame/drivers/galaxold.cpp b/src/mame/drivers/galaxold.cpp index 9fffe24187b..79f0270fb06 100644 --- a/src/mame/drivers/galaxold.cpp +++ b/src/mame/drivers/galaxold.cpp @@ -781,7 +781,7 @@ ADDRESS_MAP_END /* Lives Dips are spread across two input ports */ CUSTOM_INPUT_MEMBER(galaxold_state::vpool_lives_r) { - int bit_mask = (FPTR)param; + int bit_mask = (uintptr_t)param; switch (bit_mask) { @@ -1024,7 +1024,7 @@ INPUT_PORTS_END /* Coinage Dips are spread across two input ports */ CUSTOM_INPUT_MEMBER(galaxold_state::ckongg_coinage_r) { - int bit_mask = (FPTR)param; + int bit_mask = (uintptr_t)param; switch (bit_mask) { @@ -1536,7 +1536,7 @@ INPUT_PORTS_END /* Coinage Dips are spread across two input ports */ CUSTOM_INPUT_MEMBER(galaxold_state::dkongjrm_coinage_r) { - int bit_mask = (FPTR)param; + int bit_mask = (uintptr_t)param; switch (bit_mask) { diff --git a/src/mame/drivers/gba.cpp b/src/mame/drivers/gba.cpp index 607fee7e7c2..f05c534146c 100644 --- a/src/mame/drivers/gba.cpp +++ b/src/mame/drivers/gba.cpp @@ -154,7 +154,7 @@ TIMER_CALLBACK_MEMBER(gba_state::dma_complete) { static const UINT32 ch_int[4] = { INT_DMA0, INT_DMA1, INT_DMA2, INT_DMA3 }; - FPTR ch = param; + uintptr_t ch = param; // printf("dma complete: ch %d\n", ch); @@ -394,7 +394,7 @@ void gba_state::audio_tick(int ref) TIMER_CALLBACK_MEMBER(gba_state::timer_expire) { static const UINT32 tmr_ints[4] = { INT_TM0_OVERFLOW, INT_TM1_OVERFLOW, INT_TM2_OVERFLOW, INT_TM3_OVERFLOW }; - FPTR tmr = (FPTR) param; + uintptr_t tmr = (uintptr_t) param; // "The reload value is copied into the counter only upon following two situations: Automatically upon timer overflows," // "or when the timer start bit becomes changed from 0 to 1." diff --git a/src/mame/drivers/geniusiq.cpp b/src/mame/drivers/geniusiq.cpp index 95a038ea0bd..bb1ec82b0aa 100644 --- a/src/mame/drivers/geniusiq.cpp +++ b/src/mame/drivers/geniusiq.cpp @@ -498,7 +498,7 @@ INPUT_CHANGED_MEMBER( geniusiq_state::send_mouse_input ) INPUT_CHANGED_MEMBER( geniusiq_state::send_input ) { - UINT16 data = (UINT16)(FPTR)param; + UINT16 data = (UINT16)(uintptr_t)param; // set bit 7 if the key is released if (!newval) diff --git a/src/mame/drivers/gp32.cpp b/src/mame/drivers/gp32.cpp index a72a0575f56..b4050f0a39e 100644 --- a/src/mame/drivers/gp32.cpp +++ b/src/mame/drivers/gp32.cpp @@ -1602,18 +1602,18 @@ WRITE32_MEMBER(gp32_state::s3c240x_mmc_w) void gp32_state::s3c240x_machine_start() { - m_s3c240x_pwm_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_pwm_timer_exp),this), (void *)(FPTR)0); - m_s3c240x_pwm_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_pwm_timer_exp),this), (void *)(FPTR)1); - m_s3c240x_pwm_timer[2] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_pwm_timer_exp),this), (void *)(FPTR)2); - m_s3c240x_pwm_timer[3] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_pwm_timer_exp),this), (void *)(FPTR)3); - m_s3c240x_pwm_timer[4] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_pwm_timer_exp),this), (void *)(FPTR)4); - m_s3c240x_dma_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_dma_timer_exp),this), (void *)(FPTR)0); - m_s3c240x_dma_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_dma_timer_exp),this), (void *)(FPTR)1); - m_s3c240x_dma_timer[2] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_dma_timer_exp),this), (void *)(FPTR)2); - m_s3c240x_dma_timer[3] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_dma_timer_exp),this), (void *)(FPTR)3); - m_s3c240x_iic_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_iic_timer_exp),this), (void *)(FPTR)0); - m_s3c240x_iis_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_iis_timer_exp),this), (void *)(FPTR)0); - m_s3c240x_lcd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_lcd_timer_exp),this), (void *)(FPTR)0); + m_s3c240x_pwm_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_pwm_timer_exp),this), (void *)(uintptr_t)0); + m_s3c240x_pwm_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_pwm_timer_exp),this), (void *)(uintptr_t)1); + m_s3c240x_pwm_timer[2] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_pwm_timer_exp),this), (void *)(uintptr_t)2); + m_s3c240x_pwm_timer[3] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_pwm_timer_exp),this), (void *)(uintptr_t)3); + m_s3c240x_pwm_timer[4] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_pwm_timer_exp),this), (void *)(uintptr_t)4); + m_s3c240x_dma_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_dma_timer_exp),this), (void *)(uintptr_t)0); + m_s3c240x_dma_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_dma_timer_exp),this), (void *)(uintptr_t)1); + m_s3c240x_dma_timer[2] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_dma_timer_exp),this), (void *)(uintptr_t)2); + m_s3c240x_dma_timer[3] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_dma_timer_exp),this), (void *)(uintptr_t)3); + m_s3c240x_iic_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_iic_timer_exp),this), (void *)(uintptr_t)0); + m_s3c240x_iis_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_iis_timer_exp),this), (void *)(uintptr_t)0); + m_s3c240x_lcd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gp32_state::s3c240x_lcd_timer_exp),this), (void *)(uintptr_t)0); m_eeprom_data = std::make_unique<UINT8[]>(0x2000); m_nvram->set_base(m_eeprom_data.get(), 0x2000); smc_init(); diff --git a/src/mame/drivers/guab.cpp b/src/mame/drivers/guab.cpp index 222a23b86f5..62a04e77e23 100644 --- a/src/mame/drivers/guab.cpp +++ b/src/mame/drivers/guab.cpp @@ -304,7 +304,7 @@ INPUT_CHANGED_MEMBER(guab_state::coin_inserted) address_space &space = m_maincpu->space(AS_PROGRAM); /* Get the current credit value and add the new coin value */ - credit = space.read_dword(0x8002c) + (UINT32)(FPTR)param; + credit = space.read_dword(0x8002c) + (UINT32)(uintptr_t)param; space.write_dword(0x8002c, credit); } } diff --git a/src/mame/drivers/hh_hmcs40.cpp b/src/mame/drivers/hh_hmcs40.cpp index ce85efeda38..677e3be8862 100644 --- a/src/mame/drivers/hh_hmcs40.cpp +++ b/src/mame/drivers/hh_hmcs40.cpp @@ -341,7 +341,7 @@ void hh_hmcs40_state::set_interrupt(int line, int state) INPUT_CHANGED_MEMBER(hh_hmcs40_state::single_interrupt_line) { - set_interrupt((int)(FPTR)param, newval); + set_interrupt((int)(uintptr_t)param, newval); } diff --git a/src/mame/drivers/hh_tms1k.cpp b/src/mame/drivers/hh_tms1k.cpp index 546e268cacf..06c03be9a80 100644 --- a/src/mame/drivers/hh_tms1k.cpp +++ b/src/mame/drivers/hh_tms1k.cpp @@ -381,7 +381,7 @@ WRITE_LINE_MEMBER(hh_tms1k_state::auto_power_off) INPUT_CHANGED_MEMBER(hh_tms1k_state::power_button) { - m_power_on = (bool)(FPTR)param; + m_power_on = (bool)(uintptr_t)param; m_maincpu->set_input_line(INPUT_LINE_RESET, m_power_on ? CLEAR_LINE : ASSERT_LINE); } @@ -6857,7 +6857,7 @@ INPUT_CHANGED_MEMBER(phpball_state::flipper_button) { // rectangular LEDs under LEDs D,F and E,G are directly connected // to the left and right flipper buttons - output them to lamp90 and 91 - output().set_lamp_value(90 + (int)(FPTR)param, newval); + output().set_lamp_value(90 + (int)(uintptr_t)param, newval); } diff --git a/src/mame/drivers/hp49gp.cpp b/src/mame/drivers/hp49gp.cpp index 4dbfe0bdb56..fcadcfa0f87 100644 --- a/src/mame/drivers/hp49gp.cpp +++ b/src/mame/drivers/hp49gp.cpp @@ -238,7 +238,7 @@ WRITE32_MEMBER(hp49gp_state::s3c2410_gpio_port_w) INPUT_CHANGED_MEMBER(hp49gp_state::port_changed) { - m_s3c2410->s3c2410_request_eint( (FPTR)param + 8); + m_s3c2410->s3c2410_request_eint( (uintptr_t)param + 8); } // ... diff --git a/src/mame/drivers/juicebox.cpp b/src/mame/drivers/juicebox.cpp index 12b7749f2d7..f24d24f85ff 100644 --- a/src/mame/drivers/juicebox.cpp +++ b/src/mame/drivers/juicebox.cpp @@ -243,7 +243,7 @@ WRITE32_MEMBER(juicebox_state::juicebox_nand_w) INPUT_CHANGED_MEMBER(juicebox_state::port_changed) { - m_s3c44b0->request_eint((FPTR)param); + m_s3c44b0->request_eint((uintptr_t)param); } // ... diff --git a/src/mame/drivers/megadriv.cpp b/src/mame/drivers/megadriv.cpp index c66df4adb8d..53bf399171f 100644 --- a/src/mame/drivers/megadriv.cpp +++ b/src/mame/drivers/megadriv.cpp @@ -266,7 +266,7 @@ MACHINE_START_MEMBER(md_cons_state, md_common) // setup timers for 6 button pads for (int i = 0; i < 3; i++) - m_io_timeout[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(md_base_state::io_timeout_timer_callback),this), (void*)(FPTR)i); + m_io_timeout[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(md_base_state::io_timeout_timer_callback),this), (void*)(uintptr_t)i); m_vdp->stop_timers(); diff --git a/src/mame/drivers/megadrvb.cpp b/src/mame/drivers/megadrvb.cpp index b2ed760453a..8f8a438f7f9 100644 --- a/src/mame/drivers/megadrvb.cpp +++ b/src/mame/drivers/megadrvb.cpp @@ -694,7 +694,7 @@ MACHINE_START_MEMBER(md_boot_state, md_6button) // setup timers for 6 button pads for (int i = 0; i < 3; i++) - m_io_timeout[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(md_base_state::io_timeout_timer_callback),this), (void*)(FPTR)i); + m_io_timeout[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(md_base_state::io_timeout_timer_callback),this), (void*)(uintptr_t)i); } static MACHINE_CONFIG_START( megadrvb_6b, md_boot_state ) diff --git a/src/mame/drivers/model2.cpp b/src/mame/drivers/model2.cpp index 5a653bfb399..749834b0879 100644 --- a/src/mame/drivers/model2.cpp +++ b/src/mame/drivers/model2.cpp @@ -352,7 +352,7 @@ WRITE32_MEMBER(model2_state::timers_w) TIMER_DEVICE_CALLBACK_MEMBER(model2_state::model2_timer_cb) { - int tnum = (int)(FPTR)ptr; + int tnum = (int)(uintptr_t)ptr; int bit = tnum + 2; if(m_timerrun[tnum] == 0) @@ -2354,13 +2354,13 @@ static MACHINE_CONFIG_START( model2o, model2_state ) MCFG_NVRAM_ADD_1FILL("backup2") MCFG_TIMER_DRIVER_ADD("timer0", model2_state, model2_timer_cb) - MCFG_TIMER_PTR((FPTR)0) + MCFG_TIMER_PTR((uintptr_t)0) MCFG_TIMER_DRIVER_ADD("timer1", model2_state, model2_timer_cb) - MCFG_TIMER_PTR((FPTR)1) + MCFG_TIMER_PTR((uintptr_t)1) MCFG_TIMER_DRIVER_ADD("timer2", model2_state, model2_timer_cb) - MCFG_TIMER_PTR((FPTR)2) + MCFG_TIMER_PTR((uintptr_t)2) MCFG_TIMER_DRIVER_ADD("timer3", model2_state, model2_timer_cb) - MCFG_TIMER_PTR((FPTR)3) + MCFG_TIMER_PTR((uintptr_t)3) MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff) MCFG_S24TILE_DEVICE_PALETTE("palette") @@ -2402,13 +2402,13 @@ static MACHINE_CONFIG_START( model2a, model2_state ) MCFG_NVRAM_ADD_1FILL("backup1") MCFG_TIMER_DRIVER_ADD("timer0", model2_state, model2_timer_cb) - MCFG_TIMER_PTR((FPTR)0) + MCFG_TIMER_PTR((uintptr_t)0) MCFG_TIMER_DRIVER_ADD("timer1", model2_state, model2_timer_cb) - MCFG_TIMER_PTR((FPTR)1) + MCFG_TIMER_PTR((uintptr_t)1) MCFG_TIMER_DRIVER_ADD("timer2", model2_state, model2_timer_cb) - MCFG_TIMER_PTR((FPTR)2) + MCFG_TIMER_PTR((uintptr_t)2) MCFG_TIMER_DRIVER_ADD("timer3", model2_state, model2_timer_cb) - MCFG_TIMER_PTR((FPTR)3) + MCFG_TIMER_PTR((uintptr_t)3) MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff) MCFG_S24TILE_DEVICE_PALETTE("palette") @@ -2519,13 +2519,13 @@ static MACHINE_CONFIG_START( model2b, model2_state ) MCFG_NVRAM_ADD_1FILL("backup1") MCFG_TIMER_DRIVER_ADD("timer0", model2_state, model2_timer_cb) - MCFG_TIMER_PTR((FPTR)0) + MCFG_TIMER_PTR((uintptr_t)0) MCFG_TIMER_DRIVER_ADD("timer1", model2_state, model2_timer_cb) - MCFG_TIMER_PTR((FPTR)1) + MCFG_TIMER_PTR((uintptr_t)1) MCFG_TIMER_DRIVER_ADD("timer2", model2_state, model2_timer_cb) - MCFG_TIMER_PTR((FPTR)2) + MCFG_TIMER_PTR((uintptr_t)2) MCFG_TIMER_DRIVER_ADD("timer3", model2_state, model2_timer_cb) - MCFG_TIMER_PTR((FPTR)3) + MCFG_TIMER_PTR((uintptr_t)3) MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff) MCFG_S24TILE_DEVICE_PALETTE("palette") @@ -2584,13 +2584,13 @@ static MACHINE_CONFIG_START( model2c, model2_state ) MCFG_NVRAM_ADD_1FILL("backup1") MCFG_TIMER_DRIVER_ADD("timer0", model2_state, model2_timer_cb) - MCFG_TIMER_PTR((FPTR)0) + MCFG_TIMER_PTR((uintptr_t)0) MCFG_TIMER_DRIVER_ADD("timer1", model2_state, model2_timer_cb) - MCFG_TIMER_PTR((FPTR)1) + MCFG_TIMER_PTR((uintptr_t)1) MCFG_TIMER_DRIVER_ADD("timer2", model2_state, model2_timer_cb) - MCFG_TIMER_PTR((FPTR)2) + MCFG_TIMER_PTR((uintptr_t)2) MCFG_TIMER_DRIVER_ADD("timer3", model2_state, model2_timer_cb) - MCFG_TIMER_PTR((FPTR)3) + MCFG_TIMER_PTR((uintptr_t)3) MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff) MCFG_S24TILE_DEVICE_PALETTE("palette") diff --git a/src/mame/drivers/namcos22.cpp b/src/mame/drivers/namcos22.cpp index c2e709fbb10..bd79f9fcb95 100644 --- a/src/mame/drivers/namcos22.cpp +++ b/src/mame/drivers/namcos22.cpp @@ -3310,7 +3310,7 @@ INPUT_PORTS_END CUSTOM_INPUT_MEMBER(namcos22_state::alpine_motor_read) { - return m_motor_status >> (FPTR)param & 1; + return m_motor_status >> (uintptr_t)param & 1; } static INPUT_PORTS_START( alpiner ) diff --git a/src/mame/drivers/palm.cpp b/src/mame/drivers/palm.cpp index ced463dbe00..eeff23b6fbe 100644 --- a/src/mame/drivers/palm.cpp +++ b/src/mame/drivers/palm.cpp @@ -77,7 +77,7 @@ INPUT_CHANGED_MEMBER(palm_state::pen_check) INPUT_CHANGED_MEMBER(palm_state::button_check) { UINT8 button_state = m_io_portd->read(); - m_lsi->set_port_d_lines(button_state, (int)(FPTR)param); + m_lsi->set_port_d_lines(button_state, (int)(uintptr_t)param); } WRITE8_MEMBER(palm_state::palm_port_f_out) diff --git a/src/mame/drivers/palmz22.cpp b/src/mame/drivers/palmz22.cpp index e89bbd5c85e..9d3af49b602 100644 --- a/src/mame/drivers/palmz22.cpp +++ b/src/mame/drivers/palmz22.cpp @@ -237,13 +237,13 @@ READ32_MEMBER(palmz22_state::s3c2410_adc_data_r ) INPUT_CHANGED_MEMBER(palmz22_state::palmz22_input_changed) { - if (((int)(FPTR)param) == 0) + if (((int)(uintptr_t)param) == 0) { m_s3c2410->s3c2410_touch_screen( (newval & 0x01) ? 1 : 0); } else { - m_s3c2410->s3c2410_request_eint( (FPTR)param - 1); + m_s3c2410->s3c2410_request_eint( (uintptr_t)param - 1); } } diff --git a/src/mame/drivers/pecom.cpp b/src/mame/drivers/pecom.cpp index 3a62a0fe84a..5a32fcf84e6 100644 --- a/src/mame/drivers/pecom.cpp +++ b/src/mame/drivers/pecom.cpp @@ -52,7 +52,7 @@ mappings, this is another situation where natural keyboard comes very handy! INPUT_CHANGED_MEMBER(pecom_state::ef_w) { - m_cdp1802->set_input_line((int)(FPTR)param, newval); + m_cdp1802->set_input_line((int)(uintptr_t)param, newval); } static INPUT_PORTS_START( pecom ) diff --git a/src/mame/drivers/peyper.cpp b/src/mame/drivers/peyper.cpp index 51d55034081..19b9e947b03 100644 --- a/src/mame/drivers/peyper.cpp +++ b/src/mame/drivers/peyper.cpp @@ -174,7 +174,7 @@ WRITE8_MEMBER(peyper_state::sol_w) CUSTOM_INPUT_MEMBER(peyper_state::wolfman_replay_hs_r) { - int bit_mask = (FPTR)param; + int bit_mask = (uintptr_t)param; switch (bit_mask) { diff --git a/src/mame/drivers/pntnpuzl.cpp b/src/mame/drivers/pntnpuzl.cpp index 397ffd87d55..9fed245dda1 100644 --- a/src/mame/drivers/pntnpuzl.cpp +++ b/src/mame/drivers/pntnpuzl.cpp @@ -312,7 +312,7 @@ INPUT_CHANGED_MEMBER(pntnpuzl_state::coin_inserted) { /* TODO: change this! */ if(newval) - generic_pulse_irq_line(*m_maincpu, (UINT8)(FPTR)param, 1); + generic_pulse_irq_line(*m_maincpu, (UINT8)(uintptr_t)param, 1); } static INPUT_PORTS_START( pntnpuzl ) diff --git a/src/mame/drivers/pong.cpp b/src/mame/drivers/pong.cpp index 3b0eb06ea82..aeaa7103462 100644 --- a/src/mame/drivers/pong.cpp +++ b/src/mame/drivers/pong.cpp @@ -255,7 +255,7 @@ NETLIST_END() INPUT_CHANGED_MEMBER(pong_state::input_changed) { - int numpad = (FPTR) (param); + int numpad = (uintptr_t) (param); switch (numpad) { diff --git a/src/mame/drivers/psikyo4.cpp b/src/mame/drivers/psikyo4.cpp index 1e598ba4afc..4b832442e0d 100644 --- a/src/mame/drivers/psikyo4.cpp +++ b/src/mame/drivers/psikyo4.cpp @@ -171,7 +171,7 @@ INTERRUPT_GEN_MEMBER(psikyo4_state::psikyosh_interrupt) CUSTOM_INPUT_MEMBER(psikyo4_state::mahjong_ctrl_r)/* used by hotgmck/hgkairak */ { - int player = (FPTR)param; + int player = (uintptr_t)param; int ret = 0xff; if (m_io_select & 1) ret &= m_keys[player+0]->read(); diff --git a/src/mame/drivers/px4.cpp b/src/mame/drivers/px4.cpp index 2d0f10e592d..9cca2aab819 100644 --- a/src/mame/drivers/px4.cpp +++ b/src/mame/drivers/px4.cpp @@ -1075,7 +1075,7 @@ INPUT_CHANGED_MEMBER( px4_state::key_callback ) if (delta & (1 << i)) { down = (newvalue & (1 << i)) ? 0x10 : 0x00; - scancode = (FPTR)param * 32 + i; + scancode = (uintptr_t)param * 32 + i; // control keys if ((scancode & 0xa0) == 0xa0) diff --git a/src/mame/drivers/qx10.cpp b/src/mame/drivers/qx10.cpp index 0ac10280aba..19851555a03 100644 --- a/src/mame/drivers/qx10.cpp +++ b/src/mame/drivers/qx10.cpp @@ -518,7 +518,7 @@ ADDRESS_MAP_END { if(newval && !oldval) { - m_keyb.rx = (UINT8)(FPTR)(param) & 0x7f; + m_keyb.rx = (UINT8)(uintptr_t)(param) & 0x7f; m_pic_m->ir4_w(1); } diff --git a/src/mame/drivers/scobra.cpp b/src/mame/drivers/scobra.cpp index 64d65fdd805..7adc4fb4f4c 100644 --- a/src/mame/drivers/scobra.cpp +++ b/src/mame/drivers/scobra.cpp @@ -324,7 +324,7 @@ ADDRESS_MAP_END /* stratgyx coinage DIPs are spread across two input ports */ CUSTOM_INPUT_MEMBER(scobra_state::stratgyx_coinage_r) { - int bit_mask = (FPTR)param; + int bit_mask = (uintptr_t)param; return (ioport("IN4")->read() & bit_mask) ? 0x01 : 0x00; } diff --git a/src/mame/drivers/scramble.cpp b/src/mame/drivers/scramble.cpp index 60dceb9b7ec..37da3330846 100644 --- a/src/mame/drivers/scramble.cpp +++ b/src/mame/drivers/scramble.cpp @@ -539,7 +539,7 @@ INPUT_PORTS_END /* ckongs coinage DIPs are spread across two input ports */ CUSTOM_INPUT_MEMBER(scramble_state::ckongs_coinage_r) { - int bit_mask = (FPTR)param; + int bit_mask = (uintptr_t)param; return (ioport("FAKE")->read() & bit_mask) ? 0x01 : 0x00; } diff --git a/src/mame/drivers/seibuspi.cpp b/src/mame/drivers/seibuspi.cpp index 4f29c2fda4c..2c13b3cd65e 100644 --- a/src/mame/drivers/seibuspi.cpp +++ b/src/mame/drivers/seibuspi.cpp @@ -1198,7 +1198,7 @@ CUSTOM_INPUT_MEMBER(seibuspi_state::ejanhs_encode) Start - 111 port A */ static const UINT8 encoding[] = { 6, 5, 4, 3, 2, 7 }; - ioport_value state = ~m_key[(FPTR)param]->read(); + ioport_value state = ~m_key[(uintptr_t)param]->read(); for (int bit = 0; bit < ARRAY_LENGTH(encoding); bit++) if (state & (1 << bit)) @@ -1349,16 +1349,16 @@ static INPUT_PORTS_START( spi_ejanhs ) PORT_INCLUDE( spi_mahjong_keyboard ) PORT_START("INPUTS") - PORT_BIT( 0x00000007, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (FPTR)3) - PORT_BIT( 0x00000038, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (FPTR)4) - PORT_BIT( 0x00000700, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (FPTR)2) - PORT_BIT( 0x00003800, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (FPTR)0) + PORT_BIT( 0x00000007, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (uintptr_t)3) + PORT_BIT( 0x00000038, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (uintptr_t)4) + PORT_BIT( 0x00000700, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (uintptr_t)2) + PORT_BIT( 0x00003800, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (uintptr_t)0) PORT_SPECIAL_ONOFF_DIPLOC( 0x00008000, 0x00000000, Flip_Screen, "SW1:1" ) PORT_BIT( 0xffff4000, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("SYSTEM") // These need a noncontiguous encoding, but are nonfunctional in any case - //PORT_BIT( 0x00000013, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (FPTR)1) + //PORT_BIT( 0x00000013, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (uintptr_t)1) PORT_SERVICE_NO_TOGGLE( 0x00000004, IP_ACTIVE_LOW ) PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x000000f3, IP_ACTIVE_LOW, IPT_UNKNOWN ) diff --git a/src/mame/drivers/snk.cpp b/src/mame/drivers/snk.cpp index 96d29d098f0..54de1dc057f 100644 --- a/src/mame/drivers/snk.cpp +++ b/src/mame/drivers/snk.cpp @@ -719,7 +719,7 @@ hand, always returning 0xf inbetween valid values confuses the game. CUSTOM_INPUT_MEMBER(snk_state::gwar_rotary) { static const char *const ports[] = { "P1ROT", "P2ROT" }; - int which = (int)(FPTR)param; + int which = (int)(uintptr_t)param; int value = ioport(ports[which])->read(); if ((m_last_value[which] == 0x5 && value == 0x6) || (m_last_value[which] == 0x6 && value == 0x5)) @@ -795,7 +795,7 @@ CUSTOM_INPUT_MEMBER(snk_state::countryc_trackball_y) CUSTOM_INPUT_MEMBER(snk_state::snk_bonus_r) { - int bit_mask = (FPTR)param; + int bit_mask = (uintptr_t)param; switch (bit_mask) { diff --git a/src/mame/drivers/socrates.cpp b/src/mame/drivers/socrates.cpp index 6b2535e6fd4..3f660d21dc4 100644 --- a/src/mame/drivers/socrates.cpp +++ b/src/mame/drivers/socrates.cpp @@ -947,7 +947,7 @@ WRITE8_MEMBER( iqunlim_state::colors_w ) INPUT_CHANGED_MEMBER( iqunlim_state::send_input ) { - UINT8 data = (UINT8)(FPTR)param; + UINT8 data = (UINT8)(uintptr_t)param; if (newval) { diff --git a/src/mame/drivers/sprint4.cpp b/src/mame/drivers/sprint4.cpp index 87a54f7daed..5b250ae5c65 100644 --- a/src/mame/drivers/sprint4.cpp +++ b/src/mame/drivers/sprint4.cpp @@ -21,7 +21,7 @@ Atari Sprint 4 driver CUSTOM_INPUT_MEMBER(sprint4_state::get_lever) { - int n = (FPTR) param; + int n = (uintptr_t) param; return 4 * m_gear[n] > m_da_latch; } @@ -29,7 +29,7 @@ CUSTOM_INPUT_MEMBER(sprint4_state::get_lever) CUSTOM_INPUT_MEMBER(sprint4_state::get_wheel) { - int n = (FPTR) param; + int n = (uintptr_t) param; return 8 * m_steer_FF1[n] + 8 * m_steer_FF2[n] > m_da_latch; } @@ -37,7 +37,7 @@ CUSTOM_INPUT_MEMBER(sprint4_state::get_wheel) CUSTOM_INPUT_MEMBER(sprint4_state::get_collision) { - int n = (FPTR) param; + int n = (uintptr_t) param; return m_collision[n]; } diff --git a/src/mame/drivers/ssem.cpp b/src/mame/drivers/ssem.cpp index b9b82319932..a36d8d09916 100644 --- a/src/mame/drivers/ssem.cpp +++ b/src/mame/drivers/ssem.cpp @@ -108,7 +108,7 @@ INPUT_CHANGED_MEMBER(ssem_state::panel_check) UINT8 edit3_state = ioport("EDIT3")->read(); UINT8 misc_state = ioport("MISC")->read(); - switch( (int)(FPTR)param ) + switch( (int)(uintptr_t)param ) { case PANEL_BIT0: if(edit0_state & 0x01) m_store[(m_store_line << 2) | 0] ^= 0x80; diff --git a/src/mame/drivers/taito_f3.cpp b/src/mame/drivers/taito_f3.cpp index 1df78f00958..72eec9fcdbd 100644 --- a/src/mame/drivers/taito_f3.cpp +++ b/src/mame/drivers/taito_f3.cpp @@ -45,7 +45,7 @@ CUSTOM_INPUT_MEMBER(taito_f3_state::f3_analog_r) { - int num = (FPTR)param; + int num = (uintptr_t)param; int data = m_dial[num]->read(); return ((data & 0xf)<<12) | ((data & 0xff0)>>4); } @@ -53,7 +53,7 @@ CUSTOM_INPUT_MEMBER(taito_f3_state::f3_analog_r) CUSTOM_INPUT_MEMBER(taito_f3_state::f3_coin_r) { - int num = (FPTR)param; + int num = (uintptr_t)param; return m_coin_word[num]; } diff --git a/src/mame/drivers/taitosj.cpp b/src/mame/drivers/taitosj.cpp index 73ec4835d65..75c0f6117e3 100644 --- a/src/mame/drivers/taitosj.cpp +++ b/src/mame/drivers/taitosj.cpp @@ -268,7 +268,7 @@ CUSTOM_INPUT_MEMBER(taitosj_state::kikstart_gear_r) { const char *port_tag; - int player = (int)(FPTR)param; + int player = (int)(uintptr_t)param; if (player == 0) port_tag = "GEARP1"; diff --git a/src/mame/drivers/tamag1.cpp b/src/mame/drivers/tamag1.cpp index 1275d33f0c7..36dd47e59e7 100644 --- a/src/mame/drivers/tamag1.cpp +++ b/src/mame/drivers/tamag1.cpp @@ -105,7 +105,7 @@ INPUT_CHANGED_MEMBER(tamag1_state::input_changed) { // inputs are hooked up backwards here, because MCU input // ports are all tied to its interrupt controller - int line = (int)(FPTR)param; + int line = (int)(uintptr_t)param; int state = newval ? ASSERT_LINE : CLEAR_LINE; m_maincpu->set_input_line(line, state); } diff --git a/src/mame/drivers/tispeak.cpp b/src/mame/drivers/tispeak.cpp index 92591ad9a72..dea10f66d29 100644 --- a/src/mame/drivers/tispeak.cpp +++ b/src/mame/drivers/tispeak.cpp @@ -725,7 +725,7 @@ READ8_MEMBER(tispeak_state::k28_read_k) INPUT_CHANGED_MEMBER(tispeak_state::power_button) { - int on = (int)(FPTR)param; + int on = (int)(uintptr_t)param; if (on && !m_power_on) { diff --git a/src/mame/drivers/tispellb.cpp b/src/mame/drivers/tispellb.cpp index 258ccc82a0e..4d1198f1d93 100644 --- a/src/mame/drivers/tispellb.cpp +++ b/src/mame/drivers/tispellb.cpp @@ -243,7 +243,7 @@ WRITE16_MEMBER(tispellb_state::rev2_write_r) INPUT_CHANGED_MEMBER(tispellb_state::power_button) { - int on = (int)(FPTR)param; + int on = (int)(uintptr_t)param; if (on && !m_power_on) { diff --git a/src/mame/drivers/turrett.cpp b/src/mame/drivers/turrett.cpp index 1dbb60575b4..fcb637a4525 100644 --- a/src/mame/drivers/turrett.cpp +++ b/src/mame/drivers/turrett.cpp @@ -254,7 +254,7 @@ UINT32 turrett_state::update_inputs(void) INPUT_CHANGED_MEMBER( turrett_state::ipt_change ) { - int p = (FPTR)param; + int p = (uintptr_t)param; if (newval != oldval) { diff --git a/src/mame/drivers/ultratnk.cpp b/src/mame/drivers/ultratnk.cpp index 50d0904e836..a3f05dcc257 100644 --- a/src/mame/drivers/ultratnk.cpp +++ b/src/mame/drivers/ultratnk.cpp @@ -22,7 +22,7 @@ Atari Ultra Tank driver CUSTOM_INPUT_MEMBER(ultratnk_state::get_collision) { - return m_collision[(FPTR) param]; + return m_collision[(uintptr_t) param]; } diff --git a/src/mame/drivers/vicdual.cpp b/src/mame/drivers/vicdual.cpp index 746ca1883ee..3547570b3bd 100644 --- a/src/mame/drivers/vicdual.cpp +++ b/src/mame/drivers/vicdual.cpp @@ -1299,10 +1299,10 @@ ADDRESS_MAP_END CUSTOM_INPUT_MEMBER(vicdual_state::fake_lives_r) { /* use the low byte for the bitmask */ - UINT8 bit_mask = ((FPTR)param) & 0xff; + UINT8 bit_mask = ((uintptr_t)param) & 0xff; /* and use d8 for the port */ - int port = ((FPTR)param) >> 8 & 1; + int port = ((uintptr_t)param) >> 8 & 1; return (m_fake_lives[port].read_safe(0) & bit_mask) ? 0 : 1; } @@ -2106,7 +2106,7 @@ WRITE8_MEMBER(vicdual_state::samurai_protection_w) CUSTOM_INPUT_MEMBER(vicdual_state::samurai_protection_r) { - int offset = (FPTR)param; + int offset = (uintptr_t)param; UINT32 answer = 0; if (m_samurai_protection_data == 0xab) @@ -2282,7 +2282,7 @@ INPUT_CHANGED_MEMBER(vicdual_state::nsub_coin_in) { if (newval) { - int which = (int)(FPTR)param; + int which = (int)(uintptr_t)param; int coinage = m_coinage->read(); switch (which) diff --git a/src/mame/drivers/wolfpack.cpp b/src/mame/drivers/wolfpack.cpp index 549628162ae..2f3eee098d8 100644 --- a/src/mame/drivers/wolfpack.cpp +++ b/src/mame/drivers/wolfpack.cpp @@ -48,7 +48,7 @@ void wolfpack_state::machine_reset() CUSTOM_INPUT_MEMBER(wolfpack_state::wolfpack_dial_r) { - int bit = (FPTR)param; + int bit = (uintptr_t)param; return ((ioport("DIAL")->read() + bit) / 2) & 0x01; } diff --git a/src/mame/drivers/x07.cpp b/src/mame/drivers/x07.cpp index cc56896b589..9181618dd37 100644 --- a/src/mame/drivers/x07.cpp +++ b/src/mame/drivers/x07.cpp @@ -916,7 +916,7 @@ inline UINT8 x07_state::get_char(UINT16 pos) INPUT_CHANGED_MEMBER( x07_state::kb_func_keys ) { UINT8 data = 0; - UINT8 idx = (UINT8)(FPTR)param; + UINT8 idx = (UINT8)(uintptr_t)param; if (m_kb_on && newval) { @@ -943,7 +943,7 @@ INPUT_CHANGED_MEMBER( x07_state::kb_keys ) UINT8 modifier; UINT8 a1 = ioport("A1")->read(); UINT8 bz = ioport("BZ")->read(); - UINT8 keycode = (UINT8)(FPTR)param; + UINT8 keycode = (UINT8)(uintptr_t)param; if (m_kb_on && !newval) { diff --git a/src/mame/drivers/xxmissio.cpp b/src/mame/drivers/xxmissio.cpp index b826848f1d5..b5ee061d7ad 100644 --- a/src/mame/drivers/xxmissio.cpp +++ b/src/mame/drivers/xxmissio.cpp @@ -23,7 +23,7 @@ WRITE8_MEMBER(xxmissio_state::bank_sel_w) CUSTOM_INPUT_MEMBER(xxmissio_state::status_r) { - int bit_mask = (FPTR)param; + int bit_mask = (uintptr_t)param; return (m_status & bit_mask) ? 1 : 0; } diff --git a/src/mame/drivers/z100.cpp b/src/mame/drivers/z100.cpp index f6cdba22820..e94fc57e98d 100644 --- a/src/mame/drivers/z100.cpp +++ b/src/mame/drivers/z100.cpp @@ -422,7 +422,7 @@ INPUT_CHANGED_MEMBER(z100_state::key_stroke) if(newval && !oldval) { /* TODO: table */ - m_keyb_press = (UINT8)(FPTR)(param) & 0xff; + m_keyb_press = (UINT8)(uintptr_t)(param) & 0xff; //pic8259_ir6_w(m_picm, 1); m_keyb_status = 1; } diff --git a/src/mame/drivers/zaxxon.cpp b/src/mame/drivers/zaxxon.cpp index bd861f66f6e..cfcf6844566 100644 --- a/src/mame/drivers/zaxxon.cpp +++ b/src/mame/drivers/zaxxon.cpp @@ -350,7 +350,7 @@ READ8_MEMBER(zaxxon_state::razmataz_counter_r) CUSTOM_INPUT_MEMBER(zaxxon_state::razmataz_dial_r) { - int num = (FPTR)param; + int num = (uintptr_t)param; int res; int delta = m_dials[num]->read(); @@ -399,14 +399,14 @@ INPUT_CHANGED_MEMBER(zaxxon_state::zaxxon_coin_inserted) { if (newval) { - m_coin_status[(int)(FPTR)param] = m_coin_enable[(int)(FPTR)param]; + m_coin_status[(int)(uintptr_t)param] = m_coin_enable[(int)(uintptr_t)param]; } } CUSTOM_INPUT_MEMBER(zaxxon_state::zaxxon_coin_r) { - return m_coin_status[(int)(FPTR)param]; + return m_coin_status[(int)(uintptr_t)param]; } diff --git a/src/mame/machine/amiga.cpp b/src/mame/machine/amiga.cpp index 3fab6018d37..8a8b111de72 100644 --- a/src/mame/machine/amiga.cpp +++ b/src/mame/machine/amiga.cpp @@ -396,7 +396,7 @@ UINT16 amiga_state::joy1dat_r() CUSTOM_INPUT_MEMBER( amiga_state::amiga_joystick_convert ) { - UINT8 bits = m_joy_ports[(int)(FPTR)param].read_safe(0xff); + UINT8 bits = m_joy_ports[(int)(uintptr_t)param].read_safe(0xff); int up = (bits >> 0) & 1; int down = (bits >> 1) & 1; diff --git a/src/mame/machine/dgn_beta.cpp b/src/mame/machine/dgn_beta.cpp index 44ce021c4d2..3ce329ca8fe 100644 --- a/src/mame/machine/dgn_beta.cpp +++ b/src/mame/machine/dgn_beta.cpp @@ -202,7 +202,7 @@ void dgn_beta_state::UpdateBanks(int first, int last) m_PageRegs[m_TaskReg][Page].memory=readbank; membank(page_num)->set_base(readbank); - LOG_BANK_UPDATE(("UpdateBanks:MapPage=$%02X readbank=$%X\n",MapPage,(int)(FPTR)readbank)); + LOG_BANK_UPDATE(("UpdateBanks:MapPage=$%02X readbank=$%X\n",MapPage,(int)(uintptr_t)readbank)); LOG_BANK_UPDATE(("PageRegsSet Task=%X Page=%x\n",m_TaskReg,Page)); //LOG_BANK_UPDATE(("%X)\n",membank(Page+1))); LOG_BANK_UPDATE(("memory_install_write8_handler CPU=0\n")); diff --git a/src/mame/machine/gaelco2.cpp b/src/mame/machine/gaelco2.cpp index 099520b2813..1b6700caf24 100644 --- a/src/mame/machine/gaelco2.cpp +++ b/src/mame/machine/gaelco2.cpp @@ -221,7 +221,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(bang_state::bang_irq) CUSTOM_INPUT_MEMBER(wrally2_state::wrally2_analog_bit_r) { - int which = (FPTR)param; + int which = (uintptr_t)param; return (m_analog_ports[which] >> 7) & 0x01; } diff --git a/src/mame/machine/galaxold.cpp b/src/mame/machine/galaxold.cpp index 1414e4c3cb2..0aa0eec1673 100644 --- a/src/mame/machine/galaxold.cpp +++ b/src/mame/machine/galaxold.cpp @@ -146,7 +146,7 @@ WRITE8_MEMBER(galaxold_state::_4in1_bank_w) CUSTOM_INPUT_MEMBER(galaxold_state::_4in1_fake_port_r) { static const char *const portnames[] = { "FAKE1", "FAKE2", "FAKE3", "FAKE4" }; - int bit_mask = (FPTR)param; + int bit_mask = (uintptr_t)param; return (ioport(portnames[m__4in1_bank])->read() & bit_mask) ? 0x01 : 0x00; } diff --git a/src/mame/machine/megadriv.cpp b/src/mame/machine/megadriv.cpp index 17a20fde8cc..25449375a16 100644 --- a/src/mame/machine/megadriv.cpp +++ b/src/mame/machine/megadriv.cpp @@ -93,7 +93,7 @@ WRITE8_MEMBER(md_base_state::megadriv_68k_YM2612_write) // this is used by 6 button pads and gets installed in machine_start for drivers requiring it TIMER_CALLBACK_MEMBER(md_base_state::io_timeout_timer_callback) { - m_io_stage[(int)(FPTR)ptr] = -1; + m_io_stage[(int)(uintptr_t)ptr] = -1; } diff --git a/src/mame/machine/nextkbd.cpp b/src/mame/machine/nextkbd.cpp index 7ff946b7916..0fc545050ca 100644 --- a/src/mame/machine/nextkbd.cpp +++ b/src/mame/machine/nextkbd.cpp @@ -246,7 +246,7 @@ WRITE32_MEMBER( nextkbd_device::kmdata_w ) INPUT_CHANGED_MEMBER( nextkbd_device::update ) { - int bank = (int)(FPTR)param; + int bank = (int)(uintptr_t)param; switch(bank) { case 0: case 1: case 2: { int index; diff --git a/src/mame/machine/pc9801_kbd.cpp b/src/mame/machine/pc9801_kbd.cpp index 3e4cd4373f8..520b73c31e4 100644 --- a/src/mame/machine/pc9801_kbd.cpp +++ b/src/mame/machine/pc9801_kbd.cpp @@ -47,10 +47,10 @@ pc9801_kbd_device::pc9801_kbd_device(const machine_config &mconfig, const char * INPUT_CHANGED_MEMBER(pc9801_kbd_device::key_stroke) { if(newval && !oldval) - m_rx_buf[(UINT8)(FPTR)(param) & 0x7f] = 1; + m_rx_buf[(UINT8)(uintptr_t)(param) & 0x7f] = 1; if(oldval && !newval) - m_rx_buf[(UINT8)(FPTR)(param) & 0x7f] = 2; + m_rx_buf[(UINT8)(uintptr_t)(param) & 0x7f] = 2; } static INPUT_PORTS_START( pc9801_kbd ) diff --git a/src/mame/video/rungun.cpp b/src/mame/video/rungun.cpp index 47de04f887b..514f52c1345 100644 --- a/src/mame/video/rungun.cpp +++ b/src/mame/video/rungun.cpp @@ -18,7 +18,7 @@ /* TTL text plane stuff */ TILE_GET_INFO_MEMBER(rungun_state::ttl_get_tile_info) { - UINT32 base_addr = (FPTR)tilemap.user_data(); + UINT32 base_addr = (uintptr_t)tilemap.user_data(); UINT8 *lvram = (UINT8 *)m_ttl_vram.get() + base_addr; int attr, code; @@ -58,7 +58,7 @@ WRITE16_MEMBER(rungun_state::rng_psac2_videoram_w) TILE_GET_INFO_MEMBER(rungun_state::get_rng_936_tile_info) { - UINT32 base_addr = (FPTR)tilemap.user_data(); + UINT32 base_addr = (uintptr_t)tilemap.user_data(); int tileno, colour, flipx; tileno = m_psac2_vram[tile_index * 2 + 1 + base_addr] & 0x3fff; @@ -102,11 +102,11 @@ void rungun_state::video_start() for(UINT32 screen_num = 0;screen_num < 2;screen_num++) { m_ttl_tilemap[screen_num] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(rungun_state::ttl_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_ttl_tilemap[screen_num]->set_user_data((void *)(FPTR)(screen_num * 0x2000)); + m_ttl_tilemap[screen_num]->set_user_data((void *)(uintptr_t)(screen_num * 0x2000)); m_ttl_tilemap[screen_num]->set_transparent_pen(0); m_936_tilemap[screen_num] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(rungun_state::get_rng_936_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 128, 128); - m_936_tilemap[screen_num]->set_user_data((void *)(FPTR)(screen_num * 0x80000)); + m_936_tilemap[screen_num]->set_user_data((void *)(uintptr_t)(screen_num * 0x80000)); m_936_tilemap[screen_num]->set_transparent_pen(0); } diff --git a/src/osd/modules/debugger/win/debugviewinfo.cpp b/src/osd/modules/debugger/win/debugviewinfo.cpp index be786b33fa2..122e5649858 100644 --- a/src/osd/modules/debugger/win/debugviewinfo.cpp +++ b/src/osd/modules/debugger/win/debugviewinfo.cpp @@ -773,7 +773,7 @@ LRESULT CALLBACK debugview_info::static_view_proc(HWND wnd, UINT message, WPARAM return 0; } - debugview_info *const info = (debugview_info *)(FPTR)GetWindowLongPtr(wnd, GWLP_USERDATA); + debugview_info *const info = (debugview_info *)(uintptr_t)GetWindowLongPtr(wnd, GWLP_USERDATA); if (info == nullptr) return DefWindowProc(wnd, message, wparam, lparam); diff --git a/src/osd/modules/debugger/win/debugwininfo.cpp b/src/osd/modules/debugger/win/debugwininfo.cpp index fda0a1144fc..3b2e9ed9689 100644 --- a/src/osd/modules/debugger/win/debugwininfo.cpp +++ b/src/osd/modules/debugger/win/debugwininfo.cpp @@ -563,7 +563,7 @@ LRESULT CALLBACK debugwin_info::static_window_proc(HWND wnd, UINT message, WPARA return 0; } - debugwin_info *const info = (debugwin_info *)(FPTR)GetWindowLongPtr(wnd, GWLP_USERDATA); + debugwin_info *const info = (debugwin_info *)(uintptr_t)GetWindowLongPtr(wnd, GWLP_USERDATA); if (info == nullptr) return DefWindowProc(wnd, message, wparam, lparam); diff --git a/src/osd/modules/debugger/win/editwininfo.cpp b/src/osd/modules/debugger/win/editwininfo.cpp index e7c3ba4f54d..6dc4954a796 100644 --- a/src/osd/modules/debugger/win/editwininfo.cpp +++ b/src/osd/modules/debugger/win/editwininfo.cpp @@ -35,7 +35,7 @@ editwin_info::editwin_info(debugger_windows_interface &debugger, bool is_main_co // create an edit box and override its key handling m_editwnd = CreateWindowEx(EDIT_BOX_STYLE_EX, TEXT("EDIT"), nullptr, EDIT_BOX_STYLE, 0, 0, 100, 100, window(), nullptr, GetModuleHandleUni(), nullptr); - m_original_editproc = (WNDPROC)(FPTR)GetWindowLongPtr(m_editwnd, GWLP_WNDPROC); + m_original_editproc = (WNDPROC)(uintptr_t)GetWindowLongPtr(m_editwnd, GWLP_WNDPROC); SetWindowLongPtr(m_editwnd, GWLP_USERDATA, (LONG_PTR)this); SetWindowLongPtr(m_editwnd, GWLP_WNDPROC, (LONG_PTR)&editwin_info::static_edit_proc); SendMessage(m_editwnd, WM_SETFONT, (WPARAM)metrics().debug_font(), (LPARAM)FALSE); @@ -226,7 +226,7 @@ LRESULT editwin_info::edit_proc(UINT message, WPARAM wparam, LPARAM lparam) LRESULT CALLBACK editwin_info::static_edit_proc(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam) { - editwin_info *const info = (editwin_info *)(FPTR)GetWindowLongPtr(wnd, GWLP_USERDATA); + editwin_info *const info = (editwin_info *)(uintptr_t)GetWindowLongPtr(wnd, GWLP_USERDATA); assert(info->m_editwnd == wnd); return info->edit_proc(message, wparam, lparam); } diff --git a/src/osd/modules/diagnostics/diagnostics_win32.cpp b/src/osd/modules/diagnostics/diagnostics_win32.cpp index cdacba72ceb..aa74e60adc4 100644 --- a/src/osd/modules/diagnostics/diagnostics_win32.cpp +++ b/src/osd/modules/diagnostics/diagnostics_win32.cpp @@ -46,9 +46,9 @@ class stack_walker public: stack_walker(); - FPTR ip() const { return m_stackframe.AddrPC.Offset; } - FPTR sp() const { return m_stackframe.AddrStack.Offset; } - FPTR frame() const { return m_stackframe.AddrFrame.Offset; } + uintptr_t ip() const { return m_stackframe.AddrPC.Offset; } + uintptr_t sp() const { return m_stackframe.AddrStack.Offset; } + uintptr_t frame() const { return m_stackframe.AddrFrame.Offset; } bool reset(); void reset(CONTEXT &context, HANDLE thread); @@ -82,11 +82,11 @@ public: ~symbol_manager(); // getters - FPTR last_base() const { return m_last_base; } + uintptr_t last_base() const { return m_last_base; } // core symbol lookup - const char *symbol_for_address(FPTR address); - const char *symbol_for_address(PVOID address) { return symbol_for_address(reinterpret_cast<FPTR>(address)); } + const char *symbol_for_address(uintptr_t address); + const char *symbol_for_address(PVOID address) { return symbol_for_address(reinterpret_cast<uintptr_t>(address)); } // force symbols to be cached void cache_symbols() { scan_file_for_address(0, true); } @@ -94,21 +94,21 @@ public: void reset_cache() { m_cache.clear(); } private: // internal helpers - bool query_system_for_address(FPTR address); - void scan_file_for_address(FPTR address, bool create_cache); - bool parse_sym_line(const char *line, FPTR &address, std::string &symbol); - bool parse_map_line(const char *line, FPTR &address, std::string &symbol); - void scan_cache_for_address(FPTR address); + bool query_system_for_address(uintptr_t address); + void scan_file_for_address(uintptr_t address, bool create_cache); + bool parse_sym_line(const char *line, uintptr_t &address, std::string &symbol); + bool parse_map_line(const char *line, uintptr_t &address, std::string &symbol); + void scan_cache_for_address(uintptr_t address); void format_symbol(const char *name, UINT32 displacement, const char *filename = nullptr, int linenumber = 0); - static FPTR get_text_section_base(); + static uintptr_t get_text_section_base(); struct cache_entry { - cache_entry(FPTR address, const char *symbol) : + cache_entry(uintptr_t address, const char *symbol) : m_address(address), m_name(symbol) { } - FPTR m_address; + uintptr_t m_address; std::string m_name; }; std::vector<std::unique_ptr<cache_entry>> m_cache; @@ -117,8 +117,8 @@ private: std::string m_symfile; std::string m_buffer; HANDLE m_process; - FPTR m_last_base; - FPTR m_text_base; + uintptr_t m_last_base; + uintptr_t m_text_base; osd::dynamic_module::ptr m_dbghelp_dll; @@ -153,9 +153,9 @@ private: UINT8 m_stack_depth; UINT8 m_entry_stride; - std::vector<FPTR> m_buffer; - FPTR * m_buffer_ptr; - FPTR * m_buffer_end; + std::vector<uintptr_t> m_buffer; + uintptr_t * m_buffer_ptr; + uintptr_t * m_buffer_end; }; @@ -338,7 +338,7 @@ symbol_manager::~symbol_manager() // file //------------------------------------------------- -const char *symbol_manager::symbol_for_address(FPTR address) +const char *symbol_manager::symbol_for_address(uintptr_t address) { // default the buffer m_buffer.assign(" (not found)"); @@ -364,7 +364,7 @@ const char *symbol_manager::symbol_for_address(FPTR address) // look up our address //------------------------------------------------- -bool symbol_manager::query_system_for_address(FPTR address) +bool symbol_manager::query_system_for_address(uintptr_t address) { // need at least the sym_from_addr API if (!m_sym_from_addr) @@ -402,7 +402,7 @@ bool symbol_manager::query_system_for_address(FPTR address) // along the way //------------------------------------------------- -void symbol_manager::scan_file_for_address(FPTR address, bool create_cache) +void symbol_manager::scan_file_for_address(uintptr_t address, bool create_cache) { bool is_symfile = false; FILE *srcfile = nullptr; @@ -423,7 +423,7 @@ void symbol_manager::scan_file_for_address(FPTR address, bool create_cache) // reset the best info std::string best_symbol; - FPTR best_addr = 0; + uintptr_t best_addr = 0; // parse the file, looking for valid entries std::string symbol; @@ -431,7 +431,7 @@ void symbol_manager::scan_file_for_address(FPTR address, bool create_cache) while (fgets(line, sizeof(line) - 1, srcfile)) { // parse the line looking for an interesting symbol - FPTR addr = 0; + uintptr_t addr = 0; bool valid = is_symfile ? parse_sym_line(line, addr, symbol) : parse_map_line(line, addr, symbol); // if we got one, see if this is the best @@ -464,11 +464,11 @@ void symbol_manager::scan_file_for_address(FPTR address, bool create_cache) // find the best match for the given address //------------------------------------------------- -void symbol_manager::scan_cache_for_address(FPTR address) +void symbol_manager::scan_cache_for_address(uintptr_t address) { // reset the best info std::string best_symbol; - FPTR best_addr = 0; + uintptr_t best_addr = 0; // walk the cache, looking for valid entries for (auto &entry : m_cache) @@ -491,7 +491,7 @@ void symbol_manager::scan_cache_for_address(FPTR address) // which is just the output of objdump //------------------------------------------------- -bool symbol_manager::parse_sym_line(const char *line, FPTR &address, std::string &symbol) +bool symbol_manager::parse_sym_line(const char *line, uintptr_t &address, std::string &symbol) { #ifdef __GNUC__ /* @@ -524,7 +524,7 @@ bool symbol_manager::parse_sym_line(const char *line, FPTR &address, std::string void *temp; if (sscanf(chptr, "0x%p", &temp) != 1) return false; - address = m_text_base + reinterpret_cast<FPTR>(temp); + address = m_text_base + reinterpret_cast<uintptr_t>(temp); // skip forward until we're past the space while (*chptr != 0 && !isspace(*chptr)) @@ -545,7 +545,7 @@ bool symbol_manager::parse_sym_line(const char *line, FPTR &address, std::string // generated map file //------------------------------------------------- -bool symbol_manager::parse_map_line(const char *line, FPTR &address, std::string &symbol) +bool symbol_manager::parse_map_line(const char *line, uintptr_t &address, std::string &symbol) { #ifdef __GNUC__ /* @@ -563,7 +563,7 @@ bool symbol_manager::parse_map_line(const char *line, FPTR &address, std::string void *temp; if (sscanf(&line[16], "0x%p", &temp) != 1) return false; - address = reinterpret_cast<FPTR>(temp); + address = reinterpret_cast<uintptr_t>(temp); // skip forward until we're past the space const char *chptr = &line[16]; @@ -604,7 +604,7 @@ void symbol_manager::format_symbol(const char *name, UINT32 displacement, const // of the .text section //------------------------------------------------- -FPTR symbol_manager::get_text_section_base() +uintptr_t symbol_manager::get_text_section_base() { osd::dynamic_module::ptr m_dbghelp_dll = osd::dynamic_module::open({ "dbghelp.dll" }); @@ -623,13 +623,13 @@ FPTR symbol_manager::get_text_section_base() assert(headers != nullptr); // look ourself up (assuming we are in the .text section) - PIMAGE_SECTION_HEADER section = (*image_rva_to_section)(headers, base, reinterpret_cast<FPTR>(get_text_section_base) - reinterpret_cast<FPTR>(base)); + PIMAGE_SECTION_HEADER section = (*image_rva_to_section)(headers, base, reinterpret_cast<uintptr_t>(get_text_section_base) - reinterpret_cast<uintptr_t>(base)); if (section != nullptr) - return reinterpret_cast<FPTR>(base) + section->VirtualAddress; + return reinterpret_cast<uintptr_t>(base) + section->VirtualAddress; } // fallback to returning the image base (wrong) - return reinterpret_cast<FPTR>(base); + return reinterpret_cast<uintptr_t>(base); } @@ -710,8 +710,8 @@ void sampling_profiler::stop() int CLIB_DECL sampling_profiler::compare_address(const void *item1, const void *item2) { - const FPTR *entry1 = reinterpret_cast<const FPTR *>(item1); - const FPTR *entry2 = reinterpret_cast<const FPTR *>(item2); + const uintptr_t *entry1 = reinterpret_cast<const uintptr_t *>(item1); + const uintptr_t *entry2 = reinterpret_cast<const uintptr_t *>(item2); int mincount = std::min(entry1[0], entry2[0]); // sort in order of: bucket, caller, caller's caller, etc. @@ -731,8 +731,8 @@ int CLIB_DECL sampling_profiler::compare_address(const void *item1, const void * int CLIB_DECL sampling_profiler::compare_frequency(const void *item1, const void *item2) { - const FPTR *entry1 = reinterpret_cast<const FPTR *>(item1); - const FPTR *entry2 = reinterpret_cast<const FPTR *>(item2); + const uintptr_t *entry1 = reinterpret_cast<const uintptr_t *>(item1); + const uintptr_t *entry2 = reinterpret_cast<const uintptr_t *>(item2); // sort by frequency, then by address if (entry1[0] != entry2[0]) @@ -751,7 +751,7 @@ void sampling_profiler::print_results(symbol_manager &symbols) symbols.cache_symbols(); // step 1: find the base of each entry - for (FPTR *current = &m_buffer[0]; current < m_buffer_ptr; current += m_entry_stride) + for (uintptr_t *current = &m_buffer[0]; current < m_buffer_ptr; current += m_entry_stride) { assert(current[0] >= 1 && current[0] < m_entry_stride); @@ -761,14 +761,14 @@ void sampling_profiler::print_results(symbol_manager &symbols) } // step 2: sort the results - qsort(&m_buffer[0], (m_buffer_ptr - &m_buffer[0]) / m_entry_stride, m_entry_stride * sizeof(FPTR), compare_address); + qsort(&m_buffer[0], (m_buffer_ptr - &m_buffer[0]) / m_entry_stride, m_entry_stride * sizeof(uintptr_t), compare_address); // step 3: count and collapse unique entries UINT32 total_count = 0; - for (FPTR *current = &m_buffer[0]; current < m_buffer_ptr; ) + for (uintptr_t *current = &m_buffer[0]; current < m_buffer_ptr; ) { int count = 1; - FPTR *scan; + uintptr_t *scan; for (scan = current + m_entry_stride; scan < m_buffer_ptr; scan += m_entry_stride) { if (compare_address(current, scan) != 0) @@ -782,11 +782,11 @@ void sampling_profiler::print_results(symbol_manager &symbols) } // step 4: sort the results again, this time by frequency - qsort(&m_buffer[0], (m_buffer_ptr - &m_buffer[0]) / m_entry_stride, m_entry_stride * sizeof(FPTR), compare_frequency); + qsort(&m_buffer[0], (m_buffer_ptr - &m_buffer[0]) / m_entry_stride, m_entry_stride * sizeof(uintptr_t), compare_frequency); // step 5: print the results UINT32 num_printed = 0; - for (FPTR *current = &m_buffer[0]; current < m_buffer_ptr && num_printed < 30; current += m_entry_stride) + for (uintptr_t *current = &m_buffer[0]; current < m_buffer_ptr && num_printed < 30; current += m_entry_stride) { // once we hit 0 frequency, we're done if (current[0] == 0) @@ -837,7 +837,7 @@ void sampling_profiler::thread_run() GetThreadContext(m_target_thread, &context); // first entry is a count - FPTR *count = m_buffer_ptr++; + uintptr_t *count = m_buffer_ptr++; *count = 0; // iterate over the frames until we run out or hit an error @@ -972,7 +972,7 @@ private: auto diagnostics = downcast<diagnostics_win32 *>(get_instance()); fprintf(stderr, "Exception at EIP=%p%s: %s\n", info->ExceptionRecord->ExceptionAddress, - diagnostics->m_symbols->symbol_for_address((FPTR)info->ExceptionRecord->ExceptionAddress), exception_table[i].string); + diagnostics->m_symbols->symbol_for_address((uintptr_t)info->ExceptionRecord->ExceptionAddress), exception_table[i].string); // for access violations, print more info if (info->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) diff --git a/src/osd/modules/file/posixfile.cpp b/src/osd/modules/file/posixfile.cpp index 09ed0ac7984..940acef38d5 100644 --- a/src/osd/modules/file/posixfile.cpp +++ b/src/osd/modules/file/posixfile.cpp @@ -474,7 +474,7 @@ const char *osd_get_volume_name(int idx) // osd_is_valid_filename_char //============================================================ -bool osd_is_valid_filename_char(unicode_char uchar) +bool osd_is_valid_filename_char(char32_t uchar) { // The only one that's actually invalid is the slash // The other two are just problematic because they're the escape character and path separator @@ -494,7 +494,7 @@ bool osd_is_valid_filename_char(unicode_char uchar) // osd_is_valid_filepath_char //============================================================ -bool osd_is_valid_filepath_char(unicode_char uchar) +bool osd_is_valid_filepath_char(char32_t uchar) { // One could argue that colon should be in here too because it functions as path separator return uchar >= 0x20 diff --git a/src/osd/modules/file/stdfile.cpp b/src/osd/modules/file/stdfile.cpp index 92920bba495..74cd6abc0c3 100644 --- a/src/osd/modules/file/stdfile.cpp +++ b/src/osd/modules/file/stdfile.cpp @@ -179,7 +179,7 @@ int osd_get_physical_drive_geometry(const char *filename, UINT32 *cylinders, UIN // osd_uchar_from_osdchar //============================================================ -int osd_uchar_from_osdchar(UINT32 /* unicode_char */ *uchar, const char *osdchar, size_t count) +int osd_uchar_from_osdchar(char32_t *uchar, const char *osdchar, size_t count) { // we assume a standard 1:1 mapping of characters to the first 256 unicode characters *uchar = (UINT8)*osdchar; diff --git a/src/osd/modules/file/winfile.cpp b/src/osd/modules/file/winfile.cpp index 656ce36eadc..3d61374e8c8 100644 --- a/src/osd/modules/file/winfile.cpp +++ b/src/osd/modules/file/winfile.cpp @@ -434,7 +434,7 @@ const char *osd_get_volume_name(int idx) // osd_is_valid_filename_char //============================================================ -bool osd_is_valid_filename_char(unicode_char uchar) +bool osd_is_valid_filename_char(char32_t uchar) { return osd_is_valid_filepath_char(uchar) && uchar != '/' @@ -448,7 +448,7 @@ bool osd_is_valid_filename_char(unicode_char uchar) // osd_is_valid_filepath_char //============================================================ -bool osd_is_valid_filepath_char(unicode_char uchar) +bool osd_is_valid_filepath_char(char32_t uchar) { return uchar >= 0x20 && uchar != '<' diff --git a/src/osd/modules/font/font_dwrite.cpp b/src/osd/modules/font/font_dwrite.cpp index af9f83bdf89..643c1f9b522 100644 --- a/src/osd/modules/font/font_dwrite.cpp +++ b/src/osd/modules/font/font_dwrite.cpp @@ -400,7 +400,7 @@ public: // pixel of a black & white font //------------------------------------------------- - virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs) override + virtual bool get_bitmap(char32_t chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs) override { const int MEM_ALIGN_CONST = 31; const int BITMAP_PAD = 50; diff --git a/src/osd/modules/font/font_none.cpp b/src/osd/modules/font/font_none.cpp index 2716b52cf8e..dc6116625a8 100644 --- a/src/osd/modules/font/font_none.cpp +++ b/src/osd/modules/font/font_none.cpp @@ -15,7 +15,7 @@ public: virtual bool open(std::string const &font_path, std::string const &name, int &height) override { return false; } virtual void close() override { } - virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs) override { return false; } + virtual bool get_bitmap(char32_t chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs) override { return false; } }; class font_none : public osd_module, public font_module diff --git a/src/osd/modules/font/font_osx.cpp b/src/osd/modules/font/font_osx.cpp index 22662d3b8d3..e0ec07be502 100644 --- a/src/osd/modules/font/font_osx.cpp +++ b/src/osd/modules/font/font_osx.cpp @@ -30,7 +30,7 @@ public: virtual bool open(std::string const &font_path, std::string const &name, int &height); virtual void close(); - virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs); + virtual bool get_bitmap(char32_t chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs); osd_font_osx &operator=(osd_font_osx &&obj) { @@ -122,7 +122,7 @@ void osd_font_osx::close() // pixel of a black & white font //------------------------------------------------- -bool osd_font_osx::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs) +bool osd_font_osx::get_bitmap(char32_t chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs) { UniChar uni_char; CGGlyph glyph; diff --git a/src/osd/modules/font/font_sdl.cpp b/src/osd/modules/font/font_sdl.cpp index 629bc9046a8..668fd2d5778 100644 --- a/src/osd/modules/font/font_sdl.cpp +++ b/src/osd/modules/font/font_sdl.cpp @@ -39,7 +39,7 @@ public: virtual bool open(std::string const &font_path, std::string const &name, int &height); virtual void close(); - virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs); + virtual bool get_bitmap(char32_t chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs); osd_font_sdl & operator=(osd_font_sdl &&obj) { @@ -158,7 +158,7 @@ void osd_font_sdl::close() // pixel of a black & white font //------------------------------------------------- -bool osd_font_sdl::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs) +bool osd_font_sdl::get_bitmap(char32_t chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs) { SDL_Color const fcol = { 0xff, 0xff, 0xff }; char ustr[16]; diff --git a/src/osd/modules/font/font_windows.cpp b/src/osd/modules/font/font_windows.cpp index 9fd326f8c57..e6de2ef693d 100644 --- a/src/osd/modules/font/font_windows.cpp +++ b/src/osd/modules/font/font_windows.cpp @@ -38,7 +38,7 @@ public: virtual bool open(std::string const &font_path, std::string const &name, int &height) override; virtual void close() override; - virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs) override; + virtual bool get_bitmap(char32_t chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs) override; osd_font_windows &operator=(osd_font_windows &&obj) { @@ -144,7 +144,7 @@ void osd_font_windows::close() // pixel of a black & white font //------------------------------------------------- -bool osd_font_windows::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) +bool osd_font_windows::get_bitmap(char32_t chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) { // create a dummy DC to work with HDC dummyDC = CreateCompatibleDC(nullptr); @@ -200,7 +200,7 @@ bool osd_font_windows::get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT memset(bits, 0, rowbytes * bmheight); // now draw the character - utf16_char tempchar[UTF16_CHAR_MAX]; + char16_t tempchar[UTF16_CHAR_MAX]; UINT const count = INT(utf16_from_uchar(tempchar, ARRAY_LENGTH(tempchar), chnum)); SetTextColor(dummyDC, RGB(0xff, 0xff, 0xff)); SetBkColor(dummyDC, RGB(0x00, 0x00, 0x00)); diff --git a/src/osd/modules/input/input_dinput.cpp b/src/osd/modules/input/input_dinput.cpp index c4a62cd0d2f..694bf80b984 100644 --- a/src/osd/modules/input/input_dinput.cpp +++ b/src/osd/modules/input/input_dinput.cpp @@ -406,7 +406,7 @@ public: // populate the buttons for (butnum = 0; butnum < devinfo->dinput.caps.dwButtons; butnum++) { - FPTR offset = reinterpret_cast<FPTR>(&static_cast<DIMOUSESTATE *>(nullptr)->rgbButtons[butnum]); + uintptr_t offset = reinterpret_cast<uintptr_t>(&static_cast<DIMOUSESTATE *>(nullptr)->rgbButtons[butnum]); // add to the mouse device std::string name = device_item_name(devinfo, offset, default_button_name(butnum), nullptr); @@ -520,25 +520,25 @@ int dinput_joystick_device::configure() // left name = dinput_module::device_item_name(this, offsetof(DIJOYSTATE2, rgdwPOV) + povnum * sizeof(DWORD), default_pov_name(povnum), TEXT("L")); - device()->add_item(name.c_str(), ITEM_ID_OTHER_SWITCH, dinput_joystick_pov_get_state, reinterpret_cast<void *>(static_cast<FPTR>(povnum * 4 + POVDIR_LEFT))); + device()->add_item(name.c_str(), ITEM_ID_OTHER_SWITCH, dinput_joystick_pov_get_state, reinterpret_cast<void *>(static_cast<uintptr_t>(povnum * 4 + POVDIR_LEFT))); // right name = dinput_module::device_item_name(this, offsetof(DIJOYSTATE2, rgdwPOV) + povnum * sizeof(DWORD), default_pov_name(povnum), TEXT("R")); - device()->add_item(name.c_str(), ITEM_ID_OTHER_SWITCH, dinput_joystick_pov_get_state, reinterpret_cast<void *>(static_cast<FPTR>(povnum * 4 + POVDIR_RIGHT))); + device()->add_item(name.c_str(), ITEM_ID_OTHER_SWITCH, dinput_joystick_pov_get_state, reinterpret_cast<void *>(static_cast<uintptr_t>(povnum * 4 + POVDIR_RIGHT))); // up name = dinput_module::device_item_name(this, offsetof(DIJOYSTATE2, rgdwPOV) + povnum * sizeof(DWORD), default_pov_name(povnum), TEXT("U")); - device()->add_item(name.c_str(), ITEM_ID_OTHER_SWITCH, dinput_joystick_pov_get_state, reinterpret_cast<void *>(static_cast<FPTR>(povnum * 4 + POVDIR_UP))); + device()->add_item(name.c_str(), ITEM_ID_OTHER_SWITCH, dinput_joystick_pov_get_state, reinterpret_cast<void *>(static_cast<uintptr_t>(povnum * 4 + POVDIR_UP))); // down name = dinput_module::device_item_name(this, offsetof(DIJOYSTATE2, rgdwPOV) + povnum * sizeof(DWORD), default_pov_name(povnum), TEXT("D")); - device()->add_item(name.c_str(), ITEM_ID_OTHER_SWITCH, dinput_joystick_pov_get_state, reinterpret_cast<void *>(static_cast<FPTR>(povnum * 4 + POVDIR_DOWN))); + device()->add_item(name.c_str(), ITEM_ID_OTHER_SWITCH, dinput_joystick_pov_get_state, reinterpret_cast<void *>(static_cast<uintptr_t>(povnum * 4 + POVDIR_DOWN))); } // populate the buttons for (UINT32 butnum = 0; butnum < dinput.caps.dwButtons; butnum++) { - FPTR offset = reinterpret_cast<FPTR>(&static_cast<DIJOYSTATE2 *>(nullptr)->rgbButtons[butnum]); + uintptr_t offset = reinterpret_cast<uintptr_t>(&static_cast<DIJOYSTATE2 *>(nullptr)->rgbButtons[butnum]); std::string name = dinput_module::device_item_name(this, offset, default_button_name(butnum), nullptr); input_item_id itemid; @@ -606,8 +606,8 @@ public: static INT32 dinput_joystick_pov_get_state(void *device_internal, void *item_internal) { dinput_joystick_device *devinfo = static_cast<dinput_joystick_device *>(device_internal); - int povnum = reinterpret_cast<FPTR>(item_internal) / 4; - int povdir = reinterpret_cast<FPTR>(item_internal) % 4; + int povnum = reinterpret_cast<uintptr_t>(item_internal) / 4; + int povdir = reinterpret_cast<uintptr_t>(item_internal) % 4; INT32 result = 0; DWORD pov; diff --git a/src/osd/modules/input/input_sdl.cpp b/src/osd/modules/input/input_sdl.cpp index 9a8180b7088..d42e17274eb 100644 --- a/src/osd/modules/input/input_sdl.cpp +++ b/src/osd/modules/input/input_sdl.cpp @@ -163,7 +163,7 @@ public: auto len = std::strlen(sdlevent.text.text); while (len) { - unicode_char ch; + char32_t ch; auto chlen = uchar_from_utf8(&ch, ptr, len); if (0 > chlen) { diff --git a/src/osd/modules/lib/osdlib_win32.cpp b/src/osd/modules/lib/osdlib_win32.cpp index 503aaec9b7a..89e0cacf37d 100644 --- a/src/osd/modules/lib/osdlib_win32.cpp +++ b/src/osd/modules/lib/osdlib_win32.cpp @@ -123,7 +123,7 @@ void *osd_malloc(size_t size) UINT8 *const block = reinterpret_cast<UINT8 *>(HeapAlloc(GetProcessHeap(), 0, size)); if (block == nullptr) return nullptr; - UINT8 *const result = reinterpret_cast<UINT8 *>(reinterpret_cast<FPTR>(block + sizeof(size_t) + MAX_ALIGNMENT) & ~(FPTR(MAX_ALIGNMENT) - 1)); + UINT8 *const result = reinterpret_cast<UINT8 *>(reinterpret_cast<uintptr_t>(block + sizeof(size_t) + MAX_ALIGNMENT) & ~(uintptr_t(MAX_ALIGNMENT) - 1)); // store the size and return and pointer to the data afterward *reinterpret_cast<size_t *>(block) = size; @@ -161,7 +161,7 @@ void *osd_malloc_array(size_t size) // work backwards from the page base to get to the block base UINT8 *const block = GUARD_ALIGN_START ? reinterpret_cast<UINT8 *>(page_base) : (reinterpret_cast<UINT8 *>(page_base) + rounded_size - size); - UINT8 *const result = reinterpret_cast<UINT8 *>(reinterpret_cast<FPTR>(block + sizeof(size_t) + MAX_ALIGNMENT) & ~(FPTR(MAX_ALIGNMENT) - 1)); + UINT8 *const result = reinterpret_cast<UINT8 *>(reinterpret_cast<uintptr_t>(block + sizeof(size_t) + MAX_ALIGNMENT) & ~(uintptr_t(MAX_ALIGNMENT) - 1)); // store the size at the start with a flag indicating it has a guard page *reinterpret_cast<size_t *>(block) = size | 1; diff --git a/src/osd/modules/opengl/gl_shader_tool.cpp b/src/osd/modules/opengl/gl_shader_tool.cpp index 5ee07661aa9..33cbac2d129 100644 --- a/src/osd/modules/opengl/gl_shader_tool.cpp +++ b/src/osd/modules/opengl/gl_shader_tool.cpp @@ -152,57 +152,57 @@ int gl_shader_check_error(GLhandleARB obj, GLenum obj_query, GLSLCheckMode m, co if( param!=GL_PROGRAM_OBJECT_ARB && param!=GL_SHADER_OBJECT_ARB ) { if ( CHECK_VERBOSE <= m ) - osd_printf_warning("%s:%d: GL Error: object type 0x%X generation failed\n", file, line, (unsigned int)(FPTR)obj); + osd_printf_warning("%s:%d: GL Error: object type 0x%X generation failed\n", file, line, (unsigned int)(uintptr_t)obj); res=-1; } else if ( CHECK_ALWAYS_VERBOSE <= m ) { if(param==GL_PROGRAM_OBJECT_ARB) - osd_printf_warning("%s:%d: GL Error: object type 0x%X is PROGRAM, successful\n", file, line, (unsigned int)(FPTR)obj); + osd_printf_warning("%s:%d: GL Error: object type 0x%X is PROGRAM, successful\n", file, line, (unsigned int)(uintptr_t)obj); else - osd_printf_warning("%s:%d: GL Info: object type 0x%X is SHADER, successful\n", file, line, (unsigned int)(FPTR)obj); + osd_printf_warning("%s:%d: GL Info: object type 0x%X is SHADER, successful\n", file, line, (unsigned int)(uintptr_t)obj); } break; case GL_OBJECT_DELETE_STATUS_ARB: if(param!=1) { if ( CHECK_ALWAYS_VERBOSE <= m ) - osd_printf_warning("%s:%d: GL Info: object 0x%X not yet marked for deletion\n", file, line, (unsigned int)(FPTR)obj); + osd_printf_warning("%s:%d: GL Info: object 0x%X not yet marked for deletion\n", file, line, (unsigned int)(uintptr_t)obj); } else if ( CHECK_ALWAYS_VERBOSE <= m ) { - osd_printf_warning("%s:%d: GL Info: object 0x%X deletion successful\n", file, line, (unsigned int)(FPTR)obj); + osd_printf_warning("%s:%d: GL Info: object 0x%X deletion successful\n", file, line, (unsigned int)(uintptr_t)obj); } break; case GL_OBJECT_COMPILE_STATUS_ARB: if(param!=1) { if ( CHECK_VERBOSE <= m ) - osd_printf_warning("%s:%d: GL Error: object 0x%X compilation failed\n", file, line, (unsigned int)(FPTR)obj); + osd_printf_warning("%s:%d: GL Error: object 0x%X compilation failed\n", file, line, (unsigned int)(uintptr_t)obj); res=-1; } else if ( CHECK_ALWAYS_VERBOSE <= m ) { - osd_printf_warning("%s:%d: GL Info: object 0x%X compiled successful\n", file, line, (unsigned int)(FPTR)obj); + osd_printf_warning("%s:%d: GL Info: object 0x%X compiled successful\n", file, line, (unsigned int)(uintptr_t)obj); } break; case GL_OBJECT_LINK_STATUS_ARB: if(param!=1) { if ( CHECK_VERBOSE <= m ) - osd_printf_warning("%s:%d: GL Error: object 0x%X linking failed\n", file, line, (unsigned int)(FPTR)obj); + osd_printf_warning("%s:%d: GL Error: object 0x%X linking failed\n", file, line, (unsigned int)(uintptr_t)obj); res=-1; } else if ( CHECK_ALWAYS_VERBOSE <= m ) { - osd_printf_warning("%s:%d: GL Info: object 0x%X linked successful\n", file, line, (unsigned int)(FPTR)obj); + osd_printf_warning("%s:%d: GL Info: object 0x%X linked successful\n", file, line, (unsigned int)(uintptr_t)obj); } break; case GL_OBJECT_VALIDATE_STATUS_ARB: if(param!=1) { if ( CHECK_VERBOSE <= m ) - osd_printf_warning("%s:%d: GL Error: object 0x%X validation failed\n", file, line, (unsigned int)(FPTR)obj); + osd_printf_warning("%s:%d: GL Error: object 0x%X validation failed\n", file, line, (unsigned int)(uintptr_t)obj); res=-1; } else if ( CHECK_ALWAYS_VERBOSE <= m ) { - osd_printf_warning("%s:%d: GL Info: object 0x%X validation successful\n", file, line, (unsigned int)(FPTR)obj); + osd_printf_warning("%s:%d: GL Info: object 0x%X validation successful\n", file, line, (unsigned int)(uintptr_t)obj); } break; } diff --git a/src/osd/modules/render/blit13.h b/src/osd/modules/render/blit13.h index 22a7a1fcea5..33daf3c5ead 100644 --- a/src/osd/modules/render/blit13.h +++ b/src/osd/modules/render/blit13.h @@ -35,13 +35,13 @@ inline UINT32 ycc_to_rgb(const UINT8 y, const UINT8 cb, const UINT8 cr) inline UINT32 pixel_ycc_to_rgb(const UINT16 *pixel) { - const UINT32 p = *(UINT32 *)((FPTR) pixel & ~3); + const UINT32 p = *(UINT32 *)((uintptr_t) pixel & ~3); return ycc_to_rgb((*pixel >> 8) & 0xff, (p) & 0xff, (p>>16) & 0xff); } inline UINT32 pixel_ycc_to_rgb_pal(const UINT16 *pixel, const rgb_t *palette) { - const UINT32 p = *(UINT32 *)((FPTR) pixel & ~3); + const UINT32 p = *(UINT32 *)((uintptr_t) pixel & ~3); return ycc_to_rgb(palette[(*pixel >> 8) & 0xff], (p) & 0xff, (p>>16) & 0xff); } diff --git a/src/osd/modules/render/drawd3d.cpp b/src/osd/modules/render/drawd3d.cpp index 43ce12174e8..70baac2ace6 100644 --- a/src/osd/modules/render/drawd3d.cpp +++ b/src/osd/modules/render/drawd3d.cpp @@ -467,7 +467,7 @@ void d3d_texture_manager::delete_resources() UINT32 d3d_texture_manager::texture_compute_hash(const render_texinfo *texture, UINT32 flags) { - return (FPTR)texture->base ^ (flags & (PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)); + return (uintptr_t)texture->base ^ (flags & (PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)); } texture_info *d3d_texture_manager::find_texinfo(const render_texinfo *texinfo, UINT32 flags) diff --git a/src/osd/osdcomm.h b/src/osd/osdcomm.h index b5923482a10..0898448a364 100644 --- a/src/osd/osdcomm.h +++ b/src/osd/osdcomm.h @@ -78,16 +78,6 @@ using INT32 = std::int32_t; using UINT64 = std::uint64_t; using INT64 = std::int64_t; -/* pointer-sized values */ -using FPTR = uintptr_t; - -/* unicode types */ -using utf16_char = std::uint16_t; -using unicode_char = std::uint32_t; - - - - /*************************************************************************** FUNDAMENTAL CONSTANTS ***************************************************************************/ @@ -161,7 +151,6 @@ constexpr UINT64 little_endianize_int64(UINT64 x) { return flipendian_int64(x); #endif /* LSB_FIRST */ #ifdef _MSC_VER -#include <malloc.h> using ssize_t = std::make_signed_t<size_t>; #endif diff --git a/src/osd/osdcore.h b/src/osd/osdcore.h index 7464e076141..acc9c5b6088 100644 --- a/src/osd/osdcore.h +++ b/src/osd/osdcore.h @@ -290,7 +290,7 @@ int osd_get_physical_drive_geometry(const char *filename, UINT32 *cylinders, UIN The number of characters required to form a Unicode character. -----------------------------------------------------------------------------*/ -int osd_uchar_from_osdchar(unicode_char *uchar, const char *osdchar, size_t count); +int osd_uchar_from_osdchar(char32_t *uchar, const char *osdchar, size_t count); /*----------------------------------------------------------------------------- @@ -305,7 +305,7 @@ int osd_uchar_from_osdchar(unicode_char *uchar, const char *osdchar, size_t coun Whether this character is legal in a filename -----------------------------------------------------------------------------*/ -bool osd_is_valid_filename_char(unicode_char uchar); +bool osd_is_valid_filename_char(char32_t uchar); /*----------------------------------------------------------------------------- @@ -320,7 +320,7 @@ bool osd_is_valid_filename_char(unicode_char uchar); Whether this character is legal in a file path -----------------------------------------------------------------------------*/ -bool osd_is_valid_filepath_char(unicode_char uchar); +bool osd_is_valid_filepath_char(char32_t uchar); /*************************************************************************** diff --git a/src/osd/osdepend.h b/src/osd/osdepend.h index 3073a014d02..e16af650e17 100644 --- a/src/osd/osdepend.h +++ b/src/osd/osdepend.h @@ -51,7 +51,7 @@ public: * the pixel values rgb_t(0xff,0xff,0xff,0xff) or * rgb_t(0x00,0xff,0xff,0xff) for each pixel of a black & white font */ - virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs) = 0; + virtual bool get_bitmap(char32_t chnum, bitmap_argb32 &bitmap, std::int32_t &width, std::int32_t &xoffs, std::int32_t &yoffs) = 0; }; // ======================> osd_interface diff --git a/src/osd/strconv.cpp b/src/osd/strconv.cpp index 25d651fcf5b..8759f67cce9 100644 --- a/src/osd/strconv.cpp +++ b/src/osd/strconv.cpp @@ -282,7 +282,7 @@ std::string from_wstring(const WCHAR *s) // osd_uchar_from_osdchar //============================================================ -int osd_uchar_from_osdchar(UINT32 *uchar, const char *osdchar, size_t count) +int osd_uchar_from_osdchar(char32_t *uchar, const char *osdchar, size_t count) { WCHAR wch; CPINFO cp; @@ -311,7 +311,7 @@ error: // osd_uchar_from_osdchar //============================================================ -int osd_uchar_from_osdchar(unicode_char *uchar, const char *osdchar, size_t count) +int osd_uchar_from_osdchar(char32_t *uchar, const char *osdchar, size_t count) { wchar_t wch; diff --git a/src/osd/windows/window.cpp b/src/osd/windows/window.cpp index de245a231e0..370d7b7087d 100644 --- a/src/osd/windows/window.cpp +++ b/src/osd/windows/window.cpp @@ -1218,7 +1218,7 @@ LRESULT CALLBACK win_window_info::video_window_proc(HWND wnd, UINT message, WPAR break; case WM_CHAR: - window->machine().ui_input().push_char_event(window->m_target, (unicode_char) wparam); + window->machine().ui_input().push_char_event(window->m_target, (char32_t) wparam); break; case WM_MOUSEWHEEL: diff --git a/src/tools/imgtool/library.h b/src/tools/imgtool/library.h index 44146507f62..235603eb85b 100644 --- a/src/tools/imgtool/library.h +++ b/src/tools/imgtool/library.h @@ -298,7 +298,7 @@ union imgtoolinfo imgtoolerr_t (*read_block) (imgtool::image &image, void *buffer, UINT64 block); imgtoolerr_t (*write_block) (imgtool::image &image, const void *buffer, UINT64 block); imgtoolerr_t (*list_partitions) (imgtool::image &image, std::vector<imgtool::partition_info> &partitions); - int (*approve_filename_char)(unicode_char ch); + int (*approve_filename_char)(char32_t ch); int (*make_class)(int index, imgtool_class *imgclass); const util::option_guide *createimage_optguide; diff --git a/src/tools/imgtool/modules/fat.cpp b/src/tools/imgtool/modules/fat.cpp index 70590f28111..715b3486e61 100644 --- a/src/tools/imgtool/modules/fat.cpp +++ b/src/tools/imgtool/modules/fat.cpp @@ -1152,7 +1152,7 @@ done: -static void prepend_lfn_bytes(utf16_char *lfn_buf, size_t lfn_buflen, size_t *lfn_len, +static void prepend_lfn_bytes(char16_t *lfn_buf, size_t lfn_buflen, size_t *lfn_len, const UINT8 *entry, int offset, int chars) { UINT16 w; @@ -1285,8 +1285,8 @@ static imgtoolerr_t fat_read_dirent(imgtool::partition &partition, fat_file *fil UINT8 entry[FAT_DIRENT_SIZE]; size_t bytes_read; int i, j; - unicode_char ch; - utf16_char lfn_buf[512]; + char32_t ch; + char16_t lfn_buf[512]; size_t lfn_len = 0; int lfn_lastentry = 0; UINT8 lfn_checksum = 0; @@ -1413,11 +1413,11 @@ static imgtoolerr_t fat_construct_dirent(const char *filename, creation_policy_t UINT32 now; size_t created_entry_len = FAT_DIRENT_SIZE; size_t created_entry_pos = 0; - unicode_char ch; + char32_t ch; char last_short_char = ' '; char short_char = '\0'; char cannonical_short_char; - utf16_char buf[UTF16_CHAR_MAX]; + char16_t buf[UTF16_CHAR_MAX]; int i, len; int sfn_pos = 0; sfn_disposition_t sfn_disposition = SFN_SUFFICIENT; diff --git a/src/tools/srcclean.cpp b/src/tools/srcclean.cpp index 55ee72444fd..504392e7fa0 100644 --- a/src/tools/srcclean.cpp +++ b/src/tools/srcclean.cpp @@ -95,55 +95,55 @@ public: virtual void summarise(std::ostream &os) const; protected: - static constexpr unicode_char HORIZONTAL_TAB = 0x0000'0009U; - static constexpr unicode_char LINE_FEED = 0x0000'000aU; - static constexpr unicode_char VERTICAL_TAB = 0x0000'000bU; - static constexpr unicode_char SPACE = 0x0000'0020U; - static constexpr unicode_char DOUBLE_QUOTE = 0x0000'0022U; - static constexpr unicode_char SINGLE_QUOTE = 0x0000'0027U; - static constexpr unicode_char HYPHEN_MINUS = 0x0000'002dU; - static constexpr unicode_char QUESTION_MARK = 0x0000'003fU; - static constexpr unicode_char BACKSLASH = 0x0000'005cU; - static constexpr unicode_char BASIC_LATIN_LAST = 0x0000'007fU; - static constexpr unicode_char CYRILLIC_SUPPLEMENT_LAST = 0x0000'052fU; + static constexpr char32_t HORIZONTAL_TAB = 0x0000'0009U; + static constexpr char32_t LINE_FEED = 0x0000'000aU; + static constexpr char32_t VERTICAL_TAB = 0x0000'000bU; + static constexpr char32_t SPACE = 0x0000'0020U; + static constexpr char32_t DOUBLE_QUOTE = 0x0000'0022U; + static constexpr char32_t SINGLE_QUOTE = 0x0000'0027U; + static constexpr char32_t HYPHEN_MINUS = 0x0000'002dU; + static constexpr char32_t QUESTION_MARK = 0x0000'003fU; + static constexpr char32_t BACKSLASH = 0x0000'005cU; + static constexpr char32_t BASIC_LATIN_LAST = 0x0000'007fU; + static constexpr char32_t CYRILLIC_SUPPLEMENT_LAST = 0x0000'052fU; template <typename OutputIt> cleaner_base(OutputIt &&output, newline newline_mode, unsigned tab_width); - void output_character(unicode_char ch); + void output_character(char32_t ch); void set_tab_limit(); void reset_tab_limit(); private: - static constexpr unicode_char CARRIAGE_RETURN = 0x0000'000dU; - static constexpr unicode_char HIGH_SURROGATE_FIRST = 0x0000'd800U; - static constexpr unicode_char HIGH_SURROGATE_LAST = 0x0000'dbffU; - static constexpr unicode_char LOW_SURROGATE_FIRST = 0x0000'dc00U; - static constexpr unicode_char LOW_SURROGATE_LAST = 0x0000'dfffU; - static constexpr unicode_char NONCHARACTER_FIRST = 0x0000'fdd0U; - static constexpr unicode_char NONCHARACTER_LAST = 0x0000'fdefU; - static constexpr unicode_char ZERO_WIDTH_NB_SPACE = 0x0000'feffU; - static constexpr unicode_char REPLACEMENT_CHARACTER = 0x0000'fffdU; - static constexpr unicode_char SUPPLEMENTARY_FIRST = 0x0001'0000U; - static constexpr unicode_char SUPPLEMENTARY_LAST = 0x0010'ffffU; - - static constexpr unicode_char CODE_LENGTH_THRESHOLDS[6]{ + static constexpr char32_t CARRIAGE_RETURN = 0x0000'000dU; + static constexpr char32_t HIGH_SURROGATE_FIRST = 0x0000'd800U; + static constexpr char32_t HIGH_SURROGATE_LAST = 0x0000'dbffU; + static constexpr char32_t LOW_SURROGATE_FIRST = 0x0000'dc00U; + static constexpr char32_t LOW_SURROGATE_LAST = 0x0000'dfffU; + static constexpr char32_t NONCHARACTER_FIRST = 0x0000'fdd0U; + static constexpr char32_t NONCHARACTER_LAST = 0x0000'fdefU; + static constexpr char32_t ZERO_WIDTH_NB_SPACE = 0x0000'feffU; + static constexpr char32_t REPLACEMENT_CHARACTER = 0x0000'fffdU; + static constexpr char32_t SUPPLEMENTARY_FIRST = 0x0001'0000U; + static constexpr char32_t SUPPLEMENTARY_LAST = 0x0010'ffffU; + + static constexpr char32_t CODE_LENGTH_THRESHOLDS[6]{ 0x0000'0000U, 0x0000'0080U, 0x0000'0800U, 0x0001'0000U, 0x0020'0000U, 0x0400'0000 }; typedef std::function<void (char)> output_function; - virtual void process_characters(unicode_char const *begin, unicode_char const *end) = 0; + virtual void process_characters(char32_t const *begin, char32_t const *end) = 0; virtual void input_complete() = 0; void flush_whitespace(); - void output_utf8(unicode_char ch); - void commit_character(unicode_char ch); + void output_utf8(char32_t ch); + void commit_character(char32_t ch); void process_if_full(); void handle_lead_byte(std::uint8_t ch); - void handle_codepoint(unicode_char cp); + void handle_codepoint(char32_t cp); - static constexpr bool is_character(unicode_char ch) + static constexpr bool is_character(char32_t ch) { return (ch <= SUPPLEMENTARY_LAST) && @@ -151,17 +151,17 @@ private: ((ch & 0x0000'fffeU) != 0x0000'fffeU); } - static constexpr bool is_high_surrogate(unicode_char ch) + static constexpr bool is_high_surrogate(char32_t ch) { return (ch >= HIGH_SURROGATE_FIRST) && (ch <= HIGH_SURROGATE_LAST); } - static constexpr bool is_low_surrogate(unicode_char ch) + static constexpr bool is_low_surrogate(char32_t ch) { return (ch >= LOW_SURROGATE_FIRST) && (ch <= LOW_SURROGATE_LAST); } - static constexpr unicode_char combine_surrogates(unicode_char high, unicode_char low) + static constexpr char32_t combine_surrogates(char32_t high, char32_t low) { return SUPPLEMENTARY_FIRST + (((high & 0x0000'03ffU) << 10U) | (low & 0x0000'03ffU)); } @@ -175,16 +175,16 @@ private: unsigned m_output_column = 0U; unsigned m_indent; unsigned m_tab_limit = std::numeric_limits<unsigned>::max(); - std::vector<unicode_char> m_whitespace; + std::vector<char32_t> m_whitespace; // input state management - unicode_char m_buffer[1024]; + char32_t m_buffer[1024]; bool m_stream_start = true; std::size_t m_position = 0U; - unicode_char m_surrogate = 0U; + char32_t m_surrogate = 0U; unsigned m_code_length = 0U; unsigned m_required_bytes = 0U; - unicode_char m_newline_lead = 0U; + char32_t m_newline_lead = 0U; // statistics std::uint64_t m_overlong = 0U; @@ -207,7 +207,7 @@ private: bool m_final_newline = false; }; -constexpr unicode_char cleaner_base::CODE_LENGTH_THRESHOLDS[6]; +constexpr char32_t cleaner_base::CODE_LENGTH_THRESHOLDS[6]; /*-------------------------------------------------- @@ -226,7 +226,7 @@ void cleaner_base::process(InputIt begin, InputIt end) if ((byte & 0xc0U) == 0x80U) { m_buffer[m_position] <<= 6U; - m_buffer[m_position] |= unicode_char(byte & 0x3fU); + m_buffer[m_position] |= char32_t(byte & 0x3fU); --m_required_bytes; } else @@ -401,7 +401,7 @@ cleaner_base::cleaner_base( normalisation and line ending translation --------------------------------------------------*/ -void cleaner_base::output_character(unicode_char ch) +void cleaner_base::output_character(char32_t ch) { switch (ch) { @@ -455,7 +455,7 @@ void cleaner_base::set_tab_limit() if (!m_output_column) { unsigned limit(0U); - for (unicode_char ch : m_whitespace) + for (char32_t ch : m_whitespace) limit += (HORIZONTAL_TAB == ch) ? (m_tab_width - (limit % m_tab_width)) : 1U; m_tab_limit = limit; } @@ -488,7 +488,7 @@ void cleaner_base::flush_whitespace() bool const set_indent(!m_output_column); bool expand(m_output_column); unsigned space_count(0U); - for (unicode_char space : m_whitespace) + for (char32_t space : m_whitespace) { assert(!expand || !space_count); assert(space_count < m_tab_width); @@ -562,7 +562,7 @@ void cleaner_base::flush_whitespace() convert codepoint to UFF-8 and send to output --------------------------------------------------*/ -void cleaner_base::output_utf8(unicode_char ch) +void cleaner_base::output_utf8(char32_t ch) { if (0x0000'0080U > ch) { @@ -589,7 +589,7 @@ void cleaner_base::output_utf8(unicode_char ch) replacing noncharacters --------------------------------------------------*/ -void cleaner_base::commit_character(unicode_char ch) +void cleaner_base::commit_character(char32_t ch) { assert(ARRAY_LENGTH(m_buffer) > m_position); assert(1U <= m_code_length); @@ -716,7 +716,7 @@ void cleaner_base::handle_lead_byte(std::uint8_t byte) m_code_length = m_required_bytes + 1U; if (m_required_bytes) { - m_buffer[m_position] = ((unicode_char(1U) << (6U - m_required_bytes)) - 1) & unicode_char(byte); + m_buffer[m_position] = ((char32_t(1U) << (6U - m_required_bytes)) - 1) & char32_t(byte); } else if ((byte & 0xc0U) == 0x80U) { @@ -741,7 +741,7 @@ void cleaner_base::handle_lead_byte(std::uint8_t byte) surrogates --------------------------------------------------*/ -void cleaner_base::handle_codepoint(unicode_char cp) +void cleaner_base::handle_codepoint(char32_t cp) { if (m_surrogate) { @@ -790,7 +790,7 @@ public: } private: - virtual void process_characters(unicode_char const *begin, unicode_char const *end) override + virtual void process_characters(char32_t const *begin, char32_t const *end) override { while (begin != end) output_character(*begin++); @@ -817,29 +817,29 @@ public: virtual void summarise(std::ostream &os) const override; protected: - void output_character(unicode_char ch); + void output_character(char32_t ch); private: - static constexpr unicode_char ASTERISK = 0x0000'002aU; - static constexpr unicode_char SLASH = 0x0000'002fU; - static constexpr unicode_char UPPERCASE_FIRST = 0x0000'0041U; - static constexpr unicode_char UPPERCASE_B = 0x0000'0042U; - static constexpr unicode_char UPPERCASE_X = 0x0000'0058U; - static constexpr unicode_char UPPERCASE_LAST = 0x0000'005aU; - static constexpr unicode_char UNDERSCORE = 0x0000'005fU; - static constexpr unicode_char LOWERCASE_FIRST = 0x0000'0061U; - static constexpr unicode_char LOWERCASE_B = 0x0000'0062U; - static constexpr unicode_char LOWERCASE_X = 0x0000'0078U; - static constexpr unicode_char LOWERCASE_LAST = 0x0000'007aU; - - static constexpr unicode_char DIGIT_FIRST = 0x0000'0030U; - static constexpr unicode_char DIGIT_BINARY_LAST = 0x0000'0031U; - static constexpr unicode_char DIGIT_OCTAL_LAST = 0x0000'0037U; - static constexpr unicode_char DIGIT_DECIMAL_LAST = 0x0000'0039U; - static constexpr unicode_char DIGIT_HEX_UPPER_FIRST = 0x0000'0041U; - static constexpr unicode_char DIGIT_HEX_UPPER_LAST = 0x0000'0046U; - static constexpr unicode_char DIGIT_HEX_LOWER_FIRST = 0x0000'0061U; - static constexpr unicode_char DIGIT_HEX_LOWER_LAST = 0x0000'0066U; + static constexpr char32_t ASTERISK = 0x0000'002aU; + static constexpr char32_t SLASH = 0x0000'002fU; + static constexpr char32_t UPPERCASE_FIRST = 0x0000'0041U; + static constexpr char32_t UPPERCASE_B = 0x0000'0042U; + static constexpr char32_t UPPERCASE_X = 0x0000'0058U; + static constexpr char32_t UPPERCASE_LAST = 0x0000'005aU; + static constexpr char32_t UNDERSCORE = 0x0000'005fU; + static constexpr char32_t LOWERCASE_FIRST = 0x0000'0061U; + static constexpr char32_t LOWERCASE_B = 0x0000'0062U; + static constexpr char32_t LOWERCASE_X = 0x0000'0078U; + static constexpr char32_t LOWERCASE_LAST = 0x0000'007aU; + + static constexpr char32_t DIGIT_FIRST = 0x0000'0030U; + static constexpr char32_t DIGIT_BINARY_LAST = 0x0000'0031U; + static constexpr char32_t DIGIT_OCTAL_LAST = 0x0000'0037U; + static constexpr char32_t DIGIT_DECIMAL_LAST = 0x0000'0039U; + static constexpr char32_t DIGIT_HEX_UPPER_FIRST = 0x0000'0041U; + static constexpr char32_t DIGIT_HEX_UPPER_LAST = 0x0000'0046U; + static constexpr char32_t DIGIT_HEX_LOWER_FIRST = 0x0000'0061U; + static constexpr char32_t DIGIT_HEX_LOWER_LAST = 0x0000'0066U; enum class parse_state { @@ -852,17 +852,17 @@ private: NUMERIC_CONSTANT }; - virtual void process_characters(unicode_char const *begin, unicode_char const *end) override; + virtual void process_characters(char32_t const *begin, char32_t const *end) override; virtual void input_complete() override; - void process_default(unicode_char ch); - void process_comment(unicode_char ch); - void process_line_comment(unicode_char ch); - void process_token(unicode_char ch); - void process_text(unicode_char ch); - void process_numeric(unicode_char ch); + void process_default(char32_t ch); + void process_comment(char32_t ch); + void process_line_comment(char32_t ch); + void process_token(char32_t ch); + void process_text(char32_t ch); + void process_numeric(char32_t ch); - bool tail_is(unicode_char ch) const + bool tail_is(char32_t ch) const { return !m_tail.empty() && (m_tail.front() == ch); } @@ -873,7 +873,7 @@ private: m_tail.pop_front(); } - void replace_tail(unicode_char ch) + void replace_tail(char32_t ch) { assert(!m_tail.empty()); *m_tail.begin() = ch; @@ -881,12 +881,12 @@ private: void flush_tail() { - for (unicode_char tail : m_tail) + for (char32_t tail : m_tail) cleaner_base::output_character(tail); m_tail.clear(); } - static constexpr bool is_token_lead(unicode_char ch) + static constexpr bool is_token_lead(char32_t ch) { return ((UPPERCASE_FIRST <= ch) && (UPPERCASE_LAST >= ch)) || @@ -894,34 +894,34 @@ private: (UNDERSCORE == ch); } - static constexpr bool is_token_continuation(unicode_char ch) + static constexpr bool is_token_continuation(char32_t ch) { return is_token_lead(ch) || ((DIGIT_FIRST <= ch) && (DIGIT_DECIMAL_LAST >= ch)); } - static constexpr bool is_numeric_lead(unicode_char ch) + static constexpr bool is_numeric_lead(char32_t ch) { return (DIGIT_FIRST <= ch) && (DIGIT_DECIMAL_LAST >= ch); } - static constexpr bool is_binary_digit(unicode_char ch) + static constexpr bool is_binary_digit(char32_t ch) { return (DIGIT_FIRST <= ch) && (DIGIT_BINARY_LAST >= ch); } - static constexpr bool is_octal_digit(unicode_char ch) + static constexpr bool is_octal_digit(char32_t ch) { return (DIGIT_FIRST <= ch) && (DIGIT_OCTAL_LAST >= ch); } - static constexpr bool is_decimal_digit(unicode_char ch) + static constexpr bool is_decimal_digit(char32_t ch) { return (DIGIT_FIRST <= ch) && (DIGIT_DECIMAL_LAST >= ch); } - static constexpr bool is_hexadecimal_digit(unicode_char ch) + static constexpr bool is_hexadecimal_digit(char32_t ch) { return ((DIGIT_FIRST <= ch) && (DIGIT_DECIMAL_LAST >= ch)) || @@ -932,9 +932,9 @@ private: parse_state m_parse_state; std::uint64_t m_input_line; bool m_escape; - std::deque<unicode_char> m_tail; + std::deque<char32_t> m_tail; std::uint64_t m_comment_line; - unicode_char m_lead_digit; + char32_t m_lead_digit; unsigned m_radix; std::uint64_t m_tabs_escaped = 0U; @@ -990,7 +990,7 @@ void cpp_cleaner::summarise(std::ostream &os) const } -void cpp_cleaner::output_character(unicode_char ch) +void cpp_cleaner::output_character(char32_t ch) { switch (m_parse_state) { @@ -1032,11 +1032,11 @@ void cpp_cleaner::output_character(unicode_char ch) } -void cpp_cleaner::process_characters(unicode_char const *begin, unicode_char const *end) +void cpp_cleaner::process_characters(char32_t const *begin, char32_t const *end) { while (begin != end) { - unicode_char const ch(*begin++); + char32_t const ch(*begin++); switch (m_parse_state) { case parse_state::DEFAULT: @@ -1083,7 +1083,7 @@ void cpp_cleaner::input_complete() } -void cpp_cleaner::process_default(unicode_char ch) +void cpp_cleaner::process_default(char32_t ch) { switch (ch) { @@ -1123,7 +1123,7 @@ void cpp_cleaner::process_default(unicode_char ch) } -void cpp_cleaner::process_comment(unicode_char ch) +void cpp_cleaner::process_comment(char32_t ch) { switch (ch) { @@ -1144,7 +1144,7 @@ void cpp_cleaner::process_comment(unicode_char ch) } -void cpp_cleaner::process_line_comment(unicode_char ch) +void cpp_cleaner::process_line_comment(char32_t ch) { switch (ch) { @@ -1165,7 +1165,7 @@ void cpp_cleaner::process_line_comment(unicode_char ch) } -void cpp_cleaner::process_token(unicode_char ch) +void cpp_cleaner::process_token(char32_t ch) { if (is_token_continuation(ch)) { @@ -1179,7 +1179,7 @@ void cpp_cleaner::process_token(unicode_char ch) } -void cpp_cleaner::process_text(unicode_char ch) +void cpp_cleaner::process_text(char32_t ch) { switch (ch) { @@ -1187,7 +1187,7 @@ void cpp_cleaner::process_text(unicode_char ch) ++m_tabs_escaped; if (!m_escape) output_character(BACKSLASH); - output_character(unicode_char(std::uint8_t('t'))); + output_character(char32_t(std::uint8_t('t'))); break; case LINE_FEED: if (parse_state::CHARACTER_CONSTANT == m_parse_state) @@ -1210,7 +1210,7 @@ void cpp_cleaner::process_text(unicode_char ch) ++m_tabs_escaped; if (!m_escape) output_character(BACKSLASH); - output_character(unicode_char(std::uint8_t('v'))); + output_character(char32_t(std::uint8_t('v'))); break; default: output_character(ch); @@ -1221,7 +1221,7 @@ void cpp_cleaner::process_text(unicode_char ch) } -void cpp_cleaner::process_numeric(unicode_char ch) +void cpp_cleaner::process_numeric(char32_t ch) { if (!m_lead_digit) { @@ -1337,12 +1337,12 @@ public: virtual void summarise(std::ostream &os) const override; protected: - void output_character(unicode_char ch); + void output_character(char32_t ch); private: - static constexpr unicode_char EQUALS = 0x0000'003dU; - static constexpr unicode_char LEFT_BRACKET = 0x0000'005bU; - static constexpr unicode_char RIGHT_BRACKET = 0x0000'005dU; + static constexpr char32_t EQUALS = 0x0000'003dU; + static constexpr char32_t LEFT_BRACKET = 0x0000'005bU; + static constexpr char32_t RIGHT_BRACKET = 0x0000'005dU; enum class parse_state { @@ -1353,14 +1353,14 @@ private: LONG_STRING_CONSTANT }; - virtual void process_characters(unicode_char const *begin, unicode_char const *end) override; + virtual void process_characters(char32_t const *begin, char32_t const *end) override; virtual void input_complete() override; - void process_default(unicode_char ch); - void process_short_comment(unicode_char ch); - void process_long_comment(unicode_char ch); - void process_string_constant(unicode_char ch); - void process_long_string_constant(unicode_char ch); + void process_default(char32_t ch); + void process_short_comment(char32_t ch); + void process_long_comment(char32_t ch); + void process_string_constant(char32_t ch); + void process_long_string_constant(char32_t ch); parse_state m_parse_state; std::uint64_t m_input_line; @@ -1369,7 +1369,7 @@ private: std::uint32_t m_block_line; int m_block_level; bool m_comment_start; - unicode_char m_string_quote; + char32_t m_string_quote; std::uint64_t m_tabs_escaped = 0U; std::uint64_t m_newlines_escaped = 0U; @@ -1417,7 +1417,7 @@ void lua_cleaner::summarise(std::ostream &os) const } -void lua_cleaner::output_character(unicode_char ch) +void lua_cleaner::output_character(char32_t ch) { switch (m_parse_state) { @@ -1445,11 +1445,11 @@ void lua_cleaner::output_character(unicode_char ch) } -void lua_cleaner::process_characters(unicode_char const *begin, unicode_char const *end) +void lua_cleaner::process_characters(char32_t const *begin, char32_t const *end) { while (begin != end) { - unicode_char const ch(*begin++); + char32_t const ch(*begin++); switch (m_parse_state) { case parse_state::DEFAULT: @@ -1491,7 +1491,7 @@ void lua_cleaner::input_complete() } -void lua_cleaner::process_default(unicode_char ch) +void lua_cleaner::process_default(char32_t ch) { switch (ch) { @@ -1534,7 +1534,7 @@ void lua_cleaner::process_default(unicode_char ch) } -void lua_cleaner::process_short_comment(unicode_char ch) +void lua_cleaner::process_short_comment(char32_t ch) { if (0 <= m_long_bracket_level) { @@ -1565,7 +1565,7 @@ void lua_cleaner::process_short_comment(unicode_char ch) } -void lua_cleaner::process_long_comment(unicode_char ch) +void lua_cleaner::process_long_comment(char32_t ch) { if (0 <= m_long_bracket_level) { @@ -1597,7 +1597,7 @@ void lua_cleaner::process_long_comment(unicode_char ch) } -void lua_cleaner::process_string_constant(unicode_char ch) +void lua_cleaner::process_string_constant(char32_t ch) { switch (ch) { @@ -1605,13 +1605,13 @@ void lua_cleaner::process_string_constant(unicode_char ch) ++m_tabs_escaped; if (!m_escape) output_character(BACKSLASH); - output_character(unicode_char(std::uint8_t('t'))); + output_character(char32_t(std::uint8_t('t'))); break; case LINE_FEED: if (m_escape) { ++m_newlines_escaped; - output_character(unicode_char(std::uint8_t('n'))); + output_character(char32_t(std::uint8_t('n'))); } else { @@ -1622,7 +1622,7 @@ void lua_cleaner::process_string_constant(unicode_char ch) ++m_tabs_escaped; if (!m_escape) output_character(BACKSLASH); - output_character(unicode_char(std::uint8_t('v'))); + output_character(char32_t(std::uint8_t('v'))); break; default: output_character(ch); @@ -1633,7 +1633,7 @@ void lua_cleaner::process_string_constant(unicode_char ch) } -void lua_cleaner::process_long_string_constant(unicode_char ch) +void lua_cleaner::process_long_string_constant(char32_t ch) { // this works because they're both closed by a matching long bracket process_long_comment(ch); @@ -1652,9 +1652,9 @@ public: xml_cleaner(OutputIt &&output, newline newline_mode, unsigned tab_width); private: - static constexpr unicode_char EXCLAMATION = 0x0000'0021U; - static constexpr unicode_char LEFT_ANGLE_BRACKET = 0x0000'003cU; - static constexpr unicode_char RIGHT_ANGLE_BRACKET = 0x0000'003eU; + static constexpr char32_t EXCLAMATION = 0x0000'0021U; + static constexpr char32_t LEFT_ANGLE_BRACKET = 0x0000'003cU; + static constexpr char32_t RIGHT_ANGLE_BRACKET = 0x0000'003eU; enum class parse_state { @@ -1662,11 +1662,11 @@ private: COMMENT }; - virtual void process_characters(unicode_char const *begin, unicode_char const *end) override; + virtual void process_characters(char32_t const *begin, char32_t const *end) override; virtual void input_complete() override; - void process_default(unicode_char ch); - void process_comment(unicode_char ch); + void process_default(char32_t ch); + void process_comment(char32_t ch); parse_state m_parse_state; std::uint64_t m_input_line; @@ -1689,11 +1689,11 @@ xml_cleaner::xml_cleaner( } -void xml_cleaner::process_characters(unicode_char const *begin, unicode_char const *end) +void xml_cleaner::process_characters(char32_t const *begin, char32_t const *end) { while (begin != end) { - unicode_char const ch(*begin++); + char32_t const ch(*begin++); switch (m_parse_state) { case parse_state::DEFAULT: @@ -1717,7 +1717,7 @@ void xml_cleaner::input_complete() } -void xml_cleaner::process_default(unicode_char ch) +void xml_cleaner::process_default(char32_t ch) { assert(4U > m_escape); @@ -1746,7 +1746,7 @@ void xml_cleaner::process_default(unicode_char ch) } -void xml_cleaner::process_comment(unicode_char ch) +void xml_cleaner::process_comment(char32_t ch) { assert(3U > m_escape); |