diff options
author | Daniel Jones <admin@danieljon.es> | 2020-08-18 16:20:57 +0930 |
---|---|---|
committer | Daniel Jones <admin@danieljon.es> | 2020-08-18 16:20:57 +0930 |
commit | a9eefc680b3c385747a11f9110b35bfed58d6246 (patch) | |
tree | 92b5fe63bd57cf425ed19ca85a7058e51af4e0a5 /main.c | |
parent | 1afab3de249c6e2740c066f4074459ed048d8306 (diff) | |
download | chip8-a9eefc680b3c385747a11f9110b35bfed58d6246.tar.gz chip8-a9eefc680b3c385747a11f9110b35bfed58d6246.zip |
replace magic numbers with constants
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -45,7 +45,6 @@ quit() SDL_DestroyRenderer(renderer); SDL_DestroyWindow(window); SDL_Quit(); - } void @@ -72,7 +71,7 @@ toggle_pixel(int x, int y) // TODO: clean uint32_t dos = video[WIDTH*y+x]; if (dos <= 0) - video[WIDTH*y+x] = (255<<16)|(255<<8)|255; + video[WIDTH*y+x] = PIXEL_COLOR; else video[WIDTH*y+x] = 0; } @@ -207,7 +206,10 @@ int main(int argc, char *argv[]) chip8_cycle(); if (draw_flag) + { update_video(); + draw_flag = 0; + } frame_time = SDL_GetTicks() - frame_start; if (frame_delay > frame_time) |