Skip to content

Commit

Permalink
[Android] Fix load game at start
Browse files Browse the repository at this point in the history
  • Loading branch information
zilmar committed Apr 30, 2017
1 parent 26ab7f6 commit 5b8b51a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Android/src/emu/project64/GalleryActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -929,8 +929,8 @@ public void launchGameActivity(boolean ResumeGame)
if (ResumeGame)
{
NativeExports.SettingsSaveDword(SettingsID.Game_CurrentSaveState.getValue(), 0);
NativeExports.ExternalEvent(SystemEvent.SysEvent_LoadMachineState.getValue());
}
NativeExports.SettingsSaveBool(SettingsID.Game_LoadSaveAtStart.getValue(), ResumeGame);
// Launch the game activity
boolean isXperiaPlay = false;

Expand Down
1 change: 1 addition & 0 deletions Android/src/emu/project64/jni/SettingsID.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ public enum SettingsID
Game_CRC_Recalc,
Game_Transferpak_ROM,
Game_Transferpak_Sav,
Game_LoadSaveAtStart,

// General Game running info
GameRunning_LoadingInProgress,
Expand Down
6 changes: 6 additions & 0 deletions Source/Project64-core/N64System/N64Class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ CN64System::CN64System(CPlugins * Plugins, bool SavesReadOnly, bool SyncSystem)
{
m_Recomp = new CRecompiler(m_MMU_VM, m_Reg, m_EndEmulation);
}

if (g_Settings->LoadBool(Game_LoadSaveAtStart))
{
LoadState();
g_Settings->SaveBool(Game_LoadSaveAtStart, false);
}
}

WriteTrace(TraceN64System, TraceDebug, "Done");
Expand Down
1 change: 1 addition & 0 deletions Source/Project64-core/Settings/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ enum SettingID
Game_CRC_Recalc,
Game_Transferpak_ROM,
Game_Transferpak_Sav,
Game_LoadSaveAtStart,

// General Game running info
GameRunning_LoadingInProgress,
Expand Down
1 change: 1 addition & 0 deletions Source/Project64-core/Settings/SettingsClass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
AddHandler(Game_CRC_Recalc, new CSettingTypeGame("CRC-Recalc", Rdb_CRC_Recalc));
AddHandler(Game_Transferpak_ROM, new CSettingTypeGame("Tpak-ROM-dir", Default_None));
AddHandler(Game_Transferpak_Sav, new CSettingTypeGame("Tpak-Sav-dir", Default_None));
AddHandler(Game_LoadSaveAtStart, new CSettingTypeTempBool(false));

//User Interface
AddHandler(UserInterface_ShowCPUPer, new CSettingTypeApplication("", "Display CPU Usage", (uint32_t)false));
Expand Down

0 comments on commit 5b8b51a

Please sign in to comment.