Conflicts fixed

This commit is contained in:
Nekotekina 2014-12-28 16:29:01 +03:00
commit 6cd2665e12
13 changed files with 101 additions and 82 deletions

View File

@ -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

View File

@ -491,10 +491,10 @@ void GLFragmentDecompilerThread::Task()
case RSX_FP_OPCODE_DDY: SetDst("dFdy($0)"); break; case RSX_FP_OPCODE_DDY: SetDst("dFdy($0)"); break;
case RSX_FP_OPCODE_NRM: SetDst("normalize($0)"); break; case RSX_FP_OPCODE_NRM: SetDst("normalize($0)"); break;
case RSX_FP_OPCODE_TEX: SetDst("texture($t, $0.xy)"); break; case RSX_FP_OPCODE_TEX: SetDst("texture($t, $0.xy)"); break;
case RSX_FP_OPCODE_TXP: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: TXP"); break; case RSX_FP_OPCODE_TXP: LOG_ERROR(RSX, "TEX_SRB texture projection used. Please report this to a RPCS3 developer!"); SetDst("textureProj($t, $0.xy, $1)"); break; //TODO: Test this
case RSX_FP_OPCODE_TXD: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: TXD"); break; case RSX_FP_OPCODE_TXD: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: TXD"); break;
case RSX_FP_OPCODE_TXB: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: TXB"); break; case RSX_FP_OPCODE_TXB: SetDst("texture($t, $0.xy, $1.x)"); break;
case RSX_FP_OPCODE_TXL: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: TXL"); break; case RSX_FP_OPCODE_TXL: SetDst("textureLod($t, $0.xy, $1.x)"); break;
case RSX_FP_OPCODE_UP2: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: UP2"); break; case RSX_FP_OPCODE_UP2: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: UP2"); break;
case RSX_FP_OPCODE_UP4: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: UP4"); break; case RSX_FP_OPCODE_UP4: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: UP4"); break;
case RSX_FP_OPCODE_UP16: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: UP16"); break; case RSX_FP_OPCODE_UP16: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: UP16"); break;

View File

@ -49,7 +49,7 @@ enum
RSX_FP_OPCODE_PKG = 0x2C, // Pack with sRGB transformation RSX_FP_OPCODE_PKG = 0x2C, // Pack with sRGB transformation
RSX_FP_OPCODE_UPG = 0x2D, // Unpack gamma RSX_FP_OPCODE_UPG = 0x2D, // Unpack gamma
RSX_FP_OPCODE_DP2A = 0x2E, // 2-component dot product with scalar addition RSX_FP_OPCODE_DP2A = 0x2E, // 2-component dot product with scalar addition
RSX_FP_OPCODE_TXL = 0x2F, // Texture sample with LOD RSX_FP_OPCODE_TXL = 0x2F, // Texture sample with explicit LOD
RSX_FP_OPCODE_TXB = 0x31, // Texture sample with bias RSX_FP_OPCODE_TXB = 0x31, // Texture sample with bias
RSX_FP_OPCODE_TEXBEM = 0x33, RSX_FP_OPCODE_TEXBEM = 0x33,
RSX_FP_OPCODE_TXPBEM = 0x34, RSX_FP_OPCODE_TXPBEM = 0x34,

View File

@ -419,13 +419,13 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const
break; break;
// Vertex Texture // Vertex Texture
case_4(NV4097_SET_VERTEX_TEXTURE_FORMAT, 0x20) : case_4(NV4097_SET_VERTEX_TEXTURE_FORMAT, 0x20):
case_4(NV4097_SET_VERTEX_TEXTURE_OFFSET, 0x20) : case_4(NV4097_SET_VERTEX_TEXTURE_OFFSET, 0x20):
case_4(NV4097_SET_VERTEX_TEXTURE_FILTER, 0x20) : case_4(NV4097_SET_VERTEX_TEXTURE_FILTER, 0x20):
case_4(NV4097_SET_VERTEX_TEXTURE_ADDRESS, 0x20) : case_4(NV4097_SET_VERTEX_TEXTURE_ADDRESS, 0x20):
case_4(NV4097_SET_VERTEX_TEXTURE_IMAGE_RECT, 0x20) : case_4(NV4097_SET_VERTEX_TEXTURE_IMAGE_RECT, 0x20):
case_4(NV4097_SET_VERTEX_TEXTURE_BORDER_COLOR, 0x20) : case_4(NV4097_SET_VERTEX_TEXTURE_BORDER_COLOR, 0x20):
case_4(NV4097_SET_VERTEX_TEXTURE_CONTROL0, 0x20) : case_4(NV4097_SET_VERTEX_TEXTURE_CONTROL0, 0x20):
{ {
// Done using methodRegisters in RSXTexture.cpp // Done using methodRegisters in RSXTexture.cpp
} }
@ -1586,7 +1586,9 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const
case NV4097_SET_CONTEXT_DMA_COLOR_D: case NV4097_SET_CONTEXT_DMA_COLOR_D:
{ {
if (ARGS(0)) if (ARGS(0))
{
LOG_WARNING(RSX, "NV4097_SET_CONTEXT_DMA_COLOR_D: 0x%x", ARGS(0)); LOG_WARNING(RSX, "NV4097_SET_CONTEXT_DMA_COLOR_D: 0x%x", ARGS(0));
}
} }
break; break;
@ -2356,10 +2358,6 @@ void RSXThread::Task()
//LOG_WARNING(RSX, "non increment cmd! 0x%x", cmd); //LOG_WARNING(RSX, "non increment cmd! 0x%x", cmd);
inc = 0; inc = 0;
} }
else
{
//LOG_WARNING(RSX, "increment cmd! 0x%x", cmd);
}
if(cmd == 0) //nop if(cmd == 0) //nop
{ {

View File

@ -528,6 +528,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;
@ -579,7 +580,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
@ -865,7 +866,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];
@ -886,21 +890,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];
@ -921,14 +927,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];
@ -949,7 +964,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;
} }

View File

@ -82,15 +82,13 @@ void addSaveDataEntry(std::vector<SaveDataEntry>& saveEntries, const std::string
cellSysutil->Error("Running _stat in cellSaveData. Please report this to a RPCS3 developer!"); cellSysutil->Error("Running _stat in cellSaveData. Please report this to a RPCS3 developer!");
std::string pathy; std::string real_path;
Emu.GetVFS().GetDevice("dev_hdd0", pathy);
struct stat buf; struct stat buf;
int result = stat((pathy.substr(0, pathy.length() - 9) + f.GetPath()).c_str(), &buf);
if (result != 0) Emu.GetVFS().GetDevice(f.GetPath(), real_path);
cellSysutil->Error("_stat failed! (%s)", (pathy.substr(0, pathy.length() - 9) + f.GetPath()).c_str());
if (stat(real_path.c_str(), &buf) != 0)
cellSysutil->Error("stat failed! (%s)", real_path.c_str());
else else
{ {
atime = buf.st_atime; atime = buf.st_atime;

View File

@ -242,7 +242,7 @@ s32 cellFsStat(vm::ptr<const char> path, vm::ptr<CellFsStat> sb)
if (int result = stat(real_path.c_str(), &buf)) if (int result = stat(real_path.c_str(), &buf))
{ {
sys_fs->Error("_stat failed! (%s)", real_path.c_str()); sys_fs->Error("stat('%s') failed -> 0x%x", real_path.c_str(), result);
} }
else else
{ {

View File

@ -1,4 +1,5 @@
#include "stdafx.h" #include "stdafx.h"
#include "Emu/FS/VFS.h"
#include "Emu/Memory/Memory.h" #include "Emu/Memory/Memory.h"
#include "Emu/System.h" #include "Emu/System.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
@ -103,17 +104,11 @@ void sys_game_process_exitspawn(vm::ptr<const char> path, u32 argv_addr, u32 env
Emu.Stop(); Emu.Stop();
}); });
int device = -1; std::string real_path;
if (_path.substr(1, 8) == "dev_hdd0") Emu.GetVFS().GetDevice(_path.c_str(), real_path);
device = 0;
else if (_path.substr(1, 8) == "dev_hdd1")
device = 1;
else if (_path.substr(1, 8) == "dev_bdvd")
device = 2;
if (device != 0) Emu.BootGame(real_path, true);
Emu.BootGame(_path.c_str(), true, device);
return; return;
} }
@ -185,16 +180,11 @@ void sys_game_process_exitspawn2(vm::ptr<const char> path, u32 argv_addr, u32 en
Emu.Stop(); Emu.Stop();
}); });
int device = -1; std::string real_path;
if (_path.substr(1, 8) == "dev_hdd0") Emu.GetVFS().GetDevice(_path.c_str(), real_path);
device = 0;
else if (_path.substr(1, 8) == "dev_hdd1")
device = 1;
else if (_path.substr(1, 8) == "dev_bdvd")
device = 2;
Emu.BootGame(_path.c_str(), true, device); Emu.BootGame(real_path, true);
return; return;
} }

View File

@ -146,7 +146,7 @@ void Emulator::CheckStatus()
//} //}
} }
bool Emulator::BootGame(const std::string& path, bool direct, int device) bool Emulator::BootGame(const std::string& path, bool direct)
{ {
static const char* elf_path[6] = static const char* elf_path[6] =
{ {
@ -159,33 +159,20 @@ bool Emulator::BootGame(const std::string& path, bool direct, int device)
}; };
auto curpath = path; auto curpath = path;
if (!direct) if (direct)
{ {
for (int i = 0; i < sizeof(elf_path) / sizeof(*elf_path); i++) if (rFile::Access(curpath, rFile::read))
{ {
curpath = path + elf_path[i]; SetPath(curpath);
Load();
if (rFile::Access(curpath, rFile::read)) return true;
{
SetPath(curpath);
Load();
return true;
}
} }
} }
else
for (int i = 0; i < sizeof(elf_path) / sizeof(*elf_path); i++)
{ {
std::string pathy; curpath = path + elf_path[i];
if (device == 0)
Emu.GetVFS().GetDevice("dev_hdd0", pathy);
else if (device == 1)
Emu.GetVFS().GetDevice("dev_hdd1", pathy);
else if (device == 2)
Emu.GetVFS().GetDevice("dev_bdvd", pathy);
curpath = pathy.substr(0, pathy.length() - 9) + path;
if (rFile::Access(curpath, rFile::read)) if (rFile::Access(curpath, rFile::read))
{ {

View File

@ -206,7 +206,7 @@ public:
u32 GetCPUThreadStop() const { return m_cpu_thr_stop; } u32 GetCPUThreadStop() const { return m_cpu_thr_stop; }
void CheckStatus(); void CheckStatus();
bool BootGame(const std::string& path, bool direct = false, int device = 0); bool BootGame(const std::string& path, bool direct = false);
void Load(); void Load();
void Run(); void Run();

View File

@ -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);
}
}

View File

@ -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);
}; };

View File

@ -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;