/[VRac]/ACME-6502/lib/TieMem.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 /ACME-6502/lib/TieMem.pm

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

revision 18 by dpavlin, Sun Jul 29 21:22:24 2007 UTC revision 19 by dpavlin, Sun Jul 29 21:56:40 2007 UTC
# Line 27  sub _read { Line 27  sub _read {
27          my $value = $$self{WRAP}[$index & 0xffff];          my $value = $$self{WRAP}[$index & 0xffff];
28          cluck "read undef value from $index" unless defined($value);          cluck "read undef value from $index" unless defined($value);
29  #       printf "_read(%04x) = %2x %d\n", $index, $value, $value;  #       printf "_read(%04x) = %2x %d\n", $index, $value, $value;
30          $self->{mem_acc}->( $index, 'read', $value );          $self->{mmu}->( $index, 'read', $value );
31          return $value;          return $value;
32  }  }
33    
34  sub _write {  sub _write {
35          my ( $self, $index, $value ) = @_;          my ( $self, $index, $value ) = @_;
         if ( $index >= 0x6000 && $index < 0x8000 ) {  
                 $self->{vram}->( $index - 0x6000 , $value );  
         }  
         if ( $index > 0xAFFF ) {  
                 printf "access to %04x above affff aborting\n", $index;  
                 return -1;  
         }  
         if ( $index == 0x8800 ) {  
                 printf "sound ignored: %x\n", $value;  
         }  
36          confess "write undef value to $index" unless defined($value);          confess "write undef value to $index" unless defined($value);
37  #       printf "_write(%04x) = %2x %d\n", $index, $value, $value;  #       printf "_write(%04x) = %2x %d\n", $index, $value, $value;
38          $self->{mem_acc}->( $index, 'write', $value );          $self->{mmu}->( $index, 'write', $value );
39          $$self{WRAP}[$index] = $value;          $$self{WRAP}[$index] = $value;
40  }  }
41    
# Line 56  sub TIEARRAY { Line 46  sub TIEARRAY {
46          my ($class, $args) = @_;          my ($class, $args) = @_;
47          warn "tiemem",dump( $class, $args );          warn "tiemem",dump( $class, $args );
48          $self{WRAP} = \@ram;          $self{WRAP} = \@ram;
49          foreach my $p ( qw/vram mem_acc/ ) {          foreach my $p ( qw/mmu/ ) {
50                  $self{$p} = $args->{$p} || die "no $p ?";                  $self{$p} = $args->{$p} || die "no $p ?";
51          }          }
52          return bless \%self, $class;          return bless \%self, $class;

Legend:
Removed from v.18  
changed lines
  Added in v.19

  ViewVC Help
Powered by ViewVC 1.1.26