public void writeToVram(int value) {
        address &= 0x3FFF;
        if (address >= 0x0000 && address <= 0x1FFF)
            bus.writeChr(address, value);
        else if (address >= 0x2000 && address <= 0x2FFF)
            writeToNametable(address, value);
        else if (address >= 0x3F00 && address <= 0x3FFF)
            writeToPalette(address, value);
        else {
            //System.out.println(String.format("I/W: %04X", address));
        }

        if ((control & R_CONTROL_VRAM_INC) != 0)
            address += 32;
        else address++;
    }