Skip to content

Commit

Permalink
Eslint upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
denislins committed Sep 7, 2019
1 parent 91ce92c commit acde9c6
Show file tree
Hide file tree
Showing 8 changed files with 360 additions and 2,018 deletions.
1 change: 0 additions & 1 deletion emulator/Emulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export default class Emulator {
}

window.requestAnimationFrame(() => this.refreshDisplay());

}

refreshDisplay() {
Expand Down
5 changes: 1 addition & 4 deletions emulator/apu/Apu.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ export default class Apu {
}

generateSamples() {
const samples = this.channels.map((channel) => {
return channel.generateSample();
});

const samples = this.channels.map(channel => channel.generateSample());
this.player.addSamples(samples);
}
}
2 changes: 1 addition & 1 deletion emulator/apu/channels/SquareChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default class SquareChannel {
}

generateSample() {
if (this.registers.isChannelEnabled() && this.registers.isDacEnabled() && this.isDutyCycleActive()) {
if (this.registers.isChannelEnabled() && this.isDutyCycleActive()) {
return this.volume / 45;
} else {
return 0;
Expand Down
9 changes: 4 additions & 5 deletions emulator/apu/channels/registers/SquareChannelRegisters.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@ export default class SquareChannelRegisters {
}

isChannelEnabled() {
return this.read(4) & 0x80;
const isChannelEnabled = this.read(4) & 0x80;
const isDacEnabled = this.read(2) & 0xF8;

return isChannelEnabled && isDacEnabled;
}

getVolume() {
return this.read(2) >> 4;
}

isDacEnabled() {
return this.read(2) & 0xF8;
}

getActiveDutyCycle() {
return this.read(1) >> 6;
}
Expand Down
3 changes: 3 additions & 0 deletions emulator/gpu/renderers/SpriteRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export default class SpriteRenderer extends AbstractRenderer {
return sprite;
}
}

return undefined;
});
}

Expand All @@ -41,6 +43,7 @@ export default class SpriteRenderer extends AbstractRenderer {
const { tileNumber } = sprite;
const spriteHeight = this.spriteManager.getSpriteHeight();

// eslint-disable-next-line no-param-reassign
sprite.color = this.calculatePixelColor(tileNumber, spriteRow, spriteColumn, spriteHeight);
}

Expand Down
2 changes: 1 addition & 1 deletion emulator/mmu/registers/MemoryRegisterSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import TimerControllerRegister from './timer/TimerControllerRegister.js';
import TimerDividerRegister from './timer/TimerDividerRegister.js';
import InterruptRequestRegister from './interrupts/InterruptRequestRegister.js';
import InterruptEnabledRegister from './interrupts/InterruptEnabledRegister.js';
import TestRegister from './sound/TestRegister.js';
// import TestRegister from './sound/TestRegister.js';

export default class MemoryRegisterSet {
constructor(mmu) {
Expand Down
Loading

0 comments on commit acde9c6

Please sign in to comment.