Added swapdisc function, tested with TOS switching from disc 2 to disc 1. minor memcard manager cleanup

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1628 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
LPFaint99 2008-12-23 07:20:22 +00:00
parent 5510c207e6
commit b56f7a4682
5 changed files with 46 additions and 7 deletions

View File

@ -27,6 +27,7 @@
#include "Thread.h" #include "Thread.h"
#include "../VolumeHandler.h" #include "../VolumeHandler.h"
#include "VolumeCreator.h" // DiscIO
namespace DVDInterface namespace DVDInterface
{ {
@ -220,7 +221,21 @@ void SetDiscInside(bool _DiscInside)
{ {
g_bDiscInside = _DiscInside; g_bDiscInside = _DiscInside;
} }
void SwapDisc(const char * fileName)
{
dvdMem.CoverReg.CVRINT = 1;
dvdMem.CoverReg.CVRINTMASK = 1;
dvdMem.CoverReg.CVR = 1;
UpdateInterrupts();
// I don't think this is needed, but I am not certain
//DiscIO::IVolume* pVolume = DiscIO::CreateVolumeFromFilename("F:/Documents/Games/GameCube/GCM/Super Monkey Ball 2.gcm");
VolumeHandler::SetVolumeName(fileName);
DVDInterface::SetDiscInside(VolumeHandler::IsValid());
dvdMem.CoverReg.CVRINT = 0;
dvdMem.CoverReg.CVRINTMASK = 0;
dvdMem.CoverReg.CVR = 0;
UpdateInterrupts();
}
void SetLidOpen(bool _bOpen) void SetLidOpen(bool _bOpen)
{ {
if (_bOpen) if (_bOpen)

View File

@ -29,6 +29,7 @@ void Shutdown();
void DoState(PointerWrap &p); void DoState(PointerWrap &p);
void SetDiscInside(bool _DiscInside); void SetDiscInside(bool _DiscInside);
void SwapDisc(const char * fileName);
// Lid Functions // Lid Functions
void SetLidOpen(bool open); void SetLidOpen(bool open);

View File

@ -98,6 +98,7 @@ EVT_MENU(IDM_CONFIG_WIIMOTE_PLUGIN, CFrame::OnPluginWiimote)
EVT_MENU(IDM_BROWSE, CFrame::OnBrowse) EVT_MENU(IDM_BROWSE, CFrame::OnBrowse)
EVT_MENU(IDM_MEMCARD, CFrame::OnMemcard) EVT_MENU(IDM_MEMCARD, CFrame::OnMemcard)
EVT_MENU(IDM_CHEATS, CFrame::OnShow_CheatsWindow) EVT_MENU(IDM_CHEATS, CFrame::OnShow_CheatsWindow)
EVT_MENU(IDM_SWAPDISC, CFrame::OnSwapDisc)
EVT_MENU(IDM_TOGGLECOVER, CFrame::OnSwapDisc) EVT_MENU(IDM_TOGGLECOVER, CFrame::OnSwapDisc)
EVT_MENU(IDM_TOGGLE_FULLSCREEN, CFrame::OnToggleFullscreen) EVT_MENU(IDM_TOGGLE_FULLSCREEN, CFrame::OnToggleFullscreen)
EVT_MENU(IDM_TOGGLE_DUALCORE, CFrame::OnToggleDualCore) EVT_MENU(IDM_TOGGLE_DUALCORE, CFrame::OnToggleDualCore)
@ -250,7 +251,8 @@ void CFrame::CreateMenu()
miscMenu->AppendSeparator(); miscMenu->AppendSeparator();
miscMenu->Append(IDM_MEMCARD, _T("&Memcard manager")); miscMenu->Append(IDM_MEMCARD, _T("&Memcard manager"));
miscMenu->Append(IDM_CHEATS, _T("Action &Replay Manager")); miscMenu->Append(IDM_CHEATS, _T("Action &Replay Manager"));
miscMenu->Append(IDM_TOGGLECOVER, _T("Toggle DVD co&ver is open")); miscMenu->Append(IDM_SWAPDISC, _T("S&wap Disc"));
//miscMenu->Append(IDM_TOGGLECOVER, _T("Toggle DVD co&ver is open"));
m_pMenuBar->Append(miscMenu, _T("&Misc")); m_pMenuBar->Append(miscMenu, _T("&Misc"));
// help menu // help menu
@ -681,7 +683,27 @@ void CFrame::UpdateGUI()
} }
} }
void CFrame::OnSwapDisc(wxCommandEvent& WXUNUSED (event)) void CFrame::OnSwapDisc(wxCommandEvent& event)
{ {
switch (event.GetId())
{
case IDM_SWAPDISC:
{
wxString path = wxFileSelector(
_T("Select the Disc to swap"),
wxEmptyString, wxEmptyString, wxEmptyString,
wxString::Format
(
_T("All GC/Wii files (elf, dol, gcm, iso)|*.elf;*.dol;*.gcm;*.iso;*.gcz|All files (%s)|%s"),
wxFileSelectorDefaultWildcardStr,
wxFileSelectorDefaultWildcardStr
),
wxFD_OPEN | wxFD_PREVIEW | wxFD_FILE_MUST_EXIST,
this);
SwapDisc(path.c_str());
break;
}
default:
SetLidOpen(!IsLidOpen()); SetLidOpen(!IsLidOpen());
} }
}

View File

@ -48,6 +48,7 @@ enum
IDM_BROWSE, IDM_BROWSE,
IDM_MEMCARD, IDM_MEMCARD,
IDM_CHEATS, IDM_CHEATS,
IDM_SWAPDISC,
IDM_TOGGLECOVER, IDM_TOGGLECOVER,
IDM_PROPERTIES, IDM_PROPERTIES,
IDM_OPENCONTAININGFOLDER, IDM_OPENCONTAININGFOLDER,

View File

@ -283,7 +283,7 @@ void CMemcardManager::CreateGUIControls()
if (strcasecmp(DefaultMemcard[i].c_str(), ".")) if (strcasecmp(DefaultMemcard[i].c_str(), "."))
{ {
m_MemcardPath[i]->SetPath(wxString::FromAscii(DefaultMemcard[i].c_str())); m_MemcardPath[i]->SetPath(wxString::FromAscii(DefaultMemcard[i].c_str()));
i?ChangePath(ID_MEMCARDPATH_B):ChangePath(ID_MEMCARDPATH_A); ChangePath(ID_MEMCARDPATH_A + i);
} }
} }
} }