Exemple #1
0
            public static void InitializeLibrary(string dllName)
            {
                IDLLHandler dllHandler = null;

#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
                dllHandler = WindowsDLLHandler.Instance;
#elif UNITY_ANDROID
                dllHandler = AndroidDLLHandler.Instance;
#endif
                if (dllHandler == null)
                {
                    return;
                }
                string path = Application.streamingAssetsPath + "/" + "libwinpthread-1.dll";
                if (File.Exists(path))
                {
                    dllHandler.LoadCore(path);
                }

                dllHandler.LoadCore(dllName);

                RetroApiVersion          = dllHandler.GetMethod <RetroApiVersionDelegate>("retro_api_version");
                RetroInit                = dllHandler.GetMethod <RetroInitDelegate>("retro_init");
                RetroGetSystemInfo       = dllHandler.GetMethod <RetroGetSystemInfoDelegate>("retro_get_system_info");
                RetroGetSystemAVInfo     = dllHandler.GetMethod <RetroGetSystemAVInfoDelegate>("retro_get_system_av_info");
                RetroLoadGame            = dllHandler.GetMethod <RetroLoadGameDelegate>("retro_load_game");
                RetroSetVideoRefresh     = dllHandler.GetMethod <RetroSetVideoRefreshDelegate>("retro_set_video_refresh");
                RetroSetAudioSample      = dllHandler.GetMethod <RetroSetAudioSampleDelegate>("retro_set_audio_sample");
                RetroSetAudioSampleBatch = dllHandler.GetMethod <RetroSetAudioSampleBatchDelegate>("retro_set_audio_sample_batch");
                RetroSetInputPoll        = dllHandler.GetMethod <RetroSetInputPollDelegate>("retro_set_input_poll");
                RetroSetInputState       = dllHandler.GetMethod <RetroSetInputStateDelegate>("retro_set_input_state");
                RetroSetEnvironment      = dllHandler.GetMethod <RetroSetEnvironmentDelegate>("retro_set_environment");
                RetroRun    = dllHandler.GetMethod <RetroRunDelegate>("retro_run");
                RetroDeInit = dllHandler.GetMethod <RetroDeInitDelegate>("retro_deinit");
            }
Exemple #2
0
        public static void InitializeLibrary(string dllName)
        {
            DLLHandler.LoadCore(dllName);

            RetroApiVersion          = DLLHandler.GetMethod <RetroApiVersionDelegate>("retro_api_version");
            RetroInit                = DLLHandler.GetMethod <RetroInitDelegate>("retro_init");
            RetroGetSystemInfo       = DLLHandler.GetMethod <RetroGetSystemInfoDelegate>("retro_get_system_info");
            RetroGetSystemAVInfo     = DLLHandler.GetMethod <RetroGetSystemAVInfoDelegate>("retro_get_system_av_info");
            RetroLoadGame            = DLLHandler.GetMethod <RetroLoadGameDelegate>("retro_load_game");
            RetroSetVideoRefresh     = DLLHandler.GetMethod <RetroSetVideoRefreshDelegate>("retro_set_video_refresh");
            RetroSetAudioSample      = DLLHandler.GetMethod <RetroSetAudioSampleDelegate>("retro_set_audio_sample");
            RetroSetAudioSampleBatch = DLLHandler.GetMethod <RetroSetAudioSampleBatchDelegate>("retro_set_audio_sample_batch");
            RetroSetInputPoll        = DLLHandler.GetMethod <RetroSetInputPollDelegate>("retro_set_input_poll");
            RetroSetInputState       = DLLHandler.GetMethod <RetroSetInputStateDelegate>("retro_set_input_state");
            RetroSetEnvironment      = DLLHandler.GetMethod <RetroSetEnvironmentDelegate>("retro_set_environment");
            RetroRun    = DLLHandler.GetMethod <RetroRunDelegate>("retro_run");
            RetroDeInit = DLLHandler.GetMethod <RetroDeInitDelegate>("retro_deinit");
        }
