all repos — mgba @ 678c5465ffc017d4dfa8b999cbdd3869db717cb1

mGBA Game Boy Advance Emulator

Add (currently undocumented) command line flag for setting logging level
Jeffrey Pfau jeffrey@endrift.com
Fri, 04 Jul 2014 18:43:07 -0700
commit

678c5465ffc017d4dfa8b999cbdd3869db717cb1

parent

80d1764e6c94c6c2088668b576fa785648d81f18

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

jump to
M src/gba/gba-thread.csrc/gba/gba-thread.c

@@ -75,6 +75,7 @@ ARMInit(&cpu);

ARMReset(&cpu); threadContext->gba = &gba; gba.sync = &threadContext->sync; + gba.logLevel = threadContext->logLevel; #ifdef USE_PTHREADS pthread_setspecific(_contextKey, threadContext); #else

@@ -169,6 +170,7 @@ threadContext->fd = opts->fd;

threadContext->fname = opts->fname; threadContext->biosFd = opts->biosFd; threadContext->frameskip = opts->frameskip; + threadContext->logLevel = opts->logLevel; threadContext->rewindBufferCapacity = opts->rewindBufferCapacity; threadContext->rewindBufferInterval = opts->rewindBufferInterval; }
M src/gba/gba-thread.hsrc/gba/gba-thread.h

@@ -58,6 +58,7 @@ Condition stateCond;

enum ThreadState savedState; GBALogHandler logHandler; + int logLevel; ThreadCallback startCallback; ThreadCallback cleanCallback; ThreadCallback frameCallback;
M src/platform/commandline.csrc/platform/commandline.c

@@ -44,7 +44,7 @@ opts->biosFd = -1;

int ch; char options[64] = - "b:s:" + "b:l:s:" #ifdef USE_CLI_DEBUGGER "d" #endif

@@ -77,6 +77,9 @@ }

opts->debuggerType = DEBUGGER_GDB; break; #endif + case 'l': + opts->logLevel = atoi(optarg); + break; case 's': opts->frameskip = atoi(optarg); break;
M src/platform/commandline.hsrc/platform/commandline.h

@@ -18,6 +18,7 @@ struct StartupOptions {

int fd; const char* fname; int biosFd; + int logLevel; int frameskip; int rewindBufferCapacity; int rewindBufferInterval;