Beispiel #1
0
        public VirtualBoyee(CoreComm comm, byte[] rom, Settings settings, SyncSettings syncSettings)
            : base(comm, new Configuration
        {
            DefaultFpsNumerator   = 20000000,
            DefaultFpsDenominator = 397824,
            DefaultWidth          = 384,
            DefaultHeight         = 224,
            MaxWidth   = 1024,
            MaxHeight  = 1024,
            MaxSamples = 8192,
            SystemId   = "VB"
        })
        {
            _settings     = settings ?? new Settings();
            _syncSettings = syncSettings ?? new SyncSettings();

            _boyee = PreInit <LibVirtualBoyee>(new WaterboxOptions
            {
                Filename                   = "vb.wbx",
                SbrkHeapSizeKB             = 256,
                SealedHeapSizeKB           = 4 * 1024,
                InvisibleHeapSizeKB        = 256,
                PlainHeapSizeKB            = 256,
                SkipCoreConsistencyCheck   = comm.CorePreferences.HasFlag(CoreComm.CorePreferencesFlags.WaterboxCoreConsistencyCheck),
                SkipMemoryConsistencyCheck = comm.CorePreferences.HasFlag(CoreComm.CorePreferencesFlags.WaterboxMemoryConsistencyCheck),
            });

            if (!_boyee.Load(rom, rom.Length, LibVirtualBoyee.NativeSyncSettings.FromFrontendSettings(_syncSettings)))
            {
                throw new InvalidOperationException("Core rejected the rom");
            }

            // do a quick hack up for frame zero size
            var tmp = new LibVirtualBoyee.FrameInfo();

            _boyee.PredictFrameSize(tmp);
            BufferWidth  = tmp.Width;
            BufferHeight = tmp.Height;

            PostInit();

            _boyee.SetSettings(LibVirtualBoyee.NativeSettings.FromFrontendSettings(_settings));
        }
Beispiel #2
0
        public VirtualBoyee(CoreComm comm, byte[] rom, Settings settings, SyncSettings syncSettings)
            : base(comm, new Configuration
        {
            DefaultFpsNumerator   = 20000000,
            DefaultFpsDenominator = 397824,
            DefaultWidth          = 384,
            DefaultHeight         = 224,
            MaxWidth   = 1024,
            MaxHeight  = 1024,
            MaxSamples = 8192,
            SystemId   = "VB"
        })
        {
            _settings     = settings ?? new Settings();
            _syncSettings = syncSettings ?? new SyncSettings();
            // TODO: the way settings work in this core, changing the non-sync ones will invalidate savestates
            var nativeSettings = LibVirtualBoyee.NativeSettings.FromFrontendSettings(_settings, _syncSettings);

            _boyee = PreInit <LibVirtualBoyee>(new PeRunnerOptions
            {
                Filename            = "vb.wbx",
                SbrkHeapSizeKB      = 256,
                SealedHeapSizeKB    = 4 * 1024,
                InvisibleHeapSizeKB = 256,
                PlainHeapSizeKB     = 256
            });

            if (!_boyee.Load(rom, rom.Length, nativeSettings))
            {
                throw new InvalidOperationException("Core rejected the rom");
            }

            // do a quick hack up for frame zero size
            var tmp = new LibVirtualBoyee.FrameInfo();

            _boyee.PredictFrameSize(tmp);
            BufferWidth  = tmp.Width;
            BufferHeight = tmp.Height;

            PostInit();
        }