Beispiel #1
0
            public bool LoadGame(string gamePath)
            {
                GameInfo gameInfo = LoadGameInfo(gamePath);
                bool     ret      = Libretro.RetroLoadGame(ref gameInfo);

                Console.WriteLine("\nSystem information:");

                _av = new SystemAVInfo();
                Libretro.RetroGetSystemAVInfo(ref _av);

                var audioConfig = AudioSettings.GetConfiguration();

                audioConfig.sampleRate = (int)_av.timing.sample_rate;
                AudioSettings.Reset(audioConfig);

                Debug.Log("Geometry:");
                Debug.Log("Base width: " + _av.geometry.base_width);
                Debug.Log("Base height: " + _av.geometry.base_height);
                Debug.Log("Max width: " + _av.geometry.max_width);
                Debug.Log("Max height: " + _av.geometry.max_height);
                Debug.Log("Aspect ratio: " + _av.geometry.aspect_ratio);
                Debug.Log("Geometry:");
                Debug.Log("Target fps: " + _av.timing.fps);
                Debug.Log("Sample rate " + _av.timing.sample_rate);
                return(ret);
            }
Beispiel #2
0
            public unsafe void Init()
            {
                int        apiVersion = Libretro.RetroApiVersion();
                SystemInfo info       = new SystemInfo();

                Libretro.RetroGetSystemInfo(ref info);

                string coreName        = Marshal.PtrToStringAnsi((IntPtr)info.library_name);
                string coreVersion     = Marshal.PtrToStringAnsi((IntPtr)info.library_version);
                string validExtensions = Marshal.PtrToStringAnsi((IntPtr)info.valid_extensions);

                _requiresFullPath = info.need_fullpath;
                bool blockExtract = info.block_extract;

                Debug.Log("Core information:");
                Debug.Log("API Version: " + apiVersion);
                Debug.Log("Core Name: " + coreName);
                Debug.Log("Core Version: " + coreVersion);
                Debug.Log("Valid Extensions: " + validExtensions);
                Debug.Log("Block Extraction: " + blockExtract);
                Debug.Log("Requires Full Path: " + _requiresFullPath);

                _environment      = RetroEnvironment;
                _videoRefresh     = RetroVideoRefresh;
                _audioSample      = RetroAudioSample;
                _audioSampleBatch = RetroAudioSampleBatch;
                _inputPoll        = RetroInputPoll;
                _inputState       = RetroInputState;

                Debug.Log("Setting up environment:");

                Libretro.RetroSetEnvironment(_environment);
                Libretro.RetroSetVideoRefresh(_videoRefresh);
                Libretro.RetroSetAudioSample(_audioSample);
                Libretro.RetroSetAudioSampleBatch(_audioSampleBatch);
                Libretro.RetroSetInputPoll(_inputPoll);
                Libretro.RetroSetInputState(_inputState);

                Libretro.RetroInit();
            }
Beispiel #3
0
 public bool Update()
 {
     Libretro.RetroRun();
     return(true);
 }
Beispiel #4
0
 public Wrapper(string coreToLoad)
 {
     Libretro.InitializeLibrary(coreToLoad);
 }
Beispiel #5
0
 public Wrapper(string coreToLoad)
 {
     DLLHandler = Libretro.InitializeLibrary(coreToLoad);
 }