Main Menu
Main Page
Forums
Recent changes
Random page
Help

Databases
GlitchDex
AttackDex
ItemDex
TrainerDex
TypeDex
UnownDex
More

Major Glitches
Trainer escape glitch
Old man trick
Celebi Egg trick
Select glitches (Japan)
SRAM glitch
CoolTrainer♀ corruption
LOL glitch
Rival LOL glitch
Super Glitch
ZZAZZ glitch
Pomeg corruption glitch (Glitzer Popping)
Tweaking
Elite Four door glitch (Japan)
Pokémon merge glitch
Pokémon cloning
Time Capsule exploit
Arbitrary code execution
Coin Case glitches
More

Other Glitch Categories
Glitches by generation
Glitches between two generations
Japan-only/language specific glitches
Music glitches
Natural glitches
Non-core series glitches
Non-Pokémon glitches
Officially acknowledged glitches
Recurring glitches
Dead glitches

References
Pokémon GameShark codes
The Big HEX List
Glitch Pokémon cries
GB programming
Curiosities
Debugging features
Easter eggs
Error traps
Glitch areas
Glitch myths
Non-glitch exploits
Placeholder texts
Pokémon glitch terminology
Unused content and prerelease information

Useful Tools
8F Helper
GBz80 to Items
Old man trick name generator
PATH (Prama's Advanced Tweaking Heaven)
Save file editors
Special stat/Pokémon converter
Trainer escape Trainer Pokémon finder

Affiliates
Legendary Star Blob 2 (Hakuda)
Pokémon Speedruns wiki
PRAMA Initiative
Become an affiliate!

Technical
Site Source Code

Search Wiki

 

Search Forums

 

Author Topic: GBZ80 - Teleportation  (Read 151 times)

0 Members and 1 Guest are viewing this topic.

Th3B0r3d

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
GBZ80 - Teleportation
« on: November 08, 2017, 12:45:24 pm »
I'm trying to make item in Pokémon red  that after using warps to predefined location. How to do such thing in assembly? (I know how to edit item's usage but I still need code that will warp you)

ISSOtm

  • The French Lord of Laziness (and a huge The Legend Of Zelda fan)
  • Wiki Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Pewter City (B)rocks !
    • View Profile
    • My Little Website
Re: GBZ80 - Teleportation
« Reply #1 on: November 09, 2017, 05:39:28 am »
What are you trying to do exactly, editing the warps in the current map ? All warps, or just one ?
"THOU SHALL NOT PASS !!"  RIVAL's effect, Gandalf.

Proudly glitching Pokémon Red and Yellow on a Black & White GB, Pocket GB, GB Color, GBA SP and new 3DS.

My Twitter (beware, I'm French)
My YouTube (same warning)

Here is an online tool to build 8F setups : GBz80 to Items !

They see me layzin', they ha-tin'...
Heavy contributor of the global augmentation of entropy (my room's is too damn high !)

Th3B0r3d

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: GBZ80 - Teleportation
« Reply #2 on: November 09, 2017, 12:53:17 pm »
I'm trying to make item that after usage warps you to some place.

ISSOtm

  • The French Lord of Laziness (and a huge The Legend Of Zelda fan)
  • Wiki Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Pewter City (B)rocks !
    • View Profile
    • My Little Website
Re: GBZ80 - Teleportation
« Reply #3 on: November 09, 2017, 06:14:07 pm »
You mean, that warps you to a given map once you use the item (but after closing the menu), right ?
"THOU SHALL NOT PASS !!"  RIVAL's effect, Gandalf.

Proudly glitching Pokémon Red and Yellow on a Black & White GB, Pocket GB, GB Color, GBA SP and new 3DS.

My Twitter (beware, I'm French)
My YouTube (same warning)

Here is an online tool to build 8F setups : GBz80 to Items !

They see me layzin', they ha-tin'...
Heavy contributor of the global augmentation of entropy (my room's is too damn high !)

Th3B0r3d

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: GBZ80 - Teleportation
« Reply #4 on: November 10, 2017, 09:03:50 am »
Yes

Evie ✿

  • Administrator
  • *****
  • Offline Offline
  • Gender: Female
    • View Profile
Re: GBZ80 - Teleportation
« Reply #5 on: November 10, 2017, 10:38:54 am »
I have an answer that's incomplete as I don't actually know without further research how to properly execute this either, sorry.

However you can try:

ld a,(map ID)
ld (d35e),a
ld h, d3
ld l, 6e
ld a,41
ld (hli),a
ld a,12 [1241 is LoadMapData in pokered disassembly]
ld (hli),a
ret

After closing the menu, this will warp you anywhere but Glitch Cities may appear depending on exactly where you warped from. Refreshing the map is also possible by placing X Attack x18 into item 41 (level-script pointer, D36E-D36F) and the map's ID into item 33 (D35E).

For more complex purposes, as Glitch Cities can appear depending on where you warp from, you may have to specify the data for these addresses in some way or get the game to look them up:

D35F-D360 = Top-left block pointer
D361 - 1 byte integer = Current Player Y-Position
D362 - 1 byte integer = Current Player X-Position
D363 = Current Player Y-Position (Current Block)
D364 = Current Player X-Position (Current Block)
D3B1 = Entrance position ID (affects D35F-D360)
D3B5 = Entrance position ID (affects D35F-D360)

(Note all of these addresses (for Red/Blue) are -1 in Yellow)

If you just want to warp and don't mind having to walk through the exit of a door, you can modify D365. This address is the location specific exits like those from Pokémon Centers and many houses take you. But the entrance position ID stays the same as the one from the original map, so you've got to find one that works, use cheat code 010xxB5D3 01xxB1D3 to modify the entrance position ID, or alternatively do this:

Change D3B1 to the entrance position ID (e.g. 01).
Change D3B2 to the desired map (or FF for the map stored in D365).

Then you need to walk through the first warp of the building. (In a Pokémon Center this should be the left-side of the exit mat).

Also for what it's worth D3AF-D3B0 are the y and x-coordinates of the warp, but you'll need a proper map tile for this to work.

Hope this helps and I hope somebody with better coding knowledge than me is able to assist. :)
« Last Edit: November 10, 2017, 10:54:56 am by Evie ✿ »
Hi! I identify as transgender female.  She/her pronouns, please.

Online I most often use the username Torchickens or Chickasaurus.



Thank you Aeriixion for the cute sprite above! :) Roelof also made different variations of the sprite (which I animated).

Contact:

Email Youtube Twitter
Skype: Torchickens
Bulbapedia Starfy Wiki

I like to collect interesting video games.
https://www.vgcollect.com/Torchickens

The psychology of birth (including spiritual birth): pain>acceptance/courage in face of pain>embracement>unconditional love and strength

Beyond all philosophies are the things that go best for you; what makes you feel content. It's important to always follow your heart, so unless you feel perfectly happy about it don't just follow something because it is popular, fits a style or is conventional. Sometimes you may reach a point you're not sure who you are, but as things settle I'm convinced things do work out in time.