public final void initiateInterrupts() {
		
		
		if (timaEnabled && ((instrCount % instrsPerTima) == 0)) {
			if (LowLevelData.unsign(ioHandler.getRegisters()[05]) == 0) {
				ioHandler.getRegisters()[05] = ioHandler.getRegisters()[06]; // Set TIMA modulo
				if ((ioHandler.getRegisters()[0xFF] & INT_TIMA) != 0)
					triggerInterrupt(INT_TIMA);
			}
			ioHandler.getRegisters()[05]++;
		}

		if ((instrCount % INSTRS_PER_DIV) == 0) {
			ioHandler.getRegisters()[04]++;
		}

		if ((instrCount % INSTRS_PER_HBLANK) == 0) {

			// LCY Coincidence
			// The +1 is due to the LCY register being just about to be incremented
			int cline = LowLevelData.unsign(ioHandler.getRegisters()[0x44]) + 1;
			if (cline == 152) cline = 0;

			if (((ioHandler.getRegisters()[0xFF] & INT_LCDC) != 0) &&
					((ioHandler.getRegisters()[0x41] & 64) != 0) &&
					(LowLevelData.unsign(ioHandler.getRegisters()[0x45]) == cline) && ((ioHandler.getRegisters()[0x40] & 0x80) != 0) && (cline < 0x90)) {
				//    System.out.println("Hblank " + cline);
				//	 System.out.println("** LCDC Int **");
				triggerInterrupt(INT_LCDC);
			}

			// Trigger on every line
			if (((ioHandler.getRegisters()[0xFF] & INT_LCDC) != 0) &&
					((ioHandler.getRegisters()[0x41] & 0x8) != 0) && ((ioHandler.getRegisters()[0x40] & 0x80) != 0) && (cline < 0x90) ) {
				//	 System.out.println("** LCDC Int **");
				triggerInterrupt(INT_LCDC);
			}



			if ((gbcFeatures) && (ioHandler.hdmaRunning)) {
				ioHandler.performHdma();
			}

			if (LowLevelData.unsign(ioHandler.getRegisters()[0x44]) == 143) {
				//     System.out.println("VBLANK!");
				for (int r = 144; r < 170; r++) {
					graphicsChip.notifyScanline(r);
				} 
				if ( ((ioHandler.getRegisters()[0x40] & 0x80) != 0) && ((ioHandler.getRegisters()[0xFF] & INT_VBLANK) != 0) ) {
					triggerInterrupt(INT_VBLANK);
					if ( ((ioHandler.getRegisters()[0x41] & 16) != 0) && ((ioHandler.getRegisters()[0xFF] & INT_LCDC) != 0) ) {
						triggerInterrupt(INT_LCDC);
						//	   System.out.println("VBlank LCDC!");
					}
				}

				boolean speedThrottle = true;
				
				if ((speedThrottle) && (graphicsChip.getFrameWaitTime() >= 0)) {
					//      System.out.println("Waiting for " + graphicsChip.frameWaitTime + "ms.");
					try {
						java.lang.Thread.sleep(graphicsChip.getFrameWaitTime());
					} catch (InterruptedException e) {
						// Nothing.
					}
				}


			}

			graphicsChip.notifyScanline(LowLevelData.unsign(ioHandler.getRegisters()[0x44]));
			ioHandler.getRegisters()[0x44] = (byte) (LowLevelData.unsign(ioHandler.getRegisters()[0x44]) + 1);
			//	System.out.println("Reg 44 = " + LowLevelData.unsign(ioHandler.getRegisters()[0x44]));

			if (LowLevelData.unsign(ioHandler.getRegisters()[0x44]) >= 153) {
				//     System.out.println("VBlank");

				ioHandler.getRegisters()[0x44] = 0;
				if (soundChip != null) soundChip.outputSound();
				graphicsChip.frameDone = false;
				
				graphicsChip.draw(0,0);
				
				//     System.out.println("LCDC reset");
			}
			
		}
	}