The bug is due to major update for user interface on 0.107u1.
See cheat.c on 0.108.
Code: Select all
void cheat_display_watches(void)
{
....
int j;
WatchInfo * info = &watchList[i];
char buf[1024];
UINT32 address = info->address;
int xOffset = 0, yOffset = 0;
int numChars;
int lineElements = 0;
....
case kWatchDisplayType_Hex:
numChars = sprintf(buf, "%.*X", kSearchByteDigitsTable[info->elementBytes], data);
ui_draw_text(buf, xOffset * ui_get_char_width('0') + info->x, yOffset * ui_get_line_height() + info->y);
xOffset += numChars;
xOffset++;
break;
In ui.c on 0.108
Code: Select all
void ui_draw_text(const char *buf, float x, float y)
float ui_get_char_width(UINT16 ch)
float ui_get_line_height(void)
Code: Select all
void ui_draw_text(const char *buf, int x, int y)
int ui_get_char_width(UINT16 ch)
int ui_get_line_height(void)
I have tried to check the string '0','a' and'A' via ui_get_char_width.
- Character Float
- '0' 0.013281
- 'a' 0.013709
- 'A' 0.017137
But info->x is "int" so that if x is 0x02 it becomes "2.000000" by "float".
And if xOffset = 0, "xOffset * ui_get_char_width('0') + info->x" = 0 * 0.013281 + 2.000000 = 2.000000.
It's too large to display into a visible area (a watchpoint is perhaps out of screen).
Code: Select all
static void t##t(WatchInfo * info, UINT32 idx)
{
if(idx > 0)
info->y = watchList[idx - 1].y + ui_get_line_height();
else
info->y = 0;
}
because ln case of "float -> int",
Especially, info->x and info->y allow to change by end-user, just like in-game watchpoint edit menu and even a cheat code.