Add spreadsheet link, add drop support to table

This commit is contained in:
Evan Barger 2020-08-04 20:54:06 -04:00
parent 4b16d9fd51
commit a22f596654
2 changed files with 9 additions and 8 deletions

View File

@ -22,6 +22,7 @@
<h1><img src="img/gbnp.png" alt="GBNP logo" title="GAME BOY Nintendo Power ROM Builder" width="250"/></h1>
<div class='text-container'>
This tool can build the data necessary to flash new games to a <a href="https://en.wikipedia.org/wiki/Nintendo_Power_(cartridge)">Nintendo Power Game Boy cart</a>, as well as the <a href="https://shop.insidegadgets.com/product/gameboy-1mb-128kb-sram-power-cart-multi-game-and-multi-save/">insideGadgets Power Cart</a>. The menu can have up to seven roms, or a total of 896KB of game data. For flashing, I recommend the <a href="https://www.gbxcart.com/">GBxCart</a>.
Not sure what to flash? Check out <a href="https://docs.google.com/spreadsheets/d/18bsOfyVKd7yQ7xBVLJqYLEZPr3ER0pNvLKVGWvP8l7M/edit?usp=sharing">this spreadsheet</a> for some great games that fit!
</div>
<noscript>
Looks like you have JS disabled. This tool needs javascript to function!
@ -29,7 +30,7 @@
<div id="app">
<h2>1. Add Game ROMs</h2>
<section>
<table v-if="roms.length > 0">
<table v-if="roms.length > 0" v-on:dragover="preventDefault" v-on:drop="dropFile">
<thead>
<tr>
<th>

View File

@ -86,9 +86,9 @@ class ROM {
paddedFile.writeBytes(file.read(file.size()));
}
if (!this.valid()) { alert('File is not a valid Game Boy ROM!'); this.bad = true; }
else if (!this.type) { alert(`Error with ${this.title}!\nCartridge type could not be determined!`); this.bad = true; }
else if (this.ramSizeKB() > 32) { alert(`Error with ${this.title}!\nGame requires more than 32 KB of RAM!`); this.bad = true; }
if (!this.valid()) { alert('File is not a valid Game Boy ROM!'); this.bad = true; }
else if (!this.type) { alert(`Error with ${this.title}!\nCartridge type could not be determined!`); this.bad = true; }
else if (this.ramSizeKB() > 32) { alert(`Error with ${this.title}!\nGame requires more than 32 KB of RAM!`); this.bad = true; }
}
valid() {
@ -116,9 +116,9 @@ class ROM {
return Math.trunc(Math.pow(4, this.ramByte - 1)) * 2;
}
utilizedRamSizeKB() {
paddedRamSizeKB() {
if (this.typeByte === 0x06) { return 8; }
return this.ramSizeKB();
return Math.min(32, this.ramSizeKB());
}
isMenu() {
@ -372,8 +372,8 @@ class Processor {
romFile.writeByte(0);
// sram "block BBBBBB" flags
romFile.writeByte(rom.utilizedRamSizeKB() > 0 ? 1 : 0); // true if 8 used
romFile.writeByte(rom.utilizedRamSizeKB() > 8 ? 1 : 0); // true if 32 used
romFile.writeByte(rom.paddedRamSizeKB() > 0 ? 1 : 0); // true if 8 used
romFile.writeByte(rom.paddedRamSizeKB() > 8 ? 1 : 0); // true if 32 used
romFile.seek(romFileIndex + 63);