dolphin/Source/Plugins/Plugin_WiimoteNew/Src/WiimoteEmu/Attachment/Attachment.cpp
Jordan Woyak d8906d2a0c Commited my new wiimote plugin work so far. Some code was copied from the current wiimote plugin. I have cleaned up most of the functions, but there are still a bunch of unused structs and stuff that I need to clean up.
Moved ControllerInterface to InputCommon. Moved GCPadNew GUI/Config code to a new project, InputPluginCommon. It is used by both GCPadNew and WiimoteNew. I hope that I included everyone's fixes to GCPadNew and ControllerInterface.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5355 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-04-13 05:15:38 +00:00

36 lines
921 B
C++

#include "Attachment.h"
namespace WiimoteEmu
{
// Extension device IDs to be written to the last bytes of the extension reg
static const u8 gh3glp_id[] = { 0x00, 0x00, 0xa4, 0x20, 0x01, 0x03 };
static const u8 ghwtdrums_id[] = { 0x01, 0x00, 0xa4, 0x20, 0x01, 0x03 };
// The id for nothing inserted
static const u8 nothing_id[] = { 0x00, 0x00, 0x00, 0x00, 0x2e, 0x2e };
// The id for a partially inserted extension
static const u8 partially_id[] = { 0x00, 0x00, 0x00, 0x00, 0xff, 0xff };
Attachment::Attachment( const char* const _name ) : name( _name )
{
reg.resize( WIIMOTE_REG_EXT_SIZE, 0);
}
None::None() : Attachment( "None" )
{
// set up register
memcpy( &reg[0xfa], nothing_id, sizeof(nothing_id) );
}
std::string Attachment::GetName() const
{
return name;
}
}
void ControllerEmu::Extension::GetState( u8* const data )
{
((WiimoteEmu::Attachment*)attachments[ active_extension ])->GetState( data );
}