From 82c97e5dc3b5586a60e29e08c5d1e3afead8cd34 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 16 May 2022 01:07:45 -0700 Subject: [PATCH] Scripting: Add key input functions --- src/core/scripting.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/core/scripting.c b/src/core/scripting.c index 39b3ffb25..70f3e50fa 100644 --- a/src/core/scripting.c +++ b/src/core/scripting.c @@ -256,6 +256,12 @@ mSCRIPT_DECLARE_STRUCT_C_METHOD(mCore, WRAPPER, getGameCode, _mScriptCoreGetGame mSCRIPT_DECLARE_STRUCT_VOID_D_METHOD(mCore, runFrame, 0); mSCRIPT_DECLARE_STRUCT_VOID_D_METHOD(mCore, step, 0); +// Key functions +mSCRIPT_DECLARE_STRUCT_VOID_D_METHOD(mCore, setKeys, 1, U32, keys); +mSCRIPT_DECLARE_STRUCT_VOID_D_METHOD(mCore, addKeys, 1, U32, keys); +mSCRIPT_DECLARE_STRUCT_VOID_D_METHOD(mCore, clearKeys, 1, U32, keys); +mSCRIPT_DECLARE_STRUCT_D_METHOD(mCore, U32, getKeys, 0); + // Memory functions mSCRIPT_DECLARE_STRUCT_D_METHOD(mCore, U32, busRead8, 1, U32, address); mSCRIPT_DECLARE_STRUCT_D_METHOD(mCore, U32, busRead16, 1, U32, address); @@ -291,6 +297,15 @@ mSCRIPT_DEFINE_STRUCT(mCore) mSCRIPT_DEFINE_DOCSTRING("Run a single instruction") mSCRIPT_DEFINE_STRUCT_METHOD(mCore, step) + mSCRIPT_DEFINE_DOCSTRING("Set the currently active keys") + mSCRIPT_DEFINE_STRUCT_METHOD(mCore, setKeys) + mSCRIPT_DEFINE_DOCSTRING("Add keys to the currently active key list") + mSCRIPT_DEFINE_STRUCT_METHOD(mCore, addKeys) + mSCRIPT_DEFINE_DOCSTRING("Remove keys from the currently active key list") + mSCRIPT_DEFINE_STRUCT_METHOD(mCore, clearKeys) + mSCRIPT_DEFINE_DOCSTRING("Get the currently active keys") + mSCRIPT_DEFINE_STRUCT_METHOD(mCore, getKeys) + mSCRIPT_DEFINE_DOCSTRING("Read an 8-bit value from the given bus address") mSCRIPT_DEFINE_STRUCT_METHOD_NAMED(mCore, read8, busRead8) mSCRIPT_DEFINE_DOCSTRING("Read a 16-bit value from the given bus address")