/[VRac]/Orao.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /Orao.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 95 by dpavlin, Thu Aug 2 13:19:19 2007 UTC revision 97 by dpavlin, Thu Aug 2 14:07:52 2007 UTC
# Line 12  use List::Util qw/first/; Line 12  use List::Util qw/first/;
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(booted run_for));  __PACKAGE__->mk_accessors(qw(booted));
16    
17  =head1 NAME  =head1 NAME
18    
# Line 140  Run interactive emulation loop Line 140  Run interactive emulation loop
140  sub run {  sub run {
141          my $self = shift;          my $self = shift;
142    
143          $self->boot if ( ! $self->booted );          $self->show_mem( 1 );
144    
145          while ( 1 ) {          $self->boot if ( ! $self->booted );
146                  $self->cli;          $self->loop;
                 M6502::exec($run_for);  
         }  
147  };  };
148    
149  =head1 Helper functions  =head1 Helper functions
# Line 319  sub read { Line 317  sub read {
317          # keyboard          # keyboard
318    
319          if ( first { $addr == $_ } @kbd_ports ) {          if ( first { $addr == $_ } @kbd_ports ) {
320                  warn sprintf("keyboard port: %04x\n",$addr);                  warn sprintf("keyboard port: %04x\n",$addr) if $self->trace;
321          } elsif ( $addr == 0x87fc ) {          } elsif ( $addr == 0x87fc ) {
322                  warn "0x87fc - arrows/back\n";                  warn "0x87fc - arrows/back\n";
323  =for pascal  =for pascal
# Line 419  sub prompt { Line 417  sub prompt {
417          my $self = shift;          my $self = shift;
418          $self->app->sync;          $self->app->sync;
419          my $a = shift;          my $a = shift;
420          print STDERR $self->hexdump( $a ),          print $self->hexdump( $a ),
421                  $last ? "[$last] " : '',                  $last ? "[$last] " : '',
422                  "> ";                  "> ";
423          my $in = <STDIN>;          my $in = <STDIN>;
# Line 441  my $show_R = 0; Line 439  my $show_R = 0;
439  sub cli {  sub cli {
440          my $self = shift;          my $self = shift;
441          my $a = $PC || confess "no pc?";          my $a = $PC || confess "no pc?";
442            my $run_for = 0;
443          warn $self->dump_R() if $show_R;          warn $self->dump_R() if $show_R;
444          while ( my ($line, @v) = $self->prompt( $a, $last ) ) {          while ( my ($line, @v) = $self->prompt( $a, $last ) ) {
445                  my $c = shift @v;                  my $c = shift @v;
# Line 467  d\t\tdebug [$d] Line 466  d\t\tdebug [$d]
466    
467  __USAGE__  __USAGE__
468                          warn $self->dump_R;                          warn $self->dump_R;
469                            $last = '';
470                  } elsif ( $c =~ m/^e/i ) {                  } elsif ( $c =~ m/^e/i ) {
471                          $a = $v if defined($v);                          $a = $v if defined($v);
472                          my $to = shift @v;                          my $to = shift @v;
# Line 527  __USAGE__ Line 527  __USAGE__
527                  }                  }
528          }          }
529    
530            return $run_for;
531  }  }
532    
533  =head1 AUTHOR  =head1 AUTHOR

Legend:
Removed from v.95  
changed lines
  Added in v.97

  ViewVC Help
Powered by ViewVC 1.1.26