diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -1,4 +1,5 @@ | |||
1 | #include <errno.h> | 1 | #include <errno.h> |
2 | #include <signal.h> | ||
2 | #include <stdbool.h> | 3 | #include <stdbool.h> |
3 | #include <stdint.h> | 4 | #include <stdint.h> |
4 | #include <stdio.h> | 5 | #include <stdio.h> |
@@ -24,6 +25,13 @@ static Device *devmouse; | |||
24 | 25 | ||
25 | typedef struct timespec Time; | 26 | typedef struct timespec Time; |
26 | 27 | ||
28 | void | ||
29 | halt(int stub) { | ||
30 | (void)stub; | ||
31 | set_tty(false); | ||
32 | exit(EXIT_SUCCESS); | ||
33 | } | ||
34 | |||
27 | Time | 35 | Time |
28 | time_now(){ | 36 | time_now(){ |
29 | struct timespec t; | 37 | struct timespec t; |
@@ -446,6 +454,8 @@ load_rom(char *file_name) { | |||
446 | 454 | ||
447 | void | 455 | void |
448 | init_uxn(Uxn *u, char *file_name) { | 456 | init_uxn(Uxn *u, char *file_name) { |
457 | signal(SIGINT, halt); | ||
458 | |||
449 | // Setup UXN memory. | 459 | // Setup UXN memory. |
450 | uxn_boot(u, calloc(0x10000, sizeof(u8))); | 460 | uxn_boot(u, calloc(0x10000, sizeof(u8))); |
451 | 461 | ||