Clean up ig rom hack a bit, disable map download when selected

This commit is contained in:
Evan Barger
2020-05-23 22:28:09 -04:00
parent 9a78a1217d
commit d5de2f58b5
3 changed files with 81 additions and 73 deletions

View File

@@ -81,13 +81,15 @@ let app = new Vue({
downloadEnabled: function() {
return this.menu.present() && !this.romOverflow;
},
mapEnabled: function() {
return this.cartType == 0;
},
romOverflow: function() { return this.processor.romOverflow(); }
},
watch: {
fontIndex: function() {
for (let i = 0; i < this.roms.length; i++) { this.roms[i].updateBitmap(this.fontIndex); }
},
disableCGB: function() { this.processor.disableCGB = this.disableCGB; },
forceDMG: function() { this.processor.forceDMG = this.forceDMG; },
cartType: function() { this.processor.cartType = this.cartType; }
},
@@ -137,8 +139,10 @@ let app = new Vue({
this.processor.roms = this.roms;
},
downloadMapFile: function(e) {
if (this.mapData) { URL.revokeObjectURL(this.mapData) }
this.mapData = URL.createObjectURL(new Blob([this.processor.mapData()]));
if (this.cartType == 0) { // regular power cart only
if (this.mapData) { URL.revokeObjectURL(this.mapData) }
this.mapData = URL.createObjectURL(new Blob([this.processor.mapData()]));
}
},
downloadRomFile: function(e) {
if (this.romData) { URL.revokeObjectURL(this.romData) }