12 |
use M6502; |
use M6502; |
13 |
|
|
14 |
use base qw(Class::Accessor M6502 Screen Prefs); |
use base qw(Class::Accessor M6502 Screen Prefs); |
15 |
__PACKAGE__->mk_accessors(qw(run_for)); |
__PACKAGE__->mk_accessors(qw(booted)); |
16 |
|
|
17 |
=head1 NAME |
=head1 NAME |
18 |
|
|
20 |
|
|
21 |
=head1 VERSION |
=head1 VERSION |
22 |
|
|
23 |
Version 0.03 |
Version 0.04 |
24 |
|
|
25 |
=cut |
=cut |
26 |
|
|
27 |
our $VERSION = '0.03'; |
our $VERSION = '0.04'; |
28 |
|
|
29 |
=head1 SUMMARY |
=head1 SUMMARY |
30 |
|
|
39 |
0x83FE,0x83FF, |
0x83FE,0x83FF, |
40 |
); |
); |
41 |
|
|
42 |
|
=head1 FUNCTIONS |
43 |
|
|
44 |
=head2 boot |
=head2 boot |
45 |
|
|
46 |
Start emulator, open L<Screen>, load initial ROM images, and render memory |
Start emulator, open L<Screen>, load initial ROM images, and render memory |
126 |
|
|
127 |
M6502::reset(); |
M6502::reset(); |
128 |
|
|
129 |
|
$self->booted( 1 ); |
130 |
} |
} |
131 |
|
|
132 |
|
=head2 run |
133 |
|
|
134 |
|
Run interactive emulation loop |
135 |
|
|
136 |
|
$orao->run; |
137 |
|
|
138 |
|
=cut |
139 |
|
|
140 |
|
sub run { |
141 |
|
my $self = shift; |
142 |
|
|
143 |
|
$self->boot if ( ! $self->booted ); |
144 |
|
$self->loop; |
145 |
|
}; |
146 |
|
|
147 |
|
=head1 Helper functions |
148 |
|
|
149 |
=head2 load_rom |
=head2 load_rom |
150 |
|
|
151 |
called to init memory and load initial rom images |
called to init memory and load initial rom images |
437 |
sub cli { |
sub cli { |
438 |
my $self = shift; |
my $self = shift; |
439 |
my $a = $PC || confess "no pc?"; |
my $a = $PC || confess "no pc?"; |
440 |
|
my $run_for = 0; |
441 |
warn $self->dump_R() if $show_R; |
warn $self->dump_R() if $show_R; |
442 |
while ( my ($line, @v) = $self->prompt( $a, $last ) ) { |
while ( my ($line, @v) = $self->prompt( $a, $last ) ) { |
443 |
my $c = shift @v; |
my $c = shift @v; |
524 |
} |
} |
525 |
} |
} |
526 |
|
|
527 |
|
return $run_for; |
528 |
} |
} |
529 |
|
|
530 |
=head1 AUTHOR |
=head1 AUTHOR |