{"id":477,"date":"2013-06-13T16:55:59","date_gmt":"2013-06-13T21:55:59","guid":{"rendered":"http:\/\/snarfblam.com\/words\/?p=477"},"modified":"2013-06-13T16:56:30","modified_gmt":"2013-06-13T21:56:30","slug":"asm-hack-elevator-to-same-level","status":"publish","type":"post","link":"http:\/\/snarfblam.com\/words\/?p=477","title":{"rendered":"ASM Hack: Elevator to Same Level"},"content":{"rendered":"<p>Here is a nice, small hack that allows you to add an elevator to Metroid that, rather than bringing the player to a different level, brings the player to a different part of the same level. This hack is very unlikely to work with any other hack that involves ASM since it uses the memory at $CA35 that everybody (myself included) likes to insert new ASM into. Getting this to work with another hack is a simple matter of moving the code below from $CA35 to somewhere else (it&#8217;s pretty small). Also note that the <code>.PATCH<\/code>es need to be applied to the last bank, which, in an expanded ROM, is bank F, not 7!<!--more--><\/p>\n<p>One last gotcha: Editroid does not directly support the placement of this type of elevator. To place an elevator-to-the-same-level, start by placing an elevator in Editroid, with the elevator type as &#8220;Brinstar to Brinstar&#8221;, and <em>save the ROM<\/em>. Now, using the pointer explorer in the tools menu, go to the level&#8217;s item data, and expand the tree to find the screen containing the elevator. When you select the &#8220;Screen Entry&#8221; in the tree, you&#8217;ll see the elevator listed in the pane on the right, along with an offset and the data <code>04 00<\/code>. Now, open the ROM in a hex editor and go to the offset that was listed in the pointer explorer. For an elevator that goes down, change <code>04 00<\/code> to <code>04 0E<\/code>. For an elevator that goes up, change <code>04 00<\/code> to <code>04 8E<\/code>.<\/p>\n<pre>.PATCH 07:CA35\r\n; New code\r\n    ElevatorCheck:\r\n    cmp #$1E        ; Elevator to same area?\r\n    bne +\r\n        LDA $74     ;     Then set destination area to current area\r\n    jmp $CA18       ; Perform bankswap \r\n\r\n.PATCH 07:D8E7\r\n; Hijack\r\n    jsr ElevatorCheck\r\n\r\n    ;original code\r\n    ;jsr $CA18<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Here is a nice, small hack that allows you to add an elevator to Metroid that, rather than bringing the player to a different level, brings the player to a different part of the same level. This hack is very unlikely to work with any other hack that involves ASM since it uses the memory [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31,25,4,3],"tags":[26,27,17,12,41],"class_list":["post-477","post","type-post","status-publish","format-standard","hentry","category-asm-romhacking","category-editroid-romhacking","category-general","category-romhacking","tag-26","tag-asm","tag-editroid","tag-nes","tag-rom-hacking"],"_links":{"self":[{"href":"http:\/\/snarfblam.com\/words\/index.php?rest_route=\/wp\/v2\/posts\/477","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/snarfblam.com\/words\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/snarfblam.com\/words\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/snarfblam.com\/words\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/snarfblam.com\/words\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=477"}],"version-history":[{"count":7,"href":"http:\/\/snarfblam.com\/words\/index.php?rest_route=\/wp\/v2\/posts\/477\/revisions"}],"predecessor-version":[{"id":484,"href":"http:\/\/snarfblam.com\/words\/index.php?rest_route=\/wp\/v2\/posts\/477\/revisions\/484"}],"wp:attachment":[{"href":"http:\/\/snarfblam.com\/words\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/snarfblam.com\/words\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=477"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/snarfblam.com\/words\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}