Tile 0x3E bump noise glitch
Posted by: Torchickens
Date: 2018-03-23 17:51:16
Source: https://github.com/pret/pokecrystal/blob/master/docs/bugs_and_glitches.md
No bump noise if standing on tile $3E
This is a bug with DoPlayerMovement.CheckWarp in engine/player_movement.asm:
; Bug: Since no case is made for STANDING here, it will check
; [.edgewarps + $ff]. This resolves to $3e at $8035a.
; This causes wd041 to be nonzero when standing on tile $3e,
; making bumps silent.
ld a, [wWalkingDirection]
; cp STANDING
; jr z, .not_warp
ld e, a
ld d, 0
ld hl, .EdgeWarps
add hl, de
ld a, [wPlayerStandingTile]
cp [hl]
jr nz, .not_warp
ld a, 1
ld [wd041], a
ld a, [wWalkingDirection]
; This is in the wrong place.
cp STANDING
jr z, .not_warp
I don't quite know how to replicate this bug and what type of tile or event the page is referring to here.
(Is it to do with things like exit mat warps?)
However the 0x3E sub-tile varies between tilesets and can easily be found with BGB.
Example:
[img]https://i.imgur.com/nfOoQC8.png[/img]
When I lock D041 to 01 the bump sound for touching a wall still persists. Setting a breakpoint to D041 on read confirms it is read while touching a wall or using a warp though.
I tried bumping into a wall while I was standing on a tree (which contains the 0x3E sub-tile on the bottom-right) but with no luck unfortunately, the 'bump' noise still occurred.
I wonder if 'tile' could be referring to objects that consist of the 'sub-tiles' in a 2x2 pattern like the sub-tiles on the VRAM viewer in the image above, but haven't been able to test if you can manipulate those. I imagine though that these may be arranged in blocks, as was the case in Generation I.
Example:
This glitch block top-left edited in is the first block, the tall grass block the second block, the greenery the third block, greenery on the left and bushes on the right the fourth block and so on.
[img]https://i.imgur.com/laI3Ktv.png[/img]
Thanks.