+ read_ofs = (inw( card->IOBase + CAPR ) + 0x10) & 0xFFFF;
+ LOG("read_ofs = %i", read_ofs);
+
+ pkt_length = *(Uint16*)&card->ReceiveBuffer[read_ofs+2];
+
+ // Calculate new read offset
+ new_read_ofs = read_ofs + pkt_length + 4;
+ new_read_ofs = (new_read_ofs + 3) & ~3; // Align
+ if(new_read_ofs > card->ReceiveBufferLength) new_read_ofs = 0;
+ new_read_ofs -= 0x10; // I dunno