mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-11-25 18:33:11 +00:00
fixed keyboard flags
This commit is contained in:
parent
8cb1338364
commit
c654647b6d
@ -423,7 +423,8 @@ export function setKeyboardFromMap(video, switches, map, func?) {
|
|||||||
var mask = o.mask;
|
var mask = o.mask;
|
||||||
if (mask < 0) { // negative mask == active low
|
if (mask < 0) { // negative mask == active low
|
||||||
mask = -mask;
|
mask = -mask;
|
||||||
flags ^= KeyFlags.KeyDown;
|
if (flags & (KeyFlags.KeyDown | KeyFlags.KeyUp))
|
||||||
|
flags ^= KeyFlags.KeyDown | KeyFlags.KeyUp;
|
||||||
}
|
}
|
||||||
if (flags & KeyFlags.KeyDown) {
|
if (flags & KeyFlags.KeyDown) {
|
||||||
switches[o.index] |= mask;
|
switches[o.index] |= mask;
|
||||||
|
@ -161,7 +161,7 @@ describe('Platform Replay', () => {
|
|||||||
it('Should run apple2', () => {
|
it('Should run apple2', () => {
|
||||||
var platform = testPlatform('apple2', 'cosmic.c.rom', 72, (platform, frameno) => {
|
var platform = testPlatform('apple2', 'cosmic.c.rom', 72, (platform, frameno) => {
|
||||||
if (frameno == 62) {
|
if (frameno == 62) {
|
||||||
keycallback(32, 32, 1); // space bar
|
keycallback(32, 32, 128); // space bar
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
assert.equal(platform.saveState().kbd, 0x20); // strobe cleared
|
assert.equal(platform.saveState().kbd, 0x20); // strobe cleared
|
||||||
|
Loading…
Reference in New Issue
Block a user