2017-12-20 09:07:09 -08:00
|
|
|
// From https://github.com/Klaus2m5/6502_65C02_functional_tests
|
2019-03-26 21:12:05 -07:00
|
|
|
|
2019-12-02 18:53:47 -08:00
|
|
|
import fs from 'fs';
|
|
|
|
import path from 'path';
|
|
|
|
|
2019-02-28 21:21:18 -08:00
|
|
|
export default function Test6502() {
|
2019-12-02 18:53:47 -08:00
|
|
|
var data = fs.readFileSync(path.join(__dirname, '6502_functional_test.bin'));
|
2013-10-10 11:03:07 -07:00
|
|
|
|
|
|
|
return {
|
|
|
|
start: function() {
|
|
|
|
return 0x00;
|
|
|
|
},
|
|
|
|
end: function() {
|
|
|
|
return 0xff;
|
|
|
|
},
|
|
|
|
read: function(page, off) {
|
2019-11-23 19:05:52 -08:00
|
|
|
return data[page << 8 | off];
|
2013-10-10 11:03:07 -07:00
|
|
|
},
|
|
|
|
write: function(page, off, val) {
|
2019-11-23 19:05:52 -08:00
|
|
|
data[page << 8 | off] = val;
|
2013-10-10 11:03:07 -07:00
|
|
|
}
|
2019-01-09 00:51:25 -08:00
|
|
|
};
|
2013-10-10 11:03:07 -07:00
|
|
|
}
|