Backport Use 1 instead of 0 as first # for pressed key display.

This commit is contained in:
bladeoner 2018-12-12 19:38:44 +01:00
parent 212ed451df
commit 53b245e4e4

View File

@ -1908,7 +1908,7 @@ static void DisplayPressedKeys (void)
int16 x = READ_WORD(buf); int16 x = READ_WORD(buf);
int16 y = READ_WORD(buf + 2); int16 y = READ_WORD(buf + 2);
uint8 buttons = buf[4]; uint8 buttons = buf[4];
sprintf(string, "#%d %d: (%03d,%03d) %c%c", port, ids[0], x, y, sprintf(string, "#%d %d: (%03d,%03d) %c%c", port + 1, ids[0] + 1, x, y,
(buttons & 0x40) ? 'L' : ' ', (buttons & 0x80) ? 'R' : ' '); (buttons & 0x40) ? 'L' : ' ', (buttons & 0x80) ? 'R' : ' ');
S9xDisplayString(string, line++, 1, false); S9xDisplayString(string, line++, 1, false);
break; break;
@ -1922,7 +1922,7 @@ static void DisplayPressedKeys (void)
int16 x = READ_WORD(buf); int16 x = READ_WORD(buf);
int16 y = READ_WORD(buf + 2); int16 y = READ_WORD(buf + 2);
uint8 buttons = buf[4]; uint8 buttons = buf[4];
sprintf(string, "#%d %d: (%03d,%03d) %c%c%c%c", port, ids[0], x, y, sprintf(string, "#%d %d: (%03d,%03d) %c%c%c%c", port + 1, ids[0] + 1, x, y,
(buttons & 0x80) ? 'F' : ' ', (buttons & 0x40) ? 'C' : ' ', (buttons & 0x80) ? 'F' : ' ', (buttons & 0x40) ? 'C' : ' ',
(buttons & 0x20) ? 'T' : ' ', (buttons & 0x10) ? 'P' : ' '); (buttons & 0x20) ? 'T' : ' ', (buttons & 0x10) ? 'P' : ' ');
S9xDisplayString(string, line++, 1, false); S9xDisplayString(string, line++, 1, false);
@ -1941,7 +1941,7 @@ static void DisplayPressedKeys (void)
uint8 buttons = buf[8]; uint8 buttons = buf[8];
bool8 offscreen1 = buf[9]; bool8 offscreen1 = buf[9];
bool8 offscreen2 = buf[10]; bool8 offscreen2 = buf[10];
sprintf(string, "#%d %d: (%03d,%03d) %c%c%c / (%03d,%03d) %c%c%c", port, ids[0], sprintf(string, "#%d %d: (%03d,%03d) %c%c%c / (%03d,%03d) %c%c%c", port + 1, ids[0] + 1,
x1, y1, (buttons & 0x80) ? 'T' : ' ', (buttons & 0x20) ? 'S' : ' ', offscreen1 ? 'O' : ' ', x1, y1, (buttons & 0x80) ? 'T' : ' ', (buttons & 0x20) ? 'S' : ' ', offscreen1 ? 'O' : ' ',
x2, y2, (buttons & 0x40) ? 'T' : ' ', (buttons & 0x10) ? 'S' : ' ', offscreen2 ? 'O' : ' '); x2, y2, (buttons & 0x40) ? 'T' : ' ', (buttons & 0x10) ? 'S' : ' ', offscreen2 ? 'O' : ' ');
S9xDisplayString(string, line++, 1, false); S9xDisplayString(string, line++, 1, false);
@ -1950,7 +1950,7 @@ static void DisplayPressedKeys (void)
case CTL_JOYPAD: case CTL_JOYPAD:
{ {
sprintf(string, "#%d %d: ", port, ids[0]); sprintf(string, "#%d %d: ", port + 1, ids[0] + 1);
uint16 pad = MovieGetJoypad(ids[0]); uint16 pad = MovieGetJoypad(ids[0]);
for (int i = 0; i < 15; i++) for (int i = 0; i < 15; i++)
{ {
@ -1969,7 +1969,7 @@ static void DisplayPressedKeys (void)
{ {
if (ids[n] != -1) if (ids[n] != -1)
{ {
sprintf(string, "#%d %d: ", port, ids[n]); sprintf(string, "#%d %d: ", port + 1, ids[n] + 1);
uint16 pad = MovieGetJoypad(ids[n]); uint16 pad = MovieGetJoypad(ids[n]);
for (int i = 0; i < 15; i++) for (int i = 0; i < 15; i++)
{ {
@ -2003,8 +2003,7 @@ static void DisplayPressedKeys (void)
case CTL_NONE: case CTL_NONE:
{ {
sprintf(string, "#%d -", port); // Display Nothing
S9xDisplayString(string, line++, 1, false);
break; break;
} }
} }