@moonbase-machines/charset 0.0.0-stage → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +7 -2
- package/chargen.js +93 -0
- package/dist/moonbase-charset.js +3 -0
- package/dist/moonbase-charset.js.map +7 -0
- package/font.js +16 -0
- package/index.js +5 -0
- package/package.json +10 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mark Wharton
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @moonbase-machines/charset
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Moonbase's own character set for the Commodore 64, drawn in the 64's geometry, and the 5 by 7 dot
|
|
4
|
+
font it and the Apple IIe's text screen are built from. Commodore's and Apple's character ROMs are
|
|
5
|
+
their own and are not here.
|
|
6
|
+
|
|
7
|
+
Part of Moonbase (moonbase.au): Mark Wharton's titles of 1985 to 1995, running again in the browser
|
|
8
|
+
on these machines. MIT; see LICENSE. Each file opens with what it is and what it covers.
|
package/chargen.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// moonbase's own characters for the Commodore 64's character ROM, apart from @moonbase-machines/c64/rom.js
|
|
2
|
+
// so that a page needing only the characters (a PET's screen) loads only them.
|
|
3
|
+
//
|
|
4
|
+
// chargen() the character ROM's 4K: the two sets, each 128 characters and their reverse
|
|
5
|
+
import { FONT } from './font.js';
|
|
6
|
+
|
|
7
|
+
// The two character sets, as the character ROM holds them, 8 bytes a character, from the font:
|
|
8
|
+
// the first upper case and graphics, the second lower and upper case, each 128 characters by
|
|
9
|
+
// screen code and the same 128 reversed after them. A glyph's five columns go one dot in from the
|
|
10
|
+
// left, its seven rows from the top. The graphics, and £, ↑ and ←, are moonbase's own, drawn
|
|
11
|
+
// below: each a symbol at the place the C64 keeps it, so a game's boxes, shading and card suits
|
|
12
|
+
// show, the lines and blocks where a line or a block must lie, the rest in moonbase's hand. The
|
|
13
|
+
// second set has the first's graphics at the same places, but for four of its own.
|
|
14
|
+
const GRAPHICS = (() => {
|
|
15
|
+
const rows = (...r) => r.map(t => parseInt(t.replace(/\./g, '0').replace(/#/g, '1'), 2));
|
|
16
|
+
const fill = (top, bottom, left, right) => [...Array(8).keys()].map(y => y >= top && y <= bottom ? (0xff >> left) & (0xff << (7 - right)) & 0xff : 0);
|
|
17
|
+
const or = (...gs) => gs[0].map((_, y) => gs.reduce((v, g) => v | g[y], 0));
|
|
18
|
+
const across = (top, bottom) => fill(top, bottom, 0, 7), down = (left, right) => fill(0, 7, left, right);
|
|
19
|
+
const centre = { up: fill(0, 4, 3, 4), down: fill(3, 7, 3, 4), left: fill(3, 4, 0, 4), right: fill(3, 4, 3, 7) };
|
|
20
|
+
const join = (...arms) => or(...arms.map(a => centre[a]));
|
|
21
|
+
const checker = (phase, top = 0, bottom = 7, left = 0, right = 7) => [...Array(8).keys()].map(y => y < top || y > bottom ? 0 : ((y >> 1) + phase) & 1 ? 0x33 & (0xff >> left) & (0xff << (7 - right)) & 0xff : 0xcc & (0xff >> left) & (0xff << (7 - right)) & 0xff);
|
|
22
|
+
return {
|
|
23
|
+
// the first set's, by screen code
|
|
24
|
+
first: {
|
|
25
|
+
0x40: across(3, 4), 0x43: across(3, 4), 0x44: across(2, 3), 0x45: across(1, 2), 0x46: across(4, 5), 0x52: across(5, 6),
|
|
26
|
+
0x42: down(3, 4), 0x5d: down(3, 4), 0x47: down(2, 3), 0x48: down(4, 5), 0x54: down(1, 2), 0x59: down(5, 6),
|
|
27
|
+
0x41: rows('...##...', '..####..', '.######.', '########', '########', '##.##.##', '...##...', '..####..'), // spade
|
|
28
|
+
0x53: rows('.##..##.', '########', '########', '########', '.######.', '..####..', '...##...', '........'), // heart
|
|
29
|
+
0x58: rows('..####..', '..####..', '##.##.##', '########', '########', '##.##.##', '...##...', '..####..'), // club
|
|
30
|
+
0x5a: rows('...##...', '..####..', '.######.', '########', '.######.', '..####..', '...##...', '........'), // diamond
|
|
31
|
+
0x51: rows('........', '..####..', '.######.', '.######.', '.######.', '.######.', '..####..', '........'), // a disc
|
|
32
|
+
0x57: rows('........', '..####..', '.######.', '.##..##.', '.##..##.', '.######.', '..####..', '........'), // a ring
|
|
33
|
+
0x5e: rows('........', '........', '#######.', '.##.##..', '.##.##..', '.##.##..', '.##..##.', '........'), // pi
|
|
34
|
+
// rounded corners, the diagonals, the cross, the disc and the ring: drawn as Commodore's, so
|
|
35
|
+
// PETSCII pictures, which lean on them, come out as they were made
|
|
36
|
+
0x55: rows('........', '........', '........', '.....###', '....####', '...###..', '...##...', '...##...'),
|
|
37
|
+
0x49: rows('........', '........', '........', '###.....', '####....', '..###...', '...##...', '...##...'),
|
|
38
|
+
0x4a: rows('...##...', '...##...', '...###..', '....####', '.....###', '........', '........', '........'),
|
|
39
|
+
0x4b: rows('...##...', '...##...', '..###...', '####....', '###.....', '........', '........', '........'),
|
|
40
|
+
0x4d: rows('##......', '###.....', '.###....', '..###...', '...###..', '....###.', '.....###', '......##'),
|
|
41
|
+
0x4e: rows('......##', '.....###', '....###.', '...###..', '..###...', '.###....', '###.....', '##......'),
|
|
42
|
+
0x56: rows('##....##', '###..###', '.######.', '..####..', '..####..', '.######.', '###..###', '##....##'),
|
|
43
|
+
// the cell's edges, and corners on them
|
|
44
|
+
0x63: across(0, 0), 0x64: across(7, 7), 0x65: down(0, 1), 0x74: down(0, 1), 0x67: down(6, 7), 0x6a: down(6, 7),
|
|
45
|
+
0x4c: or(down(0, 1), across(6, 7)), 0x4f: or(across(0, 1), down(0, 1)), 0x50: or(across(0, 1), down(6, 7)), 0x7a: or(down(6, 7), across(6, 7)),
|
|
46
|
+
// box lines through the middle: corners, T-junctions and the cross
|
|
47
|
+
0x6b: join('up', 'down', 'right'), 0x73: join('up', 'down', 'left'), 0x71: join('up', 'left', 'right'), 0x72: join('down', 'left', 'right'), 0x5b: join('up', 'down', 'left', 'right'),
|
|
48
|
+
0x6d: join('up', 'right'), 0x7d: join('up', 'left'), 0x70: join('down', 'right'), 0x6e: join('down', 'left'),
|
|
49
|
+
// blocks, by halves, thirds and quarters, and the quadrants
|
|
50
|
+
0x61: fill(0, 7, 0, 3), 0x62: fill(4, 7, 0, 7), 0x6f: fill(6, 7, 0, 7), 0x77: fill(0, 1, 0, 7), 0x78: fill(0, 2, 0, 7), 0x79: fill(5, 7, 0, 7),
|
|
51
|
+
0x75: fill(0, 7, 0, 2), 0x76: fill(0, 7, 5, 7),
|
|
52
|
+
0x7e: fill(0, 3, 0, 3), 0x7c: fill(0, 3, 4, 7), 0x7b: fill(4, 7, 0, 3), 0x6c: fill(4, 7, 4, 7), 0x7f: or(fill(0, 3, 0, 3), fill(4, 7, 4, 7)),
|
|
53
|
+
// shading, and the triangles
|
|
54
|
+
0x66: checker(0), 0x5c: checker(0, 0, 7, 0, 3), 0x68: checker(0, 4, 7),
|
|
55
|
+
0x5f: [...Array(8).keys()].map(y => 0xff >> y), 0x69: [...Array(8).keys()].map(y => (0xff << y) & 0xff),
|
|
56
|
+
},
|
|
57
|
+
// the second set's own, where it does not have the first's: the shading the other way about,
|
|
58
|
+
// stripes each way, and a tick
|
|
59
|
+
second: {
|
|
60
|
+
0x5e: checker(1),
|
|
61
|
+
0x5f: rows('..##..##', '#..##..#', '##..##..', '.##..##.', '..##..##', '#..##..#', '##..##..', '.##..##.'),
|
|
62
|
+
0x69: rows('##..##..', '#..##..#', '..##..##', '.##..##.', '##..##..', '#..##..#', '..##..##', '.##..##.'),
|
|
63
|
+
0x7a: rows('........', '......##', '.....##.', '....##..', '##.##...', '.###....', '..#.....', '........'),
|
|
64
|
+
},
|
|
65
|
+
// £, ↑ and ←, in both
|
|
66
|
+
signs: {
|
|
67
|
+
0x1c: rows('...###..', '..##..#.', '..##....', '######..', '..##....', '.##...#.', '#######.', '........'),
|
|
68
|
+
0x1e: rows('...##...', '..####..', '.######.', '...##...', '...##...', '...##...', '...##...', '........'),
|
|
69
|
+
0x1f: rows('........', '..##....', '.##.....', '#######.', '.##.....', '..##....', '........', '........'),
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
})();
|
|
73
|
+
export function chargen() {
|
|
74
|
+
const out = new Uint8Array(0x1000);
|
|
75
|
+
const glyph = (ascii, at) => {
|
|
76
|
+
const g = FONT[ascii - 0x20]; if (!g) return;
|
|
77
|
+
for (let row = 0; row < 7; row++) { let bits = 0; for (let col = 0; col < 5; col++) if (g[col] >> row & 1) bits |= 0x40 >> col; out[at + row] = bits; }
|
|
78
|
+
};
|
|
79
|
+
const OTHERS = { 0x00: 0x40, 0x1b: 0x5b, 0x1c: 0x23, 0x1d: 0x5d, 0x1e: 0x5e, 0x1f: 0x3c }; // @ [ £ ] ↑ ←
|
|
80
|
+
for (const set of [0, 1]) {
|
|
81
|
+
const base = set * 0x800;
|
|
82
|
+
for (let code = 0; code < 64; code++) {
|
|
83
|
+
const ascii = code >= 0x20 ? code : code >= 1 && code <= 26 ? (set ? 0x60 : 0x40) + code : OTHERS[code];
|
|
84
|
+
glyph(ascii, base + code * 8);
|
|
85
|
+
}
|
|
86
|
+
if (set) for (let code = 0x41; code <= 0x5a; code++) glyph(code, base + code * 8); // the second set's capitals
|
|
87
|
+
for (const [code, g] of Object.entries(GRAPHICS.signs)) out.set(g, base + code * 8);
|
|
88
|
+
for (const [code, g] of Object.entries(GRAPHICS.first)) if (!set || !(code >= 0x41 && code <= 0x5a)) out.set(g, base + code * 8);
|
|
89
|
+
if (set) for (const [code, g] of Object.entries(GRAPHICS.second)) out.set(g, base + code * 8);
|
|
90
|
+
for (let i = 0; i < 0x400; i++) out[base + 0x400 + i] = out[base + i] ^ 0xff; // reversed
|
|
91
|
+
}
|
|
92
|
+
return out;
|
|
93
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! @moonbase-machines/charset 0.4.1: MIT, (c) 2026 Mark Wharton (its LICENSE) */
|
|
2
|
+
var h=Object.defineProperty;var b=(f,e)=>{for(var s in e)h(f,s,{get:e[s],enumerable:!0})};var w={};b(w,{chargen:()=>y});var m={};b(m,{FONT:()=>g});var g=[[0,0,0,0,0],[0,0,95,0,0],[0,7,0,7,0],[20,127,20,127,20],[36,42,127,42,18],[35,19,8,100,98],[54,73,85,34,80],[0,5,3,0,0],[0,28,34,65,0],[0,65,34,28,0],[20,8,62,8,20],[8,8,62,8,8],[0,80,48,0,0],[8,8,8,8,8],[0,96,96,0,0],[32,16,8,4,2],[62,81,73,69,62],[0,66,127,64,0],[66,97,81,73,70],[33,65,69,75,49],[24,20,18,127,16],[39,69,69,69,57],[60,74,73,73,48],[1,113,9,5,3],[54,73,73,73,54],[6,73,73,41,30],[0,54,54,0,0],[0,86,54,0,0],[8,20,34,65,0],[20,20,20,20,20],[0,65,34,20,8],[2,1,81,9,6],[50,73,121,65,62],[126,17,17,17,126],[127,73,73,73,54],[62,65,65,65,34],[127,65,65,34,28],[127,73,73,73,65],[127,9,9,9,1],[62,65,73,73,122],[127,8,8,8,127],[0,65,127,65,0],[32,64,65,63,1],[127,8,20,34,65],[127,64,64,64,64],[127,2,12,2,127],[127,4,8,16,127],[62,65,65,65,62],[127,9,9,9,6],[62,65,81,33,94],[127,9,25,41,70],[70,73,73,73,49],[1,1,127,1,1],[63,64,64,64,63],[31,32,64,32,31],[63,64,56,64,63],[99,20,8,20,99],[7,8,112,8,7],[97,81,73,69,67],[0,127,65,65,0],[2,4,8,16,32],[0,65,65,127,0],[4,2,1,2,4],[64,64,64,64,64],[0,1,2,4,0],[32,84,84,84,120],[127,72,68,68,56],[56,68,68,68,32],[56,68,68,72,127],[56,84,84,84,24],[8,126,9,1,2],[12,82,82,82,62],[127,8,4,4,120],[0,68,125,64,0],[32,64,68,61,0],[127,16,40,68,0],[0,65,127,64,0],[124,4,24,4,120],[124,8,4,4,120],[56,68,68,68,56],[124,20,20,20,8],[8,20,20,24,124],[124,8,4,4,8],[72,84,84,84,32],[4,63,68,64,32],[60,64,64,32,124],[28,32,64,32,28],[60,64,48,64,60],[68,40,16,40,68],[12,80,80,80,60],[68,100,84,76,68],[0,8,54,65,0],[0,0,127,0,0],[0,65,54,8,0],[8,4,8,16,8]];var u=(()=>{let f=(...o)=>o.map(n=>parseInt(n.replace(/\./g,"0").replace(/#/g,"1"),2)),e=(o,n,p,d)=>[...Array(8).keys()].map(i=>i>=o&&i<=n?255>>p&255<<7-d&255:0),s=(...o)=>o[0].map((n,p)=>o.reduce((d,i)=>d|i[p],0)),r=(o,n)=>e(o,n,0,7),c=(o,n)=>e(0,7,o,n),x={up:e(0,4,3,4),down:e(3,7,3,4),left:e(3,4,0,4),right:e(3,4,3,7)},t=(...o)=>s(...o.map(n=>x[n])),a=(o,n=0,p=7,d=0,i=7)=>[...Array(8).keys()].map(l=>l<n||l>p?0:(l>>1)+o&1?51&255>>d&255<<7-i&255:204&255>>d&255<<7-i&255);return{first:{64:r(3,4),67:r(3,4),68:r(2,3),69:r(1,2),70:r(4,5),82:r(5,6),66:c(3,4),93:c(3,4),71:c(2,3),72:c(4,5),84:c(1,2),89:c(5,6),65:f("...##...","..####..",".######.","########","########","##.##.##","...##...","..####.."),83:f(".##..##.","########","########","########",".######.","..####..","...##...","........"),88:f("..####..","..####..","##.##.##","########","########","##.##.##","...##...","..####.."),90:f("...##...","..####..",".######.","########",".######.","..####..","...##...","........"),81:f("........","..####..",".######.",".######.",".######.",".######.","..####..","........"),87:f("........","..####..",".######.",".##..##.",".##..##.",".######.","..####..","........"),94:f("........","........","#######.",".##.##..",".##.##..",".##.##..",".##..##.","........"),85:f("........","........","........",".....###","....####","...###..","...##...","...##..."),73:f("........","........","........","###.....","####....","..###...","...##...","...##..."),74:f("...##...","...##...","...###..","....####",".....###","........","........","........"),75:f("...##...","...##...","..###...","####....","###.....","........","........","........"),77:f("##......","###.....",".###....","..###...","...###..","....###.",".....###","......##"),78:f("......##",".....###","....###.","...###..","..###...",".###....","###.....","##......"),86:f("##....##","###..###",".######.","..####..","..####..",".######.","###..###","##....##"),99:r(0,0),100:r(7,7),101:c(0,1),116:c(0,1),103:c(6,7),106:c(6,7),76:s(c(0,1),r(6,7)),79:s(r(0,1),c(0,1)),80:s(r(0,1),c(6,7)),122:s(c(6,7),r(6,7)),107:t("up","down","right"),115:t("up","down","left"),113:t("up","left","right"),114:t("down","left","right"),91:t("up","down","left","right"),109:t("up","right"),125:t("up","left"),112:t("down","right"),110:t("down","left"),97:e(0,7,0,3),98:e(4,7,0,7),111:e(6,7,0,7),119:e(0,1,0,7),120:e(0,2,0,7),121:e(5,7,0,7),117:e(0,7,0,2),118:e(0,7,5,7),126:e(0,3,0,3),124:e(0,3,4,7),123:e(4,7,0,3),108:e(4,7,4,7),127:s(e(0,3,0,3),e(4,7,4,7)),102:a(0),92:a(0,0,7,0,3),104:a(0,4,7),95:[...Array(8).keys()].map(o=>255>>o),105:[...Array(8).keys()].map(o=>255<<o&255)},second:{94:a(1),95:f("..##..##","#..##..#","##..##..",".##..##.","..##..##","#..##..#","##..##..",".##..##."),105:f("##..##..","#..##..#","..##..##",".##..##.","##..##..","#..##..#","..##..##",".##..##."),122:f("........","......##",".....##.","....##..","##.##...",".###....","..#.....","........")},signs:{28:f("...###..","..##..#.","..##....","######..","..##....",".##...#.","#######.","........"),30:f("...##...","..####..",".######.","...##...","...##...","...##...","...##...","........"),31:f("........","..##....",".##.....","#######.",".##.....","..##....","........","........")}}})();function y(){let f=new Uint8Array(4096),e=(r,c)=>{let x=g[r-32];if(x)for(let t=0;t<7;t++){let a=0;for(let o=0;o<5;o++)x[o]>>t&1&&(a|=64>>o);f[c+t]=a}},s={0:64,27:91,28:35,29:93,30:94,31:60};for(let r of[0,1]){let c=r*2048;for(let x=0;x<64;x++){let t=x>=32?x:x>=1&&x<=26?(r?96:64)+x:s[x];e(t,c+x*8)}if(r)for(let x=65;x<=90;x++)e(x,c+x*8);for(let[x,t]of Object.entries(u.signs))f.set(t,c+x*8);for(let[x,t]of Object.entries(u.first))(!r||!(x>=65&&x<=90))&&f.set(t,c+x*8);if(r)for(let[x,t]of Object.entries(u.second))f.set(t,c+x*8);for(let x=0;x<1024;x++)f[c+1024+x]=f[c+x]^255}return f}export{w as chargen,m as font};
|
|
3
|
+
//# sourceMappingURL=moonbase-charset.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../chargen.js", "../font.js"],
|
|
4
|
+
"sourcesContent": ["// moonbase's own characters for the Commodore 64's character ROM, apart from @moonbase-machines/c64/rom.js\n// so that a page needing only the characters (a PET's screen) loads only them.\n//\n// chargen() the character ROM's 4K: the two sets, each 128 characters and their reverse\nimport { FONT } from './font.js';\n\n// The two character sets, as the character ROM holds them, 8 bytes a character, from the font:\n// the first upper case and graphics, the second lower and upper case, each 128 characters by\n// screen code and the same 128 reversed after them. A glyph's five columns go one dot in from the\n// left, its seven rows from the top. The graphics, and \u00A3, \u2191 and \u2190, are moonbase's own, drawn\n// below: each a symbol at the place the C64 keeps it, so a game's boxes, shading and card suits\n// show, the lines and blocks where a line or a block must lie, the rest in moonbase's hand. The\n// second set has the first's graphics at the same places, but for four of its own.\nconst GRAPHICS = (() => {\n const rows = (...r) => r.map(t => parseInt(t.replace(/\\./g, '0').replace(/#/g, '1'), 2));\n const fill = (top, bottom, left, right) => [...Array(8).keys()].map(y => y >= top && y <= bottom ? (0xff >> left) & (0xff << (7 - right)) & 0xff : 0);\n const or = (...gs) => gs[0].map((_, y) => gs.reduce((v, g) => v | g[y], 0));\n const across = (top, bottom) => fill(top, bottom, 0, 7), down = (left, right) => fill(0, 7, left, right);\n const centre = { up: fill(0, 4, 3, 4), down: fill(3, 7, 3, 4), left: fill(3, 4, 0, 4), right: fill(3, 4, 3, 7) };\n const join = (...arms) => or(...arms.map(a => centre[a]));\n const checker = (phase, top = 0, bottom = 7, left = 0, right = 7) => [...Array(8).keys()].map(y => y < top || y > bottom ? 0 : ((y >> 1) + phase) & 1 ? 0x33 & (0xff >> left) & (0xff << (7 - right)) & 0xff : 0xcc & (0xff >> left) & (0xff << (7 - right)) & 0xff);\n return {\n // the first set's, by screen code\n first: {\n 0x40: across(3, 4), 0x43: across(3, 4), 0x44: across(2, 3), 0x45: across(1, 2), 0x46: across(4, 5), 0x52: across(5, 6),\n 0x42: down(3, 4), 0x5d: down(3, 4), 0x47: down(2, 3), 0x48: down(4, 5), 0x54: down(1, 2), 0x59: down(5, 6),\n 0x41: rows('...##...', '..####..', '.######.', '########', '########', '##.##.##', '...##...', '..####..'), // spade\n 0x53: rows('.##..##.', '########', '########', '########', '.######.', '..####..', '...##...', '........'), // heart\n 0x58: rows('..####..', '..####..', '##.##.##', '########', '########', '##.##.##', '...##...', '..####..'), // club\n 0x5a: rows('...##...', '..####..', '.######.', '########', '.######.', '..####..', '...##...', '........'), // diamond\n 0x51: rows('........', '..####..', '.######.', '.######.', '.######.', '.######.', '..####..', '........'), // a disc\n 0x57: rows('........', '..####..', '.######.', '.##..##.', '.##..##.', '.######.', '..####..', '........'), // a ring\n 0x5e: rows('........', '........', '#######.', '.##.##..', '.##.##..', '.##.##..', '.##..##.', '........'), // pi\n // rounded corners, the diagonals, the cross, the disc and the ring: drawn as Commodore's, so\n // PETSCII pictures, which lean on them, come out as they were made\n 0x55: rows('........', '........', '........', '.....###', '....####', '...###..', '...##...', '...##...'),\n 0x49: rows('........', '........', '........', '###.....', '####....', '..###...', '...##...', '...##...'),\n 0x4a: rows('...##...', '...##...', '...###..', '....####', '.....###', '........', '........', '........'),\n 0x4b: rows('...##...', '...##...', '..###...', '####....', '###.....', '........', '........', '........'),\n 0x4d: rows('##......', '###.....', '.###....', '..###...', '...###..', '....###.', '.....###', '......##'),\n 0x4e: rows('......##', '.....###', '....###.', '...###..', '..###...', '.###....', '###.....', '##......'),\n 0x56: rows('##....##', '###..###', '.######.', '..####..', '..####..', '.######.', '###..###', '##....##'),\n // the cell's edges, and corners on them\n 0x63: across(0, 0), 0x64: across(7, 7), 0x65: down(0, 1), 0x74: down(0, 1), 0x67: down(6, 7), 0x6a: down(6, 7),\n 0x4c: or(down(0, 1), across(6, 7)), 0x4f: or(across(0, 1), down(0, 1)), 0x50: or(across(0, 1), down(6, 7)), 0x7a: or(down(6, 7), across(6, 7)),\n // box lines through the middle: corners, T-junctions and the cross\n 0x6b: join('up', 'down', 'right'), 0x73: join('up', 'down', 'left'), 0x71: join('up', 'left', 'right'), 0x72: join('down', 'left', 'right'), 0x5b: join('up', 'down', 'left', 'right'),\n 0x6d: join('up', 'right'), 0x7d: join('up', 'left'), 0x70: join('down', 'right'), 0x6e: join('down', 'left'),\n // blocks, by halves, thirds and quarters, and the quadrants\n 0x61: fill(0, 7, 0, 3), 0x62: fill(4, 7, 0, 7), 0x6f: fill(6, 7, 0, 7), 0x77: fill(0, 1, 0, 7), 0x78: fill(0, 2, 0, 7), 0x79: fill(5, 7, 0, 7),\n 0x75: fill(0, 7, 0, 2), 0x76: fill(0, 7, 5, 7),\n 0x7e: fill(0, 3, 0, 3), 0x7c: fill(0, 3, 4, 7), 0x7b: fill(4, 7, 0, 3), 0x6c: fill(4, 7, 4, 7), 0x7f: or(fill(0, 3, 0, 3), fill(4, 7, 4, 7)),\n // shading, and the triangles\n 0x66: checker(0), 0x5c: checker(0, 0, 7, 0, 3), 0x68: checker(0, 4, 7),\n 0x5f: [...Array(8).keys()].map(y => 0xff >> y), 0x69: [...Array(8).keys()].map(y => (0xff << y) & 0xff),\n },\n // the second set's own, where it does not have the first's: the shading the other way about,\n // stripes each way, and a tick\n second: {\n 0x5e: checker(1),\n 0x5f: rows('..##..##', '#..##..#', '##..##..', '.##..##.', '..##..##', '#..##..#', '##..##..', '.##..##.'),\n 0x69: rows('##..##..', '#..##..#', '..##..##', '.##..##.', '##..##..', '#..##..#', '..##..##', '.##..##.'),\n 0x7a: rows('........', '......##', '.....##.', '....##..', '##.##...', '.###....', '..#.....', '........'),\n },\n // \u00A3, \u2191 and \u2190, in both\n signs: {\n 0x1c: rows('...###..', '..##..#.', '..##....', '######..', '..##....', '.##...#.', '#######.', '........'),\n 0x1e: rows('...##...', '..####..', '.######.', '...##...', '...##...', '...##...', '...##...', '........'),\n 0x1f: rows('........', '..##....', '.##.....', '#######.', '.##.....', '..##....', '........', '........'),\n },\n };\n})();\nexport function chargen() {\n const out = new Uint8Array(0x1000);\n const glyph = (ascii, at) => {\n const g = FONT[ascii - 0x20]; if (!g) return;\n for (let row = 0; row < 7; row++) { let bits = 0; for (let col = 0; col < 5; col++) if (g[col] >> row & 1) bits |= 0x40 >> col; out[at + row] = bits; }\n };\n const OTHERS = { 0x00: 0x40, 0x1b: 0x5b, 0x1c: 0x23, 0x1d: 0x5d, 0x1e: 0x5e, 0x1f: 0x3c }; // @ [ \u00A3 ] \u2191 \u2190\n for (const set of [0, 1]) {\n const base = set * 0x800;\n for (let code = 0; code < 64; code++) {\n const ascii = code >= 0x20 ? code : code >= 1 && code <= 26 ? (set ? 0x60 : 0x40) + code : OTHERS[code];\n glyph(ascii, base + code * 8);\n }\n if (set) for (let code = 0x41; code <= 0x5a; code++) glyph(code, base + code * 8); // the second set's capitals\n for (const [code, g] of Object.entries(GRAPHICS.signs)) out.set(g, base + code * 8);\n for (const [code, g] of Object.entries(GRAPHICS.first)) if (!set || !(code >= 0x41 && code <= 0x5a)) out.set(g, base + code * 8);\n if (set) for (const [code, g] of Object.entries(GRAPHICS.second)) out.set(g, base + code * 8);\n for (let i = 0; i < 0x400; i++) out[base + 0x400 + i] = out[base + i] ^ 0xff; // reversed\n }\n return out;\n}\n", "// A 5 by 7 dot font for the text screen, for the characters from space to ~, since the Apple's\n// character generator is Apple's own. Each glyph is five columns, low bit at the top.\nexport const FONT = [\n [0x00,0x00,0x00,0x00,0x00],[0x00,0x00,0x5f,0x00,0x00],[0x00,0x07,0x00,0x07,0x00],[0x14,0x7f,0x14,0x7f,0x14],[0x24,0x2a,0x7f,0x2a,0x12],[0x23,0x13,0x08,0x64,0x62],[0x36,0x49,0x55,0x22,0x50],[0x00,0x05,0x03,0x00,0x00],\n [0x00,0x1c,0x22,0x41,0x00],[0x00,0x41,0x22,0x1c,0x00],[0x14,0x08,0x3e,0x08,0x14],[0x08,0x08,0x3e,0x08,0x08],[0x00,0x50,0x30,0x00,0x00],[0x08,0x08,0x08,0x08,0x08],[0x00,0x60,0x60,0x00,0x00],[0x20,0x10,0x08,0x04,0x02],\n [0x3e,0x51,0x49,0x45,0x3e],[0x00,0x42,0x7f,0x40,0x00],[0x42,0x61,0x51,0x49,0x46],[0x21,0x41,0x45,0x4b,0x31],[0x18,0x14,0x12,0x7f,0x10],[0x27,0x45,0x45,0x45,0x39],[0x3c,0x4a,0x49,0x49,0x30],[0x01,0x71,0x09,0x05,0x03],\n [0x36,0x49,0x49,0x49,0x36],[0x06,0x49,0x49,0x29,0x1e],[0x00,0x36,0x36,0x00,0x00],[0x00,0x56,0x36,0x00,0x00],[0x08,0x14,0x22,0x41,0x00],[0x14,0x14,0x14,0x14,0x14],[0x00,0x41,0x22,0x14,0x08],[0x02,0x01,0x51,0x09,0x06],\n [0x32,0x49,0x79,0x41,0x3e],[0x7e,0x11,0x11,0x11,0x7e],[0x7f,0x49,0x49,0x49,0x36],[0x3e,0x41,0x41,0x41,0x22],[0x7f,0x41,0x41,0x22,0x1c],[0x7f,0x49,0x49,0x49,0x41],[0x7f,0x09,0x09,0x09,0x01],[0x3e,0x41,0x49,0x49,0x7a],\n [0x7f,0x08,0x08,0x08,0x7f],[0x00,0x41,0x7f,0x41,0x00],[0x20,0x40,0x41,0x3f,0x01],[0x7f,0x08,0x14,0x22,0x41],[0x7f,0x40,0x40,0x40,0x40],[0x7f,0x02,0x0c,0x02,0x7f],[0x7f,0x04,0x08,0x10,0x7f],[0x3e,0x41,0x41,0x41,0x3e],\n [0x7f,0x09,0x09,0x09,0x06],[0x3e,0x41,0x51,0x21,0x5e],[0x7f,0x09,0x19,0x29,0x46],[0x46,0x49,0x49,0x49,0x31],[0x01,0x01,0x7f,0x01,0x01],[0x3f,0x40,0x40,0x40,0x3f],[0x1f,0x20,0x40,0x20,0x1f],[0x3f,0x40,0x38,0x40,0x3f],\n [0x63,0x14,0x08,0x14,0x63],[0x07,0x08,0x70,0x08,0x07],[0x61,0x51,0x49,0x45,0x43],[0x00,0x7f,0x41,0x41,0x00],[0x02,0x04,0x08,0x10,0x20],[0x00,0x41,0x41,0x7f,0x00],[0x04,0x02,0x01,0x02,0x04],[0x40,0x40,0x40,0x40,0x40],\n [0x00,0x01,0x02,0x04,0x00],[0x20,0x54,0x54,0x54,0x78],[0x7f,0x48,0x44,0x44,0x38],[0x38,0x44,0x44,0x44,0x20],[0x38,0x44,0x44,0x48,0x7f],[0x38,0x54,0x54,0x54,0x18],[0x08,0x7e,0x09,0x01,0x02],[0x0c,0x52,0x52,0x52,0x3e],\n [0x7f,0x08,0x04,0x04,0x78],[0x00,0x44,0x7d,0x40,0x00],[0x20,0x40,0x44,0x3d,0x00],[0x7f,0x10,0x28,0x44,0x00],[0x00,0x41,0x7f,0x40,0x00],[0x7c,0x04,0x18,0x04,0x78],[0x7c,0x08,0x04,0x04,0x78],[0x38,0x44,0x44,0x44,0x38],\n [0x7c,0x14,0x14,0x14,0x08],[0x08,0x14,0x14,0x18,0x7c],[0x7c,0x08,0x04,0x04,0x08],[0x48,0x54,0x54,0x54,0x20],[0x04,0x3f,0x44,0x40,0x20],[0x3c,0x40,0x40,0x20,0x7c],[0x1c,0x20,0x40,0x20,0x1c],[0x3c,0x40,0x30,0x40,0x3c],\n [0x44,0x28,0x10,0x28,0x44],[0x0c,0x50,0x50,0x50,0x3c],[0x44,0x64,0x54,0x4c,0x44],[0x00,0x08,0x36,0x41,0x00],[0x00,0x00,0x7f,0x00,0x00],[0x00,0x41,0x36,0x08,0x00],[0x08,0x04,0x08,0x10,0x08],\n];\n"],
|
|
5
|
+
"mappings": ";0FAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,ICAA,IAAAC,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAEO,IAAMA,EAAO,CAClB,CAAC,EAAK,EAAK,EAAK,EAAK,CAAI,EAAE,CAAC,EAAK,EAAK,GAAK,EAAK,CAAI,EAAE,CAAC,EAAK,EAAK,EAAK,EAAK,CAAI,EAAE,CAAC,GAAK,IAAK,GAAK,IAAK,EAAI,EAAE,CAAC,GAAK,GAAK,IAAK,GAAK,EAAI,EAAE,CAAC,GAAK,GAAK,EAAK,IAAK,EAAI,EAAE,CAAC,GAAK,GAAK,GAAK,GAAK,EAAI,EAAE,CAAC,EAAK,EAAK,EAAK,EAAK,CAAI,EACtN,CAAC,EAAK,GAAK,GAAK,GAAK,CAAI,EAAE,CAAC,EAAK,G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AAM,IAAGC,GAAQ,IAAQC,GAAKP,EAAIG,EAAKE,CAAG,EAAIC,CAAM,CACxJ,EACME,EAAS,CAAE,EAAM,GAAM,GAAM,GAAM,GAAM,GAAM,GAAM,GAAM,GAAM,GAAM,GAAM,EAAK,EACxF,QAAWC,IAAO,CAAC,EAAG,CAAC,EAAG,CACxB,IAAMC,EAAOD,EAAM,KACnB,QAASE,EAAO,EAAGA,EAAO,GAAIA,IAAQ,CACpC,IAAMT,EAAQS,GAAQ,GAAOA,EAAOA,GAAQ,GAAKA,GAAQ,IAAMF,EAAM,GAAO,IAAQE,EAAOH,EAAOG,CAAI,EACtGV,EAAMC,EAAOQ,EAAOC,EAAO,CAAC,CAC9B,CACA,GAAIF,EAAK,QAASE,EAAO,GAAMA,GAAQ,GAAMA,IAAQV,EAAMU,EAAMD,EAAOC,EAAO,CAAC,EAChF,OAAW,CAACA,EAAMrB,CAAC,IAAK,OAAO,QAAQd,EAAS,KAAK,EAAGwB,EAAI,IAAIV,EAAGoB,EAAOC,EAAO,CAAC,EAClF,OAAW,CAACA,EAAMrB,CAAC,IAAK,OAAO,QAAQd,EAAS,KAAK,GAAO,CAACiC,GAAO,EAAEE,GAAQ,IAAQA,GAAQ,MAAOX,EAAI,IAAIV,EAAGoB,EAAOC,EAAO,CAAC,EAC/H,GAAIF,EAAK,OAAW,CAACE,EAAMrB,CAAC,IAAK,OAAO,QAAQd,EAAS,MAAM,EAAGwB,EAAI,IAAIV,EAAGoB,EAAOC,EAAO,CAAC,EAC5F,QAASC,EAAI,EAAGA,EAAI,KAAOA,IAAKZ,EAAIU,EAAO,KAAQE,CAAC,EAAIZ,EAAIU,EAAOE,CAAC,EAAI,GAC1E,CACA,OAAOZ,CACT",
|
|
6
|
+
"names": ["chargen_exports", "__export", "chargen", "font_exports", "__export", "FONT", "GRAPHICS", "rows", "r", "t", "fill", "top", "bottom", "left", "right", "y", "or", "gs", "_", "v", "g", "across", "down", "centre", "join", "arms", "a", "checker", "phase", "chargen", "out", "glyph", "ascii", "at", "FONT", "row", "bits", "col", "OTHERS", "set", "base", "code", "i"]
|
|
7
|
+
}
|
package/font.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// A 5 by 7 dot font for the text screen, for the characters from space to ~, since the Apple's
|
|
2
|
+
// character generator is Apple's own. Each glyph is five columns, low bit at the top.
|
|
3
|
+
export const FONT = [
|
|
4
|
+
[0x00,0x00,0x00,0x00,0x00],[0x00,0x00,0x5f,0x00,0x00],[0x00,0x07,0x00,0x07,0x00],[0x14,0x7f,0x14,0x7f,0x14],[0x24,0x2a,0x7f,0x2a,0x12],[0x23,0x13,0x08,0x64,0x62],[0x36,0x49,0x55,0x22,0x50],[0x00,0x05,0x03,0x00,0x00],
|
|
5
|
+
[0x00,0x1c,0x22,0x41,0x00],[0x00,0x41,0x22,0x1c,0x00],[0x14,0x08,0x3e,0x08,0x14],[0x08,0x08,0x3e,0x08,0x08],[0x00,0x50,0x30,0x00,0x00],[0x08,0x08,0x08,0x08,0x08],[0x00,0x60,0x60,0x00,0x00],[0x20,0x10,0x08,0x04,0x02],
|
|
6
|
+
[0x3e,0x51,0x49,0x45,0x3e],[0x00,0x42,0x7f,0x40,0x00],[0x42,0x61,0x51,0x49,0x46],[0x21,0x41,0x45,0x4b,0x31],[0x18,0x14,0x12,0x7f,0x10],[0x27,0x45,0x45,0x45,0x39],[0x3c,0x4a,0x49,0x49,0x30],[0x01,0x71,0x09,0x05,0x03],
|
|
7
|
+
[0x36,0x49,0x49,0x49,0x36],[0x06,0x49,0x49,0x29,0x1e],[0x00,0x36,0x36,0x00,0x00],[0x00,0x56,0x36,0x00,0x00],[0x08,0x14,0x22,0x41,0x00],[0x14,0x14,0x14,0x14,0x14],[0x00,0x41,0x22,0x14,0x08],[0x02,0x01,0x51,0x09,0x06],
|
|
8
|
+
[0x32,0x49,0x79,0x41,0x3e],[0x7e,0x11,0x11,0x11,0x7e],[0x7f,0x49,0x49,0x49,0x36],[0x3e,0x41,0x41,0x41,0x22],[0x7f,0x41,0x41,0x22,0x1c],[0x7f,0x49,0x49,0x49,0x41],[0x7f,0x09,0x09,0x09,0x01],[0x3e,0x41,0x49,0x49,0x7a],
|
|
9
|
+
[0x7f,0x08,0x08,0x08,0x7f],[0x00,0x41,0x7f,0x41,0x00],[0x20,0x40,0x41,0x3f,0x01],[0x7f,0x08,0x14,0x22,0x41],[0x7f,0x40,0x40,0x40,0x40],[0x7f,0x02,0x0c,0x02,0x7f],[0x7f,0x04,0x08,0x10,0x7f],[0x3e,0x41,0x41,0x41,0x3e],
|
|
10
|
+
[0x7f,0x09,0x09,0x09,0x06],[0x3e,0x41,0x51,0x21,0x5e],[0x7f,0x09,0x19,0x29,0x46],[0x46,0x49,0x49,0x49,0x31],[0x01,0x01,0x7f,0x01,0x01],[0x3f,0x40,0x40,0x40,0x3f],[0x1f,0x20,0x40,0x20,0x1f],[0x3f,0x40,0x38,0x40,0x3f],
|
|
11
|
+
[0x63,0x14,0x08,0x14,0x63],[0x07,0x08,0x70,0x08,0x07],[0x61,0x51,0x49,0x45,0x43],[0x00,0x7f,0x41,0x41,0x00],[0x02,0x04,0x08,0x10,0x20],[0x00,0x41,0x41,0x7f,0x00],[0x04,0x02,0x01,0x02,0x04],[0x40,0x40,0x40,0x40,0x40],
|
|
12
|
+
[0x00,0x01,0x02,0x04,0x00],[0x20,0x54,0x54,0x54,0x78],[0x7f,0x48,0x44,0x44,0x38],[0x38,0x44,0x44,0x44,0x20],[0x38,0x44,0x44,0x48,0x7f],[0x38,0x54,0x54,0x54,0x18],[0x08,0x7e,0x09,0x01,0x02],[0x0c,0x52,0x52,0x52,0x3e],
|
|
13
|
+
[0x7f,0x08,0x04,0x04,0x78],[0x00,0x44,0x7d,0x40,0x00],[0x20,0x40,0x44,0x3d,0x00],[0x7f,0x10,0x28,0x44,0x00],[0x00,0x41,0x7f,0x40,0x00],[0x7c,0x04,0x18,0x04,0x78],[0x7c,0x08,0x04,0x04,0x78],[0x38,0x44,0x44,0x44,0x38],
|
|
14
|
+
[0x7c,0x14,0x14,0x14,0x08],[0x08,0x14,0x14,0x18,0x7c],[0x7c,0x08,0x04,0x04,0x08],[0x48,0x54,0x54,0x54,0x20],[0x04,0x3f,0x44,0x40,0x20],[0x3c,0x40,0x40,0x20,0x7c],[0x1c,0x20,0x40,0x20,0x1c],[0x3c,0x40,0x30,0x40,0x3c],
|
|
15
|
+
[0x44,0x28,0x10,0x28,0x44],[0x0c,0x50,0x50,0x50,0x3c],[0x44,0x64,0x54,0x4c,0x44],[0x00,0x08,0x36,0x41,0x00],[0x00,0x00,0x7f,0x00,0x00],[0x00,0x41,0x36,0x08,0x00],[0x08,0x04,0x08,0x10,0x08],
|
|
16
|
+
];
|
package/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// @moonbase-machines/charset: Moonbase's character set and the 5 by 7 font, every module by name, for one
|
|
2
|
+
// bundled file or to take the whole package at once: import { chargen } from '@moonbase-machines/charset'.
|
|
3
|
+
// Each module can be imported on its own too: '@moonbase-machines/charset/<module>.js'.
|
|
4
|
+
export * as chargen from './chargen.js';
|
|
5
|
+
export * as font from './font.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonbase-machines/charset",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.4.1",
|
|
4
|
+
"description": "Moonbase's own character set for the Commodore 64, and the 5 by 7 font it and the Apple IIe's text screen are drawn from.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Mark Wharton",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./index.js",
|
|
10
|
+
"./*": "./*"
|
|
11
|
+
}
|
|
12
|
+
}
|