/[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 50 by dpavlin, Tue Jul 31 11:14:19 2007 UTC revision 55 by dpavlin, Tue Jul 31 13:56:50 2007 UTC
# Line 10  our @EXPORT = qw'@mem $PC $A $P $X $Y $S Line 10  our @EXPORT = qw'@mem $PC $A $P $X $Y $S
10    
11  =head1 NAME  =head1 NAME
12    
13  M6502 - perl bindings for 6502 emulator  M6502 - perl bindings for M6502 CPU emulator
14    
15  =cut  =cut
16    
# Line 29  our $IPeriod = 1; Line 29  our $IPeriod = 1;
29  # Exec6502 cycles  # Exec6502 cycles
30  our $run_for = 0;  our $run_for = 0;
31    
32  =head1 init  =head1 FUNCTIONS
33    
34    =head2 init
35    
36  Called before C<Run6502>  Called before C<Run6502>
37    
# Line 83  sub poke_code { Line 85  sub poke_code {
85          my $addr = shift;          my $addr = shift;
86          warn sprintf("## M6502::poke_code(%04x,%s)\n", $addr, dump( @_ )) if $self->debug;          warn sprintf("## M6502::poke_code(%04x,%s)\n", $addr, dump( @_ )) if $self->debug;
87          #$mem[$addr++] = $_ foreach @_;          #$mem[$addr++] = $_ foreach @_;
88          $self->write($addr++, $_) foreach @_;          # call low-level write
89            Arch::write($addr++, $_) foreach @_;
90    }
91    
92    =head2 ram
93    
94    Read series of bytes into memory without MMU interaction
95    
96      my @code = $emu->ram( 0xc000, 0xc1000 );
97    
98    =cut
99    
100    sub ram {
101            my $self = shift;
102            my ( $from, $to ) = @_;
103            warn sprintf("## M6502::ram(%04x,%04x)\n", $from, $to) if $self->debug;
104            return @mem[ $from .. $to ];
105  }  }
106    
107  =head2 write_chunk  =head2 write_chunk
# Line 135  sub dump_R { Line 153  sub dump_R {
153          warn sprintf("## M6502::dump_R PC: %04x A:%02x P:%02x X:%02x Y:%02x S:%02x\n", $PC, $A, $P, $X, $Y, $S) if $debug;          warn sprintf("## M6502::dump_R PC: %04x A:%02x P:%02x X:%02x Y:%02x S:%02x\n", $PC, $A, $P, $X, $Y, $S) if $debug;
154  }  }
155    
156    =head1 SEE ALSO
157    
158    L<Orao> is sample implementation using this module
159    
160    =head1 AUTHOR
161    
162    Dobrica Pavlinusic, C<< <dpavlin@rot13.org> >>
163    
164    =head1 COPYRIGHT & LICENSE
165    
166    Copyright 2007 Dobrica Pavlinusic, All Rights Reserved.
167    
168    This program is free software; you can redistribute it and/or modify it
169    under the same terms as Perl itself.
170    
171    =cut
172  1;  1;

Legend:
Removed from v.50  
changed lines
  Added in v.55

  ViewVC Help
Powered by ViewVC 1.1.26