feat: initial version

This commit is contained in:
Zoëy Noort 2025-05-05 18:50:56 +02:00
parent 0a67fb21d1
commit ee790e99d6
12 changed files with 798 additions and 0 deletions

26
hdrs/input.h Normal file
View 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