From fee145244c14a8617c9a3c09f7273b357e636397 Mon Sep 17 00:00:00 2001 From: John Peterson Date: Tue, 9 Dec 2008 05:37:15 +0000 Subject: Wiimote: Added optional status icons for the Wiimote speaker and leds. And a few other small changes. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1455 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/StringUtil.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Source/Core/Common/Src/StringUtil.cpp') diff --git a/Source/Core/Common/Src/StringUtil.cpp b/Source/Core/Common/Src/StringUtil.cpp index 597e5fc620..9ace3e1899 100644 --- a/Source/Core/Common/Src/StringUtil.cpp +++ b/Source/Core/Common/Src/StringUtil.cpp @@ -123,6 +123,25 @@ std::string StringFromFormat(const char* format, ...) } +// =================================================== +/* For Debugging. Read out an u8 array. */ +// ---------------- +std::string ArrayToString(const u8 *data, u32 size, u32 offset, int line_len) +{ + //const u8* _data = (const u8*)data; + std::string Temp; + for (u32 i = 0; i < size; i++) + { + char Buffer[128]; + sprintf(Buffer, "%02x ", data[i + offset]); + if((i + 1) % line_len == 0) Temp.append("\n"); // break long lines + Temp.append(Buffer); + } + return Temp; +} +// ================ + + void ToStringFromFormat(std::string* out, const char* format, ...) { va_list args; -- cgit v1.2.3