Character misalignment glitches (Generation I)
Normally, Red is positioned in the middle of the screen. This is because C104 (corresponding with the y coordinate of Red) and C106 (corresponding with the x coordinate of Red) default to 3C and 40.
If you modify these addresses, you can cause the character misalignment effect. The character misalignment effect can cause some areas to become blocked, like what happens at 2:26.
At the start of this video, I changed the map script at D36D to 7F DA for arbitrary code execution and placed Red in a wall. The new map script changes his position using the d-pad.
ld hl, D36D
ld a,7F
ldi (hl),a
ld a,DA
ldi (hl),a ; locks the script on the map
call DB00
call DC00
ret
At DB00 (check for up/down press and change C104):
ld hl,C104
ld a,(C104)
add sp,00 # Reset z flag
ld a,(FFB1)
add a,80
jr z,DB14 # Did you press down?
add a,40 # Did you press up?
jr z,DB19
ret
ld hl,C104
inc (hl)
ret
ld hl,C104
dec (hl)
ret
At DC00 (check for left/right press):
At DC00:
ld hl,C106
ld a,(C106)
add sp,00 # Reset z flag
ld a,(FFB1)
add a,E0 #Did you press left?
jr z,DC14
add a,10 #Did you press right?
jr z,DC19
ret
ld hl,C106
dec (hl)
ret
ld hl,C106
inc (hl)
ret
Next, I show an alternative way to cause character misalignment with Glitch City RAM manipulation in Pokémon Red (see https://glitchcity.wiki/Glitch_City_R...) (add ) to the URL if not in link.)
As the y coordinate byte is 3C, it will appear as a block with a tree in it at the Celadon City gym. To manipulate the C104 Glitch City, enter the gym, don't move, then perform the following steps:
1. In item 33, place TM19 x236 (or x204)
2. In item 34, place TM24 x17
(The top-left map block is now at E0EC or C0EC and we changed the map to Safari Zone which is in the same bank so doesn't freeze the game)
3. Open and close the Pokémon menu, then Red will be facing the tree. Cut it to change C104 to 0x35; misaligning the player.