struct keyboard_ *keyboard = (struct keyboard_ *)hw->data;
#ifdef DEBUG
- hw->vm->msg_cb_(MSG_DEBUG, "%s>> down:%u rfb_key:0x%04x", down, key);
+ hw->vm->msg_cb_(DCPU16_MSG_DEBUG, "%s>> down:%u rfb_key:0x%04x", down, key);
#endif /* DEBUG */
if (keysym_rfbtodcpu(key, &dcpu_key)) {
keyboard->keys_pressed[dcpu_key] = (down ? 1 : 0);
if (down) {
if ((keyboard->buf_tail + 1) % keyboard->buf_sz == keyboard->buf_head) {
- hw->vm->msg_cb_(MSG_INFO, "keyboard buffer overflow");
+ hw->vm->msg_cb_(DCPU16_MSG_INFO, "keyboard buffer overflow");
return;
}
keyboard->buf[keyboard->buf_tail] = dcpu_key;
hw->data = calloc(1, sizeof(struct keyboard_));
if (hw->data == NULL) {
- hw->vm->msg_cb_(MSG_ERROR, "%s():%s", "calloc", strerror(errno));
+ hw->vm->msg_cb_(DCPU16_MSG_ERROR, "%s():%s", "calloc", strerror(errno));
return -1;
}
((struct keyboard_ *)(hw->data))->buf = malloc(buf_sz * sizeof *((struct keyboard_ *)(hw->data))->buf);
if (((struct keyboard_ *)(hw->data))->buf == NULL) {
- hw->vm->msg_cb_(MSG_ERROR, "%s():%s", "malloc", strerror(errno));
+ hw->vm->msg_cb_(DCPU16_MSG_ERROR, "%s():%s", "malloc", strerror(errno));
free(hw->data);
hw->data = NULL;
return -1;
if (buf_sz_in) {
#ifdef DEBUG
- hw->vm->msg_cb_(MSG_DEBUG, "%s>> resizing buffer from %zu to %zu", __func__, keyboard->buf_sz, *buf_sz_in);
+ hw->vm->msg_cb_(DCPU16_MSG_DEBUG, "%s>> resizing buffer from %zu to %zu", __func__, keyboard->buf_sz, *buf_sz_in);
#endif /* DEBUG */
tmp_ptr = realloc(keyboard->buf, *buf_sz_in);
if (tmp_ptr == NULL) {
- hw->vm->msg_cb_(MSG_DEBUG, "%s():%s", "realloc", strerror(errno));
+ hw->vm->msg_cb_(DCPU16_MSG_DEBUG, "%s():%s", "realloc", strerror(errno));
return -1;
}
keyboard->buf = tmp_ptr;