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 Table
- func (tbl *Table) ListLocations(output io.Writer)
- func (tbl *Table) ListReadSymbols(output io.Writer)
- func (tbl *Table) ListSymbols(output io.Writer)
- func (tbl *Table) ListWriteSymbols(output io.Writer)
- func (tbl *Table) SearchSymbol(symbol string, target TableType) (TableType, string, uint16, error)
- type TableType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Table ¶
type Table struct {
// the master table is made up of three sub-tables
Locations *symTable
Read *symTable
Write *symTable
// use max width values to help with formatting
MaxLocationWidth int
MaxSymbolWidth int
}
Table is the master symbols table for the loaded programme
func NewTable ¶
func NewTable() *Table
NewTable is the preferred method of initialisation for the Table type. In many instances however, ReadSymbolsFile() might be more appropriate. Naked initalisation of the Table type (ie. &Table{}) will rarely be useful.
func ReadSymbolsFile ¶
ReadSymbolsFile initialises a symbols table from the symbols file for the specified cartridge
Table instance will always be valid even if error is returned. for example, if the symbols file cannot be opened the symbols file will still contain the canonical vcs symbols file
Currently, only symbols files generated by DASM are supported
func (*Table) ListLocations ¶
ListLocations outputs every location symbol used in the current ROM
func (*Table) ListReadSymbols ¶
ListReadSymbols outputs every read symbol used in the current ROM
func (*Table) ListSymbols ¶
ListSymbols outputs every symbol used in the current ROM
func (*Table) ListWriteSymbols ¶
ListWriteSymbols outputs every write symbol used in the current ROM