all repos — mgba @ 1b9e1e8268fd292332a8ea132bb044e87d73e1e6

mGBA Game Boy Advance Emulator

Switch: Add argv loading
Vicki Pfau vi@endrift.com
Wed, 19 Sep 2018 19:21:49 -0700
commit

1b9e1e8268fd292332a8ea132bb044e87d73e1e6

parent

5039d17a3048224b57fef74d468133a16c4bda04

1 files changed, 10 insertions(+), 1 deletions(-)

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

@@ -524,7 +524,16 @@ _mapKey(&runner.params.keyMap, AUTO_INPUT, KEY_DLEFT, GUI_INPUT_LEFT);

_mapKey(&runner.params.keyMap, AUTO_INPUT, KEY_DRIGHT, GUI_INPUT_RIGHT); audoutStartAudioOut(); - mGUIRunloop(&runner); + + if (argc > 1) { + size_t i; + for (i = 0; runner.keySources[i].id; ++i) { + mInputMapLoad(&runner.params.keyMap, runner.keySources[i].id, mCoreConfigGetInput(&runner.config)); + } + mGUIRun(&runner, argv[1]); + } else { + mGUIRunloop(&runner); + } glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo); glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);