mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 14:01:25 +12:00
* sys_net: don't use fds_bits from a system header on FreeBSD rpcs3/Emu/Cell/Modules/sys_net.cpp:137:14: error: no member named '__fds_bits' in 'sys_net::fd_set'; did you mean 'fds_bits'? if (src->fds_bits[i] & (1 << bit)) ^~~~~~~~ fds_bits /usr/include/sys/select.h:75:18: note: expanded from macro 'fds_bits' #define fds_bits __fds_bits ^ rpcs3/Emu/Cell/Modules/sys_net.h:114:13: note: 'fds_bits' declared here be_t<u32> fds_bits[32]; ^ * GUI: fallback to xdg-open on other Unices rpcs3/Gui/GameViewer.cpp:289:26: error: use of undeclared identifier 'command' wxExecute(fmt::FromUTF8(command)); ^ * File: FreeBSD never supported copyfile(3) but sendfile(2) works fine Utilities/File.cpp:114:10: fatal error: 'copyfile.h' file not found #include <copyfile.h> ^~~~~~~~~~~~ * Thread: add signal handling for BSDs Utilities/Thread.cpp:761:23: error: use of undeclared identifier 'REG_RAX' static const decltype(REG_RAX) reg_table[] = ^ Utilities/Thread.cpp:763:2: error: use of undeclared identifier 'REG_RAX' REG_RAX, REG_RCX, REG_RDX, REG_RBX, REG_RSP, REG_RBP, REG_RSI, REG_RDI, ^ Utilities/Thread.cpp:763:11: error: use of undeclared identifier 'REG_RCX' REG_RAX, REG_RCX, REG_RDX, REG_RBX, REG_RSP, REG_RBP, REG_RSI, REG_RDI, ^ Utilities/Thread.cpp:763:20: error: use of undeclared identifier 'REG_RDX' REG_RAX, REG_RCX, REG_RDX, REG_RBX, REG_RSP, REG_RBP, REG_RSI, REG_RDI, ^ Utilities/Thread.cpp:763:29: error: use of undeclared identifier 'REG_RBX' REG_RAX, REG_RCX, REG_RDX, REG_RBX, REG_RSP, REG_RBP, REG_RSI, REG_RDI, ^ Utilities/Thread.cpp:763:38: error: use of undeclared identifier 'REG_RSP' REG_RAX, REG_RCX, REG_RDX, REG_RBX, REG_RSP, REG_RBP, REG_RSI, REG_RDI, ^ Utilities/Thread.cpp:763:47: error: use of undeclared identifier 'REG_RBP' REG_RAX, REG_RCX, REG_RDX, REG_RBX, REG_RSP, REG_RBP, REG_RSI, REG_RDI, ^ Utilities/Thread.cpp:763:56: error: use of undeclared identifier 'REG_RSI' REG_RAX, REG_RCX, REG_RDX, REG_RBX, REG_RSP, REG_RBP, REG_RSI, REG_RDI, ^ Utilities/Thread.cpp:763:65: error: use of undeclared identifier 'REG_RDI' REG_RAX, REG_RCX, REG_RDX, REG_RBX, REG_RSP, REG_RBP, REG_RSI, REG_RDI, ^ Utilities/Thread.cpp:764:2: error: use of undeclared identifier 'REG_R8' REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15, REG_RIP ^ Utilities/Thread.cpp:764:10: error: use of undeclared identifier 'REG_R9' REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15, REG_RIP ^ Utilities/Thread.cpp:764:18: error: use of undeclared identifier 'REG_R10' REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15, REG_RIP ^ Utilities/Thread.cpp:764:27: error: use of undeclared identifier 'REG_R11' REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15, REG_RIP ^ Utilities/Thread.cpp:764:36: error: use of undeclared identifier 'REG_R12' REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15, REG_RIP ^ Utilities/Thread.cpp:764:45: error: use of undeclared identifier 'REG_R13' REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15, REG_RIP ^ Utilities/Thread.cpp:764:54: error: use of undeclared identifier 'REG_R14' REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15, REG_RIP ^ Utilities/Thread.cpp:764:63: error: use of undeclared identifier 'REG_R15' REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15, REG_RIP ^ Utilities/Thread.cpp:764:72: error: use of undeclared identifier 'REG_RIP' REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15, REG_RIP ^ Utilities/Thread.cpp:792:26: error: no member named 'gregs' in '__mcontext' const u64 reg_value = *X64REG(context, reg - X64R_RAX); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG' #define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:804:21: error: no member named 'gregs' in '__mcontext' out_value = (u8)(*X64REG(context, reg - X64R_AL)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG' #define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:809:21: error: no member named 'gregs' in '__mcontext' out_value = (u8)(*X64REG(context, reg - X64R_AH) >> 8); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG' #define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:815:31: error: no member named 'gregs' in '__mcontext' const s8 imm_value = *(s8*)(RIP(context) + i_size - 1); ^~~~~~~~~~~~ Utilities/Thread.cpp:784:18: note: expanded from macro 'RIP' #define RIP(c) (*X64REG((c), 16)) ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG' #define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:827:33: error: no member named 'gregs' in '__mcontext' const s16 imm_value = *(s16*)(RIP(context) + i_size - 2); ^~~~~~~~~~~~ Utilities/Thread.cpp:784:18: note: expanded from macro 'RIP' #define RIP(c) (*X64REG((c), 16)) ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG' #define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:836:33: error: no member named 'gregs' in '__mcontext' const s32 imm_value = *(s32*)(RIP(context) + i_size - 4); ^~~~~~~~~~~~ Utilities/Thread.cpp:784:18: note: expanded from macro 'RIP' #define RIP(c) (*X64REG((c), 16)) ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG' #define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:846:20: error: no member named 'gregs' in '__mcontext' out_value = (u32)RCX(context); ^~~~~~~~~~~~ Utilities/Thread.cpp:779:18: note: expanded from macro 'RCX' #define RCX(c) (*X64REG((c), 1)) ^~~~~~~~~~~~~~ Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG' #define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:851:19: error: no member named 'gregs' in '__mcontext' const u32 _cf = EFLAGS(context) & 0x1; ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:851:19: error: use of undeclared identifier 'REG_EFL' Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ^ Utilities/Thread.cpp:852:19: error: no member named 'gregs' in '__mcontext' const u32 _zf = EFLAGS(context) & 0x40; ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:852:19: error: use of undeclared identifier 'REG_EFL' Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ^ Utilities/Thread.cpp:853:19: error: no member named 'gregs' in '__mcontext' const u32 _sf = EFLAGS(context) & 0x80; ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:853:19: error: use of undeclared identifier 'REG_EFL' Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ^ Utilities/Thread.cpp:854:19: error: no member named 'gregs' in '__mcontext' const u32 _of = EFLAGS(context) & 0x800; ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:854:19: error: use of undeclared identifier 'REG_EFL' Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ^ Utilities/Thread.cpp:855:19: error: no member named 'gregs' in '__mcontext' const u32 _pf = EFLAGS(context) & 0x4; ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:855:19: error: use of undeclared identifier 'REG_EFL' Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ^ Utilities/Thread.cpp:885:12: error: no member named 'gregs' in '__mcontext' case 1: *X64REG(context, reg - X64R_RAX) = value & 0xff | *X64REG(context, re... ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG' #define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:885:62: error: no member named 'gregs' in '__mcontext' ...*X64REG(context, reg - X64R_RAX) = value & 0xff | *X64REG(context, reg - X64R_RAX) & 0xffffff... ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG' #define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:886:12: error: no member named 'gregs' in '__mcontext' case 2: *X64REG(context, reg - X64R_RAX) = value & 0xffff | *X64REG(context, ... ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG' #define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:886:64: error: no member named 'gregs' in '__mcontext' ...reg - X64R_RAX) = value & 0xffff | *X64REG(context, reg - X64R_RAX) & 0xffff0000; return true; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG' #define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:887:12: error: no member named 'gregs' in '__mcontext' case 4: *X64REG(context, reg - X64R_RAX) = value & 0xffffffff; return true; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG' #define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:888:12: error: no member named 'gregs' in '__mcontext' case 8: *X64REG(context, reg - X64R_RAX) = value; return true; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG' #define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:913:3: error: no member named 'gregs' in '__mcontext' EFLAGS(context) |= 0x1; // set CF ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:913:3: error: use of undeclared identifier 'REG_EFL' Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ^ Utilities/Thread.cpp:917:3: error: no member named 'gregs' in '__mcontext' EFLAGS(context) &= ~0x1; // clear CF ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:917:3: error: use of undeclared identifier 'REG_EFL' Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ^ Utilities/Thread.cpp:922:3: error: no member named 'gregs' in '__mcontext' EFLAGS(context) |= 0x40; // set ZF ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:922:3: error: use of undeclared identifier 'REG_EFL' Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ^ Utilities/Thread.cpp:926:3: error: no member named 'gregs' in '__mcontext' EFLAGS(context) &= ~0x40; // clear ZF ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:926:3: error: use of undeclared identifier 'REG_EFL' Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ^ Utilities/Thread.cpp:931:3: error: no member named 'gregs' in '__mcontext' EFLAGS(context) |= 0x80; // set SF ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:931:3: error: use of undeclared identifier 'REG_EFL' Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ^ Utilities/Thread.cpp:935:3: error: no member named 'gregs' in '__mcontext' EFLAGS(context) &= ~0x80; // clear SF ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:935:3: error: use of undeclared identifier 'REG_EFL' Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ^ Utilities/Thread.cpp:940:3: error: no member named 'gregs' in '__mcontext' EFLAGS(context) |= 0x800; // set OF ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:940:3: error: use of undeclared identifier 'REG_EFL' Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ^ Utilities/Thread.cpp:944:3: error: no member named 'gregs' in '__mcontext' EFLAGS(context) &= ~0x800; // clear OF ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:944:3: error: use of undeclared identifier 'REG_EFL' Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ^ Utilities/Thread.cpp:953:3: error: no member named 'gregs' in '__mcontext' EFLAGS(context) |= 0x4; // set PF ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:953:3: error: use of undeclared identifier 'REG_EFL' Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ^ Utilities/Thread.cpp:957:3: error: no member named 'gregs' in '__mcontext' EFLAGS(context) &= ~0x4; // clear PF ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:957:3: error: use of undeclared identifier 'REG_EFL' Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ^ Utilities/Thread.cpp:962:3: error: no member named 'gregs' in '__mcontext' EFLAGS(context) |= 0x10; // set AF ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:962:3: error: use of undeclared identifier 'REG_EFL' Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ^ Utilities/Thread.cpp:966:3: error: no member named 'gregs' in '__mcontext' EFLAGS(context) &= ~0x10; // clear AF ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:966:3: error: use of undeclared identifier 'REG_EFL' Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ^ Utilities/Thread.cpp:976:7: error: no member named 'gregs' in '__mcontext' if (EFLAGS(context) & 0x400 /* direction flag */) ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:769:49: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:976:7: error: use of undeclared identifier 'REG_EFL' Utilities/Thread.cpp:769:55: note: expanded from macro 'EFLAGS' #define EFLAGS(context) ((context)->uc_mcontext.gregs[REG_EFL]) ^ Utilities/Thread.cpp:1020:25: error: no member named 'gregs' in '__mcontext' auto code = (const u8*)RIP(context); ^~~~~~~~~~~~ Utilities/Thread.cpp:784:18: note: expanded from macro 'RIP' #define RIP(c) (*X64REG((c), 16)) ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG' #define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:1146:3: error: no member named 'gregs' in '__mcontext' RIP(context) += i_size; ^~~~~~~~~~~~ Utilities/Thread.cpp:784:18: note: expanded from macro 'RIP' #define RIP(c) (*X64REG((c), 16)) ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG' #define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]]) ~~~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:1368:47: error: no member named 'gregs' in '__mcontext' const bool is_writing = context->uc_mcontext.gregs[REG_ERR] & 0x2; ~~~~~~~~~~~~~~~~~~~~ ^ Utilities/Thread.cpp:1368:53: error: use of undeclared identifier 'REG_ERR' const bool is_writing = context->uc_mcontext.gregs[REG_ERR] & 0x2; ^ Utilities/Thread.cpp:1393:89: error: no member named 'gregs' in '__mcontext' ...%s location %p at %p.", cause, info->si_addr, RIP(context))); ^~~~~~~~~~~~ Utilities/Thread.cpp:784:18: note: expanded from macro 'RIP' #define RIP(c) (*X64REG((c), 16)) ^~~~~~~~~~~~~~~ Utilities/Thread.cpp:767:55: note: expanded from macro 'X64REG' #define X64REG(context, reg) (&(context)->uc_mcontext.gregs[reg_table[reg]]) ~~~~~~~~~~~~~~~~~~~~~~ ^ * Thread: add explict casts for incomplete pthread_t on some platforms Utilities/Thread.cpp:1467:17: error: no viable overloaded '=' ctrl->m_thread = thread; ~~~~~~~~~~~~~~ ^ ~~~~~~ Utilities/Atomic.h:776:12: note: candidate function not viable: cannot convert argument of incomplete type 'pthread_t' (aka 'pthread *') to 'const atomic_t<unsigned long>' for 1st argument atomic_t& operator =(const atomic_t&) = delete; ^ Utilities/Atomic.h:902:7: note: candidate function not viable: cannot convert argument of incomplete type 'pthread_t' (aka 'pthread *') to 'const type' (aka 'const unsigned long') for 1st argument type operator =(const type& rhs) ^ Utilities/Thread.cpp:1656:3: error: no matching function for call to 'pthread_detach' pthread_detach(m_thread.raw()); ^~~~~~~~~~~~~~ /usr/include/pthread.h:218:6: note: candidate function not viable: no known conversion from 'type' (aka 'unsigned long') to 'pthread_t' (aka 'pthread *') for 1st argument int pthread_detach(pthread_t); ^ * build: dlopen() maybe in libc /usr/bin/ld: cannot find -ldl c++: error: linker command failed with exit code 1 (use -v to see invocation) * build: iconv() maybe available on some BSDs in libc /usr/bin/ld: cannot find -liconv c++: error: linker command failed with exit code 1 (use -v to see invocation) * build: hidapi-hidraw is only built on Linux /usr/bin/ld: cannot find -lhidapi-hidraw c++: error: linker command failed with exit code 1 (use -v to see invocation) * Thread: use getrusage() on more POSIX-like systems * Qt: don't return NULL handle on other platforms rpcs3/rpcs3qt/gs_frame.cpp:120:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ * build: properly disable Vulkan on other platforms In file included from rpcs3/rpcs3_app.cpp:40: In file included from rpcs3/Emu/RSX/VK/VKGSRender.h:3: rpcs3/Emu/RSX/VK/VKHelpers.h:1209:42: error: unknown type name 'device_queues' std::vector<VkBool32> supportsPresent(device_queues); ^ rpcs3/Emu/RSX/VK/VKHelpers.h:1211:4: error: expected member name or ';' after declaration specifiers for (u32 index = 0; index < device_queues; index++) ^ rpcs3/Emu/RSX/VK/VKHelpers.h:1221:4: error: expected member name or ';' after declaration specifiers for (u32 i = 0; i < device_queues; i++) ^ rpcs3/Emu/RSX/VK/VKHelpers.h:1256:4: error: expected member name or ';' after declaration specifiers if (graphicsQueueNodeIndex != presentQueueNodeIndex) ^ rpcs3/Emu/RSX/VK/VKHelpers.h:1261:4: error: expected member name or ';' after declaration specifiers CHECK_RESULT(vkGetPhysicalDeviceSurfaceFormatsKHR(dev, surface, &formatCount, nullptr)); ^ [...] /usr/bin/ld: cannot find -lvulkan c++: error: linker command failed with exit code 1 (use -v to see invocation) * build: make install/strip work by moving commands * Qt: create surface for GL context if it wasn't ready #0 strlen (str=0x0) at /usr/src/lib/libc/string/strlen.c:100 #1 0x000000000090f02e in std::__1::char_traits<char>::length (__s=0x0) at /usr/include/c++/v1/__string:215 #2 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string (__s=0x0, this=<optimized out>) at /usr/include/c++/v1/string:1547 #3 gl::capabilities::initialize (this=0x2ba32a0 <gl::g_driver_caps>) at rpcs3/Emu/RSX/GL/GLHelpers.h:133 #4 0x000000000090d3dd in gl::get_driver_caps () at rpcs3/Emu/RSX/GL/GLHelpers.cpp:56 #5 0x00000000008fa511 in GLGSRender::on_init_thread (this=0x838d30018) at rpcs3/Emu/RSX/GL/GLGSRender.cpp:484 #6 0x0000000000938f9e in rsx:🧵:on_task (this=0x838d30018) at rpcs3/Emu/RSX/RSXThread.cpp:334 #7 0x0000000000abc329 in task_stack::task_type<named_thread::start_thread(std::__1::shared_ptr<void> const&)::$_10>::invoke() () #8 0x0000000000abc114 in thread_ctrl::start(std::__1::shared_ptr<thread_ctrl> const&, task_stack)::$_7::__invoke(void*) () #9 0x0000000801e60c35 in thread_start (curthread=0x843650a00) at /usr/src/lib/libthr/thread/thr_create.c:289 #10 0x0000000000000000 in ?? () * build: don't abort without git metadata -- Found Git: /usr/local/bin/git (found version "2.13.1") fatal: Not a git repository (or any parent up to mount point /) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). CMake Warning at git-version.cmake:12 (message): git rev-list failed, unable to include version. * build: non-parallel needs git-version.h earlier rpcs3/rpcs3_version.cpp:3:10: fatal error: 'git-version.h' file not found #include "git-version.h" ^~~~~~~~~~~~~~~ 1 error generated.
268 lines
8.6 KiB
C++
268 lines
8.6 KiB
C++
#include "rpcs3_app.h"
|
|
|
|
#include "rpcs3qt/welcome_dialog.h"
|
|
#include "rpcs3qt/gui_settings.h"
|
|
|
|
#include "Emu/System.h"
|
|
#include "rpcs3qt/gs_frame.h"
|
|
#include "rpcs3qt/gl_gs_frame.h"
|
|
|
|
#include "Emu/Cell/Modules/cellSaveData.h"
|
|
#include "rpcs3qt/save_data_dialog.h"
|
|
|
|
#include "rpcs3qt/msg_dialog_frame.h"
|
|
#include "Emu/Cell/Modules/cellMsgDialog.h"
|
|
|
|
#include "Emu/Io/Null/NullKeyboardHandler.h"
|
|
#include "basic_keyboard_handler.h"
|
|
|
|
#include "Emu/Io/Null/NullMouseHandler.h"
|
|
#include "basic_mouse_handler.h"
|
|
|
|
#include "Emu/Io/Null/NullPadHandler.h"
|
|
#include "keyboard_pad_handler.h"
|
|
#include "ds4_pad_handler.h"
|
|
#ifdef _MSC_VER
|
|
#include "xinput_pad_handler.h"
|
|
#endif
|
|
#ifdef _WIN32
|
|
#include "mm_joystick_handler.h"
|
|
#endif
|
|
|
|
|
|
#include "Emu/RSX/Null/NullGSRender.h"
|
|
#include "Emu/RSX/GL/GLGSRender.h"
|
|
#include "Emu/Audio/Null/NullAudioThread.h"
|
|
#include "Emu/Audio/AL/OpenALThread.h"
|
|
#ifdef _MSC_VER
|
|
#include "Emu/RSX/D3D12/D3D12GSRender.h"
|
|
#endif
|
|
#if defined(_WIN32) || defined(__linux__)
|
|
#include "Emu/RSX/VK/VKGSRender.h"
|
|
#endif
|
|
#ifdef _WIN32
|
|
#include "Emu/Audio/XAudio2/XAudio2Thread.h"
|
|
#endif
|
|
#ifdef __linux__
|
|
#include "Emu/Audio/ALSA/ALSAThread.h"
|
|
#endif
|
|
|
|
// For now, a trivial constructor/destructor. May add command line usage later.
|
|
rpcs3_app::rpcs3_app(int& argc, char** argv) : QApplication(argc, argv)
|
|
{
|
|
}
|
|
|
|
void rpcs3_app::Init()
|
|
{
|
|
Emu.Init();
|
|
|
|
// Create the main window
|
|
RPCS3MainWin = new main_window(nullptr);
|
|
|
|
// Reset the pads -- see the method for why this is currently needed.
|
|
ResetPads();
|
|
|
|
// Create callbacks from the emulator, which reference the handlers.
|
|
InitializeCallbacks();
|
|
|
|
// Create connects to propagate events throughout Gui.
|
|
InitializeConnects();
|
|
|
|
setApplicationName("RPCS3");
|
|
RPCS3MainWin->show();
|
|
|
|
// Create the thumbnail toolbar after the main_window is created
|
|
RPCS3MainWin->CreateThumbnailToolbar();
|
|
|
|
// Slightly inneficient to make a gui_settings instance right here.
|
|
// But, I don't really feel like adding this as a dependency injection into RPCS3MainWin.
|
|
if (gui_settings().GetValue(GUI::ib_show_welcome).toBool())
|
|
{
|
|
welcome_dialog* welcome = new welcome_dialog();
|
|
welcome->exec();
|
|
}
|
|
}
|
|
|
|
/** RPCS3 emulator has functions it desires to call from the GUI at times. Initialize them in here.
|
|
*/
|
|
void rpcs3_app::InitializeCallbacks()
|
|
{
|
|
EmuCallbacks callbacks;
|
|
|
|
callbacks.exit = [this]()
|
|
{
|
|
quit();
|
|
};
|
|
callbacks.call_after = [=](std::function<void()> func)
|
|
{
|
|
emit RequestCallAfter(std::move(func));
|
|
};
|
|
|
|
callbacks.process_events = [this]()
|
|
{
|
|
RPCS3MainWin->update();
|
|
processEvents();
|
|
};
|
|
|
|
callbacks.get_kb_handler = [=]() -> std::shared_ptr<KeyboardHandlerBase>
|
|
{
|
|
switch (keyboard_handler type = g_cfg.io.keyboard)
|
|
{
|
|
case keyboard_handler::null: return std::make_shared<NullKeyboardHandler>();
|
|
case keyboard_handler::basic: return m_basicKeyboardHandler;
|
|
default: fmt::throw_exception("Invalid keyboard handler: %s", type);
|
|
}
|
|
};
|
|
|
|
callbacks.get_mouse_handler = [=]() -> std::shared_ptr<MouseHandlerBase>
|
|
{
|
|
switch (mouse_handler type = g_cfg.io.mouse)
|
|
{
|
|
case mouse_handler::null: return std::make_shared<NullMouseHandler>();
|
|
case mouse_handler::basic: return m_basicMouseHandler;
|
|
default: fmt::throw_exception("Invalid mouse handler: %s", type);
|
|
}
|
|
};
|
|
|
|
callbacks.get_pad_handler = [this]() -> std::shared_ptr<PadHandlerBase>
|
|
{
|
|
switch (pad_handler type = g_cfg.io.pad)
|
|
{
|
|
case pad_handler::null: return std::make_shared<NullPadHandler>();
|
|
case pad_handler::keyboard: return m_keyboardPadHandler;
|
|
case pad_handler::ds4: return std::make_shared<ds4_pad_handler>();
|
|
#ifdef _MSC_VER
|
|
case pad_handler::xinput: return std::make_shared<xinput_pad_handler>();
|
|
#endif
|
|
#ifdef _WIN32
|
|
case pad_handler::mm: return std::make_shared<mm_joystick_handler>();
|
|
#endif
|
|
default: fmt::throw_exception("Invalid pad handler: %s", type);
|
|
}
|
|
};
|
|
|
|
callbacks.get_gs_frame = [this]() -> std::unique_ptr<GSFrameBase>
|
|
{
|
|
extern const std::unordered_map<video_resolution, std::pair<int, int>, value_hash<video_resolution>> g_video_out_resolution_map;
|
|
|
|
const auto size = g_video_out_resolution_map.at(g_cfg.video.resolution);
|
|
|
|
switch (video_renderer type = g_cfg.video.renderer)
|
|
{
|
|
case video_renderer::null: return std::make_unique<gs_frame>("Null", size.first, size.second, RPCS3MainWin->GetAppIcon());
|
|
case video_renderer::opengl: return std::make_unique<gl_gs_frame>(size.first, size.second, RPCS3MainWin->GetAppIcon());
|
|
case video_renderer::vulkan: return std::make_unique<gs_frame>("Vulkan", size.first, size.second, RPCS3MainWin->GetAppIcon());
|
|
#ifdef _MSC_VER
|
|
case video_renderer::dx12: return std::make_unique<gs_frame>("DirectX 12", size.first, size.second, RPCS3MainWin->GetAppIcon());
|
|
#endif
|
|
default: fmt::throw_exception("Invalid video renderer: %s" HERE, type);
|
|
}
|
|
};
|
|
|
|
callbacks.get_gs_render = []() -> std::shared_ptr<GSRender>
|
|
{
|
|
switch (video_renderer type = g_cfg.video.renderer)
|
|
{
|
|
case video_renderer::null: return std::make_shared<NullGSRender>();
|
|
case video_renderer::opengl: return std::make_shared<GLGSRender>();
|
|
#if defined(_WIN32) || defined(__linux__)
|
|
case video_renderer::vulkan: return std::make_shared<VKGSRender>();
|
|
#endif
|
|
#ifdef _MSC_VER
|
|
case video_renderer::dx12: return std::make_shared<D3D12GSRender>();
|
|
#endif
|
|
default: fmt::throw_exception("Invalid video renderer: %s" HERE, type);
|
|
}
|
|
};
|
|
|
|
callbacks.get_audio = []() -> std::shared_ptr<AudioThread>
|
|
{
|
|
switch (audio_renderer type = g_cfg.audio.renderer)
|
|
{
|
|
case audio_renderer::null: return std::make_shared<NullAudioThread>();
|
|
#ifdef _WIN32
|
|
case audio_renderer::xaudio: return std::make_shared<XAudio2Thread>();
|
|
#elif __linux__
|
|
case audio_renderer::alsa: return std::make_shared<ALSAThread>();
|
|
#endif
|
|
case audio_renderer::openal: return std::make_shared<OpenALThread>();
|
|
default: fmt::throw_exception("Invalid audio renderer: %s" HERE, type);
|
|
}
|
|
};
|
|
|
|
callbacks.get_msg_dialog = [=]() -> std::shared_ptr<MsgDialogBase>
|
|
{
|
|
return std::make_shared<msg_dialog_frame>(RPCS3MainWin->windowHandle());
|
|
};
|
|
|
|
callbacks.get_save_dialog = [=]() -> std::unique_ptr<SaveDialogBase>
|
|
{
|
|
return std::make_unique<save_data_dialog>();
|
|
};
|
|
|
|
callbacks.on_run = [=]() { emit OnEmulatorRun(); };
|
|
callbacks.on_pause = [=]() {emit OnEmulatorPause(); };
|
|
callbacks.on_resume = [=]() {emit OnEmulatorResume(); };
|
|
callbacks.on_stop = [=]() {emit OnEmulatorStop(); };
|
|
callbacks.on_ready = [=]() {emit OnEmulatorReady(); };
|
|
|
|
Emu.SetCallbacks(std::move(callbacks));
|
|
}
|
|
|
|
/*
|
|
* Initialize connects here. These are used to connect things between UI elements that require the intervention of rpcs3_app.
|
|
*/
|
|
void rpcs3_app::InitializeConnects()
|
|
{
|
|
connect(RPCS3MainWin, &main_window::RequestGlobalStylesheetChange, this, &rpcs3_app::OnChangeStyleSheetRequest);
|
|
|
|
qRegisterMetaType <std::function<void()>>("std::function<void()>");
|
|
connect(this, &rpcs3_app::RequestCallAfter, this, &rpcs3_app::HandleCallAfter);
|
|
|
|
connect(this, &rpcs3_app::OnEmulatorRun, RPCS3MainWin, &main_window::OnEmuRun);
|
|
connect(this, &rpcs3_app::OnEmulatorStop, this, &rpcs3_app::ResetPads);
|
|
connect(this, &rpcs3_app::OnEmulatorStop, RPCS3MainWin, &main_window::OnEmuStop);
|
|
connect(this, &rpcs3_app::OnEmulatorPause, RPCS3MainWin, &main_window::OnEmuPause);
|
|
connect(this, &rpcs3_app::OnEmulatorResume, RPCS3MainWin, &main_window::OnEmuResume);
|
|
connect(this, &rpcs3_app::OnEmulatorReady, RPCS3MainWin, &main_window::OnEmuReady);
|
|
}
|
|
|
|
/*
|
|
* Handle a request to change the stylesheet. May consider adding reporting of errors in future.
|
|
* Empty string means default.
|
|
*/
|
|
void rpcs3_app::OnChangeStyleSheetRequest(const QString& sheetFilePath)
|
|
{
|
|
QFile file(sheetFilePath);
|
|
if (sheetFilePath == "")
|
|
{
|
|
setStyleSheet("");
|
|
}
|
|
else if (file.open(QIODevice::ReadOnly | QIODevice::Text))
|
|
{
|
|
setStyleSheet(file.readAll());
|
|
file.close();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Using connects avoids timers being unable to be used in a non-qt thread. So, even if this looks stupid to just call func, it's succinct.
|
|
*/
|
|
void rpcs3_app::HandleCallAfter(const std::function<void()>& func)
|
|
{
|
|
func();
|
|
}
|
|
|
|
/**
|
|
* We need to make this in the main thread to receive events from the main thread.
|
|
* This leads to the tricky situation. Creating it while booting leads to deadlock with a blocking connection.
|
|
* So, I need to make them before, but when?
|
|
* I opted to reset them when the Emu stops and on first init. Potentially a race condition on restart? Never encountered issues.
|
|
* The other tricky issue is that I don't want Init to be called twice on the same object. Reseting the pointer on emu stop should handle this as well!
|
|
*/
|
|
void rpcs3_app::ResetPads()
|
|
{
|
|
m_basicKeyboardHandler.reset(new basic_keyboard_handler(this, this));
|
|
m_basicMouseHandler.reset(new basic_mouse_handler(this, this));
|
|
m_keyboardPadHandler.reset(new keyboard_pad_handler(this, this));
|
|
}
|