clean up more output conversions, everything that wants to get printed needs to be explicitly convertex to the wxCharType otherwise the VFormat prints nothing

This commit is contained in:
Peter Tissen 2014-02-10 19:51:03 +01:00
parent 427a63f324
commit b05e466e8f
13 changed files with 37 additions and 53 deletions

View File

@ -294,7 +294,7 @@ void CPUThread::ExecOnce()
void CPUThread::Task()
{
ConLog.Write("%s enter", CPUThread::GetFName());
ConLog.Write("%s enter", CPUThread::GetFName().wx_str());
const Array<u64>& bp = Emu.GetBreakPoints();

View File

@ -91,9 +91,9 @@ public:
{
return
wxString::Format("%s[%d] Thread%s",
GetTypeString().mb_str(),
GetTypeString().wx_str(),
m_id,
(GetName().empty() ? "" : std::string(" (" + GetName() + ")").c_str())
wxString(GetName().empty() ? "" : std::string(" (" + GetName() + ")")).wx_str()
);
}

View File

@ -65,7 +65,7 @@ u32 section_offs = 0;
SectionInfo::SectionInfo(const wxString& _name)
{
name = _name.c_str();
name = _name.ToStdString();
memset(&shdr, 0, sizeof(Elf64_Shdr));
section_num = sections_list.Add(this);
@ -470,7 +470,7 @@ void CompilePPUProgram::DetectArgInfo(Arg& arg)
return;
}
arg.string = str(1, str.Len() - 2).c_str();
arg.string = str(1, str.Len() - 2).ToStdString();
arg.type = ARG_TXT;
return;
}

View File

@ -27,7 +27,7 @@ struct Arg
: value(_value)
, type(_type)
{
string = _string.c_str();
string = _string.ToStdString();
}
};
@ -72,7 +72,7 @@ class CompilePPUProgram
, m_id(-1)
, m_addr(-1)
{
m_name = name.c_str();
m_name = name.ToStdString();
}
Branch(const wxString& name, u32 id, u32 addr)
@ -80,7 +80,7 @@ class CompilePPUProgram
, m_id(id)
, m_addr(addr)
{
m_name = name.c_str();
m_name = name.ToStdString();
}
};
@ -107,7 +107,7 @@ class CompilePPUProgram
SpData(const wxString& data, u32 addr)
: m_addr(addr)
{
m_data = data.c_str();
m_data = data.ToStdString();
}
};

View File

