Cap creates static and dynamic variables for you, these can be calculated when you access them (e.g. checksums, the result of a find), be information about things in the ROM (e.g. the start/end position of a component), or be values of key parts of ROM data.
Note, when you see brackets in a name that will mean “location of”, e.g. $(KICKSTARTVERSION) is the location in the ROM where the kickstart version is held
ROM data
CapCLI> echo $ROMBASE
0x00f80000
CapCLI> echo $CALCCHECKSUM
0xba5d5fa4
CapCLI> echo $CALCCRC32
0x43b0df7b
CapCLI> echo $(KICKSTARTVERSION)
0x0000000c
Component data
The following inbuilt variables will tell you the location of various parts of the information about the component, if you want to get the actual values, you’ll need to use romdata to grab the data from the ROM.
$libraryname.(START)
$libraryname.(END)
$libraryname.(ROMTAG)
$libraryname.(ROMTAG.MATCHTAG)
$libraryname.(ROMTAG.ENDSKIP)
$libraryname.(ROMTAG.FLAGS)
$libraryname.(ROMTAG.VERSION)
$libraryname.(ROMTAG.TYPE)
$libraryname.(ROMTAG.PRI)
$libraryname.(ROMTAG.NAME)
$libraryname.(ROMTAG.IDSTRING)
$libraryname.(ROMTAG.INIT)
You can grab the value at the locations with the var romdata command, and using the address you can change the value at that location, e.g. to increase the priority of a component;
CapCLI> echo $exec.library.(ROMTAG.PRI)
0x000000c3
CapCLI> var PRI romdata $exec.library.(ROMTAG.PRI) 1
CapCLI> echo $PRI
0x69
CapCLI> var PRI 0x6A
CapCLI> patch $exec.library.(ROMTAG.PRI) $PRI
Patch position is in component number 0 (exec.library)
$libraryname by itself can be used as shortcut for $libraryname.(START) $libraryname.(END), this is useful used with the find command to scan within a library
CapCLI> echo $cia.resource
274624 275640