6 |
use blib; |
use blib; |
7 |
use lib './lib'; |
use lib './lib'; |
8 |
|
|
9 |
use Test::More tests => 164; |
use Test::More tests => 168; |
10 |
use Test::Exception; |
use Test::Exception; |
11 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
12 |
|
|
65 |
cmp_ok( M6502::_read($a), '==', $byte, 'M6502::_read' ); |
cmp_ok( M6502::_read($a), '==', $byte, 'M6502::_read' ); |
66 |
} |
} |
67 |
|
|
|
# flip bytes 6502 asm |
|
|
my $a = 0x1000; |
|
|
|
|
|
$mem[$a++] = $_ foreach ( |
|
|
0xa9, 0x60, 0xa2, 0x7f, 0xa0, 0x00, 0x85, 0xe1, |
|
|
0x84, 0xe0, 0xb1, 0xe0, 0x4a, 0x26, 0xe2, 0x4a, |
|
|
0x26, 0xe2, 0x4a, 0x26, 0xe2, 0x4a, 0x26, 0xe2, |
|
|
0x4a, 0x26, 0xe2, 0x4a, 0x26, 0xe2, 0x4a, 0x26, |
|
|
0xe2, 0x4a, 0x26, 0xe2, 0xa5, 0xe2, 0x91, 0xe0, |
|
|
0xc8, 0xd0, 0xdf, 0xe6, 0xe1, 0xe4, 0xe1, 0xb0, |
|
|
0xd9, 0x60, 0x00, |
|
|
); |
|
|
|
|
68 |
my @flip_tests = ( |
my @flip_tests = ( |
69 |
{ fill => 0b11101101, expect => 0b10110111, callbacks => 0x33 }, |
{ fill => 0b11101101, expect => 0b10110111, callbacks => 0x33 }, |
70 |
{ fill => 0b11101101, expect => 0b10110111, callbacks => 0x22 }, |
{ fill => 0b11101101, expect => 0b10110111, callbacks => 0x22 }, |
76 |
|
|
77 |
diag "test ",dump( $test ); |
diag "test ",dump( $test ); |
78 |
|
|
79 |
|
ok( M6502::reset(), 'reset again' ); |
80 |
is( M6502::set_all_callbacks( $test->{callbacks} ), $test->{callbacks}, 'set_all_callbacks' ); |
is( M6502::set_all_callbacks( $test->{callbacks} ), $test->{callbacks}, 'set_all_callbacks' ); |
81 |
|
|
82 |
|
# flip bytes 6502 asm |
83 |
|
my $a = 0x1000; |
84 |
|
|
85 |
|
$mem[$a++] = $_ foreach ( |
86 |
|
0xa9, 0x60, 0xa2, 0x7f, 0xa0, 0x00, 0x85, 0xe1, |
87 |
|
0x84, 0xe0, 0xb1, 0xe0, 0x4a, 0x26, 0xe2, 0x4a, |
88 |
|
0x26, 0xe2, 0x4a, 0x26, 0xe2, 0x4a, 0x26, 0xe2, |
89 |
|
0x4a, 0x26, 0xe2, 0x4a, 0x26, 0xe2, 0x4a, 0x26, |
90 |
|
0xe2, 0x4a, 0x26, 0xe2, 0xa5, 0xe2, 0x91, 0xe0, |
91 |
|
0xc8, 0xd0, 0xdf, 0xe6, 0xe1, 0xe4, 0xe1, 0xb0, |
92 |
|
0xd9, 0x60, 0x00, |
93 |
|
); |
94 |
|
|
95 |
$mem[$_] = $test->{fill} foreach ( 0x6000 .. 0x7ffff ); |
$mem[$_] = $test->{fill} foreach ( 0x6000 .. 0x7ffff ); |
96 |
|
|
97 |
diag dump_R(); |
diag dump_R(); |