Scripting: Improve docs

This commit is contained in:
Vicki Pfau 2022-05-24 18:53:56 -07:00
parent ced8fb516c
commit fd202105ef
2 changed files with 15 additions and 5 deletions

View File

@ -407,7 +407,7 @@ mSCRIPT_DEFINE_STRUCT(mCore)
mSCRIPT_DEFINE_CLASS_DOCSTRING( mSCRIPT_DEFINE_CLASS_DOCSTRING(
"An instance of an emulator core." "An instance of an emulator core."
) )
mSCRIPT_DEFINE_DOCSTRING("Get which platform is being emulated") mSCRIPT_DEFINE_DOCSTRING("Get which platform is being emulated. See C.PLATFORM for possible values")
mSCRIPT_DEFINE_STRUCT_METHOD(mCore, platform) mSCRIPT_DEFINE_STRUCT_METHOD(mCore, platform)
mSCRIPT_DEFINE_DOCSTRING("Get the number of the current frame") mSCRIPT_DEFINE_DOCSTRING("Get the number of the current frame")
mSCRIPT_DEFINE_STRUCT_METHOD_NAMED(mCore, currentFrame, frameCounter) mSCRIPT_DEFINE_STRUCT_METHOD_NAMED(mCore, currentFrame, frameCounter)
@ -463,9 +463,9 @@ mSCRIPT_DEFINE_STRUCT(mCore)
mSCRIPT_DEFINE_DOCSTRING("Write the value of the register with the given name") mSCRIPT_DEFINE_DOCSTRING("Write the value of the register with the given name")
mSCRIPT_DEFINE_STRUCT_METHOD(mCore, writeRegister) mSCRIPT_DEFINE_STRUCT_METHOD(mCore, writeRegister)
mSCRIPT_DEFINE_DOCSTRING("Save state to the slot number") mSCRIPT_DEFINE_DOCSTRING("Save state to the slot number. See C.SAVESTATE for possible values for `flags`")
mSCRIPT_DEFINE_STRUCT_METHOD(mCore, saveStateSlot) mSCRIPT_DEFINE_STRUCT_METHOD(mCore, saveStateSlot)
mSCRIPT_DEFINE_DOCSTRING("Load state from the slot number") mSCRIPT_DEFINE_DOCSTRING("Load state from the slot number. See C.SAVESTATE for possible values for `flags`")
mSCRIPT_DEFINE_STRUCT_METHOD(mCore, loadStateSlot) mSCRIPT_DEFINE_STRUCT_METHOD(mCore, loadStateSlot)
mSCRIPT_DEFINE_DOCSTRING("Save a screenshot") mSCRIPT_DEFINE_DOCSTRING("Save a screenshot")
@ -632,7 +632,7 @@ mSCRIPT_DECLARE_STRUCT_METHOD_WITH_DEFAULTS(mScriptConsole, S(mScriptTextBuffer)
mSCRIPT_DEFINE_STRUCT(mScriptConsole) mSCRIPT_DEFINE_STRUCT(mScriptConsole)
mSCRIPT_DEFINE_CLASS_DOCSTRING( mSCRIPT_DEFINE_CLASS_DOCSTRING(
"A singleton object `console` that can be used for presenting textual information to the user via a console." "A global singleton object `console` that can be used for presenting textual information to the user via a console."
) )
mSCRIPT_DEFINE_DOCSTRING("Print a log to the console") mSCRIPT_DEFINE_DOCSTRING("Print a log to the console")
mSCRIPT_DEFINE_STRUCT_METHOD(mScriptConsole, log) mSCRIPT_DEFINE_STRUCT_METHOD(mScriptConsole, log)

View File

@ -32,7 +32,17 @@ mSCRIPT_DECLARE_STRUCT_VOID_METHOD(mScriptCallbackManager, add, _mScriptCallback
mSCRIPT_DEFINE_STRUCT(mScriptCallbackManager) mSCRIPT_DEFINE_STRUCT(mScriptCallbackManager)
mSCRIPT_DEFINE_CLASS_DOCSTRING( mSCRIPT_DEFINE_CLASS_DOCSTRING(
"A singleton object `callbacks` used for managing callbacks." "A global singleton object `callbacks` used for managing callbacks. The following callbacks are defined:\n\n"
"- **alarm**: An in-game alarm went off\n"
"- **crashed**: The emulation crashed\n"
"- **frame**: The emulation finished a frame\n"
"- **keysRead**: The emulation is about to read the key input\n"
"- **reset**: The emulation has been reset\n"
"- **savedataUpdated**: The emulation has just finished modifying save data\n"
"- **sleep**: The emulation has used the sleep feature to enter a low-power mode\n"
"- **shutdown**: The emulation has been powered off\n"
"- **start**: The emulation has started\n"
"- **stop**: The emulation has voluntarily shut down\n"
) )
mSCRIPT_DEFINE_DOCSTRING("Add a callback of the named type") mSCRIPT_DEFINE_DOCSTRING("Add a callback of the named type")
mSCRIPT_DEFINE_STRUCT_METHOD(mScriptCallbackManager, add) mSCRIPT_DEFINE_STRUCT_METHOD(mScriptCallbackManager, add)