diff options
author | Daniel Jones <admin@danieljon.es> | 2020-08-30 16:17:45 +0930 |
---|---|---|
committer | Daniel Jones <admin@danieljon.es> | 2020-08-30 16:17:45 +0930 |
commit | c2c45b45f981e557838943c6f24329c51b1adb4b (patch) | |
tree | 11d162c4a65865c3e4810515d9a1b17115211ccc /main.c | |
parent | 72a80b66f979cce2318e0b4c1df1fae7175b4d2c (diff) | |
download | chip8-c2c45b45f981e557838943c6f24329c51b1adb4b.tar.gz chip8-c2c45b45f981e557838943c6f24329c51b1adb4b.zip |
move timers to a function
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 28 |
1 files changed, 5 insertions, 23 deletions
@@ -29,7 +29,6 @@ */ //#define VIDEO_SCALE 5 -#define STEPPING 0 // set to 1 to step manually through program SDL_Window *window; SDL_Renderer *renderer; @@ -236,30 +235,13 @@ int main(int argc, char *argv[]) // logic do_quit = handle_sdl_events(); - if (STEPPING) - { - if (step_cycle == 1) - { - chip8_cycle(); + chip8_cycle(); + chip8_timer_cycle(); - if (draw_flag) - { - update_video(); - draw_flag = 0; - } - - step_cycle = 0; - } - } - else + if (draw_flag) { - chip8_cycle(); - - if (draw_flag) - { - update_video(); - draw_flag = 0; - } + update_video(); + draw_flag = 0; } frame_time = SDL_GetTicks() - frame_start; |