Exemple #1
0
 private void updateTimer()
 {
     if (GameBoyCPU.getBit(6, RTCRegisters[4]) == 0)
     {
         DateTime curr     = System.DateTime.Now;
         TimeSpan currSpan = curr - start;
         RTCRegisters[0] = (byte)(currSpan.Seconds);
         RTCRegisters[1] = (byte)(currSpan.Minutes);
         RTCRegisters[2] = (byte)(currSpan.Hours);
         RTCRegisters[3] = (byte)(currSpan.Days);
         if (currSpan.Days > 255)
         {
             //Rollover
             RTCRegisters[4] = GameBoyCPU.setBit(0, RTCRegisters[4]);
         }
         if (currSpan.Days > 511)
         {
             //Set overflow bit.
             RTCRegisters[4] = GameBoyCPU.setBit(7, RTCRegisters[4]);
             //Unset rollover
             RTCRegisters[4] = GameBoyCPU.resetBit(0, RTCRegisters[4]);
             start           = start.AddDays(512);
         }
     }
 }
    public bool ResetJoyPadBit(byte key)
    {
        bool isHighToLow = (GameBoyCPU.getBit(5, memory[0xFF00]) == 1) ? true : false;

        joypadState = GameBoyCPU.resetBit(key, GameBoyMemory.joypadState);
        return(isHighToLow);
    }
 private void resetSpeedBit()
 {
     memory[KEY1] = GameBoyCPU.resetBit(7, memory[KEY1]);
 }
 public void unSetPrepared()
 {
     memory[KEY1] = GameBoyCPU.resetBit(0, memory[KEY1]);
 }