{"id":903,"date":"2025-06-20T15:12:02","date_gmt":"2025-06-20T14:12:02","guid":{"rendered":"http:\/\/capitoline.twocatsblack.com\/?page_id=903"},"modified":"2025-06-20T15:27:14","modified_gmt":"2025-06-20T14:27:14","slug":"capcli-variable-inbuilt","status":"publish","type":"page","link":"http:\/\/capitoline.twocatsblack.com\/index.php\/capcli-variable-inbuilt\/","title":{"rendered":"CapCLI: Variable (inbuilt)"},"content":{"rendered":"\n<p>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.<\/p>\n\n\n\n<p>Note, when you see brackets in a name that will mean &#8220;location of&#8221;, e.g. $(KICKSTARTVERSION) is the location in the ROM where the kickstart version is held<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">ROM data<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>CapCLI> <strong>echo $ROMBASE<\/strong>\n0x00f80000\nCapCLI> <strong>echo $CALCCHECKSUM<\/strong>\n0xba5d5fa4\nCapCLI> <strong>echo $CALCCRC32<\/strong>\n0x43b0df7b\nCapCLI> <strong>echo $(KICKSTARTVERSION)<\/strong>\n0x0000000c<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Component data<\/h4>\n\n\n\n<p>The following inbuilt variables will tell you the <em>location <\/em>of various parts of the information about the component, if you want to get the actual values, you&#8217;ll need to use romdata to grab the data from the ROM.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>$libraryname.(START)<\/strong>\n<strong>$libraryname.(END)<\/strong>\n<strong>$libraryname.(ROMTAG)<\/strong>\n<strong>$libraryname.(ROMTAG.MATCHTAG)<\/strong>\n<strong>$libraryname.(ROMTAG.ENDSKIP)<\/strong>\n<strong>$libraryname.(ROMTAG.FLAGS)<\/strong>\n<strong>$libraryname.(ROMTAG.VERSION)<\/strong>\n<strong>$libraryname.(ROMTAG.TYPE)<\/strong>\n<strong>$libraryname.(ROMTAG.PRI)<\/strong>\n<strong>$libraryname.(ROMTAG.NAME)<\/strong>\n<strong>$libraryname.(ROMTAG.IDSTRING)<\/strong>\n<strong>$libraryname.(ROMTAG.INIT)<\/strong><\/code><\/pre>\n\n\n\n<p>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;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CapCLI> <strong>echo $exec.library.(ROMTAG.PRI)<\/strong>\n0x000000c3\nCapCLI> <strong>var PRI romdata $exec.library.(ROMTAG.PRI) 1<\/strong>\nCapCLI> <strong>echo $PRI<\/strong>\n0x69\nCapCLI> <strong>var PRI 0x6A<\/strong>\nCapCLI> <strong>patch $exec.library.(ROMTAG.PRI) $PRI<\/strong>\nPatch position is in component number 0 (exec.library)<\/code><\/pre>\n\n\n\n<p>$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<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CapCLI> <strong>echo $cia.resource<\/strong>\n274624 275640<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"http:\/\/capitoline.twocatsblack.com\/index.php\/capcli-variable-inbuilt\/\"> <span class=\"screen-reader-text\">CapCLI: Variable (inbuilt)<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"class_list":["post-903","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/capitoline.twocatsblack.com\/index.php\/wp-json\/wp\/v2\/pages\/903","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/capitoline.twocatsblack.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/capitoline.twocatsblack.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/capitoline.twocatsblack.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/capitoline.twocatsblack.com\/index.php\/wp-json\/wp\/v2\/comments?post=903"}],"version-history":[{"count":2,"href":"http:\/\/capitoline.twocatsblack.com\/index.php\/wp-json\/wp\/v2\/pages\/903\/revisions"}],"predecessor-version":[{"id":906,"href":"http:\/\/capitoline.twocatsblack.com\/index.php\/wp-json\/wp\/v2\/pages\/903\/revisions\/906"}],"wp:attachment":[{"href":"http:\/\/capitoline.twocatsblack.com\/index.php\/wp-json\/wp\/v2\/media?parent=903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}