mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Add support for recording bongos.
This commit is contained in:
@ -273,7 +273,7 @@ void Init()
|
|||||||
g_Channel[i].m_InLo.Hex = 0;
|
g_Channel[i].m_InLo.Hex = 0;
|
||||||
|
|
||||||
if (Movie::IsRecordingInput() || Movie::IsPlayingInput())
|
if (Movie::IsRecordingInput() || Movie::IsPlayingInput())
|
||||||
AddDevice(Movie::IsUsingPad(i) ? SIDEVICE_GC_CONTROLLER : SIDEVICE_NONE, i);
|
AddDevice(Movie::IsUsingPad(i) ? (Movie::IsUsingBongo(i) ? SIDEVICE_GC_TARUKONGA : SIDEVICE_GC_CONTROLLER) : SIDEVICE_NONE, i);
|
||||||
else
|
else
|
||||||
AddDevice(SConfig::GetInstance().m_SIDevice[i], i);
|
AddDevice(SConfig::GetInstance().m_SIDevice[i], i);
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ std::string g_discChange = "";
|
|||||||
std::string author = "";
|
std::string author = "";
|
||||||
u64 g_titleID = 0;
|
u64 g_titleID = 0;
|
||||||
unsigned char MD5[16];
|
unsigned char MD5[16];
|
||||||
|
u8 bongos;
|
||||||
|
|
||||||
bool g_bRecordingFromSaveState = false;
|
bool g_bRecordingFromSaveState = false;
|
||||||
bool g_bPolled = false;
|
bool g_bPolled = false;
|
||||||
@ -109,7 +110,7 @@ std::string GetInputDisplay()
|
|||||||
g_numPads = 0;
|
g_numPads = 0;
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
if (SConfig::GetInstance().m_SIDevice[i] == SIDEVICE_GC_CONTROLLER)
|
if (SConfig::GetInstance().m_SIDevice[i] == SIDEVICE_GC_CONTROLLER || SConfig::GetInstance().m_SIDevice[i] == SIDEVICE_GC_TARUKONGA)
|
||||||
g_numPads |= (1 << i);
|
g_numPads |= (1 << i);
|
||||||
if (g_wiimote_sources[i] != WIIMOTE_SRC_NONE)
|
if (g_wiimote_sources[i] != WIIMOTE_SRC_NONE)
|
||||||
g_numPads |= (1 << (i + 4));
|
g_numPads |= (1 << (i + 4));
|
||||||
@ -311,6 +312,11 @@ bool IsUsingPad(int controller)
|
|||||||
return ((g_numPads & (1 << controller)) != 0);
|
return ((g_numPads & (1 << controller)) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsUsingBongo(int controller)
|
||||||
|
{
|
||||||
|
return ((bongos & (1 << controller)) != 0);
|
||||||
|
}
|
||||||
|
|
||||||
bool IsUsingWiimote(int wiimote)
|
bool IsUsingWiimote(int wiimote)
|
||||||
{
|
{
|
||||||
return ((g_numPads & (1 << (wiimote + 4))) != 0);
|
return ((g_numPads & (1 << (wiimote + 4))) != 0);
|
||||||
@ -368,7 +374,7 @@ void ChangePads(bool instantly)
|
|||||||
int controllers = 0;
|
int controllers = 0;
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
if (SConfig::GetInstance().m_SIDevice[i] == SIDEVICE_GC_CONTROLLER)
|
if (SConfig::GetInstance().m_SIDevice[i] == SIDEVICE_GC_CONTROLLER || SConfig::GetInstance().m_SIDevice[i] == SIDEVICE_GC_TARUKONGA)
|
||||||
controllers |= (1 << i);
|
controllers |= (1 << i);
|
||||||
|
|
||||||
if (instantly && (g_numPads & 0x0F) == controllers)
|
if (instantly && (g_numPads & 0x0F) == controllers)
|
||||||
@ -376,9 +382,9 @@ void ChangePads(bool instantly)
|
|||||||
|
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
if (instantly) // Changes from savestates need to be instantaneous
|
if (instantly) // Changes from savestates need to be instantaneous
|
||||||
SerialInterface::AddDevice(IsUsingPad(i) ? SIDEVICE_GC_CONTROLLER : SIDEVICE_NONE, i);
|
SerialInterface::AddDevice(IsUsingPad(i) ? (IsUsingBongo(i) ? SIDEVICE_GC_TARUKONGA : SIDEVICE_GC_CONTROLLER) : SIDEVICE_NONE, i);
|
||||||
else
|
else
|
||||||
SerialInterface::ChangeDevice(IsUsingPad(i) ? SIDEVICE_GC_CONTROLLER : SIDEVICE_NONE, i);
|
SerialInterface::ChangeDevice(IsUsingPad(i) ? (IsUsingBongo(i) ? SIDEVICE_GC_TARUKONGA : SIDEVICE_GC_CONTROLLER) : SIDEVICE_NONE, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChangeWiiPads(bool instantly)
|
void ChangeWiiPads(bool instantly)
|
||||||
@ -412,6 +418,10 @@ bool BeginRecordingInput(int controllers)
|
|||||||
g_recordingStartTime = Common::Timer::GetLocalTimeSinceJan1970();
|
g_recordingStartTime = Common::Timer::GetLocalTimeSinceJan1970();
|
||||||
g_rerecords = 0;
|
g_rerecords = 0;
|
||||||
|
|
||||||
|
for (int i = 0; i < 4; i++)
|
||||||
|
if (SConfig::GetInstance().m_SIDevice[i] == SIDEVICE_GC_TARUKONGA)
|
||||||
|
bongos |= (1 << i);
|
||||||
|
|
||||||
if (Core::IsRunning())
|
if (Core::IsRunning())
|
||||||
{
|
{
|
||||||
if(File::Exists(tmpStateFilename))
|
if(File::Exists(tmpStateFilename))
|
||||||
@ -676,7 +686,7 @@ void ReadHeader()
|
|||||||
iCPUCore = tmpHeader.CPUCore;
|
iCPUCore = tmpHeader.CPUCore;
|
||||||
g_bClearSave = tmpHeader.bClearSave;
|
g_bClearSave = tmpHeader.bClearSave;
|
||||||
bMemcard = tmpHeader.bMemcard;
|
bMemcard = tmpHeader.bMemcard;
|
||||||
|
bongos = tmpHeader.bongos;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1121,6 +1131,7 @@ void SaveRecording(const char *filename)
|
|||||||
strncpy((char *)header.discChange, g_discChange.c_str(),ARRAYSIZE(header.discChange));
|
strncpy((char *)header.discChange, g_discChange.c_str(),ARRAYSIZE(header.discChange));
|
||||||
strncpy((char *)header.author, author.c_str(),ARRAYSIZE(header.author));
|
strncpy((char *)header.author, author.c_str(),ARRAYSIZE(header.author));
|
||||||
memcpy(header.md5,MD5,16);
|
memcpy(header.md5,MD5,16);
|
||||||
|
header.bongos = bongos;
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
header.uniqueID = 0;
|
header.uniqueID = 0;
|
||||||
|
@ -118,7 +118,8 @@ struct DTMHeader {
|
|||||||
bool bUseRealXFB;
|
bool bUseRealXFB;
|
||||||
bool bMemcard;
|
bool bMemcard;
|
||||||
bool bClearSave; // Create a new memory card when playing back a movie if true
|
bool bClearSave; // Create a new memory card when playing back a movie if true
|
||||||
u8 reserved[16]; // Padding for any new config options
|
u8 bongos;
|
||||||
|
u8 reserved[15]; // Padding for any new config options
|
||||||
u8 discChange[40]; // Name of iso file to switch to, for two disc games.
|
u8 discChange[40]; // Name of iso file to switch to, for two disc games.
|
||||||
u8 reserved2[47]; // Make heading 256 bytes, just because we can
|
u8 reserved2[47]; // Make heading 256 bytes, just because we can
|
||||||
};
|
};
|
||||||
@ -154,6 +155,7 @@ void GetSettings();
|
|||||||
|
|
||||||
bool IsUsingPad(int controller);
|
bool IsUsingPad(int controller);
|
||||||
bool IsUsingWiimote(int wiimote);
|
bool IsUsingWiimote(int wiimote);
|
||||||
|
bool IsUsingBongo(int controller);
|
||||||
void ChangePads(bool instantly = false);
|
void ChangePads(bool instantly = false);
|
||||||
void ChangeWiiPads(bool instantly = false);
|
void ChangeWiiPads(bool instantly = false);
|
||||||
|
|
||||||
|
@ -745,7 +745,7 @@ void CFrame::OnRecord(wxCommandEvent& WXUNUSED (event))
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
if (SConfig::GetInstance().m_SIDevice[i] == SIDEVICE_GC_CONTROLLER)
|
if (SConfig::GetInstance().m_SIDevice[i] == SIDEVICE_GC_CONTROLLER || SConfig::GetInstance().m_SIDevice[i] == SIDEVICE_GC_TARUKONGA)
|
||||||
controllers |= (1 << i);
|
controllers |= (1 << i);
|
||||||
|
|
||||||
if (g_wiimote_sources[i] != WIIMOTE_SRC_NONE)
|
if (g_wiimote_sources[i] != WIIMOTE_SRC_NONE)
|
||||||
|
Reference in New Issue
Block a user