mmu: fix macos crash. only flush user mem in address lut
force rtt2vram for JSR (custom graffiti) clean up vmem32 remains missing host_context.h change gh action: build sdl from source on macos
This commit is contained in:
parent
a56f45af98
commit
3a1ae0db00
|
@ -19,7 +19,10 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Set up build environment (macos-latest)
|
- name: Set up build environment (macos-latest)
|
||||||
run: |
|
run: |
|
||||||
brew install ccache flac libao libomp pulseaudio sdl2 zlib
|
brew install ccache flac libao libomp pulseaudio zlib
|
||||||
|
cd shell/apple
|
||||||
|
mkdir artifacts
|
||||||
|
brew install --build-from-source ./sdl2.rb
|
||||||
echo "/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
|
echo "/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
|
||||||
echo "CCACHE_DIR=/tmp/ccache" >> $GITHUB_ENV
|
echo "CCACHE_DIR=/tmp/ccache" >> $GITHUB_ENV
|
||||||
if: matrix.config.os == 'macos-latest'
|
if: matrix.config.os == 'macos-latest'
|
||||||
|
|
|
@ -25,7 +25,6 @@ namespace config {
|
||||||
Option<bool> DynarecEnabled("Dynarec.Enabled", true);
|
Option<bool> DynarecEnabled("Dynarec.Enabled", true);
|
||||||
Option<bool> DynarecIdleSkip("Dynarec.idleskip", true);
|
Option<bool> DynarecIdleSkip("Dynarec.idleskip", true);
|
||||||
Option<bool> DynarecSafeMode("Dynarec.safe-mode");
|
Option<bool> DynarecSafeMode("Dynarec.safe-mode");
|
||||||
Option<bool> DisableVmem32("Dynarec.DisableVmem32");
|
|
||||||
|
|
||||||
// General
|
// General
|
||||||
|
|
||||||
|
|
|
@ -288,7 +288,6 @@ public:
|
||||||
extern Option<bool> DynarecEnabled;
|
extern Option<bool> DynarecEnabled;
|
||||||
extern Option<bool> DynarecIdleSkip;
|
extern Option<bool> DynarecIdleSkip;
|
||||||
extern Option<bool> DynarecSafeMode;
|
extern Option<bool> DynarecSafeMode;
|
||||||
extern Option<bool> DisableVmem32;
|
|
||||||
|
|
||||||
// General
|
// General
|
||||||
|
|
||||||
|
|
|
@ -529,6 +529,9 @@ void MMU_init()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mmu_set_state();
|
mmu_set_state();
|
||||||
|
// pre-fill kernel memory
|
||||||
|
for (int vpn = ARRAY_SIZE(mmuAddressLUT) / 2; vpn < ARRAY_SIZE(mmuAddressLUT); vpn++)
|
||||||
|
mmuAddressLUT[vpn] = vpn << 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -126,11 +126,11 @@ extern u32 mmuAddressLUT[0x100000];
|
||||||
|
|
||||||
static inline void mmuAddressLUTFlush(bool full) {
|
static inline void mmuAddressLUTFlush(bool full) {
|
||||||
if (full)
|
if (full)
|
||||||
memset(mmuAddressLUT, 0, sizeof(mmuAddressLUT));
|
memset(mmuAddressLUT, 0, sizeof(mmuAddressLUT) / 2); // flush user memory
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
constexpr u32 slotPages = (32 * 1024 * 1024) >> 12;
|
constexpr u32 slotPages = (32 * 1024 * 1024) >> 12;
|
||||||
memset(mmuAddressLUT, 0, slotPages * sizeof(u32)); // flush slot 0
|
memset(mmuAddressLUT, 0, slotPages * sizeof(u32)); // flush slot 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,7 +152,8 @@ static inline u32 mmuDynarecLookup(u32 vaddr, u32 write, u32 pc)
|
||||||
// not reached
|
// not reached
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
mmuAddressLUT[vaddr >> 12] = paddr & ~0xfff;
|
if (vaddr >> 31 == 0)
|
||||||
|
mmuAddressLUT[vaddr >> 12] = paddr & ~0xfff;
|
||||||
|
|
||||||
return paddr;
|
return paddr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,7 +128,13 @@ static void LoadSpecialSettings()
|
||||||
// Tom Clancy's Rainbow Six (US)
|
// Tom Clancy's Rainbow Six (US)
|
||||||
|| prod_id == "T40401N"
|
|| prod_id == "T40401N"
|
||||||
// Tom Clancy's Rainbow Six incl. Eagle Watch Missions (EU)
|
// Tom Clancy's Rainbow Six incl. Eagle Watch Missions (EU)
|
||||||
|| prod_id == "T-45001D05")
|
|| prod_id == "T-45001D05"
|
||||||
|
// Jet Grind Radio (US)
|
||||||
|
|| prod_id == "MK-51058"
|
||||||
|
// JSR (JP)
|
||||||
|
|| prod_id == "HDR-0078"
|
||||||
|
// JSR (EU)
|
||||||
|
|| prod_id == "MK-5105850")
|
||||||
{
|
{
|
||||||
INFO_LOG(BOOT, "Enabling render to texture buffer for game %s", prod_id.c_str());
|
INFO_LOG(BOOT, "Enabling render to texture buffer for game %s", prod_id.c_str());
|
||||||
config::RenderToTextureBuffer.override(true);
|
config::RenderToTextureBuffer.override(true);
|
||||||
|
@ -157,40 +163,7 @@ static void LoadSpecialSettings()
|
||||||
INFO_LOG(BOOT, "Enabling Extra depth scaling for game %s", prod_id.c_str());
|
INFO_LOG(BOOT, "Enabling Extra depth scaling for game %s", prod_id.c_str());
|
||||||
config::ExtraDepthScale.override(1e26f);
|
config::ExtraDepthScale.override(1e26f);
|
||||||
}
|
}
|
||||||
// Super Producers
|
|
||||||
if (prod_id == "T14303M"
|
|
||||||
// Giant Killers
|
|
||||||
|| prod_id == "T45401D 50"
|
|
||||||
// Wild Metal (US)
|
|
||||||
|| prod_id == "T42101N 00"
|
|
||||||
// Wild Metal (EU)
|
|
||||||
|| prod_id == "T40501D-50"
|
|
||||||
// Resident Evil 2 (US)
|
|
||||||
|| prod_id == "T1205N"
|
|
||||||
// Resident Evil 2 (EU)
|
|
||||||
|| prod_id == "T7004D 50"
|
|
||||||
// Rune Jade
|
|
||||||
|| prod_id == "T14304M"
|
|
||||||
// Marionette Company
|
|
||||||
|| prod_id == "T5202M"
|
|
||||||
// Marionette Company 2
|
|
||||||
|| prod_id == "T5203M"
|
|
||||||
// Maximum Pool (for online support)
|
|
||||||
|| prod_id == "T11010N"
|
|
||||||
// StarLancer (US) (for online support)
|
|
||||||
|| prod_id == "T40209N"
|
|
||||||
// StarLancer (EU) (for online support)
|
|
||||||
|| prod_id == "T17723D 05"
|
|
||||||
// Heroes of might and magic III
|
|
||||||
|| prod_id == "T0000M"
|
|
||||||
// WebTV
|
|
||||||
|| prod_id == "6107117" || prod_id == "610-7390" || prod_id == "610-7391"
|
|
||||||
// PBA
|
|
||||||
|| prod_id == "T26702N")
|
|
||||||
{
|
|
||||||
INFO_LOG(BOOT, "Disabling 32-bit virtual memory for game %s", prod_id.c_str());
|
|
||||||
config::DisableVmem32.override(true);
|
|
||||||
}
|
|
||||||
std::string areas(ip_meta.area_symbols, sizeof(ip_meta.area_symbols));
|
std::string areas(ip_meta.area_symbols, sizeof(ip_meta.area_symbols));
|
||||||
bool region_usa = areas.find('U') != std::string::npos;
|
bool region_usa = areas.find('U') != std::string::npos;
|
||||||
bool region_eu = areas.find('E') != std::string::npos;
|
bool region_eu = areas.find('E') != std::string::npos;
|
||||||
|
@ -940,9 +913,7 @@ void dc_loadstate()
|
||||||
#if FEAT_AREC == DYNAREC_JIT
|
#if FEAT_AREC == DYNAREC_JIT
|
||||||
aicaarm::recompiler::flush();
|
aicaarm::recompiler::flush();
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_MMU
|
|
||||||
mmu_flush_table();
|
mmu_flush_table();
|
||||||
#endif
|
|
||||||
#if FEAT_SHREC != DYNAREC_NONE
|
#if FEAT_SHREC != DYNAREC_NONE
|
||||||
bm_Reset();
|
bm_Reset();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -20,8 +20,5 @@ struct host_context_t {
|
||||||
#endif
|
#endif
|
||||||
#elif HOST_CPU == CPU_ARM
|
#elif HOST_CPU == CPU_ARM
|
||||||
u32 reg[15];
|
u32 reg[15];
|
||||||
#elif HOST_CPU == CPU_ARM64
|
|
||||||
u64 sp;
|
|
||||||
u64 x2;
|
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
|
@ -775,7 +775,15 @@ private:
|
||||||
|
|
||||||
mov(eax, call_regs[0]);
|
mov(eax, call_regs[0]);
|
||||||
shr(eax, 12);
|
shr(eax, 12);
|
||||||
mov(eax, dword[(uintptr_t)mmuAddressLUT + rax * 4]);
|
if ((uintptr_t)mmuAddressLUT >> 32 != 0)
|
||||||
|
{
|
||||||
|
mov(r9, (uintptr_t)mmuAddressLUT);
|
||||||
|
mov(eax, dword[r9 + rax * 4]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mov(eax, dword[(uintptr_t)mmuAddressLUT + rax * 4]);
|
||||||
|
}
|
||||||
test(eax, eax);
|
test(eax, eax);
|
||||||
jne(inCache);
|
jne(inCache);
|
||||||
mov(call_regs[1], write);
|
mov(call_regs[1], write);
|
||||||
|
|
Loading…
Reference in New Issue