예제 #1
0
        public void Init(Syscalls syscalls, Core core, Runtime runtime)
        {
#if !LIB
            syscalls.maExtensionFunctionInvoke = delegate(int extensionId, int a, int b, int c)
#else
            syscalls.maExtensionFunctionInvoke = delegate(int extensionId, int a, int b, int c, int args)
#endif
            {
                int _module = extensionId >> 8;
                if (_module >= 0 && _module < mModules.Count)
                {
                    IExtensionModule module = mModules[_module];
                    int function            = extensionId & 0xff;
#if !LIB
                    return(module.Invoke(core, function, a, b, c));
#else
                    return(module.Invoke(core, function, a, b, c, args));
#endif
                }
                return(MoSync.Constants.MA_EXTENSION_FUNCTION_UNAVAILABLE);
            };
        }
예제 #2
0
        public void Init(Syscalls syscalls, Core core, Runtime runtime)
        {
            InitExtensions(core, runtime);

            syscalls.maInvokeExtension = delegate(int extensionId, int a, int b, int c)
            {
                int    ptr    = core.GetDataMemory().ReadInt32(extensionId + 0);
                String module = core.GetDataMemory().ReadStringAtAddress(ptr);
                int    index  = core.GetDataMemory().ReadInt32(extensionId + 4);

                IExtensionModule extension = GetModule(module);
                if (extension == null)
                {
                    return(MoSync.Constants.IOCTL_UNAVAILABLE);
                }
                else
                {
                    return(extension.Invoke(index, a, b, c));
                }
            };
        }