This commit is contained in:
Will Scullin 2019-10-07 22:18:15 -07:00
parent 3b95726655
commit e2c615f20b
No known key found for this signature in database
GPG Key ID: 9092A5C0A673416B
2 changed files with 5 additions and 3 deletions

View File

@ -616,7 +616,7 @@ export default function CPU6502(options)
function rol(readAddrFn) {
var addr = readAddrFn({rwm: true});
var oldVal = readByte(addr);
writeByte(oldVal);
writeByte(addr, oldVal);
var val = rotateLeft(oldVal);
writeByte(addr, val);
}

View File

@ -3,6 +3,8 @@ import CPU6502 from '../js/cpu6502';
import Test6502 from '../js/roms/6502test';
import Test65C02 from '../js/roms/65C02test';
import { toHex } from '../js/util';
describe('CPU', function () {
var cpu;
var lastPC = 0;
@ -25,7 +27,7 @@ describe('CPU', function () {
cpu.stepCyclesDebug(1000, traceCB);
} while (!done);
expect(lastPC).toEqual(0x3469);
expect(toHex(lastPC)).toEqual(toHex(0x3469));
});
});
@ -40,7 +42,7 @@ describe('CPU', function () {
cpu.stepCyclesDebug(1000, traceCB);
} while (!done);
expect(lastPC).toEqual(0x24f1);
expect(toHex(lastPC)).toEqual(toHex(0x24f1));
});
});
});