Correct displaying of text messages on the other end

This commit is contained in:
simon.kagstrom 2009-04-13 10:10:08 +00:00
parent 30b1d1601d
commit 029c4fc7a1
2 changed files with 9 additions and 4 deletions

View File

@ -528,8 +528,7 @@ void C64Display::TranslateKey(SDLKey key, bool key_up, uint8 *key_matrix,
shift_on = true;
else if (c64_key == MATRIX(1,7) || c64_key == MATRIX(6,4))
shift_on = false;
if (!key_up && this->entering_text_message &&
c64_key != MATRIX(1,7) && c64_key != MATRIX(6,4))
else if (!key_up && this->entering_text_message)
{
char c = virtual_keyboard->keycode_to_char(c64_key | (shift_on ? 0x80 : 0) );
@ -600,6 +599,8 @@ void C64Display::PollKeyboard(uint8 *key_matrix, uint8 *rev_matrix, uint8 *joyst
case SDLK_SCROLLOCK:
this->entering_text_message = !this->entering_text_message;
if (this->entering_text_message)
this->text_message[0] = '\0';
break;
case SDLK_KP_PLUS: // '+' on keypad: Increase SkipFrames

View File

@ -879,8 +879,12 @@ bool Network::DecodeUpdate(C64Display *display, uint8 *js, MOS6581 *dst)
}
break;
case TEXT_MESSAGE:
display->display_status_string((char*)p->data, 3);
break;
{
static char display_buf[80];
strncpy(display_buf, (char*)p->data, 80);
display->display_status_string(display_buf, 4);
} break;
case LIST_PEERS:
{
} break;