int
main (void)
{
- uint8_t b[] = { 0x1f, 0x05, 0, 0, 0xa2, 3, 0, 0, 0x64, 0, 0, 0 };
+ uint8_t b[] = { 0, 0, 0, 0, 0, 0x49, 0xd2, 0x40 };
int n = sizeof b;
for (int i = 0; i <= n - 8; i++)
print_double (b + i);
static void
parse_DspString(void)
{
- match_byte_assert(1);
- match_byte_assert(2);
- match_byte_assert(40);
- if (!match_byte(0))
- match_byte_assert(5);
- match_byte_assert(0);
- match_byte_assert(1);
- printf ("DspString(\"");
- put_safe(get_string1());
- printf("\")\n");
+ if (match_byte(2))
+ {
+ printf("DspString(%f, \"", get_double());
+ printf("%s\")\n", get_string1());
+ }
+ else
+ {
+ match_byte_assert(1);
+ printf ("DspString(");
+ parse_format();
+ printf(" \"");
+ match_byte_assert(0);
+ match_byte_assert(1);
+ put_safe(get_string1());
+ printf("\")\n");
+ }
}
static void
match_DspCell();
else if (data[pos] == 0x5 && data[pos + 1] == 0x80)
match_DspString();
+ else if ((data[pos] == 0x3c || data[pos] == 0x39)
+ && data[pos + 1] == 0x80)
+ {
+ /* 3c 80 */
+ /* 39 80 */
+ pos += 2;
+ parse_format();
+/* match_byte_assert(0x01);
+ match_byte_assert(0x02);
+ match_byte_assert(0x0d); */
+ }
+ else if (data[pos] == 0x15 && data[pos + 1] == 0x80)
+ {
+ /* 15 80 */
+ data += 2;
+ match_byte_assert(2);
+ printf ("15 80(%f", get_double());
+ printf (" %s)\n", get_string1());
+ }
else
- assert(0);
+ {
+ fprintf (stderr, "bad data cell 0x%02x at offset %x\n",
+ data[pos], pos);
+ hex_dump (stderr, pos, 64);
+ assert(0);
+ }
}
int