From: hackbard Date: Sun, 16 Sep 2007 00:06:57 +0000 (+0200) Subject: basical alpha blending working (modulo minor pits) X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4018a282d71b67d91e37b81edee111ff028d66c2;p=my-code%2Farm.git basical alpha blending working (modulo minor pits) --- diff --git a/betty/betty.c b/betty/betty.c index 427d32b..8d7ce84 100644 --- a/betty/betty.c +++ b/betty/betty.c @@ -58,11 +58,11 @@ int main() { while(1) { - pause(0x05ffff); + pause(0x0fffff); /* button test! */ if(button_get_event(&button)) { - uart0_send_string(announce); + //uart0_send_string(announce); switch(button.key[0]) { case BUTTON_POWER: display_logo((u8 *)default_logo); @@ -101,10 +101,37 @@ int main() { break; case BUTTON_3: display_draw_font(70,70, - (u8 *)default_font+(0x33>>3), + (u8 *)default_font+(0x33<<3), DISPLAY_FILL_LG, 0xff); break; + case BUTTON_4: + display_font_page(23,19,(u8 *)default_font+(0x34<<3),DISPLAY_FILL_B); + break; + case BUTTON_5: + display_font_page(10,19,(u8 *)default_font+(0x35<<3),DISPLAY_FILL_DG); + break; + case BUTTON_6: + display_font_page(2,19,(u8 *)default_font+(0x36<<3),DISPLAY_FILL_LG); + break; + case BUTTON_7: + display_draw_rectangle(2,2,4,4, + DISPLAY_FILL_B, + 0xff); + break; + case BUTTON_8: + display_draw_rectangle(8,8,4,4, + DISPLAY_FILL_DG, + 0xff); + break; + case BUTTON_BETTY: + display_rectangle_page(80,15,16,2,DISPLAY_FILL_B,0x7f); + uart0_send_byte('b'); + break; + case BUTTON_EXIT: + display_rectangle_page(90,16,16,2,DISPLAY_FILL_LG,0x7f); + uart0_send_byte('e'); + break; default: display_clear_screen(); break; diff --git a/betty/display.c b/betty/display.c index a439fcd..bb74241 100644 --- a/betty/display.c +++ b/betty/display.c @@ -17,8 +17,8 @@ */ #include "display.h" -#include "system.h" -#include "default_logo.h" + +// debug #include "uart.h" /* @@ -89,21 +89,16 @@ void display_init(void) { DISPLAY_SET_ON; } -void display_load_logo(u8 *src) { +void display_logo(u8 *src) { - u8 *s; u8 page,width; - s=src; - if(s==0) - s=default_logo; - for(page=0;page>8; + buf[0]&=~(1<>1]>>row)&1) { + c[cnt]&=~(1<>1)&1)<>3);page<=((y+h)>>3);page++) { - DISPLAY_SET_PAGE_ADDR(page); - for(col=x;col