Пример #1
0
  /**
   * A Bit of Port B is Clicked Checks Interrupt Bits and impulse edge
   *
   * @param column Bit of Port B
   */
  private void portBClicked(int column) {
    int bit = interna.getBitAtNoBank(0x6, 7 - column); // toggle bits
    if (bit == 0) interna.setBitAt(0x6, 7 - column);
    else interna.clearBitAt(0x6, 7 - column);

    boolean oldB = (bit != 0);
    boolean newB = (interna.getBitAtNoBank(0x6, 4) != 0);
    if (interna.getBitAt(0xB, 7) == 1) { // GIE Enabled
      if (interna.getBitAt(0xB, 3) == 1 && column <= 3) { // rb port changed
        interna.setBitAt(0xB, 0);
      } else if (interna.getBitAt(0xB, 4) == 1 && column == 7) { // rb0 interrupt
        if (interna.getBitAt(0x81, 6) == 1) { // check interrupt-edge
          if (newB && !oldB) {
            interna.setBitAt(0xB, 1);
          }
        } else {
          if (!newB && oldB) {
            interna.setBitAt(0xB, 1);
          }
        }
      }
    }
    updateGui();
  }
Пример #2
0
 /**
  * Bit of Port A is Clicked Checks TMR0 Source Select Bit & impulse edge
  *
  * @param column Bit of Port A
  */
 private void portAClicked(int column) {
   int bit = interna.getBitAtNoBank(0x5, 7 - column); // toggle bits
   if (bit == 0) interna.setBitAt(0x5, 7 - column);
   else interna.clearBitAt(0x5, 7 - column);
   boolean oldV = (bit != 0);
   boolean newV = (interna.getBitAtNoBank(0x5, 4) != 0);
   if (column == 3 && interna.getBitAt(0x81, 5) == 1) { // TMR0 Clock Source Select Bit
     if (interna.getBitAt(0x81, 4) == 1) { // inc high-to-low
       if (!newV && oldV) {
         interna.incTMR0();
       }
     } else { // inc low-to-high
       if (newV && !oldV) {
         interna.incTMR0();
       }
     }
   }
   updateGui();
 }