--- M6502/Orao.pm 2007/08/03 10:29:33 109 +++ M6502/Orao.pm 2007/08/03 22:46:03 117 @@ -37,12 +37,12 @@ Start emulator, open L, load initial ROM images, and render memory - my $orao = Orao->new({}); - $orao->boot; + my $emu = Orao->new({}); + $emu->boot; =cut -our $orao; +our $emu; select(STDERR); $| = 1; @@ -74,7 +74,7 @@ $PC = 0xff89; - $orao = $self; + $emu = $self; # $self->prompt( 0x1000 ); @@ -123,7 +123,7 @@ Run interactive emulation loop - $orao->run; + $emu->run; =cut @@ -131,6 +131,9 @@ my $self = shift; $self->boot if ( ! $self->booted ); + +# $self->load_tape( '../oraoigre/bdash.tap' ); + $self->loop; }; @@ -140,7 +143,7 @@ called to init memory and load initial rom images - $orao->load_rom; + $emu->load_rom; =cut @@ -180,7 +183,7 @@ Load binary files, ROM images and Orao Emulator files - $orao->load_image( '/path/to/file', 0x1000 ); + $emu->load_image( '/path/to/file', 0x1000 ); Returns true on success. @@ -235,7 +238,7 @@ =head2 save_dump - $orao->save_dump( 'filename', $from, $to ); + $emu->save_dump( 'filename', $from, $to ); =cut @@ -257,7 +260,7 @@ =head2 hexdump - $orao->hexdump( $address ); + $emu->hexdump( $address ); =cut @@ -327,6 +330,9 @@ } elsif ( $self->key_down( 'left shift' ) || $self->key_down( 'right shift' ) ) { warn "shift\n"; return 16; +# } elsif ( $self->tape ) { +# warn "has tape!"; +# return 0; } return $keyboard_none; }, @@ -485,7 +491,7 @@ =head2 prompt - my ( $entered_line, @p ) = $orao->prompt( $address, $last_command ); + my ( $entered_line, @p ) = $emu->prompt( $address, $last_command ); =cut @@ -508,7 +514,7 @@ =head2 cli - $orao->cli(); + $emu->cli(); =cut @@ -578,7 +584,10 @@ } elsif ( $c =~ m/^s/i ) { $self->save_dump( $v || 'mem.dump', @v ); $last = ''; - } elsif ( $c =~ m/^r/i ) { + } elsif ( $c =~ m/^re/i ) { # reset + M6502::reset(); + $last = 'r 1'; + } elsif ( $c =~ m/^r/i ) { # run $run_for = $v || 1; print "run_for $run_for instructions\n"; $show_R = 1; @@ -592,7 +601,10 @@ $show_R = 1; last; } elsif ( $c =~ m/^tape/ ) { - if ( ! $v ) { + if ( $c =~ m/rate/ ) { + $self->tape_rate( $v ); + warn "will read table with rate $v\n"; + } elsif ( ! $v ) { warn "ERROR: please specify tape name!\n"; } elsif ( ! -e $v ) { warn "ERROR: tape $v: $!\n";