diff options
| author | Narishma-gb <194818981+Narishma-gb@users.noreply.github.com> | 2025-08-17 16:00:34 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-17 10:00:34 -0400 |
| commit | 126c3f33666f20a585d4d271a20a1e7270882de9 (patch) | |
| tree | b1896a844df8b5d342b145d5117c9b780c6001d9 /engine | |
| parent | Use `dname` macro to automatically pad names with `"@"` characters (#525) (diff) | |
| download | pokeyellow-126c3f33666f20a585d4d271a20a1e7270882de9.tar.gz pokeyellow-126c3f33666f20a585d4d271a20a1e7270882de9.tar.xz pokeyellow-126c3f33666f20a585d4d271a20a1e7270882de9.zip | |
Document a bug in `PrintBenchGuyText` (#523)
Diffstat (limited to 'engine')
| -rw-r--r-- | engine/events/hidden_objects/bench_guys.asm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/engine/events/hidden_objects/bench_guys.asm b/engine/events/hidden_objects/bench_guys.asm index 55090c01..e5a2a724 100644 --- a/engine/events/hidden_objects/bench_guys.asm +++ b/engine/events/hidden_objects/bench_guys.asm @@ -17,6 +17,15 @@ PrintBenchGuyText: ld b, a ld a, [wSpritePlayerStateData1FacingDirection] cp b + + ; bug: an 'inc hl' instruction is needed before looping back. When trying to + ; talk to a bench guy from above, this Sprite Facing test will fail, and the + ; next loop iteration will be misaligned within BenchGuyTextPointers table. + ; As a result, the routine will miss the terminator byte, and continue to + ; process data beyond the table boundary. + ; It seems that it will only return after starting to read data from VRAM + ; (According to Pan Docs, during PPU mode 3, reads return garbage value, + ; usually $FF). jr nz, .loop ; player isn't facing the bench guy ld a, [hl] jp PrintPredefTextID |
