mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 16:31:28 +12:00
Merge pull request #933 from O1L/master
Some changes in LLEModulesManager and cellAudio
This commit is contained in:
commit
0388ba5032
5 changed files with 64 additions and 18 deletions
|
@ -84,6 +84,7 @@ struct AudioPortConfig
|
||||||
u64 counter; // copy of global counter
|
u64 counter; // copy of global counter
|
||||||
u32 addr;
|
u32 addr;
|
||||||
u32 read_index_addr;
|
u32 read_index_addr;
|
||||||
|
u32 size;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct AudioConfig //custom structure
|
struct AudioConfig //custom structure
|
||||||
|
|
|
@ -529,6 +529,7 @@ int cellAudioPortOpen(vm::ptr<CellAudioPortParam> audioParam, vm::ptr<u32> portN
|
||||||
port.attr = audioParam->attr;
|
port.attr = audioParam->attr;
|
||||||
port.addr = m_config.m_buffer + (128 * 1024 * i);
|
port.addr = m_config.m_buffer + (128 * 1024 * i);
|
||||||
port.read_index_addr = m_config.m_indexes + (sizeof(u64) * i);
|
port.read_index_addr = m_config.m_indexes + (sizeof(u64) * i);
|
||||||
|
port.size = port.channel * port.block * 256 * sizeof(float);
|
||||||
if (port.attr & CELL_AUDIO_PORTATTR_INITLEVEL)
|
if (port.attr & CELL_AUDIO_PORTATTR_INITLEVEL)
|
||||||
{
|
{
|
||||||
port.level = audioParam->level;
|
port.level = audioParam->level;
|
||||||
|
@ -580,7 +581,7 @@ int cellAudioGetPortConfig(u32 portNum, vm::ptr<CellAudioPortConfig> portConfig)
|
||||||
|
|
||||||
portConfig->nChannel = port.channel;
|
portConfig->nChannel = port.channel;
|
||||||
portConfig->nBlock = port.block;
|
portConfig->nBlock = port.block;
|
||||||
portConfig->portSize = port.channel * port.block * 256 * sizeof(float);
|
portConfig->portSize = port.size;
|
||||||
portConfig->portAddr = port.addr; // 0x20020000
|
portConfig->portAddr = port.addr; // 0x20020000
|
||||||
portConfig->readIndexAddr = port.read_index_addr; // 0x20010010 on ps3
|
portConfig->readIndexAddr = port.read_index_addr; // 0x20010010 on ps3
|
||||||
|
|
||||||
|
@ -867,7 +868,10 @@ int cellAudioRemoveNotifyEventQueueEx(u64 key, u32 iFlags)
|
||||||
|
|
||||||
int cellAudioAddData(u32 portNum, vm::ptr<float> src, u32 samples, float volume)
|
int cellAudioAddData(u32 portNum, vm::ptr<float> src, u32 samples, float volume)
|
||||||
{
|
{
|
||||||
cellAudio->Todo("cellAudioAddData(portNum=0x%x, src_addr=0x%x, samples=%d, volume=%f)", portNum, src.addr(), samples, volume);
|
cellAudio->Warning("cellAudioAddData(portNum=0x%x, src_addr=0x%x, samples=%d, volume=%f)", portNum, src.addr(), samples, volume);
|
||||||
|
|
||||||
|
if (src.addr() % 16)
|
||||||
|
return CELL_AUDIO_ERROR_PARAM;
|
||||||
|
|
||||||
AudioPortConfig& port = m_config.m_ports[portNum];
|
AudioPortConfig& port = m_config.m_ports[portNum];
|
||||||
|
|
||||||
|
@ -888,21 +892,23 @@ int cellAudioAddData(u32 portNum, vm::ptr<float> src, u32 samples, float volume)
|
||||||
|
|
||||||
std::lock_guard<std::mutex> lock(audioMutex);
|
std::lock_guard<std::mutex> lock(audioMutex);
|
||||||
|
|
||||||
//u32 addr = port.addr;
|
u32 addr = port.addr;
|
||||||
//for (u32 i = 0; i < samples; i++)
|
u32 src_addr = src.addr();
|
||||||
//{
|
|
||||||
// vm::write32(addr, src[i]);
|
|
||||||
// addr += port.channel * port.block * sizeof(float);
|
|
||||||
//}
|
|
||||||
|
|
||||||
m_config.m_buffer = src.addr(); // TODO: write data from src in selected port
|
for (u32 i = 0; i < samples; i++)
|
||||||
|
{
|
||||||
|
// vm::write32(addr, (u32)((float)vm::read32(src_addr) * volume)); // TODO: use volume?
|
||||||
|
vm::write32(addr, vm::read32(src_addr));
|
||||||
|
src_addr += (port.size / samples);
|
||||||
|
addr += (port.size / samples);
|
||||||
|
}
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellAudioAdd2chData(u32 portNum, vm::ptr<be_t<float>> src, u32 samples, float volume)
|
int cellAudioAdd2chData(u32 portNum, vm::ptr<float> src, u32 samples, float volume)
|
||||||
{
|
{
|
||||||
cellAudio->Todo("cellAudioAdd2chData(portNum=0x%x, src_addr=0x%x, samples=%d, volume=%f)", portNum, src.addr(), samples, volume);
|
cellAudio->Warning("cellAudioAdd2chData(portNum=0x%x, src_addr=0x%x, samples=%d, volume=%f)", portNum, src.addr(), samples, volume);
|
||||||
|
|
||||||
AudioPortConfig& port = m_config.m_ports[portNum];
|
AudioPortConfig& port = m_config.m_ports[portNum];
|
||||||
|
|
||||||
|
@ -923,14 +929,23 @@ int cellAudioAdd2chData(u32 portNum, vm::ptr<be_t<float>> src, u32 samples, floa
|
||||||
|
|
||||||
std::lock_guard<std::mutex> lock(audioMutex);
|
std::lock_guard<std::mutex> lock(audioMutex);
|
||||||
|
|
||||||
m_config.m_buffer = src.addr(); // TODO
|
u32 addr = port.addr;
|
||||||
|
u32 src_addr = src.addr();
|
||||||
|
|
||||||
|
for (u32 i = 0; i < samples; i++)
|
||||||
|
{
|
||||||
|
// vm::write32(addr, (u32)((float)vm::read32(src_addr) * volume)); // TODO: use volume?
|
||||||
|
vm::write32(addr, vm::read32(src_addr));
|
||||||
|
src_addr += (2 * port.block * 256 * sizeof(float) / samples);
|
||||||
|
addr += (2 * port.block * 256 * sizeof(float) / samples);
|
||||||
|
}
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellAudioAdd6chData(u32 portNum, vm::ptr<be_t<float>> src, float volume)
|
int cellAudioAdd6chData(u32 portNum, vm::ptr<float> src, float volume)
|
||||||
{
|
{
|
||||||
cellAudio->Todo("cellAudioAdd6chData(portNum=0x%x, src_addr=0x%x, volume=%f)", portNum, src.addr(), volume);
|
cellAudio->Warning("cellAudioAdd6chData(portNum=0x%x, src_addr=0x%x, volume=%f)", portNum, src.addr(), volume);
|
||||||
|
|
||||||
AudioPortConfig& port = m_config.m_ports[portNum];
|
AudioPortConfig& port = m_config.m_ports[portNum];
|
||||||
|
|
||||||
|
@ -951,7 +966,16 @@ int cellAudioAdd6chData(u32 portNum, vm::ptr<be_t<float>> src, float volume)
|
||||||
|
|
||||||
std::lock_guard<std::mutex> lock(audioMutex);
|
std::lock_guard<std::mutex> lock(audioMutex);
|
||||||
|
|
||||||
m_config.m_buffer = src.addr(); // TODO
|
u32 addr = port.addr;
|
||||||
|
u32 src_addr = src.addr();
|
||||||
|
|
||||||
|
for (u32 i = 0; i < 256; i++)
|
||||||
|
{
|
||||||
|
// vm::write32(addr, (u32)((float)vm::read32(src_addr) * volume)); // TODO: use volume?
|
||||||
|
vm::write32(addr, vm::read32(src_addr));
|
||||||
|
src_addr += (6 * port.block * sizeof(float));
|
||||||
|
addr += (6 * port.block * sizeof(float));
|
||||||
|
}
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,14 +13,26 @@ LLEModulesManagerFrame::LLEModulesManagerFrame(wxWindow* parent) : FrameBase(par
|
||||||
wxBoxSizer *s_p_panel = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer *s_p_panel = new wxBoxSizer(wxVERTICAL);
|
||||||
wxPanel *p_main = new wxPanel(this);
|
wxPanel *p_main = new wxPanel(this);
|
||||||
m_check_list = new wxCheckListBox(p_main, wxID_ANY);
|
m_check_list = new wxCheckListBox(p_main, wxID_ANY);
|
||||||
|
|
||||||
|
// select / unselect
|
||||||
|
wxStaticBoxSizer* s_selection = new wxStaticBoxSizer(wxHORIZONTAL, p_main);
|
||||||
|
wxButton* b_select = new wxButton(p_main, wxID_ANY, "Select All", wxDefaultPosition, wxSize(80, -1));
|
||||||
|
wxButton* b_unselect = new wxButton(p_main, wxID_ANY, "Unselect All", wxDefaultPosition, wxSize(80, -1));
|
||||||
|
s_selection->Add(b_select);
|
||||||
|
s_selection->Add(b_unselect);
|
||||||
|
|
||||||
|
s_p_panel->Add(s_selection);
|
||||||
s_p_panel->Add(m_check_list, 1, wxEXPAND | wxALL, 5);
|
s_p_panel->Add(m_check_list, 1, wxEXPAND | wxALL, 5);
|
||||||
p_main->SetSizerAndFit(s_p_panel);
|
p_main->SetSizerAndFit(s_p_panel);
|
||||||
|
|
||||||
s_panel->Add(p_main, 1, wxEXPAND | wxALL, 5);
|
s_panel->Add(p_main, 1, wxEXPAND | wxALL, 5);
|
||||||
SetSizerAndFit(s_panel);
|
SetSizerAndFit(s_panel);
|
||||||
|
|
||||||
Refresh();
|
Refresh();
|
||||||
|
|
||||||
|
b_select->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event) { OnSelectAll(event, true); event.Skip(); });
|
||||||
|
b_unselect->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event) { OnSelectAll(event, false); event.Skip(); });
|
||||||
Bind(wxEVT_CHECKLISTBOX, [this](wxCommandEvent& event) { UpdateSelection(event.GetInt()); event.Skip(); });
|
Bind(wxEVT_CHECKLISTBOX, [this](wxCommandEvent& event) { UpdateSelection(event.GetInt()); event.Skip(); });
|
||||||
Bind(wxEVT_SIZE, [p_main, this](wxSizeEvent& event) { p_main->SetSize(GetClientSize()); m_check_list->SetSize(p_main->GetClientSize() - wxSize(10, 10)); event.Skip(); });
|
Bind(wxEVT_SIZE, [p_main, this](wxSizeEvent& event) { p_main->SetSize(GetClientSize()); m_check_list->SetSize(p_main->GetClientSize() - wxSize(10, 50)); event.Skip(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLEModulesManagerFrame::Refresh()
|
void LLEModulesManagerFrame::Refresh()
|
||||||
|
@ -92,3 +104,12 @@ void LLEModulesManagerFrame::UpdateSelection(int index)
|
||||||
load_lib.Init(m_funcs[index], "LLE");
|
load_lib.Init(m_funcs[index], "LLE");
|
||||||
load_lib.SaveValue(m_check_list->IsChecked(index));
|
load_lib.SaveValue(m_check_list->IsChecked(index));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLEModulesManagerFrame::OnSelectAll(wxCommandEvent& WXUNUSED(event), bool is_checked)
|
||||||
|
{
|
||||||
|
for (uint i = 0; i < m_check_list->GetCount(); i++)
|
||||||
|
{
|
||||||
|
m_check_list->Check(i, is_checked);
|
||||||
|
UpdateSelection(i);
|
||||||
|
}
|
||||||
|
}
|
|
@ -11,4 +11,5 @@ public:
|
||||||
LLEModulesManagerFrame(wxWindow *parent);
|
LLEModulesManagerFrame(wxWindow *parent);
|
||||||
void Refresh();
|
void Refresh();
|
||||||
void UpdateSelection(int index);
|
void UpdateSelection(int index);
|
||||||
|
void OnSelectAll(wxCommandEvent& WXUNUSED(event), bool is_checked);
|
||||||
};
|
};
|
|
@ -133,7 +133,6 @@ namespace loader
|
||||||
if (import_count)
|
if (import_count)
|
||||||
{
|
{
|
||||||
LOG_ERROR(LOADER, "**** Lib '%s'has %d imports!", module_info.name, import_count);
|
LOG_ERROR(LOADER, "**** Lib '%s'has %d imports!", module_info.name, import_count);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sys_prx_library_info_t lib;
|
sys_prx_library_info_t lib;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue