Force GAMER font to always be uppercase, use padded rom size in table

This commit is contained in:
Evan Barger
2020-08-31 22:05:16 -04:00
parent b8bc5385c5
commit 7b728b9cef
2 changed files with 14 additions and 6 deletions

View File

@@ -57,7 +57,7 @@
<td>{{ rom.title }}</td>
<td>{{ rom.type }}</td>
<td>{{ rom.romSizeKB() + 'k'}}</td>
<td>{{ rom.ramSizeKB() + 'k' }}</td>
<td>{{ rom.paddedRamSizeKB() + 'k' }}</td>
<td>{{ rom.paddedRomSizeKB() / 128 + ' (' + rom.paddedRomSizeKB() + 'k)'}}</td>
<td>
<input type="text" class='menu-text' :value="rom.menuText" @input="e => updateMenuText(rom, e.target.value)"/>
@@ -137,7 +137,7 @@
<label for="font2" id="nokia" class="radio-label">Nokia</label>
<input type="radio" id="font3" name="font" value="3" v-model="fontIndex">
<label for="font3" id="gamer" class="radio-label">Gamer</label>
<label for="font3" id="gamer" class="radio-label">GAMER</label>
</div>
<ticker-settings :processor="processor" :font-index="fontIndex" :fonts-loaded="fontsLoaded"></ticker-settings>

View File

@@ -118,7 +118,7 @@ class ROM {
paddedRamSizeKB() {
if (this.typeByte === 0x06) { return 8; }
return Math.min(32, this.ramSizeKB());
return this.ramSizeKB();
}
isMenu() {
@@ -143,7 +143,12 @@ class ROM {
const font = FONTS[fontIndex || 0];
ctx.font = font.style;
ctx.fillStyle = 'black';
ctx.fillText(this.menuText,1,font.y);
let text = this.menuText;
if (fontIndex == 3) {
text = text.toUpperCase();
}
ctx.fillText(text,1,font.y);
ctx.fillStyle = 'white';
ctx.fillRect(127, 0, 127, 8);
@@ -226,7 +231,7 @@ class Processor {
ramUsedKB() {
return this.roms.reduce((total, rom) => {
return total += rom.ramSizeKB();
return total += rom.paddedRamSizeKB();
}, 0);
}
@@ -513,7 +518,10 @@ class TickerText {
generate() {
let buffer = [];
const canvas = this.canvas;
const text = this.text;
let text = this.text;
if (this.fontIndex == 3) {
text = text.toUpperCase();
}
const font = FONTS[this.fontIndex].style;
const ctx = canvas.getContext('2d');