aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index fcd42a4..29c4d5e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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
25typedef struct timespec Time; 26typedef struct timespec Time;
26 27
28void
29halt(int stub) {
30 (void)stub;
31 set_tty(false);
32 exit(EXIT_SUCCESS);
33}
34
27Time 35Time
28time_now(){ 36time_now(){
29 struct timespec t; 37 struct timespec t;
@@ -446,6 +454,8 @@ load_rom(char *file_name) {
446 454
447void 455void
448init_uxn(Uxn *u, char *file_name) { 456init_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