예제 #1
0
        public mupen64plusVideoApi(mupen64plusApi core, VideoPluginSettings settings)
        {
            string videoplugin;

            switch (settings.Plugin)
            {
            default:
            case PluginType.Rice:
                videoplugin = "mupen64plus-video-rice.dll";
                break;

            case PluginType.Glide:
                videoplugin = "mupen64plus-video-glide64.dll";
                break;

            case PluginType.GlideMk2:
                videoplugin = "mupen64plus-video-glide64mk2.dll";
                break;

            case PluginType.GLideN64:
                videoplugin = "mupen64plus-video-GLideN64.dll";
                break;
            }

            GfxDll = core.AttachPlugin(mupen64plusApi.m64p_plugin_type.M64PLUGIN_GFX,
                                       videoplugin);
            GFXReadScreen2    = mupen64plusApi.GetTypedDelegate <ReadScreen2>(GfxDll, "ReadScreen2");
            GFXReadScreen2Res = mupen64plusApi.GetTypedDelegate <ReadScreen2Res>(GfxDll, "ReadScreen2");
            var funcPtr = OSTailoredCode.LinkedLibManager.GetProcAddrOrZero(GfxDll, "GetScreenTextureID");

            if (funcPtr != IntPtr.Zero)
            {
                GFXGetScreenTextureID = (GetScreenTextureID)Marshal.GetDelegateForFunctionPointer(funcPtr, typeof(GetScreenTextureID));
            }
        }
예제 #2
0
		public mupen64plusVideoApi(mupen64plusApi core, VideoPluginSettings settings)
		{
			string videoplugin;
			switch (settings.Plugin)
			{
				default:
				case PluginType.Rice:
					videoplugin = "mupen64plus-video-rice.dll";
					break;
				case PluginType.Glide:
					videoplugin = "mupen64plus-video-glide64.dll";
					break;
				case PluginType.GlideMk2:
					videoplugin = "mupen64plus-video-glide64mk2.dll";
					break;
				case PluginType.Jabo:
					videoplugin = "mupen64plus-video-jabo.dll";
					break;
			}

			GfxDll = core.AttachPlugin(mupen64plusApi.m64p_plugin_type.M64PLUGIN_GFX,
				videoplugin);
			GFXReadScreen2 = (ReadScreen2)Marshal.GetDelegateForFunctionPointer(GetProcAddress(GfxDll, "ReadScreen2"), typeof(ReadScreen2));
			GFXReadScreen2Res = (ReadScreen2Res)Marshal.GetDelegateForFunctionPointer(GetProcAddress(GfxDll, "ReadScreen2"), typeof(ReadScreen2Res));
			if(GetProcAddress(GfxDll, "GetScreenTextureID") != IntPtr.Zero)
				GFXGetScreenTextureID = (GetScreenTextureID)Marshal.GetDelegateForFunctionPointer(GetProcAddress(GfxDll, "GetScreenTextureID"), typeof(GetScreenTextureID));
		}
예제 #3
0
        public mupen64plusVideoApi(mupen64plusApi core, VideoPluginSettings settings)
        {
            string videoplugin;

            switch (settings.Plugin)
            {
            default:
            case PluginType.Rice:
                videoplugin = "mupen64plus-video-rice.dll";
                break;

            case PluginType.Glide:
                videoplugin = "mupen64plus-video-glide64.dll";
                break;

            case PluginType.GlideMk2:
                videoplugin = "mupen64plus-video-glide64mk2.dll";
                break;

            case PluginType.Jabo:
                videoplugin = "mupen64plus-video-jabo.dll";
                break;
            }

            GfxDll = core.AttachPlugin(mupen64plusApi.m64p_plugin_type.M64PLUGIN_GFX,
                                       videoplugin);
            GFXReadScreen2    = (ReadScreen2)Marshal.GetDelegateForFunctionPointer(GetProcAddress(GfxDll, "ReadScreen2"), typeof(ReadScreen2));
            GFXReadScreen2Res = (ReadScreen2Res)Marshal.GetDelegateForFunctionPointer(GetProcAddress(GfxDll, "ReadScreen2"), typeof(ReadScreen2Res));
            if (GetProcAddress(GfxDll, "GetScreenTextureID") != IntPtr.Zero)
            {
                GFXGetScreenTextureID = (GetScreenTextureID)Marshal.GetDelegateForFunctionPointer(GetProcAddress(GfxDll, "GetScreenTextureID"), typeof(GetScreenTextureID));
            }
        }
