1. Fixed the unbearable noise in "Resident Evil: Umbrella Chronicles", "Resident Evil: Dark Chronicles", and many other games.

No need to use "Sound Loop Hack", so I just removed it.

2. Fixed the WAD game loading issue. What can I say, I have to go though and patch all the WII_IPC_HLE devices to take care of this.

3. Applied tomman's Linux keyboard patch, but I can't test here, no suitable environment.

4. Disabled configuration dialogs when game is running, you have to pause game first to be able to change any configuration. (Which prevents some accidental crash to happen.)

5. Other trivial fixes, no need to mention.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4632 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
ayuanx 2009-12-01 15:39:37 +00:00
parent 9e17ee5155
commit 4d512ecba7
27 changed files with 163 additions and 135 deletions

View File

@ -108,9 +108,13 @@ void Reset(bool _bHard)
TDeviceMap::iterator itr = g_DeviceMap.begin();
while (itr != g_DeviceMap.end())
{
// Hardware should not be deleted unless it is a hard reset
if (_bHard || !itr->second->IsHardware())
delete itr->second;
if (itr->second)
{
itr->second->Close(NULL, true);
// Hardware should not be deleted unless it is a hard reset
if (_bHard || !itr->second->IsHardware())
delete itr->second;
}
++itr;
}
// Erase invalid device
@ -220,7 +224,8 @@ void DoState(PointerWrap &p)
TFileNameMap::const_iterator itr = g_FileNameMap.begin();
while (itr != g_FileNameMap.end())
{
delete g_DeviceMap[itr->first];
if (g_DeviceMap[itr->first])
delete g_DeviceMap[itr->first];
g_DeviceMap.erase(itr->first);
++itr;
}

View File

@ -45,7 +45,7 @@ public:
u32 GetDeviceID() const { return m_DeviceID; }
virtual bool Open(u32 _CommandAddress, u32 _Mode) { _dbg_assert_msg_(WII_IPC_HLE, 0, "%s is not able to run Open()", m_Name.c_str()); m_Active = true; return true; }
virtual bool Close(u32 _CommandAddress) { _dbg_assert_msg_(WII_IPC_HLE, 0, "%s is not able to run Close()", m_Name.c_str()); m_Active = false; return true; }
virtual bool Close(u32 _CommandAddress, bool _bForce = false) { _dbg_assert_msg_(WII_IPC_HLE, 0, "%s is not able to run Close()", m_Name.c_str()); m_Active = false; return true; }
virtual bool Seek(u32 _CommandAddress) { _dbg_assert_msg_(WII_IPC_HLE, 0, "%s is not able to run Seek()", m_Name.c_str()); return true; }
virtual bool Read(u32 _CommandAddress) { _dbg_assert_msg_(WII_IPC_HLE, 0, "%s is not able to run Read()", m_Name.c_str()); return true; }
virtual bool Write(u32 _CommandAddress) { _dbg_assert_msg_(WII_IPC_HLE, 0, "%s is not able to run Write()", m_Name.c_str()); return true; }

View File

@ -64,14 +64,16 @@ bool CWII_IPC_HLE_Device_di::Open(u32 _CommandAddress, u32 _Mode)
return true;
}
bool CWII_IPC_HLE_Device_di::Close(u32 _CommandAddress)
bool CWII_IPC_HLE_Device_di::Close(u32 _CommandAddress, bool _bForce)
{
if (m_pFileSystem)
{
delete m_pFileSystem;
m_pFileSystem = NULL;
}
Memory::Write_U32(0, _CommandAddress + 4);
m_ErrorStatus = 0;
if (!_bForce)
Memory::Write_U32(0, _CommandAddress + 4);
m_Active = false;
return true;
}

View File

@ -34,7 +34,7 @@ public:
virtual ~CWII_IPC_HLE_Device_di();
bool Open(u32 _CommandAddress, u32 _Mode);
bool Close(u32 _CommandAddress);
bool Close(u32 _CommandAddress, bool _bForce);
bool IOCtl(u32 _CommandAddress);
bool IOCtlV(u32 _CommandAddress);

View File

@ -39,9 +39,10 @@ public:
return true;
}
virtual bool Close(u32 _CommandAddress)
virtual bool Close(u32 _CommandAddress, bool _bForce)
{
Memory::Write_U32(0, _CommandAddress + 4);
if (!_bForce)
Memory::Write_U32(0, _CommandAddress + 4);
m_Active = false;
return true;
}

View File

