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

34
hdrs/chip8.h Normal file
View file

@ -0,0 +1,34 @@
#ifndef CHIP8_H
# define CHIP8_H
#include <stdint.h>
#include "./memory.h"
#include "./graphics.h"
#include "./input.h"
#define FRAME_TIME_MS 1000 / 60
typedef struct s_chip8
{
t_memory memory;
t_display display;
t_keyboard keyboard;
uint8_t v[16];
uint16_t i;
uint16_t pc;
uint8_t delay_timer;
uint8_t sound_timer;
uint16_t stack[16];
uint8_t sp;
int running;
} t_chip8;
int chip8_load_rom(t_chip8 *emu, const char *path);
void chip8_init(t_chip8 *emu);
void chip8_run(t_chip8 *emu);
#endif