public void run(int scanline) {
        if (scanline == 261) {
            if ((mask & R_MASK_BG_ON) != 0)
                address = (address & 0x1F) | (latch & ~0x1F);
                patternTable = ((control & R_CONTROL_BG_PATTERN) != 0) ? 0x1000:0;
            //    address = latch;
            //status &= ~R_STATUS_VBLANK;
        } else if (scanline >= 0 && scanline <= 239) {
            renderScanline(scanline);
        } else if (scanline == 241) {
            if ((control & R_CONTROL_NMI) != 0) {
                bus.getCpu().triggerNMI();
            }
            status |= R_STATUS_VBLANK;
        }
    }