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’s pretty small). Also note that the
.PATCHes need to be applied to the last bank, which, in an expanded ROM, is bank F, not 7!
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 “Brinstar to Brinstar”, and save the ROM. Now, using the pointer explorer in the tools menu, go to the level’s item data, and expand the tree to find the screen containing the elevator. When you select the “Screen Entry” in the tree, you’ll see the elevator listed in the pane on the right, along with an offset and the data
04 00. 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
04 00 to
04 0E. For an elevator that goes up, change
04 00 to
.PATCH 07:CA35 ; New code ElevatorCheck: cmp #$1E ; Elevator to same area? bne + LDA $74 ; Then set destination area to current area jmp $CA18 ; Perform bankswap .PATCH 07:D8E7 ; Hijack jsr ElevatorCheck ;original code ;jsr $CA18