1 | /* |
1 | /* |
2 | parse_simple.c - Part of psiconv, a PSION 5 file formats converter |
2 | parse_simple.c - Part of psiconv, a PSION 5 file formats converter |
3 | Copyright (c) 1999 Frodo Looijaard <frodol@dds.nl> |
3 | Copyright (c) 1999, 2000 Frodo Looijaard <frodol@dds.nl> |
4 | |
4 | |
5 | This program is free software; you can redistribute it and/or modify |
5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by |
6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or |
7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. |
8 | (at your option) any later version. |
… | |
… | |
102 | } else if ((temp & 0x03) == 0x01) { |
102 | } else if ((temp & 0x03) == 0x01) { |
103 | res = psiconv_read_u16(buf,lev+2,off) >> 2; |
103 | res = psiconv_read_u16(buf,lev+2,off) >> 2; |
104 | len = 2; |
104 | len = 2; |
105 | psiconv_debug(lev+2,off,"Indicator (2 bytes): %04x",res); |
105 | psiconv_debug(lev+2,off,"Indicator (2 bytes): %04x",res); |
106 | } else if ((temp & 0x07) == 0x03) { |
106 | } else if ((temp & 0x07) == 0x03) { |
107 | res = psiconv_read_u16(buf,lev+2,off) >> 3; |
107 | res = psiconv_read_u32(buf,lev+2,off) >> 3; |
108 | len = 4; |
108 | len = 4; |
109 | psiconv_debug(lev+2,off,"Indicator (4 bytes): %08x",res); |
109 | psiconv_debug(lev+2,off,"Indicator (4 bytes): %08x",res); |
110 | } else { |
110 | } else { |
111 | psiconv_warn(lev+2,off,"X indicator: unknown encoding!"); |
111 | psiconv_warn(lev+2,off,"X indicator: unknown encoding!"); |
112 | psiconv_debug(lev+2,off,"Raw data first byte: %02x",temp); |
112 | psiconv_debug(lev+2,off,"Raw data first byte: %02x",temp); |