@@ -35,7 +35,7 @@ pub struct ImcHeader {
3535 /// size of byte-stream
3636 size_of_data : u32 ,
3737 /// Final XOR
38- final_xor : u16 ,
38+ final_xor : Bytes16 ,
3939 u4 : Bytes16 ,
4040 u5 : Bytes32 ,
4141 u6 : Bytes32 ,
@@ -66,7 +66,7 @@ fn parse_imc_header(input: &[u8]) -> IResult<&[u8], ImcHeader> {
6666 let ( input, size_of_bits) = be_u32 ( input) ?;
6767 let ( input, size_of_data) = be_u32 ( input) ?;
6868
69- let ( input, s14 ) = be_u16 ( input) ?;
69+ let ( input, final_xor ) = bytes16 ( input) ?;
7070 let ( input, u4) = bytes16 ( input) ?;
7171 let ( input, u5) = bytes32 ( input) ?;
7272 let ( input, u6) = bytes32 ( input) ?;
@@ -79,7 +79,7 @@ fn parse_imc_header(input: &[u8]) -> IResult<&[u8], ImcHeader> {
7979 vchunks,
8080 size_of_bits,
8181 size_of_data,
82- final_xor : s14 ,
82+ final_xor,
8383 u4,
8484 u5,
8585 u6,
@@ -261,8 +261,8 @@ pub fn decode_imc(src: &[u8]) -> IResult<&[u8], (ImcHeader, MonochromeScreen)> {
261261 dest = & mut dest[ bytes_per_group..] ;
262262 }
263263
264- if header. final_xor != 0 {
265- let [ a, b] = header. final_xor . to_be_bytes ( ) ;
264+ if header. final_xor . 0 != 0 {
265+ let [ a, b] = header. final_xor . to_bytes ( ) ;
266266 /*// subroutine K
267267
268268 state.proc_l(a, &mut buffer[..], header.s08, header.s0a);
0 commit comments