@ -53,7 +53,7 @@ bool vfsLocalFile::Open(const wxString& path, vfsOpenMode mode)
bool vfsLocalFile::Create(const wxString& path)
{
ConLog.Warning("vfsLocalFile::Create('%s')", path.c_str());
ConLog.Warning("vfsLocalFile::Create('%s')", path.wx_str());
for(uint p=1; p < path.Len() && path[p] != '\0' ; p++)
{
for(; p < path.Len() && path[p] != '\0'; p++)
@ -65,7 +65,7 @@ bool vfsLocalFile::Create(const wxString& path)
const wxString& dir = path(0, p);
if(!wxDirExists(dir))
{
ConLog.Write("create dir: %s", dir.c_str());
ConLog.Write("create dir: %s", dir.wx_str());
wxMkdir(dir);
}
}

View File

@ -93,8 +93,9 @@ void GLProgramBuffer::Add(GLProgram& prog, GLShaderProgram& gl_fp, RSXShaderProg
ConLog.Write("*** vp data size = %d", rsx_vp.data.GetCount() * 4);
ConLog.Write("*** fp data size = %d", rsx_fp.size);
ConLog.Write("*** vp shader = \n%s", gl_vp.shader.c_str());
ConLog.Write("*** fp shader = \n%s", gl_fp.shader.c_str());
ConLog.Write("*** vp shader = \n%s", gl_vp.shader.wx_str());
ConLog.Write("*** fp shader = \n%s", wxString(gl_fp.shader).wx_str());
new_buf.prog_id = prog.id;
new_buf.vp_id = gl_vp.id;

View File

@ -187,7 +187,7 @@ void GLVertexDecompilerThread::AddCode(bool is_sca, wxString code, bool src_mask
swizzle = swizzle == "xyzw" ? "" : "." + swizzle;
cond = wxString::Format("if(all(%s(rc%s, vec4(0.0)%s))) ", cond_string_table[d0.cond], swizzle.c_str(), swizzle.c_str());
cond = wxString::Format("if(all(%s(rc%s, vec4(0.0)%s))) ", cond_string_table[d0.cond], wxString(swizzle).wx_str(), wxString(swizzle).wx_str());
}
wxString mask = GetMask(is_sca);
@ -482,7 +482,7 @@ void GLVertexProgram::Compile()
id = glCreateShader(GL_VERTEX_SHADER);
const char* str = shader.c_str();
const char* str = shader.mb_str();
const int strlen = shader.Len();
glShaderSource(id, 1, &str, &strlen);
@ -500,7 +500,7 @@ void GLVertexProgram::Compile()
GLsizei len;
memset(buf, 0, r+1);
glGetShaderInfoLog(id, r, &len, buf);
ConLog.Error("Failed to compile vertex shader: %s", buf);
ConLog.Error("Failed to compile vertex shader: %s", wxString(buf).wx_str());
delete[] buf;
}

View File

@ -102,12 +102,12 @@ int sys_raw_spu_load(int id, u32 path_addr, mem32_t entry)
{
const wxString path = Memory.ReadString(path_addr).wx_str();
sysPrxForUser.Warning("sys_raw_spu_load(id=0x%x, path=0x%x [%s], entry_addr=0x%x)",
id, path_addr, path.c_str(), entry.GetAddr());
id, path_addr, path.wx_str(), entry.GetAddr());
vfsFile f(path.c_str());
vfsFile f(path);
if(!f.IsOpened())
{
sysPrxForUser.Error("sys_raw_spu_load error: '%s' not found!", path.c_str());
sysPrxForUser.Error("sys_raw_spu_load error: '%s' not found!", path.wx_str());
return CELL_ENOENT;
}

View File

@ -180,7 +180,7 @@ void fsAioRead(u32 fd, mem_ptr_t<CellFsAio> aio, int xid, mem_func_ptr_t<void (*
func.async(aio, error, xid, res);
ConLog.Warning("*** fsAioRead(fd=%d, offset=0x%llx, buf_addr=0x%x, size=%d, res=%d, xid=%d [%s])",
fd, (u64)aio->offset, buf_addr, (u64)aio->size, res, xid, path.c_str());
fd, (u64)aio->offset, buf_addr, (u64)aio->size, res, xid, path.wx_str());
}
int cellFsAioRead(mem_ptr_t<CellFsAio> aio, mem32_t aio_id, mem_func_ptr_t<void (*)(mem_ptr_t<CellFsAio> xaio, u32 error, int xid, u64 size)> func)

View File

@ -67,7 +67,7 @@ u32 LoadSpuImage(vfsStream& stream)
int sys_spu_image_open(mem_ptr_t<sys_spu_image> img, u32 path_addr)
{
const wxString path = Memory.ReadString(path_addr).wx_str();
sc_spu.Warning("sys_spu_image_open(img_addr=0x%x, path_addr=0x%x [%s])", img.GetAddr(), path_addr, path.c_str());
sc_spu.Warning("sys_spu_image_open(img_addr=0x%x, path_addr=0x%x [%s])", img.GetAddr(), path_addr, path.wx_str());
if(!img.IsGood() || !Memory.IsGoodAddr(path_addr))
{
@ -148,7 +148,7 @@ int sys_spu_thread_initialize(mem32_t thread, u32 group, u32 spu_num, mem_ptr_t<
thread = group_info->list[spu_num] = new_thread.GetId();
sc_spu.Warning("*** New SPU Thread [%s] (img_offset=0x%x, ls_offset=0x%x, ep=0x%x, a1=0x%llx, a2=0x%llx, a3=0x%llx, a4=0x%llx): id=%d",
name.c_str(), (u32)img->segs_addr, ((SPUThread&)new_thread).dmac.ls_offset, spu_ep, a1, a2, a3, a4, thread.GetValue());
wxString(name).wx_str(), (u32)img->segs_addr, ((SPUThread&)new_thread).dmac.ls_offset, spu_ep, a1, a2, a3, a4, thread.GetValue());
return CELL_OK;
}
@ -294,7 +294,7 @@ int sys_spu_thread_group_create(mem32_t id, u32 num, int prio, mem_ptr_t<sys_spu
id = sc_spu.GetNewId(new SpuGroupInfo(name, num, prio, attr->type, attr->ct));
sc_spu.Warning("*** SPU Thread Group created [%s] (type=%d, option.ct=%d): id=%d",
name.c_str(), (int)attr->type, (u32)attr->ct, id.GetValue());
name.wx_str(), (int)attr->type, (u32)attr->ct, id.GetValue());
return CELL_OK;
}

View File

@ -110,7 +110,7 @@ bool Emulator::DecryptSelf(const std::string& elf, const std::string& self)
if(!f.IsOpened())
{
ConLog.Error("Could not open SELF file! (%s)", self.c_str());
ConLog.Error("Could not open SELF file! (%s)", wxString(self).wx_str());
return false;
}
@ -135,7 +135,7 @@ bool Emulator::DecryptSelf(const std::string& elf, const std::string& self)
if(!out.IsOpened())
{
ConLog.Error("Could not create ELF file! (%s)", elf.c_str());
ConLog.Error("Could not create ELF file! (%s)", wxString(elf).wx_str());
return false;
}
@ -504,7 +504,7 @@ void Emulator::LoadPoints(const std::string& path)
if(version != bpdb_version ||
(sizeof(u16) + break_count * sizeof(u64) + sizeof(u32) + marked_count * sizeof(u64) + sizeof(u32)) != length)
{
ConLog.Error("'%s' is broken", path.c_str());
ConLog.Error("'%s' is broken", wxString(path).wx_str());
return;
}

View File

@ -123,7 +123,7 @@ void LogWriter::WriteToLog(std::string prefix, std::string value, std::string co
}
if(m_logfile.IsOpened())
m_logfile.Write((prefix.empty() ? "" : std::string("[" + prefix + "]: ") + value + "\n").c_str());
m_logfile.Write(wxString(prefix.empty() ? "" : std::string("[" + prefix + "]: ") + value + "\n").wx_str());
if(!ConLogFrame) return;
@ -148,34 +148,17 @@ void LogWriter::WriteToLog(std::string prefix, std::string value, std::string co
LogBuffer.Push(LogPacket(prefix, value, colour));
}
//wxString FormatV(const wxString fmt, va_list args)
//{
// int length = 256;
// wxString str;
//
// for(;;)
// {
// str.Clear();
// wxStringBuffer buf(str, length+1);
// memset(buf, 0, length+1);
// if(vsnprintf((char *)((wxStringCharType *)buf), length, fmt, args) != -1) break;
// length *= 2;
// }
//
// return str;
//}
void LogWriter::Write(const wxString fmt, ...)
{
va_list list;
va_start(list, fmt);
wxString frmt;
frmt.PrintfV(fmt, list);
frmt = wxString::FormatV(fmt, list);
va_end(list);
WriteToLog("!", static_cast<const char *>(frmt), "White");
WriteToLog("!", (const char *)frmt.ToAscii(), "White");
}
void LogWriter::Error(const wxString fmt, ...)
@ -184,7 +167,7 @@ void LogWriter::Error(const wxString fmt, ...)
va_start(list, fmt);
wxString frmt;
frmt.PrintfV(fmt, list);
frmt = wxString::FormatV(fmt, list);
va_end(list);
@ -197,7 +180,7 @@ void LogWriter::Warning(const wxString fmt, ...)
va_start(list, fmt);
wxString frmt;
frmt.PrintfV(fmt, list);
frmt = wxString::FormatV(fmt, list);
va_end(list);
@ -210,7 +193,7 @@ void LogWriter::Success(const wxString fmt, ...)
va_start(list, fmt);
wxString frmt;
frmt.PrintfV(fmt, list);
frmt = wxString::FormatV(fmt, list);
va_end(list);
@ -279,9 +262,9 @@ void LogFrame::Task()
const int cur_item = m_log.GetItemCount();
m_log.InsertItem(cur_item, item.m_prefix.c_str());
m_log.SetItem(cur_item, 1, item.m_text.c_str());
m_log.SetItemTextColour(cur_item, item.m_colour.c_str());
m_log.InsertItem(cur_item, wxString(item.m_prefix).wx_str());
m_log.SetItem(cur_item, 1, wxString(item.m_text).wx_str());
m_log.SetItemTextColour(cur_item, wxString(item.m_colour).wx_str());
m_log.SetColumnWidth(0, -1);
m_log.SetColumnWidth(1, -1);

View File

@ -256,7 +256,7 @@ void MainFrame::InstallPkg(wxCommandEvent& WXUNUSED(event))
}
else
{
ConLog.Error("Ps3 executable not found in folder (%s)", pkgDir.c_str());
ConLog.Error("Ps3 executable not found in folder (%s)", pkgDir.wx_str());
}
}