mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 15:19:42 -06:00
Allow disabling memory card writes in netplay.
Fixes issue 6217.
This commit is contained in:

committed by
Rachel Bryk

parent
5f32febcf3
commit
c7abf7e8d2
@ -46,7 +46,7 @@ SCoreStartupParameter::SCoreStartupParameter()
|
|||||||
bCPUThread(true), bDSPThread(false), bDSPHLE(true),
|
bCPUThread(true), bDSPThread(false), bDSPHLE(true),
|
||||||
bSkipIdle(true), bNTSC(false), bForceNTSCJ(false),
|
bSkipIdle(true), bNTSC(false), bForceNTSCJ(false),
|
||||||
bHLE_BS2(true), bEnableCheats(false),
|
bHLE_BS2(true), bEnableCheats(false),
|
||||||
bMergeBlocks(false),
|
bMergeBlocks(false), bEnableMemcardSaving(true),
|
||||||
bDPL2Decoder(false), iLatency(14),
|
bDPL2Decoder(false), iLatency(14),
|
||||||
bRunCompareServer(false), bRunCompareClient(false),
|
bRunCompareServer(false), bRunCompareClient(false),
|
||||||
bMMU(false), bDCBZOFF(false), iTLBHack(0), bVBeam(false),
|
bMMU(false), bDCBZOFF(false), iTLBHack(0), bVBeam(false),
|
||||||
@ -81,6 +81,7 @@ void SCoreStartupParameter::LoadDefaults()
|
|||||||
bSyncGPU = false;
|
bSyncGPU = false;
|
||||||
bFastDiscSpeed = false;
|
bFastDiscSpeed = false;
|
||||||
bMergeBlocks = false;
|
bMergeBlocks = false;
|
||||||
|
bEnableMemcardSaving = true;
|
||||||
SelectedLanguage = 0;
|
SelectedLanguage = 0;
|
||||||
bWii = false;
|
bWii = false;
|
||||||
bDPL2Decoder = false;
|
bDPL2Decoder = false;
|
||||||
|
@ -105,6 +105,7 @@ struct SCoreStartupParameter
|
|||||||
bool bHLE_BS2;
|
bool bHLE_BS2;
|
||||||
bool bEnableCheats;
|
bool bEnableCheats;
|
||||||
bool bMergeBlocks;
|
bool bMergeBlocks;
|
||||||
|
bool bEnableMemcardSaving;
|
||||||
|
|
||||||
bool bDPL2Decoder;
|
bool bDPL2Decoder;
|
||||||
int iLatency;
|
int iLatency;
|
||||||
|
@ -150,6 +150,9 @@ void CEXIMemoryCard::Flush(bool exiting)
|
|||||||
if(!m_bDirty)
|
if(!m_bDirty)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!Core::g_CoreStartupParameter.bEnableMemcardSaving)
|
||||||
|
return;
|
||||||
|
|
||||||
if (flushThread.joinable())
|
if (flushThread.joinable())
|
||||||
{
|
{
|
||||||
flushThread.join();
|
flushThread.join();
|
||||||
|
@ -271,6 +271,16 @@ bool NetPlay::StopGame()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NetPlay::SetMemcardWriteEnabled(bool enabled)
|
||||||
|
{
|
||||||
|
std::lock_guard<std::recursive_mutex> lkg(m_crit.game);
|
||||||
|
|
||||||
|
if (m_is_running)
|
||||||
|
{
|
||||||
|
Core::g_CoreStartupParameter.bEnableMemcardSaving = enabled;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// called from ---CPU--- thread
|
// called from ---CPU--- thread
|
||||||
u8 NetPlay::GetPadNum(u8 numPAD)
|
u8 NetPlay::GetPadNum(u8 numPAD)
|
||||||
{
|
{
|
||||||
|
@ -111,6 +111,7 @@ public:
|
|||||||
virtual bool StartGame(const std::string &path);
|
virtual bool StartGame(const std::string &path);
|
||||||
virtual bool StopGame();
|
virtual bool StopGame();
|
||||||
|
|
||||||
|
virtual void SetMemcardWriteEnabled(bool enabled);
|
||||||
//void PushPadStates(unsigned int count);
|
//void PushPadStates(unsigned int count);
|
||||||
|
|
||||||
u8 GetPadNum(u8 numPAD);
|
u8 GetPadNum(u8 numPAD);
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "NetPlay.h"
|
#include "NetPlay.h"
|
||||||
#include "NetWindow.h"
|
#include "NetWindow.h"
|
||||||
#include "Frame.h"
|
#include "Frame.h"
|
||||||
|
#include "Core.h"
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -333,6 +334,9 @@ NetPlayDiag::NetPlayDiag(wxWindow* const parent, const CGameListCtrl* const game
|
|||||||
padbuf_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NetPlayDiag::OnPadBuffHelp, this);
|
padbuf_btn->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NetPlayDiag::OnPadBuffHelp, this);
|
||||||
bottom_szr->Add(padbuf_spin, 0, wxCENTER);
|
bottom_szr->Add(padbuf_spin, 0, wxCENTER);
|
||||||
bottom_szr->Add(padbuf_btn);
|
bottom_szr->Add(padbuf_btn);
|
||||||
|
m_memcard_write = new wxCheckBox(panel, wxID_ANY, _("Write memcards (GC)"));
|
||||||
|
m_memcard_write->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &NetPlayDiag::OnMemcardWriteCheck, this);
|
||||||
|
bottom_szr->Add(m_memcard_write, 0, wxCENTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
bottom_szr->AddStretchSpacer(1);
|
bottom_szr->AddStretchSpacer(1);
|
||||||
@ -397,6 +401,8 @@ void NetPlayDiag::OnStop(wxCommandEvent&)
|
|||||||
void NetPlayDiag::BootGame(const std::string& filename)
|
void NetPlayDiag::BootGame(const std::string& filename)
|
||||||
{
|
{
|
||||||
main_frame->BootGame(filename);
|
main_frame->BootGame(filename);
|
||||||
|
|
||||||
|
Core::g_CoreStartupParameter.bEnableMemcardSaving = m_memcard_write->GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetPlayDiag::StopGame()
|
void NetPlayDiag::StopGame()
|
||||||
@ -449,6 +455,11 @@ void NetPlayDiag::OnPadBuffHelp(wxCommandEvent&)
|
|||||||
m_chat_text->AppendText(StrToWxStr(ss.str()));
|
m_chat_text->AppendText(StrToWxStr(ss.str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NetPlayDiag::OnMemcardWriteCheck(wxCommandEvent &event)
|
||||||
|
{
|
||||||
|
netplay_ptr->SetMemcardWriteEnabled(m_memcard_write->GetValue());
|
||||||
|
}
|
||||||
|
|
||||||
void NetPlayDiag::OnAdjustBuffer(wxCommandEvent& event)
|
void NetPlayDiag::OnAdjustBuffer(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
const int val = ((wxSpinCtrl*)event.GetEventObject())->GetValue();
|
const int val = ((wxSpinCtrl*)event.GetEventObject())->GetValue();
|
||||||
|
@ -96,6 +96,7 @@ private:
|
|||||||
void OnChat(wxCommandEvent& event);
|
void OnChat(wxCommandEvent& event);
|
||||||
void OnQuit(wxCommandEvent& event);
|
void OnQuit(wxCommandEvent& event);
|
||||||
void OnPadBuffHelp(wxCommandEvent& event);
|
void OnPadBuffHelp(wxCommandEvent& event);
|
||||||
|
void OnMemcardWriteCheck(wxCommandEvent& event);
|
||||||
void OnThread(wxCommandEvent& event);
|
void OnThread(wxCommandEvent& event);
|
||||||
void OnChangeGame(wxCommandEvent& event);
|
void OnChangeGame(wxCommandEvent& event);
|
||||||
void OnAdjustBuffer(wxCommandEvent& event);
|
void OnAdjustBuffer(wxCommandEvent& event);
|
||||||
@ -104,6 +105,7 @@ private:
|
|||||||
wxListBox* m_player_lbox;
|
wxListBox* m_player_lbox;
|
||||||
wxTextCtrl* m_chat_text;
|
wxTextCtrl* m_chat_text;
|
||||||
wxTextCtrl* m_chat_msg_text;
|
wxTextCtrl* m_chat_msg_text;
|
||||||
|
wxCheckBox* m_memcard_write;
|
||||||
|
|
||||||
std::string m_selected_game;
|
std::string m_selected_game;
|
||||||
wxButton* m_game_btn;
|
wxButton* m_game_btn;
|
||||||
|
Reference in New Issue
Block a user