-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added in basic scripting features to Dolphin
- Loading branch information
1 parent
0a2afa4
commit 3eaa045
Showing
55 changed files
with
4,634 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
Source/Core/Core/Scripting/CoreScriptInterface/Enums/ArgTypeEnum.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#pragma once | ||
|
||
namespace Scripting | ||
{ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
// This enum represents the types of parameters for Scripting API functions, and the return types | ||
// of Scripting API functions (which are both specified in FunctionMetadata definitions). | ||
enum ArgTypeEnum | ||
{ | ||
VoidType = 0, | ||
Boolean = 1, | ||
U8 = 2, | ||
U16 = 3, | ||
U32 = 4, | ||
U64 = 5, | ||
S8 = 6, | ||
S16 = 7, | ||
S32 = 8, | ||
S64 = 9, | ||
Float = 10, | ||
Double = 11, | ||
String = 12, | ||
VoidPointer = 13, | ||
ListOfBytes = 14, | ||
GameCubeControllerStateObject = 15, | ||
ListOfPoints = 16, | ||
RegistrationInputType = 17, | ||
RegistrationWithAutoDeregistrationInputType = 18, | ||
RegistrationForButtonCallbackInputType = 19, | ||
UnregistrationInputType = 20, | ||
RegistrationReturnType = 21, | ||
YieldType = 22, | ||
ShutdownType = 23, | ||
ErrorStringType = 24, | ||
UnknownArgTypeEnum = 25 | ||
}; | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
} // namespace Scripting |
46 changes: 46 additions & 0 deletions
46
Source/Core/Core/Scripting/CoreScriptInterface/Enums/GCButtonNameEnum.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#pragma once | ||
|
||
namespace Scripting | ||
{ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
// GCButtonNameEnum is used to represent the names of buttons on the GameCube controller | ||
// for various APIs that take a GameCube button as input or return a GameCube button's state. | ||
|
||
// Each of these enums corresponds to a similarly-named variable in the Movie::ControllerState | ||
// struct | ||
enum GCButtonNameEnum | ||
{ | ||
A = 0, | ||
B = 1, | ||
X = 2, | ||
Y = 3, | ||
Z = 4, | ||
L = 5, // Refers to the digital L button (either pressed or not pressed) | ||
R = 6, // Refers to the digital R button (either pressed or not pressed) | ||
DPadUp = 7, | ||
DPadDown = 8, | ||
DPadLeft = 9, | ||
DPadRight = 10, | ||
AnalogStickX = 11, | ||
AnalogStickY = 12, | ||
CStickX = 13, | ||
CStickY = 14, | ||
TriggerL = 15, // Refers to the analog L trigger value (between 0-255) | ||
TriggerR = 16, // Refers to the analog R trigger value (between 0-255) | ||
Start = 17, | ||
Reset = 18, | ||
Disc = 19, | ||
GetOrigin = 20, | ||
IsConnected = 21, | ||
UnknownButton = 22 | ||
}; | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
} // namespace Scripting |
43 changes: 43 additions & 0 deletions
43
Source/Core/Core/Scripting/CoreScriptInterface/Enums/ScriptCallLocationsEnum.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#pragma once | ||
|
||
namespace Scripting | ||
{ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
// ScriptCallLocationsEnum represents the locations that a script can be run from. | ||
// The ScriptUtilities file sets each script to have the appropriate enum value | ||
// before it's run (ex. before a script's OnFrameStart callbacks are run, it has its | ||
// script location variable set equal to FromFrameStartCallback) | ||
|
||
// This way, a script which is running can check what context it was called from | ||
// (which is used internally to determine if certain functions are allowed to be | ||
// called, like OnMemoryAddressReadFrom.getMemoryAddressReadFromForCurrentCallback()) | ||
enum ScriptCallLocationsEnum | ||
{ | ||
// When a script is run for the very first time. | ||
FromScriptStartup = 0, | ||
|
||
// When a script executes global code (i.e. not a registered callback function) at the | ||
// start of a frame, and it isn't the very first time the script was run. | ||
FromFrameStartGlobalScope = 1, | ||
|
||
// When a registered OnFrameStart callback function is called at the start of a frame. | ||
FromFrameStartCallback = 2, | ||
|
||
FromInstructionHitCallback = 3, | ||
FromMemoryAddressReadFromCallback = 4, | ||
FromMemoryAddressWrittenToCallback = 5, | ||
FromGCControllerInputPolledCallback = 6, | ||
FromWiiInputPolledCallback = 7, | ||
FromGraphicsCallback = 8, | ||
UnknownLocation = 9 | ||
}; | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
} // namespace Scripting |
40 changes: 40 additions & 0 deletions
40
Source/Core/Core/Scripting/CoreScriptInterface/Enums/ScriptReturnCodesEnum.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#pragma once | ||
|
||
namespace Scripting | ||
{ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
// ScriptReturnCodesEnum is used to represent the return value of executing a script. | ||
// This value for a script will be SuccessCode on success, and not SuccessCode if an error occured. | ||
enum ScriptReturnCodesEnum | ||
{ | ||
// Indicates success (no errors occured) | ||
SuccessCode = 0, | ||
|
||
// Indicates that the DLL/SO file couldn't be found (or the user doesn't have permission to view | ||
// that file) | ||
DLLFileNotFoundError = 1, | ||
|
||
// Indicates that the DLL/SO file didn't define a function which it was required to define | ||
// (indicates an error for whoever wrote the DLL/SO). | ||
DLLComponentNotFoundError = 2, | ||
|
||
// Indicates that the script file the user tried to execute did not exist (or the user doesn't | ||
// have permission to view that file) | ||
ScriptFileNotFoundError = 3, | ||
|
||
// Indicates that some kind of runtime error happened while the script was executing (usually | ||
// indicates a bug in the script that the user wrote) | ||
RunTimeError = 4, | ||
|
||
UnknownError = 5 | ||
}; | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
} // namespace Scripting |
Oops, something went wrong.