/[VRac]/M6502/M6502.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 /M6502/M6502.pm

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

revision 86 by dpavlin, Wed Aug 1 22:25:37 2007 UTC revision 87 by dpavlin, Thu Aug 2 11:08:10 2007 UTC
# Line 17  M6502 - perl bindings for M6502 CPU emul Line 17  M6502 - perl bindings for M6502 CPU emul
17    
18  =cut  =cut
19    
20  my $debug = 1;  our $debug = 0;
21    
22  our @mem = (0xff) x 0x10000;    # 64M  our @mem = (0xff) x 0x10000;    # 64M
23    
# Line 137  sub prompt { Line 137  sub prompt {
137          return 1;          return 1;
138  }  }
139    
140  =head2 push_R  =head2 _update_perl_R
141    
142  called by C<perl.c> to push changes in registars back to perl variables  called by C<M6502.xs> to push changes in registars back to perl variables
143    
144  =cut  =cut
145    
146  sub push_R {  sub _update_perl_R {
147          warn "## M6502::push_R(",dump(@_),")\n" if $debug;          warn "## M6502::update_perl_R(",dump(@_),")\n" if $debug;
148          ( $A, $P, $X, $Y, $S, $PC, $IPeriod, $ICount, $IRequest, $IAutoReset, $TrapBadOps, $Trap, $Trace ) = @_;          ( $A, $P, $X, $Y, $S, $PC, $IPeriod, $ICount, $IRequest, $IAutoReset, $TrapBadOps, $Trap, $Trace ) = @_;
149          dump_R();          dump_R();
150  }  }
# Line 167  sub dump_R { Line 167  sub dump_R {
167          return $dump;          return $dump;
168  }  }
169    
170    =head2 debug
171    
172    Turn perl and C-level debugging on/off
173    
174      $emu->debug( 0 );
175      $emu->debug( 1 );
176      print $emu->debug;
177    
178    =cut
179    
180    sub debug {
181            my $self = shift;
182            my $value = shift;
183            if (defined($value)) {
184                    $debug = M6502::set_debug($value);
185            } else {
186                    $debug = M6502::get_debug();
187            }
188            return $debug;
189    }
190    
191  =head1 SEE ALSO  =head1 SEE ALSO
192    
193  L<Orao> is sample implementation using this module  L<Orao> is sample implementation using this module

Legend:
Removed from v.86  
changed lines
  Added in v.87

  ViewVC Help
Powered by ViewVC 1.1.26