encoding woz -> bitstream

This commit is contained in:
Will Scullin 2021-06-27 07:30:10 -07:00
parent 8fd340725e
commit ec869ff9b9
No known key found for this signature in database
GPG Key ID: 26DCD1042C6638CD
3 changed files with 8 additions and 8 deletions

View File

@ -31,7 +31,7 @@ import {
PROCESS_BINARY,
PROCESS_JSON_DISK,
PROCESS_JSON,
ENCODING_WOZ,
ENCODING_BITSTREAM,
} from '../formats/types';
import {
@ -194,7 +194,7 @@ interface BaseDrive {
/** WOZ format track data from https://applesaucefdc.com/woz/reference2/. */
interface WozDrive extends BaseDrive {
/** Woz encoding */
encoding: typeof ENCODING_WOZ
encoding: typeof ENCODING_BITSTREAM
/** Maps quarter tracks to data in rawTracks; `0xFF` = random garbage. */
trackMap: byte[];
/** Unique track bitstreams. The index is arbitrary; it is NOT the track number. */
@ -221,7 +221,7 @@ function isWozDrive(drive: Drive): drive is WozDrive {
interface DriveState {
format: DiskFormat,
encoding: typeof ENCODING_WOZ | typeof ENCODING_NIBBLE
encoding: typeof ENCODING_BITSTREAM | typeof ENCODING_NIBBLE
volume: byte,
name: string,
tracks: memory[],
@ -294,7 +294,7 @@ function setDriveState(state: DriveState) {
} else {
result = {
format: state.format,
encoding: ENCODING_WOZ,
encoding: ENCODING_BITSTREAM,
volume: state.volume,
name: state.name,
track: state.track,

View File

@ -39,7 +39,7 @@ export interface Disk {
}
export const ENCODING_NIBBLE = 'nibble';
export const ENCODING_WOZ = 'woz';
export const ENCODING_BITSTREAM = 'bitstream';
export const ENCODING_BLOCK = 'block';
export interface NibbleDisk extends Disk {
@ -50,7 +50,7 @@ export interface NibbleDisk extends Disk {
}
export interface WozDisk extends Disk {
encoding: typeof ENCODING_WOZ
encoding: typeof ENCODING_BITSTREAM
trackMap: number[]
rawTracks: bit[][]
}

View File

@ -10,7 +10,7 @@
*/
import { debug, toHex } from '../util';
import { ENCODING_WOZ } from './types';
import { ENCODING_BITSTREAM } from './types';
const WOZ_HEADER_START = 0;
const WOZ_HEADER_SIZE = 12;
@ -195,7 +195,7 @@ export default function Woz(options) {
let dvOffset = 0;
const disk = {
format: 'woz',
encoding: ENCODING_WOZ,
encoding: ENCODING_BITSTREAM,
};
let wozVersion;