Closed tuday2 closed 3 years ago
This issue is being caused by nested SPR
calls in MajorMUD for the Top Heroes screen.
The current implementation of SPR
uses a single buffer for the result, which is reused with each subsequent call (to avoid leaking memory with each call). Because of this, the player name is sent to SPR
using the format of %s %s
, followed by their rank using %d
. Because they're using the same buffer, the same pointer is being returned by SPR
and the same value is being displayed for both Rank and Name.
The fix here is probably to establish a Ring Buffer in a dedicated segment of memory for SPR and just increment the pointer/overflow back to 0x0000
when the end of the segment is reached. This would allow up to 64k of nested SPR output with unique pointers to each value.
Module Information
Describe the bug Topten Adventurers does not show name
To Reproduce Steps to reproduce the behavior:
Expected behavior Show names of adventurers
Screenshots
Software Information: