Documentation ¶
Index ¶
- Constants
- func AddFilesFromHostDirectory(readerWriter ReaderWriterAt, directory string, path string, recursive bool) error
- func ConvertBasicToText(basic []byte) string
- func ConvertImageToHiResColour(imageBytes []byte) []byte
- func ConvertImageToHiResMonochrome(imageBytes []byte) []byte
- func ConvertTextToBasic(text string) ([]byte, error)
- func CreateDirectory(readerWriter ReaderWriterAt, path string) error
- func CreateVolume(readerWriter ReaderWriterAt, volumeName string, numberOfBlocks uint16)
- func DateTimeFromProDOS(buffer []byte) time.Time
- func DateTimeToProDOS(dateTime time.Time) []byte
- func DeleteFile(readerWriter ReaderWriterAt, path string) error
- func DumpBlock(buffer []byte)
- func DumpDirectory(blocksFree uint16, totalBlocks uint16, path string, fileEntries []FileEntry)
- func DumpDirectoryHeader(directoryHeader DirectoryHeader)
- func DumpFileEntry(fileEntry FileEntry)
- func DumpVolumeHeader(volumeHeader VolumeHeader)
- func FileExists(reader io.ReaderAt, path string) (bool, error)
- func FileTypeToString(fileType uint8) string
- func GetDirectoryAndFileNameFromPath(path string) (string, string)
- func GetFreeBlockCount(volumeBitmap []byte, totalBlocks uint16) uint16
- func LoadFile(reader io.ReaderAt, path string) ([]byte, error)
- func ReadBlock(reader io.ReaderAt, block uint16) ([]byte, error)
- func ReadDirectory(reader io.ReaderAt, path string) (VolumeHeader, DirectoryHeader, []FileEntry, error)
- func ReadVolumeBitmap(reader io.ReaderAt) ([]byte, error)
- func TimeToString(printTime time.Time) string
- func WriteBlock(writer io.WriterAt, block uint16, buffer []byte) error
- func WriteFile(readerWriter ReaderWriterAt, path string, fileType uint8, auxType uint16, ...) error
- func WriteFileFromFile(readerWriter ReaderWriterAt, pathName string, fileType uint8, auxType uint16, ...) error
- type DirectoryHeader
- type FileEntry
- type MemoryFile
- type ReaderWriterAt
- type VolumeHeader
Constants ¶
const ( // StorageDeleted signifies file is deleted StorageDeleted = 0 // StorageSeedling signifies file is <= 512 bytes StorageSeedling = 1 // StorageSapling signifies file is > 512 bytes and <= 128 KB StorageSapling = 2 // StorageTree signifies file is > 128 KB and <= 16 MB StorageTree = 3 // StoragePascal signifies pascal storage area StoragePascal = 4 // StorageDirectory signifies directory StorageDirectory = 13 )
Variables ¶
This section is empty.
Functions ¶
func AddFilesFromHostDirectory ¶ added in v0.4.0
func AddFilesFromHostDirectory( readerWriter ReaderWriterAt, directory string, path string, recursive bool, ) error
AddFilesFromHostDirectory fills the root volume with files from the specified host directory
func ConvertBasicToText ¶
ConvertBasicToText converts AppleSoft BASIC to text
func ConvertImageToHiResColour ¶ added in v0.4.3
ConvertImageToHiResColour converts jpeg and png images to Apple II hi-res colour
func ConvertImageToHiResMonochrome ¶ added in v0.4.3
ConvertImageToHiResMonochrome converts jpeg and png images to Apple II hi-res monochrome
func ConvertTextToBasic ¶ added in v0.3.2
ConvertTextToBasic converts text to AppleSoft BASIC
func CreateDirectory ¶ added in v0.4.4
func CreateDirectory(readerWriter ReaderWriterAt, path string) error
CreateDirectory creates a directory information of a specified path on a ProDOS image
func CreateVolume ¶
func CreateVolume(readerWriter ReaderWriterAt, volumeName string, numberOfBlocks uint16)
CreateVolume formats a new ProDOS volume including boot block, volume bitmap and empty directory
func DateTimeFromProDOS ¶
DateTimeFromProDOS converts Time from ProDOS date time
func DateTimeToProDOS ¶
DateTimeToProDOS converts Time to ProDOS date time
49041 ($BF91) 49040 ($BF90) 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ DATE: | year | month | day | +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ 49043 ($BF93) 49042 ($BF92) 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ TIME: | hour | | minute | +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
func DeleteFile ¶
func DeleteFile(readerWriter ReaderWriterAt, path string) error
DeleteFile deletes a file from a ProDOS volume
func DumpDirectory ¶
DumpDirectory displays the directory similar to ProDOS catalog
func DumpDirectoryHeader ¶
func DumpDirectoryHeader(directoryHeader DirectoryHeader)
DumpDirectoryHeader dumps the directory header as text
func DumpFileEntry ¶
func DumpFileEntry(fileEntry FileEntry)
DumpFileEntry dumps the file entry values as text
func DumpVolumeHeader ¶
func DumpVolumeHeader(volumeHeader VolumeHeader)
DumpVolumeHeader dumps the volume header values as text
func FileExists ¶ added in v0.4.4
FileExists return true if the file exists
func FileTypeToString ¶
FileTypeToString display the file type as a string
func GetDirectoryAndFileNameFromPath ¶
GetDirectoryAndFileNameFromPath gets the directory and filename from a path
func GetFreeBlockCount ¶
GetFreeBlockCount gets the number of free blocks on a ProDOS image
func ReadDirectory ¶
func ReadDirectory(reader io.ReaderAt, path string) (VolumeHeader, DirectoryHeader, []FileEntry, error)
ReadDirectory reads the directory information from a specified path on a ProDOS image
func ReadVolumeBitmap ¶
ReadVolumeBitmap reads the volume bitmap from a ProDOS image
func TimeToString ¶
TimeToString displays the date and time in ProDOS format
func WriteBlock ¶
WriteBlock writes a block to a ProDOS volume from a byte array
func WriteFile ¶
func WriteFile(readerWriter ReaderWriterAt, path string, fileType uint8, auxType uint16, createdTime time.Time, modifiedTime time.Time, buffer []byte) error
WriteFile writes a file to a ProDOS volume from a byte array
func WriteFileFromFile ¶ added in v0.4.0
func WriteFileFromFile( readerWriter ReaderWriterAt, pathName string, fileType uint8, auxType uint16, modifiedTime time.Time, inFileName string, cacheDir fs.DirEntry, ignoreDuplicates bool, ) error
WriteFileFromFile writes a file to a ProDOS volume from a host file
Types ¶
type DirectoryHeader ¶
type DirectoryHeader struct { PreviousBlock uint16 NextBlock uint16 IsSubDirectory bool Name string CreationTime time.Time Version uint8 MinVersion uint8 Access uint8 EntryLength uint8 EntriesPerBlock uint8 ActiveFileCount uint16 StartingBlock uint16 ParentBlock uint16 ParentEntry uint16 ParentEntryLength uint8 }
DirectoryHeader from ProDOS
type FileEntry ¶
type FileEntry struct { StorageType uint8 FileName string FileType uint8 CreationTime time.Time KeyPointer uint16 Version uint8 MinVersion uint8 BlocksUsed uint16 EndOfFile uint32 Access uint8 AuxType uint16 ModifiedTime time.Time HeaderPointer uint16 DirectoryBlock uint16 DirectoryOffset uint16 }
FileEntry from ProDOS
type MemoryFile ¶ added in v0.2.0
type MemoryFile struct {
// contains filtered or unexported fields
}
MemoryFile containts file data and size
func NewMemoryFile ¶ added in v0.2.0
func NewMemoryFile(size int) *MemoryFile
NewMemoryFile creates an in-memory file of the specified size in bytes