about summary refs log tree commit diff
path: root/emulator.h
diff options
context:
space:
mode:
authorManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2021-07-24 20:58:06 +0100
committerManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2021-07-24 20:58:06 +0100
commit5d8e1534937fefdf557dbde091a4bbfb34d603f1 (patch)
tree85b5cf473bd0209ad15762760ec5de6594d4d6ac /emulator.h
parentFeature: Implemented various instructions and added a few roms (diff)
downloadCHIP8-Emulator-5d8e1534937fefdf557dbde091a4bbfb34d603f1.tar.gz
CHIP8-Emulator-5d8e1534937fefdf557dbde091a4bbfb34d603f1.tar.bz2
CHIP8-Emulator-5d8e1534937fefdf557dbde091a4bbfb34d603f1.zip
Misc: Added the timer thread variable to the emulator struct
This way we can keep track of the thread to join it on
emulator_deinitialise()
Diffstat (limited to 'emulator.h')
-rw-r--r--emulator.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/emulator.h b/emulator.h
index fa455d9..2df3665 100644
--- a/emulator.h
+++ b/emulator.h
@@ -54,6 +54,7 @@ typedef struct
     volatile uint8_t draw_flag;
     volatile uint8_t delay_timer;
     volatile uint8_t sound_timer;
+    pthread_t timers_thread;
     uint8_t display[64][32];
     Key keys[16];
     Registers regs;
@@ -64,6 +65,7 @@ typedef struct
 } Emulator;
 
 int emulator_initialise(Emulator* emulator);
+int emulator_deinitialise(Emulator* emulator);
 int emulator_load_rom(Emulator* emulator, char* rom_name);
 int emulator_tick(Emulator* emulator);
 void emulator_step(Emulator* emulator);