added controller input
This commit is contained in:
parent
640df2feb2
commit
674ee5059b
6 changed files with 83 additions and 5 deletions
NES Emulator
32
NES Emulator/controller.h
Normal file
32
NES Emulator/controller.h
Normal 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_
|
Loading…
Add table
Add a link
Reference in a new issue