public final void addressWriteOld(int addr, int data) {

		/*  if ((addr >= 0xFFA4) && (addr <= 0xFFA5) && (running)) {
   System.out.println(hexWord(addr) + " written at " + hexWord(pc) + " bank " + cartridge.currentBank);
  }*/


		//  System.out.print(LowLevelData.hexByte(LowLevelData.unsign((short) data)) + " --> " + hexWord(addr) + ", ");
		if ((addr < 0x8000)) {
			if (!running) {
				cartridge.debuggerAddressWrite(addr, data);
			} else {
				cartridge.addressWrite(addr, data);
				//    System.out.println("Tried to write to ROM! PC = " + hexWord(pc) + ", Data = " + LowLevelData.hexByte(LowLevelData.unsign((byte) data)));
			}
		} else if (addr < 0xA000) {
			try {
				graphicsChip.addressWrite(addr - 0x8000, (byte) data);
			} catch (ArrayIndexOutOfBoundsException e) {
				System.out.println("Error address " + addr);
			}
		} else if (addr < 0xC000) {
			// RAM Bank write
			//   System.out.println("RAM bank write! + " + hexWord(addr) + " = " + LowLevelData.hexByte(data) + " at " + hexWord(pc));
			cartridge.addressWrite(addr, data);
		} else if (addr < 0xE000) {
			mainRam[addr - 0xC000] = (byte) data;
		} else if (addr < 0xFE00) {
			mainRam[addr - 0xE000] = (byte) data;
		} else if (addr < 0xFF00) {
			oam[addr - 0xFE00] = (byte) data;
		} else if (addr <= 0xFFFF) {
			if (addr == 0xFF80) {
				//    System.out.println("Register write: " + LowLevelData.hexWord(addr) + " = " + LowLevelData.hexWord(data));
			}
			ioHandler.ioWrite(addr - 0xFF00, (short) data);
			//   registers[addr - 0xFF00] = (byte) data;
		} else {
			System.out.println("Attempt to write to address "+ LowLevelData.hexWord(addr));
		}
	}