Browse Source

Fixed some confusion in NESBank and CTRLBankTools dealing with palette and side of bank.

dev-bank
Bryan Miller 5 years ago
parent
commit
7ba0c5f533
2 changed files with 4 additions and 4 deletions
  1. +3
    -3
      app/js/ctrls/CTRLBankTools.js
  2. +1
    -1
      app/js/models/NESBank.js

+ 3
- 3
app/js/ctrls/CTRLBankTools.js View File

if (val !== LastVal){ if (val !== LastVal){
LastVal = val; LastVal = val;
if (val === "all"){ if (val === "all"){
SURF.access_mode = 2;
SURF.access_mode = NESBank.ACCESSMODE_FULL;
} else if (val === "sprites"){ } else if (val === "sprites"){
SURF.access_mode = 1;
SURF.access_mode = NESBank.ACCESSMODE_SPRITE;
GlobalEvents.emit("set_palette_mode", 1); GlobalEvents.emit("set_palette_mode", 1);
} else if (val === "tiles"){ } else if (val === "tiles"){
SURF.access_mode = 0;
SURF.access_mode = NESBank.ACCESSMODE_BACKGROUND;
GlobalEvents.emit("set_palette_mode", 0); GlobalEvents.emit("set_palette_mode", 0);
} }
} }

+ 1
- 1
app/js/models/NESBank.js View File



var res = LRIdx2TileIdxCo((y*this.width)+x, this.__AccessMode); var res = LRIdx2TileIdxCo((y*this.width)+x, this.__AccessMode);
var list = (res.lid === 0) ? this.__LP : this.__RP; var list = (res.lid === 0) ? this.__LP : this.__RP;
var pi = list[res.index].paletteIndex;
var pi = list[res.index].paletteIndex + ((res.lid === 0) ? 4 : 0);
var ci = list[res.index].getPixelIndex(res.x, res.y); var ci = list[res.index].getPixelIndex(res.x, res.y);


if (this.__palette !== null){ if (this.__palette !== null){

Loading…
Cancel
Save