all repos — mgba @ fffe39153f54a2318153677864a02707ae855bff

mGBA Game Boy Advance Emulator

src/main.c (view raw)

 1#include "gba-thread.h"
 2#include "renderers/video-software.h"
 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	struct GBAVideoSoftwareRenderer renderer;
19	context.fd = fd;
20	context.renderer = 0;
21	pthread_t thread;
22
23	GBAThreadStart(&context, &thread);
24
25	pthread_join(thread, 0);
26	close(fd);
27
28	return 0;
29}