37 |
|
|
38 |
Start emulator, open L<Screen>, load initial ROM images, and render memory |
Start emulator, open L<Screen>, load initial ROM images, and render memory |
39 |
|
|
40 |
my $orao = Orao->new({}); |
my $emu = Orao->new({}); |
41 |
$orao->boot; |
$emu->boot; |
42 |
|
|
43 |
=cut |
=cut |
44 |
|
|
45 |
our $orao; |
our $emu; |
46 |
|
|
47 |
select(STDERR); $| = 1; |
select(STDERR); $| = 1; |
48 |
|
|
74 |
|
|
75 |
$PC = 0xff89; |
$PC = 0xff89; |
76 |
|
|
77 |
$orao = $self; |
$emu = $self; |
78 |
|
|
79 |
# $self->prompt( 0x1000 ); |
# $self->prompt( 0x1000 ); |
80 |
|
|
123 |
|
|
124 |
Run interactive emulation loop |
Run interactive emulation loop |
125 |
|
|
126 |
$orao->run; |
$emu->run; |
127 |
|
|
128 |
=cut |
=cut |
129 |
|
|
131 |
my $self = shift; |
my $self = shift; |
132 |
|
|
133 |
$self->boot if ( ! $self->booted ); |
$self->boot if ( ! $self->booted ); |
134 |
|
|
135 |
|
$self->load_tape( '../oraoigre/bdash.tap' ); |
136 |
|
|
137 |
$self->loop; |
$self->loop; |
138 |
}; |
}; |
139 |
|
|
143 |
|
|
144 |
called to init memory and load initial rom images |
called to init memory and load initial rom images |
145 |
|
|
146 |
$orao->load_rom; |
$emu->load_rom; |
147 |
|
|
148 |
=cut |
=cut |
149 |
|
|
183 |
|
|
184 |
Load binary files, ROM images and Orao Emulator files |
Load binary files, ROM images and Orao Emulator files |
185 |
|
|
186 |
$orao->load_image( '/path/to/file', 0x1000 ); |
$emu->load_image( '/path/to/file', 0x1000 ); |
187 |
|
|
188 |
Returns true on success. |
Returns true on success. |
189 |
|
|
238 |
|
|
239 |
=head2 save_dump |
=head2 save_dump |
240 |
|
|
241 |
$orao->save_dump( 'filename', $from, $to ); |
$emu->save_dump( 'filename', $from, $to ); |
242 |
|
|
243 |
=cut |
=cut |
244 |
|
|
260 |
|
|
261 |
=head2 hexdump |
=head2 hexdump |
262 |
|
|
263 |
$orao->hexdump( $address ); |
$emu->hexdump( $address ); |
264 |
|
|
265 |
=cut |
=cut |
266 |
|
|
330 |
} elsif ( $self->key_down( 'left shift' ) || $self->key_down( 'right shift' ) ) { |
} elsif ( $self->key_down( 'left shift' ) || $self->key_down( 'right shift' ) ) { |
331 |
warn "shift\n"; |
warn "shift\n"; |
332 |
return 16; |
return 16; |
333 |
|
# } elsif ( $self->tape ) { |
334 |
|
# warn "has tape!"; |
335 |
|
# return 0; |
336 |
} |
} |
337 |
return $keyboard_none; |
return $keyboard_none; |
338 |
}, |
}, |
491 |
|
|
492 |
=head2 prompt |
=head2 prompt |
493 |
|
|
494 |
my ( $entered_line, @p ) = $orao->prompt( $address, $last_command ); |
my ( $entered_line, @p ) = $emu->prompt( $address, $last_command ); |
495 |
|
|
496 |
=cut |
=cut |
497 |
|
|
514 |
|
|
515 |
=head2 cli |
=head2 cli |
516 |
|
|
517 |
$orao->cli(); |
$emu->cli(); |
518 |
|
|
519 |
=cut |
=cut |
520 |
|
|
584 |
} elsif ( $c =~ m/^s/i ) { |
} elsif ( $c =~ m/^s/i ) { |
585 |
$self->save_dump( $v || 'mem.dump', @v ); |
$self->save_dump( $v || 'mem.dump', @v ); |
586 |
$last = ''; |
$last = ''; |
587 |
} elsif ( $c =~ m/^r/i ) { |
} elsif ( $c =~ m/^re/i ) { # reset |
588 |
|
M6502::reset(); |
589 |
|
$last = 'r 1'; |
590 |
|
} elsif ( $c =~ m/^r/i ) { # run |
591 |
$run_for = $v || 1; |
$run_for = $v || 1; |
592 |
print "run_for $run_for instructions\n"; |
print "run_for $run_for instructions\n"; |
593 |
$show_R = 1; |
$show_R = 1; |
601 |
$show_R = 1; |
$show_R = 1; |
602 |
last; |
last; |
603 |
} elsif ( $c =~ m/^tape/ ) { |
} elsif ( $c =~ m/^tape/ ) { |
604 |
if ( ! $v ) { |
if ( $c =~ m/rate/ ) { |
605 |
|
$self->tape_rate( $v ); |
606 |
|
warn "will read table with rate $v\n"; |
607 |
|
} elsif ( ! $v ) { |
608 |
warn "ERROR: please specify tape name!\n"; |
warn "ERROR: please specify tape name!\n"; |
609 |
} elsif ( ! -e $v ) { |
} elsif ( ! -e $v ) { |
610 |
warn "ERROR: tape $v: $!\n"; |
warn "ERROR: tape $v: $!\n"; |