2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2010 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2013-04-18 02:43:11 +00:00
|
|
|
// Refer to the license.txt file included.
|
2010-10-12 19:42:29 +00:00
|
|
|
|
2014-02-10 18:54:46 +00:00
|
|
|
#pragma once
|
2010-10-12 19:42:29 +00:00
|
|
|
|
2016-01-13 03:34:13 +00:00
|
|
|
#include "Common/Common.h"
|
2016-06-24 16:46:48 +00:00
|
|
|
#include "Common/CommonTypes.h"
|
2015-05-08 21:28:03 +00:00
|
|
|
|
|
|
|
class InputConfig;
|
2016-01-13 03:34:13 +00:00
|
|
|
class PointerWrap;
|
2017-02-09 03:15:43 +00:00
|
|
|
|
|
|
|
namespace ControllerEmu
|
|
|
|
{
|
|
|
|
class ControlGroup;
|
|
|
|
}
|
|
|
|
|
2016-11-11 03:07:40 +00:00
|
|
|
namespace WiimoteEmu
|
|
|
|
{
|
|
|
|
enum class WiimoteGroup;
|
|
|
|
enum class NunchukGroup;
|
|
|
|
enum class ClassicGroup;
|
|
|
|
enum class GuitarGroup;
|
|
|
|
enum class DrumsGroup;
|
|
|
|
enum class TurntableGroup;
|
|
|
|
}
|
2010-10-12 19:42:29 +00:00
|
|
|
|
2014-02-17 04:51:41 +00:00
|
|
|
enum
|
|
|
|
{
|
2016-06-24 08:43:46 +00:00
|
|
|
WIIMOTE_CHAN_0 = 0,
|
|
|
|
WIIMOTE_CHAN_1,
|
|
|
|
WIIMOTE_CHAN_2,
|
|
|
|
WIIMOTE_CHAN_3,
|
|
|
|
WIIMOTE_BALANCE_BOARD,
|
|
|
|
MAX_WIIMOTES = WIIMOTE_BALANCE_BOARD,
|
|
|
|
MAX_BBMOTES = 5,
|
2013-05-18 08:31:37 +00:00
|
|
|
};
|
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
#define WIIMOTE_INI_NAME "WiimoteNew"
|
2010-10-12 19:42:29 +00:00
|
|
|
|
2011-01-07 15:18:00 +00:00
|
|
|
enum
|
|
|
|
{
|
2016-06-24 08:43:46 +00:00
|
|
|
WIIMOTE_SRC_NONE = 0,
|
|
|
|
WIIMOTE_SRC_EMU = 1,
|
|
|
|
WIIMOTE_SRC_REAL = 2,
|
2011-01-07 15:18:00 +00:00
|
|
|
};
|
2010-10-12 19:42:29 +00:00
|
|
|
|
2013-05-18 08:31:37 +00:00
|
|
|
extern unsigned int g_wiimote_sources[MAX_BBMOTES];
|
2010-10-12 19:42:29 +00:00
|
|
|
|
|
|
|
namespace Wiimote
|
|
|
|
{
|
2016-07-07 13:40:14 +00:00
|
|
|
enum class InitializeMode
|
|
|
|
{
|
|
|
|
DO_WAIT_FOR_WIIMOTES,
|
|
|
|
DO_NOT_WAIT_FOR_WIIMOTES,
|
|
|
|
};
|
|
|
|
|
2010-10-12 19:42:29 +00:00
|
|
|
void Shutdown();
|
2016-10-11 19:54:35 +00:00
|
|
|
void Initialize(InitializeMode init_mode);
|
2017-07-19 07:55:45 +00:00
|
|
|
void Connect(unsigned int index, bool connect);
|
2015-12-23 04:26:18 +00:00
|
|
|
void ResetAllWiimotes();
|
2015-03-05 08:49:10 +00:00
|
|
|
void LoadConfig();
|
2013-05-31 05:12:59 +00:00
|
|
|
void Resume();
|
|
|
|
void Pause();
|
2010-10-12 19:42:29 +00:00
|
|
|
|
|
|
|
unsigned int GetAttached();
|
2015-10-01 06:48:32 +00:00
|
|
|
void DoState(PointerWrap& p);
|
2014-08-31 04:04:15 +00:00
|
|
|
InputConfig* GetConfig();
|
2016-11-11 03:07:40 +00:00
|
|
|
ControllerEmu::ControlGroup* GetWiimoteGroup(int number, WiimoteEmu::WiimoteGroup group);
|
|
|
|
ControllerEmu::ControlGroup* GetNunchukGroup(int number, WiimoteEmu::NunchukGroup group);
|
|
|
|
ControllerEmu::ControlGroup* GetClassicGroup(int number, WiimoteEmu::ClassicGroup group);
|
|
|
|
ControllerEmu::ControlGroup* GetGuitarGroup(int number, WiimoteEmu::GuitarGroup group);
|
|
|
|
ControllerEmu::ControlGroup* GetDrumsGroup(int number, WiimoteEmu::DrumsGroup group);
|
|
|
|
ControllerEmu::ControlGroup* GetTurntableGroup(int number, WiimoteEmu::TurntableGroup group);
|
2010-10-12 19:42:29 +00:00
|
|
|
|
2017-05-06 10:44:56 +00:00
|
|
|
void ControlChannel(int number, u16 channel_id, const void* data, u32 size);
|
|
|
|
void InterruptChannel(int number, u16 channel_id, const void* data, u32 size);
|
2017-07-14 22:08:57 +00:00
|
|
|
bool ButtonPressed(int number);
|
2017-05-06 10:44:56 +00:00
|
|
|
void Update(int number, bool connected);
|
2017-07-14 22:33:23 +00:00
|
|
|
bool NetPlay_GetButtonPress(int wiimote, bool pressed);
|
2010-10-12 19:42:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace WiimoteReal
|
|
|
|
{
|
2016-07-07 13:40:14 +00:00
|
|
|
void Initialize(::Wiimote::InitializeMode init_mode);
|
2013-07-31 14:09:18 +00:00
|
|
|
void Stop();
|
2010-10-12 19:42:29 +00:00
|
|
|
void Shutdown();
|
2013-05-31 05:12:59 +00:00
|
|
|
void Resume();
|
|
|
|
void Pause();
|
2010-10-12 19:42:29 +00:00
|
|
|
void Refresh();
|
|
|
|
|
|
|
|
void LoadSettings();
|
|
|
|
}
|