added controller input

This commit is contained in:
Lauchmelder 2021-10-30 21:01:27 +02:00
parent 640df2feb2
commit 674ee5059b
6 changed files with 83 additions and 5 deletions
NES Emulator

32
NES Emulator/controller.h Normal file
View file

@ -0,0 +1,32 @@
#ifndef _CONTROLLER_H_
#define _CONTROLLER_H_
#include "types.h"
struct Controller
{
union
{
struct
{
Byte A : 1;
Byte B : 1;
Byte Select : 1;
Byte Start : 1;
Byte Up : 1;
Byte Down : 1;
Byte Left : 1;
Byte Right : 1;
};
Byte raw;
} data;
Byte strobe;
Byte latch;
};
Byte pollInput(struct Controller* controller);
void fillRegister(struct Controller* controller);
#endif // _CONTROLLER_H_