Index: proj/include/ent.h
===================================================================
--- proj/include/ent.h	(revision 320)
+++ proj/include/ent.h	(revision 321)
@@ -11,16 +11,14 @@
 double (ent_get_XLength)(void);
 double (ent_get_YLength)(void);
 
-typedef enum {
-    gunner_melee  = BIT(0),
-    gunner_ranged = BIT(1),
-    gunner_player = BIT(2),
-    gunner_follow = BIT(3)
-} gunner_type;
+#define GUNNER_MELEE    BIT(0)
+#define GUNNER_RANGED   BIT(1)
+#define GUNNER_PLAYER   BIT(2)
+#define GUNNER_FOLLOW   BIT(3)
 
 struct gunner;
 typedef struct gunner gunner_t;
-gunner_t* (gunner_ctor)(basic_sprite_t *dude, basic_sprite_t *weapon, gunner_type type, int team);
+gunner_t* (gunner_ctor)(basic_sprite_t *dude, basic_sprite_t *weapon, uint16_t type, int team);
 void      (gunner_dtor)(gunner_t *p);
 void (gunner_set_pos)               (gunner_t *p, double x, double y);
 void (gunner_set_spawn)             (gunner_t *p, double x, double y);
@@ -36,7 +34,7 @@
 double  (gunner_get_curr_health)    (const gunner_t *p);
 int16_t (gunner_get_x_screen)       (const gunner_t *p);
 int16_t (gunner_get_y_screen)       (const gunner_t *p);
-gunner_type (gunner_get_type)       (const gunner_t *p);
+uint16_t (gunner_get_type)          (const gunner_t *p);
 int     (gunner_get_team)           (const gunner_t *p);
 void (gunner_draw)(gunner_t *p);
 void (gunner_draw_health)(const gunner_t *p);
@@ -66,7 +64,7 @@
 
 struct map;
 typedef struct map map_t;
-map_t* (map_ctor)(const char **background, const char **collide);
+map_t* (map_ctor)(const char *const *background, const char *const *collide);
 void   (map_dtor)(map_t *p);
 int    (map_collides_point)(const map_t *p, double x, double y);
 int    (map_collides_gunner)(const map_t *p, const gunner_t *gunner);
@@ -73,8 +71,8 @@
 int    (map_collides_bullet)(const map_t *p, const bullet_t *bullet);
 int16_t (map_get_width)   (const map_t *p);
 int16_t (map_get_height)  (const map_t *p);
-int (map_make_dijkstra)(map_t *p, int16_t x, int16_t y);
-int (map_where_to_follow)(const map_t *p, float x, float y, float *theta);
+int (map_make_dijkstra)(map_t *p, double x_, double y_);
+int (map_where_to_follow)(const map_t *p, double x, double y, double *theta);
 int (gunner_collides_bullet)(const gunner_t *shooter, const bullet_t *bull);
 double (distance_gunners)(const gunner_t *shooter1, const gunner_t *shooter2);
 int (gunner_collides_gunner)(const gunner_t *shooter1, const gunner_t *shooter2);
Index: proj/include/proj_func.h
===================================================================
--- proj/include/proj_func.h	(revision 320)
+++ proj/include/proj_func.h	(revision 321)
@@ -33,21 +33,14 @@
 
 void update_scale(void);
 
-int32_t* get_mouse_X(void);
+int16_t* get_mouse_X(void);
 
-int32_t* get_mouse_Y(void);
+int16_t* get_mouse_Y(void);
 
 void build_host_structure(host_info_t *p, gunner_t *host, gunner_t *remote, list_t *bullet_list);
 
 void build_remote_structure(remote_info_t *p, keys_t *keys, double angle);
 
-/**
- * @brief
- * @param
- * @param
- * @param
- * @return Angle
- */
 double get_mouse_angle(gunner_t *p);
 
 typedef struct timer {
Index: proj/Makefile
===================================================================
--- proj/Makefile	(revision 320)
+++ proj/Makefile	(revision 321)
@@ -12,7 +12,7 @@
 SRCS= proj.c list.c queue.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 uart.c hltp.c makecode_map.c menu.c
 IPATHS=-I./include -I./libs/graph/include -I./libs/kbc/include -I./libs/rtc/include -I./libs/timer/include -I./libs/uart/include -I./libs/classes/include -I./libs/utils/include -I./maps -I./media/xpm
 
-CPPFLAGS += -pedantic ${IPATHS} -D LCOM_MACRO -D __LCOM_OPTIMIZED_
+CPPFLAGS += -pedantic -Weverything ${IPATHS} -D LCOM_MACRO -D __LCOM_OPTIMIZED__
 
 
 DPADD += ${LIBLCF}
Index: proj/include/proj_structures.h
===================================================================
--- proj/include/proj_structures.h	(revision 320)
+++ proj/include/proj_structures.h	(revision 321)
@@ -15,7 +15,7 @@
     uint8_t lb_pressed      : 1;
 } keys_t;
 
