Browse Source

Fixed coloring issues in NESNameTable

dev
Bryan Miller 5 years ago
parent
commit
8cd99f0bad
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      app/js/models/NESNameTable.js

+ 3
- 3
app/js/models/NESNameTable.js View File

var blockY = Math.floor(y / 32); var blockY = Math.floor(y / 32);
bp.bindex = (blockY * 8) + blockX; bp.bindex = (blockY * 8) + blockX;


var palX = Math.floor(x % 16);
var palY = Math.floor(y % 16);
bp.pindex = ((palX < 8) ? 0 : 1) + ((palY >= 8) ? 2 : 0);
var palX = Math.floor(x % 32);
var palY = Math.floor(y % 32);
bp.pindex = ((palX < 16) ? 0 : 1) + ((palY >= 16) ? 2 : 0);


return bp; return bp;
} }

Loading…
Cancel
Save