all repos — mgba @ cb48145ea3911a438d3bc214e0622341ccbb9f15

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}