Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Blit from Flash
Author | Message | ||||
vegipete Guru Joined: 29/01/2013 Location: CanadaPosts: 1109 |
Peter's sample code for copying sprites from CSUB data in flash is very useful. The MMBasic code Local y%=yin% * 24 * w% is remarkable similar to the source codeLocal x%=xin%*12 Local b%=MM.Info(writebuff)+x%+y% Local a%=c%+s%*288 For yy%=0 To 23 Memory copy a%, b%,12 Inc b%,w% Inc a%,12 Next start_x1 = x1 + w - max_x; at the end of the cmd_blit(void) routine in the file Draw.cstart_x2 = x2 + w - max_x; while(w > max_x){ ReadBufferFast(start_x1, y1, start_x1 + max_x - 1, y1 + h - 1, buff); DrawBufferFast(start_x2, y2, start_x2 + max_x - 1, y2 + h - 1, -1, buff); w -= max_x; start_x1 -= max_x; start_x2 -= max_x; } If you squint, there are also similarities with the routine DrawBitmapColour() and the MMBasic command GUI BITMAP. This blather is a lead-up to wondering if it could be possible to have a variation of the blit command that pulls the source data from a CSUB all in one go. Visit Vegipete's *Mite Library for cool programs. |
||||
Print this page |