moved from h4570/tyra

This commit is contained in:
Sandro Sobczyński
2020-10-28 09:16:49 +01:00
commit 68eb496e11
90 changed files with 8066 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# 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