예제 #4
0
		/// <summary>
		/// Loads native functions and attaches itself to the core
		/// </summary>
		/// <param name="core">Core with loaded core api</param>
		public mupen64plusAudioApi(mupen64plusApi core)
		{
			AudDll = core.AttachPlugin(mupen64plusApi.m64p_plugin_type.M64PLUGIN_AUDIO,
				"mupen64plus-audio-bkm.dll");

			// Connect dll functions
			dllGetBufferSize = (GetBufferSize)Marshal.GetDelegateForFunctionPointer(GetProcAddress(AudDll, "GetBufferSize"), typeof(GetBufferSize));
			dllReadAudioBuffer = (ReadAudioBuffer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(AudDll, "ReadAudioBuffer"), typeof(ReadAudioBuffer));
			dllGetAudioRate = (GetAudioRate)Marshal.GetDelegateForFunctionPointer(GetProcAddress(AudDll, "GetAudioRate"), typeof(GetAudioRate));
		}
예제 #5
0
        /// <summary>
        /// Loads native functions and attaches itself to the core
        /// </summary>
        /// <param name="core">Core with loaded core api</param>
        public mupen64plusAudioApi(mupen64plusApi core)
        {
            AudDll = core.AttachPlugin(mupen64plusApi.m64p_plugin_type.M64PLUGIN_AUDIO,
                                       "mupen64plus-audio-bkm.dll");

            // Connect dll functions
            dllGetBufferSize   = (GetBufferSize)Marshal.GetDelegateForFunctionPointer(GetProcAddress(AudDll, "GetBufferSize"), typeof(GetBufferSize));
            dllReadAudioBuffer = (ReadAudioBuffer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(AudDll, "ReadAudioBuffer"), typeof(ReadAudioBuffer));
            dllGetAudioRate    = (GetAudioRate)Marshal.GetDelegateForFunctionPointer(GetProcAddress(AudDll, "GetAudioRate"), typeof(GetAudioRate));
        }
예제 #6
0
        /// <summary>
        /// Loads native functions and attaches itself to the core
        /// </summary>
        /// <param name="core">Core with loaded core api</param>
        public mupen64plusAudioApi(mupen64plusApi core)
        {
            T GetAudioDelegate <T>(string proc) where T : Delegate => mupen64plusApi.GetTypedDelegate <T>(AudDll, proc);

            AudDll = core.AttachPlugin(mupen64plusApi.m64p_plugin_type.M64PLUGIN_AUDIO,
                                       "mupen64plus-audio-bkm.dll");

            // Connect dll functions
            dllGetBufferSize   = GetAudioDelegate <GetBufferSize>("GetBufferSize");
            dllReadAudioBuffer = GetAudioDelegate <ReadAudioBuffer>("ReadAudioBuffer");
            dllGetAudioRate    = GetAudioDelegate <GetAudioRate>("GetAudioRate");
        }
예제 #7
0
        public mupen64plusInputApi(mupen64plusApi core)
        {
            T GetInputDelegate <T>(string proc) where T : Delegate => mupen64plusApi.GetTypedDelegate <T>(InpDll, proc);

            InpDll = core.AttachPlugin(mupen64plusApi.m64p_plugin_type.M64PLUGIN_INPUT,
                                       "mupen64plus-input-bkm.dll");

            InpSetInputCallback       = GetInputDelegate <SetInputCallback>("SetInputCallback");
            InpSetRumbleCallback      = GetInputDelegate <SetRumbleCallback>("SetRumbleCallback");
            InpSetControllerPakType   = GetInputDelegate <SetControllerPakType>("SetControllerPakType");
            InpSetControllerConnected = GetInputDelegate <SetControllerConnected>("SetControllerConnected");
        }
예제 #8
0
        public mupen64plusInputApi(mupen64plusApi core)
        {
            InpDll = core.AttachPlugin(mupen64plusApi.m64p_plugin_type.M64PLUGIN_INPUT,
                                       "mupen64plus-input-bkm.dll");

            mupen64plusApi.m64p_error result;
            InpSetInputCallback       = (SetInputCallback)Marshal.GetDelegateForFunctionPointer(GetProcAddress(InpDll, "SetInputCallback"), typeof(SetInputCallback));
            InpSetRumbleCallback      = (SetRumbleCallback)Marshal.GetDelegateForFunctionPointer(GetProcAddress(InpDll, "SetRumbleCallback"), typeof(SetRumbleCallback));
            InpSetControllerPakType   = (SetControllerPakType)Marshal.GetDelegateForFunctionPointer(GetProcAddress(InpDll, "SetControllerPakType"), typeof(SetControllerPakType));
            InpSetControllerConnected = (SetControllerConnected)Marshal.GetDelegateForFunctionPointer(GetProcAddress(InpDll, "SetControllerConnected"), typeof(SetControllerConnected));

            m64pRumbleCallback = new RumbleCallback(FireOnRumbleChange);
            result             = InpSetRumbleCallback(m64pRumbleCallback);
        }
