Beispiel #1
0
        public void SpriteRam_DMA_Begin(byte data)
        {
            int i;

            for (i = 0; i < 0x100; i++)
            {
                spriteRam[i] = myEngine.ReadMemory8((ushort)(((uint)data * 0x100) + i));
            }

            if (spriteRam[20] == 192)
            {
            }
        }
Beispiel #2
0
 public override ushort RenderSample()
 {
     if (base.Enabled)
     {
         base.SampleCount++;
         if (base.SampleCount > this._renderedWavelength)
         {
             base.SampleCount -= this._renderedWavelength;
             if ((this.SampleLength > 0) && (this._shift == 0))
             {
                 ushort num2;
                 this.SampleAddress = (ushort)((num2 = this.SampleAddress) + 1);
                 this.DAC           = _Nes.ReadMemory8(num2);
                 this.SampleLength--;
                 this._shift = 8;
                 if (this.Loop && (this.SampleLength <= 0))
                 {
                     this.SampleLength  = this._initialLength;
                     this.SampleAddress = this._initialAddress;
                 }
             }
             if (this.SampleLength > 0)
             {
                 if (this.DAC != 0)
                 {
                     int num = this.DAC & 1;
                     if ((num == 0) && (this._dacCounter > 1))
                     {
                         this._dacCounter -= 2;
                     }
                     else if ((num != 0) && (this._dacCounter < 0x7e))
                     {
                         this._dacCounter += 2;
                     }
                 }
                 this._dacCounter--;
                 if (this._dacCounter <= 0)
                 {
                     this._dacCounter = 8;
                 }
                 this.DAC = (byte)(this.DAC >> 1);
                 this._shift--;
             }
         }
     }
     return((ushort)(this._dacCounter * 0x30));
 }