/[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 191 by dpavlin, Sat Apr 12 13:54:53 2008 UTC revision 192 by dpavlin, Sat Apr 12 14:20:01 2008 UTC
# Line 37  my $c_0 = 0; Line 37  my $c_0 = 0;
37  my $c_1 = 0;  my $c_1 = 0;
38  my $mask = 1;  my $mask = 1;
39    
 my $bits = '';  
   
40  sub read_tape {  sub read_tape {
41          my $self = shift;          my $self = shift;
42          if ( ! $self->tape ) {          if ( ! $self->tape ) {
# Line 54  sub read_tape { Line 52  sub read_tape {
52    
53          if ( $c_0 ) {          if ( $c_0 ) {
54                  $c_0--;                  $c_0--;
                 $bits .= ".";  
55                  return 0;                  return 0;
56          }          }
57          if ( $c_1 ) {          if ( $c_1 ) {
58                  $c_1--;                  $c_1--;
                 $bits .= "X";  
59                  return 255;                  return 255;
60          }          }
61    
# Line 68  sub read_tape { Line 64  sub read_tape {
64                  $pos++;                  $pos++;
65                  $self->tape_pos( $pos );                  $self->tape_pos( $pos );
66                  $mask = 1;                  $mask = 1;
   
                 warn "# $bits\n";  
                 $bits = '';  
67          };          };
68    
69          my $byte = ord( substr($self->tape,$pos,1) );          my $byte = ord( substr($self->tape,$pos,1) );
70          my $bit = $byte & $mask;          my $bit = $byte & $mask;
71          warn sprintf("tape pos %d 0x%04x mask %02x and %02x = %d\n", $pos, $pos, $mask, $byte, $bit); # if $self->trace;  #       warn sprintf("## tape pos %d 0x%04x mask %02x and %02x = %d\n", $pos, $pos, $mask, $byte, $bit); # if $self->trace;
72    
73          ( $c_0, $c_1 ) = ( 0x17, 0x17 );          ( $c_0, $c_1 ) = ( 0x17, 0x17 );
74          ( $c_0, $c_1 ) = ( 0x30, 0x30 ) if $bit;          ( $c_0, $c_1 ) = ( 0x30, 0x30 ) if $bit;

Legend:
Removed from v.191  
changed lines
  Added in v.192

  ViewVC Help
Powered by ViewVC 1.1.26