Documentation
¶
Overview ¶
Package symbols helps keep track of address symbols. The primary structure for this is the Table type. There are two recommended ways of instantiating this type. NewTable() will create a table instance with the default or canonical Atari 2600 symbol names. For example, AUDC0 refers to the $15 write address.
The second and more flexible way of instantiating the symbols Table is with the ReadSymbolsFile() function. This function will try to read a symbols file for the named cartridge and parse its contents. It will fail silently if it cannot.
ReadSymbolFile() will always give addresses the default or canonised symbol. In this way it is a superset of the NewTable() function.
Index ¶
- type SearchResults
- type SearchTable
- type Symbols
- func (sym *Symbols) AddLabel(bank int, addr uint16, symbol string, prefer bool)
- func (sym *Symbols) GetLabel(bank int, addr uint16) (string, bool)
- func (sym *Symbols) GetReadSymbol(addr uint16) (string, bool)
- func (sym *Symbols) GetWriteSymbol(addr uint16) (string, bool)
- func (sym *Symbols) LabelWidth() int
- func (sym *Symbols) ListLabels(output io.Writer)
- func (sym *Symbols) ListReadSymbols(output io.Writer)
- func (sym *Symbols) ListSymbols(output io.Writer)
- func (sym *Symbols) ListWriteSymbols(output io.Writer)
- func (sym *Symbols) ReverseSearch(addr uint16, target SearchTable) *SearchResults
- func (sym *Symbols) Search(symbol string, target SearchTable) *SearchResults
- func (sym *Symbols) SymbolWidth() int
- func (sym *Symbols) UpdateLabel(bank int, addr uint16, label string)
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SearchResults ¶ added in v0.10.1
type SearchResults struct { Table SearchTable Symbol string Address uint16 }
SearchResults contains the normalised symbol info found in the SearchTable.
type SearchTable ¶ added in v0.10.1
type SearchTable int
SearchTable is used to select and identify a symbol table when searching.
const ( SearchAll SearchTable = iota SearchLabel SearchRead SearchWrite )
List of valid symbol table identifiers.
func (SearchTable) String ¶ added in v0.10.1
func (t SearchTable) String() string
type Symbols ¶ added in v0.7.1
type Symbols struct {
// contains filtered or unexported fields
}
Table is the master symbols table for the loaded programme.
func ReadSymbolsFile ¶
ReadSymbolsFile initialises a symbols table from the symbols file for the specified cartridge. Even in the event of an error the Symbols table will still be usable and will contain the standard 2600 symbols.
Currently, only symbols files generated by DASM are supported.
func (*Symbols) GetReadSymbol ¶ added in v0.10.1
Get symbol from read table.
func (*Symbols) GetWriteSymbol ¶ added in v0.10.1
Get symbol from read table.
func (*Symbols) LabelWidth ¶ added in v0.7.1
func (*Symbols) ListLabels ¶ added in v0.7.1
ListLabels outputs every label used in the current ROM.
func (*Symbols) ListReadSymbols ¶ added in v0.7.1
ListReadSymbols outputs every read symbol used in the current ROM.
func (*Symbols) ListSymbols ¶ added in v0.7.1
ListSymbols outputs every symbol used in the current ROM.
func (*Symbols) ListWriteSymbols ¶ added in v0.7.1
ListWriteSymbols outputs every write symbol used in the current ROM.
func (*Symbols) ReverseSearch ¶ added in v0.10.1
func (sym *Symbols) ReverseSearch(addr uint16, target SearchTable) *SearchResults
ReverseSearch returns the symbol for specified address.
When TableType is SearchAll the search in order: locations > read > write.
func (*Symbols) Search ¶ added in v0.7.1
func (sym *Symbols) Search(symbol string, target SearchTable) *SearchResults
Search return the address of the supplied seartch string.
Matching is case-insensitive and when TableType is SearchAll the search in order: locations > read > write.