feat: initial version
This commit is contained in:
parent
0a67fb21d1
commit
ee790e99d6
12 changed files with 798 additions and 0 deletions
26
hdrs/input.h
Normal file
26
hdrs/input.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#ifndef INPUT_H
|
||||
#define INPUT_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <SDL2/SDL.h>
|
||||
|
||||
#define KEY_COUNT 16
|
||||
|
||||
struct s_chip8;
|
||||
typedef struct s_chip8 t_chip8;
|
||||
|
||||
typedef struct s_keyboard
|
||||
{
|
||||
uint8_t keyboard[KEY_COUNT];
|
||||
uint8_t waiting_for_key;
|
||||
uint8_t key_pressed;
|
||||
uint8_t key_register;
|
||||
} t_keyboard;
|
||||
|
||||
|
||||
void input_update(SDL_Event *event, uint8_t *keyboard);
|
||||
uint8_t map_sdl_to_chip8(SDL_Keycode key);
|
||||
uint8_t get_pressed_key(t_chip8 *emu);
|
||||
|
||||
|
||||
#endif // INPUT_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue