|
|
@@ -349,12 +349,13 @@ export default class NESBank extends ISurface{ |
|
|
|
} |
|
|
|
|
|
|
|
get base64(){ |
|
|
|
var b = ""; |
|
|
|
var data = this.chr; |
|
|
|
for (var i = 0; i < data.length; i++) { |
|
|
|
b += String.fromCharCode(data[i]); |
|
|
|
} |
|
|
|
return window.btoa(b); |
|
|
|
return this.getBase64(this.__AccessMode, this.__AccessOffset); |
|
|
|
//var b = ""; |
|
|
|
//var data = this.chr; |
|
|
|
//for (var i = 0; i < data.length; i++) { |
|
|
|
// b += String.fromCharCode(data[i]); |
|
|
|
//} |
|
|
|
//return window.btoa(b); |
|
|
|
} |
|
|
|
|
|
|
|
set base64(s){ |
|
|
@@ -514,6 +515,15 @@ export default class NESBank extends ISurface{ |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getBase64(mode, offset){ |
|
|
|
var b = ""; |
|
|
|
var data = this.getCHR(mode, offset); |
|
|
|
for (var i = 0; i < data.length; i++) { |
|
|
|
b += String.fromCharCode(data[i]); |
|
|
|
} |
|
|
|
return window.btoa(b); |
|
|
|
} |
|
|
|
|
|
|
|
getCHR(mode, offset){ |
|
|
|
this.__emitsEnabled = false; |
|
|
|
var oam = this.access_mode; |
|
|
@@ -816,6 +826,14 @@ export default class NESBank extends ISurface{ |
|
|
|
comp(this.__RP, 256, ignoreTileZero); |
|
|
|
return this; |
|
|
|
} |
|
|
|
|
|
|
|
eq(b){ |
|
|
|
if (b instanceof NESBank){ |
|
|
|
if (this.getBase64(NESBank.ACCESSMODE_8K, 0) === b.getBase64(NESBank.ACCESSMODE_8K, 0)) |
|
|
|
return true; |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|