Language…
13 users online:  AmperSam,  Ayami,  Donut, Enan63, Green, Joosh,  MarioFanGamer, Rhubarb44230, ShadowMistressYuko,  shovda, signature_steve, Sweetdude, Tomi P - Guests: 253 - Bots: 345
Users: 64,795 (2,378 active)
Latest user: mathew

ASM Help: Secondary Exit Teleport

Does anyone know how to teleport the player with secondary exits?
I know things like:

Teleport to screen exit:

Code
	LDA #$06				; \
	STA $71					; | Teleport the player via screen exit.
	STZ $88					; |
	STZ $89					; /


Teleport to level:

Code
	REP #$20				; \
	LDA #$00xx				; | Teleport the player to level #$00xx.
	%teleport()				; |
	SEP #$20				; /


What's the code for teleport to the secondary exits?


You can control that with the screen exit settings defined in $19D8. Assuming that %teleport() macro is GPS's version, it puts the high byte of A in that address.

You could hence do something like this:

Code
	REP #$20
	LDA #$00xx|$0200
	%teleport()
	SEP #$20

That'll teleport the player to secondary exit xx. For exits in the range of 100-1FFF, see the additional H bits defined in $19D8 and set those as needed.

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer