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

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

revision 91 by dpavlin, Thu Aug 2 12:37:06 2007 UTC revision 92 by dpavlin, Thu Aug 2 12:49:19 2007 UTC
# Line 6  use strict; Line 6  use strict;
6  use blib;  use blib;
7  use lib './lib';  use lib './lib';
8    
9  use Test::More tests => 36;  use Test::More tests => 53;
10  use Test::Exception;  use Test::Exception;
11  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
12    
# Line 65  foreach my $byte ( 0x00, 0x01, 0xff, 0xa Line 65  foreach my $byte ( 0x00, 0x01, 0xff, 0xa
65          cmp_ok( M6502::_read($a), '==', $byte, 'M6502::_read' );          cmp_ok( M6502::_read($a), '==', $byte, 'M6502::_read' );
66  }  }
67    
68    $mem[$_] = 0b11101101 foreach ( 0x6000 .. 0x7ffff );
69    
70  $mem[$_] = 0 foreach ( 0x6000 .. 0x7ffff );  # flip bytes 6502 asm
   
 # invert screen in 6502 asm  
71  my $a = 0x1000;  my $a = 0x1000;
72    
73  $mem[$a++] = $_ foreach (  $mem[$a++] = $_ foreach (
# Line 85  diag dump_R(); Line 84  diag dump_R();
84  $PC = 0x1000;  $PC = 0x1000;
85    
86  ok( ! M6502::exec( 1 ), 'M6502::exec(1)' );  ok( ! M6502::exec( 1 ), 'M6502::exec(1)' );
87  cmp_ok( $PC, '>', 0x1000, 'PC moved' );  cmp_ok( $PC, '==', 0x1002, 'PC moved' );
   
 diag dump_R();  
   
 ok( my $left = M6502::exec( 10000 ), 'M6502::exec' );  
88    
89  diag dump_R(), "cycles left: $left";  ok( ! M6502::exec( 1000 ), 'M6502::exec' );
90    cmp_ok( $PC, '==', 0x1016, 'PC moved' );
91    
92  foreach my $a ( 0x6000 .. 0x6001 ) {  foreach my $a ( 0x6000 .. 0x600c ) {
93          cmp_ok( $mem[$a], '==', 0xff, sprintf('inverted %04x',$a) );          cmp_ok( $mem[$a], '==', 0b10110111, sprintf('flipped %04x',$a) );
94  }  }

Legend:
Removed from v.91  
changed lines
  Added in v.92

  ViewVC Help
Powered by ViewVC 1.1.26