/[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 47 by dpavlin, Tue Jul 31 10:16:36 2007 UTC revision 49 by dpavlin, Tue Jul 31 10:52:06 2007 UTC
# Line 62  sub init { Line 62  sub init {
62    
63  #       $self->prompt( 0x1000 );  #       $self->prompt( 0x1000 );
64    
65          my $trace = $self->trace;          my ( $trace, $debug ) = ( $self->trace, $self->debug );
66          $self->trace( 0 );          $self->trace( 0 );
67            $self->debug( 0 );
68    
69          if ( $self->show_mem ) {          if ( $self->show_mem ) {
70    
# Line 104  sub init { Line 105  sub init {
105          }          }
106          $self->sync;          $self->sync;
107          $self->trace( $trace );          $self->trace( $trace );
108            $self->debug( $debug );
109    
110          #( $A, $P, $X, $Y, $S, $IPeriod ) = ( 1, 2, 3, 4, 5, 6 );          #( $A, $P, $X, $Y, $S, $IPeriod ) = ( 1, 2, 3, 4, 5, 6 );
111    
112          warn "Orao init finished", $self->trace ? ' trace on' : '', "\n";          warn "Orao init finished",
113                    $self->trace ? ' trace' : '',
114                    $self->debug ? ' debug' : '',
115                    "\n";
116    
117  }  }
118    
# Line 252  sub prompt { Line 257  sub prompt {
257                  "> ";                  "> ";
258          my $in = <STDIN>;          my $in = <STDIN>;
259          chomp($in);          chomp($in);
260            warn "## prompt got: $in\n" if $self->debug;
261          $in ||= $last;          $in ||= $last;
262          $last = $in;          $last = $in;
263          return split(/\s+/, $in) if $in;          return split(/\s+/, $in) if $in;
# Line 332  sub cli { Line 338  sub cli {
338                  my $c = shift @v;                  my $c = shift @v;
339                  my $v = shift @v;                  my $v = shift @v;
340                  $v = hex($v) if $v && $v =~ m/^[0-9a-f]+$/;                  $v = hex($v) if $v && $v =~ m/^[0-9a-f]+$/;
                 printf "## [%s] %s\n", ($v || 'undef'), join(",",@v) if $self->debug;  
341                  @v = map { hex($_) } @v;                  @v = map { hex($_) } @v;
342                    printf "## a: %04x parsed cli: c:%s v:%s %s\n", $a, $c, ($v || 'undef'), join(",",@v) if $self->debug;
343                  if ( $c =~ m/^[qx]/i ) {                  if ( $c =~ m/^[qx]/i ) {
344                          exit;                          exit;
345                  } elsif ( $c eq '?' ) {                  } elsif ( $c eq '?' ) {
# Line 344  e 6000 6010\tdump memory, +/- to walk fo Line 350  e 6000 6010\tdump memory, +/- to walk fo
350  m 1000 ff 00\tput ff 00 on 1000  m 1000 ff 00\tput ff 00 on 1000
351  j|u 1000\t\tjump (change pc)  j|u 1000\t\tjump (change pc)
352  r 42\t\trun 42 instruction opcodes  r 42\t\trun 42 instruction opcodes
353    t\t\ttrace on/off
354    d\t\tdebug on/off
355  __USAGE__  __USAGE__
356                  } elsif ( $c =~ m/^e/i ) {                  } elsif ( $c =~ m/^e/i ) {
357                          $a ||= $v;                          $a = $v if defined($v);
358                          my $to = shift @v;                          my $to = shift @v;
359                          $to = $a + 32 if ( ! $to || $to <= $a );                          $to = $a + 32 if ( ! $to || $to <= $a );
360                          my $lines = int( ($to - $a - 8) / 8 );                          my $lines = int( ($to - $a - 8) / 8 );
# Line 384  __USAGE__ Line 392  __USAGE__
392                  } elsif ( $c =~ m/^t/ ) {                  } elsif ( $c =~ m/^t/ ) {
393                          $self->trace( not $self->trace );                          $self->trace( not $self->trace );
394                          print "trace ", $self->trace ? 'on' : 'off', "\n";                          print "trace ", $self->trace ? 'on' : 'off', "\n";
395                    } elsif ( $c =~ m/^d/ ) {
396                            $self->debug( not $self->debug );
397                            print "debug ", $self->debug ? 'on' : 'off', "\n";
398                  } else {                  } else {
399                          warn "# ignore $c\n";                          warn "# ignore $c\n";
400                          last;                          last;

Legend:
Removed from v.47  
changed lines
  Added in v.49

  ViewVC Help
Powered by ViewVC 1.1.26