8 |
#use Time::HiRes qw(time); |
#use Time::HiRes qw(time); |
9 |
use File::Slurp; |
use File::Slurp; |
10 |
|
|
11 |
use base qw(Class::Accessor M6502); |
use base qw(Class::Accessor M6502 Screen); |
12 |
__PACKAGE__->mk_accessors(qw(debug trace run_for mem_dump trace)); |
__PACKAGE__->mk_accessors(qw(debug trace run_for mem_dump trace)); |
13 |
|
|
14 |
=head1 NAME |
=head1 NAME |
29 |
|
|
30 |
=cut |
=cut |
31 |
|
|
32 |
|
=head2 init |
33 |
|
|
34 |
|
Start emulator |
35 |
|
|
36 |
|
=cut |
37 |
|
|
38 |
|
sub init { |
39 |
|
my $self = shift; |
40 |
|
warn "call upstream init\n"; |
41 |
|
$self->SUPER::init( @_ ); |
42 |
|
|
43 |
|
warn "staring Orao $Orao::VERSION emulation\n"; |
44 |
|
|
45 |
|
$self->open_screen; |
46 |
|
$self->load_rom; |
47 |
|
} |
48 |
|
|
49 |
my $loaded_files = { |
my $loaded_files = { |
50 |
0xC000 => 'rom/BAS12.ROM', |
0xC000 => 'rom/BAS12.ROM', |
51 |
0xE000 => 'rom/CRT12.ROM', |
0xE000 => 'rom/CRT12.ROM', |
80 |
my $self = shift; |
my $self = shift; |
81 |
my ( $path, $addr ) = @_; |
my ( $path, $addr ) = @_; |
82 |
|
|
83 |
my $size = -s $path || die "no size for $path: $!"; |
my $size = -s $path || confess "no size for $path: $!"; |
84 |
|
|
85 |
my $buff = read_file( $path ); |
my $buff = read_file( $path ); |
86 |
|
|
177 |
return split(/\s+/, $in) if $in; |
return split(/\s+/, $in) if $in; |
178 |
} |
} |
179 |
|
|
180 |
|
|
181 |
=head1 AUTHOR |
=head1 AUTHOR |
182 |
|
|
183 |
Dobrica Pavlinusic, C<< <dpavlin@rot13.org> >> |
Dobrica Pavlinusic, C<< <dpavlin@rot13.org> >> |