/[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 124 by dpavlin, Sat Aug 4 14:13:28 2007 UTC revision 132 by dpavlin, Sat Aug 4 21:04:05 2007 UTC
# Line 6  use strict; Line 6  use strict;
6  use warnings;  use warnings;
7    
8  use base qw/Class::Accessor/;  use base qw/Class::Accessor/;
9  __PACKAGE__->mk_accessors(qw(tape tape_pos tape_rate));  __PACKAGE__->mk_accessors(qw(tape tape_pos tape_rate trace));
10    
11  use File::Slurp;  use File::Slurp;
12  use Carp qw/confess/;  use Carp qw/confess/;
# Line 50  sub read_tape { Line 50  sub read_tape {
50    
51          if ( ! @tape_bits ) {          if ( ! @tape_bits ) {
52                  my $byte = ord( substr($self->tape,$pos,1) );                  my $byte = ord( substr($self->tape,$pos,1) );
53                  warn sprintf("tape pos %d = %02x\n", $pos, $byte);                  warn sprintf("tape pos %d = %02x\n", $pos, $byte) if $self->trace;
54    
55                  $pos++;                  $pos++;
56                  $self->tape_pos( $pos );                  $self->tape_pos( $pos );
# Line 58  sub read_tape { Line 58  sub read_tape {
58                  @tape_bits = split(//, unpack("B8",$byte) );                  @tape_bits = split(//, unpack("B8",$byte) );
59          }          }
60          my $bit = shift @tape_bits ? 0xff : 0x00;          my $bit = shift @tape_bits ? 0xff : 0x00;
61          warn "\t$bit\n";          warn "\t$bit\n" if $self->trace;
62          return $bit;          return $bit;
63  }  }
64    

Legend:
Removed from v.124  
changed lines
  Added in v.132

  ViewVC Help
Powered by ViewVC 1.1.26