Files
tyra-linux/src/engine/include/modules/pad.hpp
T
Sandro Sobczyński 68eb496e11 moved from h4570/tyra
2020-10-28 09:16:49 +01:00

44 lines
970 B
C++

/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2020, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#ifndef _TYRA_PAD_
#define _TYRA_PAD_
#include <tamtypes.h>
#include <libpad.h>
/** Class responsible for player pad */
class Pad
{
public:
u8 isCrossClicked, isSquareClicked, isTriangleClicked, isCircleClicked;
u8 isDpadUpPressed, isDpadDownPressed, isDpadLeftPressed, isDpadRightPressed;
u8 lJoyH, lJoyV, rJoyH, rJoyV;
Pad();
~Pad();
void update();
private:
char padBuf[256] __attribute__((aligned(64)));
char actAlign[6];
int actuators, ret, port, slot;
padButtonStatus buttons;
u32 padData, oldPad, newPad;
void reset();
void loadModules();
int waitPadReady();
int initPad();
};
#endif