@ -44,19 +44,15 @@ CWII_IPC_HLE_Device_FileIO::CWII_IPC_HLE_Device_FileIO(u32 _DeviceID, const std:
: IWII_IPC_HLE_Device(_DeviceID, _rDeviceName, false) // not a real hardware
, m_pFileHandle(NULL)
, m_FileLength(0)
{
}
{}
CWII_IPC_HLE_Device_FileIO::~CWII_IPC_HLE_Device_FileIO()
{
}
{}
bool
CWII_IPC_HLE_Device_FileIO::Close(u32 _CommandAddress)
CWII_IPC_HLE_Device_FileIO::Close(u32 _CommandAddress, bool _bForce)
{
u32 DeviceID = Memory::Read_U32(_CommandAddress + 8);
INFO_LOG(WII_IPC_FILEIO, "FileIO: Close %s (DeviceID=%08x)", GetDeviceName().c_str(), DeviceID);
INFO_LOG(WII_IPC_FILEIO, "FileIO: Close %s (DeviceID=%08x)", m_Name.c_str(), m_DeviceID);
if (m_pFileHandle != NULL)
{
@ -65,7 +61,8 @@ CWII_IPC_HLE_Device_FileIO::Close(u32 _CommandAddress)
}
// Close always return 0 for success
Memory::Write_U32(0, _CommandAddress + 4);
if (!_bForce)
Memory::Write_U32(0, _CommandAddress + 4);
m_Active = false;
return true;
}

View File

@ -28,7 +28,7 @@ public:
virtual ~CWII_IPC_HLE_Device_FileIO();
bool Close(u32 _CommandAddress);
bool Close(u32 _CommandAddress, bool _bForce);
bool Open(u32 _CommandAddress, u32 _Mode);
bool Seek(u32 _CommandAddress);
bool Read(u32 _CommandAddress);

View File

@ -64,10 +64,7 @@ CWII_IPC_HLE_Device_es::CWII_IPC_HLE_Device_es(u32 _DeviceID, const std::string&
{}
CWII_IPC_HLE_Device_es::~CWII_IPC_HLE_Device_es()
{
// Leave deletion of the INANDContentLoader objects to CNANDContentManager, don't do it here!
m_NANDContent.clear();
}
{}
void CWII_IPC_HLE_Device_es::LoadWAD(const std::string& _rContentFile)
{
@ -97,7 +94,6 @@ bool CWII_IPC_HLE_Device_es::Open(u32 _CommandAddress, u32 _Mode)
// scan for the title ids listed in TMDs within /title/
m_TitleIDs.clear();
m_TitleIDs.push_back(0x0000000100000002ULL);
//m_TitleIDs.push_back(0x0001000248414741ULL);
//m_TitleIDs.push_back(0x0001000248414341ULL);
@ -113,12 +109,19 @@ bool CWII_IPC_HLE_Device_es::Open(u32 _CommandAddress, u32 _Mode)
return true;
}
bool CWII_IPC_HLE_Device_es::Close(u32 _CommandAddress)
bool CWII_IPC_HLE_Device_es::Close(u32 _CommandAddress, bool _bForce)
{
// Leave deletion of the INANDContentLoader objects to CNANDContentManager, don't do it here!
m_NANDContent.clear();
m_ContentAccessMap.clear();
m_pContentLoader = NULL;
m_TitleIDs.clear();
m_TitleID = -1;
AccessIdentID = 0x6000000;
INFO_LOG(WII_IPC_ES, "ES: Close");
Memory::Write_U32(0, _CommandAddress + 4);
if (!_bForce)
Memory::Write_U32(0, _CommandAddress + 4);
m_Active = false;
return true;
}

View File

@ -34,7 +34,7 @@ public:
virtual bool Open(u32 _CommandAddress, u32 _Mode);
virtual bool Close(u32 _CommandAddress);
virtual bool Close(u32 _CommandAddress, bool _bForce);
virtual bool IOCtlV(u32 _CommandAddress);
@ -132,6 +132,7 @@ private:
std::vector<u64> m_TitleIDs;
u64 m_TitleID;
u32 AccessIdentID;
// This should only be cleared on power reset
std::string m_ContentFile;
u64 GetCurrentTitleID() const;

View File

@ -71,11 +71,11 @@ bool CWII_IPC_HLE_Device_fs::Open(u32 _CommandAddress, u32 _Mode)
return true;
}
bool CWII_IPC_HLE_Device_fs::Close(u32 _CommandAddress)
bool CWII_IPC_HLE_Device_fs::Close(u32 _CommandAddress, bool _bForce)
{
// Do we even need to do anything?
INFO_LOG(WII_IPC_NET, "/dev/fs: Close");
Memory::Write_U32(0, _CommandAddress + 4);
if (!_bForce)
Memory::Write_U32(0, _CommandAddress + 4);
m_Active = false;
return true;
}

View File

@ -36,7 +36,7 @@ public:
virtual ~CWII_IPC_HLE_Device_fs();
virtual bool Open(u32 _CommandAddress, u32 _Mode);
virtual bool Close(u32 _CommandAddress);
virtual bool Close(u32 _CommandAddress, bool _bForce);
virtual bool IOCtl(u32 _CommandAddress);
virtual bool IOCtlV(u32 _CommandAddress);

View File

@ -64,12 +64,10 @@ extern std::queue<std::pair<u32,std::string> > g_ReplyQueueLater;
// Handle /dev/net/kd/request requests
CWII_IPC_HLE_Device_net_kd_request::CWII_IPC_HLE_Device_net_kd_request(u32 _DeviceID, const std::string& _rDeviceName)
: IWII_IPC_HLE_Device(_DeviceID, _rDeviceName)
{
}
{}
CWII_IPC_HLE_Device_net_kd_request::~CWII_IPC_HLE_Device_net_kd_request()
{
}
{}
bool CWII_IPC_HLE_Device_net_kd_request::Open(u32 _CommandAddress, u32 _Mode)
{
@ -79,10 +77,11 @@ bool CWII_IPC_HLE_Device_net_kd_request::Open(u32 _CommandAddress, u32 _Mode)
return true;
}
bool CWII_IPC_HLE_Device_net_kd_request::Close(u32 _CommandAddress)
bool CWII_IPC_HLE_Device_net_kd_request::Close(u32 _CommandAddress, bool _bForce)
{
INFO_LOG(WII_IPC_NET, "NET_KD_REQ: Close");
Memory::Write_U32(0, _CommandAddress + 4);
if (!_bForce)
Memory::Write_U32(0, _CommandAddress + 4);
m_Active = false;
return true;
}
@ -170,10 +169,11 @@ bool CWII_IPC_HLE_Device_net_ncd_manage::Open(u32 _CommandAddress, u32 _Mode)
return true;
}
bool CWII_IPC_HLE_Device_net_ncd_manage::Close(u32 _CommandAddress)
bool CWII_IPC_HLE_Device_net_ncd_manage::Close(u32 _CommandAddress, bool _bForce)
{
INFO_LOG(WII_IPC_NET, "NET_NCD_MANAGE: Close");
Memory::Write_U32(0, _CommandAddress + 4);
if (!_bForce)
Memory::Write_U32(0, _CommandAddress + 4);
m_Active = false;
return true;
}
@ -221,10 +221,11 @@ bool CWII_IPC_HLE_Device_net_ip_top::Open(u32 _CommandAddress, u32 _Mode)
return true;
}
bool CWII_IPC_HLE_Device_net_ip_top::Close(u32 _CommandAddress)
bool CWII_IPC_HLE_Device_net_ip_top::Close(u32 _CommandAddress, bool _bForce)
{
INFO_LOG(WII_IPC_NET, "NET_IP_TOP: Close");
Memory::Write_U32(0, _CommandAddress + 4);
if (!_bForce)
Memory::Write_U32(0, _CommandAddress + 4);
m_Active = false;
return true;
}

