When interacting with NPCs and initiating dialogue, repeatedly pressing the button quickly can lead to glitches in the text.
To prevent this issue, at the beginning of your doDrawNPCText input text, I'd suggest to add this small piece of code:
Voilà. It's a small tweak, but it should help.
To prevent this issue, at the beginning of your doDrawNPCText input text, I'd suggest to add this small piece of code:
Code:
;; checking if the text box is already displayed
LDA gameStatusByte
AND #%00000001
BEQ +continue:
;;; we also check if text box is about to be drawn / or currently drawing
LDA textQueued
AND #%00000011
BEQ +skip
JMP dontSkipNPCtext
+skip:
RTS
+continue:
Voilà. It's a small tweak, but it should help.