- {
- sum= ReadInt(f, &ok, 1);//printf(" sum=%02x\n",sum);
- if (ok)
- {
- if (((sum + chk) & 0xff) == 0)
- {
- if (rtyp == 0)
- {
- if (rom->width > 8)
- addr/= 2;
- for (i= 0; i < dnum; i++)
- {
- if (rom->width <= 8)
- {
- rom->set(addr, rec[i]);
- addr++;
- written++;
- }
- else if (rom->width <= 16)
- {
- if (get_low)
- {
- low= rec[i];
- get_low= 0;
- }
- else
- {
- high= rec[i];
- rom->set(addr, (high*256)+low);
- addr++;
- written++;
- get_low= 1;
- }
- }
- }
- }
- else
- if (rtyp != 1)
- application->debug("Unknown record type %d(0x%x)\n",
- rtyp, rtyp);
- }
- else
- application->debug("Checksum error (%x instead of %x) in "
- "record %ld.\n", chk, sum, recnum);
- }
- else
- application->debug("Read error in record %ld.\n", recnum);
- }
+ {
+ sum= ReadInt(f, &ok, 1);//printf(" sum=%02x\n",sum);
+ if (ok)
+ {
+ if (((sum + chk) & 0xff) == 0)
+ {
+ if (rtyp == 0)
+ {
+ if (rom->width > 8)
+ addr/= 2;
+ for (i= 0; i < dnum; i++)
+ {
+ if (rom->width <= 8)
+ {
+ rom->set(addr, rec[i]);
+ addr++;
+ written++;
+ }
+ else if (rom->width <= 16)
+ {
+ if (get_low)
+ {
+ low= rec[i];
+ get_low= 0;
+ }
+ else
+ {
+ high= rec[i];
+ rom->set(addr, (high*256)+low);
+ addr++;
+ written++;
+ get_low= 1;
+ }
+ }
+ }
+ }
+ else
+ if (rtyp != 1)
+ application->debug("Unknown record type %d(0x%x)\n",
+ rtyp, rtyp);
+ }
+ else
+ application->debug("Checksum error (%x instead of %x) in "
+ "record %ld.\n", chk, sum, recnum);
+ }
+ else
+ application->debug("Read error in record %ld.\n", recnum);
+ }