diff --git a/README.md b/README.md index f02fe6b..f1e780a 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,12 @@ This tool can build the data necessary to flash new games to a [Nintendo Power G - Early GameBoy Font: https://www.dafont.com/early-gameboy.font - Nokia Cellphone FC Font: https://www.dafont.com/nokia-cellphone.font - Gamer Font: https://www.dafont.com/gamer-2.font +- Pokemon Classic Font: https://www.dafont.com/pokemon-classic.font ## Ideas +- Upload multiple games at once - Move more templating into components -- Add ability to upload arbitrary 96x8 images for menu entries +- Add ability to upload arbitrary 128x8 images for menu entries - Save settings to local storage - A setting to change scrolling ticker text -- Other romhacks to the menu? +- Upload custom background iamge diff --git a/font/Pokemon.woff b/font/Pokemon.woff new file mode 100644 index 0000000..ccf0cf9 Binary files /dev/null and b/font/Pokemon.woff differ diff --git a/index.html b/index.html index aa45340..9ccdece 100644 --- a/index.html +++ b/index.html @@ -111,16 +111,19 @@ Menu Font: - + - + + + +
diff --git a/script/app.js b/script/app.js index da50c47..7a102c1 100644 --- a/script/app.js +++ b/script/app.js @@ -100,12 +100,12 @@ Vue.component('bitmap-preview', { renderCanvas: function() { let canvas = this.$refs.canvas; const ctx = canvas.getContext('2d'); - ctx.putImageData(new ImageData(this.data, 96, 8), 0, 0); + ctx.putImageData(new ImageData(this.data, 128, 8), 0, 0); ctx.imageSmoothingEnabled = false; ctx.scale(2, 2); ctx.drawImage(ctx.canvas, 0, 0); ctx.setTransform(1, 0, 0, 1, 0, 0); } }, - template: '' + template: '' }); diff --git a/script/gbnp.js b/script/gbnp.js index 0f67361..940055e 100644 --- a/script/gbnp.js +++ b/script/gbnp.js @@ -14,10 +14,11 @@ const BITMAP_PREVIEW_BYTES = [ [0x00, 0x00, 0x00, 0xFF] // black ] const FONTS = [ - { style: 'normal 16px Pixeltype', y: 7 }, { style: 'normal 8px Gameboy', y: 7 }, + { style: 'normal 16px Pixeltype', y: 7 }, { style: 'normal 8px Nokia', y: 7 }, - { style: 'normal 16px Gamer', y: 7 } + { style: 'normal 16px Gamer', y: 7 }, + { style: 'normal 8px Pokemon', y: 7 }, ] class Menu { @@ -121,16 +122,19 @@ class ROM { const canvas = document.createElement("canvas"); canvas.height = 8; - canvas.width = 96; + canvas.width = 128; const ctx = canvas.getContext('2d'); ctx.imageSmoothingEnabled = false; ctx.fillStyle = 'white'; - ctx.fillRect(0, 0, 96, 8); + ctx.fillRect(0, 0, 128, 8); const font = FONTS[fontIndex || 0]; ctx.font = font.style; ctx.fillStyle = 'black'; ctx.fillText(this.menuText,1,font.y); - const imageData = ctx.getImageData(0, 0, 96, 8).data; + ctx.fillStyle = 'white'; + ctx.fillRect(127, 0, 127, 8); + + const imageData = ctx.getImageData(0, 0, 128, 8).data; for (let i = 0; i < imageData.length; i+=16){ let byte = 0; @@ -144,8 +148,8 @@ class ROM { } let outputBuffer = [] - for (let h = 0; h < 24; h+=2) { - for (let i = h; i < 192; i+=24) { + for (let h = 0; h < 32; h+=2) { + for (let i = h; i < 256; i+=32) { let a = buffer[i] let b = buffer[i+1] @@ -347,8 +351,6 @@ class Processor { // title bitmap romFile.writeBytes(rom.bitmapBuffer); - rom.bitmapBuffer - romFileIndex += 512 } diff --git a/style.css b/style.css index de3b79c..047e68c 100644 --- a/style.css +++ b/style.css @@ -26,6 +26,13 @@ font-style: normal; } +@font-face { + font-family: "Pokemon"; + src: url("./font/Pokemon.woff") format("woff"); + font-weight: normal; + font-style: normal; +} + html { font-family: sans-serif; line-height: 1.4; @@ -175,13 +182,19 @@ label#nokia { } label#gamer { - font-family: Gamer; + font-family: 'Gamer'; font-size: 32px; line-height: 0; position: relative; top: -2px; } +label#pokemon { + font-family: 'Pokemon'; + position: relative; + top: -2px; +} + noscript { font-weight: bold; color: red;