From 911ed0cc52c5be26573902f2d5a3d59d8970d9c9 Mon Sep 17 00:00:00 2001 From: Ernest Wong Date: Sun, 18 Feb 2018 12:01:00 +1300 Subject: [PATCH] Fix dma update mask logic: 1 !== true Pass consistent types --- src/dma.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dma.js b/src/dma.js index e0029e65..4283bded 100644 --- a/src/dma.js +++ b/src/dma.js @@ -197,7 +197,7 @@ DMA.prototype.port_page_read = function(channel) DMA.prototype.port_singlemask_write = function(channel_offset, data_byte) { var channel = (data_byte & 0x3) + channel_offset; - var value = !!(data_byte & 0x4); + var value = data_byte & 0x4 ? 1 : 0; dbg_log("singlechannel mask write [" + channel + "] = " + value, LOG_DMA); this.update_mask(channel, value); }; @@ -247,7 +247,7 @@ DMA.prototype.update_mask = function(channel, value) { if(this.channel_mask[channel] !== value) { - this.channel_mask[channel] ^= 1; + this.channel_mask[channel] = value; if(!value) {