Beispiel #1
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;

            Console.WriteLine("Core information:");
            Console.WriteLine("API Version: " + _apiVersion);
            Console.WriteLine("Core Name: " + _coreName);
            Console.WriteLine("Core Version: " + _coreVersion);
            Console.WriteLine("Valid Extensions: " + _validExtensions);
            Console.WriteLine("Block Extraction: " + _blockExtract);
            Console.WriteLine("Requires Full Path: " + requiresFullPath);

            _environment      = new Libretro.RetroEnvironmentDelegate(RetroEnvironment);
            _videoRefresh     = new Libretro.RetroVideoRefreshDelegate(RetroVideoRefresh);
            _audioSample      = new Libretro.RetroAudioSampleDelegate(RetroAudioSample);
            _audioSampleBatch = new Libretro.RetroAudioSampleBatchDelegate(RetroAudioSampleBatch);
            _inputPoll        = new Libretro.RetroInputPollDelegate(RetroInputPoll);
            _inputState       = new Libretro.RetroInputStateDelegate(RetroInputState);

            Console.WriteLine("\nSetting up environment:");

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

            Libretro.RetroInit();
        }
Beispiel #2
0
        public unsafe 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);

            Console.WriteLine("Geometry:");
            Console.WriteLine("Base width: " + av.geometry.base_width);
            Console.WriteLine("Base height: " + av.geometry.base_height);
            Console.WriteLine("Max width: " + av.geometry.max_width);
            Console.WriteLine("Max height: " + av.geometry.max_height);
            Console.WriteLine("Aspect ratio: " + av.geometry.aspect_ratio);
            Console.WriteLine("Geometry:");
            Console.WriteLine("Target fps: " + av.timing.fps);
            Console.WriteLine("Sample rate " + av.timing.sample_rate);

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