IR not working on Attiny85

After countless attemps on making this thing work i’m not sure what the hell is going on. First of all you can’t use the normal IR library because Attiny85 is crap and due to timer isses it wont work. So basicaly you need just the specific part which gets the data from the remote and thats all. This is what i did but i failed badly again.

This time i used the simplest possible code which works perfectly on the Arduino UNO but it wont do anything on the Attiny85

The code

int irPin     = 4;
int tipPin    = 3;
int start_bit = 2200;    //Start bit threshold (Microseconds)
int bin_1     = 1000;    //Binary 1 threshold (Microseconds)
int bin_0     = 400;     //Binary 0 threshold (Microseconds)

boolean state = 0x0;

void setup() {
   pinMode(tipPin, OUTPUT);
   pinMode(irPin, INPUT);
   //Serial.println("IR/Serial Initialized: ");

void loop() {
   int key = getIRKey();   //Fetch the key
   if (key != 0) {
     state != state;
     digitalWrite(tipPin, state);
   delay(400);    // avoid double key logging (adjustable)

int getIRKey() {
  int data[12];
  int i;

while(pulseIn(irPin, LOW) < start_bit); //Wait for a start bit

for(i = 0 ; i < 11 ; i++)
  data[i] = pulseIn(irPin, LOW);      //Start measuring bits, I only want   low pulses

  for(i = 0 ; i < 11 ; i++)             //Parse them
    if(data[i] > bin_1)                 //is it a 1?
data[i] = 1;
else if(data[i] > bin_0)            //is it a 0?
data[i] = 0;
return -1;                        //Flag the data as invalid; I don't know what it is! Return -1 on invalid data

  int result = 0;
  for(i = 0 ; i < 11 ; i++)             //Convert data bits to integer
    if(data[i] == 1) result |= (1<<i);

  return result;                        //Return key number

The ouput values are 3-digit numbers which work OK and i’m not even checking the value here. Just if something came in. And it doesn’t bloody work!!!

Stuff i’ve already checked

-The circuit
-If the pin works
-If the timers are set correctly
-Using adafruits library
-Changing every possible core
-If the receiver works
-The wiring

Someone else was talking about IR on the tiny85 somewhere on here lately and it turned out that the IR library had been modified by someone to receive IR. Google and you may well find it.

This line does nothing useful:

    state != state;

You probably meant:

    state = !state;