mirror of https://github.com/mgba-emu/mgba.git
Core: Have per-core input information
This commit is contained in:
parent
aff1486ec5
commit
c9fa9cd78d
|
@ -50,6 +50,7 @@ struct mCore {
|
|||
#endif
|
||||
#ifndef MINIMAL_CORE
|
||||
struct mInputMap inputMap;
|
||||
const struct mInputPlatformInfo* inputInfo;
|
||||
#endif
|
||||
struct mCoreConfig config;
|
||||
struct mCoreOptions opts;
|
||||
|
|
|
@ -20,6 +20,10 @@
|
|||
#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;
|
||||
|
@ -63,6 +67,10 @@ static bool _GBCoreInit(struct mCore* core) {
|
|||
mDirectorySetInit(&core->dirs);
|
||||
#endif
|
||||
|
||||
#ifndef MINIMAL_CORE
|
||||
core->inputInfo = &GBAInputInfo; // TODO: GBInputInfo
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,10 @@
|
|||
#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;
|
||||
|
@ -76,6 +80,10 @@ static bool _GBACoreInit(struct mCore* core) {
|
|||
mDirectorySetInit(&core->dirs);
|
||||
#endif
|
||||
|
||||
#ifndef MINIMAL_CORE
|
||||
core->inputInfo = &GBAInputInfo;
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ int main(int argc, char** argv) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
mInputMapInit(&renderer.core->inputMap, &GBAInputInfo);
|
||||
mInputMapInit(&renderer.core->inputMap, renderer.core->inputInfo);
|
||||
mCoreInitConfig(renderer.core, PORT);
|
||||
applyArguments(&args, &subparser, &renderer.core->config);
|
||||
|
||||
|
|
Loading…
Reference in New Issue