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; |
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 |
|
|