View File

@ -32,7 +32,7 @@ public:
virtual ~CWII_IPC_HLE_Device_net_kd_request();
virtual bool Open(u32 _CommandAddress, u32 _Mode);
virtual bool Close(u32 _CommandAddress);
virtual bool Close(u32 _CommandAddress, bool _bForce);
virtual bool IOCtl(u32 _CommandAddress);
private:
@ -81,10 +81,11 @@ public:
return true;
}
virtual bool Close(u32 _CommandAddress)
virtual bool Close(u32 _CommandAddress, bool _bForce)
{
INFO_LOG(WII_IPC_NET, "NET_KD_TIME: Close");
Memory::Write_U32(0, _CommandAddress + 4);
if (!_bForce)
Memory::Write_U32(0, _CommandAddress + 4);
return true;
}
@ -154,7 +155,7 @@ public:
virtual ~CWII_IPC_HLE_Device_net_ip_top();
virtual bool Open(u32 _CommandAddress, u32 _Mode);
virtual bool Close(u32 _CommandAddress);
virtual bool Close(u32 _CommandAddress, bool _bForce);
virtual bool IOCtl(u32 _CommandAddress);
virtual bool IOCtlV(u32 _CommandAddress);
@ -210,7 +211,7 @@ public:
virtual ~CWII_IPC_HLE_Device_net_ncd_manage();
virtual bool Open(u32 _CommandAddress, u32 _Mode);
virtual bool Close(u32 _CommandAddress);
virtual bool Close(u32 _CommandAddress, bool _bForce);
virtual bool IOCtlV(u32 _CommandAddress);
private:

