2011/3/28 mattschinkel <[email protected]> > > If you have time... and I'm trying to make it as easy as possible for > you. I wrote "pixel based" block write procedures that should work on > your glcd with your cache.
OK, just for the record, cache is still having troubles, I really need to debug it before going further... > It is pixel by pixel inside > (glcd_write_pixel), but you can edit to be efficient for your glcd, > maybe even just as efficient as your current procedures. > OK > > These two procedures get defined in the glcd device library. This will > allow you to draw 8x12 font, glcd_clear_screen, and images (when 1 bit > images are supported) using glcd_common. You will not be able to draw > fonts that do not match GLCD_BLOCK_WRITE_TYPE, I haven't looked into > this yet. > OK > > Of course, I don't know much about your lcd, so I don't know for sure > if this will be useful to you in the end. > If I can write font taller than 8 pixels, it should be useful > > Adding these things will activate some new stuff in glcd_common. I > keep my fingers crossed that it will be easy for you to test! > I'll let you know :) > > You will need these constants with these values: > const GLCD_USE_BLOCK_WRITE = TRUE -- to go in your sample (somewhere > before glcd_common) or in your glcd device lib const GLCD_BLOCK_WRITE_TYPE = FONT_TOP_LEFT_HORIZONTAL -- efficient > drawing type, to go in your glcd device lib > > And these 2 procedures to go in your glcd device lib: > > -- set x1,y1,x2,y2 address for block write > var byte glcd_x1, glcd_x2, glcd_x1_start var byte glcd_y1, glcd_y2 > procedure glcd_block_set_address(byte in x1,byte in y1,byte in x2,byte > in y2) is > glcd_x1 = x1 > glcd_x2 = x2 > glcd_y1 = y1 > glcd_y2 = y2 > > glcd_x1_start = glcd_x1 > end procedure > > -- draw a color for block write. glcd_block_set_address must be called > first, then this proc many times to fill the block. > procedure glcd_block_write_color(byte in color) is > var byte save_color = glcd_pen_color > > glcd_pen_color = color glcd_write_pixel(glcd_x1, glcd_y1) > > glcd_x1 = glcd_x1 + 1 > > if glcd_x1 > glcd_x2 then > glcd_x1 = glcd_x1_start > glcd_y1 = glcd_y1 + 1 > end if > > glcd_pen_color = save_color > end procedure OK, I'll have a look when I can. What seems inefficient to me is you either use block *or* "non-block" writes. I would prefer switch to block write when used font (in the case of font usage) isn't appropriate, even unsupported by "non-block" writes. Please don't change anything regarding this :), this is just a thought, maybe just a TODO within comments ? Cheers, Seb -- You received this message because you are subscribed to the Google Groups "jallib" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jallib?hl=en.
