all repos — mgba @ c9fa9cd78dc702db67d05cdb0dc84b3e7ceda698

mGBA Game Boy Advance Emulator

Core: Have per-core input information
Vicki Pfau vi@endrift.com
Thu, 23 Mar 2017 19:52:57 -0700
commit

c9fa9cd78dc702db67d05cdb0dc84b3e7ceda698

parent

aff1486ec5fe3185de59d20665c4042b715853ae

4 files changed, 19 insertions(+), 2 deletions(-)

jump to
M include/mgba/core/core.hinclude/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.csrc/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.csrc/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.csrc/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);