예제 #9
0
		public mupen64plusInputApi(mupen64plusApi core)
		{
			InpDll = core.AttachPlugin(mupen64plusApi.m64p_plugin_type.M64PLUGIN_INPUT,
				"mupen64plus-input-bkm.dll");

			mupen64plusApi.m64p_error result;
			InpSetInputCallback = (SetInputCallback)Marshal.GetDelegateForFunctionPointer(GetProcAddress(InpDll, "SetInputCallback"), typeof(SetInputCallback));
			InpSetRumbleCallback = (SetRumbleCallback)Marshal.GetDelegateForFunctionPointer(GetProcAddress(InpDll, "SetRumbleCallback"), typeof(SetRumbleCallback));
			InpSetControllerPakType = (SetControllerPakType)Marshal.GetDelegateForFunctionPointer(GetProcAddress(InpDll, "SetControllerPakType"), typeof(SetControllerPakType));
			InpSetControllerConnected = (SetControllerConnected)Marshal.GetDelegateForFunctionPointer(GetProcAddress(InpDll, "SetControllerConnected"), typeof(SetControllerConnected));

			m64pRumbleCallback = new RumbleCallback(FireOnRumbleChange);
			result = InpSetRumbleCallback(m64pRumbleCallback);
		}
예제 #10
0
        public mupen64plusVideoApi(mupen64plusApi core, VideoPluginSettings settings)
        {
            string videoplugin;

            //bool jaboReady = false;
            switch (settings.Plugin)
            {
            default:
            case PluginType.Rice:
                videoplugin = "mupen64plus-video-rice.dll";
                break;

            case PluginType.Glide:
                videoplugin = "mupen64plus-video-glide64.dll";
                break;

            case PluginType.GlideMk2:
                videoplugin = "mupen64plus-video-glide64mk2.dll";
                break;

            case PluginType.Jabo:
                videoplugin = "mupen64plus-video-jabo.dll";

                N64JaboManager manager = new N64JaboManager();
                manager.Scan();
                if (manager.Status == N64JaboManager.JaboStatus.ReadyToPatch)
                {
                    manager.Patch();
                }
                if (manager.Status != N64JaboManager.JaboStatus.Ready)
                {
                    throw new FileNotFoundException(string.Format("Error: Jabo dll was not found. please copy Jabo_Direct3D8.dll from a Project64 v1.6.1 installation into Bizhawk's dll directory."));
                }

                break;
            }

            GfxDll = core.AttachPlugin(mupen64plusApi.m64p_plugin_type.M64PLUGIN_GFX,
                                       videoplugin);
            GFXReadScreen2    = (ReadScreen2)Marshal.GetDelegateForFunctionPointer(GetProcAddress(GfxDll, "ReadScreen2"), typeof(ReadScreen2));
            GFXReadScreen2Res = (ReadScreen2Res)Marshal.GetDelegateForFunctionPointer(GetProcAddress(GfxDll, "ReadScreen2"), typeof(ReadScreen2Res));
            if (GetProcAddress(GfxDll, "GetScreenTextureID") != IntPtr.Zero)
            {
                GFXGetScreenTextureID = (GetScreenTextureID)Marshal.GetDelegateForFunctionPointer(GetProcAddress(GfxDll, "GetScreenTextureID"), typeof(GetScreenTextureID));
            }
        }
예제 #11
0
		public mupen64plusVideoApi(mupen64plusApi core, VideoPluginSettings settings)
		{
			string videoplugin;
			//bool jaboReady = false;
			switch (settings.Plugin)
			{
				default:
				case PluginType.Rice:
					videoplugin = "mupen64plus-video-rice.dll";
					break;
				case PluginType.Glide:
					videoplugin = "mupen64plus-video-glide64.dll";
					break;
				case PluginType.GlideMk2:
					videoplugin = "mupen64plus-video-glide64mk2.dll";
					break;
				case PluginType.Jabo:
					videoplugin = "mupen64plus-video-jabo.dll";

					N64JaboManager manager = new N64JaboManager();
					manager.Scan();
					if (manager.Status == N64JaboManager.JaboStatus.ReadyToPatch)
						manager.Patch();
					if(manager.Status != N64JaboManager.JaboStatus.Ready)
						throw new FileNotFoundException(string.Format("Error: Jabo dll was not found. please copy Jabo_Direct3D8.dll from a Project64 v1.6.1 installation into Bizhawk's dll directory."));

					break;
			}

			GfxDll = core.AttachPlugin(mupen64plusApi.m64p_plugin_type.M64PLUGIN_GFX,
				videoplugin);
			GFXReadScreen2 = (ReadScreen2)Marshal.GetDelegateForFunctionPointer(GetProcAddress(GfxDll, "ReadScreen2"), typeof(ReadScreen2));
			GFXReadScreen2Res = (ReadScreen2Res)Marshal.GetDelegateForFunctionPointer(GetProcAddress(GfxDll, "ReadScreen2"), typeof(ReadScreen2Res));
			if(GetProcAddress(GfxDll, "GetScreenTextureID") != IntPtr.Zero)
				GFXGetScreenTextureID = (GetScreenTextureID)Marshal.GetDelegateForFunctionPointer(GetProcAddress(GfxDll, "GetScreenTextureID"), typeof(GetScreenTextureID));
		}