[Project64] Add Reduced Sync Mem option

This commit is contained in:
zilmar 2017-01-04 18:04:37 +11:00
parent b87335957e
commit a367b4792b
9 changed files with 30 additions and 4 deletions

View File

@ -114,6 +114,8 @@
<string name="ForceGfxReset_summary">Always reload GFX plugin</string>
<string name="PreAllocSyncMem_title">Pre Alloc Sync Mem</string>
<string name="PreAllocSyncMem_summary">Allocate sync memory at startup</string>
<string name="ReducedSyncMem_title">Reduced Sync Mem</string>
<string name="ReducedSyncMem_summary">Allocate a smaller amount of memory for sync cpu</string>
<string name="DebugLanguage_title">Debug Language</string>
<string name="DebugLanguage_summary">Show the number id for the language string</string>
<string name="touchscreenScale_title">Button scale</string>

View File

@ -34,6 +34,10 @@
android:key="PreAllocSyncMem"
android:summary="@string/PreAllocSyncMem_summary"
android:title="@string/PreAllocSyncMem_title" />
<CheckBoxPreference
android:key="ReducedSyncMem"
android:summary="@string/ReducedSyncMem_summary"
android:title="@string/ReducedSyncMem_title" />
<CheckBoxPreference
android:key="Debugger_DebugLanguage"
android:summary="@string/DebugLanguage_summary"

View File

@ -599,7 +599,6 @@ public class GalleryActivity extends AppCompatActivity implements IabBroadcastLi
};
final Context finalContext = this;
final Activity finalActivity = this;
AlertDialog.Builder GameMenu = new AlertDialog.Builder(finalContext);
GameMenu.setTitle(NativeExports.SettingsLoadString(SettingsID.Game_GoodName.getValue()));
GameMenu.setAdapter(adapter, new DialogInterface.OnClickListener()
@ -838,6 +837,13 @@ public class GalleryActivity extends AppCompatActivity implements IabBroadcastLi
return false;
}
File InstantSaveDir = new File(NativeExports.SettingsLoadString(SettingsID.Directory_InstantSave.getValue()));
final File GameSaveDir = new File(InstantSaveDir,NativeExports.SettingsLoadString(SettingsID.Game_UniqueSaveDir.getValue()));
if (GameSaveDir.exists() == false)
{
return false;
}
int RunCount = NativeExports.UISettingsLoadDword(UISettingID.SupportWindow_RunCount.getValue());
Log.d("GalleryActivity", "ShowSupportWindow RunCount = " + RunCount);
if (RunCount == -1)

View File

@ -52,6 +52,7 @@ public enum SettingsID
Setting_CurrentLanguage,
Setting_EnableDisk,
Setting_PreAllocSyncMem,
Setting_ReducedSyncMem,
//RDB Settings
Rdb_GoodName,

View File

@ -57,6 +57,7 @@ public class SettingsActivity extends AppCompatActivity implements SharedPrefere
.putString("touchscreenLayout",NativeExports.UISettingsLoadString(UISettingID.TouchScreen_Layout.getValue()))
.putBoolean("audio_Enabled",NativeExports.SettingsLoadBool(SettingsID.Plugin_EnableAudio.getValue()))
.putBoolean("PreAllocSyncMem",NativeExports.SettingsLoadBool(SettingsID.Setting_PreAllocSyncMem.getValue()))
.putBoolean("ReducedSyncMem",NativeExports.SettingsLoadBool(SettingsID.Setting_ReducedSyncMem.getValue()))
.putBoolean("Plugin_ForceGfxReset",NativeExports.SettingsLoadBool(SettingsID.Plugin_ForceGfxReset.getValue()))
.putBoolean("UserInterface_BasicMode",NativeExports.SettingsLoadBool(SettingsID.UserInterface_BasicMode.getValue()))
.putBoolean("Debugger_Enabled",NativeExports.SettingsLoadBool(SettingsID.Debugger_Enabled.getValue()))
@ -142,6 +143,7 @@ public class SettingsActivity extends AppCompatActivity implements SharedPrefere
else if (key.equals("audio_Enabled")) { NativeExports.SettingsSaveBool(SettingsID.Plugin_EnableAudio.getValue(), sharedPreferences.getBoolean(key,false)); }
else if (key.equals("Plugin_ForceGfxReset")) { NativeExports.SettingsSaveBool(SettingsID.Plugin_ForceGfxReset.getValue(), sharedPreferences.getBoolean(key,false)); }
else if (key.equals("PreAllocSyncMem")) { NativeExports.SettingsSaveBool(SettingsID.Setting_PreAllocSyncMem.getValue(), sharedPreferences.getBoolean(key,false)); }
else if (key.equals("ReducedSyncMem")) { NativeExports.SettingsSaveBool(SettingsID.Setting_ReducedSyncMem.getValue(), sharedPreferences.getBoolean(key,false)); }
else if (key.equals("Debugger_Enabled")) { NativeExports.SettingsSaveBool(SettingsID.Debugger_Enabled.getValue(), sharedPreferences.getBoolean(key,false)); }
else if (key.equals("Debugger_RecordRecompilerAsm")) { NativeExports.SettingsSaveBool(SettingsID.Debugger_RecordRecompilerAsm.getValue(), sharedPreferences.getBoolean(key,false)); }
else if (key.equals("Debugger_CpuUsage")) { NativeExports.SettingsSaveBool(SettingsID.UserInterface_ShowCPUPer.getValue(), sharedPreferences.getBoolean(key,false)); }

