6 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
7 |
use Carp qw/confess/; |
use Carp qw/confess/; |
8 |
use Exporter 'import'; |
use Exporter 'import'; |
9 |
our @EXPORT = qw'dump_R @mem $PC $A $P $X $Y $S $IPeriod $ICount $IRequest $IAutoReset $TrapBadOps $Trap $Trace $run_for $debug'; |
our @EXPORT = qw'dump_R @mem $PC $A $P $X $Y $S $IPeriod $ICount $IRequest $IAutoReset $TrapBadOps $Trap $Trace $debug'; |
10 |
our $VERSION = '0.0.2'; |
our $VERSION = '0.0.2'; |
11 |
require XSLoader; |
require XSLoader; |
12 |
XSLoader::load('M6502', $VERSION); |
XSLoader::load('M6502', $VERSION); |
36 |
our $Trap; # Set Trap to address to trace from |
our $Trap; # Set Trap to address to trace from |
37 |
our $Trace; # Set Trace=1 to start tracing |
our $Trace; # Set Trace=1 to start tracing |
38 |
|
|
|
# Exec6502 cycles |
|
|
our $run_for = 0; |
|
|
|
|
39 |
=head2 init |
=head2 init |
40 |
|
|
41 |
Setup read and write memory hooks (to implement memory mapped devices) |
Setup read and write memory hooks (to implement memory mapped devices) |
121 |
splice @mem, $addr, $len, unpack('C*', $chunk); |
splice @mem, $addr, $len, unpack('C*', $chunk); |
122 |
} |
} |
123 |
|
|
|
=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; |
|
|
} |
|
|
|
|
124 |
=head1 XS Callbacks |
=head1 XS Callbacks |
125 |
|
|
126 |
This functions are called from C<M6502.xs> |
This functions are called from C<M6502.xs> |