-typedef struct __attribute__((packed)) {
+typedef struct {
     // host
     double  host_x;
     double  host_y;
@@ -39,12 +39,12 @@
     bool   *bullets_shooter; // false for host, true for remote
 } host_info_t;
 
-typedef struct __attribute__((packed)) {
+typedef struct {
     keys_t  remote_keys_pressed;
     double  remote_angle;
 } remote_info_t;
 
-typedef struct __attribute__((packed)) {
+typedef struct {
     bool   new_bullet;
 } bullet_info_t;
 
Index: proj/libs/graph/include/graph.h
===================================================================
--- proj/libs/graph/include/graph.h	(revision 320)
+++ proj/libs/graph/include/graph.h	(revision 321)
@@ -56,7 +56,7 @@
 struct basic_sprite;
 typedef struct basic_sprite basic_sprite_t;
 
-basic_sprite_t* (basic_sprite_ctor)(const char **xpm, int16_t u0, int16_t v0);
+basic_sprite_t* (basic_sprite_ctor)(const char *const *xpm, int16_t u0, int16_t v0);
 void            (basic_sprite_dtor)(basic_sprite_t *p);
 const uint8_t* (basic_sprite_get_map)(const basic_sprite_t *p);
 uint16_t       (basic_sprite_get_w)  (const basic_sprite_t *p);
Index: proj/libs/graph/src/font.c
===================================================================
--- proj/libs/graph/src/font.c	(revision 320)
+++ proj/libs/graph/src/font.c	(revision 321)
@@ -176,7 +176,6 @@
 void (text_set_halign)(text_t *p, text_halign halign  ){ p->halign = halign; }
 int16_t (text_get_x)  (const text_t *p){ return p->x; }
 int16_t (text_get_y)  (const text_t *p){ return p->y; }
-
 int (text_draw)(const text_t *p){
     if(p == NULL) return NULL_PTR;
     int ret = SUCCESS;
Index: proj/libs/graph/src/graph.c
===================================================================
--- proj/libs/graph/src/graph.c	(revision 320)
+++ proj/libs/graph/src/graph.c	(revision 321)
@@ -287,7 +287,7 @@
     uint16_t w, h;
     int16_t u0, v0;
 };
-basic_sprite_t* (basic_sprite_ctor)(const char **xpm, int16_t u0, int16_t v0){
+basic_sprite_t* (basic_sprite_ctor)(const char *const *xpm, int16_t u0, int16_t v0){
     basic_sprite_t *ret = malloc(sizeof(basic_sprite_t));
     if(ret == NULL) return NULL;
     enum xpm_image_type type = XPM_8_8_8_8;
@@ -358,8 +358,8 @@
     const basic_sprite_t *bsp;
     int16_t x, y; //position in screen
     int16_t su0, sv0;
-    float theta, s, c;
-    float scale;
+    double theta, s, c;
+    double scale;
     uint8_t *sbuf;
 };
 sprite_t* (sprite_ctor)(const basic_sprite_t *bsp){
@@ -410,8 +410,8 @@
         *u = x - p->x + p->su0;
         *v = y - p->y + p->sv0;
     }else{
-        float dx = x - p->x;
-        float dy = y - p->y;
+        double dx = x - p->x;
+        double dy = y - p->y;
         int16_t du = dx*p->c - dy*p->s - 0.5f;
         int16_t dv = dx*p->s + dy*p->c - 0.5f;
         *u = du + p->su0;
Index: proj/libs/kbc/include/kbc.h
===================================================================
--- proj/libs/kbc/include/kbc.h	(revision 320)
+++ proj/libs/kbc/include/kbc.h	(revision 321)
@@ -90,7 +90,7 @@
 
 /**
  * @brief Low-level function to issue an argument of a command
- * @param cmd argument to be issued
+ * @param arg argument to be issued
  * @return 0 if operation was successful, 1 otherwise
  */
 int (kbc_issue_arg)(uint8_t arg);
@@ -99,7 +99,7 @@
  * @brief Low-level function for reading byte from keyboard
  * Low-level function for reading byte from keyboard. Waits until output buffer
  * is full
- * @param value Pointer to variable where byte read from keyboard will be stored
+ * @param byte Pointer to variable where byte read from keyboard will be stored
  * @return 0 if operation was successful, 1 otherwise
  */
 int (kbc_read_byte)(uint8_t *byte);
Index: proj/libs/kbc/include/keyboard.h
===================================================================
--- proj/libs/kbc/include/keyboard.h	(revision 320)
+++ proj/libs/kbc/include/keyboard.h	(revision 321)
@@ -38,11 +38,12 @@
  */
 int (subscribe_kbc_interrupt)(uint8_t interrupt_bit, int *interrupt_id);
 
-uint8_t scancode[2];
-int done;
-int sz;
-int got_error_keyboard;
 
+const uint8_t* keyboard_get_scancode(void);
+int keyboard_get_done(void);
+int keyboard_get_size(void);
+int keyboard_get_error(void);
+
 void (kbc_ih)(void);
 
 int (keyboard_poll)(uint8_t bytes[], uint8_t *size);
Index: proj/libs/kbc/src/keyboard.c
===================================================================
--- proj/libs/kbc/src/keyboard.c	(revision 320)
+++ proj/libs/kbc/src/keyboard.c	(revision 321)
@@ -14,10 +14,16 @@
     return SUCCESS;
 }
 
-int done = 1;
-int sz = 1;
-int got_error_keyboard = SUCCESS;
+static uint8_t scancode[2];
+static int done = 1;
+static int sz = 1;
+static int got_error_keyboard = SUCCESS;
+const uint8_t* keyboard_get_scancode(void){ return scancode; }
+int keyboard_get_done(void){ return done; }
+int keyboard_get_size(void){ return sz; }
+int keyboard_get_error(void){return got_error_keyboard; }
 
+
 void (kbc_ih)(void) {
     if(done) { sz = 1; }
     else     sz++;
Index: proj/libs/timer/include/timer.h
===================================================================
--- proj/libs/timer/include/timer.h	(revision 320)
+++ proj/libs/timer/include/timer.h	(revision 321)
@@ -9,6 +9,6 @@
 
 int (subscribe_timer_interrupt)(uint8_t interrupt_bit, int *interrupt_id);
 
-uint32_t no_interrupts;
+uint32_t (timer_get_no_interrupts)(void);
 
 #endif //TIMER_H_INCLUDED
Index: proj/libs/timer/src/timer.c
===================================================================
--- proj/libs/timer/src/timer.c	(revision 320)
+++ proj/libs/timer/src/timer.c	(revision 321)
@@ -58,7 +58,9 @@
     return (sys_irqsetpolicy(TIMER0_IRQ, IRQ_REENABLE, interrupt_id));
 }
 
-uint32_t no_interrupts = 0;
+static uint32_t no_interrupts = 0;
 void (timer_int_handler)() {
     no_interrupts++;
 }
+
+uint32_t (timer_get_no_interrupts)(void){ return no_interrupts; }
Index: proj/libs/uart/include/uart.h
===================================================================
--- proj/libs/uart/include/uart.h	(revision 320)
+++ proj/libs/uart/include/uart.h	(revision 321)
@@ -42,7 +42,7 @@
 int uart_set_bits_per_character(int base_addr, uint8_t     bits_per_char);
 int uart_set_stop_bits         (int base_addr, uint8_t     stop         );
 int uart_set_parity            (int base_addr, uart_parity par          );
-int uart_set_bit_rate          (int base_addr, float       bit_rate     );
+int uart_set_bit_rate          (int base_addr, double      bit_rate     );
 
 int uart_enable_int_rx (int base_addr);
 int uart_disable_int_rx(int base_addr);
Index: proj/libs/uart/src/uart.c
===================================================================
--- proj/libs/uart/src/uart.c	(revision 320)
+++ proj/libs/uart/src/uart.c	(revision 321)
@@ -212,7 +212,7 @@
     conf = (conf & (~UART_PARITY)) | parity;
     return uart_set_lcr(base_addr, conf);
 }
-int uart_set_bit_rate(int base_addr, float bit_rate){
+int uart_set_bit_rate(int base_addr, double bit_rate){
     int ret = SUCCESS;
     uint16_t latch = UART_BITRATE/bit_rate;
     uint8_t dll = UART_GET_DLL(latch);
Index: proj/maps/map1.h
===================================================================
--- proj/maps/map1.h	(revision 320)
+++ proj/maps/map1.h	(revision 321)
@@ -7,10 +7,10 @@
 
 #include "xpm_utils.h"
 
-map_t* get_map1(void){
+static map_t* get_map1(void){
     char **map1         = xpm_load_xpm2("maps/map1.xpm2");
     char **map1_collide = xpm_load_xpm2("maps/map1_collide.xpm2");
-    return map_ctor((const char **)map1_xpm, (const char **)map1_collide_xpm);
+    return map_ctor((const char *const *)map1_xpm, (const char *const *)map1_collide_xpm);
     free(map1); free(map1_collide);
 }
 
Index: proj/media/xpm/bullet.h
===================================================================
--- proj/media/xpm/bullet.h	(revision 320)
+++ proj/media/xpm/bullet.h	(revision 321)
@@ -4,8 +4,8 @@
 #include "bullet.xpm"
 #include "graph.h"
 
-basic_sprite_t* get_bullet(void){
-    return basic_sprite_ctor((const char **)bullet_xpm, 3, 7);
+static basic_sprite_t* get_bullet(void){
+    return basic_sprite_ctor((const char *const *)bullet_xpm, 3, 7);
 }
 
 #endif /* end of include guard: BULLET_H_INCLUDED */
Index: proj/media/xpm/crosshair.h
===================================================================
--- proj/media/xpm/crosshair.h	(revision 320)
+++ proj/media/xpm/crosshair.h	(revision 321)
@@ -4,8 +4,8 @@
 #include "crosshair.xpm"
 #include "graph.h"
 
-basic_sprite_t* get_crosshair(){
-    return basic_sprite_ctor(crosshair_xpm, 16, 16);
+static basic_sprite_t* get_crosshair(){
+    return basic_sprite_ctor((const char *const *)crosshair_xpm, 16, 16);
 }
 
 #endif //CROSSHAIR_H_INCLUDED
Index: proj/media/xpm/crosshair.xpm
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = image/x-xpmi
Index: proj/media/xpm/nothing.h
===================================================================
--- proj/media/xpm/nothing.h	(revision 320)
+++ proj/media/xpm/nothing.h	(revision 321)
@@ -4,8 +4,8 @@
 #include "nothing.xpm"
 #include "graph.h"
 
-basic_sprite_t* get_nothing(void){
-    return basic_sprite_ctor((const char **)nothing_xpm, 34, 34);
+static basic_sprite_t* get_nothing(void){
+    return basic_sprite_ctor((const char *const *)nothing_xpm, 34, 34);
 }
 
 #endif //NOTHING_H_INCLUDED
Index: proj/media/xpm/pistol.h
===================================================================
--- proj/media/xpm/pistol.h	(revision 320)
+++ proj/media/xpm/pistol.h	(revision 321)
@@ -4,8 +4,8 @@
 #include "pistol.xpm"
 #include "graph.h"
 
-basic_sprite_t* get_pistol(void){
-    return basic_sprite_ctor((const char **)pistol_xpm, 34, 34);
+static basic_sprite_t* get_pistol(void){
+    return basic_sprite_ctor((const char *const *)pistol_xpm, 34, 34);
 }
 
 #endif //PISTOL_H_INCLUDED
Index: proj/media/xpm/shooter.h
===================================================================
--- proj/media/xpm/shooter.h	(revision 320)
+++ proj/media/xpm/shooter.h	(revision 321)
@@ -4,8 +4,8 @@
 #include "shooter.xpm"
 #include "graph.h"
 
-basic_sprite_t* get_shooter(void){
-    return basic_sprite_ctor((const char **)shooter_xpm, 34, 34);
+static basic_sprite_t* get_shooter(void){
+    return basic_sprite_ctor((const char *const *)shooter_xpm, 34, 34);
 }
 
 #endif //SHOOTER_H_INCLUDED
Index: proj/media/xpm/zombie.h
===================================================================
--- proj/media/xpm/zombie.h	(revision 320)
+++ proj/media/xpm/zombie.h	(revision 321)
@@ -4,8 +4,8 @@
 #include "zombie.xpm"
 #include "graph.h"
 
-basic_sprite_t* get_zombie(void){
-    return basic_sprite_ctor((const char **)zombie_xpm, 34, 34);
+static basic_sprite_t* get_zombie(void){
+    return basic_sprite_ctor((const char *const *)zombie_xpm, 34, 34);
 }
 
 #endif //ZOMBIE_H_INCLUDED
Index: proj/src/ent.c
===================================================================
--- proj/src/ent.c	(revision 320)
+++ proj/src/ent.c	(revision 321)
@@ -30,10 +30,10 @@
     double health, current_health;
     rectangle_t *green_bar, *red_bar;
     text_t *txt;
-    gunner_type type;
+    uint16_t type;
     int team;
 };
-gunner_t* (gunner_ctor)(basic_sprite_t *dude, basic_sprite_t *weapon, gunner_type type, int team){
+gunner_t* (gunner_ctor)(basic_sprite_t *dude, basic_sprite_t *weapon, uint16_t type, int team){
     gunner_t *ret = malloc(sizeof(gunner_t));
     if(ret == NULL) return NULL;
     ret->spawn_x = 0.0;
@@ -93,7 +93,7 @@
 double  (gunner_get_curr_health)    (const gunner_t *p){ return p->current_health; }
 int16_t (gunner_get_x_screen)       (const gunner_t *p){ return (p->x-x_origin)*scale; }
 int16_t (gunner_get_y_screen)       (const gunner_t *p){ return (p->y-y_origin)*scale; }
-gunner_type (gunner_get_type)       (const gunner_t *p){ return p->type; }
+uint16_t (gunner_get_type)          (const gunner_t *p){ return p->type; }
 int     (gunner_get_team)           (const gunner_t *p){ return p->team; }
 void (gunner_draw)(gunner_t *p){
     const int16_t x_screen = gunner_get_x_screen(p);
@@ -232,7 +232,7 @@
     }
     return 0;
 }
-map_t* (map_ctor)(const char **background, const char **collide){
+map_t* (map_ctor)(const char *const *background, const char *const *collide){
     map_t *ret = malloc(sizeof(map_t));
     if(ret == NULL) return NULL;
 
@@ -299,7 +299,8 @@
     double radius = max(sprite_get_w(shooter->dude), sprite_get_h(shooter->dude))/2.0;
     return map_collides_gunner_pos(p, gunner_get_x(shooter), gunner_get_y(shooter), radius);
 }
-int (map_make_dijkstra)(map_t *p, int16_t x, int16_t y){
+int (map_make_dijkstra)(map_t *p, double x_, double y_){
+    int16_t x = x_, y = y_;
 
     const uint16_t W = basic_sprite_get_w(p->bsp_background),
                    H = basic_sprite_get_h(p->bsp_background);
@@ -334,7 +335,7 @@
 
     return SUCCESS;
 }
-int (map_where_to_follow)(const map_t *p, float x, float y, float *theta){
+int (map_where_to_follow)(const map_t *p, double x, double y, double *theta){
     const uint16_t W = basic_sprite_get_w(p->bsp_background);
     int x_ = x, y_ = y;
     int pos = y_*W+x_;
Index: proj/src/interrupts_func.c
===================================================================
--- proj/src/interrupts_func.c	(revision 320)
+++ proj/src/interrupts_func.c	(revision 321)
@@ -77,7 +77,7 @@
     if (subscribe_kbc_interrupt(KBC_IRQ, &kbc_id)) {
         printf("%s: failed to subscribe keyboard interrupts.\n", __func__);
         if (unsubscribe_all())
-            printf("%s: failed to unsubcribe driver, unexpected behaviour is expected.\n");
+            printf("%s: failed to unsubcribe driver, unexpected behaviour is expected.\n", __func__);
         return SBCR_ERROR;
     }
     keyboard_subscribed = 1;
@@ -87,7 +87,7 @@
     if (subscribe_mouse_interrupt(MOUSE_IRQ, &mouse_id)) { // subscribes mouse interrupts in exclusive mode
         printf("%s: failed to subscribe mouse interrupts.\n", __func__);
         if (unsubscribe_all())
-            printf("%s: failed to unsubcribe driver, unexpected behaviour is expected.\n");
+            printf("%s: failed to unsubcribe driver, unexpected behaviour is expected.\n", __func__);
         return SBCR_ERROR;
     }
     mouse_subscribed = 1;
@@ -94,19 +94,19 @@
     if (sys_irqdisable(&mouse_id)) { // temporarily disables our interrupts notifications
         printf("%s: failed to disable mouse interrupts.\n", __func__);
         if (unsubscribe_all())
-            printf("%s: failed to unsubcribe driver, unexpected behaviour is expected.\n");
+            printf("%s: failed to unsubcribe driver, unexpected behaviour is expected.\n", __func__);
         return SBCR_ERROR;
     }
     if (mouse_set_data_report(true)) { // enables mouse data reporting
         printf("%s: failed to enable mouse data reporting.\n", __func__);
         if (unsubscribe_all())
-            printf("%s: failed to unsubcribe driver, unexpected behaviour is expected.\n");
+            printf("%s: failed to unsubcribe driver, unexpected behaviour is expected.\n", __func__);
         return SBCR_ERROR;
     }
     if (sys_irqenable(&mouse_id)) { // re-enables our interrupts notifications
         printf("%s: failed to enable mouse interrupts.\n", __func__);
         if (unsubscribe_all())
-            printf("%s: failed to unsubcribe driver, unexpected behaviour is expected.\n");
+            printf("%s: failed to unsubcribe driver, unexpected behaviour is expected.\n", __func__);
         return SBCR_ERROR;
     }
 
@@ -134,7 +134,7 @@
     // Unsubscribe Timer Interrupts
     if (timer_subscribed) {
         if (unsubscribe_interrupt(&timer_id)) {
-            printf("%s: failed to unsubcribe timer interrupts.\n");
+            printf("%s: failed to unsubcribe timer interrupts.\n", __func__);
             r = UNSBCR_ERROR;
         }
         timer_subscribed = 0;
@@ -143,7 +143,7 @@
     // Unsubscribe Keyboard interrupts
     if (keyboard_subscribed) {
         if (unsubscribe_interrupt(&kbc_id)) {
-            printf("%s: failed to unsubcribe keyboard interrupts.\n");
+            printf("%s: failed to unsubcribe keyboard interrupts.\n", __func__);
             r = UNSBCR_ERROR;
         }
         keyboard_subscribed = 0;
@@ -152,19 +152,19 @@
     // Unsubscribe Mouse Interrupts
     if (mouse_subscribed) {
         if (sys_irqdisable(&mouse_id)) { // temporarily disables our interrupts notifications
-            printf("%s: failed to disable mouse interrupts.\n");
+            printf("%s: failed to disable mouse interrupts.\n", __func__);
             r = UNSBCR_ERROR;
         }
         if (mouse_set_data_report(false)) { // disables mouse data reporting
-            printf("%s: failed to disable mouse data reporting.\n");
+            printf("%s: failed to disable mouse data reporting.\n", __func__);
             r = UNSBCR_ERROR;
         }
         if (sys_irqenable(&mouse_id)) { // re-enables our interrupts notifications
-            printf("%s: failed to enable mouse interrupts.\n");
+            printf("%s: failed to enable mouse interrupts.\n", __func__);
             r = UNSBCR_ERROR;
         }
         if (unsubscribe_interrupt(&mouse_id)) { // unsubscribes interrupts
-            printf("%s: failed to unsubcribe mouse interrupts.\n");
+            printf("%s: failed to unsubcribe mouse interrupts.\n", __func__);
             r = UNSBCR_ERROR;
         }
         mouse_subscribed = 0;
@@ -173,7 +173,7 @@
     // Unsubscribe UART interrupts
     if (uart_subscribed) {
         if (unsubscribe_interrupt(&uart_id)) {
-            printf("%s: failed to unsubcribe UART interrupts.\n");
+            printf("%s: failed to unsubcribe UART interrupts.\n", __func__);
             r = UNSBCR_ERROR;
         }
         uart_enable_int_rx(COM1_ADDR);
Index: proj/src/proj.c
===================================================================
--- proj/src/proj.c	(revision 320)
+++ proj/src/proj.c	(revision 321)
@@ -49,14 +49,14 @@
     return 0;
 }
 
-basic_sprite_t       *bsp_crosshair = NULL;
-basic_sprite_t       *bsp_shooter   = NULL;
-basic_sprite_t       *bsp_zombie    = NULL;
-basic_sprite_t       *bsp_pistol    = NULL;
-basic_sprite_t       *bsp_nothing   = NULL;
-basic_sprite_t       *bsp_bullet    = NULL;
-map_t                *map1          = NULL;
-sprite_t             *sp_crosshair  = NULL;
+static basic_sprite_t       *bsp_crosshair = NULL;
+static basic_sprite_t       *bsp_shooter   = NULL;
+static basic_sprite_t       *bsp_zombie    = NULL;
+static basic_sprite_t       *bsp_pistol    = NULL;
+static basic_sprite_t       *bsp_nothing   = NULL;
+static basic_sprite_t       *bsp_bullet    = NULL;
+static map_t                *map1          = NULL;
+static sprite_t             *sp_crosshair  = NULL;
 
 static int (singleplayer)(void);
 static int (multiplayer)(void);
@@ -118,7 +118,8 @@
     while (good) {
         /* Get a request message. */
         if((r = get_interrupts_vector(&int_vector))) return r;
-        for (uint32_t i = 0, n = 1; i < 32; i++, n <<= 1) {
+        uint32_t n = 1;
+        for (uint8_t i = 0; i < 32; i++, n <<= 1) {
             if (int_vector & n) {
                 interrupt_handler(i);
                 switch (i) {
@@ -142,7 +143,7 @@
 
                     break;
                     case KBC_IRQ:
-                    if ((scancode[0]) == ESC_BREAK_CODE) good = false;
+                    if (keyboard_get_scancode()[0] == ESC_BREAK_CODE) good = false;
                     case MOUSE_IRQ:
                     if (counter_mouse_ih >= 3) {
                         mouse_parse_packet(packet_mouse_ih, &pp);
@@ -182,9 +183,9 @@
     return 0;
 }
 
-host_info_t     *host_info   = NULL;
-remote_info_t   *remote_info = NULL;
-bullet_info_t   *bullet_info = NULL;
+static host_info_t     *host_info   = NULL;
+static remote_info_t   *remote_info = NULL;
+static bullet_info_t   *bullet_info = NULL;
 
 static void multiplayer_process(const uint8_t *p, const size_t sz) {
     void *dest = NULL;
@@ -202,7 +203,8 @@
             bullet_info_dtor(bullet_info);
             bullet_info = (bullet_info_t*)dest;
             break;
-        default: break;
+        case hltp_type_invalid: break;
+        case hltp_type_string : break;
     }
 }
 static int (multiplayer_host)(void);
@@ -227,7 +229,8 @@
     while (good) {
         /* Get a request message. */
         if((r = get_interrupts_vector(&int_vector))) return r;
-        for (uint32_t i = 0, n = 1; i < 32; i++, n <<= 1) {
+        uint32_t n = 1;
+        for (uint8_t i = 0; i < 32; i++, n <<= 1) {
             if (int_vector & n) {
                 interrupt_handler(i);
                 switch (i) {
@@ -250,7 +253,7 @@
 
                     break;
                     case KBC_IRQ:
-                    if ((scancode[0]) == ESC_BREAK_CODE) good = false;
+                    if (keyboard_get_scancode()[0] == ESC_BREAK_CODE) good = false;
                     case MOUSE_IRQ:
                     if (counter_mouse_ih >= 3) {
                         mouse_parse_packet(packet_mouse_ih, &pp);
@@ -279,10 +282,10 @@
 
     list_t *shooter_list = list_ctor();
 
-    gunner_t *shooter1 = gunner_ctor(bsp_shooter, bsp_pistol, gunner_player, 1); if(shooter1 == NULL) printf("Failed to get shooter1\n");
+    gunner_t *shooter1 = gunner_ctor(bsp_shooter, bsp_pistol, GUNNER_PLAYER, 1); if(shooter1 == NULL) printf("Failed to get shooter1\n");
     gunner_set_spawn(shooter1, 75, 75);
 
-    gunner_t *shooter2 = gunner_ctor(bsp_shooter, bsp_pistol, gunner_player, 2); if(shooter2 == NULL) printf("Failed to get shooter2\n");
+    gunner_t *shooter2 = gunner_ctor(bsp_shooter, bsp_pistol, GUNNER_PLAYER, 2); if(shooter2 == NULL) printf("Failed to get shooter2\n");
     gunner_set_spawn(shooter2, 975, 75);
 
     list_insert(shooter_list, list_end(shooter_list), shooter1);
@@ -314,12 +317,13 @@
     int state_1, state_2;
     while (good) {
         if ((r = get_interrupts_vector(&int_vector))) return r;
-        for (uint32_t i = 0, n = 1; i < 32; i++, n <<= 1) {
+        uint32_t n = 1;
+        for (uint8_t i = 0; i < 32; i++, n <<= 1) {
             if (int_vector & n) {
                 interrupt_handler(i);
                 switch (i) {
                     case TIMER0_IRQ:
-                    if (no_interrupts % 60 == 0) timer_update(in_game_timer);
+                    if (timer_get_no_interrupts() % 60 == 0) timer_update(in_game_timer);
 
                     update_movement(map1, shooter1, keys, shooter_list);
                     update_movement(map1, shooter2, &(remote_info->remote_keys_pressed), shooter_list);
@@ -360,7 +364,7 @@
 
                     break;
                     case KBC_IRQ:
-                    if ((scancode[0]) == ESC_BREAK_CODE) {
+                    if (keyboard_get_scancode()[0] == ESC_BREAK_CODE) {
                         good = false;
                     }
                     break;
@@ -418,10 +422,10 @@
 
     list_t *shooter_list = list_ctor();
 
-    gunner_t *shooter1 = gunner_ctor(bsp_shooter, bsp_pistol, gunner_player, 2); if(shooter1 == NULL) printf("Failed to get shooter1\n");
+    gunner_t *shooter1 = gunner_ctor(bsp_shooter, bsp_pistol, GUNNER_PLAYER, 2); if(shooter1 == NULL) printf("Failed to get shooter1\n");
     gunner_set_spawn(shooter1, 75, 75);
 
-    gunner_t *shooter2 = gunner_ctor(bsp_shooter, bsp_pistol, gunner_player, 1); if(shooter2 == NULL) printf("Failed to get shooter2\n");
+    gunner_t *shooter2 = gunner_ctor(bsp_shooter, bsp_pistol, GUNNER_PLAYER, 1); if(shooter2 == NULL) printf("Failed to get shooter2\n");
     gunner_set_spawn(shooter2, 975, 75);
 
     list_insert(shooter_list, list_end(shooter_list), shooter1);
@@ -446,12 +450,13 @@
     int good = true;
     while (good) {
         if ((r = get_interrupts_vector(&int_vector))) return r;
-        for (uint32_t i = 0, n = 1; i < 32; i++, n <<= 1) {
+        uint32_t n = 1;
+        for (uint8_t i = 0; i < 32; i++, n <<= 1) {
             if (int_vector & n) {
                 interrupt_handler(i);
                 switch (i) {
                     case TIMER0_IRQ:
-                    if (no_interrupts % 60 == 0) timer_update(in_game_timer);
+                    if (timer_get_no_interrupts() % 60 == 0) timer_update(in_game_timer);
 
                     double angle = get_mouse_angle(shooter1);
 
@@ -472,12 +477,12 @@
                     ent_set_origin(gunner_get_x(shooter1)-ent_get_XLength()/2.0,
                                    gunner_get_y(shooter1)-ent_get_YLength()/2.0);
 
-                    for (size_t i = 0; i < host_info->no_bullets; i++) {
-                        if (host_info->bullets_shooter[i]) { // remote
-                            bullet_t *bullet = bullet_ctor(shooter1, bsp_bullet, host_info->bullets_x[i], host_info->bullets_y[i], host_info->bullets_vx[i], host_info->bullets_vy[i]);
+                    for (size_t j = 0; j < host_info->no_bullets; j++) {
+                        if (host_info->bullets_shooter[j]) { // remote
+                            bullet_t *bullet = bullet_ctor(shooter1, bsp_bullet, host_info->bullets_x[j], host_info->bullets_y[j], host_info->bullets_vx[j], host_info->bullets_vy[j]);
                             list_insert(bullet_list, list_end(bullet_list), bullet);
                         } else { // host
-                            bullet_t *bullet = bullet_ctor(shooter2, bsp_bullet, host_info->bullets_x[i], host_info->bullets_y[i], host_info->bullets_vx[i], host_info->bullets_vy[i]);
+                            bullet_t *bullet = bullet_ctor(shooter2, bsp_bullet, host_info->bullets_x[j], host_info->bullets_y[j], host_info->bullets_vx[j], host_info->bullets_vy[j]);
                             list_insert(bullet_list, list_end(bullet_list), bullet);
                         }
                     }
@@ -500,7 +505,7 @@
 
                     break;
                     case KBC_IRQ:
-                    if ((scancode[0]) == ESC_BREAK_CODE) {
+                    if (keyboard_get_scancode()[0] == ESC_BREAK_CODE) {
                         good = false;
                     }
                     break;
@@ -567,7 +572,8 @@
     while (good) {
         /* Get a request message. */
         if((r = get_interrupts_vector(&int_vector))) return r;
-        for (uint32_t i = 0, n = 1; i < 32; i++, n <<= 1) {
+        uint32_t n = 1;
+        for (uint8_t i = 0; i < 32; i++, n <<= 1) {
             if (int_vector & n) {
                 interrupt_handler(i);
                 switch (i) {
@@ -590,7 +596,7 @@
 
                     break;
                     case KBC_IRQ:
-                    if ((scancode[0]) == ESC_BREAK_CODE) good = false;
+                    if (keyboard_get_scancode()[0] == ESC_BREAK_CODE) good = false;
                     case MOUSE_IRQ:
                     if (counter_mouse_ih >= 3) {
                         mouse_parse_packet(packet_mouse_ih, &pp);
@@ -618,11 +624,11 @@
 
     list_t *shooter_list = list_ctor();
 
-    gunner_t *shooter1 = gunner_ctor(bsp_shooter, bsp_pistol, gunner_player, 1); if(shooter1 == NULL) printf("Failed to get shooter1\n");
+    gunner_t *shooter1 = gunner_ctor(bsp_shooter, bsp_pistol, GUNNER_PLAYER, 1); if(shooter1 == NULL) printf("Failed to get shooter1\n");
     gunner_set_spawn(shooter1, 75, 75);
     gunner_set_pos(shooter1, 75, 75);
 
-    gunner_t *shooter2 = gunner_ctor(bsp_shooter, bsp_nothing, gunner_player, 2);
+    gunner_t *shooter2 = gunner_ctor(bsp_shooter, bsp_nothing, GUNNER_PLAYER, 2);
     gunner_set_spawn(shooter2, 975, 75);
     gunner_set_pos(shooter2, 775, 75);
 
@@ -645,7 +651,8 @@
     while (good) {
         /* Get a request message. */
         if((r = get_interrupts_vector(&int_vector))) return r;
-        for (uint32_t i = 0, n = 1; i < 32; i++, n <<= 1) {
+        uint32_t n = 1;
+        for (uint8_t i = 0; i < 32; i++, n <<= 1) {
             if(!good) break;
             if (int_vector & n) {
                 interrupt_handler(i);
@@ -652,7 +659,7 @@
                 switch (i) {
                     case TIMER0_IRQ:
 
-                    if (no_interrupts % 60 == 0) timer_update(in_game_timer);
+                    if (timer_get_no_interrupts() % 60 == 0) timer_update(in_game_timer);
                     update_movement(map1, shooter1, keys, shooter_list);
 
                     update_game_state(map1, shooter_list, bullet_list);
@@ -677,7 +684,7 @@
 
                     break;
                     case KBC_IRQ:
-                    if ((scancode[0]) == ESC_BREAK_CODE) {
+                    if (keyboard_get_scancode()[0] == ESC_BREAK_CODE) {
                         good = false;
                     }
                     break;
@@ -726,7 +733,7 @@
 
     list_t *shooter_list = list_ctor();
 
-    gunner_t *shooter1 = gunner_ctor(bsp_shooter, bsp_pistol, gunner_player, 1); if(shooter1 == NULL) printf("Failed to get shooter1\n");
+    gunner_t *shooter1 = gunner_ctor(bsp_shooter, bsp_pistol, GUNNER_PLAYER, 1); if(shooter1 == NULL) printf("Failed to get shooter1\n");
     gunner_set_spawn(shooter1, 980, 790);
     gunner_set_pos(shooter1, 980, 790);
 
@@ -749,28 +756,20 @@
 
     int health = 50;
 
-    /** #DEV */ /* {
-        gunner_t *zombie = gunner_ctor(bsp_zombie, bsp_nothing, gunner_melee | gunner_follow, 3);
-        gunner_set_health(zombie, health);
-        gunner_set_curr_health(zombie, health);
-        health *= ZOMBIE_HEALTH_FACTOR;
-        gunner_set_pos(zombie, 1100, 75);
-        list_push_back(shooter_list, zombie);
-    }*/ //\#DEV
-
     map_make_dijkstra(map1, gunner_get_x(shooter1), gunner_get_y(shooter1));
 
     while (good && !dead) {
         /* Get a request message. */
         if((r = get_interrupts_vector(&int_vector))) return r;
-        for (uint32_t i = 0, n = 1; i < 32; i++, n <<= 1) {
+        uint32_t n = 1;
+        for (uint8_t i = 0; i < 32; i++, n <<= 1) {
             if(!good || dead) break;
             if (int_vector & n) {
                 interrupt_handler(i);
                 switch (i) {
                     case TIMER0_IRQ:
-                    if (no_interrupts % 60 == 0) timer_update(in_game_timer);
-                    if (no_interrupts %  6 == 0){
+                    if (timer_get_no_interrupts() % 60 == 0) timer_update(in_game_timer);
+                    if (timer_get_no_interrupts() %  6 == 0){
                         map_make_dijkstra(map1, gunner_get_x(shooter1), gunner_get_y(shooter1));
                     }
 
@@ -791,7 +790,7 @@
                                    gunner_get_y(shooter1)-ent_get_YLength()/2.0);
 
                     while(list_size(shooter_list) < ZOMBIES_NUM+1){
-                        gunner_t *zombie = gunner_ctor(bsp_zombie, bsp_nothing, gunner_melee | gunner_follow, 3);
+                        gunner_t *zombie = gunner_ctor(bsp_zombie, bsp_nothing, GUNNER_MELEE | GUNNER_FOLLOW, 3);
                         gunner_set_health(zombie, health);
                         gunner_set_curr_health(zombie, health);
                         health *= ZOMBIE_HEALTH_FACTOR;
@@ -812,7 +811,7 @@
 
                     break;
                     case KBC_IRQ:
-                    if ((scancode[0]) == ESC_BREAK_CODE) {
+                    if (keyboard_get_scancode()[0] == ESC_BREAK_CODE) {
                         good = false;
                     }
                     break;
@@ -856,8 +855,8 @@
 
 #define CHAT_MAX_SIZE   75
 #define CHAT_MAX_NUM    19
-text_t      *t_text[CHAT_MAX_NUM] = {NULL};
-rectangle_t *r_text               =  NULL;
+static text_t      *t_text[CHAT_MAX_NUM] = {NULL};
+static rectangle_t *r_text               =  NULL;
 static void chat_process(const uint8_t *p, const size_t sz){
     char buffer2[CHAT_MAX_NUM+3];
     void *dest = NULL;
@@ -879,7 +878,10 @@
             }
         }
         break;
-        default: break;
+        case hltp_type_invalid: break;
+        case hltp_type_bullet : break;
+        case hltp_type_host   : break;
+        case hltp_type_remote : break;
     }
 }
 static int (chat)(void){
@@ -894,7 +896,7 @@
     rectangle_t *r_buffer = NULL; {
         r_buffer = rectangle_ctor(0,0,900,70);
         rectangle_set_pos(r_buffer, graph_get_XRes()/2  -rectangle_get_w(r_buffer)/2,
-        graph_get_YRes()*0.87-rectangle_get_h(r_buffer)/2);
+        (int16_t)(graph_get_YRes()*0.87-rectangle_get_h(r_buffer)/2));
         rectangle_set_fill_color   (r_buffer, GRAPH_BLACK);
         rectangle_set_outline_width(r_buffer, 2);
         rectangle_set_outline_color(r_buffer, GRAPH_WHITE);
@@ -924,7 +926,7 @@
     /** r_text */ {
     r_text = rectangle_ctor(0,0,900,550);
     rectangle_set_pos(r_text, graph_get_XRes()/2  -rectangle_get_w(r_buffer)/2,
-    graph_get_YRes()*0.09);
+    (int16_t)(graph_get_YRes()*0.09));
     rectangle_set_fill_color   (r_text, GRAPH_BLACK);
     rectangle_set_outline_width(r_text, 2);
     rectangle_set_outline_color(r_text, GRAPH_WHITE);
@@ -931,7 +933,7 @@
     rectangle_set_fill_trans(r_text, GRAPH_TRANSPARENT);
     }
     /** t_text */ {
-    for(size_t i = 0; i < CHAT_MAX_NUM; ++i){
+    for(uint16_t i = 0; i < CHAT_MAX_NUM; ++i){
         t_text[i] = text_ctor(font_get_default(), " ");
         text_set_pos(t_text[i], rectangle_get_x(r_text)+50,
         rectangle_get_y(r_text)+rectangle_get_h(r_text)-30-25*i);
@@ -947,7 +949,8 @@
 while (good) {
     /* Get a request message. */
     if((r = get_interrupts_vector(&int_vector))) return r;
-    for (uint32_t i = 0, n = 1; i < 32; i++, n <<= 1) {
+    uint32_t n = 1;
+    for (uint8_t i = 0; i < 32; i++, n <<= 1) {
         if (int_vector & n) {
             interrupt_handler(i);
             switch (i) {
@@ -960,34 +963,33 @@
                 text_draw(t_size);
 
                 rectangle_draw(r_text);
-                for(size_t i = 0; i < CHAT_MAX_NUM; ++i) text_draw(t_text[i]);
+                for(size_t j = 0; j < CHAT_MAX_NUM; ++j) text_draw(t_text[j]);
 
                 sprite_draw(sp_crosshair);
                 graph_draw();
                 break;
                 case KBC_IRQ:
-                if      (scancode[0] == ESC_BREAK_CODE) good = false;
-                else if (scancode[0] == ENTER_MAKE_CODE) {
+                if      (keyboard_get_scancode()[0] == ESC_BREAK_CODE) good = false;
+                else if (keyboard_get_scancode()[0] == ENTER_MAKE_CODE) {
                     hltp_send_string(buffer);
                     char buffer2[CHAT_MAX_SIZE+3] = "> ";
                     strncat(buffer2, buffer, strlen(buffer));
-                    for(size_t i = CHAT_MAX_NUM-1; i; --i)
-                    text_set_string(t_text[i], text_get_string(t_text[i-1]));
+                    for(size_t j = CHAT_MAX_NUM-1; j; --j) text_set_string(t_text[i], text_get_string(t_text[i-1]));
                     text_set_string(t_text[0], buffer2);
-                    for(size_t i = 0; i < CHAT_MAX_NUM; ++i){
-                        if(text_get_string(t_text[i])[0] == '>'){
-                            text_set_pos(t_text[i], rectangle_get_x(r_text)+50, text_get_y(t_text[i]));
-                            text_set_halign(t_text[i], text_halign_left);
+                    for(size_t j = 0; j < CHAT_MAX_NUM; ++j){
+                        if(text_get_string(t_text[j])[0] == '>'){
+                            text_set_pos(t_text[j], rectangle_get_x(r_text)+50, text_get_y(t_text[j]));
+                            text_set_halign(t_text[j], text_halign_left);
                         }else{
-                            text_set_pos(t_text[i], rectangle_get_x(r_text)+rectangle_get_w(r_text)-50, text_get_y(t_text[i]));
-                            text_set_halign(t_text[i], text_halign_right);
+                            text_set_pos(t_text[j], rectangle_get_x(r_text)+rectangle_get_w(r_text)-50, text_get_y(t_text[j]));
+                            text_set_halign(t_text[j], text_halign_right);
                         }
                     }
                     buffer[0] = '\0';
-                } else if(scancode[0] == BACKSPACE_MAKE_CODE){
+                } else if(keyboard_get_scancode()[0] == BACKSPACE_MAKE_CODE){
                     buffer[strlen(buffer)-1] = '\0';
                 } else {
-                    char c = map_makecode(scancode[0]);
+                    char c = map_makecode(keyboard_get_scancode()[0]);
                     if (c == ERROR_CODE) break;
                     if(strlen(buffer) < CHAT_MAX_SIZE) strncat(buffer, &c, 1);
                     else                               printf("Char limit exceeded\n");
Index: proj/src/proj_func.c
===================================================================
--- proj/src/proj_func.c	(revision 320)
+++ proj/src/proj_func.c	(revision 321)
@@ -96,8 +96,8 @@
 }
 
 void update_key_presses(void) {
-    if (sz == 1) {
-        switch(scancode[0]) {
+    if (keyboard_get_size() == 1) {
+        switch(keyboard_get_scancode()[0]) {
         case W_MAKE_CODE        : key_presses.w_pressed     = 1;        break;
         case W_BREAK_CODE       : key_presses.w_pressed     = 0;        break;
         case A_MAKE_CODE        : key_presses.a_pressed     = 1;        break;
@@ -154,11 +154,11 @@
     list_node_t *it = list_begin(shooter_list);
     while(it != list_end(shooter_list)){
         gunner_t *g = *(gunner_t**)list_node_val(it);
-        if(gunner_get_type(g) & gunner_follow){
-            float theta = 0.0;
+        if(gunner_get_type(g) & GUNNER_FOLLOW){
+            double theta = 0.0;
             map_where_to_follow(map, gunner_get_x(g), gunner_get_y(g), &theta);
-            float c = fm_cos(theta), s = fm_sin(theta);
-            float dx = ZOMBIE_SPEED*c, dy = -ZOMBIE_SPEED*s;
+            double c = fm_cos(theta), s = fm_sin(theta);
+            double dx = ZOMBIE_SPEED*c, dy = -ZOMBIE_SPEED*s;
             double x = gunner_get_x(g);
             double y = gunner_get_y(g);
             gunner_set_pos(g, x+dx, y+dy);
@@ -234,7 +234,7 @@
     list_node_t *it1 = list_begin(shooter_list);
     while(it1 != list_end(shooter_list)){
         gunner_t *s1 = *list_node_val(it1);
-        if(!(gunner_get_type(s1) & gunner_melee)){ it1 = list_node_next(it1); continue; }
+        if(!(gunner_get_type(s1) & GUNNER_MELEE)){ it1 = list_node_next(it1); continue; }
         list_node_t *it2 = list_begin(shooter_list);
         while(it2 != list_end(shooter_list)){
             gunner_t *s2 = *list_node_val(it2);
@@ -294,7 +294,7 @@
     last_minus = key_presses.minus_pressed;
 }
 
-static int32_t mouse_x = 0, mouse_y = 0;
+static int16_t mouse_x = 0, mouse_y = 0;
 
 void (update_mouse)(struct packet *p) {
     mouse_x = max(0, mouse_x + p->delta_x);
@@ -310,9 +310,9 @@
     return &key_presses;
 }
 
-int32_t* get_mouse_X(void) { return &mouse_x; }
+int16_t* get_mouse_X(void) { return &mouse_x; }
 
-int32_t* get_mouse_Y(void) { return &mouse_y; }
+int16_t* get_mouse_Y(void) { return &mouse_y; }
 
 double get_mouse_angle(gunner_t *p) {
     return atan2(gunner_get_y_screen(p) - mouse_y, mouse_x - gunner_get_x_screen(p));
