CSNG (File Format): Difference between revisions

imported>Jackoalan
imported>Jackoalan
Line 266: Line 266:
(0x80). The decoder must track the absolute time and value, summing each consecutive update
(0x80). The decoder must track the absolute time and value, summing each consecutive update
for the current time/values.
for the current time/values.
The byte sequence 0x80 0x00 is a special case that signals the end of the stream.


Similar to the command stream, when the delta time exceeds 15 bit range (>32767), extra pairs
Similar to the command stream, when the delta time exceeds 15 bit range (>32767), extra pairs
Line 296: Line 298:
     ret = [0,0]
     ret = [0,0]
     while ret[1] == 0:
     while ret[1] == 0:
        if streamIn.PeekU16() == 0x8000:
            # The stream has ended
            break
         ret[0] += DecodeUnsignedValue(streamIn)
         ret[0] += DecodeUnsignedValue(streamIn)
         ret[1] = DecodeSignedValue(streamIn)
         ret[1] = DecodeSignedValue(streamIn)
Anonymous user