public void write(int addr, int data){
                //RAM
        if (!mRamSelect)
        {
            mRAM[addr & 0x7F] = data;
        }
        else
        {
             switch (addr)
             {
                 case Addresses.TIM1T:
                     mTimer = data;
                     mTISetUnderflow = false;
                     mTimerPrescaler = 1;
                     mTimerPrescalerCount = mTimerPrescaler;
                     mTimer--;
                     
                     if (mTimer < 0)
                     {
                         mInstantReadUnderflow = true;
                         mTISetUnderflow = true;
                         mTimer = 0xFF;
                         mHighDecrement = true;
                     }
                     
                     break;
                     
                 case Addresses.TIM8T:
                     mTimer = data;
                     mTISetUnderflow = false;
                     mTimerPrescaler = 8;
                     mTimerPrescalerCount = mTimerPrescaler;
                     mTimer--;
                     
                     if (mTimer < 0)
                     {
                         mInstantReadUnderflow = true;
                         mTISetUnderflow = true;
                         mTimer = 0xFF;
                         mHighDecrement = true;
                     }
                     
                     break;
                     
                 case Addresses.TIM64T:
                     mTimer = data;
                     mTISetUnderflow = false;
                     mTimerPrescaler = 64;
                     mTimerPrescalerCount=mTimerPrescaler;
                     mTimer--;
                     
                     if (mTimer < 0)
                     {
                         mInstantReadUnderflow = true;
                         mTISetUnderflow = true;
                         mTimer = 0xFF;
                         mHighDecrement = true;
                     }
                     
                     break;
                     
                 case Addresses.T1024T:
                     mTimer = data;
                     mTISetUnderflow = false;
                     mTimerPrescaler = 1024;
                     mTimerPrescalerCount=mTimerPrescaler;
                     mTimer--;
                     
                     if (mTimer < 0)
                     {
                         mInstantReadUnderflow = true;
                         mTISetUnderflow = true;
                         mTimer = 0xFF;
                         mHighDecrement = true;
                     }
                     
                     break;
            }
        }
    }