]> www.fi.muni.cz Git - slotcarman.git/blobdiff - SCX/Parser.pm
Attempt to handle timing more exactly.
[slotcarman.git] / SCX / Parser.pm
index b71f26b75639c01c8477bd68cc0b867c643cfa54..080e8f21fdac67783ed87571e1a6b2b91f98e8f2 100644 (file)
@@ -185,9 +185,12 @@ sub car_lap_time_packet {
                || $bytes[5] & 0x01;
 
        $self->car_lap_time($bytes[0],
-               256*$bytes[1] + $bytes[2] + ($bytes[3] & 0x01 ? 1 : 0),
+               256*$bytes[1] + $bytes[2]
+                       + ($bytes[3] & 0x02 ? 256 : 0)
+                       + ($bytes[3] & 0x01 ? 1 : 0),
                sprintf('%.3f', 0.01024 * (256*$bytes[4] + $bytes[5]
-                       + ($bytes[3] & 0x08 ? 1 : 0))),
+                       + ($bytes[3] & 0x08 ? 256 : 0)
+                       + ($bytes[3] & 0x04 ? 1 : 0))),
                sprintf('%04b', $bytes[3])
        );
 }