/[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 40 by dpavlin, Tue Jul 31 08:41:06 2007 UTC revision 42 by dpavlin, Tue Jul 31 09:37:01 2007 UTC
# Line 27  our ( $A, $P, $X, $Y, $S ) = (0) x 5; Line 27  our ( $A, $P, $X, $Y, $S ) = (0) x 5;
27  # Set IPeriod to number of CPU cycles between calls to Loop6502  # Set IPeriod to number of CPU cycles between calls to Loop6502
28  our $IPeriod = 1;  our $IPeriod = 1;
29  # Exec6502 cycles  # Exec6502 cycles
30  our $run_for = 1;  our $run_for = 0;
 $run_for = 0x42;  
31    
32  =head1 init  =head1 init
33    
# Line 73  sub write { Line 72  sub write {
72    
73  =head2 poke_code  =head2 poke_code
74    
75  Write series of bytes into memory without passing through MMU  Write series of bytes into memory passing through MMU (C<read> and C<write>)
76    functions. If you don't want to trigger MMU, use C<write_chunk>.
77    
78    $emu->poke_code( 0xbeef, 0xff, 0x00, 0xff, 0x00, 0xaa );    $emu->poke_code( 0xbeef, 0xff, 0x00, 0xff, 0x00, 0xaa );
79    
# Line 83  sub poke_code { Line 83  sub poke_code {
83          my $self = shift;          my $self = shift;
84          my $addr = shift;          my $addr = shift;
85          warn sprintf("# poke_code(%04x,%s)\n", $addr, dump( @_ )) if $self->debug;          warn sprintf("# poke_code(%04x,%s)\n", $addr, dump( @_ )) if $self->debug;
86          $mem[$addr++] = $_ foreach @_;          #$mem[$addr++] = $_ foreach @_;
87            $self->write($addr++, $_) foreach @_;
88  }  }
89    
90  =head2 write_chunk  =head2 write_chunk
91    
92    Low-level update of memory, overriding user specified MMU functions C<read> and C<write>
93    
94    $emu->write_chunk( $address, $chunk_of_data );    $emu->write_chunk( $address, $chunk_of_data );
95    
96  =cut  =cut
# Line 119  sub ram { Line 122  sub ram {
122          confess "no from address";          confess "no from address";
123  }  }
124    
125    =head2 prompt
126    
127    Call this after C<< $run_for >> cycles have been run on processor
128    
129    =cut
130    
131    sub prompt {
132            warn "prompt -- you should override this\n";
133            return 1;
134    }
135    
136  =head2 push_R  =head2 push_R
137    
138  called by C<perl.c> to push changes in registars back to perl variables  called by C<perl.c> to push changes in registars back to perl variables

Legend:
Removed from v.40  
changed lines
  Added in v.42

  ViewVC Help
Powered by ViewVC 1.1.26