2021-07-07 00:04:02 +00:00
|
|
|
import { memory } from '../../../../js/types';
|
2020-12-29 14:40:40 +00:00
|
|
|
|
|
|
|
function generateBytesInOrder() {
|
2021-07-07 00:04:02 +00:00
|
|
|
const data: memory[][] = [];
|
2020-12-29 14:40:40 +00:00
|
|
|
for (let t = 0; t < 35; t++) {
|
2021-07-07 00:04:02 +00:00
|
|
|
const track: memory[] = [];
|
2020-12-29 14:40:40 +00:00
|
|
|
for (let s = 0; s < 16; s++) {
|
2021-07-07 00:04:02 +00:00
|
|
|
const sector = new Uint8Array(256);
|
2020-12-29 14:40:40 +00:00
|
|
|
for (let b = 0; b < 256; b++) {
|
|
|
|
sector[b] = b;
|
|
|
|
}
|
|
|
|
track[s] = sector;
|
|
|
|
}
|
|
|
|
data[t] = track;
|
|
|
|
}
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
|
2021-07-07 00:04:02 +00:00
|
|
|
export const BYTES_IN_ORDER: memory[][] = generateBytesInOrder();
|
2020-12-29 14:40:40 +00:00
|
|
|
|
|
|
|
function generateBytesBySector() {
|
2021-07-07 00:04:02 +00:00
|
|
|
const data: memory[][] = [];
|
2020-12-29 14:40:40 +00:00
|
|
|
for (let t = 0; t < 35; t++) {
|
2021-07-07 00:04:02 +00:00
|
|
|
const track: memory[] = [];
|
2020-12-29 14:40:40 +00:00
|
|
|
for (let s = 0; s < 16; s++) {
|
2021-07-07 00:04:02 +00:00
|
|
|
const sector = new Uint8Array(256);
|
2020-12-29 14:40:40 +00:00
|
|
|
for (let b = 0; b < 256; b++) {
|
|
|
|
sector[b] = s;
|
|
|
|
}
|
|
|
|
track[s] = sector;
|
|
|
|
}
|
|
|
|
data[t] = track;
|
|
|
|
}
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
|
2021-07-07 00:04:02 +00:00
|
|
|
export const BYTES_BY_SECTOR: memory[][] = generateBytesBySector();
|
2020-12-29 14:40:40 +00:00
|
|
|
|
|
|
|
function generateBytesByTrack() {
|
2021-07-07 00:04:02 +00:00
|
|
|
const data: memory[][] = [];
|
2020-12-29 14:40:40 +00:00
|
|
|
for (let t = 0; t < 35; t++) {
|
2021-07-07 00:04:02 +00:00
|
|
|
const track: memory[] = [];
|
2020-12-29 14:40:40 +00:00
|
|
|
for (let s = 0; s < 16; s++) {
|
2021-07-07 00:04:02 +00:00
|
|
|
const sector = new Uint8Array(256);
|
2020-12-29 14:40:40 +00:00
|
|
|
for (let b = 0; b < 256; b++) {
|
|
|
|
sector[b] = t;
|
|
|
|
}
|
|
|
|
track[s] = sector;
|
|
|
|
}
|
|
|
|
data[t] = track;
|
|
|
|
}
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
|
2021-07-07 00:04:02 +00:00
|
|
|
export const BYTES_BY_TRACK: memory[][] = generateBytesByTrack();
|