View File

@ -27,17 +27,19 @@
CWII_IPC_HLE_Device_sdio_slot0::CWII_IPC_HLE_Device_sdio_slot0(u32 _DeviceID, const std::string& _rDeviceName)
: IWII_IPC_HLE_Device(_DeviceID, _rDeviceName)
{
m_Card = NULL;
m_Status = CARD_INSERTED;
m_BlockLength = 0;
m_BusWidth = 0;
// Clear the whole SD Host Control Register
//Memory::Memset(SDIO_BASE, 0, 0x100);
}
, m_Card(NULL)
, m_Status(CARD_INSERTED)
, m_BlockLength(0)
, m_BusWidth(0)
{}
CWII_IPC_HLE_Device_sdio_slot0::~CWII_IPC_HLE_Device_sdio_slot0()
{
if(m_Card)
{
fclose(m_Card);
m_Card = NULL;
}
}
bool CWII_IPC_HLE_Device_sdio_slot0::Open(u32 _CommandAddress, u32 _Mode)
@ -65,14 +67,21 @@ bool CWII_IPC_HLE_Device_sdio_slot0::Open(u32 _CommandAddress, u32 _Mode)
return true;
}
bool CWII_IPC_HLE_Device_sdio_slot0::Close(u32 _CommandAddress)
bool CWII_IPC_HLE_Device_sdio_slot0::Close(u32 _CommandAddress, bool _bForce)
{
INFO_LOG(WII_IPC_SD, "Close");
if(m_Card)
{
fclose(m_Card);
m_Card = NULL;
}
m_Status = CARD_INSERTED;
m_BlockLength = 0;
m_BusWidth = 0;
Memory::Write_U32(0, _CommandAddress + 0x4);
if (!_bForce)
Memory::Write_U32(0, _CommandAddress + 0x4);
m_Active = false;
return true;
}

View File

@ -31,7 +31,7 @@ public:
virtual ~CWII_IPC_HLE_Device_sdio_slot0();
bool Open(u32 _CommandAddress, u32 _Mode);
bool Close(u32 _CommandAddress);
bool Close(u32 _CommandAddress, bool _bForce);
bool IOCtl(u32 _CommandAddress);
bool IOCtlV(u32 _CommandAddress);

View File

@ -47,7 +47,7 @@ public:
CWII_IPC_HLE_Device_stm_immediate(u32 _DeviceID, const std::string& _rDeviceName) :
IWII_IPC_HLE_Device(_DeviceID, _rDeviceName)
{}
{}
virtual ~CWII_IPC_HLE_Device_stm_immediate()
{}
@ -60,10 +60,11 @@ public:
return true;
}
virtual bool Close(u32 _CommandAddress)
virtual bool Close(u32 _CommandAddress, bool _bForce)
{
ERROR_LOG(WII_IPC_STM, "STM immediate: Close");
Memory::Write_U32(0, _CommandAddress+4);
if (!_bForce)
Memory::Write_U32(0, _CommandAddress+4);
m_Active = false;
return true;
}
@ -151,10 +152,13 @@ public:
return true;
}
virtual bool Close(u32 _CommandAddress)
virtual bool Close(u32 _CommandAddress, bool _bForce)
{
m_EventHookAddress = 0;
INFO_LOG(WII_IPC_STM, "STM eventhook: Close");
Memory::Write_U32(0, _CommandAddress+4);
if (!_bForce)
Memory::Write_U32(0, _CommandAddress+4);
m_Active = false;
return true;
}

View File

