Apple II Memory Map
This is the rust binding to a database of Apple II special addresses intended to be used with language servers. The central element is the file map.json
which maps addresses to a set of descriptive strings.
Map Records
The map records correspond to the structure
Information is accessed through the opaque struct MemoryMap
. The whole database can be borrowed as a HashMap
as follows:
let a2map = new;
let full_map: & = a2map.get_all;
To get a single record use
let maybe_info: = a2map.get_one;
The argument addr
can range from -32767 to 65535. As an example get_one(0xfded)
will give the rust equivalent of
AddressInfo Fields
brief
: short description suitable for display in a selection boxctx
: notes on limiting context, such as hardware requirements, applicability to given language, etc.desc
: long description suitable for hoverslabel
: suggested assembler labelnote
: any other notessubctx
: notes on sub context, e.g., specific aspect of a languagetype
: data type (e.g.word
) or operation type (e.g.ROM routine
,soft switch
)
Multi-context Records
The map.json
file uses logic expressions to delineate information by context, e.g., ctx
might have the value "Applesoft | Integer BASIC"
. The rust binding provides a function to parse the logic and produce an array of records, with each element corresponding to a given context:
let maybe_records: = a2map.get_one_and_split;
If there is no splitting of the ctx
field, no other fields will be split. It is not required to use this function. If get_one
is used instead, downstream will receive the logic expressions, which can be parsed in any manner desired.