Exemple #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            _libretro = new Wrapper(_core);
            _libretro.Init();
            _libretro.LoadGame("smw.sfc");
            _avinfo      = _libretro.GetAVInfo();
            _frameBuffer = new Texture2D(GraphicsDevice, (int)_avinfo.geometry.base_width, (int)_avinfo.geometry.base_height);

            _sampleRate    = (int)_libretro.GetAVInfo().timing.sample_rate;
            _audioBuffer   = new byte[_channels * _bufferSize * bytesPerSample];
            _workingBuffer = new float[_channels, _bufferSize];

            sound = new SoundEffect(_audioBuffer, _sampleRate, AudioChannels.Stereo);
        }
Exemple #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);
        }