Exemplo n.º 1
0
        public static void AudioSoundStop(object rawChannel, object rawResource, int resourceId, bool isActivelyPlaying, bool isHardStop)
        {
            SdlDotNet.Audio.Channel channel  = (SdlDotNet.Audio.Channel)rawChannel;
            SdlDotNet.Audio.Sound   resource = (SdlDotNet.Audio.Sound)rawResource;

            if (isHardStop)
            {
                channel.Stop();
            }
            else if (isActivelyPlaying)
            {
                channel.Pause();
            }
        }
Exemplo n.º 2
0
        private void Init()
        {
            useSound = true;
            byte[] BeepData = new byte[Sharp8.Properties.Resources.beep.Length];
            Sharp8.Properties.Resources.beep.Read(BeepData, 0, (int)Sharp8.Properties.Resources.beep.Length);
            BeepSound = new SdlDotNet.Audio.Sound(BeepData);
            BeepChan  = BeepSound.Play(true);
            BeepChan.Pause();
            memory      = new MemoryHandler();
            registers   = new byte[0x10];
            RandGen     = new Random();
            surfaceOut  = Video.CreateRgbSurface(640, 320);
            PixelB      = Video.CreateRgbSurface(10, 10);
            PixelW      = Video.CreateRgbSurface(10, 10);
            SCHIPPixelB = Video.CreateRgbSurface(5, 5);
            SCHIPPixelW = Video.CreateRgbSurface(5, 5);
            PixelB.Fill(Color.Black);
            PixelW.Fill(Color.White);
            SCHIPPixelB.Fill(Color.Black);
            SCHIPPixelW.Fill(Color.White);
            ScreenData = new bool[128, 64];

            programStack = new Stack <ushort>(16);
        }