/[VRac]/Tape.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /Tape.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 193 by dpavlin, Sat Apr 12 16:18:09 2008 UTC revision 194 by dpavlin, Sat Apr 12 22:54:19 2008 UTC
# Line 69  sub read_tape { Line 69  sub read_tape {
69    
70          if ( $pos <= $tape_len ) {          if ( $pos <= $tape_len ) {
71                  $byte = ord( substr($self->tape,$pos,1) );                  $byte = ord( substr($self->tape,$pos,1) );
                 warn sprintf("## tape pos %d/%d %.02f%% 0x%04x = %02x\n", $pos, $tape_len, ($pos * 100) / $tape_len, $pos, $byte);  
72          } elsif ( $pos  == $tape_len ) {          } elsif ( $pos  == $tape_len ) {
73                  _warn "end of tape [$pos]";                  _warn "end of tape [$pos]";
74          }          }
75    
76          my $bit = $byte & $mask;          my $bit = $byte & $mask;
77          #warn sprintf("## tape pos %d 0x%04x mask %02x and %02x = %d\n", $pos, $pos, $mask, $byte, $bit); # if $self->trace;  
78            warn sprintf("## tape pos %d/%d %.02f%% 0x%04x = %02x\n", $pos, $tape_len, ($pos * 100) / $tape_len, $pos, $byte) if $mask == 1;
79    
80          ( $c_0, $c_1 ) = ( 0x17, 0x17 );          ( $c_0, $c_1 ) = ( 0x17, 0x17 );
81          ( $c_0, $c_1 ) = ( 0x30, 0x30 ) if $bit;          ( $c_0, $c_1 ) = ( 0x30, 0x30 ) if $bit;
# Line 132  sub tape_status { Line 132  sub tape_status {
132    
133          return sprintf(          return sprintf(
134                  "tape file: %s with %d 0x%x bytes, current position: %d 0x%x",                  "tape file: %s with %d 0x%x bytes, current position: %d 0x%x",
135                  $self->tape_path, $size, $size, $self->pos, $self->pos,                  $self->tape_path, $size, $size, $self->tape_pos, $self->tape_pos,
136          );          );
137  }  }
138    

Legend:
Removed from v.193  
changed lines
  Added in v.194

  ViewVC Help
Powered by ViewVC 1.1.26