mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-14 10:48:28 +12:00
Initial macOS port bringup (#52)
This commit is contained in:
parent
a2abffd37b
commit
974edaa649
84 changed files with 157 additions and 122 deletions
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include "Cafe/OS/libs/coreinit/coreinit.h"
|
||||
|
||||
#if BOOST_OS_WINDOWS > 0
|
||||
#if BOOST_OS_WINDOWS
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
|
@ -158,7 +158,7 @@ void debugger_updateMemoryBreakpoint(DebuggerBreakpoint* bp)
|
|||
{
|
||||
std::vector<std::thread::native_handle_type> schedulerThreadHandles = coreinit::OSGetSchedulerThreads();
|
||||
|
||||
#if BOOST_OS_WINDOWS > 0
|
||||
#if BOOST_OS_WINDOWS
|
||||
debuggerState.activeMemoryBreakpoint = bp;
|
||||
for (auto& hThreadNH : schedulerThreadHandles)
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "util/helpers/fspinlock.h"
|
||||
#include "util/highresolutiontimer/HighResolutionTimer.h"
|
||||
|
||||
#if BOOST_OS_LINUX > 0
|
||||
#if BOOST_OS_LINUX || BOOST_OS_MACOS
|
||||
static __inline__
|
||||
unsigned __int64 _umul128(unsigned __int64,
|
||||
unsigned __int64,
|
||||
|
@ -113,7 +113,7 @@ uint64 PPCTimer_microsecondsToTsc(uint64 us)
|
|||
uint64 PPCTimer_tscToMicroseconds(uint64 us)
|
||||
{
|
||||
uint128_t r{};
|
||||
#if BOOST_OS_WINDOWS > 0
|
||||
#if BOOST_OS_WINDOWS
|
||||
r.low = _umul128(us, 1000000ULL, &r.high);
|
||||
#else
|
||||
r.low = _umul128(us, 1000000ULL, (unsigned long long*)&r.high);
|
||||
|
@ -153,7 +153,7 @@ uint64 PPCTimer_getFromRDTSC()
|
|||
rdtscDif = rdtscDif & ~(uint64)((sint64)rdtscDif >> 63);
|
||||
|
||||
uint128_t diff{};
|
||||
#if BOOST_OS_WINDOWS > 0
|
||||
#if BOOST_OS_WINDOWS
|
||||
diff.low = _umul128(rdtscDif, Espresso::CORE_CLOCK, &diff.high);
|
||||
#else
|
||||
diff.low = _umul128(rdtscDif, Espresso::CORE_CLOCK, (unsigned long long*)&diff.high);
|
||||
|
@ -163,7 +163,7 @@ uint64 PPCTimer_getFromRDTSC()
|
|||
_rdtscLastMeasure = rdtscCurrentMeasure; // only travel forward in time
|
||||
|
||||
uint8 c = 0;
|
||||
#if BOOST_OS_WINDOWS > 0
|
||||
#if BOOST_OS_WINDOWS
|
||||
c = _addcarry_u64(c, _rdtscAcc.low, diff.low, &_rdtscAcc.low);
|
||||
_addcarry_u64(c, _rdtscAcc.high, diff.high, &_rdtscAcc.high);
|
||||
#else
|
||||
|
|
|
@ -72,7 +72,7 @@ void PPCRecompiler_recompileIfUnvisited(uint32 enterAddress)
|
|||
|
||||
void PPCRecompiler_enter(PPCInterpreter_t* hCPU, PPCREC_JUMP_ENTRY funcPtr)
|
||||
{
|
||||
#if BOOST_OS_WINDOWS > 0
|
||||
#if BOOST_OS_WINDOWS
|
||||
uint32 prevState = _controlfp(0, 0);
|
||||
_controlfp(_RC_NEAR, _MCW_RC);
|
||||
PPCRecompiler_enterRecompilerCode((uint64)funcPtr, (uint64)hCPU);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue