int dosplit = 0;
int splitnum = 0;
int silent = 0;
+int read_pos = -5;
+int block_pos= -5;
/********************************************************/
if (tapemode)
tapestart ();
do {
- ret = read (inputfd, buffer, 1);
+ read_pos+=ret=read (inputfd, buffer, 1);
+
#ifdef HARDCORE_DEBUG
msgf ("READ : (hex)%02x (bin)%s (dec)%3i (oct)%3o",
buffer[0], bin2str (buffer[0], 8), buffer[0], buffer[0]);
}
} while (*buffer != (unsigned char) CHAR_START);
-
+
+ block_pos=read_pos;
msg ("get_block(): Blockstart erkannt");
// blk_data = (hw16 *) malloc (MAX_BLOCK_SIZE * sizeof (hw16));
do {
complete = 0;
ret = read (inputfd, buffer + round, 1);
+ read_pos+=ret;
#ifdef HARDCORE_DEBUG
static int lochzahl = 0;
char *bin = bin2str (buffer[round], 8);
if (checksum_error (blk_data, blk_size)) {
- err ("get_block(): Checksummenfehler");
+ errf ("get_block(): Checksum error!\nBlock start: %i (0x%x), read address %i (0x%x).",
+ block_pos,block_pos,read_pos,read_pos);
#ifdef CHECKSUM_DUMP
dump_data (buffer, 3);
- read (inputfd, buffer, 3);
+ read_pos+=read (inputfd, buffer, 3);
dump_data (buffer, 3);
#endif
}
datablock *akt_block;
+ /* Initialize read position */
+ read_pos=0;
+
while (1) {
msg ("********************************************************");
msgf ("Block no. %5i", blk_no++);