Skip to content

Commit

Permalink
Merge pull request #908 from kozharskyad/master
Browse files Browse the repository at this point in the history
Fix computing Lightrec base address for macOS.
  • Loading branch information
ZachCook authored Sep 15, 2024
2 parents 12a9895 + fcc2276 commit ca2cfc2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions libretro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ retro_input_state_t dbg_input_state_cb = 0;
#endif
#endif /* HAVE_LIGHTREC */

#if __APPLE__
#include <mach/shared_region.h>
#include <sys/attr.h>
#define MACOS_VM_BASE (SHARED_REGION_BASE+SHARED_REGION_SIZE+ATTR_VOL_RESERVED_SIZE)
#endif

//Fast Save States exclude string labels from variables in the savestate, and are at least 20% faster.
extern "C" {
extern bool FastSaveStates;
Expand Down Expand Up @@ -1669,10 +1675,14 @@ static void SetDiscWrapper(const bool CD_TrayOpen) {
#endif

static const uintptr_t supported_io_bases[] = {
#if !__APPLE__
static_cast<uintptr_t>(0x00000000),
static_cast<uintptr_t>(0x10000000),
static_cast<uintptr_t>(0x20000000),
static_cast<uintptr_t>(0x30000000),
#else
static_cast<uintptr_t>(MACOS_VM_BASE),
#endif
static_cast<uintptr_t>(0x40000000),
static_cast<uintptr_t>(0x50000000),
static_cast<uintptr_t>(0x60000000),
Expand Down

0 comments on commit ca2cfc2

Please sign in to comment.