storage

package
Version: v0.0.0-...-faf97dc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProDosBlockSize is the size of the blocks on the ProDOS devices
	ProDosBlockSize = uint32(512)
)

Variables

This section is empty.

Functions

func IsDiskette

func IsDiskette(filename string) bool

IsDiskette returns true if the files looks like a 5 1/4 diskette

func LoadResource

func LoadResource(filename string) ([]uint8, bool, error)

LoadResource loads in memory a file from the filesystem, http or embedded

Types

type BlockDisk

type BlockDisk struct {
	// contains filtered or unexported fields
}

BlockDisk is any block device with 512 bytes blocks

func OpenBlockDisk

func OpenBlockDisk(filename string) (*BlockDisk, error)

OpenBlockDisk creates a new block device links to a file

func (*BlockDisk) GetSizeInBlocks

func (bd *BlockDisk) GetSizeInBlocks() uint32

GetSizeInBlocks returns the number of blocks of the device

func (*BlockDisk) IsReadOnly

func (bd *BlockDisk) IsReadOnly() bool

IsReadOnly returns true if the device is read only

func (*BlockDisk) Read

func (bd *BlockDisk) Read(block uint32) ([]uint8, error)

func (*BlockDisk) Write

func (bd *BlockDisk) Write(block uint32, data []uint8) error

type Diskette

type Diskette interface {
	PowerOn(cycle uint64)
	PowerOff(cycle uint64)
	Read(quarterTrack int, cycle uint64) uint8
	Write(quarterTrack int, value uint8, cycle uint64)
}

Diskette represents a diskette and it's RW mechanism

func LoadDiskette

func LoadDiskette(filename string) (Diskette, error)

LoadDiskette returns a Diskette by detecting the format

type FileWoz

type FileWoz struct {
	Info woz2Info
	// contains filtered or unexported fields
}

func NewFileWoz

func NewFileWoz(data []uint8) (*FileWoz, error)

func (*FileWoz) DumpTrackAsNib

func (f *FileWoz) DumpTrackAsNib(quarterTrack int) []uint8

func (*FileWoz) DumpTrackAsWoz

func (f *FileWoz) DumpTrackAsWoz(quarterTrack int) []uint8

func (*FileWoz) GetNextBitAndPosition

func (f *FileWoz) GetNextBitAndPosition(position uint32, positionMax uint32, quarterTrack int) (bool, uint32, uint32)

func (*FileWoz) SetBit

func (f *FileWoz) SetBit(value bool, position uint32, positionMax uint32, quarterTrack int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL