Please see the attached test file. I've implemented a teleport routine, based on John Elliott's but in this case, each teleporter has six definition bytes, in turn:
Source room number
Destination room number
So, unlike in John's original routine, the exact position of the teleporter may vary between source and receiver room. Or you could have a teleport which takes Willy from one part of a room to another part of the same room.
y-coordinates are specified in terms of (pixelsx2) from the top (it's probably best if these are cell -aligned i.e. a multiple of #10, although there are a couple of half-aligned examples in the test file i.e. multiples of #08, where Willy falls into or out of a teleporter; x-coordinates in terms of cell-columns in from the left column; all numbers are in hexadecimal.
The subroutine to implement this is at #9718-#9765 (CALLed from #8B70), and the teleporter data are stored at #9767 (number of teleporters in the game) and #9768-#97AF (12 x 6-byte definitions).
There are about twelve teleporters inserted into the test file. They take Willy on a tour of all the 'Forbidden Holy Grounds' in the original game, and then he ends up on The Bow of his Yacht.
Edited by IRF, 19 September 2017 - 07:25 AM.