commit
acfc295b9b
|
@ -40,6 +40,7 @@
|
||||||
}, {
|
}, {
|
||||||
"files": [ "test/*"],
|
"files": [ "test/*"],
|
||||||
"env": {
|
"env": {
|
||||||
|
"node": true,
|
||||||
"jest": true
|
"jest": true
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
|
|
|
@ -9,7 +9,7 @@ jobs:
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [8.x, 10.x, 12.x]
|
node-version: [12.x]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
|
|
|
@ -79,45 +79,47 @@ export default function ACI(cpu, cb) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch (off) {
|
if (cpu.sync()) {
|
||||||
case 0x00:
|
switch (off) {
|
||||||
_recording = false;
|
case 0x00:
|
||||||
_beKind = true;
|
|
||||||
debug('Entering ACI CLI');
|
|
||||||
break;
|
|
||||||
case 0x63:
|
|
||||||
if (_recording) {
|
|
||||||
this.buffer.push(5000000);
|
|
||||||
_recording = false;
|
_recording = false;
|
||||||
}
|
_beKind = true;
|
||||||
debug('Exiting ACI CLI');
|
debug('Entering ACI CLI');
|
||||||
break;
|
break;
|
||||||
case 0x70: // WRITE
|
case 0x63:
|
||||||
_recording = true;
|
if (_recording) {
|
||||||
if (_beKind) {
|
this.buffer.push(5000000);
|
||||||
_beKind = false;
|
_recording = false;
|
||||||
this.buffer = [];
|
}
|
||||||
}
|
debug('Exiting ACI CLI');
|
||||||
debug('Start write');
|
break;
|
||||||
_last = now;
|
case 0x70: // WRITE
|
||||||
break;
|
_recording = true;
|
||||||
//case 0x7c: // WBITLOOP:
|
if (_beKind) {
|
||||||
// _debug = true;
|
_beKind = false;
|
||||||
// debug("Write bit loop");
|
this.buffer = [];
|
||||||
// break;
|
}
|
||||||
case 0x8d: // READ
|
debug('Start write');
|
||||||
_recording = false;
|
_last = now;
|
||||||
debug('Start read');
|
break;
|
||||||
if (_beKind) {
|
//case 0x7c: // WBITLOOP:
|
||||||
_readOffset = 0;
|
// _debug = true;
|
||||||
_next = now + 5000000;
|
// debug("Write bit loop");
|
||||||
_beKind = false;
|
// break;
|
||||||
|
case 0x8d: // READ
|
||||||
|
_recording = false;
|
||||||
|
debug('Start read');
|
||||||
|
if (_beKind) {
|
||||||
|
_readOffset = 0;
|
||||||
|
_next = now + 5000000;
|
||||||
|
_beKind = false;
|
||||||
|
|
||||||
cb.progress(0);
|
cb.progress(0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
557
js/cpu6502.js
557
js/cpu6502.js
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,48 @@
|
||||||
|
|
||||||
|
import CPU6502 from '../js/cpu6502';
|
||||||
|
import Test6502 from './roms/6502test';
|
||||||
|
import Test65C02 from './roms/65C02test';
|
||||||
|
|
||||||
|
import { toHex } from '../js/util';
|
||||||
|
|
||||||
|
describe.skip('CPU', function () {
|
||||||
|
var cpu;
|
||||||
|
var lastPC = 0;
|
||||||
|
var done = false;
|
||||||
|
|
||||||
|
function traceCB() {
|
||||||
|
var pc = cpu.getPC();
|
||||||
|
done = lastPC == pc;
|
||||||
|
lastPC = pc;
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('6502', function () {
|
||||||
|
it('completes the test ROM', function () {
|
||||||
|
cpu = new CPU6502();
|
||||||
|
var test = new Test6502();
|
||||||
|
cpu.addPageHandler(test);
|
||||||
|
cpu.setPC(0x400);
|
||||||
|
|
||||||
|
do {
|
||||||
|
cpu.stepCyclesDebug(1000, traceCB);
|
||||||
|
} while (!done);
|
||||||
|
|
||||||
|
expect(toHex(lastPC)).toEqual(toHex(0x3469));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('65C02', function () {
|
||||||
|
it('completes the test ROM', function () {
|
||||||
|
cpu = new CPU6502({'65C02': true});
|
||||||
|
var test = new Test65C02();
|
||||||
|
cpu.addPageHandler(test);
|
||||||
|
cpu.setPC(0x400);
|
||||||
|
|
||||||
|
do {
|
||||||
|
cpu.stepCyclesDebug(1000, traceCB);
|
||||||
|
} while (!done);
|
||||||
|
|
||||||
|
expect(toHex(lastPC)).toEqual(toHex(0x24f1));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue