diff options
| author | John Peterson <jpeterson57@gmail.com> | 2008-12-09 05:37:15 +0000 |
|---|---|---|
| committer | John Peterson <jpeterson57@gmail.com> | 2008-12-09 05:37:15 +0000 |
| commit | fee145244c14a8617c9a3c09f7273b357e636397 (patch) | |
| tree | 6a0212bc47e102459d96751645dd51e911fc48d5 /Source/Core/Common/Src/StringUtil.cpp | |
| parent | 668337eb84971922877c7f7707077d3c469008c3 (diff) | |
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
Diffstat (limited to 'Source/Core/Common/Src/StringUtil.cpp')
| -rw-r--r-- | Source/Core/Common/Src/StringUtil.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
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; |
