Index: proj/include/hltp.h
===================================================================
--- proj/include/hltp.h	(revision 268)
+++ proj/include/hltp.h	(revision 269)
@@ -1,6 +1,8 @@
 #ifndef HLTP_H_INCLUDED
 #define HLTP_H_INCLUDED
 
-int hltp_send_string(int port, const char *p);
+int hltp_send_string(int base_addr, const char *p);
 
+int hltp_get_string(int base_addr, char **p);
+
 #endif //HLTP_H_INCLUDED
Index: proj/include/nctp.h
===================================================================
--- proj/include/nctp.h	(revision 268)
+++ proj/include/nctp.h	(revision 269)
@@ -11,8 +11,8 @@
  * @param   port    Port to send message to
  * @param   num     Number of pairs of address/numbytes to send
  */
-int nctp_send(int port, size_t num, uint8_t* ptr[], size_t sz[]);
+int nctp_send(int base_addr, size_t num, uint8_t* ptr[], size_t sz[]);
 
-int ntcp_get(int port, uint8_t *dest);
+int nctp_get (int base_addr, uint8_t **dest);
 
 #endif //NCTP_H_INCLUDED
Index: proj/src/hltp.c
===================================================================
--- proj/src/hltp.c	(revision 268)
+++ proj/src/hltp.c	(revision 269)
@@ -4,12 +4,12 @@
 
 #include "nctp.h"
 
