37 lines
536 B
C++
37 lines
536 B
C++
//
|
|
// Created by selim on 9/17/23.
|
|
//
|
|
|
|
#ifndef NES_CONTROLLER_H
|
|
#define NES_CONTROLLER_H
|
|
|
|
#include <cstdint>
|
|
|
|
namespace nes {
|
|
|
|
class Controller {
|
|
public:
|
|
enum Key: uint8_t {
|
|
A = 7,
|
|
B = 6,
|
|
Select = 5,
|
|
Start = 4,
|
|
Up = 3,
|
|
Down = 2,
|
|
Left = 1,
|
|
Right = 0
|
|
};
|
|
|
|
public:
|
|
Controller();
|
|
uint8_t read();
|
|
virtual void poll();
|
|
|
|
protected:
|
|
uint8_t _data;
|
|
};
|
|
|
|
}
|
|
|
|
#endif //NES_CONTROLLER_H
|