@ -94,9 +94,29 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::Open(u32 _CommandAddress, u32 _Mode)
// ===================================================
// Close
bool CWII_IPC_HLE_Device_usb_oh1_57e_305::Close(u32 _CommandAddress)
bool CWII_IPC_HLE_Device_usb_oh1_57e_305::Close(u32 _CommandAddress, bool _bForce)
{
Memory::Write_U32(0, _CommandAddress + 4);
m_PINType = 0;
m_ScanEnable = 0;
m_EventFilterType = 0;
m_EventFilterCondition = 0;
m_HostMaxACLSize = 0;
m_HostMaxSCOSize = 0;
m_HostNumACLPackets = 0;
m_HostNumSCOPackets = 0;
m_LastCmd = NULL;
m_PacketCount = 0;
m_FreqDividerSync = 0;
m_FreqDividerMote = 0;
m_HCIBuffer.m_address = NULL;
m_HCIPool.m_number = 0;
m_ACLBuffer.m_address = NULL;
m_ACLPool.m_number = 0;
if (!_bForce)
Memory::Write_U32(0, _CommandAddress + 4);
m_Active = false;
return true;
}
@ -2128,8 +2148,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::LOG_LinkKey(const u8* _pLinkKey)
//
CWII_IPC_HLE_Device_usb_oh0::CWII_IPC_HLE_Device_usb_oh0(u32 _DeviceID, const std::string& _rDeviceName)
: IWII_IPC_HLE_Device(_DeviceID, _rDeviceName)
{
}
{}
CWII_IPC_HLE_Device_usb_oh0::~CWII_IPC_HLE_Device_usb_oh0()
{}
@ -2141,9 +2160,10 @@ bool CWII_IPC_HLE_Device_usb_oh0::Open(u32 _CommandAddress, u32 _Mode)
return true;
}
bool CWII_IPC_HLE_Device_usb_oh0::Close(u32 _CommandAddress)
bool CWII_IPC_HLE_Device_usb_oh0::Close(u32 _CommandAddress, bool _bForce)
{
Memory::Write_U32(0, _CommandAddress + 0x4);
if (!_bForce)
Memory::Write_U32(0, _CommandAddress + 0x4);
m_Active = false;
return true;
}

View File

