/[VRac]/M6502/M6502.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 /M6502/M6502.pm

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

revision 30 by dpavlin, Mon Jul 30 17:56:13 2007 UTC revision 33 by dpavlin, Mon Jul 30 21:00:36 2007 UTC
# Line 19  our $VERSION = qw(0.0.1); Line 19  our $VERSION = qw(0.0.1);
19  our @mem = (0xff) x 0x10000;    # 64M  our @mem = (0xff) x 0x10000;    # 64M
20    
21  # program counter  # program counter
22  our $PC = 0xbeef;  our $PC = 0xdd11;
23  # CPU registars  # CPU registars
24  our ( $A, $P, $X, $Y, $S ) = (0) x 5;  our ( $A, $P, $X, $Y, $S ) = (0) x 5;
25  # Set IPeriod to number of CPU cycles between calls to Loop6502  # Set IPeriod to number of CPU cycles between calls to Loop6502
# Line 32  Called before C<Run6502> Line 32  Called before C<Run6502>
32  =cut  =cut
33    
34  sub init {  sub init {
35          warn "inside init\n";          my $self = shift;
36          print "stdout\n";          warn dump(@_);
37            warn "inside init low-level M6502 from $self\n";
38  };  };
39    
40  =head2 read  =head2 read
# Line 80  sub poke_code { Line 81  sub poke_code {
81          $mem[$addr++] = $_ foreach @_;          $mem[$addr++] = $_ foreach @_;
82  }  }
83    
84    =head2 write_chunk
85    
86      $emu->write_chunk( $address, $chunk_of_data );
87    
88    =cut
89    
90    sub write_chunk {
91            my ($self, $addr, $chunk) = @_;
92            my $len = length($chunk);
93            splice @mem, $addr, $len, unpack('C*', $chunk);
94    }
95    
96  =head2 ram  =head2 ram
97    
98  Read searies of bytes from memory without passing through MMU  Read searies of bytes from memory without passing through MMU

Legend:
Removed from v.30  
changed lines
  Added in v.33

  ViewVC Help
Powered by ViewVC 1.1.26