Documentation
¶
Index ¶
- Constants
- Variables
- func ApplesoftDetoks(data []byte) []byte
- func ApplesoftTokenize(lines []string) []byte
- func AsciiToPoke(b byte) byte
- func Between(v, lo, hi uint) bool
- func Checksum(b []byte) string
- func Dump(bytes []byte)
- func IntegerDetoks(data []byte) []byte
- func IntegerTokenize(lines []string) []byte
- func PokeToAscii(v uint, usealt bool) int
- func Read16(srcptr, length *int, buffer []byte) int
- func Read8(srcptr, length *int, buffer []byte) byte
- func SectorMapperDOS33(wanted int) int
- func SectorMapperDOS33Alt(wanted int) int
- func SectorMapperDOS33bad(wanted int) int
- func SectorMapperDiversiDOS(wanted int) int
- func SectorMapperLinear(wanted int) int
- func SectorMapperProDOS(wanted int) int
- func StripText(b []byte) []byte
- type CatalogEntry
- type CatalogEntryType
- type DSKContainer
- type DSKWrapper
- func (dsk *DSKWrapper) AppleDOSDeleteFile(name string) error
- func (d *DSKWrapper) AppleDOSGetCatalog(pattern string) (*VTOC, []FileDescriptor, error)
- func (d *DSKWrapper) AppleDOSGetFileSectors(fd FileDescriptor, maxblocks int) ([][2]int, error)
- func (dsk *DSKWrapper) AppleDOSGetFreeSectors(size int) ([][2]int, [][2]int, error)
- func (d *DSKWrapper) AppleDOSGetTSListSectors(fd FileDescriptor, maxblocks int) ([][2]int, error)
- func (d *DSKWrapper) AppleDOSGetVTOC() (*VTOC, error)
- func (d *DSKWrapper) AppleDOSNamedCatalogEntry(name string) (*FileDescriptor, error)
- func (d *DSKWrapper) AppleDOSNextFreeCatalogEntry(name string) (*FileDescriptor, error)
- func (d *DSKWrapper) AppleDOSReadFile(fd FileDescriptor) (int, int, []byte, error)
- func (d *DSKWrapper) AppleDOSReadFileRaw(fd FileDescriptor) (int, int, []byte, error)
- func (d *DSKWrapper) AppleDOSReadFileSectors(fd FileDescriptor, maxblocks int) ([]byte, error)
- func (d *DSKWrapper) AppleDOSRemoveFile(fd *FileDescriptor) error
- func (dsk *DSKWrapper) AppleDOSRenameFile(name, newname string) error
- func (dsk *DSKWrapper) AppleDOSSetLocked(name string, lock bool) error
- func (dsk *DSKWrapper) AppleDOSUsedBitmap() ([]bool, error)
- func (dsk *DSKWrapper) AppleDOSWriteFile(name string, kind FileType, data []byte, loadAddr int) error
- func (d *DSKWrapper) ChecksumDisk() string
- func (d *DSKWrapper) ChecksumSector(t, s int) string
- func (dsk *DSKWrapper) GetNibbles() []byte
- func (d *DSKWrapper) HuntVTOC(t, s int) (int, int)
- func (dsk *DSKWrapper) Identify()
- func (dsk *DSKWrapper) Is2MG() (bool, DiskFormat, SectorOrder, *DSKWrapper)
- func (dsk *DSKWrapper) IsAppleDOS() (bool, DiskFormat, SectorOrder)
- func (d *DSKWrapper) IsChanged() bool
- func (dsk *DSKWrapper) IsPascal() (bool, string)
- func (dsk *DSKWrapper) IsProDOS() (bool, DiskFormat, SectorOrder)
- func (dsk *DSKWrapper) IsRDOS() (bool, RDOSFormat)
- func (d *DSKWrapper) NibbleOffsetToTS(offset int) (int, int)
- func (d *DSKWrapper) Nibblize() []byte
- func (d *DSKWrapper) PRODOS800ChecksumBlock(b int) string
- func (d *DSKWrapper) PRODOS800GetBlock(block int) ([]byte, error)
- func (d *DSKWrapper) PRODOS800GetBlockSectors(block int) (int, int, int)
- func (d *DSKWrapper) PRODOS800GetVDH(b int) (*VDH, error)
- func (dsk *DSKWrapper) PRODOS800GetVolumeBitmap() (ProDOSVolumeBitmap, error)
- func (d *DSKWrapper) PRODOSChecksumBlock(b int) string
- func (dsk *DSKWrapper) PRODOSCreateDirectory(path string, name string) error
- func (dsk *DSKWrapper) PRODOSDeleteDirectory(path string, name string) error
- func (dsk *DSKWrapper) PRODOSDeleteFile(path string, name string) error
- func (dsk *DSKWrapper) PRODOSFindDirBlocks(start int, path string) (*VDH, []int, [][]byte, error)
- func (d *DSKWrapper) PRODOSGetBlock(block int) ([]byte, error)
- func (d *DSKWrapper) PRODOSGetBlockSectors(block int) (int, int, int)
- func (d *DSKWrapper) PRODOSGetCatalog(startblock int, pattern string) (*VDH, []ProDOSFileDescriptor, error)
- func (d *DSKWrapper) PRODOSGetCatalogPathed(start int, path string, pattern string) (*VDH, []ProDOSFileDescriptor, error)
- func (dsk *DSKWrapper) PRODOSGetDirBlocks(start int) (*VDH, []int, [][]byte, error)
- func (dsk *DSKWrapper) PRODOSGetFirstFreeEntry(path string, name string, grow bool) (*ProDOSFileDescriptor, error)
- func (dsk *DSKWrapper) PRODOSGetFreeBlocks(count int, totalBlocks int) ([]int, error)
- func (dsk *DSKWrapper) PRODOSGetNamedEntry(path string, name string) (*ProDOSFileDescriptor, error)
- func (d *DSKWrapper) PRODOSGetVDH(b int) (*VDH, error)
- func (dsk *DSKWrapper) PRODOSGetVolumeBitmap() (ProDOSVolumeBitmap, error)
- func (dsk *DSKWrapper) PRODOSInitDirectoryBlock(targetBlock int, parentBlock int, entriesPerBlock int, entrySize int, ...) error
- func (dsk *DSKWrapper) PRODOSMarkBlocks(list []int, free bool) error
- func (d *DSKWrapper) PRODOSReadFile(fd ProDOSFileDescriptor) (int, int, []byte, error)
- func (d *DSKWrapper) PRODOSReadFileRaw(fd ProDOSFileDescriptor) (int, int, []byte, error)
- func (d *DSKWrapper) PRODOSReadFileSectors(fd ProDOSFileDescriptor, maxblocks int) ([]byte, error)
- func (dsk *DSKWrapper) PRODOSRenameFile(path, name, newname string) error
- func (dsk *DSKWrapper) PRODOSSetLocked(path, name string, lock bool) error
- func (d *DSKWrapper) PRODOSSetVDH(b int, vdh *VDH) error
- func (dsk *DSKWrapper) PRODOSWrite(b int, data []byte) error
- func (dsk *DSKWrapper) PRODOSWriteFile(path string, name string, kind ProDOSFileType, data []byte, auxtype int) error
- func (dsk *DSKWrapper) PRODOSWriteSaplingBlocks(indexBlock int, dataBlocks []int, data []byte) error
- func (dsk *DSKWrapper) PascalGetCatalog(pattern string) ([]*PascalFileEntry, error)
- func (dsk *DSKWrapper) PascalReadFile(file *PascalFileEntry) ([]byte, error)
- func (dsk *DSKWrapper) PascalUsedBitmap() ([]bool, error)
- func (dsk *DSKWrapper) RDOSGetCatalog(pattern string) ([]*RDOSFileDescriptor, error)
- func (dsk *DSKWrapper) RDOSReadFile(file *RDOSFileDescriptor) ([]byte, error)
- func (dsk *DSKWrapper) RDOSUsedBitmap() ([]bool, error)
- func (d *DSKWrapper) Read() []byte
- func (d *DSKWrapper) Seek(t, s int) error
- func (d *DSKWrapper) SetData(data []byte)
- func (dsk *DSKWrapper) SetNibbles(data []byte)
- func (d *DSKWrapper) SetSector(s int) error
- func (d *DSKWrapper) SetSectorPointer()
- func (d *DSKWrapper) SetTrack(t int) error
- func (d *DSKWrapper) UpdateTrack(track int)
- func (d *DSKWrapper) Write(data []byte)
- type DiskFormat
- type DiskFormatID
- type DiskImage
- type FileDescriptor
- func (fd *FileDescriptor) GetTrackSectorListStart() (int, int)
- func (fd *FileDescriptor) IsLocked() bool
- func (fd *FileDescriptor) IsUnused() bool
- func (fd *FileDescriptor) Name() string
- func (fd *FileDescriptor) NameBytes() []byte
- func (fd *FileDescriptor) NameOK() bool
- func (fd *FileDescriptor) NameUnadorned() string
- func (fd *FileDescriptor) Publish(dsk *DSKWrapper) error
- func (fd *FileDescriptor) SetData(data []byte, t, s, o int)
- func (fd *FileDescriptor) SetLocked(b bool)
- func (fd *FileDescriptor) SetName(s string)
- func (fd *FileDescriptor) SetTotalSectors(v int)
- func (fd *FileDescriptor) SetTrackSectorListStart(t, s int)
- func (fd *FileDescriptor) SetType(t FileType)
- func (fd *FileDescriptor) TotalSectors() int
- func (fd *FileDescriptor) Type() FileType
- type FileType
- type Header2MG
- func (h *Header2MG) GetCreatorID() string
- func (h *Header2MG) GetDOSFlags() int
- func (h *Header2MG) GetDiskDataLength() int
- func (h *Header2MG) GetDiskDataStart() int
- func (h *Header2MG) GetHeaderSize() int
- func (h *Header2MG) GetID() string
- func (h *Header2MG) GetImageFormat() int
- func (h *Header2MG) GetProDOSBlocks() int
- func (h *Header2MG) GetVersion() int
- func (h *Header2MG) SetData(data []byte)
- type Nibbler
- type PascalFileEntry
- func (pvh *PascalFileEntry) GetBytesRemaining() int
- func (pvh *PascalFileEntry) GetFileSize() int
- func (pvh *PascalFileEntry) GetName() string
- func (pvh *PascalFileEntry) GetNameLength() int
- func (pvh *PascalFileEntry) GetNextBlock() int
- func (pvh *PascalFileEntry) GetStartBlock() int
- func (pvh *PascalFileEntry) GetType() PascalFileType
- func (pvh *PascalFileEntry) IsLocked() bool
- func (pfe *PascalFileEntry) SetData(data []byte)
- type PascalFileType
- type PascalVolumeHeader
- func (pvh *PascalVolumeHeader) GetName() string
- func (pvh *PascalVolumeHeader) GetNameLength() int
- func (pvh *PascalVolumeHeader) GetNextBlock() int
- func (pvh *PascalVolumeHeader) GetNumFiles() int
- func (pvh *PascalVolumeHeader) GetStartBlock() int
- func (pvh *PascalVolumeHeader) GetTotalBlocks() int
- func (pvh *PascalVolumeHeader) GetType() int
- func (pvh *PascalVolumeHeader) SetData(data []byte)
- type ProDOSAccessMode
- type ProDOSFileDescriptor
- func (fd *ProDOSFileDescriptor) AccessMode() ProDOSAccessMode
- func (fd *ProDOSFileDescriptor) AuxType() int
- func (fd *ProDOSFileDescriptor) CreateTime() time.Time
- func (fd *ProDOSFileDescriptor) GetMinVersion() int
- func (fd *ProDOSFileDescriptor) GetNameLength() int
- func (fd *ProDOSFileDescriptor) GetStorageType() ProDOSStorageType
- func (fd *ProDOSFileDescriptor) GetVersion() int
- func (fd *ProDOSFileDescriptor) HeaderPointer() int
- func (fd *ProDOSFileDescriptor) IndexBlock() int
- func (fd *ProDOSFileDescriptor) IsLocked() bool
- func (fd *ProDOSFileDescriptor) ModTime() time.Time
- func (fd *ProDOSFileDescriptor) Name() string
- func (fd *ProDOSFileDescriptor) NameUnadorned() string
- func (fd *ProDOSFileDescriptor) Publish(dsk *DSKWrapper) error
- func (fd *ProDOSFileDescriptor) SetAccessMode(t ProDOSAccessMode)
- func (fd *ProDOSFileDescriptor) SetAuxType(b int)
- func (fd *ProDOSFileDescriptor) SetCreateTime(t time.Time)
- func (fd *ProDOSFileDescriptor) SetData(data []byte, blockid int, blockoffset int)
- func (fd *ProDOSFileDescriptor) SetHeaderPointer(v int)
- func (fd *ProDOSFileDescriptor) SetIndexBlock(b int)
- func (fd *ProDOSFileDescriptor) SetLocked(b bool)
- func (fd *ProDOSFileDescriptor) SetMinVersion(b int)
- func (fd *ProDOSFileDescriptor) SetModTime(t time.Time)
- func (fd *ProDOSFileDescriptor) SetName(name string)
- func (fd *ProDOSFileDescriptor) SetSize(v int)
- func (fd *ProDOSFileDescriptor) SetStorageType(t ProDOSStorageType)
- func (fd *ProDOSFileDescriptor) SetTotalBlocks(b int)
- func (fd *ProDOSFileDescriptor) SetType(t ProDOSFileType)
- func (fd *ProDOSFileDescriptor) SetVersion(b int)
- func (fd *ProDOSFileDescriptor) Size() int
- func (fd *ProDOSFileDescriptor) TotalBlocks() int
- func (fd *ProDOSFileDescriptor) TotalSectors() int
- func (fd *ProDOSFileDescriptor) Type() ProDOSFileType
- type ProDOSFileType
- type ProDOSStorageType
- type ProDOSVolumeBitmap
- type RDOSFileDescriptor
- func (fd *RDOSFileDescriptor) IsDeleted() bool
- func (fd *RDOSFileDescriptor) IsLocked() bool
- func (fd *RDOSFileDescriptor) IsUnused() bool
- func (fd RDOSFileDescriptor) Length() int
- func (fd RDOSFileDescriptor) LoadAddress() int
- func (fd *RDOSFileDescriptor) Name() string
- func (fd *RDOSFileDescriptor) NameUnadorned() string
- func (fd RDOSFileDescriptor) NumSectors() int
- func (fd *RDOSFileDescriptor) SetData(in []byte)
- func (fd RDOSFileDescriptor) StartSector() int
- func (fd *RDOSFileDescriptor) Type() RDOSFileType
- type RDOSFileType
- type RDOSFormat
- type RDOSFormatSpec
- type SectorOrder
- type VDH
- func (fd *VDH) CreateTime() time.Time
- func (fd *VDH) GetAccess() ProDOSAccessMode
- func (fd *VDH) GetBitmapPointer() int
- func (fd *VDH) GetDirName() string
- func (fd *VDH) GetDirParentEntry() int
- func (fd *VDH) GetDirParentEntryLength() int
- func (fd *VDH) GetDirParentPointer() int
- func (fd *VDH) GetEntriesPerBlock() int
- func (fd *VDH) GetEntryLength() int
- func (fd *VDH) GetFileCount() int
- func (fd *VDH) GetMinVersion() int
- func (fd *VDH) GetNameLength() int
- func (fd *VDH) GetStorageType() ProDOSStorageType
- func (fd *VDH) GetTotalBlocks() int
- func (fd *VDH) GetVersion() int
- func (fd *VDH) GetVolumeName() string
- func (fd *VDH) Publish(dsk *DSKWrapper) error
- func (fd *VDH) SetAccess(m ProDOSAccessMode)
- func (fd *VDH) SetCreateTime(t time.Time)
- func (fd *VDH) SetData(data []byte, blockid, blockoffset int)
- func (fd *VDH) SetDirParentEntry(b int)
- func (fd *VDH) SetDirParentEntryLength(b int)
- func (fd *VDH) SetDirParentPointer(b int)
- func (fd *VDH) SetEntriesPerBlock(b int)
- func (fd *VDH) SetEntryLength(b int)
- func (fd *VDH) SetFileCount(c int)
- func (fd *VDH) SetMinVersion(b int)
- func (fd *VDH) SetName(name string)
- func (fd *VDH) SetNameLength(l int)
- func (fd *VDH) SetStorageType(t ProDOSStorageType)
- func (fd *VDH) SetTotalBlocks(b int)
- func (fd *VDH) SetVersion(b int)
- func (fd *VDH) SetVolumeName(s string)
- type VTOC
- func (fd *VTOC) BytesPerSector() int
- func (fd *VTOC) DumpMap()
- func (fd *VTOC) GetCatalogStart() (int, int)
- func (fd *VTOC) GetDOSVersion() byte
- func (fd *VTOC) GetMaxTSPairsPerSector() int
- func (fd *VTOC) GetSectors() int
- func (fd *VTOC) GetTrackOrder() int
- func (fd *VTOC) GetTracks() int
- func (fd *VTOC) GetVolumeID() byte
- func (fd *VTOC) IsTSFree(t, s int) bool
- func (fd *VTOC) Publish(dsk *DSKWrapper) error
- func (fd *VTOC) SetData(data []byte, t, s int)
- func (fd *VTOC) SetTSFree(t, s int, b bool)
Constants ¶
const DISK_2MG_NIB_LENGTH = DISK_NIBBLE_LENGTH + 0x040
const DISK_2MG_NON_NIB_LENGTH = DISK_PLAIN_LENGTH + 0x040
const DISK_NIBBLE_LENGTH = TRACK_NIBBLE_LENGTH * TRACK_COUNT
const DISK_PLAIN_LENGTH = STD_DISK_BYTES
const HALF_TRACK_COUNT = TRACK_COUNT * 2
const PASCAL_BLOCK_SIZE = 512
const PASCAL_DIRECTORY_ENTRY_LENGTH = 26
const PASCAL_MAX_VOLUME_NAME = 7
const PASCAL_OVERSIZE_DIR = 32
const PASCAL_VOLUME_BLOCK = 2
const PREAMBLE_2MG_SIZE = 0x40
const PRODOS_400KB_BLOCKS = 800
const PRODOS_400KB_DISK_BYTES = STD_BYTES_PER_SECTOR * 2 * PRODOS_400KB_BLOCKS
const PRODOS_800KB_BLOCKS = 1600
const PRODOS_800KB_BLOCKS_PER_TRACK = 20
const PRODOS_800KB_DISK_BYTES = STD_BYTES_PER_SECTOR * 2 * PRODOS_800KB_BLOCKS
const PRODOS_BLOCKS_PER_DISK = 280
const PRODOS_BLOCKS_PER_TRACK = 8
const PRODOS_ENTRY_SIZE = 39
const PRODOS_SECTORS_PER_BLOCK = 2
const RDOS_CATALOG_LENGTH = 0xB
const RDOS_CATALOG_TRACK = 0x01
const RDOS_ENTRY_LENGTH = 0x20
const RDOS_NAME_LENGTH = 0x18
const SECTOR_COUNT = STD_SECTORS_PER_TRACK
const STD_BYTES_PER_SECTOR = 256
const STD_DISK_BYTES = STD_TRACKS_PER_DISK * STD_SECTORS_PER_TRACK * STD_BYTES_PER_SECTOR
const STD_DISK_BYTES_OLD = STD_TRACKS_PER_DISK * STD_SECTORS_PER_TRACK_OLD * STD_BYTES_PER_SECTOR
const STD_SECTORS_PER_TRACK = 16
const STD_SECTORS_PER_TRACK_OLD = 13
const STD_TRACKS_PER_DISK = 35
const TRACK_COUNT = STD_TRACKS_PER_DISK
const TRACK_NIBBLE_LENGTH = 0x1A00
Variables ¶
var ASPartials = map[string]bool{ "COLOR": true, "HCOLOR": true, "SPEED": true, "SCALE": true, "-": true, }
var AppleDOSTypeMap = map[FileType][2]string{ 0x00: [2]string{"TXT", "ASCII Text"}, 0x01: [2]string{"INT", "Integer Basic Program"}, 0x02: [2]string{"BAS", "Applesoft Basic Program"}, 0x04: [2]string{"BIN", "Binary File"}, 0x08: [2]string{"S", "S File Type"}, 0x10: [2]string{"REL", "Relocatable Object Code"}, 0x20: [2]string{"A", "A File Type"}, 0x40: [2]string{"B", "B File Type"}, }
var ApplesoftReverse map[string]int
var ApplesoftTokens = map[int]string{}/* 107 elements not displayed */
var DIVERSE_SECTOR_ORDER = []int{
0x00, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08,
0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x0f,
}
var DOS_32_SECTOR_ORDER = []int{
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0A, 0x0B, 0x0C,
}
var DOS_33_SECTOR_ORDER = []int{
0x00, 0x07, 0x0E, 0x06, 0x0D, 0x05, 0x0C, 0x04,
0x0B, 0x03, 0x0A, 0x02, 0x09, 0x01, 0x08, 0x0F,
}
var IntegerReverse map[string]int
var IntegerTokens = map[int]string{}/* 127 elements not displayed */
var LINEAR_SECTOR_ORDER = []int{
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
}
var NIBBLE_53 = []byte{
0xab, 0xad, 0xae, 0xaf, 0xb5, 0xb6, 0xb7, 0xba,
0xbb, 0xbd, 0xbe, 0xbf, 0xd6, 0xd7, 0xda, 0xdb,
0xdd, 0xde, 0xdf, 0xea, 0xeb, 0xed, 0xee, 0xef,
0xf5, 0xf6, 0xf7, 0xfa, 0xfb, 0xfd, 0xfe, 0xff,
}
var NIBBLE_62 = []byte{
0x96, 0x97, 0x9a, 0x9b, 0x9d, 0x9e, 0x9f, 0xa6,
0xa7, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb2, 0xb3,
0xb4, 0xb5, 0xb6, 0xb7, 0xb9, 0xba, 0xbb, 0xbc,
0xbd, 0xbe, 0xbf, 0xcb, 0xcd, 0xce, 0xcf, 0xd3,
0xd6, 0xd7, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde,
0xdf, 0xe5, 0xe6, 0xe7, 0xe9, 0xea, 0xeb, 0xec,
0xed, 0xee, 0xef, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6,
0xf7, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff}
var PRODOS_SECTOR_ORDER = []int{
0x00, 0x08, 0x01, 0x09, 0x02, 0x0a, 0x03, 0x0b,
0x04, 0x0c, 0x05, 0x0d, 0x06, 0x0e, 0x07, 0x0f,
}
var PascalTypeMap = map[PascalFileType][2]string{ 0x00: [2]string{"UNK", "ASCII Text"}, 0x01: [2]string{"BAD", "Bad Block"}, 0x02: [2]string{"PCD", "Pascal Code"}, 0x03: [2]string{"PTX", "Pascal Text"}, 0x04: [2]string{"PIF", "Pascal Info"}, 0x05: [2]string{"PDA", "Pascal Data"}, 0x06: [2]string{"GRF", "Pascal Graphics"}, 0x07: [2]string{"FOT", "HiRes Graphics"}, 0x08: [2]string{"SEC", "Secure Directory"}, }
var ProDOSTypeMap = map[ProDOSFileType][2]string{}/* 122 elements not displayed */
var RDOSTypeMap = map[RDOSFileType][2]string{ FileType_RDOS_Unknown: [2]string{"UNK", "Unknown"}, FileType_RDOS_AppleSoft: [2]string{"BAS", "Applesoft Basic Program"}, FileType_RDOS_Binary: [2]string{"BIN", "Binary File"}, FileType_RDOS_Text: [2]string{"TXT", "ASCII Text"}, }
var RDOS_SIGNATURE = []byte{ byte('R' + 0x80), byte('D' + 0x80), byte('O' + 0x80), byte('S' + 0x80), byte(' ' + 0x80), }
Functions ¶
func ApplesoftDetoks ¶
func ApplesoftTokenize ¶
func AsciiToPoke ¶
func IntegerDetoks ¶
func IntegerTokenize ¶
func PokeToAscii ¶
func SectorMapperDOS33 ¶
SectoreMapperDOS33 handles the interleaving for dos sectors
func SectorMapperDOS33Alt ¶
func SectorMapperDOS33bad ¶
func SectorMapperDiversiDOS ¶ added in v0.6.0
SectoreMapperProDOS handles the interleaving for dos sectors
func SectorMapperLinear ¶ added in v0.6.0
SectoreMapperDOS33 handles the interleaving for dos sectors
func SectorMapperProDOS ¶
SectoreMapperProDOS handles the interleaving for dos sectors
Types ¶
type CatalogEntry ¶
type CatalogEntryType ¶
type CatalogEntryType int
const ( CETUnknown CatalogEntryType = iota CETBinary CETBasicApplesoft CETBasicInteger CETPascal CETText CETData CETGraphics )
type DSKContainer ¶
type DSKContainer []byte
type DSKWrapper ¶
type DSKWrapper struct { Data DSKContainer Layout SectorOrder CurrentTrack int CurrentSector int SectorPointer int Format DiskFormat RDOSFormat RDOSFormat Filename string //Nibbles []byte Nibbles Nibbler CurrentSectorOrder []int CatalogSectorOrder []int // usually nil but for badly behaved OS: looking at YOU, DiversiDOS... :( WriteProtected bool NibblesChanged bool DOSVolumeID int }
func NewDSKWrapper ¶
func NewDSKWrapper(nibbler Nibbler, filename string) (*DSKWrapper, error)
func NewDSKWrapperBin ¶
func NewDSKWrapperBin(nibbler Nibbler, data []byte, filename string) (*DSKWrapper, error)
func (*DSKWrapper) AppleDOSDeleteFile ¶
func (dsk *DSKWrapper) AppleDOSDeleteFile(name string) error
func (*DSKWrapper) AppleDOSGetCatalog ¶
func (d *DSKWrapper) AppleDOSGetCatalog(pattern string) (*VTOC, []FileDescriptor, error)
func (*DSKWrapper) AppleDOSGetFileSectors ¶
func (d *DSKWrapper) AppleDOSGetFileSectors(fd FileDescriptor, maxblocks int) ([][2]int, error)
func (*DSKWrapper) AppleDOSGetFreeSectors ¶
func (dsk *DSKWrapper) AppleDOSGetFreeSectors(size int) ([][2]int, [][2]int, error)
AppleDOSGetFreeSectors tries to find free sectors for certain size file... Remember, we need space for the T/S list as well...
func (*DSKWrapper) AppleDOSGetTSListSectors ¶
func (d *DSKWrapper) AppleDOSGetTSListSectors(fd FileDescriptor, maxblocks int) ([][2]int, error)
func (*DSKWrapper) AppleDOSGetVTOC ¶
func (d *DSKWrapper) AppleDOSGetVTOC() (*VTOC, error)
func (*DSKWrapper) AppleDOSNamedCatalogEntry ¶
func (d *DSKWrapper) AppleDOSNamedCatalogEntry(name string) (*FileDescriptor, error)
func (*DSKWrapper) AppleDOSNextFreeCatalogEntry ¶
func (d *DSKWrapper) AppleDOSNextFreeCatalogEntry(name string) (*FileDescriptor, error)
func (*DSKWrapper) AppleDOSReadFile ¶
func (d *DSKWrapper) AppleDOSReadFile(fd FileDescriptor) (int, int, []byte, error)
func (*DSKWrapper) AppleDOSReadFileRaw ¶
func (d *DSKWrapper) AppleDOSReadFileRaw(fd FileDescriptor) (int, int, []byte, error)
func (*DSKWrapper) AppleDOSReadFileSectors ¶
func (d *DSKWrapper) AppleDOSReadFileSectors(fd FileDescriptor, maxblocks int) ([]byte, error)
func (*DSKWrapper) AppleDOSRemoveFile ¶
func (d *DSKWrapper) AppleDOSRemoveFile(fd *FileDescriptor) error
func (*DSKWrapper) AppleDOSRenameFile ¶
func (dsk *DSKWrapper) AppleDOSRenameFile(name, newname string) error
func (*DSKWrapper) AppleDOSSetLocked ¶
func (dsk *DSKWrapper) AppleDOSSetLocked(name string, lock bool) error
func (*DSKWrapper) AppleDOSUsedBitmap ¶
func (dsk *DSKWrapper) AppleDOSUsedBitmap() ([]bool, error)
func (*DSKWrapper) AppleDOSWriteFile ¶
func (*DSKWrapper) ChecksumDisk ¶
func (d *DSKWrapper) ChecksumDisk() string
func (*DSKWrapper) ChecksumSector ¶
func (d *DSKWrapper) ChecksumSector(t, s int) string
func (*DSKWrapper) GetNibbles ¶
func (dsk *DSKWrapper) GetNibbles() []byte
func (*DSKWrapper) Identify ¶
func (dsk *DSKWrapper) Identify()
func (*DSKWrapper) Is2MG ¶
func (dsk *DSKWrapper) Is2MG() (bool, DiskFormat, SectorOrder, *DSKWrapper)
func (*DSKWrapper) IsAppleDOS ¶
func (dsk *DSKWrapper) IsAppleDOS() (bool, DiskFormat, SectorOrder)
func (*DSKWrapper) IsChanged ¶
func (d *DSKWrapper) IsChanged() bool
func (*DSKWrapper) IsPascal ¶
func (dsk *DSKWrapper) IsPascal() (bool, string)
func (*DSKWrapper) IsProDOS ¶
func (dsk *DSKWrapper) IsProDOS() (bool, DiskFormat, SectorOrder)
func (*DSKWrapper) IsRDOS ¶
func (dsk *DSKWrapper) IsRDOS() (bool, RDOSFormat)
func (*DSKWrapper) NibbleOffsetToTS ¶
func (d *DSKWrapper) NibbleOffsetToTS(offset int) (int, int)
func (*DSKWrapper) Nibblize ¶
func (d *DSKWrapper) Nibblize() []byte
func (*DSKWrapper) PRODOS800ChecksumBlock ¶
func (d *DSKWrapper) PRODOS800ChecksumBlock(b int) string
func (*DSKWrapper) PRODOS800GetBlock ¶
func (d *DSKWrapper) PRODOS800GetBlock(block int) ([]byte, error)
func (*DSKWrapper) PRODOS800GetBlockSectors ¶
func (d *DSKWrapper) PRODOS800GetBlockSectors(block int) (int, int, int)
func (*DSKWrapper) PRODOS800GetVDH ¶
func (d *DSKWrapper) PRODOS800GetVDH(b int) (*VDH, error)
func (*DSKWrapper) PRODOS800GetVolumeBitmap ¶
func (dsk *DSKWrapper) PRODOS800GetVolumeBitmap() (ProDOSVolumeBitmap, error)
func (*DSKWrapper) PRODOSChecksumBlock ¶
func (d *DSKWrapper) PRODOSChecksumBlock(b int) string
func (*DSKWrapper) PRODOSCreateDirectory ¶
func (dsk *DSKWrapper) PRODOSCreateDirectory(path string, name string) error
PRODOSCreateDirectory tries to create a subdirectory...
func (*DSKWrapper) PRODOSDeleteDirectory ¶
func (dsk *DSKWrapper) PRODOSDeleteDirectory(path string, name string) error
func (*DSKWrapper) PRODOSDeleteFile ¶
func (dsk *DSKWrapper) PRODOSDeleteFile(path string, name string) error
func (*DSKWrapper) PRODOSFindDirBlocks ¶
PRODOSFindDirBlocks locates the blocks for a given directory (if it exists!)
func (*DSKWrapper) PRODOSGetBlock ¶
func (d *DSKWrapper) PRODOSGetBlock(block int) ([]byte, error)
func (*DSKWrapper) PRODOSGetBlockSectors ¶
func (d *DSKWrapper) PRODOSGetBlockSectors(block int) (int, int, int)
func (*DSKWrapper) PRODOSGetCatalog ¶
func (d *DSKWrapper) PRODOSGetCatalog(startblock int, pattern string) (*VDH, []ProDOSFileDescriptor, error)
func (*DSKWrapper) PRODOSGetCatalogPathed ¶
func (d *DSKWrapper) PRODOSGetCatalogPathed(start int, path string, pattern string) (*VDH, []ProDOSFileDescriptor, error)
func (*DSKWrapper) PRODOSGetDirBlocks ¶
PRODOSGetDirBlocks returns a list of blocks for the current directory level
func (*DSKWrapper) PRODOSGetFirstFreeEntry ¶
func (dsk *DSKWrapper) PRODOSGetFirstFreeEntry(path string, name string, grow bool) (*ProDOSFileDescriptor, error)
PRODOSGetFirstFreeEntry for a given path, will find the first free file descriptor it will expand the directory if needed to create a free block
func (*DSKWrapper) PRODOSGetFreeBlocks ¶
func (dsk *DSKWrapper) PRODOSGetFreeBlocks(count int, totalBlocks int) ([]int, error)
func (*DSKWrapper) PRODOSGetNamedEntry ¶
func (dsk *DSKWrapper) PRODOSGetNamedEntry(path string, name string) (*ProDOSFileDescriptor, error)
PRODOSGetNamedEntry for a given path, will find the file descriptor with name
func (*DSKWrapper) PRODOSGetVDH ¶
func (d *DSKWrapper) PRODOSGetVDH(b int) (*VDH, error)
func (*DSKWrapper) PRODOSGetVolumeBitmap ¶
func (dsk *DSKWrapper) PRODOSGetVolumeBitmap() (ProDOSVolumeBitmap, error)
func (*DSKWrapper) PRODOSInitDirectoryBlock ¶
func (*DSKWrapper) PRODOSMarkBlocks ¶
func (dsk *DSKWrapper) PRODOSMarkBlocks(list []int, free bool) error
func (*DSKWrapper) PRODOSReadFile ¶
func (d *DSKWrapper) PRODOSReadFile(fd ProDOSFileDescriptor) (int, int, []byte, error)
func (*DSKWrapper) PRODOSReadFileRaw ¶
func (d *DSKWrapper) PRODOSReadFileRaw(fd ProDOSFileDescriptor) (int, int, []byte, error)
func (*DSKWrapper) PRODOSReadFileSectors ¶
func (d *DSKWrapper) PRODOSReadFileSectors(fd ProDOSFileDescriptor, maxblocks int) ([]byte, error)
func (*DSKWrapper) PRODOSRenameFile ¶
func (dsk *DSKWrapper) PRODOSRenameFile(path, name, newname string) error
func (*DSKWrapper) PRODOSSetLocked ¶
func (dsk *DSKWrapper) PRODOSSetLocked(path, name string, lock bool) error
func (*DSKWrapper) PRODOSSetVDH ¶ added in v0.5.5
func (d *DSKWrapper) PRODOSSetVDH(b int, vdh *VDH) error
func (*DSKWrapper) PRODOSWrite ¶
func (dsk *DSKWrapper) PRODOSWrite(b int, data []byte) error
func (*DSKWrapper) PRODOSWriteFile ¶
func (dsk *DSKWrapper) PRODOSWriteFile(path string, name string, kind ProDOSFileType, data []byte, auxtype int) error
func (*DSKWrapper) PRODOSWriteSaplingBlocks ¶
func (dsk *DSKWrapper) PRODOSWriteSaplingBlocks(indexBlock int, dataBlocks []int, data []byte) error
func (*DSKWrapper) PascalGetCatalog ¶
func (dsk *DSKWrapper) PascalGetCatalog(pattern string) ([]*PascalFileEntry, error)
func (*DSKWrapper) PascalReadFile ¶
func (dsk *DSKWrapper) PascalReadFile(file *PascalFileEntry) ([]byte, error)
func (*DSKWrapper) PascalUsedBitmap ¶
func (dsk *DSKWrapper) PascalUsedBitmap() ([]bool, error)
func (*DSKWrapper) RDOSGetCatalog ¶
func (dsk *DSKWrapper) RDOSGetCatalog(pattern string) ([]*RDOSFileDescriptor, error)
func (*DSKWrapper) RDOSReadFile ¶
func (dsk *DSKWrapper) RDOSReadFile(file *RDOSFileDescriptor) ([]byte, error)
func (*DSKWrapper) RDOSUsedBitmap ¶
func (dsk *DSKWrapper) RDOSUsedBitmap() ([]bool, error)
func (*DSKWrapper) Read ¶
func (d *DSKWrapper) Read() []byte
Read is a simple function to return the current pointed to sector
func (*DSKWrapper) Seek ¶
func (d *DSKWrapper) Seek(t, s int) error
Seek is a convienience function to go straight to a particular track & sector
func (*DSKWrapper) SetData ¶
func (d *DSKWrapper) SetData(data []byte)
func (*DSKWrapper) SetNibbles ¶
func (dsk *DSKWrapper) SetNibbles(data []byte)
func (*DSKWrapper) SetSector ¶
func (d *DSKWrapper) SetSector(s int) error
SetSector changes the sector we are looking at
func (*DSKWrapper) SetSectorPointer ¶
func (d *DSKWrapper) SetSectorPointer()
SetSectorPointer calculates the pointer to the current sector, taking into account the sector interleaving of the DSK image.
func (*DSKWrapper) SetTrack ¶
func (d *DSKWrapper) SetTrack(t int) error
func (*DSKWrapper) UpdateTrack ¶
func (d *DSKWrapper) UpdateTrack(track int)
func (*DSKWrapper) Write ¶
func (d *DSKWrapper) Write(data []byte)
type DiskFormat ¶
type DiskFormat struct { ID DiskFormatID // contains filtered or unexported fields }
func GetDiskFormat ¶
func GetDiskFormat(id DiskFormatID) DiskFormat
func GetPDDiskFormat ¶
func GetPDDiskFormat(id DiskFormatID, blocks int) DiskFormat
func (DiskFormat) BPD ¶
func (df DiskFormat) BPD() int
func (DiskFormat) IsOneOf ¶ added in v0.6.0
func (df DiskFormat) IsOneOf(args ...DiskFormatID) bool
func (DiskFormat) SPT ¶
func (df DiskFormat) SPT() int
func (DiskFormat) String ¶
func (f DiskFormat) String() string
func (DiskFormat) TPD ¶
func (df DiskFormat) TPD() int
func (DiskFormat) USPT ¶
func (df DiskFormat) USPT() int
type DiskFormatID ¶
type DiskFormatID int
const ( DF_NONE DiskFormatID = iota DF_DOS_SECTORS_13 DF_DOS_SECTORS_16 DF_PRODOS DF_PRODOS_800KB DF_PASCAL DF_RDOS_3 DF_RDOS_32 DF_RDOS_33 DF_PRODOS_400KB DF_PRODOS_CUSTOM )
type DiskImage ¶
type DiskImage interface { IsValid() (bool, DiskFormat, SectorOrder) GetCatalog(path string, pattern string) ([]CatalogEntry, error) ReadFile(fd CatalogEntry) (int, []byte, error) StoreFile(fd CatalogEntry) error GetUsedBitmap() ([]bool, error) Nibblize() ([]byte, error) }
type FileDescriptor ¶
type FileDescriptor struct { Data []byte // contains filtered or unexported fields }
func (*FileDescriptor) GetTrackSectorListStart ¶
func (fd *FileDescriptor) GetTrackSectorListStart() (int, int)
func (*FileDescriptor) IsLocked ¶
func (fd *FileDescriptor) IsLocked() bool
func (*FileDescriptor) IsUnused ¶
func (fd *FileDescriptor) IsUnused() bool
func (*FileDescriptor) Name ¶
func (fd *FileDescriptor) Name() string
func (*FileDescriptor) NameBytes ¶
func (fd *FileDescriptor) NameBytes() []byte
func (*FileDescriptor) NameOK ¶
func (fd *FileDescriptor) NameOK() bool
func (*FileDescriptor) NameUnadorned ¶
func (fd *FileDescriptor) NameUnadorned() string
func (*FileDescriptor) Publish ¶
func (fd *FileDescriptor) Publish(dsk *DSKWrapper) error
func (*FileDescriptor) SetData ¶
func (fd *FileDescriptor) SetData(data []byte, t, s, o int)
func (*FileDescriptor) SetLocked ¶
func (fd *FileDescriptor) SetLocked(b bool)
func (*FileDescriptor) SetName ¶
func (fd *FileDescriptor) SetName(s string)
func (*FileDescriptor) SetTotalSectors ¶
func (fd *FileDescriptor) SetTotalSectors(v int)
func (*FileDescriptor) SetTrackSectorListStart ¶
func (fd *FileDescriptor) SetTrackSectorListStart(t, s int)
func (*FileDescriptor) SetType ¶
func (fd *FileDescriptor) SetType(t FileType)
func (*FileDescriptor) TotalSectors ¶
func (fd *FileDescriptor) TotalSectors() int
func (*FileDescriptor) Type ¶
func (fd *FileDescriptor) Type() FileType
type Header2MG ¶
type Header2MG struct {
Data [64]byte
}
func (*Header2MG) GetCreatorID ¶
func (*Header2MG) GetDOSFlags ¶
func (*Header2MG) GetDiskDataLength ¶
func (*Header2MG) GetDiskDataStart ¶
func (*Header2MG) GetHeaderSize ¶
func (*Header2MG) GetImageFormat ¶
func (*Header2MG) GetProDOSBlocks ¶
func (*Header2MG) GetVersion ¶
type PascalFileEntry ¶
type PascalFileEntry struct {
// contains filtered or unexported fields
}
func (*PascalFileEntry) GetBytesRemaining ¶
func (pvh *PascalFileEntry) GetBytesRemaining() int
func (*PascalFileEntry) GetFileSize ¶
func (pvh *PascalFileEntry) GetFileSize() int
func (*PascalFileEntry) GetName ¶
func (pvh *PascalFileEntry) GetName() string
func (*PascalFileEntry) GetNameLength ¶
func (pvh *PascalFileEntry) GetNameLength() int
func (*PascalFileEntry) GetNextBlock ¶
func (pvh *PascalFileEntry) GetNextBlock() int
func (*PascalFileEntry) GetStartBlock ¶
func (pvh *PascalFileEntry) GetStartBlock() int
func (*PascalFileEntry) GetType ¶
func (pvh *PascalFileEntry) GetType() PascalFileType
func (*PascalFileEntry) IsLocked ¶
func (pvh *PascalFileEntry) IsLocked() bool
func (*PascalFileEntry) SetData ¶
func (pfe *PascalFileEntry) SetData(data []byte)
type PascalFileType ¶
type PascalFileType int
const ( FileType_PAS_NONE PascalFileType = 0 FileType_PAS_BADD PascalFileType = 1 FileType_PAS_CODE PascalFileType = 2 FileType_PAS_TEXT PascalFileType = 3 FileType_PAS_INFO PascalFileType = 4 FileType_PAS_DATA PascalFileType = 5 FileType_PAS_GRAF PascalFileType = 6 FileType_PAS_FOTO PascalFileType = 7 FileType_PAS_SECD PascalFileType = 8 )
func PascalFileTypeFromExt ¶
func PascalFileTypeFromExt(ext string) PascalFileType
func (PascalFileType) Ext ¶
func (ft PascalFileType) Ext() string
func (PascalFileType) String ¶
func (ft PascalFileType) String() string
type PascalVolumeHeader ¶
type PascalVolumeHeader struct {
// contains filtered or unexported fields
}
func (*PascalVolumeHeader) GetName ¶
func (pvh *PascalVolumeHeader) GetName() string
func (*PascalVolumeHeader) GetNameLength ¶
func (pvh *PascalVolumeHeader) GetNameLength() int
func (*PascalVolumeHeader) GetNextBlock ¶
func (pvh *PascalVolumeHeader) GetNextBlock() int
func (*PascalVolumeHeader) GetNumFiles ¶
func (pvh *PascalVolumeHeader) GetNumFiles() int
func (*PascalVolumeHeader) GetStartBlock ¶
func (pvh *PascalVolumeHeader) GetStartBlock() int
func (*PascalVolumeHeader) GetTotalBlocks ¶
func (pvh *PascalVolumeHeader) GetTotalBlocks() int
func (*PascalVolumeHeader) GetType ¶
func (pvh *PascalVolumeHeader) GetType() int
func (*PascalVolumeHeader) SetData ¶
func (pvh *PascalVolumeHeader) SetData(data []byte)
type ProDOSAccessMode ¶
type ProDOSAccessMode byte
const ( AccessType_Destroy ProDOSAccessMode = 0x80 AccessType_Rename ProDOSAccessMode = 0x40 AccessType_Changed ProDOSAccessMode = 0x20 AccessType_Writable ProDOSAccessMode = 0x02 AccessType_Readable ProDOSAccessMode = 0x01 // AccessType_Default ProDOSAccessMode = AccessType_Readable | AccessType_Writable | AccessType_Rename | AccessType_Destroy )
type ProDOSFileDescriptor ¶
type ProDOSFileDescriptor struct { Data []byte // contains filtered or unexported fields }
-- Prodos file descriptor
func (*ProDOSFileDescriptor) AccessMode ¶
func (fd *ProDOSFileDescriptor) AccessMode() ProDOSAccessMode
func (*ProDOSFileDescriptor) AuxType ¶
func (fd *ProDOSFileDescriptor) AuxType() int
func (*ProDOSFileDescriptor) CreateTime ¶
func (fd *ProDOSFileDescriptor) CreateTime() time.Time
func (*ProDOSFileDescriptor) GetMinVersion ¶
func (fd *ProDOSFileDescriptor) GetMinVersion() int
func (*ProDOSFileDescriptor) GetNameLength ¶
func (fd *ProDOSFileDescriptor) GetNameLength() int
func (*ProDOSFileDescriptor) GetStorageType ¶
func (fd *ProDOSFileDescriptor) GetStorageType() ProDOSStorageType
func (*ProDOSFileDescriptor) GetVersion ¶
func (fd *ProDOSFileDescriptor) GetVersion() int
func (*ProDOSFileDescriptor) HeaderPointer ¶
func (fd *ProDOSFileDescriptor) HeaderPointer() int
func (*ProDOSFileDescriptor) IndexBlock ¶
func (fd *ProDOSFileDescriptor) IndexBlock() int
func (*ProDOSFileDescriptor) IsLocked ¶
func (fd *ProDOSFileDescriptor) IsLocked() bool
func (*ProDOSFileDescriptor) ModTime ¶
func (fd *ProDOSFileDescriptor) ModTime() time.Time
func (*ProDOSFileDescriptor) Name ¶
func (fd *ProDOSFileDescriptor) Name() string
func (*ProDOSFileDescriptor) NameUnadorned ¶
func (fd *ProDOSFileDescriptor) NameUnadorned() string
func (*ProDOSFileDescriptor) Publish ¶
func (fd *ProDOSFileDescriptor) Publish(dsk *DSKWrapper) error
func (*ProDOSFileDescriptor) SetAccessMode ¶
func (fd *ProDOSFileDescriptor) SetAccessMode(t ProDOSAccessMode)
func (*ProDOSFileDescriptor) SetAuxType ¶
func (fd *ProDOSFileDescriptor) SetAuxType(b int)
func (*ProDOSFileDescriptor) SetCreateTime ¶
func (fd *ProDOSFileDescriptor) SetCreateTime(t time.Time)
func (*ProDOSFileDescriptor) SetData ¶
func (fd *ProDOSFileDescriptor) SetData(data []byte, blockid int, blockoffset int)
func (*ProDOSFileDescriptor) SetHeaderPointer ¶
func (fd *ProDOSFileDescriptor) SetHeaderPointer(v int)
func (*ProDOSFileDescriptor) SetIndexBlock ¶
func (fd *ProDOSFileDescriptor) SetIndexBlock(b int)
func (*ProDOSFileDescriptor) SetLocked ¶
func (fd *ProDOSFileDescriptor) SetLocked(b bool)
func (*ProDOSFileDescriptor) SetMinVersion ¶
func (fd *ProDOSFileDescriptor) SetMinVersion(b int)
func (*ProDOSFileDescriptor) SetModTime ¶
func (fd *ProDOSFileDescriptor) SetModTime(t time.Time)
func (*ProDOSFileDescriptor) SetName ¶
func (fd *ProDOSFileDescriptor) SetName(name string)
func (*ProDOSFileDescriptor) SetSize ¶
func (fd *ProDOSFileDescriptor) SetSize(v int)
func (*ProDOSFileDescriptor) SetStorageType ¶
func (fd *ProDOSFileDescriptor) SetStorageType(t ProDOSStorageType)
func (*ProDOSFileDescriptor) SetTotalBlocks ¶
func (fd *ProDOSFileDescriptor) SetTotalBlocks(b int)
func (*ProDOSFileDescriptor) SetType ¶
func (fd *ProDOSFileDescriptor) SetType(t ProDOSFileType)
func (*ProDOSFileDescriptor) SetVersion ¶
func (fd *ProDOSFileDescriptor) SetVersion(b int)
func (*ProDOSFileDescriptor) Size ¶
func (fd *ProDOSFileDescriptor) Size() int
func (*ProDOSFileDescriptor) TotalBlocks ¶
func (fd *ProDOSFileDescriptor) TotalBlocks() int
func (*ProDOSFileDescriptor) TotalSectors ¶
func (fd *ProDOSFileDescriptor) TotalSectors() int
func (*ProDOSFileDescriptor) Type ¶
func (fd *ProDOSFileDescriptor) Type() ProDOSFileType
type ProDOSFileType ¶
type ProDOSFileType byte
const ( FileType_PD_None ProDOSFileType = 0x00 FileType_PD_TXT ProDOSFileType = 0x04 FileType_PD_Directory ProDOSFileType = 0x0f FileType_PD_BIN ProDOSFileType = 0x06 FileType_PD_INT ProDOSFileType = 0xfa FileType_PD_INT_Var ProDOSFileType = 0xfb FileType_PD_APP ProDOSFileType = 0xfc FileType_PD_APP_Var ProDOSFileType = 0xfd FileType_PD_Reloc ProDOSFileType = 0xfe FileType_PD_SYS ProDOSFileType = 0xff )
func ProDOSFileTypeFromExt ¶
func ProDOSFileTypeFromExt(ext string) ProDOSFileType
func (ProDOSFileType) Ext ¶
func (ft ProDOSFileType) Ext() string
func (ProDOSFileType) String ¶
func (t ProDOSFileType) String() string
func (ProDOSFileType) Valid ¶
func (t ProDOSFileType) Valid() bool
type ProDOSStorageType ¶
type ProDOSStorageType byte
const ( StorageType_Inactive ProDOSStorageType = 0x0 StorageType_Seedling ProDOSStorageType = 0x1 StorageType_Sapling ProDOSStorageType = 0x2 StorageType_Tree ProDOSStorageType = 0x3 StorageType_SubDir_File ProDOSStorageType = 0xd StorageType_SubDir_Header ProDOSStorageType = 0xe StorageType_Volume_Header ProDOSStorageType = 0xf )
type ProDOSVolumeBitmap ¶
type ProDOSVolumeBitmap struct { Data []byte // contains filtered or unexported fields }
func (ProDOSVolumeBitmap) IsBlockFree ¶
func (vb ProDOSVolumeBitmap) IsBlockFree(b int) bool
func (ProDOSVolumeBitmap) SetBlockFree ¶
func (vb ProDOSVolumeBitmap) SetBlockFree(b int, free bool)
type RDOSFileDescriptor ¶
type RDOSFileDescriptor struct {
// contains filtered or unexported fields
}
func (*RDOSFileDescriptor) IsDeleted ¶
func (fd *RDOSFileDescriptor) IsDeleted() bool
func (*RDOSFileDescriptor) IsLocked ¶
func (fd *RDOSFileDescriptor) IsLocked() bool
func (*RDOSFileDescriptor) IsUnused ¶
func (fd *RDOSFileDescriptor) IsUnused() bool
func (RDOSFileDescriptor) Length ¶
func (fd RDOSFileDescriptor) Length() int
func (RDOSFileDescriptor) LoadAddress ¶
func (fd RDOSFileDescriptor) LoadAddress() int
func (*RDOSFileDescriptor) Name ¶
func (fd *RDOSFileDescriptor) Name() string
func (*RDOSFileDescriptor) NameUnadorned ¶
func (fd *RDOSFileDescriptor) NameUnadorned() string
func (RDOSFileDescriptor) NumSectors ¶
func (fd RDOSFileDescriptor) NumSectors() int
func (*RDOSFileDescriptor) SetData ¶
func (fd *RDOSFileDescriptor) SetData(in []byte)
func (RDOSFileDescriptor) StartSector ¶
func (fd RDOSFileDescriptor) StartSector() int
func (*RDOSFileDescriptor) Type ¶
func (fd *RDOSFileDescriptor) Type() RDOSFileType
type RDOSFileType ¶
type RDOSFileType int
const ( FileType_RDOS_Unknown RDOSFileType = iota FileType_RDOS_AppleSoft FileType_RDOS_Binary FileType_RDOS_Text )
func RDOSFileTypeFromExt ¶
func RDOSFileTypeFromExt(ext string) RDOSFileType
func (RDOSFileType) Ext ¶
func (ft RDOSFileType) Ext() string
func (RDOSFileType) String ¶
func (ft RDOSFileType) String() string
type RDOSFormat ¶
type RDOSFormat int
const ( RDOS_Unknown RDOSFormat = iota RDOS_3 RDOS_32 RDOS_33 )
func (RDOSFormat) Spec ¶
func (f RDOSFormat) Spec() *RDOSFormatSpec
func (RDOSFormat) String ¶
func (f RDOSFormat) String() string
type RDOSFormatSpec ¶
type RDOSFormatSpec struct { SectorStride int SectorMax int CatalogTrack int CatalogSector int Ordering SectorOrder }
type SectorOrder ¶
type SectorOrder int
const ( SectorOrderDOS33 SectorOrder = iota SectorOrderDOS32 SectorOrderDOS33Alt SectorOrderProDOS SectorOrderProDOSLinear SectorOrderDiversiDOS )
func (SectorOrder) String ¶
func (so SectorOrder) String() string
type VDH ¶
type VDH struct { Data []byte // contains filtered or unexported fields }
func (*VDH) CreateTime ¶
func (*VDH) GetAccess ¶
func (fd *VDH) GetAccess() ProDOSAccessMode
func (*VDH) GetBitmapPointer ¶
func (*VDH) GetDirName ¶
func (*VDH) GetDirParentEntry ¶
func (*VDH) GetDirParentEntryLength ¶
func (*VDH) GetDirParentPointer ¶
func (*VDH) GetEntriesPerBlock ¶
func (*VDH) GetEntryLength ¶
func (*VDH) GetFileCount ¶
func (*VDH) GetMinVersion ¶
func (*VDH) GetNameLength ¶
func (*VDH) GetStorageType ¶
func (fd *VDH) GetStorageType() ProDOSStorageType
func (*VDH) GetTotalBlocks ¶
func (*VDH) GetVersion ¶
func (*VDH) GetVolumeName ¶
func (*VDH) Publish ¶
func (fd *VDH) Publish(dsk *DSKWrapper) error
func (*VDH) SetAccess ¶
func (fd *VDH) SetAccess(m ProDOSAccessMode)
func (*VDH) SetCreateTime ¶
func (*VDH) SetDirParentEntry ¶
func (*VDH) SetDirParentEntryLength ¶
func (*VDH) SetDirParentPointer ¶
func (*VDH) SetEntriesPerBlock ¶
func (*VDH) SetEntryLength ¶
func (*VDH) SetFileCount ¶
func (*VDH) SetMinVersion ¶
func (*VDH) SetNameLength ¶ added in v0.5.5
func (*VDH) SetStorageType ¶
func (fd *VDH) SetStorageType(t ProDOSStorageType)
func (*VDH) SetTotalBlocks ¶
func (*VDH) SetVersion ¶
func (*VDH) SetVolumeName ¶ added in v0.5.5
type VTOC ¶
type VTOC struct { Data [256]byte // contains filtered or unexported fields }
func (*VTOC) BytesPerSector ¶
func (*VTOC) GetCatalogStart ¶
func (*VTOC) GetDOSVersion ¶
func (*VTOC) GetMaxTSPairsPerSector ¶
func (*VTOC) GetSectors ¶
func (*VTOC) GetTrackOrder ¶
func (*VTOC) GetVolumeID ¶
func (*VTOC) Publish ¶
func (fd *VTOC) Publish(dsk *DSKWrapper) error