--- M6502/M6502.pm 2007/08/02 12:49:19 92 +++ M6502/M6502.pm 2007/08/02 13:04:29 94 @@ -56,7 +56,7 @@ our $_rw_hooks = { read => sub { - warn sprintf("# callback read(%04x) not implemented", @_) if $debug; + warn sprintf("# callback read(%04x) not implemented\n", @_) if $debug; return $mem[$_[0]]; }, write => sub { @@ -175,6 +175,44 @@ dump_R(); } +=head1 XS + +Following functions are implemented in C and exported to perl. + +=head2 set_debug + + M6502::set_debug( 0 ); + +=head2 get_debug + + my $debug = M6502::set_debug(); + +=head2 reset + +Reset 6502 CPU, reading PC from C<0xfffc> + + M6502::reset(); + +=head2 update_C_R + +Push perl notion of register values to CPU emulator + + M6502::update_C_R(); + +=head2 update_perl_R + +Update perl notion of register values + + M6502::update_perl_R(); + +=head2 exec + +Execute cpu for specified number of cycles + + my $cycles_left = M6502::exec( $execute_cpu_cycles ); + +=head1 Helpers + =head2 dump_R helper function which dumps registers in humanly readable form