1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-11-22 14:33:51 +00:00

fixed keyboard flags

This commit is contained in:
Steven Hugg 2018-12-09 10:11:14 -05:00
parent 8cb1338364
commit c654647b6d
2 changed files with 3 additions and 2 deletions

View File

@ -423,7 +423,8 @@ export function setKeyboardFromMap(video, switches, map, func?) {
var mask = o.mask;
if (mask < 0) { // negative mask == active low
mask = -mask;
flags ^= KeyFlags.KeyDown;
if (flags & (KeyFlags.KeyDown | KeyFlags.KeyUp))
flags ^= KeyFlags.KeyDown | KeyFlags.KeyUp;
}
if (flags & KeyFlags.KeyDown) {
switches[o.index] |= mask;

View File

@ -161,7 +161,7 @@ describe('Platform Replay', () => {
it('Should run apple2', () => {
var platform = testPlatform('apple2', 'cosmic.c.rom', 72, (platform, frameno) => {
if (frameno == 62) {
keycallback(32, 32, 1); // space bar
keycallback(32, 32, 128); // space bar
}
});
assert.equal(platform.saveState().kbd, 0x20); // strobe cleared