From c2c45b45f981e557838943c6f24329c51b1adb4b Mon Sep 17 00:00:00 2001 From: Daniel Jones Date: Sun, 30 Aug 2020 16:17:45 +0930 Subject: move timers to a function --- main.c | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 0b7eb83..44a7bfc 100644 --- a/main.c +++ b/main.c @@ -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; -- cgit v1.2.3