Documentation
¶
Overview ¶
See https://www.worldofsam.org/products/samdos and https://sam.speccy.cz/systech/sam-coupe_tech-man_v3-0.pdf for details of the disk format
Index ¶
- Constants
- type DiskImage
- func (di *DiskImage) AddCodeFile(name string, data []byte, loadAddress, executionAddress uint32) error
- func (i *DiskImage) DiskJournal() *DiskJournal
- func (di *DiskImage) File(filename string) (*File, error)
- func (di *DiskImage) Save(filename string) error
- func (i *DiskImage) SectorData(sector *Sector) (*SectorData, error)
- func (di *DiskImage) WriteFileEntry(dj *DiskJournal, index int)
- func (di *DiskImage) WriteSector(sector *Sector, sd *SectorData)
- type DiskJournal
- type File
- type FileEntry
- func (fe *FileEntry) CreateHeader() *FileHeader
- func (fe *FileEntry) ExecutionAddress() uint32
- func (fe *FileEntry) GapSize() uint32
- func (fe *FileEntry) Length() uint32
- func (fe *FileEntry) NumericVariablesSize() uint32
- func (fe *FileEntry) Output() error
- func (fe *FileEntry) ProgramLength() uint32
- func (fe *FileEntry) Raw() [0x100]byte
- func (fe *FileEntry) StartAddress() uint32
- func (fe *FileEntry) StringArrayVariablesSize() uint32
- func (fe *FileEntry) Used() bool
- type FileHeader
- type FilePart
- type FileType
- type Filename
- type SAMBasic
- type Sector
- type SectorAddressMap
- type SectorData
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiskImage ¶
type DiskImage [819200]byte
func (*DiskImage) AddCodeFile ¶
func (*DiskImage) DiskJournal ¶
func (i *DiskImage) DiskJournal() *DiskJournal
func (*DiskImage) SectorData ¶
func (i *DiskImage) SectorData(sector *Sector) (*SectorData, error)
func (*DiskImage) WriteFileEntry ¶
func (di *DiskImage) WriteFileEntry(dj *DiskJournal, index int)
func (*DiskImage) WriteSector ¶
func (di *DiskImage) WriteSector(sector *Sector, sd *SectorData)
type DiskJournal ¶
type DiskJournal [80]*FileEntry
func (*DiskJournal) CombinedSectorMap ¶
func (dj *DiskJournal) CombinedSectorMap() *SectorAddressMap
func (*DiskJournal) FreeFileEntries ¶
func (dj *DiskJournal) FreeFileEntries() []int
func (*DiskJournal) Output ¶
func (dj *DiskJournal) Output()
func (*DiskJournal) UsedFileEntries ¶
func (dj *DiskJournal) UsedFileEntries() []int
type File ¶
type File struct {
Header *FileHeader
Body []byte
}
type FileEntry ¶
type FileEntry struct {
Type FileType
Name Filename
Sectors uint16
FirstSector *Sector
SectorAddressMap *SectorAddressMap
FileTypeInfo [11]byte
StartAddressPage uint8
StartAddressPageOffset uint16
Pages uint8
LengthMod16K uint16
ExecutionAddressDiv16K uint8
ExecutionAddressMod16K uint16
SAMBASICStartLine uint16
MGTFlags uint8
MGTFutureAndPast [10]byte
ReservedA [4]byte
ReservedB [11]byte
}
func FileEntryFrom ¶
func (*FileEntry) CreateHeader ¶
func (fe *FileEntry) CreateHeader() *FileHeader
func (*FileEntry) ExecutionAddress ¶
func (*FileEntry) GapSize ¶
GapSize is the size in bytes of the gap that SAM BASIC leaves between the numeric variables and the string/array variables.
func (*FileEntry) NumericVariablesSize ¶
NumericVariablesSize is the size in bytes of the numeric variables section that immediately follows the program text.
func (*FileEntry) ProgramLength ¶
ProgramLength is the size in bytes of the SAM BASIC program text, excluding any variables.
func (*FileEntry) StartAddress ¶
func (*FileEntry) StringArrayVariablesSize ¶
StringArrayVariablesSize is the size in bytes of the string and array variables section, which occupies the remainder of the file after the gap.
type FileHeader ¶
type FileHeader struct {
Type FileType
LengthMod16K uint16
PageOffset uint16
Pages uint8
StartPage uint8
}
func (*FileHeader) Length ¶
func (fileHeader *FileHeader) Length() uint32
func (*FileHeader) Raw ¶
func (fh *FileHeader) Raw() [9]byte
func (*FileHeader) Start ¶
func (fileHeader *FileHeader) Start() uint32
type SectorAddressMap ¶
type SectorAddressMap [195]byte
func (*SectorAddressMap) FreeSectors ¶
func (sam *SectorAddressMap) FreeSectors() []*Sector
func (*SectorAddressMap) Merge ¶
func (sam *SectorAddressMap) Merge(s *SectorAddressMap)
func (*SectorAddressMap) String ¶
func (sam *SectorAddressMap) String() string
func (*SectorAddressMap) UsedSectors ¶
func (sam *SectorAddressMap) UsedSectors() []*Sector
type SectorData ¶
type SectorData [512]byte
func (*SectorData) FilePart ¶
func (data *SectorData) FilePart() *FilePart
Click to show internal directories.
Click to hide internal directories.