View File

@ -428,6 +428,12 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context
WriteTrace(TraceExceptionHandler, TraceError, "OpCode32->uint32.rt: %X",OpCode32->uint32.rt);
WriteTrace(TraceExceptionHandler, TraceError, "OpCode32->uint32.opcode2: %X",OpCode32->uint32.opcode2);
WriteTrace(TraceExceptionHandler, TraceError, "OpCode32->uint32.rm: %X",OpCode32->uint32.rm);
for (int count = 0; count < 32; count++)
{
WriteTrace(TraceExceptionHandler, TraceError, "GPR[%s] 0x%08X%08X", CRegName::GPR[count], g_Reg->m_GPR[count].W[1], g_Reg->m_GPR[count].W[0]);
}
Flush_Recompiler_Log();
TraceFlushLog();
g_Notify->BreakPoint(__FILE__, __LINE__);
@ -816,8 +822,11 @@ void CMipsMemoryVM::segv_handler(int signal, siginfo_t *siginfo, void *sigcontex
}
WriteTrace(TraceExceptionHandler, TraceNotice, "REG_EIP = %X", ucontext->uc_mcontext.gregs[REG_EIP]);
uint8_t * TypePos = (uint8_t *)ucontext->uc_mcontext.gregs[REG_EIP];
WriteTrace(TraceExceptionHandler, TraceNotice, "TypePos: %02X %02X %02X %02X %02X %02X %02X %02X %02X", TypePos[0], TypePos[1], TypePos[2], TypePos[3], TypePos[4], TypePos[5], TypePos[6], TypePos[7], TypePos[8]);
WriteTrace(TraceExceptionHandler, TraceNotice, "Data:");
for (uint8_t * TypePos = (uint8_t *)ucontext->uc_mcontext.gregs[REG_EIP] - 0x200; TypePos < (uint8_t *)ucontext->uc_mcontext.gregs[REG_EIP] + 0x30; TypePos += 8)
{
WriteTrace(TraceExceptionHandler, TraceNotice, "%X: %02X %02X %02X %02X %02X %02X %02X %02X", (uint32_t)TypePos, TypePos[0], TypePos[1], TypePos[2], TypePos[3], TypePos[4], TypePos[5], TypePos[6], TypePos[7]);
}
X86_CONTEXT context;
context.Edi = (uint32_t*)&ucontext->uc_mcontext.gregs[REG_EDI];

View File

@ -113,7 +113,7 @@ void CMipsMemoryVM::ReserveMemory()
m_Reserve1 = (uint8_t *)AllocateAddressSpace(0x20000000);
if (g_Settings->LoadBool(Debugger_Enabled) && g_Settings->LoadBool(Setting_PreAllocSyncMem))
{
m_Reserve2 = (uint8_t *)AllocateAddressSpace(0x20000000);
m_Reserve2 = (uint8_t *)AllocateAddressSpace(g_Settings->LoadBool(Setting_ReducedSyncMem) ? 0x04002000 : 0x20000000);
}
}

View File

@ -57,6 +57,7 @@ enum SettingID
Setting_CurrentLanguage,
Setting_EnableDisk,
Setting_PreAllocSyncMem,
Setting_ReducedSyncMem,
//RDB Settings
Rdb_GoodName,

View File

@ -122,6 +122,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Setting_CurrentLanguage, new CSettingTypeApplication("", "Current Language", ""));
AddHandler(Setting_EnableDisk, new CSettingTypeTempBool(false));
AddHandler(Setting_PreAllocSyncMem, new CSettingTypeApplication("", "PreAllocSyncMem", true));
AddHandler(Setting_ReducedSyncMem, new CSettingTypeApplication("", "ReducedSyncMem", false));
AddHandler(Setting_LanguageDirDefault, new CSettingTypeRelativePath("Lang", ""));
AddHandler(Setting_LanguageDir, new CSettingTypeApplicationPath("Lang Directory", "Directory", Setting_LanguageDirDefault));