summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chip8.c3
-rw-r--r--ui_sdl.c6
2 files changed, 4 insertions, 5 deletions
diff --git a/chip8.c b/chip8.c
index 9c3d7eb..a6dfbd5 100644
--- a/chip8.c
+++ b/chip8.c
@@ -1,10 +1,9 @@
+#define _XOPEN_SOURCE 500
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
-#include <math.h>
-#include <time.h>
#ifdef _WIN32
#include <winsock.h>
diff --git a/ui_sdl.c b/ui_sdl.c
index 7ac32ca..f046cd1 100644
--- a/ui_sdl.c
+++ b/ui_sdl.c
@@ -17,8 +17,8 @@
SDL_Renderer *r;
void setup(void) {
- SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO);
- SDL_Window* win = SDL_CreateWindow("chip8", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, W, H, SDL_WINDOW_SHOWN);
+ SDL_Init(SDL_INIT_VIDEO);
+ SDL_Window* win = SDL_CreateWindow("chip8", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, W, H, SDL_WINDOW_SHOWN|SDL_WINDOW_RESIZABLE);
r = SDL_CreateRenderer(win, -1, SDL_RENDERER_PRESENTVSYNC|SDL_RENDERER_ACCELERATED);
SDL_RenderClear(r);
}
@@ -44,7 +44,7 @@ void draw(void) {
int main(int argc, char* argv[]) {
if (argc != 2) {
- printf("./%s <rom file>\n", argv[0]);
+ printf("%s <rom file>\n", argv[0]);
return 1;
}