56 |
|
|
57 |
our $_rw_hooks = { |
our $_rw_hooks = { |
58 |
read => sub { |
read => sub { |
59 |
warn sprintf("# callback read(%04x) not implemented", @_) if $debug; |
warn sprintf("# callback read(%04x) not implemented\n", @_) if $debug; |
60 |
return $mem[$_[0]]; |
return $mem[$_[0]]; |
61 |
}, |
}, |
62 |
write => sub { |
write => sub { |
175 |
dump_R(); |
dump_R(); |
176 |
} |
} |
177 |
|
|
178 |
|
=head1 XS |
179 |
|
|
180 |
|
Following functions are implemented in C<M6502.xs> and exported to perl. |
181 |
|
|
182 |
|
=head2 set_debug |
183 |
|
|
184 |
|
M6502::set_debug( 0 ); |
185 |
|
|
186 |
|
=head2 get_debug |
187 |
|
|
188 |
|
my $debug = M6502::set_debug(); |
189 |
|
|
190 |
|
=head2 reset |
191 |
|
|
192 |
|
Reset 6502 CPU, reading PC from C<0xfffc> |
193 |
|
|
194 |
|
M6502::reset(); |
195 |
|
|
196 |
|
=head2 update_C_R |
197 |
|
|
198 |
|
Push perl notion of register values to CPU emulator |
199 |
|
|
200 |
|
M6502::update_C_R(); |
201 |
|
|
202 |
|
=head2 update_perl_R |
203 |
|
|
204 |
|
Update perl notion of register values |
205 |
|
|
206 |
|
M6502::update_perl_R(); |
207 |
|
|
208 |
|
=head2 exec |
209 |
|
|
210 |
|
Execute cpu for specified number of cycles |
211 |
|
|
212 |
|
my $cycles_left = M6502::exec( $execute_cpu_cycles ); |
213 |
|
|
214 |
|
=head1 Helpers |
215 |
|
|
216 |
=head2 dump_R |
=head2 dump_R |
217 |
|
|
218 |
helper function which dumps registers in humanly readable form |
helper function which dumps registers in humanly readable form |