X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=betty%2Fdisplay.c;h=1248279740118943e249be6c22c505a6e4946963;hb=e12850bb699b1f9088a72840f3ae93a06326ab67;hp=07fb923f5b95d3b99596f42b32b0908d8ecfe33d;hpb=5da509dc909c60d63c5fba98e7ced43040eb6827;p=my-code%2Farm.git diff --git a/betty/display.c b/betty/display.c index 07fb923..1248279 100644 --- a/betty/display.c +++ b/betty/display.c @@ -5,24 +5,159 @@ * */ +/* + * some comments on alpha blending! + * + * ... + * + */ + #include "display.h" +#include "system.h" +#include "default_logo.h" +#include "uart.h" /* * functions */ +void display_fill_screen(u8 fill) { + + u8 page,width; + u8 buf[2]; + + buf[0]=0; + buf[1]=0; + + switch(fill) { + case DISPLAY_FILL_LG: + buf[1]=0xff; + break; + case DISPLAY_FILL_DG: + buf[0]=0xff; + break; + case DISPLAY_FILL_B: + buf[0]=0xff; + buf[1]=0xff; + break; + case DISPLAY_FILL_W: + default: + break; + } + + for(page=0;page c=alpha*a+(1-alpha)*b + + a[0]=0; + a[1]=0; + switch(fill) { + case DISPLAY_FILL_LG: + a[1]=1; + break; + case DISPLAY_FILL_DG: + a[0]=1; + break; + case DISPLAY_FILL_B: + a[0]=1; + a[1]=1; + case DISPLAY_FILL_W: + default: + break; + } + + spage=y>>3; // start page = y/8 + epage=(y+h)>>3; // end page (y+h)/8 + + for(p=spage;p<=epage;p++) { + DISPLAY_SET_PAGE_ADDR(p); + for(c=x;cy+h?y+h:y+8; + for(r=y;r