--- M6502/M6502.pm 2007/07/31 08:41:06 40 +++ M6502/M6502.pm 2007/07/31 09:37:01 42 @@ -27,8 +27,7 @@ # Set IPeriod to number of CPU cycles between calls to Loop6502 our $IPeriod = 1; # Exec6502 cycles -our $run_for = 1; -$run_for = 0x42; +our $run_for = 0; =head1 init @@ -73,7 +72,8 @@ =head2 poke_code -Write series of bytes into memory without passing through MMU +Write series of bytes into memory passing through MMU (C and C) +functions. If you don't want to trigger MMU, use C. $emu->poke_code( 0xbeef, 0xff, 0x00, 0xff, 0x00, 0xaa ); @@ -83,11 +83,14 @@ my $self = shift; my $addr = shift; warn sprintf("# poke_code(%04x,%s)\n", $addr, dump( @_ )) if $self->debug; - $mem[$addr++] = $_ foreach @_; + #$mem[$addr++] = $_ foreach @_; + $self->write($addr++, $_) foreach @_; } =head2 write_chunk +Low-level update of memory, overriding user specified MMU functions C and C + $emu->write_chunk( $address, $chunk_of_data ); =cut @@ -119,6 +122,17 @@ confess "no from address"; } +=head2 prompt + +Call this after C<< $run_for >> cycles have been run on processor + +=cut + +sub prompt { + warn "prompt -- you should override this\n"; + return 1; +} + =head2 push_R called by C to push changes in registars back to perl variables