all repos — mgba @ 7c895f6091fe282f53d2f54d3e90ed5588955e2a

mGBA Game Boy Advance Emulator

Load files from arg 1
Jeffrey Pfau jeffrey@endrift.com
Fri, 26 Apr 2013 01:50:14 -0700
commit

7c895f6091fe282f53d2f54d3e90ed5588955e2a

parent

301c07dda345f6c0c0bbed61eb61865333cbb425

1 files changed, 8 insertions(+), 3 deletions(-)

jump to
M src/main.csrc/main.c

@@ -38,9 +38,14 @@ 0, 1

}; int main(int argc, char** argv) { - (void)(argc); - (void)(argv); - int fd = open("test.rom", O_RDONLY); + const char* fname = "test.rom"; + if (argc > 1) { + fname = argv[1]; + } + int fd = open(fname, O_RDONLY); + if (fd < 0) { + return 1; + } sigset_t signals; sigaddset(&signals, SIGINT);