@ -41,10 +41,10 @@ union UACLHeader
struct SQueuedEvent
{
u8 m_buffer[1024];
size_t m_size;
u32 m_size;
u16 m_connectionHandle;
SQueuedEvent(size_t size, u16 connectionHandle)
SQueuedEvent(u32 size, u16 connectionHandle)
: m_size(size)
, m_connectionHandle(connectionHandle)
{
@ -65,7 +65,7 @@ public:
virtual ~CWII_IPC_HLE_Device_usb_oh1_57e_305();
virtual bool Open(u32 _CommandAddress, u32 _Mode);
virtual bool Close(u32 _CommandAddress);
virtual bool Close(u32 _CommandAddress, bool _bForce);
virtual bool IOCtlV(u32 _CommandAddress);
virtual bool IOCtl(u32 _CommandAddress);
@ -179,8 +179,6 @@ private:
u16 m_HostNumACLPackets;
u16 m_HostNumSCOPackets;
typedef std::queue<SQueuedEvent> CEventQueue;
// STATE_TO_SAVE
SHCICommandMessage m_CtrlSetup;
CtrlBuffer m_HCIBuffer;
@ -273,7 +271,7 @@ public:
virtual ~CWII_IPC_HLE_Device_usb_oh0();
virtual bool Open(u32 _CommandAddress, u32 _Mode);
virtual bool Close(u32 _CommandAddress); // hermes' dsp demo
virtual bool Close(u32 _CommandAddress, bool _bForce); // hermes' dsp demo
virtual bool IOCtlV(u32 _CommandAddress);
virtual bool IOCtl(u32 _CommandAddress);

View File

@ -894,6 +894,11 @@ void CFrame::UpdateGUI()
m_ToolBar->EnableTool(wxID_REFRESH, !Initialized); // Don't allow refresh when we don't show the list
m_ToolBar->EnableTool(IDM_STOP, Running || Paused);
m_ToolBar->EnableTool(IDM_SCREENSHOT, Running || Paused);
m_ToolBar->EnableTool(IDM_CONFIG_MAIN, !Running);
m_ToolBar->EnableTool(IDM_CONFIG_GFX_PLUGIN, !Running);
m_ToolBar->EnableTool(IDM_CONFIG_DSP_PLUGIN, !Running);
m_ToolBar->EnableTool(IDM_CONFIG_PAD_PLUGIN, !Running);
m_ToolBar->EnableTool(IDM_CONFIG_WIIMOTE_PLUGIN, !Running);
}
// File
@ -909,6 +914,12 @@ void CFrame::UpdateGUI()
GetMenuBar()->FindItem(IDM_PLAYRECORD)->Enable(!Initialized);
GetMenuBar()->FindItem(IDM_FRAMESTEP)->Enable(Running || Paused);
GetMenuBar()->FindItem(IDM_SCREENSHOT)->Enable(Running || Paused);
GetMenuBar()->FindItem(IDM_CONFIG_MAIN)->Enable(!Running);
GetMenuBar()->FindItem(IDM_CONFIG_GFX_PLUGIN)->Enable(!Running);
GetMenuBar()->FindItem(IDM_CONFIG_DSP_PLUGIN)->Enable(!Running);
GetMenuBar()->FindItem(IDM_CONFIG_PAD_PLUGIN)->Enable(!Running);
GetMenuBar()->FindItem(IDM_CONFIG_WIIMOTE_PLUGIN)->Enable(!Running);
m_pSubMenuLoad->Enable(Initialized);
m_pSubMenuSave->Enable(Initialized);

View File

@ -619,10 +619,12 @@ void Host_SetDebugMode(bool)
void Host_SetWaitCursor(bool enable)
{
#ifdef _WIN32
if(enable)
if (enable)
{
SetCursor(LoadCursor(NULL, IDC_WAIT));
} else {
}
else
{
SetCursor(LoadCursor(NULL, IDC_ARROW));
}
#endif

View File

@ -35,7 +35,6 @@ void CConfig::Load()
file.Load(FULL_CONFIG_DIR "DSP.ini");
file.Get("Config", "EnableHLEAudio", &m_EnableHLEAudio, true); // Sound Settings
file.Get("Config", "EnableRE0AudioFix", &m_EnableRE0Fix, false); // RE0 Hack
file.Get("Config", "EnableLoopAudioFix", &m_EnableLoopFix, false); // Loop Hack
ac_Config.Load(file);
}
@ -45,7 +44,6 @@ void CConfig::Save()
file.Load(FULL_CONFIG_DIR "DSP.ini");
file.Set("Config", "EnableHLEAudio", m_EnableHLEAudio); // Sound Settings
file.Set("Config", "EnableRE0AudioFix", m_EnableRE0Fix); // RE0 Hack
file.Set("Config", "EnableLoopAudioFix", m_EnableLoopFix); // Loop Hack
ac_Config.Set(file);
file.Save(FULL_CONFIG_DIR "DSP.ini");

View File

@ -24,7 +24,6 @@ struct CConfig
{
bool m_EnableHLEAudio;
bool m_EnableRE0Fix;
bool m_EnableLoopFix;
CConfig();

View File

@ -25,7 +25,6 @@ EVT_CHECKBOX(ID_ENABLE_HLE_AUDIO, DSPConfigDialogHLE::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_DTK_MUSIC, DSPConfigDialogHLE::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_THROTTLE, DSPConfigDialogHLE::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_RE0_FIX, DSPConfigDialogHLE::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_LOOP_FIX, DSPConfigDialogHLE::SettingsChanged)
EVT_COMMAND_SCROLL(ID_VOLUME, DSPConfigDialogHLE::VolumeChanged)
END_EVENT_TABLE()
@ -40,9 +39,8 @@ DSPConfigDialogHLE::DSPConfigDialogHLE(wxWindow *parent, wxWindowID id, const wx
// Create items
m_buttonEnableHLEAudio = new wxCheckBox(this, ID_ENABLE_HLE_AUDIO, wxT("Enable HLE Audio"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_buttonEnableDTKMusic = new wxCheckBox(this, ID_ENABLE_DTK_MUSIC, wxT("Enable DTK Music"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_buttonEnableThrottle = new wxCheckBox(this, ID_ENABLE_THROTTLE, wxT("Enable Other Audio (Throttle)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_buttonEnableThrottle = new wxCheckBox(this, ID_ENABLE_THROTTLE, wxT("Enable Audio Throttle"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_buttonEnableRE0Fix = new wxCheckBox(this, ID_ENABLE_RE0_FIX, wxT("Enable RE0 Audio Hack"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_buttonEnableLoopFix = new wxCheckBox(this, ID_ENABLE_LOOP_FIX, wxT("Enable Loop Audio Hack"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
wxStaticText *BackendText = new wxStaticText(this, wxID_ANY, wxT("Audio Backend"), wxDefaultPosition, wxDefaultSize, 0);
m_BackendSelection = new wxComboBox(this, ID_BACKEND, wxEmptyString, wxDefaultPosition, wxSize(90, 20), wxArrayBackends, wxCB_READONLY, wxDefaultValidator);
@ -54,18 +52,16 @@ DSPConfigDialogHLE::DSPConfigDialogHLE(wxWindow *parent, wxWindowID id, const wx
m_buttonEnableDTKMusic->SetValue(ac_Config.m_EnableDTKMusic ? true : false);
m_buttonEnableThrottle->SetValue(ac_Config.m_EnableThrottle ? true : false);
m_buttonEnableRE0Fix->SetValue(g_Config.m_EnableRE0Fix ? true : false);
m_buttonEnableLoopFix->SetValue(g_Config.m_EnableLoopFix ? true : false);
// Add tooltips
m_buttonEnableHLEAudio->SetToolTip(wxT("This is the most common sound type"));
m_buttonEnableDTKMusic->SetToolTip(wxT("This is sometimes used to play music tracks from the disc"));
m_buttonEnableThrottle->SetToolTip(wxT("This is sometimes used together with pre-rendered movies.\n")
wxT("Disabling this also disables the speed throttle which this causes,\n")
wxT("meaning that there will be no upper limit on your FPS."));
m_buttonEnableHLEAudio->SetToolTip(wxT("This is usually used to play voice and sound effects."));
m_buttonEnableDTKMusic->SetToolTip(wxT("This is used to play music tracks, like BGM."));
m_buttonEnableThrottle->SetToolTip(wxT("This is used to control game speed by sound throttle.\n")
wxT("Disabling this could cause abnormal game speed, such as too fast.\n")
wxT("But sometimes enabling this causes constant noise."));
m_buttonEnableRE0Fix->SetToolTip(wxT("This fixes audio in Resident Evil Zero and maybe some other games."));
m_buttonEnableLoopFix->SetToolTip(wxT("This fixes audio loops in some games, by default it should be disabled.\n")
wxT("Unless you are experiencing strange sound loops, don't enable it,\n")
wxT("or it will cause some games to hang up."));
m_BackendSelection->SetToolTip(wxT("Changing this will have no effect while the emulator is running!"));
// Create sizer and add items to dialog
@ -79,7 +75,6 @@ DSPConfigDialogHLE::DSPConfigDialogHLE(wxWindow *parent, wxWindowID id, const wx
sbSettings->Add(m_buttonEnableDTKMusic, 0, wxALL, 5);
sbSettings->Add(m_buttonEnableThrottle, 0, wxALL, 5);
sbSettings->Add(m_buttonEnableRE0Fix, 0, wxALL, 5);
sbSettings->Add(m_buttonEnableLoopFix, 0, wxALL, 5);
sBackend->Add(BackendText, 0, wxALIGN_CENTER|wxALL, 5);
sBackend->Add(m_BackendSelection, 0, wxALL, 1);
sbSettings->Add(sBackend, 0, wxALL, 2);
@ -139,7 +134,6 @@ void DSPConfigDialogHLE::SettingsChanged(wxCommandEvent& event)
ac_Config.m_EnableDTKMusic = m_buttonEnableDTKMusic->GetValue();
ac_Config.m_EnableThrottle = m_buttonEnableThrottle->GetValue();
g_Config.m_EnableRE0Fix = m_buttonEnableRE0Fix->GetValue();
g_Config.m_EnableLoopFix = m_buttonEnableLoopFix->GetValue();
#ifdef __APPLE__
strncpy(ac_Config.sBackend, m_BackendSelection->GetValue().mb_str(), 128);

View File

@ -47,7 +47,6 @@ private:
wxCheckBox *m_buttonEnableDTKMusic;
wxCheckBox *m_buttonEnableThrottle;
wxCheckBox *m_buttonEnableRE0Fix;
wxCheckBox *m_buttonEnableLoopFix;
wxArrayString wxArrayBackends;
wxComboBox *m_BackendSelection;
@ -58,7 +57,6 @@ private:
ID_ENABLE_DTK_MUSIC,
ID_ENABLE_THROTTLE,
ID_ENABLE_RE0_FIX,
ID_ENABLE_LOOP_FIX,
ID_BACKEND,
ID_VOLUME
};

View File

@ -191,9 +191,7 @@ inline void MixAddVoice(ParamBlockType &pb, int *templbuffer, int *temprbuffer,
break;
case AUDIOFORMAT_ADPCM:
u32 toSamplePos;
toSamplePos = (newSamplePos > sampleEnd) ? sampleEnd : newSamplePos;
sample = ADPCM_Step(pb.adpcm, samplePos, toSamplePos, frac);
sample = ADPCM_Step(pb.adpcm, samplePos, newSamplePos, frac);
break;
default:
@ -248,24 +246,10 @@ inline void MixAddVoice(ParamBlockType &pb, int *templbuffer, int *temprbuffer,
}
else
{
if (!g_Config.m_EnableLoopFix && Wii && (_uCode == UCODE_AXWII))
{
// This accurate boundary wrapping will fix the hangup in many AXWii games like:
// New Super Mario Bros.Wii, Fatal Frame 4, Resident Evil Darkside Chronicles
samplePos = newSamplePos - sampleEnd + loopPos;
// And these AXWii games check this flag and will turn it off when necessary
// So DSP should not touch it
//
//pb.running = 0;
}
else
{
pb.running = 0;
}
// not sure if this will mute the unwanted over looping sound
pb.mixer.volume_left = 0;
pb.mixer.volume_right = 0;
pb.running = 0;
samplePos = samplePos - sampleEnd + loopPos;
memset(&pb.updates, 0, sizeof(pb.updates));
memset(pb.src.last_samples, 0, 8);
break;
}
}

View File

@ -7,7 +7,7 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
#include <windows.h>
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@ -184,11 +184,6 @@ BEGIN
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h\0"
END
3 TEXTINCLUDE
BEGIN
"#include <windows.h\0"
END

View File

@ -297,15 +297,17 @@ int RecordingCheckKeys(int WmNuIr)
// Subroutines
int GetMapKeyState(int _MapKey)
int GetMapKeyState(int _MapKey, int Key)
{
const int Page = 0;
if (_MapKey < 256)
#ifdef WIN32
return GetAsyncKeyState(_MapKey); // Keyboard
#ifdef _WIN32
return GetAsyncKeyState(_MapKey); // Keyboard (Windows)
#else
return KeyStatus[Key]; // Keyboard (Linux)
#endif
else if (_MapKey < 0x1100)
if (_MapKey < 0x1100)
return SDL_JoystickGetButton(PadState[Page].joy, _MapKey - 0x1000); // Pad button
else // Pad hat
{
@ -322,28 +324,32 @@ int GetMapKeyState(int _MapKey)
// Multi System Input Status Check
int IsKey(int Key)
{
#ifdef WIN32
if (g_Wiimote_kbd.A <= Key && Key <= g_Wiimote_kbd.PITCH_R)
{
return GetMapKeyState(PadMapping[0].Wm.keyForControls[Key - g_Wiimote_kbd.A]);
return GetMapKeyState(PadMapping[0].Wm.keyForControls[Key - g_Wiimote_kbd.A], Key);
}
if (Key == g_Wiimote_kbd.SHAKE)
{
return GetMapKeyState(PadMapping[0].Wm.keyForControls[Key - g_Wiimote_kbd.A]) || GetAsyncKeyState(VK_MBUTTON);
#ifdef _WIN32
return GetMapKeyState(PadMapping[0].Wm.keyForControls[Key - g_Wiimote_kbd.A], Key) || GetAsyncKeyState(VK_MBUTTON);
#else
return GetMapKeyState(PadMapping[0].Wm.keyForControls[Key - g_Wiimote_kbd.A], Key);
#endif
}
if (g_NunchuckExt.Z <= Key && Key <= g_NunchuckExt.SHAKE)
{
return GetMapKeyState(PadMapping[0].Nc.keyForControls[Key - g_NunchuckExt.Z]);
return GetMapKeyState(PadMapping[0].Nc.keyForControls[Key - g_NunchuckExt.Z], Key);
}
if (g_ClassicContExt.A <= Key && Key <= g_ClassicContExt.Rd)
{
return GetMapKeyState(PadMapping[0].Cc.keyForControls[Key - g_ClassicContExt.A]);
return GetMapKeyState(PadMapping[0].Cc.keyForControls[Key - g_ClassicContExt.A], Key);
}
if (g_GH3Ext.Green <= Key && Key <= g_GH3Ext.StrumDown)
{
return GetMapKeyState(PadMapping[0].GH3c.keyForControls[Key - g_GH3Ext.Green]);
return GetMapKeyState(PadMapping[0].GH3c.keyForControls[Key - g_GH3Ext.Green], Key);
}
#ifdef _WIN32
switch(Key)
{
// Wiimote
@ -356,7 +362,6 @@ int IsKey(int Key)
PanicAlert("There is syntax error in a function that is calling IsKey(%i)", Key);
return false;
}
#else
return KeyStatus[Key];
#endif