mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
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:
@ -206,7 +206,7 @@ bool IniFile::DeleteKey(const char* sectionName, const char* key)
|
||||
return false; //shouldn't happen
|
||||
}
|
||||
|
||||
|
||||
// Return a list of all keys in a section
|
||||
bool IniFile::GetKeys(const char* sectionName, std::vector<std::string>& keys) const
|
||||
{
|
||||
const Section* section = GetSection(sectionName);
|
||||
@ -228,7 +228,7 @@ bool IniFile::GetKeys(const char* sectionName, std::vector<std::string>& keys) c
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Return a list of all lines in a section
|
||||
bool IniFile::GetLines(const char* sectionName, std::vector<std::string>& lines) const
|
||||
{
|
||||
const Section* section = GetSection(sectionName);
|
||||
|
@ -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);
|
||||
|
@ -63,6 +63,8 @@ bool TryParseUInt(const std::string& str, u32* output);
|
||||
|
||||
// TODO: kill this
|
||||
bool AsciiToHex(const char* _szValue, u32& result);
|
||||
u32 Ascii2Hex(std::string _Text);
|
||||
std::string Hex2Ascii(u32 _Text);
|
||||
|
||||
void SplitString(const std::string& str, const std::string& delim, std::vector<std::string>& output);
|
||||
int ChooseStringFrom(const char* str, const char* * items);
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "Timer.h"
|
||||
#include "Common.h"
|
||||
#include "ConsoleWindow.h"
|
||||
#include "StringUtil.h"
|
||||
|
||||
#include "Console.h"
|
||||
#include "Core.h"
|
||||
@ -389,6 +390,8 @@ THREAD_RETURN EmuThread(void *pArg)
|
||||
{
|
||||
SWiimoteInitialize WiimoteInitialize;
|
||||
WiimoteInitialize.hWnd = g_pWindowHandle;
|
||||
// Add the ISO Id
|
||||
WiimoteInitialize.ISOId = Ascii2Hex(_CoreParameter.m_strUniqueID);
|
||||
WiimoteInitialize.pLog = Callback_WiimoteLog;
|
||||
WiimoteInitialize.pWiimoteInput = Callback_WiimoteInput;
|
||||
// Wait for Wiiuse to find the number of connected Wiimotes
|
||||
@ -684,7 +687,7 @@ const char *Callback_ISOName(void)
|
||||
else
|
||||
return (const char *)"";
|
||||
}
|
||||
|
||||
|
||||
// __________________________________________________________________________________________________
|
||||
// Called from ANY thread!
|
||||
void Callback_KeyPress(int key, bool shift, bool control)
|
||||
|
@ -452,6 +452,7 @@ void CGameListCtrl::ScanForISOs()
|
||||
sprintf(tempstring,"Scanning %s", FileName.c_str());
|
||||
msg = wxString::FromAscii(tempstring);
|
||||
|
||||
// Update with the progress (i) and the message (msg)
|
||||
bool Cont = dialog.Update(i, msg);
|
||||
|
||||
if (!Cont)
|
||||
|
Reference in New Issue
Block a user