all repos — mgba @ 9ba9fac898eaa647fc8db77dbed9abfa456ff22b

mGBA Game Boy Advance Emulator

src/main.c (view raw)

 1#include "gba-thread.h"
 2
 3
 4#include <fcntl.h>
 5#include <errno.h>
 6#include <signal.h>
 7#include <unistd.h>
 8
 9int main(int argc, char** argv) {
10	int fd = open("test.rom", O_RDONLY);
11
12	sigset_t signals;
13	sigaddset(&signals, SIGINT);
14	sigaddset(&signals, SIGTRAP);
15	pthread_sigmask(SIG_BLOCK, &signals, 0);
16
17	struct GBAThread context;
18	context.fd = fd;
19	pthread_t thread;
20	GBAThreadStart(&context, &thread);
21
22	pthread_join(thread, 0);
23	close(fd);
24
25	return 0;
26}