CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/Core/HLE/sceCtrl.h
Views: 1401
// Copyright (c) 2012- PPSSPP Project.12// This program is free software: you can redistribute it and/or modify3// it under the terms of the GNU General Public License as published by4// the Free Software Foundation, version 2.0 or later versions.56// This program is distributed in the hope that it will be useful,7// but WITHOUT ANY WARRANTY; without even the implied warranty of8// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9// GNU General Public License 2.0 for more details.1011// A copy of the GPL 2.0 should have been included with the program.12// If not, see http://www.gnu.org/licenses/1314// Official git repository and contact information can be found at15// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.1617#pragma once1819#include "Common/CommonTypes.h"2021class PointerWrap;2223void Register_sceCtrl();2425const int CTRL_STICK_LEFT = 0;26// The actual PSP only has one, but HD remasters expose this, maybe also the emulator on the PSP/Vita.27const int CTRL_STICK_RIGHT = 1;2829#define CTRL_SQUARE 0x800030#define CTRL_TRIANGLE 0x100031#define CTRL_CIRCLE 0x200032#define CTRL_CROSS 0x400033#define CTRL_UP 0x001034#define CTRL_DOWN 0x004035#define CTRL_LEFT 0x008036#define CTRL_RIGHT 0x002037#define CTRL_START 0x000838#define CTRL_SELECT 0x000139#define CTRL_LTRIGGER 0x010040#define CTRL_RTRIGGER 0x02004142// System-ish buttons. Not generally used by games.43#define CTRL_HOME 0x0001000044#define CTRL_HOLD 0x0002000045#define CTRL_WLAN 0x0004000046#define CTRL_REMOTE_HOLD 0x0008000047#define CTRL_VOL_UP 0x0010000048#define CTRL_VOL_DOWN 0x0020000049#define CTRL_SCREEN 0x0040000050#define CTRL_NOTE 0x0080000051#define CTRL_DISC 0x0100000052#define CTRL_MEMSTICK 0x0200000053#define CTRL_FORWARD 0x1000000054#define CTRL_BACK 0x2000000055#define CTRL_PLAYPAUSE 0x400000005657// Obscure extra keys that were never mapped to hardware, but can be used to bring up the debug menu in SOTN, see issue #1746458#define CTRL_L3 0x000259#define CTRL_R3 0x000460#define CTRL_L2 0x040061#define CTRL_R2 0x08006263#define CTRL_MASK_DPAD (CTRL_UP | CTRL_DOWN | CTRL_LEFT | CTRL_RIGHT)64#define CTRL_MASK_ACTION (CTRL_SQUARE | CTRL_TRIANGLE | CTRL_CIRCLE | CTRL_CROSS)65#define CTRL_MASK_TRIGGER (CTRL_LTRIGGER | CTRL_RTRIGGER)66#define CTRL_MASK_USER (CTRL_MASK_DPAD | CTRL_MASK_ACTION | CTRL_START | CTRL_SELECT | CTRL_MASK_TRIGGER | CTRL_HOME | CTRL_HOLD | CTRL_WLAN | CTRL_REMOTE_HOLD | CTRL_VOL_UP | CTRL_VOL_DOWN | CTRL_SCREEN | CTRL_NOTE | CTRL_L2 | CTRL_L3 | CTRL_R2 | CTRL_R3)6768void __CtrlInit();69void __CtrlDoState(PointerWrap &p);70void __CtrlShutdown();7172// Clears and sets selected buttons. NOTE: Clearing happens first.73void __CtrlUpdateButtons(u32 bitsToSet, u32 bitsToClear);7475// Call this to set the position of an analog stick, ideally when it changes.76// X and Y values should be from -1 to 1, inclusive, in a square (no need to force to a circle.)77// No deadzone filtering is done (but note that this applies to the actual PSP as well.)78void __CtrlSetAnalogXY(int stick, float x, float y);79void __CtrlSetAnalogX(int stick, float x);80void __CtrlSetAnalogY(int stick, float y);8182// Call this to enable rapid-fire. This will cause buttons other than arrows to alternate.83void __CtrlSetRapidFire(bool state, int interval);84bool __CtrlGetRapidFire();8586// For use by internal UI like MsgDialog87u32 __CtrlPeekButtons();88u32 __CtrlPeekButtonsVisual(); // also incorporates rapid-fire89void __CtrlPeekAnalog(int stick, float *x, float *y);90u32 __CtrlReadLatch();9192void Register_sceCtrl_driver();9394u16 sceCtrlGetRightVibration();95u16 sceCtrlGetLeftVibration();9697namespace SceCtrl {98void SetLeftVibration(u16 lVibration);99void SetRightVibration(u16 rVibration);100void SetVibrationLeftDropout(u8 vibrationLDropout);101void SetVibrationRightDropout(u8 vibrationRDropout);102};103104105