Emulated Wiimote: Added game specific Wiimote cursor configuration. The IR pointer settings will be saved for the ISO id of the ISO that is loaded. This is necessary because there is no common way of treating the IR pointer positions. The IR data use a virtual resolution of 1024 x 768, but there is no consistency of where such a point is on the screen.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2314 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2009-02-20 03:13:22 +00:00
parent 4883727384
commit 59734ddc86
19 changed files with 365 additions and 136 deletions

View File

@ -66,6 +66,40 @@ bool AsciiToHex(const char* _szValue, u32& result)
return (true);
}
//////////////////////////////////////////////////////////////////////////////////////////
// Convert AB to it's ascii table entry numbers 0x4142
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
u32 Ascii2Hex(std::string _Text)
{
// Reset the return value zero
u32 Result = 0;
// Max 32-bit values are supported
int Length = _Text.length(); if (Length > 4) Length = 4;
for (int i = 0; i < Length; i++)
{
// Add up the values, for example RSPE becomes, 0x52000000, then 0x52530000 and so on
Result += _Text.c_str()[i] << (Length - 1 - i)*8;
}
// Return the value
return Result;
}
// Convert it back again
std::string Hex2Ascii(u32 _Text)
{
// Create temporary storate
char Result[4];
// Go through the four characters
sprintf(Result, "%c%c%c%c", _Text >> 24, _Text >> 16, _Text >> 8, _Text);
// Return the string
std::string StrResult = Result;
return StrResult;
}
///////////////////////////
bool CharArrayFromFormatV(char* out, int outsize, const char* format, va_list args)
{
int writtenCount = vsnprintf(out, outsize, format, args);