Browse Source

Fix dma update mask logic: 1 !== true

Pass consistent types
Ernest Wong 6 years ago
parent
commit
911ed0cc52
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/dma.js

+ 2 - 2
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)
         {