Index: proj/include/graph.h
===================================================================
--- proj/include/graph.h	(revision 207)
+++ proj/include/graph.h	(revision 208)
@@ -18,6 +18,7 @@
 /// PUBLIC GET
 uint16_t   (graph_get_XRes)         (void);
 uint16_t   (graph_get_YRes)         (void);
+uint16_t   (graph_get_bytes_pixel)  (void);
 
 /// INIT
 int (graph_init)(uint16_t mode);
@@ -27,9 +28,7 @@
 
 /// PIXEL DRAWING
 int (graph_set_pixel)             (uint16_t x, uint16_t y, uint32_t color);
-int (graph_set_pixel_buffer)      (uint16_t x, uint16_t y, uint32_t color, uint8_t *buf, uint16_t W, uint16_t H);
-int (graph_set_pixel_alpha_buffer)(uint16_t x, uint16_t y, uint8_t alpha, uint8_t *alp_buf, uint16_t W, uint16_t H);
-//int (graph_set_pixel_alpha)       (uint16_t x, uint16_t y, uint32_t color, uint8_t alpha);
+void (graph_set_pixel_pos)         (unsigned pos          , uint32_t color);
 
 /// SCREEN
 int (graph_clear_screen)(void);
Index: proj/src/font.c
===================================================================
--- proj/src/font.c	(revision 207)
+++ proj/src/font.c	(revision 208)
@@ -35,22 +35,14 @@
 }
 static int (glyph_draw_to_alpha_buffer)(const glyph_t *p, int16_t x, int16_t y, uint8_t *alp_buf, uint16_t W, uint16_t H){
     if(p == NULL) return NULL_PTR;
-    int r;
     for(int16_t h = 0; h < p->h; ++h){
         for(int16_t w = 0; w < p->w; ++w){
             uint32_t c = *((uint32_t*)p->map + w + h*p->w);
             uint8_t a = GET_ALP(c);
-            //c = c & 0xFF000000;
-            //if(c != 0) printf("%d %d 0x%X\n", w, h, c);
-            //else       printf("%d %d <========================\n");
-
-            r = graph_set_pixel_alpha_buffer(x+w, y-p->h+h, a, alp_buf, W, H);
-
-
-            //r = graph_set_pixel_alpha(x+w, y-p->h+h, GET_COLOR(c), GET_ALP(c));
-
-            //printf("%d %d 0x%X\n", x, y, *(buf+(x+y*p->w)*sizeof(uint32_t)));
-            if(r != SUCCESS && r != OUT_OF_RANGE) return r;
+            
+            int16_t x_ = x+w, y_ = y-p->h+h;
+            unsigned pos = x_ +y_*W;
+            alp_buf[pos] = a;
         }
     }
     return SUCCESS;
Index: proj/src/graph.c
===================================================================
--- proj/src/graph.c	(revision 207)
+++ proj/src/graph.c	(revision 208)
@@ -29,13 +29,8 @@
 
 static vbe_mode_info_t vbe_mem_info;
 
-/// PUBLIC GET
-uint16_t   (graph_get_XRes)         (void){ return vbe_mem_info.XResolution; }
-uint16_t   (graph_get_YRes)         (void){ return vbe_mem_info.YResolution; }
-
 /// PRIVATE GET
 static uint16_t   (graph_get_bits_pixel)   (void){ return vbe_mem_info.BitsPerPixel; }
-static uint16_t   (graph_get_bytes_pixel)  (void){ return (graph_get_bits_pixel() + 7) >> 3; }
 static phys_bytes (graph_get_phys_addr)    (void){ return vbe_mem_info.PhysBasePtr; }
 static unsigned   (graph_get_vram_size)    (void){ return vbe_mem_info.XResolution * vbe_mem_info.YResolution * graph_get_bytes_pixel(); }
 //static uint16_t   (graph_get_RedMaskSize)  (void){ return vbe_mem_info.RedMaskSize  ; }
@@ -42,6 +37,12 @@
 //static uint16_t   (graph_get_GreenMaskSize)(void){ return vbe_mem_info.GreenMaskSize; }
 //static uint16_t   (graph_get_BlueMaskSize) (void){ return vbe_mem_info.BlueMaskSize ; }
 
+/// PUBLIC GET
+uint16_t   (graph_get_XRes)         (void){ return vbe_mem_info.XResolution; }
+uint16_t   (graph_get_YRes)         (void){ return vbe_mem_info.YResolution; }
+uint16_t   (graph_get_bytes_pixel)  (void){ return (graph_get_bits_pixel() + 7) >> 3; }
+
+///
 static int (get_permission)(unsigned int base_addr, unsigned int size) {
     struct minix_mem_range mmr;
     mmr.mr_base = base_addr;
@@ -244,7 +245,6 @@
 
 /// PIXEL DRAWING
 int (graph_set_pixel)(uint16_t x, uint16_t y, uint32_t color) {
-    /*
     if (x < 0 || vbe_mem_info.XResolution <= x || y < 0 || vbe_mem_info.YResolution <= y) {
         //printf("%s: invalid pixel.\n", __func__);
         return OUT_OF_RANGE;
@@ -252,56 +252,11 @@
     unsigned int pos = (x + y * vbe_mem_info.XResolution) * graph_get_bytes_pixel();
     memcpy(video_buf + pos, &color, graph_get_bytes_pixel());
     return SUCCESS;
-    */
-    return graph_set_pixel_buffer(x, y, color, video_buf, graph_get_XRes(), graph_get_YRes());
 }
-int (graph_set_pixel_buffer)(uint16_t x, uint16_t y, uint32_t color, uint8_t *buf, uint16_t W, uint16_t H) {
-    if(buf == NULL) return NULL_PTR;
-    if (x < 0 || W <= x || y < 0 || H <= y) {
-        //printf("%s: invalid pixel.\n", __func__);
-        return OUT_OF_RANGE;
-    }
-    unsigned int pos = (x + y * W) * graph_get_bytes_pixel();
-    memcpy(buf + pos, &color, graph_get_bytes_pixel());
-    return SUCCESS;
-}
-int (graph_set_pixel_alpha_buffer)(uint16_t x, uint16_t y, uint8_t alpha, uint8_t *alp_buf, uint16_t W, uint16_t H) {
-    if(alp_buf == NULL) return NULL_PTR;
-    if (x < 0 || W <= x || y < 0 || H <= y) {
-        //printf("%s: invalid pixel.\n", __func__);
-        return OUT_OF_RANGE;
-    }
-    unsigned int pos = x + y * W;
-    memcpy(alp_buf + pos, &alpha, 1);
-    return SUCCESS;
-}
-/*
-int (graph_set_pixel_alpha)(uint16_t x, uint16_t y, uint32_t color, uint8_t alpha){
-    if (x >= vbe_mem_info.XResolution || y >= vbe_mem_info.YResolution) {
-        //printf("%s: invalid pixel.\n", __func__);
-        return OUT_OF_RANGE;
-    }
-    unsigned int pos = (x + y * vbe_mem_info.XResolution) * graph_get_bytes_pixel();
-    uint32_t color_;
-    memcpy(&color_, video_buf + pos, graph_get_bytes_pixel());
-    float a = 1.0-(alpha&0xFF)/(float)0xFF;
-    uint8_t r = GET_RED(color)*a + GET_RED(color_)*(1.0-a);
-    uint8_t g = GET_GRE(color)*a + GET_GRE(color_)*(1.0-a);
-    uint8_t b = GET_BLU(color)*a + GET_BLU(color_)*(1.0-a); (void)(r*g*b);
-    //return graph_set_pixel(x,y,SET_RGB(r,g,b));
-    color = SET_RGB(r,g,b);
-    //unsigned int pos = (x + y * W) * graph_get_bytes_pixel();
+void (graph_set_pixel_pos)(unsigned pos, uint32_t color){
     memcpy(video_buf + pos, &color, graph_get_bytes_pixel());
-    return SUCCESS;
 }
-*/
-int (graph_clear_screen)(void){
-    //return graph_paint_screen(BLACK);
-    memset(video_buf, 0, graph_get_vram_size());
-    return SUCCESS;
-}
+int (graph_clear_screen)(void){ memset(video_buf, 0, graph_get_vram_size()); return SUCCESS; }
+int (graph_draw)(void){ memcpy(video_mem, video_buf, graph_get_vram_size()); return SUCCESS; }
 
-int (graph_draw)(void){
-    memcpy(video_mem, video_buf, graph_get_vram_size());
-    return 0;
-}
+/// SPRITE
Index: proj/src/sprite.c
===================================================================
--- proj/src/sprite.c	(revision 207)
+++ proj/src/sprite.c	(revision 208)
@@ -104,14 +104,15 @@
         ymin = max(ymin-2, 0); ymax = min(ymax+2, graph_get_YRes());
     }
     const uint8_t *map = basic_sprite_get_map(p->bsp);
-    int16_t u, v;
-    for(int16_t y = ymin; y < ymax; ++y){
-        for(int16_t x = xmin; x < xmax; ++x){
+    const uint16_t bytes_pixel = graph_get_bytes_pixel();
+    for(int16_t u, v, y = ymin; y < ymax; ++y){
+        unsigned pos = (xmin + y*graph_get_XRes())*bytes_pixel;
+        for(int16_t x = xmin; x < xmax; ++x, pos += bytes_pixel){
             sprite_src2pic(p, x, y, &u, &v);
             if(0 <= u && u < w && 0 <= v && v < h){
                 uint32_t c = *(uint32_t*)(map + (v*w + u)*4);
                 if(GET_ALP(c) < 0x7F)
-                    graph_set_pixel(x, y, GET_COLOR(c));
+                    graph_set_pixel_pos(pos, c);
             }
         }
     }
