Core: Have per-core input information
Vicki Pfau vi@endrift.com
Thu, 23 Mar 2017 19:52:57 -0700
4 files changed,
19 insertions(+),
2 deletions(-)
M
include/mgba/core/core.h
→
include/mgba/core/core.h
@@ -50,6 +50,7 @@ struct mDirectorySet dirs;
#endif #ifndef MINIMAL_CORE struct mInputMap inputMap; + const struct mInputPlatformInfo* inputInfo; #endif struct mCoreConfig config; struct mCoreOptions opts;
M
src/gb/core.c
→
src/gb/core.c
@@ -20,6 +20,10 @@ #include <mgba-util/memory.h>
#include <mgba-util/patch.h> #include <mgba-util/vfs.h> +#ifndef MINIMAL_CORE +#include <mgba/internal/gba/input.h> +#endif + struct GBCore { struct mCore d; struct GBVideoSoftwareRenderer renderer;@@ -62,7 +66,11 @@
#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 mDirectorySetInit(&core->dirs); #endif - + +#ifndef MINIMAL_CORE + core->inputInfo = &GBAInputInfo; // TODO: GBInputInfo +#endif + return true; }
M
src/gba/core.c
→
src/gba/core.c
@@ -22,6 +22,10 @@ #include <mgba-util/memory.h>
#include <mgba-util/patch.h> #include <mgba-util/vfs.h> +#ifndef MINIMAL_CORE +#include <mgba/internal/gba/input.h> +#endif + struct GBACore { struct mCore d; struct GBAVideoSoftwareRenderer renderer;@@ -74,6 +78,10 @@ gba->keySource = &gbacore->keys;
#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 mDirectorySetInit(&core->dirs); +#endif + +#ifndef MINIMAL_CORE + core->inputInfo = &GBAInputInfo; #endif return true;
M
src/platform/sdl/main.c
→
src/platform/sdl/main.c
@@ -98,7 +98,7 @@ freeArguments(&args);
return 1; } - mInputMapInit(&renderer.core->inputMap, &GBAInputInfo); + mInputMapInit(&renderer.core->inputMap, renderer.core->inputInfo); mCoreInitConfig(renderer.core, PORT); applyArguments(&args, &subparser, &renderer.core->config);