-int hltp_send_string(int port, const char *p){
-    uint8_t* ptr[] = {p};
-    size_t    sz[] = {strlen(p)};
-    return nctp_send(port, 1, ptr, sz);
+int hltp_send_string(int base_addr, const char *p){
+    uint8_t* ptr[1]; ptr[0] = (uint8_t*)p;
+    size_t    sz[1]; sz[0] = strlen(p)+1;
+    return nctp_send(base_addr, 1, ptr, sz);
 }
 
-int hltp_get_string(int port, char *p){
-    return nctp_get(port, p);
+int hltp_get_string(int base_addr, char **p){
+    return nctp_get(base_addr, (uint8_t**)p);
 }
Index: proj/src/proj.c
===================================================================
--- proj/src/proj.c	(revision 268)
+++ proj/src/proj.c	(revision 269)
@@ -31,7 +31,8 @@
 #include "list.h"
 
 #ifdef DIOGO
-    #include "test7.h"
+    #include "uart.h"
+    #include "hltp.h"
 #endif
 
 int main(int argc, char* argv[]) {
@@ -59,12 +60,14 @@
     /// subscribe interrupts
     if (subscribe_all()) { return 1; }
 
-    /// initialize graphics
-    if(graph_init(GRAPH_MODE)){
-        printf("%s: failed to initalize graphics.\n", __func__);
-        if (cleanup()) printf("%s: failed to cleanup.\n", __func__);
-        return 1;
-    }
+    #ifndef DIOGO
+        /// initialize graphics
+        if(graph_init(GRAPH_MODE)){
+            printf("%s: failed to initalize graphics.\n", __func__);
+            if (cleanup()) printf("%s: failed to cleanup.\n", __func__);
+            return 1;
+        }
+    #endif
 
     /// Load stuff
     basic_sprite_t       *bsp_crosshair = NULL;
@@ -75,11 +78,13 @@
     map_t                *map1          = NULL;
     sprite_t             *sp_crosshair  = NULL;
     {
-        graph_clear_screen();
-        text_t *txt = text_ctor(consolas, "Loading...");
-        text_draw(txt);
-        text_dtor(txt);
-        graph_draw();
+        #ifndef DIOGO
+            graph_clear_screen();
+            text_t *txt = text_ctor(consolas, "Loading...");
+            text_draw(txt);
+            text_dtor(txt);
+            graph_draw();
+        #endif
 
         bsp_crosshair = get_crosshair(); if(bsp_crosshair == NULL) printf("Failed to get crosshair\n");
         bsp_shooter   = get_shooter  (); if(bsp_shooter   == NULL) printf("Failed to get shooter\n");
@@ -136,6 +141,9 @@
     #ifndef DIOGO
         int click = 0;
     #endif
+    #ifdef DIOGO
+        char *s = NULL;
+    #endif
 
     while (game_state != EXIT) {
         /* Get a request message. */
@@ -198,11 +206,15 @@
                                 case MENU:
                                     if ((scancode[0]) == ESC_BREAK_CODE) game_state = EXIT;
 
-                                    else if ((scancode[0]) == A_MAKE_CODE) buffer[buffer_pos++] = 'A';
-
+                                    else if ((scancode[0]) == A_MAKE_CODE){
+                                        buffer[buffer_pos++] = 'A';
+                                        printf("%c", buffer[buffer_pos-1]);
+                                    }
                                     else if ((scancode[0]) == ENTER_MAKE_CODE) {
-                                        // func1
-
+                                        buffer[buffer_pos] = '\0';
+                                        printf("\nSending string -%s-\n", buffer);
+                                        printf("Send string output: %d\n",
+                                            hltp_send_string(COM1_ADDR, buffer));
                                         buffer_pos = 0;
                                     }
 
@@ -249,10 +261,12 @@
                             #endif
                             #ifdef DIOGO
                             case COM1_IRQ:
-                                char *s = NULL;
-                                hltp_get_string(1, s);
-                                printf("You've got mail: %s\n", s);
-                                break;
+                                {
+                                    printf("You've got mail");
+                                    int r = hltp_get_string(COM1_ADDR, &s);
+                                    printf(" (return code %d)", r);
+                                    printf(": -%s-\n", s);
+                                }break;
                             #endif
                             }
                         }
@@ -267,6 +281,10 @@
         }
     }
 
+    #ifdef DIOGO
+        free(s);
+    #endif
+
     while(list_size(shooter_list) > 0){
         gunner_t *p = list_erase(shooter_list, list_begin(shooter_list));
         gunner_dtor(p);
Index: proj/src/uart.c
===================================================================
--- proj/src/uart.c	(revision 268)
+++ proj/src/uart.c	(revision 269)
@@ -256,7 +256,7 @@
     return uart_set_ier(base_addr, ier);
 }
 
-static int uart_has_communication_error(int base_addr){
+/*static*/ int uart_has_communication_error(int base_addr){
     int ret;
     uint8_t lsr;
     if((ret = uart_get_lsr(base_addr, &lsr))) return 1;
@@ -305,7 +305,8 @@
     int ret;
     for(size_t k = 0; k < NCTP_TRIES; ++k){
         if((ret = nctp_send_char_poll(base_addr, c))) return ret;
-        if(nctp_expect_ok(base_addr) == SUCCESS) return SUCCESS;
+        return SUCCESS;
+        //if(nctp_expect_ok(base_addr) == SUCCESS) return SUCCESS;
     }
     return TRANS_FAILED;
 }
@@ -313,14 +314,15 @@
     int ret;
     for(size_t k = 0; k < NCTP_TRIES; ++k){
         if((ret = nctp_get_char_poll (base_addr, p))) return ret;
-        if(!uart_has_communication_error(base_addr))
-            return nctp_send_char_try(base_addr, NCTP_OK ); //If it does not have any errors
+        return SUCCESS;
+        //if(!uart_has_communication_error(base_addr))
+            //return nctp_send_char_try(base_addr, NCTP_OK ); //If it does not have any errors
     }
     if((ret = nctp_send_char_poll(base_addr, NCTP_NOK))) return ret;
     return TRANS_FAILED;
 }
 
-int nctp_send(int port, size_t num, uint8_t* ptr[], size_t sz[]){
+static int nctp_send_inner(int base_addr, size_t num, uint8_t* ptr[], size_t sz[]){
     {
         int cnt = 0;
         for(size_t i = 0; i < num; ++i){
@@ -329,19 +331,8 @@
         }
     }
 
-    int base_addr;{
-        switch(port){
-            case 1: base_addr = COM1_ADDR; break;
-            case 2: base_addr = COM2_ADDR; break;
-            default: return INVALID_ARG;
-        }
-    }
-
     int ret;
 
-    if((ret = uart_disable_int_rx(base_addr))) return ret;
-    if((ret = uart_disable_int_tx(base_addr))) return ret;
-
     if((ret = nctp_send_char_try(base_addr, NCTP_START))) return ret;
     for(size_t i = 0; i < num; ++i){
         uint8_t *p = ptr[i]; size_t s = sz[i];
@@ -353,27 +344,36 @@
 
     return SUCCESS;
 }
-int ntcp_get(int port, uint8_t *dest){
-    int base_addr;{
-        switch(port){
-            case 1: base_addr = COM1_ADDR; break;
-            case 2: base_addr = COM2_ADDR; break;
-            default: return INVALID_ARG;
-        }
-    }
+int nctp_send(int base_addr, size_t num, uint8_t* ptr[], size_t sz[]){
+    int ret;
+    if((ret = uart_disable_int_rx(base_addr))) return ret;
+    if((ret = uart_disable_int_tx(base_addr))) return ret;
+    int r = nctp_send_inner(base_addr, num, ptr, sz);
+    if((ret = uart_enable_int_rx(base_addr))) return ret;
+    if((ret = uart_disable_int_tx(base_addr))) return ret;
+    return r;
+}
 
+static int nctp_get_inner(int base_addr, uint8_t **dest){
     int ret;
-    free(dest);
-    dest = malloc(NCTP_MAX_SIZE*sizeof(uint8_t)); size_t i = 0;
-    if(dest == NULL) return NULL_PTR;
+    free(*dest);
+    *dest = malloc(NCTP_MAX_SIZE*sizeof(uint8_t)); size_t i = 0;
+    if(*dest == NULL) return NULL_PTR;
     uint8_t c;
     if((ret = nctp_get_char_try (base_addr, &c     ))) return ret;
     while(true){
         if(i >= NCTP_MAX_SIZE) return TRANS_REFUSED;
         if((ret = nctp_get_char_try (base_addr, &c))) return ret;
-        if(c == NCTP_END) break;
-        else              dest[i] = c;
-        ++i;
+        if(c == NCTP_END) return SUCCESS;
+        else              (*dest)[i++] = c;
     }
-    return SUCCESS;
 }
+int nctp_get(int base_addr, uint8_t **dest){
+    int ret;
+    if((ret = uart_disable_int_rx(base_addr))) return ret;
+    if((ret = uart_disable_int_tx(base_addr))) return ret;
+    int r = nctp_get_inner(base_addr, dest);
+    if((ret = uart_enable_int_rx(base_addr))) return ret;
+    if((ret = uart_disable_int_tx(base_addr))) return ret;
+    return r;
+}
Index: proj/DR.mk
===================================================================
--- proj/DR.mk	(revision 268)
+++ proj/DR.mk	(revision 269)
@@ -2,7 +2,7 @@
 
 .PATH: ${.CURDIR}/src
 
-SRCS= proj.c list.c graph.c kbc.c keyboard.c mouse.c utils.c timer.c interrupts_func.c proj_func.c fast_math.c rectangle.c font.c xpm_utils.c ent.c rtc.c test7.c uart.c
+SRCS= proj.c list.c graph.c kbc.c keyboard.c mouse.c utils.c timer.c interrupts_func.c proj_func.c fast_math.c rectangle.c font.c xpm_utils.c ent.c rtc.c test7.c uart.c hltp.c
 
 CPPFLAGS += -pedantic -I./include -I./maps -I./media/xpm -D LCOM_MACRO -D DIOGO #-D __LCOM_OPTIMIZED_
 
Index: proj/Makefile
===================================================================
--- proj/Makefile	(revision 268)
+++ proj/Makefile	(revision 269)
@@ -2,7 +2,7 @@
 
 .PATH: ${.CURDIR}/src
 
-SRCS= proj.c list.c graph.c kbc.c keyboard.c mouse.c utils.c timer.c interrupts_func.c proj_func.c fast_math.c rectangle.c font.c xpm_utils.c ent.c rtc.c test7.c uart.c
+SRCS= proj.c list.c graph.c kbc.c keyboard.c mouse.c utils.c timer.c interrupts_func.c proj_func.c fast_math.c rectangle.c font.c xpm_utils.c ent.c rtc.c test7.c uart.c hltp.c
 
 CPPFLAGS += -pedantic -I./include -I./maps -I./media/xpm -D LCOM_MACRO -D __LCOM_OPTIMIZED_
 
Index: proj/TB.mk
===================================================================
--- proj/TB.mk	(revision 268)
+++ proj/TB.mk	(revision 269)
@@ -2,7 +2,7 @@
 
 .PATH: ${.CURDIR}/src
 
-SRCS= proj.c list.c graph.c kbc.c keyboard.c mouse.c utils.c timer.c interrupts_func.c proj_func.c fast_math.c rectangle.c font.c xpm_utils.c ent.c rtc.c test7.c uart.c
+SRCS= proj.c list.c graph.c kbc.c keyboard.c mouse.c utils.c timer.c interrupts_func.c proj_func.c fast_math.c rectangle.c font.c xpm_utils.c ent.c rtc.c test7.c uart.c hltp.c
 
 CPPFLAGS += -pedantic -I./include -I./maps -I./media/xpm -D LCOM_MACRO -D TELMO #-D __LCOM_OPTIMIZED_
 
