Restore some array formatting

This commit is contained in:
Will Scullin 2023-11-23 11:45:46 -08:00
parent 0950ef6294
commit 012aac0fff
No known key found for this signature in database
GPG Key ID: 26DCD1042C6638CD
6 changed files with 183 additions and 924 deletions

View File

@ -85,6 +85,7 @@ const LOC = {
// B LOAD XXXXXXXX YYYYYYYY // B LOAD XXXXXXXX YYYYYYYY
// D SL1 ABCDEFGH BCDEFGH1 // D SL1 ABCDEFGH BCDEFGH1
// prettier-ignore
const SEQUENCER_ROM_13 = [ const SEQUENCER_ROM_13 = [
// See Understanding the Apple IIe, Figure 9.10 The DOS 3.2 Logic State Sequencer // See Understanding the Apple IIe, Figure 9.10 The DOS 3.2 Logic State Sequencer
// Note that the column order here is NOT the same as in Figure 9.10 for Q7 H (Write). // Note that the column order here is NOT the same as in Figure 9.10 for Q7 H (Write).
@ -93,264 +94,25 @@ const SEQUENCER_ROM_13 = [
// Q6 L (Shift) Q6 H (Load) Q6 L (Shift) Q6 H (Load) // Q6 L (Shift) Q6 H (Load) Q6 L (Shift) Q6 H (Load)
// QA L QA H QA L QA H QA L QA H QA L QA H // QA L QA H QA L QA H QA L QA H QA L QA H
// 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 // 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
0xd8, 0xD8, 0x18, 0x18, 0x08, 0x0A, 0x0A, 0x0A, 0x0A, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, // 0
0x18, 0xD8, 0x2D, 0x28, 0x28, 0x0A, 0x0A, 0x0A, 0x0A, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, // 1
0x18, 0xD8, 0x38, 0x38, 0x38, 0x0A, 0x0A, 0x0A, 0x0A, 0x39, 0x39, 0x39, 0x39, 0x3B, 0x3B, 0x3B, 0x3B, // 2
0x08, 0xD8, 0x48, 0xD8, 0x48, 0x0A, 0x0A, 0x0A, 0x0A, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x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F8, 0x0A, 0x0A, 0x0A, 0x0A, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, // E
0x18, // 0 0xDD, 0x4D, 0xE0, 0xE0, 0x0A, 0x0A, 0x0A, 0x0A, 0x88, 0x88, 0x08, 0x08, 0x88, 0x88, 0x08, 0x08 // F
0xd8,
0x2d,
0x28,
0x28,
0x0a,
0x0a,
0x0a,
0x0a,
0x28,
0x28,
0x28,
0x28,
0x28,
0x28,
0x28,
0x28, // 1
0xd8,
0x38,
0x38,
0x38,
0x0a,
0x0a,
0x0a,
0x0a,
0x39,
0x39,
0x39,
0x39,
0x3b,
0x3b,
0x3b,
0x3b, // 2
0xd8,
0x48,
0xd8,
0x48,
0x0a,
0x0a,
0x0a,
0x0a,
0x48,
0x48,
0x48,
0x48,
0x48,
0x48,
0x48,
0x48, // 3
0xd8,
0x58,
0xd8,
0x58,
0x0a,
0x0a,
0x0a,
0x0a,
0x58,
0x58,
0x58,
0x58,
0x58,
0x58,
0x58,
0x58, // 4
0xd8,
0x68,
0xd8,
0x68,
0x0a,
0x0a,
0x0a,
0x0a,
0x68,
0x68,
0x68,
0x68,
0x68,
0x68,
0x68,
0x68, // 5
0xd8,
0x78,
0xd8,
0x78,
0x0a,
0x0a,
0x0a,
0x0a,
0x78,
0x78,
0x78,
0x78,
0x78,
0x78,
0x78,
0x78, // 6
0xd8,
0x88,
0xd8,
0x88,
0x0a,
0x0a,
0x0a,
0x0a,
0x08,
0x08,
0x88,
0x88,
0x08,
0x08,
0x88,
0x88, // 7
0xd8,
0x98,
0xd8,
0x98,
0x0a,
0x0a,
0x0a,
0x0a,
0x98,
0x98,
0x98,
0x98,
0x98,
0x98,
0x98,
0x98, // 8
0xd8,
0x09,
0xd8,
0xa8,
0x0a,
0x0a,
0x0a,
0x0a,
0xa8,
0xa8,
0xa8,
0xa8,
0xa8,
0xa8,
0xa8,
0xa8, // 9
0xcd,
0xbd,
0xd8,
0xb8,
0x0a,
0x0a,
0x0a,
0x0a,
0xb9,
0xb9,
0xb9,
0xb9,
0xbb,
0xbb,
0xbb,
0xbb, // A
0xd9,
0x39,
0xd8,
0xc8,
0x0a,
0x0a,
0x0a,
0x0a,
0xc8,
0xc8,
0xc8,
0xc8,
0xc8,
0xc8,
0xc8,
0xc8, // B
0xd9,
0xd9,
0xd8,
0xa0,
0x0a,
0x0a,
0x0a,
0x0a,
0xd8,
0xd8,
0xd8,
0xd8,
0xd8,
0xd8,
0xd8,
0xd8, // C
0x1d,
0x0d,
0xe8,
0xe8,
0x0a,
0x0a,
0x0a,
0x0a,
0xe8,
0xe8,
0xe8,
0xe8,
0xe8,
0xe8,
0xe8,
0xe8, // D
0xfd,
0xfd,
0xf8,
0xf8,
0x0a,
0x0a,
0x0a,
0x0a,
0xf8,
0xf8,
0xf8,
0xf8,
0xf8,
0xf8,
0xf8,
0xf8, // E
0xdd,
0x4d,
0xe0,
0xe0,
0x0a,
0x0a,
0x0a,
0x0a,
0x88,
0x88,
0x08,
0x08,
0x88,
0x88,
0x08,
0x08, // F
] as const; ] as const;
// prettier-ignore
const SEQUENCER_ROM_16 = [ const SEQUENCER_ROM_16 = [
// See Understanding the Apple IIe, Figure 9.11 The DOS 3.3 Logic State Sequencer // See Understanding the Apple IIe, Figure 9.11 The DOS 3.3 Logic State Sequencer
// Note that the column order here is NOT the same as in Figure 9.11 for Q7 H (Write). // Note that the column order here is NOT the same as in Figure 9.11 for Q7 H (Write).
@ -359,262 +121,22 @@ const SEQUENCER_ROM_16 = [
// Q6 L (Shift) Q6 H (Load) Q6 L (Shift) Q6 H (Load) // Q6 L (Shift) Q6 H (Load) Q6 L (Shift) Q6 H (Load)
// QA L QA H QA L QA H QA L QA H QA L QA H // QA L QA H QA L QA H QA L QA H QA L QA H
// 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 // 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
0x18, 0x18, 0x18, 0x18, 0x18, 0x0A, 0x0A, 0x0A, 0x0A, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, // 0
0x18, 0x2D, 0x2D, 0x38, 0x38, 0x0A, 0x0A, 0x0A, 0x0A, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, // 1
0x18, 0xD8, 0x38, 0x08, 0x28, 0x0A, 0x0A, 0x0A, 0x0A, 0x39, 0x39, 0x39, 0x39, 0x3B, 0x3B, 0x3B, 0x3B, // 2
0x18, 0xD8, 0x48, 0x48, 0x48, 0x0A, 0x0A, 0x0A, 0x0A, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, // 3
0x0a, 0xD8, 0x58, 0xD8, 0x58, 0x0A, 0x0A, 0x0A, 0x0A, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, // 4
0x0a, 0xD8, 0x68, 0xD8, 0x68, 0x0A, 0x0A, 0x0A, 0x0A, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, 0x68, // 5
0x0a, 0xD8, 0x78, 0xD8, 0x78, 0x0A, 0x0A, 0x0A, 0x0A, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, // 6
0x0a, 0xD8, 0x88, 0xD8, 0x88, 0x0A, 0x0A, 0x0A, 0x0A, 0x08, 0x08, 0x88, 0x88, 0x08, 0x08, 0x88, 0x88, // 7
0x18, 0xD8, 0x98, 0xD8, 0x98, 0x0A, 0x0A, 0x0A, 0x0A, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, // 8
0x18, 0xD8, 0x29, 0xD8, 0xA8, 0x0A, 0x0A, 0x0A, 0x0A, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, // 9
0x18, 0xCD, 0xBD, 0xD8, 0xB8, 0x0A, 0x0A, 0x0A, 0x0A, 0xB9, 0xB9, 0xB9, 0xB9, 0xBB, 0xBB, 0xBB, 0xBB, // A
0x18, 0xD9, 0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0x78, // 6
0xd8,
0x88,
0xd8,
0x88,
0x0a,
0x0a,
0x0a,
0x0a,
0x08,
0x08,
0x88,
0x88,
0x08,
0x08,
0x88,
0x88, // 7
0xd8,
0x98,
0xd8,
0x98,
0x0a,
0x0a,
0x0a,
0x0a,
0x98,
0x98,
0x98,
0x98,
0x98,
0x98,
0x98,
0x98, // 8
0xd8,
0x29,
0xd8,
0xa8,
0x0a,
0x0a,
0x0a,
0x0a,
0xa8,
0xa8,
0xa8,
0xa8,
0xa8,
0xa8,
0xa8,
0xa8, // 9
0xcd,
0xbd,
0xd8,
0xb8,
0x0a,
0x0a,
0x0a,
0x0a,
0xb9,
0xb9,
0xb9,
0xb9,
0xbb,
0xbb,
0xbb,
0xbb, // A
0xd9,
0x59,
0xd8,
0xc8,
0x0a,
0x0a,
0x0a,
0x0a,
0xc8,
0xc8,
0xc8,
0xc8,
0xc8,
0xc8,
0xc8,
0xc8, // B
0xd9,
0xd9,
0xd8,
0xa0,
0x0a,
0x0a,
0x0a,
0x0a,
0xd8,
0xd8,
0xd8,
0xd8,
0xd8,
0xd8,
0xd8,
0xd8, // C
0xd8,
0x08,
0xe8,
0xe8,
0x0a,
0x0a,
0x0a,
0x0a,
0xe8,
0xe8,
0xe8,
0xe8,
0xe8,
0xe8,
0xe8,
0xe8, // D
0xfd,
0xfd,
0xf8,
0xf8,
0x0a,
0x0a,
0x0a,
0x0a,
0xf8,
0xf8,
0xf8,
0xf8,
0xf8,
0xf8,
0xf8,
0xf8, // E
0xdd,
0x4d,
0xe0,
0xe0,
0x0a,
0x0a,
0x0a,
0x0a,
0x88,
0x88,
0x08,
0x08,
0x88,
0x88,
0x08,
0x08, // F
] as const; ] as const;
/** Contents of the P6 sequencer ROM. */ /** Contents of the P6 sequencer ROM. */

View File

@ -12,33 +12,37 @@ import {
/** /**
* DOS 3.3 Physical sector order (index is physical sector, value is DOS sector). * DOS 3.3 Physical sector order (index is physical sector, value is DOS sector).
*/ */
// prettier-ignore
export const DO = [ export const DO = [
0x0, 0x7, 0xe, 0x6, 0xd, 0x5, 0xc, 0x4, 0xb, 0x3, 0xa, 0x2, 0x9, 0x1, 0x8, 0x0, 0x7, 0xe, 0x6, 0xd, 0x5, 0xc, 0x4,
0xf, 0xb, 0x3, 0xa, 0x2, 0x9, 0x1, 0x8, 0xf,
] as const; ] as const;
/** /**
* DOS 3.3 Logical sector order (index is DOS sector, value is physical sector). * DOS 3.3 Logical sector order (index is DOS sector, value is physical sector).
*/ */
// prettier-ignore
export const _DO = [ export const _DO = [
0x0, 0xd, 0xb, 0x9, 0x7, 0x5, 0x3, 0x1, 0xe, 0xc, 0xa, 0x8, 0x6, 0x4, 0x2, 0x0, 0xd, 0xb, 0x9, 0x7, 0x5, 0x3, 0x1,
0xf, 0xe, 0xc, 0xa, 0x8, 0x6, 0x4, 0x2, 0xf,
] as const; ] as const;
/** /**
* ProDOS Physical sector order (index is physical sector, value is ProDOS sector). * ProDOS Physical sector order (index is physical sector, value is ProDOS sector).
*/ */
// prettier-ignore
export const PO = [ export const PO = [
0x0, 0x8, 0x1, 0x9, 0x2, 0xa, 0x3, 0xb, 0x4, 0xc, 0x5, 0xd, 0x6, 0xe, 0x7, 0x0, 0x8, 0x1, 0x9, 0x2, 0xa, 0x3, 0xb,
0xf, 0x4, 0xc, 0x5, 0xd, 0x6, 0xe, 0x7, 0xf,
] as const; ] as const;
/** /**
* ProDOS Logical sector order (index is ProDOS sector, value is physical sector). * ProDOS Logical sector order (index is ProDOS sector, value is physical sector).
*/ */
// prettier-ignore
export const _PO = [ export const _PO = [
0x0, 0x2, 0x4, 0x6, 0x8, 0xa, 0xc, 0xe, 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0x0, 0x2, 0x4, 0x6, 0x8, 0xa, 0xc, 0xe,
0xf, 0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf,
] as const; ] as const;
/** /**
@ -53,132 +57,60 @@ export const _D13O = [
0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc,
] as const; ] as const;
// prettier-ignore
const TRANS53 = [ const TRANS53 = [
0xab, 0xad, 0xae, 0xaf, 0xb5, 0xb6, 0xb7, 0xba, 0xbb, 0xbd, 0xbe, 0xbf, 0xab, 0xad, 0xae, 0xaf, 0xb5, 0xb6, 0xb7, 0xba,
0xd6, 0xd7, 0xda, 0xdb, 0xdd, 0xde, 0xdf, 0xea, 0xeb, 0xed, 0xee, 0xef, 0xbb, 0xbd, 0xbe, 0xbf, 0xd6, 0xd7, 0xda, 0xdb,
0xf5, 0xf6, 0xf7, 0xfa, 0xfb, 0xfd, 0xfe, 0xff, 0xdd, 0xde, 0xdf, 0xea, 0xeb, 0xed, 0xee, 0xef,
0xf5, 0xf6, 0xf7, 0xfa, 0xfb, 0xfd, 0xfe, 0xff
] as const; ] as const;
// prettier-ignore
export const DETRANS53 = [ export const DETRANS53 = [
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // A0
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, // A8
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x06, // B0
0x00, 0x00, 0x00, 0x07, 0x08, 0x00, 0x09, 0x0A, 0x0B, // B8
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // C0
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // C8
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0D, // D0
0x00, // A0 0x00, 0x00, 0x0E, 0x0F, 0x00, 0x10, 0x11, 0x12, // D8
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // E0
0x00, 0x00, 0x00, 0x13, 0x14, 0x00, 0x15, 0x16, 0x17, // E8
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x19, 0x1A, // F0
0x00, 0x00, 0x00, 0x1B, 0x1C, 0x00, 0x1D, 0x1E, 0x1F, // F8
0x00,
0x01,
0x02,
0x03, // A8
0x00,
0x00,
0x00,
0x00,
0x00,
0x04,
0x05,
0x06, // B0
0x00,
0x00,
0x07,
0x08,
0x00,
0x09,
0x0a,
0x0b, // B8
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00, // C0
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00, // C8
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x0c,
0x0d, // D0
0x00,
0x00,
0x0e,
0x0f,
0x00,
0x10,
0x11,
0x12, // D8
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00, // E0
0x00,
0x00,
0x13,
0x14,
0x00,
0x15,
0x16,
0x17, // E8
0x00,
0x00,
0x00,
0x00,
0x00,
0x18,
0x19,
0x1a, // F0
0x00,
0x00,
0x1b,
0x1c,
0x00,
0x1d,
0x1e,
0x1f, // F8
] as const; ] as const;
// prettier-ignore
const TRANS62 = [ const TRANS62 = [
0x96, 0x97, 0x9a, 0x9b, 0x9d, 0x9e, 0x9f, 0xa6, 0xa7, 0xab, 0xac, 0xad, 0x96, 0x97, 0x9a, 0x9b, 0x9d, 0x9e, 0x9f, 0xa6,
0xae, 0xaf, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb9, 0xba, 0xbb, 0xbc, 0xa7, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb2, 0xb3,
0xbd, 0xbe, 0xbf, 0xcb, 0xcd, 0xce, 0xcf, 0xd3, 0xd6, 0xd7, 0xd9, 0xda, 0xb4, 0xb5, 0xb6, 0xb7, 0xb9, 0xba, 0xbb, 0xbc,
0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe5, 0xe6, 0xe7, 0xe9, 0xea, 0xeb, 0xec, 0xbd, 0xbe, 0xbf, 0xcb, 0xcd, 0xce, 0xcf, 0xd3,
0xed, 0xee, 0xef, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf9, 0xfa, 0xfb, 0xd6, 0xd7, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde,
0xfc, 0xfd, 0xfe, 0xff, 0xdf, 0xe5, 0xe6, 0xe7, 0xe9, 0xea, 0xeb, 0xec,
0xed, 0xee, 0xef, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6,
0xf7, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
] as const; ] as const;
// prettier-ignore
export const DETRANS62 = [ export const DETRANS62 = [
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x07, 0x08, 0x00, 0x00, 0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x00, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x06,
0x00, 0x00, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x00, 0x14, 0x15, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08,
0x17, 0x18, 0x19, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
0x00, 0x00, 0x00, 0x1b, 0x00, 0x1c, 0x1d, 0x1e, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13,
0x00, 0x00, 0x20, 0x21, 0x00, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x00, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A,
0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x2a, 0x2b, 0x00, 0x2c, 0x2d, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x2f, 0x30, 0x31, 0x32, 0x00, 0x00, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x1C, 0x1D, 0x1E,
0x00, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x20, 0x21,
0x00, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x2A, 0x2B,
0x00, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32,
0x00, 0x00, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
0x00, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F
] as const; ] as const;
/** /**

View File

@ -162,206 +162,40 @@ function isUiKitKey(k: string): k is KnownKeys<typeof uiKitMap> {
return k in uiKitMap; return k in uiKitMap;
} }
const keys2 = [ // prettier-ignore
export const keys2 = [
[ [
['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', ':', '-', 'RESET'], ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', ':', '-', 'RESET'],
[ ['ESC', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'REPT', 'RETURN'],
'ESC', ['CTRL', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ';', '&larr;', '&rarr;'],
'Q',
'W',
'E',
'R',
'T',
'Y',
'U',
'I',
'O',
'P',
'REPT',
'RETURN',
],
[
'CTRL',
'A',
'S',
'D',
'F',
'G',
'H',
'J',
'K',
'L',
';',
'&larr;',
'&rarr;',
],
['SHIFT', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', ',', '.', '/', 'SHIFT'], ['SHIFT', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', ',', '.', '/', 'SHIFT'],
['POWER', '&nbsp;'], ['POWER', '&nbsp;']
], ], [
[ ['!', '"', '#', '$', '%', '&', '\'', '(', ')', '0', '*', '=', 'RESET'],
['!', '"', '#', '$', '%', '&', "'", '(', ')', '0', '*', '=', 'RESET'], ['ESC', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', '@', 'REPT', 'RETURN'],
[ ['CTRL', 'A', 'S', 'D', 'F', 'BELL', 'H', 'J', 'K', 'L', '+', '&larr;', '&rarr;'],
'ESC',
'Q',
'W',
'E',
'R',
'T',
'Y',
'U',
'I',
'O',
'@',
'REPT',
'RETURN',
],
[
'CTRL',
'A',
'S',
'D',
'F',
'BELL',
'H',
'J',
'K',
'L',
'+',
'&larr;',
'&rarr;',
],
['SHIFT', 'Z', 'X', 'C', 'V', 'B', '^', ']', '<', '>', '?', 'SHIFT'], ['SHIFT', 'Z', 'X', 'C', 'V', 'B', '^', ']', '<', '>', '?', 'SHIFT'],
['POWER', '&nbsp;'], ['POWER', '&nbsp;']
], ]
] as const; ] as const;
type Key2 = DeepMemberOf<typeof keys2>; type Key2 = DeepMemberOf<typeof keys2>;
const keys2e = [ // prettier-ignore
export const keys2e = [
[ [
[ ['ESC', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', 'DELETE'],
'ESC', ['TAB', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '[', ']', '\\'],
'1', ['CTRL', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ';', '"', 'RETURN'],
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
'-',
'=',
'DELETE',
],
[
'TAB',
'Q',
'W',
'E',
'R',
'T',
'Y',
'U',
'I',
'O',
'P',
'[',
']',
'\\',
],
[
'CTRL',
'A',
'S',
'D',
'F',
'G',
'H',
'J',
'K',
'L',
';',
'"',
'RETURN',
],
['SHIFT', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', ',', '.', '/', 'SHIFT'], ['SHIFT', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', ',', '.', '/', 'SHIFT'],
[ ['LOCK', '`', 'POW', 'OPEN_APPLE', '&nbsp;', 'CLOSED_APPLE', '&larr;', '&rarr;', '&darr;', '&uarr;']
'LOCK', ], [
'`', ['ESC', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', 'DELETE'],
'POW', ['TAB', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '|'],
'OPEN_APPLE', ['CTRL', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '\'', 'RETURN'],
'&nbsp;',
'CLOSED_APPLE',
'&larr;',
'&rarr;',
'&darr;',
'&uarr;',
],
],
[
[
'ESC',
'!',
'@',
'#',
'$',
'%',
'^',
'&',
'*',
'(',
')',
'_',
'+',
'DELETE',
],
[
'TAB',
'Q',
'W',
'E',
'R',
'T',
'Y',
'U',
'I',
'O',
'P',
'{',
'}',
'|',
],
[
'CTRL',
'A',
'S',
'D',
'F',
'G',
'H',
'J',
'K',
'L',
':',
"'",
'RETURN',
],
['SHIFT', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?', 'SHIFT'], ['SHIFT', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?', 'SHIFT'],
[ ['CAPS', '~', 'POW', 'OPEN_APPLE', '&nbsp;', 'CLOSED_APPLE', '&larr;', '&rarr;', '&darr;', '&uarr;']
'CAPS', ]
'~',
'POW',
'OPEN_APPLE',
'&nbsp;',
'CLOSED_APPLE',
'&larr;',
'&rarr;',
'&darr;',
'&uarr;',
],
],
] as const; ] as const;
type Key2e = DeepMemberOf<typeof keys2e>; type Key2e = DeepMemberOf<typeof keys2e>;

View File

@ -5,6 +5,7 @@ import { numberToBytes, stringToBytes } from '../util';
* Version 1 INFO segment * Version 1 INFO segment
*/ */
// prettier-ignore
const mockInfo1 = [ const mockInfo1 = [
0x01, // Version 0x01, // Version
0x01, // Disk Type (5.25") 0x01, // Disk Type (5.25")
@ -12,35 +13,19 @@ const mockInfo1 = [
0x01, // Synchronized 0x01, // Synchronized
0x00, // Cleaned 0x00, // Cleaned
...stringToBytes('Apple2JS', ' ', 32), ...stringToBytes('Apple2JS', ' ', 32),
0x00, 0x00, 0x00, 0x00, 0x00, // 23 Unused
0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00,
0x00, // 23 Unused 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
]; ];
/** /**
* Version 2 INFO segment * Version 2 INFO segment
*/ */
// prettier-ignore
const mockInfo2 = [ const mockInfo2 = [
0x02, // Version 0x02, // Version
0x01, // Disk Type (5.25") 0x01, // Disk Type (5.25")
@ -51,26 +36,13 @@ const mockInfo2 = [
0x01, // sides 0x01, // sides
0x00, // bootSector 0x00, // bootSector
0x00, // bitTiming 0x00, // bitTiming
0x00, 0x00, 0x00, // compatibleHardware
0x00, // compatibleHardware 0x00, 0x00, // requiredRAM
0x00, 0x00, 0x00, // largest track
0x00, // requiredRAM 0x00, 0x00, 0x00, 0x00, // 14 unused
0x00, 0x00, 0x00, 0x00, 0x00,
0x00, // largest track 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00,
0x00,
0x00,
0x00, // 14 unused
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
]; ];
/** /**
@ -140,17 +112,13 @@ const mockMETA2 = 'title\tMock Woz 2\nside_name\tB';
* Woz Version 1 * Woz Version 1
*/ */
// prettier-ignore
export const mockWoz1: ArrayBuffer = new Uint8Array([ export const mockWoz1: ArrayBuffer = new Uint8Array([
// Header // Header
...stringToBytes('WOZ1'), ...stringToBytes('WOZ1'),
0xff, // 7 bit detection 0xff, // 7 bit detection
0x0a, 0x0a, 0x0d, 0x0a, // LF detection
0x0d, 0x00, 0x00, 0x00, 0x00, // CRC
0x0a, // LF detection
0x00,
0x00,
0x00,
0x00, // CRC
// Info chunk // Info chunk
...stringToBytes('INFO'), ...stringToBytes('INFO'),
...numberToBytes(60, 4), // Size ...numberToBytes(60, 4), // Size
@ -173,18 +141,13 @@ export const mockWoz1: ArrayBuffer = new Uint8Array([
* Woz Version 2 * Woz Version 2
*/ */
// prettier-ignore
export const mockWoz2: ArrayBuffer = new Uint8Array([ export const mockWoz2: ArrayBuffer = new Uint8Array([
// Header // Header
...stringToBytes('WOZ2'), ...stringToBytes('WOZ2'),
0xff, // 7 bit detection 0xff, // 7 bit detection
0x0a, 0x0a, 0x0d, 0x0a, // LF detection
0x0d, 0x00, 0x00, 0x00, 0x00, // CRC
0x0a, // LF detection
0x00,
0x00,
0x00,
0x00, // CRC
// Info chunk // Info chunk
...stringToBytes('INFO'), ...stringToBytes('INFO'),
...numberToBytes(mockInfo2.length, 4), // Size ...numberToBytes(mockInfo2.length, 4), // Size

View File

@ -22,12 +22,12 @@ describe('woz', () => {
encoding: ENCODING_BITSTREAM, encoding: ENCODING_BITSTREAM,
format: 'woz', format: 'woz',
trackMap: mockTMAP, trackMap: mockTMAP,
rawTracks: [ // prettier-ignore
new Uint8Array([ rawTracks: [new Uint8Array([
1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1,
0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,
]), 1, 0, 0, 1, 0, 1, 1, 0,
], ])],
info: { info: {
bitTiming: 0, bitTiming: 0,
bootSector: 0, bootSector: 0,
@ -63,12 +63,12 @@ describe('woz', () => {
encoding: ENCODING_BITSTREAM, encoding: ENCODING_BITSTREAM,
format: 'woz', format: 'woz',
trackMap: mockTMAP, trackMap: mockTMAP,
rawTracks: [ // prettier-ignore
new Uint8Array([ rawTracks: [new Uint8Array([
1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1,
0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,
]), 1, 0, 0, 1, 0, 1, 1, 0,
], ])],
info: { info: {
bitTiming: 0, bitTiming: 0,
bootSector: 0, bootSector: 0,

View File

@ -30,30 +30,38 @@ export class Program implements MemoryPages {
} }
} }
export const bios = new Program( // prettier-ignore
0xff, export const bios = new Program(0xff, [
[ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x45, 0x4c, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x4f, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x45, 0x4C, 0x4C, 0x4F, 0x0D, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x04, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
] 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
); 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0x00, 0x04, 0x00, 0xff,
]);