Exemple #3
0
            public static IDLLHandler InitializeLibrary(string dllName)
            {
                IDLLHandler dllHandler = null;

#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
                dllHandler = WindowsDLLHandler.Instance;
#elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
                dllHandler = OSXDLLHandler.Instance;
#elif UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX
                dllHandler = LinuxDLLHandler.Instance;
#elif UNITY_ANDROID
                dllHandler = AndroidDLLHandler.Instance;
#endif

                if (dllHandler == null)
                {
                    return(null);
                }

#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
                dllHandler.LoadCore("libwinpthread-1");
#endif

                dllHandler.LoadCore(dllName);

                RetroApiVersion          = dllHandler.GetMethod <RetroApiVersionDelegate>("retro_api_version");
                RetroInit                = dllHandler.GetMethod <RetroInitDelegate>("retro_init");
                RetroGetSystemInfo       = dllHandler.GetMethod <RetroGetSystemInfoDelegate>("retro_get_system_info");
                RetroGetSystemAVInfo     = dllHandler.GetMethod <RetroGetSystemAVInfoDelegate>("retro_get_system_av_info");
                RetroLoadGame            = dllHandler.GetMethod <RetroLoadGameDelegate>("retro_load_game");
                RetroSetVideoRefresh     = dllHandler.GetMethod <RetroSetVideoRefreshDelegate>("retro_set_video_refresh");
                RetroSetAudioSample      = dllHandler.GetMethod <RetroSetAudioSampleDelegate>("retro_set_audio_sample");
                RetroSetAudioSampleBatch = dllHandler.GetMethod <RetroSetAudioSampleBatchDelegate>("retro_set_audio_sample_batch");
                RetroSetInputPoll        = dllHandler.GetMethod <RetroSetInputPollDelegate>("retro_set_input_poll");
                RetroSetInputState       = dllHandler.GetMethod <RetroSetInputStateDelegate>("retro_set_input_state");
                RetroSetEnvironment      = dllHandler.GetMethod <RetroSetEnvironmentDelegate>("retro_set_environment");
                RetroRun    = dllHandler.GetMethod <RetroRunDelegate>("retro_run");
                RetroDeInit = dllHandler.GetMethod <RetroDeInitDelegate>("retro_deinit");

                return(dllHandler);
            }
Exemple #4
0
            public static void InitializeLibrary(string dllName)
            {
                IDLLHandler dllHandler = null;
                #if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
                dllHandler = WindowsDLLHandler.Instance;
                #elif UNITY_ANDROID
                dllHandler = AndroidDLLHandler.Instance;
                #endif
                if (dllHandler == null) return;
                dllHandler.LoadCore(dllName);

                RetroApiVersion = dllHandler.GetMethod<RetroApiVersionDelegate>("retro_api_version");
                RetroInit = dllHandler.GetMethod<RetroInitDelegate>("retro_init");
                RetroGetSystemInfo = dllHandler.GetMethod<RetroGetSystemInfoDelegate>("retro_get_system_info");
                RetroGetSystemAVInfo = dllHandler.GetMethod<RetroGetSystemAVInfoDelegate>("retro_get_system_av_info");
                RetroLoadGame = dllHandler.GetMethod<RetroLoadGameDelegate>("retro_load_game");
                RetroSetVideoRefresh = dllHandler.GetMethod<RetroSetVideoRefreshDelegate>("retro_set_video_refresh");
                RetroSetAudioSample = dllHandler.GetMethod<RetroSetAudioSampleDelegate>("retro_set_audio_sample");
                RetroSetAudioSampleBatch = dllHandler.GetMethod<RetroSetAudioSampleBatchDelegate>("retro_set_audio_sample_batch");
                RetroSetInputPoll = dllHandler.GetMethod<RetroSetInputPollDelegate>("retro_set_input_poll");
                RetroSetInputState = dllHandler.GetMethod<RetroSetInputStateDelegate>("retro_set_input_state");
                RetroSetEnvironment = dllHandler.GetMethod<RetroSetEnvironmentDelegate>("retro_set_environment");
                RetroRun = dllHandler.GetMethod<RetroRunDelegate>("retro_run");
                RetroDeInit = dllHandler.GetMethod<RetroDeInitDelegate>("retro_deinit");
            }