2021-07-10 00:54:27 +00:00
|
|
|
import { memory } from 'js/types';
|
2021-01-03 23:01:30 +00:00
|
|
|
|
|
|
|
function generateBytesInOrder() {
|
2021-07-07 00:04:02 +00:00
|
|
|
const data: memory[][] = [];
|
2021-01-03 23:01:30 +00:00
|
|
|
for (let t = 0; t < 35; t++) {
|
2021-07-07 00:04:02 +00:00
|
|
|
const track: memory[] = [];
|
2021-01-03 23:01:30 +00:00
|
|
|
for (let s = 0; s < 13; s++) {
|
2021-07-07 00:04:02 +00:00
|
|
|
const sector: memory = new Uint8Array(256);
|
2021-01-03 23:01:30 +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();
|
2021-01-03 23:01:30 +00:00
|
|
|
|
|
|
|
function generateBytesBySector() {
|
2021-07-07 00:04:02 +00:00
|
|
|
const data: memory[][] = [];
|
2021-01-03 23:01:30 +00:00
|
|
|
for (let t = 0; t < 35; t++) {
|
2021-07-07 00:04:02 +00:00
|
|
|
const track: memory[] = [];
|
2021-01-03 23:01:30 +00:00
|
|
|
for (let s = 0; s < 13; s++) {
|
2021-07-07 00:04:02 +00:00
|
|
|
const sector: memory = new Uint8Array(256);
|
2021-01-03 23:01:30 +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();
|
2021-01-03 23:01:30 +00:00
|
|
|
|
|
|
|
function generateBytesByTrack() {
|
2021-07-07 00:04:02 +00:00
|
|
|
const data: memory[][] = [];
|
2021-01-03 23:01:30 +00:00
|
|
|
for (let t = 0; t < 35; t++) {
|
2021-07-07 00:04:02 +00:00
|
|
|
const track: memory[] = [];
|
2021-01-03 23:01:30 +00:00
|
|
|
for (let s = 0; s < 13; s++) {
|
2021-07-07 00:04:02 +00:00
|
|
|
const sector: memory = new Uint8Array(256);
|
2021-01-03 23:01:30 +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();
|