summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorDaniel Jones <admin@danieljon.es>2020-08-30 16:17:45 +0930
committerDaniel Jones <admin@danieljon.es>2020-08-30 16:17:45 +0930
commitc2c45b45f981e557838943c6f24329c51b1adb4b (patch)
tree11d162c4a65865c3e4810515d9a1b17115211ccc /main.c
parent72a80b66f979cce2318e0b4c1df1fae7175b4d2c (diff)
downloadchip8-c2c45b45f981e557838943c6f24329c51b1adb4b.tar.gz
chip8-c2c45b45f981e557838943c6f24329c51b1adb4b.zip
move timers to a function
Diffstat (limited to 'main.c')
-rw-r--r--main.c28
1 files changed, 5 insertions, 23 deletions
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;