about summary refs log tree commit diff
path: root/emulator.h
diff options
context:
space:
mode:
Diffstat (limited to 'emulator.h')
-rw-r--r--emulator.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/emulator.h b/emulator.h
index 489ad71..fa455d9 100644
--- a/emulator.h
+++ b/emulator.h
@@ -44,11 +44,18 @@ typedef struct
 
 typedef struct
 {
+    uint8_t activated;
+    uint8_t value;
+} Key;
+
+typedef struct
+{
     volatile uint8_t is_on;
     volatile uint8_t draw_flag;
     volatile uint8_t delay_timer;
     volatile uint8_t sound_timer;
     uint8_t display[64][32];
+    Key keys[16];
     Registers regs;
     uint8_t sp; //stack pointer
     uint16_t stack[16];
@@ -62,6 +69,9 @@ int emulator_tick(Emulator* emulator);
 void emulator_step(Emulator* emulator);
 void emulator_dump_registers(Emulator* emulator);
 
+int emulator_handle_key_press(Emulator* emulator, uint8_t key);
+int emulator_handle_key_release(Emulator* emulator, uint8_t key);
+
 void* emulator_timers_thread();
 
 #endif