PS2 Mouse Library

I have got my hands on the old PS2 mouse library, and have reworked most of the code directly into my project.
I've been using this (http://www.computer-engineering.org/ps2mouse/) site to help me figure out what's what, and so far everything seems to be working smoothly, but I've hit a wall and I can't figure out how to fix the fact that the library only reads 8 bits for movement, when it's supposed to be 9 bits (2-complement 9-bit), and I cannot figure out how to do it.

Here is my current code for reading data from the mouse:

unsigned char read2(boolean vrbs, boolean mvmnt) {
  unsigned char packet = 0x00;
  unsigned char i;
  unsigned char bob = 0x01;
  gohi(clock);
  gohi(data);
  delayMicroseconds(50);
  while (digitalRead(clock) == HIGH);
//  delayMicroseconds(5);	// not sure why.
  while (digitalRead(clock) == LOW);	// eat start bit
  for (i=0; i <= 7 + mvmnt; i++) {
    while (digitalRead(clock) == HIGH);
    if (digitalRead(data) == HIGH) {
      packet = packet | bob;
    }
    while (digitalRead(clock) == LOW);
    bob = bob << 1;
  }
  // eat parity bit, ignore it.
  while (digitalRead(clock) == HIGH);
  while (digitalRead(clock) == LOW);
  // eat stop bit
  while (digitalRead(clock) == HIGH);
  while (digitalRead(clock) == LOW);
  golo(clock);	// hold incoming data
  if (vrbs == 1)
    Serial << "Mouse says " << _HEX(packet) << endl;
  return packet;
}

I've left in the original comments, but most of them make no sense to me.
Eg, I turned off the Microsecond delay and it's working just fine for me..

Anyway, hopefully somebody out there knows what's going on here, because I sure don't :~

In answer to your question, reread the paragraph Movement Data Packet in the link you provided. As I understand the description the the sign bits for the movement bytes are stuffed into the first byte (bits 4 & 5).

Further, the protocol is byte oriented, so the for loop should only read 8 bits. Not sure why mvmnt is added to the for loop check. If you are trying to read a movement data packet it seems as if you have to read in 3 bytes. Not sure if the 3 bytes are transmitted as 1 packet or 3 separate packets of data.

The delayMicroseconds statement don't make much sense since the actual clock transitions are checked by while loops anyway. Perhaps a 1 microsecond or so delay is needed when the clock & data lines are pulled hi at the start to allow the line voltages to settle before reading.

Hope this helps a bit.